commit 0dd3ee31125508cd67f7e7172247f05b7fd1753a Author: Linus Torvalds Date: Sun Jan 7 12:18:38 2024 -0800 Linux 6.7 commit 52b1853b080a082ec3749c3a9577f6c71b1d4a90 Merge: 95c8a35f1c017 a3368e1186e3c Author: Linus Torvalds Date: Sat Jan 6 11:35:37 2024 -0800 Merge tag 'i2c-for-6.7-final' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "Improve the detection when to run atomic transfer handlers for kernels with preemption disabled. This removes some false positive splats a number of users were seeing if their driver didn't have support for atomic transfers. Also, fix a typo in the docs while we are here" * tag 'i2c-for-6.7-final' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: core: Fix atomic xfer check for non-preempt config Documentation/i2c: fix spelling error in i2c-address-translators commit a3368e1186e3ce8e38f78cbca019622095b1f331 Author: Benjamin Bara Date: Thu Jan 4 09:17:08 2024 +0100 i2c: core: Fix atomic xfer check for non-preempt config Since commit aa49c90894d0 ("i2c: core: Run atomic i2c xfer when !preemptible"), the whole reboot/power off sequence on non-preempt kernels is using atomic i2c xfer, as !preemptible() always results to 1. During device_shutdown(), the i2c might be used a lot and not all busses have implemented an atomic xfer handler. This results in a lot of avoidable noise, like: [ 12.687169] No atomic I2C transfer handler for 'i2c-0' [ 12.692313] WARNING: CPU: 6 PID: 275 at drivers/i2c/i2c-core.h:40 i2c_smbus_xfer+0x100/0x118 ... Fix this by allowing non-atomic xfer when the interrupts are enabled, as it was before. Link: https://lore.kernel.org/r/20231222230106.73f030a5@yea Link: https://lore.kernel.org/r/20240102150350.3180741-1-mwalle@kernel.org Link: https://lore.kernel.org/linux-i2c/13271b9b-4132-46ef-abf8-2c311967bb46@mailbox.org/ Fixes: aa49c90894d0 ("i2c: core: Run atomic i2c xfer when !preemptible") Cc: stable@vger.kernel.org # v5.2+ Signed-off-by: Benjamin Bara Tested-by: Michael Walle Tested-by: Tor Vic [wsa: removed a comment which needs more work, code is ok] Signed-off-by: Wolfram Sang commit 95c8a35f1c017327eab3b6a2ff5c04255737c856 Merge: 0d3ac66ed81cb 7fba9420b7265 Author: Linus Torvalds Date: Fri Jan 5 13:46:18 2024 -0800 Merge tag 'mm-hotfixes-stable-2024-01-05-11-35' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc mm fixes from Andrew Morton: "12 hotfixes. Two are cc:stable and the remainder either address post-6.7 issues or aren't considered necessary for earlier kernel versions" * tag 'mm-hotfixes-stable-2024-01-05-11-35' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mm: shrinker: use kvzalloc_node() from expand_one_shrinker_info() mailmap: add entries for Mathieu Othacehe MAINTAINERS: change vmware.com addresses to broadcom.com arch/mm/fault: fix major fault accounting when retrying under per-VMA lock mm/mglru: skip special VMAs in lru_gen_look_around() MAINTAINERS: hand over hwpoison maintainership to Miaohe Lin MAINTAINERS: remove hugetlb maintainer Mike Kravetz mm: fix unmap_mapping_range high bits shift bug mm: memcg: fix split queue list crash when large folio migration mm: fix arithmetic for max_prop_frac when setting max_ratio mm: fix arithmetic for bdi min_ratio mm: align larger anonymous mappings on THP boundaries commit 0d3ac66ed81cb7c0aa78fceec9fb0dbe384992ed Merge: a4ab2706bb128 64e6304169f1e Author: Linus Torvalds Date: Fri Jan 5 13:12:29 2024 -0800 Merge tag 'nfsd-6.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fix from Chuck Lever: - Fix another regression in the NFSD administrative API * tag 'nfsd-6.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: drop the nfsd_put helper commit a4ab2706bb1280693e7dff1c5c42a8cb9d70c177 Merge: 6c23529c08fc7 ac9184fbb8478 Author: Linus Torvalds Date: Fri Jan 5 12:26:26 2024 -0800 Merge tag 'firewire-fixes-6.7-final' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394 Pull firewire fix from Takashi Sakamoto: "A single patch to suppress unexpected system reboot in AMD Ryzen machines with PCIe card consisting of Asmedia ASM1083/1085 and VT6306/6307/6308. When the 1394 OHCI driver for the card accesses a specific register in PCI memory space, the system reboot often occurs. The issue affects all versions of Linux kernel as long as the 1394 OHCI driver is included. The mechanism of unexpected system reboot is not clear, so the driver is changed to avoid the access itself when detecting the combination of hardware" * tag 'firewire-fixes-6.7-final' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: firewire: ohci: suppress unexpected system reboot in AMD Ryzen machines and ASM108x/VT630x PCIe cards commit 6c23529c08fc7539a04c9c9222ab189fcd982e8e Merge: 2b5bd1498da55 8abf77c88929b Author: Linus Torvalds Date: Fri Jan 5 12:12:33 2024 -0800 Merge tag 'mmc-v6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: "MMC core: - Fix releasing the host by canceling the delayed work - Fix pause retune on all RPMB partitions MMC host: - meson-mx-sdhc: Fix HW hang during card initialization - sdhci-sprd: Fix eMMC init failure after HW reset" * tag 'mmc-v6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-sprd: Fix eMMC init failure after hw reset mmc: core: Cancel delayed work before releasing host mmc: rpmb: fixes pause retune on all RPMB partitions. mmc: meson-mx-sdhc: Fix initialization frozen issue commit 2b5bd1498da5537e3d130b3862bccdd9aedd6c84 Merge: 6d0dc8559c847 eb284f4b37817 Author: Linus Torvalds Date: Fri Jan 5 12:02:20 2024 -0800 Merge tag 'drm-fixes-2024-01-05' of git://anongit.freedesktop.org/drm/drm Pull more drm fixes from Dave Airlie: "The amdgpu ones are fairly normal, the one that is a bit large is a fix for a newly introduced IP in 6.7 so unlikely to cause regressions. The nouveau ones are mostly memory leaks and debugging cleanups from the GSP (new nvidia firmware) enablement. There are some GSP changes to the message passing code and a subsequent fix for eDP panel turn on, that means my laptop can turn on the panel in GSP mode. These are fairly low chance of disrupting things since GSP is new in 6.7. The final not all in GSP fix is a deadlock seen with i915/nouveau when GSP is used where the the fence and irq paths have locking inversions, I've pushed some irq enablement out to a workqueue, and this has seen some fairly decent testing. amdgpu: - DP MST fix - SMU 13.0.6 fixes - fix displays on macbooks using vega12 - fix VSC and colorimetry on DP/eDP nouveau: - fix deadlock between fence signalling and irq paths - fix GSP memory leaks - fix GSP leftover debug - hide some GSP callback messages - fix GSP display disable path - fix GSP ACPI interaction - handle errors in ctrl messages - use errors info to fix DP link training" * tag 'drm-fixes-2024-01-05' of git://anongit.freedesktop.org/drm/drm: drm/nouveau/dp: Honor GSP link training retry timeouts nouveau: push event block/allowing out of the fence context nouveau/gsp: always free the alloc messages on r535 nouveau/gsp: don't free ctrl messages on errors nouveau/gsp: convert gsp errors to generic errors drm/nouveau/gsp: Fix ACPI MXDM/MXDS method invocations nouveau/gsp: free userd allocation. nouveau/gsp: free acpi object after use nouveau: fix disp disabling with GSP nouveau/gsp: drop some acpi related debug nouveau/gsp: add three notifier callbacks that we see in normal operation (v2) drm/amd/pm: Use gpu_metrics_v1_5 for SMUv13.0.6 drm/amd/pm: Add gpu_metrics_v1_5 drm/amd/pm: Add mem_busy_percent for GCv9.4.3 apu drm/amd/display: Fix sending VSC (+ colorimetry) packets for DP/eDP displays without PSR drm/amdgpu: skip gpu_info fw loading on navi12 drm/amd/display: add nv12 bounding box drm/amd/pm: Update metric table for jpeg/vcn data drm/amd/pm: Use separate metric table for APU drm/amd/display: pbn_div need be updated for hotplug event commit 7fba9420b726561966e1671004df60a08b39beb3 Author: Tetsuo Handa Date: Wed Jan 3 10:52:22 2024 +0900 mm: shrinker: use kvzalloc_node() from expand_one_shrinker_info() syzbot is reporting uninit-value at shrinker_alloc(), for commit 307bececcd12 ("mm: shrinker: add a secondary array for shrinker_info::{map, nr_deferred}") which assumed that the ->unit was allocated with __GFP_ZERO forgot to replace kvmalloc_node() in expand_one_shrinker_info() with kvzalloc_node(). Link: https://lkml.kernel.org/r/9226cc0a-10e0-4489-80c5-58c3b5b4359c@I-love.SAKURA.ne.jp Reported-by: syzbot Closes: https://syzkaller.appspot.com/bug?extid=1e0ed05798af62917464 Fixes: 307bececcd12 ("mm: shrinker: add a secondary array for shrinker_info::{map, nr_deferred}") Signed-off-by: Tetsuo Handa Acked-by: Qi Zheng Cc: Muchun Song Signed-off-by: Andrew Morton commit 6d0dc8559c847e2dcd66c5dd93dbab3d3d887ff5 Merge: 7987b8b75f1b0 643fe70e7bcdc Author: Linus Torvalds Date: Fri Jan 5 09:39:24 2024 -0800 Merge tag 'soc-fixes-6.7-3a' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "These are two correctness fixes for handing DT input in the Allwinner (sunxi) SMP startup code" * tag 'soc-fixes-6.7-3a' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: ARM: sun9i: smp: fix return code check of of_property_match_string ARM: sun9i: smp: Fix array-index-out-of-bounds read in sunxi_mc_smp_init commit 7987b8b75f1b0d00483629a0ba006dac81e227c8 Merge: 7131c2e9bba7a 971079464001c Author: Linus Torvalds Date: Fri Jan 5 09:16:15 2024 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fix from Paolo Bonzini: - Fix boolean logic in intel_guest_get_msrs * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86/pmu: fix masking logic for MSR_CORE_PERF_GLOBAL_CTRL commit 7131c2e9bba7aef8669fc8b21a52de5cf134b010 Merge: 3eca89454aec4 f5d03da48d062 Author: Linus Torvalds Date: Fri Jan 5 09:07:59 2024 -0800 Merge tag 'probes-fixes-v6.7-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull kprobes/x86 fix from Masami Hiramatsu: - Fix to emulate indirect call which size is not 5 byte. Current code expects the indirect call instructions are 5 bytes, but that is incorrect. Usually indirect call based on register is shorter than that, thus the emulation causes a kernel crash by accessing wrong instruction boundary. This uses the instruction size to calculate the return address correctly. * tag 'probes-fixes-v6.7-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: x86/kprobes: fix incorrect return address calculation in kprobe_emulate_call_indirect commit 3eca89454aec4278c0debc918b4978a3f4a0581e Merge: 1f874787ed9a2 09eeb0723f219 Author: Linus Torvalds Date: Fri Jan 5 08:52:25 2024 -0800 Merge tag '6.7-rc8-smb3-mchan-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fixes from Steve French: "Three important multichannel smb3 client fixes found in recent testing: - fix oops due to incorrect refcounting of interfaces after disabling multichannel - fix possible unrecoverable session state after disabling multichannel with active sessions - fix two places that were missing use of chan_lock" * tag '6.7-rc8-smb3-mchan-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: do not depend on release_iface for maintaining iface_list cifs: cifs_chan_is_iface_active should be called with chan_lock held cifs: after disabling multichannel, mark tcon for reconnect commit ac9184fbb8478dab4a0724b279f94956b69be827 Author: Takashi Sakamoto Date: Tue Jan 2 20:01:50 2024 +0900 firewire: ohci: suppress unexpected system reboot in AMD Ryzen machines and ASM108x/VT630x PCIe cards VIA VT6306/6307/6308 provides PCI interface compliant to 1394 OHCI. When the hardware is combined with Asmedia ASM1083/1085 PCIe-to-PCI bus bridge, it appears that accesses to its 'Isochronous Cycle Timer' register (offset 0xf0 on PCI memory space) often causes unexpected system reboot in any type of AMD Ryzen machine (both 0x17 and 0x19 families). It does not appears in the other type of machine (AMD pre-Ryzen machine, Intel machine, at least), or in the other OHCI 1394 hardware (e.g. Texas Instruments). The issue explicitly appears at a commit dcadfd7f7c74 ("firewire: core: use union for callback of transaction completion") added to v6.5 kernel. It changed 1394 OHCI driver to access to the register every time to dispatch local asynchronous transaction. However, the issue exists in older version of kernel as long as it runs in AMD Ryzen machine, since the access to the register is required to maintain bus time. It is not hard to imagine that users experience the unexpected system reboot when generating bus reset by plugging any devices in, or reading the register by time-aware application programs; e.g. audio sample processing. This commit suppresses the unexpected system reboot in the combination of hardware. It avoids the access itself. As a result, the software stack can not provide the hardware time anymore to unit drivers, userspace applications, and nodes in the same IEEE 1394 bus. It brings apparent disadvantage since time-aware application programs require it, while time-unaware applications are available again; e.g. sbp2. Cc: stable@vger.kernel.org Reported-by: Jiri Slaby Closes: https://bugzilla.suse.com/show_bug.cgi?id=1215436 Reported-by: Mario Limonciello Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217994 Reported-by: Tobias Gruetzmacher Closes: https://sourceforge.net/p/linux1394/mailman/message/58711901/ Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2240973 Closes: https://bugs.launchpad.net/linux/+bug/2043905 Link: https://lore.kernel.org/r/20240102110150.244475-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto commit 64e6304169f1e1f078e7f0798033f80a7fb0ea46 Author: Jeff Layton Date: Wed Jan 3 08:36:52 2024 -0500 nfsd: drop the nfsd_put helper It's not safe to call nfsd_put once nfsd_last_thread has been called, as that function will zero out the nn->nfsd_serv pointer. Drop the nfsd_put helper altogether and open-code the svc_put in its callers instead. That allows us to not be reliant on the value of that pointer when handling an error. Fixes: 2a501f55cd64 ("nfsd: call nfsd_last_thread() before final nfsd_put()") Reported-by: Zhi Li Cc: NeilBrown Signed-off-by: Jeffrey Layton Signed-off-by: Chuck Lever commit eb284f4b37817d2038fdfe1a9d51769730ab7b5f Author: Lyude Paul Date: Fri Dec 22 14:32:00 2023 +1000 drm/nouveau/dp: Honor GSP link training retry timeouts Turns out that one of the ways that Nvidia's driver handles the pre-LT timeout for eDP panels is by providing a retry timeout in their link training callbacks that we're expected to wait for. Up until now we didn't pay any attention to this parameter. So, start honoring the timeout if link training fails - and retry up to 3 times. The "3 times" bit comes from OpenRM's link training code. [airlied: this fixes the panel on one of my laptops] Signed-off-by: Lyude Paul Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-12-airlied@gmail.com commit eacabb5462717a52fccbbbba458365a4f5e61f35 Author: Dave Airlie Date: Fri Dec 22 14:31:59 2023 +1000 nouveau: push event block/allowing out of the fence context There is a deadlock between the irq and fctx locks, the irq handling takes irq then fctx lock the fence signalling takes fctx then irq lock This splits the fence signalling path so the code that hits the irq lock is done in a separate work queue. This seems to fix crashes/hangs when using nouveau gsp with i915 primary GPU. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-11-airlied@gmail.com commit 9c9dd22ba5d747cceee3d1b1757448b5c48ac705 Author: Dave Airlie Date: Fri Dec 22 14:31:58 2023 +1000 nouveau/gsp: always free the alloc messages on r535 Fixes a memory leak seen with kmemleak. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-10-airlied@gmail.com commit 4ae3a20102b20d1927737e1a78615386d58e194d Author: Dave Airlie Date: Fri Dec 22 14:31:57 2023 +1000 nouveau/gsp: don't free ctrl messages on errors It looks like for some messages the upper layers need to get access to the results of the message so we can interpret it. Rework the ctrl push interface to not free things and cleanup properly whereever it errors out. Requested-by: Lyude Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-9-airlied@gmail.com commit 59f6a3d8db2573aba994b95074d8f9911c969bcb Author: Dave Airlie Date: Fri Dec 22 14:31:56 2023 +1000 nouveau/gsp: convert gsp errors to generic errors This should let the upper layers retry as needed on EAGAIN. There may be other values we will care about in the future, but this covers our present needs. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-8-airlied@gmail.com commit cf22fc2846cee83061082fa373574d6cdeb4c006 Author: Lyude Paul Date: Fri Dec 22 14:31:55 2023 +1000 drm/nouveau/gsp: Fix ACPI MXDM/MXDS method invocations Currently we get an error from ACPI because both of these arguments expect a single argument, and we don't provide one. I'm not totally clear on what that argument does, but we're able to find the missing value from _acpiCacheMethodData() in src/kernel/platform/acpi_common.c in nvidia's driver. So, let's add that - which doesn't get eDP displays to power on quite yet, but gets rid of the argument warning at least. Signed-off-by: Lyude Paul Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-7-airlied@gmail.com commit 3108cc03236b54c56e34de01227cdacf764c50a8 Author: Dave Airlie Date: Fri Dec 22 14:31:54 2023 +1000 nouveau/gsp: free userd allocation. This was being leaked. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-6-airlied@gmail.com commit a9b9b42b54b2c9251144b3b9d4ebcd83e5f8c230 Author: Dave Airlie Date: Fri Dec 22 14:31:53 2023 +1000 nouveau/gsp: free acpi object after use This fixes a memory leak for the acpi dod object. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-5-airlied@gmail.com commit 7854ea0e408d7f2e8faaada1773f3ddf9cb538f5 Author: Dave Airlie Date: Fri Dec 22 14:31:52 2023 +1000 nouveau: fix disp disabling with GSP This func ptr here is normally static allocation, but gsp r535 uses a dynamic pointer, so we need to handle that better. This fixes a crash with GSP when you use config=disp=0 to avoid disp problems. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-4-airlied@gmail.com commit 34ce62a51e65a8b1fce0eb64dea2719c9429b306 Author: Dave Airlie Date: Fri Dec 22 14:31:51 2023 +1000 nouveau/gsp: drop some acpi related debug These were leftover debug, if we need to bring them back do so for debugging later. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-3-airlied@gmail.com commit 24ab185d9804e48041b370fa9354d6d941ce0a32 Author: Dave Airlie Date: Fri Dec 22 14:31:50 2023 +1000 nouveau/gsp: add three notifier callbacks that we see in normal operation (v2) Add NULL callbacks for some things GSP calls that we don't handle, but know about so we avoid the logging. v2: Timur suggested allowing null fn. Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-2-airlied@gmail.com commit ed9895d8d45af78866acea5f5b42f6041abc9d4a Merge: faa21f4c20960 f71cee97a644a Author: Dave Airlie Date: Fri Jan 5 11:28:34 2024 +1000 Merge tag 'amd-drm-fixes-6.7-2024-01-04' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amdgpu: - DP MST fix - SMU 13.0.6 fixes - Fix displays on macbooks using vega12 - Fix VSC and colorimetry on DP/eDP Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20240104152139.4931-1-alexander.deucher@amd.com commit 1f874787ed9a2d78ed59cb21d0d90ac0178eceb0 Merge: a476aae3f1dc7 4c8530dc7d7da Author: Linus Torvalds Date: Thu Jan 4 16:34:50 2024 -0800 Merge tag 'net-6.7-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from wireless and netfilter. We haven't accumulated much over the break. If it wasn't for the uninterrupted stream of fixes for Intel drivers this PR would be very slim. There was a handful of user reports, however, either they stood out because of the lower traffic or users have had more time to test over the break. The ones which are v6.7-relevant should be wrapped up. Current release - regressions: - Revert "net: ipv6/addrconf: clamp preferred_lft to the minimum required", it caused issues on networks where routers send prefixes with preferred_lft=0 - wifi: - iwlwifi: pcie: don't synchronize IRQs from IRQ, prevent deadlock - mac80211: fix re-adding debugfs entries during reconfiguration Current release - new code bugs: - tcp: print AO/MD5 messages only if there are any keys Previous releases - regressions: - virtio_net: fix missing dma unmap for resize, prevent OOM Previous releases - always broken: - mptcp: prevent tcp diag from closing listener subflows - nf_tables: - set transport header offset for egress hook, fix IPv4 mangling - skip set commit for deleted/destroyed sets, avoid double deactivation - nat: make sure action is set for all ct states, fix openvswitch matching on ICMP packets in related state - eth: mlxbf_gige: fix receive hang under heavy traffic - eth: r8169: fix PCI error on system resume for RTL8168FP - net: add missing getsockopt(SO_TIMESTAMPING_NEW) and cmsg handling" * tag 'net-6.7-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (52 commits) net/tcp: Only produce AO/MD5 logs if there are any keys net: Implement missing SO_TIMESTAMPING_NEW cmsg support bnxt_en: Remove mis-applied code from bnxt_cfg_ntp_filters() net: ravb: Wait for operating mode to be applied asix: Add check for usbnet_get_endpoints octeontx2-af: Re-enable MAC TX in otx2_stop processing octeontx2-af: Always configure NIX TX link credits based on max frame size net/smc: fix invalid link access in dumping SMC-R connections net/qla3xxx: fix potential memleak in ql_alloc_buffer_queues virtio_net: fix missing dma unmap for resize igc: Fix hicredit calculation ice: fix Get link status data length i40e: Restore VF MSI-X state during PCI reset i40e: fix use-after-free in i40e_aqc_add_filters() net: Save and restore msg_namelen in sock_sendmsg netfilter: nft_immediate: drop chain reference counter on error netfilter: nf_nat: fix action not being set for all ct states net: bcmgenet: Fix FCS generation for fragmented skbuffs mptcp: prevent tcp diag from closing listener subflows MAINTAINERS: add Geliang as reviewer for MPTCP ... commit a476aae3f1dc78a162a0d2e7945feea7d2b29401 Author: Linus Torvalds Date: Tue Jun 27 13:55:32 2023 -0700 x86/csum: clean up `csum_partial' further Commit 688eb8191b47 ("x86/csum: Improve performance of `csum_partial`") ended up improving the code generation for the IP csum calculations, and in particular special-casing the 40-byte case that is a hot case for IPv6 headers. It then had _another_ special case for the 64-byte unrolled loop, which did two chains of 32-byte blocks, which allows modern CPU's to improve performance by doing the chains in parallel thanks to renaming the carry flag. This just unifies the special cases and combines them into just one single helper the 40-byte csum case, and replaces the 64-byte case by a 80-byte case that just does that single helper twice. It avoids having all these different versions of inline assembly, and actually improved performance further in my tests. There was never anything magical about the 64-byte unrolled case, even though it happens to be a common size (and typically is the cacheline size). Signed-off-by: Linus Torvalds commit 5d4acb62853abac1da2deebcb1c1c5b79219bf3b Author: Noah Goldstein Date: Sun Sep 24 09:35:49 2023 -0500 x86/csum: Remove unnecessary odd handling The special case for odd aligned buffers is unnecessary and mostly just adds overhead. Aligned buffers is the expectations, and even for unaligned buffer, the only case that was helped is if the buffer was 1-byte from word aligned which is ~1/7 of the cases. Overall it seems highly unlikely to be worth to extra branch. It was left in the previous perf improvement patch because I was erroneously comparing the exact output of `csum_partial(...)`, but really we only need `csum_fold(csum_partial(...))` to match so its safe to remove. All csum kunit tests pass. Signed-off-by: Noah Goldstein Reviewed-by: Eric Dumazet Reviewed-by: David Laight Signed-off-by: Linus Torvalds commit 5eff55d725a4e0dc6fc7709c4b1ca4fe40588d07 Merge: 08bd31ece0820 b20712e853305 Author: Linus Torvalds Date: Thu Jan 4 10:58:51 2024 -0800 Merge tag 'platform-drivers-x86-v6.7-7' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fix from Ilpo Järvinen: "Unfortunately the P2SB deadlock fix broke some older HW and we need some time to figure out the best way to fix the issue so reverting the deadlock fix for now" * tag 'platform-drivers-x86-v6.7-7' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: Revert "platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe" commit 08bd31ece082051f5369324ae99983f4e3f9b84e Merge: 5939a693dc6e6 b6ce6e6c79e4e Author: Linus Torvalds Date: Thu Jan 4 10:51:16 2024 -0800 Merge tag 'sound-6.7-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "It became more than wished, partly because of vacations. But all changes are fairly device-specific and should be safe to apply: - A regression fix for Oops at ASoC HD-audio probe - A series of TAS2781 HD-audio codec fixes - A random build regression fix with SPI helpers - Minor endianness fix for USB-audio mixer code - ASoC FSL driver error handling fix - ASoC Mediatek driver register fix - A series of ASoC meson g12a driver fixes - A few usual HD-audio oneliner quirks" * tag 'sound-6.7-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP ProBook 440 G6 ASoC: meson: g12a-tohdmitx: Fix event generation for S/PDIF mux ASoC: meson: g12a-toacodec: Fix event generation ASoC: meson: g12a-tohdmitx: Validate written enum values ASoC: meson: g12a-toacodec: Validate written enum values ASoC: SOF: Intel: hda-codec: Delay the codec device registration ALSA: hda: cs35l41: fix building without CONFIG_SPI ALSA: hda/realtek: fix mute/micmute LEDs for a HP ZBook ALSA: hda/realtek: enable SND_PCI_QUIRK for hp pavilion 14-ec1xxx series ASoC: mediatek: mt8186: fix AUD_PAD_TOP register and offset ALSA: scarlett2: Convert meter levels from little-endian ALSA: hda/tas2781: remove sound controls in unbind ALSA: hda/tas2781: move set_drv_data outside tasdevice_init ALSA: hda/tas2781: fix typos in comment ALSA: hda/tas2781: do not use regcache ASoC: fsl_rpmsg: Fix error handler with pm_runtime_enable commit 5939a693dc6e6d6f293681017c70ff60c3723d43 Merge: ac865f00af293 faa21f4c20960 Author: Linus Torvalds Date: Thu Jan 4 10:48:03 2024 -0800 Merge tag 'drm-fixes-2024-01-04' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "These were from over the holiday period, mainly i915, a couple of qaic, bridge and an mgag200. qaic: - fix GEM import - add quirk for soc version bridge: - parade-ps8640, ti-sn65dsi86: fix aux reads bounds mgag200: - fix gamma LUT init i915: - Fix bogus DPCD rev usage for DP phy test pattern setup - Fix handling of MMIO triggered reports in the OA buffer" * tag 'drm-fixes-2024-01-04' of git://anongit.freedesktop.org/drm/drm: drm/i915/perf: Update handling of MMIO triggered reports drm/i915/dp: Fix passing the correct DPCD_REV for drm_dp_set_phy_test_pattern drm/mgag200: Fix gamma lut not initialized for G200ER, G200EV, G200SE drm/bridge: ps8640: Fix size mismatch warning w/ len drm/bridge: ti-sn65dsi86: Never store more than msg->size bytes in AUX xfer drm/bridge: parade-ps8640: Never store more than msg->size bytes in AUX xfer accel/qaic: Implement quirk for SOC_HW_VERSION accel/qaic: Fix GEM import path code commit 4c8530dc7d7da4abe97d65e8e038ce9852491369 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Thu Jan 4 13:42:39 2024 +0000 net/tcp: Only produce AO/MD5 logs if there are any keys User won't care about inproper hash options in the TCP header if they don't use neither TCP-AO nor TCP-MD5. Yet, those logs can add up in syslog, while not being a real concern to the host admin: > kernel: TCP: TCP segment has incorrect auth options set for XX.20.239.12.54681->XX.XX.90.103.80 [S] Keep silent and avoid logging when there aren't any keys in the system. Side-note: I also defined static_branch_tcp_*() helpers to avoid more ifdeffery, going to remove more ifdeffery further with their help. Reported-by: Christian Kujau Closes: https://lore.kernel.org/all/f6b59324-1417-566f-a976-ff2402718a8d@nerdbynature.de/ Signed-off-by: Dmitry Safonov Reviewed-by: Eric Dumazet Fixes: 2717b5adea9e ("net/tcp: Add tcp_hash_fail() ratelimited logs") Link: https://lore.kernel.org/r/20240104-tcp_hash_fail-logs-v1-1-ff3e1f6f9e72@arista.com Signed-off-by: Jakub Kicinski commit 2e957f9c32c154f8b823caa4f0921e0056c0c253 Merge: 382a32018b74f 947dfc8138dfa Author: Jakub Kicinski Date: Thu Jan 4 08:19:14 2024 -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 2024-01-03 (i40e, ice, igc) This series contains updates to i40e, ice, and igc drivers. Ke Xiao fixes use after free for unicast filters on i40e. Andrii restores VF MSI-X flag after PCI reset on i40e. Paul corrects admin queue link status structure to fulfill firmware expectations for ice. Rodrigo Cataldo corrects value used for hicredit calculations on igc. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: igc: Fix hicredit calculation ice: fix Get link status data length i40e: Restore VF MSI-X state during PCI reset i40e: fix use-after-free in i40e_aqc_add_filters() ==================== Link: https://lore.kernel.org/r/20240103193254.822968-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 382a32018b74f407008615e0e831d05ed28e81cd Author: Thomas Lange Date: Thu Jan 4 09:57:44 2024 +0100 net: Implement missing SO_TIMESTAMPING_NEW cmsg support Commit 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW") added the new socket option SO_TIMESTAMPING_NEW. However, it was never implemented in __sock_cmsg_send thus breaking SO_TIMESTAMPING cmsg for platforms using SO_TIMESTAMPING_NEW. Fixes: 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW") Link: https://lore.kernel.org/netdev/6a7281bf-bc4a-4f75-bb88-7011908ae471@app.fastmail.com/ Signed-off-by: Thomas Lange Reviewed-by: Willem de Bruijn Link: https://lore.kernel.org/r/20240104085744.49164-1-thomas@corelatus.se Signed-off-by: Jakub Kicinski commit b20712e853305cbd04673f02b7e52ba5b12c11a9 Author: Shin'ichiro Kawasaki Date: Thu Jan 4 20:40:50 2024 +0900 Revert "platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe" This reverts commit b28ff7a7c3245d7f62acc20f15b4361292fe4117. The commit introduced P2SB device scan and resource cache during the boot process to avoid deadlock. But it caused detection failure of IDE controllers on old systems [1]. The IDE controllers on old systems and P2SB devices on newer systems have same PCI DEVFN. It is suspected the confusion between those two is the failure cause. Revert the change at this moment until the proper solution gets ready. Link: https://lore.kernel.org/platform-driver-x86/CABq1_vjfyp_B-f4LAL6pg394bP6nDFyvg110TOLHHb0x4aCPeg@mail.gmail.com/T/#m07b30468d9676fc5e3bb2122371121e4559bb383 [1] Signed-off-by: Shin'ichiro Kawasaki Link: https://lore.kernel.org/r/20240104114050.3142690-1-shinichiro.kawasaki@wdc.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 971079464001c6856186ca137778e534d983174a Author: Paolo Bonzini Date: Thu Jan 4 16:15:17 2024 +0100 KVM: x86/pmu: fix masking logic for MSR_CORE_PERF_GLOBAL_CTRL When commit c59a1f106f5c ("KVM: x86/pmu: Add IA32_PEBS_ENABLE MSR emulation for extended PEBS") switched the initialization of cpuc->guest_switch_msrs to use compound literals, it screwed up the boolean logic: + u64 pebs_mask = cpuc->pebs_enabled & x86_pmu.pebs_capable; ... - arr[0].guest = intel_ctrl & ~cpuc->intel_ctrl_host_mask; - arr[0].guest &= ~(cpuc->pebs_enabled & x86_pmu.pebs_capable); + .guest = intel_ctrl & (~cpuc->intel_ctrl_host_mask | ~pebs_mask), Before the patch, the value of arr[0].guest would have been intel_ctrl & ~cpuc->intel_ctrl_host_mask & ~pebs_mask. The intent is to always treat PEBS events as host-only because, while the guest runs, there is no way to tell the processor about the virtual address where to put PEBS records intended for the host. Unfortunately, the new expression can be expanded to (intel_ctrl & ~cpuc->intel_ctrl_host_mask) | (intel_ctrl & ~pebs_mask) which makes no sense; it includes any bit that isn't *both* marked as exclude_guest and using PEBS. So, reinstate the old logic. Another way to write it could be "intel_ctrl & ~(cpuc->intel_ctrl_host_mask | pebs_mask)", presumably the intention of the author of the faulty. However, I personally find the repeated application of A AND NOT B to be a bit more readable. This shows up as guest failures when running concurrent long-running perf workloads on the host, and was reported to happen with rcutorture. All guests on a given host would die simultaneously with something like an instruction fault or a segmentation violation. Reported-by: Paul E. McKenney Analyzed-by: Sean Christopherson Tested-by: Paul E. McKenney Cc: stable@vger.kernel.org Fixes: c59a1f106f5c ("KVM: x86/pmu: Add IA32_PEBS_ENABLE MSR emulation for extended PEBS") Signed-off-by: Paolo Bonzini commit f71cee97a644a6dfa3bc0eb69e29a53eab49b98d Author: Asad Kamal Date: Wed Dec 20 17:32:48 2023 +0800 drm/amd/pm: Use gpu_metrics_v1_5 for SMUv13.0.6 Use gpu_metrics_v1_5 for SMUv13.0.6 to fill gpu metric info Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 43d7e8b0127cc5f77916067431f31b424156cf74 Author: Asad Kamal Date: Wed Dec 20 17:21:48 2023 +0800 drm/amd/pm: Add gpu_metrics_v1_5 Add new gpu_metrics_v1_5 to acquire vcn/jpeg activity & pcie nak error counters Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 21ff3cc851565c01cbc25c64e506fe99c26b51aa Author: Asad Kamal Date: Fri Dec 22 18:24:20 2023 +0800 drm/amd/pm: Add mem_busy_percent for GCv9.4.3 apu Expose sysfs entry mem_busy_percent for GC version 9.4.3 APU system Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 202260f64519e591b5cd99626e441b6559f571a3 Author: Joshua Ashton Date: Mon Jan 1 18:28:22 2024 +0000 drm/amd/display: Fix sending VSC (+ colorimetry) packets for DP/eDP displays without PSR The check for sending the vsc infopacket to the display was gated behind PSR (Panel Self Refresh) being enabled. The vsc infopacket also contains the colorimetry (specifically the container color gamut) information for the stream on modern DP. PSR is typically only supported on mobile phone eDP displays, thus this was not getting sent for typical desktop monitors or TV screens. This functionality is needed for proper HDR10 functionality on DP as it wants BT2020 RGB/YCbCr for the container color space. Cc: stable@vger.kernel.org Cc: Harry Wentland Cc: Xaver Hugl Cc: Melissa Wen Fixes: 15f9dfd545a1 ("drm/amd/display: Register Colorspace property for DP and HDMI") Tested-by: Simon Berz Tested-by: Xaver Hugl Signed-off-by: Joshua Ashton Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 21f6137c64c65d6808c4a81006956197ca203383 Author: Alex Deucher Date: Wed Dec 20 12:36:08 2023 -0500 drm/amdgpu: skip gpu_info fw loading on navi12 It's no longer required. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2318 Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 7e725c20fea8914ef1829da777f517ce1a93d388 Author: Alex Deucher Date: Wed Dec 20 12:33:45 2023 -0500 drm/amd/display: add nv12 bounding box This was included in gpu_info firmware, move it into the driver for consistency with other nv1x parts. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2318 Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit e009b2efb7a8850498796b360043ac25c8d3d28f Author: Michael Chan Date: Wed Jan 3 16:59:24 2024 -0800 bnxt_en: Remove mis-applied code from bnxt_cfg_ntp_filters() The 2 lines to check for the BNXT_HWRM_PF_UNLOAD_SP_EVENT bit was mis-applied to bnxt_cfg_ntp_filters() and should have been applied to bnxt_sp_task(). Fixes: 19241368443f ("bnxt_en: Send PF driver unload notification to all VFs.") Reviewed-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 9039cd4c61635b2d541009a7cd5e2cc052402f28 Author: Claudiu Beznea Date: Wed Jan 3 10:13:53 2024 +0200 net: ravb: Wait for operating mode to be applied CSR.OPS bits specify the current operating mode and (according to documentation) they are updated by HW when the operating mode change request is processed. To comply with this check CSR.OPS before proceeding. Commit introduces ravb_set_opmode() that does all the necessities for setting the operating mode (set CCC.OPC (and CCC.GAC, CCC.CSEL, if any) and wait for CSR.OPS) and call it where needed. This should comply with all the HW manuals requirements as different manual variants specify that different modes need to be checked in CSR.OPS when setting CCC.OPC. If gPTP active in config mode is supported and it needs to be enabled, the CCC.GAC and CCC.CSEL needs to be configured along with CCC.OPC in the same write access. For this, ravb_set_opmode() allows passing GAC and CSEL as part of opmode and the function updates accordingly CCC register. Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") Signed-off-by: Claudiu Beznea Reviewed-by: Sergey Shtylyov Signed-off-by: David S. Miller commit eaac6a2d26b65511e164772bec6918fcbc61938e Author: Chen Ni Date: Wed Jan 3 03:35:34 2024 +0000 asix: Add check for usbnet_get_endpoints Add check for usbnet_get_endpoints() and return the error if it fails in order to transfer the error. Fixes: 16626b0cc3d5 ("asix: Add a new driver for the AX88172A") Signed-off-by: Chen Ni Signed-off-by: David S. Miller commit 818ed8933bd17bc91a9fa8b94a898189c546fc1a Author: Naveen Mamindlapalli Date: Tue Jan 2 19:44:00 2024 +0530 octeontx2-af: Re-enable MAC TX in otx2_stop processing During QoS scheduling testing with multiple strict priority flows, the netdev tx watchdog timeout routine is invoked when a low priority QoS queue doesn't get a chance to transmit the packets because other high priority flows are completely subscribing the transmit link. The netdev tx watchdog timeout routine will stop MAC RX and TX functionality in otx2_stop() routine before cleanup of HW TX queues which results in SMQ flush errors because the packets belonging to low priority queues will never gets flushed since MAC TX is disabled. This patch fixes the issue by re-enabling MAC TX to ensure the packets in HW pipeline gets flushed properly. Fixes: a7faa68b4e7f ("octeontx2-af: Start/Stop traffic in CGX along with NPC") Signed-off-by: Naveen Mamindlapalli Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit a0d9528f6daf7fe8de217fa80a94d2989d2a57a7 Author: Naveen Mamindlapalli Date: Tue Jan 2 15:26:43 2024 +0530 octeontx2-af: Always configure NIX TX link credits based on max frame size Currently the NIX TX link credits are initialized based on the max frame size that can be transmitted on a link but when the MTU is changed, the NIX TX link credits are reprogrammed by the SW based on the new MTU value. Since SMQ max packet length is programmed to max frame size by default, there is a chance that NIX TX may stall while sending a max frame sized packet on the link with insufficient credits to send the packet all at once. This patch avoids stall issue by not changing the link credits dynamically when the MTU is changed. Fixes: 1c74b89171c3 ("octeontx2-af: Wait for TX link idle for credits change") Signed-off-by: Naveen Mamindlapalli Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Nithin Kumar Dabilpuram Signed-off-by: David S. Miller commit b6ce6e6c79e4ec650887f1fe391a70e54972001a Author: Siddhesh Dharme Date: Thu Jan 4 11:37:36 2024 +0530 ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP ProBook 440 G6 LEDs in 'HP ProBook 440 G6' laptop are controlled by ALC236 codec. Enable already existing quirk 'ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF' to fix mute and mic-mute LEDs. Signed-off-by: Siddhesh Dharme Cc: Link: https://lore.kernel.org/r/20240104060736.5149-1-siddheshdharme18@gmail.com Signed-off-by: Takashi Iwai commit 2cd06bc7d7266a7a353a23ce91b82e0614ff190f Merge: c344ef36dbc2f b036d8ef3120b Author: Takashi Iwai Date: Thu Jan 4 08:58:30 2024 +0100 Merge tag 'asoc-fix-v6.7-rc8' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.7 I recently got a LibreTech Sapphire board for my CI and while integrating it found and fixed some issues, including crashes for the enum validation. There's also a couple of patches adding quirks for another x86 laptop from Hans and an error handling fix for the Freescale rpmsg driver. commit f5d03da48d062966c94f0199d20be0b3a37a7982 Author: Jinghao Jia Date: Tue Jan 2 17:33:45 2024 -0600 x86/kprobes: fix incorrect return address calculation in kprobe_emulate_call_indirect kprobe_emulate_call_indirect currently uses int3_emulate_call to emulate indirect calls. However, int3_emulate_call always assumes the size of the call to be 5 bytes when calculating the return address. This is incorrect for register-based indirect calls in x86, which can be either 2 or 3 bytes depending on whether REX prefix is used. At kprobe runtime, the incorrect return address causes control flow to land onto the wrong place after return -- possibly not a valid instruction boundary. This can lead to a panic like the following: [ 7.308204][ C1] BUG: unable to handle page fault for address: 000000000002b4d8 [ 7.308883][ C1] #PF: supervisor read access in kernel mode [ 7.309168][ C1] #PF: error_code(0x0000) - not-present page [ 7.309461][ C1] PGD 0 P4D 0 [ 7.309652][ C1] Oops: 0000 [#1] SMP [ 7.309929][ C1] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.7.0-rc5-trace-for-next #6 [ 7.310397][ C1] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-20220807_005459-localhost 04/01/2014 [ 7.311068][ C1] RIP: 0010:__common_interrupt+0x52/0xc0 [ 7.311349][ C1] Code: 01 00 4d 85 f6 74 39 49 81 fe 00 f0 ff ff 77 30 4c 89 f7 4d 8b 5e 68 41 ba 91 76 d8 42 45 03 53 fc 74 02 0f 0b cc ff d3 65 48 <8b> 05 30 c7 ff 7e 65 4c 89 3d 28 c7 ff 7e 5b 41 5c 41 5e 41 5f c3 [ 7.312512][ C1] RSP: 0018:ffffc900000e0fd0 EFLAGS: 00010046 [ 7.312899][ C1] RAX: 0000000000000001 RBX: 0000000000000023 RCX: 0000000000000001 [ 7.313334][ C1] RDX: 00000000000003cd RSI: 0000000000000001 RDI: ffff888100d302a4 [ 7.313702][ C1] RBP: 0000000000000001 R08: 0ef439818636191f R09: b1621ff338a3b482 [ 7.314146][ C1] R10: ffffffff81e5127b R11: ffffffff81059810 R12: 0000000000000023 [ 7.314509][ C1] R13: 0000000000000000 R14: ffff888100d30200 R15: 0000000000000000 [ 7.314951][ C1] FS: 0000000000000000(0000) GS:ffff88813bc80000(0000) knlGS:0000000000000000 [ 7.315396][ C1] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 7.315691][ C1] CR2: 000000000002b4d8 CR3: 0000000003028003 CR4: 0000000000370ef0 [ 7.316153][ C1] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 7.316508][ C1] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 7.316948][ C1] Call Trace: [ 7.317123][ C1] [ 7.317279][ C1] ? __die_body+0x64/0xb0 [ 7.317482][ C1] ? page_fault_oops+0x248/0x370 [ 7.317712][ C1] ? __wake_up+0x96/0xb0 [ 7.317964][ C1] ? exc_page_fault+0x62/0x130 [ 7.318211][ C1] ? asm_exc_page_fault+0x22/0x30 [ 7.318444][ C1] ? __cfi_native_send_call_func_single_ipi+0x10/0x10 [ 7.318860][ C1] ? default_idle+0xb/0x10 [ 7.319063][ C1] ? __common_interrupt+0x52/0xc0 [ 7.319330][ C1] common_interrupt+0x78/0x90 [ 7.319546][ C1] [ 7.319679][ C1] [ 7.319854][ C1] asm_common_interrupt+0x22/0x40 [ 7.320082][ C1] RIP: 0010:default_idle+0xb/0x10 [ 7.320309][ C1] Code: 4c 01 c7 4c 29 c2 e9 72 ff ff ff cc cc cc cc 90 90 90 90 90 90 90 90 90 90 90 b8 0c 67 40 a5 66 90 0f 00 2d 09 b9 3b 00 fb f4 c3 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 b8 0c 67 40 a5 e9 [ 7.321449][ C1] RSP: 0018:ffffc9000009bee8 EFLAGS: 00000256 [ 7.321808][ C1] RAX: ffff88813bca8b68 RBX: 0000000000000001 RCX: 000000000001ef0c [ 7.322227][ C1] RDX: 0000000000000000 RSI: 0000000000000001 RDI: 000000000001ef0c [ 7.322656][ C1] RBP: ffffc9000009bef8 R08: 8000000000000000 R09: 00000000000008c2 [ 7.323083][ C1] R10: 0000000000000000 R11: ffffffff81058e70 R12: 0000000000000000 [ 7.323530][ C1] R13: ffff8881002b30c0 R14: 0000000000000000 R15: 0000000000000000 [ 7.323948][ C1] ? __cfi_lapic_next_deadline+0x10/0x10 [ 7.324239][ C1] default_idle_call+0x31/0x50 [ 7.324464][ C1] do_idle+0xd3/0x240 [ 7.324690][ C1] cpu_startup_entry+0x25/0x30 [ 7.324983][ C1] start_secondary+0xb4/0xc0 [ 7.325217][ C1] secondary_startup_64_no_verify+0x179/0x17b [ 7.325498][ C1] [ 7.325641][ C1] Modules linked in: [ 7.325906][ C1] CR2: 000000000002b4d8 [ 7.326104][ C1] ---[ end trace 0000000000000000 ]--- [ 7.326354][ C1] RIP: 0010:__common_interrupt+0x52/0xc0 [ 7.326614][ C1] Code: 01 00 4d 85 f6 74 39 49 81 fe 00 f0 ff ff 77 30 4c 89 f7 4d 8b 5e 68 41 ba 91 76 d8 42 45 03 53 fc 74 02 0f 0b cc ff d3 65 48 <8b> 05 30 c7 ff 7e 65 4c 89 3d 28 c7 ff 7e 5b 41 5c 41 5e 41 5f c3 [ 7.327570][ C1] RSP: 0018:ffffc900000e0fd0 EFLAGS: 00010046 [ 7.327910][ C1] RAX: 0000000000000001 RBX: 0000000000000023 RCX: 0000000000000001 [ 7.328273][ C1] RDX: 00000000000003cd RSI: 0000000000000001 RDI: ffff888100d302a4 [ 7.328632][ C1] RBP: 0000000000000001 R08: 0ef439818636191f R09: b1621ff338a3b482 [ 7.329223][ C1] R10: ffffffff81e5127b R11: ffffffff81059810 R12: 0000000000000023 [ 7.329780][ C1] R13: 0000000000000000 R14: ffff888100d30200 R15: 0000000000000000 [ 7.330193][ C1] FS: 0000000000000000(0000) GS:ffff88813bc80000(0000) knlGS:0000000000000000 [ 7.330632][ C1] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 7.331050][ C1] CR2: 000000000002b4d8 CR3: 0000000003028003 CR4: 0000000000370ef0 [ 7.331454][ C1] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 7.331854][ C1] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 7.332236][ C1] Kernel panic - not syncing: Fatal exception in interrupt [ 7.332730][ C1] Kernel Offset: disabled [ 7.333044][ C1] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]--- The relevant assembly code is (from objdump, faulting address highlighted): ffffffff8102ed9d: 41 ff d3 call *%r11 ffffffff8102eda0: 65 48 <8b> 05 30 c7 ff mov %gs:0x7effc730(%rip),%rax The emulation incorrectly sets the return address to be ffffffff8102ed9d + 0x5 = ffffffff8102eda2, which is the 8b byte in the middle of the next mov. This in turn causes incorrect subsequent instruction decoding and eventually triggers the page fault above. Instead of invoking int3_emulate_call, perform push and jmp emulation directly in kprobe_emulate_call_indirect. At this point we can obtain the instruction size from p->ainsn.size so that we can calculate the correct return address. Link: https://lore.kernel.org/all/20240102233345.385475-1-jinghao7@illinois.edu/ Fixes: 6256e668b7af ("x86/kprobes: Use int3 instead of debug trap for single-step") Cc: stable@vger.kernel.org Signed-off-by: Jinghao Jia Signed-off-by: Masami Hiramatsu (Google) commit cbc74fc025f905fca5154254b9d9acc0b09a8cf4 Merge: b77c1e3b9fb1f b29be0ca8e816 Author: Jakub Kicinski Date: Wed Jan 3 18:05:23 2024 -0800 Merge tag 'nf-24-01-03' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Fix nat packets in the related state in OVS, from Brad Cowie. 2) Drop chain reference counter on error path in case chain binding fails. * tag 'nf-24-01-03' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nft_immediate: drop chain reference counter on error netfilter: nf_nat: fix action not being set for all ct states ==================== Link: https://lore.kernel.org/r/20240103113001.137936-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit faa21f4c20960fee268bdb0fe977ed0edb6685fe Merge: bc2fdea006523 11f9eb899ecc8 Author: Dave Airlie Date: Thu Jan 4 11:18:31 2024 +1000 Merge tag 'drm-misc-fixes-2024-01-03' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v6.7 final: - 2 small qaic fixes. - Fixes for overflow in aux xfer. - Fix uninitialised gamma lut in gmag200. - Small compiler warning fix for backports of a ps8640 fix. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/9ba866b4-3144-47a9-a2c0-7313c67249d7@linux.intel.com commit b77c1e3b9fb1f40be11c542d914054606e082592 Merge: 0fa4f912eed70 7afd49a38e73a Author: Jakub Kicinski Date: Wed Jan 3 17:02:45 2024 -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 2023-12-27 (igc) This series contains updates to igc driver only. Kurt Kanzenbach resolves issues around VLAN ntuple rules; correctly reporting back added rules and checking for valid values. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: igc: Check VLAN EtherType mask igc: Check VLAN TCI mask igc: Report VLAN EtherType matching back to user ==================== Link: https://lore.kernel.org/r/20231227210041.3035055-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 0fa4f912eed7055f988e20b4b5fc6e755f78c8af Merge: 9dbe086c69b89 3e48041d9820c Author: Jakub Kicinski Date: Wed Jan 3 17:00:15 2024 -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 2023-12-27 (ice, i40e) This series contains updates to ice and i40e drivers. Katarzyna changes message to no longer be reported as error under certain conditions as it can be expected on ice. Ngai-Mint ensures VSI is always closed when stopping interface to prevent NULL pointer dereference for ice. Arkadiusz corrects reporting of phase offset value for ice. Sudheer corrects checking on ADQ filters to prevent invalid values on i40e. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: i40e: Fix filter input checks to prevent config with invalid values ice: dpll: fix phase offset value ice: Shut down VSI with "link-down-on-close" enabled ice: Fix link_down_on_close message ==================== Link: https://lore.kernel.org/r/20231227182541.3033124-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 9dbe086c69b8902c85cece394760ac212e9e4ccc Author: Wen Gu Date: Wed Dec 27 15:40:35 2023 +0800 net/smc: fix invalid link access in dumping SMC-R connections A crash was found when dumping SMC-R connections. It can be reproduced by following steps: - environment: two RNICs on both sides. - run SMC-R between two sides, now a SMC_LGR_SYMMETRIC type link group will be created. - set the first RNIC down on either side and link group will turn to SMC_LGR_ASYMMETRIC_LOCAL then. - run 'smcss -R' and the crash will be triggered. BUG: kernel NULL pointer dereference, address: 0000000000000010 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 8000000101fdd067 P4D 8000000101fdd067 PUD 10ce46067 PMD 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 3 PID: 1810 Comm: smcss Kdump: loaded Tainted: G W E 6.7.0-rc6+ #51 RIP: 0010:__smc_diag_dump.constprop.0+0x36e/0x620 [smc_diag] Call Trace: ? __die+0x24/0x70 ? page_fault_oops+0x66/0x150 ? exc_page_fault+0x69/0x140 ? asm_exc_page_fault+0x26/0x30 ? __smc_diag_dump.constprop.0+0x36e/0x620 [smc_diag] smc_diag_dump_proto+0xd0/0xf0 [smc_diag] smc_diag_dump+0x26/0x60 [smc_diag] netlink_dump+0x19f/0x320 __netlink_dump_start+0x1dc/0x300 smc_diag_handler_dump+0x6a/0x80 [smc_diag] ? __pfx_smc_diag_dump+0x10/0x10 [smc_diag] sock_diag_rcv_msg+0x121/0x140 ? __pfx_sock_diag_rcv_msg+0x10/0x10 netlink_rcv_skb+0x5a/0x110 sock_diag_rcv+0x28/0x40 netlink_unicast+0x22a/0x330 netlink_sendmsg+0x240/0x4a0 __sock_sendmsg+0xb0/0xc0 ____sys_sendmsg+0x24e/0x300 ? copy_msghdr_from_user+0x62/0x80 ___sys_sendmsg+0x7c/0xd0 ? __do_fault+0x34/0x1a0 ? do_read_fault+0x5f/0x100 ? do_fault+0xb0/0x110 __sys_sendmsg+0x4d/0x80 do_syscall_64+0x45/0xf0 entry_SYSCALL_64_after_hwframe+0x6e/0x76 When the first RNIC is set down, the lgr->lnk[0] will be cleared and an asymmetric link will be allocated in lgr->link[SMC_LINKS_PER_LGR_MAX - 1] by smc_llc_alloc_alt_link(). Then when we try to dump SMC-R connections in __smc_diag_dump(), the invalid lgr->lnk[0] will be accessed, resulting in this issue. So fix it by accessing the right link. Fixes: f16a7dd5cf27 ("smc: netlink interface for SMC sockets") Reported-by: henaumars Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7616 Signed-off-by: Wen Gu Reviewed-by: Tony Lu Link: https://lore.kernel.org/r/1703662835-53416-1-git-send-email-guwen@linux.alibaba.com Signed-off-by: Jakub Kicinski commit 89f45c30172c80e55c887f32f1af8e184124577b Author: Dinghao Liu Date: Wed Dec 27 15:02:27 2023 +0800 net/qla3xxx: fix potential memleak in ql_alloc_buffer_queues When dma_alloc_coherent() fails, we should free qdev->lrg_buf to prevent potential memleak. Fixes: 1357bfcf7106 ("qla3xxx: Dynamically size the rx buffer queue based on the MTU.") Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20231227070227.10527-1-dinghao.liu@zju.edu.cn Signed-off-by: Jakub Kicinski commit 320fae9edf0184df767fffd5b5d011dc3ed99fb3 Merge: 2311e06b9bf3d a613fb464dc4d Author: Jakub Kicinski Date: Wed Jan 3 16:48:59 2024 -0800 Merge branch '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-12-26 (idpf) This series contains updates to idpf driver only. Alexander resolves issues in singleq mode to prevent corrupted frames and leaking skbs. Pavan prevents extra padding on RSS struct causing load failure due to unexpected size. * '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: idpf: avoid compiler introduced padding in virtchnl2_rss_key struct idpf: fix corrupted frames and skb leaks in singleq mode ==================== Link: https://lore.kernel.org/r/20231226174125.2632875-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 2311e06b9bf3d44e15f9175af177a782806f688f Author: Xuan Zhuo Date: Tue Dec 26 17:43:33 2023 +0800 virtio_net: fix missing dma unmap for resize For rq, we have three cases getting buffers from virtio core: 1. virtqueue_get_buf{,_ctx} 2. virtqueue_detach_unused_buf 3. callback for virtqueue_resize But in commit 295525e29a5b("virtio_net: merge dma operations when filling mergeable buffers"), I missed the dma unmap for the #3 case. That will leak some memory, because I did not release the pages referred by the unused buffers. If we do such script, we will make the system OOM. while true do ethtool -G ens4 rx 128 ethtool -G ens4 rx 256 free -m done Fixes: 295525e29a5b ("virtio_net: merge dma operations when filling mergeable buffers") Signed-off-by: Xuan Zhuo Acked-by: Michael S. Tsirkin Link: https://lore.kernel.org/r/20231226094333.47740-1-xuanzhuo@linux.alibaba.com Signed-off-by: Jakub Kicinski commit ff5ab42b7926682080d87993a850a4d4b8d379e0 Author: Asad Kamal Date: Wed Dec 20 17:09:21 2023 +0800 drm/amd/pm: Update metric table for jpeg/vcn data Update pmfw metric table to include vcn & jpeg activity for smu_v_13_0_6 Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 0cc9e952e6efa1f6f2597a305ea20d4b6ecc7573 Author: Asad Kamal Date: Wed Dec 20 16:07:22 2023 +0800 drm/amd/pm: Use separate metric table for APU Use separate metric table for APU and Non APU systems for smu_v_13_0_6 to get metric data Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 9cdef4f720376ef0fb0febce1ed2377c19e531f9 Author: Wayne Lin Date: Mon Dec 4 10:09:33 2023 +0800 drm/amd/display: pbn_div need be updated for hotplug event link_rate sometime will be changed when DP MST connector hotplug, so pbn_div also need be updated; otherwise, it will mismatch with link_rate, causes no output in external monitor. This is a backport to 6.7 and older. Cc: stable@vger.kernel.org Tested-by: Daniel Wheeler Reviewed-by: Jerry Zuo Acked-by: Rodrigo Siqueira Signed-off-by: Wade Wang Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher commit ac865f00af293d081356bec56eea90815094a60e Merge: d7807d8544e56 0ee2030af4e3e Author: Linus Torvalds Date: Wed Jan 3 14:18:57 2024 -0800 Merge tag 'pci-v6.7-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci Pull PCI fixes from Bjorn Helgaas: - Revert an ASPM patch that caused an unintended reboot when resuming after suspend (Bjorn Helgaas) - Orphan Cadence PCIe IP (Bjorn Helgaas) * tag 'pci-v6.7-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: MAINTAINERS: Orphan Cadence PCIe IP Revert "PCI/ASPM: Remove pcie_aspm_pm_state_change()" commit d7807d8544e56af9b5523f15eddac09ec0291b4e Merge: 94a502eb59775 8026e40608b4d Author: Linus Torvalds Date: Wed Jan 3 13:58:37 2024 -0800 Merge tag 'apparmor-pr-2024-01-03' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor Pull apparmor fix from John Johansen: "Detect that the source mount is not in the namespace and if it isn't don't use it as a source path match. This prevent apparmor from applying the attach_disconnected flag to move_mount() source which prevents detached mounts from appearing as / when applying mount mediation, which is not only incorrect but could result in bad policy being generated" * tag 'apparmor-pr-2024-01-03' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor: apparmor: Fix move_mount mediation by detecting if source is detached commit 8026e40608b4d552216d2a818ca7080a4264bb44 Author: John Johansen Date: Mon Dec 18 01:10:03 2023 -0800 apparmor: Fix move_mount mediation by detecting if source is detached Prevent move_mount from applying the attach_disconnected flag to move_mount(). This prevents detached mounts from appearing as / when applying mount mediation, which is not only incorrect but could result in bad policy being generated. Basic mount rules like allow mount, allow mount options=(move) -> /target/, will allow detached mounts, allowing older policy to continue to function. New policy gains the ability to specify `detached` as a source option allow mount detached -> /target/, In addition make sure support of move_mount is advertised as a feature to userspace so that applications that generate policy can respond to the addition. Note: this fixes mediation of move_mount when a detached mount is used, it does not fix the broader regression of apparmor mediation of mounts under the new mount api. Link: https://lore.kernel.org/all/68c166b8-5b4d-4612-8042-1dee3334385b@leemhuis.info/T/#mb35fdde37f999f08f0b02d58dc1bf4e6b65b8da2 Fixes: 157a3537d6bc ("apparmor: Fix regression in mount mediation") Reviewed-by: Georgia Garcia Signed-off-by: John Johansen commit 94a502eb59775e13c9089de38c601f9f85b25750 Merge: 360f0342b2e93 01638431c4657 Author: Linus Torvalds Date: Wed Jan 3 11:50:17 2024 -0800 Merge tag 'efi-urgent-for-v6.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI fix from Ard Biesheuvel: - Ensure that the KASLR load flag is set in boot_params when loading the kernel randomized directly from the EFI stub * tag 'efi-urgent-for-v6.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efi/x86: Fix the missing KASLR_FLAG bit in boot_params->hdr.loadflags commit 360f0342b2e9374298e2222c846f3fe9d0295f0d Merge: 981d04137a4b5 fd56cd5f6d76e Author: Linus Torvalds Date: Wed Jan 3 11:45:15 2024 -0800 Merge tag 'trace-v6.7-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt: - Fix a NULL kernel dereference in set_gid() on tracefs mounting. When tracefs is mounted with "gid=1000", it will update the existing dentries to have the new gid. The tracefs_inode which is retrieved by a container_of(dentry->d_inode) has flags to see if the inode belongs to the eventfs system. The issue that was fixed was if getdents() was called on tracefs that was previously mounted, and was not closed. It will leave a "cursor dentry" in the subdirs list of the current dentries that set_gid() walks. On a remount of tracefs, the container_of(dentry->d_inode) will dereference a NULL pointer and cause a crash when referenced. Simply have a check for dentry->d_inode to see if it is NULL and if so, skip that entry. - Fix the bits of the eventfs_inode structure. The "is_events" bit was taken from the nr_entries field, but the nr_entries field wasn't updated to be 30 bits and was still 31. Including the "is_freed" bit this would use 33 bits which would make the structure use another integer for just one bit. * tag 'trace-v6.7-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: eventfs: Fix bitwise fields for "is_events" tracefs: Check for dentry->d_inode exists in set_gid() commit 981d04137a4b5ea95133572bdb3d888c9b515850 Merge: 610a9b8f49fbc 0d72ab35a925d Author: Linus Torvalds Date: Wed Jan 3 11:35:48 2024 -0800 Merge tag 'bcachefs-2024-01-01' of https://evilpiepirate.org/git/bcachefs Pull bcachefs from Kent Overstreet: "More bcachefs bugfixes for 6.7, and forwards compatibility work: - fix for a nasty extents + snapshot interaction, reported when reflink of a snapshotted file wouldn't complete but turned out to be a more general bug - fix for an invalid free in dio write path when iov vector was longer than our inline vector - fix for a buffer overflow in the nocow write path - BCH_REPLICAS_MAX doesn't actually limit the number of pointers in an extent when cached pointers are included - RO snapshots are actually RO now - And, a new superblock section to avoid future breakage when the disk space acounting rewrite rolls out: the new superblock section describes versions that need work to downgrade, where the work required is a list of recovery passes and errors to silently fix" * tag 'bcachefs-2024-01-01' of https://evilpiepirate.org/git/bcachefs: bcachefs: make RO snapshots actually RO bcachefs: bch_sb_field_downgrade bcachefs: bch_sb.recovery_passes_required bcachefs: Add persistent identifiers for recovery passes bcachefs: prt_bitflags_vector() bcachefs: move BCH_SB_ERRS() to sb-errors_types.h bcachefs: fix buffer overflow in nocow write path bcachefs: DARRAY_PREALLOCATED() bcachefs: Switch darray to kvmalloc() bcachefs: Factor out darray resize slowpath bcachefs: fix setting version_upgrade_complete bcachefs: fix invalid free in dio write path bcachefs: Fix extents iteration + snapshots interaction commit 947dfc8138dfaeb6e966e2d661de89eb203e3064 Author: Rodrigo Cataldo Date: Fri Dec 8 15:58:16 2023 +0100 igc: Fix hicredit calculation According to the Intel Software Manual for I225, Section 7.5.2.7, hicredit should be multiplied by the constant link-rate value, 0x7736. Currently, the old constant link-rate value, 0x7735, from the boards supported on igb are being used, most likely due to a copy'n'paste, as the rest of the logic is the same for both drivers. Update hicredit accordingly. Fixes: 1ab011b0bf07 ("igc: Add support for CBS offloading") Reviewed-by: Kurt Kanzenbach Signed-off-by: Rodrigo Cataldo Acked-by: Vinicius Costa Gomes Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 9fb266dcb6aab27867b22f7bc9e4ad6bd14b2ddc Author: Paul Greenwalt Date: Thu Dec 21 16:40:28 2023 -0500 ice: fix Get link status data length Get link status version 2 (opcode 0x0607) is returning an error because FW expects a data length of 56 bytes, and this is causing the driver to fail probe. Update the get link status version 2 data length to 56 bytes by adding 5 byte reserved5 field to the end of struct ice_aqc_get_link_status_data and passing it as parameter to offsetofend() to the fix error. Fixes: 2777d24ec6d1 ("ice: Add ice_get_link_status_datalen") Reviewed-by: Przemek Kitszel Signed-off-by: Paul Greenwalt Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 371e576ff3e8580d91d49026e5d5faebf5565558 Author: Andrii Staikov Date: Thu Dec 21 14:27:35 2023 +0100 i40e: Restore VF MSI-X state during PCI reset During a PCI FLR the MSI-X Enable flag in the VF PCI MSI-X capability register will be cleared. This can lead to issues when a VF is assigned to a VM because in these cases the VF driver receives no indication of the PF PCI error/reset and additionally it is incapable of restoring the cleared flag in the hypervisor configuration space without fully reinitializing the driver interrupt functionality. Since the VF driver is unable to easily resolve this condition on its own, restore the VF MSI-X flag during the PF PCI reset handling. Fixes: 19b7960b2da1 ("i40e: implement split PCI error reset handler") Co-developed-by: Karen Ostrowska Signed-off-by: Karen Ostrowska Co-developed-by: Mateusz Palczewski Signed-off-by: Mateusz Palczewski Reviewed-by: Wojciech Drewek Reviewed-by: Przemek Kitszel Signed-off-by: Andrii Staikov Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit b036d8ef3120b996751495ce25994eea58032a98 Author: Mark Brown Date: Wed Jan 3 18:34:04 2024 +0000 ASoC: meson: g12a-tohdmitx: Fix event generation for S/PDIF mux When a control changes value the return value from _put() should be 1 so we get events generated to userspace notifying applications of the change. While the I2S mux gets this right the S/PDIF mux does not, fix the return value. Fixes: c8609f3870f7 ("ASoC: meson: add g12a tohdmitx control") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20240103-meson-enum-val-v1-4-424af7a8fb91@kernel.org Signed-off-by: Mark Brown commit 172c88244b5f2d3375403ebb504d407be0fded59 Author: Mark Brown Date: Wed Jan 3 18:34:03 2024 +0000 ASoC: meson: g12a-toacodec: Fix event generation When a control changes value the return value from _put() should be 1 so we get events generated to userspace notifying applications of the change. We are checking if there has been a change and exiting early if not but we are not providing the correct return value in the latter case, fix this. Fixes: af2618a2eee8 ("ASoC: meson: g12a: add internal DAC glue driver") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20240103-meson-enum-val-v1-3-424af7a8fb91@kernel.org Signed-off-by: Mark Brown commit 1e001206804be3f3d21f4a1cf16e5d059d75643f Author: Mark Brown Date: Wed Jan 3 18:34:02 2024 +0000 ASoC: meson: g12a-tohdmitx: Validate written enum values When writing to an enum we need to verify that the value written is valid for the enumeration, the helper function snd_soc_item_enum_to_val() doesn't do it since it needs to return an unsigned (and in any case we'd need to check the return value). Fixes: c8609f3870f7 ("ASoC: meson: add g12a tohdmitx control") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20240103-meson-enum-val-v1-2-424af7a8fb91@kernel.org Signed-off-by: Mark Brown commit 3150b70e944ead909260285dfb5707d0bedcf87b Author: Mark Brown Date: Wed Jan 3 18:34:01 2024 +0000 ASoC: meson: g12a-toacodec: Validate written enum values When writing to an enum we need to verify that the value written is valid for the enumeration, the helper function snd_soc_item_enum_to_val() doesn't do it since it needs to return an unsigned (and in any case we'd need to check the return value). Fixes: af2618a2eee8 ("ASoC: meson: g12a: add internal DAC glue driver") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20240103-meson-enum-val-v1-1-424af7a8fb91@kernel.org Signed-off-by: Mark Brown commit 6a15584e99db8918b60e507539c7446375dcf366 Author: Ke Xiao Date: Mon Dec 18 15:08:50 2023 +0800 i40e: fix use-after-free in i40e_aqc_add_filters() Commit 3116f59c12bd ("i40e: fix use-after-free in i40e_sync_filters_subtask()") avoided use-after-free issues, by increasing refcount during update the VSI filter list to the HW. However, it missed the unicast situation. When deleting an unicast FDB entry, the i40e driver will release the mac_filter, and i40e_service_task will concurrently request firmware to add the mac_filter, which will lead to the following use-after-free issue. Fix again for both netdev->uc and netdev->mc. BUG: KASAN: use-after-free in i40e_aqc_add_filters+0x55c/0x5b0 [i40e] Read of size 2 at addr ffff888eb3452d60 by task kworker/8:7/6379 CPU: 8 PID: 6379 Comm: kworker/8:7 Kdump: loaded Tainted: G Workqueue: i40e i40e_service_task [i40e] Call Trace: dump_stack+0x71/0xab print_address_description+0x6b/0x290 kasan_report+0x14a/0x2b0 i40e_aqc_add_filters+0x55c/0x5b0 [i40e] i40e_sync_vsi_filters+0x1676/0x39c0 [i40e] i40e_service_task+0x1397/0x2bb0 [i40e] process_one_work+0x56a/0x11f0 worker_thread+0x8f/0xf40 kthread+0x2a0/0x390 ret_from_fork+0x1f/0x40 Allocated by task 21948: kasan_kmalloc+0xa6/0xd0 kmem_cache_alloc_trace+0xdb/0x1c0 i40e_add_filter+0x11e/0x520 [i40e] i40e_addr_sync+0x37/0x60 [i40e] __hw_addr_sync_dev+0x1f5/0x2f0 i40e_set_rx_mode+0x61/0x1e0 [i40e] dev_uc_add_excl+0x137/0x190 i40e_ndo_fdb_add+0x161/0x260 [i40e] rtnl_fdb_add+0x567/0x950 rtnetlink_rcv_msg+0x5db/0x880 netlink_rcv_skb+0x254/0x380 netlink_unicast+0x454/0x610 netlink_sendmsg+0x747/0xb00 sock_sendmsg+0xe2/0x120 __sys_sendto+0x1ae/0x290 __x64_sys_sendto+0xdd/0x1b0 do_syscall_64+0xa0/0x370 entry_SYSCALL_64_after_hwframe+0x65/0xca Freed by task 21948: __kasan_slab_free+0x137/0x190 kfree+0x8b/0x1b0 __i40e_del_filter+0x116/0x1e0 [i40e] i40e_del_mac_filter+0x16c/0x300 [i40e] i40e_addr_unsync+0x134/0x1b0 [i40e] __hw_addr_sync_dev+0xff/0x2f0 i40e_set_rx_mode+0x61/0x1e0 [i40e] dev_uc_del+0x77/0x90 rtnl_fdb_del+0x6a5/0x860 rtnetlink_rcv_msg+0x5db/0x880 netlink_rcv_skb+0x254/0x380 netlink_unicast+0x454/0x610 netlink_sendmsg+0x747/0xb00 sock_sendmsg+0xe2/0x120 __sys_sendto+0x1ae/0x290 __x64_sys_sendto+0xdd/0x1b0 do_syscall_64+0xa0/0x370 entry_SYSCALL_64_after_hwframe+0x65/0xca Fixes: 3116f59c12bd ("i40e: fix use-after-free in i40e_sync_filters_subtask()") Fixes: 41c445ff0f48 ("i40e: main driver core") Signed-off-by: Ke Xiao Signed-off-by: Ding Hui Cc: Di Zhu Reviewed-by: Jan Sokolowski Reviewed-by: Simon Horman Reviewed-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit c344ef36dbc2fe920ec7291b68b11fe867a2c8f6 Author: Peter Ujfalusi Date: Thu Dec 7 11:54:25 2023 +0200 ASoC: SOF: Intel: hda-codec: Delay the codec device registration The current code flow is: 1. snd_hdac_device_register() 2. set parameters needed by the hdac driver 3. request_codec_module() the hdac driver is probed at this point During boot the codec drivers are not loaded when the hdac device is registered, it is going to be probed later when loading the codec module, which point the parameters are set. On module remove/insert rmmod snd_sof_pci_intel_tgl modprobe snd_sof_pci_intel_tgl The codec module remains loaded and the driver will be probed when the hdac device is created right away, before the parameters for the driver has been configured: 1. snd_hdac_device_register() the hdac driver is probed at this point 2. set parameters needed by the hdac driver 3. request_codec_module() will be a NOP as the module is already loaded Move the snd_hdac_device_register() later, to be done right before requesting the codec module to make sure that the parameters are all set before the device is created: 1. set parameters needed by the hdac driver 2. snd_hdac_device_register() 3. request_codec_module() This way at the hdac driver probe all parameters will be set in all cases. Link: https://github.com/thesofproject/linux/issues/4731 Fixes: a0575b4add21 ("ASoC: hdac_hda: Conditionally register dais for HDMI and Analog") Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231207095425.19597-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/ZYvUIxtrqBQZbNlC@shine.dominikbrodowski.net Link: https://bugzilla.kernel.org/show_bug.cgi?id=218304 Signed-off-by: Takashi Iwai commit 01b2885d9415152bcb12ff1f7788f500a74ea0ed Author: Marc Dionne Date: Thu Dec 21 09:12:30 2023 -0400 net: Save and restore msg_namelen in sock_sendmsg Commit 86a7e0b69bd5 ("net: prevent rewrite of msg_name in sock_sendmsg()") made sock_sendmsg save the incoming msg_name pointer and restore it before returning, to insulate the caller against msg_name being changed by the called code. If the address length was also changed however, we may return with an inconsistent structure where the length doesn't match the address, and attempts to reuse it may lead to lost packets. For example, a kernel that doesn't have commit 1c5950fc6fe9 ("udp6: fix potential access to stale information") will replace a v4 mapped address with its ipv4 equivalent, and shorten namelen accordingly from 28 to 16. If the caller attempts to reuse the resulting msg structure, it will have the original ipv6 (v4 mapped) address but an incorrect v4 length. Fixes: 86a7e0b69bd5 ("net: prevent rewrite of msg_name in sock_sendmsg()") Signed-off-by: Marc Dionne Reviewed-by: Willem de Bruijn Signed-off-by: David S. Miller commit 8c14dbf36424eb751d70c15f9a671549390057b2 Author: Arnd Bergmann Date: Wed Jan 3 11:25:59 2024 +0100 ALSA: hda: cs35l41: fix building without CONFIG_SPI When CONFIG_SPI is disabled, the driver produces unused-variable warning: sound/pci/hda/cs35l41_hda_property.c: In function 'generic_dsd_config': sound/pci/hda/cs35l41_hda_property.c:181:28: error: unused variable 'spi' [-Werror=unused-variable] 181 | struct spi_device *spi; | ^~~ sound/pci/hda/cs35l41_hda_property.c:180:27: error: unused variable 'cs_gpiod' [-Werror=unused-variable] 180 | struct gpio_desc *cs_gpiod; | ^~~~~~~~ Avoid these by turning the preprocessor contionals into equivalent C code, which also helps readability. Fixes: 916d051730ae ("ALSA: hda: cs35l41: Only add SPI CS GPIO if SPI is enabled in kernel") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20240103102606.3742476-1-arnd@kernel.org Signed-off-by: Takashi Iwai commit 8abf77c88929b6d20fa4f9928b18d6448d64e293 Author: Wenchao Chen Date: Mon Dec 4 14:49:34 2023 +0800 mmc: sdhci-sprd: Fix eMMC init failure after hw reset Some eMMC devices that do not close the auto clk gate after hw reset will cause eMMC initialization to fail. Let's fix this. Signed-off-by: Wenchao Chen Fixes: ff874dbc4f86 ("mmc: sdhci-sprd: Disable CLK_AUTO when the clock is less than 400K") Reviewed-by: Baolin Wang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231204064934.21236-1-wenchao.chen@unisoc.com Signed-off-by: Ulf Hansson commit b29be0ca8e816119ccdf95cc7d7c7be9bde005f1 Author: Pablo Neira Ayuso Date: Mon Jan 1 20:15:33 2024 +0100 netfilter: nft_immediate: drop chain reference counter on error In the init path, nft_data_init() bumps the chain reference counter, decrement it on error by following the error path which calls nft_data_release() to restore it. Fixes: 4bedf9eee016 ("netfilter: nf_tables: fix chain binding transaction logic") Signed-off-by: Pablo Neira Ayuso commit e6345d2824a3f58aab82428d11645e0da861ac13 Author: Brad Cowie Date: Fri Dec 22 11:43:11 2023 +1300 netfilter: nf_nat: fix action not being set for all ct states This fixes openvswitch's handling of nat packets in the related state. In nf_ct_nat_execute(), which is called from nf_ct_nat(), ICMP/ICMPv6 packets in the IP_CT_RELATED or IP_CT_RELATED_REPLY state, which have not been dropped, will follow the goto, however the placement of the goto label means that updating the action bit field will be bypassed. This causes ovs_nat_update_key() to not be called from ovs_ct_nat() which means the openvswitch match key for the ICMP/ICMPv6 packet is not updated and the pre-nat value will be retained for the key, which will result in the wrong openflow rule being matched for that packet. Move the goto label above where the action bit field is being set so that it is updated in all cases where the packet is accepted. Fixes: ebddb1404900 ("net: move the nat function to nf_nat_ovs for ovs and tc") Signed-off-by: Brad Cowie Reviewed-by: Simon Horman Acked-by: Xin Long Acked-by: Aaron Conole Signed-off-by: Pablo Neira Ayuso commit bc2fdea0065236fdf9fbba3ac77cf5f3d0891443 Merge: 610a9b8f49fbc ee11d2d37f5c0 Author: Dave Airlie Date: Wed Jan 3 14:17:36 2024 +1000 Merge tag 'drm-intel-fixes-2023-12-28' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v6.7-rc8: - Fix bogus DPCD rev usage for DP phy test pattern setup - Fix handling of MMIO triggered reports in the OA buffer Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87cyuqk26k.fsf@intel.com commit e584f2ff1e6cc9b1d99e8a6b0f3415940d1b3eb3 Author: Adrian Cinal Date: Thu Dec 28 14:56:38 2023 +0100 net: bcmgenet: Fix FCS generation for fragmented skbuffs The flag DMA_TX_APPEND_CRC was only written to the first DMA descriptor in the TX path, where each descriptor corresponds to a single skbuff fragment (or the skbuff head). This led to packets with no FCS appearing on the wire if the kernel allocated the packet in fragments, which would always happen when using PACKET_MMAP/TPACKET (cf. tpacket_fill_skb() in net/af_packet.c). Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file") Signed-off-by: Adrian Cinal Acked-by: Doug Berger Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20231228135638.1339245-1-adriancinal1@gmail.com Signed-off-by: Jakub Kicinski commit d5a13915ae2f4df738bf4254ec25e19f82e3ff49 Merge: fe6d8300a7af3 4c0288299fd09 Author: Jakub Kicinski Date: Tue Jan 2 16:12:49 2024 -0800 Merge branch 'mptcp-new-reviewer-and-prevent-a-warning' Matthieu Baerts says: ==================== mptcp: new reviewer and prevent a warning Patch 1 adds MPTCP long time contributor -- Geliang Tang -- as a new reviewer for the project. Thanks! Patch 2 prevents a warning when TCP Diag is used to close internal MPTCP listener subflows. This is a correction for a patch introduced in v6.4 which was fixing an issue from v5.17. ==================== Link: https://lore.kernel.org/r/20231226-upstream-net-20231226-mptcp-prevent-warn-v1-0-1404dcc431ea@kernel.org Signed-off-by: Jakub Kicinski commit 4c0288299fd09ee7c6fbe2f57421f314d8c981db Author: Paolo Abeni Date: Tue Dec 26 13:10:18 2023 +0100 mptcp: prevent tcp diag from closing listener subflows The MPTCP protocol does not expect that any other entity could change the first subflow status when such socket is listening. Unfortunately the TCP diag interface allows aborting any TCP socket, including MPTCP listeners subflows. As reported by syzbot, that trigger a WARN() and could lead to later bigger trouble. The MPTCP protocol needs to do some MPTCP-level cleanup actions to properly shutdown the listener. To keep the fix simple, prevent entirely the diag interface from stopping such listeners. We could refine the diag callback in a later, larger patch targeting net-next. Fixes: 57fc0f1ceaa4 ("mptcp: ensure listener is unhashed before updating the sk status") Cc: stable@vger.kernel.org Reported-by: Closes: https://lore.kernel.org/netdev/0000000000004f4579060c68431b@google.com/ Signed-off-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Link: https://lore.kernel.org/r/20231226-upstream-net-20231226-mptcp-prevent-warn-v1-2-1404dcc431ea@kernel.org Signed-off-by: Jakub Kicinski commit 118ba479d02c5a55e1c1d3c7a43de8937680e67d Author: Matthieu Baerts Date: Tue Dec 26 13:10:17 2023 +0100 MAINTAINERS: add Geliang as reviewer for MPTCP For a long time now, Geliang has contributed to a lot of code and reviews related to MPTCP. So let's reflect that in the MAINTAINERS file. This should also encourage patch submitters to add him to the CC list. Acked-by: Geliang Tang Acked-by: Mat Martineau Signed-off-by: Matthieu Baerts Link: https://lore.kernel.org/r/20231226-upstream-net-20231226-mptcp-prevent-warn-v1-1-1404dcc431ea@kernel.org Signed-off-by: Jakub Kicinski commit fe6d8300a7af390667359c661d78a24b733dc5ad Author: Marcin Wojtas Date: Mon Dec 25 23:52:45 2023 +0100 MAINTAINERS: Update mvpp2 driver email I no longer use mw@semihalf.com email. Update mvpp2 driver entry with my alternative address. Signed-off-by: Marcin Wojtas Link: https://lore.kernel.org/r/20231225225245.1606-1-marcin.s.wojtas@gmail.com Signed-off-by: Jakub Kicinski commit d5a306aedba34e640b11d7026dbbafb78ee3a5f6 Author: Zhipeng Lu Date: Mon Dec 25 19:29:14 2023 +0800 sfc: fix a double-free bug in efx_probe_filters In efx_probe_filters, the channel->rps_flow_id is freed in a efx_for_each_channel marco when success equals to 0. However, after the following call chain: ef100_net_open |-> efx_probe_filters |-> ef100_net_stop |-> efx_remove_filters The channel->rps_flow_id is freed again in the efx_for_each_channel of efx_remove_filters, triggering a double-free bug. Fixes: a9dc3d5612ce ("sfc_ef100: RX filter table management and related gubbins") Reviewed-by: Simon Horman Reviewed-by: Edward Cree Signed-off-by: Zhipeng Lu Link: https://lore.kernel.org/r/20231225112915.3544581-1-alexious@zju.edu.cn Signed-off-by: Jakub Kicinski commit 0ee2030af4e3e0a9cd26dfaa8c2f935beffa91d1 Author: Bjorn Helgaas Date: Tue Dec 26 18:43:03 2023 -0600 MAINTAINERS: Orphan Cadence PCIe IP Tom Joseph is listed as the maintainer of the Cadence PCIe IP, but email to that address bounces and lore has no correspondence from Tom in the past two years (https://lore.kernel.org/all/?q=f%3Atjoseph). Mark the Cadence IP orphaned and add Tom to CREDITS. Link: https://lore.kernel.org/r/20240102182157.GA1732664@bhelgaas Signed-off-by: Bjorn Helgaas commit f93e71aea6c60ebff8adbd8941e678302d377869 Author: Bjorn Helgaas Date: Mon Jan 1 12:08:18 2024 -0600 Revert "PCI/ASPM: Remove pcie_aspm_pm_state_change()" This reverts commit 08d0cc5f34265d1a1e3031f319f594bd1970976c. Michael reported that when attempting to resume from suspend to RAM on ASUS mini PC PN51-BB757MDE1 (DMI model: MINIPC PN51-E1), 08d0cc5f3426 ("PCI/ASPM: Remove pcie_aspm_pm_state_change()") caused a 12-second delay with no output, followed by a reboot. Workarounds include: - Reverting 08d0cc5f3426 ("PCI/ASPM: Remove pcie_aspm_pm_state_change()") - Booting with "pcie_aspm=off" - Booting with "pcie_aspm.policy=performance" - "echo 0 | sudo tee /sys/bus/pci/devices/0000:03:00.0/link/l1_aspm" before suspending - Connecting a USB flash drive Link: https://lore.kernel.org/r/20240102232550.1751655-1-helgaas@kernel.org Fixes: 08d0cc5f3426 ("PCI/ASPM: Remove pcie_aspm_pm_state_change()") Reported-by: Michael Schaller Link: https://lore.kernel.org/r/76c61361-b8b4-435f-a9f1-32b716763d62@5challer.de Signed-off-by: Bjorn Helgaas Cc: commit 8cdafdd94654ba418648d039c48e7a90508c1982 Author: Alex Henrie Date: Fri Dec 29 21:32:44 2023 -0700 Revert "net: ipv6/addrconf: clamp preferred_lft to the minimum required" The commit had a bug and might not have been the right approach anyway. Fixes: 629df6701c8a ("net: ipv6/addrconf: clamp preferred_lft to the minimum required") Fixes: ec575f885e3e ("Documentation: networking: explain what happens if temp_prefered_lft is too small or too large") Reported-by: Dan Moulding Closes: https://lore.kernel.org/netdev/20231221231115.12402-1-dan@danm.net/ Link: https://lore.kernel.org/netdev/CAMMLpeTdYhd=7hhPi2Y7pwdPCgnnW5JYh-bu3hSc7im39uxnEA@mail.gmail.com/ Signed-off-by: Alex Henrie Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20231230043252.10530-1-alexhenrie24@gmail.com Signed-off-by: Jakub Kicinski commit fd56cd5f6d76e93356d9520cf9dabffe1e3d1aa0 Author: Steven Rostedt (Google) Date: Tue Jan 2 15:18:32 2024 -0500 eventfs: Fix bitwise fields for "is_events" A flag was needed to denote which eventfs_inode was the "events" directory, so a bit was taken from the "nr_entries" field, as there's not that many entries, and 2^30 is plenty. But the bit number for nr_entries was not updated to reflect the bit taken from it, which would add an unnecessary integer to the structure. Link: https://lore.kernel.org/linux-trace-kernel/20240102151832.7ca87275@gandalf.local.home Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Fixes: 7e8358edf503e ("eventfs: Fix file and directory uid and gid ownership") Signed-off-by: Steven Rostedt (Google) commit ad579864637af46447208254719943179b69d41a Author: Steven Rostedt (Google) Date: Tue Jan 2 15:12:49 2024 -0500 tracefs: Check for dentry->d_inode exists in set_gid() If a getdents() is called on the tracefs directory but does not get all the files, it can leave a "cursor" dentry in the d_subdirs list of tracefs dentry. This cursor dentry does not have a d_inode for it. Before referencing tracefs_inode from the dentry, the d_inode must first be checked if it has content. If not, then it's not a tracefs_inode and can be ignored. The following caused a crash: #define getdents64(fd, dirp, count) syscall(SYS_getdents64, fd, dirp, count) #define BUF_SIZE 256 #define TDIR "/tmp/file0" int main(void) { char buf[BUF_SIZE]; int fd; int n; mkdir(TDIR, 0777); mount(NULL, TDIR, "tracefs", 0, NULL); fd = openat(AT_FDCWD, TDIR, O_RDONLY); n = getdents64(fd, buf, BUF_SIZE); ret = mount(NULL, TDIR, NULL, MS_NOSUID|MS_REMOUNT|MS_RELATIME|MS_LAZYTIME, "gid=1000"); return 0; } That's because the 256 BUF_SIZE was not big enough to read all the dentries of the tracefs file system and it left a "cursor" dentry in the subdirs of the tracefs root inode. Then on remounting with "gid=1000", it would cause an iteration of all dentries which hit: ti = get_tracefs(dentry->d_inode); if (ti && (ti->flags & TRACEFS_EVENT_INODE)) eventfs_update_gid(dentry, gid); Which crashed because of the dereference of the cursor dentry which had a NULL d_inode. In the subdir loop of the dentry lookup of set_gid(), if a child has a NULL d_inode, simply skip it. Link: https://lore.kernel.org/all/20240102135637.3a21fb10@gandalf.local.home/ Link: https://lore.kernel.org/linux-trace-kernel/20240102151249.05da244d@gandalf.local.home Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Fixes: 7e8358edf503e ("eventfs: Fix file and directory uid and gid ownership") Reported-by: "Ubisectech Sirius" Signed-off-by: Steven Rostedt (Google) commit 01638431c465741e071ab34acf3bef3c2570f878 Author: Yuntao Wang Date: Tue Dec 26 22:02:50 2023 +0800 efi/x86: Fix the missing KASLR_FLAG bit in boot_params->hdr.loadflags When KASLR is enabled, the KASLR_FLAG bit in boot_params->hdr.loadflags should be set to 1 to propagate KASLR status from compressed kernel to kernel, just as the choose_random_location() function does. Currently, when the kernel is booted via the EFI stub, the KASLR_FLAG bit in boot_params->hdr.loadflags is not set, even though it should be. This causes some functions, such as kernel_randomize_memory(), not to execute as expected. Fix it. Fixes: a1b87d54f4e4 ("x86/efistub: Avoid legacy decompressor when doing EFI boot") Signed-off-by: Yuntao Wang [ardb: drop 'else' branch clearing KASLR_FLAG] Signed-off-by: Ard Biesheuvel commit 643fe70e7bcdcc9e2d96952f7fc2bab56385cce5 Author: Stefan Wahren Date: Thu Dec 28 20:39:03 2023 +0100 ARM: sun9i: smp: fix return code check of of_property_match_string of_property_match_string returns an int; either an index from 0 or greater if successful or negative on failure. Even it's very unlikely that the DT CPU node contains multiple enable-methods these checks should be fixed. This patch was inspired by the work of Nick Desaulniers. Link: https://lore.kernel.org/lkml/20230516-sunxi-v1-1-ac4b9651a8c1@google.com/T/ Cc: Nick Desaulniers Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/20231228193903.9078-2-wahrenst@gmx.net Reviewed-by: Chen-Yu Tsai Signed-off-by: Arnd Bergmann commit 72ad3b772b6d393701df58ba1359b0bb346a19ed Author: Stefan Wahren Date: Thu Dec 28 20:39:02 2023 +0100 ARM: sun9i: smp: Fix array-index-out-of-bounds read in sunxi_mc_smp_init Running a multi-arch kernel (multi_v7_defconfig) on a Raspberry Pi 3B+ with enabled CONFIG_UBSAN triggers the following warning: UBSAN: array-index-out-of-bounds in arch/arm/mach-sunxi/mc_smp.c:810:29 index 2 is out of range for type 'sunxi_mc_smp_data [2]' CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.7.0-rc6-00248-g5254c0cbc92d Hardware name: BCM2835 unwind_backtrace from show_stack+0x10/0x14 show_stack from dump_stack_lvl+0x40/0x4c dump_stack_lvl from ubsan_epilogue+0x8/0x34 ubsan_epilogue from __ubsan_handle_out_of_bounds+0x78/0x80 __ubsan_handle_out_of_bounds from sunxi_mc_smp_init+0xe4/0x4cc sunxi_mc_smp_init from do_one_initcall+0xa0/0x2fc do_one_initcall from kernel_init_freeable+0xf4/0x2f4 kernel_init_freeable from kernel_init+0x18/0x158 kernel_init from ret_from_fork+0x14/0x28 Since the enabled method couldn't match with any entry from sunxi_mc_smp_data, the value of the index shouldn't be used right after the loop. So move it after the check of ret in order to have a valid index. Fixes: 1631090e34f5 ("ARM: sun9i: smp: Add is_a83t field") Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/20231228193903.9078-1-wahrenst@gmx.net Reviewed-by: Chen-Yu Tsai Signed-off-by: Arnd Bergmann commit 18a434f32fa61b3fda8ddcd9a63d5274569c6a41 Author: Andy Chi Date: Tue Jan 2 10:49:15 2024 +0800 ALSA: hda/realtek: fix mute/micmute LEDs for a HP ZBook There is a HP ZBook which using ALC236 codec and need the ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF quirk to make mute LED and micmute LED work. [ confirmed that the new entries are for new models that have no proper name, so the strings are left as "HP" which will be updated eventually later -- tiwai ] Signed-off-by: Andy Chi Cc: Link: https://lore.kernel.org/r/20240102024916.19093-1-andy.chi@canonical.com Signed-off-by: Takashi Iwai commit 61fa2493ca76fd7bb74e13f0205274f4ab0aa696 Author: Hangbin Liu Date: Sat Dec 23 20:59:22 2023 +0800 selftests: bonding: do not set port down when adding to bond Similar to commit be809424659c ("selftests: bonding: do not set port down before adding to bond"). The bond-arp-interval-causes-panic test failed after commit a4abfa627c38 ("net: rtnetlink: Enslave device before bringing it up") as the kernel will set the port down _after_ adding to bond if setting port down specifically. Fix it by removing the link down operation when adding to bond. Fixes: 2ffd57327ff1 ("selftests: bonding: cause oops in bond_rr_gen_slave_id") Signed-off-by: Hangbin Liu Tested-by: Benjamin Poirier Signed-off-by: David S. Miller commit c46bfba1337d301661dbb23cfd905d4cb51f27ca Author: wangkeqi Date: Sat Dec 23 14:50:32 2023 +0800 connector: Fix proc_event_num_listeners count not cleared When we register a cn_proc listening event, the proc_event_num_listener variable will be incremented by one, but if PROC_CN_MCAST_IGNORE is not called, the count will not decrease. This will cause the proc_*_connector function to take the wrong path. It will reappear when the forkstat tool exits via ctrl + c. We solve this problem by determining whether there are still listeners to clear proc_event_num_listener. Signed-off-by: wangkeqi Signed-off-by: David S. Miller commit 059d37b718d38d26087121c754691df77acfc66b Author: Randy Dunlap Date: Fri Dec 22 21:06:13 2023 -0800 net: phy: linux/phy.h: fix Excess kernel-doc description warning Remove the @phy_timer: line to prevent the kernel-doc warning: include/linux/phy.h:768: warning: Excess struct member 'phy_timer' description in 'phy_device' Signed-off-by: Randy Dunlap Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Russell King Cc: netdev@vger.kernel.org Reviewed-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 7f6ca95d16b96567ce4cf458a2790ff17fa620c3 Author: Jörn-Thorben Hinz Date: Fri Dec 22 00:19:01 2023 +0100 net: Implement missing getsockopt(SO_TIMESTAMPING_NEW) Commit 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW") added the new socket option SO_TIMESTAMPING_NEW. Setting the option is handled in sk_setsockopt(), querying it was not handled in sk_getsockopt(), though. Following remarks on an earlier submission of this patch, keep the old behavior of getsockopt(SO_TIMESTAMPING_OLD) which returns the active flags even if they actually have been set through SO_TIMESTAMPING_NEW. The new getsockopt(SO_TIMESTAMPING_NEW) is stricter, returning flags only if they have been set through the same option. Fixes: 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW") Link: https://lore.kernel.org/lkml/20230703175048.151683-1-jthinz@mailbox.tu-berlin.de/ Link: https://lore.kernel.org/netdev/0d7cddc9-03fa-43db-a579-14f3e822615b@app.fastmail.com/ Signed-off-by: Jörn-Thorben Hinz Reviewed-by: Willem de Bruijn Signed-off-by: David S. Miller commit 9bf2e9165f90dc9f416af53c902be7e33930f728 Author: Sarannya S Date: Thu Dec 21 15:36:51 2023 +0530 net: qrtr: ns: Return 0 if server port is not present When a 'DEL_CLIENT' message is received from the remote, the corresponding server port gets deleted. A DEL_SERVER message is then announced for this server. As part of handling the subsequent DEL_SERVER message, the name- server attempts to delete the server port which results in a '-ENOENT' error. The return value from server_del() is then propagated back to qrtr_ns_worker, causing excessive error prints. To address this, return 0 from control_cmd_del_server() without checking the return value of server_del(), since the above scenario is not an error case and hence server_del() doesn't have any other error return value. Signed-off-by: Sarannya Sasikumar Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 0d72ab35a925d66b044cb62b709e53141c3f0143 Author: Kent Overstreet Date: Fri Dec 29 21:16:32 2023 -0500 bcachefs: make RO snapshots actually RO Add checks to all the VFS paths for "are we in a RO snapshot?". Note - we don't check this when setting inode options via our xattr interface, since those generally only affect data placement, not contents of data. Signed-off-by: Kent Overstreet Reported-by: "Carl E. Thompson" commit 84f1638795da1ff2084597de4251e9054f1ad728 Author: Kent Overstreet Date: Fri Dec 29 15:25:07 2023 -0500 bcachefs: bch_sb_field_downgrade Add a new superblock section that contains a list of { minor version, recovery passes, errors_to_fix } that is - a list of recovery passes that must be run when downgrading past a given version, and a list of errors to silently fix. The upcoming disk accounting rewrite is not going to be fully compatible: we're going to have to regenerate accounting both when upgrading to the new version, and also from downgrading from the new version, since the new method of doing disk space accounting is a completely different architecture based on deltas, and synchronizing them for every jounal entry write to maintain compatibility is going to be too expensive and impractical. Signed-off-by: Kent Overstreet commit 8b16413cda7c46d47f8071165b3071f8a9369199 Author: Kent Overstreet Date: Fri Dec 29 15:15:14 2023 -0500 bcachefs: bch_sb.recovery_passes_required Add two new superblock fields. Since the main section of the superblock is now fully, we have to add a new variable length section for them - bch_sb_field_ext. - recovery_passes_requried: recovery passes that must be run on the next mount - errors_silent: errors that will be silently fixed These are to improve upgrading and dwongrading: these fields won't be cleared until after recovery successfully completes, so there won't be any issues with crashing partway through an upgrade or a downgrade. Signed-off-by: Kent Overstreet commit 808c680f2a256188951805f05c907d40919db37a Author: Kent Overstreet Date: Fri Dec 29 14:40:03 2023 -0500 bcachefs: Add persistent identifiers for recovery passes The next patch will start to refer to recovery passes from the superblock; naturally, we now need identifiers that don't change, since the existing enum is in the order in which they are run and is not fixed. Signed-off-by: Kent Overstreet commit 560661d4ae067276c14bf0dc89fdd0228f993150 Author: Kent Overstreet Date: Sat Dec 30 23:58:50 2023 -0500 bcachefs: prt_bitflags_vector() similar to prt_bitflags(), but for ulong arrays Signed-off-by: Kent Overstreet commit 6b49b0f7e73817265f80c565037ac812df6f1ae3 Author: Kent Overstreet Date: Sat Dec 30 23:56:41 2023 -0500 bcachefs: move BCH_SB_ERRS() to sb-errors_types.h we need BCH_SB_ERR_MAX in bcachefs.h Signed-off-by: Kent Overstreet commit d9534cc9fc455214e857bc1d32f44d5a229dc602 Author: Kent Overstreet Date: Sat Dec 30 15:32:05 2023 -0500 bcachefs: fix buffer overflow in nocow write path BCH_REPLICAS_MAX isn't the actual maximum number of pointers in an extent, it's the maximum number of dirty pointers. We don't have a real restriction on the number of cached pointers, and we don't want a fixed size array here anyways - so switch to DARRAY_PREALLOCATED(). Signed-off-by: Kent Overstreet Reported-and-tested-by: Daniel J Blueman commit 099dc5c29dff52c0c37abcaa6cc747a1ac8df5fe Author: Kent Overstreet Date: Sat Dec 30 14:38:29 2023 -0500 bcachefs: DARRAY_PREALLOCATED() Add support to darray for preallocating some number of elements. Signed-off-by: Kent Overstreet commit a58a6a58f5ad55aa1f5c54598c44f1d9938c1793 Author: Kent Overstreet Date: Thu Nov 16 19:44:48 2023 -0500 bcachefs: Switch darray to kvmalloc() We sometimes use darrays for quite large buffers - the btree write buffer in particular needs large buffers, since it must be sized to hold all the write buffer keys outstanding in the journal. Signed-off-by: Kent Overstreet commit 73ab9e03861c22ec6723b7b110d62ba60f37c164 Author: Kent Overstreet Date: Wed Nov 8 17:11:44 2023 -0500 bcachefs: Factor out darray resize slowpath Move the slowpath (actually growing the darray) to an out-of-line function; also, add some helpers for the upcoming btree write buffer rewrite. Signed-off-by: Kent Overstreet commit f87bf892ea9848696ddfd184964d303202dd19dd Author: Kent Overstreet Date: Fri Dec 29 17:18:56 2023 -0500 bcachefs: fix setting version_upgrade_complete If a superblock write hasn't happened (i.e. we never had to go rw), then c->sb.version will be out of date w.r.t. c->disk_sb.sb->version. Signed-off-by: Kent Overstreet commit f2eb8434e4fec891ae842183b9193ae759ee6d78 Author: Kent Overstreet Date: Sat Dec 30 20:52:18 2023 -0500 bcachefs: fix invalid free in dio write path turns out iterate_iovec() mutates __iov, we need to save our own copy Signed-off-by: Kent Overstreet Reported-by: Marcin Mirosław commit fa014953f9409edd32b04cb5c0f4167b8a537e65 Author: Kent Overstreet Date: Fri Dec 29 13:39:07 2023 -0500 bcachefs: Fix extents iteration + snapshots interaction peek_upto() checks against the end position and bails out before FILTER_SNAPSHOTS checks; this is because if we end up at a different inode number than the original search key none of the keys we see might be visibile in the current snapshot - we might be looking at inode in a completely different subvolume. But this is broken, because when we're iterating over extents we're checking against the extent start position to decide when to bail out, and the extent start position isn't monotonically increasing until after we've run FILTER_SNAPSHOTS. Fix this by adding a simple inode number check where the old bailout check was, and moving the main check to the correct position. Signed-off-by: Kent Overstreet Reported-by: "Carl E. Thompson" commit 82585d5e2af13608dd18fe2458126cd82e2cc255 Author: Radu Pirea (NXP OSS) Date: Thu Dec 21 17:44:19 2023 +0200 MAINTAINERS: step down as TJA11XX C45 maintainer I am stepping down as TJA11XX C45 maintainer. Andrei Botila will take the responsibility to maintain and improve the support for TJA11XX C45 PHYs. Signed-off-by: Radu Pirea (NXP OSS) Signed-off-by: David S. Miller commit 9c476269bff2908a20930c58085bf0b05ebd569a Author: Kai-Heng Feng Date: Fri Dec 22 12:34:09 2023 +0800 r8169: Fix PCI error on system resume Some r8168 NICs stop working upon system resume: [ 688.051096] r8169 0000:02:00.1 enp2s0f1: rtl_ep_ocp_read_cond == 0 (loop: 10, delay: 10000). [ 688.175131] r8169 0000:02:00.1 enp2s0f1: Link is Down ... [ 691.534611] r8169 0000:02:00.1 enp2s0f1: PCI error (cmd = 0x0407, status_errs = 0x0000) Not sure if it's related, but those NICs have a BMC device at function 0: 02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Realtek RealManage BMC [10ec:816e] (rev 1a) Trial and error shows that increase the loop wait on rtl_ep_ocp_read_cond to 30 can eliminate the issue, so let rtl8168ep_driver_start() to wait a bit longer. Fixes: e6d6ca6e1204 ("r8169: Add support for another RTL8168FP") Signed-off-by: Kai-Heng Feng Reviewed-by: Heiner Kallweit Signed-off-by: David S. Miller commit b901a4e276943f61e11ddb597a0abc1e7dfadf0f Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Fri Dec 22 01:13:59 2023 +0000 net/tcp_sigpool: Use kref_get_unless_zero() The freeing and re-allocation of algorithm are protected by cpool_mutex, so it doesn't fix an actual use-after-free, but avoids a deserved refcount_warn_saturate() warning. A trivial fix for the racy behavior. Fixes: 8c73b26315aa ("net/tcp: Prepare tcp_md5sig_pool for TCP-AO") Suggested-by: Eric Dumazet Signed-off-by: Dmitry Safonov Tested-by: Bagas Sanjaya Reported-by: syzbot Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 8fcb0382af6f1ef50936f1be05b8149eb2f88496 Author: Hangyu Hua Date: Thu Dec 21 10:25:31 2023 +0800 net: sched: em_text: fix possible memory leak in em_text_destroy() m->data needs to be freed when em_text_destroy is called. Fixes: d675c989ed2d ("[PKT_SCHED]: Packet classification based on textsearch (ematch)") Acked-by: Jamal Hadi Salim Signed-off-by: Hangyu Hua Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 610a9b8f49fbcf1100716370d3b5f6f884a2835a Author: Linus Torvalds Date: Sun Dec 31 12:51:25 2023 -0800 Linux 6.7-rc8 commit 2639772a11c860628c5f7007842eca52a1c34d78 Author: Alvin Šipraga Date: Tue Dec 19 02:25:15 2023 +0100 get_maintainer: remove stray punctuation when cleaning file emails When parsing emails from .yaml files in particular, stray punctuation such as a leading '-' can end up in the name. For example, consider a common YAML section such as: maintainers: - devicetree@vger.kernel.org This would previously be processed by get_maintainer.pl as: - Make the logic in clean_file_emails more robust by deleting any sub-names which consist of common single punctuation marks before proceeding to the best-effort name extraction logic. The output is then correct: devicetree@vger.kernel.org Some additional comments are added to the function to make things clearer to future readers. Link: https://lore.kernel.org/all/0173e76a36b3a9b4e7f324dd3a36fd4a9757f302.camel@perches.com/ Suggested-by: Joe Perches Signed-off-by: Alvin Šipraga Signed-off-by: Linus Torvalds commit 9c334eb9ce886247567573074b13c5ac29d1a41a Author: Alvin Šipraga Date: Tue Dec 19 02:25:14 2023 +0100 get_maintainer: correctly parse UTF-8 encoded names in files While the script correctly extracts UTF-8 encoded names from the MAINTAINERS file, the regular expressions damage my name when parsing from .yaml files. Fix this by replacing the Latin-1-compatible regular expressions with the unicode property matcher \p{L}, which matches on any letter according to the Unicode General Category of letters. The proposed solution only works if the script uses proper string encoding from the outset, so instruct Perl to unconditionally open all files with UTF-8 encoding. This should be safe, as the entire source tree is either UTF-8 or ASCII encoded anyway. See [1] for a detailed analysis. Furthermore, to prevent the \w expression from matching non-ASCII when checking for whether a name should be escaped with quotes, add the /a flag to the regular expression. The escaping logic was duplicated in two places, so it has been factored out into its own function. The original issue was also identified on the tools mailing list [2]. This should solve the observed side effects there as well. Link: https://lore.kernel.org/all/dzn6uco4c45oaa3ia4u37uo5mlt33obecv7gghj2l756fr4hdh@mt3cprft3tmq/ [1] Link: https://lore.kernel.org/tools/20230726-gush-slouching-a5cd41@meerkat/ [2] Signed-off-by: Alvin Šipraga Signed-off-by: Linus Torvalds commit 453f5db0619e2ad64076aab16ff5a00e0f7c53a2 Merge: b106bcf0f99ae d05cb470663a2 Author: Linus Torvalds Date: Sat Dec 30 11:37:35 2023 -0800 Merge tag 'trace-v6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt: - Fix readers that are blocked on the ring buffer when buffer_percent is 100%. They are supposed to wake up when the buffer is full, but because the sub-buffer that the writer is on is never considered "dirty" in the calculation, dirty pages will never equal nr_pages. Add +1 to the dirty count in order to count for the sub-buffer that the writer is on. - When a reader is blocked on the "snapshot_raw" file, it is to be woken up when a snapshot is done and be able to read the snapshot buffer. But because the snapshot swaps the buffers (the main one with the snapshot one), and the snapshot reader is waiting on the old snapshot buffer, it was not woken up (because it is now on the main buffer after the swap). Worse yet, when it reads the buffer after a snapshot, it's not reading the snapshot buffer, it's reading the live active main buffer. Fix this by forcing a wakeup of all readers on the snapshot buffer when a new snapshot happens, and then update the buffer that the reader is reading to be back on the snapshot buffer. - Fix the modification of the direct_function hash. There was a race when new functions were added to the direct_function hash as when it moved function entries from the old hash to the new one, a direct function trace could be hit and not see its entry. This is fixed by allocating the new hash, copy all the old entries onto it as well as the new entries, and then use rcu_assign_pointer() to update the new direct_function hash with it. This also fixes a memory leak in that code. - Fix eventfs ownership * tag 'trace-v6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: ftrace: Fix modification of direct_function hash while in use tracing: Fix blocked reader of snapshot buffer ring-buffer: Fix wake ups when buffer_percent is set to 100 eventfs: Fix file and directory uid and gid ownership commit b106bcf0f99ae0459f3c8c2f0af575ef9f5d9bde Author: David Laight Date: Fri Dec 29 20:56:03 2023 +0000 locking/osq_lock: Clarify osq_wait_next() Directly return NULL or 'next' instead of breaking out of the loop. Signed-off-by: David Laight [ Split original patch into two independent parts - Linus ] Link: https://lore.kernel.org/lkml/7c8828aec72e42eeb841ca0ee3397e9a@AcuMS.aculab.com/ Signed-off-by: Linus Torvalds commit 563adbfc351b2af9f1406b809ba60b9f1673a882 Author: David Laight Date: Fri Dec 29 20:56:03 2023 +0000 locking/osq_lock: Clarify osq_wait_next() calling convention osq_wait_next() is passed 'prev' from osq_lock() and NULL from osq_unlock() but only needs the 'cpu' value to write to lock->tail. Just pass prev->cpu or OSQ_UNLOCKED_VAL instead. Should have no effect on the generated code since gcc manages to assume that 'prev != NULL' due to an earlier dereference. Signed-off-by: David Laight [ Changed 'old' to 'old_cpu' by request from Waiman Long - Linus ] Signed-off-by: Linus Torvalds commit 7c223098212957a1ecd8768e8e747ae2cf88e880 Author: David Laight Date: Fri Dec 29 20:53:49 2023 +0000 locking/osq_lock: Move the definition of optimistic_spin_node into osq_lock.c struct optimistic_spin_node is private to the implementation. Move it into the C file to ensure nothing is accessing it. Signed-off-by: David Laight Acked-by: Waiman Long Signed-off-by: Linus Torvalds commit d05cb470663a2a1879277e544f69e660208f08f2 Author: Steven Rostedt (Google) Date: Fri Dec 29 11:51:34 2023 -0500 ftrace: Fix modification of direct_function hash while in use Masami Hiramatsu reported a memory leak in register_ftrace_direct() where if the number of new entries are added is large enough to cause two allocations in the loop: for (i = 0; i < size; i++) { hlist_for_each_entry(entry, &hash->buckets[i], hlist) { new = ftrace_add_rec_direct(entry->ip, addr, &free_hash); if (!new) goto out_remove; entry->direct = addr; } } Where ftrace_add_rec_direct() has: if (ftrace_hash_empty(direct_functions) || direct_functions->count > 2 * (1 << direct_functions->size_bits)) { struct ftrace_hash *new_hash; int size = ftrace_hash_empty(direct_functions) ? 0 : direct_functions->count + 1; if (size < 32) size = 32; new_hash = dup_hash(direct_functions, size); if (!new_hash) return NULL; *free_hash = direct_functions; direct_functions = new_hash; } The "*free_hash = direct_functions;" can happen twice, losing the previous allocation of direct_functions. But this also exposed a more serious bug. The modification of direct_functions above is not safe. As direct_functions can be referenced at any time to find what direct caller it should call, the time between: new_hash = dup_hash(direct_functions, size); and direct_functions = new_hash; can have a race with another CPU (or even this one if it gets interrupted), and the entries being moved to the new hash are not referenced. That's because the "dup_hash()" is really misnamed and is really a "move_hash()". It moves the entries from the old hash to the new one. Now even if that was changed, this code is not proper as direct_functions should not be updated until the end. That is the best way to handle function reference changes, and is the way other parts of ftrace handles this. The following is done: 1. Change add_hash_entry() to return the entry it created and inserted into the hash, and not just return success or not. 2. Replace ftrace_add_rec_direct() with add_hash_entry(), and remove the former. 3. Allocate a "new_hash" at the start that is made for holding both the new hash entries as well as the existing entries in direct_functions. 4. Copy (not move) the direct_function entries over to the new_hash. 5. Copy the entries of the added hash to the new_hash. 6. If everything succeeds, then use rcu_pointer_assign() to update the direct_functions with the new_hash. This simplifies the code and fixes both the memory leak as well as the race condition mentioned above. Link: https://lore.kernel.org/all/170368070504.42064.8960569647118388081.stgit@devnote2/ Link: https://lore.kernel.org/linux-trace-kernel/20231229115134.08dd5174@gandalf.local.home Cc: stable@vger.kernel.org Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Jiri Olsa Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Masami Hiramatsu (Google) Fixes: 763e34e74bb7d ("ftrace: Add register_ftrace_direct()") Signed-off-by: Steven Rostedt (Google) commit 13a5b21197587a3d9cac9e1a00de9b91526a55e4 Author: Aabish Malik Date: Fri Dec 29 22:33:54 2023 +0530 ALSA: hda/realtek: enable SND_PCI_QUIRK for hp pavilion 14-ec1xxx series The HP Pavilion 14 ec1xxx series uses the HP mainboard 8A0F with the ALC287 codec. The mute led can be enabled using the already existing ALC287_FIXUP_HP_GPIO_LED quirk. Tested on an HP Pavilion ec1003AU Signed-off-by: Aabish Malik Cc: Link: https://lore.kernel.org/r/20231229170352.742261-3-aabishmalik3337@gmail.com Signed-off-by: Takashi Iwai commit dcea1bd45e6d111cc8fc1aaefa7e31694089bda3 Author: David Thompson Date: Wed Dec 20 18:47:39 2023 -0500 mlxbf_gige: fix receive packet race condition Under heavy traffic, the BlueField Gigabit interface can become unresponsive. This is due to a possible race condition in the mlxbf_gige_rx_packet function, where the function exits with producer and consumer indices equal but there are remaining packet(s) to be processed. In order to prevent this situation, read receive consumer index *before* the HW replenish so that the mlxbf_gige_rx_packet function returns an accurate return value even if a packet is received into just-replenished buffer prior to exiting this routine. If the just-replenished buffer is received and occupies the last RX ring entry, the interface would not recover and instead would encounter RX packet drops related to internal buffer shortages since the driver RX logic is not being triggered to drain the RX ring. This patch will address and prevent this "ring full" condition. Fixes: f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver") Reviewed-by: Asmaa Mnebhi Signed-off-by: David Thompson Signed-off-by: David S. Miller commit f016f7547aeedefed9450499d002ba983b8fce15 Merge: e543d0b5ecf28 ad5575eb62788 Author: Linus Torvalds Date: Fri Dec 29 11:57:26 2023 -0800 Merge tag 'gpio-fixes-for-v6.7-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - Andy steps down as GPIO reviewer - Kent becomes a reviewer for GPIO uAPI - add missing intel file to the relevant MAINTAINERS section * tag 'gpio-fixes-for-v6.7-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: MAINTAINERS: Add a missing file to the INTEL GPIO section MAINTAINERS: Remove Andy from GPIO maintainers MAINTAINERS: split out the uAPI into a new section commit e543d0b5ecf28f69b5fca94ea770b802c32d884f Merge: 09c57a762e797 70681aa0746ae Author: Linus Torvalds Date: Fri Dec 29 11:50:47 2023 -0800 Merge tag 'platform-drivers-x86-v6.7-6' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Ilpo Järvinen: - Intel PMC GBE LTR regression - P2SB / PCI deadlock fix * tag 'platform-drivers-x86-v6.7-6' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86/intel/pmc: Move GBE LTR ignore to suspend callback platform/x86/intel/pmc: Allow reenabling LTRs platform/x86/intel/pmc: Add suspend callback platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe commit 09c57a762e797a55f6336c9798f576c889658ba5 Merge: 8735c7c84d1bc 02d374f3418df Author: Linus Torvalds Date: Fri Dec 29 11:41:40 2023 -0800 Merge tag 'block-6.7-2023-12-29' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: "Fix for a badly numbered flag, and a regression fix for the badblocks updates from this merge window" * tag 'block-6.7-2023-12-29' of git://git.kernel.dk/linux: block: renumber QUEUE_FLAG_HW_WC badblocks: avoid checking invalid range in badblocks_check() commit 5b8fbf50a54b02e09eb64679defdebd4bc7dfe8a Author: Mathieu Othacehe Date: Sat Dec 23 15:42:22 2023 +0100 mailmap: add entries for Mathieu Othacehe Add my gnu.org mail address. Link: https://lkml.kernel.org/r/20231223144226.25740-1-othacehe@gnu.org Signed-off-by: Mathieu Othacehe Cc: Bjorn Andersson Cc: Heiko Stuebner Cc: Jakub Kicinski Cc: Jiri Kosina Cc: Konrad Dybcio Cc: Matthieu Baerts Cc: Matt Ranostay Cc: Oleksij Rempel Signed-off-by: Andrew Morton commit c1bacb02cb2f2c56db10f3d927acb5f91fe4d064 Author: Zack Rusin Date: Sun Dec 24 00:20:36 2023 -0500 MAINTAINERS: change vmware.com addresses to broadcom.com Update the email addresses for vmwgfx and vmmouse to reflect the fact that VMware is now part of Broadcom. Add a .mailmap entry because the vmware.com address will start bouncing soon. Link: https://lkml.kernel.org/r/20231224052036.603621-1-zack.rusin@broadcom.com Signed-off-by: Zack Rusin Acked-by: Florian Fainelli Cc: Ian Forbes Cc: Martin Krastev Cc: Maaz Mombasawala Signed-off-by: Andrew Morton commit 46e714c729c8d1d8110bc0545d7ffe8a759c9dc0 Author: Suren Baghdasaryan Date: Tue Dec 26 13:46:10 2023 -0800 arch/mm/fault: fix major fault accounting when retrying under per-VMA lock A test [1] in Android test suite started failing after [2] was merged. It turns out that after handling a major fault under per-VMA lock, the process major fault counter does not register that fault as major. Before [2] read faults would be done under mmap_lock, in which case FAULT_FLAG_TRIED flag is set before retrying. That in turn causes mm_account_fault() to account the fault as major once retry completes. With per-VMA locks we often retry because a fault can't be handled without locking the whole mm using mmap_lock. Therefore such retries do not set FAULT_FLAG_TRIED flag. This logic does not work after [2] because we can now handle read major faults under per-VMA lock and upon retry the fact there was a major fault gets lost. Fix this by setting FAULT_FLAG_TRIED after retrying under per-VMA lock if VM_FAULT_MAJOR was returned. Ideally we would use an additional VM_FAULT bit to indicate the reason for the retry (could not handle under per-VMA lock vs other reason) but this simpler solution seems to work, so keeping it simple. [1] https://cs.android.com/android/platform/superproject/+/master:test/vts-testcase/kernel/api/drop_caches_prop/drop_caches_test.cpp [2] https://lore.kernel.org/all/20231006195318.4087158-6-willy@infradead.org/ Link: https://lkml.kernel.org/r/20231226214610.109282-1-surenb@google.com Fixes: 12214eba1992 ("mm: handle read faults under the VMA lock") Signed-off-by: Suren Baghdasaryan Cc: Matthew Wilcox Cc: Alexander Gordeev Cc: Andy Lutomirski Cc: Catalin Marinas Cc: Christophe Leroy Cc: Dave Hansen Cc: Gerald Schaefer Cc: Michael Ellerman Cc: Palmer Dabbelt Cc: Peter Zijlstra Cc: Will Deacon Signed-off-by: Andrew Morton commit c28ac3c7eb945fee6e20f47d576af68fdff1392a Author: Yu Zhao Date: Fri Dec 22 21:56:47 2023 -0700 mm/mglru: skip special VMAs in lru_gen_look_around() Special VMAs like VM_PFNMAP can contain anon pages from COW. There isn't much profit in doing lookaround on them. Besides, they can trigger the pte_special() warning in get_pte_pfn(). Skip them in lru_gen_look_around(). Link: https://lkml.kernel.org/r/20231223045647.1566043-1-yuzhao@google.com Fixes: 018ee47f1489 ("mm: multi-gen LRU: exploit locality in rmap") Signed-off-by: Yu Zhao Reported-by: syzbot+03fd9b3f71641f0ebf2d@syzkaller.appspotmail.com Closes: https://lore.kernel.org/000000000000f9ff00060d14c256@google.com/ Cc: Signed-off-by: Andrew Morton commit 4bdd58df05cf9df0c0e43daaa83e73d77629c252 Author: Naoya Horiguchi Date: Fri Dec 22 11:40:24 2023 +0900 MAINTAINERS: hand over hwpoison maintainership to Miaohe Lin Miaohe Lin has contributed to hwpoison subsystem as a reviewer for more than 1.5 year, and has made many patch contributions in hwpoison subsystem and the memory management subsystem. So I'd like to pass on the hwpoison maintainership to Miaohe. [nao.horiguchi@gmail.com: update to keep myself as a reviewer] Link: https://lkml.kernel.org/r/20231223031115.GA2883156@u2004 Link: https://lkml.kernel.org/r/20231222024024.1601043-1-naoya.horiguchi@linux.dev Signed-off-by: Naoya Horiguchi Cc: Miaohe Lin Cc: David Hildenbrand Signed-off-by: Andrew Morton commit 140a923bc18e5355ddc54fbe70c0ee0ac23a9616 Author: Mike Kravetz Date: Wed Dec 20 14:08:43 2023 -0800 MAINTAINERS: remove hugetlb maintainer Mike Kravetz I am stepping away from my role as hugetlb maintainer. There should be no gap in coverage as Muchun Song is also a hugetlb maintainer. [akpm@linux-foundation.org: update CREDITS] Link: https://lkml.kernel.org/r/20231220220843.73586-1-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit 9eab0421fa94a3dde0d1f7e36ab3294fc306c99d Author: Jiajun Xie Date: Wed Dec 20 13:28:39 2023 +0800 mm: fix unmap_mapping_range high bits shift bug The bug happens when highest bit of holebegin is 1, suppose holebegin is 0x8000000111111000, after shift, hba would be 0xfff8000000111111, then vma_interval_tree_foreach would look it up fail or leads to the wrong result. error call seq e.g.: - mmap(..., offset=0x8000000111111000) |- syscall(mmap, ... unsigned long, off): |- ksys_mmap_pgoff( ... , off >> PAGE_SHIFT); here pgoff is correctly shifted to 0x8000000111111, but pass 0x8000000111111000 as holebegin to unmap would then cause terrible result, as shown below: - unmap_mapping_range(..., loff_t const holebegin) |- pgoff_t hba = holebegin >> PAGE_SHIFT; /* hba = 0xfff8000000111111 unexpectedly */ The issue happens in Heterogeneous computing, where the device(e.g. gpu) and host share the same virtual address space. A simple workflow pattern which hit the issue is: /* host */ 1. userspace first mmap a file backed VA range with specified offset. e.g. (offset=0x800..., mmap return: va_a) 2. write some data to the corresponding sys page e.g. (va_a = 0xAABB) /* device */ 3. gpu workload touches VA, triggers gpu fault and notify the host. /* host */ 4. reviced gpu fault notification, then it will: 4.1 unmap host pages and also takes care of cpu tlb (use unmap_mapping_range with offset=0x800...) 4.2 migrate sys page to device 4.3 setup device page table and resolve device fault. /* device */ 5. gpu workload continued, it accessed va_a and got 0xAABB. 6. gpu workload continued, it wrote 0xBBCC to va_a. /* host */ 7. userspace access va_a, as expected, it will: 7.1 trigger cpu vm fault. 7.2 driver handling fault to migrate gpu local page to host. 8. userspace then could correctly get 0xBBCC from va_a 9. done But in step 4.1, if we hit the bug this patch mentioned, then userspace would never trigger cpu fault, and still get the old value: 0xAABB. Making holebegin unsigned first fixes the bug. Link: https://lkml.kernel.org/r/20231220052839.26970-1-jiajun.xie.sh@gmail.com Signed-off-by: Jiajun Xie Cc: Signed-off-by: Andrew Morton commit 9bcef5973e31020e5aa8571eb994d67b77318356 Author: Baolin Wang Date: Wed Dec 20 14:51:40 2023 +0800 mm: memcg: fix split queue list crash when large folio migration When running autonuma with enabling multi-size THP, I encountered the following kernel crash issue: [ 134.290216] list_del corruption. prev->next should be fffff9ad42e1c490, but was dead000000000100. (prev=fffff9ad42399890) [ 134.290877] kernel BUG at lib/list_debug.c:62! [ 134.291052] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [ 134.291210] CPU: 56 PID: 8037 Comm: numa01 Kdump: loaded Tainted: G E 6.7.0-rc4+ #20 [ 134.291649] RIP: 0010:__list_del_entry_valid_or_report+0x97/0xb0 ...... [ 134.294252] Call Trace: [ 134.294362] [ 134.294440] ? die+0x33/0x90 [ 134.294561] ? do_trap+0xe0/0x110 ...... [ 134.295681] ? __list_del_entry_valid_or_report+0x97/0xb0 [ 134.295842] folio_undo_large_rmappable+0x99/0x100 [ 134.296003] destroy_large_folio+0x68/0x70 [ 134.296172] migrate_folio_move+0x12e/0x260 [ 134.296264] ? __pfx_remove_migration_pte+0x10/0x10 [ 134.296389] migrate_pages_batch+0x495/0x6b0 [ 134.296523] migrate_pages+0x1d0/0x500 [ 134.296646] ? __pfx_alloc_misplaced_dst_folio+0x10/0x10 [ 134.296799] migrate_misplaced_folio+0x12d/0x2b0 [ 134.296953] do_numa_page+0x1f4/0x570 [ 134.297121] __handle_mm_fault+0x2b0/0x6c0 [ 134.297254] handle_mm_fault+0x107/0x270 [ 134.300897] do_user_addr_fault+0x167/0x680 [ 134.304561] exc_page_fault+0x65/0x140 [ 134.307919] asm_exc_page_fault+0x22/0x30 The reason for the crash is that, the commit 85ce2c517ade ("memcontrol: only transfer the memcg data for migration") removed the charging and uncharging operations of the migration folios and cleared the memcg data of the old folio. During the subsequent release process of the old large folio in destroy_large_folio(), if the large folio needs to be removed from the split queue, an incorrect split queue can be obtained (which is pgdat->deferred_split_queue) because the old folio's memcg is NULL now. This can lead to list operations being performed under the wrong split queue lock protection, resulting in a list crash as above. After the migration, the old folio is going to be freed, so we can remove it from the split queue in mem_cgroup_migrate() a bit earlier before clearing the memcg data to avoid getting incorrect split queue. [akpm@linux-foundation.org: fix comment, per Zi Yan] Link: https://lkml.kernel.org/r/61273e5e9b490682388377c20f52d19de4a80460.1703054559.git.baolin.wang@linux.alibaba.com Fixes: 85ce2c517ade ("memcontrol: only transfer the memcg data for migration") Signed-off-by: Baolin Wang Reviewed-by: Nhat Pham Reviewed-by: Yang Shi Reviewed-by: Zi Yan Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit fa151a39a6879144b587f35c0dfcc15e1be9450f Author: Jingbo Xu Date: Tue Dec 19 22:25:08 2023 +0800 mm: fix arithmetic for max_prop_frac when setting max_ratio Since now bdi->max_ratio is part per million, fix the wrong arithmetic for max_prop_frac when setting max_ratio. Otherwise the miscalculated max_prop_frac will affect the incrementing of writeout completion count when max_ratio is not 100%. Link: https://lkml.kernel.org/r/20231219142508.86265-3-jefflexu@linux.alibaba.com Fixes: efc3e6ad53ea ("mm: split off __bdi_set_max_ratio() function") Signed-off-by: Jingbo Xu Cc: Joseph Qi Cc: Matthew Wilcox (Oracle) Cc: Stefan Roesch Signed-off-by: Andrew Morton commit e0646b7590084a5bf3b056d3ad871d9379d2c25a Author: Jingbo Xu Date: Tue Dec 19 22:25:07 2023 +0800 mm: fix arithmetic for bdi min_ratio Since now bdi->min_ratio is part per million, fix the wrong arithmetic. Otherwise it will fail with -EINVAL when setting a reasonable min_ratio, as it tries to set min_ratio to (min_ratio * BDI_RATIO_SCALE) in percentage unit, which exceeds 100% anyway. # cat /sys/class/bdi/253\:0/min_ratio 0 # cat /sys/class/bdi/253\:0/max_ratio 100 # echo 1 > /sys/class/bdi/253\:0/min_ratio -bash: echo: write error: Invalid argument Link: https://lkml.kernel.org/r/20231219142508.86265-2-jefflexu@linux.alibaba.com Fixes: 8021fb3232f2 ("mm: split off __bdi_set_min_ratio() function") Signed-off-by: Jingbo Xu Reported-by: Joseph Qi Cc: Matthew Wilcox (Oracle) Cc: Stefan Roesch Signed-off-by: Andrew Morton commit efa7df3e3bb5da8e6abbe37727417f32a37fba47 Author: Rik van Riel Date: Thu Dec 14 14:34:23 2023 -0800 mm: align larger anonymous mappings on THP boundaries Align larger anonymous memory mappings on THP boundaries by going through thp_get_unmapped_area if THPs are enabled for the current process. With this patch, larger anonymous mappings are now THP aligned. When a malloc library allocates a 2MB or larger arena, that arena can now be mapped with THPs right from the start, which can result in better TLB hit rates and execution time. Link: https://lkml.kernel.org/r/20220809142457.4751229f@imladris.surriel.com Link: https://lkml.kernel.org/r/20231214223423.1133074-1-yang@os.amperecomputing.com Signed-off-by: Rik van Riel Reviewed-by: Yang Shi Cc: Matthew Wilcox Cc: Christopher Lameter Signed-off-by: Andrew Morton commit 38744c3fa00109c51076121c2deb4f02e2f09194 Author: Eugen Hristev Date: Fri Dec 29 13:43:42 2023 +0200 ASoC: mediatek: mt8186: fix AUD_PAD_TOP register and offset AUD_PAD_TOP widget's correct register is AFE_AUD_PAD_TOP , and not zero. Having a zero as register, it would mean that the `snd_soc_dapm_new_widgets` would try to read the register at offset zero when trying to get the power status of this widget, which is incorrect. Fixes: b65c466220b3 ("ASoC: mediatek: mt8186: support adda in platform driver") Signed-off-by: Eugen Hristev Link: https://lore.kernel.org/r/20231229114342.195867-1-eugen.hristev@collabora.com Signed-off-by: Mark Brown commit 09eeb0723f219fbd96d8865bf9b935e03ee2ec22 Author: Shyam Prasad N Date: Fri Dec 29 11:16:16 2023 +0000 cifs: do not depend on release_iface for maintaining iface_list parse_server_interfaces should be in complete charge of maintaining the iface_list linked list. Today, iface entries are removed from the list only when the last refcount is dropped. i.e. in release_iface. However, this can result in undercounting of refcount if the server stops advertising interfaces (which Azure SMB server does). This change puts parse_server_interfaces in full charge of maintaining the iface_list. So if an empty list is returned by the server, the entries in the list will immediately be removed. This way, a following call to the same function will not find entries in the list. Fixes: aa45dadd34e4 ("cifs: change iface_list from array to sorted linked list") Cc: stable@vger.kernel.org Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 7257bcf3bdc785eabc4eef1f329a59815b032508 Author: Shyam Prasad N Date: Fri Dec 29 11:16:15 2023 +0000 cifs: cifs_chan_is_iface_active should be called with chan_lock held cifs_chan_is_iface_active checks the channels of a session to see if the associated iface is active. This should always happen with chan_lock held. However, these two callers of this function were missing this locking. This change makes sure the function calls are protected with proper locking. Fixes: b54034a73baf ("cifs: during reconnect, update interface if necessary") Fixes: fa1d0508bdd4 ("cifs: account for primary channel in the interface list") Cc: stable@vger.kernel.org Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 27e1fd343f80168ff456785c2443136b6b7ca3cc Author: Shyam Prasad N Date: Fri Dec 29 11:30:07 2023 +0000 cifs: after disabling multichannel, mark tcon for reconnect Once the server disables multichannel for an active multichannel session, on the following reconnect, the client would reduce the number of channels to 1. However, it could be the case that the tree connect was active on one of these disabled channels. This results in an unrecoverable state. This change fixes that by making sure that whenever a channel is being terminated, the session and tcon are marked for reconnect too. This could mean a few redundant tree connect calls to the server, but considering that this is not a frequent event, we should be okay. Fixes: ee1d21794e55 ("cifs: handle when server stops supporting multichannel") Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 0b2dca555d78c296de39c0ce29c997e55889d76a Author: Geoffrey D. Bennett Date: Wed Dec 27 03:06:48 2023 +1030 ALSA: scarlett2: Convert meter levels from little-endian Add missing conversion from little-endian data to CPU-endian in scarlett2_usb_get_meter_levels(). Fixes: 3473185f31df ("ALSA: scarlett2: Remap Level Meter values") Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/ZYsBIE3DSKdi4YC/@m.b4.vu Signed-off-by: Takashi Iwai commit 39a7dc23a1ed0fe81141792a09449d124c5953bd Author: Steven Rostedt (Google) Date: Thu Dec 28 09:51:49 2023 -0500 tracing: Fix blocked reader of snapshot buffer If an application blocks on the snapshot or snapshot_raw files, expecting to be woken up when a snapshot occurs, it will not happen. Or it may happen with an unexpected result. That result is that the application will be reading the main buffer instead of the snapshot buffer. That is because when the snapshot occurs, the main and snapshot buffers are swapped. But the reader has a descriptor still pointing to the buffer that it originally connected to. This is fine for the main buffer readers, as they may be blocked waiting for a watermark to be hit, and when a snapshot occurs, the data that the main readers want is now on the snapshot buffer. But for waiters of the snapshot buffer, they are waiting for an event to occur that will trigger the snapshot and they can then consume it quickly to save the snapshot before the next snapshot occurs. But to do this, they need to read the new snapshot buffer, not the old one that is now receiving new data. Also, it does not make sense to have a watermark "buffer_percent" on the snapshot buffer, as the snapshot buffer is static and does not receive new data except all at once. Link: https://lore.kernel.org/linux-trace-kernel/20231228095149.77f5b45d@gandalf.local.home Cc: stable@vger.kernel.org Cc: Mathieu Desnoyers Cc: Mark Rutland Acked-by: Masami Hiramatsu (Google) Fixes: debdd57f5145f ("tracing: Make a snapshot feature available from userspace") Signed-off-by: Steven Rostedt (Google) commit 623b1f896fa8a669a277ee5a258307a16c7377a3 Author: Steven Rostedt (Google) Date: Tue Dec 26 12:59:02 2023 -0500 ring-buffer: Fix wake ups when buffer_percent is set to 100 The tracefs file "buffer_percent" is to allow user space to set a water-mark on how much of the tracing ring buffer needs to be filled in order to wake up a blocked reader. 0 - is to wait until any data is in the buffer 1 - is to wait for 1% of the sub buffers to be filled 50 - would be half of the sub buffers are filled with data 100 - is not to wake the waiter until the ring buffer is completely full Unfortunately the test for being full was: dirty = ring_buffer_nr_dirty_pages(buffer, cpu); return (dirty * 100) > (full * nr_pages); Where "full" is the value for "buffer_percent". There is two issues with the above when full == 100. 1. dirty * 100 > 100 * nr_pages will never be true That is, the above is basically saying that if the user sets buffer_percent to 100, more pages need to be dirty than exist in the ring buffer! 2. The page that the writer is on is never considered dirty, as dirty pages are only those that are full. When the writer goes to a new sub-buffer, it clears the contents of that sub-buffer. That is, even if the check was ">=" it would still not be equal as the most pages that can be considered "dirty" is nr_pages - 1. To fix this, add one to dirty and use ">=" in the compare. Link: https://lore.kernel.org/linux-trace-kernel/20231226125902.4a057f1d@gandalf.local.home Cc: stable@vger.kernel.org Cc: Mark Rutland Cc: Mathieu Desnoyers Acked-by: Masami Hiramatsu (Google) Fixes: 03329f9939781 ("tracing: Add tracefs file buffer_percentage") Signed-off-by: Steven Rostedt (Google) commit 70681aa0746ae61d7668b9f651221fad5e30c71e Author: David E. Box Date: Fri Dec 22 19:25:45 2023 -0800 platform/x86/intel/pmc: Move GBE LTR ignore to suspend callback Commit 804951203aa5 ("platform/x86:intel/pmc: Combine core_init() and core_configure()") caused a network performance regression due to the GBE LTR ignore that it added at probe. This was needed in order to allow the SoC to enter the deepest Package C state. To fix the regression and at least support PC10 during suspend, move the LTR ignore from probe to the suspend callback, and enable it again on resume. This solution will allow PC10 during suspend but restrict Package C entry at runtime to no deeper than PC8/9 while a network cable it attach to the PCH LAN. Fixes: 804951203aa5 ("platform/x86:intel/pmc: Combine core_init() and core_configure()") Signed-off-by: "David E. Box" Link: https://lore.kernel.org/r/20231223032548.1680738-6-david.e.box@linux.intel.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 6f9cc5c1f94daa98846b2073733d03ced709704b Author: David E. Box Date: Fri Dec 22 19:25:44 2023 -0800 platform/x86/intel/pmc: Allow reenabling LTRs Commit 804951203aa5 ("platform/x86:intel/pmc: Combine core_init() and core_configure()") caused a network performance regression due to the GBE LTR ignore that it added during probe. The fix will move the ignore to occur at suspend-time (so as to not affect suspend power). This will require the ability to enable the LTR again on resume. Modify pmc_core_send_ltr_ignore() to allow enabling an LTR. Fixes: 804951203aa5 ("platform/x86:intel/pmc: Combine core_init() and core_configure()") Signed-off-by: "David E. Box" Link: https://lore.kernel.org/r/20231223032548.1680738-5-david.e.box@linux.intel.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 7c13f365aee68b01e7e68ee293a71fdc7571c111 Author: David E. Box Date: Fri Dec 22 19:25:43 2023 -0800 platform/x86/intel/pmc: Add suspend callback Add a suspend callback to struct pmc for performing platform specific tasks before device suspend. This is needed in order to perform GBE LTR ignore on certain platforms at suspend-time instead of at probe-time and replace the GBE LTR ignore removal that was done in order to fix a bug introduced by commit 804951203aa5 ("platform/x86:intel/pmc: Combine core_init() and core_configure()"). Fixes: 804951203aa5 ("platform/x86:intel/pmc: Combine core_init() and core_configure()") Signed-off-by: "David E. Box" Link: https://lore.kernel.org/r/20231223032548.1680738-4-david.e.box@linux.intel.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit b28ff7a7c3245d7f62acc20f15b4361292fe4117 Author: Shin'ichiro Kawasaki Date: Fri Dec 29 15:39:11 2023 +0900 platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe p2sb_bar() unhides P2SB device to get resources from the device. It guards the operation by locking pci_rescan_remove_lock so that parallel rescans do not find the P2SB device. However, this lock causes deadlock when PCI bus rescan is triggered by /sys/bus/pci/rescan. The rescan locks pci_rescan_remove_lock and probes PCI devices. When PCI devices call p2sb_bar() during probe, it locks pci_rescan_remove_lock again. Hence the deadlock. To avoid the deadlock, do not lock pci_rescan_remove_lock in p2sb_bar(). Instead, do the lock at fs_initcall. Introduce p2sb_cache_resources() for fs_initcall which gets and caches the P2SB resources. At p2sb_bar(), refer the cache and return to the caller. Suggested-by: Andy Shevchenko Fixes: 9745fb07474f ("platform/x86/intel: Add Primary to Sideband (P2SB) bridge support") Cc: stable@vger.kernel.org Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Andy Shevchenko Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/linux-pci/6xb24fjmptxxn5js2fjrrddjae6twex5bjaftwqsuawuqqqydx@7cl3uik5ef6j/ Link: https://lore.kernel.org/r/20231229063912.2517922-2-shinichiro.kawasaki@wdc.com Signed-off-by: Ilpo Järvinen commit 4e7914eb1dae377b8e6de59c96b0653aacb47646 Author: Gergo Koteles Date: Fri Dec 22 01:34:48 2023 +0100 ALSA: hda/tas2781: remove sound controls in unbind Remove sound controls in hda_unbind to make module loadable after module unload. Add a driver specific struct (tas2781_hda) to store the controls. This patch depends on patch: ALSA: hda/tas2781: do not use regcache Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") CC: stable@vger.kernel.org Signed-off-by: Gergo Koteles Link: https://lore.kernel.org/r/362aa3e2f81b9259a3e5222f576bec5debfc5e88.1703204848.git.soyer@irl.hu Signed-off-by: Takashi Iwai commit e7aa105657f7f62f54a493480588895cc8a9a1a7 Author: Gergo Koteles Date: Fri Dec 22 01:34:47 2023 +0100 ALSA: hda/tas2781: move set_drv_data outside tasdevice_init allow driver specific driver data in tas2781-hda-i2c and tas2781-i2c Fixes: ef3bcde75d06 ("ASoC: tas2781: Add tas2781 driver") CC: stable@vger.kernel.org Signed-off-by: Gergo Koteles Link: https://lore.kernel.org/r/1398bd8bf3e935b1595a99128320e4a1913e210a.1703204848.git.soyer@irl.hu Signed-off-by: Takashi Iwai commit a0c9f7f2e0a46554737509459552789300a4e854 Author: Gergo Koteles Date: Fri Dec 22 01:11:54 2023 +0100 ALSA: hda/tas2781: fix typos in comment Correct typos. Signed-off-by: Gergo Koteles Link: https://lore.kernel.org/r/ead5609d63e71e8e87c13e1767decca5b272d696.1703203812.git.soyer@irl.hu Signed-off-by: Takashi Iwai commit 6dad45f4d28977bd1948973107cf325d431e5b7e Author: Gergo Koteles Date: Fri Dec 22 00:48:56 2023 +0100 ALSA: hda/tas2781: do not use regcache There are two problems with using regcache in this module. The amplifier has 3 addressing levels (BOOK, PAGE, REG). The firmware contains blocks that must be written to BOOK 0x8C. The regcache doesn't know anything about BOOK, so regcache_sync writes invalid values to the actual BOOK. The module handles 2 or more separate amplifiers. The amplifiers have different register values, and the module uses only one regmap/regcache for all the amplifiers. The regcache_sync only writes the last amplifier used. The module successfully restores all the written register values (RC profile, program, configuration, calibration) without regcache. Remove regcache functions and set regmap cache_type to REGCACHE_NONE. Link: https://lore.kernel.org/r/21a183b5a08cb23b193af78d4b1114cc59419272.1701906455.git.soyer@irl.hu/ Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") Acked-by: Mark Brown CC: stable@vger.kernel.org Signed-off-by: Gergo Koteles Link: https://lore.kernel.org/r/491aeed0e2eecc3b704ec856f815db21bad3ba0e.1703202126.git.soyer@irl.hu Signed-off-by: Takashi Iwai commit 97417cd79ce179a774b245a3f5535cc3fbbaee50 Author: Sagi Maimon Date: Wed Dec 20 10:19:14 2023 +0200 ptp: ocp: fix bug in unregistering the DPLL subsystem When unregistering the DPLL subsystem the priv pointer is different then the one used for registration which cause failure in unregistering. Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops") Reviewed-by: Jiri Pirko Reviewed-by: Vadim Fedorenko Signed-off-by: David S. Miller commit a4255b2e5c52abe4e94d320cf8276303e192d59d Merge: 49fcf34ac9087 7315dc1e122c8 Author: David S. Miller Date: Fri Dec 29 07:57:59 2023 +0000 Merge tag 'nf-23-12-20' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablu Neira Syuso says: ==================== netfilter pull request 23-12-20 The following patchset contains Netfilter fixes for net: 1) Skip set commit for deleted/destroyed sets, this might trigger double deactivation of expired elements. 2) Fix packet mangling from egress, set transport offset from mac header for netdev/egress. Both fixes address bugs already present in several releases. ==================== Signed-off-by: David S. Miller commit f9d378fc68c43fd41b35133edec9cd902ec334ec Author: Chancel Liu Date: Mon Dec 25 17:06:08 2023 +0900 ASoC: fsl_rpmsg: Fix error handler with pm_runtime_enable There is error message when defer probe happens: fsl_rpmsg rpmsg_audio: Unbalanced pm_runtime_enable! Fix the error handler with pm_runtime_enable. Fixes: b73d9e6225e8 ("ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsg") Signed-off-by: Chancel Liu Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20231225080608.967953-1-chancel.liu@nxp.com Signed-off-by: Mark Brown commit 8735c7c84d1bc5c3e481c02b6b6163bdefe4132f Merge: 505e701c0b2cf d10c77873ba1e Author: Linus Torvalds Date: Thu Dec 28 16:12:23 2023 -0800 Merge tag '6.7rc7-smb3-srv-fix' of git://git.samba.org/ksmbd Pull ksmbd server fix from Steve French: - address possible slab out of bounds in parsing of open requests * tag '6.7rc7-smb3-srv-fix' of git://git.samba.org/ksmbd: ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16() commit 505e701c0b2cfa9e34811020829759b7663a604c Merge: eeec2599630ac 753547de0daec Author: Linus Torvalds Date: Thu Dec 28 12:09:53 2023 -0800 Merge tag 'kbuild-fixes-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Revive proper alignment for the ksymtab and kcrctab sections - Fix gen_compile_commands.py tool to resolve symbolic links - Fix symbolic links to installed debug VDSO files - Update MAINTAINERS * tag 'kbuild-fixes-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: linux/export: Ensure natural alignment of kcrctab array kbuild: fix build ID symlinks to installed debug VDSO files gen_compile_commands.py: fix path resolve with symlinks in it MAINTAINERS: Add scripts/clang-tools to Kbuild section linux/export: Fix alignment for 64-bit ksymtab entries commit eeec2599630ac1ac03db98f3ba976975c72a1427 Merge: f5837722ffecb 7b474c77dadda Author: Linus Torvalds Date: Thu Dec 28 11:55:20 2023 -0800 Merge tag 'bcachefs-2023-12-27' of https://evilpiepirate.org/git/bcachefs Pull bcachefs fixes from Kent Overstreet: "Just a few fixes: besides a few one liners, we have a fix for snapshots + compression where the extent update path didn't account for the fact that with snapshots, we might split an existing extent into three, not just two; and a small fixup for promotes which were broken by the recent changes in the data update path to correctly take into account device durability" * tag 'bcachefs-2023-12-27' of https://evilpiepirate.org/git/bcachefs: bcachefs: Fix promotes bcachefs: Fix leakage of internal error code bcachefs: Fix insufficient disk reservation with compression + snapshots bcachefs: fix BCH_FSCK_ERR enum commit 753547de0daecbdbd1af3618987ddade325d9aaa Author: Helge Deller Date: Thu Dec 28 11:36:03 2023 +0100 linux/export: Ensure natural alignment of kcrctab array The ___kcrctab section holds an array of 32-bit CRC values. Add a .balign 4 to tell the linker the correct memory alignment. Fixes: f3304ecd7f06 ("linux/export: use inline assembler to populate symbol CRCs") Signed-off-by: Helge Deller Signed-off-by: Masahiro Yamada commit d10c77873ba1e9e6b91905018e29e196fd5f863d Author: Namjae Jeon Date: Wed Dec 20 15:52:11 2023 +0900 ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16() If ->NameOffset/Length is bigger than ->CreateContextsOffset/Length, ksmbd_check_message doesn't validate request buffer it correctly. So slab-out-of-bounds warning from calling smb_strndup_from_utf16() in smb2_open() could happen. If ->NameLength is non-zero, Set the larger of the two sums (Name and CreateContext size) as the offset and length of the data area. Reported-by: Yang Chaoming Cc: stable@vger.kernel.org Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit f5837722ffecbbedf1b1dbab072a063565f0dad1 Merge: 1997b3cb4217b 1803d0c5ee1a3 Author: Linus Torvalds Date: Wed Dec 27 16:14:41 2023 -0800 Merge tag 'mm-hotfixes-stable-2023-12-27-15-00' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc fixes from Andrew Morton: "11 hotfixes. 7 are cc:stable and the other 4 address post-6.6 issues or are not considered backporting material" * tag 'mm-hotfixes-stable-2023-12-27-15-00' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mailmap: add an old address for Naoya Horiguchi mm/memory-failure: cast index to loff_t before shifting it mm/memory-failure: check the mapcount of the precise page mm/memory-failure: pass the folio and the page to collect_procs() selftests: secretmem: floor the memory size to the multiple of page_size mm: migrate high-order folios in swap cache correctly maple_tree: do not preallocate nodes for slot stores mm/filemap: avoid buffered read/write race to read inconsistent data kunit: kasan_test: disable fortify string checker on kmalloc_oob_memset kexec: select CRYPTO from KEXEC_FILE instead of depending on it kexec: fix KEXEC_FILE dependencies commit 5cb23af38916fccde98f7a999b0b6f8c4ec34a3e Author: Attreyee Mukherjee Date: Sun Dec 24 00:38:53 2023 +0530 Documentation/i2c: fix spelling error in i2c-address-translators Correct to "stretched" from "streched" in "keeps clock streched on bus A waiting for reply". Signed-off-by: Attreyee Mukherjee Acked-by: Randy Dunlap Signed-off-by: Wolfram Sang commit 7afd49a38e73afd57ff62c8d1cf5af760c4d49c0 Author: Kurt Kanzenbach Date: Wed Dec 6 15:07:18 2023 +0100 igc: Check VLAN EtherType mask Currently the driver accepts VLAN EtherType steering rules regardless of the configured mask. And things might fail silently or with confusing error messages to the user. The VLAN EtherType can only be matched by full mask. Therefore, add a check for that. For instance the following rule is invalid, but the driver accepts it and ignores the user specified mask: |root@host:~# ethtool -N enp3s0 flow-type ether vlan-etype 0x8100 \ | m 0x00ff action 0 |Added rule with ID 63 |root@host:~# ethtool --show-ntuple enp3s0 |4 RX rings available |Total 1 rules | |Filter: 63 | Flow Type: Raw Ethernet | Src MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF | Dest MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF | Ethertype: 0x0 mask: 0xFFFF | VLAN EtherType: 0x8100 mask: 0x0 | VLAN: 0x0 mask: 0xffff | User-defined: 0x0 mask: 0xffffffffffffffff | Action: Direct to queue 0 After: |root@host:~# ethtool -N enp3s0 flow-type ether vlan-etype 0x8100 \ | m 0x00ff action 0 |rmgr: Cannot insert RX class rule: Operation not supported Fixes: 2b477d057e33 ("igc: Integrate flex filter into ethtool ops") Suggested-by: Suman Ghosh Signed-off-by: Kurt Kanzenbach Acked-by: Vinicius Costa Gomes Reviewed-by: Simon Horman Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit b5063cbe148b829e8eb97672c2cbccc058835476 Author: Kurt Kanzenbach Date: Fri Dec 1 08:50:43 2023 +0100 igc: Check VLAN TCI mask Currently the driver accepts VLAN TCI steering rules regardless of the configured mask. And things might fail silently or with confusing error messages to the user. There are two ways to handle the VLAN TCI mask: 1. Match on the PCP field using a VLAN prio filter 2. Match on complete TCI field using a flex filter Therefore, add checks and code for that. For instance the following rule is invalid and will be converted into a VLAN prio rule which is not correct: |root@host:~# ethtool -N enp3s0 flow-type ether vlan 0x0001 m 0xf000 \ | action 1 |Added rule with ID 61 |root@host:~# ethtool --show-ntuple enp3s0 |4 RX rings available |Total 1 rules | |Filter: 61 | Flow Type: Raw Ethernet | Src MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF | Dest MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF | Ethertype: 0x0 mask: 0xFFFF | VLAN EtherType: 0x0 mask: 0xffff | VLAN: 0x1 mask: 0x1fff | User-defined: 0x0 mask: 0xffffffffffffffff | Action: Direct to queue 1 After: |root@host:~# ethtool -N enp3s0 flow-type ether vlan 0x0001 m 0xf000 \ | action 1 |rmgr: Cannot insert RX class rule: Operation not supported Fixes: 7991487ecb2d ("igc: Allow for Flex Filters to be installed") Signed-off-by: Kurt Kanzenbach Acked-by: Vinicius Costa Gomes Reviewed-by: Simon Horman Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 088464abd48cf3735aee91f9e211b32da9d81117 Author: Kurt Kanzenbach Date: Fri Dec 1 08:50:42 2023 +0100 igc: Report VLAN EtherType matching back to user Currently the driver allows to configure matching by VLAN EtherType. However, the retrieval function does not report it back to the user. Add it. Before: |root@host:~# ethtool -N enp3s0 flow-type ether vlan-etype 0x8100 action 0 |Added rule with ID 63 |root@host:~# ethtool --show-ntuple enp3s0 |4 RX rings available |Total 1 rules | |Filter: 63 | Flow Type: Raw Ethernet | Src MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF | Dest MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF | Ethertype: 0x0 mask: 0xFFFF | Action: Direct to queue 0 After: |root@host:~# ethtool -N enp3s0 flow-type ether vlan-etype 0x8100 action 0 |Added rule with ID 63 |root@host:~# ethtool --show-ntuple enp3s0 |4 RX rings available |Total 1 rules | |Filter: 63 | Flow Type: Raw Ethernet | Src MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF | Dest MAC addr: 00:00:00:00:00:00 mask: FF:FF:FF:FF:FF:FF | Ethertype: 0x0 mask: 0xFFFF | VLAN EtherType: 0x8100 mask: 0x0 | VLAN: 0x0 mask: 0xffff | User-defined: 0x0 mask: 0xffffffffffffffff | Action: Direct to queue 0 Fixes: 2b477d057e33 ("igc: Integrate flex filter into ethtool ops") Signed-off-by: Kurt Kanzenbach Acked-by: Vinicius Costa Gomes Reviewed-by: Simon Horman Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 3e48041d9820c17e0a51599d12e66c6e12a8d08d Author: Sudheer Mogilappagari Date: Wed Nov 29 11:23:11 2023 +0100 i40e: Fix filter input checks to prevent config with invalid values Prevent VF from configuring filters with unsupported actions or use REDIRECT action with invalid tc number. Current checks could cause out of bounds access on PF side. Fixes: e284fc280473 ("i40e: Add and delete cloud filter") Reviewed-by: Andrii Staikov Signed-off-by: Sudheer Mogilappagari Signed-off-by: Aleksandr Loktionov Reviewed-by: Simon Horman Tested-by: Bharathi Sreenivas Signed-off-by: Tony Nguyen commit 8278a6a43d030a3aa8d7768148e74844331e39e3 Author: Arkadiusz Kubalewski Date: Mon Dec 18 15:58:55 2023 +0100 ice: dpll: fix phase offset value Stop dividing the phase_offset value received from firmware. This fault is present since the initial implementation. The phase_offset value received from firmware is in 0.01ps resolution. Dpll subsystem is using the value in 0.001ps, raw value is adjusted before providing it to the user. The user can observe the value of phase offset with response to `pin-get` netlink message of dpll subsystem for an active pin: $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/dpll.yaml \ --do pin-get --json '{"id":2}' Where example of correct response would be: {'board-label': 'C827_0-RCLKA', 'capabilities': 6, 'clock-id': 4658613174691613800, 'frequency': 1953125, 'id': 2, 'module-name': 'ice', 'parent-device': [{'direction': 'input', 'parent-id': 6, 'phase-offset': -216839550, 'prio': 9, 'state': 'connected'}, {'direction': 'input', 'parent-id': 7, 'phase-offset': -42930, 'prio': 8, 'state': 'connected'}], 'phase-adjust': 0, 'phase-adjust-max': 16723, 'phase-adjust-min': -16723, 'type': 'mux'} Provided phase-offset value (-42930) shall be divided by the user with DPLL_PHASE_OFFSET_DIVIDER to get actual value of -42.930 ps. Before the fix, the response was not correct: {'board-label': 'C827_0-RCLKA', 'capabilities': 6, 'clock-id': 4658613174691613800, 'frequency': 1953125, 'id': 2, 'module-name': 'ice', 'parent-device': [{'direction': 'input', 'parent-id': 6, 'phase-offset': -216839, 'prio': 9, 'state': 'connected'}, {'direction': 'input', 'parent-id': 7, 'phase-offset': -42, 'prio': 8, 'state': 'connected'}], 'phase-adjust': 0, 'phase-adjust-max': 16723, 'phase-adjust-min': -16723, 'type': 'mux'} Where phase-offset value (-42), after division (DPLL_PHASE_OFFSET_DIVIDER) would be: -0.042 ps. Fixes: 8a3a565ff210 ("ice: add admin commands to access cgu configuration") Fixes: 90e1c90750d7 ("ice: dpll: implement phase related callbacks") Reviewed-by: Aleksandr Loktionov Reviewed-by: Przemek Kitszel Signed-off-by: Arkadiusz Kubalewski Reviewed-by: Paul Menzel Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 6d05ff55ef4f4954d28551236239f297bd52ea48 Author: Ngai-Mint Kwan Date: Fri Dec 15 12:01:57 2023 +0100 ice: Shut down VSI with "link-down-on-close" enabled Disabling netdev with ethtool private flag "link-down-on-close" enabled can cause NULL pointer dereference bug. Shut down VSI regardless of "link-down-on-close" state. Fixes: 8ac7132704f3 ("ice: Fix interface being down after reset with link-down-on-close flag on") Reviewed-by: Przemek Kitszel Signed-off-by: Ngai-Mint Kwan Signed-off-by: Wojciech Drewek Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 6a8d8bb55e7001de2d50920381cc858f3a3e9fb7 Author: Katarzyna Wieczerzycka Date: Fri Dec 15 12:01:56 2023 +0100 ice: Fix link_down_on_close message The driver should not report an error message when for a medialess port the link_down_on_close flag is enabled and the physical link cannot be set down. Fixes: 8ac7132704f3 ("ice: Fix interface being down after reset with link-down-on-close flag on") Reviewed-by: Przemek Kitszel Signed-off-by: Katarzyna Wieczerzycka Signed-off-by: Wojciech Drewek Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit ad5575eb6278892aa25a5d249c5009860d6d8bbc Author: Andy Shevchenko Date: Fri Dec 22 16:11:17 2023 +0200 MAINTAINERS: Add a missing file to the INTEL GPIO section When gpio-tangier was split the new born headers had been missed in the MAINTAINERS. Add it there. Fixes: d2c19e89e03c ("gpio: tangier: Introduce Intel Tangier GPIO driver") Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit d4c139ca7cfeea490e5b8e9a7d4247aa706fd30a Author: Andy Shevchenko Date: Fri Dec 22 16:00:17 2023 +0200 MAINTAINERS: Remove Andy from GPIO maintainers Too many things are going on, and reviewing GPIO related code seems not the best I can do, hence I step down as a reviewer of the GPIO subsystem. Signed-off-by: Andy Shevchenko Acked-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 7cf4e6831502f992faa6d1253c09728065884c1f Author: Bartosz Golaszewski Date: Fri Dec 22 15:19:52 2023 +0100 MAINTAINERS: split out the uAPI into a new section Kent Gibson is the author of the character device uAPI v2 and should be Cc'ed on all patches aimed for it. Unfortunately this is not the case as he's not listed in MAINTAINERS. Split the uAPI files into their own section and make Kent the reviewer. Signed-off-by: Bartosz Golaszewski Acked-by: Andy Shevchenko Reviewed-by: Linus Walleij commit 49fcf34ac908784f97bc0f98dc5460239cc53798 Merge: 0ee2384a5a0f3 0a3d898ee9a83 Author: David S. Miller Date: Wed Dec 27 13:09:11 2023 +0000 Merge tag 'wireless-2023-12-19' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Johannes Berg says: ==================== Just a couple of things: * debugfs fixes * rfkill fix in iwlwifi * remove mostly-not-working list ==================== Signed-off-by: David S. Miller commit ee11d2d37f5c05bd7bf5ccc820a58f48423d032b Author: Umesh Nerlige Ramappa Date: Mon Dec 18 16:05:43 2023 -0800 drm/i915/perf: Update handling of MMIO triggered reports On XEHP platforms user is not able to find MMIO triggered reports in the OA buffer since i915 squashes the context ID fields. These context ID fields hold the MMIO trigger markers. Update logic to not squash the context ID fields of MMIO triggered reports. Fixes: cba94bbcff08 ("drm/i915/perf: Determine context valid in OA reports") Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20231219000543.1087706-1-umesh.nerlige.ramappa@intel.com (cherry picked from commit 0c68132df6e66244acec1bb5b9e19b0751414389) Signed-off-by: Jani Nikula commit 2bd7a06a1208aaacb4e7a2a5436c23bce8d70801 Author: Khaled Almahallawy Date: Wed Dec 13 13:15:42 2023 -0800 drm/i915/dp: Fix passing the correct DPCD_REV for drm_dp_set_phy_test_pattern Using link_status to get DPCD_REV fails when disabling/defaulting phy pattern. Use intel_dp->dpcd to access DPCD_REV correctly. Fixes: 8cdf72711928 ("drm/i915/dp: Program vswing, pre-emphasis, test-pattern") Cc: Jani Nikula Cc: Imre Deak Cc: Lee Shawn C Signed-off-by: Khaled Almahallawy Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20231213211542.3585105-3-khaled.almahallawy@intel.com (cherry picked from commit 3ee302ec22d6e1d7d1e6d381b0d507ee80f2135c) commit 7b474c77daddaf89bbb72594737538f4e0dce2fd Author: Kent Overstreet Date: Sat Dec 23 23:29:05 2023 -0500 bcachefs: Fix promotes The recent work to fix data moves w.r.t. durability broke promotes, because the caused us to bail out when the extent minus pointers being dropped still has enough pointers to satisfy the current number of replicas. Disable this check when we're adding cached replicas. Signed-off-by: Kent Overstreet commit 1997b3cb4217b09e49659b634c94da47f0340409 Author: Edward Adam Davis Date: Sun Dec 24 00:02:49 2023 +0000 keys, dns: Fix missing size check of V1 server-list header The dns_resolver_preparse() function has a check on the size of the payload for the basic header of the binary-style payload, but is missing a check for the size of the V1 server-list payload header after determining that's what we've been given. Fix this by getting rid of the the pointer to the basic header and just assuming that we have a V1 server-list payload and moving the V1 server list pointer inside the if-statement. Dealing with other types and versions can be left for when such have been defined. This can be tested by doing the following with KASAN enabled: echo -n -e '\x0\x0\x1\x2' | keyctl padd dns_resolver foo @p and produces an oops like the following: BUG: KASAN: slab-out-of-bounds in dns_resolver_preparse+0xc9f/0xd60 net/dns_resolver/dns_key.c:127 Read of size 1 at addr ffff888028894084 by task syz-executor265/5069 ... Call Trace: dns_resolver_preparse+0xc9f/0xd60 net/dns_resolver/dns_key.c:127 __key_create_or_update+0x453/0xdf0 security/keys/key.c:842 key_create_or_update+0x42/0x50 security/keys/key.c:1007 __do_sys_add_key+0x29c/0x450 security/keys/keyctl.c:134 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x62/0x6a This patch was originally by Edward Adam Davis, but was modified by Linus. Fixes: b946001d3bb1 ("keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on expiry") Reported-and-tested-by: syzbot+94bbb75204a05da3d89f@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/0000000000009b39bc060c73e209@google.com/ Suggested-by: Linus Torvalds Signed-off-by: Edward Adam Davis Signed-off-by: David Howells Tested-by: David Howells Cc: Edward Adam Davis Cc: Jarkko Sakkinen Cc: Jeffrey E Altman Cc: Wang Lei Cc: Jeff Layton Cc: Steve French Cc: Marc Dionne Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Reviewed-by: Simon Horman Signed-off-by: Linus Torvalds commit 0ee2384a5a0f3b4eeac8d10bb01a0609d245a4d1 Author: Suman Ghosh Date: Tue Dec 19 19:56:33 2023 +0530 octeontx2-af: Fix marking couple of structure as __packed Couple of structures was not marked as __packed. This patch fixes the same and mark them as __packed. Fixes: 42006910b5ea ("octeontx2-af: cleanup KPU config data") Signed-off-by: Suman Ghosh Reviewed-by: Jacob Keller Signed-off-by: David S. Miller commit a613fb464dc4d8902d1dbca836a0872a80d36296 Author: Pavan Kumar Linga Date: Fri Dec 15 15:48:07 2023 -0800 idpf: avoid compiler introduced padding in virtchnl2_rss_key struct Size of the virtchnl2_rss_key struct should be 7 bytes but the compiler introduces a padding byte for the structure alignment. This results in idpf sending an additional byte of memory to the device control plane than the expected buffer size. As the control plane enforces virtchnl message size checks to validate the message, set RSS key message fails resulting in the driver load failure. Remove implicit compiler padding by using "__packed" structure attribute for the virtchnl2_rss_key struct. Also there is no need to use __DECLARE_FLEX_ARRAY macro for the 'key_flex' struct field. So drop it. Fixes: 0d7502a9b4a7 ("virtchnl: add virtchnl version 2 ops") Reviewed-by: Larysa Zaremba Signed-off-by: Pavan Kumar Linga Reviewed-by: Simon Horman Tested-by: Scott Register Signed-off-by: Tony Nguyen commit fea7b71b8751a0bfa7fdf9977e5782f061f71589 Author: Alexander Lobakin Date: Mon Dec 11 13:31:44 2023 +0100 idpf: fix corrupted frames and skb leaks in singleq mode idpf_ring::skb serves only for keeping an incomplete frame between several NAPI Rx polling cycles, as one cycle may end up before processing the end of packet descriptor. The pointer is taken from the ring onto the stack before entering the loop and gets written there after the loop exits. When inside the loop, only the onstack pointer is used. For some reason, the logics is broken in the singleq mode, where the pointer is taken from the ring each iteration. This means that if a frame got fragmented into several descriptors, each fragment will have its own skb, but only the last one will be passed up the stack (containing garbage), leaving the rest leaked. Then, on ifdown, rxq::skb is being freed only in the splitq mode, while it can point to a valid skb in singleq as well. This can lead to a yet another skb leak. Just don't touch the ring skb field inside the polling loop, letting the onstack skb pointer work as expected: build a new skb if it's the first frame descriptor and attach a frag otherwise. On ifdown, free rxq::skb unconditionally if the pointer is non-NULL. Fixes: a5ab9ee0df0b ("idpf: add singleq start_xmit and napi poll") Reviewed-by: Przemek Kitszel Reviewed-by: Michal Kubiak Reviewed-by: Simon Horman Reviewed-by: Eric Dumazet Signed-off-by: Alexander Lobakin Tested-by: Scott Register Signed-off-by: Tony Nguyen commit 02d374f3418df577c850f0cd45c3da9245ead547 Author: Christoph Hellwig Date: Tue Dec 26 08:15:24 2023 +0000 block: renumber QUEUE_FLAG_HW_WC For the QUEUE_FLAG_HW_WC to actually work, it needs to have a separate number from QUEUE_FLAG_FUA, doh. Fixes: 43c9835b144c ("block: don't allow enabling a cache on devices that don't support it") Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20231226081524.180289-1-hch@lst.de Signed-off-by: Jens Axboe commit fbafc3e621c3f4ded43720fdb1d6ce1728ec664e Merge: 861deac3b092f b8e0792449928 Author: Linus Torvalds Date: Mon Dec 25 13:50:46 2023 -0800 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fixes from Michael Tsirkin: "A couple of bugfixes: one for a regression" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: virtio_blk: fix snprintf truncation compiler warning virtio_ring: fix syncs DMA memory with different direction commit dff90e4a092b771354287fbe55e557467c9da620 Merge: 7c5e046bdcb25 6ec0d7527c428 Author: David S. Miller Date: Mon Dec 25 07:29:04 2023 +0000 Merge branch 'nfc-refcounting' @ 2023-12-19 17:49 Siddh Raman Pant 2023-12-19 17:49 ` [PATCH net-next v7 1/2] nfc: llcp_core: Hold a ref to llcp_local->dev when holding a ref to llcp_local Siddh Raman Pant 2023-12-19 17:49 ` [PATCH net-next v7 2/2] nfc: Do not send datagram if socket state isn't LLCP_BOUND Siddh Raman Pant 0 siblings, 2 replies; 4+ messages in thread Siddh Raman Pant says: ==================== [PATCH net-next v7 0/2] nfc: Fix UAF during datagram sending caused by missing refcounting Changes in v7: - Stupidly reverted ordering in recv() too, fix that. - Remove redundant call to nfc_llcp_sock_free(). Changes in v6: - Revert label introduction from v4, and thus also v5 entirely. Changes in v5: - Move reason = LLCP_DM_REJ under the fail_put_sock label. - Checkpatch now warns about == NULL check for new_sk, so fix that, and also at other similar places in the same function. Changes in v4: - Fix put ordering and comments. - Separate freeing in recv() into end labels. - Remove obvious comment and add reasoning. - Picked up r-bs by Suman. Changes in v3: - Fix missing freeing statements. Changes in v2: - Add net-next in patch subject. - Removed unnecessary extra lock and hold nfc_dev ref when holding llcp_sock. - Remove last formatting patch. - Picked up r-b from Krzysztof for LLCP_BOUND patch. --- For connectionless transmission, llcp_sock_sendmsg() codepath will eventually call nfc_alloc_send_skb() which takes in an nfc_dev as an argument for calculating the total size for skb allocation. virtual_ncidev_close() codepath eventually releases socket by calling nfc_llcp_socket_release() (which sets the sk->sk_state to LLCP_CLOSED) and afterwards the nfc_dev will be eventually freed. When an ndev gets freed, llcp_sock_sendmsg() will result in an use-after-free as it (1) doesn't have any checks in place for avoiding the datagram sending. (2) calls nfc_llcp_send_ui_frame(), which also has a do-while loop which can race with freeing. This loop contains the call to nfc_alloc_send_skb() where we dereference the nfc_dev pointer. nfc_dev is being freed because we do not hold a reference to it when we hold a reference to llcp_local. Thus, virtual_ncidev_close() eventually calls nfc_release() due to refcount going to 0. Since state has to be LLCP_BOUND for datagram sending, we can bail out early in llcp_sock_sendmsg(). Please review and let me know if any errors are there, and hopefully this gets accepted. ==================== Signed-off-by: David S. Miller commit 6ec0d7527c4287369b52df3bcefd21a0c4fb2b7c Author: Siddh Raman Pant Date: Tue Dec 19 23:19:44 2023 +0530 nfc: Do not send datagram if socket state isn't LLCP_BOUND As we know we cannot send the datagram (state can be set to LLCP_CLOSED by nfc_llcp_socket_release()), there is no need to proceed further. Thus, bail out early from llcp_sock_sendmsg(). Signed-off-by: Siddh Raman Pant Reviewed-by: Krzysztof Kozlowski Reviewed-by: Suman Ghosh Signed-off-by: David S. Miller commit c95f919567d6f1914f13350af61a1b044ac85014 Author: Siddh Raman Pant Date: Tue Dec 19 23:19:43 2023 +0530 nfc: llcp_core: Hold a ref to llcp_local->dev when holding a ref to llcp_local llcp_sock_sendmsg() calls nfc_llcp_send_ui_frame() which in turn calls nfc_alloc_send_skb(), which accesses the nfc_dev from the llcp_sock for getting the headroom and tailroom needed for skb allocation. Parallelly the nfc_dev can be freed, as the refcount is decreased via nfc_free_device(), leading to a UAF reported by Syzkaller, which can be summarized as follows: (1) llcp_sock_sendmsg() -> nfc_llcp_send_ui_frame() -> nfc_alloc_send_skb() -> Dereference *nfc_dev (2) virtual_ncidev_close() -> nci_free_device() -> nfc_free_device() -> put_device() -> nfc_release() -> Free *nfc_dev When a reference to llcp_local is acquired, we do not acquire the same for the nfc_dev. This leads to freeing even when the llcp_local is in use, and this is the case with the UAF described above too. Thus, when we acquire a reference to llcp_local, we should acquire a reference to nfc_dev, and release the references appropriately later. References for llcp_local is initialized in nfc_llcp_register_device() (which is called by nfc_register_device()). Thus, we should acquire a reference to nfc_dev there. nfc_unregister_device() calls nfc_llcp_unregister_device() which in turn calls nfc_llcp_local_put(). Thus, the reference to nfc_dev is appropriately released later. Reported-and-tested-by: syzbot+bbe84a4010eeea00982d@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=bbe84a4010eeea00982d Fixes: c7aa12252f51 ("NFC: Take a reference on the LLCP local pointer when creating a socket") Reviewed-by: Suman Ghosh Signed-off-by: Siddh Raman Pant Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 146e843f6b09271233c021b1677e561b7dc16303 Author: Coly Li Date: Sun Dec 24 08:28:20 2023 +0800 badblocks: avoid checking invalid range in badblocks_check() If prev_badblocks() returns '-1', it means no valid badblocks record before the checking range. It doesn't make sense to check whether the input checking range is overlapped with the non-existed invalid front range. This patch checkes whether 'prev >= 0' is true before calling overlap_front(), to void such invalid operations. Fixes: 3ea3354cb9f0 ("badblocks: improve badblocks_check() for multiple ranges handling") Reported-and-tested-by: Ira Weiny Signed-off-by: Coly Li Link: https://lore.kernel.org/nvdimm/3035e75a-9be0-4bc3-8d4a-6e52c207f277@leemhuis.info/ Cc: Dan Williams Cc: Geliang Tang Cc: Hannes Reinecke Cc: Jens Axboe Cc: NeilBrown Cc: Vishal L Verma Cc: Xiao Ni Link: https://lore.kernel.org/r/20231224002820.20234-1-colyli@suse.de Signed-off-by: Jens Axboe commit 861deac3b092f37b2c5e6871732f3e11486f7082 Author: Linus Torvalds Date: Sat Dec 23 16:25:56 2023 -0800 Linux 6.7-rc7 commit 3f82f1c3a03694800a4104ca6b6d3282bd4e213d Merge: f969c91482e1d d5a10b976ecb7 Author: Linus Torvalds Date: Sat Dec 23 12:13:28 2023 -0800 Merge tag 'x86-urgent-2023-12-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Ingo Molnar: - Fix a secondary CPUs enumeration regression caused by creative MADT APIC table entries on certain systems. - Fix a race in the NOP-patcher that can spuriously trigger crashes on bootup. - Fix a bootup failure regression caused by the parallel bringup code, caused by firmware inconsistency between the APIC initialization states of the boot and secondary CPUs, on certain systems. * tag 'x86-urgent-2023-12-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/acpi: Handle bogus MADT APIC tables gracefully x86/alternatives: Disable interrupts and sync when optimizing NOPs in place x86/alternatives: Sync core before enabling interrupts x86/smpboot/64: Handle X2APIC BIOS inconsistency gracefully commit f969c91482e1dedbb35aee4e7d32d13ed17f9e13 Merge: 4b2ee6d2b33d5 04c116e2bdfc3 Author: Linus Torvalds Date: Sat Dec 23 11:58:53 2023 -0800 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Four small fixes, three in drivers with the core one adding a batch indicator (for drivers which use it) to the error handler" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: core: Let the sq_lock protect sq_tail_slot access scsi: ufs: qcom: Return ufs_qcom_clk_scale_*() errors in ufs_qcom_clk_scale_notify() scsi: core: Always send batch on reset or error handling command scsi: bnx2fc: Fix skb double free in bnx2fc_rcv() commit 4b2ee6d2b33d56e36da552a26e817eeed637e76e Merge: a0652eb205b7a ab241a0ab5abd Author: Linus Torvalds Date: Sat Dec 23 11:48:05 2023 -0800 Merge tag 'usb-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB / Thunderbolt fixes from Greg KH: "Here are some small bugfixes and new device ids for USB and Thunderbolt drivers for 6.7-rc7. Included in here are: - new usb-serial device ids - thunderbolt driver fixes - typec driver fix - usb-storage driver quirk added - fotg210 driver fix All of these have been in linux-next with no reported issues" * tag 'usb-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: serial: option: add Quectel EG912Y module support USB: serial: ftdi_sio: update Actisense PIDs constant names usb: fotg210-hcd: delete an incorrect bounds test usb-storage: Add quirk for incorrect WP on Kingston DT Ultimate 3.0 G3 usb: typec: ucsi: fix gpio-based orientation detection net: usb: ax88179_178a: avoid failed operations when device is disconnected USB: serial: option: add Quectel RM500Q R13 firmware support USB: serial: option: add Foxconn T99W265 with new baseline thunderbolt: Fix minimum allocated USB 3.x and PCIe bandwidth thunderbolt: Fix memory leak in margining_port_remove() commit a0652eb205b7ac13429d63bcc42806115d393632 Merge: fa655abe42c65 159f5bdadcdda Author: Linus Torvalds Date: Sat Dec 23 11:29:12 2023 -0800 Merge tag 'char-misc-6.7-rc7' 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 various driver fixes for 6.7-rc7 that normally come through the char-misc tree, and one debugfs fix as well. Included in here are: - iio and hid sensor driver fixes for a number of small things - interconnect driver fixes - brcm_nvmem driver fixes - debugfs fix for previous fix - guard() definition in device.h so that many subsystems can start using it for 6.8-rc1 (requested by Dan Williams to make future merges easier) All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits) debugfs: initialize cancellations earlier Revert "iio: hid-sensor-als: Add light color temperature support" Revert "iio: hid-sensor-als: Add light chromaticity support" nvmem: brcm_nvram: store a copy of NVRAM content dt-bindings: nvmem: mxs-ocotp: Document fsl,ocotp driver core: Add a guard() definition for the device_lock() interconnect: qcom: icc-rpm: Fix peak rate calculation iio: adc: MCP3564: fix hardware identification logic iio: adc: MCP3564: fix calib_bias and calib_scale range checks iio: adc: meson: add separate config for axg SoC family iio: adc: imx93: add four channels for imx93 adc iio: adc: ti_am335x_adc: Fix return value check of tiadc_request_dma() interconnect: qcom: sm8250: Enable sync_state iio: triggered-buffer: prevent possible freeing of wrong buffer iio: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw iio: imu: adis16475: use bit numbers in assign_bit() iio: imu: adis16475: add spi_device_id table iio: tmag5273: fix temperature offset interconnect: Treat xlate() returning NULL node as an error iio: common: ms_sensors: ms_sensors_i2c: fix humidity conversion time table ... commit fa655abe42c65e7e4ad52baf280dadfb571c110e Merge: 5254c0cbc92d2 ea3715941a9b7 Author: Linus Torvalds Date: Sat Dec 23 11:16:58 2023 -0800 Merge tag 'input-for-v6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - a quirk to AT keyboard driver to skip issuing "GET ID" command when 8042 is in translated mode and the device is a laptop/portable, because the "GET ID" command makes a bunch of recent laptops unhappy - a quirk to i8042 to disable multiplexed mode on Acer P459-G2-M which causes issues on resume - psmouse will activate native RMI4 protocol support for touchpad on ThinkPad L14 G1 - addition of Razer Wolverine V2 ID to xpad gamepad driver - mapping for airplane mode button in soc_button_array driver for TUXEDO laptops - improved error handling in ipaq-micro-keys driver - amimouse being prepared for platform remove callback returning void * tag 'input-for-v6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: soc_button_array - add mapping for airplane mode button Input: xpad - add Razer Wolverine V2 support Input: ipaq-micro-keys - add error handling for devm_kmemdup Input: amimouse - convert to platform remove callback returning void Input: i8042 - add nomux quirk for Acer P459-G2-M Input: atkbd - skip ATKBD_CMD_GETID in translated mode Input: psmouse - enable Synaptics InterTouch for ThinkPad L14 G1 commit c1a8627164dbe8b92958aea10c7c0848105a3d7f Author: Masahiro Yamada Date: Wed Dec 20 17:18:33 2023 +0900 kbuild: fix build ID symlinks to installed debug VDSO files Commit 56769ba4b297 ("kbuild: unify vdso_install rules") accidentally dropped the '.debug' suffix from the build ID symlinks. Fixes: 56769ba4b297 ("kbuild: unify vdso_install rules") Signed-off-by: Masahiro Yamada commit 880946158b01138c06e93e4aa4255ffbfe70e1c8 Author: Jialu Xu Date: Sun Dec 10 15:05:34 2023 +0800 gen_compile_commands.py: fix path resolve with symlinks in it When a path contains relative symbolic links, os.path.abspath() might not follow the symlinks and instead return the absolute path with just the relative paths resolved, resulting in an incorrect path. 1. Say "drivers/hdf/" has some symlinks: # ls -l drivers/hdf/ total 364 drwxrwxr-x 2 ... 4096 ... evdev lrwxrwxrwx 1 ... 44 ... framework -> ../../../../../../drivers/hdf_core/framework -rw-rw-r-- 1 ... 359010 ... hdf_macro_test.h lrwxrwxrwx 1 ... 55 ... inner_api -> ../../../../../../drivers/hdf_core/interfaces/inner_api lrwxrwxrwx 1 ... 53 ... khdf -> ../../../../../../drivers/hdf_core/adapter/khdf/linux -rw-r--r-- 1 ... 74 ... Makefile drwxrwxr-x 3 ... 4096 ... wifi 2. One .cmd file records that: # head -1 ./framework/core/manager/src/.devmgr_service.o.cmd cmd_drivers/hdf/khdf/manager/../../../../framework/core/manager/src/devmgr_service.o := ... \ /path/to/src/drivers/hdf/khdf/manager/../../../../framework/core/manager/src/devmgr_service.c 3. os.path.abspath returns "/path/to/src/framework/core/manager/src/devmgr_service.c", not correct: # ./scripts/clang-tools/gen_compile_commands.py INFO: Could not add line from ./framework/core/manager/src/.devmgr_service.o.cmd: File \ /path/to/src/framework/core/manager/src/devmgr_service.c not found Use os.path.realpath(), which resolves the symlinks and normalizes the paths correctly. # cat compile_commands.json ... { "command": ... "directory": ... "file": "/path/to/bla/drivers/hdf_core/framework/core/manager/src/devmgr_service.c" }, ... Also fix it in parse_arguments(). Signed-off-by: Jialu Xu Signed-off-by: Masahiro Yamada commit c134abc9b8e1b9c77ee4ac8cf55da2a9240cc41d Author: Nathan Chancellor Date: Tue Dec 5 10:05:57 2023 -0700 MAINTAINERS: Add scripts/clang-tools to Kbuild section Masahiro has always applied scripts/clang-tools patches but it is not included in the Kbuild section, so neither he nor linux-kbuild get cc'd on patches that touch those files. Signed-off-by: Nathan Chancellor Acked-by: Nicolas Schier Signed-off-by: Masahiro Yamada commit f6847807c22f6944c71c981b630b9fff30801e73 Author: Helge Deller Date: Wed Nov 22 23:18:11 2023 +0100 linux/export: Fix alignment for 64-bit ksymtab entries An alignment of 4 bytes is wrong for 64-bit platforms which don't define CONFIG_HAVE_ARCH_PREL32_RELOCATIONS (which then store 64-bit pointers). Fix their alignment to 8 bytes. Fixes: ddb5cdbafaaa ("kbuild: generate KSYMTAB entries by modpost") Signed-off-by: Helge Deller Signed-off-by: Masahiro Yamada commit ea3715941a9b7d816a1e9096ac0577900af2a69e Author: Christoffer Sandberg Date: Fri Dec 22 23:25:38 2023 -0800 Input: soc_button_array - add mapping for airplane mode button This add a mapping for the airplane mode button on the TUXEDO Pulse Gen3. While it is physically a key it behaves more like a switch, sending a key down on first press and a key up on 2nd press. Therefor the switch event is used here. Besides this behaviour it uses the HID usage-id 0xc6 (Wireless Radio Button) and not 0xc8 (Wireless Radio Slider Switch), but since neither 0xc6 nor 0xc8 are currently implemented at all in soc_button_array this not to standard behaviour is not put behind a quirk for the moment. Signed-off-by: Christoffer Sandberg Signed-off-by: Werner Sembach Link: https://lore.kernel.org/r/20231215171718.80229-1-wse@tuxedocomputers.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov commit 5254c0cbc92d2a08e75443bdb914f1c4839cdf5a Merge: 867583b399192 13d822bf1cba7 Author: Linus Torvalds Date: Fri Dec 22 19:36:48 2023 -0800 Merge tag 'block-6.7-2023-12-22' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: "Just an NVMe pull request this time, with a fix for bad sleeping context, and a revert of a patch that caused some trouble" * tag 'block-6.7-2023-12-22' of git://git.kernel.dk/linux: nvme-pci: fix sleeping function called from interrupt context Revert "nvme-fc: fix race between error recovery and creating association" commit 867583b3991929aeea3844874fba598243c54240 Merge: c0f65a7c112b3 ef5b28372c565 Author: Linus Torvalds Date: Fri Dec 22 19:22:20 2023 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "RISC-V: - Fix a race condition in updating external interrupt for trap-n-emulated IMSIC swfile - Fix print_reg defaults in get-reg-list selftest ARM: - Ensure a vCPU's redistributor is unregistered from the MMIO bus if vCPU creation fails - Fix building KVM selftests for arm64 from the top-level Makefile x86: - Fix breakage for SEV-ES guests that use XSAVES Selftests: - Fix bad use of strcat(), by not using strcat() at all" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: SEV: Do not intercept accesses to MSR_IA32_XSS for SEV-ES guests KVM: selftests: Fix dynamic generation of configuration names RISCV: KVM: update external interrupt atomically for IMSIC swfile KVM: riscv: selftests: Fix get-reg-list print_reg defaults KVM: selftests: Ensure sysreg-defs.h is generated at the expected path KVM: Convert comment into an assertion in kvm_io_bus_register_dev() KVM: arm64: vgic: Ensure that slots_lock is held in vgic_register_all_redist_iodevs() KVM: arm64: vgic: Force vcpu vgic teardown on vcpu destroy KVM: arm64: vgic: Add a non-locking primitive for kvm_vgic_vcpu_destroy() KVM: arm64: vgic: Simplify kvm_vgic_destroy() commit ef5b28372c565128bdce7a59bc78402a8ce68e1b Merge: 5c2b2176ead19 4ad9843e1ea08 Author: Paolo Bonzini Date: Fri Dec 22 18:05:07 2023 -0500 Merge tag 'kvm-riscv-fixes-6.7-1' of https://github.com/kvm-riscv/linux into kvm-master KVM/riscv fixes for 6.7, take #1 - Fix a race condition in updating external interrupt for trap-n-emulated IMSIC swfile - Fix print_reg defaults in get-reg-list selftest commit 5c2b2176ead1911d652b8848169bb44bdde75ca8 Merge: a26b7cd225469 0c12e6c8267f8 Author: Paolo Bonzini Date: Fri Dec 22 18:03:54 2023 -0500 Merge tag 'kvmarm-fixes-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master KVM/arm64 fixes for 6.7, part #2 - Ensure a vCPU's redistributor is unregistered from the MMIO bus if vCPU creation fails - Fix building KVM selftests for arm64 from the top-level Makefile commit c0f65a7c112b3cfa691cead54bcf24d6cc2182b5 Merge: 5414aea7b7508 5c47251e8c490 Author: Linus Torvalds Date: Fri Dec 22 13:41:29 2023 -0800 Merge tag 'printk-for-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk fix from Petr Mladek: - Prevent refcount warning from code releasing a fwnode * tag 'printk-for-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: lib/vsprintf: Fix %pfwf when current node refcount == 0 commit 5414aea7b7508d01235ea0c95064ad66395c3239 Merge: 2618280dedb2f 916d051730ae4 Author: Linus Torvalds Date: Fri Dec 22 08:46:44 2023 -0800 Merge tag 'sound-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Apparently there were so many kids wishing bug fixes that made Santa busy; here we have lots of fixes although it's a bit late. But all changes are device-specific, hence it should be relatively safe to apply. Most of changes are for Cirrus codecs (for both ASoC and HD-audio), while the remaining are fixes for TI codecs, HD-audio and USB-audio quirks" * tag 'sound-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (24 commits) ALSA: hda: cs35l41: Only add SPI CS GPIO if SPI is enabled in kernel ALSA: hda: cs35l41: Do not allow uninitialised variables to be freed ASoC: fsl_sai: Fix channel swap issue on i.MX8MP ASoC: hdmi-codec: fix missing report for jack initial status ALSA: hda/realtek: Add quirks for ASUS Zenbook 2023 Models ALSA: hda: cs35l41: Support additional ASUS Zenbook 2023 Models ALSA: hda/realtek: Add quirks for ASUS Zenbook 2022 Models ALSA: hda: cs35l41: Support additional ASUS Zenbook 2022 Models ALSA: hda/realtek: Add quirks for ASUS ROG 2023 models ALSA: hda: cs35l41: Support additional ASUS ROG 2023 models ALSA: hda: cs35l41: Add config table to support many laptops without _DSD ASoC: Intel: bytcr_rt5640: Add new swapped-speakers quirk ASoC: Intel: bytcr_rt5640: Add quirk for the Medion Lifetab S10346 kselftest: alsa: fixed a print formatting warning ALSA: usb-audio: Increase delay in MOTU M quirk ASoC: tas2781: check the validity of prm_no/cfg_no ALSA: hda/tas2781: select program 0, conf 0 by default ALSA: hda/realtek: Add quirk for ASUS ROG GV302XA ASoC: cs42l43: Don't enable bias sense during type detect ASoC: Intel: soc-acpi-intel-mtl-match: Change CS35L56 prefixes to AMPn ... commit 2618280dedb2f3a35e51c158d31859276a8832b9 Merge: a9ca0330d222a b4cc1cbba5195 Author: Linus Torvalds Date: Fri Dec 22 08:42:55 2023 -0800 Merge tag 'i2c-for-6.7-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: - error path fixes (qcom-geni) - polling mode fix (rk3x) - target mode state machine fix (aspeed) * tag 'i2c-for-6.7-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: aspeed: Handle the coalesced stop conditions with the start conditions. i2c: rk3x: fix potential spinlock recursion on poll i2c: qcom-geni: fix missing clk_disable_unprepare() and geni_se_resources_off() commit a9ca0330d222ae6c32ba5519f5a2f04dc97b7d8b Merge: b7bc7bce88bdf 1cc3542c76acb Author: Linus Torvalds Date: Fri Dec 22 08:41:04 2023 -0800 Merge tag 'gpio-fixes-for-v6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: "Here's another round of fixes from the GPIO subsystem for this release cycle. There's one commit adding synchronization to an ioctl() we overlooked previously and another synchronization changeset for one of the drivers: - add protection against GPIO device removal to an overlooked ioctl() - synchronize the interrupt mask register manually in gpio-dwapb" * tag 'gpio-fixes-for-v6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: dwapb: mask/unmask IRQ when disable/enale it gpiolib: cdev: add gpio_device locking wrapper around gpio_ioctl() commit b7bc7bce88bdf52ec2b47c576fb51269a521bd9a Merge: 8afe6f0e0e257 93cd059764984 Author: Linus Torvalds Date: Fri Dec 22 08:37:48 2023 -0800 Merge tag 'for-linus-6.7a-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fix from Juergen Gross: "A single patch fixing a build issue for x86 32-bit configurations with CONFIG_XEN, which was introduced in the 6.7 development cycle" * tag 'for-linus-6.7a-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: x86/xen: add CPU dependencies for 32-bit build commit 8afe6f0e0e257bf7f79f5996c037e8977dcc8cc1 Merge: 93a165cb9a4c7 d4b6e7f582e29 Author: Linus Torvalds Date: Fri Dec 22 07:59:25 2023 -0800 Merge tag 'drm-fixes-2023-12-22' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Pretty quiet for this week, just i915 and amdgpu fixes, I think the misc tree got lost this week, but didn't seem to have too much in it, so it can wait. I've also got a bunch of nouveau GSP fixes sailing around that'll probably land next time as well. amdgpu: - DCN 3.5 fixes - DCN 3.2 SubVP fix - GPUVM fix amdkfd: - SVM fix for APUs i915: - Fix state readout and check for DSC and bigjoiner combo - Fix a potential integer overflow - Reject async flips with bigjoiner - Fix MTL HDMI/DP PLL clock selection - Fix various issues by disabling pipe DMC events" * tag 'drm-fixes-2023-12-22' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu: re-create idle bo's PTE during VM state machine reset drm/amd/display: dereference variable before checking for zero drm/amd/display: get dprefclk ss info from integration info table drm/amd/display: Add case for dcn35 to support usb4 dmub hpd event drm/amd/display: disable FPO and SubVP for older DMUB versions on DCN32x drm/amdkfd: svm range always mapped flag not working on APU drm/amd/display: Revert " drm/amd/display: Use channel_width = 2 for vram table 3.0" drm/i915/dmc: Don't enable any pipe DMC events drm/i915/mtl: Fix HDMI/DP PLL clock selection drm/i915: Reject async flips with bigjoiner drm/i915/hwmon: Fix static analysis tool reported issues drm/i915/display: Get bigjoiner config before dsc config during readout commit 93a165cb9a4c7bf517db07abdfafde742c7dc234 Merge: 24e0d2e527a39 ff49bf1867578 Author: Linus Torvalds Date: Fri Dec 22 07:50:34 2023 -0800 Merge tag '9p-for-6.7-rc7' of https://github.com/martinetd/linux Pull 9p fixes from Dominique Martinet: "Two small fixes scheduled for stable trees: A tracepoint fix that's been reading past the end of messages forever, but semi-recently also went over the end of the buffer. And a potential incorrectly freeing garbage in pdu parsing error path" * tag '9p-for-6.7-rc7' of https://github.com/martinetd/linux: net: 9p: avoid freeing uninit memory in p9pdu_vreadf 9p: prevent read overrun in protocol dump tracepoint commit 7e8358edf503e87236c8d07f69ef0ed846dd5112 Author: Steven Rostedt (Google) Date: Thu Dec 21 19:07:57 2023 -0500 eventfs: Fix file and directory uid and gid ownership It was reported that when mounting the tracefs file system with a gid other than root, the ownership did not carry down to the eventfs directory due to the dynamic nature of it. A fix was done to solve this, but it had two issues. (a) if the attr passed into update_inode_attr() was NULL, it didn't do anything. This is true for files that have not had a chown or chgrp done to itself or any of its sibling files, as the attr is allocated for all children when any one needs it. # umount /sys/kernel/tracing # mount -o rw,seclabel,relatime,gid=1000 -t tracefs nodev /mnt # ls -ld /mnt/events/sched drwxr-xr-x 28 root rostedt 0 Dec 21 13:12 /mnt/events/sched/ # ls -ld /mnt/events/sched/sched_switch drwxr-xr-x 2 root rostedt 0 Dec 21 13:12 /mnt/events/sched/sched_switch/ But when checking the files: # ls -l /mnt/events/sched/sched_switch total 0 -rw-r----- 1 root root 0 Dec 21 13:12 enable -rw-r----- 1 root root 0 Dec 21 13:12 filter -r--r----- 1 root root 0 Dec 21 13:12 format -r--r----- 1 root root 0 Dec 21 13:12 hist -r--r----- 1 root root 0 Dec 21 13:12 id -rw-r----- 1 root root 0 Dec 21 13:12 trigger (b) When the attr does not denote the UID or GID, it defaulted to using the parent uid or gid. This is incorrect as changing the parent uid or gid will automatically change all its children. # chgrp tracing /mnt/events/timer # ls -ld /mnt/events/timer drwxr-xr-x 2 root tracing 0 Dec 21 14:34 /mnt/events/timer # ls -l /mnt/events/timer total 0 -rw-r----- 1 root root 0 Dec 21 14:35 enable -rw-r----- 1 root root 0 Dec 21 14:35 filter drwxr-xr-x 2 root tracing 0 Dec 21 14:35 hrtimer_cancel drwxr-xr-x 2 root tracing 0 Dec 21 14:35 hrtimer_expire_entry drwxr-xr-x 2 root tracing 0 Dec 21 14:35 hrtimer_expire_exit drwxr-xr-x 2 root tracing 0 Dec 21 14:35 hrtimer_init drwxr-xr-x 2 root tracing 0 Dec 21 14:35 hrtimer_start drwxr-xr-x 2 root tracing 0 Dec 21 14:35 itimer_expire drwxr-xr-x 2 root tracing 0 Dec 21 14:35 itimer_state drwxr-xr-x 2 root tracing 0 Dec 21 14:35 tick_stop drwxr-xr-x 2 root tracing 0 Dec 21 14:35 timer_cancel drwxr-xr-x 2 root tracing 0 Dec 21 14:35 timer_expire_entry drwxr-xr-x 2 root tracing 0 Dec 21 14:35 timer_expire_exit drwxr-xr-x 2 root tracing 0 Dec 21 14:35 timer_init drwxr-xr-x 2 root tracing 0 Dec 21 14:35 timer_start At first it was thought that this could be easily fixed by just making the default ownership of the superblock when it was mounted. But this does not handle the case of: # chgrp tracing instances # mkdir instances/foo If the superblock was used, then the group ownership would be that of what it was when it was mounted, when it should instead be "tracing". Instead, set a flag for the top level eventfs directory ("events") to flag which eventfs_inode belongs to it. Since the "events" directory's dentry and inode are never freed, it does not need to use its attr field to restore its mode and ownership. Use the this eventfs_inode's attr as the default ownership for all the files and directories underneath it. When the events eventfs_inode is created, it sets its ownership to its parent uid and gid. As the events directory is created at boot up before it gets mounted, this will always be uid=0 and gid=0. If it's created via an instance, then it will take the ownership of the instance directory. When the file system is mounted, it will update all the gids if one is specified. This will have a callback to update the events evenfs_inode's default entries. When a file or directory is created under the events directory, it will walk the ei->dentry parents until it finds the evenfs_inode that belongs to the events directory to retrieve the default uid and gid values. Link: https://lore.kernel.org/all/CAHk-=wiwQtUHvzwyZucDq8=Gtw+AnwScyLhpFswrQ84PjhoGsg@mail.gmail.com/ Link: https://lore.kernel.org/linux-trace-kernel/20231221190757.7eddbca9@gandalf.local.home Cc: stable@vger.kernel.org Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Dongliang Cui Cc: Hongyu Jin Fixes: 0dfc852b6fe3 ("eventfs: Have event files and directories default to parent uid and gid") Reviewed-by: Masami Hiramatsu (Google) Tested-by: Masami Hiramatsu (Google) Reported-by: Linus Torvalds Signed-off-by: Steven Rostedt (Google) commit ab241a0ab5abd70036c3d959146e534a02447d17 Merge: 7fbcd195e2b8c 6d79d9434c69b Author: Greg Kroah-Hartman Date: Fri Dec 22 09:59:30 2023 +0100 Merge tag 'usb-serial-6.7-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial device ids for 6.7-rc6 Here are some new modem device ids and a rename of a few ftdi product id defines. All have been in linux-next with no reported issues. * tag 'usb-serial-6.7-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: add Quectel EG912Y module support USB: serial: ftdi_sio: update Actisense PIDs constant names USB: serial: option: add Quectel RM500Q R13 firmware support USB: serial: option: add Foxconn T99W265 with new baseline commit 159f5bdadcdda638aad5a234b58d6031aa4ef8aa Author: Johannes Berg Date: Thu Dec 21 15:04:45 2023 +0100 debugfs: initialize cancellations earlier Tetsuo Handa pointed out that in the (now reverted) lockdep commit I initialized the data too late. The same is true for the cancellation data, it must be initialized before the cmpxchg(), otherwise it may be done twice and possibly even overwriting data in there already when there's a race. Fix that, which also requires destroying the mutex in case we lost the race. Fixes: 8c88a474357e ("debugfs: add API to allow debugfs operations cancellation") Reported-by: Tetsuo Handa Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20231221150444.1e47a0377f80.If7e8ba721ba2956f12c6e8405e7d61e154aa7ae7@changeid Signed-off-by: Greg Kroah-Hartman commit c8296d730f19b3916c11aa7b8c47a2b3e5a7ca9c Author: Kent Overstreet Date: Thu Dec 21 23:17:00 2023 -0500 bcachefs: Fix leakage of internal error code Signed-off-by: Kent Overstreet commit 01db5e5f2f6e01cbea01872850223e58075baf63 Author: Kent Overstreet Date: Thu Dec 21 21:05:07 2023 -0500 bcachefs: Fix insufficient disk reservation with compression + snapshots When overwriting and splitting existing extents, we weren't correctly accounting for a 3 way split of a compressed extent. Signed-off-by: Kent Overstreet commit d4b6e7f582e29acac17bcaf7f7771138d72f89d2 Merge: b7ef7caff63a5 49e0a85ec3441 Author: Dave Airlie Date: Fri Dec 22 13:11:08 2023 +1000 Merge tag 'drm-intel-fixes-2023-12-21' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v6.7-rc7: - Fix state readout and check for DSC and bigjoiner combo - Fix a potential integer overflow - Reject async flips with bigjoiner - Fix MTL HDMI/DP PLL clock selection - Fix various issues by disabling pipe DMC events Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87plyzsnxi.fsf@intel.com commit b7ef7caff63a55d3a1b77fce80fcbd22d93bbc51 Merge: ceb6a6f023fd3 4a0057afa3587 Author: Dave Airlie Date: Fri Dec 22 11:19:26 2023 +1000 Merge tag 'amd-drm-fixes-6.7-2023-12-20' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.7-2023-12-20: amdgpu: - DCN 3.5 fixes - DCN 3.2 SubVP fix - GPUVM fix amdkfd: - SVM fix for APUs Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20231220164845.4975-1-alexander.deucher@amd.com commit 24e0d2e527a39f64caeb2e6be39ad5396fb2da5e Merge: 9a6b294ab4966 14694179e561b Author: Linus Torvalds Date: Thu Dec 21 16:19:27 2023 -0800 Merge tag 'pinctrl-v6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "Some driver fixes for v6.7, all are in drivers, the most interesting one is probably the AMD laptop suspend bug which really needs fixing. Freedestop org has the bug description: https://gitlab.freedesktop.org/drm/amd/-/issues/2812 Summary: - Ignore disabled device tree nodes in the Starfive 7100 and 7100 drivers. - Mask non-wake source pins with interrupt enabled at suspend in the AMD driver, this blocks unnecessary wakeups from misc interrupts. This can be power consuming because in many cases the system doesn't really suspend, it just wakes right back up. - Fix a typo breaking compilation of the cy8c95x0 driver, and fix up bugs in the get/set config callbacks. - Use a dedicated lock class for the PIO4 drivers IRQ. This fixes a crash on suspend" * tag 'pinctrl-v6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: at91-pio4: use dedicated lock class for IRQ pinctrl: cy8c95x0: Fix get_pincfg pinctrl: cy8c95x0: Fix regression pinctrl: cy8c95x0: Fix typo pinctrl: amd: Mask non-wake source pins with interrupt enabled at suspend pinctrl: starfive: jh7100: ignore disabled device tree nodes pinctrl: starfive: jh7110: ignore disabled device tree nodes commit 13d822bf1cba78612b22a65b91cd6d4d443b6254 Merge: c6d3ab9e76dc0 f6fe0b2d35457 Author: Jens Axboe Date: Thu Dec 21 14:32:35 2023 -0700 Merge tag 'nvme-6.7-2023-12-21' of git://git.infradead.org/nvme into block-6.7 Pull NVMe fixes from Keith: "nvme fixes for Linux 6.7 - Revert a commit with improper sleep context (Keith) - Fix async event handling sleep context (Maurizio)" * tag 'nvme-6.7-2023-12-21' of git://git.infradead.org/nvme: nvme-pci: fix sleeping function called from interrupt context Revert "nvme-fc: fix race between error recovery and creating association" commit 9a6b294ab496650e9f270123730df37030911b55 Author: David Howells Date: Thu Dec 21 13:57:31 2023 +0000 afs: Fix use-after-free due to get/remove race in volume tree When an afs_volume struct is put, its refcount is reduced to 0 before the cell->volume_lock is taken and the volume removed from the cell->volumes tree. Unfortunately, this means that the lookup code can race and see a volume with a zero ref in the tree, resulting in a use-after-free: refcount_t: addition on 0; use-after-free. WARNING: CPU: 3 PID: 130782 at lib/refcount.c:25 refcount_warn_saturate+0x7a/0xda ... RIP: 0010:refcount_warn_saturate+0x7a/0xda ... Call Trace: afs_get_volume+0x3d/0x55 afs_create_volume+0x126/0x1de afs_validate_fc+0xfe/0x130 afs_get_tree+0x20/0x2e5 vfs_get_tree+0x1d/0xc9 do_new_mount+0x13b/0x22e do_mount+0x5d/0x8a __do_sys_mount+0x100/0x12a do_syscall_64+0x3a/0x94 entry_SYSCALL_64_after_hwframe+0x62/0x6a Fix this by: (1) When putting, use a flag to indicate if the volume has been removed from the tree and skip the rb_erase if it has. (2) When looking up, use a conditional ref increment and if it fails because the refcount is 0, replace the node in the tree and set the removal flag. Fixes: 20325960f875 ("afs: Reorganise volume and server trees to be rooted on the cell") Signed-off-by: David Howells Reviewed-by: Jeffrey Altman cc: Marc Dionne cc: linux-afs@lists.infradead.org Signed-off-by: Linus Torvalds commit af73483f4e8b6f5c68c9aa63257bdd929a9c194a Author: Matthew Wilcox (Oracle) Date: Thu Dec 21 16:53:57 2023 +0000 ida: Fix crash in ida_free when the bitmap is empty The IDA usually detects double-frees, but that detection failed to consider the case when there are no nearby IDs allocated and so we have a NULL bitmap rather than simply having a clear bit. Add some tests to the test-suite to be sure we don't inadvertently reintroduce this problem. Unfortunately they're quite noisy so include a message to disregard the warnings. Reported-by: Zhenghan Wang Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Linus Torvalds commit a9e01ac8c5ff32669119c40dfdc9e80eb0b7d7aa Author: David Howells Date: Thu Dec 21 15:09:31 2023 +0000 afs: Fix overwriting of result of DNS query In afs_update_cell(), ret is the result of the DNS lookup and the errors are to be handled by a switch - however, the value gets clobbered in between by setting it to -ENOMEM in case afs_alloc_vlserver_list() fails. Fix this by moving the setting of -ENOMEM into the error handling for OOM failure. Further, only do it if we don't have an alternative error to return. Found by Linux Verification Center (linuxtesting.org) with SVACE. Based on a patch from Anastasia Belova [1]. Fixes: d5c32c89b208 ("afs: Fix cell DNS lookup") Signed-off-by: David Howells Reviewed-by: Jeffrey Altman cc: Anastasia Belova cc: Marc Dionne cc: linux-afs@lists.infradead.org cc: lvc-project@linuxtesting.org Link: https://lore.kernel.org/r/20231221085849.1463-1-abelova@astralinux.ru/ [1] Link: https://lore.kernel.org/r/1700862.1703168632@warthog.procyon.org.uk/ # v1 Signed-off-by: Linus Torvalds commit 937fd403380023d065fd0509caa7eff639b144a0 Merge: 13b734465a9d1 39299bdd25466 Author: Linus Torvalds Date: Thu Dec 21 09:53:25 2023 -0800 Merge tag 'afs-fixes-20231221' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull AFS fixes from David Howells: "Improve the interaction of arbitrary lookups in the AFS dynamic root that hit DNS lookup failures [1] where kafs behaves differently from openafs and causes some applications to fail that aren't expecting that. Further, negative DNS results aren't getting removed and are causing failures to persist. - Always delete unused (particularly negative) dentries as soon as possible so that they don't prevent future lookups from retrying. - Fix the handling of new-style negative DNS lookups in ->lookup() to make them return ENOENT so that userspace doesn't get confused when stat succeeds but the following open on the looked up file then fails. - Fix key handling so that DNS lookup results are reclaimed almost as soon as they expire rather than sitting round either forever or for an additional 5 mins beyond a set expiry time returning EKEYEXPIRED. They persist for 1s as /bin/ls will do a second stat call if the first fails" Link: https://bugzilla.kernel.org/show_bug.cgi?id=216637 [1] Reviewed-by: Jeffrey Altman * tag 'afs-fixes-20231221' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on expiry afs: Fix dynamic root lookup DNS check afs: Fix the dynamic root's d_delete to always delete unused dentries commit 13b734465a9d1cd09551d52eb5faf5fe55e6a9ea Merge: 7c5e046bdcb25 88b30c7f5d27e Author: Linus Torvalds Date: Thu Dec 21 09:31:45 2023 -0800 Merge tag 'trace-v6.7-rc6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt: - Fix another kerneldoc warning - Fix eventfs files to inherit the ownership of its parent directory. The dynamic creation of dentries in eventfs did not take into account if the tracefs file system was mounted with a gid/uid, and would still default to the gid/uid of root. This is a regression. - Fix warning when synthetic event testing is enabled along with startup event tracing testing is enabled * tag 'trace-v6.7-rc6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing / synthetic: Disable events after testing in synth_event_gen_test_init() eventfs: Have event files and directories default to parent uid and gid tracing/synthetic: fix kernel-doc warnings commit 7c5e046bdcb2513f9decb3765d8bf92d604279cf Merge: a4aebe936554d 74769d810ead7 Author: Linus Torvalds Date: Thu Dec 21 09:15:37 2023 -0800 Merge tag 'net-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from WiFi and bpf. Current release - regressions: - bpf: syzkaller found null ptr deref in unix_bpf proto add - eth: i40e: fix ST code value for clause 45 Previous releases - regressions: - core: return error from sk_stream_wait_connect() if sk_wait_event() fails - ipv6: revert remove expired routes with a separated list of routes - wifi rfkill: - set GPIO direction - fix crash with WED rx support enabled - bluetooth: - fix deadlock in vhci_send_frame - fix use-after-free in bt_sock_recvmsg - eth: mlx5e: fix a race in command alloc flow - eth: ice: fix PF with enabled XDP going no-carrier after reset - eth: bnxt_en: do not map packet buffers twice Previous releases - always broken: - core: - check vlan filter feature in vlan_vids_add_by_dev() and vlan_vids_del_by_dev() - check dev->gso_max_size in gso_features_check() - mptcp: fix inconsistent state on fastopen race - phy: skip LED triggers on PHYs on SFP modules - eth: mlx5e: - fix double free of encap_header - fix slab-out-of-bounds in mlx5_query_nic_vport_mac_list()" * tag 'net-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (69 commits) net: check dev->gso_max_size in gso_features_check() kselftest: rtnetlink.sh: use grep_fail when expecting the cmd fail net/ipv6: Revert remove expired routes with a separated list of routes net: avoid build bug in skb extension length calculation net: ethernet: mtk_wed: fix possible NULL pointer dereference in mtk_wed_wo_queue_tx_clean() net: stmmac: fix incorrect flag check in timestamp interrupt selftests: add vlan hw filter tests net: check vlan filter feature in vlan_vids_add_by_dev() and vlan_vids_del_by_dev() net: hns3: add new maintainer for the HNS3 ethernet driver net: mana: select PAGE_POOL net: ks8851: Fix TX stall caused by TX buffer overrun ice: Fix PF with enabled XDP going no-carrier after reset ice: alter feature support check for SRIOV and LAG ice: stop trashing VF VSI aggregator node ID information mailmap: add entries for Geliang Tang mptcp: fill in missing MODULE_DESCRIPTION() mptcp: fix inconsistent state on fastopen race selftests: mptcp: join: fix subflow_send_ack lookup net: phy: skip LED triggers on PHYs on SFP modules bpf: Add missing BPF_LINK_TYPE invocations ... commit 6d79d9434c69bb8ffa8a631050eb0ad6b83d3e90 Author: Alper Ak Date: Tue Aug 8 13:51:58 2023 +0300 USB: serial: option: add Quectel EG912Y module support Add Quectel EG912Y "DIAG, AT, MODEM" 0x6001: ECM / RNDIS + DIAG + AT + MODEM T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=6001 Rev= 3.18 S: Manufacturer=Android S: Product=Android S: SerialNumber=0000 C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00 I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether E: Ad=87(I) Atr=03(Int.) MxPS= 64 Ivl=4096ms I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0c(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0b(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=89(I) Atr=03(Int.) MxPS= 64 Ivl=4096ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=88(I) Atr=03(Int.) MxPS= 64 Ivl=4096ms E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=0a(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Alper Ak Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 88b30c7f5d27e1594d70dc2bd7199b18f2b57fa9 Author: Steven Rostedt (Google) Date: Wed Dec 20 11:15:25 2023 -0500 tracing / synthetic: Disable events after testing in synth_event_gen_test_init() The synth_event_gen_test module can be built in, if someone wants to run the tests at boot up and not have to load them. The synth_event_gen_test_init() function creates and enables the synthetic events and runs its tests. The synth_event_gen_test_exit() disables the events it created and destroys the events. If the module is builtin, the events are never disabled. The issue is, the events should be disable after the tests are run. This could be an issue if the rest of the boot up tests are enabled, as they expect the events to be in a known state before testing. That known state happens to be disabled. When CONFIG_SYNTH_EVENT_GEN_TEST=y and CONFIG_EVENT_TRACE_STARTUP_TEST=y a warning will trigger: Running tests on trace events: Testing event create_synth_test: Enabled event during self test! ------------[ cut here ]------------ WARNING: CPU: 2 PID: 1 at kernel/trace/trace_events.c:4150 event_trace_self_tests+0x1c2/0x480 Modules linked in: CPU: 2 PID: 1 Comm: swapper/0 Not tainted 6.7.0-rc2-test-00031-gb803d7c664d5-dirty #276 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:event_trace_self_tests+0x1c2/0x480 Code: bb e8 a2 ab 5d fc 48 8d 7b 48 e8 f9 3d 99 fc 48 8b 73 48 40 f6 c6 01 0f 84 d6 fe ff ff 48 c7 c7 20 b6 ad bb e8 7f ab 5d fc 90 <0f> 0b 90 48 89 df e8 d3 3d 99 fc 48 8b 1b 4c 39 f3 0f 85 2c ff ff RSP: 0000:ffffc9000001fdc0 EFLAGS: 00010246 RAX: 0000000000000029 RBX: ffff88810399ca80 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffffb9f19478 RDI: ffff88823c734e64 RBP: ffff88810399f300 R08: 0000000000000000 R09: fffffbfff79eb32a R10: ffffffffbcf59957 R11: 0000000000000001 R12: ffff888104068090 R13: ffffffffbc89f0a0 R14: ffffffffbc8a0f08 R15: 0000000000000078 FS: 0000000000000000(0000) GS:ffff88823c700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 00000001f6282001 CR4: 0000000000170ef0 Call Trace: ? __warn+0xa5/0x200 ? event_trace_self_tests+0x1c2/0x480 ? report_bug+0x1f6/0x220 ? handle_bug+0x6f/0x90 ? exc_invalid_op+0x17/0x50 ? asm_exc_invalid_op+0x1a/0x20 ? tracer_preempt_on+0x78/0x1c0 ? event_trace_self_tests+0x1c2/0x480 ? __pfx_event_trace_self_tests_init+0x10/0x10 event_trace_self_tests_init+0x27/0xe0 do_one_initcall+0xd6/0x3c0 ? __pfx_do_one_initcall+0x10/0x10 ? kasan_set_track+0x25/0x30 ? rcu_is_watching+0x38/0x60 kernel_init_freeable+0x324/0x450 ? __pfx_kernel_init+0x10/0x10 kernel_init+0x1f/0x1e0 ? _raw_spin_unlock_irq+0x33/0x50 ret_from_fork+0x34/0x60 ? __pfx_kernel_init+0x10/0x10 ret_from_fork_asm+0x1b/0x30 This is because the synth_event_gen_test_init() left the synthetic events that it created enabled. By having it disable them after testing, the other selftests will run fine. Link: https://lore.kernel.org/linux-trace-kernel/20231220111525.2f0f49b0@gandalf.local.home Cc: stable@vger.kernel.org Cc: Mathieu Desnoyers Cc: Tom Zanussi Fixes: 9fe41efaca084 ("tracing: Add synth event generation test module") Acked-by: Masami Hiramatsu (Google) Reported-by: Alexander Graf Tested-by: Alexander Graf Signed-off-by: Steven Rostedt (Google) commit 0dfc852b6fe3cbecbea67332a0dce2bebeba540d Author: Steven Rostedt (Google) Date: Wed Dec 20 10:50:17 2023 -0500 eventfs: Have event files and directories default to parent uid and gid Dongliang reported: I found that in the latest version, the nodes of tracefs have been changed to dynamically created. This has caused me to encounter a problem where the gid I specified in the mounting parameters cannot apply to all files, as in the following situation: /data/tmp/events # mount | grep tracefs tracefs on /data/tmp type tracefs (rw,seclabel,relatime,gid=3012) gid 3012 = readtracefs /data/tmp # ls -lh total 0 -r--r----- 1 root readtracefs 0 1970-01-01 08:00 README -r--r----- 1 root readtracefs 0 1970-01-01 08:00 available_events ums9621_1h10:/data/tmp/events # ls -lh total 0 drwxr-xr-x 2 root root 0 2023-12-19 00:56 alarmtimer drwxr-xr-x 2 root root 0 2023-12-19 00:56 asoc It will prevent certain applications from accessing tracefs properly, I try to avoid this issue by making the following modifications. To fix this, have the files created default to taking the ownership of the parent dentry unless the ownership was previously set by the user. Link: https://lore.kernel.org/linux-trace-kernel/1703063706-30539-1-git-send-email-dongliang.cui@unisoc.com/ Link: https://lore.kernel.org/linux-trace-kernel/20231220105017.1489d790@gandalf.local.home Cc: stable@vger.kernel.org Cc: Mathieu Desnoyers Cc: Hongyu Jin Fixes: 28e12c09f5aa0 ("eventfs: Save ownership and mode") Acked-by: Masami Hiramatsu (Google) Reported-by: Dongliang Cui Signed-off-by: Steven Rostedt (Google) commit 39299bdd2546688d92ed9db4948f6219ca1b9542 Author: David Howells Date: Sat Dec 9 00:41:55 2023 +0000 keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on expiry If a key has an expiration time, then when that time passes, the key is left around for a certain amount of time before being collected (5 mins by default) so that EKEYEXPIRED can be returned instead of ENOKEY. This is a problem for DNS keys because we want to redo the DNS lookup immediately at that point. Fix this by allowing key types to be marked such that keys of that type don't have this extra period, but are reclaimed as soon as they expire and turn this on for dns_resolver-type keys. To make this easier to handle, key->expiry is changed to be permanent if TIME64_MAX rather than 0. Furthermore, give such new-style negative DNS results a 1s default expiry if no other expiry time is set rather than allowing it to stick around indefinitely. This shouldn't be zero as ls will follow a failing stat call immediately with a second with AT_SYMLINK_NOFOLLOW added. Fixes: 1a4240f4764a ("DNS: Separate out CIFS DNS Resolver code") Signed-off-by: David Howells Tested-by: Markus Suvanto cc: Wang Lei cc: Jeff Layton cc: Steve French cc: Marc Dionne cc: Jarkko Sakkinen cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-afs@lists.infradead.org cc: linux-cifs@vger.kernel.org cc: linux-nfs@vger.kernel.org cc: ceph-devel@vger.kernel.org cc: keyrings@vger.kernel.org cc: netdev@vger.kernel.org commit 74769d810ead7e7af1a481f07a4d890861a6a4cc Merge: 24ab059d2ebd6 117211aa739a9 Author: Paolo Abeni Date: Thu Dec 21 12:27:28 2023 +0100 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2023-12-21 Hi David, hi Jakub, hi Paolo, hi Eric, The following pull-request contains BPF updates for your *net* tree. We've added 3 non-merge commits during the last 5 day(s) which contain a total of 4 files changed, 45 insertions(+). The main changes are: 1) Fix a syzkaller splat which triggered an oob issue in bpf_link_show_fdinfo(), from Jiri Olsa. 2) Fix another syzkaller-found issue which triggered a NULL pointer dereference in BPF sockmap for unconnected unix sockets, from John Fastabend. bpf-for-netdev * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf: Add missing BPF_LINK_TYPE invocations bpf: sockmap, test for unconnected af_unix sock bpf: syzkaller found null ptr deref in unix_bpf proto add ==================== Link: https://lore.kernel.org/r/20231221104844.1374-1-daniel@iogearbox.net Signed-off-by: Paolo Abeni commit 1cc3542c76acb5f59001e3e562eba672f1983355 Author: xiongxin Date: Wed Dec 20 10:29:01 2023 +0800 gpio: dwapb: mask/unmask IRQ when disable/enale it In the hardware implementation of the I2C HID driver based on DesignWare GPIO IRQ chip, when the user continues to use the I2C HID device in the suspend process, the I2C HID interrupt will be masked after the resume process is finished. This is because the disable_irq()/enable_irq() of the DesignWare GPIO driver does not synchronize the IRQ mask register state. In normal use of the I2C HID procedure, the GPIO IRQ irq_mask()/irq_unmask() functions are called in pairs. In case of an exception, i2c_hid_core_suspend() calls disable_irq() to disable the GPIO IRQ. With low probability, this causes irq_unmask() to not be called, which causes the GPIO IRQ to be masked and not unmasked in enable_irq(), raising an exception. Add synchronization to the masked register state in the dwapb_irq_enable()/dwapb_irq_disable() function. mask the GPIO IRQ before disabling it. After enabling the GPIO IRQ, unmask the IRQ. Fixes: 7779b3455697 ("gpio: add a driver for the Synopsys DesignWare APB GPIO block") Cc: stable@kernel.org Co-developed-by: Riwen Lu Signed-off-by: Riwen Lu Signed-off-by: xiongxin Acked-by: Serge Semin Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 1d656bd259edb89dc1d9938ec5c5389867088546 Author: Kent Gibson Date: Thu Dec 21 09:20:36 2023 +0800 gpiolib: cdev: add gpio_device locking wrapper around gpio_ioctl() While the GPIO cdev gpio_ioctl() call is in progress, the kernel can call gpiochip_remove() which will set gdev->chip to NULL, after which any subsequent access will cause a crash. gpio_ioctl() was overlooked by the previous fix to protect syscalls (bdbbae241a04), so add protection for that. Fixes: bdbbae241a04 ("gpiolib: protect the GPIO device against being dropped while in use by user-space") Fixes: d7c51b47ac11 ("gpio: userspace ABI for reading/writing GPIO lines") Fixes: 3c0d9c635ae2 ("gpiolib: cdev: support GPIO_V2_GET_LINE_IOCTL and GPIO_V2_LINE_GET_VALUES_IOCTL") Fixes: aad955842d1c ("gpiolib: cdev: support GPIO_V2_GET_LINEINFO_IOCTL and GPIO_V2_GET_LINEINFO_WATCH_IOCTL") Signed-off-by: Kent Gibson Signed-off-by: Bartosz Golaszewski commit 24ab059d2ebd62fdccc43794796f6ffbabe49ebc Author: Eric Dumazet Date: Tue Dec 19 12:53:31 2023 +0000 net: check dev->gso_max_size in gso_features_check() Some drivers might misbehave if TSO packets get too big. GVE for instance uses a 16bit field in its TX descriptor, and will do bad things if a packet is bigger than 2^16 bytes. Linux TCP stack honors dev->gso_max_size, but there are other ways for too big packets to reach an ndo_start_xmit() handler : virtio_net, af_packet, GRO... Add a generic check in gso_features_check() and fallback to GSO when needed. gso_max_size was added in the blamed commit. Fixes: 82cc1a7a5687 ("[NET]: Add per-connection option to set max TSO frame size") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20231219125331.4127498-1-edumazet@google.com Signed-off-by: Paolo Abeni commit b8056f2ce07f27c43b9488dd1bc8bfbb60d0779d Author: Hangbin Liu Date: Tue Dec 19 14:57:37 2023 +0800 kselftest: rtnetlink.sh: use grep_fail when expecting the cmd fail run_cmd_grep_fail should be used when expecting the cmd fail, or the ret will be set to 1, and the total test return 1 when exiting. This would cause the result report to fail if run via run_kselftest.sh. Before fix: # ./rtnetlink.sh -t kci_test_addrlft PASS: preferred_lft addresses have expired # echo $? 1 After fix: # ./rtnetlink.sh -t kci_test_addrlft PASS: preferred_lft addresses have expired # echo $? 0 Fixes: 9c2a19f71515 ("kselftest: rtnetlink.sh: add verbose flag") Signed-off-by: Hangbin Liu Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231219065737.1725120-1-liuhangbin@gmail.com Signed-off-by: Paolo Abeni commit 916d051730ae48aef8b588fd096fefca4bc0590a Author: Stefan Binding Date: Tue Dec 19 16:22:32 2023 +0000 ALSA: hda: cs35l41: Only add SPI CS GPIO if SPI is enabled in kernel If CONFIG_SPI is not set in the kernel, there is no point in trying to set the chip selects. We can selectively compile it. Fixes: 8c4c216db8fb ("ALSA: hda: cs35l41: Add config table to support many laptops without _DSD") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202312192256.lJelQEoZ-lkp@intel.com/ Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231219162232.790358-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit ed7326a24a1a9af65fafefd86b505e7c3b968f6d Author: Stefan Binding Date: Tue Dec 19 16:22:31 2023 +0000 ALSA: hda: cs35l41: Do not allow uninitialised variables to be freed Initialise the variables to NULL so that they cannot be uninitialised when devm_kfree is called. Found by static analysis. Fixes: 8c4c216db8fb ("ALSA: hda: cs35l41: Add config table to support many laptops without _DSD") Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231219162232.790358-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 092a1362470937e46947ccdc6fe4c8a9b72f3f49 Merge: ae53e2198cb81 8f0f01647550d Author: Takashi Iwai Date: Thu Dec 21 09:22:47 2023 +0100 Merge tag 'asoc-fix-v6.7-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.7 Quite a big collection of fixes, as ever mostly in drivers. There's one framework fix for the HDMI CODEC where it wasn't handling startup properly for some controllers, and one new x86 quirk, but otherwise all local fixes or dropping things we don't want to see in a release. commit 14694179e561b5f2f7e56a0f590e2cb49a9cc7ab Author: Alexis Lothoré Date: Fri Dec 15 22:34:24 2023 +0100 pinctrl: at91-pio4: use dedicated lock class for IRQ Trying to suspend to RAM on SAMA5D27 EVK leads to the following lockdep warning: ============================================ WARNING: possible recursive locking detected 6.7.0-rc5-wt+ #532 Not tainted -------------------------------------------- sh/92 is trying to acquire lock: c3cf306c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0xe8/0x100 but task is already holding lock: c3d7c46c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0xe8/0x100 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 6 locks held by sh/92: #0: c3aa0258 (sb_writers#6){.+.+}-{0:0}, at: ksys_write+0xd8/0x178 #1: c4c2df44 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x138/0x284 #2: c32684a0 (kn->active){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x148/0x284 #3: c232b6d4 (system_transition_mutex){+.+.}-{3:3}, at: pm_suspend+0x13c/0x4e8 #4: c387b088 (&dev->mutex){....}-{3:3}, at: __device_suspend+0x1e8/0x91c #5: c3d7c46c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0xe8/0x100 stack backtrace: CPU: 0 PID: 92 Comm: sh Not tainted 6.7.0-rc5-wt+ #532 Hardware name: Atmel SAMA5 unwind_backtrace from show_stack+0x18/0x1c show_stack from dump_stack_lvl+0x34/0x48 dump_stack_lvl from __lock_acquire+0x19ec/0x3a0c __lock_acquire from lock_acquire.part.0+0x124/0x2d0 lock_acquire.part.0 from _raw_spin_lock_irqsave+0x5c/0x78 _raw_spin_lock_irqsave from __irq_get_desc_lock+0xe8/0x100 __irq_get_desc_lock from irq_set_irq_wake+0xa8/0x204 irq_set_irq_wake from atmel_gpio_irq_set_wake+0x58/0xb4 atmel_gpio_irq_set_wake from irq_set_irq_wake+0x100/0x204 irq_set_irq_wake from gpio_keys_suspend+0xec/0x2b8 gpio_keys_suspend from dpm_run_callback+0xe4/0x248 dpm_run_callback from __device_suspend+0x234/0x91c __device_suspend from dpm_suspend+0x224/0x43c dpm_suspend from dpm_suspend_start+0x9c/0xa8 dpm_suspend_start from suspend_devices_and_enter+0x1e0/0xa84 suspend_devices_and_enter from pm_suspend+0x460/0x4e8 pm_suspend from state_store+0x78/0xe4 state_store from kernfs_fop_write_iter+0x1a0/0x284 kernfs_fop_write_iter from vfs_write+0x38c/0x6f4 vfs_write from ksys_write+0xd8/0x178 ksys_write from ret_fast_syscall+0x0/0x1c Exception stack(0xc52b3fa8 to 0xc52b3ff0) 3fa0: 00000004 005a0ae8 00000001 005a0ae8 00000004 00000001 3fc0: 00000004 005a0ae8 00000001 00000004 00000004 b6c616c0 00000020 0059d190 3fe0: 00000004 b6c61678 aec5a041 aebf1a26 This warning is raised because pinctrl-at91-pio4 uses chained IRQ. Whenever a wake up source configures an IRQ through irq_set_irq_wake, it will lock the corresponding IRQ desc, and then call irq_set_irq_wake on "parent" IRQ which will do the same on its own IRQ desc, but since those two locks share the same class, lockdep reports this as an issue. Fix lockdep false positive by setting a different class for parent and children IRQ Fixes: 776180848b57 ("pinctrl: introduce driver for Atmel PIO4 controller") Signed-off-by: Alexis Lothoré Link: https://lore.kernel.org/r/20231215-lockdep_warning-v1-1-8137b2510ed5@bootlin.com Signed-off-by: Linus Walleij commit 513d88a88e0203188a38f4647dd08170aebd85df Author: Mark Glover Date: Wed Dec 20 13:57:40 2023 +0000 USB: serial: ftdi_sio: update Actisense PIDs constant names Update the constant names for unused USB PIDs (product identifiers) to reflect the new products now using the PIDs. Signed-off-by: Mark Glover Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit dade3f6a1e4e35a5ae916d5e78b3229ec34c78ec Author: David Ahern Date: Mon Dec 18 20:02:43 2023 -0700 net/ipv6: Revert remove expired routes with a separated list of routes This reverts commit 3dec89b14d37ee635e772636dad3f09f78f1ab87. The commit has some race conditions given how expires is managed on a fib6_info in relation to gc start, adding the entry to the gc list and setting the timer value leading to UAF. Revert the commit and try again in a later release. Fixes: 3dec89b14d37 ("net/ipv6: Remove expired routes with a separated list of routes") Cc: Kui-Feng Lee Signed-off-by: David Ahern Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20231219030243.25687-1-dsahern@kernel.org Signed-off-by: Paolo Abeni commit b414020fed42b274946aae28becf45ff156bbd2e Merge: d6e5794b06c0f f5728a418945b Author: Paolo Abeni Date: Thu Dec 21 08:34:08 2023 +0100 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-12-18 (ice) This series contains updates to ice driver only. Jakes stops clearing of needed aggregator information. Dave adds a check for LAG device support before initializing the associated event handler. Larysa restores accounting of XDP queues in TC configurations. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ice: Fix PF with enabled XDP going no-carrier after reset ice: alter feature support check for SRIOV and LAG ice: stop trashing VF VSI aggregator node ID information ==================== Link: https://lore.kernel.org/r/20231218192708.3397702-1-anthony.l.nguyen@intel.com Signed-off-by: Paolo Abeni commit 93cd0597649844a0fe7989839a3202735fb3ae67 Author: Arnd Bergmann Date: Mon Dec 4 09:47:01 2023 +0100 x86/xen: add CPU dependencies for 32-bit build Xen only supports modern CPUs even when running a 32-bit kernel, and it now requires a kernel built for a 64 byte (or larger) cache line: In file included from : In function 'xen_vcpu_setup', inlined from 'xen_vcpu_setup_restore' at arch/x86/xen/enlighten.c:111:3, inlined from 'xen_vcpu_restore' at arch/x86/xen/enlighten.c:141:3: include/linux/compiler_types.h:435:45: error: call to '__compiletime_assert_287' declared with attribute error: BUILD_BUG_ON failed: sizeof(*vcpup) > SMP_CACHE_BYTES arch/x86/xen/enlighten.c:166:9: note: in expansion of macro 'BUILD_BUG_ON' 166 | BUILD_BUG_ON(sizeof(*vcpup) > SMP_CACHE_BYTES); | ^~~~~~~~~~~~ Enforce the dependency with a whitelist of CPU configurations. In normal distro kernels, CONFIG_X86_GENERIC is enabled, and this works fine. When this is not set, still allow Xen to be built on kernels that target a 64-bit capable CPU. Fixes: db2832309a82 ("x86/xen: fix percpu vcpu_info allocation") Signed-off-by: Arnd Bergmann Reviewed-by: Juergen Gross Tested-by: Alyssa Ross Link: https://lore.kernel.org/r/20231204084722.3789473-1-arnd@kernel.org Signed-off-by: Juergen Gross commit d6e5794b06c0fab74fe6e4fa55d508a5ceb14735 Author: Thomas Weißschuh Date: Mon Dec 18 18:06:54 2023 +0100 net: avoid build bug in skb extension length calculation GCC seems to incorrectly fail to evaluate skb_ext_total_length() at compile time under certain conditions. The issue even occurs if all values in skb_ext_type_len[] are "0", ruling out the possibility of an actual overflow. As the patch has been in mainline since v6.6 without triggering the problem it seems to be a very uncommon occurrence. As the issue only occurs when -fno-tree-loop-im is specified as part of CFLAGS_GCOV, disable the BUILD_BUG_ON() only when building with coverage reporting enabled. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202312171924.4FozI5FG-lkp@intel.com/ Suggested-by: Arnd Bergmann Link: https://lore.kernel.org/lkml/487cfd35-fe68-416f-9bfd-6bb417f98304@app.fastmail.com/ Fixes: 5d21d0a65b57 ("net: generalize calculation of skb extensions length") Cc: Signed-off-by: Thomas Weißschuh Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231218-net-skbuff-build-bug-v1-1-eefc2fb0a7d3@weissschuh.net Signed-off-by: Paolo Abeni commit 7cb8cd4daacfea646cf8b5925ca2c66c98b18480 Author: Lorenzo Bianconi Date: Sun Dec 17 16:37:40 2023 +0100 net: ethernet: mtk_wed: fix possible NULL pointer dereference in mtk_wed_wo_queue_tx_clean() In order to avoid a NULL pointer dereference, check entry->buf pointer before running skb_free_frag in mtk_wed_wo_queue_tx_clean routine. Fixes: 799684448e3e ("net: ethernet: mtk_wed: introduce wed wo support") Signed-off-by: Lorenzo Bianconi Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/3c1262464d215faa8acebfc08869798c81c96f4a.1702827359.git.lorenzo@kernel.org Signed-off-by: Paolo Abeni commit a4aebe936554dac6a91e5d091179c934f8325708 Author: Linus Torvalds Date: Tue Dec 19 15:26:59 2023 -0800 posix-timers: Get rid of [COMPAT_]SYS_NI() uses Only the posix timer system calls use this (when the posix timer support is disabled, which does not actually happen in any normal case), because they had debug code to print out a warning about missing system calls. Get rid of that special case, and just use the standard COND_SYSCALL interface that creates weak system call stubs that return -ENOSYS for when the system call does not exist. This fixes a kCFI issue with the SYS_NI() hackery: CFI failure at int80_emulation+0x67/0xb0 (target: sys_ni_posix_timers+0x0/0x70; expected type: 0xb02b34d9) WARNING: CPU: 0 PID: 48 at int80_emulation+0x67/0xb0 Reported-by: kernel test robot Reviewed-by: Sami Tolvanen Tested-by: Sami Tolvanen Cc: Thomas Gleixner Cc: Dave Hansen Cc: Borislav Petkov Signed-off-by: Linus Torvalds commit eee7f5b48e20c585dc8069b3ab8abdcabd0afded Merge: 1bf5c89256094 12d1e301bdfd1 Author: Linus Torvalds Date: Wed Dec 20 21:09:47 2023 -0800 Merge tag '6.7-rc6-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fixes from Steve French: - two multichannel reconnect fixes, one fixing an important refcounting problem that can lead to umount problems - atime fix - five fixes for various potential OOB accesses, including a CVE fix, and two additional fixes for problems pointed out by Robert Morris's fuzzing investigation * tag '6.7-rc6-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: do not let cifs_chan_update_iface deallocate channels cifs: fix a pending undercount of srv_count fs: cifs: Fix atime update check smb: client: fix potential OOB in smb2_dump_detail() smb: client: fix potential OOB in cifs_dump_detail() smb: client: fix OOB in smbCalcSize() smb: client: fix OOB in SMB2_query_info_init() smb: client: fix OOB in cifsd when receiving compounded resps commit 1bf5c8925609425fe0ff7270fe8fb14246c01694 Merge: 87c71dd604e54 3d940bb181832 Author: Linus Torvalds Date: Wed Dec 20 16:12:39 2023 -0800 Merge tag 's390-6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Alexander Gordeev: - Fix virtual vs physical address confusion in Storage Class Memory (SCM) block device driver. - Fix saving and restoring of FPU kernel context, which could lead to corruption of vector registers 8-15 - Update defconfigs * tag 's390-6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: update defconfigs s390/vx: fix save/restore of fpu kernel context s390/scm: fix virtual vs physical address confusion commit 87c71dd604e54b412db09b74cb67ebce09c57cd5 Merge: 1bddd45b5cbc0 fa3d6c7183106 Author: Linus Torvalds Date: Wed Dec 20 16:06:40 2023 -0800 Merge tag 'soc-fixes-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "There are only a handful of bugfixes this time, which feels almost too small, so I hope we are not missing something important. - One more mediatek dts warning fix after the previous larger set, this should finally result in a clean defconfig build. - TI OMAP dts fixes for a spurious hang on am335x and invalid data on DTA7 - One DTS fix for ethernet on Oriange Pi Zero (Allwinner H616) - A regression fix for ti-sysc interconnect target module driver to not access registers after reset if srst_udelay quirk is needed - Reset controller driver fixes for a crash during error handling and a build warning" * tag 'soc-fixes-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: arm64: dts: mediatek: mt8395-genio-1200-evk: add interrupt-parent for mt6360 ARM: dts: Fix occasional boot hang for am3 usb reset: Fix crash when freeing non-existent optional resets ARM: OMAP2+: Fix null pointer dereference and memory leak in omap_soc_device_init ARM: dts: dra7: Fix DRA7 L3 NoC node register size bus: ti-sysc: Flush posted write only after srst_udelay reset: hisilicon: hi6220: fix Wvoid-pointer-to-enum-cast warning arm64: dts: allwinner: h616: update emac for Orange Pi Zero 3 commit 1bddd45b5cbc0dd278ea7c568d60dc399bc4d3cc Merge: 1a44b0073b923 a55bdad5dfd1e Author: Linus Torvalds Date: Wed Dec 20 15:58:18 2023 -0800 Merge tag 'platform-drivers-x86-v6.7-5' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform drivers fixes from Ilpo Järvinen: - Fan reporting on some ThinkPads - Laptop 13 spurious keypresses while suspended - Intel PMC correction to avoid crash * tag 'platform-drivers-x86-v6.7-5' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86/amd/pmc: Disable keyboard wakeup on AMD Framework 13 platform/x86/amd/pmc: Move keyboard wakeup disablement detection to pmc-quirks platform/x86/amd/pmc: Only run IRQ1 firmware version check on Cezanne platform/x86/amd/pmc: Move platform defines to header platform/x86/intel/pmc: Fix hang in pmc_core_send_ltr_ignore() platform/x86: thinkpad_acpi: fix for incorrect fan reporting on some ThinkPad systems commit 1803d0c5ee1a3bbee23db2336e21add067824f02 Author: Matthew Wilcox (Oracle) Date: Mon Dec 18 14:03:28 2023 +0000 mailmap: add an old address for Naoya Horiguchi This address now bounces, remap it to a current address. Link: https://lkml.kernel.org/r/20231218140328.3313474-1-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Dan Williams Cc: Naoya Horiguchi Signed-off-by: Andrew Morton commit 39ebd6dce62d8cfe3864e16148927a139f11bc9a Author: Matthew Wilcox (Oracle) Date: Mon Dec 18 13:58:37 2023 +0000 mm/memory-failure: cast index to loff_t before shifting it On 32-bit systems, we'll lose the top bits of index because arithmetic will be performed in unsigned long instead of unsigned long long. This affects files over 4GB in size. Link: https://lkml.kernel.org/r/20231218135837.3310403-4-willy@infradead.org Fixes: 6100e34b2526 ("mm, memory_failure: Teach memory_failure() about dev_pagemap pages") Signed-off-by: Matthew Wilcox (Oracle) Cc: Dan Williams Cc: Naoya Horiguchi Cc: Signed-off-by: Andrew Morton commit c79c5a0a00a9457718056b588f312baadf44e471 Author: Matthew Wilcox (Oracle) Date: Mon Dec 18 13:58:36 2023 +0000 mm/memory-failure: check the mapcount of the precise page A process may map only some of the pages in a folio, and might be missed if it maps the poisoned page but not the head page. Or it might be unnecessarily hit if it maps the head page, but not the poisoned page. Link: https://lkml.kernel.org/r/20231218135837.3310403-3-willy@infradead.org Fixes: 7af446a841a2 ("HWPOISON, hugetlb: enable error handling path for hugepage") Signed-off-by: Matthew Wilcox (Oracle) Cc: Dan Williams Cc: Naoya Horiguchi Cc: Signed-off-by: Andrew Morton commit 376907f3a0b34a17e80417825f8cc1c40fcba81b Author: Matthew Wilcox (Oracle) Date: Mon Dec 18 13:58:35 2023 +0000 mm/memory-failure: pass the folio and the page to collect_procs() Patch series "Three memory-failure fixes". I've been looking at the memory-failure code and I believe I have found three bugs that need fixing -- one going all the way back to 2010! I'll have more patches later to use folios more extensively but didn't want these bugfixes to get caught up in that. This patch (of 3): Both collect_procs_anon() and collect_procs_file() iterate over the VMA interval trees looking for a single pgoff, so it is wrong to look for the pgoff of the head page as is currently done. However, it is also wrong to look at page->mapping of the precise page as this is invalid for tail pages. Clear up the confusion by passing both the folio and the precise page to collect_procs(). Link: https://lkml.kernel.org/r/20231218135837.3310403-1-willy@infradead.org Link: https://lkml.kernel.org/r/20231218135837.3310403-2-willy@infradead.org Fixes: 415c64c1453a ("mm/memory-failure: split thp earlier in memory error handling") Signed-off-by: Matthew Wilcox (Oracle) Cc: Dan Williams Cc: Naoya Horiguchi Cc: Signed-off-by: Andrew Morton commit 0aac13add26d546ac74c89d2883b3a5f0fbea039 Author: Muhammad Usama Anjum Date: Thu Dec 14 15:19:30 2023 +0500 selftests: secretmem: floor the memory size to the multiple of page_size The "locked-in-memory size" limit per process can be non-multiple of page_size. The mmap() fails if we try to allocate locked-in-memory with same size as the allowed limit if it isn't multiple of the page_size because mmap() rounds off the memory size to be allocated to next multiple of page_size. Fix this by flooring the length to be allocated with mmap() to the previous multiple of the page_size. This was getting triggered on KernelCI regularly because of different ulimit settings which wasn't multiple of the page_size. Find logs here: https://linux.kernelci.org/test/plan/id/657654bd8e81e654fae13532/ The bug in was present from the time test was first added. Link: https://lkml.kernel.org/r/20231214101931.1155586-1-usama.anjum@collabora.com Fixes: 76fe17ef588a ("secretmem: test: add basic selftest for memfd_secret(2)") Signed-off-by: Muhammad Usama Anjum Reported-by: "kernelci.org bot" Closes: https://linux.kernelci.org/test/plan/id/657654bd8e81e654fae13532/ Cc: "James E.J. Bottomley" Cc: Mike Rapoport (IBM) Cc: Shuah Khan Cc: Signed-off-by: Andrew Morton commit fc346d0a70a13d52fe1c4bc49516d83a42cd7c4c Author: Charan Teja Kalla Date: Thu Dec 14 04:58:41 2023 +0000 mm: migrate high-order folios in swap cache correctly Large folios occupy N consecutive entries in the swap cache instead of using multi-index entries like the page cache. However, if a large folio is re-added to the LRU list, it can be migrated. The migration code was not aware of the difference between the swap cache and the page cache and assumed that a single xas_store() would be sufficient. This leaves potentially many stale pointers to the now-migrated folio in the swap cache, which can lead to almost arbitrary data corruption in the future. This can also manifest as infinite loops with the RCU read lock held. [willy@infradead.org: modifications to the changelog & tweaked the fix] Fixes: 3417013e0d18 ("mm/migrate: Add folio_migrate_mapping()") Link: https://lkml.kernel.org/r/20231214045841.961776-1-willy@infradead.org Signed-off-by: Charan Teja Kalla Signed-off-by: Matthew Wilcox (Oracle) Reported-by: Charan Teja Kalla Closes: https://lkml.kernel.org/r/1700569840-17327-1-git-send-email-quic_charante@quicinc.com Cc: David Hildenbrand Cc: Johannes Weiner Cc: Kirill A. Shutemov Cc: Naoya Horiguchi Cc: Shakeel Butt Cc: Signed-off-by: Andrew Morton commit 4249f13c11be8b8b7bf93204185e150c3bdc968d Author: Sidhartha Kumar Date: Wed Dec 13 12:50:57 2023 -0800 maple_tree: do not preallocate nodes for slot stores mas_preallocate() defaults to requesting 1 node for preallocation and then ,depending on the type of store, will update the request variable. There isn't a check for a slot store type, so slot stores are preallocating the default 1 node. Slot stores do not require any additional nodes, so add a check for the slot store case that will bypass node_count_gfp(). Update the tests to reflect that slot stores do not require allocations. User visible effects of this bug include increased memory usage from the unneeded node that was allocated. Link: https://lkml.kernel.org/r/20231213205058.386589-1-sidhartha.kumar@oracle.com Fixes: 0b8bb544b1a7 ("maple_tree: update mas_preallocate() testing") Signed-off-by: Sidhartha Kumar Cc: Liam R. Howlett Cc: Matthew Wilcox (Oracle) Cc: Peng Zhang Cc: [6.6+] Signed-off-by: Andrew Morton commit e2c27b803bb664748e090d99042ac128b3f88d92 Author: Baokun Li Date: Wed Dec 13 14:23:24 2023 +0800 mm/filemap: avoid buffered read/write race to read inconsistent data The following concurrency may cause the data read to be inconsistent with the data on disk: cpu1 cpu2 ------------------------------|------------------------------ // Buffered write 2048 from 0 ext4_buffered_write_iter generic_perform_write copy_page_from_iter_atomic ext4_da_write_end ext4_da_do_write_end block_write_end __block_commit_write folio_mark_uptodate // Buffered read 4096 from 0 smp_wmb() ext4_file_read_iter set_bit(PG_uptodate, folio_flags) generic_file_read_iter i_size_write // 2048 filemap_read unlock_page(page) filemap_get_pages filemap_get_read_batch folio_test_uptodate(folio) ret = test_bit(PG_uptodate, folio_flags) if (ret) smp_rmb(); // Ensure that the data in page 0-2048 is up-to-date. // New buffered write 2048 from 2048 ext4_buffered_write_iter generic_perform_write copy_page_from_iter_atomic ext4_da_write_end ext4_da_do_write_end block_write_end __block_commit_write folio_mark_uptodate smp_wmb() set_bit(PG_uptodate, folio_flags) i_size_write // 4096 unlock_page(page) isize = i_size_read(inode) // 4096 // Read the latest isize 4096, but without smp_rmb(), there may be // Load-Load disorder resulting in the data in the 2048-4096 range // in the page is not up-to-date. copy_page_to_iter // copyout 4096 In the concurrency above, we read the updated i_size, but there is no read barrier to ensure that the data in the page is the same as the i_size at this point, so we may copy the unsynchronized page out. Hence adding the missing read memory barrier to fix this. This is a Load-Load reordering issue, which only occurs on some weak mem-ordering architectures (e.g. ARM64, ALPHA), but not on strong mem-ordering architectures (e.g. X86). And theoretically the problem doesn't only happen on ext4, filesystems that call filemap_read() but don't hold inode lock (e.g. btrfs, f2fs, ubifs ...) will have this problem, while filesystems with inode lock (e.g. xfs, nfs) won't have this problem. Link: https://lkml.kernel.org/r/20231213062324.739009-1-libaokun1@huawei.com Signed-off-by: Baokun Li Reviewed-by: Jan Kara Cc: Andreas Dilger Cc: Christoph Hellwig Cc: Dave Chinner Cc: Matthew Wilcox (Oracle) Cc: Ritesh Harjani (IBM) Cc: Theodore Ts'o Cc: yangerkun Cc: Yu Kuai Cc: Zhang Yi Cc: Signed-off-by: Andrew Morton commit b2325bf860faa2f304a7e188f00cf9f7dc9b5ee8 Author: Nico Pache Date: Tue Dec 12 16:26:59 2023 -0700 kunit: kasan_test: disable fortify string checker on kmalloc_oob_memset Similar to commit 09c6304e38e4 ("kasan: test: fix compatibility with FORTIFY_SOURCE") the kernel is panicing in kmalloc_oob_memset_*. This is due to the `ptr` not being hidden from the optimizer which would disable the runtime fortify string checker. kernel BUG at lib/string_helpers.c:1048! Call Trace: [<00000000272502e2>] fortify_panic+0x2a/0x30 ([<00000000272502de>] fortify_panic+0x26/0x30) [<001bffff817045c4>] kmalloc_oob_memset_2+0x22c/0x230 [kasan_test] Hide the `ptr` variable from the optimizer to fix the kernel panic. Also define a memset_size variable and hide that as well. This cleans up the code and follows the same convention as other tests. [npache@redhat.com: address review comments from Andrey] Link: https://lkml.kernel.org/r/20231214164423.6202-1-npache@redhat.com Link: https://lkml.kernel.org/r/20231212232659.18839-1-npache@redhat.com Signed-off-by: Nico Pache Reviewed-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Vincenzo Frascino Signed-off-by: Andrew Morton commit e63bde3d9417f8318d6dd0d0fafa35ebf307aabd Author: Arnd Bergmann Date: Mon Oct 23 13:01:55 2023 +0200 kexec: select CRYPTO from KEXEC_FILE instead of depending on it All other users of crypto code use 'select' instead of 'depends on', so do the same thing with KEXEC_FILE for consistency. In practice this makes very little difference as kernels with kexec support are very likely to also include some other feature that already selects both crypto and crypto_sha256, but being consistent here helps for usability as well as to avoid potential circular dependencies. This reverts the dependency back to what it was originally before commit 74ca317c26a3f ("kexec: create a new config option CONFIG_KEXEC_FILE for new syscall"), which changed changed it with the comment "This should be safer as "select" is not recursive", but that appears to have been done in error, as "select" is indeed recursive, and there are no other dependencies that prevent CRYPTO_SHA256 from being selected here. Link: https://lkml.kernel.org/r/20231023110308.1202042-2-arnd@kernel.org Fixes: 74ca317c26a3f ("kexec: create a new config option CONFIG_KEXEC_FILE for new syscall") Signed-off-by: Arnd Bergmann Reviewed-by: Eric DeVolder Tested-by: Eric DeVolder Acked-by: Baoquan He Cc: Herbert Xu Cc: "David S. Miller" Cc: Albert Ou Cc: Alexander Gordeev Cc: Ard Biesheuvel Cc: Borislav Petkov Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Conor Dooley Cc: Dave Hansen Cc: Heiko Carstens Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Peter Zijlstra Cc: Sven Schnelle Cc: Thomas Gleixner Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit c1ad12ee0efc07244be37f69311e6f7c4ac98e62 Author: Arnd Bergmann Date: Mon Oct 23 13:01:54 2023 +0200 kexec: fix KEXEC_FILE dependencies The cleanup for the CONFIG_KEXEC Kconfig logic accidentally changed the 'depends on CRYPTO=y' dependency to a plain 'depends on CRYPTO', which causes a link failure when all the crypto support is in a loadable module and kexec_file support is built-in: x86_64-linux-ld: vmlinux.o: in function `__x64_sys_kexec_file_load': (.text+0x32e30a): undefined reference to `crypto_alloc_shash' x86_64-linux-ld: (.text+0x32e58e): undefined reference to `crypto_shash_update' x86_64-linux-ld: (.text+0x32e6ee): undefined reference to `crypto_shash_final' Both s390 and x86 have this problem, while ppc64 and riscv have the correct dependency already. On riscv, the dependency is only used for the purgatory, not for the kexec_file code itself, which may be a bit surprising as it means that with CONFIG_CRYPTO=m, it is possible to enable KEXEC_FILE but then the purgatory code is silently left out. Move this into the common Kconfig.kexec file in a way that is correct everywhere, using the dependency on CRYPTO_SHA256=y only when the purgatory code is available. This requires reversing the dependency between ARCH_SUPPORTS_KEXEC_PURGATORY and KEXEC_FILE, but the effect remains the same, other than making riscv behave like the other ones. On s390, there is an additional dependency on CRYPTO_SHA256_S390, which should technically not be required but gives better performance. Remove this dependency here, noting that it was not present in the initial Kconfig code but was brought in without an explanation in commit 71406883fd357 ("s390/kexec_file: Add kexec_file_load system call"). [arnd@arndb.de: fix riscv build] Link: https://lkml.kernel.org/r/67ddd260-d424-4229-a815-e3fcfb864a77@app.fastmail.com Link: https://lkml.kernel.org/r/20231023110308.1202042-1-arnd@kernel.org Fixes: 6af5138083005 ("x86/kexec: refactor for kernel/Kconfig.kexec") Signed-off-by: Arnd Bergmann Reviewed-by: Eric DeVolder Tested-by: Eric DeVolder Cc: Albert Ou Cc: Alexander Gordeev Cc: Ard Biesheuvel Cc: Borislav Petkov Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Conor Dooley Cc: Dave Hansen Cc: David S. Miller Cc: Heiko Carstens Cc: Herbert Xu Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Peter Zijlstra Cc: Sven Schnelle Cc: Thomas Gleixner Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit 1a44b0073b9235521280e19d963b6dfef7888f18 Merge: 74d8fc2b868ae 413ba91089c74 Author: Linus Torvalds Date: Wed Dec 20 12:04:03 2023 -0800 Merge tag 'ovl-fixes-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs Pull overlayfs fix from Amir Goldstein: "Fix a regression from this merge window" * tag 'ovl-fixes-6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs: ovl: fix dentry reference leak after changes to underlying layers commit 74d8fc2b868ae156dcbd33132029561a8341d659 Merge: ac1c13e257c79 247ce5f1bb3ea Author: Linus Torvalds Date: Wed Dec 20 11:24:28 2023 -0800 Merge tag 'bcachefs-2023-12-19' of https://evilpiepirate.org/git/bcachefs Pull more bcachefs fixes from Kent Overstreet: - Fix a deadlock in the data move path with nocow locks (vs. update in place writes); when trylock failed we were incorrectly waiting for in flight ios to flush. - Fix reporting of NFS file handle length - Fix early error path in bch2_fs_alloc() - list head wasn't being initialized early enough - Make sure correct (hardware accelerated) crc modules get loaded - Fix a rare overflow in the btree split path, when the packed bkey format grows and all the keys have no value (LRU btree). - Fix error handling in the sector allocator This was causing writes to spuriously fail in multidevice setups, and another bug meant that the errors weren't being logged, only reported via fsync. * tag 'bcachefs-2023-12-19' of https://evilpiepirate.org/git/bcachefs: bcachefs: Fix bch2_alloc_sectors_start_trans() error handling bcachefs; guard against overflow in btree node split bcachefs: btree_node_u64s_with_format() takes nr keys bcachefs: print explicit recovery pass message only once bcachefs: improve modprobe support by providing softdeps bcachefs: fix invalid memory access in bch2_fs_alloc() error path bcachefs: Fix determining required file handle length bcachefs: Fix nocow locks deadlock commit ac1c13e257c798510a60559c2cd50f1828f89c4e Merge: 0a7a93d96d124 bd018b98ba84c Author: Linus Torvalds Date: Wed Dec 20 11:16:50 2023 -0800 Merge tag 'nfsd-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: - Address a few recently-introduced issues * tag 'nfsd-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: SUNRPC: Revert 5f7fc5d69f6e92ec0b38774c387f5cf7812c5806 NFSD: Revert 738401a9bd1ac34ccd5723d69640a4adbb1a4bc0 NFSD: Revert 6c41d9a9bd0298002805758216a9c44e38a8500d nfsd: hold nfsd_mutex across entire netlink operation nfsd: call nfsd_last_thread() before final nfsd_put() commit 0a7a93d96d124bf252430090b15feb4239bcf752 Merge: 55cb5f43689d7 5d6f447b07d54 Author: Linus Torvalds Date: Wed Dec 20 11:01:28 2023 -0800 Merge tag 'dm-6.7/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: - DM raid target (and MD raid) fix for reconfig_mutex MD deadlock that should have been merged along with recent v6.7-rc6 MD fixes (see MD related commits: f2d87a759f68^..b39113349de6) - DM integrity target fix to avoid modifying immutable biovec in the integrity_metadata() edge case where kmalloc fails. - Fix drivers/md/Kconfig so DM_AUDIT depends on BLK_DEV_DM. - Update DM entry in MAINTAINERS to remove stale info. * tag 'dm-6.7/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: MAINTAINERS: remove stale info for DEVICE-MAPPER dm audit: fix Kconfig so DM_AUDIT depends on BLK_DEV_DM dm-integrity: don't modify bio's immutable bio_vec in integrity_metadata() dm-raid: delay flushing event_work() after reconfig_mutex is released commit 7beb82b7d590e51f698b1cf590b0e2785db1c498 Author: Randy Dunlap Date: Tue Dec 19 22:12:26 2023 -0800 tracing/synthetic: fix kernel-doc warnings scripts/kernel-doc warns about using @args: for variadic arguments to functions. Documentation/doc-guide/kernel-doc.rst says that this should be written as @...: instead, so update the source code to match that, preventing the warnings. trace_events_synth.c:1165: warning: Excess function parameter 'args' description in '__synth_event_gen_cmd_start' trace_events_synth.c:1714: warning: Excess function parameter 'args' description in 'synth_event_trace' Link: https://lore.kernel.org/linux-trace-kernel/20231220061226.30962-1-rdunlap@infradead.org Cc: Mathieu Desnoyers Fixes: 35ca5207c2d11 ("tracing: Add synthetic event command generation functions") Fixes: 8dcc53ad956d2 ("tracing: Add synth_event_trace() and related functions") Acked-by: Masami Hiramatsu (Google) Signed-off-by: Randy Dunlap Signed-off-by: Steven Rostedt (Google) commit fa3d6c7183106a187a8d399216db3f088a6aab81 Author: Macpaul Lin Date: Fri Dec 15 15:32:52 2023 +0800 arm64: dts: mediatek: mt8395-genio-1200-evk: add interrupt-parent for mt6360 This patch fix the warning introduced by mt6360 node in mt8395-genio-1200-evk.dts. arch/arm64/boot/dts/mediatek/mt8195.dtsi:464.4-27: Warning (interrupts_property): /soc/i2c@11d01000/pmic@34:#interrupt-cells: size is (8), expected multiple of 16 Add a missing 'interrupt-parent' to fix this warning. Fixes: f2b543a191b6 ("arm64: dts: mediatek: add device-tree for Genio 1200 EVK board") Reported-by: Arnd Bergmann Link: https://lore.kernel.org/linux-devicetree/20231212214737.230115-1-arnd@kernel.org/ Signed-off-by: Macpaul Lin Signed-off-by: Arnd Bergmann commit 7315dc1e122c85ffdfc8defffbb8f8b616c2eb1a Author: Pablo Neira Ayuso Date: Tue Dec 19 19:44:49 2023 +0100 netfilter: nf_tables: skip set commit for deleted/destroyed sets NFT_MSG_DELSET deactivates all elements in the set, skip set->ops->commit() to avoid the unnecessary clone (for the pipapo case) as well as the sync GC cycle, which could deactivate again expired elements in such set. Fixes: 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane") Reported-by: Kevin Rich Signed-off-by: Pablo Neira Ayuso commit 11f9eb899ecc8c02b769cf8d2532ba12786a7af7 Author: Jocelyn Falempe Date: Thu Dec 14 17:38:06 2023 +0100 drm/mgag200: Fix gamma lut not initialized for G200ER, G200EV, G200SE When mgag200 switched from simple KMS to regular atomic helpers, the initialization of the gamma settings was lost. This leads to a black screen, if the bios/uefi doesn't use the same pixel color depth. This has been fixed with commit ad81e23426a6 ("drm/mgag200: Fix gamma lut not initialized.") for most G200, but G200ER, G200EV, G200SE use their own version of crtc_helper_atomic_enable() and need to be fixed too. Fixes: 1baf9127c482 ("drm/mgag200: Replace simple-KMS with regular atomic helpers") Cc: #v6.1+ Reported-by: Roger Sewell Suggested-by: Roger Sewell Signed-off-by: Jocelyn Falempe Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20231214163849.359691-1-jfalempe@redhat.com commit 02350805eeb9b8d0d4587e2ccf0ecc305bfacc4f Merge: 2096d3ec469f9 9b6a51aab5f5f Author: Arnd Bergmann Date: Wed Dec 20 12:04:38 2023 +0000 Merge tag 'am3-usb-hang-fix-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes Fix for occasional boot hang for am335x USB A fix for occasional boot hang for am335x USB that I've only recently started noticing. This can be merged naturally whenever suitable. This issue has been seen with other similar SoCs earlier and has clearly existed for a long time. * tag 'am3-usb-hang-fix-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: Fix occasional boot hang for am3 usb Link: https://lore.kernel.org/r/pull-1703071616-395333@atomide.com Signed-off-by: Arnd Bergmann commit 2096d3ec469f9b7ed1a369da6c4f27cc3ea1aff8 Merge: d73ad797c83b0 c72b9c33ef969 Author: Arnd Bergmann Date: Wed Dec 20 12:02:25 2023 +0000 Merge tag 'omap-for-v6.7/fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes Fixes for omaps A few fixes for omaps: - A regression fix for ti-sysc interconnect target module driver to not access registers after reset if srst_udelay quirk is needed - DRA7 L3 NoC node register size fix * tag 'omap-for-v6.7/fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP2+: Fix null pointer dereference and memory leak in omap_soc_device_init ARM: dts: dra7: Fix DRA7 L3 NoC node register size bus: ti-sysc: Flush posted write only after srst_udelay Link: https://lore.kernel.org/r/pull-1702037799-781982@atomide.com Signed-off-by: Arnd Bergmann commit 94c71705cc49092cef60ece13a28680809096fd4 Author: Patrick Rudolph Date: Tue Dec 19 13:51:18 2023 +0100 pinctrl: cy8c95x0: Fix get_pincfg Invert the register value for PIN_CONFIG_OUTPUT_ENABLE to return the opposite of PIN_CONFIG_INPUT_ENABLE. Signed-off-by: Patrick Rudolph Link: https://lore.kernel.org/r/20231219125120.4028862-3-patrick.rudolph@9elements.com Signed-off-by: Linus Walleij commit 04dfca968cf7349773126340991b68a83378aca2 Author: Patrick Rudolph Date: Tue Dec 19 13:51:17 2023 +0100 pinctrl: cy8c95x0: Fix regression Commit 1fa3df901f2c ("pinctrl: cy8c95x0: Remove custom ->set_config()") removed support for PIN_CONFIG_INPUT_ENABLE and PIN_CONFIG_OUTPUT. Add the following options to restore functionality: - PIN_CONFIG_INPUT_ENABLE - PIN_CONFIG_OUTPUT_ENABLE Signed-off-by: Patrick Rudolph Link: https://lore.kernel.org/r/20231219125120.4028862-2-patrick.rudolph@9elements.com Signed-off-by: Linus Walleij commit 47b1fa48116238208c1b1198dba10f56fc1b6eb2 Author: Patrick Rudolph Date: Tue Dec 19 13:51:16 2023 +0100 pinctrl: cy8c95x0: Fix typo Fix typo to make pinctrl-cy8c95x compile again. Signed-off-by: Patrick Rudolph Link: https://lore.kernel.org/r/20231219125120.4028862-1-patrick.rudolph@9elements.com Signed-off-by: Linus Walleij commit 74cef6872ceaefb5b6c5c60641371ea28702d358 Author: David Howells Date: Mon Dec 11 15:15:02 2023 +0000 afs: Fix dynamic root lookup DNS check In the afs dynamic root directory, the ->lookup() function does a DNS check on the cell being asked for and if the DNS upcall reports an error it will report an error back to userspace (typically ENOENT). However, if a failed DNS upcall returns a new-style result, it will return a valid result, with the status field set appropriately to indicate the type of failure - and in that case, dns_query() doesn't return an error and we let stat() complete with no error - which can cause confusion in userspace as subsequent calls that trigger d_automount then fail with ENOENT. Fix this by checking the status result from a valid dns_query() and returning an error if it indicates a failure. Fixes: bbb4c4323a4d ("dns: Allow the dns resolver to retrieve a server set") Reported-by: Markus Suvanto Closes: https://bugzilla.kernel.org/show_bug.cgi?id=216637 Signed-off-by: David Howells Tested-by: Markus Suvanto cc: Marc Dionne cc: linux-afs@lists.infradead.org commit 71f8b55bc30e82d6355e07811213d847981a32e2 Author: David Howells Date: Mon Dec 11 15:08:57 2023 +0000 afs: Fix the dynamic root's d_delete to always delete unused dentries Fix the afs dynamic root's d_delete function to always delete unused dentries rather than only deleting them if they're positive. With things as they stand upstream, negative dentries stemming from failed DNS lookups stick around preventing retries. Fixes: 66c7e1d319a5 ("afs: Split the dynroot stuff out and give it its own ops tables") Signed-off-by: David Howells Tested-by: Markus Suvanto cc: Marc Dionne cc: linux-afs@lists.infradead.org commit bd7f77dae69532ffc027ee50ff99e3792dc30b7f Author: Lai Peter Jun Ann Date: Mon Dec 18 15:51:32 2023 +0800 net: stmmac: fix incorrect flag check in timestamp interrupt The driver should continue get the timestamp if STMMAC_FLAG_EXT_SNAPSHOT_EN flag is set. Fixes: aa5513f5d95f ("net: stmmac: replace the ext_snapshot_en field with a flag") Cc: # 6.6 Signed-off-by: Song Yoong Siang Signed-off-by: Lai Peter Jun Ann Reviewed-by: Jacob Keller Reviewed-by: Serge Semin Signed-off-by: David S. Miller commit 498444e390b48134e550c9d65b5a1b1f56745acd Merge: 8353c2abc02cf 2e07e8348ea45 Author: David S. Miller Date: Wed Dec 20 11:12:12 2023 +0000 Merge tag 'for-net-2023-12-15' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - Add encryption key size check when acting as peripheral - Shut up false-positive build warning - Send reject if L2CAP command request is corrupted - Fix Use-After-Free in bt_sock_recvmsg - Fix not notifying when connection encryption changes - Fix not checking if HCI_OP_INQUIRY has been sent - Fix address type send over to the MGMT interface - Fix deadlock in vhci_send_frame ==================== Signed-off-by: David S. Miller commit 0ae8e4cca78781401b17721bfb72718fdf7b4912 Author: Pablo Neira Ayuso Date: Thu Dec 14 11:50:12 2023 +0100 netfilter: nf_tables: set transport offset from mac header for netdev/egress Before this patch, transport offset (pkt->thoff) provides an offset relative to the network header. This is fine for the inet families because skb->data points to the network header in such case. However, from netdev/egress, skb->data points to the mac header (if available), thus, pkt->thoff is missing the mac header length. Add skb_network_offset() to the transport offset (pkt->thoff) for netdev, so transport header mangling works as expected. Adjust payload fast eval function to use skb->data now that pkt->thoff provides an absolute offset. This explains why users report that matching on egress/netdev works but payload mangling does not. This patch implicitly fixes payload mangling for IPv4 packets in netdev/egress given skb_store_bits() requires an offset from skb->data to reach the transport header. I suspect that nft_exthdr and the trace infra were also broken from netdev/egress because they also take skb->data as start, and pkt->thoff was not correct. Note that IPv6 is fine because ipv6_find_hdr() already provides a transport offset starting from skb->data, which includes skb_network_offset(). The bridge family also uses nft_set_pktinfo_ipv4_validate(), but there skb_network_offset() is zero, so the update in this patch does not alter the existing behaviour. Fixes: 42df6e1d221d ("netfilter: Introduce egress hook") Signed-off-by: Pablo Neira Ayuso commit b0c279ff6cc97a34d8caaf28381e72bb111b5e16 Author: Kent Overstreet Date: Wed Dec 13 00:44:34 2023 -0500 bcachefs: fix BCH_FSCK_ERR enum Signed-off-by: Kent Overstreet commit 247ce5f1bb3ea90879e8552b8edf4885b9a9f849 Author: Kent Overstreet Date: Tue Dec 19 17:16:34 2023 -0500 bcachefs: Fix bch2_alloc_sectors_start_trans() error handling When we fail to allocate because of insufficient open buckets, we don't want to retry from the full set of devices - we just want to retry in blocking mode. But if the retry in blocking mode fails with a different error code, we end up squashing the -BCH_ERR_open_buckets_empty error with an error that makes us thing we won't be able to allocate (insufficient_devices) - which is incorrect when we didn't try to allocate from the full set of devices, and causes the write to fail. Signed-off-by: Kent Overstreet commit 7ba1f6ec97c7afec5787ab8e92a6a7e24f0459aa Author: Kent Overstreet Date: Sun Dec 17 23:31:26 2023 -0500 bcachefs; guard against overflow in btree node split Signed-off-by: Kent Overstreet commit 0fa3b97767019be4556a8f081b742aaaabd2bd9e Author: Kent Overstreet Date: Sun Dec 17 23:20:59 2023 -0500 bcachefs: btree_node_u64s_with_format() takes nr keys Signed-off-by: Kent Overstreet commit b4cc1cbba5195a4dd497cf2f8f09e7807977d543 Author: Quan Nguyen Date: Mon Dec 11 17:22:16 2023 +0700 i2c: aspeed: Handle the coalesced stop conditions with the start conditions. Some masters may drive the transfers with low enough latency between the nak/stop phase of the current command and the start/address phase of the following command that the interrupts are coalesced by the time we process them. Handle the stop conditions before processing SLAVE_MATCH to fix the complaints that sometimes occur below. "aspeed-i2c-bus 1e78a040.i2c-bus: irq handled != irq. Expected 0x00000086, but was 0x00000084" Fixes: f9eb91350bb2 ("i2c: aspeed: added slave support for Aspeed I2C driver") Signed-off-by: Quan Nguyen Reviewed-by: Andrew Jeffery Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit f6fe0b2d35457c10ec37acc209d19726bdc16dbd Author: Maurizio Lombardi Date: Tue Dec 19 17:48:23 2023 +0100 nvme-pci: fix sleeping function called from interrupt context the nvme_handle_cqe() interrupt handler calls nvme_complete_async_event() but the latter may call nvme_auth_stop() which is a blocking function. Sleeping functions can't be called in interrupt context BUG: sleeping function called from invalid context in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/15 Call Trace: __cancel_work_timer+0x31e/0x460 ? nvme_change_ctrl_state+0xcf/0x3c0 [nvme_core] ? nvme_change_ctrl_state+0xcf/0x3c0 [nvme_core] nvme_complete_async_event+0x365/0x480 [nvme_core] nvme_poll_cq+0x262/0xe50 [nvme] Fix the bug by moving nvme_auth_stop() to fw_act_work (executed by the nvme_wq workqueue) Fixes: f50fff73d620 ("nvme: implement In-Band authentication") Signed-off-by: Maurizio Lombardi Reviewed-by: Jens Axboe Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 4a0057afa35872a5f2e65576785844688dd9fa5e Author: ZhenGuo Yin Date: Tue Dec 19 14:39:42 2023 +0800 drm/amdgpu: re-create idle bo's PTE during VM state machine reset Idle bo's PTE needs to be re-created when resetting VM state machine. Set idle bo's vm_bo as moved to mark it as invalid. Fixes: 55bf196f60df ("drm/amdgpu: reset VM when an error is detected") Signed-off-by: ZhenGuo Yin Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 55cb5f43689d7a9ea5bf35ef050f12334f197347 Merge: 9c749e61a1104 b803d7c664d55 Author: Linus Torvalds Date: Tue Dec 19 12:25:43 2023 -0800 Merge tag 'trace-v6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fix from Steven Rostedt: "While working on the ring buffer, I found one more bug with the timestamp code, and the fix for this removed the need for the final 64-bit cmpxchg! The ring buffer events hold a "delta" from the previous event. If it is determined that the delta can not be calculated, it falls back to adding an absolute timestamp value. The way to know if the delta can be used is via two stored timestamps in the per-cpu buffer meta data: before_stamp and write_stamp The before_stamp is written by every event before it tries to allocate its space on the ring buffer. The write_stamp is written after it allocates its space and knows that nothing came in after it read the previous before_stamp and write_stamp and the two matched. A previous fix dd9394257078 ("ring-buffer: Do not try to put back write_stamp") removed putting back the write_stamp to match the before_stamp so that the next event could use the delta, but races were found where the two would match, but not be for of the previous event. It was determined to allow the event reservation to not have a valid write_stamp when it is finished, and this fixed a lot of races. The last use of the 64-bit timestamp cmpxchg depended on the write_stamp being valid after an interruption. But this is no longer the case, as if an event is interrupted by a softirq that writes an event, and that event gets interrupted by a hardirq or NMI and that writes an event, then the softirq could finish its reservation without a valid write_stamp. In the slow path of the event reservation, a delta can still be used if the write_stamp is valid. Instead of using a cmpxchg against the write stamp, the before_stamp needs to be read again to validate the write_stamp. The cmpxchg is not needed. This updates the slowpath to validate the write_stamp by comparing it to the before_stamp and removes all rb_time_cmpxchg() as there are no more users of that function. The removal of the 32-bit updates of rb_time_t will be done in the next merge window" * tag 'trace-v6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: ring-buffer: Fix slowpath of interrupted event commit 81b9aeb7b995f3870d691ec5ea95518d5b169203 Author: Josip Pavic Date: Tue Dec 5 16:57:27 2023 -0500 drm/amd/display: dereference variable before checking for zero [Why] Driver incorrectly checks if pointer variable OutBpp is null instead of if the value being pointed to is zero. [How] Dereference OutBpp before checking for a value of zero. Reviewed-by: Chaitanya Dhere Acked-by: Wayne Lin Signed-off-by: Josip Pavic Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 51e7b64690776a9981355428b537af9048308a95 Author: Charlene Liu Date: Wed Dec 6 17:14:48 2023 -0500 drm/amd/display: get dprefclk ss info from integration info table [why & how] we have two SSC_En: we get ssc_info from dce_info for MPLL_SSC_EN. we used to call VBIOS cmdtbl's smu_info's SS persentage for DPRECLK SS info, is used for DP AUDIO and VBIOS' smu_info table was from systemIntegrationInfoTable. since dcn35 VBIOS removed smu_info, driver need to use integrationInfotable directly. Reviewed-by: Nicholas Kazlauskas Acked-by: Wayne Lin Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 989824589f793120833bef13aa4e21f5a836a707 Author: Wayne Lin Date: Tue Dec 5 14:55:31 2023 +0800 drm/amd/display: Add case for dcn35 to support usb4 dmub hpd event [Why & how] Refactor dc_is_dmub_outbox_supported() a bit and add case for dcn35 to register dmub outbox notification irq to handle usb4 relevant hpd event. Reviewed-by: Roman Li Reviewed-by: Jun Lei Signed-off-by: Wayne Lin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3248211dd971ed2b614307eb42cecee3e6feecff Author: Hamza Mahfooz Date: Fri Dec 15 10:37:39 2023 -0500 drm/amd/display: disable FPO and SubVP for older DMUB versions on DCN32x There have recently been changes that break backwards compatibility, that were introduced into DMUB firmware (for DCN32x) concerning FPO and SubVP. So, since those are just power optimization features, we can just disable them unless the user is using a new enough version of DMUB firmware. Cc: stable@vger.kernel.org Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2870 Fixes: ed6e2782e974 ("drm/amd/display: For cursor P-State allow for SubVP") Reported-by: Mikhail Gavrilov Closes: https://lore.kernel.org/r/CABXGCsNRb0QbF2pKLJMDhVOKxyGD6-E+8p-4QO6FOWa6zp22_A@mail.gmail.com/ Reviewed-by: Harry Wentland Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit ebab8c3eb6a6515dc14cd93fc29dd287709da6d3 Author: Philip Yang Date: Thu Dec 14 09:42:03 2023 -0500 drm/amdkfd: svm range always mapped flag not working on APU On gfx943 APU there is no VRAM and page migration, queue CWSR area, svm range with always mapped flag, is not mapped to GPU correctly. This works fine if retry fault on CWSR area can be recovered, but could cause deadlock if there is another retry fault recover waiting for CWSR to finish. Fix this by mapping svm range with always mapped flag to GPU with ACCESS attribute if XNACK ON. There is side effect, because all GPUs have ACCESS attribute by default on new svm range with XNACK on, the CWSR area will be mapped to all GPUs after this change. This side effect will be fixed with Thunk change to set CWSR svm range with ACCESS_IN_PLACE attribute on the GPU that user queue is created. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9c749e61a1104ba9cf00519e723a7fa8ac55db0d Merge: 3f10e214a9de7 9a733dc4fbeec Author: Linus Torvalds Date: Tue Dec 19 12:19:25 2023 -0800 Merge tag 'arc-6.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Pull ARC fixes from Vineet Gupta: - build error for hugetlb, sparse and smatch fixes - removal of VIPT aliasing cache code * tag 'arc-6.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: add hugetlb definitions ARC: fix smatch warning ARC: fix spare error ARC: mm: retire support for aliasing VIPT D$ ARC: entry: move ARCompact specific bits out of entry.h ARC: entry: SAVE_ABI_CALLEE_REG: ISA/ABI specific helper commit 9dda0c07f00f511c112af135aa1ee349345037fa Author: Alvin Lee Date: Mon Dec 4 15:19:34 2023 -0500 drm/amd/display: Revert " drm/amd/display: Use channel_width = 2 for vram table 3.0" [Description] Revert commit fec05adc40c2 ("drm/amd/display: Use channel_width = 2 for vram table 3.0") Because the issue is being fixed from VBIOS side. Reviewed-by: Samson Tam Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 19cde9c92b8d3b7ee555d0da3bcb0232d3a784f4 Author: Jensen Huang Date: Thu Dec 7 16:21:59 2023 +0800 i2c: rk3x: fix potential spinlock recursion on poll Possible deadlock scenario (on reboot): rk3x_i2c_xfer_common(polling) -> rk3x_i2c_wait_xfer_poll() -> rk3x_i2c_irq(0, i2c); --> spin_lock(&i2c->lock); ... -> rk3x_i2c_irq(0, i2c); --> spin_lock(&i2c->lock); (deadlock here) Store the IRQ number and disable/enable it around the polling transfer. This patch has been tested on NanoPC-T4. Signed-off-by: Jensen Huang Reviewed-by: Heiko Stuebner Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 043465b66506e8c647cdd38a2db1f2ee0f369a1b Author: Yang Yingliang Date: Thu Nov 30 09:43:24 2023 +0800 i2c: qcom-geni: fix missing clk_disable_unprepare() and geni_se_resources_off() Add missing clk_disable_unprepare() and geni_se_resources_off() in the error path in geni_i2c_probe(). Fixes: 14d02fbadb5d ("i2c: qcom-geni: add desc struct to prepare support for I2C Master Hub variant") Signed-off-by: Yang Yingliang Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 12d1e301bdfd1f2e2f371432dedef7cce8f01c4a Author: Shyam Prasad N Date: Fri Dec 15 17:16:56 2023 +0000 cifs: do not let cifs_chan_update_iface deallocate channels cifs_chan_update_iface is meant to check and update the server interface used for a channel when the existing server interface is no longer available. So far, this handler had the code to remove an interface entry even if a new candidate interface is not available. Allowing this leads to several corner cases to handle. This change makes the logic much simpler by not deallocating the current channel interface entry if a new interface is not found to replace it with. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit f30bbc38704e279c06d073ecb18fea376791ecab Author: Shyam Prasad N Date: Fri Dec 15 17:16:55 2023 +0000 cifs: fix a pending undercount of srv_count The following commit reverted the changes to ref count the server struct while scheduling a reconnect work: 823342524868 Revert "cifs: reconnect work should have reference on server struct" However, a following change also introduced scheduling of reconnect work, and assumed ref counting. This change fixes that as well. Fixes umount problems like: [73496.157838] CPU: 5 PID: 1321389 Comm: umount Tainted: G W OE 6.7.0-060700rc6-generic #202312172332 [73496.157841] Hardware name: LENOVO 20MAS08500/20MAS08500, BIOS N2CET67W (1.50 ) 12/15/2022 [73496.157843] RIP: 0010:cifs_put_tcp_session+0x17d/0x190 [cifs] [73496.157906] Code: 5d 31 c0 31 d2 31 f6 31 ff c3 cc cc cc cc e8 4a 6e 14 e6 e9 f6 fe ff ff be 03 00 00 00 48 89 d7 e8 78 26 b3 e5 e9 e4 fe ff ff <0f> 0b e9 b1 fe ff ff 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 [73496.157908] RSP: 0018:ffffc90003bcbcb8 EFLAGS: 00010286 [73496.157911] RAX: 00000000ffffffff RBX: ffff8885830fa800 RCX: 0000000000000000 [73496.157913] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [73496.157915] RBP: ffffc90003bcbcc8 R08: 0000000000000000 R09: 0000000000000000 [73496.157917] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [73496.157918] R13: ffff8887d56ba800 R14: 00000000ffffffff R15: ffff8885830fa800 [73496.157920] FS: 00007f1ff0e33800(0000) GS:ffff88887ba80000(0000) knlGS:0000000000000000 [73496.157922] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [73496.157924] CR2: 0000115f002e2010 CR3: 00000003d1e24005 CR4: 00000000003706f0 [73496.157926] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [73496.157928] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [73496.157929] Call Trace: [73496.157931] [73496.157933] ? show_regs+0x6d/0x80 [73496.157936] ? __warn+0x89/0x160 [73496.157939] ? cifs_put_tcp_session+0x17d/0x190 [cifs] [73496.157976] ? report_bug+0x17e/0x1b0 [73496.157980] ? handle_bug+0x51/0xa0 [73496.157983] ? exc_invalid_op+0x18/0x80 [73496.157985] ? asm_exc_invalid_op+0x1b/0x20 [73496.157989] ? cifs_put_tcp_session+0x17d/0x190 [cifs] [73496.158023] ? cifs_put_tcp_session+0x1e/0x190 [cifs] [73496.158057] __cifs_put_smb_ses+0x2b5/0x540 [cifs] [73496.158090] ? tconInfoFree+0xc2/0x120 [cifs] [73496.158130] cifs_put_tcon.part.0+0x108/0x2b0 [cifs] [73496.158173] cifs_put_tlink+0x49/0x90 [cifs] [73496.158220] cifs_umount+0x56/0xb0 [cifs] [73496.158258] cifs_kill_sb+0x52/0x60 [cifs] [73496.158306] deactivate_locked_super+0x32/0xc0 [73496.158309] deactivate_super+0x46/0x60 [73496.158311] cleanup_mnt+0xc3/0x170 [73496.158314] __cleanup_mnt+0x12/0x20 [73496.158330] task_work_run+0x5e/0xa0 [73496.158333] exit_to_user_mode_loop+0x105/0x130 [73496.158336] exit_to_user_mode_prepare+0xa5/0xb0 [73496.158338] syscall_exit_to_user_mode+0x29/0x60 [73496.158341] do_syscall_64+0x6c/0xf0 [73496.158344] ? syscall_exit_to_user_mode+0x37/0x60 [73496.158346] ? do_syscall_64+0x6c/0xf0 [73496.158349] ? exit_to_user_mode_prepare+0x30/0xb0 [73496.158353] ? syscall_exit_to_user_mode+0x37/0x60 [73496.158355] ? do_syscall_64+0x6c/0xf0 Reported-by: Robert Morris Fixes: 705fc522fe9d ("cifs: handle when server starts supporting multichannel") Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit d3e8b1858734bf46cda495be4165787b9a3981a6 Author: Keith Busch Date: Mon Dec 18 08:19:39 2023 -0800 Revert "nvme-fc: fix race between error recovery and creating association" The commit was identified to might sleep in invalid context and is blocking regression testing. This reverts commit ee6fdc5055e916b1dd497f11260d4901c4c1e55e. Link: https://lore.kernel.org/linux-nvme/hkhl56n665uvc6t5d6h3wtx7utkcorw4xlwi7d2t2bnonavhe6@xaan6pu43ap6/ Link: https://lists.infradead.org/pipermail/linux-nvme/2023-December/043756.html Reported-by: Daniel Wagner Reported-by: Maurizio Lombardi Cc: Michael Liang Tested-by: Daniel Wagner Reviewed-by: Daniel Wagner Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 3d940bb1818325142e6764bff788cbf95b9afb54 Author: Heiko Carstens Date: Thu Dec 7 15:24:34 2023 +0100 s390: update defconfigs Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 01fe654f78fd1ea4df046ef76b07ba92a35f8dbe Author: Zizhi Wo Date: Wed Dec 13 10:23:53 2023 +0800 fs: cifs: Fix atime update check Commit 9b9c5bea0b96 ("cifs: do not return atime less than mtime") indicates that in cifs, if atime is less than mtime, some apps will break. Therefore, it introduce a function to compare this two variables in two places where atime is updated. If atime is less than mtime, update it to mtime. However, the patch was handled incorrectly, resulting in atime and mtime being exactly equal. A previous commit 69738cfdfa70 ("fs: cifs: Fix atime update check vs mtime") fixed one place and forgot to fix another. Fix it. Fixes: 9b9c5bea0b96 ("cifs: do not return atime less than mtime") Cc: stable@vger.kernel.org Signed-off-by: Zizhi Wo Signed-off-by: Steve French commit 567320c46a60a3c39b69aa1df802d753817a3f86 Author: Paulo Alcantara Date: Tue Dec 19 13:10:31 2023 -0300 smb: client: fix potential OOB in smb2_dump_detail() Validate SMB message with ->check_message() before calling ->calc_smb_size(). This fixes CVE-2023-6610. Reported-by: j51569436@gmail.com Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218219 Cc; stable@vger.kernel.org Signed-off-by: Paulo Alcantara Signed-off-by: Steve French commit 35ba6bd582cf926a082296b7e9a876ec81136cb1 Author: Douglas Anderson Date: Mon Dec 18 09:04:54 2023 -0800 drm/bridge: ps8640: Fix size mismatch warning w/ len After commit 26195af57798 ("drm/bridge: ps8640: Drop the ability of ps8640 to fetch the EDID"), I got an error compiling: error: comparison of distinct pointer types ('typeof (len) *' (aka 'unsigned int *') and 'typeof (msg->size) *' (aka 'unsigned long *')) [-Werror,-Wcompare-distinct-pointer-types] Fix it by declaring the `len` as size_t. The above error only shows up on downstream kernels without commit d03eba99f5bf ("minmax: allow min()/max()/clamp() if the arguments have the same signedness."), but since commit 26195af57798 ("drm/bridge: ps8640: Drop the ability of ps8640 to fetch the EDID") is a "Fix" that will likely be backported it seems nice to make it easy. ...plus it's more correct to declare `len` as size_t anyway. Fixes: 26195af57798 ("drm/bridge: ps8640: Drop the ability of ps8640 to fetch the EDID") Reviewed-by: Stephen Boyd Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20231218090454.1.I5c6eb80b2f746439c4b58efab788e00701d08759@changeid commit 8f0f01647550daf9cd8752c1656dcb0136d79ce1 Author: Shengjiu Wang Date: Tue Dec 19 10:30:57 2023 +0800 ASoC: fsl_sai: Fix channel swap issue on i.MX8MP When flag mclk_with_tere and mclk_direction_output enabled, The SAI transmitter or receiver will be enabled in very early stage, that if FSL_SAI_xMR is set by previous case, for example previous case is one channel, current case is two channels, then current case started with wrong xMR in the beginning, then channel swap happen. The patch is to clear xMR in hw_free() to avoid such channel swap issue. Fixes: 3e4a82612998 ("ASoC: fsl_sai: MCLK bind with TX/RX enable bit") Signed-off-by: Shengjiu Wang Reviewed-by: Daniel Baluta Link: https://msgid.link/r/1702953057-4499-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 025222a9d6d25eee2ad9a1bb5a8b29b34b5ba576 Author: Jerome Brunet Date: Mon Dec 18 15:56:52 2023 +0100 ASoC: hdmi-codec: fix missing report for jack initial status This fixes a problem introduced while fixing ELD reporting with no jack set. Most driver using the hdmi-codec will call the 'plugged_cb' callback directly when registered to report the initial state of the HDMI connector. With the commit mentionned, this occurs before jack is ready and the initial report is lost for platforms actually providing a jack for HDMI. Fix this by storing the hdmi connector status regardless of jack being set or not and report the last status when jack gets set. With this, the initial state is reported correctly even if it is disconnected. This was not done initially and is also a fix. Fixes: 15be353d55f9 ("ASoC: hdmi-codec: register hpd callback on component probe") Reported-by: Zhengqiao Xia Closes: https://lore.kernel.org/alsa-devel/CADYyEwTNyY+fR9SgfDa-g6iiDwkU3MUdPVCYexs2_3wbcM8_vg@mail.gmail.com/ Cc: Hsin-Yi Wang Tested-by: Zhengqiao Xia Signed-off-by: Jerome Brunet Link: https://msgid.link/r/20231218145655.134929-1-jbrunet@baylibre.com Signed-off-by: Mark Brown commit 8353c2abc02cf8302d5e6177b706c1879e7b833c Merge: fa94a0c8424a5 2258b666482d3 Author: Paolo Abeni Date: Tue Dec 19 13:13:59 2023 +0100 Merge branch 'check-vlan-filter-feature-in-vlan_vids_add_by_dev-and-vlan_vids_del_by_dev' Liu Jian says: ==================== check vlan filter feature in vlan_vids_add_by_dev() and vlan_vids_del_by_dev() v2->v3: Filter using vlan_hw_filter_capable(). Add one basic test. ==================== Link: https://lore.kernel.org/r/20231216075219.2379123-1-liujian56@huawei.com Signed-off-by: Paolo Abeni commit 2258b666482d3326aec8b72ec3e009a2aad9582c Author: Liu Jian Date: Sat Dec 16 15:52:19 2023 +0800 selftests: add vlan hw filter tests Add one basic vlan hw filter test. Signed-off-by: Liu Jian Reviewed-by: Hangbin Liu Signed-off-by: Paolo Abeni commit 01a564bab4876007ce35f312e16797dfe40e4823 Author: Liu Jian Date: Sat Dec 16 15:52:18 2023 +0800 net: check vlan filter feature in vlan_vids_add_by_dev() and vlan_vids_del_by_dev() I got the below warning trace: WARNING: CPU: 4 PID: 4056 at net/core/dev.c:11066 unregister_netdevice_many_notify CPU: 4 PID: 4056 Comm: ip Not tainted 6.7.0-rc4+ #15 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014 RIP: 0010:unregister_netdevice_many_notify+0x9a4/0x9b0 Call Trace: rtnl_dellink rtnetlink_rcv_msg netlink_rcv_skb netlink_unicast netlink_sendmsg __sock_sendmsg ____sys_sendmsg ___sys_sendmsg __sys_sendmsg do_syscall_64 entry_SYSCALL_64_after_hwframe It can be repoduced via: ip netns add ns1 ip netns exec ns1 ip link add bond0 type bond mode 0 ip netns exec ns1 ip link add bond_slave_1 type veth peer veth2 ip netns exec ns1 ip link set bond_slave_1 master bond0 [1] ip netns exec ns1 ethtool -K bond0 rx-vlan-filter off [2] ip netns exec ns1 ip link add link bond_slave_1 name bond_slave_1.0 type vlan id 0 [3] ip netns exec ns1 ip link add link bond0 name bond0.0 type vlan id 0 [4] ip netns exec ns1 ip link set bond_slave_1 nomaster [5] ip netns exec ns1 ip link del veth2 ip netns del ns1 This is all caused by command [1] turning off the rx-vlan-filter function of bond0. The reason is the same as commit 01f4fd270870 ("bonding: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves"). Commands [2] [3] add the same vid to slave and master respectively, causing command [4] to empty slave->vlan_info. The following command [5] triggers this problem. To fix this problem, we should add VLAN_FILTER feature checks in vlan_vids_add_by_dev() and vlan_vids_del_by_dev() to prevent incorrect addition or deletion of vlan_vid information. Fixes: 348a1443cc43 ("vlan: introduce functions to do mass addition/deletion of vids by another device") Signed-off-by: Liu Jian Signed-off-by: Paolo Abeni commit 0a3d898ee9a8303d5b3982b97ef0703919c3ea76 Author: Benjamin Berg Date: Wed Dec 20 04:38:01 2023 +0200 wifi: mac80211: add/remove driver debugfs entries as appropriate When an interface is removed, we should also be deleting the driver debugfs entries (as it might still exist in DOWN state in mac80211). At the same time, when adding an interface, we can check the IEEE80211_SDATA_IN_DRIVER flag to know whether the interface was previously known to the driver and is simply being reconfigured. Fixes: a1f5dcb1c0c1 ("wifi: mac80211: add a driver callback to add vif debugfs") Signed-off-by: Benjamin Berg Reviewed-by: Gregory Greenman Signed-off-by: Miri Korenblit Link: https://msgid.link/20231220043149.a9f64c359424.I7076526b5297ae8f832228079c999f7b8e147a4c@changeid Signed-off-by: Johannes Berg commit 8c917f16eb6198073ff8bc5d5c83a1bef9fae813 Author: Benjamin Berg Date: Wed Dec 20 04:38:00 2023 +0200 wifi: mac80211: do not re-add debugfs entries during resume The driver debugfs entries still exist when the interface is re-added during reconfiguration. This can be either because of a HW restart (in_reconfig) or because we are resuming. Fixes: a1f5dcb1c0c1 ("wifi: mac80211: add a driver callback to add vif debugfs") Signed-off-by: Benjamin Berg Reviewed-by: Gregory Greenman Signed-off-by: Miri Korenblit Link: https://msgid.link/20231220043149.ddd48c66ec6b.Ia81080d92129ceecf462eceb4966bab80df12060@changeid Signed-off-by: Johannes Berg commit fa94a0c8424a5e1bd184bf1f05fbcd5914ce283d Author: Jijie Shao Date: Sat Dec 16 15:04:13 2023 +0800 net: hns3: add new maintainer for the HNS3 ethernet driver Jijie Shao will be responsible for maintaining the hns3 driver's code in the future, so add Jijie to the hns3 driver's matainer list. Signed-off-by: Jijie Shao Link: https://lore.kernel.org/r/20231216070413.233668-1-shaojijie@huawei.com Signed-off-by: Paolo Abeni commit 340943fbff3d8faa44d2223ca04917df28786a07 Author: Yury Norov Date: Fri Dec 15 12:33:53 2023 -0800 net: mana: select PAGE_POOL Mana uses PAGE_POOL API. x86_64 defconfig doesn't select it: ld: vmlinux.o: in function `mana_create_page_pool.isra.0': mana_en.c:(.text+0x9ae36f): undefined reference to `page_pool_create' ld: vmlinux.o: in function `mana_get_rxfrag': mana_en.c:(.text+0x9afed1): undefined reference to `page_pool_alloc_pages' make[3]: *** [/home/yury/work/linux/scripts/Makefile.vmlinux:37: vmlinux] Error 1 make[2]: *** [/home/yury/work/linux/Makefile:1154: vmlinux] Error 2 make[1]: *** [/home/yury/work/linux/Makefile:234: __sub-make] Error 2 make[1]: Leaving directory '/home/yury/work/build-linux-x86_64' make: *** [Makefile:234: __sub-make] Error 2 So we need to select it explicitly. Signed-off-by: Yury Norov Reviewed-by: Simon Horman Tested-by: Simon Horman # build-tested Fixes: ca9c54d2 ("net: mana: Add a driver for Microsoft Azure Network Adapter") Link: https://lore.kernel.org/r/20231215203353.635379-1-yury.norov@gmail.com Signed-off-by: Paolo Abeni commit 3dc5d44545453de1de9c53cc529cc960a85933da Author: Ronald Wahl Date: Thu Dec 14 19:11:12 2023 +0100 net: ks8851: Fix TX stall caused by TX buffer overrun There is a bug in the ks8851 Ethernet driver that more data is written to the hardware TX buffer than actually available. This is caused by wrong accounting of the free TX buffer space. The driver maintains a tx_space variable that represents the TX buffer space that is deemed to be free. The ks8851_start_xmit_spi() function adds an SKB to a queue if tx_space is large enough and reduces tx_space by the amount of buffer space it will later need in the TX buffer and then schedules a work item. If there is not enough space then the TX queue is stopped. The worker function ks8851_tx_work() dequeues all the SKBs and writes the data into the hardware TX buffer. The last packet will trigger an interrupt after it was send. Here it is assumed that all data fits into the TX buffer. In the interrupt routine (which runs asynchronously because it is a threaded interrupt) tx_space is updated with the current value from the hardware. Also the TX queue is woken up again. Now it could happen that after data was sent to the hardware and before handling the TX interrupt new data is queued in ks8851_start_xmit_spi() when the TX buffer space had still some space left. When the interrupt is actually handled tx_space is updated from the hardware but now we already have new SKBs queued that have not been written to the hardware TX buffer yet. Since tx_space has been overwritten by the value from the hardware the space is not accounted for. Now we have more data queued then buffer space available in the hardware and ks8851_tx_work() will potentially overrun the hardware TX buffer. In many cases it will still work because often the buffer is written out fast enough so that no overrun occurs but for example if the peer throttles us via flow control then an overrun may happen. This can be fixed in different ways. The most simple way would be to set tx_space to 0 before writing data to the hardware TX buffer preventing the queuing of more SKBs until the TX interrupt has been handled. I have chosen a slightly more efficient (and still rather simple) way and track the amount of data that is already queued and not yet written to the hardware. When new SKBs are to be queued the already queued amount of data is honoured when checking free TX buffer space. I tested this with a setup of two linked KS8851 running iperf3 between the two in bidirectional mode. Before the fix I got a stall after some minutes. With the fix I saw now issues anymore after hours. Fixes: 3ba81f3ece3c ("net: Micrel KS8851 SPI network driver") Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Ben Dooks Cc: Tristram Ha Cc: netdev@vger.kernel.org Cc: stable@vger.kernel.org # 5.10+ Signed-off-by: Ronald Wahl Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231214181112.76052-1-rwahl@gmx.de Signed-off-by: Paolo Abeni commit d4005431673929a1259ad791db87408fcf85d2cc Author: Srinivas Pandruvada Date: Sun Dec 17 12:07:03 2023 -0800 Revert "iio: hid-sensor-als: Add light color temperature support" This reverts commit 5f05285df691b1e82108eead7165feae238c95ef. This commit assumes that every HID descriptor for ALS sensor has presence of usage id ID HID_USAGE_SENSOR_LIGHT_COLOR_TEMPERATURE. When the above usage id is absent, driver probe fails. This breaks ALS sensor functionality on many platforms. Till we have a good solution, revert this commit. Reported-by: Thomas Weißschuh Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218223 Signed-off-by: Srinivas Pandruvada Cc: Acked-by: Jonathan Cameron Link: https://lore.kernel.org/r/20231217200703.719876-3-srinivas.pandruvada@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit b9670ee2e975e1cb6751019d5dc5c193aecd8ba2 Author: Srinivas Pandruvada Date: Sun Dec 17 12:07:02 2023 -0800 Revert "iio: hid-sensor-als: Add light chromaticity support" This reverts commit ee3710f39f9d0ae5137a866138d005fe1ad18132. This commit assumes that every HID descriptor for ALS sensor has presence of usage id ID HID_USAGE_SENSOR_LIGHT_CHROMATICITY_X and HID_USAGE_SENSOR_LIGHT_CHROMATICITY_Y. When the above usage ids are absent, driver probe fails. This breaks ALS sensor functionality on many platforms. Till we have a good solution, revert this commit. Reported-by: Thomas Weißschuh Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218223 Signed-off-by: Srinivas Pandruvada Cc: Acked-by: Jonathan Cameron Link: https://lore.kernel.org/r/20231217200703.719876-2-srinivas.pandruvada@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit b803d7c664d55705831729d2f2e29c874bcd62ea Author: Steven Rostedt (Google) Date: Mon Dec 18 23:07:12 2023 -0500 ring-buffer: Fix slowpath of interrupted event To synchronize the timestamps with the ring buffer reservation, there are two timestamps that are saved in the buffer meta data. 1. before_stamp 2. write_stamp When the two are equal, the write_stamp is considered valid, as in, it may be used to calculate the delta of the next event as the write_stamp is the timestamp of the previous reserved event on the buffer. This is done by the following: /*A*/ w = current position on the ring buffer before = before_stamp after = write_stamp ts = read current timestamp if (before != after) { write_stamp is not valid, force adding an absolute timestamp. } /*B*/ before_stamp = ts /*C*/ write = local_add_return(event length, position on ring buffer) if (w == write - event length) { /* Nothing interrupted between A and C */ /*E*/ write_stamp = ts; delta = ts - after /* * If nothing interrupted again, * before_stamp == write_stamp and write_stamp * can be used to calculate the delta for * events that come in after this one. */ } else { /* * The slow path! * Was interrupted between A and C. */ This is the place that there's a bug. We currently have: after = write_stamp ts = read current timestamp /*F*/ if (write == current position on the ring buffer && after < ts && cmpxchg(write_stamp, after, ts)) { delta = ts - after; } else { delta = 0; } The assumption is that if the current position on the ring buffer hasn't moved between C and F, then it also was not interrupted, and that the last event written has a timestamp that matches the write_stamp. That is the write_stamp is valid. But this may not be the case: If a task context event was interrupted by softirq between B and C. And the softirq wrote an event that got interrupted by a hard irq between C and E. and the hard irq wrote an event (does not need to be interrupted) We have: /*B*/ before_stamp = ts of normal context ---> interrupted by softirq /*B*/ before_stamp = ts of softirq context ---> interrupted by hardirq /*B*/ before_stamp = ts of hard irq context /*E*/ write_stamp = ts of hard irq context /* matches and write_stamp valid */ <---- /*E*/ write_stamp = ts of softirq context /* No longer matches before_stamp, write_stamp is not valid! */ <--- w != write - length, go to slow path // Right now the order of events in the ring buffer is: // // |-- softirq event --|-- hard irq event --|-- normal context event --| // after = write_stamp (this is the ts of softirq) ts = read current timestamp if (write == current position on the ring buffer [true] && after < ts [true] && cmpxchg(write_stamp, after, ts) [true]) { delta = ts - after [Wrong!] The delta is to be between the hard irq event and the normal context event, but the above logic made the delta between the softirq event and the normal context event, where the hard irq event is between the two. This will shift all the remaining event timestamps on the sub-buffer incorrectly. The write_stamp is only valid if it matches the before_stamp. The cmpxchg does nothing to help this. Instead, the following logic can be done to fix this: before = before_stamp ts = read current timestamp before_stamp = ts after = write_stamp if (write == current position on the ring buffer && after == before && after < ts) { delta = ts - after } else { delta = 0; } The above will only use the write_stamp if it still matches before_stamp and was tested to not have changed since C. As a bonus, with this logic we do not need any 64-bit cmpxchg() at all! This means the 32-bit rb_time_t workaround can finally be removed. But that's for a later time. Link: https://lore.kernel.org/linux-trace-kernel/20231218175229.58ec3daf@gandalf.local.home/ Link: https://lore.kernel.org/linux-trace-kernel/20231218230712.3a76b081@gandalf.local.home Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Linus Torvalds Fixes: dd93942570789 ("ring-buffer: Do not try to put back write_stamp") Signed-off-by: Steven Rostedt (Google) commit 044879ce54069cf5f0efe7b4e67200d92e23a7da Author: Lukas Bulwahn Date: Mon Dec 18 13:11:05 2023 +0100 MAINTAINERS: wifi: brcm80211: remove non-existing SHA-cyfmac-dev-list@infineon.com When sending an email to SHA-cyfmac-dev-list@infineon.com, the server responds '550 #5.1.0 Address rejected.' Signed-off-by: Lukas Bulwahn Signed-off-by: Kalle Valo Link: https://msgid.link/20231218121105.23882-1-lukas.bulwahn@gmail.com commit 04c116e2bdfc3969f9819d2cebfdf678353c354c Author: Can Guo Date: Mon Dec 18 07:32:17 2023 -0800 scsi: ufs: core: Let the sq_lock protect sq_tail_slot access When accessing sq_tail_slot without protection from sq_lock, a race condition can cause multiple SQEs to be copied to duplicate SQE slots. This can lead to multiple stability issues. Fix this by moving the *dest initialization in ufshcd_send_command() back under protection from the sq_lock. Fixes: 3c85f087faec ("scsi: ufs: mcq: Use pointer arithmetic in ufshcd_send_command()") Signed-off-by: Can Guo Link: https://lore.kernel.org/r/1702913550-20631-1-git-send-email-quic_cang@quicinc.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 9264fd61e628ce180a168e6b90bde134dd49ec28 Author: ChanWoo Lee Date: Fri Dec 15 09:38:12 2023 +0900 scsi: ufs: qcom: Return ufs_qcom_clk_scale_*() errors in ufs_qcom_clk_scale_notify() In commit 031312dbc695 ("scsi: ufs: ufs-qcom: Remove unnecessary goto statements") the error handling was accidentally changed, resulting in the error of ufs_qcom_clk_scale_*() calls not being returned. This is the case I checked: ufs_qcom_clk_scale_notify -> 'ufs_qcom_clk_scale_up_/down_pre_change' error -> return 0; Make sure those errors are properly returned. Fixes: 031312dbc695 ("scsi: ufs: ufs-qcom: Remove unnecessary goto statements") Reviewed-by: Manivannan Sadhasivam Signed-off-by: ChanWoo Lee Link: https://lore.kernel.org/r/20231215003812.29650-1-cw9316.lee@samsung.com Reviewed-by: Andrew Halaney Signed-off-by: Martin K. Petersen commit 066c5b46b6eaf2f13f80c19500dbb3b84baabb33 Author: Alexander Atanasov Date: Fri Dec 15 14:10:08 2023 +0200 scsi: core: Always send batch on reset or error handling command In commit 8930a6c20791 ("scsi: core: add support for request batching") the block layer bd->last flag was mapped to SCMD_LAST and used as an indicator to send the batch for the drivers that implement this feature. However, the error handling code was not updated accordingly. scsi_send_eh_cmnd() is used to send error handling commands and request sense. The problem is that request sense comes as a single command that gets into the batch queue and times out. As a result the device goes offline after several failed resets. This was observed on virtio_scsi during a device resize operation. [ 496.316946] sd 0:0:4:0: [sdd] tag#117 scsi_eh_0: requesting sense [ 506.786356] sd 0:0:4:0: [sdd] tag#117 scsi_send_eh_cmnd timeleft: 0 [ 506.787981] sd 0:0:4:0: [sdd] tag#117 abort To fix this always set SCMD_LAST flag in scsi_send_eh_cmnd() and scsi_reset_ioctl(). Fixes: 8930a6c20791 ("scsi: core: add support for request batching") Cc: Signed-off-by: Alexander Atanasov Link: https://lore.kernel.org/r/20231215121008.2881653-1-alexander.atanasov@virtuozzo.com Reviewed-by: Ming Lei Signed-off-by: Martin K. Petersen commit 08c94d80b2da481652fb633e79cbc41e9e326a91 Author: Wei Yongjun Date: Mon Nov 14 11:06:26 2022 +0000 scsi: bnx2fc: Fix skb double free in bnx2fc_rcv() skb_share_check() already drops the reference to the skb when returning NULL. Using kfree_skb() in the error handling path leads to an skb double free. Fix this by removing the variable tmp_skb, and return directly when skb_share_check() returns NULL. Fixes: 01a4cc4d0cd6 ("bnx2fc: do not add shared skbs to the fcoe_rx_list") Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20221114110626.526643-1-weiyongjun@huaweicloud.com Signed-off-by: Martin K. Petersen commit 3f10e214a9de738832b357a58b605c2fbd23aa96 Merge: 2cf4f94d8e864 6eb04ca8c52e3 Author: Linus Torvalds Date: Mon Dec 18 16:47:21 2023 -0800 Merge tag 'hid-for-linus-2023121901' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Jiri Kosina: - fix for division by zero in Nintendo driver when generic joycon is attached, reported and fixed by SteamOS folks (Guilherme G. Piccoli) - GCC-7 build fix (which is a good cleanup anyway) for Nintendo driver (Ryan McClelland) * tag 'hid-for-linus-2023121901' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: nintendo: Prevent divide-by-zero on code HID: nintendo: fix initializer element is not constant error commit bd018b98ba84ca0c80abac1ef23ce726a809e58c Author: Chuck Lever Date: Mon Dec 18 17:05:40 2023 -0500 SUNRPC: Revert 5f7fc5d69f6e92ec0b38774c387f5cf7812c5806 Guillaume says: > I believe commit 5f7fc5d69f6e ("SUNRPC: Resupply rq_pages from > node-local memory") in Linux 6.5+ is incorrect. It passes > unconditionally rq_pool->sp_id as the NUMA node. > > While the comment in the svc_pool declaration in sunrpc/svc.h says > that sp_id is also the NUMA node id, it might not be the case if > the svc is created using svc_create_pooled(). svc_created_pooled() > can use the per-cpu pool mode therefore in this case sp_id would > be the cpu id. Fix this by reverting now. At a later point this minor optimization, and the deceptive labeling of the sp_id field, can be revisited. Reported-by: Guillaume Morin Closes: https://lore.kernel.org/linux-nfs/ZYC9rsno8qYggVt9@bender.morinfr.org/T/#u Fixes: 5f7fc5d69f6e ("SUNRPC: Resupply rq_pages from node-local memory") Signed-off-by: Chuck Lever commit 6eb04ca8c52e3f8c8ea7102ade81d642eee87f4a Author: Guilherme G. Piccoli Date: Tue Dec 5 18:15:51 2023 -0300 HID: nintendo: Prevent divide-by-zero on code It was reported [0] that adding a generic joycon to the system caused a kernel crash on Steam Deck, with the below panic spew: divide error: 0000 [#1] PREEMPT SMP NOPTI [...] Hardware name: Valve Jupiter/Jupiter, BIOS F7A0119 10/24/2023 RIP: 0010:nintendo_hid_event+0x340/0xcc1 [hid_nintendo] [...] Call Trace: [...] ? exc_divide_error+0x38/0x50 ? nintendo_hid_event+0x340/0xcc1 [hid_nintendo] ? asm_exc_divide_error+0x1a/0x20 ? nintendo_hid_event+0x307/0xcc1 [hid_nintendo] hid_input_report+0x143/0x160 hidp_session_run+0x1ce/0x700 [hidp] Since it's a divide-by-0 error, by tracking the code for potential denominator issues, we've spotted 2 places in which this could happen; so let's guard against the possibility and log in the kernel if the condition happens. This is specially useful since some data that fills some denominators are read from the joycon HW in some cases, increasing the potential for flaws. [0] https://github.com/ValveSoftware/SteamOS/issues/1070 Signed-off-by: Guilherme G. Piccoli Tested-by: Sam Lantinga Signed-off-by: Jiri Kosina commit 2cf4f94d8e8646803f8fb0facf134b0cd7fb691a Merge: 26d6084791bb2 77a6725560960 Author: Linus Torvalds Date: Mon Dec 18 11:11:09 2023 -0800 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Two medium sized fixes, both in drivers. The UFS one adds parsing of clock info structures, which is required by some host drivers and the aacraid one reverts the IRQ affinity mapping patch which has been causing regressions noted in kernel bugzilla 217599" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: core: Store min and max clk freq from OPP table Revert "scsi: aacraid: Reply queue mapping to CPUs based on IRQ affinity" commit 26d6084791bb2cce41b83cb09b4cfdd9fa0c28f1 Merge: ceb6a6f023fd3 fc70d643a2f66 Author: Linus Torvalds Date: Mon Dec 18 10:59:57 2023 -0800 Merge tag 'spi-fix-v6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A few bigger things here, the main one being that there were changes to the atmel driver in this cycle which made it possible to kill transfers being used for filesystem I/O which turned out to be very disruptive, the series of patches here undoes that and hardens things up further. There's also a few smaller driver specific changes, the main one being to revert a change that duplicted delays" * tag 'spi-fix-v6.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: atmel: Fix clock issue when using devices with different polarities spi: spi-imx: correctly configure burst length when using dma spi: cadence: revert "Add SPI transfer delays" spi: atmel: Prevent spi transfers from being killed spi: atmel: Drop unused defines spi: atmel: Do not cancel a transfer upon any signal commit 5d6f447b07d5432686ba69183af6e96ac58069c9 Author: Mike Snitzer Date: Wed Dec 13 14:49:12 2023 -0500 MAINTAINERS: remove stale info for DEVICE-MAPPER Signed-off-by: Mike Snitzer commit 6849302fdff126997765d16df355b73231f130d4 Author: Mike Snitzer Date: Wed Dec 13 14:46:19 2023 -0500 dm audit: fix Kconfig so DM_AUDIT depends on BLK_DEV_DM Signed-off-by: Mike Snitzer commit b86f4b790c998afdbc88fe1aa55cfe89c4068726 Author: Mikulas Patocka Date: Tue Dec 5 16:39:16 2023 +0100 dm-integrity: don't modify bio's immutable bio_vec in integrity_metadata() __bio_for_each_segment assumes that the first struct bio_vec argument doesn't change - it calls "bio_advance_iter_single((bio), &(iter), (bvl).bv_len)" to advance the iterator. Unfortunately, the dm-integrity code changes the bio_vec with "bv.bv_len -= pos". When this code path is taken, the iterator would be out of sync and dm-integrity would report errors. This happens if the machine is out of memory and "kmalloc" fails. Fix this bug by making a copy of "bv" and changing the copy instead. Fixes: 7eada909bfd7 ("dm: add integrity target") Cc: stable@vger.kernel.org # v4.12+ Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit db29d79b34d9593179de5f868be45c650923e7b4 Author: Yu Kuai Date: Fri Nov 24 15:59:53 2023 +0800 dm-raid: delay flushing event_work() after reconfig_mutex is released After commit db5e653d7c9f ("md: delay choosing sync action to md_start_sync()"), md_start_sync() will hold 'reconfig_mutex', however, in order to make sure event_work is done, __md_stop() will flush workqueue with reconfig_mutex grabbed, hence if sync_work is still pending, deadlock will be triggered. Fortunately, former pacthes to fix stopping sync_thread already make sure all sync_work is done already, hence such deadlock is not possible anymore. However, in order not to cause confusions for people by this implicit dependency, delay flushing event_work to dm-raid where 'reconfig_mutex' is not held, and add some comments to emphasize that the workqueue can't be flushed with 'reconfig_mutex'. Fixes: db5e653d7c9f ("md: delay choosing sync action to md_start_sync()") Depends-on: f52f5c71f3d4 ("md: fix stopping sync thread") Signed-off-by: Yu Kuai Acked-by: Xiao Ni Signed-off-by: Mike Snitzer commit ae53e2198cb811f7ee7c5cd4580bf42e88086fa5 Author: Stefan Binding Date: Mon Dec 18 15:12:21 2023 +0000 ALSA: hda/realtek: Add quirks for ASUS Zenbook 2023 Models These models use 2xCS35L41amps with HDA using SPI and I2C. Models use internal and external boost. All models require DSD support to be added inside cs35l41_hda_property.c Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231218151221.388745-8-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 2b35b66d82dc4641ba60f7f3c36c0040eedb74e2 Author: Stefan Binding Date: Mon Dec 18 15:12:20 2023 +0000 ALSA: hda: cs35l41: Support additional ASUS Zenbook 2023 Models Add new model entries into configuration table. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231218151221.388745-7-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 51d976079976c800ef19ed1b542602fcf63f0edb Author: Stefan Binding Date: Mon Dec 18 15:12:19 2023 +0000 ALSA: hda/realtek: Add quirks for ASUS Zenbook 2022 Models These models use 2xCS35L41amps with HDA using SPI and I2C. Models use internal and external boost. All models require DSD support to be added inside cs35l41_hda_property.c Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231218151221.388745-6-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit b257187bcff4bccc9e7a8f1b8a1a5526ff815af1 Author: Stefan Binding Date: Mon Dec 18 15:12:18 2023 +0000 ALSA: hda: cs35l41: Support additional ASUS Zenbook 2022 Models Add new model entries into configuration table. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231218151221.388745-5-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit a40ce9f4bdbebfbf55fdd83a5284fbaaf222f0b9 Author: Stefan Binding Date: Mon Dec 18 15:12:17 2023 +0000 ALSA: hda/realtek: Add quirks for ASUS ROG 2023 models These models use 2xCS35L41amps with HDA using SPI and I2C. All models use Internal Boost. Some models also use Realtek Speakers in conjunction with CS35L41. All models require DSD support to be added inside cs35l41_hda_property.c Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231218151221.388745-4-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit b592ed2e1d78a475f781802e441c499ab446975b Author: Stefan Binding Date: Mon Dec 18 15:12:16 2023 +0000 ALSA: hda: cs35l41: Support additional ASUS ROG 2023 models Add new model entries into configuration table. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231218151221.388745-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 8c4c216db8fb84be9c4ca60d72b88882066cf28f Author: Stefan Binding Date: Mon Dec 18 15:12:15 2023 +0000 ALSA: hda: cs35l41: Add config table to support many laptops without _DSD This make use of the CS35L41 HDA Property framework, which supports laptops which do not have the _DSD properties in their ACPI. Add configuration table to be able to use a generic function which allows laptops to be supported just by adding an entry into the table. Use configuration table function for existing system 103C89C6. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231218151221.388745-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit f5728a418945ba53e2fdf38a6e5c5a2670965e85 Author: Larysa Zaremba Date: Tue Dec 12 10:29:01 2023 +0100 ice: Fix PF with enabled XDP going no-carrier after reset Commit 6624e780a577fc596788 ("ice: split ice_vsi_setup into smaller functions") has refactored a bunch of code involved in PFR. In this process, TC queue number adjustment for XDP was lost. Bring it back. Lack of such adjustment causes interface to go into no-carrier after a reset, if XDP program is attached, with the following message: ice 0000:b1:00.0: Failed to set LAN Tx queue context, error: -22 ice 0000:b1:00.0 ens801f0np0: Failed to open VSI 0x0006 on switch 0x0001 ice 0000:b1:00.0: enable VSI failed, err -22, VSI index 0, type ICE_VSI_PF ice 0000:b1:00.0: PF VSI rebuild failed: -22 ice 0000:b1:00.0: Rebuild failed, unload and reload driver Fixes: 6624e780a577 ("ice: split ice_vsi_setup into smaller functions") Reviewed-by: Przemek Kitszel Signed-off-by: Larysa Zaremba Reviewed-by: Simon Horman Tested-by: Chandan Kumar Rout (A Contingent Worker at Intel) Signed-off-by: Tony Nguyen commit 4d50fcdc2476eef94c14c6761073af5667bb43b6 Author: Dave Ertman Date: Mon Dec 11 13:19:28 2023 -0800 ice: alter feature support check for SRIOV and LAG Previously, the ice driver had support for using a handler for bonding netdev events to ensure that conflicting features were not allowed to be activated at the same time. While this was still in place, additional support was added to specifically support SRIOV and LAG together. These both utilized the netdev event handler, but the SRIOV and LAG feature was behind a capabilities feature check to make sure the current NVM has support. The exclusion part of the event handler should be removed since there are users who have custom made solutions that depend on the non-exclusion of features. Wrap the creation/registration and cleanup of the event handler and associated structs in the probe flow with a feature check so that the only systems that support the full implementation of LAG features will initialize support. This will leave other systems unhindered with functionality as it existed before any LAG code was added. Fixes: bb52f42acef6 ("ice: Add driver support for firmware changes for LAG") Reviewed-by: Jesse Brandeburg Signed-off-by: Dave Ertman Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 7d881346121a97756f34e00e6296a5d63f001f7f Author: Jacob Keller Date: Wed Dec 6 12:19:05 2023 -0800 ice: stop trashing VF VSI aggregator node ID information When creating new VSIs, they are assigned into an aggregator node in the scheduler tree. Information about which aggregator node a VSI is assigned into is maintained by the vsi->agg_node structure. In ice_vsi_decfg(), this information is being destroyed, by overwriting the valid flag and the agg_id field to zero. For VF VSIs, this breaks the aggregator node configuration replay, which depends on this information. This results in VFs being inserted into the default aggregator node. The resulting configuration will have unexpected Tx bandwidth sharing behavior. This was broken by commit 6624e780a577 ("ice: split ice_vsi_setup into smaller functions"), which added the block to reset the agg_node data. The vsi->agg_node structure is not managed by the scheduler code, but is instead a wrapper around an aggregator node ID that is tracked at the VSI layer. Its been around for a long time, and its primary purpose was for handling VFs. The SR-IOV VF reset flow does not make use of the standard VSI rebuild/replay logic, and uses vsi->agg_node as part of its handling to rebuild the aggregator node configuration. The logic for aggregator nodes stretches back to early ice driver code from commit b126bd6bcd67 ("ice: create scheduler aggregator node config and move VSIs") The logic in ice_vsi_decfg() which trashes the ice_agg_node data is clearly wrong. It destroys information that is necessary for handling VF reset,. It is also not the correct way to actually remove a VSI from an aggregator node. For that, we need to implement logic in the scheduler code. Further, non-VF VSIs properly replay their aggregator configuration using existing scheduler replay logic. To fix the VF replay logic, remove this broken aggregator node cleanup logic. This is the simplest way to immediately fix this. This ensures that VFs will have proper aggregate configuration after a reset. This is especially important since VFs often perform resets as part of their reconfiguration flows. Without fixing this, VFs will be placed in the default aggregator node and Tx bandwidth will not be shared in the expected and configured manner. Fixes: 6624e780a577 ("ice: split ice_vsi_setup into smaller functions") Signed-off-by: Jacob Keller Reviewed-by: Przemek Kitszel Reviewed-by: Simon Horman Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit aca58eac52b88138ab98c814afb389a381725cd7 Author: Douglas Anderson Date: Thu Dec 14 12:37:52 2023 -0800 drm/bridge: ti-sn65dsi86: Never store more than msg->size bytes in AUX xfer For aux reads, the value `msg->size` indicates the size of the buffer provided by `msg->buffer`. We should never in any circumstances write more bytes to the buffer since it may overflow the buffer. In the ti-sn65dsi86 driver there is one code path that reads the transfer length from hardware. Even though it's never been seen to be a problem, we should make extra sure that the hardware isn't increasing the length since doing so would cause us to overrun the buffer. Fixes: 982f589bde7a ("drm/bridge: ti-sn65dsi86: Update reply on aux failures") Reviewed-by: Stephen Boyd Reviewed-by: Guenter Roeck Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20231214123752.v3.2.I7b83c0f31aeedc6b1dc98c7c741d3e1f94f040f8@changeid commit 3164c8a70073d43629b4e11e083d3d2798f7750f Author: Douglas Anderson Date: Thu Dec 14 12:37:51 2023 -0800 drm/bridge: parade-ps8640: Never store more than msg->size bytes in AUX xfer While testing, I happened to notice a random crash that looked like: Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: drm_dp_dpcd_probe+0x120/0x120 Analysis of drm_dp_dpcd_probe() shows that we pass in a 1-byte buffer (allocated on the stack) to the aux->transfer() function. Presumably if the aux->transfer() writes more than one byte to this buffer then we're in a bad shape. Dropping into kgdb, I noticed that "aux->transfer" pointed at ps8640_aux_transfer(). Reading through ps8640_aux_transfer(), I can see that there are cases where it could write more bytes to msg->buffer than were specified by msg->size. This could happen if the hardware reported back something bogus to us. Let's fix this so we never write more than msg->size bytes. We'll still read all the bytes from the hardware just in case the hardware requires it since the aux transfer data comes through an auto-incrementing register. NOTE: I have no actual way to reproduce this issue but it seems likely this is what was happening in the crash I looked at. Fixes: 13afcdd7277e ("drm/bridge: parade-ps8640: Add support for AUX channel") Reviewed-by: Stephen Boyd Reviewed-by: Guenter Roeck Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20231214123752.v3.1.I9d1afcaad76a3e2c0ca046dc4adbc2b632c22eda@changeid commit 400f6ebbc175286576c7f7fddf3c347d09d12310 Author: Johannes Berg Date: Fri Dec 15 11:13:34 2023 +0100 wifi: iwlwifi: pcie: don't synchronize IRQs from IRQ On older devices (before unified image!) we can end up calling stop_device from an rfkill interrupt. However, in stop_device we attempt to synchronize IRQs, which then of course deadlocks. Avoid this by checking the context, if running from the IRQ thread then don't synchronize. This wouldn't be correct on a new device since RSS is supported, but older devices only have a single interrupt/queue. Fixes: 37fb29bd1f90 ("wifi: iwlwifi: pcie: synchronize IRQs before NAPI") Reviewed-by: Miri Korenblit Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://msgid.link/20231215111335.59aab00baed7.Iadfe154d6248e7f9dfd69522e5429dbbd72925d7@changeid commit 1227561c2ffb81ab09ead21cce6438f59276aa6e Author: Chuck Lever Date: Sat Dec 16 12:12:50 2023 -0500 NFSD: Revert 738401a9bd1ac34ccd5723d69640a4adbb1a4bc0 There's nothing wrong with this commit, but this is dead code now that nothing triggers a CB_GETATTR callback. It can be re-introduced once the issues with handling conflicting GETATTRs are resolved. Signed-off-by: Chuck Lever commit 862bee84d77fa01cc8929656ae77781abf917863 Author: Chuck Lever Date: Sat Dec 16 11:57:43 2023 -0500 NFSD: Revert 6c41d9a9bd0298002805758216a9c44e38a8500d For some reason, the wait_on_bit() in nfsd4_deleg_getattr_conflict() is waiting forever, preventing a clean server shutdown. The requesting client might also hang waiting for a reply to the conflicting GETATTR. Invoking wait_on_bit() in an nfsd thread context is a hazard. The correct fix is to replace this wait_on_bit() call site with a mechanism that defers the conflicting GETATTR until the CB_GETATTR completes or is known to have failed. That will require some surgery and extended testing and it's late in the v6.7-rc cycle, so I'm reverting now in favor of trying again in a subsequent kernel release. This is my fault: I should have recognized the ramifications of calling wait_on_bit() in here before accepting this patch. Thanks to Dai Ngo for diagnosing the issue. Reported-by: Wolfgang Walter Closes: https://lore.kernel.org/linux-nfs/e3d43ecdad554fbdcaa7181833834f78@stwm.de/ Signed-off-by: Chuck Lever commit b1b6131bca35a55a69fadc39d51577968fa2ee97 Author: Hans de Goede Date: Sun Dec 17 22:32:21 2023 +0100 ASoC: Intel: bytcr_rt5640: Add new swapped-speakers quirk Some BYTCR x86 tablets with a rt5640 codec have the left and right channels of their speakers swapped. Add a new BYT_RT5640_SWAPPED_SPEAKERS quirk for this which sets cfg-spk:swapped in the components string to let userspace know about the swapping so that the UCM profile can configure the mixer to correct this. Enable this new quirk on the Medion Lifetab S10346 which has its speakers swapped. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://msgid.link/r/20231217213221.49424-2-hdegoede@redhat.com Signed-off-by: Mark Brown commit 99c7bb44f5749373bc01b73af02b50b69bcbf43d Author: Hans de Goede Date: Sun Dec 17 22:32:20 2023 +0100 ASoC: Intel: bytcr_rt5640: Add quirk for the Medion Lifetab S10346 Add a quirk for the Medion Lifetab S10346, this BYTCR tablet has no CHAN package in its ACPI tables and uses SSP0-AIF1 rather then SSP0-AIF2 which is the default for BYTCR devices. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Link: https://msgid.link/r/20231217213221.49424-1-hdegoede@redhat.com Signed-off-by: Mark Brown commit 49e0a85ec3441edc6c77aa40206d6e5ee4597efc Author: Ville Syrjälä Date: Mon Dec 11 23:37:47 2023 +0200 drm/i915/dmc: Don't enable any pipe DMC events The pipe DMC seems to be making a mess of things in ADL. Various weird symptoms have been observed such as missing vblank irqs, typicalle happening when using multiple displays. Keep all pipe DMC event handlers disabled until needed (which is never atm). This is also what Windows does on ADL+. We can also drop DG2 from disable_all_flip_queue_events() since on DG2 the pipe DMC is the one that handles the flip queue events. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8685 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231211213750.27109-2-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak (cherry picked from commit 648d7be8ecf47b0556e32550145c70db153b16fb) Signed-off-by: Jani Nikula commit dbcab554f777390d9bb6a808ed0cd90ee59bb44e Author: Imre Deak Date: Thu Dec 14 00:05:26 2023 +0200 drm/i915/mtl: Fix HDMI/DP PLL clock selection Select the HDMI specific PLL clock only for HDMI outputs. Fixes: 62618c7f117e ("drm/i915/mtl: C20 PLL programming") Cc: Mika Kahola Cc: Radhakrishna Sripada Reviewed-by: Radhakrishna Sripada Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231213220526.1828827-1-imre.deak@intel.com (cherry picked from commit 937d02cc79c6828fef28a4d80d8d0ad2f7bf2b62) Signed-off-by: Jani Nikula commit 88a173e5dd05e788068e8fa20a8c37c44bd8f416 Author: Ville Syrjälä Date: Mon Dec 11 10:11:34 2023 +0200 drm/i915: Reject async flips with bigjoiner Currently async flips are busted when bigjoiner is in use. As a short term fix simply reject async flips in that case. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9769 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231211081134.2698-1-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy (cherry picked from commit e93bffc2ac0a833b42841f31fff955549d38ce98) Signed-off-by: Jani Nikula commit 768f17fd25e4a98bf5166148629ecf6f647d5efc Author: Karthik Poosa Date: Mon Dec 4 20:18:09 2023 +0530 drm/i915/hwmon: Fix static analysis tool reported issues Updated i915 hwmon with fixes for issues reported by static analysis tool. Fixed integer overflow with upcasting. v2: - Added Fixes tag (Badal). - Updated commit message as per review comments (Anshuman). Fixes: 4c2572fe0ae7 ("drm/i915/hwmon: Expose power1_max_interval") Reviewed-by: Badal Nilawar Reviewed-by: Anshuman Gupta Signed-off-by: Karthik Poosa Signed-off-by: Anshuman Gupta Link: https://patchwork.freedesktop.org/patch/msgid/20231204144809.1518704-1-karthik.poosa@intel.com (cherry picked from commit ac3420d3d428443a08b923f9118121c170192b62) Signed-off-by: Jani Nikula commit 6bf3549384033102986a3514744e080d3bfca7cf Author: Ankit Nautiyal Date: Wed Nov 22 12:16:27 2023 +0530 drm/i915/display: Get bigjoiner config before dsc config during readout Currently we get bigjoiner config after the dsc get config, during HW readout. Since dsc_get_config now uses bigjoiner flags/pipes to compute DSC PPS parameter pic_width, this results in a state mismatch when Bigjoiner and DSC are used together. So call get bigjoiner config before calling dsc get config function. Fixes: 8b70b5691704 ("drm/i915/vdsc: Fill the intel_dsc_get_pps_config function") Cc: Suraj Kandpal Cc: Ankit Nautiyal Cc: Animesh Manna Cc: Jani Nikula Signed-off-by: Ankit Nautiyal Reviewed-by: Suraj Kandpal Link: https://patchwork.freedesktop.org/patch/msgid/20231122064627.905828-1-ankit.k.nautiyal@intel.com (cherry picked from commit baf31a20fa7f3538d68ffa5262a715eb1d699cdd) Signed-off-by: Jani Nikula commit d5a10b976ecb77fa49b95f3f1016ca2997c122cb Author: Thomas Gleixner Date: Fri Dec 15 15:19:32 2023 +0100 x86/acpi: Handle bogus MADT APIC tables gracefully The recent fix to ignore invalid x2APIC entries inadvertently broke systems with creative MADT APIC tables. The affected systems have APIC MADT tables where all entries have invalid APIC IDs (0xFF), which means they register exactly zero CPUs. But the condition to ignore the entries of APIC IDs < 255 in the X2APIC MADT table is solely based on the count of MADT APIC table entries. As a consequence, the affected machines enumerate no secondary CPUs at all because the APIC table has entries and therefore the X2APIC table entries with APIC IDs < 255 are ignored. Change the condition so that the APIC table preference for APIC IDs < 255 only becomes effective when the APIC table has valid APIC ID entries. IOW, an APIC table full of invalid APIC IDs is considered to be empty which in consequence enables the X2APIC table entries with a APIC ID < 255 and restores the expected behaviour. Fixes: ec9aedb2aa1a ("x86/acpi: Ignore invalid x2APIC entries") Reported-by: John Sperbeck Reported-by: Andres Freund Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/169953729188.3135.6804572126118798018.tip-bot2@tip-bot2 commit a55bdad5dfd1efd4ed9ffe518897a21ca8e4e193 Author: Mario Limonciello Date: Mon Dec 11 22:50:06 2023 -0600 platform/x86/amd/pmc: Disable keyboard wakeup on AMD Framework 13 The Laptop 13 (AMD Ryzen 7040Series) BIOS 03.03 has a workaround included in the EC firmware that will cause the EC to emit a "spurious" keypress during the resume from s0i3 [1]. This series of keypress events can be observed in the kernel log on resume. ``` atkbd serio0: Unknown key pressed (translated set 2, code 0x6b on isa0060/serio0). atkbd serio0: Use 'setkeycodes 6b ' to make it known. atkbd serio0: Unknown key released (translated set 2, code 0x6b on isa0060/serio0). atkbd serio0: Use 'setkeycodes 6b ' to make it known. ``` In some user flows this is harmless, but if a user has specifically suspended the laptop and then closed the lid it will cause the laptop to wakeup. The laptop wakes up because the ACPI SCI triggers when the lid is closed and when the kernel sees that IRQ1 is "also" active. The kernel can't distinguish from a real keyboard keypress and wakes the system. Add the model into the list of quirks to disable keyboard wakeup source. This is intentionally only matching the production BIOS version in hopes that a newer EC firmware included in a newer BIOS can avoid this behavior. Cc: Kieran Levin Link: https://github.com/FrameworkComputer/EmbeddedController/blob/lotus-zephyr/zephyr/program/lotus/azalea/src/power_sequence.c#L313 [1] Link: https://community.frame.work/t/amd-wont-sleep-properly/41755 Link: https://community.frame.work/t/tracking-framework-amd-ryzen-7040-series-lid-wakeup-behavior-feedback/39128 Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20231212045006.97581-5-mario.limonciello@amd.com Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit b614a4bd73efeddc2b20d9e6deb6c2710373802b Author: Mario Limonciello Date: Mon Dec 11 22:50:05 2023 -0600 platform/x86/amd/pmc: Move keyboard wakeup disablement detection to pmc-quirks Other platforms may need to disable keyboard wakeup besides Cezanne, so move the detection into amd_pmc_quirks_init() where it may be applied to multiple platforms. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20231212045006.97581-4-mario.limonciello@amd.com Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 2d53c0ab61e62302d7b62d660fe76de2bff6bf45 Author: Mario Limonciello Date: Mon Dec 11 22:50:04 2023 -0600 platform/x86/amd/pmc: Only run IRQ1 firmware version check on Cezanne amd_pmc_wa_czn_irq1() only runs on Cezanne platforms currently but may be extended to other platforms in the future. Rename the function and only check platform firmware version when it's called for a Cezanne based platform. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20231212045006.97581-3-mario.limonciello@amd.com Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 85980669a863514dd47761efd6c1bc4677a2ae08 Author: Mario Limonciello Date: Mon Dec 11 22:50:03 2023 -0600 platform/x86/amd/pmc: Move platform defines to header The platform defines will be used by the quirks in the future, so move them to the common header to allow use by both source files. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20231212045006.97581-2-mario.limonciello@amd.com Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit fbcf67ce5a9e2831c14bdfb895be05213e611724 Author: Rajvi Jingar Date: Fri Dec 15 17:16:50 2023 -0800 platform/x86/intel/pmc: Fix hang in pmc_core_send_ltr_ignore() For input value 0, PMC stays unassigned which causes crash while trying to access PMC for register read/write. Include LTR index 0 in pmc_index and ltr_index calculation. Fixes: 2bcef4529222 ("platform/x86:intel/pmc: Enable debugfs multiple PMC support") Signed-off-by: Rajvi Jingar Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20231216011650.1973941-1-rajvi.jingar@linux.intel.com Signed-off-by: Ilpo Järvinen commit 66e92e23a72761f5b53f970aeb1badc5fd92fc74 Author: Vishnu Sankar Date: Thu Dec 14 22:47:02 2023 +0900 platform/x86: thinkpad_acpi: fix for incorrect fan reporting on some ThinkPad systems Some ThinkPad systems ECFW use non-standard addresses for fan control and reporting. This patch adds support for such ECFW so that it can report the correct fan values. Tested on Thinkpads L13 Yoga Gen 2 and X13 Yoga Gen 2. Suggested-by: Mark Pearson Signed-off-by: Vishnu Sankar Reviewed-by: Hans de Goede Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20231214134702.166464-1-vishnuocv@gmail.com Signed-off-by: Ilpo Järvinen commit e6b2dab41888332bf83f592131e7ea07756770a4 Author: Heiko Carstens Date: Fri Dec 8 15:03:15 2023 +0100 s390/vx: fix save/restore of fpu kernel context The KERNEL_FPR mask only contains a flag for the first eight vector registers. However floating point registers overlay parts of the first sixteen vector registers. This could lead to vector register corruption if a kernel fpu context uses any of the vector registers 8 to 15 and is interrupted or calls a KERNEL_FPR context. If that context uses also vector registers 8 to 15, their contents will be corrupted on return. Luckily this is currently not a real bug, since the kernel has only one KERNEL_FPR user with s390_adjust_jiffies() and it is only using floating point registers 0 to 2. Fix this by using the correct bits for KERNEL_FPR. Fixes: 7f79695cc1b6 ("s390/fpu: improve kernel_fpu_[begin|end]") Signed-off-by: Heiko Carstens Reviewed-by: Hendrik Brueckner Signed-off-by: Alexander Gordeev commit 0b7dd38c1c520b650a889a81919838671b689eb9 Author: Ryan McClelland Date: Thu Dec 14 09:25:41 2023 -0800 HID: nintendo: fix initializer element is not constant error With gcc-7 builds, an error happens with the controller button values being defined as const. Change to a define. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202312141227.C2h1IzfI-lkp@intel.com/ Signed-off-by: Ryan McClelland Reviewed-by: Daniel J. Ogorchock Signed-off-by: Jiri Kosina commit 13d605e32e4cfdedcecdf3d98d21710ffe887708 Author: Ghanshyam Agrawal Date: Sun Dec 17 13:30:19 2023 +0530 kselftest: alsa: fixed a print formatting warning A statement used %d print formatter where %s should have been used. The same has been fixed in this commit. Signed-off-by: Ghanshyam Agrawal Link: 5aaf9efffc57 ("kselftest: alsa: Add simplistic test for ALSA mixer controls kselftest") Link: https://lore.kernel.org/r/20231217080019.1063476-1-ghanshyam1898@gmail.com Signed-off-by: Takashi Iwai commit 48d6b91798a6694fdd6edb62799754b9d3fe0792 Author: Jeremie Knuesel Date: Sun Dec 17 12:22:43 2023 +0100 ALSA: usb-audio: Increase delay in MOTU M quirk Increase the quirk delay from 2 seconds to 4 seconds. This reflects a change in the Windows driver in which the delay was increased to about 3.7 seconds. The larger delay fixes an issue where the device fails to work unless it was powered up early during boot. Also clarify in the quirk comment that the quirk is only applied to older devices (USB ID 07fd:0008). Signed-off-by: Jeremie Knuesel Suggested-by: Alexander Tsoy Cc: Link: https://bugzilla.kernel.org/show_bug.cgi?id=211975 Link: https://lore.kernel.org/r/20231217112243.33409-1-knuesel@gmail.com Signed-off-by: Takashi Iwai commit e8c7692718bb001505602aa0eb48f142c389c27a Author: Kent Overstreet Date: Sun Dec 17 15:41:03 2023 -0500 bcachefs: print explicit recovery pass message only once Signed-off-by: Kent Overstreet commit b50492b05fd02887b46aef079592207fb5c97a4c Author: Paulo Alcantara Date: Sat Dec 16 01:10:04 2023 -0300 smb: client: fix potential OOB in cifs_dump_detail() Validate SMB message with ->check_message() before calling ->calc_smb_size(). Signed-off-by: Paulo Alcantara (SUSE) Cc: stable@vger.kernel.org Signed-off-by: Steve French commit b35858b3786ddbb56e1c35138ba25d6adf8d0bef Author: Paulo Alcantara Date: Fri Dec 15 19:59:14 2023 -0300 smb: client: fix OOB in smbCalcSize() Validate @smb->WordCount to avoid reading off the end of @smb and thus causing the following KASAN splat: BUG: KASAN: slab-out-of-bounds in smbCalcSize+0x32/0x40 [cifs] Read of size 2 at addr ffff88801c024ec5 by task cifsd/1328 CPU: 1 PID: 1328 Comm: cifsd Not tainted 6.7.0-rc5 #9 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014 Call Trace: dump_stack_lvl+0x4a/0x80 print_report+0xcf/0x650 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? __phys_addr+0x46/0x90 kasan_report+0xd8/0x110 ? smbCalcSize+0x32/0x40 [cifs] ? smbCalcSize+0x32/0x40 [cifs] kasan_check_range+0x105/0x1b0 smbCalcSize+0x32/0x40 [cifs] checkSMB+0x162/0x370 [cifs] ? __pfx_checkSMB+0x10/0x10 [cifs] cifs_handle_standard+0xbc/0x2f0 [cifs] ? srso_alias_return_thunk+0x5/0xfbef5 cifs_demultiplex_thread+0xed1/0x1360 [cifs] ? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs] ? srso_alias_return_thunk+0x5/0xfbef5 ? lockdep_hardirqs_on_prepare+0x136/0x210 ? __pfx_lock_release+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? mark_held_locks+0x1a/0x90 ? lockdep_hardirqs_on_prepare+0x136/0x210 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? __kthread_parkme+0xce/0xf0 ? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs] kthread+0x18d/0x1d0 ? kthread+0xdb/0x1d0 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x34/0x60 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1b/0x30 This fixes CVE-2023-6606. Reported-by: j51569436@gmail.com Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218218 Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 33eae65c6f49770fec7a662935d4eb4a6406d24b Author: Paulo Alcantara Date: Wed Dec 13 12:25:57 2023 -0300 smb: client: fix OOB in SMB2_query_info_init() A small CIFS buffer (448 bytes) isn't big enough to hold SMB2_QUERY_INFO request along with user's input data from CIFS_QUERY_INFO ioctl. That is, if the user passed an input buffer > 344 bytes, the client will memcpy() off the end of @req->Buffer in SMB2_query_info_init() thus causing the following KASAN splat: BUG: KASAN: slab-out-of-bounds in SMB2_query_info_init+0x242/0x250 [cifs] Write of size 1023 at addr ffff88801308c5a8 by task a.out/1240 CPU: 1 PID: 1240 Comm: a.out Not tainted 6.7.0-rc4 #5 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014 Call Trace: dump_stack_lvl+0x4a/0x80 print_report+0xcf/0x650 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? __phys_addr+0x46/0x90 kasan_report+0xd8/0x110 ? SMB2_query_info_init+0x242/0x250 [cifs] ? SMB2_query_info_init+0x242/0x250 [cifs] kasan_check_range+0x105/0x1b0 __asan_memcpy+0x3c/0x60 SMB2_query_info_init+0x242/0x250 [cifs] ? __pfx_SMB2_query_info_init+0x10/0x10 [cifs] ? srso_alias_return_thunk+0x5/0xfbef5 ? smb_rqst_len+0xa6/0xc0 [cifs] smb2_ioctl_query_info+0x4f4/0x9a0 [cifs] ? __pfx_smb2_ioctl_query_info+0x10/0x10 [cifs] ? __pfx_cifsConvertToUTF16+0x10/0x10 [cifs] ? kasan_set_track+0x25/0x30 ? srso_alias_return_thunk+0x5/0xfbef5 ? __kasan_kmalloc+0x8f/0xa0 ? srso_alias_return_thunk+0x5/0xfbef5 ? cifs_strndup_to_utf16+0x12d/0x1a0 [cifs] ? __build_path_from_dentry_optional_prefix+0x19d/0x2d0 [cifs] ? __pfx_smb2_ioctl_query_info+0x10/0x10 [cifs] cifs_ioctl+0x11c7/0x1de0 [cifs] ? __pfx_cifs_ioctl+0x10/0x10 [cifs] ? srso_alias_return_thunk+0x5/0xfbef5 ? rcu_is_watching+0x23/0x50 ? srso_alias_return_thunk+0x5/0xfbef5 ? __rseq_handle_notify_resume+0x6cd/0x850 ? __pfx___schedule+0x10/0x10 ? blkcg_iostat_update+0x250/0x290 ? srso_alias_return_thunk+0x5/0xfbef5 ? ksys_write+0xe9/0x170 __x64_sys_ioctl+0xc9/0x100 do_syscall_64+0x47/0xf0 entry_SYSCALL_64_after_hwframe+0x6f/0x77 RIP: 0033:0x7f893dde49cf Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 18 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007ffc03ff4160 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007ffc03ff4378 RCX: 00007f893dde49cf RDX: 00007ffc03ff41d0 RSI: 00000000c018cf07 RDI: 0000000000000003 RBP: 00007ffc03ff4260 R08: 0000000000000410 R09: 0000000000000001 R10: 00007f893dce7300 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc03ff4388 R14: 00007f893df15000 R15: 0000000000406de0 Fix this by increasing size of SMB2_QUERY_INFO request buffers and validating input length to prevent other callers from overflowing @req in SMB2_query_info_init() as well. Fixes: f5b05d622a3e ("cifs: add IOCTL for QUERY_INFO passthrough to userspace") Cc: stable@vger.kernel.org Reported-by: Robert Morris Signed-off-by: Paulo Alcantara Signed-off-by: Steve French commit a8f68b11158f09754418de62e6b3e7b9b7a50cc9 Author: Paulo Alcantara Date: Wed Dec 13 12:25:56 2023 -0300 smb: client: fix OOB in cifsd when receiving compounded resps Validate next header's offset in ->next_header() so that it isn't smaller than MID_HEADER_SIZE(server) and then standard_receive3() or ->receive() ends up writing off the end of the buffer because 'pdu_length - MID_HEADER_SIZE(server)' wraps up to a huge length: BUG: KASAN: slab-out-of-bounds in _copy_to_iter+0x4fc/0x840 Write of size 701 at addr ffff88800caf407f by task cifsd/1090 CPU: 0 PID: 1090 Comm: cifsd Not tainted 6.7.0-rc4 #5 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014 Call Trace: dump_stack_lvl+0x4a/0x80 print_report+0xcf/0x650 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? __phys_addr+0x46/0x90 kasan_report+0xd8/0x110 ? _copy_to_iter+0x4fc/0x840 ? _copy_to_iter+0x4fc/0x840 kasan_check_range+0x105/0x1b0 __asan_memcpy+0x3c/0x60 _copy_to_iter+0x4fc/0x840 ? srso_alias_return_thunk+0x5/0xfbef5 ? hlock_class+0x32/0xc0 ? srso_alias_return_thunk+0x5/0xfbef5 ? __pfx__copy_to_iter+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_is_held_type+0x90/0x100 ? srso_alias_return_thunk+0x5/0xfbef5 ? __might_resched+0x278/0x360 ? __pfx___might_resched+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 __skb_datagram_iter+0x2c2/0x460 ? __pfx_simple_copy_to_iter+0x10/0x10 skb_copy_datagram_iter+0x6c/0x110 tcp_recvmsg_locked+0x9be/0xf40 ? __pfx_tcp_recvmsg_locked+0x10/0x10 ? mark_held_locks+0x5d/0x90 ? srso_alias_return_thunk+0x5/0xfbef5 tcp_recvmsg+0xe2/0x310 ? __pfx_tcp_recvmsg+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_acquire+0x14a/0x3a0 ? srso_alias_return_thunk+0x5/0xfbef5 inet_recvmsg+0xd0/0x370 ? __pfx_inet_recvmsg+0x10/0x10 ? __pfx_lock_release+0x10/0x10 ? do_raw_spin_trylock+0xd1/0x120 sock_recvmsg+0x10d/0x150 cifs_readv_from_socket+0x25a/0x490 [cifs] ? __pfx_cifs_readv_from_socket+0x10/0x10 [cifs] ? srso_alias_return_thunk+0x5/0xfbef5 cifs_read_from_socket+0xb5/0x100 [cifs] ? __pfx_cifs_read_from_socket+0x10/0x10 [cifs] ? __pfx_lock_release+0x10/0x10 ? do_raw_spin_trylock+0xd1/0x120 ? _raw_spin_unlock+0x23/0x40 ? srso_alias_return_thunk+0x5/0xfbef5 ? __smb2_find_mid+0x126/0x230 [cifs] cifs_demultiplex_thread+0xd39/0x1270 [cifs] ? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs] ? __pfx_lock_release+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? mark_held_locks+0x1a/0x90 ? lockdep_hardirqs_on_prepare+0x136/0x210 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? __kthread_parkme+0xce/0xf0 ? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs] kthread+0x18d/0x1d0 ? kthread+0xdb/0x1d0 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x34/0x60 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1b/0x30 Fixes: 8ce79ec359ad ("cifs: update multiplex loop to handle compounded responses") Cc: stable@vger.kernel.org Reported-by: Robert Morris Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit ceb6a6f023fd3e8b07761ed900352ef574010bcb Author: Linus Torvalds Date: Sun Dec 17 15:19:28 2023 -0800 Linux 6.7-rc6 commit 177c2ffe69555dde28fad5ddb62a6d806982e53f Merge: 0e389834672c7 7e2c1e4b34f07 Author: Linus Torvalds Date: Sun Dec 17 14:03:11 2023 -0800 Merge tag 'perf_urgent_for_v6.7_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fix from Borislav Petkov: - Avoid iterating over newly created group leader event's siblings because there are none, and thus prevent a lockdep splat * tag 'perf_urgent_for_v6.7_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Fix perf_event_validate_size() lockdep splat commit 979e90173af8d2f52f671d988189aab98c6d1be6 Merge: b1dfc0f76231b 356c71c46169d Author: David S. Miller Date: Sun Dec 17 20:54:22 2023 +0000 Merge branch 'mptcp-misc-fixes' Matthieu Baerts says: ==================== mptcp: misc. fixes for v6.7 Here are a few fixes related to MPTCP: Patch 1 avoids skipping some subtests of the MPTCP Join selftest by mistake when using older versions of GCC. This fixes a patch introduced in v6.4, backported up to v6.1. Patch 2 fixes an inconsistent state when using MPTCP + FastOpen. A fix for v6.2. Patch 3 adds a description for MPTCP Kunit test modules to avoid a warning. Patch 4 adds an entry to the mailmap file for Geliang's email addresses. ==================== Signed-off-by: David S. Miller Signed-off-by: Matthieu Baerts commit 356c71c46169d5f3ff7f9ae939d73aceb3b2e514 Author: Geliang Tang Date: Fri Dec 15 17:04:27 2023 +0100 mailmap: add entries for Geliang Tang Map Geliang's old mail addresses to his @linux.dev one. Suggested-by: Mat Martineau Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit a8f570b247972775f710375125ebabfc47b1e518 Author: Matthieu Baerts Date: Fri Dec 15 17:04:26 2023 +0100 mptcp: fill in missing MODULE_DESCRIPTION() W=1 builds warn on missing MODULE_DESCRIPTION, add them here in MPTCP. Only two were missing: two modules with different KUnit tests for MPTCP. Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit 4fd19a30701659af5839b7bd19d1f05f05933ebe Author: Paolo Abeni Date: Fri Dec 15 17:04:25 2023 +0100 mptcp: fix inconsistent state on fastopen race The netlink PM can race with fastopen self-connect attempts, shutting down the first subflow via: MPTCP_PM_CMD_DEL_ADDR -> mptcp_nl_remove_id_zero_address -> mptcp_pm_nl_rm_subflow_received -> mptcp_close_ssk and transitioning such subflow to FIN_WAIT1 status before the syn-ack packet is processed. The MPTCP code does not react to such state change, leaving the connection in not-fallback status and the subflow handshake uncompleted, triggering the following splat: WARNING: CPU: 0 PID: 10630 at net/mptcp/subflow.c:1405 subflow_data_ready+0x39f/0x690 net/mptcp/subflow.c:1405 Modules linked in: CPU: 0 PID: 10630 Comm: kworker/u4:11 Not tainted 6.6.0-syzkaller-14500-g1c41041124bd #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Workqueue: bat_events batadv_nc_worker RIP: 0010:subflow_data_ready+0x39f/0x690 net/mptcp/subflow.c:1405 Code: 18 89 ee e8 e3 d2 21 f7 40 84 ed 75 1f e8 a9 d7 21 f7 44 89 fe bf 07 00 00 00 e8 0c d3 21 f7 41 83 ff 07 74 07 e8 91 d7 21 f7 <0f> 0b e8 8a d7 21 f7 48 89 df e8 d2 b2 ff ff 31 ff 89 c5 89 c6 e8 RSP: 0018:ffffc90000007448 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff888031efc700 RCX: ffffffff8a65baf4 RDX: ffff888043222140 RSI: ffffffff8a65baff RDI: 0000000000000005 RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000007 R10: 000000000000000b R11: 0000000000000000 R12: 1ffff92000000e89 R13: ffff88807a534d80 R14: ffff888021c11a00 R15: 000000000000000b FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fa19a0ffc81 CR3: 000000007a2db000 CR4: 00000000003506f0 DR0: 000000000000d8dd DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Call Trace: tcp_data_ready+0x14c/0x5b0 net/ipv4/tcp_input.c:5128 tcp_data_queue+0x19c3/0x5190 net/ipv4/tcp_input.c:5208 tcp_rcv_state_process+0x11ef/0x4e10 net/ipv4/tcp_input.c:6844 tcp_v4_do_rcv+0x369/0xa10 net/ipv4/tcp_ipv4.c:1929 tcp_v4_rcv+0x3888/0x3b30 net/ipv4/tcp_ipv4.c:2329 ip_protocol_deliver_rcu+0x9f/0x480 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x2e4/0x510 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:314 [inline] NF_HOOK include/linux/netfilter.h:308 [inline] ip_local_deliver+0x1b6/0x550 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:461 [inline] ip_rcv_finish+0x1c4/0x2e0 net/ipv4/ip_input.c:449 NF_HOOK include/linux/netfilter.h:314 [inline] NF_HOOK include/linux/netfilter.h:308 [inline] ip_rcv+0xce/0x440 net/ipv4/ip_input.c:569 __netif_receive_skb_one_core+0x115/0x180 net/core/dev.c:5527 __netif_receive_skb+0x1f/0x1b0 net/core/dev.c:5641 process_backlog+0x101/0x6b0 net/core/dev.c:5969 __napi_poll.constprop.0+0xb4/0x540 net/core/dev.c:6531 napi_poll net/core/dev.c:6600 [inline] net_rx_action+0x956/0xe90 net/core/dev.c:6733 __do_softirq+0x21a/0x968 kernel/softirq.c:553 do_softirq kernel/softirq.c:454 [inline] do_softirq+0xaa/0xe0 kernel/softirq.c:441 __local_bh_enable_ip+0xf8/0x120 kernel/softirq.c:381 spin_unlock_bh include/linux/spinlock.h:396 [inline] batadv_nc_purge_paths+0x1ce/0x3c0 net/batman-adv/network-coding.c:471 batadv_nc_worker+0x9b1/0x10e0 net/batman-adv/network-coding.c:722 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 To address the issue, catch the racing subflow state change and use it to cause the MPTCP fallback. Such fallback is also used to cause the first subflow state propagation to the msk socket via mptcp_set_connected(). After this change, the first subflow can additionally propagate the TCP_FIN_WAIT1 state, so rename the helper accordingly. Finally, if the state propagation is delayed to the msk release callback, the first subflow can change to a different state in between. Cache the relevant target state in a new msk-level field and use such value to update the msk state at release time. Fixes: 1e777f39b4d7 ("mptcp: add MSG_FASTOPEN sendmsg flag support") Cc: stable@vger.kernel.org Reported-by: Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/458 Signed-off-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit c8f021eec5817601dbd25ab7e3ad5c720965c688 Author: Geliang Tang Date: Fri Dec 15 17:04:24 2023 +0100 selftests: mptcp: join: fix subflow_send_ack lookup MPC backups tests will skip unexpected sometimes (For example, when compiling kernel with an older version of gcc, such as gcc-8), since static functions like mptcp_subflow_send_ack also be listed in /proc/kallsyms, with a 't' in front of it, not 'T' ('T' is for a global function): > grep "mptcp_subflow_send_ack" /proc/kallsyms 0000000000000000 T __pfx___mptcp_subflow_send_ack 0000000000000000 T __mptcp_subflow_send_ack 0000000000000000 t __pfx_mptcp_subflow_send_ack 0000000000000000 t mptcp_subflow_send_ack In this case, mptcp_lib_kallsyms_doesnt_have "mptcp_subflow_send_ack$" will be false, MPC backups tests will skip. This is not what we expected. The correct logic here should be: if mptcp_subflow_send_ack is not a global function in /proc/kallsyms, do these MPC backups tests. So a 'T' must be added in front of mptcp_subflow_send_ack. Fixes: 632978f0a961 ("selftests: mptcp: join: skip MPC backups tests if not supported") Cc: stable@vger.kernel.org Signed-off-by: Geliang Tang Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Signed-off-by: David S. Miller commit 0e389834672c723435a44818ed2cabc4dad24429 Merge: accc98aff5c39 a8892fd719331 Author: Linus Torvalds Date: Sun Dec 17 09:27:36 2023 -0800 Merge tag 'for-6.7-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fix from David Sterba: "One more fix that verifies that the snapshot source is a root, same check is also done in user space but should be done by the ioctl as well" * tag 'for-6.7-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: do not allow non subvolume root targets for snapshot commit accc98aff5c39fdc63bf0bac471b9c601aaf4755 Merge: 7f499ec27ca25 393cae5f32d64 Author: Linus Torvalds Date: Sun Dec 17 09:24:06 2023 -0800 Merge tag 'soundwire-6.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire Pull soundwire fixes from Vinod Koul: - Null pointer dereference for mult link in core - AC timing fix in intel driver * tag 'soundwire-6.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: intel_ace2x: fix AC timing setting for ACE2.x soundwire: stream: fix NULL pointer dereference for multi_link commit 7f499ec27ca25c7faad74e15a6e2c72a1ea3e63c Merge: 6d04b70ea48b2 2a9c713825b31 Author: Linus Torvalds Date: Sun Dec 17 09:19:27 2023 -0800 Merge tag 'phy-fixes-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy Pull phy fixes from Vinod Koul: - register offset fix for TI driver - mediatek driver minimal supported frequency fix - negative error code in probe fix for sunplus driver * tag 'phy-fixes-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: phy: sunplus: return negative error code in sp_usb_phy_probe phy: mediatek: mipi: mt8183: fix minimal supported frequency phy: ti: gmii-sel: Fix register offset when parent is not a syscon node commit 6d04b70ea48b2d84ebf6cd9ad9b01ba50a58542e Merge: 134fdb80bc130 4ee632c82d2db Author: Linus Torvalds Date: Sun Dec 17 09:11:32 2023 -0800 Merge tag 'dmaengine-fix-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine Pull dmaengine fixes from Vinod Koul: - SPI PDMA data fix for TI k3-psil drivers - suspend fix, pointer check, logic for arbitration fix and channel leak fix in fsl-edma driver - couple of fixes in idxd driver for GRPCFG descriptions and int_handle field handling - single fix for stm32 driver for bitfield overflow * tag 'dmaengine-fix-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: dmaengine: fsl-edma: fix DMA channel leak in eDMAv4 dmaengine: fsl-edma: fix wrong pointer check in fsl_edma3_attach_pd() dmaengine: idxd: Fix incorrect descriptions for GRPCFG register dmaengine: idxd: Protect int_handle field in hw descriptor dmaengine: stm32-dma: avoid bitfield overflow assertion dmaengine: fsl-edma: Add judgment on enabling round robin arbitration dmaengine: fsl-edma: Do not suspend and resume the masked dma channel when the system is sleeping dmaengine: ti: k3-psil-am62a: Fix SPI PDMA data dmaengine: ti: k3-psil-am62: Fix SPI PDMA data commit 134fdb80bc130dba429295ac64358b16b695628c Merge: ef6a7c27db54f ef3d5cf9c59cc Author: Linus Torvalds Date: Sun Dec 17 09:07:34 2023 -0800 Merge tag 'cxl-fixes-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl Pull CXL (Compute Express Link) fixes from Dan Williams: "A collection of CXL fixes. The touch outside of drivers/cxl/ is for a helper that allocates physical address space. Device hotplug tests showed that the driver failed to utilize (skipped over) valid capacity when allocating a new memory region. Outside of that, new tests uncovered a small crop of lockdep reports. There is also some miscellaneous error path and leak fixups that are not urgent, but useful to cleanup now. - Fix alloc_free_mem_region()'s scan for address space, prevent false negative out-of-space events - Fix sleeping lock acquisition from CXL trace event (atomic context) - Fix put_device() like for the new CXL PMU driver - Fix wrong pointer freed on error path - Fixup several lockdep reports (missing lock hold) from new assertion in cxl_num_decoders_committed() and new tests" * tag 'cxl-fixes-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: cxl/pmu: Ensure put_device on pmu devices cxl/cdat: Free correct buffer on checksum error cxl/hdm: Fix dpa translation locking kernel/resource: Increment by align value in get_free_mem_region() cxl: Add cxl_num_decoders_committed() usage to cxl_test cxl/memdev: Hold region_rwsem during inject and clear poison ops cxl/core: Always hold region_rwsem while reading poison lists cxl/hdm: Fix a benign lockdep splat commit ef6a7c27db54f06cc5c79f5a756d649828d42f3d Merge: 5ef3720d91285 9483aa44912f2 Author: Linus Torvalds Date: Sun Dec 17 09:02:20 2023 -0800 Merge tag 'edac_urgent_for_v6.7_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC fix from Borislav Petkov: - A single fix for the EDAC Versal driver to read out register fields properly * tag 'edac_urgent_for_v6.7_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/versal: Read num_csrows and num_chans using the correct bitfield macro commit 5ef3720d91285f7ebc49d17366b366818516b768 Merge: dde0672bfa3e5 d2441d3e8c0c0 Author: Linus Torvalds Date: Sun Dec 17 08:50:00 2023 -0800 Merge tag 'powerpc-6.7-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix a bug where heavy VAS (accelerator) usage could race with partition migration and prevent the migration from completing. - Update MAINTAINERS to add Aneesh & Naveen. Thanks to Haren Myneni. * tag 'powerpc-6.7-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: MAINTAINERS: powerpc: Add Aneesh & Naveen powerpc/pseries/vas: Migration suspend waits for no in-progress open windows commit 413ba91089c74207313b315e04cf381ffb5b20e4 Author: Amir Goldstein Date: Sun Dec 17 11:08:52 2023 +0200 ovl: fix dentry reference leak after changes to underlying layers syzbot excercised the forbidden practice of moving the workdir under lowerdir while overlayfs is mounted and tripped a dentry reference leak. Fixes: c63e56a4a652 ("ovl: do not open/llseek lower file with upper sb_writers held") Reported-and-tested-by: syzbot+8608bb4553edb8c78f41@syzkaller.appspotmail.com Signed-off-by: Amir Goldstein commit dde0672bfa3e5c5e8530ebb45518408acb91b083 Merge: 3b8a9b2e6809d 8defec031c409 Author: Linus Torvalds Date: Sat Dec 16 16:57:55 2023 -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 handful of clk fixes, mostly in the rockchip clk driver: - Fix a clk name, clk parent, and a register for a clk gate in the Rockchip rk3128 clk driver - Add a PLL frequency on Rockchip rk3568 to fix some display artifacts - Fix a kbuild dependency for Qualcomm's SM_CAMCC_8550 symbol so that it isn't possible to select the associated GCC driver" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: rockchip: rk3128: Fix SCLK_SDMMC's clock name clk: rockchip: rk3128: Fix aclk_peri_src's parent clk: qcom: Fix SM_CAMCC_8550 dependencies clk: rockchip: rk3128: Fix HCLK_OTG gate register clk: rockchip: rk3568: Add PLL rate for 292.5MHz commit 3b8a9b2e6809d281890dd0a1102dc14d2cd11caf Merge: c8e97fc6b4c05 712292308af22 Author: Linus Torvalds Date: Sat Dec 16 10:40:51 2023 -0800 Merge tag 'trace-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt: - Fix eventfs to check creating new files for events with names greater than NAME_MAX. The eventfs lookup needs to check the return result of simple_lookup(). - Fix the ring buffer to check the proper max data size. Events must be able to fit on the ring buffer sub-buffer, if it cannot, then it fails to be written and the logic to add the event is avoided. The code to check if an event can fit failed to add the possible absolute timestamp which may make the event not be able to fit. This causes the ring buffer to go into an infinite loop trying to find a sub-buffer that would fit the event. Luckily, there's a check that will bail out if it looped over a 1000 times and it also warns. The real fix is not to add the absolute timestamp to an event that is starting at the beginning of a sub-buffer because it uses the sub-buffer timestamp. By avoiding the timestamp at the start of the sub-buffer allows events that pass the first check to always find a sub-buffer that it can fit on. - Have large events that do not fit on a trace_seq to print "LINE TOO BIG" like it does for the trace_pipe instead of what it does now which is to silently drop the output. - Fix a memory leak of forgetting to free the spare page that is saved by a trace instance. - Update the size of the snapshot buffer when the main buffer is updated if the snapshot buffer is allocated. - Fix ring buffer timestamp logic by removing all the places that tried to put the before_stamp back to the write stamp so that the next event doesn't add an absolute timestamp. But each of these updates added a race where by making the two timestamp equal, it was validating the write_stamp so that it can be incorrectly used for calculating the delta of an event. - There's a temp buffer used for printing the event that was using the event data size for allocation when it needed to use the size of the entire event (meta-data and payload data) - For hardening, use "%.*s" for printing the trace_marker output, to limit the amount that is printed by the size of the event. This was discovered by development that added a bug that truncated the '\0' and caused a crash. - Fix a use-after-free bug in the use of the histogram files when an instance is being removed. - Remove a useless update in the rb_try_to_discard of the write_stamp. The before_stamp was already changed to force the next event to add an absolute timestamp that the write_stamp is not used. But the write_stamp is modified again using an unneeded 64-bit cmpxchg. - Fix several races in the 32-bit implementation of the rb_time_cmpxchg() that does a 64-bit cmpxchg. - While looking at fixing the 64-bit cmpxchg, I noticed that because the ring buffer uses normal cmpxchg, and this can be done in NMI context, there's some architectures that do not have a working cmpxchg in NMI context. For these architectures, fail recording events that happen in NMI context. * tag 'trace-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI ring-buffer: Have rb_time_cmpxchg() set the msb counter too ring-buffer: Fix 32-bit rb_time_read() race with rb_time_cmpxchg() ring-buffer: Fix a race in rb_time_cmpxchg() for 32 bit archs ring-buffer: Remove useless update to write_stamp in rb_try_to_discard() ring-buffer: Do not try to put back write_stamp tracing: Fix uaf issue when open the hist or hist_debug file tracing: Add size check when printing trace_marker output ring-buffer: Have saved event hold the entire event ring-buffer: Do not update before stamp when switching sub-buffers tracing: Update snapshot buffer on resize if it is allocated ring-buffer: Fix memory leak of free page eventfs: Fix events beyond NAME_MAX blocking tasks tracing: Have large events show up as '[LINE TOO BIG]' instead of nothing ring-buffer: Fix writing to the buffer with max_data_size commit c8e97fc6b4c057a350a9e9a1ad625e10cc9c39ee Merge: 2e3f280b24ea8 3c0696076aad6 Author: Linus Torvalds Date: Fri Dec 15 19:59:03 2023 -0800 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - Arm CMN perf: fix the DTC allocation failure path which can end up erroneously clearing live counters - arm64/mm: fix hugetlb handling of the dirty page state leading to a continuous fault loop in user on hardware without dirty bit management (DBM). That's caused by the dirty+writeable information not being properly preserved across a series of mprotect(PROT_NONE), mprotect(PROT_READ|PROT_WRITE) * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: mm: Always make sw-dirty PTEs hw-dirty in pte_modify perf/arm-cmn: Fail DTC counter allocation correctly commit 2e3f280b24ea89f6f061c8b56771b06351c7745d Merge: ae1914174a63a 5df12742b7e3a Author: Linus Torvalds Date: Fri Dec 15 19:48:47 2023 -0800 Merge tag 'pci-v6.7-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci Pull pci fixes from Bjorn Helgaas: - Limit Max_Read_Request_Size (MRRS) on some MIPS Loongson systems because they don't all support MRRS > 256, and firmware doesn't always initialize it correctly, which meant some PCIe devices didn't work (Jiaxun Yang) - Add and use pci_enable_link_state_locked() to prevent potential deadlocks in vmd and qcom drivers (Johan Hovold) - Revert recent (v6.5) acpiphp resource assignment changes that fixed issues with hot-adding devices on a root bus or with large BARs, but introduced new issues with GPU initialization and hot-adding SCSI disks in QEMU VMs and (Bjorn Helgaas) * tag 'pci-v6.7-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: Revert "PCI: acpiphp: Reassign resources on bridge if necessary" PCI/ASPM: Add pci_disable_link_state_locked() lockdep assert PCI/ASPM: Clean up __pci_disable_link_state() 'sem' parameter PCI: qcom: Clean up ASPM comment PCI: qcom: Fix potential deadlock when enabling ASPM PCI: vmd: Fix potential deadlock when enabling ASPM PCI/ASPM: Add pci_enable_link_state_locked() PCI: loongson: Limit MRRS to 256 commit b1dfc0f76231bbf395c59d20a2070684620d5d0f Author: Daniel Golle Date: Tue Dec 12 00:05:35 2023 +0000 net: phy: skip LED triggers on PHYs on SFP modules Calling led_trigger_register() when attaching a PHY located on an SFP module potentially (and practically) leads into a deadlock. Fix this by not calling led_trigger_register() for PHYs localted on SFP modules as such modules actually never got any LEDs. ====================================================== WARNING: possible circular locking dependency detected 6.7.0-rc4-next-20231208+ #0 Tainted: G O ------------------------------------------------------ kworker/u8:2/43 is trying to acquire lock: ffffffc08108c4e8 (triggers_list_lock){++++}-{3:3}, at: led_trigger_register+0x4c/0x1a8 but task is already holding lock: ffffff80c5c6f318 (&sfp->sm_mutex){+.+.}-{3:3}, at: cleanup_module+0x2ba8/0x3120 [sfp] which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&sfp->sm_mutex){+.+.}-{3:3}: __mutex_lock+0x88/0x7a0 mutex_lock_nested+0x20/0x28 cleanup_module+0x2ae0/0x3120 [sfp] sfp_register_bus+0x5c/0x9c sfp_register_socket+0x48/0xd4 cleanup_module+0x271c/0x3120 [sfp] platform_probe+0x64/0xb8 really_probe+0x17c/0x3c0 __driver_probe_device+0x78/0x164 driver_probe_device+0x3c/0xd4 __driver_attach+0xec/0x1f0 bus_for_each_dev+0x60/0xa0 driver_attach+0x20/0x28 bus_add_driver+0x108/0x208 driver_register+0x5c/0x118 __platform_driver_register+0x24/0x2c init_module+0x28/0xa7c [sfp] do_one_initcall+0x70/0x2ec do_init_module+0x54/0x1e4 load_module+0x1b78/0x1c8c __do_sys_init_module+0x1bc/0x2cc __arm64_sys_init_module+0x18/0x20 invoke_syscall.constprop.0+0x4c/0xdc do_el0_svc+0x3c/0xbc el0_svc+0x34/0x80 el0t_64_sync_handler+0xf8/0x124 el0t_64_sync+0x150/0x154 -> #2 (rtnl_mutex){+.+.}-{3:3}: __mutex_lock+0x88/0x7a0 mutex_lock_nested+0x20/0x28 rtnl_lock+0x18/0x20 set_device_name+0x30/0x130 netdev_trig_activate+0x13c/0x1ac led_trigger_set+0x118/0x234 led_trigger_write+0x104/0x17c sysfs_kf_bin_write+0x64/0x80 kernfs_fop_write_iter+0x128/0x1b4 vfs_write+0x178/0x2a4 ksys_write+0x58/0xd4 __arm64_sys_write+0x18/0x20 invoke_syscall.constprop.0+0x4c/0xdc do_el0_svc+0x3c/0xbc el0_svc+0x34/0x80 el0t_64_sync_handler+0xf8/0x124 el0t_64_sync+0x150/0x154 -> #1 (&led_cdev->trigger_lock){++++}-{3:3}: down_write+0x4c/0x13c led_trigger_write+0xf8/0x17c sysfs_kf_bin_write+0x64/0x80 kernfs_fop_write_iter+0x128/0x1b4 vfs_write+0x178/0x2a4 ksys_write+0x58/0xd4 __arm64_sys_write+0x18/0x20 invoke_syscall.constprop.0+0x4c/0xdc do_el0_svc+0x3c/0xbc el0_svc+0x34/0x80 el0t_64_sync_handler+0xf8/0x124 el0t_64_sync+0x150/0x154 -> #0 (triggers_list_lock){++++}-{3:3}: __lock_acquire+0x12a0/0x2014 lock_acquire+0x100/0x2ac down_write+0x4c/0x13c led_trigger_register+0x4c/0x1a8 phy_led_triggers_register+0x9c/0x214 phy_attach_direct+0x154/0x36c phylink_attach_phy+0x30/0x60 phylink_sfp_connect_phy+0x140/0x510 sfp_add_phy+0x34/0x50 init_module+0x15c/0xa7c [sfp] cleanup_module+0x1d94/0x3120 [sfp] cleanup_module+0x2bb4/0x3120 [sfp] process_one_work+0x1f8/0x4ec worker_thread+0x1e8/0x3d8 kthread+0x104/0x110 ret_from_fork+0x10/0x20 other info that might help us debug this: Chain exists of: triggers_list_lock --> rtnl_mutex --> &sfp->sm_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sfp->sm_mutex); lock(rtnl_mutex); lock(&sfp->sm_mutex); lock(triggers_list_lock); *** DEADLOCK *** 4 locks held by kworker/u8:2/43: #0: ffffff80c000f938 ((wq_completion)events_power_efficient){+.+.}-{0:0}, at: process_one_work+0x150/0x4ec #1: ffffffc08214bde8 ((work_completion)(&(&sfp->timeout)->work)){+.+.}-{0:0}, at: process_one_work+0x150/0x4ec #2: ffffffc0810902f8 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock+0x18/0x20 #3: ffffff80c5c6f318 (&sfp->sm_mutex){+.+.}-{3:3}, at: cleanup_module+0x2ba8/0x3120 [sfp] stack backtrace: CPU: 0 PID: 43 Comm: kworker/u8:2 Tainted: G O 6.7.0-rc4-next-20231208+ #0 Hardware name: Bananapi BPI-R4 (DT) Workqueue: events_power_efficient cleanup_module [sfp] Call trace: dump_backtrace+0xa8/0x10c show_stack+0x14/0x1c dump_stack_lvl+0x5c/0xa0 dump_stack+0x14/0x1c print_circular_bug+0x328/0x430 check_noncircular+0x124/0x134 __lock_acquire+0x12a0/0x2014 lock_acquire+0x100/0x2ac down_write+0x4c/0x13c led_trigger_register+0x4c/0x1a8 phy_led_triggers_register+0x9c/0x214 phy_attach_direct+0x154/0x36c phylink_attach_phy+0x30/0x60 phylink_sfp_connect_phy+0x140/0x510 sfp_add_phy+0x34/0x50 init_module+0x15c/0xa7c [sfp] cleanup_module+0x1d94/0x3120 [sfp] cleanup_module+0x2bb4/0x3120 [sfp] process_one_work+0x1f8/0x4ec worker_thread+0x1e8/0x3d8 kthread+0x104/0x110 ret_from_fork+0x10/0x20 Signed-off-by: Daniel Golle Fixes: 01e5b728e9e4 ("net: phy: Add a binding for PHY LEDs") Link: https://lore.kernel.org/r/102a9dce38bdf00215735d04cd4704458273ad9c.1702339354.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski commit 117211aa739a926e6555cfea883be84bee6f1695 Author: Jiri Olsa Date: Sat Dec 16 00:05:02 2023 +0100 bpf: Add missing BPF_LINK_TYPE invocations Pengfei Xu reported [1] Syzkaller/KASAN issue found in bpf_link_show_fdinfo. The reason is missing BPF_LINK_TYPE invocation for uprobe multi link and for several other links, adding that. [1] https://lore.kernel.org/bpf/ZXptoKRSLspnk2ie@xpf.sh.intel.com/ Fixes: 89ae89f53d20 ("bpf: Add multi uprobe link") Fixes: e420bed02507 ("bpf: Add fd-based tcx multi-prog infra with link support") Fixes: 84601d6ee68a ("bpf: add bpf_link support for BPF_NETFILTER programs") Fixes: 35dfaad7188c ("netkit, bpf: Add bpf programmable net device") Reported-by: Pengfei Xu Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Tested-by: Pengfei Xu Acked-by: Hou Tao Link: https://lore.kernel.org/bpf/20231215230502.2769743-1-jolsa@kernel.org commit a8892fd71933126ebae3d60aec5918d4dceaae76 Author: Josef Bacik Date: Fri Dec 15 10:01:44 2023 -0500 btrfs: do not allow non subvolume root targets for snapshot Our btrfs subvolume snapshot utility enforces that is the root of the subvolume, however this isn't enforced in the kernel. Update the kernel to also enforce this limitation to avoid problems with other users of this ioctl that don't have the appropriate checks in place. Reported-by: Martin Michaelis CC: stable@vger.kernel.org # 4.14+ Reviewed-by: Neal Gompa Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit ae1914174a63a558113e80d24ccac2773f9f7b2b Author: Jens Axboe Date: Fri Dec 15 13:40:57 2023 -0700 cred: get rid of CONFIG_DEBUG_CREDENTIALS This code is rarely (never?) enabled by distros, and it hasn't caught anything in decades. Let's kill off this legacy debug code. Suggested-by: Linus Torvalds Signed-off-by: Jens Axboe Signed-off-by: Linus Torvalds commit f8fa5d76925991976b3e7076f9d1052515ec1fca Author: Jens Axboe Date: Fri Dec 15 13:24:10 2023 -0700 cred: switch to using atomic_long_t There are multiple ways to grab references to credentials, and the only protection we have against overflowing it is the memory required to do so. With memory sizes only moving in one direction, let's bump the reference count to 64-bit and move it outside the realm of feasibly overflowing. Signed-off-by: Jens Axboe Signed-off-by: Linus Torvalds commit 5df12742b7e3aae2594a30a9d14d5d6e9e7699f4 Author: Bjorn Helgaas Date: Thu Dec 14 09:08:56 2023 -0600 Revert "PCI: acpiphp: Reassign resources on bridge if necessary" This reverts commit 40613da52b13fb21c5566f10b287e0ca8c12c4e9 and the subsequent fix to it: cc22522fd55e ("PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus") 40613da52b13 fixed a problem where hot-adding a device with large BARs failed if the bridge windows programmed by firmware were not large enough. cc22522fd55e ("PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus") fixed a problem with 40613da52b13: an ACPI hot-add of a device on a PCI root bus (common in the virt world) or firmware sending ACPI Bus Check to non-existent Root Ports (e.g., on Dell Inspiron 7352/0W6WV0) caused a NULL pointer dereference and suspend/resume hangs. Unfortunately the combination of 40613da52b13 and cc22522fd55e caused other problems: - Fiona reported that hot-add of SCSI disks in QEMU virtual machine fails sometimes. - Dongli reported a similar problem with hot-add of SCSI disks. - Jonathan reported a console freeze during boot on bare metal due to an error in radeon GPU initialization. Revert both patches to avoid adding these problems. This means we will again see the problems with hot-adding devices with large BARs and the NULL pointer dereferences and suspend/resume issues that 40613da52b13 and cc22522fd55e were intended to fix. Fixes: 40613da52b13 ("PCI: acpiphp: Reassign resources on bridge if necessary") Fixes: cc22522fd55e ("PCI: acpiphp: Use pci_assign_unassigned_bridge_resources() only for non-root bus") Reported-by: Fiona Ebner Closes: https://lore.kernel.org/r/9eb669c0-d8f2-431d-a700-6da13053ae54@proxmox.com Reported-by: Dongli Zhang Closes: https://lore.kernel.org/r/3c4a446a-b167-11b8-f36f-d3c1b49b42e9@oracle.com Reported-by: Jonathan Woithe Closes: https://lore.kernel.org/r/ZXpaNCLiDM+Kv38H@marvin.atrad.com.au Signed-off-by: Bjorn Helgaas Acked-by: Michael S. Tsirkin Acked-by: Igor Mammedov Cc: commit 3bd7d748816927202268cb335921f7f68b3ca723 Merge: a62aa88ba1a38 1ba0e9d69b200 Author: Linus Torvalds Date: Fri Dec 15 12:20:14 2023 -0800 Merge tag 'io_uring-6.7-2023-12-15' of git://git.kernel.dk/linux Pull io_uring fixes from Jens Axboe: "Just two minor fixes: - Fix for the io_uring socket option commands using the wrong value on some archs (Al) - Tweak to the poll lazy wake enable (me)" * tag 'io_uring-6.7-2023-12-15' of git://git.kernel.dk/linux: io_uring/cmd: fix breakage in SOCKET_URING_OP_SIOC* implementation io_uring/poll: don't enable lazy wake for POLLEXCLUSIVE commit a62aa88ba1a386e9b6953083b1ceb2fe027238b9 Merge: 26e7a301419d2 4376807bf2d53 Author: Linus Torvalds Date: Fri Dec 15 12:00:54 2023 -0800 Merge tag 'mm-hotfixes-stable-2023-12-15-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc fixes from Andrew Morton: "17 hotfixes. 8 are cc:stable and the other 9 pertain to post-6.6 issues" * tag 'mm-hotfixes-stable-2023-12-15-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mm/mglru: reclaim offlined memcgs harder mm/mglru: respect min_ttl_ms with memcgs mm/mglru: try to stop at high watermarks mm/mglru: fix underprotected page cache mm/shmem: fix race in shmem_undo_range w/THP Revert "selftests: error out if kernel header files are not yet built" crash_core: fix the check for whether crashkernel is from high memory x86, kexec: fix the wrong ifdeffery CONFIG_KEXEC sh, kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC mips, kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC m68k, kexec: fix the incorrect ifdeffery and build dependency of CONFIG_KEXEC loongarch, kexec: change dependency of object files mm/damon/core: make damon_start() waits until kdamond_fn() starts selftests/mm: cow: print ksft header before printing anything else mm: fix VMA heap bounds checking riscv: fix VMALLOC_START definition kexec: drop dependency on ARCH_SUPPORTS_KEXEC from CRASH_DUMP commit 26e7a301419d2ef4696e581109c61b4e772e1fb8 Merge: 595609b2ad023 315deab289924 Author: Linus Torvalds Date: Fri Dec 15 11:35:55 2023 -0800 Merge tag 'sound-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of HD-audio quirks for TAS2781 codec and device-specific workarounds" * tag 'sound-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/tas2781: reset the amp before component_add ALSA: hda/tas2781: call cleanup functions only once ALSA: hda/tas2781: handle missing EFI calibration data ALSA: hda/tas2781: leave hda_component in usable state ALSA: hda/realtek: Apply mute LED quirk for HP15-db ALSA: hda/hdmi: add force-connect quirks for ASUSTeK Z170 variants ALSA: hda/hdmi: add force-connect quirk for NUC5CPYB commit 595609b2ad023088dfd0ae74abb4602ea267e739 Merge: 3f7168591ebf7 7ba84cbf18c7a Author: Linus Torvalds Date: Fri Dec 15 11:07:13 2023 -0800 Merge tag 'drm-fixes-2023-12-15' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "More regular fixes, amdgpu, i915, mediatek and nouveau are most of them this week. Nothing too major, then a few misc bits and pieces in core, panel and ivpu. drm: - fix uninit problems in crtc - fix fd ownership check - edid: add modes in fallback paths panel: - move LG panel into DSI yaml - ltk050h3146w: set burst mode mediatek: - mtk_disp_gamma: Fix breakage due to merge issue - fix kernel oops if no crtc is found - Add spinlock for setting vblank event in atomic_begin - Fix access violation in mtk_drm_crtc_dma_dev_get i915: - Fix selftest engine reset count storage for multi-tile - Fix out-of-bounds reads for engine reset counts - Fix ADL+ remapped stride with CCS - Fix intel_atomic_setup_scalers() plane_state handling - Fix ADL+ tiled plane stride when the POT stride is smaller than the original - Fix eDP 1.4 rate select method link configuration amdgpu: - Fix suspend fix that got accidently mangled last week - Fix OD regression - PSR fixes - OLED Backlight regression fix - JPEG 4.0.5 fix - Misc display fixes - SDMA 5.2 fix - SDMA 2.4 regression fix - GPUVM race fix nouveau: - fix gk20a instobj hierarchy - fix headless iors inheritance regression ivpu: - fix WA initialisation" * tag 'drm-fixes-2023-12-15' of git://anongit.freedesktop.org/drm/drm: (31 commits) drm/nouveau/kms/nv50-: Don't allow inheritance of headless iors drm/nouveau: Fixup gk20a instobj hierarchy drm/amdgpu: warn when there are still mappings when a BO is destroyed v2 drm/amdgpu: fix tear down order in amdgpu_vm_pt_free drm/amd: Fix a probing order problem on SDMA 2.4 drm/amdgpu/sdma5.2: add begin/end_use ring callbacks drm/panel: ltk050h3146w: Set burst mode for ltk050h3148w dt-bindings: panel-simple-dsi: move LG 5" HD TFT LCD panel into DSI yaml drm/amd/display: Disable PSR-SU on Parade 0803 TCON again drm/amd/display: Populate dtbclk from bounding box drm/amd/display: Revert "Fix conversions between bytes and KB" drm/amdgpu/jpeg: configure doorbell for each playback drm/amd/display: Restore guard against default backlight value < 1 nit drm/amd/display: fix hw rotated modes when PSR-SU is enabled drm/amd/pm: fix pp_*clk_od typo drm/amdgpu: fix buffer funcs setting order on suspend harder drm/mediatek: Fix access violation in mtk_drm_crtc_dma_dev_get drm/edid: also call add modes in EDID connector update fallback drm/i915/edp: don't write to DP_LINK_BW_SET when using rate select drm/i915: Fix ADL+ tiled plane stride when the POT stride is smaller than the original ... commit 2dc4196138055eb0340231aecac4d78c2ec2bea5 Author: Thomas Gleixner Date: Thu Dec 7 20:49:26 2023 +0100 x86/alternatives: Disable interrupts and sync when optimizing NOPs in place apply_alternatives() treats alternatives with the ALT_FLAG_NOT flag set special as it optimizes the existing NOPs in place. Unfortunately, this happens with interrupts enabled and does not provide any form of core synchronization. So an interrupt hitting in the middle of the update and using the affected code path will observe a half updated NOP and crash and burn. The following 3 NOP sequence was observed to expose this crash halfway reliably under QEMU 32bit: 0x90 0x90 0x90 which is replaced by the optimized 3 byte NOP: 0x8d 0x76 0x00 So an interrupt can observe: 1) 0x90 0x90 0x90 nop nop nop 2) 0x8d 0x90 0x90 undefined 3) 0x8d 0x76 0x90 lea -0x70(%esi),%esi 4) 0x8d 0x76 0x00 lea 0x0(%esi),%esi Where only #1 and #4 are true NOPs. The same problem exists for 64bit obviously. Disable interrupts around this NOP optimization and invoke sync_core() before re-enabling them. Fixes: 270a69c4485d ("x86/alternative: Support relocations in alternatives") Reported-by: Paul Gortmaker Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Acked-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/ZT6narvE%2BLxX%2B7Be@windriver.com commit 3ea1704a92967834bf0e64ca1205db4680d04048 Author: Thomas Gleixner Date: Thu Dec 7 20:49:24 2023 +0100 x86/alternatives: Sync core before enabling interrupts text_poke_early() does: local_irq_save(flags); memcpy(addr, opcode, len); local_irq_restore(flags); sync_core(); That's not really correct because the synchronization should happen before interrupts are re-enabled to ensure that a pending interrupt observes the complete update of the opcodes. It's not entirely clear whether the interrupt entry provides enough serialization already, but moving the sync_core() invocation into interrupt disabled region does no harm and is obviously correct. Fixes: 6fffacb30349 ("x86/alternatives, jumplabel: Use text_poke_early() before mm_init()") Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Acked-by: Peter Zijlstra (Intel) Cc: Link: https://lore.kernel.org/r/ZT6narvE%2BLxX%2B7Be@windriver.com commit 69a7386c1ec25476a0c78ffeb59de08a2a08f495 Author: Thomas Gleixner Date: Fri Dec 15 09:58:58 2023 +0100 x86/smpboot/64: Handle X2APIC BIOS inconsistency gracefully Chris reported that a Dell PowerEdge T340 system stopped to boot when upgrading to a kernel which contains the parallel hotplug changes. Disabling parallel hotplug on the kernel command line makes it boot again. It turns out that the Dell BIOS has x2APIC enabled and the boot CPU comes up in X2APIC mode, but the APs come up inconsistently in xAPIC mode. Parallel hotplug requires that the upcoming CPU reads out its APIC ID from the local APIC in order to map it to the Linux CPU number. In this particular case the readout on the APs uses the MMIO mapped registers because the BIOS failed to enable x2APIC mode. That readout results in a page fault because the kernel does not have the APIC MMIO space mapped when X2APIC mode was enabled by the BIOS on the boot CPU and the kernel switched to X2APIC mode early. That page fault can't be handled on the upcoming CPU that early and results in a silent boot failure. If parallel hotplug is disabled the system boots because in that case the APIC ID read is not required as the Linux CPU number is provided to the AP in the smpboot control word. When the kernel uses x2APIC mode then the APs are switched to x2APIC mode too slightly later in the bringup process, but there is no reason to do it that late. Cure the BIOS bogosity by checking in the parallel bootup path whether the kernel uses x2APIC mode and if so switching over the APs to x2APIC mode before the APIC ID readout. Fixes: 0c7ffa32dbd6 ("x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it") Reported-by: Chris Lindee Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Ashok Raj Tested-by: Chris Lindee Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/CA%2B2tU59853R49EaU_tyvOZuOTDdcU0RshGyydccp9R1NX9bEeQ@mail.gmail.com commit 23c93c3b6275a59f2a685f4a693944b53c31df4e Author: Andy Gospodarek Date: Thu Dec 14 13:31:38 2023 -0800 bnxt_en: do not map packet buffers twice Remove double-mapping of DMA buffers as it can prevent page pool entries from being freed. Mapping is managed by page pool infrastructure and was previously managed by the driver in __bnxt_alloc_rx_page before allowing the page pool infrastructure to manage it. Fixes: 578fcfd26e2a ("bnxt_en: Let the page pool manage the DMA mapping") Reviewed-by: Somnath Kotur Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Reviewed-by: David Wei Link: https://lore.kernel.org/r/20231214213138.98095-1-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit 4c8874c2a6512b9fe7285cab1a6910d9211a6cfb Author: Jeffrey Hugo Date: Fri Dec 8 09:31:01 2023 -0700 accel/qaic: Implement quirk for SOC_HW_VERSION The SOC_HW_VERSION register in the BHI space is not correctly initialized by the device and in many cases contains uninitialized data. The register could contain 0xFFFFFFFF which is a special value to indicate a link error in PCIe, therefore if observed, we could incorrectly think the device is down. Intercept reads for this register, and provide the correct value - every production instance would read 0x60110200 if the device was operating as intended. Fixes: a36bf7af868b ("accel/qaic: Add MHI controller") Signed-off-by: Jeffrey Hugo Reviewed-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Jacek Lawrynowicz Link: https://patchwork.freedesktop.org/patch/msgid/20231208163101.1295769-3-quic_jhugo@quicinc.com commit c8b6f4ad2ff9c6d88cdeb9acf16d0c4a323dd499 Author: Pranjal Ramajor Asha Kanojiya Date: Fri Dec 8 09:31:00 2023 -0700 accel/qaic: Fix GEM import path code Do not modify the size of dmabuf as it is immutable. Fixes: ff13be830333 ("accel/qaic: Add datapath") Signed-off-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Jeffrey Hugo Signed-off-by: Jeffrey Hugo Reviewed-by: Jacek Lawrynowicz Link: https://patchwork.freedesktop.org/patch/msgid/20231208163101.1295769-2-quic_jhugo@quicinc.com commit 2e07e8348ea454615e268222ae3fc240421be768 Author: Hyunwoo Kim Date: Sat Dec 9 05:55:18 2023 -0500 Bluetooth: af_bluetooth: Fix Use-After-Free in bt_sock_recvmsg This can cause a race with bt_sock_ioctl() because bt_sock_recvmsg() gets the skb from sk->sk_receive_queue and then frees it without holding lock_sock. A use-after-free for a skb occurs with the following flow. ``` bt_sock_recvmsg() -> skb_recv_datagram() -> skb_free_datagram() bt_sock_ioctl() -> skb_peek() ``` Add lock_sock to bt_sock_recvmsg() to fix this issue. Cc: stable@vger.kernel.org Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Hyunwoo Kim Signed-off-by: Luiz Augusto von Dentz commit 04a342cc49a8522e99c9b3346371c329d841dcd2 Author: Alex Lu Date: Tue Dec 12 10:30:34 2023 +0800 Bluetooth: Add more enc key size check When we are slave role and receives l2cap conn req when encryption has started, we should check the enc key size to avoid KNOB attack or BLUFFS attack. From SIG recommendation, implementations are advised to reject service-level connections on an encrypted baseband link with key strengths below 7 octets. A simple and clear way to achieve this is to place the enc key size check in hci_cc_read_enc_key_size() The btmon log below shows the case that lacks enc key size check. > HCI Event: Connect Request (0x04) plen 10 Address: BB:22:33:44:55:99 (OUI BB-22-33) Class: 0x480104 Major class: Computer (desktop, notebook, PDA, organizers) Minor class: Desktop workstation Capturing (Scanner, Microphone) Telephony (Cordless telephony, Modem, Headset) Link type: ACL (0x01) < HCI Command: Accept Connection Request (0x01|0x0009) plen 7 Address: BB:22:33:44:55:99 (OUI BB-22-33) Role: Peripheral (0x01) > HCI Event: Command Status (0x0f) plen 4 Accept Connection Request (0x01|0x0009) ncmd 2 Status: Success (0x00) > HCI Event: Connect Complete (0x03) plen 11 Status: Success (0x00) Handle: 1 Address: BB:22:33:44:55:99 (OUI BB-22-33) Link type: ACL (0x01) Encryption: Disabled (0x00) ... > HCI Event: Encryption Change (0x08) plen 4 Status: Success (0x00) Handle: 1 Address: BB:22:33:44:55:99 (OUI BB-22-33) Encryption: Enabled with E0 (0x01) < HCI Command: Read Encryption Key Size (0x05|0x0008) plen 2 Handle: 1 Address: BB:22:33:44:55:99 (OUI BB-22-33) > HCI Event: Command Complete (0x0e) plen 7 Read Encryption Key Size (0x05|0x0008) ncmd 2 Status: Success (0x00) Handle: 1 Address: BB:22:33:44:55:99 (OUI BB-22-33) Key size: 6 // We should check the enc key size ... > ACL Data RX: Handle 1 flags 0x02 dlen 12 L2CAP: Connection Request (0x02) ident 3 len 4 PSM: 25 (0x0019) Source CID: 64 < ACL Data TX: Handle 1 flags 0x00 dlen 16 L2CAP: Connection Response (0x03) ident 3 len 8 Destination CID: 64 Source CID: 64 Result: Connection pending (0x0001) Status: Authorization pending (0x0002) > HCI Event: Number of Completed Packets (0x13) plen 5 Num handles: 1 Handle: 1 Address: BB:22:33:44:55:99 (OUI BB-22-33) Count: 1 #35: len 16 (25 Kb/s) Latency: 5 msec (2-7 msec ~4 msec) < ACL Data TX: Handle 1 flags 0x00 dlen 16 L2CAP: Connection Response (0x03) ident 3 len 8 Destination CID: 64 Source CID: 64 Result: Connection successful (0x0000) Status: No further information available (0x0000) Cc: stable@vger.kernel.org Signed-off-by: Alex Lu Signed-off-by: Max Chou Signed-off-by: Luiz Augusto von Dentz commit 59b047bc98084f8af2c41483e4d68a5adf2fa7f7 Author: Xiao Yao Date: Tue Dec 12 00:27:18 2023 +0800 Bluetooth: MGMT/SMP: Fix address type when using SMP over BREDR/LE If two Bluetooth devices both support BR/EDR and BLE, and also support Secure Connections, then they only need to pair once. The LTK generated during the LE pairing process may be converted into a BR/EDR link key for BR/EDR transport, and conversely, a link key generated during the BR/EDR SSP pairing process can be converted into an LTK for LE transport. Hence, the link type of the link key and LTK is not fixed, they can be either an LE LINK or an ACL LINK. Currently, in the mgmt_new_irk/ltk/crsk/link_key functions, the link type is fixed, which could lead to incorrect address types being reported to the application layer. Therefore, it is necessary to add link_type/addr_type to the smp_irk/ltk/crsk and link_key, to ensure the generation of the correct address type. SMP over BREDR: Before Fix: > ACL Data RX: Handle 11 flags 0x02 dlen 12 BR/EDR SMP: Identity Address Information (0x09) len 7 Address: F8:7D:76:F2:12:F3 (OUI F8-7D-76) @ MGMT Event: New Identity Resolving Key (0x0018) plen 30 Random address: 00:00:00:00:00:00 (Non-Resolvable) LE Address: F8:7D:76:F2:12:F3 (OUI F8-7D-76) @ MGMT Event: New Long Term Key (0x000a) plen 37 LE Address: F8:7D:76:F2:12:F3 (OUI F8-7D-76) Key type: Authenticated key from P-256 (0x03) After Fix: > ACL Data RX: Handle 11 flags 0x02 dlen 12 BR/EDR SMP: Identity Address Information (0x09) len 7 Address: F8:7D:76:F2:12:F3 (OUI F8-7D-76) @ MGMT Event: New Identity Resolving Key (0x0018) plen 30 Random address: 00:00:00:00:00:00 (Non-Resolvable) BR/EDR Address: F8:7D:76:F2:12:F3 (OUI F8-7D-76) @ MGMT Event: New Long Term Key (0x000a) plen 37 BR/EDR Address: F8:7D:76:F2:12:F3 (OUI F8-7D-76) Key type: Authenticated key from P-256 (0x03) SMP over LE: Before Fix: @ MGMT Event: New Identity Resolving Key (0x0018) plen 30 Random address: 5F:5C:07:37:47:D5 (Resolvable) LE Address: F8:7D:76:F2:12:F3 (OUI F8-7D-76) @ MGMT Event: New Long Term Key (0x000a) plen 37 LE Address: F8:7D:76:F2:12:F3 (OUI F8-7D-76) Key type: Authenticated key from P-256 (0x03) @ MGMT Event: New Link Key (0x0009) plen 26 BR/EDR Address: F8:7D:76:F2:12:F3 (OUI F8-7D-76) Key type: Authenticated Combination key from P-256 (0x08) After Fix: @ MGMT Event: New Identity Resolving Key (0x0018) plen 30 Random address: 5E:03:1C:00:38:21 (Resolvable) LE Address: F8:7D:76:F2:12:F3 (OUI F8-7D-76) @ MGMT Event: New Long Term Key (0x000a) plen 37 LE Address: F8:7D:76:F2:12:F3 (OUI F8-7D-76) Key type: Authenticated key from P-256 (0x03) @ MGMT Event: New Link Key (0x0009) plen 26 Store hint: Yes (0x01) LE Address: F8:7D:76:F2:12:F3 (OUI F8-7D-76) Key type: Authenticated Combination key from P-256 (0x08) Cc: stable@vger.kernel.org Signed-off-by: Xiao Yao Signed-off-by: Luiz Augusto von Dentz commit 78b99eb1faa7371bf9c534690f26a71b6996622d Author: Frédéric Danis Date: Fri Dec 8 18:41:50 2023 +0100 Bluetooth: L2CAP: Send reject on command corrupted request L2CAP/COS/CED/BI-02-C PTS test send a malformed L2CAP signaling packet with 2 commands in it (a connection request and an unknown command) and expect to get a connection response packet and a command reject packet. The second is currently not sent. Cc: stable@vger.kernel.org Signed-off-by: Frédéric Danis Signed-off-by: Luiz Augusto von Dentz commit 50efc63d1a7a7b9a6ed21adae1b9a7123ec8abc0 Author: Luiz Augusto von Dentz Date: Fri Dec 8 17:22:29 2023 -0500 Bluetooth: hci_core: Fix hci_conn_hash_lookup_cis hci_conn_hash_lookup_cis shall always match the requested CIG and CIS ids even when they are unset as otherwise it result in not being able to bind/connect different sockets to the same address as that would result in having multiple sockets mapping to the same hci_conn which doesn't really work and prevents BAP audio configuration such as AC 6(i) when CIG and CIS are left unset. Fixes: c14516faede3 ("Bluetooth: hci_conn: Fix not matching by CIS ID") Signed-off-by: Luiz Augusto von Dentz commit a5812c68d849505ea657f653446512b85887f813 Author: Arnd Bergmann Date: Wed Nov 22 23:17:44 2023 +0100 Bluetooth: hci_event: shut up a false-positive warning Turning on -Wstringop-overflow globally exposed a misleading compiler warning in bluetooth: net/bluetooth/hci_event.c: In function 'hci_cc_read_class_of_dev': net/bluetooth/hci_event.c:524:9: error: 'memcpy' writing 3 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=] 524 | memcpy(hdev->dev_class, rp->dev_class, 3); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The problem here is the check for hdev being NULL in bt_dev_dbg() that leads the compiler to conclude that hdev->dev_class might be an invalid pointer access. Add another explicit check for the same condition to make sure gcc sees this cannot happen. Fixes: a9de9248064b ("[Bluetooth] Switch from OGF+OCF to using only opcodes") Fixes: 1b56c90018f0 ("Makefile: Enable -Wstringop-overflow globally") Signed-off-by: Arnd Bergmann Signed-off-by: Luiz Augusto von Dentz commit 99e67d46e5ff3c7c901af6009edec72d3d363be8 Author: Luiz Augusto von Dentz Date: Mon Nov 20 10:04:39 2023 -0500 Bluetooth: hci_event: Fix not checking if HCI_OP_INQUIRY has been sent Before setting HCI_INQUIRY bit check if HCI_OP_INQUIRY was really sent otherwise the controller maybe be generating invalid events or, more likely, it is a result of fuzzing tools attempting to test the right behavior of the stack when unexpected events are generated. Cc: stable@vger.kernel.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=218151 Signed-off-by: Luiz Augusto von Dentz commit 769bf60e17ee1a56a81e7c031192c3928312c52e Author: Ying Hsu Date: Fri Nov 10 01:46:05 2023 +0000 Bluetooth: Fix deadlock in vhci_send_frame syzbot found a potential circular dependency leading to a deadlock: -> #3 (&hdev->req_lock){+.+.}-{3:3}: __mutex_lock_common+0x1b6/0x1bc2 kernel/locking/mutex.c:599 __mutex_lock kernel/locking/mutex.c:732 [inline] mutex_lock_nested+0x17/0x1c kernel/locking/mutex.c:784 hci_dev_do_close+0x3f/0x9f net/bluetooth/hci_core.c:551 hci_rfkill_set_block+0x130/0x1ac net/bluetooth/hci_core.c:935 rfkill_set_block+0x1e6/0x3b8 net/rfkill/core.c:345 rfkill_fop_write+0x2d8/0x672 net/rfkill/core.c:1274 vfs_write+0x277/0xcf5 fs/read_write.c:594 ksys_write+0x19b/0x2bd fs/read_write.c:650 do_syscall_x64 arch/x86/entry/common.c:55 [inline] do_syscall_64+0x51/0xba arch/x86/entry/common.c:93 entry_SYSCALL_64_after_hwframe+0x61/0xcb -> #2 (rfkill_global_mutex){+.+.}-{3:3}: __mutex_lock_common+0x1b6/0x1bc2 kernel/locking/mutex.c:599 __mutex_lock kernel/locking/mutex.c:732 [inline] mutex_lock_nested+0x17/0x1c kernel/locking/mutex.c:784 rfkill_register+0x30/0x7e3 net/rfkill/core.c:1045 hci_register_dev+0x48f/0x96d net/bluetooth/hci_core.c:2622 __vhci_create_device drivers/bluetooth/hci_vhci.c:341 [inline] vhci_create_device+0x3ad/0x68f drivers/bluetooth/hci_vhci.c:374 vhci_get_user drivers/bluetooth/hci_vhci.c:431 [inline] vhci_write+0x37b/0x429 drivers/bluetooth/hci_vhci.c:511 call_write_iter include/linux/fs.h:2109 [inline] new_sync_write fs/read_write.c:509 [inline] vfs_write+0xaa8/0xcf5 fs/read_write.c:596 ksys_write+0x19b/0x2bd fs/read_write.c:650 do_syscall_x64 arch/x86/entry/common.c:55 [inline] do_syscall_64+0x51/0xba arch/x86/entry/common.c:93 entry_SYSCALL_64_after_hwframe+0x61/0xcb -> #1 (&data->open_mutex){+.+.}-{3:3}: __mutex_lock_common+0x1b6/0x1bc2 kernel/locking/mutex.c:599 __mutex_lock kernel/locking/mutex.c:732 [inline] mutex_lock_nested+0x17/0x1c kernel/locking/mutex.c:784 vhci_send_frame+0x68/0x9c drivers/bluetooth/hci_vhci.c:75 hci_send_frame+0x1cc/0x2ff net/bluetooth/hci_core.c:2989 hci_sched_acl_pkt net/bluetooth/hci_core.c:3498 [inline] hci_sched_acl net/bluetooth/hci_core.c:3583 [inline] hci_tx_work+0xb94/0x1a60 net/bluetooth/hci_core.c:3654 process_one_work+0x901/0xfb8 kernel/workqueue.c:2310 worker_thread+0xa67/0x1003 kernel/workqueue.c:2457 kthread+0x36a/0x430 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 -> #0 ((work_completion)(&hdev->tx_work)){+.+.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3787 [inline] __lock_acquire+0x2d32/0x77fa kernel/locking/lockdep.c:5011 lock_acquire+0x273/0x4d5 kernel/locking/lockdep.c:5622 __flush_work+0xee/0x19f kernel/workqueue.c:3090 hci_dev_close_sync+0x32f/0x1113 net/bluetooth/hci_sync.c:4352 hci_dev_do_close+0x47/0x9f net/bluetooth/hci_core.c:553 hci_rfkill_set_block+0x130/0x1ac net/bluetooth/hci_core.c:935 rfkill_set_block+0x1e6/0x3b8 net/rfkill/core.c:345 rfkill_fop_write+0x2d8/0x672 net/rfkill/core.c:1274 vfs_write+0x277/0xcf5 fs/read_write.c:594 ksys_write+0x19b/0x2bd fs/read_write.c:650 do_syscall_x64 arch/x86/entry/common.c:55 [inline] do_syscall_64+0x51/0xba arch/x86/entry/common.c:93 entry_SYSCALL_64_after_hwframe+0x61/0xcb This change removes the need for acquiring the open_mutex in vhci_send_frame, thus eliminating the potential deadlock while maintaining the required packet ordering. Fixes: 92d4abd66f70 ("Bluetooth: vhci: Fix race when opening vhci device") Signed-off-by: Ying Hsu Signed-off-by: Luiz Augusto von Dentz commit f67eabffb57d0bee379994a18ec5f462b2cbdf86 Author: Luiz Augusto von Dentz Date: Mon Oct 23 16:26:23 2023 -0700 Bluetooth: Fix not notifying when connection encryption changes Some layers such as SMP depend on getting notified about encryption changes immediately as they only allow certain PDU to be transmitted over an encrypted link which may cause SMP implementation to reject valid PDUs received thus causing pairing to fail when it shouldn't. Fixes: 7aca0ac4792e ("Bluetooth: Wait for HCI_OP_WRITE_AUTH_PAYLOAD_TO to complete") Signed-off-by: Luiz Augusto von Dentz commit 1bd773b4f0c90123af19a853244be61518ae0556 Author: NeilBrown Date: Fri Dec 15 11:56:33 2023 +1100 nfsd: hold nfsd_mutex across entire netlink operation Rather than using svc_get() and svc_put() to hold a stable reference to the nfsd_svc for netlink lookups, simply hold the mutex for the entire time. The "entire" time isn't very long, and the mutex is not often contented. This makes way for us to remove the refcounts of svc, which is more confusing than useful. Reported-by: Jeff Layton Closes: https://lore.kernel.org/linux-nfs/5d9bbb599569ce29f16e4e0eef6b291eda0f375b.camel@kernel.org/T/#u Fixes: bd9d6a3efa97 ("NFSD: add rpc_status netlink support") Signed-off-by: NeilBrown Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 2a501f55cd641eb4d3c16a2eab0d678693fac663 Author: NeilBrown Date: Fri Dec 15 11:56:31 2023 +1100 nfsd: call nfsd_last_thread() before final nfsd_put() If write_ports_addfd or write_ports_addxprt fail, they call nfsd_put() without calling nfsd_last_thread(). This leaves nn->nfsd_serv pointing to a structure that has been freed. So remove 'static' from nfsd_last_thread() and call it when the nfsd_serv is about to be destroyed. Fixes: ec52361df99b ("SUNRPC: stop using ->sv_nrthreads as a refcount") Signed-off-by: NeilBrown Reviewed-by: Jeff Layton Cc: Signed-off-by: Chuck Lever commit 712292308af2265cd9b126aedfa987f10f452a33 Author: Steven Rostedt (Google) Date: Wed Dec 13 17:54:03 2023 -0500 ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI As the ring buffer recording requires cmpxchg() to work, if the architecture does not support cmpxchg in NMI, then do not do any recording within an NMI. Link: https://lore.kernel.org/linux-trace-kernel/20231213175403.6fc18540@gandalf.local.home Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Signed-off-by: Steven Rostedt (Google) commit 0aa0e5289cfe984a8a9fdd79ccf46ccf080151f7 Author: Steven Rostedt (Google) Date: Fri Dec 15 08:41:14 2023 -0500 ring-buffer: Have rb_time_cmpxchg() set the msb counter too The rb_time_cmpxchg() on 32-bit architectures requires setting three 32-bit words to represent the 64-bit timestamp, with some salt for synchronization. Those are: msb, top, and bottom The issue is, the rb_time_cmpxchg() did not properly salt the msb portion, and the msb that was written was stale. Link: https://lore.kernel.org/linux-trace-kernel/20231215084114.20899342@rorschach.local.home Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Fixes: f03f2abce4f39 ("ring-buffer: Have 32 bit time stamps use all 64 bits") Signed-off-by: Steven Rostedt (Google) commit dec890089bf79a4954b61482715ee2d084364856 Author: Mathieu Desnoyers Date: Tue Dec 12 14:30:49 2023 -0500 ring-buffer: Fix 32-bit rb_time_read() race with rb_time_cmpxchg() The following race can cause rb_time_read() to observe a corrupted time stamp: rb_time_cmpxchg() [...] if (!rb_time_read_cmpxchg(&t->msb, msb, msb2)) return false; if (!rb_time_read_cmpxchg(&t->top, top, top2)) return false; __rb_time_read() [...] do { c = local_read(&t->cnt); top = local_read(&t->top); bottom = local_read(&t->bottom); msb = local_read(&t->msb); } while (c != local_read(&t->cnt)); *cnt = rb_time_cnt(top); /* If top and msb counts don't match, this interrupted a write */ if (*cnt != rb_time_cnt(msb)) return false; ^ this check fails to catch that "bottom" is still not updated. So the old "bottom" value is returned, which is wrong. Fix this by checking that all three of msb, top, and bottom 2-bit cnt values match. The reason to favor checking all three fields over requiring a specific update order for both rb_time_set() and rb_time_cmpxchg() is because checking all three fields is more robust to handle partial failures of rb_time_cmpxchg() when interrupted by nested rb_time_set(). Link: https://lore.kernel.org/lkml/20231211201324.652870-1-mathieu.desnoyers@efficios.com/ Link: https://lore.kernel.org/linux-trace-kernel/20231212193049.680122-1-mathieu.desnoyers@efficios.com Fixes: f458a1453424e ("ring-buffer: Test last update in 32bit version of __rb_time_read()") Signed-off-by: Mathieu Desnoyers Signed-off-by: Steven Rostedt (Google) commit fff88fa0fbc7067ba46dde570912d63da42c59a9 Author: Steven Rostedt (Google) Date: Tue Dec 12 11:53:01 2023 -0500 ring-buffer: Fix a race in rb_time_cmpxchg() for 32 bit archs Mathieu Desnoyers pointed out an issue in the rb_time_cmpxchg() for 32 bit architectures. That is: static bool rb_time_cmpxchg(rb_time_t *t, u64 expect, u64 set) { unsigned long cnt, top, bottom, msb; unsigned long cnt2, top2, bottom2, msb2; u64 val; /* The cmpxchg always fails if it interrupted an update */ if (!__rb_time_read(t, &val, &cnt2)) return false; if (val != expect) return false; <<<< interrupted here! cnt = local_read(&t->cnt); The problem is that the synchronization counter in the rb_time_t is read *after* the value of the timestamp is read. That means if an interrupt were to come in between the value being read and the counter being read, it can change the value and the counter and the interrupted process would be clueless about it! The counter needs to be read first and then the value. That way it is easy to tell if the value is stale or not. If the counter hasn't been updated, then the value is still good. Link: https://lore.kernel.org/linux-trace-kernel/20231211201324.652870-1-mathieu.desnoyers@efficios.com/ Link: https://lore.kernel.org/linux-trace-kernel/20231212115301.7a9c9a64@gandalf.local.home Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Fixes: 10464b4aa605e ("ring-buffer: Add rb_time_t 64 bit operations for speeding up 32 bit") Reported-by: Mathieu Desnoyers Reviewed-by: Mathieu Desnoyers Signed-off-by: Steven Rostedt (Google) commit 083e9f65bd215582bf8f6a920db729fadf16704f Author: Steven Rostedt (Google) Date: Fri Dec 15 08:18:10 2023 -0500 ring-buffer: Remove useless update to write_stamp in rb_try_to_discard() When filtering is enabled, a temporary buffer is created to place the content of the trace event output so that the filter logic can decide from the trace event output if the trace event should be filtered out or not. If it is to be filtered out, the content in the temporary buffer is simply discarded, otherwise it is written into the trace buffer. But if an interrupt were to come in while a previous event was using that temporary buffer, the event written by the interrupt would actually go into the ring buffer itself to prevent corrupting the data on the temporary buffer. If the event is to be filtered out, the event in the ring buffer is discarded, or if it fails to discard because another event were to have already come in, it is turned into padding. The update to the write_stamp in the rb_try_to_discard() happens after a fix was made to force the next event after the discard to use an absolute timestamp by setting the before_stamp to zero so it does not match the write_stamp (which causes an event to use the absolute timestamp). But there's an effort in rb_try_to_discard() to put back the write_stamp to what it was before the event was added. But this is useless and wasteful because nothing is going to be using that write_stamp for calculations as it still will not match the before_stamp. Remove this useless update, and in doing so, we remove another cmpxchg64()! Also update the comments to reflect this change as well as remove some extra white space in another comment. Link: https://lore.kernel.org/linux-trace-kernel/20231215081810.1f4f38fe@rorschach.local.home Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Joel Fernandes Cc: Vincent Donnefort Fixes: b2dd797543cf ("ring-buffer: Force absolute timestamp on discard of event") Signed-off-by: Steven Rostedt (Google) commit dd939425707898da992e59ab0fcfae4652546910 Author: Steven Rostedt (Google) Date: Thu Dec 14 22:29:21 2023 -0500 ring-buffer: Do not try to put back write_stamp If an update to an event is interrupted by another event between the time the initial event allocated its buffer and where it wrote to the write_stamp, the code try to reset the write stamp back to the what it had just overwritten. It knows that it was overwritten via checking the before_stamp, and if it didn't match what it wrote to the before_stamp before it allocated its space, it knows it was overwritten. To put back the write_stamp, it uses the before_stamp it read. The problem here is that by writing the before_stamp to the write_stamp it makes the two equal again, which means that the write_stamp can be considered valid as the last timestamp written to the ring buffer. But this is not necessarily true. The event that interrupted the event could have been interrupted in a way that it was interrupted as well, and can end up leaving with an invalid write_stamp. But if this happens and returns to this context that uses the before_stamp to update the write_stamp again, it can possibly incorrectly make it valid, causing later events to have in correct time stamps. As it is OK to leave this function with an invalid write_stamp (one that doesn't match the before_stamp), there's no reason to try to make it valid again in this case. If this race happens, then just leave with the invalid write_stamp and the next event to come along will just add a absolute timestamp and validate everything again. Bonus points: This gets rid of another cmpxchg64! Link: https://lore.kernel.org/linux-trace-kernel/20231214222921.193037a7@gandalf.local.home Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Joel Fernandes Cc: Vincent Donnefort Fixes: a389d86f7fd09 ("ring-buffer: Have nested events still record running time stamp") Signed-off-by: Steven Rostedt (Google) commit f32c80d34249e1cfb2e647ab3c8ef38a460c787f Author: Gergo Koteles Date: Thu Dec 14 23:04:44 2023 +0100 ASoC: tas2781: check the validity of prm_no/cfg_no Add additional checks for program/config numbers to avoid loading from invalid addresses. If prm_no/cfg_no is negative, skip uploading program/config. The tas2781-hda driver caused a NULL pointer dereference after loading module, and before first runtime_suspend. the state was: tas_priv->cur_conf = -1; tas_priv->tasdevice[i].cur_conf = 0; program = &(tas_fmw->programs[-1]); BUG: kernel NULL pointer dereference, address: 0000000000000010 Call Trace: ? __die+0x23/0x70 ? page_fault_oops+0x171/0x4e0 ? vprintk_emit+0x175/0x2b0 ? exc_page_fault+0x7f/0x180 ? asm_exc_page_fault+0x26/0x30 ? tasdevice_load_block_kernel+0x21/0x310 [snd_soc_tas2781_fmwlib] tasdevice_select_tuningprm_cfg+0x268/0x3a0 [snd_soc_tas2781_fmwlib] tasdevice_tuning_switch+0x69/0x710 [snd_soc_tas2781_fmwlib] tas2781_hda_playback_hook+0xd4/0x110 [snd_hda_scodec_tas2781_i2c] Fixes: 915f5eadebd2 ("ASoC: tas2781: firmware lib") CC: Signed-off-by: Gergo Koteles Link: https://msgid.link/r/523780155bfdca9bc0acd39efc79ed039454818d.1702591356.git.soyer@irl.hu Signed-off-by: Mark Brown commit 7fbcd195e2b8cc952e4aeaeb50867b798040314c Author: Dan Carpenter Date: Wed Dec 13 16:22:43 2023 +0300 usb: fotg210-hcd: delete an incorrect bounds test Here "temp" is the number of characters that we have written and "size" is the size of the buffer. The intent was clearly to say that if we have written to the end of the buffer then stop. However, for that to work the comparison should have been done on the original "size" value instead of the "size -= temp" value. Not only will that not trigger when we want to, but there is a small chance that it will trigger incorrectly before we want it to and we break from the loop slightly earlier than intended. This code was recently changed from using snprintf() to scnprintf(). With snprintf() we likely would have continued looping and passed a negative size parameter to snprintf(). This would have triggered an annoying WARN(). Now that we have converted to scnprintf() "size" will never drop below 1 and there is no real need for this test. We could change the condition to "if (temp <= 1) goto done;" but just deleting the test is cleanest. Fixes: 7d50195f6c50 ("usb: host: Faraday fotg210-hcd driver") Cc: stable Signed-off-by: Dan Carpenter Reviewed-by: Linus Walleij Reviewed-by: Lee Jones Link: https://lore.kernel.org/r/ZXmwIwHe35wGfgzu@suswa Signed-off-by: Greg Kroah-Hartman commit 772685c14743ad565bb271041ad3c262298cd6fc Author: Tasos Sahanidis Date: Thu Dec 7 15:44:41 2023 +0200 usb-storage: Add quirk for incorrect WP on Kingston DT Ultimate 3.0 G3 This flash drive reports write protect during the first mode sense. In the past this was not an issue as the kernel called revalidate twice, thus asking the device for its write protect status twice, with write protect being disabled in the second mode sense. However, since commit 1e029397d12f ("scsi: sd: Reorganize DIF/DIX code to avoid calling revalidate twice") that is no longer the case, thus the device shows up read only. [490891.289495] sd 12:0:0:0: [sdl] Write Protect is on [490891.289497] sd 12:0:0:0: [sdl] Mode Sense: 2b 00 80 08 This does not appear to be a timing issue, as enabling the usbcore quirk USB_QUIRK_DELAY_INIT has no effect on write protect. Fixes: 1e029397d12f ("scsi: sd: Reorganize DIF/DIX code to avoid calling revalidate twice") Cc: stable Signed-off-by: Tasos Sahanidis Acked-by: Alan Stern Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20231207134441.298131-1-tasos@tasossah.com Signed-off-by: Greg Kroah-Hartman commit c994cb596bf7ef5928f06331c76f46e071b16f09 Author: Johan Hovold Date: Fri Dec 8 13:36:02 2023 +0100 usb: typec: ucsi: fix gpio-based orientation detection Fix the recently added connector sanity check which was off by one and prevented orientation notifications from being handled correctly for the second port when using GPIOs to determine orientation. Fixes: c6165ed2f425 ("usb: ucsi: glink: use the connector orientation GPIO to provide switch events") Cc: stable Cc: Neil Armstrong Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231208123603.29957-1-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit aef05e349bfd81c95adb4489639413fadbb74a83 Author: Jose Ignacio Tornos Martinez Date: Thu Dec 7 18:50:07 2023 +0100 net: usb: ax88179_178a: avoid failed operations when device is disconnected When the device is disconnected we get the following messages showing failed operations: Nov 28 20:22:11 localhost kernel: usb 2-3: USB disconnect, device number 2 Nov 28 20:22:11 localhost kernel: ax88179_178a 2-3:1.0 enp2s0u3: unregister 'ax88179_178a' usb-0000:02:00.0-3, ASIX AX88179 USB 3.0 Gigabit Ethernet Nov 28 20:22:11 localhost kernel: ax88179_178a 2-3:1.0 enp2s0u3: Failed to read reg index 0x0002: -19 Nov 28 20:22:11 localhost kernel: ax88179_178a 2-3:1.0 enp2s0u3: Failed to write reg index 0x0002: -19 Nov 28 20:22:11 localhost kernel: ax88179_178a 2-3:1.0 enp2s0u3 (unregistered): Failed to write reg index 0x0002: -19 Nov 28 20:22:11 localhost kernel: ax88179_178a 2-3:1.0 enp2s0u3 (unregistered): Failed to write reg index 0x0001: -19 Nov 28 20:22:11 localhost kernel: ax88179_178a 2-3:1.0 enp2s0u3 (unregistered): Failed to write reg index 0x0002: -19 The reason is that although the device is detached, normal stop and unbind operations are commanded from the driver. These operations are not necessary in this situation, so avoid these logs when the device is detached if the result of the operation is -ENODEV and if the new flag informing about the disconnecting status is enabled. cc: Fixes: e2ca90c276e1f ("ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver") Signed-off-by: Jose Ignacio Tornos Martinez Acked-by: Alan Stern Link: https://lore.kernel.org/r/20231207175007.263907-1-jtornosm@redhat.com Signed-off-by: Greg Kroah-Hartman commit 1e37bf84afacd5ba17b7a13a18ca2bc78aff05c0 Author: Rafał Miłecki Date: Fri Dec 15 11:13:58 2023 +0000 nvmem: brcm_nvram: store a copy of NVRAM content This driver uses MMIO access for reading NVRAM from a flash device. Underneath there is a flash controller that reads data and provides mapping window. Using MMIO interface affects controller configuration and may break real controller driver. It was reported by multiple users of devices with NVRAM stored on NAND. Modify driver to read & cache NVRAM content during init and use that copy to provide NVMEM data when requested. On NAND flashes due to their alignment NVRAM partitions can be quite big (1 MiB and more) while actual NVRAM content stays quite small (usually 16 to 32 KiB). To avoid allocating so much memory check for actual data length. Link: https://lore.kernel.org/linux-mtd/CACna6rwf3_9QVjYcM+847biTX=K0EoWXuXcSMkJO1Vy_5vmVqA@mail.gmail.com/ Fixes: 3fef9ed0627a ("nvmem: brcm_nvram: new driver exposing Broadcom's NVRAM") Cc: Cc: Arınç ÜNAL Cc: Florian Fainelli Cc: Scott Branden Signed-off-by: Rafał Miłecki Acked-by: Arınç ÜNAL Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20231215111358.316727-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit a2a8aefecbd0f87d6127951cef33b3def8439057 Author: Fabio Estevam Date: Fri Dec 15 11:13:57 2023 +0000 dt-bindings: nvmem: mxs-ocotp: Document fsl,ocotp Both imx23.dtsi and imx28.dtsi describe the OCOTP nodes in the format: compatible = "fsl,imx28-ocotp", "fsl,ocotp"; Document the "fsl,ocotp" entry to fix the following schema warning: efuse@8002c000: compatible: ['fsl,imx23-ocotp', 'fsl,ocotp'] is too long from schema $id: http://devicetree.org/schemas/nvmem/mxs-ocotp.yaml# Fixes: 2c504460f502 ("dt-bindings: nvmem: Convert MXS OCOTP to json-schema") Cc: Signed-off-by: Fabio Estevam Acked-by: Conor Dooley Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20231215111358.316727-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 134c6eaa6087d78c0e289931ca15ae7a5007670d Author: Dan Williams Date: Wed Dec 13 15:02:35 2023 -0800 driver core: Add a guard() definition for the device_lock() At present there are ~200 usages of device_lock() in the kernel. Some of those usages lead to "goto unlock;" patterns which have proven to be error prone. Define a "device" guard() definition to allow for those to be cleaned up and prevent new ones from appearing. Link: http://lore.kernel.org/r/657897453dda8_269bd29492@dwillia2-mobl3.amr.corp.intel.com.notmuch Link: http://lore.kernel.org/r/6577b0c2a02df_a04c5294bb@dwillia2-xfh.jf.intel.com.notmuch Cc: Vishal Verma Cc: Ira Weiny Cc: Peter Zijlstra Cc: Greg Kroah-Hartman Cc: Andrew Morton Signed-off-by: Dan Williams Reviewed-by: Ira Weiny Reviewed-by: Dave Jiang Reviewed-by: Vishal Verma Link: https://lore.kernel.org/r/170250854466.1522182.17555361077409628655.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Greg Kroah-Hartman commit 9483aa44912f26da2b69dade6099c2bf4b50a8c3 Author: Shubhrajyoti Datta Date: Fri Dec 15 11:03:52 2023 +0530 EDAC/versal: Read num_csrows and num_chans using the correct bitfield macro Fix the extraction of num_csrows and num_chans. The extraction of the num_rows is wrong. Instead of extracting using the FIELD_GET it is calling FIELD_PREP. The issue was masked as the default design has the rows as 0. Fixes: 6f15b178cd63 ("EDAC/versal: Add a Xilinx Versal memory controller driver") Closes: https://lore.kernel.org/all/60ca157e-6eff-d12c-9dc0-8aeab125edda@linux-m68k.org/ Reported-by: Geert Uytterhoeven Signed-off-by: Shubhrajyoti Datta Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231215053352.8740-1-shubhrajyoti.datta@amd.com commit 64b8bc7d5f1434c636a40bdcfcd42b278d1714be Author: Eric Dumazet Date: Thu Dec 14 15:27:47 2023 +0000 net/rose: fix races in rose_kill_by_device() syzbot found an interesting netdev refcounting issue in net/rose/af_rose.c, thanks to CONFIG_NET_DEV_REFCNT_TRACKER=y [1] Problem is that rose_kill_by_device() can change rose->device while other threads do not expect the pointer to be changed. We have to first collect sockets in a temporary array, then perform the changes while holding the socket lock and rose_list_lock spinlock (in this order) Change rose_release() to also acquire rose_list_lock before releasing the netdev refcount. [1] [ 1185.055088][ T7889] ref_tracker: reference already released. [ 1185.061476][ T7889] ref_tracker: allocated in: [ 1185.066081][ T7889] rose_bind+0x4ab/0xd10 [ 1185.070446][ T7889] __sys_bind+0x1ec/0x220 [ 1185.074818][ T7889] __x64_sys_bind+0x72/0xb0 [ 1185.079356][ T7889] do_syscall_64+0x40/0x110 [ 1185.083897][ T7889] entry_SYSCALL_64_after_hwframe+0x63/0x6b [ 1185.089835][ T7889] ref_tracker: freed in: [ 1185.094088][ T7889] rose_release+0x2f5/0x570 [ 1185.098629][ T7889] __sock_release+0xae/0x260 [ 1185.103262][ T7889] sock_close+0x1c/0x20 [ 1185.107453][ T7889] __fput+0x270/0xbb0 [ 1185.111467][ T7889] task_work_run+0x14d/0x240 [ 1185.116085][ T7889] get_signal+0x106f/0x2790 [ 1185.120622][ T7889] arch_do_signal_or_restart+0x90/0x7f0 [ 1185.126205][ T7889] exit_to_user_mode_prepare+0x121/0x240 [ 1185.131846][ T7889] syscall_exit_to_user_mode+0x1e/0x60 [ 1185.137293][ T7889] do_syscall_64+0x4d/0x110 [ 1185.141783][ T7889] entry_SYSCALL_64_after_hwframe+0x63/0x6b [ 1185.148085][ T7889] ------------[ cut here ]------------ WARNING: CPU: 1 PID: 7889 at lib/ref_tracker.c:255 ref_tracker_free+0x61a/0x810 lib/ref_tracker.c:255 Modules linked in: CPU: 1 PID: 7889 Comm: syz-executor.2 Not tainted 6.7.0-rc4-syzkaller-00162-g65c95f78917e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 RIP: 0010:ref_tracker_free+0x61a/0x810 lib/ref_tracker.c:255 Code: 00 44 8b 6b 18 31 ff 44 89 ee e8 21 62 f5 fc 45 85 ed 0f 85 a6 00 00 00 e8 a3 66 f5 fc 48 8b 34 24 48 89 ef e8 27 5f f1 05 90 <0f> 0b 90 bb ea ff ff ff e9 52 fd ff ff e8 84 66 f5 fc 4c 8d 6d 44 RSP: 0018:ffffc90004917850 EFLAGS: 00010202 RAX: 0000000000000201 RBX: ffff88802618f4c0 RCX: 0000000000000000 RDX: 0000000000000202 RSI: ffffffff8accb920 RDI: 0000000000000001 RBP: ffff8880269ea5b8 R08: 0000000000000001 R09: fffffbfff23e35f6 R10: ffffffff91f1afb7 R11: 0000000000000001 R12: 1ffff92000922f0c R13: 0000000005a2039b R14: ffff88802618f4d8 R15: 00000000ffffffff FS: 00007f0a720ef6c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f43a819d988 CR3: 0000000076c64000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: netdev_tracker_free include/linux/netdevice.h:4127 [inline] netdev_put include/linux/netdevice.h:4144 [inline] netdev_put include/linux/netdevice.h:4140 [inline] rose_kill_by_device net/rose/af_rose.c:195 [inline] rose_device_event+0x25d/0x330 net/rose/af_rose.c:218 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x130 net/core/dev.c:1967 call_netdevice_notifiers_extack net/core/dev.c:2005 [inline] call_netdevice_notifiers net/core/dev.c:2019 [inline] __dev_notify_flags+0x1f5/0x2e0 net/core/dev.c:8646 dev_change_flags+0x122/0x170 net/core/dev.c:8682 dev_ifsioc+0x9ad/0x1090 net/core/dev_ioctl.c:529 dev_ioctl+0x224/0x1090 net/core/dev_ioctl.c:786 sock_do_ioctl+0x198/0x270 net/socket.c:1234 sock_ioctl+0x22e/0x6b0 net/socket.c:1339 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f0a7147cba9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0a720ef0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f0a7159bf80 RCX: 00007f0a7147cba9 RDX: 0000000020000040 RSI: 0000000000008914 RDI: 0000000000000004 RBP: 00007f0a714c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f0a7159bf80 R15: 00007ffc8bb3a5f8 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Bernard Pidoux Signed-off-by: David S. Miller commit 7e2c1e4b34f07d9aa8937fab88359d4a0fce468e Author: Mark Rutland Date: Fri Dec 15 11:24:50 2023 +0000 perf: Fix perf_event_validate_size() lockdep splat When lockdep is enabled, the for_each_sibling_event(sibling, event) macro checks that event->ctx->mutex is held. When creating a new group leader event, we call perf_event_validate_size() on a partially initialized event where event->ctx is NULL, and so when for_each_sibling_event() attempts to check event->ctx->mutex, we get a splat, as reported by Lucas De Marchi: WARNING: CPU: 8 PID: 1471 at kernel/events/core.c:1950 __do_sys_perf_event_open+0xf37/0x1080 This only happens for a new event which is its own group_leader, and in this case there cannot be any sibling events. Thus it's safe to skip the check for siblings, which avoids having to make invasive and ugly changes to for_each_sibling_event(). Avoid the splat by bailing out early when the new event is its own group_leader. Fixes: 382c27f4ed28f803 ("perf: Fix perf_event_validate_size()") Closes: https://lore.kernel.org/lkml/20231214000620.3081018-1-lucas.demarchi@intel.com/ Closes: https://lore.kernel.org/lkml/ZXpm6gQ%2Fd59jGsuW@xpf.sh.intel.com/ Reported-by: Lucas De Marchi Reported-by: Pengfei Xu Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20231215112450.3972309-1-mark.rutland@arm.com commit 309fdb1c33fe726d92d0030481346f24e1b01f07 Author: Zhipeng Lu Date: Thu Dec 14 21:04:04 2023 +0800 ethernet: atheros: fix a memleak in atl1e_setup_ring_resources In the error handling of 'offset > adapter->ring_size', the tx_ring->tx_buffer allocated by kzalloc should be freed, instead of 'goto failed' instantly. Fixes: a6a5325239c2 ("atl1e: Atheros L1E Gigabit Ethernet driver") Signed-off-by: Zhipeng Lu Reviewed-by: Suman Ghosh Signed-off-by: David S. Miller commit 19391a2ca98baa7b80279306cdf7dd43f81fa595 Author: Eric Dumazet Date: Thu Dec 14 11:30:38 2023 +0000 net: sched: ife: fix potential use-after-free ife_decode() calls pskb_may_pull() two times, we need to reload ifehdr after the second one, or risk use-after-free as reported by syzbot: BUG: KASAN: slab-use-after-free in __ife_tlv_meta_valid net/ife/ife.c:108 [inline] BUG: KASAN: slab-use-after-free in ife_tlv_meta_decode+0x1d1/0x210 net/ife/ife.c:131 Read of size 2 at addr ffff88802d7300a4 by task syz-executor.5/22323 CPU: 0 PID: 22323 Comm: syz-executor.5 Not tainted 6.7.0-rc3-syzkaller-00804-g074ac38d5b95 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 __ife_tlv_meta_valid net/ife/ife.c:108 [inline] ife_tlv_meta_decode+0x1d1/0x210 net/ife/ife.c:131 tcf_ife_decode net/sched/act_ife.c:739 [inline] tcf_ife_act+0x4e3/0x1cd0 net/sched/act_ife.c:879 tc_act include/net/tc_wrapper.h:221 [inline] tcf_action_exec+0x1ac/0x620 net/sched/act_api.c:1079 tcf_exts_exec include/net/pkt_cls.h:344 [inline] mall_classify+0x201/0x310 net/sched/cls_matchall.c:42 tc_classify include/net/tc_wrapper.h:227 [inline] __tcf_classify net/sched/cls_api.c:1703 [inline] tcf_classify+0x82f/0x1260 net/sched/cls_api.c:1800 hfsc_classify net/sched/sch_hfsc.c:1147 [inline] hfsc_enqueue+0x315/0x1060 net/sched/sch_hfsc.c:1546 dev_qdisc_enqueue+0x3f/0x230 net/core/dev.c:3739 __dev_xmit_skb net/core/dev.c:3828 [inline] __dev_queue_xmit+0x1de1/0x3d30 net/core/dev.c:4311 dev_queue_xmit include/linux/netdevice.h:3165 [inline] packet_xmit+0x237/0x350 net/packet/af_packet.c:276 packet_snd net/packet/af_packet.c:3081 [inline] packet_sendmsg+0x24aa/0x5200 net/packet/af_packet.c:3113 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 __sys_sendto+0x255/0x340 net/socket.c:2190 __do_sys_sendto net/socket.c:2202 [inline] __se_sys_sendto net/socket.c:2198 [inline] __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2198 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7fe9acc7cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe9ada450c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007fe9acd9bf80 RCX: 00007fe9acc7cae9 RDX: 000000000000fce0 RSI: 00000000200002c0 RDI: 0000000000000003 RBP: 00007fe9accc847a R08: 0000000020000140 R09: 0000000000000014 R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fe9acd9bf80 R15: 00007ffd5427ae78 Allocated by task 22323: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1007 [inline] __kmalloc_node_track_caller+0x5a/0x90 mm/slab_common.c:1027 kmalloc_reserve+0xef/0x260 net/core/skbuff.c:582 __alloc_skb+0x12b/0x330 net/core/skbuff.c:651 alloc_skb include/linux/skbuff.h:1298 [inline] alloc_skb_with_frags+0xe4/0x710 net/core/skbuff.c:6331 sock_alloc_send_pskb+0x7e4/0x970 net/core/sock.c:2780 packet_alloc_skb net/packet/af_packet.c:2930 [inline] packet_snd net/packet/af_packet.c:3024 [inline] packet_sendmsg+0x1e2a/0x5200 net/packet/af_packet.c:3113 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 __sys_sendto+0x255/0x340 net/socket.c:2190 __do_sys_sendto net/socket.c:2202 [inline] __se_sys_sendto net/socket.c:2198 [inline] __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2198 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Freed by task 22323: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xc0/0x180 mm/slub.c:3822 skb_kfree_head net/core/skbuff.c:950 [inline] skb_free_head+0x110/0x1b0 net/core/skbuff.c:962 pskb_expand_head+0x3c5/0x1170 net/core/skbuff.c:2130 __pskb_pull_tail+0xe1/0x1830 net/core/skbuff.c:2655 pskb_may_pull_reason include/linux/skbuff.h:2685 [inline] pskb_may_pull include/linux/skbuff.h:2693 [inline] ife_decode+0x394/0x4f0 net/ife/ife.c:82 tcf_ife_decode net/sched/act_ife.c:727 [inline] tcf_ife_act+0x43b/0x1cd0 net/sched/act_ife.c:879 tc_act include/net/tc_wrapper.h:221 [inline] tcf_action_exec+0x1ac/0x620 net/sched/act_api.c:1079 tcf_exts_exec include/net/pkt_cls.h:344 [inline] mall_classify+0x201/0x310 net/sched/cls_matchall.c:42 tc_classify include/net/tc_wrapper.h:227 [inline] __tcf_classify net/sched/cls_api.c:1703 [inline] tcf_classify+0x82f/0x1260 net/sched/cls_api.c:1800 hfsc_classify net/sched/sch_hfsc.c:1147 [inline] hfsc_enqueue+0x315/0x1060 net/sched/sch_hfsc.c:1546 dev_qdisc_enqueue+0x3f/0x230 net/core/dev.c:3739 __dev_xmit_skb net/core/dev.c:3828 [inline] __dev_queue_xmit+0x1de1/0x3d30 net/core/dev.c:4311 dev_queue_xmit include/linux/netdevice.h:3165 [inline] packet_xmit+0x237/0x350 net/packet/af_packet.c:276 packet_snd net/packet/af_packet.c:3081 [inline] packet_sendmsg+0x24aa/0x5200 net/packet/af_packet.c:3113 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 __sys_sendto+0x255/0x340 net/socket.c:2190 __do_sys_sendto net/socket.c:2202 [inline] __se_sys_sendto net/socket.c:2198 [inline] __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2198 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff88802d730000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 164 bytes inside of freed 8192-byte region [ffff88802d730000, ffff88802d732000) The buggy address belongs to the physical page: page:ffffea0000b5cc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d730 head:ffffea0000b5cc00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888013042280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080020002 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 22323, tgid 22320 (syz-executor.5), ts 950317230369, free_ts 950233467461 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1544 prep_new_page mm/page_alloc.c:1551 [inline] get_page_from_freelist+0xa28/0x3730 mm/page_alloc.c:3319 __alloc_pages+0x22e/0x2420 mm/page_alloc.c:4575 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab mm/slub.c:2017 [inline] new_slab+0x283/0x3c0 mm/slub.c:2070 ___slab_alloc+0x979/0x1500 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x131/0x310 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1006 [inline] __kmalloc_node_track_caller+0x4a/0x90 mm/slab_common.c:1027 kmalloc_reserve+0xef/0x260 net/core/skbuff.c:582 __alloc_skb+0x12b/0x330 net/core/skbuff.c:651 alloc_skb include/linux/skbuff.h:1298 [inline] alloc_skb_with_frags+0xe4/0x710 net/core/skbuff.c:6331 sock_alloc_send_pskb+0x7e4/0x970 net/core/sock.c:2780 packet_alloc_skb net/packet/af_packet.c:2930 [inline] packet_snd net/packet/af_packet.c:3024 [inline] packet_sendmsg+0x1e2a/0x5200 net/packet/af_packet.c:3113 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 __sys_sendto+0x255/0x340 net/socket.c:2190 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1144 [inline] free_unref_page_prepare+0x53c/0xb80 mm/page_alloc.c:2354 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2494 __unfreeze_partials+0x226/0x240 mm/slub.c:2655 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc_lru+0x219/0x6f0 mm/slub.c:3509 alloc_inode_sb include/linux/fs.h:2937 [inline] ext4_alloc_inode+0x28/0x650 fs/ext4/super.c:1408 alloc_inode+0x5d/0x220 fs/inode.c:261 new_inode_pseudo fs/inode.c:1006 [inline] new_inode+0x22/0x260 fs/inode.c:1032 __ext4_new_inode+0x333/0x5200 fs/ext4/ialloc.c:958 ext4_symlink+0x5d7/0xa20 fs/ext4/namei.c:3398 vfs_symlink fs/namei.c:4464 [inline] vfs_symlink+0x3e5/0x620 fs/namei.c:4448 do_symlinkat+0x25f/0x310 fs/namei.c:4490 __do_sys_symlinkat fs/namei.c:4506 [inline] __se_sys_symlinkat fs/namei.c:4503 [inline] __x64_sys_symlinkat+0x97/0xc0 fs/namei.c:4503 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 Fixes: d57493d6d1be ("net: sched: ife: check on metadata length") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Jamal Hadi Salim Cc: Alexander Aring Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit cac23b7d7627915d967ce25436d7aae26e88ed06 Author: Shigeru Yoshida Date: Thu Dec 14 14:09:22 2023 +0900 net: Return error from sk_stream_wait_connect() if sk_wait_event() fails The following NULL pointer dereference issue occurred: BUG: kernel NULL pointer dereference, address: 0000000000000000 <...> RIP: 0010:ccid_hc_tx_send_packet net/dccp/ccid.h:166 [inline] RIP: 0010:dccp_write_xmit+0x49/0x140 net/dccp/output.c:356 <...> Call Trace: dccp_sendmsg+0x642/0x7e0 net/dccp/proto.c:801 inet_sendmsg+0x63/0x90 net/ipv4/af_inet.c:846 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x83/0xe0 net/socket.c:745 ____sys_sendmsg+0x443/0x510 net/socket.c:2558 ___sys_sendmsg+0xe5/0x150 net/socket.c:2612 __sys_sendmsg+0xa6/0x120 net/socket.c:2641 __do_sys_sendmsg net/socket.c:2650 [inline] __se_sys_sendmsg net/socket.c:2648 [inline] __x64_sys_sendmsg+0x45/0x50 net/socket.c:2648 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x43/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b sk_wait_event() returns an error (-EPIPE) if disconnect() is called on the socket waiting for the event. However, sk_stream_wait_connect() returns success, i.e. zero, even if sk_wait_event() returns -EPIPE, so a function that waits for a connection with sk_stream_wait_connect() may misbehave. In the case of the above DCCP issue, dccp_sendmsg() is waiting for the connection. If disconnect() is called in concurrently, the above issue occurs. This patch fixes the issue by returning error from sk_stream_wait_connect() if sk_wait_event() fails. Fixes: 419ce133ab92 ("tcp: allow again tcp_disconnect() when threads are waiting") Signed-off-by: Shigeru Yoshida Reviewed-by: Kuniyuki Iwashima Reported-by: syzbot+c71bc336c5061153b502@syzkaller.appspotmail.com Reviewed-by: Eric Dumazet Reported-by: syzbot Reported-by: syzkaller Signed-off-by: David S. Miller commit 8c97ab5448f2096daba11edf8d18a44e1eb6f31d Author: Suman Ghosh Date: Wed Dec 13 23:40:44 2023 +0530 octeontx2-pf: Fix graceful exit during PFC configuration failure During PFC configuration failure the code was not handling a graceful exit. This patch fixes the same and add proper code for a graceful exit. Fixes: 99c969a83d82 ("octeontx2-pf: Add egress PFC support") Signed-off-by: Suman Ghosh Signed-off-by: David S. Miller commit 738b54b9b6236f573eed2453c4cbfa77326793e2 Author: duanqiangwen Date: Thu Dec 14 10:33:37 2023 +0800 net: libwx: fix memory leak on free page ifconfig ethx up, will set page->refcount larger than 1, and then ifconfig ethx down, calling __page_frag_cache_drain() to free pages, it is not compatible with page pool. So deleting codes which changing page->refcount. Fixes: 3c47e8ae113a ("net: libwx: Support to receive packets in NAPI") Signed-off-by: duanqiangwen Signed-off-by: David S. Miller commit 06f22cd6635bdae7d73566fca9879b2026a08e00 Author: Reinhard Speyerer Date: Tue Dec 12 18:15:38 2023 +0100 USB: serial: option: add Quectel RM500Q R13 firmware support Add support for Quectel RM500Q R13 firmware which uses Prot=40 for the NMEA port: T: Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 8 Spd=5000 MxCh= 0 D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1 P: Vendor=2c7c ProdID=0800 Rev= 4.14 S: Manufacturer=Quectel S: Product=RM500Q-AE S: SerialNumber=xxxxxxxx C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 4 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 Signed-off-by: Reinhard Speyerer Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 13fde9ac23ca8c6d1ac13cc9eefe1f1ac3ee30a4 Author: Slark Xiao Date: Fri Dec 1 10:09:50 2023 +0800 USB: serial: option: add Foxconn T99W265 with new baseline This ID was added based on latest SDX12 code base line, and we made some changes with previous 0489:e0db. Test evidence as below: T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=5000 MxCh= 0 D: Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 2 P: Vendor=0489 ProdID=e0da Rev=05.04 S: Manufacturer=Qualcomm S: Product=Qualcomm Snapdragon X12 S: SerialNumber=2bda65fb C: #Ifs= 6 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=ff Prot=40 Driver=option I: If#=0x3 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) I: If#=0x4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) 0&1: MBIM, 2: Modem, 3:GNSS, 4:Diag, 5:ADB Signed-off-by: Slark Xiao Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit ec1de5c214eb5a892fdb7c450748249d5e2840f5 Author: Gergo Koteles Date: Fri Dec 15 00:33:27 2023 +0100 ALSA: hda/tas2781: select program 0, conf 0 by default Currently, cur_prog/cur_conf remains at the default value (-1), while program 0 has been loaded into the amplifiers. In the playback hook, tasdevice_tuning_switch tries to restore the cur_prog/cur_conf. In the runtime_resume/system_resume, tasdevice_prmg_load tries to load the cur_prog as well. Set cur_prog and cur_conf to 0 if available in the firmware. Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") CC: stable@vger.kernel.org Signed-off-by: Gergo Koteles Link: https://lore.kernel.org/r/038add0bdca1f979cc7abcce8f24cbcd3544084b.1702596646.git.soyer@irl.hu Signed-off-by: Takashi Iwai commit 02a460adfc4920d4da775fb59ab3e54036daef22 Author: Clément Villeret Date: Thu Dec 14 21:36:32 2023 +0100 ALSA: hda/realtek: Add quirk for ASUS ROG GV302XA Asus ROG Flowx13 (GV302XA) seems require same patch as others asus products Signed-off-by: Clément Villeret Cc: Link: https://lore.kernel.org/r/0a27bf4b-3056-49ac-9651-ebd7f3e36328@gmail.com Signed-off-by: Takashi Iwai commit ef3d5cf9c59cccb012aa6b93d99f4c6eb5d6648e Author: Ira Weiny Date: Mon Oct 16 16:25:05 2023 -0700 cxl/pmu: Ensure put_device on pmu devices The following kmemleaks were detected when removing the cxl module stack: unreferenced object 0xffff88822616b800 (size 1024): ... backtrace: [<00000000bedc6f83>] kmalloc_trace+0x26/0x90 [<00000000448d1afc>] devm_cxl_pmu_add+0x3a/0x110 [cxl_core] [<00000000ca3bfe16>] 0xffffffffa105213b [<00000000ba7f78dc>] local_pci_probe+0x41/0x90 [<000000005bb027ac>] pci_device_probe+0xb0/0x1c0 ... unreferenced object 0xffff8882260abcc0 (size 16): ... hex dump (first 16 bytes): 70 6d 75 5f 6d 65 6d 30 2e 30 00 26 82 88 ff ff pmu_mem0.0.&.... backtrace: ... [<00000000152b5e98>] dev_set_name+0x43/0x50 [<00000000c228798b>] devm_cxl_pmu_add+0x102/0x110 [cxl_core] [<00000000ca3bfe16>] 0xffffffffa105213b [<00000000ba7f78dc>] local_pci_probe+0x41/0x90 [<000000005bb027ac>] pci_device_probe+0xb0/0x1c0 ... unreferenced object 0xffff8882272af200 (size 256): ... backtrace: [<00000000bedc6f83>] kmalloc_trace+0x26/0x90 [<00000000a14d1813>] device_add+0x4ea/0x890 [<00000000a3f07b47>] devm_cxl_pmu_add+0xbe/0x110 [cxl_core] [<00000000ca3bfe16>] 0xffffffffa105213b [<00000000ba7f78dc>] local_pci_probe+0x41/0x90 [<000000005bb027ac>] pci_device_probe+0xb0/0x1c0 ... devm_cxl_pmu_add() correctly registers a device remove function but it only calls device_del() which is only part of device unregistration. Properly call device_unregister() to free up the memory associated with the device. Fixes: 1ad3f701c399 ("cxl/pci: Find and register CXL PMU devices") Cc: Jonathan Cameron Signed-off-by: Ira Weiny Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20231016-pmu-unregister-fix-v1-1-1e2eb2fa3c69@intel.com Signed-off-by: Dan Williams commit 7ba84cbf18c7a53107c64880d9c90f18fa68b481 Author: Lyude Paul Date: Wed Dec 13 19:43:57 2023 -0500 drm/nouveau/kms/nv50-: Don't allow inheritance of headless iors Turns out we made a silly mistake when coming up with OR inheritance on nouveau. On pre-DCB 4.1, iors are statically routed to output paths via the DCB. On later generations iors are only routed to an output path if they're actually being used. Unfortunately, it appears with NVIF_OUTP_INHERIT_V0 we make the mistake of assuming the later is true on all generations, which is currently leading us to return bogus ior -> head assignments through nvif, which causes WARN_ON(). So - fix this by verifying that we actually know that there's a head assigned to an ior before allowing it to be inherited through nvif. This -should- hopefully fix the WARN_ON on GT218 reported by Borislav. Signed-off-by: Lyude Paul Cc: Borislav Petkov Reported-by: Borislav Petkov (AMD) Tested-by: Borislav Petkov (AMD) Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231214004359.1028109-1-lyude@redhat.com commit 46dec61643d7047c9b5929f98a2b7fa4fa93a7dc Author: Thierry Reding Date: Fri Dec 8 11:46:53 2023 +0100 drm/nouveau: Fixup gk20a instobj hierarchy Commit 12c9b05da918 ("drm/nouveau/imem: support allocations not preserved across suspend") uses container_of() to cast from struct nvkm_memory to struct nvkm_instobj, assuming that all instance objects are derived from struct nvkm_instobj. For the gk20a family that's not the case and they are derived from struct nvkm_memory instead. This causes some subtle data corruption (nvkm_instobj.preserve ends up mapping to gk20a_instobj.vaddr) that causes a NULL pointer dereference in gk20a_instobj_acquire_iommu() (and possibly elsewhere) and also prevents suspend/resume from working. Fix this by making struct gk20a_instobj derive from struct nvkm_instobj instead. Fixes: 12c9b05da918 ("drm/nouveau/imem: support allocations not preserved across suspend") Reported-by: Jonathan Hunter Signed-off-by: Thierry Reding Tested-by: Jon Hunter Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231208104653.1917055-1-thierry.reding@gmail.com commit 3f7168591ebf7bbdb91797d02b1afaf00a4289b1 Merge: 976600c6da56c 3a42709fa909e Author: Linus Torvalds Date: Thu Dec 14 19:57:42 2023 -0800 Merge tag '6.7-rc5-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fixes from Steve French: "Address OOBs and NULL dereference found by Dr. Morris's recent analysis and fuzzing. All marked for stable as well" * tag '6.7-rc5-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb: client: fix OOB in smb2_query_reparse_point() smb: client: fix NULL deref in asn1_ber_decoder() smb: client: fix potential OOBs in smb2_parse_contexts() smb: client: fix OOB in receive_encrypted_standard() commit 0225191a769510ed2591e29c5f0dc88f04c7a632 Merge: e9b797dc7af99 3c2a8ebe3fe66 Author: Jakub Kicinski Date: Thu Dec 14 19:04:57 2023 -0800 Merge tag 'wireless-2023-12-14' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Johannes Berg says: ==================== * add (and fix) certificate for regdb handover to Chen-Yu Tsai * fix rfkill GPIO handling * a few driver (iwlwifi, mt76) crash fixes * logic fixes in the stack * tag 'wireless-2023-12-14' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: cfg80211: fix certs build to not depend on file order wifi: mt76: fix crash with WED rx support enabled wifi: iwlwifi: pcie: avoid a NULL pointer dereference wifi: mac80211: mesh_plink: fix matches_local logic wifi: mac80211: mesh: check element parsing succeeded wifi: mac80211: check defragmentation succeeded wifi: mac80211: don't re-add debugfs during reconfig net: rfkill: gpio: set GPIO direction wifi: mac80211: check if the existing link config remains unchanged wifi: cfg80211: Add my certificate wifi: iwlwifi: pcie: add another missing bh-disable for rxq->lock wifi: ieee80211: don't require protected vendor action frames ==================== Link: https://lore.kernel.org/r/20231214111515.60626-3-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski commit e9b797dc7af995ac237b4c0b3a9463c5c54c0ff7 Merge: 2c1a4185a105a b13559b76157d Author: Jakub Kicinski Date: Thu Dec 14 19:00:30 2023 -0800 Merge tag 'mlx5-fixes-2023-12-13' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2023-12-13 This series provides bug fixes to mlx5 driver. * tag 'mlx5-fixes-2023-12-13' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: Correct snprintf truncation handling for fw_version buffer used by representors net/mlx5e: Correct snprintf truncation handling for fw_version buffer net/mlx5e: Fix error codes in alloc_branch_attr() net/mlx5e: Fix error code in mlx5e_tc_action_miss_mapping_get() net/mlx5: Refactor mlx5_flow_destination->rep pointer to vport num net/mlx5: Fix fw tracer first block check net/mlx5e: XDP, Drop fragmented packets larger than MTU size net/mlx5e: Decrease num_block_tc when unblock tc offload net/mlx5e: Fix overrun reported by coverity net/mlx5e: fix a potential double-free in fs_udp_create_groups net/mlx5e: Fix a race in command alloc flow net/mlx5e: Fix slab-out-of-bounds in mlx5_query_nic_vport_mac_list() net/mlx5e: fix double free of encap_header Revert "net/mlx5e: fix double free of encap_header" Revert "net/mlx5e: fix double free of encap_header in update funcs" ==================== Link: https://lore.kernel.org/r/20231214012505.42666-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 2c1a4185a105a252582056b642b2c294bc6ba980 Merge: 70f010da00f90 9b3daf2b0443e Author: Jakub Kicinski Date: Thu Dec 14 18:57:39 2023 -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 2023-12-13 (ice, i40e) This series contains updates to ice and i40e drivers. Michal Schmidt prevents possible out-of-bounds access for ice. Ivan Vecera corrects value for MDIO clause 45 on i40e. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: i40e: Fix ST code value for Clause 45 ice: fix theoretical out-of-bounds access in ethtool link modes ==================== Link: https://lore.kernel.org/r/20231213220827.1311772-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit f8678a336808f728ea2e0806cfc10362958ca4e5 Merge: 7beae48301f7c 6c9dbee84cd00 Author: Dave Airlie Date: Fri Dec 15 12:47:11 2023 +1000 Merge tag 'drm-misc-fixes-2023-12-14' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v6.7-rc6: - Fix regression for checking if FD is master capable. - Fix uninitialized variables in drm/crtc. - Fix ivpu w/a. - Refresh modes correctly when updating EDID. - Small panel fixes. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/2d46b68f-c5a4-45e5-beb4-411569f4aac8@linux.intel.com commit 7beae48301f7ca214939e522051007b9b4daf178 Merge: 51af5563423c6 a4236c4b41085 Author: Dave Airlie Date: Fri Dec 15 12:21:42 2023 +1000 Merge tag 'amd-drm-fixes-6.7-2023-12-13' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.7-2023-12-13: amdgpu: - Fix suspend fix that got accidently mangled last week - Fix OD regression - PSR fixes - OLED Backlight regression fix - JPEG 4.0.5 fix - Misc display fixes - SDMA 5.2 fix - SDMA 2.4 regression fix - GPUVM race fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20231213221122.4937-1-alexander.deucher@amd.com commit 70f010da00f90415296f93fb47a561977eae41cb Author: Vladimir Oltean Date: Thu Dec 14 02:09:02 2023 +0200 net: mscc: ocelot: fix pMAC TX RMON stats for bucket 256-511 and above The typo from ocelot_port_rmon_stats_cb() was also carried over to ocelot_port_pmac_rmon_stats_cb() as well, leading to incorrect TX RMON stats for the pMAC too. Fixes: ab3f97a9610a ("net: mscc: ocelot: export ethtool MAC Merge stats for Felix VSC9959") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20231214000902.545625-2-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 52eda4641d041667fa059f4855c5f88dcebd8afe Author: Vladimir Oltean Date: Thu Dec 14 02:09:01 2023 +0200 net: mscc: ocelot: fix eMAC TX RMON stats for bucket 256-511 and above There is a typo in the driver due to which we report incorrect TX RMON counters for the 256-511 octet bucket and all the other buckets larger than that. Bug found with the selftest at https://patchwork.kernel.org/project/netdevbpf/patch/20231211223346.2497157-9-tobias@waldekranz.com/ Fixes: e32036e1ae7b ("net: mscc: ocelot: add support for all sorts of standardized counters present in DSA") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20231214000902.545625-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 976600c6da56c488776c9ee2a5733ae9736e2a75 Merge: c7402612e2e61 7bcd032370f88 Author: Linus Torvalds Date: Thu Dec 14 17:15:33 2023 -0800 Merge tag 'platform-drivers-x86-v6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Ilpo Järvinen: - tablet-mode-switch events fix - kernel-doc warning fixes * tag 'platform-drivers-x86-v6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: intel_ips: fix kernel-doc formatting platform/x86: thinkpad_acpi: fix kernel-doc warnings platform/x86: intel-vbtn: Fix missing tablet-mode-switch events commit 51af5563423c6e8537da8b6bd485b46c2b0d6492 Merge: 2fda61748214c e6861d8264cd4 Author: Dave Airlie Date: Fri Dec 15 11:12:40 2023 +1000 Merge tag 'drm-intel-fixes-2023-12-13' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v6.7-rc6: - Fix selftest engine reset count storage for multi-tile - Fix out-of-bounds reads for engine reset counts - Fix ADL+ remapped stride with CCS - Fix intel_atomic_setup_scalers() plane_state handling - Fix ADL+ tiled plane stride when the POT stride is smaller than the original - Fix eDP 1.4 rate select method link configuration Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/871qbqw4rw.fsf@intel.com commit 1ba0e9d69b2000e95267c888cbfa91d823388d47 Author: Al Viro Date: Thu Dec 14 21:34:08 2023 +0000 io_uring/cmd: fix breakage in SOCKET_URING_OP_SIOC* implementation In 8e9fad0e70b7 "io_uring: Add io_uring command support for sockets" you've got an include of asm-generic/ioctls.h done in io_uring/uring_cmd.c. That had been done for the sake of this chunk - + ret = prot->ioctl(sk, SIOCINQ, &arg); + if (ret) + return ret; + return arg; + case SOCKET_URING_OP_SIOCOUTQ: + ret = prot->ioctl(sk, SIOCOUTQ, &arg); SIOC{IN,OUT}Q are defined to symbols (FIONREAD and TIOCOUTQ) that come from ioctls.h, all right, but the values vary by the architecture. FIONREAD is 0x467F on mips 0x4004667F on alpha, powerpc and sparc 0x8004667F on sh and xtensa 0x541B everywhere else TIOCOUTQ is 0x7472 on mips 0x40047473 on alpha, powerpc and sparc 0x80047473 on sh and xtensa 0x5411 everywhere else ->ioctl() expects the same values it would've gotten from userland; all places where we compare with SIOC{IN,OUT}Q are using asm/ioctls.h, so they pick the correct values. io_uring_cmd_sock(), OTOH, ends up passing the default ones. Fixes: 8e9fad0e70b7 ("io_uring: Add io_uring command support for sockets") Cc: Signed-off-by: Al Viro Link: https://lore.kernel.org/r/20231214213408.GT1674809@ZenIV Signed-off-by: Jens Axboe commit c7402612e2e61b76177f22e6e7f705adcbecc6fe Merge: bdb2701f0b682 7bb26ea74aa86 Author: Linus Torvalds Date: Thu Dec 14 13:11:49 2023 -0800 Merge tag 'net-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Current release - regressions: - tcp: fix tcp_disordered_ack() vs usec TS resolution Current release - new code bugs: - dpll: sanitize possible null pointer dereference in dpll_pin_parent_pin_set() - eth: octeon_ep: initialise control mbox tasks before using APIs Previous releases - regressions: - io_uring/af_unix: disable sending io_uring over sockets - eth: mlx5e: - TC, don't offload post action rule if not supported - fix possible deadlock on mlx5e_tx_timeout_work - eth: iavf: fix iavf_shutdown to call iavf_remove instead iavf_close - eth: bnxt_en: fix skb recycling logic in bnxt_deliver_skb() - eth: ena: fix DMA syncing in XDP path when SWIOTLB is on - eth: team: fix use-after-free when an option instance allocation fails Previous releases - always broken: - neighbour: don't let neigh_forced_gc() disable preemption for long - net: prevent mss overflow in skb_segment() - ipv6: support reporting otherwise unknown prefix flags in RTM_NEWPREFIX - tcp: remove acked SYN flag from packet in the transmit queue correctly - eth: octeontx2-af: - fix a use-after-free in rvu_nix_register_reporters - fix promisc mcam entry action - eth: dwmac-loongson: make sure MDIO is initialized before use - eth: atlantic: fix double free in ring reinit logic" * tag 'net-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (62 commits) net: atlantic: fix double free in ring reinit logic appletalk: Fix Use-After-Free in atalk_ioctl net: stmmac: Handle disabled MDIO busses from devicetree net: stmmac: dwmac-qcom-ethqos: Fix drops in 10M SGMII RX dpaa2-switch: do not ask for MDB, VLAN and FDB replay dpaa2-switch: fix size of the dma_unmap net: prevent mss overflow in skb_segment() vsock/virtio: Fix unsigned integer wrap around in virtio_transport_has_space() Revert "tcp: disable tcp_autocorking for socket when TCP_NODELAY flag is set" MIPS: dts: loongson: drop incorrect dwmac fallback compatible stmmac: dwmac-loongson: drop useless check for compatible fallback stmmac: dwmac-loongson: Make sure MDIO is initialized before use tcp: disable tcp_autocorking for socket when TCP_NODELAY flag is set dpll: sanitize possible null pointer dereference in dpll_pin_parent_pin_set() net: ena: Fix XDP redirection error net: ena: Fix DMA syncing in XDP path when SWIOTLB is on net: ena: Fix xdp drops handling due to multibuf packets net: ena: Destroy correct number of xdp queues upon failure net: Remove acked SYN flag from packet in the transmit queue correctly qed: Fix a potential use-after-free in qed_cxt_tables_alloc ... commit d73ad797c83b0777407a2200bbefa3cb82759247 Merge: 81556f228c0e7 4a6756f56bcf8 Author: Arnd Bergmann Date: Thu Dec 14 21:02:22 2023 +0000 Merge tag 'reset-fixes-for-v6.7' of git://git.pengutronix.de/pza/linux into arm/fixes Reset controller fixes for v6.7 Fix a void-pointer-to-enum-cast warning in the hisilicon hi6220 reset driver and fix a NULL pointer dereference when freeing non-existent optional resets requested via the reset_array API in the core. * tag 'reset-fixes-for-v6.7' of git://git.pengutronix.de/pza/linux: reset: Fix crash when freeing non-existent optional resets reset: hisilicon: hi6220: fix Wvoid-pointer-to-enum-cast warning Link: https://lore.kernel.org/r/20231213152606.231044-1-p.zabel@pengutronix.de Signed-off-by: Arnd Bergmann commit 81556f228c0e7b3681e1002eb182efc4c1410c72 Merge: a39b6ac3781d4 b9622937d9580 Author: Arnd Bergmann Date: Thu Dec 14 21:01:40 2023 +0000 Merge tag 'sunxi-fixes-for-6.7-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/fixes - Fix ethernet node for Orange Pi Zero 3 board * tag 'sunxi-fixes-for-6.7-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: arm64: dts: allwinner: h616: update emac for Orange Pi Zero 3 Link: https://lore.kernel.org/r/ZXtVUJ0SG2NRpPG4@archlinux Signed-off-by: Arnd Bergmann commit 85c6db980989ddc119ea1647ad72a4ec5a4e06f2 Author: Daniel Hill Date: Tue Dec 5 19:10:28 2023 +1300 bcachefs: improve modprobe support by providing softdeps We need to help modprobe load architecture specific modules so we don't fall back to generic software implementations, this should help performance when building as a module. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 50a8a732d2db64507ba7cd4ebe66538d9c40bea8 Author: Thomas Bertschinger Date: Thu Dec 14 12:06:41 2023 -0700 bcachefs: fix invalid memory access in bch2_fs_alloc() error path When bch2_fs_alloc() gets an error before calling bch2_fs_btree_iter_init(), bch2_fs_btree_iter_exit() makes an invalid memory access because btree_trans_list is uninitialized. Signed-off-by: Thomas Bertschinger Fixes: 6bd68ec266ad ("bcachefs: Heap allocate btree_trans") Signed-off-by: Kent Overstreet commit bdb2701f0b6822d711ec34968ccef70b73a91da7 Merge: 829649443e78d e85a0adacf170 Author: Linus Torvalds Date: Thu Dec 14 11:53:00 2023 -0800 Merge tag 'for-6.7-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "Some fixes to quota accounting code, mostly around error handling and correctness: - free reserves on various error paths, after IO errors or transaction abort - don't clear reserved range at the folio release time, it'll be properly cleared after final write - fix integer overflow due to int used when passing around size of freed reservations - fix a regression in squota accounting that missed some cases with delayed refs" * tag 'for-6.7-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: ensure releasing squota reserve on head refs btrfs: don't clear qgroup reserved bit in release_folio btrfs: free qgroup pertrans reserve on transaction abort btrfs: fix qgroup_free_reserved_data int overflow btrfs: free qgroup reserve when ORDERED_IOERR is set commit 7bb26ea74aa86fdf894b7dbd8c5712c5b4187da7 Author: Igor Russkikh Date: Wed Dec 13 10:40:44 2023 +0100 net: atlantic: fix double free in ring reinit logic Driver has a logic leak in ring data allocation/free, where double free may happen in aq_ring_free if system is under stress and driver init/deinit is happening. The probability is higher to get this during suspend/resume cycle. Verification was done simulating same conditions with stress -m 2000 --vm-bytes 20M --vm-hang 10 --backoff 1000 while true; do sudo ifconfig enp1s0 down; sudo ifconfig enp1s0 up; done Fixed by explicitly clearing pointers to NULL on deallocation Fixes: 018423e90bee ("net: ethernet: aquantia: Add ring support code") Reported-by: Linus Torvalds Closes: https://lore.kernel.org/netdev/CAHk-=wiZZi7FcvqVSUirHBjx0bBUZ4dFrMDVLc3+3HCrtq0rBA@mail.gmail.com/ Signed-off-by: Igor Russkikh Link: https://lore.kernel.org/r/20231213094044.22988-1-irusskikh@marvell.com Signed-off-by: Paolo Abeni commit 315deab289924c83ab1ded50022e8db95d6e428b Author: Gergo Koteles Date: Thu Dec 14 00:49:20 2023 +0100 ALSA: hda/tas2781: reset the amp before component_add Calling component_add starts loading the firmware, the callback function writes the program to the amplifiers. If the module resets the amplifiers after component_add, it happens that one of the amplifiers does not work because the reset and program writing are interleaving. Call tas2781_reset before component_add to ensure reliable initialization. Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") CC: stable@vger.kernel.org Signed-off-by: Gergo Koteles Link: https://lore.kernel.org/r/4d23bf58558e23ee8097de01f70f1eb8d9de2d15.1702511246.git.soyer@irl.hu Signed-off-by: Takashi Iwai commit 6c6fa2641402e8e753262fb61ed9a15a7cb225ad Author: Gergo Koteles Date: Thu Dec 14 00:28:16 2023 +0100 ALSA: hda/tas2781: call cleanup functions only once If the module can load the RCA but not the firmware binary, it will call the cleanup functions. Then unloading the module causes general protection fault due to double free. Do not call the cleanup functions in tasdev_fw_ready. general protection fault, probably for non-canonical address 0x6f2b8a2bff4c8fec: 0000 [#1] PREEMPT SMP NOPTI Call Trace: ? die_addr+0x36/0x90 ? exc_general_protection+0x1c5/0x430 ? asm_exc_general_protection+0x26/0x30 ? tasdevice_config_info_remove+0x6d/0xd0 [snd_soc_tas2781_fmwlib] tas2781_hda_unbind+0xaa/0x100 [snd_hda_scodec_tas2781_i2c] component_unbind+0x2e/0x50 component_unbind_all+0x92/0xa0 component_del+0xa8/0x140 tas2781_hda_remove.isra.0+0x32/0x60 [snd_hda_scodec_tas2781_i2c] i2c_device_remove+0x26/0xb0 Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") CC: stable@vger.kernel.org Signed-off-by: Gergo Koteles Link: https://lore.kernel.org/r/1a0885c424bb21172702d254655882b59ef6477a.1702510018.git.soyer@irl.hu Signed-off-by: Takashi Iwai commit 189ff16722ee36ced4d2a2469d4ab65a8fee4198 Author: Hyunwoo Kim Date: Tue Dec 12 23:10:56 2023 -0500 appletalk: Fix Use-After-Free in atalk_ioctl Because atalk_ioctl() accesses sk->sk_receive_queue without holding a sk->sk_receive_queue.lock, it can cause a race with atalk_recvmsg(). A use-after-free for skb occurs with the following flow. ``` atalk_ioctl() -> skb_peek() atalk_recvmsg() -> skb_recv_datagram() -> skb_free_datagram() ``` Add sk->sk_receive_queue.lock to atalk_ioctl() to fix this issue. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Hyunwoo Kim Link: https://lore.kernel.org/r/20231213041056.GA519680@v4bel-B760M-AORUS-ELITE-AX Signed-off-by: Paolo Abeni commit e23c0d21ce9234fbc31ece35663ababbb83f9347 Author: Andrew Halaney Date: Tue Dec 12 16:18:33 2023 -0600 net: stmmac: Handle disabled MDIO busses from devicetree Many hardware configurations have the MDIO bus disabled, and are instead using some other MDIO bus to talk to the MAC's phy. of_mdiobus_register() returns -ENODEV in this case. Let's handle it gracefully instead of failing to probe the MAC. Fixes: 47dd7a540b8a ("net: add support for STMicroelectronics Ethernet controllers.") Signed-off-by: Andrew Halaney Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20231212-b4-stmmac-handle-mdio-enodev-v2-1-600171acf79f@redhat.com Signed-off-by: Paolo Abeni commit fc70d643a2f6678cbe0f5c86433c1aeb4d613fcc Author: Louis Chauvet Date: Mon Dec 4 16:49:03 2023 +0100 spi: atmel: Fix clock issue when using devices with different polarities The current Atmel SPI controller driver (v2) behaves incorrectly when using two SPI devices with different clock polarities and GPIO CS. When switching from one device to another, the controller driver first enables the CS and then applies whatever configuration suits the targeted device (typically, the polarities). The side effect of such order is the apparition of a spurious clock edge after enabling the CS when the clock polarity needs to be inverted wrt. the previous configuration of the controller. This parasitic clock edge is problematic when the SPI device uses that edge for internal processing, which is perfectly legitimate given that its CS was asserted. Indeed, devices such as HVS8080 driven by driver gpio-sr in the kernel are shift registers and will process this first clock edge to perform a first register shift. In this case, the first bit gets lost and the whole data block that will later be read by the kernel is all shifted by one. Current behavior: The actual switching of the clock polarity only occurs after the CS when the controller sends the first message: CLK ------------\ /-\ /-\ | | | | | . . . \---/ \-/ \ CS -----\ | \------------------ ^ ^ ^ | | | | | Actual clock of the message sent | | | Change of clock polarity, which occurs with the first | write to the bus. This edge occurs when the CS is | already asserted, and can be interpreted as | the first clock edge by the receiver. | GPIO CS toggle This issue is specific to this controller because while the SPI core performs the operations in the right order, the controller however does not. In practice, the controller only applies the clock configuration right before the first transmission. So this is not a problem when using the controller's dedicated CS, as the controller does things correctly, but it becomes a problem when you need to change the clock polarity and use an external GPIO for the CS. One possible approach to solve this problem is to send a dummy message before actually activating the CS, so that the controller applies the clock polarity beforehand. New behavior: CLK ------\ /-\ /-\ /-\ /-\ | | | ... | | | | ... | | \------/ \- -/ \------/ \- -/ \------ CS -\/-----------------------\ || | \/ \--------------------- ^ ^ ^ ^ ^ | | | | | | | | | Expected clock cycles when | | | | sending the message | | | | | | | Actual GPIO CS activation, occurs inside | | | the driver | | | | | Dummy message, to trigger clock polarity | | reconfiguration. This message is not received and | | processed by the device because CS is low. | | | Change of clock polarity, forced by the dummy message. This | time, the edge is not detected by the receiver. | This small spike in CS activation is due to the fact that the spi-core activates the CS gpio before calling the driver's set_cs callback, which deactivates this gpio again until the clock polarity is correct. To avoid having to systematically send a dummy packet, the driver keeps track of the clock's current polarity. In this way, it only sends the dummy packet when necessary, ensuring that the clock will have the correct polarity when the CS is toggled. There could be two hardware problems with this patch: 1- Maybe the small CS activation peak can confuse SPI devices 2- If on a design, a single wire is used to select two devices depending on its state, the dummy message may disturb them. Fixes: 5ee36c989831 ("spi: atmel_spi update chipselect handling") Cc: Signed-off-by: Louis Chauvet Link: https://msgid.link/r/20231204154903.11607-1-louis.chauvet@bootlin.com Signed-off-by: Mark Brown commit 981d947bcd382c3950a593690e0e13d194d65b1c Author: Sneh Shah Date: Tue Dec 12 14:52:08 2023 +0530 net: stmmac: dwmac-qcom-ethqos: Fix drops in 10M SGMII RX In 10M SGMII mode all the packets are being dropped due to wrong Rx clock. SGMII 10MBPS mode needs RX clock divider programmed to avoid drops in Rx. Update configure SGMII function with Rx clk divider programming. Fixes: 463120c31c58 ("net: stmmac: dwmac-qcom-ethqos: add support for SGMII") Tested-by: Andrew Halaney Signed-off-by: Sneh Shah Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20231212092208.22393-1-quic_snehshah@quicinc.com Signed-off-by: Paolo Abeni commit 3c2a8ebe3fe66a5f77d4c164a0bea8e2ff37b455 Author: Johannes Berg Date: Thu Dec 14 09:08:16 2023 +0100 wifi: cfg80211: fix certs build to not depend on file order The file for the new certificate (Chen-Yu Tsai's) didn't end with a comma, so depending on the file order in the build rule, we'd end up with invalid C when concatenating the (now two) certificates. Fix that. Cc: stable@vger.kernel.org Reported-by: Biju Das Reported-by: Naresh Kamboju Fixes: fb768d3b13ff ("wifi: cfg80211: Add my certificate") Signed-off-by: Johannes Berg commit 89e0c6467eefec542e49712d987086cb2a43d7a3 Merge: dc84bb19b5d07 7ae42ef308ed0 Author: Jakub Kicinski Date: Wed Dec 13 22:03:01 2023 -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 2023-12-12 (iavf) This series contains updates to iavf driver only. Piotr reworks Flow Director states to deal with issues in restoring filters. Slawomir fixes shutdown processing as it was missing needed calls. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: iavf: Fix iavf_shutdown to call iavf_remove instead iavf_close iavf: Handle ntuple on/off based on new state machines for flow director iavf: Introduce new state machines for flow director ==================== Link: https://lore.kernel.org/r/20231212203613.513423-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 1cc111b9cddc71ce161cd388f11f0e9048edffdb Author: Zheng Yejian Date: Thu Dec 14 09:21:53 2023 +0800 tracing: Fix uaf issue when open the hist or hist_debug file KASAN report following issue. The root cause is when opening 'hist' file of an instance and accessing 'trace_event_file' in hist_show(), but 'trace_event_file' has been freed due to the instance being removed. 'hist_debug' file has the same problem. To fix it, call tracing_{open,release}_file_tr() in file_operations callback to have the ref count and avoid 'trace_event_file' being freed. BUG: KASAN: slab-use-after-free in hist_show+0x11e0/0x1278 Read of size 8 at addr ffff242541e336b8 by task head/190 CPU: 4 PID: 190 Comm: head Not tainted 6.7.0-rc5-g26aff849438c #133 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x98/0xf8 show_stack+0x1c/0x30 dump_stack_lvl+0x44/0x58 print_report+0xf0/0x5a0 kasan_report+0x80/0xc0 __asan_report_load8_noabort+0x1c/0x28 hist_show+0x11e0/0x1278 seq_read_iter+0x344/0xd78 seq_read+0x128/0x1c0 vfs_read+0x198/0x6c8 ksys_read+0xf4/0x1e0 __arm64_sys_read+0x70/0xa8 invoke_syscall+0x70/0x260 el0_svc_common.constprop.0+0xb0/0x280 do_el0_svc+0x44/0x60 el0_svc+0x34/0x68 el0t_64_sync_handler+0xb8/0xc0 el0t_64_sync+0x168/0x170 Allocated by task 188: kasan_save_stack+0x28/0x50 kasan_set_track+0x28/0x38 kasan_save_alloc_info+0x20/0x30 __kasan_slab_alloc+0x6c/0x80 kmem_cache_alloc+0x15c/0x4a8 trace_create_new_event+0x84/0x348 __trace_add_new_event+0x18/0x88 event_trace_add_tracer+0xc4/0x1a0 trace_array_create_dir+0x6c/0x100 trace_array_create+0x2e8/0x568 instance_mkdir+0x48/0x80 tracefs_syscall_mkdir+0x90/0xe8 vfs_mkdir+0x3c4/0x610 do_mkdirat+0x144/0x200 __arm64_sys_mkdirat+0x8c/0xc0 invoke_syscall+0x70/0x260 el0_svc_common.constprop.0+0xb0/0x280 do_el0_svc+0x44/0x60 el0_svc+0x34/0x68 el0t_64_sync_handler+0xb8/0xc0 el0t_64_sync+0x168/0x170 Freed by task 191: kasan_save_stack+0x28/0x50 kasan_set_track+0x28/0x38 kasan_save_free_info+0x34/0x58 __kasan_slab_free+0xe4/0x158 kmem_cache_free+0x19c/0x508 event_file_put+0xa0/0x120 remove_event_file_dir+0x180/0x320 event_trace_del_tracer+0xb0/0x180 __remove_instance+0x224/0x508 instance_rmdir+0x44/0x78 tracefs_syscall_rmdir+0xbc/0x140 vfs_rmdir+0x1cc/0x4c8 do_rmdir+0x220/0x2b8 __arm64_sys_unlinkat+0xc0/0x100 invoke_syscall+0x70/0x260 el0_svc_common.constprop.0+0xb0/0x280 do_el0_svc+0x44/0x60 el0_svc+0x34/0x68 el0t_64_sync_handler+0xb8/0xc0 el0t_64_sync+0x168/0x170 Link: https://lore.kernel.org/linux-trace-kernel/20231214012153.676155-1-zhengyejian1@huawei.com Suggested-by: Steven Rostedt Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit 9a733dc4fbeec3f6d99645b845712b035e7440cf Author: Pavel Kozlov Date: Wed Dec 13 19:07:10 2023 +0400 ARC: add hugetlb definitions Add hugetlb definitions if THP enabled. ARC doesn't support HugeTLB FS but it supports THP. Some kernel code such as pagemap uses hugetlb definitions with THP. This patch fixes ARC build issue (HPAGE_SIZE undeclared error) with TRANSPARENT_HUGEPAGE enabled. Signed-off-by: Pavel Kozlov Signed-off-by: Vineet Gupta commit 77a67255609606164e1042f3bf7452a568a700e4 Author: Nitin Rawat Date: Fri Dec 8 18:43:31 2023 +0530 scsi: ufs: core: Store min and max clk freq from OPP table OPP support added by commit 72208ebe181e ("scsi: ufs: core: Add support for parsing OPP") doesn't update the min_freq and max_freq of each clock in 'struct ufs_clk_info'. But these values are used by the host drivers internally for controller configuration. When the OPP support is enabled in devicetree, these values will be 0, causing boot issues on the respective platforms. So add support to parse the min_freq and max_freq of all clocks while parsing the OPP table. Fixes: 72208ebe181e ("scsi: ufs: core: Add support for parsing OPP") Co-developed-by: Manish Pandey Signed-off-by: Manish Pandey Signed-off-by: Nitin Rawat Link: https://lore.kernel.org/r/20231208131331.12596-1-quic_nitirawa@quicinc.com Reviewed-by: Manivannan Sadhasivam Signed-off-by: Martin K. Petersen commit dc84bb19b5d074f09f40c83fa68da5b03ad4fbd6 Merge: 23d05d563b7e7 f24a49a375f65 Author: Jakub Kicinski Date: Wed Dec 13 18:38:56 2023 -0800 Merge branch 'dpaa2-switch-various-fixes' Ioana Ciornei says: ==================== dpaa2-switch: various fixes The first patch fixes the size passed to two dma_unmap_single() calls which was wrongly put as the size of the pointer. The second patch is new to this series and reverts the behavior of the dpaa2-switch driver to not ask for object replay upon offloading so that we avoid the errors encountered when a VLAN is installed multiple times on the same port. ==================== Link: https://lore.kernel.org/r/20231212164326.2753457-1-ioana.ciornei@nxp.com Signed-off-by: Jakub Kicinski commit f24a49a375f65e8e75ee1b19d806f46dbaae57fd Author: Ioana Ciornei Date: Tue Dec 12 18:43:26 2023 +0200 dpaa2-switch: do not ask for MDB, VLAN and FDB replay Starting with commit 4e51bf44a03a ("net: bridge: move the switchdev object replay helpers to "push" mode") the switchdev_bridge_port_offload() helper was extended with the intention to provide switchdev drivers easy access to object addition and deletion replays. This works by calling the replay helpers with non-NULL notifier blocks. In the same commit, the dpaa2-switch driver was updated so that it passes valid notifier blocks to the helper. At that moment, no regression was identified through testing. In the meantime, the blamed commit changed the behavior in terms of which ports get hit by the replay. Before this commit, only the initial port which identified itself as offloaded through switchdev_bridge_port_offload() got a replay of all port objects and FDBs. After this, the newly joining port will trigger a replay of objects on all bridge ports and on the bridge itself. This behavior leads to errors in dpaa2_switch_port_vlans_add() when a VLAN gets installed on the same interface multiple times. The intended mechanism to address this is to pass a non-NULL ctx to the switchdev_bridge_port_offload() helper and then check it against the port's private structure. But since the driver does not have any use for the replayed port objects and FDBs until it gains support for LAG offload, it's better to fix the issue by reverting the dpaa2-switch driver to not ask for replay. The pointers will be added back when we are prepared to ignore replays on unrelated ports. Fixes: b28d580e2939 ("net: bridge: switchdev: replay all VLAN groups") Signed-off-by: Ioana Ciornei Link: https://lore.kernel.org/r/20231212164326.2753457-3-ioana.ciornei@nxp.com Signed-off-by: Jakub Kicinski commit 2aad7d4189a923b24efa8ea6ad09059882b1bfe4 Author: Ioana Ciornei Date: Tue Dec 12 18:43:25 2023 +0200 dpaa2-switch: fix size of the dma_unmap The size of the DMA unmap was wrongly put as a sizeof of a pointer. Change the value of the DMA unmap to be the actual macro used for the allocation and the DMA map. Fixes: 1110318d83e8 ("dpaa2-switch: add tc flower hardware offload on ingress traffic") Signed-off-by: Ioana Ciornei Link: https://lore.kernel.org/r/20231212164326.2753457-2-ioana.ciornei@nxp.com Signed-off-by: Jakub Kicinski commit 23d05d563b7e7b0314e65c8e882bc27eac2da8e7 Author: Eric Dumazet Date: Tue Dec 12 16:46:21 2023 +0000 net: prevent mss overflow in skb_segment() Once again syzbot is able to crash the kernel in skb_segment() [1] GSO_BY_FRAGS is a forbidden value, but unfortunately the following computation in skb_segment() can reach it quite easily : mss = mss * partial_segs; 65535 = 3 * 5 * 17 * 257, so many initial values of mss can lead to a bad final result. Make sure to limit segmentation so that the new mss value is smaller than GSO_BY_FRAGS. [1] general protection fault, probably for non-canonical address 0xdffffc000000000e: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000070-0x0000000000000077] CPU: 1 PID: 5079 Comm: syz-executor993 Not tainted 6.7.0-rc4-syzkaller-00141-g1ae4cd3cbdd0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 RIP: 0010:skb_segment+0x181d/0x3f30 net/core/skbuff.c:4551 Code: 83 e3 02 e9 fb ed ff ff e8 90 68 1c f9 48 8b 84 24 f8 00 00 00 48 8d 78 70 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 8a 21 00 00 48 8b 84 24 f8 00 RSP: 0018:ffffc900043473d0 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000010046 RCX: ffffffff886b1597 RDX: 000000000000000e RSI: ffffffff886b2520 RDI: 0000000000000070 RBP: ffffc90004347578 R08: 0000000000000005 R09: 000000000000ffff R10: 000000000000ffff R11: 0000000000000002 R12: ffff888063202ac0 R13: 0000000000010000 R14: 000000000000ffff R15: 0000000000000046 FS: 0000555556e7e380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020010000 CR3: 0000000027ee2000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: udp6_ufo_fragment+0xa0e/0xd00 net/ipv6/udp_offload.c:109 ipv6_gso_segment+0x534/0x17e0 net/ipv6/ip6_offload.c:120 skb_mac_gso_segment+0x290/0x610 net/core/gso.c:53 __skb_gso_segment+0x339/0x710 net/core/gso.c:124 skb_gso_segment include/net/gso.h:83 [inline] validate_xmit_skb+0x36c/0xeb0 net/core/dev.c:3626 __dev_queue_xmit+0x6f3/0x3d60 net/core/dev.c:4338 dev_queue_xmit include/linux/netdevice.h:3134 [inline] packet_xmit+0x257/0x380 net/packet/af_packet.c:276 packet_snd net/packet/af_packet.c:3087 [inline] packet_sendmsg+0x24c6/0x5220 net/packet/af_packet.c:3119 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 __sys_sendto+0x255/0x340 net/socket.c:2190 __do_sys_sendto net/socket.c:2202 [inline] __se_sys_sendto net/socket.c:2198 [inline] __x64_sys_sendto+0xe0/0x1b0 net/socket.c:2198 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f8692032aa9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 d1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fff8d685418 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f8692032aa9 RDX: 0000000000010048 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00000000000f4240 R08: 0000000020000540 R09: 0000000000000014 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff8d685480 R13: 0000000000000001 R14: 00007fff8d685480 R15: 0000000000000003 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:skb_segment+0x181d/0x3f30 net/core/skbuff.c:4551 Code: 83 e3 02 e9 fb ed ff ff e8 90 68 1c f9 48 8b 84 24 f8 00 00 00 48 8d 78 70 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 8a 21 00 00 48 8b 84 24 f8 00 RSP: 0018:ffffc900043473d0 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000010046 RCX: ffffffff886b1597 RDX: 000000000000000e RSI: ffffffff886b2520 RDI: 0000000000000070 RBP: ffffc90004347578 R08: 0000000000000005 R09: 000000000000ffff R10: 000000000000ffff R11: 0000000000000002 R12: ffff888063202ac0 R13: 0000000000010000 R14: 000000000000ffff R15: 0000000000000046 FS: 0000555556e7e380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020010000 CR3: 0000000027ee2000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Fixes: 3953c46c3ac7 ("sk_buff: allow segmenting based on frag sizes") Signed-off-by: Eric Dumazet Cc: Marcelo Ricardo Leitner Reviewed-by: Willem de Bruijn Link: https://lore.kernel.org/r/20231212164621.4131800-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 60316d7f10b17a7ebb1ead0642fee8710e1560e0 Author: Nikolay Kuratov Date: Mon Dec 11 19:23:17 2023 +0300 vsock/virtio: Fix unsigned integer wrap around in virtio_transport_has_space() We need to do signed arithmetic if we expect condition `if (bytes < 0)` to be possible Found by Linux Verification Center (linuxtesting.org) with SVACE Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko") Signed-off-by: Nikolay Kuratov Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20231211162317.4116625-1-kniv@yandex-team.ru Signed-off-by: Jakub Kicinski commit b13559b76157de9d74f04d3ca0e49d69de3b5675 Author: Rahul Rameshbabu Date: Tue Nov 21 15:00:22 2023 -0800 net/mlx5e: Correct snprintf truncation handling for fw_version buffer used by representors snprintf returns the length of the formatted string, excluding the trailing null, without accounting for truncation. This means that is the return value is greater than or equal to the size parameter, the fw_version string was truncated. Link: https://docs.kernel.org/core-api/kernel-api.html#c.snprintf Fixes: 1b2bd0c0264f ("net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors") Signed-off-by: Rahul Rameshbabu Reviewed-by: Simon Horman Signed-off-by: Saeed Mahameed commit ad436b9c1270c40554e274f067f1b78fcc06a004 Author: Rahul Rameshbabu Date: Tue Nov 21 15:00:21 2023 -0800 net/mlx5e: Correct snprintf truncation handling for fw_version buffer snprintf returns the length of the formatted string, excluding the trailing null, without accounting for truncation. This means that is the return value is greater than or equal to the size parameter, the fw_version string was truncated. Reported-by: David Laight Closes: https://lore.kernel.org/netdev/81cae734ee1b4cde9b380a9a31006c1a@AcuMS.aculab.com/ Link: https://docs.kernel.org/core-api/kernel-api.html#c.snprintf Fixes: 41e63c2baa11 ("net/mlx5e: Check return value of snprintf writing to fw_version buffer") Signed-off-by: Rahul Rameshbabu Reviewed-by: Simon Horman Signed-off-by: Saeed Mahameed commit d792e5f7f19b95f5ce41ac49df5ead4d280238f4 Author: Dan Carpenter Date: Wed Dec 13 17:08:57 2023 +0300 net/mlx5e: Fix error codes in alloc_branch_attr() Set the error code if set_branch_dest_ft() fails. Fixes: ccbe33003b10 ("net/mlx5e: TC, Don't offload post action rule if not supported") Signed-off-by: Dan Carpenter Signed-off-by: Saeed Mahameed commit 86d5922679f3b6d02a64df66cdd777fdd4ea5c0d Author: Dan Carpenter Date: Wed Dec 13 17:08:17 2023 +0300 net/mlx5e: Fix error code in mlx5e_tc_action_miss_mapping_get() Preserve the error code if esw_add_restore_rule() fails. Don't return success. Fixes: 6702782845a5 ("net/mlx5e: TC, Set CT miss to the specific ct action instance") Signed-off-by: Dan Carpenter Signed-off-by: Saeed Mahameed commit 04ad04e4fdd10f92ef4f2b3f6227ec9824682197 Author: Vlad Buslov Date: Fri Oct 6 15:22:22 2023 +0200 net/mlx5: Refactor mlx5_flow_destination->rep pointer to vport num Currently the destination rep pointer is only used for comparisons or to obtain vport number from it. Since it is used both during flow creation and deletion it may point to representor of another eswitch instance which can be deallocated during driver unload even when there are rules pointing to it[0]. Refactor the code to store vport number and 'valid' flag instead of the representor pointer. [0]: [176805.886303] ================================================================== [176805.889433] BUG: KASAN: slab-use-after-free in esw_cleanup_dests+0x390/0x440 [mlx5_core] [176805.892981] Read of size 2 at addr ffff888155090aa0 by task modprobe/27280 [176805.895462] CPU: 3 PID: 27280 Comm: modprobe Tainted: G B 6.6.0-rc3+ #1 [176805.896771] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [176805.898514] Call Trace: [176805.899026] [176805.899519] dump_stack_lvl+0x33/0x50 [176805.900221] print_report+0xc2/0x610 [176805.900893] ? mlx5_chains_put_table+0x33d/0x8d0 [mlx5_core] [176805.901897] ? esw_cleanup_dests+0x390/0x440 [mlx5_core] [176805.902852] kasan_report+0xac/0xe0 [176805.903509] ? esw_cleanup_dests+0x390/0x440 [mlx5_core] [176805.904461] esw_cleanup_dests+0x390/0x440 [mlx5_core] [176805.905223] __mlx5_eswitch_del_rule+0x1ae/0x460 [mlx5_core] [176805.906044] ? esw_cleanup_dests+0x440/0x440 [mlx5_core] [176805.906822] ? xas_find_conflict+0x420/0x420 [176805.907496] ? down_read+0x11e/0x200 [176805.908046] mlx5e_tc_rule_unoffload+0xc4/0x2a0 [mlx5_core] [176805.908844] mlx5e_tc_del_fdb_flow+0x7da/0xb10 [mlx5_core] [176805.909597] mlx5e_flow_put+0x4b/0x80 [mlx5_core] [176805.910275] mlx5e_delete_flower+0x5b4/0xb70 [mlx5_core] [176805.911010] tc_setup_cb_reoffload+0x27/0xb0 [176805.911648] fl_reoffload+0x62d/0x900 [cls_flower] [176805.912313] ? mlx5e_rep_indr_block_unbind+0xd0/0xd0 [mlx5_core] [176805.913151] ? __fl_put+0x230/0x230 [cls_flower] [176805.913768] ? filter_irq_stacks+0x90/0x90 [176805.914335] ? kasan_save_stack+0x1e/0x40 [176805.914893] ? kasan_set_track+0x21/0x30 [176805.915484] ? kasan_save_free_info+0x27/0x40 [176805.916105] tcf_block_playback_offloads+0x79/0x1f0 [176805.916773] ? mlx5e_rep_indr_block_unbind+0xd0/0xd0 [mlx5_core] [176805.917647] tcf_block_unbind+0x12d/0x330 [176805.918239] tcf_block_offload_cmd.isra.0+0x24e/0x320 [176805.918953] ? tcf_block_bind+0x770/0x770 [176805.919551] ? _raw_read_unlock_irqrestore+0x30/0x30 [176805.920236] ? mutex_lock+0x7d/0xd0 [176805.920735] ? mutex_unlock+0x80/0xd0 [176805.921255] tcf_block_offload_unbind+0xa5/0x120 [176805.921909] __tcf_block_put+0xc2/0x2d0 [176805.922467] ingress_destroy+0xf4/0x3d0 [sch_ingress] [176805.923178] __qdisc_destroy+0x9d/0x280 [176805.923741] dev_shutdown+0x1c6/0x330 [176805.924295] unregister_netdevice_many_notify+0x6ef/0x1500 [176805.925034] ? netdev_freemem+0x50/0x50 [176805.925610] ? _raw_spin_lock_irq+0x7b/0xd0 [176805.926235] ? _raw_spin_lock_bh+0xe0/0xe0 [176805.926849] unregister_netdevice_queue+0x1e0/0x280 [176805.927592] ? unregister_netdevice_many+0x10/0x10 [176805.928275] unregister_netdev+0x18/0x20 [176805.928835] mlx5e_vport_rep_unload+0xc0/0x200 [mlx5_core] [176805.929608] mlx5_esw_offloads_unload_rep+0x9d/0xc0 [mlx5_core] [176805.930492] mlx5_eswitch_unload_vf_vports+0x108/0x1a0 [mlx5_core] [176805.931422] ? mlx5_eswitch_unload_sf_vport+0x50/0x50 [mlx5_core] [176805.932304] ? rwsem_down_write_slowpath+0x11f0/0x11f0 [176805.932987] mlx5_eswitch_disable_sriov+0x6f9/0xa60 [mlx5_core] [176805.933807] ? mlx5_core_disable_hca+0xe1/0x130 [mlx5_core] [176805.934576] ? mlx5_eswitch_disable_locked+0x580/0x580 [mlx5_core] [176805.935463] mlx5_device_disable_sriov+0x138/0x490 [mlx5_core] [176805.936308] mlx5_sriov_disable+0x8c/0xb0 [mlx5_core] [176805.937063] remove_one+0x7f/0x210 [mlx5_core] [176805.937711] pci_device_remove+0x96/0x1c0 [176805.938289] device_release_driver_internal+0x361/0x520 [176805.938981] ? kobject_put+0x5c/0x330 [176805.939553] driver_detach+0xd7/0x1d0 [176805.940101] bus_remove_driver+0x11f/0x290 [176805.943847] pci_unregister_driver+0x23/0x1f0 [176805.944505] mlx5_cleanup+0xc/0x20 [mlx5_core] [176805.945189] __x64_sys_delete_module+0x2b3/0x450 [176805.945837] ? module_flags+0x300/0x300 [176805.946377] ? dput+0xc2/0x830 [176805.946848] ? __kasan_record_aux_stack+0x9c/0xb0 [176805.947555] ? __call_rcu_common.constprop.0+0x46c/0xb50 [176805.948338] ? fpregs_assert_state_consistent+0x1d/0xa0 [176805.949055] ? exit_to_user_mode_prepare+0x30/0x120 [176805.949713] do_syscall_64+0x3d/0x90 [176805.950226] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [176805.950904] RIP: 0033:0x7f7f42c3f5ab [176805.951462] Code: 73 01 c3 48 8b 0d 75 a8 1b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 45 a8 1b 00 f7 d8 64 89 01 48 [176805.953710] RSP: 002b:00007fff07dc9d08 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0 [176805.954691] RAX: ffffffffffffffda RBX: 000055b6e91c01e0 RCX: 00007f7f42c3f5ab [176805.955691] RDX: 0000000000000000 RSI: 0000000000000800 RDI: 000055b6e91c0248 [176805.956662] RBP: 000055b6e91c01e0 R08: 0000000000000000 R09: 0000000000000000 [176805.957601] R10: 00007f7f42d9eac0 R11: 0000000000000206 R12: 000055b6e91c0248 [176805.958593] R13: 0000000000000000 R14: 000055b6e91bfb38 R15: 0000000000000000 [176805.959599] [176805.960324] Allocated by task 20490: [176805.960893] kasan_save_stack+0x1e/0x40 [176805.961463] kasan_set_track+0x21/0x30 [176805.962019] __kasan_kmalloc+0x77/0x90 [176805.962554] esw_offloads_init+0x1bb/0x480 [mlx5_core] [176805.963318] mlx5_eswitch_init+0xc70/0x15c0 [mlx5_core] [176805.964092] mlx5_init_one_devl_locked+0x366/0x1230 [mlx5_core] [176805.964902] probe_one+0x6f7/0xc90 [mlx5_core] [176805.965541] local_pci_probe+0xd7/0x180 [176805.966075] pci_device_probe+0x231/0x6f0 [176805.966631] really_probe+0x1d4/0xb50 [176805.967179] __driver_probe_device+0x18d/0x450 [176805.967810] driver_probe_device+0x49/0x120 [176805.968431] __driver_attach+0x1fb/0x490 [176805.968976] bus_for_each_dev+0xed/0x170 [176805.969560] bus_add_driver+0x21a/0x570 [176805.970124] driver_register+0x133/0x460 [176805.970684] 0xffffffffa0678065 [176805.971180] do_one_initcall+0x92/0x2b0 [176805.971744] do_init_module+0x22d/0x720 [176805.972318] load_module+0x58c3/0x63b0 [176805.972847] init_module_from_file+0xd2/0x130 [176805.973441] __x64_sys_finit_module+0x389/0x7c0 [176805.974045] do_syscall_64+0x3d/0x90 [176805.974556] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [176805.975566] Freed by task 27280: [176805.976077] kasan_save_stack+0x1e/0x40 [176805.976655] kasan_set_track+0x21/0x30 [176805.977221] kasan_save_free_info+0x27/0x40 [176805.977834] ____kasan_slab_free+0x11a/0x1b0 [176805.978505] __kmem_cache_free+0x163/0x2d0 [176805.979113] esw_offloads_cleanup_reps+0xb8/0x120 [mlx5_core] [176805.979963] mlx5_eswitch_cleanup+0x182/0x270 [mlx5_core] [176805.980763] mlx5_cleanup_once+0x9a/0x1e0 [mlx5_core] [176805.981477] mlx5_uninit_one+0xa9/0x180 [mlx5_core] [176805.982196] remove_one+0x8f/0x210 [mlx5_core] [176805.982868] pci_device_remove+0x96/0x1c0 [176805.983461] device_release_driver_internal+0x361/0x520 [176805.984169] driver_detach+0xd7/0x1d0 [176805.984702] bus_remove_driver+0x11f/0x290 [176805.985261] pci_unregister_driver+0x23/0x1f0 [176805.985847] mlx5_cleanup+0xc/0x20 [mlx5_core] [176805.986483] __x64_sys_delete_module+0x2b3/0x450 [176805.987126] do_syscall_64+0x3d/0x90 [176805.987665] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [176805.988667] Last potentially related work creation: [176805.989305] kasan_save_stack+0x1e/0x40 [176805.989839] __kasan_record_aux_stack+0x9c/0xb0 [176805.990443] kvfree_call_rcu+0x84/0xa30 [176805.990973] clean_xps_maps+0x265/0x6e0 [176805.991547] netif_reset_xps_queues.part.0+0x3f/0x80 [176805.992226] unregister_netdevice_many_notify+0xfcf/0x1500 [176805.992966] unregister_netdevice_queue+0x1e0/0x280 [176805.993638] unregister_netdev+0x18/0x20 [176805.994205] mlx5e_remove+0xba/0x1e0 [mlx5_core] [176805.994872] auxiliary_bus_remove+0x52/0x70 [176805.995490] device_release_driver_internal+0x361/0x520 [176805.996196] bus_remove_device+0x1e1/0x3d0 [176805.996767] device_del+0x390/0x980 [176805.997270] mlx5_rescan_drivers_locked.part.0+0x130/0x540 [mlx5_core] [176805.998195] mlx5_unregister_device+0x77/0xc0 [mlx5_core] [176805.998989] mlx5_uninit_one+0x41/0x180 [mlx5_core] [176805.999719] remove_one+0x8f/0x210 [mlx5_core] [176806.000387] pci_device_remove+0x96/0x1c0 [176806.000938] device_release_driver_internal+0x361/0x520 [176806.001612] unbind_store+0xd8/0xf0 [176806.002108] kernfs_fop_write_iter+0x2c0/0x440 [176806.002748] vfs_write+0x725/0xba0 [176806.003294] ksys_write+0xed/0x1c0 [176806.003823] do_syscall_64+0x3d/0x90 [176806.004357] entry_SYSCALL_64_after_hwframe+0x46/0xb0 [176806.005317] The buggy address belongs to the object at ffff888155090a80 which belongs to the cache kmalloc-64 of size 64 [176806.006774] The buggy address is located 32 bytes inside of freed 64-byte region [ffff888155090a80, ffff888155090ac0) [176806.008773] The buggy address belongs to the physical page: [176806.009480] page:00000000a407e0e6 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x155090 [176806.010633] flags: 0x200000000000800(slab|node=0|zone=2) [176806.011352] page_type: 0xffffffff() [176806.011905] raw: 0200000000000800 ffff888100042640 ffffea000422b1c0 dead000000000004 [176806.012949] raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000 [176806.013933] page dumped because: kasan: bad access detected [176806.014935] Memory state around the buggy address: [176806.015601] ffff888155090980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [176806.016568] ffff888155090a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [176806.017497] >ffff888155090a80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [176806.018438] ^ [176806.019007] ffff888155090b00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [176806.020001] ffff888155090b80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc [176806.020996] ================================================================== Fixes: a508728a4c8b ("net/mlx5e: VF tunnel RX traffic offloading") Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 4261edf11cb7c9224af713a102e5616329306932 Author: Moshe Shemesh Date: Thu Nov 30 11:30:34 2023 +0200 net/mlx5: Fix fw tracer first block check While handling new traces, to verify it is not the first block being written, last_timestamp is checked. But instead of checking it is non zero it is verified to be zero. Fix to verify last_timestamp is not zero. Fixes: c71ad41ccb0c ("net/mlx5: FW tracer, events handling") Signed-off-by: Moshe Shemesh Reviewed-by: Feras Daoud Signed-off-by: Saeed Mahameed commit bcaf109f794744c14da0e9123b31d1f4571b0a35 Author: Carolina Jubran Date: Thu Nov 23 16:11:20 2023 +0200 net/mlx5e: XDP, Drop fragmented packets larger than MTU size XDP transmits fragmented packets that are larger than MTU size instead of dropping those packets. The drop check that checks whether a packet is larger than MTU is comparing MTU size against the linear part length only. Adjust the drop check to compare MTU size against both linear and non-linear part lengths to avoid transmitting fragmented packets larger than MTU size. Fixes: 39a1665d16a2 ("net/mlx5e: Implement sending multi buffer XDP frames") Signed-off-by: Carolina Jubran Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit be86106fd74a145f24c56c9bc18d658e8fe6d4f4 Author: Chris Mi Date: Wed Nov 29 04:53:32 2023 +0200 net/mlx5e: Decrease num_block_tc when unblock tc offload The cited commit increases num_block_tc when unblock tc offload. Actually should decrease it. Fixes: c8e350e62fc5 ("net/mlx5e: Make TC and IPsec offloads mutually exclusive on a netdev") Signed-off-by: Chris Mi Reviewed-by: Jianbo Liu Signed-off-by: Saeed Mahameed commit da75fa542873e5f7d7f615566c0b00042d8a0437 Author: Jianbo Liu Date: Tue Nov 14 01:25:21 2023 +0000 net/mlx5e: Fix overrun reported by coverity Coverity Scan reports the following issue. But it's impossible that mlx5_get_dev_index returns 7 for PF, even if the index is calculated from PCI FUNC ID. So add the checking to make coverity slience. CID 610894 (#2 of 2): Out-of-bounds write (OVERRUN) Overrunning array esw->fdb_table.offloads.peer_miss_rules of 4 8-byte elements at element index 7 (byte offset 63) using index mlx5_get_dev_index(peer_dev) (which evaluates to 7). Fixes: 9bee385a6e39 ("net/mlx5: E-switch, refactor FDB miss rule add/remove") Signed-off-by: Jianbo Liu Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit e75efc6466ae289e599fb12a5a86545dff245c65 Author: Dinghao Liu Date: Tue Nov 28 17:40:53 2023 +0800 net/mlx5e: fix a potential double-free in fs_udp_create_groups When kcalloc() for ft->g succeeds but kvzalloc() for in fails, fs_udp_create_groups() will free ft->g. However, its caller fs_udp_create_table() will free ft->g again through calling mlx5e_destroy_flow_table(), which will lead to a double-free. Fix this by setting ft->g to NULL in fs_udp_create_groups(). Fixes: 1c80bd684388 ("net/mlx5e: Introduce Flow Steering UDP API") Signed-off-by: Dinghao Liu Reviewed-by: Tariq Toukan Reviewed-by: Simon Horman Signed-off-by: Saeed Mahameed commit 8f5100da56b3980276234e812ce98d8f075194cd Author: Shifeng Li Date: Sat Dec 2 00:01:26 2023 -0800 net/mlx5e: Fix a race in command alloc flow Fix a cmd->ent use after free 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 allocated a ent->idx but didn't set ent to cmd->ent_arr in cmd_work_handler(). Fix it by moving the assignment of cmd->ent_arr into the spin lock. [70013.081955] BUG: KASAN: use-after-free in mlx5_cmd_trigger_completions+0x1e2/0x4c0 [mlx5_core] [70013.081967] Write of size 4 at addr ffff88880b1510b4 by task kworker/26:1/1433361 [70013.081968] [70013.082028] Workqueue: events aer_isr [70013.082053] Call Trace: [70013.082067] dump_stack+0x8b/0xbb [70013.082086] print_address_description+0x6a/0x270 [70013.082102] kasan_report+0x179/0x2c0 [70013.082173] mlx5_cmd_trigger_completions+0x1e2/0x4c0 [mlx5_core] [70013.082267] mlx5_cmd_flush+0x80/0x180 [mlx5_core] [70013.082304] mlx5_enter_error_state+0x106/0x1d0 [mlx5_core] [70013.082338] mlx5_try_fast_unload+0x2ea/0x4d0 [mlx5_core] [70013.082377] remove_one+0x200/0x2b0 [mlx5_core] [70013.082409] pci_device_remove+0xf3/0x280 [70013.082439] device_release_driver_internal+0x1c3/0x470 [70013.082453] pci_stop_bus_device+0x109/0x160 [70013.082468] pci_stop_and_remove_bus_device+0xe/0x20 [70013.082485] pcie_do_fatal_recovery+0x167/0x550 [70013.082493] aer_isr+0x7d2/0x960 [70013.082543] process_one_work+0x65f/0x12d0 [70013.082556] worker_thread+0x87/0xb50 [70013.082571] kthread+0x2e9/0x3a0 [70013.082592] ret_from_fork+0x1f/0x40 The logical relationship of this error is as follows: aer_recover_work | ent->work -------------------------------------------+------------------------------ aer_recover_work_func | |- pcie_do_recovery | |- report_error_detected | |- mlx5_pci_err_detected |cmd_work_handler |- mlx5_enter_error_state | |- cmd_alloc_index |- enter_error_state | |- lock cmd->alloc_lock |- mlx5_cmd_flush | |- clear_bit |- mlx5_cmd_trigger_completions| |- unlock cmd->alloc_lock |- lock cmd->alloc_lock | |- vector = ~dev->cmd.vars.bitmask |- for_each_set_bit | |- cmd_ent_get(cmd->ent_arr[i]) (UAF) |- unlock cmd->alloc_lock | |- cmd->ent_arr[ent->idx]=ent The cmd->ent_arr[ent->idx] assignment and the bit clearing are not protected by the cmd->alloc_lock in cmd_work_handler(). Fixes: 50b2412b7e78 ("net/mlx5: Avoid possible free of command entry while timeout comp handler") Reviewed-by: Moshe Shemesh Signed-off-by: Shifeng Li Signed-off-by: Saeed Mahameed commit ddb38ddff9c71026bad481b791a94d446ee37603 Author: Shifeng Li Date: Thu Nov 30 01:46:56 2023 -0800 net/mlx5e: Fix slab-out-of-bounds in mlx5_query_nic_vport_mac_list() Out_sz that the size of out buffer is calculated using query_nic_vport _context_in structure when driver query the MAC list. However query_nic _vport_context_in structure is smaller than query_nic_vport_context_out. When allowed_list_size is greater than 96, calling ether_addr_copy() will trigger an slab-out-of-bounds. [ 1170.055866] BUG: KASAN: slab-out-of-bounds in mlx5_query_nic_vport_mac_list+0x481/0x4d0 [mlx5_core] [ 1170.055869] Read of size 4 at addr ffff88bdbc57d912 by task kworker/u128:1/461 [ 1170.055870] [ 1170.055932] Workqueue: mlx5_esw_wq esw_vport_change_handler [mlx5_core] [ 1170.055936] Call Trace: [ 1170.055949] dump_stack+0x8b/0xbb [ 1170.055958] print_address_description+0x6a/0x270 [ 1170.055961] kasan_report+0x179/0x2c0 [ 1170.056061] mlx5_query_nic_vport_mac_list+0x481/0x4d0 [mlx5_core] [ 1170.056162] esw_update_vport_addr_list+0x2c5/0xcd0 [mlx5_core] [ 1170.056257] esw_vport_change_handle_locked+0xd08/0x1a20 [mlx5_core] [ 1170.056377] esw_vport_change_handler+0x6b/0x90 [mlx5_core] [ 1170.056381] process_one_work+0x65f/0x12d0 [ 1170.056383] worker_thread+0x87/0xb50 [ 1170.056390] kthread+0x2e9/0x3a0 [ 1170.056394] ret_from_fork+0x1f/0x40 Fixes: e16aea2744ab ("net/mlx5: Introduce access functions to modify/query vport mac lists") Cc: Ding Hui Signed-off-by: Shifeng Li Reviewed-by: Simon Horman Signed-off-by: Saeed Mahameed commit 8e13cd737cb4fbbb37d448e7e5228a99ae08fdc1 Author: Vlad Buslov Date: Tue Nov 21 14:15:30 2023 +0100 net/mlx5e: fix double free of encap_header Cited commit introduced potential double free since encap_header can be destroyed twice in some cases - once by error cleanup sequence in mlx5e_tc_tun_{create|update}_header_ipv{4|6}(), once by generic mlx5e_encap_put() that user calls as a result of getting an error from tunnel create|update. At the same time the point where e->encap_header is assigned can't be delayed because the function can still return non-error code 0 as a result of checking for NUD_VALID flag, which will cause neighbor update to dereference NULL encap_header. Fix the issue by: - Nulling local encap_header variables in mlx5e_tc_tun_{create|update}_header_ipv{4|6}() to make kfree(encap_header) call in error cleanup sequence noop after that point. - Assigning reformat_params.data from e->encap_header instead of local variable encap_header that was set to NULL pointer by previous step. Also assign reformat_params.size from e->encap_size for uniformity and in order to make the code less error-prone in the future. Fixes: d589e785baf5 ("net/mlx5e: Allow concurrent creation of encap entries") Reported-by: Dust Li Reported-by: Cruz Zhao Reported-by: Tianchen Ding Signed-off-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 5d089684dc434a31e08d32f0530066d0025c52e4 Author: Vlad Buslov Date: Tue Nov 21 13:52:28 2023 +0100 Revert "net/mlx5e: fix double free of encap_header" This reverts commit 6f9b1a0731662648949a1c0587f6acb3b7f8acf1. This patch is causing a null ptr issue, the proper fix is in the next patch. Fixes: 6f9b1a073166 ("net/mlx5e: fix double free of encap_header") Signed-off-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 66ca8d4deca09bce3fc7bcf8ea7997fa1a51c33c Author: Vlad Buslov Date: Tue Nov 21 13:51:52 2023 +0100 Revert "net/mlx5e: fix double free of encap_header in update funcs" This reverts commit 3a4aa3cb83563df942be49d145ee3b7ddf17d6bb. This patch is causing a null ptr issue, the proper fix is in the next patch. Fixes: 3a4aa3cb8356 ("net/mlx5e: fix double free of encap_header in update funcs") Signed-off-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 2f2fee2bf74a7e31d06fc6cb7ba2bd4dd7753c99 Merge: e307b5a845c59 50d96f05af678 Author: Martin KaFai Lau Date: Wed Dec 13 16:21:53 2023 -0800 Merge branch ' bpf fix for unconnect af_unix socket' John Fastabend says: ==================== Eric reported a syzbot splat from a null ptr deref from recent fix to resolve a use-after-free with af-unix stream sockets and BPF sockmap usage. The issue is I missed is we allow unconnected af_unix STREAM sockets to be added to the sockmap. Fix this by blocking unconnected sockets. v2: change sk_is_unix to sk_is_stream_unix (Eric) and remove duplicate ASSERTS in selftests the xsocket helper already marks FAIL (Jakub) ==================== Signed-off-by: Martin KaFai Lau commit 50d96f05af6787a34b4eca2ee3fc1993289c4c24 Author: John Fastabend Date: Fri Dec 1 10:01:39 2023 -0800 bpf: sockmap, test for unconnected af_unix sock Add test to sockmap_basic to ensure af_unix sockets that are not connected can not be added to the map. Ensure we keep DGRAM sockets working however as these will not be connected typically. Signed-off-by: John Fastabend Acked-by: Jakub Sitnicki Link: https://lore.kernel.org/r/20231201180139.328529-3-john.fastabend@gmail.com Signed-off-by: Martin KaFai Lau commit 8d6650646ce49e9a5b8c5c23eb94f74b1749f70f Author: John Fastabend Date: Fri Dec 1 10:01:38 2023 -0800 bpf: syzkaller found null ptr deref in unix_bpf proto add I added logic to track the sock pair for stream_unix sockets so that we ensure lifetime of the sock matches the time a sockmap could reference the sock (see fixes tag). I forgot though that we allow af_unix unconnected sockets into a sock{map|hash} map. This is problematic because previous fixed expected sk_pair() to exist and did not NULL check it. Because unconnected sockets have a NULL sk_pair this resulted in the NULL ptr dereference found by syzkaller. BUG: KASAN: null-ptr-deref in unix_stream_bpf_update_proto+0x72/0x430 net/unix/unix_bpf.c:171 Write of size 4 at addr 0000000000000080 by task syz-executor360/5073 Call Trace: ... sock_hold include/net/sock.h:777 [inline] unix_stream_bpf_update_proto+0x72/0x430 net/unix/unix_bpf.c:171 sock_map_init_proto net/core/sock_map.c:190 [inline] sock_map_link+0xb87/0x1100 net/core/sock_map.c:294 sock_map_update_common+0xf6/0x870 net/core/sock_map.c:483 sock_map_update_elem_sys+0x5b6/0x640 net/core/sock_map.c:577 bpf_map_update_value+0x3af/0x820 kernel/bpf/syscall.c:167 We considered just checking for the null ptr and skipping taking a ref on the NULL peer sock. But, if the socket is then connected() after being added to the sockmap we can cause the original issue again. So instead this patch blocks adding af_unix sockets that are not in the ESTABLISHED state. Reported-by: Eric Dumazet Reported-by: syzbot+e8030702aefd3444fb9e@syzkaller.appspotmail.com Fixes: 8866730aed51 ("bpf, sockmap: af_unix stream sockets need to hold ref for pair sock") Acked-by: Jakub Sitnicki Signed-off-by: John Fastabend Link: https://lore.kernel.org/r/20231201180139.328529-2-john.fastabend@gmail.com Signed-off-by: Martin KaFai Lau commit 8defec031c40913ef10d2f654a5ccc8a2a9730c1 Merge: e8d66d02defd3 99fe9ee56bd2f Author: Stephen Boyd Date: Wed Dec 13 15:26:24 2023 -0800 Merge tag 'v6.7-rockchip-clkfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-fixes Pull Rockchip clk driver fixes for the merge window from Heiko Stuebner: Fixes for a wrong clockname, a wrong clock-parent, a wrong clock-gate and finally one new PLL rate for the rk3568 to fix display artifacts on a handheld devices based on that soc. * tag 'v6.7-rockchip-clkfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: clk: rockchip: rk3128: Fix SCLK_SDMMC's clock name clk: rockchip: rk3128: Fix aclk_peri_src's parent clk: rockchip: rk3128: Fix HCLK_OTG gate register clk: rockchip: rk3568: Add PLL rate for 292.5MHz commit a4236c4b410857a70647c410e886c8a0455ec4fb Author: Christian König Date: Mon Dec 4 15:51:50 2023 +0100 drm/amdgpu: warn when there are still mappings when a BO is destroyed v2 This can only happen when there is a reference counting bug. v2: fix typo Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ceb9a321e7639700844aa3bf234a4e0884f13b77 Author: Christian König Date: Fri Dec 8 13:43:09 2023 +0100 drm/amdgpu: fix tear down order in amdgpu_vm_pt_free When freeing PD/PT with shadows it can happen that the shadow destruction races with detaching the PD/PT from the VM causing a NULL pointer dereference in the invalidation code. Fix this by detaching the the PD/PT from the VM first and then freeing the shadow instead. Signed-off-by: Christian König Fixes: https://gitlab.freedesktop.org/drm/amd/-/issues/2867 Cc: Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 2c7300d357a213d4a4bda691d1d5c06251e552d0 Author: Mario Limonciello Date: Tue Dec 12 01:09:16 2023 -0600 drm/amd: Fix a probing order problem on SDMA 2.4 commit 751e293f2c99 ("drm/amd: Move microcode init from sw_init to early_init for SDMA v2.4") made a fateful mistake in `adev->sdma.num_instances` wasn't declared when sdma_v2_4_init_microcode() was run. This caused probing to fail. Move the declaration to right before sdma_v2_4_init_microcode(). Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3043 Fixes: 751e293f2c99 ("drm/amd: Move microcode init from sw_init to early_init for SDMA v2.4") Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit ab4750332dbe535243def5dcebc24ca00c1f98ac Author: Alex Deucher Date: Thu Dec 7 10:14:41 2023 -0500 drm/amdgpu/sdma5.2: add begin/end_use ring callbacks Add begin/end_use ring callbacks to disallow GFXOFF when SDMA work is submitted and allow it again afterward. This should avoid corner cases where GFXOFF is erroneously entered when SDMA is still active. For now just allow/disallow GFXOFF in the begin and end helpers until we root cause the issue. This should not impact power as SDMA usage is pretty minimal and GFXOSS should not be active when SDMA is active anyway, this just makes it explicit. v2: move everything into sdma5.2 code. No reason for this to be generic at this point. v3: Add comments in new code Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2220 Reviewed-by: Mario Limonciello (v1) Tested-by: Mario Limonciello (v1) Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 5.15+ commit 829649443e78d85db0cff0c37cadb28fbb1a5f6f Author: Yusong Gao Date: Wed Dec 13 10:31:10 2023 +0000 sign-file: Fix incorrect return values check There are some wrong return values check in sign-file when call OpenSSL API. The ERR() check cond is wrong because of the program only check the return value is < 0 which ignored the return val is 0. For example: 1. CMS_final() return 1 for success or 0 for failure. 2. i2d_CMS_bio_stream() returns 1 for success or 0 for failure. 3. i2d_TYPEbio() return 1 for success and 0 for failure. 4. BIO_free() return 1 for success and 0 for failure. Link: https://www.openssl.org/docs/manmaster/man3/ Fixes: e5a2e3c84782 ("scripts/sign-file.c: Add support for signing with a raw signature") Signed-off-by: Yusong Gao Reviewed-by: Juerg Haefliger Signed-off-by: David Howells Link: https://lore.kernel.org/r/20231213024405.624692-1-a869920004@gmail.com/ # v5 Signed-off-by: Linus Torvalds commit 5bd7ef53ffe5ca580e93e74eb8c81ed191ddc4bd Merge: af2a9c6a83a61 485053bb81c81 Author: Linus Torvalds Date: Wed Dec 13 11:09:58 2023 -0800 Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull ufs fix from Al Viro: "ufs got broken this merge window on folio conversion - calling conventions for filemap_lock_folio() are not the same as for find_lock_page()" * tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fix ufs_get_locked_folio() breakage commit 9702817384aa4a3700643d0b26e71deac0172cfd Author: Jakub Kicinski Date: Wed Dec 13 10:56:29 2023 -0800 Revert "tcp: disable tcp_autocorking for socket when TCP_NODELAY flag is set" This reverts commit f3f32a356c0d2379d4431364e74f101f8f075ce3. Paolo reports that the change disables autocorking even after the userspace sets TCP_CORK. Fixes: f3f32a356c0d ("tcp: disable tcp_autocorking for socket when TCP_NODELAY flag is set") Link: https://lore.kernel.org/r/0d30d5a41d3ac990573016308aaeacb40a9dc79f.camel@redhat.com Signed-off-by: Jakub Kicinski commit af2a9c6a83a61bcaeb0fa4edc74762448926ef1c Merge: 88035e5694a86 50d7cdf7a9b1a Author: Linus Torvalds Date: Wed Dec 13 10:54:50 2023 -0800 Merge tag 'efi-urgent-for-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI fixes from Ard Biesheuvel: - Deal with a regression in the recently refactored x86 EFI stub code on older Dell systems by disabling randomization of the physical load address - Use the correct load address for relocatable Loongarch kernels * tag 'efi-urgent-for-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efi/x86: Avoid physical KASLR on older Dell systems efi/loongarch: Use load address to calculate kernel entry address commit 9b3daf2b0443eeba23c3888059342aec920dfd53 Author: Ivan Vecera Date: Wed Nov 29 17:17:10 2023 +0100 i40e: Fix ST code value for Clause 45 ST code value for clause 45 that has been changed by commit 8196b5fd6c73 ("i40e: Refactor I40E_MDIO_CLAUSE* macros") is currently wrong. The mentioned commit refactored ..MDIO_CLAUSE??_STCODE_MASK so their value is the same for both clauses. The value is correct for clause 22 but not for clause 45. Fix the issue by adding a parameter to I40E_GLGEN_MSCA_STCODE_MASK macro that specifies required value. Fixes: 8196b5fd6c73 ("i40e: Refactor I40E_MDIO_CLAUSE* macros") Signed-off-by: Ivan Vecera Reviewed-by: Jacob Keller Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 91f9181c738101a276d9da333e0ab665ad806e6d Author: Michal Schmidt Date: Thu Nov 30 17:58:06 2023 +0100 ice: fix theoretical out-of-bounds access in ethtool link modes To map phy types reported by the hardware to ethtool link mode bits, ice uses two lookup tables (phy_type_low_lkup, phy_type_high_lkup). The "low" table has 64 elements to cover every possible bit the hardware may report, but the "high" table has only 13. If the hardware reports a higher bit in phy_types_high, the driver would access memory beyond the lookup table's end. Instead of iterating through all 64 bits of phy_types_{low,high}, use the sizes of the respective lookup tables. Fixes: 9136e1f1e5c3 ("ice: refactor PHY type to ethtool link mode") Signed-off-by: Michal Schmidt Reviewed-by: Przemek Kitszel Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 8bf771972b8468b6a841d088141ac2960e6927fd Author: Jan Kara Date: Wed Dec 13 17:51:04 2023 +0100 bcachefs: Fix determining required file handle length The ->encode_fh method is responsible for setting amount of space required for storing the file handle if not enough space was provided. bch2_encode_fh() was not setting required length in that case which breaks e.g. fanotify. Fix it. Reported-by: Petr Vorel Signed-off-by: Jan Kara Signed-off-by: Kent Overstreet commit a26b7cd2254695f8258cc370f33280db0a9a3813 Author: Michael Roth Date: Mon Oct 16 08:27:32 2023 -0500 KVM: SEV: Do not intercept accesses to MSR_IA32_XSS for SEV-ES guests When intercepts are enabled for MSR_IA32_XSS, the host will swap in/out the guest-defined values while context-switching to/from guest mode. However, in the case of SEV-ES, vcpu->arch.guest_state_protected is set, so the guest-defined value is effectively ignored when switching to guest mode with the understanding that the VMSA will handle swapping in/out this register state. However, SVM is still configured to intercept these accesses for SEV-ES guests, so the values in the initial MSR_IA32_XSS are effectively read-only, and a guest will experience undefined behavior if it actually tries to write to this MSR. Fortunately, only CET/shadowstack makes use of this register on SEV-ES-capable systems currently, which isn't yet widely used, but this may become more of an issue in the future. Additionally, enabling intercepts of MSR_IA32_XSS results in #VC exceptions in the guest in certain paths that can lead to unexpected #VC nesting levels. One example is SEV-SNP guests when handling #VC exceptions for CPUID instructions involving leaf 0xD, subleaf 0x1, since they will access MSR_IA32_XSS as part of servicing the CPUID #VC, then generate another #VC when accessing MSR_IA32_XSS, which can lead to guest crashes if an NMI occurs at that point in time. Running perf on a guest while it is issuing such a sequence is one example where these can be problematic. Address this by disabling intercepts of MSR_IA32_XSS for SEV-ES guests if the host/guest configuration allows it. If the host/guest configuration doesn't allow for MSR_IA32_XSS, leave it intercepted so that it can be caught by the existing checks in kvm_{set,get}_msr_common() if the guest still attempts to access it. Fixes: 376c6d285017 ("KVM: SVM: Provide support for SEV-ES vCPU creation/loading") Cc: Alexey Kardashevskiy Suggested-by: Tom Lendacky Signed-off-by: Michael Roth Message-Id: <20231016132819.1002933-4-michael.roth@amd.com> Signed-off-by: Paolo Bonzini commit 6c9dbee84cd005bed5f9d07b3a2797ae6414b435 Author: Farouk Bouabid Date: Wed Dec 13 15:50:45 2023 +0100 drm/panel: ltk050h3146w: Set burst mode for ltk050h3148w The ltk050h3148w variant expects the horizontal component lane byte clock cycle(lbcc) to be calculated using lane_mbps (burst mode) instead of the pixel clock. Using the pixel clock rate by default for this calculation was introduced in commit ac87d23694f4 ("drm/bridge: synopsys: dw-mipi-dsi: Use pixel clock rate to calculate lbcc") and starting from commit 93e82bb4de01 ("drm/bridge: synopsys: dw-mipi-dsi: Fix hcomponent lbcc for burst mode") only panels that support burst mode can keep using the lane_mbps. So add MIPI_DSI_MODE_VIDEO_BURST as part of the mode_flags for the dsi host. Fixes: 93e82bb4de01 ("drm/bridge: synopsys: dw-mipi-dsi: Fix hcomponent lbcc for burst mode") Signed-off-by: Farouk Bouabid Reviewed-by: Jessica Zhang Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231213145045.41020-1-farouk.bouabid@theobroma-systems.com commit 485053bb81c81a122edd982b263277e65d7485c5 Author: Al Viro Date: Wed Dec 13 11:14:09 2023 -0500 fix ufs_get_locked_folio() breakage filemap_lock_folio() returns ERR_PTR(-ENOENT) if the thing is not in cache - not NULL like find_lock_page() used to. Fixes: 5fb7bd50b351 "ufs: add ufs_get_locked_folio and ufs_put_locked_folio" Signed-off-by: Al Viro commit 595e52284d24adc376890d3fc93bdca4707d9aca Author: Jens Axboe Date: Wed Dec 13 08:58:15 2023 -0700 io_uring/poll: don't enable lazy wake for POLLEXCLUSIVE There are a few quirks around using lazy wake for poll unconditionally, and one of them is related the EPOLLEXCLUSIVE. Those may trigger exclusive wakeups, which wake a limited number of entries in the wait queue. If that wake number is less than the number of entries someone is waiting for (and that someone is also using DEFER_TASKRUN), then we can get stuck waiting for more entries while we should be processing the ones we already got. If we're doing exclusive poll waits, flag the request as not being compatible with lazy wakeups. Reported-by: Pavel Begunkov Fixes: 6ce4a93dbb5b ("io_uring/poll: use IOU_F_TWQ_LAZY_WAKE for wakeups") Signed-off-by: Jens Axboe commit e39120ab8a04e5eb304cee3cfb42d628eb1f0d48 Author: Paolo Bonzini Date: Wed Dec 13 07:21:35 2023 -0500 KVM: selftests: Fix dynamic generation of configuration names When we dynamically generate a name for a configuration in get-reg-list we use strcat() to append to a buffer allocated using malloc() but we never initialise that buffer. Since malloc() offers no guarantees regarding the contents of the memory it returns this can lead to us corrupting, and likely overflowing, the buffer: vregs: PASS vregs+pmu: PASS sve: PASS sve+pmu: PASS vregs+pauth_address+pauth_generic: PASS X?vr+gspauth_addre+spauth_generi+pmu: PASS The bug is that strcat() should have been strcpy(), and that replacement would be enough to fix it, but there are other things in the function that leave something to be desired. In particular, an (incorrectly) empty config would cause an out of bounds access to c->name[-1]. Since the strcpy() call relies on c->name[0..len-1] being initialized, enforce that invariant throughout the function. Fixes: 2f9ace5d4557 ("KVM: arm64: selftests: get-reg-list: Introduce vcpu configs") Reviewed-by: Andrew Jones Co-developed-by: Mark Brown Signed-off-by: Mark Brown Message-Id: <20231211-kvm-get-reg-list-str-init-v3-1-6554c71c77b1@kernel.org> Signed-off-by: Paolo Bonzini commit d2441d3e8c0c076d0a2e705fa235c76869a85140 Author: Michael Ellerman Date: Tue Dec 5 16:11:05 2023 +1100 MAINTAINERS: powerpc: Add Aneesh & Naveen Aneesh and Naveen are helping out with some aspects of upstream maintenance, add them as reviewers. Acked-by: "Aneesh Kumar K.V (IBM)" Acked-by: "Naveen N. Rao" Signed-off-by: Michael Ellerman Link: https://msgid.link/20231205051105.736470-1-mpe@ellerman.id.au commit 0cf72f7f14d12cb065c3d01954cf42fc5638aa69 Author: Haren Myneni Date: Sat Nov 25 15:51:04 2023 -0800 powerpc/pseries/vas: Migration suspend waits for no in-progress open windows The hypervisor returns migration failure if all VAS windows are not closed. During pre-migration stage, vas_migration_handler() sets migration_in_progress flag and closes all windows from the list. The allocate VAS window routine checks the migration flag, setup the window and then add it to the list. So there is possibility of the migration handler missing the window that is still in the process of setup. t1: Allocate and open VAS t2: Migration event window lock vas_pseries_mutex If migration_in_progress set unlock vas_pseries_mutex return open window HCALL unlock vas_pseries_mutex Modify window HCALL lock vas_pseries_mutex setup window migration_in_progress=true Closes all windows from the list // May miss windows that are // not in the list unlock vas_pseries_mutex lock vas_pseries_mutex return if nr_closed_windows == 0 // No DLPAR CPU or migration add window to the list // Window will be added to the // list after the setup is completed unlock vas_pseries_mutex return unlock vas_pseries_mutex Close VAS window // due to DLPAR CPU or migration return -EBUSY This patch resolves the issue with the following steps: - Set the migration_in_progress flag without holding mutex. - Introduce nr_open_wins_progress counter in VAS capabilities struct - This counter tracks the number of open windows are still in progress - The allocate setup window thread closes windows if the migration is set and decrements nr_open_window_progress counter - The migration handler waits for no in-progress open windows. The code flow with the fix is as follows: t1: Allocate and open VAS t2: Migration event window lock vas_pseries_mutex If migration_in_progress set unlock vas_pseries_mutex return open window HCALL nr_open_wins_progress++ // Window opened, but not // added to the list yet unlock vas_pseries_mutex Modify window HCALL migration_in_progress=true setup window lock vas_pseries_mutex Closes all windows from the list While nr_open_wins_progress { unlock vas_pseries_mutex lock vas_pseries_mutex sleep if nr_closed_windows == 0 // Wait if any open window in or migration is not started // progress. The open window // No DLPAR CPU or migration // thread closes the window without add window to the list // adding to the list and return if nr_open_wins_progress-- // the migration is in progress. unlock vas_pseries_mutex return Close VAS window nr_open_wins_progress-- unlock vas_pseries_mutex return -EBUSY lock vas_pseries_mutex } unlock vas_pseries_mutex return Fixes: 37e6764895ef ("powerpc/pseries/vas: Add VAS migration handler") Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://msgid.link/20231125235104.3405008-1-haren@linux.ibm.com commit 2513974cc3e120bd26ecf43bcc1c40ac32669226 Merge: f3f32a356c0d2 4907a3f54b12b Author: David S. Miller Date: Wed Dec 13 10:57:01 2023 +0000 Merge branch 'stmmac-bug-fixes' Yanteng Si says: ==================== stmmac: Some bug fixes * Put Krzysztof's patch into my thread, pick Conor's Reviewed-by tag and Jiaxun's Acked-by tag.(prev version is RFC patch) * I fixed an Oops related to mdio, mainly to ensure that mdio is initialized before use, because it will be used in a series of patches I am working on. see ==================== Signed-off-by: David S. Miller commit 4907a3f54b12b8209864572a312cf967befcae80 Author: Krzysztof Kozlowski Date: Mon Dec 11 18:33:54 2023 +0800 MIPS: dts: loongson: drop incorrect dwmac fallback compatible Device binds to proper PCI ID (LOONGSON, 0x7a03), already listed in DTS, so checking for some other compatible does not make sense. It cannot be bound to unsupported platform. Drop useless, incorrect (space in between) and undocumented compatible. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Yanteng Si Reviewed-by: Conor Dooley Acked-by: Jiaxun Yang Signed-off-by: David S. Miller commit 31fea092c6f9f8fb2c40a08137907f5fbeae55dd Author: Krzysztof Kozlowski Date: Mon Dec 11 18:33:53 2023 +0800 stmmac: dwmac-loongson: drop useless check for compatible fallback Device binds to proper PCI ID (LOONGSON, 0x7a03), already listed in DTS, so checking for some other compatible does not make sense. It cannot be bound to unsupported platform. Drop useless, incorrect (space in between) and undocumented compatible. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Yanteng Si Reviewed-by: Conor Dooley Acked-by: Jiaxun Yang Signed-off-by: David S. Miller commit e87d3a1370ce9f04770d789bcf7cce44865d2e8d Author: Yanteng Si Date: Mon Dec 11 18:33:11 2023 +0800 stmmac: dwmac-loongson: Make sure MDIO is initialized before use Generic code will use mdio. If it is not initialized before use, the kernel will Oops. Fixes: 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson") Signed-off-by: Yanteng Si Signed-off-by: Feiyang Chen Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit fa97e21e74df5ef63a442e4cfd13fd113fc8196e Author: David Heidelberg Date: Tue Dec 12 21:09:17 2023 +0100 dt-bindings: panel-simple-dsi: move LG 5" HD TFT LCD panel into DSI yaml Originally was in the panel-simple, but belongs to panel-simple-dsi. See arch/arm/boot/dts/nvidia/tegra114-roth.dts for more details. Resolves the following warning: ``` arch/arm/boot/dts/tegra114-roth.dt.yaml: panel@0: 'reg' does not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/display/panel/panel-simple.yaml ``` Fixes: 310abcea76e9 ("dt-bindings: display: convert simple lg panels to DT Schema") Signed-off-by: David Heidelberg Acked-by: Krzysztof Kozlowski Acked-by: Jessica Zhang Link: https://lore.kernel.org/r/20231212200934.99262-1-david@ixit.cz Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231212200934.99262-1-david@ixit.cz commit f3f32a356c0d2379d4431364e74f101f8f075ce3 Author: Salvatore Dipietro Date: Fri Dec 8 10:20:49 2023 -0800 tcp: disable tcp_autocorking for socket when TCP_NODELAY flag is set Based on the tcp man page, if TCP_NODELAY is set, it disables Nagle's algorithm and packets are sent as soon as possible. However in the `tcp_push` function where autocorking is evaluated the `nonagle` value set by TCP_NODELAY is not considered which can trigger unexpected corking of packets and induce delays. For example, if two packets are generated as part of a server's reply, if the first one is not transmitted on the wire quickly enough, the second packet can trigger the autocorking in `tcp_push` and be delayed instead of sent as soon as possible. It will either wait for additional packets to be coalesced or an ACK from the client before transmitting the corked packet. This can interact badly if the receiver has tcp delayed acks enabled, introducing 40ms extra delay in completion times. It is not always possible to control who has delayed acks set, but it is possible to adjust when and how autocorking is triggered. Patch prevents autocorking if the TCP_NODELAY flag is set on the socket. Patch has been tested using an AWS c7g.2xlarge instance with Ubuntu 22.04 and Apache Tomcat 9.0.83 running the basic servlet below: import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class HelloWorldServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=utf-8"); OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream(),"UTF-8"); String s = "a".repeat(3096); osw.write(s,0,s.length()); osw.flush(); } } Load was applied using wrk2 (https://github.com/kinvolk/wrk2) from an AWS c6i.8xlarge instance. With the current auto-corking behavior and TCP_NODELAY set an additional 40ms latency from P99.99+ values are observed. With the patch applied we see no occurrences of 40ms latencies. The patch has also been tested with iperf and uperf benchmarks and no regression was observed. # No patch with tcp_autocorking=1 and TCP_NODELAY set on all sockets ./wrk -t32 -c128 -d40s --latency -R10000 http://172.31.49.177:8080/hello/hello' ... 50.000% 0.91ms 75.000% 1.12ms 90.000% 1.46ms 99.000% 1.73ms 99.900% 1.96ms 99.990% 43.62ms <<< 40+ ms extra latency 99.999% 48.32ms 100.000% 49.34ms # With patch ./wrk -t32 -c128 -d40s --latency -R10000 http://172.31.49.177:8080/hello/hello' ... 50.000% 0.89ms 75.000% 1.13ms 90.000% 1.44ms 99.000% 1.67ms 99.900% 1.78ms 99.990% 2.27ms <<< no 40+ ms extra latency 99.999% 3.71ms 100.000% 4.57ms Fixes: f54b311142a9 ("tcp: auto corking") Signed-off-by: Salvatore Dipietro Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 2fda61748214c0a3c7f848d68d6edf295bdad819 Merge: a39b6ac3781d4 b6961d187fcd1 Author: Dave Airlie Date: Wed Dec 13 17:03:01 2023 +1000 Merge tag 'mediatek-drm-fixes-20231211' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-fixes Mediatek DRM Fixes - 20231211 1. mtk_disp_gamma: Fix breakage due to merge issue 2. fix kernel oops if no crtc is found 3. Add spinlock for setting vblank event in atomic_begin 4. Fix access violation in mtk_drm_crtc_dma_dev_get Signed-off-by: Dave Airlie From: Chun-Kuang Hu Link: https://patchwork.freedesktop.org/patch/msgid/20231211151510.6749-1-chunkuang.hu@kernel.org commit 9b6a51aab5f5f9f71d2fa16e8b4d530e1643dfcb Author: Tony Lindgren Date: Tue Dec 12 15:50:35 2023 +0200 ARM: dts: Fix occasional boot hang for am3 usb With subtle timings changes, we can now sometimes get an external abort on non-linefetch error booting am3 devices at sysc_reset(). This is because of a missing reset delay needed for the usb target module. Looks like we never enabled the delay earlier for am3, although a similar issue was seen earlier with a similar usb setup for dm814x as described in commit ebf244148092 ("ARM: OMAP2+: Use srst_udelay for USB on dm814x"). Cc: stable@vger.kernel.org Fixes: 0782e8572ce4 ("ARM: dts: Probe am335x musb with ti-sysc") Signed-off-by: Tony Lindgren commit 4ad9843e1ea088bd2529290234c6c4c6374836a7 Author: Yong-Xuan Wang Date: Wed Dec 13 06:16:09 2023 +0000 RISCV: KVM: update external interrupt atomically for IMSIC swfile The emulated IMSIC update the external interrupt pending depending on the value of eidelivery and topei. It might lose an interrupt when it is interrupted before setting the new value to the pending status. For example, when VCPU0 sends an IPI to VCPU1 via IMSIC: VCPU0 VCPU1 CSRSWAP topei = 0 The VCPU1 has claimed all the external interrupt in its interrupt handler. topei of VCPU1's IMSIC = 0 set pending in VCPU1's IMSIC topei of VCPU1' IMSIC = 1 set the external interrupt pending of VCPU1 clear the external interrupt pending of VCPU1 When the VCPU1 switches back to VS mode, it exits the interrupt handler because the result of CSRSWAP topei is 0. If there are no other external interrupts injected into the VCPU1's IMSIC, VCPU1 will never know this pending interrupt unless it initiative read the topei. If the interruption occurs between updating interrupt pending in IMSIC and updating external interrupt pending of VCPU, it will not cause a problem. Suppose that the VCPU1 clears the IPI pending in IMSIC right after VCPU0 sets the pending, the external interrupt pending of VCPU1 will not be set because the topei is 0. But when the VCPU1 goes back to VS mode, the pending IPI will be reported by the CSRSWAP topei, it will not lose this interrupt. So we only need to make the external interrupt updating procedure as a critical section to avoid the problem. Fixes: db8b7e97d613 ("RISC-V: KVM: Add in-kernel virtualization of AIA IMSIC") Tested-by: Roy Lin Tested-by: Wayling Chen Co-developed-by: Vincent Chen Signed-off-by: Vincent Chen Signed-off-by: Yong-Xuan Wang Signed-off-by: Anup Patel commit 3279f526952f82b2967663c36c12a01f125cbbfd Author: Andrew Jones Date: Thu Dec 7 14:40:13 2023 +0100 KVM: riscv: selftests: Fix get-reg-list print_reg defaults print_reg() will print everything it knows when it encounters a register ID it's unfamiliar with in the default cases of its decoding switches. Fix several issues with these (until now, never tested) paths; missing newlines in printfs, missing complement operator in mask, and missing return in order to avoid continuing to decode. Fixes: 62d0c458f828 ("KVM: riscv: selftests: get-reg-list print_reg should never fail") Signed-off-by: Andrew Jones Reviewed-by: Haibo Xu Signed-off-by: Anup Patel commit c3d1610345b79cbe29ef6ca04a4780eff0d360c7 Author: Luca Weiss Date: Sat Nov 25 17:22:15 2023 +0100 Input: xpad - add Razer Wolverine V2 support Add the VID and PID of Razer Wolverine V2 to xpad_device. Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20231125-razer-wolverine-v2-v1-1-979fe9f9288e@z3ntu.xyz Signed-off-by: Dmitry Torokhov commit 60be76eeabb3d83858cc6577fc65c7d0f36ffd42 Author: Steven Rostedt (Google) Date: Tue Dec 12 08:44:44 2023 -0500 tracing: Add size check when printing trace_marker output If for some reason the trace_marker write does not have a nul byte for the string, it will overflow the print: trace_seq_printf(s, ": %s", field->buf); The field->buf could be missing the nul byte. To prevent overflow, add the max size that the buf can be by using the event size and the field location. int max = iter->ent_size - offsetof(struct print_entry, buf); trace_seq_printf(s, ": %*.s", max, field->buf); Link: https://lore.kernel.org/linux-trace-kernel/20231212084444.4619b8ce@gandalf.local.home Cc: Mark Rutland Cc: Mathieu Desnoyers Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit b049525855fdd0024881c9b14b8fbec61c3f53d3 Author: Steven Rostedt (Google) Date: Tue Dec 12 07:25:58 2023 -0500 ring-buffer: Have saved event hold the entire event For the ring buffer iterator (non-consuming read), the event needs to be copied into the iterator buffer to make sure that a writer does not overwrite it while the user is reading it. If a write happens during the copy, the buffer is simply discarded. But the temp buffer itself was not big enough. The allocation of the buffer was only BUF_MAX_DATA_SIZE, which is the maximum data size that can be passed into the ring buffer and saved. But the temp buffer needs to hold the meta data as well. That would be BUF_PAGE_SIZE and not BUF_MAX_DATA_SIZE. Link: https://lore.kernel.org/linux-trace-kernel/20231212072558.61f76493@gandalf.local.home Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Fixes: 785888c544e04 ("ring-buffer: Have rb_iter_head_event() handle concurrent writer") Signed-off-by: Steven Rostedt (Google) commit 9e45e39dc249c970d99d2681f6bcb55736fd725c Author: Steven Rostedt (Google) Date: Mon Dec 11 11:44:20 2023 -0500 ring-buffer: Do not update before stamp when switching sub-buffers The ring buffer timestamps are synchronized by two timestamp placeholders. One is the "before_stamp" and the other is the "write_stamp" (sometimes referred to as the "after stamp" but only in the comments. These two stamps are key to knowing how to handle nested events coming in with a lockless system. When moving across sub-buffers, the before stamp is updated but the write stamp is not. There's an effort to put back the before stamp to something that seems logical in case there's nested events. But as the current event is about to cross sub-buffers, and so will any new nested event that happens, updating the before stamp is useless, and could even introduce new race conditions. The first event on a sub-buffer simply uses the sub-buffer's timestamp and keeps a "delta" of zero. The "before_stamp" and "write_stamp" are not used in the algorithm in this case. There's no reason to try to fix the before_stamp when this happens. As a bonus, it removes a cmpxchg() when crossing sub-buffers! Link: https://lore.kernel.org/linux-trace-kernel/20231211114420.36dde01b@gandalf.local.home Cc: stable@vger.kernel.org Cc: Mark Rutland Cc: Mathieu Desnoyers Fixes: a389d86f7fd09 ("ring-buffer: Have nested events still record running time stamp") Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 4376807bf2d5371c3e00080c972be568c3f8a7d1 Author: Yu Zhao Date: Thu Dec 7 23:14:07 2023 -0700 mm/mglru: reclaim offlined memcgs harder In the effort to reduce zombie memcgs [1], it was discovered that the memcg LRU doesn't apply enough pressure on offlined memcgs. Specifically, instead of rotating them to the tail of the current generation (MEMCG_LRU_TAIL) for a second attempt, it moves them to the next generation (MEMCG_LRU_YOUNG) after the first attempt. Not applying enough pressure on offlined memcgs can cause them to build up, and this can be particularly harmful to memory-constrained systems. On Pixel 8 Pro, launching apps for 50 cycles: Before After Change Zombie memcgs 45 35 -22% [1] https://lore.kernel.org/CABdmKX2M6koq4Q0Cmp_-=wbP0Qa190HdEGGaHfxNS05gAkUtPA@mail.gmail.com/ Link: https://lkml.kernel.org/r/20231208061407.2125867-4-yuzhao@google.com Fixes: e4dde56cd208 ("mm: multi-gen LRU: per-node lru_gen_folio lists") Signed-off-by: Yu Zhao Reported-by: T.J. Mercier Tested-by: T.J. Mercier Cc: Charan Teja Kalla Cc: Hillf Danton Cc: Jaroslav Pulchart Cc: Kairui Song Cc: Kalesh Singh Cc: Signed-off-by: Andrew Morton commit 8aa420617918d12d1f5d55030a503c9418e73c2c Author: Yu Zhao Date: Thu Dec 7 23:14:06 2023 -0700 mm/mglru: respect min_ttl_ms with memcgs While investigating kswapd "consuming 100% CPU" [1] (also see "mm/mglru: try to stop at high watermarks"), it was discovered that the memcg LRU can breach the thrashing protection imposed by min_ttl_ms. Before the memcg LRU: kswapd() shrink_node_memcgs() mem_cgroup_iter() inc_max_seq() // always hit a different memcg lru_gen_age_node() mem_cgroup_iter() check the timestamp of the oldest generation After the memcg LRU: kswapd() shrink_many() restart: iterate the memcg LRU: inc_max_seq() // occasionally hit the same memcg if raced with lru_gen_rotate_memcg(): goto restart lru_gen_age_node() mem_cgroup_iter() check the timestamp of the oldest generation Specifically, when the restart happens in shrink_many(), it needs to stick with the (memcg LRU) generation it began with. In other words, it should neither re-read memcg_lru->seq nor age an lruvec of a different generation. Otherwise it can hit the same memcg multiple times without giving lru_gen_age_node() a chance to check the timestamp of that memcg's oldest generation (against min_ttl_ms). [1] https://lore.kernel.org/CAK8fFZ4DY+GtBA40Pm7Nn5xCHy+51w3sfxPqkqpqakSXYyX+Wg@mail.gmail.com/ Link: https://lkml.kernel.org/r/20231208061407.2125867-3-yuzhao@google.com Fixes: e4dde56cd208 ("mm: multi-gen LRU: per-node lru_gen_folio lists") Signed-off-by: Yu Zhao Tested-by: T.J. Mercier Cc: Charan Teja Kalla Cc: Hillf Danton Cc: Jaroslav Pulchart Cc: Kairui Song Cc: Kalesh Singh Cc: Signed-off-by: Andrew Morton commit 5095a2b23987d3c3c47dd16b3d4080e2733b8bb9 Author: Yu Zhao Date: Thu Dec 7 23:14:05 2023 -0700 mm/mglru: try to stop at high watermarks The initial MGLRU patchset didn't include the memcg LRU support, and it relied on should_abort_scan(), added by commit f76c83378851 ("mm: multi-gen LRU: optimize multiple memcgs"), to "backoff to avoid overshooting their aggregate reclaim target by too much". Later on when the memcg LRU was added, should_abort_scan() was deemed unnecessary, and the test results [1] showed no side effects after it was removed by commit a579086c99ed ("mm: multi-gen LRU: remove eviction fairness safeguard"). However, that test used memory.reclaim, which sets nr_to_reclaim to SWAP_CLUSTER_MAX. So it can overshoot only by SWAP_CLUSTER_MAX-1 pages, i.e., from nr_reclaimed=nr_to_reclaim-1 to nr_reclaimed=nr_to_reclaim+SWAP_CLUSTER_MAX-1. Compared with the batch size kswapd sets to nr_to_reclaim, SWAP_CLUSTER_MAX is tiny. Therefore that test isn't able to reproduce the worst case scenario, i.e., kswapd overshooting GBs on large systems and "consuming 100% CPU" (see the Closes tag). Bring back a simplified version of should_abort_scan() on top of the memcg LRU, so that kswapd stops when all eligible zones are above their respective high watermarks plus a small delta to lower the chance of KSWAPD_HIGH_WMARK_HIT_QUICKLY. Note that this only applies to order-0 reclaim, meaning compaction-induced reclaim can still run wild (which is a different problem). On Android, launching 55 apps sequentially: Before After Change pgpgin 838377172 802955040 -4% pgpgout 38037080 34336300 -10% [1] https://lore.kernel.org/20221222041905.2431096-1-yuzhao@google.com/ Link: https://lkml.kernel.org/r/20231208061407.2125867-2-yuzhao@google.com Fixes: a579086c99ed ("mm: multi-gen LRU: remove eviction fairness safeguard") Signed-off-by: Yu Zhao Reported-by: Charan Teja Kalla Reported-by: Jaroslav Pulchart Closes: https://lore.kernel.org/CAK8fFZ4DY+GtBA40Pm7Nn5xCHy+51w3sfxPqkqpqakSXYyX+Wg@mail.gmail.com/ Tested-by: Jaroslav Pulchart Tested-by: Kalesh Singh Cc: Hillf Danton Cc: Kairui Song Cc: T.J. Mercier Cc: Signed-off-by: Andrew Morton commit 081488051d28d32569ebb7c7a23572778b2e7d57 Author: Yu Zhao Date: Thu Dec 7 23:14:04 2023 -0700 mm/mglru: fix underprotected page cache Unmapped folios accessed through file descriptors can be underprotected. Those folios are added to the oldest generation based on: 1. The fact that they are less costly to reclaim (no need to walk the rmap and flush the TLB) and have less impact on performance (don't cause major PFs and can be non-blocking if needed again). 2. The observation that they are likely to be single-use. E.g., for client use cases like Android, its apps parse configuration files and store the data in heap (anon); for server use cases like MySQL, it reads from InnoDB files and holds the cached data for tables in buffer pools (anon). However, the oldest generation can be very short lived, and if so, it doesn't provide the PID controller with enough time to respond to a surge of refaults. (Note that the PID controller uses weighted refaults and those from evicted generations only take a half of the whole weight.) In other words, for a short lived generation, the moving average smooths out the spike quickly. To fix the problem: 1. For folios that are already on LRU, if they can be beyond the tracking range of tiers, i.e., five accesses through file descriptors, move them to the second oldest generation to give them more time to age. (Note that tiers are used by the PID controller to statistically determine whether folios accessed multiple times through file descriptors are worth protecting.) 2. When adding unmapped folios to LRU, adjust the placement of them so that they are not too close to the tail. The effect of this is similar to the above. On Android, launching 55 apps sequentially: Before After Change workingset_refault_anon 25641024 25598972 0% workingset_refault_file 115016834 106178438 -8% Link: https://lkml.kernel.org/r/20231208061407.2125867-1-yuzhao@google.com Fixes: ac35a4902374 ("mm: multi-gen LRU: minimal implementation") Signed-off-by: Yu Zhao Reported-by: Charan Teja Kalla Tested-by: Kalesh Singh Cc: T.J. Mercier Cc: Kairui Song Cc: Hillf Danton Cc: Jaroslav Pulchart Cc: Signed-off-by: Andrew Morton commit 55ac8bbe358bdd2f3c044c12f249fd22d48fe015 Author: David Stevens Date: Tue Apr 18 17:40:31 2023 +0900 mm/shmem: fix race in shmem_undo_range w/THP Split folios during the second loop of shmem_undo_range. It's not sufficient to only split folios when dealing with partial pages, since it's possible for a THP to be faulted in after that point. Calling truncate_inode_folio in that situation can result in throwing away data outside of the range being targeted. [akpm@linux-foundation.org: tidy up comment layout] Link: https://lkml.kernel.org/r/20230418084031.3439795-1-stevensd@google.com Fixes: b9a8a4195c7d ("truncate,shmem: Handle truncates that split large folios") Signed-off-by: David Stevens Cc: Matthew Wilcox (Oracle) Cc: Suleiman Souhlal Cc: Signed-off-by: Andrew Morton commit 43e8832fed08438e2a27afed9bac21acd0ceffe5 Author: John Hubbard Date: Fri Dec 8 18:01:44 2023 -0800 Revert "selftests: error out if kernel header files are not yet built" This reverts commit 9fc96c7c19df ("selftests: error out if kernel header files are not yet built"). It turns out that requiring the kernel headers to be built as a prerequisite to building selftests, does not work in many cases. For example, Peter Zijlstra writes: "My biggest beef with the whole thing is that I simply do not want to use 'make headers', it doesn't work for me. I have a ton of output directories and I don't care to build tools into the output dirs, in fact some of them flat out refuse to work that way (bpf comes to mind)." [1] Therefore, stop erroring out on the selftests build. Additional patches will be required in order to change over to not requiring the kernel headers. [1] https://lore.kernel.org/20231208221007.GO28727@noisy.programming.kicks-ass.net Link: https://lkml.kernel.org/r/20231209020144.244759-1-jhubbard@nvidia.com Fixes: 9fc96c7c19df ("selftests: error out if kernel header files are not yet built") Signed-off-by: John Hubbard Cc: Anders Roxell Cc: Muhammad Usama Anjum Cc: David Hildenbrand Cc: Peter Xu Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Shuah Khan Cc: Peter Zijlstra Cc: Marcos Paulo de Souza Cc: Signed-off-by: Andrew Morton commit 1dd11e977360ad3493812da0b05ffd9adcdd15a1 Author: Yuntao Wang Date: Sat Dec 9 22:14:38 2023 +0800 crash_core: fix the check for whether crashkernel is from high memory If crash_base is equal to CRASH_ADDR_LOW_MAX, it also indicates that the crashkernel memory is allocated from high memory. However, the current check only considers the case where crash_base is greater than CRASH_ADDR_LOW_MAX. Fix it. The runtime effects is that crashkernel high memory is successfully reserved, whereas the crashkernel low memory is bypassed in this case, then kdump kernel bootup will fail because of no low memory under 4G. This patch also includes some minor cleanups. Link: https://lkml.kernel.org/r/20231209141438.77233-1-ytcoode@gmail.com Fixes: 0ab97169aa05 ("crash_core: add generic function to do reservation") Signed-off-by: Yuntao Wang Cc: Baoquan He Cc: Dave Young Cc: Vivek Goyal Cc: Zhen Lei Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton commit 69f8ca8d36b5e52360f45c3b63bcb3d075da36df Author: Baoquan He Date: Fri Dec 8 15:30:36 2023 +0800 x86, kexec: fix the wrong ifdeffery CONFIG_KEXEC With the current ifdeffery CONFIG_KEXEC, get_cmdline_acpi_rsdp() is only available when kexec_load interface is taken, while kexec_file_load interface can't make use of it. Now change it to CONFIG_KEXEC_CORE. Link: https://lkml.kernel.org/r/20231208073036.7884-6-bhe@redhat.com Signed-off-by: Baoquan He Cc: Eric DeVolder Cc: Ignat Korchagin Cc: kernel test robot Cc: Stephen Rothwell Signed-off-by: Andrew Morton commit d70c27b728b8da1ab9c3b7ca117ee1c99dc86d29 Author: Baoquan He Date: Fri Dec 8 15:30:35 2023 +0800 sh, kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC The select of KEXEC for CRASH_DUMP in kernel/Kconfig.kexec will be dropped, then compiling errors will be triggered if below config items are set: === CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y CONFIG_CRASH_DUMP=y === Here, change the dependency of building kexec_core related object files, and the ifdeffery on SuperH from CONFIG_KEXEC to CONFIG_KEXEC_CORE. Link: https://lkml.kernel.org/r/20231208073036.7884-5-bhe@redhat.com Signed-off-by: Baoquan He Cc: Eric DeVolder Cc: Ignat Korchagin Cc: kernel test robot Cc: Stephen Rothwell Signed-off-by: Andrew Morton commit 8cd2accb71f5eb8e92d775fc1978d3779875c2e5 Author: Baoquan He Date: Fri Dec 8 15:30:34 2023 +0800 mips, kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC The select of KEXEC for CRASH_DUMP in kernel/Kconfig.kexec will be dropped, then compiling errors will be triggered if below config items are set: === CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y CONFIG_CRASH_DUMP=y === -------------------------------------------------------------------- mipsel-linux-ld: kernel/kexec_core.o: in function `kimage_free': kernel/kexec_core.c:(.text+0x2200): undefined reference to `machine_kexec_cleanup' mipsel-linux-ld: kernel/kexec_core.o: in function `__crash_kexec': kernel/kexec_core.c:(.text+0x2480): undefined reference to `machine_crash_shutdown' mipsel-linux-ld: kernel/kexec_core.c:(.text+0x2488): undefined reference to `machine_kexec' mipsel-linux-ld: kernel/kexec_core.o: in function `kernel_kexec': kernel/kexec_core.c:(.text+0x29b8): undefined reference to `machine_shutdown' mipsel-linux-ld: kernel/kexec_core.c:(.text+0x29c0): undefined reference to `machine_kexec' -------------------------------------------------------------------- Here, change the dependency of building kexec_core related object files, and the ifdeffery in mips from CONFIG_KEXEC to CONFIG_KEXEC_CORE. Link: https://lkml.kernel.org/r/20231208073036.7884-4-bhe@redhat.com Signed-off-by: Baoquan He Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311302042.sn8cDPIX-lkp@intel.com/ Cc: Eric DeVolder Cc: Ignat Korchagin Cc: Stephen Rothwell Signed-off-by: Andrew Morton commit 9bad6b75fca1b38b08d94e93f49a90cda44702b9 Author: Baoquan He Date: Fri Dec 8 15:30:33 2023 +0800 m68k, kexec: fix the incorrect ifdeffery and build dependency of CONFIG_KEXEC The select of KEXEC for CRASH_DUMP in kernel/Kconfig.kexec will be dropped, then compiling errors will be triggered if below config items are set: === CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y CONFIG_CRASH_DUMP=y === Here, change the dependency of buinding machine_kexec.o relocate_kernel.o and the ifdeffery in asm/kexe.h to CONFIG_KEXEC_CORE. Link: https://lkml.kernel.org/r/20231208073036.7884-3-bhe@redhat.com Signed-off-by: Baoquan He Cc: Eric DeVolder Cc: Ignat Korchagin Cc: kernel test robot Cc: Stephen Rothwell Signed-off-by: Andrew Morton commit 655fc6cd45521aba4a21c6e607533f1a21e06c2e Author: Baoquan He Date: Fri Dec 8 15:30:32 2023 +0800 loongarch, kexec: change dependency of object files Patch series "kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC". The select of KEXEC for CRASH_DUMP in kernel/Kconfig.kexec will be dropped, then compiling errors will be triggered if below config items are set: === CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y CONFIG_CRASH_DUMP=y === E.g on mips, below link error are seen: -------------------------------------------------------------------- mipsel-linux-ld: kernel/kexec_core.o: in function `kimage_free': kernel/kexec_core.c:(.text+0x2200): undefined reference to `machine_kexec_cleanup' mipsel-linux-ld: kernel/kexec_core.o: in function `__crash_kexec': kernel/kexec_core.c:(.text+0x2480): undefined reference to `machine_crash_shutdown' mipsel-linux-ld: kernel/kexec_core.c:(.text+0x2488): undefined reference to `machine_kexec' mipsel-linux-ld: kernel/kexec_core.o: in function `kernel_kexec': kernel/kexec_core.c:(.text+0x29b8): undefined reference to `machine_shutdown' mipsel-linux-ld: kernel/kexec_core.c:(.text+0x29c0): undefined reference to `machine_kexec' -------------------------------------------------------------------- Here, change the incorrect dependency of building kexec_core related object files, and the ifdeffery on architectures from CONFIG_KEXEC to CONFIG_KEXEC_CORE. Testing: ======== Passed on mips and loognarch with the LKP reproducer. This patch (of 5): Currently, in arch/loongarch/kernel/Makefile, building machine_kexec.o relocate_kernel.o depends on CONFIG_KEXEC. Whereas, since we will drop the select of KEXEC for CRASH_DUMP in kernel/Kconfig.kexec, compiling error will be triggered if below config items are set: === CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y CONFIG_CRASH_DUMP=y === --------------------------------------------------------------- loongarch64-linux-ld: kernel/kexec_core.o: in function `.L209': >> kexec_core.c:(.text+0x1660): undefined reference to `machine_kexec_cleanup' loongarch64-linux-ld: kernel/kexec_core.o: in function `.L287': >> kexec_core.c:(.text+0x1c5c): undefined reference to `machine_crash_shutdown' >> loongarch64-linux-ld: kexec_core.c:(.text+0x1c64): undefined reference to `machine_kexec' loongarch64-linux-ld: kernel/kexec_core.o: in function `.L2^B5': >> kexec_core.c:(.text+0x2090): undefined reference to `machine_shutdown' loongarch64-linux-ld: kexec_core.c:(.text+0x20a0): undefined reference to `machine_kexec' --------------------------------------------------------------- Here, change the dependency of machine_kexec.o relocate_kernel.o to CONFIG_KEXEC_CORE can fix above building error. Link: https://lkml.kernel.org/r/20231208073036.7884-1-bhe@redhat.com Link: https://lkml.kernel.org/r/20231208073036.7884-2-bhe@redhat.com Signed-off-by: Baoquan He Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311300946.kHE9Iu71-lkp@intel.com/ Cc: Eric DeVolder Cc: Ignat Korchagin Cc: Stephen Rothwell Signed-off-by: Andrew Morton commit 6376a824595607e99d032a39ba3394988b4fce96 Author: SeongJae Park Date: Fri Dec 8 17:50:18 2023 +0000 mm/damon/core: make damon_start() waits until kdamond_fn() starts The cleanup tasks of kdamond threads including reset of corresponding DAMON context's ->kdamond field and decrease of global nr_running_ctxs counter is supposed to be executed by kdamond_fn(). However, commit 0f91d13366a4 ("mm/damon: simplify stop mechanism") made neither damon_start() nor damon_stop() ensure the corresponding kdamond has started the execution of kdamond_fn(). As a result, the cleanup can be skipped if damon_stop() is called fast enough after the previous damon_start(). Especially the skipped reset of ->kdamond could cause a use-after-free. Fix it by waiting for start of kdamond_fn() execution from damon_start(). Link: https://lkml.kernel.org/r/20231208175018.63880-1-sj@kernel.org Fixes: 0f91d13366a4 ("mm/damon: simplify stop mechanism") Signed-off-by: SeongJae Park Reported-by: Jakub Acs Cc: Changbin Du Cc: Jakub Acs Cc: # 5.15.x Signed-off-by: Andrew Morton commit a6fcd57cf2df409d35e9225b8dbad6f937b28df0 Author: David Hildenbrand Date: Wed Dec 6 11:35:58 2023 +0100 selftests/mm: cow: print ksft header before printing anything else Doing a ksft_print_msg() before the ksft_print_header() seems to confuse the ksft framework in a strange way: running the test on the cmdline results in the expected output. But piping the output somewhere else, results in some odd output, whereby we repeatedly get the same info printed: # [INFO] detected THP size: 2048 KiB # [INFO] detected hugetlb page size: 2048 KiB # [INFO] detected hugetlb page size: 1048576 KiB # [INFO] huge zeropage is enabled TAP version 13 1..190 # [INFO] Anonymous memory tests in private mappings # [RUN] Basic COW after fork() ... with base page # [INFO] detected THP size: 2048 KiB # [INFO] detected hugetlb page size: 2048 KiB # [INFO] detected hugetlb page size: 1048576 KiB # [INFO] huge zeropage is enabled TAP version 13 1..190 # [INFO] Anonymous memory tests in private mappings # [RUN] Basic COW after fork() ... with base page ok 1 No leak from parent into child # [RUN] Basic COW after fork() ... with swapped out base page # [INFO] detected THP size: 2048 KiB # [INFO] detected hugetlb page size: 2048 KiB # [INFO] detected hugetlb page size: 1048576 KiB # [INFO] huge zeropage is enabled Doing the ksft_print_header() first seems to resolve that and gives us the output we expect: TAP version 13 # [INFO] detected THP size: 2048 KiB # [INFO] detected hugetlb page size: 2048 KiB # [INFO] detected hugetlb page size: 1048576 KiB # [INFO] huge zeropage is enabled 1..190 # [INFO] Anonymous memory tests in private mappings # [RUN] Basic COW after fork() ... with base page ok 1 No leak from parent into child # [RUN] Basic COW after fork() ... with swapped out base page ok 2 No leak from parent into child # [RUN] Basic COW after fork() ... with THP ok 3 No leak from parent into child # [RUN] Basic COW after fork() ... with swapped-out THP ok 4 No leak from parent into child # [RUN] Basic COW after fork() ... with PTE-mapped THP ok 5 No leak from parent into child Link: https://lkml.kernel.org/r/20231206103558.38040-1-david@redhat.com Fixes: f4b5fd6946e2 ("selftests/vm: anon_cow: THP tests") Signed-off-by: David Hildenbrand Reported-by: Nico Pache Signed-off-by: Andrew Morton commit d3bb89ea9c13e5a98d2b7a0ba8e50a77893132cb Author: Kefeng Wang Date: Thu Dec 7 23:25:25 2023 +0800 mm: fix VMA heap bounds checking After converting selinux to VMA heap check helper, the gcl triggers an execheap SELinux denial, which is caused by a changed logic check. Previously selinux only checked that the VMA range was within the VMA heap range, and the implementation checks the intersection between the two ranges, but the corner case (vm_end=start_brk, brk=vm_start) isn't handled correctly. Since commit 11250fd12eb8 ("mm: factor out VMA stack and heap checks") was only a function extraction, it seems that the issue was introduced by commit 0db0c01b53a1 ("procfs: fix /proc//maps heap check"). Let's fix above corner cases, meanwhile, correct the wrong indentation of the stack and heap check helpers. Fixes: 11250fd12eb8 ("mm: factor out VMA stack and heap checks") Signed-off-by: Kefeng Wang Reported-by: Ondrej Mosnacek Closes: https://lore.kernel.org/selinux/CAFqZXNv0SVT0fkOK6neP9AXbj3nxJ61JAY4+zJzvxqJaeuhbFw@mail.gmail.com/ Tested-by: Ondrej Mosnacek Link: https://lkml.kernel.org/r/20231207152525.2607420-1-wangkefeng.wang@huawei.com Cc: David Hildenbrand Cc: Paul Moore Cc: Peter Zijlstra Cc: Stephen Smalley Signed-off-by: Andrew Morton commit ac88ff6b9d7dea9f0907c86bdae204dde7d5c0e6 Author: Baoquan He Date: Tue Dec 5 11:02:55 2023 +0800 riscv: fix VMALLOC_START definition When below config items are set, compiler complained: -------------------- CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y CONFIG_CRASH_DUMP=y ...... ----------------------- ------------------------------------------------------------------- arch/riscv/kernel/crash_core.c: In function 'arch_crash_save_vmcoreinfo': arch/riscv/kernel/crash_core.c:11:58: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'int' [-Wformat=] 11 | vmcoreinfo_append_str("NUMBER(VMALLOC_START)=0x%lx\n", VMALLOC_START); | ~~^ | | | long unsigned int | %x ---------------------------------------------------------------------- This is because on riscv macro VMALLOC_START has different type when CONFIG_MMU is set or unset. arch/riscv/include/asm/pgtable.h: -------------------------------------------------- Changing it to _AC(0, UL) in case CONFIG_MMU=n can fix the warning. Link: https://lkml.kernel.org/r/ZW7OsX4zQRA3mO4+@MiWiFi-R3L-srv Signed-off-by: Baoquan He Reported-by: Randy Dunlap Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Cc: Eric DeVolder Cc: Ignat Korchagin Cc: Stephen Rothwell Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Signed-off-by: Andrew Morton commit c41bd2514184d75db087fe4c1221237fb7922875 Author: Ignat Korchagin Date: Wed Nov 29 22:04:09 2023 +0000 kexec: drop dependency on ARCH_SUPPORTS_KEXEC from CRASH_DUMP In commit f8ff23429c62 ("kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP") we tried to fix a config regression, where CONFIG_CRASH_DUMP required CONFIG_KEXEC. However, it was not enough at least for arm64 platforms. While further testing the patch with our arm64 config I noticed that CONFIG_CRASH_DUMP is unavailable in menuconfig. This is because CONFIG_CRASH_DUMP still depends on the new CONFIG_ARCH_SUPPORTS_KEXEC introduced in commit 91506f7e5d21 ("arm64/kexec: refactor for kernel/Kconfig.kexec") and on arm64 CONFIG_ARCH_SUPPORTS_KEXEC requires CONFIG_PM_SLEEP_SMP=y, which in turn requires either CONFIG_SUSPEND=y or CONFIG_HIBERNATION=y neither of which are set in our config. Given that we already established that CONFIG_KEXEC (which is a switch for kexec system call itself) is not required for CONFIG_CRASH_DUMP drop CONFIG_ARCH_SUPPORTS_KEXEC dependency as well. The arm64 kernel builds just fine with CONFIG_CRASH_DUMP=y and with both CONFIG_KEXEC=n and CONFIG_KEXEC_FILE=n after f8ff23429c62 ("kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP") and this patch are applied given that the necessary shared bits are included via CONFIG_KEXEC_CORE dependency. [bhe@redhat.com: don't export some symbols when CONFIG_MMU=n] Link: https://lkml.kernel.org/r/ZW03ODUKGGhP1ZGU@MiWiFi-R3L-srv [bhe@redhat.com: riscv, kexec: fix dependency of two items] Link: https://lkml.kernel.org/r/ZW04G/SKnhbE5mnX@MiWiFi-R3L-srv Link: https://lkml.kernel.org/r/20231129220409.55006-1-ignat@cloudflare.com Fixes: 91506f7e5d21 ("arm64/kexec: refactor for kernel/Kconfig.kexec") Signed-off-by: Ignat Korchagin Signed-off-by: Baoquan He Acked-by: Baoquan He Cc: Alexander Gordeev Cc: # 6.6+: f8ff234: kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP Cc: # 6.6+ Signed-off-by: Andrew Morton commit 88035e5694a86a7167d490bb95e9df97a9bb162b Merge: cf52eed70e555 df83a0df820b9 Author: Linus Torvalds Date: Tue Dec 12 17:02:56 2023 -0800 Merge tag 'hid-for-linus-2023121201' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Jiri Kosina: - Lenovo ThinkPad TrackPoint Keyboard II firmware-specific regression fix (Mikhail Khvainitski) - device-specific fixes (various authors) * tag 'hid-for-linus-2023121201' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: apple: Add "hfd.cn" and "WKB603" to the list of non-apple keyboards HID: lenovo: Restrict detection of patched firmware only to USB cptkbd HID: Add quirk for Labtec/ODDOR/aikeec handbrake HID: i2c-hid: Add IDEA5002 to i2c_hid_acpi_blacklist[] mailmap: add address mapping for Jiri Kosina commit 65c95f78917ea6fa7ff189a2c19879c4fe161873 Author: Jiri Pirko Date: Mon Dec 11 09:37:58 2023 +0100 dpll: sanitize possible null pointer dereference in dpll_pin_parent_pin_set() User may not pass DPLL_A_PIN_STATE attribute in the pin set operation message. Sanitize that by checking if the attr pointer is not null and process the passed state attribute value only in that case. Reported-by: Xingyuan Mo Fixes: 9d71b54b65b1 ("dpll: netlink: Add DPLL framework base functions") Signed-off-by: Jiri Pirko Acked-by: Vadim Fedorenko Link: https://lore.kernel.org/r/20231211083758.1082853-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 154bb2fa4810e6196561ecc0f0c36ad61c770b6e Merge: f99cd56230f56 4ab138ca0a340 Author: Jakub Kicinski Date: Tue Dec 12 16:07:32 2023 -0800 Merge branch 'ena-driver-xdp-bug-fixes' David Arinzon says: ==================== ENA driver XDP bug fixes This patchset contains multiple XDP-related bug fixes in the ENA driver. ==================== Link: https://lore.kernel.org/r/20231211062801.27891-1-darinzon@amazon.com Signed-off-by: Jakub Kicinski commit 4ab138ca0a340e6d6e7a6a9bd5004bd8f83127ca Author: David Arinzon Date: Mon Dec 11 06:28:01 2023 +0000 net: ena: Fix XDP redirection error When sending TX packets, the meta descriptor can be all zeroes as no meta information is required (as in XDP). This patch removes the validity check, as when `disable_meta_caching` is enabled, such TX packets will be dropped otherwise. Fixes: 0e3a3f6dacf0 ("net: ena: support new LLQ acceleration mode") Signed-off-by: Shay Agroskin Signed-off-by: David Arinzon Link: https://lore.kernel.org/r/20231211062801.27891-5-darinzon@amazon.com Signed-off-by: Jakub Kicinski commit d760117060cf2e90b5c59c5492cab179a4dbce01 Author: David Arinzon Date: Mon Dec 11 06:28:00 2023 +0000 net: ena: Fix DMA syncing in XDP path when SWIOTLB is on This patch fixes two issues: Issue 1 ------- Description ``````````` Current code does not call dma_sync_single_for_cpu() to sync data from the device side memory to the CPU side memory before the XDP code path uses the CPU side data. This causes the XDP code path to read the unset garbage data in the CPU side memory, resulting in incorrect handling of the packet by XDP. Solution ```````` 1. Add a call to dma_sync_single_for_cpu() before the XDP code starts to use the data in the CPU side memory. 2. The XDP code verdict can be XDP_PASS, in which case there is a fallback to the non-XDP code, which also calls dma_sync_single_for_cpu(). To avoid calling dma_sync_single_for_cpu() twice: 2.1. Put the dma_sync_single_for_cpu() in the code in such a place where it happens before XDP and non-XDP code. 2.2. Remove the calls to dma_sync_single_for_cpu() in the non-XDP code for the first buffer only (rx_copybreak and non-rx_copybreak cases), since the new call that was added covers these cases. The call to dma_sync_single_for_cpu() for the second buffer and on stays because only the first buffer is handled by the newly added dma_sync_single_for_cpu(). And there is no need for special handling of the second buffer and on for the XDP path since currently the driver supports only single buffer packets. Issue 2 ------- Description ``````````` In case the XDP code forwarded the packet (ENA_XDP_FORWARDED), ena_unmap_rx_buff_attrs() is called with attrs set to 0. This means that before unmapping the buffer, the internal function dma_unmap_page_attrs() will also call dma_sync_single_for_cpu() on the whole buffer (not only on the data part of it). This sync is both wasteful (since a sync was already explicitly called before) and also causes a bug, which will be explained using the below diagram. The following diagram shows the flow of events causing the bug. The order of events is (1)-(4) as shown in the diagram. CPU side memory area (3)convert_to_xdp_frame() initializes the headroom with xdpf metadata || \/ ___________________________________ | | 0 | V 4K --------------------------------------------------------------------- | xdpf->data | other xdpf | < data > | tailroom ||...| | | fields | | GARBAGE || | --------------------------------------------------------------------- /\ /\ || || (4)ena_unmap_rx_buff_attrs() calls (2)dma_sync_single_for_cpu() dma_sync_single_for_cpu() on the copies data from device whole buffer page, overwriting side to CPU side memory the xdpf->data with GARBAGE. || 0 4K --------------------------------------------------------------------- | headroom | < data > | tailroom ||...| | GARBAGE | | GARBAGE || | --------------------------------------------------------------------- Device side memory area /\ || (1) device writes RX packet data After the call to ena_unmap_rx_buff_attrs() in (4), the xdpf->data becomes corrupted, and so when it is later accessed in ena_clean_xdp_irq()->xdp_return_frame(), it causes a page fault, crashing the kernel. Solution ```````` Explicitly tell ena_unmap_rx_buff_attrs() not to call dma_sync_single_for_cpu() by passing it the ENA_DMA_ATTR_SKIP_CPU_SYNC flag. Fixes: f7d625adeb7b ("net: ena: Add dynamic recycling mechanism for rx buffers") Signed-off-by: Arthur Kiyanovski Signed-off-by: David Arinzon Link: https://lore.kernel.org/r/20231211062801.27891-4-darinzon@amazon.com Signed-off-by: Jakub Kicinski commit 505b1a88d311ff6f8c44a34f94e3be21745cce6f Author: David Arinzon Date: Mon Dec 11 06:27:59 2023 +0000 net: ena: Fix xdp drops handling due to multibuf packets Current xdp code drops packets larger than ENA_XDP_MAX_MTU. This is an incorrect condition since the problem is not the size of the packet, rather the number of buffers it contains. This commit: 1. Identifies and drops XDP multi-buffer packets at the beginning of the function. 2. Increases the xdp drop statistic when this drop occurs. 3. Adds a one-time print that such drops are happening to give better indication to the user. Fixes: 838c93dc5449 ("net: ena: implement XDP drop support") Signed-off-by: Arthur Kiyanovski Signed-off-by: David Arinzon Link: https://lore.kernel.org/r/20231211062801.27891-3-darinzon@amazon.com Signed-off-by: Jakub Kicinski commit 41db6f99b5489a0d2ef26afe816ef0c6118d1d47 Author: David Arinzon Date: Mon Dec 11 06:27:58 2023 +0000 net: ena: Destroy correct number of xdp queues upon failure The ena_setup_and_create_all_xdp_queues() function freed all the resources upon failure, after creating only xdp_num_queues queues, instead of freeing just the created ones. In this patch, the only resources that are freed, are the ones allocated right before the failure occurs. Fixes: 548c4940b9f1 ("net: ena: Implement XDP_TX action") Signed-off-by: Shahar Itzko Signed-off-by: David Arinzon Link: https://lore.kernel.org/r/20231211062801.27891-2-darinzon@amazon.com Signed-off-by: Jakub Kicinski commit d06aff1cb13d2a0d52b48e605462518149c98c81 Author: Steven Rostedt (Google) Date: Sun Dec 10 22:54:47 2023 -0500 tracing: Update snapshot buffer on resize if it is allocated The snapshot buffer is to mimic the main buffer so that when a snapshot is needed, the snapshot and main buffer are swapped. When the snapshot buffer is allocated, it is set to the minimal size that the ring buffer may be at and still functional. When it is allocated it becomes the same size as the main ring buffer, and when the main ring buffer changes in size, it should do. Currently, the resize only updates the snapshot buffer if it's used by the current tracer (ie. the preemptirqsoff tracer). But it needs to be updated anytime it is allocated. When changing the size of the main buffer, instead of looking to see if the current tracer is utilizing the snapshot buffer, just check if it is allocated to know if it should be updated or not. Also fix typo in comment just above the code change. Link: https://lore.kernel.org/linux-trace-kernel/20231210225447.48476a6a@rorschach.local.home Cc: stable@vger.kernel.org Cc: Mark Rutland Cc: Mathieu Desnoyers Fixes: ad909e21bbe69 ("tracing: Add internal tracing_snapshot() functions") Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 17d801758157bec93f26faaf5ff1a8b9a552d67a Author: Steven Rostedt (Google) Date: Sun Dec 10 22:12:50 2023 -0500 ring-buffer: Fix memory leak of free page Reading the ring buffer does a swap of a sub-buffer within the ring buffer with a empty sub-buffer. This allows the reader to have full access to the content of the sub-buffer that was swapped out without having to worry about contention with the writer. The readers call ring_buffer_alloc_read_page() to allocate a page that will be used to swap with the ring buffer. When the code is finished with the reader page, it calls ring_buffer_free_read_page(). Instead of freeing the page, it stores it as a spare. Then next call to ring_buffer_alloc_read_page() will return this spare instead of calling into the memory management system to allocate a new page. Unfortunately, on freeing of the ring buffer, this spare page is not freed, and causes a memory leak. Link: https://lore.kernel.org/linux-trace-kernel/20231210221250.7b9cc83c@rorschach.local.home Cc: stable@vger.kernel.org Cc: Mark Rutland Cc: Mathieu Desnoyers Fixes: 73a757e63114d ("ring-buffer: Return reader page back into existing ring buffer") Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 5eaf7f0589c0d88178f0fbeebe0e0b7108258707 Author: Beau Belgrave Date: Sun Dec 10 21:35:34 2023 +0000 eventfs: Fix events beyond NAME_MAX blocking tasks Eventfs uses simple_lookup(), however, it will fail if the name of the entry is beyond NAME_MAX length. When this error is encountered, eventfs still tries to create dentries instead of skipping the dentry creation. When the dentry is attempted to be created in this state d_wait_lookup() will loop forever, waiting for the lookup to be removed. Fix eventfs to return the error in simple_lookup() back to the caller instead of continuing to try to create the dentry. Link: https://lore.kernel.org/linux-trace-kernel/20231210213534.497-1-beaub@linux.microsoft.com Fixes: 63940449555e ("eventfs: Implement eventfs lookup, read, open functions") Link: https://lore.kernel.org/linux-trace-kernel/20231208183601.GA46-beaub@linux.microsoft.com/ Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit b55b0a0d7c4aa2dac3579aa7e6802d1f57445096 Author: Steven Rostedt (Google) Date: Sat Dec 9 17:10:58 2023 -0500 tracing: Have large events show up as '[LINE TOO BIG]' instead of nothing If a large event was added to the ring buffer that is larger than what the trace_seq can handle, it just drops the output: ~# cat /sys/kernel/tracing/trace # tracer: nop # # entries-in-buffer/entries-written: 2/2 #P:8 # # _-----=> irqs-off/BH-disabled # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / _-=> migrate-disable # |||| / delay # TASK-PID CPU# ||||| TIMESTAMP FUNCTION # | | | ||||| | | <...>-859 [001] ..... 141.118951: tracing_mark_write <...>-859 [001] ..... 141.148201: tracing_mark_write: 78901234 Instead, catch this case and add some context: ~# cat /sys/kernel/tracing/trace # tracer: nop # # entries-in-buffer/entries-written: 2/2 #P:8 # # _-----=> irqs-off/BH-disabled # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / _-=> migrate-disable # |||| / delay # TASK-PID CPU# ||||| TIMESTAMP FUNCTION # | | | ||||| | | <...>-852 [001] ..... 121.550551: tracing_mark_write[LINE TOO BIG] <...>-852 [001] ..... 121.550581: tracing_mark_write: 78901234 This now emulates the same output as trace_pipe. Link: https://lore.kernel.org/linux-trace-kernel/20231209171058.78c1a026@gandalf.local.home Cc: Mark Rutland Cc: Mathieu Desnoyers Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit b3ae7b67b87fed771fa5bf95389df06b0433603e Author: Steven Rostedt (Google) Date: Tue Dec 12 11:16:17 2023 -0500 ring-buffer: Fix writing to the buffer with max_data_size The maximum ring buffer data size is the maximum size of data that can be recorded on the ring buffer. Events must be smaller than the sub buffer data size minus any meta data. This size is checked before trying to allocate from the ring buffer because the allocation assumes that the size will fit on the sub buffer. The maximum size was calculated as the size of a sub buffer page (which is currently PAGE_SIZE minus the sub buffer header) minus the size of the meta data of an individual event. But it missed the possible adding of a time stamp for events that are added long enough apart that the event meta data can't hold the time delta. When an event is added that is greater than the current BUF_MAX_DATA_SIZE minus the size of a time stamp, but still less than or equal to BUF_MAX_DATA_SIZE, the ring buffer would go into an infinite loop, looking for a page that can hold the event. Luckily, there's a check for this loop and after 1000 iterations and a warning is emitted and the ring buffer is disabled. But this should never happen. This can happen when a large event is added first, or after a long period where an absolute timestamp is prefixed to the event, increasing its size by 8 bytes. This passes the check and then goes into the algorithm that causes the infinite loop. For events that are the first event on the sub-buffer, it does not need to add a timestamp, because the sub-buffer itself contains an absolute timestamp, and adding one is redundant. The fix is to check if the event is to be the first event on the sub-buffer, and if it is, then do not add a timestamp. This also fixes 32 bit adding a timestamp when a read of before_stamp or write_stamp is interrupted. There's still no need to add that timestamp if the event is going to be the first event on the sub buffer. Also, if the buffer has "time_stamp_abs" set, then also check if the length plus the timestamp is greater than the BUF_MAX_DATA_SIZE. Link: https://lore.kernel.org/all/20231212104549.58863438@gandalf.local.home/ Link: https://lore.kernel.org/linux-trace-kernel/20231212071837.5fdd6c13@gandalf.local.home Link: https://lore.kernel.org/linux-trace-kernel/20231212111617.39e02849@gandalf.local.home Cc: stable@vger.kernel.org Cc: Mark Rutland Cc: Mathieu Desnoyers Fixes: a4543a2fa9ef3 ("ring-buffer: Get timestamp after event is allocated") Fixes: 58fbc3c63275c ("ring-buffer: Consolidate add_timestamp to remove some branches") Reported-by: Kent Overstreet # (on IRC) Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit f99cd56230f56c8b6b33713c5be4da5d6766be1f Author: Dong Chenchen Date: Sun Dec 10 10:02:00 2023 +0800 net: Remove acked SYN flag from packet in the transmit queue correctly syzkaller report: kernel BUG at net/core/skbuff.c:3452! invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.7.0-rc4-00009-gbee0e7762ad2-dirty #135 RIP: 0010:skb_copy_and_csum_bits (net/core/skbuff.c:3452) Call Trace: icmp_glue_bits (net/ipv4/icmp.c:357) __ip_append_data.isra.0 (net/ipv4/ip_output.c:1165) ip_append_data (net/ipv4/ip_output.c:1362 net/ipv4/ip_output.c:1341) icmp_push_reply (net/ipv4/icmp.c:370) __icmp_send (./include/net/route.h:252 net/ipv4/icmp.c:772) ip_fragment.constprop.0 (./include/linux/skbuff.h:1234 net/ipv4/ip_output.c:592 net/ipv4/ip_output.c:577) __ip_finish_output (net/ipv4/ip_output.c:311 net/ipv4/ip_output.c:295) ip_output (net/ipv4/ip_output.c:427) __ip_queue_xmit (net/ipv4/ip_output.c:535) __tcp_transmit_skb (net/ipv4/tcp_output.c:1462) __tcp_retransmit_skb (net/ipv4/tcp_output.c:3387) tcp_retransmit_skb (net/ipv4/tcp_output.c:3404) tcp_retransmit_timer (net/ipv4/tcp_timer.c:604) tcp_write_timer (./include/linux/spinlock.h:391 net/ipv4/tcp_timer.c:716) The panic issue was trigered by tcp simultaneous initiation. The initiation process is as follows: TCP A TCP B 1. CLOSED CLOSED 2. SYN-SENT --> ... 3. SYN-RECEIVED <-- <-- SYN-SENT 4. ... --> SYN-RECEIVED 5. SYN-RECEIVED --> ... // TCP B: not send challenge ack for ack limit or packet loss // TCP A: close tcp_close tcp_send_fin if (!tskb && tcp_under_memory_pressure(sk)) tskb = skb_rb_last(&sk->tcp_rtx_queue); //pick SYN_ACK packet TCP_SKB_CB(tskb)->tcp_flags |= TCPHDR_FIN; // set FIN flag 6. FIN_WAIT_1 --> ... // TCP B: send challenge ack to SYN_FIN_ACK 7. ... <-- SYN-RECEIVED //challenge ack // TCP A: 8. FIN_WAIT_1 --> ... // retransmit panic __tcp_retransmit_skb //skb->len=0 tcp_trim_head len = tp->snd_una - TCP_SKB_CB(skb)->seq // len=101-100 __pskb_trim_head skb->data_len -= len // skb->len=-1, wrap around ... ... ip_fragment icmp_glue_bits //BUG_ON If we use tcp_trim_head() to remove acked SYN from packet that contains data or other flags, skb->len will be incorrectly decremented. We can remove SYN flag that has been acked from rtx_queue earlier than tcp_trim_head(), which can fix the problem mentioned above. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Co-developed-by: Eric Dumazet Signed-off-by: Eric Dumazet Signed-off-by: Dong Chenchen Link: https://lore.kernel.org/r/20231210020200.1539875-1-dongchenchen2@huawei.com Signed-off-by: Jakub Kicinski commit b65d52ac9c085c0c52dee012a210d4e2f352611b Author: Dinghao Liu Date: Sun Dec 10 12:52:55 2023 +0800 qed: Fix a potential use-after-free in qed_cxt_tables_alloc qed_ilt_shadow_alloc() will call qed_ilt_shadow_free() to free p_hwfn->p_cxt_mngr->ilt_shadow on error. However, qed_cxt_tables_alloc() accesses the freed pointer on failure of qed_ilt_shadow_alloc() through calling qed_cxt_mngr_free(), which may lead to use-after-free. Fix this issue by setting p_mngr->ilt_shadow to NULL in qed_ilt_shadow_free(). Fixes: fe56b9e6a8d9 ("qed: Add module with basic common support") Reviewed-by: Przemek Kitszel Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20231210045255.21383-1-dinghao.liu@zju.edu.cn Signed-off-by: Jakub Kicinski commit ff49bf1867578f23a5ffdd38f927f6e1e16796c4 Author: Fedor Pchelkin Date: Wed Dec 6 23:09:13 2023 +0300 net: 9p: avoid freeing uninit memory in p9pdu_vreadf If some of p9pdu_readf() calls inside case 'T' in p9pdu_vreadf() fails, the error path is not handled properly. *wnames or members of *wnames array may be left uninitialized and invalidly freed. Initialize *wnames to NULL in beginning of case 'T'. Initialize the first *wnames array element to NULL and nullify the failing *wnames element so that the error path freeing loop stops on the first NULL element and doesn't proceed further. Found by Linux Verification Center (linuxtesting.org). Fixes: ace51c4dd2f9 ("9p: add new protocol support code") Signed-off-by: Fedor Pchelkin Message-ID: <20231206200913.16135-1-pchelkin@ispras.ru> Cc: stable@vger.kernel.org Reviewed-by: Simon Horman Reviewed-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit cf52eed70e555e864120cfaf280e979e2a035c66 Merge: eaadbbaaff74a 6c02757c93606 Author: Linus Torvalds Date: Tue Dec 12 11:37:04 2023 -0800 Merge tag 'ext4_for_linus-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 fixes from Ted Ts'o: "Fix various bugs / regressions for ext4, including a soft lockup, a WARN_ON, and a BUG" * tag 'ext4_for_linus-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: jbd2: fix soft lockup in journal_finish_inode_data_buffers() ext4: fix warning in ext4_dio_write_end_io() jbd2: increase the journal IO's priority jbd2: correct the printing of write_flags in jbd2_write_superblock() ext4: prevent the normalized size from exceeding EXT_MAX_BLOCKS commit 7ae42ef308ed0f6250b36f43e4eeb182ebbe6215 Author: Slawomir Laba Date: Wed Nov 29 10:35:26 2023 -0500 iavf: Fix iavf_shutdown to call iavf_remove instead iavf_close Make the flow for pci shutdown be the same to the pci remove. iavf_shutdown was implementing an incomplete version of iavf_remove. It misses several calls to the kernel like iavf_free_misc_irq, iavf_reset_interrupt_capability, iounmap that might break the system on reboot or hibernation. Implement the call of iavf_remove directly in iavf_shutdown to close this gap. Fixes below error messages (dmesg) during shutdown stress tests - [685814.900917] ice 0000:88:00.0: MAC 02:d0:5f:82:43:5d does not exist for VF 0 [685814.900928] ice 0000:88:00.0: MAC 33:33:00:00:00:01 does not exist for VF 0 Reproduction: 1. Create one VF interface: echo 1 > /sys/class/net//device/sriov_numvfs 2. Run live dmesg on the host: dmesg -wH 3. On SUT, script below steps into vf_namespace_assignment.sh <#!/bin/sh> // Remove <>. Git removes # line if= (edit this per VF name) loop=0 while true; do echo test round $loop let loop++ ip netns add ns$loop ip link set dev $if up ip link set dev $if netns ns$loop ip netns exec ns$loop ip link set dev $if up ip netns exec ns$loop ip link set dev $if netns 1 ip netns delete ns$loop done 4. Run the script for at least 1000 iterations on SUT: ./vf_namespace_assignment.sh Expected result: No errors in dmesg. Fixes: 129cf89e5856 ("iavf: rename functions and structs to new name") Signed-off-by: Slawomir Laba Reviewed-by: Michal Swiatkowski Reviewed-by: Ahmed Zaki Reviewed-by: Jesse Brandeburg Co-developed-by: Ranganatha Rao Signed-off-by: Ranganatha Rao Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 09d23b8918f9ab0f8114f6b94f2faf8bde3fb52a Author: Piotr Gardocki Date: Tue Nov 21 22:47:16 2023 -0500 iavf: Handle ntuple on/off based on new state machines for flow director ntuple-filter feature on/off: Default is on. If turned off, the filters will be removed from both PF and iavf list. The removal is irrespective of current filter state. Steps to reproduce: ------------------- 1. Ensure ntuple is on. ethtool -K enp8s0 ntuple-filters on 2. Create a filter to receive the traffic into non-default rx-queue like 15 and ensure traffic is flowing into queue into 15. Now, turn off ntuple. Traffic should not flow to configured queue 15. It should flow to default RX queue. Fixes: 0dbfbabb840d ("iavf: Add framework to enable ethtool ntuple filters") Signed-off-by: Piotr Gardocki Reviewed-by: Larysa Zaremba Signed-off-by: Ranganatha Rao Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 3a0b5a2929fdeda63fc921c2dbed237059acf732 Author: Piotr Gardocki Date: Tue Nov 21 22:47:15 2023 -0500 iavf: Introduce new state machines for flow director New states introduced: IAVF_FDIR_FLTR_DIS_REQUEST IAVF_FDIR_FLTR_DIS_PENDING IAVF_FDIR_FLTR_INACTIVE Current FDIR state machines (SM) are not adequate to handle a few scenarios in the link DOWN/UP event, reset event and ntuple-feature. For example, when VF link goes DOWN and comes back UP administratively, the expectation is that previously installed filters should also be restored. But with current SM, filters are not restored. So with new SM, during link DOWN filters are marked as INACTIVE in the iavf list but removed from PF. After link UP, SM will transition from INACTIVE to ADD_REQUEST to restore the filter. Similarly, with VF reset, filters will be removed from the PF, but marked as INACTIVE in the iavf list. Filters will be restored after reset completion. Steps to reproduce: ------------------- 1. Create a VF. Here VF is enp8s0. 2. Assign IP addresses to VF and link partner and ping continuously from remote. Here remote IP is 1.1.1.1. 3. Check default RX Queue of traffic. ethtool -S enp8s0 | grep -E "rx-[[:digit:]]+\.packets" 4. Add filter - change default RX Queue (to 15 here) ethtool -U ens8s0 flow-type ip4 src-ip 1.1.1.1 action 15 loc 5 5. Ensure filter gets added and traffic is received on RX queue 15 now. Link event testing: ------------------- 6. Bring VF link down and up. If traffic flows to configured queue 15, test is success, otherwise it is a failure. Reset event testing: -------------------- 7. Reset the VF. If traffic flows to configured queue 15, test is success, otherwise it is a failure. Fixes: 0dbfbabb840d ("iavf: Add framework to enable ethtool ntuple filters") Signed-off-by: Piotr Gardocki Reviewed-by: Larysa Zaremba Signed-off-by: Ranganatha Rao Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit eaadbbaaff74ac9a7f84f412fbaac221a04896c1 Merge: 8b8cd4beea4f6 3f29f1c336c0e Author: Linus Torvalds Date: Tue Dec 12 11:06:41 2023 -0800 Merge tag 'fuse-fixes-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse Pull fuse fixes from Miklos Szeredi: - Fix a couple of potential crashes, one introduced in 6.6 and one in 5.10 - Fix misbehavior of virtiofs submounts on memory pressure - Clarify naming in the uAPI for a recent feature * tag 'fuse-fixes-6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: disable FOPEN_PARALLEL_DIRECT_WRITES with FUSE_DIRECT_IO_ALLOW_MMAP fuse: dax: set fc->dax to NULL in fuse_dax_conn_free() fuse: share lookup state between submount and its parent docs/fuse-io: Document the usage of DIRECT_IO_ALLOW_MMAP fuse: Rename DIRECT_IO_RELAX to DIRECT_IO_ALLOW_MMAP commit 8b8cd4beea4f6c68092736c544a797dcd5e094c5 Merge: 26aff849438ce 1373665448119 Author: Linus Torvalds Date: Tue Dec 12 10:30:10 2023 -0800 Merge tag '6.7-rc5-ksmbd-server-fixes' of git://git.samba.org/ksmbd Pull smb server fixes from Steve French: - Memory leak fix (in lock error path) - Two fixes for create with allocation size - FIx for potential UAF in lease break error path - Five directory lease (caching) fixes found during additional recent testing * tag '6.7-rc5-ksmbd-server-fixes' of git://git.samba.org/ksmbd: ksmbd: fix wrong name of SMB2_CREATE_ALLOCATION_SIZE ksmbd: fix wrong allocation size update in smb2_open() ksmbd: avoid duplicate opinfo_put() call on error of smb21_lease_break_ack() ksmbd: lazy v2 lease break on smb2_write() ksmbd: send v2 lease break notification for directory ksmbd: downgrade RWH lease caching state to RH for directory ksmbd: set v2 lease capability ksmbd: set epoch in create context v2 lease ksmbd: fix memory leak in smb2_lock() commit e7ab758741672acb21c5d841a9f0309d30e48a06 Author: Mario Limonciello Date: Mon Jun 19 15:04:24 2023 -0500 drm/amd/display: Disable PSR-SU on Parade 0803 TCON again When screen brightness is rapidly changed and PSR-SU is enabled the display hangs on panels with this TCON even on the latest DCN 3.1.4 microcode (0x8002a81 at this time). This was disabled previously as commit 072030b17830 ("drm/amd: Disable PSR-SU on Parade 0803 TCON") but reverted as commit 1e66a17ce546 ("Revert "drm/amd: Disable PSR-SU on Parade 0803 TCON"") in favor of testing for a new enough microcode (commit cd2e31a9ab93 ("drm/amd/display: Set minimum requirement for using PSR-SU on Phoenix")). As hangs are still happening specifically with this TCON, disable PSR-SU again for it until it can be root caused. Cc: stable@vger.kernel.org Cc: aaron.ma@canonical.com Cc: binli@gnome.org Cc: Marc Rossi Cc: Hamza Mahfooz Signed-off-by: Mario Limonciello Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2046131 Acked-by: Alex Deucher Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit fb01ab528df324a140058a11e9b25e5efdf9671d Author: Fangzhi Zuo Date: Wed Dec 6 14:52:28 2023 -0500 drm/amd/display: Populate dtbclk from bounding box dtbclk is unavaliable from pmfw. Try to grab the value from bounding box Reviewed-by: Charlene Liu Acked-by: Aurabindo Pillai Signed-off-by: Fangzhi Zuo Signed-off-by: Alex Deucher commit a409c053b0b0cc0fc1af684d0b23bd5ca010c4cb Author: Taimur Hassan Date: Wed Dec 6 14:52:25 2023 -0500 drm/amd/display: Revert "Fix conversions between bytes and KB" [Why & How] HostVMMinPageSize is expected to be in KB according to spec, the checks later down the line reflect this as well. Reviewed-by: Nicholas Kazlauskas Acked-by: Aurabindo Pillai Signed-off-by: Taimur Hassan Signed-off-by: Alex Deucher commit 19544aa5f5ece80b12315fa68e51fb2ba6f01fa4 Author: Saleemkhan Jamadar Date: Tue Nov 28 17:02:06 2023 +0530 drm/amdgpu/jpeg: configure doorbell for each playback Doorbell is configured during start of each playback. v1 - add comment for the doorbell programming change Signed-off-by: Saleemkhan Jamadar Acked-by: Leo Liu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 0c12e6c8267f831e491ee64ac6f216601cea3eee Author: Oliver Upton Date: Tue Dec 12 07:04:32 2023 +0000 KVM: selftests: Ensure sysreg-defs.h is generated at the expected path Building the KVM selftests from the main selftests Makefile (as opposed to the kvm subdirectory) doesn't work as OUTPUT is set, forcing the generated header to spill into the selftests directory. Additionally, relative paths do not work when building outside of the srctree, as the canonical selftests path is replaced with 'kselftest' in the output. Work around both of these issues by explicitly overriding OUTPUT on the submake cmdline. Move the whole fragment below the point lib.mk gets included such that $(abs_objdir) is available. Reviewed-by: Cornelia Huck Tested-by: Mark Brown Link: https://lore.kernel.org/r/20231212070431.145544-2-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 3c0696076aad60a2f04c019761921954579e1b0e Author: James Houghton Date: Mon Dec 4 17:26:46 2023 +0000 arm64: mm: Always make sw-dirty PTEs hw-dirty in pte_modify It is currently possible for a userspace application to enter an infinite page fault loop when using HugeTLB pages implemented with contiguous PTEs when HAFDBS is not available. This happens because: 1. The kernel may sometimes write PTEs that are sw-dirty but hw-clean (PTE_DIRTY | PTE_RDONLY | PTE_WRITE). 2. If, during a write, the CPU uses a sw-dirty, hw-clean PTE in handling the memory access on a system without HAFDBS, we will get a page fault. 3. HugeTLB will check if it needs to update the dirty bits on the PTE. For contiguous PTEs, it will check to see if the pgprot bits need updating. In this case, HugeTLB wants to write a sequence of sw-dirty, hw-dirty PTEs, but it finds that all the PTEs it is about to overwrite are all pte_dirty() (pte_sw_dirty() => pte_dirty()), so it thinks no update is necessary. We can get the kernel to write a sw-dirty, hw-clean PTE with the following steps (showing the relevant VMA flags and pgprot bits): i. Create a valid, writable contiguous PTE. VMA vmflags: VM_SHARED | VM_READ | VM_WRITE VMA pgprot bits: PTE_RDONLY | PTE_WRITE PTE pgprot bits: PTE_DIRTY | PTE_WRITE ii. mprotect the VMA to PROT_NONE. VMA vmflags: VM_SHARED VMA pgprot bits: PTE_RDONLY PTE pgprot bits: PTE_DIRTY | PTE_RDONLY iii. mprotect the VMA back to PROT_READ | PROT_WRITE. VMA vmflags: VM_SHARED | VM_READ | VM_WRITE VMA pgprot bits: PTE_RDONLY | PTE_WRITE PTE pgprot bits: PTE_DIRTY | PTE_WRITE | PTE_RDONLY Make it impossible to create a writeable sw-dirty, hw-clean PTE with pte_modify(). Such a PTE should be impossible to create, and there may be places that assume that pte_dirty() implies pte_hw_dirty(). Signed-off-by: James Houghton Fixes: 031e6e6b4e12 ("arm64: hugetlb: Avoid unnecessary clearing in huge_ptep_set_access_flags") Cc: Acked-by: Will Deacon Reviewed-by: Ryan Roberts Link: https://lore.kernel.org/r/20231204172646.2541916-3-jthoughton@google.com Signed-off-by: Catalin Marinas commit 6c02757c936063f0631b4e43fe156f8c8f1f351f Author: Ye Bin Date: Mon Dec 11 19:25:44 2023 +0800 jbd2: fix soft lockup in journal_finish_inode_data_buffers() There's issue when do io test: WARN: soft lockup - CPU#45 stuck for 11s! [jbd2/dm-2-8:4170] CPU: 45 PID: 4170 Comm: jbd2/dm-2-8 Kdump: loaded Tainted: G OE Call trace: dump_backtrace+0x0/0x1a0 show_stack+0x24/0x30 dump_stack+0xb0/0x100 watchdog_timer_fn+0x254/0x3f8 __hrtimer_run_queues+0x11c/0x380 hrtimer_interrupt+0xfc/0x2f8 arch_timer_handler_phys+0x38/0x58 handle_percpu_devid_irq+0x90/0x248 generic_handle_irq+0x3c/0x58 __handle_domain_irq+0x68/0xc0 gic_handle_irq+0x90/0x320 el1_irq+0xcc/0x180 queued_spin_lock_slowpath+0x1d8/0x320 jbd2_journal_commit_transaction+0x10f4/0x1c78 [jbd2] kjournald2+0xec/0x2f0 [jbd2] kthread+0x134/0x138 ret_from_fork+0x10/0x18 Analyzed informations from vmcore as follows: (1) There are about 5k+ jbd2_inode in 'commit_transaction->t_inode_list'; (2) Now is processing the 855th jbd2_inode; (3) JBD2 task has TIF_NEED_RESCHED flag; (4) There's no pags in address_space around the 855th jbd2_inode; (5) There are some process is doing drop caches; (6) Mounted with 'nodioread_nolock' option; (7) 128 CPUs; According to informations from vmcore we know 'journal->j_list_lock' spin lock competition is fierce. So journal_finish_inode_data_buffers() maybe process slowly. Theoretically, there is scheduling point in the filemap_fdatawait_range_keep_errors(). However, if inode's address_space has no pages which taged with PAGECACHE_TAG_WRITEBACK, will not call cond_resched(). So may lead to soft lockup. journal_finish_inode_data_buffers filemap_fdatawait_range_keep_errors __filemap_fdatawait_range while (index <= end) nr_pages = pagevec_lookup_range_tag(&pvec, mapping, &index, end, PAGECACHE_TAG_WRITEBACK); if (!nr_pages) break; --> If 'nr_pages' is equal zero will break, then will not call cond_resched() for (i = 0; i < nr_pages; i++) wait_on_page_writeback(page); cond_resched(); To solve above issue, add scheduling point in the journal_finish_inode_data_buffers(); Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20231211112544.3879780-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit cd607f2cbbbec90682b2f6d6b85e1525d0f43b19 Author: Felix Fietkau Date: Fri Dec 8 08:50:04 2023 +0100 wifi: mt76: fix crash with WED rx support enabled If WED rx is enabled, rx buffers are added to a buffer pool that can be filled from multiple page pools. Because buffers freed from rx poll are not guaranteed to belong to the processed queue's page pool, lockless caching must not be used in this case. Cc: stable@vger.kernel.org Fixes: 2f5c3c77fc9b ("wifi: mt76: switch to page_pool allocator") Signed-off-by: Felix Fietkau Acked-by: Lorenzo Bianconi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231208075004.69843-1-nbd@nbd.name commit df83a0df820b9b705e51b9499691b0dafb2f4dcb Author: Yan Jun Date: Sun Dec 3 19:50:58 2023 +0800 HID: apple: Add "hfd.cn" and "WKB603" to the list of non-apple keyboards JingZao(京造) WKB603 keyboard is a rebranded product of Jamesdonkey RS2 keyboard, identified as "hfd.cn WKB603" in wired mode, "WKB603" in bluetooth mode. Adding them to the list of non-apple keyboards fixes function key. Signed-off-by: Yan Jun Signed-off-by: Jiri Kosina commit 43527a0094c10dfbf0d5a2e7979395a38de3ff65 Author: Mikhail Khvainitski Date: Tue Dec 12 15:31:48 2023 +0200 HID: lenovo: Restrict detection of patched firmware only to USB cptkbd Commit 46a0a2c96f0f ("HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround") introduced a regression for ThinkPad TrackPoint Keyboard II which has similar quirks to cptkbd (so it uses the same workarounds) but slightly different so that there are false-positives during detecting well-behaving firmware. This commit restricts detecting well-behaving firmware to the only model which known to have one and have stable enough quirks to not cause false-positives. Fixes: 46a0a2c96f0f ("HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround") Link: https://lore.kernel.org/linux-input/ZXRiiPsBKNasioqH@jekhomev/ Link: https://bbs.archlinux.org/viewtopic.php?pid=2135468#p2135468 Signed-off-by: Mikhail Khvainitski Tested-by: Yauhen Kharuzhy Signed-off-by: Jiri Kosina commit 810c38a369a0a0ce625b5c12169abce1dd9ccd53 Author: Hyunwoo Kim Date: Sat Dec 9 05:05:38 2023 -0500 net/rose: Fix Use-After-Free in rose_ioctl Because rose_ioctl() accesses sk->sk_receive_queue without holding a sk->sk_receive_queue.lock, it can cause a race with rose_accept(). A use-after-free for skb occurs with the following flow. ``` rose_ioctl() -> skb_peek() rose_accept() -> skb_dequeue() -> kfree_skb() ``` Add sk->sk_receive_queue.lock to rose_ioctl() to fix this issue. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Hyunwoo Kim Link: https://lore.kernel.org/r/20231209100538.GA407321@v4bel-B760M-AORUS-ELITE-AX Signed-off-by: Paolo Abeni commit 24e90b9e34f9e039f56b5f25f6e6eb92cdd8f4b3 Author: Hyunwoo Kim Date: Sat Dec 9 04:42:10 2023 -0500 atm: Fix Use-After-Free in do_vcc_ioctl Because do_vcc_ioctl() accesses sk->sk_receive_queue without holding a sk->sk_receive_queue.lock, it can cause a race with vcc_recvmsg(). A use-after-free for skb occurs with the following flow. ``` do_vcc_ioctl() -> skb_peek() vcc_recvmsg() -> skb_recv_datagram() -> skb_free_datagram() ``` Add sk->sk_receive_queue.lock to do_vcc_ioctl() to fix this issue. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Hyunwoo Kim Link: https://lore.kernel.org/r/20231209094210.GA403126@v4bel-B760M-AORUS-ELITE-AX Signed-off-by: Paolo Abeni commit 1892fe103c3a20fced306c8dafa74f7f6d4ea0a3 Author: Robin Murphy Date: Mon Dec 11 19:27:28 2023 +0000 perf/arm-cmn: Fail DTC counter allocation correctly Calling arm_cmn_event_clear() before all DTC indices are allocated is wrong, and can lead to arm_cmn_event_add() erroneously clearing live counters from full DTCs where allocation fails. Since the DTC counters are only updated by arm_cmn_init_counter() after all DTC and DTM allocations succeed, nothing actually needs cleaning up in this case anyway, and it should just return directly as it did before. Fixes: 7633ec2c262f ("perf/arm-cmn: Rework DTC counters (again)") Signed-off-by: Robin Murphy Reviewed-by: Ilkka Koskinen Acked-by: Will Deacon Link: https://lore.kernel.org/r/ed589c0d8e4130dc68b8ad1625226d28bdc185d4.1702322847.git.robin.murphy@arm.com Signed-off-by: Catalin Marinas commit da48708e873312aeba42481f12e2982f8a8ffb80 Merge: a39b6ac3781d4 f0b94c1c5c799 Author: Greg Kroah-Hartman Date: Tue Dec 12 11:34:07 2023 +0100 Merge tag 'thunderbolt-for-v6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-linus Mika writes: thunderbolt: Fixes for v6.7-rc6 This includes following USB4/Thunderbolt fixes for v6.7-rc6: - Fix memory leak in margining_port_remove() - Correct minimum bandwidth allocated for USB 3.x and PCIe to avoid reducing DisplayPort capabilities in certain monitor configurations. Both have been in linux-next with no reported issues. * tag 'thunderbolt-for-v6.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Fix minimum allocated USB 3.x and PCIe bandwidth thunderbolt: Fix memory leak in margining_port_remove() commit ce038edfce43fb345f8dfdca0f7b17f535896701 Author: Avraham Stern Date: Thu Dec 7 04:50:17 2023 +0200 wifi: iwlwifi: pcie: avoid a NULL pointer dereference It possible that while the rx rb is being handled, the transport has been stopped and re-started. In this case the tx queue pointer is not yet initialized, which will lead to a NULL pointer dereference. Fix it. Signed-off-by: Avraham Stern Signed-off-by: Miri Korenblit Link: https://msgid.link/20231207044813.cd0898cafd89.I0b84daae753ba9612092bf383f5c6f761446e964@changeid Signed-off-by: Johannes Berg commit 8c386b166e2517cf3a123018e77941ec22625d0f Author: Johannes Berg Date: Mon Dec 11 09:05:31 2023 +0200 wifi: mac80211: mesh_plink: fix matches_local logic During refactoring the "else" here got lost, add it back. Fixes: c99a89edb106 ("mac80211: factor out plink event gathering") Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit Link: https://msgid.link/20231211085121.795480fa0e0b.I017d501196a5bbdcd9afd33338d342d6fe1edd79@changeid Signed-off-by: Johannes Berg commit 1fc4a3eec50d726f4663ad3c0bb0158354d6647a Author: Johannes Berg Date: Mon Dec 11 09:05:32 2023 +0200 wifi: mac80211: mesh: check element parsing succeeded ieee802_11_parse_elems() can return NULL, so we must check for the return value. Fixes: 5d24828d05f3 ("mac80211: always allocate struct ieee802_11_elems") Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit Link: https://msgid.link/20231211085121.93dea364f3d3.Ie87781c6c48979fb25a744b90af4a33dc2d83a28@changeid Signed-off-by: Johannes Berg commit 98849ba2aa9db46e62720fb686a9d63ed9887806 Author: Johannes Berg Date: Mon Dec 11 09:05:30 2023 +0200 wifi: mac80211: check defragmentation succeeded We need to check that cfg80211_defragment_element() didn't return an error, since it can fail due to bad input, and we didn't catch that before. Fixes: 8eb8dd2ffbbb ("wifi: mac80211: Support link removal using Reconfiguration ML element") Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit Link: https://msgid.link/20231211085121.8595a6b67fc0.I1225edd8f98355e007f96502e358e476c7971d8c@changeid Signed-off-by: Johannes Berg commit 63bafd9d5421959b2124dd940ed8d7462d99f449 Author: Johannes Berg Date: Mon Dec 11 09:05:19 2023 +0200 wifi: mac80211: don't re-add debugfs during reconfig If we're doing reconfig, then we cannot add the debugfs files that are already there from before the reconfig. Skip that in drv_change_sta_links() during reconfig. Fixes: d2caad527c19 ("wifi: mac80211: add API to show the link STAs in debugfs") Signed-off-by: Johannes Berg Reviewed-by: Gregory Greenman Reviewed-by: Benjamin Berg Signed-off-by: Miri Korenblit Link: https://msgid.link/20231211085121.88a950f43e16.Id71181780994649219685887c0fcad33d387cc78@changeid Signed-off-by: Johannes Berg commit 23484d817082c3005252d8edfc8292c8a1006b5b Author: Rouven Czerwinski Date: Thu Dec 7 08:58:36 2023 +0100 net: rfkill: gpio: set GPIO direction Fix the undefined usage of the GPIO consumer API after retrieving the GPIO description with GPIO_ASIS. The API documentation mentions that GPIO_ASIS won't set a GPIO direction and requires the user to set a direction before using the GPIO. This can be confirmed on i.MX6 hardware, where rfkill-gpio is no longer able to enabled/disable a device, presumably because the GPIO controller was never configured for the output direction. Fixes: b2f750c3a80b ("net: rfkill: gpio: prevent value glitch during probe") Cc: stable@vger.kernel.org Signed-off-by: Rouven Czerwinski Link: https://msgid.link/20231207075835.3091694-1-r.czerwinski@pengutronix.de Signed-off-by: Johannes Berg commit c1393c132b906fbdf91f6d1c9eb2ef7a00cce64e Author: Edward Adam Davis Date: Wed Nov 29 20:17:47 2023 +0800 wifi: mac80211: check if the existing link config remains unchanged [Syz report] WARNING: CPU: 1 PID: 5067 at net/mac80211/rate.c:48 rate_control_rate_init+0x540/0x690 net/mac80211/rate.c:48 Modules linked in: CPU: 1 PID: 5067 Comm: syz-executor413 Not tainted 6.7.0-rc3-syzkaller-00014-gdf60cee26a2e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 RIP: 0010:rate_control_rate_init+0x540/0x690 net/mac80211/rate.c:48 Code: 48 c7 c2 00 46 0c 8c be 08 03 00 00 48 c7 c7 c0 45 0c 8c c6 05 70 79 0b 05 01 e8 1b a0 6f f7 e9 e0 fd ff ff e8 61 b3 8f f7 90 <0f> 0b 90 e9 36 ff ff ff e8 53 b3 8f f7 e8 5e 0b 78 f7 31 ff 89 c3 RSP: 0018:ffffc90003c57248 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff888016bc4000 RCX: ffffffff89f7d519 RDX: ffff888076d43b80 RSI: ffffffff89f7d6df RDI: 0000000000000005 RBP: ffff88801daaae20 R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000002 R12: 0000000000000001 R13: 0000000000000000 R14: ffff888020030e20 R15: ffff888078f08000 FS: 0000555556b94380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000005fdeb8 CR3: 0000000076d22000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: sta_apply_auth_flags.constprop.0+0x4b7/0x510 net/mac80211/cfg.c:1674 sta_apply_parameters+0xaf1/0x16c0 net/mac80211/cfg.c:2002 ieee80211_add_station+0x3fa/0x6c0 net/mac80211/cfg.c:2068 rdev_add_station net/wireless/rdev-ops.h:201 [inline] nl80211_new_station+0x13ba/0x1a70 net/wireless/nl80211.c:7603 genl_family_rcv_msg_doit+0x1fc/0x2e0 net/netlink/genetlink.c:972 genl_family_rcv_msg net/netlink/genetlink.c:1052 [inline] genl_rcv_msg+0x561/0x800 net/netlink/genetlink.c:1067 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2545 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1076 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0x53b/0x810 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x93c/0xe40 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2584 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2638 __sys_sendmsg+0x117/0x1e0 net/socket.c:2667 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b [Analysis] It is inappropriate to make a link configuration change judgment on an non-existent and non new link. [Fix] Quickly exit when there is a existent link and the link configuration has not changed. Fixes: b303835dabe0 ("wifi: mac80211: accept STA changes without link changes") Reported-and-tested-by: syzbot+62d7eef57b09bfebcd84@syzkaller.appspotmail.com Signed-off-by: Edward Adam Davis Link: https://msgid.link/tencent_DE67FF86DB92ED465489A36ECD2EDDCC8C06@qq.com Signed-off-by: Johannes Berg commit fb768d3b13ffa325b7e84480d488ac799c9d2cd7 Author: Chen-Yu Tsai Date: Thu Dec 7 21:20:50 2023 +0800 wifi: cfg80211: Add my certificate As announced [1][2], I have taken over maintainership of the wireless-regdb project. Add my certificate so that newer releases are valid to the kernel. Seth's certificate should be kept around for awhile, at least until a few new releases by me happen. This should also be applied to stable trees so that stable kernels can utilize newly released database binaries. [1] https://lore.kernel.org/linux-wireless/CAGb2v657baNMPKU3QADijx7hZa=GUcSv2LEDdn6N=QQaFX8r-g@mail.gmail.com/ [2] https://lore.kernel.org/linux-wireless/ZWmRR5ul7EDfxCan@wens.tw/ Cc: stable@vger.kernel.org Signed-off-by: Chen-Yu Tsai Acked-by: Seth Forshee Link: https://msgid.link/ZXHGsqs34qZyzZng@wens.tw Signed-off-by: Johannes Berg commit a4754182dc936b97ec7e9f6b08cdf7ed97ef9069 Author: Johannes Berg Date: Fri Dec 8 18:32:02 2023 +0200 wifi: iwlwifi: pcie: add another missing bh-disable for rxq->lock Evidently I had only looked at all the ones in rx.c, and missed this. Add bh-disable to this use of the rxq->lock as well. Fixes: 25edc8f259c7 ("iwlwifi: pcie: properly implement NAPI") Reported-by: Brian Norris Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit Link: https://msgid.link/20231208183100.e79ad3dae649.I8f19713c4383707f8be7fc20ff5cc1ecf12429bb@changeid Signed-off-by: Johannes Berg commit 76101fa0c0a9519010c6afe488574ec38aa4ba8d Merge: e1b2fa6185bab 408d4b33c2440 Author: Greg Kroah-Hartman Date: Tue Dec 12 09:43:01 2023 +0100 Merge tag 'iio-fixes-for-6.7a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linus Jonathan writes: First set of IIO fixes for the 6.7 cycle. Usual mixed bunch of driver bugs. The core bug probably isn't hit with upstream drivers, but good to get fix in place anyway. iio-core - Fix potential freeing of wrong iio buffer when multiple buffers used. adi,adis16475 - Add missing spi_device_id table need for module auto-loading - Fix untended BIT(BIT()) due to wrong macro definitions. amlogic,meson - Add a chip specific config for AXG soc familly which needs a vref_select to work. freescale,mp6050 - Fix eating of error code on failure to read from sensor. kionixq,kx022a - Fix scaling to comply with ABI (m/s^2 rather than micro m/s^2) measspec,ms_sensors - Fix wrong conversion times due to strange value mapping. microchip,mcp3564 - Fix previously impossible to fail check on limits. - Fix identification logic. nxp,imx93 - Add missing channels for i.mx95. ti,am335x - Fix handling of error for tiadc_request_dma(). ti,tmag5273 - Fix incorrect temperature offset. * tag 'iio-fixes-for-6.7a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: iio: adc: MCP3564: fix hardware identification logic iio: adc: MCP3564: fix calib_bias and calib_scale range checks iio: adc: meson: add separate config for axg SoC family iio: adc: imx93: add four channels for imx93 adc iio: adc: ti_am335x_adc: Fix return value check of tiadc_request_dma() iio: triggered-buffer: prevent possible freeing of wrong buffer iio: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw iio: imu: adis16475: use bit numbers in assign_bit() iio: imu: adis16475: add spi_device_id table iio: tmag5273: fix temperature offset iio: common: ms_sensors: ms_sensors_i2c: fix humidity conversion time table iio: kx022a: Fix acceleration value scaling commit e1b2fa6185babdff58953ee0b65f569255bd0897 Merge: a39b6ac3781d4 9085b23b668ad Author: Greg Kroah-Hartman Date: Tue Dec 12 09:42:11 2023 +0100 Merge tag 'icc-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-linus Georgi writes: interconnect fixes for v6.7-rc This contains fixes for reported issues. One fix is in framework code to explicitly treat returned NULL nodes as error when the device-tree data is translated into endpoint nodes. The other two fixes are in driver code. One is expected to improve the power consumption on the sm8250 platforms and the other one is fixing a bandwidth calculation formula that was introduced during this cycle. - interconnect: Treat xlate() returning NULL node as an error - interconnect: qcom: sm8250: Enable sync_state - interconnect: qcom: icc-rpm: Fix peak rate calculation Signed-off-by: Georgi Djakov * tag 'icc-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: interconnect: qcom: icc-rpm: Fix peak rate calculation interconnect: qcom: sm8250: Enable sync_state interconnect: Treat xlate() returning NULL node as an error commit 98fb9b9680c9f3895ced02d6a73e27f5d7b5892b Author: Johannes Berg Date: Wed Dec 6 22:37:57 2023 +0100 wifi: ieee80211: don't require protected vendor action frames For vendor action frames, whether a protected one should be used or not is clearly up to the individual vendor and frame, so even though a protected dual is defined, it may not get used. Thus, don't require protection for vendor action frames when they're used in a connection. Since we obviously don't process frames unknown to the kernel in the kernel, it may makes sense to invert this list to have all the ones the kernel processes and knows to be requiring protection, but that'd be a different change. Fixes: 91535613b609 ("wifi: mac80211: don't drop all unprotected public action frames") Reported-by: Jouni Malinen Link: https://msgid.link/20231206223801.f6a2cf4e67ec.Ifa6acc774bd67801d3dafb405278f297683187aa@changeid Signed-off-by: Johannes Berg commit b1a39a718db44ecb18c2a99a11e15f6eedc14c53 Author: Marc Zyngier Date: Thu Dec 7 15:12:01 2023 +0000 KVM: Convert comment into an assertion in kvm_io_bus_register_dev() Instead of having a comment indicating the need to hold slots_lock when calling kvm_io_bus_register_dev(), make it explicit with a lockdep assertion. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231207151201.3028710-6-maz@kernel.org Signed-off-by: Oliver Upton commit 6bef365e310a5cd4b6e95fbb80b44725fce97e37 Author: Marc Zyngier Date: Thu Dec 7 15:12:00 2023 +0000 KVM: arm64: vgic: Ensure that slots_lock is held in vgic_register_all_redist_iodevs() Although we implicitly depend on slots_lock being held when registering IO devices with the IO bus infrastructure, we don't enforce this requirement. Make it explicit. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231207151201.3028710-5-maz@kernel.org Signed-off-by: Oliver Upton commit 02e3858f08faabab9503ae2911cf7c7e27702257 Author: Marc Zyngier Date: Thu Dec 7 15:11:59 2023 +0000 KVM: arm64: vgic: Force vcpu vgic teardown on vcpu destroy When failing to create a vcpu because (for example) it has a duplicate vcpu_id, we destroy the vcpu. Amusingly, this leaves the redistributor registered with the KVM_MMIO bus. This is no good, and we should properly clean the mess. Force a teardown of the vgic vcpu interface, including the RD device before returning to the caller. Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231207151201.3028710-4-maz@kernel.org Signed-off-by: Oliver Upton commit d26b9cb33c2d1ba68d1f26bb06c40300f16a3799 Author: Marc Zyngier Date: Thu Dec 7 15:11:58 2023 +0000 KVM: arm64: vgic: Add a non-locking primitive for kvm_vgic_vcpu_destroy() As we are going to need to call into kvm_vgic_vcpu_destroy() without prior holding of the slots_lock, introduce __kvm_vgic_vcpu_destroy() as a non-locking primitive of kvm_vgic_vcpu_destroy(). Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231207151201.3028710-3-maz@kernel.org Signed-off-by: Oliver Upton commit 01ad29d224ff73bc4e16e0ef9ece17f28598c4a4 Author: Marc Zyngier Date: Thu Dec 7 15:11:57 2023 +0000 KVM: arm64: vgic: Simplify kvm_vgic_destroy() When destroying a vgic, we have rather cumbersome rules about when slots_lock and config_lock are held, resulting in fun buglets. The first port of call is to simplify kvm_vgic_map_resources() so that there is only one call to kvm_vgic_destroy() instead of two, with the second only holding half of the locks. For that, we kill the non-locking primitive and move the call outside of the locking altogether. This doesn't change anything (we re-acquire the locks and teardown the whole vgic), and simplifies the code significantly. Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231207151201.3028710-2-maz@kernel.org Signed-off-by: Oliver Upton commit bedd6fe4d357f3cffb392f2153b52ef71f810259 Author: Kent Overstreet Date: Mon Dec 11 18:40:17 2023 -0500 bcachefs: Fix nocow locks deadlock On trylock failure we were waiting for outstanding reads to complete - but nocow locks need to be held until the whole move is finished. Signed-off-by: Kent Overstreet commit 26aff849438cebcd05f1a647390c4aa700d5c0f1 Merge: 52bf9f6c09fca a66ff26b0f311 Author: Linus Torvalds Date: Mon Dec 11 16:13:51 2023 -0800 Merge tag 'bcachefs-2023-12-10' of https://evilpiepirate.org/git/bcachefs Pull more bcachefs bugfixes from Kent Overstreet: - Fix a rare emergency shutdown path bug: dropping journal pins after the filesystem has mostly been torn down is not what we want. - Fix some concurrency issues with the btree write buffer and journal replay by not using the btree write buffer until journal replay is finished - A fixup from the prior patch to kill journal pre-reservations: at the start of the btree update path, where previously we took a pre-reservation, we do at least want to check the journal watermark. - Fix a race between dropping device metadata and btree node writes, which would re-add a pointer to a device that had just been dropped - Fix one of the SCRU lock warnings, in bch2_compression_stats_to_text(). - Partial fix for a rare transaction paths overflow, when indirect extents had been split by background tasks, by not running certain triggers when they're not needed. - Fix for creating a snapshot with implicit source in a subdirectory of the containing subvolume - Don't unfreeze when we're emergency read-only - Fix for rebalance spinning trying to compress unwritten extentns - Another deleted_inodes fix, for directories - Fix a rare deadlock (usually just an unecessary wait) when flushing the journal with an open journal entry. * tag 'bcachefs-2023-12-10' of https://evilpiepirate.org/git/bcachefs: bcachefs: Close journal entry if necessary when flushing all pins bcachefs: Fix uninitialized var in bch2_journal_replay() bcachefs: Fix deleted inode check for dirs bcachefs: rebalance shouldn't attempt to compress unwritten extents bcachefs: don't attempt rw on unfreeze when shutdown bcachefs: Fix creating snapshot with implict source bcachefs: Don't run indirect extent trigger unless inserting/deleting bcachefs: Convert compression_stats to for_each_btree_key2 bcachefs: Fix bch2_extent_drop_ptrs() call bcachefs: Fix a journal deadlock in replay bcachefs; Don't use btree write buffer until journal replay is finished bcachefs: Don't drop journal pins in exit path commit 52bf9f6c09fca8c74388cd41cc24e5d1bff812a9 Author: David Howells Date: Mon Dec 11 21:43:52 2023 +0000 afs: Fix refcount underflow from error handling race If an AFS cell that has an unreachable (eg. ENETUNREACH) server listed (VL server or fileserver), an asynchronous probe to one of its addresses may fail immediately because sendmsg() returns an error. When this happens, a refcount underflow can happen if certain events hit a very small window. The way this occurs is: (1) There are two levels of "call" object, the afs_call and the rxrpc_call. Each of them can be transitioned to a "completed" state in the event of success or failure. (2) Asynchronous afs_calls are self-referential whilst they are active to prevent them from evaporating when they're not being processed. This reference is disposed of when the afs_call is completed. Note that an afs_call may only be completed once; once completed completing it again will do nothing. (3) When a call transmission is made, the app-side rxrpc code queues a Tx buffer for the rxrpc I/O thread to transmit. The I/O thread invokes sendmsg() to transmit it - and in the case of failure, it transitions the rxrpc_call to the completed state. (4) When an rxrpc_call is completed, the app layer is notified. In this case, the app is kafs and it schedules a work item to process events pertaining to an afs_call. (5) When the afs_call event processor is run, it goes down through the RPC-specific handler to afs_extract_data() to retrieve data from rxrpc - and, in this case, it picks up the error from the rxrpc_call and returns it. The error is then propagated to the afs_call and that is completed too. At this point the self-reference is released. (6) If the rxrpc I/O thread manages to complete the rxrpc_call within the window between rxrpc_send_data() queuing the request packet and checking for call completion on the way out, then rxrpc_kernel_send_data() will return the error from sendmsg() to the app. (7) Then afs_make_call() will see an error and will jump to the error handling path which will attempt to clean up the afs_call. (8) The problem comes when the error handling path in afs_make_call() tries to unconditionally drop an async afs_call's self-reference. This self-reference, however, may already have been dropped by afs_extract_data() completing the afs_call (9) The refcount underflows when we return to afs_do_probe_vlserver() and that tries to drop its reference on the afs_call. Fix this by making afs_make_call() attempt to complete the afs_call rather than unconditionally putting it. That way, if afs_extract_data() manages to complete the call first, afs_make_call() won't do anything. The bug can be forced by making do_udp_sendmsg() return -ENETUNREACH and sticking an msleep() in rxrpc_send_data() after the 'success:' label to widen the race window. The error message looks something like: refcount_t: underflow; use-after-free. WARNING: CPU: 3 PID: 720 at lib/refcount.c:28 refcount_warn_saturate+0xba/0x110 ... RIP: 0010:refcount_warn_saturate+0xba/0x110 ... afs_put_call+0x1dc/0x1f0 [kafs] afs_fs_get_capabilities+0x8b/0xe0 [kafs] afs_fs_probe_fileserver+0x188/0x1e0 [kafs] afs_lookup_server+0x3bf/0x3f0 [kafs] afs_alloc_server_list+0x130/0x2e0 [kafs] afs_create_volume+0x162/0x400 [kafs] afs_get_tree+0x266/0x410 [kafs] vfs_get_tree+0x25/0xc0 fc_mount+0xe/0x40 afs_d_automount+0x1b3/0x390 [kafs] __traverse_mounts+0x8f/0x210 step_into+0x340/0x760 path_openat+0x13a/0x1260 do_filp_open+0xaf/0x160 do_sys_openat2+0xaf/0x170 or something like: refcount_t: underflow; use-after-free. ... RIP: 0010:refcount_warn_saturate+0x99/0xda ... afs_put_call+0x4a/0x175 afs_send_vl_probes+0x108/0x172 afs_select_vlserver+0xd6/0x311 afs_do_cell_detect_alias+0x5e/0x1e9 afs_cell_detect_alias+0x44/0x92 afs_validate_fc+0x9d/0x134 afs_get_tree+0x20/0x2e6 vfs_get_tree+0x1d/0xc9 fc_mount+0xe/0x33 afs_d_automount+0x48/0x9d __traverse_mounts+0xe0/0x166 step_into+0x140/0x274 open_last_lookups+0x1c1/0x1df path_openat+0x138/0x1c3 do_filp_open+0x55/0xb4 do_sys_openat2+0x6c/0xb6 Fixes: 34fa47612bfe ("afs: Fix race in async call refcounting") Reported-by: Bill MacAllister Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1052304 Suggested-by: Jeffrey E Altman Signed-off-by: David Howells Reviewed-by: Jeffrey Altman cc: Marc Dionne cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/2633992.1702073229@warthog.procyon.org.uk/ # v1 Signed-off-by: Linus Torvalds commit 3a42709fa909e22b0be4bb1e2795aa04ada732a3 Author: Paulo Alcantara Date: Mon Dec 11 10:26:43 2023 -0300 smb: client: fix OOB in smb2_query_reparse_point() Validate @ioctl_rsp->OutputOffset and @ioctl_rsp->OutputCount so that their sum does not wrap to a number that is smaller than @reparse_buf and we end up with a wild pointer as follows: BUG: unable to handle page fault for address: ffff88809c5cd45f #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 4a01067 P4D 4a01067 PUD 0 Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 2 PID: 1260 Comm: mount.cifs Not tainted 6.7.0-rc4 #2 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014 RIP: 0010:smb2_query_reparse_point+0x3e0/0x4c0 [cifs] Code: ff ff e8 f3 51 fe ff 41 89 c6 58 5a 45 85 f6 0f 85 14 fe ff ff 49 8b 57 48 8b 42 60 44 8b 42 64 42 8d 0c 00 49 39 4f 50 72 40 <8b> 04 02 48 8b 9d f0 fe ff ff 49 8b 57 50 89 03 48 8b 9d e8 fe ff RSP: 0018:ffffc90000347a90 EFLAGS: 00010212 RAX: 000000008000001f RBX: ffff88800ae11000 RCX: 00000000000000ec RDX: ffff88801c5cd440 RSI: 0000000000000000 RDI: ffffffff82004aa4 RBP: ffffc90000347bb0 R08: 00000000800000cd R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000024 R12: ffff8880114d4100 R13: ffff8880114d4198 R14: 0000000000000000 R15: ffff8880114d4000 FS: 00007f02c07babc0(0000) GS:ffff88806ba00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff88809c5cd45f CR3: 0000000011750000 CR4: 0000000000750ef0 PKRU: 55555554 Call Trace: ? __die+0x23/0x70 ? page_fault_oops+0x181/0x480 ? search_module_extables+0x19/0x60 ? srso_alias_return_thunk+0x5/0xfbef5 ? exc_page_fault+0x1b6/0x1c0 ? asm_exc_page_fault+0x26/0x30 ? _raw_spin_unlock_irqrestore+0x44/0x60 ? smb2_query_reparse_point+0x3e0/0x4c0 [cifs] cifs_get_fattr+0x16e/0xa50 [cifs] ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_acquire+0xbf/0x2b0 cifs_root_iget+0x163/0x5f0 [cifs] cifs_smb3_do_mount+0x5bd/0x780 [cifs] smb3_get_tree+0xd9/0x290 [cifs] vfs_get_tree+0x2c/0x100 ? capable+0x37/0x70 path_mount+0x2d7/0xb80 ? srso_alias_return_thunk+0x5/0xfbef5 ? _raw_spin_unlock_irqrestore+0x44/0x60 __x64_sys_mount+0x11a/0x150 do_syscall_64+0x47/0xf0 entry_SYSCALL_64_after_hwframe+0x6f/0x77 RIP: 0033:0x7f02c08d5b1e Fixes: 2e4564b31b64 ("smb3: add support for stat of WSL reparse points for special file types") Cc: stable@vger.kernel.org Reported-by: Robert Morris Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 90d025c2e953c11974e76637977c473200593a46 Author: Paulo Alcantara Date: Mon Dec 11 10:26:42 2023 -0300 smb: client: fix NULL deref in asn1_ber_decoder() If server replied SMB2_NEGOTIATE with a zero SecurityBufferOffset, smb2_get_data_area() sets @len to non-zero but return NULL, so decode_negTokeninit() ends up being called with a NULL @security_blob: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 2 PID: 871 Comm: mount.cifs Not tainted 6.7.0-rc4 #2 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014 RIP: 0010:asn1_ber_decoder+0x173/0xc80 Code: 01 4c 39 2c 24 75 09 45 84 c9 0f 85 2f 03 00 00 48 8b 14 24 4c 29 ea 48 83 fa 01 0f 86 1e 07 00 00 48 8b 74 24 28 4d 8d 5d 01 <42> 0f b6 3c 2e 89 fa 40 88 7c 24 5c f7 d2 83 e2 1f 0f 84 3d 07 00 RSP: 0018:ffffc9000063f950 EFLAGS: 00010202 RAX: 0000000000000002 RBX: 0000000000000000 RCX: 000000000000004a RDX: 000000000000004a RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000002 R11: 0000000000000001 R12: 0000000000000000 R13: 0000000000000000 R14: 000000000000004d R15: 0000000000000000 FS: 00007fce52b0fbc0(0000) GS:ffff88806ba00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000001ae64000 CR4: 0000000000750ef0 PKRU: 55555554 Call Trace: ? __die+0x23/0x70 ? page_fault_oops+0x181/0x480 ? __stack_depot_save+0x1e6/0x480 ? exc_page_fault+0x6f/0x1c0 ? asm_exc_page_fault+0x26/0x30 ? asn1_ber_decoder+0x173/0xc80 ? check_object+0x40/0x340 decode_negTokenInit+0x1e/0x30 [cifs] SMB2_negotiate+0xc99/0x17c0 [cifs] ? smb2_negotiate+0x46/0x60 [cifs] ? srso_alias_return_thunk+0x5/0xfbef5 smb2_negotiate+0x46/0x60 [cifs] cifs_negotiate_protocol+0xae/0x130 [cifs] cifs_get_smb_ses+0x517/0x1040 [cifs] ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? queue_delayed_work_on+0x5d/0x90 cifs_mount_get_session+0x78/0x200 [cifs] dfs_mount_share+0x13a/0x9f0 [cifs] ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_acquire+0xbf/0x2b0 ? find_nls+0x16/0x80 ? srso_alias_return_thunk+0x5/0xfbef5 cifs_mount+0x7e/0x350 [cifs] cifs_smb3_do_mount+0x128/0x780 [cifs] smb3_get_tree+0xd9/0x290 [cifs] vfs_get_tree+0x2c/0x100 ? capable+0x37/0x70 path_mount+0x2d7/0xb80 ? srso_alias_return_thunk+0x5/0xfbef5 ? _raw_spin_unlock_irqrestore+0x44/0x60 __x64_sys_mount+0x11a/0x150 do_syscall_64+0x47/0xf0 entry_SYSCALL_64_after_hwframe+0x6f/0x77 RIP: 0033:0x7fce52c2ab1e Fix this by setting @len to zero when @off == 0 so callers won't attempt to dereference non-existing data areas. Reported-by: Robert Morris Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit af1689a9b7701d9907dfc84d2a4b57c4bc907144 Author: Paulo Alcantara Date: Mon Dec 11 10:26:41 2023 -0300 smb: client: fix potential OOBs in smb2_parse_contexts() Validate offsets and lengths before dereferencing create contexts in smb2_parse_contexts(). This fixes following oops when accessing invalid create contexts from server: BUG: unable to handle page fault for address: ffff8881178d8cc3 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 4a01067 P4D 4a01067 PUD 0 Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 3 PID: 1736 Comm: mount.cifs Not tainted 6.7.0-rc4 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014 RIP: 0010:smb2_parse_contexts+0xa0/0x3a0 [cifs] Code: f8 10 75 13 48 b8 93 ad 25 50 9c b4 11 e7 49 39 06 0f 84 d2 00 00 00 8b 45 00 85 c0 74 61 41 29 c5 48 01 c5 41 83 fd 0f 76 55 <0f> b7 7d 04 0f b7 45 06 4c 8d 74 3d 00 66 83 f8 04 75 bc ba 04 00 RSP: 0018:ffffc900007939e0 EFLAGS: 00010216 RAX: ffffc90000793c78 RBX: ffff8880180cc000 RCX: ffffc90000793c90 RDX: ffffc90000793cc0 RSI: ffff8880178d8cc0 RDI: ffff8880180cc000 RBP: ffff8881178d8cbf R08: ffffc90000793c22 R09: 0000000000000000 R10: ffff8880180cc000 R11: 0000000000000024 R12: 0000000000000000 R13: 0000000000000020 R14: 0000000000000000 R15: ffffc90000793c22 FS: 00007f873753cbc0(0000) GS:ffff88806bc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff8881178d8cc3 CR3: 00000000181ca000 CR4: 0000000000750ef0 PKRU: 55555554 Call Trace: ? __die+0x23/0x70 ? page_fault_oops+0x181/0x480 ? search_module_extables+0x19/0x60 ? srso_alias_return_thunk+0x5/0xfbef5 ? exc_page_fault+0x1b6/0x1c0 ? asm_exc_page_fault+0x26/0x30 ? smb2_parse_contexts+0xa0/0x3a0 [cifs] SMB2_open+0x38d/0x5f0 [cifs] ? smb2_is_path_accessible+0x138/0x260 [cifs] smb2_is_path_accessible+0x138/0x260 [cifs] cifs_is_path_remote+0x8d/0x230 [cifs] cifs_mount+0x7e/0x350 [cifs] cifs_smb3_do_mount+0x128/0x780 [cifs] smb3_get_tree+0xd9/0x290 [cifs] vfs_get_tree+0x2c/0x100 ? capable+0x37/0x70 path_mount+0x2d7/0xb80 ? srso_alias_return_thunk+0x5/0xfbef5 ? _raw_spin_unlock_irqrestore+0x44/0x60 __x64_sys_mount+0x11a/0x150 do_syscall_64+0x47/0xf0 entry_SYSCALL_64_after_hwframe+0x6f/0x77 RIP: 0033:0x7f8737657b1e Reported-by: Robert Morris Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit eec04ea119691e65227a97ce53c0da6b9b74b0b7 Author: Paulo Alcantara Date: Mon Dec 11 10:26:40 2023 -0300 smb: client: fix OOB in receive_encrypted_standard() Fix potential OOB in receive_encrypted_standard() if server returned a large shdr->NextCommand that would end up writing off the end of @next_buffer. Fixes: b24df3e30cbf ("cifs: update receive_encrypted_standard to handle compounded responses") Cc: stable@vger.kernel.org Reported-by: Robert Morris Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 7ff2b7a1821b61c324626ad57c3664398fb0083d Author: Johan Hovold Date: Tue Nov 28 09:15:12 2023 +0100 PCI/ASPM: Add pci_disable_link_state_locked() lockdep assert Add a lockdep assert to pci_disable_link_state_locked() which should only be called with a pci_bus_sem read lock held. Link: https://lore.kernel.org/r/20231128081512.19387-7-johan+linaro@kernel.org Signed-off-by: Johan Hovold [bhelgaas: include function name in subject, commit log] Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit e673d383bdba94c9924388086b91988254d39f19 Author: Johan Hovold Date: Tue Nov 28 09:15:11 2023 +0100 PCI/ASPM: Clean up __pci_disable_link_state() 'sem' parameter Replace the current 'sem' parameter to the __pci_disable_link_state() helper with a more descriptive 'locked' parameter, which indicates whether a pci_bus_sem read lock is already held. Link: https://lore.kernel.org/r/20231128081512.19387-6-johan+linaro@kernel.org Signed-off-by: Johan Hovold [bhelgaas: include function name in subject, commit log] Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 780f52e3213e5f05bb41adebe1f2214f2f86f4a3 Author: Johan Hovold Date: Tue Nov 28 09:15:10 2023 +0100 PCI: qcom: Clean up ASPM comment Break up the newly added ASPM comment so that it fits within the soft 80 character limit and becomes more readable. Link: https://lore.kernel.org/r/20231128081512.19387-5-johan+linaro@kernel.org Signed-off-by: Johan Hovold Signed-off-by: Bjorn Helgaas commit f352ce99926048e12aa4281c32471031351aec98 Author: Johan Hovold Date: Tue Nov 28 09:15:09 2023 +0100 PCI: qcom: Fix potential deadlock when enabling ASPM The qcom_pcie_enable_aspm() helper is called from pci_walk_bus() during host init to enable ASPM. Since pci_walk_bus() already holds a pci_bus_sem read lock, use pci_enable_link_state_locked() to enable link states in order to avoid a potential deadlock (e.g. in case someone takes a write lock before reacquiring the read lock). This issue was reported by lockdep: ============================================ WARNING: possible recursive locking detected 6.7.0-rc1 #4 Not tainted -------------------------------------------- kworker/u16:6/147 is trying to acquire lock: ffffbf3ff9d2cfa0 (pci_bus_sem){++++}-{3:3}, at: pci_enable_link_state+0x74/0x1e8 but task is already holding lock: ffffbf3ff9d2cfa0 (pci_bus_sem){++++}-{3:3}, at: pci_walk_bus+0x34/0xbc other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(pci_bus_sem); lock(pci_bus_sem); *** DEADLOCK *** Fixes: 9f4f3dfad8cf ("PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops") Link: https://lore.kernel.org/r/20231128081512.19387-4-johan+linaro@kernel.org Signed-off-by: Johan Hovold [bhelgaas: add "potential" in subject since the deadlock has only been reported by lockdep, include helper name in commit log] Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 49de0dc87965079a8e2803ee4b39f9d946259423 Author: Johan Hovold Date: Tue Nov 28 09:15:08 2023 +0100 PCI: vmd: Fix potential deadlock when enabling ASPM The vmd_pm_enable_quirk() helper is called from pci_walk_bus() during probe to enable ASPM for controllers with VMD_FEAT_BIOS_PM_QUIRK set. Since pci_walk_bus() already holds a pci_bus_sem read lock, use pci_enable_link_state_locked() to enable link states in order to avoid a potential deadlock (e.g. in case someone takes a write lock before reacquiring the read lock). Fixes: f492edb40b54 ("PCI: vmd: Add quirk to configure PCIe ASPM and LTR") Link: https://lore.kernel.org/r/20231128081512.19387-3-johan+linaro@kernel.org Signed-off-by: Johan Hovold [bhelgaas: add "potential" in subject since the deadlock has only been reported by lockdep, include helper name in commit log] Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam Cc: # 6.3 Cc: Michael Bottini Cc: David E. Box commit 718ab8226636a1a3a7d281f5d6a7ad7c925efe5a Author: Johan Hovold Date: Tue Nov 28 09:15:07 2023 +0100 PCI/ASPM: Add pci_enable_link_state_locked() Add pci_enable_link_state_locked() for enabling link states that can be used in contexts where a pci_bus_sem read lock is already held (e.g. from pci_walk_bus()). This helper will be used to fix a couple of potential deadlocks where the current helper is called with the lock already held, hence the CC stable tag. Fixes: f492edb40b54 ("PCI: vmd: Add quirk to configure PCIe ASPM and LTR") Link: https://lore.kernel.org/r/20231128081512.19387-2-johan+linaro@kernel.org Signed-off-by: Johan Hovold [bhelgaas: include helper name in subject, commit log] Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam Cc: # 6.3 Cc: Michael Bottini Cc: David E. Box commit b96ab339ee50470d13a1faa6ad94d2218a7cd49f Author: Mario Limonciello Date: Wed Dec 6 12:08:26 2023 -0600 drm/amd/display: Restore guard against default backlight value < 1 nit Mark reports that brightness is not restored after Xorg dpms screen blank. This behavior was introduced by commit d9e865826c20 ("drm/amd/display: Simplify brightness initialization") which dropped the cached backlight value in display code, but also removed code for when the default value read back was less than 1 nit. Restore this code so that the backlight brightness is restored to the correct default value in this circumstance. Reported-by: Mark Herbert Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3031 Cc: stable@vger.kernel.org Cc: Camille Cho Cc: Krunoslav Kovac Cc: Hamza Mahfooz Fixes: d9e865826c20 ("drm/amd/display: Simplify brightness initialization") Acked-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit f528ee145bd0076cd0ed7e7b2d435893e6329e98 Author: Hamza Mahfooz Date: Tue Dec 5 14:55:04 2023 -0500 drm/amd/display: fix hw rotated modes when PSR-SU is enabled We currently don't support dirty rectangles on hardware rotated modes. So, if a user is using hardware rotated modes with PSR-SU enabled, use PSR-SU FFU for all rotated planes (including cursor planes). Cc: stable@vger.kernel.org Fixes: 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support") Reported-by: Kai-Heng Feng Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2952 Tested-by: Kai-Heng Feng Tested-by: Bin Li Reviewed-by: Mario Limonciello Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit dbfbf4740e40fbd39ceeb5c42ab301ac2edd7a9f Author: Dmitrii Galantsev Date: Wed Dec 6 02:04:52 2023 -0600 drm/amd/pm: fix pp_*clk_od typo Fix pp_dpm_sclk_od and pp_dpm_mclk_od typos. Those were defined as pp_*clk_od but used as pp_dpm_*clk_od instead. This change removes the _dpm part. Fixes: 8cfd6a05750c ("drm/amd/pm: Hide irrelevant pm device attributes") Signed-off-by: Dmitrii Galantsev Reviewed-by: Lijo Lazar Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 9fd2fbaabdb9dba947d1c14e5f4f217bc21afc34 Author: Alex Deucher Date: Mon Dec 11 11:28:30 2023 -0500 drm/amdgpu: fix buffer funcs setting order on suspend harder Part of commit dab96d8b61aa ("drm/amdgpu: fix buffer funcs setting order on suspend") got dropped accidently. Add it back. Fixes: dab96d8b61aa ("drm/amdgpu: fix buffer funcs setting order on suspend") Signed-off-by: Alex Deucher commit dc96528b176fa6e55a3dc01060fe9d97be450ce9 Author: Charles Keepax Date: Mon Dec 11 16:00:18 2023 +0000 ASoC: cs42l43: Don't enable bias sense during type detect Alas on some headsets the bias sense can cause problems with the type detection. It can occasionally be falsely triggered by the type detect itself and as the clamp is applied when this happens, it will cause a headset to be incorrectly identified as headphones. As such it should be disabled whilst running type detect. This does mean a jack removal during type detect will cause a larger click but that is unfortunately unavoidable. Fixes: 1e4ce0d5c023 ("ASoC: cs42l43: Move headset bias sense enable earlier in process") Signed-off-by: Charles Keepax Link: https://msgid.link/r/20231211160019.2034442-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 50d7cdf7a9b1ab6f4f74a69c84e974d5dc0c1bf1 Author: Ard Biesheuvel Date: Mon Dec 11 10:00:57 2023 +0100 efi/x86: Avoid physical KASLR on older Dell systems River reports boot hangs with v6.6 and v6.7, and the bisect points to commit a1b87d54f4e4 ("x86/efistub: Avoid legacy decompressor when doing EFI boot") which moves the memory allocation and kernel decompression from the legacy decompressor (which executes *after* ExitBootServices()) to the EFI stub, using boot services for allocating the memory. The memory allocation succeeds but the subsequent call to decompress_kernel() never returns, resulting in a failed boot and a hanging system. As it turns out, this issue only occurs when physical address randomization (KASLR) is enabled, and given that this is a feature we can live without (virtual KASLR is much more important), let's disable the physical part of KASLR when booting on AMI UEFI firmware claiming to implement revision v2.0 of the specification (which was released in 2006), as this is the version these systems advertise. Fixes: a1b87d54f4e4 ("x86/efistub: Avoid legacy decompressor when doing EFI boot") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218173 Signed-off-by: Ard Biesheuvel commit 4ee632c82d2dbb9e2dcc816890ef182a151cbd99 Author: Frank Li Date: Mon Nov 27 16:43:25 2023 -0500 dmaengine: fsl-edma: fix DMA channel leak in eDMAv4 Allocate channel count consistently increases due to a missing source ID (srcid) cleanup in the fsl_edma_free_chan_resources() function at imx93 eDMAv4. Reset 'srcid' at fsl_edma_free_chan_resources(). Cc: stable@vger.kernel.org Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support") Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20231127214325.2477247-1-Frank.Li@nxp.com Signed-off-by: Vinod Koul commit b6961d187fcd138981b8707dac87b9fcdbfe75d1 Author: Stuart Lee Date: Fri Nov 10 09:29:14 2023 +0800 drm/mediatek: Fix access violation in mtk_drm_crtc_dma_dev_get Add error handling to check NULL input in mtk_drm_crtc_dma_dev_get function. While display path is not configured correctly, none of crtc is established. So the caller of mtk_drm_crtc_dma_dev_get may pass input parameter *crtc as NULL, Which may cause coredump when we try to get the container of NULL pointer. Fixes: cb1d6bcca542 ("drm/mediatek: Add dma dev get function") Signed-off-by: Stuart Lee Cc: stable@vger.kernel.org Reviewed-by: AngeloGioacchino DEl Regno Tested-by: Macpaul Lin Link: https://patchwork.kernel.org/project/dri-devel/patch/20231110012914.14884-2-stuart.lee@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 02a914ed475dd928c7b2b6c9d1da9b0b27fa724d Author: Richard Fitzgerald Date: Tue Dec 5 11:57:15 2023 +0000 ASoC: Intel: soc-acpi-intel-mtl-match: Change CS35L56 prefixes to AMPn Change the ALSA prefix for the CS35L56 to "AMPn". This keeps them consistent with the CS35L56 HDA driver. It also avoids coding the chip ID into the control name, so that other Cirrus amps with the same controls can have the same control names. Signed-off-by: Richard Fitzgerald Fixes: 05fe62842804 ("ASoC: Intel: soc-acpi-intel-mtl-match: add acpi match table for cdb35l56-eight-c") Link: https://msgid.link/r/20231205115715.2460386-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 759f14e20891de72e676d9d738eb2c573aa15f52 Author: Jani Nikula Date: Thu Dec 7 11:38:21 2023 +0200 drm/edid: also call add modes in EDID connector update fallback When the separate add modes call was added back in commit c533b5167c7e ("drm/edid: add separate drm_edid_connector_add_modes()"), it failed to address drm_edid_override_connector_update(). Also call add modes there. Reported-by: bbaa Closes: https://lore.kernel.org/r/930E9B4C7D91FDFF+29b34d89-8658-4910-966a-c772f320ea03@bbaa.fun Fixes: c533b5167c7e ("drm/edid: add separate drm_edid_connector_add_modes()") Cc: # v6.3+ Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231207093821.2654267-1-jani.nikula@intel.com commit bffa7218dcddb80e7f18dfa545dd4b359b11dd93 Author: Yang Yingliang Date: Wed Nov 29 17:00:00 2023 +0800 dmaengine: fsl-edma: fix wrong pointer check in fsl_edma3_attach_pd() device_link_add() returns NULL pointer not PTR_ERR() when it fails, so replace the IS_ERR() check with NULL pointer check. Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20231129090000.841440-1-yangyingliang@huaweicloud.com Signed-off-by: Vinod Koul commit e6861d8264cd43c5eb20196e53df36fd71ec5698 Author: Jani Nikula Date: Tue Dec 5 20:05:51 2023 +0200 drm/i915/edp: don't write to DP_LINK_BW_SET when using rate select The eDP 1.5 spec adds a clarification for eDP 1.4x: > For eDP v1.4x, if the Source device chooses the Main-Link rate by way > of DPCD 00100h, the Sink device shall ignore DPCD 00115h[2:0]. We write 0 to DP_LINK_BW_SET (DPCD 100h) even when using DP_LINK_RATE_SET (DPCD 114h). Stop doing that, as it can cause the panel to ignore the rate set method. Moreover, 0 is a reserved value for DP_LINK_BW_SET, and should not be used. v2: Improve the comments (Ville) Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9081 Tested-by: Animesh Manna Reviewed-by: Uma Shankar Cc: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20231205180551.2476228-1-jani.nikula@intel.com (cherry picked from commit 23b392b94acb0499f69706c5808c099f590ebcf4) Cc: stable@vger.kernel.org Signed-off-by: Jani Nikula commit 324b70e997aab0a7deab8cb90711faccda4e98c8 Author: Ville Syrjälä Date: Mon Dec 4 22:24:43 2023 +0200 drm/i915: Fix ADL+ tiled plane stride when the POT stride is smaller than the original plane_view_scanout_stride() currently assumes that we had to pad the mapping stride with dummy pages in order to align it. But that is not the case if the original fb stride exceeds the aligned stride used to populate the remapped view, which is calculated from the user specified framebuffer width rather than the user specified framebuffer stride. Ignore the original fb stride in this case and just stick to the POT aligned stride. Getting this wrong will cause the plane to fetch the wrong data, and can lead to fault errors if the page tables at the bogus location aren't even populated. TODO: figure out if this is OK for CCS, or if we should instead increase the width of the view to cover the entire user specified fb stride instead... Cc: Imre Deak Cc: Juha-Pekka Heikkila Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231204202443.31247-1-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila (cherry picked from commit 01a39f1c4f1220a4e6a25729fae87ff5794cbc52) Cc: stable@vger.kernel.org Signed-off-by: Jani Nikula commit c3070f080f9ba18dea92eaa21730f7ab85b5c8f4 Author: Ville Syrjälä Date: Thu Dec 7 21:34:34 2023 +0200 drm/i915: Fix intel_atomic_setup_scalers() plane_state handling Since the plane_state variable is declared outside the scaler_users loop in intel_atomic_setup_scalers(), and it's never reset back to NULL inside the loop we may end up calling intel_atomic_setup_scaler() with a non-NULL plane state for the pipe scaling case. That is bad because intel_atomic_setup_scaler() determines whether we are doing plane scaling or pipe scaling based on plane_state!=NULL. The end result is that we may miscalculate the scaler mode for pipe scaling. The hardware becomes somewhat upset if we end up in this situation when scanning out a planar format on a SDR plane. We end up programming the pipe scaler into planar mode as well, and the result is a screenfull of garbage. Fix the situation by making sure we pass the correct plane_state==NULL when calculating the scaler mode for pipe scaling. Cc: stable@vger.kernel.org Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231207193441.20206-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit e81144106e21271c619f0c722a09e27ccb8c043d) Signed-off-by: Jani Nikula commit 0ccd963fe555451b1f84e6d14d2b3ef03dd5c947 Author: Ville Syrjälä Date: Tue Dec 5 20:03:08 2023 +0200 drm/i915: Fix remapped stride with CCS on ADL+ On ADL+ the hardware automagically calculates the CCS AUX surface stride from the main surface stride, so when remapping we can't really play a lot of tricks with the main surface stride, or else the AUX surface stride would get miscalculated and no longer match the actual data layout in memory. Supposedly we could remap in 256 main surface tile units (AUX page(4096)/cachline(64)*4(4x1 main surface tiles per AUX cacheline)=256 main surface tiles), but the extra complexity is probably not worth the hassle. So let's just make sure our mapping stride is calculated from the full framebuffer stride (instead of the framebuffer width). This way the stride we program into PLANE_STRIDE will be the original framebuffer stride, and thus there will be no change to the AUX stride/layout. Cc: stable@vger.kernel.org Cc: Imre Deak Cc: Juha-Pekka Heikkila Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231205180308.7505-1-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak (cherry picked from commit 2c12eb36f849256f5eb00ffaee9bf99396fd3814) Signed-off-by: Jani Nikula commit 1f721a93a528268fa97875cff515d1fcb69f4f44 Author: Tvrtko Ursulin Date: Fri Dec 1 12:21:09 2023 +0000 drm/i915: Use internal class when counting engine resets Commit 503579448db9 ("drm/i915/gsc: Mark internal GSC engine with reserved uabi class") made the GSC0 engine not have a valid uabi class and so broke the engine reset counting, which in turn was made class based in cb823ed9915b ("drm/i915/gt: Use intel_gt as the primary object for handling resets"). Despite the title and commit text of the latter is not mentioning it (and has left the storage array incorrectly sized), tracking by class, despite it adding aliasing in hypthotetical multi-tile systems, is handy for virtual engines which for instance do not have a valid engine->id. Therefore we keep that but just change it to use the internal class which is always valid. We also add a helper to increment the count, which aligns with the existing getter. What was broken without this fix were out of bounds reads every time a reset would happen on the GSC0 engine, or during selftests when storing and cross-checking the counts in igt_live_test_begin and igt_live_test_end. Signed-off-by: Tvrtko Ursulin Fixes: 503579448db9 ("drm/i915/gsc: Mark internal GSC engine with reserved uabi class") [tursulin: fixed Fixes tag] Reported-by: Alan Previn Teres Alexis Cc: Daniele Ceraolo Spurio Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20231201122109.729006-2-tvrtko.ursulin@linux.intel.com (cherry picked from commit cf9cb028ac56696ff879af1154c4b2f0b12701fd) Signed-off-by: Jani Nikula commit 7c7c863bf89c5f76d8c7fda177a81559b61dc15b Author: Tvrtko Ursulin Date: Fri Dec 1 12:21:08 2023 +0000 drm/i915/selftests: Fix engine reset count storage for multi-tile Engine->id namespace is per-tile so struct igt_live_test->reset_engine[] needs to be two-dimensional so engine reset counts from all tiles can be stored with no aliasing. With aliasing, if we had a real multi-tile platform, the reset counts would be incorrect for same engine instance on different tiles. Signed-off-by: Tvrtko Ursulin Fixes: 0c29efa23f5c ("drm/i915/selftests: Consider multi-gt instead of to_gt()") Reported-by: Alan Previn Teres Alexis Cc: Tejas Upadhyay Cc: Andi Shyti Cc: Daniele Ceraolo Spurio Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231201122109.729006-1-tvrtko.ursulin@linux.intel.com (cherry picked from commit 0647ece3819b018cb62a71c3bcb7c2c3243e78ac) Signed-off-by: Jani Nikula commit e307b5a845c5951dabafc48d00b6424ee64716c4 Author: Hariprasad Kelam Date: Fri Dec 8 14:57:54 2023 +0530 octeontx2-af: Fix pause frame configuration The current implementation's default Pause Forward setting is causing unnecessary network traffic. This patch disables Pause Forward to address this issue. Fixes: 1121f6b02e7a ("octeontx2-af: Priority flow control configuration support") Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit 271f2a4a9576b87ed1f8584909d6d270039e52ea Author: Wang Yao Date: Wed Dec 6 08:24:27 2023 +0800 efi/loongarch: Use load address to calculate kernel entry address The efi_relocate_kernel() may load the PIE kernel to anywhere, the loaded address may not be equal to link address or EFI_KIMG_PREFERRED_ADDRESS. Acked-by: Huacai Chen Signed-off-by: Wang Yao Signed-off-by: Ard Biesheuvel commit c3e041425af9068e3ec9d90c536de2a2ba97ba2b Merge: 284f717622417 570ba37898ecd Author: David S. Miller Date: Mon Dec 11 10:06:05 2023 +0000 Merge branch 'octeontx2-fixes' Hariprasad Kelam says: ==================== octeontx2: Fix issues with promisc/allmulti mode When interface is configured in promisc/all multi mode, low network performance observed. This series patches address the same. Patch1: Change the promisc/all multi mcam entry action to unicast if there are no trusted vfs associated with PF. Patch2: Configures RSS flow algorithm in promisc/all multi mcam entries to address flow distribution issues. ==================== Signed-off-by: David S. Miller commit 570ba37898ecd9069beb58bf0b6cf84daba6e0fe Author: Hariprasad Kelam Date: Fri Dec 8 12:26:10 2023 +0530 octeontx2-af: Update RSS algorithm index The RSS flow algorithm is not set up correctly for promiscuous or all multi MCAM entries. This has an impact on flow distribution. This patch fixes the issue by updating flow algorithm index in above mentioned MCAM entries. Fixes: 967db3529eca ("octeontx2-af: add support for multicast/promisc packet replication feature") Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit dbda436824ded8ef6a05bb82cd9baa8d42377a49 Author: Hariprasad Kelam Date: Fri Dec 8 12:26:09 2023 +0530 octeontx2-pf: Fix promisc mcam entry action Current implementation is such that, promisc mcam entry action is set as multicast even when there are no trusted VFs. multicast action causes the hardware to copy packet data, which reduces the performance. This patch fixes this issue by setting the promisc mcam entry action to unicast instead of multicast when there are no trusted VFs. The same change is made for the 'allmulti' mcam entry action. Fixes: ffd2f89ad05c ("octeontx2-pf: Enable promisc/allmulti match MCAM entries.") Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller commit 284f717622417cb267e344a9174f8e5698d1e3c1 Author: Shinas Rasheed Date: Thu Dec 7 21:56:46 2023 -0800 octeon_ep: explicitly test for firmware ready value The firmware ready value is 1, and get firmware ready status function should explicitly test for that value. The firmware ready value read will be 2 after driver load, and on unbind till firmware rewrites the firmware ready back to 0, the value seen by driver will be 2, which should be regarded as not ready. Fixes: 10c073e40469 ("octeon_ep: defer probe if firmware not ready") Signed-off-by: Shinas Rasheed Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 125f1c7f26ffcdbf96177abe75b70c1a6ceb17bc Author: Vlad Buslov Date: Tue Dec 5 18:25:54 2023 +0100 net/sched: act_ct: Take per-cb reference to tcf_ct_flow_table The referenced change added custom cleanup code to act_ct to delete any callbacks registered on the parent block when deleting the tcf_ct_flow_table instance. However, the underlying issue is that the drivers don't obtain the reference to the tcf_ct_flow_table instance when registering callbacks which means that not only driver callbacks may still be on the table when deleting it but also that the driver can still have pointers to its internal nf_flowtable and can use it concurrently which results either warning in netfilter[0] or use-after-free. Fix the issue by taking a reference to the underlying struct tcf_ct_flow_table instance when registering the callback and release the reference when unregistering. Expose new API required for such reference counting by adding two new callbacks to nf_flowtable_type and implementing them for act_ct flowtable_ct type. This fixes the issue by extending the lifetime of nf_flowtable until all users have unregistered. [0]: [106170.938634] ------------[ cut here ]------------ [106170.939111] WARNING: CPU: 21 PID: 3688 at include/net/netfilter/nf_flow_table.h:262 mlx5_tc_ct_del_ft_cb+0x267/0x2b0 [mlx5_core] [106170.940108] Modules linked in: act_ct nf_flow_table act_mirred act_skbedit act_tunnel_key vxlan cls_matchall nfnetlink_cttimeout act_gact cls_flower sch_ingress mlx5_vdpa vringh vhost_iotlb vdpa bonding openvswitch nsh rpcrdma rdma_ucm ib_iser libiscsi scsi_transport_iscsi ib_umad rdma_cm ib_ipoib iw_cm ib_cm mlx5_ib ib_uverbs ib_core xt_MASQUERADE nf_conntrack_netlink nfnetlink iptable_nat xt_addrtype xt_conntrack nf_nat br_netfilter rpcsec_gss_krb5 auth_rpcgss oid_regis try overlay mlx5_core [106170.943496] CPU: 21 PID: 3688 Comm: kworker/u48:0 Not tainted 6.6.0-rc7_for_upstream_min_debug_2023_11_01_13_02 #1 [106170.944361] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [106170.945292] Workqueue: mlx5e mlx5e_rep_neigh_update [mlx5_core] [106170.945846] RIP: 0010:mlx5_tc_ct_del_ft_cb+0x267/0x2b0 [mlx5_core] [106170.946413] Code: 89 ef 48 83 05 71 a4 14 00 01 e8 f4 06 04 e1 48 83 05 6c a4 14 00 01 48 83 c4 28 5b 5d 41 5c 41 5d c3 48 83 05 d1 8b 14 00 01 <0f> 0b 48 83 05 d7 8b 14 00 01 e9 96 fe ff ff 48 83 05 a2 90 14 00 [106170.947924] RSP: 0018:ffff88813ff0fcb8 EFLAGS: 00010202 [106170.948397] RAX: 0000000000000000 RBX: ffff88811eabac40 RCX: ffff88811eabad48 [106170.949040] RDX: ffff88811eab8000 RSI: ffffffffa02cd560 RDI: 0000000000000000 [106170.949679] RBP: ffff88811eab8000 R08: 0000000000000001 R09: ffffffffa0229700 [106170.950317] R10: ffff888103538fc0 R11: 0000000000000001 R12: ffff88811eabad58 [106170.950969] R13: ffff888110c01c00 R14: ffff888106b40000 R15: 0000000000000000 [106170.951616] FS: 0000000000000000(0000) GS:ffff88885fd40000(0000) knlGS:0000000000000000 [106170.952329] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [106170.952834] CR2: 00007f1cefd28cb0 CR3: 000000012181b006 CR4: 0000000000370ea0 [106170.953482] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [106170.954121] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [106170.954766] Call Trace: [106170.955057] [106170.955315] ? __warn+0x79/0x120 [106170.955648] ? mlx5_tc_ct_del_ft_cb+0x267/0x2b0 [mlx5_core] [106170.956172] ? report_bug+0x17c/0x190 [106170.956537] ? handle_bug+0x3c/0x60 [106170.956891] ? exc_invalid_op+0x14/0x70 [106170.957264] ? asm_exc_invalid_op+0x16/0x20 [106170.957666] ? mlx5_del_flow_rules+0x10/0x310 [mlx5_core] [106170.958172] ? mlx5_tc_ct_block_flow_offload_add+0x1240/0x1240 [mlx5_core] [106170.958788] ? mlx5_tc_ct_del_ft_cb+0x267/0x2b0 [mlx5_core] [106170.959339] ? mlx5_tc_ct_del_ft_cb+0xc6/0x2b0 [mlx5_core] [106170.959854] ? mapping_remove+0x154/0x1d0 [mlx5_core] [106170.960342] ? mlx5e_tc_action_miss_mapping_put+0x4f/0x80 [mlx5_core] [106170.960927] mlx5_tc_ct_delete_flow+0x76/0xc0 [mlx5_core] [106170.961441] mlx5_free_flow_attr_actions+0x13b/0x220 [mlx5_core] [106170.962001] mlx5e_tc_del_fdb_flow+0x22c/0x3b0 [mlx5_core] [106170.962524] mlx5e_tc_del_flow+0x95/0x3c0 [mlx5_core] [106170.963034] mlx5e_flow_put+0x73/0xe0 [mlx5_core] [106170.963506] mlx5e_put_flow_list+0x38/0x70 [mlx5_core] [106170.964002] mlx5e_rep_update_flows+0xec/0x290 [mlx5_core] [106170.964525] mlx5e_rep_neigh_update+0x1da/0x310 [mlx5_core] [106170.965056] process_one_work+0x13a/0x2c0 [106170.965443] worker_thread+0x2e5/0x3f0 [106170.965808] ? rescuer_thread+0x410/0x410 [106170.966192] kthread+0xc6/0xf0 [106170.966515] ? kthread_complete_and_exit+0x20/0x20 [106170.966970] ret_from_fork+0x2d/0x50 [106170.967332] ? kthread_complete_and_exit+0x20/0x20 [106170.967774] ret_from_fork_asm+0x11/0x20 [106170.970466] [106170.970726] ---[ end trace 0000000000000000 ]--- Fixes: 77ac5e40c44e ("net/sched: act_ct: remove and free nf_table callbacks") Signed-off-by: Vlad Buslov Reviewed-by: Paul Blakey Acked-by: Pablo Neira Ayuso Signed-off-by: David S. Miller commit 35c49cfc8b702eda7a0d3f05497b16f81b69e289 Author: Andrzej Kacprowski Date: Mon Dec 4 13:23:31 2023 +0100 accel/ivpu/37xx: Fix interrupt_clear_with_0 WA initialization Using PCI Device ID/Revision to initialize the interrupt_clear_with_0 workaround is problematic - there are many pre-production steppings with different behavior, even with the same PCI ID/Revision Instead of checking for PCI Device ID/Revision, check the VPU buttress interrupt status register behavior - if this register is not zero after writing 1s it means there register is RW instead of RW1C and we need to enable the interrupt_clear_with_0 workaround. Fixes: 7f34e01f77f8 ("accel/ivpu: Clear specific interrupt status bits on C0") Signed-off-by: Andrzej Kacprowski Signed-off-by: Jacek Lawrynowicz Reviewed-by: Jeffrey Hugo Link: https://lore.kernel.org/all/20231204122331.40560-1-jacek.lawrynowicz@linux.intel.com commit 33071422714a4c9587753b0ccc130ca59323bf42 Author: Gergo Koteles Date: Mon Dec 11 00:37:33 2023 +0100 ALSA: hda/tas2781: handle missing EFI calibration data The code does not properly check whether the calibration variable is available in the EFI. If it is not available, it causes a NULL pointer dereference. Check the return value of the first get_variable call also. BUG: kernel NULL pointer dereference, address: 0000000000000000 Call Trace: ? __die+0x23/0x70 ? page_fault_oops+0x171/0x4e0 ? srso_alias_return_thunk+0x5/0x7f ? schedule+0x5e/0xd0 ? exc_page_fault+0x7f/0x180 ? asm_exc_page_fault+0x26/0x30 ? crc32_body+0x2c/0x120 ? tas2781_save_calibration+0xe4/0x220 [snd_hda_scodec_tas2781_i2c] tasdev_fw_ready+0x1af/0x280 [snd_hda_scodec_tas2781_i2c] request_firmware_work_func+0x59/0xa0 Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") CC: stable@vger.kernel.org Signed-off-by: Gergo Koteles Link: https://lore.kernel.org/r/f1f6583bda918f78556f67d522ca7b3b91cebbd5.1702251102.git.soyer@irl.hu Signed-off-by: Takashi Iwai commit 0c154698a0fc32957d00c6009d5389e086dc8acf Author: Guanjun Date: Mon Dec 11 13:37:04 2023 +0800 dmaengine: idxd: Fix incorrect descriptions for GRPCFG register Fix incorrect descriptions for the GRPCFG register which has three sub-registers (GRPWQCFG, GRPENGCFG and GRPFLGCFG). No functional changes Signed-off-by: Guanjun Reviewed-by: Dave Jiang Reviewed-by: Fenghua Yu Acked-by: Lijun Pan Link: https://lore.kernel.org/r/20231211053704.2725417-3-guanjun@linux.alibaba.com Signed-off-by: Vinod Koul commit 778dfacc903d4b1ef5b7a9726e3a36bc15913d29 Author: Guanjun Date: Mon Dec 11 13:37:03 2023 +0800 dmaengine: idxd: Protect int_handle field in hw descriptor The int_handle field in hw descriptor should also be protected by wmb() before possibly triggering a DMA read. Fixes: eb0cf33a91b4 (dmaengine: idxd: move interrupt handle assignment) Signed-off-by: Guanjun Reviewed-by: Dave Jiang Reviewed-by: Fenghua Yu Reviewed-by: Lijun Pan Link: https://lore.kernel.org/r/20231211053704.2725417-2-guanjun@linux.alibaba.com Signed-off-by: Vinod Koul commit a39b6ac3781d46ba18193c9dbb2110f31e9bffe9 Author: Linus Torvalds Date: Sun Dec 10 14:33:40 2023 -0800 Linux 6.7-rc5 commit a66ff26b0f31189e413a87065c25949c359e4bef Author: Kent Overstreet Date: Sun Dec 10 15:23:27 2023 -0500 bcachefs: Close journal entry if necessary when flushing all pins Since outstanding journal buffers hold a journal pin, when flushing all pins we need to close the current journal entry if necessary so its pin can be released. Signed-off-by: Kent Overstreet commit 3a87498869d6d1e7347cd01f337a77984604eb5e Merge: 537ccb5d28d6f 23ab79e8e469e Author: Linus Torvalds Date: Sun Dec 10 11:09:16 2023 -0800 Merge tag 'sched_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Borislav Petkov: - Make sure tasks are thawed exactly and only once to avoid their state getting corrupted * tag 'sched_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: freezer,sched: Do not restore saved_state of a thawed task commit 537ccb5d28d6f398215e7f578e46ee7836f5ac47 Merge: 5412fed784876 382c27f4ed28f Author: Linus Torvalds Date: Sun Dec 10 11:03:15 2023 -0800 Merge tag 'perf_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf event fix from Borislav Petkov: - Make sure perf event size validation is done on every event in the group * tag 'perf_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Fix perf_event_validate_size() commit 5412fed784876892c4d0960f003795b6dbdcfc5a Merge: 0aea22c7ab05f 9b8493dc43044 Author: Linus Torvalds Date: Sun Dec 10 10:53:55 2023 -0800 Merge tag 'x86_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Add a forgotten CPU vendor check in the AMD microcode post-loading callback so that the callback runs only on AMD - Make sure SEV-ES protocol negotiation happens only once and on the BSP * tag 'x86_urgent_for_v6.7_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/CPU/AMD: Check vendor in the AMD microcode callback x86/sev: Fix kernel crash due to late update to read-only ghcb_version commit 28a7cb045ab700de5554193a1642917602787784 Author: Zhipeng Lu Date: Thu Dec 7 17:49:16 2023 +0800 octeontx2-af: fix a use-after-free in rvu_nix_register_reporters The rvu_dl will be freed in rvu_nix_health_reporters_destroy(rvu_dl) after the create_workqueue fails, and after that free, the rvu_dl will be translate back through the following call chain: rvu_nix_health_reporters_destroy |-> rvu_nix_health_reporters_create |-> rvu_health_reporters_create |-> rvu_register_dl (label err_dl_health) Finally. in the err_dl_health label, rvu_dl being freed again in rvu_health_reporters_destroy(rvu) by rvu_nix_health_reporters_destroy. In the second calls of rvu_nix_health_reporters_destroy, however, it uses rvu_dl->rvu_nix_health_reporter, which is already freed at the end of rvu_nix_health_reporters_destroy in the first call. So this patch prevents the first destroy by instantly returning -ENONMEN when create_workqueue fails. In addition, since the failure of create_workqueue is the only entrence of label err, it has been integrated into the error-handling path of create_workqueue. Fixes: 5ed66306eab6 ("octeontx2-af: Add devlink health reporters for NIX") Signed-off-by: Zhipeng Lu Signed-off-by: David S. Miller commit 0aea22c7ab05f9dfebbccf265a399331435b8938 Merge: c527f5606aa54 4cdf351d3630a Author: Linus Torvalds Date: Sun Dec 10 10:46:46 2023 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "Generic: - Set .owner for various KVM file_operations so that files refcount the KVM module until KVM is done executing _all_ code, including the last few instructions of kvm_put_kvm(). And then revert the misguided attempt to rely on "struct kvm" refcounts to pin KVM-the-module. ARM: - Do not redo the mapping of vLPIs, if they have already been mapped s390: - Do not leave bits behind in PTEs - Properly catch page invalidations that affect the prefix of a nested guest x86: - When checking if a _running_ vCPU is "in-kernel", i.e. running at CPL0, get the CPL directly instead of relying on preempted_in_kernel (which is valid if and only if the vCPU was preempted, i.e. NOT running). - Fix a benign "return void" that was recently introduced. Selftests: - Makefile tweak for dependency generation - '-Wformat' fix" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: SVM: Update EFER software model on CR0 trap for SEV-ES KVM: selftests: add -MP to CFLAGS KVM: selftests: Actually print out magic token in NX hugepages skip message KVM: x86: Remove 'return void' expression for 'void function' Revert "KVM: Prevent module exit until all VMs are freed" KVM: Set file_operations.owner appropriately for all such structures KVM: x86: Get CPL directly when checking if loaded vCPU is in kernel mode KVM: arm64: GICv4: Do not perform a map to a mapped vLPI KVM: s390/mm: Properly reset no-dat KVM: s390: vsie: fix wrong VIR 37 when MSO is used commit 9fc95fe95c3e2a63ced8eeca4b256518ab204b63 Author: Radu Bulie Date: Thu Dec 7 16:38:01 2023 +0800 net: fec: correct queue selection The old implementation extracted VLAN TCI info from the payload before the VLAN tag has been pushed in the payload. Another problem was that the VLAN TCI was extracted even if the packet did not have VLAN protocol header. This resulted in invalid VLAN TCI and as a consequence a random queue was computed. This patch fixes the above issues and use the VLAN TCI from the skb if it is present or VLAN TCI from payload if present. If no VLAN header is present queue 0 is selected. Fixes: 52c4a1a85f4b ("net: fec: add ndo_select_queue to fix TX bandwidth fluctuations") Signed-off-by: Radu Bulie Signed-off-by: Wei Fang Signed-off-by: David S. Miller commit 4a147af2081070218a4c66523c584e198994528e Author: Kent Overstreet Date: Sun Dec 10 12:21:42 2023 -0500 bcachefs: Fix uninitialized var in bch2_journal_replay() Signed-off-by: Kent Overstreet commit e9b220aeacf109684cce36a94fc24ed37be92b05 Author: Benjamin Bigler Date: Sat Dec 9 23:23:26 2023 +0100 spi: spi-imx: correctly configure burst length when using dma If DMA is used, burst length should be set to the bus width of the DMA. Otherwise, the SPI hardware will transmit/receive one word per DMA request. Since this issue affects both transmission and reception, it cannot be detected with a loopback test. Replace magic numbers 512 and 0xfff with MX51_ECSPI_CTRL_MAX_BURST. Reported-by Stefan Bigler Signed-off-by: Benjamin Bigler Fixes: 15a6af94a277 ("spi: Increase imx51 ecspi burst length based on transfer length") Link: https://lore.kernel.org/r/8a415902c751cdbb4b20ce76569216ed@mail.infomaniak.com Link: https://lore.kernel.org/r/20231209222338.5564-1-benjamin@bigler.one Signed-off-by: Mark Brown commit 75a25d31b80770485641ad2789a854955f5c1e40 Author: Gergo Koteles Date: Sat Dec 9 22:18:29 2023 +0100 ALSA: hda/tas2781: leave hda_component in usable state Unloading then loading the module causes a NULL ponter dereference. The hda_unbind zeroes the hda_component, later the hda_bind tries to dereference the codec field. The hda_component is only initialized once by tas2781_generic_fixup. Set only previously modified fields to NULL. BUG: kernel NULL pointer dereference, address: 0000000000000322 Call Trace: ? __die+0x23/0x70 ? page_fault_oops+0x171/0x4e0 ? exc_page_fault+0x7f/0x180 ? asm_exc_page_fault+0x26/0x30 ? tas2781_hda_bind+0x59/0x140 [snd_hda_scodec_tas2781_i2c] component_bind_all+0xf3/0x240 try_to_bring_up_aggregate_device+0x1c3/0x270 __component_add+0xbc/0x1a0 tas2781_hda_i2c_probe+0x289/0x3a0 [snd_hda_scodec_tas2781_i2c] i2c_device_probe+0x136/0x2e0 Fixes: 5be27f1e3ec9 ("ALSA: hda/tas2781: Add tas2781 HDA driver") Cc: stable@vger.kernel.org Signed-off-by: Gergo Koteles Link: https://lore.kernel.org/r/8b8ed2bd5f75fbb32e354a3226c2f966fa85b46b.1702156522.git.soyer@irl.hu Signed-off-by: Takashi Iwai commit 9b726bf6ae11add6a7a52883a21f90ff9cbca916 Author: Hartmut Knaack Date: Sat Dec 9 15:47:07 2023 +0100 ALSA: hda/realtek: Apply mute LED quirk for HP15-db The HP laptop 15-db0403ng uses the ALC236 codec and controls the mute LED using COEF 0x07 index 1. Sound card subsystem: Hewlett-Packard Company Device [103c:84ae] Use the existing quirk for this model. Signed-off-by: Hartmut Knaack Cc: Link: https://lore.kernel.org/r/e61815d0-f1c7-b164-e49d-6ca84771476a@gmx.de Signed-off-by: Takashi Iwai commit 924f5ca2975b2993ee81a7ecc3c809943a70f334 Author: Kai Vehmanen Date: Fri Dec 8 15:21:27 2023 +0200 ALSA: hda/hdmi: add force-connect quirks for ASUSTeK Z170 variants On ASUSTeK Z170M PLUS and Z170 PRO GAMING systems, the display codec pins are not registered properly without the force-connect quirk. The codec will report only one pin as having external connectivity, but i915 finds all three connectors on the system, so the two drivers are not in sync. Issue found with DRM igt-gpu-tools test kms_hdmi_inject@inject-audio. Link: https://gitlab.freedesktop.org/drm/intel/-/issues/9801 Cc: Ville Syrjälä Cc: Jani Saarinen Signed-off-by: Kai Vehmanen Cc: Link: https://lore.kernel.org/r/20231208132127.2438067-3-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai commit 3b1ff57e24a7bcd2e2a8426dd2013a80d1fa96eb Author: Kai Vehmanen Date: Fri Dec 8 15:21:26 2023 +0200 ALSA: hda/hdmi: add force-connect quirk for NUC5CPYB Add one more older NUC model that requires quirk to force all pins to be connected. The display codec pins are not registered properly without the force-connect quirk. The codec will report only one pin as having external connectivity, but i915 finds all three connectors on the system, so the two drivers are not in sync. Issue found with DRM igt-gpu-tools test kms_hdmi_inject@inject-audio. Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/3 Cc: Ville Syrjälä Cc: Jani Saarinen Signed-off-by: Kai Vehmanen Cc: Link: https://lore.kernel.org/r/20231208132127.2438067-2-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai commit c527f5606aa545233a4d2c6d5c636ed82b8633ef Merge: 99d4cf7659554 4b3338aaa74d7 Author: Linus Torvalds Date: Sat Dec 9 19:32:35 2023 -0800 Merge tag 'powerpc-6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fix from Michael Ellerman: - Fix stack teardown in ftrace_no_trace, seen as crashes doing CPU hotplug while ftrace is active. Thanks to Naveen N Rao. * tag 'powerpc-6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/ftrace: Fix stack teardown in ftrace_no_trace commit 99d4cf7659554c2c9c5e4c0808782759b7d32bbd Merge: 21b73ffcc62ab 95dd1e34ff5bb Author: Linus Torvalds Date: Sat Dec 9 19:21:44 2023 -0800 Merge tag 'gpio-fixes-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fix from Bartosz Golaszewski: - fix an error path after a failed export in sysfs code * tag 'gpio-fixes-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpiolib: sysfs: Fix error handling on failed export commit 69db702c83874fbaa2a51af761e35a8e5a593b95 Author: Pavel Begunkov Date: Wed Dec 6 13:55:19 2023 +0000 io_uring/af_unix: disable sending io_uring over sockets File reference cycles have caused lots of problems for io_uring in the past, and it still doesn't work exactly right and races with unix_stream_read_generic(). The safest fix would be to completely disallow sending io_uring files via sockets via SCM_RIGHT, so there are no possible cycles invloving registered files and thus rendering SCM accounting on the io_uring side unnecessary. Cc: stable@vger.kernel.org Fixes: 0091bfc81741b ("io_uring/af_unix: defer registered files gc to io_uring release") Reported-and-suggested-by: Jann Horn Signed-off-by: Pavel Begunkov Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit 15319a4e8ee4b098118591c6ccbd17237f841613 Author: Chengfeng Ye Date: Thu Dec 7 12:34:53 2023 +0000 atm: solos-pci: Fix potential deadlock on &tx_queue_lock As &card->tx_queue_lock is acquired under softirq context along the following call chain from solos_bh(), other acquisition of the same lock inside process context should disable at least bh to avoid double lock. pclose() --> spin_lock(&card->tx_queue_lock) --> solos_bh() --> fpga_tx() --> spin_lock(&card->tx_queue_lock) This flaw was found by an experimental static analysis tool I am developing for irq-related deadlock. To prevent the potential deadlock, the patch uses spin_lock_bh() on &card->tx_queue_lock under process context code consistently to prevent the possible deadlock scenario. Fixes: 213e85d38912 ("solos-pci: clean up pclose() function") Signed-off-by: Chengfeng Ye Signed-off-by: David S. Miller commit d5dba32b8f6cb39be708b726044ba30dbc088b30 Author: Chengfeng Ye Date: Thu Dec 7 12:34:37 2023 +0000 atm: solos-pci: Fix potential deadlock on &cli_queue_lock As &card->cli_queue_lock is acquired under softirq context along the following call chain from solos_bh(), other acquisition of the same lock inside process context should disable at least bh to avoid double lock. console_show() --> spin_lock(&card->cli_queue_lock) --> solos_bh() --> spin_lock(&card->cli_queue_lock) This flaw was found by an experimental static analysis tool I am developing for irq-related deadlock. To prevent the potential deadlock, the patch uses spin_lock_bh() on the card->cli_queue_lock under process context code consistently to prevent the possible deadlock scenario. Fixes: 9c54004ea717 ("atm: Driver for Solos PCI ADSL2+ card.") Signed-off-by: Chengfeng Ye Signed-off-by: David S. Miller commit 21b73ffcc62ab772bc06e3e90bd87eff5e9e8ed4 Merge: 0b5260904b7d2 61890dc28f7d9 Author: Linus Torvalds Date: Sat Dec 9 12:54:58 2023 -0800 Merge tag 'usb-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are some small USB fixes for 6.7-rc5 to resolve some reported issues. Included in here are: - usb gadget f_hid, and uevent fix - xhci driver revert to resolve a much-reported issue - typec driver fix All of these have been in linux-next with no reported issues" * tag 'usb-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: gadget: f_hid: fix report descriptor allocation Revert "xhci: Loosen RPM as default policy to cover for AMD xHC 1.1" usb: typec: class: fix typec_altmode_put_partner to put plugs USB: gadget: core: adjust uevent timing on gadget unbind commit 0b5260904b7d2f55e8c4a6ac9f32e7387dc55a75 Merge: ca20f1622b0cb e92fad024929c Author: Linus Torvalds Date: Sat Dec 9 12:49:22 2023 -0800 Merge tag 'tty-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull serial driver fixes from Greg KH: "Here are some small serial driver fixes for 6.7-rc4 to resolve some reported issues. Included in here are: - pl011 dma support fix - sc16is7xx driver fix - ma35d1 console index fix - 8250 driver fixes for small issues All of these have been in linux-next with no reported issues" * tag 'tty-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: 8250_dw: Add ACPI ID for Granite Rapids-D UART serial: ma35d1: Validate console index before assignment ARM: PL011: Fix DMA support serial: sc16is7xx: address RX timeout interrupt errata serial: 8250: 8250_omap: Clear UART_HAS_RHR_IT_DIS bit serial: 8250_omap: Add earlycon support for the AM654 UART controller serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt commit ca20f1622b0cb21853c41d2c264fafa88ebba7c0 Merge: b10a3ccaf6e39 b7c1e53751cb3 Author: Linus Torvalds Date: Sat Dec 9 12:44:10 2023 -0800 Merge tag 'char-misc-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char / misc driver fixes from Greg KH: "Here are some small fixes for 6.7-rc5 for a variety of small driver subsystems. Included in here are: - debugfs revert for reported issue - greybus revert for reported issue - greybus fixup for endian build warning - coresight driver fixes - nvmem driver fixes - devcoredump fix - parport new device id - ndtest build fix All of these have ben in linux-next with no reported issues" * tag 'char-misc-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: nvmem: Do not expect fixed layouts to grab a layout driver parport: Add support for Brainboxes IX/UC/PX parallel cards Revert "greybus: gb-beagleplay: Ensure le for values in transport" greybus: gb-beagleplay: Ensure le for values in transport greybus: BeaglePlay driver needs CRC_CCITT Revert "debugfs: annotate debugfs handlers vs. removal with lockdep" devcoredump: Send uevent once devcd is ready ndtest: fix typo class_regster -> class_register misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write misc: mei: client.c: return negative error code in mei_cl_write mei: pxp: fix mei_pxp_send_message return value coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base coresight: ultrasoc-smb: Config SMB buffer before register sink coresight: ultrasoc-smb: Fix sleep while close preempt in enable_smb Documentation: coresight: fix `make refcheckdocs` warning hwtracing: hisi_ptt: Don't try to attach a task hwtracing: hisi_ptt: Handle the interrupt in hardirq context hwtracing: hisi_ptt: Add dummy callback pmu::read() coresight: Fix crash when Perf and sysfs modes are used concurrently coresight: etm4x: Remove bogous __exit annotation for some functions commit b10a3ccaf6e39f6290ca29d7c24604082eacaea0 Merge: b8503b2157896 e2f7b3d8b4b30 Author: Linus Torvalds Date: Sat Dec 9 12:25:56 2023 -0800 Merge tag 'loongarch-fixes-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen: "Preserve syscall nr across execve(), slightly clean up drdtime(), fix the Clang built zboot kernel, fix a stack unwinder bug and several bpf jit bugs" * tag 'loongarch-fixes-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: LoongArch: BPF: Fix unconditional bswap instructions LoongArch: BPF: Fix sign-extension mov instructions LoongArch: BPF: Don't sign extend function return value LoongArch: BPF: Don't sign extend memory load operand LoongArch: Preserve syscall nr across execve() LoongArch: Set unwind stack type to unknown rather than set error flag LoongArch: Slightly clean up drdtime() LoongArch: Apply dynamic relocations for LLD commit b8503b215789628d3625ef6aa252f323e32be929 Merge: 9d3bc457a24f8 a58a173444a68 Author: Linus Torvalds Date: Sat Dec 9 12:22:20 2023 -0800 Merge tag 'mips-fixes_6.7_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fixes from Thomas Bogendoerfer: - Fixes for broken Loongson firmware - Fix lockdep splat - Fix FPU states when creating kernel threads * tag 'mips-fixes_6.7_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: kernel: Clear FPU states when setting up kernel threads MIPS: Loongson64: Handle more memory types passed from firmware MIPS: Loongson64: Enable DMA noncoherent support MIPS: Loongson64: Reserve vgabios memory on boot mips/smp: Call rcutree_report_cpu_starting() earlier commit 9d3bc457a24f837604e45729285e9ceba757b508 Merge: 2099306c4e1d5 b169374748744 Author: Linus Torvalds Date: Sat Dec 9 12:16:50 2023 -0800 Merge tag 'perf-tools-fixes-for-v6.7-2-2023-12-08' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools Pull perf tools fixes from Namhyung Kim: "A random set of small bug fixes including: - Fix segfault on AmpereOne due to missing default metricgroup name - Fix segfault on `perf list --json` due to NULL pointer" * tag 'perf-tools-fixes-for-v6.7-2-2023-12-08' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: perf list: Fix JSON segfault by setting the used skip_duplicate_pmus callback perf vendor events arm64: AmpereOne: Add missing DefaultMetricgroupName fields perf metrics: Avoid segv if default metricgroup isn't set commit 2099306c4e1d5d772b150aeac68fdd1d0331b09d Merge: f2e8a57ee9036 04909192ada32 Author: Linus Torvalds Date: Sat Dec 9 12:10:56 2023 -0800 Merge tag '6.7-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fixes from Steve French: "Six smb3 client fixes: - Fixes for copy_file_range and clone (cache invalidation and file size), also addresses an xfstest failure - Fix to return proper error if REMAP_FILE_DEDUP set (also fixes xfstest generic/304) - Fix potential null pointer reference with DFS - Multichannel fix addressing (reverting an earlier patch) some of the problems with enabling/disabling channels dynamically Still working on a followon multichannel fix to address another issue found in reconnect testing that will send next week" * tag '6.7-rc4-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: reconnect worker should take reference on server struct unconditionally Revert "cifs: reconnect work should have reference on server struct" cifs: Fix non-availability of dedup breaking generic/304 smb: client: fix potential NULL deref in parse_dfs_referrals() cifs: Fix flushing, invalidation and file size with FICLONE cifs: Fix flushing, invalidation and file size with copy_file_range() commit e2f7b3d8b4b300956a77fa1ab084c931ba1c7421 Author: Tiezhu Yang Date: Sat Dec 9 15:49:16 2023 +0800 LoongArch: BPF: Fix unconditional bswap instructions We can see that "bswap32: Takes an unsigned 32-bit number in either big- or little-endian format and returns the equivalent number with the same bit width but opposite endianness" in BPF Instruction Set Specification, so it should clear the upper 32 bits in "case 32:" for both BPF_ALU and BPF_ALU64. [root@linux fedora]# echo 1 > /proc/sys/net/core/bpf_jit_enable [root@linux fedora]# modprobe test_bpf Before: test_bpf: #313 BSWAP 32: 0x0123456789abcdef -> 0xefcdab89 jited:1 ret 1460850314 != -271733879 (0x5712ce8a != 0xefcdab89)FAIL (1 times) test_bpf: #317 BSWAP 32: 0xfedcba9876543210 -> 0x10325476 jited:1 ret -1460850316 != 271733878 (0xa8ed3174 != 0x10325476)FAIL (1 times) After: test_bpf: #313 BSWAP 32: 0x0123456789abcdef -> 0xefcdab89 jited:1 4 PASS test_bpf: #317 BSWAP 32: 0xfedcba9876543210 -> 0x10325476 jited:1 4 PASS Fixes: 4ebf9216e7df ("LoongArch: BPF: Support unconditional bswap instructions") Acked-by: Hengqi Chen Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 772cbe948fb07389639d4e698a2d3299f8e538b8 Author: Tiezhu Yang Date: Sat Dec 9 15:49:16 2023 +0800 LoongArch: BPF: Fix sign-extension mov instructions We can see that "Short form of movsx, dst_reg = (s8,s16,s32)src_reg" in include/linux/filter.h, additionally, for BPF_ALU64 the value of the destination register is unchanged whereas for BPF_ALU the upper 32 bits of the destination register are zeroed, so it should clear the upper 32 bits for BPF_ALU. [root@linux fedora]# echo 1 > /proc/sys/net/core/bpf_jit_enable [root@linux fedora]# modprobe test_bpf Before: test_bpf: #81 ALU_MOVSX | BPF_B jited:1 ret 2 != 1 (0x2 != 0x1)FAIL (1 times) test_bpf: #82 ALU_MOVSX | BPF_H jited:1 ret 2 != 1 (0x2 != 0x1)FAIL (1 times) After: test_bpf: #81 ALU_MOVSX | BPF_B jited:1 6 PASS test_bpf: #82 ALU_MOVSX | BPF_H jited:1 6 PASS By the way, the bpf selftest case "./test_progs -t verifier_movsx" can also be fixed with this patch. Fixes: f48012f16150 ("LoongArch: BPF: Support sign-extension mov instructions") Acked-by: Hengqi Chen Signed-off-by: Tiezhu Yang Signed-off-by: Huacai Chen commit 5d47ec2e6f4c64e30e392cfe9532df98c9beb106 Author: Hengqi Chen Date: Sat Dec 9 15:49:16 2023 +0800 LoongArch: BPF: Don't sign extend function return value The `cls_redirect` test triggers a kernel panic like: # ./test_progs -t cls_redirect Can't find bpf_testmod.ko kernel module: -2 WARNING! Selftests relying on bpf_testmod.ko will be skipped. [ 30.938489] CPU 3 Unable to handle kernel paging request at virtual address fffffffffd814de0, era == ffff800002009fb8, ra == ffff800002009f9c [ 30.939331] Oops[#1]: [ 30.939513] CPU: 3 PID: 1260 Comm: test_progs Not tainted 6.7.0-rc2-loong-devel-g2f56bb0d2327 #35 a896aca3f4164f09cc346f89f2e09832e07be5f6 [ 30.939732] Hardware name: QEMU QEMU Virtual Machine, BIOS unknown 2/2/2022 [ 30.939901] pc ffff800002009fb8 ra ffff800002009f9c tp 9000000104da4000 sp 9000000104da7ab0 [ 30.940038] a0 fffffffffd814de0 a1 9000000104da7a68 a2 0000000000000000 a3 9000000104da7c10 [ 30.940183] a4 9000000104da7c14 a5 0000000000000002 a6 0000000000000021 a7 00005555904d7f90 [ 30.940321] t0 0000000000000110 t1 0000000000000000 t2 fffffffffd814de0 t3 0004c4b400000000 [ 30.940456] t4 ffffffffffffffff t5 00000000c3f63600 t6 0000000000000000 t7 0000000000000000 [ 30.940590] t8 000000000006d803 u0 0000000000000020 s9 9000000104da7b10 s0 900000010504c200 [ 30.940727] s1 fffffffffd814de0 s2 900000010504c200 s3 9000000104da7c10 s4 9000000104da7ad0 [ 30.940866] s5 0000000000000000 s6 90000000030e65bc s7 9000000104da7b44 s8 90000000044f6fc0 [ 30.941015] ra: ffff800002009f9c bpf_prog_846803e5ae81417f_cls_redirect+0xa0/0x590 [ 30.941535] ERA: ffff800002009fb8 bpf_prog_846803e5ae81417f_cls_redirect+0xbc/0x590 [ 30.941696] CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE) [ 30.942224] PRMD: 00000004 (PPLV0 +PIE -PWE) [ 30.942330] EUEN: 00000003 (+FPE +SXE -ASXE -BTE) [ 30.942453] ECFG: 00071c1c (LIE=2-4,10-12 VS=7) [ 30.942612] ESTAT: 00010000 [PIL] (IS= ECode=1 EsubCode=0) [ 30.942764] BADV: fffffffffd814de0 [ 30.942854] PRID: 0014c010 (Loongson-64bit, Loongson-3A5000) [ 30.942974] Modules linked in: [ 30.943078] Process test_progs (pid: 1260, threadinfo=00000000ce303226, task=000000007d10bb76) [ 30.943306] Stack : 900000010a064000 90000000044f6fc0 9000000104da7b48 0000000000000000 [ 30.943495] 0000000000000000 9000000104da7c14 9000000104da7c10 900000010504c200 [ 30.943626] 0000000000000001 ffff80001b88c000 9000000104da7b70 90000000030e6668 [ 30.943785] 0000000000000000 9000000104da7b58 ffff80001b88c048 9000000003d05000 [ 30.943936] 900000000303ac88 0000000000000000 0000000000000000 9000000104da7b70 [ 30.944091] 0000000000000000 0000000000000001 0000000731eeab00 0000000000000000 [ 30.944245] ffff80001b88c000 0000000000000000 0000000000000000 54b99959429f83b8 [ 30.944402] ffff80001b88c000 90000000044f6fc0 9000000101d70000 ffff80001b88c000 [ 30.944538] 000000000000005a 900000010504c200 900000010a064000 900000010a067000 [ 30.944697] 9000000104da7d88 0000000000000000 9000000003d05000 90000000030e794c [ 30.944852] ... [ 30.944924] Call Trace: [ 30.945120] [] bpf_prog_846803e5ae81417f_cls_redirect+0xbc/0x590 [ 30.945650] [<90000000030e6668>] bpf_test_run+0x1ec/0x2f8 [ 30.945958] [<90000000030e794c>] bpf_prog_test_run_skb+0x31c/0x684 [ 30.946065] [<90000000026d4f68>] __sys_bpf+0x678/0x2724 [ 30.946159] [<90000000026d7288>] sys_bpf+0x20/0x2c [ 30.946253] [<90000000032dd224>] do_syscall+0x7c/0x94 [ 30.946343] [<9000000002541c5c>] handle_syscall+0xbc/0x158 [ 30.946492] [ 30.946549] Code: 0015030e 5c0009c0 5001d000 <28c00304> 02c00484 29c00304 00150009 2a42d2e4 0280200d [ 30.946793] [ 30.946971] ---[ end trace 0000000000000000 ]--- [ 32.093225] Kernel panic - not syncing: Fatal exception in interrupt [ 32.093526] Kernel relocated by 0x2320000 [ 32.093630] .text @ 0x9000000002520000 [ 32.093725] .data @ 0x9000000003400000 [ 32.093792] .bss @ 0x9000000004413200 [ 34.971998] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]--- This is because we signed-extend function return values. When subprog mode is enabled, we have: cls_redirect() -> get_global_metrics() returns pcpu ptr 0xfffffefffc00b480 The pointer returned is later signed-extended to 0xfffffffffc00b480 at `BPF_JMP | BPF_EXIT`. During BPF prog run, this triggers unhandled page fault and a kernel panic. Drop the unnecessary signed-extension on return values like other architectures do. With this change, we have: # ./test_progs -t cls_redirect Can't find bpf_testmod.ko kernel module: -2 WARNING! Selftests relying on bpf_testmod.ko will be skipped. #51/1 cls_redirect/cls_redirect_inlined:OK #51/2 cls_redirect/IPv4 TCP accept unknown (no hops, flags: SYN):OK #51/3 cls_redirect/IPv6 TCP accept unknown (no hops, flags: SYN):OK #51/4 cls_redirect/IPv4 TCP accept unknown (no hops, flags: ACK):OK #51/5 cls_redirect/IPv6 TCP accept unknown (no hops, flags: ACK):OK #51/6 cls_redirect/IPv4 TCP forward unknown (one hop, flags: ACK):OK #51/7 cls_redirect/IPv6 TCP forward unknown (one hop, flags: ACK):OK #51/8 cls_redirect/IPv4 TCP accept known (one hop, flags: ACK):OK #51/9 cls_redirect/IPv6 TCP accept known (one hop, flags: ACK):OK #51/10 cls_redirect/IPv4 UDP accept unknown (no hops, flags: none):OK #51/11 cls_redirect/IPv6 UDP accept unknown (no hops, flags: none):OK #51/12 cls_redirect/IPv4 UDP forward unknown (one hop, flags: none):OK #51/13 cls_redirect/IPv6 UDP forward unknown (one hop, flags: none):OK #51/14 cls_redirect/IPv4 UDP accept known (one hop, flags: none):OK #51/15 cls_redirect/IPv6 UDP accept known (one hop, flags: none):OK #51/16 cls_redirect/cls_redirect_subprogs:OK #51/17 cls_redirect/IPv4 TCP accept unknown (no hops, flags: SYN):OK #51/18 cls_redirect/IPv6 TCP accept unknown (no hops, flags: SYN):OK #51/19 cls_redirect/IPv4 TCP accept unknown (no hops, flags: ACK):OK #51/20 cls_redirect/IPv6 TCP accept unknown (no hops, flags: ACK):OK #51/21 cls_redirect/IPv4 TCP forward unknown (one hop, flags: ACK):OK #51/22 cls_redirect/IPv6 TCP forward unknown (one hop, flags: ACK):OK #51/23 cls_redirect/IPv4 TCP accept known (one hop, flags: ACK):OK #51/24 cls_redirect/IPv6 TCP accept known (one hop, flags: ACK):OK #51/25 cls_redirect/IPv4 UDP accept unknown (no hops, flags: none):OK #51/26 cls_redirect/IPv6 UDP accept unknown (no hops, flags: none):OK #51/27 cls_redirect/IPv4 UDP forward unknown (one hop, flags: none):OK #51/28 cls_redirect/IPv6 UDP forward unknown (one hop, flags: none):OK #51/29 cls_redirect/IPv4 UDP accept known (one hop, flags: none):OK #51/30 cls_redirect/IPv6 UDP accept known (one hop, flags: none):OK #51/31 cls_redirect/cls_redirect_dynptr:OK #51/32 cls_redirect/IPv4 TCP accept unknown (no hops, flags: SYN):OK #51/33 cls_redirect/IPv6 TCP accept unknown (no hops, flags: SYN):OK #51/34 cls_redirect/IPv4 TCP accept unknown (no hops, flags: ACK):OK #51/35 cls_redirect/IPv6 TCP accept unknown (no hops, flags: ACK):OK #51/36 cls_redirect/IPv4 TCP forward unknown (one hop, flags: ACK):OK #51/37 cls_redirect/IPv6 TCP forward unknown (one hop, flags: ACK):OK #51/38 cls_redirect/IPv4 TCP accept known (one hop, flags: ACK):OK #51/39 cls_redirect/IPv6 TCP accept known (one hop, flags: ACK):OK #51/40 cls_redirect/IPv4 UDP accept unknown (no hops, flags: none):OK #51/41 cls_redirect/IPv6 UDP accept unknown (no hops, flags: none):OK #51/42 cls_redirect/IPv4 UDP forward unknown (one hop, flags: none):OK #51/43 cls_redirect/IPv6 UDP forward unknown (one hop, flags: none):OK #51/44 cls_redirect/IPv4 UDP accept known (one hop, flags: none):OK #51/45 cls_redirect/IPv6 UDP accept known (one hop, flags: none):OK #51 cls_redirect:OK Summary: 1/45 PASSED, 0 SKIPPED, 0 FAILED Fixes: 5dc615520c4d ("LoongArch: Add BPF JIT support") Signed-off-by: Hengqi Chen Signed-off-by: Huacai Chen commit fe5757553bf9ebe45ae8ecab5922f6937c8d8dfc Author: Hengqi Chen Date: Sat Dec 9 15:49:16 2023 +0800 LoongArch: BPF: Don't sign extend memory load operand The `cgrp_local_storage` test triggers a kernel panic like: # ./test_progs -t cgrp_local_storage Can't find bpf_testmod.ko kernel module: -2 WARNING! Selftests relying on bpf_testmod.ko will be skipped. [ 550.930632] CPU 1 Unable to handle kernel paging request at virtual address 0000000000000080, era == ffff80000200be34, ra == ffff80000200be00 [ 550.931781] Oops[#1]: [ 550.931966] CPU: 1 PID: 1303 Comm: test_progs Not tainted 6.7.0-rc2-loong-devel-g2f56bb0d2327 #35 a896aca3f4164f09cc346f89f2e09832e07be5f6 [ 550.932215] Hardware name: QEMU QEMU Virtual Machine, BIOS unknown 2/2/2022 [ 550.932403] pc ffff80000200be34 ra ffff80000200be00 tp 9000000108350000 sp 9000000108353dc0 [ 550.932545] a0 0000000000000000 a1 0000000000000517 a2 0000000000000118 a3 00007ffffbb15558 [ 550.932682] a4 00007ffffbb15620 a5 90000001004e7700 a6 0000000000000021 a7 0000000000000118 [ 550.932824] t0 ffff80000200bdc0 t1 0000000000000517 t2 0000000000000517 t3 00007ffff1c06ee0 [ 550.932961] t4 0000555578ae04d0 t5 fffffffffffffff8 t6 0000000000000004 t7 0000000000000020 [ 550.933097] t8 0000000000000040 u0 00000000000007b8 s9 9000000108353e00 s0 90000001004e7700 [ 550.933241] s1 9000000004005000 s2 0000000000000001 s3 0000000000000000 s4 0000555555eb2ec8 [ 550.933379] s5 00007ffffbb15bb8 s6 00007ffff1dafd60 s7 000055555663f610 s8 00007ffff1db0050 [ 550.933520] ra: ffff80000200be00 bpf_prog_98f1b9e767be2a84_on_enter+0x40/0x200 [ 550.933911] ERA: ffff80000200be34 bpf_prog_98f1b9e767be2a84_on_enter+0x74/0x200 [ 550.934105] CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE) [ 550.934596] PRMD: 00000004 (PPLV0 +PIE -PWE) [ 550.934712] EUEN: 00000003 (+FPE +SXE -ASXE -BTE) [ 550.934836] ECFG: 00071c1c (LIE=2-4,10-12 VS=7) [ 550.934976] ESTAT: 00010000 [PIL] (IS= ECode=1 EsubCode=0) [ 550.935097] BADV: 0000000000000080 [ 550.935181] PRID: 0014c010 (Loongson-64bit, Loongson-3A5000) [ 550.935291] Modules linked in: [ 550.935391] Process test_progs (pid: 1303, threadinfo=000000006c3b1c41, task=0000000061f84a55) [ 550.935643] Stack : 00007ffffbb15bb8 0000555555eb2ec8 0000000000000000 0000000000000001 [ 550.935844] 9000000004005000 ffff80001b864000 00007ffffbb15450 90000000029aa034 [ 550.935990] 0000000000000000 9000000108353ec0 0000000000000118 d07d9dfb09721a09 [ 550.936175] 0000000000000001 0000000000000000 9000000108353ec0 0000000000000118 [ 550.936314] 9000000101d46ad0 900000000290abf0 000055555663f610 0000000000000000 [ 550.936479] 0000000000000003 9000000108353ec0 00007ffffbb15450 90000000029d7288 [ 550.936635] 00007ffff1dafd60 000055555663f610 0000000000000000 0000000000000003 [ 550.936779] 9000000108353ec0 90000000035dd1f0 00007ffff1dafd58 9000000002841c5c [ 550.936939] 0000000000000119 0000555555eea5a8 00007ffff1d78780 00007ffffbb153e0 [ 550.937083] ffffffffffffffda 00007ffffbb15518 0000000000000040 00007ffffbb15558 [ 550.937224] ... [ 550.937299] Call Trace: [ 550.937521] [] bpf_prog_98f1b9e767be2a84_on_enter+0x74/0x200 [ 550.937910] [<90000000029aa034>] bpf_trace_run2+0x90/0x154 [ 550.938105] [<900000000290abf0>] syscall_trace_enter.isra.0+0x1cc/0x200 [ 550.938224] [<90000000035dd1f0>] do_syscall+0x48/0x94 [ 550.938319] [<9000000002841c5c>] handle_syscall+0xbc/0x158 [ 550.938477] [ 550.938607] Code: 580009ae 50016000 262402e4 <28c20085> 14092084 03a00084 16000024 03240084 00150006 [ 550.938851] [ 550.939021] ---[ end trace 0000000000000000 ]--- Further investigation shows that this panic is triggered by memory load operations: ptr = bpf_cgrp_storage_get(&map_a, task->cgroups->dfl_cgrp, 0, BPF_LOCAL_STORAGE_GET_F_CREATE); The expression `task->cgroups->dfl_cgrp` involves two memory load. Since the field offset fits in imm12 or imm14, we use ldd or ldptrd instructions. But both instructions have the side effect that it will signed-extended the imm operand. Finally, we got the wrong addresses and panics is inevitable. Use a generic ldxd instruction to avoid this kind of issues. With this change, we have: # ./test_progs -t cgrp_local_storage Can't find bpf_testmod.ko kernel module: -2 WARNING! Selftests relying on bpf_testmod.ko will be skipped. test_cgrp_local_storage:PASS:join_cgroup /cgrp_local_storage 0 nsec #48/1 cgrp_local_storage/tp_btf:OK test_attach_cgroup:PASS:skel_open 0 nsec test_attach_cgroup:PASS:prog_attach 0 nsec test_attach_cgroup:PASS:prog_attach 0 nsec libbpf: prog 'update_cookie_tracing': failed to attach: ERROR: strerror_r(-524)=22 test_attach_cgroup:FAIL:prog_attach unexpected error: -524 #48/2 cgrp_local_storage/attach_cgroup:FAIL test_recursion:PASS:skel_open_and_load 0 nsec libbpf: prog 'on_lookup': failed to attach: ERROR: strerror_r(-524)=22 libbpf: prog 'on_lookup': failed to auto-attach: -524 test_recursion:FAIL:skel_attach unexpected error: -524 (errno 524) #48/3 cgrp_local_storage/recursion:FAIL #48/4 cgrp_local_storage/negative:OK #48/5 cgrp_local_storage/cgroup_iter_sleepable:OK test_yes_rcu_lock:PASS:skel_open 0 nsec test_yes_rcu_lock:PASS:skel_load 0 nsec libbpf: prog 'yes_rcu_lock': failed to attach: ERROR: strerror_r(-524)=22 libbpf: prog 'yes_rcu_lock': failed to auto-attach: -524 test_yes_rcu_lock:FAIL:skel_attach unexpected error: -524 (errno 524) #48/6 cgrp_local_storage/yes_rcu_lock:FAIL #48/7 cgrp_local_storage/no_rcu_lock:OK #48 cgrp_local_storage:FAIL All error logs: test_cgrp_local_storage:PASS:join_cgroup /cgrp_local_storage 0 nsec test_attach_cgroup:PASS:skel_open 0 nsec test_attach_cgroup:PASS:prog_attach 0 nsec test_attach_cgroup:PASS:prog_attach 0 nsec libbpf: prog 'update_cookie_tracing': failed to attach: ERROR: strerror_r(-524)=22 test_attach_cgroup:FAIL:prog_attach unexpected error: -524 #48/2 cgrp_local_storage/attach_cgroup:FAIL test_recursion:PASS:skel_open_and_load 0 nsec libbpf: prog 'on_lookup': failed to attach: ERROR: strerror_r(-524)=22 libbpf: prog 'on_lookup': failed to auto-attach: -524 test_recursion:FAIL:skel_attach unexpected error: -524 (errno 524) #48/3 cgrp_local_storage/recursion:FAIL test_yes_rcu_lock:PASS:skel_open 0 nsec test_yes_rcu_lock:PASS:skel_load 0 nsec libbpf: prog 'yes_rcu_lock': failed to attach: ERROR: strerror_r(-524)=22 libbpf: prog 'yes_rcu_lock': failed to auto-attach: -524 test_yes_rcu_lock:FAIL:skel_attach unexpected error: -524 (errno 524) #48/6 cgrp_local_storage/yes_rcu_lock:FAIL #48 cgrp_local_storage:FAIL Summary: 0/4 PASSED, 0 SKIPPED, 1 FAILED No panics any more (The test still failed because lack of BPF trampoline which I am actively working on). Fixes: 5dc615520c4d ("LoongArch: Add BPF JIT support") Signed-off-by: Hengqi Chen Signed-off-by: Huacai Chen commit d6c5f06e46a836e6a70c7cfd95bb38a67d9252ec Author: Hengqi Chen Date: Sat Dec 9 15:49:15 2023 +0800 LoongArch: Preserve syscall nr across execve() Currently, we store syscall nr in pt_regs::regs[11] and syscall execve() accidentally overrides it during its execution: sys_execve() -> do_execve() -> do_execveat_common() -> bprm_execve() -> exec_binprm() -> search_binary_handler() -> load_elf_binary() -> ELF_PLAT_INIT() ELF_PLAT_INIT() reset regs[11] to 0, so in syscall_exit_to_user_mode() we later get a wrong syscall nr. This breaks tools like execsnoop since it relies on execve() tracepoints. Skip pt_regs::regs[11] reset in ELF_PLAT_INIT() to fix the issue. Signed-off-by: Hengqi Chen Signed-off-by: Huacai Chen commit 97ceddbc9404a7d1e2c4049435bff29427d762cc Author: Jinyang He Date: Sat Dec 9 15:49:15 2023 +0800 LoongArch: Set unwind stack type to unknown rather than set error flag During unwinding, unwind_done() is used as an end condition. Normally it unwind to the user stack and then set the stack type to unknown, which is a normal exit. When something unexpected happens in unwind process and we cannot unwind anymore, we should set the error flag, and also set the stack type to unknown to indicate that the unwind process can not continue. The error flag emphasizes that the unwind process produce an unexpected error. There is no unexpected things when we unwind the PT_REGS in the top of IRQ stack and find out that is an user mode PT_REGS. Thus, we should not set error flag and just set stack type to unknown. Reported-by: Hengqi Chen Acked-by: Hengqi Chen Signed-off-by: Jinyang He Signed-off-by: Huacai Chen commit 8146c5b349074da7732f1d45eb4a5f9fd192c7c1 Author: Xi Ruoyao Date: Sat Dec 9 15:49:15 2023 +0800 LoongArch: Slightly clean up drdtime() As we are just discarding the stable clock ID, simply write it into $zero instead of allocating a temporary register. Signed-off-by: Xi Ruoyao Signed-off-by: Huacai Chen commit eea673e9d5ea994c60b550ffb684413d3759b3f4 Author: WANG Rui Date: Sat Dec 9 15:49:15 2023 +0800 LoongArch: Apply dynamic relocations for LLD For the following assembly code: .text .global func func: nop .data var: .dword func When linked with `-pie`, GNU LD populates the `var` variable with the pre-relocated value of `func`. However, LLVM LLD does not exhibit the same behavior. This issue also arises with the `kernel_entry` in arch/ loongarch/kernel/head.S: _head: .word MZ_MAGIC /* "MZ", MS-DOS header */ .org 0x8 .dword kernel_entry /* Kernel entry point */ The correct kernel entry from the MS-DOS header is crucial for jumping to vmlinux from zboot. This necessity is why the compressed relocatable kernel compiled by Clang encounters difficulties in booting. To address this problem, it is proposed to apply dynamic relocations to place with `--apply-dynamic-relocs`. Link: https://github.com/ClangBuiltLinux/linux/issues/1962 Signed-off-by: WANG Rui Signed-off-by: Huacai Chen commit 1ae4cd3cbdd08287c56c4cc816ebf05eb6681a0f Merge: 9c25aae0132b8 c13e268c07686 Author: Jakub Kicinski Date: Fri Dec 8 17:20:28 2023 -0800 Merge branch 'bnxt_en-misc-fixes' Michael Chan says: ==================== bnxt_en: Misc. fixes 4 miscellaneous driver fixes covering PM resume, SKB recycling, wrong return value check, and PTP HWTSTAMP_FILTER_ALL. ==================== Link: https://lore.kernel.org/r/20231208001658.14230-1-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit c13e268c0768659cdaae4bfe2fb24860bcc8ddb4 Author: Michael Chan Date: Thu Dec 7 16:16:58 2023 -0800 bnxt_en: Fix HWTSTAMP_FILTER_ALL packet timestamp logic When the chip is configured to timestamp all receive packets, the timestamp in the RX completion is only valid if the metadata present flag is not set for packets received on the wire. In addition, internal loopback packets will never have a valid timestamp and the timestamp field will always be zero. We must exclude any 0 value in the timestamp field because there is no way to determine if it is a loopback packet or not. Add a new function bnxt_rx_ts_valid() to check for all timestamp valid conditions. Fixes: 66ed81dcedc6 ("bnxt_en: Enable packet timestamping for all RX packets") Reviewed-by: Andy Gospodarek Reviewed-by: Pavan Chebbi Signed-off-by: Michael Chan Link: https://lore.kernel.org/r/20231208001658.14230-5-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit bd6781c18cb5b5e5d8c5873fa9a51668e89ec76e Author: Kalesh AP Date: Thu Dec 7 16:16:57 2023 -0800 bnxt_en: Fix wrong return value check in bnxt_close_nic() The wait_event_interruptible_timeout() function returns 0 if the timeout elapsed, -ERESTARTSYS if it was interrupted by a signal, and the remaining jiffies otherwise if the condition evaluated to true before the timeout elapsed. Driver should have checked for zero return value instead of a positive value. MChan: Print a warning for -ERESTARTSYS. The close operation will proceed anyway when wait_event_interruptible_timeout() returns for any reason. Since we do the close no matter what, we should not return this error code to the caller. Change bnxt_close_nic() to a void function and remove all error handling from some of the callers. Fixes: c0c050c58d84 ("bnxt_en: New Broadcom ethernet driver.") Reviewed-by: Andy Gospodarek Reviewed-by: Vikas Gupta Reviewed-by: Somnath Kotur Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Link: https://lore.kernel.org/r/20231208001658.14230-4-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit aded5d1feb08e48d544845d3594d70c4d5fe6e54 Author: Sreekanth Reddy Date: Thu Dec 7 16:16:56 2023 -0800 bnxt_en: Fix skb recycling logic in bnxt_deliver_skb() Receive SKBs can go through the VF-rep path or the normal path. skb_mark_for_recycle() is only called for the normal path. Fix it to do it for both paths to fix possible stalled page pool shutdown errors. Fixes: 86b05508f775 ("bnxt_en: Use the unified RX page pool buffers for XDP and non-XDP") Reviewed-by: Somnath Kotur Reviewed-by: Andy Gospodarek Reviewed-by: Vikas Gupta Signed-off-by: Sreekanth Reddy Signed-off-by: Michael Chan Link: https://lore.kernel.org/r/20231208001658.14230-3-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit 9ef7c58f5abe41e6d91f37f28fe2d851ffedd92a Author: Somnath Kotur Date: Thu Dec 7 16:16:55 2023 -0800 bnxt_en: Clear resource reservation during resume We are issuing HWRM_FUNC_RESET cmd to reset the device including all reserved resources, but not clearing the reservations within the driver struct. As a result, when the driver re-initializes as part of resume, it believes that there is no need to do any resource reservation and goes ahead and tries to allocate rings which will eventually fail beyond a certain number pre-reserved by the firmware. Fixes: 674f50a5b026 ("bnxt_en: Implement new method to reserve rings.") Reviewed-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Andy Gospodarek Signed-off-by: Somnath Kotur Signed-off-by: Michael Chan Link: https://lore.kernel.org/r/20231208001658.14230-2-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit 9c25aae0132b8babbe71ebb2160186d69231d9b3 Author: Eric Dumazet Date: Thu Dec 7 18:13:42 2023 +0000 tcp: fix tcp_disordered_ack() vs usec TS resolution After commit 939463016b7a ("tcp: change data receiver flowlabel after one dup") we noticed an increase of TCPACKSkippedPAWS events. Neal Cardwell tracked the issue to tcp_disordered_ack() assumption about remote peer TS clock. RFC 1323 & 7323 are suggesting the following: "timestamp clock frequency in the range 1 ms to 1 sec per tick between 1ms and 1sec." This has to be adjusted for 1 MHz clock frequency. This hints at reorders of SACK packets on send side, this might deserve a future patch. (skb->ooo_okay is always set for pure ACK packets) Fixes: 614e8316aa4c ("tcp: add support for usec resolution in TCP TS values") Co-developed-by: Neal Cardwell Signed-off-by: Neal Cardwell Signed-off-by: Eric Dumazet Cc: David Morley Link: https://lore.kernel.org/r/20231207181342.525181-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 4eb69d00fe967699b9d93f7e74a990fe813e8d2b Author: Vineet Gupta Date: Fri Dec 8 16:25:23 2023 -0800 ARC: fix smatch warning Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202311280906.VAIwEAfT-lkp@intel.com/ Signed-off-by: Vineet Gupta commit aca02d933f63ba8bc84258bf35f9ffaf6b664336 Author: Vineet Gupta Date: Fri Dec 8 15:57:07 2023 -0800 ARC: fix spare error Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202312082320.VDN5A9hb-lkp@intel.com/ Signed-off-by: Vineet Gupta commit 6732c0e494ac35fbadd749bbbd226c0aceb2d2c4 Author: Vineet Gupta Date: Wed Feb 15 21:06:33 2023 -0800 ARC: mm: retire support for aliasing VIPT D$ Legacy ARC700 processors (first generation of MMU enabled ARC cores) had VIPT cached which could be configured such that they could alias. Corresponding support in kernel (with all the obnoxious cache flush overhead) was added in ARC port 10 years ago to support 1 silicon. That is long bygone and we can let it RIP. Cc: Matthew Wilcox (Oracle) Signed-off-by: Vineet Gupta commit 3a02ec2f0b304af6b38e9cc5a009bf517d38e72c Author: Vineet Gupta Date: Wed May 20 11:23:21 2020 -0700 ARC: entry: move ARCompact specific bits out of entry.h - PUSHAUX/POPAUX helpers to ARCompact entry - use gas provided "push"/pop pseudo instructions Signed-off-by: Vineet Gupta commit 9de7fc30f288ccee11c74613b9a0ee4904f6875f Author: Vineet Gupta Date: Thu May 21 13:33:24 2020 -0700 ARC: entry: SAVE_ABI_CALLEE_REG: ISA/ABI specific helper And for ARcompact variant replace the PUSH/POP macros with gas provided push/pop pseudo-instructions This allows ISA specific implementation e.g. Current ARCv2 PUSH/POP could be replaced with STD/LDL to save 2 registers at a time (w/o bothering with SP update each time) or perhaps use ENTER_S/LEAVE_S to reduce code size For ARCv3 ABI changed so callee regs are now r14-r26 (vs. r13-r25) thus would need a different implementation. Signed-off-by: Vineet Gupta commit a45f1e46274256852990c479fbb1198a7d84529b Author: Karsten Graul Date: Thu Dec 7 21:23:58 2023 +0100 MAINTAINERS: remove myself as maintainer of SMC I changed responsibilities some time ago, its time to remove myself as maintainer of the SMC component. Signed-off-by: Karsten Graul Signed-off-by: Wenjia Zhang Link: https://lore.kernel.org/r/20231207202358.53502-1-wenjia@linux.ibm.com Signed-off-by: Jakub Kicinski commit c65efe3685f5d150eeca5599afeabdc85da899d1 Author: Ira Weiny Date: Thu Nov 16 16:03:29 2023 -0800 cxl/cdat: Free correct buffer on checksum error The new 6.7-rc1 kernel now checks the checksum on CDAT data. While using a branch of Fan's DCD qemu work (and specifying DCD devices), the following splat was observed. WARNING: CPU: 1 PID: 1384 at drivers/base/devres.c:1064 devm_kfree+0x4f/0x60 ... RIP: 0010:devm_kfree+0x4f/0x60 ... ? devm_kfree+0x4f/0x60 read_cdat_data+0x1a0/0x2a0 [cxl_core] cxl_port_probe+0xdf/0x200 [cxl_port] ... The issue in qemu is still unknown but the spat is a straight forward bug in the CDAT checksum processing code. Use a CDAT buffer variable to ensure the devm_free() works correctly on error. Fixes: 670e4e88f3b1 ("cxl: Add checksum verification to CDAT from CXL") Signed-off-by: Ira Weiny Reviewed-by: Dave Jiang Reviewed-by: Fan Ni Reviewed-by: Robert Richter Link: http://lore.kernel.org/r/20231116-fix-cdat-devm-free-v1-1-b148b40707d7@intel.com Signed-off-by: Dan Williams commit 271f31d5967b9480824f5bf9b6665aea65ad2ce0 Merge: a1664b991ac12 1057812d146dd Author: Jakub Kicinski Date: Fri Dec 8 16:12:21 2023 -0800 Merge branch 'qca_spi-collection-of-major-fixes' Stefan Wahren says: ==================== qca_spi: collection of major fixes This series contains a collection of major fixes for the qca_spi driver, which has been recently discovered. ==================== Link: https://lore.kernel.org/r/20231206141222.52029-1-wahrenst@gmx.net Signed-off-by: Jakub Kicinski commit 1057812d146dd658c9a9a96d869c2551150207b5 Author: Stefan Wahren Date: Wed Dec 6 15:12:22 2023 +0100 qca_spi: Fix reset behavior In case of a reset triggered by the QCA7000 itself, the behavior of the qca_spi driver was not quite correct: - in case of a pending RX frame decoding the drop counter must be incremented and decoding state machine reseted - also the reset counter must always be incremented regardless of sync state Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000") Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/20231206141222.52029-4-wahrenst@gmx.net Signed-off-by: Jakub Kicinski commit 96a7e861d9e04d07febd3011c30cd84cd141d81f Author: Stefan Wahren Date: Wed Dec 6 15:12:21 2023 +0100 qca_debug: Fix ethtool -G iface tx behavior After calling ethtool -g it was not possible to adjust the TX ring size again: # ethtool -g eth1 Ring parameters for eth1: Pre-set maximums: RX: 4 RX Mini: n/a RX Jumbo: n/a TX: 10 Current hardware settings: RX: 4 RX Mini: n/a RX Jumbo: n/a TX: 10 # ethtool -G eth1 tx 8 netlink error: Invalid argument The reason for this is that the readonly setting rx_pending get initialized and after that the range check in qcaspi_set_ringparam() fails regardless of the provided parameter. So fix this by accepting the exposed RX defaults. Instead of adding another magic number better use a new define here. Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000") Suggested-by: Paolo Abeni Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/20231206141222.52029-3-wahrenst@gmx.net Signed-off-by: Jakub Kicinski commit f4e6064c97c050bd9904925ff7d53d0c9954fc7b Author: Stefan Wahren Date: Wed Dec 6 15:12:20 2023 +0100 qca_debug: Prevent crash on TX ring changes The qca_spi driver stop and restart the SPI kernel thread (via ndo_stop & ndo_open) in case of TX ring changes. This is a big issue because it allows userspace to prevent restart of the SPI kernel thread (via signals). A subsequent change of TX ring wrongly assume a valid spi_thread pointer which result in a crash. So prevent this by stopping the network traffic handling and temporary park the SPI thread. Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000") Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/20231206141222.52029-2-wahrenst@gmx.net Signed-off-by: Jakub Kicinski commit a1664b991ac12b872be859ca03529c68c72795a2 Author: Shinas Rasheed Date: Wed Dec 6 05:52:27 2023 -0800 octeon_ep: initialise control mbox tasks before using APIs Initialise various workqueue tasks and queue interrupt poll task before the first invocation of any control net APIs. Since octep_ctrl_net_get_info was called before the control net receive work task was initialised or even the interrupt poll task was queued, the function call wasn't returning actual firmware info queried from Octeon. Fixes: 8d6198a14e2b ("octeon_ep: support to fetch firmware info") Signed-off-by: Shinas Rasheed Reviewed-by: Michal Schmidt Link: https://lore.kernel.org/r/20231206135228.2591659-1-srasheed@marvell.com Signed-off-by: Jakub Kicinski commit f2e8a57ee9036c7d5443382b6c3c09b51a92ec7e Merge: d71369dbe0c5c 235f2b548d7f4 Author: Linus Torvalds Date: Fri Dec 8 12:40:38 2023 -0800 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fix from James Bottomley: "One tiny fix to the be2iscsi driver fixing a memory leak in an error leg" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: be2iscsi: Fix a memleak in beiscsi_init_wrb_handle() commit d71369dbe0c5c1217dc681d6871b7918b2996de6 Merge: 689659c988193 c6d3ab9e76dc0 Author: Linus Torvalds Date: Fri Dec 8 12:36:45 2023 -0800 Merge tag 'block-6.7-2023-12-08' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: "Nothing major in here, just miscellanous fixes for MD and NVMe: - NVMe pull request via Keith: - Proper nvme ctrl state setting (Keith) - Passthrough command optimization (Keith) - Spectre fix (Nitesh) - Kconfig clarifications (Shin'ichiro) - Frozen state deadlock fix (Bitao) - Power setting quirk (Georg) - MD pull requests via Song: - 6.7 regresisons with recovery/sync (Yu) - Reshape fix (David)" * tag 'block-6.7-2023-12-08' of git://git.kernel.dk/linux: md: split MD_RECOVERY_NEEDED out of mddev_resume nvme-pci: Add sleep quirk for Kingston drives md: fix stopping sync thread md: don't leave 'MD_RECOVERY_FROZEN' in error path of md_set_readonly() md: fix missing flush of sync_work nvme: fix deadlock between reset and scan nvme: prevent potential spectre v1 gadget nvme: improve NVME_HOST_AUTH and NVME_TARGET_AUTH config descriptions nvme-ioctl: move capable() admin check to the end nvme: ensure reset state check ordering nvme: introduce helper function to get ctrl state md/raid6: use valid sector values to determine if an I/O should wait on the reshape commit 689659c988193f1e16bc34bfda3f333b11528c1f Merge: 8aa74869d2e9d 705318a99a138 Author: Linus Torvalds Date: Fri Dec 8 12:32:38 2023 -0800 Merge tag 'io_uring-6.7-2023-12-08' of git://git.kernel.dk/linux Pull io_uring fixes from Jens Axboe: "Two minor fixes for issues introduced in this release cycle, and two fixes for issues or potential issues that are heading to stable. One of these ends up disabling passing io_uring file descriptors via SCM_RIGHTS. There really shouldn't be an overlap between that kind of historic use case and modern usage of io_uring, which is why this was deemed appropriate" * tag 'io_uring-6.7-2023-12-08' of git://git.kernel.dk/linux: io_uring/af_unix: disable sending io_uring over sockets io_uring/kbuf: check for buffer list readiness after NULL check io_uring/kbuf: Fix an NULL vs IS_ERR() bug in io_alloc_pbuf_ring() io_uring: fix mutex_unlock with unreferenced ctx commit 8aa74869d2e9d868b1c4598eecc1a89f637a92cf Merge: 081ed90a8c662 e3e82fcb79eeb Author: Linus Torvalds Date: Fri Dec 8 12:27:11 2023 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Primarily rtrs and irdma fixes: - Fix uninitialized value in ib_get_eth_speed() - Fix hns refusing to work if userspace doesn't select the correct congestion control algorithm - Several irdma fixes - unreliable Send Queue Drain, use after free, 64k page size bugs, device removal races - Several rtrs bug fixes - crashes, memory leaks, use after free, bad credit accounting, bogus WARN_ON - Typos and a MAINTAINER update" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/irdma: Avoid free the non-cqp_request scratch RDMA/irdma: Fix support for 64k pages RDMA/irdma: Ensure iWarp QP queue memory is OS paged aligned RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz RDMA/irdma: Fix UAF in irdma_sc_ccq_get_cqe_info() RDMA/bnxt_re: Correct module description string RDMA/rtrs-clt: Remove the warnings for req in_use check RDMA/rtrs-clt: Fix the max_send_wr setting RDMA/rtrs-srv: Destroy path files after making sure no IOs in-flight RDMA/rtrs-srv: Free srv_mr iu only when always_invalidate is true RDMA/rtrs-srv: Check return values while processing info request RDMA/rtrs-clt: Start hb after path_up RDMA/rtrs-srv: Do not unconditionally enable irq MAINTAINERS: Add Chengchang Tang as Hisilicon RoCE maintainer RDMA/irdma: Add wait for suspend on SQD RDMA/irdma: Do not modify to SQD on error RDMA/hns: Fix unnecessary err return when using invalid congest control algorithm RDMA/core: Fix uninit-value access in ib_get_eth_speed() commit 081ed90a8c662455a79843add14857b356de37a4 Merge: c3e2f9bda2ffa bdefd9913bdd4 Author: Linus Torvalds Date: Fri Dec 8 11:57:55 2023 -0800 Merge tag 'pm-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fix from Rafael Wysocki: "Fix cpufreq reference counting in the DTPM (dynamic thermal and power management) power capping framework (Lukasz Luba)" * tag 'pm-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: powercap: DTPM: Fix missing cpufreq_cpu_put() calls commit c3e2f9bda2ffa2dd7dcaf2b45604db08c6ab0579 Merge: 0dfe14fca933d 8f0b960a42bad Author: Linus Torvalds Date: Fri Dec 8 11:54:07 2023 -0800 Merge tag 'acpi-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fix from Rafael Wysocki: "Fix a possible crash on an attempt to free unallocated memory in the error path of acpi_evaluate_reference() that has been introduced by one of the recent changes (Rafael Wysocki)" * tag 'acpi-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: utils: Fix error path in acpi_evaluate_reference() commit 0dfe14fca933dc729fd7671c7b8fa616d74856b7 Merge: d650b3beff76b 307004e8b254a Author: Linus Torvalds Date: Fri Dec 8 11:46:41 2023 -0800 Merge tag 'hwmon-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - acpi_power_meter: Fix 4.29 MW output seen if acpi reports bad data - corsair-psu: Fix ability to probe if the driver is built into the kernel - ltc2991: Fix spelling mistake "contiuous" -> "continuous" - max31827: Add missing regulator header file include - nzxt-kraken2: Fix error handling path in probe function * tag 'hwmon-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (corsair-psu) Fix probe when built-in hwmon: (nzxt-kraken2) Fix error handling path in kraken2_probe() hwmon: (acpi_power_meter) Fix 4.29 MW bug hwmon: max31827: include regulator header hwmon: ltc2991: Fix spelling mistake "contiuous" -> "continuous" commit d650b3beff76bd0d1eaba6c706f9fbac52137339 Merge: b8b68d2fd41c1 4e7a8dbd2bc0a Author: Linus Torvalds Date: Fri Dec 8 11:41:56 2023 -0800 Merge tag 'pwm/for-6.7-rc5-fixes' of https://git.pengutronix.de/git/ukl/linux Pull pwm fix from Uwe Kleine-König: "This fixes a null pointer exception in the bcm2835 pwm driver. The problem was introduced by a combination of two commits merged for v6.7-rc1 where each change alone would have been fine. Thanks to Florian Fainelli for noticing and fixing the issue" * tag 'pwm/for-6.7-rc5-fixes' of https://git.pengutronix.de/git/ukl/linux: pwm: bcm2835: Fix NPD in suspend/resume commit b8b68d2fd41c1068554290fdf2c5adc6b03d40ce Merge: 38bafa65b1260 634e5e1e06f5c Author: Linus Torvalds Date: Fri Dec 8 11:29:45 2023 -0800 Merge tag 'sound-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "This is a typical bump in the middle of its way; we've gathered lots of fixes (mostly for ASoC) at this time: - PCM array out-of-bound access fix - Correction of SOC PCM merge error - Lots of ASoC SOF Intel updates - A few ASoC AMD quirks - More proper timer handling in PCM test module - HD-audio and USB-audio quirks as usual - Other device-specific fixes for various ASoC codecs" * tag 'sound-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (39 commits) ALSA: hda/realtek: Add quirk for Lenovo Yoga Pro 7 ALSA: pcmtest: stop timer before buffer is released ALSA: hda/realtek: Add Framework laptop 16 to quirks ALSA: hda/realtek: add new Framework laptop to quirks ALSA: pcm: fix out-of-bounds in snd_pcm_state_names ASoC: qcom: sc8280xp: Limit speaker digital volumes ASoC: ops: add correct range check for limiting volume ALSA: hda/realtek: Enable headset on Lenovo M90 Gen5 ALSA: hda/realtek: fix speakers on XPS 9530 (2023) ALSA: usb-audio: Add Pioneer DJM-450 mixer controls ASoC: wm_adsp: fix memleak in wm_adsp_buffer_populate ASoC: da7219: Support low DC impedance headset ASoC: amd: acp: Add support for a new Huawei Matebook laptop ALSA: hda/realtek: Apply quirk for ASUS UM3504DA ASoC: SOF: ipc4-topology: Correct data structures for the GAIN module ASoC: SOF: ipc4-topology: Correct data structures for the SRC module ASoC: hdac_hda: Conditionally register dais for HDMI and Analog ASoC: codecs: lpass-tx-macro: set active_decimator correct default value ASoC: amd: yc: Fix non-functional mic on ASUS E1504FA ASoC: amd: yc: Add DMI entry to support System76 Pangolin 13 ... commit 38bafa65b1260cb774cfc0c9a3ddf82d3c563e10 Merge: 4df7c5fde3168 b7b5a56acec81 Author: Linus Torvalds Date: Fri Dec 8 11:17:44 2023 -0800 Merge tag 'drm-fixes-2023-12-08' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Regular weekly fixes, mostly amdgpu and i915 as usual. A couple of nouveau, panfrost, one core and one bridge Kconfig. Seems about normal for rc5. atomic-helpers: - invoke end_fb_access while owning plane state i915: - fix a missing dep for a previous fix - Relax BXT/GLK DSI transcoder hblank limits - Fix DP MST .mode_valid_ctx() return values - Reject DP MST modes that require bigjoiner (as it's not yet supported on DP MST) - Fix _intel_dsb_commit() variable type to allow negative values nouveau: - document some bits of gsp rm - flush vmm more on tu102 to avoid hangs panfrost: - fix imported dma-buf objects residency - fix device freq update bridge: - tc358768 - fix Kconfig amdgpu: - Disable MCBP on gfx9 - DC vbios fix - eDP fix - dml2 UBSAN fix - SMU 14 fix - RAS fixes - dml KASAN/KCSAN fix - PSP 13 fix - Clockgating fixes - Suspend fix exynos: - fix pointer dereference - fix wrong error check" * tag 'drm-fixes-2023-12-08' of git://anongit.freedesktop.org/drm/drm: (27 commits) drm/exynos: fix a wrong error checking drm/exynos: fix a potential error pointer dereference drm/amdgpu: fix buffer funcs setting order on suspend drm/amdgpu: Avoid querying DRM MGCG status drm/amdgpu: Update HDP 4.4.2 clock gating flags drm/amdgpu: Add NULL checks for function pointers drm/amdgpu: Restrict extended wait to PSP v13.0.6 drm/amd/display: Increase frame warning limit with KASAN or KCSAN in dml drm/amdgpu: optimize the printing order of error data drm/amdgpu: Update fw version for boot time error query drm/amd/pm: support new mca smu error code decoding drm/amd/swsmu: update smu v14_0_0 driver if version and metrics table drm/amd/display: Fix array-index-out-of-bounds in dml2 drm/amd/display: Add monitor patch for specific eDP drm/amd/display: Use channel_width = 2 for vram table 3.0 drm/amdgpu: disable MCBP by default drm/atomic-helpers: Invoke end_fb_access while owning plane state drm/i915: correct the input parameter on _intel_dsb_commit() drm/i915/mst: Reject modes that require the bigjoiner drm/i915/mst: Fix .mode_valid_ctx() return values ... commit c12296bbecc488623b7d1932080e394d08f3226b Author: Florent Revest Date: Wed Dec 6 13:37:18 2023 +0100 team: Fix use-after-free when an option instance allocation fails In __team_options_register, team_options are allocated and appended to the team's option_list. If one option instance allocation fails, the "inst_rollback" cleanup path frees the previously allocated options but doesn't remove them from the team's option_list. This leaves dangling pointers that can be dereferenced later by other parts of the team driver that iterate over options. This patch fixes the cleanup path to remove the dangling pointers from the list. As far as I can tell, this uaf doesn't have much security implications since it would be fairly hard to exploit (an attacker would need to make the allocation of that specific small object fail) but it's still nice to fix. Cc: stable@vger.kernel.org Fixes: 80f7c6683fe0 ("team: add support for per-port options") Signed-off-by: Florent Revest Reviewed-by: Jiri Pirko Reviewed-by: Hangbin Liu Link: https://lore.kernel.org/r/20231206123719.1963153-1-revest@chromium.org Signed-off-by: Jakub Kicinski commit 4cdf351d3630a640ab6a05721ef055b9df62277f Author: Sean Christopherson Date: Fri May 7 09:59:46 2021 -0700 KVM: SVM: Update EFER software model on CR0 trap for SEV-ES In general, activating long mode involves setting the EFER_LME bit in the EFER register and then enabling the X86_CR0_PG bit in the CR0 register. At this point, the EFER_LMA bit will be set automatically by hardware. In the case of SVM/SEV guests where writes to CR0 are intercepted, it's necessary for the host to set EFER_LMA on behalf of the guest since hardware does not see the actual CR0 write. In the case of SEV-ES guests where writes to CR0 are trapped instead of intercepted, the hardware *does* see/record the write to CR0 before exiting and passing the value on to the host, so as part of enabling SEV-ES support commit f1c6366e3043 ("KVM: SVM: Add required changes to support intercepts under SEV-ES") dropped special handling of the EFER_LMA bit with the understanding that it would be set automatically. However, since the guest never explicitly sets the EFER_LMA bit, the host never becomes aware that it has been set. This becomes problematic when userspace tries to get/set the EFER values via KVM_GET_SREGS/KVM_SET_SREGS, since the EFER contents tracked by the host will be missing the EFER_LMA bit, and when userspace attempts to pass the EFER value back via KVM_SET_SREGS it will fail a sanity check that asserts that EFER_LMA should always be set when X86_CR0_PG and EFER_LME are set. Fix this by always inferring the value of EFER_LMA based on X86_CR0_PG and EFER_LME, regardless of whether or not SEV-ES is enabled. Fixes: f1c6366e3043 ("KVM: SVM: Add required changes to support intercepts under SEV-ES") Reported-by: Peter Gonda Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20210507165947.2502412-2-seanjc@google.com> [A two year old patch that was revived after we noticed the failure in KVM_SET_SREGS and a similar patch was posted by Michael Roth. This is Sean's patch, but with Michael's more complete commit message. - Paolo] Signed-off-by: Paolo Bonzini commit 307004e8b254ad28e150b63f299ab9caa4bc7c3e Author: Armin Wolf Date: Thu Dec 7 22:07:23 2023 +0100 hwmon: (corsair-psu) Fix probe when built-in It seems that when the driver is built-in, the HID bus is initialized after the driver is loaded, which whould cause module_hid_driver() to fail. Fix this by registering the driver after the HID bus using late_initcall() in accordance with other hwmon HID drivers. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20231207210723.222552-1-W_Armin@gmx.de [groeck: Dropped "compile tested" comment; the patch has been tested but the tester did not provide a Tested-by: tag] Signed-off-by: Guenter Roeck commit 96f124015f825a4a186b8497e20cf87f6519c7b4 Author: David Woodhouse Date: Sat Oct 28 20:34:53 2023 +0100 KVM: selftests: add -MP to CFLAGS Using -MD without -MP causes build failures when a header file is deleted or moved. With -MP, the compiler will emit phony targets for the header files it lists as dependencies, and the Makefiles won't refuse to attempt to rebuild a C unit which no longer includes the deleted header. Signed-off-by: David Woodhouse Link: https://lore.kernel.org/r/9fc8b5395321abbfcaf5d78477a9a7cd350b08e4.camel@infradead.org Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 4a073e813477be4ae95dfd23cb08baf36e93a29f Author: angquan yu Date: Tue Nov 28 16:11:05 2023 -0600 KVM: selftests: Actually print out magic token in NX hugepages skip message Pass MAGIC_TOKEN to __TEST_REQUIRE() when printing the help message about needing to pass a magic value to manually run the NX hugepages test, otherwise the help message will contain garbage. In file included from x86_64/nx_huge_pages_test.c:15: x86_64/nx_huge_pages_test.c: In function ‘main’: include/test_util.h:40:32: error: format ‘%d’ expects a matching ‘int’ argument [-Werror=format=] 40 | ksft_exit_skip("- " fmt "\n", ##__VA_ARGS__); \ | ^~~~ x86_64/nx_huge_pages_test.c:259:9: note: in expansion of macro ‘__TEST_REQUIRE’ 259 | __TEST_REQUIRE(token == MAGIC_TOKEN, | ^~~~~~~~~~~~~~ Signed-off-by: angquan yu Link: https://lore.kernel.org/r/20231128221105.63093-1-angquan21@gmail.com [sean: rewrite shortlog+changelog] Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 6254eebad4bedd3ac258a7e0710ec9fb28d8dbe9 Merge: aa0ae3df80990 ef8d89033c3f1 Author: Paolo Bonzini Date: Fri Dec 8 13:13:45 2023 -0500 Merge tag 'kvm-x86-fixes-6.7-rcN' of https://github.com/kvm-x86/linux into kvm-master KVM fixes for 6.7-rcN: - When checking if a _running_ vCPU is "in-kernel", i.e. running at CPL0, get the CPL directly instead of relying on preempted_in_kernel, which is valid if and only if the vCPU was preempted, i.e. NOT running. - Set .owner for various KVM file_operations so that files refcount the KVM module until KVM is done executing _all_ code, including the last few instructions of kvm_put_kvm(). And then revert the misguided attempt to rely on "struct kvm" refcounts to pin KVM-the-module. - Fix a benign "return void" that was recently introduced. commit aa0ae3df809909b5f06bd46a825dd923538e0115 Merge: c8a11a938c9de 27072b8e18a73 Author: Paolo Bonzini Date: Fri Dec 8 13:13:12 2023 -0500 Merge tag 'kvm-s390-master-6.7-1' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into kvm-master Two small but important bugfixes. commit c8a11a938c9def4e976b3c6f92f01c9b8655ff78 Merge: 33cc938e65a98 8e4ece6889a5b Author: Paolo Bonzini Date: Fri Dec 8 13:11:42 2023 -0500 Merge tag 'kvmarm-fixes-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into kvm-master KVM/arm64 fixes for 6.7, take #1 - Avoid mapping vLPIs that have already been mapped commit c5becf57dd5659c687d41d623a69f42d63f59eb2 Author: Martin K. Petersen Date: Fri Dec 8 12:09:38 2023 -0500 Revert "scsi: aacraid: Reply queue mapping to CPUs based on IRQ affinity" This reverts commit 9dc704dcc09eae7d21b5da0615eb2ed79278f63e. Several reports have been made indicating that this commit caused hangs. Numerous attempts at root causing and fixing the issue have been unsuccessful so let's revert for now. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217599 Cc: Signed-off-by: Martin K. Petersen commit 4df7c5fde316820286dfa6d203a1005d7fbe007d Merge: a6adef898741e ed5b7cfd7839f Author: Linus Torvalds Date: Fri Dec 8 09:03:54 2023 -0800 Merge tag 'riscv-for-linus-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - A pair of fixes to the new module load-time relocation code - A fix for hwprobe overflowing on rv32 - A fix for to correctly decode C.SWSP and C.SDSP, which manifests in misaligned access handling - A fix for a boot-time shadow call stack initialization ordering issue - A fix for Andes' errata probing, which was calling riscv_noncoherent_supported() too late in the boot process and triggering an oops * tag 'riscv-for-linus-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: errata: andes: Probe for IOCP only once in boot stage riscv: Fix SMP when shadow call stacks are enabled dt-bindings: perf: riscv,pmu: drop unneeded quotes riscv: fix misaligned access handling of C.SWSP and C.SDSP RISC-V: hwprobe: Always use u64 for extension bits Support rv32 ULEB128 test riscv: Correct type casting in module loading riscv: Safely remove entries from relocation list commit a6adef898741eb07526aaf9d8b982d3dff4a9e67 Merge: 17894c2a7aa60 fd1e5745f87a9 Author: Linus Torvalds Date: Fri Dec 8 08:58:39 2023 -0800 Merge tag 'soc-fixes-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "Most of the changes are devicetree fixes for NXP, Mediatek, Rockchips Arm machines as well as Microchip RISC-V, and most of these address build-time warnings for spec violations and other minor issues. One of the Mediatek warnings was enabled by default and prevented a clean build. The ones that address serious runtime issues are all on the i.MX platform: - a boot time panic on imx8qm - USB hanging under load on imx8 - regressions on the imx93 ethernet phy Code fixes include a minor error handling for the i.MX PMU driver, and a number of firmware driver fixes: - OP-TEE fix for supplicant based device enumeration, and a new sysfs attribute to needed to fix a race against userspace - Arm SCMI fix for possible truncation/overflow in the frequency computations - Multiple FF-A fixes for the newly added notification support" * tag 'soc-fixes-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (55 commits) MAINTAINERS: change the S32G2 maintainer's email address. arm64: dts: rockchip: Fix eMMC Data Strobe PD on rk3588 ARM: dts: imx28-xea: Pass the 'model' property ARM: dts: imx7: Declare timers compatible with fsl,imx6dl-gpt MAINTAINERS: reinstate freescale ARM64 DT directory in i.MX entry arm64: dts: imx8-apalis: set wifi regulator to always-on ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init arm64: dts: imx8ulp: update gpio node name to align with register address arm64: dts: imx93: update gpio node name to align with register address arm64: dts: imx93: correct mediamix power arm64: dts: imx8qm: Add imx8qm's own pm to avoid panic during startup arm64: dts: freescale: imx8-ss-dma: Fix #pwm-cells arm64: dts: freescale: imx8-ss-lsio: Fix #pwm-cells dt-bindings: pwm: imx-pwm: Unify #pwm-cells for all compatibles ARM: dts: imx6ul-pico: Describe the Ethernet PHY clock arm64: dts: imx8mp: imx8mq: Add parkmode-disable-ss-quirk on DWC3 arm64: dts: rockchip: Fix PCI node addresses on rk3399-gru arm64: dts: rockchip: drop interrupt-names property from rk3588s dfi firmware: arm_scmi: Fix possible frequency truncation when using level indexing mode firmware: arm_scmi: Fix frequency truncation by promoting multiplier type ... commit ef61a0405742a9f7f6051bc6fd2f017d87d07911 Author: Jiaxun Yang Date: Fri Dec 1 11:50:28 2023 +0000 PCI: loongson: Limit MRRS to 256 This is a partial revert of 8b3517f88ff2 ("PCI: loongson: Prevent LS7A MRRS increases") for MIPS-based Loongson. Some MIPS Loongson systems don't support arbitrary Max_Read_Request_Size (MRRS) settings. 8b3517f88ff2 ("PCI: loongson: Prevent LS7A MRRS increases") worked around that by (1) assuming that firmware configured MRRS to the maximum supported value and (2) preventing the PCI core from increasing MRRS. Unfortunately, some firmware doesn't set that maximum MRRS correctly, which results in devices not being initialized correctly. One symptom, from the Debian report below, is this: ata4.00: exception Emask 0x0 SAct 0x20000000 SErr 0x0 action 0x6 frozen ata4.00: failed command: WRITE FPDMA QUEUED ata4.00: cmd 61/20:e8:00:f0:e1/00:00:00:00:00/40 tag 29 ncq dma 16384 out res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) ata4.00: status: { DRDY } ata4: hard resetting link Limit MRRS to 256 because MIPS Loongson with higher MRRS support is considered rare. This must be done at device enablement stage because the MRRS setting may get lost if PCI_COMMAND_MASTER on the parent bridge is cleared, and we are only sure parent bridge is enabled at this point. Fixes: 8b3517f88ff2 ("PCI: loongson: Prevent LS7A MRRS increases") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217680 Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1035587 Link: https://lore.kernel.org/r/20231201115028.84351-1-jiaxun.yang@flygoat.com Signed-off-by: Jiaxun Yang Signed-off-by: Bjorn Helgaas Acked-by: Huacai Chen Cc: stable@vger.kernel.org commit 17894c2a7aa60a6da7495cc8500a53523e64c4b1 Merge: 8e819a7623f19 f458a1453424e Author: Linus Torvalds Date: Fri Dec 8 08:44:43 2023 -0800 Merge tag 'trace-v6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt: - Snapshot buffer issues: 1. When instances started allowing latency tracers, it uses a snapshot buffer (another buffer that is not written to but swapped with the main buffer that is). The snapshot buffer needs to be the same size as the main buffer. But when the snapshot buffers were added to instances, the code to make the snapshot equal to the main buffer still was only doing it for the main buffer and not the instances. 2. Need to stop the current tracer when resizing the buffers. Otherwise there can be a race if the tracer decides to make a snapshot between resizing the main buffer and the snapshot buffer. 3. When a tracer is "stopped" in disables both the main buffer and the snapshot buffer. This needs to be done for instances and not only the main buffer, now that instances also have a snapshot buffer. - Buffered event for filtering issues: When filtering is enabled, because events can be dropped often, it is quicker to copy the event into a temp buffer and write that into the main buffer if it is not filtered or just drop the event if it is, than to write the event into the ring buffer and then try to discard it. This temp buffer is allocated and needs special synchronization to do so. But there were some issues with that: 1. When disabling the filter and freeing the buffer, a call to all CPUs is required to stop each per_cpu usage. But the code called smp_call_function_many() which does not include the current CPU. If the task is migrated to another CPU when it enables the CPUs via smp_call_function_many(), it will not enable the one it is currently on and this causes issues later on. Use on_each_cpu_mask() instead, which includes the current CPU. 2.When the allocation of the buffered event fails, it can give a warning. But the buffered event is just an optimization (it's still OK to write to the ring buffer and free it). Do not WARN in this case. 3.The freeing of the buffer event requires synchronization. First a counter is decremented to zero so that no new uses of it will happen. Then it sets the buffered event to NULL, and finally it frees the buffered event. There's a synchronize_rcu() between the counter decrement and the setting the variable to NULL, but only a smp_wmb() between that and the freeing of the buffer. It is theoretically possible that a user missed seeing the decrement, but will use the buffer after it is free. Another synchronize_rcu() is needed in place of that smp_wmb(). - ring buffer timestamps on 32 bit machines The ring buffer timestamp on 32 bit machines has to break the 64 bit number into multiple values as cmpxchg is required on it, and a 64 bit cmpxchg on 32 bit architectures is very slow. The code use to just use two 32 bit values and make it a 60 bit timestamp where the other 4 bits were used as counters for synchronization. It later came known that the timestamp on 32 bit still need all 64 bits in some cases. So 3 words were created to handle the 64 bits. But issues arised with this: 1. The synchronization logic still only compared the counter with the first two, but not with the third number, so the synchronization could fail unknowingly. 2. A check on discard of an event could race if an event happened between the discard and updating one of the counters. The counter needs to be updated (forcing an absolute timestamp and not to use a delta) before the actual discard happens. * tag 'trace-v6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: ring-buffer: Test last update in 32bit version of __rb_time_read() ring-buffer: Force absolute timestamp on discard of event tracing: Fix a possible race when disabling buffered events tracing: Fix a warning when allocating buffered events fails tracing: Fix incomplete locking when disabling buffered events tracing: Disable snapshot buffer when stopping instance tracers tracing: Stop current tracer when resizing buffer tracing: Always update snapshot buffer size commit 8e819a7623f19534bce6d53678b581c167b5b079 Merge: 5e3f5b81de80c b2f557a21bc8f Author: Linus Torvalds Date: Fri Dec 8 08:36:23 2023 -0800 Merge tag 'mm-hotfixes-stable-2023-12-07-18-47' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc fixes from Andrew Morton: "31 hotfixes. Ten of these address pre-6.6 issues and are marked cc:stable. The remainder address post-6.6 issues or aren't considered serious enough to justify backporting" * tag 'mm-hotfixes-stable-2023-12-07-18-47' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (31 commits) mm/madvise: add cond_resched() in madvise_cold_or_pageout_pte_range() nilfs2: prevent WARNING in nilfs_sufile_set_segment_usage() mm/hugetlb: have CONFIG_HUGETLB_PAGE select CONFIG_XARRAY_MULTI scripts/gdb: fix lx-device-list-bus and lx-device-list-class MAINTAINERS: drop Antti Palosaari highmem: fix a memory copy problem in memcpy_from_folio nilfs2: fix missing error check for sb_set_blocksize call kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP units: add missing header drivers/base/cpu: crash data showing should depends on KEXEC_CORE mm/damon/sysfs-schemes: add timeout for update_schemes_tried_regions scripts/gdb/tasks: fix lx-ps command error mm/Kconfig: make userfaultfd a menuconfig selftests/mm: prevent duplicate runs caused by TEST_GEN_PROGS mm/damon/core: copy nr_accesses when splitting region lib/group_cpus.c: avoid acquiring cpu hotplug lock in group_cpus_evenly checkstack: fix printed address mm/memory_hotplug: fix error handling in add_memory_resource() mm/memory_hotplug: add missing mem_hotplug_lock .mailmap: add a new address mapping for Chester Lin ... commit 13736654481198e519059d4a2e2e3b20fa9fdb3e Author: Namjae Jeon Date: Wed Dec 6 08:23:49 2023 +0900 ksmbd: fix wrong name of SMB2_CREATE_ALLOCATION_SIZE MS confirm that "AISi" name of SMB2_CREATE_ALLOCATION_SIZE in MS-SMB2 specification is a typo. cifs/ksmbd have been using this wrong name from MS-SMB2. It should be "AlSi". Also It will cause problem when running smb2.create.open test in smbtorture against ksmbd. Cc: stable@vger.kernel.org Fixes: 12197a7fdda9 ("Clarify SMB2/SMB3 create context and add missing ones") Signed-off-by: Namjae Jeon Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit a9f106c765c12d2f58aa33431bd8ce8e9d8a404a Author: Namjae Jeon Date: Mon Dec 4 22:23:34 2023 +0900 ksmbd: fix wrong allocation size update in smb2_open() When client send SMB2_CREATE_ALLOCATION_SIZE create context, ksmbd update old size to ->AllocationSize in smb2 create response. ksmbd_vfs_getattr() should be called after it to get updated stat result. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 658609d9a618d8881bf549b5893c0ba8fcff4526 Author: Namjae Jeon Date: Mon Dec 4 22:20:46 2023 +0900 ksmbd: avoid duplicate opinfo_put() call on error of smb21_lease_break_ack() opinfo_put() could be called twice on error of smb21_lease_break_ack(). It will cause UAF issue if opinfo is referenced on other places. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit c2a721eead71202a0d8ddd9b56ec8dce652c71d1 Author: Namjae Jeon Date: Fri Dec 8 14:37:56 2023 +0900 ksmbd: lazy v2 lease break on smb2_write() Don't immediately send directory lease break notification on smb2_write(). Instead, It postpones it until smb2_close(). Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d47d9886aeef79feba7adac701a510d65f3682b5 Author: Namjae Jeon Date: Fri Dec 8 14:33:41 2023 +0900 ksmbd: send v2 lease break notification for directory If client send different parent key, different client guid, or there is no parent lease key flags in create context v2 lease, ksmbd send lease break to client. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit b1a6a1a77f0666a5a6dc0893ab6ec8fcae46f24c Author: Vineeth Vijayan Date: Thu Nov 23 22:52:53 2023 +0100 s390/scm: fix virtual vs physical address confusion Fix virtual vs physical address confusion (which currently are the same). Signed-off-by: Vineeth Vijayan Reviewed-by: Peter Oberparleiter Acked-by: Alexander Gordeev Signed-off-by: Alexander Gordeev commit 6e455f5dcdd15fa28edf0ffb5b44d3508512dccf Author: Jani Nikula Date: Fri Dec 8 15:12:38 2023 +0200 drm/crtc: fix uninitialized variable use Commit 3823119b9c2b ("drm/crtc: Fix uninit-value bug in drm_mode_setcrtc") was supposed to fix use of an uninitialized variable, but introduced another. num_connectors is only initialized if crtc_req->count_connectors > 0, but it's used regardless. Fix it. Fixes: 3823119b9c2b ("drm/crtc: Fix uninit-value bug in drm_mode_setcrtc") Cc: syzbot+4fad2e57beb6397ab2fc@syzkaller.appspotmail.com Cc: Ziqi Zhao Cc: Maxime Ripard Cc: Maarten Lankhorst Cc: Thomas Zimmermann Signed-off-by: Jani Nikula Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20231208131238.2924571-1-jani.nikula@intel.com commit 7bcd032370f88fd4022b6926d101403e96a86309 Author: Randy Dunlap Date: Tue Dec 5 22:01:18 2023 -0800 platform/x86: intel_ips: fix kernel-doc formatting Fix kernel-doc function notation and comment formatting to prevent warnings from scripts/kernel-doc. for drivers/platform/x86/intel_ips.c: 595: warning: No description found for return value of 'mcp_exceeded' 624: warning: No description found for return value of 'cpu_exceeded' 650: warning: No description found for return value of 'mch_exceeded' 745: warning: bad line: cpu+ gpu+ cpu+gpu- cpu-gpu+ cpu-gpu- 746: warning: bad line: cpu < gpu < cpu+gpu+ cpu+ gpu+ nothing 753: warning: No description found for return value of 'ips_adjust' 747: warning: bad line: cpu < gpu >= cpu+gpu-(mcp<) cpu+gpu-(mcp<) gpu- gpu- 748: warning: bad line: cpu >= gpu < cpu-gpu+(mcp<) cpu- cpu-gpu+(mcp<) cpu- 749: warning: bad line: cpu >= gpu >= cpu-gpu- cpu-gpu- cpu-gpu- cpu-gpu- 945: warning: No description found for return value of 'ips_monitor' 1151: warning: No description found for return value of 'ips_irq_handler' 1301: warning: Function parameter or member 'ips' not described in 'ips_detect_cpu' 1302: warning: No description found for return value of 'ips_detect_cpu' 1358: warning: No description found for return value of 'ips_get_i915_syms' Signed-off-by: Randy Dunlap Cc: Hans de Goede Cc: Ilpo Järvinen Cc: platform-driver-x86@vger.kernel.org Link: https://lore.kernel.org/r/20231206060120.4816-1-rdunlap@infradead.org Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 17fe3ec0c110b4afc04052e2a33b146766aac8a1 Author: Randy Dunlap Date: Tue Dec 5 22:01:43 2023 -0800 platform/x86: thinkpad_acpi: fix kernel-doc warnings Add a function's return description and don't misuse "/**" for non-kernel-doc comments to prevent warnings from scripts/kernel-doc. thinkpad_acpi.c:523: warning: No description found for return value of 'tpacpi_check_quirks' thinkpad_acpi.c:9307: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst thinkpad_acpi.c:9307: warning: missing initial short description on line: * This evaluates a ACPI method call specific to the battery Signed-off-by: Randy Dunlap Cc: Henrique de Moraes Holschuh Cc: Hans de Goede Cc: Ilpo Järvinen CC: ibm-acpi-devel@lists.sourceforge.net CC: platform-driver-x86@vger.kernel.org Reviewed-by: mpearson-lenovo@squebb.ca Link: https://lore.kernel.org/r/20231206060144.8260-1-rdunlap@infradead.org Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 14c200b7ca46b9a9f4af9e81d258a58274320b6f Author: Hans de Goede Date: Mon Dec 4 16:06:01 2023 +0100 platform/x86: intel-vbtn: Fix missing tablet-mode-switch events 2 issues have been reported on the Dell Inspiron 7352: 1. Sometimes the tablet-mode-switch stops reporting tablet-mode change events. Add a "VBDL" call to notify_handler() to work around this. 2. Sometimes the tablet-mode is incorrect after suspend/resume Add a detect_tablet_mode() to resume() to fix this. Reported-by: Arnold Gozum Closes: https://lore.kernel.org/platform-driver-x86/87271a74-c831-4eec-b7a4-1371d0e42471@gmail.com/ Tested-by: Arnold Gozum Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231204150601.46976-1-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit bd4a816752bab609dd6d65ae021387beb9e2ddbd Author: Maciej Żenczykowski Date: Wed Dec 6 09:36:12 2023 -0800 net: ipv6: support reporting otherwise unknown prefix flags in RTM_NEWPREFIX Lorenzo points out that we effectively clear all unknown flags from PIO when copying them to userspace in the netlink RTM_NEWPREFIX notification. We could fix this one at a time as new flags are defined, or in one fell swoop - I choose the latter. We could either define 6 new reserved flags (reserved1..6) and handle them individually (and rename them as new flags are defined), or we could simply copy the entire unmodified byte over - I choose the latter. This unfortunately requires some anonymous union/struct magic, so we add a static assert on the struct size for a little extra safety. Cc: David Ahern Cc: Lorenzo Colitti Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Maciej Żenczykowski Reviewed-by: David Ahern Signed-off-by: David S. Miller commit e5dc5afff62f3e97e86c3643ec9fcad23de4f2d3 Author: Judy Hsiao Date: Wed Dec 6 03:38:33 2023 +0000 neighbour: Don't let neigh_forced_gc() disable preemption for long We are seeing cases where neigh_cleanup_and_release() is called by neigh_forced_gc() many times in a row with preemption turned off. When running on a low powered CPU at a low CPU frequency, this has been measured to keep preemption off for ~10 ms. That's not great on a system with HZ=1000 which expects tasks to be able to schedule in with ~1ms latency. Suggested-by: Douglas Anderson Signed-off-by: Judy Hsiao Reviewed-by: David Ahern Reviewed-by: Eric Dumazet Reviewed-by: Douglas Anderson Signed-off-by: David S. Miller commit 179a8b515e4b8971ae4ad2db36a44f0691fc6756 Merge: 5e3f5b81de80c ca4ef28d0ad83 Author: David S. Miller Date: Fri Dec 8 10:30:34 2023 +0000 Merge tag 'mlx5-fixes-2023-12-04' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2023-12-04 This series provides bug fixes to mlx5 driver. V1->V2: - Drop commit #9 ("net/mlx5e: Forbid devlink reload if IPSec rules are offloaded"), we are working on a better fix Please pull and let me know if there is any problem. ==================== Signed-off-by: David S. Miller commit 3823119b9c2b5f9e9b760336f75bc989b805cde6 Author: Ziqi Zhao Date: Fri Jul 21 09:14:46 2023 -0700 drm/crtc: Fix uninit-value bug in drm_mode_setcrtc The connector_set contains uninitialized values when allocated with kmalloc_array. However, in the "out" branch, the logic assumes that any element in connector_set would be equal to NULL if failed to initialize, which causes the bug reported by Syzbot. The fix is to use an extra variable to keep track of how many connectors are initialized indeed, and use that variable to decrease any refcounts in the "out" branch. Reported-by: syzbot+4fad2e57beb6397ab2fc@syzkaller.appspotmail.com Signed-off-by: Ziqi Zhao Reported-and-tested-by: syzbot+4fad2e57beb6397ab2fc@syzkaller.appspotmail.com Tested-by: Harshit Mogalapalli Link: https://lore.kernel.org/r/20230721161446.8602-1-astrajoan@yahoo.com Signed-off-by: Maxime Ripard commit fd1e5745f87a9e06974d2f42d22b3e1682c99105 Merge: 7c9bb19045835 37f3d61087307 Author: Arnd Bergmann Date: Fri Dec 8 08:36:17 2023 +0100 Merge tag 'v6.7-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/fixes Devicetree fixes for the 6.7-cycle. All over the place this time. From adapting the size of the vdec nodes on rk3328 and rk3399, fixing some wrong pinctrl settings on rk3128 and the Turing RK1 board, emmc-settings fixes on rk3588 and interrupt-name mishaps, down to some dt-cleanups. Also this adds the missing rockchip,rk3588-pmugrf compatible to the soc grf binding, that I somehow messed up during the pull requests for the -rc1 . At least with it included the dt-checker is happier. * tag 'v6.7-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: Fix eMMC Data Strobe PD on rk3588 arm64: dts: rockchip: Fix PCI node addresses on rk3399-gru arm64: dts: rockchip: drop interrupt-names property from rk3588s dfi arm64: dts: rockchip: Fix Turing RK1 interrupt pinctrls ARM: dts: rockchip: Fix sdmmc_pwren's pinmux setting for RK3128 arm64: dts: rockchip: minor whitespace cleanup around '=' ARM: dts: rockchip: minor whitespace cleanup around '=' dt-bindings: soc: rockchip: grf: add rockchip,rk3588-pmugrf arm64: dts: rockchip: fix rk356x pcie msg interrupt name arm64: dts: rockchip: Expand reg size of vdec node for RK3399 arm64: dts: rockchip: Expand reg size of vdec node for RK3328 Link: https://lore.kernel.org/r/2709704.mvXUDI8C0e@phil Signed-off-by: Arnd Bergmann commit f0b94c1c5c7994a74e487f43c91cfc922105a423 Author: Gil Fine Date: Thu Nov 30 18:17:13 2023 +0200 thunderbolt: Fix minimum allocated USB 3.x and PCIe bandwidth With the current bandwidth allocation we end up reserving too much for the USB 3.x and PCIe tunnels that leads to reduced capabilities for the second DisplayPort tunnel. Fix this by decreasing the USB 3.x allocation to 900 Mb/s which then allows both tunnels to get the maximum HBR2 bandwidth. This way, the reserved bandwidth for USB 3.x and PCIe, would be 1350 Mb/s (taking weights of USB 3.x and PCIe into account). So bandwidth allocations on a link are: USB 3.x + PCIe tunnels => 1350 Mb/s DisplayPort tunnel #1 => 17280 Mb/s DisplayPort tunnel #2 => 17280 Mb/s Total consumed bandwidth is 35910 Mb/s. So that all the above can be tunneled on a Gen 3 link (which allows maximum of 36000 Mb/s). Fixes: 582e70b0d3a4 ("thunderbolt: Change bandwidth reservations to comply USB4 v2") Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 6d1980f0af439b5fd49b1bee2220deff6888792e Author: Kent Overstreet Date: Thu Dec 7 12:39:13 2023 -0500 bcachefs: Fix deleted inode check for dirs We could delete directories transactionally on rmdir()/unlink(), but we don't; instead, like with regular files we wait for the VFS to call evict(). That means that our check for directories in the deleted inodes btree is wrong - the check should be for non-empty directories. Signed-off-by: Kent Overstreet commit b7b5a56acec819bb8dcd03c687e97a091b29d28f Merge: 9f3e1c5919169 8d1b7809684c6 Author: Dave Airlie Date: Fri Dec 8 13:55:29 2023 +1000 Merge tag 'exynos-drm-next-for-v6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes Two fixups - Fix a potential error pointer dereference by checking the return value of exynos_drm_crtc_get_by_type() function before accessing to crtc object. - Fix a wrong error checking in exynos_drm_dma.c modules, which was reported by Dan[1] [1] https://lore.kernel.org/all/33e52277-1349-472b-a55b-ab5c3462bfcf@moroto.mountain/ Signed-off-by: Dave Airlie From: Inki Dae Link: https://patchwork.freedesktop.org/patch/msgid/20231207042223.2473706-1-inki.dae@samsung.com commit 9f3e1c5919169002c547df783b6167a2fc06c005 Merge: 9ac4883d24f23 dab96d8b61aab Author: Dave Airlie Date: Fri Dec 8 13:15:03 2023 +1000 Merge tag 'amd-drm-fixes-6.7-2023-12-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.7-2023-12-06: amdgpu: - Disable MCBP on gfx9 - DC vbios fix - eDP fix - dml2 UBSAN fix - SMU 14 fix - RAS fixes - dml KASAN/KCSAN fix - PSP 13 fix - Clockgating fixes - Suspend fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20231206221102.4995-1-alexander.deucher@amd.com commit 6f5c4eca48ffe18307b4e1d375817691c9005c87 Author: Dan Williams Date: Wed Dec 6 19:11:14 2023 -0800 cxl/hdm: Fix dpa translation locking The helper, cxl_dpa_resource_start(), snapshots the dpa-address of an endpoint-decoder after acquiring the cxl_dpa_rwsem. However, it is sufficient to assert that cxl_dpa_rwsem is held rather than acquire it in the helper. Otherwise, it triggers multiple lockdep reports: 1/ Tracing callbacks are in an atomic context that can not acquire sleeping locks: BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1525 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1288, name: bash preempt_count: 2, expected: 0 RCU nest depth: 0, expected: 0 [..] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS edk2-20230524-3.fc38 05/24/2023 Call Trace: dump_stack_lvl+0x71/0x90 __might_resched+0x1b2/0x2c0 down_read+0x1a/0x190 cxl_dpa_resource_start+0x15/0x50 [cxl_core] cxl_trace_hpa+0x122/0x300 [cxl_core] trace_event_raw_event_cxl_poison+0x1c9/0x2d0 [cxl_core] 2/ The rwsem is already held in the inject poison path: WARNING: possible recursive locking detected 6.7.0-rc2+ #12 Tainted: G W OE N -------------------------------------------- bash/1288 is trying to acquire lock: ffffffffc05f73d0 (cxl_dpa_rwsem){++++}-{3:3}, at: cxl_dpa_resource_start+0x15/0x50 [cxl_core] but task is already holding lock: ffffffffc05f73d0 (cxl_dpa_rwsem){++++}-{3:3}, at: cxl_inject_poison+0x7d/0x1e0 [cxl_core] [..] Call Trace: dump_stack_lvl+0x71/0x90 __might_resched+0x1b2/0x2c0 down_read+0x1a/0x190 cxl_dpa_resource_start+0x15/0x50 [cxl_core] cxl_trace_hpa+0x122/0x300 [cxl_core] trace_event_raw_event_cxl_poison+0x1c9/0x2d0 [cxl_core] __traceiter_cxl_poison+0x5c/0x80 [cxl_core] cxl_inject_poison+0x1bc/0x1e0 [cxl_core] This appears to have been an issue since the initial implementation and uncovered by the new cxl-poison.sh test [1]. That test is now passing with these changes. Fixes: 28a3ae4ff66c ("cxl/trace: Add an HPA to cxl_poison trace events") Link: http://lore.kernel.org/r/e4f2716646918135ddbadf4146e92abb659de734.1700615159.git.alison.schofield@intel.com [1] Cc: Cc: Alison Schofield Cc: Jonathan Cameron Cc: Dave Jiang Cc: Ira Weiny Signed-off-by: Dan Williams commit 9ac4883d24f231a290c3547b29bfc1f3b16727a5 Merge: abd02118807ad e0f04e41e8eed Author: Dave Airlie Date: Fri Dec 8 12:16:10 2023 +1000 Merge tag 'drm-misc-fixes-2023-12-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v6.7-rc5: - Document nouveau's GSP-RM. - Flush vmm harder on nouveau tu102. - Panfrost fix for imported dma-buf objects, and device frequency. - Kconfig Build fix for tc358768. - Call end_fb_access after atomic commit. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/05a26dc0-8cf1-4b1f-abb6-3bf471fbfc99@linux.intel.com commit 5e3f5b81de80c98338bcb47c233aebefee5a4801 Merge: 9ace34a8e446c b0a930e8d90ca Author: Linus Torvalds Date: Thu Dec 7 17:04:13 2023 -0800 Merge tag 'net-6.7-rc5' 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: - veth: fix packet segmentation in veth_convert_skb_to_xdp_buff Current release - new code bugs: - tcp: assorted fixes to the new Auth Option support Older releases - regressions: - tcp: fix mid stream window clamp - tls: fix incorrect splice handling - ipv4: ip_gre: handle skb_pull() failure in ipgre_xmit() - dsa: mv88e6xxx: restore USXGMII support for 6393X - arcnet: restore support for multiple Sohard Arcnet cards Older releases - always broken: - tcp: do not accept ACK of bytes we never sent - require admin privileges to receive packet traces via netlink - packet: move reference count in packet_sock to atomic_long_t - bpf: - fix incorrect branch offset comparison with cpu=v4 - fix prog_array_map_poke_run map poke update - netfilter: - three fixes for crashes on bad admin commands - xt_owner: fix race accessing sk->sk_socket, TOCTOU null-deref - nf_tables: fix 'exist' matching on bigendian arches - leds: netdev: fix RTNL handling to prevent potential deadlock - eth: tg3: prevent races in error/reset handling - eth: r8169: fix rtl8125b PAUSE storm when suspended - eth: r8152: improve reset and surprise removal handling - eth: hns: fix race between changing features and sending - eth: nfp: fix sleep in atomic for bonding offload" * tag 'net-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (62 commits) vsock/virtio: fix "comparison of distinct pointer types lacks a cast" warning net/smc: fix missing byte order conversion in CLC handshake net: dsa: microchip: provide a list of valid protocols for xmit handler drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group psample: Require 'CAP_NET_ADMIN' when joining "packets" group bpf: sockmap, updating the sg structure should also update curr net: tls, update curr on splice as well nfp: flower: fix for take a mutex lock in soft irq context and rcu lock net: dsa: mv88e6xxx: Restore USXGMII support for 6393X tcp: do not accept ACK of bytes we never sent selftests/bpf: Add test for early update in prog_array_map_poke_run bpf: Fix prog_array_map_poke_run map poke update netfilter: xt_owner: Fix for unsafe access of sk->sk_socket netfilter: nf_tables: validate family when identifying table via handle netfilter: nf_tables: bail out on mismatching dynset and set expressions netfilter: nf_tables: fix 'exist' matching on bigendian arches netfilter: nft_set_pipapo: skip inactive elements during set walk netfilter: bpf: fix bad registration on nf_defrag leds: trigger: netdev: fix RTNL handling to prevent potential deadlock octeontx2-af: Update Tx link register range ... commit abd02118807adec599e2d03b8b18529f5ba7f2a5 Merge: 33924328498e9 9f269070abe9c Author: Dave Airlie Date: Fri Dec 8 11:00:58 2023 +1000 Merge tag 'drm-intel-fixes-2023-12-07' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v6.7-rc5: - d21a3962d304 ("drm/i915: Call intel_pre_plane_updates() also for pipes getting enabled") in the previous fixes pull depends on a change that wasn't included. Pick it up. - Relax BXT/GLK DSI transcoder hblank limits - Fix DP MST .mode_valid_ctx() return values - Reject DP MST modes that require bigjoiner (as it's not yet supported on DP MST) - Fix _intel_dsb_commit() variable type to allow negative values Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87msum1hv8.fsf@intel.com commit 9ace34a8e446c1a566f3b0a3e0c4c483987e39a6 Merge: e0348c1f686a9 cff5f49d433fc Author: Linus Torvalds Date: Thu Dec 7 12:42:40 2023 -0800 Merge tag 'cgroup-for-6.7-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup fix from Tejun Heo: "Just one fix. Commit f5d39b020809 ("freezer,sched: Rewrite core freezer logic") changed how freezing state is recorded which made cgroup_freezing() disagree with the actual state of the task while thawing triggering a warning. Fix it by updating cgroup_freezing()" * tag 'cgroup-for-6.7-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup_freezer: cgroup_freezing: Check if not frozen commit 8f0b960a42badda7a2781e8a33564624200debc9 Author: Rafael J. Wysocki Date: Thu Dec 7 19:28:10 2023 +0100 ACPI: utils: Fix error path in acpi_evaluate_reference() If a pointer to an uninitialized struct acpi_handle_list is passed to acpi_evaluate_reference() and it decides to bail out early, either because acpi_evaluate_object() fails, or because it produces invalid data, the handles pointer from the struct acpi_handle_list will be passed to kfree() and if it is not NULL, the kernel will crash on an attempt to free unallocated memory. Address this by moving the "end" label in acpi_evaluate_reference() to the end of the function, which is sufficient, because no cleanup is needed in that case. Fixes: 2e57d10a6591 ("ACPI: utils: Dynamically determine acpi_handle_list size") Signed-off-by: Rafael J. Wysocki Tested-by: Woody Suwalski commit e0348c1f686a939222a2cbe7f3861e356b60d9b6 Merge: 4388ae22aeaa1 4a6c5607d4502 Author: Linus Torvalds Date: Thu Dec 7 12:36:32 2023 -0800 Merge tag 'wq-for-6.7-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue fix from Tejun Heo: "Just one patch to fix a bug which can crash the kernel if the housekeeping and wq_unbound_cpu cpumask configuration combination leaves the latter empty" * tag 'wq-for-6.7-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: Make sure that wq_unbound_cpumask is never empty commit 4388ae22aeaa1cd2f74edaa5cf5a518cc5f04c56 Merge: d5c0b60145348 fea88064445a5 Author: Linus Torvalds Date: Thu Dec 7 12:30:54 2023 -0800 Merge tag 'regmap-fix-v6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap fix from Mark Brown: "An incremental fix for the fix introduced during the merge window for caching of the selector for windowed register ranges. We were incorrectly leaking an error code in the case where the last selector accessed was for some reason not cached" * tag 'regmap-fix-v6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: fix bogus error on regcache_sync success commit d5c0b601453483f3068b9b06e13f83ea546c36e6 Merge: 33d42bde99274 136c6531ba12e Author: Linus Torvalds Date: Thu Dec 7 12:22:36 2023 -0800 Merge tag 'devicetree-fixes-for-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Fix dt-extract-compatibles for builds with in tree build directory - Drop Xinlei Lee bouncing email - Fix the of_reconfig_get_state_change() return value documentation - Add missing #power-domain-cells property to QCom MPM - Fix warnings in i.MX LCDIF and adi,adv7533 * tag 'devicetree-fixes-for-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: display: adi,adv75xx: Document #sound-dai-cells dt-bindings: lcdif: Properly describe the i.MX23 interrupts dt-bindings: interrupt-controller: Allow #power-domain-cells of: dynamic: Fix of_reconfig_get_state_change() return value documentation dt-bindings: display: mediatek: dsi: remove Xinlei's mail dt: dt-extract-compatibles: Don't follow symlinks when walking tree commit 33d42bde99274217305327ab14cef9e182961ff3 Merge: f35e46631b28a 3494a594315b5 Author: Linus Torvalds Date: Thu Dec 7 12:10:55 2023 -0800 Merge tag 'platform-drivers-x86-v6.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Ilpo Järvinen: - Fix i8042 filter resource handling, input, and suspend issues in asus-wmi - Skip zero instance WMI blocks to avoid issues with some laptops - Differentiate dev/production keys in mlxbf-bootctl - Correct surface serdev related return value to avoid leaking errno into userspace - Error checking fixes * tag 'platform-drivers-x86-v6.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/mellanox: Check devm_hwmon_device_register_with_groups() return value platform/mellanox: Add null pointer checks for devm_kasprintf() mlxbf-bootctl: correctly identify secure boot with development keys platform/x86: wmi: Skip blocks with zero instances platform/surface: aggregator: fix recv_buf() return value platform/x86: asus-wmi: disable USB0 hub on ROG Ally before suspend platform/x86: asus-wmi: Filter Volume key presses if also reported via atkbd platform/x86: asus-wmi: Change q500a_i8042_filter() into a generic i8042-filter platform/x86: asus-wmi: Move i8042 filter install to shared asus-wmi code commit f35e46631b28a63ca3887d7afef1a65a5544da52 Merge: 55b224d90d44d f4116bfc44621 Author: Linus Torvalds Date: Thu Dec 7 11:56:34 2023 -0800 Merge tag 'x86-int80-20231207' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 int80 fixes from Dave Hansen: "Avoid VMM misuse of 'int 0x80' handling in TDX and SEV guests. It also has the very nice side effect of getting rid of a bunch of assembly entry code" * tag 'x86-int80-20231207' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/tdx: Allow 32-bit emulation by default x86/entry: Do not allow external 0x80 interrupts x86/entry: Convert INT 0x80 emulation to IDTENTRY x86/coco: Disable 32-bit emulation by default on TDX and SEV commit c6d3ab9e76dc01011392cf8309f7e684b94ec464 Merge: 22b9a8964ead0 b39113349de60 Author: Jens Axboe Date: Thu Dec 7 12:15:18 2023 -0700 Merge tag 'md-fixes-20231207-1' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-6.7 Pull MD fix from Song: "This change from Yu Kuai fixes a bug reported in https://bugzilla.kernel.org/show_bug.cgi?id=218200" * tag 'md-fixes-20231207-1' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: split MD_RECOVERY_NEEDED out of mddev_resume commit 634e5e1e06f5cdd614a1bc429ecb243a51cc009d Author: Takashi Iwai Date: Thu Dec 7 19:20:35 2023 +0100 ALSA: hda/realtek: Add quirk for Lenovo Yoga Pro 7 Lenovo Yoga Pro 7 14APH8 (PCI SSID 17aa:3882) seems requiring the similar workaround like Yoga 9 model for the bass speaker. Cc: Link: https://lore.kernel.org/r/CAGGk=CRRQ1L9p771HsXTN_ebZP41Qj+3gw35Gezurn+nokRewg@mail.gmail.com Link: https://lore.kernel.org/r/20231207182035.30248-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit b39113349de60e9b0bc97c2e129181b193c45054 Author: Yu Kuai Date: Thu Dec 7 10:07:24 2023 +0800 md: split MD_RECOVERY_NEEDED out of mddev_resume New mddev_resume() calls are added to synchronize IO with array reconfiguration, however, this introduces a performance regression while adding it in md_start_sync(): 1) someone sets MD_RECOVERY_NEEDED first; 2) daemon thread grabs reconfig_mutex, then clears MD_RECOVERY_NEEDED and queues a new sync work; 3) daemon thread releases reconfig_mutex; 4) in md_start_sync a) check that there are spares that can be added/removed, then suspend the array; b) remove_and_add_spares may not be called, or called without really add/remove spares; c) resume the array, then set MD_RECOVERY_NEEDED again! Loop between 2 - 4, then mddev_suspend() will be called quite often, for consequence, normal IO will be quite slow. Fix this problem by don't set MD_RECOVERY_NEEDED again in md_start_sync(), hence the loop will be broken. Fixes: bc08041b32ab ("md: suspend array in md_start_sync() if array need reconfiguration") Suggested-by: Song Liu Reported-by: Janpieter Sollie Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218200 Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231207020724.2797445-1-yukuai1@huaweicloud.com commit b0a930e8d90caf66a94fee7a9d0b8472bc3e7561 Author: Stefano Garzarella Date: Wed Dec 6 17:41:43 2023 +0100 vsock/virtio: fix "comparison of distinct pointer types lacks a cast" warning After backporting commit 581512a6dc93 ("vsock/virtio: MSG_ZEROCOPY flag support") in CentOS Stream 9, CI reported the following error: In file included from ./include/linux/kernel.h:17, from ./include/linux/list.h:9, from ./include/linux/preempt.h:11, from ./include/linux/spinlock.h:56, from net/vmw_vsock/virtio_transport_common.c:9: net/vmw_vsock/virtio_transport_common.c: In function ‘virtio_transport_can_zcopy‘: ./include/linux/minmax.h:20:35: error: comparison of distinct pointer types lacks a cast [-Werror] 20 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ^~ ./include/linux/minmax.h:26:18: note: in expansion of macro ‘__typecheck‘ 26 | (__typecheck(x, y) && __no_side_effects(x, y)) | ^~~~~~~~~~~ ./include/linux/minmax.h:36:31: note: in expansion of macro ‘__safe_cmp‘ 36 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~ ./include/linux/minmax.h:45:25: note: in expansion of macro ‘__careful_cmp‘ 45 | #define min(x, y) __careful_cmp(x, y, <) | ^~~~~~~~~~~~~ net/vmw_vsock/virtio_transport_common.c:63:37: note: in expansion of macro ‘min‘ 63 | int pages_to_send = min(pages_in_iov, MAX_SKB_FRAGS); We could solve it by using min_t(), but this operation seems entirely unnecessary, because we also pass MAX_SKB_FRAGS to iov_iter_npages(), which performs almost the same check, returning at most MAX_SKB_FRAGS elements. So, let's eliminate this unnecessary comparison. Fixes: 581512a6dc93 ("vsock/virtio: MSG_ZEROCOPY flag support") Cc: avkrasnov@salutedevices.com Signed-off-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Reviewed-by: Arseniy Krasnov Link: https://lore.kernel.org/r/20231206164143.281107-1-sgarzare@redhat.com Signed-off-by: Jakub Kicinski commit c5a10397d4571bcfd4bd7ca211ee47bcb6792ec3 Author: Wen Gu Date: Thu Dec 7 01:02:37 2023 +0800 net/smc: fix missing byte order conversion in CLC handshake The byte order conversions of ISM GID and DMB token are missing in process of CLC accept and confirm. So fix it. Fixes: 3d9725a6a133 ("net/smc: common routine for CLC accept and confirm") Signed-off-by: Wen Gu Reviewed-by: Tony Lu Reviewed-by: Alexandra Winter Reviewed-by: Wenjia Zhang Link: https://lore.kernel.org/r/1701882157-87956-1-git-send-email-guwen@linux.alibaba.com Signed-off-by: Jakub Kicinski commit 1499b89289bf272fd83cb296c82fb5519d0fe93f Author: Sean Nyekjaer Date: Wed Dec 6 08:16:54 2023 +0100 net: dsa: microchip: provide a list of valid protocols for xmit handler Provide a list of valid protocols for which the driver will provide it's deferred xmit handler. When using DSA_TAG_PROTO_KSZ8795 protocol, it does not provide a "connect" method, therefor ksz_connect() is not allocating ksz_tagger_data. This avoids the following null pointer dereference: ksz_connect_tag_protocol from dsa_register_switch+0x9ac/0xee0 dsa_register_switch from ksz_switch_register+0x65c/0x828 ksz_switch_register from ksz_spi_probe+0x11c/0x168 ksz_spi_probe from spi_probe+0x84/0xa8 spi_probe from really_probe+0xc8/0x2d8 Fixes: ab32f56a4100 ("net: dsa: microchip: ptp: add packet transmission timestamping") Signed-off-by: Sean Nyekjaer Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20231206071655.1626479-1-sean@geanix.com Signed-off-by: Jakub Kicinski commit a041adee8a9c8d07d876d0633476f407554fc8cb Merge: 4a02609d756cd e03781879a0d5 Author: Jakub Kicinski Date: Thu Dec 7 09:54:04 2023 -0800 Merge branch 'generic-netlink-multicast-fixes' Ido Schimmel says: ==================== Generic netlink multicast fixes Restrict two generic netlink multicast groups - in the "psample" and "NET_DM" families - to be root-only with the appropriate capabilities. See individual patches for more details. ==================== Link: https://lore.kernel.org/r/20231206213102.1824398-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit e03781879a0d524ce3126678d50a80484a513c4b Author: Ido Schimmel Date: Wed Dec 6 23:31:02 2023 +0200 drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group The "NET_DM" generic netlink family notifies drop locations over the "events" multicast group. This is problematic since by default generic netlink allows non-root users to listen to these notifications. Fix by adding a new field to the generic netlink multicast group structure that when set prevents non-root users or root without the 'CAP_SYS_ADMIN' capability (in the user namespace owning the network namespace) from joining the group. Set this field for the "events" group. Use 'CAP_SYS_ADMIN' rather than 'CAP_NET_ADMIN' because of the nature of the information that is shared over this group. Note that the capability check in this case will always be performed against the initial user namespace since the family is not netns aware and only operates in the initial network namespace. A new field is added to the structure rather than using the "flags" field because the existing field uses uAPI flags and it is inappropriate to add a new uAPI flag for an internal kernel check. In net-next we can rework the "flags" field to use internal flags and fold the new field into it. But for now, in order to reduce the amount of changes, add a new field. Since the information can only be consumed by root, mark the control plane operations that start and stop the tracing as root-only using the 'GENL_ADMIN_PERM' flag. Tested using [1]. Before: # capsh -- -c ./dm_repo # capsh --drop=cap_sys_admin -- -c ./dm_repo After: # capsh -- -c ./dm_repo # capsh --drop=cap_sys_admin -- -c ./dm_repo Failed to join "events" multicast group [1] $ cat dm.c #include #include #include #include int main(int argc, char **argv) { struct nl_sock *sk; int grp, err; sk = nl_socket_alloc(); if (!sk) { fprintf(stderr, "Failed to allocate socket\n"); return -1; } err = genl_connect(sk); if (err) { fprintf(stderr, "Failed to connect socket\n"); return err; } grp = genl_ctrl_resolve_grp(sk, "NET_DM", "events"); if (grp < 0) { fprintf(stderr, "Failed to resolve \"events\" multicast group\n"); return grp; } err = nl_socket_add_memberships(sk, grp, NFNLGRP_NONE); if (err) { fprintf(stderr, "Failed to join \"events\" multicast group\n"); return err; } return 0; } $ gcc -I/usr/include/libnl3 -lnl-3 -lnl-genl-3 -o dm_repo dm.c Fixes: 9a8afc8d3962 ("Network Drop Monitor: Adding drop monitor implementation & Netlink protocol") Reported-by: "The UK's National Cyber Security Centre (NCSC)" Signed-off-by: Ido Schimmel Reviewed-by: Jacob Keller Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231206213102.1824398-3-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 44ec98ea5ea9cfecd31a5c4cc124703cb5442832 Author: Ido Schimmel Date: Wed Dec 6 23:31:01 2023 +0200 psample: Require 'CAP_NET_ADMIN' when joining "packets" group The "psample" generic netlink family notifies sampled packets over the "packets" multicast group. This is problematic since by default generic netlink allows non-root users to listen to these notifications. Fix by marking the group with the 'GENL_UNS_ADMIN_PERM' flag. This will prevent non-root users or root without the 'CAP_NET_ADMIN' capability (in the user namespace owning the network namespace) from joining the group. Tested using [1]. Before: # capsh -- -c ./psample_repo # capsh --drop=cap_net_admin -- -c ./psample_repo After: # capsh -- -c ./psample_repo # capsh --drop=cap_net_admin -- -c ./psample_repo Failed to join "packets" multicast group [1] $ cat psample.c #include #include #include #include int join_grp(struct nl_sock *sk, const char *grp_name) { int grp, err; grp = genl_ctrl_resolve_grp(sk, "psample", grp_name); if (grp < 0) { fprintf(stderr, "Failed to resolve \"%s\" multicast group\n", grp_name); return grp; } err = nl_socket_add_memberships(sk, grp, NFNLGRP_NONE); if (err) { fprintf(stderr, "Failed to join \"%s\" multicast group\n", grp_name); return err; } return 0; } int main(int argc, char **argv) { struct nl_sock *sk; int err; sk = nl_socket_alloc(); if (!sk) { fprintf(stderr, "Failed to allocate socket\n"); return -1; } err = genl_connect(sk); if (err) { fprintf(stderr, "Failed to connect socket\n"); return err; } err = join_grp(sk, "config"); if (err) return err; err = join_grp(sk, "packets"); if (err) return err; return 0; } $ gcc -I/usr/include/libnl3 -lnl-3 -lnl-genl-3 -o psample_repo psample.c Fixes: 6ae0a6286171 ("net: Introduce psample, a new genetlink channel for packet sampling") Reported-by: "The UK's National Cyber Security Centre (NCSC)" Signed-off-by: Ido Schimmel Reviewed-by: Jacob Keller Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231206213102.1824398-2-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 4a02609d756cdcf2f2d58f16423ba166f599ea7a Merge: 4de75d3e6b0ec bb9aefde5bbaf Author: Jakub Kicinski Date: Thu Dec 7 09:52:30 2023 -0800 Merge branch 'fixes-for-ktls' John Fastabend says: ==================== Couple fixes for TLS and BPF interactions. ==================== Link: https://lore.kernel.org/r/20231206232706.374377-1-john.fastabend@gmail.com Signed-off-by: Jakub Kicinski commit bb9aefde5bbaf6c168c77ba635c155b4980c2287 Author: John Fastabend Date: Wed Dec 6 15:27:06 2023 -0800 bpf: sockmap, updating the sg structure should also update curr Curr pointer should be updated when the sg structure is shifted. Fixes: 7246d8ed4dcce ("bpf: helper to pop data from messages") Signed-off-by: John Fastabend Link: https://lore.kernel.org/r/20231206232706.374377-3-john.fastabend@gmail.com Signed-off-by: Jakub Kicinski commit c5a595000e2677e865a39f249c056bc05d6e55fd Author: John Fastabend Date: Wed Dec 6 15:27:05 2023 -0800 net: tls, update curr on splice as well The curr pointer must also be updated on the splice similar to how we do this for other copy types. Fixes: d829e9c4112b ("tls: convert to generic sk_msg interface") Signed-off-by: John Fastabend Reported-by: Jann Horn Link: https://lore.kernel.org/r/20231206232706.374377-2-john.fastabend@gmail.com Signed-off-by: Jakub Kicinski commit f4116bfc44621882556bbf70f5284fbf429a5cf6 Author: Kirill A. Shutemov Date: Mon Dec 4 11:31:41 2023 +0300 x86/tdx: Allow 32-bit emulation by default 32-bit emulation was disabled on TDX to prevent a possible attack by a VMM injecting an interrupt on vector 0x80. Now that int80_emulation() has a check for external interrupts the limitation can be lifted. To distinguish software interrupts from external ones, int80_emulation() checks the APIC ISR bit relevant to the 0x80 vector. For software interrupts, this bit will be 0. On TDX, the VAPIC state (including ISR) is protected and cannot be manipulated by the VMM. The ISR bit is set by the microcode flow during the handling of posted interrupts. [ dhansen: more changelog tweaks ] Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Thomas Gleixner Reviewed-by: Borislav Petkov (AMD) Cc: # v6.0+ commit 55617fb991df535f953589586468612351575704 Author: Thomas Gleixner Date: Mon Dec 4 11:31:40 2023 +0300 x86/entry: Do not allow external 0x80 interrupts The INT 0x80 instruction is used for 32-bit x86 Linux syscalls. The kernel expects to receive a software interrupt as a result of the INT 0x80 instruction. However, an external interrupt on the same vector also triggers the same codepath. An external interrupt on vector 0x80 will currently be interpreted as a 32-bit system call, and assuming that it was a user context. Panic on external interrupts on the vector. To distinguish software interrupts from external ones, the kernel checks the APIC ISR bit relevant to the 0x80 vector. For software interrupts, this bit will be 0. Signed-off-by: Thomas Gleixner Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Borislav Petkov (AMD) Cc: # v6.0+ commit be5341eb0d43b1e754799498bd2e8756cc167a41 Author: Thomas Gleixner Date: Mon Dec 4 11:31:39 2023 +0300 x86/entry: Convert INT 0x80 emulation to IDTENTRY There is no real reason to have a separate ASM entry point implementation for the legacy INT 0x80 syscall emulation on 64-bit. IDTENTRY provides all the functionality needed with the only difference that it does not: - save the syscall number (AX) into pt_regs::orig_ax - set pt_regs::ax to -ENOSYS Both can be done safely in the C code of an IDTENTRY before invoking any of the syscall related functions which depend on this convention. Aside of ASM code reduction this prepares for detecting and handling a local APIC injected vector 0x80. [ kirill.shutemov: More verbose comments ] Suggested-by: Linus Torvalds Signed-off-by: Thomas Gleixner Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Borislav Petkov (AMD) Cc: # v6.0+ commit b82a8dbd3d2f4563156f7150c6f2ecab6e960b30 Author: Kirill A. Shutemov Date: Mon Dec 4 11:31:38 2023 +0300 x86/coco: Disable 32-bit emulation by default on TDX and SEV The INT 0x80 instruction is used for 32-bit x86 Linux syscalls. The kernel expects to receive a software interrupt as a result of the INT 0x80 instruction. However, an external interrupt on the same vector triggers the same handler. The kernel interprets an external interrupt on vector 0x80 as a 32-bit system call that came from userspace. A VMM can inject external interrupts on any arbitrary vector at any time. This remains true even for TDX and SEV guests where the VMM is untrusted. Put together, this allows an untrusted VMM to trigger int80 syscall handling at any given point. The content of the guest register file at that moment defines what syscall is triggered and its arguments. It opens the guest OS to manipulation from the VMM side. Disable 32-bit emulation by default for TDX and SEV. User can override it with the ia32_emulation=y command line option. [ dhansen: reword the changelog ] Reported-by: Supraja Sridhara Reported-by: Benedict Schlüter Reported-by: Mark Kuhne Reported-by: Andrin Bertschi Reported-by: Shweta Shinde Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Thomas Gleixner Reviewed-by: Borislav Petkov (AMD) Cc: # v6.0+: 1da5c9b x86: Introduce ia32_enabled() Cc: # v6.0+ commit 4de75d3e6b0ece518a2e6e48c2716f1b223716d3 Merge: c85e5594b7456 7ae836a3d630e Author: Jakub Kicinski Date: Thu Dec 7 09:43:29 2023 -0800 Merge tag 'nf-23-12-06' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Incorrect nf_defrag registration for bpf link infra, from D. Wythe. 2) Skip inactive elements in pipapo set backend walk to avoid double deactivation, from Florian Westphal. 3) Fix NFT_*_F_PRESENT check with big endian arch, also from Florian. 4) Bail out if number of expressions in NFTA_DYNSET_EXPRESSIONS mismatch stateful expressions in set declaration. 5) Honor family in table lookup by handle. Broken since 4.16. 6) Use sk_callback_lock to protect access to sk->sk_socket in xt_owner. sock_orphan() might zap this pointer, from Phil Sutter. All of these fixes address broken stuff for several releases. * tag 'nf-23-12-06' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: xt_owner: Fix for unsafe access of sk->sk_socket netfilter: nf_tables: validate family when identifying table via handle netfilter: nf_tables: bail out on mismatching dynset and set expressions netfilter: nf_tables: fix 'exist' matching on bigendian arches netfilter: nft_set_pipapo: skip inactive elements during set walk netfilter: bpf: fix bad registration on nf_defrag ==================== Link: https://lore.kernel.org/r/20231206180357.959930-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 705318a99a138c29a512a72c3e0043b3cd7f55f4 Author: Pavel Begunkov Date: Wed Dec 6 13:26:47 2023 +0000 io_uring/af_unix: disable sending io_uring over sockets File reference cycles have caused lots of problems for io_uring in the past, and it still doesn't work exactly right and races with unix_stream_read_generic(). The safest fix would be to completely disallow sending io_uring files via sockets via SCM_RIGHT, so there are no possible cycles invloving registered files and thus rendering SCM accounting on the io_uring side unnecessary. Cc: Fixes: 0091bfc81741b ("io_uring/af_unix: defer registered files gc to io_uring release") Reported-and-suggested-by: Jann Horn Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/c716c88321939156909cfa1bd8b0faaf1c804103.1701868795.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit c85e5594b7456d55103fa1f1bde47cd4e002e7fb Merge: 0ad722bd9ee3a ffed24eff9e0e Author: Jakub Kicinski Date: Thu Dec 7 09:32:23 2023 -0800 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2023-12-06 We've added 4 non-merge commits during the last 6 day(s) which contain a total of 7 files changed, 185 insertions(+), 55 deletions(-). The main changes are: 1) Fix race found by syzkaller on prog_array_map_poke_run when a BPF program's kallsym symbols were still missing, from Jiri Olsa. 2) Fix BPF verifier's branch offset comparison for BPF_JMP32 | BPF_JA, from Yonghong Song. 3) Fix xsk's poll handling to only set mask on bound xsk sockets, from Yewon Choi. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: selftests/bpf: Add test for early update in prog_array_map_poke_run bpf: Fix prog_array_map_poke_run map poke update xsk: Skip polling event check for unbound socket bpf: Fix a verifier bug due to incorrect branch offset comparison with cpu=v4 ==================== Link: https://lore.kernel.org/r/20231206220528.12093-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 22b9a8964ead09e4bc0f03305cadee353653d790 Merge: 7d2affce33209 107b4e063d78c Author: Jens Axboe Date: Thu Dec 7 10:30:54 2023 -0700 Merge tag 'nvme-6.7-2023-12-7' of git://git.infradead.org/nvme into block-6.7 Pull NVMe fixes from Keith: "nvme fixes for Linux 6.7 - Proper nvme ctrl state setting (Keith) - Passthrough command optimization (Keith) - Spectre fix (Nitesh) - Kconfig clarifications (Shin'ichiro) - Frozen state deadlock fix (Bitao) - Power setting quirk (Georg)" * tag 'nvme-6.7-2023-12-7' of git://git.infradead.org/nvme: nvme-pci: Add sleep quirk for Kingston drives nvme: fix deadlock between reset and scan nvme: prevent potential spectre v1 gadget nvme: improve NVME_HOST_AUTH and NVME_TARGET_AUTH config descriptions nvme-ioctl: move capable() admin check to the end nvme: ensure reset state check ordering nvme: introduce helper function to get ctrl state commit 107b4e063d78c300b21e2d5291b1aa94c514ea5b Author: Georg Gottleuber Date: Wed Sep 20 10:52:10 2023 +0200 nvme-pci: Add sleep quirk for Kingston drives Some Kingston NV1 and A2000 are wasting a lot of power on specific TUXEDO platforms in s2idle sleep if 'Simple Suspend' is used. This patch applies a new quirk 'Force No Simple Suspend' to achieve a low power sleep without 'Simple Suspend'. Signed-off-by: Werner Sembach Signed-off-by: Georg Gottleuber Cc: Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 7c9bb19045835946ad85811d7b5e8d21f53f52a0 Merge: b0b2981c49ff4 63ef8fc9bcee6 Author: Arnd Bergmann Date: Thu Dec 7 17:36:27 2023 +0100 Merge tag 'imx-fixes-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 6.7: - A MAINTAINERS update to reinstate freescale ARM64 DT directory in i.MX entry. - A series from Alexander Stein to fix #pwm-cells for imx8-ss. - A series from Haibo Chen to fix GPIO node name for i.MX93 and i.MX8ULP. - Add parkmode-disable-ss-quirk for DWC3 on i.MX8MP and i.MX8MQ to fix an issue that the controller may hang when processing transactions under heavy USB traffic from multiple endpoints. - Fix mediamix block power on/off for i.MX93 by correcting the power domain clock to be 'nic_media'. - A couple of Ethernet PHY clock regression fixes for imx6ul-pico and imx6q-skov board. - Fix edma3 power domain for i.MX8QM to fix a panic during startup process. * tag 'imx-fixes-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: dts: imx28-xea: Pass the 'model' property ARM: dts: imx7: Declare timers compatible with fsl,imx6dl-gpt MAINTAINERS: reinstate freescale ARM64 DT directory in i.MX entry arm64: dts: imx8-apalis: set wifi regulator to always-on ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init arm64: dts: imx8ulp: update gpio node name to align with register address arm64: dts: imx93: update gpio node name to align with register address arm64: dts: imx93: correct mediamix power arm64: dts: imx8qm: Add imx8qm's own pm to avoid panic during startup arm64: dts: freescale: imx8-ss-dma: Fix #pwm-cells arm64: dts: freescale: imx8-ss-lsio: Fix #pwm-cells dt-bindings: pwm: imx-pwm: Unify #pwm-cells for all compatibles ARM: dts: imx6ul-pico: Describe the Ethernet PHY clock arm64: dts: imx8mp: imx8mq: Add parkmode-disable-ss-quirk on DWC3 ARM: dts: imx6q: skov: fix ethernet clock regression arm64: dt: imx93: tqma9352-mba93xxla: Fix LPUART2 pad config Link: https://lore.kernel.org/r/20231207005202.GF270430@dragon Signed-off-by: Arnd Bergmann commit 1036f69e251380573e256568cf814506e3fb9988 Author: Geert Uytterhoeven Date: Mon Dec 4 12:29:53 2023 +0100 mmc: core: Cancel delayed work before releasing host On RZ/Five SMARC EVK, where probing of SDHI is deferred due to probe deferral of the vqmmc-supply regulator: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at kernel/time/timer.c:1738 __run_timers.part.0+0x1d0/0x1e8 Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 6.7.0-rc4 #101 Hardware name: Renesas SMARC EVK based on r9a07g043f01 (DT) epc : __run_timers.part.0+0x1d0/0x1e8 ra : __run_timers.part.0+0x134/0x1e8 epc : ffffffff800771a4 ra : ffffffff80077108 sp : ffffffc800003e60 gp : ffffffff814f5028 tp : ffffffff8140c5c0 t0 : ffffffc800000000 t1 : 0000000000000001 t2 : ffffffff81201300 s0 : ffffffc800003f20 s1 : ffffffd8023bc4a0 a0 : 00000000fffee6b0 a1 : 0004010000400000 a2 : ffffffffc0000016 a3 : ffffffff81488640 a4 : ffffffc800003e60 a5 : 0000000000000000 a6 : 0000000004000000 a7 : ffffffc800003e68 s2 : 0000000000000122 s3 : 0000000000200000 s4 : 0000000000000000 s5 : ffffffffffffffff s6 : ffffffff81488678 s7 : ffffffff814886c0 s8 : ffffffff814f49c0 s9 : ffffffff81488640 s10: 0000000000000000 s11: ffffffc800003e60 t3 : 0000000000000240 t4 : 0000000000000a52 t5 : ffffffd8024ae018 t6 : ffffffd8024ae038 status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003 [] __run_timers.part.0+0x1d0/0x1e8 [] run_timer_softirq+0x24/0x4a [] __do_softirq+0xc6/0x1fa [] irq_exit_rcu+0x66/0x84 [] handle_riscv_irq+0x40/0x4e [] call_on_irq_stack+0x1c/0x28 ---[ end trace 0000000000000000 ]--- What happens? renesas_sdhi_probe() { tmio_mmc_host_alloc() mmc_alloc_host() INIT_DELAYED_WORK(&host->detect, mmc_rescan); devm_request_irq(tmio_mmc_irq); /* * After this, the interrupt handler may be invoked at any time * * tmio_mmc_irq() * { * __tmio_mmc_card_detect_irq() * mmc_detect_change() * _mmc_detect_change() * mmc_schedule_delayed_work(&host->detect, delay); * } */ tmio_mmc_host_probe() tmio_mmc_init_ocr() -EPROBE_DEFER tmio_mmc_host_free() mmc_free_host() } When expire_timers() runs later, it warns because the MMC host structure containing the delayed work was freed, and now contains an invalid work function pointer. Fix this by cancelling any pending delayed work before releasing the MMC host structure. Signed-off-by: Geert Uytterhoeven Tested-by: Lad Prabhakar Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/205dc4c91b47e31b64392fe2498c7a449e717b4b.1701689330.git.geert+renesas@glider.be Signed-off-by: Ulf Hansson commit e7794c14fd73e5eb4a3e0ecaa5334d5a17377c50 Author: Jorge Ramirez-Ortiz Date: Fri Dec 1 16:31:43 2023 +0100 mmc: rpmb: fixes pause retune on all RPMB partitions. When RPMB was converted to a character device, it added support for multiple RPMB partitions (Commit 97548575bef3 ("mmc: block: Convert RPMB to a character device"). One of the changes in this commit was transforming the variable target_part defined in __mmc_blk_ioctl_cmd into a bitmask. This inadvertently regressed the validation check done in mmc_blk_part_switch_pre() and mmc_blk_part_switch_post(), so let's fix it. Fixes: 97548575bef3 ("mmc: block: Convert RPMB to a character device") Signed-off-by: Jorge Ramirez-Ortiz Reviewed-by: Linus Walleij Cc: Link: https://lore.kernel.org/r/20231201153143.1449753-1-jorge@foundries.io Signed-off-by: Ulf Hansson commit 5a6c9a05e55cb2972396cc991af9d74c8c15029a Author: Lingkai Dong Date: Wed Dec 6 13:51:58 2023 +0000 drm: Fix FD ownership check in drm_master_check_perm() The DRM subsystem keeps a record of the owner of a DRM device file descriptor using thread group ID (TGID) instead of process ID (PID), to ensures all threads within the same userspace process are considered the owner. However, the DRM master ownership check compares the current thread's PID against the record, so the thread is incorrectly considered to be not the FD owner if the PID is not equal to the TGID. This causes DRM ioctls to be denied master privileges, even if the same thread that opened the FD performs an ioctl. Fix this by checking TGID. Fixes: 4230cea89cafb ("drm: Track clients by tgid and not tid") Signed-off-by: Lingkai Dong Reviewed-by: Christian König Reviewed-by: Tvrtko Ursulin Cc: # v6.4+ Link: https://patchwork.freedesktop.org/patch/msgid/PA6PR08MB107665920BE9A96658CDA04CE8884A@PA6PR08MB10766.eurprd08.prod.outlook.com Signed-off-by: Christian König commit 8c124d998ea0c9022e247b11ac51f86ec8afa0e1 Author: Ziyang Huang Date: Wed Oct 11 00:44:00 2023 +0800 mmc: meson-mx-sdhc: Fix initialization frozen issue Commit 4bc31edebde5 ("mmc: core: Set HS clock speed before sending HS CMD13") set HS clock (52MHz) before switching to HS mode. For this freq, FCLK_DIV5 will be selected and div value is 10 (reg value is 9). Then we set rx_clk_phase to 11 or 15 which is out of range and make hardware frozen. After we send command request, no irq will be interrupted and the mmc driver will keep to wait for request finished, even durning rebooting. So let's set it to Phase 90 which should work in most cases. Then let meson_mx_sdhc_execute_tuning() to find the accurate value for data transfer. If this doesn't work, maybe need to define a factor in dts. Fixes: e4bf1b0970ef ("mmc: host: meson-mx-sdhc: new driver for the Amlogic Meson SDHC host") Signed-off-by: Ziyang Huang Tested-by: Anand Moon Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/TYZPR01MB5556A3E71554A2EC08597EA4C9CDA@TYZPR01MB5556.apcprd01.prod.exchangelabs.com Signed-off-by: Ulf Hansson commit 0ad722bd9ee3a9bdfca9613148645e4c9b7f26cf Author: Hui Zhou Date: Tue Dec 5 11:26:25 2023 +0200 nfp: flower: fix for take a mutex lock in soft irq context and rcu lock The neighbour event callback call the function nfp_tun_write_neigh, this function will take a mutex lock and it is in soft irq context, change the work queue to process the neighbour event. Move the nfp_tun_write_neigh function out of range rcu_read_lock/unlock() in function nfp_tunnel_request_route_v4 and nfp_tunnel_request_route_v6. Fixes: abc210952af7 ("nfp: flower: tunnel neigh support bond offload") CC: stable@vger.kernel.org # 6.2+ Signed-off-by: Hui Zhou Signed-off-by: Louis Peens Signed-off-by: David S. Miller commit eb99b1b72a424a79f56c972e0fd7ad01fe93a008 Author: Ivan Orlov Date: Wed Dec 6 22:32:11 2023 +0000 ALSA: pcmtest: stop timer before buffer is released Stop timer in the 'trigger' and 'sync_stop' callbacks since we want the timer to be stopped before the DMA buffer is released. Otherwise, it could trigger a kernel panic in some circumstances, for instance when the DMA buffer is already released but the timer callback is still running. Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20231206223211.12761-1-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai commit 55b224d90d44d794c1afab046c4fd9dc8be9247d Merge: bee0e7762ad2c 487635756198c Author: Linus Torvalds Date: Wed Dec 6 23:22:48 2023 -0800 Merge tag 'parisc-for-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc fix from Helge Deller: "A single line patch for parisc which fixes the build in tinyconfig configurations: - Fix asm operand number out of range build error in bug table" * tag 'parisc-for-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix asm operand number out of range build error in bug table commit 8804fa04a492f4176ea407390052292912227820 Author: Mario Limonciello Date: Wed Dec 6 13:39:27 2023 -0600 ALSA: hda/realtek: Add Framework laptop 16 to quirks The Framework 16" laptop has the same controller as other Framework models. Apply the presence detection quirk. Signed-off-by: Mario Limonciello Cc: Link: https://lore.kernel.org/r/20231206193927.2996-1-mario.limonciello@amd.com Signed-off-by: Takashi Iwai commit 803a809d3d85cf06a04770fb04b585364d2d26dc Merge: 0c7ed1f9197ae a206d9959f5cc Author: Jakub Kicinski Date: Wed Dec 6 19:33:43 2023 -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 2023-12-05 (ice, i40e, iavf) This series contains updates to ice, i40e and iavf drivers. Michal fixes incorrect usage of VF MSIX value and index calculation for ice. Marcin restores disabling of Rx VLAN filtering which was inadvertently removed for ice. Ivan Vecera corrects improper messaging of MFS port for i40e. Jake fixes incorrect checking of coalesce values on iavf. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: iavf: validate tx_coalesce_usecs even if rx_coalesce_usecs is zero i40e: Fix unexpected MFS warning message ice: Restore fix disabling RX VLAN filtering ice: change vfs.num_msix_per to vf->num_msix ==================== Link: https://lore.kernel.org/r/20231205211918.2123019-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 0c7ed1f9197aecada33a08b022e484a97bf584ba Author: Tobias Waldekranz Date: Tue Dec 5 23:13:59 2023 +0100 net: dsa: mv88e6xxx: Restore USXGMII support for 6393X In 4a56212774ac, USXGMII support was added for 6393X, but this was lost in the PCS conversion (the blamed commit), most likely because these efforts where more or less done in parallel. Restore this feature by porting Michal's patch to fit the new implementation. Reviewed-by: Florian Fainelli Tested-by: Michal Smulski Reviewed-by: Vladimir Oltean Fixes: e5b732a275f5 ("net: dsa: mv88e6xxx: convert 88e639x to phylink_pcs") Signed-off-by: Tobias Waldekranz Link: https://lore.kernel.org/r/20231205221359.3926018-1-tobias@waldekranz.com Signed-off-by: Jakub Kicinski commit 3d501dd326fb1c73f1b8206d4c6e1d7b15c07e27 Author: Eric Dumazet Date: Tue Dec 5 16:18:41 2023 +0000 tcp: do not accept ACK of bytes we never sent This patch is based on a detailed report and ideas from Yepeng Pan and Christian Rossow. ACK seq validation is currently following RFC 5961 5.2 guidelines: The ACK value is considered acceptable only if it is in the range of ((SND.UNA - MAX.SND.WND) <= SEG.ACK <= SND.NXT). All incoming segments whose ACK value doesn't satisfy the above condition MUST be discarded and an ACK sent back. It needs to be noted that RFC 793 on page 72 (fifth check) says: "If the ACK is a duplicate (SEG.ACK < SND.UNA), it can be ignored. If the ACK acknowledges something not yet sent (SEG.ACK > SND.NXT) then send an ACK, drop the segment, and return". The "ignored" above implies that the processing of the incoming data segment continues, which means the ACK value is treated as acceptable. This mitigation makes the ACK check more stringent since any ACK < SND.UNA wouldn't be accepted, instead only ACKs that are in the range ((SND.UNA - MAX.SND.WND) <= SEG.ACK <= SND.NXT) get through. This can be refined for new (and possibly spoofed) flows, by not accepting ACK for bytes that were never sent. This greatly improves TCP security at a little cost. I added a Fixes: tag to make sure this patch will reach stable trees, even if the 'blamed' patch was adhering to the RFC. tp->bytes_acked was added in linux-4.2 Following packetdrill test (courtesy of Yepeng Pan) shows the issue at hand: 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 +0 bind(3, ..., ...) = 0 +0 listen(3, 1024) = 0 // ---------------- Handshake ------------------- // // when window scale is set to 14 the window size can be extended to // 65535 * (2^14) = 1073725440. Linux would accept an ACK packet // with ack number in (Server_ISN+1-1073725440. Server_ISN+1) // ,though this ack number acknowledges some data never // sent by the server. +0 < S 0:0(0) win 65535 +0 > S. 0:0(0) ack 1 <...> +0 < . 1:1(0) ack 1 win 65535 +0 accept(3, ..., ...) = 4 // For the established connection, we send an ACK packet, // the ack packet uses ack number 1 - 1073725300 + 2^32, // where 2^32 is used to wrap around. // Note: we used 1073725300 instead of 1073725440 to avoid possible // edge cases. // 1 - 1073725300 + 2^32 = 3221241997 // Oops, old kernels happily accept this packet. +0 < . 1:1001(1000) ack 3221241997 win 65535 // After the kernel fix the following will be replaced by a challenge ACK, // and prior malicious frame would be dropped. +0 > . 1:1(0) ack 1001 Fixes: 354e4aa391ed ("tcp: RFC 5961 5.2 Blind Data Injection Attack Mitigation") Signed-off-by: Eric Dumazet Reported-by: Yepeng Pan Reported-by: Christian Rossow Acked-by: Neal Cardwell Link: https://lore.kernel.org/r/20231205161841.2702925-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 8d1b7809684c688005706125b804e1f9792d2b1b Author: Inki Dae Date: Wed Nov 1 18:36:51 2023 +0900 drm/exynos: fix a wrong error checking Fix a wrong error checking in exynos_drm_dma.c module. In the exynos_drm_register_dma function, both arm_iommu_create_mapping() and iommu_get_domain_for_dev() functions are expected to return NULL as an error. However, the error checking is performed using the statement if(IS_ERR(mapping)), which doesn't provide a suitable error value. So check if 'mapping' is NULL, and if it is, return -ENODEV. This issue[1] was reported by Dan. Changelog v1: - fix build warning. [1] https://lore.kernel.org/all/33e52277-1349-472b-a55b-ab5c3462bfcf@moroto.mountain/ Reported-by : Dan Carpenter Signed-off-by: Inki Dae commit 73bf1c9ae6c054c53b8e84452c5e46f86dd28246 Author: Xiang Yang Date: Sat Aug 12 14:27:48 2023 +0800 drm/exynos: fix a potential error pointer dereference Smatch reports the warning below: drivers/gpu/drm/exynos/exynos_hdmi.c:1864 hdmi_bind() error: 'crtc' dereferencing possible ERR_PTR() The return value of exynos_drm_crtc_get_by_type maybe ERR_PTR(-ENODEV), which can not be used directly. Fix this by checking the return value before using it. Signed-off-by: Xiang Yang Signed-off-by: Inki Dae commit b7c1e53751cb3990153084f31c41f25fde3b629c Author: Miquel Raynal Date: Fri Nov 24 20:38:14 2023 +0100 nvmem: Do not expect fixed layouts to grab a layout driver Two series lived in parallel for some time, which led to this situation: - The nvmem-layout container is used for dynamic layouts - We now expect fixed layouts to also use the nvmem-layout container but this does not require any additional driver, the support is built-in the nvmem core. Ensure we don't refuse to probe for wrong reasons. Fixes: 27f699e578b1 ("nvmem: core: add support for fixed cells *layout*") Cc: stable@vger.kernel.org Reported-by: Luca Ceresoli Signed-off-by: Miquel Raynal Tested-by: Rafał Miłecki Tested-by: Luca Ceresoli Reviewed-by: Luca Ceresoli Link: https://lore.kernel.org/r/20231124193814.360552-1-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman commit 1a031f6edc460e9562098bdedc3918da07c30a6e Author: Cameron Williams Date: Thu Nov 2 21:10:40 2023 +0000 parport: Add support for Brainboxes IX/UC/PX parallel cards Adds support for Intashield IX-500/IX-550, UC-146/UC-157, PX-146/PX-157, PX-203 and PX-475 (LPT port) Cc: stable@vger.kernel.org Signed-off-by: Cameron Williams Acked-by: Sudip Mukherjee Link: https://lore.kernel.org/r/AS4PR02MB790389C130410BD864C8DCC9C4A6A@AS4PR02MB7903.eurprd02.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit e92fad024929c79460403acf946bc9c09ce5c3a9 Author: Andy Shevchenko Date: Tue Dec 5 21:55:24 2023 +0200 serial: 8250_dw: Add ACPI ID for Granite Rapids-D UART Granite Rapids-D has an additional UART that is enumerated via ACPI. Add ACPI ID for it. Signed-off-by: Andy Shevchenko Cc: stable Link: https://lore.kernel.org/r/20231205195524.2705965-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit f0b9d97a77fa8f18400450713358303a435ab688 Author: Andi Shyti Date: Mon Dec 4 17:38:03 2023 +0100 serial: ma35d1: Validate console index before assignment The console is immediately assigned to the ma35d1 port without checking its index. This oversight can lead to out-of-bounds errors when the index falls outside the valid '0' to MA35_UART_NR range. Such scenario trigges ran error like the following: UBSAN: array-index-out-of-bounds in drivers/tty/serial/ma35d1_serial.c:555:51 index -1 is out of range for type 'uart_ma35d1_port [17] Check the index before using it and bail out with a warning. Fixes: 930cbf92db01 ("tty: serial: Add Nuvoton ma35d1 serial driver support") Signed-off-by: Andi Shyti Cc: Jacky Huang Cc: # v6.5+ Link: https://lore.kernel.org/r/20231204163804.1331415-2-andi.shyti@kernel.org Signed-off-by: Greg Kroah-Hartman commit 61890dc28f7d9e9aac8a9471302613824c22fae4 Author: Konstantin Aladyshev Date: Wed Dec 6 11:07:44 2023 +0300 usb: gadget: f_hid: fix report descriptor allocation The commit 89ff3dfac604 ("usb: gadget: f_hid: fix f_hidg lifetime vs cdev") has introduced a bug that leads to hid device corruption after the replug operation. Reverse device managed memory allocation for the report descriptor to fix the issue. Tested: This change was tested on the AMD EthanolX CRB server with the BMC based on the OpenBMC distribution. The BMC provides KVM functionality via the USB gadget device: - before: KVM page refresh results in a broken USB device, - after: KVM page refresh works without any issues. Fixes: 89ff3dfac604 ("usb: gadget: f_hid: fix f_hidg lifetime vs cdev") Cc: stable@vger.kernel.org Signed-off-by: Konstantin Aladyshev Link: https://lore.kernel.org/r/20231206080744.253-2-aladyshev22@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0c92218f4e7d4b4a7245d32bea042fa6f9cc39d7 Merge: b2f557a21bc8f 33cc938e65a98 Author: Andrew Morton Date: Wed Dec 6 17:03:50 2023 -0800 Merge branch 'master' into mm-hotfixes-stable commit b2f557a21bc8fffdcd65794eda8a854e024999f3 Author: Jiexun Wang Date: Thu Sep 21 20:27:51 2023 +0800 mm/madvise: add cond_resched() in madvise_cold_or_pageout_pte_range() I conducted real-time testing and observed that madvise_cold_or_pageout_pte_range() causes significant latency under memory pressure, which can be effectively reduced by adding cond_resched() within the loop. I tested on the LicheePi 4A board using Cylictest for latency testing and Ftrace for latency tracing. The board uses TH1520 processor and has a memory size of 8GB. The kernel version is 6.5.0 with the PREEMPT_RT patch applied. The script I tested is as follows: echo wakeup_rt > /sys/kernel/tracing/current_tracer echo 1 > /sys/kernel/tracing/tracing_on echo 0 > /sys/kernel/tracing/tracing_max_latency stress-ng --vm 8 --vm-bytes 2G & cyclictest --mlockall --smp --priority=99 --distance=0 --duration=30m echo 0 > /sys/kernel/tracing/tracing_on cat /sys/kernel/tracing/trace The tracing results before modification are as follows: # tracer: wakeup_rt # # wakeup_rt latency trace v1.1.5 on 6.5.0-rt6-r1208-00003-g999d221864bf # -------------------------------------------------------------------- # latency: 2552 us, #6/6, CPU#3 | (M:preempt_rt VP:0, KP:0, SP:0 HP:0 #P:4) # ----------------- # | task: cyclictest-196 (uid:0 nice:0 policy:1 rt_prio:99) # ----------------- # # _--------=> CPU# # / _-------=> irqs-off/BH-disabled # | / _------=> need-resched # || / _-----=> need-resched-lazy # ||| / _----=> hardirq/softirq # |||| / _---=> preempt-depth # ||||| / _--=> preempt-lazy-depth # |||||| / _-=> migrate-disable # ||||||| / delay # cmd pid |||||||| time | caller # \ / |||||||| \ | / stress-n-206 3dn.h512 2us : 206:120:R + [003] 196: 0:R cyclictest stress-n-206 3dn.h512 7us : => __ftrace_trace_stack => __trace_stack => probe_wakeup => ttwu_do_activate => try_to_wake_up => wake_up_process => hrtimer_wakeup => __hrtimer_run_queues => hrtimer_interrupt => riscv_timer_interrupt => handle_percpu_devid_irq => generic_handle_domain_irq => riscv_intc_irq => handle_riscv_irq => do_irq stress-n-206 3dn.h512 9us#: 0 stress-n-206 3d...3.. 2544us : __schedule stress-n-206 3d...3.. 2545us : 206:120:R ==> [003] 196: 0:R cyclictest stress-n-206 3d...3.. 2551us : => __ftrace_trace_stack => __trace_stack => probe_wakeup_sched_switch => __schedule => preempt_schedule => migrate_enable => rt_spin_unlock => madvise_cold_or_pageout_pte_range => walk_pgd_range => __walk_page_range => walk_page_range => madvise_pageout => madvise_vma_behavior => do_madvise => sys_madvise => do_trap_ecall_u => ret_from_exception The tracing results after modification are as follows: # tracer: wakeup_rt # # wakeup_rt latency trace v1.1.5 on 6.5.0-rt6-r1208-00004-gca3876fc69a6-dirty # -------------------------------------------------------------------- # latency: 1689 us, #6/6, CPU#0 | (M:preempt_rt VP:0, KP:0, SP:0 HP:0 #P:4) # ----------------- # | task: cyclictest-217 (uid:0 nice:0 policy:1 rt_prio:99) # ----------------- # # _--------=> CPU# # / _-------=> irqs-off/BH-disabled # | / _------=> need-resched # || / _-----=> need-resched-lazy # ||| / _----=> hardirq/softirq # |||| / _---=> preempt-depth # ||||| / _--=> preempt-lazy-depth # |||||| / _-=> migrate-disable # ||||||| / delay # cmd pid |||||||| time | caller # \ / |||||||| \ | / stress-n-232 0dn.h413 1us+: 232:120:R + [000] 217: 0:R cyclictest stress-n-232 0dn.h413 12us : => __ftrace_trace_stack => __trace_stack => probe_wakeup => ttwu_do_activate => try_to_wake_up => wake_up_process => hrtimer_wakeup => __hrtimer_run_queues => hrtimer_interrupt => riscv_timer_interrupt => handle_percpu_devid_irq => generic_handle_domain_irq => riscv_intc_irq => handle_riscv_irq => do_irq stress-n-232 0dn.h413 19us#: 0 stress-n-232 0d...3.. 1671us : __schedule stress-n-232 0d...3.. 1676us+: 232:120:R ==> [000] 217: 0:R cyclictest stress-n-232 0d...3.. 1687us : => __ftrace_trace_stack => __trace_stack => probe_wakeup_sched_switch => __schedule => preempt_schedule => migrate_enable => free_unref_page_list => release_pages => free_pages_and_swap_cache => tlb_batch_pages_flush => tlb_flush_mmu => unmap_page_range => unmap_vmas => unmap_region => do_vmi_align_munmap.constprop.0 => do_vmi_munmap => __vm_munmap => sys_munmap => do_trap_ecall_u => ret_from_exception After the modification, the cause of maximum latency is no longer madvise_cold_or_pageout_pte_range(), so this modification can reduce the latency caused by madvise_cold_or_pageout_pte_range(). Currently the madvise_cold_or_pageout_pte_range() function exhibits significant latency under memory pressure, which can be effectively reduced by adding cond_resched() within the loop. When the batch_count reaches SWAP_CLUSTER_MAX, we reschedule the task to ensure fairness and avoid long lock holding times. Link: https://lkml.kernel.org/r/85363861af65fac66c7a98c251906afc0d9c8098.1695291046.git.wangjiexun@tinylab.org Signed-off-by: Jiexun Wang Cc: Zhangjin Wu Signed-off-by: Andrew Morton commit 675abf8df1353e0e3bde314993e0796c524cfbf0 Author: Ryusuke Konishi Date: Tue Dec 5 17:59:47 2023 +0900 nilfs2: prevent WARNING in nilfs_sufile_set_segment_usage() If nilfs2 reads a disk image with corrupted segment usage metadata, and its segment usage information is marked as an error for the segment at the write location, nilfs_sufile_set_segment_usage() can trigger WARN_ONs during log writing. Segments newly allocated for writing with nilfs_sufile_alloc() will not have this error flag set, but this unexpected situation will occur if the segment indexed by either nilfs->ns_segnum or nilfs->ns_nextnum (active segment) was marked in error. Fix this issue by inserting a sanity check to treat it as a file system corruption. Since error returns are not allowed during the execution phase where nilfs_sufile_set_segment_usage() is used, this inserts the sanity check into nilfs_sufile_mark_dirty() which pre-reads the buffer containing the segment usage record to be updated and sets it up in a dirty state for writing. In addition, nilfs_sufile_set_segment_usage() is also called when canceling log writing and undoing segment usage update, so in order to avoid issuing the same kernel warning in that case, in case of cancellation, avoid checking the error flag in nilfs_sufile_set_segment_usage(). Link: https://lkml.kernel.org/r/20231205085947.4431-1-konishi.ryusuke@gmail.com Signed-off-by: Ryusuke Konishi Reported-by: syzbot+14e9f834f6ddecece094@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=14e9f834f6ddecece094 Tested-by: Ryusuke Konishi Cc: Signed-off-by: Andrew Morton commit 4a3ef6be03e6700037fc20e63aa5ffd972e435ca Author: Sidhartha Kumar Date: Mon Dec 4 10:32:34 2023 -0800 mm/hugetlb: have CONFIG_HUGETLB_PAGE select CONFIG_XARRAY_MULTI After commit a08c7193e4f1 "mm/filemap: remove hugetlb special casing in filemap.c", hugetlb pages are stored in the page cache in base page sized indexes. This leads to multi index stores in the xarray which is only supporting through CONFIG_XARRAY_MULTI. The other page cache user of multi index stores ,THP, selects XARRAY_MULTI. Have CONFIG_HUGETLB_PAGE follow this behavior as well to avoid the BUG() with a CONFIG_HUGETLB_PAGE && !CONFIG_XARRAY_MULTI config. Link: https://lkml.kernel.org/r/20231204183234.348697-1-sidhartha.kumar@oracle.com Fixes: a08c7193e4f1 ("mm/filemap: remove hugetlb special casing in filemap.c") Signed-off-by: Sidhartha Kumar Reported-by: Al Viro Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit 801a2b1b49f4dcf06703130922806e9c639c2ca8 Author: Florian Fainelli Date: Wed Nov 29 20:33:16 2023 -0800 scripts/gdb: fix lx-device-list-bus and lx-device-list-class After the conversion to bus_to_subsys() and class_to_subsys(), the gdb scripts listing the system buses and classes respectively was broken, fix those by returning the subsys_priv pointer and have the various caller de-reference either the 'bus' or 'class' structure members accordingly. Link: https://lkml.kernel.org/r/20231130043317.174188-1-florian.fainelli@broadcom.com Fixes: 7b884b7f24b4 ("driver core: class.c: convert to only use class_to_subsys") Signed-off-by: Florian Fainelli Tested-by: Kuan-Ying Lee Cc: Greg Kroah-Hartman Cc: Jan Kiszka Cc: Kieran Bingham Signed-off-by: Andrew Morton commit bc220fe70919d6500811e5e1e07aff43e137065a Author: Bagas Sanjaya Date: Thu Nov 30 15:38:48 2023 +0700 MAINTAINERS: drop Antti Palosaari He is currently inactive (last message from him is two years ago [1]). His media tree [2] is also dormant (latest activity is 6 years ago), yet his site is still online [3]. Drop him from MAINTAINERS and add CREDITS entry for him. We thank him for maintaining various DVB drivers. [1]: https://lore.kernel.org/all/660772b3-0597-02db-ed94-c6a9be04e8e8@iki.fi/ [2]: https://git.linuxtv.org/anttip/media_tree.git/ [3]: https://palosaari.fi/linux/ Link: https://lkml.kernel.org/r/20231130083848.5396-1-bagasdotme@gmail.com Signed-off-by: Bagas Sanjaya Acked-by: Antti Palosaari Cc: Hans Verkuil Cc: Lukas Bulwahn Cc: Mauro Carvalho Chehab Cc: Uwe Kleine-König Signed-off-by: Andrew Morton commit 73424d00dc63ba681856e06cfb0a5abbdb62e2b5 Author: Su Hui Date: Thu Nov 30 11:40:18 2023 +0800 highmem: fix a memory copy problem in memcpy_from_folio Clang static checker complains that value stored to 'from' is never read. And memcpy_from_folio() only copy the last chunk memory from folio to destination. Use 'to += chunk' to replace 'from += chunk' to fix this typo problem. Link: https://lkml.kernel.org/r/20231130034017.1210429-1-suhui@nfschina.com Fixes: b23d03ef7af5 ("highmem: add memcpy_to_folio() and memcpy_from_folio()") Signed-off-by: Su Hui Reviewed-by: Matthew Wilcox (Oracle) Cc: Ira Weiny Cc: Jiaqi Yan Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Peter Collingbourne Cc: Tom Rix Cc: Tony Luck Cc: Signed-off-by: Andrew Morton commit d61d0ab573649789bf9eb909c89a1a193b2e3d10 Author: Ryusuke Konishi Date: Wed Nov 29 23:15:47 2023 +0900 nilfs2: fix missing error check for sb_set_blocksize call When mounting a filesystem image with a block size larger than the page size, nilfs2 repeatedly outputs long error messages with stack traces to the kernel log, such as the following: getblk(): invalid block size 8192 requested logical block size: 512 ... Call Trace: dump_stack_lvl+0x92/0xd4 dump_stack+0xd/0x10 bdev_getblk+0x33a/0x354 __breadahead+0x11/0x80 nilfs_search_super_root+0xe2/0x704 [nilfs2] load_nilfs+0x72/0x504 [nilfs2] nilfs_mount+0x30f/0x518 [nilfs2] legacy_get_tree+0x1b/0x40 vfs_get_tree+0x18/0xc4 path_mount+0x786/0xa88 __ia32_sys_mount+0x147/0x1a8 __do_fast_syscall_32+0x56/0xc8 do_fast_syscall_32+0x29/0x58 do_SYSENTER_32+0x15/0x18 entry_SYSENTER_32+0x98/0xf1 ... This overloads the system logger. And to make matters worse, it sometimes crashes the kernel with a memory access violation. This is because the return value of the sb_set_blocksize() call, which should be checked for errors, is not checked. The latter issue is due to out-of-buffer memory being accessed based on a large block size that caused sb_set_blocksize() to fail for buffers read with the initial minimum block size that remained unupdated in the super_block structure. Since nilfs2 mkfs tool does not accept block sizes larger than the system page size, this has been overlooked. However, it is possible to create this situation by intentionally modifying the tool or by passing a filesystem image created on a system with a large page size to a system with a smaller page size and mounting it. Fix this issue by inserting the expected error handling for the call to sb_set_blocksize(). Link: https://lkml.kernel.org/r/20231129141547.4726-1-konishi.ryusuke@gmail.com Signed-off-by: Ryusuke Konishi Tested-by: Ryusuke Konishi Cc: Signed-off-by: Andrew Morton commit dccf78d39f1069a5ddf4328bf0c97aa5f2f4296e Author: Baoquan He Date: Tue Nov 28 13:44:57 2023 +0800 kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP Ignat Korchagin complained that a potential config regression was introduced by commit 89cde455915f ("kexec: consolidate kexec and crash options into kernel/Kconfig.kexec"). Before the commit, CONFIG_CRASH_DUMP has no dependency on CONFIG_KEXEC. After the commit, CRASH_DUMP selects KEXEC. That enforces system to have CONFIG_KEXEC=y as long as CONFIG_CRASH_DUMP=Y which people may not want. In Ignat's case, he sets CONFIG_CRASH_DUMP=y, CONFIG_KEXEC_FILE=y and CONFIG_KEXEC=n because kexec_load interface could have security issue if kernel/initrd has no chance to be signed and verified. CRASH_DUMP has select of KEXEC because Eric, author of above commit, met a LKP report of build failure when posting patch of earlier version. Please see below link to get detail of the LKP report: https://lore.kernel.org/all/3e8eecd1-a277-2cfb-690e-5de2eb7b988e@oracle.com/T/#u In fact, that LKP report is triggered because arm's is wrapped in CONFIG_KEXEC ifdeffery scope. That is wrong. CONFIG_KEXEC controls the enabling/disabling of kexec_load interface, but not kexec feature. Removing the wrongly added CONFIG_KEXEC ifdeffery scope in of arm allows us to drop the select KEXEC for CRASH_DUMP. Meanwhile, change arch/arm/kernel/Makefile to let machine_kexec.o relocate_kernel.o depend on KEXEC_CORE. Link: https://lkml.kernel.org/r/20231128054457.659452-1-bhe@redhat.com Fixes: 89cde455915f ("kexec: consolidate kexec and crash options into kernel/Kconfig.kexec") Signed-off-by: Baoquan He Reported-by: Ignat Korchagin Tested-by: Ignat Korchagin [compile-time only] Tested-by: Alexander Gordeev Reviewed-by: Eric DeVolder Tested-by: Eric DeVolder Signed-off-by: Andrew Morton commit 8e92157d7f6190c86bfd6144a409001469827100 Author: Andy Shevchenko Date: Tue Nov 28 19:44:03 2023 +0200 units: add missing header BITS_PER_BYTE is defined in bits.h. Link: https://lkml.kernel.org/r/20231128174404.393393-1-andriy.shevchenko@linux.intel.com Fixes: e8eed5f7366f ("units: Add BYTES_PER_*BIT") Signed-off-by: Andy Shevchenko Reviewed-by: Randy Dunlap Cc: Damian Muszynski Cc: Rasmus Villemoes Cc: Herbert Xu Signed-off-by: Andrew Morton commit 4e9e2e4c65136dfd32dd0afe555961433d1cf906 Author: Baoquan He Date: Tue Nov 28 13:52:48 2023 +0800 drivers/base/cpu: crash data showing should depends on KEXEC_CORE After commit 88a6f8994421 ("crash: memory and CPU hotplug sysfs attributes"), on x86_64, if only below kernel configs related to kdump are set, compiling error are triggered. ---- CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y CONFIG_CRASH_DUMP=y CONFIG_CRASH_HOTPLUG=y ------ ------------------------------------------------------ drivers/base/cpu.c: In function `crash_hotplug_show': drivers/base/cpu.c:309:40: error: implicit declaration of function `crash_hotplug_cpu_support'; did you mean `crash_hotplug_show'? [-Werror=implicit-function-declaration] 309 | return sysfs_emit(buf, "%d\n", crash_hotplug_cpu_support()); | ^~~~~~~~~~~~~~~~~~~~~~~~~ | crash_hotplug_show cc1: some warnings being treated as errors ------------------------------------------------------ CONFIG_KEXEC is used to enable kexec_load interface, the crash_notes/crash_notes_size/crash_hotplug showing depends on CONFIG_KEXEC is incorrect. It should depend on KEXEC_CORE instead. Fix it now. Link: https://lkml.kernel.org/r/20231128055248.659808-1-bhe@redhat.com Fixes: 88a6f8994421 ("crash: memory and CPU hotplug sysfs attributes") Signed-off-by: Baoquan He Tested-by: Ignat Korchagin [compile-time only] Tested-by: Alexander Gordeev Reviewed-by: Eric DeVolder Cc: Signed-off-by: Andrew Morton commit 7d6fa31a2fd7072376b3c8be66bf8527b2c8208c Author: SeongJae Park Date: Fri Nov 24 21:38:40 2023 +0000 mm/damon/sysfs-schemes: add timeout for update_schemes_tried_regions If a scheme is set to not applied to any monitoring target region for any reasons including the target access pattern, quota, filters, or watermarks, writing 'update_schemes_tried_regions' to 'state' DAMON sysfs file can indefinitely hang. Fix the case by implementing a timeout for the operation. The time limit is two apply intervals of each scheme. Link: https://lkml.kernel.org/r/20231124213840.39157-1-sj@kernel.org Fixes: 4d4e41b68299 ("mm/damon/sysfs-schemes: do not update tried regions more than one DAMON snapshot") Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 854f2764b5771e450b44e6a5fddb6872deb5bb56 Author: Kuan-Ying Lee Date: Mon Nov 27 15:04:01 2023 +0800 scripts/gdb/tasks: fix lx-ps command error Since commit 8e1f385104ac ("kill task_struct->thread_group") remove the thread_group, we will encounter below issue. (gdb) lx-ps TASK PID COMM 0xffff800086503340 0 swapper/0 Python Exception : There is no member named thread_group. Error occurred in Python: There is no member named thread_group. We use signal->thread_head to iterate all threads instead. [Kuan-Ying.Lee@mediatek.com: v2] Link: https://lkml.kernel.org/r/20231129065142.13375-2-Kuan-Ying.Lee@mediatek.com Link: https://lkml.kernel.org/r/20231127070404.4192-2-Kuan-Ying.Lee@mediatek.com Fixes: 8e1f385104ac ("kill task_struct->thread_group") Signed-off-by: Kuan-Ying Lee Acked-by: Oleg Nesterov Tested-by: Florian Fainelli Cc: AngeloGioacchino Del Regno Cc: Chinwen Chang Cc: Kuan-Ying Lee Cc: Matthias Brugger Cc: Qun-Wei Lin Cc: Andrey Konovalov Signed-off-by: Andrew Morton commit 97219cc358ad156ec5b170c2ed6f44278932c63c Author: Peter Xu Date: Thu Nov 23 17:42:04 2023 -0500 mm/Kconfig: make userfaultfd a menuconfig PTE_MARKER_UFFD_WP is a subconfig for userfaultfd. To make it clear, switch to use menuconfig for userfaultfd. Link: https://lkml.kernel.org/r/20231123224204.1060152-1-peterx@redhat.com Signed-off-by: Peter Xu Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: Mike Rapoport (IBM) Cc: Peter Xu Signed-off-by: Andrew Morton commit f39fb633fe9b9a4a7572ec32debf766d971a500b Author: Nico Pache Date: Mon Nov 20 15:29:08 2023 -0700 selftests/mm: prevent duplicate runs caused by TEST_GEN_PROGS Commit 05f1edac8009 ("selftests/mm: run all tests from run_vmtests.sh") fixed the inconsistency caused by tests being defined as TEST_GEN_PROGS. This issue was leading to tests not being executed via run_vmtests.sh and furthermore some tests running twice due to the kselftests wrapper also executing them. Fix the definition of two tests (soft-dirty and pagemap_ioctl) that are still incorrectly defined. Link: https://lkml.kernel.org/r/20231120222908.28559-1-npache@redhat.com Signed-off-by: Nico Pache Reviewed-by: David Hildenbrand Cc: Joel Savitz Cc: Shuah Khan Signed-off-by: Andrew Morton commit 1f3730fd9e8d4d77fb99c60d0e6ad4b1104e7e04 Author: SeongJae Park Date: Sun Nov 19 17:15:28 2023 +0000 mm/damon/core: copy nr_accesses when splitting region Regions split function ('damon_split_region_at()') is called at the beginning of an aggregation interval, and when DAMOS applying the actions and charging quota. Because 'nr_accesses' fields of all regions are reset at the beginning of each aggregation interval, and DAMOS was applying the action at the end of each aggregation interval, there was no need to copy the 'nr_accesses' field to the split-out region. However, commit 42f994b71404 ("mm/damon/core: implement scheme-specific apply interval") made DAMOS applies action on its own timing interval. Hence, 'nr_accesses' should also copied to split-out regions, but the commit didn't. Fix it by copying it. Link: https://lkml.kernel.org/r/20231119171529.66863-1-sj@kernel.org Fixes: 42f994b71404 ("mm/damon/core: implement scheme-specific apply interval") Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 0263f92fadbb9d294d5971ac57743f882c93b2b3 Author: Ming Lei Date: Mon Nov 20 16:35:59 2023 +0800 lib/group_cpus.c: avoid acquiring cpu hotplug lock in group_cpus_evenly group_cpus_evenly() could be part of storage driver's error handler, such as nvme driver, when may happen during CPU hotplug, in which storage queue has to drain its pending IOs because all CPUs associated with the queue are offline and the queue is becoming inactive. And handling IO needs error handler to provide forward progress. Then deadlock is caused: 1) inside CPU hotplug handler, CPU hotplug lock is held, and blk-mq's handler is waiting for inflight IO 2) error handler is waiting for CPU hotplug lock 3) inflight IO can't be completed in blk-mq's CPU hotplug handler because error handling can't provide forward progress. Solve the deadlock by not holding CPU hotplug lock in group_cpus_evenly(), in which two stage spreads are taken: 1) the 1st stage is over all present CPUs; 2) the end stage is over all other CPUs. Turns out the two stage spread just needs consistent 'cpu_present_mask', and remove the CPU hotplug lock by storing it into one local cache. This way doesn't change correctness, because all CPUs are still covered. Link: https://lkml.kernel.org/r/20231120083559.285174-1-ming.lei@redhat.com Signed-off-by: Ming Lei Reported-by: Yi Zhang Reported-by: Guangwu Zhang Tested-by: Guangwu Zhang Reviewed-by: Chengming Zhou Reviewed-by: Jens Axboe Cc: Keith Busch Cc: Signed-off-by: Andrew Morton commit ee34db3f271cea4d4252048617919c2caafe698b Author: Heiko Carstens Date: Mon Nov 20 19:37:17 2023 +0100 checkstack: fix printed address All addresses printed by checkstack have an extra incorrect 0 appended at the end. This was introduced with commit 677f1410e058 ("scripts/checkstack.pl: don't display $dre as different entity"): since then the address is taken from the line which contains the function name, instead of the line which contains stack consumption. E.g. on s390: 0000000000100a30 : ... 100a44: e3 f0 ff 70 ff 71 lay %r15,-144(%r15) So the used regex which matches spaces and hexadecimal numbers to extract an address now matches a different substring. Subsequently replacing spaces with 0 appends a zero at the and, instead of replacing leading spaces. Fix this by using the proper regex, and simplify the code a bit. Link: https://lkml.kernel.org/r/20231120183719.2188479-2-hca@linux.ibm.com Fixes: 677f1410e058 ("scripts/checkstack.pl: don't display $dre as different entity") Signed-off-by: Heiko Carstens Cc: Maninder Singh Cc: Masahiro Yamada Cc: Vaneet Narang Cc: Signed-off-by: Andrew Morton commit f42ce5f087eb69e47294ababd2e7e6f88a82d308 Author: Sumanth Korikkar Date: Mon Nov 20 15:53:53 2023 +0100 mm/memory_hotplug: fix error handling in add_memory_resource() In add_memory_resource(), creation of memory block devices occurs after successful call to arch_add_memory(). However, creation of memory block devices could fail. In that case, arch_remove_memory() is called to perform necessary cleanup. Currently with or without altmap support, arch_remove_memory() is always passed with altmap set to NULL during error handling. This leads to freeing of struct pages using free_pages(), eventhough the allocation might have been performed with altmap support via altmap_alloc_block_buf(). Fix the error handling by passing altmap in arch_remove_memory(). This ensures the following: * When altmap is disabled, deallocation of the struct pages array occurs via free_pages(). * When altmap is enabled, deallocation occurs via vmem_altmap_free(). Link: https://lkml.kernel.org/r/20231120145354.308999-3-sumanthk@linux.ibm.com Fixes: a08a2ae34613 ("mm,memory_hotplug: allocate memmap from the added memory range") Signed-off-by: Sumanth Korikkar Reviewed-by: Gerald Schaefer Acked-by: David Hildenbrand Cc: Alexander Gordeev Cc: Aneesh Kumar K.V Cc: Anshuman Khandual Cc: Heiko Carstens Cc: kernel test robot Cc: Michal Hocko Cc: Oscar Salvador Cc: Vasily Gorbik Cc: [5.15+] Signed-off-by: Andrew Morton commit 001002e73712cdf6b8d9a103648cda3040ad7647 Author: Sumanth Korikkar Date: Mon Nov 20 15:53:52 2023 +0100 mm/memory_hotplug: add missing mem_hotplug_lock From Documentation/core-api/memory-hotplug.rst: When adding/removing/onlining/offlining memory or adding/removing heterogeneous/device memory, we should always hold the mem_hotplug_lock in write mode to serialise memory hotplug (e.g. access to global/zone variables). mhp_(de)init_memmap_on_memory() functions can change zone stats and struct page content, but they are currently called w/o the mem_hotplug_lock. When memory block is being offlined and when kmemleak goes through each populated zone, the following theoretical race conditions could occur: CPU 0: | CPU 1: memory_offline() | -> offline_pages() | -> mem_hotplug_begin() | ... | -> mem_hotplug_done() | | kmemleak_scan() | -> get_online_mems() | ... -> mhp_deinit_memmap_on_memory() | [not protected by mem_hotplug_begin/done()]| Marks memory section as offline, | Retrieves zone_start_pfn poisons vmemmap struct pages and updates | and struct page members. the zone related data | | ... | -> put_online_mems() Fix this by ensuring mem_hotplug_lock is taken before performing mhp_init_memmap_on_memory(). Also ensure that mhp_deinit_memmap_on_memory() holds the lock. online/offline_pages() are currently only called from memory_block_online/offline(), so it is safe to move the locking there. Link: https://lkml.kernel.org/r/20231120145354.308999-2-sumanthk@linux.ibm.com Fixes: a08a2ae34613 ("mm,memory_hotplug: allocate memmap from the added memory range") Signed-off-by: Sumanth Korikkar Reviewed-by: Gerald Schaefer Acked-by: David Hildenbrand Cc: Alexander Gordeev Cc: Aneesh Kumar K.V Cc: Anshuman Khandual Cc: Heiko Carstens Cc: Michal Hocko Cc: Oscar Salvador Cc: Vasily Gorbik Cc: kernel test robot Cc: [5.15+] Signed-off-by: Andrew Morton commit c540b03828dff96e1b36e9e75714f0a8e807a92e Author: Chester Lin Date: Fri Nov 17 10:28:07 2023 +0800 .mailmap: add a new address mapping for Chester Lin My company email address is going to be disabled so let's create a mapping that links to my private/community email just in case people might still try to reach me via the old one. Link: https://lkml.kernel.org/r/20231117022807.29461-1-clin@suse.com Signed-off-by: Chester Lin Cc: Chester Lin Cc: Bjorn Andersson Cc: Greg Kroah-Hartman Cc: Heiko Stuebner Cc: Jakub Kicinski Cc: Konrad Dybcio Cc: Oleksij Rempel Cc: Stephen Hemminger Cc: Conor Dooley Cc: Matthias Brugger Signed-off-by: Andrew Morton commit 9aa1345d66b8132745ffb99b348b1492088da9e2 Author: Hugh Dickins Date: Fri Nov 17 00:49:18 2023 -0800 mm: fix oops when filemap_map_pmd() without prealloc_pte syzbot reports oops in lockdep's __lock_acquire(), called from __pte_offset_map_lock() called from filemap_map_pages(); or when I run the repro, the oops comes in pmd_install(), called from filemap_map_pmd() called from filemap_map_pages(), just before the __pte_offset_map_lock(). The problem is that filemap_map_pmd() has been assuming that when it finds pmd_none(), a page table has already been prepared in prealloc_pte; and indeed do_fault_around() has been careful to preallocate one there, when it finds pmd_none(): but what if *pmd became none in between? My 6.6 mods in mm/khugepaged.c, avoiding mmap_lock for write, have made it easy for *pmd to be cleared while servicing a page fault; but even before those, a huge *pmd might be zapped while a fault is serviced. The difference in symptomatic stack traces comes from the "memory model" in use: pmd_install() uses pmd_populate() uses page_to_pfn(): in some models that is strict, and will oops on the NULL prealloc_pte; in other models, it will construct a bogus value to be populated into *pmd, then __pte_offset_map_lock() oops when trying to access split ptlock pointer (or some other symptom in normal case of ptlock embedded not pointer). Link: https://lore.kernel.org/linux-mm/20231115065506.19780-1-jose.pekkarinen@foxhound.fi/ Link: https://lkml.kernel.org/r/6ed0c50c-78ef-0719-b3c5-60c0c010431c@google.com Fixes: f9ce0be71d1f ("mm: Cleanup faultaround and finish_fault() codepaths") Signed-off-by: Hugh Dickins Reported-and-tested-by: syzbot+89edd67979b52675ddec@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-mm/0000000000005e44550608a0806c@google.com/ Reviewed-by: David Hildenbrand Cc: Jann Horn , Cc: José Pekkarinen Cc: Kirill A. Shutemov Cc: Matthew Wilcox (Oracle) Cc: [5.12+] Signed-off-by: Andrew Morton commit eb66b8abae98f869c224f7c852b685ae02144564 Author: Lizhi Xu Date: Thu Nov 16 11:13:52 2023 +0800 squashfs: squashfs_read_data need to check if the length is 0 When the length passed in is 0, the pagemap_scan_test_walk() caller should bail. This error causes at least a WARN_ON(). Link: https://lkml.kernel.org/r/20231116031352.40853-1-lizhi.xu@windriver.com Reported-by: syzbot+32d3767580a1ea339a81@syzkaller.appspotmail.com Closes: https://lkml.kernel.org/r/0000000000000526f2060a30a085@google.com Signed-off-by: Lizhi Xu Reviewed-by: Phillip Lougher Signed-off-by: Andrew Morton commit 3f3cac5c0a5c3b09bdfb919a7518dca83523a52c Author: Peter Xu Date: Thu Nov 16 15:15:47 2023 -0500 mm/selftests: fix pagemap_ioctl memory map test __FILE__ is not guaranteed to exist in current dir. Replace that with argv[0] for memory map test. Link: https://lkml.kernel.org/r/20231116201547.536857-4-peterx@redhat.com Fixes: 46fd75d4a3c9 ("selftests: mm: add pagemap ioctl tests") Signed-off-by: Peter Xu Reviewed-by: David Hildenbrand Cc: Andrei Vagin Cc: David Hildenbrand Cc: Muhammad Usama Anjum Signed-off-by: Andrew Morton commit 4980e837cab7e2acc4dad18dba656c6896c531aa Author: Peter Xu Date: Thu Nov 16 15:15:46 2023 -0500 mm/pagemap: fix wr-protect even if PM_SCAN_WP_MATCHING not set The new pagemap ioctl contains a fast path for wr-protections without looking into category masks. It forgets to check PM_SCAN_WP_MATCHING before applying the wr-protections. It can cause, e.g., pte markers installed on archs that do not even support uffd wr-protect. WARNING: CPU: 0 PID: 5059 at mm/memory.c:1520 zap_pte_range mm/memory.c:1520 [inline] Link: https://lkml.kernel.org/r/20231116201547.536857-3-peterx@redhat.com Fixes: 12f6b01a0bcb ("fs/proc/task_mmu: add fast paths to get/clear PAGE_IS_WRITTEN flag") Signed-off-by: Peter Xu Reported-by: syzbot+7ca4b2719dc742b8d0a4@syzkaller.appspotmail.com Reviewed-by: David Hildenbrand Reviewed-by: Andrei Vagin Cc: Muhammad Usama Anjum Signed-off-by: Andrew Morton commit 0dff1b407def32452a0d80148172889862c64fe7 Author: Peter Xu Date: Thu Nov 16 15:15:45 2023 -0500 mm/pagemap: fix ioctl(PAGEMAP_SCAN) on vma check Patch series "mm/pagemap: A few fixes to the recent PAGEMAP_SCAN". This series should fix two known reports from syzbot on the new PAGEMAP_SCAN ioctl(): https://lore.kernel.org/all/000000000000b0e576060a30ee3b@google.com/ https://lore.kernel.org/all/000000000000773fa7060a31e2cc@google.com/ The 3rd patch is something I found when testing these patches. This patch (of 3): The new ioctl(PAGEMAP_SCAN) relies on vma wr-protect capability provided by userfault, however in the vma test it didn't explicitly require the vma to have wr-protect function enabled, even if PM_SCAN_WP_MATCHING flag is set. It means the pagemap code can now apply uffd-wp bit to a page in the vma even if not registered to userfaultfd at all. Then in whatever way as long as the pte got written and page fault resolved, we'll apply the write bit even if uffd-wp bit is set. We'll see a pte that has both UFFD_WP and WRITE bit set. Anything later that looks up the pte for uffd-wp bit will trigger the warning: WARNING: CPU: 1 PID: 5071 at arch/x86/include/asm/pgtable.h:403 pte_uffd_wp arch/x86/include/asm/pgtable.h:403 [inline] Fix it by doing proper check over the vma attributes when PM_SCAN_WP_MATCHING is specified. Link: https://lkml.kernel.org/r/20231116201547.536857-1-peterx@redhat.com Link: https://lkml.kernel.org/r/20231116201547.536857-2-peterx@redhat.com Fixes: 52526ca7fdb9 ("fs/proc/task_mmu: implement IOCTL to get and optionally clear info about PTEs") Signed-off-by: Peter Xu Reported-by: syzbot+e94c5aaf7890901ebf9b@syzkaller.appspotmail.com Reviewed-by: David Hildenbrand Reviewed-by: Andrei Vagin Reviewed-by: Muhammad Usama Anjum Signed-off-by: Andrew Morton commit 5f79489a73d77419d18952e0258efbd5ecb74770 Author: Roman Gushchin Date: Wed Nov 15 18:51:09 2023 -0800 mm: kmem: properly initialize local objcg variable in current_obj_cgroup() Erhard reported that the 6.7-rc1 kernel panics on boot if being built with clang-16. The problem was not reproducible with gcc. [ 5.975049] general protection fault, probably for non-canonical address 0xf555515555555557: 0000 [#1] SMP KASAN PTI [ 5.976422] KASAN: maybe wild-memory-access in range [0xaaaaaaaaaaaaaab8-0xaaaaaaaaaaaaaabf] [ 5.977475] CPU: 3 PID: 1 Comm: systemd Not tainted 6.7.0-rc1-Zen3 #77 [ 5.977860] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 [ 5.977860] RIP: 0010:obj_cgroup_charge_pages+0x27/0x2d5 [ 5.977860] Code: 90 90 90 55 41 57 41 56 41 55 41 54 53 89 d5 41 89 f6 49 89 ff 48 b8 00 00 00 00 00 fc ff df 49 83 c7 10 4d3 [ 5.977860] RSP: 0018:ffffc9000001fb18 EFLAGS: 00010a02 [ 5.977860] RAX: dffffc0000000000 RBX: aaaaaaaaaaaaaaaa RCX: ffff8883eb9a8b08 [ 5.977860] RDX: 0000000000000005 RSI: 0000000000400cc0 RDI: aaaaaaaaaaaaaaaa [ 5.977860] RBP: 0000000000000005 R08: 3333333333333333 R09: 0000000000000000 [ 5.977860] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8883eb9a8b18 [ 5.977860] R13: 1555555555555557 R14: 0000000000400cc0 R15: aaaaaaaaaaaaaaba [ 5.977860] FS: 00007f2976438b40(0000) GS:ffff8883eb980000(0000) knlGS:0000000000000000 [ 5.977860] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5.977860] CR2: 00007f29769e0060 CR3: 0000000107222003 CR4: 0000000000370eb0 [ 5.977860] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 5.977860] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 5.977860] Call Trace: [ 5.977860] [ 5.977860] ? __die_body+0x16/0x75 [ 5.977860] ? die_addr+0x4a/0x70 [ 5.977860] ? exc_general_protection+0x1c9/0x2d0 [ 5.977860] ? cgroup_mkdir+0x455/0x9fb [ 5.977860] ? __x64_sys_mkdir+0x69/0x80 [ 5.977860] ? asm_exc_general_protection+0x26/0x30 [ 5.977860] ? obj_cgroup_charge_pages+0x27/0x2d5 [ 5.977860] obj_cgroup_charge+0x114/0x1ab [ 5.977860] pcpu_alloc+0x1a6/0xa65 [ 5.977860] ? mem_cgroup_css_alloc+0x1eb/0x1140 [ 5.977860] ? cgroup_apply_control_enable+0x26b/0x7c0 [ 5.977860] mem_cgroup_css_alloc+0x23f/0x1140 [ 5.977860] cgroup_apply_control_enable+0x26b/0x7c0 [ 5.977860] ? cgroup_kn_set_ugid+0x2d/0x1a0 [ 5.977860] cgroup_mkdir+0x455/0x9fb [ 5.977860] ? __cfi_cgroup_mkdir+0x10/0x10 [ 5.977860] kernfs_iop_mkdir+0x130/0x170 [ 5.977860] vfs_mkdir+0x405/0x530 [ 5.977860] do_mkdirat+0x188/0x1f0 [ 5.977860] __x64_sys_mkdir+0x69/0x80 [ 5.977860] do_syscall_64+0x7d/0x100 [ 5.977860] ? do_syscall_64+0x89/0x100 [ 5.977860] ? do_syscall_64+0x89/0x100 [ 5.977860] ? do_syscall_64+0x89/0x100 [ 5.977860] ? do_syscall_64+0x89/0x100 [ 5.977860] entry_SYSCALL_64_after_hwframe+0x4b/0x53 [ 5.977860] RIP: 0033:0x7f297671defb [ 5.977860] Code: 8b 05 39 7f 0d 00 bb ff ff ff ff 64 c7 00 16 00 00 00 e9 61 ff ff ff e8 23 0c 02 00 0f 1f 00 f3 0f 1e fa b88 [ 5.977860] RSP: 002b:00007ffee6242bb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000053 [ 5.977860] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f297671defb [ 5.977860] RDX: 0000000000000000 RSI: 00000000000001ed RDI: 000055c6b449f0e0 [ 5.977860] RBP: 00007ffee6242bf0 R08: 000000000000000e R09: 0000000000000000 [ 5.977860] R10: 0000000000000000 R11: 0000000000000246 R12: 000055c6b445db80 [ 5.977860] R13: 00000000000003a0 R14: 00007f2976a68651 R15: 00000000000003a0 [ 5.977860] [ 5.977860] Modules linked in: [ 6.014095] ---[ end trace 0000000000000000 ]--- [ 6.014701] RIP: 0010:obj_cgroup_charge_pages+0x27/0x2d5 [ 6.015348] Code: 90 90 90 55 41 57 41 56 41 55 41 54 53 89 d5 41 89 f6 49 89 ff 48 b8 00 00 00 00 00 fc ff df 49 83 c7 10 4d3 [ 6.017575] RSP: 0018:ffffc9000001fb18 EFLAGS: 00010a02 [ 6.018255] RAX: dffffc0000000000 RBX: aaaaaaaaaaaaaaaa RCX: ffff8883eb9a8b08 [ 6.019120] RDX: 0000000000000005 RSI: 0000000000400cc0 RDI: aaaaaaaaaaaaaaaa [ 6.019983] RBP: 0000000000000005 R08: 3333333333333333 R09: 0000000000000000 [ 6.020849] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8883eb9a8b18 [ 6.021747] R13: 1555555555555557 R14: 0000000000400cc0 R15: aaaaaaaaaaaaaaba [ 6.022609] FS: 00007f2976438b40(0000) GS:ffff8883eb980000(0000) knlGS:0000000000000000 [ 6.023593] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 6.024296] CR2: 00007f29769e0060 CR3: 0000000107222003 CR4: 0000000000370eb0 [ 6.025279] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 6.026139] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 6.027000] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b Actually the problem is caused by uninitialized local variable in current_obj_cgroup(). If the root memory cgroup is set as an active memory cgroup for a charging scope (as in the trace, where systemd tries to create the first non-root cgroup, so the parent cgroup is the root cgroup), the "for" loop is skipped and uninitialized objcg is returned, causing a panic down the accounting stack. The fix is trivial: initialize the objcg variable to NULL unconditionally before the "for" loop. [vbabka@suse.cz: remove redundant assignment] Link: https://lkml.kernel.org/r/4bd106d5-c3e3-6731-9a74-cff81e2392de@suse.cz Link: https://lkml.kernel.org/r/20231116025109.3775055-1-roman.gushchin@linux.dev Fixes: e86828e5446d ("mm: kmem: scoped objcg protection") Signed-off-by: Roman Gushchin (Cruise) Signed-off-by: Vlastimil Babka Reported-by: Erhard Furtner Closes: https://github.com/ClangBuiltLinux/linux/issues/1959 Tested-by: Erhard Furtner Acked-by: Vlastimil Babka Acked-by: Shakeel Butt Cc: David Rientjes Cc: Dennis Zhou Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Signed-off-by: Andrew Morton commit d63385a7d3099fedf201b0263282aebf9f9af3e8 Author: Liu Shixin Date: Wed Nov 15 16:21:38 2023 +0800 mm/kmemleak: move set_track_prepare() outside raw_spinlocks set_track_prepare() will call __alloc_pages() which attempts to acquire zone->lock(spinlocks), so move it outside object->lock(raw_spinlocks) because it's not right to acquire spinlocks while holding raw_spinlocks in RT mode. Link: https://lkml.kernel.org/r/20231115082138.2649870-3-liushixin2@huawei.com Signed-off-by: Liu Shixin Acked-by: Catalin Marinas Cc: Geert Uytterhoeven Cc: Kefeng Wang Cc: Patrick Wang Signed-off-by: Andrew Morton commit 4eff7d62abdeb293233fdda2a2ecc4e0907a9a30 Author: Liu Shixin Date: Wed Nov 15 16:21:37 2023 +0800 Revert "mm/kmemleak: move the initialisation of object to __link_object" Patch series "Fix invalid wait context of set_track_prepare()". Geert reported an invalid wait context[1] which is resulted by moving set_track_prepare() inside kmemleak_lock. This is not allowed because in RT mode, the spinlocks can be preempted but raw_spinlocks can not, so it is not allowd to acquire spinlocks while holding raw_spinlocks. The second patch fix same problem in kmemleak_update_trace(). This patch (of 2): Move the initialisation of object back to__alloc_object() because set_track_prepare() attempt to acquire zone->lock(spinlocks) while __link_object is holding kmemleak_lock(raw_spinlocks). This is not right for RT mode. This reverts commit 245245c2fffd00 ("mm/kmemleak: move the initialisation of object to __link_object"). Link: https://lkml.kernel.org/r/20231115082138.2649870-1-liushixin2@huawei.com Link: https://lkml.kernel.org/r/20231115082138.2649870-2-liushixin2@huawei.com Fixes: 245245c2fffd ("mm/kmemleak: move the initialisation of object to __link_object") Signed-off-by: Liu Shixin Reported-by: Geert Uytterhoeven Closes: https://lore.kernel.org/linux-mm/CAMuHMdWj0UzwNaxUvcocTfh481qRJpOWwXxsJCTJfu1oCqvgdA@mail.gmail.com/ [1] Acked-by: Catalin Marinas Cc: Kefeng Wang Cc: Patrick Wang Signed-off-by: Andrew Morton commit 727d16f1993bcf46ee2888c13e3fc1463babed8d Author: Andrew Morton Date: Wed Nov 15 13:54:18 2023 -0800 mm/memory.c:zap_pte_range() print bad swap entry We have a report of this WARN() triggering. Let's print the offending swp_entry_t to help diagnosis. Link: https://lkml.kernel.org/r/000000000000b0e576060a30ee3b@google.com Cc: Muhammad Usama Anjum Signed-off-by: Andrew Morton commit 187da0f8250aa94bd96266096aef6f694e0b4cd2 Author: Mike Kravetz Date: Mon Nov 13 17:20:33 2023 -0800 hugetlb: fix null-ptr-deref in hugetlb_vma_lock_write The routine __vma_private_lock tests for the existence of a reserve map associated with a private hugetlb mapping. A pointer to the reserve map is in vma->vm_private_data. __vma_private_lock was checking the pointer for NULL. However, it is possible that the low bits of the pointer could be used as flags. In such instances, vm_private_data is not NULL and not a valid pointer. This results in the null-ptr-deref reported by syzbot: general protection fault, probably for non-canonical address 0xdffffc000000001d: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x00000000000000e8-0x00000000000000ef] CPU: 0 PID: 5048 Comm: syz-executor139 Not tainted 6.6.0-rc7-syzkaller-00142-g88 8cf78c29e2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 1 0/09/2023 RIP: 0010:__lock_acquire+0x109/0x5de0 kernel/locking/lockdep.c:5004 ... Call Trace: lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 down_write+0x93/0x200 kernel/locking/rwsem.c:1573 hugetlb_vma_lock_write mm/hugetlb.c:300 [inline] hugetlb_vma_lock_write+0xae/0x100 mm/hugetlb.c:291 __hugetlb_zap_begin+0x1e9/0x2b0 mm/hugetlb.c:5447 hugetlb_zap_begin include/linux/hugetlb.h:258 [inline] unmap_vmas+0x2f4/0x470 mm/memory.c:1733 exit_mmap+0x1ad/0xa60 mm/mmap.c:3230 __mmput+0x12a/0x4d0 kernel/fork.c:1349 mmput+0x62/0x70 kernel/fork.c:1371 exit_mm kernel/exit.c:567 [inline] do_exit+0x9ad/0x2a20 kernel/exit.c:861 __do_sys_exit kernel/exit.c:991 [inline] __se_sys_exit kernel/exit.c:989 [inline] __x64_sys_exit+0x42/0x50 kernel/exit.c:989 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Mask off low bit flags before checking for NULL pointer. In addition, the reserve map only 'belongs' to the OWNER (parent in parent/child relationships) so also check for the OWNER flag. Link: https://lkml.kernel.org/r/20231114012033.259600-1-mike.kravetz@oracle.com Reported-by: syzbot+6ada951e7c0f7bc8a71e@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-mm/00000000000078d1e00608d7878b@google.com/ Fixes: bf4916922c60 ("hugetlbfs: extend hugetlb_vma_lock to private VMAs") Signed-off-by: Mike Kravetz Reviewed-by: Rik van Riel Cc: Edward Adam Davis Cc: Muchun Song Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Cc: Signed-off-by: Andrew Morton commit b197d16669831d3e3240e2b6a3e4f9cf0331d58e Author: Andrew Morton Date: Tue Nov 14 15:02:04 2023 -0800 MAINTAINERS: add Andrew Morton for lib/* Add myself as the fallthough maintainer for material under lib/. Cc: Joe Perches Signed-off-by: Andrew Morton commit a0ffa8115e1ea9786b03edc3f431d2f4ef3e7a2e Author: Ricardo Rivera-Matos Date: Wed Dec 6 10:03:18 2023 -0600 ASoC: cs35l45: Prevents spinning during runtime suspend Masks the "DSP Virtual Mailbox 2 write" interrupt when before issuing the hibernate command to the DSP. The interrupt is unmasked when exiting runtime suspend as it is required for DSP operation. Without this change the DSP fires an interrupt when hibernating causing the system spin between runtime suspend and runtime resume. Signed-off-by: Ricardo Rivera-Matos Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20231206160318.1255034-4-rriveram@opensource.cirrus.com Signed-off-by: Mark Brown commit c3c8b088949b9ccb88da2f84d3c3cc06580a6a43 Author: Ricardo Rivera-Matos Date: Wed Dec 6 10:03:17 2023 -0600 ASoC: cs35l45: Prevent IRQ handling when suspending/resuming Use the SYSTEM_SLEEP_PM_OPS handlers to prevent handling an IRQ when the system is in the middle of suspending or resuming. Signed-off-by: Ricardo Rivera-Matos Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20231206160318.1255034-3-rriveram@opensource.cirrus.com Signed-off-by: Mark Brown commit 12e102b1bd22ee00361559d57a5876445bcb2407 Author: Ricardo Rivera-Matos Date: Wed Dec 6 10:03:16 2023 -0600 ASoC: cs35l45: Use modern pm_ops Make use of the recently introduced EXPORT_GPL_DEV_PM_OPS() macro, to conditionally export the runtime/system PM functions. Replace the old SET_{RUNTIME,SYSTEM_SLEEP,NOIRQ_SYSTEM_SLEEP}_PM_OPS() helpers with their modern alternatives and get rid of the now unnecessary '__maybe_unused' annotations on all PM functions. Additionally, use the pm_ptr() macro to fix the following errors when building with CONFIG_PM disabled: Signed-off-by: Ricardo Rivera-Matos Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20231206160318.1255034-2-rriveram@opensource.cirrus.com Signed-off-by: Mark Brown commit e59728883943c6820a0aa413db66a38f2e8c27bd Author: Daniel Hill Date: Wed Dec 6 21:26:00 2023 +1300 bcachefs: rebalance shouldn't attempt to compress unwritten extents This fixes a bug where rebalance would loop repeatedly on the same extents. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 136c6531ba12e4a658376387e355a09c9b5223e5 Author: Fabio Estevam Date: Wed Dec 6 06:36:43 2023 -0300 dt-bindings: display: adi,adv75xx: Document #sound-dai-cells When using audio from ADV7533 or ADV7535 and describing the audio card via simple-audio-card, the '#sound-dai-cells' needs to be passed. Document the '#sound-dai-cells' property to fix the following dt-schema warning: imx8mn-beacon-kit.dtb: hdmi@3d: '#sound-dai-cells' does not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/display/bridge/adi,adv7533.yaml# Signed-off-by: Fabio Estevam Acked-by: Adam Ford Link: https://lore.kernel.org/r/20231206093643.2198562-1-festevam@gmail.com Signed-off-by: Rob Herring commit b6c7ca4d7966c9d6e3deaefa896666cd5f8e2d8d Author: Fabio Estevam Date: Wed Dec 6 08:23:37 2023 -0300 dt-bindings: lcdif: Properly describe the i.MX23 interrupts i.MX23 has two LCDIF interrupts instead of a single one like other i.MX devices. Take this into account for properly describing the i.MX23 LCDIF interrupts. This fixes the following dt-schema warning: imx23-olinuxino.dtb: lcdif@80030000: interrupts: [[46], [45]] is too long from schema $id: http://devicetree.org/schemas/display/fsl,lcdif.yaml# Signed-off-by: Fabio Estevam Reviewed-by: Marek Vasut Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231206112337.2234849-1-festevam@gmail.com Signed-off-by: Rob Herring commit 7d2affce33209662f5a0b3b0fe60f41b948c279a Merge: a134cd8dfb8cd f52f5c71f3d4b Author: Jens Axboe Date: Wed Dec 6 15:31:58 2023 -0700 Merge tag 'md-fixes-20231206' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-6.7 Pull MD fixes from Song: "This set from Yu Kuai fixes issues around sync_work, which was introduced in 6.7 kernels." * tag 'md-fixes-20231206' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: fix stopping sync thread md: don't leave 'MD_RECOVERY_FROZEN' in error path of md_set_readonly() md: fix missing flush of sync_work commit ffed24eff9e0e52d8e74df1c18db8ed43b4666e6 Author: Jiri Olsa Date: Wed Dec 6 09:30:41 2023 +0100 selftests/bpf: Add test for early update in prog_array_map_poke_run Adding test that tries to trigger the BUG_IN during early map update in prog_array_map_poke_run function. The idea is to share prog array map between thread that constantly updates it and another one loading a program that uses that prog array. Eventually we will hit a place where the program is ok to be updated (poke->tailcall_target_stable check) but the address is still not registered in kallsyms, so the bpf_arch_text_poke returns -EINVAL and cause imbalance for the next tail call update check, which will fail with -EBUSY in bpf_arch_text_poke as described in previous fix. Signed-off-by: Jiri Olsa Signed-off-by: Daniel Borkmann Acked-by: Ilya Leoshkevich Link: https://lore.kernel.org/bpf/20231206083041.1306660-3-jolsa@kernel.org commit 4b7de801606e504e69689df71475d27e35336fb3 Author: Jiri Olsa Date: Wed Dec 6 09:30:40 2023 +0100 bpf: Fix prog_array_map_poke_run map poke update Lee pointed out issue found by syscaller [0] hitting BUG in prog array map poke update in prog_array_map_poke_run function due to error value returned from bpf_arch_text_poke function. There's race window where bpf_arch_text_poke can fail due to missing bpf program kallsym symbols, which is accounted for with check for -EINVAL in that BUG_ON call. The problem is that in such case we won't update the tail call jump and cause imbalance for the next tail call update check which will fail with -EBUSY in bpf_arch_text_poke. I'm hitting following race during the program load: CPU 0 CPU 1 bpf_prog_load bpf_check do_misc_fixups prog_array_map_poke_track map_update_elem bpf_fd_array_map_update_elem prog_array_map_poke_run bpf_arch_text_poke returns -EINVAL bpf_prog_kallsyms_add After bpf_arch_text_poke (CPU 1) fails to update the tail call jump, the next poke update fails on expected jump instruction check in bpf_arch_text_poke with -EBUSY and triggers the BUG_ON in prog_array_map_poke_run. Similar race exists on the program unload. Fixing this by moving the update to bpf_arch_poke_desc_update function which makes sure we call __bpf_arch_text_poke that skips the bpf address check. Each architecture has slightly different approach wrt looking up bpf address in bpf_arch_text_poke, so instead of splitting the function or adding new 'checkip' argument in previous version, it seems best to move the whole map_poke_run update as arch specific code. [0] https://syzkaller.appspot.com/bug?extid=97a4fe20470e9bc30810 Fixes: ebf7d1f508a7 ("bpf, x64: rework pro/epilogue and tailcall handling in JIT") Reported-by: syzbot+97a4fe20470e9bc30810@syzkaller.appspotmail.com Signed-off-by: Jiri Olsa Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Cc: Lee Jones Cc: Maciej Fijalkowski Link: https://lore.kernel.org/bpf/20231206083041.1306660-2-jolsa@kernel.org commit e85a0adacf170634878fffcbf34b725aff3f49ed Author: Boris Burkov Date: Fri Dec 1 13:00:13 2023 -0800 btrfs: ensure releasing squota reserve on head refs A reservation goes through a 3 step lifetime: - generated during delalloc - released/counted by ordered_extent allocation - freed by running delayed ref That third step depends on must_insert_reserved on the head ref, so the head ref with that field set owns the reservation. Once you prepare to run the head ref, must_insert_reserved is unset, which means that running the ref must free the reservation, whether or not it succeeds, or else the reservation is leaked. That results in either a risk of spurious ENOSPC if the fs stays writeable or a warning on unmount if it is readonly. The existing squota code was aware of these invariants, but missed a few cases. Improve it by adding a helper function to use in the cleanup paths and call it from the existing early returns in running delayed refs. This also simplifies btrfs_record_squota_delta and struct btrfs_quota_delta. This fixes (or at least improves the reliability of) generic/475 with "mkfs -O squota". On my machine, that test failed ~4/10 times without this patch and passed 100/100 times with it. Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit a86805504b88f636a6458520d85afdf0634e3c6b Author: Boris Burkov Date: Fri Dec 1 13:00:12 2023 -0800 btrfs: don't clear qgroup reserved bit in release_folio The EXTENT_QGROUP_RESERVED bit is used to "lock" regions of the file for duplicate reservations. That is two writes to that range in one transaction shouldn't create two reservations, as the reservation will only be freed once when the write finally goes down. Therefore, it is never OK to clear that bit without freeing the associated qgroup reserve. At this point, we don't want to be freeing the reserve, so mask off the bit. CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Qu Wenruo Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit b321a52cce062ec7ed385333a33905d22159ce36 Author: Boris Burkov Date: Fri Dec 1 13:00:11 2023 -0800 btrfs: free qgroup pertrans reserve on transaction abort If we abort a transaction, we never run the code that frees the pertrans qgroup reservation. This results in warnings on unmount as that reservation has been leaked. The leak isn't a huge issue since the fs is read-only, but it's better to clean it up when we know we can/should. Do it during the cleanup_transaction step of aborting. CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Qu Wenruo Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 9e65bfca24cf1d77e4a5c7a170db5867377b3fe7 Author: Boris Burkov Date: Fri Dec 1 13:00:10 2023 -0800 btrfs: fix qgroup_free_reserved_data int overflow The reserved data counter and input parameter is a u64, but we inadvertently accumulate it in an int. Overflowing that int results in freeing the wrong amount of data and breaking reserve accounting. Unfortunately, this overflow rot spreads from there, as the qgroup release/free functions rely on returning an int to take advantage of negative values for error codes. Therefore, the full fix is to return the "released" or "freed" amount by a u64 argument and to return 0 or negative error code via the return value. Most of the call sites simply ignore the return value, though some of them handle the error and count the returned bytes. Change all of them accordingly. CC: stable@vger.kernel.org # 6.1+ Reviewed-by: Qu Wenruo Signed-off-by: Boris Burkov Reviewed-by: David Sterba Signed-off-by: David Sterba commit f63e1164b90b385cd832ff0fdfcfa76c3cc15436 Author: Boris Burkov Date: Fri Dec 1 13:00:09 2023 -0800 btrfs: free qgroup reserve when ORDERED_IOERR is set An ordered extent completing is a critical moment in qgroup reserve handling, as the ownership of the reservation is handed off from the ordered extent to the delayed ref. In the happy path we release (unlock) but do not free (decrement counter) the reservation, and the delayed ref drives the free. However, on an error, we don't create a delayed ref, since there is no ref to add. Therefore, free on the error path. CC: stable@vger.kernel.org # 6.1+ Reviewed-by: Qu Wenruo Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit dab96d8b61aab1a4f99d0b86964a6c40e7bb1756 Author: Alex Deucher Date: Wed Nov 29 15:44:25 2023 -0500 drm/amdgpu: fix buffer funcs setting order on suspend We need to disable this after the last eviction call, but before we disable the SDMA IP. Fixes: b70438004a14 ("drm/amdgpu: move buffer funcs setting up a level") Link: https://lore.kernel.org/r/87edgv4x3i.fsf@vps.thesusis.net Reviewed-by: Luben Tuikov Tested-by: Phillip Susi Signed-off-by: Alex Deucher Cc: Phillip Susi Cc: Luben Tuikov commit 27b024a88acba17c8e3a71ff4fd425064851e3b7 Author: Lijo Lazar Date: Thu Nov 30 16:35:58 2023 +0530 drm/amdgpu: Avoid querying DRM MGCG status MP0 v13.0.6 SOCs don't support DRM MGCG. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 555e39f0270b1a1c51224044be9922b4c3a4c27f Author: Lijo Lazar Date: Thu Nov 30 15:58:21 2023 +0530 drm/amdgpu: Update HDP 4.4.2 clock gating flags HDP 4.4.2 clockgating is enabled by default, update the flags accordingly. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 81577503efb49f4ad76af22f9941d72900ef4aab Author: Lijo Lazar Date: Wed Nov 29 12:37:34 2023 +0530 drm/amdgpu: Add NULL checks for function pointers Check if function is implemented before making the call. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 6fce23a4d8c5f93bf80b7f122449fbb97f1e40dd Author: Lijo Lazar Date: Wed Nov 29 18:06:55 2023 +0530 drm/amdgpu: Restrict extended wait to PSP v13.0.6 Only PSPv13.0.6 SOCs take a longer time to reach steady state. Other PSPv13 based SOCs don't need extended wait. Also, reduce PSPv13.0.6 wait time. Cc: stable@vger.kernel.org Fixes: fc5988907156 ("drm/amdgpu: update retry times for psp vmbx wait") Fixes: d8c1925ba8cd ("drm/amdgpu: update retry times for psp BL wait") Link: https://lore.kernel.org/amd-gfx/34dd4c66-f7bf-44aa-af8f-c82889dd652c@amd.com/ Signed-off-by: Lijo Lazar Reviewed-by: Asad Kamal Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher commit 5b750b22530fe53bf7fd6a30baacd53ada26911b Author: Alex Deucher Date: Thu Nov 30 17:34:07 2023 -0500 drm/amd/display: Increase frame warning limit with KASAN or KCSAN in dml Does the same thing as: commit 6740ec97bcdb ("drm/amd/display: Increase frame warning limit with KASAN or KCSAN in dml2") Reviewed-by: Harry Wentland Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311302107.hUDXVyWT-lkp@intel.com/ Fixes: 67e38874b85b ("drm/amd/display: Increase num voltage states to 40") Signed-off-by: Alex Deucher Cc: Alvin Lee Cc: Hamza Mahfooz Cc: Samson Tam Cc: Harry Wentland commit dbf3850d12baf3ba8a80c302f538d1b01940aef7 Author: Yang Wang Date: Mon Dec 4 10:44:32 2023 +0800 drm/amdgpu: optimize the printing order of error data sort error data list to optimize the printing order. Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 0e8af20517197934cc04f8e361c6bbe198c327fd Author: Hawking Zhang Date: Mon Nov 20 10:43:02 2023 +0800 drm/amdgpu: Update fw version for boot time error query Boot time error query is not available until fw a10109 Signed-off-by: Hawking Zhang Reviewed-by: Stanley Yang Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 37c57631c18661c4c0dc415e75afd143ed89e098 Author: Yang Wang Date: Mon Dec 4 10:17:57 2023 +0800 drm/amd/pm: support new mca smu error code decoding support new mca smu error code decoding from smu 85.86.0 for smu v13.0.6 Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 78825df90d427b26964bf9610eaac30542ee9e2d Author: Li Ma Date: Tue Nov 14 16:17:51 2023 +0800 drm/amd/swsmu: update smu v14_0_0 driver if version and metrics table Increment the driver if version and add new mems to the mertics table. Signed-off-by: Li Ma Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 9f7cb03e3c32613fb5891e10ce3ff9169b09ba69 Author: Roman Li Date: Fri Dec 1 06:25:40 2023 -0700 drm/amd/display: Fix array-index-out-of-bounds in dml2 [Why] UBSAN errors observed in dmesg. array-index-out-of-bounds in dml2/display_mode_core.c [How] Fix the index. Tested-by: Daniel Wheeler Acked-by: Rodrigo Siqueira Signed-off-by: Roman Li Signed-off-by: Alex Deucher commit 3d71a8726e05a35beb9de394e86ce896d69e563f Author: Ivan Lipski Date: Fri Dec 1 06:25:16 2023 -0700 drm/amd/display: Add monitor patch for specific eDP [WHY] Some eDP panels's ext caps don't write initial value cause the value of dpcd_addr(0x317) is random. It means that sometimes the eDP will clarify it is OLED, miniLED...etc cause the backlight control interface is incorrect. [HOW] Add a new panel patch to remove sink ext caps(HDR,OLED...etc) Tested-by: Daniel Wheeler Reviewed-by: Sun peng Li Acked-by: Rodrigo Siqueira Signed-off-by: Ivan Lipski Signed-off-by: Alex Deucher commit fec05adc40c25a028c9dfa9d540f800a2d433f80 Author: Alvin Lee Date: Fri Dec 1 06:25:07 2023 -0700 drm/amd/display: Use channel_width = 2 for vram table 3.0 VBIOS has suggested to use channel_width=2 for any ASIC that uses vram info 3.0. This is because channel_width in the vram table no longer represents the memory width Tested-by: Daniel Wheeler Reviewed-by: Samson Tam Acked-by: Rodrigo Siqueira Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit f52f5c71f3d4bb0992800139d2f35cf9f6f6e0ee Author: Yu Kuai Date: Tue Dec 5 17:42:15 2023 +0800 md: fix stopping sync thread Currently sync thread is stopped from multiple contex: - idle_sync_thread - frozen_sync_thread - __md_stop_writes - md_set_readonly - do_md_stop And there are some problems: 1) sync_work is flushed while reconfig_mutex is grabbed, this can deadlock because the work function will grab reconfig_mutex as well. 2) md_reap_sync_thread() can't be called directly while md_do_sync() is not finished yet, for example, commit 130443d60b1b ("md: refactor idle/frozen_sync_thread() to fix deadlock"). 3) If MD_RECOVERY_RUNNING is not set, there is no need to stop sync_thread at all because sync_thread must not be registered. Factor out a helper stop_sync_thread(), so that above contex will behave the same. Fix 1) by flushing sync_work after reconfig_mutex is released, before waiting for sync_thread to be done; Fix 2) bt letting daemon thread to unregister sync_thread; Fix 3) by always checking MD_RECOVERY_RUNNING first. Fixes: db5e653d7c9f ("md: delay choosing sync action to md_start_sync()") Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231205094215.1824240-4-yukuai1@huaweicloud.com commit c9f7cb5b2bc968adcdc686c197ed108f47fd8eb0 Author: Yu Kuai Date: Tue Dec 5 17:42:14 2023 +0800 md: don't leave 'MD_RECOVERY_FROZEN' in error path of md_set_readonly() If md_set_readonly() failed, the array could still be read-write, however 'MD_RECOVERY_FROZEN' could still be set, which leave the array in an abnormal state that sync or recovery can't continue anymore. Hence make sure the flag is cleared after md_set_readonly() returns. Fixes: 88724bfa68be ("md: wait for pending superblock updates before switching to read-only") Signed-off-by: Yu Kuai Acked-by: Xiao Ni Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231205094215.1824240-3-yukuai1@huaweicloud.com commit f2d87a759f6841a132e845e2fafdad37385ddd30 Author: Yu Kuai Date: Tue Dec 5 17:42:13 2023 +0800 md: fix missing flush of sync_work Commit ac619781967b ("md: use separate work_struct for md_start_sync()") use a new sync_work to replace del_work, however, stop_sync_thread() and __md_stop_writes() was trying to wait for sync_thread to be done, hence they should switch to use sync_work as well. Noted that md_start_sync() from sync_work will grab 'reconfig_mutex', hence other contex can't held the same lock to flush work, and this will be fixed in later patches. Fixes: ac619781967b ("md: use separate work_struct for md_start_sync()") Signed-off-by: Yu Kuai Acked-by: Xiao Ni Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231205094215.1824240-2-yukuai1@huaweicloud.com commit d6a57588666301acd9d42d3b00d74240964f07f6 Author: Jiadong Zhu Date: Fri Dec 1 08:38:15 2023 +0800 drm/amdgpu: disable MCBP by default Disable MCBP(mid command buffer preemption) by default as old Mesa hangs with it. We shall not enable the feature that breaks old usermode driver. Fixes: 50a7c8765ca6 ("drm/amdgpu: enable mcbp by default on gfx9") Signed-off-by: Jiadong Zhu Acked-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit f458a1453424e03462b5bb539673c9a3cddda480 Author: Steven Rostedt (Google) Date: Wed Dec 6 10:00:50 2023 -0500 ring-buffer: Test last update in 32bit version of __rb_time_read() Since 64 bit cmpxchg() is very expensive on 32bit architectures, the timestamp used by the ring buffer does some interesting tricks to be able to still have an atomic 64 bit number. It originally just used 60 bits and broke it up into two 32 bit words where the extra 2 bits were used for synchronization. But this was not enough for all use cases, and all 64 bits were required. The 32bit version of the ring buffer timestamp was then broken up into 3 32bit words using the same counter trick. But one update was not done. The check to see if the read operation was done without interruption only checked the first two words and not last one (like it had before this update). Fix it by making sure all three updates happen without interruption by comparing the initial counter with the last updated counter. Link: https://lore.kernel.org/linux-trace-kernel/20231206100050.3100b7bb@gandalf.local.home Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Fixes: f03f2abce4f39 ("ring-buffer: Have 32 bit time stamps use all 64 bits") Signed-off-by: Steven Rostedt (Google) commit b2dd797543cfa6580eac8408dd67fa02164d9e56 Author: Steven Rostedt (Google) Date: Wed Dec 6 10:02:44 2023 -0500 ring-buffer: Force absolute timestamp on discard of event There's a race where if an event is discarded from the ring buffer and an interrupt were to happen at that time and insert an event, the time stamp is still used from the discarded event as an offset. This can screw up the timings. If the event is going to be discarded, set the "before_stamp" to zero. When a new event comes in, it compares the "before_stamp" with the "write_stamp" and if they are not equal, it will insert an absolute timestamp. This will prevent the timings from getting out of sync due to the discarded event. Link: https://lore.kernel.org/linux-trace-kernel/20231206100244.5130f9b3@gandalf.local.home Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Fixes: 6f6be606e763f ("ring-buffer: Force before_stamp and write_stamp to be different on discard") Signed-off-by: Steven Rostedt (Google) commit 04909192ada3285070f8ced0af7f07735478b364 Author: Shyam Prasad N Date: Wed Dec 6 16:37:38 2023 +0000 cifs: reconnect worker should take reference on server struct unconditionally Reconnect worker currently assumes that the server struct is alive and only takes reference on the server if it needs to call smb2_reconnect. With the new ability to disable channels based on whether the server has multichannel disabled, this becomes a problem when we need to disable established channels. While disabling the channels and deallocating the server, there could be reconnect work that could not be cancelled (because it started). This change forces the reconnect worker to unconditionally take a reference on the server when it runs. Also, this change now allows smb2_reconnect to know if it was called by the reconnect worker. Based on this, the cifs_put_tcp_session can decide whether it can cancel the reconnect work synchronously or not. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 823342524868168bf681f135d01b4ae10f5863ec Author: Shyam Prasad N Date: Wed Dec 6 16:37:37 2023 +0000 Revert "cifs: reconnect work should have reference on server struct" This reverts commit 19a4b9d6c372cab6a3b2c9a061a236136fe95274. This earlier commit was making an assumption that each mod_delayed_work called for the reconnect work would result in smb2_reconnect_server being called twice. This assumption turns out to be untrue. So reverting this change for now. I will submit a follow-up patch to fix the actual problem in a different way. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 7ae836a3d630e146b732fe8ef7d86b243748751f Author: Phil Sutter Date: Tue Dec 5 21:58:12 2023 +0100 netfilter: xt_owner: Fix for unsafe access of sk->sk_socket A concurrently running sock_orphan() may NULL the sk_socket pointer in between check and deref. Follow other users (like nft_meta.c for instance) and acquire sk_callback_lock before dereferencing sk_socket. Fixes: 0265ab44bacc ("[NETFILTER]: merge ipt_owner/ip6t_owner in xt_owner") Reported-by: Jann Horn Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit b0b2981c49ff43f2c547c3a7c82869d6135cfb9a Merge: 94ea0ed356b45 f1ed48ef97e2d Author: Arnd Bergmann Date: Wed Dec 6 17:35:29 2023 +0100 Merge tag 'ffa-fixes-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Arm FF-A fixes for v6.7 A bunch of fixes addressing issues around the notification support that was added this cycle. They address issue in partition IDs handling in ffa_notification_info_get(), notifications cleanup path and the size of the allocation in ffa_partitions_cleanup(). It also adds check for the notification enabled state so that the drivers registering the callbacks can be rejected if not enabled/supported. It also moves the partitions setup operation after the notification initialisation so that the driver has the correct state for notification enabled/supported before the partitions are initialised/setup. It also now allows FF-A initialisation to complete successfully even when the notification initialisation fails as it is an optional support in the specification. Initial support just allowed it only if the firmware didn't support notifications. Finally, it also adds a fix for smatch warning by declaring ffa_bus_type structure in the header. * tag 'ffa-fixes-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_ffa: Fix ffa_notification_info_get() IDs handling firmware: arm_ffa: Fix the size of the allocation in ffa_partitions_cleanup() firmware: arm_ffa: Fix FFA notifications cleanup path firmware: arm_ffa: Add checks for the notification enabled state firmware: arm_ffa: Setup the partitions after the notification initialisation firmware: arm_ffa: Allow FF-A initialisation even when notification fails firmware: arm_ffa: Declare ffa_bus_type structure in the header Link: https://lore.kernel.org/r/20231116191603.929767-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 7a733e060bd20edb63b1f27f0b29cf9b184e0e8b Author: Nam Cao Date: Wed Dec 6 15:52:33 2023 +0100 spi: cadence: revert "Add SPI transfer delays" The commit 855a40cd8ccc ("spi: cadence: Add SPI transfer delays") adds a delay after each transfer into the driver's transfer_one(). However, the delay is already done in SPI core. So this commit unnecessarily doubles the delay amount. Revert this commit. Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/20231206145233.74982-1-namcao@linutronix.de Signed-off-by: Mark Brown commit d20d36755a605a21e737b6b16c566658589b1811 Author: Curtis Malainey Date: Tue Dec 5 14:01:18 2023 -0800 ASoC: SOF: mediatek: mt8186: Revert Add Google Steelix topology compatible This reverts commit 505c83212da5bfca95109421b8f5d9f8c6cdfef2. This is not an official topology from the SOF project. Topologies are named based on the card configuration and are NOT board specific. Signed-off-by: Curtis Malainey Link: https://lore.kernel.org/r/20231205220131.2585913-1-cujomalainey@chromium.org Signed-off-by: Mark Brown commit f6e1532a2697b81da00bfb184e99d15e01e9d98c Author: Pablo Neira Ayuso Date: Mon Dec 4 14:51:48 2023 +0100 netfilter: nf_tables: validate family when identifying table via handle Validate table family when looking up for it via NFTA_TABLE_HANDLE. Fixes: 3ecbfd65f50e ("netfilter: nf_tables: allocate handle and delete objects via handle") Reported-by: Xingyuan Mo Signed-off-by: Pablo Neira Ayuso commit 3701cd390fd731ee7ae8b8006246c8db82c72bea Author: Pablo Neira Ayuso Date: Mon Dec 4 14:25:33 2023 +0100 netfilter: nf_tables: bail out on mismatching dynset and set expressions If dynset expressions provided by userspace is larger than the declared set expressions, then bail out. Fixes: 48b0ae046ee9 ("netfilter: nftables: netlink support for several set element expressions") Reported-by: Xingyuan Mo Signed-off-by: Pablo Neira Ayuso commit 63331e37fb227e796894b31d713697612c8dee7f Author: Florian Westphal Date: Mon Dec 4 12:29:54 2023 +0100 netfilter: nf_tables: fix 'exist' matching on bigendian arches Maze reports "tcp option fastopen exists" fails to match on OpenWrt 22.03.5, r20134-5f15225c1e (5.10.176) router. "tcp option fastopen exists" translates to: inet [ exthdr load tcpopt 1b @ 34 + 0 present => reg 1 ] [ cmp eq reg 1 0x00000001 ] .. but existing nft userspace generates a 1-byte compare. On LSB (x86), "*reg32 = 1" is identical to nft_reg_store8(reg32, 1), but not on MSB, which will place the 1 last. IOW, on bigendian aches the cmp8 is awalys false. Make sure we store this in a consistent fashion, so existing userspace will also work on MSB (bigendian). Regardless of this patch we can also change nft userspace to generate 'reg32 == 0' and 'reg32 != 0' instead of u8 == 0 // u8 == 1 when adding 'option x missing/exists' expressions as well. Fixes: 3c1fece8819e ("netfilter: nft_exthdr: Allow checking TCP option presence, too") Fixes: b9f9a485fb0e ("netfilter: nft_exthdr: add boolean DCCP option matching") Fixes: 055c4b34b94f ("netfilter: nft_fib: Support existence check") Reported-by: Maciej Żenczykowski Closes: https://lore.kernel.org/netfilter-devel/CAHo-OozyEqHUjL2-ntATzeZOiuftLWZ_HU6TOM_js4qLfDEAJg@mail.gmail.com/ Signed-off-by: Florian Westphal Acked-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 317eb9685095678f2c9f5a8189de698c5354316a Author: Florian Westphal Date: Fri Dec 1 15:47:13 2023 +0100 netfilter: nft_set_pipapo: skip inactive elements during set walk Otherwise set elements can be deactivated twice which will cause a crash. Reported-by: Xingyuan Mo Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 1834d62ae88500f37cba4439c3237aa85242272e Author: D. Wythe Date: Thu Nov 30 15:23:23 2023 +0800 netfilter: bpf: fix bad registration on nf_defrag We should pass a pointer to global_hook to the get_proto_defrag_hook() instead of its value, since the passed value won't be updated even if the request module was loaded successfully. Log: [ 54.915713] nf_defrag_ipv4 has bad registration [ 54.915779] WARNING: CPU: 3 PID: 6323 at net/netfilter/nf_bpf_link.c:62 get_proto_defrag_hook+0x137/0x160 [ 54.915835] CPU: 3 PID: 6323 Comm: fentry Kdump: loaded Tainted: G E 6.7.0-rc2+ #35 [ 54.915839] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 [ 54.915841] RIP: 0010:get_proto_defrag_hook+0x137/0x160 [ 54.915844] Code: 4f 8c e8 2c cf 68 ff 80 3d db 83 9a 01 00 0f 85 74 ff ff ff 48 89 ee 48 c7 c7 8f 12 4f 8c c6 05 c4 83 9a 01 01 e8 09 ee 5f ff <0f> 0b e9 57 ff ff ff 49 8b 3c 24 4c 63 e5 e8 36 28 6c ff 4c 89 e0 [ 54.915849] RSP: 0018:ffffb676003fbdb0 EFLAGS: 00010286 [ 54.915852] RAX: 0000000000000023 RBX: ffff9596503d5600 RCX: ffff95996fce08c8 [ 54.915854] RDX: 00000000ffffffd8 RSI: 0000000000000027 RDI: ffff95996fce08c0 [ 54.915855] RBP: ffffffff8c4f12de R08: 0000000000000000 R09: 00000000fffeffff [ 54.915859] R10: ffffb676003fbc70 R11: ffffffff8d363ae8 R12: 0000000000000000 [ 54.915861] R13: ffffffff8e1f75c0 R14: ffffb676003c9000 R15: 00007ffd15e78ef0 [ 54.915864] FS: 00007fb6e9cab740(0000) GS:ffff95996fcc0000(0000) knlGS:0000000000000000 [ 54.915867] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 54.915868] CR2: 00007ffd15e75c40 CR3: 0000000101e62006 CR4: 0000000000360ef0 [ 54.915870] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 54.915871] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 54.915873] Call Trace: [ 54.915891] [ 54.915894] ? __warn+0x84/0x140 [ 54.915905] ? get_proto_defrag_hook+0x137/0x160 [ 54.915908] ? __report_bug+0xea/0x100 [ 54.915925] ? report_bug+0x2b/0x80 [ 54.915928] ? handle_bug+0x3c/0x70 [ 54.915939] ? exc_invalid_op+0x18/0x70 [ 54.915942] ? asm_exc_invalid_op+0x1a/0x20 [ 54.915948] ? get_proto_defrag_hook+0x137/0x160 [ 54.915950] bpf_nf_link_attach+0x1eb/0x240 [ 54.915953] link_create+0x173/0x290 [ 54.915969] __sys_bpf+0x588/0x8f0 [ 54.915974] __x64_sys_bpf+0x20/0x30 [ 54.915977] do_syscall_64+0x45/0xf0 [ 54.915989] entry_SYSCALL_64_after_hwframe+0x6e/0x76 [ 54.915998] RIP: 0033:0x7fb6e9daa51d [ 54.916001] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 2b 89 0c 00 f7 d8 64 89 01 48 [ 54.916003] RSP: 002b:00007ffd15e78ed8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 [ 54.916006] RAX: ffffffffffffffda RBX: 00007ffd15e78fc0 RCX: 00007fb6e9daa51d [ 54.916007] RDX: 0000000000000040 RSI: 00007ffd15e78ef0 RDI: 000000000000001c [ 54.916009] RBP: 000000000000002d R08: 00007fb6e9e73a60 R09: 0000000000000001 [ 54.916010] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000006 [ 54.916012] R13: 0000000000000006 R14: 0000000000000000 R15: 0000000000000000 [ 54.916014] [ 54.916015] ---[ end trace 0000000000000000 ]--- Fixes: 91721c2d02d3 ("netfilter: bpf: Support BPF_F_NETFILTER_IP_DEFRAG in netfilter link") Signed-off-by: D. Wythe Acked-by: Daniel Xu Reviewed-by: Simon Horman Signed-off-by: Pablo Neira Ayuso commit 94ea0ed356b45fa2d5d0c08d5495471bde29a1e5 Author: Chester Lin Date: Thu Nov 16 07:45:08 2023 +0800 MAINTAINERS: change the S32G2 maintainer's email address. I am leaving SUSE so the current email address will be disabled soon. will be my new address for handling emails, patches and pull requests from upstream and communities. Cc: Chester Lin Cc: NXP S32 Linux Team Cc: Arnd Bergmann Cc: Olof Johansson Cc: Andreas Färber Cc: Matthias Brugger Signed-off-by: Chester Lin Reviewed-by: Matthias Brugger Link: https://lore.kernel.org/r/20231115234508.11510-1-clin@suse.com Signed-off-by: Arnd Bergmann commit 56d4eaed1e38c1e010156556d4534c9793bf68be Merge: 2d8781ba59c1b dc761f11af2e3 Author: Arnd Bergmann Date: Wed Dec 6 16:36:55 2023 +0100 Merge tag 'arm-soc/for-6.7/devicetree-fixes' of https://github.com/Broadcom/stblinux into arm/fixes This pull request contains Broadcom ARM-based SoCs Device Tree fixes for 6.7, please pull the following: - Stefan corrects the disabling of the activity LED for the Raspberry Pi 400 * tag 'arm-soc/for-6.7/devicetree-fixes' of https://github.com/Broadcom/stblinux: ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act Link: https://lore.kernel.org/r/20231205225021.653045-1-florian.fainelli@broadcom.com Signed-off-by: Arnd Bergmann commit fe2b1226656afae56702d1d84c6900f6b67df297 Author: Heiner Kallweit Date: Fri Dec 1 11:23:22 2023 +0100 leds: trigger: netdev: fix RTNL handling to prevent potential deadlock When working on LED support for r8169 I got the following lockdep warning. Easiest way to prevent this scenario seems to be to take the RTNL lock before the trigger_data lock in set_device_name(). ====================================================== WARNING: possible circular locking dependency detected 6.7.0-rc2-next-20231124+ #2 Not tainted ------------------------------------------------------ bash/383 is trying to acquire lock: ffff888103aa1c68 (&trigger_data->lock){+.+.}-{3:3}, at: netdev_trig_notify+0xec/0x190 [ledtrig_netdev] but task is already holding lock: ffffffff8cddf808 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock+0x12/0x20 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (rtnl_mutex){+.+.}-{3:3}: __mutex_lock+0x9b/0xb50 mutex_lock_nested+0x16/0x20 rtnl_lock+0x12/0x20 set_device_name+0xa9/0x120 [ledtrig_netdev] netdev_trig_activate+0x1a1/0x230 [ledtrig_netdev] led_trigger_set+0x172/0x2c0 led_trigger_write+0xf1/0x140 sysfs_kf_bin_write+0x5d/0x80 kernfs_fop_write_iter+0x15d/0x210 vfs_write+0x1f0/0x510 ksys_write+0x6c/0xf0 __x64_sys_write+0x14/0x20 do_syscall_64+0x3f/0xf0 entry_SYSCALL_64_after_hwframe+0x6c/0x74 -> #0 (&trigger_data->lock){+.+.}-{3:3}: __lock_acquire+0x1459/0x25a0 lock_acquire+0xc8/0x2d0 __mutex_lock+0x9b/0xb50 mutex_lock_nested+0x16/0x20 netdev_trig_notify+0xec/0x190 [ledtrig_netdev] call_netdevice_register_net_notifiers+0x5a/0x100 register_netdevice_notifier+0x85/0x120 netdev_trig_activate+0x1d4/0x230 [ledtrig_netdev] led_trigger_set+0x172/0x2c0 led_trigger_write+0xf1/0x140 sysfs_kf_bin_write+0x5d/0x80 kernfs_fop_write_iter+0x15d/0x210 vfs_write+0x1f0/0x510 ksys_write+0x6c/0xf0 __x64_sys_write+0x14/0x20 do_syscall_64+0x3f/0xf0 entry_SYSCALL_64_after_hwframe+0x6c/0x74 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(rtnl_mutex); lock(&trigger_data->lock); lock(rtnl_mutex); lock(&trigger_data->lock); *** DEADLOCK *** 8 locks held by bash/383: #0: ffff888103ff33f0 (sb_writers#3){.+.+}-{0:0}, at: ksys_write+0x6c/0xf0 #1: ffff888103aa1e88 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x114/0x210 #2: ffff8881036f1890 (kn->active#82){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x11d/0x210 #3: ffff888108e2c358 (&led_cdev->led_access){+.+.}-{3:3}, at: led_trigger_write+0x30/0x140 #4: ffffffff8cdd9e10 (triggers_list_lock){++++}-{3:3}, at: led_trigger_write+0x75/0x140 #5: ffff888108e2c270 (&led_cdev->trigger_lock){++++}-{3:3}, at: led_trigger_write+0xe3/0x140 #6: ffffffff8cdde3d0 (pernet_ops_rwsem){++++}-{3:3}, at: register_netdevice_notifier+0x1c/0x120 #7: ffffffff8cddf808 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock+0x12/0x20 stack backtrace: CPU: 0 PID: 383 Comm: bash Not tainted 6.7.0-rc2-next-20231124+ #2 Hardware name: Default string Default string/Default string, BIOS ADLN.M6.SODIMM.ZB.CY.015 08/08/2023 Call Trace: dump_stack_lvl+0x5c/0xd0 dump_stack+0x10/0x20 print_circular_bug+0x2dd/0x410 check_noncircular+0x131/0x150 __lock_acquire+0x1459/0x25a0 lock_acquire+0xc8/0x2d0 ? netdev_trig_notify+0xec/0x190 [ledtrig_netdev] __mutex_lock+0x9b/0xb50 ? netdev_trig_notify+0xec/0x190 [ledtrig_netdev] ? __this_cpu_preempt_check+0x13/0x20 ? netdev_trig_notify+0xec/0x190 [ledtrig_netdev] ? __cancel_work_timer+0x11c/0x1b0 ? __mutex_lock+0x123/0xb50 mutex_lock_nested+0x16/0x20 ? mutex_lock_nested+0x16/0x20 netdev_trig_notify+0xec/0x190 [ledtrig_netdev] call_netdevice_register_net_notifiers+0x5a/0x100 register_netdevice_notifier+0x85/0x120 netdev_trig_activate+0x1d4/0x230 [ledtrig_netdev] led_trigger_set+0x172/0x2c0 ? preempt_count_add+0x49/0xc0 led_trigger_write+0xf1/0x140 sysfs_kf_bin_write+0x5d/0x80 kernfs_fop_write_iter+0x15d/0x210 vfs_write+0x1f0/0x510 ksys_write+0x6c/0xf0 __x64_sys_write+0x14/0x20 do_syscall_64+0x3f/0xf0 entry_SYSCALL_64_after_hwframe+0x6c/0x74 RIP: 0033:0x7f269055d034 Code: c7 00 16 00 00 00 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 80 3d 35 c3 0d 00 00 74 13 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 48 83 ec 28 48 89 54 24 18 48 RSP: 002b:00007ffddb7ef748 EFLAGS: 00000202 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000007 RCX: 00007f269055d034 RDX: 0000000000000007 RSI: 000055bf5f4af3c0 RDI: 0000000000000001 RBP: 000055bf5f4af3c0 R08: 0000000000000073 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000007 R13: 00007f26906325c0 R14: 00007f269062ff20 R15: 0000000000000000 Fixes: d5e01266e7f5 ("leds: trigger: netdev: add additional specific link speed mode") Cc: stable@vger.kernel.org Signed-off-by: Heiner Kallweit Reviewed-by: Andrew Lunn Acked-by: Lee Jones Link: https://lore.kernel.org/r/fb5c8294-2a10-4bf5-8f10-3d2b77d2757e@gmail.com Signed-off-by: Jakub Kicinski commit 2d8781ba59c1b74afa93f6fdd97e6e95a77f2526 Merge: 437c99c256271 77f5032e94f24 Author: Arnd Bergmann Date: Wed Dec 6 16:25:42 2023 +0100 Merge tag 'scmi-fixes-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Arm SCMI fixes for v6.7 A fix for possible truncation/overflow in the frequency computations as both the performance value and the multiplier are 32bit values. * tag 'scmi-fixes-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: Fix possible frequency truncation when using level indexing mode firmware: arm_scmi: Fix frequency truncation by promoting multiplier type Link: https://lore.kernel.org/r/20231204134724.30465-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 437c99c2562717b457ca44ac5df2a007664ea790 Merge: 1133ae113d6c5 79997eda0d31b Author: Arnd Bergmann Date: Wed Dec 6 16:24:07 2023 +0100 Merge tag 'riscv-dt-fixes-for-v6.7-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into arm/fixes RISC-V Devicetree fixes for v6.7-rc4 Two fixes, both rather minor. The first fixes some dtbs_check warnings introduced after an update to the bindings, that returns the architecture to being clean of dtbs_check issues. The second relocates a soc-specific property to the appropriate location in $soc.dtsi, and hopefully avoids the same mistake being copy-pasted into more devicetrees. Signed-off-by: Conor Dooley * tag 'riscv-dt-fixes-for-v6.7-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux: riscv: dts: microchip: move timebase-frequency to mpfs.dtsi riscv: dts: sophgo: remove address-cells from intc node Link: https://lore.kernel.org/r/20231130-maternity-majestic-dd29f0170050@spud Signed-off-by: Arnd Bergmann commit 1133ae113d6c588f02b0af584b81c1bea60de901 Merge: 9c7f01d5f438a 5943b8f7449df Author: Arnd Bergmann Date: Wed Dec 6 16:23:10 2023 +0100 Merge tag 'mtk-dts64-fixes-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux into arm/fixes MediaTek ARM64 DeviceTree fixes for v6.7 Fixes for various MediaTek SoCs, including MT7986: - eMMC HS400 mode failures - Cooling trips for emergency system shutdown - BPI-R3 machine SFP power limit and active cooling MT8173: - EVB device tree unit_address_vs_reg warning MT8183: - unit_address_vs_reg and simple_bus_reg warnings - Kukui device tree nodes naming consistency and adhering to bindings - Jacuzzi device tree unnecessary cells removed as those were producing avoid_unnecessary_addr_size MT8186: - Power domains faults due to incorrect clocks - GPU speed bin nvmem cell name was wrong, producing issues with interpreting the speedbin with GPU OPPs MT8195: - Local Arbiter (and whole system) ability to suspend - Cherry device tree interrupts_property warning ...and another unit_address_vs_reg warning on MT7622. * tag 'mtk-dts64-fixes-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux: arm64: dts: mediatek: cherry: Fix interrupt cells for MT6360 on I2C7 arm64: dts: mediatek: mt8183-kukui-jacuzzi: fix dsi unnecessary cells properties arm64: dts: mediatek: mt7622: fix memory node warning check arm64: dts: mediatek: mt8186: fix clock names for power domains arm64: dts: mediatek: mt8186: Change gpu speedbin nvmem cell name arm64: dts: mt7986: change cooling trips arm64: dts: mt7986: define 3W max power to both SFP on BPI-R3 arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization arm64: dts: mt8183: kukui: Fix underscores in node names arm64: dts: mediatek: mt8183: Move thermal-zones to the root node arm64: dts: mediatek: mt8173-evb: Fix regulator-fixed node names arm64: dts: mediatek: mt8183-evb: Fix unit_address_vs_reg warning on ntc arm64: dts: mediatek: mt8183: Fix unit address for scp reserved memory arm64: dts: mediatek: mt8195: Fix PM suspend/resume with venc clocks Link: https://lore.kernel.org/r/20231129113905.134732-1-angelogioacchino.delregno@collabora.com Signed-off-by: Arnd Bergmann commit ed5b7cfd7839f9280a63365c1133482b42d0981f Author: Lad Prabhakar Date: Thu Nov 30 21:26:47 2023 +0000 riscv: errata: andes: Probe for IOCP only once in boot stage We need to probe for IOCP only once during boot stage, as we were probing for IOCP for all the stages this caused the below issue during module-init stage, [9.019104] Unable to handle kernel paging request at virtual address ffffffff8100d3a0 [9.027153] Oops [#1] [9.029421] Modules linked in: rcar_canfd renesas_usbhs i2c_riic can_dev spi_rspi i2c_core [9.037686] CPU: 0 PID: 90 Comm: udevd Not tainted 6.7.0-rc1+ #57 [9.043756] Hardware name: Renesas SMARC EVK based on r9a07g043f01 (DT) [9.050339] epc : riscv_noncoherent_supported+0x10/0x3e [9.055558]  ra : andes_errata_patch_func+0x4a/0x52 [9.060418] epc : ffffffff8000d8c2 ra : ffffffff8000d95c sp : ffffffc8003abb00 [9.067607]  gp : ffffffff814e25a0 tp : ffffffd80361e540 t0 : 0000000000000000 [9.074795]  t1 : 000000000900031e t2 : 0000000000000001 s0 : ffffffc8003abb20 [9.081984]  s1 : ffffffff015b57c7 a0 : 0000000000000000 a1 : 0000000000000001 [9.089172]  a2 : 0000000000000000 a3 : 0000000000000000 a4 : ffffffff8100d8be [9.096360]  a5 : 0000000000000001 a6 : 0000000000000001 a7 : 000000000900031e [9.103548]  s2 : ffffffff015b57d7 s3 : 0000000000000001 s4 : 000000000000031e [9.110736]  s5 : 8000000000008a45 s6 : 0000000000000500 s7 : 000000000000003f [9.117924]  s8 : ffffffc8003abd48 s9 : ffffffff015b1140 s10: ffffffff8151a1b0 [9.125113]  s11: ffffffff015b1000 t3 : 0000000000000001 t4 : fefefefefefefeff [9.132301]  t5 : ffffffff015b57c7 t6 : ffffffd8b63a6000 [9.137587] status: 0000000200000120 badaddr: ffffffff8100d3a0 cause: 000000000000000f [9.145468] [] riscv_noncoherent_supported+0x10/0x3e [9.151972] [] _apply_alternatives+0x84/0x86 [9.157784] [] apply_module_alternatives+0x10/0x1a [9.164113] [] module_finalize+0x5e/0x7a [9.169583] [] load_module+0xfd8/0x179c [9.174965] [] init_module_from_file+0x76/0xaa [9.180948] [] __riscv_sys_finit_module+0x176/0x2a8 [9.187365] [] do_trap_ecall_u+0xbe/0x130 [9.192922] [] ret_from_exception+0x0/0x64 [9.198573] Code: 0009 b7e9 6797 014d a783 85a7 c799 4785 0717 0100 (0123) aef7 [9.205994] ---[ end trace 0000000000000000 ]--- This is because we called riscv_noncoherent_supported() for all the stages during IOCP probe. riscv_noncoherent_supported() function sets noncoherent_supported variable to true which has an annotation set to "__ro_after_init" due to which we were seeing the above splat. Fix this by probing for IOCP only once in boot stage by having a boolean variable "done" which will be set to true upon IOCP probe in errata_probe_iocp() and we bail out early if "done" is set to true. While at it make return type of errata_probe_iocp() to void as we were not checking the return value in andes_errata_patch_func(). Fixes: e021ae7f5145 ("riscv: errata: Add Andes alternative ports") Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Reviewed-by: Yu Chien Peter Lin Link: https://lore.kernel.org/r/20231130212647.108746-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Palmer Dabbelt commit 9c7f01d5f438a3b3e3dc551df560ae420b4b741c Merge: 2cc14f52aeb78 7269cba53d906 Author: Arnd Bergmann Date: Wed Dec 6 16:15:25 2023 +0100 Merge tag 'optee-supplicant-fix-for-v6.7' of git://git.linaro.org:/people/jens.wiklander/linux-tee into arm/fixes OP-TEE fix for supplicant based device enumeration Adds a sysfs attribute for devices depending on supplicant services so that the user-space service can detect and detach those devices before closing the supplicant * tag 'optee-supplicant-fix-for-v6.7' of git://git.linaro.org:/people/jens.wiklander/linux-tee: tee: optee: Fix supplicant based device enumeration Link: https://lore.kernel.org/r/20231114153113.GA1310615@rayden Signed-off-by: Arnd Bergmann commit f40cab8e18ed57d2c7b5213437d83d955f78097f Author: Samuel Holland Date: Tue Nov 21 13:19:29 2023 -0800 riscv: Fix SMP when shadow call stacks are enabled This fixes two bugs in SCS initialization for secondary CPUs. First, the SCS was not initialized at all in the spinwait boot path. Second, the code for the SBI HSM path attempted to initialize the SCS before enabling the MMU. However, that involves dereferencing the thread pointer, which requires the MMU to be enabled. Fix both issues by setting up the SCS in the common secondary entry path, after enabling the MMU. Fixes: d1584d791a29 ("riscv: Implement Shadow Call Stack") Signed-off-by: Samuel Holland Reviewed-by: Sami Tolvanen Link: https://lore.kernel.org/r/20231121211958.3158576-1-samuel.holland@sifive.com Signed-off-by: Palmer Dabbelt commit 9085b23b668ad5aca62df4f071b306a47152e6b3 Author: Bjorn Andersson Date: Tue Dec 5 14:14:00 2023 -0800 interconnect: qcom: icc-rpm: Fix peak rate calculation Per the commit message of commit 'dd014803f260 ("interconnect: qcom: icc-rpm: Add AB/IB calculations coefficients")', the peak rate should be 100/ib_percent. But, in what looks like a typical typo, the numerator value is discarded in the calculation. Update the implementation to match the described intention. Fixes: dd014803f260 ("interconnect: qcom: icc-rpm: Add AB/IB calculations coefficients") Cc: stable@vger.kernel.org Signed-off-by: Bjorn Andersson Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231205-qcom_icc_calc_rate-typo-v1-1-9d4378dcf53e@quicinc.com Signed-off-by: Georgi Djakov commit 96ba4a47d147cf8c4b764ec3a66a088a5bb3033a Author: Rob Herring Date: Wed Nov 22 15:44:14 2023 -0700 dt-bindings: perf: riscv,pmu: drop unneeded quotes Drop unneeded quotes over simple string values to fix a soon to be enabled yamllint warning: [error] string value is redundantly quoted with any quotes (quoted-strings) Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231122224414.2809184-1-robh@kernel.org Signed-off-by: Palmer Dabbelt commit 33038efb64f7576bac635164021f5c984d4c755f Author: Tim Bosse Date: Wed Dec 6 09:26:29 2023 -0500 ALSA: hda/realtek: add new Framework laptop to quirks The Framework Laptop 13 (AMD Ryzen 7040Series) has an ALC295 with a disconnected or faulty headset mic presence detect similar to the previous models. It works with the same quirk chain as 309d7363ca3d9fcdb92ff2d958be14d7e8707f68. This model has a VID:PID of f111:0006. Signed-off-by: Tim Bosse Cc: Link: https://lore.kernel.org/r/20231206142629.388615-1-flinn@timbos.se Signed-off-by: Takashi Iwai commit 22e0eb04837a63af111fae35a92f7577676b9bc8 Author: Clément Léger Date: Fri Nov 3 10:02:23 2023 +0100 riscv: fix misaligned access handling of C.SWSP and C.SDSP This is a backport of a fix that was done in OpenSBI: ec0559eb315b ("lib: sbi_misaligned_ldst: Fix handling of C.SWSP and C.SDSP"). Unlike C.LWSP/C.LDSP, these encodings can be used with the zero register, so checking that the rs2 field is non-zero is unnecessary. Additionally, the previous check was incorrect since it was checking the immediate field of the instruction instead of the rs2 field. Fixes: 956d705dd279 ("riscv: Unaligned load/store handling for M_MODE") Signed-off-by: Clément Léger Link: https://lore.kernel.org/r/20231103090223.702340-1-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt commit fbbc69d2bba592fb6a84c2253a693dffcf7f9062 Merge: 2b3a7a302c980 0a10d15280a38 Author: Takashi Iwai Date: Wed Dec 6 14:56:00 2023 +0100 Merge tag 'asoc-fix-v6.7-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.7 A crop of fixes for v6.7, one core fix for a merge issue and a bunch of driver specific fixes and new IDs, mostly for x86 platforms. commit c0a2755aced969e0125fd68ccd95269b28d8913a Author: Konrad Dybcio Date: Wed Nov 29 20:12:31 2023 +0100 dt-bindings: interrupt-controller: Allow #power-domain-cells MPM provides a single genpd. Allow #power-domain-cells = <0>. Fixes: 54fc9851c0e0 ("dt-bindings: interrupt-controller: Add Qualcomm MPM support") Acked-by: Shawn Guo Acked-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231129-topic-mpmbindingspd-v2-1-acbe909ceee1@linaro.org Signed-off-by: Rob Herring commit 777c0d761be7d981a2ae5494dfbc636311908dfb Author: Andrew Jones Date: Wed Nov 1 15:19:09 2023 +0100 RISC-V: hwprobe: Always use u64 for extension bits Extensions are getting added quickly and their hwprobe bits will soon exceed 31 (which pair values accommodate, since they're of type u64). However, in one tree, where a bunch of extensions got merged prior to zicboz, zicboz already got pushed to bit 32. Pushing it exposed a 32-bit compilation bug, since unsigned long was used instead of u64. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310311801.hxduISrr-lkp@intel.com/ Fixes: 9c7646d5ffd2 ("RISC-V: hwprobe: Expose Zicboz extension and its block size") Signed-off-by: Andrew Jones Link: https://lore.kernel.org/r/20231101141908.192198-2-ajones@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 2078a341f5f609d55667c2dc6337f90d8f322b8f Merge: 3142dbf084cb6 7336fc196748f Author: Paolo Abeni Date: Wed Dec 6 13:44:40 2023 +0100 Merge branch 'octeontx2-af-miscellaneous-fixes' Geetha sowjanya says: ==================== octeontx2-af: miscellaneous fixes The series of patches fixes various issues related to mcs and NIX link registers. v3-v4: Used FIELD_PREP macro and proper data types. v2-v3: Fixed typo error in patch 4 commit message. v1-v2: Fixed author name for patch 5. Added Reviewed-by. ==================== Link: https://lore.kernel.org/r/20231205080434.27604-1-gakula@marvell.com Signed-off-by: Paolo Abeni commit 7336fc196748f82646b630d5a2e9d283e200b988 Author: Rahul Bhansali Date: Tue Dec 5 13:34:34 2023 +0530 octeontx2-af: Update Tx link register range On new silicons the TX channels for transmit level has increased. This patch fixes the respective register offset range to configure the newly added channels. Fixes: b279bbb3314e ("octeontx2-af: NIX Tx scheduler queue config support") Signed-off-by: Rahul Bhansali Signed-off-by: Geetha sowjanya Reviewed-by: Wojciech Drewek Signed-off-by: Paolo Abeni commit d431abd0a9aa27be379fb5f8304062071b0f5a7e Author: Geetha sowjanya Date: Tue Dec 5 13:34:33 2023 +0530 octeontx2-af: Add missing mcs flr handler call If mcs resources are attached to PF/VF. These resources need to be freed on FLR. This patch add missing mcs flr call on PF FLR. Fixes: bd69476e86fc ("octeontx2-af: cn10k: mcs: Install a default TCAM for normal traffic") Signed-off-by: Geetha sowjanya Reviewed-by: Wojciech Drewek Signed-off-by: Paolo Abeni commit 3ba98a8c6f8ceb4e01a78f973d8d9017020bbd57 Author: Geetha sowjanya Date: Tue Dec 5 13:34:32 2023 +0530 octeontx2-af: Fix mcs stats register address This patch adds the miss mcs stats register for mcs supported platforms. Fixes: 9312150af8da ("octeontx2-af: cn10k: mcs: Support for stats collection") Signed-off-by: Geetha sowjanya Reviewed-by: Wojciech Drewek Signed-off-by: Paolo Abeni commit 9723b2cca1f0e980c53156b52ea73b93966b3c8a Author: Geetha sowjanya Date: Tue Dec 5 13:34:31 2023 +0530 octeontx2-af: Fix mcs sa cam entries size On latest silicon versions SA cam entries increased to 256. This patch fixes the datatype of sa_entries in mcs_hw_info struct to u16 to hold 256 entries. Fixes: 080bbd19c9dd ("octeontx2-af: cn10k: mcs: Add mailboxes for port related operations") Signed-off-by: Geetha sowjanya Reviewed-by: Wojciech Drewek Signed-off-by: Paolo Abeni commit dca6fa8644b89f54345e55501b1419316ba5cb29 Author: Nithin Dabilpuram Date: Tue Dec 5 13:34:30 2023 +0530 octeontx2-af: Adjust Tx credits when MCS external bypass is disabled When MCS external bypass is disabled, MCS returns additional 2 credits(32B) for every packet Tx'ed on LMAC. To account for these extra credits, NIX_AF_TX_LINKX_NORM_CREDIT.CC_MCS_CNT needs to be configured as otherwise NIX Tx credits would overflow and will never be returned to idle state credit count causing issues with credit control and MTU change. This patch fixes the same by configuring CC_MCS_CNT at probe time for MCS enabled SoC's Fixes: bd69476e86fc ("octeontx2-af: cn10k: mcs: Install a default TCAM for normal traffic") Signed-off-by: Nithin Dabilpuram Signed-off-by: Geetha sowjanya Signed-off-by: Sunil Goutham Reviewed-by: Wojciech Drewek Signed-off-by: Paolo Abeni commit 82180b1fae2432ee88b4a54cc6c376ba01e57b22 Author: Charlie Jenkins Date: Wed Nov 22 15:35:54 2023 -0800 Support rv32 ULEB128 test Use opcodes available to both rv32 and rv64 in uleb128 module linking test. Fixes: af71bc194916 ("riscv: Add tests for riscv module loading") Signed-off-by: Charlie Jenkins Reported-by: Randy Dunlap Closes: https://lore.kernel.org/lkml/1d7c71ee-5742-4df4-b8ef-a2aea0a624eb@infradead.org/ Tested-by: Randy Dunlap # build-tested Link: https://lore.kernel.org/r/20231122-module_fixup-v2-1-dfb9565e9ea5@rivosinc.com Signed-off-by: Palmer Dabbelt commit 3142dbf084cb66080b111673148192906a4c037c Merge: 6b07b5225d87f 9396c4ee93f9a Author: Paolo Abeni Date: Wed Dec 6 12:36:59 2023 +0100 Merge branch 'tcp-ao-fixes' Dmitry Safonov says: ==================== TCP-AO fixes Changes from v4: - Dropped 2 patches on which there's no consensus. They will require more work TBD if they may made acceptable. Those are: o "net/tcp: Allow removing current/rnext TCP-AO keys on TCP_LISTEN sockets" o "net/tcp: Store SNEs + SEQs on ao_info" Changes from v3: - Don't restrict adding any keys on TCP-AO connection in VRF, but only the ones that don't match l3index (David) Changes from v2: - rwlocks are problematic in net code (Paolo) Changed the SNE code to avoid spin/rw locks on RX/TX fastpath by double-accounting SEQ numbers for TCP-AO enabled connections. Changes from v1: - Use tcp_can_repair_sock() helper to limit TCP_AO_REPAIR (Eric) - Instead of hook to listen() syscall, allow removing current/rnext keys on TCP_LISTEN (addressing Eric's objection) - Add sne_lock to protect snd_sne/rcv_sne - Don't move used_tcp_ao in struct tcp_request_sock (Eric) I've been working on TCP-AO key-rotation selftests and as a result exercised some corner-cases that are not usually met in production. Here are a bunch of semi-related fixes: - Documentation typo (reported by Markus Elfring) - Proper alignment for TCP-AO option in TCP header that has MAC length of non 4 bytes (now a selftest with randomized maclen/algorithm/etc passes) - 3 uAPI restricting patches that disallow more things to userspace in order to prevent it shooting itself in any parts of the body - SNEs READ_ONCE()/WRITE_ONCE() that went missing by my human factor - Avoid storing MAC length from SYN header as SYN-ACK will use rnext_key.maclen (drops an extra check that fails on new selftests) ==================== Link: https://lore.kernel.org/r/ Signed-off-by: Paolo Abeni commit 9396c4ee93f9ac03cd0cea0bb345fbc657772943 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Dec 4 19:00:44 2023 +0000 net/tcp: Don't store TCP-AO maclen on reqsk This extra check doesn't work for a handshake when SYN segment has (current_key.maclen != rnext_key.maclen). It could be amended to preserve rnext_key.maclen instead of current_key.maclen, but that requires a lookup on listen socket. Originally, this extra maclen check was introduced just because it was cheap. Drop it and convert tcp_request_sock::maclen into boolean tcp_request_sock::used_tcp_ao. Fixes: 06b22ef29591 ("net/tcp: Wire TCP-AO to request sockets") Signed-off-by: Dmitry Safonov Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit 12083d728213285c2d4347fa0ed3b556449703ce Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Dec 4 19:00:43 2023 +0000 net/tcp: Don't add key with non-matching VRF on connected sockets If the connection was established, don't allow adding TCP-AO keys that don't match the peer. Currently, there are checks for ip-address matching, but L3 index check is missing. Add it to restrict userspace shooting itself somewhere. Yet, nothing restricts the CAP_NET_RAW user from trying to shoot themselves by performing setsockopt(SO_BINDTODEVICE) or setsockopt(SO_BINDTOIFINDEX) over an established TCP-AO connection. So, this is just "minimum effort" to potentially save someone's debugging time, rather than a full restriction on doing weird things. Fixes: 248411b8cb89 ("net/tcp: Wire up l3index to TCP-AO") Signed-off-by: Dmitry Safonov Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit 965c00e4ea2e4df986ecd73c2fe9d3a00a2858db Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Dec 4 19:00:42 2023 +0000 net/tcp: Limit TCP_AO_REPAIR to non-listen sockets Listen socket is not an established TCP connection, so setsockopt(TCP_AO_REPAIR) doesn't have any impact. Restrict this uAPI for listen sockets. Fixes: faadfaba5e01 ("net/tcp: Add TCP_AO_REPAIR") Signed-off-by: Dmitry Safonov Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit da7dfaa6d6f731c30eca6ffa808b83634d43e26f Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Dec 4 19:00:41 2023 +0000 net/tcp: Consistently align TCP-AO option in the header Currently functions that pre-calculate TCP header options length use unaligned TCP-AO header + MAC-length for skb reservation. And the functions that actually write TCP-AO options into skb do align the header. Nothing good can come out of this for ((maclen % 4) != 0). Provide tcp_ao_len_aligned() helper and use it everywhere for TCP header options space calculations. Fixes: 1e03d32bea8e ("net/tcp: Add TCP-AO sign to outgoing packets") Signed-off-by: Dmitry Safonov Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit 714589c2742209cc228991b115e48548fb8d89cf Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Dec 4 19:00:40 2023 +0000 Documentation/tcp: Fix an obvious typo Yep, my VIM spellchecker is not good enough for typos like this one. Fixes: 7fe0e38bb669 ("Documentation/tcp: Add TCP-AO documentation") Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Reported-by: Markus Elfring Closes: https://lore.kernel.org/all/2745ab4e-acac-40d4-83bf-37f2600d0c3d@web.de/ Signed-off-by: Dmitry Safonov Signed-off-by: Paolo Abeni commit 6b07b5225d87f1ff212be9f95d527a3bb6b99adb Merge: cbe860be36095 f708aba40f9c1 Author: Paolo Abeni Date: Wed Dec 6 12:19:10 2023 +0100 Merge branch 'there-are-some-bugfix-for-the-hns-ethernet-driver' Jijie Shao says: ==================== There are some bugfix for the HNS ethernet driver There are some bugfix for the HNS ethernet driver --- changeLog: v2 -> v3: - Refine the commit msg as Wojciech suggestions - Reconstruct the "hns_mac_link_anti_shake" function suggested by Wojciech v2: https://lore.kernel.org/all/20231204011051.4055031-1-shaojijie@huawei.com/ v1 -> v2: - Fixed the internal function is not decorated with static issue, suggested by Jakub v1: https://lore.kernel.org/all/20231201102703.4134592-1-shaojijie@huawei.com/ --- ==================== Link: https://lore.kernel.org/r/20231204143232.3221542-1-shaojijie@huawei.com Signed-off-by: Paolo Abeni commit f708aba40f9c1eeb9c7e93ed4863b5f85b09b288 Author: Yonglong Liu Date: Mon Dec 4 22:32:32 2023 +0800 net: hns: fix fake link up on xge port If a xge port just connect with an optical module and no fiber, it may have a fake link up because there may be interference on the hardware. This patch adds an anti-shake to avoid the problem. And the time of anti-shake is base on tests. Fixes: b917078c1c10 ("net: hns: Add ACPI support to check SFP present") Signed-off-by: Yonglong Liu Signed-off-by: Jijie Shao Reviewed-by: Wojciech Drewek Signed-off-by: Paolo Abeni commit 84757d0839451b20b11e993128f0a77393ca50c1 Author: Yonglong Liu Date: Mon Dec 4 22:32:31 2023 +0800 net: hns: fix wrong head when modify the tx feature when sending packets Upon changing the tx feature, the hns driver will modify the maybe_stop_tx() and fill_desc() functions, if the modify happens during packet sending, will cause the hardware and software pointers do not match, and the port can not work anymore. This patch deletes the maybe_stop_tx() and fill_desc() functions modification when setting tx feature, and use the skb_is_gro() to determine which functions to use in the tx path. Fixes: 38f616da1c28 ("net:hns: Add support of ethtool TSO set option for Hip06 in HNS") Signed-off-by: Yonglong Liu Signed-off-by: Jijie Shao Reviewed-by: Wojciech Drewek Signed-off-by: Paolo Abeni commit cbe860be36095e68e4e5561ab43610982fb429fd Author: Daniil Maximov Date: Mon Dec 4 11:58:10 2023 +0300 net: atlantic: Fix NULL dereference of skb pointer in If is_ptp_ring == true in the loop of __aq_ring_xdp_clean function, then a timestamp is stored from a packet in a field of skb object, which is not allocated at the moment of the call (skb == NULL). Generalize aq_ptp_extract_ts and other affected functions so they don't work with struct sk_buff*, but with struct skb_shared_hwtstamps*. Found by Linux Verification Center (linuxtesting.org) with SVACE Fixes: 26efaef759a1 ("net: atlantic: Implement xdp data plane") Signed-off-by: Daniil Maximov Reviewed-by: Igor Russkikh Link: https://lore.kernel.org/r/20231204085810.1681386-1-daniil31415it@gmail.com Signed-off-by: Paolo Abeni commit 5c47251e8c4903111608ddcba2a77c0c425c247c Author: Herve Codina Date: Tue Nov 14 16:26:55 2023 +0100 lib/vsprintf: Fix %pfwf when current node refcount == 0 A refcount issue can appeared in __fwnode_link_del() due to the pr_debug() call: WARNING: CPU: 0 PID: 901 at lib/refcount.c:25 refcount_warn_saturate+0xe5/0x110 Call Trace: ... of_node_get+0x1e/0x30 of_fwnode_get+0x28/0x40 fwnode_full_name_string+0x34/0x90 fwnode_string+0xdb/0x140 ... vsnprintf+0x17b/0x630 ... __fwnode_link_del+0x25/0xa0 fwnode_links_purge+0x39/0xb0 of_node_release+0xd9/0x180 ... Indeed, an fwnode (of_node) is being destroyed and so, of_node_release() is called because the of_node refcount reached 0. From of_node_release() several function calls are done and lead to a pr_debug() calls with %pfwf to print the fwnode full name. The issue is not present if we change %pfwf to %pfwP. To print the full name, %pfwf iterates over the current node and its parents and obtain/drop a reference to all nodes involved. In order to allow to print the full name (%pfwf) of a node while it is being destroyed, do not obtain/drop a reference to this current node. Fixes: a92eb7621b9f ("lib/vsprintf: Make use of fwnode API to obtain node names and separators") Cc: stable@vger.kernel.org Signed-off-by: Herve Codina Reviewed-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20231114152655.409331-1-herve.codina@bootlin.com commit e0f04e41e8eedd4e5a1275f2318df7e1841855f2 Author: Thomas Zimmermann Date: Mon Dec 4 09:32:33 2023 +0100 drm/atomic-helpers: Invoke end_fb_access while owning plane state Invoke drm_plane_helper_funcs.end_fb_access before drm_atomic_helper_commit_hw_done(). The latter function hands over ownership of the plane state to the following commit, which might free it. Releasing resources in end_fb_access then operates on undefined state. This bug has been observed with non-blocking commits when they are being queued up quickly. Here is an example stack trace from the bug report. The plane state has been free'd already, so the pages for drm_gem_fb_vunmap() are gone. Unable to handle kernel paging request at virtual address 0000000100000049 [...] drm_gem_fb_vunmap+0x18/0x74 drm_gem_end_shadow_fb_access+0x1c/0x2c drm_atomic_helper_cleanup_planes+0x58/0xd8 drm_atomic_helper_commit_tail+0x90/0xa0 commit_tail+0x15c/0x188 commit_work+0x14/0x20 Fix this by running end_fb_access immediately after updating all planes in drm_atomic_helper_commit_planes(). The existing clean-up helper drm_atomic_helper_cleanup_planes() now only handles cleanup_fb. For aborted commits, roll back from drm_atomic_helper_prepare_planes() in the new helper drm_atomic_helper_unprepare_planes(). This case is different from regular cleanup, as we have to release the new state; regular cleanup releases the old state. The new helper also invokes cleanup_fb for all planes. The changes mostly involve DRM's atomic helpers. Only two drivers, i915 and nouveau, implement their own commit function. Update them to invoke drm_atomic_helper_unprepare_planes(). Drivers with custom commit_tail function do not require changes. v4: * fix documentation (kernel test robot) v3: * add drm_atomic_helper_unprepare_planes() for rolling back * use correct state for end_fb_access v2: * fix test in drm_atomic_helper_cleanup_planes() Reported-by: Alyssa Ross Closes: https://lore.kernel.org/dri-devel/87leazm0ya.fsf@alyssa.is/ Suggested-by: Daniel Vetter Fixes: 94d879eaf7fb ("drm/atomic-helper: Add {begin,end}_fb_access to plane helpers") Tested-by: Alyssa Ross Reviewed-by: Alyssa Ross Signed-off-by: Thomas Zimmermann Cc: # v6.2+ Link: https://patchwork.freedesktop.org/patch/msgid/20231204083247.22006-1-tzimmermann@suse.de commit 7037d95a047cd89b1f680eed253c6ab586bef1ed Author: Kelly Kane Date: Sat Dec 2 17:17:12 2023 -0800 r8152: add vendor/device ID pair for ASUS USB-C2500 The ASUS USB-C2500 is an RTL8156 based 2.5G Ethernet controller. Add the vendor and product ID values to the driver. This makes Ethernet work with the adapter. Signed-off-by: Kelly Kane Link: https://lore.kernel.org/r/20231203011712.6314-1-kelly@hawknetworks.com Signed-off-by: Paolo Abeni commit 37f3d6108730713c411827ab4af764909f4dfc78 Author: Sam Edwards Date: Tue Dec 5 12:29:00 2023 -0800 arm64: dts: rockchip: Fix eMMC Data Strobe PD on rk3588 JEDEC standard JESD84-B51 defines the eMMC Data Strobe line, which is currently used only in HS400 mode, as a device->host clock signal that "is used only in read operation. The Data Strobe is always High-Z (not driven by the device and pulled down by RDS) or Driven Low in write operation, except during CRC status response." RDS is a pull-down resistor specified in the 10K-100K ohm range. Thus per the standard, the Data Strobe is always pulled to ground (by the eMMC and/or RDS) during write operations. Evidently, the eMMC host controller in the RK3588 considers an active voltage on the eMMC-DS line during a write to be an error. The default (i.e. hardware reset, and Rockchip BSP) behavior for the RK3588 is to activate the eMMC-DS pin's builtin pull-down. As a result, many RK3588 board designers do not bother adding a dedicated RDS resistor, instead relying on the RK3588's internal bias. The current devicetree, however, disables this bias (`pcfg_pull_none`), breaking HS400-mode writes for boards without a dedicated RDS, but with an eMMC chip that chooses to High-Z (instead of drive-low) the eMMC-DS line. (The Turing RK1 is one such board.) Fix this by changing the bias in the (common) emmc_data_strobe case to reflect the expected hardware/BSP behavior. This is unlikely to cause regressions elsewhere: the pull-down is only relevant for High-Z eMMCs, and if this is redundant with a (dedicated) RDS resistor, the effective result is only a lower resistance to ground -- where the range of tolerance is quite high. If it does, it's better fixed in the specific devicetrees. Fixes: d85f8a5c798d5 ("arm64: dts: rockchip: Add rk3588 pinctrl data") Signed-off-by: Sam Edwards Link: https://lore.kernel.org/r/20231205202900.4617-2-CFSworks@gmail.com Signed-off-by: Heiko Stuebner commit 63ef8fc9bcee6b73ca445a19a7ac6bd544723c9f Author: Fabio Estevam Date: Tue Dec 5 10:27:35 2023 -0300 ARM: dts: imx28-xea: Pass the 'model' property Per root-node.yaml, 'model' is a required property. Pass it to fix the following dt-schema warning: imx28-xea.dtb: /: 'model' is a required property from schema $id: http://devicetree.org/schemas/root-node.yaml# Signed-off-by: Fabio Estevam Fixes: 445ae16ac1c5 ("ARM: dts: imx28: Add DTS description of imx28 based XEA board") Signed-off-by: Shawn Guo commit 80d875cfc9d3711a029f234ef7d680db79e8fa4b Author: Shigeru Yoshida Date: Sun Dec 3 01:14:41 2023 +0900 ipv4: ip_gre: Avoid skb_pull() failure in ipgre_xmit() In ipgre_xmit(), skb_pull() may fail even if pskb_inet_may_pull() returns true. For example, applications can use PF_PACKET to create a malformed packet with no IP header. This type of packet causes a problem such as uninit-value access. This patch ensures that skb_pull() can pull the required size by checking the skb with pskb_network_may_pull() before skb_pull(). Fixes: c54419321455 ("GRE: Refactor GRE tunneling code.") Signed-off-by: Shigeru Yoshida Reviewed-by: Eric Dumazet Reviewed-by: Suman Ghosh Link: https://lore.kernel.org/r/20231202161441.221135-1-syoshida@redhat.com Signed-off-by: Paolo Abeni commit 2b3a7a302c9804e463f2ea5b54dc3a6ad106a344 Author: Jason Zhang Date: Wed Dec 6 09:31:39 2023 +0800 ALSA: pcm: fix out-of-bounds in snd_pcm_state_names The pcm state can be SNDRV_PCM_STATE_DISCONNECTED at disconnect callback, and there is not an entry of SNDRV_PCM_STATE_DISCONNECTED in snd_pcm_state_names. This patch adds the missing entry to resolve this issue. cat /proc/asound/card2/pcm0p/sub0/status That results in stack traces like the following: [ 99.702732][ T5171] Unexpected kernel BRK exception at EL1 [ 99.702774][ T5171] Internal error: BRK handler: f2005512 [#1] PREEMPT SMP [ 99.703858][ T5171] Modules linked in: bcmdhd(E) (...) [ 99.747425][ T5171] CPU: 3 PID: 5171 Comm: cat Tainted: G C OE 5.10.189-android13-4-00003-g4a17384380d8-ab11086999 #1 [ 99.748447][ T5171] Hardware name: Rockchip RK3588 CVTE V10 Board (DT) [ 99.749024][ T5171] pstate: 60400005 (nZCv daif +PAN -UAO -TCO BTYPE=--) [ 99.749616][ T5171] pc : snd_pcm_substream_proc_status_read+0x264/0x2bc [ 99.750204][ T5171] lr : snd_pcm_substream_proc_status_read+0xa4/0x2bc [ 99.750778][ T5171] sp : ffffffc0175abae0 [ 99.751132][ T5171] x29: ffffffc0175abb80 x28: ffffffc009a2c498 [ 99.751665][ T5171] x27: 0000000000000001 x26: ffffff810cbae6e8 [ 99.752199][ T5171] x25: 0000000000400cc0 x24: ffffffc0175abc60 [ 99.752729][ T5171] x23: 0000000000000000 x22: ffffff802f558400 [ 99.753263][ T5171] x21: ffffff81d8d8ff00 x20: ffffff81020cdc00 [ 99.753795][ T5171] x19: ffffff802d110000 x18: ffffffc014fbd058 [ 99.754326][ T5171] x17: 0000000000000000 x16: 0000000000000000 [ 99.754861][ T5171] x15: 000000000000c276 x14: ffffffff9a976fda [ 99.755392][ T5171] x13: 0000000065689089 x12: 000000000000d72e [ 99.755923][ T5171] x11: ffffff802d110000 x10: 00000000000000e0 [ 99.756457][ T5171] x9 : 9c431600c8385d00 x8 : 0000000000000008 [ 99.756990][ T5171] x7 : 0000000000000000 x6 : 000000000000003f [ 99.757522][ T5171] x5 : 0000000000000040 x4 : ffffffc0175abb70 [ 99.758056][ T5171] x3 : 0000000000000001 x2 : 0000000000000001 [ 99.758588][ T5171] x1 : 0000000000000000 x0 : 0000000000000000 [ 99.759123][ T5171] Call trace: [ 99.759404][ T5171] snd_pcm_substream_proc_status_read+0x264/0x2bc [ 99.759958][ T5171] snd_info_seq_show+0x54/0xa4 [ 99.760370][ T5171] seq_read_iter+0x19c/0x7d4 [ 99.760770][ T5171] seq_read+0xf0/0x128 [ 99.761117][ T5171] proc_reg_read+0x100/0x1f8 [ 99.761515][ T5171] vfs_read+0xf4/0x354 [ 99.761869][ T5171] ksys_read+0x7c/0x148 [ 99.762226][ T5171] __arm64_sys_read+0x20/0x30 [ 99.762625][ T5171] el0_svc_common+0xd0/0x1e4 [ 99.763023][ T5171] el0_svc+0x28/0x98 [ 99.763358][ T5171] el0_sync_handler+0x8c/0xf0 [ 99.763759][ T5171] el0_sync+0x1b8/0x1c0 [ 99.764118][ T5171] Code: d65f03c0 b9406102 17ffffae 94191565 (d42aa240) [ 99.764715][ T5171] ---[ end trace 1eeffa3e17c58e10 ]--- [ 99.780720][ T5171] Kernel panic - not syncing: BRK handler: Fatal exception Signed-off-by: Jason Zhang Cc: Link: https://lore.kernel.org/r/20231206013139.20506-1-jason.zhang@rock-chips.com Signed-off-by: Takashi Iwai commit 397caf68e2d36532054cb14ae8995537f27f8b61 Author: Philipp Zabel Date: Mon Nov 27 17:05:01 2023 +0100 ARM: dts: imx7: Declare timers compatible with fsl,imx6dl-gpt The timer nodes declare compatibility with "fsl,imx6sx-gpt", which itself is compatible with "fsl,imx6dl-gpt". Switch the fallback compatible from "fsl,imx6sx-gpt" to "fsl,imx6dl-gpt". Fixes: 949673450291 ("ARM: dts: add imx7d soc dtsi file") Signed-off-by: Philipp Zabel Signed-off-by: Roland Hieber Signed-off-by: Shawn Guo commit 15a1c7f3e8d9c16e65644b83ad96895164fb2988 Author: Ahmad Fatoum Date: Mon Nov 27 06:34:14 2023 +0100 MAINTAINERS: reinstate freescale ARM64 DT directory in i.MX entry The MAINTAINERS entry's F: currently only matches the 32-bit device trees, as commit 724ba6751532 ("ARM: dts: Move .dts files to vendor sub-directories") inadvertently dropped the 64-bit DT match when it added the 32 bit matches. The entry has a N: imx, which reduced the impact a bit, but still some board device trees may not contain the substring and would thus not be covered by the entry. Reinstate the missing F: line to restore previous behavior. Fixes: 724ba6751532 ("ARM: dts: Move .dts files to vendor sub-directories") Signed-off-by: Ahmad Fatoum Signed-off-by: Shawn Guo commit 04179605ab604dba32571a05cd06423afc9eca19 Author: Stefan Eichenberger Date: Thu Nov 23 11:48:12 2023 +0100 arm64: dts: imx8-apalis: set wifi regulator to always-on Make sure that the wifi regulator is always on. The wifi driver itself puts the wifi module into suspend mode. If we cut the power the driver will crash when resuming from suspend. Signed-off-by: Stefan Eichenberger Signed-off-by: Francesco Dolcini Fixes: ad0de4ceb706 ("arm64: dts: freescale: add initial apalis imx8 aka quadmax module support") Signed-off-by: Shawn Guo commit 1c2b1049af3f86545fcc5fae0fc725fb64b3a09e Author: Kunwu Chan Date: Wed Nov 22 14:46:36 2023 +0800 ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init devm_kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Ensure the allocation was successful by checking the pointer validity. Release the id allocated in 'mmdc_pmu_init' when 'devm_kasprintf' return NULL Suggested-by: Ahmad Fatoum Fixes: e76bdfd7403a ("ARM: imx: Added perf functionality to mmdc driver") Signed-off-by: Kunwu Chan Signed-off-by: Shawn Guo commit 8ae06f1366390972fdcce0f0cee3cac0f63b3209 Author: Haibo Chen Date: Wed Nov 15 11:56:21 2023 +0800 arm64: dts: imx8ulp: update gpio node name to align with register address Change the gpio node name to align with register address. Fixes: ac7bcf48ddba ("arm64: dts: imx8ulp: update gpio node") Signed-off-by: Haibo Chen Reviewed-by: Marco Felsch Signed-off-by: Shawn Guo commit 4af1b258b68c5c948601082d5ce858ba31eb64f4 Author: Haibo Chen Date: Wed Nov 15 11:56:20 2023 +0800 arm64: dts: imx93: update gpio node name to align with register address Change the gpio node name to align with register address Fixes: c1d0782b5fc3 ("arm64: dts: imx93: update gpio node") Signed-off-by: Haibo Chen Reviewed-by: Marco Felsch Signed-off-by: Shawn Guo commit d4cb68a5d3a1ed30ecaf1591eb901523faa13496 Author: Peng Fan Date: Mon Nov 13 18:02:29 2023 +0800 arm64: dts: imx93: correct mediamix power "nic_media" clock should be enabled when power on/off mediamix, otherwise power on/off will fail. Because "media_axi_root" clock is the parent of "nic_media" clock, so replace "media_axi_clock" clock with "nic_media" clock in mediamix node. Link: https://github.com/nxp-imx/linux-imx/commit/ce18e6d0071ae9df5486af8613708ebe920484be Fixes: f2d03ba997cb ("arm64: dts: imx93: reorder device nodes") Fixes: e85d3458a804 ("arm64: dts: imx93: add src node") Reviewed-by: Jacky Bai Signed-off-by: Peng Fan Signed-off-by: Liu Ying Signed-off-by: Shawn Guo commit b37e75bddc35d4a40a4caeb9921cb95c33c3eba9 Author: Xiaolei Wang Date: Fri Nov 10 15:25:31 2023 +0800 arm64: dts: imx8qm: Add imx8qm's own pm to avoid panic during startup Add imx8qm's own pm, otherwise the following panic will occur during the startup process: Kernel panic - not syncing: Asynchronous SError Interrupt Hardware name: Freescale i.MX8QM MEK (DT) Workqueue: events_unbound deferred_probe_work_func Call trace: dump_backtrace+0x98/0xf0 show_stack+0x18/0x24 dump_stack_lvl+0x60/0xac dump_stack+0x18/0x24 panic+0x340/0x3a0 nmi_panic+0x8c/0x90 arm64_serror_panic+0x6c/0x78 do_serror+0x3c/0x78 el1h_64_error_handler+0x38/0x50 el1h_64_error+0x64/0x68 fsl_edma_chan_mux+0x98/0xdc fsl_edma_probe+0x278/0x898 platform_probe+0x68/0xd8 really_probe+0x110/0x27c __driver_probe_device+0x78/0x12c driver_probe_device+0x3c/0x118 __device_attach_driver+0xb8/0xf8 bus_for_each_drv+0x84/0xe4 __device_attach+0xfc/0x18c device_initial_probe+0x14/0x20 Fixes: e4d7a330fb7a ("arm64: dts: imx8: add edma[0..3]") Signed-off-by: Xiaolei Wang Signed-off-by: Shawn Guo commit 7cef7c0b1dea1e17c7913826b74403f4ab7edeb9 Author: Alexander Stein Date: Mon Nov 6 16:13:26 2023 +0100 arm64: dts: freescale: imx8-ss-dma: Fix #pwm-cells i.MX8QXP supports inverted PWM output, thus #pwm-cells needs to be set to 3. Fixes: f1d6a6b991ef9 ("arm64: dts: imx8qxp: add adma_pwm in adma") Signed-off-by: Alexander Stein Reviewed-by: Uwe Kleine-König Signed-off-by: Shawn Guo commit d863a2f4f47560d71447650822857fc3d2aea715 Author: Alexander Stein Date: Mon Nov 6 16:13:25 2023 +0100 arm64: dts: freescale: imx8-ss-lsio: Fix #pwm-cells i.MX8QM/QXP supports inverted PWM output, thus #pwm-cells needs to be set to 3. Fixes: 23fa99b205ea ("arm64: dts: freescale: imx8-ss-lsio: add support for lsio_pwm0-3") Signed-off-by: Alexander Stein Reviewed-by: Uwe Kleine-König Signed-off-by: Shawn Guo commit 5796230582f6131fa217f0a1700783c459c847d2 Author: Brian Foster Date: Tue Dec 5 08:24:38 2023 -0500 bcachefs: don't attempt rw on unfreeze when shutdown The internal freeze mechanism in bcachefs mostly reuses the generic rw<->ro transition code. If the fs happens to shutdown during or after freeze, a transition back to rw can fail. This is expected, but returning an error from the unfreeze callout prevents the filesystem from being unfrozen. Skip the read write transition if the fs is shutdown. This allows the fs to unfreeze at the vfs level so writes will no longer block, but will still fail due to the emergency read-only state of the fs. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 7aebaabfede75feda5c5d16991da74124aee428d Author: Kent Overstreet Date: Mon Dec 4 15:44:15 2023 -0500 bcachefs: Fix creating snapshot with implict source When creating a snapshot without specifying the source subvolume, we use the subvolume containing the new snapshot. Previously, this worked if the directory containing the new snapshot was the subvolume root - but we were using the incorrect helper, and got a subvolume ID of 0 when the parent directory wasn't the root of the subvolume, causing an emergency read-only. Signed-off-by: Kent Overstreet commit efd563ff1a7e692408c9d44bec3d90949f7a9557 Merge: 58d3aade20cdd 4115ba677c35f Author: Jakub Kicinski Date: Tue Dec 5 20:20:22 2023 -0800 Merge branch 'ionic-small-driver-fixes' Shannon Nelson says: ==================== ionic: small driver fixes This is a pair of fixes to address a DIM issue and a kernel test robot complaint v1: https://lore.kernel.org/netdev/20231201000519.13363-1-shannon.nelson@amd.com/ ==================== Link: https://lore.kernel.org/r/20231204192234.21017-1-shannon.nelson@amd.com Signed-off-by: Jakub Kicinski commit 4115ba677c35f694b62298e55f0e04ce84eed469 Author: Brett Creeley Date: Mon Dec 4 11:22:34 2023 -0800 ionic: Fix dim work handling in split interrupt mode Currently ionic_dim_work() is incorrect when in split interrupt mode. This is because the interrupt rate is only being changed for the Rx side even for dim running on Tx. Fix this by using the qcq from the container_of macro. Also, introduce some local variables for a bit of cleanup. Fixes: a6ff85e0a2d9 ("ionic: remove intr coalesce update from napi") Signed-off-by: Brett Creeley Signed-off-by: Shannon Nelson Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20231204192234.21017-3-shannon.nelson@amd.com Signed-off-by: Jakub Kicinski commit 0ceb3860a67652f9d36dfdecfcd2cb3eb2f4537d Author: Shannon Nelson Date: Mon Dec 4 11:22:33 2023 -0800 ionic: fix snprintf format length warning Our friendly kernel test robot has reminded us that with a new check we have a warning about a potential string truncation. In this case it really doesn't hurt anything, but it is worth addressing especially since there really is no reason to reserve so many bytes for our queue names. It seems that cutting the queue name buffer length in half stops the complaint. Fixes: c06107cabea3 ("ionic: more ionic name tweaks") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311300201.lO8v7mKU-lkp@intel.com/ Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20231204192234.21017-2-shannon.nelson@amd.com Signed-off-by: Jakub Kicinski commit 58d3aade20cdddbac6c9707ac0f3f5f8c1278b74 Author: Paolo Abeni Date: Mon Dec 4 17:08:05 2023 +0100 tcp: fix mid stream window clamp. After the blamed commit below, if the user-space application performs window clamping when tp->rcv_wnd is 0, the TCP socket will never be able to announce a non 0 receive window, even after completely emptying the receive buffer and re-setting the window clamp to higher values. Refactor tcp_set_window_clamp() to address the issue: when the user decreases the current clamp value, set rcv_ssthresh according to the same logic used at buffer initialization, but ensuring reserved mem provisioning. To avoid code duplication factor-out the relevant bits from tcp_adjust_rcv_ssthresh() in a new helper and reuse it in the above scenario. When increasing the clamp value, give the rcv_ssthresh a chance to grow according to previously implemented heuristic. Fixes: 3aa7857fe1d7 ("tcp: enable mid stream window clamp") Reported-by: David Gibson Reported-by: Stefano Brivio Signed-off-by: Paolo Abeni Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/705dad54e6e6e9a010e571bf58e0b35a8ae70503.1701706073.git.pabeni@redhat.com Signed-off-by: Jakub Kicinski commit d007caaaf052f82ca2340d4c7b32d04a3f5dbf3f Author: Dinghao Liu Date: Mon Dec 4 10:40:04 2023 +0800 net: bnxt: fix a potential use-after-free in bnxt_init_tc When flow_indr_dev_register() fails, bnxt_init_tc will free bp->tc_info through kfree(). However, the caller function bnxt_init_one() will ignore this failure and call bnxt_shutdown_tc() on failure of bnxt_dl_register(), where a use-after-free happens. Fix this issue by setting bp->tc_info to NULL after kfree(). Fixes: 627c89d00fb9 ("bnxt_en: flow_offload: offload tunnel decap rules via indirect callbacks") Signed-off-by: Dinghao Liu Reviewed-by: Pavan Chebbi Reviewed-by: Michael Chan Reviewed-by: Somnath Kotur Link: https://lore.kernel.org/r/20231204024004.8245-1-dinghao.liu@zju.edu.cn Signed-off-by: Jakub Kicinski commit a61f46e1102545cf1fb5f19992288265362cefb0 Author: Lorenzo Bianconi Date: Mon Dec 4 16:01:48 2023 +0100 net: veth: fix packet segmentation in veth_convert_skb_to_xdp_buff Based on the previous allocated packet, page_offset can be not null in veth_convert_skb_to_xdp_buff routine. Take into account page fragment offset during the skb paged area copy in veth_convert_skb_to_xdp_buff(). Fixes: 2d0de67da51a ("net: veth: use newly added page pool API for veth with xdp") Signed-off-by: Lorenzo Bianconi Reviewed-by: Yunsheng Lin Link: https://lore.kernel.org/r/eddfe549e7e626870071930964ac3c38a1dc8068.1701702000.git.lorenzo@kernel.org Signed-off-by: Jakub Kicinski commit 5101ada56f845e9701440f62fc68a76fc0d711ef Merge: fcc9b50e5517f 862c135bde8bc Author: Greg Kroah-Hartman Date: Wed Dec 6 12:13:30 2023 +0900 Merge tag 'coresight-fixes-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux into char-misc-next Suzuki writes: coresight: Fixes for v6.7-rc1 Here are a few fixes for the hwtracing subsystem targetting v6.7. Includes: - Ultrasoc-SMB driver fixes - HiSilicon PTT driver fixes - Corsight driver fixes Signed-off-by: Suzuki K Poulose * tag 'coresight-fixes-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux: coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base coresight: ultrasoc-smb: Config SMB buffer before register sink coresight: ultrasoc-smb: Fix sleep while close preempt in enable_smb Documentation: coresight: fix `make refcheckdocs` warning hwtracing: hisi_ptt: Don't try to attach a task hwtracing: hisi_ptt: Handle the interrupt in hardirq context hwtracing: hisi_ptt: Add dummy callback pmu::read() coresight: Fix crash when Perf and sysfs modes are used concurrently coresight: etm4x: Remove bogous __exit annotation for some functions commit 691a41d8da4b34fe72f09393505f55f28a8f34ec Author: David Howells Date: Mon Dec 4 14:01:59 2023 +0000 cifs: Fix non-availability of dedup breaking generic/304 Deduplication isn't supported on cifs, but cifs doesn't reject it, instead treating it as extent duplication/cloning. This can cause generic/304 to go silly and run for hours on end. Fix cifs to indicate EOPNOTSUPP if REMAP_FILE_DEDUP is set in ->remap_file_range(). Note that it's unclear whether or not commit b073a08016a1 is meant to cause cifs to return an error if REMAP_FILE_DEDUP. Fixes: b073a08016a1 ("cifs: fix that return -EINVAL when do dedupe operation") Cc: stable@vger.kernel.org Suggested-by: Dave Chinner cc: Xiaoli Feng cc: Shyam Prasad N cc: Rohith Surabattula cc: Jeff Layton cc: Darrick Wong cc: fstests@vger.kernel.org cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/3876191.1701555260@warthog.procyon.org.uk/ Signed-off-by: David Howells Signed-off-by: Steve French commit 92414333eb375ed64f4ae92d34d579e826936480 Author: Paulo Alcantara Date: Tue Dec 5 21:49:29 2023 -0300 smb: client: fix potential NULL deref in parse_dfs_referrals() If server returned no data for FSCTL_DFS_GET_REFERRALS, @dfs_rsp will remain NULL and then parse_dfs_referrals() will dereference it. Fix this by returning -EIO when no output data is returned. Besides, we can't fix it in SMB2_ioctl() as some FSCTLs are allowed to return no data as per MS-SMB2 2.2.32. Fixes: 9d49640a21bf ("CIFS: implement get_dfs_refer for SMB2+") Cc: stable@vger.kernel.org Reported-by: Robert Morris Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit eb547407f3572d2110cb1194ecd8865b3371a7a4 Author: Namjae Jeon Date: Tue Dec 5 21:02:03 2023 +0900 ksmbd: downgrade RWH lease caching state to RH for directory RWH(Read + Write + Handle) caching state is not supported for directory. ksmbd downgrade it to RH for directory if client send RWH caching lease state. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 18dd1c367c31d0a060f737d48345747662369b64 Author: Namjae Jeon Date: Mon Dec 4 22:10:16 2023 +0900 ksmbd: set v2 lease capability Set SMB2_GLOBAL_CAP_DIRECTORY_LEASING to ->capabilities to inform server support directory lease to client. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit d045850b628aaf931fc776c90feaf824dca5a1cf Author: Namjae Jeon Date: Mon Dec 4 22:07:03 2023 +0900 ksmbd: set epoch in create context v2 lease To support v2 lease(directory lease), ksmbd set epoch in create context v2 lease response. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 8f1752723019db900fb60a5b9d0dfd3a2bdea36c Author: Zizhi Wo Date: Fri Dec 1 22:50:48 2023 +0800 ksmbd: fix memory leak in smb2_lock() In smb2_lock(), if setup_async_work() executes successfully, work->cancel_argv will bind the argv that generated by kmalloc(). And release_async_work() is called in ksmbd_conn_try_dequeue_request() or smb2_lock() to release argv. However, when setup_async_work function fails, work->cancel_argv has not been bound to the argv, resulting in the previously allocated argv not being released. Call kfree() to fix it. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Signed-off-by: Zizhi Wo Acked-by: Namjae Jeon Signed-off-by: Steve French commit 235f2b548d7f4ac5931d834f05d3f7f5166a2e72 Author: Dinghao Liu Date: Thu Nov 23 16:19:41 2023 +0800 scsi: be2iscsi: Fix a memleak in beiscsi_init_wrb_handle() When an error occurs in the for loop of beiscsi_init_wrb_handle(), we should free phwi_ctxt->be_wrbq before returning an error code to prevent potential memleak. Fixes: a7909b396ba7 ("[SCSI] be2iscsi: Fix dynamic CID allocation Mechanism in driver") Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20231123081941.24854-1-dinghao.liu@zju.edu.cn Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen commit c0591b1cccf708a47bc465c62436d669a4213323 Author: Petr Pavlu Date: Tue Dec 5 17:17:36 2023 +0100 tracing: Fix a possible race when disabling buffered events Function trace_buffered_event_disable() is responsible for freeing pages backing buffered events and this process can run concurrently with trace_event_buffer_lock_reserve(). The following race is currently possible: * Function trace_buffered_event_disable() is called on CPU 0. It increments trace_buffered_event_cnt on each CPU and waits via synchronize_rcu() for each user of trace_buffered_event to complete. * After synchronize_rcu() is finished, function trace_buffered_event_disable() has the exclusive access to trace_buffered_event. All counters trace_buffered_event_cnt are at 1 and all pointers trace_buffered_event are still valid. * At this point, on a different CPU 1, the execution reaches trace_event_buffer_lock_reserve(). The function calls preempt_disable_notrace() and only now enters an RCU read-side critical section. The function proceeds and reads a still valid pointer from trace_buffered_event[CPU1] into the local variable "entry". However, it doesn't yet read trace_buffered_event_cnt[CPU1] which happens later. * Function trace_buffered_event_disable() continues. It frees trace_buffered_event[CPU1] and decrements trace_buffered_event_cnt[CPU1] back to 0. * Function trace_event_buffer_lock_reserve() continues. It reads and increments trace_buffered_event_cnt[CPU1] from 0 to 1. This makes it believe that it can use the "entry" that it already obtained but the pointer is now invalid and any access results in a use-after-free. Fix the problem by making a second synchronize_rcu() call after all trace_buffered_event values are set to NULL. This waits on all potential users in trace_event_buffer_lock_reserve() that still read a previous pointer from trace_buffered_event. Link: https://lore.kernel.org/all/20231127151248.7232-2-petr.pavlu@suse.com/ Link: https://lkml.kernel.org/r/20231205161736.19663-4-petr.pavlu@suse.com Cc: stable@vger.kernel.org Fixes: 0fc1b09ff1ff ("tracing: Use temp buffer when filtering events") Signed-off-by: Petr Pavlu Signed-off-by: Steven Rostedt (Google) commit 34209fe83ef8404353f91ab4ea4035dbc9922d04 Author: Petr Pavlu Date: Tue Dec 5 17:17:35 2023 +0100 tracing: Fix a warning when allocating buffered events fails Function trace_buffered_event_disable() produces an unexpected warning when the previous call to trace_buffered_event_enable() fails to allocate pages for buffered events. The situation can occur as follows: * The counter trace_buffered_event_ref is at 0. * The soft mode gets enabled for some event and trace_buffered_event_enable() is called. The function increments trace_buffered_event_ref to 1 and starts allocating event pages. * The allocation fails for some page and trace_buffered_event_disable() is called for cleanup. * Function trace_buffered_event_disable() decrements trace_buffered_event_ref back to 0, recognizes that it was the last use of buffered events and frees all allocated pages. * The control goes back to trace_buffered_event_enable() which returns. The caller of trace_buffered_event_enable() has no information that the function actually failed. * Some time later, the soft mode is disabled for the same event. Function trace_buffered_event_disable() is called. It warns on "WARN_ON_ONCE(!trace_buffered_event_ref)" and returns. Buffered events are just an optimization and can handle failures. Make trace_buffered_event_enable() exit on the first failure and left any cleanup later to when trace_buffered_event_disable() is called. Link: https://lore.kernel.org/all/20231127151248.7232-2-petr.pavlu@suse.com/ Link: https://lkml.kernel.org/r/20231205161736.19663-3-petr.pavlu@suse.com Fixes: 0fc1b09ff1ff ("tracing: Use temp buffer when filtering events") Signed-off-by: Petr Pavlu Signed-off-by: Steven Rostedt (Google) commit 7fed14f7ac9cf5e38c693836fe4a874720141845 Author: Petr Pavlu Date: Tue Dec 5 17:17:34 2023 +0100 tracing: Fix incomplete locking when disabling buffered events The following warning appears when using buffered events: [ 203.556451] WARNING: CPU: 53 PID: 10220 at kernel/trace/ring_buffer.c:3912 ring_buffer_discard_commit+0x2eb/0x420 [...] [ 203.670690] CPU: 53 PID: 10220 Comm: stress-ng-sysin Tainted: G E 6.7.0-rc2-default #4 56e6d0fcf5581e6e51eaaecbdaec2a2338c80f3a [ 203.670704] Hardware name: Intel Corp. GROVEPORT/GROVEPORT, BIOS GVPRCRB1.86B.0016.D04.1705030402 05/03/2017 [ 203.670709] RIP: 0010:ring_buffer_discard_commit+0x2eb/0x420 [ 203.735721] Code: 4c 8b 4a 50 48 8b 42 48 49 39 c1 0f 84 b3 00 00 00 49 83 e8 01 75 b1 48 8b 42 10 f0 ff 40 08 0f 0b e9 fc fe ff ff f0 ff 47 08 <0f> 0b e9 77 fd ff ff 48 8b 42 10 f0 ff 40 08 0f 0b e9 f5 fe ff ff [ 203.735734] RSP: 0018:ffffb4ae4f7b7d80 EFLAGS: 00010202 [ 203.735745] RAX: 0000000000000000 RBX: ffffb4ae4f7b7de0 RCX: ffff8ac10662c000 [ 203.735754] RDX: ffff8ac0c750be00 RSI: ffff8ac10662c000 RDI: ffff8ac0c004d400 [ 203.781832] RBP: ffff8ac0c039cea0 R08: 0000000000000000 R09: 0000000000000000 [ 203.781839] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 203.781842] R13: ffff8ac10662c000 R14: ffff8ac0c004d400 R15: ffff8ac10662c008 [ 203.781846] FS: 00007f4cd8a67740(0000) GS:ffff8ad798880000(0000) knlGS:0000000000000000 [ 203.781851] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 203.781855] CR2: 0000559766a74028 CR3: 00000001804c4000 CR4: 00000000001506f0 [ 203.781862] Call Trace: [ 203.781870] [ 203.851949] trace_event_buffer_commit+0x1ea/0x250 [ 203.851967] trace_event_raw_event_sys_enter+0x83/0xe0 [ 203.851983] syscall_trace_enter.isra.0+0x182/0x1a0 [ 203.851990] do_syscall_64+0x3a/0xe0 [ 203.852075] entry_SYSCALL_64_after_hwframe+0x6e/0x76 [ 203.852090] RIP: 0033:0x7f4cd870fa77 [ 203.982920] Code: 00 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 66 90 b8 89 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e9 43 0e 00 f7 d8 64 89 01 48 [ 203.982932] RSP: 002b:00007fff99717dd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000089 [ 203.982942] RAX: ffffffffffffffda RBX: 0000558ea1d7b6f0 RCX: 00007f4cd870fa77 [ 203.982948] RDX: 0000000000000000 RSI: 00007fff99717de0 RDI: 0000558ea1d7b6f0 [ 203.982957] RBP: 00007fff99717de0 R08: 00007fff997180e0 R09: 00007fff997180e0 [ 203.982962] R10: 00007fff997180e0 R11: 0000000000000246 R12: 00007fff99717f40 [ 204.049239] R13: 00007fff99718590 R14: 0000558e9f2127a8 R15: 00007fff997180b0 [ 204.049256] For instance, it can be triggered by running these two commands in parallel: $ while true; do echo hist:key=id.syscall:val=hitcount > \ /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/trigger; done $ stress-ng --sysinfo $(nproc) The warning indicates that the current ring_buffer_per_cpu is not in the committing state. It happens because the active ring_buffer_event doesn't actually come from the ring_buffer_per_cpu but is allocated from trace_buffered_event. The bug is in function trace_buffered_event_disable() where the following normally happens: * The code invokes disable_trace_buffered_event() via smp_call_function_many() and follows it by synchronize_rcu(). This increments the per-CPU variable trace_buffered_event_cnt on each target CPU and grants trace_buffered_event_disable() the exclusive access to the per-CPU variable trace_buffered_event. * Maintenance is performed on trace_buffered_event, all per-CPU event buffers get freed. * The code invokes enable_trace_buffered_event() via smp_call_function_many(). This decrements trace_buffered_event_cnt and releases the access to trace_buffered_event. A problem is that smp_call_function_many() runs a given function on all target CPUs except on the current one. The following can then occur: * Task X executing trace_buffered_event_disable() runs on CPU 0. * The control reaches synchronize_rcu() and the task gets rescheduled on another CPU 1. * The RCU synchronization finishes. At this point, trace_buffered_event_disable() has the exclusive access to all trace_buffered_event variables except trace_buffered_event[CPU0] because trace_buffered_event_cnt[CPU0] is never incremented and if the buffer is currently unused, remains set to 0. * A different task Y is scheduled on CPU 0 and hits a trace event. The code in trace_event_buffer_lock_reserve() sees that trace_buffered_event_cnt[CPU0] is set to 0 and decides the use the buffer provided by trace_buffered_event[CPU0]. * Task X continues its execution in trace_buffered_event_disable(). The code incorrectly frees the event buffer pointed by trace_buffered_event[CPU0] and resets the variable to NULL. * Task Y writes event data to the now freed buffer and later detects the created inconsistency. The issue is observable since commit dea499781a11 ("tracing: Fix warning in trace_buffered_event_disable()") which moved the call of trace_buffered_event_disable() in __ftrace_event_enable_disable() earlier, prior to invoking call->class->reg(.. TRACE_REG_UNREGISTER ..). The underlying problem in trace_buffered_event_disable() is however present since the original implementation in commit 0fc1b09ff1ff ("tracing: Use temp buffer when filtering events"). Fix the problem by replacing the two smp_call_function_many() calls with on_each_cpu_mask() which invokes a given callback on all CPUs. Link: https://lore.kernel.org/all/20231127151248.7232-2-petr.pavlu@suse.com/ Link: https://lkml.kernel.org/r/20231205161736.19663-2-petr.pavlu@suse.com Cc: stable@vger.kernel.org Fixes: 0fc1b09ff1ff ("tracing: Use temp buffer when filtering events") Fixes: dea499781a11 ("tracing: Fix warning in trace_buffered_event_disable()") Signed-off-by: Petr Pavlu Signed-off-by: Steven Rostedt (Google) commit b538bf7d0ec11ca49f536dfda742a5f6db90a798 Author: Steven Rostedt (Google) Date: Tue Dec 5 16:52:11 2023 -0500 tracing: Disable snapshot buffer when stopping instance tracers It use to be that only the top level instance had a snapshot buffer (for latency tracers like wakeup and irqsoff). When stopping a tracer in an instance would not disable the snapshot buffer. This could have some unintended consequences if the irqsoff tracer is enabled. Consolidate the tracing_start/stop() with tracing_start/stop_tr() so that all instances behave the same. The tracing_start/stop() functions will just call their respective tracing_start/stop_tr() with the global_array passed in. Link: https://lkml.kernel.org/r/20231205220011.041220035@goodmis.org Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Andrew Morton Fixes: 6d9b3fa5e7f6 ("tracing: Move tracing_max_latency into trace_array") Signed-off-by: Steven Rostedt (Google) commit d78ab792705c7be1b91243b2544d1a79406a2ad7 Author: Steven Rostedt (Google) Date: Tue Dec 5 16:52:10 2023 -0500 tracing: Stop current tracer when resizing buffer When the ring buffer is being resized, it can cause side effects to the running tracer. For instance, there's a race with irqsoff tracer that swaps individual per cpu buffers between the main buffer and the snapshot buffer. The resize operation modifies the main buffer and then the snapshot buffer. If a swap happens in between those two operations it will break the tracer. Simply stop the running tracer before resizing the buffers and enable it again when finished. Link: https://lkml.kernel.org/r/20231205220010.748996423@goodmis.org Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Andrew Morton Fixes: 3928a8a2d9808 ("ftrace: make work with new ring buffer") Signed-off-by: Steven Rostedt (Google) commit 7be76461f302ec05cbd62b90b2a05c64299ca01f Author: Steven Rostedt (Google) Date: Tue Dec 5 16:52:09 2023 -0500 tracing: Always update snapshot buffer size It use to be that only the top level instance had a snapshot buffer (for latency tracers like wakeup and irqsoff). The update of the ring buffer size would check if the instance was the top level and if so, it would also update the snapshot buffer as it needs to be the same as the main buffer. Now that lower level instances also has a snapshot buffer, they too need to update their snapshot buffer sizes when the main buffer is changed, otherwise the following can be triggered: # cd /sys/kernel/tracing # echo 1500 > buffer_size_kb # mkdir instances/foo # echo irqsoff > instances/foo/current_tracer # echo 1000 > instances/foo/buffer_size_kb Produces: WARNING: CPU: 2 PID: 856 at kernel/trace/trace.c:1938 update_max_tr_single.part.0+0x27d/0x320 Which is: ret = ring_buffer_swap_cpu(tr->max_buffer.buffer, tr->array_buffer.buffer, cpu); if (ret == -EBUSY) { [..] } WARN_ON_ONCE(ret && ret != -EAGAIN && ret != -EBUSY); <== here That's because ring_buffer_swap_cpu() has: int ret = -EINVAL; [..] /* At least make sure the two buffers are somewhat the same */ if (cpu_buffer_a->nr_pages != cpu_buffer_b->nr_pages) goto out; [..] out: return ret; } Instead, update all instances' snapshot buffer sizes when their main buffer size is updated. Link: https://lkml.kernel.org/r/20231205220010.454662151@goodmis.org Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Andrew Morton Fixes: 6d9b3fa5e7f6 ("tracing: Move tracing_max_latency into trace_array") Signed-off-by: Steven Rostedt (Google) commit bdefd9913bdd453991ef756b6f7176e8ad80d786 Author: Lukasz Luba Date: Fri Dec 1 12:32:05 2023 +0000 powercap: DTPM: Fix missing cpufreq_cpu_put() calls The policy returned by cpufreq_cpu_get() has to be released with the help of cpufreq_cpu_put() to balance its kobject reference counter properly. Add the missing calls to cpufreq_cpu_put() in the code. Fixes: 0aea2e4ec2a2 ("powercap/dtpm_cpu: Reset per_cpu variable in the release function") Fixes: 0e8f68d7f048 ("powercap/drivers/dtpm: Add CPU energy model based support") Cc: v5.16+ # v5.16+ Signed-off-by: Lukasz Luba Signed-off-by: Rafael J. Wysocki commit 24be0b3c40594a14b65141ced486ae327398faf8 Author: Mathias Nyman Date: Tue Dec 5 11:05:48 2023 +0200 Revert "xhci: Loosen RPM as default policy to cover for AMD xHC 1.1" This reverts commit 4baf1218150985ee3ab0a27220456a1f027ea0ac. Enabling runtime pm as default for all AMD xHC 1.1 controllers caused regression. An initial attempt to fix those was done in commit a5d6264b638e ("xhci: Enable RPM on controllers that support low-power states") but new issues are still seen. Revert this to get those AMD xHC 1.1 systems working This patch went to stable an needs to be reverted from there as well. Fixes: 4baf12181509 ("xhci: Loosen RPM as default policy to cover for AMD xHC 1.1") Link: https://lore.kernel.org/linux-usb/55c50bf5-bffb-454e-906e-4408c591cb63@molgen.mpg.de Cc: Mario Limonciello Cc: Basavaraj Natikar Cc: stable@vger.kernel.org Signed-off-by: Mathias Nyman Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20231205090548.1377667-1-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit b1693747487442984050eb0f462b83a3a8307525 Author: Ian Rogers Date: Wed Nov 29 13:34:26 2023 -0800 perf list: Fix JSON segfault by setting the used skip_duplicate_pmus callback Json output didn't set the skip_duplicate_pmus callback yielding a segfault. Fixes: cd4e1efbbc40 ("perf pmus: Skip duplicate PMUs and don't print list suffix by default") Signed-off-by: Ian Rogers Cc: James Clark Cc: Kan Liang Cc: Athira Rajeev Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231129213428.2227448-2-irogers@google.com [namhyung: updated subject line according to Arnaldo] Signed-off-by: Namhyung Kim commit a206d9959f5ccd0fb2d54a997c993947ae0e881c Author: Jacob Keller Date: Mon Nov 27 15:33:50 2023 -0800 iavf: validate tx_coalesce_usecs even if rx_coalesce_usecs is zero In __iavf_set_coalesce, the driver checks both ec->rx_coalesce_usecs and ec->tx_coalesce_usecs for validity. It does this via a chain if if/else-if blocks. If every single branch of the series of if statements exited, this would be fine. However, the rx_coalesce_usecs is checked against zero to print an informative message if use_adaptive_rx_coalesce is enabled. If this check is true, it short circuits the entire chain of statements, preventing validation of the tx_coalesce_usecs field. Indeed, since commit e792779e6b63 ("iavf: Prevent changing static ITR values if adaptive moderation is on") the iavf driver actually rejects any change to the tx_coalesce_usecs or rx_coalesce_usecs when use_adaptive_tx_coalesce or use_adaptive_rx_coalesce is enabled, making this checking a bit redundant. Fix this error by removing the unnecessary and redundant checks for use_adaptive_rx_coalesce and use_adaptive_tx_coalesce. Since zero is a valid value, and since the tx_coalesce_usecs and rx_coalesce_usecs fields are already unsigned, remove the minimum value check. This allows assigning an ITR value ranging from 0-8160 as described by the printed message. Fixes: 65e87c0398f5 ("i40evf: support queue-specific settings for interrupt moderation") Signed-off-by: Jacob Keller Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 7d9f22b3d3ef379ed05bd3f3e2de83dfa8da8258 Author: Ivan Vecera Date: Fri Nov 10 09:12:09 2023 +0100 i40e: Fix unexpected MFS warning message Commit 3a2c6ced90e1 ("i40e: Add a check to see if MFS is set") added a warning message that reports unexpected size of port's MFS (max frame size) value. This message use for the port number local variable 'i' that is wrong. In i40e_probe() this 'i' variable is used only to iterate VSIs to find FDIR VSI: ... /* if FDIR VSI was set up, start it now */ for (i = 0; i < pf->num_alloc_vsi; i++) { if (pf->vsi[i] && pf->vsi[i]->type == I40E_VSI_FDIR) { i40e_vsi_open(pf->vsi[i]); break; } } ... So the warning message use for the port number index of FDIR VSI if this exists or pf->num_alloc_vsi if not. Fix the message by using 'pf->hw.port' for the port number. Fixes: 3a2c6ced90e1 ("i40e: Add a check to see if MFS is set") Signed-off-by: Ivan Vecera Reviewed-by: Simon Horman Signed-off-by: Tony Nguyen commit 4e7f0087b058cc3cab8f3c32141b51aa5457d298 Author: Marcin Szycik Date: Tue Nov 7 14:51:38 2023 +0100 ice: Restore fix disabling RX VLAN filtering Fix setting dis_rx_filtering depending on whether port vlan is being turned on or off. This was originally fixed in commit c793f8ea15e3 ("ice: Fix disabling Rx VLAN filtering with port VLAN enabled"), but while refactoring ice_vf_vsi_init_vlan_ops(), the fix has been lost. Restore the fix along with the original comment from that change. Also delete duplicate lines in ice_port_vlan_on(). Fixes: 2946204b3fa8 ("ice: implement bridge port vlan") Reviewed-by: Wojciech Drewek Signed-off-by: Marcin Szycik Reviewed-by: Simon Horman Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit f8e9889f54da6e3146c2cb3f5c206cf1a704f9d3 Author: Michal Swiatkowski Date: Tue Oct 24 16:20:10 2023 +0200 ice: change vfs.num_msix_per to vf->num_msix vfs::num_msix_per should be only used as default value for vf->num_msix. For other use cases vf->num_msix should be used, as VF can have different MSI-X amount values. Fix incorrect register index calculation. vfs::num_msix_per and pf->sriov_base_vector shouldn't be used after implementation of changing MSI-X amount on VFs. Instead vf->first_vector_idx should be used, as it is storing value for first irq index. Fixes: fe1c5ca2fe76 ("ice: implement num_msix field per VF") Reviewed-by: Jacob Keller Signed-off-by: Michal Swiatkowski Reviewed-by: Simon Horman Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 90fe70d4e23cb57253d2668a171d5695c332deb7 Author: Ilkka Koskinen Date: Thu Nov 30 18:15:48 2023 -0800 perf vendor events arm64: AmpereOne: Add missing DefaultMetricgroupName fields AmpereOne metrics were missing DefaultMetricgroupName from metrics with "Default" in group name resulting perf to segfault. Add the missing field to address the issue. Fixes: 59faeaf80d02 ("perf vendor events arm64: Fix for AmpereOne metrics") Signed-off-by: Ilkka Koskinen Reviewed-by: Ian Rogers Cc: James Clark Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: John Garry Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20231201021550.1109196-2-ilkka@os.amperecomputing.com Signed-off-by: Namhyung Kim commit e2b005d6ec0e738df584190e21d2c7ada37266a0 Author: Ian Rogers Date: Mon Dec 4 10:23:29 2023 -0800 perf metrics: Avoid segv if default metricgroup isn't set A metric is default by having "Default" within its groups. The default metricgroup name needn't be set and this can result in segv in default_metricgroup_cmp and perf_stat__print_shadow_stats_metricgroup that assume it has a value when there is a Default metric group. To avoid the segv initialize the value to "". Fixes: 1c0e47956a8e ("perf metrics: Sort the Default metricgroup") Signed-off-by: Ian Rogers Reviewed-and-tested-by: Ilkka Koskinen Cc: James Clark Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Kajol Jain Cc: Kan Liang Cc: John Garry Cc: stable@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20231204182330.654255-1-irogers@google.com Signed-off-by: Namhyung Kim commit a58a173444a68412bb08849bd81c679395f20ca0 Author: Thomas Bogendoerfer Date: Thu Nov 30 17:36:01 2023 +0100 MIPS: kernel: Clear FPU states when setting up kernel threads io_uring sets up the io worker kernel thread via a syscall out of an user space prrocess. This process might have used FPU and since copy_thread() didn't clear FPU states for kernel threads a BUG() is triggered for using FPU inside kernel. Move code around to always clear FPU state for user and kernel threads. Cc: stable@vger.kernel.org Reported-by: Aurelien Jarno Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1055021 Suggested-by: Jiaxun Yang Reviewed-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit c7206e7bd214ebb3ca6fa474a4423662327d9beb Author: Jiaxun Yang Date: Tue Nov 7 11:15:20 2023 +0000 MIPS: Loongson64: Handle more memory types passed from firmware There are many types of revsered memory passed from firmware that should be reserved in memblock, and UMA memory passed from firmware that should be added to system memory for system to use. Also for memblock there is no need to align those space into page, which actually cause problems. Handle them properly to prevent memory corruption on some systems. Cc: stable@vger.kernel.org Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit edc0378eee00200a5bedf1bb9f00ad390e0d1bd4 Author: Jiaxun Yang Date: Tue Nov 7 11:15:19 2023 +0000 MIPS: Loongson64: Enable DMA noncoherent support There are some Loongson64 systems come with broken coherent DMA support, firmware will set a bit in boot_param and pass nocoherentio in cmdline. However nonconherent support was missed out when spin off Loongson-2EF form Loongson64, and that boot_param change never made itself into upstream. Support DMA noncoherent properly to get those systems working. Cc: stable@vger.kernel.org Fixes: 71e2f4dd5a65 ("MIPS: Fork loongson2ef from loongson64") Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 8f7aa77a463f47c9e00592d02747a9fcf2271543 Author: Jiaxun Yang Date: Tue Nov 7 11:15:18 2023 +0000 MIPS: Loongson64: Reserve vgabios memory on boot vgabios is passed from firmware to kernel on Loongson64 systems. Sane firmware will keep this pointer in reserved memory space passed from the firmware but insane firmware keeps it in low memory before kernel entry that is not reserved. Previously kernel won't try to allocate memory from low memory before kernel entry on boot, but after converting to memblock it will do that. Fix by resversing those memory on early boot. Cc: stable@vger.kernel.org Fixes: a94e4f24ec83 ("MIPS: init: Drop boot_mem_map") Signed-off-by: Jiaxun Yang Signed-off-by: Thomas Bogendoerfer commit 55702ec9603ebeffb15e6f7b113623fe1d8872f4 Author: Stefan Wiehler Date: Mon Nov 6 13:12:07 2023 +0100 mips/smp: Call rcutree_report_cpu_starting() earlier rcutree_report_cpu_starting() must be called before clockevents_register_device() to avoid the following lockdep splat triggered by calling list_add() when CONFIG_PROVE_RCU_LIST=y: WARNING: suspicious RCU usage ... ----------------------------- kernel/locking/lockdep.c:3680 RCU-list traversed in non-reader section!! other info that might help us debug this: RCU used illegally from offline CPU! rcu_scheduler_active = 1, debug_locks = 1 no locks held by swapper/1/0. ... Call Trace: [] show_stack+0x64/0x158 [] dump_stack_lvl+0x90/0xc4 [] __lock_acquire+0x1404/0x2940 [] lock_acquire+0x14c/0x448 [] _raw_spin_lock_irqsave+0x50/0x88 [] clockevents_register_device+0x60/0x1e8 [] r4k_clockevent_init+0x220/0x3a0 [] start_secondary+0x50/0x3b8 raw_smp_processor_id() is required in order to avoid calling into lockdep before RCU has declared the CPU to be watched for readers. See also commit 29368e093921 ("x86/smpboot: Move rcu_cpu_starting() earlier"), commit de5d9dae150c ("s390/smp: move rcu_cpu_starting() earlier") and commit 99f070b62322 ("powerpc/smp: Call rcu_cpu_starting() earlier"). Signed-off-by: Stefan Wiehler Reviewed-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer commit 3c91c909f13f0c32b0d54d75c3f798479b1a84f5 Author: Zhipeng Lu Date: Sat Dec 2 17:59:02 2023 +0800 octeontx2-af: fix a use-after-free in rvu_npa_register_reporters The rvu_dl will be freed in rvu_npa_health_reporters_destroy(rvu_dl) after the create_workqueue fails, and after that free, the rvu_dl will be translate back through rvu_npa_health_reporters_create, rvu_health_reporters_create, and rvu_register_dl. Finally it goes to the err_dl_health label, being freed again in rvu_health_reporters_destroy(rvu) by rvu_npa_health_reporters_destroy. In the second calls of rvu_npa_health_reporters_destroy, however, it uses rvu_dl->rvu_npa_health_reporter, which is already freed at the end of rvu_npa_health_reporters_destroy in the first call. So this patch prevents the first destroy by instantly returning -ENONMEN when create_workqueue fails. In addition, since the failure of create_workqueue is the only entrence of label err, it has been integrated into the error-handling path of create_workqueue. Fixes: f1168d1e207c ("octeontx2-af: Add devlink health reporters for NPA") Signed-off-by: Zhipeng Lu Acked-by: Paolo Abeni Acked-by: Geethasowjanya Akula Link: https://lore.kernel.org/r/20231202095902.3264863-1-alexious@zju.edu.cn Signed-off-by: Paolo Abeni commit 9865346b7e8374b57f1c3ccacdc77846c6352ff4 Author: Jens Axboe Date: Tue Dec 5 07:02:13 2023 -0700 io_uring/kbuf: check for buffer list readiness after NULL check Move the buffer list 'is_ready' check below the validity check for the buffer list for a given group. Fixes: 5cf4f52e6d8a ("io_uring: free io_buffer_list entries via RCU") Reported-by: Dan Carpenter Signed-off-by: Jens Axboe commit e53f7b54b1fdecae897f25002ff0cff04faab228 Author: Dan Carpenter Date: Tue Dec 5 15:37:17 2023 +0300 io_uring/kbuf: Fix an NULL vs IS_ERR() bug in io_alloc_pbuf_ring() The io_mem_alloc() function returns error pointers, not NULL. Update the check accordingly. Fixes: b10b73c102a2 ("io_uring/kbuf: recycle freed mapped buffer ring entries") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/5ed268d3-a997-4f64-bd71-47faa92101ab@moroto.mountain Signed-off-by: Jens Axboe commit 890188d2d7e4ac6c131ba166ca116cb315e752ee Author: Miquel Raynal Date: Tue Dec 5 09:31:02 2023 +0100 spi: atmel: Prevent spi transfers from being killed Upstream commit e0205d6203c2 ("spi: atmel: Prevent false timeouts on long transfers") has tried to mitigate the problem of getting spi transfers canceled because they were lasting too long. On slow buses, transfers in the MiB range can take more than one second and thus a calculation was added to progressively increment the timeout value. In order to not be too problematic from a user point of view (waiting dozen of seconds or even minutes), the wait call was turned interruptible. Turning the wait interruptible was a mistake as what we really wanted to do was to be able to kill a transfer. Any signal interrupting our transfer would not be suitable at all so a second attempt was made at turning the wait killable instead. Link: https://lore.kernel.org/linux-spi/20231127095842.389631-1-miquel.raynal@bootlin.com/ All being well, it was reported that JFFS2 was showing a splat when interrupting a transfer. After some more debate about whether JFFS2 should be fixed and how, it was also pointed out that the whole consistency of the filesystem in case of parallel I/O would be compromised. Changing JFFS2 behavior would in theory be possible but nobody has the energy and time and knowledge to do this now, so better prevent spi transfers to be interrupted by the user. Partially revert the blamed commit to no longer use the interruptible nor the killable variant of wait_for_completion(). Fixes: e0205d6203c2 ("spi: atmel: Prevent false timeouts on long transfers") Cc: Signed-off-by: Miquel Raynal Tested-by: Ronald Wahl Link: https://lore.kernel.org/r/20231205083102.16946-1-miquel.raynal@bootlin.com Signed-off-by: Mark Brown commit e4d008d49a7135214e0ee70537405b6a069e3a3f Author: Yewon Choi Date: Fri Dec 1 15:10:52 2023 +0900 xsk: Skip polling event check for unbound socket In xsk_poll(), checking available events and setting mask bits should be executed only when a socket has been bound. Setting mask bits for unbound socket is meaningless. Currently, it checks events even when xsk_check_common() failed. To prevent this, we move goto location (skip_tx) after that checking. Fixes: 1596dae2f17e ("xsk: check IFF_UP earlier in Tx path") Signed-off-by: Yewon Choi Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20231201061048.GA1510@libra05 commit 4c6f19ab2aed2abc78d788d5418047e5f44b1921 Author: Alexander Stein Date: Mon Nov 6 16:13:24 2023 +0100 dt-bindings: pwm: imx-pwm: Unify #pwm-cells for all compatibles Use #pwm-cells for all i.MX variants. Only fsl,imx1-pwm does not support inverted PWM output. Keep it the same for consistency. Signed-off-by: Alexander Stein Reviewed-by: Uwe Kleine-König Acked-by: Conor Dooley Signed-off-by: Shawn Guo commit d951f8f5f23a9417b7952f22b33784c73caa1ebb Author: Fabio Estevam Date: Sun Nov 5 10:32:19 2023 -0300 ARM: dts: imx6ul-pico: Describe the Ethernet PHY clock Since commit c7e73b5051d6 ("ARM: imx: mach-imx6ul: remove 14x14 EVK specific PHY fixup")thet Ethernet PHY is no longer configured via code in board file. This caused Ethernet to stop working. Fix this problem by describing the clocks and clock-names to the Ethernet PHY node so that the KSZ8081 chip can be clocked correctly. Fixes: c7e73b5051d6 ("ARM: imx: mach-imx6ul: remove 14x14 EVK specific PHY fixup") Signed-off-by: Fabio Estevam Reviewed-by: Andrew Lunn Signed-off-by: Shawn Guo commit a931c6816078af3e306e0f444f492396ce40de31 Author: JP Kobryn Date: Mon Dec 4 12:23:20 2023 -0800 9p: prevent read overrun in protocol dump tracepoint An out of bounds read can occur within the tracepoint 9p_protocol_dump. In the fast assign, there is a memcpy that uses a constant size of 32 (macro named P9_PROTO_DUMP_SZ). When the copy is invoked, the source buffer is not guaranteed match this size. It was found that in some cases the source buffer size is less than 32, resulting in a read that overruns. The size of the source buffer seems to be known at the time of the tracepoint being invoked. The allocations happen within p9_fcall_init(), where the capacity field is set to the allocated size of the payload buffer. This patch tries to fix the overrun by changing the fixed array to a dynamically sized array and using the minimum of the capacity value or P9_PROTO_DUMP_SZ as its length. The trace log statement is adjusted to account for this. Note that the trace log no longer splits the payload on the first 16 bytes. The full payload is now logged to a single line. To repro the orignal problem, operations to a plan 9 managed resource can be used. The simplest approach might just be mounting a shared filesystem (between host and guest vm) using the plan 9 protocol while the tracepoint is enabled. mount -t 9p -o trans=virtio The bpftrace program below can be used to show the out of bounds read. Note that a recent version of bpftrace is needed for the raw tracepoint support. The script was tested using v0.19.0. /* from include/net/9p/9p.h */ struct p9_fcall { u32 size; u8 id; u16 tag; size_t offset; size_t capacity; struct kmem_cache *cache; u8 *sdata; bool zc; }; tracepoint:9p:9p_protocol_dump { /* out of bounds read can happen when this tracepoint is enabled */ } rawtracepoint:9p_protocol_dump { $pdu = (struct p9_fcall *)arg1; $dump_sz = (uint64)32; if ($dump_sz > $pdu->capacity) { printf("reading %zu bytes from src buffer of %zu bytes\n", $dump_sz, $pdu->capacity); } } Signed-off-by: JP Kobryn Message-ID: <20231204202321.22730-1-inwardvessel@gmail.com> Fixes: 60ece0833b6c ("net/9p: allocate appropriate reduced message buffers") Cc: stable@vger.kernel.org Reviewed-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit 9f269070abe9c45dc60abc84e29326f855317eac Author: heminhong Date: Tue Nov 14 10:43:41 2023 +0800 drm/i915: correct the input parameter on _intel_dsb_commit() Current, the dewake_scanline variable is defined as unsigned int, an unsigned int variable that is always greater than or equal to 0. when _intel_dsb_commit function is called by intel_dsb_commit function, the dewake_scanline variable may have an int value. So the dewake_scanline variable is necessary to defined as an int. Fixes: f83b94d23770 ("drm/i915/dsb: Use DEwake to combat PkgC latency") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310052201.AnVbpgPr-lkp@intel.com/ Cc: Ville Syrjälä Cc: Uma Shankar Signed-off-by: heminhong Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20231114024341.14524-1-heminhong@kylinos.cn (cherry picked from commit ef32c3cc9c62252986f09e06b4e525742cd91529) Signed-off-by: Jani Nikula commit dd7eb65c493615fda7d459501c3d4a46e00ea5ba Author: Ville Syrjälä Date: Mon Nov 27 16:50:27 2023 +0200 drm/i915/mst: Reject modes that require the bigjoiner We have no bigjoiner support in the MST code, so .mode_valid() pretending otherwise is just going to result black screens for users. Reject any mode that needs the joiner. Cc: stable@vger.kernel.org Cc: Stanislav Lisovskiy Fixes: d51f25eb479a ("drm/i915: Add DSC support to MST path") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231127145028.4899-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit 9c058492b16f90bb772cb0dad567e8acc68e155d) Signed-off-by: Jani Nikula commit 7cf82b25dd91d7f330d9df2de868caca14289ba1 Author: Ville Syrjälä Date: Mon Nov 27 16:50:26 2023 +0200 drm/i915/mst: Fix .mode_valid_ctx() return values .mode_valid_ctx() returns an errno, not the mode status. Fix the code to do the right thing. Cc: stable@vger.kernel.org Cc: Stanislav Lisovskiy Fixes: d51f25eb479a ("drm/i915: Add DSC support to MST path") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231127145028.4899-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit c1799032d2ef6616113b733428dfaa2199a5604b) Signed-off-by: Jani Nikula commit 20c2dbff342aec13bf93c2f6c951da198916a455 Author: Ville Syrjälä Date: Mon Nov 27 16:50:25 2023 +0200 drm/i915: Skip some timing checks on BXT/GLK DSI transcoders Apparently some BXT/GLK systems have DSI panels whose timings don't agree with the normal cpu transcoder hblank>=32 limitation. This is perhaps fine as there are no specific hblank/etc. limits listed for the BXT/GLK DSI transcoders. Move those checks out from the global intel_mode_valid() into into connector specific .mode_valid() hooks, skipping BXT/GLK DSI connectors. We'll leave the basic [hv]display/[hv]total checks in intel_mode_valid() as those seem like sensible upper limits regardless of the transcoder used. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9720 Fixes: 8f4b1068e7fc ("drm/i915: Check some transcoder timing minimum limits") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231127145028.4899-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit e0ef2daa8ca8ce4dbc2fd0959e383b753a87fd7d) Signed-off-by: Jani Nikula commit 209043cf092d7b0d4739921b3f11d6d0b451eabf Author: Nathan Rossi Date: Mon Nov 6 02:14:36 2023 +0000 arm64: dts: imx8mp: imx8mq: Add parkmode-disable-ss-quirk on DWC3 The i.MX8MP and i.MX8MQ devices both use the same DWC3 controller and are both affected by a known issue with the controller due to specific behaviour when park mode is enabled in SuperSpeed host mode operation. Under heavy USB traffic from multiple endpoints the controller will sometimes incorrectly process transactions such that some transactions are lost, or the controller may hang when processing transactions. When the controller hangs it does not recover. This issue is documented partially within the linux-imx vendor kernel which references a Synopsys STAR number 9001415732 in commits [1] and additional details in [2]. Those commits provide some additional controller internal implementation specifics around the incorrect behaviour of the SuperSpeed host controller operation when park mode is enabled. The summary of this issue is that the host controller can incorrectly enter/exit park mode such that part of the controller is in a state which behaves as if in park mode even though it is not. In this state the controller incorrectly calculates the number of TRBs available which results in incorrect access of the internal caches causing the overwrite of pending requests in the cache which should have been processed but are ignored. This can cause the controller to drop the requests or hang waiting for the pending state of the dropped requests. The workaround for this issue is to disable park mode for SuperSpeed operation of the controller through the GUCTL1[17] bit. This is already available as a quirk for the DWC3 controller and can be enabled via the 'snps,parkmode-disable-ss-quirk' device tree property. It is possible to replicate this failure on an i.MX8MP EVK with a USB Hub connecting 4 SuperSpeed USB flash drives. Performing continuous small read operations (dd if=/dev/sd... of=/dev/null bs=16) on the block devices will result in device errors initially and will eventually result in the controller hanging. [13240.896936] xhci-hcd xhci-hcd.0.auto: WARN Event TRB for slot 4 ep 2 with no TDs queued? [13240.990708] usb 2-1.3: reset SuperSpeed USB device number 5 using xhci-hcd [13241.015582] sd 2:0:0:0: [sdc] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=DRIVER_OK cmd_age=0s [13241.025198] sd 2:0:0:0: [sdc] tag#0 CDB: opcode=0x28 28 00 00 00 03 e0 00 01 00 00 [13241.032949] I/O error, dev sdc, sector 992 op 0x0:(READ) flags 0x80700 phys_seg 25 prio class 2 [13272.150710] usb 2-1.2: reset SuperSpeed USB device number 4 using xhci-hcd [13272.175469] sd 1:0:0:0: [sdb] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x03 driverbyte=DRIVER_OK cmd_age=31s [13272.185365] sd 1:0:0:0: [sdb] tag#0 CDB: opcode=0x28 28 00 00 00 03 e0 00 01 00 00 [13272.193385] I/O error, dev sdb, sector 992 op 0x0:(READ) flags 0x80700 phys_seg 18 prio class 2 [13434.846556] xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command [13434.854592] xhci-hcd xhci-hcd.0.auto: xHCI host controller not responding, assume dead [13434.862553] xhci-hcd xhci-hcd.0.auto: HC died; cleaning up [1] https://github.com/nxp-imx/linux-imx/commit/97a5349d936b08cf301730b59e4e8855283f815c [2] https://github.com/nxp-imx/linux-imx/commit/b4b5cbc5a12d7c3b920d1d7cba0ada3379e4e42b Fixes: fb8587a2c165 ("arm64: dtsi: imx8mp: add usb nodes") Fixes: ad37549cb5dc ("arm64: dts: imx8mq: add USB nodes") Signed-off-by: Nathan Rossi Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 26513300978f7285c3e776c144f27ef71be61f57 Author: Arnd Bergmann Date: Mon Dec 4 08:27:36 2023 +0100 drm/bridge: tc358768: select CONFIG_VIDEOMODE_HELPERS A dependency on this feature was recently introduced: x86_64-linux-ld: vmlinux.o: in function `tc358768_bridge_pre_enable': tc358768.c:(.text+0xbe3dae): undefined reference to `drm_display_mode_to_videomode' Make sure this is always enabled. Fixes: e5fb21678136 ("drm/bridge: tc358768: Use struct videomode") Signed-off-by: Arnd Bergmann Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20231204072814.968816-1-arnd@kernel.org Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231204072814.968816-1-arnd@kernel.org commit ca4ef28d0ad831d2521fa2b16952f37fd9324ca3 Author: Dan Carpenter Date: Fri Nov 3 09:36:20 2023 +0300 net/mlx5: Fix a NULL vs IS_ERR() check The mlx5_esw_offloads_devlink_port() function returns error pointers, not NULL. Fixes: 7bef147a6ab6 ("net/mlx5: Don't skip vport check") Signed-off-by: Dan Carpenter Reviewed-by: Wojciech Drewek Signed-off-by: Saeed Mahameed commit 7aaf975238c47b710fcc4eca0da1e7902a53abe2 Author: Gavin Li Date: Thu Aug 31 05:47:09 2023 +0300 net/mlx5e: Check netdev pointer before checking its net ns Previously, when comparing the net namespaces, the case where the netdev doesn't exist wasn't taken into account, and therefore can cause a crash. In such a case, the comparing function should return false, as there is no netdev->net to compare the devlink->net to. Furthermore, this will result in an attempt to enter switchdev mode without a netdev to fail, and which is the desired result as there is no meaning in switchdev mode without a net device. Fixes: 662404b24a4c ("net/mlx5e: Block entering switchdev mode with ns inconsistency") Signed-off-by: Gavin Li Reviewed-by: Gavi Teitz Signed-off-by: Saeed Mahameed commit 3d7a3f2612d75de5f371a681038b089ded6667eb Author: Moshe Shemesh Date: Mon Aug 7 13:11:32 2023 +0300 net/mlx5: Nack sync reset request when HotPlug is enabled Current sync reset flow is not supported when PCIe bridge connected directly to mlx5 device has HotPlug interrupt enabled and can be triggered on link state change event. Return nack on reset request in such case. Fixes: 92501fa6e421 ("net/mlx5: Ack on sync_reset_request only if PF can do reset_now") Signed-off-by: Moshe Shemesh Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit ccbe33003b109f14c4dde2a4fca9c2a50c423601 Author: Chris Mi Date: Mon Sep 11 13:28:10 2023 +0300 net/mlx5e: TC, Don't offload post action rule if not supported If post action is not supported, eg. ignore_flow_level is not supported, don't offload post action rule. Otherwise, will hit panic [1]. Fix it by checking if post action table is valid or not. [1] [445537.863880] BUG: unable to handle page fault for address: ffffffffffffffb1 [445537.864617] #PF: supervisor read access in kernel mode [445537.865244] #PF: error_code(0x0000) - not-present page [445537.865860] PGD 70683a067 P4D 70683a067 PUD 70683c067 PMD 0 [445537.866497] Oops: 0000 [#1] PREEMPT SMP NOPTI [445537.867077] CPU: 19 PID: 248742 Comm: tc Kdump: loaded Tainted: G O 6.5.0+ #1 [445537.867888] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [445537.868834] RIP: 0010:mlx5e_tc_post_act_add+0x51/0x130 [mlx5_core] [445537.869635] Code: c0 0d 00 00 e8 20 96 c6 d3 48 85 c0 0f 84 e5 00 00 00 c7 83 b0 01 00 00 00 00 00 00 49 89 c5 31 c0 31 d2 66 89 83 b4 01 00 00 <49> 8b 44 24 10 83 23 df 83 8b d8 01 00 00 04 48 89 83 c0 01 00 00 [445537.871318] RSP: 0018:ffffb98741cef428 EFLAGS: 00010246 [445537.871962] RAX: 0000000000000000 RBX: ffff8df341167000 RCX: 0000000000000001 [445537.872704] RDX: 0000000000000000 RSI: ffffffff954844e1 RDI: ffffffff9546e9cb [445537.873430] RBP: ffffb98741cef448 R08: 0000000000000020 R09: 0000000000000246 [445537.874160] R10: 0000000000000000 R11: ffffffff943f73ff R12: ffffffffffffffa1 [445537.874893] R13: ffff8df36d336c20 R14: ffffffffffffffa1 R15: ffff8df341167000 [445537.875628] FS: 00007fcd6564f800(0000) GS:ffff8dfa9ea00000(0000) knlGS:0000000000000000 [445537.876425] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [445537.877090] CR2: ffffffffffffffb1 CR3: 00000003b5884001 CR4: 0000000000770ee0 [445537.877832] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [445537.878564] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [445537.879300] PKRU: 55555554 [445537.879797] Call Trace: [445537.880263] [445537.880713] ? show_regs+0x6e/0x80 [445537.881232] ? __die+0x29/0x70 [445537.881731] ? page_fault_oops+0x85/0x160 [445537.882276] ? search_exception_tables+0x65/0x70 [445537.882852] ? kernelmode_fixup_or_oops+0xa2/0x120 [445537.883432] ? __bad_area_nosemaphore+0x18b/0x250 [445537.884019] ? bad_area_nosemaphore+0x16/0x20 [445537.884566] ? do_kern_addr_fault+0x8b/0xa0 [445537.885105] ? exc_page_fault+0xf5/0x1c0 [445537.885623] ? asm_exc_page_fault+0x2b/0x30 [445537.886149] ? __kmem_cache_alloc_node+0x1df/0x2a0 [445537.886717] ? mlx5e_tc_post_act_add+0x51/0x130 [mlx5_core] [445537.887431] ? mlx5e_tc_post_act_add+0x30/0x130 [mlx5_core] [445537.888172] alloc_flow_post_acts+0xfb/0x1c0 [mlx5_core] [445537.888849] parse_tc_actions+0x582/0x5c0 [mlx5_core] [445537.889505] parse_tc_fdb_actions+0xd7/0x1f0 [mlx5_core] [445537.890175] __mlx5e_add_fdb_flow+0x1ab/0x2b0 [mlx5_core] [445537.890843] mlx5e_add_fdb_flow+0x56/0x120 [mlx5_core] [445537.891491] ? debug_smp_processor_id+0x1b/0x30 [445537.892037] mlx5e_tc_add_flow+0x79/0x90 [mlx5_core] [445537.892676] mlx5e_configure_flower+0x305/0x450 [mlx5_core] [445537.893341] mlx5e_rep_setup_tc_cls_flower+0x3d/0x80 [mlx5_core] [445537.894037] mlx5e_rep_setup_tc_cb+0x5c/0xa0 [mlx5_core] [445537.894693] tc_setup_cb_add+0xdc/0x220 [445537.895177] fl_hw_replace_filter+0x15f/0x220 [cls_flower] [445537.895767] fl_change+0xe87/0x1190 [cls_flower] [445537.896302] tc_new_tfilter+0x484/0xa50 Fixes: f0da4daa3413 ("net/mlx5e: Refactor ct to use post action infrastructure") Signed-off-by: Chris Mi Reviewed-by: Jianbo Liu Signed-off-by: Saeed Mahameed Reviewed-by: Automatic Verification Reviewed-by: Maher Sanalla Reviewed-by: Shay Drory Reviewed-by: Moshe Shemesh Reviewed-by: Shachar Kagan Reviewed-by: Tariq Toukan commit eab0da38912ebdad922ed0388209f7eb0a5163cd Author: Moshe Shemesh Date: Wed Sep 21 18:45:11 2022 +0300 net/mlx5e: Fix possible deadlock on mlx5e_tx_timeout_work Due to the cited patch, devlink health commands take devlink lock and this may result in deadlock for mlx5e_tx_reporter as it takes local state_lock before calling devlink health report and on the other hand devlink health commands such as diagnose for same reporter take local state_lock after taking devlink lock (see kernel log below). To fix it, remove local state_lock from mlx5e_tx_timeout_work() before calling devlink_health_report() and take care to cancel the work before any call to close channels, which may free the SQs that should be handled by the work. Before cancel_work_sync(), use current_work() to check we are not calling it from within the work, as mlx5e_tx_timeout_work() itself may close the channels and reopen as part of recovery flow. While removing state_lock from mlx5e_tx_timeout_work() keep rtnl_lock to ensure no change in netdev->real_num_tx_queues, but use rtnl_trylock() and a flag to avoid deadlock by calling cancel_work_sync() before closing the channels while holding rtnl_lock too. Kernel log: ====================================================== WARNING: possible circular locking dependency detected 6.0.0-rc3_for_upstream_debug_2022_08_30_13_10 #1 Not tainted ------------------------------------------------------ kworker/u16:2/65 is trying to acquire lock: ffff888122f6c2f8 (&devlink->lock_key#2){+.+.}-{3:3}, at: devlink_health_report+0x2f1/0x7e0 but task is already holding lock: ffff888121d20be0 (&priv->state_lock){+.+.}-{3:3}, at: mlx5e_tx_timeout_work+0x70/0x280 [mlx5_core] which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&priv->state_lock){+.+.}-{3:3}: __mutex_lock+0x12c/0x14b0 mlx5e_rx_reporter_diagnose+0x71/0x700 [mlx5_core] devlink_nl_cmd_health_reporter_diagnose_doit+0x212/0xa50 genl_family_rcv_msg_doit+0x1e9/0x2f0 genl_rcv_msg+0x2e9/0x530 netlink_rcv_skb+0x11d/0x340 genl_rcv+0x24/0x40 netlink_unicast+0x438/0x710 netlink_sendmsg+0x788/0xc40 sock_sendmsg+0xb0/0xe0 __sys_sendto+0x1c1/0x290 __x64_sys_sendto+0xdd/0x1b0 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 -> #0 (&devlink->lock_key#2){+.+.}-{3:3}: __lock_acquire+0x2c8a/0x6200 lock_acquire+0x1c1/0x550 __mutex_lock+0x12c/0x14b0 devlink_health_report+0x2f1/0x7e0 mlx5e_health_report+0xc9/0xd7 [mlx5_core] mlx5e_reporter_tx_timeout+0x2ab/0x3d0 [mlx5_core] mlx5e_tx_timeout_work+0x1c1/0x280 [mlx5_core] process_one_work+0x7c2/0x1340 worker_thread+0x59d/0xec0 kthread+0x28f/0x330 ret_from_fork+0x1f/0x30 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&priv->state_lock); lock(&devlink->lock_key#2); lock(&priv->state_lock); lock(&devlink->lock_key#2); *** DEADLOCK *** 4 locks held by kworker/u16:2/65: #0: ffff88811a55b138 ((wq_completion)mlx5e#2){+.+.}-{0:0}, at: process_one_work+0x6e2/0x1340 #1: ffff888101de7db8 ((work_completion)(&priv->tx_timeout_work)){+.+.}-{0:0}, at: process_one_work+0x70f/0x1340 #2: ffffffff84ce8328 (rtnl_mutex){+.+.}-{3:3}, at: mlx5e_tx_timeout_work+0x53/0x280 [mlx5_core] #3: ffff888121d20be0 (&priv->state_lock){+.+.}-{3:3}, at: mlx5e_tx_timeout_work+0x70/0x280 [mlx5_core] stack backtrace: CPU: 1 PID: 65 Comm: kworker/u16:2 Not tainted 6.0.0-rc3_for_upstream_debug_2022_08_30_13_10 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 Workqueue: mlx5e mlx5e_tx_timeout_work [mlx5_core] Call Trace: dump_stack_lvl+0x57/0x7d check_noncircular+0x278/0x300 ? print_circular_bug+0x460/0x460 ? find_held_lock+0x2d/0x110 ? __stack_depot_save+0x24c/0x520 ? alloc_chain_hlocks+0x228/0x700 __lock_acquire+0x2c8a/0x6200 ? register_lock_class+0x1860/0x1860 ? kasan_save_stack+0x1e/0x40 ? kasan_set_free_info+0x20/0x30 ? ____kasan_slab_free+0x11d/0x1b0 ? kfree+0x1ba/0x520 ? devlink_health_do_dump.part.0+0x171/0x3a0 ? devlink_health_report+0x3d5/0x7e0 lock_acquire+0x1c1/0x550 ? devlink_health_report+0x2f1/0x7e0 ? lockdep_hardirqs_on_prepare+0x400/0x400 ? find_held_lock+0x2d/0x110 __mutex_lock+0x12c/0x14b0 ? devlink_health_report+0x2f1/0x7e0 ? devlink_health_report+0x2f1/0x7e0 ? mutex_lock_io_nested+0x1320/0x1320 ? trace_hardirqs_on+0x2d/0x100 ? bit_wait_io_timeout+0x170/0x170 ? devlink_health_do_dump.part.0+0x171/0x3a0 ? kfree+0x1ba/0x520 ? devlink_health_do_dump.part.0+0x171/0x3a0 devlink_health_report+0x2f1/0x7e0 mlx5e_health_report+0xc9/0xd7 [mlx5_core] mlx5e_reporter_tx_timeout+0x2ab/0x3d0 [mlx5_core] ? lockdep_hardirqs_on_prepare+0x400/0x400 ? mlx5e_reporter_tx_err_cqe+0x1b0/0x1b0 [mlx5_core] ? mlx5e_tx_reporter_timeout_dump+0x70/0x70 [mlx5_core] ? mlx5e_tx_reporter_dump_sq+0x320/0x320 [mlx5_core] ? mlx5e_tx_timeout_work+0x70/0x280 [mlx5_core] ? mutex_lock_io_nested+0x1320/0x1320 ? process_one_work+0x70f/0x1340 ? lockdep_hardirqs_on_prepare+0x400/0x400 ? lock_downgrade+0x6e0/0x6e0 mlx5e_tx_timeout_work+0x1c1/0x280 [mlx5_core] process_one_work+0x7c2/0x1340 ? lockdep_hardirqs_on_prepare+0x400/0x400 ? pwq_dec_nr_in_flight+0x230/0x230 ? rwlock_bug.part.0+0x90/0x90 worker_thread+0x59d/0xec0 ? process_one_work+0x1340/0x1340 kthread+0x28f/0x330 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 Fixes: c90005b5f75c ("devlink: Hold the instance lock in health callbacks") Signed-off-by: Moshe Shemesh Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 762a55a54eec4217e4cec9265ab6e5d4c11b61bd Author: Chris Mi Date: Mon Oct 30 15:44:47 2023 +0200 net/mlx5e: Disable IPsec offload support if not FW steering IPsec FDB offload can only work with FW steering as of now, disable the cap upon non FW steering. And since the IPSec cap is dynamic now based on steering mode. Cleanup the resources if they exist instead of checking the IPsec cap again. Fixes: edd8b295f9e2 ("Merge branch 'mlx5-ipsec-packet-offload-support-in-eswitch-mode'") Signed-off-by: Chris Mi Signed-off-by: Leon Romanovsky commit 4e25b661f484df54b6751b65f9ea2434a3b67539 Author: Jianbo Liu Date: Thu Oct 12 02:00:44 2023 +0000 net/mlx5e: Check the number of elements before walk TC rhashtable After IPSec TX tables are destroyed, the flow rules in TC rhashtable, which have the destination to IPSec, are restored to the original one, the uplink. However, when the device is in switchdev mode and unload driver with IPSec rules configured, TC rhashtable cleanup is done before IPSec cleanup, which means tc_ht->tbl is already freed when walking TC rhashtable, in order to restore the destination. So add the checking before walking to avoid unexpected behavior. Fixes: d1569537a837 ("net/mlx5e: Modify and restore TC rules for IPSec TX rules") Signed-off-by: Jianbo Liu Signed-off-by: Leon Romanovsky commit baac8351f74c543896b8fd40138b7ad9365587a3 Author: Jianbo Liu Date: Wed Oct 11 03:38:29 2023 +0000 net/mlx5e: Reduce eswitch mode_lock protection context Currently eswitch mode_lock is so heavy, for example, it's locked during the whole process of the mode change, which may need to hold other locks. As the mode_lock is also used by IPSec to block mode and encap change now, it is easy to cause lock dependency. Since some of protections are also done by devlink lock, the eswitch mode_lock is not needed at those places, and thus the possibility of lockdep issue is reduced. Fixes: c8e350e62fc5 ("net/mlx5e: Make TC and IPsec offloads mutually exclusive on a netdev") Signed-off-by: Jianbo Liu Signed-off-by: Leon Romanovsky commit c2bf84f1d1a1595dcc45fe867f0e02b331993fee Author: Leon Romanovsky Date: Sun Nov 12 13:50:00 2023 +0200 net/mlx5e: Tidy up IPsec NAT-T SA discovery IPsec NAT-T packets are UDP encapsulated packets over ESP normal ones. In case they arrive to RX, the SPI and ESP are located in inner header, while the check was performed on outer header instead. That wrong check caused to the situation where received rekeying request was missed and caused to rekey timeout, which "compensated" this failure by completing rekeying. Fixes: d65954934937 ("net/mlx5e: Support IPsec NAT-T functionality") Signed-off-by: Leon Romanovsky commit dddb49b63d8683be81cff220b94a0196c1367b74 Author: Patrisious Haddad Date: Sun Sep 24 11:50:31 2023 +0300 net/mlx5e: Add IPsec and ASO syndromes check in HW After IPsec decryption it isn't enough to only check the IPsec syndrome but need to also check the ASO syndrome in order to verify that the operation was actually successful. Verify that both syndromes are actually zero and in case not drop the packet and increment the appropriate flow counter for the drop reason. Fixes: 6b5c45e16e43 ("net/mlx5e: Configure IPsec packet offload flow steering") Signed-off-by: Patrisious Haddad Signed-off-by: Leon Romanovsky commit 5ad00dee43b98129b86930d457b983d4d04dc553 Author: Leon Romanovsky Date: Tue Oct 3 16:44:19 2023 +0300 net/mlx5e: Remove exposure of IPsec RX flow steering struct After previous commit, which unified various IPsec creation modes, there is no need to have struct mlx5e_ipsec_rx exposed in global IPsec header. Move it to ipsec_fs.c to be placed together with already existing struct mlx5e_ipsec_tx. Fixes: 1762f132d542 ("net/mlx5e: Support IPsec packet offload for RX in switchdev mode") Signed-off-by: Leon Romanovsky commit 94af50c0a9bb961fe93cf0fdd14eb0883da86721 Author: Patrisious Haddad Date: Thu Sep 21 14:06:18 2023 +0300 net/mlx5e: Unify esw and normal IPsec status table creation/destruction Change normal IPsec flow to use the same creation/destruction functions for status flow table as that of ESW, which first of all refines the code to have less code duplication. And more importantly, the ESW status table handles IPsec syndrome checks at steering by HW, which is more efficient than the previous behaviour we had where it was copied to WQE meta data and checked by the driver. Fixes: 1762f132d542 ("net/mlx5e: Support IPsec packet offload for RX in switchdev mode") Signed-off-by: Patrisious Haddad Signed-off-by: Leon Romanovsky commit 3d42c8cc67a8fcbff0181f9ed6d03d353edcee07 Author: Leon Romanovsky Date: Wed Sep 20 10:07:13 2023 +0300 net/mlx5e: Ensure that IPsec sequence packet number starts from 1 According to RFC4303, section "3.3.3. Sequence Number Generation", the first packet sent using a given SA will contain a sequence number of 1. However if user didn't set seq/oseq, the HW used zero as first sequence packet number. Such misconfiguration causes to drop of first packet if replay window protection was enabled in SA. To fix it, set sequence number to be at least 1. Fixes: 7db21ef4566e ("net/mlx5e: Set IPsec replay sequence numbers") Signed-off-by: Leon Romanovsky commit a5e400a985df8041ed4659ed1462aa9134318130 Author: Leon Romanovsky Date: Sun Aug 20 20:58:56 2023 +0300 net/mlx5e: Honor user choice of IPsec replay window size Users can configure IPsec replay window size, but mlx5 driver didn't honor their choice and set always 32bits. Fix assignment logic to configure right size from the beginning. Fixes: 7db21ef4566e ("net/mlx5e: Set IPsec replay sequence numbers") Reviewed-by: Patrisious Haddad Signed-off-by: Leon Romanovsky commit 4b3338aaa74d7d4ec5b6734dc298f0db94ec83d2 Author: Naveen N Rao Date: Thu Nov 30 12:29:47 2023 +0530 powerpc/ftrace: Fix stack teardown in ftrace_no_trace Commit 41a506ef71eb ("powerpc/ftrace: Create a dummy stackframe to fix stack unwind") added use of a new stack frame on ftrace entry to fix stack unwind. However, the commit missed updating the offset used while tearing down the ftrace stack when ftrace is disabled. Fix the same. In addition, the commit missed saving the correct stack pointer in pt_regs. Update the same. Fixes: 41a506ef71eb ("powerpc/ftrace: Create a dummy stackframe to fix stack unwind") Cc: stable@vger.kernel.org # v6.5+ Signed-off-by: Naveen N Rao Signed-off-by: Michael Ellerman Link: https://msgid.link/20231130065947.2188860-1-naveen@kernel.org commit 37e4b8df27bc68340f3fc80dbb27e3549c7f881c Author: Jianheng Zhang Date: Fri Dec 1 03:22:03 2023 +0000 net: stmmac: fix FPE events losing The status bits of register MAC_FPE_CTRL_STS are clear on read. Using 32-bit read for MAC_FPE_CTRL_STS in dwmac5_fpe_configure() and dwmac5_fpe_send_mpacket() clear the status bits. Then the stmmac interrupt handler missing FPE event status and leads to FPE handshaking failure and retries. To avoid clear status bits of MAC_FPE_CTRL_STS in dwmac5_fpe_configure() and dwmac5_fpe_send_mpacket(), add fpe_csr to stmmac_fpe_cfg structure to cache the control bits of MAC_FPE_CTRL_STS and to avoid reading MAC_FPE_CTRL_STS in those methods. Fixes: 5a5586112b92 ("net: stmmac: support FPE link partner hand-shaking procedure") Reviewed-by: Serge Semin Signed-off-by: Jianheng Zhang Link: https://lore.kernel.org/r/CY5PR12MB637225A7CF529D5BE0FBE59CBF81A@CY5PR12MB6372.namprd12.prod.outlook.com Signed-off-by: Jakub Kicinski commit adbf100fc47001c93d7e513ecac6fd6e04d5b4a1 Author: Naveen Mamindlapalli Date: Fri Dec 1 11:03:30 2023 +0530 octeontx2-pf: consider both Rx and Tx packet stats for adaptive interrupt coalescing The current adaptive interrupt coalescing code updates only rx packet stats for dim algorithm. This patch also updates tx packet stats which will be useful when there is only tx traffic. Also moved configuring hardware adaptive interrupt setting to driver dim callback. Fixes: 6e144b47f560 ("octeontx2-pf: Add support for adaptive interrupt coalescing") Signed-off-by: Naveen Mamindlapalli Signed-off-by: Suman Ghosh Reviewed-by: Wojciech Drewek Link: https://lore.kernel.org/r/20231201053330.3903694-1-sumang@marvell.com Signed-off-by: Jakub Kicinski commit 33924328498e903bea74727353e5012d29653aff Merge: 33cc938e65a98 96d7e79401364 Author: Dave Airlie Date: Tue Dec 5 12:19:21 2023 +1000 Merge tag 'drm-intel-fixes-2023-12-01-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v6.7-rc4 #2: - d21a3962d304 ("drm/i915: Call intel_pre_plane_updates() also for pipes getting enabled") in the previous fixes pull depends on a change that wasn't included. Pick it up. Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87fs0m48ol.fsf@intel.com commit 6b17a597fc2f13aaaa0a2780eb7edb9ae7ac9aea Author: Thomas Reichinger Date: Thu Nov 30 12:35:03 2023 +0100 arcnet: restoring support for multiple Sohard Arcnet cards Probe of Sohard Arcnet cards fails, if 2 or more cards are installed in a system. See kernel log: [ 2.759203] arcnet: arcnet loaded [ 2.763648] arcnet:com20020: COM20020 chipset support (by David Woodhouse et al.) [ 2.770585] arcnet:com20020_pci: COM20020 PCI support [ 2.772295] com20020 0000:02:00.0: enabling device (0000 -> 0003) [ 2.772354] (unnamed net_device) (uninitialized): PLX-PCI Controls ... [ 3.071301] com20020 0000:02:00.0 arc0-0 (uninitialized): PCI COM20020: station FFh found at F080h, IRQ 101. [ 3.071305] com20020 0000:02:00.0 arc0-0 (uninitialized): Using CKP 64 - data rate 2.5 Mb/s [ 3.071534] com20020 0000:07:00.0: enabling device (0000 -> 0003) [ 3.071581] (unnamed net_device) (uninitialized): PLX-PCI Controls ... [ 3.369501] com20020 0000:07:00.0: Led pci:green:tx:0-0 renamed to pci:green:tx:0-0_1 due to name collision [ 3.369535] com20020 0000:07:00.0: Led pci:red:recon:0-0 renamed to pci:red:recon:0-0_1 due to name collision [ 3.370586] com20020 0000:07:00.0 arc0-0 (uninitialized): PCI COM20020: station E1h found at C000h, IRQ 35. [ 3.370589] com20020 0000:07:00.0 arc0-0 (uninitialized): Using CKP 64 - data rate 2.5 Mb/s [ 3.370608] com20020: probe of 0000:07:00.0 failed with error -5 commit 5ef216c1f848 ("arcnet: com20020-pci: add rotary index support") changes the device name of all COM20020 based PCI cards, even if only some cards support this: snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i); The error happens because all Sohard Arcnet cards would be called arc0-0, since the Sohard Arcnet cards don't have a PLX rotary coder. I.e. EAE Arcnet cards have a PLX rotary coder, which sets the first decimal, ensuring unique devices names. This patch adds two new card feature flags to indicate which cards support LEDs and the PLX rotary coder. For EAE based cards the names still depend on the PLX rotary coder (untested, since missing EAE hardware). For Sohard based cards, this patch will result in devices being called arc0, arc1, ... (tested). Signed-off-by: Thomas Reichinger Fixes: 5ef216c1f848 ("arcnet: com20020-pci: add rotary index support") Link: https://lore.kernel.org/r/20231130113503.6812-1-thomas.reichinger@sohard.de Signed-off-by: Jakub Kicinski commit 659aa050a53817157b7459529538598a6449c1d3 Author: Alison Schofield Date: Mon Nov 13 14:13:24 2023 -0800 kernel/resource: Increment by align value in get_free_mem_region() Currently get_free_mem_region() searches for available capacity in increments equal to the region size being requested. This can cause the search to take giant steps through the resource leaving needless gaps and missing available space. Specifically 'cxl create-region' fails with ERANGE even though capacity of the given size and CXL's expected 256M x InterleaveWays alignment can be satisfied. Replace the total-request-size increment with a next alignment increment so that the next possible address is always examined for availability. Fixes: 14b80582c43e ("resource: Introduce alloc_free_mem_region()") Reported-by: Dmytro Adamenko Reported-by: Dan Williams Signed-off-by: Alison Schofield Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20231113221324.1118092-1-alison.schofield@intel.com Cc: Jason Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Dan Williams commit e05501e8a84eee4f819f31b9ce663bddd01b3b69 Author: Dave Jiang Date: Mon Nov 6 10:26:45 2023 -0700 cxl: Add cxl_num_decoders_committed() usage to cxl_test Commit 458ba8189cb4 ("cxl: Add cxl_decoders_committed() helper") missed the conversion for cxl_test. Add usage of cxl_num_decoders_committed() to replace the open coding. Suggested-by: Alison Schofield Signed-off-by: Dave Jiang Reviewed-by: Fan Ni Link: https://lore.kernel.org/r/169929160525.824083.11813222229025394254.stgit@djiang5-mobl3 Signed-off-by: Dan Williams commit fcc9b50e5517f7d65cdc33d81f223b22536f863f Author: Greg Kroah-Hartman Date: Tue Dec 5 09:10:01 2023 +0900 Revert "greybus: gb-beagleplay: Ensure le for values in transport" This reverts commit 52eb67861ebeb2110318bd9fe33d85ddcf92aac7. Turns out to not be correct, a new version will be generated later. Link: https://lore.kernel.org/r/20231204131008.384583-1-ayushdevel1325@gmail.com Cc: Ayush Singh Signed-off-by: Greg Kroah-Hartman commit e3e82fcb79eeb3f1a88a89f676831773caff514a Author: Shifeng Li Date: Thu Nov 30 00:14:15 2023 -0800 RDMA/irdma: Avoid free the non-cqp_request scratch When creating ceq_0 during probing irdma, cqp.sc_cqp will be sent as a cqp_request to cqp->sc_cqp.sq_ring. If the request is pending when removing the irdma driver or unplugging its aux device, cqp.sc_cqp will be dereferenced as wrong struct in irdma_free_pending_cqp_request(). PID: 3669 TASK: ffff88aef892c000 CPU: 28 COMMAND: "kworker/28:0" #0 [fffffe0000549e38] crash_nmi_callback at ffffffff810e3a34 #1 [fffffe0000549e40] nmi_handle at ffffffff810788b2 #2 [fffffe0000549ea0] default_do_nmi at ffffffff8107938f #3 [fffffe0000549eb8] do_nmi at ffffffff81079582 #4 [fffffe0000549ef0] end_repeat_nmi at ffffffff82e016b4 [exception RIP: native_queued_spin_lock_slowpath+1291] RIP: ffffffff8127e72b RSP: ffff88aa841ef778 RFLAGS: 00000046 RAX: 0000000000000000 RBX: ffff88b01f849700 RCX: ffffffff8127e47e RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffffff83857ec0 RBP: ffff88afe3e4efc8 R8: ffffed15fc7c9dfa R9: ffffed15fc7c9dfa R10: 0000000000000001 R11: ffffed15fc7c9df9 R12: 0000000000740000 R13: ffff88b01f849708 R14: 0000000000000003 R15: ffffed1603f092e1 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0000 -- -- #5 [ffff88aa841ef778] native_queued_spin_lock_slowpath at ffffffff8127e72b #6 [ffff88aa841ef7b0] _raw_spin_lock_irqsave at ffffffff82c22aa4 #7 [ffff88aa841ef7c8] __wake_up_common_lock at ffffffff81257363 #8 [ffff88aa841ef888] irdma_free_pending_cqp_request at ffffffffa0ba12cc [irdma] #9 [ffff88aa841ef958] irdma_cleanup_pending_cqp_op at ffffffffa0ba1469 [irdma] #10 [ffff88aa841ef9c0] irdma_ctrl_deinit_hw at ffffffffa0b2989f [irdma] #11 [ffff88aa841efa28] irdma_remove at ffffffffa0b252df [irdma] #12 [ffff88aa841efae8] auxiliary_bus_remove at ffffffff8219afdb #13 [ffff88aa841efb00] device_release_driver_internal at ffffffff821882e6 #14 [ffff88aa841efb38] bus_remove_device at ffffffff82184278 #15 [ffff88aa841efb88] device_del at ffffffff82179d23 #16 [ffff88aa841efc48] ice_unplug_aux_dev at ffffffffa0eb1c14 [ice] #17 [ffff88aa841efc68] ice_service_task at ffffffffa0d88201 [ice] #18 [ffff88aa841efde8] process_one_work at ffffffff811c589a #19 [ffff88aa841efe60] worker_thread at ffffffff811c71ff #20 [ffff88aa841eff10] kthread at ffffffff811d87a0 #21 [ffff88aa841eff50] ret_from_fork at ffffffff82e0022f Fixes: 44d9e52977a1 ("RDMA/irdma: Implement device initialization definitions") Link: https://lore.kernel.org/r/20231130081415.891006-1-lishifeng@sangfor.com.cn Suggested-by: "Ismail, Mustafa" Signed-off-by: Shifeng Li Reviewed-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit 03769f72d66edab82484449ed594cb6b00ae0223 Author: Mike Marciniszyn Date: Wed Nov 29 14:21:43 2023 -0600 RDMA/irdma: Fix support for 64k pages Virtual QP and CQ require a 4K HW page size but the driver passes PAGE_SIZE to ib_umem_find_best_pgsz() instead. Fix this by using the appropriate 4k value in the bitmap passed to ib_umem_find_best_pgsz(). Fixes: 693a5386eff0 ("RDMA/irdma: Split mr alloc and free into new functions") Link: https://lore.kernel.org/r/20231129202143.1434-4-shiraz.saleem@intel.com Signed-off-by: Mike Marciniszyn Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit 0a5ec366de7e94192669ba08de6ed336607fd282 Author: Mike Marciniszyn Date: Wed Nov 29 14:21:42 2023 -0600 RDMA/irdma: Ensure iWarp QP queue memory is OS paged aligned The SQ is shared for between kernel and used by storing the kernel page pointer and passing that to a kmap_atomic(). This then requires that the alignment is PAGE_SIZE aligned. Fix by adding an iWarp specific alignment check. Fixes: e965ef0e7b2c ("RDMA/irdma: Split QP handler into irdma_reg_user_mr_type_qp") Link: https://lore.kernel.org/r/20231129202143.1434-3-shiraz.saleem@intel.com Signed-off-by: Mike Marciniszyn Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit 4fbc3a52cd4d14de3793f4b2c721d7306ea84cf9 Author: Mike Marciniszyn Date: Wed Nov 29 14:21:41 2023 -0600 RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz 64k pages introduce the situation in this diagram when the HCA 4k page size is being used: +-------------------------------------------+ <--- 64k aligned VA | | | HCA 4k page | | | +-------------------------------------------+ | o | | | | o | | | | o | +-------------------------------------------+ | | | HCA 4k page | | | +-------------------------------------------+ <--- Live HCA page |OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO| <--- offset | | <--- VA | MR data | +-------------------------------------------+ | | | HCA 4k page | | | +-------------------------------------------+ | o | | | | o | | | | o | +-------------------------------------------+ | | | HCA 4k page | | | +-------------------------------------------+ The VA addresses are coming from rdma-core in this diagram can be arbitrary, but for 64k pages, the VA may be offset by some number of HCA 4k pages and followed by some number of HCA 4k pages. The current iterator doesn't account for either the preceding 4k pages or the following 4k pages. Fix the issue by extending the ib_block_iter to contain the number of DMA pages like comment [1] says and by using __sg_advance to start the iterator at the first live HCA page. The changes are contained in a parallel set of iterator start and next functions that are umem aware and specific to umem since there is one user of the rdma_for_each_block() without umem. These two fixes prevents the extra pages before and after the user MR data. Fix the preceding pages by using the __sq_advance field to start at the first 4k page containing MR data. Fix the following pages by saving the number of pgsz blocks in the iterator state and downcounting on each next. This fix allows for the elimination of the small page crutch noted in the Fixes. Fixes: 10c75ccb54e4 ("RDMA/umem: Prevent small pages from being returned by ib_umem_find_best_pgsz()") Link: https://lore.kernel.org/r/20231129202143.1434-2-shiraz.saleem@intel.com Signed-off-by: Mike Marciniszyn Signed-off-by: Shiraz Saleem Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe commit db3fadacaf0c817b222090290d06ca2a338422d0 Author: Daniel Borkmann Date: Fri Dec 1 14:10:21 2023 +0100 packet: Move reference count in packet_sock to atomic_long_t In some potential instances the reference count on struct packet_sock could be saturated and cause overflows which gets the kernel a bit confused. To prevent this, move to a 64-bit atomic reference count on 64-bit architectures to prevent the possibility of this type to overflow. Because we can not handle saturation, using refcount_t is not possible in this place. Maybe someday in the future if it changes it could be used. Also, instead of using plain atomic64_t, use atomic_long_t instead. 32-bit machines tend to be memory-limited (i.e. anything that increases a reference uses so much memory that you can't actually get to 2**32 references). 32-bit architectures also tend to have serious problems with 64-bit atomics. Hence, atomic_long_t is the more natural solution. Reported-by: "The UK's National Cyber Security Centre (NCSC)" Co-developed-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman Signed-off-by: Daniel Borkmann Cc: Linus Torvalds Cc: stable@kernel.org Reviewed-by: Willem de Bruijn Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20231201131021.19999-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit bee0e7762ad2c6025b9f5245c040fcc36ef2bde8 Merge: 1e535748449a5 6f9c4d8c468c1 Author: Linus Torvalds Date: Tue Dec 5 06:54:52 2023 +0900 Merge tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd Pull iommufd fixes from Jason Gunthorpe: - A small fix for the dirty tracking self test to fail correctly if the code is buggy - Fix a tricky syzkaller race UAF with object reference counting * tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd: iommufd: Do not UAF during iommufd_put_object() iommufd: Add iommufd_ctx to iommufd_put_object() iommufd/selftest: Fix _test_mock_dirty_bitmaps() commit 1e535748449a51842872c46db61525f7524fc63a Merge: 33cc938e65a98 cefc9ba6aed48 Author: Linus Torvalds Date: Tue Dec 5 06:51:43 2023 +0900 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull vdpa fixes from Michael Tsirkin: "Fixes in mlx5 and pds drivers" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: pds_vdpa: set features order pds_vdpa: clear config callback when status goes to 0 pds_vdpa: fix up format-truncation complaint vdpa/mlx5: preserve CVQ vringh index commit 0a10d15280a385e5971fb58a6d2eddbf7c0aa9f3 Merge: 29046a78a3c0a 716d4e5373e9d Author: Mark Brown Date: Mon Dec 4 21:42:29 2023 +0000 ASoC: qcom: Limit Digital gains on speaker Merge series from srinivas.kandagatla@linaro.org: Limit the speaker digital gains to 0dB so that the users will not damage them. Currently there is a limit in UCM, but this does not stop the user form changing the digital gains from command line. So limit this in driver which makes the speakers more safer without active speaker protection in place. Apart from this there is also a range check fix in snd_soc_limit_volume to allow setting this limit correctly. Tested on Lenovo X13s. commit f88d811a238b12a261a04f125db952cf05c06d0b Author: Kent Overstreet Date: Sun Dec 3 13:05:21 2023 -0500 bcachefs: Don't run indirect extent trigger unless inserting/deleting This fixes a transaction path overflow reported in the snapshot deletion path, when moving extents to the correct snapshot. The root of the issue is that creating/deleting a reflink pointer can generate an unbounded number of updates, if it is allowed to reference an unbounded number of indirect extents; to prevent this, merging of reflink pointers has been disabled. But there's a hole, which is that copygc/rebalance may fragment existing extents in the course of moving them around, and if an indirect extent becomes too fragmented we'll then become unable to delete the reflink pointer. The eventual solution is going to be to tweak trigger handling so that we can process large reflink pointers incrementally when necessary, and notice that trigger updates don't need to be run for the part of the reflink pointer not changing. That is going to be a bigger project though, for another patch. Signed-off-by: Kent Overstreet commit adcf4ee64291b701d083bacf653eb10a4c46acd7 Author: Kent Overstreet Date: Mon Dec 4 00:38:56 2023 -0500 bcachefs: Convert compression_stats to for_each_btree_key2 for_each_btree_key2() runs each loop iteration in a btree transaction, and thus does not cause SRCU lock hold time problems. Signed-off-by: Kent Overstreet commit 131898b0cb4ac6598d3537eeeee2711dec129f51 Author: Kent Overstreet Date: Sat Dec 2 02:43:58 2023 -0500 bcachefs: Fix bch2_extent_drop_ptrs() call Also, make bch2_extent_drop_ptrs() safer, so it works with extents and non-extents iterators. Signed-off-by: Kent Overstreet commit 87b0d8d3d05028c59b64c0287efeca90c28e1152 Author: Kent Overstreet Date: Fri Dec 1 01:14:50 2023 -0500 bcachefs: Fix a journal deadlock in replay Recently, journal pre-reservations were removed. They were for reserving space ahead of time in the journal for operations that are required for journal reclaim, e.g. btree key cache flushing and interior node btree updates. Instead we have watermarks - only operations for journal reclaim are allowed when the journal is low on space, and in general we're quite good about doing operations in the order that will free up space in the journal quickest when we're low on space. If we're doing a journal reclaim operation out of order, we usually do it in nonblocking mode if it's not freeing up space at the end of the journal. There's an exceptino though - interior btree node update operations have to be BCH_WATERMARK_reclaim - once they've been started, and they can't be nonblocking. Generally this is fine because they'll only be a very small fraction of transaction commits - but there's an exception, which is during journal replay. Journal replay does many btree operations, but doesn't need to commit them to the journal since they're already in the journal. So killing off of pre-reservation, plus another change to make journal replay more efficient by initially doing the replay in sorted btree order, made it possible for the interior update operations replay generates to fill and deadlock the journal. Fix this by introducing a new check on journal space at the _start_ of an interior update operation. This causes us to block if necessary in exactly the same way as we used to when interior updates took a journal pre-reservaiton, but without all the expensive accounting pre-reservations required. Signed-off-by: Kent Overstreet commit ef6fae4a13aecfa7966edff0445e5c920ad2ddd9 Author: Kent Overstreet Date: Fri Dec 1 22:31:23 2023 -0500 bcachefs; Don't use btree write buffer until journal replay is finished The keys being replayed by journal replay have to be synchronized with updates by other threads that overwrite them. We rely on btree node locks for synchronizing - but since btree write buffer updates take no btree locks, that won't work. Instead, simply disable using the btree write buffer until journal replay is finished. This fixes a rare backpointers error in the merge_torture_flakey test. Signed-off-by: Kent Overstreet commit c13c823a78b77ea0e5f1f73112d910e259911101 Author: Rob Herring Date: Thu Nov 30 13:18:29 2023 -0600 arm64: dts: rockchip: Fix PCI node addresses on rk3399-gru The rk3399-gru PCI node addresses are wrong. In rk3399-gru-scarlet, the bus number in the address should be 0. This is because bus number assignment is dynamic and not known up front. For FDT, the bus number is simply ignored. In rk3399-gru-chromebook, the addresses are simply invalid. The first "reg" entry must be the configuration space for the device. The entry should be all 0s except for device/slot and function numbers. The existing 64-bit memory space (0x83000000) entries are not valid because they must have the BAR address in the lower byte of the first cell. Warnings for these are enabled by adding the missing 'device_type = "pci"' for the root port node. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231130191830.2424361-1-robh@kernel.org Signed-off-by: Heiko Stuebner commit c54fc3a4f375663f2361a9cbb2955fb4ef912879 Author: David Howells Date: Fri Dec 1 00:22:01 2023 +0000 cifs: Fix flushing, invalidation and file size with FICLONE Fix a number of issues in the cifs filesystem implementation of the FICLONE ioctl in cifs_remap_file_range(). This is analogous to the previously fixed bug in cifs_file_copychunk_range() and can share the helper functions. Firstly, the invalidation of the destination range is handled incorrectly: We shouldn't just invalidate the whole file as dirty data in the file may get lost and we can't just call truncate_inode_pages_range() to invalidate the destination range as that will erase parts of a partial folio at each end whilst invalidating and discarding all the folios in the middle. We need to force all the folios covering the range to be reloaded, but we mustn't lose dirty data in them that's not in the destination range. Further, we shouldn't simply round out the range to PAGE_SIZE at each end as cifs should move to support multipage folios. Secondly, there's an issue whereby a write may have extended the file locally, but not have been written back yet. This can leaves the local idea of the EOF at a later point than the server's EOF. If a clone request is issued, this will fail on the server with STATUS_INVALID_VIEW_SIZE (which gets translated to -EIO locally) if the clone source extends past the server's EOF. Fix this by: (0) Flush the source region (already done). The flush does nothing and the EOF isn't moved if the source region has no dirty data. (1) Move the EOF to the end of the source region if it isn't already at least at this point. If we can't do this, for instance if the server doesn't support it, just flush the entire source file. (2) Find the folio (if present) at each end of the range, flushing it and increasing the region-to-be-invalidated to cover those in their entirety. (3) Fully discard all the folios covering the range as we want them to be reloaded. (4) Then perform the extent duplication. Thirdly, set i_size after doing the duplicate_extents operation as this value may be used by various things internally. stat() hides the issue because setting ->time to 0 causes cifs_getatr() to revalidate the attributes. These were causing the cifs/001 xfstest to fail. Fixes: 04b38d601239 ("vfs: pull btrfs clone API to vfs layer") Signed-off-by: David Howells Cc: stable@vger.kernel.org cc: Christoph Hellwig cc: Paulo Alcantara cc: Shyam Prasad N cc: Rohith Surabattula cc: Matthew Wilcox cc: Jeff Layton cc: linux-cifs@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: David Howells Signed-off-by: Steve French commit 7b2404a886f8b91250c31855d287e632123e1746 Author: David Howells Date: Fri Dec 1 00:22:00 2023 +0000 cifs: Fix flushing, invalidation and file size with copy_file_range() Fix a number of issues in the cifs filesystem implementation of the copy_file_range() syscall in cifs_file_copychunk_range(). Firstly, the invalidation of the destination range is handled incorrectly: We shouldn't just invalidate the whole file as dirty data in the file may get lost and we can't just call truncate_inode_pages_range() to invalidate the destination range as that will erase parts of a partial folio at each end whilst invalidating and discarding all the folios in the middle. We need to force all the folios covering the range to be reloaded, but we mustn't lose dirty data in them that's not in the destination range. Further, we shouldn't simply round out the range to PAGE_SIZE at each end as cifs should move to support multipage folios. Secondly, there's an issue whereby a write may have extended the file locally, but not have been written back yet. This can leaves the local idea of the EOF at a later point than the server's EOF. If a copy request is issued, this will fail on the server with STATUS_INVALID_VIEW_SIZE (which gets translated to -EIO locally) if the copy source extends past the server's EOF. Fix this by: (0) Flush the source region (already done). The flush does nothing and the EOF isn't moved if the source region has no dirty data. (1) Move the EOF to the end of the source region if it isn't already at least at this point. If we can't do this, for instance if the server doesn't support it, just flush the entire source file. (2) Find the folio (if present) at each end of the range, flushing it and increasing the region-to-be-invalidated to cover those in their entirety. (3) Fully discard all the folios covering the range as we want them to be reloaded. (4) Then perform the copy. Thirdly, set i_size after doing the copychunk_range operation as this value may be used by various things internally. stat() hides the issue because setting ->time to 0 causes cifs_getatr() to revalidate the attributes. These were causing the generic/075 xfstest to fail. Fixes: 620d8745b35d ("Introduce cifs_copy_file_range()") Cc: stable@vger.kernel.org Signed-off-by: David Howells cc: Paulo Alcantara cc: Shyam Prasad N cc: Rohith Surabattula cc: Matthew Wilcox cc: Jeff Layton cc: linux-cifs@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: David Howells Signed-off-by: Steve French commit 815f986f33eeb06652d59d8a4d405d4fdb4e59a8 Author: Heiko Stuebner Date: Fri Dec 1 14:48:59 2023 +0100 arm64: dts: rockchip: drop interrupt-names property from rk3588s dfi The dfi binding does not specify interrupt names, with the interrupts just specifying channels 0-x. So drop the unspecified property. Fixes: 5a6976b1040a ("arm64: dts: rockchip: Add DFI to rk3588s") Reported-by: Jagan Teki Signed-off-by: Heiko Stuebner Link: https://lore.kernel.org/r/20231201134859.322491-1-heiko@sntech.de commit 7c1593410bca9a66c89d528f523ae32e2e220e68 Merge: b85ea95d08647 4a92a87950c4f Author: Palmer Dabbelt Date: Mon Dec 4 11:02:40 2023 -0800 Merge patch series "riscv: Fix issues with module loading" Charlie Jenkins says: Module loading did not account for multiple threads concurrently loading modules. This patch fixes that issue. There is also a small patch to fix the type of a __le16 variable. * b4-shazam-merge: riscv: Correct type casting in module loading riscv: Safely remove entries from relocation list Link: https://lore.kernel.org/r/20231127-module_linking_freeing-v4-0-a2ca1d7027d0@rivosinc.com Signed-off-by: Palmer Dabbelt commit 4a92a87950c4f86bc372ee3b1da4ba9d092252a9 Author: Charlie Jenkins Date: Mon Nov 27 14:05:00 2023 -0800 riscv: Correct type casting in module loading Use __le16 with le16_to_cpu. Fixes: 8fd6c5142395 ("riscv: Add remaining module relocations") Signed-off-by: Charlie Jenkins Reviewed-by: Samuel Holland Tested-by: Samuel Holland Tested-by: Björn Töpel Link: https://lore.kernel.org/r/20231127-module_linking_freeing-v4-2-a2ca1d7027d0@rivosinc.com Signed-off-by: Palmer Dabbelt commit d8792a5734b0f3e58b898c2e2f910bfac48e9ee3 Author: Charlie Jenkins Date: Mon Nov 27 14:04:59 2023 -0800 riscv: Safely remove entries from relocation list Use the safe versions of list and hlist iteration to safely remove entries from the module relocation lists. To allow mutliple threads to load modules concurrently, move relocation list pointers onto the stack rather than using global variables. Fixes: 8fd6c5142395 ("riscv: Add remaining module relocations") Reported-by: Ron Economos Closes: https://lore.kernel.org/linux-riscv/444de86a-7e7c-4de7-5d1d-c1c40eefa4ba@w6rz.net Signed-off-by: Charlie Jenkins Tested-by: Björn Töpel Link: https://lore.kernel.org/r/20231127-module_linking_freeing-v4-1-a2ca1d7027d0@rivosinc.com Signed-off-by: Palmer Dabbelt commit 839a40d1e730977d4448d141fa653517c2959a88 Author: Bitao Hu Date: Thu Nov 30 10:13:37 2023 +0800 nvme: fix deadlock between reset and scan If controller reset occurs when allocating namespace, both nvme_reset_work and nvme_scan_work will hang, as shown below. Test Scripts: for ((t=1;t<=128;t++)) do nsid=`nvme create-ns /dev/nvme1 -s 14537724 -c 14537724 -f 0 -m 0 \ -d 0 | awk -F: '{print($NF);}'` nvme attach-ns /dev/nvme1 -n $nsid -c 0 done nvme reset /dev/nvme1 We will find that both nvme_reset_work and nvme_scan_work hung: INFO: task kworker/u249:4:17848 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:kworker/u249:4 state:D stack: 0 pid:17848 ppid: 2 flags:0x00000028 Workqueue: nvme-reset-wq nvme_reset_work [nvme] Call trace: __switch_to+0xb4/0xfc __schedule+0x22c/0x670 schedule+0x4c/0xd0 blk_mq_freeze_queue_wait+0x84/0xc0 nvme_wait_freeze+0x40/0x64 [nvme_core] nvme_reset_work+0x1c0/0x5cc [nvme] process_one_work+0x1d8/0x4b0 worker_thread+0x230/0x440 kthread+0x114/0x120 INFO: task kworker/u249:3:22404 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:kworker/u249:3 state:D stack: 0 pid:22404 ppid: 2 flags:0x00000028 Workqueue: nvme-wq nvme_scan_work [nvme_core] Call trace: __switch_to+0xb4/0xfc __schedule+0x22c/0x670 schedule+0x4c/0xd0 rwsem_down_write_slowpath+0x32c/0x98c down_write+0x70/0x80 nvme_alloc_ns+0x1ac/0x38c [nvme_core] nvme_validate_or_alloc_ns+0xbc/0x150 [nvme_core] nvme_scan_ns_list+0xe8/0x2e4 [nvme_core] nvme_scan_work+0x60/0x500 [nvme_core] process_one_work+0x1d8/0x4b0 worker_thread+0x260/0x440 kthread+0x114/0x120 INFO: task nvme:28428 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:nvme state:D stack: 0 pid:28428 ppid: 27119 flags:0x00000000 Call trace: __switch_to+0xb4/0xfc __schedule+0x22c/0x670 schedule+0x4c/0xd0 schedule_timeout+0x160/0x194 do_wait_for_common+0xac/0x1d0 __wait_for_common+0x78/0x100 wait_for_completion+0x24/0x30 __flush_work.isra.0+0x74/0x90 flush_work+0x14/0x20 nvme_reset_ctrl_sync+0x50/0x74 [nvme_core] nvme_dev_ioctl+0x1b0/0x250 [nvme_core] __arm64_sys_ioctl+0xa8/0xf0 el0_svc_common+0x88/0x234 do_el0_svc+0x7c/0x90 el0_svc+0x1c/0x30 el0_sync_handler+0xa8/0xb0 el0_sync+0x148/0x180 The reason for the hang is that nvme_reset_work occurs while nvme_scan_work is still running. nvme_scan_work may add new ns into ctrl->namespaces list after nvme_reset_work frozen all ns->q in ctrl->namespaces list. The newly added ns is not frozen, so nvme_wait_freeze will wait forever. Unfortunately, ctrl->namespaces_rwsem is held by nvme_reset_work, so nvme_scan_work will also wait forever. Now we are deadlocked! PROCESS1 PROCESS2 ============== ============== nvme_scan_work ... nvme_reset_work nvme_validate_or_alloc_ns nvme_dev_disable nvme_alloc_ns nvme_start_freeze down_write ... nvme_ns_add_to_ctrl_list ... up_write nvme_wait_freeze ... down_read nvme_alloc_ns blk_mq_freeze_queue_wait down_write Fix by marking the ctrl with say NVME_CTRL_FROZEN flag set in nvme_start_freeze and cleared in nvme_unfreeze. Then the scan can check it before adding the new namespace (under the namespaces_rwsem). Signed-off-by: Bitao Hu Reviewed-by: Guixin Liu Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 20dc66f2d76b4a410df14e4675e373b718babc34 Author: Nitesh Shetty Date: Tue Nov 28 17:59:57 2023 +0530 nvme: prevent potential spectre v1 gadget This patch fixes the smatch warning, "nvmet_ns_ana_grpid_store() warn: potential spectre issue 'nvmet_ana_group_enabled' [w] (local cap)" Prevent the contents of kernel memory from being leaked to user space via speculative execution by using array_index_nospec. Signed-off-by: Nitesh Shetty Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 29ac4b2f9263f52ba12fa35832cc6506ce3b4793 Author: Shin'ichiro Kawasaki Date: Wed Nov 29 13:49:51 2023 +0900 nvme: improve NVME_HOST_AUTH and NVME_TARGET_AUTH config descriptions Currently two similar config options NVME_HOST_AUTH and NVME_TARGET_AUTH have almost same descriptions. It is confusing to choose them in menuconfig. Improve the descriptions to distinguish them. Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 7be866b1cf0bf1dfa74480fe8097daeceda68622 Author: Keith Busch Date: Tue May 2 11:43:41 2023 -0700 nvme-ioctl: move capable() admin check to the end This can be an expensive call on some kernel configs. Move it to the end after checking the cheaper ways to determine if the command is allowed. Reviewed-by: Jens Axboe Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit e6e7f7ac03e40795346f1b2994a05f507ad8d345 Author: Keith Busch Date: Fri Oct 27 10:58:12 2023 -0700 nvme: ensure reset state check ordering A different CPU may be setting the ctrl->state value, so ensure proper barriers to prevent optimizing to a stale state. Normally it isn't a problem to observe the wrong state as it is merely advisory to take a quicker path during initialization and error recovery, but seeing an old state can report unexpected ENETRESET errors when a reset request was in fact successful. Reported-by: Minh Hoang Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch Signed-off-by: Hannes Reinecke commit 5c687c287c46fadb14644091823298875a5216aa Author: Keith Busch Date: Mon Oct 30 08:13:09 2023 -0700 nvme: introduce helper function to get ctrl state The controller state is typically written by another CPU, so reading it should ensure no optimizations are taken. This is a repeated pattern in the driver, so start with adding a convenience function that returns the controller state with READ_ONCE(). Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 716d4e5373e9d1ae993485ab2e3b893bf7104fb1 Author: Srinivas Kandagatla Date: Mon Dec 4 12:47:36 2023 +0000 ASoC: qcom: sc8280xp: Limit speaker digital volumes Limit the speaker digital gains to 0dB so that the users will not damage them. Currently there is a limit in UCM, but this does not stop the user form changing the digital gains from command line. So limit this in driver which makes the speakers more safer without active speaker protection in place. Signed-off-by: Srinivas Kandagatla Reviewed-by: Johan Hovold Tested-by: Johan Hovold Link: https://lore.kernel.org/r/20231204124736.132185-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit fb9ad24485087e0f00d84bee7a5914640b2b9024 Author: Srinivas Kandagatla Date: Mon Dec 4 12:47:35 2023 +0000 ASoC: ops: add correct range check for limiting volume Volume can have ranges that start with negative values, ex: -84dB to +40dB. Apply correct range check in snd_soc_limit_volume before setting the platform_max. Without this patch, for example setting a 0dB limit on a volume range of -84dB to +40dB would fail. Signed-off-by: Srinivas Kandagatla Tested-by: Johan Hovold Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/20231204124736.132185-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 31e52523267faab5ed8569b9d5c22c9a2283872f Author: Sebastian Parschauer Date: Mon Nov 27 23:49:37 2023 +0100 HID: Add quirk for Labtec/ODDOR/aikeec handbrake This device needs ALWAYS_POLL quirk, otherwise it keeps reconnecting indefinitely. It is a handbrake for sim racing detected as joystick. Reported and tested by GitHub user N0th1ngM4tt3rs. Link: https://github.com/sriemer/fix-linux-mouse issue 22 Signed-off-by: Sebastian Parschauer Signed-off-by: Jiri Kosina commit a9f68ffe1170ca4bc17ab29067d806a354a026e0 Author: Mario Limonciello Date: Sat Dec 2 21:24:30 2023 -0600 HID: i2c-hid: Add IDEA5002 to i2c_hid_acpi_blacklist[] Users have reported problems with recent Lenovo laptops that contain an IDEA5002 I2C HID device. Reports include fans turning on and running even at idle and spurious wakeups from suspend. Presumably in the Windows ecosystem there is an application that uses the HID device. Maybe that puts it into a lower power state so it doesn't cause spurious events. This device doesn't serve any functional purpose in Linux as nothing interacts with it so blacklist it from being probed. This will prevent the GPIO driver from setting up the GPIO and the spurious interrupts and wake events will not occur. Cc: stable@vger.kernel.org # 6.1 Reported-and-tested-by: Marcus Aram Reported-and-tested-by: Mark Herbert Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2812 Signed-off-by: Mario Limonciello Signed-off-by: Jiri Kosina commit 2fff0b5e1a6b9c577b4dd4958902c877159c856b Author: Mario Limonciello Date: Sat Dec 2 21:24:31 2023 -0600 pinctrl: amd: Mask non-wake source pins with interrupt enabled at suspend If a pin isn't marked as a wake source processing any interrupts is just going to destroy battery life. The APU may wake up from a hardware sleep state to process the interrupt but not return control to the OS. Mask interrupt for all non-wake source pins at suspend. They'll be re-enabled at resume. Reported-and-tested-by: Marcus Aram Reported-and-tested-by: Mark Herbert Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2812 Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20231203032431.30277-3-mario.limonciello@amd.com Signed-off-by: Linus Walleij commit b8e0792449928943c15d1af9f63816911d139267 Author: Stefan Hajnoczi Date: Mon Dec 4 09:07:43 2023 -0500 virtio_blk: fix snprintf truncation compiler warning Commit 4e0400525691 ("virtio-blk: support polling I/O") triggers the following gcc 13 W=1 warnings: drivers/block/virtio_blk.c: In function ‘init_vq’: drivers/block/virtio_blk.c:1077:68: warning: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 7 [-Wformat-truncation=] 1077 | snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%d", i); | ^~ drivers/block/virtio_blk.c:1077:58: note: directive argument in the range [-2147483648, 65534] 1077 | snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%d", i); | ^~~~~~~~~~~~~ drivers/block/virtio_blk.c:1077:17: note: ‘snprintf’ output between 11 and 21 bytes into a destination of size 16 1077 | snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%d", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is a false positive because the lower bound -2147483648 is incorrect. The true range of i is [0, num_vqs - 1] where 0 < num_vqs < 65536. The code mixes int, unsigned short, and unsigned int types in addition to using "%d" for an unsigned value. Use unsigned short and "%u" consistently to solve the compiler warning. Cc: Suwan Kim Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202312041509.DIyvEt9h-lkp@intel.com/ Signed-off-by: Stefan Hajnoczi Message-Id: <20231204140743.1487843-1-stefanha@redhat.com> Signed-off-by: Michael S. Tsirkin commit 6f7e4664e597440dfbdb8b2931c561b717030d07 Author: Bin Li Date: Mon Dec 4 18:04:50 2023 +0800 ALSA: hda/realtek: Enable headset on Lenovo M90 Gen5 Lenovo M90 Gen5 is equipped with ALC897, and it needs ALC897_FIXUP_HEADSET_MIC_PIN quirk to make its headset mic work. Signed-off-by: Bin Li Cc: Link: https://lore.kernel.org/r/20231204100450.642783-1-bin.li@canonical.com Signed-off-by: Takashi Iwai commit cd14dedf15be432066e63783c63d650f2800cd48 Author: Aleksandrs Vinarskis Date: Mon Dec 4 00:30:06 2023 +0100 ALSA: hda/realtek: fix speakers on XPS 9530 (2023) XPS 9530 has 2 tweeters and 2 subwoofers powered by CS35L41 amplifier, SPI connected. For subwoofers to work, it requires both to enable amplifier support, and to enable output to subwoofers via 0x17 quirk (similalry to XPS 9510/9520). Signed-off-by: Aleksandrs Vinarskis Cc: Link: https://lore.kernel.org/r/20231203233006.100558-1-alex.vinarskis@gmail.com Signed-off-by: Takashi Iwai commit bbb8e71965c3737bdc691afd803a34bfd61cfbeb Author: Sarah Grant Date: Fri Dec 1 18:16:54 2023 +0000 ALSA: usb-audio: Add Pioneer DJM-450 mixer controls These values mirror those of the Pioneer DJM-250MK2 as the channel layout appears identical based on my observations. This duplication could be removed in later contributions if desired. Signed-off-by: Sarah Grant Cc: Link: https://lore.kernel.org/r/20231201181654.5058-1-s@srd.tw Signed-off-by: Takashi Iwai commit 408d4b33c2440600418a1eb9c89eaa27cf5867ad Author: Marius Cristea Date: Wed Nov 29 15:56:19 2023 +0200 iio: adc: MCP3564: fix hardware identification logic In mcp3564_config() fix the hardware identification logic based on the hardware ID registers. Second part of the code was disabled by an logic error. Fix a typo related to the "MODULE_DESCRIPTION". Fixes: 33ec3e5fc1ea (iio: adc: adding support for MCP3564 ADC) Signed-off-by: Marius Cristea Link: https://lore.kernel.org/r/20231129135619.63475-1-marius.cristea@microchip.com Signed-off-by: Jonathan Cameron commit 85ac6d92fdfd6097a16d9c61363fe1d0272c1604 Author: Javier Carrasco Date: Fri Dec 1 10:48:03 2023 +0100 iio: adc: MCP3564: fix calib_bias and calib_scale range checks The current implementation uses the AND (&&) operator to check if the value to write for IIO_CHAN_INFO_CALIBBIAS and IIO_CHAN_INFO_CALIBSCALE is within the valid ranges. The evaluated values are the lower and upper limits of the ranges, so this operation always evaluates to false. The OR (||) operator must be used instead. Signed-off-by: Javier Carrasco Reviewed-by: Marius Cristea Link: https://lore.kernel.org/r/20231201-mcp3564_range_checks-v1-1-68f4436e22b0@gmail.com Cc: Signed-off-by: Jonathan Cameron commit 1f475cd572ea77ae6474a17e693a96bca927efe9 Author: Xuan Zhuo Date: Fri Dec 1 11:33:03 2023 +0800 virtio_ring: fix syncs DMA memory with different direction Now the APIs virtqueue_dma_sync_single_range_for_{cpu,device} ignore the parameter 'dir', that is a mistake. [ 6.101666] ------------[ cut here ]------------ [ 6.102079] DMA-API: virtio-pci 0000:00:04.0: device driver syncs DMA memory with different direction [device address=0x00000000ae010000] [size=32752 bytes] [mapped with DMA_FROM_DEVICE] [synced with DMA_BIDIRECTIONAL] [ 6.103630] WARNING: CPU: 6 PID: 0 at kernel/dma/debug.c:1125 check_sync+0x53e/0x6c0 [ 6.107420] CPU: 6 PID: 0 Comm: swapper/6 Tainted: G E 6.6.0+ #290 [ 6.108030] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 [ 6.108936] RIP: 0010:check_sync+0x53e/0x6c0 [ 6.109289] Code: 24 10 e8 f5 d9 74 00 4c 8b 4c 24 10 4c 8b 44 24 18 48 8b 4c 24 20 48 89 c6 41 56 4c 89 ea 48 c7 c7 b0 f1 50 82 e8 32 fc f3 ff <0f> 0b 48 c7 c7 48 4b 4a 82 e8 74 d9 fc ff 8b 73 4c 48 8d 7b 50 31 [ 6.110750] RSP: 0018:ffffc90000180cd8 EFLAGS: 00010092 [ 6.111178] RAX: 00000000000000ce RBX: ffff888100aa5900 RCX: 0000000000000000 [ 6.111744] RDX: 0000000000000104 RSI: ffffffff824c3208 RDI: 00000000ffffffff [ 6.112316] RBP: ffffc90000180d40 R08: 0000000000000000 R09: 00000000fffeffff [ 6.112893] R10: ffffc90000180b98 R11: ffffffff82f63308 R12: ffffffff83d5af00 [ 6.113460] R13: ffff888100998200 R14: ffffffff824a4b5f R15: 0000000000000286 [ 6.114027] FS: 0000000000000000(0000) GS:ffff88842fd80000(0000) knlGS:0000000000000000 [ 6.114665] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 6.115128] CR2: 00007f10f1e03030 CR3: 0000000108272004 CR4: 0000000000770ee0 [ 6.115701] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 6.116272] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 6.116842] PKRU: 55555554 [ 6.117069] Call Trace: [ 6.117275] [ 6.117452] ? __warn+0x84/0x140 [ 6.117727] ? check_sync+0x53e/0x6c0 [ 6.118034] ? __report_bug+0xea/0x100 [ 6.118353] ? check_sync+0x53e/0x6c0 [ 6.118653] ? report_bug+0x41/0xc0 [ 6.118944] ? handle_bug+0x3c/0x70 [ 6.119237] ? exc_invalid_op+0x18/0x70 [ 6.119551] ? asm_exc_invalid_op+0x1a/0x20 [ 6.119900] ? check_sync+0x53e/0x6c0 [ 6.120199] ? check_sync+0x53e/0x6c0 [ 6.120499] debug_dma_sync_single_for_cpu+0x5c/0x70 [ 6.120906] ? dma_sync_single_for_cpu+0xb7/0x100 [ 6.121291] virtnet_rq_unmap+0x158/0x170 [virtio_net] [ 6.121716] virtnet_receive+0x196/0x220 [virtio_net] [ 6.122135] virtnet_poll+0x48/0x1b0 [virtio_net] [ 6.122524] __napi_poll+0x29/0x1b0 [ 6.123083] net_rx_action+0x282/0x360 [ 6.123612] __do_softirq+0xf3/0x2fb [ 6.124138] __irq_exit_rcu+0x8e/0xf0 [ 6.124663] common_interrupt+0xbc/0xe0 [ 6.125202] We need to enable CONFIG_DMA_API_DEBUG and work with need sync mode(such as swiotlb) to reproduce this warn. Fixes: 8bd2f71054bd ("virtio_ring: introduce dma sync api for virtqueue") Reported-by: "Ning, Hongyu" Closes: https://lore.kernel.org/all/f37cb55a-6fc8-4e21-8789-46d468325eea@linux.intel.com/ Suggested-by: Jason Wang Signed-off-by: Xuan Zhuo Message-Id: <20231201033303.25141-1-xuanzhuo@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Parav Pandit Acked-by: Jason Wang Tested-by: Hongyu Ning commit b17b7fe6dd5c6ff74b38b0758ca799cdbb79e26e Author: RD Babiera Date: Wed Nov 29 19:23:50 2023 +0000 usb: typec: class: fix typec_altmode_put_partner to put plugs When typec_altmode_put_partner is called by a plug altmode upon release, the port altmode the plug belongs to will not remove its reference to the plug. The check to see if the altmode being released evaluates against the released altmode's partner instead of the calling altmode itself, so change adev in typec_altmode_put_partner to properly refer to the altmode being released. typec_altmode_set_partner is not run for port altmodes, so also add a check in typec_altmode_release to prevent typec_altmode_put_partner() calls on port altmode release. Fixes: 8a37d87d72f0 ("usb: typec: Bus type for alternate modes") Cc: stable@vger.kernel.org Signed-off-by: RD Babiera Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231129192349.1773623-2-rdbabiera@google.com Signed-off-by: Greg Kroah-Hartman commit 73ea73affe8622bdf292de898da869d441da6a9d Author: Roy Luo Date: Tue Nov 28 22:17:56 2023 +0000 USB: gadget: core: adjust uevent timing on gadget unbind The KOBJ_CHANGE uevent is sent before gadget unbind is actually executed, resulting in inaccurate uevent emitted at incorrect timing (the uevent would have USB_UDC_DRIVER variable set while it would soon be removed). Move the KOBJ_CHANGE uevent to the end of the unbind function so that uevent is sent only after the change has been made. Fixes: 2ccea03a8f7e ("usb: gadget: introduce UDC Class") Cc: stable@vger.kernel.org Signed-off-by: Roy Luo Link: https://lore.kernel.org/r/20231128221756.2591158-1-royluo@google.com Signed-off-by: Greg Kroah-Hartman commit 3494a594315b56516988afb6854d75dee5b501db Author: Kunwu Chan Date: Fri Dec 1 13:54:47 2023 +0800 platform/mellanox: Check devm_hwmon_device_register_with_groups() return value devm_hwmon_device_register_with_groups() returns an error pointer upon failure. Check its return value for errors. Compile-tested only. Fixes: 1a218d312e65 ("platform/mellanox: mlxbf-pmc: Add Mellanox BlueField PMC driver") Suggested-by: Ilpo Järvinen Suggested-by: Vadim Pasternak Signed-off-by: Kunwu Chan Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20231201055447.2356001-1-chentao@kylinos.cn [ij: split the change into two] Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 2c7c857f5fed997be93047d2de853d7f10c8defe Author: Kunwu Chan Date: Fri Dec 1 13:54:47 2023 +0800 platform/mellanox: Add null pointer checks for devm_kasprintf() devm_kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Compile-tested only. Fixes: 1a218d312e65 ("platform/mellanox: mlxbf-pmc: Add Mellanox BlueField PMC driver") Suggested-by: Ilpo Järvinen Suggested-by: Vadim Pasternak Signed-off-by: Kunwu Chan Reviewed-by: Vadim Pasternak Link: https://lore.kernel.org/r/20231201055447.2356001-1-chentao@kylinos.cn [ij: split the change into two] Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 29046a78a3c0a1f8fa0427f164caa222f003cf5b Author: Dinghao Liu Date: Mon Dec 4 15:41:56 2023 +0800 ASoC: wm_adsp: fix memleak in wm_adsp_buffer_populate When wm_adsp_buffer_read() fails, we should free buf->regions. Otherwise, the callers of wm_adsp_buffer_populate() will directly free buf on failure, which makes buf->regions a leaked memory. Fixes: a792af69b08f ("ASoC: wm_adsp: Refactor compress stream initialisation") Signed-off-by: Dinghao Liu Reviewed-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20231204074158.12026-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown commit 5f44de697383fcc9a9a1a78f99e09d1838704b90 Author: David Rau Date: Fri Dec 1 12:29:33 2023 +0800 ASoC: da7219: Support low DC impedance headset Change the default MIC detection impedance threshold to 200ohm to support low mic DC impedance headset. Signed-off-by: David Rau Link: https://lore.kernel.org/r/20231201042933.26392-1-David.Rau.opensource@dm.renesas.com Signed-off-by: Mark Brown commit b5338b1b901e41bd7cead66a0b3a796e9fa95684 Author: Marian Postevca Date: Sun Dec 3 00:29:51 2023 +0200 ASoC: amd: acp: Add support for a new Huawei Matebook laptop This commit adds support for Huawei MateBook D16 2021 with Ryzen 4600H in driver acp3x-es83xx. Signed-off-by: Marian Postevca Link: https://lore.kernel.org/r/20231202223001.8025-1-posteuca@mutex.one Signed-off-by: Mark Brown commit d4eef75279f5e9d594f5785502038c763ce42268 Author: David Thompson Date: Thu Nov 30 13:35:15 2023 -0500 mlxbf-bootctl: correctly identify secure boot with development keys The secure boot state of the BlueField SoC is represented by two bits: 0 = production state 1 = secure boot enabled 2 = non-secure (secure boot disabled) 3 = RMA state There is also a single bit to indicate whether production keys or development keys are being used when secure boot is enabled. This single bit (specified by MLXBF_BOOTCTL_SB_DEV_MASK) only has meaning if secure boot state equals 1 (secure boot enabled). The secure boot states are as follows: - “GA secured” is when secure boot is enabled with official production keys. - “Secured (development)” is when secure boot is enabled with development keys. Without this fix “GA Secured” is displayed on development cards which is misleading. This patch updates the logic in "lifecycle_state_show()" to handle the case where the SoC is configured for secure boot and is using development keys. Fixes: 79e29cb8fbc5c ("platform/mellanox: Add bootctl driver for Mellanox BlueField Soc") Reviewed-by: Khalil Blaiech Signed-off-by: David Thompson Link: https://lore.kernel.org/r/20231130183515.17214-1-davthompson@nvidia.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit fea88064445a59584460f7f67d102b6e5fc1ca1d Author: Matthias Reichl Date: Sun Dec 3 23:22:16 2023 +0100 regmap: fix bogus error on regcache_sync success Since commit 0ec7731655de ("regmap: Ensure range selector registers are updated after cache sync") opening pcm512x based soundcards fail with EINVAL and dmesg shows sync cache and pm_runtime_get errors: [ 228.794676] pcm512x 1-004c: Failed to sync cache: -22 [ 228.794740] pcm512x 1-004c: ASoC: error at snd_soc_pcm_component_pm_runtime_get on pcm512x.1-004c: -22 This is caused by the cache check result leaking out into the regcache_sync return value. Fix this by making the check local-only, as the comment above the regcache_read call states a non-zero return value means there's nothing to do so the return value should not be altered. Fixes: 0ec7731655de ("regmap: Ensure range selector registers are updated after cache sync") Cc: stable@vger.kernel.org Signed-off-by: Matthias Reichl Link: https://lore.kernel.org/r/20231203222216.96547-1-hias@horus.com Signed-off-by: Mark Brown commit 77f5032e94f244ba08db51e17ca8f37bd7ff9acb Author: Sudeep Holla Date: Thu Nov 30 20:43:43 2023 +0000 firmware: arm_scmi: Fix possible frequency truncation when using level indexing mode The multiplier is already promoted to unsigned long, however the frequency calculations done when using level indexing mode doesn't use the multiplier computed. It instead hardcodes the multiplier value of 1000 at all the usage sites. Clean that up by assigning the multiplier value of 1000 when using the perf level indexing mode and update the frequency calculations to use the multiplier instead. It should fix the possible frequency truncation for all the values greater than or equal to 4GHz on 64-bit machines. Fixes: 31c7c1397a33 ("firmware: arm_scmi: Add v3.2 perf level indexing mode support") Reported-by: Sibi Sankar Closes: https://lore.kernel.org/all/20231129065748.19871-3-quic_sibis@quicinc.com/ Cc: Cristian Marussi Link: https://lore.kernel.org/r/20231130204343.503076-2-sudeep.holla@arm.com Reviewed-by: Cristian Marussi Signed-off-by: Sudeep Holla commit 8e3c98d9187e09274fc000a7d1a77b070a42d259 Author: Sudeep Holla Date: Thu Nov 30 20:43:42 2023 +0000 firmware: arm_scmi: Fix frequency truncation by promoting multiplier type Fix the possible frequency truncation for all values equal to or greater 4GHz on 64bit machines by updating the multiplier 'mult_factor' to 'unsigned long' type. It is also possible that the multiplier itself can be greater than or equal to 2^32. So we need to also fix the equation computing the value of the multiplier. Fixes: a9e3fbfaa0ff ("firmware: arm_scmi: add initial support for performance protocol") Reported-by: Sibi Sankar Closes: https://lore.kernel.org/all/20231129065748.19871-3-quic_sibis@quicinc.com/ Cc: Cristian Marussi Link: https://lore.kernel.org/r/20231130204343.503076-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit 79321a793945fdbff2f405f84712d0ab81bed287 Author: Douglas Anderson Date: Wed Nov 29 13:25:24 2023 -0800 r8152: Add RTL8152_INACCESSIBLE to r8153_aldps_en() Delay loops in r8152 should break out if RTL8152_INACCESSIBLE is set so that they don't delay too long if the device becomes inaccessible. Add the break to the loop in r8153_aldps_en(). Fixes: 4214cc550bf9 ("r8152: check if disabling ALDPS is finished") Reviewed-by: Grant Grundler Signed-off-by: Douglas Anderson Acked-by: Hayes Wang Signed-off-by: David S. Miller commit 8c53a7bd706535a9cf4e2ec3a4e8d61d46353ca0 Author: Douglas Anderson Date: Wed Nov 29 13:25:23 2023 -0800 r8152: Add RTL8152_INACCESSIBLE to r8153_pre_firmware_1() Delay loops in r8152 should break out if RTL8152_INACCESSIBLE is set so that they don't delay too long if the device becomes inaccessible. Add the break to the loop in r8153_pre_firmware_1(). Fixes: 9370f2d05a2a ("r8152: support request_firmware for RTL8153") Reviewed-by: Grant Grundler Signed-off-by: Douglas Anderson Acked-by: Hayes Wang Signed-off-by: David S. Miller commit 8a67b47fced9f6a84101eb9ec5ce4c7d64204bc7 Author: Douglas Anderson Date: Wed Nov 29 13:25:22 2023 -0800 r8152: Add RTL8152_INACCESSIBLE to r8156b_wait_loading_flash() Delay loops in r8152 should break out if RTL8152_INACCESSIBLE is set so that they don't delay too long if the device becomes inaccessible. Add the break to the loop in r8156b_wait_loading_flash(). Fixes: 195aae321c82 ("r8152: support new chips") Reviewed-by: Grant Grundler Signed-off-by: Douglas Anderson Acked-by: Hayes Wang Signed-off-by: David S. Miller commit 32a574c7e2685aa8138754d4d755f9246cc6bd48 Author: Douglas Anderson Date: Wed Nov 29 13:25:21 2023 -0800 r8152: Add RTL8152_INACCESSIBLE checks to more loops Previous commits added checks for RTL8152_INACCESSIBLE in the loops in the driver. There are still a few more that keep tripping the driver up in error cases and make things take longer than they should. Add those in. All the loops that are part of this commit existed in some form or another since the r8152 driver was first introduced, though RTL8152_INACCESSIBLE was known as RTL8152_UNPLUG before commit 715f67f33af4 ("r8152: Rename RTL8152_UNPLUG to RTL8152_INACCESSIBLE") Fixes: ac718b69301c ("net/usb: new driver for RTL8152") Reviewed-by: Grant Grundler Signed-off-by: Douglas Anderson Acked-by: Hayes Wang Signed-off-by: David S. Miller commit e62adaeecdc6a1e8ae86e7f3f9f8223a3ede94f5 Author: Douglas Anderson Date: Wed Nov 29 13:25:20 2023 -0800 r8152: Hold the rtnl_lock for all of reset As of commit d9962b0d4202 ("r8152: Block future register access if register access fails") there is a race condition that can happen between the USB device reset thread and napi_enable() (not) getting called during rtl8152_open(). Specifically: * While rtl8152_open() is running we get a register access error that's _not_ -ENODEV and queue up a USB reset. * rtl8152_open() exits before calling napi_enable() due to any reason (including usb_submit_urb() returning an error). In that case: * Since the USB reset is perform in a separate thread asynchronously, it can run at anytime USB device lock is not held - even before rtl8152_open() has exited with an error and caused __dev_open() to clear the __LINK_STATE_START bit. * The rtl8152_pre_reset() will notice that the netif_running() returns true (since __LINK_STATE_START wasn't cleared) so it won't exit early. * rtl8152_pre_reset() will then hang in napi_disable() because napi_enable() was never called. We can fix the race by making sure that the r8152 reset routines don't run at the same time as we're opening the device. Specifically we need the reset routines in their entirety rely on the return value of netif_running(). The only way to reliably depend on that is for them to hold the rntl_lock() mutex for the duration of reset. Grabbing the rntl_lock() mutex for the duration of reset seems like a long time, but reset is not expected to be common and the rtnl_lock() mutex is already held for long durations since the core grabs it around the open/close calls. Fixes: d9962b0d4202 ("r8152: Block future register access if register access fails") Reviewed-by: Grant Grundler Signed-off-by: Douglas Anderson Signed-off-by: David S. Miller commit 59b75dcb0953813676b5030877f3f37cedaed87d Author: George Stark Date: Tue Nov 28 02:55:58 2023 +0300 iio: adc: meson: add separate config for axg SoC family According to Amlogic custom kernels ADC of axg SoC family has vref_select and requires this setting to work nominally and thus needs a separate config. Fixes: 90c6241860bf ("iio: adc: meson: init voltage control bits") Signed-off-by: George Stark Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20231127235558.71995-1-gnstark@salutedevices.com Signed-off-by: Jonathan Cameron commit 5c584f175d32f9cc66c909f851cd905da58b39ea Author: Nam Cao Date: Fri Dec 1 10:23:29 2023 +0100 pinctrl: starfive: jh7100: ignore disabled device tree nodes The driver always registers pin configurations in device tree. This can cause some inconvenience to users, as pin configurations in the base device tree cannot be disabled in the device tree overlay, even when the relevant devices are not used. Ignore disabled pin configuration nodes in device tree. Fixes: ec648f6b7686 ("pinctrl: starfive: Add pinctrl driver for StarFive SoCs") Cc: Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/fe4c15dcc3074412326b8dc296b0cbccf79c49bf.1701422582.git.namcao@linutronix.de Signed-off-by: Linus Walleij commit f6e3b40a2c89c1d832ed9cb031dc9825bbf43b7c Author: Nam Cao Date: Fri Dec 1 10:23:28 2023 +0100 pinctrl: starfive: jh7110: ignore disabled device tree nodes The driver always registers pin configurations in device tree. This can cause some inconvenience to users, as pin configurations in the base device tree cannot be disabled in the device tree overlay, even when the relevant devices are not used. Ignore disabled pin configuration nodes in device tree. Fixes: 447976ab62c5 ("pinctrl: starfive: Add StarFive JH7110 sys controller driver") Cc: Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/fd8bf044799ae50a6291ae150ef87b4f1923cacb.1701422582.git.namcao@linutronix.de Signed-off-by: Linus Walleij commit 2475ecdb9b6e177b133cf26e64e8d441d37bebde Author: Haibo Chen Date: Thu Nov 16 15:10:26 2023 +0800 iio: adc: imx93: add four channels for imx93 adc According to the spec, this ADC totally support 8 channels. i.MX93 contain this ADC with 4 channels connected to pins in the package. i.MX95 contain this ADC with 8 channels connected to pins in the package. Signed-off-by: Haibo Chen Fixes: 7d02296ac8b8 ("iio: adc: add imx93 adc support") Link: https://lore.kernel.org/r/20231116071026.611269-1-haibo.chen@nxp.com Cc: Signed-off-by: Jonathan Cameron commit 2d880bfa4a97002962d5be148725197be98b191a Author: Jiri Kosina Date: Mon Dec 4 10:37:15 2023 +0100 mailmap: add address mapping for Jiri Kosina Since I switched the MAINTAINERS entry to @kernel.org some time ago, let's canonicalize my addressess to it. Signed-off-by: Jiri Kosina Signed-off-by: Jiri Kosina commit 60576e84c187043cef11f11d015249e71151d35a Author: Wadim Egorov Date: Mon Sep 25 15:44:27 2023 +0200 iio: adc: ti_am335x_adc: Fix return value check of tiadc_request_dma() Fix wrong handling of a DMA request where the probing only failed if -EPROPE_DEFER was returned. Instead, let us fail if a non -ENODEV value is returned. This makes DMAs explicitly optional. Even if the DMA request is unsuccessfully, the ADC can still work properly. We do also handle the defer probe case by making use of dev_err_probe(). Fixes: f438b9da75eb ("drivers: iio: ti_am335x_adc: add dma support") Signed-off-by: Wadim Egorov Reviewed-by: Bhavya Kapoor Link: https://lore.kernel.org/r/20230925134427.214556-1-w.egorov@phytec.de Cc: Signed-off-by: Jonathan Cameron commit 3f29f1c336c0e8a4bec52f1e5217f88835553e5b Author: Amir Goldstein Date: Sun Dec 3 09:42:33 2023 +0200 fuse: disable FOPEN_PARALLEL_DIRECT_WRITES with FUSE_DIRECT_IO_ALLOW_MMAP The new fuse init flag FUSE_DIRECT_IO_ALLOW_MMAP breaks assumptions made by FOPEN_PARALLEL_DIRECT_WRITES and causes test generic/095 to hit BUG_ON(fi->writectr < 0) assertions in fuse_set_nowrite(): generic/095 5s ... kernel BUG at fs/fuse/dir.c:1756! ... ? fuse_set_nowrite+0x3d/0xdd ? do_raw_spin_unlock+0x88/0x8f ? _raw_spin_unlock+0x2d/0x43 ? fuse_range_is_writeback+0x71/0x84 fuse_sync_writes+0xf/0x19 fuse_direct_io+0x167/0x5bd fuse_direct_write_iter+0xf0/0x146 Auto disable FOPEN_PARALLEL_DIRECT_WRITES when server negotiated FUSE_DIRECT_IO_ALLOW_MMAP. Fixes: e78662e818f9 ("fuse: add a new fuse init flag to relax restrictions in no cache mode") Cc: # v6.6 Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi commit 7f8ed28d1401320bcb02dda81b3c23ab2dc5a6d8 Author: Hangyu Hua Date: Thu Nov 16 15:57:26 2023 +0800 fuse: dax: set fc->dax to NULL in fuse_dax_conn_free() fuse_dax_conn_free() will be called when fuse_fill_super_common() fails after fuse_dax_conn_alloc(). Then deactivate_locked_super() in virtio_fs_get_tree() will call virtio_kill_sb() to release the discarded superblock. This will call fuse_dax_conn_free() again in fuse_conn_put(), resulting in a possible double free. Fixes: 1dd539577c42 ("virtiofs: add a mount option to enable dax") Signed-off-by: Hangyu Hua Acked-by: Vivek Goyal Reviewed-by: Jingbo Xu Cc: # v5.10 Signed-off-by: Miklos Szeredi commit c4d361f66ac91db8fc65061a9671682f61f4ca9d Author: Krister Johansen Date: Fri Nov 3 10:39:47 2023 -0700 fuse: share lookup state between submount and its parent Fuse submounts do not perform a lookup for the nodeid that they inherit from their parent. Instead, the code decrements the nlookup on the submount's fuse_inode when it is instantiated, and no forget is performed when a submount root is evicted. Trouble arises when the submount's parent is evicted despite the submount itself being in use. In this author's case, the submount was in a container and deatched from the initial mount namespace via a MNT_DEATCH operation. When memory pressure triggered the shrinker, the inode from the parent was evicted, which triggered enough forgets to render the submount's nodeid invalid. Since submounts should still function, even if their parent goes away, solve this problem by sharing refcounted state between the parent and its submount. When all of the references on this shared state reach zero, it's safe to forget the final lookup of the fuse nodeid. Signed-off-by: Krister Johansen Cc: stable@vger.kernel.org Fixes: 1866d779d5d2 ("fuse: Allow fuse_fill_super_common() for submounts") Signed-off-by: Miklos Szeredi commit 11ca77cdcca17cec909d2b97404ddacfec0acafd Author: Tyler Fanelli Date: Tue Sep 19 22:40:01 2023 -0400 docs/fuse-io: Document the usage of DIRECT_IO_ALLOW_MMAP By default, shared mmap is disabled in FUSE DIRECT_IO mode. However, when the DIRECT_IO_ALLOW_MMAP flag is enabled in the FUSE_INIT reply, shared mmap is allowed. Signed-off-by: Tyler Fanelli Signed-off-by: Miklos Szeredi commit c55e0a55b165202f18cbc4a20650d2e1becd5507 Author: Tyler Fanelli Date: Tue Sep 19 22:40:00 2023 -0400 fuse: Rename DIRECT_IO_RELAX to DIRECT_IO_ALLOW_MMAP Although DIRECT_IO_RELAX's initial usage is to allow shared mmap, its description indicates a purpose of reducing memory footprint. This may imply that it could be further used to relax other DIRECT_IO operations in the future. Replace it with a flag DIRECT_IO_ALLOW_MMAP which does only one thing, allow shared mmap of DIRECT_IO files while still bypassing the cache on regular reads and writes. [Miklos] Also Keep DIRECT_IO_RELAX definition for backward compatibility. Signed-off-by: Tyler Fanelli Fixes: e78662e818f9 ("fuse: add a new fuse init flag to relax restrictions in no cache mode") Cc: # v6.6 Signed-off-by: Miklos Szeredi commit 52eb67861ebeb2110318bd9fe33d85ddcf92aac7 Author: Ayush Singh Date: Sun Dec 3 13:23:10 2023 +0530 greybus: gb-beagleplay: Ensure le for values in transport Ensure that the following values are little-endian: - header->pad (which is used for cport_id) - header->size Fixes: ec558bbfea67 ("greybus: Add BeaglePlay Linux Driver") Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202311072329.Xogj7hGW-lkp@intel.com/ Signed-off-by: Ayush Singh Link: https://lore.kernel.org/r/20231203075312.255233-1-ayushdevel1325@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4181ef7dbb63e638739e929bca5b7bca3a37a311 Author: Randy Dunlap Date: Mon Oct 30 21:09:09 2023 -0700 greybus: BeaglePlay driver needs CRC_CCITT The gb-beagleplay driver uses crc_ccitt(), so it should select CRC_CCITT to make sure that the function is available. Fixes these build errors: s390-linux-ld: drivers/greybus/gb-beagleplay.o: in function `hdlc_append_tx_u8': gb-beagleplay.c:(.text+0x2c0): undefined reference to `crc_ccitt' s390-linux-ld: drivers/greybus/gb-beagleplay.o: in function `hdlc_rx_frame': gb-beagleplay.c:(.text+0x6a0): undefined reference to `crc_ccitt' Fixes: ec558bbfea67 ("greybus: Add BeaglePlay Linux Driver") Signed-off-by: Randy Dunlap Cc: Ayush Singh Cc: Johan Hovold Cc: Alex Elder Cc: greybus-dev@lists.linaro.org Link: https://lore.kernel.org/r/20231031040909.21201-1-rdunlap@infradead.org Reviewed-by: Ayush Singh Signed-off-by: Greg Kroah-Hartman commit 88ac06a9f938c158bbeafec16adb483b0c66142f Author: Johannes Berg Date: Sat Dec 2 11:49:37 2023 +0100 Revert "debugfs: annotate debugfs handlers vs. removal with lockdep" This reverts commit f4acfcd4deb1 ("debugfs: annotate debugfs handlers vs. removal with lockdep"), it appears to have false positives and really shouldn't have been in the -rc series with the fixes anyway. Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20231202114936.fd55431ab160.I911aa53abeeca138126f690d383a89b13eb05667@changeid Signed-off-by: Greg Kroah-Hartman commit 4906f39a1343713a4fb3fe78aecd12eba5257dc0 Merge: af54d778a0385 33cc938e65a98 Author: Greg Kroah-Hartman Date: Mon Dec 4 07:42:16 2023 +0100 Merge 6.7-rc4 into char-misc-linus We need 6.7-rc4 in here as we need to revert one of the debugfs changes that came in that release through the wireless tree. Signed-off-by: Greg Kroah-Hartman commit f7b32e785042d2357c5abc23ca6db1b92c91a070 Author: Pavel Begunkov Date: Sun Dec 3 15:37:53 2023 +0000 io_uring: fix mutex_unlock with unreferenced ctx Callers of mutex_unlock() have to make sure that the mutex stays alive for the whole duration of the function call. For io_uring that means that the following pattern is not valid unless we ensure that the context outlives the mutex_unlock() call. mutex_lock(&ctx->uring_lock); req_put(req); // typically via io_req_task_submit() mutex_unlock(&ctx->uring_lock); Most contexts are fine: io-wq pins requests, syscalls hold the file, task works are taking ctx references and so on. However, the task work fallback path doesn't follow the rule. Cc: Fixes: 04fc6c802d ("io_uring: save ctx put/get for task_work submit") Reported-by: Jann Horn Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/io-uring/CAG48ez3xSoYb+45f1RLtktROJrpiDQ1otNvdR+YLQf7m+Krj5Q@mail.gmail.com/ Signed-off-by: Jens Axboe commit 59b6a747e2d39227ac2325c5e29d6ab3bb070c2a Author: Haoran Liu Date: Sun Dec 3 19:00:23 2023 +0000 Input: ipaq-micro-keys - add error handling for devm_kmemdup Check the return value of i2c_add_adapter. Static analysis revealed that the function did not properly handle potential failures of i2c_add_adapter, which could lead to partial initialization of the I2C adapter and unstable operation. Signed-off-by: Haoran Liu Link: https://lore.kernel.org/r/20231203164653.38983-1-liuhaoran14@163.com Fixes: d7535ffa427b ("Input: driver for microcontroller keys on the iPaq h3xxx") Signed-off-by: Dmitry Torokhov commit 0117591e69d1edff46bc87061e533a1e25a8c500 Author: Kent Overstreet Date: Thu Nov 30 23:32:20 2023 -0500 bcachefs: Don't drop journal pins in exit path There's no need to drop journal pins in our exit paths - the code was trying to have everything cleaned up on any shutdown, but better to just tweak the assertions a bit. This fixes a bug where calling into journal reclaim in the exit path would cass a null ptr deref. Signed-off-by: Kent Overstreet commit 35fe2ad259a3bfca15ab78c8ffb5278cb6149c89 Author: Christophe JAILLET Date: Sun Dec 3 16:24:05 2023 +0100 hwmon: (nzxt-kraken2) Fix error handling path in kraken2_probe() There is no point in calling hid_hw_stop() if hid_hw_start() has failed. There is no point in calling hid_hw_close() if hid_hw_open() has failed. Update the error handling path accordingly. Fixes: 82e3430dfa8c ("hwmon: add driver for NZXT Kraken X42/X52/X62/X72") Reported-by: Aleksa Savic Closes: https://lore.kernel.org/all/121470f0-6c1f-418a-844c-7ec2e8a54b8e@gmail.com/ Signed-off-by: Christophe JAILLET Reviewed-by: Jonas Malaco Link: https://lore.kernel.org/r/a768e69851a07a1f4e29f270f4e2559063f07343.1701617030.git.christophe.jaillet@wanadoo.fr Signed-off-by: Guenter Roeck commit 33cc938e65a98f1d29d0a18403dbbee050dcad9a Author: Linus Torvalds Date: Sun Dec 3 18:52:56 2023 +0900 Linux 6.7-rc4 commit c5c325bb5849868d76969d3fe014515f5e99eabc Author: Pascal Noël Date: Fri Dec 1 17:37:44 2023 -0800 ALSA: hda/realtek: Apply quirk for ASUS UM3504DA The ASUS UM3504DA uses a Realtek HDA codec and two CS35L41 amplifiers via I2C. Apply existing quirk to model. Signed-off-by: Pascal Noël Cc: Link: https://lore.kernel.org/r/20231202013744.12369-1-pascal@pascalcompiles.com Signed-off-by: Takashi Iwai commit 968f35f4ab1c0966ceb39af3c89f2e24afedf878 Merge: 55abae438c3cf 0015eb6e12384 Author: Linus Torvalds Date: Sun Dec 3 09:08:26 2023 +0900 Merge tag 'v6.7-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fixes from Steve French: - Two fallocate fixes - Fix warnings from new gcc - Two symlink fixes * tag 'v6.7-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb: client, common: fix fortify warnings cifs: Fix FALLOC_FL_INSERT_RANGE by setting i_size after EOF moved cifs: Fix FALLOC_FL_ZERO_RANGE by setting i_size if EOF moved smb: client: report correct st_size for SMB and NFS symlinks smb: client: fix missing mode bits for SMB symlinks commit 55abae438c3cf39f66c3e0cb922c3d915363afb5 Merge: 1b8af6552cb7c 891e0eab32a57 Author: Linus Torvalds Date: Sun Dec 3 09:03:07 2023 +0900 Merge tag 'firewire-fixes-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394 Pull firewire fix from Takashi Sakamoto: "A single patch to fix long-standing issue of memory leak at failure of device registration for fw_unit. We rarely encounter the issue, but it should be applied to stable releases, since it fixes inappropriate API usage" * tag 'firewire-fixes-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: firewire: core: fix possible memory leak in create_units() commit 1b8af6552cb7c9bf1194e871f8d733a19b113230 Merge: 17b17be28d42f dc158d23b33df Author: Linus Torvalds Date: Sun Dec 3 08:43:35 2023 +0900 Merge tag 'powerpc-6.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix corruption of f0/vs0 during FP/Vector save, seen as userspace crashes when using io-uring workers (in particular with MariaDB) - Fix KVM_RUN potentially clobbering all host userspace FP/Vector registers Thanks to Timothy Pearson, Jens Axboe, and Nicholas Piggin. * tag 'powerpc-6.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: KVM: PPC: Book3S HV: Fix KVM_RUN clobbering FP/VEC user registers powerpc: Don't clobber f0/vs0 during fp|altivec register save commit 17b17be28d42f59f579ef9da2557b92a97291777 Merge: deb4b9dd3b539 4ea95c04fa6b9 Author: Linus Torvalds Date: Sun Dec 3 08:37:39 2023 +0900 Merge tag 'vfio-v6.7-rc4' of https://github.com/awilliam/linux-vfio Pull vfio fixes from Alex Williamson: - Fix the lifecycle of a mutex in the pds variant driver such that a reset prior to opening the device won't find it uninitialized. Implement the release path to symmetrically destroy the mutex. Also switch a different lock from spinlock to mutex as the code path has the potential to sleep and doesn't need the spinlock context otherwise (Brett Creeley) - Fix an issue detected via randconfig where KVM tries to symbol_get an undeclared function. The symbol is temporarily declared unconditionally here, which resolves the problem and avoids churn relative to a series pending for the next merge window which resolves some of this symbol ugliness, but also fixes Kconfig dependencies (Sean Christopherson) * tag 'vfio-v6.7-rc4' of https://github.com/awilliam/linux-vfio: vfio: Drop vfio_file_iommu_group() stub to fudge around a KVM wart vfio/pds: Fix possible sleep while in atomic context vfio/pds: Fix mutex lock->magic != lock warning commit deb4b9dd3b539c8331bbc0d64dff3b4fb57296ef Merge: 669fc83452d44 7f3da4b698bcc Author: Linus Torvalds Date: Sun Dec 3 08:31:53 2023 +0900 Merge tag 'for-linus-6.7a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: - A fix for the Xen event driver setting the correct return value when experiencing an allocation failure - A fix for allocating space for a struct in the percpu area to not cross page boundaries (this one is for x86, a similar one for Arm was already in the pull request for rc3) * tag 'for-linus-6.7a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/events: fix error code in xen_bind_pirq_msi_to_irq() x86/xen: fix percpu vcpu_info allocation commit 669fc83452d443cb48f03ce0ebc496562e1c2205 Merge: 815fb87b75305 a1461f1fd6cfd Author: Linus Torvalds Date: Sun Dec 3 08:02:49 2023 +0900 Merge tag 'probes-fixes-v6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull probes fixes from Masami Hiramatsu: - objpool: Fix objpool overrun case on memory/cache access delay especially on the big.LITTLE SoC. The objpool uses a copy of object slot index internal loop, but the slot index can be changed on another processor in parallel. In that case, the difference of 'head' local copy and the 'slot->last' index will be bigger than local slot size. In that case, we need to re-read the slot::head to update it. - kretprobe: Fix to use appropriate rcu API for kretprobe holder. Since kretprobe_holder::rp is RCU managed, it should use rcu_assign_pointer() and rcu_dereference_check() correctly. Also adding __rcu tag for finding wrong usage by sparse. - rethook: Fix to use appropriate rcu API for rethook::handler. The same as kretprobe, rethook::handler is RCU managed and it should use rcu_assign_pointer() and rcu_dereference_check(). This also adds __rcu tag for finding wrong usage by sparse. * tag 'probes-fixes-v6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: rethook: Use __rcu pointer for rethook::handler kprobes: consistent rcu api usage for kretprobe holder lib: objpool: fix head overrun on RK3588 SBC commit 4b0768b6556af56ee9b7cf4e68452a2b6289ae45 Author: ChunHao Lin Date: Wed Nov 29 23:53:50 2023 +0800 r8169: fix rtl8125b PAUSE frames blasting when suspended When FIFO reaches near full state, device will issue pause frame. If pause slot is enabled(set to 1), in this time, device will issue pause frame only once. But if pause slot is disabled(set to 0), device will keep sending pause frames until FIFO reaches near empty state. When pause slot is disabled, if there is no one to handle receive packets, device FIFO will reach near full state and keep sending pause frames. That will impact entire local area network. This issue can be reproduced in Chromebox (not Chromebook) in developer mode running a test image (and v5.10 kernel): 1) ping -f $CHROMEBOX (from workstation on same local network) 2) run "powerd_dbus_suspend" from command line on the $CHROMEBOX 3) ping $ROUTER (wait until ping fails from workstation) Takes about ~20-30 seconds after step 2 for the local network to stop working. Fix this issue by enabling pause slot to only send pause frame once when FIFO reaches near full state. Fixes: f1bce4ad2f1c ("r8169: add support for RTL8125") Reported-by: Grant Grundler Tested-by: Grant Grundler Cc: stable@vger.kernel.org Signed-off-by: ChunHao Lin Reviewed-by: Jacob Keller Reviewed-by: Heiner Kallweit Link: https://lore.kernel.org/r/20231129155350.5843-1-hau@realtek.com Signed-off-by: Jakub Kicinski commit 9f6acd2b4dfef81dcc45486ac704cf602c88db02 Author: Sam Edwards Date: Fri Dec 1 23:12:12 2023 -0800 arm64: dts: rockchip: Fix Turing RK1 interrupt pinctrls The pinctrls for the hym8563 interrupt line and fan-tach input were both mistakenly defined as `pcfg_pull_none`. As these are active-low signals (level-triggered, in the hym8563 case) which may not be driven at times, these should really be pull-up. The lack of any bias results in spurious interrupts. Fix this by modifying the `rockchip,pins` properties as necessary to enable the pull-up resistors. Fixes: 2806a69f3fef6 ("arm64: dts: rockchip: Add Turing RK1 SoM support") Signed-off-by: Sam Edwards Link: https://lore.kernel.org/r/20231202071212.1606800-1-CFSworks@gmail.com Signed-off-by: Heiko Stuebner commit 9b8493dc43044376716d789d07699f17d538a7c4 Author: Borislav Petkov (AMD) Date: Fri Dec 1 19:37:27 2023 +0100 x86/CPU/AMD: Check vendor in the AMD microcode callback Commit in Fixes added an AMD-specific microcode callback. However, it didn't check the CPU vendor the kernel runs on explicitly. The only reason the Zenbleed check in it didn't run on other x86 vendors hardware was pure coincidental luck: if (!cpu_has_amd_erratum(c, amd_zenbleed)) return; gives true on other vendors because they don't have those families and models. However, with the removal of the cpu_has_amd_erratum() in 05f5f73936fa ("x86/CPU/AMD: Drop now unused CPU erratum checking function") that coincidental condition is gone, leading to the zenbleed check getting executed on other vendors too. Add the explicit vendor check for the whole callback as it should've been done in the first place. Fixes: 522b1d69219d ("x86/cpu/amd: Add a Zenbleed fix") Cc: Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231201184226.16749-1-bp@alien8.de commit 6c89f49964375c904cea33c0247467873f4daf2c Author: Randy Dunlap Date: Wed Nov 29 21:58:53 2023 -0800 hv_netvsc: rndis_filter needs to select NLS rndis_filter uses utf8s_to_utf16s() which is provided by setting NLS, so select NLS to fix the build error: ERROR: modpost: "utf8s_to_utf16s" [drivers/net/hyperv/hv_netvsc.ko] undefined! Fixes: 1ce09e899d28 ("hyperv: Add support for setting MAC from within guests") Signed-off-by: Randy Dunlap Cc: Haiyang Zhang Cc: K. Y. Srinivasan Cc: Wei Liu Cc: Dexuan Cui Reviewed-by: Simon Horman Tested-by: Simon Horman # build-tested Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20231130055853.19069-1-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit a134cd8dfb8cdfd8f019a7ec2ad5cb8e855f0245 Merge: 8ad3ac92f0760 c467e97f079f0 Author: Jens Axboe Date: Fri Dec 1 18:37:24 2023 -0700 Merge tag 'md-fixes-20231201-1' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-6.7 Pull MD fix from Song: "This change fixes issue with raid456 reshape." * tag 'md-fixes-20231201-1' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md/raid6: use valid sector values to determine if an I/O should wait on the reshape commit 16b55b1f2269962fb6b5154b8bf43f37c9a96637 Author: Thinh Tran Date: Thu Nov 30 18:19:11 2023 -0600 net/tg3: fix race condition in tg3_reset_task() When an EEH error is encountered by a PCI adapter, the EEH driver modifies the PCI channel's state as shown below: enum { /* I/O channel is in normal state */ pci_channel_io_normal = (__force pci_channel_state_t) 1, /* I/O to channel is blocked */ pci_channel_io_frozen = (__force pci_channel_state_t) 2, /* PCI card is dead */ pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, }; If the same EEH error then causes the tg3 driver's transmit timeout logic to execute, the tg3_tx_timeout() function schedules a reset task via tg3_reset_task_schedule(), which may cause a race condition between the tg3 and EEH driver as both attempt to recover the HW via a reset action. EEH driver gets error event --> eeh_set_channel_state() and set device to one of error state above scheduler: tg3_reset_task() get returned error from tg3_init_hw() --> dev_close() shuts down the interface tg3_io_slot_reset() and tg3_io_resume() fail to reset/resume the device To resolve this issue, we avoid the race condition by checking the PCI channel state in the tg3_reset_task() function and skip the tg3 driver initiated reset when the PCI channel is not in the normal state. (The driver has no access to tg3 device registers at this point and cannot even complete the reset task successfully without external assistance.) We'll leave the reset procedure to be managed by the EEH driver which calls the tg3_io_error_detected(), tg3_io_slot_reset() and tg3_io_resume() functions as appropriate. Adding the same checking in tg3_dump_state() to avoid dumping all device registers when the PCI channel is not in the normal state. Signed-off-by: Thinh Tran Tested-by: Venkata Sai Duggi Reviewed-by: David Christensen Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/20231201001911.656-1-thinhtr@linux.vnet.ibm.com Signed-off-by: Jakub Kicinski commit 815fb87b753055df2d9e50f6cd80eb10235fe3e9 Merge: ce474ae7d006e a6b31256928d7 Author: Linus Torvalds Date: Sat Dec 2 09:01:00 2023 +0900 Merge tag 'pm-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These fix issues in two cpufreq drivers, in the AMD P-state driver and in the power-capping DTPM framework. Specifics: - Fix the AMD P-state driver's EPP sysfs interface in the cases when the performance governor is in use (Ayush Jain) - Make the ->fast_switch() callback in the AMD P-state driver return the target frequency as expected (Gautham R. Shenoy) - Allow user space to control the range of frequencies to use via scaling_min_freq and scaling_max_freq when AMD P-state driver is in use (Wyes Karny) - Prevent power domains needed for wakeup signaling from being turned off during system suspend on Qualcomm systems and prevent performance states votes from runtime-suspended devices from being lost across a system suspend-resume cycle in qcom-cpufreq-nvmem (Stephan Gerhold) - Fix disabling the 792 Mhz OPP in the imx6q cpufreq driver for the i.MX6ULL types that can run at that frequency (Christoph Niedermaier) - Eliminate unnecessary and harmful conversions to uW from the DTPM (dynamic thermal and power management) framework (Lukasz Luba)" * tag 'pm-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq/amd-pstate: Only print supported EPP values for performance governor cpufreq/amd-pstate: Fix scaling_min_freq and scaling_max_freq update powercap: DTPM: Fix unneeded conversions to micro-Watts cpufreq/amd-pstate: Fix the return value of amd_pstate_fast_switch() pmdomain: qcom: rpmpd: Set GENPD_FLAG_ACTIVE_WAKEUP cpufreq: qcom-nvmem: Preserve PM domain votes in system suspend cpufreq: qcom-nvmem: Enable virtual power domain devices cpufreq: imx6q: Don't disable 792 Mhz OPP unnecessarily commit ce474ae7d006e4d451d8b9e23ee8110499edb62a Merge: 35f84584806e4 7d4c44a53dade Author: Linus Torvalds Date: Sat Dec 2 08:52:20 2023 +0900 Merge tag 'acpi-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "This fixes a recently introduced build issue on ARM32 and a NULL pointer dereference in the ACPI backlight driver due to a design issue exposed by a recent change in the ACPI bus type code. Specifics: - Fix a recently introduced build issue on ARM32 platforms caused by an inadvertent header file breakage (Dave Jiang) - Eliminate questionable usage of acpi_driver_data() in the ACPI backlight cooling device code that leads to NULL pointer dereferences after recent ACPI core changes (Hans de Goede)" * tag 'acpi-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: video: Use acpi_video_device for cooling-dev driver data ACPI: Fix ARM32 platforms compile issue introduced by fw_table changes commit 35f84584806e4e127a667221c592f8ae248132f6 Merge: 1a2b4185669b6 f5259997f3e8d Author: Linus Torvalds Date: Sat Dec 2 08:48:59 2023 +0900 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fix from Catalin Marinas: "Fix a regression where the arm64 KPTI ends up enabled even on systems that don't need it" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Avoid enabling KPTI unnecessarily commit 1a2b4185669b6318cf75ec18d13fa5f8779ac073 Merge: 06a3c59f9cf4f c2183b3dcc9dd Author: Linus Torvalds Date: Sat Dec 2 08:42:39 2023 +0900 Merge tag 'iommu-fixes-v6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: - Fix race conditions in device probe path - Handle ERR_PTR() returns in __iommu_domain_alloc() path - Update MAINTAINERS entry for Qualcom IOMMUs - Printk argument fix in device tree specific code - Several Intel VT-d fixes from Lu Baolu: - Do not support enforcing cache coherency for non-empty domains - Avoid devTLB invalidation if iommu is off - Disable PCI ATS in legacy passthrough mode - Support non-PCI devices when clearing context - Fix incorrect cache invalidation for mm notification - Add MTL to quirk list to skip TE disabling - Set variable intel_dirty_ops to static * tag 'iommu-fixes-v6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu: Fix printk arg in of_iommu_get_resv_regions() iommu/vt-d: Set variable intel_dirty_ops to static iommu/vt-d: Fix incorrect cache invalidation for mm notification iommu/vt-d: Add MTL to quirk list to skip TE disabling iommu/vt-d: Make context clearing consistent with context mapping iommu/vt-d: Disable PCI ATS in legacy passthrough mode iommu/vt-d: Omit devTLB invalidation requests when TES=0 iommu/vt-d: Support enforce_cache_coherency only for empty domains iommu: Avoid more races around device probe MAINTAINERS: list all Qualcomm IOMMU drivers in the QUALCOMM IOMMU entry iommu: Flow ERR_PTR out from __iommu_domain_alloc() commit dfce9cb3140592b886838e06f3e0c25fea2a9cae Author: Yonghong Song Date: Thu Nov 30 18:46:40 2023 -0800 bpf: Fix a verifier bug due to incorrect branch offset comparison with cpu=v4 Bpf cpu=v4 support is introduced in [1] and Commit 4cd58e9af8b9 ("bpf: Support new 32bit offset jmp instruction") added support for new 32bit offset jmp instruction. Unfortunately, in function bpf_adj_delta_to_off(), for new branch insn with 32bit offset, the offset (plus/minor a small delta) compares to 16-bit offset bound [S16_MIN, S16_MAX], which caused the following verification failure: $ ./test_progs-cpuv4 -t verif_scale_pyperf180 ... insn 10 cannot be patched due to 16-bit range ... libbpf: failed to load object 'pyperf180.bpf.o' scale_test:FAIL:expect_success unexpected error: -12 (errno 12) #405 verif_scale_pyperf180:FAIL Note that due to recent llvm18 development, the patch [2] (already applied in bpf-next) needs to be applied to bpf tree for testing purpose. The fix is rather simple. For 32bit offset branch insn, the adjusted offset compares to [S32_MIN, S32_MAX] and then verification succeeded. [1] https://lore.kernel.org/all/20230728011143.3710005-1-yonghong.song@linux.dev [2] https://lore.kernel.org/bpf/20231110193644.3130906-1-yonghong.song@linux.dev Fixes: 4cd58e9af8b9 ("bpf: Support new 32bit offset jmp instruction") Signed-off-by: Yonghong Song Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20231201024640.3417057-1-yonghong.song@linux.dev commit 42b8ff47720258d1f6a4412e780a480c139773a0 Author: Uwe Kleine-König Date: Fri Dec 1 14:37:48 2023 +0100 Input: amimouse - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231201133747.1099286-2-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 06a3c59f9cf4f550facf16a2f1e48ba364deb293 Merge: b1e51588aa502 a337c355719c4 Author: Linus Torvalds Date: Sat Dec 2 08:33:29 2023 +0900 Merge tag 'sound-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "No surprise here, including only a collection of HD-audio device-specific small fixes" * tag 'sound-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda: Disable power-save on KONTRON SinglePC ALSA: hda/realtek: Add supported ALC257 for ChromeOS ALSA: hda/realtek: Headset Mic VREF to 100% ALSA: hda: intel-nhlt: Ignore vbps when looking for DMIC 32 bps format ALSA: hda: cs35l56: Enable low-power hibernation mode on SPI ALSA: cs35l41: Fix for old systems which do not support command ALSA: hda: cs35l41: Remove unnecessary boolean state variable firmware_running ALSA: hda - Fix speaker and headset mic pin config for CHUWI CoreBook XPro commit b1e51588aa50287c3d33e14969d47ccdd403ad80 Merge: c9a925b7bcd95 908f60642441c Author: Linus Torvalds Date: Sat Dec 2 08:18:59 2023 +0900 Merge tag 'drm-fixes-2023-12-01' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Weekly fixes, mostly amdgpu fixes with a scattering of nouveau, i915, and a couple of reverts. Hopefully it will quieten down in coming weeks. drm: - Revert unexport of prime helpers for fd/handle conversion dma_resv: - Do not double add fences in dma_resv_add_fence. gpuvm: - Fix GPUVM license identifier. i915: - Mark internal GSC engine with reserved uabi class - Take VGA converters into account in eDP probe - Fix intel_pre_plane_updates() call to ensure workarounds get applied panel: - Revert panel fixes as they require exporting device_is_dependent. nouveau: - fix oversized allocations in new vm path - fix zero-length array - remove a stray lock nt36523: - Fix error check for nt36523. amdgpu: - DMUB fix - DCN 3.5 fixes - XGMI fix - DCN 3.2 fixes - Vangogh suspend fix - NBIO 7.9 fix - GFX11 golden register fix - Backlight fix - NBIO 7.11 fix - IB test overflow fix - DCN 3.1.4 fixes - fix a runtime pm ref count - Retimer fix - ABM fix - DCN 3.1.5 fix - Fix AGP addressing - Fix possible memory leak in SMU error path - Make sure PME is enabled in D3 - Fix possible NULL pointer dereference in debugfs - EEPROM fix - GC 9.4.3 fix amdkfd: - IP version check fix - Fix memory leak in pqm_uninit()" * tag 'drm-fixes-2023-12-01' of git://anongit.freedesktop.org/drm/drm: (53 commits) Revert "drm/prime: Unexport helpers for fd/handle conversion" drm/amdgpu: Use another offset for GC 9.4.3 remap drm/amd/display: Fix some HostVM parameters in DML drm/amdkfd: Free gang_ctx_bo and wptr_bo in pqm_uninit drm/amdgpu: Update EEPROM I2C address for smu v13_0_0 drm/amd/display: Allow DTBCLK disable for DCN35 drm/amdgpu: Fix cat debugfs amdgpu_regs_didt causes kernel null pointer drm/amd: Enable PCIe PME from D3 drm/amd/pm: fix a memleak in aldebaran_tables_init drm/amdgpu: fix AGP addressing when GART is not at 0 drm/amd/display: update dcn315 lpddr pstate latency drm/amd/display: fix ABM disablement drm/amd/display: Fix black screen on video playback with embedded panel drm/amd/display: Fix conversions between bytes and KB drm/amdkfd: Use common function for IP version check drm/amd/display: Remove config update drm/amd/display: Update DCN35 clock table policy drm/amd/display: force toggle rate wa for first link training for a retimer drm/amdgpu: correct the amdgpu runtime dereference usage count drm/amd/display: Update min Z8 residency time to 2100 for DCN314 ... commit c467e97f079f0019870c314996fae952cc768e82 Author: David Jeffery Date: Tue Nov 28 13:11:39 2023 -0500 md/raid6: use valid sector values to determine if an I/O should wait on the reshape During a reshape or a RAID6 array such as expanding by adding an additional disk, I/Os to the region of the array which have not yet been reshaped can stall indefinitely. This is from errors in the stripe_ahead_of_reshape function causing md to think the I/O is to a region in the actively undergoing the reshape. stripe_ahead_of_reshape fails to account for the q disk having a sector value of 0. By not excluding the q disk from the for loop, raid6 will always generate a min_sector value of 0, causing a return value which stalls. The function's max_sector calculation also uses min() when it should use max(), causing the max_sector value to always be 0. During a backwards rebuild this can cause the opposite problem where it allows I/O to advance when it should wait. Fixing these errors will allow safe I/O to advance in a timely manner and delay only I/O which is unsafe due to stripes in the middle of undergoing the reshape. Fixes: 486f60558607 ("md/raid5: Check all disks in a stripe_head for reshape progress") Cc: stable@vger.kernel.org # v6.0+ Signed-off-by: David Jeffery Tested-by: Laurence Oberman Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231128181233.6187-1-djeffery@redhat.com commit 49d8575ca6135a533218e40ddcb85462fd9ff1d2 Author: Miquel Raynal Date: Mon Nov 27 10:58:42 2023 +0100 spi: atmel: Drop unused defines These defines are leftovers from previous versions of the blamed commit, they are simply unused so drop them. Fixes: e0205d6203c2 ("spi: atmel: Prevent false timeouts on long transfers") Reported-by: Ronald Wahl Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20231127095842.389631-2-miquel.raynal@bootlin.com Signed-off-by: Mark Brown commit 1ca2761a7734928ffe0678f88789266cf3d05362 Author: Miquel Raynal Date: Mon Nov 27 10:58:41 2023 +0100 spi: atmel: Do not cancel a transfer upon any signal The intended move from wait_for_completion_*() to wait_for_completion_interruptible_*() was to allow (very) long spi memory transfers to be stopped upon user request instead of freezing the machine forever as the timeout value could now be significantly bigger. However, depending on the user logic, applications can receive many signals for their own "internal" purpose and have nothing to do with the requested kernel operations, hence interrupting spi transfers upon any signal is probably not a wise choice. Instead, let's switch to wait_for_completion_killable_*() to only catch the "important" signals. This was likely the intended behavior anyway. Fixes: e0205d6203c2 ("spi: atmel: Prevent false timeouts on long transfers") Cc: stable@vger.kernel.org Reported-by: Ronald Wahl Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20231127095842.389631-1-miquel.raynal@bootlin.com Signed-off-by: Mark Brown commit c9a925b7bcd9552f19ba50519c6a49ed7ca61691 Merge: ee0c8a9b349ec 73363c262d6a7 Author: Linus Torvalds Date: Sat Dec 2 06:47:32 2023 +0900 Merge tag 'io_uring-6.7-2023-11-30' of git://git.kernel.dk/linux Pull io_uring fixes from Jens Axboe: - Fix an issue with discontig page checking for IORING_SETUP_NO_MMAP - Fix an issue with not allowing IORING_SETUP_NO_MMAP also disallowing mmap'ed buffer rings - Fix an issue with deferred release of memory mapped pages - Fix a lockdep issue with IORING_SETUP_NO_MMAP - Use fget/fput consistently, even from our sync system calls. No real issue here, but if we were ever to allow closing io_uring descriptors it would be required. Let's play it safe and just use the full ref counted versions upfront. Most uses of io_uring are threaded anyway, and hence already doing the full version underneath. * tag 'io_uring-6.7-2023-11-30' of git://git.kernel.dk/linux: io_uring: use fget/fput consistently io_uring: free io_buffer_list entries via RCU io_uring/kbuf: prune deferred locked cache when tearing down io_uring/kbuf: recycle freed mapped buffer ring entries io_uring/kbuf: defer release of mapped buffer rings io_uring: enable io_mem_alloc/free to be used in other parts io_uring: don't guard IORING_OFF_PBUF_RING with SETUP_NO_MMAP io_uring: don't allow discontig pages for IORING_SETUP_NO_MMAP commit ee0c8a9b349ecdc97f81f0000a94ac9be8d8006c Merge: abd792f330fa3 8ad3ac92f0760 Author: Linus Torvalds Date: Sat Dec 2 06:39:30 2023 +0900 Merge tag 'block-6.7-2023-12-01' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: - NVMe pull request via Keith: - Invalid namespace identification error handling (Marizio Ewan, Keith) - Fabrics keep-alive tuning (Mark) - Fix for a bad error check regression in bcache (Markus) - Fix for a performance regression with O_DIRECT (Ming) - Fix for a flush related deadlock (Ming) - Make the read-only warn on per-partition (Yu) * tag 'block-6.7-2023-12-01' of git://git.kernel.dk/linux: nvme-core: check for too small lba shift blk-mq: don't count completed flush data request as inflight in case of quiesce block: Document the role of the two attribute groups block: warn once for each partition in bio_check_ro() block: move .bd_inode into 1st cacheline of block_device nvme: check for valid nvme_identify_ns() before using it nvme-core: fix a memory leak in nvme_ns_info_from_identify() nvme: fine-tune sending of first keep-alive bcache: revert replacing IS_ERR_OR_NULL with IS_ERR commit abd792f330fa328e8f8c30f3e32e609006c846fc Merge: ff4a9f49054a9 41e05548fa6b0 Author: Linus Torvalds Date: Sat Dec 2 06:32:29 2023 +0900 Merge tag 'dm-6.7/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: - Fix DM verity target's FEC support to always initialize IO before it frees it. Also fix alignment of struct dm_verity_fec_io within the per-bio-data - Fix DM verity target to not FEC failed readahead IO - Update DM flakey target to use MAX_ORDER rather than MAX_ORDER - 1 * tag 'dm-6.7/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm-flakey: start allocating with MAX_ORDER dm-verity: align struct dm_verity_fec_io properly dm verity: don't perform FEC for failed readahead IO dm verity: initialize fec io before freeing it commit ff4a9f49054a9cc5ae733155398d2aff2ef90836 Merge: c1c09da07c550 b09d7f8fd50f6 Author: Linus Torvalds Date: Sat Dec 2 06:27:20 2023 +0900 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Three small fixes, one in drivers. The core changes are to the internal representation of flags in scsi_devices which removes space wasting bools in favour of single bit flags and to add a flag to force a runtime resume which is used by ATA devices" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: sd: Fix system start for ATA devices scsi: Change SCSI device boolean fields to single bit flags scsi: ufs: core: Clear cmd if abort succeeds in MCQ mode commit c1c09da07c550971a1764a113963533dcc8e4d2a Merge: e6861be452a53 8abc712ea4867 Author: Linus Torvalds Date: Sat Dec 2 06:19:27 2023 +0900 Merge tag 'fs_for_v6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull ext2 fix from Jan Kara: "Fix an ext2 bug introduced by changes in ext2 & iomap stepping on each other toes (apparently ext2 driver does not get much testing in linux-next)" * tag 'fs_for_v6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: ext2: Fix ki_pos update for DIO buffered-io fallback case commit e6861be452a53a5de3e1a048eabd811a05a44915 Merge: 994d5c58e50e9 415e5107b0dce Author: Linus Torvalds Date: Sat Dec 2 06:02:16 2023 +0900 Merge tag 'bcachefs-2023-11-29' of https://evilpiepirate.org/git/bcachefs Pull more bcachefs bugfixes from Kent Overstreet: - bcache & bcachefs were broken with CFI enabled; patch for closures to fix type punning - mark erasure coding as extra-experimental; there are incompatible disk space accounting changes coming for erasure coding, and I'm still seeing checksum errors in some tests - several fixes for durability-related issues (durability is a device specific setting where we can tell bcachefs that data on a given device should be counted as replicated x times) - a fix for a rare livelock when a btree node merge then updates a parent node that is almost full - fix a race in the device removal path, where dropping a pointer in a btree node to a device would be clobbered by an in flight btree write updating the btree node key on completion - fix one SRCU lock hold time warning in the btree gc code - ther's still a bunch more of these to fix - fix a rare race where we'd start copygc before initializing the "are we rw" percpu refcount; copygc would think we were already ro and die immediately * tag 'bcachefs-2023-11-29' of https://evilpiepirate.org/git/bcachefs: (23 commits) bcachefs: Extra kthread_should_stop() calls for copygc bcachefs: Convert gc_alloc_start() to for_each_btree_key2() bcachefs: Fix race between btree writes and metadata drop bcachefs: move journal seq assertion bcachefs: -EROFS doesn't count as move_extent_start_fail bcachefs: trace_move_extent_start_fail() now includes errcode bcachefs: Fix split_race livelock bcachefs: Fix bucket data type for stripe buckets bcachefs: Add missing validation for jset_entry_data_usage bcachefs: Fix zstd compress workspace size bcachefs: bpos is misaligned on big endian bcachefs: Fix ec + durability calculation bcachefs: Data update path won't accidentaly grow replicas bcachefs: deallocate_extra_replicas() bcachefs: Proper refcounting for journal_keys bcachefs: preserve device path as device name bcachefs: Fix an endianness conversion bcachefs: Start gc, copygc, rebalance threads after initing writes ref bcachefs: Don't stop copygc thread on device resize bcachefs: Make sure bch2_move_ratelimit() also waits for move_ops ... commit 7d4c44a53dade7103c3a9a928705db2326efba6f Merge: 172c48caed91a 35732699f5d29 Author: Rafael J. Wysocki Date: Fri Dec 1 21:32:19 2023 +0100 Merge branch 'acpi-tables' Merge a fix for a recently introduced build issue on ARM32 platforms caused by an inadvertent header file breakage (Dave Jiang). * acpi-tables: ACPI: Fix ARM32 platforms compile issue introduced by fw_table changes commit a6b31256928d78204f8f282220d3b0d64387f79d Merge: 142c169b31beb b817f1488fca5 Author: Rafael J. Wysocki Date: Fri Dec 1 21:07:55 2023 +0100 Merge branch 'powercap' Merge a power capping fix for 6.7-rc4 which eliminates unnecessary and harmful conversions to uW from the DTPM (dynamic thermal and power management) framework (Lukasz Luba). * powercap: powercap: DTPM: Fix unneeded conversions to micro-Watts commit ef8d89033c3f1f6a64757f066b2c17e76d1189f8 Author: Like Xu Date: Sat Oct 7 14:40:19 2023 +0800 KVM: x86: Remove 'return void' expression for 'void function' The requested info will be stored in 'guest_xsave->region' referenced by the incoming pointer "struct kvm_xsave *guest_xsave", thus there is no need to explicitly use return void expression for a void function "static void kvm_vcpu_ioctl_x86_get_xsave(...)". The issue is caught with [-Wpedantic]. Fixes: 2d287ec65e79 ("x86/fpu: Allow caller to constrain xfeatures when copying to uabi buffer") Signed-off-by: Like Xu Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20231007064019.17472-1-likexu@tencent.com Signed-off-by: Sean Christopherson commit ea61294befd361ab8260c65d53987b400e5599a7 Author: Sean Christopherson Date: Wed Oct 18 13:46:24 2023 -0700 Revert "KVM: Prevent module exit until all VMs are freed" Revert KVM's misguided attempt to "fix" a use-after-module-unload bug that was actually due to failure to flush a workqueue, not a lack of module refcounting. Pinning the KVM module until kvm_vm_destroy() doesn't prevent use-after-free due to the module being unloaded, as userspace can invoke delete_module() the instant the last reference to KVM is put, i.e. can cause all KVM code to be unmapped while KVM is actively executing said code. Generally speaking, the many instances of module_put(THIS_MODULE) notwithstanding, outside of a few special paths, a module can never safely put the last reference to itself without creating deadlock, i.e. something external to the module *must* put the last reference. In other words, having VMs grab a reference to the KVM module is futile, pointless, and as evidenced by the now-reverted commit 70375c2d8fa3 ("Revert "KVM: set owner of cpu and vm file operations""), actively dangerous. This reverts commit 405294f29faee5de8c10cb9d4a90e229c2835279 and commit 5f6de5cbebee925a612856fce6f9182bb3eee0db. Fixes: 405294f29fae ("KVM: Unconditionally get a ref to /dev/kvm module when creating a VM") Fixes: 5f6de5cbebee ("KVM: Prevent module exit until all VMs are freed") Link: https://lore.kernel.org/r/20231018204624.1905300-4-seanjc@google.com Signed-off-by: Sean Christopherson commit 087e15206d6ac0d46734e2b0ab34370c0fdca481 Author: Sean Christopherson Date: Wed Oct 18 13:46:22 2023 -0700 KVM: Set file_operations.owner appropriately for all such structures Set .owner for all KVM-owned filed types so that the KVM module is pinned until any files with callbacks back into KVM are completely freed. Using "struct kvm" as a proxy for the module, i.e. keeping KVM-the-module alive while there are active VMs, doesn't provide full protection. Userspace can invoke delete_module() the instant the last reference to KVM is put. If KVM itself puts the last reference, e.g. via kvm_destroy_vm(), then it's possible for KVM to be preempted and deleted/unloaded before KVM fully exits, e.g. when the task running kvm_destroy_vm() is scheduled back in, it will jump to a code page that is no longer mapped. Note, file types that can call into sub-module code, e.g. kvm-intel.ko or kvm-amd.ko on x86, must use the module pointer passed to kvm_init(), not THIS_MODULE (which points at kvm.ko). KVM assumes that if /dev/kvm is reachable, e.g. VMs are active, then the vendor module is loaded. To reduce the probability of forgetting to set .owner entirely, use THIS_MODULE for stats files where KVM does not call back into vendor code. This reverts commit 70375c2d8fa3fb9b0b59207a9c5df1e2e1205c10, and fixes several other file types that have been buggy since their introduction. Fixes: 70375c2d8fa3 ("Revert "KVM: set owner of cpu and vm file operations"") Fixes: 3bcd0662d66f ("KVM: X86: Introduce mmu_rmaps_stat per-vm debugfs file") Reported-by: Al Viro Link: https://lore.kernel.org/all/20231010003746.GN800259@ZenIV Link: https://lore.kernel.org/r/20231018204624.1905300-2-seanjc@google.com Signed-off-by: Sean Christopherson commit 8ad3ac92f0760fdd8537857ee1adfde849ab0268 Merge: 0e4237ae8d159 74fbc88e16142 Author: Jens Axboe Date: Fri Dec 1 09:09:16 2023 -0700 Merge tag 'nvme-6.7-2023-12-01' of git://git.infradead.org/nvme into block-6.7 Pull NVMe fixes from Keith: "nvme fixes for Linux 6.7 - Invalid namespace identification error handling (Marizio Ewan, Keith) - Fabrics keep-alive tuning (Mark)" * tag 'nvme-6.7-2023-12-01' of git://git.infradead.org/nvme: nvme-core: check for too small lba shift nvme: check for valid nvme_identify_ns() before using it nvme-core: fix a memory leak in nvme_ns_info_from_identify() nvme: fine-tune sending of first keep-alive commit 74fbc88e161424b3b96a22b23a8e3e1edab9d05c Author: Keith Busch Date: Tue Nov 28 09:36:04 2023 -0800 nvme-core: check for too small lba shift The block layer doesn't support logical block sizes smaller than 512 bytes. The nvme spec doesn't support that small either, but the driver isn't checking to make sure the device responded with usable data. Failing to catch this will result in a kernel bug, either from a division by zero when stacking, or a zero length bio. Reviewed-by: Jens Axboe Signed-off-by: Keith Busch commit cefc9ba6aed48a3aa085888e3262ac2aa975714b Author: Shannon Nelson Date: Fri Nov 10 14:18:02 2023 -0800 pds_vdpa: set features order Fix up the order that the device and negotiated features are checked to get a more reliable difference when things get changed. Signed-off-by: Shannon Nelson Message-Id: <20231110221802.46841-4-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit dd3b8de16e90c5594eddd29aeeb99e97c6f863be Author: Shannon Nelson Date: Fri Nov 10 14:18:01 2023 -0800 pds_vdpa: clear config callback when status goes to 0 If the client driver is setting status to 0, something is getting shutdown and possibly removed. Make sure we clear the config_cb so that it doesn't end up crashing when trying to call a bogus callback. Signed-off-by: Shannon Nelson Message-Id: <20231110221802.46841-3-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 4f317d6529d7fc3ab7769ef89645d43fc7eec61b Author: Shannon Nelson Date: Fri Nov 10 14:18:00 2023 -0800 pds_vdpa: fix up format-truncation complaint Our friendly kernel test robot has recently been pointing out some format-truncation issues. Here's a fix for one of them. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311040109.RfgJoE7L-lkp@intel.com/ Signed-off-by: Shannon Nelson Message-Id: <20231110221802.46841-2-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 480b3e73720f6b5d76bef2387b1f9d19ed67573b Author: Steve Sistare Date: Fri Nov 3 05:26:27 2023 -0700 vdpa/mlx5: preserve CVQ vringh index mlx5_vdpa does not preserve userland's view of vring base for the control queue in the following sequence: ioctl VHOST_SET_VRING_BASE ioctl VHOST_VDPA_SET_STATUS VIRTIO_CONFIG_S_DRIVER_OK mlx5_vdpa_set_status() setup_cvq_vring() vringh_init_iotlb() vringh_init_kern() vrh->last_avail_idx = 0; ioctl VHOST_GET_VRING_BASE To fix, restore the value of cvq->vring.last_avail_idx after calling vringh_init_iotlb. Fixes: 5262912ef3cf ("vdpa/mlx5: Add support for control VQ and MAC setting") Signed-off-by: Steve Sistare Acked-by: Eugenio Pérez Acked-by: Jason Wang Message-Id: <1699014387-194368-1-git-send-email-steven.sistare@oracle.com> Signed-off-by: Michael S. Tsirkin commit 0e4237ae8d159e3d28f3cd83146a46f576ffb586 Author: Ming Lei Date: Fri Dec 1 16:56:05 2023 +0800 blk-mq: don't count completed flush data request as inflight in case of quiesce Request queue quiesce may interrupt flush sequence, and the original request may have been marked as COMPLETE, but can't get finished because of queue quiesce. This way is fine from driver viewpoint, because flush sequence is block layer concept, and it isn't related with driver. However, driver(such as dm-rq) can call blk_mq_queue_inflight() to count & drain inflight requests, then the wait & drain never gets done because the completed & not-finished flush request is counted as inflight. Fix this issue by not counting completed flush data request as inflight in case of quiesce. Cc: Mike Snitzer Cc: David Jeffery Cc: John Pittman Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20231201085605.577730-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit e238b68e6dc89ddab52bd98216fe5623e94792b1 Author: Peter Ujfalusi Date: Wed Nov 29 15:14:11 2023 +0200 ASoC: SOF: ipc4-topology: Correct data structures for the GAIN module Move the base_cfg to struct sof_ipc4_gain_data. This struct describes the message payload passed to the firmware via the mailbox. It is not wise to be 'clever' and try to use the first part of a struct as IPC message without marking the message section as packed and aligned. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20231129131411.27516-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit c447636970e3409ac39f0bb8c2dcff6b726f36b0 Author: Peter Ujfalusi Date: Wed Nov 29 15:14:10 2023 +0200 ASoC: SOF: ipc4-topology: Correct data structures for the SRC module Separate the IPC message part as struct sof_ipc4_src_data. This struct describes the message payload passed to the firmware via the mailbox. It is not wise to be 'clever' and try to use the first part of a struct as IPC message without marking the message section as packed and aligned. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20231129131411.27516-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit a0575b4add21a243cc3257e75ad913cd5377d5f2 Author: Peter Ujfalusi Date: Tue Nov 28 14:39:14 2023 +0200 ASoC: hdac_hda: Conditionally register dais for HDMI and Analog The current driver is registering the same dais for each hdev found in the system which results duplicated widgets to be registered and the kernel log contains similar prints: snd_hda_codec_realtek ehdaudio0D0: ASoC: sink widget AIF1TX overwritten snd_hda_codec_realtek ehdaudio0D0: ASoC: source widget AIF1RX overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi3 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi2 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi1 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Codec Output Pin1 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Codec Input Pin1 overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Analog Codec Playback overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Digital Codec Playback overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Alt Analog Codec Playback overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Analog Codec Capture overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Digital Codec Capture overwritten skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Alt Analog Codec Capture overwritten To avoid such issue, split the dai array into HDMI and non HDMI array and register them conditionally: for HDMI hdev only register the dais needed for HDMI for non HDMI hdev do not register the HDMI dais. Depends-on: 3d1dc8b1030d ("ASoC: Intel: skl_hda_dsp_generic: Drop HDMI routes when HDMI is not available") Link: https://github.com/thesofproject/linux/issues/4509 Signed-off-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20231128123914.3986-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit a2f35ed1d237c459100adb0c39bb811d7f170977 Author: Neil Armstrong Date: Thu Nov 16 17:44:21 2023 +0100 ASoC: codecs: lpass-tx-macro: set active_decimator correct default value The -1 value for active_decimator[dai_id] is considered as "not set", but at probe the table is initialized a 0, this prevents enabling the DEC0 Mixer since it will be considered as already set. Initialize the table entries as -1 to fix tx_macro_tx_mixer_put(). Fixes: 1c6a7f5250ce ("ASoC: codecs: tx-macro: fix active_decimator array") Fixes: c1057a08af43 ("ASoC: codecs: tx-macro: fix kcontrol put") Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20231116-topic-sm8x50-upstream-tx-macro-fix-active-decimator-set-v1-1-6edf402f4b6f@linaro.org Signed-off-by: Mark Brown commit b24e3590c94ab0aba6e455996b502a83baa5c31c Author: Malcolm Hart Date: Mon Nov 27 20:36:00 2023 +0000 ASoC: amd: yc: Fix non-functional mic on ASUS E1504FA This patch adds ASUSTeK COMPUTER INC "E1504FA" to the quirks file acp6x-mach.c to enable microphone array on ASUS Vivobook GO 15. I have this laptop and can confirm that the patch succeeds in enabling the microphone array. Signed-off-by: Malcolm Hart Cc: stable@vger.kernel.org Rule: add Link: https://lore.kernel.org/stable/875y1nt1bx.fsf%405harts.com Link: https://lore.kernel.org/r/871qcbszh0.fsf@5harts.com Signed-off-by: Mark Brown commit 19650c0f402f53abe48a55a1c49c8ed9576a088c Author: Jeremy Soller Date: Mon Nov 27 11:42:38 2023 -0700 ASoC: amd: yc: Add DMI entry to support System76 Pangolin 13 Add pang13 quirk to enable the internal microphone. Signed-off-by: Jeremy Soller Signed-off-by: Tim Crawford Link: https://lore.kernel.org/r/20231127184237.32077-2-tcrawford@system76.com Signed-off-by: Mark Brown commit 830139e7b6911266a84a77e1f18abf758995cc89 Author: Subbaraya Sundeep Date: Wed Nov 29 11:11:48 2023 +0530 octeontx2-af: Check return value of nix_get_nixlf before using nixlf If a NIXLF is not attached to a PF/VF device then nix_get_nixlf function fails and returns proper error code. But npc_get_default_entry_action does not check it and uses garbage value in subsequent calls. Fix this by cheking the return value of nix_get_nixlf. Fixes: 967db3529eca ("octeontx2-af: add support for multicast/promisc packet replication feature") Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit 9572c949385aa2ef10368287c439bcb7935137c8 Author: Subbaraya Sundeep Date: Wed Nov 29 10:53:42 2023 +0530 octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam All the mailbox messages sent to AF needs to be guarded by mutex lock. Add the missing lock in otx2_get_pauseparam function. Fixes: 75f36270990c ("octeontx2-pf: Support to enable/disable pause frames via ethtool") Signed-off-by: Subbaraya Sundeep Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit cf50b5cae84741268c7bd3fed568c1b8beef9fa9 Author: Jakub Kicinski Date: Tue Nov 28 06:59:15 2023 -0800 MAINTAINERS: exclude 9p from networking We don't have much to say about 9p, even tho it lives under net/. Avoid CCing netdev. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 95dd1e34ff5bbee93a28ff3947eceaf6de811b1a Author: Boerge Struempfel Date: Wed Nov 29 16:23:07 2023 +0100 gpiolib: sysfs: Fix error handling on failed export If gpio_set_transitory() fails, we should free the GPIO again. Most notably, the flag FLAG_REQUESTED has previously been set in gpiod_request_commit(), and should be reset on failure. To my knowledge, this does not affect any current users, since the gpio_set_transitory() mainly returns 0 and -ENOTSUPP, which is converted to 0. However the gpio_set_transitory() function calles the .set_config() function of the corresponding GPIO chip and there are some GPIO drivers in which some (unlikely) branches return other values like -EPROBE_DEFER, and -EINVAL. In these cases, the above mentioned FLAG_REQUESTED would not be reset, which results in the pin being blocked until the next reboot. Fixes: e10f72bf4b3e ("gpio: gpiolib: Generalise state persistence beyond sleep") Signed-off-by: Boerge Struempfel Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit c2183b3dcc9dd41b768569ea88bededa58cceebb Author: Daniel Mentz Date: Tue Nov 7 22:22:26 2023 -0800 iommu: Fix printk arg in of_iommu_get_resv_regions() The variable phys is defined as (struct resource *) which aligns with the printk format specifier %pr. Taking the address of it results in a value of type (struct resource **) which is incompatible with the format specifier %pr. Therefore, remove the address of operator (&). Fixes: a5bf3cfce8cb ("iommu: Implement of_iommu_get_resv_regions()") Signed-off-by: Daniel Mentz Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20231108062226.928985-1-danielmentz@google.com Signed-off-by: Joerg Roedel commit 96d7e79401364c6e9a63af5f74f76792b03cb832 Author: Ville Syrjälä Date: Tue Nov 21 07:43:14 2023 +0200 drm/i915: Check pipe active state in {planes,vrr}_{enabling,disabling}() {planes,vrr}_{enabling,disabling}() are supposed to indicate whether the specific hardware feature is supposed to be enabling or disabling. That can only makes sense if the pipe is active overall. So check for that before we go poking at the hardware. I think we're semi-safe currently on due to: - intel_pre_plane_update() doesn't get called when the pipe was not-active prior to the commit, but this is actually a bug. This saves vrr_disabling(), and vrr_enabling() is called from deeper down where we have already checked hw.active. - active_planes mirrors the crtc's hw.active Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231121054324.9988-2-ville.syrjala@linux.intel.com (cherry picked from commit bc53c4d56eb24dbe56cd2c66ef4e9fc9393b1533) Signed-off-by: Jani Nikula commit 75475bb51e78a3f54ad2f69380f2a1c985e85f2d Author: Eric Dumazet Date: Wed Nov 29 16:06:30 2023 +0000 ipv6: fix potential NULL deref in fib6_add() If fib6_find_prefix() returns NULL, we should silently fallback using fib6_null_entry regardless of RT6_DEBUG value. syzbot reported: WARNING: CPU: 0 PID: 5477 at net/ipv6/ip6_fib.c:1516 fib6_add+0x310d/0x3fa0 net/ipv6/ip6_fib.c:1516 Modules linked in: CPU: 0 PID: 5477 Comm: syz-executor.0 Not tainted 6.7.0-rc2-syzkaller-00029-g9b6de136b5f0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 RIP: 0010:fib6_add+0x310d/0x3fa0 net/ipv6/ip6_fib.c:1516 Code: 00 48 8b 54 24 68 e8 42 22 00 00 48 85 c0 74 14 49 89 c6 e8 d5 d3 c2 f7 eb 5d e8 ce d3 c2 f7 e9 ca 00 00 00 e8 c4 d3 c2 f7 90 <0f> 0b 90 48 b8 00 00 00 00 00 fc ff df 48 8b 4c 24 38 80 3c 01 00 RSP: 0018:ffffc90005067740 EFLAGS: 00010293 RAX: ffffffff89cba5bc RBX: ffffc90005067ab0 RCX: ffff88801a2e9dc0 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: ffffc90005067980 R08: ffffffff89cbca85 R09: 1ffff110040d4b85 R10: dffffc0000000000 R11: ffffed10040d4b86 R12: 00000000ffffffff R13: 1ffff110051c3904 R14: ffff8880206a5c00 R15: ffff888028e1c820 FS: 00007f763783c6c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f763783bff8 CR3: 000000007f74d000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __ip6_ins_rt net/ipv6/route.c:1303 [inline] ip6_route_add+0x88/0x120 net/ipv6/route.c:3847 ipv6_route_ioctl+0x525/0x7b0 net/ipv6/route.c:4467 inet6_ioctl+0x21a/0x270 net/ipv6/af_inet6.c:575 sock_do_ioctl+0x152/0x460 net/socket.c:1220 sock_ioctl+0x615/0x8c0 net/socket.c:1339 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82 Fixes: 7bbfe00e0252 ("ipv6: fix general protection fault in fib6_add()") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Wei Wang Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20231129160630.3509216-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit a1461f1fd6cfdc4b8917c9d4a91e92605d1f28dc Author: Masami Hiramatsu (Google) Date: Fri Dec 1 14:53:56 2023 +0900 rethook: Use __rcu pointer for rethook::handler Since the rethook::handler is an RCU-maganged pointer so that it will notice readers the rethook is stopped (unregistered) or not, it should be an __rcu pointer and use appropriate functions to be accessed. This will use appropriate memory barrier when accessing it. OTOH, rethook::data is never changed, so we don't need to check it in get_kretprobe(). NOTE: To avoid sparse warning, rethook::handler is defined by a raw function pointer type with __rcu instead of rethook_handler_t. Link: https://lore.kernel.org/all/170126066201.398836.837498688669005979.stgit@devnote2/ Fixes: 54ecbe6f1ed5 ("rethook: Add a generic return hook") Cc: stable@vger.kernel.org Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311241808.rv9ceuAh-lkp@intel.com/ Tested-by: JP Kobryn Signed-off-by: Masami Hiramatsu (Google) commit d839a656d0f3caca9f96e9bf912fd394ac6a11bc Author: JP Kobryn Date: Fri Dec 1 14:53:55 2023 +0900 kprobes: consistent rcu api usage for kretprobe holder It seems that the pointer-to-kretprobe "rp" within the kretprobe_holder is RCU-managed, based on the (non-rethook) implementation of get_kretprobe(). The thought behind this patch is to make use of the RCU API where possible when accessing this pointer so that the needed barriers are always in place and to self-document the code. The __rcu annotation to "rp" allows for sparse RCU checking. Plain writes done to the "rp" pointer are changed to make use of the RCU macro for assignment. For the single read, the implementation of get_kretprobe() is simplified by making use of an RCU macro which accomplishes the same, but note that the log warning text will be more generic. I did find that there is a difference in assembly generated between the usage of the RCU macros vs without. For example, on arm64, when using rcu_assign_pointer(), the corresponding store instruction is a store-release (STLR) which has an implicit barrier. When normal assignment is done, a regular store (STR) is found. In the macro case, this seems to be a result of rcu_assign_pointer() using smp_store_release() when the value to write is not NULL. Link: https://lore.kernel.org/all/20231122132058.3359-1-inwardvessel@gmail.com/ Fixes: d741bf41d7c7 ("kprobes: Remove kretprobe hash") Cc: stable@vger.kernel.org Signed-off-by: JP Kobryn Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit d67f39d2b81b6a8259944d2400c1ff4fe283ff72 Author: wuqiang.matt Date: Fri Dec 1 14:53:55 2023 +0900 lib: objpool: fix head overrun on RK3588 SBC objpool overrun stress with test_objpool on OrangePi5+ SBC triggered the following kernel warnings: WARNING: CPU: 6 PID: 3115 at lib/objpool.c:168 objpool_push+0xc0/0x100 This message is from objpool.c:168: WARN_ON_ONCE(tail - head > pool->nr_objs); The overrun test case is to validate the case that pre-allocated objects are insufficient: 8 objects are pre-allocated for each node and consumer thread per node tries to grab 16 objects in a row. The testing system is OrangePI 5+, with RK3588, a big.LITTLE SOC with 4x A76 and 4x A55. When disabling either all 4 big or 4 little cores, the overrun tests run well, and once with big and little cores mixed together, the overrun test would always cause an overrun loop. It's likely the memory timing differences of big and little cores cause this trouble. Here are the debugging data of objpool_try_get_slot after try_cmpxchg_release: objpool_pop: cpu: 4/0 0:0 head: 278/279 tail:278 last:276/278 The local copies of 'head' and 'last' were 278 and 276, and reloading of 'slot->head' and 'slot->last' got 279 and 278. After try_cmpxchg_release 'slot->head' became 'head + 1', which is correct. But what's wrong here is the stale value of 'last', and that stale value of 'last' finally led the overrun of 'head'. Memory updating of 'last' and 'head' are performed in push() and pop() independently, which could be the culprit leading this out of order visibility of 'last' and 'head'. So for objpool_try_get_slot(), it's not enough only checking the condition of 'head != slot', the implicit condition 'last - head <= nr_objs' must also be explicitly asserted to guarantee 'last' is always behind 'head' before the object retrieving. This patch will check and try reloading of 'head' and 'last' to ensure 'last' is behind 'head' at the time of object retrieving. Performance testings show the average impact is about 0.1% for X86_64 and 1.12% for ARM64. Here are the results: OS: Debian 10 X86_64, Linux 6.6rc HW: XEON 8336C x 2, 64 cores/128 threads, DDR4 3200MT/s 1T 2T 4T 8T 16T native: 49543304 99277826 199017659 399070324 795185848 objpool: 29909085 59865637 119692073 239750369 478005250 objpool+: 29879313 59230743 119609856 239067773 478509029 32T 48T 64T 96T 128T native: 1596927073 2390099988 2929397330 3183875848 3257546602 objpool: 957553042 1435814086 1680872925 2043126796 2165424198 objpool+: 956476281 1434491297 1666055740 2041556569 2157415622 OS: Debian 11 AARCH64, Linux 6.6rc HW: Kunpeng-920 96 cores/2 sockets/4 NUMA nodes, DDR4 2933 MT/s 1T 2T 4T 8T 16T native: 30890508 60399915 123111980 242257008 494002946 objpool: 14742531 28883047 57739948 115886644 232455421 objpool+: 14107220 29032998 57286084 113730493 232232850 24T 32T 48T 64T 96T native: 746406039 1000174750 1493236240 1998318364 2942911180 objpool: 349164852 467284332 702296756 934459713 1387898285 objpool+: 348388180 462750976 696606096 927865887 1368402195 Link: https://lore.kernel.org/all/20231114115148.298821-1-wuqiang.matt@bytedance.com/ Fixes: b4edb8d2d464 ("lib: objpool added: ring-array based lockless MPMC") Signed-off-by: wuqiang.matt Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit 994d5c58e50e91bb02c7be4a91d5186292a895c8 Merge: 47669f40b14c3 d71f22365a9ca Author: Linus Torvalds Date: Fri Dec 1 14:17:54 2023 +0900 Merge tag 'hardening-v6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening fixes from Kees Cook: - struct_group: propagate attributes to top-level union (Dmitry Antipov) - gcc-plugins: randstruct: Update code comment in relayout_struct (Gustavo A. R. Silva) - MAINTAINERS: refresh LLVM support (Nick Desaulniers) * tag 'hardening-v6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: gcc-plugins: randstruct: Update code comment in relayout_struct() uapi: propagate __struct_group() attributes to the container union MAINTAINERS: refresh LLVM support commit 47669f40b14c32c9771e0852f7cd3a12eb044c2f Merge: 2594faafeee2f 1bddcf77ce666 Author: Linus Torvalds Date: Fri Dec 1 14:03:05 2023 +0900 Merge tag 'linux_kselftest-kunit-fixes-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull KUnit fixes from Shuah Khan: "Three fixes to warnings and run-time test behavior. With these fixes, test suite counter will be reset correctly before running tests, kunit will warn if tests are too slow, and eliminate warning when kfree() as an action" * tag 'linux_kselftest-kunit-fixes-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: kunit: test: Avoid cast warning when adding kfree() as an action kunit: Reset suite counter right before running tests kunit: Warn if tests are slow commit 619f75dae2cf117b1d07f27b046b9ffb071c4685 Author: Jan Kara Date: Thu Nov 30 10:56:53 2023 +0100 ext4: fix warning in ext4_dio_write_end_io() The syzbot has reported that it can hit the warning in ext4_dio_write_end_io() because i_size < i_disksize. Indeed the reproducer creates a race between DIO IO completion and truncate expanding the file and thus ext4_dio_write_end_io() sees an inconsistent inode state where i_disksize is already updated but i_size is not updated yet. Since we are careful when setting up DIO write and consider it extending (and thus performing the IO synchronously with i_rwsem held exclusively) whenever it goes past either of i_size or i_disksize, we can use the same test during IO completion without risking entering ext4_handle_inode_extension() without i_rwsem held. This way we make it obvious both i_size and i_disksize are large enough when we report DIO completion without relying on unreliable WARN_ON. Reported-by: Fixes: 91562895f803 ("ext4: properly sync file size update after O_SYNC direct IO") Signed-off-by: Jan Kara Reviewed-by: Ritesh Harjani (IBM) Link: https://lore.kernel.org/r/20231130095653.22679-1-jack@suse.cz Signed-off-by: Theodore Ts'o commit 6a3afb6ac6dfab158ebdd4b87941178f58c8939f Author: Zhang Yi Date: Wed Nov 29 19:47:40 2023 +0800 jbd2: increase the journal IO's priority Current jbd2 only add REQ_SYNC for descriptor block, metadata log buffer, commit buffer and superblock buffer, the submitted IO could be throttled by writeback throttle in block layer, that could lead to priority inversion in some cases. The log IO looks like a kind of high priority metadata IO, so it should not be throttled by WBT like QOS policies in block layer, let's add REQ_SYNC | REQ_IDLE to exempt from writeback throttle, and also add REQ_META together indicates it's a metadata IO. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20231129114740.2686201-2-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o commit 85559227211020b270728104c3b89918f7af27ac Author: Zhang Yi Date: Wed Nov 29 19:47:39 2023 +0800 jbd2: correct the printing of write_flags in jbd2_write_superblock() The write_flags print in the trace of jbd2_write_superblock() is not real, so move the modification before the trace. Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20231129114740.2686201-1-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o commit 1fefca6c57fb928d2131ff365270cbf863d89c88 Author: Armin Wolf Date: Fri Nov 24 19:27:47 2023 +0100 hwmon: (acpi_power_meter) Fix 4.29 MW bug The ACPI specification says: "If an error occurs while obtaining the meter reading or if the value is not available then an Integer with all bits set is returned" Since the "integer" is 32 bits in case of the ACPI power meter, userspace will get a power reading of 2^32 * 1000 miliwatts (~4.29 MW) in case of such an error. This was discovered due to a lm_sensors bugreport (https://github.com/lm-sensors/lm-sensors/issues/460). Fix this by returning -ENODATA instead. Tested-by: Fixes: de584afa5e18 ("hwmon driver for ACPI 4.0 power meters") Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20231124182747.13956-1-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 908f60642441cb4f9f0e1eb576e63b0011d318b9 Merge: a74229bcafe15 0514f63cfff38 Author: Dave Airlie Date: Fri Dec 1 13:56:22 2023 +1000 Merge tag 'amd-drm-fixes-6.7-2023-11-30' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.7-2023-11-30: amdgpu: - DMUB fix - DCN 3.5 fixes - XGMI fix - DCN 3.2 fixes - Vangogh suspend fix - NBIO 7.9 fix - GFX11 golden register fix - Backlight fix - NBIO 7.11 fix - IB test overflow fix - DCN 3.1.4 fixes - fix a runtime pm ref count - Retimer fix - ABM fix - DCN 3.1.5 fix - Fix AGP addressing - Fix possible memory leak in SMU error path - Make sure PME is enabled in D3 - Fix possible NULL pointer dereference in debugfs - EEPROM fix - GC 9.4.3 fix amdkfd: - IP version check fix - Fix memory leak in pqm_uninit() drm: - Revert unexport of prime helpers for fd/handle conversion Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20231130213135.5083-1-alexander.deucher@amd.com commit 2dcf5fde6dffb312a4bfb8ef940cea2d1f402e32 Author: Baokun Li Date: Mon Nov 27 14:33:13 2023 +0800 ext4: prevent the normalized size from exceeding EXT_MAX_BLOCKS For files with logical blocks close to EXT_MAX_BLOCKS, the file size predicted in ext4_mb_normalize_request() may exceed EXT_MAX_BLOCKS. This can cause some blocks to be preallocated that will not be used. And after [Fixes], the following issue may be triggered: ========================================================= kernel BUG at fs/ext4/mballoc.c:4653! Internal error: Oops - BUG: 00000000f2000800 [#1] SMP CPU: 1 PID: 2357 Comm: xfs_io 6.7.0-rc2-00195-g0f5cc96c367f Hardware name: linux,dummy-virt (DT) pc : ext4_mb_use_inode_pa+0x148/0x208 lr : ext4_mb_use_inode_pa+0x98/0x208 Call trace: ext4_mb_use_inode_pa+0x148/0x208 ext4_mb_new_inode_pa+0x240/0x4a8 ext4_mb_use_best_found+0x1d4/0x208 ext4_mb_try_best_found+0xc8/0x110 ext4_mb_regular_allocator+0x11c/0xf48 ext4_mb_new_blocks+0x790/0xaa8 ext4_ext_map_blocks+0x7cc/0xd20 ext4_map_blocks+0x170/0x600 ext4_iomap_begin+0x1c0/0x348 ========================================================= Here is a calculation when adjusting ac_b_ex in ext4_mb_new_inode_pa(): ex.fe_logical = orig_goal_end - EXT4_C2B(sbi, ex.fe_len); if (ac->ac_o_ex.fe_logical >= ex.fe_logical) goto adjust_bex; The problem is that when orig_goal_end is subtracted from ac_b_ex.fe_len it is still greater than EXT_MAX_BLOCKS, which causes ex.fe_logical to overflow to a very small value, which ultimately triggers a BUG_ON in ext4_mb_new_inode_pa() because pa->pa_free < len. The last logical block of an actual write request does not exceed EXT_MAX_BLOCKS, so in ext4_mb_normalize_request() also avoids normalizing the last logical block to exceed EXT_MAX_BLOCKS to avoid the above issue. The test case in [Link] can reproduce the above issue with 64k block size. Link: https://patchwork.kernel.org/project/fstests/list/?series=804003 Cc: # 6.4 Fixes: 93cdf49f6eca ("ext4: Fix best extent lstart adjustment logic in ext4_mb_new_inode_pa()") Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20231127063313.3734294-1-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit 2594faafeee2f4406ff82790604e4e3f55037d60 Merge: 6172a5180fcc6 57686a72da08a Author: Linus Torvalds Date: Fri Dec 1 10:17:16 2023 +0900 Merge tag 'perf-tools-fixes-for-v6.7-1-2023-11-29' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools Pull perf tools fixes from Namhyung Kim: "Assorted build fixes including: - fix compile errors in printf() with u64 on 32-bit systesm - sync kernel headers to the tool copies - update arm64 sysreg generation for tarballs - disable compile warnings on __packed attribute" * tag 'perf-tools-fixes-for-v6.7-1-2023-11-29' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: tools: Disable __packed attribute compiler warning due to -Werror=attributes perf build: Ensure sysreg-defs Makefile respects output dir tools perf: Add arm64 sysreg files to MANIFEST tools/perf: Update tools's copy of mips syscall table tools/perf: Update tools's copy of s390 syscall table tools/perf: Update tools's copy of powerpc syscall table tools/perf: Update tools's copy of x86 syscall table tools headers: Update tools's copy of s390/asm headers tools headers: Update tools's copy of arm64/asm headers tools headers: Update tools's copy of x86/asm headers tools headers: Update tools's copy of socket.h header tools headers UAPI: Update tools's copy of unistd.h header tools headers UAPI: Update tools's copy of vhost.h header tools headers UAPI: Update tools's copy of mount.h header tools headers UAPI: Update tools's copy of kvm.h header tools headers UAPI: Update tools's copy of fscrypt.h header tools headers UAPI: Update tools's copy of drm headers perf lock contention: Fix a build error on 32-bit perf kwork: Fix a build error on 32-bit commit 6172a5180fcc65170bfa2d49e55427567860f2a7 Merge: e8f60209d6cf6 777f245eec815 Author: Linus Torvalds Date: Fri Dec 1 08:24:46 2023 +0900 Merge tag 'net-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from bpf and wifi. Current release - regressions: - neighbour: fix __randomize_layout crash in struct neighbour - r8169: fix deadlock on RTL8125 in jumbo mtu mode Previous releases - regressions: - wifi: - mac80211: fix warning at station removal time - cfg80211: fix CQM for non-range use - tools: ynl-gen: fix unexpected response handling - octeontx2-af: fix possible buffer overflow - dpaa2: recycle the RX buffer only after all processing done - rswitch: fix missing dev_kfree_skb_any() in error path Previous releases - always broken: - ipv4: fix uaf issue when receiving igmp query packet - wifi: mac80211: fix debugfs deadlock at device removal time - bpf: - sockmap: af_unix stream sockets need to hold ref for pair sock - netdevsim: don't accept device bound programs - selftests: fix a char signedness issue - dsa: mv88e6xxx: fix marvell 6350 probe crash - octeontx2-pf: restore TC ingress police rules when interface is up - wangxun: fix memory leak on msix entry - ravb: keep reverse order of operations in ravb_remove()" * tag 'net-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (51 commits) net: ravb: Keep reverse order of operations in ravb_remove() net: ravb: Stop DMA in case of failures on ravb_open() net: ravb: Start TX queues after HW initialization succeeded net: ravb: Make write access to CXR35 first before accessing other EMAC registers net: ravb: Use pm_runtime_resume_and_get() net: ravb: Check return value of reset_control_deassert() net: libwx: fix memory leak on msix entry ice: Fix VF Reset paths when interface in a failed over aggregate bpf, sockmap: Add af_unix test with both sockets in map bpf, sockmap: af_unix stream sockets need to hold ref for pair sock tools: ynl-gen: always construct struct ynl_req_state ethtool: don't propagate EOPNOTSUPP from dumps ravb: Fix races between ravb_tx_timeout_work() and net related ops r8169: prevent potential deadlock in rtl8169_close r8169: fix deadlock on RTL8125 in jumbo mtu mode neighbour: Fix __randomize_layout crash in struct neighbour octeontx2-pf: Restore TC ingress police rules when interface is up octeontx2-pf: Fix adding mbox work queue entry when num_vfs > 64 net: stmmac: xgmac: Disable FPE MMC interrupts octeontx2-af: Fix possible buffer overflow ... commit e8f60209d6cf652a9cfda64371acea69f62770aa Merge: 09443a144c164 0cb19e50a911a Author: Linus Torvalds Date: Fri Dec 1 08:17:08 2023 +0900 Merge tag 'pmdomain-v6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm Pull pmdomain fix from Ulf Hansson: - Avoid polling for the scmi_perf_domain on arm * tag 'pmdomain-v6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: pmdomain: arm: Avoid polling for scmi_perf_domain commit 09443a144c1642b302c9bc329eb9475ae95b4304 Merge: 16864755721d5 477865af60b21 Author: Linus Torvalds Date: Fri Dec 1 08:15:05 2023 +0900 Merge tag 'mmc-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: "MMC core: - Fix CQE error recovery path MMC host: - cqhci: Fix CQE error recovery path - sdhci-pci-gli: Fix initialization of LPM - sdhci-sprd: Fix enabling/disabling of the vqmmc regulator" * tag 'mmc-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-sprd: Fix vqmmc not shutting down after the card was pulled mmc: sdhci-pci-gli: Disable LPM during initialization mmc: cqhci: Fix task clearing in CQE error recovery mmc: cqhci: Warn of halt or task clear failure mmc: block: Retry commands in CQE error recovery mmc: block: Be sure to wait while busy in CQE error recovery mmc: cqhci: Increase recovery halt timeout mmc: block: Do not lose cache flush during CQE error recovery commit 16864755721d53d7d866cf254905fde32370aa7c Merge: 9d3eac3c05ffb 8f2244c9af245 Author: Linus Torvalds Date: Fri Dec 1 08:00:02 2023 +0900 Merge tag 'leds-fixes-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds Pull LED fix from Lee Jones: - Remove duplicate sysfs entry 'color' from LEDs class * tag 'leds-fixes-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: leds: class: Don't expose color sysfs entry commit 9d3eac3c05ffb4e56cece2e7c4cc7fa2f1188748 Merge: 3b47bc037bd44 01b1e3ca0e5ce Author: Linus Torvalds Date: Fri Dec 1 07:57:08 2023 +0900 Merge tag 'efi-urgent-for-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI fix from Ard Biesheuvel: - Fix for EFI unaccepted memory handling * tag 'efi-urgent-for-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efi/unaccepted: Fix off-by-one when checking for overlapping ranges commit a74229bcafe154c103ffa63eac3a513a2280088f Merge: 54001331d25c4 fb18fe0fdf22a Author: Dave Airlie Date: Fri Dec 1 08:05:31 2023 +1000 Merge tag 'drm-misc-fixes-2023-11-29' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Fixes for v6.7-rc4: - Revert panel fixes as they require exporting device_is_dependent. - Do not double add fences in dma_resv_add_fence. - Fix GPUVM license identifier. - Assorted nouveau fixes. - Fix error check for nt36523. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/561f807e-f9d3-43c1-80d3-8b41ba83c9ec@linux.intel.com commit 54001331d25c431849af621e89ac1a2c2736081a Merge: 2cc14f52aeb78 d21a3962d3042 Author: Dave Airlie Date: Fri Dec 1 07:01:06 2023 +1000 Merge tag 'drm-intel-fixes-2023-11-30' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v6.7-rc4: - Mark internal GSC engine with reserved uabi class - Take VGA converters into account in eDP probe - Fix intel_pre_plane_updates() call to ensure workarounds get applied Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87msuv479z.fsf@intel.com commit 335fe00319e030d481a54d5e0e68d50c5e672c0e Author: Esther Shimanovich Date: Thu Nov 30 19:56:19 2023 +0000 Input: i8042 - add nomux quirk for Acer P459-G2-M After the laptop lid is opened, and the device resumes from S3 deep sleep, if the user presses a keyboard key while the screen is still black, the mouse and keyboard become unusable. Enabling this quirk prevents this behavior from occurring. Signed-off-by: Esther Shimanovich Link: https://lore.kernel.org/r/20231130195615.v2.1.Ibe78a9df97ecd18dc227a5cff67d3029631d9c11@changeid Signed-off-by: Dmitry Torokhov commit 0514f63cfff38a0dcb7ba9c5f245827edc0c5107 Author: Felix Kuehling Date: Fri Nov 17 16:44:17 2023 -0500 Revert "drm/prime: Unexport helpers for fd/handle conversion" This reverts commit 71a7974ac7019afeec105a54447ae1dc7216cbb3. These helper functions are needed for KFD to export and import DMABufs the right way without duplicating the tracking of DMABufs associated with GEM objects while ensuring that move notifier callbacks are working as intended. CC: Christian König CC: Thomas Zimmermann Acked-by: Thomas Zimmermann Acked-by: Daniel Vetter Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit f5259997f3e8d6edfcc2daf5b2c0b34f074d7bc0 Author: Ard Biesheuvel Date: Mon Nov 27 13:00:51 2023 +0100 arm64: Avoid enabling KPTI unnecessarily Commit 42c5a3b04bf6 refactored the KPTI init code in a way that results in the use of non-global kernel mappings even on systems that have no need for it, and even when KPTI has been disabled explicitly via the command line. Ensure that this only happens when we have decided (based on the detected system-wide CPU features) that KPTI should be enabled. Fixes: 42c5a3b04bf6 ("arm64: Split kpti_install_ng_mappings()") Signed-off-by: Ard Biesheuvel Acked-by: Will Deacon Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20231127120049.2258650-6-ardb@google.com Signed-off-by: Catalin Marinas commit 4ea95c04fa6b9043a1a301240996aeebe3cb28ec Author: Sean Christopherson Date: Wed Nov 29 16:10:00 2023 -0800 vfio: Drop vfio_file_iommu_group() stub to fudge around a KVM wart Drop the vfio_file_iommu_group() stub and instead unconditionally declare the function to fudge around a KVM wart where KVM tries to do symbol_get() on vfio_file_iommu_group() (and other VFIO symbols) even if CONFIG_VFIO=n. Ensuring the symbol is always declared fixes a PPC build error when modules are also disabled, in which case symbol_get() simply points at the address of the symbol (with some attributes shenanigans). Because KVM does symbol_get() instead of directly depending on VFIO, the lack of a fully defined symbol is not problematic (ugly, but "fine"). arch/powerpc/kvm/../../../virt/kvm/vfio.c:89:7: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] fn = symbol_get(vfio_file_iommu_group); ^ include/linux/module.h:805:60: note: expanded from macro 'symbol_get' #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak,visibility("hidden"))); &(x); }) ^ include/linux/vfio.h:294:35: note: previous definition is here static inline struct iommu_group *vfio_file_iommu_group(struct file *file) ^ arch/powerpc/kvm/../../../virt/kvm/vfio.c:89:7: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] fn = symbol_get(vfio_file_iommu_group); ^ include/linux/module.h:805:65: note: expanded from macro 'symbol_get' #define symbol_get(x) ({ extern typeof(x) x __attribute__((weak,visibility("hidden"))); &(x); }) ^ include/linux/vfio.h:294:35: note: previous definition is here static inline struct iommu_group *vfio_file_iommu_group(struct file *file) ^ 2 errors generated. Although KVM is firmly in the wrong (there is zero reason for KVM to build virt/kvm/vfio.c when VFIO is disabled), fudge around the error in VFIO as the stub is unnecessary and doesn't serve its intended purpose (KVM is the only external user of vfio_file_iommu_group()), and there is an in-flight series to clean up the entire KVM<->VFIO interaction, i.e. fixing this in KVM would result in more churn in the long run, and the stub needs to go away regardless. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202308251949.5IiaV0sz-lkp@intel.com Closes: https://lore.kernel.org/oe-kbuild-all/202309030741.82aLACDG-lkp@intel.com Closes: https://lore.kernel.org/oe-kbuild-all/202309110914.QLH0LU6L-lkp@intel.com Link: https://lore.kernel.org/all/0-v1-08396538817d+13c5-vfio_kvm_kconfig_jgg@nvidia.com Link: https://lore.kernel.org/all/20230916003118.2540661-1-seanjc@google.com Cc: Nick Desaulniers Cc: Jason Gunthorpe Tested-by: Michael Ellerman Fixes: c1cce6d079b8 ("vfio: Compile vfio_group infrastructure optionally") Signed-off-by: Sean Christopherson Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20231130001000.543240-1-seanjc@google.com Signed-off-by: Alex Williamson commit 0015eb6e12384ff1c589928e84deac2ad1ceb236 Author: Dmitry Antipov Date: Tue Nov 28 13:53:47 2023 +0300 smb: client, common: fix fortify warnings When compiling with gcc version 14.0.0 20231126 (experimental) and CONFIG_FORTIFY_SOURCE=y, I've noticed the following: In file included from ./include/linux/string.h:295, from ./include/linux/bitmap.h:12, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:17, from ./arch/x86/include/asm/cpuid.h:62, from ./arch/x86/include/asm/processor.h:19, 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:9, from ./include/linux/preempt.h:79, from ./include/linux/spinlock.h:56, from ./include/linux/wait.h:9, from ./include/linux/wait_bit.h:8, from ./include/linux/fs.h:6, from fs/smb/client/smb2pdu.c:18: In function 'fortify_memcpy_chk', inlined from '__SMB2_close' at fs/smb/client/smb2pdu.c:3480:4: ./include/linux/fortify-string.h:588:25: warning: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] 588 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ and: In file included from ./include/linux/string.h:295, from ./include/linux/bitmap.h:12, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/paravirt.h:17, from ./arch/x86/include/asm/cpuid.h:62, from ./arch/x86/include/asm/processor.h:19, 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:9, from ./include/linux/preempt.h:79, from ./include/linux/spinlock.h:56, from ./include/linux/wait.h:9, from ./include/linux/wait_bit.h:8, from ./include/linux/fs.h:6, from fs/smb/client/cifssmb.c:17: In function 'fortify_memcpy_chk', inlined from 'CIFS_open' at fs/smb/client/cifssmb.c:1248:3: ./include/linux/fortify-string.h:588:25: warning: call to '__read_overflow2_field' declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] 588 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In both cases, the fortification logic inteprets calls to 'memcpy()' as an attempts to copy an amount of data which exceeds the size of the specified field (i.e. more than 8 bytes from __le64 value) and thus issues an overread warning. Both of these warnings may be silenced by using the convenient 'struct_group()' quirk. Signed-off-by: Dmitry Antipov Acked-by: Namjae Jeon Signed-off-by: Steve French commit bfc7db1cb94ad664546d70212699f8cc6c539e8c Author: Konrad Dybcio Date: Thu Nov 30 15:04:45 2023 +0100 interconnect: qcom: sm8250: Enable sync_state Add the generic icc sync_state callback to ensure interconnect votes are taken into account, instead of being pegged at maximum values. Fixes: b95b668eaaa2 ("interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231130-topic-8250icc_syncstate-v1-1-7ce78ba6e04c@linaro.org Signed-off-by: Georgi Djakov commit a337c355719c42a6c5b67e985ad753590ed844fb Author: Takashi Iwai Date: Thu Nov 30 16:13:21 2023 +0100 ALSA: hda: Disable power-save on KONTRON SinglePC It's been reported that the runtime PM on KONTRON SinglePC (PCI SSID 1734:1232) caused a stall of playback after a bunch of invocations. (FWIW, this looks like an timing issue, and the stall happens rather on the controller side.) As a workaround, disable the default power-save on this platform. Cc: Link: https://lore.kernel.org/r/20231130151321.9813-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4a6756f56bcf8e64c87144a626ce53aea4899c0e Author: Geert Uytterhoeven Date: Wed Nov 29 17:55:33 2023 +0100 reset: Fix crash when freeing non-existent optional resets When obtaining one or more optional resets, non-existent resets are stored as NULL pointers, and all related error and cleanup paths need to take this into account. Currently only reset_control_put() and reset_control_bulk_put() get this right. All of __reset_control_bulk_get(), of_reset_control_array_get(), and reset_control_array_put() lack the proper checking, causing NULL pointer dereferences on failure or release. Fix this by moving the existing check from reset_control_bulk_put() to __reset_control_put_internal(), so it applies to all callers. The double check in reset_control_put() doesn't hurt. Fixes: 17c82e206d2a3cd8 ("reset: Add APIs to manage array of resets") Fixes: 48d71395896d54ee ("reset: Add reset_control_bulk API") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/2440edae7ca8534628cdbaf559ded288f2998178.1701276806.git.geert+renesas@glider.be Signed-off-by: Philipp Zabel commit c72b9c33ef9695ad7ce7a6eb39a9df8a01b70796 Author: Kunwu Chan Date: Thu Nov 23 22:52:37 2023 +0800 ARM: OMAP2+: Fix null pointer dereference and memory leak in omap_soc_device_init kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. When 'soc_dev_attr->family' is NULL,it'll trigger the null pointer dereference issue, such as in 'soc_info_show'. And when 'soc_device_register' fails, it's necessary to release 'soc_dev_attr->family' to avoid memory leaks. Fixes: 6770b2114325 ("ARM: OMAP2+: Export SoC information to userspace") Signed-off-by: Kunwu Chan Message-ID: <20231123145237.609442-1-chentao@kylinos.cn> Signed-off-by: Tony Lindgren commit cbf54f37600e874d82886aa3b2f471778cae01ce Author: Armin Wolf Date: Wed Nov 29 19:16:54 2023 +0100 platform/x86: wmi: Skip blocks with zero instances Some machines like the HP Omen 17 ck2000nf contain WMI blocks with zero instances, so any WMI driver which tries to handle the associated WMI device will fail. Skip such WMI blocks to avoid confusing any WMI drivers. Reported-by: Alexis Belmonte Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218188 Fixes: bff431e49ff5 ("ACPI: WMI: Add ACPI-WMI mapping driver") Tested-by: Alexis Belmonte Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20231129181654.5800-1-W_Armin@gmx.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 1e5caee2ba8f1426e8098afb4ca38dc40a0ca71b Author: Andrew Davis Date: Mon Nov 13 12:16:04 2023 -0600 ARM: dts: dra7: Fix DRA7 L3 NoC node register size This node can access any part of the L3 configuration registers space, including CLK1 and CLK2 which are 0x800000 offset. Restore this area size to include these areas. Fixes: 7f2659ce657e ("ARM: dts: Move dra7 l3 noc to a separate node") Signed-off-by: Andrew Davis Message-ID: <20231113181604.546444-1-afd@ti.com> Signed-off-by: Tony Lindgren commit 64111a0e22a9d4e0de7a5d04e7d5c21d0af4b900 Author: Adrián Larumbe Date: Sat Nov 25 20:52:03 2023 +0000 drm/panfrost: Fix incorrect updating of current device frequency It was noticed when setting the Panfrost's DVFS device to the performant governor, GPU frequency as reported by fdinfo had dropped to 0 permamently. There are two separate issues causing this behaviour: - Not initialising the device's current_frequency variable to its original value during device probe(). - Updating said variable in Panfrost devfreq's get_dev_status() rather than after the new OPP's frequency had been retrieved in target(), which meant the old frequency would be assigned instead. Signed-off-by: Adrián Larumbe Fixes: f11b0417eec2 ("drm/panfrost: Add fdinfo support GPU load metrics") Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20231125205438.375407-3-adrian.larumbe@collabora.com commit 7701ce26c747322de1f1a87f8e32792582f33249 Author: Adrián Larumbe Date: Sat Nov 25 20:52:02 2023 +0000 drm/panfrost: Consider dma-buf imported objects as resident A GEM object constructed from a dma-buf imported sgtable should be regarded as being memory resident, because the dma-buf API mandates backing storage to be allocated when attachment succeeds. Signed-off-by: Adrián Larumbe Fixes: 9ccdac7aa822 ("drm/panfrost: Add fdinfo support for memory stats") Reported-by: Boris Brezillon Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20231125205438.375407-2-adrian.larumbe@collabora.com commit 777f245eec8152926b411e3d4f4545310f52cbed Merge: 91fdb30ddfdb6 edf9bc396e050 Author: Paolo Abeni Date: Thu Nov 30 10:59:10 2023 +0100 Merge branch 'net-ravb-fixes-for-the-ravb-driver' Claudiu Beznea says: ==================== net: ravb: Fixes for the ravb driver This series adds some fixes for ravb driver. Patches in this series were initilly part of series at [1]. Changes in v2: - in description of patch 1/6 documented the addition of out_free_netdev goto label - collected tags - s/out_runtime_disable/out_rpm_disable in patch 2/6 - fixed typos in description of patch 6/6 Changes since [1]: - addressed review comments - added patch 6/6 [1] https://lore.kernel.org/all/20231120084606.4083194-1-claudiu.beznea.uj@bp.renesas.com/ ==================== Link: https://lore.kernel.org/r/20231128080439.852467-1-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Paolo Abeni commit edf9bc396e05081ca281ffb0cd41e44db478ff26 Author: Claudiu Beznea Date: Tue Nov 28 10:04:39 2023 +0200 net: ravb: Keep reverse order of operations in ravb_remove() On RZ/G3S SMARC Carrier II board having RGMII connections b/w Ethernet MACs and PHYs it has been discovered that doing unbind/bind for ravb driver in a loop leads to wrong speed and duplex for Ethernet links and broken connectivity (the connectivity cannot be restored even with bringing interface down/up). Before doing unbind/bind the Ethernet interfaces were configured though systemd. The sh instructions used to do unbind/bind were: $ cd /sys/bus/platform/drivers/ravb/ $ while :; do echo 11c30000.ethernet > unbind ; \ echo 11c30000.ethernet > bind; done It has been discovered that there is a race b/w IOCTLs initialized by systemd at the response of success binding and the "ravb_write(ndev, CCC_OPC_RESET, CCC)" call in ravb_remove() as follows: 1/ as a result of bind success the user space open/configures the interfaces tough an IOCTL; the following stack trace has been identified on RZ/G3S: Call trace: dump_backtrace+0x9c/0x100 show_stack+0x20/0x38 dump_stack_lvl+0x48/0x60 dump_stack+0x18/0x28 ravb_open+0x70/0xa58 __dev_open+0xf4/0x1e8 __dev_change_flags+0x198/0x218 dev_change_flags+0x2c/0x80 devinet_ioctl+0x640/0x708 inet_ioctl+0x1e4/0x200 sock_do_ioctl+0x50/0x108 sock_ioctl+0x240/0x358 __arm64_sys_ioctl+0xb0/0x100 invoke_syscall+0x50/0x128 el0_svc_common.constprop.0+0xc8/0xf0 do_el0_svc+0x24/0x38 el0_svc+0x34/0xb8 el0t_64_sync_handler+0xc0/0xc8 el0t_64_sync+0x190/0x198 2/ this call may execute concurrently with ravb_remove() as the unbind/bind operation was executed in a loop 3/ if the operation mode is changed to RESET (through ravb_write(ndev, CCC_OPC_RESET, CCC) call in ravb_remove()) while the above ravb_open() is in progress it may lead to MAC (or PHY, or MAC-PHY connection, the right point hasn't been identified at the moment) to be broken, thus the Ethernet connectivity fails to restore. The simple fix for this is to move ravb_write(ndev, CCC_OPC_RESET, CCC)) after unregister_netdev() to avoid resetting the controller while the netdev interface is still registered. To avoid future issues in ravb_remove(), the patch follows the proper order of operations in ravb_remove(): reverse order compared with ravb_probe(). This avoids described races as the IOCTLs as well as unregister_netdev() (called now at the beginning of ravb_remove()) calls rtnl_lock() before continuing and IOCTLs check (though devinet_ioctl()) if device is still registered just after taking the lock: int devinet_ioctl(struct net *net, unsigned int cmd, struct ifreq *ifr) { // ... rtnl_lock(); ret = -ENODEV; dev = __dev_get_by_name(net, ifr->ifr_name); if (!dev) goto done; // ... done: rtnl_unlock(); out: return ret; } Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") Reviewed-by: Sergey Shtylyov Signed-off-by: Claudiu Beznea Signed-off-by: Paolo Abeni commit eac16a733427ba0de2449ffc7bd3da32ddb65cb7 Author: Claudiu Beznea Date: Tue Nov 28 10:04:38 2023 +0200 net: ravb: Stop DMA in case of failures on ravb_open() In case ravb_phy_start() returns with error the settings applied in ravb_dmac_init() are not reverted (e.g. config mode). For this call ravb_stop_dma() on failure path of ravb_open(). Fixes: a0d2f20650e8 ("Renesas Ethernet AVB PTP clock driver") Reviewed-by: Sergey Shtylyov Signed-off-by: Claudiu Beznea Signed-off-by: Paolo Abeni commit 6f32c086602050fc11157adeafaa1c1eb393f0af Author: Claudiu Beznea Date: Tue Nov 28 10:04:37 2023 +0200 net: ravb: Start TX queues after HW initialization succeeded ravb_phy_start() may fail. If that happens, the TX queues will remain started. Thus, move the netif_tx_start_all_queues() after PHY is successfully initialized. Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") Reviewed-by: Sergey Shtylyov Signed-off-by: Claudiu Beznea Reviewed-by: Kalesh AP Signed-off-by: Paolo Abeni commit d78c0ced60d5e2f8b5a4a0468a5c400b24aeadf2 Author: Claudiu Beznea Date: Tue Nov 28 10:04:36 2023 +0200 net: ravb: Make write access to CXR35 first before accessing other EMAC registers Hardware manual of RZ/G3S (and RZ/G2L) specifies the following on the description of CXR35 register (chapter "PHY interface select register (CXR35)"): "After release reset, make write-access to this register before making write-access to other registers (except MDIOMOD). Even if not need to change the value of this register, make write-access to this register at least one time. Because RGMII/MII MODE is recognized by accessing this register". The setup procedure for EMAC module (chapter "Setup procedure" of RZ/G3S, RZ/G2L manuals) specifies the E-MAC.CXR35 register is the first EMAC register that is to be configured. Note [A] from chapter "PHY interface select register (CXR35)" specifies the following: [A] The case which CXR35 SEL_XMII is used for the selection of RGMII/MII in APB Clock 100 MHz. (1) To use RGMII interface, Set ‘H’03E8_0000’ to this register. (2) To use MII interface, Set ‘H’03E8_0002’ to this register. Take into account these indication. Fixes: 1089877ada8d ("ravb: Add RZ/G2L MII interface support") Reviewed-by: Sergey Shtylyov Signed-off-by: Claudiu Beznea Signed-off-by: Paolo Abeni commit 88b74831faaee455c2af380382d979fc38e79270 Author: Claudiu Beznea Date: Tue Nov 28 10:04:35 2023 +0200 net: ravb: Use pm_runtime_resume_and_get() pm_runtime_get_sync() may return an error. In case it returns with an error dev->power.usage_count needs to be decremented. pm_runtime_resume_and_get() takes care of this. Thus use it. Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") Reviewed-by: Sergey Shtylyov Signed-off-by: Claudiu Beznea Signed-off-by: Paolo Abeni commit d8eb6ea4b302e7ff78535c205510e359ac10a0bd Author: Claudiu Beznea Date: Tue Nov 28 10:04:34 2023 +0200 net: ravb: Check return value of reset_control_deassert() reset_control_deassert() could return an error. Some devices cannot work if reset signal de-assert operation fails. To avoid this check the return code of reset_control_deassert() in ravb_probe() and take proper action. Along with it, the free_netdev() call from the error path was moved after reset_control_assert() on its own label (out_free_netdev) to free netdev in case reset_control_deassert() fails. Fixes: 0d13a1a464a0 ("ravb: Add reset support") Reviewed-by: Sergey Shtylyov Reviewed-by: Philipp Zabel Signed-off-by: Claudiu Beznea Signed-off-by: Paolo Abeni commit 27d25348d42161837be08fc63b04a2559d2e781c Author: Ashwin Dayanand Kamat Date: Wed Nov 29 16:10:29 2023 +0530 x86/sev: Fix kernel crash due to late update to read-only ghcb_version A write-access violation page fault kernel crash was observed while running cpuhotplug LTP testcases on SEV-ES enabled systems. The crash was observed during hotplug, after the CPU was offlined and the process was migrated to different CPU. setup_ghcb() is called again which tries to update ghcb_version in sev_es_negotiate_protocol(). Ideally this is a read_only variable which is initialised during booting. Trying to write it results in a pagefault: BUG: unable to handle page fault for address: ffffffffba556e70 #PF: supervisor write access in kernel mode #PF: error_code(0x0003) - permissions violation [ ...] Call Trace: ? __die_body.cold+0x1a/0x1f ? __die+0x2a/0x35 ? page_fault_oops+0x10c/0x270 ? setup_ghcb+0x71/0x100 ? __x86_return_thunk+0x5/0x6 ? search_exception_tables+0x60/0x70 ? __x86_return_thunk+0x5/0x6 ? fixup_exception+0x27/0x320 ? kernelmode_fixup_or_oops+0xa2/0x120 ? __bad_area_nosemaphore+0x16a/0x1b0 ? kernel_exc_vmm_communication+0x60/0xb0 ? bad_area_nosemaphore+0x16/0x20 ? do_kern_addr_fault+0x7a/0x90 ? exc_page_fault+0xbd/0x160 ? asm_exc_page_fault+0x27/0x30 ? setup_ghcb+0x71/0x100 ? setup_ghcb+0xe/0x100 cpu_init_exception_handling+0x1b9/0x1f0 The fix is to call sev_es_negotiate_protocol() only in the BSP boot phase, and it only needs to be done once in any case. [ mingo: Refined the changelog. ] Fixes: 95d33bfaa3e1 ("x86/sev: Register GHCB memory when SEV-SNP is active") Suggested-by: Tom Lendacky Co-developed-by: Bo Gan Signed-off-by: Bo Gan Signed-off-by: Ashwin Dayanand Kamat Signed-off-by: Ingo Molnar Acked-by: Tom Lendacky Link: https://lore.kernel.org/r/1701254429-18250-1-git-send-email-kashwindayan@vmware.com commit cb9c919364653eeafb49e7ff5cd32f1ad64063ac Author: Dave Airlie Date: Thu Nov 30 11:08:52 2023 +1000 nouveau/tu102: flush all pdbs on vmm flush This is a hack around a bug exposed with the GSP code, I'm not sure what is happening exactly, but it appears some of our flushes don't result in proper tlb invalidation for out BAR2 and we get a BAR2 fault from GSP and it all dies. Signed-off-by: Dave Airlie Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20231130010852.4034774-1-airlied@gmail.com commit 91fdb30ddfdb651509914d3ed0a0302712540fed Author: Jiawen Wu Date: Tue Nov 28 17:59:28 2023 +0800 net: libwx: fix memory leak on msix entry Since pci_free_irq_vectors() set pdev->msix_enabled as 0 in the calling of pci_msix_shutdown(), wx->msix_entries is never freed. Reordering the lines to fix the memory leak. Cc: stable@vger.kernel.org Fixes: 3f703186113f ("net: libwx: Add irq flow functions") Signed-off-by: Jiawen Wu Reviewed-by: Kalesh AP Link: https://lore.kernel.org/r/20231128095928.1083292-1-jiawenwu@trustnetic.com Signed-off-by: Jakub Kicinski commit 9f74a3dfcf83e11aedcb98250b8040dbc6d9659a Author: Dave Ertman Date: Mon Nov 27 13:23:38 2023 -0800 ice: Fix VF Reset paths when interface in a failed over aggregate There is an error when an interface has the following conditions: - PF is in an aggregate (bond) - PF has VFs created on it - bond is in a state where it is failed-over to the secondary interface - A VF reset is issued on one or more of those VFs The issue is generated by the originating PF trying to rebuild or reconfigure the VF resources. Since the bond is failed over to the secondary interface the queue contexts are in a modified state. To fix this issue, have the originating interface reclaim its resources prior to the tear-down and rebuild or reconfigure. Then after the process is complete, move the resources back to the currently active interface. There are multiple paths that can be used depending on what triggered the event, so create a helper function to move the queues and use paired calls to the helper (back to origin, process, then move back to active interface) under the same lag_mutex lock. Fixes: 1e0f9881ef79 ("ice: Flesh out implementation of support for SRIOV on bonded interface") Signed-off-by: Dave Ertman Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen Reviewed-by: Przemek Kitszel Link: https://lore.kernel.org/r/20231127212340.1137657-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 300fbb247eb3d2146b37c8dc127056f695091218 Merge: 0d47fa5cc91b9 4ded3bfe1db65 Author: Jakub Kicinski Date: Wed Nov 29 19:43:34 2023 -0800 Merge tag 'wireless-2023-11-29' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Johannes Berg says: ==================== wireless fixes: - debugfs had a deadlock (removal vs. use of files), fixes going through wireless ACKed by Greg - support for HT STAs on 320 MHz channels, even if it's not clear that should ever happen (that's 6 GHz), best not to WARN() - fix for the previous CQM fix that broke most cases - various wiphy locking fixes - various small driver fixes * tag 'wireless-2023-11-29' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: mac80211: use wiphy locked debugfs for sdata/link wifi: mac80211: use wiphy locked debugfs helpers for agg_status wifi: cfg80211: add locked debugfs wrappers debugfs: add API to allow debugfs operations cancellation debugfs: annotate debugfs handlers vs. removal with lockdep debugfs: fix automount d_fsdata usage wifi: mac80211: handle 320 MHz in ieee80211_ht_cap_ie_to_sta_ht_cap wifi: avoid offset calculation on NULL pointer wifi: cfg80211: hold wiphy mutex for send_interface wifi: cfg80211: lock wiphy mutex for rfkill poll wifi: cfg80211: fix CQM for non-range use wifi: mac80211: do not pass AP_VLAN vif pointer to drivers during flush wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta() wifi: mt76: mt7925: fix typo in mt7925_init_he_caps wifi: mt76: mt7921: fix 6GHz disabled by the missing default CLC config ==================== Link: https://lore.kernel.org/r/20231129150809.31083-3-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski commit 0d47fa5cc91b9c8a0c90833bf1705048b2295714 Merge: 83f2df9d66bc9 51354f700d400 Author: Jakub Kicinski Date: Wed Nov 29 19:40:04 2023 -0800 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2023-11-30 We've added 5 non-merge commits during the last 7 day(s) which contain a total of 10 files changed, 66 insertions(+), 15 deletions(-). The main changes are: 1) Fix AF_UNIX splat from use after free in BPF sockmap, from John Fastabend. 2) Fix a syzkaller splat in netdevsim by properly handling offloaded programs (and not device-bound ones), from Stanislav Fomichev. 3) Fix bpf_mem_cache_alloc_flags() to initialize the allocation hint, from Hou Tao. 4) Fix netkit by rejecting IFLA_NETKIT_PEER_INFO in changelink, from Daniel Borkmann. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf, sockmap: Add af_unix test with both sockets in map bpf, sockmap: af_unix stream sockets need to hold ref for pair sock netkit: Reject IFLA_NETKIT_PEER_INFO in netkit_change_link bpf: Add missed allocation hint for bpf_mem_cache_alloc_flags() netdevsim: Don't accept device bound programs ==================== Link: https://lore.kernel.org/r/20231129234916.16128-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 88010155f02b2c3b03c71609ba6ceeb457ece095 Author: David Howells Date: Wed Nov 29 16:56:18 2023 +0000 cifs: Fix FALLOC_FL_INSERT_RANGE by setting i_size after EOF moved Fix the cifs filesystem implementations of FALLOC_FL_INSERT_RANGE, in smb3_insert_range(), to set i_size after extending the file on the server and before we do the copy to open the gap (as we don't clean up the EOF marker if the copy fails). Fixes: 7fe6fe95b936 ("cifs: add FALLOC_FL_INSERT_RANGE support") Cc: stable@vger.kernel.org Signed-off-by: David Howells Acked-by: Paulo Alcantara cc: Shyam Prasad N cc: Rohith Surabattula cc: Jeff Layton cc: linux-cifs@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: Steve French commit 83d5518b124dfd605f10a68128482c839a239f9d Author: David Howells Date: Wed Nov 29 16:56:17 2023 +0000 cifs: Fix FALLOC_FL_ZERO_RANGE by setting i_size if EOF moved Fix the cifs filesystem implementations of FALLOC_FL_ZERO_RANGE, in smb3_zero_range(), to set i_size after extending the file on the server. Fixes: 72c419d9b073 ("cifs: fix smb3_zero_range so it can expand the file-size when required") Cc: stable@vger.kernel.org Signed-off-by: David Howells Acked-by: Paulo Alcantara cc: Shyam Prasad N cc: Rohith Surabattula cc: Jeff Layton cc: linux-cifs@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: Steve French commit 0e33ac9c3ffe5e4f55c68345f44cea7fec2fe750 Author: Alison Schofield Date: Sun Nov 26 16:09:30 2023 -0800 cxl/memdev: Hold region_rwsem during inject and clear poison ops Poison inject and clear are supported via debugfs where a privileged user can inject and clear poison to a device physical address. Commit 458ba8189cb4 ("cxl: Add cxl_decoders_committed() helper") added a lockdep assert that highlighted a gap in poison inject and clear functions where holding the dpa_rwsem does not assure that a a DPA is not added to a region. The impact for inject and clear is that if the DPA address being injected or cleared has been attached to a region, but not yet committed, the dev_dbg() message intended to alert the debug user that they are acting on a mapped address is not emitted. Also, the cxl_poison trace event that serves as a log of the inject and clear activity will not include region info. Close this gap by snapshotting an unchangeable region state during poison inject and clear operations. That means holding both the region_rwsem and the dpa_rwsem during the inject and clear ops. Fixes: d2fbc4865802 ("cxl/memdev: Add support for the Inject Poison mailbox command") Fixes: 9690b07748d1 ("cxl/memdev: Add support for the Clear Poison mailbox command") Signed-off-by: Alison Schofield Reviewed-by: Davidlohr Bueso Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/08721dc1df0a51e4e38fecd02425c3475912dfd5.1701041440.git.alison.schofield@intel.com Signed-off-by: Dan Williams commit 5558b92e8d39e18aa19619be2ee37274e9592528 Author: Alison Schofield Date: Sun Nov 26 16:09:29 2023 -0800 cxl/core: Always hold region_rwsem while reading poison lists A read of a device poison list is triggered via a sysfs attribute and the results are logged as kernel trace events of type cxl_poison. The work is managed by either: a) the region driver when one of more regions map the device, or by b) the memdev driver when no regions map the device. In the case of a) the region driver holds the region_rwsem while reading the poison by committed endpoint decoder mappings and for any unmapped resources. This makes sure that the cxl_poison trace event trace reports valid region info. (Region name, HPA, and UUID). In the case of b) the memdev driver holds the dpa_rwsem preventing new DPA resources from being attached to a region. However, it leaves a gap between region attach and decoder commit actions. If a DPA in the gap is in the poison list, the cxl_poison trace event will omit the region info. Close the gap by holding the region_rwsem and the dpa_rwsem when reading poison per memdev. Since both methods now hold both locks, down_read both from the caller. Doing so also addresses the lockdep assert that found this issue: Commit 458ba8189cb4 ("cxl: Add cxl_decoders_committed() helper") Fixes: f0832a586396 ("cxl/region: Provide region info to the cxl_poison trace event") Signed-off-by: Alison Schofield Reviewed-by: Davidlohr Bueso Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/08e8e7ec9a3413b91d51de39e385653494b1eed0.1701041440.git.alison.schofield@intel.com Signed-off-by: Dan Williams commit 6f9c4d8c468c189d6dc470324bd52955f8aa0a10 Author: Jason Gunthorpe Date: Sun Nov 12 15:44:08 2023 -0400 iommufd: Do not UAF during iommufd_put_object() The mixture of kernel and user space lifecycle objects continues to be complicated inside iommufd. The obj->destroy_rwsem is used to bring order to the kernel driver destruction sequence but it cannot be sequenced right with the other refcounts so we end up possibly UAF'ing: BUG: KASAN: slab-use-after-free in __up_read+0x627/0x750 kernel/locking/rwsem.c:1342 Read of size 8 at addr ffff888073cde868 by task syz-executor934/6535 CPU: 1 PID: 6535 Comm: syz-executor934 Not tainted 6.6.0-rc7-syzkaller-00195-g2af9b20dbb39 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 __up_read+0x627/0x750 kernel/locking/rwsem.c:1342 iommufd_put_object drivers/iommu/iommufd/iommufd_private.h:149 [inline] iommufd_vfio_ioas+0x46c/0x580 drivers/iommu/iommufd/vfio_compat.c:146 iommufd_fops_ioctl+0x347/0x4d0 drivers/iommu/iommufd/main.c:398 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd There are two races here, the more obvious one: CPU 0 CPU 1 iommufd_put_object() iommufd_destroy() refcount_dec(&obj->users) iommufd_object_remove() kfree() up_read(&obj->destroy_rwsem) // Boom And there is also perhaps some possibility that the rwsem could hit an issue: CPU 0 CPU 1 iommufd_put_object() iommufd_object_destroy_user() refcount_dec(&obj->users); down_write(&obj->destroy_rwsem) up_read(&obj->destroy_rwsem); atomic_long_or(RWSEM_FLAG_WAITERS, &sem->count); tmp = atomic_long_add_return_release() rwsem_try_write_lock() iommufd_object_remove() up_write(&obj->destroy_rwsem) kfree() clear_nonspinnable() // Boom Fix this by reorganizing this again so that two refcounts are used to keep track of things with a rule that users == 0 && shortterm_users == 0 means no other threads have that memory. Put a wait_queue in the iommufd_ctx object that is triggered when any sub object reaches a 0 shortterm_users. This allows the same wait for userspace ioctls to finish behavior that the rwsem was providing. This is weaker still than the prior versions: - There is no bias on shortterm_users so if some thread is waiting to destroy other threads can continue to get new read sides - If destruction fails, eg because of an active in-kernel user, then shortterm_users will have cycled to zero momentarily blocking new users - If userspace races destroy with other userspace operations they continue to get an EBUSY since we still can't intermix looking up an ID and sleeping for its unref In all cases these are things that userspace brings on itself, correct programs will not hit them. Fixes: 99f98a7c0d69 ("iommufd: IOMMUFD_DESTROY should not increase the refcount") Link: https://lore.kernel.org/all/2-v2-ca9e00171c5b+123-iommufd_syz4_jgg@nvidia.com/ Reported-by: syzbot+d31adfb277377ef8fcba@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/00000000000055ef9a0609336580@google.com Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit bd7a282650b8beb57bc9d19bfcb714b1ccae843a Author: Jason Gunthorpe Date: Sun Nov 12 14:50:13 2023 -0400 iommufd: Add iommufd_ctx to iommufd_put_object() Will be used in the next patch. Link: https://lore.kernel.org/r/1-v2-ca9e00171c5b+123-iommufd_syz4_jgg@nvidia.com/ Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 891e0eab32a57fca4d36c5162628eb0bcb1f0edf Author: Yang Yingliang Date: Wed Nov 29 17:34:08 2023 +0800 firewire: core: fix possible memory leak in create_units() If device_register() fails, the refcount of device is not 0, the name allocated in dev_set_name() is leaked. To fix this by calling put_device(), so that it will be freed in callback function kobject_cleanup(). unreferenced object 0xffff9d99035c7a90 (size 8): comm "systemd-udevd", pid 168, jiffies 4294672386 (age 152.089s) hex dump (first 8 bytes): 66 77 30 2e 30 00 ff ff fw0.0... backtrace: [<00000000e1d62bac>] __kmem_cache_alloc_node+0x1e9/0x360 [<00000000bbeaff31>] __kmalloc_node_track_caller+0x44/0x1a0 [<00000000491f2fb4>] kvasprintf+0x67/0xd0 [<000000005b960ddc>] kobject_set_name_vargs+0x1e/0x90 [<00000000427ac591>] dev_set_name+0x4e/0x70 [<000000003b4e447d>] create_units+0xc5/0x110 fw_unit_release() will be called in the error path, move fw_device_get() before calling device_register() to keep balanced with fw_device_put() in fw_unit_release(). Cc: stable@vger.kernel.org Fixes: 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array") Fixes: a1f64819fe9f ("firewire: struct device - replace bus_id with dev_name(), dev_set_name()") Signed-off-by: Yang Yingliang Signed-off-by: Takashi Sakamoto commit 88a2b4d34a64bba914c4e245c6de3ca42bea93cf Author: Timur Tabi Date: Wed Nov 22 14:28:40 2023 -0600 nouveau/gsp: document some aspects of GSP-RM Document a few aspects of communication with GSP-RM. These comments are derived from notes made during early development of GSP-RM support in Nouveau, but were not included in the initial patch set. Reviewed-by: Dave Airlie Signed-off-by: Timur Tabi Reviewed-by: Danilo Krummrich Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20231122202840.2565153-1-ttabi@nvidia.com commit 51354f700d400e55b329361e1386b04695e6e5c1 Author: John Fastabend Date: Tue Nov 28 17:25:57 2023 -0800 bpf, sockmap: Add af_unix test with both sockets in map This adds a test where both pairs of a af_unix paired socket are put into a BPF map. This ensures that when we tear down the af_unix pair we don't have any issues on sockmap side with ordering and reference counting. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/20231129012557.95371-3-john.fastabend@gmail.com commit 8866730aed5100f06d3d965c22f1c61f74942541 Author: John Fastabend Date: Tue Nov 28 17:25:56 2023 -0800 bpf, sockmap: af_unix stream sockets need to hold ref for pair sock AF_UNIX stream sockets are a paired socket. So sending on one of the pairs will lookup the paired socket as part of the send operation. It is possible however to put just one of the pairs in a BPF map. This currently increments the refcnt on the sock in the sockmap to ensure it is not free'd by the stack before sockmap cleans up its state and stops any skbs being sent/recv'd to that socket. But we missed a case. If the peer socket is closed it will be free'd by the stack. However, the paired socket can still be referenced from BPF sockmap side because we hold a reference there. Then if we are sending traffic through BPF sockmap to that socket it will try to dereference the free'd pair in its send logic creating a use after free. And following splat: [59.900375] BUG: KASAN: slab-use-after-free in sk_wake_async+0x31/0x1b0 [59.901211] Read of size 8 at addr ffff88811acbf060 by task kworker/1:2/954 [...] [59.905468] Call Trace: [59.905787] [59.906066] dump_stack_lvl+0x130/0x1d0 [59.908877] print_report+0x16f/0x740 [59.910629] kasan_report+0x118/0x160 [59.912576] sk_wake_async+0x31/0x1b0 [59.913554] sock_def_readable+0x156/0x2a0 [59.914060] unix_stream_sendmsg+0x3f9/0x12a0 [59.916398] sock_sendmsg+0x20e/0x250 [59.916854] skb_send_sock+0x236/0xac0 [59.920527] sk_psock_backlog+0x287/0xaa0 To fix let BPF sockmap hold a refcnt on both the socket in the sockmap and its paired socket. It wasn't obvious how to contain the fix to bpf_unix logic. The primarily problem with keeping this logic in bpf_unix was: In the sock close() we could handle the deref by having a close handler. But, when we are destroying the psock through a map delete operation we wouldn't have gotten any signal thorugh the proto struct other than it being replaced. If we do the deref from the proto replace its too early because we need to deref the sk_pair after the backlog worker has been stopped. Given all this it seems best to just cache it at the end of the psock and eat 8B for the af_unix and vsock users. Notice dgram sockets are OK because they handle locking already. Fixes: 94531cfcbe79 ("af_unix: Add unix_stream_proto for sockmap") Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Sitnicki Link: https://lore.kernel.org/bpf/20231129012557.95371-2-john.fastabend@gmail.com commit ed6e4f0a27ebafffbd12bf3878ab004787685d8a Author: Lijo Lazar Date: Tue Nov 28 16:47:14 2023 +0530 drm/amdgpu: Use another offset for GC 9.4.3 remap The legacy region at 0x7F000 maps to valid registers in GC 9.4.3 SOCs. Use 0x1A000 offset instead as MMIO register remap region. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a2ab248d94f5af2c609c8c3329875f92324782c5 Author: Taimur Hassan Date: Fri Nov 10 10:24:20 2023 -0500 drm/amd/display: Fix some HostVM parameters in DML [Why] A number of DML parameters related to HostVM were either missing or being set incorrectly, which may cause inaccuracies in calculating margins and determining BW limitations. [How] Correct these values where needed and populate the missing values. Cc: stable@vger.kernel.org Reviewed-by: Nicholas Kazlauskas Acked-by: Hamza Mahfooz Signed-off-by: Taimur Hassan Signed-off-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 72838777aa38352e20301e123b97110c456cd38e Author: ZhenGuo Yin Date: Mon Nov 6 18:07:51 2023 +0800 drm/amdkfd: Free gang_ctx_bo and wptr_bo in pqm_uninit [Why] Memory leaks of gang_ctx_bo and wptr_bo. [How] Free gang_ctx_bo and wptr_bo in pqm_uninit. v2: add a common function pqm_clean_queue_resource to free queue's resources. v3: reset pdd->pqd.num_gws when destorying GWS queue. Reviewed-by: Felix Kuehling Signed-off-by: ZhenGuo Yin Signed-off-by: Alex Deucher commit e0409021e34af50e7b6f31635c8d21583d7c43dd Author: Candice Li Date: Fri Nov 24 09:33:47 2023 +0800 drm/amdgpu: Update EEPROM I2C address for smu v13_0_0 Check smu v13_0_0 SKU type to select EEPROM I2C address. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.1.x commit 27750e176a4f8549e13fa91f311b29a2e40d47be Author: Nicholas Kazlauskas Date: Tue Nov 14 11:22:09 2023 -0500 drm/amd/display: Allow DTBCLK disable for DCN35 [Why] DTBCLK is enabled on idle and it will burn power. [How] There's a few issues here: - Always enabling DTBCLK on clock manager init - Setting refclk when DTBCLK is supposed to be disabled - Not applying the correct calculated version refclk, but instead the base value which might be zero On dtbclk_en change we'll message PMFW to enable or disable the clock accordingly. The DTBDTO will be then based on refclk, but it will be set to the default fixed value if there was nothing calculated in DML despite the clock being considered enabled. Reviewed-by: Charlene Liu Acked-by: Tom Chung Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2161e09cd05a50d80736fe397145340d2e8f6c05 Author: Lu Yao Date: Thu Nov 23 09:22:34 2023 +0800 drm/amdgpu: Fix cat debugfs amdgpu_regs_didt causes kernel null pointer For 'AMDGPU_FAMILY_SI' family cards, in 'si_common_early_init' func, init 'didt_rreg' and 'didt_wreg' to 'NULL'. But in func 'amdgpu_debugfs_regs_didt_read/write', using 'RREG32_DIDT' 'WREG32_DIDT' lacks of relevant judgment. And other 'amdgpu_ip_block_version' that use these two definitions won't be added for 'AMDGPU_FAMILY_SI'. So, add null pointer judgment before calling. Reviewed-by: Christian König Signed-off-by: Lu Yao Signed-off-by: Alex Deucher commit 6967741d26c87300a51b5e50d4acd104bc1a9759 Author: Mario Limonciello Date: Fri Nov 24 09:56:32 2023 -0600 drm/amd: Enable PCIe PME from D3 When dGPU is put into BOCO it may be in D3cold but still able send PME on display hotplug event. For this to work it must be enabled as wake source from D3. When runpm is enabled use pci_wake_from_d3() to mark wakeup as enabled by default. Cc: stable@vger.kernel.org # 6.1+ Signed-off-by: Mario Limonciello Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 7a88f23e768491bae653b444a96091d2aaeb0818 Author: Dinghao Liu Date: Thu Nov 23 15:33:22 2023 +0800 drm/amd/pm: fix a memleak in aldebaran_tables_init When kzalloc() for smu_table->ecc_table fails, we should free the previously allocated resources to prevent memleak. Fixes: edd794208555 ("drm/amd/pm: add message smu to get ecc_table v2") Signed-off-by: Dinghao Liu Signed-off-by: Alex Deucher commit e222b36e9649404cc0770a6d778d69cf73bcd440 Author: Alex Deucher Date: Fri Nov 10 09:39:18 2023 -0500 drm/amdgpu: fix AGP addressing when GART is not at 0 This worked by luck if the GART aperture ended up at 0. When we ended up moving GART on some chips, the GART aperture ended up offsetting the AGP address since the resource->start is a GART offset, not an MC address. Fix this by moving the AGP address setup into amdgpu_bo_gpu_offset_no_check(). v2: check mem_type before checking agp v3: check if the ttm bo has a ttm_tt allocated yet Fixes: 67318cb84341 ("drm/amdgpu/gmc11: set gart placement GC11") Tested-by: Mario Limonciello Reported-by: Jesse Zhang Reported-by: Yifan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: christian.koenig@amd.com Cc: mario.limonciello@amd.com commit c92da0403d373c03ea5c65c0260c7db6762013b0 Author: Dmytro Laktyushkin Date: Fri Nov 3 14:55:37 2023 -0400 drm/amd/display: update dcn315 lpddr pstate latency [WHY/HOW] Increase the pstate latency to improve ac/dc transition Reviewed-by: Charlene Liu Acked-by: Tom Chung Signed-off-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b9f46f0b98784e40288ee393f863f553fde062fa Author: Hamza Mahfooz Date: Wed Nov 22 14:50:34 2023 -0500 drm/amd/display: fix ABM disablement On recent versions of DMUB firmware, if we want to completely disable ABM we have to pass ABM_LEVEL_IMMEDIATE_DISABLE as the requested ABM level to DMUB. Otherwise, LCD eDP displays are unable to reach their maximum brightness levels. So, to fix this whenever the user requests an ABM level of 0 pass ABM_LEVEL_IMMEDIATE_DISABLE to DMUB instead. Also, to keep the user's experience consistent map ABM_LEVEL_IMMEDIATE_DISABLE to 0 when a user tries to read the requested ABM level. Cc: stable@vger.kernel.org # 6.1+ Reviewed-by: Harry Wentland Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 47831f4860d4e8cdfee4910d2b76ccd892fd72d1 Author: Sung Joon Kim Date: Fri Nov 10 11:33:45 2023 -0500 drm/amd/display: Fix black screen on video playback with embedded panel [why] We have dynamic power control in driver but should be ignored when power is forced on. [how] Bypass any power control when it's forced on. Cc: stable@vger.kernel.org Reviewed-by: Nicholas Kazlauskas Acked-by: Hamza Mahfooz Signed-off-by: Sung Joon Kim Signed-off-by: Alex Deucher commit dcf6cd7f35de572a946e2805ed32eb20d429a881 Author: Taimur Hassan Date: Fri Nov 10 10:15:28 2023 -0500 drm/amd/display: Fix conversions between bytes and KB [Why] There are a number of instances where we convert HostVMMinPageSize or GPUVMMinPageSize from bytes to KB by dividing (rather than multiplying) and vice versa. Additionally, in some cases, a parameter is passed through DML in KB but later checked as if it were in bytes. Cc: stable@vger.kernel.org Reviewed-by: Nicholas Kazlauskas Acked-by: Hamza Mahfooz Signed-off-by: Taimur Hassan Signed-off-by: Alex Deucher commit 2f86bf79b63dbe6963ebc647b77a5f576a906b40 Author: Mukul Joshi Date: Wed Nov 22 15:17:22 2023 -0500 drm/amdkfd: Use common function for IP version check KFD_GC_VERSION was recently updated to use a new function for IP version checks. As a result, use KFD_GC_VERSION as the common function for all IP version checks in KFD. Signed-off-by: Mukul Joshi Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher commit c5ca994445a6c99012e70ed6f3550f07efa4c341 Author: Taimur Hassan Date: Fri Nov 10 10:06:09 2023 -0500 drm/amd/display: Remove config update [Why] Prevent overwrite of dc->config.use_default_clock_table, as it should be pre-configured. Reviewed-by: Nicholas Kazlauskas Acked-by: Hamza Mahfooz Signed-off-by: Taimur Hassan Signed-off-by: Alex Deucher commit d60f56b92d3c59364a54618d557d7f9ba5939b21 Author: Nicholas Kazlauskas Date: Fri Nov 3 18:07:11 2023 -0400 drm/amd/display: Update DCN35 clock table policy [Why] The new table doesn't have an implicit mapping between Fclk SOC voltage and MemClk and it currently builds the table off of number of Fclk states rather than DcfClock states. The DML table in use is not correct for functionality or power and does not align with our existing policies for DCN3x. [How] Build the table based on DcfClock with the following assumptions: 1. Raising Soc voltage is the most expensive operation, so assume that running at max DispClock or DppClock is preferable. 2. Assume that we can run at max Fclk / MemClk at any state, but restrict the maximum state to the very last entry in the table as the worst case scenario. 3. Assume that Fclk always has a 2x multiplier on DcfClock unless the table specifies something lower. Reviewed-by: Taimur Hassan Acked-by: Hamza Mahfooz Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit eb28018943fed7639dfea1c9ec9c756ec692b99a Author: Zhongwei Date: Wed Nov 8 16:34:36 2023 +0800 drm/amd/display: force toggle rate wa for first link training for a retimer [WHY] Handover from DMUB to driver does not perform link rate toggle. It might cause link training failure for boot up. [HOW] Force toggle rate wa for first link train. link->vendor_specific_lttpr_link_rate_wa should be zero then. Cc: stable@vger.kernel.org # 6.1+ Reviewed-by: Michael Strauss Acked-by: Hamza Mahfooz Signed-off-by: Zhongwei Signed-off-by: Alex Deucher commit c6df7f313794c3ad41a49b9a7c95da369db607f3 Author: Prike Liang Date: Wed Nov 8 14:38:29 2023 +0800 drm/amdgpu: correct the amdgpu runtime dereference usage count Fix the amdgpu runpm dereference usage count. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 4636a211980052ca0df90265c8a3ed2d46099091 Author: Nicholas Kazlauskas Date: Wed Nov 8 10:59:00 2023 -0500 drm/amd/display: Update min Z8 residency time to 2100 for DCN314 [Why] Some panels with residency period of 2054 exhibit flickering with Z8 at the end of the frame. [How] As a workaround, increase the limit to block these panels. Cc: stable@vger.kernel.org # 6.1+ Reviewed-by: Syed Hassan Acked-by: Hamza Mahfooz Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 08448812acb2ab701cd5ff7e1a1dc97f7f10260c Author: Nicholas Kazlauskas Date: Wed Nov 8 10:55:53 2023 -0500 drm/amd/display: Remove min_dst_y_next_start check for Z8 [Why] Flickering occurs on DRR supported panels when engaged in DRR due to min_dst_y_next becoming larger than the frame size itself. [How] In general, we should be able to enter Z8 when this is engaged but it might be a net power loss even if the calculation wasn't bugged. Don't support enabling Z8 during the DRR region. Cc: stable@vger.kernel.org # 6.1+ Reviewed-by: Syed Hassan Acked-by: Hamza Mahfooz Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 6b0b7789a7a5f3e69185449f891beea58e563f9b Author: Tim Huang Date: Tue Nov 21 11:06:51 2023 +0800 drm/amdgpu: fix memory overflow in the IB test Fix a memory overflow issue in the gfx IB test for some ASICs. At least 20 bytes are needed for the IB test packet. v2: correct code indentation errors. (Christian) Signed-off-by: Tim Huang Reviewed-by: Yifan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 5c908a3586492d469aef4f60f74f5298b7cb68af Author: Li Ma Date: Tue Nov 21 16:54:59 2023 +0800 drm/amdgpu: add init_registers for nbio v7.11 enable init_registers callback func for nbio v7.11. Signed-off-by: Li Ma Reviewed-by: Yifan Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit d9e865826c202b262f9ee3f17a03cc4ac5d44ced Author: Camille Cho Date: Fri Nov 3 12:08:42 2023 +0800 drm/amd/display: Simplify brightness initialization [Why] Remove the brightness cache in DC. It uses a single value to represent the brightness for both SDR and HDR mode. This leads to flash in HDR on/off. It also unconditionally programs brightness as in HDR mode. This may introduce garbage on SDR mode in miniLED panel. [How] Simplify the initialization flow by removing the DC cache and taking what panel has as default. Expand the mechanism for PWM to DPCD Aux to restore cached brightness value generally. Cc: stable@vger.kernel.org # 6.1+ Reviewed-by: Krunoslav Kovac Acked-by: Hamza Mahfooz Signed-off-by: Camille Cho Signed-off-by: Alex Deucher commit 67e38874b85b8df7b23d29f78ac3d7ecccd9519d Author: Alvin Lee Date: Wed Nov 8 17:16:28 2023 -0500 drm/amd/display: Increase num voltage states to 40 [Description] If during driver init stage there are greater than 20 intermediary voltage states while constructing the SOC BB we could hit issues because we will index outside of the clock_limits array and start overwriting data. Increase the total number of states to 40 to avoid this issue. Cc: stable@vger.kernel.org # 6.1+ Reviewed-by: Samson Tam Acked-by: Hamza Mahfooz Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 9976421f8cb26e22b611ad7036c8b26340dcce25 Author: Michael Strauss Date: Fri Oct 27 14:12:51 2023 -0400 drm/amd/display: Do not read DPREFCLK spread info from LUT on DCN35 [WHY] Currently DCN35 does not spread DPREFCLK [HOW] Remove hardcoded table with nonzero caps Reviewed-by: Nicholas Kazlauskas Acked-by: Hamza Mahfooz Signed-off-by: Michael Strauss Signed-off-by: Alex Deucher commit 9be601135ba8ac69880c01606c82140f2dde105e Author: Alvin Lee Date: Tue Nov 7 17:01:49 2023 -0500 drm/amd/display: Use DRAM speed from validation for dummy p-state [Description] When choosing which dummy p-state latency to use, we need to use the DRAM speed from validation. The DRAMSpeed DML variable can change because we use different input params to DML when populating watermarks set B. Cc: stable@vger.kernel.org # 6.1+ Reviewed-by: Samson Tam Acked-by: Hamza Mahfooz Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 6f395cebdd8927fbffdc3a55a14fcacf93634359 Author: Ilya Bakoulin Date: Tue Nov 7 15:07:56 2023 -0500 drm/amd/display: Fix MPCC 1DLUT programming [Why] Wrong function is used to translate LUT values to HW format, leading to visible artifacting in some cases. [How] Use the correct cm3_helper function. Cc: stable@vger.kernel.org # 6.1+ Reviewed-by: Krunoslav Kovac Acked-by: Hamza Mahfooz Signed-off-by: Ilya Bakoulin Signed-off-by: Alex Deucher commit cab667a87133d409ff18913fd53c2324803ea8d2 Author: Nicholas Kazlauskas Date: Tue Nov 7 11:15:16 2023 -0500 drm/amd/display: Feed SR and Z8 watermarks into DML2 for DCN35 [Why] We've updated the table but the values aren't being reflected in DML2 calculation. [How] Pass them into the bbox overrides. Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 4b27a33c3b173bef1d19ba89e0b9b812b4fddd25 Author: Alex Sierra Date: Mon Nov 20 11:31:32 2023 -0600 drm/amdgpu: Force order between a read and write to the same address Setting register to force ordering to prevent read/write or write/read hazards for un-cached modes. Signed-off-by: Alex Sierra Acked-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.1.x commit 884e9b0827e889a8742e203ccd052101fb0b945d Author: Hawking Zhang Date: Mon Nov 20 10:14:21 2023 +0800 drm/amdgpu: Do not issue gpu reset from nbio v7_9 bif interrupt In nbio v7_9, host driver should not issu gpu reset Signed-off-by: Hawking Zhang Reviewed-by: Stanley Yang Signed-off-by: Alex Deucher commit 0652a1c8a4a434a9766ca6bc52487c907df1864d Author: Nicholas Kazlauskas Date: Tue Nov 7 11:12:45 2023 -0500 drm/amd/display: Add Z8 watermarks for DML2 bbox overrides [Why] We can override SR watermarks but not Z8 ones. [How] Add new parameters for Z8 matching the SR ones and feed them into the states. These also weren't being applied to every state, so make sure that we loop over and update all SOC states if given an override. Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 8c4e9105b2a8ab4ac4e6eeb479951ba6a3b4e897 Author: Perry Yuan Date: Tue Aug 1 10:37:41 2023 -0400 drm/amdgpu: optimize RLC powerdown notification on Vangogh The smu needs to get the rlc power down message to sync the rlc state with smu, the rlc state updating message need to be sent at while smu begin suspend sequence , otherwise SMU will crash while RLC state is not notified by driver, and rlc state probally changed after that notification, so it needs to notify rlc state to smu at the end of the suspend sequence in amdgpu_device_suspend() that can make sure the rlc state is correctly set to SMU. [ 101.000590] amdgpu 0000:03:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000001E SMN_C2PMSG_82:0x00000000 [ 101.000598] amdgpu 0000:03:00.0: amdgpu: Failed to disable gfxoff! [ 110.838026] amdgpu 0000:03:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000001E SMN_C2PMSG_82:0x00000000 [ 110.838035] amdgpu 0000:03:00.0: amdgpu: Failed to disable smu features. [ 110.838039] amdgpu 0000:03:00.0: amdgpu: Fail to disable dpm features! [ 110.838040] [drm:amdgpu_device_ip_suspend_phase2 [amdgpu]] *ERROR* suspend of IP block failed -62 [ 110.884394] PM: suspend of devices aborted after 21213.620 msecs [ 110.884402] PM: start suspend of devices aborted after 21213.882 msecs [ 110.884405] PM: Some devices failed to suspend, or early wake event detected Reviewed-by: Yifan Zhang Signed-off-by: Perry Yuan Signed-off-by: Alex Deucher commit dc9b0c2af004fe7d9d7b67015fadcb0a7123c740 Author: Wenjing Liu Date: Mon Nov 6 16:47:19 2023 -0500 drm/amd/display: fix a pipe mapping error in dcn32_fpu [why] In dcn32 DML pipes are ordered the same as dc pipes but only for used pipes. For example, if dc pipe 1 and 2 are used, their dml pipe indices would be 0 and 1 respectively. However update_pipe_slice_table_with_split_flags doesn't skip indices for free pipes. This causes us to not reference correct dml pipe output when building pipe topology. [how] Use two variables to iterate dc and dml pipes respectively and only increment dml pipe index when current dc pipe is not free. Cc: stable@vger.kernel.org # 6.1+ Reviewed-by: Chaitanya Dhere Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit fdf84f10e2b08b6e3cbfc672e5dd2cebf4317dea Author: Nicholas Kazlauskas Date: Mon Nov 6 17:29:33 2023 -0500 drm/amd/display: Update DCN35 watermarks [Why & How] Update to the new values per HW team request. Affects both stutter and z8. Reviewed-by: Charlene Liu Acked-by: Hamza Mahfooz Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit b9eab9e0aad3285651040e8ab86f64f6c4e51956 Author: Jonathan Kim Date: Thu Nov 16 13:57:07 2023 -0500 drm/amdgpu: update xgmi num links info post gc9.4.2 GC IP 9.4.2 and up support TA reporting of the number of xGMI links between peers. Tested-by: Vignesh Chander Signed-off-by: Jonathan Kim Reviewed-by: Mukul Joshi Signed-off-by: Alex Deucher commit c95f12b7b724abee5e8c3727db066c63c0876db3 Author: Nicholas Kazlauskas Date: Fri Nov 3 10:01:01 2023 -0400 drm/amd/display: Add z-state support policy for dcn35 [Why] DML2 means that the dcn3x policy for calculating z-state support no longer runs from validate_bandwidth. This means we are unconditionally allowing Z8, the hardware default. [How] Port the policy over to DCN35, but with a few modifications: - Don't use min_dst_y_next_start as a check for Z8/Z10 allow - Add support for overriding the Z10 stutter period per ASIC - Cleanup the code to make the policy assignment more clear Reviewed-by: Charlene Liu Acked-by: Hamza Mahfooz Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 3c9ea68cb61bd7e5bd312c06a12adada74ff5805 Author: Alvin Lee Date: Mon Nov 6 11:20:15 2023 -0500 drm/amd/display: Include udelay when waiting for INBOX0 ACK When waiting for the ACK for INBOX0 message, we have to ensure to include the udelay for proper wait time Cc: stable@vger.kernel.org # 6.1+ Reviewed-by: Samson Tam Acked-by: Hamza Mahfooz Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 142c169b31beb364ef39385b4e88735bd51d37fe Author: Ayush Jain Date: Fri Nov 3 15:18:15 2023 +0530 cpufreq/amd-pstate: Only print supported EPP values for performance governor show_energy_performance_available_preferences() to show only supported values which is performance in performance governor policy. -------Before-------- $ cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_driver amd-pstate-epp $ cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor performance $ cat /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference performance $ cat /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences default performance balance_performance balance_power power -------After-------- $ cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_driver amd-pstate-epp $ cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor performance $ cat /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference performance $ cat /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences performance Fixes: ffa5096a7c33 ("cpufreq: amd-pstate: implement Pstate EPP support for the AMD processors") Suggested-by: Wyes Karny Signed-off-by: Ayush Jain Reviewed-by: Wyes Karny Acked-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit 41e05548fa6b069a2b895cf4c7bd9ad618b21e2f Author: Mikulas Patocka Date: Tue Nov 28 14:48:06 2023 +0100 dm-flakey: start allocating with MAX_ORDER Commit 23baf831a32c ("mm, treewide: redefine MAX_ORDER sanely") changed the meaning of MAX_ORDER from exclusive to inclusive. So, we can allocate compound pages with up to 1 << MAX_ORDER pages. Reflect this change in dm-flakey and start trying to allocate compound pages with MAX_ORDER. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 547c91929f437b42e6a9c90fec1fb5aec3e64aac Author: Like Xu Date: Thu Nov 23 15:58:18 2023 +0800 KVM: x86: Get CPL directly when checking if loaded vCPU is in kernel mode When querying whether or not a vCPU "is" running in kernel mode, directly get the CPL if the vCPU is the currently loaded vCPU. In scenarios where a guest is profiled via perf-kvm, querying vcpu->arch.preempted_in_kernel from kvm_guest_state() is wrong if vCPU is actively running, i.e. isn't scheduled out due to being preempted and so preempted_in_kernel is stale. This affects perf/core's ability to accurately tag guest RIP with PERF_RECORD_MISC_GUEST_{KERNEL|USER} and record it in the sample. This causes perf/tool to fail to connect the vCPU RIPs to the guest kernel space symbols when parsing these samples due to incorrect PERF_RECORD_MISC flags: Before (perf-report of a cpu-cycles sample): 1.23% :58945 [unknown] [u] 0xffffffff818012e0 After: 1.35% :60703 [kernel.vmlinux] [g] asm_exc_page_fault Note, checking preempted_in_kernel in kvm_arch_vcpu_in_kernel() is awful as nothing in the API's suggests that it's safe to use if and only if the vCPU was preempted. That can be cleaned up in the future, for now just fix the glaring correctness bug. Note #2, checking vcpu->preempted is NOT safe, as getting the CPL on VMX requires VMREAD, i.e. is correct if and only if the vCPU is loaded. If the target vCPU *was* preempted, then it can be scheduled back in after the check on vcpu->preempted in kvm_vcpu_on_spin(), i.e. KVM could end up trying to do VMREAD on a VMCS that isn't loaded on the current pCPU. Signed-off-by: Like Xu Fixes: e1bfc24577cc ("KVM: Move x86's perf guest info callbacks to generic KVM") Link: https://lore.kernel.org/r/20231123075818.12521-1-likexu@tencent.com [sean: massage changelong, add Fixes] Signed-off-by: Sean Christopherson commit 38bc1ab135db87577695816b190e7d6d8ec75879 Author: Mikulas Patocka Date: Tue Nov 28 14:50:23 2023 +0100 dm-verity: align struct dm_verity_fec_io properly dm_verity_fec_io is placed after the end of two hash digests. If the hash digest has unaligned length, struct dm_verity_fec_io could be unaligned. This commit fixes the placement of struct dm_verity_fec_io, so that it's aligned. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Fixes: a739ff3f543a ("dm verity: add support for forward error correction") Signed-off-by: Mike Snitzer commit 0193e3966ceeeef69e235975918b287ab093082b Author: Wu Bo Date: Tue Nov 21 20:51:50 2023 -0700 dm verity: don't perform FEC for failed readahead IO We found an issue under Android OTA scenario that many BIOs have to do FEC where the data under dm-verity is 100% complete and no corruption. Android OTA has many dm-block layers, from upper to lower: dm-verity dm-snapshot dm-origin & dm-cow dm-linear ufs DM tables have to change 2 times during Android OTA merging process. When doing table change, the dm-snapshot will be suspended for a while. During this interval, many readahead IOs are submitted to dm_verity from filesystem. Then the kverity works are busy doing FEC process which cost too much time to finish dm-verity IO. This causes needless delay which feels like system is hung. After adding debugging it was found that each readahead IO needed around 10s to finish when this situation occurred. This is due to IO amplification: dm-snapshot suspend erofs_readahead // 300+ io is submitted dm_submit_bio (dm_verity) dm_submit_bio (dm_snapshot) bio return EIO bio got nothing, it's empty verity_end_io verity_verify_io forloop range(0, io->n_blocks) // each io->nblocks ~= 20 verity_fec_decode fec_decode_rsb fec_read_bufs forloop range(0, v->fec->rsn) // v->fec->rsn = 253 new_read submit_bio (dm_snapshot) end loop end loop dm-snapshot resume Readahead BIOs get nothing while dm-snapshot is suspended, so all of them will cause verity's FEC. Each readahead BIO needs to verify ~20 (io->nblocks) blocks. Each block needs to do FEC, and every block needs to do 253 (v->fec->rsn) reads. So during the suspend interval(~200ms), 300 readahead BIOs trigger ~1518000 (300*20*253) IOs to dm-snapshot. As readahead IO is not required by userspace, and to fix this issue, it is best to pass readahead errors to upper layer to handle it. Cc: stable@vger.kernel.org Fixes: a739ff3f543a ("dm verity: add support for forward error correction") Signed-off-by: Wu Bo Reviewed-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 7be05bdfb4efc1396f7692562c7161e2b9f595f1 Author: Wu Bo Date: Tue Nov 21 20:51:49 2023 -0700 dm verity: initialize fec io before freeing it If BIO error, verity_end_io() can call verity_finish_io() before verity_fec_init_io(). Therefore, fec_io->rs is not initialized and may crash when doing memory freeing in verity_fec_finish_io(). Crash call stack: die+0x90/0x2b8 __do_kernel_fault+0x260/0x298 do_bad_area+0x2c/0xdc do_translation_fault+0x3c/0x54 do_mem_abort+0x54/0x118 el1_abort+0x38/0x5c el1h_64_sync_handler+0x50/0x90 el1h_64_sync+0x64/0x6c free_rs+0x18/0xac fec_rs_free+0x10/0x24 mempool_free+0x58/0x148 verity_fec_finish_io+0x4c/0xb0 verity_end_io+0xb8/0x150 Cc: stable@vger.kernel.org # v6.0+ Fixes: 5721d4e5a9cd ("dm verity: Add optional "try_verify_in_tasklet" feature") Signed-off-by: Wu Bo Reviewed-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 3649ff0a0b152b5f00e8f56a5ce0da0945aae278 Author: Bart Van Assche Date: Tue Nov 28 11:40:19 2023 -0800 block: Document the role of the two attribute groups It is nontrivial to derive the role of the two attribute groups in source file block/blk-sysfs.c. Hence add a comment that explains their roles. See also commit 6d85ebf95c44 ("blk-sysfs: add a new attr_group for blk_mq"). Cc: Christoph Hellwig Cc: Yu Kuai Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20231128194019.72762-1-bvanassche@acm.org Signed-off-by: Jens Axboe commit 83f2df9d66bc9e1e0dbd5d5586a701088f6a1d42 Author: Jakub Kicinski Date: Sun Nov 26 14:58:58 2023 -0800 tools: ynl-gen: always construct struct ynl_req_state struct ynl_req_state carries reply-related info from generated code into generic YNL code. While we don't need reply info to execute a request without a reply, we still need to pass in the struct, because it's also where we get the pointer to struct ynl_sock from. Passing NULL results in crashes if kernel returns an error or an unexpected reply. Fixes: dc0956c98f11 ("tools: ynl-gen: move the response reading logic into YNL") Link: https://lore.kernel.org/r/20231126225858.2144136-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit cbeb989e41f4094f54bec2cecce993f26f547bea Author: Jakub Kicinski Date: Sun Nov 26 14:58:06 2023 -0800 ethtool: don't propagate EOPNOTSUPP from dumps The default dump handler needs to clear ret before returning. Otherwise if the last interface returns an inconsequential error this error will propagate to user space. This may confuse user space (ethtool CLI seems to ignore it, but YNL doesn't). It will also terminate the dump early for mutli-skb dump, because netlink core treats EOPNOTSUPP as a real error. Fixes: 728480f12442 ("ethtool: default handlers for GET requests") Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231126225806.2143528-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit febab20caebac959fdc3d7520bc52de8b1184455 Author: Wyes Karny Date: Fri Nov 17 06:38:39 2023 +0000 cpufreq/amd-pstate: Fix scaling_min_freq and scaling_max_freq update When amd_pstate is running, writing to scaling_min_freq and scaling_max_freq has no effect. These values are only passed to the policy level, but not to the platform level. This means that the platform does not know about the frequency limits set by the user. To fix this, update the min_perf and max_perf values at the platform level whenever the user changes the scaling_min_freq and scaling_max_freq values. Fixes: ffa5096a7c33 ("cpufreq: amd-pstate: implement Pstate EPP support for the AMD processors") Acked-by: Huang Rui Signed-off-by: Wyes Karny Signed-off-by: Rafael J. Wysocki commit fb18fe0fdf22a2f4512a8b644bb5ea1473829cda Author: Yang Yingliang Date: Wed Nov 29 17:07:15 2023 +0800 drm/panel: nt36523: fix return value check in nt36523_probe() mipi_dsi_device_register_full() never returns NULL pointer, it will return ERR_PTR() when it fails, so replace the check with IS_ERR(). Fixes: 0993234a0045 ("drm/panel: Add driver for Novatek NT36523") Signed-off-by: Yang Yingliang Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20231129090715.856263-1-yangyingliang@huaweicloud.com Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231129090715.856263-1-yangyingliang@huaweicloud.com commit fc1ccc16271a0526518f19f460fed63d575a8a42 Author: xiazhengqiao Date: Wed Nov 29 16:41:15 2023 +0800 drm/panel: starry-2081101qfh032011-53g: Fine tune the panel power sequence For the "starry, 2081101qfh032011-53g" panel, it is stipulated in the panel spec that MIPI needs to keep the LP11 state before the lcm_reset pin is pulled high. Fixes: 6069b66cd962 ("drm/panel: support for STARRY 2081101QFH032011-53G MIPI-DSI panel") Signed-off-by: xiazhengqiao Reviewed-by: Jessica Zhang Link: https://lore.kernel.org/r/20231129084115.7918-1-xiazhengqiao@huaqin.corp-partner.google.com Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231129084115.7918-1-xiazhengqiao@huaqin.corp-partner.google.com commit 3b47bc037bd44f142ac09848e8d3ecccc726be99 Merge: 18d46e76d7c2e 90785ea8158b6 Author: Linus Torvalds Date: Wed Nov 29 06:45:22 2023 -0800 Merge tag 'pinctrl-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: - Fix a really interesting potential core bug in the list iterator requireing the use of READ_ONCE() discovered when testing kernel compiles with clang. - Check devm_kcalloc() return value and an array bounds in the STM32 driver. - Fix an exotic string truncation issue in the s32cc driver, found by the kernel test robot (impressive!) - Fix an undocumented struct member in the cy8c95x0 driver. - Fix a symbol overlap with MIPS in the Lochnagar driver, MIPS defines a global symbol "RST" which is a bit too generic and collide with stuff. OK this one should be renamed too, we will fix that as well. - Fix erroneous branch taking in the Realtek driver. - Fix the mail address in MAINTAINERS for the s32g2 driver. * tag 'pinctrl-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: dt-bindings: pinctrl: s32g2: change a maintainer email address pinctrl: realtek: Fix logical error when finding descriptor pinctrl: lochnagar: Don't build on MIPS pinctrl: avoid reload of p state in list iteration pinctrl: cy8c95x0: Fix doc warning pinctrl: s32cc: Avoid possible string truncation pinctrl: stm32: fix array read out of bound pinctrl: stm32: Add check for devm_kcalloc commit 382c27f4ed28f803b1f1473ac2d8db0afc795a1b Author: Peter Zijlstra Date: Wed Nov 29 15:24:52 2023 +0100 perf: Fix perf_event_validate_size() Budimir noted that perf_event_validate_size() only checks the size of the newly added event, even though the sizes of all existing events can also change due to not all events having the same read_format. When we attach the new event, perf_group_attach(), we do re-compute the size for all events. Fixes: a723968c0ed3 ("perf: Fix u16 overflows") Reported-by: Budimir Markovic Signed-off-by: Peter Zijlstra (Intel) commit 23ab79e8e469e2605beec2e3ccb40d19c68dd2e0 Author: Elliot Berman Date: Mon Nov 20 09:36:31 2023 -0800 freezer,sched: Do not restore saved_state of a thawed task It is possible for a task to be thawed multiple times when mixing the *legacy* cgroup freezer and system-wide freezer. To do this, freeze the cgroup, do system-wide freeze/thaw, then thaw the cgroup. When this happens, then a stale saved_state can be written to the task's state and cause task to hang indefinitely. Fix this by only trying to thaw tasks that are actually frozen. This change also has the marginal benefit avoiding unnecessary wake_up_state(p, TASK_FROZEN) if we know the task is already thawed. There is not possibility of time-of-compare/time-of-use race when we skip the wake_up_state because entering/exiting TASK_FROZEN is guarded by freezer_lock. Fixes: 8f0eed4a78a8 ("freezer,sched: Use saved_state to reduce some spurious wakeups") Signed-off-by: Elliot Berman Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Abhijeet Dharmapurikar Link: https://lore.kernel.org/r/20231120-freezer-state-multiple-thaws-v1-1-f2e1dd7ce5a2@quicinc.com commit dc158d23b33df9033bcc8e7117e8591dd2f9d125 Author: Nicholas Piggin Date: Wed Nov 22 12:58:11 2023 +1000 KVM: PPC: Book3S HV: Fix KVM_RUN clobbering FP/VEC user registers Before running a guest, the host process (e.g., QEMU) FP/VEC registers are saved if they were being used, similarly to when the kernel uses FP registers. The guest values are then loaded into regs, and the host process registers will be restored lazily when it uses FP/VEC. KVM HV has a bug here: the host process registers do get saved, but the user MSR bits remain enabled, which indicates the registers are valid for the process. After they are clobbered by running the guest, this valid indication causes the host process to take on the FP/VEC register values of the guest. Fixes: 34e119c96b2b ("KVM: PPC: Book3S HV P9: Reduce mtmsrd instructions required to save host SPRs") Cc: stable@vger.kernel.org # v5.17+ Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20231122025811.2973-1-npiggin@gmail.com commit 5943b8f7449df9881b273db07bdde1e7120dccf0 Author: AngeloGioacchino Del Regno Date: Mon Nov 27 14:20:26 2023 +0100 arm64: dts: mediatek: cherry: Fix interrupt cells for MT6360 on I2C7 Change interrupt cells to 2 to suppress interrupts_property warning. Cc: stable@vger.kernel.org Fixes: 0de0fe950f1b ("arm64: dts: mediatek: cherry: Enable MT6360 sub-pmic on I2C7") Link: https://lore.kernel.org/r/20231127132026.165027-1-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno commit 74543b303a9abfe4fa253d1fa215281baa05ff3a Author: Eugen Hristev Date: Mon Aug 14 10:10:53 2023 +0300 arm64: dts: mediatek: mt8183-kukui-jacuzzi: fix dsi unnecessary cells properties dtbs_check throws a warning at the dsi node: Warning (avoid_unnecessary_addr_size): /soc/dsi@14014000: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property Other DTS have a panel child node with a reg, so the parent dtsi must have the address-cells and size-cells, however this specific DT has the panel removed, but not the cells, hence the warning above. If panel is deleted then the cells must also be deleted since they are tied together, as the child node in this DT does not have a reg. Cc: stable@vger.kernel.org Fixes: cabc71b08eb5 ("arm64: dts: mt8183: Add kukui-jacuzzi-damu board") Signed-off-by: Eugen Hristev Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230814071053.5459-1-eugen.hristev@collabora.com Signed-off-by: AngeloGioacchino Del Regno commit 8e6ecbfd44b5542a7598c1c5fc9c6dcb5d367f2a Author: Eugen Hristev Date: Mon Aug 14 09:50:42 2023 +0300 arm64: dts: mediatek: mt7622: fix memory node warning check dtbs_check throws a warning at the memory node: Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit name fix by adding the address into the node name. Cc: stable@vger.kernel.org Fixes: 0b6286dd96c0 ("arm64: dts: mt7622: add bananapi BPI-R64 board") Signed-off-by: Eugen Hristev Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230814065042.4973-1-eugen.hristev@collabora.com Signed-off-by: AngeloGioacchino Del Regno commit 9adf7580f6d498a5839e02fa1d1535e934364602 Author: Eugen Hristev Date: Thu Oct 5 13:30:41 2023 +0300 arm64: dts: mediatek: mt8186: fix clock names for power domains Clocks for each power domain are split into big categories: pd clocks and subsys clocks. According to the binding, all clocks which have a dash '-' in their name are treated as subsys clocks, and must be placed at the end of the list. The other clocks which are pd clocks must come first. Fixed the naming and the placing of all clocks in the power domains. For the avoidance of doubt, prefixed all subsys clocks with the 'subsys' prefix. The binding does not enforce strict clock names, the driver uses them in bulk, only making a difference for pd clocks vs subsys clocks. The above problem appears to be trivial, however, it leads to incorrect power up and power down sequence of the power domains, because some clocks will be mistakenly taken for subsys clocks and viceversa. One consequence is the fact that if the DIS power domain goes power down and power back up during the boot process, when it comes back up, there are still transactions left on the bus which makes the display inoperable. Some of the clocks for the DIS power domain were wrongly using '_' instead of '-', which again made these clocks being treated as pd clocks instead of subsys clocks. Cc: stable@vger.kernel.org Fixes: d9e43c1e7a38 ("arm64: dts: mt8186: Add power domains controller") Signed-off-by: Eugen Hristev Tested-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20231005103041.352478-1-eugen.hristev@collabora.com Signed-off-by: AngeloGioacchino Del Regno commit 59fa1e51ba54e1f513985a8177969b62973f7fd5 Author: AngeloGioacchino Del Regno Date: Thu Oct 5 17:11:50 2023 +0200 arm64: dts: mediatek: mt8186: Change gpu speedbin nvmem cell name MT8186's GPU speedbin value must be interpreted, or the value will not be meaningful. Use the correct "gpu-speedbin" nvmem cell name for the GPU speedbin to allow triggering the cell info fixup handler, hence feeding the right speedbin number to the users. Cc: stable@vger.kernel.org Fixes: 263d2fd02afc ("arm64: dts: mediatek: mt8186: Add GPU speed bin NVMEM cells") Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20231005151150.355536-1-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno commit 1fcda8ceb014aafd56f10b33e0077c93b5dd45d1 Author: Frank Wunderlich Date: Wed Oct 25 19:08:30 2023 +0200 arm64: dts: mt7986: change cooling trips Add Critical and hot trips for emergency system shutdown and limiting system load. Change passive trip to active to make sure fan is activated on the lowest trip. Cc: stable@vger.kernel.org Fixes: 1f5be05132f3 ("arm64: dts: mt7986: add thermal-zones") Fixes: c26f779a2295 ("arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts") Suggested-by: Daniel Golle Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231025170832.78727-4-linux@fw-web.de Signed-off-by: AngeloGioacchino Del Regno commit 6413cbc17f89b3a160f3a6f3fad1232b1678fe40 Author: Frank Wunderlich Date: Wed Oct 25 19:08:29 2023 +0200 arm64: dts: mt7986: define 3W max power to both SFP on BPI-R3 All SFP power supplies are connected to the system VDD33 which is 3v3/8A. Set 3A per SFP slot to allow SFPs work which need more power than the default 1W. Cc: stable@vger.kernel.org Fixes: 8e01fb15b815 ("arm64: dts: mt7986: add Bananapi R3") Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231025170832.78727-3-linux@fw-web.de Signed-off-by: AngeloGioacchino Del Regno commit 8dfe51c3f6ef31502fca3e2da8cd250ebbe4b8f2 Author: Eric Woudstra Date: Wed Oct 25 19:08:28 2023 +0200 arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization Eric reports errors on emmc with hs400 mode when booting linux on bpi-r3 without uboot [1]. Booting with uboot does not show this because clocks seem to be initialized by uboot. Fix this by adding assigned-clocks and assigned-clock-parents like it's done in uboot [2]. [1] https://forum.banana-pi.org/t/bpi-r3-kernel-fails-setting-emmc-clock-to-416m-depends-on-u-boot/15170 [2] https://github.com/u-boot/u-boot/blob/master/arch/arm/dts/mt7986.dtsi#L287 Cc: stable@vger.kernel.org Fixes: 513b49d19b34 ("arm64: dts: mt7986: add mmc related device nodes") Signed-off-by: Eric Woudstra Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231025170832.78727-2-linux@fw-web.de Signed-off-by: AngeloGioacchino Del Regno commit 8980c30141d3986beab815d85762b9c67196ed72 Author: Hsin-Yi Wang Date: Thu Oct 26 12:09:10 2023 -0700 arm64: dts: mt8183: kukui: Fix underscores in node names Replace underscores with hyphens in pinctrl node names both for consistency and to adhere to the bindings. Cc: stable@vger.kernel.org Fixes: cd894e274b74 ("arm64: dts: mt8183: Add krane-sku176 board") Fixes: 1652dbf7363a ("arm64: dts: mt8183: add scp node") Fixes: 27eaf34df364 ("arm64: dts: mt8183: config dsi node") Signed-off-by: Hsin-Yi Wang Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231026191343.3345279-2-hsinyi@chromium.org Signed-off-by: AngeloGioacchino Del Regno commit 5a60d63439694590cd5ab1f998fc917ff7ba1c1d Author: AngeloGioacchino Del Regno Date: Wed Oct 25 11:38:16 2023 +0200 arm64: dts: mediatek: mt8183: Move thermal-zones to the root node The thermal zones are not a soc bus device: move it to the root node to solve simple_bus_reg warnings. Cc: stable@vger.kernel.org Fixes: b325ce39785b ("arm64: dts: mt8183: add thermal zone node") Link: https://lore.kernel.org/r/20231025093816.44327-9-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno commit 24165c5dad7ba7c7624d05575a5e0cc851396c71 Author: AngeloGioacchino Del Regno Date: Wed Oct 25 11:38:15 2023 +0200 arm64: dts: mediatek: mt8173-evb: Fix regulator-fixed node names Fix a unit_address_vs_reg warning for the USB VBUS fixed regulators by renaming the regulator nodes from regulator@{0,1} to regulator-usb-p0 and regulator-usb-p1. Cc: stable@vger.kernel.org Fixes: c0891284a74a ("arm64: dts: mediatek: add USB3 DRD driver") Link: https://lore.kernel.org/r/20231025093816.44327-8-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno commit 9dea1c724fc36643e83216c1f5a26613412150db Author: AngeloGioacchino Del Regno Date: Wed Oct 25 11:38:14 2023 +0200 arm64: dts: mediatek: mt8183-evb: Fix unit_address_vs_reg warning on ntc The NTC is defined as ntc@0 but it doesn't need any address at all. Fix the unit_address_vs_reg warning by dropping the unit address: since the node name has to be generic also fully rename it from ntc@0 to thermal-sensor. Cc: stable@vger.kernel.org Fixes: ff9ea5c62279 ("arm64: dts: mediatek: mt8183-evb: Add node for thermistor") Link: https://lore.kernel.org/r/20231025093816.44327-7-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno commit 19cba9a6c071db57888dc6b2ec1d9bf8996ea681 Author: AngeloGioacchino Del Regno Date: Wed Oct 25 11:38:13 2023 +0200 arm64: dts: mediatek: mt8183: Fix unit address for scp reserved memory The reserved memory for scp had node name "scp_mem_region" and also without unit-address: change the name to "memory@(address)". This fixes a unit_address_vs_reg warning. Cc: stable@vger.kernel.org Fixes: 1652dbf7363a ("arm64: dts: mt8183: add scp node") Link: https://lore.kernel.org/r/20231025093816.44327-6-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno commit 61b94d54421a1f3670ddd5396ec70afe833e9405 Author: AngeloGioacchino Del Regno Date: Thu Jul 6 11:58:41 2023 +0200 arm64: dts: mediatek: mt8195: Fix PM suspend/resume with venc clocks Before suspending the LARBs we're making sure that any operation is done: this never happens because we are unexpectedly unclocking the LARB20 before executing the suspend handler for the MediaTek Smart Multimedia Interface (SMI) and the cause of this is incorrect clocks on this LARB. Fix this issue by changing the Local Arbiter 20 (used by the video encoder secondary core) apb clock to CLK_VENC_CORE1_VENC; furthermore, in order to make sure that both the PM resume and video encoder operation is stable, add the CLK_VENC(_CORE1)_LARB clock to the VENC (main core) and VENC_CORE1 power domains, as this IP cannot communicate with the rest of the system (the AP) without local arbiter clocks being operational. Cc: stable@vger.kernel.org Fixes: 3b5838d1d82e ("arm64: dts: mt8195: Add iommu and smi nodes") Fixes: 2b515194bf0c ("arm64: dts: mt8195: Add power domains controller") Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230706095841.109315-1-angelogioacchino.delregno@collabora.com Signed-off-by: AngeloGioacchino Del Regno commit c8820c92caf0770bec976b01fa9e82bb993c5865 Author: Francesco Dolcini Date: Tue Nov 28 20:49:35 2023 +0100 platform/surface: aggregator: fix recv_buf() return value Serdev recv_buf() callback is supposed to return the amount of bytes consumed, therefore an int in between 0 and count. Do not return negative number in case of issue, when ssam_controller_receive_buf() returns ESHUTDOWN just returns 0, e.g. no bytes consumed, this keep the exact same behavior as it was before. This fixes a potential WARN in serdev-ttyport.c:ttyport_receive_buf(). Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem") Cc: stable@vger.kernel.org Signed-off-by: Francesco Dolcini Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20231128194935.11350-1-francesco@dolcini.it Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit cae2bdb579ecc9d4219c58a7d3fde1958118dc1d Author: Kailang Yang Date: Wed Nov 29 15:38:40 2023 +0800 ALSA: hda/realtek: Add supported ALC257 for ChromeOS ChromeOS want to support ALC257. Add codec ID to some relation function. Signed-off-by: Kailang Yang Cc: Link: https://lore.kernel.org/r/99a88a7dbdb045fd9d934abeb6cec15f@realtek.com Signed-off-by: Takashi Iwai commit d21a3962d3042e6f56ad324cf18bdd64a1e6ecfa Author: Ville Syrjälä Date: Tue Nov 21 07:43:15 2023 +0200 drm/i915: Call intel_pre_plane_updates() also for pipes getting enabled We used to call intel_pre_plane_updates() for any pipe going through a modeset whether the pipe was previously enabled or not. This in fact needed to apply all the necessary clock gating workarounds/etc. Restore the correct behaviour. Fixes: 39919997322f ("drm/i915: Disable all planes before modesetting any pipes") Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231121054324.9988-3-ville.syrjala@linux.intel.com (cherry picked from commit e0d5ce11ed0a21bb2bf328ad82fd261783c7ad88) Signed-off-by: Jani Nikula commit f76f83a83c8fdbb62acbf8bd945f10821768145b Author: Ville Syrjälä Date: Tue Nov 14 16:23:33 2023 +0200 drm/i915: Also check for VGA converter in eDP probe Unfortunately even the HPD based detection added in commit cfe5bdfb27fa ("drm/i915: Check HPD live state during eDP probe") fails to detect that the VBT's eDP/DDI-A is a ghost on Asus B360M-A (CFL+CNP). On that board eDP/DDI-A has its HPD asserted despite nothing being actually connected there :( The straps/fuses also indicate that the eDP port is present. So if one boots with a VGA monitor connected the eDP probe will mistake the DP->VGA converter hooked to DDI-E for an eDP panel on DDI-A. As a last resort check what kind of DP device we've detected, and if it looks like a DP->VGA converter then conclude that the eDP port should be ignored. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9636 Fixes: cfe5bdfb27fa ("drm/i915: Check HPD live state during eDP probe") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231114142333.15799-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit fcd479a79120bf0cd507d85f898297a3b868dda6) Signed-off-by: Jani Nikula commit 503579448db93f9fbcc93cd99a1f2d5aa4b2cda6 Author: Tvrtko Ursulin Date: Thu Nov 16 08:44:56 2023 +0000 drm/i915/gsc: Mark internal GSC engine with reserved uabi class The GSC CS is not exposed to the user, so we skipped assigning a uabi class number for it. However, the trace logs use the uabi class and instance to identify the engine, so leaving uabi class unset makes the GSC CS show up as the RCS in those logs. Given that the engine is not exposed to the user, we can't add a new case in the uabi enum, so we insted internally define a kernel internal class as -1. At the same time remove special handling for the name and complete the uabi_classes array so internal class is automatically correctly assigned. Engine will show as 65535:0 other0 in the logs/traces which should be unique enough. v2: * Fix uabi class u8 vs u16 type confusion. Signed-off-by: Tvrtko Ursulin Fixes: 194babe26bdc ("drm/i915/mtl: don't expose GSC command streamer to the user") Cc: Daniele Ceraolo Spurio Cc: Alan Previn Cc: Matt Roper Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20231116084456.291533-1-tvrtko.ursulin@linux.intel.com (cherry picked from commit dfed6b58d54f3a5d7e6bc1fb060e2c936330eba2) Signed-off-by: Jani Nikula commit 415e5107b0dce0e5407ae4a46700cd7e8859e252 Author: Kent Overstreet Date: Tue Nov 28 16:33:52 2023 -0500 bcachefs: Extra kthread_should_stop() calls for copygc This fixes a bug where going read-only was taking longer than it should have due to copygc forgetting to check kthread_should_stop() Additionally: fix a missing is_kthread check in bch2_move_ratelimit(). Signed-off-by: Kent Overstreet commit 463086d99889c84ce0960fac2815c596f26cc0e5 Author: Kent Overstreet Date: Tue Nov 28 16:31:48 2023 -0500 bcachefs: Convert gc_alloc_start() to for_each_btree_key2() This eliminates some SRCU warnings: for_each_btree_key2() runs every loop iteration in a distinct transaction context. Signed-off-by: Kent Overstreet commit 2111f39459b0b2ec54859b756c625edb0befce0e Author: Kent Overstreet Date: Tue Nov 28 19:26:23 2023 -0500 bcachefs: Fix race between btree writes and metadata drop btree writes update the btree node key after every write, in order to update sectors_written, and they also might need to drop pointers if one of the writes failed in a replicated btree node. But the btree node might also have had a pointer dropped while the write was in flight, by bch2_dev_metadata_drop(), and thus there was a bug where the btree node write would ovewrite the btree node's key with what it had at the start of the write. Fix this by dropping pointers not currently in the btree node key. Signed-off-by: Kent Overstreet commit ef0beeb8dd343a57cf8ad4967b508b8e7452f347 Author: Kent Overstreet Date: Mon Nov 27 00:53:46 2023 -0500 bcachefs: move journal seq assertion journal_cur_seq() can legitimately be used outside of the journal lock, where this assert can race Signed-off-by: Kent Overstreet commit 1b1bd0fd41577400434d5948edc2679092c57b08 Author: Kent Overstreet Date: Sun Nov 26 23:11:18 2023 -0500 bcachefs: -EROFS doesn't count as move_extent_start_fail The automated tests check if we've hit too many slowpath/error path events and fail the test - if we're just shutting down, that naturally shouldn't count. Signed-off-by: Kent Overstreet commit 9870257a0a338cd8d6c1cddab74e703f490f6779 Author: Yoshihiro Shimoda Date: Mon Nov 27 21:24:20 2023 +0900 ravb: Fix races between ravb_tx_timeout_work() and net related ops Fix races between ravb_tx_timeout_work() and functions of net_device_ops and ethtool_ops by using rtnl_trylock() and rtnl_unlock(). Note that since ravb_close() is under the rtnl lock and calls cancel_work_sync(), ravb_tx_timeout_work() should calls rtnl_trylock(). Otherwise, a deadlock may happen in ravb_tx_timeout_work() like below: CPU0 CPU1 ravb_tx_timeout() schedule_work() ... __dev_close_many() // Under rtnl lock ravb_close() cancel_work_sync() // Waiting ravb_tx_timeout_work() rtnl_lock() // This is possible to cause a deadlock If rtnl_trylock() fails, rescheduling the work with sleep for 1 msec. Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper") Signed-off-by: Yoshihiro Shimoda Reviewed-by: Sergey Shtylyov Link: https://lore.kernel.org/r/20231127122420.3706751-1-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Jakub Kicinski commit 9d63509547a940225d06d7eba1dc412befae255d Author: Paulo Alcantara Date: Tue Nov 28 16:37:19 2023 -0300 smb: client: report correct st_size for SMB and NFS symlinks We can't rely on FILE_STANDARD_INFORMATION::EndOfFile for reparse points as they will be always zero. Set it to symlink target's length as specified by POSIX. This will make stat() family of syscalls return the correct st_size for such files. Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit ef22bb800d967616c7638d204bc1b425beac7f5f Author: Paulo Alcantara Date: Sat Nov 25 23:55:10 2023 -0300 smb: client: fix missing mode bits for SMB symlinks When instantiating inodes for SMB symlinks, add the mode bits from @cifs_sb->ctx->file_mode as we already do for the other special files. Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 52fdb99cc436014a417750150928c8ff1f69ae66 Author: Gustavo A. R. Silva Date: Thu Nov 16 12:11:43 2023 -0600 nouveau/gsp: replace zero-length array with flex-array member and use __counted_by Fake flexible arrays (zero-length and one-element arrays) are deprecated, and should be replaced by flexible-array members. So, replace zero-length array with a flexible-array member in `struct PACKED_REGISTRY_TABLE`. Also annotate array `entries` with `__counted_by()` to prepare for the coming implementation by GCC and Clang of the `__counted_by` attribute. Flexible array members annotated with `__counted_by` can have their accesses bounds-checked at run-time via `CONFIG_UBSAN_BOUNDS` (for array indexing) and `CONFIG_FORTIFY_SOURCE` (for strcpy/memcpy-family functions). This fixes multiple -Warray-bounds warnings: drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:1069:29: warning: array subscript 0 is outside array bounds of 'PACKED_REGISTRY_ENTRY[0]' [-Warray-bounds=] drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:1070:29: warning: array subscript 0 is outside array bounds of 'PACKED_REGISTRY_ENTRY[0]' [-Warray-bounds=] drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:1071:29: warning: array subscript 0 is outside array bounds of 'PACKED_REGISTRY_ENTRY[0]' [-Warray-bounds=] drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:1072:29: warning: array subscript 0 is outside array bounds of 'PACKED_REGISTRY_ENTRY[0]' [-Warray-bounds=] While there, also make use of the struct_size() helper, and address checkpatch.pl warning: WARNING: please, no spaces at the start of a line This results in no differences in binary output. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/ZVZbX7C5suLMiBf+@work commit 45b7955b774f82680db71f460fa01bfcdaaeb514 Author: Dan Carpenter Date: Mon Nov 27 15:56:33 2023 +0300 nouveau/gsp/r535: remove a stray unlock in r535_gsp_rpc_send() This unlock doesn't belong here and it leads to a double unlock in the caller, r535_gsp_rpc_push(). Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM") Signed-off-by: Dan Carpenter Reviewed-by: Timur Tabi Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/a0293812-c05d-45f0-a535-3f24fe582c02@moroto.mountain commit e9ba37d9f9a6872b069dd893bd86a7d77ba8c153 Author: Dave Airlie Date: Fri Aug 11 13:15:20 2023 +1000 nouveau: find the smallest page allocation to cover a buffer alloc. With the new uapi we don't have the comp flags on the allocation, so we shouldn't be using the first size that works, we should be iterating until we get the correct one. This reduces allocations from 2MB to 64k in lots of places. Fixes dEQP-VK.memory.allocation.basic.size_8KiB.forward.count_4000 on my ampere/gsp system. Cc: stable@vger.kernel.org # v6.6 Signed-off-by: Dave Airlie Reviewed-by: Faith Ekstrand Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20230811031520.248341-1-airlied@gmail.com commit dc761f11af2e39119d3a7942e3d10615f3d900e7 Author: Stefan Wahren Date: Sat Nov 18 13:42:52 2023 +0100 ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act The LED ACT which is included from bcm2711-rpi-4-b doesn't exists on the Raspberry Pi 400. So the bcm2711-rpi-400.dts tries to use the delete-node directive in order to remove the complete node. Unfortunately the usage get broken in commit 1156e3a78bcc ("ARM: dts: bcm283x: Move ACT LED into separate dtsi") and now ACT and PWR LED using the same GPIO and this prevent probing of led-gpios on Raspberry Pi 400: leds-gpio: probe of leds failed with error -16 So fix the delete-node directive. Fixes: 1156e3a78bcc ("ARM: dts: bcm283x: Move ACT LED into separate dtsi") Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/20231118124252.14838-3-wahrenst@gmx.net Signed-off-by: Florian Fainelli commit ae4d612cc1f23a6137d0978b1620a2af2e201c1a Author: Kent Overstreet Date: Sun Nov 26 21:13:54 2023 -0500 bcachefs: trace_move_extent_start_fail() now includes errcode Renamed from trace_move_extent_alloc_mem_fail, because there are other reasons we colud fail (disk space allocation failure). Signed-off-by: Kent Overstreet commit 5510a4af521c34df339fcceb0f26ace5b1090ad6 Author: Kent Overstreet Date: Sun Nov 26 18:31:11 2023 -0500 bcachefs: Fix split_race livelock bch2_btree_update_start() calculates which nodes are going to have to be split/rewritten, so that we know how many nodes to reserve and how deep in the tree we have to take locks. But btree node merges require inserting two keys into the parent node, not just splits. Signed-off-by: Kent Overstreet commit 03013bb0c6b157630018800a456a08646655ea97 Author: Kent Overstreet Date: Sat Nov 25 23:55:26 2023 -0500 bcachefs: Fix bucket data type for stripe buckets Signed-off-by: Kent Overstreet commit d5bd37872a93e07ef3f9cbd4e2044ba4e17b5021 Author: Kent Overstreet Date: Sat Nov 25 21:42:08 2023 -0500 bcachefs: Add missing validation for jset_entry_data_usage Validation was completely missing for replicas entries in the journal (not the superblock replicas section) - we can't have replicas entries pointing to invalid devices. Signed-off-by: Kent Overstreet commit bbc3a46065d08f9ab3412b1f26bbfa778c444833 Author: Kent Overstreet Date: Fri Nov 24 23:12:45 2023 -0500 bcachefs: Fix zstd compress workspace size zstd apparently lies about the size of the compression workspace it requires; if we double it compression succeeds. Signed-off-by: Kent Overstreet commit af54d778a03853801d681c98c0c2a6c316ef9ca7 Author: Mukesh Ojha Date: Fri Nov 17 20:19:32 2023 +0530 devcoredump: Send uevent once devcd is ready dev_coredumpm() creates a devcoredump device and adds it to the core kernel framework which eventually end up sending uevent to the user space and later creates a symbolic link to the failed device. An application running in userspace may be interested in this symbolic link to get the name of the failed device. In a issue scenario, once uevent sent to the user space it start reading '/sys/class/devcoredump/devcdX/failing_device' to get the actual name of the device which might not been created and it is in its path of creation. To fix this, suppress sending uevent till the failing device symbolic link gets created and send uevent once symbolic link is created successfully. Fixes: 833c95456a70 ("device coredump: add new device coredump class") Signed-off-by: Mukesh Ojha Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/1700232572-25823-1-git-send-email-quic_mojha@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 18d46e76d7c2eedd8577fae67e3f1d4db25018b0 Merge: df60cee26a2e3 0ac1d13a55eb3 Author: Linus Torvalds Date: Tue Nov 28 11:16:04 2023 -0800 Merge tag 'for-6.7-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "A few fixes and message updates: - for simple quotas, handle the case when a snapshot is created and the target qgroup already exists - fix a warning when file descriptor given to send ioctl is not writable - fix off-by-one condition when checking chunk maps - free pages when page array allocation fails during compression read, other cases were handled - fix memory leak on error handling path in ref-verify debugging feature - copy missing struct member 'version' in 64/32bit compat send ioctl - tree-checker verifies inline backref ordering - print messages to syslog on first mount and last unmount - update error messages when reading chunk maps" * tag 'for-6.7-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: send: ensure send_fd is writable btrfs: free the allocated memory if btrfs_alloc_page_array() fails btrfs: fix 64bit compat send ioctl arguments not initializing version member btrfs: make error messages more clear when getting a chunk map btrfs: fix off-by-one when checking chunk map includes logical address btrfs: ref-verify: fix memory leaks in btrfs_ref_tree_mod() btrfs: add dmesg output for first mount and last unmount of a filesystem btrfs: do not abort transaction if there is already an existing qgroup btrfs: tree-checker: add type and sequence check for inline backrefs commit 67d995e069535c32829f5d368d919063492cec6e Author: Yu Kuai Date: Tue Nov 28 20:30:27 2023 +0800 block: warn once for each partition in bio_check_ro() Commit 1b0a151c10a6 ("blk-core: use pr_warn_ratelimited() in bio_check_ro()") fix message storm by limit the rate, however, there will still be lots of message in the long term. Fix it better by warn once for each partition. Signed-off-by: Yu Kuai Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20231128123027.971610-3-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit fad907cffd4bde7384812cf32fcf69becab805cc Author: Ming Lei Date: Tue Nov 28 20:30:26 2023 +0800 block: move .bd_inode into 1st cacheline of block_device The .bd_inode field of block_device is used in IO fast path of blkdev_write_iter() and blkdev_llseek(), so it is more efficient to keep it into the 1st cacheline. .bd_openers is only touched in open()/close(), and .bd_size_lock is only for updating bdev capacity, which is in slow path too. So swap .bd_inode layout with .bd_openers & .bd_size_lock to move .bd_inode into the 1st cache line. Cc: Yu Kuai Signed-off-by: Ming Lei Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20231128123027.971610-2-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 73363c262d6a7d26063da96610f61baf69a70f7c Author: Jens Axboe Date: Tue Nov 28 10:29:58 2023 -0700 io_uring: use fget/fput consistently Normally within a syscall it's fine to use fdget/fdput for grabbing a file from the file table, and it's fine within io_uring as well. We do that via io_uring_enter(2), io_uring_register(2), and then also for cancel which is invoked from the latter. io_uring cannot close its own file descriptors as that is explicitly rejected, and for the cancel side of things, the file itself is just used as a lookup cookie. However, it is more prudent to ensure that full references are always grabbed. For anything threaded, either explicitly in the application itself or through use of the io-wq worker threads, this is what happens anyway. Generalize it and use fget/fput throughout. Also see the below link for more details. Link: https://lore.kernel.org/io-uring/CAG48ez1htVSO3TqmrF8QcX2WFuYTRM-VZ_N10i-VZgbtg=NNqw@mail.gmail.com/ Suggested-by: Jann Horn Signed-off-by: Jens Axboe commit 5cf4f52e6d8aa2d3b7728f568abbf9d42a3af252 Author: Jens Axboe Date: Mon Nov 27 17:54:40 2023 -0700 io_uring: free io_buffer_list entries via RCU mmap_lock nests under uring_lock out of necessity, as we may be doing user copies with uring_lock held. However, for mmap of provided buffer rings, we attempt to grab uring_lock with mmap_lock already held from do_mmap(). This makes lockdep, rightfully, complain: WARNING: possible circular locking dependency detected 6.7.0-rc1-00009-gff3337ebaf94-dirty #4438 Not tainted ------------------------------------------------------ buf-ring.t/442 is trying to acquire lock: ffff00020e1480a8 (&ctx->uring_lock){+.+.}-{3:3}, at: io_uring_validate_mmap_request.isra.0+0x4c/0x140 but task is already holding lock: ffff0000dc226190 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x124/0x264 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&mm->mmap_lock){++++}-{3:3}: __might_fault+0x90/0xbc io_register_pbuf_ring+0x94/0x488 __arm64_sys_io_uring_register+0x8dc/0x1318 invoke_syscall+0x5c/0x17c el0_svc_common.constprop.0+0x108/0x130 do_el0_svc+0x2c/0x38 el0_svc+0x4c/0x94 el0t_64_sync_handler+0x118/0x124 el0t_64_sync+0x168/0x16c -> #0 (&ctx->uring_lock){+.+.}-{3:3}: __lock_acquire+0x19a0/0x2d14 lock_acquire+0x2e0/0x44c __mutex_lock+0x118/0x564 mutex_lock_nested+0x20/0x28 io_uring_validate_mmap_request.isra.0+0x4c/0x140 io_uring_mmu_get_unmapped_area+0x3c/0x98 get_unmapped_area+0xa4/0x158 do_mmap+0xec/0x5b4 vm_mmap_pgoff+0x158/0x264 ksys_mmap_pgoff+0x1d4/0x254 __arm64_sys_mmap+0x80/0x9c invoke_syscall+0x5c/0x17c el0_svc_common.constprop.0+0x108/0x130 do_el0_svc+0x2c/0x38 el0_svc+0x4c/0x94 el0t_64_sync_handler+0x118/0x124 el0t_64_sync+0x168/0x16c From that mmap(2) path, we really just need to ensure that the buffer list doesn't go away from underneath us. For the lower indexed entries, they never go away until the ring is freed and we can always sanely reference those as long as the caller has a file reference. For the higher indexed ones in our xarray, we just need to ensure that the buffer list remains valid while we return the address of it. Free the higher indexed io_buffer_list entries via RCU. With that we can avoid needing ->uring_lock inside mmap(2), and simply hold the RCU read lock around the buffer list lookup and address check. To ensure that the arrayed lookup either returns a valid fully formulated entry via RCU lookup, add an 'is_ready' flag that we access with store and release memory ordering. This isn't needed for the xarray lookups, but doesn't hurt either. Since this isn't a fast path, retain it across both types. Similarly, for the allocated array inside the ctx, ensure we use the proper load/acquire as setup could in theory be running in parallel with mmap. While in there, add a few lockdep checks for documentation purposes. Cc: stable@vger.kernel.org Fixes: c56e022c0a27 ("io_uring: add support for user mapped provided buffer ring") Signed-off-by: Jens Axboe commit 07d6063d3d3beb3168d3ac9fdef7bca81254d983 Author: Jens Axboe Date: Mon Nov 27 17:02:48 2023 -0700 io_uring/kbuf: prune deferred locked cache when tearing down We used to just use our page list for final teardown, which would ensure that we got all the buffers, even the ones that were not on the normal cached list. But while moving to slab for the io_buffers, we know only prune this list, not the deferred locked list that we have. This can cause a leak of memory, if the workload ends up using the intermediate locked list. Fix this by always pruning both lists when tearing down. Fixes: b3a4dbc89d40 ("io_uring/kbuf: Use slab for struct io_buffer objects") Signed-off-by: Jens Axboe commit b10b73c102a2eab91e1cd62a03d6446f1dfecc64 Author: Jens Axboe Date: Tue Nov 28 11:17:25 2023 -0700 io_uring/kbuf: recycle freed mapped buffer ring entries Right now we stash any potentially mmap'ed provided ring buffer range for freeing at release time, regardless of when they get unregistered. Since we're keeping track of these ranges anyway, keep track of their registration state as well, and use that to recycle ranges when appropriate rather than always allocate new ones. The lookup is a basic scan of entries, checking for the best matching free entry. Fixes: c392cbecd8ec ("io_uring/kbuf: defer release of mapped buffer rings") Signed-off-by: Jens Axboe commit cff5f49d433fcd0063c8be7dd08fa5bf190c6c37 Author: Tim Van Patten Date: Wed Nov 15 09:20:43 2023 -0700 cgroup_freezer: cgroup_freezing: Check if not frozen __thaw_task() was recently updated to warn if the task being thawed was part of a freezer cgroup that is still currently freezing: void __thaw_task(struct task_struct *p) { ... if (WARN_ON_ONCE(freezing(p))) goto unlock; This has exposed a bug in cgroup1 freezing where when CGROUP_FROZEN is asserted, the CGROUP_FREEZING bits are not also cleared at the same time. Meaning, when a cgroup is marked FROZEN it continues to be marked FREEZING as well. This causes the WARNING to trigger, because cgroup_freezing() thinks the cgroup is still freezing. There are two ways to fix this: 1. Whenever FROZEN is set, clear FREEZING for the cgroup and all children cgroups. 2. Update cgroup_freezing() to also verify that FROZEN is not set. This patch implements option (2), since it's smaller and more straightforward. Signed-off-by: Tim Van Patten Tested-by: Mark Hasemeyer Fixes: f5d39b020809 ("freezer,sched: Rewrite core freezer logic") Cc: stable@vger.kernel.org # v6.1+ Signed-off-by: Tejun Heo commit c392cbecd8eca4c53f2bf508731257d9d0a21c2d Author: Jens Axboe Date: Mon Nov 27 16:47:04 2023 -0700 io_uring/kbuf: defer release of mapped buffer rings If a provided buffer ring is setup with IOU_PBUF_RING_MMAP, then the kernel allocates the memory for it and the application is expected to mmap(2) this memory. However, io_uring uses remap_pfn_range() for this operation, so we cannot rely on normal munmap/release on freeing them for us. Stash an io_buf_free entry away for each of these, if any, and provide a helper to free them post ->release(). Cc: stable@vger.kernel.org Fixes: c56e022c0a27 ("io_uring: add support for user mapped provided buffer ring") Reported-by: Jann Horn Signed-off-by: Jens Axboe commit b817f1488fca548fe50e2654d84a1956a16a1a8a Author: Lukasz Luba Date: Mon Nov 27 09:28:19 2023 +0000 powercap: DTPM: Fix unneeded conversions to micro-Watts The power values coming from the Energy Model are already in uW. The PowerCap and DTPM frameworks operate on uW, so all places should just use the values from the EM. Fix the code by removing all of the conversion to uW still present in it. Fixes: ae6ccaa65038 (PM: EM: convert power field to micro-Watts precision and align drivers) Cc: 5.19+ # v5.19+ Signed-off-by: Lukasz Luba [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit bb87be267b8ee9b40917fb5bf51be5ddb33c37c2 Author: Gautham R. Shenoy Date: Mon Nov 27 16:41:21 2023 +0530 cpufreq/amd-pstate: Fix the return value of amd_pstate_fast_switch() cpufreq_driver->fast_switch() callback expects a frequency as a return value. amd_pstate_fast_switch() was returning the return value of amd_pstate_update_freq(), which only indicates a success or failure. Fix this by making amd_pstate_fast_switch() return the target_freq when the call to amd_pstate_update_freq() is successful, and return the current frequency from policy->cur when the call to amd_pstate_update_freq() is unsuccessful. Fixes: 4badf2eb1e98 ("cpufreq: amd-pstate: Add ->fast_switch() callback") Acked-by: Huang Rui Reviewed-by: Wyes Karny Reviewed-by: Perry Yuan Cc: 6.4+ # v6.4+ Signed-off-by: Gautham R. Shenoy Signed-off-by: Rafael J. Wysocki commit e0894ff038d86f30614ec16ec26dacb88c8d2bd4 Author: Luke D. Jones Date: Mon Nov 27 12:05:21 2023 +1300 platform/x86: asus-wmi: disable USB0 hub on ROG Ally before suspend ASUS have worked around an issue in XInput where it doesn't support USB selective suspend, which causes suspend issues in Windows. They worked around this by adjusting the MCU firmware to disable the USB0 hub when the screen is switched off during the Microsoft DSM suspend path in ACPI. The issue we have with this however is one of timing - the call the tells the MCU to this isn't able to complete before suspend is done so we call this in a prepare() and add a small msleep() to ensure it is done. This must be done before the screen is switched off to prevent a variety of possible races. Further to this the MCU powersave option must also be disabled as it can cause a number of issues such as: - unreliable resume connection of N-Key - complete loss of N-Key if the power is plugged in while suspended Disabling the powersave option prevents this. Without this the MCU is unable to initialise itself correctly on resume. Signed-off-by: "Luke D. Jones" Tested-by: Philip Mueller Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20231126230521.125708-2-luke@ljones.dev Signed-off-by: Ilpo Järvinen commit 5e1d824f9a283cbf90f25241b66d1f69adb3835b Author: Timothy Pearson Date: Sun Nov 19 09:18:02 2023 -0600 powerpc: Don't clobber f0/vs0 during fp|altivec register save During floating point and vector save to thread data f0/vs0 are clobbered by the FPSCR/VSCR store routine. This has been obvserved to lead to userspace register corruption and application data corruption with io-uring. Fix it by restoring f0/vs0 after FPSCR/VSCR store has completed for all the FP, altivec, VMX register save paths. Tested under QEMU in kvm mode, running on a Talos II workstation with dual POWER9 DD2.2 CPUs. Additional detail (mpe): Typically save_fpu() is called from __giveup_fpu() which saves the FP regs and also *turns off FP* in the tasks MSR, meaning the kernel will reload the FP regs from the thread struct before letting the task use FP again. So in that case save_fpu() is free to clobber f0 because the FP regs no longer hold live values for the task. There is another case though, which is the path via: sys_clone() ... copy_process() dup_task_struct() arch_dup_task_struct() flush_all_to_thread() save_all() That path saves the FP regs but leaves them live. That's meant as an optimisation for a process that's using FP/VSX and then calls fork(), leaving the regs live means the parent process doesn't have to take a fault after the fork to get its FP regs back. The optimisation was added in commit 8792468da5e1 ("powerpc: Add the ability to save FPU without giving it up"). That path does clobber f0, but f0 is volatile across function calls, and typically programs reach copy_process() from userspace via a syscall wrapper function. So in normal usage f0 being clobbered across a syscall doesn't cause visible data corruption. But there is now a new path, because io-uring can call copy_process() via create_io_thread() from the signal handling path. That's OK if the signal is handled as part of syscall return, but it's not OK if the signal is handled due to some other interrupt. That path is: interrupt_return_srr_user() interrupt_exit_user_prepare() interrupt_exit_user_prepare_main() do_notify_resume() get_signal() task_work_run() create_worker_cb() create_io_worker() copy_process() dup_task_struct() arch_dup_task_struct() flush_all_to_thread() save_all() if (tsk->thread.regs->msr & MSR_FP) save_fpu() # f0 is clobbered and potentially live in userspace Note the above discussion applies equally to save_altivec(). Fixes: 8792468da5e1 ("powerpc: Add the ability to save FPU without giving it up") Cc: stable@vger.kernel.org # v4.6+ Closes: https://lore.kernel.org/all/480932026.45576726.1699374859845.JavaMail.zimbra@raptorengineeringinc.com/ Closes: https://lore.kernel.org/linuxppc-dev/480221078.47953493.1700206777956.JavaMail.zimbra@raptorengineeringinc.com/ Tested-by: Timothy Pearson Tested-by: Jens Axboe Signed-off-by: Timothy Pearson [mpe: Reword change log to describe exact path of corruption & other minor tweaks] Signed-off-by: Michael Ellerman Link: https://msgid.link/1921539696.48534988.1700407082933.JavaMail.zimbra@raptorengineeringinc.com commit 91d3d149978ba7b238198dd80e4b823756aa7cfa Author: Heiner Kallweit Date: Sun Nov 26 23:01:02 2023 +0100 r8169: prevent potential deadlock in rtl8169_close ndo_stop() is RTNL-protected by net core, and the worker function takes RTNL as well. Therefore we will deadlock when trying to execute a pending work synchronously. To fix this execute any pending work asynchronously. This will do no harm because netif_running() is false in ndo_stop(), and therefore the work function is effectively a no-op. However we have to ensure that no task is running or pending after rtl_remove_one(), therefore add a call to cancel_work_sync(). Fixes: abe5fc42f9ce ("r8169: use RTNL to protect critical sections") Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/12395867-1d17-4cac-aa7d-c691938fcddf@gmail.com Signed-off-by: Paolo Abeni commit 59d395ed606d8df14615712b0cdcdadb2d962175 Author: Heiner Kallweit Date: Sun Nov 26 19:36:46 2023 +0100 r8169: fix deadlock on RTL8125 in jumbo mtu mode The original change results in a deadlock if jumbo mtu mode is used. Reason is that the phydev lock is held when rtl_reset_work() is called here, and rtl_jumbo_config() calls phy_start_aneg() which also tries to acquire the phydev lock. Fix this by calling rtl_reset_work() asynchronously. Fixes: 621735f59064 ("r8169: fix rare issue with broken rx after link-down on RTL8125") Reported-by: Ian Chen Tested-by: Ian Chen Cc: stable@vger.kernel.org Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/caf6a487-ef8c-4570-88f9-f47a659faf33@gmail.com Signed-off-by: Paolo Abeni commit 01b1e3ca0e5ce47bbae8217d47376ad01b331b07 Author: Michael Roth Date: Fri Nov 3 10:13:54 2023 -0500 efi/unaccepted: Fix off-by-one when checking for overlapping ranges When a task needs to accept memory it will scan the accepting_list to see if any ranges already being processed by other tasks overlap with its range. Due to an off-by-one in the range comparisons, a task might falsely determine that an overlapping range is being accepted, leading to an unnecessary delay before it begins processing the range. Fix the off-by-one in the range comparison to prevent this and slightly improve performance. Fixes: 50e782a86c98 ("efi/unaccepted: Fix soft lockups caused by parallel memory acceptance") Link: https://lore.kernel.org/linux-mm/20231101004523.vseyi5bezgfaht5i@amd.com/T/#me2eceb9906fcae5fe958b3fe88e41f920f8335b6 Reviewed-by: Kirill A. Shutemov Signed-off-by: Michael Roth Acked-by: Vlastimil Babka Signed-off-by: Ard Biesheuvel commit 7f3da4b698bcc21a6df0e7f114af71d53a3e26ac Author: Dan Carpenter Date: Tue Nov 28 09:52:41 2023 +0300 xen/events: fix error code in xen_bind_pirq_msi_to_irq() Return -ENOMEM if xen_irq_init() fails. currently the code returns an uninitialized variable or zero. Fixes: 5dd9ad32d775 ("xen/events: drop xen_allocate_irqs_dynamic()") Signed-off-by: Dan Carpenter Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/3b9ab040-a92e-4e35-b687-3a95890a9ace@moroto.mountain Signed-off-by: Juergen Gross commit db2832309a82b9acc4b8cc33a1831d36507ec13e Author: Juergen Gross Date: Fri Nov 24 08:48:52 2023 +0100 x86/xen: fix percpu vcpu_info allocation Today the percpu struct vcpu_info is allocated via DEFINE_PER_CPU(), meaning that it could cross a page boundary. In this case registering it with the hypervisor will fail, resulting in a panic(). This can easily be fixed by using DEFINE_PER_CPU_ALIGNED() instead, as struct vcpu_info is guaranteed to have a size of 64 bytes, matching the cache line size of x86 64-bit processors (Xen doesn't support 32-bit processors). Fixes: 5ead97c84fa7 ("xen: Core Xen implementation") Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20231124074852.25161-1-jgross@suse.com Signed-off-by: Juergen Gross commit 45b3fae4675dc1d4ee2d7aefa19d85ee4f891377 Author: Gustavo A. R. Silva Date: Sat Nov 25 15:33:58 2023 -0600 neighbour: Fix __randomize_layout crash in struct neighbour Previously, one-element and zero-length arrays were treated as true flexible arrays, even though they are actually "fake" flex arrays. The __randomize_layout would leave them untouched at the end of the struct, similarly to proper C99 flex-array members. However, this approach changed with commit 1ee60356c2dc ("gcc-plugins: randstruct: Only warn about true flexible arrays"). Now, only C99 flexible-array members will remain untouched at the end of the struct, while one-element and zero-length arrays will be subject to randomization. Fix a `__randomize_layout` crash in `struct neighbour` by transforming zero-length array `primary_key` into a proper C99 flexible-array member. Fixes: 1ee60356c2dc ("gcc-plugins: randstruct: Only warn about true flexible arrays") Closes: https://lore.kernel.org/linux-hardening/20231124102458.GB1503258@e124191.cambridge.arm.com/ Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Tested-by: Joey Gouly Link: https://lore.kernel.org/r/ZWJoRsJGnCPdJ3+2@work Signed-off-by: Paolo Abeni commit fd7f98b2e12a3d96a92bde6640657ec7116f4372 Author: Subbaraya Sundeep Date: Sat Nov 25 22:06:57 2023 +0530 octeontx2-pf: Restore TC ingress police rules when interface is up TC ingress policer rules depends on interface receive queue contexts since the bandwidth profiles are attached to RQ contexts. When an interface is brought down all the queue contexts are freed. This in turn frees bandwidth profiles in hardware causing ingress police rules non-functional after the interface is brought up. Fix this by applying all the ingress police rules config to hardware in otx2_open. Also allow adding ingress rules only when interface is running since no contexts exist for the interface when it is down. Fixes: 68fbff68dbea ("octeontx2-pf: Add police action for TC flower") Signed-off-by: Subbaraya Sundeep Link: https://lore.kernel.org/r/1700930217-5707-1-git-send-email-sbhatta@marvell.com Signed-off-by: Paolo Abeni commit 51597219e0cd5157401d4d0ccb5daa4d9961676f Author: Geetha sowjanya Date: Sat Nov 25 22:04:02 2023 +0530 octeontx2-pf: Fix adding mbox work queue entry when num_vfs > 64 When more than 64 VFs are enabled for a PF then mbox communication between VF and PF is not working as mbox work queueing for few VFs are skipped due to wrong calculation of VF numbers. Fixes: d424b6c02415 ("octeontx2-pf: Enable SRIOV and added VF mbox handling") Signed-off-by: Geetha sowjanya Signed-off-by: Subbaraya Sundeep Link: https://lore.kernel.org/r/1700930042-5400-1-git-send-email-sbhatta@marvell.com Signed-off-by: Paolo Abeni commit f71f6ff8c1f682a1cae4e8d7bdeed9d7f76b8f75 Author: Tony Lindgren Date: Fri Nov 24 10:50:56 2023 +0200 bus: ti-sysc: Flush posted write only after srst_udelay Commit 34539b442b3b ("bus: ti-sysc: Flush posted write on enable before reset") caused a regression reproducable on omap4 duovero where the ISS target module can produce interconnect errors on boot. Turns out the registers are not accessible until after a delay for devices needing a ti,sysc-delay-us value. Let's fix this by flushing the posted write only after the reset delay. We do flushing also for ti,sysc-delay-us using devices as that should trigger an interconnect error if the delay is not properly configured. Let's also add some comments while at it. Fixes: 34539b442b3b ("bus: ti-sysc: Flush posted write on enable before reset") Cc: stable@vger.kernel.org Signed-off-by: Tony Lindgren commit e54d628a2721bfbb002c19f6e8ca6746cec7640f Author: Furong Xu <0x1207@gmail.com> Date: Sat Nov 25 14:01:26 2023 +0800 net: stmmac: xgmac: Disable FPE MMC interrupts Commit aeb18dd07692 ("net: stmmac: xgmac: Disable MMC interrupts by default") tries to disable MMC interrupts to avoid a storm of unhandled interrupts, but leaves the FPE(Frame Preemption) MMC interrupts enabled, FPE MMC interrupts can cause the same problem. Now we mask FPE TX and RX interrupts to disable all MMC interrupts. Fixes: aeb18dd07692 ("net: stmmac: xgmac: Disable MMC interrupts by default") Reviewed-by: Larysa Zaremba Signed-off-by: Furong Xu <0x1207@gmail.com> Reviewed-by: Serge Semin Reviewed-by: Wojciech Drewek Link: https://lore.kernel.org/r/20231125060126.2328690-1-0x1207@gmail.com Signed-off-by: Paolo Abeni commit b9c02e1052650af56d4487efa5fade3fb70e3653 Author: Thomas Hellström Date: Mon Nov 6 12:48:27 2023 +0100 drm/gpuvm: Fix deprecated license identifier "GPL-2.0-only" in the license header was incorrectly changed to the now deprecated "GPL-2.0". Fix. Cc: Maxime Ripard Cc: Danilo Krummrich Reported-by: David Edelsohn Closes: https://lore.kernel.org/dri-devel/5lfrhdpkwhpgzipgngojs3tyqfqbesifzu5nf4l5q3nhfdhcf2@25nmiq7tfrew/T/#m5c356d68815711eea30dd94cc6f7ea8cd4344fe3 Fixes: f7749a549b4f ("drm/gpuvm: Dual-licence the drm_gpuvm code GPL-2.0 OR MIT") Signed-off-by: Thomas Hellström Acked-by: Maxime Ripard Acked-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20231106114827.62492-1-thomas.hellstrom@linux.intel.com commit 9b6a59e5db87c2c6b3ca0391176ed4358623d5e4 Author: Linus Walleij Date: Tue Nov 28 00:10:21 2023 +0100 Revert "drm/bridge: panel: Add a device link between drm device and panel device" This reverts commit 199cf07ebd2b0d41185ac79b895547d45610b681. This patch creates bugs on devices where the DRM device is the ancestor of the panel devices. Attempts to fix this have failed because it leads to using device core functionality which is questionable. Reported-by: Linus Walleij Link: https://lore.kernel.org/lkml/CACRpkdaGzXD6HbiX7mVUNJAJtMEPG00Pp6+nJ1P0JrfJ-ArMvQ@mail.gmail.com/T/ Signed-off-by: Linus Walleij Acked-by: Neil Armstrong Link: https://lore.kernel.org/r/20231128-revert-panel-fix-v1-3-69bb05048dae@linaro.org Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231128-revert-panel-fix-v1-3-69bb05048dae@linaro.org commit 8dd926689dfa9d8ee64e4fce202d0fdc91fd69fd Author: Linus Walleij Date: Tue Nov 28 00:10:19 2023 +0100 Revert "driver core: Export device_is_dependent() to modules" This reverts commit 1d5e8f4bf06da86b71cc9169110d1a0e1e7af337. Greg says: "why exactly is this needed? Nothing outside of the driver core should be needing this function, it shouldn't be public at all (I missed that before.) So please, revert it for now, let's figure out why DRM thinks this is needed for it's devices, and yet no other bus/subsystem does." Link: https://lore.kernel.org/dri-devel/2023112739-willing-sighing-6bdd@gregkh/ Signed-off-by: Linus Walleij Acked-by: Neil Armstrong Link: https://lore.kernel.org/r/20231128-revert-panel-fix-v1-1-69bb05048dae@linaro.org Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231128-revert-panel-fix-v1-1-69bb05048dae@linaro.org commit c13f87efa7488fcd5f4d6e89c8f9d5bb072f9e6e Author: Linus Walleij Date: Tue Nov 28 00:10:20 2023 +0100 Revert "drm/bridge: panel: Check device dependency before managing device link" This reverts commit 39d5b6a64ace77d0c11c398d272218df5f939abb. This patch was causing build errors by using an unexported function from the device core, which Greg questions the saneness in exporting. Link: https://lore.kernel.org/lkml/CACRpkdaGzXD6HbiX7mVUNJAJtMEPG00Pp6+nJ1P0JrfJ-ArMvQ@mail.gmail.com/T/ Signed-off-by: Linus Walleij Acked-by: Neil Armstrong Link: https://lore.kernel.org/r/20231128-revert-panel-fix-v1-2-69bb05048dae@linaro.org Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231128-revert-panel-fix-v1-2-69bb05048dae@linaro.org commit 0c349b5001f8bdcead844484c15a0c4dfb341157 Author: Alex Bee Date: Mon Nov 27 19:46:44 2023 +0100 ARM: dts: rockchip: Fix sdmmc_pwren's pinmux setting for RK3128 RK3128's reference design uses sdmmc_pwren pincontrol as GPIO - see [0]. Let's change it in the SoC DT as well. [0] https://github.com/rockchip-linux/kernel/commit/8c62deaf6025 Fixes: a0201bff6259 ("ARM: dts: rockchip: add rk3128 soc dtsi") Signed-off-by: Alex Bee Link: https://lore.kernel.org/r/20231127184643.13314-2-knaerzche@gmail.com Signed-off-by: Heiko Stuebner commit 393cae5f32d640b9798903702018a48c7a45e59f Author: Chao Song Date: Mon Nov 27 20:47:35 2023 +0800 soundwire: intel_ace2x: fix AC timing setting for ACE2.x Start from ACE1.x, DOAISE is added to AC timing control register bit 5, it combines with DOAIS to get effective timing, and has the default value 1. The current code fills DOAIS, DACTQE and DODS bits to a variable initialized to zero, and updates the variable to AC timing control register. With this operation, We change DOAISE to 0, and force a much more aggressive timing. The timing is even unable to form a working waveform on SDA pin. This patch uses read-modify-write operation for the AC timing control register access, thus makes sure those bits not supposed and intended to change are not touched. Signed-off-by: Chao Song Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20231127124735.2080562-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit ad31c629ca3c87f6d557488c1f9faaebfbcd203c Author: Elena Salomatkina Date: Sat Nov 25 00:08:02 2023 +0300 octeontx2-af: Fix possible buffer overflow A loop in rvu_mbox_handler_nix_bandprof_free() contains a break if (idx == MAX_BANDPROF_PER_PFFUNC), but if idx may reach MAX_BANDPROF_PER_PFFUNC buffer '(*req->prof_idx)[layer]' overflow happens before that check. The patch moves the break to the beginning of the loop. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: e8e095b3b370 ("octeontx2-af: cn10k: Bandwidth profiles config support"). Signed-off-by: Elena Salomatkina Reviewed-by: Simon Horman Reviewed-by: Subbaraya Sundeep Link: https://lore.kernel.org/r/20231124210802.109763-1-elena.salomatkina.cmc@gmail.com Signed-off-by: Paolo Abeni commit 99fe9ee56bd2f7358f1bc72551c2f3a6bbddf80a Author: Alex Bee Date: Mon Nov 27 19:14:18 2023 +0100 clk: rockchip: rk3128: Fix SCLK_SDMMC's clock name SCLK_SDMMC is the parent for SCLK_SDMMC_DRV and SCLK_SDMMC_SAMPLE, but used with the (more) correct name sclk_sdmmc. SD card tuning does currently fail as the parent can't be found under that name. There is no need to suffix the name with '0' since RK312x SoCs do have a single sdmmc controller - so rename it to the name which is already used by it's children. Fixes: f6022e88faca ("clk: rockchip: add clock controller for rk3128") Signed-off-by: Alex Bee Link: https://lore.kernel.org/r/20231127181415.11735-6-knaerzche@gmail.com Signed-off-by: Heiko Stuebner commit 98dcc6be3859fb15257750b8e1d4e0eefd2c5e1e Author: Finley Xiao Date: Mon Nov 27 19:14:16 2023 +0100 clk: rockchip: rk3128: Fix aclk_peri_src's parent According to the TRM there are no specific gpll_peri, cpll_peri, gpll_div2_peri or gpll_div3_peri gates, but a single clk_peri_src gate. Instead mux_clk_peri_src directly connects to the plls respectively the pll divider clocks. Fix this by creating a single gated composite. Also rename all occurrences of aclk_peri_src to clk_peri_src, since it is the parent for peri aclks, pclks and hclks. That name also matches the one used in the TRM. Fixes: f6022e88faca ("clk: rockchip: add clock controller for rk3128") Signed-off-by: Finley Xiao [renamed aclk_peri_src -> clk_peri_src and added commit message] Signed-off-by: Alex Bee Link: https://lore.kernel.org/r/20231127181415.11735-4-knaerzche@gmail.com Signed-off-by: Heiko Stuebner commit baaacbff64d9f34b64f294431966d035aeadb81c Author: Kailang Yang Date: Wed Oct 25 15:24:06 2023 +0800 ALSA: hda/realtek: Headset Mic VREF to 100% This platform need to set Mic VREF to 100%. Signed-off-by: Kailang Yang Cc: Link: https://lore.kernel.org/r/0916af40f08a4348a3298a9a59e6967e@realtek.com Signed-off-by: Takashi Iwai commit e199bf52ffda8f98f129728d57244a9cd9ad5623 Author: Krzysztof Kozlowski Date: Fri Nov 24 19:01:36 2023 +0100 soundwire: stream: fix NULL pointer dereference for multi_link If bus is marked as multi_link, but number of masters in the stream is not higher than bus->hw_sync_min_links (bus->multi_link && m_rt_count >= bus->hw_sync_min_links), bank switching should not happen. The first part of do_bank_switch() code properly takes these conditions into account, but second part (sdw_ml_sync_bank_switch()) relies purely on bus->multi_link property. This is not balanced and leads to NULL pointer dereference: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 ... Call trace: wait_for_completion_timeout+0x124/0x1f0 do_bank_switch+0x370/0x6f8 sdw_prepare_stream+0x2d0/0x438 qcom_snd_sdw_prepare+0xa0/0x118 sm8450_snd_prepare+0x128/0x148 snd_soc_link_prepare+0x5c/0xe8 __soc_pcm_prepare+0x28/0x1ec dpcm_be_dai_prepare+0x1e0/0x2c0 dpcm_fe_dai_prepare+0x108/0x28c snd_pcm_do_prepare+0x44/0x68 snd_pcm_action_single+0x54/0xc0 snd_pcm_action_nonatomic+0xe4/0xec snd_pcm_prepare+0xc4/0x114 snd_pcm_common_ioctl+0x1154/0x1cc0 snd_pcm_ioctl+0x54/0x74 Fixes: ce6e74d008ff ("soundwire: Add support for multi link bank switch") Cc: stable@vger.kernel.org Signed-off-by: Krzysztof Kozlowski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231124180136.390621-1-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit edecf1689768452ba1a64b7aaf3a47a817da651a Author: Jens Axboe Date: Mon Nov 27 20:53:52 2023 -0700 io_uring: enable io_mem_alloc/free to be used in other parts In preparation for using these helpers, make them non-static and add them to our internal header. Signed-off-by: Jens Axboe commit ec2610b129b49fd3ba0fbbf1fe988774a1af4a2a Merge: ccf49cebe595e 00a4f8fd9c750 Author: Jakub Kicinski Date: Mon Nov 27 18:12:09 2023 -0800 Merge branch 'selftests-net-fix-a-few-small-compiler-warnings' Willem de Bruijn says: ==================== selftests/net: fix a few small compiler warnings Observed a clang warning when backporting cmsg_sender. Ran the same build against all the .c files under selftests/net. This is clang-14 with -Wall Which is what tools/testing/selftests/net/Makefile also enables. ==================== Link: https://lore.kernel.org/r/20231124171645.1011043-1-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski commit 00a4f8fd9c750f20d8fd4535c71c9caa7ef5ff2f Author: Willem de Bruijn Date: Fri Nov 24 12:15:22 2023 -0500 selftests/net: mptcp: fix uninitialized variable warnings Same init_rng() in both tests. The function reads /dev/urandom to initialize srand(). In case of failure, it falls back onto the entropy in the uninitialized variable. Not sure if this is on purpose. But failure reading urandom should be rare, so just fail hard. While at it, convert to getrandom(). Which man 4 random suggests is simpler and more robust. mptcp_inq.c:525:6: mptcp_connect.c:1131:6: error: variable 'foo' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] Fixes: 048d19d444be ("mptcp: add basic kselftest for mptcp") Fixes: b51880568f20 ("selftests: mptcp: add inq test case") Cc: Florian Westphal Signed-off-by: Willem de Bruijn ---- When input is randomized because this is expected to meaningfully explore edge cases, should we also add 1. logging the random seed to stdout and 2. adding a command line argument to replay from a specific seed I can do this in net-next, if authors find it useful in this case. Reviewed-by: Matthieu Baerts Link: https://lore.kernel.org/r/20231124171645.1011043-5-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski commit 59fef379d453781f0dabfa1f1a1e86e78aee919a Author: Willem de Bruijn Date: Fri Nov 24 12:15:21 2023 -0500 selftests/net: unix: fix unused variable compiler warning Remove an unused variable. diag_uid.c:151:24: error: unused variable 'udr' [-Werror,-Wunused-variable] Fixes: ac011361bd4f ("af_unix: Add test for sock_diag and UDIAG_SHOW_UID.") Signed-off-by: Willem de Bruijn Link: https://lore.kernel.org/r/20231124171645.1011043-4-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski commit 7b29828c5af6841bdeb9fafa32fdfeff7ab9c407 Author: Willem de Bruijn Date: Fri Nov 24 12:15:20 2023 -0500 selftests/net: fix a char signedness issue Signedness of char is signed on x86_64, but unsigned on arm64. Fix the warning building cmsg_sender.c on signed platforms or forced with -fsigned-char: msg_sender.c:455:12: error: implicit conversion from 'int' to 'char' changes value from 128 to -128 [-Werror,-Wconstant-conversion] buf[0] = ICMPV6_ECHO_REQUEST; constant ICMPV6_ECHO_REQUEST is 128. Link: https://lwn.net/Articles/911914 Fixes: de17e305a810 ("selftests: net: cmsg_sender: support icmp and raw sockets") Signed-off-by: Willem de Bruijn Link: https://lore.kernel.org/r/20231124171645.1011043-3-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski commit 088559815477c6f623a5db5993491ddd7facbec7 Author: Willem de Bruijn Date: Fri Nov 24 12:15:19 2023 -0500 selftests/net: ipsec: fix constant out of range Fix a small compiler warning. nr_process must be a signed long: it is assigned a signed long by strtol() and is compared against LONG_MIN and LONG_MAX. ipsec.c:2280:65: error: result of comparison of constant -9223372036854775808 with expression of type 'unsigned int' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if ((errno == ERANGE && (nr_process == LONG_MAX || nr_process == LONG_MIN)) Fixes: bc2652b7ae1e ("selftest/net/xfrm: Add test for ipsec tunnel") Signed-off-by: Willem de Bruijn Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Link: https://lore.kernel.org/r/20231124171645.1011043-2-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski commit df60cee26a2e3d937a319229e335cb3f9c1f16d2 Merge: d095b18f3e222 cd80ce7e68f16 Author: Linus Torvalds Date: Mon Nov 27 17:17:23 2023 -0800 Merge tag '6.7-rc3-smb3-server-fixes' of git://git.samba.org/ksmbd Pull smb server fixes from Steve French: - Memory leak fix - Fix possible deadlock in open - Multiple SMB3 leasing (caching) fixes including: - incorrect open count (found via xfstest generic/002 with leases) - lease breaking incorrect serialization - lease break error handling fix - fix sending async response when lease pending - Async command fix * tag '6.7-rc3-smb3-server-fixes' of git://git.samba.org/ksmbd: ksmbd: don't update ->op_state as OPLOCK_STATE_NONE on error ksmbd: move setting SMB2_FLAGS_ASYNC_COMMAND and AsyncId ksmbd: release interim response after sending status pending response ksmbd: move oplock handling after unlock parent dir ksmbd: separately allocate ci per dentry ksmbd: fix possible deadlock in smb2_open ksmbd: prevent memory leak on error return commit d71f22365a9caca82d424f3a33445de46567e198 Author: Gustavo A. R. Silva Date: Sat Nov 25 15:49:12 2023 -0600 gcc-plugins: randstruct: Update code comment in relayout_struct() Update code comment to clarify that the only element whose layout is not randomized is a proper C99 flexible-array member. This update is complementary to commit 1ee60356c2dc ("gcc-plugins: randstruct: Only warn about true flexible arrays") Signed-off-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/ZWJr2MWDjXLHE8ap@work Fixes: 1ee60356c2dc ("gcc-plugins: randstruct: Only warn about true flexible arrays") Signed-off-by: Kees Cook commit d095b18f3e22257ab5fb0d1eae76bf1c0f5260f8 Merge: 2cc14f52aeb78 32138be394e5d Author: Linus Torvalds Date: Mon Nov 27 16:26:10 2023 -0800 Merge tag 'media/v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab. * tag 'media/v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: pci: mgb4: add COMMON_CLK dependency media: v4l2-subdev: Fix a 64bit bug media: mgb4: Added support for T200 card variant media: vsp1: Remove unbalanced .s_stream(0) calls commit 4e86f32a13af1970d21be94f659cae56bbe487ee Author: Dmitry Antipov Date: Mon Nov 20 14:05:08 2023 +0300 uapi: propagate __struct_group() attributes to the container union Recently the kernel test robot has reported an ARM-specific BUILD_BUG_ON() in an old and unmaintained wil6210 wireless driver. The problem comes from the structure packing rules of old ARM ABI ('-mabi=apcs-gnu'). For example, the following structure is packed to 18 bytes instead of 16: struct poorly_packed { unsigned int a; unsigned int b; unsigned short c; union { struct { unsigned short d; unsigned int e; } __attribute__((packed)); struct { unsigned short d; unsigned int e; } __attribute__((packed)) inner; }; } __attribute__((packed)); To fit it into 16 bytes, it's required to add packed attribute to the container union as well: struct poorly_packed { unsigned int a; unsigned int b; unsigned short c; union { struct { unsigned short d; unsigned int e; } __attribute__((packed)); struct { unsigned short d; unsigned int e; } __attribute__((packed)) inner; } __attribute__((packed)); } __attribute__((packed)); Thanks to Andrew Pinski of GCC team for sorting the things out at https://gcc.gnu.org/pipermail/gcc/2023-November/242888.html. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311150821.cI4yciFE-lkp@intel.com Signed-off-by: Dmitry Antipov Link: https://lore.kernel.org/r/20231120110607.98956-1-dmantipov@yandex.ru Fixes: 50d7bd38c3aa ("stddef: Introduce struct_group() helper macro") Signed-off-by: Kees Cook commit 9099184dec26669bea16ab86e586ad0f90aa7197 Author: ndesaulniers@google.com Date: Fri Nov 17 11:24:02 2023 -0800 MAINTAINERS: refresh LLVM support As discussed at the ClangBuiltLinux '23 meetup (co-located with Linux Plumbers Conf '23), I'll be taking a step back from kernel work to focus on my growing family and helping Google figure out its libc story. So I think it's time to formally hand over the reigns to my co-maintainer Nathan. As such, remove myself from reviewer for: - CLANG CONTROL FLOW INTEGRITY SUPPORT - COMPILER ATTRIBUTES - KERNEL BUILD For CLANG/LLVM BUILD SUPPORT I'm bumping myself down from maintainer to reviewer, adding Bill and Justin, and removing Tom (Tom and I confirmed this via private email; thanks for the work done Tom, ++beers_owed). It has been my pleasure to work with everyone to improve the toolchain portability of the Linux kernel, and to help bring LLVM to the table as a competitor. The work here is not done. I have a few last LLVM patches in the works to improve stack usage of clang which has been our longest standing open issue (getting "rm" inline asm constraints to DTRT is part of that). But looking back I'm incredibly proud of where we are to today relative to where we were when we started the ClangBuiltLinux journey, and am confident that the team and processes we have put in place will continue to be successful. I continue to believe that a rising tide will lift all boats. I identify first and foremost as a Linux kernel developer, and an LLVM dev second. May it be a cold day in hell when that changes. Wake me when you need me. Signed-off-by: Nick Desaulniers Acked-by: Miguel Ojeda Acked-by: Bill Wendling Acked-by: Masahiro Yamada Acked-by: Nathan Chancellor Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231117-maintainers-v1-1-85f2a7422ed9@google.com Signed-off-by: Kees Cook commit 6f007b1406637d3d73d42e41d7e8d9b245185e69 Author: Jens Axboe Date: Mon Nov 27 17:08:19 2023 -0700 io_uring: don't guard IORING_OFF_PBUF_RING with SETUP_NO_MMAP This flag only applies to the SQ and CQ rings, it's perfectly valid to use a mmap approach for the provided ring buffers. Move the check into where it belongs. Cc: stable@vger.kernel.org Fixes: 03d89a2de25b ("io_uring: support for user allocated memory for rings/sqes") Signed-off-by: Jens Axboe commit 0bad281d0ecdf8391b0f42678b663336e7c3ceb0 Author: Daniel Borkmann Date: Mon Nov 27 21:05:33 2023 +0100 netkit: Reject IFLA_NETKIT_PEER_INFO in netkit_change_link The IFLA_NETKIT_PEER_INFO attribute can only be used during device creation, but not via changelink callback. Hence reject it there. Fixes: 35dfaad7188c ("netkit, bpf: Add bpf programmable net device") Signed-off-by: Daniel Borkmann Acked-by: Nikolay Aleksandrov Cc: Jakub Kicinski Reviewed-by: Jakub Kicinski Link: https://lore.kernel.org/r/e86a277a1e8d3b19890312779e42f790b0605ea4.1701115314.git.daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit e8d66d02defd3256a31c0ec09af63382b8682c0e Author: Jagadeesh Kona Date: Tue Nov 7 12:15:45 2023 +0530 clk: qcom: Fix SM_CAMCC_8550 dependencies SM_GCC_8550 depends on ARM64 but it is selected by SM_CAMCC_8550, which should have the same dependencies as SM_GCC_8550 to avoid the below Kconfig warning reported by kernel test robot. WARNING: unmet direct dependencies detected for SM_GCC_8550 Depends on [n]: COMMON_CLK [=y] && COMMON_CLK_QCOM [=y] && (ARM64 || COMPILE_TEST [=n]) Selected by [y]: - SM_CAMCC_8550 [=y] && COMMON_CLK [=y] && COMMON_CLK_QCOM [=y] Fixes: ccc4e6a061a2 ("clk: qcom: camcc-sm8550: Add camera clock controller driver for SM8550") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311062309.XugQH7AH-lkp@intel.com/ Signed-off-by: Jagadeesh Kona Link: https://lore.kernel.org/r/20231107064545.13120-1-quic_jkona@quicinc.com Reviewed-by: Dmitry Baryshkov Tested-by: Randy Dunlap Reviewed-by: Randy Dunlap Signed-off-by: Stephen Boyd commit d8b90d600aff181936457f032d116dbd8534db06 Author: Ewan D. Milne Date: Mon Nov 27 15:56:57 2023 -0500 nvme: check for valid nvme_identify_ns() before using it When scanning namespaces, it is possible to get valid data from the first call to nvme_identify_ns() in nvme_alloc_ns(), but not from the second call in nvme_update_ns_info_block(). In particular, if the NSID becomes inactive between the two commands, a storage device may return a buffer filled with zero as per 4.1.5.1. In this case, we can get a kernel crash due to a divide-by-zero in blk_stack_limits() because ns->lba_shift will be set to zero. PID: 326 TASK: ffff95fec3cd8000 CPU: 29 COMMAND: "kworker/u98:10" #0 [ffffad8f8702f9e0] machine_kexec at ffffffff91c76ec7 #1 [ffffad8f8702fa38] __crash_kexec at ffffffff91dea4fa #2 [ffffad8f8702faf8] crash_kexec at ffffffff91deb788 #3 [ffffad8f8702fb00] oops_end at ffffffff91c2e4bb #4 [ffffad8f8702fb20] do_trap at ffffffff91c2a4ce #5 [ffffad8f8702fb70] do_error_trap at ffffffff91c2a595 #6 [ffffad8f8702fbb0] exc_divide_error at ffffffff928506e6 #7 [ffffad8f8702fbd0] asm_exc_divide_error at ffffffff92a00926 [exception RIP: blk_stack_limits+434] RIP: ffffffff92191872 RSP: ffffad8f8702fc80 RFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff95efa0c91800 RCX: 0000000000000001 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: 00000000ffffffff R8: ffff95fec7df35a8 R9: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: ffff95fed33c09a8 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 #8 [ffffad8f8702fce0] nvme_update_ns_info_block at ffffffffc06d3533 [nvme_core] #9 [ffffad8f8702fd18] nvme_scan_ns at ffffffffc06d6fa7 [nvme_core] This happened when the check for valid data was moved out of nvme_identify_ns() into one of the callers. Fix this by checking in both callers. Link: https://bugzilla.kernel.org/show_bug.cgi?id=218186 Fixes: 0dd6fff2aad4 ("nvme: bring back auto-removal of deleted namespaces during sequential scan") Cc: stable@vger.kernel.org Signed-off-by: Ewan D. Milne Signed-off-by: Keith Busch commit d79972789d17499b6091ded2fc0c6763c501a5ba Author: Luca Ceresoli Date: Thu Nov 23 15:47:18 2023 +0100 of: dynamic: Fix of_reconfig_get_state_change() return value documentation The documented numeric return values do not match the actual returned values. Fix them by using the enum names instead of raw numbers. Fixes: b53a2340d0d3 ("of/reconfig: Add of_reconfig_get_state_change() of notifier helper.") Signed-off-by: Luca Ceresoli Link: https://lore.kernel.org/r/20231123-fix-of_reconfig_get_state_change-docs-v1-1-f51892050ff9@bootlin.com Signed-off-by: Rob Herring commit 6ba21d02ae99b216b41a689b20edb5329e684b31 Merge: 2cc14f52aeb78 8f96e29aae313 Author: Rafael J. Wysocki Date: Mon Nov 27 21:36:17 2023 +0100 Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Merge ARM cpufreq fixes for 6.7-rc4 from Viresh Kumar. These fix issues related to power domains in the qcom cpufreq driver and an OPP-related issue in the imx6q cpufreq driver. * 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: pmdomain: qcom: rpmpd: Set GENPD_FLAG_ACTIVE_WAKEUP cpufreq: qcom-nvmem: Preserve PM domain votes in system suspend cpufreq: qcom-nvmem: Enable virtual power domain devices cpufreq: imx6q: Don't disable 792 Mhz OPP unnecessarily commit 172c48caed91a978bca078042222d09baea13717 Author: Hans de Goede Date: Mon Nov 27 15:37:41 2023 +0100 ACPI: video: Use acpi_video_device for cooling-dev driver data The acpi_video code was storing the acpi_video_device as driver_data in the acpi_device children of the acpi_video_bus acpi_device. But the acpi_video driver only binds to the bus acpi_device. It uses, but does not bind to, the children. Since it is not the driver it should not be using the driver_data of the children's acpi_device-s. Since commit 0d16710146a1 ("ACPI: bus: Set driver_data to NULL every time .add() fails") the childen's driver_data ends up getting set to NULL after a driver fails to bind to the children leading to a NULL pointer deref in video_get_max_state when registering the cooling-dev: [ 3.148958] BUG: kernel NULL pointer dereference, address: 0000000000000090 [ 3.149015] Hardware name: Sony Corporation VPCSB2X9R/VAIO, BIOS R2087H4 06/15/2012 [ 3.149021] RIP: 0010:video_get_max_state+0x17/0x30 [video] [ 3.149105] Call Trace: [ 3.149110] [ 3.149114] ? __die+0x23/0x70 [ 3.149126] ? page_fault_oops+0x171/0x4e0 [ 3.149137] ? exc_page_fault+0x7f/0x180 [ 3.149147] ? asm_exc_page_fault+0x26/0x30 [ 3.149158] ? video_get_max_state+0x17/0x30 [video 9b6f3f0d19d7b4a0e2df17a2d8b43bc19c2ed71f] [ 3.149176] ? __pfx_video_get_max_state+0x10/0x10 [video 9b6f3f0d19d7b4a0e2df17a2d8b43bc19c2ed71f] [ 3.149192] __thermal_cooling_device_register.part.0+0xf2/0x2f0 [ 3.149205] acpi_video_bus_register_backlight.part.0.isra.0+0x414/0x570 [video 9b6f3f0d19d7b4a0e2df17a2d8b43bc19c2ed71f] [ 3.149227] acpi_video_register_backlight+0x57/0x80 [video 9b6f3f0d19d7b4a0e2df17a2d8b43bc19c2ed71f] [ 3.149245] intel_acpi_video_register+0x68/0x90 [i915 1f3a758130b32ef13d301d4f8f78c7d766d57f2a] [ 3.149669] intel_display_driver_register+0x28/0x50 [i915 1f3a758130b32ef13d301d4f8f78c7d766d57f2a] [ 3.150064] i915_driver_probe+0x790/0xb90 [i915 1f3a758130b32ef13d301d4f8f78c7d766d57f2a] [ 3.150402] local_pci_probe+0x45/0xa0 [ 3.150412] pci_device_probe+0xc1/0x260 Fix this by directly using the acpi_video_device as devdata for the cooling-device, which avoids the need to set driver-data on the children at all. Fixes: 0d16710146a1 ("ACPI: bus: Set driver_data to NULL every time .add() fails") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9718 Cc: 6.6+ # 6.6+ Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 95ba893c9f4feb836ddce627efd0bb6af6667031 Author: Christian König Date: Tue Nov 14 13:37:09 2023 +0100 dma-buf: fix check in dma_resv_add_fence It's valid to add the same fence multiple times to a dma-resv object and we shouldn't need one extra slot for each. Signed-off-by: Christian König Reviewed-by: Thomas Hellström Fixes: a3f7c10a269d5 ("dma-buf/dma-resv: check if the new fence is really later") Cc: stable@vger.kernel.org # v5.19+ Link: https://patchwork.freedesktop.org/patch/msgid/20231115093035.1889-1-christian.koenig@amd.com commit e3139cef8257fcab1725441e2fd5fd0ccb5481b1 Author: Maurizio Lombardi Date: Thu Nov 23 15:07:41 2023 +0100 nvme-core: fix a memory leak in nvme_ns_info_from_identify() In case of error, free the nvme_id_ns structure that was allocated by nvme_identify_ns(). Signed-off-by: Maurizio Lombardi Reviewed-by: Sagi Grimberg Reviewed-by: Kanchan Joshi Signed-off-by: Keith Busch commit 136cfcb8dce9bc7a17a8d32e497f4dfe80dd357d Author: Mark O'Donovan Date: Fri Nov 24 20:56:59 2023 +0000 nvme: fine-tune sending of first keep-alive Keep-alive commands are sent half-way through the kato period. This normally works well but fails when the keep-alive system is started when we are more than half way through the kato. This can happen on larger setups or due to host delays. With this change we now time the initial keep-alive command from the controller initialisation time, rather than the keep-alive mechanism activation time. Signed-off-by: Mark O'Donovan Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 76cab6f4fd63129e852eb15e14d6d359b57e797f Author: Yi Zhang Date: Mon Nov 27 12:00:26 2023 +0800 ndtest: fix typo class_regster -> class_register Fixes: dd6cad2dcb58 ("testing: nvdimm: make struct class structures constant") Signed-off-by: Yi Zhang Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20231127040026.362729-1-yi.zhang@redhat.com Signed-off-by: Greg Kroah-Hartman commit ded965834b156c93dd914b0c6952e8f77929cf84 Author: Michael Walle Date: Thu Nov 23 14:49:27 2023 +0100 dt-bindings: display: mediatek: dsi: remove Xinlei's mail Xinlei Lee's mail is bouncing: : host mailgw02.mediatek.com[216.200.240.185] said: 550 Relaying mail to xinlei.lee@mediatek.com is not allowed (in reply to RCPT TO command) Remove it. Signed-off-by: Michael Walle Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231123134927.2034024-1-mwalle@kernel.org Signed-off-by: Rob Herring commit 93dc6cd15f207be502739072ad122fa5ac812908 Author: Krzysztof Kozlowski Date: Fri Nov 24 10:50:31 2023 +0100 arm64: dts: rockchip: minor whitespace cleanup around '=' The DTS code coding style expects exactly one space before and after '=' sign. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231124095031.58555-2-krzysztof.kozlowski@linaro.org Signed-off-by: Heiko Stuebner commit 076a948f5ad0da8a4438fdb3ec1b4a473084b40a Author: Krzysztof Kozlowski Date: Fri Nov 24 10:50:30 2023 +0100 ARM: dts: rockchip: minor whitespace cleanup around '=' The DTS code coding style expects exactly one space before and after '=' sign. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231124095031.58555-1-krzysztof.kozlowski@linaro.org Signed-off-by: Heiko Stuebner commit ae2667cd8a479bb5abd6e24c12fcc9ef5bc06d75 Author: Brett Creeley Date: Wed Nov 22 11:25:32 2023 -0800 vfio/pds: Fix possible sleep while in atomic context The driver could possibly sleep while in atomic context resulting in the following call trace while CONFIG_DEBUG_ATOMIC_SLEEP=y is set: BUG: sleeping function called from invalid context at kernel/locking/mutex.c:283 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 2817, name: bash preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 Call Trace: dump_stack_lvl+0x36/0x50 __might_resched+0x123/0x170 mutex_lock+0x1e/0x50 pds_vfio_put_lm_file+0x1e/0xa0 [pds_vfio_pci] pds_vfio_put_save_file+0x19/0x30 [pds_vfio_pci] pds_vfio_state_mutex_unlock+0x2e/0x80 [pds_vfio_pci] pci_reset_function+0x4b/0x70 reset_store+0x5b/0xa0 kernfs_fop_write_iter+0x137/0x1d0 vfs_write+0x2de/0x410 ksys_write+0x5d/0xd0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 This can happen if pds_vfio_put_restore_file() and/or pds_vfio_put_save_file() grab the mutex_lock(&lm_file->lock) while the spin_lock(&pds_vfio->reset_lock) is held, which can happen during while calling pds_vfio_state_mutex_unlock(). Fix this by changing the reset_lock to reset_mutex so there are no such conerns. Also, make sure to destroy the reset_mutex in the driver specific VFIO device release function. This also fixes a spinlock bad magic BUG that was caused by not calling spinlock_init() on the reset_lock. Since, the lock is being changed to a mutex, make sure to call mutex_init() on it. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/kvm/1f9bc27b-3de9-4891-9687-ba2820c1b390@moroto.mountain/ Fixes: bb500dbe2ac6 ("vfio/pds: Add VFIO live migration support") Signed-off-by: Brett Creeley Reviewed-by: Shannon Nelson Link: https://lore.kernel.org/r/20231122192532.25791-3-brett.creeley@amd.com Signed-off-by: Alex Williamson commit 91aeb563bd4332e2988f8c0f64f125c4ecb5bcb3 Author: Brett Creeley Date: Wed Nov 22 11:25:31 2023 -0800 vfio/pds: Fix mutex lock->magic != lock warning The following BUG was found when running on a kernel with CONFIG_DEBUG_MUTEXES=y set: DEBUG_LOCKS_WARN_ON(lock->magic != lock) RIP: 0010:mutex_trylock+0x10d/0x120 Call Trace: ? __warn+0x85/0x140 ? mutex_trylock+0x10d/0x120 ? report_bug+0xfc/0x1e0 ? handle_bug+0x3f/0x70 ? exc_invalid_op+0x17/0x70 ? asm_exc_invalid_op+0x1a/0x20 ? mutex_trylock+0x10d/0x120 ? mutex_trylock+0x10d/0x120 pds_vfio_reset+0x3a/0x60 [pds_vfio_pci] pci_reset_function+0x4b/0x70 reset_store+0x5b/0xa0 kernfs_fop_write_iter+0x137/0x1d0 vfs_write+0x2de/0x410 ksys_write+0x5d/0xd0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 As shown, lock->magic != lock. This is because mutex_init(&pds_vfio->state_mutex) is called in the VFIO open path. So, if a reset is initiated before the VFIO device is opened the mutex will have never been initialized. Fix this by calling mutex_init(&pds_vfio->state_mutex) in the VFIO init path. Also, don't destroy the mutex on close because the device may be re-opened, which would cause mutex to be uninitialized. Fix this by implementing a driver specific vfio_device_ops.release callback that destroys the mutex before calling vfio_pci_core_release_dev(). Fixes: bb500dbe2ac6 ("vfio/pds: Add VFIO live migration support") Signed-off-by: Brett Creeley Reviewed-by: Shannon Nelson Link: https://lore.kernel.org/r/20231122192532.25791-2-brett.creeley@amd.com Signed-off-by: Alex Williamson commit 7b4c93a50a2ebbbaf656cc4fa6aca74a6166d85b Author: Peter Ujfalusi Date: Mon Nov 27 13:16:58 2023 +0200 ALSA: hda: intel-nhlt: Ignore vbps when looking for DMIC 32 bps format When looking up DMIC blob from the NHLT table and the format is 32 bits, ignore the vbps matching for 32 bps for DMIC since some NHLT table have the vbps as 24, some have it as 32. The DMIC hardware supports only one type of 32 bit sample size, which is 24 bit sampling on the MSB side and bits[1:0] is used for indicating the channel number. Signed-off-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20231127111658.17275-1-peter.ujfalusi@linux.intel.com Signed-off-by: Takashi Iwai commit 1d5e8f4bf06da86b71cc9169110d1a0e1e7af337 Author: Liu Ying Date: Mon Nov 27 13:14:13 2023 +0800 driver core: Export device_is_dependent() to modules Export device_is_dependent() since the drm_kms_helper module is starting to use it. Signed-off-by: Liu Ying Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20231127051414.3783108-2-victor.liu@nxp.com commit 820d070feb668aab5bc9413c285a1dda2a70e076 Author: Jens Axboe Date: Fri Nov 24 21:02:01 2023 -0700 io_uring: don't allow discontig pages for IORING_SETUP_NO_MMAP io_sqes_map() is used rather than io_mem_alloc(), if the application passes in memory for mapping rather than have the kernel allocate it and then mmap(2) the ranges. This then calls __io_uaddr_map() to perform the page mapping and pinning, which checks if we end up with the same pages, if more than one page is mapped. But this check is incorrect and only checks if the first and last pages are the same, where it really should be checking if the mapped pages are contigous. This allows mapping a single normal page, or a huge page range. Down the line we can add support for remapping pages to be virtually contigous, which is really all that io_uring cares about. Cc: stable@vger.kernel.org Fixes: 03d89a2de25b ("io_uring: support for user allocated memory for rings/sqes") Reported-by: Jann Horn Signed-off-by: Jens Axboe commit 0cb19e50a911aaadf49eed120392e429d6e1fa0c Author: Ulf Hansson Date: Mon Nov 27 14:50:33 2023 +0100 pmdomain: arm: Avoid polling for scmi_perf_domain It was a mistake to prefer polling based mode when setting a performance level for a domain. Let's instead rely on the protocol to decide what is best and thus avoid polling when possible. Reported-by: Nikunj Kela Fixes: 2af23ceb8624 ("pmdomain: arm: Add the SCMI performance domain") Signed-off-by: Ulf Hansson Reviewed-by: Sudeep Holla Link: https://lore.kernel.org/r/20231127135033.136442-1-ulf.hansson@linaro.org commit ee6236027218f8531916f1c5caa5dc330379f287 Author: Su Hui Date: Mon Nov 20 17:55:26 2023 +0800 misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write Clang static analyzer complains that value stored to 'rets' is never read.Let 'buf_len = -EOVERFLOW' to make sure we can return '-EOVERFLOW'. Fixes: 8c8d964ce90f ("mei: move hbuf_depth from the mei device to the hw modules") Signed-off-by: Su Hui Link: https://lore.kernel.org/r/20231120095523.178385-2-suhui@nfschina.com Signed-off-by: Greg Kroah-Hartman commit 8f06aee8089cf42fd99a20184501bd1347ce61b9 Author: Su Hui Date: Mon Nov 20 17:55:23 2023 +0800 misc: mei: client.c: return negative error code in mei_cl_write mei_msg_hdr_init() return negative error code, rets should be 'PTR_ERR(mei_hdr)' rather than '-PTR_ERR(mei_hdr)'. Fixes: 0cd7c01a60f8 ("mei: add support for mei extended header.") Signed-off-by: Su Hui Link: https://lore.kernel.org/r/20231120095523.178385-1-suhui@nfschina.com Signed-off-by: Greg Kroah-Hartman commit be6f9a39969a4ad01f0051a9b94af6e7f4d2d7ac Author: Alexander Usyskin Date: Sun Nov 26 11:24:49 2023 +0200 mei: pxp: fix mei_pxp_send_message return value mei_pxp_send_message() should return zero on success and cannot propagate number of bytes as returned by internally called mei_cldev_send(). Fixes: ee5cb39348e6 ("mei: pxp: recover from recv fail under memory pressure") Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20231126092449.88310-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit 2a9c713825b3127ece11984abf973672c9779518 Author: Su Hui Date: Mon Nov 20 17:10:47 2023 +0800 phy: sunplus: return negative error code in sp_usb_phy_probe devm_phy_create() return negative error code, 'ret' should be 'PTR_ERR(phy)' rather than '-PTR_ERR(phy)'. Fixes: 99d9ccd97385 ("phy: usb: Add USB2.0 phy driver for Sunplus SP7021") Signed-off-by: Su Hui Link: https://lore.kernel.org/r/20231120091046.163781-1-suhui@nfschina.com Signed-off-by: Vinod Koul commit 06f76e464ac81c6915430b7155769ea4ef16efe4 Author: Michael Walle Date: Thu Nov 23 12:02:02 2023 +0100 phy: mediatek: mipi: mt8183: fix minimal supported frequency The lowest supported clock frequency of the PHY is 125MHz (see also mtk_mipi_tx_pll_enable()), but the clamping in .round_rate() has the wrong minimal value, which will make the .enable() op return -EINVAL on low frequencies. Fix the minimal clamping value. Fixes: efda51a58b4a ("drm/mediatek: add mipi_tx driver for mt8183") Signed-off-by: Michael Walle Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231123110202.2025585-1-mwalle@kernel.org Signed-off-by: Vinod Koul commit ac43c9122e4287bbdbe91e980fc2528acb72cc1e Author: Yaxiong Tian Date: Wed Nov 22 16:02:43 2023 +0800 thunderbolt: Fix memory leak in margining_port_remove() The dentry returned by debugfs_lookup() needs to be released by calling dput() which is missing in margining_port_remove(). Fix this by calling debugfs_lookup_and_remove() that combines both and avoids the memory leak. Fixes: d0f1e0c2a699 ("thunderbolt: Add support for receiver lane margining") Cc: stable@vger.kernel.org Signed-off-by: Yaxiong Tian Signed-off-by: Mika Westerberg commit 4ded3bfe1db655367642aadba91aee770cbab317 Author: Johannes Berg Date: Fri Nov 24 17:25:29 2023 +0100 wifi: mac80211: use wiphy locked debugfs for sdata/link The debugfs files for netdevs (sdata) and links are removed with the wiphy mutex held, which may deadlock. Use the new wiphy locked debugfs to avoid that. Signed-off-by: Johannes Berg commit 3d529cd11f2b6c1c3b8e084269152eb30fbb96f5 Author: Johannes Berg Date: Fri Nov 24 17:25:28 2023 +0100 wifi: mac80211: use wiphy locked debugfs helpers for agg_status The read is currently with RCU and the write can deadlock, convert both for the sake of illustration. Make mac80211 depend on cfg80211 debugfs to get the helpers, but mac80211 debugfs without it does nothing anyway. This also required some adjustments in ath9k. Signed-off-by: Johannes Berg commit b590b9ae1efc30e52f81d95cdb2519a4c248b965 Author: Johannes Berg Date: Fri Nov 24 17:25:27 2023 +0100 wifi: cfg80211: add locked debugfs wrappers Add wrappers for debugfs files that should be called with the wiphy mutex held, while the file is also to be removed under the wiphy mutex. This could otherwise deadlock when a file is trying to acquire the wiphy mutex while the code removing it holds the mutex but waits for the removal. This actually works by pushing the execution of the read or write handler to a wiphy work that can be cancelled using the debugfs cancellation API. Signed-off-by: Johannes Berg commit 8c88a474357ead632b07c70bf7f119ace8c3b39e Author: Johannes Berg Date: Fri Nov 24 17:25:26 2023 +0100 debugfs: add API to allow debugfs operations cancellation In some cases there might be longer-running hardware accesses in debugfs files, or attempts to acquire locks, and we want to still be able to quickly remove the files. Introduce a cancellations API to use inside the debugfs handler functions to be able to cancel such operations on a per-file basis. Acked-by: Greg Kroah-Hartman Signed-off-by: Johannes Berg commit f4acfcd4deb158b96595250cc332901b282d15b0 Author: Johannes Berg Date: Fri Nov 24 17:25:25 2023 +0100 debugfs: annotate debugfs handlers vs. removal with lockdep When you take a lock in a debugfs handler but also try to remove the debugfs file under that lock, things can deadlock since the removal has to wait for all users to finish. Add lockdep annotations in debugfs_file_get()/_put() to catch such issues. Acked-by: Greg Kroah-Hartman Signed-off-by: Johannes Berg commit 0ed04a1847a10297595ac24dc7d46b35fb35f90a Author: Johannes Berg Date: Fri Nov 24 17:25:24 2023 +0100 debugfs: fix automount d_fsdata usage debugfs_create_automount() stores a function pointer in d_fsdata, but since commit 7c8d469877b1 ("debugfs: add support for more elaborate ->d_fsdata") debugfs_release_dentry() will free it, now conditionally on DEBUGFS_FSDATA_IS_REAL_FOPS_BIT, but that's not set for the function pointer in automount. As a result, removing an automount dentry would attempt to free the function pointer. Luckily, the only user of this (tracing) never removes it. Nevertheless, it's safer if we just handle the fsdata in one way, namely either DEBUGFS_FSDATA_IS_REAL_FOPS_BIT or allocated. Thus, change the automount to allocate it, and use the real_fops in the data to indicate whether or not automount is filled, rather than adding a type tag. At least for now this isn't actually needed, but the next changes will require it. Also check in debugfs_file_get() that it gets only called on regular files, just to make things clearer. Acked-by: Greg Kroah-Hartman Signed-off-by: Johannes Berg commit e378c7de74620051c3be899a8c2506c25d23049d Author: Kunwu Chan Date: Wed Nov 22 11:26:08 2023 +0800 iommu/vt-d: Set variable intel_dirty_ops to static Fix the following warning: drivers/iommu/intel/iommu.c:302:30: warning: symbol 'intel_dirty_ops' was not declared. Should it be static? This variable is only used in its defining file, so it should be static. Fixes: f35f22cc760e ("iommu/vt-d: Access/Dirty bit support for SS domains") Signed-off-by: Kunwu Chan Reviewed-by: Jason Gunthorpe Reviewed-by: Joao Martins Link: https://lore.kernel.org/r/20231120101025.1103404-1-chentao@kylinos.cn Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit e7ad6c2a4b1aa710db94060b716f53c812cef565 Author: Lu Baolu Date: Wed Nov 22 11:26:07 2023 +0800 iommu/vt-d: Fix incorrect cache invalidation for mm notification Commit 6bbd42e2df8f ("mmu_notifiers: call invalidate_range() when invalidating TLBs") moved the secondary TLB invalidations into the TLB invalidation functions to ensure that all secondary TLB invalidations happen at the same time as the CPU invalidation and added a flush-all type of secondary TLB invalidation for the batched mode, where a range of [0, -1UL) is used to indicates that the range extends to the end of the address space. However, using an end address of -1UL caused an overflow in the Intel IOMMU driver, where the end address was rounded up to the next page. As a result, both the IOTLB and device ATC were not invalidated correctly. Add a flush all helper function and call it when the invalidation range is from 0 to -1UL, ensuring that the entire caches are invalidated correctly. Fixes: 6bbd42e2df8f ("mmu_notifiers: call invalidate_range() when invalidating TLBs") Cc: stable@vger.kernel.org Cc: Huang Ying Cc: Alistair Popple Tested-by: Luo Yuzhang # QAT Tested-by: Tony Zhu # DSA Reviewed-by: Jason Gunthorpe Reviewed-by: Alistair Popple Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20231117090933.75267-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 85b80fdffa867d75dfb9084a839e7949e29064e8 Author: Abdul Halim, Mohd Syazwan Date: Wed Nov 22 11:26:06 2023 +0800 iommu/vt-d: Add MTL to quirk list to skip TE disabling The VT-d spec requires (10.4.4 Global Command Register, TE field) that: Hardware implementations supporting DMA draining must drain any in-flight DMA read/write requests queued within the Root-Complex before switching address translation on or off and reflecting the status of the command through the TES field in the Global Status register. Unfortunately, some integrated graphic devices fail to do so after some kind of power state transition. As the result, the system might stuck in iommu_disable_translation(), waiting for the completion of TE transition. Add MTL to the quirk list for those devices and skips TE disabling if the qurik hits. Fixes: b1012ca8dc4f ("iommu/vt-d: Skip TE disabling on quirky gfx dedicated iommu") Cc: stable@vger.kernel.org Signed-off-by: Abdul Halim, Mohd Syazwan Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20231116022324.30120-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 9a16ab9d640274b20813d2d17475e18d3e99d834 Author: Lu Baolu Date: Wed Nov 22 11:26:05 2023 +0800 iommu/vt-d: Make context clearing consistent with context mapping In the iommu probe_device path, domain_context_mapping() allows setting up the context entry for a non-PCI device. However, in the iommu release_device path, domain_context_clear() only clears context entries for PCI devices. Make domain_context_clear() behave consistently with domain_context_mapping() by clearing context entries for both PCI and non-PCI devices. Fixes: 579305f75d34 ("iommu/vt-d: Update to use PCI DMA aliases") Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20231114011036.70142-4-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit da37dddcf4caf015c400a930301d2ee27a7a15fb Author: Lu Baolu Date: Wed Nov 22 11:26:04 2023 +0800 iommu/vt-d: Disable PCI ATS in legacy passthrough mode When IOMMU hardware operates in legacy mode, the TT field of the context entry determines the translation type, with three supported types (Section 9.3 Context Entry): - DMA translation without device TLB support - DMA translation with device TLB support - Passthrough mode with translated and translation requests blocked Device TLB support is absent when hardware is configured in passthrough mode. Disable the PCI ATS feature when IOMMU is configured for passthrough translation type in legacy (non-scalable) mode. Fixes: 0faa19a1515f ("iommu/vt-d: Decouple PASID & PRI enabling from SVA") Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20231114011036.70142-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 0f5432a9b839847dcfe9fa369d72e3d646102ddf Author: Lu Baolu Date: Wed Nov 22 11:26:03 2023 +0800 iommu/vt-d: Omit devTLB invalidation requests when TES=0 The latest VT-d spec indicates that when remapping hardware is disabled (TES=0 in Global Status Register), upstream ATS Invalidation Completion requests are treated as UR (Unsupported Request). Consequently, the spec recommends in section 4.3 Handling of Device-TLB Invalidations that software refrain from submitting any Device-TLB invalidation requests when address remapping hardware is disabled. Verify address remapping hardware is enabled prior to submitting Device- TLB invalidation requests. Fixes: 792fb43ce2c9 ("iommu/vt-d: Enable Intel IOMMU scalable mode by default") Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20231114011036.70142-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit e645c20e8e9cde549bc233435d3c1338e1cd27fe Author: Lu Baolu Date: Wed Nov 22 11:26:02 2023 +0800 iommu/vt-d: Support enforce_cache_coherency only for empty domains The enforce_cache_coherency callback ensures DMA cache coherency for devices attached to the domain. Intel IOMMU supports enforced DMA cache coherency when the Snoop Control bit in the IOMMU's extended capability register is set. Supporting it differs between legacy and scalable modes. In legacy mode, it's supported page-level by setting the SNP field in second-stage page-table entries. In scalable mode, it's supported in PASID-table granularity by setting the PGSNP field in PASID-table entries. In legacy mode, mappings before attaching to a device have SNP fields cleared, while mappings after the callback have them set. This means partial DMAs are cache coherent while others are not. One possible fix is replaying mappings and flipping SNP bits when attaching a domain to a device. But this seems to be over-engineered, given that all real use cases just attach an empty domain to a device. To meet practical needs while reducing mode differences, only support enforce_cache_coherency on a domain without mappings if SNP field is used. Fixes: fc0051cb9590 ("iommu/vt-d: Check domain force_snooping against attached devices") Signed-off-by: Lu Baolu Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20231114011036.70142-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 487635756198cad563feb47539c6a37ea57f1dae Author: Helge Deller Date: Mon Nov 27 10:39:26 2023 +0100 parisc: Fix asm operand number out of range build error in bug table Build is broken if CONFIG_DEBUG_BUGVERBOSE=n. Fix it be using the correct asm operand number. Signed-off-by: Helge Deller Reported-by: Linux Kernel Functional Testing Fixes: fe76a1349f23 ("parisc: Use natural CPU alignment for bug_table") Cc: stable@vger.kernel.org # v6.0+ commit a2e7e59a94269484a83386972ca07c22fd188854 Author: Robin Murphy Date: Wed Nov 15 18:25:44 2023 +0000 iommu: Avoid more races around device probe It turns out there are more subtle races beyond just the main part of __iommu_probe_device() itself running in parallel - the dev_iommu_free() on the way out of an unsuccessful probe can still manage to trip up concurrent accesses to a device's fwspec. Thus, extend the scope of iommu_probe_device_lock() to also serialise fwspec creation and initial retrieval. Reported-by: Zhenhua Huang Link: https://lore.kernel.org/linux-iommu/e2e20e1c-6450-4ac5-9804-b0000acdf7de@quicinc.com/ Fixes: 01657bc14a39 ("iommu: Avoid races around device probe") Signed-off-by: Robin Murphy Acked-by: Greg Kroah-Hartman Reviewed-by: André Draszik Tested-by: André Draszik Link: https://lore.kernel.org/r/16f433658661d7cadfea51e7c65da95826112a2b.1700071477.git.robin.murphy@arm.com Cc: stable@vger.kernel.org Signed-off-by: Joerg Roedel commit a99583e2aff64baf27b04b7d3a0341a52bf8e047 Author: Dmitry Baryshkov Date: Sat Nov 4 00:54:13 2023 +0200 MAINTAINERS: list all Qualcomm IOMMU drivers in the QUALCOMM IOMMU entry For historical reasons the 'QUALCOMM IOMMU' entry lists only one Qualcomm IOMMU driver. However there are also the historical MSM IOMMU driver, which is used for old 32-bit platforms, and the Qualcomm-specific customisations for the generic ARM SMMU driver. List all these files under the QUALCOMM IOMMU entry. Signed-off-by: Dmitry Baryshkov Acked-by: Will Deacon Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231103225413.1479857-1-dmitry.baryshkov@linaro.org Signed-off-by: Joerg Roedel commit 34e2dccbb30baf7e5502bae382722aacbbfddc5b Author: Jason Gunthorpe Date: Wed Nov 1 20:28:11 2023 -0300 iommu: Flow ERR_PTR out from __iommu_domain_alloc() Most of the calling code now has error handling that can carry an error code further up the call chain. Keep the exported interface iommu_domain_alloc() returning NULL and reflow the internal code to use ERR_PTR not NULL for domain allocation failure. Optionally allow drivers to return ERR_PTR from any of the alloc ops. Many of the new ops (user, sva, etc) already return ERR_PTR, so having two rules is confusing and hard on drivers. This fixes a bug in DART that was returning ERR_PTR. Fixes: 482feb5c6492 ("iommu/dart: Call apple_dart_finalize_domain() as part of alloc_paging()") Reported-by: Dan Carpenter Link: https://lore.kernel.org/linux-iommu/b85e0715-3224-4f45-ad6b-ebb9f08c015d@moroto.mountain/ Signed-off-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/0-v2-55ae413017b8+97-domain_alloc_err_ptr_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 2cc14f52aeb78ce3f29677c2de1f06c0e91471ab Author: Linus Torvalds Date: Sun Nov 26 19:59:33 2023 -0800 Linux 6.7-rc3 commit 5b2b1173a93fa056b4539ef52e5f03148345d498 Merge: d2da77f431ac4 76d9eafff4484 Author: Linus Torvalds Date: Sun Nov 26 19:48:20 2023 -0800 Merge tag 'trace-v6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing fixes from Steven Rostedt:: "Eventfs fixes: - With the usage of simple_recursive_remove() recommended by Al Viro, the code should not be calling "d_invalidate()" itself. Doing so is causing crashes. The code was calling d_invalidate() on the race of trying to look up a file while the parent was being deleted. This was detected, and the added dentry was having d_invalidate() called on it, but the deletion of the directory was also calling d_invalidate() on that same dentry. - A fix to not free the eventfs_inode (ei) until the last dput() was called on its ei->dentry made the ei->dentry exist even after it was marked for free by setting the ei->is_freed. But code elsewhere still was checking if ei->dentry was NULL if ei->is_freed is set and would trigger WARN_ON if that was the case. That's no longer true and there should not be any warnings when it is true. - Use GFP_NOFS for allocations done under eventfs_mutex. The eventfs_mutex can be taken on file system reclaim, make sure that allocations done under that mutex do not trigger file system reclaim. - Clean up code by moving the taking of inode_lock out of the helper functions and into where they are needed, and not use the parameter to know to take it or not. It must always be held but some callers of the helper function have it taken when they were called. - Warn if the inode_lock is not held in the helper functions. - Warn if eventfs_start_creating() is called without a parent. As eventfs is underneath tracefs, all files created will have a parent (the top one will have a tracefs parent). Tracing update: - Add Mathieu Desnoyers as an official reviewer of the tracing subsystem" * tag 'trace-v6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: MAINTAINERS: TRACING: Add Mathieu Desnoyers as Reviewer eventfs: Make sure that parent->d_inode is locked in creating files/dirs eventfs: Do not allow NULL parent to eventfs_start_creating() eventfs: Move taking of inode_lock into dcache_dir_open_wrapper() eventfs: Use GFP_NOFS for allocation when eventfs_mutex is held eventfs: Do not invalidate dentry in create_file/dir_dentry() eventfs: Remove expectation that ei->is_freed means ei->dentry == NULL commit 6552218f4dc47ba3c6c5b58cc1e9eb208a2b438b Author: Stefan Kerkmann Date: Wed Nov 1 12:03:37 2023 +0100 ARM: dts: imx6q: skov: fix ethernet clock regression A regression was introduced in the Skov specific i.MX6 flavor reve-mi1010ait-1cp1 device tree causing the external ethernet controller to not being selected as the clock source for the i.MX6 ethernet MAC, resulting in a none functional ethernet interface. The root cause is that the ethernet clock selection is now part of the clocks node, which is overwritten in the specific device tree and wasn't updated to contain these ethernet clocks. Fixes: c89614079e44 ("ARM: dts: imx6qdl-skov-cpu: configure ethernet reference clock parent") Signed-off-by: Stefan Kerkmann Signed-off-by: Shawn Guo commit 2bfba37b3d90d6d2d499d5b0dfe99c05c38b1b54 Author: Alexander Stein Date: Thu Oct 19 08:32:17 2023 +0200 arm64: dt: imx93: tqma9352-mba93xxla: Fix LPUART2 pad config LPUART2_RTS# has an external pull-down, so do not enable the internal pull-up at the same time, use a pull-down instead. Fixes: c982ecfa7992a ("arm64: dts: freescale: add initial device tree for MBa93xxLA SBC board") Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 75a442581d05edaee168222ffbe00d4389785636 Author: Hou Tao Date: Sat Nov 11 12:38:21 2023 +0800 bpf: Add missed allocation hint for bpf_mem_cache_alloc_flags() bpf_mem_cache_alloc_flags() may call __alloc() directly when there is no free object in free list, but it doesn't initialize the allocation hint for the returned pointer. It may lead to bad memory dereference when freeing the pointer, so fix it by initializing the allocation hint. Fixes: 822fb26bdb55 ("bpf: Add a hint to allocated objects.") Signed-off-by: Hou Tao Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20231111043821.2258513-1-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit d2da77f431ac49b5763b88751a75f70daa46296c Merge: 4892711acee09 43266838515d3 Author: Linus Torvalds Date: Sun Nov 26 09:59:39 2023 -0800 Merge tag 'parisc-for-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture fixes from Helge Deller: "This patchset fixes and enforces correct section alignments for the ex_table, altinstructions, parisc_unwind, jump_table and bug_table which are created by inline assembly. Due to not being correctly aligned at link & load time they can trigger unnecessarily the kernel unaligned exception handler at runtime. While at it, I switched the bug table to use relative addresses which reduces the size of the table by half on 64-bit. We still had the ENOSYM and EREMOTERELEASE errno symbols as left-overs from HP-UX, which now trigger build-issues with glibc. We can simply remove them. Most of the patches are tagged for stable kernel series. Summary: - Drop HP-UX ENOSYM and EREMOTERELEASE return codes to avoid glibc build issues - Fix section alignments for ex_table, altinstructions, parisc unwind table, jump_table and bug_table - Reduce size of bug_table on 64-bit kernel by using relative pointers" * tag 'parisc-for-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Reduce size of the bug_table on 64-bit kernel by half parisc: Drop the HP-UX ENOSYM and EREMOTERELEASE error codes parisc: Use natural CPU alignment for bug_table parisc: Ensure 32-bit alignment on parisc unwind section parisc: Mark lock_aligned variables 16-byte aligned on SMP parisc: Mark jump_table naturally aligned parisc: Mark altinstructions read-only and 32-bit aligned parisc: Mark ex_table entries 32-bit aligned in uaccess.h parisc: Mark ex_table entries 32-bit aligned in assembly.h commit bce61476dc82f114e24e9c2e11fb064781ec563c Author: David Lechner Date: Tue Oct 31 16:05:19 2023 -0500 iio: triggered-buffer: prevent possible freeing of wrong buffer Commit ee708e6baacd ("iio: buffer: introduce support for attaching more IIO buffers") introduced support for multiple buffers per indio_dev but left indio_dev->buffer for a few legacy use cases. In the case of the triggered buffer, iio_triggered_buffer_cleanup() still assumes that indio_dev->buffer points to the buffer allocated by iio_triggered_buffer_setup_ext(). However, since iio_triggered_buffer_setup_ext() now calls iio_device_attach_buffer() to attach the buffer, indio_dev->buffer will only point to the buffer allocated by iio_device_attach_buffer() if it the first buffer attached. This adds a check to make sure that no other buffer has been attached yet to ensure that indio_dev->buffer will be assigned when iio_device_attach_buffer() is called. As per discussion in the review thread, we may want to deal with multiple triggers per device, but this is a fix for the issue in the meantime and any such support would be unlikely to be suitable for a backport. Fixes: ee708e6baacd ("iio: buffer: introduce support for attaching more IIO buffers") Signed-off-by: David Lechner Acked-by: Nuno Sa Link: https://lore.kernel.org/r/20231031210521.1661552-1-dlechner@baylibre.com Cc: Signed-off-by: Jonathan Cameron commit c3df0e29fb7788c4b3ddf37d5ed87dda2b822943 Author: Su Hui Date: Mon Oct 30 10:02:19 2023 +0800 iio: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw inv_mpu6050_sensor_show() can return -EINVAL or IIO_VAL_INT. Return the true value rather than only return IIO_VAL_INT. Fixes: d5098447147c ("iio: imu: mpu6050: add calibration offset support") Signed-off-by: Su Hui Link: https://lore.kernel.org/r/20231030020218.65728-1-suhui@nfschina.com Signed-off-by: Jonathan Cameron commit 1cd2fe4fd63e54b799a68c0856bda18f2e40caa8 Author: Nuno Sa Date: Mon Nov 6 16:07:30 2023 +0100 iio: imu: adis16475: use bit numbers in assign_bit() assign_bit() expects a bit number and not a mask like BIT(x). Hence, just remove the BIT() macro from the #defines. Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202311060647.i9XyO4ej-lkp@intel.com/ Fixes: fff7352bf7a3ce ("iio: imu: Add support for adis16475") Signed-off-by: Nuno Sa Link: https://lore.kernel.org/r/20231106150730.945-1-nuno.sa@analog.com Cc: Signed-off-by: Jonathan Cameron commit 4892711acee0915a8a4ae02e1af3dc70ce000024 Merge: e81fe505202fd 080990aa33441 Author: Linus Torvalds Date: Sun Nov 26 08:42:42 2023 -0800 Merge tag 'x86-urgent-2023-11-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 microcode fixes from Ingo Molnar: "Fix/enhance x86 microcode version reporting: fix the bootup log spam, and remove the driver version announcement to avoid version confusion when distros backport fixes" * tag 'x86-urgent-2023-11-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/microcode: Rework early revisions reporting x86/microcode: Remove the driver announcement and version commit ee4d79055aeea27f1b8c42233cc0c90d0a8b5355 Author: Nuno Sa Date: Thu Nov 2 13:52:58 2023 +0100 iio: imu: adis16475: add spi_device_id table This prevents the warning message "SPI driver has no spi_device_id for..." when registering the driver. More importantly, it makes sure that module autoloading works as spi relies on spi: modaliases and not of. While at it, move the of_device_id table to it's natural place. Fixes: fff7352bf7a3c ("iio: imu: Add support for adis16475") Signed-off-by: Nuno Sa Link: https://lore.kernel.org/r/20231102125258.3284830-1-nuno.sa@analog.com Cc: Signed-off-by: Jonathan Cameron commit e81fe505202fdc07b1925aa70fca5e2a714eb259 Merge: 1d0dbc3d16e82 e8df9d9f4209c Author: Linus Torvalds Date: Sun Nov 26 08:34:12 2023 -0800 Merge tag 'perf-urgent-2023-11-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 perf event fix from Ingo Molnar: "Fix a bug in the Intel hybrid CPUs hardware-capabilities enumeration code resulting in non-working events on those platforms" * tag 'perf-urgent-2023-11-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel: Correct incorrect 'or' operation for PMU capabilities commit 1d0dbc3d16e8215838d9898d0191e8c0d2cc77af Merge: 4515866db1346 bca4104b00fec Author: Linus Torvalds Date: Sun Nov 26 08:30:11 2023 -0800 Merge tag 'locking-urgent-2023-11-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking fix from Ingo Molnar: "Fix lockdep block chain corruption resulting in KASAN warnings" * tag 'locking-urgent-2023-11-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: lockdep: Fix block chain corruption commit 4515866db1346d0b3d7c53214c60ff5373e39bb7 Merge: 090472ed9c922 b0348e459c836 Author: Linus Torvalds Date: Sun Nov 26 08:22:27 2023 -0800 Merge tag '6.7-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fixes from Steve French: - use after free fix in releasing multichannel interfaces - fixes for special file types (report char, block, FIFOs properly when created e.g. by NFS to Windows) - fixes for reporting various special file types and symlinks properly when using SMB1 * tag '6.7-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb: client: introduce cifs_sfu_make_node() smb: client: set correct file type from NFS reparse points smb: client: introduce ->parse_reparse_point() smb: client: implement ->query_reparse_point() for SMB1 cifs: fix use after free for iface while disabling secondary channels commit ccf49cebe595e081761f9973f5cabf1afc8b0f23 Merge: a524eabcd72d2 beb1930f966d1 Author: David S. Miller Date: Sun Nov 26 15:18:57 2023 +0000 Merge branch 'dpaa2-eth-fixes' Ioana Ciornei says: ==================== dpaa2-eth: various fixes The first patch fixes a memory corruption issue happening between the Tx and Tx confirmation of a packet by making the Tx alignment at 64bytes mandatory instead of optional as it was previously. The second patch fixes the Rx copybreak code path which recycled the initial data buffer before all processing was done on the packet. Changes in v2: - squashed patches #1 and #2 ==================== Signed-off-by: David S. Miller commit beb1930f966d1517921488bd5d64147f58f79abf Author: Ioana Ciornei Date: Fri Nov 24 12:28:05 2023 +0200 dpaa2-eth: recycle the RX buffer only after all processing done The blamed commit added support for Rx copybreak. This meant that for certain frame sizes, a new skb was allocated and the initial data buffer was recycled. Instead of waiting to recycle the Rx buffer only after all processing was done on it (like accessing the parse results or timestamp information), the code path just went ahead and re-used the buffer right away. This sometimes lead to corrupted HW and SW annotation areas. Fix this by delaying the moment when the buffer is recycled. Fixes: 50f826999a80 ("dpaa2-eth: add rx copybreak support") Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit f422abe3f23d483cf01f386819f26fb3fe0dbb2b Author: Ioana Ciornei Date: Fri Nov 24 12:28:04 2023 +0200 dpaa2-eth: increase the needed headroom to account for alignment Increase the needed headroom to account for a 64 byte alignment restriction which, with this patch, we make mandatory on the Tx path. The case in which the amount of headroom needed is not available is already handled by the driver which instead sends a S/G frame with the first buffer only holding the SW and HW annotation areas. Without this patch, we can empirically see data corruption happening between Tx and Tx confirmation which sometimes leads to the SW annotation area being overwritten. Since this is an old IP where the hardware team cannot help to understand the underlying behavior, we make the Tx alignment mandatory for all frames to avoid the crash on Tx conf. Also, remove the comment that suggested that this is just an optimization. This patch also sets the needed_headroom net device field to the usual value that the driver would need on the Tx path: - 64 bytes for the software annotation area - 64 bytes to account for a 64 byte aligned buffer address Fixes: 6e2387e8f19e ("staging: fsl-dpaa2/eth: Add Freescale DPAA2 Ethernet driver") Closes: https://lore.kernel.org/netdev/aa784d0c-85eb-4e5d-968b-c8f74fa86be6@gin.de/ Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 79997eda0d31bc68203c95ecb978773ee6ce7a1f Author: Conor Dooley Date: Sun Nov 26 11:40:54 2023 +0000 riscv: dts: microchip: move timebase-frequency to mpfs.dtsi The timebase-frequency on PolarFire SoC is not set by an oscillator on the board, but rather by an internal divider, so move the property to mpfs.dtsi. This looks to be copy-pasta from the SiFive Unleashed as the comments in both places were almost identical. In the Unleashed's case this looks to actually be valid, as the clock is provided by a crystal on the PCB. Signed-off-by: Conor Dooley --- CC: Conor Dooley CC: Daire McNamara CC: Rob Herring CC: Krzysztof Kozlowski CC: Paul Walmsley CC: Palmer Dabbelt CC: linux-riscv@lists.infradead.org CC: devicetree@vger.kernel.org commit a524eabcd72d28425d9db242cf375d0389d74eba Author: Greg Ungerer Date: Fri Nov 24 14:15:29 2023 +1000 net: dsa: mv88e6xxx: fix marvell 6350 probe crash As of commit b92143d4420f ("net: dsa: mv88e6xxx: add infrastructure for phylink_pcs") probing of a Marvell 88e6350 switch causes a NULL pointer de-reference like this example: ... mv88e6085 d0072004.mdio-mii:11: switch 0x3710 detected: Marvell 88E6350, revision 2 8<--- cut here --- Unable to handle kernel NULL pointer dereference at virtual address 00000000 when read [00000000] *pgd=00000000 Internal error: Oops: 5 [#1] ARM Modules linked in: CPU: 0 PID: 8 Comm: kworker/u2:0 Not tainted 6.7.0-rc2-dirty #26 Hardware name: Marvell Armada 370/XP (Device Tree) Workqueue: events_unbound deferred_probe_work_func PC is at mv88e6xxx_port_setup+0x1c/0x44 LR is at dsa_port_devlink_setup+0x74/0x154 pc : [] lr : [] psr: a0000013 sp : c184fce0 ip : c542b8f4 fp : 00000000 r10: 00000001 r9 : c542a540 r8 : c542bc00 r7 : c542b838 r6 : c5244580 r5 : 00000005 r4 : c5244580 r3 : 00000000 r2 : c542b840 r1 : 00000005 r0 : c1a02040 ... The Marvell 6350 switch has no SERDES interface and so has no corresponding pcs_ops defined for it. But during probing a call is made to mv88e6xxx_port_setup() which unconditionally expects pcs_ops to exist - though the presence of the pcs_ops->pcs_init function is optional. Modify code to check for pcs_ops first, before checking for and calling pcs_ops->pcs_init. Modify checking and use of pcs_ops->pcs_teardown which may potentially suffer the same problem. Fixes: b92143d4420f ("net: dsa: mv88e6xxx: add infrastructure for phylink_pcs") Signed-off-by: Greg Ungerer Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit b3f1a164c7f742503dc7159011f7ad6b092b660e Author: Greg Ungerer Date: Fri Nov 24 14:15:28 2023 +1000 net: dsa: mv88e6xxx: fix marvell 6350 switch probing As of commit de5c9bf40c45 ("net: phylink: require supported_interfaces to be filled") Marvell 88e6350 switches fail to be probed: ... mv88e6085 d0072004.mdio-mii:11: switch 0x3710 detected: Marvell 88E6350, revision 2 mv88e6085 d0072004.mdio-mii:11: phylink: error: empty supported_interfaces error creating PHYLINK: -22 mv88e6085: probe of d0072004.mdio-mii:11 failed with error -22 ... The problem stems from the use of mv88e6185_phylink_get_caps() to get the device capabilities. Create a new dedicated phylink_get_caps for the 6351 family (which the 6350 is one of) to properly support their set of capabilities. According to chip.h the 6351 switch family includes the 6171, 6175, 6350 and 6351 switches, so update each of these to use the correct phylink_get_caps. Fixes: de5c9bf40c45 ("net: phylink: require supported_interfaces to be filled") Signed-off-by: Greg Ungerer Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 3f3ae1250e739fb446639efad0ba916ba0a012f0 Author: Kent Overstreet Date: Sat Nov 25 12:16:22 2023 -0500 bcachefs: bpos is misaligned on big endian bkey embeds a bpos that is misaligned on big endian; this is so that bch2_bkey_swab() works correctly without having to differentiate between packed and non-packed keys (a debatable design decision). This means it can't have the __aligned() tag on big endian. Signed-off-by: Kent Overstreet commit e4f72bb46a774b449ffe864fa6fffa7ecbf8f3f7 Author: Kent Overstreet Date: Fri Nov 24 21:52:06 2023 -0500 bcachefs: Fix ec + durability calculation Durability of an erasure coded pointer doesn't add the device durability; durability is the same for any extent in that stripe so the calculation only comes from the stripe. Signed-off-by: Kent Overstreet commit 7d9f8468ff7589073981b3eb8b175945c7dcd13c Author: Kent Overstreet Date: Fri Nov 24 21:51:45 2023 -0500 bcachefs: Data update path won't accidentaly grow replicas Previously, there was a bug where if an extent had greater durability than required (because we needed to move a durability=1 pointer and ended up putting it on a durability 2 device), we would submit a write for replicas=2 - the durability of the pointer being rewritten - instead of the number of replicas required to bring it back up to the data_replicas option. This, plus the allocation path sometimes allocating on a greater durability device than requested, meant that extents could continue having more and more replicas added as they were being rewritten. Signed-off-by: Kent Overstreet commit 936e4d49ecbc8c404790504386e1422b599dec39 Author: Hans de Goede Date: Fri Nov 24 19:59:24 2023 -0800 Input: atkbd - skip ATKBD_CMD_GETID in translated mode There have been multiple reports of keyboard issues on recent laptop models which can be worked around by setting i8042.dumbkbd, with the downside being this breaks the capslock LED. It seems that these issues are caused by recent laptops getting confused by ATKBD_CMD_GETID. Rather then adding and endless growing list of quirks for this, just skip ATKBD_CMD_GETID alltogether on laptops in translated mode. The main goal of sending ATKBD_CMD_GETID is to skip binding to ps/2 mice/touchpads and those are never used in translated mode. Examples of laptop models which benefit from skipping ATKBD_CMD_GETID: * "HP Laptop 15s-fq2xxx", "HP laptop 15s-fq4xxx" and "HP Laptop 15-dy2xxx" models the kbd stops working for the first 2 - 5 minutes after boot (waiting for EC watchdog reset?) * On "HP Spectre x360 13-aw2xxx" atkbd fails to probe the keyboard * At least 9 different Lenovo models have issues with ATKBD_CMD_GETID, see: https://github.com/yescallop/atkbd-nogetid This has been tested on: 1. A MSI B550M PRO-VDH WIFI desktop, where the i8042 controller is not in translated mode when no keyboard is plugged in and with a ps/2 kbd a "AT Translated Set 2 keyboard" /dev/input/event# node shows up 2. A Lenovo ThinkPad X1 Yoga gen 8 (always has a translated set 2 keyboard) Reported-by: Shang Ye Closes: https://lore.kernel.org/linux-input/886D6167733841AE+20231017135318.11142-1-yesh25@mail2.sysu.edu.cn/ Closes: https://github.com/yescallop/atkbd-nogetid Reported-by: gurevitch Closes: https://lore.kernel.org/linux-input/2iAJTwqZV6lQs26cTb38RNYqxvsink6SRmrZ5h0cBUSuf9NT0tZTsf9fEAbbto2maavHJEOP8GA1evlKa6xjKOsaskDhtJWxjcnrgPigzVo=@gurevit.ch/ Reported-by: Egor Ignatov Closes: https://lore.kernel.org/all/20210609073333.8425-1-egori@altlinux.org/ Reported-by: Anton Zhilyaev Closes: https://lore.kernel.org/linux-input/20210201160336.16008-1-anton@cpp.in/ Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2086156 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231115174625.7462-1-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit 090472ed9c922e699dc61dd601a9b376a64f4390 Merge: b46ae77f67874 cb9a830e87177 Author: Linus Torvalds Date: Sat Nov 25 18:22:42 2023 -0800 Merge tag 'usb-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB / PHY / Thunderbolt fixes from Greg KH: "Here are a number of reverts, fixes, and new device ids for 6.7-rc3 for the USB, PHY, and Thunderbolt driver subsystems. Include in here are: - reverts of some PHY drivers that went into 6.7-rc1 that shouldn't have been merged yet, the author is reworking them based on review comments as they were using older apis that shouldn't be used anymore for newer drivers - small thunderbolt driver fixes for reported issues - USB driver fixes for a variety of small issues in dwc3, typec, xhci, and other smaller drivers. - new device ids for usb-serial and onboard_usb_hub drivers. All of these have been in linux-next with no reported issues" * tag 'usb-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (33 commits) USB: serial: option: add Luat Air72*U series products USB: dwc3: qcom: fix ACPI platform device leak USB: dwc3: qcom: fix software node leak on probe errors USB: dwc3: qcom: fix resource leaks on probe deferral USB: dwc3: qcom: simplify wakeup interrupt setup USB: dwc3: qcom: fix wakeup after probe deferral dt-bindings: usb: qcom,dwc3: fix example wakeup interrupt types usb: misc: onboard-hub: add support for Microchip USB5744 dt-bindings: usb: microchip,usb5744: Add second supply usb: misc: ljca: Fix enumeration error on Dell Latitude 9420 USB: serial: option: add Fibocom L7xx modules USB: xhci-plat: fix legacy PHY double init usb: typec: tipd: Supply also I2C driver data usb: xhci-mtk: fix in-ep's start-split check failure usb: dwc3: set the dma max_seg_size usb: config: fix iteration issue in 'usb_get_bos_descriptor()' usb: dwc3: add missing of_node_put and platform_device_put USB: dwc2: write HCINT with INTMASK applied usb: misc: ljca: Drop _ADR support to get ljca children devices usb: cdnsp: Fix deadlock issue during using NCM gadget ... commit fe4c5f662097978b6c91c23a13c24ed92339a180 Author: Jason-JH.Lin Date: Wed Sep 20 17:06:58 2023 +0800 drm/mediatek: Add spinlock for setting vblank event in atomic_begin Add spinlock protection to avoid race condition on vblank event between mtk_drm_crtc_atomic_begin() and mtk_drm_finish_page_flip(). Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Jason-JH.Lin Suggested-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Reviewed-by: Fei Shao Tested-by: Fei Shao Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/dri-devel/patch/20230920090658.31181-1-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit b46ae77f67874918c540feb1e37a63308b2c9290 Merge: 2821c393d4fdf 9c235dfc3d3f9 Author: Linus Torvalds Date: Sat Nov 25 08:57:09 2023 -0800 Merge tag 'xfs-6.7-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fix from Chandan Babu: - Validate quota records recovered from the log before writing them to the disk. * tag 'xfs-6.7-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: dquot recovery does not validate the recovered dquot xfs: clean up dqblk extraction commit 2821c393d4fdfc75a96a2fad3bec76cf3107b88a Merge: 00cff7b29b1db c0a8574204054 Author: Linus Torvalds Date: Sat Nov 25 08:43:46 2023 -0800 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - Fix "rodata=on" not disabling "rodata=full" on arm64 - Add arm64 make dependency between vmlinuz.efi and Image, leading to occasional build failures previously (with parallel building) - Add newline to the output formatting of the za-fork kselftest * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: add dependency between vmlinuz.efi and Image kselftest/arm64: Fix output formatting for za-fork arm64: mm: Fix "rodata=on" when CONFIG_RODATA_FULL_DEFAULT_ENABLED=y commit 00cff7b29b1dbc4ff48ae9278eb1aa4dc0bfad6a Merge: 0f5cc96c367f2 7bf9a6b465498 Author: Linus Torvalds Date: Sat Nov 25 08:32:44 2023 -0800 Merge tag 'for-linus-6.7a-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: - A small cleanup patch for the Xen privcmd driver - A fix for the swiotlb-xen driver which was missing the advertising of the maximum mapping length - A fix for Xen on Arm for a longstanding bug, which happened to occur only recently: a structure in percpu memory crossed a page boundary, which was rejected by the hypervisor * tag 'for-linus-6.7a-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: arm/xen: fix xen_vcpu_info allocation alignment xen: privcmd: Replace zero-length array with flex-array member and use __counted_by swiotlb-xen: provide the "max_mapping_size" method commit 3b8157ec4573e304a29b7bced627e144dbc3dfdb Author: Javier Carrasco Date: Tue Nov 21 06:48:39 2023 +0100 iio: tmag5273: fix temperature offset The current offset has the scale already applied to it. The ABI documentation defines the offset parameter as "offset to be added to [Y]_raw prior to scaling by [Y]_scale in order to obtain value in the units as specified in [Y]_raw documentation" The right value is obtained at 0 degrees Celsius by the formula provided in the datasheet: T = Tsens_t0 + (Tadc_t - Tadc_t0) / Tadc_res where: T = 0 degrees Celsius Tsens_t0 (reference temperature) = 25 degrees Celsius Tadc_t0 (16-bit format for Tsens_t0) = 17508 Tadc_res = 60.1 LSB/degree Celsius The resulting offset is 16005.5, which has been truncated to 16005 to provide an integer value with a precision loss smaller than the 1-LSB measurement precision. Fix the offset to apply its value prior to scaling. Signed-off-by: Javier Carrasco Link: https://lore.kernel.org/r/9879beec-05fc-4fc6-af62-d771e238954e@wolfvision.net Cc: Signed-off-by: Jonathan Cameron commit f83d38def6b1b00c9bb17173837045b41df7e7d7 Author: Chancel Liu Date: Sat Nov 25 14:53:00 2023 +0800 ASoC: imx-rpmsg: SND_SOC_IMX_RPMSG should depend on OF and I2C SND_SOC_IMX_RPMSG should depend on OF and I2C. It fixes the following error reported by kernel test robot: ld: sound/soc/fsl/imx-rpmsg.o: in function `imx_rpmsg_late_probe': imx-rpmsg.c:(.text+0x4f): undefined reference to `i2c_find_device_by_fwnode' Fixes: 5d9f746ca64c ("ASoC: imx-rpmsg: Force codec power on in low power audio mode") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311230506.DPF9vvYY-lkp@intel.com/ Signed-off-by: Chancel Liu Link: https://lore.kernel.org/r/20231125065300.6385-1-chancel.liu@nxp.com Signed-off-by: Mark Brown commit 43266838515d30dc0c45d5c7e6e7edacee6cce92 Author: Helge Deller Date: Thu Nov 23 21:57:19 2023 +0100 parisc: Reduce size of the bug_table on 64-bit kernel by half Enable GENERIC_BUG_RELATIVE_POINTERS which will store 32-bit relative offsets to the bug address and the source file name instead of 64-bit absolute addresses. This effectively reduces the size of the bug_table[] array by half on 64-bit kernels. Signed-off-by: Helge Deller commit e5f3e299a2b1e9c3ece24a38adfc089aef307e8a Author: Helge Deller Date: Thu Nov 23 20:28:27 2023 +0100 parisc: Drop the HP-UX ENOSYM and EREMOTERELEASE error codes Those return codes are only defined for the parisc architecture and are leftovers from when we wanted to be HP-UX compatible. They are not returned by any Linux kernel syscall but do trigger problems with the glibc strerrorname_np() and strerror() functions as reported in glibc issue #31080. There is no need to keep them, so simply remove them. Signed-off-by: Helge Deller Reported-by: Bruno Haible Closes: https://sourceware.org/bugzilla/show_bug.cgi?id=31080 Cc: stable@vger.kernel.org commit fe76a1349f235969381832c83d703bc911021eb6 Author: Helge Deller Date: Mon Nov 20 23:30:49 2023 +0100 parisc: Use natural CPU alignment for bug_table Make sure that the __bug_table section gets 32- or 64-bit aligned, depending if a 32- or 64-bit kernel is being built. Mark it non-writeable and use .blockz instead of the .org assembler directive to pad the struct. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v6.0+ commit c9fcb2b65c2849e8ff3be23fd8828312fb68dc19 Author: Helge Deller Date: Sat Nov 25 09:16:02 2023 +0100 parisc: Ensure 32-bit alignment on parisc unwind section Make sure the .PARISC.unwind section will be 32-bit aligned. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v6.0+ commit b28fc0d8739c03e7b6c44914a9d00d4c6dddc0ea Author: Helge Deller Date: Sat Nov 25 09:11:56 2023 +0100 parisc: Mark lock_aligned variables 16-byte aligned on SMP On parisc we need 16-byte alignment for variables which are used for locking. Mark the __lock_aligned attribute acordingly so that the .data..lock_aligned section will get that alignment in the generated object files. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v6.0+ commit 07eecff8ae78df7f28800484d31337e1f9bfca3a Author: Helge Deller Date: Mon Nov 20 23:14:39 2023 +0100 parisc: Mark jump_table naturally aligned The jump_table stores two 32-bit words and one 32- (on 32-bit kernel) or one 64-bit word (on 64-bit kernel). Ensure that the last word is always 64-bit aligned on a 64-bit kernel by aligning the whole structure on sizeof(long). Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v6.0+ commit 33f806da2df68606f77d7b892cd1298ba3d463e8 Author: Helge Deller Date: Mon Nov 20 23:10:20 2023 +0100 parisc: Mark altinstructions read-only and 32-bit aligned Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v6.0+ commit a80aeb86542a50aa8521729ea4cc731ee7174f03 Author: Helge Deller Date: Mon Nov 20 15:39:03 2023 +0100 parisc: Mark ex_table entries 32-bit aligned in uaccess.h Add an align statement to tell the linker that all ex_table entries and as such the whole ex_table section should be 32-bit aligned in vmlinux and modules. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v6.0+ commit e11d4cccd094a7cd4696c8c42e672c76c092dad5 Author: Helge Deller Date: Mon Nov 20 15:37:50 2023 +0100 parisc: Mark ex_table entries 32-bit aligned in assembly.h Add an align statement to tell the linker that all ex_table entries and as such the whole ex_table section should be 32-bit aligned in vmlinux and modules. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v6.0+ commit b09d7f8fd50f6e93cbadd8d27fde178f745b42a1 Author: Damien Le Moal Date: Tue Nov 21 07:56:31 2023 +0900 scsi: sd: Fix system start for ATA devices It is not always possible to keep a device in the runtime suspended state when a system level suspend/resume cycle is executed. E.g. for ATA devices connected to AHCI adapters, system resume resets the ATA ports, which causes connected devices to spin up. In such case, a runtime suspended disk will incorrectly be seen with a suspended runtime state because the device is not resumed by sd_resume_system(). The power state seen by the user is different than the actual device physical power state. Fix this issue by introducing the struct scsi_device flag force_runtime_start_on_system_start. When set, this flag causes sd_resume_system() to request a runtime resume operation for runtime suspended devices. This results in the user seeing the device runtime_state as active after a system resume, thus correctly reflecting the device physical power state. Fixes: 9131bff6a9f1 ("scsi: core: pm: Only runtime resume if necessary") Cc: Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20231120225631.37938-3-dlemoal@kernel.org Signed-off-by: Martin K. Petersen commit 6371be7aeb986905bb60ec73d002fc02343393b4 Author: Damien Le Moal Date: Tue Nov 21 07:56:30 2023 +0900 scsi: Change SCSI device boolean fields to single bit flags Commit 3cc2ffe5c16d ("scsi: sd: Differentiate system and runtime start/stop management") changed the single bit manage_start_stop flag into 2 boolean fields of the SCSI device structure. Commit 24eca2dce0f8 ("scsi: sd: Introduce manage_shutdown device flag") introduced the manage_shutdown boolean field for the same structure. Together, these 2 commits increase the size of struct scsi_device by 8 bytes by using booleans instead of defining the manage_xxx fields as single bit flags, similarly to other flags of this structure. Avoid this unnecessary structure size increase and be consistent with the definition of other flags by reverting the definitions of the manage_xxx fields as single bit flags. Fixes: 3cc2ffe5c16d ("scsi: sd: Differentiate system and runtime start/stop management") Fixes: 24eca2dce0f8 ("scsi: sd: Introduce manage_shutdown device flag") Cc: Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20231120225631.37938-2-dlemoal@kernel.org Reviewed-by: Niklas Cassel Signed-off-by: Martin K. Petersen commit 93e6c0e19d5bb12b49534a411c85e21d333731fa Author: Peter Wang Date: Wed Nov 15 21:10:24 2023 +0800 scsi: ufs: core: Clear cmd if abort succeeds in MCQ mode In MCQ mode, if cmd is pending in device and abort succeeds, response will not be returned by device. So we need clear the cmd, otherwise timeout will happen and next time we use same tag we will get a WARN_ON(lrbp->cmd). Below is error log: <3>[ 2277.447611][T21376] ufshcd-mtk 112b0000.ufshci: ufshcd_try_to_abort_task: cmd pending in the device. tag = 7 <3>[ 2277.476954][T21376] ufshcd-mtk 112b0000.ufshci: Aborting tag 7 / CDB 0x2a succeeded <6>[ 2307.551263][T30974] ufshcd-mtk 112b0000.ufshci: ufshcd_abort: Device abort task at tag 7 <4>[ 2307.623264][ T327] WARNING: CPU: 5 PID: 327 at source/drivers/ufs/core/ufshcd.c:3021 ufshcd_queuecommand+0x66c/0xe34 Fixes: ab248643d3d6 ("scsi: ufs: core: Add error handling for MCQ mode") Cc: Signed-off-by: Peter Wang Link: https://lore.kernel.org/r/20231115131024.15829-1-peter.wang@mediatek.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 39d5b6a64ace77d0c11c398d272218df5f939abb Author: Liu Ying Date: Thu Nov 23 11:26:15 2023 +0800 drm/bridge: panel: Check device dependency before managing device link Some panel devices already depend on DRM device, like the panel in arch/arm/boot/dts/st/ste-ux500-samsung-skomer.dts, because DRM device is the ancestor of those panel devices. device_link_add() would fail by returning a NULL pointer for those panel devices because of the existing dependency. So, check the dependency by calling device_is_dependent() before adding or deleting device link between panel device and DRM device so that the link is managed only for independent panel devices. Fixes: 887878014534 ("drm/bridge: panel: Fix device link for DRM_BRIDGE_ATTACH_NO_CONNECTOR") Fixes: 199cf07ebd2b ("drm/bridge: panel: Add a device link between drm device and panel device") Reported-by: Linus Walleij Closes: https://lore.kernel.org/lkml/CACRpkdaGzXD6HbiX7mVUNJAJtMEPG00Pp6+nJ1P0JrfJ-ArMvQ@mail.gmail.com/T/ Tested-by: Linus Walleij Signed-off-by: Liu Ying Signed-off-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20231123032615.3760488-1-victor.liu@nxp.com commit 0f5cc96c367f2e780eb492cc9cab84e3b2ca88da Merge: 1bcc689719473 aab1f809d7540 Author: Linus Torvalds Date: Fri Nov 24 11:44:50 2023 -0800 Merge tag 's390-6.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Alexander Gordeev: - Remove unnecessary assignment of the performance event last_tag. - Create missing /sys/firmware/ipl/* attributes when kernel is booted in dump mode using List-directed ECKD IPL. - Remove odd comment. - Fix s390-specific part of scripts/checkstack.pl script that only matches three-digit numbers starting with 3 or any higher number and skips any stack sizes smaller than 304 bytes. * tag 's390-6.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: scripts/checkstack.pl: match all stack sizes for s390 s390: remove odd comment s390/ipl: add missing IPL_TYPE_ECKD_DUMP case to ipl_init() s390/pai: cleanup event initialization commit 1bcc689719473873e961ed91df7e929fae71cbbb Merge: b345fd55a2b79 e37470624e008 Author: Linus Torvalds Date: Fri Nov 24 11:30:35 2023 -0800 Merge tag 'acpi-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "These add an ACPI IRQ override quirk for ASUS ExpertBook B1402CVA and fix an ACPI processor idle issue leading to triple-faults in Xen HVM guests and an ACPI backlight driver issue that causes GPUs to misbehave while their children power is being fixed up. Specifics: - Avoid powering up GPUs while attempting to fix up power for their children (Hans de Goede) - Use raw_safe_halt() instead of safe_halt() in acpi_idle_play_dead() so as to avoid triple-falts during CPU online in Xen HVM guests due to the setting of the hardirqs_enabled flag in safe_halt() (David Woodhouse) - Add an ACPI IRQ override quirk for ASUS ExpertBook B1402CVA (Hans de Goede)" * tag 'acpi-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA ACPI: video: Use acpi_device_fix_up_power_children() ACPI: PM: Add acpi_device_fix_up_power_children() function ACPI: processor_idle: use raw_safe_halt() in acpi_idle_play_dead() commit b345fd55a2b79d6aa92042b19be802425fc353cb Merge: 5b7ad877e4d81 b85e2dab33ce4 Author: Linus Torvalds Date: Fri Nov 24 11:26:00 2023 -0800 Merge tag 'pm-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fix from Rafael Wysocki: "Fix a syntax error in the sleepgraph utility which causes it to exit early on every invocation (David Woodhouse)" * tag 'pm-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM: tools: Fix sleepgraph syntax error commit 5b7ad877e4d81f8904ce83982b1ba5c6e83deccb Merge: fa2b906f51488 68516f60c1d8b Author: Linus Torvalds Date: Fri Nov 24 10:40:03 2023 -0800 Merge tag 'afs-fixes-20231124' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull AFS fixes from David Howells: - Fix the afs_server_list struct to be cleaned up with RCU - Fix afs to translate a no-data result from a DNS lookup into ENOENT, not EDESTADDRREQ for consistency with OpenAFS - Fix afs to translate a negative DNS lookup result into ENOENT rather than EDESTADDRREQ - Fix file locking on R/O volumes to operate in local mode as the server doesn't handle exclusive locks on such files - Set SB_RDONLY on superblocks for RO and Backup volumes so that the VFS can see that they're read only * tag 'afs-fixes-20231124' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: afs: Mark a superblock for an R/O or Backup volume as SB_RDONLY afs: Fix file locking on R/O volumes to operate in local mode afs: Return ENOENT if no cell DNS record can be found afs: Make error on cell lookup failure consistent with OpenAFS afs: Fix afs_server_list to be cleaned up with RCU commit e37470624e008579fec020c6be062dd200877129 Merge: bd911485294a6 c936954946063 9bb69ba4c177d Author: Rafael J. Wysocki Date: Fri Nov 24 19:16:22 2023 +0100 Merge branches 'acpi-video' and 'acpi-processor' into acpi Merge ACPI backlight driver fixes and an ACPI processor driver fix for 6.7-rc3: - Avoid powering up GPUs while attempting to fix up power for their children (Hans de Goede). - Use raw_safe_halt() instead of safe_halt() in acpi_idle_play_dead() so as to avoid triple-falts during CPU online in Xen HVM guests due to the setting of the hardirqs_enabled flag in safe_halt() (David Woodhouse). * acpi-video: ACPI: video: Use acpi_device_fix_up_power_children() ACPI: PM: Add acpi_device_fix_up_power_children() function * acpi-processor: ACPI: processor_idle: use raw_safe_halt() in acpi_idle_play_dead() commit 0ac1d13a55eb37d398b63e6ff6db4a09a2c9128c Author: Jann Horn Date: Fri Nov 24 17:48:31 2023 +0100 btrfs: send: ensure send_fd is writable kernel_write() requires the caller to ensure that the file is writable. Let's do that directly after looking up the ->send_fd. We don't need a separate bailout path because the "out" path already does fput() if ->send_filp is non-NULL. This has no security impact for two reasons: - the ioctl requires CAP_SYS_ADMIN - __kernel_write() bails out on read-only files - but only since 5.8, see commit a01ac27be472 ("fs: check FMODE_WRITE in __kernel_write") Reported-and-tested-by: syzbot+12e098239d20385264d3@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=12e098239d20385264d3 Fixes: 31db9f7c23fb ("Btrfs: introduce BTRFS_IOC_SEND for btrfs send/receive") CC: stable@vger.kernel.org # 4.14+ Signed-off-by: Jann Horn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 94dbf7c0871f7ae6349ba4b0341ce8f5f98a071d Author: Qu Wenruo Date: Fri Nov 24 14:53:50 2023 +1030 btrfs: free the allocated memory if btrfs_alloc_page_array() fails [BUG] If btrfs_alloc_page_array() fail to allocate all pages but part of the slots, then the partially allocated pages would be leaked in function btrfs_submit_compressed_read(). [CAUSE] As explicitly stated, if btrfs_alloc_page_array() returned -ENOMEM, caller is responsible to free the partially allocated pages. For the existing call sites, most of them are fine: - btrfs_raid_bio::stripe_pages Handled by free_raid_bio(). - extent_buffer::pages[] Handled btrfs_release_extent_buffer_pages(). - scrub_stripe::pages[] Handled by release_scrub_stripe(). But there is one exception in btrfs_submit_compressed_read(), if btrfs_alloc_page_array() failed, we didn't cleanup the array and freed the array pointer directly. Initially there is still the error handling in commit dd137dd1f2d7 ("btrfs: factor out allocating an array of pages"), but later in commit 544fe4a903ce ("btrfs: embed a btrfs_bio into struct compressed_bio"), the error handling is removed, leading to the possible memory leak. [FIX] This patch would add back the error handling first, then to prevent such situation from happening again, also Make btrfs_alloc_page_array() to free the allocated pages as a extra safety net, then we don't need to add the error handling to btrfs_submit_compressed_read(). Fixes: 544fe4a903ce ("btrfs: embed a btrfs_bio into struct compressed_bio") CC: stable@vger.kernel.org # 6.4+ Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5de0434bc064606d6b7467ec3e5ad22963a18c04 Author: David Sterba Date: Tue Nov 14 17:44:11 2023 +0100 btrfs: fix 64bit compat send ioctl arguments not initializing version member When the send protocol versioning was added in 5.16 e77fbf990316 ("btrfs: send: prepare for v2 protocol"), the 32/64bit compat code was not updated (added by 2351f431f727 ("btrfs: fix send ioctl on 32bit with 64bit kernel")), missing the version struct member. The compat code is probably rarely used, nobody reported any bugs. Found by tool https://github.com/jirislaby/clang-struct . Fixes: e77fbf990316 ("btrfs: send: prepare for v2 protocol") CC: stable@vger.kernel.org # 6.1+ Reviewed-by: Filipe Manana Signed-off-by: David Sterba commit fa2b906f5148883e2d0be8952767469c2e3de274 Merge: afa0f6ee000ab 796432efab1e3 Author: Linus Torvalds Date: Fri Nov 24 09:45:40 2023 -0800 Merge tag 'vfs-6.7-rc3.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull vfs fixes from Christian Brauner: - Avoid calling back into LSMs from vfs_getattr_nosec() calls. IMA used to query inode properties accessing raw inode fields without dedicated helpers. That was finally fixed a few releases ago by forcing IMA to use vfs_getattr_nosec() helpers. The goal of the vfs_getattr_nosec() helper is to query for attributes without calling into the LSM layer which would be quite problematic because incredibly IMA is called from __fput()... __fput() -> ima_file_free() What it does is to call back into the filesystem to update the file's IMA xattr. Querying the inode without using vfs_getattr_nosec() meant that IMA didn't handle stacking filesystems such as overlayfs correctly. So the switch to vfs_getattr_nosec() is quite correct. But the switch to vfs_getattr_nosec() revealed another bug when used on stacking filesystems: __fput() -> ima_file_free() -> vfs_getattr_nosec() -> i_op->getattr::ovl_getattr() -> vfs_getattr() -> i_op->getattr::$WHATEVER_UNDERLYING_FS_getattr() -> security_inode_getattr() # calls back into LSMs Now, if that __fput() happens from task_work_run() of an exiting task current->fs and various other pointer could already be NULL. So anything in the LSM layer relying on that not being NULL would be quite surprised. Fix that by passing the information that this is a security request through to the stacking filesystem by adding a new internal ATT_GETATTR_NOSEC flag. Now the callchain becomes: __fput() -> ima_file_free() -> vfs_getattr_nosec() -> i_op->getattr::ovl_getattr() -> if (AT_GETATTR_NOSEC) vfs_getattr_nosec() else vfs_getattr() -> i_op->getattr::$WHATEVER_UNDERLYING_FS_getattr() - Fix a bug introduced with the iov_iter rework from last cycle. This broke /proc/kcore by copying too much and without the correct offset. - Add a missing NULL check when allocating the root inode in autofs_fill_super(). - Fix stable writes for multi-device filesystems (xfs, btrfs etc) and the block device pseudo filesystem. Stable writes used to be a superblock flag only, making it a per filesystem property. Add an additional AS_STABLE_WRITES mapping flag to allow for fine-grained control. - Ensure that offset_iterate_dir() returns 0 after reaching the end of a directory so it adheres to getdents() convention. * tag 'vfs-6.7-rc3.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: libfs: getdents() should return 0 after reaching EOD xfs: respect the stable writes flag on the RT device xfs: clean up FS_XFLAG_REALTIME handling in xfs_ioctl_setattr_xflags block: update the stable_writes flag in bdev_add filemap: add a per-mapping stable writes flag autofs: add: new_inode check in autofs_fill_super() iov_iter: fix copy_page_to_iter_nofault() fs: Pass AT_GETATTR_NOSEC flag to getattr interface function commit 00f7d153f3358a7c7e35aef66fcd9ceb95d90430 Author: Ben Greear Date: Thu Nov 9 10:22:01 2023 -0800 wifi: mac80211: handle 320 MHz in ieee80211_ht_cap_ie_to_sta_ht_cap The new 320 MHz channel width wasn't handled, so connecting a station to a 320 MHz AP would limit the station to 20 MHz (on HT) after a warning, handle 320 MHz to fix that. Signed-off-by: Ben Greear Link: https://lore.kernel.org/r/20231109182201.495381-1-greearb@candelatech.com [write a proper commit message] Signed-off-by: Johannes Berg commit ef5828805842204dd0259ecfc132b5916c8a77ae Author: Michael-CY Lee Date: Wed Nov 22 11:02:37 2023 +0800 wifi: avoid offset calculation on NULL pointer ieee80211_he_6ghz_oper() can be passed a NULL pointer and checks for that, but already did the calculation to inside of it before. Move it after the check. Signed-off-by: Michael-CY Lee Link: https://lore.kernel.org/r/20231122030237.31276-1-michael-cy.lee@mediatek.com [rewrite commit message] Signed-off-by: Johannes Berg commit afa0f6ee000abd220a8160f0375b5b8d3e4284f2 Merge: f1a09972a45ae b3ca8a08d8ed0 Author: Linus Torvalds Date: Fri Nov 24 09:36:33 2023 -0800 Merge tag 'drm-fixes-2023-11-24' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Back to regular scheduled fixes pull request, mainly a bunch of msm, some i915 and otherwise a few scattered, one memory crasher in the nouveau GSP paths is helping stabilise that work. msm: - Fix the VREG_CTRL_1 for 4nm CPHY to match downstream - Remove duplicate call to drm_kms_helper_poll_init() in msm_drm_init() - Fix the safe_lut_tbl[] for sc8280xp to match downstream - Don't attach the drm_dp_set_subconnector_property() for eDP - Fix to attach drm_dp_set_subconnector_property() for DP. Otherwise there is a bootup crash on multiple targets - Remove unnecessary NULL check left behind during cleanup i915: - Fix race between DP MST connectore registration and setup - Fix GT memory leak on probe error path panel: - Fixes for innolux and auo,b101uan08.3 panel. - Fix Himax83102-j02 timings. ivpu: - Fix ivpu MMIO reset. ast: - AST fix on connetor disconnection. nouveau: - gsp memory corruption fix rockchip: - color fix" * tag 'drm-fixes-2023-11-24' of git://anongit.freedesktop.org/drm/drm: nouveau/gsp: allocate enough space for all channel ids. drm/panel: boe-tv101wum-nl6: Fine tune Himax83102-j02 panel HFP and HBP drm/ast: Disconnect BMC if physical connector is connected accel/ivpu/37xx: Fix hangs related to MMIO reset drm/rockchip: vop: Fix color for RGB888/BGR888 format on VOP full drm/i915: do not clean GT table on error path drm/i915/dp_mst: Fix race between connector registration and setup drm/panel: simple: Fix Innolux G101ICE-L01 timings drm/panel: simple: Fix Innolux G101ICE-L01 bus flags drm/msm: remove unnecessary NULL check drm/panel: auo,b101uan08.3: Fine tune the panel power sequence drm/msm/dp: attach the DP subconnector property drm/msm/dp: don't touch DP subconnector property in eDP case drm/msm/dpu: Add missing safe_lut_tbl in sc8280xp catalog drm/msm: remove exra drm_kms_helper_poll_init() call drm/msm/dsi: use the correct VREG_CTRL_1 value for 4nm cphy commit 103317670e6bf2542309db28d52444a83d84ed28 Author: Johannes Berg Date: Wed Nov 15 13:06:16 2023 +0100 wifi: cfg80211: hold wiphy mutex for send_interface Given all the locking rework in mac80211, we pretty much need to get into the driver with the wiphy mutex held in all callbacks. This is already mostly the case, but as Johan reported, in the get_txpower it may not be true. Lock the wiphy mutex around nl80211_send_iface(), then is also around callers of nl80211_notify_iface(). This is easy to do, fixes the problem, and aligns the locking between various calls to it in different parts of the code of cfg80211. Fixes: 0e8185ce1dde ("wifi: mac80211: check wiphy mutex in ops") Reported-by: Johan Hovold Closes: https://lore.kernel.org/r/ZVOXX6qg4vXEx8dX@hovoldconsulting.com Tested-by: Johan Hovold Signed-off-by: Johannes Berg commit 8e2f6f2366219b3304b227bdd2f04b64c92e3e12 Author: Johannes Berg Date: Wed Nov 8 13:41:25 2023 +0100 wifi: cfg80211: lock wiphy mutex for rfkill poll We want to guarantee the mutex is held for pretty much all operations, so ensure that here as well. Reported-by: syzbot+7e59a5bfc7a897247e18@syzkaller.appspotmail.com Signed-off-by: Johannes Berg commit 7e7efdda6adb385fbdfd6f819d76bc68c923c394 Author: Johannes Berg Date: Mon Nov 6 23:17:16 2023 +0100 wifi: cfg80211: fix CQM for non-range use My prior race fix here broke CQM when ranges aren't used, as the reporting worker now requires the cqm_config to be set in the wdev, but isn't set when there's no range configured. Rather than continuing to special-case the range version, set the cqm_config always and configure accordingly, also tracking if range was used or not to be able to clear the configuration appropriately with the same API, which was actually not right if both were implemented by a driver for some reason, as is the case with mac80211 (though there the implementations are equivalent so it doesn't matter.) Also, the original multiple-RSSI commit lost checking for the callback, so might have potentially crashed if a driver had neither implementation, and userspace tried to use it despite not being advertised as supported. Cc: stable@vger.kernel.org Fixes: 4a4b8169501b ("cfg80211: Accept multiple RSSI thresholds for CQM") Fixes: 37c20b2effe9 ("wifi: cfg80211: fix cqm_config access race") Signed-off-by: Johannes Berg commit 3e3a2b645c043f7e3e488d5011478cefb69bbe8b Author: Oldřich Jedlička Date: Sat Nov 4 15:13:33 2023 +0100 wifi: mac80211: do not pass AP_VLAN vif pointer to drivers during flush This fixes WARN_ONs when using AP_VLANs after station removal. The flush call passed AP_VLAN vif to driver, but because these vifs are virtual and not registered with drivers, we need to translate to the correct AP vif first. Closes: https://github.com/openwrt/openwrt/issues/12420 Fixes: 0b75a1b1e42e ("wifi: mac80211: flush queues on STA removal") Fixes: d00800a289c9 ("wifi: mac80211: add flush_sta method") Tested-by: Konstantin Demin Tested-by: Koen Vandeputte Signed-off-by: Oldřich Jedlička Link: https://lore.kernel.org/r/20231104141333.3710-1-oldium.pro@gmail.com Signed-off-by: Johannes Berg commit 71b5e40651d89a8685bea1592dfcd2aa61559628 Author: Dan Carpenter Date: Wed Sep 27 15:40:41 2023 +0300 wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta() This error path should return -EINVAL instead of success. Fixes: 57974a55d995 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()") Signed-off-by: Dan Carpenter Acked-by: Gregory Greenman Link: https://lore.kernel.org/r/75e4ea09-db58-462f-bd4e-5ad4e5e5dcb5@moroto.mountain Signed-off-by: Johannes Berg commit bb6cc253861bd5a7cf8439e2118659696df9619f Author: Markus Weippert Date: Fri Nov 24 16:14:37 2023 +0100 bcache: revert replacing IS_ERR_OR_NULL with IS_ERR Commit 028ddcac477b ("bcache: Remove unnecessary NULL point check in node allocations") replaced IS_ERR_OR_NULL by IS_ERR. This leads to a NULL pointer dereference. BUG: kernel NULL pointer dereference, address: 0000000000000080 Call Trace: ? __die_body.cold+0x1a/0x1f ? page_fault_oops+0xd2/0x2b0 ? exc_page_fault+0x70/0x170 ? asm_exc_page_fault+0x22/0x30 ? btree_node_free+0xf/0x160 [bcache] ? up_write+0x32/0x60 btree_gc_coalesce+0x2aa/0x890 [bcache] ? bch_extent_bad+0x70/0x170 [bcache] btree_gc_recurse+0x130/0x390 [bcache] ? btree_gc_mark_node+0x72/0x230 [bcache] bch_btree_gc+0x5da/0x600 [bcache] ? cpuusage_read+0x10/0x10 ? bch_btree_gc+0x600/0x600 [bcache] bch_gc_thread+0x135/0x180 [bcache] The relevant code starts with: new_nodes[0] = NULL; for (i = 0; i < nodes; i++) { if (__bch_keylist_realloc(&keylist, bkey_u64s(&r[i].b->key))) goto out_nocoalesce; // ... out_nocoalesce: // ... for (i = 0; i < nodes; i++) if (!IS_ERR(new_nodes[i])) { // IS_ERR_OR_NULL before 028ddcac477b btree_node_free(new_nodes[i]); // new_nodes[0] is NULL rw_unlock(true, new_nodes[i]); } This patch replaces IS_ERR() by IS_ERR_OR_NULL() to fix this. Fixes: 028ddcac477b ("bcache: Remove unnecessary NULL point check in node allocations") Link: https://lore.kernel.org/all/3DF4A87A-2AC1-4893-AE5F-E921478419A9@suse.de/ Cc: stable@vger.kernel.org Cc: Zheng Wang Cc: Coly Li Signed-off-by: Markus Weippert Signed-off-by: Jens Axboe commit cb9a830e871779b4f9b8d5f76a2abf24915cd007 Merge: 9cf87666fc6e0 da90e45d5afc4 Author: Greg Kroah-Hartman Date: Fri Nov 24 16:30:38 2023 +0000 Merge tag 'usb-serial-6.7-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for 6.7-rc3 Here are a couple of modem device entry fixes and some new modem device ids. All have been in linux-next with no reported issues. * tag 'usb-serial-6.7-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: (329 commits) USB: serial: option: add Luat Air72*U series products USB: serial: option: add Fibocom L7xx modules USB: serial: option: fix FM101R-GL defines USB: serial: option: don't claim interface 4 for ZTE MF290 Linux 6.7-rc2 prctl: Disable prctl(PR_SET_MDWE) on parisc parisc/power: Fix power soft-off when running on qemu parisc: Replace strlcpy() with strscpy() NFSD: Fix checksum mismatches in the duplicate reply cache NFSD: Fix "start of NFS reply" pointer passed to nfsd_cache_update() NFSD: Update nfsd_cache_append() to use xdr_stream nfsd: fix file memleak on client_opens_release dm-crypt: start allocating with MAX_ORDER dm-verity: don't use blocking calls from tasklets dm-bufio: fix no-sleep mode dm-delay: avoid duplicate logic dm-delay: fix bugs introduced by kthread mode dm-delay: fix a race between delay_presuspend and delay_bio drm/amdgpu/gmc9: disable AGP aperture drm/amdgpu/gmc10: disable AGP aperture ... commit 1805a6d269bea9a8c8a60b6a36eb48ec91ccd3cf Merge: fba293488ccb1 31ed8da1c8e5e Author: Mark Brown Date: Fri Nov 24 16:12:06 2023 +0000 ASoC: SOF: Extend the enabled DSP core handling Merge series from Peter Ujfalusi : In the current code, we enable a widget core when it is set up and disable it when it is freed. This is problematic with IPC4 because widget free is essentially a NOP and all widgets are freed in the firmware when the pipeline is deleted. This results in a crash during pipeline deletion when one of it's widgets is scheduled to run on a secondary core and is powered off when widget is freed. So, change the logic to enable all cores needed by all the modules in a pipeline when the pipeline widget is set up and disable them after the pipeline widget is freed. commit e2b706c691905fe78468c361aaabc719d0a496f1 Author: Zhengchao Shao Date: Thu Nov 23 15:13:14 2023 +0800 ipv4: igmp: fix refcnt uaf issue when receiving igmp query packet When I perform the following test operations: 1.ip link add br0 type bridge 2.brctl addif br0 eth0 3.ip addr add 239.0.0.1/32 dev eth0 4.ip addr add 239.0.0.1/32 dev br0 5.ip addr add 224.0.0.1/32 dev br0 6.while ((1)) do ifconfig br0 up ifconfig br0 down done 7.send IGMPv2 query packets to port eth0 continuously. For example, ./mausezahn ethX -c 0 "01 00 5e 00 00 01 00 72 19 88 aa 02 08 00 45 00 00 1c 00 01 00 00 01 02 0e 7f c0 a8 0a b7 e0 00 00 01 11 64 ee 9b 00 00 00 00" The preceding tests may trigger the refcnt uaf issue of the mc list. The stack is as follows: refcount_t: addition on 0; use-after-free. WARNING: CPU: 21 PID: 144 at lib/refcount.c:25 refcount_warn_saturate (lib/refcount.c:25) CPU: 21 PID: 144 Comm: ksoftirqd/21 Kdump: loaded Not tainted 6.7.0-rc1-next-20231117-dirty #80 Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011 RIP: 0010:refcount_warn_saturate (lib/refcount.c:25) RSP: 0018:ffffb68f00657910 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffff8a00c3bf96c0 RCX: ffff8a07b6160908 RDX: 00000000ffffffd8 RSI: 0000000000000027 RDI: ffff8a07b6160900 RBP: ffff8a00cba36862 R08: 0000000000000000 R09: 00000000ffff7fff R10: ffffb68f006577c0 R11: ffffffffb0fdcdc8 R12: ffff8a00c3bf9680 R13: ffff8a00c3bf96f0 R14: 0000000000000000 R15: ffff8a00d8766e00 FS: 0000000000000000(0000) GS:ffff8a07b6140000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055f10b520b28 CR3: 000000039741a000 CR4: 00000000000006f0 Call Trace: igmp_heard_query (net/ipv4/igmp.c:1068) igmp_rcv (net/ipv4/igmp.c:1132) ip_protocol_deliver_rcu (net/ipv4/ip_input.c:205) ip_local_deliver_finish (net/ipv4/ip_input.c:234) __netif_receive_skb_one_core (net/core/dev.c:5529) netif_receive_skb_internal (net/core/dev.c:5729) netif_receive_skb (net/core/dev.c:5788) br_handle_frame_finish (net/bridge/br_input.c:216) nf_hook_bridge_pre (net/bridge/br_input.c:294) __netif_receive_skb_core (net/core/dev.c:5423) __netif_receive_skb_list_core (net/core/dev.c:5606) __netif_receive_skb_list (net/core/dev.c:5674) netif_receive_skb_list_internal (net/core/dev.c:5764) napi_gro_receive (net/core/gro.c:609) e1000_clean_rx_irq (drivers/net/ethernet/intel/e1000/e1000_main.c:4467) e1000_clean (drivers/net/ethernet/intel/e1000/e1000_main.c:3805) __napi_poll (net/core/dev.c:6533) net_rx_action (net/core/dev.c:6735) __do_softirq (kernel/softirq.c:554) run_ksoftirqd (kernel/softirq.c:913) smpboot_thread_fn (kernel/smpboot.c:164) kthread (kernel/kthread.c:388) ret_from_fork (arch/x86/kernel/process.c:153) ret_from_fork_asm (arch/x86/entry/entry_64.S:250) The root causes are as follows: Thread A Thread B ... netif_receive_skb br_dev_stop ... br_multicast_leave_snoopers ... __ip_mc_dec_group ... __igmp_group_dropped igmp_rcv igmp_stop_timer igmp_heard_query //ref = 1 ip_ma_put igmp_mod_timer refcount_dec_and_test igmp_start_timer //ref = 0 ... refcount_inc //ref increases from 0 When the device receives an IGMPv2 Query message, it starts the timer immediately, regardless of whether the device is running. If the device is down and has left the multicast group, it will cause the mc list refcount uaf issue. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Zhengchao Shao Reviewed-by: Eric Dumazet Reviewed-by: Hangbin Liu Signed-off-by: David S. Miller commit 237ff253f2d4f6307b7b20434d7cbcc67693298b Author: Edward Adam Davis Date: Thu Nov 23 09:23:39 2023 +0800 mptcp: fix uninit-value in mptcp_incoming_options Added initialization use_ack to mptcp_parse_option(). Reported-by: syzbot+b834a6b2decad004cfa1@syzkaller.appspotmail.com Signed-off-by: Edward Adam Davis Acked-by: Paolo Abeni Signed-off-by: David S. Miller commit 68516f60c1d8b0a71e516d630f66b99cb50e0150 Author: David Howells Date: Thu Nov 2 16:24:00 2023 +0000 afs: Mark a superblock for an R/O or Backup volume as SB_RDONLY Mark a superblock that is for for an R/O or Backup volume as SB_RDONLY when mounting it. Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org commit b590eb41be766c5a63acc7e8896a042f7a4e8293 Author: David Howells Date: Wed Nov 1 22:03:28 2023 +0000 afs: Fix file locking on R/O volumes to operate in local mode AFS doesn't really do locking on R/O volumes as fileservers don't maintain state with each other and thus a lock on a R/O volume file on one fileserver will not be be visible to someone looking at the same file on another fileserver. Further, the server may return an error if you try it. Fix this by doing what other AFS clients do and handle filelocking on R/O volume files entirely within the client and don't touch the server. Fixes: 6c6c1d63c243 ("afs: Provide mount-time configurable byte-range file locking emulation") Signed-off-by: David Howells Reviewed-by: Marc Dionne cc: linux-afs@lists.infradead.org commit 0167236e7d66c5e1e85d902a6abc2529b7544539 Author: David Howells Date: Thu Oct 26 01:25:07 2023 +0100 afs: Return ENOENT if no cell DNS record can be found Make AFS return error ENOENT if no cell SRV or AFSDB DNS record (or cellservdb config file record) can be found rather than returning EDESTADDRREQ. Also add cell name lookup info to the cursor dump. Fixes: d5c32c89b208 ("afs: Fix cell DNS lookup") Reported-by: Markus Suvanto Link: https://bugzilla.kernel.org/show_bug.cgi?id=216637 Signed-off-by: David Howells Reviewed-by: Marc Dionne cc: linux-afs@lists.infradead.org commit 31ed8da1c8e5e504710bb36863700e3389f8fc81 Author: Ranjani Sridharan Date: Fri Nov 24 15:57:43 2023 +0200 ASoC: SOF: sof-audio: Modify logic for enabling/disabling topology cores In the current code, we enable a widget core when it is set up and disable it when it is freed. This is problematic with IPC4 because widget free is essentially a NOP and all widgets are freed in the firmware when the pipeline is deleted. This results in a crash during pipeline deletion when one of it's widgets is scheduled to run on a secondary core and is powered off when widget is freed. So, change the logic to enable all cores needed by all the modules in a pipeline when the pipeline widget is set up and disable them after the pipeline widget is freed. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20231124135743.24674-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 0376b995bb7a65fb0c056f3adc5e9695ad0c1805 Author: Ranjani Sridharan Date: Fri Nov 24 15:57:42 2023 +0200 ASoC: SOF: ipc4-topology: Add core_mask in struct snd_sof_pipeline With IPC4, a pipeline may contain multiple modules in the data processing domain and they can be scheduled to run on different cores. Add a new field in struct snd_sof_pipeline to keep track of all the cores that are associated with the modules in the pipeline. Set the pipeline core mask for IPC3 when initializing the pipeline widget IPC structure. For IPC4, set the core mark when initializing the pipeline widget and initializing processing modules in the data processing domain. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20231124135743.24674-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 54bed6bafa0f38daf9697af50e3aff5ff1354fe1 Author: Amelie Delaunay Date: Mon Nov 6 14:48:32 2023 +0100 dmaengine: stm32-dma: avoid bitfield overflow assertion stm32_dma_get_burst() returns a negative error for invalid input, which gets turned into a large u32 value in stm32_dma_prep_dma_memcpy() that in turn triggers an assertion because it does not fit into a two-bit field: drivers/dma/stm32-dma.c: In function 'stm32_dma_prep_dma_memcpy': include/linux/compiler_types.h:354:38: error: call to '__compiletime_assert_282' declared with attribute error: FIELD_PREP: value too large for the field _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^ include/linux/compiler_types.h:335:4: note: in definition of macro '__compiletime_assert' prefix ## suffix(); \ ^~~~~~ include/linux/compiler_types.h:354:2: note: in expansion of macro '_compiletime_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ^~~~~~~~~~~~~~~~~~~ include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert' #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) ^~~~~~~~~~~~~~~~~~ include/linux/bitfield.h:68:3: note: in expansion of macro 'BUILD_BUG_ON_MSG' BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \ ^~~~~~~~~~~~~~~~ include/linux/bitfield.h:114:3: note: in expansion of macro '__BF_FIELD_CHECK' __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \ ^~~~~~~~~~~~~~~~ drivers/dma/stm32-dma.c:1237:4: note: in expansion of macro 'FIELD_PREP' FIELD_PREP(STM32_DMA_SCR_PBURST_MASK, dma_burst) | ^~~~~~~~~~ As an easy workaround, assume the error can happen, so try to handle this by failing stm32_dma_prep_dma_memcpy() before the assertion. It replicates what is done in stm32_dma_set_xfer_param() where stm32_dma_get_burst() is also used. Fixes: 1c32d6c37cc2 ("dmaengine: stm32-dma: use bitfield helpers") Fixes: a2b6103b7a8a ("dmaengine: stm32-dma: Improve memory burst management") Signed-off-by: Arnd Bergmann Signed-off-by: Amelie Delaunay Cc: stable@vger.kernel.org Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311060135.Q9eMnpCL-lkp@intel.com/ Link: https://lore.kernel.org/r/20231106134832.1470305-1-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit fba293488ccb1902e715da328e71aa868dd561f6 Author: Peter Ujfalusi Date: Fri Nov 24 14:40:32 2023 +0200 ASoC: Intel: sof_sdw: Always register the HDMI dai links The topology files for SDW devices require HDMI dai links to be present and this is granted under normal conditions but in case of special use cases the display (i915) driver might not be enabled due to deny-listing, booting with nomodeset or just not compiled at all. This should not block the non HDMI audio to be usable so register the dai links unconditionally. The code has been prepared for this and in case of no HDMI audio the link is created with dummy codec. Closes: https://github.com/thesofproject/linux/issues/4594 Closes: https://github.com/thesofproject/linux/issues/4648 Signed-off-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231124124032.15946-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 3d1dc8b1030df8ca0fdfd4905c88ee10db943bf8 Author: Peter Ujfalusi Date: Fri Nov 24 14:40:15 2023 +0200 ASoC: Intel: skl_hda_dsp_generic: Drop HDMI routes when HDMI is not available When the HDMI is not present due to disabled display support we will use dummy codec and the HDMI routes will refer to non existent DAPM widgets. Trim the route list from the HDMI routes to be able to probe the card even if the HDMI dais are not registered. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231124124015.15878-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 3448397a47c08c291c3fccb7ac5f0f429fd547e0 Author: Xiaolei Wang Date: Tue Nov 14 06:57:13 2023 +0800 dmaengine: fsl-edma: Add judgment on enabling round robin arbitration Add judgment on enabling round robin arbitration to avoid exceptions if this function is not supported. Call trace: fsl_edma_resume_early+0x1d4/0x208 dpm_run_callback+0xd4/0x304 device_resume_early+0xb0/0x208 dpm_resume_early+0x224/0x528 suspend_devices_and_enter+0x3e4/0xd00 pm_suspend+0x3c4/0x910 state_store+0x90/0x124 kobj_attr_store+0x48/0x64 sysfs_kf_write+0x84/0xb4 kernfs_fop_write_iter+0x19c/0x264 vfs_write+0x664/0x858 ksys_write+0xc8/0x180 __arm64_sys_write+0x44/0x58 invoke_syscall+0x5c/0x178 el0_svc_common.constprop.0+0x11c/0x14c do_el0_svc+0x30/0x40 el0_svc+0x58/0xa8 el0t_64_sync_handler+0xc0/0xc4 el0t_64_sync+0x190/0x194 Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support") Signed-off-by: Xiaolei Wang Reviewed-by: Frank Li Link: https://lore.kernel.org/r/20231113225713.1892643-3-xiaolei.wang@windriver.com Signed-off-by: Vinod Koul commit 2838a897654c4810153cc51646414ffa54fd23b0 Author: Xiaolei Wang Date: Tue Nov 14 06:57:12 2023 +0800 dmaengine: fsl-edma: Do not suspend and resume the masked dma channel when the system is sleeping Some channels may be masked. When the system is suspended, if these masked channels are not filtered out, this will lead to null pointer operations and system crash: Unable to handle kernel NULL pointer dereference at virtual address Mem abort info: ESR = 0x0000000096000004 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, ISS2 = 0x00000000 CM = 0, WnR = 0, TnD = 0, TagAccess = 0 GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 user pgtable: 4k pages, 48-bit VAs, pgdp=0000000894300000 [00000000000002a0] pgd=0000000000000000, p4d=0000000000000000 Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP Modules linked in: CPU: 1 PID: 989 Comm: sh Tainted: G B 6.6.0-16203-g557fb7a3ec4c-dirty #70 Hardware name: Freescale i.MX8QM MEK (DT) pstate: 400000c5 (nZcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc: fsl_edma_disable_request+0x3c/0x78 lr: fsl_edma_disable_request+0x3c/0x78 sp:ffff800089ae7690 x29: ffff800089ae7690 x28: ffff000807ab5440 x27: ffff000807ab5830 x26: 0000000000000008 x25: 0000000000000278 x24: 0000000000000001 23: ffff000807ab4328 x22: 0000000000000000 x21: 0000000000000009 x20: ffff800082616940 x19: 0000000000000000 x18: 0000000000000000 x17: 3d3d3d3d3d3d3d3d x16: 3d3d3d3d3d3d3d3d x15: 3d3d3d3d3d3d3d3d x14: 3d3d3d3d3d3d3d3d x13: 3d3d3d3d3d3d3d3d x12: 1ffff00010d45724 x11: ffff700010d45724 x10: dfff800000000000 x9: dfff800000000000 x8: 00008fffef2ba8dc x7: 0000000000000001 x6: ffff800086a2b927 x5: ffff800086a2b920 x4: ffff700010d45725 x3: ffff8000800d5bbc x2 : 0000000000000000 x1 : ffff000800c1d880 x0 : 0000000000000001 Call trace: fsl_edma_disable_request+0x3c/0x78 fsl_edma_suspend_late+0x128/0x12c dpm_run_callback+0xd4/0x304 __device_suspend_late+0xd0/0x240 dpm_suspend_late+0x174/0x59c suspend_devices_and_enter+0x194/0xd00 pm_suspend+0x3c4/0x910 Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support") Signed-off-by: Xiaolei Wang Link: https://lore.kernel.org/r/20231113225713.1892643-2-xiaolei.wang@windriver.com Signed-off-by: Vinod Koul commit b5ec294472794ed9ecba0cb4b8208372842e7e0d Author: Krzysztof Kozlowski Date: Thu Aug 10 11:13:00 2023 +0200 reset: hisilicon: hi6220: fix Wvoid-pointer-to-enum-cast warning 'type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: hi6220_reset.c:166:9: error: cast to smaller integer type 'enum hi6220_reset_ctrl_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230810091300.70197-1-krzysztof.kozlowski@linaro.org Signed-off-by: Philipp Zabel commit 90785ea8158b6923c5d6a024f2b1c076110577b5 Author: Chester Lin Date: Thu Nov 16 08:19:13 2023 +0800 dt-bindings: pinctrl: s32g2: change a maintainer email address I am leaving SUSE so the current email address will be disabled soon. will be my new address for handling emails, patches and pull requests from upstream and communities. Cc: Chester Lin Cc: NXP S32 Linux Team Cc: Ghennadi Procopciuc Cc: Linus Walleij Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: Conor Dooley Signed-off-by: Chester Lin Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231116001913.16121-1-clin@suse.com Signed-off-by: Linus Walleij commit bca4104b00fec60be330cd32818dd5c70db3d469 Author: Peter Zijlstra Date: Tue Nov 21 12:41:26 2023 +0100 lockdep: Fix block chain corruption Kent reported an occasional KASAN splat in lockdep. Mark then noted: > I suspect the dodgy access is to chain_block_buckets[-1], which hits the last 4 > bytes of the redzone and gets (incorrectly/misleadingly) attributed to > nr_large_chain_blocks. That would mean @size == 0, at which point size_to_bucket() returns -1 and the above happens. alloc_chain_hlocks() has 'size - req', for the first with the precondition 'size >= rq', which allows the 0. This code is trying to split a block, del_chain_block() takes what we need, and add_chain_block() puts back the remainder, except in the above case the remainder is 0 sized and things go sideways. Fixes: 810507fe6fd5 ("locking/lockdep: Reuse freed chain_hlocks entries") Reported-by: Kent Overstreet Signed-off-by: Peter Zijlstra (Intel) Tested-by: Kent Overstreet Link: https://lkml.kernel.org/r/20231121114126.GH8262@noisy.programming.kicks-ass.net commit 38a285d5d446ce80b21f997cdc747cc11678b4e0 Author: Tzuyi Chang Date: Tue Nov 21 17:11:07 2023 +0800 pinctrl: realtek: Fix logical error when finding descriptor The pin descriptor should be returned if the name has been found in the descriptor table. Remove the negation in the if statement for accurate retrieval. Fixes: e99ce78030db ("pinctrl: realtek: Add common pinctrl driver for Realtek DHC RTD SoCs") Signed-off-by: Tzuyi Chang Link: https://lore.kernel.org/r/20231121091107.5564-1-tychang@realtek.com Signed-off-by: Linus Walleij commit be37542afbfcd27b3bb99a135abf9b4736b96f75 Author: Jai Luthra Date: Thu Nov 23 14:57:31 2023 +0530 dmaengine: ti: k3-psil-am62a: Fix SPI PDMA data AM62Ax has 3 SPI channels where each channel has 4x TX and 4x RX threads. Also fix the thread numbers to match what the firmware expects according to the PSI-L device description. Link: http://downloads.ti.com/tisci/esd/latest/5_soc_doc/am62ax/psil_cfg.html [1] Fixes: aac6db7e243a ("dmaengine: ti: k3-psil-am62a: Add AM62Ax PSIL and PDMA data") Signed-off-by: Jai Luthra Link: https://lore.kernel.org/r/20231123-psil_fix-v1-1-6604d80819be@ti.com Signed-off-by: Vinod Koul commit 0af8a06a4ce823e380385cdd9538cdd968a1ffae Author: Kent Overstreet Date: Mon Nov 20 18:23:26 2023 -0500 bcachefs: deallocate_extra_replicas() When allocating from devices with different durability, we might end up with more replicas than required; this changes bch2_alloc_sectors_start() to check for this, and drop replicas that aren't needed to hit the number of replicas requested. Signed-off-by: Kent Overstreet commit 8a443d3ea1327fea5ac3be77d2e39ebe35bfe9cf Author: Kent Overstreet Date: Fri Nov 17 23:13:49 2023 -0500 bcachefs: Proper refcounting for journal_keys The btree iterator code overlays keys from the journal until journal replay is finished; since we're now starting copygc/rebalance etc. before replay is finished, this is multithreaded access and thus needs refcounting. Signed-off-by: Kent Overstreet commit 63807d951803e422cea8bfb4fdd36f57de191ada Author: Brian Foster Date: Thu Nov 16 12:13:43 2023 -0500 bcachefs: preserve device path as device name Various userspace scripts/tools may expect mount entries in /proc/mounts to reflect the device path names used to mount the associated filesystem. bcachefs seems to normalize the device path to the underlying device name based on the block device. This confuses tools like fstests when the test devices might be lvm or device-mapper based. The default behavior for show_vfsmnt() appers to be to use the string passed to alloc_vfsmnt(), so tweak bcachefs to copy the path at device superblock read time and to display it via ->show_devname(). Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 0a11adfb7aceb65831ff1c4d129d611e54fc3f57 Author: Kent Overstreet Date: Sat Nov 11 16:31:20 2023 -0500 bcachefs: Fix an endianness conversion cpu_to_le32(), not le32_to_cpu() - fixes a sparse complaint. Signed-off-by: Kent Overstreet commit 468035ca4b83fd49be99a67b5aac3960d577c7c5 Author: Kent Overstreet Date: Fri Nov 24 00:55:59 2023 -0500 bcachefs: Start gc, copygc, rebalance threads after initing writes ref This fixes a bug where copygc would occasionally race with going read-write and die, thinking we were read only, because it couldn't take a ref on c->writes. It's not necessary for copygc (or rebalance, or copygc) to take write refs; they could run with BCH_TRANS_COMMIT_nocheck_rw, but this is an easier fix that making sure that flag is passed correctly everywhere. Signed-off-by: Kent Overstreet commit 202a7c292ec65d5a602aa356f4fa4f50ff84cdee Author: Kent Overstreet Date: Fri Nov 24 00:54:43 2023 -0500 bcachefs: Don't stop copygc thread on device resize copygc no longer has to scan the buckets, so it's no longer a problem if the number of buckets is changing while it's running. This also fixes a bug where we forgot to restart copygc. Signed-off-by: Kent Overstreet commit 261af2f1c6b668586325a37df02f904c1c273a7d Author: Kent Overstreet Date: Wed Nov 22 23:44:47 2023 -0500 bcachefs: Make sure bch2_move_ratelimit() also waits for move_ops This adds move_ctxt_wait_event_timeout(), which can sleep for a timeout while also issueing pending moves as reads complete. Co-developed-by: Daniel Hill Signed-off-by: Kent Overstreet commit 50e029c6390a6795869b742a5fce1e57d6a76c82 Author: Kent Overstreet Date: Mon Nov 20 17:24:32 2023 -0500 bcachefs: bch2_moving_ctxt_flush_all() Introduce a new helper to flush all move IOs, and use it in a few places where we should have been. The new helper also drops btree locks before waiting on outstanding move writes, avoiding potential deadlocks. Signed-off-by: Kent Overstreet commit 6201d91ee32cf92e9bcca69a3cf73461827b5ce5 Author: Kent Overstreet Date: Thu Nov 23 17:56:14 2023 -0500 bcachefs: Put erasure coding behind an EXPERIMENTAL kconfig option We still have disk space accounting changes coming for erasure coding, and the changes won't be as strictly backwards compatible as they'd ought to be - specifically, we need to start accounting striped data under a separate counter in bch_alloc (which describes buckets). A fsck will suffice for upgrading/downgrading, but since erasure coding is the most incomplete major feature of bcachefs it still makes sense to put behind a separate kconfig option, so that users are fully aware. Signed-off-by: Kent Overstreet commit d4e3b928ab487a8aecd1f6a140b40ac365116cfb Author: Kent Overstreet Date: Fri Nov 17 19:13:27 2023 -0500 closures: CLOSURE_CALLBACK() to fix type punning Control flow integrity is now checking that type signatures match on indirect function calls. That breaks closures, which embed a work_struct in a closure in such a way that a closure_fn may also be used as a workqueue fn by the underlying closure code. So we have to change closure fns to take a work_struct as their argument - but that results in a loss of clarity, as closure fns have different semantics from normal workqueue functions (they run owning a ref on the closure, which must be released with continue_at() or closure_return()). Thus, this patc introduces CLOSURE_CALLBACK() and closure_type() macros as suggested by Kees, to smooth things over a bit. Suggested-by: Kees Cook Cc: Coly Li Signed-off-by: Kent Overstreet commit cd80ce7e68f1624ac29cd0a6b057789d1236641e Author: Namjae Jeon Date: Wed Nov 22 23:01:43 2023 +0900 ksmbd: don't update ->op_state as OPLOCK_STATE_NONE on error ksmbd set ->op_state as OPLOCK_STATE_NONE on lease break ack error. op_state of lease should not be updated because client can send lease break ack again. This patch fix smb2.lease.breaking2 test failure. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 9ac45ac7cf65b0623ceeab9b28b307a08efa22dc Author: Namjae Jeon Date: Wed Nov 22 23:00:59 2023 +0900 ksmbd: move setting SMB2_FLAGS_ASYNC_COMMAND and AsyncId Directly set SMB2_FLAGS_ASYNC_COMMAND flags and AsyncId in smb2 header of interim response instead of current response header. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 2a3f7857ec742e212d6cee7fbbf7b0e2ae7f5161 Author: Namjae Jeon Date: Wed Nov 22 23:00:22 2023 +0900 ksmbd: release interim response after sending status pending response Add missing release async id and delete interim response entry after sending status pending response. This only cause when smb2 lease is enable. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 2e450920d58b4991a436c8cecf3484bcacd8e535 Author: Namjae Jeon Date: Mon Nov 20 23:39:39 2023 +0900 ksmbd: move oplock handling after unlock parent dir ksmbd should process secound parallel smb2 create request during waiting oplock break ack. parent lock range that is too large in smb2_open() causes smb2_open() to be serialized. Move the oplock handling to the bottom of smb2_open() and make it called after parent unlock. This fixes the failure of smb2.lease.breaking1 testcase. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 4274a9dc6aeb9fea66bffba15697a35ae8983b6a Author: Namjae Jeon Date: Mon Nov 20 09:13:54 2023 +0900 ksmbd: separately allocate ci per dentry xfstests generic/002 test fail when enabling smb2 leases feature. This test create hard link file, but removeal failed. ci has a file open count to count file open through the smb client, but in the case of hard link files, The allocation of ci per inode cause incorrectly open count for file deletion. This patch allocate ci per dentry to counts open counts for hard link. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 864fb5d3716303a045c3ffb397f651bfd37bfb36 Author: Namjae Jeon Date: Mon Nov 20 09:23:09 2023 +0900 ksmbd: fix possible deadlock in smb2_open [ 8743.393379] ====================================================== [ 8743.393385] WARNING: possible circular locking dependency detected [ 8743.393391] 6.4.0-rc1+ #11 Tainted: G OE [ 8743.393397] ------------------------------------------------------ [ 8743.393402] kworker/0:2/12921 is trying to acquire lock: [ 8743.393408] ffff888127a14460 (sb_writers#8){.+.+}-{0:0}, at: ksmbd_vfs_setxattr+0x3d/0xd0 [ksmbd] [ 8743.393510] but task is already holding lock: [ 8743.393515] ffff8880360d97f0 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: ksmbd_vfs_kern_path_locked+0x181/0x670 [ksmbd] [ 8743.393618] which lock already depends on the new lock. [ 8743.393623] the existing dependency chain (in reverse order) is: [ 8743.393628] -> #1 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}: [ 8743.393648] down_write_nested+0x9a/0x1b0 [ 8743.393660] filename_create+0x128/0x270 [ 8743.393670] do_mkdirat+0xab/0x1f0 [ 8743.393680] __x64_sys_mkdir+0x47/0x60 [ 8743.393690] do_syscall_64+0x5d/0x90 [ 8743.393701] entry_SYSCALL_64_after_hwframe+0x72/0xdc [ 8743.393711] -> #0 (sb_writers#8){.+.+}-{0:0}: [ 8743.393728] __lock_acquire+0x2201/0x3b80 [ 8743.393737] lock_acquire+0x18f/0x440 [ 8743.393746] mnt_want_write+0x5f/0x240 [ 8743.393755] ksmbd_vfs_setxattr+0x3d/0xd0 [ksmbd] [ 8743.393839] ksmbd_vfs_set_dos_attrib_xattr+0xcc/0x110 [ksmbd] [ 8743.393924] compat_ksmbd_vfs_set_dos_attrib_xattr+0x39/0x50 [ksmbd] [ 8743.394010] smb2_open+0x3432/0x3cc0 [ksmbd] [ 8743.394099] handle_ksmbd_work+0x2c9/0x7b0 [ksmbd] [ 8743.394187] process_one_work+0x65a/0xb30 [ 8743.394198] worker_thread+0x2cf/0x700 [ 8743.394209] kthread+0x1ad/0x1f0 [ 8743.394218] ret_from_fork+0x29/0x50 This patch add mnt_want_write() above parent inode lock and remove nested mnt_want_write calls in smb2_open(). Fixes: 40b268d384a2 ("ksmbd: add mnt_want_write to ksmbd vfs functions") Cc: stable@vger.kernel.org Reported-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 90044481e7cca6cb3125b3906544954a25f1309f Author: Zongmin Zhou Date: Mon Nov 20 23:48:17 2023 +0900 ksmbd: prevent memory leak on error return When allocated memory for 'new' failed,just return will cause memory leak of 'ar'. Fixes: 1819a9042999 ("ksmbd: reorganize ksmbd_iov_pin_rsp()") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202311031837.H3yo7JVl-lkp@intel.com/ Signed-off-by: Zongmin Zhou Acked-by: Namjae Jeon Signed-off-by: Steve French commit c9213ddad2bdb43ef17d86f07ad6c45ca2b4acd5 Merge: d3fa86b1a7b4c 782486af9b5b7 Author: David S. Miller Date: Fri Nov 24 01:52:36 2023 +0000 Merge branch 'rswitch-fixes' Yoshihiro Shimoda says: ==================== net: rswitch: Fix issues in rswitch_start_xmit() This patch series is based on the latest net.git / main branch. Changes from v2: https://lore.kernel.org/all/20231122012556.3645840-1-yoshihiro.shimoda.uh@renesas.com/ - Keep reverse christmas tree of local variable declarations in patch 1/3. Changes from v1: https://lore.kernel.org/all/20231121055255.3627949-1-yoshihiro.shimoda.uh@renesas.com/ - Separate a patch because fixing 2 issues. - Add fixing wrong type of return value. - Use goto for improving code readability. ==================== Signed-off-by: David S. Miller commit 782486af9b5b76493012711413c141509ac45dec Author: Yoshihiro Shimoda Date: Wed Nov 22 14:11:43 2023 +0900 net: rswitch: Fix missing dev_kfree_skb_any() in error path Before returning the rswitch_start_xmit() in the error path, dev_kfree_skb_any() should be called. So, fix it. Fixes: 33f5d733b589 ("net: renesas: rswitch: Improve TX timestamp accuracy") Signed-off-by: Yoshihiro Shimoda Reviewed-by: Wojciech Drewek Signed-off-by: David S. Miller commit 1aaef8634a20b322c82e84f12a9b6aec1e2fd4fa Author: Yoshihiro Shimoda Date: Wed Nov 22 14:11:42 2023 +0900 net: rswitch: Fix return value in rswitch_start_xmit() This .ndo_start_xmit() function should return netdev_tx_t value, not -ENOMEM. So, fix it. Fixes: 33f5d733b589 ("net: renesas: rswitch: Improve TX timestamp accuracy") Signed-off-by: Yoshihiro Shimoda Reviewed-by: Wojciech Drewek Signed-off-by: David S. Miller commit 109b25d13e0054337860d44841b990d11b32d262 Author: Yoshihiro Shimoda Date: Wed Nov 22 14:11:41 2023 +0900 net: rswitch: Fix type of ret in rswitch_start_xmit() The type of ret in rswitch_start_xmit() should be netdev_tx_t. So, fix it. Fixes: 3590918b5d07 ("net: ethernet: renesas: Add support for "Ethernet Switch"") Signed-off-by: Yoshihiro Shimoda Reviewed-by: Wojciech Drewek Signed-off-by: David S. Miller commit f1a09972a45ae63efbd1587337c4be13b1893330 Merge: bc893f744ef04 a6925165ea82b Author: Linus Torvalds Date: Thu Nov 23 17:45:49 2023 -0800 Merge tag 'ata-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fix from Damien Le Moal: - Add a missing error check in the adapter initialization of the pata_isapnp driver (Chen) * tag 'ata-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: pata_isapnp: Add missing error check for devm_ioport_map() commit bc893f744ef04e118f7bcf848fd33f8016b63f7d Merge: 004442384416c 0e6c4fe782e68 Author: Linus Torvalds Date: Thu Nov 23 17:40:15 2023 -0800 Merge tag 'block-6.7-2023-11-23' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: "A bit bigger than usual at this time, but nothing really earth shattering: - NVMe pull request via Keith: - TCP TLS fixes (Hannes) - Authentifaction fixes (Mark, Hannes) - Properly terminate target names (Christoph) - MD pull request via Song, fixing a raid5 corruption issue - Disentanglement of the dependency mess in nvme introduced with the tls additions. Now it should actually build on all configs (Arnd) - Series of bcache fixes (Coly) - Removal of a dead helper (Damien) - s390 dasd fix (Muhammad, Jan) - lockdep blk-cgroup fixes (Ming)" * tag 'block-6.7-2023-11-23' of git://git.kernel.dk/linux: (33 commits) nvme: tcp: fix compile-time checks for TLS mode nvme: target: fix Kconfig select statements nvme: target: fix nvme_keyring_id() references nvme: move nvme_stop_keep_alive() back to original position nbd: pass nbd_sock to nbd_read_reply() instead of index s390/dasd: protect device queue against concurrent access s390/dasd: resolve spelling mistake block/null_blk: Fix double blk_mq_start_request() warning nvmet-tcp: always initialize tls_handshake_tmo_work nvmet: nul-terminate the NQNs passed in the connect command nvme: blank out authentication fabrics options if not configured nvme: catch errors from nvme_configure_metadata() nvme-tcp: only evaluate 'tls' option if TLS is selected nvme-auth: set explanation code for failure2 msgs nvme-auth: unlock mutex in one place only block: Remove blk_set_runtime_active() nbd: fix null-ptr-dereference while accessing 'nbd->config' nbd: factor out a helper to get nbd_config without holding 'config_lock' nbd: fold nbd config initialization into nbd_alloc_config() bcache: avoid NULL checking to c->root in run_cache_set() ... commit 004442384416cbb3cedf99eb8ab5f10c32e4dd34 Merge: 1f342790ad3c2 d6fef34ee4d10 Author: Linus Torvalds Date: Thu Nov 23 17:36:29 2023 -0800 Merge tag 'io_uring-6.7-2023-11-23' of git://git.kernel.dk/linux Pull io_uring fixes from Jens Axboe: "A fix for ensuring that LINKAT always propagates flags correctly, and a fix for an off-by-one in segment skipping for registered buffers. Both heading to stable as well" * tag 'io_uring-6.7-2023-11-23' of git://git.kernel.dk/linux: io_uring: fix off-by one bvec index io_uring/fs: consider link->flags when getting path for LINKAT commit 1f342790ad3c2456e15351829ad5d8919cccc03f Merge: d3fa86b1a7b4c 9ffccb691adb8 Author: Linus Torvalds Date: Thu Nov 23 17:31:53 2023 -0800 Merge tag 'for-linus-2023112301' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Jiri Kosina: - revert of commit that caused regression to many Logitech unifying receiver users (Jiri Kosina) - power management fix for hid-mcp2221 (Hamish Martin) - fix for race condition between HID core and HID debug (Charles Yi) - a couple of assorted device-ID-specific quirks * tag 'for-linus-2023112301' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: multitouch: Add quirk for HONOR GLO-GXXX touchpad HID: hid-asus: reset the backlight brightness level on resume HID: hid-asus: add const to read-only outgoing usb buffer Revert "HID: logitech-dj: Add support for a new lightspeed receiver iteration" HID: add ALWAYS_POLL quirk for Apple kb HID: glorious: fix Glorious Model I HID report HID: fix HID device resource race between HID core and debugging support HID: apple: add Jamesdonkey and A3R to non-apple keyboards list HID: mcp2221: Allow IO to start during probe HID: mcp2221: Set driver data before I2C adapter add commit b3ca8a08d8ed0dc8a9e236d9294efd58554a7b05 Merge: 8692160904c9b 0561794b6b642 Author: Dave Airlie Date: Fri Nov 24 11:18:28 2023 +1000 Merge tag 'drm-intel-fixes-2023-11-23' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915 fixes for v6.7-rc3: - Fix race between DP MST connectore registration and setup - Fix GT memory leak on probe error path Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87y1eol98h.fsf@intel.com commit 8692160904c9b8653b36e508c26be3cd9b79402a Merge: fca9a80563581 ab93edb2f94c3 Author: Dave Airlie Date: Fri Nov 24 11:14:56 2023 +1000 Merge tag 'drm-misc-fixes-2023-11-23' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Fixes for v6.7-rc3: - Panel fixes for innolux and auo,b101uan08.3 panel. - Fix ivpu MMIO reset. - AST fix on connetor disconnection. - nouveau gsp fix. - rockchip color fix. - Fix Himax83102-j02 timings. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/12322257-2e0c-43d3-8241-876aafc10e4a@linux.intel.com commit fca9a80563581468b67017acc0a27a9626822600 Merge: 98b1cc82c4aff 56466f653cb59 Author: Dave Airlie Date: Fri Nov 24 10:37:45 2023 +1000 Merge tag 'drm-msm-fixes-2023-11-21' of https://gitlab.freedesktop.org/drm/msm into drm-fixes Fixes for v6.7-rc3: - Fix the VREG_CTRL_1 for 4nm CPHY to match downstream - Remove duplicate call to drm_kms_helper_poll_init() in msm_drm_init() - Fix the safe_lut_tbl[] for sc8280xp to match downstream - Don't attach the drm_dp_set_subconnector_property() for eDP - Fix to attach drm_dp_set_subconnector_property() for DP. Otherwise there is a bootup crash on multiple targets - Remove unnecessary NULL check left behind during cleanup Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGtkna3P3mvaF53n2ARJACaXQU+OFfShayTrsUVmqCOmNQ@mail.gmail.com commit 7d410d5efe04e42a6cd959bfe6d59d559fdf8b25 Author: Filipe Manana Date: Tue Nov 21 13:38:33 2023 +0000 btrfs: make error messages more clear when getting a chunk map When getting a chunk map, at btrfs_get_chunk_map(), we do some sanity checks to verify we found a chunk map and that map found covers the logical address the caller passed in. However the messages aren't very clear in the sense that don't mention the issue is with a chunk map and one of them prints the 'length' argument as if it were the end offset of the requested range (while the in the string format we use %llu-%llu which suggests a range, and the second %llu-%llu is actually a range for the chunk map). So improve these two details in the error messages. CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5fba5a571858ce2d787fdaf55814e42725bfa895 Author: Filipe Manana Date: Tue Nov 21 13:38:32 2023 +0000 btrfs: fix off-by-one when checking chunk map includes logical address At btrfs_get_chunk_map() we get the extent map for the chunk that contains the given logical address stored in the 'logical' argument. Then we do sanity checks to verify the extent map contains the logical address. One of these checks verifies if the extent map covers a range with an end offset behind the target logical address - however this check has an off-by-one error since it will consider an extent map whose start offset plus its length matches the target logical address as inclusive, while the fact is that the last byte it covers is behind the target logical address (by 1). So fix this condition by using '<=' rather than '<' when comparing the extent map's "start + length" against the target logical address. CC: stable@vger.kernel.org # 4.14+ Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit f91192cd68591c6b037da345bc9fcd5e50540358 Author: Bragatheswaran Manickavel Date: Sat Nov 18 14:40:12 2023 +0530 btrfs: ref-verify: fix memory leaks in btrfs_ref_tree_mod() In btrfs_ref_tree_mod(), when !parent 're' was allocated through kmalloc(). In the following code, if an error occurs, the execution will be redirected to 'out' or 'out_unlock' and the function will be exited. However, on some of the paths, 're' are not deallocated and may lead to memory leaks. For example: lookup_block_entry() for 'be' returns NULL, the out label will be invoked. During that flow ref and 'ra' are freed but not 're', which can potentially lead to a memory leak. CC: stable@vger.kernel.org # 5.10+ Reported-and-tested-by: syzbot+d66de4cbf532749df35f@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f Signed-off-by: Bragatheswaran Manickavel Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2db313205f8b96eea467691917138d646bb50aef Author: Qu Wenruo Date: Thu Nov 2 07:54:50 2023 +1030 btrfs: add dmesg output for first mount and last unmount of a filesystem There is a feature request to add dmesg output when unmounting a btrfs. There are several alternative methods to do the same thing, but with their own problems: - Use eBPF to watch btrfs_put_super()/open_ctree() Not end user friendly, they have to dip their head into the source code. - Watch for directory /sys/fs// This is way more simple, but still requires some simple device -> uuid lookups. And a script needs to use inotify to watch /sys/fs/. Compared to all these, directly outputting the information into dmesg would be the most simple one, with both device and UUID included. And since we're here, also add the output when mounting a filesystem for the first time for parity. A more fine grained monitoring of subvolume mounts should be done by another layer, like audit. Now mounting a btrfs with all default mkfs options would look like this: [81.906566] BTRFS info (device dm-8): first mount of filesystem 633b5c16-afe3-4b79-b195-138fe145e4f2 [81.907494] BTRFS info (device dm-8): using crc32c (crc32c-intel) checksum algorithm [81.908258] BTRFS info (device dm-8): using free space tree [81.912644] BTRFS info (device dm-8): auto enabling async discard [81.913277] BTRFS info (device dm-8): checking UUID tree [91.668256] BTRFS info (device dm-8): last unmount of filesystem 633b5c16-afe3-4b79-b195-138fe145e4f2 CC: stable@vger.kernel.org # 5.4+ Link: https://github.com/kdave/btrfs-progs/issues/689 Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Reviewed-by: David Sterba [ update changelog ] Signed-off-by: David Sterba commit c0c6bde586c7dce82719b4ff32a2db6af9ee3d65 Author: Stanislav Fomichev Date: Mon Nov 13 20:54:52 2023 -0800 netdevsim: Don't accept device bound programs Commit 2b3486bc2d23 ("bpf: Introduce device-bound XDP programs") introduced device-bound programs by largely reusing existing offloading infrastructure. This changed the semantics of 'prog->aux->offload' a bit. Now, it's non-NULL for both offloaded and device-bound programs. Instead of looking at 'prog->aux->offload' let's call bpf_prog_is_offloaded which should be true iff the program is offloaded and not merely device-bound. Fixes: 2b3486bc2d23 ("bpf: Introduce device-bound XDP programs") Reported-by: syzbot+44c2416196b7c607f226@syzkaller.appspotmail.com Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Reviewed-by: Jakub Kicinski Cc: Dipendra Khadka Link: https://lore.kernel.org/bpf/20231114045453.1816995-2-sdf@google.com Signed-off-by: Alexei Starovoitov commit 58ac1b3799799069d53f5bf95c093f2fe8dd3cc5 Author: Arnd Bergmann Date: Wed Nov 22 18:15:03 2023 +0100 ARM: PL011: Fix DMA support Since there is no guarantee that the memory returned by dma_alloc_coherent() is associated with a 'struct page', using the architecture specific phys_to_page() is wrong, but using virt_to_page() would be as well. Stop using sg lists altogether and just use the *_single() functions instead. This also simplifies the code a bit since the scatterlists in this driver always have only one entry anyway. https://lore.kernel.org/lkml/86db0fe5-930d-4cbb-bd7d-03367da38951@app.fastmail.com/ Use consistent names for dma buffers gc: Add a commit log from the initial thread: https://lore.kernel.org/lkml/86db0fe5-930d-4cbb-bd7d-03367da38951@app.fastmail.com/ Use consistent names for dma buffers Fixes: cb06ff102e2d7 ("ARM: PL011: Add support for Rx DMA buffer polling.") Signed-off-by: Arnd Bergmann Tested-by: Gregory CLEMENT Signed-off-by: Gregory CLEMENT Cc: stable Link: https://lore.kernel.org/r/20231122171503.235649-1-gregory.clement@bootlin.com Signed-off-by: Greg Kroah-Hartman commit 08ce9a1b72e38cf44c300a44ac5858533eb3c860 Author: Daniel Mack Date: Thu Nov 23 08:28:18 2023 +0100 serial: sc16is7xx: address RX timeout interrupt errata This device has a silicon bug that makes it report a timeout interrupt but no data in the FIFO. The datasheet states the following in the errata section 18.1.4: "If the host reads the receive FIFO at the same time as a time-out interrupt condition happens, the host might read 0xCC (time-out) in the Interrupt Indication Register (IIR), but bit 0 of the Line Status Register (LSR) is not set (means there is no data in the receive FIFO)." The errata description seems to indicate it concerns only polled mode of operation when reading bit 0 of the LSR register. However, tests have shown and NXP has confirmed that the RXLVL register also yields 0 when the bug is triggered, and hence the IRQ driven implementation in this driver is equally affected. This bug has hit us on production units and when it does, sc16is7xx_irq() would spin forever because sc16is7xx_port_irq() keeps seeing an interrupt in the IIR register that is not cleared because the driver does not call into sc16is7xx_handle_rx() unless the RXLVL register reports at least one byte in the FIFO. Fix this by always reading one byte from the FIFO when this condition is detected in order to clear the interrupt. This approach was confirmed to be correct by NXP through their support channels. Tested by: Hugo Villeneuve Signed-off-by: Daniel Mack Co-Developed-by: Maxim Popov Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231123072818.1394539-1-daniel@zonque.org Signed-off-by: Greg Kroah-Hartman commit 8973ab7a2441b286218f4a5c4c33680e2f139996 Author: Ronald Wahl Date: Tue Oct 31 12:09:09 2023 +0100 serial: 8250: 8250_omap: Clear UART_HAS_RHR_IT_DIS bit This fixes commit 439c7183e5b9 ("serial: 8250: 8250_omap: Disable RX interrupt after DMA enable") which unfortunately set the UART_HAS_RHR_IT_DIS bit in the UART_OMAP_IER2 register and never cleared it. Cc: stable@vger.kernel.org Fixes: 439c7183e5b9 ("serial: 8250: 8250_omap: Disable RX interrupt after DMA enable") Signed-off-by: Ronald Wahl Reviewed-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20231031110909.11695-1-rwahl@gmx.de Signed-off-by: Greg Kroah-Hartman commit 8e42c301ce64e0dcca547626eb486877d502d336 Author: Ronald Wahl Date: Tue Oct 31 14:12:42 2023 +0100 serial: 8250_omap: Add earlycon support for the AM654 UART controller Currently there is no support for earlycon on the AM654 UART controller. This commit adds it. Signed-off-by: Ronald Wahl Reviewed-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20231031131242.15516-1-rwahl@gmx.de Cc: stable Signed-off-by: Greg Kroah-Hartman commit c6bb057418876cdfdd29a6f7b8cef54539ee8811 Author: Ronald Wahl Date: Wed Nov 1 18:14:31 2023 +0100 serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt Starting RX DMA on THRI interrupt is too early because TX may not have finished yet. This change is inspired by commit 90b8596ac460 ("serial: 8250: Prevent starting up DMA Rx on THRI interrupt") and fixes DMA issues I had with an AM62 SoC that is using the 8250 OMAP variant. Cc: stable@vger.kernel.org Fixes: c26389f998a8 ("serial: 8250: 8250_omap: Add DMA support for UARTs on K3 SoCs") Signed-off-by: Ronald Wahl Reviewed-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20231101171431.16495-1-rwahl@gmx.de Signed-off-by: Greg Kroah-Hartman commit c0a8574204054effad6ac83cc75c02576e2985fe Author: Masahiro Yamada Date: Sun Nov 19 14:32:34 2023 +0900 arm64: add dependency between vmlinuz.efi and Image A common issue in Makefile is a race in parallel building. You need to be careful to prevent multiple threads from writing to the same file simultaneously. Commit 3939f3345050 ("ARM: 8418/1: add boot image dependencies to not generate invalid images") addressed such a bad scenario. A similar symptom occurs with the following command: $ make -j$(nproc) ARCH=arm64 Image vmlinuz.efi [ snip ] SORTTAB vmlinux OBJCOPY arch/arm64/boot/Image OBJCOPY arch/arm64/boot/Image AS arch/arm64/boot/zboot-header.o PAD arch/arm64/boot/vmlinux.bin GZIP arch/arm64/boot/vmlinuz OBJCOPY arch/arm64/boot/vmlinuz.o LD arch/arm64/boot/vmlinuz.efi.elf OBJCOPY arch/arm64/boot/vmlinuz.efi The log "OBJCOPY arch/arm64/boot/Image" is displayed twice. It indicates that two threads simultaneously enter arch/arm64/boot/ and write to arch/arm64/boot/Image. It occasionally leads to a build failure: $ make -j$(nproc) ARCH=arm64 Image vmlinuz.efi [ snip ] SORTTAB vmlinux OBJCOPY arch/arm64/boot/Image PAD arch/arm64/boot/vmlinux.bin truncate: Invalid number: 'arch/arm64/boot/vmlinux.bin' make[2]: *** [drivers/firmware/efi/libstub/Makefile.zboot:13: arch/arm64/boot/vmlinux.bin] Error 1 make[2]: *** Deleting file 'arch/arm64/boot/vmlinux.bin' make[1]: *** [arch/arm64/Makefile:163: vmlinuz.efi] Error 2 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:234: __sub-make] Error 2 vmlinuz.efi depends on Image, but such a dependency is not specified in arch/arm64/Makefile. Signed-off-by: Masahiro Yamada Acked-by: Ard Biesheuvel Reviewed-by: SImon Glass Link: https://lore.kernel.org/r/20231119053234.2367621-1-masahiroy@kernel.org Signed-off-by: Catalin Marinas commit d3fa86b1a7b4cdc4367acacea16b72e0a200b3d7 Merge: 9b6de136b5f01 39f04b1406b23 Author: Linus Torvalds Date: Thu Nov 23 10:40:13 2023 -0800 Merge tag 'net-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from bpf. Current release - regressions: - Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E" - kselftest: rtnetlink: fix ip route command typo Current release - new code bugs: - s390/ism: make sure ism driver implies smc protocol in kconfig - two build fixes for tools/net Previous releases - regressions: - rxrpc: couple of ACK/PING/RTT handling fixes Previous releases - always broken: - bpf: verify bpf_loop() callbacks as if they are called unknown number of times - improve stability of auto-bonding with Hyper-V - account BPF-neigh-redirected traffic in interface statistics Misc: - net: fill in some more MODULE_DESCRIPTION()s" * tag 'net-6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (58 commits) tools: ynl: fix duplicate op name in devlink tools: ynl: fix header path for nfsd net: ipa: fix one GSI register field width tls: fix NULL deref on tls_sw_splice_eof() with empty record net: axienet: Fix check for partial TX checksum vsock/test: fix SEQPACKET message bounds test i40e: Fix adding unsupported cloud filters ice: restore timestamp configuration after device reset ice: unify logic for programming PFINT_TSYN_MSK ice: remove ptp_tx ring parameter flag amd-xgbe: propagate the correct speed and duplex status amd-xgbe: handle the corner-case during tx completion amd-xgbe: handle corner-case during sfp hotplug net: veth: fix ethtool stats reporting octeontx2-pf: Fix ntuple rule creation to direct packet to VF with higher Rx queue than its PF net: usb: qmi_wwan: claim interface 4 for ZTE MF290 Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E" net/smc: avoid data corruption caused by decline nfc: virtual_ncidev: Add variable to check if ndev is running dpll: Fix potential msg memleak when genlmsg_put_reply failed ... commit b0348e459c836abdb0f4b967e006d15c77cf1c87 Author: Paulo Alcantara Date: Tue Nov 21 20:12:55 2023 -0300 smb: client: introduce cifs_sfu_make_node() Remove duplicate code and add new helper for creating special files in SFU (Services for UNIX) format that can be shared by SMB1+ code. Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 45e724022e2704b5a5193fd96f378822b0448e07 Author: Paulo Alcantara Date: Tue Nov 21 20:12:54 2023 -0300 smb: client: set correct file type from NFS reparse points Handle all file types in NFS reparse points as specified in MS-FSCC 2.1.2.6 Network File System (NFS) Reparse Data Buffer. The client is now able to set all file types based on the parsed NFS reparse point, which used to support only symlinks. This works for SMB1+. Before patch: $ mount.cifs //srv/share /mnt -o ... $ ls -l /mnt ls: cannot access 'block': Operation not supported ls: cannot access 'char': Operation not supported ls: cannot access 'fifo': Operation not supported ls: cannot access 'sock': Operation not supported total 1 l????????? ? ? ? ? ? block l????????? ? ? ? ? ? char -rwxr-xr-x 1 root root 5 Nov 18 23:22 f0 l????????? ? ? ? ? ? fifo l--------- 1 root root 0 Nov 18 23:23 link -> f0 l????????? ? ? ? ? ? sock After patch: $ mount.cifs //srv/share /mnt -o ... $ ls -l /mnt total 1 brwxr-xr-x 1 root root 123, 123 Nov 18 00:34 block crwxr-xr-x 1 root root 1234, 1234 Nov 18 00:33 char -rwxr-xr-x 1 root root 5 Nov 18 23:22 f0 prwxr-xr-x 1 root root 0 Nov 18 23:23 fifo lrwxr-xr-x 1 root root 0 Nov 18 23:23 link -> f0 srwxr-xr-x 1 root root 0 Nov 19 2023 sock Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 539aad7f14dab7f947e5ab81901c0b20513a50db Author: Paulo Alcantara Date: Tue Nov 21 20:12:53 2023 -0300 smb: client: introduce ->parse_reparse_point() Parse reparse point into cifs_open_info_data structure and feed it through cifs_open_info_to_fattr(). Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit ed3e0a149b58ea8cfd10cc4f7cefb39877ff07ac Author: Paulo Alcantara Date: Tue Nov 21 20:12:52 2023 -0300 smb: client: implement ->query_reparse_point() for SMB1 Reparse points are not limited to symlinks, so implement ->query_reparse_point() in order to handle different file types. Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit a15ccef82d3de9a37dc25898c60a394209368dc8 Author: Ritvik Budhiraja Date: Tue Nov 21 19:13:47 2023 +0530 cifs: fix use after free for iface while disabling secondary channels We were deferencing iface after it has been released. Fix is to release after all dereference instances have been encountered. Signed-off-by: Ritvik Budhiraja Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202311110815.UJaeU3Tt-lkp@intel.com/ Signed-off-by: Steve French commit da90e45d5afc4da2de7cd3ea7943d0f1baa47cc2 Author: Asuna Yang Date: Wed Nov 22 22:18:03 2023 +0800 USB: serial: option: add Luat Air72*U series products Update the USB serial option driver support for Luat Air72*U series products. ID 1782:4e00 Spreadtrum Communications Inc. UNISOC-8910 T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 13 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1782 ProdID=4e00 Rev=00.00 S: Manufacturer=UNISOC S: Product=UNISOC-8910 C: #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=400mA I: If#= 0 Alt= 0 #EPs= 1 Cls=e0(wlcon) Sub=01 Prot=03 Driver=rndis_host E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=4096ms I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms If#= 2: AT If#= 3: PPP + AT If#= 4: Debug Co-developed-by: Yangyu Chen Signed-off-by: Yangyu Chen Signed-off-by: Asuna Yang Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 477865af60b2117ceaa1d558e03559108c15c78c Author: Wenchao Chen Date: Wed Nov 15 16:34:06 2023 +0800 mmc: sdhci-sprd: Fix vqmmc not shutting down after the card was pulled With cat regulator_summary, we found that vqmmc was not shutting down after the card was pulled. cat /sys/kernel/debug/regulator/regulator_summary 1.before fix 1)Insert SD card vddsdio 1 1 0 unknown 3500mV 0mA 1200mV 3750mV 71100000.mmc-vqmmc 1 0mA 3500mV 3600mV 2)Pull out the SD card vddsdio 1 1 0 unknown 3500mV 0mA 1200mV 3750mV 71100000.mmc-vqmmc 1 0mA 3500mV 3600mV 2.after fix 1)Insert SD cardt vddsdio 1 1 0 unknown 3500mV 0mA 1200mV 3750mV 71100000.mmc-vqmmc 1 0mA 3500mV 3600mV 2)Pull out the SD card vddsdio 0 1 0 unknown 3500mV 0mA 1200mV 3750mV 71100000.mmc-vqmmc 0 0mA 3500mV 3600mV Fixes: fb8bd90f83c4 ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller") Signed-off-by: Wenchao Chen Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231115083406.7368-1-wenchao.chen@unisoc.com Signed-off-by: Ulf Hansson commit d9ed644f58670865cf067351deb71010bd87a52f Author: Kornel Dulęba Date: Tue Nov 14 11:54:49 2023 +0000 mmc: sdhci-pci-gli: Disable LPM during initialization To address IO performance commit f9e5b33934ce ("mmc: host: Improve I/O read/write performance for GL9763E") limited LPM negotiation to runtime suspend state. The problem is that it only flips the switch in the runtime PM resume/suspend logic. Disable LPM negotiation in gl9763e_add_host. This helps in two ways: 1. It was found that the LPM switch stays in the same position after warm reboot. Having it set in init helps with consistency. 2. Disabling LPM during the first runtime resume leaves us susceptible to the performance issue in the time window between boot and the first runtime suspend. Fixes: f9e5b33934ce ("mmc: host: Improve I/O read/write performance for GL9763E") Cc: stable@vger.kernel.org Signed-off-by: Kornel Dulęba Reviewed-by: Sven van Ashbrook Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20231114115516.1585361-1-korneld@chromium.org Signed-off-by: Ulf Hansson commit 39f04b1406b23fcc129a67e70d6205d5a7322f38 Author: Jakub Kicinski Date: Wed Nov 22 19:05:58 2023 -0800 tools: ynl: fix duplicate op name in devlink We don't support CRUD-inspired message types in YNL too well. One aspect that currently trips us up is the fact that single message ID can be used in multiple commands (as the response). This leads to duplicate entries in the id-to-string tables: devlink-user.c:19:34: warning: initialized field overwritten [-Woverride-init] 19 | [DEVLINK_CMD_PORT_NEW] = "port-new", | ^~~~~~~~~~ devlink-user.c:19:34: note: (near initialization for ‘devlink_op_strmap[7]’) Fixes tag points at where the code was generated, the "real" problem is that the code generator does not support CRUD. Fixes: f2f9dd164db0 ("netlink: specs: devlink: add the remaining command to generate complete split_ops") Link: https://lore.kernel.org/r/20231123030558.1611831-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 2be35a619482c1f4e5bc7a2d84049b8d7d171882 Author: Jakub Kicinski Date: Wed Nov 22 19:06:24 2023 -0800 tools: ynl: fix header path for nfsd The makefile dependency is trying to include the wrong header: : fatal error: ../../../../include/uapi//linux/nfsd.h: No such file or directory The guard also looks wrong. Fixes: f14122b2c2ac ("tools: ynl: Add source files for nfsd netlink protocol") Reviewed-by: Chuck Lever Link: https://lore.kernel.org/r/20231123030624.1611925-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 37f0205538baf70beb57cdcb6c7d14aa13257926 Author: Alex Elder Date: Wed Nov 22 17:17:08 2023 -0600 net: ipa: fix one GSI register field width The width of the R_LENGTH field of the EV_CH_E_CNTXT_1 GSI register is 24 bits (not 20 bits) starting with IPA v5.0. Fix this. Fixes: faf0678ec8a0 ("net: ipa: add IPA v5.0 GSI register definitions") Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20231122231708.896632-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit 53f2cb491b500897a619ff6abd72f565933760f0 Author: Jann Horn Date: Wed Nov 22 22:44:47 2023 +0100 tls: fix NULL deref on tls_sw_splice_eof() with empty record syzkaller discovered that if tls_sw_splice_eof() is executed as part of sendfile() when the plaintext/ciphertext sk_msg are empty, the send path gets confused because the empty ciphertext buffer does not have enough space for the encryption overhead. This causes tls_push_record() to go on the `split = true` path (which is only supposed to be used when interacting with an attached BPF program), and then get further confused and hit the tls_merge_open_record() path, which then assumes that there must be at least one populated buffer element, leading to a NULL deref. It is possible to have empty plaintext/ciphertext buffers if we previously bailed from tls_sw_sendmsg_locked() via the tls_trim_both_msgs() path. tls_sw_push_pending_record() already handles this case correctly; let's do the same check in tls_sw_splice_eof(). Fixes: df720d288dbb ("tls/sw: Use splice_eof() to flush") Cc: stable@vger.kernel.org Reported-by: syzbot+40d43509a099ea756317@syzkaller.appspotmail.com Signed-off-by: Jann Horn Link: https://lore.kernel.org/r/20231122214447.675768-1-jannh@google.com Signed-off-by: Jakub Kicinski commit fd0413bbf8b11f56e8aa842783b0deda0dfe2926 Author: Samuel Holland Date: Tue Nov 21 16:42:17 2023 -0800 net: axienet: Fix check for partial TX checksum Due to a typo, the code checked the RX checksum feature in the TX path. Fixes: 8a3b7a252dca ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") Signed-off-by: Samuel Holland Reviewed-by: Andrew Lunn Reviewed-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/20231122004219.3504219-1-samuel.holland@sifive.com Signed-off-by: Jakub Kicinski commit f0863888f6cfef33e3117dccfe94fa78edf76be4 Author: Arseniy Krasnov Date: Wed Nov 22 00:16:42 2023 +0300 vsock/test: fix SEQPACKET message bounds test Tune message length calculation to make this test work on machines where 'getpagesize()' returns >32KB. Now maximum message length is not hardcoded (on machines above it was smaller than 'getpagesize()' return value, thus we get negative value and test fails), but calculated at runtime and always bigger than 'getpagesize()' result. Reproduced on aarch64 with 64KB page size. Fixes: 5c338112e48a ("test/vsock: rework message bounds test") Signed-off-by: Arseniy Krasnov Reported-by: Bogdan Marcynkov Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20231121211642.163474-1-avkrasnov@salutedevices.com Signed-off-by: Jakub Kicinski commit 4e20655e503e3a478cd1682bf25e3202dd823da8 Author: Ivan Vecera Date: Tue Nov 21 13:13:36 2023 -0800 i40e: Fix adding unsupported cloud filters If a VF tries to add unsupported cloud filter through virtchnl then i40e_add_del_cloud_filter(_big_buf) returns -ENOTSUPP but this error code is stored in 'ret' instead of 'aq_ret' that is used as error code sent back to VF. In this scenario where one of the mentioned functions fails the value of 'aq_ret' is zero so the VF will incorrectly receive a 'success'. Use 'aq_ret' to store return value and remove 'ret' local variable. Additionally fix the issue when filter allocation fails, in this case no notification is sent back to the VF. Fixes: e284fc280473 ("i40e: Add and delete cloud filter") Reviewed-by: Simon Horman Signed-off-by: Ivan Vecera Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20231121211338.3348677-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 4662817aed5a9d6c695658d0105d8ff4b84ac6cb Author: Michael Walle Date: Tue Sep 5 10:49:21 2023 +0200 drm/mediatek: fix kernel oops if no crtc is found drm_crtc_from_index(0) might return NULL if there are no CRTCs registered at all which will lead to a kernel oops in mtk_drm_crtc_dma_dev_get(). Add the missing return value check. Fixes: 0d9eee9118b7 ("drm/mediatek: Add drm ovl_adaptor sub driver for MT8195") Signed-off-by: Michael Walle Reviewed-by: Nícolas F. R. A. Prado Tested-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Tested-by: Eugen Hristev Reviewed-by: Eugen Hristev Link: https://patchwork.kernel.org/project/dri-devel/patch/20230905084922.3908121-1-mwalle@kernel.org/ Signed-off-by: Chun-Kuang Hu commit 9aa6a662c309e6f8770972840948af963bd6ff34 Author: AngeloGioacchino Del Regno Date: Wed Oct 25 12:49:40 2023 +0200 drm/mediatek: mtk_disp_gamma: Fix breakage due to merge issue While the commit that was sent to the mailing lists was fine, something happened during merge and the mtk_gamma_set() function got broken as a writel() was turned into a readl(). Fix that by changing that back to the expected writel(). Fixes: a6b39cd248f3 ("drm/mediatek: De-commonize disp_aal/disp_gamma gamma_set functions") Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20231025104940.140605-1-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit e50a8061feac92edd7cb9315a078edd03a96715f Merge: d9775fb6d011c 7758017911a4f Author: Paolo Abeni Date: Thu Nov 23 15:27:35 2023 +0100 Merge branch 'ice-restore-timestamp-config-after-reset' Tony Nguyen says: ==================== ice: restore timestamp config after reset Jake Keller says: We recently discovered during internal validation that the ice driver has not been properly restoring Tx timestamp configuration after a device reset, which resulted in application failures after a device reset. After some digging, it turned out this problem is two-fold. Since the introduction of the PTP support the driver has been clobbering the storage of the current timestamp configuration during reset. Thus after a reset, the driver will no longer perform Tx or Rx timestamps, and will report timestamp configuration as disabled if SIOCGHWTSTAMP ioctl is issued. In addition, the recently merged auxiliary bus support code missed that PFINT_TSYN_MSK must be reprogrammed on the clock owner for E822 devices. Failure to restore this register configuration results in the driver no longer responding to interrupts from other ports. Depending on the traffic pattern, this can either result in increased latency responding to timestamps on the non-owner ports, or it can result in the driver never reporting any timestamps. The configuration of PFINT_TSYN_MSK was only done during initialization. Due to this, the Tx timestamp issue persists even if userspace reconfigures timestamping. This series fixes both issues, as well as removes a redundant Tx ring field since we can rely on the skb flag as the primary detector for a Tx timestamp request. Note that I don't think this series will directly apply to older stable releases (even v6.6) as we recently refactored a lot of the PTP code to support auxiliary bus. Patch 2/3 only matters for the post-auxiliary bus implementation. The principle of patch 1/3 and 3/3 could apply as far back as the initial PTP support, but I don't think it will apply cleanly as-is. ==================== Link: https://lore.kernel.org/r/20231121211259.3348630-1-anthony.l.nguyen@intel.com Signed-off-by: Paolo Abeni commit 7758017911a4f2578d54c318e8fe77bcb5899054 Author: Jacob Keller Date: Tue Nov 21 13:12:57 2023 -0800 ice: restore timestamp configuration after device reset The driver calls ice_ptp_cfg_timestamp() during ice_ptp_prepare_for_reset() to disable timestamping while the device is resetting. This operation destroys the user requested configuration. While the driver does call ice_ptp_cfg_timestamp in ice_rebuild() to restore some hardware settings after a reset, it unconditionally passes true or false, resulting in failure to restore previous user space configuration. This results in a device reset forcibly disabling timestamp configuration regardless of current user settings. This was not detected previously due to a quirk of the LinuxPTP ptp4l application. If ptp4l detects a missing timestamp, it enters a fault state and performs recovery logic which includes executing SIOCSHWTSTAMP again, restoring the now accidentally cleared configuration. Not every application does this, and for these applications, timestamps will mysteriously stop after a PF reset, without being restored until an application restart. Fix this by replacing ice_ptp_cfg_timestamp() with two new functions: 1) ice_ptp_disable_timestamp_mode() which unconditionally disables the timestamping logic in ice_ptp_prepare_for_reset() and ice_ptp_release() 2) ice_ptp_restore_timestamp_mode() which calls ice_ptp_restore_tx_interrupt() to restore Tx timestamping configuration, calls ice_set_rx_tstamp() to restore Rx timestamping configuration, and issues an immediate TSYN_TX interrupt to ensure that timestamps which may have occurred during the device reset get processed. Modify the ice_ptp_set_timestamp_mode to directly save the user configuration and then call ice_ptp_restore_timestamp_mode. This way, reset no longer destroys the saved user configuration. This obsoletes the ice_set_tx_tstamp() function which can now be safely removed. With this change, all devices should now restore Tx and Rx timestamping functionality correctly after a PF reset without application intervention. Fixes: 77a781155a65 ("ice: enable receive hardware timestamping") Fixes: ea9b847cda64 ("ice: enable transmit timestamps for E810 devices") Signed-off-by: Jacob Keller Reviewed-by: Jesse Brandeburg Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Paolo Abeni commit 7d606a1e2d0575b6c3a2600f43f90d1e409f9661 Author: Jacob Keller Date: Tue Nov 21 13:12:56 2023 -0800 ice: unify logic for programming PFINT_TSYN_MSK Commit d938a8cca88a ("ice: Auxbus devices & driver for E822 TS") modified how Tx timestamps are handled for E822 devices. On these devices, only the clock owner handles reading the Tx timestamp data from firmware. To do this, the PFINT_TSYN_MSK register is modified from the default value to one which enables reacting to a Tx timestamp on all PHY ports. The driver currently programs PFINT_TSYN_MSK in different places depending on whether the port is the clock owner or not. For the clock owner, the PFINT_TSYN_MSK value is programmed during ice_ptp_init_owner just before calling ice_ptp_tx_ena_intr to program the PHY ports. For the non-clock owner ports, the PFINT_TSYN_MSK is programmed during ice_ptp_init_port. If a large enough device reset occurs, the PFINT_TSYN_MSK register will be reset to the default value in which only the PHY associated directly with the PF will cause the Tx timestamp interrupt to trigger. The driver lacks logic to reprogram the PFINT_TSYN_MSK register after a device reset. For the E822 device, this results in the PF no longer responding to interrupts for other ports. This results in failure to deliver Tx timestamps to user space applications. Rename ice_ptp_configure_tx_tstamp to ice_ptp_cfg_tx_interrupt, and unify the logic for programming PFINT_TSYN_MSK and PFINT_OICR_ENA into one place. This function will program both registers according to the combination of user configuration and device requirements. This ensures that PFINT_TSYN_MSK is always restored when we configure the Tx timestamp interrupt. Fixes: d938a8cca88a ("ice: Auxbus devices & driver for E822 TS") Signed-off-by: Jacob Keller Reviewed-by: Jesse Brandeburg Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Paolo Abeni commit 0ffb08b1a45bd6b7694e01da0e1d9e3e788418fb Author: Jacob Keller Date: Tue Nov 21 13:12:55 2023 -0800 ice: remove ptp_tx ring parameter flag Before performing a Tx timestamp in ice_stamp(), the driver checks a ptp_tx ring variable to see if timestamping is enabled on that ring. This value is set for all rings whenever userspace configures Tx timestamping. Ostensibly this was done to avoid wasting cycles checking other fields when timestamping has not been enabled. However, for Tx timestamps we already get an individual per-SKB flag indicating whether userspace wants to request a timestamp on that packet. We do not gain much by also having a separate flag to check for whether timestamping was enabled. In fact, the driver currently fails to restore the field after a PF reset. Because of this, if a PF reset occurs, timestamps will be disabled. Since this flag doesn't add value in the hotpath, remove it and always provide a timestamp if the SKB flag has been set. A following change will fix the reset path to properly restore user timestamping configuration completely. This went unnoticed for some time because one of the most common applications using Tx timestamps, ptp4l, will reconfigure the socket as part of its fault recovery logic. Fixes: ea9b847cda64 ("ice: enable transmit timestamps for E810 devices") Signed-off-by: Jacob Keller Reviewed-by: Jesse Brandeburg Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Paolo Abeni commit 460e462d22542adfafd8a5bc979437df73f1cbf3 Author: Mark Brown Date: Thu Nov 16 12:52:29 2023 +0000 kselftest/arm64: Fix output formatting for za-fork The za-fork test does not output a newline when reporting the result of the one test it runs, causing the counts printed by kselftest to be included in the test name. Add the newline. Fixes: 266679ffd867 ("kselftest/arm64: Convert za-fork to use kselftest.h") Cc: # 6.4.x Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20231116-arm64-fix-za-fork-output-v1-1-42c03d4f5759@kernel.org Signed-off-by: Catalin Marinas commit d9775fb6d011cb97b4106c40840dc982be99fec3 Merge: 818ad9cc90d4a 7a2323ac24a50 Author: Paolo Abeni Date: Thu Nov 23 13:47:25 2023 +0100 Merge branch 'amd-xgbe-fixes-to-handle-corner-cases' Raju Rangoju says: ==================== amd-xgbe: fixes to handle corner-cases This series include bug fixes to amd-xgbe driver. ==================== Link: https://lore.kernel.org/r/20231121191435.4049995-1-Raju.Rangoju@amd.com Signed-off-by: Paolo Abeni commit 7a2323ac24a50311f64a3a9b54ed5bef5821ecae Author: Raju Rangoju Date: Wed Nov 22 00:44:35 2023 +0530 amd-xgbe: propagate the correct speed and duplex status xgbe_get_link_ksettings() does not propagate correct speed and duplex information to ethtool during cable unplug. Due to which ethtool reports incorrect values for speed and duplex. Address this by propagating correct information. Fixes: 7c12aa08779c ("amd-xgbe: Move the PHY support into amd-xgbe") Acked-by: Shyam Sundar S K Signed-off-by: Raju Rangoju Reviewed-by: Wojciech Drewek Signed-off-by: Paolo Abeni commit 7121205d5330c6a3cb3379348886d47c77b78d06 Author: Raju Rangoju Date: Wed Nov 22 00:44:34 2023 +0530 amd-xgbe: handle the corner-case during tx completion The existing implementation uses software logic to accumulate tx completions until the specified time (1ms) is met and then poll them. However, there exists a tiny gap which leads to a race between resetting and checking the tx_activate flag. Due to this the tx completions are not reported to upper layer and tx queue timeout kicks-in restarting the device. To address this, introduce a tx cleanup mechanism as part of the periodic maintenance process. Fixes: c5aa9e3b8156 ("amd-xgbe: Initial AMD 10GbE platform driver") Acked-by: Shyam Sundar S K Signed-off-by: Raju Rangoju Reviewed-by: Wojciech Drewek Signed-off-by: Paolo Abeni commit 676ec53844cbdf2f47e68a076cdff7f0ec6cbe3f Author: Raju Rangoju Date: Wed Nov 22 00:44:33 2023 +0530 amd-xgbe: handle corner-case during sfp hotplug Force the mode change for SFI in Fixed PHY configurations. Fixed PHY configurations needs PLL to be enabled while doing mode set. When the SFP module isn't connected during boot, driver assumes AN is ON and attempts auto-negotiation. However, if the connected SFP comes up in Fixed PHY configuration the link will not come up as PLL isn't enabled while the initial mode set command is issued. So, force the mode change for SFI in Fixed PHY configuration to fix link issues. Fixes: e57f7a3feaef ("amd-xgbe: Prepare for working with more than one type of phy") Acked-by: Shyam Sundar S K Signed-off-by: Raju Rangoju Reviewed-by: Wojciech Drewek Signed-off-by: Paolo Abeni commit 347ecf29a68cc8958fbcbd26ef410d07fe9d82f4 Author: Shengjiu Wang Date: Thu Nov 23 09:14:53 2023 +0800 ASoC: fsl_xcvr: refine the requested phy clock frequency As the input phy clock frequency will divided by 2 by default on i.MX8MP with the implementation of clk-imx8mp-audiomix driver, So the requested frequency need to be updated. The relation of phy clock is: sai_pll_ref_sel sai_pll sai_pll_bypass sai_pll_out sai_pll_out_div2 earc_phy_cg Signed-off-by: Shengjiu Wang Reviewed-by: Iuliana Prodan Link: https://lore.kernel.org/r/1700702093-8008-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 505c83212da5bfca95109421b8f5d9f8c6cdfef2 Author: AngeloGioacchino Del Regno Date: Thu Nov 23 09:44:54 2023 +0100 ASoC: SOF: mediatek: mt8186: Add Google Steelix topology compatible Add the machine compatible and topology filename for the Google Steelix MT8186 Chromebook to load the correct SOF topology file. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231123084454.20471-1-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown commit 3841d8a563a7473ceb7415ecfe577e20b2a66d37 Author: Johan Hovold Date: Thu Nov 23 10:18:15 2023 +0100 ASoC: soc-pcm: fix up bad merge A recent change to address pops and clicks with codecs like WSA883X touched the same code paths as a fix for clearing DAI parameters and resulted in a bad merge. Specifically, commit f0220575e65a ("ASoC: soc-dai: add flag to mute and unmute stream during trigger") made mute at stream close conditional, while commit 3efcb471f871 ("ASoC: soc-pcm.c: Make sure DAI parameters cleared if the DAI becomes inactive") moved that same mute call back to soc_pcm_hw_clean(). Fix up the bad merge by dropping the second mute call from soc_pcm_clean() and making sure that the call in soc_pcm_hw_clean() is conditional as intended. Fixes: bdb7e1922052 ("ASoC: Merge up workaround for CODECs that play noise on stopped stream") Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20231123091815.21933-1-johan+linaro@kernel.org Signed-off-by: Mark Brown commit fb103b90e944ecd664577c0fd37a069282dcd294 Author: Hans de Goede Date: Mon Nov 20 16:42:35 2023 +0100 platform/x86: asus-wmi: Filter Volume key presses if also reported via atkbd Use the i8042-filter to check if Volume key presses are also reported via atkbd and if yes then filter out the WMI events to avoid reporting each key-press twice. Note depending on in which order the PS/2 data vs the WMI event are handled the first volume key press may still be reported twice. This is a compromise versus DMI quirks (unmaintainable) or other more complex solutions. Closes: https://bbs.archlinux.org/viewtopic.php?pid=2128536#p2128536 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231120154235.610808-4-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 6db829fa2f1295aaad51a3c00f6fc57a27c444bb Author: Hans de Goede Date: Mon Nov 20 16:42:34 2023 +0100 platform/x86: asus-wmi: Change q500a_i8042_filter() into a generic i8042-filter Change asus_q500a_i8042_filter() into a generic i8042-filter, using a new filter_i8042_e1_extended_codes flag in the quirks struct to decide if e1 extended codes should be filtered out or not. This is a preparation patch for adding support for filtering volume key events being reported twice through both the PS/2 keyboard and asus-wmi. Note while modifying the code also drop the unnecessary unlikely() annotations, this is not in a hot path so those are not necessary. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231120154235.610808-3-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit b52cbca22cbf6c9d2700c1e576d0ddcc670e49d5 Author: Hans de Goede Date: Mon Nov 20 16:42:33 2023 +0100 platform/x86: asus-wmi: Move i8042 filter install to shared asus-wmi code asus-nb-wmi calls i8042_install_filter() in some cases, but it never calls i8042_remove_filter(). This means that a dangling pointer to the filter function is left after rmmod leading to crashes. Fix this by moving the i8042-filter installation to the shared asus-wmi code and also remove it from the shared code on driver unbind. Fixes: b5643539b825 ("platform/x86: asus-wmi: Filter buggy scan codes on ASUS Q500A") Cc: Oleksij Rempel Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231120154235.610808-2-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 818ad9cc90d4a7165caaee7e32800c50d0564ec3 Author: Lorenzo Bianconi Date: Tue Nov 21 20:08:44 2023 +0100 net: veth: fix ethtool stats reporting Fix a possible misalignment between page_pool stats and tx xdp_stats reported in veth_get_ethtool_stats routine. The issue can be reproduced configuring the veth pair with the following tx/rx queues: $ip link add v0 numtxqueues 2 numrxqueues 4 type veth peer name v1 \ numtxqueues 1 numrxqueues 1 and loading a simple XDP program on v0 that just returns XDP_PASS. In this case on v0 the page_pool stats overwrites tx xdp_stats for queue 1. Fix the issue incrementing pp_idx of dev->real_num_tx_queues * VETH_TQ_STATS_LEN since we always report xdp_stats for all tx queues in ethtool. Fixes: 4fc418053ec7 ("net: veth: add page_pool stats") Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/c5b5d0485016836448453f12846c7c4ab75b094a.1700593593.git.lorenzo@kernel.org Signed-off-by: Paolo Abeni commit 4aa1d8f89b10cdc25a231dabf808d8935e0b137a Author: Suman Ghosh Date: Tue Nov 21 22:26:24 2023 +0530 octeontx2-pf: Fix ntuple rule creation to direct packet to VF with higher Rx queue than its PF It is possible to add a ntuple rule which would like to direct packet to a VF whose number of queues are greater/less than its PF's queue numbers. For example a PF can have 2 Rx queues but a VF created on that PF can have 8 Rx queues. As of today, ntuple rule will reject rule because it is checking the requested queue number against PF's number of Rx queues. As a part of this fix if the action of a ntuple rule is to move a packet to a VF's queue then the check is removed. Also, a debug information is printed to aware user that it is user's responsibility to cross check if the requested queue number on that VF is a valid one. Fixes: f0a1913f8a6f ("octeontx2-pf: Add support for ethtool ntuple filters") Signed-off-by: Suman Ghosh Reviewed-by: Wojciech Drewek Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231121165624.3664182-1-sumang@marvell.com Signed-off-by: Paolo Abeni commit 744f5e7b69710701dc225020769138f8ca2894df Author: Ronald Wahl Date: Mon Oct 30 20:01:13 2023 +0100 dmaengine: ti: k3-psil-am62: Fix SPI PDMA data AM62x has 3 SPI channels where each channel has 4 TX and 4 RX threads. This also fixes the thread numbers. Signed-off-by: Ronald Wahl Fixes: 5ac6bfb58777 ("dmaengine: ti: k3-psil: Add AM62x PSIL and PDMA data") Reviewed-by: Jai Luthra Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20231030190113.16782-1-rwahl@gmx.de Signed-off-by: Vinod Koul commit 7bf9a6b46549852a37e6d07e52c601c3c706b562 Author: Stefano Stabellini Date: Wed Nov 22 15:07:41 2023 -0800 arm/xen: fix xen_vcpu_info allocation alignment xen_vcpu_info is a percpu area than needs to be mapped by Xen. Currently, it could cross a page boundary resulting in Xen being unable to map it: [ 0.567318] kernel BUG at arch/arm64/xen/../../arm/xen/enlighten.c:164! [ 0.574002] Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP Fix the issue by using __alloc_percpu and requesting alignment for the memory allocation. Signed-off-by: Stefano Stabellini Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2311221501340.2053963@ubuntu-linux-20-04-desktop Fixes: 24d5373dda7c ("arm/xen: Use alloc_percpu rather than __alloc_percpu") Reviewed-by: Juergen Gross Signed-off-by: Juergen Gross commit 99360d9620f09fb8bc15548d855011bbb198c680 Author: Lech Perczak Date: Sat Nov 18 00:19:18 2023 +0100 net: usb: qmi_wwan: claim interface 4 for ZTE MF290 Interface 4 is used by for QMI interface in stock firmware of MF28D, the router which uses MF290 modem. Rebind it to qmi_wwan after freeing it up from option driver. The proper configuration is: Interface mapping is: 0: QCDM, 1: (unknown), 2: AT (PCUI), 2: AT (Modem), 4: QMI T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 4 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=19d2 ProdID=0189 Rev= 0.00 S: Manufacturer=ZTE, Incorporated S: Product=ZTE LTE Technologies MSM C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan E: Ad=86(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms Cc: Bjørn Mork Signed-off-by: Lech Perczak Link: https://lore.kernel.org/r/20231117231918.100278-3-lech.perczak@gmail.com Signed-off-by: Paolo Abeni commit 8f96e29aae31354191227ad476dc7f6147ef1d75 Author: Stephan Gerhold Date: Tue Nov 14 11:07:45 2023 +0100 pmdomain: qcom: rpmpd: Set GENPD_FLAG_ACTIVE_WAKEUP Set GENPD_FLAG_ACTIVE_WAKEUP for all RPM power domains so that power domains necessary for wakeup/"awake path" devices are kept on across suspend. This is needed for example for the *_AO ("active-only") variants of the RPMPDs used by the CPU. Those should maintain their votes also across system suspend to ensure the CPU can keep running for the whole suspend process (ending in a firmware call). When the RPM firmware detects that the CPUs are in a deep idle state it will drop those votes automatically. Signed-off-by: Stephan Gerhold Reviewed-by: Ulf Hansson Signed-off-by: Viresh Kumar commit d6048a19a7104ce90dcc140d03dbe5796af3acd4 Author: Stephan Gerhold Date: Tue Nov 14 11:07:44 2023 +0100 cpufreq: qcom-nvmem: Preserve PM domain votes in system suspend >From the Linux point of view, the power domains used by the CPU must stay always-on. This is because we still need the CPU to keep running until the last instruction, which will typically be a firmware call that shuts down the CPU cleanly. At the moment the power domain votes (enable + performance state) are dropped during system suspend, which means the CPU could potentially malfunction while entering suspend. We need to distinguish between two different setups used with qcom-cpufreq-nvmem: 1. CPR power domain: The backing regulator used by CPR should stay always-on in Linux; it is typically disabled automatically by hardware when the CPU enters a deep idle state. However, we should pause the CPR state machine during system suspend. 2. RPMPD: The power domains used by the CPU should stay always-on in Linux (also across system suspend). The CPU typically only uses the *_AO ("active-only") variants of the power domains in RPMPD. For those, the RPM firmware will automatically drop the votes internally when the CPU enters a deep idle state. Make this work correctly by calling device_set_awake_path() on the virtual genpd devices, so that the votes are maintained across system suspend. The power domain drivers need to set GENPD_FLAG_ACTIVE_WAKEUP to opt into staying on during system suspend. For now we only set this for the RPMPD case. For CPR, not setting it will ensure the state machine is still paused during system suspend, while the backing regulator will stay on with "regulator-always-on". Signed-off-by: Stephan Gerhold Reviewed-by: Ulf Hansson Signed-off-by: Viresh Kumar commit 5cbff51e709a72a60b0416b00521b835a1f9a3d5 Author: Stephan Gerhold Date: Tue Nov 14 11:07:43 2023 +0100 cpufreq: qcom-nvmem: Enable virtual power domain devices The genpd core caches performance state votes from devices that are runtime suspended as of commit 3c5a272202c2 ("PM: domains: Improve runtime PM performance state handling"). They get applied once the device becomes active again. To attach the power domains needed by qcom-cpufreq-nvmem the OPP core calls genpd_dev_pm_attach_by_id(). This results in "virtual" dummy devices that use runtime PM only to control the enable and performance state for the attached power domain. However, at the moment nothing ever resumes the virtual devices created for qcom-cpufreq-nvmem. They remain permanently runtime suspended. This means that performance state votes made during cpufreq scaling get always cached and never applied to the hardware. Fix this by enabling the devices after attaching them. Without this fix performance states votes are silently ignored, and the CPU/CPR voltage is never adjusted. This has been broken since 5.14 but for some reason no one noticed this on QCS404 so far. Fixes: 1cb8339ca225 ("cpufreq: qcom: Add support for qcs404 on nvmem driver") Signed-off-by: Stephan Gerhold Reviewed-by: Ulf Hansson Signed-off-by: Viresh Kumar commit 2e4e0984c7d696cc74cf2fd7e7f62997f0e9ebe6 Author: Christoph Niedermaier Date: Wed Nov 22 14:41:13 2023 +0100 cpufreq: imx6q: Don't disable 792 Mhz OPP unnecessarily For a 900MHz i.MX6ULL CPU the 792MHz OPP is disabled. There is no convincing reason to disable this OPP. If a CPU can run at 900MHz, it should also be able to cope with 792MHz. Looking at the voltage level of 792MHz in [1] (page 24, table 10. "Operating Ranges") the current defined OPP is above the minimum. So the voltage level shouldn't be a problem. However in [2] (page 24, table 10. "Operating Ranges"), it is not mentioned that 792MHz OPP isn't allowed. Change it to only disable 792MHz OPP for i.MX6ULL types below 792 MHz. [1] https://www.nxp.com/docs/en/data-sheet/IMX6ULLIEC.pdf [2] https://www.nxp.com/docs/en/data-sheet/IMX6ULLCEC.pdf Fixes: 0aa9abd4c212 ("cpufreq: imx6q: check speed grades for i.MX6ULL") Signed-off-by: Christoph Niedermaier Reviewed-by: Marek Vasut Reviewed-by: Fabio Estevam [ Viresh: Edited subject ] Signed-off-by: Viresh Kumar commit 0e6c4fe782e683ff55a27fbb10e9c6b5c241533b Author: Arnd Bergmann Date: Wed Nov 22 23:47:19 2023 +0100 nvme: tcp: fix compile-time checks for TLS mode When CONFIG_NVME_KEYRING is enabled as a loadable module, but the TCP host code is built-in, it fails to link: arm-linux-gnueabi-ld: drivers/nvme/host/tcp.o: in function `nvme_tcp_setup_ctrl': tcp.c:(.text+0x1940): undefined reference to `nvme_tls_psk_default' The problem is that the compile-time conditionals are inconsistent here, using a mix of #ifdef CONFIG_NVME_TCP_TLS, IS_ENABLED(CONFIG_NVME_TCP_TLS) and IS_ENABLED(CONFIG_NVME_KEYRING) checks, with CONFIG_NVME_KEYRING controlling whether the implementation is actually built. Change it to use IS_ENABLED(CONFIG_NVME_KEYRING) checks consistently, which should help readability and make it less error-prone. Combining it with the check for the ctrl->opts->tls flag lets the compiler drop all the TLS code in configurations without this feature, which also helps runtime behavior in addition to avoiding the link failure. To make it possible for the compiler to build the dead code, both the tls_handshake_timeout variable and the TLS specific members of nvme_tcp_queue need to be moved out of the #ifdef block as well, but at least the former of these gets optimized out again. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231122224719.4042108-4-arnd@kernel.org Signed-off-by: Jens Axboe commit 65e2a74c44ddfa174b700f5da2d1d29b4ba6639b Author: Arnd Bergmann Date: Wed Nov 22 23:47:18 2023 +0100 nvme: target: fix Kconfig select statements When the NVME target code is built-in but its TCP frontend is a loadable module, enabling keyring support causes a link failure: x86_64-linux-ld: vmlinux.o: in function `nvmet_ports_make': configfs.c:(.text+0x100a211): undefined reference to `nvme_keyring_id' The problem is that CONFIG_NVME_TARGET_TCP_TLS is a 'bool' symbol that depends on the tristate CONFIG_NVME_TARGET_TCP, so any 'select' from it inherits the state of the tristate symbol rather than the intended CONFIG_NVME_TARGET one that contains the actual call. The same thing is true for CONFIG_KEYS, which itself is required for NVME_KEYRING. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231122224719.4042108-3-arnd@kernel.org Signed-off-by: Jens Axboe commit d78abcbabe7e98bb4baa4dea87550806944790ed Author: Arnd Bergmann Date: Wed Nov 22 23:47:17 2023 +0100 nvme: target: fix nvme_keyring_id() references In configurations without CONFIG_NVME_TARGET_TCP_TLS, the keyring code might not be available, or using it will result in a runtime failure: x86_64-linux-ld: vmlinux.o: in function `nvmet_ports_make': configfs.c:(.text+0x100a211): undefined reference to `nvme_keyring_id' Add a check to ensure we only check the keyring if there is a chance of it being used, which avoids both the runtime and link-time problems. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231122224719.4042108-2-arnd@kernel.org Signed-off-by: Jens Axboe commit 36a1c2ee50f573972aea3c3019555f47ee0094c0 Author: Dave Jiang Date: Fri Nov 17 13:18:48 2023 -0700 cxl/hdm: Fix a benign lockdep splat The new helper "cxl_num_decoders_committed()" added a lockdep assertion to validate that port->commit_end is protected against modification. That assertion fires in init_hdm_decoder() where it is initializing port->commit_end. Given that it is both accessing and writing that property it obstensibly needs the lock. In practice, CXL decoder commit rules (must commit in order) and the in-order discovery of device decoders makes the manipulation of ->commit_end in init_hdm_decoder() safe. However, rather than rely on the subtle rules of CXL hardware, just make the implementation obviously correct from a software perspective. The Fixes: tag is only for cleaning up a lockdep splat, there is no functional issue addressed by this fix. Fixes: 458ba8189cb4 ("cxl: Add cxl_decoders_committed() helper") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/170025232811.2147250.16376901801315194121.stgit@djiang5-mobl3 Acked-by: Davidlohr Bueso Signed-off-by: Dan Williams commit 76d9eafff4484547ed9e606c8227ac9799a9f2da Author: Mathieu Desnoyers Date: Wed Nov 15 10:50:18 2023 -0500 MAINTAINERS: TRACING: Add Mathieu Desnoyers as Reviewer In order to make sure I get CC'd on tracing changes for which my input would be relevant, add my name as reviewer of the TRACING subsystem. Link: https://lore.kernel.org/linux-trace-kernel/20231115155018.8236-1-mathieu.desnoyers@efficios.com Acked-by: Masami Hiramatsu (Google) Signed-off-by: Mathieu Desnoyers Signed-off-by: Steven Rostedt (Google) commit f49f950c217bfb40f11662bab39cb388d41e4cfb Author: Steven Rostedt (Google) Date: Tue Nov 21 18:10:07 2023 -0500 eventfs: Make sure that parent->d_inode is locked in creating files/dirs Since the locking of the parent->d_inode has been moved outside the creation of the files and directories (as it use to be locked via a conditional), add a WARN_ON_ONCE() to the case that it's not locked. Link: https://lkml.kernel.org/r/20231121231112.853962542@goodmis.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Andrew Morton Reviewed-by: Josef Bacik Signed-off-by: Steven Rostedt (Google) commit fc4561226feaad5fcdcb55646c348d77b8ee69c5 Author: Steven Rostedt (Google) Date: Tue Nov 21 18:10:06 2023 -0500 eventfs: Do not allow NULL parent to eventfs_start_creating() The eventfs directory is dynamically created via the meta data supplied by the existing trace events. All files and directories in eventfs has a parent. Do not allow NULL to be passed into eventfs_start_creating() as the parent because that should never happen. Warn if it does. Link: https://lkml.kernel.org/r/20231121231112.693841807@goodmis.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Andrew Morton Reviewed-by: Josef Bacik Signed-off-by: Steven Rostedt (Google) commit bcae32c5632fc0a0dbce46fa731cd23403117e66 Author: Steven Rostedt (Google) Date: Tue Nov 21 18:10:05 2023 -0500 eventfs: Move taking of inode_lock into dcache_dir_open_wrapper() The both create_file_dentry() and create_dir_dentry() takes a boolean parameter "lookup", as on lookup the inode_lock should already be taken, but for dcache_dir_open_wrapper() it is not taken. There's no reason that the dcache_dir_open_wrapper() can't take the inode_lock before calling these functions. In fact, it's better if it does, as the lock can be held throughout both directory and file creations. This also simplifies the code, and possibly prevents unexpected race conditions when the lock is released. Link: https://lkml.kernel.org/r/20231121231112.528544825@goodmis.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Andrew Morton Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_inode") Reviewed-by: Josef Bacik Signed-off-by: Steven Rostedt (Google) commit 4763d635c907baed212664dc579dde1663bb2676 Author: Steven Rostedt (Google) Date: Tue Nov 21 18:10:04 2023 -0500 eventfs: Use GFP_NOFS for allocation when eventfs_mutex is held If memory reclaim happens, it can reclaim file system pages. The file system pages from eventfs may take the eventfs_mutex on reclaim. This means that allocation while holding the eventfs_mutex must not call into filesystem reclaim. A lockdep splat uncovered this. Link: https://lkml.kernel.org/r/20231121231112.373501894@goodmis.org Cc: Masami Hiramatsu Cc: Andrew Morton Fixes: 28e12c09f5aa0 ("eventfs: Save ownership and mode") Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_inode") Reported-by: Mark Rutland Reviewed-by: Josef Bacik Signed-off-by: Steven Rostedt (Google) commit 57686a72da08ae555d93148aa8756b16417a6aff Author: Arnaldo Carvalho de Melo Date: Thu Nov 9 16:34:09 2023 -0300 tools: Disable __packed attribute compiler warning due to -Werror=attributes Noticed on several perf tools cross build test containers: [perfbuilder@five ~]$ grep FAIL ~/dm.log/summary 19 10.18 debian:experimental-x-mips : FAIL gcc version 12.3.0 (Debian 12.3.0-6) 20 11.21 debian:experimental-x-mips64 : FAIL gcc version 12.3.0 (Debian 12.3.0-6) 21 11.30 debian:experimental-x-mipsel : FAIL gcc version 12.3.0 (Debian 12.3.0-6) 37 12.07 ubuntu:18.04-x-arm : FAIL gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 42 11.91 ubuntu:18.04-x-riscv64 : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) 44 13.17 ubuntu:18.04-x-sh4 : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) 45 12.09 ubuntu:18.04-x-sparc64 : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) [perfbuilder@five ~]$ In file included from util/intel-pt-decoder/intel-pt-pkt-decoder.c:10: /tmp/perf-6.6.0-rc1/tools/include/asm-generic/unaligned.h: In function 'get_unaligned_le16': /tmp/perf-6.6.0-rc1/tools/include/asm-generic/unaligned.h:13:29: error: packed attribute causes inefficient alignment for 'x' [-Werror=attributes] 13 | const struct { type x; } __packed *__pptr = (typeof(__pptr))(ptr); \ | ^ /tmp/perf-6.6.0-rc1/tools/include/asm-generic/unaligned.h:27:28: note: in expansion of macro '__get_unaligned_t' 27 | return le16_to_cpu(__get_unaligned_t(__le16, p)); | ^~~~~~~~~~~~~~~~~ This comes from the kernel, where the -Wattributes and -Wpacked isn't used, -Wpacked is already disabled, do it for the attributes as well. Fixes: a91c987254651443 ("perf tools: Add get_unaligned_leNN()") Suggested-by: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/7c5b626c-1de9-4c12-a781-e44985b4a797@intel.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Namhyung Kim commit 35732699f5d2922ff674e711e566cf44a4bd86d2 Author: Dave Jiang Date: Wed Nov 22 08:33:53 2023 -0700 ACPI: Fix ARM32 platforms compile issue introduced by fw_table changes Linus reported that: After commit a103f46633fd the kernel stopped compiling for several ARM32 platforms that I am building with a bare metal compiler. Bare metal compilers (arm-none-eabi-) don't define __linux__. This is because the header is now in the include path for : CC arch/arm/kernel/irq.o CC kernel/sysctl.o CC crypto/api.o In file included from ../include/acpi/acpi.h:22, from ../include/linux/fw_table.h:29, from ../include/linux/acpi.h:18, from ../include/linux/irqchip.h:14, from ../arch/arm/kernel/irq.c:25: ../include/acpi/platform/acenv.h:218:2: error: #error Unknown target environment 218 | #error Unknown target environment | ^~~~~ The issue is caused by the introducing of splitting out the ACPI code to support the new generic fw_table code. Rafael suggested [1] moving the fw_table.h include in linux/acpi.h to below the linux/mutex.h. Remove the two includes in fw_table.h. Replace linux/fw_table.h include in fw_table.c with linux/acpi.h. Link: https://lore.kernel.org/linux-acpi/CAJZ5v0idWdJq3JSqQWLG5q+b+b=zkEdWR55rGYEoxh7R6N8kFQ@mail.gmail.com/ Fixes: a103f46633fd ("acpi: Move common tables helper functions to common lib") Closes: https://lore.kernel.org/linux-acpi/20231114-arm-build-bug-v1-1-458745fe32a4@linaro.org/ Reported-by: Linus Walleij Suggested-by: Rafael J. Wysocki Tested-by: Linus Walleij Signed-off-by: Dave Jiang Acked-by: Rafael J. Wysocki Signed-off-by: Rafael J. Wysocki commit a29ee6aea7030786a63fde0d6d83a8f477b060fb Author: Oliver Upton Date: Tue Nov 21 19:29:56 2023 +0000 perf build: Ensure sysreg-defs Makefile respects output dir Currently the sysreg-defs are written out to the source tree unconditionally, ignoring the specified output directory. Correct the build rule to emit the header to the output directory. Opportunistically reorganize the rules to avoid interleaving with the set of beauty make rules. Reported-by: Ian Rogers Signed-off-by: Oliver Upton Link: https://lore.kernel.org/r/20231121192956.919380-3-oliver.upton@linux.dev Signed-off-by: Namhyung Kim commit ef5c958090a909c9f2ab717ba6abb86869e42da7 Author: Oliver Upton Date: Tue Nov 21 19:29:55 2023 +0000 tools perf: Add arm64 sysreg files to MANIFEST Ian pointed out that source tarballs are incomplete as of commit e2bdd172e665 ("perf build: Generate arm64's sysreg-defs.h and add to include path"), since the source files needed from the kernel tree do not appear in the manifest. Add them. Reported-by: Ian Rogers Fixes: e2bdd172e665 ("perf build: Generate arm64's sysreg-defs.h and add to include path") Signed-off-by: Oliver Upton Link: https://lore.kernel.org/r/20231121192956.919380-2-oliver.upton@linux.dev Signed-off-by: Namhyung Kim commit 027905fe5baec70a00e00890e982d035d6c8b6b3 Author: Namhyung Kim Date: Tue Nov 21 14:56:49 2023 -0800 tools/perf: Update tools's copy of mips syscall table tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-14-namhyung@kernel.org commit d3968c974a2453de9289bdb9d34130b2ce323628 Author: Namhyung Kim Date: Tue Nov 21 14:56:48 2023 -0800 tools/perf: Update tools's copy of s390 syscall table tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Cc: linux-s390@vger.kernel.org Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-13-namhyung@kernel.org commit 3483d2440538aa2575c3cddac0b7f42d488570cf Author: Namhyung Kim Date: Tue Nov 21 14:56:47 2023 -0800 tools/perf: Update tools's copy of powerpc syscall table tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-12-namhyung@kernel.org commit b3b11aed147af8f7c3d79c5b0b7474505d1dde7b Author: Namhyung Kim Date: Tue Nov 21 14:56:46 2023 -0800 tools/perf: Update tools's copy of x86 syscall table tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-11-namhyung@kernel.org commit e1d7426bb9156d34d385d0516a7309c8f33c55bc Author: Namhyung Kim Date: Tue Nov 21 14:56:45 2023 -0800 tools headers: Update tools's copy of s390/asm headers tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Cc: linux-s390@vger.kernel.org Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-10-namhyung@kernel.org commit fad8afdcc18ff72e1d90c558be364f26534b8a5b Author: Namhyung Kim Date: Tue Nov 21 14:56:44 2023 -0800 tools headers: Update tools's copy of arm64/asm headers tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-9-namhyung@kernel.org commit c23708f37652b74570409725e0bd70a81c275867 Author: Namhyung Kim Date: Tue Nov 21 14:56:43 2023 -0800 tools headers: Update tools's copy of x86/asm headers tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-8-namhyung@kernel.org commit fd2ddee727d1ae9296b3875087410cc3698885f0 Author: Namhyung Kim Date: Tue Nov 21 14:56:42 2023 -0800 tools headers: Update tools's copy of socket.h header tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: netdev@vger.kernel.org Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-7-namhyung@kernel.org commit 91c97b36bd6939a5c3c29de9e83e6359146c6939 Author: Namhyung Kim Date: Tue Nov 21 14:56:41 2023 -0800 tools headers UAPI: Update tools's copy of unistd.h header tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: Arnd Bergmann Cc: linux-arch@vger.kernel.org Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-6-namhyung@kernel.org commit daa97513415525e4d17c4978f3c47a7b7e935b36 Author: Namhyung Kim Date: Tue Nov 21 14:56:40 2023 -0800 tools headers UAPI: Update tools's copy of vhost.h header tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: kvm@vger.kernel.org Cc: virtualization@lists.linux.dev Cc: netdev@vger.kernel.org Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-5-namhyung@kernel.org commit fb3648a6a87b674540f0ba7701a353006c408065 Author: Namhyung Kim Date: Tue Nov 21 14:56:39 2023 -0800 tools headers UAPI: Update tools's copy of mount.h header tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: Alexander Viro Cc: Christian Brauner Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-4-namhyung@kernel.org commit 5a9f95b67059dda160f65ab41c48587103b3b3a0 Author: Namhyung Kim Date: Tue Nov 21 14:56:38 2023 -0800 tools headers UAPI: Update tools's copy of kvm.h header tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: Paolo Bonzini Cc: kvm@vger.kernel.org Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-3-namhyung@kernel.org commit 111844666672347747585e24d6cebda640bd1284 Author: Namhyung Kim Date: Tue Nov 21 14:56:37 2023 -0800 tools headers UAPI: Update tools's copy of fscrypt.h header tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: Eric Biggers Cc: "Theodore Y. Ts'o" Cc: Jaegeuk Kim Cc: linux-fscrypt@vger.kernel.org Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-2-namhyung@kernel.org commit 1041dfe6109fcb24e9a3d5d4ca9218e64dc0ed29 Author: Namhyung Kim Date: Tue Nov 21 14:56:36 2023 -0800 tools headers UAPI: Update tools's copy of drm headers tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: David Airlie Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: dri-devel@lists.freedesktop.org Signed-off-by: Namhyung Kim Link: https://lore.kernel.org/r/20231121225650.390246-1-namhyung@kernel.org commit acfa60dbe03802d6afd28401aa47801270e82021 Author: Will Deacon Date: Fri Nov 17 13:14:22 2023 +0000 arm64: mm: Fix "rodata=on" when CONFIG_RODATA_FULL_DEFAULT_ENABLED=y When CONFIG_RODATA_FULL_DEFAULT_ENABLED=y, passing "rodata=on" on the kernel command-line (rather than "rodata=full") should turn off the "full" behaviour, leaving writable linear aliases of read-only kernel memory. Unfortunately, the option has no effect in this situation and the only way to disable the "rodata=full" behaviour is to disable rodata protection entirely by passing "rodata=off". Fix this by parsing the "on" and "off" options in the arch code, additionally enforcing that 'rodata_full' cannot be set without also setting 'rodata_enabled', allowing us to simplify a couple of checks in the process. Fixes: 2e8cff0a0eee ("arm64: fix rodata=full") Cc: Ard Biesheuvel Cc: Mark Rutland Signed-off-by: Will Deacon Reviewed-by: "Russell King (Oracle)" Reviewed-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20231117131422.29663-1-will@kernel.org Signed-off-by: Catalin Marinas commit 9b6de136b5f0158c60844f85286a593cb70fb364 Merge: 05c8c94ed4074 c517fd2738f47 Author: Linus Torvalds Date: Wed Nov 22 10:20:17 2023 -0800 Merge tag 'loongarch-fixes-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen: "Fix several build errors, a potential kernel panic, a cpu hotplug issue and update links in documentations" * tag 'loongarch-fixes-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: Docs/zh_CN/LoongArch: Update links in LoongArch introduction.rst Docs/LoongArch: Update links in LoongArch introduction.rst LoongArch: Implement constant timer shutdown interface LoongArch: Mark {dmw,tlb}_virt_to_page() exports as non-GPL LoongArch: Silence the boot warning about 'nokaslr' LoongArch: Add __percpu annotation for __percpu_read()/__percpu_write() LoongArch: Record pc instead of offset in la_abs relocation LoongArch: Explicitly set -fdirect-access-external-data for vmlinux LoongArch: Add dependency between vmlinuz.efi and vmlinux.efi commit 9c235dfc3d3f901fe22acb20f2ab37ff39f2ce02 Author: Darrick J. Wong Date: Mon Nov 20 10:31:44 2023 -0800 xfs: dquot recovery does not validate the recovered dquot When we're recovering ondisk quota records from the log, we need to validate the recovered buffer contents before writing them to disk. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Chandan Babu R commit ed17f7da5f0c8b65b7b5f7c98beb0aadbc0546ee Author: Darrick J. Wong Date: Mon Nov 20 10:31:38 2023 -0800 xfs: clean up dqblk extraction Since the introduction of xfs_dqblk in V5, xfs really ought to find the dqblk pointer from the dquot buffer, then compute the xfs_disk_dquot pointer from the dqblk pointer. Fix the open-coded xfs_buf_offset calls and do the type checking in the correct order. Note that this has made no practical difference since the start of the xfs_disk_dquot is coincident with the start of the xfs_dqblk. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Chandan Babu R commit 05c8c94ed407499279b2a552e7ee9bb03e859b7b Merge: 125b0bb95dd6b 18286883e779f Author: Linus Torvalds Date: Wed Nov 22 09:56:26 2023 -0800 Merge tag 'hyperv-fixes-signed-20231121' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv fixes from Wei Liu: - One fix for the KVP daemon (Ani Sinha) - Fix for the detection of E820_TYPE_PRAM in a Gen2 VM (Saurabh Sengar) - Micro-optimization for hv_nmi_unknown() (Uros Bizjak) * tag 'hyperv-fixes-signed-20231121' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: x86/hyperv: Use atomic_try_cmpxchg() to micro-optimize hv_nmi_unknown() x86/hyperv: Fix the detection of E820_TYPE_PRAM in a Gen2 VM hv/hv_kvp_daemon: Some small fixes for handling NM keyfiles commit 125b0bb95dd6bec81b806b997a4ccb026eeecf8f Author: Linus Torvalds Date: Thu Nov 9 22:22:13 2023 -0800 asm-generic: qspinlock: fix queued_spin_value_unlocked() implementation We really don't want to do atomic_read() or anything like that, since we already have the value, not the lock. The whole point of this is that we've loaded the lock from memory, and we want to check whether the value we loaded was a locked one or not. The main use of this is the lockref code, which loads both the lock and the reference count in one atomic operation, and then works on that combined value. With the atomic_read(), the compiler would pointlessly spill the value to the stack, in order to then be able to read it back "atomically". This is the qspinlock version of commit c6f4a9002252 ("asm-generic: ticket-lock: Optimize arch_spin_value_unlocked()") which fixed this same bug for ticket locks. Cc: Guo Ren Cc: Ingo Molnar Cc: Waiman Long Link: https://lore.kernel.org/all/CAHk-=whNRv0v6kQiV5QO6DJhjH4KEL36vWQ6Re8Csrnh4zbRkQ@mail.gmail.com/ Signed-off-by: Linus Torvalds commit cdba4301adda7c60a2064bf808e48fccd352aaa9 Author: Shuming Fan Date: Wed Nov 22 18:01:23 2023 +0800 ASoC: rt5650: add mutex to avoid the jack detection failure This patch adds the jd_mutex to protect the jack detection control flow. And only the headset type could check the button status. Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20231122100123.2831753-1-shumingf@realtek.com Signed-off-by: Mark Brown commit 55072cd7ce36d6e3af949608bcb0e734d5a4b0c2 Merge: 98c598afc22d4 3af755a46881c Author: Jens Axboe Date: Wed Nov 22 10:19:27 2023 -0700 Merge tag 'nvme-6.7-2023-11-22' of git://git.infradead.org/nvme into block-6.7 Pull NVMe fixes from Keith: "nvme fixes for Linux 6.7 - TCP TLS fixes (Hannes) - Authentifaction fixes (Mark, Hannes) - Properly terminate target names (Christoph)" * tag 'nvme-6.7-2023-11-22' of git://git.infradead.org/nvme: nvme: move nvme_stop_keep_alive() back to original position nvmet-tcp: always initialize tls_handshake_tmo_work nvmet: nul-terminate the NQNs passed in the connect command nvme: blank out authentication fabrics options if not configured nvme: catch errors from nvme_configure_metadata() nvme-tcp: only evaluate 'tls' option if TLS is selected nvme-auth: set explanation code for failure2 msgs nvme-auth: unlock mutex in one place only commit 4a6c5607d4502ccd1b15b57d57f17d12b6f257a7 Author: Tejun Heo Date: Tue Nov 21 11:39:36 2023 -1000 workqueue: Make sure that wq_unbound_cpumask is never empty During boot, depending on how the housekeeping and workqueue.unbound_cpus masks are set, wq_unbound_cpumask can end up empty. Since 8639ecebc9b1 ("workqueue: Implement non-strict affinity scope for unbound workqueues"), this may end up feeding -1 as a CPU number into scheduler leading to oopses. BUG: unable to handle page fault for address: ffffffff8305e9c0 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page ... Call Trace: select_idle_sibling+0x79/0xaf0 select_task_rq_fair+0x1cb/0x7b0 try_to_wake_up+0x29c/0x5c0 wake_up_process+0x19/0x20 kick_pool+0x5e/0xb0 __queue_work+0x119/0x430 queue_work_on+0x29/0x30 ... An empty wq_unbound_cpumask is a clear misconfiguration and already disallowed once system is booted up. Let's warn on and ignore unbound_cpumask restrictions which lead to no unbound cpus. While at it, also remove now unncessary empty check on wq_unbound_cpumask in wq_select_unbound_cpu(). Signed-off-by: Tejun Heo Reported-and-Tested-by: Yong He Link: http://lkml.kernel.org/r/20231120121623.119780-1-alexyonghe@tencent.com Fixes: 8639ecebc9b1 ("workqueue: Implement non-strict affinity scope for unbound workqueues") Cc: stable@vger.kernel.org # v6.6+ Reviewed-by: Waiman Long commit 3af755a46881c32fecaecfdeaf3a8f0a869deca5 Author: Hannes Reinecke Date: Tue Nov 21 09:01:03 2023 +0100 nvme: move nvme_stop_keep_alive() back to original position Stopping keep-alive not only stops the keep-alive workqueue, but also needs to be synchronized with I/O termination as we must not send a keep-alive command after all I/O had been terminated. So to avoid any regressions move the call to stop_keep_alive() back to its original position and ensure that keep-alive is correctly stopped failing to setup the admin queue. Fixes: 4733b65d82bd ("nvme: start keep-alive after admin queue setup") Suggested-by: Sagi Grimberg Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 695bfba7ca781dd41b5225148cc8cebd74c553c2 Author: Lorenzo Bianconi Date: Mon Nov 13 11:06:33 2023 +0100 wifi: mt76: mt7925: fix typo in mt7925_init_he_caps Use iftype for interface type switch in mt7925_init_he_caps routine. This found during code review but later Coverity reported this with id 1549845. Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips") Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/7de6e939dc75ee08f05bf1ee73253aa7eeccf28e.1699869649.git.lorenzo@kernel.org commit aab1f809d7540def24498e81347740a7239a74d5 Author: Heiko Carstens Date: Mon Nov 20 13:00:00 2023 +0100 scripts/checkstack.pl: match all stack sizes for s390 For some unknown reason the regular expression for checkstack only matches three digit numbers starting with the number "3", or any higher number. Which means that it skips any stack sizes smaller than 304 bytes. This makes the checkstack script a bit less useful than it could be. Change the script to match any number. To be filtered out stack sizes can be configured with the min_stack variable, which omits any stack frame sizes smaller than 100 bytes by default. Tested-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 732c678eb021dbc514a699be1815e194692fdd5c Author: Richard Fitzgerald Date: Tue Nov 21 15:44:19 2023 +0000 ALSA: hda: cs35l56: Enable low-power hibernation mode on SPI SPI hibernation is now supported with the latest hibernation/wake sequences in the shared ASoC code. This has a functional dependency on two commits: commit 3df761bdbc8b ("ASoC: cs35l56: Wake transactions need to be issued twice") commit a47cf4dac7dc ("ASoC: cs35l56: Change hibernate sequence to use allow auto hibernate") To protect against this, enabling hibernation is conditional on CS35L56_WAKE_HOLD_TIME_US being defined, which indicates that the new hibernation sequences are available. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20231121154419.19435-1-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 0a9ace1117bbaa25687468af703b472235f5c210 Author: Heiko Carstens Date: Wed Nov 15 11:39:02 2023 +0100 s390: remove odd comment In the meantime hopefully most people got used to forward declarations, therefore remove the explanation. Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev commit 673752a839694133a328610fcbc54f3d59ae87f3 Author: Mikhail Zaslonko Date: Wed Nov 8 18:18:52 2023 +0100 s390/ipl: add missing IPL_TYPE_ECKD_DUMP case to ipl_init() Add missing IPL_TYPE_ECKD_DUMP case to ipl_init() creating ECKD ipl device attribute group similar to IPL_TYPE_ECKD case. Commit e2d2a2968f2a ("s390/ipl: add eckd dump support") should have had it from the beginning. Fixes: e2d2a2968f2a ("s390/ipl: add eckd dump support") Signed-off-by: Mikhail Zaslonko Reviewed-by: Sven Schnelle Signed-off-by: Alexander Gordeev commit 4711b7b8f99583f6105a33e91f106125134beacb Author: Thomas Richter Date: Mon Oct 30 11:41:33 2023 +0100 s390/pai: cleanup event initialization Setting event::hw.last_tag to zero is not necessary. The memory for each event is dynamically allocated by the kernel common code and initialized to zero already. Remove this unnecessary assignment. Move the comment to function paicrypt_start() for clarification. Suggested-by: Sumanth Korikkar Acked-by: Sumanth Korikkar Signed-off-by: Thomas Richter Signed-off-by: Alexander Gordeev commit ad2ab1297d0c80899125a842bb7a078abfe1e6ce Author: Mike Tipton Date: Wed Oct 25 07:58:29 2023 -0700 interconnect: Treat xlate() returning NULL node as an error Currently, if provider->xlate() or provider->xlate_extended() "successfully" return a NULL node, then of_icc_get_from_provider() won't consider that an error and will successfully return the NULL node. This bypasses error handling in of_icc_get_by_index() and leads to NULL dereferences in path_find(). This could be avoided by ensuring provider callbacks always return an error for NULL nodes, but it's better to explicitly protect against this in the common framework. Fixes: 87e3031b6fbd ("interconnect: Allow endpoints translation via DT") Signed-off-by: Mike Tipton Link: https://lore.kernel.org/r/20231025145829.11603-1-quic_mdtipton@quicinc.com Signed-off-by: Georgi Djakov commit 9cf87666fc6e08572341fe08ecd909935998fbbd Author: Johan Hovold Date: Fri Nov 17 18:36:50 2023 +0100 USB: dwc3: qcom: fix ACPI platform device leak Make sure to free the "urs" platform device, which is created for some ACPI platforms, on probe errors and on driver unbind. Compile-tested only. Fixes: c25c210f590e ("usb: dwc3: qcom: add URS Host support for sdm845 ACPI boot") Cc: Shawn Guo Signed-off-by: Johan Hovold Acked-by: Andrew Halaney Acked-by: Shawn Guo Link: https://lore.kernel.org/r/20231117173650.21161-4-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit 9feefbf57d92e8ee293dad67585d351c7d0b6e37 Author: Johan Hovold Date: Fri Nov 17 18:36:49 2023 +0100 USB: dwc3: qcom: fix software node leak on probe errors Make sure to remove the software node also on (ACPI) probe errors to avoid leaking the underlying resources. Note that the software node is only used for ACPI probe so the driver unbind tear down is updated to match probe. Fixes: 8dc6e6dd1bee ("usb: dwc3: qcom: Constify the software node") Cc: stable@vger.kernel.org # 5.12 Cc: Heikki Krogerus Signed-off-by: Johan Hovold Acked-by: Heikki Krogerus Acked-by: Andrew Halaney Link: https://lore.kernel.org/r/20231117173650.21161-3-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit 51392a1879ff06dc21b68aef4825f6ef68a7be42 Author: Johan Hovold Date: Fri Nov 17 18:36:48 2023 +0100 USB: dwc3: qcom: fix resource leaks on probe deferral The driver needs to deregister and free the newly allocated dwc3 core platform device on ACPI probe errors (e.g. probe deferral) and on driver unbind but instead it leaked those resources while erroneously dropping a reference to the parent platform device which is still in use. For OF probing the driver takes a reference to the dwc3 core platform device which has also always been leaked. Fix the broken ACPI tear down and make sure to drop the dwc3 core reference for both OF and ACPI. Fixes: 8fd95da2cfb5 ("usb: dwc3: qcom: Release the correct resources in dwc3_qcom_remove()") Fixes: 2bc02355f8ba ("usb: dwc3: qcom: Add support for booting with ACPI") Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver") Cc: stable@vger.kernel.org # 4.18 Cc: Christophe JAILLET Cc: Lee Jones Signed-off-by: Johan Hovold Acked-by: Andrew Halaney Link: https://lore.kernel.org/r/20231117173650.21161-2-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit aee70a1d711327dae409671035a0368c1dc4a2ea Author: Johan Hovold Date: Mon Nov 20 17:16:07 2023 +0100 USB: dwc3: qcom: simplify wakeup interrupt setup Use the IRQF_NO_AUTOEN irq flag when requesting the wakeup interrupts instead of setting it separately. No functional change intended. Signed-off-by: Johan Hovold Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/20231120161607.7405-4-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit 41f5a0973259db9e4e3c9963d36505f80107d1a0 Author: Johan Hovold Date: Mon Nov 20 17:16:06 2023 +0100 USB: dwc3: qcom: fix wakeup after probe deferral The Qualcomm glue driver is overriding the interrupt trigger types defined by firmware when requesting the wakeup interrupts during probe. This can lead to a failure to map the DP/DM wakeup interrupts after a probe deferral as the firmware defined trigger types do not match the type used for the initial mapping: irq: type mismatch, failed to map hwirq-14 for interrupt-controller@b220000! irq: type mismatch, failed to map hwirq-15 for interrupt-controller@b220000! Fix this by not overriding the firmware provided trigger types when requesting the wakeup interrupts. Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver") Cc: stable@vger.kernel.org # 4.18 Signed-off-by: Johan Hovold Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/20231120161607.7405-3-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit 0c2671f33a9c975d752216739d6a05cb88e98aa4 Author: Johan Hovold Date: Mon Nov 20 17:16:05 2023 +0100 dt-bindings: usb: qcom,dwc3: fix example wakeup interrupt types The DP/DM wakeup interrupts are edge triggered and which edge to trigger on depends on use-case and whether a Low speed or Full/High speed device is connected. Fixes: 3828026c9ec8 ("dt-bindings: usb: qcom,dwc3: Convert USB DWC3 bindings") Signed-off-by: Johan Hovold Acked-by: Krzysztof Kozlowski Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/20231120161607.7405-2-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit 6972b38ca05235f6142715db7062ecc87a422e22 Author: Stefan Eichenberger Date: Mon Nov 13 15:59:21 2023 +0100 usb: misc: onboard-hub: add support for Microchip USB5744 Add support for the Microchip USB5744 USB3.0 and USB2.0 Hub. The Microchip USB5744 supports two power supplies, one for 1V2 and one for 3V3. According to the datasheet there is no need for a delay between power on and reset, so this value is set to 0. Signed-off-by: Stefan Eichenberger Signed-off-by: Francesco Dolcini Cc: stable Acked-by: Matthias Kaehlcke Link: https://lore.kernel.org/r/20231113145921.30104-3-francesco@dolcini.it Signed-off-by: Greg Kroah-Hartman commit d0c930b745cafde8e7d25d0356c648bca669556a Author: Stefan Eichenberger Date: Mon Nov 13 15:59:20 2023 +0100 dt-bindings: usb: microchip,usb5744: Add second supply The USB5744 has two power supplies one for 3V3 and one for 1V2. Add the second supply to the USB5744 DT binding. Signed-off-by: Stefan Eichenberger Signed-off-by: Francesco Dolcini Acked-by: Conor Dooley Cc: stable Link: https://lore.kernel.org/r/20231113145921.30104-2-francesco@dolcini.it Signed-off-by: Greg Kroah-Hartman commit 6a26310273c323380da21eb23fcfd50e31140913 Author: Heiner Kallweit Date: Tue Nov 21 09:09:33 2023 +0100 Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E" This reverts commit efa5f1311c4998e9e6317c52bc5ee93b3a0f36df. I couldn't reproduce the reported issue. What I did, based on a pcap packet log provided by the reporter: - Used same chip version (RTL8168h) - Set MAC address to the one used on the reporters system - Replayed the EAPOL unicast packet that, according to the reporter, was filtered out by the mc filter. The packet was properly received. Therefore the root cause of the reported issue seems to be somewhere else. Disabling mc filtering completely for the most common chip version is a quite big hammer. Therefore revert the change and wait for further analysis results from the reporter. Cc: stable@vger.kernel.org Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 372ee6a3368ec6ff46ee4e6ff4ffe2fe1e059dbb Author: Hans de Goede Date: Tue Nov 21 21:32:05 2023 +0100 usb: misc: ljca: Fix enumeration error on Dell Latitude 9420 Not all LJCA chips implement SPI and on chips without SPI reading the SPI descriptors will timeout. On laptop models like the Dell Latitude 9420, this is expected behavior and not an error. Modify the driver to continue without instantiating a SPI auxbus child, instead of failing to probe() the whole LJCA chip. Fixes: acd6199f195d ("usb: Add support for Intel LJCA device") Signed-off-by: Hans de Goede Reviewed-by: Wentong Wu Link: https://lore.kernel.org/r/20231104175104.38786-1-hdegoede@redhat.com Link: https://lore.kernel.org/r/20231121203205.223047-1-hdegoede@redhat.com Signed-off-by: Greg Kroah-Hartman commit e6d71b437abc2f249e3b6a1ae1a7228e09c6e563 Author: D. Wythe Date: Wed Nov 22 10:37:05 2023 +0800 net/smc: avoid data corruption caused by decline We found a data corruption issue during testing of SMC-R on Redis applications. The benchmark has a low probability of reporting a strange error as shown below. "Error: Protocol error, got "\xe2" as reply type byte" Finally, we found that the retrieved error data was as follows: 0xE2 0xD4 0xC3 0xD9 0x04 0x00 0x2C 0x20 0xA6 0x56 0x00 0x16 0x3E 0x0C 0xCB 0x04 0x02 0x01 0x00 0x00 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xE2 It is quite obvious that this is a SMC DECLINE message, which means that the applications received SMC protocol message. We found that this was caused by the following situations: client server ¦ clc proposal -------------> ¦ clc accept <------------- ¦ clc confirm -------------> wait llc confirm send llc confirm ¦failed llc confirm ¦ x------ (after 2s)timeout wait llc confirm rsp wait decline (after 1s) timeout (after 2s) timeout ¦ decline --------------> ¦ decline <-------------- As a result, a decline message was sent in the implementation, and this message was read from TCP by the already-fallback connection. This patch double the client timeout as 2x of the server value, With this simple change, the Decline messages should never cross or collide (during Confirm link timeout). This issue requires an immediate solution, since the protocol updates involve a more long-term solution. Fixes: 0fb0b02bd6fd ("net/smc: adapt SMC client code to use the LLC flow") Signed-off-by: D. Wythe Reviewed-by: Wen Gu Reviewed-by: Wenjia Zhang Signed-off-by: David S. Miller commit c33fd110424dfcb544cf55a1b312f43fe1918235 Author: Shengjiu Wang Date: Wed Nov 22 09:42:53 2023 +0800 ASoC: fsl_xcvr: Enable 2 * TX bit clock for spdif only case The bit 10 in TX_DPTH_CTRL register controls the TX clock rate. If this bit is set, TX datapath clock should be = 2* TX bit rate. If this bit is not set, TX datapath clock should be 10* TX bit rate. As the spdif only case, we always use 2 * TX bit clock, so this bit need to be set. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1700617373-6472-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 2b78832f50c4d711e161b166d7d8790968051546 Author: Shifeng Li Date: Tue Nov 21 02:12:36 2023 -0800 RDMA/irdma: Fix UAF in irdma_sc_ccq_get_cqe_info() When removing the irdma driver or unplugging its aux device, the ccq queue is released before destorying the cqp_cmpl_wq queue. But in the window, there may still be completion events for wqes. That will cause a UAF in irdma_sc_ccq_get_cqe_info(). [34693.333191] BUG: KASAN: use-after-free in irdma_sc_ccq_get_cqe_info+0x82f/0x8c0 [irdma] [34693.333194] Read of size 8 at addr ffff889097f80818 by task kworker/u67:1/26327 [34693.333194] [34693.333199] CPU: 9 PID: 26327 Comm: kworker/u67:1 Kdump: loaded Tainted: G O --------- -t - 4.18.0 #1 [34693.333200] Hardware name: SANGFOR Inspur/NULL, BIOS 4.1.13 08/01/2016 [34693.333211] Workqueue: cqp_cmpl_wq cqp_compl_worker [irdma] [34693.333213] Call Trace: [34693.333220] dump_stack+0x71/0xab [34693.333226] print_address_description+0x6b/0x290 [34693.333238] ? irdma_sc_ccq_get_cqe_info+0x82f/0x8c0 [irdma] [34693.333240] kasan_report+0x14a/0x2b0 [34693.333251] irdma_sc_ccq_get_cqe_info+0x82f/0x8c0 [irdma] [34693.333264] ? irdma_free_cqp_request+0x151/0x1e0 [irdma] [34693.333274] irdma_cqp_ce_handler+0x1fb/0x3b0 [irdma] [34693.333285] ? irdma_ctrl_init_hw+0x2c20/0x2c20 [irdma] [34693.333290] ? __schedule+0x836/0x1570 [34693.333293] ? strscpy+0x83/0x180 [34693.333296] process_one_work+0x56a/0x11f0 [34693.333298] worker_thread+0x8f/0xf40 [34693.333301] ? __kthread_parkme+0x78/0xf0 [34693.333303] ? rescuer_thread+0xc50/0xc50 [34693.333305] kthread+0x2a0/0x390 [34693.333308] ? kthread_destroy_worker+0x90/0x90 [34693.333310] ret_from_fork+0x1f/0x40 Fixes: 44d9e52977a1 ("RDMA/irdma: Implement device initialization definitions") Signed-off-by: Shifeng Li Link: https://lore.kernel.org/r/20231121101236.581694-1-lishifeng1992@126.com Acked-by: Shiraz Saleem Signed-off-by: Leon Romanovsky commit 422b19f7f006e813ee0865aadce6a62b3c263c42 Author: Kalesh AP Date: Tue Nov 21 00:29:47 2023 -0800 RDMA/bnxt_re: Correct module description string The word "Driver" is repeated twice in the "modinfo bnxt_re" output description. Fix it. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1700555387-6277-1-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit 8f2244c9af245ff72185c0473827125ee6b2d1a5 Author: Takashi Iwai Date: Tue Nov 21 17:23:59 2023 +0100 leds: class: Don't expose color sysfs entry The commit c7d80059b086 ("leds: class: Store the color index in struct led_classdev") introduced a new sysfs entry "color" that is commonly created for the led classdev. Unfortunately, this conflicts with the "color" sysfs entry of already existing drivers such as Logitech HID or System76 ACPI drivers. The driver probe fails due to the conflict, hence it leads to a severe regression with the missing keyboard, for example. This patch reverts partially the change in the commit above for removing the led class color sysfs entries again for addressing the regressions. The newly introduced led_classdev.color field is kept as it's already used by other driver. Fixes: c7d80059b086 ("leds: class: Store the color index in struct led_classdev") Reported-by: Johannes Penßel Closes: https://lore.kernel.org/r/b5646db3-acff-45aa-baef-df3f660486fb@gmail.com Link: https://bugzilla.kernel.org/show_bug.cgi?id=218045 Link: https://bugzilla.kernel.org/show_bug.cgi?id=218155 Link: https://bugzilla.suse.com/show_bug.cgi?id=1217172 Signed-off-by: Takashi Iwai Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20231121162359.9332-1-tiwai@suse.de Signed-off-by: Lee Jones commit 0c8bb6eb70ca41031f663b4481aac9ac78b53bc6 Author: Jack Wang Date: Mon Nov 20 16:41:44 2023 +0100 RDMA/rtrs-clt: Remove the warnings for req in_use check As we chain the WR during write request: memory registration, rdma write, local invalidate, if only the last WR fail to send due to send queue overrun, the server can send back the reply, while client mark the req->in_use to false in case of error in rtrs_clt_req when error out from rtrs_post_rdma_write_sg. Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") Signed-off-by: Jack Wang Reviewed-by: Md Haris Iqbal Signed-off-by: Grzegorz Prajsner Link: https://lore.kernel.org/r/20231120154146.920486-8-haris.iqbal@ionos.com Signed-off-by: Leon Romanovsky commit 6d09f6f7d7584e099633282ea915988914f86529 Author: Jack Wang Date: Mon Nov 20 16:41:43 2023 +0100 RDMA/rtrs-clt: Fix the max_send_wr setting For each write request, we need Request, Response Memory Registration, Local Invalidate. Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") Signed-off-by: Jack Wang Reviewed-by: Md Haris Iqbal Signed-off-by: Grzegorz Prajsner Link: https://lore.kernel.org/r/20231120154146.920486-7-haris.iqbal@ionos.com Signed-off-by: Leon Romanovsky commit c4d32e77fc1006f99eeb78417efc3d81a384072a Author: Md Haris Iqbal Date: Mon Nov 20 16:41:42 2023 +0100 RDMA/rtrs-srv: Destroy path files after making sure no IOs in-flight Destroying path files may lead to the freeing of rdma_stats. This creates the following race. An IO is in-flight, or has just passed the session state check in process_read/process_write. The close_work gets triggered and the function rtrs_srv_close_work() starts and does destroy path which frees the rdma_stats. After this the function process_read/process_write resumes and tries to update the stats through the function rtrs_srv_update_rdma_stats This commit solves the problem by moving the destroy path function to a later point. This point makes sure any inflights are completed. This is done by qp drain, and waiting for all in-flights through ops_id. Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality") Signed-off-by: Md Haris Iqbal Signed-off-by: Santosh Kumar Pradhan Signed-off-by: Grzegorz Prajsner Link: https://lore.kernel.org/r/20231120154146.920486-6-haris.iqbal@ionos.com Signed-off-by: Leon Romanovsky commit 3a71cd6ca0ce33d1af019ecf1d7167406fa54400 Author: Md Haris Iqbal Date: Mon Nov 20 16:41:41 2023 +0100 RDMA/rtrs-srv: Free srv_mr iu only when always_invalidate is true Since srv_mr->iu is allocated and used only when always_invalidate is true, free it only when always_invalidate is true. Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality") Signed-off-by: Md Haris Iqbal Signed-off-by: Jack Wang Signed-off-by: Grzegorz Prajsner Link: https://lore.kernel.org/r/20231120154146.920486-5-haris.iqbal@ionos.com Signed-off-by: Leon Romanovsky commit ed1e52aefa16f15dc2f04054a3baf11726a7460e Author: Md Haris Iqbal Date: Mon Nov 20 16:41:40 2023 +0100 RDMA/rtrs-srv: Check return values while processing info request While processing info request, it could so happen that the srv_path goes to CLOSING state, cause of any of the error events from RDMA. That state change should be picked up while trying to change the state in process_info_req, by checking the return value. In case the state change call in process_info_req fails, we fail the processing. We should also check the return value for rtrs_srv_path_up, since it sends a link event to the client above, and the client can fail for any reason. Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality") Signed-off-by: Md Haris Iqbal Signed-off-by: Jack Wang Signed-off-by: Grzegorz Prajsner Link: https://lore.kernel.org/r/20231120154146.920486-4-haris.iqbal@ionos.com Signed-off-by: Leon Romanovsky commit 3e44a61b5db873612e20e7b7922468d7d1ac2d22 Author: Jack Wang Date: Mon Nov 20 16:41:39 2023 +0100 RDMA/rtrs-clt: Start hb after path_up If we start hb too early, it will confuse server side to close the session. Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") Signed-off-by: Jack Wang Reviewed-by: Md Haris Iqbal Signed-off-by: Grzegorz Prajsner Link: https://lore.kernel.org/r/20231120154146.920486-3-haris.iqbal@ionos.com Signed-off-by: Leon Romanovsky commit 3ee7ecd712048ade6482bea4b2f3dcaf039c0348 Author: Jack Wang Date: Mon Nov 20 16:41:38 2023 +0100 RDMA/rtrs-srv: Do not unconditionally enable irq When IO is completed, rtrs can be called in softirq context, unconditionally enabling irq could cause panic. To be on safe side, use spin_lock_irqsave and spin_unlock_irqrestore instread. Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality") Signed-off-by: Jack Wang Signed-off-by: Florian-Ewald Mueller Signed-off-by: Md Haris Iqbal Signed-off-by: Grzegorz Prajsner Link: https://lore.kernel.org/r/20231120154146.920486-2-haris.iqbal@ionos.com Signed-off-by: Leon Romanovsky commit 84d2db91f14a32dc856a5972e3f0907089093c7a Author: Nguyen Dinh Phi Date: Tue Nov 21 15:53:57 2023 +0800 nfc: virtual_ncidev: Add variable to check if ndev is running syzbot reported an memory leak that happens when an skb is add to send_buff after virtual nci closed. This patch adds a variable to track if the ndev is running before handling new skb in send function. Signed-off-by: Nguyen Dinh Phi Reported-by: syzbot+6eb09d75211863f15e3e@syzkaller.appspotmail.com Closes: https://lore.kernel.org/lkml/00000000000075472b06007df4fb@google.com Reviewed-by: Bongsu Jeon Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 9ffccb691adb854e7b7f3ee57fbbda12ff70533f Author: Aoba K Date: Tue Nov 21 20:23:11 2023 +0800 HID: multitouch: Add quirk for HONOR GLO-GXXX touchpad Honor MagicBook 13 2023 has a touchpad which do not switch to the multitouch mode until the input mode feature is written by the host. The touchpad do report the input mode at touchpad(3), while itself working under mouse mode. As a workaround, it is possible to call MT_QUIRE_FORCE_GET_FEATURE to force set feature in mt_set_input_mode for such device. The touchpad reports as BLTP7853, which cannot retrive any useful manufacture information on the internel by this string at present. As the serial number of the laptop is GLO-G52, while DMI info reports the laptop serial number as GLO-GXXX, this workaround should applied to all models which has the GLO-GXXX. Signed-off-by: Aoba K Signed-off-by: Jiri Kosina commit 546edbd26cff7ae990e480a59150e801a06f77b1 Author: Denis Benato Date: Fri Nov 17 14:15:56 2023 +1300 HID: hid-asus: reset the backlight brightness level on resume Some devices managed by this driver automatically set brightness to 0 before entering a suspended state and reset it back to a default brightness level after the resume: this has the effect of having the kernel report wrong brightness status after a sleep, and on some devices (like the Asus RC71L) that brightness is the intensity of LEDs directly facing the user. Fix the above issue by setting back brightness to the level it had before entering a sleep state. Signed-off-by: Denis Benato Signed-off-by: Luke D. Jones Signed-off-by: Jiri Kosina commit 06ae5afce8cc1f7621cc5c7751e449ce20d68af7 Author: Denis Benato Date: Fri Nov 17 14:15:55 2023 +1300 HID: hid-asus: add const to read-only outgoing usb buffer In the function asus_kbd_set_report the parameter buf is read-only as it gets copied in a memory portion suitable for USB transfer, but the parameter is not marked as const: add the missing const and mark const immutable buffers passed to that function. Signed-off-by: Denis Benato Signed-off-by: Luke D. Jones Signed-off-by: Jiri Kosina commit 8abc712ea4867a81c860853048f24e511bbc20f2 Author: Ritesh Harjani (IBM) Date: Wed Nov 22 14:32:15 2023 +0530 ext2: Fix ki_pos update for DIO buffered-io fallback case Commit "filemap: update ki_pos in generic_perform_write", made updating of ki_pos into common code in generic_perform_write() function. This also causes generic/091 to fail. This happened due to an in-flight collision with: fb5de4358e1a ("ext2: Move direct-io to use iomap"). I have chosen fixes tag based on which commit got landed later to upstream kernel. Fixes: 182c25e9c157 ("filemap: update ki_pos in generic_perform_write") Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Ritesh Harjani (IBM) Signed-off-by: Jan Kara Message-Id: commit e389fe8b68137344562fb6e4d53d8a89ef6212dd Author: Victor Fragoso Date: Tue Nov 21 21:05:56 2023 +0000 USB: serial: option: add Fibocom L7xx modules Add support for Fibocom L716-EU module series. L716-EU is a Fibocom module based on ZTE's V3E/V3T chipset. Device creates multiple interfaces when connected to PC as follows: - Network Interface: ECM or RNDIS (set by FW or AT Command) - ttyUSB0: AT port - ttyUSB1: Modem port - ttyUSB2: AT2 port - ttyUSB3: Trace port for log information - ADB: ADB port for debugging. ("Driver=usbfs" when ADB server enabled) Here are the outputs of lsusb and usb-devices: $ ls /dev/ttyUSB* /dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3 usb-devices: L716-EU (ECM mode): T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 51 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2cb7 ProdID=0001 Rev= 1.00 S: Manufacturer=Fibocom,Incorporated S: Product=Fibocom Mobile Boardband S: SerialNumber=1234567890ABCDEF C:* #Ifs= 7 Cfg#= 1 Atr=e0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00 I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether E: Ad=87(I) Atr=03(Int.) MxPS= 16 Ivl=32ms I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms L716-EU (RNDIS mode): T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 49 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2cb7 ProdID=0001 Rev= 1.00 S: Manufacturer=Fibocom,Incorporated S: Product=Fibocom Mobile Boardband S: SerialNumber=1234567890ABCDEF C:* #Ifs= 7 Cfg#= 1 Atr=e0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=03 I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=ff Driver=rndis_host E: Ad=87(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= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Victor Fragoso Reviewed-by: Lars Melin Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 18286883e779fb79b413a7462968ee3f6768f19c Author: Uros Bizjak Date: Tue Nov 14 17:59:28 2023 +0100 x86/hyperv: Use atomic_try_cmpxchg() to micro-optimize hv_nmi_unknown() Use atomic_try_cmpxchg() instead of atomic_cmpxchg(*ptr, old, new) == old in hv_nmi_unknown(). On x86 the CMPXCHG instruction returns success in the ZF flag, so this change saves a compare after CMPXCHG. The generated asm code improves from: 3e: 65 8b 15 00 00 00 00 mov %gs:0x0(%rip),%edx 45: b8 ff ff ff ff mov $0xffffffff,%eax 4a: f0 0f b1 15 00 00 00 lock cmpxchg %edx,0x0(%rip) 51: 00 52: 83 f8 ff cmp $0xffffffff,%eax 55: 0f 95 c0 setne %al to: 3e: 65 8b 15 00 00 00 00 mov %gs:0x0(%rip),%edx 45: b8 ff ff ff ff mov $0xffffffff,%eax 4a: f0 0f b1 15 00 00 00 lock cmpxchg %edx,0x0(%rip) 51: 00 52: 0f 95 c0 setne %al No functional change intended. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Wei Liu Cc: Dexuan Cui Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Signed-off-by: Uros Bizjak Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20231114170038.381634-1-ubizjak@gmail.com Signed-off-by: Wei Liu Message-ID: <20231114170038.381634-1-ubizjak@gmail.com> commit b6fe6f03716da246b453369f98a553d4ab21447c Author: Hao Ge Date: Tue Nov 21 09:37:09 2023 +0800 dpll: Fix potential msg memleak when genlmsg_put_reply failed We should clean the skb resource if genlmsg_put_reply failed. Fixes: 9d71b54b65b1 ("dpll: netlink: Add DPLL framework base functions") Signed-off-by: Hao Ge Reviewed-by: Vadim Fedorenko Link: https://lore.kernel.org/r/20231121013709.73323-1-gehao@kylinos.cn Signed-off-by: Jakub Kicinski commit b2d66643dcf2c395207f9373c624e0ab32166e57 Merge: 495ec91b48e48 acb12c859ac7c Author: Jakub Kicinski Date: Tue Nov 21 15:49:30 2023 -0800 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2023-11-21 We've added 19 non-merge commits during the last 4 day(s) which contain a total of 18 files changed, 1043 insertions(+), 416 deletions(-). The main changes are: 1) Fix BPF verifier to validate callbacks as if they are called an unknown number of times in order to fix not detecting some unsafe programs, from Eduard Zingerman. 2) Fix bpf_redirect_peer() handling which missed proper stats accounting for veth and netkit and also generally fix missing stats for the latter, from Peilin Ye, Daniel Borkmann et al. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: selftests/bpf: check if max number of bpf_loop iterations is tracked bpf: keep track of max number of bpf_loop callback iterations selftests/bpf: test widening for iterating callbacks bpf: widening for callback iterators selftests/bpf: tests for iterating callbacks bpf: verify callbacks as if they are called unknown number of times bpf: extract setup_func_entry() utility function bpf: extract __check_reg_arg() utility function selftests/bpf: fix bpf_loop_bench for new callback verification scheme selftests/bpf: track string payload offset as scalar in strobemeta selftests/bpf: track tcp payload offset as scalar in xdp_synproxy selftests/bpf: Add netkit to tc_redirect selftest selftests/bpf: De-veth-ize the tc_redirect test case bpf, netkit: Add indirect call wrapper for fetching peer dev bpf: Fix dev's rx stats for bpf_redirect_peer traffic veth: Use tstats per-CPU traffic counters netkit: Add tstats per-CPU traffic counters net: Move {l,t,d}stats allocation to core and convert veth & vrf net, vrf: Move dstats structure to core ==================== Link: https://lore.kernel.org/r/20231121193113.11796-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 495ec91b48e489afefb2ad714f0d9b68c3016c6c Author: Jakub Kicinski Date: Mon Nov 20 12:01:09 2023 -0800 docs: netdev: try to guide people on dealing with silence There has been more than a few threads which went idle before the merge window and now people came back to them and started asking about next steps. We currently tell people to be patient and not to repost too often. Our "not too often", however, is still a few orders of magnitude faster than other subsystems. Or so I feel after hearing people talk about review rates at LPC. Clarify in the doc that if the discussion went idle for a week on netdev, 95% of the time there's no point waiting longer. Link: https://lore.kernel.org/r/20231120200109.620392-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 0739af07d1d947af27c877f797cb82ceee702515 Author: Jose Ignacio Tornos Martinez Date: Mon Nov 20 13:06:29 2023 +0100 net: usb: ax88179_178a: fix failed operations during ax88179_reset Using generic ASIX Electronics Corp. AX88179 Gigabit Ethernet device, the following test cycle has been implemented: - power on - check logs - shutdown - after detecting the system shutdown, disconnect power - after approximately 60 seconds of sleep, power is restored Running some cycles, sometimes error logs like this appear: kernel: ax88179_178a 2-9:1.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -19 kernel: ax88179_178a 2-9:1.0 (unnamed net_device) (uninitialized): Failed to read reg index 0x0001: -19 ... These failed operation are happening during ax88179_reset execution, so the initialization could not be correct. In order to avoid this, we need to increase the delay after reset and clock initial operations. By using these larger values, many cycles have been run and no failed operations appear. It would be better to check some status register to verify when the operation has finished, but I do not have found any available information (neither in the public datasheets nor in the manufacturer's driver). The only available information for the necessary delays is the maufacturer's driver (original values) but the proposed values are not enough for the tested devices. Fixes: e2ca90c276e1f ("ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver") Reported-by: Herb Wei Tested-by: Herb Wei Signed-off-by: Jose Ignacio Tornos Martinez Link: https://lore.kernel.org/r/20231120120642.54334-1-jtornosm@redhat.com Signed-off-by: Jakub Kicinski commit ab93edb2f94c3c0d5965be3815782472adbe3f52 Author: Dave Airlie Date: Wed Nov 22 06:11:09 2023 +1000 nouveau/gsp: allocate enough space for all channel ids. This probably isn't the ideal fix, but we ended up using chids sparsely, and lots of things rely on indexing into the full range, so just allocate the full range up front. The GSP code fixes 8 channels into a userd page, but we end up using a single userd page per channel so end up sparsely using the range. Fixes a few crashes seen with multiple channels. Link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/277 Signed-off-by: Dave Airlie Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20231121201109.2988516-1-airlied@gmail.com commit c2d5304e6c648ebcf653bace7e51e0e6742e46c8 Merge: 6b65522316489 a6584711e64d9 Author: Linus Torvalds Date: Tue Nov 21 11:56:57 2023 -0800 Merge tag 'platform-drivers-x86-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform drivers fixes from Ilpo Järvinen: "Just a few fixes (one with two non-fix deps) plus tidying up MAINTAINERS" * tag 'platform-drivers-x86-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: intel_telemetry: Fix kernel doc descriptions MAINTAINERS: Drop Mark Gross as maintainer for x86 platform drivers platform/x86/amd/pmc: adjust getting DRAM size behavior platform/x86: hp-bioscfg: Remove unused obj in hp_add_other_attributes() platform/x86: hp-bioscfg: Fix error handling in hp_add_other_attributes() platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes() platform/x86: hp-bioscfg: Simplify return check in hp_add_other_attributes() platform/x86: ideapad-laptop: Set max_brightness before using it MAINTAINERS: Remove stale entry for SBL platform driver commit 6b65522316489ff0b2be65d00fbcecbc781017c9 Merge: 98b1cc82c4aff 62b241efff99f Author: Linus Torvalds Date: Tue Nov 21 11:45:48 2023 -0800 Merge tag 'erofs-for-6.7-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs fixes from Gao Xiang: - Tidy up erofs_read_inode() for simplicity - Fix broken fscache mode due to NULL dereference of dif->bdev_handle - Add the EROFS webpage to MAINTAINERS, documentation, and Kconfig * tag 'erofs-for-6.7-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: MAINTAINERS: erofs: add EROFS webpage erofs: fix NULL dereference of dif->bdev_handle in fscache mode erofs: simplify erofs_read_inode() commit cea7008190ad65b4aaae6e94667a358d2c10a696 Author: Cong Yang Date: Mon Nov 20 10:01:09 2023 +0800 drm/panel: boe-tv101wum-nl6: Fine tune Himax83102-j02 panel HFP and HBP The refresh reported by modetest is 60.46Hz, and the actual measurement is 60.01Hz, which is outside the expected tolerance. Adjust hporch and pixel clock to fix it. After repair, modetest and actual measurement were all 60.01Hz. Modetest refresh = Pixel CLK/ htotal* vtotal, but measurement frame rate is HS->LP cycle time(Vblanking). Measured frame rate is not only affecte by Htotal/Vtotal/pixel clock, also affected by Lane-num/PixelBit/LineTime /DSI CLK. Assume that the DSI controller could not make the mode that we requested(presumably it's PLL couldn't generate the exact pixel clock?). If you use a different DSI controller, you may need to readjust these parameters. Now this panel looks like it's only used by me on the MTK platform, so let's change this set of parameters. Fixes: 1bc2ef065f13 ("drm/panel: Support for Starry-himax83102-j02 TDDI MIPI-DSI panel") Signed-off-by: Cong Yang Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20231120020109.3216343-1-yangcong5@huaqin.corp-partner.google.com commit 29b8e94dcf2575c17541f843741ee96691ff1ded Author: Yang Jihong Date: Sat Nov 18 02:48:57 2023 +0000 perf lock contention: Fix a build error on 32-bit Fix a build error on 32-bit system: util/bpf_lock_contention.c: In function 'lock_contention_get_name': util/bpf_lock_contention.c:253:50: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'u64 {aka long long unsigned int}' [-Werror=format=] snprintf(name_buf, sizeof(name_buf), "cgroup:%lu", cgrp_id); ~~^ %llu cc1: all warnings being treated as errors Fixes: d0c502e46e97 ("perf lock contention: Prepare to handle cgroups") Signed-off-by: Yang Jihong Acked-by: Namhyung Kim Cc: avagin@google.com Cc: daniel.diaz@linaro.org Link: https://lore.kernel.org/r/20231118024858.1567039-3-yangjihong1@huawei.com Signed-off-by: Namhyung Kim commit a6dda77a752d918b35ef4a3f94e6b8c7d7ba4a73 Author: Yang Jihong Date: Sat Nov 18 02:48:56 2023 +0000 perf kwork: Fix a build error on 32-bit lkft reported a build error for 32-bit system: builtin-kwork.c: In function 'top_print_work': builtin-kwork.c:1646:28: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'u64' {aka 'long long unsigned int'} [-Werror=format=] 1646 | ret += printf(" %*ld ", PRINT_PID_WIDTH, work->id); | ~~~^ ~~~~~~~~ | | | | long int u64 {aka long long unsigned int} | %*lld cc1: all warnings being treated as errors make[3]: *** [/builds/linux/tools/build/Makefile.build:106: /home/tuxbuild/.cache/tuxmake/builds/1/build/builtin-kwork.o] Error 1 Fix it. Fixes: 55c40e505234 ("perf kwork top: Introduce new top utility") Reported-by: Linux Kernel Functional Testing Signed-off-by: Yang Jihong Acked-by: Namhyung Kim Cc: avagin@google.com Cc: daniel.diaz@linaro.org Link: https://lore.kernel.org/r/20231118024858.1567039-2-yangjihong1@huawei.com Signed-off-by: Namhyung Kim commit 080990aa3344123673f686cda2df0d1b0deee046 Author: Borislav Petkov (AMD) Date: Wed Nov 15 22:02:12 2023 +0100 x86/microcode: Rework early revisions reporting The AMD side of the loader issues the microcode revision for each logical thread on the system, which can become really noisy on huge machines. And doing that doesn't make a whole lot of sense - the microcode revision is already in /proc/cpuinfo. So in case one is interested in the theoretical support of mixed silicon steppings on AMD, one can check there. What is also missing on the AMD side - something which people have requested before - is showing the microcode revision the CPU had *before* the early update. So abstract that up in the main code and have the BSP on each vendor provide those revision numbers. Then, dump them only once on driver init. On Intel, do not dump the patch date - it is not needed. Reported-by: Linus Torvalds Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/CAHk-=wg=%2B8rceshMkB4VnKxmRccVLtBLPBawnewZuuqyx5U=3A@mail.gmail.com commit 2e569ada424c40ce27c99bfab4f9780619061c83 Author: Borislav Petkov (AMD) Date: Wed Nov 15 22:02:11 2023 +0100 x86/microcode: Remove the driver announcement and version First of all, the print is useless. The driver will either load and say which microcode revision the machine has or issue an error. Then, the version number is meaningless and actively confusing, as Yazen mentioned recently: when a subset of patches are backported to a distro kernel, one can't assume the driver version is the same as the upstream one. And besides, the version number of the loader hasn't been used and incremented for a long time. So drop it. Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20231115210212.9981-2-bp@alien8.de commit 98c598afc22d4e43c2ad91860b65996d0c099a5d Author: Li Nan Date: Mon Sep 11 10:33:08 2023 +0800 nbd: pass nbd_sock to nbd_read_reply() instead of index If a socket is processing ioctl 'NBD_SET_SOCK', config->socks might be krealloc in nbd_add_socket(), and a garbage request is received now, a UAF may occurs. T1 nbd_ioctl __nbd_ioctl nbd_add_socket blk_mq_freeze_queue T2 recv_work nbd_read_reply sock_xmit krealloc config->socks def config->socks Pass nbd_sock to nbd_read_reply(). And introduce a new function sock_xmit_recv(), which differs from sock_xmit only in the way it get socket. ================================================================== BUG: KASAN: use-after-free in sock_xmit+0x525/0x550 Read of size 8 at addr ffff8880188ec428 by task kworker/u12:1/18779 Workqueue: knbd4-recv recv_work Call Trace: __dump_stack dump_stack+0xbe/0xfd print_address_description.constprop.0+0x19/0x170 __kasan_report.cold+0x6c/0x84 kasan_report+0x3a/0x50 sock_xmit+0x525/0x550 nbd_read_reply+0xfe/0x2c0 recv_work+0x1c2/0x750 process_one_work+0x6b6/0xf10 worker_thread+0xdd/0xd80 kthread+0x30a/0x410 ret_from_fork+0x22/0x30 Allocated by task 18784: kasan_save_stack+0x1b/0x40 kasan_set_track set_alloc_info __kasan_kmalloc __kasan_kmalloc.constprop.0+0xf0/0x130 slab_post_alloc_hook slab_alloc_node slab_alloc __kmalloc_track_caller+0x157/0x550 __do_krealloc krealloc+0x37/0xb0 nbd_add_socket +0x2d3/0x880 __nbd_ioctl nbd_ioctl+0x584/0x8e0 __blkdev_driver_ioctl blkdev_ioctl+0x2a0/0x6e0 block_ioctl+0xee/0x130 vfs_ioctl __do_sys_ioctl __se_sys_ioctl+0x138/0x190 do_syscall_64+0x33/0x40 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Freed by task 18784: kasan_save_stack+0x1b/0x40 kasan_set_track+0x1c/0x30 kasan_set_free_info+0x20/0x40 __kasan_slab_free.part.0+0x13f/0x1b0 slab_free_hook slab_free_freelist_hook slab_free kfree+0xcb/0x6c0 krealloc+0x56/0xb0 nbd_add_socket+0x2d3/0x880 __nbd_ioctl nbd_ioctl+0x584/0x8e0 __blkdev_driver_ioctl blkdev_ioctl+0x2a0/0x6e0 block_ioctl+0xee/0x130 vfs_ioctl __do_sys_ioctl __se_sys_ioctl+0x138/0x190 do_syscall_64+0x33/0x40 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Signed-off-by: Li Nan Reviewed-by: Yu Kuai Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20230911023308.3467802-1-linan666@huaweicloud.com Signed-off-by: Jens Axboe commit 16b7e0cccb243033de4406ffb4d892365041a1e7 Author: Johan Hovold Date: Fri Nov 3 17:43:23 2023 +0100 USB: xhci-plat: fix legacy PHY double init Commits 7b8ef22ea547 ("usb: xhci: plat: Add USB phy support") and 9134c1fd0503 ("usb: xhci: plat: Add USB 3.0 phy support") added support for looking up legacy PHYs from the sysdev devicetree node and initialising them. This broke drivers such as dwc3 which manages PHYs themself as the PHYs would now be initialised twice, something which specifically can lead to resources being left enabled during suspend (e.g. with the usb_phy_generic PHY driver). As the dwc3 driver uses driver-name matching for the xhci platform device, fix this by only looking up and initialising PHYs for devices that have been matched using OF. Note that checking that the platform device has a devicetree node would currently be sufficient, but that could lead to subtle breakages in case anyone ever tries to reuse an ancestor's node. Fixes: 7b8ef22ea547 ("usb: xhci: plat: Add USB phy support") Fixes: 9134c1fd0503 ("usb: xhci: plat: Add USB 3.0 phy support") Cc: stable@vger.kernel.org # 4.1 Cc: Maxime Ripard Cc: Stanley Chang Signed-off-by: Johan Hovold Tested-by: Stefan Eichenberger Tested-by: Stanley Chang Link: https://lore.kernel.org/r/20231103164323.14294-1-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit 4b435764f7c2922822962e7f6343cce645d502f1 Author: Heikki Krogerus Date: Tue Nov 21 13:46:47 2023 +0200 usb: typec: tipd: Supply also I2C driver data If there is no fwnode, device_get_match_data() does not return anything making the probe to always fail. Using i2c_get_match_data() when there is no fwnode to fix that. Fixes: 5bd4853da049 ("USB: typec: tps6598x: Add device data to of_device_id") Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231121114647.2005011-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 61d2cf0db741827724d33079b4a54bf99a32b8e5 Author: Chunfeng Yun Date: Sat Nov 18 11:30:11 2023 +0800 usb: xhci-mtk: fix in-ep's start-split check failure It's wrong to use the data length in a CS (in uframe x) to check whether there is a SS (in uframe x-2), because for a isoc-in ep, it may need some CS to receive data; Save the count of SS in a uframe for isoc/intr in-eps to fix the issue. Fixes: 5c954e030f55 ("usb: xhci-mtk: improve split scheduling by separate IN/OUT budget") Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20231118033011.22033-1-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 8bbae288a85abed6a1cf7d185d8b9dc2f5dcb12c Author: Ricardo Ribalda Date: Fri Oct 27 11:28:20 2023 +0000 usb: dwc3: set the dma max_seg_size Allow devices to have dma operations beyond 4K, and avoid warnings such as: DMA-API: dwc3 a600000.usb: mapping sg segment longer than device claims to support [len=86016] [max=65536] Cc: stable@vger.kernel.org Fixes: 72246da40f37 ("usb: Introduce DesignWare USB3 DRD Driver") Reported-by: Zubin Mithra Signed-off-by: Ricardo Ribalda Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20231026-dwc3-v2-1-1d4fd5c3e067@chromium.org Signed-off-by: Greg Kroah-Hartman commit 974bba5c118f4c2baf00de0356e3e4f7928b4cbc Author: Niklas Neronin Date: Wed Nov 15 14:13:25 2023 +0200 usb: config: fix iteration issue in 'usb_get_bos_descriptor()' The BOS descriptor defines a root descriptor and is the base descriptor for accessing a family of related descriptors. Function 'usb_get_bos_descriptor()' encounters an iteration issue when skipping the 'USB_DT_DEVICE_CAPABILITY' descriptor type. This results in the same descriptor being read repeatedly. To address this issue, a 'goto' statement is introduced to ensure that the pointer and the amount read is updated correctly. This ensures that the function iterates to the next descriptor instead of reading the same descriptor repeatedly. Cc: stable@vger.kernel.org Fixes: 3dd550a2d365 ("USB: usbcore: Fix slab-out-of-bounds bug during device reset") Signed-off-by: Niklas Neronin Acked-by: Mathias Nyman Reviewed-by: Alan Stern Link: https://lore.kernel.org/r/20231115121325.471454-1-niklas.neronin@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 791cd7afe51b0c770264836ab0607766e3e80f52 Author: Stanley Chang Date: Fri Nov 17 15:03:05 2023 +0800 usb: dwc3: add missing of_node_put and platform_device_put of_get_compatible_child performs an of_node_get, so an of_node_put is required. Add platform_device_put to match with of_find_device_by_node. Fixes: 34c200483569 ("usb: dwc3: add Realtek DHC RTD SoC dwc3 glue layer driver") Signed-off-by: Stanley Chang Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20231117070311.32502-1-stanley_chang@realtek.com Signed-off-by: Greg Kroah-Hartman commit 0583bc776ca5b5a3f5752869fc31cf7322df2b35 Author: Oliver Neukum Date: Wed Nov 15 15:45:07 2023 +0100 USB: dwc2: write HCINT with INTMASK applied dwc2_hc_n_intr() writes back INTMASK as read but evaluates it with intmask applied. In stress testing this causes spurious interrupts like this: [Mon Aug 14 10:51:07 2023] dwc2 3f980000.usb: dwc2_hc_chhltd_intr_dma: Channel 7 - ChHltd set, but reason is unknown [Mon Aug 14 10:51:07 2023] dwc2 3f980000.usb: hcint 0x00000002, intsts 0x04600001 [Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: dwc2_hc_chhltd_intr_dma: Channel 0 - ChHltd set, but reason is unknown [Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: hcint 0x00000002, intsts 0x04600001 [Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: dwc2_hc_chhltd_intr_dma: Channel 4 - ChHltd set, but reason is unknown [Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: hcint 0x00000002, intsts 0x04600001 [Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: dwc2_update_urb_state_abn(): trimming xfer length Applying INTMASK prevents this. The issue exists in all versions of the driver. Signed-off-by: Oliver Neukum Tested-by: Ivan Ivanov Tested-by: Andrea della Porta Link: https://lore.kernel.org/r/20231115144514.15248-1-oneukum@suse.com Cc: stable Signed-off-by: Greg Kroah-Hartman commit 30ce1c03a083c9dc131d09d28ba1bcaafa3d8df2 Author: Wentong Wu Date: Tue Nov 14 15:25:31 2023 +0800 usb: misc: ljca: Drop _ADR support to get ljca children devices Currently the shipped platforms use only _HID to distinguish ljca children devices. The _ADR support here is for future HW. This patch is to drop _ADR support and we can then re-introduce it (revert this patch) if future HW actually starts using _ADR to distinguish children devices. Signed-off-by: Wentong Wu Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231114072531.1366753-1-wentong.wu@intel.com Signed-off-by: Greg Kroah-Hartman commit 58f2fcb3a845fcbbad2f3196bb37d744e0506250 Author: Pawel Laszczak Date: Wed Nov 8 10:31:25 2023 +0100 usb: cdnsp: Fix deadlock issue during using NCM gadget 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. cc: stable@vger.kernel.org Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver") Signed-off-by: Pawel Laszczak Acked-by: Peter Chen Link: https://lore.kernel.org/r/20231108093125.224963-1-pawell@cadence.com Signed-off-by: Greg Kroah-Hartman commit 187fb003c57c964ea61ac9fbfe41abf3ca9973eb Author: Badhri Jagan Sridharan Date: Wed Nov 1 01:28:45 2023 +0000 usb: typec: tcpm: Fix sink caps op current check TCPM checks for sink caps operational current even when PD is disabled. This incorrectly sets tcpm_set_charge() when PD is disabled. Check for sink caps only when PD is enabled. [ 97.572342] Start toggling [ 97.578949] CC1: 0 -> 0, CC2: 0 -> 0 [state TOGGLING, polarity 0, disconnected] [ 99.571648] CC1: 0 -> 0, CC2: 0 -> 4 [state TOGGLING, polarity 0, connected] [ 99.571658] state change TOGGLING -> SNK_ATTACH_WAIT [rev3 NONE_AMS] [ 99.571673] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 170 ms [rev3 NONE_AMS] [ 99.741778] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 170 ms] [ 99.789283] CC1: 0 -> 0, CC2: 4 -> 5 [state SNK_DEBOUNCED, polarity 0, connected] [ 99.789306] state change SNK_DEBOUNCED -> SNK_DEBOUNCED [rev3 NONE_AMS] [ 99.903584] VBUS on [ 99.903591] state change SNK_DEBOUNCED -> SNK_ATTACHED [rev3 NONE_AMS] [ 99.903600] polarity 1 [ 99.910155] enable vbus discharge ret:0 [ 99.910160] Requesting mux state 1, usb-role 2, orientation 2 [ 99.946791] state change SNK_ATTACHED -> SNK_STARTUP [rev3 NONE_AMS] [ 99.946798] state change SNK_STARTUP -> SNK_DISCOVERY [rev3 NONE_AMS] [ 99.946800] Setting voltage/current limit 5000 mV 500 mA [ 99.946803] vbus=0 charge:=1 [ 100.027139] state change SNK_DISCOVERY -> SNK_READY [rev3 NONE_AMS] [ 100.027145] Setting voltage/current limit 5000 mV 3000 mA [ 100.466830] VBUS on Cc: stable@vger.kernel.org Fixes: 803b1c8a0cea ("usb: typec: tcpm: not sink vbus if operational current is 0mA") Signed-off-by: Badhri Jagan Sridharan Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Tested-by: Will McVicker Link: https://lore.kernel.org/r/20231101012845.2701348-1-badhri@google.com Signed-off-by: Greg Kroah-Hartman commit 10d510abd096d620b9fda2dd3e0047c5efc4ad2b Author: Alexander Stein Date: Wed Oct 25 11:51:10 2023 +0200 usb: dwc3: Fix default mode initialization The default mode, configurable by DT, shall be set before usb role switch driver is registered. Otherwise there is a race between default mode and mode set by usb role switch driver. Fixes: 98ed256a4dbad ("usb: dwc3: Add support for role-switch-default-mode binding") Cc: stable Signed-off-by: Alexander Stein Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20231025095110.2405281-1-alexander.stein@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman commit cdd0cde8d8837de3d234bb08115d5f196e0ac8dd Author: Christophe JAILLET Date: Mon Oct 30 07:56:40 2023 +0100 USB: typec: tps6598x: Fix a memory leak in an error handling path All error handling end to the error handling path, except these ones. Go to 'release_fw' as well here, otherwise 'fw' is leaking. Fixes: 7e7a3c815d22 ("USB: typec: tps6598x: Add TPS25750 support") Signed-off-by: Christophe JAILLET Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/23168336f18a9f6cb1a5b47130fc134dc0510d7f.1698648980.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit a6fe37f428c19dd164c2111157d4a1029bd853aa Author: Badhri Jagan Sridharan Date: Wed Nov 1 02:19:09 2023 +0000 usb: typec: tcpm: Skip hard reset when in error recovery Hard reset queued prior to error recovery (or) received during error recovery will make TCPM to prematurely exit error recovery sequence. Ignore hard resets received during error recovery (or) port reset sequence. ``` [46505.459688] state change SNK_READY -> ERROR_RECOVERY [rev3 NONE_AMS] [46505.459706] state change ERROR_RECOVERY -> PORT_RESET [rev3 NONE_AMS] [46505.460433] disable vbus discharge ret:0 [46505.461226] Setting usb_comm capable false [46505.467244] Setting voltage/current limit 0 mV 0 mA [46505.467262] polarity 0 [46505.470695] Requesting mux state 0, usb-role 0, orientation 0 [46505.475621] cc:=0 [46505.476012] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS] [46505.476020] Received hard reset [46505.476024] state change PORT_RESET -> HARD_RESET_START [rev3 HARD_RESET] ``` Cc: stable@vger.kernel.org Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)") Signed-off-by: Badhri Jagan Sridharan Acked-by: Heikki Krogeus Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231101021909.2962679-1-badhri@google.com Signed-off-by: Greg Kroah-Hartman commit 41058707bea93b979c4854bdb857e46f2b85df92 Author: Johan Hovold Date: Fri Nov 10 14:48:02 2023 +0100 dt-bindings: usb: hcd: add missing phy name to example The example host controller node has two PHYs and therefore needs two PHY names. Fixes: 3aa3c66aedef ("dt-bindings: usb: Bring back phy-names") Signed-off-by: Johan Hovold Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231110134802.32060-1-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit 9c6dc13106f2dd2d6819d66618b25a6f41f0ee6a Author: Simon Horman Date: Mon Nov 20 08:28:40 2023 +0000 MAINTAINERS: Add indirect_call_wrapper.h to NETWORKING [GENERAL] indirect_call_wrapper.h is not, strictly speaking, networking specific. However, it's git history indicates that in practice changes go through netdev and thus the netdev maintainers have effectively been taking responsibility for it. Formalise this by adding it to the NETWORKING [GENERAL] section in the MAINTAINERS file. It is not clear how many other files under include/linux fall into this category and it would be interesting, as a follow-up, to audit that and propose further updates to the MAINTAINERS file as appropriate. Link: https://lore.kernel.org/netdev/20231116010310.4664dd38@kernel.org/ Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20231120-indirect_call_wrapper-maintainer-v1-1-0a6bb1f7363e@kernel.org Signed-off-by: Paolo Abeni commit 5b4ffb176d7979ac66b349addf3f7de433335e00 Author: Jiri Kosina Date: Tue Nov 21 14:38:11 2023 +0100 Revert "HID: logitech-dj: Add support for a new lightspeed receiver iteration" This reverts commit 9d1bd9346241cd6963b58da7ffb7ed303285f684. Multiple people reported misbehaving devices and reverting this commit fixes the problem for them. As soon as the original commit author starts reacting again, we can try to figure out why he hasn't seen the issues (mismatching report descriptors?), but for the time being, fix for 6.7 by reverting. Link: https://bugzilla.kernel.org/show_bug.cgi?id=218172 Link: https://bugzilla.kernel.org/show_bug.cgi?id=218094 Cc: Signed-off-by: Jiri Kosina commit a1092619dd28ac0fcf23016160a2fdccd98ef935 Author: Puliang Lu Date: Thu Oct 26 20:35:06 2023 +0800 USB: serial: option: fix FM101R-GL defines Modify the definition of the two Fibocom FM101R-GL PID macros, which had their PIDs switched. The correct PIDs are: - VID:PID 413C:8213, FM101R-GL ESIM are laptop M.2 cards (with MBIM interfaces for Linux) - VID:PID 413C:8215, FM101R-GL are laptop M.2 cards (with MBIM interface for Linux) 0x8213: mbim, tty 0x8215: mbim, tty Signed-off-by: Puliang Lu Fixes: 52480e1f1a25 ("USB: serial: option: add Fibocom to DELL custom modem FM101R-GL") Link: https://lore.kernel.org/lkml/TYZPR02MB508845BAD7936A62A105CE5D89DFA@TYZPR02MB5088.apcprd02.prod.outlook.com/ Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 8771127e25d6c20d458ad27cf32f7fcfc1755e05 Author: Lech Perczak Date: Sat Nov 18 00:19:17 2023 +0100 USB: serial: option: don't claim interface 4 for ZTE MF290 Interface 4 is used by for QMI interface in stock firmware of MF28D, the router which uses MF290 modem. Free the interface up, to rebind it to qmi_wwan driver. The proper configuration is: Interface mapping is: 0: QCDM, 1: (unknown), 2: AT (PCUI), 2: AT (Modem), 4: QMI T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 4 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=19d2 ProdID=0189 Rev= 0.00 S: Manufacturer=ZTE, Incorporated S: Product=ZTE LTE Technologies MSM C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan E: Ad=86(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms Cc: Bjørn Mork Signed-off-by: Lech Perczak Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit e8df9d9f4209c04161321d8c12640ae560f65939 Author: Dapeng Mi Date: Tue Nov 21 09:46:28 2023 +0800 perf/x86/intel: Correct incorrect 'or' operation for PMU capabilities When running perf-stat command on Intel hybrid platform, perf-stat reports the following errors: sudo taskset -c 7 ./perf stat -vvvv -e cpu_atom/instructions/ sleep 1 Opening: cpu/cycles/:HG ------------------------------------------------------------ perf_event_attr: type 0 (PERF_TYPE_HARDWARE) config 0xa00000000 disabled 1 ------------------------------------------------------------ sys_perf_event_open: pid 0 cpu -1 group_fd -1 flags 0x8 sys_perf_event_open failed, error -16 Performance counter stats for 'sleep 1': cpu_atom/instructions/ It looks the cpu_atom/instructions/ event can't be enabled on atom PMU even when the process is pinned on atom core. Investigation shows that exclusive_event_init() helper always returns -EBUSY error in the perf event creation. That's strange since the atom PMU should not be an exclusive PMU. Further investigation shows the issue was introduced by commit: 97588df87b56 ("perf/x86/intel: Add common intel_pmu_init_hybrid()") The commit originally intents to clear the bit PERF_PMU_CAP_AUX_OUTPUT from PMU capabilities if intel_cap.pebs_output_pt_available is not set, but it incorrectly uses 'or' operation and leads to all PMU capabilities bits are set to 1 except bit PERF_PMU_CAP_AUX_OUTPUT. Testing this fix on Intel hybrid platforms, the observed issues disappear. Fixes: 97588df87b56 ("perf/x86/intel: Add common intel_pmu_init_hybrid()") Signed-off-by: Dapeng Mi Signed-off-by: Ingo Molnar Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231121014628.729989-1-dapeng1.mi@linux.intel.com commit 54d4434da824460a190d547404530eff12a7907d Merge: c0e2926266af3 c807d6cd089d2 Author: Paolo Abeni Date: Tue Nov 21 13:15:04 2023 +0100 Merge branch 'hv_netvsc-fix-race-of-netvsc-vf-register-and-slave-bit' Haiyang Zhang says: ==================== hv_netvsc: fix race of netvsc, VF register, and slave bit There are some races between netvsc probe, set notifier, VF register, and slave bit setting. This patch set fixes them. ==================== Link: https://lore.kernel.org/r/1700411023-14317-1-git-send-email-haiyangz@microsoft.com Signed-off-by: Paolo Abeni commit c807d6cd089d2f4951baa838081ec5ae3e2360f8 Author: Long Li Date: Sun Nov 19 08:23:43 2023 -0800 hv_netvsc: Mark VF as slave before exposing it to user-mode When a VF is being exposed form the kernel, it should be marked as "slave" before exposing to the user-mode. The VF is not usable without netvsc running as master. The user-mode should never see a VF without the "slave" flag. This commit moves the code of setting the slave flag to the time before VF is exposed to user-mode. Cc: stable@vger.kernel.org Fixes: 0c195567a8f6 ("netvsc: transparent VF management") Signed-off-by: Long Li Signed-off-by: Haiyang Zhang Acked-by: Stephen Hemminger Acked-by: Dexuan Cui Signed-off-by: Paolo Abeni commit 85520856466ed6bc3b1ccb013cddac70ceb437db Author: Haiyang Zhang Date: Sun Nov 19 08:23:42 2023 -0800 hv_netvsc: Fix race of register_netdevice_notifier and VF register If VF NIC is registered earlier, NETDEV_REGISTER event is replayed, but NETDEV_POST_INIT is not. Move register_netdevice_notifier() earlier, so the call back function is set before probing. Cc: stable@vger.kernel.org Fixes: e04e7a7bbd4b ("hv_netvsc: Fix a deadlock by getting rtnl lock earlier in netvsc_probe()") Reported-by: Dexuan Cui Signed-off-by: Haiyang Zhang Reviewed-by: Wojciech Drewek Reviewed-by: Dexuan Cui Signed-off-by: Paolo Abeni commit d30fb712e52964f2cf9a9c14cf67078394044837 Author: Haiyang Zhang Date: Sun Nov 19 08:23:41 2023 -0800 hv_netvsc: fix race of netvsc and VF register_netdevice The rtnl lock also needs to be held before rndis_filter_device_add() which advertises nvsp_2_vsc_capability / sriov bit, and triggers VF NIC offering and registering. If VF NIC finished register_netdev() earlier it may cause name based config failure. To fix this issue, move the call to rtnl_lock() before rndis_filter_device_add(), so VF will be registered later than netvsc / synthetic NIC, and gets a name numbered (ethX) after netvsc. Cc: stable@vger.kernel.org Fixes: e04e7a7bbd4b ("hv_netvsc: Fix a deadlock by getting rtnl lock earlier in netvsc_probe()") Reported-by: Dexuan Cui Signed-off-by: Haiyang Zhang Reviewed-by: Wojciech Drewek Reviewed-by: Simon Horman Reviewed-by: Dexuan Cui Signed-off-by: Paolo Abeni commit c0e2926266af3b5acf28df0a8fc6e4d90effe0bb Author: Kunwu Chan Date: Sun Nov 19 22:17:59 2023 +0800 ipv4: Correct/silence an endian warning in __ip_do_redirect net/ipv4/route.c:783:46: warning: incorrect type in argument 2 (different base types) net/ipv4/route.c:783:46: expected unsigned int [usertype] key net/ipv4/route.c:783:46: got restricted __be32 [usertype] new_gw Fixes: 969447f226b4 ("ipv4: use new_gw for redirect neigh lookup") Suggested-by: Eric Dumazet Signed-off-by: Kunwu Chan Link: https://lore.kernel.org/r/20231119141759.420477-1-chentao@kylinos.cn Signed-off-by: Paolo Abeni commit 4e7a8dbd2bc0aec4605a5069df7a779bd9e64db1 Author: Florian Fainelli Date: Mon Nov 13 08:46:32 2023 -0800 pwm: bcm2835: Fix NPD in suspend/resume When 119a508c4dc9 ("pwm: bcm2835: Add support for suspend/resume") was sent out on October 11th,, there was still a call to platform_set_drvdata() which would ensure that the driver private data structure could be used in bcm2835_pwm_{suspend,resume}. A cleanup now merged as commit commit 2ce7b7f6704c ("pwm: bcm2835: Simplify using devm functions") removed that call which would now cause a NPD in bcm2835_pwm_{suspend,resume} as a consequence. Fixes: 119a508c4dc9 ("pwm: bcm2835: Add support for suspend/resume") Signed-off-by: Florian Fainelli Reviewed-by: Uwe Kleine-König Link: https://lore.kernel.org/linux-pwm/20231113164632.2439400-1-florian.fainelli@broadcom.com Signed-off-by: Uwe Kleine-König commit c55092187d9ad7b2f8f5a8645286fa03997d442f Author: Oliver Neukum Date: Tue Nov 14 15:54:30 2023 +0100 HID: add ALWAYS_POLL quirk for Apple kb These devices disconnect if suspended without remote wakeup. They can operate with the standard driver. Signed-off-by: Oliver Neukum Signed-off-by: Jiri Kosina commit 8d6ef26501b97243ee6c16b8187c5b38cb69b77d Author: Thomas Zimmermann Date: Thu Nov 16 14:02:12 2023 +0100 drm/ast: Disconnect BMC if physical connector is connected Many user-space compositors fail with mode setting if a CRTC has more than one connected connector. This is the case with the BMC on Aspeed systems. Work around this problem by setting the BMC's connector status to disconnected when the physical connector has a display attached. This way compositors will only see one connected connector at a time; either the physical one or the BMC. Suggested-by: Jocelyn Falempe Fixes: e329cb53b45d ("drm/ast: Add BMC virtual connector") Signed-off-by: Thomas Zimmermann Cc: # v6.6+ Reviewed-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231116130217.22931-1-tzimmermann@suse.de commit a5e913c25b6b2b6ae02acef6d9400645ac03dfdf Author: Brett Raye Date: Thu Nov 2 18:10:38 2023 -0700 HID: glorious: fix Glorious Model I HID report The Glorious Model I mouse has a buggy HID report descriptor for its keyboard endpoint (used for programmable buttons). For report ID 2, there is a mismatch between Logical Minimum and Usage Minimum in the array that reports keycodes. The offending portion of the descriptor: (from hid-decode) 0x95, 0x05, // Report Count (5) 30 0x75, 0x08, // Report Size (8) 32 0x15, 0x00, // Logical Minimum (0) 34 0x25, 0x65, // Logical Maximum (101) 36 0x05, 0x07, // Usage Page (Keyboard) 38 0x19, 0x01, // Usage Minimum (1) 40 0x29, 0x65, // Usage Maximum (101) 42 0x81, 0x00, // Input (Data,Arr,Abs) 44 This bug shifts all programmed keycodes up by 1. Importantly, this causes "empty" array indexes of 0x00 to be interpreted as 0x01, ErrorRollOver. The presence of ErrorRollOver causes the system to ignore all keypresses from the endpoint and breaks the ability to use the programmable buttons. Setting byte 41 to 0x00 fixes this, and causes keycodes to be interpreted correctly. Also, USB_VENDOR_ID_GLORIOUS is changed to USB_VENDOR_ID_SINOWEALTH, and a new ID for Laview Technology is added. Glorious seems to be white-labeling controller boards or mice from these vendors. There isn't a single canonical vendor ID for Glorious products. Signed-off-by: Brett Raye Signed-off-by: Jiri Kosina commit fc43e9c857b7aa55efba9398419b14d9e35dcc7d Author: Charles Yi Date: Tue Oct 31 12:32:39 2023 +0800 HID: fix HID device resource race between HID core and debugging support hid_debug_events_release releases resources bound to the HID device instance. hid_device_release releases the underlying HID device instance potentially before hid_debug_events_release has completed releasing debug resources bound to the same HID device instance. Reference count to prevent the HID device instance from being torn down preemptively when HID debugging support is used. When count reaches zero, release core resources of HID device instance using hiddev_free. The crash: [ 120.728477][ T4396] kernel BUG at lib/list_debug.c:53! [ 120.728505][ T4396] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 120.739806][ T4396] Modules linked in: bcmdhd dhd_static_buf 8822cu pcie_mhi r8168 [ 120.747386][ T4396] CPU: 1 PID: 4396 Comm: hidt_bridge Not tainted 5.10.110 #257 [ 120.754771][ T4396] Hardware name: Rockchip RK3588 EVB4 LP4 V10 Board (DT) [ 120.761643][ T4396] pstate: 60400089 (nZCv daIf +PAN -UAO -TCO BTYPE=--) [ 120.768338][ T4396] pc : __list_del_entry_valid+0x98/0xac [ 120.773730][ T4396] lr : __list_del_entry_valid+0x98/0xac [ 120.779120][ T4396] sp : ffffffc01e62bb60 [ 120.783126][ T4396] x29: ffffffc01e62bb60 x28: ffffff818ce3a200 [ 120.789126][ T4396] x27: 0000000000000009 x26: 0000000000980000 [ 120.795126][ T4396] x25: ffffffc012431000 x24: ffffff802c6d4e00 [ 120.801125][ T4396] x23: ffffff8005c66f00 x22: ffffffc01183b5b8 [ 120.807125][ T4396] x21: ffffff819df2f100 x20: 0000000000000000 [ 120.813124][ T4396] x19: ffffff802c3f0700 x18: ffffffc01d2cd058 [ 120.819124][ T4396] x17: 0000000000000000 x16: 0000000000000000 [ 120.825124][ T4396] x15: 0000000000000004 x14: 0000000000003fff [ 120.831123][ T4396] x13: ffffffc012085588 x12: 0000000000000003 [ 120.837123][ T4396] x11: 00000000ffffbfff x10: 0000000000000003 [ 120.843123][ T4396] x9 : 455103d46b329300 x8 : 455103d46b329300 [ 120.849124][ T4396] x7 : 74707572726f6320 x6 : ffffffc0124b8cb5 [ 120.855124][ T4396] x5 : ffffffffffffffff x4 : 0000000000000000 [ 120.861123][ T4396] x3 : ffffffc011cf4f90 x2 : ffffff81fee7b948 [ 120.867122][ T4396] x1 : ffffffc011cf4f90 x0 : 0000000000000054 [ 120.873122][ T4396] Call trace: [ 120.876259][ T4396] __list_del_entry_valid+0x98/0xac [ 120.881304][ T4396] hid_debug_events_release+0x48/0x12c [ 120.886617][ T4396] full_proxy_release+0x50/0xbc [ 120.891323][ T4396] __fput+0xdc/0x238 [ 120.895075][ T4396] ____fput+0x14/0x24 [ 120.898911][ T4396] task_work_run+0x90/0x148 [ 120.903268][ T4396] do_exit+0x1bc/0x8a4 [ 120.907193][ T4396] do_group_exit+0x8c/0xa4 [ 120.911458][ T4396] get_signal+0x468/0x744 [ 120.915643][ T4396] do_signal+0x84/0x280 [ 120.919650][ T4396] do_notify_resume+0xd0/0x218 [ 120.924262][ T4396] work_pending+0xc/0x3f0 [ Rahul Rameshbabu : rework changelog ] Fixes: cd667ce24796 ("HID: use debugfs for events/reports dumping") Signed-off-by: Charles Yi Signed-off-by: Jiri Kosina commit 113f736655e4f20633e107d731dd5bd097d5938c Author: Yihong Cao Date: Mon Oct 30 01:05:38 2023 +0800 HID: apple: add Jamesdonkey and A3R to non-apple keyboards list Jamesdonkey A3R keyboard is identified as "Jamesdonkey A3R" in wired mode, "A3R-U" in wireless mode and "A3R" in bluetooth mode. Adding them to non-apple keyboards fixes function key. Signed-off-by: Yihong Cao Signed-off-by: Jiri Kosina commit 73ce9f1f2741a38f5d27393e627702ae2c46e6f2 Author: Hamish Martin Date: Wed Oct 25 16:55:11 2023 +1300 HID: mcp2221: Allow IO to start during probe During the probe we add an I2C adapter and as soon as we add that adapter it may be used for a transfer (e.g via the code in i2cdetect()). Those transfers are not able to complete and time out. This is because the HID raw_event callback (mcp2221_raw_event) will not be invoked until the HID device's 'driver_input_lock' is marked up at the completion of the probe in hid_device_probe(). This starves the driver of the responses it is waiting for. In order to allow the I2C transfers to complete while we are still in the probe, start the IO once we have completed init of the HID device. This issue seems to have been seen before and a patch was submitted but it seems it was never accepted. See: https://lore.kernel.org/all/20221103222714.21566-3-Enrik.Berkhan@inka.de/ Signed-off-by: Hamish Martin Signed-off-by: Jiri Kosina commit f2d4a5834638bbc967371b9168c0b481519f7c5e Author: Hamish Martin Date: Wed Oct 25 16:55:10 2023 +1300 HID: mcp2221: Set driver data before I2C adapter add The process of adding an I2C adapter can invoke I2C accesses on that new adapter (see i2c_detect()). Ensure we have set the adapter's driver data to avoid null pointer dereferences in the xfer functions during the adapter add. This has been noted in the past and the same fix proposed but not completed. See: https://lore.kernel.org/lkml/ef597e73-ed71-168e-52af-0d19b03734ac@vigem.de/ Signed-off-by: Hamish Martin Signed-off-by: Jiri Kosina commit 3f7c0634926daf48cd2f6db6c1197a1047074088 Author: Jacek Lawrynowicz Date: Wed Nov 15 12:10:04 2023 +0100 accel/ivpu/37xx: Fix hangs related to MMIO reset There is no need to call MMIO reset using VPU_37XX_BUTTRESS_VPU_IP_RESET register. IP will be reset by FLR or by entering d0i3. Also IP reset during power_up is not needed as the VPU is already in reset. Removing MMIO reset improves stability as it a partial device reset that is not safe in some corner cases. This change also brings back ivpu_boot_pwr_domain_disable() that helps to properly power down VPU when it is hung by a buggy workload. Signed-off-by: Jacek Lawrynowicz Fixes: 828d63042aec ("accel/ivpu: Don't enter d0i3 during FLR") Reviewed-by: Jeffrey Hugo Link: https://patchwork.freedesktop.org/patch/msgid/20231115111004.1304092-1-jacek.lawrynowicz@linux.intel.com commit a6584711e64d9d12ab79a450ec3628fd35e4f476 Author: Andy Shevchenko Date: Mon Nov 20 17:07:56 2023 +0200 platform/x86: intel_telemetry: Fix kernel doc descriptions LKP found issues with a kernel doc in the driver: core.c:116: warning: Function parameter or member 'ioss_evtconfig' not described in 'telemetry_update_events' core.c:188: warning: Function parameter or member 'ioss_evtconfig' not described in 'telemetry_get_eventconfig' It looks like it were copy'n'paste typos when these descriptions had been introduced. Fix the typos. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310070743.WALmRGSY-lkp@intel.com/ Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231120150756.1661425-1-andriy.shevchenko@linux.intel.com Reviewed-by: Rajneesh Bhardwaj Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 8d9ce3e53bbd2d6241213e9a4deb310499c929ff Author: Hans de Goede Date: Mon Nov 20 16:45:45 2023 +0100 MAINTAINERS: Drop Mark Gross as maintainer for x86 platform drivers Mark has not really been active as maintainer for x86 platform drivers lately, drop Mark from the MAINTAINERS entries for drivers/platform/x86, drivers/platform/mellanox and drivers/platform/surface. Cc: Mark Gross Signed-off-by: Hans de Goede Acked-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231120154548.611041-1-hdegoede@redhat.com Signed-off-by: Ilpo Järvinen commit 849d3f985e73196a24273f810a134b3ebed1efad Merge: 1a229d8690a0f 480713b1ba8ea Author: Greg Kroah-Hartman Date: Tue Nov 21 08:13:55 2023 +0100 Merge tag 'thunderbolt-for-v6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-linus Mika writes: thunderbolt: Fixes for v6.7-rc3 This includes following USB4/Thunderbolt fixes for v6.7-rc3: - Fix a lane bonding issue on ASMedia USB4 device - Send uevents when link is switched to asymmetric or symmetric - Only add device router DP IN adapters to the head of resource list to avoid issues during system resume. All these have been in linux-next with no reported issues. * tag 'thunderbolt-for-v6.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: (1451 commits) thunderbolt: Only add device router DP IN to the head of the DP resource list thunderbolt: Send uevent after asymmetric/symmetric switch thunderbolt: Set lane bonding bit only for downstream port commit c517fd2738f472eb0d1db60a70d91629349a9bf8 Author: Yanteng Si Date: Tue Nov 21 15:03:26 2023 +0800 Docs/zh_CN/LoongArch: Update links in LoongArch introduction.rst LoongArch-Vol1 has been updated to v1.10, the links in the documentation are out of date, let's update it. Signed-off-by: Yanteng Si Signed-off-by: Huacai Chen commit 10301780c96e70b694eca86a3ccfa1893a4a6d3e Author: Yanteng Si Date: Tue Nov 21 15:03:25 2023 +0800 Docs/LoongArch: Update links in LoongArch introduction.rst LoongArch-Vol1 has been updated to v1.10, the links in the documentation are out of date, let's update it. Signed-off-by: Yanteng Si Signed-off-by: Huacai Chen commit d43f37b73468c172bc89ac4824a1511b411f0778 Author: Bibo Mao Date: Tue Nov 21 15:03:25 2023 +0800 LoongArch: Implement constant timer shutdown interface When a cpu is hot-unplugged, it is put in idle state and the function arch_cpu_idle_dead() is called. The timer interrupt for this processor should be disabled, otherwise there will be pending timer interrupt for the unplugged cpu, so that vcpu is prevented from giving up scheduling when system is running in vm mode. This patch implements the timer shutdown interface so that the constant timer will be properly disabled when a CPU is hot-unplugged. Reviewed-by: WANG Xuerui Signed-off-by: Bibo Mao Signed-off-by: Huacai Chen commit 19d86a496233731882aea7ec24505ce6641b1c0c Author: Huacai Chen Date: Tue Nov 21 15:03:25 2023 +0800 LoongArch: Mark {dmw,tlb}_virt_to_page() exports as non-GPL Mark {dmw,tlb}_virt_to_page() exports as non-GPL, in order to let out-of-tree modules (e.g. OpenZFS) be built without errors. Otherwise we get: ERROR: modpost: GPL-incompatible module zfs.ko uses GPL-only symbol 'dmw_virt_to_page' ERROR: modpost: GPL-incompatible module zfs.ko uses GPL-only symbol 'tlb_virt_to_page' Reported-by: Haowu Ge Signed-off-by: Huacai Chen commit 902d75cdf0cf0a3fb58550089ee519abf12566f5 Author: Huacai Chen Date: Tue Nov 21 15:03:25 2023 +0800 LoongArch: Silence the boot warning about 'nokaslr' The kernel parameter 'nokaslr' is handled before start_kernel(), so we don't need early_param() to mark it technically. But it can cause a boot warning as follows: Unknown kernel command line parameters "nokaslr", will be passed to user space. When we use 'init=/bin/bash', 'nokaslr' which passed to user space will even cause a kernel panic. So we use early_param() to mark 'nokaslr', simply print a notice and silence the boot warning (also fix a potential panic). This logic is similar to RISC-V. Signed-off-by: Huacai Chen commit ee2daf7102f42007b7bf5dbd1ae76478ee62c512 Author: Huacai Chen Date: Tue Nov 21 15:03:25 2023 +0800 LoongArch: Add __percpu annotation for __percpu_read()/__percpu_write() When build kernel with C=1, we get: arch/loongarch/kernel/process.c:234:46: warning: incorrect type in argument 1 (different address spaces) arch/loongarch/kernel/process.c:234:46: expected void *ptr arch/loongarch/kernel/process.c:234:46: got unsigned long [noderef] __percpu * arch/loongarch/kernel/process.c:234:46: warning: incorrect type in argument 1 (different address spaces) arch/loongarch/kernel/process.c:234:46: expected void *ptr arch/loongarch/kernel/process.c:234:46: got unsigned long [noderef] __percpu * arch/loongarch/kernel/process.c:234:46: warning: incorrect type in argument 1 (different address spaces) arch/loongarch/kernel/process.c:234:46: expected void *ptr arch/loongarch/kernel/process.c:234:46: got unsigned long [noderef] __percpu * arch/loongarch/kernel/process.c:234:46: warning: incorrect type in argument 1 (different address spaces) arch/loongarch/kernel/process.c:234:46: expected void *ptr arch/loongarch/kernel/process.c:234:46: got unsigned long [noderef] __percpu * Add __percpu annotation for __percpu_read()/__percpu_write() can avoid such warnings. __percpu_xchg() and other functions don't need annotation because their wrapper, i.e. _pcp_protect(), already suppresses warnings. Also adjust the indentations in this file. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311080409.LlOfTR3m-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202311080840.Vc2kXhfp-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202311081340.3k72KKdg-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202311120926.cjYHyoYw-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202311152142.g6UyNx1R-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202311160339.DbhaH8LX-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202311181454.CTPrSYmQ-lkp@intel.com/ Signed-off-by: Huacai Chen commit aa0cbc1b506b090c3a775b547c693ada108cc0d7 Author: WANG Rui Date: Tue Nov 21 15:03:25 2023 +0800 LoongArch: Record pc instead of offset in la_abs relocation To clarify, the previous version functioned flawlessly. However, it's worth noting that the LLVM's LoongArch backend currently lacks support for cross-section label calculations. With this patch, we enable the use of clang to compile relocatable kernels. Tested-by: Nathan Chancellor Signed-off-by: WANG Rui Signed-off-by: Huacai Chen commit cbfd44bd5c6eec0aada0c39130f0b8d7ecba0529 Author: WANG Rui Date: Tue Nov 21 15:03:25 2023 +0800 LoongArch: Explicitly set -fdirect-access-external-data for vmlinux After this llvm commit [1], The -fno-pic does not imply direct access external data. Explicitly set -fdirect-access-external-data for vmlinux that can avoids GOT entries. Link: https://github.com/llvm/llvm-project/commit/47eeee297775347cbdb7624d6a766c2a3eec4a59 Suggested-by: Xi Ruoyao Signed-off-by: WANG Rui Signed-off-by: Huacai Chen commit d3ec75bc635cb0cb8185b63293d33a3d1b942d22 Author: Masahiro Yamada Date: Tue Nov 21 15:03:25 2023 +0800 LoongArch: Add dependency between vmlinuz.efi and vmlinux.efi A common issue in Makefile is a race in parallel building. You need to be careful to prevent multiple threads from writing to the same file simultaneously. Commit 3939f3345050 ("ARM: 8418/1: add boot image dependencies to not generate invalid images") addressed such a bad scenario. A similar symptom occurs with the following command: $ make -j$(nproc) ARCH=loongarch vmlinux.efi vmlinuz.efi [ snip ] SORTTAB vmlinux OBJCOPY arch/loongarch/boot/vmlinux.efi OBJCOPY arch/loongarch/boot/vmlinux.efi PAD arch/loongarch/boot/vmlinux.bin GZIP arch/loongarch/boot/vmlinuz OBJCOPY arch/loongarch/boot/vmlinuz.o LD arch/loongarch/boot/vmlinuz.efi.elf OBJCOPY arch/loongarch/boot/vmlinuz.efi The log "OBJCOPY arch/loongarch/boot/vmlinux.efi" is displayed twice. It indicates that two threads simultaneously enter arch/loongarch/boot/ and write to arch/loongarch/boot/vmlinux.efi. It occasionally leads to a build failure: $ make -j$(nproc) ARCH=loongarch vmlinux.efi vmlinuz.efi [ snip ] SORTTAB vmlinux OBJCOPY arch/loongarch/boot/vmlinux.efi PAD arch/loongarch/boot/vmlinux.bin truncate: Invalid number: ‘arch/loongarch/boot/vmlinux.bin’ make[2]: *** [drivers/firmware/efi/libstub/Makefile.zboot:13: arch/loongarch/boot/vmlinux.bin] Error 1 make[2]: *** Deleting file 'arch/loongarch/boot/vmlinux.bin' make[1]: *** [arch/loongarch/Makefile:146: vmlinuz.efi] Error 2 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:234: __sub-make] Error 2 vmlinuz.efi depends on vmlinux.efi, but such a dependency is not specified in arch/loongarch/Makefile. Signed-off-by: Masahiro Yamada Signed-off-by: Huacai Chen commit acb12c859ac7c36d6d7632280fd1e263188cb07f Merge: fcb905d831336 57e2a52deeb12 Author: Alexei Starovoitov Date: Mon Nov 20 18:33:36 2023 -0800 Merge branch 'verify-callbacks-as-if-they-are-called-unknown-number-of-times' Eduard Zingerman says: ==================== verify callbacks as if they are called unknown number of times This series updates verifier logic for callback functions handling. Current master simulates callback body execution exactly once, which leads to verifier not detecting unsafe programs like below: static int unsafe_on_zero_iter_cb(__u32 idx, struct num_context *ctx) { ctx->i = 0; return 0; } SEC("?raw_tp") int unsafe_on_zero_iter(void *unused) { struct num_context loop_ctx = { .i = 32 }; __u8 choice_arr[2] = { 0, 1 }; bpf_loop(100, unsafe_on_zero_iter_cb, &loop_ctx, 0); return choice_arr[loop_ctx.i]; } This was reported previously in [0]. The basic idea of the fix is to schedule callback entry state for verification in env->head until some identical, previously visited state in current DFS state traversal is found. Same logic as with open coded iterators, and builds on top recent fixes [1] for those. The series is structured as follows: - patches #1,2,3 update strobemeta, xdp_synproxy selftests and bpf_loop_bench benchmark to allow convergence of the bpf_loop callback states; - patches #4,5 just shuffle the code a bit; - patch #6 is the main part of the series; - patch #7 adds test cases for #6; - patch #8 extend patch #6 with same speculative scalar widening logic, as used for open coded iterators; - patch #9 adds test cases for #8; - patch #10 extends patch #6 to track maximal number of callback executions specifically for bpf_loop(); - patch #11 adds test cases for #10. Veristat results comparing this series to master+patches #1,2,3 using selftests show the following difference: File Program States (A) States (B) States (DIFF) ------------------------- ------------- ---------- ---------- ------------- bpf_loop_bench.bpf.o benchmark 1 2 +1 (+100.00%) pyperf600_bpf_loop.bpf.o on_event 322 407 +85 (+26.40%) strobemeta_bpf_loop.bpf.o on_event 113 151 +38 (+33.63%) xdp_synproxy_kern.bpf.o syncookie_tc 341 291 -50 (-14.66%) xdp_synproxy_kern.bpf.o syncookie_xdp 344 301 -43 (-12.50%) Veristat results comparing this series to master using Tetragon BPF files [2] also show some differences. States diff varies from +2% to +15% on 23 programs out of 186, no new failures. Changelog: - V3 [5] -> V4, changes suggested by Andrii: - validate mark_chain_precision() result in patch #10; - renaming s/cumulative_callback_depth/callback_unroll_depth/. - V2 [4] -> V3: - fixes in expected log messages for test cases: - callback_result_precise; - parent_callee_saved_reg_precise_with_callback; - parent_stack_slot_precise_with_callback; - renamings (suggested by Alexei): - s/callback_iter_depth/cumulative_callback_depth/ - s/is_callback_iter_next/calls_callback/ - s/mark_callback_iter_next/mark_calls_callback/ - prepare_func_exit() updated to exit with -EFAULT when callee->in_callback_fn is true but calls_callback() is not true for callsite; - test case 'bpf_loop_iter_limit_nested' rewritten to use return value check instead of verifier log message checks (suggested by Alexei). - V1 [3] -> V2, changes suggested by Andrii: - small changes for error handling code in __check_func_call(); - callback body processing log is now matched in relevant verifier_subprog_precision.c tests; - R1 passed to bpf_loop() is now always marked as precise; - log level 2 message for bpf_loop() iteration termination instead of iteration depth messages; - __no_msg macro removed; - bpf_loop_iter_limit_nested updated to avoid using __no_msg; - commit message for patch #3 updated according to Alexei's request. [0] https://lore.kernel.org/bpf/CA+vRuzPChFNXmouzGG+wsy=6eMcfr1mFG0F3g7rbg-sedGKW3w@mail.gmail.com/ [1] https://lore.kernel.org/bpf/20231024000917.12153-1-eddyz87@gmail.com/ [2] git@github.com:cilium/tetragon.git [3] https://lore.kernel.org/bpf/20231116021803.9982-1-eddyz87@gmail.com/T/#t [4] https://lore.kernel.org/bpf/20231118013355.7943-1-eddyz87@gmail.com/T/#t [5] https://lore.kernel.org/bpf/20231120225945.11741-1-eddyz87@gmail.com/T/#t ==================== Link: https://lore.kernel.org/r/20231121020701.26440-1-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 57e2a52deeb12ab84c15c6d0fb93638b5b94001b Author: Eduard Zingerman Date: Tue Nov 21 04:07:01 2023 +0200 selftests/bpf: check if max number of bpf_loop iterations is tracked Check that even if bpf_loop() callback simulation does not converge to a specific state, verification could proceed via "brute force" simulation of maximal number of callback calls. Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231121020701.26440-12-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit bb124da69c47dd98d69361ec13244ece50bec63e Author: Eduard Zingerman Date: Tue Nov 21 04:07:00 2023 +0200 bpf: keep track of max number of bpf_loop callback iterations In some cases verifier can't infer convergence of the bpf_loop() iteration. E.g. for the following program: static int cb(__u32 idx, struct num_context* ctx) { ctx->i++; return 0; } SEC("?raw_tp") int prog(void *_) { struct num_context ctx = { .i = 0 }; __u8 choice_arr[2] = { 0, 1 }; bpf_loop(2, cb, &ctx, 0); return choice_arr[ctx.i]; } Each 'cb' simulation would eventually return to 'prog' and reach 'return choice_arr[ctx.i]' statement. At which point ctx.i would be marked precise, thus forcing verifier to track multitude of separate states with {.i=0}, {.i=1}, ... at bpf_loop() callback entry. This commit allows "brute force" handling for such cases by limiting number of callback body simulations using 'umax' value of the first bpf_loop() parameter. For this, extend bpf_func_state with 'callback_depth' field. Increment this field when callback visiting state is pushed to states traversal stack. For frame #N it's 'callback_depth' field counts how many times callback with frame depth N+1 had been executed. Use bpf_func_state specifically to allow independent tracking of callback depths when multiple nested bpf_loop() calls are present. Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231121020701.26440-11-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 9f3330aa644d6d979eb064c46e85c62d4b4eac75 Author: Eduard Zingerman Date: Tue Nov 21 04:06:59 2023 +0200 selftests/bpf: test widening for iterating callbacks A test case to verify that imprecise scalars widening is applied to callback entering state, when callback call is simulated repeatedly. Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231121020701.26440-10-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit cafe2c21508a38cdb3ed22708842e957b2572c3e Author: Eduard Zingerman Date: Tue Nov 21 04:06:58 2023 +0200 bpf: widening for callback iterators Callbacks are similar to open coded iterators, so add imprecise widening logic for callback body processing. This makes callback based loops behave identically to open coded iterators, e.g. allowing to verify programs like below: struct ctx { u32 i; }; int cb(u32 idx, struct ctx* ctx) { ++ctx->i; return 0; } ... struct ctx ctx = { .i = 0 }; bpf_loop(100, cb, &ctx, 0); ... Acked-by: Andrii Nakryiko Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231121020701.26440-9-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 958465e217dbf5fc6677d42d8827fb3073d86afd Author: Eduard Zingerman Date: Tue Nov 21 04:06:57 2023 +0200 selftests/bpf: tests for iterating callbacks A set of test cases to check behavior of callback handling logic, check if verifier catches the following situations: - program not safe on second callback iteration; - program not safe on zero callback iterations; - infinite loop inside a callback. Verify that callback logic works for bpf_loop, bpf_for_each_map_elem, bpf_user_ringbuf_drain, bpf_find_vma. Acked-by: Andrii Nakryiko Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231121020701.26440-8-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit ab5cfac139ab8576fb54630d4cca23c3e690ee90 Author: Eduard Zingerman Date: Tue Nov 21 04:06:56 2023 +0200 bpf: verify callbacks as if they are called unknown number of times Prior to this patch callbacks were handled as regular function calls, execution of callback body was modeled exactly once. This patch updates callbacks handling logic as follows: - introduces a function push_callback_call() that schedules callback body verification in env->head stack; - updates prepare_func_exit() to reschedule callback body verification upon BPF_EXIT; - as calls to bpf_*_iter_next(), calls to callback invoking functions are marked as checkpoints; - is_state_visited() is updated to stop callback based iteration when some identical parent state is found. Paths with callback function invoked zero times are now verified first, which leads to necessity to modify some selftests: - the following negative tests required adding release/unlock/drop calls to avoid previously masked unrelated error reports: - cb_refs.c:underflow_prog - exceptions_fail.c:reject_rbtree_add_throw - exceptions_fail.c:reject_with_cp_reference - the following precision tracking selftests needed change in expected log trace: - verifier_subprog_precision.c:callback_result_precise (note: r0 precision is no longer propagated inside callback and I think this is a correct behavior) - verifier_subprog_precision.c:parent_callee_saved_reg_precise_with_callback - verifier_subprog_precision.c:parent_stack_slot_precise_with_callback Reported-by: Andrew Werner Closes: https://lore.kernel.org/bpf/CA+vRuzPChFNXmouzGG+wsy=6eMcfr1mFG0F3g7rbg-sedGKW3w@mail.gmail.com/ Acked-by: Andrii Nakryiko Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231121020701.26440-7-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 58124a98cb8eda69d248d7f1de954c8b2767c945 Author: Eduard Zingerman Date: Tue Nov 21 04:06:55 2023 +0200 bpf: extract setup_func_entry() utility function Move code for simulated stack frame creation to a separate utility function. This function would be used in the follow-up change for callbacks handling. Acked-by: Andrii Nakryiko Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231121020701.26440-6-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 683b96f9606ab7308ffb23c46ab43cecdef8a241 Author: Eduard Zingerman Date: Tue Nov 21 04:06:54 2023 +0200 bpf: extract __check_reg_arg() utility function Split check_reg_arg() into two utility functions: - check_reg_arg() operating on registers from current verifier state; - __check_reg_arg() operating on a specific set of registers passed as a parameter; The __check_reg_arg() function would be used by a follow-up change for callbacks handling. Acked-by: Andrii Nakryiko Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231121020701.26440-5-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit f40bfd1679446b22d321e64a1fa98b7d07d2be08 Author: Eduard Zingerman Date: Tue Nov 21 04:06:53 2023 +0200 selftests/bpf: fix bpf_loop_bench for new callback verification scheme This is a preparatory change. A follow-up patch "bpf: verify callbacks as if they are called unknown number of times" changes logic for callbacks handling. While previously callbacks were verified as a single function call, new scheme takes into account that callbacks could be executed unknown number of times. This has dire implications for bpf_loop_bench: SEC("fentry/" SYS_PREFIX "sys_getpgid") int benchmark(void *ctx) { for (int i = 0; i < 1000; i++) { bpf_loop(nr_loops, empty_callback, NULL, 0); __sync_add_and_fetch(&hits, nr_loops); } return 0; } W/o callbacks change verifier sees it as a 1000 calls to empty_callback(). However, with callbacks change things become exponential: - i=0: state exploring empty_callback is scheduled with i=0 (a); - i=1: state exploring empty_callback is scheduled with i=1; ... - i=999: state exploring empty_callback is scheduled with i=999; - state (a) is popped from stack; - i=1: state exploring empty_callback is scheduled with i=1; ... Avoid this issue by rewriting outer loop as bpf_loop(). Unfortunately, this adds a function call to a loop at runtime, which negatively affects performance: throughput latency before: 149.919 ± 0.168 M ops/s, 6.670 ns/op after : 137.040 ± 0.187 M ops/s, 7.297 ns/op Acked-by: Andrii Nakryiko Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231121020701.26440-4-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 87eb0152bcc102ecbda866978f4e54db5a3be1ef Author: Eduard Zingerman Date: Tue Nov 21 04:06:52 2023 +0200 selftests/bpf: track string payload offset as scalar in strobemeta This change prepares strobemeta for update in callbacks verification logic. To allow bpf_loop() verification converge when multiple callback iterations are considered: - track offset inside strobemeta_payload->payload directly as scalar value; - at each iteration make sure that remaining strobemeta_payload->payload capacity is sufficient for execution of read_{map,str}_var functions; - make sure that offset is tracked as unbound scalar between iterations, otherwise verifier won't be able infer that bpf_loop callback reaches identical states. Acked-by: Andrii Nakryiko Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231121020701.26440-3-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 977bc146d4eb7070118d8a974919b33bb52732b4 Author: Eduard Zingerman Date: Tue Nov 21 04:06:51 2023 +0200 selftests/bpf: track tcp payload offset as scalar in xdp_synproxy This change prepares syncookie_{tc,xdp} for update in callbakcs verification logic. To allow bpf_loop() verification converge when multiple callback itreations are considered: - track offset inside TCP payload explicitly, not as a part of the pointer; - make sure that offset does not exceed MAX_PACKET_OFF enforced by verifier; - make sure that offset is tracked as unbound scalar between iterations, otherwise verifier won't be able infer that bpf_loop callback reaches identical states. Acked-by: Andrii Nakryiko Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231121020701.26440-2-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 98594181944daa201481ad63242806beb7c89ff4 Author: Robin Murphy Date: Thu Nov 16 16:52:15 2023 +0000 iommufd/selftest: Fix _test_mock_dirty_bitmaps() The ASSERT_EQ() macro sneakily expands to two statements, so the loop here needs braces to ensure it captures both and actually terminates the test upon failure. Where these tests are currently failing on my arm64 machine, this reduces the number of logged lines from a rather unreasonable ~197,000 down to 10. While we're at it, we can also clean up the tautologous "count" calculations whose assertions can never fail unless mathematics and/or the C language become fundamentally broken. Fixes: a9af47e382a4 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP") Link: https://lore.kernel.org/r/90e083045243ef407dd592bb1deec89cd1f4ddf2.1700153535.git.robin.murphy@arm.com Signed-off-by: Robin Murphy Reviewed-by: Kevin Tian Reviewed-by: Joao Martins Tested-by: Joao Martins Signed-off-by: Jason Gunthorpe commit 71cade82f2b553a74d046c015c986f2df165696f Author: Steven Rostedt (Google) Date: Mon Nov 20 18:51:07 2023 -0500 eventfs: Do not invalidate dentry in create_file/dir_dentry() With the call to simple_recursive_removal() on the entire eventfs sub system when the directory is removed, it performs the d_invalidate on all the dentries when it is removed. There's no need to do clean ups when a dentry is being created while the directory is being deleted. As dentries are cleaned up by the simpler_recursive_removal(), trying to do d_invalidate() in these functions will cause the dentry to be invalidated twice, and crash the kernel. Link: https://lore.kernel.org/all/20231116123016.140576-1-naresh.kamboju@linaro.org/ Link: https://lkml.kernel.org/r/20231120235154.422970988@goodmis.org Cc: Masami Hiramatsu Cc: Andrew Morton Fixes: 407c6726ca71 ("eventfs: Use simple_recursive_removal() to clean up dentries") Reported-by: Mark Rutland Reported-by: Naresh Kamboju Reported-by: Linux Kernel Functional Testing Signed-off-by: Steven Rostedt (Google) commit 88903daecacf03b1e5636e1b5f18bda5b07030fc Author: Steven Rostedt (Google) Date: Mon Nov 20 18:51:06 2023 -0500 eventfs: Remove expectation that ei->is_freed means ei->dentry == NULL The logic to free the eventfs_inode (ei) use to set is_freed and clear the "dentry" field under the eventfs_mutex. But that changed when a race was found where the ei->dentry needed to be cleared when the last dput() was called on it. But there was still logic that checked if ei->dentry was not NULL and is_freed is set, and would warn if it was. But since that situation was changed and the ei->dentry isn't cleared until the last dput() is called on it while the ei->is_freed is set, do not test for that condition anymore, and change the comments to reflect that. Link: https://lkml.kernel.org/r/20231120235154.265826243@goodmis.org Cc: Masami Hiramatsu Cc: Andrew Morton Fixes: 020010fbfa20 ("eventfs: Delete eventfs_inode when the last dentry is freed") Reported-by: Mark Rutland Signed-off-by: Steven Rostedt (Google) commit d6fef34ee4d102be448146f24caf96d7b4a05401 Author: Keith Busch Date: Mon Nov 20 14:18:31 2023 -0800 io_uring: fix off-by one bvec index If the offset equals the bv_len of the first registered bvec, then the request does not include any of that first bvec. Skip it so that drivers don't have to deal with a zero length bvec, which was observed to break NVMe's PRP list creation. Cc: stable@vger.kernel.org Fixes: bd11b3a391e3 ("io_uring: don't use iov_iter_advance() for fixed buffers") Signed-off-by: Keith Busch Link: https://lore.kernel.org/r/20231120221831.2646460-1-kbusch@meta.com Signed-off-by: Jens Axboe commit 8e4ece6889a5b1836b6a135827ac831a5350602a Author: Kunkun Jiang Date: Mon Nov 20 21:12:10 2023 +0800 KVM: arm64: GICv4: Do not perform a map to a mapped vLPI Before performing a map, let's check whether the vLPI has been mapped. Fixes: 196b136498b3 ("KVM: arm/arm64: GICv4: Wire mapping/unmapping of VLPIs in VFIO irq bypass") Signed-off-by: Kunkun Jiang Acked-by: Marc Zyngier Reviewed-by: Zenghui Yu Link: https://lore.kernel.org/r/20231120131210.2039-1-jiangkunkun@huawei.com Signed-off-by: Oliver Upton commit db46cd1e0426f52999d50fa72cfa97fa39952885 Author: Jan Höppner Date: Wed Oct 25 15:24:37 2023 +0200 s390/dasd: protect device queue against concurrent access In dasd_profile_start() the amount of requests on the device queue are counted. The access to the device queue is unprotected against concurrent access. With a lot of parallel I/O, especially with alias devices enabled, the device queue can change while dasd_profile_start() is accessing the queue. In the worst case this leads to a kernel panic due to incorrect pointer accesses. Fix this by taking the device lock before accessing the queue and counting the requests. Additionally the check for a valid profile data pointer can be done earlier to avoid unnecessary locking in a hot path. Cc: Fixes: 4fa52aa7a82f ("[S390] dasd: add enhanced DASD statistics interface") Reviewed-by: Stefan Haberland Signed-off-by: Jan Höppner Signed-off-by: Stefan Haberland Link: https://lore.kernel.org/r/20231025132437.1223363-3-sth@linux.ibm.com Signed-off-by: Jens Axboe commit 5029c5e4f20d8d6b41cefbde4b3eeadaec4662c6 Author: Muhammad Muzammil Date: Wed Oct 25 15:24:36 2023 +0200 s390/dasd: resolve spelling mistake resolve typing mistake from pimary to primary Signed-off-by: Muhammad Muzammil Link: https://lore.kernel.org/r/20231010043140.28416-1-m.muzzammilashraf@gmail.com Signed-off-by: Stefan Haberland Link: https://lore.kernel.org/r/20231025132437.1223363-2-sth@linux.ibm.com Signed-off-by: Jens Axboe commit fcb905d831336ee0a67dd953837a904173cf7390 Merge: 76df934c6d5f5 adfeae2d243d9 Author: Martin KaFai Lau Date: Mon Nov 20 10:15:17 2023 -0800 Merge branch 'bpf_redirect_peer fixes' Daniel Borkmann says: ==================== This fixes bpf_redirect_peer stats accounting for veth and netkit, and adds tstats in the first place for the latter. Utilise indirect call wrapper for bpf_redirect_peer, and improve test coverage of the latter also for netkit devices. Details in the patches, thanks! The series was targeted at bpf originally, and is done here as well, so it can trigger BPF CI. Jakub, if you think directly going via net is better since the majority of the diff touches net anyway, that is fine, too. Thanks! v2 -> v3: - Add kdoc for pcpu_stat_type (Simon) - Reject invalid type value in netdev_do_alloc_pcpu_stats (Simon) - Add Reviewed-by tags from list v1 -> v2: - Move stats allocation/freeing into net core (Jakub) - As prepwork for the above, move vrf's dstats over into the core - Add a check into stats alloc to enforce tstats upon implementing ndo_get_peer_dev - Add Acked-by tags from list Daniel Borkmann (6): net, vrf: Move dstats structure to core net: Move {l,t,d}stats allocation to core and convert veth & vrf netkit: Add tstats per-CPU traffic counters bpf, netkit: Add indirect call wrapper for fetching peer dev selftests/bpf: De-veth-ize the tc_redirect test case selftests/bpf: Add netkit to tc_redirect selftest ==================== Signed-off-by: Martin KaFai Lau commit adfeae2d243d9e5b83d094af481d189156b11779 Author: Daniel Borkmann Date: Tue Nov 14 01:42:20 2023 +0100 selftests/bpf: Add netkit to tc_redirect selftest Extend the existing tc_redirect selftest to also cover netkit devices for exercising the bpf_redirect_peer() code paths, so that we have both veth as well as netkit covered, all tests still pass after this change. Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Reviewed-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20231114004220.6495-9-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit eee82da79f036bb49ff80d3088b9530e3c2e57eb Author: Daniel Borkmann Date: Tue Nov 14 01:42:19 2023 +0100 selftests/bpf: De-veth-ize the tc_redirect test case No functional changes to the test case, but just renaming various functions, variables, etc, to remove veth part of their name for making it more generic and reusable later on (e.g. for netkit). Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Reviewed-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20231114004220.6495-8-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit 2c225425704078282e152ba692649237f78b3d7a Author: Daniel Borkmann Date: Tue Nov 14 01:42:18 2023 +0100 bpf, netkit: Add indirect call wrapper for fetching peer dev ndo_get_peer_dev is used in tcx BPF fast path, therefore make use of indirect call wrapper and therefore optimize the bpf_redirect_peer() internal handling a bit. Add a small skb_get_peer_dev() wrapper which utilizes the INDIRECT_CALL_1() macro instead of open coding. Future work could potentially add a peer pointer directly into struct net_device in future and convert veth and netkit over to use it so that eventually ndo_get_peer_dev can be removed. Co-developed-by: Nikolay Aleksandrov Signed-off-by: Nikolay Aleksandrov Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20231114004220.6495-7-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit 024ee930cb3c9ae49e4266aee89cfde0ebb407e1 Author: Peilin Ye Date: Tue Nov 14 01:42:17 2023 +0100 bpf: Fix dev's rx stats for bpf_redirect_peer traffic Traffic redirected by bpf_redirect_peer() (used by recent CNIs like Cilium) is not accounted for in the RX stats of supported devices (that is, veth and netkit), confusing user space metrics collectors such as cAdvisor [0], as reported by Youlun. Fix it by calling dev_sw_netstats_rx_add() in skb_do_redirect(), to update RX traffic counters. Devices that support ndo_get_peer_dev _must_ use the @tstats per-CPU counters (instead of @lstats, or @dstats). To make this more fool-proof, error out when ndo_get_peer_dev is set but @tstats are not selected. [0] Specifically, the "container_network_receive_{byte,packet}s_total" counters are affected. Fixes: 9aa1206e8f48 ("bpf: Add redirect_peer helper") Reported-by: Youlun Zhang Signed-off-by: Peilin Ye Co-developed-by: Daniel Borkmann Signed-off-by: Daniel Borkmann Reviewed-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20231114004220.6495-6-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit 6f2684bf2b4460c84d0d34612a939f78b96b03fc Author: Peilin Ye Date: Tue Nov 14 01:42:16 2023 +0100 veth: Use tstats per-CPU traffic counters Currently veth devices use the lstats per-CPU traffic counters, which only cover TX traffic. veth_get_stats64() actually populates RX stats of a veth device from its peer's TX counters, based on the assumption that a veth device can _only_ receive packets from its peer, which is no longer true: For example, recent CNIs (like Cilium) can use the bpf_redirect_peer() BPF helper to redirect traffic from NIC's tc ingress to veth's tc ingress (in a different netns), skipping veth's peer device. Unfortunately, this kind of traffic isn't currently accounted for in veth's RX stats. In preparation for the fix, use tstats (instead of lstats) to maintain both RX and TX counters for each veth device. We'll use RX counters for bpf_redirect_peer() traffic, and keep using TX counters for the usual "peer-to-peer" traffic. In veth_get_stats64(), calculate RX stats by _adding_ RX count to peer's TX count, in order to cover both kinds of traffic. veth_stats_rx() might need a name change (perhaps to "veth_stats_xdp()") for less confusion, but let's leave it to another patch to keep the fix minimal. Signed-off-by: Peilin Ye Co-developed-by: Daniel Borkmann Signed-off-by: Daniel Borkmann Reviewed-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20231114004220.6495-5-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit ae1658272c6491a31ac968e39882fc569f312ac3 Author: Daniel Borkmann Date: Tue Nov 14 01:42:15 2023 +0100 netkit: Add tstats per-CPU traffic counters Add dev->tstats traffic accounting to netkit. The latter contains per-CPU RX and TX counters. The dev's TX counters are bumped upon pass/unspec as well as redirect verdicts, in other words, on everything except for drops. The dev's RX counters are bumped upon successful __netif_rx(), as well as from skb_do_redirect() (not part of this commit here). Using dev->lstats with having just a single packets/bytes counter and inferring one another's RX counters from the peer dev's lstats is not possible given skb_do_redirect() can also bump the device's stats. Signed-off-by: Daniel Borkmann Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20231114004220.6495-4-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit 34d21de99cea9cb17967874313e5b0262527833c Author: Daniel Borkmann Date: Tue Nov 14 01:42:14 2023 +0100 net: Move {l,t,d}stats allocation to core and convert veth & vrf Move {l,t,d}stats allocation to the core and let netdevs pick the stats type they need. That way the driver doesn't have to bother with error handling (allocation failure checking, making sure free happens in the right spot, etc) - all happening in the core. Co-developed-by: Jakub Kicinski Signed-off-by: Jakub Kicinski Signed-off-by: Daniel Borkmann Reviewed-by: Nikolay Aleksandrov Cc: David Ahern Link: https://lore.kernel.org/r/20231114004220.6495-3-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit 79e0c5be8c73a674c92bd4ba77b75f4f8c91d32e Author: Daniel Borkmann Date: Tue Nov 14 01:42:13 2023 +0100 net, vrf: Move dstats structure to core Just move struct pcpu_dstats out of the vrf into the core, and streamline the field names slightly, so they better align with the {t,l}stats ones. No functional change otherwise. A conversion of the u64s to u64_stats_t could be done at a separate point in future. This move is needed as we are moving the {t,l,d}stats allocation/freeing to the core. Signed-off-by: Daniel Borkmann Reviewed-by: Nikolay Aleksandrov Cc: Jakub Kicinski Cc: David Ahern Link: https://lore.kernel.org/r/20231114004220.6495-2-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit 53f2bca2609237f910531f2c1a7779b16ce7952d Author: Chengming Zhou Date: Mon Nov 20 03:25:21 2023 +0000 block/null_blk: Fix double blk_mq_start_request() warning When CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION is enabled, null_queue_rq() would return BLK_STS_RESOURCE or BLK_STS_DEV_RESOURCE for the request, which has been marked as MQ_RQ_IN_FLIGHT by blk_mq_start_request(). Then null_queue_rqs() put these requests in the rqlist, return back to the block layer core, which would try to queue them individually again, so the warning in blk_mq_start_request() triggered. Fix it by splitting the null_queue_rq() into two parts: the first is the preparation of request, the second is the handling of request. We put the blk_mq_start_request() after the preparation part, which may fail and return back to the block layer core. The throttling also belongs to the preparation part, so move it before blk_mq_start_request(). And change the return type of null_handle_cmd() to void, since it always return BLK_STS_OK now. Reported-by: Closes: https://lore.kernel.org/all/0000000000000e6aac06098aee0c@google.com/ Fixes: d78bfa1346ab ("block/null_blk: add queue_rqs() support") Suggested-by: Bart Van Assche Signed-off-by: Chengming Zhou Link: https://lore.kernel.org/r/20231120032521.1012037-1-chengming.zhou@linux.dev Signed-off-by: Jens Axboe commit 11b9d0b4999705105d1fb7f0e8ac969e0f41b1b8 Author: Hannes Reinecke Date: Fri Oct 20 07:06:06 2023 +0200 nvmet-tcp: always initialize tls_handshake_tmo_work The TLS handshake timeout work item should always be initialized to avoid a crash when cancelling the workqueue. Fixes: 675b453e0241 ("nvmet-tcp: enable TLS handshake upcall") Suggested-by: Maurizio Lombardi Signed-off-by: Hannes Reinecke Tested-by: Shin'ichiro Kawasaki Tested-by: Yi Zhang Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 1c22e0295a5eb571c27b53c7371f95699ef705ff Author: Christoph Hellwig Date: Fri Nov 17 08:13:36 2023 -0500 nvmet: nul-terminate the NQNs passed in the connect command The host and subsystem NQNs are passed in the connect command payload and interpreted as nul-terminated strings. Ensure they actually are nul-terminated before using them. Fixes: a07b4970f464 "nvmet: add a generic NVMe target") Reported-by: Alon Zahavi Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Signed-off-by: Keith Busch commit c7ca9757bda35ff9ce27ab42f2cb8b84d983e6ad Author: Hannes Reinecke Date: Thu Nov 16 13:14:35 2023 +0100 nvme: blank out authentication fabrics options if not configured If the config option NVME_HOST_AUTH is not selected we should not accept the corresponding fabrics options. This allows userspace to detect if NVMe authentication has been enabled for the kernel. Cc: Shin'ichiro Kawasaki Fixes: f50fff73d620 ("nvme: implement In-Band authentication") Signed-off-by: Hannes Reinecke Tested-by: Shin'ichiro Kawasaki Reviewed-by: Daniel Wagner Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit cd9aed606088d36a7ffff3e808db4e76b1854285 Author: Hannes Reinecke Date: Tue Nov 14 14:27:01 2023 +0100 nvme: catch errors from nvme_configure_metadata() nvme_configure_metadata() is issuing I/O, so we might incur an I/O error which will cause the connection to be reset. But in that case any further probing will race with reset and cause UAF errors. So return a status from nvme_configure_metadata() and abort probing if there was an I/O error. Signed-off-by: Hannes Reinecke Signed-off-by: Keith Busch commit 23441536b63677cb2ed9b1637d8ca70315e44bd0 Author: Hannes Reinecke Date: Tue Nov 14 14:18:21 2023 +0100 nvme-tcp: only evaluate 'tls' option if TLS is selected We only need to evaluate the 'tls' connect option if TLS is enabled; otherwise we might be getting a link error. Fixes: 706add13676d ("nvme: keyring: fix conditional compilation") Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202311140426.0eHrTXBr-lkp@intel.com/ Signed-off-by: Hannes Reinecke Signed-off-by: Keith Busch commit 38ce1570e2c46e7e9af983aa337edd7e43723aa2 Author: Mark O'Donovan Date: Wed Oct 11 08:45:12 2023 +0000 nvme-auth: set explanation code for failure2 msgs Some error cases were not setting an auth-failure-reason-code-explanation. This means an AUTH_Failure2 message will be sent with an explanation value of 0 which is a reserved value. Signed-off-by: Mark O'Donovan Reviewed-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 616add70bfdc0274a253e84fc78155c27aacde91 Author: Mark O'Donovan Date: Wed Oct 11 08:45:11 2023 +0000 nvme-auth: unlock mutex in one place only Signed-off-by: Mark O'Donovan Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Signed-off-by: Keith Busch commit c96b8175522a2c52e297ee0a49827a668f95e1e8 Author: Damien Le Moal Date: Mon Nov 20 16:06:11 2023 +0900 block: Remove blk_set_runtime_active() The function blk_set_runtime_active() is called only from blk_post_runtime_resume(), so there is no need for that function to be exported. Open-code this function directly in blk_post_runtime_resume() and remove it. Signed-off-by: Damien Le Moal Reviewed-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20231120070611.33951-1-dlemoal@kernel.org Signed-off-by: Jens Axboe commit c2da049f419417808466c529999170f5c3ef7d3d Author: Li Nan Date: Fri Nov 17 00:23:16 2023 +0800 nbd: fix null-ptr-dereference while accessing 'nbd->config' Memory reordering may occur in nbd_genl_connect(), causing config_refs to be set to 1 while nbd->config is still empty. Opening nbd at this time will cause null-ptr-dereference. T1 T2 nbd_open nbd_get_config_unlocked nbd_genl_connect nbd_alloc_and_init_config //memory reordered refcount_set(&nbd->config_refs, 1) // 2 nbd->config ->null point nbd->config = config // 1 Fix it by adding smp barrier to guarantee the execution sequence. Signed-off-by: Li Nan Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20231116162316.1740402-4-linan666@huaweicloud.com Signed-off-by: Jens Axboe commit 3123ac77923341774ca3ad1196ad20bb0732bf70 Author: Li Nan Date: Fri Nov 17 00:23:15 2023 +0800 nbd: factor out a helper to get nbd_config without holding 'config_lock' There are no functional changes, just to make code cleaner and prepare to fix null-ptr-dereference while accessing 'nbd->config'. Signed-off-by: Li Nan Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20231116162316.1740402-3-linan666@huaweicloud.com Signed-off-by: Jens Axboe commit 1b59860540a4018e8071dc18d4893ec389506b7d Author: Li Nan Date: Fri Nov 17 00:23:14 2023 +0800 nbd: fold nbd config initialization into nbd_alloc_config() There are no functional changes, make the code cleaner and prepare to fix null-ptr-dereference while accessing 'nbd->config'. Signed-off-by: Li Nan Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20231116162316.1740402-2-linan666@huaweicloud.com Signed-off-by: Jens Axboe commit b85e2dab33ce467e8dcf1cb6c0c587132ff17f56 Author: David Woodhouse Date: Wed Nov 15 11:47:51 2023 -0500 PM: tools: Fix sleepgraph syntax error The sleepgraph tool currently fails: File "/usr/bin/sleepgraph", line 4155 or re.match('psci: CPU(?P[0-9]*) killed.*', msg)): ^ SyntaxError: unmatched ')' Fixes: 34ea427e01ea ("PM: tools: sleepgraph: Recognize "CPU killed" messages") Signed-off-by: David Woodhouse Reviewed-by: Wolfram Sang Signed-off-by: Rafael J. Wysocki commit 8a554c6234731d63014391331127480755d6cac4 Merge: 3eba5e0b2422a 45b478951b2ba Author: Jens Axboe Date: Mon Nov 20 09:45:31 2023 -0700 Merge tag 'md-fixes-20231120' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-6.7 Pull MD fix from Song. * tag 'md-fixes-20231120' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: fix bi_status reporting in md_end_clone_io commit bd911485294a6f0596e4592ed442438015cffc8a Author: Hans de Goede Date: Wed Nov 15 19:02:22 2023 +0100 ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA Like various other ASUS ExpertBook-s, the ASUS ExpertBook B1402CVA has an ACPI DSDT table that describes IRQ 1 as ActiveLow while the kernel overrides it to EdgeHigh. This prevents the keyboard from working. To fix this issue, add this laptop to the skip_override_table so that the kernel does not override IRQ 1. Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218114 Cc: All applicable Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit c93695494606326d7fd72b46a2a657139ccb0dec Author: Hans de Goede Date: Sun Nov 12 21:36:27 2023 +0100 ACPI: video: Use acpi_device_fix_up_power_children() Commit 89c290ea7589 ("ACPI: video: Put ACPI video and its child devices into D0 on boot") introduced calling acpi_device_fix_up_power_extended() on the video card for which the ACPI video bus is the companion device. This unnecessarily touches the power-state of the GPU itself, while the issue it tries to address only requires calling _PS0 on the child devices. Touching the power-state of the GPU itself is causing suspend / resume issues on e.g. a Lenovo ThinkPad W530. Instead use acpi_device_fix_up_power_children(), which only touches the child devices, to fix this. Fixes: 89c290ea7589 ("ACPI: video: Put ACPI video and its child devices into D0 on boot") Reported-by: Owen T. Heisler Closes: https://lore.kernel.org/regressions/9f36fb06-64c4-4264-aaeb-4e1289e764c4@owenh.net/ Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/273 Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218124 Tested-by: Kai-Heng Feng Tested-by: Owen T. Heisler Signed-off-by: Hans de Goede Cc: 6.6+ # 6.6+ Signed-off-by: Rafael J. Wysocki commit 37ba91a82e3b9de35f64348c62b5ec7d74e3a41c Author: Hans de Goede Date: Sun Nov 12 21:36:26 2023 +0100 ACPI: PM: Add acpi_device_fix_up_power_children() function In some cases it is necessary to fix-up the power-state of an ACPI device's children without touching the ACPI device itself add a new acpi_device_fix_up_power_children() function for this. Signed-off-by: Hans de Goede Cc: 6.6+ # 6.6+ Signed-off-by: Rafael J. Wysocki commit 9bb69ba4c177dccaa1f5b5cbdf80b67813328348 Author: David Woodhouse Date: Fri Oct 27 19:36:51 2023 +0100 ACPI: processor_idle: use raw_safe_halt() in acpi_idle_play_dead() Xen HVM guests were observed taking triple-faults when attempting to online a previously offlined vCPU. Investigation showed that the fault was coming from a failing call to lockdep_assert_irqs_disabled(), in load_current_idt() which was too early in the CPU bringup to actually catch the exception and report the failure cleanly. This was a false positive, caused by acpi_idle_play_dead() setting the per-cpu hardirqs_enabled flag by calling safe_halt(). Switch it to use raw_safe_halt() instead, which doesn't do so. Signed-off-by: David Woodhouse Acked-by: Peter Zijlstra (Intel) Cc: 6.6+ # 6.6+ Signed-off-by: Rafael J. Wysocki commit 3eba5e0b2422aec3c9e79822029599961fdcab97 Author: Coly Li Date: Mon Nov 20 13:25:03 2023 +0800 bcache: avoid NULL checking to c->root in run_cache_set() In run_cache_set() after c->root returned from bch_btree_node_get(), it is checked by IS_ERR_OR_NULL(). Indeed it is unncessary to check NULL because bch_btree_node_get() will not return NULL pointer to caller. This patch replaces IS_ERR_OR_NULL() by IS_ERR() for the above reason. Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20231120052503.6122-11-colyli@suse.de Signed-off-by: Jens Axboe commit 31f5b956a197d4ec25c8a07cb3a2ab69d0c0b82f Author: Coly Li Date: Mon Nov 20 13:25:02 2023 +0800 bcache: add code comments for bch_btree_node_get() and __bch_btree_node_alloc() This patch adds code comments to bch_btree_node_get() and __bch_btree_node_alloc() that NULL pointer will not be returned and it is unnecessary to check NULL pointer by the callers of these routines. Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20231120052503.6122-10-colyli@suse.de Signed-off-by: Jens Axboe commit f72f4312d4388376fc8a1f6cf37cb21a0d41758b Author: Coly Li Date: Mon Nov 20 13:25:01 2023 +0800 bcache: replace a mistaken IS_ERR() by IS_ERR_OR_NULL() in btree_gc_coalesce() Commit 028ddcac477b ("bcache: Remove unnecessary NULL point check in node allocations") do the following change inside btree_gc_coalesce(), 31 @@ -1340,7 +1340,7 @@ static int btree_gc_coalesce( 32 memset(new_nodes, 0, sizeof(new_nodes)); 33 closure_init_stack(&cl); 34 35 - while (nodes < GC_MERGE_NODES && !IS_ERR_OR_NULL(r[nodes].b)) 36 + while (nodes < GC_MERGE_NODES && !IS_ERR(r[nodes].b)) 37 keys += r[nodes++].keys; 38 39 blocks = btree_default_blocks(b->c) * 2 / 3; At line 35 the original r[nodes].b is not always allocatored from __bch_btree_node_alloc(), and possibly initialized as NULL pointer by caller of btree_gc_coalesce(). Therefore the change at line 36 is not correct. This patch replaces the mistaken IS_ERR() by IS_ERR_OR_NULL() to avoid potential issue. Fixes: 028ddcac477b ("bcache: Remove unnecessary NULL point check in node allocations") Cc: # 6.5+ Cc: Zheng Wang Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20231120052503.6122-9-colyli@suse.de Signed-off-by: Jens Axboe commit 2faac25d7958c4761bb8cec54adb79f806783ad6 Author: Mingzhe Zou Date: Mon Nov 20 13:25:00 2023 +0800 bcache: fixup multi-threaded bch_sectors_dirty_init() wake-up race We get a kernel crash about "unable to handle kernel paging request": ```dmesg [368033.032005] BUG: unable to handle kernel paging request at ffffffffad9ae4b5 [368033.032007] PGD fc3a0d067 P4D fc3a0d067 PUD fc3a0e063 PMD 8000000fc38000e1 [368033.032012] Oops: 0003 [#1] SMP PTI [368033.032015] CPU: 23 PID: 55090 Comm: bch_dirtcnt[0] Kdump: loaded Tainted: G OE --------- - - 4.18.0-147.5.1.es8_24.x86_64 #1 [368033.032017] Hardware name: Tsinghua Tongfang THTF Chaoqiang Server/072T6D, BIOS 2.4.3 01/17/2017 [368033.032027] RIP: 0010:native_queued_spin_lock_slowpath+0x183/0x1d0 [368033.032029] Code: 8b 02 48 85 c0 74 f6 48 89 c1 eb d0 c1 e9 12 83 e0 03 83 e9 01 48 c1 e0 05 48 63 c9 48 05 c0 3d 02 00 48 03 04 cd 60 68 93 ad <48> 89 10 8b 42 08 85 c0 75 09 f3 90 8b 42 08 85 c0 74 f7 48 8b 02 [368033.032031] RSP: 0018:ffffbb48852abe00 EFLAGS: 00010082 [368033.032032] RAX: ffffffffad9ae4b5 RBX: 0000000000000246 RCX: 0000000000003bf3 [368033.032033] RDX: ffff97b0ff8e3dc0 RSI: 0000000000600000 RDI: ffffbb4884743c68 [368033.032034] RBP: 0000000000000001 R08: 0000000000000000 R09: 000007ffffffffff [368033.032035] R10: ffffbb486bb01000 R11: 0000000000000001 R12: ffffffffc068da70 [368033.032036] R13: 0000000000000003 R14: 0000000000000000 R15: 0000000000000000 [368033.032038] FS: 0000000000000000(0000) GS:ffff97b0ff8c0000(0000) knlGS:0000000000000000 [368033.032039] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [368033.032040] CR2: ffffffffad9ae4b5 CR3: 0000000fc3a0a002 CR4: 00000000003626e0 [368033.032042] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [368033.032043] bcache: bch_cached_dev_attach() Caching rbd479 as bcache462 on set 8cff3c36-4a76-4242-afaa-7630206bc70b [368033.032045] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [368033.032046] Call Trace: [368033.032054] _raw_spin_lock_irqsave+0x32/0x40 [368033.032061] __wake_up_common_lock+0x63/0xc0 [368033.032073] ? bch_ptr_invalid+0x10/0x10 [bcache] [368033.033502] bch_dirty_init_thread+0x14c/0x160 [bcache] [368033.033511] ? read_dirty_submit+0x60/0x60 [bcache] [368033.033516] kthread+0x112/0x130 [368033.033520] ? kthread_flush_work_fn+0x10/0x10 [368033.034505] ret_from_fork+0x35/0x40 ``` The crash occurred when call wake_up(&state->wait), and then we want to look at the value in the state. However, bch_sectors_dirty_init() is not found in the stack of any task. Since state is allocated on the stack, we guess that bch_sectors_dirty_init() has exited, causing bch_dirty_init_thread() to be unable to handle kernel paging request. In order to verify this idea, we added some printing information during wake_up(&state->wait). We find that "wake up" is printed twice, however we only expect the last thread to wake up once. ```dmesg [ 994.641004] alcache: bch_dirty_init_thread() wake up [ 994.641018] alcache: bch_dirty_init_thread() wake up [ 994.641523] alcache: bch_sectors_dirty_init() init exit ``` There is a race. If bch_sectors_dirty_init() exits after the first wake up, the second wake up will trigger this bug("unable to handle kernel paging request"). Proceed as follows: bch_sectors_dirty_init kthread_run ==============> bch_dirty_init_thread(bch_dirtcnt[0]) ... ... atomic_inc(&state.started) ... ... ... atomic_read(&state.enough) ... ... atomic_set(&state->enough, 1) kthread_run ======================================================> bch_dirty_init_thread(bch_dirtcnt[1]) ... atomic_dec_and_test(&state->started) ... atomic_inc(&state.started) ... ... ... wake_up(&state->wait) ... atomic_read(&state.enough) atomic_dec_and_test(&state->started) ... ... wait_event(state.wait, atomic_read(&state.started) == 0) ... return ... wake_up(&state->wait) We believe it is very common to wake up twice if there is no dirty, but crash is an extremely low probability event. It's hard for us to reproduce this issue. We attached and detached continuously for a week, with a total of more than one million attaches and only one crash. Putting atomic_inc(&state.started) before kthread_run() can avoid waking up twice. Fixes: b144e45fc576 ("bcache: make bch_sectors_dirty_init() to be multithreaded") Signed-off-by: Mingzhe Zou Cc: Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20231120052503.6122-8-colyli@suse.de Signed-off-by: Jens Axboe commit e34820f984512b433ee1fc291417e60c47d56727 Author: Mingzhe Zou Date: Mon Nov 20 13:24:59 2023 +0800 bcache: fixup lock c->root error We had a problem with io hung because it was waiting for c->root to release the lock. crash> cache_set.root -l cache_set.list ffffa03fde4c0050 root = 0xffff802ef454c800 crash> btree -o 0xffff802ef454c800 | grep rw_semaphore [ffff802ef454c858] struct rw_semaphore lock; crash> struct rw_semaphore ffff802ef454c858 struct rw_semaphore { count = { counter = -4294967297 }, wait_list = { next = 0xffff00006786fc28, prev = 0xffff00005d0efac8 }, wait_lock = { raw_lock = { { val = { counter = 0 }, { locked = 0 '\000', pending = 0 '\000' }, { locked_pending = 0, tail = 0 } } } }, osq = { tail = { counter = 0 } }, owner = 0xffffa03fdc586603 } The "counter = -4294967297" means that lock count is -1 and a write lock is being attempted. Then, we found that there is a btree with a counter of 1 in btree_cache_freeable. crash> cache_set -l cache_set.list ffffa03fde4c0050 -o|grep btree_cache [ffffa03fde4c1140] struct list_head btree_cache; [ffffa03fde4c1150] struct list_head btree_cache_freeable; [ffffa03fde4c1160] struct list_head btree_cache_freed; [ffffa03fde4c1170] unsigned int btree_cache_used; [ffffa03fde4c1178] wait_queue_head_t btree_cache_wait; [ffffa03fde4c1190] struct task_struct *btree_cache_alloc_lock; crash> list -H ffffa03fde4c1140|wc -l 973 crash> list -H ffffa03fde4c1150|wc -l 1123 crash> cache_set.btree_cache_used -l cache_set.list ffffa03fde4c0050 btree_cache_used = 2097 crash> list -s btree -l btree.list -H ffffa03fde4c1140|grep -E -A2 "^ lock = {" > btree_cache.txt crash> list -s btree -l btree.list -H ffffa03fde4c1150|grep -E -A2 "^ lock = {" > btree_cache_freeable.txt [root@node-3 127.0.0.1-2023-08-04-16:40:28]# pwd /var/crash/127.0.0.1-2023-08-04-16:40:28 [root@node-3 127.0.0.1-2023-08-04-16:40:28]# cat btree_cache.txt|grep counter|grep -v "counter = 0" [root@node-3 127.0.0.1-2023-08-04-16:40:28]# cat btree_cache_freeable.txt|grep counter|grep -v "counter = 0" counter = 1 We found that this is a bug in bch_sectors_dirty_init() when locking c->root: (1). Thread X has locked c->root(A) write. (2). Thread Y failed to lock c->root(A), waiting for the lock(c->root A). (3). Thread X bch_btree_set_root() changes c->root from A to B. (4). Thread X releases the lock(c->root A). (5). Thread Y successfully locks c->root(A). (6). Thread Y releases the lock(c->root B). down_write locked ---(1)----------------------┐ | | | down_read waiting ---(2)----┐ | | | ┌-------------┐ ┌-------------┐ bch_btree_set_root ===(3)========>> | c->root A | | c->root B | | | └-------------┘ └-------------┘ up_write ---(4)---------------------┘ | | | | | down_read locked ---(5)-----------┘ | | | up_read ---(6)-----------------------------┘ Since c->root may change, the correct steps to lock c->root should be the same as bch_root_usage(), compare after locking. static unsigned int bch_root_usage(struct cache_set *c) { unsigned int bytes = 0; struct bkey *k; struct btree *b; struct btree_iter iter; goto lock_root; do { rw_unlock(false, b); lock_root: b = c->root; rw_lock(false, b, b->level); } while (b != c->root); for_each_key_filter(&b->keys, k, &iter, bch_ptr_bad) bytes += bkey_bytes(k); rw_unlock(false, b); return (bytes * 100) / btree_bytes(c); } Fixes: b144e45fc576 ("bcache: make bch_sectors_dirty_init() to be multithreaded") Signed-off-by: Mingzhe Zou Cc: Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20231120052503.6122-7-colyli@suse.de Signed-off-by: Jens Axboe commit 7cc47e64d3d69786a2711a4767e26b26ba63d7ed Author: Mingzhe Zou Date: Mon Nov 20 13:24:58 2023 +0800 bcache: fixup init dirty data errors We found that after long run, the dirty_data of the bcache device will have errors. This error cannot be eliminated unless re-register. We also found that reattach after detach, this error can accumulate. In bch_sectors_dirty_init(), all inode <= d->id keys will be recounted again. This is wrong, we only need to count the keys of the current device. Fixes: b144e45fc576 ("bcache: make bch_sectors_dirty_init() to be multithreaded") Signed-off-by: Mingzhe Zou Cc: Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20231120052503.6122-6-colyli@suse.de Signed-off-by: Jens Axboe commit 2c7f497ac274a14330208b18f6f734000868ebf9 Author: Rand Deeb Date: Mon Nov 20 13:24:57 2023 +0800 bcache: prevent potential division by zero error In SHOW(), the variable 'n' is of type 'size_t.' While there is a conditional check to verify that 'n' is not equal to zero before executing the 'do_div' macro, concerns arise regarding potential division by zero error in 64-bit environments. The concern arises when 'n' is 64 bits in size, greater than zero, and the lower 32 bits of it are zeros. In such cases, the conditional check passes because 'n' is non-zero, but the 'do_div' macro casts 'n' to 'uint32_t,' effectively truncating it to its lower 32 bits. Consequently, the 'n' value becomes zero. To fix this potential division by zero error and ensure precise division handling, this commit replaces the 'do_div' macro with div64_u64(). div64_u64() is designed to work with 64-bit operands, guaranteeing that division is performed correctly. This change enhances the robustness of the code, ensuring that division operations yield accurate results in all scenarios, eliminating the possibility of division by zero, and improving compatibility across different 64-bit environments. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Rand Deeb Cc: Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20231120052503.6122-5-colyli@suse.de Signed-off-by: Jens Axboe commit be93825f0e6428c2d3f03a6e4d447dc48d33d7ff Author: Colin Ian King Date: Mon Nov 20 13:24:56 2023 +0800 bcache: remove redundant assignment to variable cur_idx Variable cur_idx is being initialized with a value that is never read, it is being re-assigned later in a while-loop. Remove the redundant assignment. Cleans up clang scan build warning: drivers/md/bcache/writeback.c:916:2: warning: Value stored to 'cur_idx' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Reviewed-by: Coly Li Signed-off-by: Coly Li Link: https://lore.kernel.org/r/20231120052503.6122-4-colyli@suse.de Signed-off-by: Jens Axboe commit 777967e7e9f6f5f3e153abffb562bffaf4430d26 Author: Coly Li Date: Mon Nov 20 13:24:55 2023 +0800 bcache: check return value from btree_node_alloc_replacement() In btree_gc_rewrite_node(), pointer 'n' is not checked after it returns from btree_gc_rewrite_node(). There is potential possibility that 'n' is a non NULL ERR_PTR(), referencing such error code is not permitted in following code. Therefore a return value checking is necessary after 'n' is back from btree_node_alloc_replacement(). Signed-off-by: Coly Li Reported-by: Dan Carpenter Cc: Link: https://lore.kernel.org/r/20231120052503.6122-3-colyli@suse.de Signed-off-by: Jens Axboe commit baf8fb7e0e5ec54ea0839f0c534f2cdcd79bea9c Author: Coly Li Date: Mon Nov 20 13:24:54 2023 +0800 bcache: avoid oversize memory allocation by small stripe_size Arraies bcache->stripe_sectors_dirty and bcache->full_dirty_stripes are used for dirty data writeback, their sizes are decided by backing device capacity and stripe size. Larger backing device capacity or smaller stripe size make these two arraies occupies more dynamic memory space. Currently bcache->stripe_size is directly inherited from queue->limits.io_opt of underlying storage device. For normal hard drives, its limits.io_opt is 0, and bcache sets the corresponding stripe_size to 1TB (1<<31 sectors), it works fine 10+ years. But for devices do declare value for queue->limits.io_opt, small stripe_size (comparing to 1TB) becomes an issue for oversize memory allocations of bcache->stripe_sectors_dirty and bcache->full_dirty_stripes, while the capacity of hard drives gets much larger in recent decade. For example a raid5 array assembled by three 20TB hardrives, the raid device capacity is 40TB with typical 512KB limits.io_opt. After the math calculation in bcache code, these two arraies will occupy 400MB dynamic memory. Even worse Andrea Tomassetti reports that a 4KB limits.io_opt is declared on a new 2TB hard drive, then these two arraies request 2GB and 512MB dynamic memory from kzalloc(). The result is that bcache device always fails to initialize on his system. To avoid the oversize memory allocation, bcache->stripe_size should not directly inherited by queue->limits.io_opt from the underlying device. This patch defines BCH_MIN_STRIPE_SZ (4MB) as minimal bcache stripe size and set bcache device's stripe size against the declared limits.io_opt value from the underlying storage device, - If the declared limits.io_opt > BCH_MIN_STRIPE_SZ, bcache device will set its stripe size directly by this limits.io_opt value. - If the declared limits.io_opt < BCH_MIN_STRIPE_SZ, bcache device will set its stripe size by a value multiplying limits.io_opt and euqal or large than BCH_MIN_STRIPE_SZ. Then the minimal stripe size of a bcache device will always be >= 4MB. For a 40TB raid5 device with 512KB limits.io_opt, memory occupied by bcache->stripe_sectors_dirty and bcache->full_dirty_stripes will be 50MB in total. For a 2TB hard drive with 4KB limits.io_opt, memory occupied by these two arraies will be 2.5MB in total. Such mount of memory allocated for bcache->stripe_sectors_dirty and bcache->full_dirty_stripes is reasonable for most of storage devices. Reported-by: Andrea Tomassetti Signed-off-by: Coly Li Reviewed-by: Eric Wheeler Link: https://lore.kernel.org/r/20231120052503.6122-2-colyli@suse.de Signed-off-by: Jens Axboe commit bb0a05acd6121ff0e810b44fdc24dbdfaa46b642 Author: Jonas Karlman Date: Thu Oct 26 19:14:58 2023 +0000 drm/rockchip: vop: Fix color for RGB888/BGR888 format on VOP full Use of DRM_FORMAT_RGB888 and DRM_FORMAT_BGR888 on e.g. RK3288, RK3328 and RK3399 result in wrong colors being displayed. The issue can be observed using modetest: modetest -s @:1920x1080-60@RG24 modetest -s @:1920x1080-60@BG24 Vendor 4.4 kernel apply an inverted rb swap for these formats on VOP full framework (IP version 3.x) compared to VOP little framework (2.x). Fix colors by applying different rb swap for VOP full framework (3.x) and VOP little framework (2.x) similar to vendor 4.4 kernel. Fixes: 85a359f25388 ("drm/rockchip: Add BGR formats to VOP") Signed-off-by: Jonas Karlman Tested-by: Diederik de Haas Reviewed-by: Christopher Obbard Tested-by: Christopher Obbard Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231026191500.2994225-1-jonas@kwiboo.se commit 8479063f1fbee201a8739130e816cc331b675838 Author: Charles Mirabile Date: Mon Nov 20 05:55:45 2023 -0500 io_uring/fs: consider link->flags when getting path for LINKAT In order for `AT_EMPTY_PATH` to work as expected, the fact that the user wants that behavior needs to make it to `getname_flags` or it will return ENOENT. Fixes: cf30da90bc3a ("io_uring: add support for IORING_OP_LINKAT") Cc: Link: https://github.com/axboe/liburing/issues/995 Signed-off-by: Charles Mirabile Link: https://lore.kernel.org/r/20231120105545.1209530-1-cmirabil@redhat.com Signed-off-by: Jens Axboe commit 796432efab1e372d404e7a71cc6891a53f105051 Author: Chuck Lever Date: Sun Nov 19 18:56:17 2023 -0500 libfs: getdents() should return 0 after reaching EOD The new directory offset helpers don't conform with the convention of getdents() returning no more entries once a directory file descriptor has reached the current end-of-directory. To address this, copy the logic from dcache_readdir() to mark the open directory file descriptor once EOD has been reached. Seeking resets the mark. Reported-by: Tavian Barnes Closes: https://lore.kernel.org/linux-fsdevel/20231113180616.2831430-1-tavianator@tavianator.com/ Fixes: 6faddda69f62 ("libfs: Add directory operations for stable offsets") Signed-off-by: Chuck Lever Link: https://lore.kernel.org/r/170043792492.4628.15646203084646716134.stgit@bazille.1015granger.net Signed-off-by: Christian Brauner commit 9c04138414c00ae61421f36ada002712c4bac94a Author: Christoph Hellwig Date: Wed Oct 25 16:10:20 2023 +0200 xfs: respect the stable writes flag on the RT device Update the per-folio stable writes flag dependening on which device an inode resides on. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20231025141020.192413-5-hch@lst.de Reviewed-by: Darrick J. Wong Signed-off-by: Christian Brauner commit c421df0b19430417a04f68919fc3d1943d20ac04 Author: Christoph Hellwig Date: Wed Oct 25 16:10:19 2023 +0200 xfs: clean up FS_XFLAG_REALTIME handling in xfs_ioctl_setattr_xflags Introduce a local boolean variable if FS_XFLAG_REALTIME to make the checks for it more obvious, and de-densify a few of the conditionals using it to make them more readable while at it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20231025141020.192413-4-hch@lst.de Reviewed-by: Darrick J. Wong Signed-off-by: Christian Brauner commit 1898efcdbed32bb1c67269c985a50bab0dbc9493 Author: Christoph Hellwig Date: Wed Oct 25 16:10:18 2023 +0200 block: update the stable_writes flag in bdev_add Propagate the per-queue stable_write flags into each bdev inode in bdev_add. This makes sure devices that require stable writes have it set for I/O on the block device node as well. Note that this doesn't cover the case of a flag changing on a live device yet. We should handle that as well, but I plan to cover it as part of a more general rework of how changing runtime paramters on block devices works. Fixes: 1cb039f3dc16 ("bdi: replace BDI_CAP_STABLE_WRITES with a queue and a sb flag") Reported-by: Ilya Dryomov Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20231025141020.192413-3-hch@lst.de Tested-by: Ilya Dryomov Reviewed-by: Darrick J. Wong Signed-off-by: Christian Brauner commit 762321dab9a72760bf9aec48362f932717c9424d Author: Christoph Hellwig Date: Wed Oct 25 16:10:17 2023 +0200 filemap: add a per-mapping stable writes flag folio_wait_stable waits for writeback to finish before modifying the contents of a folio again, e.g. to support check summing of the data in the block integrity code. Currently this behavior is controlled by the SB_I_STABLE_WRITES flag on the super_block, which means it is uniform for the entire file system. This is wrong for the block device pseudofs which is shared by all block devices, or file systems that can use multiple devices like XFS witht the RT subvolume or btrfs (although btrfs currently reimplements folio_wait_stable anyway). Add a per-address_space AS_STABLE_WRITES flag to control the behavior in a more fine grained way. The existing SB_I_STABLE_WRITES is kept to initialize AS_STABLE_WRITES to the existing default which covers most cases. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20231025141020.192413-2-hch@lst.de Tested-by: Ilya Dryomov Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Signed-off-by: Christian Brauner commit 66917f85db6002ed09cd24186258892fcfca64b6 Author: Ian Kent Date: Mon Nov 20 06:53:19 2023 +0800 autofs: add: new_inode check in autofs_fill_super() Add missing NULL check of root_inode in autofs_fill_super(). While we are at it simplify the logic by taking advantage of the VFS cleanup procedures and get rid of the goto error handling, as suggested by Al Viro. Signed-off-by: Ian Kent Link: https://lore.kernel.org/r/20231119225319.331156-1-raven@themaw.net Reviewed-by: Bill O'Donnell Cc: Al Viro Cc: Christian Brauner Cc: Bill O'Donnell Reported-by: Signed-off-by: Christian Brauner commit 14e8442e0789598514f3c9de014950de9feda7a4 Author: Shengjiu Wang Date: Mon Nov 20 18:05:35 2023 +0800 ASoC: fsl_sai: Fix no frame sync clock issue on i.MX8MP On i.MX8MP, when the TERE and FSD_MSTR enabled before configuring the word width, there will be no frame sync clock issue, because old word width impact the generation of frame sync. TERE enabled earlier only for i.MX8MP case for the hardware limitation, So need to disable FSD_MSTR before configuring word width, then enable FSD_MSTR bit for this specific case. Fixes: 3e4a82612998 ("ASoC: fsl_sai: MCLK bind with TX/RX enable bit") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1700474735-3863-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit d04ce4113cb4e5c2deddcb161db42a25917f285f Author: Stefan Binding Date: Fri Nov 17 16:36:09 2023 +0000 ALSA: cs35l41: Fix for old systems which do not support command Some older laptops using cs35l41 use firmware which does not support the CSPL_MBOX_CMD_SPK_OUT_ENABLE command. Firmware versions v0.28.0 and older do not support this command. Fixes: fa3efcc36aac ("ALSA: cs35l41: Use mbox command to enable speaker output for external boost") Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231117163609.823627-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 37f67abe08557a79c3aabf684a49c6b99dbc259a Author: Stefan Binding Date: Fri Nov 17 16:36:08 2023 +0000 ALSA: hda: cs35l41: Remove unnecessary boolean state variable firmware_running This state duplicates the running state inside cs_dsp, so is not necessary. Remove it, and use cs_dsp.running instead. This brings the CS35L41 HDA driver more inline with its ASoC version, allowing the same state to be used when calling library functions. Fixes: fa3efcc36aac ("ALSA: cs35l41: Use mbox command to enable speaker output for external boost") Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231117163609.823627-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 7c9caa299335df94ad1c58f70a22f16a540eab60 Author: Vasiliy Kovalev Date: Fri Nov 17 20:09:23 2023 +0300 ALSA: hda - Fix speaker and headset mic pin config for CHUWI CoreBook XPro This patch corrected the speaker and headset mic pin config to the more appropriate values. Signed-off-by: Vasiliy Kovalev Link: https://lore.kernel.org/r/20231117170923.106822-1-kovalev@altlinux.org Signed-off-by: Takashi Iwai commit 0561794b6b642b84b879bf97061c4b4fa692839e Author: Andrzej Hajda Date: Wed Nov 15 11:54:03 2023 +0100 drm/i915: do not clean GT table on error path The only task of intel_gt_release_all is to zero gt table. Calling it on error path prevents intel_gt_driver_late_release_all (called from i915_driver_late_release) to cleanup GTs, causing leakage. After i915_driver_late_release GT array is not used anymore so it does not need cleaning at all. Sample leak report: BUG i915_request (...): Objects remaining in i915_request on __kmem_cache_shutdown() ... Object 0xffff888113420040 @offset=64 Allocated in __i915_request_create+0x75/0x610 [i915] age=18339 cpu=1 pid=1454 kmem_cache_alloc+0x25b/0x270 __i915_request_create+0x75/0x610 [i915] i915_request_create+0x109/0x290 [i915] __engines_record_defaults+0xca/0x440 [i915] intel_gt_init+0x275/0x430 [i915] i915_gem_init+0x135/0x2c0 [i915] i915_driver_probe+0x8d1/0xdc0 [i915] v2: removed whole intel_gt_release_all Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8489 Fixes: bec68cc9ea42 ("drm/i915: Prepare for multiple GTs") Signed-off-by: Andrzej Hajda Reviewed-by: Tvrtko Ursulin Reviewed-by: Nirmoy Das Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231115-dont_clean_gt_on_error_path-v2-1-54250125470a@intel.com (cherry picked from commit e899505533852bf1da133f2f4c9a9655ff77f7e5) Signed-off-by: Jani Nikula commit 018903e1cec3421a6198589fabd30682eb277904 Author: Imre Deak Date: Mon Oct 30 01:13:08 2023 +0200 drm/i915/dp_mst: Fix race between connector registration and setup After drm_connector_init() is called the connector is visible to the rest of the kernel via the drm_mode_config::connector_list. Make sure that the DSC AUX device and capabilities are setup by that time. Another race condition is adding the connector to the connector list before drm_connector_helper_add() sets the connector helper functions. That's an unrelated issue, for which the fix is for a follow-up. One solution would be adding the connector to the connector list only during its registration in drm_connector_register(). Cc: Stanislav Lisovskiy Cc: Ville Syrjälä Fixes: 808b43fa7e56 ("drm/i915/dp_mst: Set connector DSC capabilities and decompression AUX") Reviewed-by: Stanislav Lisovskiy Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231030155843.2251023-2-imre.deak@intel.com (cherry picked from commit 560ea72c76eb6d0c59f77580414e64cc09f1093d) Signed-off-by: Jani Nikula commit 45b478951b2ba5aea70b2850c49c1aa83aedd0d2 Author: Song Liu Date: Fri Nov 17 15:56:30 2023 -0800 md: fix bi_status reporting in md_end_clone_io md_end_clone_io() may overwrite error status in orig_bio->bi_status with BLK_STS_OK. This could happen when orig_bio has BIO_CHAIN (split by md_submit_bio => bio_split_to_limits, for example). As a result, upper layer may miss error reported from md (or the device) and consider the failed IO was successful. Fix this by only update orig_bio->bi_status when current bio reports error and orig_bio is BLK_STS_OK. This is the same behavior as __bio_chain_endio(). Fixes: 10764815ff47 ("md: add io accounting for raid0 and raid5") Cc: stable@vger.kernel.org # v5.14+ Reported-by: Bhanu Victor DiCara <00bvd0+linux@gmail.com> Closes: https://lore.kernel.org/regressions/5727380.DvuYhMxLoT@bvd0/ Signed-off-by: Song Liu Tested-by: Xiao Ni Reviewed-by: Yu Kuai Acked-by: Guoqing Jiang commit a6925165ea82b7765269ddd8dcad57c731aa00de Author: Chen Ni Date: Tue Oct 31 04:00:07 2023 +0000 ata: pata_isapnp: Add missing error check for devm_ioport_map() Add missing error return check for devm_ioport_map() and return the error if this function call fails. Fixes: 0d5ff566779f ("libata: convert to iomap") Signed-off-by: Chen Ni Reviewed-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit 98b1cc82c4affc16f5598d4fa14b1858671b2263 Author: Linus Torvalds Date: Sun Nov 19 15:02:14 2023 -0800 Linux 6.7-rc2 commit eb3479bc23fafbc408558cd8450b35f07fad2a63 Merge: 46a29dd146219 ae1eff0349f2e Author: Linus Torvalds Date: Sun Nov 19 13:54:28 2023 -0800 Merge tag 'kbuild-fixes-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Fix section mismatch warning messages for riscv and loongarch - Remove CONFIG_IA64 left-over from linux/export-internal.h - Fix the location of the quotes for UIMAGE_NAME - Fix a memory leak bug in Kconfig * tag 'kbuild-fixes-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: fix memory leak from range properties kbuild: Move the single quotes for image name linux/export: clean up the IA-64 KSYM_FUNC macro modpost: fix section mismatch message for RELA commit 46a29dd1462198e67bf939c32a2faf4e9bf9ac63 Merge: cd557bc0a2d0f d3badb15613c1 Author: Linus Torvalds Date: Sun Nov 19 13:49:32 2023 -0800 Merge tag 'irq_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fix from Borislav Petkov: - Flush the translation service tables to prevent unpredictable behavior on non-coherent GIC devices * tag 'irq_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/gic-v3-its: Flush ITS tables correctly in non-coherent GIC designs commit cd557bc0a2d0f36c41b6040c27f31da5c5b76f49 Merge: b0014556a2a19 ec9aedb2aa1ab Author: Linus Torvalds Date: Sun Nov 19 13:46:17 2023 -0800 Merge tag 'x86_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Ignore invalid x2APIC entries in order to not waste per-CPU data - Fix a back-to-back signals handling scenario when shadow stack is in use - A documentation fix - Add Kirill as TDX maintainer * tag 'x86_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/acpi: Ignore invalid x2APIC entries x86/shstk: Delay signal entry SSP write until after user accesses x86/Documentation: Indent 'note::' directive for protocol version number note MAINTAINERS: Add Intel TDX entry commit b0014556a2a1991df08b2b5d586a1bcc9e762ffd Merge: 2a0adc49548e9 5c0930ccaad5a Author: Linus Torvalds Date: Sun Nov 19 13:35:07 2023 -0800 Merge tag 'timers_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer fix from Borislav Petkov: - Do the push of pending hrtimers away from a CPU which is being offlined earlier in the offlining process in order to prevent a deadlock * tag 'timers_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: hrtimers: Push pending hrtimers away from outgoing CPU earlier commit 2a0adc49548e9116fdf9d7a39f5e0d8c1e16bef6 Merge: 2f84f8232ed3b 6d7e4782bcf54 Author: Linus Torvalds Date: Sun Nov 19 13:32:00 2023 -0800 Merge tag 'sched_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fixes from Borislav Petkov: - Fix virtual runtime calculation when recomputing a sched entity's weights - Fix wrongly rejected unprivileged poll requests to the cgroup psi pressure files - Make sure the load balancing is done by only one CPU * tag 'sched_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Fix the decision for load balance sched: psi: fix unprivileged polling against cgroups sched/eevdf: Fix vruntime adjustment on reweight commit 2f84f8232ed3bfb772dcf30d8a0acbb8ee7ffb73 Merge: c8b3443cbde91 c9bd1568d5462 Author: Linus Torvalds Date: Sun Nov 19 13:30:21 2023 -0800 Merge tag 'locking_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking fix from Borislav Petkov: - Fix a hardcoded futex flags case which lead to one robust futex test failure * tag 'locking_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: futex: Fix hardcoded flags commit c8b3443cbde91251970893fe4d5dc465c1a76a7e Merge: 037266a5f7239 889c58b3155ff Author: Linus Torvalds Date: Sun Nov 19 13:26:42 2023 -0800 Merge tag 'perf_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fix from Borislav Petkov: - Make sure the context refcount is transferred too when migrating perf events * tag 'perf_urgent_for_v6.7_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Fix cpuctx refcounting commit 938dbead34cd139c50c5d51cc58e18ef2f1c3d2c Author: Jakub Kicinski Date: Sat Nov 18 19:30:06 2023 -0800 net: fill in MODULE_DESCRIPTION()s for SOCK_DIAG modules W=1 builds now warn if module is built without a MODULE_DESCRIPTION(). Add descriptions to all the sock diag modules in one fell swoop. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 5f228d7c8a539714c1e9b7e7534f76bb7979f268 Author: Suman Ghosh Date: Fri Nov 17 16:10:18 2023 +0530 octeontx2-pf: Fix memory leak during interface down During 'ifconfig down' one RSS memory was not getting freed. This patch fixes the same. Fixes: 81a4362016e7 ("octeontx2-pf: Add RSS multi group support") Signed-off-by: Suman Ghosh Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 93da8d75a66568ba4bb5b14ad2833acd7304cd02 Author: Eric Dumazet Date: Fri Nov 17 14:17:33 2023 +0000 wireguard: use DEV_STATS_INC() wg_xmit() can be called concurrently, KCSAN reported [1] some device stats updates can be lost. Use DEV_STATS_INC() for this unlikely case. [1] BUG: KCSAN: data-race in wg_xmit / wg_xmit read-write to 0xffff888104239160 of 8 bytes by task 1375 on cpu 0: wg_xmit+0x60f/0x680 drivers/net/wireguard/device.c:231 __netdev_start_xmit include/linux/netdevice.h:4918 [inline] netdev_start_xmit include/linux/netdevice.h:4932 [inline] xmit_one net/core/dev.c:3543 [inline] dev_hard_start_xmit+0x11b/0x3f0 net/core/dev.c:3559 ... read-write to 0xffff888104239160 of 8 bytes by task 1378 on cpu 1: wg_xmit+0x60f/0x680 drivers/net/wireguard/device.c:231 __netdev_start_xmit include/linux/netdevice.h:4918 [inline] netdev_start_xmit include/linux/netdevice.h:4932 [inline] xmit_one net/core/dev.c:3543 [inline] dev_hard_start_xmit+0x11b/0x3f0 net/core/dev.c:3559 ... v2: also change wg_packet_consume_data_done() (Hangbin Liu) and wg_packet_purge_staged_packets() Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Jason A. Donenfeld Cc: Hangbin Liu Signed-off-by: Jason A. Donenfeld Reviewed-by: Hangbin Liu Signed-off-by: David S. Miller commit 8ba2c459668cfe2aaacc5ebcd35b4b9ef8643013 Author: Jiawen Wu Date: Fri Nov 17 18:11:08 2023 +0800 net: wangxun: fix kernel panic due to null pointer When the device uses a custom subsystem vendor ID, the function wx_sw_init() returns before the memory of 'wx->mac_table' is allocated. The null pointer will causes the kernel panic. Fixes: 79625f45ca73 ("net: wangxun: Move MAC address handling to libwx") Signed-off-by: Jiawen Wu Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 3f9a91b6c00e655d27bd785dcda1742dbdc31bda Author: Marek Vasut Date: Mon Oct 9 00:32:56 2023 +0200 drm/panel: simple: Fix Innolux G101ICE-L01 timings The Innolux G101ICE-L01 datasheet [1] page 17 table 6.1 INPUT SIGNAL TIMING SPECIFICATIONS indicates that maximum vertical blanking time is 40 lines. Currently the driver uses 29 lines. Fix it, and since this panel is a DE panel, adjust the timings to make them less hostile to controllers which cannot do 1 px HSA/VSA, distribute the delays evenly between all three parts. [1] https://www.data-modul.com/sites/default/files/products/G101ICE-L01-C2-specification-12042389.pdf Fixes: 1e29b840af9f ("drm/panel: simple: Add Innolux G101ICE-L01 panel") Signed-off-by: Marek Vasut Reviewed-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231008223256.279196-1-marex@denx.de commit 06fc41b09cfbc02977acd9189473593a37d82d9b Author: Marek Vasut Date: Mon Oct 9 00:33:15 2023 +0200 drm/panel: simple: Fix Innolux G101ICE-L01 bus flags Add missing .bus_flags = DRM_BUS_FLAG_DE_HIGH to this panel description, ones which match both the datasheet and the panel display_timing flags . Fixes: 1e29b840af9f ("drm/panel: simple: Add Innolux G101ICE-L01 panel") Signed-off-by: Marek Vasut Reviewed-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231008223315.279215-1-marex@denx.de commit b6f09b16558f31d93cdcda3cab90a2d309a7c823 Author: Junxian Huang Date: Fri Nov 17 16:06:57 2023 +0800 MAINTAINERS: Add Chengchang Tang as Hisilicon RoCE maintainer Add Chengchang Tang as Hisilicon RoCE maintainer. Signed-off-by: Junxian Huang Link: https://lore.kernel.org/r/20231117080657.1844316-1-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit 037266a5f7239ead1530266f7d7af153d2a867fa Merge: 2254005ef1474 2a0508d9d08f0 Author: Linus Torvalds Date: Sat Nov 18 15:20:58 2023 -0800 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Seven small fixes, six in drivers and one in sd. The sd fix is so large because it changes a struct pointer to a struct but otherwise is fairly simple" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: qcom-ufs: dt-bindings: Document the SM8650 UFS Controller scsi: sd: Fix sshdr use in sd_suspend_common() scsi: scsi_debug: Delete some bogus error checking scsi: scsi_debug: Fix some bugs in sdebug_error_write() scsi: ufs: core: Fix racing issue between ufshcd_mcq_abort() and ISR scsi: ufs: core: Expand MCQ queue slot to DeviceQueueDepth + 1 scsi: qla2xxx: Fix system crash due to bad pointer access commit 2254005ef1474d59b706f2ea574d8552071631b1 Merge: b8f1fa2419c19 793838138c157 Author: Linus Torvalds Date: Sat Nov 18 15:13:10 2023 -0800 Merge tag 'parisc-for-6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc fixes from Helge Deller: "On parisc we still sometimes need writeable stacks, e.g. if programs aren't compiled with gcc-14. To avoid issues with the upcoming systemd-254 we therefore have to disable prctl(PR_SET_MDWE) for now (for parisc only). The other two patches are minor: a bugfix for the soft power-off on qemu with 64-bit kernel and prefer strscpy() over strlcpy(): - Fix power soft-off on qemu - Disable prctl(PR_SET_MDWE) since parisc sometimes still needs writeable stacks - Use strscpy instead of strlcpy in show_cpuinfo()" * tag 'parisc-for-6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: prctl: Disable prctl(PR_SET_MDWE) on parisc parisc/power: Fix power soft-off when running on qemu parisc: Replace strlcpy() with strscpy() commit b9622937d95809ef89904583191571a9fa326402 Author: Chukun Pan Date: Sun Oct 29 15:40:09 2023 +0800 arm64: dts: allwinner: h616: update emac for Orange Pi Zero 3 The current emac setting is not suitable for Orange Pi Zero 3, move it back to Orange Pi Zero 2 DT. Also update phy mode and delay values for emac on Orange Pi Zero 3. With these changes, Ethernet now looks stable. Fixes: 322bf103204b ("arm64: dts: allwinner: h616: Split Orange Pi Zero 2 DT") Signed-off-by: Chukun Pan Reviewed-by: Jernej Skrabec Link: https://lore.kernel.org/r/20231029074009.7820-2-amadeus@jmu.edu.cn Signed-off-by: Jernej Skrabec commit b8f1fa2419c19c81bc386a6b350879ba54a573e1 Merge: bb28378af3921 7930d9e103700 Author: Linus Torvalds Date: Sat Nov 18 11:28:28 2023 -0800 Merge tag 'xfs-6.7-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fixes from Chandan Babu: - Fix deadlock arising due to intent items in AIL not being cleared when log recovery fails - Fix stale data exposure bug when remapping COW fork extents to data fork - Fix deadlock when data device flush fails - Fix AGFL minimum size calculation - Select DEBUG_FS instead of XFS_DEBUG when XFS_ONLINE_SCRUB_STATS is selected - Fix corruption of log inode's extent count field when NREXT64 feature is enabled * tag 'xfs-6.7-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: recovery should not clear di_flushiter unconditionally xfs: inode recovery does not validate the recovered inode xfs: fix again select in kconfig XFS_ONLINE_SCRUB_STATS xfs: fix internal error from AGFL exhaustion xfs: up(ic_sema) if flushing data device fails xfs: only remap the written blocks in xfs_reflink_end_cow_extent XFS: Update MAINTAINERS to catch all XFS documentation xfs: abort intent items when recovery intents fail xfs: factor out xfs_defer_pending_abort commit bb28378af3921ea50f316d025acd1f7290873b51 Merge: 33b63f159a435 bf51c52a1f3c2 Author: Linus Torvalds Date: Sat Nov 18 11:23:32 2023 -0800 Merge tag 'nfsd-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: - Fix several long-standing bugs in the duplicate reply cache - Fix a memory leak * tag 'nfsd-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: NFSD: Fix checksum mismatches in the duplicate reply cache NFSD: Fix "start of NFS reply" pointer passed to nfsd_cache_update() NFSD: Update nfsd_cache_append() to use xdr_stream nfsd: fix file memleak on client_opens_release commit 33b63f159a435c6dcaaf2cd0f312b28c76b61373 Merge: 05aa69b096a08 5eef12c4e3230 Author: Linus Torvalds Date: Sat Nov 18 11:18:46 2023 -0800 Merge tag '6.7-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fixes from Steve French: - multichannel fixes (including a lock ordering fix and an important refcounting fix) - spnego fix * tag '6.7-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix lock ordering while disabling multichannel cifs: fix leak of iface for primary channel cifs: fix check of rc in function generate_smb3signingkey cifs: spnego: add ';' in HOST_KEY_LEN commit 793838138c157d4c49f4fb744b170747e3dabf58 Author: Helge Deller Date: Sat Nov 18 19:33:35 2023 +0100 prctl: Disable prctl(PR_SET_MDWE) on parisc systemd-254 tries to use prctl(PR_SET_MDWE) for it's MemoryDenyWriteExecute functionality, but fails on parisc which still needs executable stacks in certain combinations of gcc/glibc/kernel. Disable prctl(PR_SET_MDWE) by returning -EINVAL for now on parisc, until userspace has catched up. Signed-off-by: Helge Deller Co-developed-by: Linus Torvalds Reported-by: Sam James Closes: https://github.com/systemd/systemd/issues/29775 Tested-by: Sam James Link: https://lore.kernel.org/all/875y2jro9a.fsf@gentoo.org/ Cc: # v6.3+ commit 05aa69b096a089dc85391e36ccdce76961694e22 Merge: 23dfa043f6d5a 13648e04a9b83 Author: Linus Torvalds Date: Sat Nov 18 10:02:16 2023 -0800 Merge tag 'for-6.7/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: - Various fixes for the DM delay target to address regressions introduced during the 6.7 merge window - Fixes to both DM bufio and the verity target for no-sleep mode, to address sleeping while atomic issues - Update DM crypt target in response to the treewide change that made MAX_ORDER inclusive * tag 'for-6.7/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm-crypt: start allocating with MAX_ORDER dm-verity: don't use blocking calls from tasklets dm-bufio: fix no-sleep mode dm-delay: avoid duplicate logic dm-delay: fix bugs introduced by kthread mode dm-delay: fix a race between delay_presuspend and delay_bio commit 6ad6e15a9c46b8f0932cd99724f26f3db4db1cdf Author: Helge Deller Date: Fri Nov 17 16:43:52 2023 +0100 parisc/power: Fix power soft-off when running on qemu Firmware returns the physical address of the power switch, so need to use gsc_writel() instead of direct memory access. Fixes: d0c219472980 ("parisc/power: Add power soft-off when running on qemu") Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v6.0+ commit 721d28f3dfb3e40c45ce45fbeeff47b72c230bc9 Author: Kees Cook Date: Thu Nov 16 11:13:40 2023 -0800 parisc: Replace strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated[1]. Additionally, it returns the size of the source string, not the resulting size of the destination string. In an effort to remove strlcpy() completely[2], replace strlcpy() here with strscpy(). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [1] Link: https://github.com/KSPP/linux/issues/89 [2] Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Azeem Shaikh Cc: linux-parisc@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Helge Deller commit 23dfa043f6d5ac9339607f077f2c30cd50798e12 Merge: 9ea991a50dd55 382561d16854a Author: Linus Torvalds Date: Sat Nov 18 09:44:14 2023 -0800 Merge tag 'i2c-for-6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "Revert a not-working conversion to generic recovery for PXA, use proper IO accessors for designware, and use proper PM level for ocores to allow accessing interrupt providers late" * tag 'i2c-for-6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: ocores: Move system PM hooks to the NOIRQ phase i2c: designware: Fix corrupted memory seen in the ISR Revert "i2c: pxa: move to generic GPIO recovery" commit 9ea991a50dd559ad2f1a5094d73f9583811979a5 Merge: 791c8ab095f71 b8337e6a780da Author: Linus Torvalds Date: Sat Nov 18 09:09:17 2023 -0800 Merge tag 'turbostat-2023.11.07' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux Pull turbostat updates from Len Brown: - Turbostat features are now table-driven (Rui Zhang) - Add support for some new platforms (Sumeet Pawnikar, Rui Zhang) - Gracefully run in configs when CPUs are limited (Rui Zhang, Srinivas Pandruvada) - misc minor fixes [ This came in during the merge window, but sorting out the signed tag took a while, so thus the late merge - Linus ] * tag 'turbostat-2023.11.07' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (86 commits) tools/power turbostat: version 2023.11.07 tools/power/turbostat: bugfix "--show IPC" tools/power/turbostat: Add initial support for LunarLake tools/power/turbostat: Add initial support for ArrowLake tools/power/turbostat: Add initial support for GrandRidge tools/power/turbostat: Add initial support for SierraForest tools/power/turbostat: Add initial support for GraniteRapids tools/power/turbostat: Add MSR_CORE_C1_RES support for spr_features tools/power/turbostat: Move process to root cgroup tools/power/turbostat: Handle cgroup v2 cpu limitation tools/power/turbostat: Abstrct function for parsing cpu string tools/power/turbostat: Handle offlined CPUs in cpu_subset tools/power/turbostat: Obey allowed CPUs for system summary tools/power/turbostat: Obey allowed CPUs for primary thread/core detection tools/power/turbostat: Abstract several functions tools/power/turbostat: Obey allowed CPUs during startup tools/power/turbostat: Obey allowed CPUs when accessing CPU counters tools/power/turbostat: Introduce cpu_allowed_set tools/power/turbostat: Remove PC7/PC9 support on ADL/RPL tools/power/turbostat: Enable MSR_CORE_C1_RES on recent Intel client platforms ... commit fe2c34bab6d46469ad3095955dc37e984dc24e38 Author: Omar Sandoval Date: Fri Nov 17 13:38:46 2023 -0800 iov_iter: fix copy_page_to_iter_nofault() The recent conversion to inline functions made two mistakes: 1. It tries to copy the full amount requested (bytes), not just what's available in the kmap'd page (n). 2. It's not applying the offset in the first page. Note that copy_page_to_iter_nofault() is only used by /proc/kcore. This was detected by drgn's test suite. Fixes: f1982740f5e7 ("iov_iter: Convert iterate*() to inline funcs") Signed-off-by: Omar Sandoval Link: https://lore.kernel.org/r/c1616e06b5248013cbbb1881bb4fef85a7a69ccb.1700257019.git.osandov@fb.com Acked-by: David Howells Signed-off-by: Christian Brauner commit 8a924db2d7b5eb69ba08b1a0af46e9f1359a9bdf Author: Stefan Berger Date: Mon Oct 2 08:57:33 2023 -0400 fs: Pass AT_GETATTR_NOSEC flag to getattr interface function When vfs_getattr_nosec() calls a filesystem's getattr interface function then the 'nosec' should propagate into this function so that vfs_getattr_nosec() can again be called from the filesystem's gettattr rather than vfs_getattr(). The latter would add unnecessary security checks that the initial vfs_getattr_nosec() call wanted to avoid. Therefore, introduce the getattr flag GETATTR_NOSEC and allow to pass with the new getattr_flags parameter to the getattr interface function. In overlayfs and ecryptfs use this flag to determine which one of the two functions to call. In a recent code change introduced to IMA vfs_getattr_nosec() ended up calling vfs_getattr() in overlayfs, which in turn called security_inode_getattr() on an exiting process that did not have current->fs set anymore, which then caused a kernel NULL pointer dereference. With this change the call to security_inode_getattr() can be avoided, thus avoiding the NULL pointer dereference. Reported-by: Fixes: db1d1e8b9867 ("IMA: use vfs_getattr_nosec to get the i_version") Cc: Alexander Viro Cc: Cc: Miklos Szeredi Cc: Amir Goldstein Cc: Tyler Hicks Cc: Mimi Zohar Suggested-by: Christian Brauner Co-developed-by: Amir Goldstein Signed-off-by: Stefan Berger Link: https://lore.kernel.org/r/20231002125733.1251467-1-stefanb@linux.vnet.ibm.com Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner commit 56466f653cb59a8f46e991ad1e285f43afdca7d4 Author: Dan Carpenter Date: Fri Oct 13 11:25:15 2023 +0300 drm/msm: remove unnecessary NULL check This NULL check was required when it was added, but we shuffled the code around and now it's not. The inconsistent NULL checking triggers a Smatch warning: drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c:847 mdp5_init() warn: variable dereferenced before check 'mdp5_kms' (see line 782) Fixes: 1f50db2f3e1e ("drm/msm/mdp5: move resource allocation to the _probe function") Signed-off-by: Dan Carpenter Reviewed-by: Uwe Kleine-König Reviewed-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/562559/ Link: https://lore.kernel.org/r/ZSj+6/J6YsoSpLak@kadam Signed-off-by: Abhinav Kumar commit 3bdaf698a7973156209c00d33b548882784aefe8 Merge: f8ba14b780273 aa7e8e5e40115 Author: Mark Brown Date: Fri Nov 17 23:19:12 2023 +0000 ASoC: Fixes for cs43130 Merge a couple of small fixes for the cs43130, one const correctness issue and one problem with the configuration of left justified format. commit 791c8ab095f71327899023223940dd52257a4173 Merge: 12ee72fe01e45 ba276ce5865b5 Author: Linus Torvalds Date: Fri Nov 17 14:36:58 2023 -0800 Merge tag 'bcachefs-2023-11-17' of https://evilpiepirate.org/git/bcachefs Pull bcachefs fixes from Kent Overstreet: "Lots of small fixes for minor nits and compiler warnings. Bigger items: - The six locks lost wakeup is finally fixed: six_read_trylock() was checking for the waiting bit before decrementing the number of readers - validated the fix with a torture test. - Fix for a memory reclaim issue: when needing to reallocate a key cache key, we now do our usual GFP_NOWAIT; unlock(); GFP_KERNEL dance. - Multiple deleted inodes btree fixes - Fix an issue in fsck, where i_nlink would be recalculated incorrectly for hardlinked files if a snapshot had ever been taken. - Kill journal pre-reservations: This is a bigger patch than I would normally send at this point, but it deletes code and it fixes some of our tests that would sporadically die with the journal getting stuck, and it's a performance improvement, too" * tag 'bcachefs-2023-11-17' of https://evilpiepirate.org/git/bcachefs: (22 commits) bcachefs: Fix missing locking for dentry->d_parent access bcachefs: six locks: Fix lost wakeup bcachefs: Fix no_data_io mode checksum check bcachefs: Fix bch2_check_nlinks() for snapshots bcachefs: Don't decrease BTREE_ITER_MAX when LOCKDEP=y bcachefs: Disable debug log statements bcachefs: Fix missing transaction commit bcachefs: Fix error path in bch2_mount() bcachefs: Fix potential sleeping during mount bcachefs: Fix iterator leak in may_delete_deleted_inode() bcachefs: Kill journal pre-reservations bcachefs: Check for nonce offset inconsistency in data_update path bcachefs: Make sure to drop/retake btree locks before reclaim bcachefs: btree_trans->write_locked bcachefs: Run btree key cache shrinker less aggressively bcachefs: Split out btree_key_cache_types.h bcachefs: Guard against insufficient devices to create stripes bcachefs: Fix null ptr deref in bch2_backpointer_get_node() bcachefs: Fix multiple -Warray-bounds warnings bcachefs: Use DECLARE_FLEX_ARRAY() helper and fix multiple -Warray-bounds warnings ... commit 12ee72fe01e45a9586b9d130c5501763818c8efc Merge: ffd75bc777b4f afccb0804fc74 Author: Linus Torvalds Date: Fri Nov 17 14:19:46 2023 -0800 Merge tag 'mm-hotfixes-stable-2023-11-17-14-04' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc fixes from Andrew Morton: "Thirteen hotfixes. Seven are cc:stable and the remainder pertain to post-6.6 issues or aren't considered suitable for backporting" * tag 'mm-hotfixes-stable-2023-11-17-14-04' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: mm: more ptep_get() conversion parisc: fix mmap_base calculation when stack grows upwards mm/damon/core.c: avoid unintentional filtering out of schemes mm: kmem: drop __GFP_NOFAIL when allocating objcg vectors mm/damon/sysfs-schemes: handle tried region directory allocation failure mm/damon/sysfs-schemes: handle tried regions sysfs directory allocation failure mm/damon/sysfs: check error from damon_sysfs_update_target() mm: fix for negative counter: nr_file_hugepages selftests/mm: add hugetlb_fault_after_madv to .gitignore selftests/mm: restore number of hugepages selftests: mm: fix some build warnings selftests: mm: skip whole test instead of failure mm/damon/sysfs: eliminate potential uninitialized variable warning commit ffd75bc777b4f86bee0e49a1b9f2c45dc4503001 Merge: 0e413c2a737f4 b0077e269f6c1 Author: Linus Torvalds Date: Fri Nov 17 14:08:14 2023 -0800 Merge tag 'block-6.7-2023-11-17' of git://git.kernel.dk/linux Pull block fix from Jens Axboe: "Just a single fix from Christoph/Ming, fixing a case where integrity IO could be called without having an appropriate queue reference" * tag 'block-6.7-2023-11-17' of git://git.kernel.dk/linux: blk-mq: make sure active queue usage is held for bio_integrity_prep() commit 0e413c2a737f4ce8924645ee80438c3be7c44ee3 Merge: e63fe2d35ee09 a0d45c3f596be Author: Linus Torvalds Date: Fri Nov 17 14:03:18 2023 -0800 Merge tag 'io_uring-6.7-2023-11-17' of git://git.kernel.dk/linux Pull io_uring fix from Jens Axboe: "Just a single fixup for a change we made in this release, which caused a regression in sometimes missing fdinfo output if the SQPOLL thread had the lock held when fdinfo output was retrieved. This brings us back on par with what we had before, where just the main uring_lock will prevent that output. We'd love to get rid of that too, but that is beyond the scope of this release and will have to wait for 6.8" * tag 'io_uring-6.7-2023-11-17' of git://git.kernel.dk/linux: io_uring/fdinfo: remove need for sqpoll lock for thread/pid retrieval commit e63fe2d35ee095b483adf936747dbc7d85f3de38 Merge: 6bc40e44f1dde 86d8f905f24d2 Author: Linus Torvalds Date: Fri Nov 17 13:58:26 2023 -0800 Merge tag 'drm-fixes-2023-11-17' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Daniel Vetter: "This is a 'blast from the bast' fixes pull, because it contains a bunch of AGP fixes for amdgpu. Otherwise nothing out of the ordinary. Next week is back to Dave unless he's knocked out by some conference bug. - amdgpu: fixes all over, including a set of AGP fixes - nouvea: GSP + other bugfixes - ivpu build fix - lenovo legion go panel orientation quirk" * tag 'drm-fixes-2023-11-17' of git://anongit.freedesktop.org/drm/drm: (30 commits) drm/amdgpu/gmc9: disable AGP aperture drm/amdgpu/gmc10: disable AGP aperture drm/amdgpu/gmc11: disable AGP aperture drm/amdgpu: add a module parameter to control the AGP aperture drm/amdgpu/gmc11: fix logic typo in AGP check drm/amd/display: Fix encoder disable logic drm/amd/display: Change the DMCUB mailbox memory location from FB to inbox drm/amdgpu: add and populate the port num into xgmi topology info drm/amd/display: Negate IPS allow and commit bits drm/amd/pm: Don't send unload message for reset drm/amdgpu: fix ras err_data null pointer issue in amdgpu_ras.c drm/amd/display: Clear dpcd_sink_ext_caps if not set drm/amd/display: Enable fast plane updates on DCN3.2 and above drm/amd/display: fix NULL dereference drm/amd/display: fix a NULL pointer dereference in amdgpu_dm_i2c_xfer() drm/amd/display: Add null checks for 8K60 lightup drm/amd/pm: Fill pcie error counters for gpu v1_4 drm/amd/pm: Update metric table for smu v13_0_6 drm/amdgpu: correct chunk_ptr to a pointer to chunk. drm/amd/display: Fix DSC not Enabled on Direct MST Sink ... commit 6965809e526917b73c8f9178173184dcf13cec4b Author: Xuxin Xiong Date: Tue Nov 14 12:42:05 2023 +0800 drm/panel: auo,b101uan08.3: Fine tune the panel power sequence For "auo,b101uan08.3" this panel, it is stipulated in the panel spec that MIPI needs to keep the LP11 state before the lcm_reset pin is pulled high. Fixes: 56ad624b4cb5 ("drm/panel: support for auo, b101uan08.3 wuxga dsi video mode panel") Signed-off-by: Xuxin Xiong Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20231114044205.613421-1-xuxinxiong@huaqin.corp-partner.google.com commit bf51c52a1f3c238d72c64e14d5e7702d3a245b82 Author: Chuck Lever Date: Fri Nov 10 11:28:45 2023 -0500 NFSD: Fix checksum mismatches in the duplicate reply cache nfsd_cache_csum() currently assumes that the server's RPC layer has been advancing rq_arg.head[0].iov_base as it decodes an incoming request, because that's the way it used to work. On entry, it expects that buf->head[0].iov_base points to the start of the NFS header, and excludes the already-decoded RPC header. These days however, head[0].iov_base now points to the start of the RPC header during all processing. It no longer points at the NFS Call header when execution arrives at nfsd_cache_csum(). In a retransmitted RPC the XID and the NFS header are supposed to be the same as the original message, but the contents of the retransmitted RPC header can be different. For example, for krb5, the GSS sequence number will be different between the two. Thus if the RPC header is always included in the DRC checksum computation, the checksum of the retransmitted message might not match the checksum of the original message, even though the NFS part of these messages is identical. The result is that, even if a matching XID is found in the DRC, the checksum mismatch causes the server to execute the retransmitted RPC transaction again. Reviewed-by: Jeff Layton Tested-by: Jeff Layton Signed-off-by: Chuck Lever commit 1caf5f61dd8430ae5a0b4538afe4953ce7517cbb Author: Chuck Lever Date: Fri Nov 10 11:28:33 2023 -0500 NFSD: Fix "start of NFS reply" pointer passed to nfsd_cache_update() The "statp + 1" pointer that is passed to nfsd_cache_update() is supposed to point to the start of the egress NFS Reply header. In fact, it does point there for AUTH_SYS and RPCSEC_GSS_KRB5 requests. But both krb5i and krb5p add fields between the RPC header's accept_stat field and the start of the NFS Reply header. In those cases, "statp + 1" points at the extra fields instead of the Reply. The result is that nfsd_cache_update() caches what looks to the client like garbage. A connection break can occur for a number of reasons, but the most common reason when using krb5i/p is a GSS sequence number window underrun. When an underrun is detected, the server is obliged to drop the RPC and the connection to force a retransmit with a fresh GSS sequence number. The client presents the same XID, it hits in the server's DRC, and the server returns the garbage cache entry. The "statp + 1" argument has been used since the oldest changeset in the kernel history repo, so it has been in nfsd_dispatch() literally since before history began. The problem arose only when the server-side GSS implementation was added twenty years ago. Reviewed-by: Jeff Layton Tested-by: Jeff Layton commit 49cecd8628a9855cd993792a0377559ea32d5e7c Author: Chuck Lever Date: Fri Nov 10 11:28:39 2023 -0500 NFSD: Update nfsd_cache_append() to use xdr_stream When inserting a DRC-cached response into the reply buffer, ensure that the reply buffer's xdr_stream is updated properly. Otherwise the server will send a garbage response. Cc: stable@vger.kernel.org # v6.3+ Reviewed-by: Jeff Layton Tested-by: Jeff Layton Signed-off-by: Chuck Lever commit bc1b5acb40201a0746d68a7d7cfc141899937f4f Author: Mahmoud Adam Date: Fri Nov 10 19:21:04 2023 +0100 nfsd: fix file memleak on client_opens_release seq_release should be called to free the allocated seq_file Cc: stable@vger.kernel.org # v5.3+ Signed-off-by: Mahmoud Adam Reviewed-by: Jeff Layton Fixes: 78599c42ae3c ("nfsd4: add file to display list of client's opens") Reviewed-by: NeilBrown Tested-by: Jeff Layton Signed-off-by: Chuck Lever commit 13648e04a9b831b3dfa5cf3887dfa6cf8fe5fe69 Author: Mikulas Patocka Date: Fri Nov 17 18:38:33 2023 +0100 dm-crypt: start allocating with MAX_ORDER Commit 23baf831a32c ("mm, treewide: redefine MAX_ORDER sanely") changed the meaning of MAX_ORDER from exclusive to inclusive. So, we can allocate compound pages with up to 1 << MAX_ORDER pages. Reflect this change in dm-crypt and start trying to allocate compound pages with MAX_ORDER. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 28f07f2ab4b3a2714f1fefcc58ada4bcc195f806 Author: Mikulas Patocka Date: Fri Nov 17 18:37:25 2023 +0100 dm-verity: don't use blocking calls from tasklets The commit 5721d4e5a9cd enhanced dm-verity, so that it can verify blocks from tasklets rather than from workqueues. This reportedly improves performance significantly. However, dm-verity was using the flag CRYPTO_TFM_REQ_MAY_SLEEP from tasklets which resulted in warnings about sleeping function being called from non-sleeping context. BUG: sleeping function called from invalid context at crypto/internal.h:206 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 14, name: ksoftirqd/0 preempt_count: 100, expected: 0 RCU nest depth: 0, expected: 0 CPU: 0 PID: 14 Comm: ksoftirqd/0 Tainted: G W 6.7.0-rc1 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 Call Trace: dump_stack_lvl+0x32/0x50 __might_resched+0x110/0x160 crypto_hash_walk_done+0x54/0xb0 shash_ahash_update+0x51/0x60 verity_hash_update.isra.0+0x4a/0x130 [dm_verity] verity_verify_io+0x165/0x550 [dm_verity] ? free_unref_page+0xdf/0x170 ? psi_group_change+0x113/0x390 verity_tasklet+0xd/0x70 [dm_verity] tasklet_action_common.isra.0+0xb3/0xc0 __do_softirq+0xaf/0x1ec ? smpboot_thread_fn+0x1d/0x200 ? sort_range+0x20/0x20 run_ksoftirqd+0x15/0x30 smpboot_thread_fn+0xed/0x200 kthread+0xdc/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x28/0x40 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork_asm+0x11/0x20 This commit fixes dm-verity so that it doesn't use the flags CRYPTO_TFM_REQ_MAY_SLEEP and CRYPTO_TFM_REQ_MAY_BACKLOG from tasklets. The crypto API would do GFP_ATOMIC allocation instead, it could return -ENOMEM and we catch -ENOMEM in verity_tasklet and requeue the request to the workqueue. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org # v6.0+ Fixes: 5721d4e5a9cd ("dm verity: Add optional "try_verify_in_tasklet" feature") Signed-off-by: Mike Snitzer commit 2a695062a5a42aead8c539a344168d4806b3fda2 Author: Mikulas Patocka Date: Fri Nov 17 18:36:34 2023 +0100 dm-bufio: fix no-sleep mode dm-bufio has a no-sleep mode. When activated (with the DM_BUFIO_CLIENT_NO_SLEEP flag), the bufio client is read-only and we could call dm_bufio_get from tasklets. This is used by dm-verity. Unfortunately, commit 450e8dee51aa ("dm bufio: improve concurrent IO performance") broke this and the kernel would warn that cache_get() was calling down_read() from no-sleeping context. The bug can be reproduced by using "veritysetup open" with the "--use-tasklets" flag. This commit fixes dm-bufio, so that the tasklet mode works again, by expanding use of the 'no_sleep_enabled' static_key to conditionally use either a rw_semaphore or rwlock_t (which are colocated in the buffer_tree structure using a union). Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org # v6.4 Fixes: 450e8dee51aa ("dm bufio: improve concurrent IO performance") Signed-off-by: Mike Snitzer commit ccadc8a21ef13eb80006ecff6a7466810e4f0dd6 Author: Mikulas Patocka Date: Fri Nov 17 18:24:04 2023 +0100 dm-delay: avoid duplicate logic This is small refactoring of dm-delay - we avoid duplicate logic in flush_delayed_bios and flush_delayed_bios_fast and join these two functions into one. We also add cond_resched() to flush_delayed_bios because the list may have unbounded number of entries. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 38cfff568169ff9f99784948f79f62ca1af5a187 Author: Mikulas Patocka Date: Fri Nov 17 18:22:47 2023 +0100 dm-delay: fix bugs introduced by kthread mode This commit fixes the following bugs introduced by commit 70bbeb29fab0 ("dm delay: for short delays, use kthread instead of timers and wq"): * the function flush_worker_fn has no exit path - on unload, this function will just loop and consume 100% CPU without any progress * the wake-up mechanism in flush_worker_fn is racy - a wake up will be missed if the process adds entries to the delayed_bios list just before set_current_state(TASK_INTERRUPTIBLE) * flush_delayed_bios_fast submits a bio while holding a global mutex; this may deadlock if we have multiple stacked dm-delay devices and the underlying device attempts to acquire the mutex too * if the target constructor fails, it will call delay_dtr. delay_dtr would attempt to free dc->timer_lock without it being initialized by the constructor. * if the target constructor's kthread allocation fails, delay_dtr would crash trying to dereference dc->worker because it is non-NULL due to ERR_PTR. Fixes: 70bbeb29fab0 ("dm delay: for short delays, use kthread instead of timers and wq") Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 6fc45b6ed921dc00dfb264dc08c7d67ee63d2656 Author: Mikulas Patocka Date: Fri Nov 17 18:21:14 2023 +0100 dm-delay: fix a race between delay_presuspend and delay_bio In delay_presuspend, we set the atomic variable may_delay and then stop the timer and flush pending bios. The intention here is to prevent the delay target from re-arming the timer again. However, this test is racy. Suppose that one thread goes to delay_bio, sees that dc->may_delay is one and proceeds; now, another thread executes delay_presuspend, it sets dc->may_delay to zero, deletes the timer and flushes pending bios. Then, the first thread continues and adds the bio to delayed->list despite the fact that dc->may_delay is false. Fix this bug by changing may_delay's type from atomic_t to bool and only access it while holding the delayed_bios_lock mutex. Note that we don't have to grab the mutex in delay_resume because there are no bios in flight at this point. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer commit e63a57303599b17290cd8bc48e6f20b24289a8bc Author: Ming Lei Date: Fri Nov 17 10:35:24 2023 +0800 blk-cgroup: bypass blkcg_deactivate_policy after destroying blkcg_deactivate_policy() can be called after blkg_destroy_all() returns, and it isn't necessary since blkg_destroy_all has covered policy deactivation. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20231117023527.3188627-4-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 35a99d6557cacbc177314735342f77a2dda41872 Author: Ming Lei Date: Fri Nov 17 10:35:23 2023 +0800 blk-cgroup: avoid to warn !rcu_read_lock_held() in blkg_lookup() So far, all callers either holds spin lock or rcu read explicitly, and most of the caller has added WARN_ON_ONCE(!rcu_read_lock_held()) or lockdep_assert_held(&disk->queue->queue_lock). Remove WARN_ON_ONCE(!rcu_read_lock_held()) from blkg_lookup() for killing the false positive warning from blkg_conf_prep(). Reported-by: Changhui Zhong Fixes: 83462a6c971c ("blkcg: Drop unnecessary RCU read [un]locks from blkg_conf_prep/finish()") Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20231117023527.3188627-3-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 27b13e209ddca5979847a1b57890e0372c1edcee Author: Ming Lei Date: Fri Nov 17 10:35:22 2023 +0800 blk-throttle: fix lockdep warning of "cgroup_mutex or RCU read lock required!" Inside blkg_for_each_descendant_pre(), both css_for_each_descendant_pre() and blkg_lookup() requires RCU read lock, and either cgroup_assert_mutex_or_rcu_locked() or rcu_read_lock_held() is called. Fix the warning by adding rcu read lock. Reported-by: Changhui Zhong Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20231117023527.3188627-2-ming.lei@redhat.com Signed-off-by: Jens Axboe commit aa7e8e5e4011571022dc06e4d7a2f108feb53d1a Author: Maciej Strozek Date: Fri Nov 17 14:13:39 2023 +0000 ASoC: cs43130: Fix incorrect frame delay configuration Signed-off-by: Maciej Strozek Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20231117141344.64320-3-mstrozek@opensource.cirrus.com Signed-off-by: Mark Brown commit e7f289a59e76a5890a57bc27b198f69f175f75d9 Author: Maciej Strozek Date: Fri Nov 17 14:13:38 2023 +0000 ASoC: cs43130: Fix the position of const qualifier Signed-off-by: Maciej Strozek Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20231117141344.64320-2-mstrozek@opensource.cirrus.com Signed-off-by: Mark Brown commit 6bc40e44f1ddef16a787f3501b97f1fff909177c Merge: eb9a643c1739b 37f32f5264386 Author: Linus Torvalds Date: Fri Nov 17 09:18:48 2023 -0500 Merge tag 'ovl-fixes-6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs Pull overlayfs fixes from Amir Goldstein: "A fix to an overlayfs param parsing bug and a misformatted comment" * tag 'ovl-fixes-6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs: ovl: fix memory leak in ovl_parse_param() ovl: fix misformatted comment commit eb9a643c1739b732b90714131962bee76d279600 Merge: bf786e2a78d4d 5d639b60971f0 Author: Linus Torvalds Date: Fri Nov 17 09:05:31 2023 -0500 Merge tag 'sound-6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of small fixes: including a regression fix in RC1 wrt HD-audio / i915 component binding, while the rest are HD-audio device-speific fixes / quirks" * tag 'sound-6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek: Add quirks for HP Laptops ALSA: hda/realtek: Add quirks for ASUS 2024 Zenbooks ALSA: hda: i915: Alays handle -EPROBE_DEFER ALSA: hda/realtek: Enable Mute LED on HP 255 G10 ALSA: hda: cs35l56: Enable low-power hibernation mode on i2c ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC ALSA: hda/realtek: Enable Mute LED on HP 255 G8 ALSA: hda/realtek - Add Dell ALC295 to pin fall back table commit bf786e2a78d4d3cfc87469c3b31ade257df14fa0 Merge: 7475e51b87969 969d90ec212ba Author: Linus Torvalds Date: Fri Nov 17 08:42:05 2023 -0500 Merge tag 'audit-pr-20231116' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit fix from Paul Moore: "One small audit patch to convert a WARN_ON_ONCE() into a normal conditional to avoid scary looking console warnings when eBPF code generates audit records from unexpected places" * tag 'audit-pr-20231116' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare() commit f8ba14b780273fd290ddf7ee0d7d7decb44cc365 Author: Kamil Duljas Date: Thu Nov 16 23:41:13 2023 +0100 ASoC: Intel: Skylake: mem leak in skl register function skl_platform_register() uses krealloc. When krealloc is fail, then previous memory is not freed. The leak is also when soc component registration failed. Signed-off-by: Kamil Duljas Reviewed-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231116224112.2209-2-kamil.duljas@gmail.com Signed-off-by: Mark Brown commit 31e721fbd194d5723722eaa21df1d14cee7e12b5 Author: Kamil Duljas Date: Thu Nov 16 22:39:17 2023 +0100 ASoC: SOF: topology: Fix mem leak in sof_dai_load() The function has multiple return points at which it is not released previously allocated memory. Signed-off-by: Kamil Duljas Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20231116213926.2034-2-kamil.duljas@gmail.com Signed-off-by: Mark Brown commit c1501f2597dd08601acd42256a4b0a0fc36bf302 Author: David Lin Date: Fri Nov 17 12:30:12 2023 +0800 ASoC: nau8822: Fix incorrect type in assignment and cast to restricted __be16 This issue is reproduced when W=1 build in compiler gcc-12. The following are sparse warnings: sound/soc/codecs/nau8822.c:199:25: sparse: sparse: incorrect type in assignment sound/soc/codecs/nau8822.c:199:25: sparse: expected unsigned short sound/soc/codecs/nau8822.c:199:25: sparse: got restricted __be16 sound/soc/codecs/nau8822.c:235:25: sparse: sparse: cast to restricted __be16 sound/soc/codecs/nau8822.c:235:25: sparse: sparse: cast to restricted __be16 sound/soc/codecs/nau8822.c:235:25: sparse: sparse: cast to restricted __be16 sound/soc/codecs/nau8822.c:235:25: sparse: sparse: cast to restricted __be16 Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311122320.T1opZVkP-lkp@intel.com/ Signed-off-by: David Lin Link: https://lore.kernel.org/r/20231117043011.1747594-1-CTLIN0@nuvoton.com Signed-off-by: Mark Brown commit d5c65be34df73fa01ed05611aafb73b440d89e29 Author: Kamil Duljas Date: Thu Nov 16 13:51:50 2023 +0100 ASoC: Intel: Skylake: Fix mem leak in few functions The resources should be freed when function return error. Signed-off-by: Kamil Duljas Reviewed-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231116125150.1436-1-kamil.duljas@gmail.com Signed-off-by: Mark Brown commit 62b241efff99fc4d88a86f1c67c7516e31f432a3 Author: Gao Xiang Date: Fri Nov 17 16:53:29 2023 +0800 MAINTAINERS: erofs: add EROFS webpage Add a new `W:` field of the EROFS entry points to the documentation site at . In addition, update the in-tree documentation and Kconfig too. Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20231117085329.1624223-1-hsiangkao@linux.alibaba.com commit 8bd90b6ae7856dd5000b75691d905b39b9ea5d6b Author: Jingbo Xu Date: Tue Nov 14 15:07:04 2023 +0800 erofs: fix NULL dereference of dif->bdev_handle in fscache mode Avoid NULL dereference of dif->bdev_handle, as dif->bdev_handle is NULL in fscache mode. BUG: kernel NULL pointer dereference, address: 0000000000000000 RIP: 0010:erofs_map_dev+0xbd/0x1c0 Call Trace: erofs_fscache_data_read_slice+0xa7/0x340 erofs_fscache_data_read+0x11/0x30 erofs_fscache_readahead+0xd9/0x100 read_pages+0x47/0x1f0 page_cache_ra_order+0x1e5/0x270 filemap_get_pages+0xf2/0x5f0 filemap_read+0xb8/0x2e0 vfs_read+0x18d/0x2b0 ksys_read+0x53/0xd0 do_syscall_64+0x42/0xf0 entry_SYSCALL_64_after_hwframe+0x6e/0x76 Reported-by: Yiqun Leng Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7245 Fixes: 49845720080d ("erofs: Convert to use bdev_open_by_path()") Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang Reviewed-by: Yue Hu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20231114070704.23398-1-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang commit 914fa861e3d7803c9bbafc229652c2a69edb8b60 Author: Ferry Meng Date: Thu Nov 9 19:18:22 2023 +0800 erofs: simplify erofs_read_inode() After commit 1c7f49a76773 ("erofs: tidy up EROFS on-disk naming"), there is a unique `union erofs_inode_i_u` so that we could parse the union directly. Besides, it also replaces `inode->i_sb` with `sb` for simplicity. Signed-off-by: Ferry Meng Reviewed-by: Gao Xiang Reviewed-by: Yue Hu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20231109111822.17944-1-mengferry@linux.alibaba.com Signed-off-by: Gao Xiang commit 480713b1ba8eac4617936f8404da34bda991c30e Author: Mika Westerberg Date: Mon Nov 13 12:49:13 2023 +0200 thunderbolt: Only add device router DP IN to the head of the DP resource list When pairing DP IN and DP OUT adapters for DisplayPort tunneling, we should prioritize the possible external GPU DP IN adapters to take advantage of the its capabilities. However the commit in question did this for host router DP IN adapters too and that changes ordering of the initial DP IN resources in such way that resuming from suspend may end up using different resource and that may confuse the user. Fix this so that we only put DP IN adapters of device routers to the top of the resource list and leave host routers as is. Fixes: 274baf695b08 ("thunderbolt: Add DP IN added last in the head of the list of DP resources") Reported-by: Pengfei Xu Signed-off-by: Mika Westerberg commit 5391bcfa56c79a891734e4d22aa0ca3217b86491 Author: Mika Westerberg Date: Tue Nov 7 14:34:27 2023 +0200 thunderbolt: Send uevent after asymmetric/symmetric switch We should send uevent to userspace whenever the link speed or width changes but tb_switch_asym_enable() and tb_switch_asym_disable() set the sw->link_width already so tb_switch_update_link_attributes() never noticed the change. Fix this so that we let tb_switch_update_link_attributes() update the fields accordingly. Fixes: 81af2952e606 ("thunderbolt: Add support for asymmetric link") Reported-by: Pengfei Xu Tested-by: Pengfei Xu Signed-off-by: Mika Westerberg commit 24d85bb3be373b5831699bddf698b392bd2b904d Author: Gil Fine Date: Tue Nov 7 12:22:40 2023 +0200 thunderbolt: Set lane bonding bit only for downstream port Fix the lane bonding procedure to follow the steps described in USB4 Connection Manager guide. Hence, set the lane bonding bit only for downstream port. This is needed for certain ASMedia device, otherwise lane bonding fails and the device disconnects. Cc: stable@vger.kernel.org Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 86d8f905f24d223e15587365f07849635458c5d9 Merge: 63957f6beba07 e8c2d3e25b844 Author: Daniel Vetter Date: Fri Nov 17 11:46:06 2023 +0100 Merge tag 'amd-drm-fixes-6.7-2023-11-17' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-6.7-2023-11-17: amdgpu: - DMCUB fixes - SR-IOV fix - GMC9 fix - Documentation fix - DSC MST fix - CS chunk parsing fix - SMU13.0.6 fixes - 8K tiled display fix - Fix potential NULL pointer dereferences - Cursor lag fix - Backlight fix - DCN s0ix fix - XGMI fix - DCN encoder disable logic fix - AGP aperture fixes Signed-off-by: Daniel Vetter From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20231117063441.4883-1-alexander.deucher@amd.com commit 63957f6beba0771a1cf0545a491479d20fdc492b Merge: b85ea95d08647 ae1aadb1eb8d3 Author: Daniel Vetter Date: Fri Nov 17 11:04:52 2023 +0100 Merge tag 'drm-misc-fixes-2023-11-16' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Assorted fixes for v6.7-rc2: - Nouveau GSP fixes. - Fix nouveau driver load without display. - Use rwlock for nouveau's event lock to break a lockdep splat. - Add orientation quirk for Lenovo Legion Go. - Fix build failure in IVPU. Signed-off-by: Daniel Vetter From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/98fc82d3-8714-45e7-bd12-c95ba8c6c35f@linux.intel.com commit c6ea14d557343cd3af6c6be2f5a78c98bdb281bb Author: Shyam Sundar S K Date: Thu Nov 16 22:31:21 2023 +0530 platform/x86/amd/pmc: adjust getting DRAM size behavior amd_pmc_get_dram_size() is used to get the DRAM size information. But in the current code, mailbox command to get the DRAM size info is sent based on the values of dev->major and dev->minor. But dev->major and dev->minor will have either junk or zero assigned to them until at least once a call to amd_pmc_get_smu_version() is made which ideally populates dev->major and dev->minor. However, adding a amd_pmc_get_smu_version() call to amd_pmc_get_dram_size() has a downside of elevating the boot times. After talking to the PMFW team, it's understood that the "get dram size" mbox command would only be supported on specific platforms (like Mendocino) and not all. So, adjust getting DRAM size behavior such that, - if running on Rembrandt or Mendocino and the underlying PMFW knows how to execute the "get dram size" command it shall give the custom dram size. - if the underlying FW does not report the dram size, we just proceed further and assign the default dram size. The simplest way to address this is to remove amd_pmc_get_dram_size() function and directly call the "get dram size" command in the amd_pmc_s2d_init(). Reported-by: Mark Hasemeyer Fixes: be8325fb3d8c ("platform/x86/amd: pmc: Get STB DRAM size from PMFW") Cc: stable@vger.kernel.org Suggested-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20231116170121.3372222-1-Shyam-sundar.S-k@amd.com Reviewed-by: Mario Limonciello Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 295b202227e98edb2fb5cc29b6ec4b96b2792d9c Author: Gustavo A. R. Silva Date: Thu Nov 16 12:54:59 2023 -0600 xen: privcmd: Replace zero-length array with flex-array member and use __counted_by Fake flexible arrays (zero-length and one-element arrays) are deprecated, and should be replaced by flexible-array members. So, replace zero-length array with a flexible-array member in `struct privcmd_kernel_ioreq`. Also annotate array `ports` with `__counted_by()` to prepare for the coming implementation by GCC and Clang of the `__counted_by` attribute. Flexible array members annotated with `__counted_by` can have their accesses bounds-checked at run-time via `CONFIG_UBSAN_BOUNDS` (for array indexing) and `CONFIG_FORTIFY_SOURCE` (for strcpy/memcpy-family functions). This fixes multiple -Warray-bounds warnings: drivers/xen/privcmd.c:1239:30: warning: array subscript i is outside array bounds of 'struct ioreq_port[0]' [-Warray-bounds=] drivers/xen/privcmd.c:1240:30: warning: array subscript i is outside array bounds of 'struct ioreq_port[0]' [-Warray-bounds=] drivers/xen/privcmd.c:1241:30: warning: array subscript i is outside array bounds of 'struct ioreq_port[0]' [-Warray-bounds=] drivers/xen/privcmd.c:1245:33: warning: array subscript i is outside array bounds of 'struct ioreq_port[0]' [-Warray-bounds=] drivers/xen/privcmd.c:1258:67: warning: array subscript i is outside array bounds of 'struct ioreq_port[0]' [-Warray-bounds=] This results in no differences in binary output. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/ZVZlg3tPMPCRdteh@work Signed-off-by: Juergen Gross commit 2a842c4e2f76736f4ed2da9f02ca3ae3330d6b11 Author: Sascha Hauer Date: Wed Oct 18 08:17:11 2023 +0200 dt-bindings: soc: rockchip: grf: add rockchip,rk3588-pmugrf Add rockchip,rk3588-pmugrf compatible string. Acked-by: Conor Dooley Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20231018061714.3553817-24-s.hauer@pengutronix.de Signed-off-by: Heiko Stuebner commit bff2a2d453a1b683378b4508b86b84389f551a00 Author: Keith Busch Date: Mon Nov 6 18:12:30 2023 +0100 swiotlb-xen: provide the "max_mapping_size" method There's a bug that when using the XEN hypervisor with bios with large multi-page bio vectors on NVMe, the kernel deadlocks [1]. The deadlocks are caused by inability to map a large bio vector - dma_map_sgtable always returns an error, this gets propagated to the block layer as BLK_STS_RESOURCE and the block layer retries the request indefinitely. XEN uses the swiotlb framework to map discontiguous pages into contiguous runs that are submitted to the PCIe device. The swiotlb framework has a limitation on the length of a mapping - this needs to be announced with the max_mapping_size method to make sure that the hardware drivers do not create larger mappings. Without max_mapping_size, the NVMe block driver would create large mappings that overrun the maximum mapping size. Reported-by: Marek Marczykowski-Górecki Link: https://lore.kernel.org/stable/ZTNH0qtmint%2FzLJZ@mail-itl/ [1] Tested-by: Marek Marczykowski-Górecki Suggested-by: Christoph Hellwig Cc: stable@vger.kernel.org Signed-off-by: Keith Busch Signed-off-by: Mikulas Patocka Acked-by: Stefano Stabellini Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/151bef41-e817-aea9-675-a35fdac4ed@redhat.com Signed-off-by: Juergen Gross commit 2a4ca1b4b77850544408595e2433f5d7811a9daa Author: David Howells Date: Thu Jun 8 09:43:54 2023 +0100 afs: Make error on cell lookup failure consistent with OpenAFS When kafs tries to look up a cell in the DNS or the local config, it will translate a lookup failure into EDESTADDRREQ whereas OpenAFS translates it into ENOENT. Applications such as West expect the latter behaviour and fail if they see the former. This can be seen by trying to mount an unknown cell: # mount -t afs %example.com:cell.root /mnt mount: /mnt: mount(2) system call failed: Destination address required. Fixes: 4d673da14533 ("afs: Support the AFS dynamic root") Reported-by: Markus Suvanto Link: https://bugzilla.kernel.org/show_bug.cgi?id=216637 Signed-off-by: David Howells Reviewed-by: Jeffrey Altman cc: Marc Dionne cc: linux-afs@lists.infradead.org commit e6bace7313d61e31f2b16fa3d774fd8cb3cb869e Author: David Howells Date: Thu Nov 2 16:26:59 2023 +0000 afs: Fix afs_server_list to be cleaned up with RCU afs_server_list is accessed with the rcu_read_lock() held from volume->servers, so it needs to be cleaned up correctly. Fix this by using kfree_rcu() instead of kfree(). Fixes: 8a070a964877 ("afs: Detect cell aliases 1 - Cells with root volumes") Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org commit e8c2d3e25b844ad8f7c8b269a7cfd65285329264 Author: Alex Deucher Date: Thu Nov 9 15:40:00 2023 -0500 drm/amdgpu/gmc9: disable AGP aperture We've had misc reports of random IOMMU page faults when this is used. It's just a rarely used optimization anyway, so let's just disable it. It can still be toggled via the module parameter for testing. v2: leave it configurable via module parameter Reviewed-by: Yang Wang (v1) Acked-by: Christian König Reviewed-by: Mario Limonciello Tested-by: Mario Limonciello # PHX & Navi33 Signed-off-by: Alex Deucher commit 61fc93695bbfde218d5f9f0b8051ce36eb649669 Author: Alex Deucher Date: Thu Nov 9 15:38:54 2023 -0500 drm/amdgpu/gmc10: disable AGP aperture We've had misc reports of random IOMMU page faults when this is used. It's just a rarely used optimization anyway, so let's just disable it. It can still be toggled via the module parameter for testing. v2: leave it configurable via module parameter Reviewed-by: Yang Wang (v1) Acked-by: Christian König Reviewed-by: Mario Limonciello Tested-by: Mario Limonciello # PHX & Navi33 Signed-off-by: Alex Deucher commit 0db062eac3e0846c6f120867a79df83b4c3db46f Author: Alex Deucher Date: Thu Nov 9 15:34:19 2023 -0500 drm/amdgpu/gmc11: disable AGP aperture We've had misc reports of random IOMMU page faults when this is used. It's just a rarely used optimization anyway, so let's just disable it. It can still be toggled via the module parameter for testing. v2: leave it configurable via module parameter Fixes: 67318cb84341 ("drm/amdgpu/gmc11: set gart placement GC11") Reviewed-by: Yang Wang (v1) Acked-by: Christian König Reviewed-by: Mario Limonciello Tested-by: Mario Limonciello # PHX & Navi33 Signed-off-by: Alex Deucher commit 6ba5b613837c5d997ad8297b22fc46cd0be58d76 Author: Alex Deucher Date: Thu Nov 9 15:31:00 2023 -0500 drm/amdgpu: add a module parameter to control the AGP aperture Add a module parameter to control the AGP aperture. The AGP aperture is an aperture in the GPU's internal address space which provides direct non-paged access to the platform address space. This access is non-snooped so only uncached memory can be accessed. Add a knob so that we can toggle this for debugging. Fixes: 67318cb84341 ("drm/amdgpu/gmc11: set gart placement GC11") Acked-by: Christian König Reviewed-by: Mario Limonciello Tested-by: Mario Limonciello # PHX & Navi33 Signed-off-by: Alex Deucher commit 564ca1b53ece166b5915c2ac90f3e9313100f4ea Author: Alex Deucher Date: Tue Nov 14 11:36:56 2023 -0500 drm/amdgpu/gmc11: fix logic typo in AGP check Should be && rather than ||. Fixes: b2e1cbe6281f ("drm/amdgpu/gmc11: disable AGP on GC 11.5") Acked-by: Christian König Reviewed-by: Mario Limonciello Tested-by: Mario Limonciello # PHX & Navi33 Signed-off-by: Alex Deucher commit 0ee057e66c4b782809a0a9265cdac5542e646706 Author: Nicholas Susanto Date: Wed Nov 1 15:30:10 2023 -0400 drm/amd/display: Fix encoder disable logic [WHY] DENTIST hangs when OTG is off and encoder is on. We were not disabling the encoder properly when switching from extended mode to external monitor only. [HOW] Disable the encoder using an existing enable/disable fifo helper instead of enc35_stream_encoder_enable. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Nicholas Kazlauskas Acked-by: Alex Hung Signed-off-by: Nicholas Susanto Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5911d02cac70d7fb52009fbd37423e63f8f6f9bc Author: Lewis Huang Date: Thu Oct 19 17:22:21 2023 +0800 drm/amd/display: Change the DMCUB mailbox memory location from FB to inbox [WHY] Flush command sent to DMCUB spends more time for execution on a dGPU than on an APU. This causes cursor lag when using high refresh rate mouses. [HOW] 1. Change the DMCUB mailbox memory location from FB to inbox. 2. Only change windows memory to inbox. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Nicholas Kazlauskas Acked-by: Alex Hung Signed-off-by: Lewis Huang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9ddea8c9775d9379d71e6ac1519c552461b90b07 Author: Shiwu Zhang Date: Tue Oct 31 11:02:49 2023 +0800 drm/amdgpu: add and populate the port num into xgmi topology info The port num info is firstly introduced with 20.00.01.13 xgmi ta and make them as part of topology info. Signed-off-by: Shiwu Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 5e8a0d3598b47ee5a57708072bdef08816264538 Author: Duncan Ma Date: Wed Oct 25 19:07:21 2023 -0400 drm/amd/display: Negate IPS allow and commit bits [WHY] On s0i3, IPS mask isn't saved and restored. It is reset to zero on exit. If it is cleared unexpectedly, driver will proceed operations while DCN is in IPS2 and cause a hang. [HOW] Negate the bit logic. Default value of zero indicates it is still in IPS2. Driver must poll for the bit to assert. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Charlene Liu Acked-by: Alex Hung Signed-off-by: Duncan Ma Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0f216364625cb453b4f933deacfa92df7f2a2fc9 Author: Lijo Lazar Date: Fri Nov 10 13:15:39 2023 +0530 drm/amd/pm: Don't send unload message for reset No need to notify about unload during reset. Also remove the FW version check. Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit 07ee43faeb7eb088e49a7549fcabcae94c443d3b Author: Yang Wang Date: Mon Nov 13 14:34:55 2023 +0800 drm/amdgpu: fix ras err_data null pointer issue in amdgpu_ras.c fix ras err_data null pointer issue in amdgpu_ras.c Fixes: 8cc0f5669eb6 ("drm/amdgpu: Support multiple error query modes") Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 923bbfe6c888812db1088d684bd30c24036226d2 Author: Paul Hsieh Date: Wed Oct 25 10:53:35 2023 +0800 drm/amd/display: Clear dpcd_sink_ext_caps if not set [WHY] Some eDP panels' ext caps don't set initial values and the value of dpcd_addr (0x317) is random. It means that sometimes the eDP can be OLED, miniLED and etc, and cause incorrect backlight control interface. [HOW] Add remove_sink_ext_caps to remove sink ext caps (HDR, OLED and etc) Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Anthony Koo Acked-by: Alex Hung Signed-off-by: Paul Hsieh Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 435f5b369657cffee4b04db1f5805b48599f4dbe Author: Tianci Yin Date: Wed Nov 1 09:47:13 2023 +0800 drm/amd/display: Enable fast plane updates on DCN3.2 and above [WHY] When cursor moves across screen boarder, lag cursor observed, since subvp settings need to sync up with vblank that causes cursor updates being delayed. [HOW] Enable fast plane updates on DCN3.2 to fix it. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Aurabindo Pillai Acked-by: Alex Hung Signed-off-by: Tianci Yin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 270b301beca58e427a0fda7523a71a9562e644bb Author: José Pekkarinen Date: Tue Nov 14 17:27:51 2023 +0200 drm/amd/display: fix NULL dereference The following patch will fix a minor issue where a debug message is referencing an struct that has just being checked whether is null or not. This has been noticed by using coccinelle, in the following output: drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c:540:25-29: ERROR: aconnector is NULL but dereferenced. Fixes: 5d72e247e58c ("drm/amd/display: switch DC over to the new DRM logging macros") Signed-off-by: José Pekkarinen Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit b71f4ade1b8900d30c661d6c27f87c35214c398c Author: Mario Limonciello Date: Wed Nov 8 13:31:57 2023 -0600 drm/amd/display: fix a NULL pointer dereference in amdgpu_dm_i2c_xfer() When ddc_service_construct() is called, it explicitly checks both the link type and whether there is something on the link which will dictate whether the pin is marked as hw_supported. If the pin isn't set or the link is not set (such as from unloading/reloading amdgpu in an IGT test) then fail the amdgpu_dm_i2c_xfer() call. Cc: stable@vger.kernel.org Fixes: 22676bc500c2 ("drm/amd/display: Fix dmub soft hang for PSR 1") Link: https://github.com/fwupd/fwupd/issues/6327 Signed-off-by: Mario Limonciello Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 9725a4f9eb495bfa6c7f5ccdb49440ff06dba0a1 Author: Muhammad Ahmed Date: Tue Oct 31 16:03:21 2023 -0400 drm/amd/display: Add null checks for 8K60 lightup [WHY & HOW] Add some null checks to fix an issue where 8k60 tiled display fails to light up. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Charlene Liu Acked-by: Alex Hung Signed-off-by: Muhammad Ahmed Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e4d0be18243ca006258b5c7c148796c0b43505c4 Author: Asad Kamal Date: Tue Nov 14 16:17:17 2023 +0800 drm/amd/pm: Fill pcie error counters for gpu v1_4 Fill PCIE error counters & instantaneous bandwidth in gpu metrics v1_4 for smu v_13_0_6 Signed-off-by: Asad Kamal Reviewed-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 786c355797b3942725829d02ce9e2e6a9eba11fe Author: Asad Kamal Date: Tue Oct 31 03:14:02 2023 +0800 drm/amd/pm: Update metric table for smu v13_0_6 Update pmfw metric table to include pcie instantaneous bandwidth & pcie error counters Signed-off-by: Asad Kamal Reviewed-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 50d51374b498457c4dea26779d32ccfed12ddaff Author: YuanShang Date: Tue Oct 31 10:32:37 2023 +0800 drm/amdgpu: correct chunk_ptr to a pointer to chunk. The variable "chunk_ptr" should be a pointer pointing to a struct drm_amdgpu_cs_chunk instead of to a pointer of that. Signed-off-by: YuanShang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit a58555359a9f870543aaddef277c3396159895ce Author: Fangzhi Zuo Date: Mon Oct 23 13:57:32 2023 -0400 drm/amd/display: Fix DSC not Enabled on Direct MST Sink [WHY & HOW] For the scenario when a dsc capable MST sink device is directly connected, it needs to use max dsc compression as the link bw constraint. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Roman Li Acked-by: Alex Hung Signed-off-by: Fangzhi Zuo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8a0173cd90984835645022bf1997abd1bcd81aae Author: Srinivasan Shanmugam Date: Sun Nov 12 09:51:19 2023 +0530 drm/amdgpu: Address member 'ring' not described in 'amdgpu_ vce, uvd_entity_init()' Fixes the following: drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c:237: warning: Function parameter or member 'ring' not described in 'amdgpu_vce_entity_init' drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:405: warning: Function parameter or member 'ring' not described in 'amdgpu_uvd_entity_init' Cc: Christian König Cc: Alex Deucher Cc: "Pan, Xinhui" Signed-off-by: Srinivasan Shanmugam Reviewed-by: Christian König Signed-off-by: Alex Deucher commit bdb72185d310fc8049c7ea95221d640e9e7165e5 Author: Le Ma Date: Mon Nov 13 18:05:34 2023 +0800 drm/amdgpu: finalizing mem_partitions at the end of GMC v9 sw_fini The valid num_mem_partitions is required during ttm pool fini, thus move the cleanup at the end of the function. Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 0288603040c38ccfeb5342f34a52673366d90038 Author: Victor Lu Date: Wed Oct 4 14:24:15 2023 -0400 drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2) MC_VM_AGP_* registers should not be programmed by guest driver. v2: move early return outside of loop Signed-off-by: Victor Lu Reviewed-by: Samir Dhume Signed-off-by: Alex Deucher commit 1ffa8602e39b89469dc703ebab7a7e44c33da0f7 Author: Nicholas Kazlauskas Date: Wed Sep 13 16:18:44 2023 -0400 drm/amd/display: Guard against invalid RPTR/WPTR being set [WHY] HW can return invalid values on register read, guard against these being set and causing us to access memory out of range and page fault. [HOW] Guard at sync_inbox1 and guard at pushing commands. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Hansen Dsouza Acked-by: Alex Hung Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ae1eff0349f2e908fc083630e8441ea6dc434dc0 Author: Masahiro Yamada Date: Wed Nov 15 13:16:53 2023 +0900 kconfig: fix memory leak from range properties Currently, sym_validate_range() duplicates the range string using xstrdup(), which is overwritten by a subsequent sym_calc_value() call. It results in a memory leak. Instead, only the pointer should be copied. Below is a test case, with a summary from Valgrind. [Test Kconfig] config FOO int "foo" range 10 20 [Test .config] CONFIG_FOO=0 [Before] LEAK SUMMARY: definitely lost: 3 bytes in 1 blocks indirectly lost: 0 bytes in 0 blocks possibly lost: 0 bytes in 0 blocks still reachable: 17,465 bytes in 21 blocks suppressed: 0 bytes in 0 blocks [After] LEAK SUMMARY: definitely lost: 0 bytes in 0 blocks indirectly lost: 0 bytes in 0 blocks possibly lost: 0 bytes in 0 blocks still reachable: 17,462 bytes in 20 blocks suppressed: 0 bytes in 0 blocks Signed-off-by: Masahiro Yamada commit 76020731d4ee897411ce4a73916ed805ea15d946 Author: Simon Glass Date: Fri Nov 10 17:28:01 2023 -0700 kbuild: Move the single quotes for image name Add quotes where UIMAGE_NAME is used, rather than where it is defined. This allows the UIMAGE_NAME variable to be set by the user. Signed-off-by: Simon Glass Signed-off-by: Masahiro Yamada commit 9e0be3f50c0e8517d0238b62409c20bcb8cd8785 Author: Lukas Bulwahn Date: Fri Nov 10 13:07:22 2023 +0100 linux/export: clean up the IA-64 KSYM_FUNC macro With commit cf8e8658100d ("arch: Remove Itanium (IA-64) architecture"), there is no need to keep the IA-64 definition of the KSYM_FUNC macro. Clean up the IA-64 definition of the KSYM_FUNC macro. Signed-off-by: Lukas Bulwahn Reviewed-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit 76df934c6d5f5c93ba7a0112b1818620ddc10b19 Author: Kees Cook Date: Thu Nov 16 12:11:51 2023 -0800 MAINTAINERS: Add netdev subsystem profile link The netdev subsystem has had a subsystem process document for a while now. Link it appropriately in MAINTAINERS with the P: tag. Cc: Jakub Kicinski Cc: "David S. Miller" Cc: Eric Dumazet Cc: Paolo Abeni Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit 3c15504a97a1bcabec5459e604dcc20c7313c8ea Merge: 75a50c4f5b957 1a01319feef70 Author: David S. Miller Date: Fri Nov 17 02:50:33 2023 +0000 Merge branch 'rxrpc-ack-fixes' David Howells says: ==================== rxrpc: ACK handling fixes Here are a couple of patches to fix ACK handling in AF_RXRPC: (1) Allow RTT determination to use an ACK of any type as the response from which to calculate RTT, provided ack.serial matches the serial number of the outgoing packet. (2) Defer the response to a PING ACK packet (or any ACK with the REQUEST_ACK flag set) until after we've parsed the packet so that we carry up to date information if the Tx or Rx rings are advanced. ==================== Signed-off-by: David S. Miller commit 1a01319feef7047aa2ba400ffa3e047776aa29ca Author: David Howells Date: Thu Nov 16 13:12:59 2023 +0000 rxrpc: Defer the response to a PING ACK until we've parsed it Defer the generation of a PING RESPONSE ACK in response to a PING ACK until we've parsed the PING ACK so that we pick up any changes to the packet queue so that we can update ackinfo. This is also applied to an ACK generated in response to an ACK with the REQUEST_ACK flag set. Note that whilst the problem was added in commit 248f219cb8bc, it didn't really matter at that point because the ACK was proposed in softirq mode and generated asynchronously later in process context, taking the latest values at the time. But this fix is only needed since the move to parse incoming packets in an I/O thread rather than in softirq and generate the ACK at point of proposal (b0346843b1076b34a0278ff601f8f287535cb064). Fixes: 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code") Signed-off-by: David Howells cc: Marc Dionne cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-afs@lists.infradead.org cc: netdev@vger.kernel.org Signed-off-by: David S. Miller commit 3798680f2fbbe0ca3ab6138b34e0d161c36497ee Author: David Howells Date: Thu Nov 16 13:12:58 2023 +0000 rxrpc: Fix RTT determination to use any ACK as a source Fix RTT determination to be able to use any type of ACK as the response from which RTT can be calculated provided its ack.serial is non-zero and matches the serial number of an outgoing DATA or ACK packet. This shouldn't be limited to REQUESTED-type ACKs as these can have other types substituted for them for things like duplicate or out-of-order packets. Fixes: 4700c4d80b7b ("rxrpc: Fix loss of RTT samples due to interposed ACK") Signed-off-by: David Howells cc: Marc Dionne cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-afs@lists.infradead.org cc: netdev@vger.kernel.org Signed-off-by: David S. Miller commit 75a50c4f5b957a34dedb7c8cce52b582a9162828 Author: Paolo Abeni Date: Thu Nov 16 18:01:41 2023 +0100 kselftest: rtnetlink: fix ip route command typo The blamed commit below introduced a typo causing 'gretap' test-case failures: ./rtnetlink.sh -t kci_test_gretap -v COMMAND: ip link add name test-dummy0 type dummy COMMAND: ip link set test-dummy0 up COMMAND: ip netns add testns COMMAND: ip link help gretap 2>&1 | grep -q '^Usage:' COMMAND: ip -netns testns link add dev gretap00 type gretap seq key 102 local 172.16.1.100 remote 172.16.1.200 COMMAND: ip -netns testns addr add dev gretap00 10.1.1.100/24 COMMAND: ip -netns testns link set dev gretap00 ups Error: either "dev" is duplicate, or "ups" is a garbage. COMMAND: ip -netns testns link del gretap00 COMMAND: ip -netns testns link add dev gretap00 type gretap external COMMAND: ip -netns testns link del gretap00 FAIL: gretap Fix it by using the correct keyword. Fixes: 9c2a19f71515 ("kselftest: rtnetlink.sh: add verbose flag") Signed-off-by: Paolo Abeni Reviewed-by: Hangbin Liu Signed-off-by: David S. Miller commit d565fa4300d9ebd5ba3bbd259ce841f8dab609d6 Author: Gerd Bayer Date: Wed Nov 15 16:59:58 2023 +0100 s390/ism: ism driver implies smc protocol Since commit a72178cfe855 ("net/smc: Fix dependency of SMC on ISM") you can build the ism code without selecting the SMC network protocol. That leaves some ism functions be reported as unused. Move these functions under the conditional compile with CONFIG_SMC. Also codify the suggestion to also configure the SMC protocol in ism's Kconfig - but with an "imply" rather than a "select" as SMC depends on other config options and allow for a deliberate decision not to build SMC. Also, mention that in ISM's help. Fixes: a72178cfe855 ("net/smc: Fix dependency of SMC on ISM") Reported-by: Randy Dunlap Closes: https://lore.kernel.org/netdev/afd142a2-1fa0-46b9-8b2d-7652d41d3ab8@infradead.org/ Signed-off-by: Gerd Bayer Reviewed-by: Wenjia Zhang Reviewed-by: Simon Horman Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Signed-off-by: David S. Miller commit 0c3bd086d12d185650d095a906662593ec607bd0 Author: David Howells Date: Wed Nov 15 17:15:40 2023 +0000 rxrpc: Fix some minor issues with bundle tracing Fix some superficial issues with the tracing of rxrpc_bundle structs, including: (1) Set the debug_id when the bundle is allocated rather than when it is set up so that the "NEW" trace line displays the correct bundle ID. (2) Show the refcount when emitting the "FREE" traceline. Signed-off-by: David Howells cc: Marc Dionne cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-afs@lists.infradead.org cc: netdev@vger.kernel.org Signed-off-by: David S. Miller commit 7fbd5fc2b35a8f559a6b380dfa9bcd964a758186 Author: Jean Delvare Date: Wed Nov 15 11:53:31 2023 +0100 stmmac: dwmac-loongson: Add architecture dependency Only present the DWMAC_LOONGSON option on architectures where it can actually be used. This follows the same logic as the DWMAC_INTEL option. Signed-off-by: Jean Delvare Cc: Keguang Zhang Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit ccab434e674ca95d483788b1895a70c21b7f016a Author: Oliver Neukum Date: Wed Nov 15 11:08:57 2023 +0100 usb: aqc111: check packet for fixup for true limit If a device sends a packet that is inbetween 0 and sizeof(u64) the value passed to skb_trim() as length will wrap around ending up as some very large value. The driver will then proceed to parse the header located at that position, which will either oops or process some random value. The fix is to check against sizeof(u64) rather than 0, which the driver currently does. The issue exists since the introduction of the driver. Signed-off-by: Oliver Neukum Signed-off-by: David S. Miller commit ba276ce5865b5a22ee96c4c5664bfefd9c1bb593 Author: Kent Overstreet Date: Tue Nov 14 19:11:04 2023 -0500 bcachefs: Fix missing locking for dentry->d_parent access Reported-by: Al Viro Signed-off-by: Kent Overstreet commit e80ed63affc9a9b4aacb44180ecd7ed601839599 Author: Conor Dooley Date: Tue Oct 24 09:20:35 2023 +0100 riscv: dts: sophgo: remove address-cells from intc node A recent submission [1] from Rob has added additionalProperties: false to the interrupt-controller child node of RISC-V cpus, highlighting that the new cv1800b DT has been incorrectly using #address-cells. It has no child nodes, so #address-cells is not needed. Remove it. Link: https://patchwork.kernel.org/project/linux-riscv/patch/20230915201946.4184468-1-robh@kernel.org/ [1] Fixes: c3dffa879cca ("riscv: dts: sophgo: add initial CV1800B SoC device tree") Reviewed-by: Jisheng Zhang Acked-by: Chen Wang Signed-off-by: Conor Dooley commit 21133266ca12f82b6e59c9711258cca2097c167c Author: Dmitry Baryshkov Date: Wed Oct 25 12:23:10 2023 +0300 drm/msm/dp: attach the DP subconnector property While developing and testing the commit bfcc3d8f94f4 ("drm/msm/dp: support setting the DP subconnector type") I had the patch [1] in my tree. I haven't noticed that it was a dependency for the commit in question. Mea culpa. Since the patch has not landed yet (and even was not reviewed) and since one of the bridges erroneously uses USB connector type instead of DP, attach the property directly from the MSM DP driver. This fixes the following oops on DP HPD event: drm_object_property_set_value (drivers/gpu/drm/drm_mode_object.c:288) dp_display_process_hpd_high (drivers/gpu/drm/msm/dp/dp_display.c:402) dp_hpd_plug_handle.isra.0 (drivers/gpu/drm/msm/dp/dp_display.c:604) hpd_event_thread (drivers/gpu/drm/msm/dp/dp_display.c:1110) kthread (kernel/kthread.c:388) ret_from_fork (arch/arm64/kernel/entry.S:858) [1] https://patchwork.freedesktop.org/patch/555530/ Fixes: bfcc3d8f94f4 ("drm/msm/dp: support setting the DP subconnector type") Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Tested-by: Jessica Zhang # SC7280 Reviewed-by: Johan Hovold Tested-by: Johan Hovold Patchwork: https://patchwork.freedesktop.org/patch/564286/ Link: https://lore.kernel.org/r/20231025092711.851168-3-dmitry.baryshkov@linaro.org Signed-off-by: Abhinav Kumar commit ebfa85c504cb34f2fd3257c6f5d54158a0ff1bf6 Author: Abel Vesa Date: Wed Oct 25 12:23:09 2023 +0300 drm/msm/dp: don't touch DP subconnector property in eDP case In case of the eDP connection there is no subconnetor and as such no subconnector property. Put drm_dp_set_subconnector_property() calls under the !is_edp condition. Fixes: bfcc3d8f94f4 ("drm/msm/dp: support setting the DP subconnector type") Signed-off-by: Abel Vesa Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Tested-by: Jessica Zhang # SC7280 Reviewed-by: Johan Hovold Tested-by: Johan Hovold Patchwork: https://patchwork.freedesktop.org/patch/564284/ Link: https://lore.kernel.org/r/20231025092711.851168-2-dmitry.baryshkov@linaro.org Signed-off-by: Abhinav Kumar commit a33b2431d11b4df137bbcfdd5a5adfa054c2479e Author: Bjorn Andersson Date: Mon Oct 30 16:23:20 2023 -0700 drm/msm/dpu: Add missing safe_lut_tbl in sc8280xp catalog During USB transfers on the SC8280XP __arm_smmu_tlb_sync() is seen to typically take 1-2ms to complete. As expected this results in poor performance, something that has been mitigated by proposing running the iommu in non-strict mode (boot with iommu.strict=0). This turns out to be related to the SAFE logic, and programming the QOS SAFE values in the DPU (per suggestion from Rob and Doug) reduces the TLB sync time to below 10us, which means significant less time spent with interrupts disabled and a significant boost in throughput. Fixes: 4a352c2fc15a ("drm/msm/dpu: Introduce SC8280XP") Cc: stable@vger.kernel.org Suggested-by: Doug Anderson Suggested-by: Rob Clark Signed-off-by: Bjorn Andersson Tested-by: Johan Hovold Tested-by: Steev Klimaszewski Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/565094/ Link: https://lore.kernel.org/r/20231030-sc8280xp-dpu-safe-lut-v1-1-6d485d7b428f@quicinc.com Signed-off-by: Abhinav Kumar commit 3944e343e54b93d3fef30eacc4738e77fdf5444e Author: Dmitry Baryshkov Date: Tue Nov 7 13:14:13 2023 +0200 drm/msm: remove exra drm_kms_helper_poll_init() call It seems during rebases I have left a call to drm_kms_helper_poll_init() which is not guarded by the (priv->kms_init) check. This leads to the crash for the boards which don't have KMS output. Drop this call, as there is a correctly guarded one next to the one being removed. Fixes: 506efcba3129 ("drm/msm: carve out KMS code from msm_drv.c") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/566299/ Link: https://lore.kernel.org/r/20231107111413.2212942-1-dmitry.baryshkov@linaro.org Signed-off-by: Abhinav Kumar commit b3e0f94d15700ac8e8c1c2355834f5d5c753c41d Author: Jonathan Marek Date: Thu Nov 9 19:02:14 2023 -0500 drm/msm/dsi: use the correct VREG_CTRL_1 value for 4nm cphy Use the same value as the downstream driver. This change is needed for CPHY mode to work correctly. Fixes: 8b034e677111 ("drm/msm/dsi: add support for DSI-PHY on SM8550") Signed-off-by: Jonathan Marek Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/566987/ Link: https://lore.kernel.org/r/20231110000216.29979-1-jonathan@marek.ca Signed-off-by: Abhinav Kumar commit c6c5a5580dcb6631aa6369dabe12ef3ce784d1d2 Author: Weihao Li Date: Tue Oct 31 19:18:16 2023 +0800 clk: rockchip: rk3128: Fix HCLK_OTG gate register The HCLK_OTG gate control is in CRU_CLKGATE5_CON, not CRU_CLKGATE3_CON. Signed-off-by: Weihao Li Link: https://lore.kernel.org/r/20231031111816.8777-1-cn.liweihao@gmail.com Signed-off-by: Heiko Stuebner commit 1af27671f62ce919f1fb76082ed81f71cb090989 Author: Chris Morgan Date: Wed Oct 18 10:33:55 2023 -0500 clk: rockchip: rk3568: Add PLL rate for 292.5MHz Add support for a PLL rate of 292.5MHz so that the Powkiddy RGB30 panel can run at a requested 60hz (59.96, close enough). I have confirmed this rate fits with all the constraints listed in the TRM for the VPLL (as an integer PLL) in Part 1 "Chapter 2 Clock & Reset Unit (CRU)." Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20231018153357.343142-2-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 3cee9c635f27d1003d46f624d816f3455698b625 Author: Heiko Stuebner Date: Tue Nov 14 16:38:34 2023 +0100 arm64: dts: rockchip: fix rk356x pcie msg interrupt name The expected name by the binding at this position is "msg" and the SoC's manual also calls the interrupt in question "msg", so fix the rk356x dtsi to use the correct name. Reviewed-by: Sebastian Reichel Signed-off-by: Heiko Stuebner Link: https://lore.kernel.org/r/20231114153834.934978-1-heiko@sntech.de commit 35938c18291b5da7422b2fac6dac0af11aa8d0d7 Author: Alex Bee Date: Sun Nov 5 23:36:16 2023 +0000 arm64: dts: rockchip: Expand reg size of vdec node for RK3399 Expand the reg size for the vdec node to include cache/performance registers the rkvdec driver writes to. Also add missing clocks to the related power-domain. Fixes: cbd7214402ec ("arm64: dts: rockchip: Define the rockchip Video Decoder node on rk3399") Signed-off-by: Alex Bee Signed-off-by: Jonas Karlman Link: https://lore.kernel.org/r/20231105233630.3927502-10-jonas@kwiboo.se Signed-off-by: Heiko Stuebner commit 0b6240d697a96eaa45a2a5503a274ebb4f162fa3 Author: Jonas Karlman Date: Sun Nov 5 23:36:15 2023 +0000 arm64: dts: rockchip: Expand reg size of vdec node for RK3328 Expand the reg size for the vdec node to include cache/performance registers the rkvdec driver writes to. Fixes: 17408c9b119d ("arm64: dts: rockchip: Add vdec support for RK3328") Signed-off-by: Jonas Karlman Link: https://lore.kernel.org/r/20231105233630.3927502-9-jonas@kwiboo.se Signed-off-by: Heiko Stuebner commit 54cf39ec16335dadbe1ba008d8e5e98dae3e26f8 Author: Javier Carrasco Date: Thu Oct 26 17:44:49 2023 +0200 iio: common: ms_sensors: ms_sensors_i2c: fix humidity conversion time table The HTU21 offers 4 sampling frequencies: 20, 40, 70 and 120, which are associated to an index that is used to select the right measurement resolution and its corresponding measurement time. The current implementation selects the measurement resolution and the temperature measurement time properly, but it does not select the right humidity measurement time in all cases. In summary, the 40 and 70 humidity measurement times are swapped. The reason for that is probably the unusual coding for the measurement resolution. According to the datasheet, the bits [7,0] of the "user register" are used as follows to select the bit resolution: -------------------------------------------------- | Bit 7 | Bit 0 | RH | Temp | Trh (us) | Tt (us) | -------------------------------------------------- | 0 | 0 | 12 | 14 | 16000 | 50000 | -------------------------------------------------- | 0 | 1 | 8 | 12 | 3000 | 13000 | -------------------------------------------------- | 1 | 0 | 10 | 13 | 5000 | 25000 | -------------------------------------------------- | 1 | 1 | 11 | 11 | 8000 | 7000 | -------------------------------------------------- *This table is available in the official datasheet, page 13/21. I have just appended the times provided in the humidity/temperature tables, pages 3/21, 5/21. Note that always a pair of resolutions is selected. The sampling frequencies [20, 40, 70, 120] are assigned to a linear index [0..3] which is then coded as follows [1]: Index [7,0] -------------- idx 0 0,0 idx 1 1,0 idx 2 0,1 idx 3 1,1 That is done that way because the temperature measurements are being used as the reference for the sampling frequency (the frequencies and the temperature measurement times are correlated), so increasing the index always reduces the temperature measurement time and its resolution. Therefore, the temperature measurement time array is as simple as [50000, 25000, 13000, 7000] On the other hand, the humidity resolution cannot follow the same pattern because of the way it is coded in the "user register", where both resolutions are selected at the same time. The humidity measurement time array is the following: [16000, 3000, 5000, 8000], which defines the following assignments: Index [7,0] Trh ----------------------- idx 0 0,0 16000 -> right, [0,0] selects 12 bits (Trh = 16000) idx 1 1,0 3000 -> wrong! [1,0] selects 10 bits (Trh = 5000) idx 2 0,1 5000 -> wrong! [0,1] selects 8 bits (Trh = 3000) idx 3 1,1 8000 -> right, [1,1] selects 11 bits (Trh = 8000) The times have been ordered as if idx = 1 -> [0,1] and idx = 2 -> [1,0], which is not the case for the reason explained above. So a simple modification is required to obtain the right humidity measurement time array, swapping the values in the positions 1 and 2. The right table should be the following: [16000, 5000, 3000, 8000] Fix the humidity measurement time array with the right idex/value coding. [1] The actual code that makes this coding and assigns it to the current value of the "user register" is the following: config_reg &= 0x7E; config_reg |= ((i & 1) << 7) + ((i & 2) >> 1); Fixes: d574a87cc311 ("Add meas-spec sensors common part") Signed-off-by: Javier Carrasco Link: https://lore.kernel.org/r/20231026-topic-htu21_conversion_time-v1-1-bd257dc44209@gmail.com Cc: Signed-off-by: Jonathan Cameron commit 92bfa4ab1b79be95c4f52d13f5386390f0a513c2 Author: Matti Vaittinen Date: Thu Oct 19 16:23:56 2023 +0300 iio: kx022a: Fix acceleration value scaling The IIO ABI mandates acceleration values from accelerometer to be emitted in m/s^2. The KX022A was emitting values in micro m/s^2. Fix driver to report the correct scale values. Signed-off-by: Matti Vaittinen Reported-by: Jagath Jog J Fixes: 7c1d1677b322 ("iio: accel: Support Kionix/ROHM KX022A accelerometer") Tested-by: Jagath Jog J Link: https://lore.kernel.org/r/ZTEt7NqfDHPOkm8j@dc78bmyyyyyyyyyyyyydt-3.rev.dnainternet.fi Cc: Signed-off-by: Jonathan Cameron commit 6588732445ff19f6183f0fa72ddedf67e5a5be32 Author: Charles Keepax Date: Wed Nov 15 16:28:53 2023 +0000 pinctrl: lochnagar: Don't build on MIPS MIPS appears to define a RST symbol at a high level, which clashes with some register naming in the driver. Since there is currently no case for running this driver on MIPS devices simply cut off the build of this driver on MIPS. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311071303.JJMAOjy4-lkp@intel.com/ Suggested-by: Linus Walleij Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20231115162853.1891940-1-ckeepax@opensource.cirrus.com Signed-off-by: Linus Walleij commit 32138be394e5d32c095a413949e6ab4875b2aec0 Merge: 173d167ce3509 42d62b7e47d58 Author: Hans Verkuil Date: Thu Nov 16 14:28:44 2023 +0100 Merge tag 'media-renesas-fixes-20231113' of git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git Laurent Pinchart says: ---------------------------------------------------------------- Renesas R-Car VSP1 driver regression fix ---------------------------------------------------------------- Laurent Pinchart (1): media: vsp1: Remove unbalanced .s_stream(0) calls Link: https://lore.kernel.org/linux-media/20231113020054.GA18039@pendragon.ideasonboard.com/ Signed-off-by: Hans Verkuil commit 173d167ce350961d7d689a4d59d66a5f2ad70a76 Author: Arnd Bergmann Date: Mon Oct 23 18:05:31 2023 +0200 media: pci: mgb4: add COMMON_CLK dependency This driver fails to build when HAVE_CLK and COMMON_CLK are disabled: x86_64-linux-ld: vmlinux.o: in function `mgb4_remove': mgb4_core.c:(.text+0x1915e8c): undefined reference to `clkdev_drop' x86_64-linux-ld: mgb4_core.c:(.text+0x1915e98): undefined reference to `clk_hw_unregister' Add a Kconfig dependency to enforce a clean build. Fixes: 0ab13674a9bd ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver") Signed-off-by: Arnd Bergmann Reviewed-by: Martin Tůma Signed-off-by: Hans Verkuil commit 5d33213fac5929a2e7766c88d78779fd443b0fe8 Author: Dan Carpenter Date: Fri Nov 3 10:39:24 2023 +0300 media: v4l2-subdev: Fix a 64bit bug The problem is this line here from subdev_do_ioctl(). client_cap->capabilities &= ~V4L2_SUBDEV_CLIENT_CAP_STREAMS; The "client_cap->capabilities" variable is a u64. The AND operation is supposed to clear out the V4L2_SUBDEV_CLIENT_CAP_STREAMS flag. But because it's a 32 bit variable it accidentally clears out the high 32 bits as well. Currently we only use the first bit and none of the upper bits so this doesn't affect runtime behavior. Fixes: f57fa2959244 ("media: v4l2-subdev: Add new ioctl for client capabilities") Signed-off-by: Dan Carpenter Reviewed-by: Tomi Valkeinen Signed-off-by: Hans Verkuil commit 9ea7be95d3d4d76df63cef13b4360cd58548b2ef Author: Martin Tůma Date: Wed Oct 25 18:51:47 2023 +0200 media: mgb4: Added support for T200 card variant T200 card variants use the XC7A200T FPGA instead of XC7A100T. The SPI FLASH memory layout is different as the FPGA requires bigger FW images. Signed-off-by: Martin Tůma Signed-off-by: Hans Verkuil commit 7475e51b87969e01a6812eac713a1c8310372e8a Merge: 6eb1acd9766a0 cff088d924df8 Author: Linus Torvalds Date: Thu Nov 16 07:51:26 2023 -0500 Merge tag 'net-6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from BPF and netfilter. Current release - regressions: - core: fix undefined behavior in netdev name allocation - bpf: do not allocate percpu memory at init stage - netfilter: nf_tables: split async and sync catchall in two functions - mptcp: fix possible NULL pointer dereference on close Current release - new code bugs: - eth: ice: dpll: fix initial lock status of dpll Previous releases - regressions: - bpf: fix precision backtracking instruction iteration - af_unix: fix use-after-free in unix_stream_read_actor() - tipc: fix kernel-infoleak due to uninitialized TLV value - eth: bonding: stop the device in bond_setup_by_slave() - eth: mlx5: - fix double free of encap_header - avoid referencing skb after free-ing in drop path - eth: hns3: fix VF reset - eth: mvneta: fix calls to page_pool_get_stats Previous releases - always broken: - core: set SOCK_RCU_FREE before inserting socket into hashtable - bpf: fix control-flow graph checking in privileged mode - eth: ppp: limit MRU to 64K - eth: stmmac: avoid rx queue overrun - eth: icssg-prueth: fix error cleanup on failing initialization - eth: hns3: fix out-of-bounds access may occur when coalesce info is read via debugfs - eth: cortina: handle large frames Misc: - selftests: gso: support CONFIG_MAX_SKB_FRAGS up to 45" * tag 'net-6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (78 commits) macvlan: Don't propagate promisc change to lower dev in passthru net: sched: do not offload flows with a helper in act_ct net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors net/mlx5e: Check return value of snprintf writing to fw_version buffer net/mlx5e: Reduce the size of icosq_str net/mlx5: Increase size of irq name buffer net/mlx5e: Update doorbell for port timestamping CQ before the software counter net/mlx5e: Track xmit submission to PTP WQ after populating metadata map net/mlx5e: Avoid referencing skb after free-ing in drop path of mlx5e_sq_xmit_wqe net/mlx5e: Don't modify the peer sent-to-vport rules for IPSec offload net/mlx5e: Fix pedit endianness net/mlx5e: fix double free of encap_header in update funcs net/mlx5e: fix double free of encap_header net/mlx5: Decouple PHC .adjtime and .adjphase implementations net/mlx5: DR, Allow old devices to use multi destination FTE net/mlx5: Free used cpus mask when an IRQ is released Revert "net/mlx5: DR, Supporting inline WQE when possible" bpf: Do not allocate percpu memory at init stage net: Fix undefined behavior in netdev name allocation dt-bindings: net: ethernet-controller: Fix formatting error ... commit 6eb1acd9766a0dc9d85927843d85787408395e15 Merge: 372bed5fbb873 cee96422e863f Author: Linus Torvalds Date: Thu Nov 16 07:44:34 2023 -0500 Merge tag 'for-linus-6.7a-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from Juergen Gross: - A fix in the Xen events driver avoiding the use of RCU after the call to rcu_report_dead() when taking a cpu down - A fix for running as Xen dom0 to line up ACPI's idea of power management capabilities with the one of Xen - A cleanup eliminating several kernel-doc warnings in Xen related code - A cleanup series of the Xen events driver * tag 'for-linus-6.7a-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/events: remove some info_for_irq() calls in pirq handling xen/events: modify internal [un]bind interfaces xen/events: drop xen_allocate_irqs_dynamic() xen/events: remove some simple helpers from events_base.c xen/events: reduce externally visible helper functions xen/events: remove unused functions xen/events: fix delayed eoi list handling xen/shbuf: eliminate 17 kernel-doc warnings acpi/processor: sanitize _OSC/_PDC capabilities for Xen dom0 xen/events: avoid using info_for_irq() in xen_send_IPI_one() commit 372bed5fbb87314abf410c3916e51578cd382cd1 Merge: c42d9eeef8e5b e07754e0a1ea2 Author: Linus Torvalds Date: Thu Nov 16 07:39:37 2023 -0500 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fixes from Michael Tsirkin: "Bugfixes all over the place" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: vhost-vdpa: fix use after free in vhost_vdpa_probe() virtio_pci: Switch away from deprecated irq_set_affinity_hint riscv, qemu_fw_cfg: Add support for RISC-V architecture vdpa_sim_blk: allocate the buffer zeroed virtio_pci: move structure to a header commit 0f40d5099cd6d828fd7de6227d3eabe86016724c Author: Andrew Davis Date: Wed Oct 25 09:33:02 2023 -0500 phy: ti: gmii-sel: Fix register offset when parent is not a syscon node When the node for this phy selector is a child node of a syscon node then the property 'reg' is used as an offset into the parent regmap. When the node is standalone and gets its own regmap this offset is pre-applied. So we need to track which method was used to get the regmap and not apply the offset in the standalone case. Fixes: 1fdfa7cccd35 ("phy: ti: gmii-sel: Allow parent to not be syscon node") Signed-off-by: Andrew Davis Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20231025143302.1265633-1-afd@ti.com Signed-off-by: Vinod Koul commit 1c4a7587d1bbee0fd53b63af60e4244a62775f57 Author: Masahiro Yamada Date: Wed Nov 1 02:46:27 2023 +0900 modpost: fix section mismatch message for RELA The section mismatch check prints a bogus symbol name on some architectures. [test code] #include int __initdata foo; int get_foo(void) { return foo; } If you compile it with GCC for riscv or loongarch, modpost will show an incorrect symbol name: WARNING: modpost: vmlinux: section mismatch in reference: get_foo+0x8 (section: .text) -> done (section: .init.data) To get the correct symbol address, the st_value must be added. This issue has never been noticed since commit 93684d3b8062 ("kbuild: include symbol names in section mismatch warnings") presumably because st_value becomes zero on most architectures when the referenced symbol is looked up. It is not true for riscv or loongarch, at least. With this fix, modpost will show the correct symbol name: WARNING: modpost: vmlinux: section mismatch in reference: get_foo+0x8 (section: .text) -> foo (section: .init.data) Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit cff088d924df871296412e6b819823f42d1bb9a5 Merge: 7e1caeace0418 8837ba3e58ea1 Author: Paolo Abeni Date: Thu Nov 16 11:02:52 2023 +0100 Merge tag 'nf-23-11-15' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Remove unused variable causing compilation warning in nft_set_rbtree, from Yang Li. This unused variable is a left over from previous merge window. 2) Possible return of uninitialized in nf_conntrack_bridge, from Linkui Xiao. This is there since nf_conntrack_bridge is available. 3) Fix incorrect pointer math in nft_byteorder, from Dan Carpenter. Problem has been there since 2016. 4) Fix bogus error in destroy set element command. Problem is there since this new destroy command was added. 5) Fix race condition in ipset between swap and destroy commands and add/del/test control plane. This problem is there since ipset was merged. 6) Split async and sync catchall GC in two function to fix unsafe iteration over RCU. This is a fix-for-fix that was included in the previous pull request. * tag 'nf-23-11-15' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nf_tables: split async and sync catchall in two functions netfilter: ipset: fix race condition between swap/destroy and kernel side add/del/test netfilter: nf_tables: bogus ENOENT when destroying element which does not exist netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval() netfilter: nf_conntrack_bridge: initialize err to 0 netfilter: nft_set_rbtree: Remove unused variable nft_net ==================== Link: https://lore.kernel.org/r/20231115184514.8965-1-pablo@netfilter.org Signed-off-by: Paolo Abeni commit 862c135bde8bc185e8aae2110374175e6a1b6ed5 Author: Junhao He Date: Tue Nov 14 21:33:45 2023 +0800 coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base In smb_reset_buffer, the sdb->buf_hw_base variable is uninitialized before use, which initializes it in smb_init_data_buffer. And the SMB regiester are set in smb_config_inport. So move the call after smb_config_inport. Fixes: 06f5c2926aaa ("drivers/coresight: Add UltraSoc System Memory Buffer driver") Signed-off-by: Junhao He Reviewed-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20231114133346.30489-4-hejunhao3@huawei.com commit 830a7f54db102c889a3fe1c0a225f369ac05f07f Author: Junhao He Date: Tue Nov 14 21:33:44 2023 +0800 coresight: ultrasoc-smb: Config SMB buffer before register sink The SMB dirver register the enable/disable sysfs interface in function smb_register_sink(), however the buffer depends on the following configuration to work well. So it'll be possible for user to access an unreset one. Move the config buffer operation to before register_sink(). Ignore the return value, if smb_config_inport() fails. That will cause the hardwares disable trace path to fail, should not affect SMB driver remove. So we make smb_remove() return success, Fixes: 06f5c2926aaa ("drivers/coresight: Add UltraSoc System Memory Buffer driver") Signed-off-by: Junhao He Reviewed-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20231114133346.30489-3-hejunhao3@huawei.com commit b8411287aef4a994eff0c68f5597910c4194dfe3 Author: Junhao He Date: Tue Nov 14 21:33:43 2023 +0800 coresight: ultrasoc-smb: Fix sleep while close preempt in enable_smb When we to enable the SMB by perf, the perf sched will call perf_ctx_lock() to close system preempt in event_function_call(). But SMB::enable_smb() use mutex to lock the critical section, which may sleep. BUG: sleeping function called from invalid context at kernel/locking/mutex.c:580 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 153023, name: perf preempt_count: 2, expected: 0 RCU nest depth: 0, expected: 0 INFO: lockdep is turned off. irq event stamp: 0 hardirqs last enabled at (0): [<0000000000000000>] 0x0 hardirqs last disabled at (0): [] copy_process+0xae8/0x2b48 softirqs last enabled at (0): [] copy_process+0xae8/0x2b48 softirqs last disabled at (0): [<0000000000000000>] 0x0 CPU: 2 PID: 153023 Comm: perf Kdump: loaded Tainted: G W O 6.5.0-rc4+ #1 Call trace: ... __mutex_lock+0xbc/0xa70 mutex_lock_nested+0x34/0x48 smb_update_buffer+0x58/0x360 [ultrasoc_smb] etm_event_stop+0x204/0x2d8 [coresight] etm_event_del+0x1c/0x30 [coresight] event_sched_out+0x17c/0x3b8 group_sched_out.part.0+0x5c/0x208 __perf_event_disable+0x15c/0x210 event_function+0xe0/0x230 remote_function+0xb4/0xe8 generic_exec_single+0x160/0x268 smp_call_function_single+0x20c/0x2a0 event_function_call+0x20c/0x220 _perf_event_disable+0x5c/0x90 perf_event_for_each_child+0x58/0xc0 _perf_ioctl+0x34c/0x1250 perf_ioctl+0x64/0x98 ... Use spinlock to replace mutex to control driver data access to one at a time. The function copy_to_user() may sleep, it cannot be in a spinlock context, so we can't simply replace it in smb_read(). But we can ensure that only one user gets the SMB device fd by smb_open(), so remove the locks from smb_read() and buffer synchronization is guaranteed by the user. Fixes: 06f5c2926aaa ("drivers/coresight: Add UltraSoc System Memory Buffer driver") Signed-off-by: Junhao He Reviewed-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20231114133346.30489-2-hejunhao3@huawei.com commit 7e1caeace0418381f36b3aa8403dfd82fc57fc53 Author: Vlad Buslov Date: Tue Nov 14 18:59:15 2023 +0100 macvlan: Don't propagate promisc change to lower dev in passthru Macvlan device in passthru mode sets its lower device promiscuous mode according to its MACVLAN_FLAG_NOPROMISC flag instead of synchronizing it to its own promiscuity setting. However, macvlan_change_rx_flags() function doesn't check the mode before propagating such changes to the lower device which can cause net_device->promiscuity counter overflow as illustrated by reproduction example [0] and resulting dmesg log [1]. Fix the issue by first verifying the mode in macvlan_change_rx_flags() function before propagating promiscuous mode change to the lower device. [0]: ip link add macvlan1 link enp8s0f0 type macvlan mode passthru ip link set macvlan1 promisc on ip l set dev macvlan1 up ip link set macvlan1 promisc off ip l set dev macvlan1 down ip l set dev macvlan1 up [1]: [ 5156.281724] macvlan1: entered promiscuous mode [ 5156.285467] mlx5_core 0000:08:00.0 enp8s0f0: entered promiscuous mode [ 5156.287639] macvlan1: left promiscuous mode [ 5156.288339] mlx5_core 0000:08:00.0 enp8s0f0: left promiscuous mode [ 5156.290907] mlx5_core 0000:08:00.0 enp8s0f0: entered promiscuous mode [ 5156.317197] mlx5_core 0000:08:00.0 enp8s0f0: promiscuity touches roof, set promiscuity failed. promiscuity feature of device might be broken. Fixes: efdbd2b30caa ("macvlan: Propagate promiscuity setting to lower devices.") Reviewed-by: Gal Pressman Signed-off-by: Vlad Buslov Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231114175915.1649154-1-vladbu@nvidia.com Signed-off-by: Paolo Abeni commit e49c0b1401d0d0efc8aeeb9db5a9d54e980d9f69 Author: Vegard Nossum Date: Sun Oct 22 20:58:06 2023 +0200 Documentation: coresight: fix `make refcheckdocs` warning This reference uses a glob pattern to match multiple files, but the asterisk was escaped as \* in order to not be interpreted by sphinx as reStructuredText markup. refcheckdocs/documentation-file-ref-check doesn't know about rST syntax and tries to interpret the \* literally (instead of as a glob). We can work around the warning by putting the Documentation reference inside double backticks (``..``), which allows us to not escape the asterisk. Fixes: c06475910b52 ("Documentation: coresight: Escape coresight bindings file wildcard") Cc: Mathieu Poirier Cc: Suzuki K Poulose Cc: Mike Leach Cc: Leo Yan Cc: Jonathan Corbet Cc: Rob Herring Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-next@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Stephen Rothwell Cc: Bagas Sanjaya Signed-off-by: Vegard Nossum Reviewed-by: Bagas Sanjaya Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20231022185806.919434-1-vegard.nossum@oracle.com commit 7cd5af0e937a197295f3aa3721031f0fbae49cff Author: Xin Long Date: Mon Nov 13 12:53:28 2023 -0500 net: sched: do not offload flows with a helper in act_ct There is no hardware supporting ct helper offload. However, prior to this patch, a flower filter with a helper in the ct action can be successfully set into the HW, for example (eth1 is a bnxt NIC): # tc qdisc add dev eth1 ingress_block 22 ingress # tc filter add block 22 proto ip flower skip_sw ip_proto tcp \ dst_port 21 ct_state -trk action ct helper ipv4-tcp-ftp # tc filter show dev eth1 ingress filter block 22 protocol ip pref 49152 flower chain 0 handle 0x1 eth_type ipv4 ip_proto tcp dst_port 21 ct_state -trk skip_sw in_hw in_hw_count 1 <---- action order 1: ct zone 0 helper ipv4-tcp-ftp pipe index 2 ref 1 bind 1 used_hw_stats delayed This might cause the flower filter not to work as expected in the HW. This patch avoids this problem by simply returning -EOPNOTSUPP in tcf_ct_offload_act_setup() to not allow to offload flows with a helper in act_ct. Fixes: a21b06e73191 ("net: sched: add helper support in act_ct") Signed-off-by: Xin Long Reviewed-by: Jamal Hadi Salim Link: https://lore.kernel.org/r/f8685ec7702c4a448a1371a8b34b43217b583b9d.1699898008.git.lucien.xin@gmail.com Signed-off-by: Paolo Abeni commit bdc454fcdc824062c6f5ebc56e898a462ac66fc6 Merge: a6a6a0a9fdb03 1b2bd0c0264fe Author: Jakub Kicinski Date: Wed Nov 15 22:34:31 2023 -0800 Merge branch 'mlx5-fixes-2023-11-13-manual' Saeed Mahameed says: ==================== This series provides bug fixes to mlx5 driver. ==================== Link: https://lore.kernel.org/r/20231114215846.5902-1-saeed@kernel.org/ Signed-off-by: Jakub Kicinski commit 1b2bd0c0264febcd8d47209079a6671c38e6558b Author: Rahul Rameshbabu Date: Tue Nov 14 13:58:46 2023 -0800 net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors Treat the operation as an error case when the return value is equivalent to the size of the name buffer. Failed to write null terminator to the name buffer, making the string malformed and should not be used. Provide a string with only the firmware version when forming the string with the board id fails. This logic for representors is identical to normal flow with ethtool. Without check, will trigger -Wformat-truncation with W=1. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c: In function 'mlx5e_rep_get_drvinfo': drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:78:31: warning: '%.16s' directive output may be truncated writing up to 16 bytes into a region of size between 13 and 22 [-Wformat-truncation=] 78 | "%d.%d.%04d (%.16s)", | ^~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:77:9: note: 'snprintf' output between 12 and 37 bytes into a destination of size 32 77 | snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 78 | "%d.%d.%04d (%.16s)", | ~~~~~~~~~~~~~~~~~~~~~ 79 | fw_rev_maj(mdev), fw_rev_min(mdev), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 80 | fw_rev_sub(mdev), mdev->board_id); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: cf83c8fdcd47 ("net/mlx5e: Add missing ethtool driver info for representors") Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6d4ab2e97dcfbcd748ae71761a9d8e5e41cc732c Signed-off-by: Rahul Rameshbabu Reviewed-by: Dragos Tatulea Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231114215846.5902-16-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 41e63c2baa11dc2aa71df5dd27a5bd87d11b6bbb Author: Rahul Rameshbabu Date: Tue Nov 14 13:58:45 2023 -0800 net/mlx5e: Check return value of snprintf writing to fw_version buffer Treat the operation as an error case when the return value is equivalent to the size of the name buffer. Failed to write null terminator to the name buffer, making the string malformed and should not be used. Provide a string with only the firmware version when forming the string with the board id fails. Without check, will trigger -Wformat-truncation with W=1. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c: In function 'mlx5e_ethtool_get_drvinfo': drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c:49:31: warning: '%.16s' directive output may be truncated writing up to 16 bytes into a region of size between 13 and 22 [-Wformat-truncation=] 49 | "%d.%d.%04d (%.16s)", | ^~~~~ drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c:48:9: note: 'snprintf' output between 12 and 37 bytes into a destination of size 32 48 | snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 49 | "%d.%d.%04d (%.16s)", | ~~~~~~~~~~~~~~~~~~~~~ 50 | fw_rev_maj(mdev), fw_rev_min(mdev), fw_rev_sub(mdev), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 51 | mdev->board_id); | ~~~~~~~~~~~~~~~ Fixes: 84e11edb71de ("net/mlx5e: Show board id in ethtool driver information") Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6d4ab2e97dcfbcd748ae71761a9d8e5e41cc732c Signed-off-by: Rahul Rameshbabu Reviewed-by: Dragos Tatulea Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit dce94142842e119b982c27c1b62bd20890c7fd21 Author: Saeed Mahameed Date: Tue Nov 14 13:58:44 2023 -0800 net/mlx5e: Reduce the size of icosq_str icosq_str size is unnecessarily too long, and it causes a build warning -Wformat-truncation with W=1. Looking closely, It doesn't need to be 255B, hence this patch reduces the size to 32B which should be more than enough to host the string: "ICOSQ: 0x%x, ". While here, add a missing space in the formatted string. This fixes the following build warning: $ KCFLAGS='-Wall -Werror' $ make O=/tmp/kbuild/linux W=1 -s -j12 drivers/net/ethernet/mellanox/mlx5/core/ drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c: In function 'mlx5e_reporter_rx_timeout': drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c:718:56: error: ', CQ: 0x' directive output may be truncated writing 8 bytes into a region of size between 0 and 255 [-Werror=format-truncation=] 718 | "RX timeout on channel: %d, %sRQ: 0x%x, CQ: 0x%x", | ^~~~~~~~ drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c:717:9: note: 'snprintf' output between 43 and 322 bytes into a destination of size 288 717 | snprintf(err_str, sizeof(err_str), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 718 | "RX timeout on channel: %d, %sRQ: 0x%x, CQ: 0x%x", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 719 | rq->ix, icosq_str, rq->rqn, rq->cq.mcq.cqn); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 521f31af004a ("net/mlx5e: Allow RQ outside of channel context") Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6d4ab2e97dcfbcd748ae71761a9d8e5e41cc732c Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231114215846.5902-14-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 3338bebfc26a1e2cebbba82a1cf12c0159608e73 Author: Rahul Rameshbabu Date: Tue Nov 14 13:58:43 2023 -0800 net/mlx5: Increase size of irq name buffer Without increased buffer size, will trigger -Wformat-truncation with W=1 for the snprintf operation writing to the buffer. drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c: In function 'mlx5_irq_alloc': drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c:296:7: error: '@pci:' directive output may be truncated writing 5 bytes into a region of size between 1 and 32 [-Werror=format-truncation=] 296 | "%s@pci:%s", name, pci_name(dev->pdev)); | ^~~~~ drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c:295:2: note: 'snprintf' output 6 or more bytes (assuming 37) into a destination of size 32 295 | snprintf(irq->name, MLX5_MAX_IRQ_NAME, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 296 | "%s@pci:%s", name, pci_name(dev->pdev)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: ada9f5d00797 ("IB/mlx5: Fix eq names to display nicely in /proc/interrupts") Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6d4ab2e97dcfbcd748ae71761a9d8e5e41cc732c Signed-off-by: Rahul Rameshbabu Reviewed-by: Dragos Tatulea Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231114215846.5902-13-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 92214be5979c0961a471b7eaaaeacab41bdf456c Author: Rahul Rameshbabu Date: Tue Nov 14 13:58:42 2023 -0800 net/mlx5e: Update doorbell for port timestamping CQ before the software counter Previously, mlx5e_ptp_poll_ts_cq would update the device doorbell with the incremented consumer index after the relevant software counters in the kernel were updated. In the mlx5e_sq_xmit_wqe context, this would lead to either overrunning the device CQ or exceeding the expected software buffer size in the device CQ if the device CQ size was greater than the software buffer size. Update the relevant software counter only after updating the device CQ consumer index in the port timestamping napi_poll context. Log: mlx5_core 0000:08:00.0: cq_err_event_notifier:517:(pid 0): CQ error on CQN 0x487, syndrome 0x1 mlx5_core 0000:08:00.0 eth2: mlx5e_cq_error_event: cqn=0x000487 event=0x04 Fixes: 1880bc4e4a96 ("net/mlx5e: Add TX port timestamp support") Signed-off-by: Rahul Rameshbabu Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231114215846.5902-12-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 7e3f3ba97e6cc6fce5bf62df2ca06c8e59040167 Author: Rahul Rameshbabu Date: Tue Nov 14 13:58:41 2023 -0800 net/mlx5e: Track xmit submission to PTP WQ after populating metadata map Ensure the skb is available in metadata mapping to skbs before tracking the metadata index for detecting undelivered CQEs. If the metadata index is put in the tracking list before putting the skb in the map, the metadata index might be used for detecting undelivered CQEs before the relevant skb is available in the map, which can lead to a null-ptr-deref. Log: general protection fault, probably for non-canonical address 0xdffffc0000000005: 0000 [#1] SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f] CPU: 0 PID: 1243 Comm: kworker/0:2 Not tainted 6.6.0-rc4+ #108 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Workqueue: events mlx5e_rx_dim_work [mlx5_core] RIP: 0010:mlx5e_ptp_napi_poll+0x9a4/0x2290 [mlx5_core] Code: 8c 24 38 cc ff ff 4c 8d 3c c1 4c 89 f9 48 c1 e9 03 42 80 3c 31 00 0f 85 97 0f 00 00 4d 8b 3f 49 8d 7f 28 48 89 f9 48 c1 e9 03 <42> 80 3c 31 00 0f 85 8b 0f 00 00 49 8b 47 28 48 85 c0 0f 84 05 07 RSP: 0018:ffff8884d3c09c88 EFLAGS: 00010206 RAX: 0000000000000069 RBX: ffff8881160349d8 RCX: 0000000000000005 RDX: ffffed10218f48cf RSI: 0000000000000004 RDI: 0000000000000028 RBP: ffff888122707700 R08: 0000000000000001 R09: ffffed109a781383 R10: 0000000000000003 R11: 0000000000000003 R12: ffff88810c7a7a40 R13: ffff888122707700 R14: dffffc0000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8884d3c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f4f878dd6e0 CR3: 000000014d108002 CR4: 0000000000370eb0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? die_addr+0x3c/0xa0 ? exc_general_protection+0x144/0x210 ? asm_exc_general_protection+0x22/0x30 ? mlx5e_ptp_napi_poll+0x9a4/0x2290 [mlx5_core] ? mlx5e_ptp_napi_poll+0x8f6/0x2290 [mlx5_core] __napi_poll.constprop.0+0xa4/0x580 net_rx_action+0x460/0xb80 ? _raw_spin_unlock_irqrestore+0x32/0x60 ? __napi_poll.constprop.0+0x580/0x580 ? tasklet_action_common.isra.0+0x2ef/0x760 __do_softirq+0x26c/0x827 irq_exit_rcu+0xc2/0x100 common_interrupt+0x7f/0xa0 asm_common_interrupt+0x22/0x40 RIP: 0010:__kmem_cache_alloc_node+0xb/0x330 Code: 41 5d 41 5e 41 5f c3 8b 44 24 14 8b 4c 24 10 09 c8 eb d5 e8 b7 43 ca 01 0f 1f 80 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 41 57 <41> 56 41 89 d6 41 55 41 89 f5 41 54 49 89 fc 53 48 83 e4 f0 48 83 RSP: 0018:ffff88812c4079c0 EFLAGS: 00000246 RAX: 1ffffffff083c7fe RBX: ffff888100042dc0 RCX: 0000000000000218 RDX: 00000000ffffffff RSI: 0000000000000dc0 RDI: ffff888100042dc0 RBP: ffff88812c4079c8 R08: ffffffffa0289f96 R09: ffffed1025880ea9 R10: ffff888138839f80 R11: 0000000000000002 R12: 0000000000000dc0 R13: 0000000000000100 R14: 000000000000008c R15: ffff8881271fc450 ? cmd_exec+0x796/0x2200 [mlx5_core] kmalloc_trace+0x26/0xc0 cmd_exec+0x796/0x2200 [mlx5_core] mlx5_cmd_do+0x22/0xc0 [mlx5_core] mlx5_cmd_exec+0x17/0x30 [mlx5_core] mlx5_core_modify_cq_moderation+0x139/0x1b0 [mlx5_core] ? mlx5_add_cq_to_tasklet+0x280/0x280 [mlx5_core] ? lockdep_set_lock_cmp_fn+0x190/0x190 ? process_one_work+0x659/0x1220 mlx5e_rx_dim_work+0x9d/0x100 [mlx5_core] process_one_work+0x730/0x1220 ? lockdep_hardirqs_on_prepare+0x400/0x400 ? max_active_store+0xf0/0xf0 ? assign_work+0x168/0x240 worker_thread+0x70f/0x12d0 ? __kthread_parkme+0xd1/0x1d0 ? process_one_work+0x1220/0x1220 kthread+0x2d9/0x3b0 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x2d/0x70 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork_asm+0x11/0x20 Modules linked in: xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter rpcsec_gss_krb5 auth_rpcgss oid_registry overlay mlx5_ib ib_uverbs ib_core zram zsmalloc mlx5_core fuse ---[ end trace 0000000000000000 ]--- Fixes: 3178308ad4ca ("net/mlx5e: Make tx_port_ts logic resilient to out-of-order CQEs") Signed-off-by: Rahul Rameshbabu Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231114215846.5902-11-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 64f14d16eef1f939000f2617b50c7c996b5117d4 Author: Rahul Rameshbabu Date: Tue Nov 14 13:58:40 2023 -0800 net/mlx5e: Avoid referencing skb after free-ing in drop path of mlx5e_sq_xmit_wqe When SQ is a port timestamping SQ for PTP, do not access tx flags of skb after free-ing the skb. Free the skb only after all references that depend on it have been handled in the dropped WQE path. Fixes: 3178308ad4ca ("net/mlx5e: Make tx_port_ts logic resilient to out-of-order CQEs") Signed-off-by: Rahul Rameshbabu Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231114215846.5902-10-saeed@kernel.org Signed-off-by: Jakub Kicinski commit bdf788cf224f61c20a01c58c00685d394d57887f Author: Jianbo Liu Date: Tue Nov 14 13:58:39 2023 -0800 net/mlx5e: Don't modify the peer sent-to-vport rules for IPSec offload As IPSec packet offload in switchdev mode is not supported with LAG, it's unnecessary to modify those sent-to-vport rules to the peer eswitch. Fixes: c6c2bf5db4ea ("net/mlx5e: Support IPsec packet offload for TX in switchdev mode") Signed-off-by: Jianbo Liu Reviewed-by: Leon Romanovsky Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231114215846.5902-9-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 0c101a23ca7eaf00eef1328eefb04b3a93401cc8 Author: Vlad Buslov Date: Tue Nov 14 13:58:38 2023 -0800 net/mlx5e: Fix pedit endianness Referenced commit addressed endianness issue in mlx5 pedit implementation in ad hoc manner instead of systematically treating integer values according to their types which left pedit fields of sizes not equal to 4 and where the bytes being modified are not least significant ones broken on big endian machines since wrong bits will be consumed during parsing which leads to following example error when applying pedit to source and destination MAC addresses: [Wed Oct 18 12:52:42 2023] mlx5_core 0001:00:00.1 p1v3_r: attempt to offload an unsupported field (cmd 0) [Wed Oct 18 12:52:42 2023] mask: 00000000330c5b68: 00 00 00 00 ff ff 00 00 00 00 ff ff 00 00 00 00 ................ [Wed Oct 18 12:52:42 2023] mask: 0000000017d22fd9: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ [Wed Oct 18 12:52:42 2023] mask: 000000008186d717: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ [Wed Oct 18 12:52:42 2023] mask: 0000000029eb6149: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ [Wed Oct 18 12:52:42 2023] mask: 000000007ed103e4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ [Wed Oct 18 12:52:42 2023] mask: 00000000db8101a6: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ [Wed Oct 18 12:52:42 2023] mask: 00000000ec3c08a9: 00 00 00 00 00 00 00 00 00 00 00 00 ............ Treat masks and values of pedit and filter match as network byte order, refactor pointers to them to void pointers instead of confusing u32 pointers and only cast to pointer-to-integer when reading a value from them. Treat pedit mlx5_fields->field_mask as host byte order according to its type u32, change the constants in fields array accordingly. Fixes: 82198d8bcdef ("net/mlx5e: Fix endianness when calculating pedit mask first bit") Signed-off-by: Vlad Buslov Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231114215846.5902-8-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 3a4aa3cb83563df942be49d145ee3b7ddf17d6bb Author: Gavin Li Date: Tue Nov 14 13:58:37 2023 -0800 net/mlx5e: fix double free of encap_header in update funcs Follow up to the previous patch to fix the same issue for mlx5e_tc_tun_update_header_ipv4{6} when mlx5_packet_reformat_alloc() fails. When mlx5_packet_reformat_alloc() fails, the encap_header allocated in mlx5e_tc_tun_update_header_ipv4{6} will be released within it. However, e->encap_header is already set to the previously freed encap_header before mlx5_packet_reformat_alloc(). As a result, the later mlx5e_encap_put() will free e->encap_header again, causing a double free issue. mlx5e_encap_put() --> mlx5e_encap_dealloc() --> kfree(e->encap_header) This patch fix it by not setting e->encap_header until mlx5_packet_reformat_alloc() success. Fixes: a54e20b4fcae ("net/mlx5e: Add basic TC tunnel set action for SRIOV offloads") Signed-off-by: Gavin Li Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231114215846.5902-7-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 6f9b1a0731662648949a1c0587f6acb3b7f8acf1 Author: Dust Li Date: Tue Nov 14 13:58:36 2023 -0800 net/mlx5e: fix double free of encap_header When mlx5_packet_reformat_alloc() fails, the encap_header allocated in mlx5e_tc_tun_create_header_ipv4{6} will be released within it. However, e->encap_header is already set to the previously freed encap_header before mlx5_packet_reformat_alloc(). As a result, the later mlx5e_encap_put() will free e->encap_header again, causing a double free issue. mlx5e_encap_put() --> mlx5e_encap_dealloc() --> kfree(e->encap_header) This happens when cmd: MLX5_CMD_OP_ALLOC_PACKET_REFORMAT_CONTEXT fail. This patch fix it by not setting e->encap_header until mlx5_packet_reformat_alloc() success. Fixes: d589e785baf5e ("net/mlx5e: Allow concurrent creation of encap entries") Reported-by: Cruz Zhao Reported-by: Tianchen Ding Signed-off-by: Dust Li Reviewed-by: Wojciech Drewek Signed-off-by: Saeed Mahameed Signed-off-by: Jakub Kicinski commit fd64fd13c49a53012ce9170449dcd9eb71c11284 Author: Rahul Rameshbabu Date: Tue Nov 14 13:58:35 2023 -0800 net/mlx5: Decouple PHC .adjtime and .adjphase implementations When running a phase adjustment operation, the free running clock should not be modified at all. The phase control keyword is intended to trigger an internal servo on the device that will converge to the provided delta. A free running counter cannot implement phase adjustment. Fixes: 8e11a68e2e8a ("net/mlx5: Add adjphase function to support hardware-only offset control") Signed-off-by: Rahul Rameshbabu Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231114215846.5902-5-saeed@kernel.org Signed-off-by: Jakub Kicinski commit ad4d82c3eacdd500a246af736e6e01d96484e35e Author: Erez Shitrit Date: Tue Nov 14 13:58:34 2023 -0800 net/mlx5: DR, Allow old devices to use multi destination FTE The current check isn't aware of old devices that don't have the relevant FW capability. This patch allows multi destination FTE in old cards, as it was before this check. Fixes: f6f46e7173cb ("net/mlx5: DR, Add check for multi destination FTE") Signed-off-by: Erez Shitrit Reviewed-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231114215846.5902-4-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 7d2f74d1d4385a5bcf90618537f16a45121c30ae Author: Maher Sanalla Date: Tue Nov 14 13:58:33 2023 -0800 net/mlx5: Free used cpus mask when an IRQ is released Each EQ table maintains a cpumask of the already used CPUs that are mapped to IRQs to ensure that each IRQ gets mapped to a unique CPU. However, on IRQ release, the said cpumask is not updated by clearing the CPU from the mask to allow future IRQ request, causing the following error when a SF is reloaded after it has utilized all CPUs for its IRQs: mlx5_irq_affinity_request:135:(pid 306010): Didn't find a matching IRQ. err = -28 Thus, when releasing an IRQ, clear its mapped CPU from the used CPUs mask, to prevent the case described above. While at it, move the used cpumask update to the EQ layer as it is more fitting and preserves symmetricity of the IRQ request/release API. Fixes: a1772de78d73 ("net/mlx5: Refactor completion IRQ request/release API") Signed-off-by: Maher Sanalla Reviewed-by: Tariq Toukan Reviewed-by: Shay Drory Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231114215846.5902-3-saeed@kernel.org Signed-off-by: Jakub Kicinski commit df3aafe501853c92bc9e25b05dcb030fee072962 Author: Itamar Gozlan Date: Tue Nov 14 13:58:32 2023 -0800 Revert "net/mlx5: DR, Supporting inline WQE when possible" This reverts commit 95c337cce0e11d06a715da73e6796ade9216637f. The revert is required due to the suspicion it cause some tests fail and will be moved to further investigation. Fixes: 95c337cce0e1 ("net/mlx5: DR, Supporting inline WQE when possible") Signed-off-by: Itamar Gozlan Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231114215846.5902-2-saeed@kernel.org Signed-off-by: Jakub Kicinski commit a6a6a0a9fdb03af10513b5bb48e5419563f54413 Merge: 674e318089468 1fda5bb66ad8f Author: Jakub Kicinski Date: Wed Nov 15 22:28:02 2023 -0800 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Alexei Starovoitov says: ==================== pull-request: bpf 2023-11-15 We've added 7 non-merge commits during the last 6 day(s) which contain a total of 9 files changed, 200 insertions(+), 49 deletions(-). The main changes are: 1) Do not allocate bpf specific percpu memory unconditionally, from Yonghong. 2) Fix precision backtracking instruction iteration, from Andrii. 3) Fix control flow graph checking, from Andrii. 4) Fix xskxceiver selftest build, from Anders. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf: Do not allocate percpu memory at init stage selftests/bpf: add more test cases for check_cfg() bpf: fix control-flow graph checking in privileged mode selftests/bpf: add edge case backtracking logic test bpf: fix precision backtracking instruction iteration bpf: handle ldimm64 properly in check_cfg() selftests: bpf: xskxceiver: ksft_print_msg: fix format type error ==================== Link: https://lore.kernel.org/r/20231115214949.48854-1-alexei.starovoitov@gmail.com Signed-off-by: Jakub Kicinski commit afccb0804fc74ac2f6737af6a139632606cb461d Author: Ryan Roberts Date: Tue Nov 14 15:49:45 2023 +0000 mm: more ptep_get() conversion Commit c33c794828f2 ("mm: ptep_get() conversion") converted all (non-arch) call sites to use ptep_get() instead of doing a direct dereference of the pte. Full rationale can be found in that commit's log. Since then, three new call sites have snuck in, which directly dereference the pte, so let's fix those up. Unfortunately there is no reliable automated mechanism to catch these; I'm relying on a combination of Coccinelle (which throws up a lot of false positives) and some compiler magic to force a compiler error on dereference (While this approach finds dereferences, it also yields a non-booting kernel so can't be committed). Link: https://lkml.kernel.org/r/20231114154945.490401-1-ryan.roberts@arm.com Signed-off-by: Ryan Roberts Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 5f74f820f6fc844b95f9e5e406e0a07d97510420 Author: Helge Deller Date: Mon Nov 13 11:12:57 2023 +0100 parisc: fix mmap_base calculation when stack grows upwards Matoro reported various userspace crashes on the parisc platform with kernel 6.6 and bisected it to commit 3033cd430768 ("parisc: Use generic mmap top-down layout and brk randomization"). That commit switched parisc to use the common infrastructure to calculate mmap_base, but missed that the mmap_base() function takes care for architectures where the stack grows downwards only. Fix the mmap_base() calculation to include the stack-grows-upwards case and thus fix the userspace crashes on parisc. Link: https://lkml.kernel.org/r/ZVH2qeS1bG7/1J/l@p100 Fixes: 3033cd430768 ("parisc: Use generic mmap top-down layout and brk randomization") Signed-off-by: Helge Deller Reported-by: matoro Tested-by: matoro Cc: [6.6+] Signed-off-by: Andrew Morton commit 13b2a4b22e98ff80b888a160a2acd92d81b05925 Author: Hyeongtak Ji Date: Fri Nov 10 14:37:09 2023 +0900 mm/damon/core.c: avoid unintentional filtering out of schemes The function '__damos_filter_out()' causes DAMON to always filter out schemes whose filter type is anon or memcg if its matching value is set to false. This commit addresses the issue by ensuring that '__damos_filter_out()' no longer applies to filters whose type is 'anon' or 'memcg'. Link: https://lkml.kernel.org/r/1699594629-3816-1-git-send-email-hyeongtak.ji@gmail.com Fixes: ab9bda001b681 ("mm/damon/core: introduce address range type damos filter") Signed-off-by: Hyeongtak Ji Reviewed-by: SeongJae Park Cc: Signed-off-by: Andrew Morton commit 24948e3b7b12e0031a6edb4f49bbb9fb2ad1e4e9 Author: Roman Gushchin Date: Tue Nov 7 09:18:02 2023 -0800 mm: kmem: drop __GFP_NOFAIL when allocating objcg vectors Objcg vectors attached to slab pages to store slab object ownership information are allocated using gfp flags for the original slab allocation. Depending on slab page order and the size of slab objects, objcg vector can take several pages. If the original allocation was done with the __GFP_NOFAIL flag, it triggered a warning in the page allocation code. Indeed, order > 1 pages should not been allocated with the __GFP_NOFAIL flag. Fix this by simply dropping the __GFP_NOFAIL flag when allocating the objcg vector. It effectively allows to skip the accounting of a single slab object under a heavy memory pressure. An alternative would be to implement the mechanism to fallback to order-0 allocations for accounting metadata, which is also not perfect because it will increase performance penalty and memory footprint of the kernel memory accounting under memory pressure. Link: https://lkml.kernel.org/r/ZUp8ZFGxwmCx4ZFr@P9FQF9L96D.corp.robot.car Signed-off-by: Roman Gushchin Reported-by: Christoph Lameter Closes: https://lkml.kernel.org/r/6b42243e-f197-600a-5d22-56bd728a5ad8@gentwo.org Acked-by: Shakeel Butt Cc: Matthew Wilcox Cc: Signed-off-by: Andrew Morton commit ae636ae2bbfd9279f5681dbf320d1da817e52b68 Author: SeongJae Park Date: Mon Nov 6 23:34:08 2023 +0000 mm/damon/sysfs-schemes: handle tried region directory allocation failure DAMON sysfs interface's before_damos_apply callback (damon_sysfs_before_damos_apply()), which creates the DAMOS tried regions for each DAMOS action applied region, is not handling the allocation failure for the sysfs directory data. As a result, NULL pointer derefeence is possible. Fix it by handling the case. Link: https://lkml.kernel.org/r/20231106233408.51159-4-sj@kernel.org Fixes: f1d13cacabe1 ("mm/damon/sysfs: implement DAMOS tried regions update command") Signed-off-by: SeongJae Park Cc: [6.2+] Signed-off-by: Andrew Morton commit 84055688b6bc075c92a88e2d6c3ad26ab93919f9 Author: SeongJae Park Date: Mon Nov 6 23:34:07 2023 +0000 mm/damon/sysfs-schemes: handle tried regions sysfs directory allocation failure DAMOS tried regions sysfs directory allocation function (damon_sysfs_scheme_regions_alloc()) is not handling the memory allocation failure. In the case, the code will dereference NULL pointer. Handle the failure to avoid such invalid access. Link: https://lkml.kernel.org/r/20231106233408.51159-3-sj@kernel.org Fixes: 9277d0367ba1 ("mm/damon/sysfs-schemes: implement scheme region directory") Signed-off-by: SeongJae Park Cc: [6.2+] Signed-off-by: Andrew Morton commit b4936b544b08ed44949055b92bd25f77759ebafc Author: SeongJae Park Date: Mon Nov 6 23:34:06 2023 +0000 mm/damon/sysfs: check error from damon_sysfs_update_target() Patch series "mm/damon/sysfs: fix unhandled return values". Some of DAMON sysfs interface code is not handling return values from some functions. As a result, confusing user input handling or NULL-dereference is possible. Check those properly. This patch (of 3): damon_sysfs_update_target() returns error code for failures, but its caller, damon_sysfs_set_targets() is ignoring that. The update function seems making no critical change in case of such failures, but the behavior will look like DAMON sysfs is silently ignoring or only partially accepting the user input. Fix it. Link: https://lkml.kernel.org/r/20231106233408.51159-1-sj@kernel.org Link: https://lkml.kernel.org/r/20231106233408.51159-2-sj@kernel.org Fixes: 19467a950b49 ("mm/damon/sysfs: remove requested targets when online-commit inputs") Signed-off-by: SeongJae Park Cc: [5.19+] Signed-off-by: Andrew Morton commit a48d5bdc877b85201e42cef9c2fdf5378164c23a Author: Stefan Roesch Date: Mon Nov 6 10:19:18 2023 -0800 mm: fix for negative counter: nr_file_hugepages While qualifiying the 6.4 release, the following warning was detected in messages: vmstat_refresh: nr_file_hugepages -15664 The warning is caused by the incorrect updating of the NR_FILE_THPS counter in the function split_huge_page_to_list. The if case is checking for folio_test_swapbacked, but the else case is missing the check for folio_test_pmd_mappable. The other functions that manipulate the counter like __filemap_add_folio and filemap_unaccount_folio have the corresponding check. I have a test case, which reproduces the problem. It can be found here: https://github.com/sroeschus/testcase/blob/main/vmstat_refresh/madv.c The test case reproduces on an XFS filesystem. Running the same test case on a BTRFS filesystem does not reproduce the problem. AFAIK version 6.1 until 6.6 are affected by this problem. [akpm@linux-foundation.org: whitespace fix] [shr@devkernel.io: test for folio_test_pmd_mappable()] Link: https://lkml.kernel.org/r/20231108171517.2436103-1-shr@devkernel.io Link: https://lkml.kernel.org/r/20231106181918.1091043-1-shr@devkernel.io Signed-off-by: Stefan Roesch Co-debugged-by: Johannes Weiner Acked-by: Johannes Weiner Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand Reviewed-by: Yang Shi Cc: Rik van Riel Cc: Signed-off-by: Andrew Morton commit edf14544324dd036183fafe372fe5709708bdddd Author: Breno Leitao Date: Fri Nov 3 10:34:00 2023 -0700 selftests/mm: add hugetlb_fault_after_madv to .gitignore commit 116d57303a05 ("selftests/mm: add a new test for madv and hugetlb") added a new test case, but, it didn't add the binary name in tools/testing/selftests/mm/.gitignore. Add hugetlb_fault_after_madv to tools/testing/selftests/mm/.gitignore. Link: https://lkml.kernel.org/r/20231103173400.1608403-2-leitao@debian.org Fixes: 116d57303a05 ("selftests/mm: add a new test for madv and hugetlb") Signed-off-by: Breno Leitao Reported-by: Ryan Roberts Closes: https://lore.kernel.org/all/662df57e-47f1-4c15-9b84-f2f2d587fc5c@arm.com/ Signed-off-by: Andrew Morton commit dd9b35efd719be242e227f9eebad1e50ea5c914f Author: Breno Leitao Date: Fri Nov 3 10:33:59 2023 -0700 selftests/mm: restore number of hugepages The test mm `hugetlb_fault_after_madv` selftest needs one and only one huge page to run, thus it sets `/proc/sys/vm/nr_hugepages` to 1. The problem is that further tests require the previous number of hugepages allocated in order to succeed. Save the number of huge pages before changing it, and restore it once the test finishes, so, further tests could run successfully. Link: https://lkml.kernel.org/r/20231103173400.1608403-1-leitao@debian.org Fixes: 116d57303a05 ("selftests/mm: add a new test for madv and hugetlb") Signed-off-by: Breno Leitao Reported-by: Ryan Roberts Closes: https://lore.kernel.org/all/662df57e-47f1-4c15-9b84-f2f2d587fc5c@arm.com/ Signed-off-by: Andrew Morton commit 9297e5360c3bd777f95d5146dbeda7fb9ba4273a Author: Muhammad Usama Anjum Date: Fri Nov 3 23:23:42 2023 +0500 selftests: mm: fix some build warnings Fix build warnings: pagemap_ioctl.c:1154:38: warning: format `%s' expects a matching `char *' argument [-Wformat=] pagemap_ioctl.c:1162:51: warning: format `%ld' expects argument of type `long int', but argument 2 has type `int' [-Wformat=] pagemap_ioctl.c:1192:51: warning: format `%ld' expects argument of type `long int', but argument 2 has type `int' [-Wformat=] pagemap_ioctl.c:1600:51: warning: format `%ld' expects argument of type `long int', but argument 2 has type `int' [-Wformat=] pagemap_ioctl.c:1628:51: warning: format `%ld' expects argument of type `long int', but argument 2 has type `int' [-Wformat=] Link: https://lkml.kernel.org/r/20231103182343.2874015-2-usama.anjum@collabora.com Fixes: 46fd75d4a3c9 ("selftests: mm: add pagemap ioctl tests") Signed-off-by: Muhammad Usama Anjum Cc: Shuah Khan Cc: Ryan Roberts Signed-off-by: Andrew Morton commit 019b277b680f5b95135c042c78dd79318d8f9e3c Author: Muhammad Usama Anjum Date: Fri Nov 3 23:23:41 2023 +0500 selftests: mm: skip whole test instead of failure Some architectures don't support userfaultfd. Skip running the whole test on them instead of registering the failure. Link: https://lkml.kernel.org/r/20231103182343.2874015-1-usama.anjum@collabora.com Fixes: 46fd75d4a3c9 ("selftests: mm: add pagemap ioctl tests") Reported-by: Ryan Roberts Closes: https://lore.kernel.org/all/f8463381-2697-49e9-9460-9dc73452830d@arm.com Signed-off-by: Muhammad Usama Anjum Cc: Shuah Khan Signed-off-by: Andrew Morton commit 85c2ceaafbd306814a3a4740bf4d95ac26a8b36a Author: Dan Carpenter Date: Mon Nov 6 17:07:40 2023 +0300 mm/damon/sysfs: eliminate potential uninitialized variable warning The "err" variable is not initialized if damon_target_has_pid(ctx) is false and sys_target->regions->nr is zero. Link: https://lkml.kernel.org/r/739e6aaf-a634-4e33-98a8-16546379ec9f@moroto.mountain Fixes: 0bcd216c4741 ("mm/damon/sysfs: update monitoring target regions for online input commit") Signed-off-by: Dan Carpenter Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 5d639b60971f003d3a9b2b31f8ec73b0718b5d57 Author: Stefan Binding Date: Wed Nov 15 16:21:16 2023 +0000 ALSA: hda/realtek: Add quirks for HP Laptops These HP laptops use Realtek HDA codec combined with 2 or 4 CS35L41 Amplifiers using SPI with Internal Boost. Signed-off-by: Stefan Binding Cc: Link: https://lore.kernel.org/r/20231115162116.494968-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 61cbc08fdb04fd445458b0f4cba7e6929afdfaef Author: Stefan Binding Date: Wed Nov 15 16:21:15 2023 +0000 ALSA: hda/realtek: Add quirks for ASUS 2024 Zenbooks These ASUS Zenbook laptops use Realtek HDA codec combined with 2xCS35L41 Amplifiers using SPI or I2C with External Boost or Internal Boost. Signed-off-by: Stefan Binding Cc: Link: https://lore.kernel.org/r/20231115162116.494968-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit ae1aadb1eb8d3cbc52e42bee71d67bd4a71f9f07 Author: Dave Airlie Date: Thu Nov 16 00:39:33 2023 +1000 nouveau: don't fail driver load if no display hw present. If we get back ENODEV don't fail load. There are nvidia devices that don't have display blocks and the driver should work on those. Fixes: 15740541e8f0 ("drm/nouveau/devinit/tu102-: prepare for GSP-RM") Link: https://gitlab.freedesktop.org/drm/nouveau/-/issues/270 Signed-off-by: Dave Airlie Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20231115143933.261287-1-airlied@gmail.com commit c1f342f35f820b33390571293498c3e2e9bc77ec Author: José Pekkarinen Date: Wed Nov 15 16:50:23 2023 +0000 Input: psmouse - enable Synaptics InterTouch for ThinkPad L14 G1 Observed on dmesg of my laptop I see the following output: [ 19.898700] psmouse serio1: synaptics: queried max coordinates: x [..5678], y [..4694] [ 19.936057] psmouse serio1: synaptics: queried min coordinates: x [1266..], y [1162..] [ 19.936076] psmouse serio1: synaptics: Your touchpad (PNP: LEN0411 PNP0f13) says it can support a different bus. If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org. [ 20.008901] psmouse serio1: synaptics: Touchpad model: 1, fw: 10.32, id: 0x1e2a1, caps: 0xf014a3/0x940300/0x12e800/0x500000, board id: 3471, fw id: 2909640 [ 20.008925] psmouse serio1: synaptics: serio: Synaptics pass-through port at isa0060/serio1/input0 [ 20.053344] input: SynPS/2 Synaptics TouchPad as /devices/platform/i8042/serio1/input/input7 [ 20.397608] mousedev: PS/2 mouse device common for all mice This patch will add its pnp id to the smbus list to produce the setup of intertouch for the device. Signed-off-by: José Pekkarinen Link: https://lore.kernel.org/r/20231114063607.71772-1-jose.pekkarinen@foxhound.fi Signed-off-by: Dmitry Torokhov commit 8049ba5d0a28c7208285e94e71a8df5e41a2e889 Author: Qu Wenruo Date: Sat Nov 11 07:14:57 2023 +1030 btrfs: do not abort transaction if there is already an existing qgroup [BUG] Syzbot reported a regression that after commit 6ed05643ddb1 ("btrfs: create qgroup earlier in snapshot creation") we can trigger transaction abort during snapshot creation: BTRFS: Transaction aborted (error -17) WARNING: CPU: 0 PID: 5057 at fs/btrfs/transaction.c:1778 create_pending_snapshot+0x25f4/0x2b70 fs/btrfs/transaction.c:1778 Modules linked in: CPU: 0 PID: 5057 Comm: syz-executor225 Not tainted 6.6.0-syzkaller-15365-g305230142ae0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 RIP: 0010:create_pending_snapshot+0x25f4/0x2b70 fs/btrfs/transaction.c:1778 Call Trace: create_pending_snapshots+0x195/0x1d0 fs/btrfs/transaction.c:1967 btrfs_commit_transaction+0xf1c/0x3730 fs/btrfs/transaction.c:2440 create_snapshot+0x4a5/0x7e0 fs/btrfs/ioctl.c:845 btrfs_mksubvol+0x5d0/0x750 fs/btrfs/ioctl.c:995 btrfs_mksnapshot+0xb5/0xf0 fs/btrfs/ioctl.c:1041 __btrfs_ioctl_snap_create+0x344/0x460 fs/btrfs/ioctl.c:1294 btrfs_ioctl_snap_create+0x13c/0x190 fs/btrfs/ioctl.c:1321 btrfs_ioctl+0xbbf/0xd40 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f2f791127b9 [CAUSE] The error number is -EEXIST, which can happen for qgroup if there is already an existing qgroup and then we're trying to create a snapshot for it. [FIX] In that case, we can continue creating the snapshot, although it may lead to qgroup inconsistency, it's not so critical to abort the current transaction. So in this case, we can just ignore the non-critical errors, mostly -EEXIST (there is already a qgroup). Reported-by: syzbot+4d81015bc10889fd12ea@syzkaller.appspotmail.com Fixes: 6ed05643ddb1 ("btrfs: create qgroup earlier in snapshot creation") Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 1645c283a87c61f84b2bffd81f50724df959b11a Author: Qu Wenruo Date: Tue Oct 24 12:41:11 2023 +1030 btrfs: tree-checker: add type and sequence check for inline backrefs [BUG] There is a bug report that ntfs2btrfs had a bug that it can lead to transaction abort and the filesystem flips to read-only. [CAUSE] For inline backref items, kernel has a strict requirement for their ordered, they must follow the following rules: - All btrfs_extent_inline_ref::type should be in an ascending order - Within the same type, the items should follow a descending order by their sequence number For EXTENT_DATA_REF type, the sequence number is result from hash_extent_data_ref(). For other types, their sequence numbers are btrfs_extent_inline_ref::offset. Thus if there is any code not following above rules, the resulted inline backrefs can prevent the kernel to locate the needed inline backref and lead to transaction abort. [FIX] Ntrfs2btrfs has already fixed the problem, and btrfs-progs has added the ability to detect such problems. For kernel, let's be more noisy and be more specific about the order, so that the next time kernel hits such problem we would reject it in the first place, without leading to transaction abort. Link: https://github.com/kdave/btrfs-progs/pull/622 Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 430143b0d3611f4a9c8434319e5e504244749e79 Author: Brenton Simpson Date: Tue Nov 14 23:38:59 2023 +0000 drm: panel-orientation-quirks: Add quirk for Lenovo Legion Go The Legion Go has a 2560x1600 portrait screen, with the native "up" facing the right controller (90° CW from the rest of the device). Signed-off-by: Brenton Simpson Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231114233859.274189-1-appsforartists@google.com commit 1fda5bb66ad8fb24ecb3858e61a13a6548428898 Author: Yonghong Song Date: Fri Nov 10 17:39:28 2023 -0800 bpf: Do not allocate percpu memory at init stage Kirill Shutemov reported significant percpu memory consumption increase after booting in 288-cpu VM ([1]) due to commit 41a5db8d8161 ("bpf: Add support for non-fix-size percpu mem allocation"). The percpu memory consumption is increased from 111MB to 969MB. The number is from /proc/meminfo. I tried to reproduce the issue with my local VM which at most supports upto 255 cpus. With 252 cpus, without the above commit, the percpu memory consumption immediately after boot is 57MB while with the above commit the percpu memory consumption is 231MB. This is not good since so far percpu memory from bpf memory allocator is not widely used yet. Let us change pre-allocation in init stage to on-demand allocation when verifier detects there is a need of percpu memory for bpf program. With this change, percpu memory consumption after boot can be reduced signicantly. [1] https://lore.kernel.org/lkml/20231109154934.4saimljtqx625l3v@box.shutemov.name/ Fixes: 41a5db8d8161 ("bpf: Add support for non-fix-size percpu mem allocation") Reported-and-tested-by: Kirill A. Shutemov Signed-off-by: Yonghong Song Acked-by: Hou Tao Link: https://lore.kernel.org/r/20231111013928.948838-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit bd6da690c27d75cae432c09162d054b34fa2156f Author: Mustafa Ismail Date: Tue Nov 14 11:02:46 2023 -0600 RDMA/irdma: Add wait for suspend on SQD Currently, there is no wait for the QP suspend to complete on a modify to SQD state. Add a wait, after the modify to SQD state, for the Suspend Complete AE. While we are at it, update the suspend timeout value in irdma_prep_tc_change to use IRDMA_EVENT_TIMEOUT_MS too. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Signed-off-by: Mustafa Ismail Signed-off-by: Shiraz Saleem Link: https://lore.kernel.org/r/20231114170246.238-3-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky commit ba12ab66aa83a2340a51ad6e74b284269745138c Author: Mustafa Ismail Date: Tue Nov 14 11:02:45 2023 -0600 RDMA/irdma: Do not modify to SQD on error Remove the modify to SQD before going to ERROR state. It is not needed. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Signed-off-by: Mustafa Ismail Signed-off-by: Shiraz Saleem Link: https://lore.kernel.org/r/20231114170246.238-2-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky commit a0d45c3f596be53c1bd8822a1984532d14fdcea9 Author: Jens Axboe Date: Tue Nov 14 09:55:50 2023 -0700 io_uring/fdinfo: remove need for sqpoll lock for thread/pid retrieval A previous commit added a trylock for getting the SQPOLL thread info via fdinfo, but this introduced a regression where we often fail to get it if the thread is busy. For that case, we end up not printing the current CPU and PID info. Rather than rely on this lock, just print the pid we already stored in the io_sq_data struct, and ensure we update the current CPU every time we've slept or potentially rescheduled. The latter won't potentially be 100% accurate, but that wasn't the case before either as the task can get migrated at any time unless it has been pinned at creation time. We retain keeping the io_sq_data dereference inside the ctx->uring_lock, as it has always been, as destruction of the thread and data happen below that. We could make this RCU safe, but there's little point in doing that. With this, we always print the last valid information we had, rather than have spurious outputs with missing information. Fixes: 7644b1a1c9a7 ("io_uring/fdinfo: lock SQ thread while retrieving thread cpu/pid") Signed-off-by: Jens Axboe commit 92c47597db7d8fb500a4b04ebd457ec7360279cc Author: Harshit Mogalapalli Date: Mon Nov 13 12:07:40 2023 -0800 platform/x86: hp-bioscfg: Remove unused obj in hp_add_other_attributes() acpi_object *obj is unused in this function, so delete it, also delete a unnecessary kfree(obj); Signed-off-by: Harshit Mogalapalli Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20231113200742.3593548-4-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen commit f40f939917b2b4cbf18450096c0ce1c58ed59fae Author: Harshit Mogalapalli Date: Mon Nov 13 12:07:39 2023 -0800 platform/x86: hp-bioscfg: Fix error handling in hp_add_other_attributes() 'attr_name_kobj' is allocated using kzalloc, but on all the error paths it is not freed, hence we have a memory leak. Fix the error path before kobject_init_and_add() by adding kfree(). kobject_put() must be always called after passing the object to kobject_init_and_add(). Only the error path which is immediately next to kobject_init_and_add() calls kobject_put() and not any other error path after it. Fix the error handling after kobject_init_and_add() by moving the kobject_put() into the goto label err_other_attr_init that is already used by all the error paths after kobject_init_and_add(). Fixes: a34fc329b189 ("platform/x86: hp-bioscfg: bioscfg") Cc: stable@vger.kernel.org # 6.6.x: c5dbf0416000: platform/x86: hp-bioscfg: Simplify return check in hp_add_other_attributes() Cc: stable@vger.kernel.org # 6.6.x: 5736aa9537c9: platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes() Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202309201412.on0VXJGo-lkp@intel.com/ Signed-off-by: Harshit Mogalapalli [ij: Added the stable dep tags] Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20231113200742.3593548-3-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen commit 9e88b493157a9901fa498f23cc3c9ab82b43ce83 Author: Maarten Lankhorst Date: Wed Nov 15 13:36:25 2023 +0100 ALSA: hda: i915: Alays handle -EPROBE_DEFER It turns out that even if the comment says that the driver can load fine, it's not really the case and no codecs are detected. Specifically for -EPROBE_DEFER, always fail the probe. This fixes a regression when HDA-intel is loaded before i915. Reported-by: Ville Syrjälä Closes: https://lore.kernel.org/r/ZVNUxZzCGcxQzqJX@intel.com Signed-off-by: Maarten Lankhorst Tested-by: Kai Vehmanen Fixes: e6d0c13e9f46 ("ALSA: hda: i915: Remove extra argument from snd_hdac_i915_init") Link: https://gitlab.freedesktop.org/drm/intel/-/issues/9671 Link: https://lore.kernel.org/r/20231115123625.74286-1-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit 5736aa9537c9b8927dec32d3d47c8c31fe560f62 Author: Harshit Mogalapalli Date: Mon Nov 13 12:07:38 2023 -0800 platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes() attr_name_kobj's memory allocation is done with mutex_lock() held, this is not needed. Move allocation outside of mutex_lock() so unlock is not needed when allocation fails. Suggested-by: Ilpo Järvinen Signed-off-by: Harshit Mogalapalli Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20231113200742.3593548-2-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen commit c5dbf04160005e07e8ca7232a7faa77ab1547ae0 Author: Harshit Mogalapalli Date: Mon Nov 13 12:07:37 2023 -0800 platform/x86: hp-bioscfg: Simplify return check in hp_add_other_attributes() All cases in switch-case have a same goto on error, move the return check out of the switch. This is a cleanup. Signed-off-by: Harshit Mogalapalli Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20231113200742.3593548-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen commit 7a3c36eef9a5d13b16aa954da54224c9c6bed339 Author: Stuart Hayhurst Date: Tue Nov 14 11:38:08 2023 +0000 platform/x86: ideapad-laptop: Set max_brightness before using it max_brightness is used in ideapad_kbd_bl_brightness_get() before it's set, causing ideapad_kbd_bl_brightness_get() to return -EINVAL sometimes. Fixes: ecaa1867b524 ("platform/x86: ideapad-laptop: Add support for keyboard backlights using KBLC ACPI symbol") Signed-off-by: Stuart Hayhurst Cc: stable@vger.kernel.org Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20231114114055.6220-2-stuart.a.hayhurst@gmail.com Signed-off-by: Ilpo Järvinen commit 9fadd4509966e375952f31ae954ab5eae76f90fe Author: Jithu Joseph Date: Thu Nov 2 12:52:18 2023 -0700 MAINTAINERS: Remove stale entry for SBL platform driver Maurice is no longer with Intel and his e-mail address is no longer active. Remove the stale entry from Slim boot loader section. Signed-off-by: Jithu Joseph Link: https://lore.kernel.org/r/20231102195218.143440-1-jithu.joseph@intel.com Signed-off-by: Ilpo Järvinen commit 674e318089468ece99aef4796eaef7add57f36b2 Author: Gal Pressman Date: Tue Nov 14 09:56:18 2023 +0200 net: Fix undefined behavior in netdev name allocation Cited commit removed the strscpy() call and kept the snprintf() only. It is common to use 'dev->name' as the format string before a netdev is registered, this results in 'res' and 'name' pointers being equal. According to POSIX, if copying takes place between objects that overlap as a result of a call to sprintf() or snprintf(), the results are undefined. Add back the strscpy() and use 'buf' as an intermediate buffer. Fixes: 7ad17b04dc7b ("net: trust the bitmap in __dev_alloc_name()") Cc: Jakub Kicinski Reviewed-by: Vlad Buslov Signed-off-by: Gal Pressman Reviewed-by: Jakub Kicinski Reviewed-by: Simon Horman Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller commit 4198a9b571065978632276264e01d71d68000ac5 Author: Maria Yu Date: Wed Nov 15 18:28:24 2023 +0800 pinctrl: avoid reload of p state in list iteration When in the list_for_each_entry iteration, reload of p->state->settings with a local setting from old_state will turn the list iteration into an infinite loop. The typical symptom when the issue happens, will be a printk message like: "not freeing pin xx (xxx) as part of deactivating group xxx - it is already used for some other setting". This is a compiler-dependent problem, one instance occurred using Clang version 10.0 on the arm64 architecture with linux version 4.19. Fixes: 6e5e959dde0d ("pinctrl: API changes to support multiple states per device") Signed-off-by: Maria Yu Cc: Link: https://lore.kernel.org/r/20231115102824.23727-1-quic_aiquny@quicinc.com Signed-off-by: Linus Walleij commit 00a614fc3527ba8846e6d823013bcf724e9a68f6 Author: Arnd Bergmann Date: Fri Oct 27 17:26:23 2023 +0200 accel/ivpu: avoid build failure with CONFIG_PM=n The usage count of struct dev_pm_info is an implementation detail that is only available if CONFIG_PM is enabled, so printing it in a debug message causes a build failure in configurations without PM: In file included from include/linux/device.h:15, from include/linux/pci.h:37, from drivers/accel/ivpu/ivpu_pm.c:8: drivers/accel/ivpu/ivpu_pm.c: In function 'ivpu_rpm_get_if_active': drivers/accel/ivpu/ivpu_pm.c:254:51: error: 'struct dev_pm_info' has no member named 'usage_count' 254 | atomic_read(&vdev->drm.dev->power.usage_count)); | ^ include/linux/dev_printk.h:129:48: note: in definition of macro 'dev_printk' 129 | _dev_printk(level, dev, fmt, ##__VA_ARGS__); \ | ^~~~~~~~~~~ drivers/accel/ivpu/ivpu_drv.h:75:17: note: in expansion of macro 'dev_dbg' 75 | dev_dbg((vdev)->drm.dev, "[%s] " fmt, #type, ##args); \ | ^~~~~~~ drivers/accel/ivpu/ivpu_pm.c:253:9: note: in expansion of macro 'ivpu_dbg' 253 | ivpu_dbg(vdev, RPM, "rpm_get_if_active count %d\n", | ^~~~~~~~ The print message does not seem essential, so the easiest workaround is to just remove it. Fixes: c39dc15191c4 ("accel/ivpu: Read clock rate only if device is up") Signed-off-by: Arnd Bergmann Reviewed-by: Stanislaw Gruszka Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20231027152633.528490-1-arnd@kernel.org (cherry picked from commit 1470acbef122c7e2e588f6346ce459c26d0568a2) Signed-off-by: Jacek Lawrynowicz commit efc0c8363bc6dab2cd540acc886e6097deee8bb9 Author: Niklas Söderlund Date: Mon Nov 13 17:44:12 2023 +0100 dt-bindings: net: ethernet-controller: Fix formatting error When moving the *-internal-delay-ps properties to only apply for RGMII interface modes there where a typo in the text formatting. Signed-off-by: Niklas Söderlund Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 9e2e7efbbbff69d8340abb56d375dd79d1f5770f Author: Johnathan Mantey Date: Mon Nov 13 08:30:29 2023 -0800 Revert ncsi: Propagate carrier gain/loss events to the NCSI controller This reverts commit 3780bb29311eccb7a1c9641032a112eed237f7e3. The cited commit introduced unwanted behavior. The intent for the commit was to be able to detect carrier loss/gain for just the NIC connected to the BMC. The unwanted effect is a carrier loss for auxiliary paths also causes the BMC to lose carrier. The BMC never regains carrier despite the secondary NIC regaining a link. This change, when merged, needs to be backported to stable kernels. 5.4-stable, 5.10-stable, 5.15-stable, 6.1-stable, 6.5-stable Fixes: 3780bb29311e ("ncsi: Propagate carrier gain/loss events to the NCSI controller") CC: stable@vger.kernel.org Signed-off-by: Johnathan Mantey Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit cee96422e863f0b0e9d3d0c2d617271ef2255858 Author: Juergen Gross Date: Thu Sep 28 11:25:32 2023 +0200 xen/events: remove some info_for_irq() calls in pirq handling Instead of the IRQ number user the struct irq_info pointer as parameter in the internal pirq related functions. This allows to drop some calls of info_for_irq(). Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Signed-off-by: Juergen Gross commit 3fcdaf3d7634338c3f5cbfa7451eb0b6b0024844 Author: Juergen Gross Date: Thu Sep 28 09:09:52 2023 +0200 xen/events: modify internal [un]bind interfaces Modify the internal bind- and unbind-interfaces to take a struct irq_info parameter. When allocating a new IRQ pass the pointer from the allocating function further up. This will reduce the number of info_for_irq() calls and make the code more efficient. Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Signed-off-by: Juergen Gross commit 5dd9ad32d7758b1a76742f394acf0eb3ac8a636a Author: Juergen Gross Date: Wed Sep 27 10:29:02 2023 +0200 xen/events: drop xen_allocate_irqs_dynamic() Instead of having a common function for allocating a single IRQ or a consecutive number of IRQs, split up the functionality into the callers of xen_allocate_irqs_dynamic(). This allows to handle any allocation error in xen_irq_init() gracefully instead of panicing the system. Let xen_irq_init() return the irq_info pointer or NULL in case of an allocation error. Additionally set the IRQ into irq_info already at allocation time, as otherwise the IRQ would be '0' (which is a valid IRQ number) until being set. Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Signed-off-by: Juergen Gross commit c42d9eeef8e5ba9292eda36fd8e3c11f35ee065c Merge: 86d11b0e20c09 782ce431613cf Author: Linus Torvalds Date: Tue Nov 14 23:47:12 2023 -0500 Merge tag 'hardening-v6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening fixes from Kees Cook: - stackleak: add declarations for global functions (Arnd Bergmann) - gcc-plugins: randstruct: Only warn about true flexible arrays (Kees Cook) - gcc-plugins: latent_entropy: Fix description typo (Konstantin Runov) * tag 'hardening-v6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: gcc-plugins: latent_entropy: Fix typo (args -> argc) in plugin description gcc-plugins: randstruct: Only warn about true flexible arrays stackleak: add declarations for global functions commit 61b85cb0d773115d9a4b20c3e67286844cf73f34 Author: Kent Overstreet Date: Tue Nov 14 18:52:22 2023 -0500 bcachefs: six locks: Fix lost wakeup In percpu reader mode, trylock() for read had a lost wakeup: on failure to get the lock, we may have caused a writer to fail to get the lock, because we temporarily elevated the reader count. We need to check for waiters after decrementing the read count - not before. Signed-off-by: Kent Overstreet commit 62d73dfc44d54c97e0df6b947f0bccf6c4b8030e Author: Kent Overstreet Date: Sun Nov 12 21:46:52 2023 -0500 bcachefs: Fix no_data_io mode checksum check In no_data_io mode, we expect data checksums to be wrong - don't want to spew the log with them. Signed-off-by: Kent Overstreet commit db18ef1a02bc2cd924f86b2582302f2c2711b67c Author: Kent Overstreet Date: Mon Nov 13 21:17:19 2023 -0500 bcachefs: Fix bch2_check_nlinks() for snapshots When searching the link table for the matching inode, we were searching for a specific - incorrect - snapshot ID as well, causing us to fail to find the inode. Signed-off-by: Kent Overstreet commit 7125063fc6dfb77138b3a100527f3d8f9203ff2a Author: Kent Overstreet Date: Thu Mar 2 23:52:57 2023 -0500 bcachefs: Don't decrease BTREE_ITER_MAX when LOCKDEP=y Running with fewer max btree paths doesn't work anymore when replication is enabled - as we've added e.g. the freespace and bucket gens btrees, we naturally end up needing more btree paths. This is an issue with lockdep, we end up taking more locks than lockdep will track (the MAX_LOCKD_DEPTH constant). But bcachefs as merged does not yet support lockdep anyways, so we can leave that for later. Signed-off-by: Kent Overstreet commit 497c57a303590ea69ace23506e182c489e85694d Author: Kent Overstreet Date: Sun Nov 12 17:02:08 2023 -0500 bcachefs: Disable debug log statements The journal read path had some informational log statements preperatory for ZNS support - they're not of interest to users, so we can turn them off. Signed-off-by: Kent Overstreet commit f42fa17883e73d8509fff5925781d4157db82f00 Author: Kent Overstreet Date: Sun Nov 12 15:47:02 2023 -0500 bcachefs: Fix missing transaction commit In may_delete_deleted_inode(), there's a corner case when a snapshot was taken while we had an unlinked inode: we don't want to delete the inode in the internal (shared) snapshot node, since it might have been reattached in a descendent snapshot. Instead we propagate the key to any snapshot leaves it doesn't exist in, so that it can be deleted there if necessary, and then clear the unlinked flag in the internal node. But we forgot to commit after clearing the unlinked flag, causing us to go into an infinite loop. Signed-off-by: Kent Overstreet commit 178c4873fd06c0361d260547ce70fcdc29b74809 Author: Kent Overstreet Date: Sun Nov 12 14:15:35 2023 -0500 bcachefs: Fix error path in bch2_mount() This fixes a bug discovered by generic/388 where sb->s_fs_info was NULL while the superblock was still active - the error path was entirely fubar, and was trying to do something unclear and unecessary. Signed-off-by: Kent Overstreet commit b783fc4d1366658200bf759e1010655a9e2e145c Author: Daniel J Blueman Date: Sun Nov 12 00:38:41 2023 +0000 bcachefs: Fix potential sleeping during mount During mount, bcachefs mount option processing may sleep while allocating a string buffer. Fix this by reference counting in order to take the atomic path. Signed-off-by: Daniel J Blueman Signed-off-by: Kent Overstreet commit 069749688ea4bbaeff0ca3b229b443ea96b03757 Author: Kent Overstreet Date: Sat Nov 11 22:15:59 2023 -0500 bcachefs: Fix iterator leak in may_delete_deleted_inode() may_delete_deleted_inode() was returning without exiting a btree iterator, eventually causing propagate_key_to_snaphot_leaves() to go into an infinite loop hitting btree_trans_too_many_iters(). Signed-off-by: Kent Overstreet commit 006ccc3090e2f30f5f97857f3946312692a5279e Author: Kent Overstreet Date: Sat Nov 4 22:54:26 2023 -0400 bcachefs: Kill journal pre-reservations This deletes the complicated and somewhat expensive journal pre-reservation machinery in favor of just using journal watermarks: when the journal is more than half full, we run journal reclaim more aggressively, and when the journal is more than 3/4s full we only allow journal reclaim to get new journal reservations. Signed-off-by: Kent Overstreet commit 86d11b0e20c09e0a91cd2aa57b115000274e2ac5 Merge: 2e6ef8aaba6b7 77618db346455 Author: Linus Torvalds Date: Tue Nov 14 23:35:31 2023 -0500 Merge tag 'zstd-linus-v6.7-rc2' of https://github.com/terrelln/linux Pull Zstd fix from Nick Terrell: "Only a single line change to fix a benign UBSAN warning" * tag 'zstd-linus-v6.7-rc2' of https://github.com/terrelln/linux: zstd: Fix array-index-out-of-bounds UBSAN warning commit a133eae83a1fd614751b1a34752716bad5f6409e Merge: 278a370c17660 7cefbe5e1dacc Author: Jakub Kicinski Date: Tue Nov 14 20:10:45 2023 -0800 Merge branch 'mptcp-misc-fixes-for-v6-7' Matthieu Baerts says: ==================== mptcp: misc. fixes for v6.7 Here are a few fixes related to MPTCP: - Patch 1 limits GSO max size to ~64K when MPTCP is being used due to a spec limit. 'gso_max_size' can exceed the max value supported by MPTCP since v5.19. - Patch 2 fixes a possible NULL pointer dereference on close that can happen since v6.7-rc1. - Patch 3 avoids sending a RM_ADDR when the corresponding address is no longer tracked locally. A regression for a fix backported to v5.19. - Patch 4 adds a missing lock when changing the IP TOS with setsockopt(). A fix for v5.17. - Patch 5 fixes an expectation when running MPTCP Join selftest with the checksum option (-C). An issue present since v6.1. ==================== Link: https://lore.kernel.org/r/20231114-upstream-net-20231113-mptcp-misc-fixes-6-7-rc2-v1-0-7b9cd6a7b7f4@kernel.org Signed-off-by: Jakub Kicinski commit 7cefbe5e1dacc7236caa77e9d072423f21422fe2 Author: Paolo Abeni Date: Tue Nov 14 00:16:17 2023 +0100 selftests: mptcp: fix fastclose with csum failure Running the mp_join selftest manually with the following command line: ./mptcp_join.sh -z -C leads to some failures: 002 fastclose server test # ... rtx [fail] got 1 MP_RST[s] TX expected 0 # ... rstrx [fail] got 1 MP_RST[s] RX expected 0 The problem is really in the wrong expectations for the RST checks implied by the csum validation. Note that the same check is repeated explicitly in the same test-case, with the correct expectation and pass successfully. Address the issue explicitly setting the correct expectation for the failing checks. Reported-by: Xiumei Mu Fixes: 6bf41020b72b ("selftests: mptcp: update and extend fastclose test-cases") Cc: stable@vger.kernel.org Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Link: https://lore.kernel.org/r/20231114-upstream-net-20231113-mptcp-misc-fixes-6-7-rc2-v1-5-7b9cd6a7b7f4@kernel.org Signed-off-by: Jakub Kicinski commit 7679d34f97b7a09fd565f5729f79fd61b7c55329 Author: Paolo Abeni Date: Tue Nov 14 00:16:16 2023 +0100 mptcp: fix setsockopt(IP_TOS) subflow locking The MPTCP implementation of the IP_TOS socket option uses the lockless variant of the TOS manipulation helper and does not hold such lock at the helper invocation time. Add the required locking. Fixes: ffcacff87cd6 ("mptcp: Support for IP_TOS for MPTCP setsockopt()") Cc: stable@vger.kernel.org Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/457 Signed-off-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Link: https://lore.kernel.org/r/20231114-upstream-net-20231113-mptcp-misc-fixes-6-7-rc2-v1-4-7b9cd6a7b7f4@kernel.org Signed-off-by: Jakub Kicinski commit 8df220b29282e8b450ea57be62e1eccd4996837c Author: Geliang Tang Date: Tue Nov 14 00:16:15 2023 +0100 mptcp: add validity check for sending RM_ADDR This patch adds the validity check for sending RM_ADDRs for userspace PM in mptcp_pm_remove_addrs(), only send a RM_ADDR when the address is in the anno_list or conn_list. Fixes: 8b1c94da1e48 ("mptcp: only send RM_ADDR in nl_cmd_remove") Cc: stable@vger.kernel.org Signed-off-by: Geliang Tang Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Link: https://lore.kernel.org/r/20231114-upstream-net-20231113-mptcp-misc-fixes-6-7-rc2-v1-3-7b9cd6a7b7f4@kernel.org Signed-off-by: Jakub Kicinski commit d109a7767273d1706b541c22b83a0323823dfde4 Author: Paolo Abeni Date: Tue Nov 14 00:16:14 2023 +0100 mptcp: fix possible NULL pointer dereference on close After the blamed commit below, the MPTCP release callback can dereference the first subflow pointer via __mptcp_set_connected() and send buffer auto-tuning. Such pointer is always expected to be valid, except at socket destruction time, when the first subflow is deleted and the pointer zeroed. If the connect event is handled by the release callback while the msk socket is finally released, MPTCP hits the following splat: general protection fault, probably for non-canonical address 0xdffffc00000000f2: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000790-0x0000000000000797] CPU: 1 PID: 26719 Comm: syz-executor.2 Not tainted 6.6.0-syzkaller-10102-gff269e2cd5ad #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 RIP: 0010:mptcp_subflow_ctx net/mptcp/protocol.h:542 [inline] RIP: 0010:__mptcp_propagate_sndbuf net/mptcp/protocol.h:813 [inline] RIP: 0010:__mptcp_set_connected+0x57/0x3e0 net/mptcp/subflow.c:424 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff8a62323c RDX: 00000000000000f2 RSI: ffffffff8a630116 RDI: 0000000000000790 RBP: ffff88803334b100 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000034 R12: ffff88803334b198 R13: ffff888054f0b018 R14: 0000000000000000 R15: ffff88803334b100 FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fbcb4f75198 CR3: 000000006afb5000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: mptcp_release_cb+0xa2c/0xc40 net/mptcp/protocol.c:3405 release_sock+0xba/0x1f0 net/core/sock.c:3537 mptcp_close+0x32/0xf0 net/mptcp/protocol.c:3084 inet_release+0x132/0x270 net/ipv4/af_inet.c:433 inet6_release+0x4f/0x70 net/ipv6/af_inet6.c:485 __sock_release+0xae/0x260 net/socket.c:659 sock_close+0x1c/0x20 net/socket.c:1419 __fput+0x270/0xbb0 fs/file_table.c:394 task_work_run+0x14d/0x240 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa92/0x2a20 kernel/exit.c:876 do_group_exit+0xd4/0x2a0 kernel/exit.c:1026 get_signal+0x23ba/0x2790 kernel/signal.c:2900 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x4b/0x110 arch/x86/entry/common.c:88 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7fb515e7cae9 Code: Unable to access opcode bytes at 0x7fb515e7cabf. RSP: 002b:00007fb516c560c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: 000000000000003c RBX: 00007fb515f9c120 RCX: 00007fb515e7cae9 RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000006 RBP: 00007fb515ec847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007fb515f9c120 R15: 00007ffc631eb968 To avoid sparkling unneeded conditionals, address the issue explicitly checking msk->first only in the critical place. Fixes: 8005184fd1ca ("mptcp: refactor sndbuf auto-tuning") Cc: stable@vger.kernel.org Reported-by: Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/454 Reported-by: Eric Dumazet Closes: https://lore.kernel.org/netdev/CANn89iLZUA6S2a=K8GObnS62KK6Jt4B7PsAs7meMFooM8xaTgw@mail.gmail.com/ Signed-off-by: Paolo Abeni Reviewed-by: Eric Dumazet Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Link: https://lore.kernel.org/r/20231114-upstream-net-20231113-mptcp-misc-fixes-6-7-rc2-v1-2-7b9cd6a7b7f4@kernel.org Signed-off-by: Jakub Kicinski commit 9fce92f050f448a0d1ddd9083ef967d9930f1e52 Author: Paolo Abeni Date: Tue Nov 14 00:16:13 2023 +0100 mptcp: deal with large GSO size After the blamed commit below, the TCP sockets (and the MPTCP subflows) can build egress packets larger than 64K. That exceeds the maximum DSS data size, the length being misrepresent on the wire and the stream being corrupted, as later observed on the receiver: WARNING: CPU: 0 PID: 9696 at net/mptcp/protocol.c:705 __mptcp_move_skbs_from_subflow+0x2604/0x26e0 CPU: 0 PID: 9696 Comm: syz-executor.7 Not tainted 6.6.0-rc5-gcd8bdf563d46 #45 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014 netlink: 8 bytes leftover after parsing attributes in process `syz-executor.4'. RIP: 0010:__mptcp_move_skbs_from_subflow+0x2604/0x26e0 net/mptcp/protocol.c:705 RSP: 0018:ffffc90000006e80 EFLAGS: 00010246 RAX: ffffffff83e9f674 RBX: ffff88802f45d870 RCX: ffff888102ad0000 netlink: 8 bytes leftover after parsing attributes in process `syz-executor.4'. RDX: 0000000080000303 RSI: 0000000000013908 RDI: 0000000000003908 RBP: ffffc90000007110 R08: ffffffff83e9e078 R09: 1ffff1100e548c8a R10: dffffc0000000000 R11: ffffed100e548c8b R12: 0000000000013908 R13: dffffc0000000000 R14: 0000000000003908 R15: 000000000031cf29 FS: 00007f239c47e700(0000) GS:ffff88811b200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f239c45cd78 CR3: 000000006a66c006 CR4: 0000000000770ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 PKRU: 55555554 Call Trace: mptcp_data_ready+0x263/0xac0 net/mptcp/protocol.c:819 subflow_data_ready+0x268/0x6d0 net/mptcp/subflow.c:1409 tcp_data_queue+0x21a1/0x7a60 net/ipv4/tcp_input.c:5151 tcp_rcv_established+0x950/0x1d90 net/ipv4/tcp_input.c:6098 tcp_v6_do_rcv+0x554/0x12f0 net/ipv6/tcp_ipv6.c:1483 tcp_v6_rcv+0x2e26/0x3810 net/ipv6/tcp_ipv6.c:1749 ip6_protocol_deliver_rcu+0xd6b/0x1ae0 net/ipv6/ip6_input.c:438 ip6_input+0x1c5/0x470 net/ipv6/ip6_input.c:483 ipv6_rcv+0xef/0x2c0 include/linux/netfilter.h:304 __netif_receive_skb+0x1ea/0x6a0 net/core/dev.c:5532 process_backlog+0x353/0x660 net/core/dev.c:5974 __napi_poll+0xc6/0x5a0 net/core/dev.c:6536 net_rx_action+0x6a0/0xfd0 net/core/dev.c:6603 __do_softirq+0x184/0x524 kernel/softirq.c:553 do_softirq+0xdd/0x130 kernel/softirq.c:454 Address the issue explicitly bounding the maximum GSO size to what MPTCP actually allows. Reported-by: Christoph Paasch Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/450 Fixes: 7c4e983c4f3c ("net: allow gso_max_size to exceed 65536") Cc: stable@vger.kernel.org Signed-off-by: Paolo Abeni Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts Link: https://lore.kernel.org/r/20231114-upstream-net-20231113-mptcp-misc-fixes-6-7-rc2-v1-1-7b9cd6a7b7f4@kernel.org Signed-off-by: Jakub Kicinski commit 278a370c1766060d2144d6cf0b06c101e1043b6d Author: Ziwei Xiao Date: Mon Nov 13 16:41:44 2023 -0800 gve: Fixes for napi_poll when budget is 0 Netpoll will explicilty pass the polling call with a budget of 0 to indicate it's clearing the Tx path only. For the gve_rx_poll and gve_xdp_poll, they were mistakenly taking the 0 budget as the indication to do all the work. Add check to avoid the rx path and xdp path being called when budget is 0. And also avoid napi_complete_done being called when budget is 0 for netpoll. Fixes: f5cedc84a30d ("gve: Add transmit and receive support") Signed-off-by: Ziwei Xiao Link: https://lore.kernel.org/r/20231114004144.2022268-1-ziweixiao@google.com Signed-off-by: Jakub Kicinski commit 67af0bdcd623586176df15994a605a036cee0223 Merge: 9d350b2b0d581 a778616e4cc2d Author: Jakub Kicinski Date: Tue Nov 14 19:56:30 2023 -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 2023-11-13 (ice) This series contains updates to ice driver only. Arkadiusz ensures the device is initialized with valid lock status value. He also removes range checking of dpll priority to allow firmware to process the request; supported values are firmware dependent. Finally, he removes setting of can change capability for pins that cannot be changed. Dan restores ability to load a package which doesn't contain a signature segment. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ice: fix DDP package download for packages without signature segment ice: dpll: fix output pin capabilities ice: dpll: fix check for dpll input priority range ice: dpll: fix initial lock status of dpll ==================== Link: https://lore.kernel.org/r/20231113230551.548489-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 9d350b2b0d5815a381b558db68a152c6658aad3d Merge: 17dd5efe5f36a 7c02f6ae676a9 Author: Jakub Kicinski Date: Tue Nov 14 19:52:14 2023 -0800 Merge branch 'pds_core-fix-irq-index-bug-and-compiler-warnings' Shannon Nelson says: ==================== pds_core: fix irq index bug and compiler warnings The first patch fixes a bug in our interrupt masking where we used the wrong index. The second patch addresses a couple of kernel test robot string truncation warnings. ==================== Link: https://lore.kernel.org/r/20231113183257.71110-1-shannon.nelson@amd.com Signed-off-by: Jakub Kicinski commit 7c02f6ae676a954216a192612040f9a0cde3adf7 Author: Shannon Nelson Date: Mon Nov 13 10:32:57 2023 -0800 pds_core: fix up some format-truncation complaints Our friendly kernel test robot pointed out a couple of potential string truncation issues. None of which were we worried about, but can be relatively easily fixed to quiet the complaints. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310211736.66syyDpp-lkp@intel.com/ Fixes: 45d76f492938 ("pds_core: set up device and adminq") Signed-off-by: Shannon Nelson Link: https://lore.kernel.org/r/20231113183257.71110-3-shannon.nelson@amd.com Signed-off-by: Jakub Kicinski commit 09d4c14c6c5e6e781a3879fed7f8e116a18b8c65 Author: Shannon Nelson Date: Mon Nov 13 10:32:56 2023 -0800 pds_core: use correct index to mask irq Use the qcq's interrupt index, not the irq number, to mask the interrupt. Since the irq number can be out of range from the number of possible interrupts, we can end up accessing and potentially scribbling on out-of-range and/or unmapped memory, making the kernel angry. [ 3116.039364] BUG: unable to handle page fault for address: ffffbeea1c3edf84 [ 3116.047059] #PF: supervisor write access in kernel mode [ 3116.052895] #PF: error_code(0x0002) - not-present page [ 3116.058636] PGD 100000067 P4D 100000067 PUD 1001f2067 PMD 10f82e067 PTE 0 [ 3116.066221] Oops: 0002 [#1] SMP NOPTI [ 3116.092948] RIP: 0010:iowrite32+0x9/0x76 [ 3116.190452] Call Trace: [ 3116.193185] [ 3116.195430] ? show_trace_log_lvl+0x1d6/0x2f9 [ 3116.200298] ? show_trace_log_lvl+0x1d6/0x2f9 [ 3116.205166] ? pdsc_adminq_isr+0x43/0x55 [pds_core] [ 3116.210618] ? __die_body.cold+0x8/0xa [ 3116.214806] ? page_fault_oops+0x16d/0x1ac [ 3116.219382] ? exc_page_fault+0xbe/0x13b [ 3116.223764] ? asm_exc_page_fault+0x22/0x27 [ 3116.228440] ? iowrite32+0x9/0x76 [ 3116.232143] pdsc_adminq_isr+0x43/0x55 [pds_core] [ 3116.237627] __handle_irq_event_percpu+0x3a/0x184 [ 3116.243088] handle_irq_event+0x57/0xb0 [ 3116.247575] handle_edge_irq+0x87/0x225 [ 3116.252062] __common_interrupt+0x3e/0xbc [ 3116.256740] common_interrupt+0x7b/0x98 [ 3116.261216] [ 3116.263745] [ 3116.266268] asm_common_interrupt+0x22/0x27 Reported-by: Joao Martins Fixes: 01ba61b55b20 ("pds_core: Add adminq processing and commands") Signed-off-by: Shannon Nelson Link: https://lore.kernel.org/r/20231113183257.71110-2-shannon.nelson@amd.com Signed-off-by: Jakub Kicinski commit 17dd5efe5f36a96bd78012594fabe21efb01186b Author: Alex Pakhunov Date: Mon Nov 13 10:23:50 2023 -0800 tg3: Increment tx_dropped in tg3_tso_bug() tg3_tso_bug() drops a packet if it cannot be segmented for any reason. The number of discarded frames should be incremented accordingly. Signed-off-by: Alex Pakhunov Signed-off-by: Vincent Wong Reviewed-by: Pavan Chebbi Link: https://lore.kernel.org/r/20231113182350.37472-2-alexey.pakhunov@spacex.com Signed-off-by: Jakub Kicinski commit 907d1bdb8b2cc0357d03a1c34d2a08d9943760b1 Author: Alex Pakhunov Date: Mon Nov 13 10:23:49 2023 -0800 tg3: Move the [rt]x_dropped counters to tg3_napi This change moves [rt]x_dropped counters to tg3_napi so that they can be updated by a single writer, race-free. Signed-off-by: Alex Pakhunov Signed-off-by: Vincent Wong Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/20231113182350.37472-1-alexey.pakhunov@spacex.com Signed-off-by: Jakub Kicinski commit b6cb4541853c7ee512111b0e7ddf3cb66c99c137 Author: Baruch Siach Date: Mon Nov 13 19:42:50 2023 +0200 net: stmmac: avoid rx queue overrun dma_rx_size can be set as low as 64. Rx budget might be higher than that. Make sure to not overrun allocated rx buffers when budget is larger. Leave one descriptor unused to avoid wrap around of 'dirty_rx' vs 'cur_rx'. Signed-off-by: Baruch Siach Reviewed-by: Serge Semin Fixes: 47dd7a540b8a ("net: add support for STMicroelectronics Ethernet controllers.") Link: https://lore.kernel.org/r/d95413e44c97d4692e72cec13a75f894abeb6998.1699897370.git.baruch@tkos.co.il Signed-off-by: Jakub Kicinski commit fa02de9e75889915b554eda1964a631fd019973b Author: Baruch Siach Date: Mon Nov 13 19:42:49 2023 +0200 net: stmmac: fix rx budget limit check The while loop condition verifies 'count < limit'. Neither value change before the 'count >= limit' check. As is this check is dead code. But code inspection reveals a code path that modifies 'count' and then goto 'drain_data' and back to 'read_again'. So there is a need to verify count value sanity after 'read_again'. Move 'read_again' up to fix the count limit check. Fixes: ec222003bd94 ("net: stmmac: Prepare to add Split Header support") Signed-off-by: Baruch Siach Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/d9486296c3b6b12ab3a0515fcd47d56447a07bfc.1699897370.git.baruch@tkos.co.il Signed-off-by: Jakub Kicinski commit 889c58b3155ff4c8e8671c95daef63d6fabbb6b1 Author: Peter Zijlstra Date: Fri Jun 9 12:34:46 2023 +0200 perf/core: Fix cpuctx refcounting Audit of the refcounting turned up that perf_pmu_migrate_context() fails to migrate the ctx refcount. Fixes: bd2756811766 ("perf: Rewrite core context handling") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lkml.kernel.org/r/20230612093539.085862001@infradead.org Cc: commit c9bd1568d5462f4108417518ce1af7b924acfb6f Author: Peter Zijlstra Date: Tue Nov 14 21:36:13 2023 +0100 futex: Fix hardcoded flags Xi reported that commit 5694289ce183 ("futex: Flag conversion") broke glibc's robust futex tests. This was narrowed down to the change of FLAGS_SHARED from 0x01 to 0x10, at which point Florian noted that handle_futex_death() has a hardcoded flags argument of 1. Change this to: FLAGS_SIZE_32 | FLAGS_SHARED, matching how futex_to_flags() unconditionally sets FLAGS_SIZE_32 for all legacy futex ops. Reported-by: Xi Ruoyao Reported-by: Florian Weimer Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lkml.kernel.org/r/20231114201402.GA25315@noisy.programming.kicks-ass.net Fixes: 5694289ce183 ("futex: Flag conversion") Cc: commit 77618db346455129424fadbbaec596a09feaf3bb Author: Nick Terrell Date: Thu Oct 12 12:55:34 2023 -0700 zstd: Fix array-index-out-of-bounds UBSAN warning Zstd used an array of length 1 to mean a flexible array for C89 compatibility. Switch to a C99 flexible array to fix the UBSAN warning. Tested locally by booting the kernel and writing to and reading from a BtrFS filesystem with zstd compression enabled. I was unable to reproduce the issue before the fix, however it is a trivial change. Link: https://lkml.kernel.org/r/20231012213428.1390905-1-nickrterrell@gmail.com Reported-by: syzbot+1f2eb3e8cd123ffce499@syzkaller.appspotmail.com Reported-by: Eric Biggers Reported-by: Kees Cook Signed-off-by: Nick Terrell Reviewed-by: Kees Cook commit 969d90ec212bae4b45bf9d21d7daa30aa6cf055e Author: Paul Moore Date: Tue Nov 14 17:25:48 2023 -0500 audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare() eBPF can end up calling into the audit code from some odd places, and some of these places don't have @current set properly so we end up tripping the `WARN_ON_ONCE(!current->mm)` near the top of `audit_exe_compare()`. While the basic `!current->mm` check is good, the `WARN_ON_ONCE()` results in some scary console messages so let's drop that and just do the regular `!current->mm` check to avoid problems. Cc: Fixes: 47846d51348d ("audit: don't take task_lock() in audit_exe_compare() code path") Reported-by: Artem Savkov Signed-off-by: Paul Moore commit a2e36cd56041e277d7d81d35638fd8d9731e21f5 Author: Dave Airlie Date: Tue Nov 7 15:32:55 2023 +1000 nouveau: use an rwlock for the event lock. This allows it to break the following circular locking dependency. Aug 10 07:01:29 dg1test kernel: ====================================================== Aug 10 07:01:29 dg1test kernel: WARNING: possible circular locking dependency detected Aug 10 07:01:29 dg1test kernel: 6.4.0-rc7+ #10 Not tainted Aug 10 07:01:29 dg1test kernel: ------------------------------------------------------ Aug 10 07:01:29 dg1test kernel: wireplumber/2236 is trying to acquire lock: Aug 10 07:01:29 dg1test kernel: ffff8fca5320da18 (&fctx->lock){-...}-{2:2}, at: nouveau_fence_wait_uevent_handler+0x2b/0x100 [nouveau] Aug 10 07:01:29 dg1test kernel: but task is already holding lock: Aug 10 07:01:29 dg1test kernel: ffff8fca41208610 (&event->list_lock#2){-...}-{2:2}, at: nvkm_event_ntfy+0x50/0xf0 [nouveau] Aug 10 07:01:29 dg1test kernel: which lock already depends on the new lock. Aug 10 07:01:29 dg1test kernel: the existing dependency chain (in reverse order) is: Aug 10 07:01:29 dg1test kernel: -> #3 (&event->list_lock#2){-...}-{2:2}: Aug 10 07:01:29 dg1test kernel: _raw_spin_lock_irqsave+0x4b/0x70 Aug 10 07:01:29 dg1test kernel: nvkm_event_ntfy+0x50/0xf0 [nouveau] Aug 10 07:01:29 dg1test kernel: ga100_fifo_nonstall_intr+0x24/0x30 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_intr+0x12c/0x240 [nouveau] Aug 10 07:01:29 dg1test kernel: __handle_irq_event_percpu+0x88/0x240 Aug 10 07:01:29 dg1test kernel: handle_irq_event+0x38/0x80 Aug 10 07:01:29 dg1test kernel: handle_edge_irq+0xa3/0x240 Aug 10 07:01:29 dg1test kernel: __common_interrupt+0x72/0x160 Aug 10 07:01:29 dg1test kernel: common_interrupt+0x60/0xe0 Aug 10 07:01:29 dg1test kernel: asm_common_interrupt+0x26/0x40 Aug 10 07:01:29 dg1test kernel: -> #2 (&device->intr.lock){-...}-{2:2}: Aug 10 07:01:29 dg1test kernel: _raw_spin_lock_irqsave+0x4b/0x70 Aug 10 07:01:29 dg1test kernel: nvkm_inth_allow+0x2c/0x80 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_event_ntfy_state+0x181/0x250 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_event_ntfy_allow+0x63/0xd0 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_uevent_mthd+0x4d/0x70 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_ioctl+0x10b/0x250 [nouveau] Aug 10 07:01:29 dg1test kernel: nvif_object_mthd+0xa8/0x1f0 [nouveau] Aug 10 07:01:29 dg1test kernel: nvif_event_allow+0x2a/0xa0 [nouveau] Aug 10 07:01:29 dg1test kernel: nouveau_fence_enable_signaling+0x78/0x80 [nouveau] Aug 10 07:01:29 dg1test kernel: __dma_fence_enable_signaling+0x5e/0x100 Aug 10 07:01:29 dg1test kernel: dma_fence_add_callback+0x4b/0xd0 Aug 10 07:01:29 dg1test kernel: nouveau_cli_work_queue+0xae/0x110 [nouveau] Aug 10 07:01:29 dg1test kernel: nouveau_gem_object_close+0x1d1/0x2a0 [nouveau] Aug 10 07:01:29 dg1test kernel: drm_gem_handle_delete+0x70/0xe0 [drm] Aug 10 07:01:29 dg1test kernel: drm_ioctl_kernel+0xa5/0x150 [drm] Aug 10 07:01:29 dg1test kernel: drm_ioctl+0x256/0x490 [drm] Aug 10 07:01:29 dg1test kernel: nouveau_drm_ioctl+0x5a/0xb0 [nouveau] Aug 10 07:01:29 dg1test kernel: __x64_sys_ioctl+0x91/0xd0 Aug 10 07:01:29 dg1test kernel: do_syscall_64+0x3c/0x90 Aug 10 07:01:29 dg1test kernel: entry_SYSCALL_64_after_hwframe+0x72/0xdc Aug 10 07:01:29 dg1test kernel: -> #1 (&event->refs_lock#4){....}-{2:2}: Aug 10 07:01:29 dg1test kernel: _raw_spin_lock_irqsave+0x4b/0x70 Aug 10 07:01:29 dg1test kernel: nvkm_event_ntfy_state+0x37/0x250 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_event_ntfy_allow+0x63/0xd0 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_uevent_mthd+0x4d/0x70 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_ioctl+0x10b/0x250 [nouveau] Aug 10 07:01:29 dg1test kernel: nvif_object_mthd+0xa8/0x1f0 [nouveau] Aug 10 07:01:29 dg1test kernel: nvif_event_allow+0x2a/0xa0 [nouveau] Aug 10 07:01:29 dg1test kernel: nouveau_fence_enable_signaling+0x78/0x80 [nouveau] Aug 10 07:01:29 dg1test kernel: __dma_fence_enable_signaling+0x5e/0x100 Aug 10 07:01:29 dg1test kernel: dma_fence_add_callback+0x4b/0xd0 Aug 10 07:01:29 dg1test kernel: nouveau_cli_work_queue+0xae/0x110 [nouveau] Aug 10 07:01:29 dg1test kernel: nouveau_gem_object_close+0x1d1/0x2a0 [nouveau] Aug 10 07:01:29 dg1test kernel: drm_gem_handle_delete+0x70/0xe0 [drm] Aug 10 07:01:29 dg1test kernel: drm_ioctl_kernel+0xa5/0x150 [drm] Aug 10 07:01:29 dg1test kernel: drm_ioctl+0x256/0x490 [drm] Aug 10 07:01:29 dg1test kernel: nouveau_drm_ioctl+0x5a/0xb0 [nouveau] Aug 10 07:01:29 dg1test kernel: __x64_sys_ioctl+0x91/0xd0 Aug 10 07:01:29 dg1test kernel: do_syscall_64+0x3c/0x90 Aug 10 07:01:29 dg1test kernel: entry_SYSCALL_64_after_hwframe+0x72/0xdc Aug 10 07:01:29 dg1test kernel: -> #0 (&fctx->lock){-...}-{2:2}: Aug 10 07:01:29 dg1test kernel: __lock_acquire+0x14e3/0x2240 Aug 10 07:01:29 dg1test kernel: lock_acquire+0xc8/0x2a0 Aug 10 07:01:29 dg1test kernel: _raw_spin_lock_irqsave+0x4b/0x70 Aug 10 07:01:29 dg1test kernel: nouveau_fence_wait_uevent_handler+0x2b/0x100 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_client_event+0xf/0x20 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_event_ntfy+0x9b/0xf0 [nouveau] Aug 10 07:01:29 dg1test kernel: ga100_fifo_nonstall_intr+0x24/0x30 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_intr+0x12c/0x240 [nouveau] Aug 10 07:01:29 dg1test kernel: __handle_irq_event_percpu+0x88/0x240 Aug 10 07:01:29 dg1test kernel: handle_irq_event+0x38/0x80 Aug 10 07:01:29 dg1test kernel: handle_edge_irq+0xa3/0x240 Aug 10 07:01:29 dg1test kernel: __common_interrupt+0x72/0x160 Aug 10 07:01:29 dg1test kernel: common_interrupt+0x60/0xe0 Aug 10 07:01:29 dg1test kernel: asm_common_interrupt+0x26/0x40 Aug 10 07:01:29 dg1test kernel: other info that might help us debug this: Aug 10 07:01:29 dg1test kernel: Chain exists of: &fctx->lock --> &device->intr.lock --> &event->list_lock#2 Aug 10 07:01:29 dg1test kernel: Possible unsafe locking scenario: Aug 10 07:01:29 dg1test kernel: CPU0 CPU1 Aug 10 07:01:29 dg1test kernel: ---- ---- Aug 10 07:01:29 dg1test kernel: lock(&event->list_lock#2); Aug 10 07:01:29 dg1test kernel: lock(&device->intr.lock); Aug 10 07:01:29 dg1test kernel: lock(&event->list_lock#2); Aug 10 07:01:29 dg1test kernel: lock(&fctx->lock); Aug 10 07:01:29 dg1test kernel: *** DEADLOCK *** Aug 10 07:01:29 dg1test kernel: 2 locks held by wireplumber/2236: Aug 10 07:01:29 dg1test kernel: #0: ffff8fca53177bf8 (&device->intr.lock){-...}-{2:2}, at: nvkm_intr+0x29/0x240 [nouveau] Aug 10 07:01:29 dg1test kernel: #1: ffff8fca41208610 (&event->list_lock#2){-...}-{2:2}, at: nvkm_event_ntfy+0x50/0xf0 [nouveau] Aug 10 07:01:29 dg1test kernel: stack backtrace: Aug 10 07:01:29 dg1test kernel: CPU: 6 PID: 2236 Comm: wireplumber Not tainted 6.4.0-rc7+ #10 Aug 10 07:01:29 dg1test kernel: Hardware name: Gigabyte Technology Co., Ltd. Z390 I AORUS PRO WIFI/Z390 I AORUS PRO WIFI-CF, BIOS F8 11/05/2021 Aug 10 07:01:29 dg1test kernel: Call Trace: Aug 10 07:01:29 dg1test kernel: Aug 10 07:01:29 dg1test kernel: dump_stack_lvl+0x5b/0x90 Aug 10 07:01:29 dg1test kernel: check_noncircular+0xe2/0x110 Aug 10 07:01:29 dg1test kernel: __lock_acquire+0x14e3/0x2240 Aug 10 07:01:29 dg1test kernel: lock_acquire+0xc8/0x2a0 Aug 10 07:01:29 dg1test kernel: ? nouveau_fence_wait_uevent_handler+0x2b/0x100 [nouveau] Aug 10 07:01:29 dg1test kernel: ? lock_acquire+0xc8/0x2a0 Aug 10 07:01:29 dg1test kernel: _raw_spin_lock_irqsave+0x4b/0x70 Aug 10 07:01:29 dg1test kernel: ? nouveau_fence_wait_uevent_handler+0x2b/0x100 [nouveau] Aug 10 07:01:29 dg1test kernel: nouveau_fence_wait_uevent_handler+0x2b/0x100 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_client_event+0xf/0x20 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_event_ntfy+0x9b/0xf0 [nouveau] Aug 10 07:01:29 dg1test kernel: ga100_fifo_nonstall_intr+0x24/0x30 [nouveau] Aug 10 07:01:29 dg1test kernel: nvkm_intr+0x12c/0x240 [nouveau] Aug 10 07:01:29 dg1test kernel: __handle_irq_event_percpu+0x88/0x240 Aug 10 07:01:29 dg1test kernel: handle_irq_event+0x38/0x80 Aug 10 07:01:29 dg1test kernel: handle_edge_irq+0xa3/0x240 Aug 10 07:01:29 dg1test kernel: __common_interrupt+0x72/0x160 Aug 10 07:01:29 dg1test kernel: common_interrupt+0x60/0xe0 Aug 10 07:01:29 dg1test kernel: asm_common_interrupt+0x26/0x40 Aug 10 07:01:29 dg1test kernel: RIP: 0033:0x7fb66174d700 Aug 10 07:01:29 dg1test kernel: Code: c1 e2 05 29 ca 8d 0c 10 0f be 07 84 c0 75 eb 89 c8 c3 0f 1f 84 00 00 00 00 00 f3 0f 1e fa e9 d7 0f fc ff 0f 1f 80 00 00 00 00 0f 1e fa e9 c7 0f fc> Aug 10 07:01:29 dg1test kernel: RSP: 002b:00007ffdd3c48438 EFLAGS: 00000206 Aug 10 07:01:29 dg1test kernel: RAX: 000055bb758763c0 RBX: 000055bb758752c0 RCX: 00000000000028b0 Aug 10 07:01:29 dg1test kernel: RDX: 000055bb758752c0 RSI: 000055bb75887490 RDI: 000055bb75862950 Aug 10 07:01:29 dg1test kernel: RBP: 00007ffdd3c48490 R08: 000055bb75873b10 R09: 0000000000000001 Aug 10 07:01:29 dg1test kernel: R10: 0000000000000004 R11: 000055bb7587f000 R12: 000055bb75887490 Aug 10 07:01:29 dg1test kernel: R13: 000055bb757f6280 R14: 000055bb758875c0 R15: 000055bb757f6280 Aug 10 07:01:29 dg1test kernel: Signed-off-by: Dave Airlie Tested-by: Danilo Krummrich Reviewed-by: Danilo Krummrich Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20231107053255.2257079-1-airlied@gmail.com commit 42bd415bd8bd43721d423930b4695c565661e687 Author: Dan Carpenter Date: Wed Nov 8 10:40:21 2023 +0300 nouveau/gsp/r535: Fix a NULL vs error pointer bug The r535_gsp_cmdq_get() function returns error pointers but this code checks for NULL. Also we need to propagate the error pointer back to the callers in r535_gsp_rpc_get(). Returning NULL will lead to a NULL pointer dereference. Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM") Signed-off-by: Dan Carpenter Reviewed-by: Danilo Krummrich Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/f71996d9-d1cb-45ea-a4b2-2dfc21312d8c@kili.mountain commit 09f12bf9f790052710bd6e48a1fc1bc4d9e17389 Author: Dan Carpenter Date: Tue Nov 7 18:18:31 2023 +0300 nouveau/gsp/r535: uninitialized variable in r535_gsp_acpi_mux_id() The if we hit the "continue" statement on the first iteration through the loop then "handle_mux" needs to be set to NULL so we continue looping. Fixes: 176fdcbddfd2 ("drm/nouveau/gsp/r535: add support for booting GSP-RM") Signed-off-by: Dan Carpenter Reviewed-by: Danilo Krummrich Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/1d864f6e-43e9-43d8-9d90-30e76c9c843b@moroto.mountain commit 6d7e4782bcf549221b4ccfffec2cf4d1a473f1a3 Author: Keisuke Nishimura Date: Tue Oct 31 14:38:22 2023 +0100 sched/fair: Fix the decision for load balance should_we_balance is called for the decision to do load-balancing. When sched ticks invoke this function, only one CPU should return true. However, in the current code, two CPUs can return true. The following situation, where b means busy and i means idle, is an example, because CPU 0 and CPU 2 return true. [0, 1] [2, 3] b b i b This fix checks if there exists an idle CPU with busy sibling(s) after looking for a CPU on an idle core. If some idle CPUs with busy siblings are found, just the first one should do load-balancing. Fixes: b1bfeab9b002 ("sched/fair: Consider the idle state of the whole core for load balance") Signed-off-by: Keisuke Nishimura Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Chen Yu Reviewed-by: Shrikanth Hegde Reviewed-by: Vincent Guittot Link: https://lkml.kernel.org/r/20231031133821.1570861-1-keisuke.nishimura@inria.fr commit 8b39d20eceeda6c4eb23df1497f9ed2fffdc8f69 Author: Johannes Weiner Date: Thu Oct 26 12:41:14 2023 -0400 sched: psi: fix unprivileged polling against cgroups 519fabc7aaba ("psi: remove 500ms min window size limitation for triggers") breaks unprivileged psi polling on cgroups. Historically, we had a privilege check for polling in the open() of a pressure file in /proc, but were erroneously missing it for the open() of cgroup pressure files. When unprivileged polling was introduced in d82caa273565 ("sched/psi: Allow unprivileged polling of N*2s period"), it needed to filter privileges depending on the exact polling parameters, and as such moved the CAP_SYS_RESOURCE check from the proc open() callback to psi_trigger_create(). Both the proc files as well as cgroup files go through this during write(). This implicitly added the missing check for privileges required for HT polling for cgroups. When 519fabc7aaba ("psi: remove 500ms min window size limitation for triggers") followed right after to remove further restrictions on the RT polling window, it incorrectly assumed the cgroup privilege check was still missing and added it to the cgroup open(), mirroring what we used to do for proc files in the past. As a result, unprivileged poll requests that would be supported now get rejected when opening the cgroup pressure file for writing. Remove the cgroup open() check. psi_trigger_create() handles it. Fixes: 519fabc7aaba ("psi: remove 500ms min window size limitation for triggers") Reported-by: Luca Boccassi Signed-off-by: Johannes Weiner Signed-off-by: Peter Zijlstra (Intel) Acked-by: Luca Boccassi Acked-by: Suren Baghdasaryan Cc: stable@vger.kernel.org # 6.5+ Link: https://lore.kernel.org/r/20231026164114.2488682-1-hannes@cmpxchg.org commit eab03c23c2a162085b13200d7942fc5a00b5ccc8 Author: Abel Wu Date: Tue Nov 7 17:05:07 2023 +0800 sched/eevdf: Fix vruntime adjustment on reweight vruntime of the (on_rq && !0-lag) entity needs to be adjusted when it gets re-weighted, and the calculations can be simplified based on the fact that re-weight won't change the w-average of all the entities. Please check the proofs in comments. But adjusting vruntime can also cause position change in RB-tree hence require re-queue to fix up which might be costly. This might be avoided by deferring adjustment to the time the entity actually leaves tree (dequeue/pick), but that will negatively affect task selection and probably not good enough either. Fixes: 147f3efaa241 ("sched/fair: Implement an EEVDF-like scheduling policy") Signed-off-by: Abel Wu Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20231107090510.71322-2-wuyun.abel@bytedance.com commit 1bddcf77ce6668692fc15e968fd0870d5524d112 Author: Richard Fitzgerald Date: Mon Nov 6 17:25:57 2023 +0000 kunit: test: Avoid cast warning when adding kfree() as an action In kunit_log_test() pass the kfree_wrapper() function to kunit_add_action() instead of directly passing kfree(). This prevents a cast warning: lib/kunit/kunit-test.c:565:25: warning: cast from 'void (*)(const void *)' to 'kunit_action_t *' (aka 'void (*)(void *)') converts to incompatible function type [-Wcast-function-type-strict] 564 full_log = string_stream_get_string(test->log); > 565 kunit_add_action(test, (kunit_action_t *)kfree, full_log); Signed-off-by: Richard Fitzgerald Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311070041.kWVYx7YP-lkp@intel.com/ Fixes: 05e2006ce493 ("kunit: Use string_stream for test log") Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 2e3c94aed51eabbe9c1c0ee515371ea5441c2fa7 Author: Michal Wajdeczko Date: Wed Oct 4 22:57:00 2023 +0200 kunit: Reset suite counter right before running tests Today we reset the suite counter as part of the suite cleanup, called from the module exit callback, but it might not work that well as one can try to collect results without unloading a previous test (either unintentionally or due to dependencies). For easy reproduction try to load the kunit-test.ko and then collect and parse results from the kunit-example-test.ko load. Parser will complain about mismatch of expected test number: [ ] KTAP version 1 [ ] 1..1 [ ] # example: initializing suite [ ] KTAP version 1 [ ] # Subtest: example .. [ ] # example: pass:5 fail:0 skip:4 total:9 [ ] # Totals: pass:6 fail:0 skip:6 total:12 [ ] ok 7 example [ ] [ERROR] Test: example: Expected test number 1 but found 7 [ ] ===================== [PASSED] example ===================== [ ] ============================================================ [ ] Testing complete. Ran 12 tests: passed: 6, skipped: 6, errors: 1 Since we are now printing suite test plan on every module load, right before running suite tests, we should make sure that suite counter will also start from 1. Easiest solution seems to be move counter reset to the __kunit_test_suites_init() function. Signed-off-by: Michal Wajdeczko Cc: David Gow Cc: Rae Moar Reviewed-by: David Gow Signed-off-by: Shuah Khan commit f8f2847f739dc899d0e563eac01299dadefa64ff Author: Maxime Ripard Date: Thu Oct 26 10:59:31 2023 +0200 kunit: Warn if tests are slow Kunit recently gained support to setup attributes, the first one being the speed of a given test, then allowing to filter out slow tests. A slow test is defined in the documentation as taking more than one second. There's an another speed attribute called "super slow" but whose definition is less clear. Add support to the test runner to check the test execution time, and report tests that should be marked as slow but aren't. Signed-off-by: Maxime Ripard Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 27072b8e18a73ffeffb1c140939023915a35134b Author: Claudio Imbrenda Date: Thu Nov 9 13:36:24 2023 +0100 KVM: s390/mm: Properly reset no-dat When the CMMA state needs to be reset, the no-dat bit also needs to be reset. Failure to do so could cause issues in the guest, since the guest expects the bit to be cleared after a reset. Cc: Reviewed-by: Nico Boehr Message-ID: <20231109123624.37314-1-imbrenda@linux.ibm.com> Signed-off-by: Claudio Imbrenda commit 80aea01c48971a1fffc0252d036995572d84950d Author: Claudio Imbrenda Date: Thu Nov 2 16:35:49 2023 +0100 KVM: s390: vsie: fix wrong VIR 37 when MSO is used When the host invalidates a guest page, it will also check if the page was used to map the prefix of any guest CPUs, in which case they are stopped and marked as needing a prefix refresh. Upon starting the affected CPUs again, their prefix pages are explicitly faulted in and revalidated if they had been invalidated. A bit in the PGSTEs indicates whether or not a page might contain a prefix. The bit is allowed to overindicate. Pages above 2G are skipped, because they cannot be prefixes, since KVM runs all guests with MSO = 0. The same applies for nested guests (VSIE). When the host invalidates a guest page that maps the prefix of the nested guest, it has to stop the affected nested guest CPUs and mark them as needing a prefix refresh. The same PGSTE bit used for the guest prefix is also used for the nested guest. Pages above 2G are skipped like for normal guests, which is the source of the bug. The nested guest runs is the guest primary address space. The guest could be running the nested guest using MSO != 0. If the MSO + prefix for the nested guest is above 2G, the check for nested prefix will skip it. This will cause the invalidation notifier to not stop the CPUs of the nested guest and not mark them as needing refresh. When the nested guest is run again, its prefix will not be refreshed, since it has not been marked for refresh. This will cause a fatal validity intercept with VIR code 37. Fix this by removing the check for 2G for nested guests. Now all invalidations of pages with the notify bit set will always scan the existing VSIE shadow state descriptors. This allows to catch invalidations of nested guest prefix mappings even when the prefix is above 2G in the guest virtual address space. Fixes: a3508fbe9dc6 ("KVM: s390: vsie: initial support for nested virtualization") Tested-by: Nico Boehr Reviewed-by: Nico Boehr Reviewed-by: David Hildenbrand Message-ID: <20231102153549.53984-1-imbrenda@linux.ibm.com> Signed-off-by: Claudio Imbrenda commit 5eef12c4e3230f2025dc46ad8c4a3bc19978e5d7 Author: Shyam Prasad N Date: Tue Nov 14 04:58:23 2023 +0000 cifs: fix lock ordering while disabling multichannel The code to handle the case of server disabling multichannel was picking iface_lock with chan_lock held. This goes against the lock ordering rules, as iface_lock is a higher order lock (even if it isn't so obvious). This change fixes the lock ordering by doing the following in that order for each secondary channel: 1. store iface and server pointers in local variable 2. remove references to iface and server in channels 3. unlock chan_lock 4. lock iface_lock 5. dec ref count for iface 6. unlock iface_lock 7. dec ref count for server 8. lock chan_lock again Since this function can only be called in smb2_reconnect, and that cannot be called by two parallel processes, we should not have races due to dropping chan_lock between steps 3 and 8. Fixes: ee1d21794e55 ("cifs: handle when server stops supporting multichannel") Reported-by: Paulo Alcantara Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 29954d5b1e0d67a4cd61c30c2201030c97e94b1e Author: Shyam Prasad N Date: Tue Nov 14 04:54:12 2023 +0000 cifs: fix leak of iface for primary channel My last change in this area introduced a change which accounted for primary channel in the interface ref count. However, it did not reduce this ref count on deallocation of the primary channel. i.e. during umount. Fixing this leak here, by dropping this ref count for primary channel while freeing up the session. Fixes: fa1d0508bdd4 ("cifs: account for primary channel in the interface list") Cc: stable@vger.kernel.org Reported-by: Paulo Alcantara Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 782ce431613cf08c3a00dca42ad925c3b1108d09 Author: Konstantin Runov Date: Mon Oct 30 12:45:08 2023 +0300 gcc-plugins: latent_entropy: Fix typo (args -> argc) in plugin description Fix the typo in the plugin description comment. Clearly, "argc" should be used. Signed-off-by: Konstantin Runov Link: https://lore.kernel.org/r/20231030094508.245432-1-runebone1@gmail.com Signed-off-by: Kees Cook commit 2e6ef8aaba6b709ce91164401fa1c12668510360 Author: Bob Peterson Date: Tue Nov 14 07:57:53 2023 -0600 Remove myself as maintainer of GFS2 I am retiring from Red Hat and will no longer be a maintainer of the gfs2 file system. Signed-off-by: Bob Peterson Signed-off-by: Linus Torvalds commit b944aa9d86d5f782bfe5e51336434c960304839c Author: Matus Malych Date: Tue Nov 14 14:35:25 2023 +0100 ALSA: hda/realtek: Enable Mute LED on HP 255 G10 HP 255 G10 has a mute LED that can be made to work using quirk ALC236_FIXUP_HP_MUTE_LED_COEFBIT2. Enable already existing quirk - at correct line to keep order Signed-off-by: Matus Malych Cc: Link: https://lore.kernel.org/r/20231114133524.11340-1-matus@malych.org Signed-off-by: Takashi Iwai commit 2a0508d9d08f0c3e354044d4f48466ee0d225041 Merge: b85ea95d08647 e439e4a62a8ea Author: Martin K. Petersen Date: Tue Nov 14 11:40:40 2023 -0500 Merge branch '6.7/scsi-staging' into 6.7/scsi-fixes Pull in queued fixes for 6.7 Signed-off-by: Martin K. Petersen commit 1de1b77982e1a1df9707cb11f9b1789e6b8919d4 Author: Adrian Hunter Date: Fri Nov 3 10:47:20 2023 +0200 mmc: cqhci: Fix task clearing in CQE error recovery If a task completion notification (TCN) is received when there is no outstanding task, the cqhci driver issues a "spurious TCN" warning. This was observed to happen right after CQE error recovery. When an error interrupt is received the driver runs recovery logic. It halts the controller, clears all pending tasks, and then re-enables it. On some platforms, like Intel Jasper Lake, a stale task completion event was observed, regardless of the CQHCI_CLEAR_ALL_TASKS bit being set. This results in either: a) Spurious TC completion event for an empty slot. b) Corrupted data being passed up the stack, as a result of premature completion for a newly added task. Rather than add a quirk for affected controllers, ensure tasks are cleared by toggling CQHCI_ENABLE, which would happen anyway if cqhci_clear_all_tasks() timed out. This is simpler and should be safe and effective for all controllers. Fixes: a4080225f51d ("mmc: cqhci: support for command queue enabled host") Cc: stable@vger.kernel.org Reported-by: Kornel Dulęba Tested-by: Kornel Dulęba Co-developed-by: Kornel Dulęba Signed-off-by: Kornel Dulęba Signed-off-by: Adrian Hunter Reviewed-by: Avri Altman Link: https://lore.kernel.org/r/20231103084720.6886-7-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit 35597bdb04ec27ef3b1cea007dc69f8ff5df75a5 Author: Adrian Hunter Date: Fri Nov 3 10:47:19 2023 +0200 mmc: cqhci: Warn of halt or task clear failure A correctly operating controller should successfully halt and clear tasks. Failure may result in errors elsewhere, so promote messages from debug to warnings. Fixes: a4080225f51d ("mmc: cqhci: support for command queue enabled host") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter Reviewed-by: Avri Altman Reviewed-by: Avri Altman Link: https://lore.kernel.org/r/20231103084720.6886-6-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit 8155d1fa3a747baad5caff5f8303321d68ddd48c Author: Adrian Hunter Date: Fri Nov 3 10:47:18 2023 +0200 mmc: block: Retry commands in CQE error recovery It is important that MMC_CMDQ_TASK_MGMT command to discard the queue is successful because otherwise a subsequent reset might fail to flush the cache first. Retry it and the previous STOP command. Fixes: 72a5af554df8 ("mmc: core: Add support for handling CQE requests") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter Reviewed-by: Avri Altman Link: https://lore.kernel.org/r/20231103084720.6886-5-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit c616696a902987352426fdaeec1b0b3240949e6b Author: Adrian Hunter Date: Fri Nov 3 10:47:17 2023 +0200 mmc: block: Be sure to wait while busy in CQE error recovery STOP command does not guarantee to wait while busy, but subsequent command MMC_CMDQ_TASK_MGMT to discard the queue will fail if the card is busy, so be sure to wait by employing mmc_poll_for_busy(). Fixes: 72a5af554df8 ("mmc: core: Add support for handling CQE requests") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter Reviewed-by: Avri Altman Reviewed-by: Christian Loehle Link: https://lore.kernel.org/r/20231103084720.6886-4-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit b578d5d18e929aa7c007a98cce32657145dde219 Author: Adrian Hunter Date: Fri Nov 3 10:47:16 2023 +0200 mmc: cqhci: Increase recovery halt timeout Failing to halt complicates the recovery. Additionally, unless the card or controller are stuck, which is expected to be very rare, then the halt should succeed, so it is better to wait. Set a large timeout. Fixes: a4080225f51d ("mmc: cqhci: support for command queue enabled host") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter Reviewed-by: Avri Altman Link: https://lore.kernel.org/r/20231103084720.6886-3-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit 174925d340aac55296318e43fd96c0e1d196e105 Author: Adrian Hunter Date: Fri Nov 3 10:47:15 2023 +0200 mmc: block: Do not lose cache flush during CQE error recovery During CQE error recovery, error-free data commands get requeued if there is any data left to transfer, but non-data commands are completed even though they have not been processed. Requeue them instead. Note the only non-data command is cache flush, which would have resulted in a cache flush being lost if it was queued at the time of CQE recovery. Fixes: 1e8e55b67030 ("mmc: block: Add CQE support") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter Reviewed-by: Avri Altman Link: https://lore.kernel.org/r/20231103084720.6886-2-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit 8837ba3e58ea1e3d09ae36db80b1e80853aada95 Author: Pablo Neira Ayuso Date: Mon Nov 13 21:13:31 2023 +0100 netfilter: nf_tables: split async and sync catchall in two functions list_for_each_entry_safe() does not work for the async case which runs under RCU, therefore, split GC logic for catchall in two functions instead, one for each of the sync and async GC variants. The catchall sync GC variant never sees a _DEAD bit set on ever, thus, this handling is removed in such case, moreover, allocate GC sync batch via GFP_KERNEL. Fixes: 93995bf4af2c ("netfilter: nf_tables: remove catchall element in GC sync path") Reported-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 28628fa952fefc7f2072ce6e8016968cc452b1ba Author: Jozsef Kadlecsik Date: Mon Nov 13 21:13:23 2023 +0100 netfilter: ipset: fix race condition between swap/destroy and kernel side add/del/test Linkui Xiao reported that there's a race condition when ipset swap and destroy is called, which can lead to crash in add/del/test element operations. Swap then destroy are usual operations to replace a set with another one in a production system. The issue can in some cases be reproduced with the script: ipset create hash_ip1 hash:net family inet hashsize 1024 maxelem 1048576 ipset add hash_ip1 172.20.0.0/16 ipset add hash_ip1 192.168.0.0/16 iptables -A INPUT -m set --match-set hash_ip1 src -j ACCEPT while [ 1 ] do # ... Ongoing traffic... ipset create hash_ip2 hash:net family inet hashsize 1024 maxelem 1048576 ipset add hash_ip2 172.20.0.0/16 ipset swap hash_ip1 hash_ip2 ipset destroy hash_ip2 sleep 0.05 done In the race case the possible order of the operations are CPU0 CPU1 ip_set_test ipset swap hash_ip1 hash_ip2 ipset destroy hash_ip2 hash_net_kadt Swap replaces hash_ip1 with hash_ip2 and then destroy removes hash_ip2 which is the original hash_ip1. ip_set_test was called on hash_ip1 and because destroy removed it, hash_net_kadt crashes. The fix is to force ip_set_swap() to wait for all readers to finish accessing the old set pointers by calling synchronize_rcu(). The first version of the patch was written by Linkui Xiao . v2: synchronize_rcu() is moved into ip_set_swap() in order not to burden ip_set_destroy() unnecessarily when all sets are destroyed. v3: Florian Westphal pointed out that all netfilter hooks run with rcu_read_lock() held and em_ipset.c wraps the entire ip_set_test() in rcu read lock/unlock pair. So there's no need to extend the rcu read locked area in ipset itself. Closes: https://lore.kernel.org/all/69e7963b-e7f8-3ad0-210-7b86eebf7f78@netfilter.org/ Reported by: Linkui Xiao Signed-off-by: Jozsef Kadlecsik Signed-off-by: Pablo Neira Ayuso commit a7d5a955bfa854ac6b0c53aaf933394b4e6139e4 Author: Pablo Neira Ayuso Date: Mon Nov 13 20:34:56 2023 +0100 netfilter: nf_tables: bogus ENOENT when destroying element which does not exist destroy element command bogusly reports ENOENT in case a set element does not exist. ENOENT errors are skipped, however, err is still set and propagated to userspace. # nft destroy element ip raw BLACKLIST { 1.2.3.4 } Error: Could not process rule: No such file or directory destroy element ip raw BLACKLIST { 1.2.3.4 } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Fixes: f80a612dd77c ("netfilter: nf_tables: add support to destroy operation") Signed-off-by: Pablo Neira Ayuso commit c301f0981fdd3fd1ffac6836b423c4d7a8e0eb63 Author: Dan Carpenter Date: Fri Nov 3 09:42:51 2023 +0300 netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval() The problem is in nft_byteorder_eval() where we are iterating through a loop and writing to dst[0], dst[1], dst[2] and so on... On each iteration we are writing 8 bytes. But dst[] is an array of u32 so each element only has space for 4 bytes. That means that every iteration overwrites part of the previous element. I spotted this bug while reviewing commit caf3ef7468f7 ("netfilter: nf_tables: prevent OOB access in nft_byteorder_eval") which is a related issue. I think that the reason we have not detected this bug in testing is that most of time we only write one element. Fixes: ce1e7989d989 ("netfilter: nft_byteorder: provide 64bit le/be conversion") Signed-off-by: Dan Carpenter Signed-off-by: Pablo Neira Ayuso commit a44af08e3d4d7566eeea98d7a29fe06e7b9de944 Author: Linkui Xiao Date: Wed Nov 1 11:20:18 2023 +0800 netfilter: nf_conntrack_bridge: initialize err to 0 K2CI reported a problem: consume_skb(skb); return err; [nf_br_ip_fragment() error] uninitialized symbol 'err'. err is not initialized, because returning 0 is expected, initialize err to 0. Fixes: 3c171f496ef5 ("netfilter: bridge: add connection tracking system") Reported-by: k2ci Signed-off-by: Linkui Xiao Signed-off-by: Pablo Neira Ayuso commit 67059b61597c004e23b074547b40604222bee3a0 Author: Yang Li Date: Wed Nov 1 09:33:51 2023 +0800 netfilter: nft_set_rbtree: Remove unused variable nft_net The code that uses nft_net has been removed, and the nft_pernet function is merely obtaining a reference to shared data through the net pointer. The content of the net pointer is not modified or changed, so both of them should be removed. silence the warning: net/netfilter/nft_set_rbtree.c:627:26: warning: variable ‘nft_net’ set but not used Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7103 Signed-off-by: Yang Li Reviewed-by: Simon Horman Signed-off-by: Pablo Neira Ayuso commit df572eba4e6211c6187fa81a0cc1199da1902f63 Author: Linus Walleij Date: Tue Nov 14 14:30:04 2023 +0100 pinctrl: cy8c95x0: Fix doc warning One member of struct cy8c95x0_pinctrl is missing kerneldoc, which leads to warnings. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311031342.r4To3GaD-lkp@intel.com/ Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20231114-cy8c95x0-doc-v1-1-31674103ad18@linaro.org commit 08e8734d877a9a0fb8af1254a4ce58734fbef296 Author: Chester Lin Date: Tue Nov 7 22:10:44 2023 +0800 pinctrl: s32cc: Avoid possible string truncation With "W=1" and "-Wformat-truncation" build options, the kernel test robot found a possible string truncation warning in pinctrl-s32cc.c, which uses an 8-byte char array to hold a memory region name "map%u". Since the maximum number of digits that a u32 value can present is 10, and the "map" string occupies 3 bytes with a termination '\0', which means the rest 4 bytes cannot fully present the integer "X" that exceeds 4 digits. Here we check if the number >= 10000, which is the lowest value that contains more than 4 digits. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311030159.iyUGjNGF-lkp@intel.com/ Signed-off-by: Chester Lin Link: https://lore.kernel.org/r/20231107141044.24058-1-clin@suse.com Signed-off-by: Linus Walleij commit edd48fd9d45370d6c8ba0dd834fcc51ff688cc87 Author: Antonio Borneo Date: Tue Nov 7 12:05:20 2023 +0100 pinctrl: stm32: fix array read out of bound The existing code does not verify if the "tentative" index exceeds the size of the array, causing out of bound read. Issue identified with kasan. Check the index before using it. Signed-off-by: Antonio Borneo Fixes: 32c170ff15b0 ("pinctrl: stm32: set default gpio line names using pin names") Link: https://lore.kernel.org/r/20231107110520.4449-1-antonio.borneo@foss.st.com Signed-off-by: Linus Walleij commit 58ebe7fb6eb2deed0fd05cf57911fea3f36124eb Author: Antoniu Miclaus Date: Tue Oct 31 11:13:24 2023 +0200 hwmon: max31827: include regulator header Include `linux/regulator/consumer.h` since the driver is using `devm_regulator_get_enable` function. Signed-off-by: Antoniu Miclaus Link: https://lore.kernel.org/r/20231031091324.23991-1-antoniu.miclaus@analog.com Signed-off-by: Guenter Roeck commit d9995cd96928fa72963293fa5ca87350fed16930 Author: Colin Ian King Date: Tue Oct 31 08:42:40 2023 +0000 hwmon: ltc2991: Fix spelling mistake "contiuous" -> "continuous" There is a spelling mistake in a dev_err_probe messages. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20231031084240.2148339-1-colin.i.king@gmail.com Signed-off-by: Guenter Roeck commit 4b7b492615cf3017190f55444f7016812b66611d Author: Eric Dumazet Date: Mon Nov 13 13:49:38 2023 +0000 af_unix: fix use-after-free in unix_stream_read_actor() syzbot reported the following crash [1] After releasing unix socket lock, u->oob_skb can be changed by another thread. We must temporarily increase skb refcount to make sure this other thread will not free the skb under us. [1] BUG: KASAN: slab-use-after-free in unix_stream_read_actor+0xa7/0xc0 net/unix/af_unix.c:2866 Read of size 4 at addr ffff88801f3b9cc4 by task syz-executor107/5297 CPU: 1 PID: 5297 Comm: syz-executor107 Not tainted 6.6.0-syzkaller-15910-gb8e3a87a627b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 unix_stream_read_actor+0xa7/0xc0 net/unix/af_unix.c:2866 unix_stream_recv_urg net/unix/af_unix.c:2587 [inline] unix_stream_read_generic+0x19a5/0x2480 net/unix/af_unix.c:2666 unix_stream_recvmsg+0x189/0x1b0 net/unix/af_unix.c:2903 sock_recvmsg_nosec net/socket.c:1044 [inline] sock_recvmsg+0xe2/0x170 net/socket.c:1066 ____sys_recvmsg+0x21f/0x5c0 net/socket.c:2803 ___sys_recvmsg+0x115/0x1a0 net/socket.c:2845 __sys_recvmsg+0x114/0x1e0 net/socket.c:2875 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7fc67492c559 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 18 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc6748ab228 EFLAGS: 00000246 ORIG_RAX: 000000000000002f RAX: ffffffffffffffda RBX: 000000000000001c RCX: 00007fc67492c559 RDX: 0000000040010083 RSI: 0000000020000140 RDI: 0000000000000004 RBP: 00007fc6749b6348 R08: 00007fc6748ab6c0 R09: 00007fc6748ab6c0 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fc6749b6340 R13: 00007fc6749b634c R14: 00007ffe9fac52a0 R15: 00007ffe9fac5388 Allocated by task 5295: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x180/0x3c0 mm/slub.c:3523 __alloc_skb+0x287/0x330 net/core/skbuff.c:641 alloc_skb include/linux/skbuff.h:1286 [inline] alloc_skb_with_frags+0xe4/0x710 net/core/skbuff.c:6331 sock_alloc_send_pskb+0x7e4/0x970 net/core/sock.c:2780 sock_alloc_send_skb include/net/sock.h:1884 [inline] queue_oob net/unix/af_unix.c:2147 [inline] unix_stream_sendmsg+0xb5f/0x10a0 net/unix/af_unix.c:2301 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2584 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2638 __sys_sendmsg+0x117/0x1e0 net/socket.c:2667 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Freed by task 5295: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] kmem_cache_free+0xf8/0x340 mm/slub.c:3831 kfree_skbmem+0xef/0x1b0 net/core/skbuff.c:1015 __kfree_skb net/core/skbuff.c:1073 [inline] consume_skb net/core/skbuff.c:1288 [inline] consume_skb+0xdf/0x170 net/core/skbuff.c:1282 queue_oob net/unix/af_unix.c:2178 [inline] unix_stream_sendmsg+0xd49/0x10a0 net/unix/af_unix.c:2301 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2584 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2638 __sys_sendmsg+0x117/0x1e0 net/socket.c:2667 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff88801f3b9c80 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 68 bytes inside of freed 240-byte region [ffff88801f3b9c80, ffff88801f3b9d70) The buggy address belongs to the physical page: page:ffffea00007cee40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f3b9 flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000800 ffff888142a60640 dead000000000122 0000000000000000 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 5299, tgid 5283 (syz-executor107), ts 103803840339, free_ts 103600093431 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0xa25/0x36c0 mm/page_alloc.c:3312 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4568 alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8c7/0x1580 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] kmem_cache_alloc_node+0x132/0x3c0 mm/slub.c:3523 __alloc_skb+0x287/0x330 net/core/skbuff.c:641 alloc_skb include/linux/skbuff.h:1286 [inline] alloc_skb_with_frags+0xe4/0x710 net/core/skbuff.c:6331 sock_alloc_send_pskb+0x7e4/0x970 net/core/sock.c:2780 sock_alloc_send_skb include/net/sock.h:1884 [inline] queue_oob net/unix/af_unix.c:2147 [inline] unix_stream_sendmsg+0xb5f/0x10a0 net/unix/af_unix.c:2301 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0xd5/0x180 net/socket.c:745 ____sys_sendmsg+0x6ac/0x940 net/socket.c:2584 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2638 __sys_sendmsg+0x117/0x1e0 net/socket.c:2667 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x4f8/0xa90 mm/page_alloc.c:2347 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2487 __unfreeze_partials+0x21d/0x240 mm/slub.c:2655 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:763 [inline] slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x15d/0x380 mm/slub.c:3502 vm_area_dup+0x21/0x2f0 kernel/fork.c:500 __split_vma+0x17d/0x1070 mm/mmap.c:2365 split_vma mm/mmap.c:2437 [inline] vma_modify+0x25d/0x450 mm/mmap.c:2472 vma_modify_flags include/linux/mm.h:3271 [inline] mprotect_fixup+0x228/0xc80 mm/mprotect.c:635 do_mprotect_pkey+0x852/0xd60 mm/mprotect.c:809 __do_sys_mprotect mm/mprotect.c:830 [inline] __se_sys_mprotect mm/mprotect.c:827 [inline] __x64_sys_mprotect+0x78/0xb0 mm/mprotect.c:827 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Memory state around the buggy address: ffff88801f3b9b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801f3b9c00: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc >ffff88801f3b9c80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801f3b9d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff88801f3b9d80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb Fixes: 876c14ad014d ("af_unix: fix holding spinlock in oob handling") Reported-and-tested-by: syzbot+7a2d546fa43e49315ed3@syzkaller.appspotmail.com Signed-off-by: Eric Dumazet Cc: Rao Shoaib Reviewed-by: Rao shoaib Link: https://lore.kernel.org/r/20231113134938.168151-1-edumazet@google.com Signed-off-by: Paolo Abeni commit 3bdb0ac350fe5e6301562143e4573971dd01ae0b Author: Juergen Gross Date: Wed Sep 27 08:24:46 2023 +0200 xen/events: remove some simple helpers from events_base.c The helper functions type_from_irq() and cpu_from_irq() are just one line functions used only internally. Open code them where needed. At the same time modify and rename get_evtchn_to_irq() to return a struct irq_info instead of the IRQ number. Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Signed-off-by: Juergen Gross commit 686464514fbebb6c8de4415238319e414c3500a4 Author: Juergen Gross Date: Wed Sep 27 08:58:05 2023 +0200 xen/events: reduce externally visible helper functions get_evtchn_to_irq() has only one external user while irq_from_evtchn() provides the same functionality and is exported for a wider user base. Modify the only external user of get_evtchn_to_irq() to use irq_from_evtchn() instead and make get_evtchn_to_irq() static. evtchn_from_irq() and irq_from_virq() have a single external user and can easily be combined to a new helper irq_evtchn_from_virq() allowing to drop irq_from_virq() and to make evtchn_from_irq() static. Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Signed-off-by: Juergen Gross commit 37f32f52643869131ec01bb69bdf9f404f6109fb Author: Amir Goldstein Date: Sun Nov 12 10:11:25 2023 +0200 ovl: fix memory leak in ovl_parse_param() On failure to parse parameters in ovl_parse_param_lowerdir(), it is necessary to update ctx->nr with the correct nr before using ovl_reset_lowerdirs() to release l->name. Reported-and-tested-by: syzbot+26eedf3631650972f17c@syzkaller.appspotmail.com Fixes: c835110b588a ("ovl: remove unused code in lowerdir param parsing") Co-authored-by: Edward Adam Davis Signed-off-by: Amir Goldstein commit b28060db7172e6d8912d88b369123eb89e0d36b4 Author: Amir Goldstein Date: Sun Nov 12 11:12:49 2023 +0200 ovl: fix misformatted comment Remove misleading /** prefix from a regular comment. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311121628.byHp8tkv-lkp@intel.com/ Signed-off-by: Amir Goldstein commit 48c205c69ac988e818f8800a3ce2cbf574c47f99 Merge: 334e90b8d74f8 868c3b95afef4 Author: Jakub Kicinski Date: Mon Nov 13 21:00:10 2023 -0800 Merge branch 'r8169-fix-dash-devices-network-lost-issue' ChunHao Lin says: ==================== r8169: fix DASH devices network lost issue This series are used to fix network lost issue on systems that support DASH. It has been tested on rtl8168ep and rtl8168fp. ==================== Link: https://lore.kernel.org/r/20231109173400.4573-1-hau@realtek.com Signed-off-by: Jakub Kicinski commit 868c3b95afef4883bfb66c9397482da6840b5baf Author: ChunHao Lin Date: Fri Nov 10 01:34:00 2023 +0800 r8169: fix network lost after resume on DASH systems Device that support DASH may be reseted or powered off during suspend. So driver needs to handle DASH during system suspend and resume. Or DASH firmware will influence device behavior and causes network lost. Fixes: b646d90053f8 ("r8169: magic.") Cc: stable@vger.kernel.org Reviewed-by: Heiner Kallweit Signed-off-by: ChunHao Lin Link: https://lore.kernel.org/r/20231109173400.4573-3-hau@realtek.com Signed-off-by: Jakub Kicinski commit 0ab0c45d8aaea5192328bfa6989673aceafc767c Author: ChunHao Lin Date: Fri Nov 10 01:33:59 2023 +0800 r8169: add handling DASH when DASH is disabled For devices that support DASH, even DASH is disabled, there may still exist a default firmware that will influence device behavior. So driver needs to handle DASH for devices that support DASH, no matter the DASH status is. This patch also prepares for "fix network lost after resume on DASH systems". Fixes: ee7a1beb9759 ("r8169:call "rtl8168_driver_start" "rtl8168_driver_stop" only when hardware dash function is enabled") Cc: stable@vger.kernel.org Signed-off-by: ChunHao Lin Reviewed-by: Heiner Kallweit Link: https://lore.kernel.org/r/20231109173400.4573-2-hau@realtek.com Signed-off-by: Jakub Kicinski commit 334e90b8d74f83b8cbe5c9b606d1690858b4897b Merge: 3cffa2ddc4d3f dc6c0bfbaa947 Author: Jakub Kicinski Date: Mon Nov 13 20:58:22 2023 -0800 Merge branch 'fix-large-frames-in-the-gemini-ethernet-driver' Linus Walleij says: ==================== Fix large frames in the Gemini ethernet driver This is the result of a bug hunt for a problem with the RTL8366RB DSA switch leading me wrong all over the place. I am indebted to Vladimir Oltean who as usual pointed out where the real problem was, many thanks! Tryig to actually use big ("jumbo") frames on this hardware uncovered the real bugs. Then I tested it on the DSA switch and it indeed fixes the issue. To make sure it also works fine with big frames on non-DSA devices I also copied a large video file over scp to a device with maximum frame size, the data was transported in large TCP packets ending up in 0x7ff sized frames using software checksumming at ~2.0 MB/s. If I set down the MTU to the standard 1500 bytes so that hardware checksumming is used, the scp transfer of the same file was slightly lower, ~1.8-1.9 MB/s. Despite this not being the best test it shows that we can now stress the hardware with large frames and that software checksum works fine. v3: https://lore.kernel.org/r/20231107-gemini-largeframe-fix-v3-0-e3803c080b75@linaro.org v2: https://lore.kernel.org/r/20231105-gemini-largeframe-fix-v2-0-cd3a5aa6c496@linaro.org v1: https://lore.kernel.org/r/20231104-gemini-largeframe-fix-v1-0-9c5513f22f33@linaro.org ==================== Link: https://lore.kernel.org/r/20231109-gemini-largeframe-fix-v4-0-6e611528db08@linaro.org Signed-off-by: Jakub Kicinski commit dc6c0bfbaa947dd7976e30e8c29b10c868b6fa42 Author: Linus Walleij Date: Thu Nov 9 10:03:14 2023 +0100 net: ethernet: cortina: Fix MTU max setting The RX max frame size is over 10000 for the Gemini ethernet, but the TX max frame size is actually just 2047 (0x7ff after checking the datasheet). Reflect this in what we offer to Linux, cap the MTU at the TX max frame minus ethernet headers. We delete the code disabling the hardware checksum for large MTUs as netdev->mtu can no longer be larger than netdev->max_mtu meaning the if()-clause in gmac_fix_features() is never true. Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet") Reviewed-by: Andrew Lunn Signed-off-by: Linus Walleij Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20231109-gemini-largeframe-fix-v4-3-6e611528db08@linaro.org Signed-off-by: Jakub Kicinski commit d4d0c5b4d279bfe3585fbd806efefd3e51c82afa Author: Linus Walleij Date: Thu Nov 9 10:03:13 2023 +0100 net: ethernet: cortina: Handle large frames The Gemini ethernet controller provides hardware checksumming for frames up to 1514 bytes including ethernet headers but not FCS. If we start sending bigger frames (after first bumping up the MTU on both interfaces sending and receiving the frames), truncated packets start to appear on the target such as in this tcpdump resulting from ping -s 1474: 23:34:17.241983 14:d6:4d:a8:3c:4f (oui Unknown) > bc:ae:c5:6b:a8:3d (oui Unknown), ethertype IPv4 (0x0800), length 1514: truncated-ip - 2 bytes missing! (tos 0x0, ttl 64, id 32653, offset 0, flags [DF], proto ICMP (1), length 1502) OpenWrt.lan > Fecusia: ICMP echo request, id 1672, seq 50, length 1482 If we bypass the hardware checksumming and provide a software fallback, everything starts working fine up to the max TX MTU of 2047 bytes, for example ping -s2000 192.168.1.2: 00:44:29.587598 bc:ae:c5:6b:a8:3d (oui Unknown) > 14:d6:4d:a8:3c:4f (oui Unknown), ethertype IPv4 (0x0800), length 2042: (tos 0x0, ttl 64, id 51828, offset 0, flags [none], proto ICMP (1), length 2028) Fecusia > OpenWrt.lan: ICMP echo reply, id 1683, seq 4, length 2008 The bit enabling to bypass hardware checksum (or any of the "TSS" bits) are undocumented in the hardware reference manual. The entire hardware checksum unit appears undocumented. The conclusion that we need to use the "bypass" bit was found by trial-and-error. Since no hardware checksum will happen, we slot in a software checksum fallback. Check for the condition where we need to compute checksum on the skb with either hardware or software using == CHECKSUM_PARTIAL instead of != CHECKSUM_NONE which is an incomplete check according to . On the D-Link DIR-685 router this fixes a bug on the conduit interface to the RTL8366RB DSA switch: as the switch needs to add space for its tag it increases the MTU on the conduit interface to 1504 and that means that when the router sends packages of 1500 bytes these get an extra 4 bytes of DSA tag and the transfer fails because of the erroneous hardware checksumming, affecting such basic functionality as the LuCI web interface. Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet") Signed-off-by: Linus Walleij Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20231109-gemini-largeframe-fix-v4-2-6e611528db08@linaro.org Signed-off-by: Jakub Kicinski commit 510e35fb931ffc3b100e5d5ae4595cd3beca9f1a Author: Linus Walleij Date: Thu Nov 9 10:03:12 2023 +0100 net: ethernet: cortina: Fix max RX frame define Enumerator 3 is 1548 bytes according to the datasheet. Not 1542. Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet") Reviewed-by: Andrew Lunn Signed-off-by: Linus Walleij Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20231109-gemini-largeframe-fix-v4-1-6e611528db08@linaro.org Signed-off-by: Jakub Kicinski commit 3cffa2ddc4d3fcf70cde361236f5a614f81a09b2 Author: Eric Dumazet Date: Thu Nov 9 18:01:02 2023 +0000 bonding: stop the device in bond_setup_by_slave() Commit 9eed321cde22 ("net: lapbether: only support ethernet devices") has been able to keep syzbot away from net/lapb, until today. In the following splat [1], the issue is that a lapbether device has been created on a bonding device without members. Then adding a non ARPHRD_ETHER member forced the bonding master to change its type. The fix is to make sure we call dev_close() in bond_setup_by_slave() so that the potential linked lapbether devices (or any other devices having assumptions on the physical device) are removed. A similar bug has been addressed in commit 40baec225765 ("bonding: fix panic on non-ARPHRD_ETHER enslave failure") [1] skbuff: skb_under_panic: text:ffff800089508810 len:44 put:40 head:ffff0000c78e7c00 data:ffff0000c78e7bea tail:0x16 end:0x140 dev:bond0 kernel BUG at net/core/skbuff.c:192 ! Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 6007 Comm: syz-executor383 Not tainted 6.6.0-rc3-syzkaller-gbf6547d8715b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : skb_panic net/core/skbuff.c:188 [inline] pc : skb_under_panic+0x13c/0x140 net/core/skbuff.c:202 lr : skb_panic net/core/skbuff.c:188 [inline] lr : skb_under_panic+0x13c/0x140 net/core/skbuff.c:202 sp : ffff800096a06aa0 x29: ffff800096a06ab0 x28: ffff800096a06ba0 x27: dfff800000000000 x26: ffff0000ce9b9b50 x25: 0000000000000016 x24: ffff0000c78e7bea x23: ffff0000c78e7c00 x22: 000000000000002c x21: 0000000000000140 x20: 0000000000000028 x19: ffff800089508810 x18: ffff800096a06100 x17: 0000000000000000 x16: ffff80008a629a3c x15: 0000000000000001 x14: 1fffe00036837a32 x13: 0000000000000000 x12: 0000000000000000 x11: 0000000000000201 x10: 0000000000000000 x9 : cb50b496c519aa00 x8 : cb50b496c519aa00 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff800096a063b8 x4 : ffff80008e280f80 x3 : ffff8000805ad11c x2 : 0000000000000001 x1 : 0000000100000201 x0 : 0000000000000086 Call trace: skb_panic net/core/skbuff.c:188 [inline] skb_under_panic+0x13c/0x140 net/core/skbuff.c:202 skb_push+0xf0/0x108 net/core/skbuff.c:2446 ip6gre_header+0xbc/0x738 net/ipv6/ip6_gre.c:1384 dev_hard_header include/linux/netdevice.h:3136 [inline] lapbeth_data_transmit+0x1c4/0x298 drivers/net/wan/lapbether.c:257 lapb_data_transmit+0x8c/0xb0 net/lapb/lapb_iface.c:447 lapb_transmit_buffer+0x178/0x204 net/lapb/lapb_out.c:149 lapb_send_control+0x220/0x320 net/lapb/lapb_subr.c:251 __lapb_disconnect_request+0x9c/0x17c net/lapb/lapb_iface.c:326 lapb_device_event+0x288/0x4e0 net/lapb/lapb_iface.c:492 notifier_call_chain+0x1a4/0x510 kernel/notifier.c:93 raw_notifier_call_chain+0x3c/0x50 kernel/notifier.c:461 call_netdevice_notifiers_info net/core/dev.c:1970 [inline] call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] __dev_close_many+0x1b8/0x3c4 net/core/dev.c:1508 dev_close_many+0x1e0/0x470 net/core/dev.c:1559 dev_close+0x174/0x250 net/core/dev.c:1585 lapbeth_device_event+0x2e4/0x958 drivers/net/wan/lapbether.c:466 notifier_call_chain+0x1a4/0x510 kernel/notifier.c:93 raw_notifier_call_chain+0x3c/0x50 kernel/notifier.c:461 call_netdevice_notifiers_info net/core/dev.c:1970 [inline] call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] __dev_close_many+0x1b8/0x3c4 net/core/dev.c:1508 dev_close_many+0x1e0/0x470 net/core/dev.c:1559 dev_close+0x174/0x250 net/core/dev.c:1585 bond_enslave+0x2298/0x30cc drivers/net/bonding/bond_main.c:2332 bond_do_ioctl+0x268/0xc64 drivers/net/bonding/bond_main.c:4539 dev_ifsioc+0x754/0x9ac dev_ioctl+0x4d8/0xd34 net/core/dev_ioctl.c:786 sock_do_ioctl+0x1d4/0x2d0 net/socket.c:1217 sock_ioctl+0x4e8/0x834 net/socket.c:1322 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:857 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x16c arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 Code: aa1803e6 aa1903e7 a90023f5 94785b8b (d4210000) Fixes: 872254dd6b1f ("net/bonding: Enable bonding to enslave non ARPHRD_ETHER") Reported-by: syzbot Signed-off-by: Eric Dumazet Acked-by: Jay Vosburgh Reviewed-by: Hangbin Liu Link: https://lore.kernel.org/r/20231109180102.4085183-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 73bde5a3294853947252cd9092a3517c7cb0cd2d Author: Eric Dumazet Date: Thu Nov 9 17:48:59 2023 +0000 ptp: annotate data-race around q->head and q->tail As I was working on a syzbot report, I found that KCSAN would probably complain that reading q->head or q->tail without barriers could lead to invalid results. Add corresponding READ_ONCE() and WRITE_ONCE() to avoid load-store tearing. Fixes: d94ba80ebbea ("ptp: Added a brand new class driver for ptp clocks.") Signed-off-by: Eric Dumazet Acked-by: Richard Cochran Link: https://lore.kernel.org/r/20231109174859.3995880-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 4b3812d90b2c93723adf4b6ce99240d301f7d5f9 Author: Jakub Kicinski Date: Mon Nov 13 20:49:39 2023 -0800 Revert "ptp: Fixes a null pointer dereference in ptp_ioctl" This reverts commit 8a4f030dbced6fc255cbe67b2d0a129947e18493. Richard says: The test itself is harmless, but keeping it will make people think, "oh this pointer can be invalid." In fact the core stack ensures that ioctl() can't be invoked after release(), otherwise Bad Stuff happens. Fixes: 8a4f030dbced ("ptp: Fixes a null pointer dereference in ptp_ioctl") Link: https://lore.kernel.org/all/ZVAf_qdRfDAQYUt-@hoboy.vegasvil.org/ Signed-off-by: Jakub Kicinski commit 701ff57eb3d7c86c9a53de959e0c48fa8ca446d4 Author: Kent Overstreet Date: Fri Nov 3 18:38:35 2023 -0400 bcachefs: Check for nonce offset inconsistency in data_update path We've rarely been seeing a nonce offset inconsistency that doesn't show up in tests: this adds some extra verification code to the data update path that prints out more relevant info when it occurs. Signed-off-by: Kent Overstreet commit 09b0283ee23a02094a43a9b93146d1060c58fc3a Author: Kent Overstreet Date: Sun Nov 5 15:28:44 2023 -0500 bcachefs: Make sure to drop/retake btree locks before reclaim We really don't want to be invoking memory reclaim with btree locks held: even aside from (solvable, but tricky) recursion issues, it can cause painful to diagnose performance edge cases. This fixes a recently reported issue in btree_key_can_insert_cached(). Signed-off-by: Kent Overstreet Reported-by: Mateusz Guzik Fixes: https://lore.kernel.org/linux-bcachefs/CAGudoHEsb_hGRMeWeXh+UF6po0qQuuq_NKSEo+s1sEb6bDLjpA@mail.gmail.com/T/ commit 3b8c4507779691984e31e64e0b80abb03cc02d0d Author: Kent Overstreet Date: Mon Nov 6 19:49:47 2023 -0500 bcachefs: btree_trans->write_locked As prep work for the next patch to fix a key cache reclaim issue, we need to start tracking whether we're currently holding write locks - so that we can release and retake the before calling into memory reclaim. Signed-off-by: Kent Overstreet commit c65c13f0eac61218c9ee4635c05661c0b9760e58 Author: Kent Overstreet Date: Mon Nov 6 09:53:14 2023 -0500 bcachefs: Run btree key cache shrinker less aggressively The btree key cache maintains lists of items that have been freed, but can't yet be reclaimed because a bch2_trans_relock() call might find them - we're waiting for SRCU readers to release. Previously, we wouldn't count these items against the number we're attempting to scan for, which would mean we'd evict more live key cache entries - doing quite a bit of potentially unecessary work. With recent work to make sure we don't hold SRCU locks for too long, it should be safe to count all the items on the freelists against number to scan - even if we can't reclaim them yet, we will be able to soon. Signed-off-by: Kent Overstreet commit 1bd5bcc9f5eef968ed021d72b14a157be7abdb49 Author: Kent Overstreet Date: Mon Nov 13 21:44:14 2023 -0500 bcachefs: Split out btree_key_cache_types.h More consistent organization. Signed-off-by: Kent Overstreet commit 4d6128dca6d940015fe2aa383ec1a0eeb9632f08 Author: Kent Overstreet Date: Mon Nov 6 11:59:05 2023 -0500 bcachefs: Guard against insufficient devices to create stripes We can't create stripes if we don't have enough devices - this manifested as an integer underflow bug later. Signed-off-by: Kent Overstreet commit 03cc1e67a243cbb2c85d5fd84f369449f94d4269 Author: Kent Overstreet Date: Tue Nov 7 10:30:22 2023 -0500 bcachefs: Fix null ptr deref in bch2_backpointer_get_node() bch2_btree_iter_peek_node() can return a NULL ptr (when the tree is shorter than the search depth); handle this with an early return. Signed-off-by: Kent Overstreet Reported-by: Dan Carpenter Fixes: https://lore.kernel.org/linux-bcachefs/5fc3c28b-c232-4ec7-b0ac-4ef220ddf976@moroto.mountain/T/ Signed-off-by: Kent Overstreet commit 274c2f8fd27158d15524abe63c3df6fb96707dd3 Author: Gustavo A. R. Silva Date: Mon Nov 6 15:40:22 2023 -0600 bcachefs: Fix multiple -Warray-bounds warnings Transform zero-length array `entries` into a proper flexible-array member in `struct journal_seq_blacklist_table`; and fix the following -Warray-bounds warnings: fs/bcachefs/journal_seq_blacklist.c:148:26: warning: array subscript idx is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:150:30: warning: array subscript idx is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:154:27: warning: array subscript idx is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:176:27: warning: array subscript i is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:177:27: warning: array subscript i is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:297:34: warning: array subscript i is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:298:34: warning: array subscript i is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] fs/bcachefs/journal_seq_blacklist.c:300:31: warning: array subscript i is outside array bounds of 'struct journal_seq_blacklist_table_entry[0]' [-Warray-bounds=] This results in no differences in binary output. This helps with the ongoing efforts to globally enable -Warray-bounds. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kent Overstreet commit 1b8bc556280d3f4970407480e6a5ff49efe5601b Author: Gustavo A. R. Silva Date: Mon Nov 6 16:27:02 2023 -0600 bcachefs: Use DECLARE_FLEX_ARRAY() helper and fix multiple -Warray-bounds warnings Transform zero-length array `s` into a proper flexible-array member in `struct snapshot_table` via the DECLARE_FLEX_ARRAY() helper; and fix tons of the following -Warray-bounds warnings: fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] fs/bcachefs/snapshot.c:135:70: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] fs/bcachefs/snapshot.h:36:21: warning: array subscript is outside array bounds of 'struct snapshot_t[0]' [-Warray-bounds=] This helps with the ongoing efforts to globally enable -Warray-bounds. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kent Overstreet commit c4f1f80a0e8d829ce4e29ca52cb7f74b22f67454 Author: Kent Overstreet Date: Sat Nov 11 12:30:19 2023 -0500 bcachefs: Use correct fgf_t type as function argument This quiets a sparse complaint. Signed-off-by: Kent Overstreet commit 48d584b7f90f48d2623fb01743b099efbf0d36c2 Author: Jiapeng Chong Date: Mon Nov 6 10:34:01 2023 +0800 bcachefs: make bch2_target_to_text_sb static The bch2_target_to_text_sb are not used outside the file disk_groups.c, so the modification is defined as static. fs/bcachefs/disk_groups.c:583:6: warning: no previous prototype for ‘bch2_target_to_text_sb’. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7144 Signed-off-by: Jiapeng Chong Signed-off-by: Kent Overstreet commit 181724fc72486dec2bec8803459be05b5162aaa8 Author: Ekaterina Esina Date: Mon Nov 13 19:42:41 2023 +0300 cifs: fix check of rc in function generate_smb3signingkey Remove extra check after condition, add check after generating key for encryption. The check is needed to return non zero rc before rewriting it with generating key for decryption. Found by Linux Verification Center (linuxtesting.org) with SVACE. Reviewed-by: Paulo Alcantara (SUSE) Fixes: d70e9fa55884 ("cifs: try opening channels after mounting") Signed-off-by: Ekaterina Esina Co-developed-by: Anastasia Belova Signed-off-by: Anastasia Belova Signed-off-by: Steve French commit ff31ba19d732efb9aca3633935d71085e68d5076 Author: Anastasia Belova Date: Mon Nov 13 17:52:32 2023 +0300 cifs: spnego: add ';' in HOST_KEY_LEN "host=" should start with ';' (as in cifs_get_spnego_key) So its length should be 6. Found by Linux Verification Center (linuxtesting.org) with SVACE. Reviewed-by: Paulo Alcantara (SUSE) Fixes: 7c9c3760b3a5 ("[CIFS] add constants for string lengths of keynames in SPNEGO upcall string") Signed-off-by: Anastasia Belova Co-developed-by: Ekaterina Esina Signed-off-by: Ekaterina Esina Signed-off-by: Steve French commit 37e6fd0cebf0b9f71afb38fd95b10408799d1f0b Author: Charles Keepax Date: Mon Nov 13 15:59:16 2023 +0000 ASoC: wm8974: Correct boost mixer inputs Bit 6 of INPPGA (INPPGAMUTE) does not control the Aux path, it controls the input PGA path, as can been seen from Figure 8 Input Boost Stage in the datasheet. Update the naming of things in the driver to match this and update the routing to also reflect this. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20231113155916.1741027-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit a778616e4cc2d5e3a253c7d8959aafa5218fc5e4 Author: Dan Nowlin Date: Tue Nov 7 12:32:27 2023 -0500 ice: fix DDP package download for packages without signature segment Commit 3cbdb0343022 ("ice: Add support for E830 DDP package segment") incorrectly removed support for package download for packages without a signature segment. These packages include the signature buffer inline in the configurations buffers, and not in a signature segment. Fix package download by providing download support for both packages with (ice_download_pkg_with_sig_seg()) and without signature segment (ice_download_pkg_without_sig_seg()). Fixes: 3cbdb0343022 ("ice: Add support for E830 DDP package segment") Reported-by: Maciej Fijalkowski Closes: https://lore.kernel.org/netdev/ZUT50a94kk2pMGKb@boxer/ Tested-by: Maciej Fijalkowski Reviewed-by: Wojciech Drewek Reviewed-by: Jacob Keller Signed-off-by: Dan Nowlin Signed-off-by: Paul Greenwalt Reviewed-by: Simon Horman Tested-by: Arpana Arland (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 6db5f2cd9ebb12e930a82c01714a6589576cd50f Author: Arkadiusz Kubalewski Date: Tue Oct 31 18:08:00 2023 +0100 ice: dpll: fix output pin capabilities The dpll output pins which are used to feed clock signal of PHY and MAC circuits cannot be disconnected, those integrated circuits require clock signal for operation. By stopping assignment of DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE pin capability, prevent the user from invoking the state set callback on those pins, setting the state on those pins already returns error, as firmware doesn't allow the change of their state. Fixes: d7999f5ea64b ("ice: implement dpll interface to control cgu") Fixes: 8a3a565ff210 ("ice: add admin commands to access cgu configuration") Reviewed-by: Andrii Staikov Signed-off-by: Arkadiusz Kubalewski Tested-by: Sunitha Mekala (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 4a4027f25dc3f39c2aafb3bf8926125c5378c9dc Author: Arkadiusz Kubalewski Date: Tue Oct 31 18:06:54 2023 +0100 ice: dpll: fix check for dpll input priority range Supported priority value for input pins may differ with regard of NIC firmware version. E810T NICs with 3.20/4.00 FW versions would accept priority range 0-31, where firmware 4.10+ would support the range 0-9 and extra value of 255. Remove the in-range check as the driver has no information on supported values from the running firmware, let firmware decide if given value is correct and return extack error if the value is not supported. Fixes: d7999f5ea64b ("ice: implement dpll interface to control cgu") Reviewed-by: Przemek Kitszel Reviewed-by: Jacob Keller Signed-off-by: Arkadiusz Kubalewski Tested-by: Sunitha Mekala (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 7a1aba89ac54ccf6cad23a91a34c0ab24b1d7997 Author: Arkadiusz Kubalewski Date: Fri Oct 13 12:25:10 2023 +0200 ice: dpll: fix initial lock status of dpll When dpll device is registered and dpll subsystem performs notify of a new device, the lock state value provided to dpll subsystem equals 0 which is invalid value for the `enum dpll_lock_status`. Provide correct value by obtaining it from firmware before registering the dpll device. Fixes: d7999f5ea64b ("ice: implement dpll interface to control cgu") Signed-off-by: Aleksandr Loktionov Signed-off-by: Arkadiusz Kubalewski Tested-by: Sunitha Mekala (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 382561d16854a747e6df71034da08d20d6013dfe Author: Samuel Holland Date: Sun Nov 12 18:32:45 2023 -0800 i2c: ocores: Move system PM hooks to the NOIRQ phase When an I2C device contains a wake IRQ subordinate to a regmap-irq chip, the regmap-irq code must be able to perform I2C transactions during suspend_device_irqs() and resume_device_irqs(). Therefore, the bus must be suspended/resumed during the NOIRQ phase. Signed-off-by: Samuel Holland Acked-by: Peter Korsgaard Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 9bacdd8996c77c42ca004440be610692275ff9d0 Merge: 58c09cad1754c d3933152442b7 Author: Linus Torvalds Date: Mon Nov 13 09:09:12 2023 -0800 Merge tag 'for-6.7-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - fix potential overflow in returned value from SEARCH_TREE_V2 ioctl on 32bit architecture - zoned mode fixes: - drop unnecessary write pointer check for RAID0/RAID1/RAID10 profiles, now it works because of raid-stripe-tree - wait for finishing the zone when direct IO needs a new allocation - simple quota fixes: - pass correct owning root pointer when cleaning up an aborted transaction - fix leaking some structures when processing delayed refs - change key type number of BTRFS_EXTENT_OWNER_REF_KEY, reorder it before inline refs that are supposed to be sorted, keeping the original number would complicate a lot of things; this change needs an updated version of btrfs-progs to work and filesystems need to be recreated - fix error pointer dereference after failure to allocate fs devices - fix race between accounting qgroup extents and removing a qgroup * tag 'for-6.7-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: make OWNER_REF_KEY type value smallest among inline refs btrfs: fix qgroup record leaks when using simple quotas btrfs: fix race between accounting qgroup extents and removing a qgroup btrfs: fix error pointer dereference after failure to allocate fs devices btrfs: make found_logical_ret parameter mandatory for function queue_scrub_stripe() btrfs: get correct owning_root when dropping snapshot btrfs: zoned: wait for data BG to be finished on direct IO allocation btrfs: zoned: drop no longer valid write pointer check btrfs: directly return 0 on no error code in btrfs_insert_raid_extent() btrfs: use u64 for buffer sizes in the tree search ioctls commit 58c09cad1754c56cb000ef07477e8781e3fad4d3 Author: Linus Torvalds Date: Mon Nov 13 08:52:24 2023 -0800 drm/ci: make github dependabot happy again The drm CI scripts for gitlab have a requirements file that makes the github 'dependabot' worry about a few of the required tooling versions. It wants to update the pip requirements from 23.2.1 to 23.3: "When installing a package from a Mercurial VCS URL, e.g. pip install hg+..., with pip prior to v23.3, the specified Mercurial revision could be used to inject arbitrary configuration options to the hg clone call (e.g. --config). Controlling the Mercurial configuration can modify how and which repository is installed. This vulnerability does not affect users who aren't installing from Mercurial" and upgrade the urllib3 requirements from 2.0.4 to 2.0.7 due to two issues: "urllib3's request body not stripped after redirect from 303 status changes request method to GET" "`Cookie` HTTP header isn't stripped on cross-origin redirects" The file also ends up not having a newline at the end, that my editor ends up wanting to fix automatically. Link: https://github.com/dependabot Tested-by: Helen Koike Signed-off-by: Linus Torvalds commit d02ef87db9d6137fc2a98231b92f24ead4f7966d Author: Simon Trimmer Date: Mon Nov 13 16:40:29 2023 +0000 ALSA: hda: cs35l56: Enable low-power hibernation mode on i2c This can now be re-enabled as the sequence to reliably wake the device has been implemented in the shared ASoC code. This has a functional dependency on commit 3df761bdbc8b ("ASoC: cs35l56: Wake transactions need to be issued twice") To protect against this, enabling hibernation is conditional on CS35L56_WAKE_HOLD_TIME_US being defined, which indicates that the new hibernation sequences are available. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20231113164029.1156669-1-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai commit b0077e269f6c152e807fdac90b58caf012cdbaab Author: Christoph Hellwig Date: Mon Nov 13 11:52:31 2023 +0800 blk-mq: make sure active queue usage is held for bio_integrity_prep() blk_integrity_unregister() can come if queue usage counter isn't held for one bio with integrity prepared, so this request may be completed with calling profile->complete_fn, then kernel panic. Another constraint is that bio_integrity_prep() needs to be called before bio merge. Fix the issue by: - call bio_integrity_prep() with one queue usage counter grabbed reliably - call bio_integrity_prep() before bio merge Fixes: 900e080752025f00 ("block: move queue enter logic into blk_mq_submit_bio()") Reported-by: Yi Zhang Cc: Christoph Hellwig Signed-off-by: Ming Lei Tested-by: Yi Zhang Link: https://lore.kernel.org/r/20231113035231.2708053-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit f96c6c588ca81255566a5168e51c9cbbe7b86def Author: Juergen Gross Date: Tue Sep 26 14:29:54 2023 +0200 xen/events: remove unused functions There are no users of xen_irq_from_pirq() and xen_set_irq_pending(). Remove those functions. Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Signed-off-by: Juergen Gross commit 47d970204054f859f35a2237baa75c2d84fcf436 Author: Juergen Gross Date: Mon Sep 25 17:54:13 2023 +0200 xen/events: fix delayed eoi list handling When delaying eoi handling of events, the related elements are queued into the percpu lateeoi list. In case the list isn't empty, the elements should be sorted by the time when eoi handling is to happen. Unfortunately a new element will never be queued at the start of the list, even if it has a handling time lower than all other list elements. Fix that by handling that case the same way as for an empty list. Fixes: e99502f76271 ("xen/events: defer eoi in case of excessive number of events") Reported-by: Jan Beulich Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Signed-off-by: Juergen Gross commit b0eeba527e704d6023a6cd9103f929226e326b03 Author: Chen Ni Date: Tue Oct 31 08:08:07 2023 +0000 pinctrl: stm32: Add check for devm_kcalloc Add check for the return value of devm_kcalloc() and return the error if it fails in order to avoid NULL pointer dereference. Fixes: 32c170ff15b0 ("pinctrl: stm32: set default gpio line names using pin names") Signed-off-by: Chen Ni Acked-by: Valentin Caron Link: https://lore.kernel.org/r/20231031080807.3600656-1-nichen@iscas.ac.cn Signed-off-by: Linus Walleij commit 0c6498a59fbbcbf3d0a58c282dd6f0bca0eed92a Author: Matus Malych Date: Sun Nov 12 17:54:04 2023 +0100 ASoC: amd: yc: Add HP 255 G10 into quirk table HP 255 G10's internal microphone array can be made to work by adding it to the quirk table. Signed-off-by: Matus Malych Link: https://lore.kernel.org/r/20231112165403.3221-1-matus@malych.org Signed-off-by: Mark Brown commit f1ed48ef97e2d12dee21e42db4a6ebb895ed3a79 Author: Lorenzo Pieralisi Date: Wed Nov 8 12:15:49 2023 +0100 firmware: arm_ffa: Fix ffa_notification_info_get() IDs handling To parse the retrieved ID lists appropriately in ffa_notification_info_get() the ids_processed variable should not be pre-incremented - we are dropping an identifier at the beginning of the list. Fix it by using the post-increment operator to increment the number of processed IDs. Fixes: 3522be48d82b ("firmware: arm_ffa: Implement the NOTIFICATION_INFO_GET interface") Signed-off-by: Lorenzo Pieralisi Cc: Sudeep Holla Link: https://lore.kernel.org/r/20231108111549.155974-1-lpieralisi@kernel.org Signed-off-by: Sudeep Holla commit 05857a1eb723190923b091a857184ced17a83770 Author: Sudeep Holla Date: Tue Oct 31 14:13:35 2023 +0000 firmware: arm_ffa: Fix the size of the allocation in ffa_partitions_cleanup() Arry of pointer to struct ffa_dev_part_info needs to be allocated to fetch the pointers stored in XArray. However, currently we allocate the entire structure instead of just pointers. Fix the allocation size. This will also eliminate the below Smatch istatic checker warning: | drivers/firmware/arm_ffa/driver.c:1251 ffa_partitions_cleanup() | warn: double check that we're allocating correct size: 8 vs 88 Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/0e8ddbca-d9da-4a3b-aae3-328993b62ba2@moroto.mountain Link: https://lore.kernel.org/r/20231031141335.3077026-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit 6d67cbe67a86a87307df0c6fafa74394a6820ad6 Author: Sudeep Holla Date: Tue Oct 24 11:56:20 2023 +0100 firmware: arm_ffa: Fix FFA notifications cleanup path We allow the FF-A to be initialised successfully even when notification fails. When the notification fails, ffa_notifications_cleanup() gets called on the failure path. However, the driver information about the notifications like the irq, workqueues and cpu hotplug state for enabling and disabling percpu IRQ are not cleared. This may result in unexpected behaviour during CPU hotplug because of percpu IRQ being enabled and disabled or during the driver removal when ffa_notifications_cleanup() gets executed again. Fix the FFA notifications cleanup path by clearing all the notification related driver information. Link: https://lore.kernel.org/r/20231024-ffa-notification-fixes-v1-4-d552c0ec260d@arm.com Tested-by: Jens Wiklander Signed-off-by: Sudeep Holla commit f4bfcaee34bc9527274710884f8d14039f3ee506 Author: Sudeep Holla Date: Tue Oct 24 11:56:19 2023 +0100 firmware: arm_ffa: Add checks for the notification enabled state We need to check if the FF-A notifications are enabled or not in all the notification operations that are accessible for the FF-A device from the FF-A driver. This helps to avoid making calls to the FF-A firmware even if the notification setup has failed. Link: https://lore.kernel.org/r/20231024-ffa-notification-fixes-v1-3-d552c0ec260d@arm.com Tested-by: Jens Wiklander Signed-off-by: Sudeep Holla commit 6f47023f7a52f3482937e9271ba41570b8752067 Author: Sudeep Holla Date: Tue Oct 24 11:56:18 2023 +0100 firmware: arm_ffa: Setup the partitions after the notification initialisation Currently the notifications are setup of the partitions are probed and FF-A devices are added on the FF-A bus. The FF-A driver probe can be called even before the FF-A notification setup happens which is wrong and may result in failure or misbehaviour in the FF-A partition device probe. In order to ensure the FF-A notifications are setup before the FF-A devices are probed, let us move the FF-A partition setup after the completion of FF-A notification setup. Link: https://lore.kernel.org/r/20231024-ffa-notification-fixes-v1-2-d552c0ec260d@arm.com Tested-by: Jens Wiklander Signed-off-by: Sudeep Holla commit 95520fc07743d3f58e8872acd72e928b09fbc143 Author: Sudeep Holla Date: Tue Oct 24 11:56:17 2023 +0100 firmware: arm_ffa: Allow FF-A initialisation even when notification fails FF-A notifications are optional feature in the specification. Currently we allow to continue if the firmware reports no support for the notifications. However, we fail to continue and complete the FF-A driver initialisation if the notification setup fails for any reason. Let us allow the FF-A driver to complete the initialisation even if the notification fails to setup. We will just flag the error and continue to provide other features in the driver. Link: https://lore.kernel.org/r/20231024-ffa-notification-fixes-v1-1-d552c0ec260d@arm.com Tested-by: Jens Wiklander Signed-off-by: Sudeep Holla commit 3fad96e9b21bed214c1593d7d7fb3e40d1fbf6f4 Author: Sudeep Holla Date: Tue Oct 24 11:57:15 2023 +0100 firmware: arm_ffa: Declare ffa_bus_type structure in the header smatch reports: drivers/firmware/arm_ffa/bus.c:108:17: warning: symbol 'ffa_bus_type' was not declared. Should it be static? ffa_bus_type is exported to be useful in the FF-A driver. So this warning is not correct. However, declaring the ffa_bus_type structure in the header like many other bus_types do already removes this warning. So let us just do the same and get rid of the warning. Link: https://lore.kernel.org/r/20231024105715.2369638-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit c0a2a1b0d631fc460d830f52d06211838874d655 Author: Willem de Bruijn Date: Sun Nov 12 22:16:32 2023 -0500 ppp: limit MRU to 64K ppp_sync_ioctl allows setting device MRU, but does not sanity check this input. Limit to a sane upper bound of 64KB. No implementation I could find generates larger than 64KB frames. RFC 2823 mentions an upper bound of PPP over SDL of 64KB based on the 16-bit length field. Other protocols will be smaller, such as PPPoE (9KB jumbo frame) and PPPoA (18190 maximum CPCS-SDU size, RFC 2364). PPTP and L2TP encapsulate in IP. Syzbot managed to trigger alloc warning in __alloc_pages: if (WARN_ON_ONCE_GFP(order > MAX_ORDER, gfp)) WARNING: CPU: 1 PID: 37 at mm/page_alloc.c:4544 __alloc_pages+0x3ab/0x4a0 mm/page_alloc.c:4544 __alloc_skb+0x12b/0x330 net/core/skbuff.c:651 __netdev_alloc_skb+0x72/0x3f0 net/core/skbuff.c:715 netdev_alloc_skb include/linux/skbuff.h:3225 [inline] dev_alloc_skb include/linux/skbuff.h:3238 [inline] ppp_sync_input drivers/net/ppp/ppp_synctty.c:669 [inline] ppp_sync_receive+0xff/0x680 drivers/net/ppp/ppp_synctty.c:334 tty_ldisc_receive_buf+0x14c/0x180 drivers/tty/tty_buffer.c:390 tty_port_default_receive_buf+0x70/0xb0 drivers/tty/tty_port.c:37 receive_buf drivers/tty/tty_buffer.c:444 [inline] flush_to_ldisc+0x261/0x780 drivers/tty/tty_buffer.c:494 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 With call ioctl$PPPIOCSMRU1(r1, 0x40047452, &(0x7f0000000100)=0x5e6417a8) Similar code exists in other drivers that implement ppp_channel_ops ioctl PPPIOCSMRU. Those might also be in scope. Notably excluded from this are pppol2tp_ioctl and pppoe_ioctl. This code goes back to the start of git history. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: syzbot+6177e1f90d92583bcc58@syzkaller.appspotmail.com Signed-off-by: Willem de Bruijn Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit ca8add922f9c7f6e2e3c71039da8e0dcc64b87ed Author: Sven Auhagen Date: Sat Nov 11 05:41:12 2023 +0100 net: mvneta: fix calls to page_pool_get_stats Calling page_pool_get_stats in the mvneta driver without checks leads to kernel crashes. First the page pool is only available if the bm is not used. The page pool is also not allocated when the port is stopped. It can also be not allocated in case of errors. The current implementation leads to the following crash calling ethstats on a port that is down or when calling it at the wrong moment: ble to handle kernel NULL pointer dereference at virtual address 00000070 [00000070] *pgd=00000000 Internal error: Oops: 5 [#1] SMP ARM Hardware name: Marvell Armada 380/385 (Device Tree) PC is at page_pool_get_stats+0x18/0x1cc LR is at mvneta_ethtool_get_stats+0xa0/0xe0 [mvneta] pc : [] lr : [] psr: a0000013 sp : f1439d48 ip : f1439dc0 fp : 0000001d r10: 00000100 r9 : c4816b80 r8 : f0d75150 r7 : bf0b400c r6 : c238f000 r5 : 00000000 r4 : f1439d68 r3 : c2091040 r2 : ffffffd8 r1 : f1439d68 r0 : 00000000 Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none Control: 10c5387d Table: 066b004a DAC: 00000051 Register r0 information: NULL pointer Register r1 information: 2-page vmalloc region starting at 0xf1438000 allocated at kernel_clone+0x9c/0x390 Register r2 information: non-paged memory Register r3 information: slab kmalloc-2k start c2091000 pointer offset 64 size 2048 Register r4 information: 2-page vmalloc region starting at 0xf1438000 allocated at kernel_clone+0x9c/0x390 Register r5 information: NULL pointer Register r6 information: slab kmalloc-cg-4k start c238f000 pointer offset 0 size 4096 Register r7 information: 15-page vmalloc region starting at 0xbf0a8000 allocated at load_module+0xa30/0x219c Register r8 information: 1-page vmalloc region starting at 0xf0d75000 allocated at ethtool_get_stats+0x138/0x208 Register r9 information: slab task_struct start c4816b80 pointer offset 0 Register r10 information: non-paged memory Register r11 information: non-paged memory Register r12 information: 2-page vmalloc region starting at 0xf1438000 allocated at kernel_clone+0x9c/0x390 Process snmpd (pid: 733, stack limit = 0x38de3a88) Stack: (0xf1439d48 to 0xf143a000) 9d40: 000000c0 00000001 c238f000 bf0b400c f0d75150 c4816b80 9d60: 00000100 bf0a98d8 00000000 00000000 00000000 00000000 00000000 00000000 9d80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9da0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9dc0: 00000dc0 5335509c 00000035 c238f000 bf0b2214 01067f50 f0d75000 c0b9b9c8 9de0: 0000001d 00000035 c2212094 5335509c c4816b80 c238f000 c5ad6e00 01067f50 9e00: c1b0be80 c4816b80 00014813 c0b9d7f0 00000000 00000000 0000001d 0000001d 9e20: 00000000 00001200 00000000 00000000 c216ed90 c73943b8 00000000 00000000 9e40: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9e60: 00000000 c0ad9034 00000000 00000000 00000000 00000000 00000000 00000000 9e80: 00000000 00000000 00000000 5335509c c1b0be80 f1439ee4 00008946 c1b0be80 9ea0: 01067f50 f1439ee3 00000000 00000046 b6d77ae0 c0b383f0 00008946 becc83e8 9ec0: c1b0be80 00000051 0000000b c68ca480 c7172d00 c0ad8ff0 f1439ee3 cf600e40 9ee0: 01600e40 32687465 00000000 00000000 00000000 01067f50 00000000 00000000 9f00: 00000000 5335509c 00008946 00008946 00000000 c68ca480 becc83e8 c05e2de0 9f20: f1439fb0 c03002f0 00000006 5ac3c35a c4816b80 00000006 b6d77ae0 c030caf0 9f40: c4817350 00000014 f1439e1c 0000000c 00000000 00000051 01000000 00000014 9f60: 00003fec f1439edc 00000001 c0372abc b6d77ae0 c0372abc cf600e40 5335509c 9f80: c21e6800 01015c9c 0000000b 00008946 00000036 c03002f0 c4816b80 00000036 9fa0: b6d77ae0 c03000c0 01015c9c 0000000b 0000000b 00008946 becc83e8 00000000 9fc0: 01015c9c 0000000b 00008946 00000036 00000035 010678a0 b6d797ec b6d77ae0 9fe0: b6dbf738 becc838c b6d186d7 b6baa858 40000030 0000000b 00000000 00000000 page_pool_get_stats from mvneta_ethtool_get_stats+0xa0/0xe0 [mvneta] mvneta_ethtool_get_stats [mvneta] from ethtool_get_stats+0x154/0x208 ethtool_get_stats from dev_ethtool+0xf48/0x2480 dev_ethtool from dev_ioctl+0x538/0x63c dev_ioctl from sock_ioctl+0x49c/0x53c sock_ioctl from sys_ioctl+0x134/0xbd8 sys_ioctl from ret_fast_syscall+0x0/0x1c Exception stack(0xf1439fa8 to 0xf1439ff0) 9fa0: 01015c9c 0000000b 0000000b 00008946 becc83e8 00000000 9fc0: 01015c9c 0000000b 00008946 00000036 00000035 010678a0 b6d797ec b6d77ae0 9fe0: b6dbf738 becc838c b6d186d7 b6baa858 Code: e28dd004 e1a05000 e2514000 0a00006a (e5902070) This commit adds the proper checks before calling page_pool_get_stats. Fixes: b3fc79225f05 ("net: mvneta: add support for page_pool_get_stats") Signed-off-by: Sven Auhagen Reported-by: Paulo Da Silva Acked-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit fb317eb23b5ee4c37b0656a9a52a3db58d9dd072 Author: Shigeru Yoshida Date: Sat Nov 11 01:39:47 2023 +0900 tipc: Fix kernel-infoleak due to uninitialized TLV value KMSAN reported the following kernel-infoleak issue: ===================================================== BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:114 [inline] BUG: KMSAN: kernel-infoleak in copy_to_user_iter lib/iov_iter.c:24 [inline] BUG: KMSAN: kernel-infoleak in iterate_ubuf include/linux/iov_iter.h:29 [inline] BUG: KMSAN: kernel-infoleak in iterate_and_advance2 include/linux/iov_iter.h:245 [inline] BUG: KMSAN: kernel-infoleak in iterate_and_advance include/linux/iov_iter.h:271 [inline] BUG: KMSAN: kernel-infoleak in _copy_to_iter+0x4ec/0x2bc0 lib/iov_iter.c:186 instrument_copy_to_user include/linux/instrumented.h:114 [inline] copy_to_user_iter lib/iov_iter.c:24 [inline] iterate_ubuf include/linux/iov_iter.h:29 [inline] iterate_and_advance2 include/linux/iov_iter.h:245 [inline] iterate_and_advance include/linux/iov_iter.h:271 [inline] _copy_to_iter+0x4ec/0x2bc0 lib/iov_iter.c:186 copy_to_iter include/linux/uio.h:197 [inline] simple_copy_to_iter net/core/datagram.c:532 [inline] __skb_datagram_iter.5+0x148/0xe30 net/core/datagram.c:420 skb_copy_datagram_iter+0x52/0x210 net/core/datagram.c:546 skb_copy_datagram_msg include/linux/skbuff.h:3960 [inline] netlink_recvmsg+0x43d/0x1630 net/netlink/af_netlink.c:1967 sock_recvmsg_nosec net/socket.c:1044 [inline] sock_recvmsg net/socket.c:1066 [inline] __sys_recvfrom+0x476/0x860 net/socket.c:2246 __do_sys_recvfrom net/socket.c:2264 [inline] __se_sys_recvfrom net/socket.c:2260 [inline] __x64_sys_recvfrom+0x130/0x200 net/socket.c:2260 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Uninit was created at: slab_post_alloc_hook+0x103/0x9e0 mm/slab.h:768 slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x5f7/0xb50 mm/slub.c:3523 kmalloc_reserve+0x13c/0x4a0 net/core/skbuff.c:560 __alloc_skb+0x2fd/0x770 net/core/skbuff.c:651 alloc_skb include/linux/skbuff.h:1286 [inline] tipc_tlv_alloc net/tipc/netlink_compat.c:156 [inline] tipc_get_err_tlv+0x90/0x5d0 net/tipc/netlink_compat.c:170 tipc_nl_compat_recv+0x1042/0x15d0 net/tipc/netlink_compat.c:1324 genl_family_rcv_msg_doit net/netlink/genetlink.c:972 [inline] genl_family_rcv_msg net/netlink/genetlink.c:1052 [inline] genl_rcv_msg+0x1220/0x12c0 net/netlink/genetlink.c:1067 netlink_rcv_skb+0x4a4/0x6a0 net/netlink/af_netlink.c:2545 genl_rcv+0x41/0x60 net/netlink/genetlink.c:1076 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0xf4b/0x1230 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x1242/0x1420 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0x997/0xd60 net/socket.c:2588 ___sys_sendmsg+0x271/0x3b0 net/socket.c:2642 __sys_sendmsg net/socket.c:2671 [inline] __do_sys_sendmsg net/socket.c:2680 [inline] __se_sys_sendmsg net/socket.c:2678 [inline] __x64_sys_sendmsg+0x2fa/0x4a0 net/socket.c:2678 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Bytes 34-35 of 36 are uninitialized Memory access of size 36 starts at ffff88802d464a00 Data copied to user address 00007ff55033c0a0 CPU: 0 PID: 30322 Comm: syz-executor.0 Not tainted 6.6.0-14500-g1c41041124bd #10 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc38 04/01/2014 ===================================================== tipc_add_tlv() puts TLV descriptor and value onto `skb`. This size is calculated with TLV_SPACE() macro. It adds the size of struct tlv_desc and the length of TLV value passed as an argument, and aligns the result to a multiple of TLV_ALIGNTO, i.e., a multiple of 4 bytes. If the size of struct tlv_desc plus the length of TLV value is not aligned, the current implementation leaves the remaining bytes uninitialized. This is the cause of the above kernel-infoleak issue. This patch resolves this issue by clearing data up to an aligned size. Fixes: d0796d1ef63d ("tipc: convert legacy nl bearer dump to nl compat") Signed-off-by: Shigeru Yoshida Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit e6daf129ccb79d3781129f623f82bc676f2cb02c Author: Willem de Bruijn Date: Fri Nov 10 10:36:00 2023 -0500 net: gso_test: support CONFIG_MAX_SKB_FRAGS up to 45 The test allocs a single page to hold all the frag_list skbs. This is insufficient on kernels with CONFIG_MAX_SKB_FRAGS=45, due to the increased skb_shared_info frags[] array length. gso_test_func: ASSERTION FAILED at net/core/gso_test.c:210 Expected alloc_size <= ((1UL) << 12), but alloc_size == 5075 (0x13d3) ((1UL) << 12) == 4096 (0x1000) Simplify the logic. Just allocate a page for each frag_list skb. Fixes: 4688ecb1385f ("net: expand skb_segment unit test with frag_list coverage") Signed-off-by: Willem de Bruijn Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 438cbcdf105d84449fceb39a2d0e16d0ec20708f Author: Marek Behún Date: Fri Nov 10 13:05:46 2023 +0100 net: mdio: fix typo in header The quotes symbol in "EEE "link partner ability 1 should be at the end of the register name "EEE link partner ability 1" Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 6979a51ecaec4dfb7c768eb2a77b77df73a74c8e Author: MD Danish Anwar Date: Mon Nov 13 15:16:56 2023 +0530 MAINTAINERS: add entry for TI ICSSG Ethernet driver Add record for TI Industrial Communication Subsystem - Gigabit (ICSSG) Ethernet driver. Also add Roger and myself as maintainer. Signed-off-by: MD Danish Anwar Signed-off-by: David S. Miller commit f726eaa787e9f9bc858c902d18a09af6bcbfcdaf Author: Jan Bottorff Date: Thu Nov 9 03:19:27 2023 +0000 i2c: designware: Fix corrupted memory seen in the ISR When running on a many core ARM64 server, errors were happening in the ISR that looked like corrupted memory. These corruptions would fix themselves if small delays were inserted in the ISR. Errors reported by the driver included "i2c_designware APMC0D0F:00: i2c_dw_xfer_msg: invalid target address" and "i2c_designware APMC0D0F:00:controller timed out" during in-band IPMI SSIF stress tests. The problem was determined to be memory writes in the driver were not becoming visible to all cores when execution rapidly shifted between cores, like when a register write immediately triggers an ISR. Processors with weak memory ordering, like ARM64, make no guarantees about the order normal memory writes become globally visible, unless barrier instructions are used to control ordering. To solve this, regmap accessor functions configured by this driver were changed to use non-relaxed forms of the low-level register access functions, which include a barrier on platforms that require it. This assures memory writes before a controller register access are visible to all cores. The community concluded defaulting to correct operation outweighed defaulting to the small performance gains from using relaxed access functions. Being a low speed device added weight to this choice of default register access behavior. Signed-off-by: Jan Bottorff Acked-by: Jarkko Nikula Tested-by: Serge Semin Reviewed-by: Serge Semin Signed-off-by: Wolfram Sang commit aff787f64ad7cbb54614b51b82c682fe06411ef3 Author: Yicong Yang Date: Tue Oct 10 16:47:30 2023 +0800 hwtracing: hisi_ptt: Don't try to attach a task PTT is an uncore PMU and shouldn't be attached to any task. Block the usage in pmu::event_init(). Signed-off-by: Yicong Yang Acked-by: Jonathan Cameron Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20231010084731.30450-5-yangyicong@huawei.com commit e0dd27ad8af00f147ac3c9de88e0687986afc3ea Author: Yicong Yang Date: Tue Oct 10 16:47:28 2023 +0800 hwtracing: hisi_ptt: Handle the interrupt in hardirq context Handle the trace interrupt in the hardirq context, make sure the irq core won't threaded it by declaring IRQF_NO_THREAD and userspace won't balance it by declaring IRQF_NOBALANCING. Otherwise we may violate the synchronization requirements of the perf core, referenced to the change of arm-ccn PMU commit 0811ef7e2f54 ("bus: arm-ccn: fix PMU interrupt flags"). In the interrupt handler we mainly doing 2 things: - Copy the data from the local DMA buffer to the AUX buffer - Commit the data in the AUX buffer Signed-off-by: Yicong Yang Acked-by: Jonathan Cameron [ Fixed commit description to suppress checkpatch warning ] Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20231010084731.30450-3-yangyicong@huawei.com commit 55e0a2fb0cb5ab7c9c99c1ad4d3e6954de8b73a0 Author: Junhao He Date: Tue Oct 10 16:47:31 2023 +0800 hwtracing: hisi_ptt: Add dummy callback pmu::read() When start trace with perf option "-C $cpu" and immediately stop it with SIGTERM or others, the perf core will invoke pmu::read() while the driver doesn't implement it. Add a dummy pmu::read() to avoid any issues. Fixes: ff0de066b463 ("hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device") Signed-off-by: Junhao He Signed-off-by: Yicong Yang Acked-by: Jonathan Cameron Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20231010084731.30450-6-yangyicong@huawei.com commit 287e82cf69aa264a52bc37591bd0eb407e20f85c Author: James Clark Date: Fri Oct 6 14:14:52 2023 +0100 coresight: Fix crash when Perf and sysfs modes are used concurrently Partially revert the change in commit 6148652807ba ("coresight: Enable and disable helper devices adjacent to the path") which changed the bare call from source_ops(csdev)->enable() to coresight_enable_source() for Perf sessions. It was missed that coresight_enable_source() is specifically for the sysfs interface, rather than being a generic call. This interferes with the sysfs reference counting to cause the following crash: $ perf record -e cs_etm/@tmc_etr0/ -C 0 & $ echo 1 > /sys/bus/coresight/devices/tmc_etr0/enable_sink $ echo 1 > /sys/bus/coresight/devices/etm0/enable_source $ echo 0 > /sys/bus/coresight/devices/etm0/enable_source Unable to handle kernel NULL pointer dereference at virtual address 00000000000001d0 Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP ... Call trace: etm4_disable+0x54/0x150 [coresight_etm4x] coresight_disable_source+0x6c/0x98 [coresight] coresight_disable+0x74/0x1c0 [coresight] enable_source_store+0x88/0xa0 [coresight] dev_attr_store+0x20/0x40 sysfs_kf_write+0x4c/0x68 kernfs_fop_write_iter+0x120/0x1b8 vfs_write+0x2dc/0x3b0 ksys_write+0x70/0x108 __arm64_sys_write+0x24/0x38 invoke_syscall+0x50/0x128 el0_svc_common.constprop.0+0x104/0x130 do_el0_svc+0x40/0xb8 el0_svc+0x2c/0xb8 el0t_64_sync_handler+0xc0/0xc8 el0t_64_sync+0x1a4/0x1a8 Code: d53cd042 91002000 b9402a81 b8626800 (f940ead5) ---[ end trace 0000000000000000 ]--- This commit linked below also fixes the issue, but has unlocked updates to the mode which could potentially race. So until we come up with a more complete solution that takes all locking and interaction between both modes into account, just revert back to the old behavior for Perf. Reported-by: Junhao He Closes: https://lore.kernel.org/linux-arm-kernel/20230921132904.60996-1-hejunhao3@huawei.com/ Fixes: 6148652807ba ("coresight: Enable and disable helper devices adjacent to the path") Tested-by: Junhao He Signed-off-by: James Clark Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20231006131452.646721-1-james.clark@arm.com commit 348ddab81f7b0983d9fb158df910254f08d3f887 Author: Uwe Kleine-König Date: Fri Sep 29 10:16:37 2023 +0200 coresight: etm4x: Remove bogous __exit annotation for some functions etm4_platform_driver (which lives in ".data" contains a reference to etm4_remove_platform_dev(). So the latter must not be marked with __exit which results in the function being discarded for a build with CONFIG_CORESIGHT_SOURCE_ETM4X=y which in turn makes the remove pointer contain invalid data. etm4x_amba_driver referencing etm4_remove_amba() has the same issue. Drop the __exit annotations for the two affected functions and a third one that is called by the other two. For reasons I don't understand this isn't catched by building with CONFIG_DEBUG_SECTION_MISMATCH=y. Fixes: c23bc382ef0e ("coresight: etm4x: Refactor probing routine") Fixes: 5214b563588e ("coresight: etm4x: Add support for sysreg only devices") Signed-off-by: Uwe Kleine-König Reviewed-by: James Clark Link: https://lore.kernel.org/all/20230929081540.yija47lsj35xtj4v@pengutronix.de/ Link: https://lore.kernel.org/r/20230929081637.2377335-1-u.kleine-koenig@pengutronix.de Signed-off-by: Suzuki K Poulose commit 5d64075cd80069a67a275482f70a4793a6b0a072 Merge: 2bd5b559a1f39 dff655e82faff Author: David S. Miller Date: Mon Nov 13 09:06:58 2023 +0000 Merge branch 'hns3-fixes' Jijie Shao says: ==================== There are some bugfix for the HNS3 ethernet driver There are some bugfix for the HNS3 ethernet driver --- ChangeLog: v1 -> v2: - net: hns3: fix add VLAN fail issue, net: hns3: fix VF reset fail issue are modified suggested by Paolo v1: https://lore.kernel.org/all/20231028025917.314305-1-shaojijie@huawei.com/ ==================== Signed-off-by: David S. Miller commit dff655e82faffc287d4a72a59f66fa120bf904e4 Author: Jijie Shao Date: Fri Nov 10 17:37:13 2023 +0800 net: hns3: fix VF wrong speed and duplex issue If PF is down, firmware will returns 10 Mbit/s rate and half-duplex mode when PF queries the port information from firmware. After imp reset command is executed, PF status changes to down, and PF will query link status and updates port information from firmware in a periodic scheduled task. However, there is a low probability that port information is updated when PF is down, and then PF link status changes to up. In this case, PF synchronizes incorrect rate and duplex mode to VF. This patch fixes it by updating port information before PF synchronizes the rate and duplex to the VF when PF changes to up. Fixes: 18b6e31f8bf4 ("net: hns3: PF add support for pushing link status to VFs") Signed-off-by: Jijie Shao Signed-off-by: David S. Miller commit 65e98bb56fa3ce2edb400930c05238c9b380500e Author: Jijie Shao Date: Fri Nov 10 17:37:12 2023 +0800 net: hns3: fix VF reset fail issue Currently the reset process in hns3 and firmware watchdog init process is asynchronous. We think firmware watchdog initialization is completed before VF clear the interrupt source. However, firmware initialization may not complete early. So VF will receive multiple reset interrupts and fail to reset. So we add delay before VF interrupt source and 5 ms delay is enough to avoid second reset interrupt. Fixes: 427900d27d86 ("net: hns3: fix the timing issue of VF clearing interrupt sources") Signed-off-by: Jijie Shao Signed-off-by: David S. Miller commit dbd2f3b20c6ae425665b6975d766e3653d453e73 Author: Yonglong Liu Date: Fri Nov 10 17:37:11 2023 +0800 net: hns3: fix variable may not initialized problem in hns3_init_mac_addr() When a VF is calling hns3_init_mac_addr(), get_mac_addr() may return fail, then the value of mac_addr_temp is not initialized. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Yonglong Liu Signed-off-by: Jijie Shao Signed-off-by: David S. Miller commit 53aba458f23846112c0d44239580ff59bc5c36c3 Author: Yonglong Liu Date: Fri Nov 10 17:37:10 2023 +0800 net: hns3: fix out-of-bounds access may occur when coalesce info is read via debugfs The hns3 driver define an array of string to show the coalesce info, but if the kernel adds a new mode or a new state, out-of-bounds access may occur when coalesce info is read via debugfs, this patch fix the problem. Fixes: c99fead7cb07 ("net: hns3: add debugfs support for interrupt coalesce") Signed-off-by: Yonglong Liu Signed-off-by: Jijie Shao Signed-off-by: David S. Miller commit 75b247b57d8b71bcb679e4cb37d0db104848806c Author: Jian Shen Date: Fri Nov 10 17:37:09 2023 +0800 net: hns3: fix incorrect capability bit display for copper port Currently, the FEC capability bit is default set for device version V2. It's incorrect for the copper port. Eventhough it doesn't make the nic work abnormal, but the capability information display in debugfs may confuse user. So clear it when driver get the port type inforamtion. Fixes: 433ccce83504 ("net: hns3: use FEC capability queried from firmware") Signed-off-by: Jian Shen Signed-off-by: Jijie Shao Signed-off-by: David S. Miller commit ac92c0a9a0603fb448e60f38e63302e4eebb8035 Author: Yonglong Liu Date: Fri Nov 10 17:37:08 2023 +0800 net: hns3: add barrier in vf mailbox reply process In hclgevf_mbx_handler() and hclgevf_get_mbx_resp() functions, there is a typical store-store and load-load scenario between received_resp and additional_info. This patch adds barrier to fix the problem. Fixes: 4671042f1ef0 ("net: hns3: add match_id to check mailbox response from PF to VF") Signed-off-by: Yonglong Liu Signed-off-by: Jijie Shao Signed-off-by: David S. Miller commit 472a2ff63efb30234cbf6b2cdaf8117f21b4f8bc Author: Jian Shen Date: Fri Nov 10 17:37:07 2023 +0800 net: hns3: fix add VLAN fail issue The hclge_sync_vlan_filter is called in periodic task, trying to remove VLAN from vlan_del_fail_bmap. It can be concurrence with VLAN adding operation from user. So once user failed to delete a VLAN id, and add it again soon, it may be removed by the periodic task, which may cause the software configuration being inconsistent with hardware. So add mutex handling to avoid this. user hns3 driver periodic task │ add vlan 10 ───── hns3_vlan_rx_add_vid │ │ (suppose success) │ │ │ del vlan 10 ───── hns3_vlan_rx_kill_vid │ │ (suppose fail,add to │ │ vlan_del_fail_bmap) │ │ │ add vlan 10 ───── hns3_vlan_rx_add_vid │ (suppose success) │ foreach vlan_del_fail_bmp del vlan 10 Fixes: fe4144d47eef ("net: hns3: sync VLAN filter entries when kill VLAN ID failed") Signed-off-by: Jian Shen Signed-off-by: Jijie Shao Signed-off-by: David S. Miller commit efb9cbf66440482ceaa90493d648226ab7ec2ebf Author: Junxian Huang Date: Sat Oct 28 17:32:42 2023 +0800 RDMA/hns: Fix unnecessary err return when using invalid congest control algorithm Add a default congest control algorithm so that driver won't return an error when the configured algorithm is invalid. Fixes: f91696f2f053 ("RDMA/hns: Support congestion control type selection according to the FW") Signed-off-by: Junxian Huang Link: https://lore.kernel.org/r/20231028093242.670325-1-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit 0550d4604e2ca4e653dc13f0c009fc42106b6bfc Author: Shigeru Yoshida Date: Wed Nov 8 23:31:13 2023 +0900 RDMA/core: Fix uninit-value access in ib_get_eth_speed() KMSAN reported the following uninit-value access issue: lo speed is unknown, defaulting to 1000 ===================================================== BUG: KMSAN: uninit-value in ib_get_width_and_speed drivers/infiniband/core/verbs.c:1889 [inline] BUG: KMSAN: uninit-value in ib_get_eth_speed+0x546/0xaf0 drivers/infiniband/core/verbs.c:1998 ib_get_width_and_speed drivers/infiniband/core/verbs.c:1889 [inline] ib_get_eth_speed+0x546/0xaf0 drivers/infiniband/core/verbs.c:1998 siw_query_port drivers/infiniband/sw/siw/siw_verbs.c:173 [inline] siw_get_port_immutable+0x6f/0x120 drivers/infiniband/sw/siw/siw_verbs.c:203 setup_port_data drivers/infiniband/core/device.c:848 [inline] setup_device drivers/infiniband/core/device.c:1244 [inline] ib_register_device+0x1589/0x1df0 drivers/infiniband/core/device.c:1383 siw_device_register drivers/infiniband/sw/siw/siw_main.c:72 [inline] siw_newlink+0x129e/0x13d0 drivers/infiniband/sw/siw/siw_main.c:490 nldev_newlink+0x8fd/0xa60 drivers/infiniband/core/nldev.c:1763 rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline] rdma_nl_rcv+0xe8a/0x1120 drivers/infiniband/core/netlink.c:259 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0xf4b/0x1230 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x1242/0x1420 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0x997/0xd60 net/socket.c:2588 ___sys_sendmsg+0x271/0x3b0 net/socket.c:2642 __sys_sendmsg net/socket.c:2671 [inline] __do_sys_sendmsg net/socket.c:2680 [inline] __se_sys_sendmsg net/socket.c:2678 [inline] __x64_sys_sendmsg+0x2fa/0x4a0 net/socket.c:2678 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Local variable lksettings created at: ib_get_eth_speed+0x4b/0xaf0 drivers/infiniband/core/verbs.c:1974 siw_query_port drivers/infiniband/sw/siw/siw_verbs.c:173 [inline] siw_get_port_immutable+0x6f/0x120 drivers/infiniband/sw/siw/siw_verbs.c:203 CPU: 0 PID: 11257 Comm: syz-executor.1 Not tainted 6.6.0-14500-g1c41041124bd #10 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc38 04/01/2014 ===================================================== If __ethtool_get_link_ksettings() fails, `netdev_speed` is set to the default value, SPEED_1000. In this case, if `lanes` field of struct ethtool_link_ksettings is not initialized, an uninitialized value is passed to ib_get_width_and_speed(). This causes the above issue. This patch resolves the issue by initializing `lanes` to 0. Fixes: cb06b6b3f6cb ("RDMA/core: Get IB width and speed from netdev") Signed-off-by: Shigeru Yoshida Link: https://lore.kernel.org/r/20231108143113.1360567-1-syoshida@redhat.com Signed-off-by: Leon Romanovsky commit 50e865a56876bd7a74a79c1778025631150f104a Author: Randy Dunlap Date: Sun Nov 5 21:56:31 2023 -0800 xen/shbuf: eliminate 17 kernel-doc warnings Don't use kernel-doc markers ("/**") for comments that are not in kernel-doc format. This prevents multiple kernel-doc warnings: xen-front-pgdir-shbuf.c:25: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * This structure represents the structure of a shared page xen-front-pgdir-shbuf.c:37: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Shared buffer ops which are differently implemented xen-front-pgdir-shbuf.c:65: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Get granted reference to the very first page of the xen-front-pgdir-shbuf.c:85: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Map granted references of the shared buffer. xen-front-pgdir-shbuf.c:106: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Unmap granted references of the shared buffer. xen-front-pgdir-shbuf.c:127: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Free all the resources of the shared buffer. xen-front-pgdir-shbuf.c:154: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Get the number of pages the page directory consumes itself. xen-front-pgdir-shbuf.c:164: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Calculate the number of grant references needed to share the buffer xen-front-pgdir-shbuf.c:176: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Calculate the number of grant references needed to share the buffer xen-front-pgdir-shbuf.c:194: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Unmap the buffer previously mapped with grant references xen-front-pgdir-shbuf.c:242: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Map the buffer with grant references provided by the backend. xen-front-pgdir-shbuf.c:324: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Fill page directory with grant references to the pages of the xen-front-pgdir-shbuf.c:354: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Fill page directory with grant references to the pages of the xen-front-pgdir-shbuf.c:393: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Grant references to the frontend's buffer pages. xen-front-pgdir-shbuf.c:422: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Grant all the references needed to share the buffer. xen-front-pgdir-shbuf.c:470: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Allocate all required structures to mange shared buffer. xen-front-pgdir-shbuf.c:510: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Allocate a new instance of a shared buffer. Signed-off-by: Randy Dunlap Reported-by: kernel test robot Closes: lore.kernel.org/r/202311060203.yQrpPZhm-lkp@intel.com Acked-by: Juergen Gross Cc: Juergen Gross Cc: Stefano Stabellini Cc: Oleksandr Tyshchenko Cc: xen-devel@lists.xenproject.org Link: https://lore.kernel.org/r/20231106055631.21520-1-rdunlap@infradead.org Signed-off-by: Juergen Gross commit bfa993b355d33a438a746523e7129391c8664e8a Author: Roger Pau Monne Date: Wed Nov 8 16:25:15 2023 -0500 acpi/processor: sanitize _OSC/_PDC capabilities for Xen dom0 The Processor capability bits notify ACPI of the OS capabilities, and so ACPI can adjust the return of other Processor methods taking the OS capabilities into account. When Linux is running as a Xen dom0, the hypervisor is the entity in charge of processor power management, and hence Xen needs to make sure the capabilities reported by _OSC/_PDC match the capabilities of the driver in Xen. Introduce a small helper to sanitize the buffer when running as Xen dom0. When Xen supports HWP, this serves as the equivalent of commit a21211672c9a ("ACPI / processor: Request native thermal interrupt handling via _OSC") to avoid SMM crashes. Xen will set bit ACPI_PROC_CAP_COLLAB_PROC_PERF (bit 12) in the capability bits and the _OSC/_PDC call will apply it. [ jandryuk: Mention Xen HWP's need. Support _OSC & _PDC ] Signed-off-by: Roger Pau Monné Cc: stable@vger.kernel.org Signed-off-by: Jason Andryuk Reviewed-by: Michal Wilczynski Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20231108212517.72279-1-jandryuk@gmail.com Signed-off-by: Juergen Gross commit e64e7c74b99ec9e439abca75f522f4b98f220bd1 Author: Juergen Gross Date: Tue Oct 24 13:51:36 2023 +0200 xen/events: avoid using info_for_irq() in xen_send_IPI_one() xen_send_IPI_one() is being used by cpuhp_report_idle_dead() after it calls rcu_report_dead(), meaning that any RCU usage by xen_send_IPI_one() is a bad idea. Unfortunately xen_send_IPI_one() is using notify_remote_via_irq() today, which is using irq_get_chip_data() via info_for_irq(). And irq_get_chip_data() in turn is using a maple-tree lookup requiring RCU. Avoid this problem by caching the ipi event channels in another percpu variable, allowing the use notify_remote_via_evtchn() in xen_send_IPI_one(). Fixes: 721255b9826b ("genirq: Use a maple tree for interrupt descriptor management") Reported-by: David Woodhouse Signed-off-by: Juergen Gross Tested-by: David Woodhouse Acked-by: Stefano Stabellini Signed-off-by: Juergen Gross commit 7930d9e103700cde15833638855b750715c12091 Author: Dave Chinner Date: Fri Nov 10 15:33:14 2023 +1100 xfs: recovery should not clear di_flushiter unconditionally Because on v3 inodes, di_flushiter doesn't exist. It overlaps with zero padding in the inode, except when NREXT64=1 configurations are in use and the zero padding is no longer padding but holds the 64 bit extent counter. This manifests obviously on big endian platforms (e.g. s390) because the log dinode is in host order and the overlap is the LSBs of the extent count field. It is not noticed on little endian machines because the overlap is at the MSB end of the extent count field and we need to get more than 2^^48 extents in the inode before it manifests. i.e. the heat death of the universe will occur before we see the problem in little endian machines. This is a zero-day issue for NREXT64=1 configuraitons on big endian machines. Fix it by only clearing di_flushiter on v2 inodes during recovery. Fixes: 9b7d16e34bbe ("xfs: Introduce XFS_DIFLAG2_NREXT64 and associated helpers") cc: stable@kernel.org # 5.19+ Signed-off-by: Dave Chinner Reviewed-by: "Darrick J. Wong" Signed-off-by: Chandan Babu R commit 038ca189c0d2c1570b4d922f25b524007c85cf94 Author: Dave Chinner Date: Fri Nov 10 15:33:13 2023 +1100 xfs: inode recovery does not validate the recovered inode Discovered when trying to track down a weird recovery corruption issue that wasn't detected at recovery time. The specific corruption was a zero extent count field when big extent counts are in use, and it turns out the dinode verifier doesn't detect that specific corruption case, either. So fix it too. Signed-off-by: Dave Chinner Reviewed-by: "Darrick J. Wong" Signed-off-by: Chandan Babu R commit a2e4388adfa44684c7c428a5a5980efe0d75e13e Author: Anthony Iliopoulos Date: Sun Nov 5 20:23:18 2023 +0100 xfs: fix again select in kconfig XFS_ONLINE_SCRUB_STATS Commit 57c0f4a8ea3a attempted to fix the select in the kconfig entry XFS_ONLINE_SCRUB_STATS by selecting XFS_DEBUG, but the original intention was to select DEBUG_FS, since the feature relies on debugfs to export the related scrub statistics. Fixes: 57c0f4a8ea3a ("xfs: fix select in config XFS_ONLINE_SCRUB_STATS") Reported-by: Holger Hoffstätte Signed-off-by: Anthony Iliopoulos Reviewed-by: Dave Chinner Reviewed-by: "Darrick J. Wong" Signed-off-by: Chandan Babu R commit f63a5b3769ad7659da4c0420751d78958ab97675 Author: Omar Sandoval Date: Wed Nov 1 09:41:45 2023 -0700 xfs: fix internal error from AGFL exhaustion We've been seeing XFS errors like the following: XFS: Internal error i != 1 at line 3526 of file fs/xfs/libxfs/xfs_btree.c. Caller xfs_btree_insert+0x1ec/0x280 ... Call Trace: xfs_corruption_error+0x94/0xa0 xfs_btree_insert+0x221/0x280 xfs_alloc_fixup_trees+0x104/0x3e0 xfs_alloc_ag_vextent_size+0x667/0x820 xfs_alloc_fix_freelist+0x5d9/0x750 xfs_free_extent_fix_freelist+0x65/0xa0 __xfs_free_extent+0x57/0x180 ... This is the XFS_IS_CORRUPT() check in xfs_btree_insert() when xfs_btree_insrec() fails. After converting this into a panic and dissecting the core dump, I found that xfs_btree_insrec() is failing because it's trying to split a leaf node in the cntbt when the AG free list is empty. In particular, it's failing to get a block from the AGFL _while trying to refill the AGFL_. If a single operation splits every level of the bnobt and the cntbt (and the rmapbt if it is enabled) at once, the free list will be empty. Then, when the next operation tries to refill the free list, it allocates space. If the allocation does not use a full extent, it will need to insert records for the remaining space in the bnobt and cntbt. And if those new records go in full leaves, the leaves (and potentially more nodes up to the old root) need to be split. Fix it by accounting for the additional splits that may be required to refill the free list in the calculation for the minimum free list size. P.S. As far as I can tell, this bug has existed for a long time -- maybe back to xfs-history commit afdf80ae7405 ("Add XFS_AG_MAXLEVELS macros ...") in April 1994! It requires a very unlucky sequence of events, and in fact we didn't hit it until a particular sparse mmap workload updated from 5.12 to 5.19. But this bug existed in 5.12, so it must've been exposed by some other change in allocation or writeback patterns. It's also much less likely to be hit with the rmapbt enabled, since that increases the minimum free list size and is unlikely to split at the same time as the bnobt and cntbt. Reviewed-by: "Darrick J. Wong" Reviewed-by: Dave Chinner Signed-off-by: Omar Sandoval Signed-off-by: Chandan Babu R commit 471de20303dda0b67981e06d59cc6c4a83fd2a3c Author: Leah Rumancik Date: Mon Oct 30 13:33:49 2023 -0700 xfs: up(ic_sema) if flushing data device fails We flush the data device cache before we issue external log IO. If the flush fails, we shut down the log immediately and return. However, the iclog->ic_sema is left in a decremented state so let's add an up(). Prior to this patch, xfs/438 would fail consistently when running with an external log device: sync -> xfs_log_force -> xlog_write_iclog -> down(&iclog->ic_sema) -> blkdev_issue_flush (fail causes us to intiate shutdown) -> xlog_force_shutdown -> return unmount -> xfs_log_umount -> xlog_wait_iclog_completion -> down(&iclog->ic_sema) --------> HANG There is a second early return / shutdown. Make sure the up() happens for it as well. Also make sure we cleanup the iclog state, xlog_state_done_syncing, before dropping the iclog lock. Fixes: b5d721eaae47 ("xfs: external logs need to flush data device") Fixes: 842a42d126b4 ("xfs: shutdown on failure to add page to log bio") Fixes: 7d839e325af2 ("xfs: check return codes when flushing block devices") Signed-off-by: Leah Rumancik Reviewed-by: "Darrick J. Wong" Signed-off-by: Chandan Babu R commit 55f669f34184ecb25b8353f29c7f6f1ae5b313d1 Author: Christoph Hellwig Date: Mon Oct 16 17:28:52 2023 +0200 xfs: only remap the written blocks in xfs_reflink_end_cow_extent xfs_reflink_end_cow_extent looks up the COW extent and the data fork extent at offset_fsb, and then proceeds to remap the common subset between the two. It does however not limit the remapped extent to the passed in [*offset_fsbm end_fsb] range and thus potentially remaps more blocks than the one handled by the current I/O completion. This means that with sufficiently large data and COW extents we could be remapping COW fork mappings that have not been written to, leading to a stale data exposure on a powerfail event. We use to have a xfs_trim_range to make the remap fit the I/O completion range, but that got (apparently accidentally) removed in commit df2fd88f8ac7 ("xfs: rewrite xfs_reflink_end_cow to use intents"). Note that I've only found this by code inspection, and a test case would probably require very specific delay and error injection. Fixes: df2fd88f8ac7 ("xfs: rewrite xfs_reflink_end_cow to use intents") Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" Signed-off-by: Chandan Babu R commit 00080503612f61d1ad67be641ed9cb4f9f6ba40e Author: Matthew Wilcox (Oracle) Date: Tue Sep 19 17:12:45 2023 -0400 XFS: Update MAINTAINERS to catch all XFS documentation Assumes that all XFS documentation will be prefixed with xfs-, which seems like a good policy anyway. Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Chandan Babu R commit f8f9d952e42dd49ae534f61f2fa7ca0876cb9848 Author: Long Li Date: Mon Jul 31 20:46:18 2023 +0800 xfs: abort intent items when recovery intents fail When recovering intents, we capture newly created intent items as part of committing recovered intent items. If intent recovery fails at a later point, we forget to remove those newly created intent items from the AIL and hang: [root@localhost ~]# cat /proc/539/stack [<0>] xfs_ail_push_all_sync+0x174/0x230 [<0>] xfs_unmount_flush_inodes+0x8d/0xd0 [<0>] xfs_mountfs+0x15f7/0x1e70 [<0>] xfs_fs_fill_super+0x10ec/0x1b20 [<0>] get_tree_bdev+0x3c8/0x730 [<0>] vfs_get_tree+0x89/0x2c0 [<0>] path_mount+0xecf/0x1800 [<0>] do_mount+0xf3/0x110 [<0>] __x64_sys_mount+0x154/0x1f0 [<0>] do_syscall_64+0x39/0x80 [<0>] entry_SYSCALL_64_after_hwframe+0x63/0xcd When newly created intent items fail to commit via transaction, intent recovery hasn't created done items for these newly created intent items, so the capture structure is the sole owner of the captured intent items. We must release them explicitly or else they leak: unreferenced object 0xffff888016719108 (size 432): comm "mount", pid 529, jiffies 4294706839 (age 144.463s) hex dump (first 32 bytes): 08 91 71 16 80 88 ff ff 08 91 71 16 80 88 ff ff ..q.......q..... 18 91 71 16 80 88 ff ff 18 91 71 16 80 88 ff ff ..q.......q..... backtrace: [] xfs_efi_init+0x18f/0x1d0 [] xfs_extent_free_create_intent+0x50/0x150 [] xfs_defer_create_intents+0x16a/0x340 [] xfs_defer_ops_capture_and_commit+0x8e/0xad0 [] xfs_cui_item_recover+0x819/0x980 [] xlog_recover_process_intents+0x246/0xb70 [] xlog_recover_finish+0x8a/0x9a0 [] xfs_log_mount_finish+0x2bb/0x4a0 [] xfs_mountfs+0x14bf/0x1e70 [] xfs_fs_fill_super+0x10d0/0x1b20 [] get_tree_bdev+0x3d2/0x6d0 [] vfs_get_tree+0x89/0x2c0 [] path_mount+0xecf/0x1800 [] do_mount+0xf3/0x110 [] __x64_sys_mount+0x154/0x1f0 [] do_syscall_64+0x39/0x80 Fix the problem above by abort intent items that don't have a done item when recovery intents fail. Fixes: e6fff81e4870 ("xfs: proper replay of deferred ops queued during log recovery") Signed-off-by: Long Li Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R commit 2a5db859c6825b5d50377dda9c3cc729c20cad43 Author: Long Li Date: Mon Jul 31 20:46:17 2023 +0800 xfs: factor out xfs_defer_pending_abort Factor out xfs_defer_pending_abort() from xfs_defer_trans_abort(), which not use transaction parameter, so it can be used after the transaction life cycle. Signed-off-by: Long Li Reviewed-by: Darrick J. Wong Signed-off-by: Chandan Babu R commit 7b211c7671212cad0b83603c674838c7e824d845 Author: Robert Marko Date: Fri Nov 10 10:30:11 2023 +0100 Revert "i2c: pxa: move to generic GPIO recovery" This reverts commit 0b01392c18b9993a584f36ace1d61118772ad0ca. Conversion of PXA to generic I2C recovery, makes the I2C bus completely lock up if recovery pinctrl is present in the DT and I2C recovery is enabled. So, until the generic I2C recovery can also work with PXA lets revert to have working I2C and I2C recovery again. Signed-off-by: Robert Marko Cc: stable@vger.kernel.org # 5.11+ Acked-by: Andi Shyti Acked-by: Russell King (Oracle) Acked-by: Linus Walleij Signed-off-by: Wolfram Sang commit 42d62b7e47d58273c64fc1540e5d81ccfdb60f77 Author: Laurent Pinchart Date: Tue Oct 24 17:18:17 2023 +0300 media: vsp1: Remove unbalanced .s_stream(0) calls The VSP1 driver uses the subdev .s_stream() operation to stop WPF instances, without a corresponding call to start them. The V4L2 subdev core started warning about unbalanced .s_stream() calls in commit 009905ec5043 ("media: v4l2-subdev: Document and enforce .s_stream() requirements"), causing a regression with this driver. Fix the problem by replacing the .s_stream() operation with an explicit function call for WPF instances. This allows sharing an additional data structure between RPF and WPF instances. Fixes: 009905ec5043 ("media: v4l2-subdev: Document and enforce .s_stream() requirements") Reported-by: Geert Uytterhoeven Closes: https://lore.kernel.org/linux-media/2221395-6a9b-9527-d697-e76aebc6af@linux-m68k.org/ Signed-off-by: Laurent Pinchart Tested-by: Geert Uytterhoeven commit b85ea95d086471afb4ad062012a4d73cd328fa86 Author: Linus Torvalds Date: Sun Nov 12 16:19:07 2023 -0800 Linux 6.7-rc1 commit 7e8037b099c0bbe8f2109dc452dbcab8d400fc53 Author: Saurabh Sengar Date: Sat Nov 11 00:37:47 2023 -0800 x86/hyperv: Fix the detection of E820_TYPE_PRAM in a Gen2 VM A Gen2 VM doesn't support legacy PCI/PCIe, so both raw_pci_ops and raw_pci_ext_ops are NULL, and pci_subsys_init() -> pcibios_init() doesn't call pcibios_resource_survey() -> e820__reserve_resources_late(); as a result, any emulated persistent memory of E820_TYPE_PRAM (12) via the kernel parameter memmap=nn[KMG]!ss is not added into iomem_resource and hence can't be detected by register_e820_pmem(). Fix this by directly calling e820__reserve_resources_late() in hv_pci_init(), which is called from arch_initcall(pci_arch_init). It's ok to move a Gen2 VM's e820__reserve_resources_late() from subsys_initcall(pci_subsys_init) to arch_initcall(pci_arch_init) because the code in-between doesn't depend on the E820 resources. e820__reserve_resources_late() depends on e820__reserve_resources(), which has been called earlier from setup_arch(). For a Gen-2 VM, the new hv_pci_init() also adds any memory of E820_TYPE_PMEM (7) into iomem_resource, and acpi_nfit_register_region() -> acpi_nfit_insert_resource() -> region_intersects() returns REGION_INTERSECTS, so the memory of E820_TYPE_PMEM won't get added twice. Changed the local variable "int gen2vm" to "bool gen2vm". Signed-off-by: Saurabh Sengar Signed-off-by: Dexuan Cui Signed-off-by: Wei Liu Message-ID: <1699691867-9827-1-git-send-email-ssengar@linux.microsoft.com> commit e257da5715365b853439243f89cf5d8a9d382355 Author: Miri Korenblit Date: Sun Nov 12 16:36:20 2023 +0200 wifi: iwlwifi: fix system commands group ordering The commands should be sorted inside the group definition. Fix the ordering so we won't get following warning: WARN_ON(iwl_cmd_groups_verify_sorted(trans_cfg)) Link: https://lore.kernel.org/regressions/2fa930bb-54dd-4942-a88d-05a47c8e9731@gmail.com/ Link: https://lore.kernel.org/linux-wireless/CAHk-=wix6kqQ5vHZXjOPpZBfM7mMm9bBZxi2Jh7XnaKCqVf94w@mail.gmail.com/ Fixes: b6e3d1ba4fcf ("wifi: iwlwifi: mvm: implement new firmware API for statistics") Tested-by: Niklāvs Koļesņikovs Tested-by: Damian Tometzki Acked-by: Kalle Valo Signed-off-by: Miri Korenblit Signed-off-by: Emmanuel Grumbach Signed-off-by: Linus Torvalds commit b57b17e88bf58860dad312d08db7d6708ee6d06d Merge: 4eeee6636af81 a406b8b424fa0 Author: Linus Torvalds Date: Sun Nov 12 11:05:31 2023 -0800 Merge tag 'parisc-for-6.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture fixes from Helge Deller: - Include the upper 5 address bits when inserting TLB entries on a 64-bit kernel. On physical machines those are ignored, but in qemu it's nice to have them included and to be correct. - Stop the 64-bit kernel and show a warning if someone tries to boot on a machine with a 32-bit CPU - Fix a "no previous prototype" warning in parport-gsc * tag 'parisc-for-6.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Prevent booting 64-bit kernels on PA1.x machines parport: gsc: mark init function static parisc/pgtable: Do not drop upper 5 address bits of physical address commit 4eeee6636af819454d7c43702e77ec7857a63000 Merge: 5dd2020f335a7 1d375d65466e5 Author: Linus Torvalds Date: Sun Nov 12 10:58:08 2023 -0800 Merge tag 'loongarch-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch updates from Huacai Chen: - support PREEMPT_DYNAMIC with static keys - relax memory ordering for atomic operations - support BPF CPU v4 instructions for LoongArch - some build and runtime warning fixes * tag 'loongarch-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: selftests/bpf: Enable cpu v4 tests for LoongArch LoongArch: BPF: Support signed mod instructions LoongArch: BPF: Support signed div instructions LoongArch: BPF: Support 32-bit offset jmp instructions LoongArch: BPF: Support unconditional bswap instructions LoongArch: BPF: Support sign-extension mov instructions LoongArch: BPF: Support sign-extension load instructions LoongArch: Add more instruction opcodes and emit_* helpers LoongArch/smp: Call rcutree_report_cpu_starting() earlier LoongArch: Relax memory ordering for atomic operations LoongArch: Mark __percpu functions as always inline LoongArch: Disable module from accessing external data directly LoongArch: Support PREEMPT_DYNAMIC with static keys commit 5dd2020f335a7a60c154375a168791a2b87f35b5 Merge: 1b907d0507354 644b6025bcaff Author: Linus Torvalds Date: Sun Nov 12 10:50:38 2023 -0800 Merge tag 'powerpc-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Finish a refactor of pgprot_framebuffer() which dependend on some changes that were merged via the drm tree - Fix some kernel-doc warnings to quieten the bots Thanks to Nathan Lynch and Thomas Zimmermann. * tag 'powerpc-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/rtas: Fix ppc_rtas_rmo_buf_show() kernel-doc powerpc/pseries/rtas-work-area: Fix rtas_work_area_reserve_arena() kernel-doc powerpc/fb: Call internal __phys_mem_access_prot() in fbdev code powerpc: Remove file parameter from phys_mem_access_prot() powerpc/machdep: Remove trailing whitespaces commit 713f040cd22285fcc506f40a0d259566e6758c3c Author: Chandradeep Dey Date: Sat Nov 11 19:25:49 2023 +0100 ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC Apply the already existing quirk chain ALC294_FIXUP_ASUS_SPK to enable the internal speaker of ASUS K6500ZC. Signed-off-by: Chandradeep Dey Cc: Link: https://lore.kernel.org/r/NizcVHQ--3-9@chandradeepdey.com Signed-off-by: Takashi Iwai commit 1b907d0507354b74a4f2c286380cd6059af79248 Merge: 3ca112b71f35d fd2bd7c0539e2 Author: Linus Torvalds Date: Sat Nov 11 17:17:22 2023 -0800 Merge tag '6.7-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client fixes from Steve French: - ctime caching fix (for setxattr) - encryption fix - DNS resolver mount fix - debugging improvements - multichannel fixes including cases where server stops or starts supporting multichannel after mount - reconnect fix - minor cleanups * tag '6.7-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6: cifs: update internal module version number for cifs.ko cifs: handle when server stops supporting multichannel cifs: handle when server starts supporting multichannel Missing field not being returned in ioctl CIFS_IOC_GET_MNT_INFO smb3: allow dumping session and tcon id to improve stats analysis and debugging smb: client: fix mount when dns_resolver key is not available smb3: fix caching of ctime on setxattr smb3: minor cleanup of session handling code cifs: reconnect work should have reference on server struct cifs: do not pass cifs_sb when trying to add channels cifs: account for primary channel in the interface list cifs: distribute channels across interfaces based on speed cifs: handle cases where a channel is closed smb3: more minor cleanups for session handling routines smb3: minor RDMA cleanup cifs: Fix encryption of cleared, but unset rq_iter data buffers commit 2bd5b559a1f391f05927bbb0b31381fa71c61e26 Author: Jan Kiszka Date: Fri Nov 10 17:13:08 2023 +0100 net: ti: icssg-prueth: Fix error cleanup on failing pruss_request_mem_region We were just continuing in this case, surely not desired. Fixes: 128d5874c082 ("net: ti: icssg-prueth: Add ICSSG ethernet driver") Signed-off-by: Jan Kiszka Reviewed-by: Wojciech Drewek Reviewed-by: Roger Quadros Signed-off-by: David S. Miller commit e409d7346648c9acff84c3cc8d291767ee2d5326 Author: Jan Kiszka Date: Fri Nov 10 17:13:02 2023 +0100 net: ti: icssg-prueth: Add missing icss_iep_put to error path Analogously to prueth_remove, just also taking care for NULL'ing the iep pointers. Fixes: 186734c15886 ("net: ti: icssg-prueth: add packet timestamping and ptp support") Fixes: 443a2367ba3c ("net: ti: icssg-prueth: am65x SR2.0 add 10M full duplex support") Signed-off-by: Jan Kiszka Reviewed-by: Wojciech Drewek Reviewed-by: MD Danish Anwar Reviewed-by: Roger Quadros Signed-off-by: David S. Miller commit 5c0930ccaad5a74d74e8b18b648c5eb21ed2fe94 Author: Thomas Gleixner Date: Tue Nov 7 15:57:13 2023 +0100 hrtimers: Push pending hrtimers away from outgoing CPU earlier 2b8272ff4a70 ("cpu/hotplug: Prevent self deadlock on CPU hot-unplug") solved the straight forward CPU hotplug deadlock vs. the scheduler bandwidth timer. Yu discovered a more involved variant where a task which has a bandwidth timer started on the outgoing CPU holds a lock and then gets throttled. If the lock required by one of the CPU hotplug callbacks the hotplug operation deadlocks because the unthrottling timer event is not handled on the dying CPU and can only be recovered once the control CPU reaches the hotplug state which pulls the pending hrtimers from the dead CPU. Solve this by pushing the hrtimers away from the dying CPU in the dying callbacks. Nothing can queue a hrtimer on the dying CPU at that point because all other CPUs spin in stop_machine() with interrupts disabled and once the operation is finished the CPU is marked offline. Reported-by: Yu Liao Signed-off-by: Thomas Gleixner Tested-by: Liu Tie Link: https://lore.kernel.org/r/87a5rphara.ffs@tglx commit 3ca112b71f35dd5d99fc4571a56b5fc6f0c15814 Merge: 18553507f60f4 f032c53bea6d2 Author: Linus Torvalds Date: Fri Nov 10 16:35:04 2023 -0800 Merge tag 'probes-fixes-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull probes fixes from Masami Hiramatsu: - Documentation update: Add a note about argument and return value fetching is the best effort because it depends on the type. - objpool: Fix to make internal global variables static in test_objpool.c. - kprobes: Unify kprobes_exceptions_nofify() prototypes. There are the same prototypes in asm/kprobes.h for some architectures, but some of them are missing the prototype and it causes a warning. So move the prototype into linux/kprobes.h. - tracing: Fix to check the tracepoint event and return event at parsing stage. The tracepoint event doesn't support %return but if $retval exists, it will be converted to %return silently. This finds that case and rejects it. - tracing: Fix the order of the descriptions about the parameters of __kprobe_event_gen_cmd_start() to be consistent with the argument list of the function. * tag 'probes-fixes-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing/kprobes: Fix the order of argument descriptions tracing: fprobe-event: Fix to check tracepoint event and return kprobes: unify kprobes_exceptions_nofify() prototypes lib: test_objpool: make global variables static Documentation: tracing: Add a note about argument and retval access commit c3803203bc5ec910a3eb06172cf6fb368e0e4390 Author: Ani Sinha Date: Mon Oct 16 19:01:22 2023 +0530 hv/hv_kvp_daemon: Some small fixes for handling NM keyfiles Some small fixes: - lets make sure we are not adding ipv4 addresses in ipv6 section in keyfile and vice versa. - ADDR_FAMILY_IPV6 is a bit in addr_family. Test that bit instead of checking the whole value of addr_family. - Some trivial fixes in hv_set_ifconfig.sh. These fixes are proposed after doing some internal testing at Red Hat. CC: Shradha Gupta CC: Saurabh Sengar Fixes: 42999c904612 ("hv/hv_kvp_daemon:Support for keyfile based connection profile") Signed-off-by: Ani Sinha Reviewed-by: Shradha Gupta Signed-off-by: Wei Liu Message-ID: <20231016133122.2419537-1-anisinha@redhat.com> commit 18553507f60f4f51f071644621a58836eb59e28c Merge: c0d12d769299e a5035c8184743 Author: Linus Torvalds Date: Fri Nov 10 15:07:01 2023 -0800 Merge tag 'fbdev-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev Pull fbdev fixes and cleanups from Helge Deller: - fix double free and resource leaks in imsttfb - lots of remove callback cleanups and section mismatch fixes in omapfb, amifb and atmel_lcdfb - error code fix and memparse simplification in omapfb * tag 'fbdev-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: (31 commits) fbdev: fsl-diu-fb: mark wr_reg_wa() static fbdev: amifb: Convert to platform remove callback returning void fbdev: amifb: Mark driver struct with __refdata to prevent section mismatch warning fbdev: hyperv_fb: fix uninitialized local variable use fbdev: omapfb/tpd12s015: Convert to platform remove callback returning void fbdev: omapfb/tfp410: Convert to platform remove callback returning void fbdev: omapfb/sharp-ls037v7dw01: Convert to platform remove callback returning void fbdev: omapfb/opa362: Convert to platform remove callback returning void fbdev: omapfb/hdmi: Convert to platform remove callback returning void fbdev: omapfb/dvi: Convert to platform remove callback returning void fbdev: omapfb/dsi-cm: Convert to platform remove callback returning void fbdev: omapfb/dpi: Convert to platform remove callback returning void fbdev: omapfb/analog-tv: Convert to platform remove callback returning void fbdev: atmel_lcdfb: Convert to platform remove callback returning void fbdev: omapfb/tpd12s015: Don't put .remove() in .exit.text and drop suppress_bind_attrs fbdev: omapfb/tfp410: Don't put .remove() in .exit.text and drop suppress_bind_attrs fbdev: omapfb/sharp-ls037v7dw01: Don't put .remove() in .exit.text and drop suppress_bind_attrs fbdev: omapfb/opa362: Don't put .remove() in .exit.text and drop suppress_bind_attrs fbdev: omapfb/hdmi: Don't put .remove() in .exit.text and drop suppress_bind_attrs fbdev: omapfb/dvi: Don't put .remove() in .exit.text and drop suppress_bind_attrs ... commit f032c53bea6d2057c14553832d846be2f151cfb2 Author: Yujie Liu Date: Tue Oct 31 12:13:05 2023 +0800 tracing/kprobes: Fix the order of argument descriptions The order of descriptions should be consistent with the argument list of the function, so "kretprobe" should be the second one. int __kprobe_event_gen_cmd_start(struct dynevent_cmd *cmd, bool kretprobe, const char *name, const char *loc, ...) Link: https://lore.kernel.org/all/20231031041305.3363712-1-yujie.liu@intel.com/ Fixes: 2a588dd1d5d6 ("tracing: Add kprobe event command generation functions") Suggested-by: Mukesh Ojha Signed-off-by: Yujie Liu Reviewed-by: Mukesh Ojha Signed-off-by: Masami Hiramatsu (Google) commit c0d12d769299e1e08338988c7745009e0db2a4a0 Merge: ac347a0655dbc 03df0fc007ca4 Author: Linus Torvalds Date: Fri Nov 10 14:59:30 2023 -0800 Merge tag 'drm-next-2023-11-10' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Daniel Vetter: "Dave's VPN to the big machine died, so it's on me to do fixes pr this and next week while everyone else is at plumbers. - big pile of amd fixes, but mostly for hw support newly added in 6.7 - i915 fixes, mostly minor things - qxl memory leak fix - vc4 uaf fix in mock helpers - syncobj fix for DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE" * tag 'drm-next-2023-11-10' of git://anongit.freedesktop.org/drm/drm: (78 commits) drm/amdgpu: fix error handling in amdgpu_vm_init drm/amdgpu: Fix possible null pointer dereference drm/amdgpu: move UVD and VCE sched entity init after sched init drm/amdgpu: move kfd_resume before the ip late init drm/amd: Explicitly check for GFXOFF to be enabled for s0ix drm/amdgpu: Change WREG32_RLC to WREG32_SOC15_RLC where inst != 0 (v2) drm/amdgpu: Use correct KIQ MEC engine for gfx9.4.3 (v5) drm/amdgpu: add smu v13.0.6 pcs xgmi ras error query support drm/amdgpu: fix software pci_unplug on some chips drm/amd/display: remove duplicated argument drm/amdgpu: correct mca debugfs dump reg list drm/amdgpu: correct acclerator check architecutre dump drm/amdgpu: add pcs xgmi v6.4.0 ras support drm/amdgpu: Change extended-scope MTYPE on GC 9.4.3 drm/amdgpu: disable smu v13.0.6 mca debug mode by default drm/amdgpu: Support multiple error query modes drm/amdgpu: refine smu v13.0.6 mca dump driver drm/amdgpu: Do not program PF-only regs in hdp_v4_0.c under SRIOV (v2) drm/amdgpu: Skip PCTL0_MMHUB_DEEPSLEEP_IB write in jpegv4.0.3 under SRIOV drm: amd: Resolve Sphinx unexpected indentation warning ... commit ac347a0655dbc7d885e217c89dddd16e2800bd58 Merge: e1d809b3c5d1d f86128050d2d8 Author: Linus Torvalds Date: Fri Nov 10 12:22:14 2023 -0800 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: "Mostly PMU fixes and a reworking of the pseudo-NMI disabling on broken MediaTek firmware: - Move the MediaTek GIC quirk handling from irqchip to core. Before the merging window commit 44bd78dd2b88 ("irqchip/gic-v3: Disable pseudo NMIs on MediaTek devices w/ firmware issues") temporarily addressed this issue. Fixed now at a deeper level in the arch code - Reject events meant for other PMUs in the CoreSight PMU driver, otherwise some of the core PMU events would disappear - Fix the Armv8 PMUv3 driver driver to not truncate 64-bit registers, causing some events to be invisible - Remove duplicate declaration of __arm64_sys##name following the patch to avoid prototype warning for syscalls - Typos in the elf_hwcap documentation" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64/syscall: Remove duplicate declaration Revert "arm64: smp: avoid NMI IPIs with broken MediaTek FW" arm64: Move MediaTek GIC quirk handling from irqchip to core arm64/arm: arm_pmuv3: perf: Don't truncate 64-bit registers perf: arm_cspmu: Reject events meant for other PMUs Documentation/arm64: Fix typos in elf_hwcaps commit e1d809b3c5d1d9988350755454747a105dad331b Merge: ae4f52a729a17 bce36aa682da7 Author: Linus Torvalds Date: Fri Nov 10 11:57:51 2023 -0800 Merge tag 'sound-fix-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of fixes for rc1. The majority of changes are various ASoC driver-specific small fixes and usual HD-audio quirks, while there are a couple of core changes: a fix in ALSA core procfs code to avoid deadlocks at disconnection and an ASoC core fix for DAPM clock widgets" * tag 'sound-fix-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: OSS: dmasound/paula: Convert to platform remove callback returning void ALSA: hda: ASUS UM5302LA: Added quirks for cs35L41/10431A83 on i2c bus ALSA: info: Fix potential deadlock at disconnection ASoC: nau8540: Add self recovery to improve capture quility ALSA: hda/realtek: Add support dual speaker for Dell ALSA: hda: Add ASRock X670E Taichi to denylist ALSA: hda/realtek: Add quirk for ASUS UX7602ZM ASoC: SOF: sof-client: trivial: fix comment typo ASoC: dapm: fix clock get name ASoC: hdmi-codec: register hpd callback on component probe ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: trivial: fix error messages ASoC: da7219: Improve system suspend and resume handling ASoC: codecs: Modify macro value error ASoC: codecs: Modify the wrong judgment of re value ASoC: codecs: Modify the maximum value of calib ASoC: amd: acp: fix for i2s mode register field update ASoC: codecs: aw88399: Fix -Wuninitialized in aw_dev_set_vcalb() ASoC: rt712-sdca: fix speaker route missing issue ASoC: rockchip: Fix unused rockchip_i2s_tdm_match warning for !CONFIG_OF ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings commit 03df0fc007ca4713fa1e716329af556f981807e4 Merge: aec3e2e23b08f 8473bfdcb5b1a Author: Daniel Vetter Date: Fri Nov 10 20:51:37 2023 +0100 Merge tag 'amd-drm-next-6.7-2023-11-10' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-6.7-2023-11-10: amdgpu: - SR-IOV fixes - DMCUB fixes - DCN3.5 fixes - DP2 fixes - SubVP fixes - SMU14 fixes - SDMA4.x fixes - Suspend/resume fixes - AGP regression fix - UAF fixes for some error cases - SMU 13.0.6 fixes - Documentation fixes - RAS fixes - Hotplug fixes - Scheduling entity ordering fix - GPUVM fixes Signed-off-by: Daniel Vetter From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20231110190703.4741-1-alexander.deucher@amd.com commit ae4f52a729a17a48865a008a6c7dd4c44077ec54 Merge: b456259e1544d bef4a48f4ef79 Author: Linus Torvalds Date: Fri Nov 10 11:44:38 2023 -0800 Merge tag 'spi-fix-v6.7-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A couple of fixes that came in during the merge window: one Kconfig dependency fix and another fix for a long standing issue where a sync transfer races with system suspend" * tag 'spi-fix-v6.7-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: Fix null dereference on suspend spi: spi-zynq-qspi: add spi-mem to driver kconfig dependencies commit b456259e1544daa337fa00cda8bd3bea04c8d914 Merge: b077b7ee9268b 015c9cbcf0ad7 Author: Linus Torvalds Date: Fri Nov 10 11:40:38 2023 -0800 Merge tag 'mmc-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: "MMC core: - Fix broken cache-flush support for Micron eMMCs - Revert 'mmc: core: Capture correct oemid-bits for eMMC cards' MMC host: - sdhci_am654: Fix TAP value parsing for legacy speed mode - sdhci-pci-gli: Fix support for ASPM mode for GL9755/GL9750 - vub300: Fix an error path in probe" * tag 'mmc-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-pci-gli: GL9750: Mask the replay timer timeout of AER mmc: sdhci-pci-gli: GL9755: Mask the replay timer timeout of AER Revert "mmc: core: Capture correct oemid-bits for eMMC cards" mmc: vub300: fix an error code mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for Micron eMMC Q2J54A mmc: sdhci_am654: fix start loop index for TAP value parsing commit b077b7ee9268bb4a34e22a503a2e6315ae8f97a7 Merge: b712075e03cf9 d27abbfd4888d Author: Linus Torvalds Date: Fri Nov 10 11:34:16 2023 -0800 Merge tag 'pwm/for-6.7-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm Pull pwm fixes from Thierry Reding: "This contains two very small fixes that I failed to include in the main pull request" * tag 'pwm/for-6.7-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: pwm: Fix double shift bug pwm: samsung: Fix a bit test in pwm_samsung_resume() commit b712075e03cf95d9009c99230775dc41195bde8a Merge: 4b803784178d1 e53759298a7d7 Author: Linus Torvalds Date: Fri Nov 10 11:25:58 2023 -0800 Merge tag 'io_uring-6.7-2023-11-10' of git://git.kernel.dk/linux Pull io_uring fixes from Jens Axboe: "Mostly just a few fixes and cleanups caused by the read multishot support. Outside of that, a stable fix for how a connect retry is done" * tag 'io_uring-6.7-2023-11-10' of git://git.kernel.dk/linux: io_uring: do not clamp read length for multishot read io_uring: do not allow multishot read to set addr or len io_uring: indicate if io_kbuf_recycle did recycle anything io_uring/rw: add separate prep handler for fixed read/write io_uring/rw: add separate prep handler for readv/writev io_uring/net: ensure socket is marked connected on connect retry io_uring/rw: don't attempt to allocate async data if opcode doesn't need it commit 4b803784178d1721ba26cadd8aef13b2c7456730 Merge: d035e4eb38b3e 37d9486874ec9 Author: Linus Torvalds Date: Fri Nov 10 11:20:33 2023 -0800 Merge tag 'block-6.7-2023-11-10' of git://git.kernel.dk/linux Pull block fixes from Jens Axboe: - NVMe pull request via Keith: - nvme keyring config compile fixes (Hannes and Arnd) - fabrics keep alive fixes (Hannes) - tcp authentication fixes (Mark) - io_uring_cmd error handling fix (Anuj) - stale firmware attribute fix (Daniel) - tcp memory leak (Christophe) - crypto library usage simplification (Eric) - nbd use-after-free fix. May need a followup, but at least it's better than what it was before (Li) - Rate limit write on read-only device warnings (Yu) * tag 'block-6.7-2023-11-10' of git://git.kernel.dk/linux: nvme: keyring: fix conditional compilation nvme: common: make keyring and auth separate modules blk-core: use pr_warn_ratelimited() in bio_check_ro() nbd: fix uaf in nbd_open nvme: start keep-alive after admin queue setup nvme-loop: always quiesce and cancel commands before destroying admin q nvme-tcp: avoid open-coding nvme_tcp_teardown_admin_queue() nvme-auth: always set valid seq_num in dhchap reply nvme-auth: add flag for bi-directional auth nvme-auth: auth success1 msg always includes resp nvme: fix error-handling for io_uring nvme-passthrough nvme: update firmware version after commit nvme-tcp: Fix a memory leak nvme-auth: use crypto_shash_tfm_digest() commit d035e4eb38b3ea5ae9ead342f888fd3c394b0fe0 Merge: 391ce5b9c46eb 99bce5182d8fe Author: Linus Torvalds Date: Fri Nov 10 11:15:34 2023 -0800 Merge tag 'ata-6.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fixes from Damien Le Moal: - Revert a change in ata_pci_shutdown_one() to suspend disks on shutdown as this is now done using the manage_shutdown scsi device flag (me) - Change the pata_falcon and pata_gayle drivers to stop using module_platform_driver_probe(). This makes these drivers more inline with all other drivers (allowing bind/unbind) and suppress a compilation warning (Uwe) - Convert the pata_falcon and pata_gayle drivers to the new .remove_new() void-return callback. These 2 drivers are the last ones needing this change (Uwe) * tag 'ata-6.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: pata_gayle: Convert to platform remove callback returning void ata: pata_falcon: Convert to platform remove callback returning void ata: pata_gayle: Stop using module_platform_driver_probe() ata: pata_falcon: Stop using module_platform_driver_probe() ata: libata-core: Fix ata_pci_shutdown_one() commit 391ce5b9c46ebf23cd049bb552a899dfc0cfb838 Merge: ead3b62a34d82 53c87e846e335 Author: Linus Torvalds Date: Fri Nov 10 11:09:07 2023 -0800 Merge tag 'dma-mapping-6.7-2023-11-10' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping fixes from Christoph Hellwig: - don't leave pages decrypted for DMA in encrypted memory setups linger around on failure (Petr Tesarik) - fix an out of bounds access in the new dynamic swiotlb code (Petr Tesarik) - fix dma_addressing_limited for systems with weird physical memory layouts (Jia He) * tag 'dma-mapping-6.7-2023-11-10' of git://git.infradead.org/users/hch/dma-mapping: swiotlb: fix out-of-bounds TLB allocations with CONFIG_SWIOTLB_DYNAMIC dma-mapping: fix dma_addressing_limited() if dma_range_map can't cover all system RAM dma-mapping: move dma_addressing_limited() out of line swiotlb: do not free decrypted pages if dynamic commit ead3b62a34d829d2df38187b93a18c22b289bd9c Merge: 826c484166f0f b36995b8609a5 Author: Linus Torvalds Date: Fri Nov 10 10:58:49 2023 -0800 Merge tag 'lsm-pr-20231109' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm Pull lsm updates from Paul Moore: "We've got two small patches to correct the default return value of two LSM hooks: security_vm_enough_memory_mm() and security_inode_getsecctx()" * tag 'lsm-pr-20231109' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm: lsm: fix default return value for inode_getsecctx lsm: fix default return value for vm_enough_memory commit 826c484166f0f74bd8fc09220f99dc937c9297cf Merge: e21165bfbc6c5 5a5409d90bd05 Author: Linus Torvalds Date: Fri Nov 10 10:23:53 2023 -0800 Merge tag '6.7-rc-smb3-server-part2' of git://git.samba.org/ksmbd Pull smb server fixes from Steve French: - slab out of bounds fix in ACL handling - fix malformed request oops - minor doc fix * tag '6.7-rc-smb3-server-part2' of git://git.samba.org/ksmbd: ksmbd: handle malformed smb1 message ksmbd: fix kernel-doc comment of ksmbd_vfs_kern_path_locked() ksmbd: fix slab out of bounds write in smb_inherit_dacl() commit e21165bfbc6c5d259466a7b2eccb66630e807bfb Merge: 56d428ae1c4e2 56d2e2cfa2131 Author: Linus Torvalds Date: Fri Nov 10 09:52:56 2023 -0800 Merge tag 'ceph-for-6.7-rc1' of https://github.com/ceph/ceph-client Pull ceph updates from Ilya Dryomov: - support for idmapped mounts in CephFS (Christian Brauner, Alexander Mikhalitsyn). The series was originally developed by Christian and later picked up and brought over the finish line by Alexander, who also contributed an enabler on the MDS side (separate owner_{u,g}id fields on the wire). The required exports for mnt_idmap_{get,put}() in VFS have been acked by Christian and received no objection from Christoph. - a churny change in CephFS logging to include cluster and client identifiers in log and debug messages (Xiubo Li). This would help in scenarios with dozens of CephFS mounts on the same node which are getting increasingly common, especially in the Kubernetes world. * tag 'ceph-for-6.7-rc1' of https://github.com/ceph/ceph-client: ceph: allow idmapped mounts ceph: allow idmapped atomic_open inode op ceph: allow idmapped set_acl inode op ceph: allow idmapped setattr inode op ceph: pass idmap to __ceph_setattr ceph: allow idmapped permission inode op ceph: allow idmapped getattr inode op ceph: pass an idmapping to mknod/symlink/mkdir ceph: add enable_unsafe_idmap module parameter ceph: handle idmapped mounts in create_request_message() ceph: stash idmapping in mdsc request fs: export mnt_idmap_get/mnt_idmap_put libceph, ceph: move mdsmap.h to fs/ceph ceph: print cluster fsid and client global_id in all debug logs ceph: rename _to_client() to _to_fs_client() ceph: pass the mdsc to several helpers libceph: add doutc and *_client debug macros support commit 56d428ae1c4e27fbe02cb554b2192cd66e4df05a Merge: 656d88c3b654c 457926b253200 Author: Linus Torvalds Date: Fri Nov 10 09:23:17 2023 -0800 Merge tag 'riscv-for-linus-6.7-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull more RISC-V updates from Palmer Dabbelt: - Support for handling misaligned accesses in S-mode - Probing for misaligned access support is now properly cached and handled in parallel - PTDUMP now reflects the SW reserved bits, as well as the PBMT and NAPOT extensions - Performance improvements for TLB flushing - Support for many new relocations in the module loader - Various bug fixes and cleanups * tag 'riscv-for-linus-6.7-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (51 commits) riscv: Optimize bitops with Zbb extension riscv: Rearrange hwcap.h and cpufeature.h drivers: perf: Do not broadcast to other cpus when starting a counter drivers: perf: Check find_first_bit() return value of: property: Add fw_devlink support for msi-parent RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs riscv: Fix set_memory_XX() and set_direct_map_XX() by splitting huge linear mappings riscv: Don't use PGD entries for the linear mapping RISC-V: Probe misaligned access speed in parallel RISC-V: Remove __init on unaligned_emulation_finish() RISC-V: Show accurate per-hart isa in /proc/cpuinfo RISC-V: Don't rely on positional structure initialization riscv: Add tests for riscv module loading riscv: Add remaining module relocations riscv: Avoid unaligned access when relocating modules riscv: split cache ops out of dma-noncoherent.c riscv: Improve flush_tlb_kernel_range() riscv: Make __flush_tlb_range() loop over pte instead of flushing the whole tlb riscv: Improve flush_tlb_range() for hugetlb pages riscv: Improve tlb_flush() ... commit 656d88c3b654c0ccc0ff63aa75101c6c9f0a5300 Merge: 89cdf9d556016 4b7d3ab445653 Author: Linus Torvalds Date: Fri Nov 10 09:19:46 2023 -0800 Merge tag 'mips_6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS updates from Thomas Bogendoerfer: - removed AR7 platform support - cleanups and fixes * tag 'mips_6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: AR7: remove platform watchdog: ar7_wdt: remove driver to prepare for platform removal vlynq: remove bus driver mtd: parsers: ar7: remove support serial: 8250: remove AR7 support arch: mips: remove ReiserFS from defconfig MIPS: lantiq: Remove unnecessary include of MIPS: lantiq: Fix pcibios_plat_dev_init() "no previous prototype" warning MIPS: KVM: Fix a build warning about variable set but not used MIPS: Remove dead code in relocate_new_kernel mips: dts: ralink: mt7621: rename to GnuBee GB-PC1 and GnuBee GB-PC2 mips: dts: ralink: mt7621: define each reset as an item mips: dts: ingenic: Remove unneeded probe-type properties MIPS: loongson32: Remove dma.h and nand.h commit 8384c0baf223e1c3bc7b1c711d80a4c6106d210e Author: Eymen Yigit Date: Fri Nov 10 18:07:15 2023 +0300 ALSA: hda/realtek: Enable Mute LED on HP 255 G8 This HP Notebook uses ALC236 codec with COEF 0x07 idx 1 controlling the mute LED. Enable already existing quirk for this device. Signed-off-by: Eymen Yigit Cc: Luka Guzenko Cc: Link: https://lore.kernel.org/r/20231110150715.5141-1-eymenyg01@gmail.com Signed-off-by: Takashi Iwai commit 4b21a669ca21ed8f24ef4530b2918be5730114de Author: Kailang Yang Date: Fri Nov 10 15:16:06 2023 +0800 ALSA: hda/realtek - Add Dell ALC295 to pin fall back table Add ALC295 to pin fall back table. Remove 5 pin quirks for Dell ALC295. ALC295 was only support MIC2 for external MIC function. ALC295 assigned model "ALC269_FIXUP_DELL1_MIC_NO_PRESENCE" for pin fall back table. It was assigned wrong model. So, let's remove it. Fixes: fbc571290d9f ("ALSA: hda/realtek - Fixed Headphone Mic can't record on Dell platform") Signed-off-by: Kailang Yang Cc: Link: https://lore.kernel.org/r/7c1998e873834df98d59bd7e0d08c72e@realtek.com Signed-off-by: Takashi Iwai commit 8473bfdcb5b1a32fd05629c4535ccacd73bc5567 Author: Christian König Date: Tue Oct 31 15:35:27 2023 +0100 drm/amdgpu: fix error handling in amdgpu_vm_init When clearing the root PD fails we need to properly release it again. Signed-off-by: Christian König Acked-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 256503071c2de2b5b5c20e06654aa9a44f13aa62 Author: Felix Kuehling Date: Tue Oct 31 13:30:00 2023 -0400 drm/amdgpu: Fix possible null pointer dereference mem = bo->tbo.resource may be NULL in amdgpu_vm_bo_update. Fixes: 180253782038 ("drm/ttm: stop allocating dummy resources during BO creation") Signed-off-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 037b98a2312e2587163de14afae8ae1b64b67dda Author: Alex Deucher Date: Wed Nov 8 09:40:44 2023 -0500 drm/amdgpu: move UVD and VCE sched entity init after sched init We need kernel scheduling entities to deal with handle clean up if apps are not cleaned up properly. With commit 56e449603f0ac5 ("drm/sched: Convert the GPU scheduler to variable number of run-queues") the scheduler entities have to be created after scheduler init, so change the ordering to fix this. v2: Leave logic in UVD and VCE code Fixes: 56e449603f0a ("drm/sched: Convert the GPU scheduler to variable number of run-queues") Reviewed-by: Christian König Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher Cc: ltuikov89@gmail.com commit 8ed79c409ecb216ee2b0ec334568a1104505c62a Author: Tim Huang Date: Thu Oct 19 15:50:43 2023 +0800 drm/amdgpu: move kfd_resume before the ip late init The kfd_resume needs to touch GC registers to enable the interrupts, it needs to be done before GFXOFF is enabled to ensure that the GFX is not off and GC registers can be touched. So move kfd_resume before the amdgpu_device_ip_late_init which enables the CGPG/GFXOFF. Signed-off-by: Tim Huang Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit e4c44b1a19625348fc004ce8c5f828d5d80d037e Author: Mario Limonciello Date: Thu Nov 9 11:23:46 2023 -0600 drm/amd: Explicitly check for GFXOFF to be enabled for s0ix If a user has disabled GFXOFF this may cause problems for the suspend sequence. Ensure that it is enabled in amdgpu_acpi_is_s0ix_active(). The system won't reach the deepest state but it also won't hang. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit aec3e2e23b08f188c22f36c4108467f80e980b15 Merge: 0b336ec076b97 0e8b9f258baed Author: Daniel Vetter Date: Fri Nov 10 16:54:41 2023 +0100 Merge tag 'drm-misc-fixes-2023-11-08' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-fixes for v6.7-rc1: qxl: - qxl memory leak fix. syncobj: - Fix waiting for DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE vc4: - Fix UAF in mock helpers Signed-off-by: Daniel Vetter From: Maarten Lankhorst [sima: Stitch together both changelogs from Maarten. Also because of branch history this contains a few more bugfixes which are already in v6.6, but I didn't feel like this justifies some backmerge since there wasn't any real conflict.] Link: https://patchwork.freedesktop.org/patch/msgid/bc8598ee-d427-4616-8ebd-64107ab9a2d8@linux.intel.com commit 0b336ec076b97642a8e740b0f01f6ad305b02742 Merge: 9ccde17d46554 9506fba463fcb Author: Daniel Vetter Date: Fri Nov 10 16:43:44 2023 +0100 Merge tag 'drm-intel-next-fixes-2023-11-08' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 fixes for v6.7-rc1: - Fix null dereference when perf interface is not available - Fix a -Wstringop-overflow warning - Fix a -Wformat-truncation warning in intel_tc_port_init - Flush WC GGTT only on required platforms - Fix MTL HBR3 rate support on C10 phy and eDP - Fix MTL notify_guc for multi-GT - Bump GLK CDCLK frequency when driving multiple pipes - Fix potential spectre vulnerability Signed-off-by: Daniel Vetter From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/878r78xrxd.fsf@intel.com commit fd2bd7c0539e28f267a84da8d68f9378511b50a7 Author: Steve French Date: Thu Jul 20 08:30:32 2023 -0500 cifs: update internal module version number for cifs.ko From 2.45 to 2.46 Signed-off-by: Steve French commit ee1d21794e55ab76505745d24101331552182002 Author: Shyam Prasad N Date: Fri Oct 13 11:40:09 2023 +0000 cifs: handle when server stops supporting multichannel When a server stops supporting multichannel, we will keep attempting reconnects to the secondary channels today. Avoid this by freeing extra channels when negotiate returns no multichannel support. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 705fc522fe9d58848c253ee0948567060f36e2a7 Author: Shyam Prasad N Date: Fri Oct 13 11:33:21 2023 +0000 cifs: handle when server starts supporting multichannel When the user mounts with multichannel option, but the server does not support it, there can be a time in future where it can be supported. With this change, such a case is handled. Signed-off-by: Shyam Prasad N commit 784e0e20b4c97c270b2892f677d3fad658e2c1d5 Author: Steve French Date: Fri Nov 10 01:24:16 2023 -0600 Missing field not being returned in ioctl CIFS_IOC_GET_MNT_INFO The tcon_flags field was always being set to zero in the information about the mount returned by the ioctl CIFS_IOC_GET_MNT_INFO instead of being set to the value of the Flags field in the tree connection structure as intended. Reviewed-by: Shyam Prasad N Signed-off-by: Steve French commit a406b8b424fa01f244c1aab02ba186258448c36b Author: Helge Deller Date: Fri Nov 10 16:13:15 2023 +0100 parisc: Prevent booting 64-bit kernels on PA1.x machines Bail out early with error message when trying to boot a 64-bit kernel on 32-bit machines. This fixes the previous commit to include the check for true 64-bit kernels as well. Signed-off-by: Helge Deller Fixes: 591d2108f3abc ("parisc: Add runtime check to prevent PA2.0 kernels on PA1.x machines") Cc: # v6.0+ commit bef4a48f4ef798c4feddf045d49e53c8a97d5e37 Author: Mark Hasemeyer Date: Tue Nov 7 14:47:43 2023 -0700 spi: Fix null dereference on suspend A race condition exists where a synchronous (noqueue) transfer can be active during a system suspend. This can cause a null pointer dereference exception to occur when the system resumes. Example order of events leading to the exception: 1. spi_sync() calls __spi_transfer_message_noqueue() which sets ctlr->cur_msg 2. Spi transfer begins via spi_transfer_one_message() 3. System is suspended interrupting the transfer context 4. System is resumed 6. spi_controller_resume() calls spi_start_queue() which resets cur_msg to NULL 7. Spi transfer context resumes and spi_finalize_current_message() is called which dereferences cur_msg (which is now NULL) Wait for synchronous transfers to complete before suspending by acquiring the bus mutex and setting/checking a suspend flag. Signed-off-by: Mark Hasemeyer Link: https://lore.kernel.org/r/20231107144743.v1.1.I7987f05f61901f567f7661763646cb7d7919b528@changeid Signed-off-by: Mark Brown Cc: stable@kernel.org commit 719639853d88071dfdfd8d9971eca9c283ff314c Author: Shigeru Yoshida Date: Thu Nov 9 00:44:20 2023 +0900 tty: Fix uninit-value access in ppp_sync_receive() KMSAN reported the following uninit-value access issue: ===================================================== BUG: KMSAN: uninit-value in ppp_sync_input drivers/net/ppp/ppp_synctty.c:690 [inline] BUG: KMSAN: uninit-value in ppp_sync_receive+0xdc9/0xe70 drivers/net/ppp/ppp_synctty.c:334 ppp_sync_input drivers/net/ppp/ppp_synctty.c:690 [inline] ppp_sync_receive+0xdc9/0xe70 drivers/net/ppp/ppp_synctty.c:334 tiocsti+0x328/0x450 drivers/tty/tty_io.c:2295 tty_ioctl+0x808/0x1920 drivers/tty/tty_io.c:2694 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0x211/0x400 fs/ioctl.c:857 __x64_sys_ioctl+0x97/0xe0 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Uninit was created at: __alloc_pages+0x75d/0xe80 mm/page_alloc.c:4591 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] __page_frag_cache_refill+0x9a/0x2c0 mm/page_alloc.c:4691 page_frag_alloc_align+0x91/0x5d0 mm/page_alloc.c:4722 page_frag_alloc include/linux/gfp.h:322 [inline] __netdev_alloc_skb+0x215/0x6d0 net/core/skbuff.c:728 netdev_alloc_skb include/linux/skbuff.h:3225 [inline] dev_alloc_skb include/linux/skbuff.h:3238 [inline] ppp_sync_input drivers/net/ppp/ppp_synctty.c:669 [inline] ppp_sync_receive+0x237/0xe70 drivers/net/ppp/ppp_synctty.c:334 tiocsti+0x328/0x450 drivers/tty/tty_io.c:2295 tty_ioctl+0x808/0x1920 drivers/tty/tty_io.c:2694 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0x211/0x400 fs/ioctl.c:857 __x64_sys_ioctl+0x97/0xe0 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b CPU: 0 PID: 12950 Comm: syz-executor.1 Not tainted 6.6.0-14500-g1c41041124bd #10 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc38 04/01/2014 ===================================================== ppp_sync_input() checks the first 2 bytes of the data are PPP_ALLSTATIONS and PPP_UI. However, if the data length is 1 and the first byte is PPP_ALLSTATIONS, an access to an uninitialized value occurs when checking PPP_UI. This patch resolves this issue by checking the data length. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Shigeru Yoshida Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit ce51e6153f7781bcde0f8bb4c81d6fd85ee422e6 Author: Masami Hiramatsu (Google) Date: Wed Nov 8 21:12:39 2023 +0900 tracing: fprobe-event: Fix to check tracepoint event and return Fix to check the tracepoint event is not valid with $retval. The commit 08c9306fc2e3 ("tracing/fprobe-event: Assume fprobe is a return event by $retval") introduced automatic return probe conversion with $retval. But since tracepoint event does not support return probe, $retval is not acceptable. Without this fix, ftracetest, tprobe_syntax_errors.tc fails; [22] Tracepoint probe event parser error log check [FAIL] ---- # tail 22-tprobe_syntax_errors.tc-log.mRKroL + ftrace_errlog_check trace_fprobe t kfree ^$retval dynamic_events + printf %s t kfree + wc -c + pos=8 + printf %s t kfree ^$retval + tr -d ^ + command=t kfree $retval + echo Test command: t kfree $retval Test command: t kfree $retval + echo ---- So 't kfree $retval' should fail (tracepoint doesn't support return probe) but passed it. Link: https://lore.kernel.org/all/169944555933.45057.12831706585287704173.stgit@devnote2/ Fixes: 08c9306fc2e3 ("tracing/fprobe-event: Assume fprobe is a return event by $retval") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) commit 18f039428c7df183b09c69ebf10ffd4e521035d2 Author: Eric Dumazet Date: Thu Nov 9 15:22:41 2023 +0000 ipvlan: add ipvlan_route_v6_outbound() helper Inspired by syzbot reports using a stack of multiple ipvlan devices. Reduce stack size needed in ipvlan_process_v6_outbound() by moving the flowi6 struct used for the route lookup in an non inlined helper. ipvlan_route_v6_outbound() needs 120 bytes on the stack, immediately reclaimed. Also make sure ipvlan_process_v4_outbound() is not inlined. We might also have to lower MAX_NEST_DEV, because only syzbot uses setups with more than four stacked devices. BUG: TASK stack guard page was hit at ffffc9000e803ff8 (stack is ffffc9000e804000..ffffc9000e808000) stack guard page: 0000 [#1] SMP KASAN CPU: 0 PID: 13442 Comm: syz-executor.4 Not tainted 6.1.52-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 RIP: 0010:kasan_check_range+0x4/0x2a0 mm/kasan/generic.c:188 Code: 48 01 c6 48 89 c7 e8 db 4e c1 03 31 c0 5d c3 cc 0f 0b eb 02 0f 0b b8 ea ff ff ff 5d c3 cc 00 00 cc cc 00 00 cc cc 55 48 89 e5 <41> 57 41 56 41 55 41 54 53 b0 01 48 85 f6 0f 84 a4 01 00 00 48 89 RSP: 0018:ffffc9000e804000 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff817e5bf2 RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff887c6568 RBP: ffffc9000e804000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff92001d0080c R13: dffffc0000000000 R14: ffffffff87e6b100 R15: 0000000000000000 FS: 00007fd0c55826c0(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffc9000e803ff8 CR3: 0000000170ef7000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <#DF> [] __kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31 [] instrument_atomic_read include/linux/instrumented.h:72 [inline] [] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] [] cpumask_test_cpu include/linux/cpumask.h:506 [inline] [] cpu_online include/linux/cpumask.h:1092 [inline] [] trace_lock_acquire include/trace/events/lock.h:24 [inline] [] lock_acquire+0xe2/0x590 kernel/locking/lockdep.c:5632 [] rcu_lock_acquire+0x2e/0x40 include/linux/rcupdate.h:306 [] rcu_read_lock include/linux/rcupdate.h:747 [inline] [] ip6_pol_route+0x15d/0x1440 net/ipv6/route.c:2221 [] ip6_pol_route_output+0x50/0x80 net/ipv6/route.c:2606 [] pol_lookup_func include/net/ip6_fib.h:584 [inline] [] fib6_rule_lookup+0x265/0x620 net/ipv6/fib6_rules.c:116 [] ip6_route_output_flags_noref+0x2d9/0x3a0 net/ipv6/route.c:2638 [] ip6_route_output_flags+0xca/0x340 net/ipv6/route.c:2651 [] ip6_route_output include/net/ip6_route.h:100 [inline] [] ipvlan_process_v6_outbound drivers/net/ipvlan/ipvlan_core.c:473 [inline] [] ipvlan_process_outbound drivers/net/ipvlan/ipvlan_core.c:529 [inline] [] ipvlan_xmit_mode_l3 drivers/net/ipvlan/ipvlan_core.c:602 [inline] [] ipvlan_queue_xmit+0xc33/0x1be0 drivers/net/ipvlan/ipvlan_core.c:677 [] ipvlan_start_xmit+0x49/0x100 drivers/net/ipvlan/ipvlan_main.c:229 [] netdev_start_xmit include/linux/netdevice.h:4966 [inline] [] xmit_one net/core/dev.c:3644 [inline] [] dev_hard_start_xmit+0x320/0x980 net/core/dev.c:3660 [] __dev_queue_xmit+0x16b2/0x3370 net/core/dev.c:4324 [] dev_queue_xmit include/linux/netdevice.h:3067 [inline] [] neigh_hh_output include/net/neighbour.h:529 [inline] [] neigh_output include/net/neighbour.h:543 [inline] [] ip6_finish_output2+0x160d/0x1ae0 net/ipv6/ip6_output.c:139 [] __ip6_finish_output net/ipv6/ip6_output.c:200 [inline] [] ip6_finish_output+0x6c6/0xb10 net/ipv6/ip6_output.c:211 [] NF_HOOK_COND include/linux/netfilter.h:298 [inline] [] ip6_output+0x2bc/0x3d0 net/ipv6/ip6_output.c:232 [] dst_output include/net/dst.h:444 [inline] [] ip6_local_out+0x10f/0x140 net/ipv6/output_core.c:161 [] ipvlan_process_v6_outbound drivers/net/ipvlan/ipvlan_core.c:483 [inline] [] ipvlan_process_outbound drivers/net/ipvlan/ipvlan_core.c:529 [inline] [] ipvlan_xmit_mode_l3 drivers/net/ipvlan/ipvlan_core.c:602 [inline] [] ipvlan_queue_xmit+0x1174/0x1be0 drivers/net/ipvlan/ipvlan_core.c:677 [] ipvlan_start_xmit+0x49/0x100 drivers/net/ipvlan/ipvlan_main.c:229 [] netdev_start_xmit include/linux/netdevice.h:4966 [inline] [] xmit_one net/core/dev.c:3644 [inline] [] dev_hard_start_xmit+0x320/0x980 net/core/dev.c:3660 [] __dev_queue_xmit+0x16b2/0x3370 net/core/dev.c:4324 [] dev_queue_xmit include/linux/netdevice.h:3067 [inline] [] neigh_hh_output include/net/neighbour.h:529 [inline] [] neigh_output include/net/neighbour.h:543 [inline] [] ip6_finish_output2+0x160d/0x1ae0 net/ipv6/ip6_output.c:139 [] __ip6_finish_output net/ipv6/ip6_output.c:200 [inline] [] ip6_finish_output+0x6c6/0xb10 net/ipv6/ip6_output.c:211 [] NF_HOOK_COND include/linux/netfilter.h:298 [inline] [] ip6_output+0x2bc/0x3d0 net/ipv6/ip6_output.c:232 [] dst_output include/net/dst.h:444 [inline] [] ip6_local_out+0x10f/0x140 net/ipv6/output_core.c:161 [] ipvlan_process_v6_outbound drivers/net/ipvlan/ipvlan_core.c:483 [inline] [] ipvlan_process_outbound drivers/net/ipvlan/ipvlan_core.c:529 [inline] [] ipvlan_xmit_mode_l3 drivers/net/ipvlan/ipvlan_core.c:602 [inline] [] ipvlan_queue_xmit+0x1174/0x1be0 drivers/net/ipvlan/ipvlan_core.c:677 [] ipvlan_start_xmit+0x49/0x100 drivers/net/ipvlan/ipvlan_main.c:229 [] netdev_start_xmit include/linux/netdevice.h:4966 [inline] [] xmit_one net/core/dev.c:3644 [inline] [] dev_hard_start_xmit+0x320/0x980 net/core/dev.c:3660 [] __dev_queue_xmit+0x16b2/0x3370 net/core/dev.c:4324 [] dev_queue_xmit include/linux/netdevice.h:3067 [inline] [] neigh_hh_output include/net/neighbour.h:529 [inline] [] neigh_output include/net/neighbour.h:543 [inline] [] ip6_finish_output2+0x160d/0x1ae0 net/ipv6/ip6_output.c:139 [] __ip6_finish_output net/ipv6/ip6_output.c:200 [inline] [] ip6_finish_output+0x6c6/0xb10 net/ipv6/ip6_output.c:211 [] NF_HOOK_COND include/linux/netfilter.h:298 [inline] [] ip6_output+0x2bc/0x3d0 net/ipv6/ip6_output.c:232 [] dst_output include/net/dst.h:444 [inline] [] ip6_local_out+0x10f/0x140 net/ipv6/output_core.c:161 [] ipvlan_process_v6_outbound drivers/net/ipvlan/ipvlan_core.c:483 [inline] [] ipvlan_process_outbound drivers/net/ipvlan/ipvlan_core.c:529 [inline] [] ipvlan_xmit_mode_l3 drivers/net/ipvlan/ipvlan_core.c:602 [inline] [] ipvlan_queue_xmit+0x1174/0x1be0 drivers/net/ipvlan/ipvlan_core.c:677 [] ipvlan_start_xmit+0x49/0x100 drivers/net/ipvlan/ipvlan_main.c:229 [] netdev_start_xmit include/linux/netdevice.h:4966 [inline] [] xmit_one net/core/dev.c:3644 [inline] [] dev_hard_start_xmit+0x320/0x980 net/core/dev.c:3660 [] __dev_queue_xmit+0x16b2/0x3370 net/core/dev.c:4324 [] dev_queue_xmit include/linux/netdevice.h:3067 [inline] [] neigh_hh_output include/net/neighbour.h:529 [inline] [] neigh_output include/net/neighbour.h:543 [inline] [] ip6_finish_output2+0x160d/0x1ae0 net/ipv6/ip6_output.c:139 [] __ip6_finish_output net/ipv6/ip6_output.c:200 [inline] [] ip6_finish_output+0x6c6/0xb10 net/ipv6/ip6_output.c:211 [] NF_HOOK_COND include/linux/netfilter.h:298 [inline] [] ip6_output+0x2bc/0x3d0 net/ipv6/ip6_output.c:232 [] dst_output include/net/dst.h:444 [inline] [] ip6_local_out+0x10f/0x140 net/ipv6/output_core.c:161 [] ipvlan_process_v6_outbound drivers/net/ipvlan/ipvlan_core.c:483 [inline] [] ipvlan_process_outbound drivers/net/ipvlan/ipvlan_core.c:529 [inline] [] ipvlan_xmit_mode_l3 drivers/net/ipvlan/ipvlan_core.c:602 [inline] [] ipvlan_queue_xmit+0x1174/0x1be0 drivers/net/ipvlan/ipvlan_core.c:677 [] ipvlan_start_xmit+0x49/0x100 drivers/net/ipvlan/ipvlan_main.c:229 [] netdev_start_xmit include/linux/netdevice.h:4966 [inline] [] xmit_one net/core/dev.c:3644 [inline] [] dev_hard_start_xmit+0x320/0x980 net/core/dev.c:3660 [] __dev_queue_xmit+0x16b2/0x3370 net/core/dev.c:4324 [] dev_queue_xmit include/linux/netdevice.h:3067 [inline] [] neigh_resolve_output+0x64e/0x750 net/core/neighbour.c:1560 [] neigh_output include/net/neighbour.h:545 [inline] [] ip6_finish_output2+0x1643/0x1ae0 net/ipv6/ip6_output.c:139 [] __ip6_finish_output net/ipv6/ip6_output.c:200 [inline] [] ip6_finish_output+0x6c6/0xb10 net/ipv6/ip6_output.c:211 [] NF_HOOK_COND include/linux/netfilter.h:298 [inline] [] ip6_output+0x2bc/0x3d0 net/ipv6/ip6_output.c:232 [] dst_output include/net/dst.h:444 [inline] [] NF_HOOK include/linux/netfilter.h:309 [inline] [] ip6_xmit+0x11a4/0x1b20 net/ipv6/ip6_output.c:352 [] sctp_v6_xmit+0x9ae/0x1230 net/sctp/ipv6.c:250 [] sctp_packet_transmit+0x25de/0x2bc0 net/sctp/output.c:653 [] sctp_packet_singleton+0x202/0x310 net/sctp/outqueue.c:783 [] sctp_outq_flush_ctrl net/sctp/outqueue.c:914 [inline] [] sctp_outq_flush+0x661/0x3d40 net/sctp/outqueue.c:1212 [] sctp_outq_uncork+0x79/0xb0 net/sctp/outqueue.c:764 [] sctp_side_effects net/sctp/sm_sideeffect.c:1199 [inline] [] sctp_do_sm+0x55c0/0x5c30 net/sctp/sm_sideeffect.c:1170 [] sctp_primitive_ASSOCIATE+0x97/0xc0 net/sctp/primitive.c:73 [] sctp_sendmsg_to_asoc+0xf62/0x17b0 net/sctp/socket.c:1839 [] sctp_sendmsg+0x212e/0x33b0 net/sctp/socket.c:2029 [] inet_sendmsg+0x149/0x310 net/ipv4/af_inet.c:849 [] sock_sendmsg_nosec net/socket.c:716 [inline] [] sock_sendmsg net/socket.c:736 [inline] [] ____sys_sendmsg+0x572/0x8c0 net/socket.c:2504 [] ___sys_sendmsg net/socket.c:2558 [inline] [] __sys_sendmsg+0x271/0x360 net/socket.c:2587 [] __do_sys_sendmsg net/socket.c:2596 [inline] [] __se_sys_sendmsg net/socket.c:2594 [inline] [] __x64_sys_sendmsg+0x7f/0x90 net/socket.c:2594 [] do_syscall_x64 arch/x86/entry/common.c:51 [inline] [] do_syscall_64+0x53/0x80 arch/x86/entry/common.c:84 [] entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Mahesh Bandewar Cc: Willem de Bruijn Reviewed-by: Willem de Bruijn Signed-off-by: David S. Miller commit abc28463c81853e4fdf8d009f71b2a3ce62a6f40 Author: Arnd Bergmann Date: Fri Nov 10 19:59:05 2023 +0900 kprobes: unify kprobes_exceptions_nofify() prototypes Most architectures that support kprobes declare this function in their own asm/kprobes.h header and provide an override, but some are missing the prototype, which causes a warning for the __weak stub implementation: kernel/kprobes.c:1865:12: error: no previous prototype for 'kprobe_exceptions_notify' [-Werror=missing-prototypes] 1865 | int __weak kprobe_exceptions_notify(struct notifier_block *self, Move the prototype into linux/kprobes.h so it is visible to all the definitions. Link: https://lore.kernel.org/all/20231108125843.3806765-4-arnd@kernel.org/ Acked-by: Masami Hiramatsu (Google) Signed-off-by: Arnd Bergmann Signed-off-by: Masami Hiramatsu (Google) commit 3afe73372966d4d8b40922d7229c8ecb1c2ca287 Author: wuqiang.matt Date: Fri Nov 10 19:59:04 2023 +0900 lib: test_objpool: make global variables static Kernel test robot reported build warnings that structures g_ot_sync_ops, g_ot_async_ops and g_testcases should be static. These definitions are only used in test_objpool.c, so make them static Link: https://lore.kernel.org/all/20231108012248.313574-1-wuqiang.matt@bytedance.com/ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311071229.WGrWUjM1-lkp@intel.com/ Signed-off-by: wuqiang.matt Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit b2a866975f6cd5859c746f1da39c8f5736c8def2 Author: Masami Hiramatsu (Google) Date: Fri Nov 10 19:59:03 2023 +0900 Documentation: tracing: Add a note about argument and retval access Add a note about the argument and return value accecss will be best effort. Depending on the type, it will be passed via stack or a pair of the registers, but $argN and $retval only support the single register access. Link: https://lore.kernel.org/all/169556269377.146934.14829235476649685954.stgit@devnote2/ Suggested-by: Alexei Starovoitov Signed-off-by: Masami Hiramatsu (Google) commit cbe9e68e1e0f965fd3b1caf975eb29083c65e6b0 Author: Ravi Gunasekaran Date: Fri Nov 10 14:57:49 2023 +0530 MAINTAINERS: net: Update reviewers for TI's Ethernet drivers Grygorii is no longer associated with TI and messages addressed to him bounce. Add Siddharth, Roger and myself as reviewers. Signed-off-by: Ravi Gunasekaran Signed-off-by: David S. Miller commit 871019b22d1bcc9fab2d1feba1b9a564acbb6e99 Author: Stanislav Fomichev Date: Wed Nov 8 13:13:25 2023 -0800 net: set SOCK_RCU_FREE before inserting socket into hashtable We've started to see the following kernel traces: WARNING: CPU: 83 PID: 0 at net/core/filter.c:6641 sk_lookup+0x1bd/0x1d0 Call Trace: __bpf_skc_lookup+0x10d/0x120 bpf_sk_lookup+0x48/0xd0 bpf_sk_lookup_tcp+0x19/0x20 bpf_prog_+0x37c/0x16a3 cls_bpf_classify+0x205/0x2e0 tcf_classify+0x92/0x160 __netif_receive_skb_core+0xe52/0xf10 __netif_receive_skb_list_core+0x96/0x2b0 napi_complete_done+0x7b5/0xb70 _poll+0x94/0xb0 net_rx_action+0x163/0x1d70 __do_softirq+0xdc/0x32e asm_call_irq_on_stack+0x12/0x20 do_softirq_own_stack+0x36/0x50 do_softirq+0x44/0x70 __inet_hash can race with lockless (rcu) readers on the other cpus: __inet_hash __sk_nulls_add_node_rcu <- (bpf triggers here) sock_set_flag(SOCK_RCU_FREE) Let's move the SOCK_RCU_FREE part up a bit, before we are inserting the socket into hashtables. Note, that the race is really harmless; the bpf callers are handling this situation (where listener socket doesn't have SOCK_RCU_FREE set) correctly, so the only annoyance is a WARN_ONCE. More details from Eric regarding SOCK_RCU_FREE timeline: Commit 3b24d854cb35 ("tcp/dccp: do not touch listener sk_refcnt under synflood") added SOCK_RCU_FREE. At that time, the precise location of sock_set_flag(sk, SOCK_RCU_FREE) did not matter, because the thread calling __inet_hash() owns a reference on sk. SOCK_RCU_FREE was only tested at dismantle time. Commit 6acc9b432e67 ("bpf: Add helper to retrieve socket in BPF") started checking SOCK_RCU_FREE _after_ the lookup to infer whether the refcount has been taken care of. Fixes: 6acc9b432e67 ("bpf: Add helper to retrieve socket in BPF") Reviewed-by: Eric Dumazet Signed-off-by: Stanislav Fomichev Reviewed-by: Kuniyuki Iwashima Signed-off-by: David S. Miller commit 8a4f030dbced6fc255cbe67b2d0a129947e18493 Author: Yuran Pereira Date: Wed Nov 8 02:18:36 2023 +0530 ptp: Fixes a null pointer dereference in ptp_ioctl Syzkaller found a null pointer dereference in ptp_ioctl originating from the lack of a null check for tsevq. ``` general protection fault, probably for non-canonical address 0xdffffc000000020b: 0000 [#1] PREEMPT SMP KASAN KASAN: probably user-memory-access in range [0x0000000000001058-0x000000000000105f] CPU: 0 PID: 5053 Comm: syz-executor353 Not tainted 6.6.0-syzkaller-10396-g4652b8e4f3ff #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 RIP: 0010:ptp_ioctl+0xcb7/0x1d10 drivers/ptp/ptp_chardev.c:476 ... Call Trace: posix_clock_ioctl+0xf8/0x160 kernel/time/posix-clock.c:86 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b ``` This patch fixes the issue by adding a check for tsevq and ensuring ptp_ioctl returns with an error if tsevq is null. Reported-by: syzbot+8a78ecea7ac1a2ea26e5@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=8a78ecea7ac1a2ea26e5 Fixes: c5a445b1e934 ("ptp: support event queue reader channel masks") Signed-off-by: Yuran Pereira Reviewed-by: Przemek Kitszel Signed-off-by: David S. Miller commit d27abbfd4888d79dd24baf50e774631046ac4732 Author: Dan Carpenter Date: Wed Oct 25 14:58:18 2023 +0300 pwm: Fix double shift bug These enums are passed to set/test_bit(). The set/test_bit() functions take a bit number instead of a shifted value. Passing a shifted value is a double shift bug like doing BIT(BIT(1)). The double shift bug doesn't cause a problem here because we are only checking 0 and 1 but if the value was 5 or above then it can lead to a buffer overflow. Signed-off-by: Dan Carpenter Reviewed-by: Uwe Kleine-König Reviewed-by: Sam Protsenko Signed-off-by: Thierry Reding commit a2da597ff6f5504fc99163de4f15b7f3a129894e Author: Dan Carpenter Date: Wed Oct 25 14:57:34 2023 +0300 pwm: samsung: Fix a bit test in pwm_samsung_resume() The PWMF_REQUESTED enum is supposed to be used with test_bit() and not used as in a bitwise AND. In this specific code the flag will never be set so the function is effectively a no-op. Fixes: e3fe982b2e4e ("pwm: samsung: Put per-channel data into driver data") Signed-off-by: Dan Carpenter Reviewed-by: Uwe Kleine-König Reviewed-by: Sam Protsenko Signed-off-by: Thierry Reding commit a5035c81847430dfa3482807b07325f29e9e8c09 Author: Arnd Bergmann Date: Wed Nov 8 13:58:42 2023 +0100 fbdev: fsl-diu-fb: mark wr_reg_wa() static wr_reg_wa() is not an appropriate name for a global function, and doesn't need to be global anyway, so mark it static and avoid the warning: drivers/video/fbdev/fsl-diu-fb.c:493:6: error: no previous prototype for 'wr_reg_wa' [-Werror=missing-prototypes] Fixes: 0d9dab39fbbe ("powerpc/5121: fsl-diu-fb: fix issue with re-enabling DIU area descriptor") Signed-off-by: Arnd Bergmann Signed-off-by: Helge Deller commit dce217780270300db7931d0fd73796aa64fea237 Author: Uwe Kleine-König Date: Thu Nov 9 23:01:54 2023 +0100 fbdev: amifb: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Signed-off-by: Helge Deller commit 67e1ab5bb58a787809772eba14e7e758c765e2fd Author: Uwe Kleine-König Date: Thu Nov 9 23:01:53 2023 +0100 fbdev: amifb: Mark driver struct with __refdata to prevent section mismatch warning As described in the added code comment, a reference to .exit.text is ok for drivers registered via module_platform_driver_probe(). Make this explicit to prevent a section mismatch warning. Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Signed-off-by: Helge Deller commit de4eceab578ead12a71e5b5588a57e142bbe8ceb Author: Steve French Date: Thu Nov 9 15:28:12 2023 -0600 smb3: allow dumping session and tcon id to improve stats analysis and debugging When multiple mounts are to the same share from the same client it was not possible to determine which section of /proc/fs/cifs/Stats (and DebugData) correspond to that mount. In some recent examples this turned out to be a significant problem when trying to analyze performance data - since there are many cases where unless we know the tree id and session id we can't figure out which stats (e.g. number of SMB3.1.1 requests by type, the total time they take, which is slowest, how many fail etc.) apply to which mount. The only existing loosely related ioctl CIFS_IOC_GET_MNT_INFO does not return the information needed to uniquely identify which tcon is which mount although it does return various flags and device info. Add a cifs.ko ioctl CIFS_IOC_GET_TCON_INFO (0x800ccf0c) to return tid, session id, tree connect count. Cc: stable@vger.kernel.org Reviewed-by: Shyam Prasad N Signed-off-by: Steve French commit 8e8e46a6036f5e0eefdbf6e0ed43b3581d488aa7 Author: Arnd Bergmann Date: Wed Nov 8 13:58:26 2023 +0100 parport: gsc: mark init function static This is only used locally, so mark it static to avoid a warning: drivers/parport/parport_gsc.c:395:5: error: no previous prototype for 'parport_gsc_init' [-Werror=missing-prototypes] Acked-by: Helge Deller Acked-by: Sudip Mukherjee Signed-off-by: Arnd Bergmann Signed-off-by: Helge Deller commit e2e57d637aa5da0a2f49d83ad44e9febf95df7b4 Author: Andrii Nakryiko Date: Thu Nov 9 22:14:11 2023 -0800 selftests/bpf: add more test cases for check_cfg() Add a few more simple cases to validate proper privileged vs unprivileged loop detection behavior. conditional_loop2 is the one reported by Hao Sun that triggered this set of fixes. Acked-by: Eduard Zingerman Suggested-by: Hao Sun Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20231110061412.2995786-2-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 10e14e9652bf9e8104151bfd9200433083deae3d Author: Andrii Nakryiko Date: Thu Nov 9 22:14:10 2023 -0800 bpf: fix control-flow graph checking in privileged mode When BPF program is verified in privileged mode, BPF verifier allows bounded loops. This means that from CFG point of view there are definitely some back-edges. Original commit adjusted check_cfg() logic to not detect back-edges in control flow graph if they are resulting from conditional jumps, which the idea that subsequent full BPF verification process will determine whether such loops are bounded or not, and either accept or reject the BPF program. At least that's my reading of the intent. Unfortunately, the implementation of this idea doesn't work correctly in all possible situations. Conditional jump might not result in immediate back-edge, but just a few unconditional instructions later we can arrive at back-edge. In such situations check_cfg() would reject BPF program even in privileged mode, despite it might be bounded loop. Next patch adds one simple program demonstrating such scenario. To keep things simple, instead of trying to detect back edges in privileged mode, just assume every back edge is valid and let subsequent BPF verification prove or reject bounded loops. Note a few test changes. For unknown reason, we have a few tests that are specified to detect a back-edge in a privileged mode, but looking at their code it seems like the right outcome is passing check_cfg() and letting subsequent verification to make a decision about bounded or not bounded looping. Bounded recursion case is also interesting. The example should pass, as recursion is limited to just a few levels and so we never reach maximum number of nested frames and never exhaust maximum stack depth. But the way that max stack depth logic works today it falsely detects this as exceeding max nested frame count. This patch series doesn't attempt to fix this orthogonal problem, so we just adjust expected verifier failure. Suggested-by: Alexei Starovoitov Fixes: 2589726d12a1 ("bpf: introduce bounded loops") Reported-by: Hao Sun Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20231110061412.2995786-1-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit cca202a5e59578247cd7f0496056884f5c9cc338 Author: Arnd Bergmann Date: Wed Nov 8 15:58:13 2023 +0100 fbdev: hyperv_fb: fix uninitialized local variable use When CONFIG_SYSFB is disabled, the hyperv_fb driver can now run into undefined behavior on a gen2 VM, as indicated by this smatch warning: drivers/video/fbdev/hyperv_fb.c:1077 hvfb_getmem() error: uninitialized symbol 'base'. drivers/video/fbdev/hyperv_fb.c:1077 hvfb_getmem() error: uninitialized symbol 'size'. Since there is no way to know the actual framebuffer in this configuration, just return an allocation failure here, which should avoid the build warning and the undefined behavior. Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202311070802.YCpvehaz-lkp@intel.com/ Fixes: a07b50d80ab6 ("hyperv: avoid dependency on screen_info") Signed-off-by: Arnd Bergmann Signed-off-by: Helge Deller commit 2e2389ca5d7efd2f029b138d78e38200d5ba125b Author: Uwe Kleine-König Date: Tue Nov 7 10:18:03 2023 +0100 fbdev: omapfb/tpd12s015: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit a23f29d057d034c77bd6689a5c328a6933255bf4 Author: Uwe Kleine-König Date: Tue Nov 7 10:18:02 2023 +0100 fbdev: omapfb/tfp410: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit b0d61e8c04965373b74d719a460153cb700dab80 Author: Uwe Kleine-König Date: Tue Nov 7 10:18:01 2023 +0100 fbdev: omapfb/sharp-ls037v7dw01: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit fe83fc52db06aa0632e53b3b27184e26971b555d Author: Uwe Kleine-König Date: Tue Nov 7 10:18:00 2023 +0100 fbdev: omapfb/opa362: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit 34948a36a4bbf583bf39b5c9783aa9e872c7910d Author: Uwe Kleine-König Date: Tue Nov 7 10:17:59 2023 +0100 fbdev: omapfb/hdmi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit ebfb1334cf430ef36059c5bed35e9cfbab23ff11 Author: Uwe Kleine-König Date: Tue Nov 7 10:17:58 2023 +0100 fbdev: omapfb/dvi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit da21ff3954ed31e04f8280b3ef573484c38e01ad Author: Uwe Kleine-König Date: Tue Nov 7 10:17:57 2023 +0100 fbdev: omapfb/dsi-cm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit d5d8b9df6b6d72841f827327b37de2b0b7af88f2 Author: Uwe Kleine-König Date: Tue Nov 7 10:17:56 2023 +0100 fbdev: omapfb/dpi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit 26553eb8df2dbfbc075619abd53618efc8c5586a Author: Uwe Kleine-König Date: Tue Nov 7 10:17:55 2023 +0100 fbdev: omapfb/analog-tv: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit 42a0148ab7f85f4e102630e4cdbb5d336056aedf Author: Uwe Kleine-König Date: Tue Nov 7 10:17:54 2023 +0100 fbdev: atmel_lcdfb: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit 3e9ec97706fd8bc06ed41ff85ff168537618879f Author: Uwe Kleine-König Date: Tue Nov 7 10:17:52 2023 +0100 fbdev: omapfb/tpd12s015: Don't put .remove() in .exit.text and drop suppress_bind_attrs On today's platforms the memory savings of putting the remove function in .exit isn't that relevant any more. It only matters for built-in drivers and typically saves a few 100k. The downside is that the driver cannot be unbound at runtime which is ancient and also slightly complicates testing. Also it requires to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/omap2/omapfb/displays/encoder-tpd12s015: section mismatch in reference: tpd_driver+0x4 (section: .data) -> tpd_remove (section: .exit.text) To simplify matters, move the remove callback to .text and drop .suppress_bind_attrs = true. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit 20bcc282d7ccf78bd2dd24a518210baf8763ffaa Author: Uwe Kleine-König Date: Tue Nov 7 10:17:51 2023 +0100 fbdev: omapfb/tfp410: Don't put .remove() in .exit.text and drop suppress_bind_attrs On today's platforms the memory savings of putting the remove function in .exit isn't that relevant any more. It only matters for built-in drivers and typically saves a few 100k. The downside is that the driver cannot be unbound at runtime which is ancient and also slightly complicates testing. Also it requires to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410: section mismatch in reference: tfp410_driver+0x4 (section: .data) -> tfp410_remove (section: .exit.text) To simplify matters, move the remove callback to .text and drop .suppress_bind_attrs = true. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit 6a06fc772fa53a436e50aef44f4163253dbb089f Author: Uwe Kleine-König Date: Tue Nov 7 10:17:50 2023 +0100 fbdev: omapfb/sharp-ls037v7dw01: Don't put .remove() in .exit.text and drop suppress_bind_attrs On today's platforms the memory savings of putting the remove function in .exit isn't that relevant any more. It only matters for built-in drivers and typically saves a few 100k. The downside is that the driver cannot be unbound at runtime which is ancient and also slightly complicates testing. Also it requires to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01: section mismatch in reference: sharp_ls_driver+0x4 (section: .data) -> sharp_ls_remove (section: .exit.text) To simplify matters, move the remove callback to .text and drop .suppress_bind_attrs = true. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit 7462e46054c5ce07639aabec5b605d6a481368b1 Author: Uwe Kleine-König Date: Tue Nov 7 10:17:49 2023 +0100 fbdev: omapfb/opa362: Don't put .remove() in .exit.text and drop suppress_bind_attrs On today's platforms the memory savings of putting the remove function in .exit isn't that relevant any more. It only matters for built-in drivers and typically saves a few 100k. The downside is that the driver cannot be unbound at runtime which is ancient and also slightly complicates testing. Also it requires to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/omap2/omapfb/displays/encoder-tfp410: section mismatch in reference: tfp410_driver+0x4 (section: .data) -> tfp410_remove (section: .exit.text) To simplify matters, move the remove callback to .text and drop .suppress_bind_attrs = true. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit 1fc9ea058089f27a5f4c5f04927daed1bb7668d0 Author: Uwe Kleine-König Date: Tue Nov 7 10:17:48 2023 +0100 fbdev: omapfb/hdmi: Don't put .remove() in .exit.text and drop suppress_bind_attrs On today's platforms the memory savings of putting the remove function in .exit isn't that relevant any more. It only matters for built-in drivers and typically saves a few 100k. The downside is that the driver cannot be unbound at runtime which is ancient and also slightly complicates testing. Also it requires to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/omap2/omapfb/displays/connector-hdmi: section mismatch in reference: hdmi_connector_driver+0x4 (section: .data) -> hdmic_remove (section: .exit.text) To simplify matters, move the remove callback to .text and drop .suppress_bind_attrs = true. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit f004d91130595a01203272be12a8764788b68109 Author: Uwe Kleine-König Date: Tue Nov 7 10:17:47 2023 +0100 fbdev: omapfb/dvi: Don't put .remove() in .exit.text and drop suppress_bind_attrs On today's platforms the memory savings of putting the remove function in .exit isn't that relevant any more. It only matters for built-in drivers and typically saves a few 100k. The downside is that the driver cannot be unbound at runtime which is ancient and also slightly complicates testing. Also it requires to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/omap2/omapfb/displays/connector-dvi: section mismatch in reference: dvi_connector_driver+0x4 (section: .data) -> dvic_remove (section: .exit.text) To simplify matters, move the remove callback to .text and drop .suppress_bind_attrs = true. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit b02e6f70f8d87d8cfc8306fcb38120bf58d5e6cb Author: Uwe Kleine-König Date: Tue Nov 7 10:17:46 2023 +0100 fbdev: omapfb/dsi-cm: Don't put .remove() in .exit.text and drop suppress_bind_attrs On today's platforms the memory savings of putting the remove function in .exit isn't that relevant any more. It only matters for built-in drivers and typically saves a few 100k. The downside is that the driver cannot be unbound at runtime which is ancient and also slightly complicates testing. Also it requires to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm: section mismatch in reference: dsicm_driver+0x4 (section: .data) -> dsicm_remove (section: .exit.text) To simplify matters, move the remove callback to .text and drop .suppress_bind_attrs = true. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit bfaee69738bcae5c3dd0aaccae4f55dc381a9b36 Author: Uwe Kleine-König Date: Tue Nov 7 10:17:45 2023 +0100 fbdev: omapfb/dpi: Don't put .remove() in .exit.text and drop suppress_bind_attrs On today's platforms the memory savings of putting the remove function in .exit isn't that relevant any more. It only matters for built-in drivers and typically saves a few 100k. The downside is that the driver cannot be unbound at runtime which is ancient and also slightly complicates testing. Also it requires to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/omap2/omapfb/displays/panel-dpi: section mismatch in reference: panel_dpi_driver+0x4 (section: .data) -> panel_dpi_remove (section: .exit.text) To simplify matters, move the remove callback to .text and drop .suppress_bind_attrs = true. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit 7fbbc0868ca473f9ec97754acb21ae0e4ddb3d89 Author: Uwe Kleine-König Date: Tue Nov 7 10:17:44 2023 +0100 fbdev: omapfb/analog-tv: Don't put .remove() in .exit.text and drop suppress_bind_attrs On today's platforms the memory savings of putting the remove function in .exit isn't that relevant any more. It only matters for built-in drivers and typically saves a few 100k. The downside is that the driver cannot be unbound at runtime which is ancient and also slightly complicates testing. Also it requires to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv: section mismatch in reference: tvc_connector_driver+0x4 (section: .data) -> tvc_remove (section: .exit.text) To simplify matters, move the remove callback to .text and drop .suppress_bind_attrs = true. Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit 13c8fb98b7bd3872e75f89c86a2453b0e4a99401 Author: Uwe Kleine-König Date: Tue Nov 7 10:17:43 2023 +0100 fbdev: atmel_lcdfb: Stop using platform_driver_probe() On today's platforms the benefit of platform_driver_probe() isn't that relevant any more. It allows to drop some code after booting (or module loading) for .probe() and discard the .remove() function completely if the driver is built-in. This typically saves a few 100k. The downside of platform_driver_probe() is that the driver cannot be bound and unbound at runtime which is ancient and also slightly complicates testing. There are also thoughts to deprecate platform_driver_probe() because it adds some complexity in the driver core for little gain. Also many drivers don't use it correctly. This driver for example misses to mark the driver struct with __refdata which is needed to suppress a (W=1) modpost warning: WARNING: modpost: drivers/video/fbdev/atmel_lcdfb: section mismatch in reference: atmel_lcdfb_driver+0x4 (section: .data) -> atmel_lcdfb_remove (section: .exit.text) [folded in patch by Nathan Chancellor] Signed-off-by: Uwe Kleine-König Signed-off-by: Nathan Chancellor Signed-off-by: Helge Deller commit 8c74b27f4b30cd896ccf387102410a65b4a35c25 Merge: fe69a1b1b6ed9 62ccdb11d3c63 Author: Alexei Starovoitov Date: Thu Nov 9 20:11:20 2023 -0800 Merge branch 'bpf-control-flow-graph-and-precision-backtrack-fixes' Andrii Nakryiko says: ==================== BPF control flow graph and precision backtrack fixes A small fix to BPF verifier's CFG logic around handling and reporting ldimm64 instructions. Patch #1 was previously submitted separately ([0]), and so this patch set supersedes that patch. Second patch is fixing obscure corner case in mark_chain_precise() logic. See patch for details. Patch #3 adds a dedicated test, however fragile it might. [0] https://patchwork.kernel.org/project/netdevbpf/patch/20231101205626.119243-1-andrii@kernel.org/ ==================== Link: https://lore.kernel.org/r/20231110002638.4168352-1-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 62ccdb11d3c63dc697dea1fd92b3496fe43dcc1e Author: Andrii Nakryiko Date: Thu Nov 9 16:26:38 2023 -0800 selftests/bpf: add edge case backtracking logic test Add a dedicated selftests to try to set up conditions to have a state with same first and last instruction index, but it actually is a loop 3->4->1->2->3. This confuses mark_chain_precision() if verifier doesn't take into account jump history. Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20231110002638.4168352-4-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 4bb7ea946a370707315ab774432963ce47291946 Author: Andrii Nakryiko Date: Thu Nov 9 16:26:37 2023 -0800 bpf: fix precision backtracking instruction iteration Fix an edge case in __mark_chain_precision() which prematurely stops backtracking instructions in a state if it happens that state's first and last instruction indexes are the same. This situations doesn't necessarily mean that there were no instructions simulated in a state, but rather that we starting from the instruction, jumped around a bit, and then ended up at the same instruction before checkpointing or marking precision. To distinguish between these two possible situations, we need to consult jump history. If it's empty or contain a single record "bridging" parent state and first instruction of processed state, then we indeed backtracked all instructions in this state. But if history is not empty, we are definitely not done yet. Move this logic inside get_prev_insn_idx() to contain it more nicely. Use -ENOENT return code to denote "we are out of instructions" situation. This bug was exposed by verifier_loop1.c's bounded_recursion subtest, once the next fix in this patch set is applied. Acked-by: Eduard Zingerman Fixes: b5dc0163d8fd ("bpf: precise scalar_value tracking") Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20231110002638.4168352-3-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit 3feb263bb516ee7e1da0acd22b15afbb9a7daa19 Author: Andrii Nakryiko Date: Thu Nov 9 16:26:36 2023 -0800 bpf: handle ldimm64 properly in check_cfg() ldimm64 instructions are 16-byte long, and so have to be handled appropriately in check_cfg(), just like the rest of BPF verifier does. This has implications in three places: - when determining next instruction for non-jump instructions; - when determining next instruction for callback address ldimm64 instructions (in visit_func_call_insn()); - when checking for unreachable instructions, where second half of ldimm64 is expected to be unreachable; We take this also as an opportunity to report jump into the middle of ldimm64. And adjust few test_verifier tests accordingly. Acked-by: Eduard Zingerman Reported-by: Hao Sun Fixes: 475fb78fbf48 ("bpf: verifier (add branch/goto checks)") Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20231110002638.4168352-2-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit fe69a1b1b6ed9ffc2c578c63f526026a8ab74f0c Author: Anders Roxell Date: Thu Nov 9 18:43:28 2023 +0100 selftests: bpf: xskxceiver: ksft_print_msg: fix format type error Crossbuilding selftests/bpf for architecture arm64, format specifies type error show up like. xskxceiver.c:912:34: error: format specifies type 'int' but the argument has type '__u64' (aka 'unsigned long long') [-Werror,-Wformat] ksft_print_msg("[%s] expected meta_count [%d], got meta_count [%d]\n", ~~ %llu __func__, pkt->pkt_nb, meta->count); ^~~~~~~~~~~ xskxceiver.c:929:55: error: format specifies type 'unsigned long long' but the argument has type 'u64' (aka 'unsigned long') [-Werror,-Wformat] ksft_print_msg("Frag invalid addr: %llx len: %u\n", addr, len); ~~~~ ^~~~ Fixing the issues by casting to (unsigned long long) and changing the specifiers to be %llu from %d and %u, since with u64s it might be %llx or %lx, depending on architecture. Signed-off-by: Anders Roxell Link: https://lore.kernel.org/r/20231109174328.1774571-1-anders.roxell@linaro.org Signed-off-by: Alexei Starovoitov commit 89cdf9d556016a54ff6ddd62324aa5ec790c05cc Merge: 3b22041343818 83b9dda8afa4e Author: Linus Torvalds Date: Thu Nov 9 17:09:35 2023 -0800 Merge tag 'net-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter and bpf. Current release - regressions: - sched: fix SKB_NOT_DROPPED_YET splat under debug config Current release - new code bugs: - tcp: - fix usec timestamps with TCP fastopen - fix possible out-of-bounds reads in tcp_hash_fail() - fix SYN option room calculation for TCP-AO - tcp_sigpool: fix some off by one bugs - bpf: fix compilation error without CGROUPS - ptp: - ptp_read() should not release queue - fix tsevqs corruption Previous releases - regressions: - llc: verify mac len before reading mac header Previous releases - always broken: - bpf: - fix check_stack_write_fixed_off() to correctly spill imm - fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END - check map->usercnt after timer->timer is assigned - dsa: lan9303: consequently nested-lock physical MDIO - dccp/tcp: call security_inet_conn_request() after setting IP addr - tg3: fix the TX ring stall due to incorrect full ring handling - phylink: initialize carrier state at creation - ice: fix direction of VF rules in switchdev mode Misc: - fill in a bunch of missing MODULE_DESCRIPTION()s, more to come" * tag 'net-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (84 commits) net: ti: icss-iep: fix setting counter value ptp: fix corrupted list in ptp_open ptp: ptp_read should not release queue net_sched: sch_fq: better validate TCA_FQ_WEIGHTS and TCA_FQ_PRIOMAP net: kcm: fill in MODULE_DESCRIPTION() net/sched: act_ct: Always fill offloading tuple iifidx netfilter: nat: fix ipv6 nat redirect with mapped and scoped addresses netfilter: xt_recent: fix (increase) ipv6 literal buffer length ipvs: add missing module descriptions netfilter: nf_tables: remove catchall element in GC sync path netfilter: add missing module descriptions drivers/net/ppp: use standard array-copy-function net: enetc: shorten enetc_setup_xdp_prog() error message to fit NETLINK_MAX_FMTMSG_LEN virtio/vsock: Fix uninit-value in virtio_transport_recv_pkt() r8169: respect userspace disabling IFF_MULTICAST selftests/bpf: get trusted cgrp from bpf_iter__cgroup directly bpf: Let verifier consider {task,cgroup} is trusted in bpf_iter_reg net: phylink: initialize carrier state at creation test/vsock: add dobule bind connect test test/vsock: refactor vsock_accept ... commit 3b220413438184b352b297e7cf593fa56999b5b3 Merge: a12deb44f9734 9aedd10fe3841 Author: Linus Torvalds Date: Thu Nov 9 17:04:58 2023 -0800 Merge tag 'v6.7-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: "This fixes a regression in ahash and hides the Kconfig sub-options for the jitter RNG" * tag 'v6.7-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: ahash - Set using_shash for cloned ahash wrapper over shash crypto: jitterentropy - Hide esoteric Kconfig options under FIPS and EXPERT commit a12deb44f9734dc25970c266249b272e44d3d1b5 Merge: ace92fd98475c cdd5b5a9761fd Author: Linus Torvalds Date: Thu Nov 9 14:18:42 2023 -0800 Merge tag 'input-for-v6.7-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - a number of input drivers has been converted to use facilities provided by the device core to instantiate driver-specific attributes instead of using devm_device_add_group() and similar APIs - platform input devices have been converted to use remove() callback returning void - a fix for use-after-free when tearing down a Synaptics RMI device - a few flexible arrays in input structures have been annotated with __counted_by to help hardening efforts - handling of vddio supply in cyttsp5 driver - other miscellaneous fixups * tag 'input-for-v6.7-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (86 commits) Input: walkera0701 - use module_parport_driver macro to simplify the code Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() dt-bindings: input: fsl,scu-key: Document wakeup-source Input: cyttsp5 - add handling for vddio regulator dt-bindings: input: cyttsp5: document vddio-supply Input: tegra-kbc - use device_get_match_data() Input: Annotate struct ff_device with __counted_by Input: axp20x-pek - avoid needless newline removal Input: mt - annotate struct input_mt with __counted_by Input: leds - annotate struct input_leds with __counted_by Input: evdev - annotate struct evdev_client with __counted_by Input: synaptics-rmi4 - replace deprecated strncpy Input: wm97xx-core - convert to platform remove callback returning void Input: wm831x-ts - convert to platform remove callback returning void Input: ti_am335x_tsc - convert to platform remove callback returning void Input: sun4i-ts - convert to platform remove callback returning void Input: stmpe-ts - convert to platform remove callback returning void Input: pcap_ts - convert to platform remove callback returning void Input: mc13783_ts - convert to platform remove callback returning void Input: mainstone-wm97xx - convert to platform remove callback returning void ... commit ace92fd98475c15c860855b53aad3413e28399c8 Merge: 12418ece0d662 bdba49cbba41f Author: Linus Torvalds Date: Thu Nov 9 14:10:38 2023 -0800 Merge tag 'for-6.7-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull more i2c updates from Wolfram Sang: "This contains one patch which slipped through the cracks (iproc), a core sanitizing improvement as the new memdup_array_user() helper went upstream (i2c-dev), and two driver bugfixes (designware, cp2615)" * tag 'for-6.7-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: cp2615: Fix 'assignment to __be16' warning i2c: dev: copy userspace array safely i2c: designware: Disable TX_EMPTY irq while waiting for block length byte i2c: iproc: handle invalid slave state commit 197264284303b30b26e885d83680f594e69840e5 Author: Victor Lu Date: Tue Aug 8 14:28:56 2023 -0400 drm/amdgpu: Change WREG32_RLC to WREG32_SOC15_RLC where inst != 0 (v2) W/RREG32_RLC is hardedcoded to use instance 0. W/RREG32_SOC15_RLC should be used instead when inst != 0. v2: rebase Signed-off-by: Victor Lu Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 85150626ea0423fd0adb5ac9b5ab4bbaff9aa30b Author: Victor Lu Date: Tue Oct 3 16:15:52 2023 -0400 drm/amdgpu: Use correct KIQ MEC engine for gfx9.4.3 (v5) amdgpu_kiq_wreg/rreg is hardcoded to use MEC engine 0. Add an xcc_id parameter to amdgpu_kiq_wreg/rreg, define W/RREG32_XCC and amdgpu_device_xcc_wreg/rreg to use the new xcc_id parameter. Using amdgpu_sriov_runtime to determine whether to access via kiq or RLC is sufficient for now. v5: add condition in amdgpu_device_xcc_w/rreg, remove trace func call v4: avoid using amdgpu_sriov_w/rreg v3: use W/RREG32_XCC to handle non-kiq case v2: define amdgpu_device_xcc_wreg/rreg instead of changing parameters of amdgpu_device_wreg/rreg Signed-off-by: Victor Lu Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 76d2da18afde2c78e9fc1fbcc9dc57c27ac77ac5 Author: Yang Wang Date: Tue Nov 7 18:03:45 2023 +0800 drm/amdgpu: add smu v13.0.6 pcs xgmi ras error query support add pcs xgmi ras error query support for smu v13.0.6. Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4638e0c29a3f2294d5de0d052a4b8c9f33ccb957 Author: Vitaly Prosyak Date: Wed Oct 11 19:31:48 2023 -0400 drm/amdgpu: fix software pci_unplug on some chips When software 'pci unplug' using IGT is executed we got a sysfs directory entry is NULL for differant ras blocks like hdp, umc, etc. Before call 'sysfs_remove_file_from_group' and 'sysfs_remove_group' check that 'sd' is not NULL. [ +0.000001] RIP: 0010:sysfs_remove_group+0x83/0x90 [ +0.000002] Code: 31 c0 31 d2 31 f6 31 ff e9 9a a8 b4 00 4c 89 e7 e8 f2 a2 ff ff eb c2 49 8b 55 00 48 8b 33 48 c7 c7 80 65 94 82 e8 cd 82 bb ff <0f> 0b eb cc 66 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 [ +0.000001] RSP: 0018:ffffc90002067c90 EFLAGS: 00010246 [ +0.000002] RAX: 0000000000000000 RBX: ffffffff824ea180 RCX: 0000000000000000 [ +0.000001] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ +0.000001] RBP: ffffc90002067ca8 R08: 0000000000000000 R09: 0000000000000000 [ +0.000001] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ +0.000001] R13: ffff88810a395f48 R14: ffff888101aab0d0 R15: 0000000000000000 [ +0.000001] FS: 00007f5ddaa43a00(0000) GS:ffff88841e800000(0000) knlGS:0000000000000000 [ +0.000002] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ +0.000001] CR2: 00007f8ffa61ba50 CR3: 0000000106432000 CR4: 0000000000350ef0 [ +0.000001] Call Trace: [ +0.000001] [ +0.000001] ? show_regs+0x72/0x90 [ +0.000002] ? sysfs_remove_group+0x83/0x90 [ +0.000002] ? __warn+0x8d/0x160 [ +0.000001] ? sysfs_remove_group+0x83/0x90 [ +0.000001] ? report_bug+0x1bb/0x1d0 [ +0.000003] ? handle_bug+0x46/0x90 [ +0.000001] ? exc_invalid_op+0x19/0x80 [ +0.000002] ? asm_exc_invalid_op+0x1b/0x20 [ +0.000003] ? sysfs_remove_group+0x83/0x90 [ +0.000001] dpm_sysfs_remove+0x61/0x70 [ +0.000002] device_del+0xa3/0x3d0 [ +0.000002] ? ktime_get_mono_fast_ns+0x46/0xb0 [ +0.000002] device_unregister+0x18/0x70 [ +0.000001] i2c_del_adapter+0x26d/0x330 [ +0.000002] arcturus_i2c_control_fini+0x25/0x50 [amdgpu] [ +0.000236] smu_sw_fini+0x38/0x260 [amdgpu] [ +0.000241] amdgpu_device_fini_sw+0x116/0x670 [amdgpu] [ +0.000186] ? mutex_lock+0x13/0x50 [ +0.000003] amdgpu_driver_release_kms+0x16/0x40 [amdgpu] [ +0.000192] drm_minor_release+0x4f/0x80 [drm] [ +0.000025] drm_release+0xfe/0x150 [drm] [ +0.000027] __fput+0x9f/0x290 [ +0.000002] ____fput+0xe/0x20 [ +0.000002] task_work_run+0x61/0xa0 [ +0.000002] exit_to_user_mode_prepare+0x150/0x170 [ +0.000002] syscall_exit_to_user_mode+0x2a/0x50 Cc: Hawking Zhang Cc: Luben Tuikov Cc: Alex Deucher Cc: Christian Koenig Signed-off-by: Vitaly Prosyak Reviewed-by: Luben Tuikov Signed-off-by: Alex Deucher commit 36e0d7088555a6a32664635eebe372452027bc6f Author: José Pekkarinen Date: Sun Oct 29 11:39:26 2023 +0200 drm/amd/display: remove duplicated argument Spotted by coccicheck, there is a redundant check for v->SourcePixelFormat[k] != dm_444_16. This patch will remove it. The corresponding output follows. drivers/gpu/drm/amd/display/dc/dml/dcn30/display_mode_vba_30.c:5130:86-122: duplicated argument to && or || Signed-off-by: José Pekkarinen Reviewed-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 8140b07b0a69a7e8d5d764237c68af7942c4bfdd Author: Yang Wang Date: Wed Nov 8 20:35:52 2023 +0800 drm/amdgpu: correct mca debugfs dump reg list avoid driver to touch invalid mca reg. Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d406aec8dc2a001d4a91f786b525b3b4ea7fa1ef Author: Hawking Zhang Date: Wed Nov 8 17:08:49 2023 +0800 drm/amdgpu: correct acclerator check architecutre dump So driver doesn't touch invalid aca entries. Signed-off-by: Hawking Zhang Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 27d80f7d68185a62e101575d302539353622e523 Author: Yang Wang Date: Fri Nov 3 17:00:10 2023 +0800 drm/amdgpu: add pcs xgmi v6.4.0 ras support add pcs xgmi v6.4.0 ras support Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4abf0b0bdf5ffe7e79e6416cc2c1b7f018b71c79 Author: David Yat Sin Date: Wed Nov 8 02:32:13 2023 +0000 drm/amdgpu: Change extended-scope MTYPE on GC 9.4.3 Change local memory type to MTYPE_UC on revision id 0 Signed-off-by: David Yat Sin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 61e0a98200f49d0b78e17aa2ccd71967cd92f2ab Author: Yang Wang Date: Tue Nov 7 09:34:33 2023 +0800 drm/amdgpu: disable smu v13.0.6 mca debug mode by default disable mca debug mode for smu v13.0.6 by default. Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 8cc0f5669eb6d4f156c721956da67560c9319317 Author: Hawking Zhang Date: Wed Nov 8 16:07:45 2023 +0800 drm/amdgpu: Support multiple error query modes Direct error query mode and firmware error query mode are supported for now. Signed-off-by: Hawking Zhang Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 07c1db70364671eea4e84befe43ac91941153a43 Author: Yang Wang Date: Thu Nov 2 14:17:04 2023 +0800 drm/amdgpu: refine smu v13.0.6 mca dump driver refine smu mca driver to support query ras error from pmfw path. - correct gfx smu bank hwid (from mp5 to smu bank) - retire unused callback function in amdgpu_mca_smu_funcs{} - add new mca_bank_set{} structure to collect mca bank - move enum mca_reg_idx into amdgpu_mca.h header - add mca status register field decode macro Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 0b1695710ab8be263a5c19f17240c6a44b4b0a3e Author: Victor Lu Date: Wed Oct 11 16:27:59 2023 -0400 drm/amdgpu: Do not program PF-only regs in hdp_v4_0.c under SRIOV (v2) The following regs can only be programmed by the PF: HDP_MISC_CNTL HDP_NONSURFACE_BASE HDP_NONSURFACE_BASE_HI v2: update commit message Signed-off-by: Victor Lu Reviewed-by: Samir Dhume Signed-off-by: Alex Deucher commit a78b4814697251419f3460bb124aaa5689e65055 Author: Victor Lu Date: Wed Oct 4 15:52:57 2023 -0400 drm/amdgpu: Skip PCTL0_MMHUB_DEEPSLEEP_IB write in jpegv4.0.3 under SRIOV PCTL0_MMHUB_DEEPSLEEP_IB is blocked for VF access Signed-off-by: Victor Lu Reviewed-by: Samir Dhume Signed-off-by: Alex Deucher commit bb619539629cee523df886705d6ef866e099640a Author: Hunter Chasens Date: Tue Nov 7 11:28:30 2023 -0500 drm: amd: Resolve Sphinx unexpected indentation warning Resolves Sphinx unexpected indentation warning when compiling documentation (e.g. `make htmldocs`). Replaces tabs with spaces and adds a literal block to keep vertical formatting of the example power state list. Reviewed-by: Lijo Lazar Reviewed-by: Bagas Sanjaya (v2) Acked-by: Randy Dunlap (v2) Signed-off-by: Hunter Chasens Signed-off-by: Alex Deucher commit bf13da6ae1a0097cf2ff4fba1e3236aaa3fa3a7a Author: Yang Wang Date: Tue Oct 24 14:00:39 2023 +0800 drm/amdgpu: correct smu v13.0.6 umc ras error check correct smu v13.0.0 umc ras error check Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bc3c566071c8504f5d7c73a4171ead394f097639 Author: Victor Lu Date: Tue Aug 8 13:57:16 2023 -0400 drm/amdgpu: Add xcc param to SRIOV kiq write and WREG32_SOC15_IP_NO_KIQ (v4) WREG32/RREG32_SOC15_IP_NO_KIQ and amdgpu_virt_kiq_reg_write_reg_wait are not using the correct rlcg interface or mec engine, respectively. Add xcc instance parameter to them. v4: Use GET_INST and squash commit with: "drm/amdgpu: Add xcc_inst param to amdgpu_virt_kiq_reg_write_reg_wait" v3: xcc not needed for MMMHUB v2: rebase Signed-off-by: Victor Lu Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit f64c3fce460469cd356ccb5c91d0bcbd1b9bc403 Author: Victor Lu Date: Tue Aug 8 15:11:19 2023 -0400 drm/amdgpu: Add flag to enable indirect RLCG access for gfx v9.4.3 The "rlcg_reg_access_supported" flag is missing. Add it back in. Signed-off-by: Victor Lu Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 5a2913aadabc4711e98fb48d56e5c5f5728bbc33 Author: Le Ma Date: Tue Nov 7 18:10:29 2023 +0800 drm/amd/pm: raise the deep sleep clock threshold for smu 13.0.6 The DS clock may exceed the limit as sclk dfll divider is 16 to target freq. Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 4eaa007c739991b08b6343453035e5d1dfe2bd98 Author: Yang Wang Date: Tue Oct 31 10:48:50 2023 +0800 drm/amdgpu: correct amdgpu ip block rev info correct following amdgpu ip block version information: - gfx_v9_4_3 - sdma_v4_4_2 Signed-off-by: Yang Wang Reviewed-by: Kenneth Feng Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 8abf799ea4d58e7d0522bd6e4bb070be3de3ed62 Author: Lijo Lazar Date: Fri Nov 3 11:24:44 2023 +0530 drm/amd/pm: Hide pp_dpm_pcie device attribute Hide PCIe DPM attribute on SOCs with GC v9.4.2 and GC v9.4.3. Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit 61d7052216214e828b71407172aa85031cf138a9 Author: Tao Zhou Date: Tue Oct 31 11:09:30 2023 +0800 drm/amdgpu: Don't warn for unsupported set_xgmi_plpd_mode set_xgmi_plpd_mode may be unsupported and this isn't error, no need to print warning for it. v2: add ret2 to save the status of psp_ras_trigger_error. Suggested-by: lijo.lazar@amd.com Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 17daf01ab4e3e5a5929747aa05cc15eb2bad5438 Author: Christian König Date: Thu Nov 9 10:14:14 2023 +0100 drm/amdgpu: lower CS errors to debug severity Otherwise userspace can spam the logs by using incorrect input values. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 12f76050d8d4d10dab96333656b821bd4620d103 Author: Christian König Date: Thu Nov 9 10:12:39 2023 +0100 drm/amdgpu: fix error handling in amdgpu_bo_list_get() We should not leak the pointer where we couldn't grab the reference on to the caller because it can be that the error handling still tries to put the reference then. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit bff3315ba8b1d81655743136bfc38514e820a739 Author: Alex Deucher Date: Tue Nov 7 14:07:44 2023 -0500 drm/amdgpu: fix AGP init order The default AGP settings were overwriting the IP selected ones since the default was getting set after the IP ones were selected. Fixes: de59b69932e6 ("drm/amdgpu/gmc: set a default disable value for AGP") Link: https://lists.freedesktop.org/archives/amd-gfx/2023-November/100966.html Tested-by: Mikhail Gavrilov Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: Mikhail Gavrilov commit 12418ece0d662ac6e7325eddefed841b25578fa3 Merge: f3bfe64330414 9d08e5909c811 Author: Linus Torvalds Date: Thu Nov 9 13:54:25 2023 -0800 Merge tag 'linux-watchdog-6.7-rc1' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog updates from Wim Van Sebroeck: - add support for Amlogic C3 and S4 SoCs - add IT8613 ID - add MSM8226 and MSM8974 compatibles - other small fixes and improvements * tag 'linux-watchdog-6.7-rc1' of git://www.linux-watchdog.org/linux-watchdog: (24 commits) dt-bindings: watchdog: Add support for Amlogic C3 and S4 SoCs watchdog: mlx-wdt: Parameter desctiption warning fix watchdog: aspeed: Add support for aspeed,reset-mask DT property dt-bindings: watchdog: aspeed-wdt: Add aspeed,reset-mask property watchdog: apple: Deactivate on suspend dt-bindings: watchdog: qcom-wdt: Add MSM8226 and MSM8974 compatibles dt-bindings: watchdog: fsl-imx7ulp-wdt: Add 'fsl,ext-reset-output' wdog: imx7ulp: Enable wdog int_en bit for watchdog any reset drivers: watchdog: marvell_gti: Program the max_hw_heartbeat_ms drivers: watchdog: marvell_gti: fix zero pretimeout handling watchdog: marvell_gti: Replace of_platform.h with explicit includes watchdog: imx_sc_wdt: continue if the wdog already enabled watchdog: st_lpc: Use device_get_match_data() watchdog: wdat_wdt: Add timeout value as a param in ping method watchdog: gpio_wdt: Make use of device properties sbsa_gwdt: Calculate timeout with 64-bit math watchdog: ixp4xx: Make sure restart always works watchdog: it87_wdt: add IT8613 ID watchdog: marvell_gti_wdt: Fix error code in probe() Watchdog: marvell_gti_wdt: Remove redundant dev_err_probe() for platform_get_irq() ... commit f3bfe643304143ce2727adc893cfa134ba27f968 Merge: 4bbdb725a36b0 40592064a1a53 Author: Linus Torvalds Date: Thu Nov 9 13:47:52 2023 -0800 Merge tag 'pwm/for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm Pull pwm updates from Thierry Reding: "This contains a few fixes and a bunch of cleanups, a lot of which is in preparation for Uwe's character device support that may be ready in time for the next merge window" * tag 'pwm/for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (37 commits) pwm: samsung: Document new member .channel in struct samsung_pwm_chip pwm: bcm2835: Add support for suspend/resume pwm: brcmstb: Checked clk_prepare_enable() return value pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume pwm: pxa: Explicitly include correct DT includes pwm: cros-ec: Simplify using devm_pwmchip_add() and dev_err_probe() pwm: samsung: Consistently use the same name for driver data pwm: vt8500: Simplify using devm functions pwm: sprd: Simplify using devm_pwmchip_add() and dev_err_probe() pwm: sprd: Provide a helper to cast a chip to driver data pwm: spear: Simplify using devm functions pwm: mtk-disp: Simplify using devm_pwmchip_add() pwm: imx-tpm: Simplify using devm functions pwm: brcmstb: Simplify using devm functions pwm: bcm2835: Simplify using devm functions pwm: bcm-iproc: Simplify using devm functions pwm: Adapt sysfs API documentation to reality pwm: dwc: add PWM bit unset in get_state call pwm: dwc: make timer clock configurable pwm: dwc: split pci out of core driver ... commit 4bbdb725a36b0d235f3b832bd0c1e885f0442d9f Merge: 6bc986ab839c8 e8cca466a84a7 Author: Linus Torvalds Date: Thu Nov 9 13:37:28 2023 -0800 Merge tag 'iommu-updates-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu updates from Joerg Roedel: "Core changes: - Make default-domains mandatory for all IOMMU drivers - Remove group refcounting - Add generic_single_device_group() helper and consolidate drivers - Cleanup map/unmap ops - Scaling improvements for the IOVA rcache depot - Convert dart & iommufd to the new domain_alloc_paging() ARM-SMMU: - Device-tree binding update: - Add qcom,sm7150-smmu-v2 for Adreno on SM7150 SoC - SMMUv2: - Support for Qualcomm SDM670 (MDSS) and SM7150 SoCs - SMMUv3: - Large refactoring of the context descriptor code to move the CD table into the master, paving the way for '->set_dev_pasid()' support on non-SVA domains - Minor cleanups to the SVA code Intel VT-d: - Enable debugfs to dump domain attached to a pasid - Remove an unnecessary inline function AMD IOMMU: - Initial patches for SVA support (not complete yet) S390 IOMMU: - DMA-API conversion and optimized IOTLB flushing And some smaller fixes and improvements" * tag 'iommu-updates-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (102 commits) iommu/dart: Remove the force_bypass variable iommu/dart: Call apple_dart_finalize_domain() as part of alloc_paging() iommu/dart: Convert to domain_alloc_paging() iommu/dart: Move the blocked domain support to a global static iommu/dart: Use static global identity domains iommufd: Convert to alloc_domain_paging() iommu/vt-d: Use ops->blocked_domain iommu/vt-d: Update the definition of the blocking domain iommu: Move IOMMU_DOMAIN_BLOCKED global statics to ops->blocked_domain Revert "iommu/vt-d: Remove unused function" iommu/amd: Remove DMA_FQ type from domain allocation path iommu: change iommu_map_sgtable to return signed values iommu/virtio: Add __counted_by for struct viommu_request and use struct_size() iommu/vt-d: debugfs: Support dumping a specified page table iommu/vt-d: debugfs: Create/remove debugfs file per {device, pasid} iommu/vt-d: debugfs: Dump entry pointing to huge page iommu/vt-d: Remove unused function iommu/arm-smmu-v3-sva: Remove bond refcount iommu/arm-smmu-v3-sva: Remove unused iommu_sva handle iommu/arm-smmu-v3: Rename cdcfg to cd_table ... commit 5e2fd17f434d2fed78efb123e2fc6711e4f598f1 Author: Paulo Alcantara Date: Thu Nov 9 12:01:48 2023 -0300 smb: client: fix mount when dns_resolver key is not available There was a wrong assumption that with CONFIG_CIFS_DFS_UPCALL=y there would always be a dns_resolver key set up so we could unconditionally upcall to resolve UNC hostname rather than using the value provided by mount(2). Only require it when performing automount of junctions within a DFS share so users that don't have dns_resolver key still can mount their regular shares with server hostname resolved by mount.cifs(8). Fixes: 348a04a8d113 ("smb: client: get rid of dfs code dep in namespace.c") Cc: stable@vger.kernel.org Tested-by: Eduard Bachmakov Reported-by: Eduard Bachmakov Closes: https://lore.kernel.org/all/CADCRUiNvZuiUZ0VGZZO9HRyPyw6x92kiA7o7Q4tsX5FkZqUkKg@mail.gmail.com/ Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 457926b253200bd9bdfae9a016a3b1d1dc661d55 Author: Xiao Wang Date: Tue Oct 31 14:45:53 2023 +0800 riscv: Optimize bitops with Zbb extension This patch leverages the alternative mechanism to dynamically optimize bitops (including __ffs, __fls, ffs, fls) with Zbb instructions. When Zbb ext is not supported by the runtime CPU, legacy implementation is used. If Zbb is supported, then the optimized variants will be selected via alternative patching. The legacy bitops support is taken from the generic C implementation as fallback. If the parameter is a build-time constant, we leverage compiler builtin to calculate the result directly, this approach is inspired by x86 bitops implementation. EFI stub runs before the kernel, so alternative mechanism should not be used there, this patch introduces a macro NO_ALTERNATIVE for this purpose. Signed-off-by: Xiao Wang Reviewed-by: Charlie Jenkins Link: https://lore.kernel.org/r/20231031064553.2319688-3-xiao.w.wang@intel.com Signed-off-by: Palmer Dabbelt commit e72c4333d2f2e7f2200f71a88c0480fd2a769a64 Author: Xiao Wang Date: Tue Oct 31 14:45:52 2023 +0800 riscv: Rearrange hwcap.h and cpufeature.h Now hwcap.h and cpufeature.h are mutually including each other, and most of the variable/API declarations in hwcap.h are implemented in cpufeature.c, so, it's better to move them into cpufeature.h and leave only macros for ISA extension logical IDs in hwcap.h. BTW, the riscv_isa_extension_mask macro is not used now, so this patch removes it. Suggested-by: Andrew Jones Signed-off-by: Xiao Wang Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20231031064553.2319688-2-xiao.w.wang@intel.com Signed-off-by: Palmer Dabbelt commit 8f51593cdcab82fb23ef2e1a0010b2e6f99aae02 Author: Nícolas F. R. A. Prado Date: Tue Nov 7 17:55:28 2023 -0500 dt: dt-extract-compatibles: Don't follow symlinks when walking tree The iglob function, which we use to find C source files in the kernel tree, always follows symbolic links. This can cause unintentional recursions whenever a symbolic link points to a parent directory. A common scenario is building the kernel with the output set to a directory inside the kernel tree, which will contain such a symlink. Instead of using the iglob function, use os.walk to traverse the directory tree, which by default doesn't follow symbolic links. fnmatch is then used to match the glob on the filename, as well as ignore hidden files (which were ignored by default with iglob). This approach runs just as fast as using iglob. Fixes: b6acf8073517 ("dt: Add a check for undocumented compatible strings in kernel") Reported-by: Aishwarya TCV Closes: https://lore.kernel.org/all/e90cb52f-d55b-d3ba-3933-6cc7b43fcfbc@arm.com Signed-off-by: "Nícolas F. R. A. Prado" Link: https://lore.kernel.org/r/20231107225624.9811-1-nfraprado@collabora.com Signed-off-by: Rob Herring commit f86128050d2d854035bfa461aadf36e6951b2bac Author: Kevin Brodsky Date: Thu Nov 9 14:11:53 2023 +0000 arm64/syscall: Remove duplicate declaration Commit 6ac19f96515e ("arm64: avoid prototype warnings for syscalls") added missing declarations to various syscall wrapper macros. It however proved a little too zealous in __SYSCALL_DEFINEx(), as a declaration for __arm64_sys##name was already present. A declaration is required before the call to ALLOW_ERROR_INJECTION(), so keep the original one and remove the new one. Fixes: 6ac19f96515e ("arm64: avoid prototype warnings for syscalls") Signed-off-by: Kevin Brodsky Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231109141153.250046-1-kevin.brodsky@arm.com Signed-off-by: Catalin Marinas commit bce36aa682da7ca996d4a02636ebfb6b5f2c3f83 Author: Uwe Kleine-König Date: Tue Nov 7 16:12:24 2023 +0100 OSS: dmasound/paula: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231107151223.3971602-2-u.kleine-koenig@pengutronix.de Signed-off-by: Takashi Iwai commit 5923d6686a100c2b4cabd4c2ca9d5a12579c7614 Author: Steve French Date: Tue Nov 7 21:38:13 2023 -0600 smb3: fix caching of ctime on setxattr Fixes xfstest generic/728 which had been failing due to incorrect ctime after setxattr and removexattr Update ctime on successful set of xattr Cc: stable@vger.kernel.org Signed-off-by: Steve French commit f72d96507640835726d4f5ba26c1c11acbe1bc97 Author: Steve French Date: Mon Nov 6 15:37:03 2023 -0600 smb3: minor cleanup of session handling code Minor cleanup of style issues found by checkpatch Reviewed-by: Bharath SM Signed-off-by: Steve French commit 19a4b9d6c372cab6a3b2c9a061a236136fe95274 Author: Shyam Prasad N Date: Fri Oct 13 11:43:09 2023 +0000 cifs: reconnect work should have reference on server struct The delayed work for reconnect takes server struct as a parameter. But it does so without holding a ref to it. Normally, this may not show a problem as the reconnect work is only cancelled on umount. However, since we now plan to support scaling down of channels, and the scale down can happen from reconnect work itself, we need to fix it. This change takes a reference on the server struct before it is passed to the delayed work. And drops the reference in the delayed work itself. Or if the delayed work is successfully cancelled, by the process that cancels it. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 9599d59eb8fc0c0fd9480c4f22901533d08965ee Author: Shyam Prasad N Date: Mon Nov 6 16:22:11 2023 +0000 cifs: do not pass cifs_sb when trying to add channels The only reason why cifs_sb gets passed today to cifs_try_adding_channels is to pass the local_nls field for the new channels and binding session. However, the ses struct already has local_nls field that is setup during the first cifs_setup_session. So there is no need to pass cifs_sb. This change removes cifs_sb from the arg list for this and the functions that it calls and uses ses->local_nls instead. Cc: stable@vger.kernel.org Signed-off-by: Shyam Prasad N Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit fa1d0508bdd4a68c5e40f85f635712af8c12f180 Author: Shyam Prasad N Date: Tue Mar 14 11:14:58 2023 +0000 cifs: account for primary channel in the interface list The refcounting of server interfaces should account for the primary channel too. Although this is not strictly necessary, doing so will account for the primary channel in DebugData. Cc: stable@vger.kernel.org Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit a6d8fb54a515f0546ffdb7870102b1238917e567 Author: Shyam Prasad N Date: Mon Dec 26 11:24:56 2022 +0000 cifs: distribute channels across interfaces based on speed Today, if the server interfaces RSS capable, we simply choose the fastest interface to setup a channel. This is not a scalable approach, and does not make a lot of attempt to distribute the connections. This change does a weighted distribution of channels across all the available server interfaces, where the weight is a function of the advertised interface speed. Also make sure that we don't mix rdma and non-rdma for channels. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 0c51cc6f2cb0108e7d49805f6e089cd85caab279 Author: Shyam Prasad N Date: Fri Oct 13 09:25:30 2023 +0000 cifs: handle cases where a channel is closed So far, SMB multichannel could only scale up, but not scale down the number of channels. In this series of patch, we now allow the client to deal with the case of multichannel disabled on the server when the share is mounted. With that change, we now need the ability to scale down the channels. This change allows the client to deal with cases of missing channels more gracefully. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 1bc081b67a79b6e75fae686e98048cea1038ae31 Author: Steve French Date: Mon Nov 6 22:40:38 2023 -0600 smb3: more minor cleanups for session handling routines Some trivial cleanup pointed out by checkpatch Reviewed-by: Bharath SM Signed-off-by: Steve French commit 43960dc2328e554c4c61b22c47e77e8b1c48d854 Author: Steve French Date: Mon Nov 6 13:31:45 2023 -0600 smb3: minor RDMA cleanup Some minor smbdirect debug cleanup spotted by checkpatch Cc: Long Li Reviewed-by: Bharath SM Signed-off-by: Steve French commit 6ae90e906aed727759b88eb2b000fcdc8fcd94a3 Author: Vitalii Torshyn Date: Thu Nov 9 01:13:54 2023 +0200 ALSA: hda: ASUS UM5302LA: Added quirks for cs35L41/10431A83 on i2c bus Proposed patch fixes initialization of CSC3551 on the UM5302LA laptop. Patching DSDT table is not required since ASUS did added _DSD entry. Nothing new introduced but reused work started by Stefan B. Currently there is no official firmware available for 10431A83 on cirrus git unfortunately. For testing used 104317f3 (which is also seems on i2c bus): $ cd /lib/firmware/cirrus/ && \ for fw in $(find ./ -name '*104317f3*'); do newfw=$(echo $fw | sed 's/104317f3/10431a83/g'); echo echo "$fw -> $newfw"; ln -s $f $newfw; done With the patch applied to 6.6.0 and obviously symlinks to 104317F3 FW, speakers works and to my susrprise they sound quite good and loud without distortion. Probably confirmation from cirrus team is needed on firmware. Signed-off-by: Vitalii Torshyn Link: https://bugzilla.kernel.org/show_bug.cgi?id=218119 Link: https://lore.kernel.org/r/CAHiQ-bCMPpCJ8eOYAaVVoqGkFixS1qTgSS4xfbZvL4oZV9LYew@mail.gmail.com Signed-off-by: Takashi Iwai commit c7a60651953359f98dbf24b43e1bf561e1573ed4 Author: Takashi Iwai Date: Thu Nov 9 15:19:54 2023 +0100 ALSA: info: Fix potential deadlock at disconnection As reported recently, ALSA core info helper may cause a deadlock at the forced device disconnection during the procfs operation. The proc_remove() (that is called from the snd_card_disconnect() helper) has a synchronization of the pending procfs accesses via wait_for_completion(). Meanwhile, ALSA procfs helper takes the global mutex_lock(&info_mutex) at both the proc_open callback and snd_card_info_disconnect() helper. Since the proc_open can't finish due to the mutex lock, wait_for_completion() never returns, either, hence it deadlocks. TASK#1 TASK#2 proc_reg_open() takes use_pde() snd_info_text_entry_open() snd_card_disconnect() snd_info_card_disconnect() takes mutex_lock(&info_mutex) proc_remove() wait_for_completion(unused_pde) ... waiting task#1 closes mutex_lock(&info_mutex) => DEADLOCK This patch is a workaround for avoiding the deadlock scenario above. The basic strategy is to move proc_remove() call outside the mutex lock. proc_remove() can work gracefully without extra locking, and it can delete the tree recursively alone. So, we call proc_remove() at snd_info_card_disconnection() at first, then delete the rest resources recursively within the info_mutex lock. After the change, the function snd_info_disconnect() doesn't do disconnection by itself any longer, but it merely clears the procfs pointer. So rename the function to snd_info_clear_entries() for avoiding confusion. The similar change is applied to snd_info_free_entry(), too. Since the proc_remove() is called only conditionally with the non-NULL entry->p, it's skipped after the snd_info_clear_entries() call. Reported-by: Shinhyung Kang Closes: https://lore.kernel.org/r/664457955.21699345385931.JavaMail.epsvc@epcpadp4 Reviewed-by: Jaroslav Kysela Cc: Link: https://lore.kernel.org/r/20231109141954.4283-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 68444b93ed6c622f77745ea25f8db05cd0afb1b6 Merge: c6e316ac05532 61e3d993c8bd3 Author: Palmer Dabbelt Date: Thu Nov 9 06:44:13 2023 -0800 Merge patch "drivers: perf: Do not broadcast to other cpus when starting a counter" This is really just a single patch, but since the offending fix hasn't yet made it to my for-next I'm merging it here. Signed-off-by: Palmer Dabbelt commit 61e3d993c8bd3e80f8f1363ed5e04f88ab531b72 Author: Alexandre Ghiti Date: Thu Oct 26 10:40:10 2023 +0200 drivers: perf: Do not broadcast to other cpus when starting a counter This command: $ perf record -e cycles:k -e instructions:k -c 10000 -m 64M dd if=/dev/zero of=/dev/null count=1000 gives rise to this kernel warning: [ 444.364395] WARNING: CPU: 0 PID: 104 at kernel/smp.c:775 smp_call_function_many_cond+0x42c/0x436 [ 444.364515] Modules linked in: [ 444.364657] CPU: 0 PID: 104 Comm: perf-exec Not tainted 6.6.0-rc6-00051-g391df82e8ec3-dirty #73 [ 444.364771] Hardware name: riscv-virtio,qemu (DT) [ 444.364868] epc : smp_call_function_many_cond+0x42c/0x436 [ 444.364917] ra : on_each_cpu_cond_mask+0x20/0x32 [ 444.364948] epc : ffffffff8009f9e0 ra : ffffffff8009fa5a sp : ff20000000003800 [ 444.364966] gp : ffffffff81500aa0 tp : ff60000002b83000 t0 : ff200000000038c0 [ 444.364982] t1 : ffffffff815021f0 t2 : 000000000000001f s0 : ff200000000038b0 [ 444.364998] s1 : ff60000002c54d98 a0 : ff60000002a73940 a1 : 0000000000000000 [ 444.365013] a2 : 0000000000000000 a3 : 0000000000000003 a4 : 0000000000000100 [ 444.365029] a5 : 0000000000010100 a6 : 0000000000f00000 a7 : 0000000000000000 [ 444.365044] s2 : 0000000000000000 s3 : ffffffffffffffff s4 : ff60000002c54d98 [ 444.365060] s5 : ffffffff81539610 s6 : ffffffff80c20c48 s7 : 0000000000000000 [ 444.365075] s8 : 0000000000000000 s9 : 0000000000000001 s10: 0000000000000001 [ 444.365090] s11: ffffffff80099394 t3 : 0000000000000003 t4 : 00000000eac0c6e6 [ 444.365104] t5 : 0000000400000000 t6 : ff60000002e010d0 [ 444.365120] status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003 [ 444.365226] [] smp_call_function_many_cond+0x42c/0x436 [ 444.365295] [] on_each_cpu_cond_mask+0x20/0x32 [ 444.365311] [] pmu_sbi_ctr_start+0x7a/0xaa [ 444.365327] [] riscv_pmu_start+0x48/0x66 [ 444.365339] [] perf_adjust_freq_unthr_context+0x196/0x1ac [ 444.365356] [] perf_event_task_tick+0x78/0x8c [ 444.365368] [] scheduler_tick+0xe6/0x25e [ 444.365383] [] update_process_times+0x80/0x96 [ 444.365398] [] tick_sched_handle+0x26/0x52 [ 444.365410] [] tick_sched_timer+0x50/0x98 [ 444.365422] [] __hrtimer_run_queues+0x126/0x18a [ 444.365433] [] hrtimer_interrupt+0xce/0x1da [ 444.365444] [] riscv_timer_interrupt+0x30/0x3a [ 444.365457] [] handle_percpu_devid_irq+0x80/0x114 [ 444.365470] [] generic_handle_domain_irq+0x1c/0x2a [ 444.365483] [] riscv_intc_irq+0x2e/0x46 [ 444.365497] [] handle_riscv_irq+0x4a/0x74 [ 444.365521] [] do_irq+0x7c/0x7e [ 444.365796] ---[ end trace 0000000000000000 ]--- That's because the fix in commit 3fec323339a4 ("drivers: perf: Fix panic in riscv SBI mmap support") was wrong since there is no need to broadcast to other cpus when starting a counter, that's only needed in mmap when the counters could have already been started on other cpus, so simply remove this broadcast. Fixes: 3fec323339a4 ("drivers: perf: Fix panic in riscv SBI mmap support") Signed-off-by: Alexandre Ghiti Tested-by: Clément Léger Tested-by: Yu Chien Peter Lin Tested-by: Lad Prabhakar #On Link: https://lore.kernel.org/r/20231026084010.11888-1-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit c6e316ac05532febb0c966fa9b55f5258ed037be Author: Alexandre Ghiti Date: Thu Nov 9 09:21:28 2023 +0100 drivers: perf: Check find_first_bit() return value We must check the return value of find_first_bit() before using the return value as an index array since it happens to overflow the array and then panic: [ 107.318430] Kernel BUG [#1] [ 107.319434] CPU: 3 PID: 1238 Comm: kill Tainted: G E 6.6.0-rc6ubuntu-defconfig #2 [ 107.319465] Hardware name: riscv-virtio,qemu (DT) [ 107.319551] epc : pmu_sbi_ovf_handler+0x3a4/0x3ae [ 107.319840] ra : pmu_sbi_ovf_handler+0x52/0x3ae [ 107.319868] epc : ffffffff80a0a77c ra : ffffffff80a0a42a sp : ffffaf83fecda350 [ 107.319884] gp : ffffffff823961a8 tp : ffffaf8083db1dc0 t0 : ffffaf83fecda480 [ 107.319899] t1 : ffffffff80cafe62 t2 : 000000000000ff00 s0 : ffffaf83fecda520 [ 107.319921] s1 : ffffaf83fecda380 a0 : 00000018fca29df0 a1 : ffffffffffffffff [ 107.319936] a2 : 0000000001073734 a3 : 0000000000000004 a4 : 0000000000000000 [ 107.319951] a5 : 0000000000000040 a6 : 000000001d1c8774 a7 : 0000000000504d55 [ 107.319965] s2 : ffffffff82451f10 s3 : ffffffff82724e70 s4 : 000000000000003f [ 107.319980] s5 : 0000000000000011 s6 : ffffaf8083db27c0 s7 : 0000000000000000 [ 107.319995] s8 : 0000000000000001 s9 : 00007fffb45d6558 s10: 00007fffb45d81a0 [ 107.320009] s11: ffffaf7ffff60000 t3 : 0000000000000004 t4 : 0000000000000000 [ 107.320023] t5 : ffffaf7f80000000 t6 : ffffaf8000000000 [ 107.320037] status: 0000000200000100 badaddr: 0000000000000000 cause: 0000000000000003 [ 107.320081] [] pmu_sbi_ovf_handler+0x3a4/0x3ae [ 107.320112] [] handle_percpu_devid_irq+0x9e/0x1a0 [ 107.320131] [] generic_handle_domain_irq+0x28/0x36 [ 107.320148] [] riscv_intc_irq+0x36/0x4e [ 107.320166] [] handle_riscv_irq+0x54/0x86 [ 107.320189] [] do_irq+0x64/0x96 [ 107.320271] Code: 85a6 855e b097 ff7f 80e7 9220 b709 9002 4501 bbd9 (9002) 6097 [ 107.320585] ---[ end trace 0000000000000000 ]--- [ 107.320704] Kernel panic - not syncing: Fatal exception in interrupt [ 107.320775] SMP: stopping secondary CPUs [ 107.321219] Kernel Offset: 0x0 from 0xffffffff80000000 [ 107.333051] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]--- Fixes: 4905ec2fb7e6 ("RISC-V: Add sscofpmf extension support") Signed-off-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20231109082128.40777-1-alexghiti@rivosinc.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit ec9aedb2aa1ab7ac420c00b31f5edc5be15ec167 Author: Zhang Rui Date: Mon Jul 3 00:28:02 2023 +0800 x86/acpi: Ignore invalid x2APIC entries Currently, the kernel enumerates the possible CPUs by parsing both ACPI MADT Local APIC entries and x2APIC entries. So CPUs with "valid" APIC IDs, even if they have duplicated APIC IDs in Local APIC and x2APIC, are always enumerated. Below is what ACPI MADT Local APIC and x2APIC describes on an Ivebridge-EP system, [02Ch 0044 1] Subtable Type : 00 [Processor Local APIC] [02Fh 0047 1] Local Apic ID : 00 ... [164h 0356 1] Subtable Type : 00 [Processor Local APIC] [167h 0359 1] Local Apic ID : 39 [16Ch 0364 1] Subtable Type : 00 [Processor Local APIC] [16Fh 0367 1] Local Apic ID : FF ... [3ECh 1004 1] Subtable Type : 09 [Processor Local x2APIC] [3F0h 1008 4] Processor x2Apic ID : 00000000 ... [B5Ch 2908 1] Subtable Type : 09 [Processor Local x2APIC] [B60h 2912 4] Processor x2Apic ID : 00000077 As a result, kernel shows "smpboot: Allowing 168 CPUs, 120 hotplug CPUs". And this wastes significant amount of memory for the per-cpu data. Plus this also breaks https://lore.kernel.org/all/87edm36qqb.ffs@tglx/, because __max_logical_packages is over-estimated by the APIC IDs in the x2APIC entries. According to https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#processor-local-x2apic-structure: "[Compatibility note] On some legacy OSes, Logical processors with APIC ID values less than 255 (whether in XAPIC or X2APIC mode) must use the Processor Local APIC structure to convey their APIC information to OSPM, and those processors must be declared in the DSDT using the Processor() keyword. Logical processors with APIC ID values 255 and greater must use the Processor Local x2APIC structure and be declared using the Device() keyword." Therefore prevent the registration of x2APIC entries with an APIC ID less than 255 if the local APIC table enumerates valid APIC IDs. [ tglx: Simplify the logic ] Signed-off-by: Zhang Rui Signed-off-by: Thomas Gleixner Tested-by: Peter Zijlstra Link: https://lore.kernel.org/r/20230702162802.344176-1-rui.zhang@intel.com commit d3933152442b7f94419e9ea71835d71b620baf0e Author: Boris Burkov Date: Fri Nov 3 11:38:04 2023 -0700 btrfs: make OWNER_REF_KEY type value smallest among inline refs BTRFS_EXTENT_OWNER_REF_KEY is the type of simple quotas extent owner refs. This special inline ref goes in front of all other inline refs. In general, inline refs have a required sorted order s.t. type never decreases (among other requirements). This was recently reified into a tree-checker and fsck rule, which broke simple quotas. To be fair, though, in a sense, the new owner ref item had also violated that not yet fully enforced requirement. This fix brings the owner ref item into compliance with the requirement that inline ref type never decrease. btrfs/301 exercises this behavior and should pass again with this fix. Fixes: d9a620f77e33 ("btrfs: new inline ref storing owning subvol of data extents") Signed-off-by: Boris Burkov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 609d99379736aa6c5b0658654084198aa808035a Author: Filipe Manana Date: Mon Nov 6 20:17:37 2023 +0000 btrfs: fix qgroup record leaks when using simple quotas When using simple quotas we are not supposed to allocate qgroup records when adding delayed references. However we allocate them if either mode of quotas is enabled (the new simple one or the old one), but then we never free them because running the accounting, which frees the records, is only run when using the old quotas (at btrfs_qgroup_account_extents()), resulting in a memory leak of the records allocated when adding delayed references. Fix this by allocating the records only if the old quotas mode is enabled. Also fix btrfs_qgroup_trace_extent_nolock() to return 1 if the old quotas mode is not enabled - meaning the caller has to free the record. Fixes: 182940f4f4db ("btrfs: qgroup: add new quota mode for simple quotas") Reported-by: syzbot+d3ddc6dcc6386dea398b@syzkaller.appspotmail.com Link: https://lore.kernel.org/linux-btrfs/00000000000004769106097f9a34@google.com/ Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 6c8e69e4a702b072206f166111c003d704de15d9 Author: Filipe Manana Date: Fri Nov 3 12:26:25 2023 +0000 btrfs: fix race between accounting qgroup extents and removing a qgroup When doing qgroup accounting for an extent, we take the spinlock fs_info->qgroup_lock and then add qgroups to the local list (iterator) named "qgroups". These qgroups are found in the fs_info->qgroup_tree rbtree. After we're done, we unlock fs_info->qgroup_lock and then call qgroup_iterator_nested_clean(), which will iterate over all the qgroups added to the local list "qgroups" and then delete them from the list. Deleting a qgroup from the list can however result in a use-after-free if a qgroup remove operation happens after we unlock fs_info->qgroup_lock and before or while we are at qgroup_iterator_nested_clean(). Fix this by calling qgroup_iterator_nested_clean() while still holding the lock fs_info->qgroup_lock - we don't need it under the 'out' label since before taking the lock the "qgroups" list is always empty. This guarantees safety because btrfs_remove_qgroup() takes that lock before removing a qgroup from the rbtree fs_info->qgroup_tree. This was reported by syzbot with the following stack traces: BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0x2f/0x130 lib/list_debug.c:49 Read of size 8 at addr ffff888027e420b0 by task kworker/u4:3/48 CPU: 1 PID: 48 Comm: kworker/u4:3 Not tainted 6.6.0-syzkaller-10396-g4652b8e4f3ff #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Workqueue: btrfs-qgroup-rescan btrfs_work_helper Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x175/0x1b0 mm/kasan/report.c:588 __list_del_entry_valid_or_report+0x2f/0x130 lib/list_debug.c:49 __list_del_entry_valid include/linux/list.h:124 [inline] __list_del_entry include/linux/list.h:215 [inline] list_del_init include/linux/list.h:287 [inline] qgroup_iterator_nested_clean fs/btrfs/qgroup.c:2623 [inline] btrfs_qgroup_account_extent+0x18b/0x1150 fs/btrfs/qgroup.c:2883 qgroup_rescan_leaf fs/btrfs/qgroup.c:3543 [inline] btrfs_qgroup_rescan_worker+0x1078/0x1c60 fs/btrfs/qgroup.c:3604 btrfs_work_helper+0x37c/0xbd0 fs/btrfs/async-thread.c:315 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x90f/0x1400 kernel/workqueue.c:2703 worker_thread+0xa5f/0xff0 kernel/workqueue.c:2784 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Allocated by task 6355: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] btrfs_quota_enable+0xee9/0x2060 fs/btrfs/qgroup.c:1209 btrfs_ioctl_quota_ctl+0x143/0x190 fs/btrfs/ioctl.c:3705 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Freed by task 6355: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0x263/0x3a0 mm/slub.c:3822 btrfs_remove_qgroup+0x764/0x8c0 fs/btrfs/qgroup.c:1787 btrfs_ioctl_qgroup_create+0x185/0x1e0 fs/btrfs/ioctl.c:3811 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xad/0xc0 mm/kasan/generic.c:492 __call_rcu_common kernel/rcu/tree.c:2667 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:2781 kthread_worker_fn+0x4ba/0xa90 kernel/kthread.c:823 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 Second to last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xad/0xc0 mm/kasan/generic.c:492 __call_rcu_common kernel/rcu/tree.c:2667 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:2781 kthread_worker_fn+0x4ba/0xa90 kernel/kthread.c:823 kthread+0x2d3/0x370 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 The buggy address belongs to the object at ffff888027e42000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 176 bytes inside of freed 512-byte region [ffff888027e42000, ffff888027e42200) The buggy address belongs to the physical page: page:ffffea00009f9000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x27e40 head:ffffea00009f9000 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888012c41c80 ffffea0000a5ba00 dead000000000002 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4514, tgid 4514 (udevadm), ts 24598439480, free_ts 23755696267 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0x31db/0x3360 mm/page_alloc.c:3170 __alloc_pages+0x255/0x670 mm/page_alloc.c:4426 alloc_slab_page+0x6a/0x160 mm/slub.c:1870 allocate_slab mm/slub.c:2017 [inline] new_slab+0x84/0x2f0 mm/slub.c:2070 ___slab_alloc+0xc85/0x1310 mm/slub.c:3223 __slab_alloc mm/slub.c:3322 [inline] __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x19d/0x270 mm/slub.c:3517 kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1098 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:721 [inline] kernfs_fop_open+0x3e7/0xcc0 fs/kernfs/file.c:670 do_dentry_open+0x8fd/0x1590 fs/open.c:948 do_open fs/namei.c:3622 [inline] path_openat+0x2845/0x3280 fs/namei.c:3779 do_filp_open+0x234/0x490 fs/namei.c:3809 do_sys_openat2+0x13e/0x1d0 fs/open.c:1440 do_sys_open fs/open.c:1455 [inline] __do_sys_openat fs/open.c:1471 [inline] __se_sys_openat fs/open.c:1466 [inline] __x64_sys_openat+0x247/0x290 fs/open.c:1466 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x8c3/0x9f0 mm/page_alloc.c:2312 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2405 discard_slab mm/slub.c:2116 [inline] __unfreeze_partials+0x1dc/0x220 mm/slub.c:2655 put_cpu_partial+0x17b/0x250 mm/slub.c:2731 __slab_free+0x2b6/0x390 mm/slub.c:3679 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x75/0xe0 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook+0x67/0x3d0 mm/slab.h:762 slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x104/0x2c0 mm/slub.c:3502 getname_flags+0xbc/0x4f0 fs/namei.c:140 do_sys_openat2+0xd2/0x1d0 fs/open.c:1434 do_sys_open fs/open.c:1455 [inline] __do_sys_openat fs/open.c:1471 [inline] __se_sys_openat fs/open.c:1466 [inline] __x64_sys_openat+0x247/0x290 fs/open.c:1466 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Memory state around the buggy address: ffff888027e41f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888027e42000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888027e42080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888027e42100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888027e42180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb Reported-by: syzbot+e0b615318f8fcfc01ceb@syzkaller.appspotmail.com Fixes: dce28769a33a ("btrfs: qgroup: use qgroup_iterator_nested to in qgroup_update_refcnt()") CC: stable@vger.kernel.org # 6.6 Link: https://lore.kernel.org/linux-btrfs/00000000000091a5b2060936bf6d@google.com/ Reviewed-by: Josef Bacik Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 83b9dda8afa4e968d9cce253f390b01c0612a2a5 Author: Diogo Ivo Date: Tue Nov 7 12:00:36 2023 +0000 net: ti: icss-iep: fix setting counter value Currently icss_iep_set_counter() writes the upper 32-bits of the counter value to both the lower and upper counter registers, so fix this by writing the appropriate value to the lower register. Fixes: c1e0230eeaab ("net: ti: icss-iep: Add IEP driver") Signed-off-by: Diogo Ivo Link: https://lore.kernel.org/r/20231107120037.1513546-1-diogo.ivo@siemens.com Signed-off-by: Paolo Abeni commit 3e3ab468ebdfd79fb2c80f381b70b3815801988e Merge: 53b5fdb617859 a60a609b7f548 Author: Takashi Iwai Date: Thu Nov 9 12:37:03 2023 +0100 Merge tag 'asoc-fix-v6.7-merge-window-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: One more fix for the merge window One additional driver fix that came in during the merge window. commit f9a619eb603b6c8062e910cd994acc4b3ce032ba Merge: 05942f780ac6a c5e4ce9db635f Author: Palmer Dabbelt Date: Wed Nov 8 18:57:17 2023 -0800 Merge patch series "Linux RISC-V AIA Preparatory Series" These two ended up in the AIA series, but they're really independent improvements. * b4-shazam-merge: of: property: Add fw_devlink support for msi-parent RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs Link: https://lore.kernel.org/r/20231027154254.355853-1-apatel@ventanamicro.com Signed-off-by: Palmer Dabbelt commit c5e4ce9db635fef5ebffdfba1e7d80710474b176 Author: Anup Patel Date: Fri Oct 27 21:12:54 2023 +0530 of: property: Add fw_devlink support for msi-parent This allows fw_devlink to create device links between consumers of a MSI and the supplier of the MSI. Signed-off-by: Anup Patel Acked-by: Rob Herring Reviewed-by: Saravana Kannan Link: https://lore.kernel.org/r/20231027154254.355853-3-apatel@ventanamicro.com Signed-off-by: Palmer Dabbelt commit c4676f8dc1e12e68d6511f9ed89707fdad4c962c Author: Anup Patel Date: Fri Oct 27 21:12:53 2023 +0530 RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs The riscv_of_processor_hartid() used by riscv_of_parent_hartid() fails for HARTs disabled in the DT. This results in the following warning thrown by the RISC-V INTC driver for the E-core on SiFive boards: [ 0.000000] riscv-intc: unable to find hart id for /cpus/cpu@0/interrupt-controller The riscv_of_parent_hartid() is only expected to read the hartid from the DT so we directly call of_get_cpu_hwid() instead of calling riscv_of_processor_hartid(). Fixes: ad635e723e17 ("riscv: cpu: Add 64bit hartid support on RV64") Signed-off-by: Anup Patel Reviewed-by: Atish Patra Link: https://lore.kernel.org/r/20231027154254.355853-2-apatel@ventanamicro.com Signed-off-by: Palmer Dabbelt commit e439e4a62a8ea3c39d65c546de3af7d1c594077c Author: Neil Armstrong Date: Mon Oct 30 10:43:11 2023 +0100 scsi: ufs: qcom-ufs: dt-bindings: Document the SM8650 UFS Controller Document the UFS Controller on the SM8650 Platform. Reviewed-by: Alim Akhtar Reviewed-by: Manivannan Sadhasivam Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20231030-topic-sm8650-upstream-bindings-ufs-v3-1-a96364463fd5@linaro.org Reviewed-by: Krzysztof Kozlowski Signed-off-by: Martin K. Petersen commit 1bea2c3e6df8caf45d18384abfb707f47e9ff993 Author: Edward Adam Davis Date: Tue Nov 7 16:00:41 2023 +0800 ptp: fix corrupted list in ptp_open There is no lock protection when writing ptp->tsevqs in ptp_open() and ptp_release(), which can cause data corruption, use spin lock to avoid this issue. Moreover, ptp_release() should not be used to release the queue in ptp_read(), and it should be deleted altogether. Acked-by: Richard Cochran Reported-and-tested-by: syzbot+df3f3ef31f60781fa911@syzkaller.appspotmail.com Fixes: 8f5de6fb2453 ("ptp: support multiple timestamp event readers") Signed-off-by: Edward Adam Davis Link: https://lore.kernel.org/r/tencent_CD19564FFE8DA8A5918DFE92325D92DD8107@qq.com Signed-off-by: Jakub Kicinski commit b714ca2ccf6a90733f6ceb14abb6ce914f8832c3 Author: Edward Adam Davis Date: Tue Nov 7 16:00:40 2023 +0800 ptp: ptp_read should not release queue Firstly, queue is not the memory allocated in ptp_read; Secondly, other processes may block at ptp_read and wait for conditions to be met to perform read operations. Acked-by: Richard Cochran Reported-and-tested-by: syzbot+df3f3ef31f60781fa911@syzkaller.appspotmail.com Fixes: 8f5de6fb2453 ("ptp: support multiple timestamp event readers") Signed-off-by: Edward Adam Davis Link: https://lore.kernel.org/r/tencent_18747D76F1675A3C633772960237544AAA09@qq.com Signed-off-by: Jakub Kicinski commit 3b83486399a6a9feb9c681b74c21a227d48d7020 Author: Mike Christie Date: Mon Nov 6 17:13:04 2023 -0600 scsi: sd: Fix sshdr use in sd_suspend_common() If scsi_execute_cmd() returns < 0, it doesn't initialize the sshdr, so we shouldn't access the sshdr. If it returns 0, then the cmd executed successfully, so there is no need to check the sshdr. sd_sync_cache() will only access the sshdr if it's been setup because it calls scsi_status_is_check_condition() before accessing it. However, the sd_sync_cache() caller, sd_suspend_common(), does not check. sd_suspend_common() is only checking for ILLEGAL_REQUEST which it's using to determine if the command is supported. If it's not it just ignores the error. So to fix its sshdr use this patch just moves that check to sd_sync_cache() where it converts ILLEGAL_REQUEST to success/0. sd_suspend_common() was ignoring that error and sd_shutdown() doesn't check for errors so there will be no behavior changes. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20231106231304.5694-2-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 9b818a340c0024f8b8f36a5f8e8b4eea3afa9a77 Merge: f1a3b283f852c 68c51db3a16d2 Author: Jakub Kicinski Date: Wed Nov 8 18:43:52 2023 -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 2023-11-06 (ice) This series contains updates to ice driver only. Dave removes SR-IOV LAG attribute for only the interface being disabled to allow for proper unwinding of all interfaces. Michal Schmidt changes some LAG allocations from GFP_KERNEL to GFP_ATOMIC due to non-allowed sleeping. Aniruddha and Marcin fix redirection and drop rules for switchdev by properly setting and marking egress/ingress type. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ice: Fix VF-VF direction matching in drop rule in switchdev ice: Fix VF-VF filter rules in switchdev mode ice: lag: in RCU, use atomic allocation ice: Fix SRIOV LAG disable on non-compliant aggregate ==================== Link: https://lore.kernel.org/r/20231107004844.655549-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 037fbd3fcfbd99145f9310d93f6637012807cfd0 Author: Dan Carpenter Date: Mon Nov 6 17:05:04 2023 +0300 scsi: scsi_debug: Delete some bogus error checking Smatch complains that "dentry" is never initialized. These days everyone initializes all their stack variables to zero so this means that it will trigger a warning every time this function is run. Really, debugfs functions are not supposed to be checked for errors in normal code. For example, if we updated this code to check the correct variable then it would print a warning if CONFIG_DEBUGFS was disabled. We don't want that. Just delete the check. Fixes: f084fe52c640 ("scsi: scsi_debug: Add debugfs interface to fail target reset") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/c602c9ad-5e35-4e18-a47f-87ed956a9ec2@moroto.mountain Reviewed-by: Wenchao Hao Signed-off-by: Martin K. Petersen commit 860c3d03bbc3f17aef8600662c488f27fd093142 Author: Dan Carpenter Date: Mon Nov 6 17:04:33 2023 +0300 scsi: scsi_debug: Fix some bugs in sdebug_error_write() There are two bug in this code: 1) If count is zero, then it will lead to a NULL dereference. The kmalloc() will successfully allocate zero bytes and the test for "if (buf[0] == '-')" will read beyond the end of the zero size buffer and Oops. 2) The code does not ensure that the user's string is properly NUL terminated which could lead to a read overflow. Fixes: a9996d722b11 ("scsi: scsi_debug: Add interface to manage error injection for a single device") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/7733643d-e102-4581-8d29-769472011c97@moroto.mountain Reviewed-by: Wenchao Hao Signed-off-by: Martin K. Petersen commit 27900d7119c464b43cd9eac69c85884d17bae240 Author: Peter Wang Date: Mon Nov 6 15:51:17 2023 +0800 scsi: ufs: core: Fix racing issue between ufshcd_mcq_abort() and ISR If command timeout happens and cq complete IRQ is raised at the same time, ufshcd_mcq_abort clears lprb->cmd and a NULL pointer deref happens in the ISR. Error log: ufshcd_abort: Device abort task at tag 18 Unable to handle kernel NULL pointer dereference at virtual address 0000000000000108 pc : [0xffffffe27ef867ac] scsi_dma_unmap+0xc/0x44 lr : [0xffffffe27f1b898c] ufshcd_release_scsi_cmd+0x24/0x114 Fixes: f1304d442077 ("scsi: ufs: mcq: Added ufshcd_mcq_abort()") Cc: stable@vger.kernel.org Signed-off-by: Peter Wang Link: https://lore.kernel.org/r/20231106075117.8995-1-peter.wang@mediatek.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit defde5a50d91c74e1ce71a7f0bce7fb1ae311d84 Author: Naomi Chu Date: Thu Nov 2 13:24:24 2023 +0800 scsi: ufs: core: Expand MCQ queue slot to DeviceQueueDepth + 1 The UFSHCI 4.0 specification mandates that there should always be at least one empty slot in each queue for distinguishing between full and empty states. Enlarge 'hwq->max_entries' to 'DeviceQueueDepth + 1' to allow UFSHCI 4.0 controllers to fully utilize MCQ queue slots. Fixes: 4682abfae2eb ("scsi: ufs: core: mcq: Allocate memory for MCQ mode") Signed-off-by: Naomi Chu Link: https://lore.kernel.org/r/20231102052426.12006-2-naomi.chu@mediatek.com Reviewed-by: Stanley Chu Reviewed-by: Bart Van Assche Reviewed-by: Peter Wang Reviewed-by: Chun-Hung Signed-off-by: Martin K. Petersen commit 19597cad64d608aa8ac2f8aef50a50187a565223 Author: Quinn Tran Date: Mon Oct 30 12:19:12 2023 +0530 scsi: qla2xxx: Fix system crash due to bad pointer access User experiences system crash when running AER error injection. The perturbation causes the abort-all-I/O path to trigger. The driver assumes all I/O on this path is FCP only. If there is both NVMe & FCP traffic, a system crash happens. Add additional check to see if I/O is FCP or not before access. PID: 999019 TASK: ff35d769f24722c0 CPU: 53 COMMAND: "kworker/53:1" 0 [ff3f78b964847b58] machine_kexec at ffffffffae86973d 1 [ff3f78b964847ba8] __crash_kexec at ffffffffae9be29d 2 [ff3f78b964847c70] crash_kexec at ffffffffae9bf528 3 [ff3f78b964847c78] oops_end at ffffffffae8282ab 4 [ff3f78b964847c98] exc_page_fault at ffffffffaf2da502 5 [ff3f78b964847cc0] asm_exc_page_fault at ffffffffaf400b62 [exception RIP: qla2x00_abort_srb+444] RIP: ffffffffc07b5f8c RSP: ff3f78b964847d78 RFLAGS: 00010046 RAX: 0000000000000282 RBX: ff35d74a0195a200 RCX: ff35d76886fd03a0 RDX: 0000000000000001 RSI: ffffffffc07c5ec8 RDI: ff35d74a0195a200 RBP: ff35d76913d22080 R8: ff35d7694d103200 R9: ff35d7694d103200 R10: 0000000100000000 R11: ffffffffb05d6630 R12: 0000000000010000 R13: ff3f78b964847df8 R14: ff35d768d8754000 R15: ff35d768877248e0 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 6 [ff3f78b964847d70] qla2x00_abort_srb at ffffffffc07b5f84 [qla2xxx] 7 [ff3f78b964847de0] __qla2x00_abort_all_cmds at ffffffffc07b6238 [qla2xxx] 8 [ff3f78b964847e38] qla2x00_abort_all_cmds at ffffffffc07ba635 [qla2xxx] 9 [ff3f78b964847e58] qla2x00_terminate_rport_io at ffffffffc08145eb [qla2xxx] 10 [ff3f78b964847e70] fc_terminate_rport_io at ffffffffc045987e [scsi_transport_fc] 11 [ff3f78b964847e88] process_one_work at ffffffffae914f15 12 [ff3f78b964847ed0] worker_thread at ffffffffae9154c0 13 [ff3f78b964847f10] kthread at ffffffffae91c456 14 [ff3f78b964847f50] ret_from_fork at ffffffffae8036ef Cc: stable@vger.kernel.org Fixes: f45bca8c5052 ("scsi: qla2xxx: Fix double scsi_done for abort path") Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Link: https://lore.kernel.org/r/20231030064912.37912-1-njavali@marvell.com Signed-off-by: Martin K. Petersen commit f1a3b283f852c613fae004f87bbbacc8cef5a061 Author: Eric Dumazet Date: Tue Nov 7 16:04:40 2023 +0000 net_sched: sch_fq: better validate TCA_FQ_WEIGHTS and TCA_FQ_PRIOMAP syzbot was able to trigger the following report while providing too small TCA_FQ_WEIGHTS attribute [1] Fix is to use NLA_POLICY_EXACT_LEN() to ensure user space provided correct sizes. Apply the same fix to TCA_FQ_PRIOMAP. [1] BUG: KMSAN: uninit-value in fq_load_weights net/sched/sch_fq.c:960 [inline] BUG: KMSAN: uninit-value in fq_change+0x1348/0x2fe0 net/sched/sch_fq.c:1071 fq_load_weights net/sched/sch_fq.c:960 [inline] fq_change+0x1348/0x2fe0 net/sched/sch_fq.c:1071 fq_init+0x68e/0x780 net/sched/sch_fq.c:1159 qdisc_create+0x12f3/0x1be0 net/sched/sch_api.c:1326 tc_modify_qdisc+0x11ef/0x2c20 rtnetlink_rcv_msg+0x16a6/0x1840 net/core/rtnetlink.c:6558 netlink_rcv_skb+0x371/0x650 net/netlink/af_netlink.c:2545 rtnetlink_rcv+0x34/0x40 net/core/rtnetlink.c:6576 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0xf47/0x1250 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x1238/0x13d0 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0x9c2/0xd60 net/socket.c:2588 ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2642 __sys_sendmsg net/socket.c:2671 [inline] __do_sys_sendmsg net/socket.c:2680 [inline] __se_sys_sendmsg net/socket.c:2678 [inline] __x64_sys_sendmsg+0x307/0x490 net/socket.c:2678 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Uninit was created at: slab_post_alloc_hook+0x129/0xa70 mm/slab.h:768 slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x5e9/0xb10 mm/slub.c:3523 kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:560 __alloc_skb+0x318/0x740 net/core/skbuff.c:651 alloc_skb include/linux/skbuff.h:1286 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1214 [inline] netlink_sendmsg+0xb34/0x13d0 net/netlink/af_netlink.c:1885 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0x9c2/0xd60 net/socket.c:2588 ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2642 __sys_sendmsg net/socket.c:2671 [inline] __do_sys_sendmsg net/socket.c:2680 [inline] __se_sys_sendmsg net/socket.c:2678 [inline] __x64_sys_sendmsg+0x307/0x490 net/socket.c:2678 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b CPU: 1 PID: 5001 Comm: syz-executor300 Not tainted 6.6.0-syzkaller-12401-g8f6f76a6a29f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Fixes: 29f834aa326e ("net_sched: sch_fq: add 3 bands and WRR scheduling") Fixes: 49e7265fd098 ("net_sched: sch_fq: add TCA_FQ_WEIGHTS attribute") Reported-by: syzbot Signed-off-by: Eric Dumazet Acked-by: Jamal Hadi Salim Link: https://lore.kernel.org/r/20231107160440.1992526-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 09699f193555c0630b7d0fe52c90ba2c7eac639e Merge: 31356547e3316 aa54d846f3613 Author: Jakub Kicinski Date: Wed Nov 8 18:20:13 2023 -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 2023-11-06 (i40e) This series contains updates to i40e driver only. Ivan Vecera resolves a couple issues with devlink; removing a call to devlink_port_type_clear() and ensuring devlink port is unregistered after the net device. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: i40e: Fix devlink port unregistering i40e: Do not call devlink_port_type_clear() ==================== Link: https://lore.kernel.org/r/20231107003600.653796-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 31356547e3316829f15a98ecf9a2096cf3e228d2 Author: Jakub Kicinski Date: Tue Nov 7 18:03:05 2023 -0800 net: kcm: fill in MODULE_DESCRIPTION() W=1 builds now warn if module is built without a MODULE_DESCRIPTION(). Link: https://lore.kernel.org/r/20231108020305.537293-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 0613736e8ab91e7f338d4021a8b57b124dc49bd4 Merge: 942b8b38de3fd 80abbe8a82631 Author: Jakub Kicinski Date: Wed Nov 8 18:14:59 2023 -0800 Merge tag 'nf-23-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Add missing netfilter modules description to fix W=1, from Florian Westphal. 2) Fix catch-all element GC with timeout when use with the pipapo set backend, this remained broken since I tried to fix it this summer, then another attempt to fix it recently. 3) Add missing IPVS modules descriptions to fix W=1, also from Florian. 4) xt_recent allocated a too small buffer to store an IPv4-mapped IPv6 address which can be parsed by in6_pton(), from Maciej Zenczykowski. Broken for many releases. 5) Skip IPv4-mapped IPv6, IPv4-compat IPv6, site/link local scoped IPv6 addressses to set up IPv6 NAT redirect, also from Florian. This is broken since 2012. * tag 'nf-23-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nat: fix ipv6 nat redirect with mapped and scoped addresses netfilter: xt_recent: fix (increase) ipv6 literal buffer length ipvs: add missing module descriptions netfilter: nf_tables: remove catchall element in GC sync path netfilter: add missing module descriptions ==================== Link: https://lore.kernel.org/r/20231108155802.84617-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 942b8b38de3fd38de1476b2abca562e729caa03d Merge: 9bc64bd0cd765 8e1b802503bb6 Author: Jakub Kicinski Date: Wed Nov 8 17:56:13 2023 -0800 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2023-11-08 We've added 16 non-merge commits during the last 6 day(s) which contain a total of 30 files changed, 341 insertions(+), 130 deletions(-). The main changes are: 1) Fix a BPF verifier issue in precision tracking for BPF_ALU | BPF_TO_BE | BPF_END where the source register was incorrectly marked as precise, from Shung-Hsi Yu. 2) Fix a concurrency issue in bpf_timer where the former could still have been alive after an application releases or unpins the map, from Hou Tao. 3) Fix a BPF verifier issue where immediates are incorrectly cast to u32 before being spilled and therefore losing sign information, from Hao Sun. 4) Fix a misplaced BPF_TRACE_ITER in check_css_task_iter_allowlist which incorrectly compared bpf_prog_type with bpf_attach_type, from Chuyi Zhou. 5) Add __bpf_hook_{start,end} as well as __bpf_kfunc_{start,end}_defs macros, migrate all BPF-related __diag callsites over to it, and add a new __diag_ignore_all for -Wmissing-declarations to the macros to address recent build warnings, from Dave Marchevsky. 6) Fix broken BPF selftest build of xdp_hw_metadata test on architectures where char is not signed, from Björn Töpel. 7) Fix test_maps selftest to properly use LIBBPF_OPTS() macro to initialize the bpf_map_create_opts, from Andrii Nakryiko. 8) Fix bpffs selftest to avoid unmounting /sys/kernel/debug as it may have been mounted and used by other applications already, from Manu Bretelle. 9) Fix a build issue without CONFIG_CGROUPS wrt css_task open-coded iterators, from Matthieu Baerts. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: selftests/bpf: get trusted cgrp from bpf_iter__cgroup directly bpf: Let verifier consider {task,cgroup} is trusted in bpf_iter_reg selftests/bpf: Fix broken build where char is unsigned selftests/bpf: precision tracking test for BPF_NEG and BPF_END bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END selftests/bpf: Add test for using css_task iter in sleepable progs selftests/bpf: Add tests for css_task iter combining with cgroup iter bpf: Relax allowlist for css_task iter selftests/bpf: fix test_maps' use of bpf_map_create_opts bpf: Check map->usercnt after timer->timer is assigned bpf: Add __bpf_hook_{start,end} macros bpf: Add __bpf_kfunc_{start,end}_defs macros selftests/bpf: fix test_bpffs selftests/bpf: Add test for immediate spilled to stack bpf: Fix check_stack_write_fixed_off() to correctly spill imm bpf: fix compilation error without CGROUPS ==================== Link: https://lore.kernel.org/r/20231108132448.1970-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 9bc64bd0cd765f696fcd40fc98909b1f7c73b2ba Author: Vlad Buslov Date: Fri Nov 3 16:14:10 2023 +0100 net/sched: act_ct: Always fill offloading tuple iifidx Referenced commit doesn't always set iifidx when offloading the flow to hardware. Fix the following cases: - nf_conn_act_ct_ext_fill() is called before extension is created with nf_conn_act_ct_ext_add() in tcf_ct_act(). This can cause rule offload with unspecified iifidx when connection is offloaded after only single original-direction packet has been processed by tc data path. Always fill the new nf_conn_act_ct_ext instance after creating it in nf_conn_act_ct_ext_add(). - Offloading of unidirectional UDP NEW connections is now supported, but ct flow iifidx field is not updated when connection is promoted to bidirectional which can result reply-direction iifidx to be zero when refreshing the connection. Fill in the extension and update flow iifidx before calling flow_offload_refresh(). Fixes: 9795ded7f924 ("net/sched: act_ct: Fill offloading tuple iifidx") Reviewed-by: Paul Blakey Signed-off-by: Vlad Buslov Reviewed-by: Simon Horman Fixes: 6a9bad0069cf ("net/sched: act_ct: offload UDP NEW connections") Link: https://lore.kernel.org/r/20231103151410.764271-1-vladbu@nvidia.com Signed-off-by: Jakub Kicinski commit 1ee60356c2dca938362528404af95b8ef3e49b6a Author: Kees Cook Date: Sat Nov 4 13:43:37 2023 -0700 gcc-plugins: randstruct: Only warn about true flexible arrays The randstruct GCC plugin tried to discover "fake" flexible arrays to issue warnings about them in randomized structs. In the future LSM overhead reduction series, it would be legal to have a randomized struct with a 1-element array, and this should _not_ be treated as a flexible array, especially since commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3"). Disable the 0-sized and 1-element array discovery logic in the plugin, but keep the "true" flexible array check. Cc: KP Singh Cc: linux-hardening@vger.kernel.org Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311021532.iBwuZUZ0-lkp@intel.com/ Fixes: df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") Reviewed-by: Bill Wendling Acked-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20231104204334.work.160-kees@kernel.org Signed-off-by: Kees Cook commit 6bc986ab839c844e78a2333a02e55f02c9e57935 Merge: 67c0afb6424fe f003a717ae908 Author: Linus Torvalds Date: Wed Nov 8 13:39:16 2023 -0800 Merge tag 'nfs-for-6.7-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs Pull NFS client updates from Trond Myklebust: "Bugfixes: - SUNRPC: - re-probe the target RPC port after an ECONNRESET error - handle allocation errors from rpcb_call_async() - fix a use-after-free condition in rpc_pipefs - fix up various checks for timeouts - NFSv4.1: - Handle NFS4ERR_DELAY errors during session trunking - fix SP4_MACH_CRED protection for pnfs IO - NFSv4: - Ensure that we test all delegations when the server notifies us that it may have revoked some of them Features: - Allow knfsd processes to break out of NFS4ERR_DELAY loops when re-exporting NFSv4.x by setting appropriate values for the 'delay_retrans' module parameter - nfs: Convert nfs_symlink() to use a folio" * tag 'nfs-for-6.7-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: nfs: Convert nfs_symlink() to use a folio SUNRPC: Fix RPC client cleaned up the freed pipefs dentries NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO SUNRPC: Add an IS_ERR() check back to where it was NFSv4.1: fix handling NFS4ERR_DELAY when testing for session trunking nfs41: drop dependency between flexfiles layout driver and NFSv3 modules NFSv4: fairly test all delegations on a SEQ4_ revocation SUNRPC: SOFTCONN tasks should time out when on the sending list SUNRPC: Force close the socket when a hard error is reported SUNRPC: Don't skip timeout checks in call_connect_status() SUNRPC: ECONNRESET might require a rebind NFSv4/pnfs: Allow layoutget to return EAGAIN for softerr mounts NFSv4: Add a parameter to limit the number of retries after NFS4ERR_DELAY commit 67c0afb6424fee94238d9a32b97c407d0c97155e Merge: 34f763262743a 1373ca10ec04a Author: Linus Torvalds Date: Wed Nov 8 13:33:47 2023 -0800 Merge tag 'exfat-for-6.7-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat Pull exfat updates from Namjae Jeon: - Fix an issue that exfat timestamps are not updated caused by new timestamp accessor function patch * tag 'exfat-for-6.7-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat: exfat: fix ctime is not updated exfat: fix setting uninitialized time to ctime/atime commit 34f763262743aac0847b15711b0460ac6d6943d5 Merge: 6d795e2a7df53 14a537983b228 Author: Linus Torvalds Date: Wed Nov 8 13:22:16 2023 -0800 Merge tag 'xfs-6.7-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs updates from Chandan Babu: - Realtime device subsystem: - Cleanup usage of xfs_rtblock_t and xfs_fsblock_t data types - Replace open coded conversions between rt blocks and rt extents with calls to static inline helpers - Replace open coded realtime geometry compuation and macros with helper functions - CPU usage optimizations for realtime allocator - Misc bug fixes associated with Realtime device - Allow read operations to execute while an FICLONE ioctl is being serviced - Misc bug fixes: - Alert user when xfs_droplink() encounters an inode with a link count of zero - Handle the case where the allocator could return zero extents when servicing an fallocate request * tag 'xfs-6.7-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (40 commits) xfs: allow read IO and FICLONE to run concurrently xfs: handle nimaps=0 from xfs_bmapi_write in xfs_alloc_file_space xfs: introduce protection for drop nlink xfs: don't look for end of extent further than necessary in xfs_rtallocate_extent_near() xfs: don't try redundant allocations in xfs_rtallocate_extent_near() xfs: limit maxlen based on available space in xfs_rtallocate_extent_near() xfs: return maximum free size from xfs_rtany_summary() xfs: invert the realtime summary cache xfs: simplify rt bitmap/summary block accessor functions xfs: simplify xfs_rtbuf_get calling conventions xfs: cache last bitmap block in realtime allocator xfs: use accessor functions for summary info words xfs: consolidate realtime allocation arguments xfs: create helpers for rtsummary block/wordcount computations xfs: use accessor functions for bitmap words xfs: create helpers for rtbitmap block/wordcount computations xfs: create a helper to handle logging parts of rt bitmap/summary blocks xfs: convert rt summary macros to helpers xfs: convert open-coded xfs_rtword_t pointer accesses to helper xfs: remove XFS_BLOCKWSIZE and XFS_BLOCKWMASK macros ... commit 6d795e2a7df53afccb613cdd1fdc3035a95c8a1d Author: Konstantin Ryabitsev Date: Tue Nov 7 15:00:32 2023 -0500 MAINTAINERS: update lists.linuxfoundation.org migrated lists The mailman-2 system behind lists.linux[-]foundation.org is being retired, so the lists are being migrated to lists.linux.dev. Since both domains belong to LF and setting up proper forwards is possible, the old addresses will continue to work for a while, but all new patches should be sent to the new canonical addresses for each list. Signed-off-by: Konstantin Ryabitsev Signed-off-by: Linus Torvalds commit 1995a536702921f000acda2bed645f1fe0e7ee5b Merge: 90450a06162e6 02e790ee3077c Author: Linus Torvalds Date: Wed Nov 8 12:39:54 2023 -0800 Merge tag 's390-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull more s390 updates from Vasily Gorbik: - Get rid of s390 specific use of two PTEs per 4KB page with complex half-used pages tracking. Using full 4KB pages for 2KB PTEs increases the memory footprint of page tables but drastically simplify mm code, removing a common blocker for common code changes and adaptations - Simplify and rework "cmma no-dat" handling. This is a follow up for recent fixes which prevent potential incorrect guest TLB flushes - Add perf user stack unwinding as well as USER_STACKTRACE support for user space built with -mbackchain compile option - Add few missing conversion from tlb_remove_table to tlb_remove_ptdesc - Fix crypto cards vanishing in a secure execution environment due to asynchronous errors - Avoid reporting crypto cards or queues in check-stop state as online - Fix null-ptr deference in AP bus code triggered by early config change via SCLP - Couple of stability improvements in AP queue interrupt handling * tag 's390-6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/mm: make pte_free_tlb() similar to pXd_free_tlb() s390/mm: use compound page order to distinguish page tables s390/mm: use full 4KB page for 2KB PTE s390/cmma: rework no-dat handling s390/cmma: move arch_set_page_dat() to header file s390/cmma: move set_page_stable() and friends to header file s390/cmma: move parsing of cmma kernel parameter to early boot code s390/cmma: cleanup inline assemblies s390/ap: fix vanishing crypto cards in SE environment s390/zcrypt: don't report online if card or queue is in check-stop state s390: add USER_STACKTRACE support s390/perf: implement perf_callchain_user() s390/ap: fix AP bus crash on early config change callback invocation s390/ap: re-enable interrupt for AP queues s390/ap: rework to use irq info from ap queue status s390/mm: add missing conversion to use ptdescs commit b36995b8609a5a8fe5cf259a1ee768fcaed919f8 Author: Ondrej Mosnacek Date: Tue Oct 31 13:32:07 2023 +0100 lsm: fix default return value for inode_getsecctx -EOPNOTSUPP is the return value that implements a "no-op" hook, not 0. Without this fix having only the BPF LSM enabled (with no programs attached) can cause uninitialized variable reads in nfsd4_encode_fattr(), because the BPF hook returns 0 without touching the 'ctxlen' variable and the corresponding 'contextlen' variable in nfsd4_encode_fattr() remains uninitialized, yet being treated as valid based on the 0 return value. Cc: stable@vger.kernel.org Fixes: 98e828a0650f ("security: Refactor declaration of LSM hooks") Reported-by: Benjamin Coddington Signed-off-by: Ondrej Mosnacek Signed-off-by: Paul Moore commit 866d648059d5faf53f1cd960b43fe8365ad93ea7 Author: Ondrej Mosnacek Date: Tue Oct 31 13:32:06 2023 +0100 lsm: fix default return value for vm_enough_memory 1 is the return value that implements a "no-op" hook, not 0. Cc: stable@vger.kernel.org Fixes: 98e828a0650f ("security: Refactor declaration of LSM hooks") Signed-off-by: Ondrej Mosnacek Signed-off-by: Paul Moore commit 65120498aaf8d7320647a8b6d6de7db42e74ea52 Author: Arnd Bergmann Date: Wed Nov 8 13:58:27 2023 +0100 stackleak: add declarations for global functions With -Wmissing-prototypes enabled, the stackleak code produces a couple of warnings that have no declarations because they are only called from assembler: stackleak.c:127:25: error: no previous prototype for 'stackleak_erase' [-Werror=missing-prototypes] stackleak.c:139:25: error: no previous prototype for 'stackleak_erase_on_task_stack' [-Werror=missing-prototypes] stackleak.c:151:25: error: no previous prototype for 'stackleak_erase_off_task_stack' [-Werror=missing-prototypes] stackleak.c:159:49: error: no previous prototype for 'stackleak_track_stack' [-Werror=missing-prototypes] Add declarations to the stackleak header to shut up the warnings. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231108125843.3806765-7-arnd@kernel.org Signed-off-by: Kees Cook commit 7a934b5cc3f452df6f9a4903450fc103dee98ee8 Author: Ming Yen Hsieh Date: Mon Oct 30 15:17:34 2023 +0800 wifi: mt76: mt7921: fix 6GHz disabled by the missing default CLC config No matter CLC is enabled or disabled, the driver should initialize the default value 0xff for channel configuration of CLC. Otherwise, the zero value would disable channels. Reported-and-tested-by: Ben Greear Closes: https://lore.kernel.org/all/2fb78387-d226-3193-8ca7-90040561b9ad@candelatech.com/ Fixes: 09382d8f8641 ("wifi: mt76: mt7921: update the channel usage when the regd domain changed") Signed-off-by: Ming Yen Hsieh Signed-off-by: Deren Wu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/5a976ddf1f636b5cb809373501d3cfdc6d8de3e4.1698648737.git.deren.wu@mediatek.com commit 90450a06162e6c71ab813ea22a83196fe7cff4bc Merge: 447cec034b789 a80712b9cc7e5 Author: Linus Torvalds Date: Wed Nov 8 09:47:52 2023 -0800 Merge tag 'rcu-fixes-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks Pull RCU fixes from Frederic Weisbecker: - Fix a lock inversion between scheduler and RCU introduced in v6.2-rc4. The scenario could trigger on any user of RCU_NOCB (mostly Android but also nohz_full) - Fix PF_IDLE semantic changes introduced in v6.6-rc3 breaking some RCU-Tasks and RCU-Tasks-Trace expectations as to what exactly is an idle task. This resulted in potential spurious stalls and warnings. * tag 'rcu-fixes-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks: rcu/tasks-trace: Handle new PF_IDLE semantics rcu/tasks: Handle new PF_IDLE semantics rcu: Introduce rcu_cpu_online() rcu: Break rcu_node_0 --> &rq->__lock order commit 447cec034b7896f4b19dbfe3ce6c366ce7c7602a Merge: c1ef4df14ed1f e96c6b8f212a5 Author: Linus Torvalds Date: Wed Nov 8 09:40:13 2023 -0800 Merge tag 'memblock-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock Pull memblock update from Mike Rapoport: "Report failures when memblock_can_resize is not set. Numerous memblock reservations at early boot may exhaust static memblock.reserved array and it is unnoticed because most of the callers don't check memblock_reserve() return value. In this case the system will crash later, but the reason is hard to identify. Replace return of an error with panic() when memblock.reserved is exhausted before it can be resized" * tag 'memblock-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: memblock: report failures when memblock_can_resize is not set commit c1ef4df14ed1feb9b0f08508390a196a1bc530ce Merge: d46392bbf5c6c 23816724fdbd4 Author: Linus Torvalds Date: Wed Nov 8 09:28:38 2023 -0800 Merge tag 'kgdb-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux Pull kgdb updates from Daniel Thompson: "Just two patches for you this time! - During a panic, flush the console before entering kgdb. This makes things a little easier to comprehend, especially if an NMI backtrace was triggered on all CPUs just before we enter the panic routines - Correcting a couple of misleading (a.k.a. plain wrong) comments" * tag 'kgdb-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux: kdb: Corrects comment for kdballocenv kgdb: Flush console before entering kgdb on panic commit d46392bbf5c6ce594669f00b8177f0b34e983f90 Merge: 305230142ae06 e1c05b3bf80f8 Author: Linus Torvalds Date: Wed Nov 8 09:21:18 2023 -0800 Merge tag 'riscv-for-linus-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V updates from Palmer Dabbelt: - Support for cbo.zero in userspace - Support for CBOs on ACPI-based systems - A handful of improvements for the T-Head cache flushing ops - Support for software shadow call stacks - Various cleanups and fixes * tag 'riscv-for-linus-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (31 commits) RISC-V: hwprobe: Fix vDSO SIGSEGV riscv: configs: defconfig: Enable configs required for RZ/Five SoC riscv: errata: prefix T-Head mnemonics with th. riscv: put interrupt entries into .irqentry.text riscv: mm: Update the comment of CONFIG_PAGE_OFFSET riscv: Using TOOLCHAIN_HAS_ZIHINTPAUSE marco replace zihintpause riscv/mm: Fix the comment for swap pte format RISC-V: clarify the QEMU workaround in ISA parser riscv: correct pt_level name via pgtable_l5/4_enabled RISC-V: Provide pgtable_l5_enabled on rv32 clocksource: timer-riscv: Increase rating of clock_event_device for Sstc clocksource: timer-riscv: Don't enable/disable timer interrupt lkdtm: Fix CFI_BACKWARD on RISC-V riscv: Use separate IRQ shadow call stacks riscv: Implement Shadow Call Stack riscv: Move global pointer loading to a macro riscv: Deduplicate IRQ stack switching riscv: VMAP_STACK overflow detection thread-safe RISC-V: cacheflush: Initialize CBO variables on ACPI systems RISC-V: ACPI: RHCT: Add function to get CBO block sizes ... commit 31255e072b2e91f97645d792d25b2db744186dd1 Author: Rick Edgecombe Date: Tue Nov 7 10:22:51 2023 -0800 x86/shstk: Delay signal entry SSP write until after user accesses When a signal is being delivered, the kernel needs to make accesses to userspace. These accesses could encounter an access error, in which case the signal delivery itself will trigger a segfault. Usually this would result in the kernel killing the process. But in the case of a SEGV signal handler being configured, the failure of the first signal delivery will result in *another* signal getting delivered. The second signal may succeed if another thread has resolved the issue that triggered the segfault (i.e. a well timed mprotect()/mmap()), or the second signal is being delivered to another stack (i.e. an alt stack). On x86, in the non-shadow stack case, all the accesses to userspace are done before changes to the registers (in pt_regs). The operation is aborted when an access error occurs, so although there may be writes done for the first signal, control flow changes for the signal (regs->ip, regs->sp, etc) are not committed until all the accesses have already completed successfully. This means that the second signal will be delivered as if it happened at the time of the first signal. It will effectively replace the first aborted signal, overwriting the half-written frame of the aborted signal. So on sigreturn from the second signal, control flow will resume happily from the point of control flow where the original signal was delivered. The problem is, when shadow stack is active, the shadow stack SSP register/MSR is updated *before* some of the userspace accesses. This means if the earlier accesses succeed and the later ones fail, the second signal will not be delivered at the same spot on the shadow stack as the first one. So on sigreturn from the second signal, the SSP will be pointing to the wrong location on the shadow stack (off by a frame). Pengfei privately reported that while using a shadow stack enabled glibc, the “signal06” test in the LTP test-suite hung. It turns out it is testing the above described double signal scenario. When this test was compiled with shadow stack, the first signal pushed a shadow stack sigframe, then the second pushed another. When the second signal was handled, the SSP was at the first shadow stack signal frame instead of the original location. The test then got stuck as the #CP from the twice incremented SSP was incorrect and generated segfaults in a loop. Fix this by adjusting the SSP register only after any userspace accesses, such that there can be no failures after the SSP is adjusted. Do this by moving the shadow stack sigframe push logic to happen after all other userspace accesses. Note, sigreturn (as opposed to the signal delivery dealt with in this patch) has ordering behavior that could lead to similar failures. The ordering issues there extend beyond shadow stack to include the alt stack restoration. Fixing that would require cross-arch changes, and the ordering today does not cause any known test or apps breakages. So leave it as is, for now. [ dhansen: minor changelog/subject tweak ] Fixes: 05e36022c054 ("x86/shstk: Handle signals for shadow stack") Reported-by: Pengfei Xu Signed-off-by: Rick Edgecombe Signed-off-by: Dave Hansen Tested-by: Pengfei Xu Cc:stable@vger.kernel.org Link: https://lore.kernel.org/all/20231107182251.91276-1-rick.p.edgecombe%40intel.com Link: https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/signal/signal06.c commit 53b5fdb617859a68ab0f4961e524982297bcd7c7 Merge: f0d9da19d7de9 45f2f28bd498f Author: Takashi Iwai Date: Wed Nov 8 17:44:06 2023 +0100 Merge tag 'asoc-fix-v6.7-merge-window' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.7 A collection of fixes that have come in during the merge window, the majority of this is driver specific with one core fix for handling of DAPM clock widgets when a name prefix is specified for the card - the name should not be applied to the clock name we request from the clock API. commit 37d9486874ec925fa298bcd7ba628a9b206e812f Merge: 1b0a151c10a6d 706add13676da Author: Jens Axboe Date: Wed Nov 8 09:19:16 2023 -0700 Merge tag 'nvme-6.7-2023-11-8' of git://git.infradead.org/nvme into block-6.7 Pull NVMe fixes from Keith: "nvme fixes for 6.7 - nvme keyring config compile fixes (Hannes and Arnd) - fabrics keep alive fixes (Hannes) - tcp authentication fixes (Mark) - io_uring_cmd error handling fix (Anuj) - stale firmware attribute fix (Daniel) - tcp memory leak (Christophe) - cytpo library usage simplification (Eric)" * tag 'nvme-6.7-2023-11-8' of git://git.infradead.org/nvme: nvme: keyring: fix conditional compilation nvme: common: make keyring and auth separate modules nvme: start keep-alive after admin queue setup nvme-loop: always quiesce and cancel commands before destroying admin q nvme-tcp: avoid open-coding nvme_tcp_teardown_admin_queue() nvme-auth: always set valid seq_num in dhchap reply nvme-auth: add flag for bi-directional auth nvme-auth: auth success1 msg always includes resp nvme: fix error-handling for io_uring nvme-passthrough nvme: update firmware version after commit nvme-tcp: Fix a memory leak nvme-auth: use crypto_shash_tfm_digest() commit 706add13676da7ad213b65e92b94af5efc8c4131 Author: Hannes Reinecke Date: Thu Oct 26 15:08:04 2023 +0200 nvme: keyring: fix conditional compilation The keyring and auth functions can be called from both the host and the target side and are controlled by Kconfig options for each of the combinations, but the declarations are controlled by #ifdef checks on the shared Kconfig symbols. This leads to link failures in combinations where one of the frontends is built-in and the other one is a module, and the keyring code ends up in a module that is not reachable from the builtin code: ld: drivers/nvme/host/core.o: in function `nvme_core_exit': core.c:(.exit.text+0x4): undefined reference to `nvme_keyring_exit' ld: drivers/nvme/host/core.o: in function `nvme_core_init': core.c:(.init.text+0x94): undefined reference to `nvme_keyring_init ld: drivers/nvme/host/tcp.o: in function `nvme_tcp_setup_ctrl': tcp.c:(.text+0x4c18): undefined reference to `nvme_tls_psk_default' Address this by moving nvme_keyring_init()/nvme_keyring_exit() into module init/exit functions for the keyring module. Fixes: be8e82caa6859 ("nvme-tcp: enable TLS handshake upcall") Signed-off-by: Hannes Reinecke Cc: Arnd Bergmann Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 37de5a80e932f828c34abeaae63170d73930dca3 Author: David Howells Date: Mon Nov 6 14:40:11 2023 +0000 cifs: Fix encryption of cleared, but unset rq_iter data buffers Each smb_rqst struct contains two things: an array of kvecs (rq_iov) that contains the protocol data for an RPC op and an iterator (rq_iter) that contains the data payload of an RPC op. When an smb_rqst is allocated rq_iter is it always cleared, but we don't set it up unless we're going to use it. The functions that determines the size of the ciphertext buffer that will be needed to encrypt a request, cifs_get_num_sgs(), assumes that rq_iter is always initialised - and employs user_backed_iter() to check that the iterator isn't user-backed. This used to incidentally work, because ->user_backed was set to false because the iterator has never been initialised, but with commit f1b4cb650b9a0eeba206d8f069fcdc532bfbcd74[1] which changes user_backed_iter() to determine this based on the iterator type insted, a warning is now emitted: WARNING: CPU: 7 PID: 4584 at fs/smb/client/cifsglob.h:2165 smb2_get_aead_req+0x3fc/0x420 [cifs] ... RIP: 0010:smb2_get_aead_req+0x3fc/0x420 [cifs] ... crypt_message+0x33e/0x550 [cifs] smb3_init_transform_rq+0x27d/0x3f0 [cifs] smb_send_rqst+0xc7/0x160 [cifs] compound_send_recv+0x3ca/0x9f0 [cifs] cifs_send_recv+0x25/0x30 [cifs] SMB2_tcon+0x38a/0x820 [cifs] cifs_get_smb_ses+0x69c/0xee0 [cifs] cifs_mount_get_session+0x76/0x1d0 [cifs] dfs_mount_share+0x74/0x9d0 [cifs] cifs_mount+0x6e/0x2e0 [cifs] cifs_smb3_do_mount+0x143/0x300 [cifs] smb3_get_tree+0x15e/0x290 [cifs] vfs_get_tree+0x2d/0xe0 do_new_mount+0x124/0x340 __se_sys_mount+0x143/0x1a0 The problem is that rq_iter was never set, so the type is 0 (ie. ITER_UBUF) which causes user_backed_iter() to return true. The code doesn't malfunction because it checks the size of the iterator - which is 0. Fix cifs_get_num_sgs() to ignore rq_iter if its count is 0, thereby bypassing the warnings. It might be better to explicitly initialise rq_iter to a zero-length ITER_BVEC, say, as it can always be reinitialised later. Fixes: d08089f649a0 ("cifs: Change the I/O paths to use an iterator rather than a page list") Reported-by: Damian Tometzki Closes: https://lore.kernel.org/r/ZUfQo47uo0p2ZsYg@fedora.fritz.box/ Tested-by: Damian Tometzki Cc: stable@vger.kernel.org cc: Eric Biggers cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f1b4cb650b9a0eeba206d8f069fcdc532bfbcd74 [1] Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: David Howells Signed-off-by: Steve French commit 80abbe8a8263106fe45a4f293b92b5c74cc9cc8a Author: Florian Westphal Date: Wed Nov 8 13:18:53 2023 +0100 netfilter: nat: fix ipv6 nat redirect with mapped and scoped addresses The ipv6 redirect target was derived from the ipv4 one, i.e. its identical to a 'dnat' with the first (primary) address assigned to the network interface. The code has been moved around to make it usable from nf_tables too, but its still the same as it was back when this was added in 2012. IPv6, however, has different types of addresses, if the 'wrong' address comes first the redirection does not work. In Daniels case, the addresses are: inet6 ::ffff:192 ... inet6 2a01: ... ... so the function attempts to redirect to the mapped address. Add more checks before the address is deemed correct: 1. If the packets' daddr is scoped, search for a scoped address too 2. skip tentative addresses 3. skip mapped addresses Use the first address that appears to match our needs. Reported-by: Daniel Huhardeaux Closes: https://lore.kernel.org/netfilter/71be06b8-6aa0-4cf9-9e0b-e2839b01b22f@tootai.net/ Fixes: 115e23ac78f8 ("netfilter: ip6tables: add REDIRECT target") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 4bb49009e07175266e8c5ffbd5d4c4b241c97f19 Author: Douglas Anderson Date: Tue Nov 7 07:26:57 2023 -0800 Revert "arm64: smp: avoid NMI IPIs with broken MediaTek FW" This reverts commit a07a594152173a3dd3bdd12fc7d73dbba54cdbca. This is no longer needed after the patch ("arm64: Move MediaTek GIC quirk handling from irqchip to core). Signed-off-by: Douglas Anderson Acked-by: Mark Rutland Acked-by: Marc Zyngier Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231107072651.v2.2.I2c5fa192e767eb3ee233bc28eb60e2f8656c29a6@changeid Signed-off-by: Catalin Marinas commit 1d816ba168ea1999afe8cd2ccbe66b0e762bf455 Author: Douglas Anderson Date: Tue Nov 7 07:26:56 2023 -0800 arm64: Move MediaTek GIC quirk handling from irqchip to core In commit 44bd78dd2b88 ("irqchip/gic-v3: Disable pseudo NMIs on MediaTek devices w/ firmware issues") we added a method for detecting MediaTek devices with broken firmware and disabled pseudo-NMI. While that worked, it didn't address the problem at a deep enough level. The fundamental issue with this broken firmware is that it's not saving and restoring several important GICR registers. The current list is believed to be: * GICR_NUM_IPRIORITYR * GICR_CTLR * GICR_ISPENDR0 * GICR_ISACTIVER0 * GICR_NSACR Pseudo-NMI didn't work because it was the only thing (currently) in the kernel that relied on the broken registers, so forcing pseudo-NMI off was an effective fix. However, it could be observed that calling system_uses_irq_prio_masking() on these systems still returned "true". That caused confusion and led to the need for commit a07a59415217 ("arm64: smp: avoid NMI IPIs with broken MediaTek FW"). It's worried that the incorrect value returned by system_uses_irq_prio_masking() on these systems will continue to confuse future developers. Let's fix the issue a little more completely by disabling IRQ priorities at a deeper level in the kernel. Once we do this we can revert some of the other bits of code dealing with this quirk. This includes a partial revert of commit 44bd78dd2b88 ("irqchip/gic-v3: Disable pseudo NMIs on MediaTek devices w/ firmware issues"). This isn't a full revert because it leaves some of the changes to the "quirks" structure around in case future code needs it. Suggested-by: Mark Rutland Signed-off-by: Douglas Anderson Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Acked-by: Mark Rutland Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20231107072651.v2.1.Ide945748593cffd8ff0feb9ae22b795935b944d6@changeid Signed-off-by: Catalin Marinas commit 53c87e846e335e3c18044c397cc35178163d7827 Author: Petr Tesarik Date: Wed Nov 8 12:12:49 2023 +0100 swiotlb: fix out-of-bounds TLB allocations with CONFIG_SWIOTLB_DYNAMIC Limit the free list length to the size of the IO TLB. Transient pool can be smaller than IO_TLB_SEGSIZE, but the free list is initialized with the assumption that the total number of slots is a multiple of IO_TLB_SEGSIZE. As a result, swiotlb_area_find_slots() may allocate slots past the end of a transient IO TLB buffer. Reported-by: Niklas Schnelle Closes: https://lore.kernel.org/linux-iommu/104a8c8fedffd1ff8a2890983e2ec1c26bff6810.camel@linux.ibm.com/ Fixes: 79636caad361 ("swiotlb: if swiotlb is full, fall back to a transient memory pool") Cc: stable@vger.kernel.org Signed-off-by: Petr Tesarik Reviewed-by: Halil Pasic Signed-off-by: Christoph Hellwig commit 05942f780ac6a70e5859fc41d5700e2ca43c4867 Merge: 55e0bf49a0d03 311cd2f6e2538 Author: Palmer Dabbelt Date: Wed Nov 8 07:08:35 2023 -0800 Merge patch series "riscv: Fix set_memory_XX() and set_direct_map_XX()" Alexandre Ghiti says: Those 2 patches fix the set_memory_XX() and set_direct_map_XX() APIs, which in turn fix STRICT_KERNEL_RWX and memfd_secret(). Those were broken since the permission changes were not applied to the linear mapping because the linear mapping is mapped using hugepages and walk_page_range_novma() does not split such mappings. To fix that, patch 1 disables PGD mappings in the linear mapping as it is hard to propagate changes at this level in *all* the page tables, this has the downside of disabling PMD mapping for sv32 and PUD (1GB) mapping for sv39 in the linear mapping (for specific kernels, we could add a Kconfig to enable ARCH_HAS_SET_DIRECT_MAP and STRICT_KERNEL_RWX if needed, I'm pretty sure we'll discuss that). patch 2 implements the split of the huge linear mappings so that walk_page_range_novma() can properly apply the permissions. The whole split is protected with mmap_sem in write mode, but I'm wondering if that's enough, any opinion on that is appreciated. * b4-shazam-merge: riscv: Fix set_memory_XX() and set_direct_map_XX() by splitting huge linear mappings riscv: Don't use PGD entries for the linear mapping Link: https://lore.kernel.org/r/20231108075930.7157-1-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit 311cd2f6e25380cff0abc2884dc6a3d33bc9b5c3 Author: Alexandre Ghiti Date: Wed Nov 8 08:59:30 2023 +0100 riscv: Fix set_memory_XX() and set_direct_map_XX() by splitting huge linear mappings When STRICT_KERNEL_RWX is set, any change of permissions on any kernel mapping (vmalloc/modules/kernel text...etc) should be applied on its linear mapping alias. The problem is that the riscv kernel uses huge mappings for the linear mapping and walk_page_range_novma() does not split those huge mappings. So this patchset implements such split in order to apply fine-grained permissions on the linear mapping. Below is the difference before and after (the first PUD mapping is split into PTE/PMD mappings): Before: ---[ Linear mapping ]--- 0xffffaf8000080000-0xffffaf8000200000 0x0000000080080000 1536K PTE D A G . . W R V 0xffffaf8000200000-0xffffaf8077c00000 0x0000000080200000 1914M PMD D A G . . W R V 0xffffaf8077c00000-0xffffaf8078800000 0x00000000f7c00000 12M PMD D A G . . . R V 0xffffaf8078800000-0xffffaf8078c00000 0x00000000f8800000 4M PMD D A G . . W R V 0xffffaf8078c00000-0xffffaf8079200000 0x00000000f8c00000 6M PMD D A G . . . R V 0xffffaf8079200000-0xffffaf807e600000 0x00000000f9200000 84M PMD D A G . . W R V 0xffffaf807e600000-0xffffaf807e716000 0x00000000fe600000 1112K PTE D A G . . W R V 0xffffaf807e717000-0xffffaf807e71a000 0x00000000fe717000 12K PTE D A G . . W R V 0xffffaf807e71d000-0xffffaf807e71e000 0x00000000fe71d000 4K PTE D A G . . W R V 0xffffaf807e722000-0xffffaf807e800000 0x00000000fe722000 888K PTE D A G . . W R V 0xffffaf807e800000-0xffffaf807fe00000 0x00000000fe800000 22M PMD D A G . . W R V 0xffffaf807fe00000-0xffffaf807ff54000 0x00000000ffe00000 1360K PTE D A G . . W R V 0xffffaf807ff55000-0xffffaf8080000000 0x00000000fff55000 684K PTE D A G . . W R V 0xffffaf8080000000-0xffffaf8400000000 0x0000000100000000 14G PUD D A G . . W R V After: ---[ Linear mapping ]--- 0xffffaf8000080000-0xffffaf8000200000 0x0000000080080000 1536K PTE D A G . . W R V 0xffffaf8000200000-0xffffaf8077c00000 0x0000000080200000 1914M PMD D A G . . W R V 0xffffaf8077c00000-0xffffaf8078800000 0x00000000f7c00000 12M PMD D A G . . . R V 0xffffaf8078800000-0xffffaf8078a00000 0x00000000f8800000 2M PMD D A G . . W R V 0xffffaf8078a00000-0xffffaf8078c00000 0x00000000f8a00000 2M PTE D A G . . W R V 0xffffaf8078c00000-0xffffaf8079200000 0x00000000f8c00000 6M PMD D A G . . . R V 0xffffaf8079200000-0xffffaf807e600000 0x00000000f9200000 84M PMD D A G . . W R V 0xffffaf807e600000-0xffffaf807e716000 0x00000000fe600000 1112K PTE D A G . . W R V 0xffffaf807e717000-0xffffaf807e71a000 0x00000000fe717000 12K PTE D A G . . W R V 0xffffaf807e71d000-0xffffaf807e71e000 0x00000000fe71d000 4K PTE D A G . . W R V 0xffffaf807e722000-0xffffaf807e800000 0x00000000fe722000 888K PTE D A G . . W R V 0xffffaf807e800000-0xffffaf807fe00000 0x00000000fe800000 22M PMD D A G . . W R V 0xffffaf807fe00000-0xffffaf807ff54000 0x00000000ffe00000 1360K PTE D A G . . W R V 0xffffaf807ff55000-0xffffaf8080000000 0x00000000fff55000 684K PTE D A G . . W R V 0xffffaf8080000000-0xffffaf8080800000 0x0000000100000000 8M PMD D A G . . W R V 0xffffaf8080800000-0xffffaf8080af6000 0x0000000100800000 3032K PTE D A G . . W R V 0xffffaf8080af6000-0xffffaf8080af8000 0x0000000100af6000 8K PTE D A G . X . R V 0xffffaf8080af8000-0xffffaf8080c00000 0x0000000100af8000 1056K PTE D A G . . W R V 0xffffaf8080c00000-0xffffaf8081a00000 0x0000000100c00000 14M PMD D A G . . W R V 0xffffaf8081a00000-0xffffaf8081a40000 0x0000000101a00000 256K PTE D A G . . W R V 0xffffaf8081a40000-0xffffaf8081a44000 0x0000000101a40000 16K PTE D A G . X . R V 0xffffaf8081a44000-0xffffaf8081a52000 0x0000000101a44000 56K PTE D A G . . W R V 0xffffaf8081a52000-0xffffaf8081a54000 0x0000000101a52000 8K PTE D A G . X . R V ... 0xffffaf809e800000-0xffffaf80c0000000 0x000000011e800000 536M PMD D A G . . W R V 0xffffaf80c0000000-0xffffaf8400000000 0x0000000140000000 13G PUD D A G . . W R V Note that this also fixes memfd_secret() syscall which uses set_direct_map_invalid_noflush() and set_direct_map_default_noflush() to remove the pages from the linear mapping. Below is the kernel page table while a memfd_secret() syscall is running, you can see all the !valid page table entries in the linear mapping: ... 0xffffaf8082240000-0xffffaf8082241000 0x0000000102240000 4K PTE D A G . . W R . 0xffffaf8082241000-0xffffaf8082250000 0x0000000102241000 60K PTE D A G . . W R V 0xffffaf8082250000-0xffffaf8082252000 0x0000000102250000 8K PTE D A G . . W R . 0xffffaf8082252000-0xffffaf8082256000 0x0000000102252000 16K PTE D A G . . W R V 0xffffaf8082256000-0xffffaf8082257000 0x0000000102256000 4K PTE D A G . . W R . 0xffffaf8082257000-0xffffaf8082258000 0x0000000102257000 4K PTE D A G . . W R V 0xffffaf8082258000-0xffffaf8082259000 0x0000000102258000 4K PTE D A G . . W R . 0xffffaf8082259000-0xffffaf808225a000 0x0000000102259000 4K PTE D A G . . W R V 0xffffaf808225a000-0xffffaf808225c000 0x000000010225a000 8K PTE D A G . . W R . 0xffffaf808225c000-0xffffaf8082266000 0x000000010225c000 40K PTE D A G . . W R V 0xffffaf8082266000-0xffffaf8082268000 0x0000000102266000 8K PTE D A G . . W R . 0xffffaf8082268000-0xffffaf8082284000 0x0000000102268000 112K PTE D A G . . W R V 0xffffaf8082284000-0xffffaf8082288000 0x0000000102284000 16K PTE D A G . . W R . 0xffffaf8082288000-0xffffaf808229c000 0x0000000102288000 80K PTE D A G . . W R V 0xffffaf808229c000-0xffffaf80822a0000 0x000000010229c000 16K PTE D A G . . W R . 0xffffaf80822a0000-0xffffaf80822a5000 0x00000001022a0000 20K PTE D A G . . W R V 0xffffaf80822a5000-0xffffaf80822a6000 0x00000001022a5000 4K PTE D A G . . . R V 0xffffaf80822a6000-0xffffaf80822ab000 0x00000001022a6000 20K PTE D A G . . W R V ... And when the memfd_secret() fd is released, the linear mapping is correctly reset: ... 0xffffaf8082240000-0xffffaf80822a5000 0x0000000102240000 404K PTE D A G . . W R V 0xffffaf80822a5000-0xffffaf80822a6000 0x00000001022a5000 4K PTE D A G . . . R V 0xffffaf80822a6000-0xffffaf80822af000 0x00000001022a6000 36K PTE D A G . . W R V ... Signed-off-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20231108075930.7157-3-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit 629db01c64ff6cea08fc61b52426362689ef8618 Author: Alexandre Ghiti Date: Wed Nov 8 08:59:29 2023 +0100 riscv: Don't use PGD entries for the linear mapping Propagating changes at this level is cumbersome as we need to go through all the page tables when that happens (either when changing the permissions or when splitting the mapping). Note that this prevents the use of 4MB mapping for sv32 and 1GB mapping for sv39 in the linear mapping. Signed-off-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20231108075930.7157-2-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit a60a609b7f548050d1e84c7aa1c0a57d5d7e22d5 Author: David Lin Date: Wed Nov 8 14:16:59 2023 +0800 ASoC: nau8540: Add self recovery to improve capture quility Reading the peak data to detect abnormal data in the ADC channel. If abnormal data occurs, the driver takes recovery actions to refresh the ADC channel. Signed-off-by: David Lin Link: https://lore.kernel.org/r/20231108061658.1265065-1-CTLIN0@nuvoton.com Signed-off-by: Mark Brown commit 7b308feb4fd2d1c06919445c65c8fbf8e9fd1781 Author: Maciej Żenczykowski Date: Sun Nov 5 11:56:00 2023 -0800 netfilter: xt_recent: fix (increase) ipv6 literal buffer length in6_pton() supports 'low-32-bit dot-decimal representation' (this is useful with DNS64/NAT64 networks for example): # echo +aaaa:bbbb:cccc:dddd:eeee:ffff:1.2.3.4 > /proc/self/net/xt_recent/DEFAULT # cat /proc/self/net/xt_recent/DEFAULT src=aaaa:bbbb:cccc:dddd:eeee:ffff:0102:0304 ttl: 0 last_seen: 9733848829 oldest_pkt: 1 9733848829 but the provided buffer is too short: # echo +aaaa:bbbb:cccc:dddd:eeee:ffff:255.255.255.255 > /proc/self/net/xt_recent/DEFAULT -bash: echo: write error: Invalid argument Fixes: 079aa88fe717 ("netfilter: xt_recent: IPv6 support") Signed-off-by: Maciej Żenczykowski Reviewed-by: Simon Horman Signed-off-by: Pablo Neira Ayuso commit 17cd01e4d1e37e2c8051bbc0ca1ecca4cb001198 Author: Florian Westphal Date: Tue Nov 7 10:48:04 2023 +0100 ipvs: add missing module descriptions W=1 builds warn on missing MODULE_DESCRIPTION, add them. Signed-off-by: Florian Westphal Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso commit 93995bf4af2c5a99e2a87f0cd5ce547d31eb7630 Author: Pablo Neira Ayuso Date: Mon Nov 6 10:53:09 2023 +0100 netfilter: nf_tables: remove catchall element in GC sync path The expired catchall element is not deactivated and removed from GC sync path. This path holds mutex so just call nft_setelem_data_deactivate() and nft_setelem_catchall_remove() before queueing the GC work. Fixes: 4a9e12ea7e70 ("netfilter: nft_set_pipapo: call nft_trans_gc_queue_sync() in catchall GC") Reported-by: lonial con Signed-off-by: Pablo Neira Ayuso commit 94090b23f3f71c150359a2e0716855a4037ad45a Author: Florian Westphal Date: Sat Nov 4 11:14:05 2023 +0100 netfilter: add missing module descriptions W=1 builds warn on missing MODULE_DESCRIPTION, add them. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit caf3100810f4150677f4e1057aa0a29f8a2c3743 Author: Philipp Stanner Date: Mon Nov 6 10:16:00 2023 +0100 drivers/net/ppp: use standard array-copy-function In ppp_generic.c, memdup_user() is utilized to copy a userspace array. This is done without an overflow-check, which is, however, not critical because the multiplicands are an unsigned short and struct sock_filter, which is currently of size 8. Regardless, string.h now provides memdup_array_user(), a wrapper for copying userspace arrays in a standardized manner, which has the advantage of making it more obvious to the reader that an array is being copied. The wrapper additionally performs an obligatory overflow check, saving the reader the effort of analyzing the potential for overflow, and making the code a bit more robust in case of future changes to the multiplicands len * size. Replace memdup_user() with memdup_array_user(). Suggested-by: Dave Airlie Signed-off-by: Philipp Stanner Signed-off-by: David S. Miller commit bdba49cbba41f0bea54fc93529bbef4d6ceaa3cd Author: Bence Csókás Date: Mon Oct 30 17:19:10 2023 +0000 i2c: cp2615: Fix 'assignment to __be16' warning While the preamble field _is_ technically big-endian, its value is always 0x2A2A, which is the same in either endianness. However, to avoid generating a warning, we should still call `htons()` explicitly. Signed-off-by: Bence Csókás Signed-off-by: Wolfram Sang commit cc9c54232f04aef3a5d7f64a0ece7df00f1aaa3d Author: Philipp Stanner Date: Thu Nov 2 20:26:13 2023 +0100 i2c: dev: copy userspace array safely i2c-dev.c utilizes memdup_user() to copy a userspace array. This is done without an overflow check. Use the new wrapper memdup_array_user() to copy the array more safely. Suggested-by: Dave Airlie Signed-off-by: Philipp Stanner Signed-off-by: Wolfram Sang commit e8183fa10c25c7b3c20670bf2b430ddcc1ee03c0 Author: Tam Nguyen Date: Thu Nov 2 10:30:08 2023 +0700 i2c: designware: Disable TX_EMPTY irq while waiting for block length byte During SMBus block data read process, we have seen high interrupt rate because of TX_EMPTY irq status while waiting for block length byte (the first data byte after the address phase). The interrupt handler does not do anything because the internal state is kept as STATUS_WRITE_IN_PROGRESS. Hence, we should disable TX_EMPTY IRQ until I2C DesignWare receives first data byte from I2C device, then re-enable it to resume SMBus transaction. It takes 0.789 ms for host to receive data length from slave. Without the patch, i2c_dw_isr() is called 99 times by TX_EMPTY interrupt. And it is none after applying the patch. Cc: stable@vger.kernel.org Co-developed-by: Chuong Tran Signed-off-by: Chuong Tran Signed-off-by: Tam Nguyen Acked-by: Jarkko Nikula Reviewed-by: Serge Semin Signed-off-by: Wolfram Sang commit ba15a14399c262f91ce30c19fcbdc952262dd1be Author: Roman Bacik Date: Thu Aug 24 14:23:51 2023 -0700 i2c: iproc: handle invalid slave state Add the code to handle an invalid state when both bits S_RX_EVENT (indicating a transaction) and S_START_BUSY (indicating the end of transaction - transition of START_BUSY from 1 to 0) are set in the interrupt status register during a slave read. Signed-off-by: Roman Bacik Fixes: 1ca1b4516088 ("i2c: iproc: handle Master aborted error") Acked-by: Ray Jui Signed-off-by: Wolfram Sang commit f0d9da19d7de9e845e7a93a901c4b9658df6b492 Author: Kailang Yang Date: Wed Nov 8 15:45:00 2023 +0800 ALSA: hda/realtek: Add support dual speaker for Dell Dell new platform support dual speaker. But BIOS verb table only show one speaker. It will fill verb table for second speaker. Then bind with CS AMP model. Fixes: de90f5165b1c ("ALSA: hda/realtek: Add support for DELL Oasis 13/14/16 laptops") Signed-off-by: Kailang Yang Link: https://lore.kernel.org/r/4dd390a77bf742b8a518ac2deee00b0f@realtek.com Signed-off-by: Takashi Iwai commit 1d375d65466e5c8d7a9406826d80d475a22e8c6d Author: Hengqi Chen Date: Wed Nov 8 14:12:21 2023 +0800 selftests/bpf: Enable cpu v4 tests for LoongArch Enable the cpu v4 tests for LoongArch. Currently, we don't have BPF trampoline in LoongArch JIT, so the fentry test `test_ptr_struct_arg` still failed, will followup. Test result attached below: # ./test_progs -t verifier_sdiv,verifier_movsx,verifier_ldsx,verifier_gotol,verifier_bswap #316/1 verifier_bswap/BSWAP, 16:OK #316/2 verifier_bswap/BSWAP, 16 @unpriv:OK #316/3 verifier_bswap/BSWAP, 32:OK #316/4 verifier_bswap/BSWAP, 32 @unpriv:OK #316/5 verifier_bswap/BSWAP, 64:OK #316/6 verifier_bswap/BSWAP, 64 @unpriv:OK #316 verifier_bswap:OK #330/1 verifier_gotol/gotol, small_imm:OK #330/2 verifier_gotol/gotol, small_imm @unpriv:OK #330 verifier_gotol:OK #338/1 verifier_ldsx/LDSX, S8:OK #338/2 verifier_ldsx/LDSX, S8 @unpriv:OK #338/3 verifier_ldsx/LDSX, S16:OK #338/4 verifier_ldsx/LDSX, S16 @unpriv:OK #338/5 verifier_ldsx/LDSX, S32:OK #338/6 verifier_ldsx/LDSX, S32 @unpriv:OK #338/7 verifier_ldsx/LDSX, S8 range checking, privileged:OK #338/8 verifier_ldsx/LDSX, S16 range checking:OK #338/9 verifier_ldsx/LDSX, S16 range checking @unpriv:OK #338/10 verifier_ldsx/LDSX, S32 range checking:OK #338/11 verifier_ldsx/LDSX, S32 range checking @unpriv:OK #338 verifier_ldsx:OK #349/1 verifier_movsx/MOV32SX, S8:OK #349/2 verifier_movsx/MOV32SX, S8 @unpriv:OK #349/3 verifier_movsx/MOV32SX, S16:OK #349/4 verifier_movsx/MOV32SX, S16 @unpriv:OK #349/5 verifier_movsx/MOV64SX, S8:OK #349/6 verifier_movsx/MOV64SX, S8 @unpriv:OK #349/7 verifier_movsx/MOV64SX, S16:OK #349/8 verifier_movsx/MOV64SX, S16 @unpriv:OK #349/9 verifier_movsx/MOV64SX, S32:OK #349/10 verifier_movsx/MOV64SX, S32 @unpriv:OK #349/11 verifier_movsx/MOV32SX, S8, range_check:OK #349/12 verifier_movsx/MOV32SX, S8, range_check @unpriv:OK #349/13 verifier_movsx/MOV32SX, S16, range_check:OK #349/14 verifier_movsx/MOV32SX, S16, range_check @unpriv:OK #349/15 verifier_movsx/MOV32SX, S16, range_check 2:OK #349/16 verifier_movsx/MOV32SX, S16, range_check 2 @unpriv:OK #349/17 verifier_movsx/MOV64SX, S8, range_check:OK #349/18 verifier_movsx/MOV64SX, S8, range_check @unpriv:OK #349/19 verifier_movsx/MOV64SX, S16, range_check:OK #349/20 verifier_movsx/MOV64SX, S16, range_check @unpriv:OK #349/21 verifier_movsx/MOV64SX, S32, range_check:OK #349/22 verifier_movsx/MOV64SX, S32, range_check @unpriv:OK #349/23 verifier_movsx/MOV64SX, S16, R10 Sign Extension:OK #349/24 verifier_movsx/MOV64SX, S16, R10 Sign Extension @unpriv:OK #349 verifier_movsx:OK #361/1 verifier_sdiv/SDIV32, non-zero imm divisor, check 1:OK #361/2 verifier_sdiv/SDIV32, non-zero imm divisor, check 1 @unpriv:OK #361/3 verifier_sdiv/SDIV32, non-zero imm divisor, check 2:OK #361/4 verifier_sdiv/SDIV32, non-zero imm divisor, check 2 @unpriv:OK #361/5 verifier_sdiv/SDIV32, non-zero imm divisor, check 3:OK #361/6 verifier_sdiv/SDIV32, non-zero imm divisor, check 3 @unpriv:OK #361/7 verifier_sdiv/SDIV32, non-zero imm divisor, check 4:OK #361/8 verifier_sdiv/SDIV32, non-zero imm divisor, check 4 @unpriv:OK #361/9 verifier_sdiv/SDIV32, non-zero imm divisor, check 5:OK #361/10 verifier_sdiv/SDIV32, non-zero imm divisor, check 5 @unpriv:OK #361/11 verifier_sdiv/SDIV32, non-zero imm divisor, check 6:OK #361/12 verifier_sdiv/SDIV32, non-zero imm divisor, check 6 @unpriv:OK #361/13 verifier_sdiv/SDIV32, non-zero imm divisor, check 7:OK #361/14 verifier_sdiv/SDIV32, non-zero imm divisor, check 7 @unpriv:OK #361/15 verifier_sdiv/SDIV32, non-zero imm divisor, check 8:OK #361/16 verifier_sdiv/SDIV32, non-zero imm divisor, check 8 @unpriv:OK #361/17 verifier_sdiv/SDIV32, non-zero reg divisor, check 1:OK #361/18 verifier_sdiv/SDIV32, non-zero reg divisor, check 1 @unpriv:OK #361/19 verifier_sdiv/SDIV32, non-zero reg divisor, check 2:OK #361/20 verifier_sdiv/SDIV32, non-zero reg divisor, check 2 @unpriv:OK #361/21 verifier_sdiv/SDIV32, non-zero reg divisor, check 3:OK #361/22 verifier_sdiv/SDIV32, non-zero reg divisor, check 3 @unpriv:OK #361/23 verifier_sdiv/SDIV32, non-zero reg divisor, check 4:OK #361/24 verifier_sdiv/SDIV32, non-zero reg divisor, check 4 @unpriv:OK #361/25 verifier_sdiv/SDIV32, non-zero reg divisor, check 5:OK #361/26 verifier_sdiv/SDIV32, non-zero reg divisor, check 5 @unpriv:OK #361/27 verifier_sdiv/SDIV32, non-zero reg divisor, check 6:OK #361/28 verifier_sdiv/SDIV32, non-zero reg divisor, check 6 @unpriv:OK #361/29 verifier_sdiv/SDIV32, non-zero reg divisor, check 7:OK #361/30 verifier_sdiv/SDIV32, non-zero reg divisor, check 7 @unpriv:OK #361/31 verifier_sdiv/SDIV32, non-zero reg divisor, check 8:OK #361/32 verifier_sdiv/SDIV32, non-zero reg divisor, check 8 @unpriv:OK #361/33 verifier_sdiv/SDIV64, non-zero imm divisor, check 1:OK #361/34 verifier_sdiv/SDIV64, non-zero imm divisor, check 1 @unpriv:OK #361/35 verifier_sdiv/SDIV64, non-zero imm divisor, check 2:OK #361/36 verifier_sdiv/SDIV64, non-zero imm divisor, check 2 @unpriv:OK #361/37 verifier_sdiv/SDIV64, non-zero imm divisor, check 3:OK #361/38 verifier_sdiv/SDIV64, non-zero imm divisor, check 3 @unpriv:OK #361/39 verifier_sdiv/SDIV64, non-zero imm divisor, check 4:OK #361/40 verifier_sdiv/SDIV64, non-zero imm divisor, check 4 @unpriv:OK #361/41 verifier_sdiv/SDIV64, non-zero imm divisor, check 5:OK #361/42 verifier_sdiv/SDIV64, non-zero imm divisor, check 5 @unpriv:OK #361/43 verifier_sdiv/SDIV64, non-zero imm divisor, check 6:OK #361/44 verifier_sdiv/SDIV64, non-zero imm divisor, check 6 @unpriv:OK #361/45 verifier_sdiv/SDIV64, non-zero reg divisor, check 1:OK #361/46 verifier_sdiv/SDIV64, non-zero reg divisor, check 1 @unpriv:OK #361/47 verifier_sdiv/SDIV64, non-zero reg divisor, check 2:OK #361/48 verifier_sdiv/SDIV64, non-zero reg divisor, check 2 @unpriv:OK #361/49 verifier_sdiv/SDIV64, non-zero reg divisor, check 3:OK #361/50 verifier_sdiv/SDIV64, non-zero reg divisor, check 3 @unpriv:OK #361/51 verifier_sdiv/SDIV64, non-zero reg divisor, check 4:OK #361/52 verifier_sdiv/SDIV64, non-zero reg divisor, check 4 @unpriv:OK #361/53 verifier_sdiv/SDIV64, non-zero reg divisor, check 5:OK #361/54 verifier_sdiv/SDIV64, non-zero reg divisor, check 5 @unpriv:OK #361/55 verifier_sdiv/SDIV64, non-zero reg divisor, check 6:OK #361/56 verifier_sdiv/SDIV64, non-zero reg divisor, check 6 @unpriv:OK #361/57 verifier_sdiv/SMOD32, non-zero imm divisor, check 1:OK #361/58 verifier_sdiv/SMOD32, non-zero imm divisor, check 1 @unpriv:OK #361/59 verifier_sdiv/SMOD32, non-zero imm divisor, check 2:OK #361/60 verifier_sdiv/SMOD32, non-zero imm divisor, check 2 @unpriv:OK #361/61 verifier_sdiv/SMOD32, non-zero imm divisor, check 3:OK #361/62 verifier_sdiv/SMOD32, non-zero imm divisor, check 3 @unpriv:OK #361/63 verifier_sdiv/SMOD32, non-zero imm divisor, check 4:OK #361/64 verifier_sdiv/SMOD32, non-zero imm divisor, check 4 @unpriv:OK #361/65 verifier_sdiv/SMOD32, non-zero imm divisor, check 5:OK #361/66 verifier_sdiv/SMOD32, non-zero imm divisor, check 5 @unpriv:OK #361/67 verifier_sdiv/SMOD32, non-zero imm divisor, check 6:OK #361/68 verifier_sdiv/SMOD32, non-zero imm divisor, check 6 @unpriv:OK #361/69 verifier_sdiv/SMOD32, non-zero reg divisor, check 1:OK #361/70 verifier_sdiv/SMOD32, non-zero reg divisor, check 1 @unpriv:OK #361/71 verifier_sdiv/SMOD32, non-zero reg divisor, check 2:OK #361/72 verifier_sdiv/SMOD32, non-zero reg divisor, check 2 @unpriv:OK #361/73 verifier_sdiv/SMOD32, non-zero reg divisor, check 3:OK #361/74 verifier_sdiv/SMOD32, non-zero reg divisor, check 3 @unpriv:OK #361/75 verifier_sdiv/SMOD32, non-zero reg divisor, check 4:OK #361/76 verifier_sdiv/SMOD32, non-zero reg divisor, check 4 @unpriv:OK #361/77 verifier_sdiv/SMOD32, non-zero reg divisor, check 5:OK #361/78 verifier_sdiv/SMOD32, non-zero reg divisor, check 5 @unpriv:OK #361/79 verifier_sdiv/SMOD32, non-zero reg divisor, check 6:OK #361/80 verifier_sdiv/SMOD32, non-zero reg divisor, check 6 @unpriv:OK #361/81 verifier_sdiv/SMOD64, non-zero imm divisor, check 1:OK #361/82 verifier_sdiv/SMOD64, non-zero imm divisor, check 1 @unpriv:OK #361/83 verifier_sdiv/SMOD64, non-zero imm divisor, check 2:OK #361/84 verifier_sdiv/SMOD64, non-zero imm divisor, check 2 @unpriv:OK #361/85 verifier_sdiv/SMOD64, non-zero imm divisor, check 3:OK #361/86 verifier_sdiv/SMOD64, non-zero imm divisor, check 3 @unpriv:OK #361/87 verifier_sdiv/SMOD64, non-zero imm divisor, check 4:OK #361/88 verifier_sdiv/SMOD64, non-zero imm divisor, check 4 @unpriv:OK #361/89 verifier_sdiv/SMOD64, non-zero imm divisor, check 5:OK #361/90 verifier_sdiv/SMOD64, non-zero imm divisor, check 5 @unpriv:OK #361/91 verifier_sdiv/SMOD64, non-zero imm divisor, check 6:OK #361/92 verifier_sdiv/SMOD64, non-zero imm divisor, check 6 @unpriv:OK #361/93 verifier_sdiv/SMOD64, non-zero imm divisor, check 7:OK #361/94 verifier_sdiv/SMOD64, non-zero imm divisor, check 7 @unpriv:OK #361/95 verifier_sdiv/SMOD64, non-zero imm divisor, check 8:OK #361/96 verifier_sdiv/SMOD64, non-zero imm divisor, check 8 @unpriv:OK #361/97 verifier_sdiv/SMOD64, non-zero reg divisor, check 1:OK #361/98 verifier_sdiv/SMOD64, non-zero reg divisor, check 1 @unpriv:OK #361/99 verifier_sdiv/SMOD64, non-zero reg divisor, check 2:OK #361/100 verifier_sdiv/SMOD64, non-zero reg divisor, check 2 @unpriv:OK #361/101 verifier_sdiv/SMOD64, non-zero reg divisor, check 3:OK #361/102 verifier_sdiv/SMOD64, non-zero reg divisor, check 3 @unpriv:OK #361/103 verifier_sdiv/SMOD64, non-zero reg divisor, check 4:OK #361/104 verifier_sdiv/SMOD64, non-zero reg divisor, check 4 @unpriv:OK #361/105 verifier_sdiv/SMOD64, non-zero reg divisor, check 5:OK #361/106 verifier_sdiv/SMOD64, non-zero reg divisor, check 5 @unpriv:OK #361/107 verifier_sdiv/SMOD64, non-zero reg divisor, check 6:OK #361/108 verifier_sdiv/SMOD64, non-zero reg divisor, check 6 @unpriv:OK #361/109 verifier_sdiv/SMOD64, non-zero reg divisor, check 7:OK #361/110 verifier_sdiv/SMOD64, non-zero reg divisor, check 7 @unpriv:OK #361/111 verifier_sdiv/SMOD64, non-zero reg divisor, check 8:OK #361/112 verifier_sdiv/SMOD64, non-zero reg divisor, check 8 @unpriv:OK #361/113 verifier_sdiv/SDIV32, zero divisor:OK #361/114 verifier_sdiv/SDIV32, zero divisor @unpriv:OK #361/115 verifier_sdiv/SDIV64, zero divisor:OK #361/116 verifier_sdiv/SDIV64, zero divisor @unpriv:OK #361/117 verifier_sdiv/SMOD32, zero divisor:OK #361/118 verifier_sdiv/SMOD32, zero divisor @unpriv:OK #361/119 verifier_sdiv/SMOD64, zero divisor:OK #361/120 verifier_sdiv/SMOD64, zero divisor @unpriv:OK #361 verifier_sdiv:OK Summary: 5/163 PASSED, 0 SKIPPED, 0 FAILED # ./test_progs -t ldsx_insn test_map_val_and_probed_memory:PASS:test_ldsx_insn__open 0 nsec test_map_val_and_probed_memory:PASS:test_ldsx_insn__load 0 nsec libbpf: prog 'test_ptr_struct_arg': failed to attach: ERROR: strerror_r(-524)=22 libbpf: prog 'test_ptr_struct_arg': failed to auto-attach: -524 test_map_val_and_probed_memory:FAIL:test_ldsx_insn__attach unexpected error: -524 (errno 524) #116/1 ldsx_insn/map_val and probed_memory:FAIL #116/2 ldsx_insn/ctx_member_sign_ext:OK #116/3 ldsx_insn/ctx_member_narrow_sign_ext:OK #116 ldsx_insn:FAIL All error logs: test_map_val_and_probed_memory:PASS:test_ldsx_insn__open 0 nsec test_map_val_and_probed_memory:PASS:test_ldsx_insn__load 0 nsec libbpf: prog 'test_ptr_struct_arg': failed to attach: ERROR: strerror_r(-524)=22 libbpf: prog 'test_ptr_struct_arg': failed to auto-attach: -524 test_map_val_and_probed_memory:FAIL:test_ldsx_insn__attach unexpected error: -524 (errno 524) #116/1 ldsx_insn/map_val and probed_memory:FAIL #116 ldsx_insn:FAIL Summary: 0/2 PASSED, 0 SKIPPED, 1 FAILED Signed-off-by: Hengqi Chen Signed-off-by: Huacai Chen commit 7b6b13d32965ad7f1eb889d1a7058868a88eb29f Author: Hengqi Chen Date: Wed Nov 8 14:12:21 2023 +0800 LoongArch: BPF: Support signed mod instructions Add support for signed mod instructions. Signed-off-by: Hengqi Chen Signed-off-by: Huacai Chen commit 2425c9e002d2a1fdca34261b2fa6713eafef2163 Author: Hengqi Chen Date: Wed Nov 8 14:12:21 2023 +0800 LoongArch: BPF: Support signed div instructions Add support for signed div instructions. Signed-off-by: Hengqi Chen Signed-off-by: Huacai Chen commit 9ddd2b8d1a8b566195c196fe4249d04cd75cc73c Author: Hengqi Chen Date: Wed Nov 8 14:12:16 2023 +0800 LoongArch: BPF: Support 32-bit offset jmp instructions Add support for 32-bit offset jmp instruction. Currently, we use b instruction which supports range within ±128MB for such jumps. This should be large enough for BPF progs. Signed-off-by: Hengqi Chen Signed-off-by: Huacai Chen commit 4ebf9216e7dff0b38e350007da3b03afb15c816b Author: Hengqi Chen Date: Wed Nov 8 14:12:16 2023 +0800 LoongArch: BPF: Support unconditional bswap instructions Add support for unconditional bswap instruction. Since LoongArch is always little-endian, just treat unconditional bswap the same as big- endian conversion. Signed-off-by: Hengqi Chen Signed-off-by: Huacai Chen commit f48012f161508c743e1b39c3521a2b285d19c6aa Author: Hengqi Chen Date: Wed Nov 8 14:12:16 2023 +0800 LoongArch: BPF: Support sign-extension mov instructions Add support for sign-extension mov instructions. Signed-off-by: Hengqi Chen Signed-off-by: Huacai Chen commit 7111afe8fb5f15e11b8eff90d7aed1c58e3b1167 Author: Hengqi Chen Date: Wed Nov 8 14:12:16 2023 +0800 LoongArch: BPF: Support sign-extension load instructions Add support for sign-extension load instructions. Signed-off-by: Hengqi Chen Signed-off-by: Huacai Chen commit add28024405ed600afaa02749989d4fd119f9057 Author: Hengqi Chen Date: Wed Nov 8 14:12:15 2023 +0800 LoongArch: Add more instruction opcodes and emit_* helpers This patch adds more instruction opcodes and their corresponding emit_* helpers which will be used in later patches. Signed-off-by: Hengqi Chen Signed-off-by: Huacai Chen commit a2ccf46333d7b2cf9658f0d82ac74097c1542fae Author: Huacai Chen Date: Wed Nov 8 14:12:15 2023 +0800 LoongArch/smp: Call rcutree_report_cpu_starting() earlier rcutree_report_cpu_starting() must be called before cpu_probe() to avoid the following lockdep splat that triggered by calling __alloc_pages() when CONFIG_PROVE_RCU_LIST=y: ============================= WARNING: suspicious RCU usage 6.6.0+ #980 Not tainted ----------------------------- kernel/locking/lockdep.c:3761 RCU-list traversed in non-reader section!! other info that might help us debug this: RCU used illegally from offline CPU! rcu_scheduler_active = 1, debug_locks = 1 1 lock held by swapper/1/0: #0: 900000000c82ef98 (&pcp->lock){+.+.}-{2:2}, at: get_page_from_freelist+0x894/0x1790 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.6.0+ #980 Stack : 0000000000000001 9000000004f79508 9000000004893670 9000000100310000 90000001003137d0 0000000000000000 90000001003137d8 9000000004f79508 0000000000000000 0000000000000001 0000000000000000 90000000048a3384 203a656d616e2065 ca43677b3687e616 90000001002c3480 0000000000000008 000000000000009d 0000000000000000 0000000000000001 80000000ffffe0b8 000000000000000d 0000000000000033 0000000007ec0000 13bbf50562dad831 9000000005140748 0000000000000000 9000000004f79508 0000000000000004 0000000000000000 9000000005140748 90000001002bad40 0000000000000000 90000001002ba400 0000000000000000 9000000003573ec8 0000000000000000 00000000000000b0 0000000000000004 0000000000000000 0000000000070000 ... Call Trace: [<9000000003573ec8>] show_stack+0x38/0x150 [<9000000004893670>] dump_stack_lvl+0x74/0xa8 [<900000000360d2bc>] lockdep_rcu_suspicious+0x14c/0x190 [<900000000361235c>] __lock_acquire+0xd0c/0x2740 [<90000000036146f4>] lock_acquire+0x104/0x2c0 [<90000000048a955c>] _raw_spin_lock_irqsave+0x5c/0x90 [<900000000381cd5c>] rmqueue_bulk+0x6c/0x950 [<900000000381fc0c>] get_page_from_freelist+0xd4c/0x1790 [<9000000003821c6c>] __alloc_pages+0x1bc/0x3e0 [<9000000003583b40>] tlb_init+0x150/0x2a0 [<90000000035742a0>] per_cpu_trap_init+0xf0/0x110 [<90000000035712fc>] cpu_probe+0x3dc/0x7a0 [<900000000357ed20>] start_secondary+0x40/0xb0 [<9000000004897138>] smpboot_entry+0x54/0x58 raw_smp_processor_id() is required in order to avoid calling into lockdep before RCU has declared the CPU to be watched for readers. See also commit 29368e093921 ("x86/smpboot: Move rcu_cpu_starting() earlier"), commit de5d9dae150c ("s390/smp: move rcu_cpu_starting() earlier") and commit 99f070b62322 ("powerpc/smp: Call rcu_cpu_starting() earlier"). Signed-off-by: Huacai Chen commit affef66b65889a0ea0060e13e5f7fe569897d787 Author: WANG Rui Date: Wed Nov 8 14:12:15 2023 +0800 LoongArch: Relax memory ordering for atomic operations This patch relaxes the implementation while satisfying the memory ordering requirements for atomic operations, which will help improve performance on LA664+. Unixbench with full threads (8) before after Dhrystone 2 using register variables 203910714.2 203909539.8 0.00% Double-Precision Whetstone 37930.9 37931 0.00% Execl Throughput 29431.5 29545.8 0.39% File Copy 1024 bufsize 2000 maxblocks 6645759.5 6676320 0.46% File Copy 256 bufsize 500 maxblocks 2138772.4 2144182.4 0.25% File Copy 4096 bufsize 8000 maxblocks 11640698.4 11602703 -0.33% Pipe Throughput 8849077.7 8917009.4 0.77% Pipe-based Context Switching 1255108.5 1287277.3 2.56% Process Creation 50825.9 50442.1 -0.76% Shell Scripts (1 concurrent) 25795.8 25942.3 0.57% Shell Scripts (8 concurrent) 3812.6 3835.2 0.59% System Call Overhead 9248212.6 9353348.6 1.14% ======= System Benchmarks Index Score 8076.6 8114.4 0.47% Signed-off-by: WANG Rui Signed-off-by: Huacai Chen commit 71945968d8b128c955204baa33ec03bdd91bdc26 Author: Nathan Chancellor Date: Wed Nov 8 14:12:15 2023 +0800 LoongArch: Mark __percpu functions as always inline A recent change to the optimization pipeline in LLVM reveals some fragility around the inlining of LoongArch's __percpu functions, which manifests as a BUILD_BUG() failure: In file included from kernel/sched/build_policy.c:17: In file included from include/linux/sched/cputime.h:5: In file included from include/linux/sched/signal.h:5: In file included from include/linux/rculist.h:11: In file included from include/linux/rcupdate.h:26: In file included from include/linux/irqflags.h:18: arch/loongarch/include/asm/percpu.h:97:3: error: call to '__compiletime_assert_51' declared with 'error' attribute: BUILD_BUG failed 97 | BUILD_BUG(); | ^ include/linux/build_bug.h:59:21: note: expanded from macro 'BUILD_BUG' 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") | ^ include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG' 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) | ^ include/linux/compiler_types.h:425:2: note: expanded from macro 'compiletime_assert' 425 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ include/linux/compiler_types.h:413:2: note: expanded from macro '_compiletime_assert' 413 | __compiletime_assert(condition, msg, prefix, suffix) | ^ include/linux/compiler_types.h:406:4: note: expanded from macro '__compiletime_assert' 406 | prefix ## suffix(); \ | ^ :86:1: note: expanded from here 86 | __compiletime_assert_51 | ^ 1 error generated. If these functions are not inlined (which the compiler is free to do even with functions marked with the standard 'inline' keyword), the BUILD_BUG() in the default case cannot be eliminated since the compiler cannot prove it is never used, resulting in a build failure due to the error attribute. Mark these functions as __always_inline to guarantee inlining so that the BUILD_BUG() only triggers when the default case genuinely cannot be eliminated due to an unexpected size. Cc: Closes: https://github.com/ClangBuiltLinux/linux/issues/1955 Fixes: 46859ac8af52 ("LoongArch: Add multi-processor (SMP) support") Link: https://github.com/llvm/llvm-project/commit/1a2e77cf9e11dbf56b5720c607313a566eebb16e Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: Huacai Chen commit 21eb2bfe2748b238f06983e4308cb30611371605 Author: WANG Rui Date: Wed Nov 8 14:12:07 2023 +0800 LoongArch: Disable module from accessing external data directly The distance between vmlinux and the module is too far so that PC-REL cannot be accessed directly, only GOT. When compiling module with GCC, the option `-mdirect-extern-access` is disabled by default. The Clang option `-fdirect-access-external-data` is enabled by default, so it needs to be explicitly disabled. Signed-off-by: WANG Rui Signed-off-by: Huacai Chen commit 80c7889de7a8246e44a9632a2b7d15b41ab3fe41 Author: Huacai Chen Date: Wed Nov 8 14:12:01 2023 +0800 LoongArch: Support PREEMPT_DYNAMIC with static keys Since commit 4e90d0522a688371402c ("riscv: support PREEMPT_DYNAMIC with static keys"), the infrastructure is complete and we can simply select HAVE_PREEMPT_DYNAMIC_KEY to enable PREEMPT_DYNAMIC on LoongArch because we already support static keys. Signed-off-by: Huacai Chen commit b8337e6a780dad9505f9d44da07c0a5c52fa0a04 Author: Len Brown Date: Tue Nov 7 23:28:30 2023 -0500 tools/power turbostat: version 2023.11.07 Turbostat features are now table-driven (Rui Zhang) Add support for some new platforms (Sumeet Pawnikar, Rui Zhang) Gracefully run in configs when CPUs are limited (Rui Zhang, Srinivas Pandruvada) misc minor fixes. Signed-off-by: Len Brown commit f2c1dba31133233697fc96e808c6005fc304a8e9 Author: Len Brown Date: Wed Jun 28 09:40:53 2023 -0400 tools/power/turbostat: bugfix "--show IPC" turbostat --show IPC displays "inf" for the IPC column turbostat was missing the explicit dependency of IPC on APERF, and thus neglected to collect APERF when only IPC was requested. typcial use: turbostat --quiet --show CPU,IPC Signed-off-by: Len Brown commit f968c56417f00be4cb62eadeed042a1e3c80dc53 Author: Vladimir Oltean Date: Mon Nov 6 18:03:11 2023 +0200 net: enetc: shorten enetc_setup_xdp_prog() error message to fit NETLINK_MAX_FMTMSG_LEN NETLINK_MAX_FMTMSG_LEN is currently hardcoded to 80, and we provide an error printf-formatted string having 96 characters including the terminating \0. Assuming each %d (representing a queue) gets replaced by a number having at most 2 digits (a reasonable assumption), the final string is also 96 characters wide, which is too much. Reduce the verbiage a bit by removing some (partially) redundant words, which makes the new printf-formatted string be 73 characters wide with the trailing newline. Fixes: 800db2d125c2 ("net: enetc: ensure we always have a minimum number of TXQs for stack") Reported-by: kernel test robot Closes: https://lore.kernel.org/lkml/202311061336.4dsWMT1h-lkp@intel.com/ Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20231106160311.616118-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 34c4effacfc329aeca5635a69fd9e0f6c90b4101 Author: Shigeru Yoshida Date: Sun Nov 5 00:05:31 2023 +0900 virtio/vsock: Fix uninit-value in virtio_transport_recv_pkt() KMSAN reported the following uninit-value access issue: ===================================================== BUG: KMSAN: uninit-value in virtio_transport_recv_pkt+0x1dfb/0x26a0 net/vmw_vsock/virtio_transport_common.c:1421 virtio_transport_recv_pkt+0x1dfb/0x26a0 net/vmw_vsock/virtio_transport_common.c:1421 vsock_loopback_work+0x3bb/0x5a0 net/vmw_vsock/vsock_loopback.c:120 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0xff6/0x1e60 kernel/workqueue.c:2703 worker_thread+0xeca/0x14d0 kernel/workqueue.c:2784 kthread+0x3cc/0x520 kernel/kthread.c:388 ret_from_fork+0x66/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Uninit was stored to memory at: virtio_transport_space_update net/vmw_vsock/virtio_transport_common.c:1274 [inline] virtio_transport_recv_pkt+0x1ee8/0x26a0 net/vmw_vsock/virtio_transport_common.c:1415 vsock_loopback_work+0x3bb/0x5a0 net/vmw_vsock/vsock_loopback.c:120 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0xff6/0x1e60 kernel/workqueue.c:2703 worker_thread+0xeca/0x14d0 kernel/workqueue.c:2784 kthread+0x3cc/0x520 kernel/kthread.c:388 ret_from_fork+0x66/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Uninit was created at: slab_post_alloc_hook+0x105/0xad0 mm/slab.h:767 slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x5a2/0xaf0 mm/slub.c:3523 kmalloc_reserve+0x13c/0x4a0 net/core/skbuff.c:559 __alloc_skb+0x2fd/0x770 net/core/skbuff.c:650 alloc_skb include/linux/skbuff.h:1286 [inline] virtio_vsock_alloc_skb include/linux/virtio_vsock.h:66 [inline] virtio_transport_alloc_skb+0x90/0x11e0 net/vmw_vsock/virtio_transport_common.c:58 virtio_transport_reset_no_sock net/vmw_vsock/virtio_transport_common.c:957 [inline] virtio_transport_recv_pkt+0x1279/0x26a0 net/vmw_vsock/virtio_transport_common.c:1387 vsock_loopback_work+0x3bb/0x5a0 net/vmw_vsock/vsock_loopback.c:120 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0xff6/0x1e60 kernel/workqueue.c:2703 worker_thread+0xeca/0x14d0 kernel/workqueue.c:2784 kthread+0x3cc/0x520 kernel/kthread.c:388 ret_from_fork+0x66/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 CPU: 1 PID: 10664 Comm: kworker/1:5 Not tainted 6.6.0-rc3-00146-g9f3ebbef746f #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc38 04/01/2014 Workqueue: vsock-loopback vsock_loopback_work ===================================================== The following simple reproducer can cause the issue described above: int main(void) { int sock; struct sockaddr_vm addr = { .svm_family = AF_VSOCK, .svm_cid = VMADDR_CID_ANY, .svm_port = 1234, }; sock = socket(AF_VSOCK, SOCK_STREAM, 0); connect(sock, (struct sockaddr *)&addr, sizeof(addr)); return 0; } This issue occurs because the `buf_alloc` and `fwd_cnt` fields of the `struct virtio_vsock_hdr` are not initialized when a new skb is allocated in `virtio_transport_init_hdr()`. This patch resolves the issue by initializing these fields during allocation. Fixes: 71dc9ec9ac7d ("virtio/vsock: replace virtio_vsock_pkt with sk_buff") Reported-and-tested-by: syzbot+0c8ce1da0ac31abbadcd@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=0c8ce1da0ac31abbadcd Signed-off-by: Shigeru Yoshida Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20231104150531.257952-1-syoshida@redhat.com Signed-off-by: Jakub Kicinski commit 8999ce4cfc87e61b4143ec2e7b93d8e92e11fa7f Author: Heiner Kallweit Date: Sun Nov 5 23:43:36 2023 +0100 r8169: respect userspace disabling IFF_MULTICAST So far we ignore the setting of IFF_MULTICAST. Fix this and clear bit AcceptMulticast if IFF_MULTICAST isn't set. Note: Based on the implementations I've seen it doesn't seem to be 100% clear what a driver is supposed to do if IFF_ALLMULTI is set but IFF_MULTICAST is not. This patch is based on the understanding that IFF_MULTICAST has precedence. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/4a57ba02-d52d-4369-9f14-3565e6c1f7dc@gmail.com Signed-off-by: Jakub Kicinski commit 305230142ae0637213bf6e04f6d9f10bbcb74af8 Merge: 25b6377007ebe 36cbb924d60bf Author: Linus Torvalds Date: Tue Nov 7 17:16:23 2023 -0800 Merge tag 'pm-6.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more power management updates from Rafael Wysocki: "These add new hardware support to a cpufreq driver and fix cpupower utility documentation: - Add support for several Qualcomm SoC versions to the Qualcomm cpufreq driver (Robert Marko, Varadarajan Narayanan) - Fix a reference to a removed document in the cpupower utility documentation (Vegard Nossum)" * tag 'pm-6.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: qcom-nvmem: Introduce cpufreq for ipq95xx cpufreq: qcom-nvmem: Enable cpufreq for ipq53xx cpufreq: qcom-nvmem: add support for IPQ8074 cpupower: fix reference to nonexistent document commit 25b6377007ebe1c3ede773fd6979f613386db000 Merge: eaec7c9892bd5 9ccde17d46554 Author: Linus Torvalds Date: Tue Nov 7 17:10:02 2023 -0800 Merge tag 'drm-next-2023-11-07' of git://anongit.freedesktop.org/drm/drm Pull more drm updates from Dave Airlie: "Geert pointed out I missed the renesas reworks in my main pull, so this pull contains the renesas next work for atomic conversion and DT support. It also contains a bunch of amdgpu and some small ssd13xx fixes. renesas: - atomic conversion - DT support ssd13xx: - dt binding fix for ssd132x - Initialize ssd130x crtc_state to NULL. amdgpu: - Fix RAS support check - RAS fixes - MES fixes - SMU13 fixes - Contiguous memory allocation fix - BACO fixes - GPU reset fixes - Min power limit fixes - GFX11 fixes - USB4/TB hotplug fixes - ARM regression fix - GFX9.4.3 fixes - KASAN/KCSAN stack size check fixes - SR-IOV fixes - SMU14 fixes - PSP13 fixes - Display blend fixes - Flexible array size fixes amdkfd: - GPUVM fix radeon: - Flexible array size fixes" * tag 'drm-next-2023-11-07' of git://anongit.freedesktop.org/drm/drm: (83 commits) drm/amd/display: Enable fast update on blendTF change drm/amd/display: Fix blend LUT programming drm/amd/display: Program plane color setting correctly drm/amdgpu: Query and report boot status drm/amdgpu: Add psp v13 function to query boot status drm/amd/swsmu: remove fw version check in sw_init. drm/amd/swsmu: update smu v14_0_0 driver if and metrics table drm/amdgpu: Add C2PMSG_109/126 reg field shift/masks drm/amdgpu: Optimize the asic type fix code drm/amdgpu: fix GRBM read timeout when do mes_self_test drm/amdgpu: check recovery status of xgmi hive in ras_reset_error_count drm/amd/pm: only check sriov vf flag once when creating hwmon sysfs drm/amdgpu: Attach eviction fence on alloc drm/amdkfd: Improve amdgpu_vm_handle_moved drm/amd/display: Increase frame warning limit with KASAN or KCSAN in dml2 drm/amd/display: Avoid NULL dereference of timing generator drm/amdkfd: Update cache info for GFX 9.4.3 drm/amdkfd: Populate cache info for GFX 9.4.3 drm/amdgpu: don't put MQDs in VRAM on ARM | ARM64 drm/amdgpu/smu13: drop compute workload workaround ... commit eaec7c9892bd565ffc7dcd32515b157011ca2323 Merge: b8dd631fcabe2 984a4afdc87a1 Author: Linus Torvalds Date: Tue Nov 7 16:56:10 2023 -0800 Merge tag 'regmap-fix-v6.7-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap fix from Mark Brown: "One fix here, for an interaction between noinc registers and caches. If a device uses noinc registers (which is rare) then we could corrupt registers after the noinc register in the cache" * tag 'regmap-fix-v6.7-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: prevent noinc writes from clobbering cache commit 5a5409d90bd05f87fe5623a749ccfbf3f7c7d400 Author: Namjae Jeon Date: Tue Nov 7 21:04:31 2023 +0900 ksmbd: handle malformed smb1 message If set_smb1_rsp_status() is not implemented, It will cause NULL pointer dereferece error when client send malformed smb1 message. This patch add set_smb1_rsp_status() to ignore malformed smb1 message. Cc: stable@vger.kernel.org Reported-by: Robert Morris Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit f6049712e520287ad695e9d4f1572ab76807fa0c Author: Namjae Jeon Date: Sun Nov 5 12:47:53 2023 +0900 ksmbd: fix kernel-doc comment of ksmbd_vfs_kern_path_locked() Fix argument list that the kdoc format and script verified in ksmbd_vfs_kern_path_locked(). fs/smb/server/vfs.c:1207: warning: Function parameter or member 'parent_path' not described in 'ksmbd_vfs_kern_path_locked' Reported-by: kernel test robot Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit eebff19acaa35820cb09ce2ccb3d21bee2156ffb Author: Namjae Jeon Date: Sun Nov 5 12:46:24 2023 +0900 ksmbd: fix slab out of bounds write in smb_inherit_dacl() slab out-of-bounds write is caused by that offsets is bigger than pntsd allocation size. This patch add the check to validate 3 offsets using allocation size. Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-22271 Cc: stable@vger.kernel.org Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit b8dd631fcabe2656c8d3751ad4836131d51fb63b Merge: c87271ee86e83 3d8a18697ad83 Author: Linus Torvalds Date: Tue Nov 7 16:53:28 2023 -0800 Merge tag 'rproc-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull remoteproc updates from Bjorn Andersson: "Support for controlling the second core in Mediatek's SCP dual-core setup is introduced. Support for audio, compute and modem DSPs on Qualcomm SM6375, and the audio DSP in SC7180 are introduced. The peripheral NoC clock is dropped from MSM8996 modem DSP, as this is handled through the interconnect provider. In the zynqmp driver the setup for TCM memory, and device address translation thereof, when operating in lockstep mode is corrected. A few bug fixes and cleanups are introduces across the ST and STM32 remoteproc drivers" * tag 'rproc-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (28 commits) remoteproc: st: Fix sometimes uninitialized ret in st_rproc_probe() remoteproc: st: Use device_get_match_data() remoteproc: zynqmp: Change tcm address translation method remoteproc: mediatek: Refactor single core check and fix retrocompatibility remoteproc: qcom: q6v5-mss: Remove PNoC clock from 8996 MSS dt-bindings: remoteproc: qcom,msm8996-mss-pil: Remove PNoC clock dt-bindings: remoteproc: qcom,adsp: Remove AGGRE2 clock remoteproc: qcom: pas: Add SM6375 MPSS remoteproc: qcom: pas: Add SM6375 ADSP & CDSP dt-bindings: remoteproc: qcom,sm6375-pas: Document remoteprocs dt-bindings: remoteproc: pru: Add Interrupt property remoteproc: qcom: pas: Add sc7180 adsp dt-bindings: remoteproc: qcom: sc7180-pas: Add ADSP compatible arm64: dts: mediatek: Update the node name of SCP rpmsg subnode remoteproc: zynqmp: fix TCM carveouts in lockstep mode remoteproc: mediatek: Refine ipi handler error message remoteproc: mediatek: Report watchdog crash to all cores remoteproc: mediatek: Handle MT8195 SCP core 1 watchdog timeout remoteproc: mediatek: Setup MT8195 SCP core 1 SRAM offset remoteproc: mediatek: Remove dependency of MT8195 SCP L2TCM power control on dual-core SCP ... commit c87271ee86e836d3beae7b8b0222e81e225fa6c5 Merge: d3fbdb8ad3349 2a6e483ad0476 Author: Linus Torvalds Date: Tue Nov 7 16:50:51 2023 -0800 Merge tag 'rpmsg-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull rpmsg updates from Bjorn Andersson: "This replaces a number of strncpy() instances with strscpy() or strscpy_pad() through the rpmsg core and virtio implementation" * tag 'rpmsg-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: rpmsg: virtio: Replace deprecated strncpy with strscpy/_pad rpmsg: Replace deprecated strncpy with strscpy_pad rpmsg: core: Replace deprecated strncpy with strscpy commit d3fbdb8ad33491f7c241a1167d7e3009f6e3f085 Merge: dc1434801d2ee 4f733de8b78a2 Author: Linus Torvalds Date: Tue Nov 7 16:40:42 2023 -0800 Merge tag 'pcmcia-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux Pull PCMCIA updates from Dominik Brodowski: "Cleanups and fixes. Yang Yingliang has fixed a number of resource leaks and Dongliang Mu contributed a spelling fix for the PCMCIA core. Also included is a tiny clenaup to the tcic PCMCIA socket driver provided by lizhe" * tag 'pcmcia-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux: pcmcia: tcic: remove unneeded "&" in call to setup_timer() pcmcia: typo fix pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() pcmcia: ds: fix refcount leak in pcmcia_device_add() pcmcia: cs: fix possible hung task and memory leak pccardd() commit dc1434801d2ee8b57286f587877e67d2f9b699d6 Merge: 13d88ac54ddd1 5be55473a0647 Author: Linus Torvalds Date: Tue Nov 7 16:36:25 2023 -0800 Merge tag 'gpio-pinctrl-updates-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio/pinctrl updates from Bartosz Golaszewski: "The bulk of it is a rework of the glue layer between pinctrl and GPIO. We changed the signature of GPIO helpers for pinctrl to taking the gpio_chip/offset pair as arguments instead of using the deprecated global GPIO numberspace. The last little bit is removing the gpiochip_find() function as it now has no more users in-tree. Summary: - rework the GPIO-to-pinctrl glue code to stop using the deprecated global GPIO numberspace - remove now unused wrappers around pinctrl GPIO helpers from drivers - remove gpiochip_find() as it has no more users" * tag 'gpio-pinctrl-updates-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (70 commits) pinctrl: tegra: drop the wrapper around pinctrl_gpio_request() pinctrl: em: drop the wrapper around pinctrl_gpio_request() pinctrl: nuvoton: npcm8xx: drop wrappers around pinctrl_gpio_request/free() pinctrl: nuvoton: npcm7xx: drop wrappers around pinctrl_gpio_request/free() pinctrl: stm32: drop wrappers around pinctrl_gpio_free/input() pinctrl: starfive: jh7110: drop wrappers around pinctrl_gpio_request/free() pinctrl: starfive: jh7100: drop wrappers around pinctrl_gpio_request/free() pinctrl: ocelot: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: cirrus: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: mediatek: common: drop the wrappers around pinctrl_gpio_direction_input() pinctrl: mediatek: moore: drop the wrappers around pinctrl_gpio_direction_input() pinctrl: rk805: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: axp209: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: vt8500: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: as3722: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: ingenic: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: st: drop the wrapper around pinctrl_gpio_direction_input() pinctrl: change the signature of pinctrl_ready_for_gpio_range() pinctrl: change the signature of gpio_to_pin() pinctrl: change the signature of pinctrl_match_gpio_range() ... commit 99bce5182d8fe90e5c57e9d99f831baaa94f90cb Author: Uwe Kleine-König Date: Sun Nov 5 16:00:39 2023 +0100 ata: pata_gayle: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Sergey Shtylyov Reviewed-by: Niklas Cassel Signed-off-by: Damien Le Moal commit 47d4708dfa54ad0e84e47bc681c133c2146b0f56 Author: Uwe Kleine-König Date: Sun Nov 5 16:00:38 2023 +0100 ata: pata_falcon: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Sergey Shtylyov Reviewed-by: Niklas Cassel Signed-off-by: Damien Le Moal commit 0b2771dd52570698c1b92e428f8bf2a224e7a2c3 Author: Uwe Kleine-König Date: Sun Nov 5 16:00:37 2023 +0100 ata: pata_gayle: Stop using module_platform_driver_probe() On today's platforms the benefit of platform_driver_probe() isn't that relevant any more. It allows to drop some code after booting (or module loading) for .probe() and discard the .remove() function completely if the driver is built-in. This typically saves a few 100k. The downside of platform_driver_probe() is that the driver cannot be bound and unbound at runtime which is ancient and so slightly complicates testing. There are also thoughts to deprecate platform_driver_probe() because it adds some complexity in the driver core for little gain. Also many drivers don't use it correctly. This driver for example misses to mark the driver struct with __ref which is needed to suppress a (W=1) modpost warning. Signed-off-by: Uwe Kleine-König Reviewed-by: Sergey Shtylyov Reviewed-by: Niklas Cassel Signed-off-by: Damien Le Moal commit 36f10a914a7b7169b5e399d1671ba2169c0801f3 Author: Uwe Kleine-König Date: Sun Nov 5 16:00:36 2023 +0100 ata: pata_falcon: Stop using module_platform_driver_probe() On today's platforms the benefit of platform_driver_probe() isn't that relevant any more. It allows to drop some code after booting (or module loading) for .probe() and discard the .remove() function completely if the driver is built-in. This typically saves a few 100k. The downside of platform_driver_probe() is that the driver cannot be bound and unbound at runtime which is ancient and so slightly complicates testing. There are also thoughts to deprecate platform_driver_probe() because it adds some complexity in the driver core for little gain. Also many drivers don't use it correctly. This driver for example misses to mark the driver struct with __ref which is needed to suppress a (W=1) modpost warning. Signed-off-by: Uwe Kleine-König Reviewed-by: Sergey Shtylyov Reviewed-by: Niklas Cassel Signed-off-by: Damien Le Moal commit fd3a6837d8e18cb7be80dcca1283276290336a7a Author: Damien Le Moal Date: Mon Nov 6 13:00:49 2023 +0900 ata: libata-core: Fix ata_pci_shutdown_one() This reverts commit 5b6fba546da246b3d0dd8465c07783e22629cc53. Commit 5b6fba546da2 ("ata: libata-core: Detach a port devices on shutdown") modified the function ata_pci_shutdown_one() to stop (suspend) devices attached to the ports of a PCI AHCI adapter to ensure that drives are spun down before shutting down a system. However, this is done only for PCI adapters and not for other types of adapters. This limitation was addressed with commit 24eca2dce0f8 ("scsi: sd: Introduce manage_shutdown device flag"). With this, all ATA disks are spun down on system shutdown, which make the changes introduced with 5b6fba546da2 useless. Signed-off-by: Damien Le Moal Reviewed-by: Niklas Cassel commit 8e1b802503bb630eafc3e97b2daf755368ec96e1 Merge: d84b139f53e8f 3c5864ba9cf91 Author: Martin KaFai Lau Date: Tue Nov 7 13:26:03 2023 -0800 Merge branch 'Let BPF verifier consider {task,cgroup} is trusted in bpf_iter_reg' Chuyi Zhou says: ==================== The patchset aims to let the BPF verivier consider bpf_iter__cgroup->cgroup and bpf_iter__task->task is trusted suggested by Alexei[1]. Please see individual patches for more details. And comments are always welcome. Link[1]:https://lore.kernel.org/bpf/20231022154527.229117-1-zhouchuyi@bytedance.com/T/#mb57725edc8ccdd50a1b165765c7619b4d65ed1b0 v2->v1: * Patch #1: Add Yonghong's ack and add description of similar case in log. * Patch #2: Add Yonghong's ack ==================== Signed-off-by: Martin KaFai Lau commit 3c5864ba9cf912ff9809f315d28f296f21563cce Author: Chuyi Zhou Date: Tue Nov 7 21:22:04 2023 +0800 selftests/bpf: get trusted cgrp from bpf_iter__cgroup directly Commit f49843afde (selftests/bpf: Add tests for css_task iter combining with cgroup iter) added a test which demonstrates how css_task iter can be combined with cgroup iter. That test used bpf_cgroup_from_id() to convert bpf_iter__cgroup->cgroup to a trusted ptr which is pointless now, since with the previous fix, we can get a trusted cgroup directly from bpf_iter__cgroup. Signed-off-by: Chuyi Zhou Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20231107132204.912120-3-zhouchuyi@bytedance.com Signed-off-by: Martin KaFai Lau commit 0de4f50de25af79c2a46db55d70cdbd8f985c6d1 Author: Chuyi Zhou Date: Tue Nov 7 21:22:03 2023 +0800 bpf: Let verifier consider {task,cgroup} is trusted in bpf_iter_reg BTF_TYPE_SAFE_TRUSTED(struct bpf_iter__task) in verifier.c wanted to teach BPF verifier that bpf_iter__task -> task is a trusted ptr. But it doesn't work well. The reason is, bpf_iter__task -> task would go through btf_ctx_access() which enforces the reg_type of 'task' is ctx_arg_info->reg_type, and in task_iter.c, we actually explicitly declare that the ctx_arg_info->reg_type is PTR_TO_BTF_ID_OR_NULL. Actually we have a previous case like this[1] where PTR_TRUSTED is added to the arg flag for map_iter. This patch sets ctx_arg_info->reg_type is PTR_TO_BTF_ID_OR_NULL | PTR_TRUSTED in task_reg_info. Similarly, bpf_cgroup_reg_info -> cgroup is also PTR_TRUSTED since we are under the protection of cgroup_mutex and we would check cgroup_is_dead() in __cgroup_iter_seq_show(). This patch is to improve the user experience of the newly introduced bpf_iter_css_task kfunc before hitting the mainline. The Fixes tag is pointing to the commit introduced the bpf_iter_css_task kfunc. Link[1]:https://lore.kernel.org/all/20230706133932.45883-3-aspsk@isovalent.com/ Fixes: 9c66dc94b62a ("bpf: Introduce css_task open-coded iterator kfuncs") Signed-off-by: Chuyi Zhou Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20231107132204.912120-2-zhouchuyi@bytedance.com Signed-off-by: Martin KaFai Lau commit 55e0bf49a0d0387d682d696e41cada071f516075 Author: Evan Green Date: Mon Nov 6 14:58:55 2023 -0800 RISC-V: Probe misaligned access speed in parallel Probing for misaligned access speed takes about 0.06 seconds. On a system with 64 cores, doing this in smp_callin() means it's done serially, extending boot time by 3.8 seconds. That's a lot of boot time. Instead of measuring each CPU serially, let's do the measurements on all CPUs in parallel. If we disable preemption on all CPUs, the jiffies stop ticking, so we can do this in stages of 1) everybody except core 0, then 2) core 0. The allocations are all done outside of on_each_cpu() to avoid calling alloc_pages() with interrupts disabled. For hotplugged CPUs that come in after the boot time measurement, register CPU hotplug callbacks, and do the measurement there. Interrupts are enabled in those callbacks, so they're fine to do alloc_pages() in. Reported-by: Jisheng Zhang Closes: https://lore.kernel.org/all/mhng-9359993d-6872-4134-83ce-c97debe1cf9a@palmer-ri-x1c9/T/#mae9b8f40016f9df428829d33360144dc5026bcbf Fixes: 584ea6564bca ("RISC-V: Probe for unaligned access speed") Signed-off-by: Evan Green Link: https://lore.kernel.org/r/20231106225855.3121724-1-evan@rivosinc.com Signed-off-by: Palmer Dabbelt commit 6eb7a6445b76a2fced91ebcf93d7a9073258c8cf Author: Evan Green Date: Mon Nov 6 15:11:05 2023 -0800 RISC-V: Remove __init on unaligned_emulation_finish() This function shouldn't be __init, since it's called during hotplug. The warning says it well enough: WARNING: modpost: vmlinux: section mismatch in reference: check_unaligned_access_all_cpus+0x13a (section: .text) -> unaligned_emulation_finish (section: .init.text) Signed-off-by: Evan Green Fixes: 71c54b3d169d ("riscv: report misaligned accesses emulation to hwprobe") Link: https://lore.kernel.org/r/20231106231105.3141413-1-evan@rivosinc.com Signed-off-by: Palmer Dabbelt commit d3d2cf1acab1857ae1982d431be9d96dc0e0775c Author: Evan Green Date: Mon Nov 6 15:24:39 2023 -0800 RISC-V: Show accurate per-hart isa in /proc/cpuinfo In /proc/cpuinfo, most of the information we show for each processor is specific to that hart: marchid, mvendorid, mimpid, processor, hart, compatible, and the mmu size. But the ISA string gets filtered through a lowest common denominator mask, so that if one CPU is missing an ISA extension, no CPUs will show it. Now that we track the ISA extensions for each hart, let's report ISA extension info accurately per-hart in /proc/cpuinfo. We cannot change the "isa:" line, as usermode may be relying on that line to show only the common set of extensions supported across all harts. Add a new "hart isa" line instead, which reports the true set of extensions for that hart. Signed-off-by: Evan Green Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20231106232439.3176268-1-evan@rivosinc.com Signed-off-by: Palmer Dabbelt commit 28ea54bade76e2d47cb8cdb96e427cfb90d3eea7 Author: Palmer Dabbelt Date: Tue Nov 7 07:55:29 2023 -0800 RISC-V: Don't rely on positional structure initialization Without this I get a bunch of warnings along the lines of arch/riscv/kernel/module.c:535:26: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init] 535 | [R_RISCV_32] = { apply_r_riscv_32_rela }, This just mades the member initializers explicit instead of positional. I also aligned some of the table, but mostly just to make the batch editing go faster. Fixes: b51fc88cb35e ("Merge patch series "riscv: Add remaining module relocations and tests"") Reviewed-by: Charlie Jenkins Link: https://lore.kernel.org/r/20231107155529.8368-1-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt commit b51fc88cb35e49a6e835b496fb21417f414f7c02 Merge: 946bb33d33025 af71bc194916b Author: Palmer Dabbelt Date: Tue Nov 7 14:59:35 2023 -0800 Merge patch series "riscv: Add remaining module relocations and tests" Charlie Jenkins says: A handful of module relocations were missing, this patch includes the remaining ones. I also wrote some test cases to ensure that module loading works properly. Some relocations cannot be supported in the kernel, these include the ones that rely on thread local storage and dynamic linking. This patch also overhauls the implementation of ADD/SUB/SET/ULEB128 relocations to handle overflow. "Overflow" is different for ULEB128 since it is a variable-length encoding that the compiler can be expected to generate enough space for. Instead of overflowing, ULEB128 will expand into the next 8-bit segment of the location. A psABI proposal [1] was merged that mandates that SET_ULEB128 and SUB_ULEB128 are paired, however the discussion following the merging of the pull request revealed that while the pull request was valid, it would be better for linkers to properly handle this overflow. This patch proactively implements this methodology for future compatibility. This can be tested by enabling KUNIT, RUNTIME_KERNEL_TESTING_MENU, and RISCV_MODULE_LINKING_KUNIT. [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/403 * b4-shazam-merge: riscv: Add tests for riscv module loading riscv: Add remaining module relocations riscv: Avoid unaligned access when relocating modules Link: https://lore.kernel.org/r/20231101-module_relocations-v9-0-8dfa3483c400@rivosinc.com Signed-off-by: Palmer Dabbelt commit af71bc194916b10f9b394f9b14419d99700a5e67 Author: Charlie Jenkins Date: Wed Nov 1 11:33:01 2023 -0700 riscv: Add tests for riscv module loading Add test cases for the two main groups of relocations added: SUB and SET, along with uleb128. Signed-off-by: Charlie Jenkins Link: https://lore.kernel.org/r/20231101-module_relocations-v9-3-8dfa3483c400@rivosinc.com Signed-off-by: Palmer Dabbelt commit 8fd6c5142395a106b63c8668e9f4a7106b6a0772 Author: Charlie Jenkins Date: Wed Nov 1 11:33:00 2023 -0700 riscv: Add remaining module relocations Add all final module relocations and add error logs explaining the ones that are not supported. Implement overflow checks for ADD/SUB/SET/ULEB128 relocations. Signed-off-by: Charlie Jenkins Link: https://lore.kernel.org/r/20231101-module_relocations-v9-2-8dfa3483c400@rivosinc.com Signed-off-by: Palmer Dabbelt commit 8cbe0accc4a6ba7ed34812a1c7e1ba67e7f7b2a4 Author: Emil Renner Berthing Date: Wed Nov 1 11:32:59 2023 -0700 riscv: Avoid unaligned access when relocating modules With the C-extension regular 32bit instructions are not necessarily aligned on 4-byte boundaries. RISC-V instructions are in fact an ordered list of 16bit little-endian "parcels", so access the instruction as such. This should also make the code work in case someone builds a big-endian RISC-V machine. Signed-off-by: Emil Renner Berthing Signed-off-by: Charlie Jenkins Link: https://lore.kernel.org/r/20231101-module_relocations-v9-1-8dfa3483c400@rivosinc.com Signed-off-by: Palmer Dabbelt commit 02d5fdbf4f2b8c406f7a4c98fa52aa181a11d733 Author: Klaus Kudielka Date: Tue Nov 7 18:44:02 2023 +0100 net: phylink: initialize carrier state at creation Background: Turris Omnia (Armada 385); eth2 (mvneta) connected to SFP bus; SFP module is present, but no fiber connected, so definitely no carrier. After booting, eth2 is down, but netdev LED trigger surprisingly reports link active. Then, after "ip link set eth2 up", the link indicator goes away - as I would have expected it from the beginning. It turns out, that the default carrier state after netdev creation is "carrier ok". Some ethernet drivers explicitly call netif_carrier_off during probing, others (like mvneta) don't - which explains the current behaviour: only when the device is brought up, phylink_start calls netif_carrier_off. Fix this for all drivers using phylink, by calling netif_carrier_off in phylink_create. Fixes: 089381b27abe ("leds: initial support for Turris Omnia LEDs") Cc: stable@vger.kernel.org Suggested-by: Andrew Lunn Signed-off-by: Klaus Kudielka Reviewed-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 97b94329126823d58550f4699d91e2536d4b6e91 Merge: 7425627b2b2cd d80f63f690257 Author: David S. Miller Date: Tue Nov 7 22:27:07 2023 +0000 Merge branch 'vsock-fixes' Filippo Storniolo says: ==================== vsock: fix server prevents clients from reconnecting This patch series introduce fix and tests for the following vsock bug: If the same remote peer, using the same port, tries to connect to a server on a listening port more than once, the server will reject the connection, causing a "connection reset by peer" error on the remote peer. This is due to the presence of a dangling socket from a previous connection in both the connected and bound socket lists. The inconsistency of the above lists only occurs when the remote peer disconnects and the server remains active. This bug does not occur when the server socket is closed. More details on the first patch changelog. The remaining patches are refactoring and test. ==================== Signed-off-by: David S. Miller commit d80f63f690257b04b4fe3731b90dbf34a9ebb93f Author: Filippo Storniolo Date: Fri Nov 3 18:55:51 2023 +0100 test/vsock: add dobule bind connect test This add bind connect test which creates a listening server socket and tries to connect a client with a bound local port to it twice. Co-developed-by: Luigi Leonardi Signed-off-by: Luigi Leonardi Signed-off-by: Filippo Storniolo Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit 84d5fb9741316ca53f0f7c23b82f30e0bb33c38e Author: Filippo Storniolo Date: Fri Nov 3 18:55:50 2023 +0100 test/vsock: refactor vsock_accept This is a preliminary patch to introduce SOCK_STREAM bind connect test. vsock_accept() is split into vsock_listen() and vsock_accept(). Co-developed-by: Luigi Leonardi Signed-off-by: Luigi Leonardi Signed-off-by: Filippo Storniolo Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit bfada5a7672fea5465d81bba3d05fca6024a244e Author: Filippo Storniolo Date: Fri Nov 3 18:55:49 2023 +0100 test/vsock fix: add missing check on socket creation Add check on socket() return value in vsock_listen() and vsock_connect() Co-developed-by: Luigi Leonardi Signed-off-by: Luigi Leonardi Signed-off-by: Filippo Storniolo Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit 3a5cc90a4d1756072619fe511d07621bdef7f120 Author: Filippo Storniolo Date: Fri Nov 3 18:55:48 2023 +0100 vsock/virtio: remove socket from connected/bound list on shutdown If the same remote peer, using the same port, tries to connect to a server on a listening port more than once, the server will reject the connection, causing a "connection reset by peer" error on the remote peer. This is due to the presence of a dangling socket from a previous connection in both the connected and bound socket lists. The inconsistency of the above lists only occurs when the remote peer disconnects and the server remains active. This bug does not occur when the server socket is closed: virtio_transport_release() will eventually schedule a call to virtio_transport_do_close() and the latter will remove the socket from the bound and connected socket lists and clear the sk_buff. However, virtio_transport_do_close() will only perform the above actions if it has been scheduled, and this will not happen if the server is processing the shutdown message from a remote peer. To fix this, introduce a call to vsock_remove_sock() when the server is handling a client disconnect. This is to remove the socket from the bound and connected socket lists without clearing the sk_buff. Fixes: 06a8fc78367d ("VSOCK: Introduce virtio_vsock_common.ko") Reported-by: Daan De Meyer Tested-by: Daan De Meyer Co-developed-by: Luigi Leonardi Signed-off-by: Luigi Leonardi Signed-off-by: Filippo Storniolo Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit 7425627b2b2cd671d5bf6541ce50f7cba8a76ad6 Author: Nathan Chancellor Date: Mon Nov 6 14:14:16 2023 -0700 tcp: Fix -Wc23-extensions in tcp_options_write() Clang warns (or errors with CONFIG_WERROR=y) when CONFIG_TCP_AO is set: net/ipv4/tcp_output.c:663:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions] 663 | } | ^ 1 error generated. On earlier releases (such as clang-11, the current minimum supported version for building the kernel) that do not support C23, this was a hard error unconditionally: net/ipv4/tcp_output.c:663:2: error: expected statement } ^ 1 error generated. While adding a semicolon after the label would resolve this, it is more in line with the kernel as a whole to refactor this block into a standalone function, which means the goto a label construct can just be replaced with a return statement. Do so to resolve the warning. Closes: https://github.com/ClangBuiltLinux/linux/issues/1953 Fixes: 1e03d32bea8e ("net/tcp: Add TCP-AO sign to outgoing packets") Signed-off-by: Nathan Chancellor Reviewed-by: Dmitry Safonov Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit c542b39b607dc0619e3b1b36e289600a555c4774 Author: Alex Pakhunov Date: Sun Nov 5 10:58:28 2023 -0800 tg3: Fix the TX ring stall The TX ring maintained by the tg3 driver can end up in the state, when it has packets queued for sending but the NIC hardware is not informed, so no progress is made. This leads to a multi-second interruption in network traffic followed by dev_watchdog() firing and resetting the queue. The specific sequence of steps is: 1. tg3_start_xmit() is called at least once and queues packet(s) without updating tnapi->prodmbox (netdev_xmit_more() returns true) 2. tg3_start_xmit() is called with an SKB which causes tg3_tso_bug() to be called. 3. tg3_tso_bug() determines that the SKB is too large, ... if (unlikely(tg3_tx_avail(tnapi) <= frag_cnt_est)) { ... stops the queue, and returns NETDEV_TX_BUSY: netif_tx_stop_queue(txq); ... if (tg3_tx_avail(tnapi) <= frag_cnt_est) return NETDEV_TX_BUSY; 4. Since all tg3_tso_bug() call sites directly return, the code updating tnapi->prodmbox is skipped. 5. The queue is stuck now. tg3_start_xmit() is not called while the queue is stopped. The NIC is not processing new packets because tnapi->prodmbox wasn't updated. tg3_tx() is not called by tg3_poll_work() because the all TX descriptions that could be freed has been freed: /* run TX completion thread */ if (tnapi->hw_status->idx[0].tx_consumer != tnapi->tx_cons) { tg3_tx(tnapi); 6. Eventually, dev_watchdog() fires triggering a reset of the queue. This fix makes sure that the tnapi->prodmbox update happens regardless of the reason tg3_start_xmit() returned. Signed-off-by: Alex Pakhunov Signed-off-by: Vincent Wong Reviewed-by: Michael Chan Signed-off-by: David S. Miller commit dbc9e341e3655f03a1eeeda8f0fa7931f54fac58 Author: Kuan-Wei Chiu Date: Tue Nov 7 06:20:59 2023 +0800 s390/qeth: Fix typo 'weed' in comment Replace 'weed' with 'we' in the comment. Signed-off-by: Kuan-Wei Chiu Reviewed-by: Alexandra Winter Signed-off-by: David S. Miller commit 13d88ac54ddd1011b6e94443958e798aa06eb835 Merge: 062cca8915cad 4ad714df58e64 Author: Linus Torvalds Date: Tue Nov 7 12:11:26 2023 -0800 Merge tag 'vfs-6.7.fsid' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull vfs fanotify fsid updates from Christian Brauner: "This work is part of the plan to enable fanotify to serve as a drop-in replacement for inotify. While inotify is availabe on all filesystems, fanotify currently isn't. In order to support fanotify on all filesystems two things are needed: (1) all filesystems need to support AT_HANDLE_FID (2) all filesystems need to report a non-zero f_fsid This contains (1) and allows filesystems to encode non-decodable file handlers for fanotify without implementing any exportfs operations by encoding a file id of type FILEID_INO64_GEN from i_ino and i_generation. Filesystems that want to opt out of encoding non-decodable file ids for fanotify that don't support NFS export can do so by providing an empty export_operations struct. This also partially addresses (2) by generating f_fsid for simple filesystems as well as freevxfs. Remaining filesystems will be dealt with by separate patches. Finally, this contains the patch from the current exportfs maintainers which moves exportfs under vfs with Chuck, Jeff, and Amir as maintainers and vfs.git as tree" * tag 'vfs-6.7.fsid' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: MAINTAINERS: create an entry for exportfs fs: fix build error with CONFIG_EXPORTFS=m or not defined freevxfs: derive f_fsid from bdev->bd_dev fs: report f_fsid from s_dev for "simple" filesystems exportfs: support encoding non-decodeable file handles by default exportfs: define FILEID_INO64_GEN* file handle types exportfs: make ->encode_fh() a mandatory method for NFS export exportfs: add helpers to check if filesystem can encode/decode file handles commit 062cca8915cad56aabb11206a4a5082856167fc0 Merge: 1a0507d8780e2 64bc7eee421fa Author: Linus Torvalds Date: Tue Nov 7 12:03:54 2023 -0800 Merge tag 'vfs-6.7.iomap' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs Pull iomap maintainership rotation from Christian Brauner: "As discussed on list last week this makes fs/iomap part of vfs.git with Darrick as main reviewer" * tag 'vfs-6.7.iomap' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: iomap: rename iomap entry iomap: rotate maintainers commit 1a0507d8780e2902c4c17c5a4c45d298bd7048af Merge: 7f851936a0ca4 0cdc6f44e9fdc Author: Linus Torvalds Date: Tue Nov 7 11:54:17 2023 -0800 Merge tag 'gfs2-v6.6-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 updates from Andreas Gruenbacher: - Don't update inode timestamps for direct writes (performance regression fix) - Skip no-op quota records instead of panicing - Fix a RCU race in gfs2_permission() - Various other smaller fixes and cleanups all over the place * tag 'gfs2-v6.6-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: (24 commits) gfs2: don't withdraw if init_threads() got interrupted gfs2: remove dead code in add_to_queue gfs2: Fix slab-use-after-free in gfs2_qd_dealloc gfs2: Silence "suspicious RCU usage in gfs2_permission" warning gfs2: fs: derive f_fsid from s_uuid gfs2: No longer use 'extern' in function declarations gfs2: Rename gfs2_lookup_{ simple => meta } gfs2: Convert gfs2_internal_read to folios gfs2: Convert stuffed_readpage to folios gfs2: Minor gfs2_write_jdata_batch PAGE_SIZE cleanup gfs2: Get rid of gfs2_alloc_blocks generation parameter gfs2: Add metapath_dibh helper gfs2: Clean up quota.c:print_message gfs2: Clean up gfs2_alloc_parms initializers gfs2: Two quota=account mode fixes gfs2: Stop using GFS2_BASIC_BLOCK and GFS2_BASIC_BLOCK_SHIFT gfs2: setattr_chown: Add missing initialization gfs2: fix an oops in gfs2_permission gfs2: ignore negated quota changes gfs2: Don't update inode timestamps for direct writes ... commit 7f851936a0ca4b231224ee296cba28f9b1bc555e Merge: c9d01179e185f 24e16e385f227 Author: Linus Torvalds Date: Tue Nov 7 11:46:31 2023 -0800 Merge tag 'ovl-update-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs Pull overlayfs updates from Amir Goldstein: - Overlayfs aio cleanups and fixes Cleanups and minor fixes in preparation for factoring out of read/write passthrough code. - Overlayfs lock ordering changes Hold mnt_writers only throughout copy up instead of a long lived elevated refcount. - Add support for nesting overlayfs private xattrs There are cases where you want to use an overlayfs mount as a lowerdir for another overlayfs mount. For example, if the system rootfs is on overlayfs due to composefs, or to make it volatile (via tmpfs), then you cannot currently store a lowerdir on the rootfs, because the inner overlayfs will eat all the whiteouts and overlay xattrs. This means you can't e.g. store on the rootfs a prepared container image for use with overlayfs. This adds support for nesting of overlayfs mounts by escaping the problematic features and unescaping them when exposing to the overlayfs user. - Add new mount options for appending lowerdirs * tag 'ovl-update-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs: ovl: add support for appending lowerdirs one by one ovl: refactor layer parsing helpers ovl: store and show the user provided lowerdir mount option ovl: remove unused code in lowerdir param parsing ovl: Add documentation on nesting of overlayfs mounts ovl: Add an alternative type of whiteout ovl: Support escaped overlay.* xattrs ovl: Add OVL_XATTR_TRUSTED/USER_PREFIX_LEN macros ovl: Move xattr support to new xattrs.c file ovl: do not encode lower fh with upper sb_writers held ovl: do not open/llseek lower file with upper sb_writers held ovl: reorder ovl_want_write() after ovl_inode_lock() ovl: split ovl_want_write() into two helpers ovl: add helper ovl_file_modified() ovl: protect copying of realinode attributes to ovl inode ovl: punt write aio completion to workqueue ovl: propagate IOCB_APPEND flag on writes to realfile ovl: use simpler function to convert iocb to rw flags commit 36cbb924d60bf2f1f684b3739edc61cba8350160 Merge: d53f7f7a74cfb a563c99f222f2 Author: Rafael J. Wysocki Date: Tue Nov 7 20:46:13 2023 +0100 Merge branch 'pm-tools' Merge cpupower utility update for 6.7-rc1: - Fix a reference to a removed document in the cpupower utility documentation (Vegard Nossum). * pm-tools: cpupower: fix reference to nonexistent document commit d53f7f7a74cfb8e672644fdde518f286e512f791 Merge: 3062a9879afbc d1f6be54eafe1 Author: Rafael J. Wysocki Date: Tue Nov 7 20:45:12 2023 +0100 Merge branch 'pm-cpufreq' Merge branch 'pm-cpufreq' Merge additional Qualcomm cpufreq driver updates for 6.7-rc1: - Add support for several Qualcomm SoC versions (Robert Marko, Varadarajan Narayanan). * pm-cpufreq: cpufreq: qcom-nvmem: Introduce cpufreq for ipq95xx cpufreq: qcom-nvmem: Enable cpufreq for ipq53xx cpufreq: qcom-nvmem: add support for IPQ8074 commit c9d01179e185f72b20af7e37aa4308f4c7ca7eeb Merge: be3ca57cfb777 c7046ed0cf9bb Author: Linus Torvalds Date: Tue Nov 7 11:38:38 2023 -0800 Merge tag 'bcachefs-2023-11-5' of https://evilpiepirate.org/git/bcachefs Pull more bcachefs updates from Kent Overstreet: "Here's the second big bcachefs pull request. This brings your tree up to date with my master branch, which is what existing bcachefs users are currently running. New features: - rebalance_work btree (and metadata version 1.3): the rebalance thread no longer has to scan to find extents that need processing - big scalability improvement. - sb_errors superblock section: this adds counters for each fsck error type, since filesystem creation, along with the date of the most recent error. It'll get us better bug reports (since users do not typically report errors that fsck was able to fix), and I might add telemetry for this in the future. Fixes include: - multiple snapshot deletion fixes - members_v2 fixups - deleted_inodes btree fixes - copygc thread no longer spins when a device is full but has no fragmented buckets (i.e. rebalance needs to move data around instead) - a fix for a memory reclaim issue with the btree key cache: we're now careful not to hold the srcu read lock that blocks key cache reclaim for too long - an early allocator locking fix, from Brian - endianness fixes, from Brian - CONFIG_BCACHEFS_DEBUG_TRANSACTIONS no longer defaults to y, a big performance improvement on multithreaded workloads" * tag 'bcachefs-2023-11-5' of https://evilpiepirate.org/git/bcachefs: (70 commits) bcachefs: Improve stripe checksum error message bcachefs: Simplify, fix bch2_backpointer_get_key() bcachefs: kill thing_it_points_to arg to backpointer_not_found() bcachefs: bch2_ec_read_extent() now takes btree_trans bcachefs: bch2_stripe_to_text() now prints ptr gens bcachefs: Don't iterate over journal entries just for btree roots bcachefs: Break up bch2_journal_write() bcachefs: Replace ERANGE with private error codes bcachefs: bkey_copy() is no longer a macro bcachefs: x-macro-ify inode flags enum bcachefs: Convert bch2_fs_open() to darray bcachefs: Move __bch2_members_v2_get_mut to sb-members.h bcachefs: bch2_prt_datetime() bcachefs: CONFIG_BCACHEFS_DEBUG_TRANSACTIONS no longer defaults to y bcachefs: Add a comment for BTREE_INSERT_NOJOURNAL usage bcachefs: rebalance_work btree is not a snapshots btree bcachefs: Add missing printk newlines bcachefs: Fix recovery when forced to use JSET_NO_FLUSH journal entry bcachefs: .get_parent() should return an error pointer bcachefs: Fix bch2_delete_dead_inodes() ... commit 166b0110d1ee53290bd11618df6e3991c117495a Author: Helge Deller Date: Tue Nov 7 14:33:32 2023 +0100 parisc/pgtable: Do not drop upper 5 address bits of physical address When calculating the pfn for the iitlbt/idtlbt instruction, do not drop the upper 5 address bits. This doesn't seem to have an effect on physical hardware which uses less physical address bits, but in qemu the missing bits are visible. Signed-off-by: Helge Deller Cc: commit 6affe08aea5f3b630565676e227b41d55a6f009c Author: Arnd Bergmann Date: Thu Oct 26 15:08:03 2023 +0200 nvme: common: make keyring and auth separate modules When only the keyring module is included but auth is not, modpost complains about the lack of a module license tag: ERROR: modpost: missing MODULE_LICENSE() in drivers/nvme/common/nvme-common.o Address this by making both modules buildable standalone, removing the now unnecessary CONFIG_NVME_COMMON symbol in the process. Also, now that NVME_KEYRING config symbol can be either a module or built-in, the stubs need to check for '#if IS_ENABLED' rather than a simple '#ifdef'. Fixes: 9d77eb5277849 ("nvme-keyring: register '.nvme' keyring") Signed-off-by: Arnd Bergmann Signed-off-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Keith Busch commit 946bb33d330251966223f770f64885c79448b1a1 Author: Christoph Hellwig Date: Sat Oct 28 17:51:01 2023 +0200 riscv: split cache ops out of dma-noncoherent.c The cache ops are also used by the pmem code which is unconditionally built into the kernel. Move them into a separate file that is built based on the correct config option. Fixes: fd962781270e ("riscv: RISCV_NONSTANDARD_CACHE_OPS shouldn't depend on RISCV_DMA_NONCOHERENT") Reported-by: kernel test robot Signed-off-by: Christoph Hellwig Reviewed-by: Conor Dooley Tested-by: Conor Dooley Reviewed-by: Lad Prabhakar Tested-by: Lad Prabhakar # Link: https://lore.kernel.org/r/20231028155101.1039049-1-hch@lst.de Signed-off-by: Palmer Dabbelt commit 20238a2cc9a6a926f9f47ae4ae9edd1bc98f278c Author: Tao Zhou Date: Thu Oct 19 16:01:07 2023 +0800 drm/amdgpu: add RAS reset/query operations for XGMI v6_4 Reset/query RAS error status and count. v2: use XGMI IP version instead of WAFL version. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 61fe5536d06cf485d387c894d2083de883c81ad7 Author: Tao Zhou Date: Tue Oct 31 10:39:51 2023 +0800 drm/amdgpu: handle extra UE register entries for gfx v9_4_3 The UE registe list is larger than CE list. Reported-by: yipeng.chai@amd.com Signed-off-by: Tao Zhou Reviewed-by: Stanley.Yang Signed-off-by: Alex Deucher commit d78fa1c309327cee1cfb7c608ec59f5a60ab94bd Author: Tim Huang Date: Thu Oct 19 10:24:11 2023 +0800 drm/amd/pm: not stop rlc for IMU enabled APUs when suspend For IMU enabled APUs, after sending the PrepareMp1ForUnload message to SMU in system_features_control, the RLC registers can't be touched. The driver to stop the rlc in suspending is no longer required. Signed-off-by: Tim Huang Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit c68b4550b6b432cbb05ad30f67178d2d3845d919 Author: Bragatheswaran Manickavel Date: Tue Oct 24 23:41:34 2023 +0530 drm/amd/display: avoid variable reinitialization The member variable enable_hpo_pg_support is already initialized and hence the reinitialization instruction can be removed. Issue identified using the doubleinit.cocci Coccinelle semantic patch script. Signed-off-by: Bragatheswaran Manickavel Signed-off-by: Alex Deucher commit 8cfd6a05750cd7aa84e7f1e5933fa7781006bfc3 Author: Lijo Lazar Date: Tue Oct 31 12:32:03 2023 +0530 drm/amd/pm: Hide irrelevant pm device attributes Change return code to EOPNOTSUPP for unsupported functions. Use the error code information to hide sysfs nodes not valid for the SOC. Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit 0553eb9f33aa1a89a788682c78bd9747d41e65cb Author: Lijo Lazar Date: Mon Nov 6 09:06:58 2023 +0530 drm/amdgpu: Fix sdma 4.4.2 doorbell rptr/wptr init Doorbell rptr/wptr can be set through multiple ways including direct register initialization. Disable doorbell during hw_fini once the ring is disabled so that during next module reload direct initialization takes effect. Also, move the direct initialization after minor update is set to 1 since rptr/wptr are reinitialized back to 0 which could be lower than the previous doorbell value (ex: cases like module reload). Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Reviewed-by: Asad Kamal Tested-by: Asad Kamal Signed-off-by: Alex Deucher commit 9c561ca2d3ca99606034880f62791e866af35ef9 Author: Jiadong Zhu Date: Thu Oct 26 17:08:49 2023 +0800 drm/amdgpu/soc21: add mode2 asic reset for SMU IP v14.0.0 Set the default reset method to mode2 for SMU IP v14.0.0 Signed-off-by: Jiadong Zhu Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit d736c2e0744807e4cb12e84b179896c995a096f9 Author: George Shen Date: Tue Oct 24 21:47:57 2023 -0400 drm/amd/display: Set stream's DP test pattern upon test request [Why] A recent refactor of DC's DP test pattern automation code requires the DC stream's test pattern and test pattern color space fields to be correctly populated before calling dc_link_dp_set_test_pattern. [How] Populate stream's test pattern type and color space fields before calling into DC to program DP test pattern. Reviewed-by: Aurabindo Pillai Acked-by: Hersen Wu Signed-off-by: George Shen Signed-off-by: Hersen Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 35c1d9664cbfa3a592c208cff86353c7c7689eef Author: Sung Joon Kim Date: Wed Oct 11 17:12:05 2023 -0400 drm/amd/display: Fix handling duplicate planes on one stream [why] DML2 does not handle the case when we have a single stream sourcing 2 or more planes that are duplicates of one another. To properly handle this scenario, pipe index to plane index mapping is used to decide which plane is being processed and programmed. [how] Create static array of pipe index to plane index map. Populate the array properly and use in appropriate places. Reviewed-by: Xi (Alex) Liu Acked-by: Hersen Wu Signed-off-by: Sung Joon Kim Signed-off-by: Hersen Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ed6e2782e9747508888f671e1101250bb19045be Author: Alvin Lee Date: Mon Oct 23 14:33:16 2023 -0400 drm/amd/display: For cursor P-State allow for SubVP [Description] - Similar to FPO, SubVP should also force cursor P-State allow instead of relying on natural assertion - Implement code path to force and unforce cursor P-State allow for SubVP Reviewed-by: Samson Tam Acked-by: Hersen Wu Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e4c33fff2eae41d16d9760e56efc23dcc30c6b91 Author: Daniel Miess Date: Thu Oct 26 14:34:14 2023 -0400 drm/amd/display: Enable physymclk RCO [Why] Enable the last of the RCO options for dcn35 [How] Breakout RCO from dccg35_set_physymclk so that physymclk RCO can be set in dccg_init without disabling physymclk Reviewed-by: Nicholas Kazlauskas Reviewed-by: Jun Lei Acked-by: Hersen Wu Signed-off-by: Daniel Miess Signed-off-by: Hersen Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 90f2f83352f7e85edb38cdb171627ded3d9c7040 Author: Chaitanya Dhere Date: Tue Oct 24 13:10:12 2023 -0400 drm/amd/display: Remove references to unused dml arch version Clean-up the code to remove references of all unused dml architecture versions since only dml2 is actively used. Reviewed-by: Jun Lei Acked-by: Hersen Wu Signed-off-by: Chaitanya Dhere Signed-off-by: Hersen Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5c10147464fafbd3850d1f276a75a8825ecbbc0d Author: Aric Cyr Date: Sun Oct 29 21:22:37 2023 -0400 drm/amd/display: Promote DAL to 3.2.259 Summary: - Enable DCN35 physymclk root clock gating - Fix DP automation test pattern bug - Disable OTG for mode timing switch on DCN35 - Refactor DML2 - Revert Fix handling duplicate planes on one stream - Revert Enable DCN clock gating - Implement cursor P-State allow for SubVP - Optimize pipe otg allocation - Save and restore mall state while switching from ODM to Subvp Acked-by: Hersen Wu Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit fecbaa0a79adaa632e406ee5cffe5751e2d44fcb Author: Wenjing Liu Date: Fri Oct 20 16:18:40 2023 -0400 drm/amd/display: save and restore mall state when applying minimal transition [why] There is a case when we are switching from ODM combine to Subvp where minimal transition based off subvp state is required. In thise case, we need to save and restore mall state when applying minimal transition. Reviewed-by: Dillon Varone Acked-by: Hersen Wu Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 62893e9794c5ba237af93fa1f67cd04ca823405e Author: Joshua Aberback Date: Wed Oct 25 01:18:04 2023 -0400 drm/amd/display: Remove unused duplicate register definition [Why] DCN32 uses ABM register definitions in dcn32_resource.h, remove duplicate from dce_abm.h to avoid confusion. Reviewed-by: Dillon Varone Acked-by: Hersen Wu Signed-off-by: Joshua Aberback Signed-off-by: Hersen Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 60ccd588d5820fc270bdd75185b5dc0220019e35 Author: Rodrigo Siqueira Date: Fri Oct 20 15:31:24 2023 -0600 drm/amd/display: Create optc.h file For all the components that participate in DCN architecture, there is a header in the dc/inch/hw. For some reason, OPTC broke this pattern and added all the primary functions/structs associated with that in the dcn10_optc.h file. For consistency's sake, this commit introduces a new optc.h file and extracts the code from dcn10_optc to this new file. Reviewed-by: Hamza Mahfooz Acked-by: Hersen Wu Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3e18d4bd9ac627d8262661272ea1e60631c2608e Author: Ovidiu Bunea Date: Wed Oct 25 13:05:47 2023 -0400 drm/amd/display: Disable OTG for mode timing switch on DCN35 [why] Doing a mode timing change causes a hang when OTG is not disabled. [how] Add link_enc null check in disable_otg_wa to cover this case. Reviewed-by: Nicholas Kazlauskas Acked-by: Hersen Wu Signed-off-by: Ovidiu Bunea Signed-off-by: Hersen Wu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d0ef62bd109c2af3ba8dc16a6d5ad4a0f30e03dc Author: Dennis Chan Date: Thu Oct 12 23:08:25 2023 +0800 drm/amd/display: Revise Replay Desync Error IRQ handle [Why] Current Desync IRQ handler will have some potential do not hit the desync error case. We change to check both desync error HPD and DPCD. Signed-off-by: Dennis Chan Acked-by: Hersen Wu Reviewed-by: Robin Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 77b2c07d7d3cc1ee11cb64d209d59e57b0ae649b Author: Anthony Koo Date: Sat Oct 21 03:51:08 2023 -0400 drm/amd/display: [FW Promotion] Release 0.0.190.0 - Increase number of bits for IPS boot option Reviewed-by: Aric Cyr Acked-by: Hersen Wu Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 51131758c79f3f727318ee468bbb9c22666604e3 Author: Aric Cyr Date: Sun Oct 22 17:26:35 2023 -0400 drm/amd/display: 3.2.258 This version brings along following fixes: Update test link rate DPCD bit field to match spec Enable RCO options for dcn35 Add missing dml2 init value for dcn35 Enable DCN clock gating DCN35 Disable cm power optimization Allow 16 max_slices for DP2 DSC Fix OTG disable workaround logic Enable more IPS options Fix FRL assertion on boot Fix missing blendTF programming Update DP HPO MSA with colorimetry from test request Fix handling duplicate planes on one stream Acked-by: Hersen Wu Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f9e7d4fadc4fbd8083e8dec04fabf870f3f6ae39 Author: Roman Li Date: Thu Oct 19 15:32:55 2023 -0400 drm/amd/display: Add missing dml2 init value for dcn35 [Why] For lighting up, some dml2 params needs to be initialized. One of them escaped initial patch under: "drm/amd/display: Add DCN35 DML2 support" [How] Add missing initialization. Fixes: 115009d11ccf ("drm/amd/display: Add DCN35 DML2 support") Reviewed-by: Harry Wentland Acked-by: Hersen Wu Signed-off-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit fd7cedccdde3ff9c7d31092787f280631da7b207 Author: Taimur Hassan Date: Tue Oct 10 13:31:19 2023 -0400 drm/amd/display: Fix OTG disable workaround logic [Why] DENTIST was hanging when performing DISPCLK update with OTG enabled, as OTG disable workaround was not executing. [How] Workaround was checking against current_state before running, but when called from optimize_bandwidth (safe_to_lower), we should be checking against context instead. Reviewed-by: Nicholas Kazlauskas Acked-by: Hersen Wu Signed-off-by: Taimur Hassan Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ce3b32ec4aef7171277c7c8efc07861eac27998c Author: ChunTao Tso Date: Tue Oct 3 17:05:05 2023 +0800 drm/amd/display: amend HPD handler for Replay [Why] For Replay, if we receive HPD, it doesn’t need to reboot the display. We don’t need to return anything exactly. [How] Return nothing just because we don’t need to reboot the display. Signed-off-by: ChunTao Tso Acked-by: Hersen Wu Reviewed-by: Jerry Zuo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 39ad51cb61556892ce8af02b995136cd2711527b Author: Dennis Chan Date: Wed May 3 14:20:17 2023 +0800 drm/amd/display: Introduce flag for disabling Replay desync recovery [why] It's useful to disable the recovery mechanism when debugging replay desync errors. Signed-off-by: Dennis Chan Acked-by: Hersen Wu Reviewed-by: Robin Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 85de32cd7b383f5d84195aed0c53e920e6786005 Author: Yihan Zhu Date: Thu Oct 19 14:23:17 2023 -0400 drm/amd/display: DCN35 Disable cm power optimization [WHY & HOW] Enabling SCE after boot up will cause color distortion. Reviewed-by: Ovidiu Bunea Acked-by: Hersen Wu Signed-off-by: Yihan Zhu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 81df7271688cf04a502e3bbd19d0395a986a89e1 Author: George Shen Date: Wed Oct 11 16:32:39 2023 -0400 drm/amd/display: Update DP HPO MSA with colorimetry from test request [Why] Some DP link layer tests request a different colorimetry than the default one that is used. Currently, our test automation logic does not update the MSA with the test request value for DP HPO case. [How] Update HPO MSA colorimetry with test automation request value. Reviewed-by: Wenjing Liu Acked-by: Hersen Wu Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f031ba12082cadd1d827b36ba1d2c76a2395134d Author: George Shen Date: Thu Oct 19 22:03:41 2023 -0400 drm/amd/display: Update test link rate DPCD bit field to match spec [Why] An SCR was made to the DP2.0 spec that updated the bit field definition for UHBR13.5 in the test link rate DPCD register. [How] Add new translation to match the SCR update. Keep old translation for backwards compatibility. Reviewed-by: Wenjing Liu Acked-by: Hersen Wu Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8df0d7d33a58d9394bd1240205e393d5f2bab6c7 Author: Fangzhi Zuo Date: Wed Oct 18 09:38:33 2023 -0400 drm/amd/display: Allow 16 max_slices for DP2 DSC Enable 12 and 16 max_slices for DP2 DSC Reviewed-by: Alvin Lee Acked-by: Hersen Wu Signed-off-by: Fangzhi Zuo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 92e11f0159f6635bb8b0a7bb427ddb525bccbcb5 Author: Sung Joon Kim Date: Mon Oct 16 11:35:56 2023 -0400 drm/amd/display: Enable more IPS options [why] To help isolate static screen and video playback tests, we want to enable an IPS option to allow IPS only on D3 cycle. [how] Add DISABLE_DYNAMIC and DISABLE_ALL IPS disable flags for user control. Reviewed-by: Jun Lei Acked-by: Hersen Wu Signed-off-by: Sung Joon Kim Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit eacfdc362d3c1eaab517f7c25b089f2536c010f1 Author: Daniel Miess Date: Fri Oct 20 12:31:09 2023 -0400 drm/amd/display: Enable RCO options for dcn35 [Why & How] Enable root clock optimization options for dcn35 for power savings Reviewed-by: Nicholas Kazlauskas Acked-by: Hersen Wu Signed-off-by: Daniel Miess Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f896cd2686817db915c265ff693a8dad7b6580dc Author: Sung Joon Kim Date: Mon Oct 16 15:23:16 2023 -0400 drm/amd/display: Fix FRL assertion on boot [why] Make sure to ungate the clocks on boot so programming sequence is done successfully. [how] Move the ungate logic after bios init. Reviewed-by: Xi (Alex) Liu Acked-by: Hersen Wu Signed-off-by: Sung Joon Kim Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 566f648c4e028ffd62f533d2e8d7e7f89d0e420c Author: Ilya Bakoulin Date: Fri Oct 13 19:34:58 2023 -0400 drm/amd/display: Fix missing blendTF programming [Why] When MPO surface pixel format is not ARGB8888, fast update can miss programming blendTF. [How] Set the gamma_change update flag on blend_tf change. Reviewed-by: Aric Cyr Acked-by: Hersen Wu Signed-off-by: Ilya Bakoulin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5d71a8e336e1553aa685963ba362d951541ce082 Author: Aric Cyr Date: Sun Oct 15 14:28:01 2023 -0400 drm/amd/display: 3.2.257 This version brings along following fixes: On boot disable domain22 force power on decouple dmcub execution to reduce lock granularity Enable fast update on blendTF change Fix blend LUT programming Program plane color setting correctly amend HPD handler for Replay Avoid NULL dereference of timing generator Acked-by: Hersen Wu Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 028bac5834495f4f4036bf8b3206fcdafe99a393 Author: JinZe.Xu Date: Fri Oct 13 09:50:00 2023 +0800 drm/amd/display: decouple dmcub execution to reduce lock granularity [Why] On some systems dmub commands run at high IRQ, so long running commands will block other interrupts. [How] Decouple wait_for_idle from dmcub queue/execute/wait. Reviewed-by: Josip Pavic Acked-by: Hersen Wu Signed-off-by: JinZe.Xu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 13c84bbe0524e6a5c8a3d873152c1eaa295e3592 Author: Anthony Koo Date: Sat Oct 14 11:12:13 2023 -0400 drm/amd/display: [FW Promotion] Release 0.0.189.0 - Minor formatting changes - Update defines to match the bit width of the field it is used for - Add new boot up bits to control HW sub block regions power down Reviewed-by: Aric Cyr Acked-by: Hersen Wu Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 89830c62e677187a75b25202effbbf6611fc6552 Author: Daniel Miess Date: Fri Oct 13 10:38:09 2023 -0400 drm/amd/display: On boot disable domain22 force power on [Why] HDCP2 enablement fails when domain22 is set to force power on [How] Disable force power on for domain22 on startup Reviewed-by: Nicholas Kazlauskas Acked-by: Hersen Wu Signed-off-by: Daniel Miess Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9256e8d47a2fa0bcb5d32e7fee8c674c476a480f Author: Surbhi Kakarya Date: Mon Sep 25 12:12:10 2023 -0400 drm/amd: Disable XNACK on SRIOV environment The purpose of this patch is to disable XNACK or set XNACK OFF mode on SRIOV platform which doesn't support it. This will prevent user-space application to fail or result into unexpected behaviour whenever the application need to run test-case in XNACK ON mode. Signed-off-by: Surbhi Kakarya Reviewed-by: Shaoyun Liu Signed-off-by: Alex Deucher commit 1b0a151c10a6d823f033023b9fdd9af72a89591b Author: Yu Kuai Date: Tue Nov 7 19:12:47 2023 +0800 blk-core: use pr_warn_ratelimited() in bio_check_ro() If one of the underlying disks of raid or dm is set to read-only, then each io will generate new log, which will cause message storm. This environment is indeed problematic, however we can't make sure our naive custormer won't do this, hence use pr_warn_ratelimited() to prevent message storm in this case. Signed-off-by: Yu Kuai Fixes: 57e95e4670d1 ("block: fix and cleanup bio_check_ro") Signed-off-by: Ye Bin Link: https://lore.kernel.org/r/20231107111247.2157820-1-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe commit 327462725b0f759f093788dfbcb2f1fd132f956b Author: Li Lingfeng Date: Tue Nov 7 18:34:35 2023 +0800 nbd: fix uaf in nbd_open Commit 4af5f2e03013 ("nbd: use blk_mq_alloc_disk and blk_cleanup_disk") cleans up disk by blk_cleanup_disk() and it won't set disk->private_data as NULL as before. UAF may be triggered in nbd_open() if someone tries to open nbd device right after nbd_put() since nbd has been free in nbd_dev_remove(). Fix this by implementing ->free_disk and free private data in it. Fixes: 4af5f2e03013 ("nbd: use blk_mq_alloc_disk and blk_cleanup_disk") Signed-off-by: Li Lingfeng Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20231107103435.2074904-1-lilingfeng@huaweicloud.com Signed-off-by: Jens Axboe commit df42ee7e22f03de034939d582c4dff19e6030e4f Author: Alexander Koskovich Date: Sun Nov 5 15:29:29 2023 +0000 ALSA: hda: Add ASRock X670E Taichi to denylist Recent AMD platforms expose an HD-audio bus but without any actual codecs, which is internally tied with a USB-audio device, supposedly. It results in "no codecs" error of HD-audio bus driver, and it's nothing but a waste of resources. snd_hda_intel 0000:59:00.6: no codecs found! Signed-off-by: Alexander Koskovich Link: https://lore.kernel.org/r/20231105152834.5620-1-akoskovich@pm.me Signed-off-by: Takashi Iwai commit 26fd31ef9c02a5e91cdb8eea127b056bd7cf0b3b Author: Alex Spataru Date: Sat Nov 4 16:01:52 2023 -0500 ALSA: hda/realtek: Add quirk for ASUS UX7602ZM Enables the SPI-connected CSC35L41 audio amplifier for this laptop model. As of BIOS version 303 it's still necessary to modify the ACPI table to add the related _DSD properties: https://github.com/alex-spataru/asus_zenbook_ux7602zm_sound/ Signed-off-by: Alex Spataru Link: https://lore.kernel.org/r/DS7PR07MB7621BB5BB14F5473D181624CE3A4A@DS7PR07MB7621.namprd07.prod.outlook.com Signed-off-by: Takashi Iwai commit 4ad714df58e646d4b2a454a7dface8ff903911c4 Author: Amir Goldstein Date: Thu Oct 26 23:55:53 2023 +0300 MAINTAINERS: create an entry for exportfs Split the exportfs entry from the nfsd entry and add myself as reviewer. Suggested-by: Chuck Lever Acked-by: Chuck Lever Acked-by: Jeff Layton Signed-off-by: Amir Goldstein Link: https://lore.kernel.org/r/20231026205553.143556-1-amir73il@gmail.com Signed-off-by: Christian Brauner commit aba6ab57a910ad4b940c2024d15f2cdbf5b7f76b Author: Dan Carpenter Date: Fri Oct 27 15:05:44 2023 +0300 fbdev: imsttfb: fix a resource leak in probe I've re-written the error handling but the bug is that if init_imstt() fails we need to call iounmap(par->cmap_regs). Fixes: c75f5a550610 ("fbdev: imsttfb: Fix use after free bug in imsttfb_probe") Signed-off-by: Dan Carpenter Signed-off-by: Helge Deller commit e08c30efda21ef4c0ec084a3a9581c220b442ba9 Author: Dan Carpenter Date: Fri Oct 27 15:04:56 2023 +0300 fbdev: imsttfb: fix double free in probe() The init_imstt() function calls framebuffer_release() on error and then the probe() function calls it again. It should only be done in probe. Fixes: 518ecb6a209f ("fbdev: imsttfb: Fix error path of imsttfb_probe()") Signed-off-by: Dan Carpenter Signed-off-by: Helge Deller commit 3e91a38de1dce97b385d732a5f444264ea8fbd92 Author: Philipp Stanner Date: Thu Nov 2 20:24:03 2023 +0100 fbdev: viafb: use new array-copying-wrapper viafbdev.c utilizes memdup_user() to copy an array from userspace. There is a new wrapper, specifically designed for copying arrays. Use this one instead. Suggested-by: Dave Airlie Signed-off-by: Philipp Stanner Signed-off-by: Helge Deller commit fc6699d62f5f4facc3e934efd25892fc36050b70 Author: Uwe Kleine-König Date: Fri Nov 3 18:35:58 2023 +0100 fbdev: omapfb: Drop unused remove function OMAP2_VRFB is a bool, so the vrfb driver can never be compiled as a module. With that __exit_p(vrfb_remove) always evaluates to NULL and vrfb_remove() is unused. If the driver was compilable as a module, it would fail to build because the type of vrfb_remove() isn't compatible with struct platform_driver::remove(). (The former returns void, the latter int.) Fixes: aa1e49a3752f ("OMAPDSS: VRFB: add omap_vrfb_supported()") Signed-off-by: Uwe Kleine-König Signed-off-by: Helge Deller commit 02d487fa30042fb68392e36f04e51fda266637e7 Author: Christophe JAILLET Date: Sat Oct 21 08:53:37 2023 +0200 fbdev: offb: Simplify offb_init_fb() Turn a strcpy()+strncat()+'\0' into an equivalent snprintf(). Signed-off-by: Christophe JAILLET Signed-off-by: Helge Deller commit 7be6adf11370d58f9a7afa50fbf06801db04af5c Author: Andy Shevchenko Date: Wed Oct 18 06:47:25 2023 +0300 fbdev: omapfb: Replace custom memparse() implementation Our library has memparse() for parsing numbers with respective suffixes suitable for memory sizes. Use it instead of custom implementation. Signed-off-by: Andy Shevchenko Signed-off-by: Helge Deller commit e89a60ba93c266ee3606adcdd460412c1e7c0924 Author: Andy Shevchenko Date: Wed Oct 18 06:37:50 2023 +0300 fbdev: omapfb: Do not shadow error code from platform_get_irq() There is no point in shadowing the error codes from platform_get_irq(). Refactor omapfb_do_probe() accordingly. Signed-off-by: Andy Shevchenko Signed-off-by: Helge Deller commit 015c9cbcf0ad709079117d27c2094a46e0eadcdb Author: Victor Shih Date: Tue Nov 7 17:57:40 2023 +0800 mmc: sdhci-pci-gli: GL9750: Mask the replay timer timeout of AER Due to a flaw in the hardware design, the GL9750 replay timer frequently times out when ASPM is enabled. As a result, the warning messages will often appear in the system log when the system accesses the GL9750 PCI config. Therefore, the replay timer timeout must be masked. Fixes: d7133797e9e1 ("mmc: sdhci-pci-gli: A workaround to allow GL9750 to enter ASPM L1.2") Signed-off-by: Victor Shih Acked-by: Adrian Hunter Acked-by: Kai-Heng Feng Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231107095741.8832-2-victorshihgli@gmail.com Signed-off-by: Ulf Hansson commit 85dd3af64965c1c0eb7373b340a1b1f7773586b0 Author: Victor Shih Date: Tue Nov 7 17:57:41 2023 +0800 mmc: sdhci-pci-gli: GL9755: Mask the replay timer timeout of AER Due to a flaw in the hardware design, the GL9755 replay timer frequently times out when ASPM is enabled. As a result, the warning messages will often appear in the system log when the system accesses the GL9755 PCI config. Therefore, the replay timer timeout must be masked. Fixes: 36ed2fd32b2c ("mmc: sdhci-pci-gli: A workaround to allow GL9755 to enter ASPM L1.2") Signed-off-by: Victor Shih Acked-by: Adrian Hunter Acked-by: Kai-Heng Feng Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231107095741.8832-3-victorshihgli@gmail.com Signed-off-by: Ulf Hansson commit 45f2f28bd498fb697d07a38775d55f0f50fee5ca Author: Eugen Hristev Date: Tue Oct 31 13:22:18 2023 +0200 ASoC: SOF: sof-client: trivial: fix comment typo Fix typo s/depndent/dependent Fixes: 6e9548cdb30e ("ASoC: SOF: Convert the generic IPC flood test into SOF client") Signed-off-by: Eugen Hristev Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231031112218.79136-1-eugen.hristev@collabora.com Signed-off-by: Mark Brown commit 403edfa436286b21f5ffe6856ae5b36396e8966c Author: Ilkka Koskinen Date: Thu Nov 2 11:30:12 2023 -0700 arm64/arm: arm_pmuv3: perf: Don't truncate 64-bit registers The driver used to truncate several 64-bit registers such as PMCEID[n] registers used to describe whether architectural and microarchitectural events in range 0x4000-0x401f exist. Due to discarding the bits, the driver made the events invisible, even if they existed. Moreover, PMCCFILTR and PMCR registers have additional bits in the upper 32 bits. This patch makes them available although they aren't currently used. Finally, functions handling PMXEVCNTR and PMXEVTYPER registers are removed as they not being used at all. Fixes: df29ddf4f04b ("arm64: perf: Abstract system register accesses away") Reported-by: Carl Worth Signed-off-by: Ilkka Koskinen Acked-by: Will Deacon Closes: https://lore.kernel.org/.. Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20231102183012.1251410-1-ilkka@os.amperecomputing.com Signed-off-by: Catalin Marinas commit 15c7ef7341a2e54cfa12ac502c65d6fd2cce2b62 Author: Ilkka Koskinen Date: Thu Nov 2 17:16:54 2023 -0700 perf: arm_cspmu: Reject events meant for other PMUs Coresight PMU driver didn't reject events meant for other PMUs. This caused some of the Core PMU events disappearing from the output of "perf list". In addition, trying to run e.g. $ perf stat -e r2 sleep 1 made Coresight PMU driver to handle the event instead of letting Core PMU driver to deal with it. Cc: stable@vger.kernel.org Fixes: e37dfd65731d ("perf: arm_cspmu: Add support for ARM CoreSight PMU driver") Signed-off-by: Ilkka Koskinen Acked-by: Will Deacon Reviewed-by: Besar Wicaksono Acked-by: Mark Rutland Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20231103001654.35565-1-ilkka@os.amperecomputing.com Signed-off-by: Catalin Marinas commit 6eeeb4c7e4b5e03405b335fa7ce340922b7ce089 Author: Marielle Novastrider Date: Tue Oct 31 20:08:38 2023 +0000 Documentation/arm64: Fix typos in elf_hwcaps Small typos in register and field names. Signed-off-by: Marielle Novastrider Acked-by: Will Deacon Link: https://lore.kernel.org/r/20231031200838.55569-1-marielle@novastrider.com Signed-off-by: Catalin Marinas commit 64bc7eee421fafc5d491d65bff74f46430fe61af Author: Christian Brauner Date: Tue Nov 7 10:50:38 2023 +0100 iomap: rename iomap entry Since this is now part of the vfs trees rename it accordingly and remove the old tree referencing xfs. Signed-off-by: Christian Brauner commit 9aedd10fe38418319bd8ed55dc68a40ec04aaa05 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Tue Nov 7 02:37:17 2023 +0000 crypto: ahash - Set using_shash for cloned ahash wrapper over shash The cloned child of ahash that uses shash under the hood should use shash helpers (like crypto_shash_setkey()). The following panic may be observed on TCP-AO selftests: > ================================================================== > BUG: KASAN: wild-memory-access in crypto_mod_get+0x1b/0x60 > Write of size 4 at addr 5d5be0ff5c415e14 by task connect_ipv4/1397 > > CPU: 0 PID: 1397 Comm: connect_ipv4 Tainted: G W 6.6.0+ #47 > Call Trace: > > dump_stack_lvl+0x46/0x70 > kasan_report+0xc3/0xf0 > kasan_check_range+0xec/0x190 > crypto_mod_get+0x1b/0x60 > crypto_spawn_alg+0x53/0x140 > crypto_spawn_tfm2+0x13/0x60 > hmac_init_tfm+0x25/0x60 > crypto_ahash_setkey+0x8b/0x100 > tcp_ao_add_cmd+0xe7a/0x1120 > do_tcp_setsockopt+0x5ed/0x12a0 > do_sock_setsockopt+0x82/0x100 > __sys_setsockopt+0xe9/0x160 > __x64_sys_setsockopt+0x60/0x70 > do_syscall_64+0x3c/0xe0 > entry_SYSCALL_64_after_hwframe+0x46/0x4e > ================================================================== > general protection fault, probably for non-canonical address 0x5d5be0ff5c415e14: 0000 [#1] PREEMPT SMP KASAN > CPU: 0 PID: 1397 Comm: connect_ipv4 Tainted: G B W 6.6.0+ #47 > Call Trace: > > ? die_addr+0x3c/0xa0 > ? exc_general_protection+0x144/0x210 > ? asm_exc_general_protection+0x22/0x30 > ? add_taint+0x26/0x90 > ? crypto_mod_get+0x20/0x60 > ? crypto_mod_get+0x1b/0x60 > ? ahash_def_finup_done1+0x58/0x80 > crypto_spawn_alg+0x53/0x140 > crypto_spawn_tfm2+0x13/0x60 > hmac_init_tfm+0x25/0x60 > crypto_ahash_setkey+0x8b/0x100 > tcp_ao_add_cmd+0xe7a/0x1120 > do_tcp_setsockopt+0x5ed/0x12a0 > do_sock_setsockopt+0x82/0x100 > __sys_setsockopt+0xe9/0x160 > __x64_sys_setsockopt+0x60/0x70 > do_syscall_64+0x3c/0xe0 > entry_SYSCALL_64_after_hwframe+0x46/0x4e > > RIP: 0010:crypto_mod_get+0x20/0x60 Make sure that the child/clone has using_shash set when parent is an shash user. Fixes: 2f1f34c1bf7b ("crypto: ahash - optimize performance when wrapping shash") Cc: David Ahern Cc: "David S. Miller" Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: Eric Biggers Cc: Eric Dumazet Cc: Francesco Ruggeri To: Herbert Xu Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Salam Noureddine Cc: netdev@vger.kernel.org Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Dmitry Safonov Reviewed-by: Eric Biggers Signed-off-by: Herbert Xu commit e7ed6473c2c8c4e45dd861bfa06e96189b11d8db Author: Herbert Xu Date: Mon Nov 6 18:00:08 2023 +0800 crypto: jitterentropy - Hide esoteric Kconfig options under FIPS and EXPERT As JITTERENTROPY is selected by default if you enable the CRYPTO API, any Kconfig options added there will show up for every single user. Hide the esoteric options under EXPERT as well as FIPS so that only distro makers will see them. Reported-by: Linus Torvalds Signed-off-by: Herbert Xu Reviewed-by: Stephan Mueller Signed-off-by: Herbert Xu commit f367db71d5755d6476dd6f3d84b53c098c111255 Merge: e0c0a7c35f671 62b78fd5fe39b Author: Palmer Dabbelt Date: Mon Nov 6 22:49:30 2023 -0800 Merge patch series "riscv: tlb flush improvements" Alexandre Ghiti says: This series optimizes the tlb flushes on riscv which used to simply flush the whole tlb whatever the size of the range to flush or the size of the stride. Patch 3 introduces a threshold that is microarchitecture specific and will very likely be modified by vendors, not sure though which mechanism we'll use to do that (dt? alternatives? vendor initialization code?). * b4-shazam-merge: riscv: Improve flush_tlb_kernel_range() riscv: Make __flush_tlb_range() loop over pte instead of flushing the whole tlb riscv: Improve flush_tlb_range() for hugetlb pages riscv: Improve tlb_flush() Link: https://lore.kernel.org/r/20231030133027.19542-1-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit 62b78fd5fe39b5b82e4b4b8d0ba87ad40d1a99bb Author: Alexandre Ghiti Date: Mon Oct 30 14:30:28 2023 +0100 riscv: Improve flush_tlb_kernel_range() This function used to simply flush the whole tlb of all harts, be more subtile and try to only flush the range. The problem is that we can only use PAGE_SIZE as stride since we don't know the size of the underlying mapping and then this function will be improved only if the size of the region to flush is < threshold * PAGE_SIZE. Signed-off-by: Alexandre Ghiti Reviewed-by: Andrew Jones Tested-by: Lad Prabhakar # On RZ/Five SMARC Reviewed-by: Samuel Holland Tested-by: Samuel Holland Link: https://lore.kernel.org/r/20231030133027.19542-5-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit ba6f35964c518b4520bc3f2fe25d8457cb4a7be5 Author: Alexandre Ghiti Date: Mon Oct 30 14:30:27 2023 +0100 riscv: Make __flush_tlb_range() loop over pte instead of flushing the whole tlb Currently, when the range to flush covers more than one page (a 4K page or a hugepage), __flush_tlb_range() flushes the whole tlb. Flushing the whole tlb comes with a greater cost than flushing a single entry so we should flush single entries up to a certain threshold so that: threshold * cost of flushing a single entry < cost of flushing the whole tlb. Co-developed-by: Mayuresh Chitale Signed-off-by: Mayuresh Chitale Signed-off-by: Alexandre Ghiti Reviewed-by: Andrew Jones Tested-by: Lad Prabhakar # On RZ/Five SMARC Reviewed-by: Samuel Holland Tested-by: Samuel Holland Link: https://lore.kernel.org/r/20231030133027.19542-4-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit 9e113064b4c291ad06a7a3864691288bd2cf014f Author: Alexandre Ghiti Date: Mon Oct 30 14:30:26 2023 +0100 riscv: Improve flush_tlb_range() for hugetlb pages flush_tlb_range() uses a fixed stride of PAGE_SIZE and in its current form, when a hugetlb mapping needs to be flushed, flush_tlb_range() flushes the whole tlb: so set a stride of the size of the hugetlb mapping in order to only flush the hugetlb mapping. However, if the hugepage is a NAPOT region, all PTEs that constitute this mapping must be invalidated, so the stride size must actually be the size of the PTE. Note that THPs are directly handled by flush_pmd_tlb_range(). Signed-off-by: Alexandre Ghiti Reviewed-by: Samuel Holland Tested-by: Lad Prabhakar # On RZ/Five SMARC Link: https://lore.kernel.org/r/20231030133027.19542-3-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit 114d5c85a39a0e35024ff5156a160eef1907f3e6 Author: Alexandre Ghiti Date: Mon Oct 30 14:30:25 2023 +0100 riscv: Improve tlb_flush() For now, tlb_flush() simply calls flush_tlb_mm() which results in a flush of the whole TLB. So let's use mmu_gather fields to provide a more fine-grained flush of the TLB. Signed-off-by: Alexandre Ghiti Reviewed-by: Andrew Jones Reviewed-by: Samuel Holland Tested-by: Lad Prabhakar # On RZ/Five SMARC Link: https://lore.kernel.org/r/20231030133027.19542-2-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit 644b6025bcaff59737270d812c70302f5a8d4a8f Author: Nathan Lynch Date: Mon Nov 6 07:42:54 2023 -0600 powerpc/rtas: Fix ppc_rtas_rmo_buf_show() kernel-doc >From a W=1 build: >> arch/powerpc/kernel/rtas-proc.c:771: warning: Function parameter or member 'm' not described in >> 'ppc_rtas_rmo_buf_show' >> arch/powerpc/kernel/rtas-proc.c:771: warning: Function parameter or member 'v' not described in >> 'ppc_rtas_rmo_buf_show' Add the missing parameter descriptions. Signed-off-by: Nathan Lynch Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309211645.1Lvwmbv4-lkp@intel.com/ Signed-off-by: Michael Ellerman Link: https://msgid.link/20231106-rtas-trivial-v1-2-61847655c51f@linux.ibm.com commit 65083333d3d16b282674aeef5cce5c72226c05e0 Author: Nathan Lynch Date: Mon Nov 6 07:42:53 2023 -0600 powerpc/pseries/rtas-work-area: Fix rtas_work_area_reserve_arena() kernel-doc >From a W=1 build: >> arch/powerpc/platforms/pseries/rtas-work-area.c:189: warning: Function parameter or member 'limit' not >> described in 'rtas_work_area_reserve_arena' Add the missing description of the limit parameter. Signed-off-by: Nathan Lynch Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309131221.Bm1pg96n-lkp@intel.com/ Signed-off-by: Michael Ellerman Link: https://msgid.link/20231106-rtas-trivial-v1-1-61847655c51f@linux.ibm.com commit 115c0f4d58574524ed7fbbcce1b0a86aa5249db1 Author: Eric Dumazet Date: Fri Nov 3 20:04:51 2023 +0000 idpf: fix potential use-after-free in idpf_tso() skb_cow_head() can change skb->head (and thus skb_shinfo(skb)) We must not cache skb_shinfo(skb) before skb_cow_head(). Fixes: 6818c4d5b3c2 ("idpf: add splitq start_xmit") Signed-off-by: Eric Dumazet Cc: Joshua Hay Cc: Alan Brady Cc: Madhu Chittim Cc: Phani Burra Cc: Sridhar Samudrala Cc: Willem de Bruijn Cc: Pavan Kumar Linga Cc: Tony Nguyen Cc: Bailey Forrest Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231103200451.514047-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 9fc3bc7643341dc5be7d269f3d3dbe441d8d7ac3 Author: George Shuklin Date: Fri Nov 3 13:50:29 2023 +0200 tg3: power down device only on SYSTEM_POWER_OFF Dell R650xs servers hangs on reboot if tg3 driver calls tg3_power_down. This happens only if network adapters (BCM5720 for R650xs) were initialized using SNP (e.g. by booting ipxe.efi). The actual problem is on Dell side, but this fix allows servers to come back alive after reboot. Signed-off-by: George Shuklin Fixes: 2ca1c94ce0b6 ("tg3: Disable tg3 device on system reboot to avoid triggering AER") Reviewed-by: Pavan Chebbi Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/20231103115029.83273-1-george.shuklin@gmail.com Signed-off-by: Jakub Kicinski commit 68c51db3a16d258e730dd1c04a1de2f7ab038ddf Author: Marcin Szycik Date: Wed Oct 25 16:47:24 2023 +0200 ice: Fix VF-VF direction matching in drop rule in switchdev When adding a drop rule on a VF, rule direction is not being set, which results in it always being set to ingress (ICE_ESWITCH_FLTR_INGRESS equals 0). Because of this, drop rules added on port representors don't match any packets. To fix it, set rule direction in drop action to egress when netdev is a port representor, otherwise set it to ingress. Fixes: 0960a27bd479 ("ice: Add direction metadata") Reviewed-by: Michal Swiatkowski Signed-off-by: Marcin Szycik Tested-by: Sujai Buvaneswaran Reviewed-by: Simon Horman Signed-off-by: Tony Nguyen commit 8b3c8c55ccbc02920b0ae6601c66df24f0d833bd Author: Aniruddha Paul Date: Fri Oct 13 19:13:42 2023 +0530 ice: Fix VF-VF filter rules in switchdev mode Any packet leaving VSI i.e VF's VSI is considered as egress traffic by HW, thus failing to match the added rule. Mark the direction for redirect rules as below: 1. VF-VF - Egress 2. Uplink-VF - Ingress 3. VF-Uplink - Egress 4. Link_Partner-Uplink - Ingress 5. Link_Partner-VF - Ingress Fixes: 0960a27bd479 ("ice: Add direction metadata") Reviewed-by: Przemek Kitszel Reviewed-by: Wojciech Drewek Signed-off-by: Aniruddha Paul Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen commit e1db8c2a01d7e12bd566106fbeefa3c5cccd2003 Author: Michal Schmidt Date: Mon Oct 23 12:59:53 2023 +0200 ice: lag: in RCU, use atomic allocation Sleeping is not allowed in RCU read-side critical sections. Use atomic allocations under rcu_read_lock. Fixes: 1e0f9881ef79 ("ice: Flesh out implementation of support for SRIOV on bonded interface") Fixes: 41ccedf5ca8f ("ice: implement lag netdev event handler") Fixes: 3579aa86fb40 ("ice: update reset path for SRIOV LAG support") Signed-off-by: Michal Schmidt Reviewed-by: Wojciech Drewek Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Reviewed-by: Simon Horman Signed-off-by: Tony Nguyen commit 3e39da4fa16c9c09207d98b8a86a6f6436b531c9 Author: Dave Ertman Date: Tue Oct 10 10:32:15 2023 -0700 ice: Fix SRIOV LAG disable on non-compliant aggregate If an attribute of an aggregate interface disqualifies it from supporting SRIOV, the driver will unwind the SRIOV support. Currently the driver is clearing the feature bit for all interfaces in the aggregate, but this is not allowing the other interfaces to unwind successfully on driver unload. Only clear the feature bit for the interface that is currently unwinding. Fixes: bf65da2eb279 ("ice: enforce interface eligibility and add messaging for SRIOV LAG") Signed-off-by: Dave Ertman Reviewed-by: Wojciech Drewek Reviewed-by: Simon Horman Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen commit e0c0a7c35f67191152635e5913f76aa7094d967c Author: Andreas Schwab Date: Tue Oct 31 12:40:47 2023 +0100 riscv: select ARCH_PROC_KCORE_TEXT This adds a separate segment for kernel text in /proc/kcore, which has a different address than the direct linear map. Signed-off-by: Andreas Schwab Link: https://lore.kernel.org/r/mvmh6m758ao.fsf@suse.de Signed-off-by: Palmer Dabbelt commit aa54d846f3613fa9651786308c6f438e8705aff1 Author: Ivan Vecera Date: Tue Oct 24 14:51:09 2023 +0200 i40e: Fix devlink port unregistering Ensure that devlink port is unregistered after unregistering of net device. Reproducer: [root@host ~]# rmmod i40e [ 4742.939386] i40e 0000:02:00.1: i40e_ptp_stop: removed PHC on enp2s0f1np1 [ 4743.059269] ------------[ cut here ]------------ [ 4743.063900] WARNING: CPU: 21 PID: 10766 at net/devlink/port.c:1078 devl_port_unregister+0x69/0x80 ... Fixes: 9e479d64dc58 ("i40e: Add initial devlink support") Signed-off-by: Ivan Vecera Reviewed-by: Jiri Pirko Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit e96fe283c6f45dd888536ccb7b0464569533f791 Author: Ivan Vecera Date: Tue Oct 24 14:51:08 2023 +0200 i40e: Do not call devlink_port_type_clear() Do not call devlink_port_type_clear() prior devlink port unregister and let devlink core to take care about it. Reproducer: [root@host ~]# rmmod i40e [ 4539.964699] i40e 0000:02:00.0: devlink port type for port 0 cleared without a software interface reference, device type not supported by the kernel? [ 4540.319811] i40e 0000:02:00.1: devlink port type for port 1 cleared without a software interface reference, device type not supported by the kernel? Fixes: 9e479d64dc58 ("i40e: Add initial devlink support") Signed-off-by: Ivan Vecera Reviewed-by: Jiri Pirko Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit cdd5b5a9761fd66d17586e4f4ba6588c70e640ea Merge: 5c15c60e7be61 28d3fe3235470 Author: Dmitry Torokhov Date: Mon Nov 6 15:42:08 2023 -0800 Merge branch 'next' into for-linus Prepare input updates for 6.7 merge window. commit be3ca57cfb777ad820c6659d52e60bbdd36bf5ff Merge: d2f51b3516dad 3e238417254bf Author: Linus Torvalds Date: Mon Nov 6 15:06:06 2023 -0800 Merge tag 'media/v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - the old V4L2 core videobuf kAPI was finally removed. All media drivers should now be using VB2 kAPI - new automotive driver: mgb4 - new platform video driver: npcm-video - new sensor driver: mt9m114 - new TI driver used in conjunction with Cadence CSI2RX IP to bridge TI-specific parts - ir-rx51 was removed and the N900 DT binding was moved to the pwm-ir-tx generic driver - drop atomisp-specific ov5693, using the upstream driver instead - the camss driver has gained RDI3 support for VFE 17x - the atomisp driver now detects ISP2400 or ISP2401 at run time. No need to set it up at build time anymore - lots of driver fixes, cleanups and improvements * tag 'media/v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (377 commits) media: nuvoton: VIDEO_NPCM_VCD_ECE should depend on ARCH_NPCM media: venus: Fix firmware path for resources media: venus: hfi_cmds: Replace one-element array with flex-array member and use __counted_by media: venus: hfi_parser: Add check to keep the number of codecs within range media: venus: hfi: add checks to handle capabilities from firmware media: venus: hfi: fix the check to handle session buffer requirement media: venus: hfi: add checks to perform sanity on queue pointers media: platform: cadence: select MIPI_DPHY dependency media: MAINTAINERS: Fix path for J721E CSI2RX bindings media: cec: meson: always include meson sub-directory in Makefile media: videobuf2: Fix IS_ERR checking in vb2_dc_put_userptr() media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config() media: mediatek: vcodec: using encoder device to alloc/free encoder memory media: imx-jpeg: notify source chagne event when the first picture parsed media: cx231xx: Use EP5_BUF_SIZE macro media: siano: Drop unnecessary error check for debugfs_create_dir/file() media: mediatek: vcodec: Handle invalid encoder vsi media: aspeed: Drop unnecessary error check for debugfs_create_file() Documentation: media: buffer.rst: fix V4L2_BUF_FLAG_PREPARED Documentation: media: gen-errors.rst: fix confusing ENOTTY description ... commit e53759298a7d7e98c3e5c2440d395d19cea7d6bf Author: Dylan Yudaken Date: Mon Nov 6 20:39:09 2023 +0000 io_uring: do not clamp read length for multishot read When doing a multishot read, the code path reuses the old read paths. However this breaks an assumption built into those paths, namely that struct io_rw::len is available for reuse by __io_import_iovec. For multishot this results in len being set for the first receive call, and then subsequent calls are clamped to that buffer length incorrectly. Instead keep len as zero after recycling buffers, to reuse the full buffer size of the next selected buffer. Fixes: fc68fcda0491 ("io_uring/rw: add support for IORING_OP_READ_MULTISHOT") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20231106203909.197089-4-dyudaken@gmail.com Signed-off-by: Jens Axboe commit 49fbe99486786661994a55ced855c31d966bbdf0 Author: Dylan Yudaken Date: Mon Nov 6 20:39:08 2023 +0000 io_uring: do not allow multishot read to set addr or len For addr: this field is not used, since buffer select is forced. But by forcing it to be zero it leaves open future uses of the field. len is actually usable, you could imagine that you want to receive multishot up to a certain length. However right now this is not how it is implemented, and it seems safer to force this to be zero. Fixes: fc68fcda0491 ("io_uring/rw: add support for IORING_OP_READ_MULTISHOT") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20231106203909.197089-3-dyudaken@gmail.com Signed-off-by: Jens Axboe commit 89d528ba2f8281de61163c6b62e598b64d832175 Author: Dylan Yudaken Date: Mon Nov 6 20:39:07 2023 +0000 io_uring: indicate if io_kbuf_recycle did recycle anything It can be useful to know if io_kbuf_recycle did actually recycle the buffer on the request, or if it left the request alone. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20231106203909.197089-2-dyudaken@gmail.com Signed-off-by: Jens Axboe commit 4cc0d8a3f109fbdd8100ed88fc9417203a5d5b4e Author: Clément Léger Date: Tue Oct 24 15:26:53 2023 +0200 riscv: kernel: Use correct SYM_DATA_*() macro for data Some data were incorrectly annotated with SYM_FUNC_*() instead of SYM_DATA_*() ones. Use the correct ones. Signed-off-by: Clément Léger Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20231024132655.730417-4-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt commit 76329c693924d8f37afbf361f0d8daab594e1644 Author: Clément Léger Date: Tue Oct 24 15:26:52 2023 +0200 riscv: Use SYM_*() assembly macros instead of deprecated ones ENTRY()/END()/WEAK() macros are deprecated and we should make use of the new SYM_*() macros [1] for better annotation of symbols. Replace the deprecated ones with the new ones and fix wrong usage of END()/ENDPROC() to correctly describe the symbols. [1] https://docs.kernel.org/core-api/asm-annotations.html Signed-off-by: Clément Léger Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20231024132655.730417-3-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt commit b18f7296fbfdb2ad0871f00f3042fc74663d52ac Author: Clément Léger Date: Tue Oct 24 15:26:51 2023 +0200 riscv: use ".L" local labels in assembly when applicable For the sake of coherency, use local labels in assembly when applicable. This also avoid kprobes being confused when applying a kprobe since the size of function is computed by checking where the next visible symbol is located. This might end up in computing some function size to be way shorter than expected and thus failing to apply kprobes to the specified offset. Signed-off-by: Clément Léger Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20231024132655.730417-2-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt commit 57a4542cb7c9baa1509c3366b57a08d75b212ead Author: Geert Uytterhoeven Date: Tue Oct 24 16:53:18 2023 +0200 riscv: boot: Fix creation of loader.bin When flashing loader.bin for K210 using kflash:     [ERROR] This is an ELF file and cannot be programmed to flash directly: arch/riscv/boot/loader.bin Before, loader.bin relied on "OBJCOPYFLAGS := -O binary" in the main RISC-V Makefile to create a boot image with the right format. With this removed, the image is now created in the wrong (ELF) format. Fix this by adding an explicit rule. Fixes: 505b02957e74f0c5 ("riscv: Remove duplicate objcopy flag") Signed-off-by: Geert Uytterhoeven Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/1086025809583809538dfecaa899892218f44e7e.1698159066.git.geert+renesas@glider.be Signed-off-by: Palmer Dabbelt commit 4733b65d82bdb19bca5ba47ff6c9b24bce1b3f9f Author: Hannes Reinecke Date: Tue Oct 24 08:13:37 2023 +0200 nvme: start keep-alive after admin queue setup Setting up I/O queues might take quite some time on larger and/or busy setups, so KATO might expire before all I/O queues could be set up. Fix this by start keep alive from the ->init_ctrl_finish() callback, and stopping it when calling nvme_cancel_admin_tagset(). Signed-off-by: Hannes Reinecke Tested-by: Mark O'Donovan [fixed nvme-fc compile error] Signed-off-by: Keith Busch commit 23816724fdbd47c28bc998866fd7bc5ad9f0e535 Author: Yuran Pereira Date: Sun Nov 5 13:18:08 2023 +0530 kdb: Corrects comment for kdballocenv This patch corrects the comment for the kdballocenv function. The previous comment incorrectly described the function's parameters and return values. Signed-off-by: Yuran Pereira Link: https://lore.kernel.org/r/DB3PR10MB6835B383B596133EDECEA98AE8ABA@DB3PR10MB6835.EURPRD10.PROD.OUTLOOK.COM [daniel.thompson@linaro.org: fixed whitespace alignment in new lines] Signed-off-by: Daniel Thompson commit 55adcdbbdd349de935de677ccb59ff8be8c67f6a Author: Hannes Reinecke Date: Tue Oct 24 08:13:36 2023 +0200 nvme-loop: always quiesce and cancel commands before destroying admin q Once ->init_ctrl_finish() is called there may be commands outstanding, so we should quiesce the admin queue and cancel all commands prior to call nvme_loop_destroy_admin_queue(). Signed-off-by: Hannes Reinecke Tested-by: Mark O'Donovan Signed-off-by: Keith Busch commit fd1418de10b9ca03d78404cf00a95138689ea369 Author: Hannes Reinecke Date: Tue Oct 24 08:13:35 2023 +0200 nvme-tcp: avoid open-coding nvme_tcp_teardown_admin_queue() nvme_tcp_setup_ctrl() has an open-coded version of nvme_tcp_teardown_admin_queue(). Signed-off-by: Hannes Reinecke Tested-by: Mark O'Donovan Signed-off-by: Keith Busch commit 6f66d046eade7a5b979e349ac52026ddfe2776b3 Author: Mark O'Donovan Date: Wed Oct 25 10:51:25 2023 +0000 nvme-auth: always set valid seq_num in dhchap reply Currently a seqnum of zero is sent during uni-directional authentication. The zero value is reserved for the secure channel feature which is not yet implemented. Relevant extract from the spec: The value 0h is used to indicate that bidirectional authentication is not performed, but a challenge value C2 is carried in order to generate a pre-shared key (PSK) for subsequent establishment of a secure channel Signed-off-by: Mark O'Donovan Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke commit fc1e03eacac8e5ff8664ce2ebadabba8604f09f4 Author: Mark O'Donovan Date: Wed Oct 25 10:51:24 2023 +0000 nvme-auth: add flag for bi-directional auth Introduces an explicit variable for bi-directional auth. The currently used variable chap->s2 is incorrectly zeroed for uni-directional auth. That will be fixed in the next patch so this needs to change to avoid sending unexpected success2 messages Signed-off-by: Mark O'Donovan Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke commit 75276847f4e262a52ccaf1a1c6b929280ddf77f6 Author: Mark O'Donovan Date: Wed Oct 25 10:51:23 2023 +0000 nvme-auth: auth success1 msg always includes resp In cases where RVALID is false, the response is still transmitted, but is cleared to zero. Relevant extract from the spec: Response R2, if valid (i.e., if the RVALID field is set to 01h), cleared to 0h otherwise Signed-off-by: Mark O'Donovan Reviewed-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig commit 1147dd0503564fa0e03489a039f9e0c748a03db4 Author: Anuj Gupta Date: Thu Oct 19 00:54:30 2023 +0530 nvme: fix error-handling for io_uring nvme-passthrough Driver may return an error before submitting the command to the device. Ensure that such error is propagated up. Fixes: 456cba386e94 ("nvme: wire-up uring-cmd support for io-passthru on char-device.") Signed-off-by: Anuj Gupta Signed-off-by: Kanchan Joshi Reviewed-by: Niklas Cassel Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 983a338b96c8a25b81e773b643f80634358e81bc Author: Daniel Wagner Date: Mon Oct 30 17:00:44 2023 +0100 nvme: update firmware version after commit The firmware version sysfs entry needs to be updated after a successfully firmware activation. nvme-cli stopped issuing an Identify Controller command to list the current firmware information and relies on sysfs showing the current firmware version. Reported-by: Kenji Tomonaga Signed-off-by: Daniel Wagner Tested-by: Kenji Tomonaga Reviewed-by: Christoph Hellwig Reviewed-by: Niklas Cassel [fixed off-by one afi index] Signed-off-by: Keith Busch commit 0e32fdd7968eb9a39aa4d4111aef0fda8684af9e Author: Christophe JAILLET Date: Mon Oct 30 15:49:28 2023 +0100 nvme-tcp: Fix a memory leak All error handling path end to the error handling path, except this one. Go to the error handling branch as well here, otherwise 'icreq' and 'icresp' will leak. Fixes: 2837966ab2a8 ("nvme-tcp: control message handling for recvmsg()") Signed-off-by: Christophe JAILLET Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 744eac783f9e105358eed05b42dcc5c5789744b3 Author: Eric Biggers Date: Sat Oct 28 22:00:40 2023 -0700 nvme-auth: use crypto_shash_tfm_digest() Simplify nvme_auth_augmented_challenge() by using crypto_shash_tfm_digest() instead of an alloc+init+update+final sequence. This should also improve performance. Signed-off-by: Eric Biggers Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch commit 9ba91d1356db3ad4df7c79d5284bc1427d51c03b Merge: dbfbda3bd6bfb 5e22bfd520ea8 Author: Palmer Dabbelt Date: Mon Nov 6 07:20:54 2023 -0800 Merge patch series "riscv: tlb flush improvements" Alexandre Ghiti says: This series optimizes the tlb flushes on riscv which used to simply flush the whole tlb whatever the size of the range to flush or the size of the stride. Patch 3 introduces a threshold that is microarchitecture specific and will very likely be modified by vendors, not sure though which mechanism we'll use to do that (dt? alternatives? vendor initialization code?). * b4-shazam-merge: riscv: Improve flush_tlb_kernel_range() riscv: Make __flush_tlb_range() loop over pte instead of flushing the whole tlb riscv: Improve flush_tlb_range() for hugetlb pages riscv: Improve tlb_flush() Link: https://lore.kernel.org/r/20231030133027.19542-1-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit 5e22bfd520ea8740e9a20314d2a890baf304c9d2 Author: Alexandre Ghiti Date: Mon Oct 30 14:30:28 2023 +0100 riscv: Improve flush_tlb_kernel_range() This function used to simply flush the whole tlb of all harts, be more subtile and try to only flush the range. The problem is that we can only use PAGE_SIZE as stride since we don't know the size of the underlying mapping and then this function will be improved only if the size of the region to flush is < threshold * PAGE_SIZE. Signed-off-by: Alexandre Ghiti Reviewed-by: Andrew Jones Tested-by: Lad Prabhakar # On RZ/Five SMARC Reviewed-by: Samuel Holland Tested-by: Samuel Holland Link: https://lore.kernel.org/r/20231030133027.19542-5-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit 9d4e8d5fa7dbbb606b355f40d918a1feef821bc5 Author: Alexandre Ghiti Date: Mon Oct 30 14:30:27 2023 +0100 riscv: Make __flush_tlb_range() loop over pte instead of flushing the whole tlb Currently, when the range to flush covers more than one page (a 4K page or a hugepage), __flush_tlb_range() flushes the whole tlb. Flushing the whole tlb comes with a greater cost than flushing a single entry so we should flush single entries up to a certain threshold so that: threshold * cost of flushing a single entry < cost of flushing the whole tlb. Co-developed-by: Mayuresh Chitale Signed-off-by: Mayuresh Chitale Signed-off-by: Alexandre Ghiti Reviewed-by: Andrew Jones Tested-by: Lad Prabhakar # On RZ/Five SMARC Reviewed-by: Samuel Holland Tested-by: Samuel Holland Link: https://lore.kernel.org/r/20231030133027.19542-4-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit c962a6e7463980a513e990a7a8a9967e529ad467 Author: Alexandre Ghiti Date: Mon Oct 30 14:30:26 2023 +0100 riscv: Improve flush_tlb_range() for hugetlb pages flush_tlb_range() uses a fixed stride of PAGE_SIZE and in its current form, when a hugetlb mapping needs to be flushed, flush_tlb_range() flushes the whole tlb: so set a stride of the size of the hugetlb mapping in order to only flush the hugetlb mapping. However, if the hugepage is a NAPOT region, all PTEs that constitute this mapping must be invalidated, so the stride size must actually be the size of the PTE. Note that THPs are directly handled by flush_pmd_tlb_range(). Signed-off-by: Alexandre Ghiti Reviewed-by: Samuel Holland Tested-by: Lad Prabhakar # On RZ/Five SMARC Link: https://lore.kernel.org/r/20231030133027.19542-3-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit c5e9b2c2ae82231d85d9650854e7b3e97dde33da Author: Alexandre Ghiti Date: Mon Oct 30 14:30:25 2023 +0100 riscv: Improve tlb_flush() For now, tlb_flush() simply calls flush_tlb_mm() which results in a flush of the whole TLB. So let's use mmu_gather fields to provide a more fine-grained flush of the TLB. Signed-off-by: Alexandre Ghiti Reviewed-by: Andrew Jones Reviewed-by: Samuel Holland Tested-by: Lad Prabhakar # On RZ/Five SMARC Link: https://lore.kernel.org/r/20231030133027.19542-2-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt commit f688944cfb810986c626cb13d95bc666e5c8a36c Author: Jens Axboe Date: Mon Nov 6 07:43:16 2023 -0700 io_uring/rw: add separate prep handler for fixed read/write Rather than sprinkle opcode checks in the generic read/write prep handler, have a separate prep handler for the vectored readv/writev operation. Signed-off-by: Jens Axboe commit 0e984ec88da9747549227900e5215c5e6a1b65ae Author: Jens Axboe Date: Mon Nov 6 07:41:17 2023 -0700 io_uring/rw: add separate prep handler for readv/writev Rather than sprinkle opcode checks in the generic read/write prep handler, have a separate prep handler for the vectored readv/writev operation. Signed-off-by: Jens Axboe commit 1a229d8690a0f8951fc4aa8b76a7efab0d8de342 Author: Johan Hovold Date: Mon Nov 6 12:06:54 2023 +0100 Revert "usb: phy: add usb phy notify port status API" This reverts commit a08799cf17c22375752abfad3b4a2b34b3acb287. The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding. Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated "usb-phy" property which is clearly wrong. We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo. Revert the new notification interface which is broken by design. Fixes: a08799cf17c2 ("usb: phy: add usb phy notify port status API") Cc: stable@vger.kernel.org # 6.6 Cc: Stanley Chang Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20231106110654.31090-4-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit 7a784bcdd7e54f0599da3b2360e472238412623e Author: Johan Hovold Date: Mon Nov 6 12:06:53 2023 +0100 Revert "phy: realtek: usb: Add driver for the Realtek SoC USB 2.0 PHY" This reverts commit 134e6d25f6bd06071e5aac0a7eefcea6f7713955. The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding. Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated "usb-phy" property which is clearly wrong. We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo. Revert the new Realtek PHY drivers for now so that the port status notification interface can be reverted and replaced. Fixes: 134e6d25f6bd ("phy: realtek: usb: Add driver for the Realtek SoC USB 2.0 PHY") Cc: stable@vger.kernel.org # 6.6 Cc: Stanley Chang Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20231106110654.31090-3-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit 258ea41c926b7b3a16d0d7aa210a1401c4a1601b Author: Johan Hovold Date: Mon Nov 6 12:06:52 2023 +0100 Revert "phy: realtek: usb: Add driver for the Realtek SoC USB 3.0 PHY" This reverts commit adda6e82a7de7d6d478f6c8ef127f0ac51c510a1. The recently added Realtek PHY drivers depend on the new port status notification mechanism which was built on the deprecated USB PHY implementation and devicetree binding. Specifically, using these PHYs would require describing the very same PHY using both the generic "phy" property and the deprecated "usb-phy" property which is clearly wrong. We should not be building new functionality on top of the legacy USB PHY implementation even if it is currently stuck in some kind of transitional limbo. Revert the new Realtek PHY drivers for now so that the port status notification interface can be reverted and replaced. Fixes: adda6e82a7de ("phy: realtek: usb: Add driver for the Realtek SoC USB 3.0 PHY") Cc: stable@vger.kernel.org # 6.6 Cc: Stanley Chang Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20231106110654.31090-2-johan+linaro@kernel.org Signed-off-by: Greg Kroah-Hartman commit 9506fba463fcbdf8c8b7af3ec9ee34360df843fe Author: Nirmoy Das Date: Thu Oct 26 14:56:36 2023 +0200 drm/i915/tc: Fix -Wformat-truncation in intel_tc_port_init Fix below compiler warning: intel_tc.c:1879:11: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 3 [-Werror=format-truncation=] "%c/TC#%d", port_name(port), tc_port + 1); ^~ intel_tc.c:1878:2: note: ‘snprintf’ output between 7 and 17 bytes into a destination of size 8 snprintf(tc->port_name, sizeof(tc->port_name), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "%c/TC#%d", port_name(port), tc_port + 1); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v2: use kasprintf(Imre) v3: use const for port_name, and fix tc mem leak(Imre) Fixes: 3eafcddf766b ("drm/i915/tc: Move TC port fields to a new intel_tc_port struct") Cc: Mika Kahola Cc: Imre Deak Cc: Jani Nikula Signed-off-by: Nirmoy Das Reviewed-by: Andrzej Hajda Reviewed-by: Imre Deak Reviewed-by: Mika Kahola Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20231026125636.5080-1-nirmoy.das@intel.com (cherry picked from commit 70a3cbbe620ee66afb0c066624196077767e61b2) Signed-off-by: Jani Nikula commit 1a8e9bad6ef563c28ab0f8619628d5511be55431 Author: Kunwu Chan Date: Fri Nov 3 11:09:22 2023 +0000 drm/i915: Fix potential spectre vulnerability Fix smatch warning: drivers/gpu/drm/i915/gem/i915_gem_context.c:847 set_proto_ctx_sseu() warn: potential spectre issue 'pc->user_engines' [r] (local cap) Fixes: d4433c7600f7 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)") Cc: # v5.15+ Signed-off-by: Kunwu Chan Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20231103110922.430122-1-tvrtko.ursulin@linux.intel.com (cherry picked from commit 27b086382c22efb7e0a16442f7bdc2e120108ef3) Signed-off-by: Jani Nikula commit 0cb89cd42fd22bbdec0b046c48f35775f5b88bdb Author: Ville Syrjälä Date: Tue Oct 31 18:08:00 2023 +0200 drm/i915: Bump GLK CDCLK frequency when driving multiple pipes On GLK CDCLK frequency needs to be at least 2*96 MHz when accessing the audio hardware. Currently we bump the CDCLK frequency up temporarily (if not high enough already) whenever audio hardware is being accessed, and drop it back down afterwards. With a single active pipe this works just fine as we can switch between all the valid CDCLK frequencies by changing the cd2x divider, which doesn't require a full modeset. However with multiple active pipes the cd2x divider trick no longer works, and thus we end up blinking all displays off and back on. To avoid this let's just bump the CDCLK frequency to >=2*96MHz whenever multiple pipes are active. The downside is slightly higher power consumption, but that seems like an acceptable tradeoff. With a single active pipe we can stick to the current more optiomal (from power comsumption POV) behaviour. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9599 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231031160800.18371-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit 451eaa1a614c911f5a51078dcb68022874e4cb12) Signed-off-by: Jani Nikula commit 0ad755fb88bdb7452f976d97847a47dbf7496763 Author: Nirmoy Das Date: Wed Oct 25 12:28:26 2023 +0200 drm/i915/mtl: Apply notify_guc to all GTs Handle platforms with multiple GTs by iterate over all GTs. Add a Fixes commit so this gets propagated for MTL support. Fixes: 213c43676beb ("drm/i915/mtl: Remove the 'force_probe' requirement for Meteor Lake") Suggested-by: John Harrison Cc: Jani Nikula Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: Andi Shyti Cc: Andrzej Hajda Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20231025102826.16955-1-nirmoy.das@intel.com (cherry picked from commit 949113d34fb82a5dc6f5dd3ad9168001b441792b) Signed-off-by: Jani Nikula commit 18216762bcf618c52b85719d3563243f80e4a2d4 Author: Bagas Sanjaya Date: Mon Nov 6 17:12:04 2023 +0700 x86/Documentation: Indent 'note::' directive for protocol version number note The protocol version number note is between the protocol version table and the memory layout section. As such, Sphinx renders the note directive not only on the actual note, but until the end of doc. Indent the directive so that only the actual protocol version number note is rendered as such. Fixes: 2c33c27fd603 ("x86/boot: Introduce kernel_info") Signed-off-by: Bagas Sanjaya Signed-off-by: Ingo Molnar Cc: Jonathan Corbet Link: https://lore.kernel.org/r/20231106101206.76487-2-bagasdotme@gmail.com Signed-off-by: Ingo Molnar commit c2ded280a4b1b7bd93e53670528504be08d24967 Author: Amit Kumar Mahapatra Date: Sat Nov 4 00:13:51 2023 +0530 spi: spi-zynq-qspi: add spi-mem to driver kconfig dependencies Zynq QSPI driver has been converted to use spi-mem framework so add spi-mem to driver kconfig dependencies. Fixes: 67dca5e580f1 ("spi: spi-mem: Add support for Zynq QSPI controller") Signed-off-by: Amit Kumar Mahapatra Signed-off-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/1699037031-702858-1-git-send-email-radhey.shyam.pandey@amd.com Signed-off-by: Mark Brown commit 4bdcbc31ad2112385ad525b28972c45015e6ad70 Author: Jerome Brunet Date: Mon Nov 6 11:37:09 2023 +0100 ASoC: dapm: fix clock get name The name currently used to get the clock includes the dapm prefix. It should use the name as provided to the widget, without the prefix. Fixes: 3caac759681e ("ASoC: soc-dapm.c: fixup snd_soc_dapm_new_control_unlocked() error handling") Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20231106103712.703962-1-jbrunet@baylibre.com Signed-off-by: Mark Brown commit 15be353d55f9e12e34f9a819f51eb41fdef5eda8 Author: Jerome Brunet Date: Mon Nov 6 11:40:11 2023 +0100 ASoC: hdmi-codec: register hpd callback on component probe The HDMI hotplug callback to the hdmi-codec is currently registered when jack is set. The hotplug not only serves to report the ASoC jack state but also to get the ELD. It should be registered when the component probes instead, so it does not depend on the card driver registering a jack for the HDMI to properly report the ELD. Fixes: 25ce4f2b3593 ("ASoC: hdmi-codec: Get ELD in before reporting plugged event") Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20231106104013.704356-1-jbrunet@baylibre.com Signed-off-by: Mark Brown commit c1ed833e0b3b7b9edc82b97b73b2a8a10ceab241 Merge: d93f9528573e1 aa96fbd6d78d9 Author: David S. Miller Date: Mon Nov 6 10:01:08 2023 +0000 Merge branch 'smc-fixes' D. Wythe says ==================== bugfixs for smc This patches includes bugfix following: 1. hung state 2. sock leak 3. potential panic We have been testing these patches for some time, but if you have any questions, please let us know. -- v1: Fix spelling errors and incorrect function names in descriptions v2->v1: Add fix tags for bugfix patch ==================== Reviewed-by: Wenjia Zhang Signed-off-by: David S. Miller commit aa96fbd6d78d9770323b21e2c92bd38821be8852 Author: D. Wythe Date: Fri Nov 3 14:07:40 2023 +0800 net/smc: put sk reference if close work was canceled Note that we always hold a reference to sock when attempting to submit close_work. Therefore, if we have successfully canceled close_work from pending, we MUST release that reference to avoid potential leaks. Fixes: 42bfba9eaa33 ("net/smc: immediate termination for SMCD link groups") Signed-off-by: D. Wythe Reviewed-by: Dust Li Signed-off-by: David S. Miller commit c5bf605ba4f9d6fbbb120595ab95002f4716edcb Author: D. Wythe Date: Fri Nov 3 14:07:39 2023 +0800 net/smc: allow cdc msg send rather than drop it with NULL sndbuf_desc This patch re-fix the issues mentioned by commit 22a825c541d7 ("net/smc: fix NULL sndbuf_desc in smc_cdc_tx_handler()"). Blocking sending message do solve the issues though, but it also prevents the peer to receive the final message. Besides, in logic, whether the sndbuf_desc is NULL or not have no impact on the processing of cdc message sending. Hence that, this patch allows the cdc message sending but to check the sndbuf_desc with care in smc_cdc_tx_handler(). Fixes: 22a825c541d7 ("net/smc: fix NULL sndbuf_desc in smc_cdc_tx_handler()") Signed-off-by: D. Wythe Reviewed-by: Dust Li Signed-off-by: David S. Miller commit 5211c9729484c923f8d2e06bd29f9322cc42bb8f Author: D. Wythe Date: Fri Nov 3 14:07:38 2023 +0800 net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT Considering scenario: smc_cdc_rx_handler __smc_release sock_set_flag smc_close_active() sock_set_flag __set_bit(DEAD) __set_bit(DONE) Dues to __set_bit is not atomic, the DEAD or DONE might be lost. if the DEAD flag lost, the state SMC_CLOSED will be never be reached in smc_close_passive_work: if (sock_flag(sk, SOCK_DEAD) && smc_close_sent_any_close(conn)) { sk->sk_state = SMC_CLOSED; } else { /* just shutdown, but not yet closed locally */ sk->sk_state = SMC_APPFINCLOSEWAIT; } Replace sock_set_flags or __set_bit to set_bit will fix this problem. Since set_bit is atomic. Fixes: b38d732477e4 ("smc: socket closing and linkgroup cleanup") Signed-off-by: D. Wythe Reviewed-by: Dust Li Signed-off-by: David S. Miller commit d93f9528573e1d419b69ca5ff4130201d05f6b90 Author: Jakub Kicinski Date: Thu Nov 2 11:52:27 2023 -0700 nfsd: regenerate user space parsers after ynl-gen changes Commit 8cea95b0bd79 ("tools: ynl-gen: handle do ops with no input attrs") added support for some of the previously-skipped ops in nfsd. Regenerate the user space parsers to fill them in. Signed-off-by: Jakub Kicinski Acked-by: Chuck Lever Signed-off-by: David S. Miller commit 0a8e987dcc13244b5a5bc90cb1b184f813104d87 Author: Kuniyuki Iwashima Date: Thu Nov 2 14:05:48 2023 -0700 tcp: Fix SYN option room calculation for TCP-AO. When building SYN packet in tcp_syn_options(), MSS, TS, WS, and SACKPERM are used without checking the remaining bytes in the options area. To keep that logic as is, we limit the TCP-AO MAC length in tcp_ao_parse_crypto(). Currently, the limit is calculated as below. MAX_TCP_OPTION_SPACE - TCPOLEN_TSTAMP_ALIGNED - TCPOLEN_WSCALE_ALIGNED - TCPOLEN_SACKPERM_ALIGNED This looks confusing as (1) we pack SACKPERM into the leading 2-bytes of the aligned 12-bytes of TS and (2) TCPOLEN_MSS_ALIGNED is not used. Fortunately, the calculated limit is not wrong as TCPOLEN_SACKPERM_ALIGNED and TCPOLEN_MSS_ALIGNED are the same value. However, we should use the proper constant in the formula. MAX_TCP_OPTION_SPACE - TCPOLEN_MSS_ALIGNED - TCPOLEN_TSTAMP_ALIGNED - TCPOLEN_WSCALE_ALIGNED Fixes: 4954f17ddefc ("net/tcp: Introduce TCP_AO setsockopt()s") Signed-off-by: Kuniyuki Iwashima Reviewed-by: Dmitry Safonov Signed-off-by: David S. Miller commit 3423ca23e08bf285a324237abe88e7e7d9becfe6 Author: Geetha sowjanya Date: Tue Oct 31 16:53:45 2023 +0530 octeontx2-pf: Free pending and dropped SQEs On interface down, the pending SQEs in the NIX get dropped or drained out during SMQ flush. But skb's pointed by these SQEs never get free or updated to the stack as respective CQE never get added. This patch fixes the issue by freeing all valid skb's in SQ SG list. Fixes: b1bc8457e9d0 ("octeontx2-pf: Cleanup all receive buffers in SG descriptor") Signed-off-by: Geetha sowjanya Signed-off-by: David S. Miller commit 40cb2fdfed342e7e578d551a073687789f698d89 Author: Jamal Hadi Salim Date: Sat Oct 28 13:16:10 2023 -0400 net, sched: Fix SKB_NOT_DROPPED_YET splat under debug config Getting the following splat [1] with CONFIG_DEBUG_NET=y and this reproducer [2]. Problem seems to be that classifiers clear 'struct tcf_result::drop_reason', thereby triggering the warning in __kfree_skb_reason() due to reason being 'SKB_NOT_DROPPED_YET' (0). Fixed by disambiguating a legit error from a verdict with a bogus drop_reason [1] WARNING: CPU: 0 PID: 181 at net/core/skbuff.c:1082 kfree_skb_reason+0x38/0x130 Modules linked in: CPU: 0 PID: 181 Comm: mausezahn Not tainted 6.6.0-rc6-custom-ge43e6d9582e0 #682 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc37 04/01/2014 RIP: 0010:kfree_skb_reason+0x38/0x130 [...] Call Trace: __netif_receive_skb_core.constprop.0+0x837/0xdb0 __netif_receive_skb_one_core+0x3c/0x70 process_backlog+0x95/0x130 __napi_poll+0x25/0x1b0 net_rx_action+0x29b/0x310 __do_softirq+0xc0/0x29b do_softirq+0x43/0x60 [2] ip link add name veth0 type veth peer name veth1 ip link set dev veth0 up ip link set dev veth1 up tc qdisc add dev veth1 clsact tc filter add dev veth1 ingress pref 1 proto all flower dst_mac 00:11:22:33:44:55 action drop mausezahn veth0 -a own -b 00:11:22:33:44:55 -q -c 1 Ido reported: [...] getting the following splat [1] with CONFIG_DEBUG_NET=y and this reproducer [2]. Problem seems to be that classifiers clear 'struct tcf_result::drop_reason', thereby triggering the warning in __kfree_skb_reason() due to reason being 'SKB_NOT_DROPPED_YET' (0). [...] [1] WARNING: CPU: 0 PID: 181 at net/core/skbuff.c:1082 kfree_skb_reason+0x38/0x130 Modules linked in: CPU: 0 PID: 181 Comm: mausezahn Not tainted 6.6.0-rc6-custom-ge43e6d9582e0 #682 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-1.fc37 04/01/2014 RIP: 0010:kfree_skb_reason+0x38/0x130 [...] Call Trace: __netif_receive_skb_core.constprop.0+0x837/0xdb0 __netif_receive_skb_one_core+0x3c/0x70 process_backlog+0x95/0x130 __napi_poll+0x25/0x1b0 net_rx_action+0x29b/0x310 __do_softirq+0xc0/0x29b do_softirq+0x43/0x60 [2] #!/bin/bash ip link add name veth0 type veth peer name veth1 ip link set dev veth0 up ip link set dev veth1 up tc qdisc add dev veth1 clsact tc filter add dev veth1 ingress pref 1 proto all flower dst_mac 00:11:22:33:44:55 action drop mausezahn veth0 -a own -b 00:11:22:33:44:55 -q -c 1 What happens is that inside most classifiers the tcf_result is copied over from a filter template e.g. *res = f->res which then implicitly overrides the prior SKB_DROP_REASON_TC_{INGRESS,EGRESS} default drop code which was set via sch_handle_{ingress,egress}() for kfree_skb_reason(). Commit text above copied verbatim from Daniel. The general idea of the patch is not very different from what Ido originally posted but instead done at the cls_api codepath. Fixes: 54a59aed395c ("net, sched: Make tc-related drop reason more flexible") Reported-by: Ido Schimmel Signed-off-by: Jamal Hadi Salim Link: https://lore.kernel.org/netdev/ZTjY959R+AFXf3Xy@shredder Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 0e8b9f258baed25f1c5672613699247c76b007b5 Author: Zongmin Zhou Date: Tue Aug 1 10:53:09 2023 +0800 drm/qxl: prevent memory leak The allocated memory for qdev->dumb_heads should be released in qxl_destroy_monitors_object before qxl suspend. otherwise,qxl_create_monitors_object will be called to reallocate memory for qdev->dumb_heads after qxl resume, it will cause memory leak. Signed-off-by: Zongmin Zhou Link: https://lore.kernel.org/r/20230801025309.4049813-1-zhouzongmin@kylinos.cn Reviewed-by: Dave Airlie Signed-off-by: Maxime Ripard commit a409d9600959f3c4b2a48946304c8e01b8d04072 Author: Jia He Date: Sat Oct 28 10:20:59 2023 +0000 dma-mapping: fix dma_addressing_limited() if dma_range_map can't cover all system RAM There is an unusual case that the range map covers right up to the top of system RAM, but leaves a hole somewhere lower down. Then it prevents the nvme device dma mapping in the checking path of phys_to_dma() and causes the hangs at boot. E.g. On an Armv8 Ampere server, the dsdt ACPI table is: Method (_DMA, 0, Serialized) // _DMA: Direct Memory Access { Name (RBUF, ResourceTemplate () { QWordMemory (ResourceConsumer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, 0x0000000000000000, // Granularity 0x0000000000000000, // Range Minimum 0x00000000FFFFFFFF, // Range Maximum 0x0000000000000000, // Translation Offset 0x0000000100000000, // Length ,, , AddressRangeMemory, TypeStatic) QWordMemory (ResourceConsumer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, 0x0000000000000000, // Granularity 0x0000006010200000, // Range Minimum 0x000000602FFFFFFF, // Range Maximum 0x0000000000000000, // Translation Offset 0x000000001FE00000, // Length ,, , AddressRangeMemory, TypeStatic) QWordMemory (ResourceConsumer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, 0x0000000000000000, // Granularity 0x00000060F0000000, // Range Minimum 0x00000060FFFFFFFF, // Range Maximum 0x0000000000000000, // Translation Offset 0x0000000010000000, // Length ,, , AddressRangeMemory, TypeStatic) QWordMemory (ResourceConsumer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, 0x0000000000000000, // Granularity 0x0000007000000000, // Range Minimum 0x000003FFFFFFFFFF, // Range Maximum 0x0000000000000000, // Translation Offset 0x0000039000000000, // Length ,, , AddressRangeMemory, TypeStatic) }) But the System RAM ranges are: cat /proc/iomem |grep -i ram 90000000-91ffffff : System RAM 92900000-fffbffff : System RAM 880000000-fffffffff : System RAM 8800000000-bff5990fff : System RAM bff59d0000-bff5a4ffff : System RAM bff8000000-bfffffffff : System RAM So some RAM ranges are out of dma_range_map. Fix it by checking whether each of the system RAM resources can be properly encompassed within the dma_range_map. Signed-off-by: Jia He Signed-off-by: Christoph Hellwig commit 8ae0e970319ac0b516d285650a744bab4ed3dd37 Author: Jia He Date: Sat Oct 28 10:20:58 2023 +0000 dma-mapping: move dma_addressing_limited() out of line This patch moves dma_addressing_limited() out of line, serving as a preliminary step to prevent the introduction of a new publicly accessible low-level helper when validating whether all system RAM is mapped within the DMA mapping range. Suggested-by: Christoph Hellwig Signed-off-by: Jia He Signed-off-by: Christoph Hellwig commit deebe5f607d7f72f83c41163191ad0c1c4356385 Author: Thomas Zimmermann Date: Fri Sep 22 10:04:59 2023 +0200 powerpc/fb: Call internal __phys_mem_access_prot() in fbdev code Call __phys_mem_access_prot() from the fbdev mmap helper pgprot_framebuffer(). Allows to avoid the file argument of NULL. Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann Signed-off-by: Michael Ellerman Link: https://msgid.link/20230922080636.26762-6-tzimmermann@suse.de commit 1f92a844c35e483c00bab8a7b7d39c555ee799d8 Author: Thomas Zimmermann Date: Fri Sep 22 10:04:58 2023 +0200 powerpc: Remove file parameter from phys_mem_access_prot() Remove 'file' parameter from struct machdep_calls.phys_mem_access_prot and its implementation in pci_phys_mem_access_prot(). The file is not used on PowerPC. By removing it, a later patch can simplify fbdev's mmap code, which uses phys_mem_access_prot() on PowerPC. Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann [mpe: Rebase on unrelated changes to phys_mem_access_prot()] Signed-off-by: Michael Ellerman Link: https://msgid.link/20230922080636.26762-5-tzimmermann@suse.de commit 322948c3198cf80e7c10d953ddad24ebd85757cd Author: Thomas Zimmermann Date: Fri Sep 22 10:04:57 2023 +0200 powerpc/machdep: Remove trailing whitespaces Fix coding style. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Ellerman Link: https://msgid.link/20230922080636.26762-4-tzimmermann@suse.de commit d2f51b3516dade79269ff45eae2a7668ae711b25 Merge: 7b2c9e41e73fb cfb67623ce281 Author: Linus Torvalds Date: Sun Nov 5 18:49:40 2023 -0800 Merge tag 'rtc-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "There is a new driver for the RTC of the Mstar SSD202D SoC. The rtc7301 driver gains support for byte addresses to support the USRobotics USR8200. Then we have many non user visible changes and typo fixes. Summary: Subsytem: - convert platform drivers to remove_new - prevent modpost warnings for unremovable platform drivers New driver: - Mstar SSD202D Drivers: - brcmstb-waketimer: support level alarm_irq - ep93xx: add DT support - rtc7301: support byte-addressed IO" * tag 'rtc-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (28 commits) dt-bindings: rtc: Add Mstar SSD202D RTC rtc: Add support for the SSD202D RTC rtc: at91rm9200: annotate at91_rtc_remove with __exit again dt-bindings: rtc: microcrystal,rv3032: Document wakeup-source property dt-bindings: rtc: pcf8523: Convert to YAML dt-bindings: rtc: mcp795: move to trivial-rtc rtc: ep93xx: add DT support for Cirrus EP93xx dt-bindings: rtc: Add Cirrus EP93xx dt-bindings: rtc: pcf2123: convert to YAML rtc: efi: fixed typo in efi_procfs() rtc: omap: Use device_get_match_data() rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call rtc: rtc7301: Support byte-addressed IO rtc: rtc7301: Rewrite bindings in schema rtc: sh: Convert to platform remove callback returning void rtc: pxa: Convert to platform remove callback returning void rtc: mv: Convert to platform remove callback returning void rtc: imxdi: Convert to platform remove callback returning void rtc: at91rm9200: Convert to platform remove callback returning void rtc: pcap: Drop no-op remove function ... commit 7b2c9e41e73fbe50f519072009b1e624ea230163 Merge: 77fa2fbe87fc6 96cb7a4e296da Author: Linus Torvalds Date: Sun Nov 5 18:45:32 2023 -0800 Merge tag 'mailbox-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox Pull mailbox updates from Jassi Brar: - imx: add support for TX Doorbell v2 - mtk: implement runtime PM - zynqmp: add destination mailbox compatible - qcom: - add another clock provider for IPQ - add SM8650 compatible - misc: use preferred device_get_match_data() * tag 'mailbox-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox: dt-bindings: mailbox: qcom-ipcc: document the SM8650 Inter-Processor Communication Controller mailbox: mtk-cmdq-mailbox: Implement Runtime PM with autosuspend mailbox: Use device_get_match_data() dt-bindings: zynqmp: add destination mailbox compatible dt-bindings: mailbox: qcom: add one more clock provider for IPQ mailbox mailbox: imx: support channel type tx doorbell v2 dt-bindings: mailbox: fsl,mu: add new tx doorbell channel commit 9ccde17d46554dbb2757c427f2cdf67688701f96 Merge: f056cb9681f63 6d5e0032a92df Author: Dave Airlie Date: Mon Nov 6 11:25:10 2023 +1000 Merge tag 'amd-drm-next-6.7-2023-11-03' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-6.7-2023-11-03: amdgpu: - Fix RAS support check - RAS fixes - MES fixes - SMU13 fixes - Contiguous memory allocation fix - BACO fixes - GPU reset fixes - Min power limit fixes - GFX11 fixes - USB4/TB hotplug fixes - ARM regression fix - GFX9.4.3 fixes - KASAN/KCSAN stack size check fixes - SR-IOV fixes - SMU14 fixes - PSP13 fixes - Display blend fixes - Flexible array size fixes amdkfd: - GPUVM fix radeon: - Flexible array size fixes Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20231103173203.4912-1-alexander.deucher@amd.com commit f056cb9681f631c99c7c6780c82651c86f15cf5c Merge: 2ba446f82142d 94565e95e247c Author: Dave Airlie Date: Mon Nov 6 11:24:29 2023 +1000 Merge tag 'drm-misc-next-fixes-2023-11-02' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next-fixes for v6.7-rc1: - dt binding fix for ssd132x - Initialize ssd130x crtc_state to NULL. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/58f40043-bb8a-4716-bf07-89f6a9f56c4c@linux.intel.com commit 0cdc6f44e9fdc2d20d720145bf99a39f611f6d61 Author: Andreas Gruenbacher Date: Thu Nov 2 20:52:30 2023 +0100 gfs2: don't withdraw if init_threads() got interrupted In gfs2_fill_super(), when mounting a gfs2 filesystem is interrupted, kthread_create() can return -EINTR. When that happens, we roll back what has already been done and abort the mount. Since commit 62dd0f98a0e5 ("gfs2: Flag a withdraw if init_threads() fails), we are calling gfs2_withdraw_delayed() in gfs2_fill_super(); first via gfs2_make_fs_rw(), then directly. But gfs2_withdraw_delayed() only marks the filesystem as withdrawing and relies on a caller further up the stack to do the actual withdraw, which doesn't exist in the gfs2_fill_super() case. Because the filesystem is marked as withdrawing / withdrawn, function gfs2_lm_unmount() doesn't release the dlm lockspace, so when we try to mount that filesystem again, we get: gfs2: fsid=gohan:gohan0: Trying to join cluster "lock_dlm", "gohan:gohan0" gfs2: fsid=gohan:gohan0: dlm_new_lockspace error -17 Since commit b77b4a4815a9 ("gfs2: Rework freeze / thaw logic"), the deadlock this gfs2_withdraw_delayed() call was supposed to work around cannot occur anymore because freeze_go_callback() won't take the sb->s_umount semaphore unconditionally anymore, so we can get rid of the gfs2_withdraw_delayed() in gfs2_fill_super() entirely. Reported-by: Alexander Aring Signed-off-by: Andreas Gruenbacher Cc: stable@vger.kernel.org # v6.5+ commit bb25b97562e52b2b5808b348db32568b1f5394b5 Author: Su Hui Date: Thu Nov 2 09:51:42 2023 +0800 gfs2: remove dead code in add_to_queue clang static analyzer complains that value stored to 'gh' is never read. The code of this line is useless after commit 0b93bac2271e ("gfs2: Remove LM_FLAG_PRIORITY flag"). Remove this code to save space. Signed-off-by: Su Hui Signed-off-by: Andreas Gruenbacher commit bdcb8aa434c6d36b5c215d02a9ef07551be25a37 Author: Juntong Deng Date: Mon Oct 30 05:10:06 2023 +0800 gfs2: Fix slab-use-after-free in gfs2_qd_dealloc In gfs2_put_super(), whether withdrawn or not, the quota should be cleaned up by gfs2_quota_cleanup(). Otherwise, struct gfs2_sbd will be freed before gfs2_qd_dealloc (rcu callback) has run for all gfs2_quota_data objects, resulting in use-after-free. Also, gfs2_destroy_threads() and gfs2_quota_cleanup() is already called by gfs2_make_fs_ro(), so in gfs2_put_super(), after calling gfs2_make_fs_ro(), there is no need to call them again. Reported-by: syzbot+29c47e9e51895928698c@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=29c47e9e51895928698c Signed-off-by: Juntong Deng Signed-off-by: Andreas Gruenbacher commit 074d7306a4fe22fcac0b53f699f92757ab1cee99 Author: Andreas Gruenbacher Date: Mon Oct 30 22:06:05 2023 +0100 gfs2: Silence "suspicious RCU usage in gfs2_permission" warning Commit 0abd1557e21c added rcu_dereference() for dereferencing ip->i_gl in gfs2_permission. This now causes lockdep to complain when gfs2_permission is called in non-RCU context: WARNING: suspicious RCU usage in gfs2_permission Switch to rcu_dereference_check() and check for the MAY_NOT_BLOCK flag to shut up lockdep when we know that dereferencing ip->i_gl is safe. Fixes: 0abd1557e21c ("gfs2: fix an oops in gfs2_permission") Reported-by: syzbot+3e5130844b0c0e2b4948@syzkaller.appspotmail.com Signed-off-by: Andreas Gruenbacher commit d6fc6c93636ffefd3d209d90a749e4e4ea51d6c1 Author: Amir Goldstein Date: Tue Oct 24 10:55:35 2023 +0300 gfs2: fs: derive f_fsid from s_uuid gfs2 already has optional persistent uuid. Use that uuid to report f_fsid in statfs(2), same as ext2/ext4/zonefs. This allows gfs2 to be monitored by fanotify filesystem watch. for example, with inotify-tools 4.23.8.0, the following command can be used to watch changes over entire filesystem: fsnotifywatch --filesystem /mnt/gfs2 Signed-off-by: Amir Goldstein Reviewed-by: Jan Kara Signed-off-by: Andreas Gruenbacher commit 0b2355fe91ac3756a9e29c8b833ba33f9affb520 Author: Andreas Gruenbacher Date: Mon Oct 9 18:49:31 2023 +0200 gfs2: No longer use 'extern' in function declarations For non-static function declarations, external linkage is implied and the 'extern' keyword isn't needed. Some static checkers complain about the overuse of 'extern', so clean up all the function declarations. In addition, remove 'extern' from the definition of free_local_statfs_inodes(); it isn't needed there, either. Signed-off-by: Andreas Gruenbacher commit 062fb903895a035ed382a0d3f9b9d459b2718217 Author: Andreas Gruenbacher Date: Wed Jul 26 22:23:43 2023 +0200 gfs2: Rename gfs2_lookup_{ simple => meta } Function gfs2_lookup_simple() is used for looking up inodes in the metadata directory tree, so rename it to gfs2_lookup_meta() to closer match its purpose. Clean the function up a little on the way. Signed-off-by: Andreas Gruenbacher commit be7f6a6b0bca708999eef4f8e9f2b128c73b9e17 Author: Andreas Gruenbacher Date: Mon Jul 24 20:53:14 2023 +0200 gfs2: Convert gfs2_internal_read to folios Change gfs2_internal_read() to use folios. Convert sizes to size_t. Signed-off-by: Andreas Gruenbacher commit 7fa4964b35e4046cae1c7d8b42f631ffd898701d Author: Andreas Gruenbacher Date: Fri Jul 21 23:58:04 2023 +0200 gfs2: Convert stuffed_readpage to folios Change stuffed_readpage() to take a folio instead of a page. Signed-off-by: Andreas Gruenbacher commit d6d64dac1d3967f3e951ae1cf2753181b78f2f89 Author: Andreas Gruenbacher Date: Tue Jul 18 15:49:08 2023 +0200 gfs2: Minor gfs2_write_jdata_batch PAGE_SIZE cleanup In gfs2_write_jdata_batch(), to compute the number of blocks, compute the total size of the folio batch instead of the number of pages it contains. Not a functional change. Note that we don't currently allow mounting filesystems with a block size bigger than the page size. We could change that after converting the page cache to folios. The page cache would then only contain block-size or bigger folios, so rounding wouldn't become an issue here. Signed-off-by: Andreas Gruenbacher commit 4c7b3f7fb7c8c66d669d107e717f9de41ef81e92 Author: Andreas Gruenbacher Date: Sat Oct 21 00:40:07 2023 +0200 gfs2: Get rid of gfs2_alloc_blocks generation parameter Get rid of the generation parameter of gfs2_alloc_blocks(): we only ever set the generation of the current inode while creating it, so do so directly. Signed-off-by: Andreas Gruenbacher commit d3badb15613c14dd35d3495b1dde5c90fcd616dd Author: Fang Xiang Date: Mon Oct 30 16:32:56 2023 +0800 irqchip/gic-v3-its: Flush ITS tables correctly in non-coherent GIC designs In non-coherent GIC designs, the ITS tables must be flushed before writing to the GITS_BASER registers, otherwise the ITS could read dirty tables, which results in unpredictable behavior. Flush the tables right at the begin of its_setup_baser() to prevent that. [ tglx: Massage changelog ] Fixes: a8707f553884 ("irqchip/gic-v3: Add Rockchip 3588001 erratum workaround") Suggested-by: Marc Zyngier Signed-off-by: Fang Xiang Signed-off-by: Thomas Gleixner Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231030083256.4345-1-fangxiang3@xiaomi.com commit dbfbda3bd6bfb5189e05b9eab8dfaad2d1d23f62 Author: Jisheng Zhang Date: Tue Sep 12 15:25:10 2023 +0800 riscv: mm: update T-Head memory type definitions Update T-Head memory type definitions according to C910 doc [1] For NC and IO, SH property isn't configurable, hardcoded as SH, so set SH for NOCACHE and IO. And also set bit[61](Bufferable) for NOCACHE according to the table 6.1 in the doc [1]. Link: https://github.com/T-head-Semi/openc910 [1] Signed-off-by: Jisheng Zhang Reviewed-by: Guo Ren Tested-by: Drew Fustini Link: https://lore.kernel.org/r/20230912072510.2510-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 7f00a975005f5656ee2bf656bab1c1657c587e2b Merge: b8a03a634129b 8f8c1ff879fab Author: Palmer Dabbelt Date: Sun Nov 5 14:15:17 2023 -0800 Merge patch series "riscv: vdso.lds.S: some improvement" Jisheng Zhang says: This series renews one of my last year RFC patch[1], tries to improve the vdso layout a bit. patch1 removes useless symbols patch2 merges .data section of vdso into .rodata because they are readonly patch3 is the real renew patch, it removes hardcoded 0x800 .text start addr. But I rewrite the commit msg per Andrew's suggestions and move move .note, .eh_frame_hdr, and .eh_frame between .rodata and .text to keep the actual code well away from the non-instruction data. * b4-shazam-merge: riscv: vdso.lds.S: remove hardcoded 0x800 .text start addr riscv: vdso.lds.S: merge .data section into .rodata section riscv: vdso.lds.S: drop __alt_start and __alt_end symbols Link: https://lore.kernel.org/linux-riscv/20221123161805.1579-1-jszhang@kernel.org/ [1] Link: https://lore.kernel.org/r/20230912072015.2424-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 8f8c1ff879fab60f80f3a7aec3000f47e5b03ba9 Author: Jisheng Zhang Date: Tue Sep 12 15:20:15 2023 +0800 riscv: vdso.lds.S: remove hardcoded 0x800 .text start addr I believe the hardcoded 0x800 and related comments come from the long history VDSO_TEXT_OFFSET in x86 vdso code, but commit 5b9304933730 ("x86 vDSO: generate vdso-syms.lds") and commit f6b46ebf904f ("x86 vDSO: new layout") removes the comment and hard coding for x86. Similar as x86 and other arch, riscv doesn't need the rigid layout using VDSO_TEXT_OFFSET since it "no longer matters to the kernel". so we could remove the hard coding now, and removing it brings a small vdso.so and aligns with other architectures. Also, having enough separation between data and text is important for I-cache, so similar as x86, move .note, .eh_frame_hdr, and .eh_frame between .rodata and .text. Signed-off-by: Jisheng Zhang Reviewed-by: Andrew Jones Tested-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20230912072015.2424-4-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 49cfbdc21faf5fffbdaa8fd31e1451a4432cfdaa Author: Jisheng Zhang Date: Tue Sep 12 15:20:14 2023 +0800 riscv: vdso.lds.S: merge .data section into .rodata section The .data section doesn't need to be separate from .rodata section, they are both readonly. Signed-off-by: Jisheng Zhang Tested-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20230912072015.2424-3-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit ddcc7d9bf531b2e950bc4a745a41c825a4759ae6 Author: Jisheng Zhang Date: Tue Sep 12 15:20:13 2023 +0800 riscv: vdso.lds.S: drop __alt_start and __alt_end symbols These two symbols are not used, remove them. Signed-off-by: Jisheng Zhang Tested-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20230912072015.2424-2-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit b8a03a634129b61a7ec69ece4460297ffbd790dc Author: Yunhui Cui Date: Tue Sep 12 10:13:49 2023 +0800 riscv: add userland instruction dump to RISC-V splats Add userland instruction dump and rename dump_kernel_instr() to dump_instr(). An example: [ 0.822439] Freeing unused kernel image (initmem) memory: 6916K [ 0.823817] Run /init as init process [ 0.839411] init[1]: unhandled signal 4 code 0x1 at 0x000000000005be18 in bb[10000+5fb000] [ 0.840751] CPU: 0 PID: 1 Comm: init Not tainted 5.14.0-rc4-00049-gbd644290aa72-dirty #187 [ 0.841373] Hardware name: , BIOS [ 0.841743] epc : 000000000005be18 ra : 0000000000079e74 sp : 0000003fffcafda0 [ 0.842271] gp : ffffffff816e9dc8 tp : 0000000000000000 t0 : 0000000000000000 [ 0.842947] t1 : 0000003fffc9fdf0 t2 : 0000000000000000 s0 : 0000000000000000 [ 0.843434] s1 : 0000000000000000 a0 : 0000003fffca0190 a1 : 0000003fffcafe18 [ 0.843891] a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000000 [ 0.844357] a5 : 0000000000000000 a6 : 0000000000000000 a7 : 0000000000000000 [ 0.844803] s2 : 0000000000000000 s3 : 0000000000000000 s4 : 0000000000000000 [ 0.845253] s5 : 0000000000000000 s6 : 0000000000000000 s7 : 0000000000000000 [ 0.845722] s8 : 0000000000000000 s9 : 0000000000000000 s10: 0000000000000000 [ 0.846180] s11: 0000000000d144e0 t3 : 0000000000000000 t4 : 0000000000000000 [ 0.846616] t5 : 0000000000000000 t6 : 0000000000000000 [ 0.847204] status: 0000000200000020 badaddr: 00000000f0028053 cause: 0000000000000002 [ 0.848219] Code: f06f ff5f 3823 fa11 0113 fb01 2e23 0201 0293 0000 (8053) f002 [ 0.851016] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004 Signed-off-by: Yunhui Cui Reviewed-by: Björn Töpel Link: https://lore.kernel.org/r/20230912021349.28302-1-cuiyunhui@bytedance.com Signed-off-by: Palmer Dabbelt commit 8cb22bec142624d21bc85ff96b7bad10b6220e6a Author: Nam Cao Date: Tue Aug 29 20:25:00 2023 +0200 riscv: kprobes: allow writing to x0 Instructions can write to x0, so we should simulate these instructions normally. Currently, the kernel hangs if an instruction who writes to x0 is simulated. Fixes: c22b0bcb1dd0 ("riscv: Add kprobes supported") Cc: stable@vger.kernel.org Signed-off-by: Nam Cao Reviewed-by: Charlie Jenkins Acked-by: Guo Ren Link: https://lore.kernel.org/r/20230829182500.61875-1-namcaov@gmail.com Signed-off-by: Palmer Dabbelt commit b701f9e726f0a30a94ea6af596b74c1f07b95b6b Author: Nam Cao Date: Tue Aug 29 10:36:15 2023 +0200 riscv: provide riscv-specific is_trap_insn() uprobes expects is_trap_insn() to return true for any trap instructions, not just the one used for installing uprobe. The current default implementation only returns true for 16-bit c.ebreak if C extension is enabled. This can confuse uprobes if a 32-bit ebreak generates a trap exception from userspace: uprobes asks is_trap_insn() who says there is no trap, so uprobes assume a probe was there before but has been removed, and return to the trap instruction. This causes an infinite loop of entering and exiting trap handler. Instead of using the default implementation, implement this function speficially for riscv with checks for both ebreak and c.ebreak. Fixes: 74784081aac8 ("riscv: Add uprobes supported") Signed-off-by: Nam Cao Tested-by: Björn Töpel Reviewed-by: Guo Ren Link: https://lore.kernel.org/r/20230829083614.117748-1-namcaov@gmail.com Signed-off-by: Palmer Dabbelt commit 02e790ee3077c0571794d0ab8f71413edbe129cc Author: Alexander Gordeev Date: Fri Nov 3 16:43:52 2023 +0100 s390/mm: make pte_free_tlb() similar to pXd_free_tlb() Make pte_free_tlb() look similar to pXd_free_tlb() family functions. Reviewed-by: Heiko Carstens Reviewed-by: Gerald Schaefer Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 0031f1c7cf2632a068a80261071b9b1f2d32d836 Author: Alexander Gordeev Date: Fri Nov 3 16:40:13 2023 +0100 s390/mm: use compound page order to distinguish page tables CRSTs always have size of four pages, while 2KB-size page tables always occupy a single page. Use that information to distinguish page tables from CRSTs. Reviewed-by: Heiko Carstens Reviewed-by: Gerald Schaefer Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit d08d4e7cd6bffe333f09853005aa549a8d57614b Author: Alexander Gordeev Date: Thu Oct 12 20:28:51 2023 +0200 s390/mm: use full 4KB page for 2KB PTE Cease using 4KB pages to host two 2KB PTEs. That greatly simplifies the memory management code at the expense of page tables memory footprint. Instead of two PTEs per 4KB page use only upper half of the parent page for a single PTE. With that the list of half-used pages pgtable_list becomes unneeded. Further, the upper byte of the parent page _refcount counter does not need to be used for fragments tracking and could be left alone. Commit 8211dad62798 ("s390: add pte_free_defer() for pgtables sharing page") introduced the use of PageActive flag to coordinate a deferred free with 2KB page table fragments tracking. Since there is no tracking anymore, there is no need for using PageActive flag. Reviewed-by: Heiko Carstens Reviewed-by: Gerald Schaefer Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit a51324c430db3fcf3e7d77c265491322c251a396 Author: Heiko Carstens Date: Fri Oct 27 14:12:39 2023 +0200 s390/cmma: rework no-dat handling Rework the way physical pages are set no-dat / dat: The old way is: - Rely on that all pages are initially marked "dat" - Allocate page tables for the kernel mapping - Enable dat - Walk the whole kernel mapping and set PG_arch_1 bit in all struct pages that belong to pages of kernel page tables - Walk all struct pages and test and clear the PG_arch_1 bit. If the bit is not set, set the page state to no-dat - For all subsequent page table allocations, set the page state to dat (remove the no-dat state) on allocation time Change this rather complex logic to a simpler approach: - Set the whole physical memory (all pages) to "no-dat" - Explicitly set those page table pages to "dat" which are part of the kernel image (e.g. swapper_pg_dir) - For all subsequent page table allocations, set the page state to dat (remove the no-dat state) on allocation time In result the code is simpler, and this also allows to get rid of one odd usage of the PG_arch_1 bit. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 65d37f163add1c6ead3a63788acb2f9590159f94 Author: Heiko Carstens Date: Fri Oct 27 14:12:38 2023 +0200 s390/cmma: move arch_set_page_dat() to header file In order to be usable for early boot code move the simple arch_set_page_dat() function to header file, and add its counter-part arch_set_page_nodat(). Also change the parameters, and the function name slightly. This is required since there aren't any struct pages available in early boot code, and renaming of functions is done to make sure that all users are converted to the new API. Instead of a pointer to a struct page a virtual address is passed, and instead of an order the number of pages for which the page state needs be set. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit a3e89e20fe00209779eb3e419621070b9158acdb Author: Heiko Carstens Date: Fri Oct 27 14:12:37 2023 +0200 s390/cmma: move set_page_stable() and friends to header file In order to be usable for early boot code move the simple set_page_xxx() function to header file. Also change the parameters, and the function names slightly. This is required since there aren't any struct pages available in early boot code, and renaming of functions is done to make sure that all users are converted to the new API. Instead of a pointer to a struct page a virtual address is passed, and instead of an order the number of pages for which the page state needs be set. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 468a3bc2b7b955a7cf97d47c6022bf1ae4a538a3 Author: Heiko Carstens Date: Fri Oct 27 14:12:36 2023 +0200 s390/cmma: move parsing of cmma kernel parameter to early boot code The "cmma=" kernel command line parameter needs to be parsed early for upcoming changes. Therefore move the parsing code. Note that EX_TABLE handling of cmma_test_essa() needs to be open-coded, since the early boot code doesn't have infrastructure for handling expected exceptions. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 92b519f3bc1c90e098bb3f12d8e739fc56c2d444 Author: Heiko Carstens Date: Fri Oct 27 14:12:35 2023 +0200 s390/cmma: cleanup inline assemblies Cleanup cmma related inline assemblies: - consolidate inline assemblies - use symbolic names - add same white space where missing - add braces to for-loops which contain a multi-line statement Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 5cf1a563a3284dc5c9f4ee8917ad2ebd51ff3def Author: Harald Freudenberger Date: Thu Oct 26 09:33:31 2023 +0200 s390/ap: fix vanishing crypto cards in SE environment A secure execution (SE, also known as confidential computing) guest may see asynchronous errors on a crypto firmware queue. The current implementation to gather information about cards and queues in ap_queue_info() simple returns if an asynchronous error is hanging on the firmware queue. If such a situation happened and it was the only queue visible for a crypto card within an SE guest, then the card vanished from sysfs as the AP bus scan function refuses to hold a card without any type information. As lszcrypt evaluates the sysfs such a card vanished from the lszcrypt card listing and the user is baffled and has no way to reset and thus clear the pending asynchronous error. This patch improves the named function to also evaluate GR2 of the TAPQ in case of asynchronous error pending. If there is a not-null value stored in, the info is processed now. In the end, a queue with pending asynchronous error does not lead to a vanishing card any more. Reviewed-by: Holger Dengler Signed-off-by: Harald Freudenberger Signed-off-by: Vasily Gorbik commit cfaef6516e9ac64e36967bd74d173b67fef6eee4 Author: Ingo Franzki Date: Thu Oct 26 11:24:03 2023 +0200 s390/zcrypt: don't report online if card or queue is in check-stop state If a card or a queue is in check-stop state, it can't be used by applications to perform crypto operations. Applications check the 'online' sysfs attribute to check if a card or queue is usable. Report a card or queue as offline in case it is in check-stop state. Furthermore, don't allow to set a card or queue online, if it is in check-stop state. This is similar to when the card or the queue is in deconfigured state, there it is also reported as being offline, and it can't be set online. Reviewed-by: Harald Freudenberger Signed-off-by: Ingo Franzki Signed-off-by: Vasily Gorbik commit aa44433ac4ee2ae59b4b11e01eddb6241ae24ef5 Author: Heiko Carstens Date: Mon Oct 30 16:50:47 2023 +0100 s390: add USER_STACKTRACE support Use the perf_callchain_user() code as blueprint to also add support for USER_STACKTRACE. To describe how to use this cite the commit message of the LoongArch implementation which came with commit 4d7bf939df08 ("LoongArch: Add USER_STACKTRACE support"), but replace -fno-omit-frame-pointer option with the s390 specific -mbackchain option: ====================================================================== To get the best stacktrace output, you can compile your userspace programs with frame pointers (at least glibc + the app you are tracing). 1, export "CC = gcc -mbackchain"; 2, compile your programs with "CC"; 3, use uprobe to get stacktrace output. ... echo 'p:malloc /usr/lib64/libc.so.6:0x0a4704 size=%r2:u64' > uprobe_events echo 'p:free /usr/lib64/libc.so.6:0x0a4d50 ptr=%r2:u64' >> uprobe_events echo 'comm == "demo"' > ./events/uprobes/malloc/filter echo 'comm == "demo"' > ./events/uprobes/free/filter echo 1 > ./options/userstacktrace echo 1 > ./options/sym-userobj ... ====================================================================== Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 504b73d00a55a68c0d1bb0e7c12e56e5f908e906 Author: Heiko Carstens Date: Mon Oct 30 16:50:46 2023 +0100 s390/perf: implement perf_callchain_user() Daan De Meyer and Neal Gompa reported that s390 does not support perf user stack unwinding. This was never implemented since this requires user space to be compiled with the -mbackchain compile option, which until now no distribution did. However this is going to change with Fedora. Therefore provide a perf_callchain_user() implementation. Note that due to the way s390 sets up stack frames the provided call chains can contain invalid values. This is especially true for the first stack frame, where it is not possible to tell if the return address has been written to the stack already or not. Reported-by: Daan De Meyer Reported-by: Neal Gompa Closes: https://lore.kernel.org/all/CAO8sHcn3+_qrnvp0580aK7jN0Wion5F7KYeBAa4MnCY4mqABPA@mail.gmail.com/ Link: https://lore.kernel.org/all/20231030123558.10816-A-hca@linux.ibm.com Reviewed-by: Neal Gompa Acked-by: Ilya Leoshkevich Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit e14aec23025eeb1f2159ba34dbc1458467c4c347 Author: Harald Freudenberger Date: Mon Oct 23 09:57:10 2023 +0200 s390/ap: fix AP bus crash on early config change callback invocation Fix kernel crash in AP bus code caused by very early invocation of the config change callback function via SCLP. After a fresh IML of the machine the crypto cards are still offline and will get switched online only with activation of any LPAR which has the card in it's configuration. A crypto card coming online is reported to the LPAR via SCLP and the AP bus offers a callback function to get this kind of information. However, it may happen that the callback is invoked before the AP bus init function is complete. As the callback triggers a synchronous AP bus scan, the scan may already run but some internal states are not initialized by the AP bus init function resulting in a crash like this: [ 11.635859] Unable to handle kernel pointer dereference in virtual kernel address space [ 11.635861] Failing address: 0000000000000000 TEID: 0000000000000887 [ 11.635862] Fault in home space mode while using kernel ASCE. [ 11.635864] AS:00000000894c4007 R3:00000001fece8007 S:00000001fece7800 P:000000000000013d [ 11.635879] Oops: 0004 ilc:1 [#1] SMP [ 11.635882] Modules linked in: [ 11.635884] CPU: 5 PID: 42 Comm: kworker/5:0 Not tainted 6.6.0-rc3-00003-g4dbf7cdc6b42 #12 [ 11.635886] Hardware name: IBM 3931 A01 751 (LPAR) [ 11.635887] Workqueue: events_long ap_scan_bus [ 11.635891] Krnl PSW : 0704c00180000000 0000000000000000 (0x0) [ 11.635895] R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 RI:0 EA:3 [ 11.635897] Krnl GPRS: 0000000001000a00 0000000000000000 0000000000000006 0000000089591940 [ 11.635899] 0000000080000000 0000000000000a00 0000000000000000 0000000000000000 [ 11.635901] 0000000081870c00 0000000089591000 000000008834e4e2 0000000002625a00 [ 11.635903] 0000000081734200 0000038000913c18 000000008834c6d6 0000038000913ac8 [ 11.635906] Krnl Code:>0000000000000000: 0000 illegal [ 11.635906] 0000000000000002: 0000 illegal [ 11.635906] 0000000000000004: 0000 illegal [ 11.635906] 0000000000000006: 0000 illegal [ 11.635906] 0000000000000008: 0000 illegal [ 11.635906] 000000000000000a: 0000 illegal [ 11.635906] 000000000000000c: 0000 illegal [ 11.635906] 000000000000000e: 0000 illegal [ 11.635915] Call Trace: [ 11.635916] [<0000000000000000>] 0x0 [ 11.635918] [<000000008834e4e2>] ap_queue_init_state+0x82/0xb8 [ 11.635921] [<000000008834ba1c>] ap_scan_domains+0x6fc/0x740 [ 11.635923] [<000000008834c092>] ap_scan_adapter+0x632/0x8b0 [ 11.635925] [<000000008834c3e4>] ap_scan_bus+0xd4/0x288 [ 11.635927] [<00000000879a33ba>] process_one_work+0x19a/0x410 [ 11.635930] Discipline DIAG cannot be used without z/VM [ 11.635930] [<00000000879a3a2c>] worker_thread+0x3fc/0x560 [ 11.635933] [<00000000879aea60>] kthread+0x120/0x128 [ 11.635936] [<000000008792afa4>] __ret_from_fork+0x3c/0x58 [ 11.635938] [<00000000885ebe62>] ret_from_fork+0xa/0x30 [ 11.635942] Last Breaking-Event-Address: [ 11.635942] [<000000008834c6d4>] ap_wait+0xcc/0x148 This patch improves the ap_bus_force_rescan() function which is invoked by the config change callback by checking if a first initial AP bus scan has been done. If not, the force rescan request is simple ignored. Anyhow it does not make sense to trigger AP bus re-scans even before the very first bus scan is complete. Cc: stable@vger.kernel.org Reviewed-by: Holger Dengler Signed-off-by: Harald Freudenberger Signed-off-by: Vasily Gorbik commit c40284b3642554d6cf519525872f2f5784933d8d Author: Harald Freudenberger Date: Mon Oct 23 15:42:21 2023 +0200 s390/ap: re-enable interrupt for AP queues This patch introduces some code lines which check for interrupt support enabled on an AP queue after a reply has been received. This invocation has been chosen as there is a good chance to have the queue empty at that time. As the enablement of the irq imples a state machine change the queue should not have any pending requests or unreceived replies. Reviewed-by: Tony Krowiak Reviewed-by: Holger Dengler Signed-off-by: Harald Freudenberger Signed-off-by: Vasily Gorbik commit 01c89ab7f81b76de00daccf6a856a00eb63a17d7 Author: Harald Freudenberger Date: Mon Oct 23 14:50:11 2023 +0200 s390/ap: rework to use irq info from ap queue status This patch reworks the irq handling and reporting code for the AP queue interrupt handling to always use the irq info from the queue status. Until now the interrupt status of an AP queue was stored into a bool variable within the ap_queue struct. This variable was set on a successful interrupt enablement and cleared with kicking a reset. However, it may be that the interrupt state is manipulated outband for example by a hypervisor. This patch removes this variable and instead the irq bit from the AP queue status which is always reflecting the current irq state is used. Reviewed-by: Tony Krowiak Reviewed-by: Holger Dengler Signed-off-by: Harald Freudenberger Signed-off-by: Vasily Gorbik commit 0547e0bd9b95da18747009c2091846fcb5691a6f Author: Alexander Gordeev Date: Mon Oct 23 21:16:41 2023 +0200 s390/mm: add missing conversion to use ptdescs Commit 6326c26c1514 ("s390: convert various pgalloc functions to use ptdescs") missed to convert tlb_remove_table() into tlb_remove_ptdesc() in few locations. Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 77fa2fbe87fc605c4bfa87dff87be9bfded0e9a3 Merge: 1cfb751165ef6 86f6c224c9791 Author: Linus Torvalds Date: Sun Nov 5 09:02:32 2023 -1000 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio updates from Michael Tsirkin: "vhost,virtio,vdpa: features, fixes, cleanups. vdpa/mlx5: - VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK - new maintainer vdpa: - support for vq descriptor mappings - decouple reset of iotlb mapping from device reset and fixes, cleanups all over the place" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (34 commits) vdpa_sim: implement .reset_map support vdpa/mlx5: implement .reset_map driver op vhost-vdpa: clean iotlb map during reset for older userspace vdpa: introduce .compat_reset operation callback vhost-vdpa: introduce IOTLB_PERSIST backend feature bit vhost-vdpa: reset vendor specific mapping to initial state in .release vdpa: introduce .reset_map operation callback virtio_pci: add check for common cfg size virtio-blk: fix implicit overflow on virtio_max_dma_size virtio_pci: add build offset check for the new common cfg items virtio: add definition of VIRTIO_F_NOTIF_CONFIG_DATA feature bit vduse: make vduse_class constant vhost-scsi: Spelling s/preceeding/preceding/g virtio: kdoc for struct virtio_pci_modern_device vdpa: Update sysfs ABI documentation MAINTAINERS: Add myself as mlx5_vdpa driver virtio-balloon: correct the comment of virtballoon_migratepage() mlx5_vdpa: offer VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK vdpa/mlx5: Update cvq iotlb mapping on ASID change vdpa/mlx5: Make iotlb helper functions more generic ... commit 1cfb751165ef685b80635218beff38d6afbce4e2 Merge: 3d05e493e461c c12d7aa7ffa4c Author: Linus Torvalds Date: Sun Nov 5 08:50:41 2023 -1000 Merge tag 'firewire-updates-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394 Pull firewire update from Takashi Sakamoto: "A slight change for flexible length of array in core function. Kees Cook provides a patch to annotate the array embedded in fw_node structure referring to structure member for the length of array. The annotation would be defined by future extension of C compilers, and used for access bound-check at run-time enabled by UBSAN and FORTIFY_SOURCE" * tag 'firewire-updates-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: firewire: Annotate struct fw_node with __counted_by commit 3d05e493e461c4469a9b73e00e59ea16e1d8a416 Merge: 2153fc3d68170 10e806d39d304 Author: Linus Torvalds Date: Sun Nov 5 08:41:14 2023 -1000 Merge tag 'i2c-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "I2C has largely driver updates for 6.7, i.e. feature additions (like adding transfers while in atomic mode), using new helpers (like devm_clk_get_enabled), new IDs, documentation fixes and additions... you name it. The core got a memleak fix and better support for nested muxes" * tag 'i2c-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (53 commits) i2c: s3c2410: make i2c_s3c_irq_nextbyte() void i2c: qcom-geni: add ACPI device id for sc8180x Documentation: i2c: add fault code for not supporting 10 bit addresses i2c: sun6i-p2wi: Prevent potential division by zero i2c: mux: demux-pinctrl: Convert to use sysfs_emit_at() API i2c: i801: Use new helper acpi_use_parent_companion ACPI: Add helper acpi_use_parent_companion MAINTAINERS: add YAML file for i2c-demux-pinctrl i2c: core: fix lockdep warning for sparsely nested adapter chain i2c: axxia: eliminate kernel-doc warnings dt-bindings: i2c: i2c-demux-pinctrl: Convert to json-schema i2c: stm32f7: Use devm_clk_get_enabled() i2c: stm32f4: Use devm_clk_get_enabled() i2c: stm32f7: add description of atomic in struct stm32f7_i2c_dev i2c: fix memleak in i2c_new_client_device() i2c: exynos5: Calculate t_scl_l, t_scl_h according to i2c spec i2c: i801: Simplify class-based client device instantiation i2c: exynos5: add support for atomic transfers i2c: at91-core: Use devm_clk_get_enabled() eeprom: at24: add ST M24C64-D Additional Write lockable page support ... commit 2153fc3d68170bb67be8e389c2f6e0f4a9eb7cd3 Merge: 1c41041124bd1 75690493591fe Author: Linus Torvalds Date: Sun Nov 5 08:28:32 2023 -1000 Merge tag 'ubifs-for-linus-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs Pull UBI and UBIFS updates from Richard Weinberger: - UBI Fastmap improvements - Minor issues found by static analysis bots in both UBI and UBIFS - Fix for wrong dentry length UBIFS in fscrypt mode * tag 'ubifs-for-linus-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs: ubifs: ubifs_link: Fix wrong name len calculating when UBIFS is encrypted ubi: block: Fix use-after-free in ubiblock_cleanup ubifs: fix possible dereference after free ubi: fastmap: Add control in 'UBI_IOCATT' ioctl to reserve PEBs for filling pools ubi: fastmap: Add module parameter to control reserving filling pool PEBs ubi: fastmap: Fix lapsed wear leveling for first 64 PEBs ubi: fastmap: Get wl PEB even ec beyonds the 'max' if free PEBs are run out ubi: fastmap: may_reserve_for_fm: Don't reserve PEB if fm_anchor exists ubi: fastmap: Remove unneeded break condition while filling pools ubi: fastmap: Wait until there are enough free PEBs before filling pools ubi: fastmap: Use free pebs reserved for bad block handling ubi: Replace erase_block() with sync_erase() ubi: fastmap: Allocate memory with GFP_NOFS in ubi_update_fastmap ubi: fastmap: erase_block: Get erase counter from wl_entry rather than flash ubi: fastmap: Fix missed ec updating after erasing old fastmap data block ubifs: Fix missing error code err ubifs: Fix memory leak of bud->log_hash ubifs: Fix some kernel-doc comments commit c7046ed0cf9bb33599aa7e72e7b67bba4be42d64 Author: Kent Overstreet Date: Sat Nov 4 22:34:37 2023 -0400 bcachefs: Improve stripe checksum error message We now include the name of the device in the error message - and also increment the number of checksum errors on that device. Signed-off-by: Kent Overstreet commit 853960d00b4b3df96acbf8e18980896f9115c45c Author: Kent Overstreet Date: Sat Nov 4 20:22:56 2023 -0400 bcachefs: Simplify, fix bch2_backpointer_get_key() - backpointer_not_found() checks backpointers_no_use_write_buffer, no need to do it inbackpointer_get_key(). - always use backpointer_get_node() for pointers to nodes: backpointer_get_key() was sometimes returning the key from the root node unlocked. Signed-off-by: Kent Overstreet commit daba90f2da9d1a32b94552207f8dad5adb646a5c Author: Kent Overstreet Date: Sat Nov 4 21:22:34 2023 -0400 bcachefs: kill thing_it_points_to arg to backpointer_not_found() This can be calculated locally. Signed-off-by: Kent Overstreet commit aa982665887590a9443f12323fdf508a22d8c86f Author: Kent Overstreet Date: Sat Nov 4 00:25:52 2023 -0400 bcachefs: bch2_ec_read_extent() now takes btree_trans We're not supposed to have more than one btree_trans at a time in a given thread - that causes recursive locking deadlocks. Signed-off-by: Kent Overstreet commit da4aa3b00123b8a588d23482993751e88bbaa324 Author: Kent Overstreet Date: Fri Nov 3 23:56:14 2023 -0400 bcachefs: bch2_stripe_to_text() now prints ptr gens Signed-off-by: Kent Overstreet commit 769b3600495b8a2ea3c2136121800ce6b566a457 Author: Kent Overstreet Date: Thu Nov 2 21:43:26 2023 -0400 bcachefs: Don't iterate over journal entries just for btree roots Small performance optimization, and a bit of a code cleanup too. Signed-off-by: Kent Overstreet commit 80396a47490936f73729548310ad60e9f5df61c9 Author: Kent Overstreet Date: Thu Nov 2 21:01:25 2023 -0400 bcachefs: Break up bch2_journal_write() Split up bch2_journal_write() to simplify locking: - bch2_journal_write_pick_flush(), which needs j->lock - bch2_journal_write_prep, which operates on the journal buffer to be written and will need the upcoming buf_lock for synchronization with the btree write buffer flush path Signed-off-by: Kent Overstreet commit a973de85e3976f3418f35cf82112190fac2eeddb Author: Kent Overstreet Date: Fri Nov 3 11:40:32 2023 -0400 bcachefs: Replace ERANGE with private error codes We avoid using standard error codes: private, per-callsite error codes make debugging easier. Signed-off-by: Kent Overstreet commit a8958a1a95b28e16dbca0654eeb6aa458bb1d3b0 Author: Kent Overstreet Date: Thu Nov 2 19:33:48 2023 -0400 bcachefs: bkey_copy() is no longer a macro Signed-off-by: Kent Overstreet commit 103ffe9aaf85660f40c8b68797a374b80b29b91d Author: Kent Overstreet Date: Thu Nov 2 11:42:48 2023 -0400 bcachefs: x-macro-ify inode flags enum This lets us use bch2_prt_bitflags to print them out. Signed-off-by: Kent Overstreet commit d4c8bb69d0208907f98af6a0f4da02778f2d7bdb Author: Kent Overstreet Date: Tue Oct 31 22:35:49 2023 -0400 bcachefs: Convert bch2_fs_open() to darray Open coded dynamic arrays are deprecated. Signed-off-by: Kent Overstreet commit 0f0fc312380b93d203be3282b2cbaee7016f2b72 Author: Kent Overstreet Date: Tue Oct 31 23:19:59 2023 -0400 bcachefs: Move __bch2_members_v2_get_mut to sb-members.h Signed-off-by: Kent Overstreet commit 59154f2c66ce5625bc00f3e66af7b71608e991f4 Author: Kent Overstreet Date: Tue Oct 31 23:43:47 2023 -0400 bcachefs: bch2_prt_datetime() Improved, better named version of pr_time(). Signed-off-by: Kent Overstreet commit 3ce99bd6357d4789c138898d9a07916d0f3b7f29 Merge: d3eabf2f2c81f 015c3c3704722 Author: Palmer Dabbelt Date: Sun Nov 5 09:41:57 2023 -0800 Merge patch series "Improve PTDUMP and introduce new fields" Yu Chien Peter Lin says: This patchset enhances PTDUMP by providing additional information from pagetable entries. The first patch fixes the RSW field, while the second and third patches introduce the PBMT and NAPOT fields, respectively, for RV64 systems. * b4-shazam-merge: riscv: Introduce NAPOT field to PTDUMP riscv: Introduce PBMT field to PTDUMP riscv: Improve PTDUMP to show RSW with non-zero value Link: https://lore.kernel.org/r/20230921025022.3989723-1-peterlin@andestech.com Signed-off-by: Palmer Dabbelt commit 015c3c370472290e37143d1387c000db7ec273ad Author: Yu Chien Peter Lin Date: Thu Sep 21 10:50:22 2023 +0800 riscv: Introduce NAPOT field to PTDUMP This patch introduces the NAPOT field to PTDUMP, allowing it to display the letter "N" for pages that have the 63rd bit set. Signed-off-by: Yu Chien Peter Lin Reviewed-by: Alexandre Ghiti Tested-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20230921025022.3989723-4-peterlin@andestech.com Signed-off-by: Palmer Dabbelt commit 0713ff337173884bcaf163e44cadd6a56bc8193a Author: Yu Chien Peter Lin Date: Thu Sep 21 10:50:21 2023 +0800 riscv: Introduce PBMT field to PTDUMP This patch introduces the PBMT field to the PTDUMP, so it can display the memory attributes for NC or IO. Signed-off-by: Yu Chien Peter Lin Reviewed-by: Alexandre Ghiti Tested-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20230921025022.3989723-3-peterlin@andestech.com Signed-off-by: Palmer Dabbelt commit d5d2c264d33b9acf1a0216861942176ee3569258 Author: Yu Chien Peter Lin Date: Thu Sep 21 10:50:20 2023 +0800 riscv: Improve PTDUMP to show RSW with non-zero value RSW field can be used to encode 2 bits of software defined information. Currently, PTDUMP only prints "RSW" when its value is 1 or 3. To fix this issue and improve the debugging experience with PTDUMP, we redefine _PAGE_SPECIAL to its original value and use _PAGE_SOFT as the RSW mask, allow it to print the RSW with any non-zero value. This patch also removes the val from the struct prot_bits as it is no longer needed. Signed-off-by: Yu Chien Peter Lin Reviewed-by: Alexandre Ghiti Tested-by: Alexandre Ghiti Link: https://lore.kernel.org/r/20230921025022.3989723-2-peterlin@andestech.com Signed-off-by: Palmer Dabbelt commit d3eabf2f2c81f8b0de0b75c6f41b875c501eb33b Author: Conor Dooley Date: Fri Sep 15 16:40:44 2023 +0100 RISC-V: capitalise CMO op macros The CMO op macros initially used lower case, as the original iteration of the ALT_CMO_OP alternative stringified the first parameter to finalise the assembly for the standard variant. As a knock-on, the T-Head versions of these CMOs had to use mixed case defines. Commit dd23e9535889 ("RISC-V: replace cbom instructions with an insn-def") removed the asm construction with stringify, replacing it an insn-def macro, rending the lower-case surplus to requirements. As far as I can tell from a brief check, CBO_zero does not see similar use and didn't require the mixed case define in the first place. Replace the lower case characters now for consistency with other insn-def macros in the standard and T-Head forms, and adjust the callsites. Suggested-by: Andrew Jones Signed-off-by: Conor Dooley Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20230915-aloe-dollar-994937477776@spud Signed-off-by: Palmer Dabbelt commit c20d36cc2a2073d4cdcda92bd7a1bb9b3b3b7c79 Author: Jisheng Zhang Date: Tue Sep 12 23:40:40 2023 +0800 riscv: don't probe unaligned access speed if already done If misaligned_access_speed percpu var isn't so called "HWPROBE MISALIGNED UNKNOWN", it means the probe has happened(this is possible for example, hotplug off then hotplug on one cpu), and the percpu var has been set, don't probe again in this case. Signed-off-by: Jisheng Zhang Fixes: 584ea6564bca ("RISC-V: Probe for unaligned access speed") Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230912154040.3306-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 07863871dfb162965b21bb8c2e4861bdb0019da3 Author: Jinyu Tang Date: Tue Sep 12 21:31:28 2023 +0800 riscv: defconfig : add CONFIG_MMC_DW for starfive If these config not set, mmc can't run for jh7110, rootfs can't be found when using SD card. So set CONFIG_MMC_DW=y like arm64 defconfig, and set CONFIG_MMC_DW_STARFIVE=y for starfive. Then starfive vf2 board can start SD card rootfs with mainline defconfig and dtb. Signed-off-by: Jinyu Tang Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230912133128.5247-1-tangjinyu@tinylab.org Signed-off-by: Palmer Dabbelt commit ce4f78f1b53d3327fbd32764aa333bf05fb68818 Author: Haorong Lu Date: Thu Aug 3 15:44:54 2023 -0700 riscv: signal: handle syscall restart before get_signal In the current riscv implementation, blocking syscalls like read() may not correctly restart after being interrupted by ptrace. This problem arises when the syscall restart process in arch_do_signal_or_restart() is bypassed due to changes to the regs->cause register, such as an ebreak instruction. Steps to reproduce: 1. Interrupt the tracee process with PTRACE_SEIZE & PTRACE_INTERRUPT. 2. Backup original registers and instruction at new_pc. 3. Change pc to new_pc, and inject an instruction (like ebreak) to this address. 4. Resume with PTRACE_CONT and wait for the process to stop again after executing ebreak. 5. Restore original registers and instructions, and detach from the tracee process. 6. Now the read() syscall in tracee will return -1 with errno set to ERESTARTSYS. Specifically, during an interrupt, the regs->cause changes from EXC_SYSCALL to EXC_BREAKPOINT due to the injected ebreak, which is inaccessible via ptrace so we cannot restore it. This alteration breaks the syscall restart condition and ends the read() syscall with an ERESTARTSYS error. According to include/linux/errno.h, it should never be seen by user programs. X86 can avoid this issue as it checks the syscall condition using a register (orig_ax) exposed to user space. Arm64 handles syscall restart before calling get_signal, where it could be paused and inspected by ptrace/debugger. This patch adjusts the riscv implementation to arm64 style, which also checks syscall using a kernel register (syscallno). It ensures the syscall restart process is not bypassed when changes to the cause register occur, providing more consistent behavior across various architectures. For a simplified reproduction program, feel free to visit: https://github.com/ancientmodern/riscv-ptrace-bug-demo. Signed-off-by: Haorong Lu Link: https://lore.kernel.org/r/20230803224458.4156006-1-ancientmodern4@gmail.com Signed-off-by: Palmer Dabbelt commit 0619ff9f0273b80a5bf14a327f1eb0c808cafdb4 Merge: e1c05b3bf80f8 9f23a5d2f6b01 Author: Palmer Dabbelt Date: Wed Nov 1 09:02:09 2023 -0700 Merge patch series "Add support to handle misaligned accesses in S-mode" Clément Léger says: Since commit 61cadb9 ("Provide new description of misaligned load/store behavior compatible with privileged architecture.") in the RISC-V ISA manual, it is stated that misaligned load/store might not be supported. However, the RISC-V kernel uABI describes that misaligned accesses are supported. In order to support that, this series adds support for S-mode handling of misaligned accesses as well support for prctl(PR_UNALIGN). Handling misaligned access in kernel allows for a finer grain control of the misaligned accesses behavior, and thanks to the prctl() call, can allow disabling misaligned access emulation to generate SIGBUS. User space can then optimize its software by removing such access based on SIGBUS generation. This series is useful when using a SBI implementation that does not handle misaligned traps as well as detecting misaligned accesses generated by userspace application using the prctrl(PR_SET_UNALIGN) feature. This series can be tested using the spike simulator[1] and a modified openSBI version[2] which allows to always delegate misaligned load/store to S-mode. A test[3] that exercise various instructions/registers can be executed to verify the unaligned access support. [1] https://github.com/riscv-software-src/riscv-isa-sim [2] https://github.com/rivosinc/opensbi/tree/dev/cleger/no_misaligned [3] https://github.com/clementleger/unaligned_test * b4-shazam-merge: riscv: add support for PR_SET_UNALIGN and PR_GET_UNALIGN riscv: report misaligned accesses emulation to hwprobe riscv: annotate check_unaligned_access_boot_cpu() with __init riscv: add support for sysctl unaligned_enabled control riscv: add floating point insn support to misaligned access emulation riscv: report perf event for misaligned fault riscv: add support for misaligned trap handling in S-mode riscv: remove unused functions in traps_misaligned.c Link: https://lore.kernel.org/r/20231004151405.521596-1-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt commit c12d7aa7ffa4c61443241fbc1ee405acf4aa17de Author: Kees Cook Date: Fri Sep 22 10:53:35 2023 -0700 firewire: Annotate struct fw_node with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct fw_node. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Takashi Sakamoto Cc: linux1394-devel@lists.sourceforge.net Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922175334.work.335-kees@kernel.org Signed-off-by: Takashi Sakamoto commit 1c41041124bd14dd6610da256a3da4e5b74ce6b1 Merge: b8cc56d0414e2 9fd00df05e81a Author: Linus Torvalds Date: Sat Nov 4 16:25:36 2023 -1000 Merge tag 'i3c/for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux Pull i3c updates from Alexandre Belloni: "There are now more fixes because as stated in my previous pull request, people now have access to actual hardware. Core: - handle IBI in the proper order Drivers: - cdns: fix status register access - mipi-i3c-hci: many fixes now that the driver has been actually tested - svc: many IBI fixes, correct compatible string, fix hot join corner cases" * tag 'i3c/for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: (29 commits) i3c: master: handle IBIs in order they came i3c: master: mipi-i3c-hci: Fix a kernel panic for accessing DAT_data. i3c: master: svc: fix compatibility string mismatch with binding doc i3c: master: svc: fix random hot join failure since timeout error i3c: master: svc: fix SDA keep low when polling IBIWON timeout happen i3c: master: svc: fix check wrong status register in irq handler i3c: master: svc: fix ibi may not return mandatory data byte i3c: master: svc: fix wrong data return when IBI happen during start frame i3c: master: svc: fix race condition in ibi work thread i3c: Fix typo "Provisional ID" to "Provisioned ID" i3c: Fix potential refcount leak in i3c_master_register_new_i3c_devs i3c: mipi-i3c-hci: Resume controller after aborted transfer i3c: mipi-i3c-hci: Resume controller explicitly i3c: mipi-i3c-hci: Fix missing xfer->completion in hci_cmd_v1_daa() i3c: mipi-i3c-hci: Do not unmap region not mapped for transfer i3c: mipi-i3c-hci: Set number of SW enabled Ring Bundles earlier i3c: mipi-i3c-hci: Fix race between bus cleanup and interrupt i3c: mipi-i3c-hci: Set ring start request together with enable i3c: mipi-i3c-hci: Remove BUG() when Ring Abort request times out i3c: mipi-i3c-hci: Fix out of bounds access in hci_dma_irq_handler ... commit b8cc56d0414e2330d9fe05342843512b1ad8cdb7 Merge: 5e2cb28dd7e18 4b92894064b3d Author: Linus Torvalds Date: Sat Nov 4 16:20:36 2023 -1000 Merge tag 'cxl-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl Pull CXL (Compute Express Link) updates from Dan Williams: "The main new functionality this time is work to allow Linux to natively handle CXL link protocol errors signalled via PCIe AER for current generation CXL platforms. This required some enlightenment of the PCIe AER core to workaround the fact that current generation RCH (Restricted CXL Host) platforms physically hide topology details and registers via a mechanism called RCRB (Root Complex Register Block). The next major highlight is reworks to address bugs in parsing region configurations for next generation VH (Virtual Host) topologies. The old broken algorithm is replaced with a simpler one that significantly increases the number of region configurations supported by Linux. This is again relevant for error handling so that forward and reverse address translation of memory errors can be carried out by Linux for memory regions instantiated by platform firmware. As for other cross-tree work, the ACPI table parsing code has been refactored for reuse parsing the "CDAT" structure which is an ACPI-like data structure that is reported by CXL devices. That work is in preparation for v6.8 support for CXL QoS. Think of this as dynamic generation of NUMA node topology information generated by Linux rather than platform firmware. Lastly, a number of internal object lifetime issues have been resolved along with misc. fixes and feature updates (decoders_committed sysfs ABI). Summary: - Add support for RCH (Restricted CXL Host) Error recovery - Fix several region assembly bugs - Fix mem-device lifetime issues relative to the sanitize command and RCH topology. - Refactor ACPI table parsing for CDAT parsing re-use in preparation for CXL QOS support" * tag 'cxl-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: (50 commits) lib/fw_table: Remove acpi_parse_entries_array() export cxl/pci: Change CXL AER support check to use native AER cxl/hdm: Remove broken error path cxl/hdm: Fix && vs || bug acpi: Move common tables helper functions to common lib cxl: Add support for reading CXL switch CDAT table cxl: Add checksum verification to CDAT from CXL cxl: Export QTG ids from CFMWS to sysfs as qos_class attribute cxl: Add decoders_committed sysfs attribute to cxl_port cxl: Add cxl_decoders_committed() helper cxl/core/regs: Rework cxl_map_pmu_regs() to use map->dev for devm cxl/core/regs: Rename phys_addr in cxl_map_component_regs() PCI/AER: Unmask RCEC internal errors to enable RCH downstream port error handling PCI/AER: Forward RCH downstream port-detected errors to the CXL.mem dev handler cxl/pci: Disable root port interrupts in RCH mode cxl/pci: Add RCH downstream port error logging cxl/pci: Map RCH downstream AER registers for logging protocol errors cxl/pci: Update CXL error logging to use RAS register address PCI/AER: Refactor cper_print_aer() for use by CXL driver module cxl/pci: Add RCH downstream port AER register discovery ... commit bf61dcdfc12c3890c7a062cfcd46c443883defc9 Author: Kent Overstreet Date: Sat Nov 4 18:31:42 2023 -0400 bcachefs: CONFIG_BCACHEFS_DEBUG_TRANSACTIONS no longer defaults to y BCACHEFS_DEBUG_TRANSACTIONS is useful, but it's too expensive to have on by default - and it hasn't been coming up in bug reports. Turn it off by default until we figure out a way to make it cheaper. Signed-off-by: Kent Overstreet commit 9fcdd23b6eea3f04475cd9cfb4497f6e26906061 Author: Kent Overstreet Date: Sat Nov 4 13:49:31 2023 -0400 bcachefs: Add a comment for BTREE_INSERT_NOJOURNAL usage BTREE_INSERT_NOJOURNAL is primarily used for a performance optimization related to inode updates and fsync - document it. Signed-off-by: Kent Overstreet commit d3c7727bb9269c7f7a2f17ef76b9e5c9b8cc8863 Author: Kent Overstreet Date: Fri Nov 3 18:30:08 2023 -0400 bcachefs: rebalance_work btree is not a snapshots btree rebalance_work entries may refer to entries in the extents btree, which is a snapshots btree, or they may also refer to entries in the reflink btree, which is not. Hence rebalance_work keys may use the snapshot field but it's not required to be nonzero - add a new btree flag to reflect this. Signed-off-by: Kent Overstreet commit 01ccee225a373d859eb6e5d42dbe0138a40a7e0a Author: Kent Overstreet Date: Fri Nov 3 12:06:18 2023 -0400 bcachefs: Add missing printk newlines This was causing error messages in -tools to not get printed. Signed-off-by: Kent Overstreet commit 5a53f851e6fe0e7cc41e682a4a9e40bb178fb80b Author: Kent Overstreet Date: Fri Nov 3 11:55:44 2023 -0400 bcachefs: Fix recovery when forced to use JSET_NO_FLUSH journal entry When we didn't find anything in the journal that we'd like to use, and we're forced to use whatever we can find - that entry will have been a JSET_NO_FLUSH entry with a garbage last_seq value, since it's not normally used. Initialize it to something sane, for bch2_fs_journal_start(). Signed-off-by: Kent Overstreet commit ce3e9a8a10086b28444cab1431dfc926787ecfcb Author: Kent Overstreet Date: Thu Nov 2 16:54:00 2023 -0400 bcachefs: .get_parent() should return an error pointer Delete the useless check for inum == 0; we'll return -ENOENT without it, which is what we want. Signed-off-by: Kent Overstreet commit 4bd156c4b44ef34bd57d20a0a48aad829e1c54c1 Author: Kent Overstreet Date: Thu Nov 2 15:28:15 2023 -0400 bcachefs: Fix bch2_delete_dead_inodes() - the fsck_err() check for the filesystem being clean was incorrect, causing us to always fail to delete unlinked inodes - if a snapshot had been taken, the unlinked inode needs to be propagated to snapshot leaves so the unlink can happen there - fixed. Signed-off-by: Kent Overstreet commit 7cb2a7895d94db2979c29e4a20f33b5557c702d5 Author: Brian Foster Date: Fri Nov 3 09:09:38 2023 -0400 bcachefs: use swab40 for bch_backpointer.bucket_offset bitfield The bucket_offset field of bch_backpointer is a 40-bit bitfield, but the bch2_backpointer_swab() helper uses swab32. This leads to inconsistency when an on-disk fs is accessed from an opposite endian machine. As it turns out, we already have an internal swab40() helper that is used from the bch_alloc_v4 swab callback. Lift it into the backpointers header file and use it consistently in both places. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 0996c72a0f300bfedf8df52a8e437435494fc204 Author: Brian Foster Date: Fri Nov 3 09:09:37 2023 -0400 bcachefs: byte order swap bch_alloc_v4.fragmentation_lru field A simple test to populate a filesystem on one CPU architecture and fsck on an arch of the opposite byte order produces errors related to the fragmentation LRU. This occurs because the 64-bit fragmentation_lru field is not byte-order swapped when reads detect that the on-disk/bset key values were written in opposite byte-order of the current CPU. Update the bch2_alloc_v4 swab callback to handle fragmentation_lru as is done for other multi-byte fields. This doesn't affect existing filesystems when accessed by CPUs of the same endianness because the ->swab() callback is only called when the bset flags indicate an endianness mismatch between the CPU and on-disk data. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 2a4e7497604b20b19b6d9dbd109c42900892d7c9 Author: Brian Foster Date: Fri Nov 3 09:09:36 2023 -0400 bcachefs: allow writeback to fill bio completely The bcachefs folio writeback code includes a bio full check as well as a fixed size check to determine when to split off and submit writeback I/O. The inclusive check of the latter against the limit means that writeback can submit slightly prematurely. This is not a functional problem, but results in unnecessarily split I/Os and extent merging. This can be observed with a buffered write sized exactly to the current maximum value (1MB) and with key_merging_disabled=1. The latter prevents the merge from the second write such that a subsequent check of the extent list shows a 1020k extent followed by a contiguous 4k extent. The purpose for the fixed size check is also undocumented and somewhat obscure. Lift this check into a new helper that wraps the bio check, fix the comparison logic, and add a comment to document the purpose and how we might improve on this in the future. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 0e91d3a6d59ed3c6630c7c50f17534f2b02d2abf Author: Brian Foster Date: Wed Nov 1 09:01:02 2023 -0400 bcachefs: fix odebug warn and lockdep splat due to on-stack rhashtable Guenter Roeck reports a lockdep splat and DEBUG_OBJECTS_WORK related warning when bch2_copygc_thread() initializes its rhashtable. The lockdep splat relates to a warning print caused by the fact that the rhashtable exists on the stack but is not annotated as so. This is something that could be addressed by INIT_WORK_ONSTACK(), but rhashtable doesn't expose that control and probably isnt worth the churn for just one user. Instead, dynamically allocate the buckets_in_flight structure and avoid the splat that way. Reported-by: Guenter Roeck Tested-by: Guenter Roeck Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit e0fb0dccfd6fd8dd9c07adc6eafb1a12e2121a36 Author: Brian Foster Date: Wed Nov 1 15:02:45 2023 -0400 bcachefs: update alloc cursor in early bucket allocator A recent bug report uncovered a scenario where a filesystem never runs with freespace_initialized, and therefore the user observes significantly degraded write performance by virtue of running the early bucket allocator. The associated bug aside, the primary cause of the performance drop in this particular instance is that the early bucket allocator does not update the allocation cursor. This means that every allocation walks the alloc btree from the first bucket of the associated device looking for a bucket marked as free space. Update the early allocator code to set the alloc cursor to the last processed position in the tree, similar to how the freelist allocator behaves. With the alloc_cursor being updated, the retry logic also needs to be updated to restart from the beginning of the device when a free bucket is not available between the cursor and the end of the device. Track the restart position in a first_bucket variable to make the code a bit more easily readable and consistent with the freelist allocator. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 385a82f62a9b46d84d545062375274bdc6f50c37 Author: Brian Foster Date: Wed Nov 1 15:02:44 2023 -0400 bcachefs: serialize on cached key in early bucket allocator bcachefs had a transient bug where freespace_initialized was not properly being set, which lead to unexpected use of the early bucket allocator at runtime. This issue has been fixed, but the existence of it uncovered a coherency issue in the early bucket allocation code that is somewhat related to how uncached iterators deal with the key cache. The problem itself manifests as occasional failure of generic/113 due to corruption, often seen as a duplicate backpointer or multiple data types per-bucket error. The immediate cause of the error is a racing bucket allocation along the lines of the following sequence: - Task 1 selects key A in bch2_bucket_alloc_early() and schedules. - Task 2 selects the same key A, but proceeds to complete the allocation and associated I/O, after which it releases the open_bucket. - Task 1 resumes with key A, but does not recognize the bucket is now allocated because the open_bucket has been removed from the hash when it was released in the previous step. This generally shouldn't happen because the allocating task updates the alloc btree key before releasing the bucket. This is not sufficient in this particular instance, however, because an uncached iterator for a cached btree doesn't actually lock the key cache slot when no key exists for a given slot in the cache. Thus the fact that the allocation side updates the cached key means that multiple uncached iters can stumble across the same alloc key and duplicate the bucket allocation as described above. This is something that probably needs a longer term fix in the iterator code. As a short term fix, close the race through explicit use of a cached iterator for likely allocation candidates. We don't want to scan the btree with a cached iterator because that would unnecessarily pollute the cache. This mitigates cache pollution by primarily scanning the tree with an uncached iterator, but closes the race by creating a key cache entry for any prospective slot prior to the bucket allocation attempt (also similar to how _alloc_freelist() works via try_alloc_bucket()). This survives many iterations of generic/113 on a kernel hacked to always use the early bucket allocator. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit f82755e4e8b83a4a98ebd6d819d716547fe11919 Author: Kent Overstreet Date: Mon Oct 30 15:13:09 2023 -0400 bcachefs: Data move path now uses bch2_trans_unlock_long() Signed-off-by: Kent Overstreet commit 5e2cb28dd7e182dfa641550dfa225913509ad45d Merge: b1dfbda8636b5 f4738f56d1dc6 Author: Linus Torvalds Date: Sat Nov 4 15:58:13 2023 -1000 Merge tag 'tsm-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/linux Pull unified attestation reporting from Dan Williams: "In an ideal world there would be a cross-vendor standard attestation report format for confidential guests along with a common device definition to act as the transport. In the real world the situation ended up with multiple platform vendors inventing their own attestation report formats with the SEV-SNP implementation being a first mover to define a custom sev-guest character device and corresponding ioctl(). Later, this configfs-tsm proposal intercepted an attempt to add a tdx-guest character device and a corresponding new ioctl(). It also anticipated ARM and RISC-V showing up with more chardevs and more ioctls(). The proposal takes for granted that Linux tolerates the vendor report format differentiation until a standard arrives. From talking with folks involved, it sounds like that standardization work is unlikely to resolve anytime soon. It also takes the position that kernfs ABIs are easier to maintain than ioctl(). The result is a shared configfs mechanism to return per-vendor report-blobs with the option to later support a standard when that arrives. Part of the goal here also is to get the community into the "uncomfortable, but beneficial to the long term maintainability of the kernel" state of talking to each other about their differentiation and opportunities to collaborate. Think of this like the device-driver equivalent of the common memory-management infrastructure for confidential-computing being built up in KVM. As for establishing an "upstream path for cross-vendor confidential-computing device driver infrastructure" this is something I want to discuss at Plumbers. At present, the multiple vendor proposals for assigning devices to confidential computing VMs likely needs a new dedicated repository and maintainer team, but that is a discussion for v6.8. For now, Greg and Thomas have acked this approach and this is passing is AMD, Intel, and Google tests. Summary: - Introduce configfs-tsm as a shared ABI for confidential computing attestation reports - Convert sev-guest to additionally support configfs-tsm alongside its vendor specific ioctl() - Added signed attestation report retrieval to the tdx-guest driver forgoing a new vendor specific ioctl() - Misc cleanups and a new __free() annotation for kvfree()" * tag 'tsm-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/linux: virt: tdx-guest: Add Quote generation support using TSM_REPORTS virt: sevguest: Add TSM_REPORTS support for SNP_GET_EXT_REPORT mm/slab: Add __free() support for kvfree virt: sevguest: Prep for kernel internal get_ext_report() configfs-tsm: Introduce a shared ABI for attestation reports virt: coco: Add a coco/Makefile and coco/Kconfig virt: sevguest: Fix passing a stack buffer as a scatterlist target commit b1dfbda8636b54cde21f9f5d352fd25c4deff584 Merge: e70703890b258 6d55d31e927ee Author: Linus Torvalds Date: Sat Nov 4 11:04:30 2023 -1000 Merge tag 'mtd/for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull mtd updates from Miquel Raynal: "The main set of changes is related to Uwe's work converting platform remove callbacks to return void. Comes next (in number of changes) Kees' additional structures annotations to improve the sanitizers. The usual amount of cleanups apply. About the more substancial contribution, one main function of the partitions core could return an error which was not checked, this is now fixed. On the bindings side, fixed partitions can now have a compression property. Finally, an erroneous situation is now always avoided in the MAP RAM driver. CFI: - A several years old byte swap has been fixed. NAND: - The subsystem has, as usual, seen a bit of cleanup being done this cycle, typically return values of platform_get_irq() and devm_kasprintf(). There is also a better ECC check in the Arasan driver. This comes with smaller misc changes. - In the SPI-NAND world there is now support for Foresee F35SQA002G, Winbond W25N and XTX XT26 chips. SPI NOR: - For SPI NOR we cleaned the flash info entries in order to have them slimmer and self explanatory. In order to make the entries as slim as possible, we introduced sane default values so that the actual flash entries don't need to specify them. We now use a flexible macro to specify the flash ID instead of the previous INFOx() macros that had hardcoded ID lengths. Instead of: { "w25q512nwm", INFO(0xef8020, 0, 64 * 1024, 0) OTP_INFO(256, 3, 0x1000, 0x1000) }, We now use: .id = SNOR_ID(0xef, 0x80, 0x20), .name = "w25q512nwm", .otp = SNOR_OTP(256, 3, 0x1000, 0x1000), - We also removed some flash entries: the very old Catalyst SPI EEPROMs that were introduced once with the SPI-NOR subsystem, and a Fujitsu MRAM. Both should use the at25 EEPROM driver. The latter even has device tree bindings for the at25 driver. - We made sure that the conversion didn't introduce any unwanted changes by comparing the .rodata segment before and after the conversion. The patches landed in linux-next immediately after v6.6-rc2, we haven't seen any regressions yet. - Apart of the autumn cleaning we introduced a new flash entry, at25ff321a, and added block protection support for mt25qu512a" * tag 'mtd/for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (91 commits) mtd: cfi_cmdset_0001: Byte swap OTP info mtd: rawnand: meson: check return value of devm_kasprintf() mtd: rawnand: intel: check return value of devm_kasprintf() mtd: rawnand: sh_flctl: Convert to module_platform_driver() mtd: spi-nor: micron-st: use SFDP table for mt25qu512a mtd: spi-nor: micron-st: enable lock/unlock for mt25qu512a mtd: rawnand: Remove unused of_gpio.h inclusion mtd: spinand: Add support for XTX XT26xxxDxxxxx mtd: spinand: winbond: add support for serial NAND flash mtd: rawnand: cadence: Annotate struct cdns_nand_chip with __counted_by mtd: rawnand: Annotate struct mtk_nfc_nand_chip with __counted_by mtd: spinand: add support for FORESEE F35SQA002G mtd: rawnand: rockchip: Use struct_size() mtd: rawnand: arasan: Include ECC syndrome along with in-band data while checking for ECC failure mtd: Use device_get_match_data() mtd: spi-nor: nxp-spifi: Convert to platform remove callback returning void mtd: spi-nor: hisi-sfc: Convert to platform remove callback returning void mtd: maps: sun_uflash: Convert to platform remove callback returning void mtd: maps: sa1100-flash: Convert to platform remove callback returning void mtd: maps: pxa2xx-flash: Convert to platform remove callback returning void ... commit e70703890b2586bc3567365d391c260d23fb7a94 Merge: aea6bf908d730 8d55b0a940bb1 Author: Linus Torvalds Date: Sat Nov 4 10:42:07 2023 -1000 Merge tag 'topic/nvidia-gsp-2023-11-03' of git://anongit.freedesktop.org/drm/drm Pull drm nouveau GSP support from Dave Airlie: "This adds the initial support for the NVIDIA GSP firmware to nouveau. This firmware is a new direction for Turing+ GPUs, and is only enabled by default on Ada generation. Other generations need to use nouveau.config=NvGspRm=1 The GSP firmware takes nearly all the GPU init and power management tasks onto a risc-v CPU on the GPU. This series is mostly the work from Ben Skeggs, and Dave added some patches to rebase it to the latest firmware release which is where we will stay for as long as possible as the firmwares have no ABI stability" * tag 'topic/nvidia-gsp-2023-11-03' of git://anongit.freedesktop.org/drm/drm: (49 commits) nouveau/gsp: add some basic registry entries. nouveau/gsp: fix message signature. nouveau/gsp: move to 535.113.01 nouveau/disp: fix post-gsp build on 32-bit arm. nouveau: fix r535 build on 32-bit arm. drm/nouveau/ofa/r535: initial support drm/nouveau/nvjpg/r535: initial support drm/nouveau/nvenc/r535: initial support drm/nouveau/nvdec/r535: initial support drm/nouveau/gr/r535: initial support drm/nouveau/ce/r535: initial support drm/nouveau/fifo/r535: initial support drm/nouveau/disp/r535: initial support drm/nouveau/mmu/r535: initial support drm/nouveau/gsp/r535: add interrupt handling drm/nouveau/gsp/r535: add support for rm alloc drm/nouveau/gsp/r535: add support for rm control drm/nouveau/gsp/r535: add support for booting GSP-RM drm/nouveau/nvkm: support loading fws into sg_table drm/nouveau/kms/tu102-: disable vbios parsing when running on RM ... commit aea6bf908d730b01bd264a8821159db9463c111c Merge: c9b93cafb69cb 1e7bef5f90ed6 Author: Linus Torvalds Date: Sat Nov 4 09:26:23 2023 -1000 Merge tag 'f2fs-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs updates from Jaegeuk Kim: "In this cycle, we introduce a bigger page size support by changing the internal f2fs's block size aligned to the page size. We also continue to improve zoned block device support regarding the power off recovery. As usual, there are some bug fixes regarding the error handling routines in compression and ioctl. Enhancements: - Support Block Size == Page Size - let f2fs_precache_extents() traverses in file range - stop iterating f2fs_map_block if hole exists - preload extent_cache for POSIX_FADV_WILLNEED - compress: fix to avoid fragment w/ OPU during f2fs_ioc_compress_file() Bug fixes: - do not return EFSCORRUPTED, but try to run online repair - finish previous checkpoints before returning from remount - fix error handling of __get_node_page and __f2fs_build_free_nids - clean up zones when not successfully unmounted - fix to initialize map.m_pblk in f2fs_precache_extents() - fix to drop meta_inode's page cache in f2fs_put_super() - set the default compress_level on ioctl - fix to avoid use-after-free on dic - fix to avoid redundant compress extension - do sanity check on cluster when CONFIG_F2FS_CHECK_FS is on - fix deadloop in f2fs_write_cache_pages()" * tag 'f2fs-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: f2fs: finish previous checkpoints before returning from remount f2fs: fix error handling of __get_node_page f2fs: do not return EFSCORRUPTED, but try to run online repair f2fs: fix error path of __f2fs_build_free_nids f2fs: Clean up errors in segment.h f2fs: clean up zones when not successfully unmounted f2fs: let f2fs_precache_extents() traverses in file range f2fs: avoid format-overflow warning f2fs: fix to initialize map.m_pblk in f2fs_precache_extents() f2fs: Support Block Size == Page Size f2fs: stop iterating f2fs_map_block if hole exists f2fs: preload extent_cache for POSIX_FADV_WILLNEED f2fs: set the default compress_level on ioctl f2fs: compress: fix to avoid fragment w/ OPU during f2fs_ioc_compress_file() f2fs: fix to drop meta_inode's page cache in f2fs_put_super() f2fs: split initial and dynamic conditions for extent_cache f2fs: compress: fix to avoid redundant compress extension f2fs: compress: do sanity check on cluster when CONFIG_F2FS_CHECK_FS is on f2fs: compress: fix to avoid use-after-free on dic f2fs: compress: fix deadloop in f2fs_write_cache_pages() commit c9b93cafb69cbbbe375de29c1ebf410dbc33ebfc Merge: 766e9cf3bd64c ce07087964208 Author: Linus Torvalds Date: Sat Nov 4 09:20:04 2023 -1000 Merge tag '9p-for-6.7-rc1' of https://github.com/martinetd/linux Pull 9p updates from Dominique Martinet: A bunch of small fixes: - three W=1 warning fixes: the NULL -> "" replacement isn't trivial but is serialized identically by the protocol layer and has been tested - one syzbot/KCSAN datarace annotation where we don't care about users messing with the fd they passed to mount -t 9p - removing a declaration without implementation - yet another race fix for trans_fd around connection close: the 'err' field is also used in potentially racy calls and this isn't complete, but it's better than what we had - and finally a theorical memory leak fix on serialization failure" * tag '9p-for-6.7-rc1' of https://github.com/martinetd/linux: 9p/net: fix possible memory leak in p9_check_errors() 9p/fs: add MODULE_DESCRIPTION 9p/net: xen: fix false positive printf format overflow warning 9p: v9fs_listxattr: fix %s null argument warning 9p/trans_fd: Annotate data-racy writes to file::f_flags fs/9p: Remove unused function declaration v9fs_inode2stat() 9p/trans_fd: avoid sending req to a cancelled conn commit 766e9cf3bd64c45fcace3acc6f8b3df815448ea3 Merge: 4c975a43fa380 d9a6d78096056 Author: Linus Torvalds Date: Sat Nov 4 09:13:50 2023 -1000 Merge tag '6.7-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6 Pull smb client updates from Steve French: - use after free fixes and deadlock fix - symlink timestamp fix - hashing perf improvement - multichannel fixes - minor debugging improvements - fix creating fifos when using "sfu" mounts - NTLMSSP authentication improvement - minor fixes to include some missing create flags and structures from recently updated protocol documentation * tag '6.7-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6: cifs: force interface update before a fresh session setup cifs: do not reset chan_max if multichannel is not supported at mount cifs: reconnect helper should set reconnect for the right channel smb: client: fix use-after-free in smb2_query_info_compound() smb: client: remove extra @chan_count check in __cifs_put_smb_ses() cifs: add xid to query server interface call cifs: print server capabilities in DebugData smb: use crypto_shash_digest() in symlink_hash() smb: client: fix use-after-free bug in cifs_debug_data_proc_show() smb: client: fix potential deadlock when releasing mids smb3: fix creating FIFOs when mounting with "sfu" mount option Add definition for new smb3.1.1 command type SMB3: clarify some of the unused CreateOption flags cifs: Add client version details to NTLM authenticate message smb3: fix touch -h of symlink commit 4c975a43fa380676828321ebe5b662c743c14d9e Merge: 0a23fb262d17f 5329aa5101f73 Author: Linus Torvalds Date: Sat Nov 4 08:54:20 2023 -1000 Merge tag 'efi-next-for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI update from Ard Biesheuvel: "This is the only remaining EFI change, as everything else was taken via -tip this cycle: - implement uid/gid mount options for efivarfs" * tag 'efi-next-for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efivarfs: Add uid/gid mount options commit 96cb7a4e296da9aaae0ad61394fdb2828e0a21b5 Author: Neil Armstrong Date: Wed Oct 25 10:25:47 2023 +0200 dt-bindings: mailbox: qcom-ipcc: document the SM8650 Inter-Processor Communication Controller Document the Inter-Processor Communication Controller on the SM8650 Platform. Signed-off-by: Neil Armstrong Reviewed-by: Krzysztof Kozlowski Reviewed-by: Manivannan Sadhasivam Signed-off-by: Jassi Brar commit 0a23fb262d17f587c9bb1e6cc83ad4158b21f16e Merge: 5c5e048b2417a cf5ab01c87030 Author: Linus Torvalds Date: Sat Nov 4 08:46:37 2023 -1000 Merge tag 'x86_microcode_for_v6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 microcode loading updates from Borislac Petkov: "Major microcode loader restructuring, cleanup and improvements by Thomas Gleixner: - Restructure the code needed for it and add a temporary initrd mapping on 32-bit so that the loader can access the microcode blobs. This in itself is a preparation for the next major improvement: - Do not load microcode on 32-bit before paging has been enabled. Handling this has caused an endless stream of headaches, issues, ugly code and unnecessary hacks in the past. And there really wasn't any sensible reason to do that in the first place. So switch the 32-bit loading to happen after paging has been enabled and turn the loader code "real purrty" again - Drop mixed microcode steppings loading on Intel - there, a single patch loaded on the whole system is sufficient - Rework late loading to track which CPUs have updated microcode successfully and which haven't, act accordingly - Move late microcode loading on Intel in NMI context in order to guarantee concurrent loading on all threads - Make the late loading CPU-hotplug-safe and have the offlined threads be woken up for the purpose of the update - Add support for a minimum revision which determines whether late microcode loading is safe on a machine and the microcode does not change software visible features which the machine cannot use anyway since feature detection has happened already. Roughly, the minimum revision is the smallest revision number which must be loaded currently on the system so that late updates can be allowed - Other nice leanups, fixess, etc all over the place" * tag 'x86_microcode_for_v6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (40 commits) x86/microcode/intel: Add a minimum required revision for late loading x86/microcode: Prepare for minimal revision check x86/microcode: Handle "offline" CPUs correctly x86/apic: Provide apic_force_nmi_on_cpu() x86/microcode: Protect against instrumentation x86/microcode: Rendezvous and load in NMI x86/microcode: Replace the all-in-one rendevous handler x86/microcode: Provide new control functions x86/microcode: Add per CPU control field x86/microcode: Add per CPU result state x86/microcode: Sanitize __wait_for_cpus() x86/microcode: Clarify the late load logic x86/microcode: Handle "nosmt" correctly x86/microcode: Clean up mc_cpu_down_prep() x86/microcode: Get rid of the schedule work indirection x86/microcode: Mop up early loading leftovers x86/microcode/amd: Use cached microcode for AP load x86/microcode/amd: Cache builtin/initrd microcode early x86/microcode/amd: Cache builtin microcode too x86/microcode/amd: Use correct per CPU ucode_cpu_info ... commit c4accde498dd7db8352d574958d19a5f710aba69 Author: Kent Overstreet Date: Mon Oct 30 12:30:52 2023 -0400 bcachefs: Ensure srcu lock is not held too long The SRCU read lock that btree_trans takes exists to make it safe for bch2_trans_relock() to deref pointers to btree nodes/key cache items we don't have locked, but as a side effect it blocks reclaim from freeing those items. Thus, it's important to not hold it for too long: we need to differentiate between bch2_trans_unlock() calls that will be only for a short duration, and ones that will be for an unbounded duration. This introduces bch2_trans_unlock_long(), to be used mainly by the data move paths. Signed-off-by: Kent Overstreet commit 6dfa10ab22a6a322269a3454d7ac720dc2f8bf11 Author: Kent Overstreet Date: Tue Oct 31 18:05:22 2023 -0400 bcachefs: Fix build errors with gcc 10 gcc 10 seems to complain about array bounds in situations where gcc 11 does not - curious. This unfortunately requires adding some casts for now; we may investigate getting rid of our __u64 _data[] VLA in a future patch so that our start[0] members can be VLAs. Reported-by: John Stoffel Signed-off-by: Kent Overstreet commit 4db8ac8629b1ee75316849b0e8ea5bbf90335706 Author: Kent Overstreet Date: Tue Oct 31 12:29:58 2023 -0400 bcachefs: Fix MEAN_AND_VARIANCE kconfig options Fixes: https://lore.kernel.org/linux-bcachefs/CAMuHMdXpwMdLuoWsNGa8qacT_5Wv-vSTz0xoBR5n_fnD9cNOuQ@mail.gmail.com/ Signed-off-by: Kent Overstreet commit 1f7056b735d59843faee70f504f71e1fbffc51d8 Author: Kent Overstreet Date: Mon Oct 30 13:15:36 2023 -0400 bcachefs: Ensure copygc does not spin If copygc does no work - finds no fragmented buckets - wait for a bit of IO to happen. Signed-off-by: Kent Overstreet commit 5c5e048b2417a56b7b52bdbb66d4fc99d0c20dd2 Merge: 3062a9879afbc 5f56cb030e4bc Author: Linus Torvalds Date: Sat Nov 4 08:07:19 2023 -1000 Merge tag 'kbuild-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - Implement the binary search in modpost for faster symbol lookup - Respect HOSTCC when linking host programs written in Rust - Change the binrpm-pkg target to generate kernel-devel RPM package - Fix endianness issues for tee and ishtp MODULE_DEVICE_TABLE - Unify vdso_install rules - Remove unused __memexit* annotations - Eliminate stale whitelisting for __devinit/__devexit from modpost - Enable dummy-tools to handle the -fpatchable-function-entry flag - Add 'userldlibs' syntax * tag 'kbuild-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (30 commits) kbuild: support 'userldlibs' syntax kbuild: dummy-tools: pretend we understand -fpatchable-function-entry kbuild: Correct missing architecture-specific hyphens modpost: squash ALL_{INIT,EXIT}_TEXT_SECTIONS to ALL_TEXT_SECTIONS modpost: merge sectioncheck table entries regarding init/exit sections modpost: use ALL_INIT_SECTIONS for the section check from DATA_SECTIONS modpost: disallow the combination of EXPORT_SYMBOL and __meminit* modpost: remove EXIT_SECTIONS macro modpost: remove MEM_INIT_SECTIONS macro modpost: remove more symbol patterns from the section check whitelist modpost: disallow *driver to reference .meminit* sections linux/init: remove __memexit* annotations modpost: remove ALL_EXIT_DATA_SECTIONS macro kbuild: simplify cmd_ld_multi_m kbuild: avoid too many execution of scripts/pahole-flags.sh kbuild: remove ARCH_POSTLINK from module builds kbuild: unify no-compiler-targets and no-sync-config-targets kbuild: unify vdso_install rules docs: kbuild: add INSTALL_DTBS_PATH UML: remove unused cmd_vdso_install ... commit 3062a9879afbca810d9f1613698963ecfcb35701 Merge: 90b0c2b2edd1a 4b27d5c420335 Author: Linus Torvalds Date: Sat Nov 4 07:54:21 2023 -1000 Merge tag 'acpi-6.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fix from Rafael Wysocki: "Fix the acpi_thermal_add() error path that may do a double-free in some cases after recent changes (Dan Carpenter)" * tag 'acpi-6.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: thermal: Fix acpi_thermal_unregister_thermal_zone() cleanup commit 6d55d31e927eec68ba6db344688044ed253223e9 Merge: 3a8ab4a13d17f 5a985960a4dd0 Author: Miquel Raynal Date: Sat Nov 4 11:50:22 2023 +0100 Merge tag 'nand/for-6.7' into mtd/next The raw NAND subsystem has, as usual, seen a bit of cleanup being done this cycle, typically return values of platform_get_irq() and devm_kasprintf(), plus structure annotations for sanitizers. There is also a better ECC check in the Arasan driver. This comes with smaller misc changes. In the SPI-NAND world there is now support for Foresee F35SQA002G, Winbond W25N and XTX XT26 chips. Signed-off-by: Miquel Raynal commit 3a8ab4a13d17f2a16cd4f125e5238096c1c55149 Merge: 565fe150624ee 6823a83834202 Author: Miquel Raynal Date: Sat Nov 4 11:49:52 2023 +0100 Merge tag 'spi-nor/for-6.7' into mtd/next For SPI NOR we cleaned the flash info entries in order to have them slimmer and self explanatory. In order to make the entries as slim as possible, we introduced sane default values so that the actual flash entries don't need to specify them. We now use a flexible macro to specify the flash ID instead of the previous INFOx() macros that had hardcoded ID lengths. Instead of: - { "w25q512nwm", INFO(0xef8020, 0, 64 * 1024, 0) - OTP_INFO(256, 3, 0x1000, 0x1000) }, We now use: + .id = SNOR_ID(0xef, 0x80, 0x20), + .name = "w25q512nwm", + .otp = SNOR_OTP(256, 3, 0x1000, 0x1000), We also removed some flash entries: the very old Catalyst SPI EEPROMs that were introduced once with the SPI-NOR subsystem, and a Fujitsu MRAM. Both should use the at25 EEPROM driver. The latter even has device tree bindings for the at25 driver. We made sure that the conversion didn't introduce any unwanted changes by comparing the .rodata segment before and after the conversion. The patches landed in linux-next immediately after v6.6-rc2, we haven't seen any regressions yet. Apart of the autumn cleaning we introduced a new flash entry, at25ff321a, and added block protection support for mt25qu512a. Signed-off-by: Miquel Raynal commit 5be55473a06475cc1128ccd93831ff57a068a81e Author: Bartosz Golaszewski Date: Tue Oct 10 14:35:19 2023 +0200 pinctrl: tegra: drop the wrapper around pinctrl_gpio_request() pinctrl_gpio_request() now has the same signature as the wrapper around it so we can drop them. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 8e1df2f5d689e361ee1892cbc804995f71793b7e Author: Bartosz Golaszewski Date: Tue Oct 10 14:33:08 2023 +0200 pinctrl: em: drop the wrapper around pinctrl_gpio_request() pinctrl_gpio_request() now has the same signature as the wrapper around it so we can drop them. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 11d84b2033ade571b86e1c7fed2892ce3c556aff Author: Bartosz Golaszewski Date: Fri Oct 13 14:04:28 2023 +0200 pinctrl: nuvoton: npcm8xx: drop wrappers around pinctrl_gpio_request/free() pinctrl_gpio_*() helpers now have signatures corresponding with those of the GPIOLIB callbacks. We can drop the wrappers. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit de38bdbe011b3102e673add59c58c44bd162c86f Author: Bartosz Golaszewski Date: Fri Oct 13 14:04:10 2023 +0200 pinctrl: nuvoton: npcm7xx: drop wrappers around pinctrl_gpio_request/free() pinctrl_gpio_*() helpers now have signatures corresponding with those of the GPIOLIB callbacks. We can drop the wrappers. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit b04ce10d22bb5d1a48c74dd476e75f88d5d8982c Author: Bartosz Golaszewski Date: Tue Oct 10 12:16:14 2023 +0200 pinctrl: stm32: drop wrappers around pinctrl_gpio_free/input() pinctrl_gpio_*() helpers now have signatures corresponding with those of the GPIOLIB callbacks. We can drop the wrappers. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 895bf1d82656ae938fb19d6c439c98f23abc413a Author: Bartosz Golaszewski Date: Fri Oct 13 14:03:43 2023 +0200 pinctrl: starfive: jh7110: drop wrappers around pinctrl_gpio_request/free() pinctrl_gpio_*() helpers now have signatures corresponding with those of the GPIOLIB callbacks. We can drop the wrappers. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 0b261df49ff8484d0e8faaa4ff82002a9bfa26fd Author: Bartosz Golaszewski Date: Fri Oct 13 14:03:31 2023 +0200 pinctrl: starfive: jh7100: drop wrappers around pinctrl_gpio_request/free() pinctrl_gpio_*() helpers now have signatures corresponding with those of the GPIOLIB callbacks. We can drop the wrappers. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 653e95f1fc466b40417b9d66da6aeec76bc29571 Author: Bartosz Golaszewski Date: Tue Oct 10 12:09:17 2023 +0200 pinctrl: ocelot: drop the wrapper around pinctrl_gpio_direction_input() pinctrl_gpio_direction_input() now has the same signature as the wrapper around it so we can drop them. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit d35e579d60a7cdd87fa13d2cad04a95ec27e0383 Author: Bartosz Golaszewski Date: Tue Oct 10 12:08:04 2023 +0200 pinctrl: cirrus: drop the wrapper around pinctrl_gpio_direction_input() pinctrl_gpio_direction_input() now has the same signature as the wrapper around it so we can drop them. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit c1649a7db47ffa51f1ad637f0d2d4114eff403b7 Author: Bartosz Golaszewski Date: Fri Oct 13 13:57:42 2023 +0200 pinctrl: mediatek: common: drop the wrappers around pinctrl_gpio_direction_input() pinctrl_gpio_direction_input() now has the same signature as the wrappers around it so we can drop them. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit f00f921fd3f49e3a8f2303719e3c5945805fd5aa Author: Bartosz Golaszewski Date: Fri Oct 13 13:57:27 2023 +0200 pinctrl: mediatek: moore: drop the wrappers around pinctrl_gpio_direction_input() pinctrl_gpio_direction_input() now has the same signature as the wrappers around it so we can drop them. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 5835b3f2a2cb6fff443e46192e6aa8e2a92a3347 Author: Bartosz Golaszewski Date: Tue Oct 10 12:00:06 2023 +0200 pinctrl: rk805: drop the wrapper around pinctrl_gpio_direction_input() pinctrl_gpio_direction_input() now has the same signature as the wrapper around it so we can drop them. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 36077c86fee25c24de749c8f4e483f76920c659c Author: Bartosz Golaszewski Date: Tue Oct 10 11:58:42 2023 +0200 pinctrl: axp209: drop the wrapper around pinctrl_gpio_direction_input() pinctrl_gpio_direction_input() now has the same signature as the wrapper around it so we can drop them. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit ffed728761214d705bddcb611956cfbb74549465 Author: Bartosz Golaszewski Date: Tue Oct 10 11:56:24 2023 +0200 pinctrl: vt8500: drop the wrapper around pinctrl_gpio_direction_input() pinctrl_gpio_direction_input() now has the same signature as the wrapper around it so we can drop them. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 54d9eab19e769dbedf33968da9a729a4df105327 Author: Bartosz Golaszewski Date: Tue Oct 10 11:53:40 2023 +0200 pinctrl: as3722: drop the wrapper around pinctrl_gpio_direction_input() pinctrl_gpio_direction_input() now has the same signature as the wrapper around it so we can drop them. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 22c7203db32040f4f36aba9fb2217db792f29725 Author: Bartosz Golaszewski Date: Tue Oct 10 10:40:47 2023 +0200 pinctrl: ingenic: drop the wrapper around pinctrl_gpio_direction_input() pinctrl_gpio_direction_input() now has the same signature as the wrapper around it so we can drop them. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit b6d83d010db67bff883240116ee84ebdffe6711b Author: Bartosz Golaszewski Date: Tue Oct 10 10:40:25 2023 +0200 pinctrl: st: drop the wrapper around pinctrl_gpio_direction_input() pinctrl_gpio_direction_input() now has the same signature as the wrapper around it so we can drop it. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 6042aaef3158bd34c2851d77a134f7fc711acb1e Author: Bartosz Golaszewski Date: Tue Oct 10 16:22:16 2023 +0200 pinctrl: change the signature of pinctrl_ready_for_gpio_range() Modify pinctrl_ready_for_gpio_range() to be in line with public GPIO helpers and take a pair of GPIO chip & offset as arguments Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit 31d4e8d10177ff2e96a905480dd6779cdf17a596 Author: Bartosz Golaszewski Date: Tue Oct 10 16:17:01 2023 +0200 pinctrl: change the signature of gpio_to_pin() Modify gpio_to_pin() to be in line with public GPIO helpers and take a pair of GPIO chip & offset as arguments. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit 58e772f43774aef0bbb099c5e63801562a467d5a Author: Bartosz Golaszewski Date: Tue Oct 10 16:13:14 2023 +0200 pinctrl: change the signature of pinctrl_match_gpio_range() Modify pinctrl_match_gpio_range() to be in line with public GPIO helpers and take a pair of GPIO chip & offset as arguments. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit 82059c3d78409b29d9bb436a137e72453d30277a Author: Bartosz Golaszewski Date: Tue Oct 10 15:34:28 2023 +0200 pinctrl: change the signature of pinctrl_get_device_gpio_range() Modify pinctrl_get_device_gpio_range() to be in line with public GPIO helpers and take a pair of GPIO chip & offset as arguments. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit 315c4418ac659bca89120fb4270ede71257d5070 Author: Bartosz Golaszewski Date: Tue Oct 10 15:32:52 2023 +0200 pinctrl: change the signature of pinctrl_gpio_direction() Modify pinctrl_gpio_direction() to be in line with public GPIO helpers and take a pair of GPIO chip & offset as arguments. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit acf2981b84c344428baa10dbc9234749c68dedae Author: Bartosz Golaszewski Date: Tue Oct 3 12:01:01 2023 +0200 treewide: rename pinctrl_gpio_set_config_new() Now that pinctrl_gpio_set_config() is no longer used, let's drop the '_new' suffix from its improved variant. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit b679d6c06b2b29187374f9f4da7eea1961c2eeaa Author: Bartosz Golaszewski Date: Tue Oct 3 11:59:51 2023 +0200 treewide: rename pinctrl_gpio_direction_output_new() Now that pinctrl_gpio_direction_output() is no longer used, let's drop the '_new' suffix from its improved variant. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 315c46f9b696be82972290d50349c7824276b844 Author: Bartosz Golaszewski Date: Tue Oct 3 11:58:30 2023 +0200 treewide: rename pinctrl_gpio_direction_input_new() Now that pinctrl_gpio_direction_input() is no longer used, let's drop the '_new' suffix from its improved variant. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 4fccb263f3a0dc07b306213930e0c25d1c9002b0 Author: Bartosz Golaszewski Date: Tue Oct 3 11:57:17 2023 +0200 treewide: rename pinctrl_gpio_free_new() Now that pinctrl_gpio_free()() is no longer used, let's drop the '_new' suffix from its improved variant. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit acb38be654f9af05fe626b37ea83e119cd310c3c Author: Bartosz Golaszewski Date: Tue Oct 3 11:56:03 2023 +0200 treewide: rename pinctrl_gpio_request_new() Now that pinctrl_gpio_request() is no longer used, let's drop the '_new' suffix from its improved variant. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 00762e416cd2001270a59fab417fbb1c30e2b7e5 Author: Bartosz Golaszewski Date: Tue Oct 3 11:54:45 2023 +0200 treewide: rename pinctrl_gpio_can_use_line_new() Now that pinctrl_gpio_can_use_line() is no longer used, let's drop the '_new' suffix from its improved variant. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit ab56e2bfceecae12e3b656b1641ecb961de6f92c Author: Bartosz Golaszewski Date: Tue Oct 10 15:16:54 2023 +0200 pinctrl: remove pinctrl_gpio_set_config() There are no more users of pinctrl_gpio_set_config() so remove it. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 45d2055b0067739253883dc541f37c86aad45c92 Author: Bartosz Golaszewski Date: Tue Oct 10 15:14:33 2023 +0200 pinctrl: remove pinctrl_gpio_direction_output() There are no more users of pinctrl_gpio_direction_output() so remove it. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit aec96797f9efcaf444400a9d92900de3acc13e51 Author: Bartosz Golaszewski Date: Tue Oct 10 15:13:38 2023 +0200 pinctrl: remove pinctrl_gpio_direction_input() There are no more users of pinctrl_gpio_direction_input() so remove it. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 1d2c88450f77d9d62883a4a2ecc5e840cc7c74ee Author: Bartosz Golaszewski Date: Tue Oct 10 15:11:28 2023 +0200 pinctrl: remove pinctrl_gpio_free() There are no more users of pinctrl_gpio_free() so remove it. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 699f0784631eee4f482291fdcc23c87a055ab5f7 Author: Bartosz Golaszewski Date: Tue Oct 10 15:04:24 2023 +0200 pinctrl: remove pinctrl_gpio_request() There are no more users of pinctrl_gpio_request() so remove it. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit a063e57adf7baa91eee52eb4131557c3a43f4c3a Author: Bartosz Golaszewski Date: Tue Oct 10 14:59:36 2023 +0200 pinctrl: remove pinctrl_gpio_can_use_line() There are no more users of pinctrl_gpio_can_use_line() so remove it. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit c6801e23322d03e57c299ff16d013bd37a5d9360 Author: Bartosz Golaszewski Date: Tue Oct 3 10:53:52 2023 +0200 pinctrl: st: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Reviewed-by: Patrice Chotard Acked-by: Linus Walleij commit 578d009b1b9da36593c2da5d5c265317551a480a Author: Bartosz Golaszewski Date: Fri Oct 13 13:54:53 2023 +0200 pinctrl: lynxpoint: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Mika Westerberg Acked-by: Linus Walleij commit 262abd2d17b605b1f7c0828d8296d7da7acd553a Author: Bartosz Golaszewski Date: Fri Oct 13 13:54:33 2023 +0200 pinctrl: intel: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Mika Westerberg Acked-by: Linus Walleij commit 588ad2b1b62a92f94168eb26d876150ba944fade Author: Bartosz Golaszewski Date: Fri Oct 13 13:54:10 2023 +0200 pinctrl: cherryview: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Mika Westerberg Acked-by: Linus Walleij commit 78329866ef57bf7d41e690922fd56092138f9fd2 Author: Bartosz Golaszewski Date: Tue Oct 3 10:51:02 2023 +0200 pinctrl: ingenic: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 4125651b3d7db5d8dcb0bdb58462efbb04c53365 Author: Bartosz Golaszewski Date: Tue Oct 3 10:22:10 2023 +0200 pinctrl: as3722: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit b2979a1786bcaca324b879f0d9f2590979b525e2 Author: Bartosz Golaszewski Date: Tue Oct 3 10:21:02 2023 +0200 pinctrl: cy8c95x0: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit f7fdb230ca16f1f4516f6ef826548aa044e9a521 Author: Bartosz Golaszewski Date: Tue Oct 3 10:17:57 2023 +0200 pinctrl: vt8500: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit ddfba5bde6b843cc7204e43246155f7ba6474b8e Author: Bartosz Golaszewski Date: Tue Oct 3 10:16:51 2023 +0200 pinctrl: axp209: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 47ad5c97ba898898d279af037443e21e051a5dd2 Author: Bartosz Golaszewski Date: Fri Oct 13 13:53:24 2023 +0200 pinctrl: mediatek: paris: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 6232d8b9346fd4460c3cab733c48390186c24c37 Author: Bartosz Golaszewski Date: Fri Oct 13 13:53:04 2023 +0200 pinctrl: mediatek: common: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 1b5f829b171215be194d06298ba4738da5e2a644 Author: Bartosz Golaszewski Date: Fri Oct 13 13:52:36 2023 +0200 pinctrl: mediatek: moore: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 3607ac37a4f378cd5f673d6bdb3776e45a899e2c Author: Bartosz Golaszewski Date: Tue Oct 3 10:12:12 2023 +0200 pinctrl: cirrus: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Charles Keepax Acked-by: Linus Walleij commit 91dff6b66e5e6a72136b5a0b276bc32d40ae2796 Author: Bartosz Golaszewski Date: Tue Oct 3 10:11:27 2023 +0200 pinctrl: rk805: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit da70bf79efad5a2a5891e92f2fef9bfb8ac24d92 Author: Bartosz Golaszewski Date: Tue Oct 3 10:10:39 2023 +0200 pinctrl: ocelot: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit fed493fce82be8dc0ab4ed15ea6acfd27d73f05b Author: Bartosz Golaszewski Date: Fri Oct 13 14:02:58 2023 +0200 pinctrl: starfive: jh7110: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 7cdd1db6afa1b7726433799db5964d8a99073490 Author: Bartosz Golaszewski Date: Fri Oct 13 14:02:45 2023 +0200 pinctrl: starfive: jh7100: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit a3305049053a66e04def76e62fc94d7980d88a84 Author: Bartosz Golaszewski Date: Tue Oct 3 09:59:58 2023 +0200 pinctrl: spear: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Viresh Kumar Acked-by: Linus Walleij commit 164fcf1eb3bff52ebc6655287ab74428b80aaccc Author: Bartosz Golaszewski Date: Tue Oct 3 09:56:50 2023 +0200 pinctrl: stm32: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 0bea3e7c157f6a1622c5b71eb8972502bd9b3241 Author: Bartosz Golaszewski Date: Tue Oct 3 09:55:27 2023 +0200 pinctrl: bcm: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit af80a91199a57a29f509943b2363b233d961b214 Author: Bartosz Golaszewski Date: Tue Oct 3 09:54:07 2023 +0200 pinctrl: renesas: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Acked-by: Linus Walleij commit 481a59fb3d988b2d86c86a341b8040804ed9a282 Author: Bartosz Golaszewski Date: Fri Oct 13 14:02:14 2023 +0200 pinctrl: nuvoton: npcm8xx: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit c54d686d7d9975c2bdc5fca6ec30f1600817a628 Author: Bartosz Golaszewski Date: Fri Oct 13 14:02:00 2023 +0200 pinctrl: nuvoton: npcm7xx: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 506e94e1084fec07f0f657883f4d5845c0c76bd5 Author: Bartosz Golaszewski Date: Tue Oct 3 10:06:39 2023 +0200 gpio: vf610: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 7233d90aead374eb58513f035079acd15f9f51b2 Author: Bartosz Golaszewski Date: Tue Oct 3 10:06:22 2023 +0200 gpio: rockchip: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Heiko Stuebner Acked-by: Linus Walleij commit 566e684e70cbfcb06039edcdf89637f211c914ba Author: Bartosz Golaszewski Date: Tue Oct 3 10:06:08 2023 +0200 gpio: pxa: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 4df6c2ec22b2f8e933f4ee7b357bec4312747707 Author: Bartosz Golaszewski Date: Tue Oct 3 10:05:54 2023 +0200 gpio: mvebu: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Uwe Kleine-König Acked-by: Linus Walleij commit 09a88bed64352f205bb1b9d0a12294ca43c25f21 Author: Bartosz Golaszewski Date: Tue Oct 3 09:41:14 2023 +0200 gpio: aspeed: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Jeffery Acked-by: Uwe Kleine-König Acked-by: Linus Walleij commit 9626b3d74d383539cfe3a54168335f07f5e0c125 Author: Bartosz Golaszewski Date: Tue Oct 3 09:24:26 2023 +0200 gpio: em: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit f6c54ab976154b0986d40fb28dd40c7279a26e35 Author: Bartosz Golaszewski Date: Tue Oct 3 09:23:37 2023 +0200 gpio: tegra: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit dd4e1f9cd6994146236215dbed44851567498a95 Author: Bartosz Golaszewski Date: Tue Oct 3 09:21:14 2023 +0200 gpio: rcar: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Acked-by: Linus Walleij commit 32fb7d23e76a4a89f9796c81dfde91b3d84257ef Author: Bartosz Golaszewski Date: Tue Oct 3 09:15:14 2023 +0200 gpio: cdev: use pinctrl_gpio_can_use_line_new() Use the improved variant of pinctrl_gpio_can_use_line() which takes a pointer to the gpio_chip and a controller-relative offset. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit e3d3ab299ba63c61776f3579d8a58c486eba5044 Author: Bartosz Golaszewski Date: Tue Oct 3 09:25:29 2023 +0200 gpiolib: generic: use new pinctrl GPIO helpers Replace the pinctrl helpers taking the global GPIO number as argument with the improved variants that instead take a pointer to the GPIO chip and the controller-relative offset. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit ec963d04ca8651cc3738bc8e013b3ab7fdb95e3d Author: Bartosz Golaszewski Date: Tue Oct 3 09:12:13 2023 +0200 pinctrl: provide new GPIO-to-pinctrl glue helpers Currently the pinctrl GPIO helpers all take a number from the global GPIO numberspace - of which we're trying to get rid of as argument. These helpers are almost universally called from GPIOLIB driver callbacks which take a pointer to the backing gpio_chip and the controller-relative offset as arguments. Let's provide improved variants of these functions that match the GPIOLIB signatures as the first step in removing the older flavor. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit 9596ebf87c4f3f439d658af4d7cc2a302bea3750 Author: Bartosz Golaszewski Date: Mon Oct 2 20:53:47 2023 +0200 pinctrl: remove unneeded extern specifiers from consumer.h The 'extern' specifiers are not needed for function declarations. Remove all of them from the pinctrl/consumer.h header. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko commit 2654521d774f9461234bcf3d089185404abd110b Author: Bartosz Golaszewski Date: Tue Sep 5 20:53:09 2023 +0200 gpiolib: remove gpiochip_find() With all users of gpiochip_find() converted to using gpio_device_find(), we can now remove this function from the kernel. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij commit 90b0c2b2edd1adff742c621e246562fbefa11b70 Merge: be47c8e326c23 63bffc2d3a99e Author: Linus Torvalds Date: Fri Nov 3 19:15:19 2023 -1000 Merge tag 'pinctrl-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "No pin control core changes this time. New drivers: - Realtek RTD family pin control driver and RTD1619B, RTD1319D and RTD1315E subdrivers - Nuvoton NPCM8xx combined pin control and GPIO driver - Amlogic T7 pin control driver - Renesas RZ/G3S pin control driver Improvements: - A number of additional UART groups added to the Mediatek MT7981 driver - MPM pin maps added for Qualcomm MSM8996, SM6115, SM6125 and SDM660 - Extra GPIO banks for the Sunxi H616 - MLSP I2C6 function support in Qualcomm MSM8226 - Some __counted_by() annotations for dynamic arrays - Ongoing work to make remove() return void - LSBC groups and functions in the Renesas R8A7778" * tag 'pinctrl-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (110 commits) pinctrl: Use device_get_match_data() dt-bindings: pinctrl: qcom,sa8775p-tlmm: add missing wakeup-parent dt-bindings: pinctrl: nuvoton,npcm845: Add missing additionalProperties on gpio child nodes dt-bindings: pinctrl: brcm: Ensure all child node properties are documented pinctrl: renesas: rzn1: Convert to platform remove callback returning void pinctrl: renesas: rzg2l: Add RZ/G3S support dt-bindings: pinctrl: renesas: Document RZ/G3S SoC pinctrl: renesas: rzg2l: Add support for different DS values on different groups pinctrl: renesas: rzg2l: Move DS and OI to SoC-specific configuration pinctrl: renesas: rzg2l: Adapt function number for RZ/G3S pinctrl: renesas: rzg2l: Adapt for different SD/PWPR register offsets pinctrl: renesas: rzg2l: Index all registers based on port offset pinctrl: renesas: rzg2l: Add validation of GPIO pin in rzg2l_gpio_request() pinctrl: renesas: r8a7778: Add LBSC pins, groups, and functions pinctrl: intel: fetch community only when we need it pinctrl: cherryview: reduce scope of PIN_CONFIG_BIAS_HIGH_IMPEDANCE case pinctrl: cherryview: Convert to platform remove callback returning void pinctrl: sprd-sc9860: Convert to platform remove callback returning void pinctrl: qcom/msm: Convert to platform remove callback returning void pinctrl: qcom/lpi: Convert to platform remove callback returning void ... commit be47c8e326c2375200473e442f3481c386a955c4 Merge: bfafa2c19d706 4ea2b6d3128ea Author: Linus Torvalds Date: Fri Nov 3 19:10:41 2023 -1000 Merge tag 'soundwire-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire Pull soundwire updates from Vinod Koul: - Core now has improved handling of errors for clock stop - Support for qcom v2.0.0 status registers and command ignored interrupt and more logging for failures - DMI quirk for HP Omen machine * tag 'soundwire-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: dmi-quirks: update HP Omen match soundwire: bus: improve error handling for clock stop prepare/deprepare soundwire: qcom: Log clk_get("iface") failures soundwire: qcom: handle command ignored interrupt soundwire: qcom: use newer link status tregister on v2.0.0 commit bfafa2c19d706ab1db0b581f9d3886469fab8627 Merge: d934aef6bb9ec d688c8264b8ed Author: Linus Torvalds Date: Fri Nov 3 19:06:12 2023 -1000 Merge tag 'phy-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy Pull generic phy updates from Vinod Koul: "New Support: - Qualcomm sa8775p qmp-pcie, IPQ5018, and SC7280 qmp-ufs support - Mediatek MT8188 support Updates: - Device tree device_get_match_data() usage and dropping of_match_device() calls - Qualcomm qmp usb and combo phy updates for v6 register layout - Qualcomm eusb2-repeater updates for tuning overrides, regmap fields - STih407 usb binding and ralink usb-phy yaml conversion - renesas r8a779f0 serdes init sequencing updates" * tag 'phy-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (32 commits) phy: Remove duplicated include in phy-ralink-usb.c phy: Kconfig: Select GENERIC_PHY for GENERIC_PHY_MIPI_DPHY phy: qcom-qmp-pcie: add endpoint support for sa8775p dt-bindings: phy: ralink-usb-phy: convert to dtschema dt-bindings: phy: Convert PXA1928 USB/HSIC PHY to DT schema phy: Drop unnecessary of_match_device() calls phy: rockchip-inno-usb2: Drop unnecessary DT includes phy: Use device_get_match_data() phy: realtek: Replace of_device.h with explicit includes phy: renesas: r8a779f0-ether-serdes: Add .exit() ops phy: renesas: r8a779f0-ether-serdes: Reset in .init() phy: qcom-qmp-combo: use v6 registers in v6 regs layout phy: qcom-qmp-usb: move PCS v6 register to the proper header phy: qcom-qmp-combo: fix the prefix for the PCS_USB v6 registers phy: sun4i-usb: update array size phy: qualcomm: phy-qcom-eusb2-repeater: Add tuning overrides phy: qualcomm: phy-qcom-eusb2-repeater: Zero out untouched tuning regs phy: qualcomm: phy-qcom-eusb2-repeater: Use regmap_fields dt-bindings: phy: qcom,snps-eusb2-repeater: Add magic tuning overrides dt-bindings: phy: Add compatible for Mediatek MT8188 ... commit d934aef6bb9ec1b42dfe1f5c1f945fa0d2d0752c Merge: 2c40c1c6adab9 03f25d53b145b Author: Linus Torvalds Date: Fri Nov 3 18:56:51 2023 -1000 Merge tag 'dmaengine-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine Pull dmaengine updates from Vinod Koul: - Big pile of __counted_by attribute annotations to several structures for bounds checking of flexible arrays at run-time - Another big pile platform remove callback returning void changes - Device tree device_get_match_data() usage and dropping of_match_device() calls - Minor driver updates to pxa, idxd fsl, hisi etc drivers * tag 'dmaengine-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (106 commits) dmaengine: stm32-mdma: correct desc prep when channel running dmaengine: dw-axi-dmac: Add support DMAX_NUM_CHANNELS > 16 dmaengine: xilinx: xilinx_dma: Fix kernel doc about xilinx_dma_remove() dmaengine: mmp_tdma: drop unused variable 'of_id' MAINTAINERS: Add entries for NXP(Freescale) eDMA drivers dmaengine: xilinx: xdma: Support cyclic transfers dmaengine: xilinx: xdma: Prepare the introduction of cyclic transfers dmaengine: Drop unnecessary of_match_device() calls dmaengine: Use device_get_match_data() dmaengine: pxa_dma: Annotate struct pxad_desc_sw with __counted_by dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() dmaengine: xilinx: xdma: Use resource_size() in xdma_probe() dmaengine: fsl-dpaa2-qdma: Remove redundant initialization owner in dpaa2_qdma_driver dmaengine: Remove unused declaration dma_chan_cleanup() dmaengine: mmp: fix Wvoid-pointer-to-enum-cast warning dmaengine: qcom: fix Wvoid-pointer-to-enum-cast warning dmaengine: fsl-edma: Remove redundant dev_err() for platform_get_irq() dmaengine: ep93xx_dma: Annotate struct ep93xx_dma_engine with __counted_by dmaengine: idxd: add wq driver name support for accel-config user tool dmaengine: fsl-edma: Annotate struct struct fsl_edma_engine with __counted_by ... commit 2c40c1c6adab90ee4660caf03722b3a3ec67767b Merge: 1f24458a1071f c70793fb7632a Author: Linus Torvalds Date: Fri Nov 3 16:00:42 2023 -1000 Merge tag 'usb-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB/Thunderbolt updates from Greg KH: "Here is the "big" set of USB and Thunderbolt changes for 6.7-rc1. Nothing really major in here, just lots of constant development for new hardware. Included in here are: - Thunderbolt (i.e. USB4) fixes for reported issues and support for new hardware types and devices - USB typec additions of new drivers and cleanups for some existing ones - xhci cleanups and expanded tracing support and some platform specific updates - USB "La Jolla Cove Adapter (LJCA)" support added, and the gpio, spi, and i2c drivers for that type of device (all acked by the respective subsystem maintainers.) - lots of USB gadget driver updates and cleanups - new USB dwc3 platforms supported, as well as other dwc3 fixes and cleanups - USB chipidea driver updates - other smaller driver cleanups and additions, full details in the shortlog All of these have been in the linux-next tree for a while with no reported problems" * tag 'usb-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (167 commits) usb: gadget: uvc: Add missing initialization of ssp config descriptor usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility usb: raw-gadget: report suspend, resume, reset, and disconnect events usb: raw-gadget: don't disable device if usb_ep_queue fails usb: raw-gadget: properly handle interrupted requests usb:cdnsp: remove TRB_FLUSH_ENDPOINT command usb: gadget: aspeed_udc: Convert to platform remove callback returning void dt-bindings: usb: fsa4480: Add compatible for OCP96011 usb: typec: fsa4480: Add support to swap SBU orientation dt-bindings: usb: fsa4480: Add data-lanes property to endpoint usb: typec: tcpm: Fix NULL pointer dereference in tcpm_pd_svdm() Revert "dt-bindings: usb: Add bindings for multiport properties on DWC3 controller" Revert "dt-bindings: usb: qcom,dwc3: Add bindings for SC8280 Multiport" thunderbolt: Fix one kernel-doc comment usb: gadget: f_ncm: Always set current gadget in ncm_bind() usb: core: Remove duplicated check in usb_hub_create_port_device usb: typec: tcpm: Add additional checks for contaminant arm64: dts: rockchip: rk3588s: Add USB3 host controller usb: dwc3: add optional PHY interface clocks dt-bindings: usb: add rk3588 compatible to rockchip,dwc3 ... commit 1f24458a1071f006e3f7449c08ae0f12af493923 Merge: 4c7a0c95adc3e 64ebf8797249e Author: Linus Torvalds Date: Fri Nov 3 15:44:25 2023 -1000 Merge tag 'tty-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty and serial updates from Greg KH: "Here is the big set of tty/serial driver changes for 6.7-rc1. Included in here are: - console/vgacon cleanups and removals from Arnd - tty core and n_tty cleanups from Jiri - lots of 8250 driver updates and cleanups - sc16is7xx serial driver updates - dt binding updates - first set of port lock wrapers from Thomas for the printk fixes coming in future releases - other small serial and tty core cleanups and updates All of these have been in linux-next for a while with no reported issues" * tag 'tty-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (193 commits) serdev: Replace custom code with device_match_acpi_handle() serdev: Simplify devm_serdev_device_open() function serdev: Make use of device_set_node() tty: n_gsm: add copyright Siemens Mobility GmbH tty: n_gsm: fix race condition in status line change on dead connections serial: core: Fix runtime PM handling for pending tx vgacon: fix mips/sibyte build regression dt-bindings: serial: drop unsupported samsung bindings tty: serial: samsung: drop earlycon support for unsupported platforms tty: 8250: Add note for PX-835 tty: 8250: Fix IS-200 PCI ID comment tty: 8250: Add Brainboxes Oxford Semiconductor-based quirks tty: 8250: Add support for Intashield IX cards tty: 8250: Add support for additional Brainboxes PX cards tty: 8250: Fix up PX-803/PX-857 tty: 8250: Fix port count of PX-257 tty: 8250: Add support for Intashield IS-100 tty: 8250: Add support for Brainboxes UP cards tty: 8250: Add support for additional Brainboxes UC cards tty: 8250: Remove UC-257 and UC-431 ... commit 4c7a0c95adc3ed8cc5e4c2187521aea3e40ba1aa Merge: b06f58ad8e8c4 a4000df5300fd Author: Linus Torvalds Date: Fri Nov 3 15:31:04 2023 -1000 Merge tag 'staging-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here is the big set of staging driver updates for 6.7-rc1. A bit bigger than 6.6 this time around, as it coincided with the Outreachy and mentorship application process, so we got a bunch of new developers sending in their first changes, which is nice to see. Also in here is a removal of the qlge ethernet driver, and the rtl8192u wireless driver. Both of these were very old and no one was maintaining them, the wireless driver removal was due to no one using it anymore, and no hardware to be found, and is part of a larger effort to remove unused and old wifi drivers from the system. The qlge ethernet driver did have one user pop up after it was dropped, and we are working with the network mainainers to figure out what tree it will come back in from and who will be responsible for it, and if it really is being used or not. Odds are it will show up in a network subsystem pull request after -rc1 is out, but we aren't sure yet. Other smaller changes in here are: - Lots of vc04_services work by Umang to clean up the mess created by the rpi developers long ago, bringing it almost into good enough shape to get out of staging, hopefully next major release, it's getting close. - rtl8192e variable cleanups and removal of unused code and structures - vme_user coding style cleanups - other small coding style cleanups to lots of the staging drivers - octeon typedef removals, and then last-minute revert when it was found to break the build in some configurations (it's a hard driver to build properly, none of the normal automated testing catches it.) All of these have been in linux-next for a while with no reported issues" * tag 'staging-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (256 commits) Revert "staging: octeon: remove typedef in enum cvmx_spi_mode_t" Revert "staging: octeon: remove typedef in enum cvmx_helper_interface_mode_t" Revert "staging: octeon: remove typedef in enum cvmx_pow_wait_t" Revert "staging: octeon: remove typedef in struct cvmx_pko_lock_t" Revert "staging: octeon: remove typedef in enum cvmx_pko_status_t" Revert "staging: octeon: remove typedef in structs cvmx_pip_port_status_t and cvmx_pko_port_status_t" staging: vt6655: Type encoding info dropped from variable name "byRxRate" staging: vt6655: Type encoding info dropped from function name "CARDbUpdateTSF" staging: vt6655: Type encoding info dropped from function name "CARDvSetRSPINF" staging: vt6655: Type encoding info dropped from function name "CARDbyGetPktType" staging: vt6655: Type encoding info dropped from variable name "byPacketType" staging: vt6655: Type encoding info dropped from function name "CARDbSetPhyParameter" staging: vt6655: Type encoding info dropped from variable name "pbyRsvTime" staging: vt6655: Type encoding info dropped from variable name "pbyTxRate" staging: vt6655: Type encoding info dropped from function name "s_vCalculateOFDMRParameter" staging: vt6655: Type encoding info dropped from array name "cwRXBCNTSFOff" staging: fbtft: Convert to platform remove callback returning void staging: olpc_dcon: Remove I2C_CLASS_DDC support staging: vc04_services: use snprintf instead of sprintf staging: rtl8192e: Fix line break issue at priv->rx_buf[priv->rx_idx] ... commit b06f58ad8e8c4154bc88d83b4fd70f74ede50193 Merge: d99b91a99be43 effd7c70eaa04 Author: Linus Torvalds Date: Fri Nov 3 15:15:47 2023 -1000 Merge tag 'driver-core-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here is the set of driver core updates for 6.7-rc1. Nothing major in here at all, just a small number of changes including: - minor cleanups and updates from Andy Shevchenko - __counted_by addition - firmware_loader update for aborting loads cleaner - other minor changes, details in the shortlog - documentation update All of these have been in linux-next for a while with no reported issues" * tag 'driver-core-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (21 commits) firmware_loader: Abort all upcoming firmware load request once reboot triggered firmware_loader: Refactor kill_pending_fw_fallback_reqs() Documentation: security-bugs.rst: linux-distros relaxed their rules driver core: Release all resources during unbind before updating device links driver core: class: remove boilerplate code driver core: platform: Annotate struct irq_affinity_devres with __counted_by resource: Constify resource crosscheck APIs resource: Unify next_resource() and next_resource_skip_children() resource: Reuse for_each_resource() macro PCI: Implement custom llseek for sysfs resource entries kernfs: sysfs: support custom llseek method for sysfs entries debugfs: Fix __rcu type comparison warning device property: Replace custom implementation of COUNT_ARGS() drivers: base: test: Make property entry API test modular driver core: Add missing parameter description to __fwnode_link_add() device property: Clarify usage scope of some struct fwnode_handle members devres: rename the first parameter of devm_add_action(_or_reset) driver core: platform: Unify the firmware node type check driver core: platform: Use temporary variable in platform_device_add() driver core: platform: Refactor error path in a couple places ... commit d99b91a99be430be45413052bb428107c435918b Merge: e392ea4d4d008 fa10f413091a4 Author: Linus Torvalds Date: Fri Nov 3 14:51:08 2023 -1000 Merge tag 'char-misc-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc updates from Greg KH: "Here is the big set of char/misc and other small driver subsystem changes for 6.7-rc1. Included in here are: - IIO subsystem driver updates and additions (largest part of this pull request) - FPGA subsystem driver updates - Counter subsystem driver updates - ICC subsystem driver updates - extcon subsystem driver updates - mei driver updates and additions - nvmem subsystem driver updates and additions - comedi subsystem dependency fixes - parport driver fixups - cdx subsystem driver and core updates - splice support for /dev/zero and /dev/full - other smaller driver cleanups All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (326 commits) cdx: add sysfs for subsystem, class and revision cdx: add sysfs for bus reset cdx: add support for bus enable and disable cdx: Register cdx bus as a device on cdx subsystem cdx: Create symbol namespaces for cdx subsystem cdx: Introduce lock to protect controller ops cdx: Remove cdx controller list from cdx bus system dts: ti: k3-am625-beagleplay: Add beaglecc1352 greybus: Add BeaglePlay Linux Driver dt-bindings: net: Add ti,cc1352p7 dt-bindings: eeprom: at24: allow NVMEM cells based on old syntax dt-bindings: nvmem: SID: allow NVMEM cells based on old syntax Revert "nvmem: add new config option" MAINTAINERS: coresight: Add missing Coresight files misc: pci_endpoint_test: Add deviceID for J721S2 PCIe EP device support firmware: xilinx: Move EXPORT_SYMBOL_GPL next to zynqmp_pm_feature definition uacce: make uacce_class constant ocxl: make ocxl_class constant cxl: make cxl_class constant misc: phantom: make phantom_class constant ... commit 9fd00df05e81a2e1080ce6e9abc35533dca99d74 Author: Zbigniew Lukwinski Date: Mon Oct 16 00:23:34 2023 +0200 i3c: master: handle IBIs in order they came IBI shall be handled in order they appear on the bus. Otherwise could hit case when order of handling them in device driver will be different. It may lead to invalid assembling fragmented packets or events order broken. Added separate workqueue with option WQ_MEM_RECLAIM for each device driver. This ensures IBI handling order and improves IBI handling performance: IBI handlers for device B are not blocked by IBI handlers for device A. Original solution (single workqueue in main driver) was able to handle also general IBI (not related to specific device) like HJ or MR. So leaving this for such purposes. Signed-off-by: Zbigniew Lukwinski Link: https://lore.kernel.org/r/20231015222334.1652401-2-zbigniew.lukwinski@linux.intel.com Signed-off-by: Alexandre Belloni commit b53e9758a31c683fc8615df930262192ed5f034b Author: Billy Tsai Date: Mon Oct 23 16:02:37 2023 +0800 i3c: master: mipi-i3c-hci: Fix a kernel panic for accessing DAT_data. The `i3c_master_bus_init` function may attach the I2C devices before the I3C bus initialization. In this flow, the DAT `alloc_entry`` will be used before the DAT `init`. Additionally, if the `i3c_master_bus_init` fails, the DAT `cleanup` will execute before the device is detached, which will execue DAT `free_entry` function. The above scenario can cause the driver to use DAT_data when it is NULL. Signed-off-by: Billy Tsai Link: https://lore.kernel.org/r/20231023080237.560936-1-billy_tsai@aspeedtech.com Signed-off-by: Alexandre Belloni commit 56d2e2cfa21315c12945c22e141c7e7ec8b0a630 Author: Christian Brauner Date: Mon Aug 7 15:26:26 2023 +0200 ceph: allow idmapped mounts Now that we converted cephfs internally to account for idmapped mounts allow the creation of idmapped mounts on by setting the FS_ALLOW_IDMAP flag. Signed-off-by: Christian Brauner Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 8a051b40abd6f948a599dc6328e9356f4697e77d Author: Christian Brauner Date: Mon Aug 7 15:26:25 2023 +0200 ceph: allow idmapped atomic_open inode op Enable ceph_atomic_open() to handle idmapped mounts. This is just a matter of passing down the mount's idmapping. [ aleksandr.mikhalitsyn: adapted to 5fadbd9929 ("ceph: rely on vfs for setgid stripping") ] Signed-off-by: Christian Brauner Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 2cce72dda2b5c494f6489ba78588c4ce191c6b61 Author: Christian Brauner Date: Mon Aug 7 15:26:24 2023 +0200 ceph: allow idmapped set_acl inode op Enable ceph_set_acl() to handle idmapped mounts. This is just a matter of passing down the mount's idmapping. Signed-off-by: Christian Brauner Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit a04aff2588e05bdefc6abb3f16999312db14c333 Author: Christian Brauner Date: Mon Aug 7 15:26:23 2023 +0200 ceph: allow idmapped setattr inode op Enable __ceph_setattr() to handle idmapped mounts. This is just a matter of passing down the mount's idmapping. [ aleksandr.mikhalitsyn: adapted to b27c82e12965 ("attr: port attribute changes to new types") ] Signed-off-by: Christian Brauner Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 79c66a0c8c4a5d341e948dd6a41111957b315f20 Author: Alexander Mikhalitsyn Date: Mon Aug 7 15:26:22 2023 +0200 ceph: pass idmap to __ceph_setattr Just pass down the mount's idmapping to __ceph_setattr, because we will need it later. Signed-off-by: Alexander Mikhalitsyn Acked-by: Christian Brauner Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 8995375fae40a9a014622fd2a0567fe8a2252e66 Author: Christian Brauner Date: Mon Aug 7 15:26:21 2023 +0200 ceph: allow idmapped permission inode op Enable ceph_permission() to handle idmapped mounts. This is just a matter of passing down the mount's idmapping. Signed-off-by: Christian Brauner Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 0513043ec491500237d7215bf1ccfed54f292e86 Author: Christian Brauner Date: Mon Aug 7 15:26:20 2023 +0200 ceph: allow idmapped getattr inode op Enable ceph_getattr() to handle idmapped mounts. This is just a matter of passing down the mount's idmapping. Signed-off-by: Christian Brauner Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 09838f1bfd40f483cd6442788e810ea042e91177 Author: Christian Brauner Date: Mon Aug 7 15:26:19 2023 +0200 ceph: pass an idmapping to mknod/symlink/mkdir Enable mknod/symlink/mkdir iops to handle idmapped mounts. This is just a matter of passing down the mount's idmapping. Signed-off-by: Christian Brauner Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 673478b6e59b25079a590eb5ba89d7a3ec9c1c78 Author: Alexander Mikhalitsyn Date: Mon Aug 7 15:26:18 2023 +0200 ceph: add enable_unsafe_idmap module parameter This parameter is used to decide if we allow to perform IO on idmapped mount in case when MDS lacks support of CEPHFS_FEATURE_HAS_OWNER_UIDGID feature. In this case we can't properly handle MDS permission checks and if UID/GID-based restrictions are enabled on the MDS side then IO requests which go through an idmapped mount may fail with -EACCESS/-EPERM. Fortunately, for most of users it's not a case and everything should work fine. But we put work "unsafe" in the module parameter name to warn users about possible problems with this feature and encourage update of cephfs MDS. Suggested-by: Stéphane Graber Signed-off-by: Alexander Mikhalitsyn Acked-by: Christian Brauner Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 5ccd8530dd7ba97531a50ffa11eabe258d65a7af Author: Christian Brauner Date: Mon Aug 7 15:26:17 2023 +0200 ceph: handle idmapped mounts in create_request_message() Inode operations that create a new filesystem object such as ->mknod, ->create, ->mkdir() and others don't take a {g,u}id argument explicitly. Instead the caller's fs{g,u}id is used for the {g,u}id of the new filesystem object. In order to ensure that the correct {g,u}id is used map the caller's fs{g,u}id for creation requests. This doesn't require complex changes. It suffices to pass in the relevant idmapping recorded in the request message. If this request message was triggered from an inode operation that creates filesystem objects it will have passed down the relevant idmaping. If this is a request message that was triggered from an inode operation that doens't need to take idmappings into account the initial idmapping is passed down which is an identity mapping. This change uses a new cephfs protocol extension CEPHFS_FEATURE_HAS_OWNER_UIDGID which adds two new fields (owner_{u,g}id) to the request head structure. So, we need to ensure that MDS supports it otherwise we need to fail any IO that comes through an idmapped mount because we can't process it in a proper way. MDS server without such an extension will use caller_{u,g}id fields to set a new inode owner UID/GID which is incorrect because caller_{u,g}id values are unmapped. At the same time we can't map these fields with an idmapping as it can break UID/GID-based permission checks logic on the MDS side. This problem was described with a lot of details at [1], [2]. [1] https://lore.kernel.org/lkml/CAEivzxfw1fHO2TFA4dx3u23ZKK6Q+EThfzuibrhA3RKM=ZOYLg@mail.gmail.com/ [2] https://lore.kernel.org/all/20220104140414.155198-3-brauner@kernel.org/ Link: https://github.com/ceph/ceph/pull/52575 Link: https://tracker.ceph.com/issues/62217 Co-Developed-by: Alexander Mikhalitsyn Signed-off-by: Christian Brauner Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 9c2df2271c6901ba67d3437494b3d889dc43645b Author: Christian Brauner Date: Mon Aug 7 15:26:16 2023 +0200 ceph: stash idmapping in mdsc request When sending a mds request cephfs will send relevant data for the requested operation. For creation requests the caller's fs{g,u}id is used to set the ownership of the newly created filesystem object. For setattr requests the caller can pass in arbitrary {g,u}id values to which the relevant filesystem object is supposed to be changed. If the caller is performing the relevant operation via an idmapped mount cephfs simply needs to take the idmapping into account when it sends the relevant mds request. In order to support idmapped mounts for cephfs we stash the idmapping whenever they are relevant for the operation for the duration of the request. Since mds requests can be queued and performed asynchronously we make sure to keep the idmapping around and release it once the request has finished. In follow-up patches we will use this to send correct ownership information over the wire. This patch just adds the basic infrastructure to keep the idmapping around. The actual conversion patches are all fairly minimal. Signed-off-by: Christian Brauner Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 1b90344614cc5949666328b37f03edec1d4e2873 Author: Alexander Mikhalitsyn Date: Mon Aug 7 15:26:15 2023 +0200 fs: export mnt_idmap_get/mnt_idmap_put These helpers are required to support idmapped mounts in CephFS. Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Christian Brauner Signed-off-by: Ilya Dryomov commit 522dc5108f07ef30e2c7399e59b9547d382308ff Author: Xiubo Li Date: Mon Jun 12 15:41:10 2023 +0800 libceph, ceph: move mdsmap.h to fs/ceph The mdsmap.h is only used by CephFS, so move it to fs/ceph. Signed-off-by: Xiubo Li Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 38d46409c4639a1d659ebfa70e27a8bed6b8ee1d Author: Xiubo Li Date: Mon Jun 12 09:04:07 2023 +0800 ceph: print cluster fsid and client global_id in all debug logs Multiple CephFS mounts on a host is increasingly common so disambiguating messages like this is necessary and will make it easier to debug issues. At the same this will improve the debug logs to make them easier to troubleshooting issues, such as print the ino# instead only printing the memory addresses of the corresponding inodes and print the dentry names instead of the corresponding memory addresses for the dentry,etc. Link: https://tracker.ceph.com/issues/61590 Signed-off-by: Xiubo Li Reviewed-by: Patrick Donnelly Reviewed-by: Milind Changire Signed-off-by: Ilya Dryomov commit 5995d90d2d19f337df6a50bcf4699ef053214dac Author: Xiubo Li Date: Mon Jun 12 10:50:38 2023 +0800 ceph: rename _to_client() to _to_fs_client() We need to covert the inode to ceph_client in the following commit, and will add one new helper for that, here we rename the old helper to _fs_client(). Link: https://tracker.ceph.com/issues/61590 Signed-off-by: Xiubo Li Reviewed-by: Patrick Donnelly Reviewed-by: Milind Changire Signed-off-by: Ilya Dryomov commit 197b7d792d6aead2e30d4b2c054ffabae2ed73dc Author: Xiubo Li Date: Fri Jun 9 15:15:47 2023 +0800 ceph: pass the mdsc to several helpers We will use the 'mdsc' to get the global_id in the following commits. Link: https://tracker.ceph.com/issues/61590 Signed-off-by: Xiubo Li Reviewed-by: Patrick Donnelly Reviewed-by: Milind Changire Signed-off-by: Ilya Dryomov commit 5c5f0d2b5f92c47baf82b9b211e27edd7d195158 Author: Xiubo Li Date: Fri Jun 9 13:04:14 2023 +0800 libceph: add doutc and *_client debug macros support This will help print the fsid and client's global_id in debug logs, and also print the function names. [ idryomov: %lld -> %llu, leading space for doutc(), don't include __func__ in pr_*() variants ] Link: https://tracker.ceph.com/issues/61590 Signed-off-by: Xiubo Li Reviewed-by: Patrick Donnelly Reviewed-by: Milind Changire Signed-off-by: Ilya Dryomov commit c692800cb2ef7a4f4940c68d765cd4649aff3e46 Author: Kirill A. Shutemov Date: Thu Nov 2 02:33:14 2023 +0300 MAINTAINERS: Add Intel TDX entry Add myself as Intel TDX maintainer. I drove upstreaming most of TDX code so far and I will continue working on TDX for foreseeable future. [ dhansen: * Add myself as a reviewer too * Swap Maintained=>Supported. I double checked Kirill is still being paid * Add drivers/virt/coco/tdx-guest ] Suggested-by: Dave Hansen Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Acked-by: Dave Hansen Acked-by: Kuppuswamy Sathyanarayanan Acked-by: Kai Huang Link: https://lore.kernel.org/all/20231101233314.2567-1-kirill.shutemov%40linux.intel.com commit e392ea4d4d00880bf94550151b1ace4f88a4b17a Merge: 707df298cbde2 991a211aa99f4 Author: Linus Torvalds Date: Fri Nov 3 10:17:22 2023 -1000 Merge tag 's390-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Vasily Gorbik: - Get rid of private VM_FAULT flags - Add word-at-a-time implementation - Add DCACHE_WORD_ACCESS support - Cleanup control register handling - Disallow CPU hotplug of CPU 0 to simplify its handling complexity, following a similar restriction in x86 - Optimize pai crypto map allocation - Update the list of crypto express EP11 coprocessor operation modes - Fixes and improvements for secure guests AP pass-through - Several fixes to address incorrect page marking for address translation with the "cmma no-dat" feature, preventing potential incorrect guest TLB flushes - Fix early IPI handling - Several virtual vs physical address confusion fixes - Various small fixes and improvements all over the code * tag 's390-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (74 commits) s390/cio: replace deprecated strncpy with strscpy s390/sclp: replace deprecated strncpy with strtomem s390/cio: fix virtual vs physical address confusion s390/cio: export CMG value as decimal s390: delete the unused store_prefix() function s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir s390/cmma: fix detection of DAT pages s390/sclp: handle default case in sclp memory notifier s390/pai_crypto: remove per-cpu variable assignement in event initialization s390/pai: initialize event count once at initialization s390/pai_crypto: use PERF_ATTACH_TASK define for per task detection s390/mm: add missing arch_set_page_dat() call to gmap allocations s390/mm: add missing arch_set_page_dat() call to vmem_crst_alloc() s390/cmma: fix initial kernel address space page table walk s390/diag: add missing virt_to_phys() translation to diag224() s390/mm,fault: move VM_FAULT_ERROR handling to do_exception() s390/mm,fault: remove VM_FAULT_BADMAP and VM_FAULT_BADACCESS s390/mm,fault: remove VM_FAULT_SIGNAL s390/mm,fault: remove VM_FAULT_BADCONTEXT s390/mm,fault: simplify kfence fault handling ... commit 707df298cbde200b939c70be2577b20775fe3345 Merge: 6bdfe2d88b9ff 303d77a6e1707 Author: Linus Torvalds Date: Fri Nov 3 10:07:39 2023 -1000 Merge tag 'powerpc-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc updates from Michael Ellerman: - Add support for KVM running as a nested hypervisor under development versions of PowerVM, using the new PAPR nested virtualisation API - Add support for the BPF prog pack allocator - A rework of the non-server MMU handling to support execute-only on all platforms - Some optimisations & cleanups for the powerpc qspinlock code - Various other small features and fixes Thanks to Aboorva Devarajan, Aditya Gupta, Amit Machhiwal, Benjamin Gray, Christophe Leroy, Dr. David Alan Gilbert, Gaurav Batra, Gautam Menghani, Geert Uytterhoeven, Haren Myneni, Hari Bathini, Joel Stanley, Jordan Niethe, Julia Lawall, Kautuk Consul, Kuan-Wei Chiu, Michael Neuling, Minjie Du, Muhammad Muzammil, Naveen N Rao, Nicholas Piggin, Nick Child, Nysal Jan K.A, Peter Lafreniere, Rob Herring, Sachin Sant, Sebastian Andrzej Siewior, Shrikanth Hegde, Srikar Dronamraju, Stanislav Kinsburskii, Vaibhav Jain, Wang Yufen, Yang Yingliang, and Yuan Tan. * tag 'powerpc-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (100 commits) powerpc/vmcore: Add MMU information to vmcoreinfo Revert "powerpc: add `cur_cpu_spec` symbol to vmcoreinfo" powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free] powerpc/bpf: rename powerpc64_jit_data to powerpc_jit_data powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack powerpc/bpf: implement bpf_arch_text_copy powerpc/code-patching: introduce patch_instructions() powerpc/32s: Implement local_flush_tlb_page_psize() powerpc/pseries: use kfree_sensitive() in plpks_gen_password() powerpc/code-patching: Perform hwsync in __patch_instruction() in case of failure powerpc/fsl_msi: Use device_get_match_data() powerpc: Remove cpm_dp...() macros powerpc/qspinlock: Rename yield_propagate_owner tunable powerpc/qspinlock: Propagate sleepy if previous waiter is preempted powerpc/qspinlock: don't propagate the not-sleepy state powerpc/qspinlock: propagate owner preemptedness rather than CPU number powerpc/qspinlock: stop queued waiters trying to set lock sleepy powerpc/perf: Fix disabling BHRB and instruction sampling powerpc/trace: Add support for HAVE_FUNCTION_ARG_ACCESS_API powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh ... commit 6bdfe2d88b9ff8b0cce32ce87cd47c0e9d665f48 Merge: 136cc1e1f5be7 6cede10161be0 Author: Linus Torvalds Date: Fri Nov 3 09:48:17 2023 -1000 Merge tag 'apparmor-pr-2023-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor Pull apparmor updates from John Johansen: "This adds initial support for mediating io_uring and userns creation. Adds a new restriction that tightens the use of change_profile, and a couple of optimizations to reduce performance bottle necks that have been found when retrieving the current task's secid and allocating work buffers. The majority of the patch set continues cleaning up and simplifying the code (fixing comments, removing now dead functions, and macros etc). Finally there are 4 bug fixes, with the regression fix having had a couple months of testing. Features: - optimize retrieving current task secid - add base io_uring mediation - add base userns mediation - improve buffer allocation - allow restricting unprivilege change_profile Cleanups: - Fix kernel doc comments - remove unused declarations - remove unused functions - remove unneeded #ifdef - remove unused macros - mark fns static - cleanup fn with unused return values - cleanup audit data - pass cred through to audit data - refcount the pdb instead of using duplicates - make SK_CTX macro an inline fn - some comment cleanups Bug fixes: - fix regression in mount mediation - fix invalid refenece - use passed in gfp flags - advertise avaiability of extended perms and disconnected.path" * tag 'apparmor-pr-2023-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor: (39 commits) apparmor: Fix some kernel-doc comments apparmor: Fix one kernel-doc comment apparmor: Fix some kernel-doc comments apparmor: mark new functions static apparmor: Fix regression in mount mediation apparmor: cache buffers on percpu list if there is lock contention apparmor: add io_uring mediation apparmor: add user namespace creation mediation apparmor: allow restricting unprivileged change_profile apparmor: advertise disconnected.path is available apparmor: refcount the pdb apparmor: provide separate audit messages for file and policy checks apparmor: pass cred through to audit info. apparmor: rename audit_data->label to audit_data->subj_label apparmor: combine common_audit_data and apparmor_audit_data apparmor: rename SK_CTX() to aa_sock and make it an inline fn apparmor: Optimize retrieving current task secid apparmor: remove unused functions in policy_ns.c/.h apparmor: remove unneeded #ifdef in decompress_zstd() apparmor: fix invalid reference on profile->disconnected ... commit 136cc1e1f5be75f57f1e0404b94ee1c8792cb07d Merge: 7ab89417ed235 f12f8f84509a0 Author: Linus Torvalds Date: Fri Nov 3 09:28:53 2023 -1000 Merge tag 'landlock-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux Pull landlock updates from Mickaël Salaün: "A Landlock ruleset can now handle two new access rights: LANDLOCK_ACCESS_NET_BIND_TCP and LANDLOCK_ACCESS_NET_CONNECT_TCP. When handled, the related actions are denied unless explicitly allowed by a Landlock network rule for a specific port. The related patch series has been reviewed for almost two years, it has evolved a lot and we now have reached a decent design, code and testing. The refactored kernel code and the new test helpers also bring the foundation to support more network protocols. Test coverage for security/landlock is 92.4% of 710 lines according to gcc/gcov-13, and it was 93.1% of 597 lines before this series. The decrease in coverage is due to code refactoring to make the ruleset management more generic (i.e. dealing with inodes and ports) that also added new WARN_ON_ONCE() checks not possible to test from user space. syzkaller has been updated accordingly [4], and such patched instance (tailored to Landlock) has been running for a month, covering all the new network-related code [5]" Link: https://lore.kernel.org/r/20231026014751.414649-1-konstantin.meskhidze@huawei.com [1] Link: https://lore.kernel.org/r/CAHC9VhS1wwgH6NNd+cJz4MYogPiRV8NyPDd1yj5SpaxeUB4UVg@mail.gmail.com [2] Link: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next-history.git/commit/?id=c8dc5ee69d3a [3] Link: https://github.com/google/syzkaller/pull/4266 [4] Link: https://storage.googleapis.com/syzbot-assets/82e8608dec36/ci-upstream-linux-next-kasan-gce-root-ab577164.html#security%2flandlock%2fnet.c [5] * tag 'landlock-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux: selftests/landlock: Add tests for FS topology changes with network rules landlock: Document network support samples/landlock: Support TCP restrictions selftests/landlock: Add network tests selftests/landlock: Share enforce_ruleset() helper landlock: Support network rules with TCP bind and connect landlock: Refactor landlock_add_rule() syscall landlock: Refactor layer helpers landlock: Move and rename layer helpers landlock: Refactor merge/inherit_ruleset helpers landlock: Refactor landlock_find_rule/insert_rule helpers landlock: Allow FS topology changes for domains without such rule type landlock: Make ruleset's access masks more generic commit f8f9ab2d98116e79d220f1d089df7464ad4e026d Author: Jens Axboe Date: Fri Nov 3 10:35:40 2023 -0600 io_uring/net: ensure socket is marked connected on connect retry io_uring does non-blocking connection attempts, which can yield some unexpected results if a connect request is re-attempted by an an application. This is equivalent to the following sync syscall sequence: sock = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, IPPROTO_TCP); connect(sock, &addr, sizeof(addr); ret == -1 and errno == EINPROGRESS expected here. Now poll for POLLOUT on sock, and when that returns, we expect the socket to be connected. But if we follow that procedure with: connect(sock, &addr, sizeof(addr)); you'd expect ret == -1 and errno == EISCONN here, but you actually get ret == 0. If we attempt the connection one more time, then we get EISCON as expected. io_uring used to do this, but turns out that bluetooth fails with EBADFD if you attempt to re-connect. Also looks like EISCONN _could_ occur with this sequence. Retain the ->in_progress logic, but work-around a potential EISCONN or EBADFD error and only in those cases look at the sock_error(). This should work in general and avoid the odd sequence of a repeated connect request returning success when the socket is already connected. This is all a side effect of the socket state being in a CONNECTING state when we get EINPROGRESS, and only a re-connect or other related operation will turn that into CONNECTED. Cc: stable@vger.kernel.org Fixes: 3fb1bd688172 ("io_uring/net: handle -EINPROGRESS correct for IORING_OP_CONNECT") Link: https://github.com/axboe/liburing/issues/980 Signed-off-by: Jens Axboe commit 8911eae9c8a947e5c1cc4fcce40473f1f5e475cd Author: Frank Li Date: Tue Oct 17 15:46:56 2023 -0400 i3c: master: svc: fix compatibility string mismatch with binding doc In the binding documentation, the compatible string is specified as 'silvaco,i3c-master-v1', but in the driver, it is defined as 'silvaco,i3c-master'. Rename 'silvaco,i3c-master' to 'silvaco,i3c-master-v1' to ensure compatibility with the documentation. Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20231017194657.3199749-1-Frank.Li@nxp.com Signed-off-by: Alexandre Belloni commit 9aaeef113c55248ecf3ab941c2e4460aaa8b8b9a Author: Frank Li Date: Mon Oct 23 12:16:58 2023 -0400 i3c: master: svc: fix random hot join failure since timeout error master side report: silvaco-i3c-master 44330000.i3c-master: Error condition: MSTATUS 0x020090c7, MERRWARN 0x00100000 BIT 20: TIMEOUT error The module has stalled too long in a frame. This happens when: - The TX FIFO or RX FIFO is not handled and the bus is stuck in the middle of a message, - No STOP was issued and between messages, - IBI manual is used and no decision was made. The maximum stall period is 100 μs. This can be considered as being just a warning as the system IRQ latency can easily be greater than 100us. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: Signed-off-by: Frank Li Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/r/20231023161658.3890811-7-Frank.Li@nxp.com Signed-off-by: Alexandre Belloni commit dfd7cd6aafdb1f5ba93828e97e56b38304b23a05 Author: Frank Li Date: Mon Oct 23 12:16:57 2023 -0400 i3c: master: svc: fix SDA keep low when polling IBIWON timeout happen Upon IBIWON timeout, the SDA line will always be kept low if we don't emit a stop. Calling svc_i3c_master_emit_stop() there will let the bus return to idle state. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: Reviewed-by: Miquel Raynal Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20231023161658.3890811-6-Frank.Li@nxp.com Signed-off-by: Alexandre Belloni commit 225d5ef048c4ed01a475c95d94833bd7dd61072d Author: Frank Li Date: Mon Oct 23 12:16:56 2023 -0400 i3c: master: svc: fix check wrong status register in irq handler svc_i3c_master_irq_handler() wrongly checks register SVC_I3C_MINTMASKED. It should be SVC_I3C_MSTATUS. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: Reviewed-by: Miquel Raynal Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20231023161658.3890811-5-Frank.Li@nxp.com Signed-off-by: Alexandre Belloni commit c85e209b799f12d18a90ae6353b997b1bb1274a5 Author: Frank Li Date: Mon Oct 23 12:16:55 2023 -0400 i3c: master: svc: fix ibi may not return mandatory data byte MSTATUS[RXPEND] is only updated after the data transfer cycle started. This creates an issue when the I3C clock is slow, and the CPU is running fast enough that MSTATUS[RXPEND] may not be updated when the code reaches checking point. As a result, mandatory data can be missed. Add a wait for MSTATUS[COMPLETE] to ensure that all mandatory data is already in FIFO. It also works without mandatory data. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: Reviewed-by: Miquel Raynal Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20231023161658.3890811-4-Frank.Li@nxp.com Signed-off-by: Alexandre Belloni commit 5e5e3c92e748a6d859190e123b9193cf4911fcca Author: Frank Li Date: Mon Oct 23 12:16:54 2023 -0400 i3c: master: svc: fix wrong data return when IBI happen during start frame ┌─────┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┌───── SCL: ┘ └─────┛ └──┛ └──┛ └──┛ └──┛ └──┛ └──┛ └──┛ └──┘ ───┐ ┌─────┐ ┌─────┐ ┌───────────┐ SDA: └───────────────────────┘ └─────┘ └─────┘ └───── xxx╱ ╲╱ ╲╱ ╲╱ ╲╱ ╲ : xxx╲IBI ╱╲ Addr(0x0a) ╱╲ RW ╱╲NACK╱╲ S ╱ If an In-Band Interrupt (IBI) occurs and IBI work thread is not immediately scheduled, when svc_i3c_master_priv_xfers() initiates the I3C transfer and attempts to send address 0x7e, the target interprets it as an IBI handler and returns the target address 0x0a. However, svc_i3c_master_priv_xfers() does not handle this case and proceeds with other transfers, resulting in incorrect data being returned. Add IBIWON check in svc_i3c_master_xfer(). In case this situation occurs, return a failure to the driver. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: Reviewed-by: Miquel Raynal Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20231023161658.3890811-3-Frank.Li@nxp.com Signed-off-by: Alexandre Belloni commit 6bf3fc268183816856c96b8794cd66146bc27b35 Author: Frank Li Date: Mon Oct 23 12:16:53 2023 -0400 i3c: master: svc: fix race condition in ibi work thread The ibi work thread operates asynchronously with other transfers, such as svc_i3c_master_priv_xfers(). Introduce mutex protection to ensure the completion of the entire i3c/i2c transaction. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: Reviewed-by: Miquel Raynal Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20231023161658.3890811-2-Frank.Li@nxp.com Signed-off-by: Alexandre Belloni commit 7ab89417ed235f56d84c7893d38d4905e38d2692 Merge: 31e5f934ff962 fed3a1be6433e Author: Linus Torvalds Date: Fri Nov 3 08:17:38 2023 -1000 Merge tag 'perf-tools-for-v6.7-1-2023-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools Pull perf tools updates from Namhyung Kim: "Build: - Compile BPF programs by default if clang (>= 12.0.1) is available to enable more features like kernel lock contention, off-cpu profiling, kwork, sample filtering and so on. This can be disabled by passing BUILD_BPF_SKEL=0 to make. - Produce better error messages for bison on debug build (make DEBUG=1) by defining YYDEBUG symbol internally. perf record: - Track sideband events (like FORK/MMAP) from all CPUs even if perf record targets a subset of CPUs only (using -C option). Otherwise it may lose some information happened on a CPU out of the target list. - Fix checking raw sched_switch tracepoint argument using system BTF. This affects off-cpu profiling which attaches a BPF program to the raw tracepoint. perf lock contention: - Add --lock-cgroup option to see contention by cgroups. This should be used with BPF only (using -b option). $ sudo perf lock con -ab --lock-cgroup -- sleep 1 contended total wait max wait avg wait cgroup 835 14.06 ms 41.19 us 16.83 us /system.slice/led.service 25 122.38 us 13.77 us 4.89 us / 44 23.73 us 3.87 us 539 ns /user.slice/user-657345.slice/session-c4.scope 1 491 ns 491 ns 491 ns /system.slice/connectd.service - Add -G/--cgroup-filter option to see contention only for given cgroups. This can be useful when you identified a cgroup in the above command and want to investigate more on it. It also works with other output options like -t/--threads and -l/--lock-addr. $ sudo perf lock con -ab -G /user.slice/user-657345.slice/session-c4.scope -- sleep 1 contended total wait max wait avg wait type caller 8 77.11 us 17.98 us 9.64 us spinlock futex_wake+0xc8 2 24.56 us 14.66 us 12.28 us spinlock tick_do_update_jiffies64+0x25 1 4.97 us 4.97 us 4.97 us spinlock futex_q_lock+0x2a - Use per-cpu array for better spinlock tracking. This is to improve performance of the BPF program and to avoid nested contention on a lock in the BPF hash map. - Update callstack check for PowerPC. To find a representative caller of a lock, it needs to look up the call stacks. It ends the lookup when it sees 0 in the call stack buffer. However, PowerPC call stacks can have 0 values in the beginning so skip them when it expects valid call stacks after. perf kwork: - Support 'sched' class (for -k option) so that it can see task scheduling event (using sched_switch tracepoint) as well as irq and workqueue items. - Add perf kwork top subcommand to show more accurate cpu utilization with sched class above. It works both with a recorded data (using perf kwork record command) and BPF (using -b option). Unlike perf top command, it does not support interactive mode (yet). $ sudo perf kwork top -b -k sched Starting trace, Hit to stop and report ^C Total : 160702.425 ms, 8 cpus %Cpu(s): 36.00% id, 0.00% hi, 0.00% si %Cpu0 [|||||||||||||||||| 61.66%] %Cpu1 [|||||||||||||||||| 61.27%] %Cpu2 [||||||||||||||||||| 66.40%] %Cpu3 [|||||||||||||||||| 61.28%] %Cpu4 [|||||||||||||||||| 61.82%] %Cpu5 [||||||||||||||||||||||| 77.41%] %Cpu6 [|||||||||||||||||| 61.73%] %Cpu7 [|||||||||||||||||| 63.25%] PID SPID %CPU RUNTIME COMMMAND ------------------------------------------------------------- 0 0 38.72 8089.463 ms [swapper/1] 0 0 38.71 8084.547 ms [swapper/3] 0 0 38.33 8007.532 ms [swapper/0] 0 0 38.26 7992.985 ms [swapper/6] 0 0 38.17 7971.865 ms [swapper/4] 0 0 36.74 7447.765 ms [swapper/7] 0 0 33.59 6486.942 ms [swapper/2] 0 0 22.58 3771.268 ms [swapper/5] 9545 9351 2.48 447.136 ms sched-messaging 9574 9351 2.09 418.583 ms sched-messaging 9724 9351 2.05 372.407 ms sched-messaging 9531 9351 2.01 368.804 ms sched-messaging 9512 9351 2.00 362.250 ms sched-messaging 9514 9351 1.95 357.767 ms sched-messaging 9538 9351 1.86 384.476 ms sched-messaging 9712 9351 1.84 386.490 ms sched-messaging 9723 9351 1.83 380.021 ms sched-messaging 9722 9351 1.82 382.738 ms sched-messaging 9517 9351 1.81 354.794 ms sched-messaging 9559 9351 1.79 344.305 ms sched-messaging 9725 9351 1.77 365.315 ms sched-messaging - Add hard/soft-irq statistics to perf kwork top. This will show the total CPU utilization with IRQ stats like below: $ sudo perf kwork top -b -k sched,irq,softirq Starting trace, Hit to stop and report ^C Total : 12554.889 ms, 8 cpus %Cpu(s): 96.23% id, 0.10% hi, 0.19% si <---- here %Cpu0 [| 4.60%] %Cpu1 [| 4.59%] %Cpu2 [ 2.73%] %Cpu3 [| 3.81%] perf bench: - Add -G/--cgroups option to perf bench sched pipe. The pipe bench is good to measure context switch overhead. With this option, it puts the reader and writer tasks in separate cgroups to enforce context switch between two different cgroups. Also it needs to set CPU affinity of the tasks in a CPU to accurately measure the impact of cgroup context switches. $ sudo perf stat -e context-switches,cgroup-switches -- \ > taskset -c 0 perf bench sched pipe -l 100000 # Running 'sched/pipe' benchmark: # Executed 100000 pipe operations between two processes Total time: 0.307 [sec] 3.078180 usecs/op 324867 ops/sec Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 100000': 200,026 context-switches 63 cgroup-switches 0.321637922 seconds time elapsed You can see small number of cgroup-switches because both write and read tasks are in the same cgroup. $ sudo mkdir /sys/fs/cgroup/{AAA,BBB} $ sudo perf stat -e context-switches,cgroup-switches -- \ > taskset -c 0 perf bench sched pipe -l 100000 -G AAA,BBB # Running 'sched/pipe' benchmark: # Executed 100000 pipe operations between two processes Total time: 0.351 [sec] 3.512990 usecs/op 284657 ops/sec Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 100000 -G AAA,BBB': 200,020 context-switches 200,019 cgroup-switches 0.365034567 seconds time elapsed Now context-switches and cgroup-switches are almost same. And you can see the pipe operation took little more. - Kill child processes when perf bench sched messaging exited abnormally. Otherwise it'd leave the child doing unnecessary work. perf test: - Fix various shellcheck issues on the tests written in shell script. - Skip tests when condition is not satisfied: - object code reading test for non-text section addresses. - CoreSight test if cs_etm// event is not available. - lock contention test if not enough CPUs. Event parsing: - Make PMU alias name loading lazy to reduce the startup time in the event parsing code for perf record, stat and others in the general case. - Lazily compute PMU default config. In the same sense, delay PMU initialization until it's really needed to reduce the startup cost. - Fix event term values that are raw events. The event specification can have several terms including event name. But sometimes it clashes with raw event encoding which starts with 'r' and has hex-digits. For example, an event named 'read' should be processed as a normal event but it was mis-treated as a raw encoding and caused a failure. $ perf stat -e 'uncore_imc_free_running/event=read/' -a sleep 1 event syntax error: '..nning/event=read/' \___ 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 Event metrics: - Add "Compat" regex to match event with multiple identifiers. - Usual updates for Intel, Power10, Arm telemetry/CMN and AmpereOne. Misc: - Assorted memory leak fixes and footprint reduction. - Add "bpf_skeletons" to perf version --build-options so that users can check whether their perf tools have BPF support easily. - Fix unaligned access in Intel-PT packet decoder found by undefined-behavior sanitizer. - Avoid frequency mode for the dummy event. Surprisingly it'd impact kernel timer tick handler performance by force iterating all PMU events. - Update bash shell completion for events and metrics" * tag 'perf-tools-for-v6.7-1-2023-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: (187 commits) perf vendor events intel: Update tsx_cycles_per_elision metrics perf vendor events intel: Update bonnell version number to v5 perf vendor events intel: Update westmereex events to v4 perf vendor events intel: Update meteorlake events to v1.06 perf vendor events intel: Update knightslanding events to v16 perf vendor events intel: Add typo fix for ivybridge FP perf vendor events intel: Update a spelling in haswell/haswellx perf vendor events intel: Update emeraldrapids to v1.01 perf vendor events intel: Update alderlake/alderlake events to v1.23 perf build: Disable BPF skeletons if clang version is < 12.0.1 perf callchain: Fix spelling mistake "statisitcs" -> "statistics" perf report: Fix spelling mistake "heirachy" -> "hierarchy" perf python: Fix binding linkage due to rename and move of evsel__increase_rlimit() perf tests: test_arm_coresight: Simplify source iteration perf vendor events intel: Add tigerlake two metrics perf vendor events intel: Add broadwellde two metrics perf vendor events intel: Fix broadwellde tma_info_system_dram_bw_use metric perf mem_info: Add and use map_symbol__exit and addr_map_symbol__exit perf callchain: Minor layout changes to callchain_list perf callchain: Make brtype_stat in callchain_list optional ... commit 31e5f934ff962820995c82a6953176a1c7d18ff5 Merge: fd912e49986aa 70a9affa930c7 Author: Linus Torvalds Date: Fri Nov 3 07:41:18 2023 -1000 Merge tag 'trace-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing updates from Steven Rostedt: - Remove eventfs_file descriptor This is the biggest change, and the second part of making eventfs create its files dynamically. In 6.6 the first part was added, and that maintained a one to one mapping between eventfs meta descriptors and the directories and file inodes and dentries that were dynamically created. The directories were represented by a eventfs_inode and the files were represented by a eventfs_file. In v6.7 the eventfs_file is removed. As all events have the same directory make up (sched_switch has an "enable", "id", "format", etc files), the handing of what files are underneath each leaf eventfs directory is moved back to the tracing subsystem via a callback. When an event is added to the eventfs, it registers an array of evenfs_entry's. These hold the names of the files and the callbacks to call when the file is referenced. The callback gets the name so that the same callback may be used by multiple files. The callback then supplies the filesystem_operations structure needed to create this file. This has brought the memory footprint of creating multiple eventfs instances down by 2 megs each! - User events now has persistent events that are not associated to a single processes. These are privileged events that hang around even if no process is attached to them - Clean up of seq_buf There's talk about using seq_buf more to replace strscpy() and friends. But this also requires some minor modifications of seq_buf to be able to do this - Expand instance ring buffers individually Currently if boot up creates an instance, and a trace event is enabled on that instance, the ring buffer for that instance and the top level ring buffer are expanded (1.4 MB per CPU). This wastes memory as this happens when nothing is using the top level instance - Other minor clean ups and fixes * tag 'trace-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: (34 commits) seq_buf: Export seq_buf_puts() seq_buf: Export seq_buf_putc() eventfs: Use simple_recursive_removal() to clean up dentries eventfs: Remove special processing of dput() of events directory eventfs: Delete eventfs_inode when the last dentry is freed eventfs: Hold eventfs_mutex when calling callback functions eventfs: Save ownership and mode eventfs: Test for ei->is_freed when accessing ei->dentry eventfs: Have a free_ei() that just frees the eventfs_inode eventfs: Remove "is_freed" union with rcu head eventfs: Fix kerneldoc of eventfs_remove_rec() tracing: Have the user copy of synthetic event address use correct context eventfs: Remove extra dget() in eventfs_create_events_dir() tracing: Have trace_event_file have ref counters seq_buf: Introduce DECLARE_SEQ_BUF and seq_buf_str() eventfs: Fix typo in eventfs_inode union comment eventfs: Fix WARN_ON() in create_file_dentry() powerpc: Remove initialisation of readpos tracing/histograms: Simplify last_cmd_set() seq_buf: fix a misleading comment ... commit fd912e49986aa7ec5bef1bc9cd92d7d68a57e383 Merge: 2a80532c0745e 696444a544ecd Author: Linus Torvalds Date: Fri Nov 3 07:29:54 2023 -1000 Merge tag 'trace-tools-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull tracing tools updates from Steven Rostedt: "RTLA: - In rtla/utils.c, initialize the 'found' variable to avoid garbage when a mount point is not found. Verification: - Remove duplicated imports on dot2k python script" * tag 'trace-tools-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: rtla: Fix uninitialized variable found verification/dot2k: Delete duplicate imports commit 2a80532c0745e140852e6b579bbe8371332bb45d Merge: 00657bb3dbece 2966bd3698451 Author: Linus Torvalds Date: Fri Nov 3 07:24:22 2023 -1000 Merge tag 'printk-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk updates from Petr Mladek: - Another preparation step for introducing printk kthreads. The main piece is a per-console lock with several features: - Support three priorities: normal, emergency, and panic. They will be defined by a context where the lock is taken. A context with a higher priority is allowed to take over the lock from a context with a lower one. The plan is to use the emergency context for Oops and WARN() messages, and also by watchdogs. The panic() context will be used on panic CPU. - The owner might enter/exit regions where it is not safe to take over the lock. It allows the take over the lock a safe way in the middle of a message. For example, serial drivers emit characters one by one. And the serial port is in a safe state in between. Only the final console_flush_in_panic() will be allowed to take over the lock even in the unsafe state (last chance, pray, and hope). - A higher priority context might busy wait with a timeout. The current owner is informed about the waiter and releases the lock on exit from the unsafe state. - The new lock is safe even in atomic contexts, including NMI. Another change is a safe manipulation of per-console sequence number counter under the new lock. - simple_strntoull() micro-optimization - Reduce pr_flush() pooling time. - Calm down false warning about possible buffer invalid access to console buffers when CONFIG_PRINTK is disabled. [ .. and Thomas Gleixner wants to point out that while several of the commits are attributed to him, he only authored the early versions of said commits, and that John Ogness and Petr Mladek have been the ones who sorted out the details and really should be those who get the credit - Linus ] * tag 'printk-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: vsprintf: uninline simple_strntoull(), reorder arguments printk: printk: Remove unnecessary statements'len = 0;' printk: Reduce pr_flush() pooling time printk: fix illegal pbufs access for !CONFIG_PRINTK printk: nbcon: Allow drivers to mark unsafe regions and check state printk: nbcon: Add emit function and callback function for atomic printing printk: nbcon: Add sequence handling printk: nbcon: Add ownership state functions printk: nbcon: Add buffer management printk: Make static printk buffers available to nbcon printk: nbcon: Add acquire/release logic printk: Add non-BKL (nbcon) console basic infrastructure commit 00657bb3dbecee324336e1da1ad71b670b6aee60 Merge: 9a719c2145c99 67e18e132f0fd Author: Linus Torvalds Date: Fri Nov 3 07:21:54 2023 -1000 Merge tag 'livepatching-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching Pull livepatching update from Petr Mladek: - Add missing newline character to avoid waiting for a continuous message * tag 'livepatching-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching: livepatch: Fix missing newline character in klp_resolve_symbols() commit 9a719c2145c9942d1215c05a954dd4bf6c9587e7 Merge: 8f6f76a6a29f3 bdcb37a5d8de3 Author: Linus Torvalds Date: Fri Nov 3 07:08:36 2023 -1000 Merge tag 'bitmap-for-6.7' of https://github.com/norov/linux Pull bitmap updates from Yury Norov: "This includes the 'bitmap: cleanup bitmap_*_region() implementation' series, and scattered cleanup patches" * tag 'bitmap-for-6.7' of https://github.com/norov/linux: buildid: reduce header file dependencies for module bitmap: move bitmap_*_region() functions to bitmap.h bitmap: drop _reg_op() function bitmap: replace _reg_op(REG_OP_ISFREE) with find_next_bit() bitmap: replace _reg_op(REG_OP_RELEASE) with bitmap_clear() bitmap: replace _reg_op(REG_OP_ALLOC) with bitmap_set() bitmap: fix opencoded bitmap_allocate_region() bitmap: add test for bitmap_*_region() functions bitmap: align __reg_op() wrappers with modern coding style lib/bitmap: split-out string-related operations to a separate files bitmap: Remove dead code, i.e. bitmap_copy_le() bitmap: Fix a typo ("identify map") cpumask: kernel-doc cleanups and additions commit 6d5e0032a92df3a030cd47d91905310591466687 Author: Ilya Bakoulin Date: Thu Oct 12 16:42:11 2023 -0400 drm/amd/display: Enable fast update on blendTF change [Why] Full update is not required on surface blend TF change. [How] Update full_update_required condition. Reviewed-by: Aric Cyr Acked-by: Hersen Wu Signed-off-by: Ilya Bakoulin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5d853ad5a866dd52ff519afd073f4156cca3cf7f Author: Ilya Bakoulin Date: Thu Oct 12 12:21:34 2023 -0400 drm/amd/display: Fix blend LUT programming [Why] LUT write index does not get reset to zero when writing the LUT values for each separate RGB component, which results in wrong data for 2 of the 3 components. [How] Reset LUT write index to zero before writing each component's data. Reviewed-by: Krunoslav Kovac Acked-by: Hersen Wu Signed-off-by: Ilya Bakoulin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 995dedb7a4fa9703d1ae584914b0aa12b5da454c Author: Sung Joon Kim Date: Wed Oct 11 15:48:51 2023 -0400 drm/amd/display: Program plane color setting correctly [why] There are some registers for plane color that are skipped programming on resume. Need to add those as part of the sequence. [how] Add new function hook for programming plane color control. Reviewed-by: Duncan Ma Acked-by: Hersen Wu Signed-off-by: Sung Joon Kim Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 23618280cca543183d29ae4f286e3319066774d2 Author: Hawking Zhang Date: Thu Oct 19 14:47:53 2023 +0800 drm/amdgpu: Query and report boot status Query boot status and report boot errors. A follow up change is needed to stop GPU initialization if boot fails. v2: only invoke the call for dGPU (Le/Lijo) Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Reviewed-by: Yang Wang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit df57e019d5c341305e82e6f041f3b373ad7c6529 Author: Hawking Zhang Date: Fri Nov 3 13:28:04 2023 +0800 drm/amdgpu: Add psp v13 function to query boot status Add psp v13 function to query boot status. v2: limit the use case to dGPU only (Lijo) Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Reviewed-by: Yang Wang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 908cebc9a48062167620d0113f3f0285daec2455 Author: Li Ma Date: Mon Oct 30 18:30:48 2023 +0800 drm/amd/swsmu: remove fw version check in sw_init. dorp fw version check and using max table size to init table. Signed-off-by: Li Ma Reviewed-by: Yifan Zhang Reviewed-by: Yang Wang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 34ec3cedcaf94c0a75e0df1314d82d66c783612e Author: Li Ma Date: Mon Oct 30 18:27:27 2023 +0800 drm/amd/swsmu: update smu v14_0_0 driver if and metrics table Update driver if headers and metrics table in smu v14_0_0 after smu fw promotion. Drop the legacy metrics table and add warning of checking pmfw version. Signed-off-by: Li Ma Reviewed-by: Yifan Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 38a64e3a33bb542a9929cb4d2109789bce0c6e46 Author: Hawking Zhang Date: Fri Oct 27 11:53:46 2023 +0800 drm/amdgpu: Add C2PMSG_109/126 reg field shift/masks Add MP0_C2PMSG_109/126 register field shift/masks that are used to identify boot status by driver. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Reviewed-by: Yang Wang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit dbab63561b3cf6acfa3f089319dcc0e78ad31586 Author: Ma Jun Date: Tue Oct 31 19:10:47 2023 +0800 drm/amdgpu: Optimize the asic type fix code Use a new struct array to define the asic information which asic type needs to be fixed. Signed-off-by: Ma Jun Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 36e7ff5c13cb15cb7b06c76d42bb76cbf6b7ea75 Author: Tim Huang Date: Wed Nov 1 14:22:04 2023 +0800 drm/amdgpu: fix GRBM read timeout when do mes_self_test Use a proper MEID to make sure the CP_HQD_* and CP_GFX_HQD_* registers can be touched when initialize the compute and gfx mqd in mes_self_test. Otherwise, we expect no response from CP and an GRBM eventual timeout. Signed-off-by: Tim Huang Acked-by: Alex Deucher Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 18eae367cb74d05b5e37ce77ef4025b735df012e Author: Tao Zhou Date: Mon Oct 30 20:44:37 2023 +0800 drm/amdgpu: check recovery status of xgmi hive in ras_reset_error_count Handle xgmi hive case. Suggested-by: Hawking Zhang Signed-off-by: Tao Zhou Reviewed-by: Stanley.Yang Signed-off-by: Alex Deucher commit 88e5c8f8745b389b8e088a743a70840ead1dad37 Author: Ma Jun Date: Thu Oct 26 09:58:15 2023 +0800 drm/amd/pm: only check sriov vf flag once when creating hwmon sysfs The current code checks sriov vf flag multiple times when creating hwmon sysfs. So fix it. Signed-off-by: Ma Jun Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 0e2e7c5b3d712f4589b3bf0eb2988337966648b6 Author: Felix Kuehling Date: Wed Mar 16 18:03:59 2022 -0400 drm/amdgpu: Attach eviction fence on alloc Instead of attaching the eviction fence when a KFD BO is first mapped, attach it when it is allocated or imported. This in preparation to allow KFD BOs to be mapped using the render node API. Signed-off-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Alex Deucher commit 5a104cb97c4e2bc8918b026a770188313b1d5fb3 Author: Felix Kuehling Date: Wed Mar 16 17:21:40 2022 -0400 drm/amdkfd: Improve amdgpu_vm_handle_moved Let amdgpu_vm_handle_moved update all BO VA mappings of BOs reserved by the caller. This will be useful for handling extra BO VA mappings in KFD VMs that are managed through the render node API. v2: rebase against drm_exec changes (Alex) Signed-off-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 6740ec97bcdbe96ac7df147f986c030eddfebe65 Author: Nathan Chancellor Date: Thu Nov 2 10:40:52 2023 -0700 drm/amd/display: Increase frame warning limit with KASAN or KCSAN in dml2 When building ARCH=x86_64 allmodconfig with clang, which will typically have sanitizers enabled, there is a warning about a large stack frame. drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/display_mode_core.c:6265:13: error: stack frame size (2520) exceeds limit (2048) in 'dml_prefetch_check' [-Werror,-Wframe-larger-than] 6265 | static void dml_prefetch_check(struct display_mode_lib_st *mode_lib) | ^ 1 error generated. Notably, GCC 13.2.0 does not do too much of a better job, as it is right at the current limit of 2048 (and others have reported being over with older GCC versions): drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/display_mode_core.c: In function 'dml_prefetch_check': drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/display_mode_core.c:6705:1: error: the frame size of 2048 bytes is larger than 1800 bytes [-Werror=frame-larger-than=] 6705 | } | ^ In the past, these warnings have been avoided by reducing the number of parameters to various functions so that not as many arguments need to be passed on the stack. However, these patches take a good amount of effort to write despite being mechanical due to code structure and complexity and they are never carried forward to new generations of the code so that effort has to be expended every new hardware generation, which becomes harder to justify as time goes on. To avoid having a noticeable or lengthy breakage in all{mod,yes}config, which are easy testing targets that have -Werror enabled, increase the limit for configurations that have KASAN or KCSAN enabled by 50% so that cases of extremely poor code generation can still be caught while not breaking the majority of builds. CONFIG_KMSAN also causes high stack usage but the frame limit is already set to zero when it is enabled, which is accounted for by the check for CONFIG_FRAME_WARN=0 in the dml2 Makefile. Signed-off-by: Nathan Chancellor Signed-off-by: Alex Deucher commit b1904ed480cee3f9f4036ea0e36d139cb5fee2d6 Author: Wayne Lin Date: Fri Sep 8 10:14:49 2023 +0800 drm/amd/display: Avoid NULL dereference of timing generator [Why & How] Check whether assigned timing generator is NULL or not before accessing its funcs to prevent NULL dereference. Reviewed-by: Jun Lei Acked-by: Hersen Wu Signed-off-by: Wayne Lin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit be457b2252b6b49d74c4217224263c8d1e2a894d Author: Mukul Joshi Date: Fri Oct 27 11:33:32 2023 -0400 drm/amdkfd: Update cache info for GFX 9.4.3 Update cache info reporting based on compute and memory partitioning modes. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 0ce8edae8be74eb883b8721ac6acd2f501b34a9f Author: Mukul Joshi Date: Fri Oct 27 11:30:25 2023 -0400 drm/amdkfd: Populate cache info for GFX 9.4.3 GFX 9.4.3 uses a new version of the GC info table which contains the cache info. This patch adds a new function to populate the cache info from IP discovery for GFX 9.4.3. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit ba0fb4b48c19a2d2380fc16ca4af236a0871d279 Author: Alex Deucher Date: Thu Oct 26 14:37:31 2023 -0400 drm/amdgpu: don't put MQDs in VRAM on ARM | ARM64 Issues were reported with commit 1cfb4d612127 ("drm/amdgpu: put MQDs in VRAM") on an ADLINK Ampere Altra Developer Platform (AVA developer platform). Various ARM systems seem to have problems related to PCIe and MMIO access. In this case, I'm not sure if this is specific to the ADLINK platform or ARM in general. Seems to be some coherency issue with VRAM. For now, just don't put MQDs in VRAM on ARM. Link: https://lists.freedesktop.org/archives/amd-gfx/2023-October/100453.html Fixes: 1cfb4d612127 ("drm/amdgpu: put MQDs in VRAM") Acked-by: Christian König Signed-off-by: Alex Deucher Cc: alexey.klimov@linaro.org commit 23170863ea0a0965d224342c0eb2ad8303b1f267 Author: Alex Deucher Date: Wed Nov 1 15:48:14 2023 -0400 drm/amdgpu/smu13: drop compute workload workaround This was fixed in PMFW before launch and is no longer required. Reviewed-by: Yang Wang Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.1.x commit 3938eb956e383ef88b8fc7d556492336ebee52df Author: Alex Deucher Date: Thu Oct 19 13:56:56 2023 -0400 drm/amdgpu: add a retry for IP discovery init AMD dGPUs have integrated FW that runs as soon as the device gets power and initializes the board (determines the amount of memory, provides configuration details to the driver, etc.). For direct PCIe attached cards this happens as soon as power is applied and normally completes well before the OS has even started loading. However, with hotpluggable ports like USB4, the driver needs to wait for this to complete before initializing the device. This normally takes 60-100ms, but could take longer on some older boards periodically due to memory training. Retry for up to a second. In the non-hotplug case, there should be no change in behavior and this should complete on the first try. v2: adjust test criteria v3: adjust checks for the masks, only enable on removable devices v4: skip bif_fb_en check Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2925 Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 886b92f63573eab4ba30b06c4514b8f4af114e6a Author: Perry Yuan Date: Thu Jul 27 01:45:30 2023 -0400 drm/amdgpu: ungate power gating when system suspend [Why] During suspend, if GFX DPM is enabled and GFXOFF feature is enabled the system may get hung. So, it is suggested to disable GFXOFF feature during suspend and enable it after resume. [How] Update the code to disable GFXOFF feature during suspend and enable it after resume. [ 311.396526] amdgpu 0000:03:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x0000001E SMN_C2PMSG_82:0x00000000 [ 311.396530] amdgpu 0000:03:00.0: amdgpu: Fail to disable dpm features! [ 311.396531] [drm:amdgpu_device_ip_suspend_phase2 [amdgpu]] *ERROR* suspend of IP block failed -62 Acked-by: Yang Wang Reviewed-by: Kenneth Feng Signed-off-by: Perry Yuan Signed-off-by: Kun Liu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 3a50f41bc20a26dfa8cd18ef3ae924feec25c95e Author: José Pekkarinen Date: Tue Oct 31 19:08:47 2023 +0200 drm/radeon: replace 1-element arrays with flexible-array members Reported by coccinelle, the following patch will move the following 1 element arrays to flexible arrays. drivers/gpu/drm/radeon/atombios.h:5523:32-48: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:5545:32-48: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:5461:34-44: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:4447:30-40: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:4236:30-41: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:7095:28-45: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:3896:27-37: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:5443:16-25: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:5454:34-43: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:4603:21-32: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:4628:32-46: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:6285:29-39: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:4296:30-36: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:4756:28-36: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:4064:22-35: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:7327:9-24: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:7332:32-53: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:7362:26-41: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:7369:29-44: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:7349:24-32: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) drivers/gpu/drm/radeon/atombios.h:7355:27-35: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: José Pekkarinen Signed-off-by: Alex Deucher commit 49afe91370b86566857a3c2c39612cf098110885 Author: Alex Deucher Date: Fri Oct 27 16:40:47 2023 -0400 drm/amd: Fix UBSAN array-index-out-of-bounds for Powerplay headers For pptable structs that use flexible array sizes, use flexible arrays. Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2039926 Reviewed-by: Mario Limonciello Acked-by: Christian König Signed-off-by: Alex Deucher commit 7b1c6263eaf4fd64ffe1cafdc504a42ee4bfbb33 Author: Alex Deucher Date: Tue Oct 17 16:30:00 2023 -0400 drm/amdgpu: don't use pci_is_thunderbolt_attached() It's only valid on Intel systems with the Intel VSEC. Use dev_is_removable() instead. This should do the right thing regardless of the platform. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2925 Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 432e664e7c98c243fab4c3c95bd463bea3aeed28 Author: Alex Deucher Date: Tue Oct 17 15:40:01 2023 -0400 drm/amdgpu: don't use ATRM for external devices The ATRM ACPI method is for fetching the dGPU vbios rom image on laptops and all-in-one systems. It should not be used for external add in cards. If the dGPU is thunderbolt connected, don't try ATRM. v2: pci_is_thunderbolt_attached only works for Intel. Use pdev->external_facing instead. v3: dev_is_removable() seems to be what we want Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2925 Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit cd63ffbd23edc176f09cac5c9287db732d7cbb73 Author: Filipe Manana Date: Mon Oct 30 11:54:23 2023 +0000 btrfs: fix error pointer dereference after failure to allocate fs devices At device_list_add() we allocate a btrfs_fs_devices structure and then before checking if the allocation failed (pointer is ERR_PTR(-ENOMEM)), we dereference the error pointer in a memcpy() argument if the feature BTRFS_FEATURE_INCOMPAT_METADATA_UUID is enabled. Fix this by checking for an allocation error before trying the memcpy(). Fixes: f7361d8c3fc3 ("btrfs: sipmlify uuid parameters of alloc_fs_devices()") Reviewed-by: Qu Wenruo Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 47e2b06b7b5cb356a987ba3429550c3a89ea89d6 Author: Qu Wenruo Date: Sat Oct 28 13:28:45 2023 +1030 btrfs: make found_logical_ret parameter mandatory for function queue_scrub_stripe() [BUG] There is a compilation warning reported on commit ae76d8e3e135 ("btrfs: scrub: fix grouping of read IO"), where gcc (14.0.0 20231022 experimental) is reporting the following uninitialized variable: fs/btrfs/scrub.c: In function ‘scrub_simple_mirror.isra’: fs/btrfs/scrub.c:2075:29: error: ‘found_logical’ may be used uninitialized [-Werror=maybe-uninitialized[https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wmaybe-uninitialized]] 2075 | cur_logical = found_logical + BTRFS_STRIPE_LEN; fs/btrfs/scrub.c:2040:21: note: ‘found_logical’ was declared here 2040 | u64 found_logical; | ^~~~~~~~~~~~~ [CAUSE] This is a false alert, as @found_logical is passed as parameter @found_logical_ret of function queue_scrub_stripe(). As long as queue_scrub_stripe() returned 0, we would update @found_logical_ret. And if queue_scrub_stripe() returned >0 or <0, the caller would not utilized @found_logical, thus there should be nothing wrong. Although the triggering gcc is still experimental, it looks like the extra check on "if (found_logical_ret)" can sometimes confuse the compiler. Meanwhile the only caller of queue_scrub_stripe() is always passing a valid pointer, there is no need for such check at all. [FIX] Although the report itself is a false alert, we can still make it more explicit by: - Replace the check for @found_logical_ret with ASSERT() - Initialize @found_logical to U64_MAX - Add one extra ASSERT() to make sure @found_logical got updated Link: https://lore.kernel.org/linux-btrfs/87fs1x1p93.fsf@gentoo.org/ Fixes: ae76d8e3e135 ("btrfs: scrub: fix grouping of read IO") Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit d8ba2a91fc3cd0347823435971f58f473cbba7aa Author: Josef Bacik Date: Fri Oct 13 15:18:17 2023 -0400 btrfs: get correct owning_root when dropping snapshot Dave reported a bug where we were aborting the transaction while trying to cleanup the squota reservation for an extent. This turned out to be because we're doing btrfs_header_owner(next) in do_walk_down when we decide to free the block. However in this code block we haven't explicitly read next, so it could be stale. We would then get whatever garbage happened to be in the pages at this point. The commit that introduced that is "btrfs: track owning root in btrfs_ref". Fix this by saving the owner_root when we do the btrfs_lookup_extent_info(). We always do this in do_walk_down, it is how we make the decision of whether or not to delete the block. This is cheap because we've already done the extent item lookup at this point, so it's straightforward to just grab the owner root as well. Then we can use this when deleting the metadata block without needing to force a read of the extent buffer to find the owner. This fixes the problem that Dave reported. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 776a838f1fa95670c1c1cf7109a898090b473fa3 Author: Naohiro Aota Date: Tue Oct 17 17:00:31 2023 +0900 btrfs: zoned: wait for data BG to be finished on direct IO allocation Running the fio command below on a ZNS device results in "Resource temporarily unavailable" error. $ sudo fio --name=w --directory=/mnt --filesize=1GB --bs=16MB --numjobs=16 \ --rw=write --ioengine=libaio --iodepth=128 --direct=1 fio: io_u error on file /mnt/w.2.0: Resource temporarily unavailable: write offset=117440512, buflen=16777216 fio: io_u error on file /mnt/w.2.0: Resource temporarily unavailable: write offset=134217728, buflen=16777216 ... This happens because -EAGAIN error returned from btrfs_reserve_extent() called from btrfs_new_extent_direct() is spilling over to the userland. btrfs_reserve_extent() returns -EAGAIN when there is no active zone available. Then, the caller should wait for some other on-going IO to finish a zone and retry the allocation. This logic is already implemented for buffered write in cow_file_range(), but it is missing for the direct IO counterpart. Implement the same logic for it. Reported-by: Shinichiro Kawasaki Fixes: 2ce543f47843 ("btrfs: zoned: wait until zone is finished when allocation didn't progress") CC: stable@vger.kernel.org # 6.1+ Tested-by: Shinichiro Kawasaki Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit dfcb03ae8a341600d72fbf3c79429f306764d653 Author: Naohiro Aota Date: Tue Oct 17 16:23:22 2023 +0900 btrfs: zoned: drop no longer valid write pointer check There is a check of the write pointer vs the zone size to reject an invalid write pointer. However, as of now, we have RAID0/RAID10 on the zoned mode, we can have a block group whose size is larger than the zone size. As an equivalent check against the block group's zone_capacity is already there, we can just drop this invalid check. Fixes: 568220fa9657 ("btrfs: zoned: support RAID0/1/10 on top of raid stripe tree") Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit b8212814d1e8428a082234223105e4071b844fab Author: Dan Carpenter Date: Thu Oct 12 12:42:55 2023 +0300 btrfs: directly return 0 on no error code in btrfs_insert_raid_extent() It's more obvious to return a literal zero instead of "return ret;". Plus Smatch complains that ret could be uninitialized if the ordered_extent->bioc_list list is empty and this silences that warning. Signed-off-by: Dan Carpenter Reviewed-by: David Sterba Signed-off-by: David Sterba commit dec96fc2dcb59723e041416b8dc53e011b4bfc2e Author: Filipe Manana Date: Fri Oct 13 10:05:48 2023 +0100 btrfs: use u64 for buffer sizes in the tree search ioctls In the tree search v2 ioctl we use the type size_t, which is an unsigned long, to track the buffer size in the local variable 'buf_size'. An unsigned long is 32 bits wide on a 32 bits architecture. The buffer size defined in struct btrfs_ioctl_search_args_v2 is a u64, so when we later try to copy the local variable 'buf_size' to the argument struct, when the search returns -EOVERFLOW, we copy only 32 bits which will be a problem on big endian systems. Fix this by using a u64 type for the buffer sizes, not only at btrfs_ioctl_tree_search_v2(), but also everywhere down the call chain so that we can use the u64 at btrfs_ioctl_tree_search_v2(). Fixes: cc68a8a5a433 ("btrfs: new ioctl TREE_SEARCH_V2") Reported-by: Dan Carpenter Link: https://lore.kernel.org/linux-btrfs/ce6f4bd6-9453-4ffe-ba00-cee35495e10f@moroto.mountain/ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit b3c942bb6c32a8ddc1d52ee6bc24b8cf732dddf4 Author: Alex Deucher Date: Thu Oct 26 14:47:57 2023 -0400 drm/amdgpu/gfx10,11: use memcpy_to/fromio for MQDs Since they were moved to VRAM, we need to use the IO variants of memcpy. Fixes: 1cfb4d612127 ("drm/amdgpu: put MQDs in VRAM") Reviewed-by: Christian König Signed-off-by: Alex Deucher commit f7aeee73461560bf70ef48b238dd6a48068debff Author: Tao Zhou Date: Fri Oct 27 11:38:18 2023 +0800 drm/amdgpu: use mode-2 reset for RAS poison consumption Switch from mode-1 reset to mode-2 for poison consumption. Signed-off-by: Tao Zhou Reviewed-by: Stanley.Yang Signed-off-by: Alex Deucher commit b77cc85bdbad83dfea533c5ea881665aa0673d65 Author: Lin.Cao Date: Mon Oct 30 17:55:08 2023 +0800 drm/amdgpu doorbell range should be set when gpu recovery GFX doorbell range should be set after flr otherwise the gfx doorbell range will be overlap with MEC. v2: remove "amdgpu_sriov_vf" and "amdgpu_in_reset" check, and add grbm select for the case of 2 gfx rings. Signed-off-by: Lin.Cao Acked-by: ZhenGuo Yin Signed-off-by: Alex Deucher commit 42ef313754f2c89f2584dfb6c052e745ad3a3ca1 Author: Ma Jun Date: Thu Oct 26 18:16:06 2023 +0800 drm/amd/pm: Return 0 as default min power limit for legacy asics Return 0 as the default min power limit for the asics use powerplay. Signed-off-by: Ma Jun Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 0df96fb71a395b4fc9c80180306420c743f395a8 Author: Jens Axboe Date: Fri Nov 3 09:26:13 2023 -0600 io_uring/rw: don't attempt to allocate async data if opcode doesn't need it The new read multishot method doesn't need to allocate async data ever, as it doesn't do vectored IO and it must only be used with provided buffers. While it doesn't have ->prep_async() set, it also sets ->async_size to 0, which is different from any other read/write type we otherwise support. If it's used on a file type that isn't pollable, we do try and allocate this async data, and then try and use that data. But since we passed in a size of 0 for the data, we get a NULL back on data allocation. We then proceed to dereference that to copy state, and that obviously won't end well. Add a check in io_setup_async_rw() for this condition, and avoid copying state. Also add a check for whether or not buffer selection is specified in prep while at it. Fixes: fc68fcda0491 ("io_uring/rw: add support for IORING_OP_READ_MULTISHOT") Link: https://bugzilla.kernel.org/show_bug.cgi?id=218101 Signed-off-by: Jens Axboe commit d1f6be54eafe177bdea6d42b4ef3b45bb00660b3 Merge: ad1871ad8d9b3 5b5b5806f2239 Author: Rafael J. Wysocki Date: Fri Nov 3 15:31:57 2023 +0100 Merge tag 'cpufreq-arm-updates-6.7-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Merge ARM cpufreq updates for 6.7 (part 2) from Viresh kumar: "- Add support for several Qualcomm SoC versions (Robert Marko and Varadarajan Narayanan)." * tag 'cpufreq-arm-updates-6.7-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: qcom-nvmem: Introduce cpufreq for ipq95xx cpufreq: qcom-nvmem: Enable cpufreq for ipq53xx cpufreq: qcom-nvmem: add support for IPQ8074 soc: qcom: socinfo: Add IDs for IPQ8174 family dt-bindings: arm: qcom,ids: Add IDs for IPQ8174 family dt-bindings: qcom: geni-se: Allow dma-coherent soc: qcom: socinfo: Add SoC ID for QCM6490 dt-bindings: arm: qcom,ids: Add SoC ID for QCM6490 soc: qcom: socinfo: Add SM8550-adjacent PMICs soc: qcom: wcnss_ctrl: Remove redundant initialization owner in wcnss_ctrl_driver soc: qcom: socinfo: Add Soc ID for SM7150P dt-bindings: arm: qcom,ids: Add Soc ID for SM7150P firmware: Add support for Qualcomm UEFI Secure Application firmware: qcom_scm: Add support for Qualcomm Secure Execution Environment SCM interface lib/ucs2_string: Add UCS-2 strscpy function commit a563c99f222f2b8e5d53cfae8eb84a345209530b Merge: ad1871ad8d9b3 6feb1a9641197 Author: Rafael J. Wysocki Date: Fri Nov 3 15:30:10 2023 +0100 Merge tag 'linux-cpupower-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux Merge cpupower utility update for 6.7-rc1 from Shuah Khan: "This cpupower update for Linux 6.7-rc1 consists of a single fix to documentation to fix reference to a removed document." * tag 'linux-cpupower-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux: cpupower: fix reference to nonexistent document commit 1373ca10ec04afba9199de1fab01fde91338a78b Author: Yuezhang Mo Date: Tue Oct 31 17:36:39 2023 +0800 exfat: fix ctime is not updated Commit 4c72a36edd54 ("exfat: convert to new timestamp accessors") removed attr_copy() from exfat_set_attr(). It causes xfstests generic/221 to fail. In xfstests generic/221, it tests ctime should be updated even if futimens() update atime only. But in this case, ctime will not be updated if attr_copy() is removed. attr_copy() may also update other attributes, and removing it may cause other bugs, so this commit restores to call attr_copy() in exfat_set_attr(). Fixes: 4c72a36edd54 ("exfat: convert to new timestamp accessors") Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit fc12a722e6b799d1d3c1520dc9ba9aab4fda04bf Author: Yuezhang Mo Date: Tue Oct 31 17:52:13 2023 +0800 exfat: fix setting uninitialized time to ctime/atime An uninitialized time is set to ctime/atime in __exfat_write_inode(). It causes xfstests generic/003 and generic/192 to fail. And since there will be a time gap between setting ctime/atime to the inode and writing back the inode, so ctime/atime should not be set again when writing back the inode. Fixes: 4c72a36edd54 ("exfat: convert to new timestamp accessors") Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru Reviewed-by: Sungjong Seo Signed-off-by: Namjae Jeon commit 004fc58edea6f00db9ad07b40b882e8d976f7a54 Author: Eugen Hristev Date: Tue Oct 31 12:31:39 2023 +0200 ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: trivial: fix error messages Property 'playback-codecs' is referenced as 'speaker-codec' in the error message, and this can lead to confusion. Correct the error message such that the correct property name is referenced. Fixes: 0da16e370dd7 ("ASoC: mediatek: mt8186: add machine driver with mt6366, rt1019 and rt5682s") Signed-off-by: Eugen Hristev Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231031103139.77395-1-eugen.hristev@collabora.com Signed-off-by: Mark Brown commit 016b9332a3346e97a6cacffea0f9dc10e1235a75 Author: Jakub Kicinski Date: Wed Nov 1 21:57:24 2023 -0700 netlink: fill in missing MODULE_DESCRIPTION() W=1 builds now warn if a module is built without a MODULE_DESCRIPTION(). Fill it in for sock_diag. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 02f0717e9835dbdeee26084e42086fbd32e64eb8 Author: Eric Dumazet Date: Wed Nov 1 04:52:33 2023 +0000 net/tcp: fix possible out-of-bounds reads in tcp_hash_fail() syzbot managed to trigger a fault by sending TCP packets with all flags being set. v2: - While fixing this bug, add PSH flag handling and represent flags the way tcpdump does : [S], [S.], [P.] - Print 4-tuples more consistently between families. BUG: KASAN: stack-out-of-bounds in string_nocheck lib/vsprintf.c:645 [inline] BUG: KASAN: stack-out-of-bounds in string+0x394/0x3d0 lib/vsprintf.c:727 Read of size 1 at addr ffffc9000397f3f5 by task syz-executor299/5039 CPU: 1 PID: 5039 Comm: syz-executor299 Not tainted 6.6.0-rc7-syzkaller-02075-g55c900477f5b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 string_nocheck lib/vsprintf.c:645 [inline] string+0x394/0x3d0 lib/vsprintf.c:727 vsnprintf+0xc5f/0x1870 lib/vsprintf.c:2818 vprintk_store+0x3a0/0xb80 kernel/printk/printk.c:2191 vprintk_emit+0x14c/0x5f0 kernel/printk/printk.c:2288 vprintk+0x7b/0x90 kernel/printk/printk_safe.c:45 _printk+0xc8/0x100 kernel/printk/printk.c:2332 tcp_inbound_hash.constprop.0+0xdb2/0x10d0 include/net/tcp.h:2760 tcp_v6_rcv+0x2b31/0x34d0 net/ipv6/tcp_ipv6.c:1882 ip6_protocol_deliver_rcu+0x33b/0x13d0 net/ipv6/ip6_input.c:438 ip6_input_finish+0x14f/0x2f0 net/ipv6/ip6_input.c:483 NF_HOOK include/linux/netfilter.h:314 [inline] NF_HOOK include/linux/netfilter.h:308 [inline] ip6_input+0xce/0x440 net/ipv6/ip6_input.c:492 dst_input include/net/dst.h:461 [inline] ip6_rcv_finish net/ipv6/ip6_input.c:79 [inline] NF_HOOK include/linux/netfilter.h:314 [inline] NF_HOOK include/linux/netfilter.h:308 [inline] ipv6_rcv+0x563/0x720 net/ipv6/ip6_input.c:310 __netif_receive_skb_one_core+0x115/0x180 net/core/dev.c:5527 __netif_receive_skb+0x1f/0x1b0 net/core/dev.c:5641 netif_receive_skb_internal net/core/dev.c:5727 [inline] netif_receive_skb+0x133/0x700 net/core/dev.c:5786 tun_rx_batched+0x429/0x780 drivers/net/tun.c:1579 tun_get_user+0x29e7/0x3bc0 drivers/net/tun.c:2002 tun_chr_write_iter+0xe8/0x210 drivers/net/tun.c:2048 call_write_iter include/linux/fs.h:1956 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x650/0xe40 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Fixes: 2717b5adea9e ("net/tcp: Add tcp_hash_fail() ratelimited logs") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Dmitry Safonov Cc: Francesco Ruggeri Cc: David Ahern Reviewed-by: Dmitry Safonov Signed-off-by: David S. Miller commit 153a58c6d8976f289b52e6652932c1cb28a2eacd Author: Ronald Wahl Date: Tue Oct 31 13:20:05 2023 +0100 net: ethernet: ti: am65-cpsw: rx_pause/tx_pause controls wrong direction The rx_pause flag says that whether we support receiving Pause frames. When a Pause frame is received TX is delayed for some time. This is TX flow control. In the same manner tx_pause is actually RX flow control. Signed-off-by: Ronald Wahl Signed-off-by: David S. Miller commit 421b605edb1ce611dee06cf6fd9a1c1f2fd85ad0 Author: Dominique Martinet Date: Fri Nov 3 09:42:20 2023 +0900 Revert "mmc: core: Capture correct oemid-bits for eMMC cards" This reverts commit 84ee19bffc9306128cd0f1c650e89767079efeff. The commit above made quirks with an OEMID fail to be applied, as they were checking card->cid.oemid for the full 16 bits defined in MMC_FIXUP macros but the field would only contain the bottom 8 bits. eMMC v5.1A might have bogus values in OEMID's higher bits so another fix will be made, but it has been decided to revert this until that is ready. Fixes: 84ee19bffc93 ("mmc: core: Capture correct oemid-bits for eMMC cards") Link: https://lkml.kernel.org/r/ZToJsSLHr8RnuTHz@codewreck.org Link: https://lkml.kernel.org/r/CAPDyKFqkKibcXnwjnhc3+W1iJBHLeqQ9BpcZrSwhW2u9K2oUtg@mail.gmail.com Signed-off-by: Dominique Martinet Cc: stable@vger.kernel.org Cc: Alex Fetters Reviewed-by: Avri Altman Link: https://lore.kernel.org/r/20231103004220.1666641-1-asmadeus@codewreck.org Signed-off-by: Ulf Hansson commit b44f9da81783fda72632ef9b0d05ea3f3ca447a5 Author: Dan Carpenter Date: Thu Nov 2 10:51:06 2023 +0300 mmc: vub300: fix an error code This error path should return -EINVAL instead of success. Fixes: 88095e7b473a ("mmc: Add new VUB300 USB-to-SD/SDIO/MMC driver") Signed-off-by: Dan Carpenter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/0769d30c-ad80-421b-bf5d-7d6f5d85604e@moroto.mountain Signed-off-by: Ulf Hansson commit ed9009ad300c0f15a3ecfe9613547b1962bde02c Author: Bean Huo Date: Mon Oct 30 23:48:09 2023 +0100 mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for Micron eMMC Q2J54A Micron MTFC4GACAJCN eMMC supports cache but requires that flush cache operation be allowed only after a write has occurred. Otherwise, the cache flush command or subsequent commands will time out. Signed-off-by: Bean Huo Signed-off-by: Rafael Beims Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231030224809.59245-1-beanhuo@iokpp.de Signed-off-by: Ulf Hansson commit 40592064a1a536adcced4ffea435c392eb9e7192 Author: Uwe Kleine-König Date: Thu Oct 12 23:02:29 2023 +0200 pwm: samsung: Document new member .channel in struct samsung_pwm_chip My earlier commit reworking how driver data is tracked added a new member to struct samsung_pwm_chip but failed to add matching documentation. Make up leeway. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310130404.uQ33q5Dk-lkp@intel.com/ Fixes: e3fe982b2e4e ("pwm: samsung: Put per-channel data into driver data") Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 71956d0cb56c1e5f9feeb4819db87a076418e930 Author: Nitin Yadav Date: Thu Oct 26 11:44:58 2023 +0530 mmc: sdhci_am654: fix start loop index for TAP value parsing ti,otap-del-sel-legacy/ti,itap-del-sel-legacy passed from DT are currently ignored for all SD/MMC and eMMC modes. Fix this by making start loop index to MMC_TIMING_LEGACY. Fixes: 8ee5fc0e0b3b ("mmc: sdhci_am654: Update OTAPDLY writes") Signed-off-by: Nitin Yadav Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231026061458.1116276-1-n-yadav@ti.com Signed-off-by: Ulf Hansson commit cdbab6236605dc11780779d9af689aea7d58cab1 Author: Eric Dumazet Date: Tue Oct 31 06:19:45 2023 +0000 tcp: fix fastopen code vs usec TS After blamed commit, TFO client-ack-dropped-then-recovery-ms-timestamps packetdrill test failed. David Morley and Neal Cardwell started investigating and Neal pointed that we had : tcp_conn_request() tcp_try_fastopen() -> tcp_fastopen_create_child -> child = inet_csk(sk)->icsk_af_ops->syn_recv_sock() -> tcp_create_openreq_child() -> copy req_usec_ts from req: newtp->tcp_usec_ts = treq->req_usec_ts; // now the new TFO server socket always does usec TS, no matter // what the route options are... send_synack() -> tcp_make_synack() // disable tcp_rsk(req)->req_usec_ts if route option is not present: if (tcp_rsk(req)->req_usec_ts < 0) tcp_rsk(req)->req_usec_ts = dst_tcp_usec_ts(dst); tcp_conn_request() has the initial dst, we can initialize tcp_rsk(req)->req_usec_ts there instead of later in send_synack(); This means tcp_rsk(req)->req_usec_ts can be a boolean. Many thanks to David an Neal for their help. Fixes: 614e8316aa4c ("tcp: add support for usec resolution in TCP TS values") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202310302216.f79d78bc-oliver.sang@intel.com Suggested-by: Neal Cardwell Signed-off-by: Eric Dumazet Cc: David Morley Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit 63e201916b27260218e528a2f8758be47f99bbf4 Author: Hangbin Liu Date: Tue Oct 31 11:47:32 2023 +0800 selftests: pmtu.sh: fix result checking In the PMTU test, when all previous tests are skipped and the new test passes, the exit code is set to 0. However, the current check mistakenly treats this as an assignment, causing the check to pass every time. Consequently, regardless of how many tests have failed, if the latest test passes, the PMTU test will report a pass. Fixes: 2a9d3716b810 ("selftests: pmtu.sh: improve the test result processing") Signed-off-by: Hangbin Liu Acked-by: Po-Hsu Lin Signed-off-by: David S. Miller commit db456d90a4c1b43b6251fa4348c8adc59b583274 Author: Furong Xu <0x1207@gmail.com> Date: Tue Oct 31 10:27:29 2023 +0800 net: stmmac: xgmac: Enable support for multiple Flexible PPS outputs From XGMAC Core 3.20 and later, each Flexible PPS has individual PPSEN bit to select Fixed mode or Flexible mode. The PPSEN must be set, or it stays in Fixed PPS mode by default. XGMAC Core prior 3.20, only PPSEN0(bit 4) is writable. PPSEN{1,2,3} are read-only reserved, and they are already in Flexible mode by default, our new code always set PPSEN{1,2,3} do not make things worse ;-) Fixes: 95eaf3cd0a90 ("net: stmmac: dwxgmac: Add Flexible PPS support") Reviewed-by: Serge Semin Reviewed-by: Jacob Keller Signed-off-by: Furong Xu <0x1207@gmail.com> Signed-off-by: David S. Miller commit e8ae8ad479e2d037daa33756e5e72850a7bd37a9 Author: NeilBrown Date: Tue Oct 24 09:53:33 2023 +1100 Fix termination state for idr_for_each_entry_ul() The comment for idr_for_each_entry_ul() states after normal termination @entry is left with the value NULL This is not correct in the case where UINT_MAX has an entry in the idr. In that case @entry will be non-NULL after termination. No current code depends on the documentation being correct, but to save future code we should fix it. Also fix idr_for_each_entry_continue_ul(). While this is not documented as leaving @entry as NULL, the mellanox driver appears to depend on it doing so. So make that explicit in the documentation as well as in the code. Fixes: e33d2b74d805 ("idr: fix overflow case for idr_for_each_entry_ul()") Cc: Matthew Wilcox Cc: Chris Mi Cc: Cong Wang Signed-off-by: NeilBrown Signed-off-by: David S. Miller commit a5e3b127455d073f146a2a4ea3e7117635d34c5c Author: Petr Tesarik Date: Thu Nov 2 10:36:49 2023 +0100 swiotlb: do not free decrypted pages if dynamic Fix these two error paths: 1. When set_memory_decrypted() fails, pages may be left fully or partially decrypted. 2. Decrypted pages may be freed if swiotlb_alloc_tlb() determines that the physical address is too high. To fix the first issue, call set_memory_encrypted() on the allocated region after a failed decryption attempt. If that also fails, leak the pages. To fix the second issue, check that the TLB physical address is below the requested limit before decrypting. Let the caller differentiate between unsuitable physical address (=> retry from a lower zone) and allocation failures (=> no point in retrying). Cc: stable@vger.kernel.org Fixes: 79636caad361 ("swiotlb: if swiotlb is full, fall back to a transient memory pool") Signed-off-by: Petr Tesarik Reviewed-by: Rick Edgecombe Signed-off-by: Christoph Hellwig commit 7269cba53d906cf257c139d3b3a53ad272176bca Author: Sumit Garg Date: Thu Nov 2 13:00:55 2023 +0530 tee: optee: Fix supplicant based device enumeration Currently supplicant dependent optee device enumeration only registers devices whenever tee-supplicant is invoked for the first time. But it forgets to remove devices when tee-supplicant daemon stops running and closes its context gracefully. This leads to following error for fTPM driver during reboot/shutdown: [ 73.466791] tpm tpm0: ftpm_tee_tpm_op_send: SUBMIT_COMMAND invoke error: 0xffff3024 Fix this by adding an attribute for supplicant dependent devices so that the user-space service can detect and detach supplicant devices before closing the supplicant: $ for dev in /sys/bus/tee/devices/*; do if [[ -f "$dev/need_supplicant" && -f "$dev/driver/unbind" ]]; \ then echo $(basename "$dev") > $dev/driver/unbind; fi done Reported-by: Jan Kiszka Closes: https://github.com/OP-TEE/optee_os/issues/6094 Fixes: 5f178bb71e3a ("optee: enable support for multi-stage bus enumeration") Signed-off-by: Sumit Garg Reviewed-by: Ilias Apalodimas Acked-by: Jerome Forissier [jw: fixed up Date documentation] Signed-off-by: Jens Wiklander commit 8f6f76a6a29f36d2f3e4510d0bde5046672f6924 Merge: ecae0bd5173b1 6620999f0d41e Author: Linus Torvalds Date: Thu Nov 2 20:53:31 2023 -1000 Merge tag 'mm-nonmm-stable-2023-11-02-14-08' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull non-MM updates from Andrew Morton: "As usual, lots of singleton and doubleton patches all over the tree and there's little I can say which isn't in the individual changelogs. The lengthier patch series are - 'kdump: use generic functions to simplify crashkernel reservation in arch', from Baoquan He. This is mainly cleanups and consolidation of the 'crashkernel=' kernel parameter handling - After much discussion, David Laight's 'minmax: Relax type checks in min() and max()' is here. Hopefully reduces some typecasting and the use of min_t() and max_t() - A group of patches from Oleg Nesterov which clean up and slightly fix our handling of reads from /proc/PID/task/... and which remove task_struct.thread_group" * tag 'mm-nonmm-stable-2023-11-02-14-08' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (64 commits) scripts/gdb/vmalloc: disable on no-MMU scripts/gdb: fix usage of MOD_TEXT not defined when CONFIG_MODULES=n .mailmap: add address mapping for Tomeu Vizoso mailmap: update email address for Claudiu Beznea tools/testing/selftests/mm/run_vmtests.sh: lower the ptrace permissions .mailmap: map Benjamin Poirier's address scripts/gdb: add lx_current support for riscv ocfs2: fix a spelling typo in comment proc: test ProtectionKey in proc-empty-vm test proc: fix proc-empty-vm test with vsyscall fs/proc/base.c: remove unneeded semicolon do_io_accounting: use sig->stats_lock do_io_accounting: use __for_each_thread() ocfs2: replace BUG_ON() at ocfs2_num_free_extents() with ocfs2_error() ocfs2: fix a typo in a comment scripts/show_delta: add __main__ judgement before main code treewide: mark stuff as __ro_after_init fs: ocfs2: check status values proc: test /proc/${pid}/statm compiler.h: move __is_constexpr() to compiler.h ... commit ecae0bd5173b1014f95a14a8dfbe40ec10367dcf Merge: bc3012f4e3a97 9732336006764 Author: Linus Torvalds Date: Thu Nov 2 19:38:47 2023 -1000 Merge tag 'mm-stable-2023-11-01-14-33' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull MM updates from Andrew Morton: "Many singleton patches against the MM code. The patch series which are included in this merge do the following: - Kemeng Shi has contributed some compation maintenance work in the series 'Fixes and cleanups to compaction' - Joel Fernandes has a patchset ('Optimize mremap during mutual alignment within PMD') which fixes an obscure issue with mremap()'s pagetable handling during a subsequent exec(), based upon an implementation which Linus suggested - More DAMON/DAMOS maintenance and feature work from SeongJae Park i the following patch series: mm/damon: misc fixups for documents, comments and its tracepoint mm/damon: add a tracepoint for damos apply target regions mm/damon: provide pseudo-moving sum based access rate mm/damon: implement DAMOS apply intervals mm/damon/core-test: Fix memory leaks in core-test mm/damon/sysfs-schemes: Do DAMOS tried regions update for only one apply interval - In the series 'Do not try to access unaccepted memory' Adrian Hunter provides some fixups for the recently-added 'unaccepted memory' feature. To increase the feature's checking coverage. 'Plug a few gaps where RAM is exposed without checking if it is unaccepted memory' - In the series 'cleanups for lockless slab shrink' Qi Zheng has done some maintenance work which is preparation for the lockless slab shrinking code - Qi Zheng has redone the earlier (and reverted) attempt to make slab shrinking lockless in the series 'use refcount+RCU method to implement lockless slab shrink' - David Hildenbrand contributes some maintenance work for the rmap code in the series 'Anon rmap cleanups' - Kefeng Wang does more folio conversions and some maintenance work in the migration code. Series 'mm: migrate: more folio conversion and unification' - Matthew Wilcox has fixed an issue in the buffer_head code which was causing long stalls under some heavy memory/IO loads. Some cleanups were added on the way. Series 'Add and use bdev_getblk()' - In the series 'Use nth_page() in place of direct struct page manipulation' Zi Yan has fixed a potential issue with the direct manipulation of hugetlb page frames - In the series 'mm: hugetlb: Skip initialization of gigantic tail struct pages if freed by HVO' has improved our handling of gigantic pages in the hugetlb vmmemmep optimizaton code. This provides significant boot time improvements when significant amounts of gigantic pages are in use - Matthew Wilcox has sent the series 'Small hugetlb cleanups' - code rationalization and folio conversions in the hugetlb code - Yin Fengwei has improved mlock()'s handling of large folios in the series 'support large folio for mlock' - In the series 'Expose swapcache stat for memcg v1' Liu Shixin has added statistics for memcg v1 users which are available (and useful) under memcg v2 - Florent Revest has enhanced the MDWE (Memory-Deny-Write-Executable) prctl so that userspace may direct the kernel to not automatically propagate the denial to child processes. The series is named 'MDWE without inheritance' - Kefeng Wang has provided the series 'mm: convert numa balancing functions to use a folio' which does what it says - In the series 'mm/ksm: add fork-exec support for prctl' Stefan Roesch makes is possible for a process to propagate KSM treatment across exec() - Huang Ying has enhanced memory tiering's calculation of memory distances. This is used to permit the dax/kmem driver to use 'high bandwidth memory' in addition to Optane Data Center Persistent Memory Modules (DCPMM). The series is named 'memory tiering: calculate abstract distance based on ACPI HMAT' - In the series 'Smart scanning mode for KSM' Stefan Roesch has optimized KSM by teaching it to retain and use some historical information from previous scans - Yosry Ahmed has fixed some inconsistencies in memcg statistics in the series 'mm: memcg: fix tracking of pending stats updates values' - In the series 'Implement IOCTL to get and optionally clear info about PTEs' Peter Xu has added an ioctl to /proc//pagemap which permits us to atomically read-then-clear page softdirty state. This is mainly used by CRIU - Hugh Dickins contributed the series 'shmem,tmpfs: general maintenance', a bunch of relatively minor maintenance tweaks to this code - Matthew Wilcox has increased the use of the VMA lock over file-backed page faults in the series 'Handle more faults under the VMA lock'. Some rationalizations of the fault path became possible as a result - In the series 'mm/rmap: convert page_move_anon_rmap() to folio_move_anon_rmap()' David Hildenbrand has implemented some cleanups and folio conversions - In the series 'various improvements to the GUP interface' Lorenzo Stoakes has simplified and improved the GUP interface with an eye to providing groundwork for future improvements - Andrey Konovalov has sent along the series 'kasan: assorted fixes and improvements' which does those things - Some page allocator maintenance work from Kemeng Shi in the series 'Two minor cleanups to break_down_buddy_pages' - In thes series 'New selftest for mm' Breno Leitao has developed another MM self test which tickles a race we had between madvise() and page faults - In the series 'Add folio_end_read' Matthew Wilcox provides cleanups and an optimization to the core pagecache code - Nhat Pham has added memcg accounting for hugetlb memory in the series 'hugetlb memcg accounting' - Cleanups and rationalizations to the pagemap code from Lorenzo Stoakes, in the series 'Abstract vma_merge() and split_vma()' - Audra Mitchell has fixed issues in the procfs page_owner code's new timestamping feature which was causing some misbehaviours. In the series 'Fix page_owner's use of free timestamps' - Lorenzo Stoakes has fixed the handling of new mappings of sealed files in the series 'permit write-sealed memfd read-only shared mappings' - Mike Kravetz has optimized the hugetlb vmemmap optimization in the series 'Batch hugetlb vmemmap modification operations' - Some buffer_head folio conversions and cleanups from Matthew Wilcox in the series 'Finish the create_empty_buffers() transition' - As a page allocator performance optimization Huang Ying has added automatic tuning to the allocator's per-cpu-pages feature, in the series 'mm: PCP high auto-tuning' - Roman Gushchin has contributed the patchset 'mm: improve performance of accounted kernel memory allocations' which improves their performance by ~30% as measured by a micro-benchmark - folio conversions from Kefeng Wang in the series 'mm: convert page cpupid functions to folios' - Some kmemleak fixups in Liu Shixin's series 'Some bugfix about kmemleak' - Qi Zheng has improved our handling of memoryless nodes by keeping them off the allocation fallback list. This is done in the series 'handle memoryless nodes more appropriately' - khugepaged conversions from Vishal Moola in the series 'Some khugepaged folio conversions'" [ bcachefs conflicts with the dynamically allocated shrinkers have been resolved as per Stephen Rothwell in https://lore.kernel.org/all/20230913093553.4290421e@canb.auug.org.au/ with help from Qi Zheng. The clone3 test filtering conflict was half-arsed by yours truly ] * tag 'mm-stable-2023-11-01-14-33' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (406 commits) mm/damon/sysfs: update monitoring target regions for online input commit mm/damon/sysfs: remove requested targets when online-commit inputs selftests: add a sanity check for zswap Documentation: maple_tree: fix word spelling error mm/vmalloc: fix the unchecked dereference warning in vread_iter() zswap: export compression failure stats Documentation: ubsan: drop "the" from article title mempolicy: migration attempt to match interleave nodes mempolicy: mmap_lock is not needed while migrating folios mempolicy: alloc_pages_mpol() for NUMA policy without vma mm: add page_rmappable_folio() wrapper mempolicy: remove confusing MPOL_MF_LAZY dead code mempolicy: mpol_shared_policy_init() without pseudo-vma mempolicy trivia: use pgoff_t in shared mempolicy tree mempolicy trivia: slightly more consistent naming mempolicy trivia: delete those ancient pr_debug()s mempolicy: fix migrate_pages(2) syscall return nr_failed kernfs: drop shared NUMA mempolicy hooks hugetlbfs: drop shared NUMA mempolicy pretence mm/damon/sysfs-test: add a unit test for damon_sysfs_set_targets() ... commit 8d55b0a940bb10592ffaad68d14314823ddf4cdf Author: Dave Airlie Date: Mon Oct 30 16:48:08 2023 +1000 nouveau/gsp: add some basic registry entries. The nvidia driver sets these two basic registry entries always, so copy it. Reviewed-by: Danilo Krummrich Signed-off-by: Dave Airlie commit 5177e5fa6e9e32decfc5beedf82823a0e57bdcff Author: Dave Airlie Date: Mon Oct 30 13:49:36 2023 +1000 nouveau/gsp: fix message signature. This original one was backwards, compared to traces from nvidia driver. Reviewed-by: Danilo Krummrich Signed-off-by: Dave Airlie commit b5bad8c16b9b67be5ce04b8c2f0f1e22c68d8fd9 Author: Dave Airlie Date: Thu Sep 21 13:13:01 2023 +1000 nouveau/gsp: move to 535.113.01 This moves the initial effort to the latest 535 firmware. The gsp msg structs have changed, and the message passing also. The wpr also seems to have some struct changes. This version of the firmware will be what we are stuck on for a while, until we can refactor the driver and work out a better path forward. Reviewed-by: Danilo Krummrich Signed-off-by: Dave Airlie commit bc3012f4e3a9765de81f454cb8f9bb16aafc6ff5 Merge: 6803bd7956ca8 a312e07a65fb5 Author: Linus Torvalds Date: Thu Nov 2 16:15:30 2023 -1000 Merge tag 'v6.7-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto updates from Herbert Xu: "API: - Add virtual-address based lskcipher interface - Optimise ahash/shash performance in light of costly indirect calls - Remove ahash alignmask attribute Algorithms: - Improve AES/XTS performance of 6-way unrolling for ppc - Remove some uses of obsolete algorithms (md4, md5, sha1) - Add FIPS 202 SHA-3 support in pkcs1pad - Add fast path for single-page messages in adiantum - Remove zlib-deflate Drivers: - Add support for S4 in meson RNG driver - Add STM32MP13x support in stm32 - Add hwrng interface support in qcom-rng - Add support for deflate algorithm in hisilicon/zip" * tag 'v6.7-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (283 commits) crypto: adiantum - flush destination page before unmapping crypto: testmgr - move pkcs1pad(rsa,sha3-*) to correct place Documentation/module-signing.txt: bring up to date module: enable automatic module signing with FIPS 202 SHA-3 crypto: asymmetric_keys - allow FIPS 202 SHA-3 signatures crypto: rsa-pkcs1pad - Add FIPS 202 SHA-3 support crypto: FIPS 202 SHA-3 register in hash info for IMA x509: Add OIDs for FIPS 202 SHA-3 hash and signatures crypto: ahash - optimize performance when wrapping shash crypto: ahash - check for shash type instead of not ahash type crypto: hash - move "ahash wrapping shash" functions to ahash.c crypto: talitos - stop using crypto_ahash::init crypto: chelsio - stop using crypto_ahash::init crypto: ahash - improve file comment crypto: ahash - remove struct ahash_request_priv crypto: ahash - remove crypto_ahash_alignmask crypto: gcm - stop using alignmask of ahash crypto: chacha20poly1305 - stop using alignmask of ahash crypto: ccm - stop using alignmask of ahash net: ipv6: stop checking crypto_ahash_alignmask ... commit 6803bd7956ca8fc43069c2e42016f17f3c2fbf30 Merge: 5be9911406ada 45b890f7689eb Author: Linus Torvalds Date: Thu Nov 2 15:45:15 2023 -1000 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm updates from Paolo Bonzini: "ARM: - Generalized infrastructure for 'writable' ID registers, effectively allowing userspace to opt-out of certain vCPU features for its guest - Optimization for vSGI injection, opportunistically compressing MPIDR to vCPU mapping into a table - Improvements to KVM's PMU emulation, allowing userspace to select the number of PMCs available to a VM - Guest support for memory operation instructions (FEAT_MOPS) - Cleanups to handling feature flags in KVM_ARM_VCPU_INIT, squashing bugs and getting rid of useless code - Changes to the way the SMCCC filter is constructed, avoiding wasted memory allocations when not in use - Load the stage-2 MMU context at vcpu_load() for VHE systems, reducing the overhead of errata mitigations - Miscellaneous kernel and selftest fixes LoongArch: - New architecture for kvm. The hardware uses the same model as x86, s390 and RISC-V, where guest/host mode is orthogonal to supervisor/user mode. The virtualization extensions are very similar to MIPS, therefore the code also has some similarities but it's been cleaned up to avoid some of the historical bogosities that are found in arch/mips. The kernel emulates MMU, timer and CSR accesses, while interrupt controllers are only emulated in userspace, at least for now. RISC-V: - Support for the Smstateen and Zicond extensions - Support for virtualizing senvcfg - Support for virtualized SBI debug console (DBCN) S390: - Nested page table management can be monitored through tracepoints and statistics x86: - Fix incorrect handling of VMX posted interrupt descriptor in KVM_SET_LAPIC, which could result in a dropped timer IRQ - Avoid WARN on systems with Intel IPI virtualization - Add CONFIG_KVM_MAX_NR_VCPUS, to allow supporting up to 4096 vCPUs without forcing more common use cases to eat the extra memory overhead. - Add virtualization support for AMD SRSO mitigation (IBPB_BRTYPE and SBPB, aka Selective Branch Predictor Barrier). - Fix a bug where restoring a vCPU snapshot that was taken within 1 second of creating the original vCPU would cause KVM to try to synchronize the vCPU's TSC and thus clobber the correct TSC being set by userspace. - Compute guest wall clock using a single TSC read to avoid generating an inaccurate time, e.g. if the vCPU is preempted between multiple TSC reads. - "Virtualize" HWCR.TscFreqSel to make Linux guests happy, which complain about a "Firmware Bug" if the bit isn't set for select F/M/S combos. Likewise "virtualize" (ignore) MSR_AMD64_TW_CFG to appease Windows Server 2022. - Don't apply side effects to Hyper-V's synthetic timer on writes from userspace to fix an issue where the auto-enable behavior can trigger spurious interrupts, i.e. do auto-enabling only for guest writes. - Remove an unnecessary kick of all vCPUs when synchronizing the dirty log without PML enabled. - Advertise "support" for non-serializing FS/GS base MSR writes as appropriate. - Harden the fast page fault path to guard against encountering an invalid root when walking SPTEs. - Omit "struct kvm_vcpu_xen" entirely when CONFIG_KVM_XEN=n. - Use the fast path directly from the timer callback when delivering Xen timer events, instead of waiting for the next iteration of the run loop. This was not done so far because previously proposed code had races, but now care is taken to stop the hrtimer at critical points such as restarting the timer or saving the timer information for userspace. - Follow the lead of upstream Xen and ignore the VCPU_SSHOTTMR_future flag. - Optimize injection of PMU interrupts that are simultaneous with NMIs. - Usual handful of fixes for typos and other warts. x86 - MTRR/PAT fixes and optimizations: - Clean up code that deals with honoring guest MTRRs when the VM has non-coherent DMA and host MTRRs are ignored, i.e. EPT is enabled. - Zap EPT entries when non-coherent DMA assignment stops/start to prevent using stale entries with the wrong memtype. - Don't ignore guest PAT for CR0.CD=1 && KVM_X86_QUIRK_CD_NW_CLEARED=y This was done as a workaround for virtual machine BIOSes that did not bother to clear CR0.CD (because ancient KVM/QEMU did not bother to set it, in turn), and there's zero reason to extend the quirk to also ignore guest PAT. x86 - SEV fixes: - Report KVM_EXIT_SHUTDOWN instead of EINVAL if KVM intercepts SHUTDOWN while running an SEV-ES guest. - Clean up the recognition of emulation failures on SEV guests, when KVM would like to "skip" the instruction but it had already been partially emulated. This makes it possible to drop a hack that second guessed the (insufficient) information provided by the emulator, and just do the right thing. Documentation: - Various updates and fixes, mostly for x86 - MTRR and PAT fixes and optimizations" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (164 commits) KVM: selftests: Avoid using forced target for generating arm64 headers tools headers arm64: Fix references to top srcdir in Makefile KVM: arm64: Add tracepoint for MMIO accesses where ISV==0 KVM: arm64: selftest: Perform ISB before reading PAR_EL1 KVM: arm64: selftest: Add the missing .guest_prepare() KVM: arm64: Always invalidate TLB for stage-2 permission faults KVM: x86: Service NMI requests after PMI requests in VM-Enter path KVM: arm64: Handle AArch32 SPSR_{irq,abt,und,fiq} as RAZ/WI KVM: arm64: Do not let a L1 hypervisor access the *32_EL2 sysregs KVM: arm64: Refine _EL2 system register list that require trap reinjection arm64: Add missing _EL2 encodings arm64: Add missing _EL12 encodings KVM: selftests: aarch64: vPMU test for validating user accesses KVM: selftests: aarch64: vPMU register test for unimplemented counters KVM: selftests: aarch64: vPMU register test for implemented counters KVM: selftests: aarch64: Introduce vpmu_counter_access test tools: Import arm_pmuv3.h KVM: arm64: PMU: Allow userspace to limit PMCR_EL0.N for the guest KVM: arm64: Sanitize PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR} before first run KVM: arm64: Add {get,set}_user for PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR} ... commit 5be9911406ada8fe6187db7ce402f7ff4c21ebdf Merge: c9cacf7db3e48 63f1ee206170a Author: Linus Torvalds Date: Thu Nov 2 15:34:59 2023 -1000 Merge tag 'sh-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux Pull sh updates from John Paul Adrian Glaubitz: "While the previously announced patch series for converting arch/sh to device trees is not yet ready for inclusion to mainline and therefore didn't make it for this pull request, there are still a small number changes for v6.7 which include one platform (board plus CPU and driver code) removal plus two fixes. The removal sent in by Arnd Bergmann concerns the microdev board which was an early SuperH prototype board that was never used in production. With the board removed, we were able to drop the now unused code for the SH4-202 CPU and well as the driver code for the superhyway bus and a custom implementation for ioport_map() and ioport_unmap() which will allow us to simplify ioport handling in the future. Another patch set by Geert Uytterhoeven revives SuperH BIOS earlyprintk support which got accidentally disabled in e76fe57447e88916 ("sh: Remove old early serial console code V2"), the second patch in the series updates the documentation. Finally, a patch by Masami Hiramatsu fixes a regression reported by the kernel test robot which uncovered that arch/sh is not implementing arch_cmpxchg_local() and therefore needs use __generic_cmpxchg_local() instead" * tag 'sh-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/glaubitz/sh-linux: locking/atomic: sh: Use generic_cmpxchg_local for arch_cmpxchg_local() Documentation: kernel-parameters: Add earlyprintk=bios on SH sh: bios: Revive earlyprintk support sh: machvec: Remove custom ioport_{un,}map() sh: Remove superhyway bus support sh: Remove unused SH4-202 support sh: Remove stale microdev board commit c9cacf7db3e4802fd38cf7a7cbee4db2528bd256 Merge: 8c04bddc27d60 c7368ddba2ffc Author: Linus Torvalds Date: Thu Nov 2 15:32:53 2023 -1000 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM updates from Russell King: - fix some kernel-doc warnings - fix stack depot IRQ stack filter - cast memset() byte to unsigned char - explicitly include correct DI includes - fix ARCH_LOW_ADDRESS_LIMIT with CONFIG_ZONE_DMA - fix get_user() problems when linker uses a veneer - make including linux/uaccess.h self-contained on ARM * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9326/1: make self-contained for ARM ARM: 9324/1: fix get_user() broken with veneer ARM: 9323/1: mm: Fix ARCH_LOW_ADDRESS_LIMIT when CONFIG_ZONE_DMA ARM: 9322/1: Explicitly include correct DT includes ARM: 9321/1: memset: cast the constant byte to unsigned char ARM: 9320/1: fix stack depot IRQ stack filter ARM: 9319/1: sa1111: fix sa1111_probe kernel-doc warnings commit 8c04bddc27d60df8ca5cb5bea40374c3ca1d75fc Merge: 43468456c95b9 2508b608f4028 Author: Linus Torvalds Date: Thu Nov 2 15:31:01 2023 -1000 Merge tag 'm68knommu-for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu Pull m68knommu updates from Greg Ungerer: "A few changes, most of them related to fixing warnings when compiling with "W=1". These follow up Geert's recent changes for M68K for this too. These ones complete the fixes for the nommu and ColdFire specific code. Also a couple of other fixes to improve ROM default addressing and compiling for the Cleopatra boards. Summary: - improve default Kconfig ROM section settings - fix compilation for some Cleopatra boards - fixes and cleanups for warnings compiling with 'W=1'" * tag 'm68knommu-for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68k: 68000: fix warning in timer code m68k: 68000: fix warnings in 68000 interrupt handling m68k: coldfire: remove unused variable in MMU code m68k: coldfire: fix warnings in uboot argument processing m68k: coldfire: make mcf_maskimr() static m68k: coldfire: ensure gpio prototypes visible m68k: coldfire: add and use "vectors.h" m68knommu: fix compilation for ColdFire/Cleopatra boards m68knommu: improve config ROM setting defaults commit 43468456c95b9e13c0592de51a9a530caa525c1f Merge: 6ed92e559a2ea 2ef422f063b74 Author: Linus Torvalds Date: Thu Nov 2 15:20:30 2023 -1000 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma updates from Jason Gunthorpe: "Nothing exciting this cycle, most of the diffstat is changing SPDX 'or' to 'OR'. Summary: - Bugfixes for hns, mlx5, and hfi1 - Hardening patches for size_*, counted_by, strscpy - rts fixes from static analysis - Dump SRQ objects in rdma netlink, with hns support - Fix a performance regression in mlx5 MR deregistration - New XDR (200Gb/lane) link speed - SRQ record doorbell latency optimization for hns - IPSEC support for mlx5 multi-port mode - ibv_rereg_mr() support for irdma - Affiliated event support for bnxt_re - Opt out for the spec compliant qkey security enforcement as we discovered SW that breaks under enforcement - Comment and trivial updates" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (50 commits) IB/mlx5: Fix init stage error handling to avoid double free of same QP and UAF RDMA/mlx5: Fix mkey cache WQ flush RDMA/hfi1: Workaround truncation compilation error IB/hfi1: Fix potential deadlock on &irq_src_lock and &dd->uctxt_lock RDMA/core: Remove NULL check before dev_{put, hold} RDMA/hfi1: Remove redundant assignment to pointer ppd RDMA/mlx5: Change the key being sent for MPV device affiliation RDMA/bnxt_re: Fix clang -Wimplicit-fallthrough in bnxt_re_handle_cq_async_error() RDMA/hns: Fix init failure of RoCE VF and HIP08 RDMA/hns: Fix unnecessary port_num transition in HW stats allocation RDMA/hns: The UD mode can only be configured with DCQCN RDMA/hns: Add check for SL RDMA/hns: Fix signed-unsigned mixed comparisons RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common() RDMA/hns: Fix printing level of asynchronous events RDMA/core: Add support to set privileged QKEY parameter RDMA/bnxt_re: Do not report SRQ error in srq notification RDMA/bnxt_re: Report async events and errors RDMA/bnxt_re: Update HW interface headers IB/mlx5: Fix rdma counter binding for RAW QP ... commit 6ed92e559a2ea572ae2bac5cbeddd1dc8cb667b6 Merge: 90a300dc0553c a75a16c62a254 Author: Linus Torvalds Date: Thu Nov 2 15:13:50 2023 -1000 Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI updates from James Bottomley: "Updates to the usual drivers (ufs, megaraid_sas, lpfc, target, ibmvfc, scsi_debug) plus the usual assorted minor fixes and updates. The major change this time around is a prep patch for rethreading of the driver reset handler API not to take a scsi_cmd structure which starts to reduce various drivers' dependence on scsi_cmd in error handling" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (132 commits) scsi: ufs: core: Leave space for '\0' in utf8 desc string scsi: ufs: core: Conversion to bool not necessary scsi: ufs: core: Fix race between force complete and ISR scsi: megaraid: Fix up debug message in megaraid_abort_and_reset() scsi: aic79xx: Fix up NULL command in ahd_done() scsi: message: fusion: Initialize return value in mptfc_bus_reset() scsi: mpt3sas: Fix loop logic scsi: snic: Remove useless code in snic_dr_clean_pending_req() scsi: core: Add comment to target_destroy in scsi_host_template scsi: core: Clean up scsi_dev_queue_ready() scsi: pmcraid: Add missing scsi_device_put() in pmcraid_eh_target_reset_handler() scsi: target: core: Fix kernel-doc comment scsi: pmcraid: Fix kernel-doc comment scsi: core: Handle depopulation and restoration in progress scsi: ufs: core: Add support for parsing OPP scsi: ufs: core: Add OPP support for scaling clocks and regulators scsi: ufs: dt-bindings: common: Add OPP table scsi: scsi_debug: Add param to control sdev's allow_restart scsi: scsi_debug: Add debugfs interface to fail target reset scsi: scsi_debug: Add new error injection type: Reset LUN failed ... commit 90a300dc0553c5c4a3324ca6de5877c834d27af7 Merge: e5760335882bd 9ea459e477dc0 Author: Linus Torvalds Date: Thu Nov 2 15:06:04 2023 -1000 Merge tag 'libnvdimm-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm updates from Ira Weiny: - updates to deprecated and changed interfaces - bug/kdoc fixes * tag 'libnvdimm-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: libnvdimm: remove kernel-doc warnings: testing: nvdimm: make struct class structures constant libnvdimm: Annotate struct nd_region with __counted_by nd_btt: Make BTT lanes preemptible libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return value dax: refactor deprecated strncpy commit e5760335882bd91137873b8f2230b6c1f91da52b Merge: 431f1051884e3 b00839ca4cca8 Author: Linus Torvalds Date: Thu Nov 2 15:01:33 2023 -1000 Merge tag 'for-linus-6.7-1' of https://github.com/cminyard/linux-ipmi Pull IPMI update from Corey Minyard: "Only one change, and I would normally just wait, but it will make the people trying to get rid of strncpy happy. Its a good change, anyway" * tag 'for-linus-6.7-1' of https://github.com/cminyard/linux-ipmi: ipmi: refactor deprecated strncpy commit 431f1051884e38d2a5751e4731d69b2ff289ee56 Merge: 38984d7872181 b9604be241587 Author: Linus Torvalds Date: Thu Nov 2 14:53:19 2023 -1000 Merge tag 'leds-next-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds Pull LED updates from Lee Jones: "Core Frameworks: - Add support for a bunch more colours New Drivers: - Add support for Kinetic KTD2026/7 RGB/White LEDs New Functionality: - Add support for device to enter HW Controlled Mode to Turris Omnia LEDs - Add support for HW Gamma Correction to Turris Omnia LEDs Fix-ups: - Apply new __counted_by() annotation to several data structures containing flexible arrays - Rid the return value from Platform's .remove() operation - Use *_cansleep() variants for instances were threads can sleep - Improve the semantics when setting the brightness - Generic clean-ups; code reduction, coding style, standard patterns - Replace strncpy() with strscpy() - Fix-up / add various documentation - Re-author the GPIO associated Trigger to use trigger-sources - Move to using standard APIs and helpers - Improve error checking - Stop using static GPIO bases Bug Fixes: - Fix Pointer to Enum casing warnings - Do not pretend that I2C backed device supports SMBUS - Ensure PWM LEDs are extinguished when disabled, rather than held in a state - Fix 'output may be truncated' warnings" * tag 'leds-next-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (43 commits) leds: lp5521: Add an error check in lp5521_post_init_device leds: gpio: Update headers leds: gpio: Remove unneeded assignment leds: gpio: Move temporary variable for struct device to gpio_led_probe() leds: gpio: Refactor code to use devm_gpiod_get_index_optional() leds: gpio: Utilise PTR_ERR_OR_ZERO() leds: gpio: Keep driver firmware interface agnostic leds: core: Refactor led_update_brightness() to use standard pattern leds: turris-omnia: Fix brightness setting and trigger activating leds: sc27xx: Move mutex_init() down leds: trigger: netdev: Move size check in set_device_name leds: Add ktd202x driver dt-bindings: leds: Add Kinetic KTD2026/2027 LED leds: core: Add more colors from DT bindings to led_colors dt-bindings: leds: Last color ID is now 14 (LED_COLOR_ID_LIME) leds: tca6507: Don't use fixed GPIO base leds: lp3952: Convert to use maple tree register cache leds: lm392x: Convert to use maple tree register cache leds: aw200xx: Convert to use maple tree register cache leds: lm3601x: Convert to use maple tree register cache ... commit 38984d78721811c45c4a194784133254903697eb Merge: 27bc0782ef8ec d5272d39995f4 Author: Linus Torvalds Date: Thu Nov 2 14:46:31 2023 -1000 Merge tag 'backlight-next-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "New Functionality: - Add new Device Tree binding for Monolithic Power (MPS) MP3309C step-up converter - Document brightness-levels in bindings for; generic, LED and PWM Bug Fixes: - Ensure PWMs are disabled on .shutdown(), .suspend() and .remove()" * tag 'backlight-next-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: dt-bindings: backlight: Add brightness-levels related common properties backlight: pwm_bl: Disable PWM on shutdown, suspend and remove dt-bindings: backlight: Add MPS MP3309C commit 27bc0782ef8ec26ed94b9fa16c75c11fdb3cd78b Merge: edd8e84ae9514 2b481822446e3 Author: Linus Torvalds Date: Thu Nov 2 14:40:51 2023 -1000 Merge tag 'mfd-next-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Frameworks: - Allow all MFD Cell properties to be filled in dynamically at runtime - Skip disabled device nodes and continue to look for subsequent devices New Device Support: - Add support for Lunar Lake-M PCI to Intel LPSS PCI - Add support for Denverton to Intel ICH LPC New Functionality: - Add support for Clocks to Texas Instruments TWL* Core - Add support for Interrupts to STMicroelectronics STM32 Timers Fix-ups: - Convert to new devm-* (managed) power-off API - Remove superfluous code - Bunch of Device Tree additions, conversions and adaptions - Simplify obtaining resources (memory, device data) using unified API helpers - Trivial coding-style / spelling type clean-ups - Constify / staticify changes - Expand or edit on existing documentation - Convert some Regmap configurations to use the Maple Tree cache - Apply new __counted_by() annotation to several data structures containing flexible arrays - Replace strncpy() with strscpy() Bug Fixes: - Remove double put creating reference imbalances - Ensure headphone/lineout detection gets set when booting with ACPI" * tag 'mfd-next-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (73 commits) mfd: lpc_ich: Mark *_gpio_offsets data with const spmi: rename spmi device lookup helper spmi: document spmi_device_from_of() refcounting dt-bindings: mfd: armltd: Move Arm board syscon's to separate schema mfd: rk8xx: Add support for RK806 power off mfd: rk8xx: Add support for standard system-power-controller property dt-bindings: mfd: rk806: Allow system-power-controller property dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller dt-bindings: mfd: max8925: Convert to DT schema format mfd: Use i2c_get_match_data() in a selection of drivers mfd: Use device_get_match_data() in a bunch of drivers mfd: mc13xxx-spi/wm831x-spi: Use spi_get_device_match_data() mfd: motorola-cpcap: Drop unnecessary of_match_device() call mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs mfd: qcom-spmi-pmic: Switch to EXPORT_SYMBOL_GPL() mfd: qcom-spmi-pmic: Fix revid implementation mfd: qcom-spmi-pmic: Fix reference leaks in revid helper mfd: intel-m10-bmc: Change contact for ABI docs mfd: max8907: Convert to use maple tree register cache mfd: max77686: Convert to use maple tree register cache ... commit edd8e84ae9514e93368f56c3715b11af52df6c3b Merge: 4ea4ed22b5784 dc6e08b1a2ae2 Author: Linus Torvalds Date: Thu Nov 2 14:34:14 2023 -1000 Merge tag 'sound-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "Most of changes at this time are for ASoC, spread over ASoC core and drivers due to the API prefix standardization. Other than that, there have little change wrt API, rather lots of driver-specific updates and fixes. Some highlight below: ASoC: - Standardization of API prefix - GPIO API usage improvements - Support for HDA patches - Lots of work on SOF, including crash dump support - Fixes for noise when stopping some Sounwire CODECs - Support for AMD platforms with es83xx, AMD ACP 6.3 and 7.0, Awinc AT87390 and AW88399, many Intel platforms, many Mediatek platforms, Qualcomm SM6115 and SC7180 platforms, Richtek RTQ9128 and Texas Instruments TAS575x HD-audio and USB-audio: - Deferred probe support of audio component binding - More fixes and enhancements for Cirrus subcodecs - USB Scarlett2 mixer and McIntosh DSD quirk Others: - More enhancement of snd-aloop driver - Update MAINTAINERS entry for linux-sound mailing list" * tag 'sound-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (485 commits) ALSA: hda: cs35l41: Fix missing error code in cs35l41_smart_amp() ALSA: hda: cs35l41: mark cs35l41_verify_id() static ASoC: codecs: wsa883x: make use of new mute_unmute_on_trigger flag ASoC: soc-dai: add flag to mute and unmute stream during trigger ASoC: ams-delta.c: use component after check ASoC: amd: acp: select SND_SOC_AMD_ACP_LEGACY_COMMON for ACP63 ASoC: codecs: aw88399: fix typo in Kconfig select ASoC: amd: acp: add ACPI dependency ASoC: Intel: avs: Add rt5514 machine board ASoC: Intel: avs: Add rt5514 machine board ALSA: scarlett2: Add missing check with firmware version control ALSA: virtio: use ack callback ALSA: scarlett2: Remap Level Meter values ALSA: scarlett2: Allow passing any output to line_out_remap() ALSA: scarlett2: Add support for reading firmware version ALSA: scarlett2: Rename Gen 3 config sets ALSA: scarlett2: Rename scarlett_gen2 to scarlett2 ASoC: cs35l41: Detect CSPL errors when sending CSPL commands ALSA: hda: cs35l41: Check CSPL state after loading firmware ALSA: hda: cs35l41: Do not unload firmware before reset in system suspend ... commit 4ea4ed22b57846facd9cb4af5f67cb7bd2792cf3 Merge: 27beb3ca347fa 1372e73a18139 Author: Linus Torvalds Date: Thu Nov 2 14:29:10 2023 -1000 Merge tag 'for-linus-2023110101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID updates from Jiri Kosina: - fixes for crashes detected by CONFIG_KUNIT_ALL_TESTS in hid-uclogic driver (Jinjie Ruan) - HID selftests fixes and improvements (Benjamin Tissoires) - probe error handling path fixes in hid-nvidia-shield driver (Christophe JAILLET) - cleanup of LED handling in hid-nintendo (Martino Fontana) - big cleanup of logitech-hidpp probe code (Hans de Goede) - Suspend/Resume fix for USB Thinkpad Compact Keyboard (Jamie Lentin) - firmware detection improvement for Lenovo cptkbd (Mikhail Khvainitski) - IRQ shutdown and workqueue initialization fixes for hid-cp2112 driver (Danny Kaehn) - #ifdef CONFIG_PM removal from HID code (Thomas Weißschuh) - other assorted device-ID additions and quirks * tag 'for-linus-2023110101' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (31 commits) HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W HID: logitech-hidpp: Stop IO before calling hid_connect() HID: logitech-hidpp: Drop HIDPP_QUIRK_UNIFYING HID: logitech-hidpp: Drop delayed_work_cb() HID: logitech-hidpp: Fix connect event race HID: logitech-hidpp: Remove unused connected param from *_connect() HID: logitech-hidpp: Remove connected check for non-unifying devices HID: logitech-hidpp: Add hidpp_non_unifying_init() helper HID: logitech-hidpp: Move hidpp_overwrite_name() to before connect check HID: logitech-hidpp: Move g920_get_config() to just before hidpp_ff_init() HID: logitech-hidpp: Remove wtp_get_config() call from probe() HID: logitech-hidpp: Move get_wireless_feature_index() check to hidpp_connect_event() HID: logitech-hidpp: Revert "Don't restart communication if not necessary" HID: logitech-hidpp: Don't restart IO, instead defer hid_connect() only HID: rmi: remove #ifdef CONFIG_PM HID: multitouch: remove #ifdef CONFIG_PM HID: usbhid: remove #ifdef CONFIG_PM HID: core: remove #ifdef CONFIG_PM from hid_driver hid: lenovo: Resend all settings on reset_resume for compact keyboards HID: uclogic: Fix a work->entry not empty bug in __queue_work() ... commit 27beb3ca347fa29fef5c23b351120239b8cf0612 Merge: 4652b8e4f3ffa 50b3ef14c26b2 Author: Linus Torvalds Date: Thu Nov 2 14:05:18 2023 -1000 Merge tag 'pci-v6.7-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci Pull pci updates from Bjorn Helgaas: "Enumeration: - Use acpi_evaluate_dsm_typed() instead of open-coding _DSM evaluation to learn device characteristics (Andy Shevchenko) - Tidy multi-function header checks using new PCI_HEADER_TYPE_MASK definition (Ilpo Järvinen) - Simplify config access error checking in various drivers (Ilpo Järvinen) - Use pcie_capability_clear_word() (not pcie_capability_clear_and_set_word()) when only clearing (Ilpo Järvinen) - Add pci_get_base_class() to simplify finding devices using base class only (ignoring subclass and programming interface) (Sui Jingfeng) - Add pci_is_vga(), which includes ancient PCI_CLASS_NOT_DEFINED_VGA devices from before the Class Code was added to PCI (Sui Jingfeng) - Use pci_is_vga() for vgaarb, sysfs "boot_vga", virtio, qxl to include ancient VGA devices (Sui Jingfeng) Resource management: - Make pci_assign_unassigned_resources() non-init because sparc uses it after init (Randy Dunlap) Driver binding: - Retain .remove() and .probe() callbacks (previously __init) because sysfs may cause them to be called later (Uwe Kleine-König) - Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device, so it can be claimed by dwc3 instead (Vicki Pfau) PCI device hotplug: - Add Ampere Altra Attention Indicator extension driver for acpiphp (D Scott Phillips) Power management: - Quirk VideoPropulsion Torrent QN16e with longer delay after reset (Lukas Wunner) - Prevent users from overriding drivers that say we shouldn't use D3cold (Lukas Wunner) - Avoid PME from D3hot/D3cold for AMD Rembrandt and Phoenix USB4 because wakeup interrupts from those states don't work if amd-pmc has put the platform in a hardware sleep state (Mario Limonciello) IOMMU: - Disable ATS for Intel IPU E2000 devices with invalidation message endianness erratum (Bartosz Pawlowski) Error handling: - Factor out interrupt enable/disable into helpers (Kai-Heng Feng) Peer-to-peer DMA: - Fix flexible-array usage in struct pci_p2pdma_pagemap in case we ever use pagemaps with multiple entries (Gustavo A. R. Silva) ASPM: - Revert a change that broke when drivers disabled L1 and users later enabled an L1.x substate via sysfs, and fix a similar issue when users disabled L1 via sysfs (Heiner Kallweit) Endpoint framework: - Fix double free in __pci_epc_create() (Dan Carpenter) - Use IS_ERR_OR_NULL() to simplify endpoint core (Ruan Jinjie) Cadence PCIe controller driver: - Drop unused "is_rc" member (Li Chen) Freescale Layerscape PCIe controller driver: - Enable 64-bit addressing in endpoint mode (Guanhua Gao) Intel VMD host bridge driver: - Fix multi-function header check (Ilpo Järvinen) Microsoft Hyper-V host bridge driver: - Annotate struct hv_dr_state with __counted_by (Kees Cook) NVIDIA Tegra194 PCIe controller driver: - Drop setting of LNKCAP_MLW (max link width) since dw_pcie_setup() already does this via dw_pcie_link_set_max_link_width() (Yoshihiro Shimoda) Qualcomm PCIe controller driver: - Use PCIE_SPEED2MBS_ENC() to simplify encoding of link speed (Manivannan Sadhasivam) - Add a .write_dbi2() callback so DBI2 register writes, e.g., for setting the BAR size, work correctly (Manivannan Sadhasivam) - Enable ASPM for platforms that use 1.9.0 ops, because the PCI core doesn't enable ASPM states that haven't been enabled by the firmware (Manivannan Sadhasivam) Renesas R-Car Gen4 PCIe controller driver: - Add DesignWare core support (set max link width, EDMA_UNROLL flag, .pre_init(), .deinit(), etc) for use by R-Car Gen4 driver (Yoshihiro Shimoda) - Add driver and DT schema for DesignWare-based Renesas R-Car Gen4 controller in both host and endpoint mode (Yoshihiro Shimoda) Xilinx NWL PCIe controller driver: - Update ECAM size to support 256 buses (Thippeswamy Havalige) - Stop setting bridge primary/secondary/subordinate bus numbers, since PCI core does this (Thippeswamy Havalige) Xilinx XDMA controller driver: - Add driver and DT schema for Zynq UltraScale+ MPSoCs devices with Xilinx XDMA Soft IP (Thippeswamy Havalige) Miscellaneous: - Use FIELD_GET()/FIELD_PREP() to simplify and reduce use of _SHIFT macros (Ilpo Järvinen, Bjorn Helgaas) - Remove logic_outb(), _outw(), outl() duplicate declarations (John Sanpe) - Replace unnecessary UTF-8 in Kconfig help text because menuconfig doesn't render it correctly (Liu Song)" * tag 'pci-v6.7-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: (102 commits) PCI: qcom-ep: Add dedicated callback for writing to DBI2 registers PCI: Simplify pcie_capability_clear_and_set_word() to ..._clear_word() PCI: endpoint: Fix double free in __pci_epc_create() PCI: xilinx-xdma: Add Xilinx XDMA Root Port driver dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx XDMA PCIe Root Port Bridge PCI: xilinx-cpm: Move IRQ definitions to a common header PCI: xilinx-nwl: Modify ECAM size to enable support for 256 buses PCI: xilinx-nwl: Rename the NWL_ECAM_VALUE_DEFAULT macro dt-bindings: PCI: xilinx-nwl: Modify ECAM size in the DT example PCI: xilinx-nwl: Remove redundant code that sets Type 1 header fields PCI: hotplug: Add Ampere Altra Attention Indicator extension driver PCI/AER: Factor out interrupt toggling into helpers PCI: acpiphp: Allow built-in drivers for Attention Indicators PCI/portdrv: Use FIELD_GET() PCI/VC: Use FIELD_GET() PCI/PTM: Use FIELD_GET() PCI/PME: Use FIELD_GET() PCI/ATS: Use FIELD_GET() PCI/ATS: Show PASID Capability register width in bitmasks PCI/ASPM: Fix L1 substate handling in aspm_attr_store_common() ... commit 4b92894064b3df472b2cf5741c7f080e16dcd1ec Author: Dan Williams Date: Thu Nov 2 15:07:02 2023 -0700 lib/fw_table: Remove acpi_parse_entries_array() export Stephen reports that the ACPI helper library rework, CONFIG_FIRMWARE_TABLE, introduces a new compiler warning: WARNING: modpost: vmlinux: acpi_parse_entries_array: EXPORT_SYMBOL used for init symbol. Remove __init or EXPORT_SYMBOL. Delete this export as it turns out it is unneeded, and future work wraps this in another exported helper. Note that in general EXPORT_SYMBOL_ACPI_LIB() is needed for exporting symbols that are marked __init_or_acpilib, but in this case no export is required. Fixes: a103f46633fd ("acpi: Move common tables helper functions to common lib") Cc: Dave Jiang Reported-by: Stephen Rothwell Closes: http://lore.kernel.org/r/20231030160523.670a7569@canb.auug.org.au Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/169896282222.70775.940454758280866379.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams commit b3741ac86c8e648709506102f7ab51905d50df43 Author: Terry Bowman Date: Thu Nov 2 10:52:32 2023 -0500 cxl/pci: Change CXL AER support check to use native AER Native CXL protocol errors are delivered to the OS through AER reporting. The owner of AER owns CXL Protocol error management with respect to _OSC negotiation.[1] CXL device errors are handled by a separate interrupt with native control gated by _OSC control field 'CXL Memory Error Reporting Control'. The CXL driver incorrectly checks for 'CXL Memory Error Reporting Control' before accessing AER registers and caching RCH downport AER registers. Replace the current check in these 2 cases with native AER checks. [1] CXL 3.0 - 9.17.2 CXL _OSC, Table-9-26, Interpretation of CXL _OSC Support Fields, p.641 Fixes: f05fd10d138d ("cxl/pci: Add RCH downstream port AER register discovery") Signed-off-by: Terry Bowman Reviewed-by: Smita Koralahalli Link: https://lore.kernel.org/r/20231102155232.1421261-1-terry.bowman@amd.com Signed-off-by: Dan Williams commit e1c05b3bf80f829ced464bdca90f1dfa96e8d251 Author: Andrew Jones Date: Tue Oct 10 18:51:02 2023 +0200 RISC-V: hwprobe: Fix vDSO SIGSEGV A hwprobe pair key is signed, but the hwprobe vDSO function was only checking that the upper bound was valid. In order to help avoid this type of problem in the future, and in anticipation of this check becoming more complicated with sparse keys, introduce and use a "key is valid" predicate function for the check. Fixes: aa5af0aa90ba ("RISC-V: Add hwprobe vDSO function and data") Signed-off-by: Andrew Jones Reviewed-by: Evan Green Link: https://lore.kernel.org/r/20231010165101.14942-2-ajones@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 653301077c1f3e18af33f7950014cda8b4bf4935 Author: Lad Prabhakar Date: Fri Sep 29 01:07:04 2023 +0100 riscv: configs: defconfig: Enable configs required for RZ/Five SoC Enable the configs required by the below IP blocks which are present on RZ/Five SoC: * ADC * CANFD * DMAC * eMMC/SDHI * OSTM * RAVB (+ Micrel PHY) * RIIC * RSPI * SSI (Sound+WM8978 codec) * Thermal * USB (PHY/RESET/OTG) Along with the above some core configs are enabled too, -> CPU frequency scaling as RZ/Five does support this. -> MTD is enabled as RSPI can be connected to flash chips -> Enabled I2C chardev so that it enables userspace to read/write i2c devices (similar to arm64) -> Thermal configs as RZ/Five SoC does have thermal unit -> GPIO regulator as we might have IP blocks for which voltage levels are controlled by GPIOs -> OTG configs as RZ/Five USB can support host/function -> Gadget configs so that we can test USB function (as done in arm64 all the gadget configs are enabled) Signed-off-by: Lad Prabhakar Acked-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929000704.53217-6-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Palmer Dabbelt commit 24005d184aaa80984e0511c4ec6e6a0860fdddb8 Merge: 4630d6daaba81 245561ba6d5de Author: Palmer Dabbelt Date: Thu Nov 2 14:05:23 2023 -0700 Merge patch series "riscv: SCS support" Sami Tolvanen says: This series adds Shadow Call Stack (SCS) support for RISC-V. SCS uses compiler instrumentation to store return addresses in a separate shadow stack to protect them against accidental or malicious overwrites. More information about SCS can be found here: https://clang.llvm.org/docs/ShadowCallStack.html Patch 1 is from Deepak, and it simplifies VMAP_STACK overflow handling by adding support for accessing per-CPU variables directly in assembly. The patch is included in this series to make IRQ stack switching cleaner with SCS, and I've simply rebased it and fixed a couple of minor issues. Patch 2 uses this functionality to clean up the stack switching by moving duplicate code into a single function. On RISC-V, the compiler uses the gp register for storing the current shadow call stack pointer, which is incompatible with global pointer relaxation. Patch 3 moves global pointer loading into a macro that can be easily disabled with SCS. Patch 4 implements SCS register loading and switching, and allows the feature to be enabled, and patch 5 adds separate per-CPU IRQ shadow call stacks when CONFIG_IRQ_STACKS is enabled. Patch 6 fixes the backward-edge CFI test in lkdtm for RISC-V. Note that this series requires Clang 17. Earlier Clang versions support SCS on RISC-V, but use the x18 register instead of gp, which isn't ideal. gcc has SCS support for arm64, but I'm not aware of plans to support RISC-V. Once the Zicfiss extension is ratified, it's probably preferable to use hardware-backed shadow stacks instead of SCS on hardware that supports the extension, and we may want to consider implementing CONFIG_DYNAMIC_SCS to patch between the implementation at runtime (similarly to the arm64 implementation, which switches to SCS when hardware PAC support isn't available). * b4-shazam-merge: lkdtm: Fix CFI_BACKWARD on RISC-V riscv: Use separate IRQ shadow call stacks riscv: Implement Shadow Call Stack riscv: Move global pointer loading to a macro riscv: Deduplicate IRQ stack switching riscv: VMAP_STACK overflow detection thread-safe Link: https://lore.kernel.org/r/20230927224757.1154247-8-samitolvanen@google.com Signed-off-by: Palmer Dabbelt commit 4630d6daaba81560379d7ee5107100671c305992 Merge: b8c2f6617fd73 27fb27197cbbd Author: Palmer Dabbelt Date: Fri Oct 27 06:22:52 2023 -0700 Merge patch "riscv: errata: improve T-Head CMO" This fixes an encoding issue with T-Head's dcache.cva and fixes the comment about the T-Head encodings. The first of these was a fix and got picked up earlier, I'm merging the second on top of it as they touch the same comment. * b4-shazam-merge: riscv: errata: prefix T-Head mnemonics with th. riscv: errata: fix T-Head dcache.cva encoding Link: https://lore.kernel.org/r/20230827090813.1353-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt commit 27fb27197cbbdfd917417ac2492f9bf15d23e5c4 Author: Icenowy Zheng Date: Sun Aug 27 17:08:13 2023 +0800 riscv: errata: prefix T-Head mnemonics with th. T-Head now maintains some specification for their extended instructions at [1], in which all instructions are prefixed "th.". Follow this practice in the kernel comments. Link: https://github.com/T-head-Semi/thead-extension-spec [1] Signed-off-by: Icenowy Zheng Reviewed-by: Guo Ren Signed-off-by: Palmer Dabbelt commit 92099f0c92270c8c7a79e6bc6e0312ad248ea331 Author: Andreas Gruenbacher Date: Fri Oct 20 01:32:15 2023 +0200 gfs2: Add metapath_dibh helper Add a metapath_dibh() helper for extracting the inode's buffer head from a metapath. Signed-off-by: Andreas Gruenbacher commit 1f7b0a84c86eca74155dc292cd2f965d6bb79884 Author: Andreas Gruenbacher Date: Fri Oct 20 21:02:59 2023 +0200 gfs2: Clean up quota.c:print_message Function print_message() in quota.c doesn't return a meaningful return value. Turn it into a void function and stop abusing it for setting variable error to 0 in gfs2_quota_check(). Signed-off-by: Andreas Gruenbacher commit f7e4c610cb9afcb94d45c6252c312b95038d52bc Author: Andreas Gruenbacher Date: Fri Oct 20 22:02:04 2023 +0200 gfs2: Clean up gfs2_alloc_parms initializers When intializing a struct, all fields that are not explicitly mentioned are zeroed out already. Signed-off-by: Andreas Gruenbacher commit 703df114f9b70b4b672d71bdf751497cf7643b75 Author: Andreas Gruenbacher Date: Sun Oct 22 00:06:41 2023 +0200 gfs2: Two quota=account mode fixes Make sure we don't skip accounting for quota changes with the quota=account mount option. Reviewed-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 4652b8e4f3ffa48c706ec334f048c217a7d9750d Merge: 71fb7b320b282 67797da8a4b82 Author: Linus Torvalds Date: Thu Nov 2 08:32:07 2023 -1000 Merge tag '6.7-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd Pull smb server updates from Steve French: "Seven ksmbd server fixes: - logoff improvement for multichannel bound connections - unicode fix for surrogate pairs - RDMA (smbdirect) fix for IB devices - fix locking deadlock in kern_path_create during rename - iov memory allocation fix - two minor cleanup patches (doc cleanup, and unused variable)" * tag '6.7-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd: ksmbd: no need to wait for binded connection termination at logoff ksmbd: add support for surrogate pair conversion ksmbd: fix missing RDMA-capable flag for IPoIB device in ksmbd_rdma_capable_netdev() ksmbd: fix recursive locking in vfs helpers ksmbd: fix kernel-doc comment of ksmbd_vfs_setxattr() ksmbd: reorganize ksmbd_iov_pin_rsp() ksmbd: Remove unused field in ksmbd_user struct commit 71fb7b320b2820903210acd60427e09b1962cfd3 Merge: 5efad0a7658ce 1758cd2e95d31 Author: Linus Torvalds Date: Thu Nov 2 08:27:04 2023 -1000 Merge tag 'fsnotify_for_v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify update from Jan Kara: "This time just one tiny cleanup for fsnotify" * tag 'fsnotify_for_v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fanotify: delete useless parenthesis in FANOTIFY_INLINE_FH macro commit 5efad0a7658cea6dfd22d4e75d247692e48dde10 Merge: e9806ff8a0f9e 82dd620653b32 Author: Linus Torvalds Date: Thu Nov 2 08:19:51 2023 -1000 Merge tag 'fs_for_v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull ext2, udf, and quota updates from Jan Kara: - conversion of ext2 directory code to use folios - cleanups in UDF declarations - bugfix for quota interaction with file encryption * tag 'fs_for_v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: ext2: Convert ext2_prepare_chunk and ext2_commit_chunk to folios ext2: Convert ext2_make_empty() to use a folio ext2: Convert ext2_unlink() and ext2_rename() to use folios ext2: Convert ext2_delete_entry() to use folios ext2: Convert ext2_empty_dir() to use a folio ext2: Convert ext2_add_link() to use a folio ext2: Convert ext2_readdir to use a folio ext2: Add ext2_get_folio() ext2: Convert ext2_check_page to ext2_check_folio highmem: Add folio_release_kmap() udf: Avoid unneeded variable length array in struct fileIdentDesc udf: Annotate struct udf_bitmap with __counted_by quota: explicitly forbid quota files from being encrypted commit e9806ff8a0f9e6eb193326383a7b88bf30ad0533 Merge: dc737f11c2189 a779ed754e52d Author: Linus Torvalds Date: Thu Nov 2 08:08:28 2023 -1000 Merge tag 'jfs-6.7' of https://github.com/kleikamp/linux-shaggy Pull jfs updates from Dave Kleikamp: "Minor stability improvements" * tag 'jfs-6.7' of https://github.com/kleikamp/linux-shaggy: jfs: define xtree root and page independently jfs: fix array-index-out-of-bounds in diAlloc jfs: fix array-index-out-of-bounds in dbFindLeaf fs/jfs: Add validity check for db_maxag and db_agpref fs/jfs: Add check for negative db_l2nbperpage commit dc737f11c218969d01799dd8eb478582b67aaa24 Merge: 87a201b43bbe1 ee785c15b5906 Author: Linus Torvalds Date: Thu Nov 2 08:00:53 2023 -1000 Merge tag 'exfat-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat Pull exfat updates from Namjae Jeon: - Add ioctls to get and set file attribute that is used in the fatattr util - Add zero_size_dir mount option to avoid allocating a cluster when creating a directory * tag 'exfat-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat: exfat: support create zero-size directory exfat: support handle zero-size directory exfat: add ioctls for accessing attributes commit 87a201b43bbe14ddf8dc2d73fa15741b7403afc3 Merge: 57aff99745042 1a0ac8bd7a4fa Author: Linus Torvalds Date: Thu Nov 2 07:53:57 2023 -1000 Merge tag 'erofs-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs updates from Gao Xiang: "Nothing exciting lands for this cycle, since we're still busying in developing support for sub-page blocks and large-folios of compressed data for new scenarios on Android. In this cycle, MicroLZMA format is marked as stable, and there are minor cleanups around documentation and codebase. In addition, it also fixes incorrect lockref usage in erofs_insert_workgroup(). Summary: - Fix inode metadata space layout documentation - Avoid warning for MicroLZMA format anymore - Fix erofs_insert_workgroup() lockref usage - Some cleanups" * tag 'erofs-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: fix erofs_insert_workgroup() lockref usage erofs: tidy up redundant includes erofs: get rid of ROOT_NID() erofs: simplify compression configuration parser erofs: don't warn MicroLZMA format anymore erofs: fix inode metadata space layout description in documentation commit 57aff997450420b8a7da6a72f45c3677ac1c2f86 Merge: 91a683cdf602a 91562895f8030 Author: Linus Torvalds Date: Thu Nov 2 07:45:14 2023 -1000 Merge tag 'ext4_for_linus-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 updates from Ted Ts'o: "Cleanup ext4's multi-block allocator, including adding some unit tests, as well as cleaning how we update the backup superblock after online resizes or updating the label or uuid. Optimize handling of released data blocks in ext4's commit machinery to avoid a potential lock contention on s_md_lock spinlock. Fix a number of ext4 bugs: - fix race between writepages and remount - fix racy may inline data check in dio write - add missed brelse in an error path in update_backups - fix umask handling when ACL support is disabled - fix lost EIO error when a journal commit races with a fsync of the blockdev - fix potential improper i_size when there is a crash right after an O_SYNC direct write. - check extent node for validity before potentially using what might be an invalid pointer - fix potential stale data exposure when writing to an unwritten extent and the file system is nearly out of space - fix potential accounting error around block reservations when writing partial delayed allocation writes to a bigalloc cluster - avoid memory allocation failure when tracking partial delayed allocation writes to a bigalloc cluster - fix various debugging print messages" * tag 'ext4_for_linus-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (41 commits) ext4: properly sync file size update after O_SYNC direct IO ext4: fix racy may inline data check in dio write ext4: run mballoc test with different layouts setting ext4: add first unit test for ext4_mb_new_blocks_simple in mballoc ext4: add some kunit stub for mballoc kunit test ext4: call ext4_mb_mark_context in ext4_group_add_blocks() ext4: Separate block bitmap and buddy bitmap freeing in ext4_group_add_blocks() ext4: call ext4_mb_mark_context in ext4_mb_clear_bb ext4: Separate block bitmap and buddy bitmap freeing in ext4_mb_clear_bb() ext4: call ext4_mb_mark_context in ext4_mb_mark_diskspace_used ext4: extend ext4_mb_mark_context to support allocation under journal ext4: call ext4_mb_mark_context in ext4_free_blocks_simple ext4: factor out codes to update block bitmap and group descriptor on disk from ext4_mb_mark_bb ext4: make state in ext4_mb_mark_bb to be bool jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev ext4: apply umask if ACL support is disabled ext4: mark buffer new if it is unwritten to avoid stale data exposure ext4: move 'ix' sanity check to corrent position jbd2: fix printk format type for 'io_block' in do_one_pass() jbd2: print io_block if check data block checksum failed when do recovery ... commit 91a683cdf602a593ea1f7783346a605e0cd470df Merge: 17fc8084aa8f9 eb53c01873cab Author: Linus Torvalds Date: Thu Nov 2 07:40:07 2023 -1000 Merge tag 'dlm-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm Pull dlm updates from David Teigland: "This set of patches has some minor fixes for message handling, some misc cleanups, and updates the maintainers entry" * tag 'dlm-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm: MAINTAINERS: Update dlm maintainer and web page dlm: slow down filling up processing queue dlm: fix no ack after final message dlm: be sure we reset all nodes at forced shutdown dlm: fix remove member after close call dlm: fix creating multiple node structures fs: dlm: Remove some useless memset() fs: dlm: Fix the size of a buffer in dlm_create_debug_file() fs: dlm: Simplify buffer size computation in dlm_create_debug_file() commit 17fc8084aa8f9d5235f252fc3978db657dd77e92 Author: Andrea Righi Date: Thu Nov 2 09:19:14 2023 +0100 module/decompress: use kvmalloc() consistently We consistently switched from kmalloc() to vmalloc() in module decompression to prevent potential memory allocation failures with large modules, however vmalloc() is not as memory-efficient and fast as kmalloc(). Since we don't know in general the size of the workspace required by the decompression algorithm, it is more reasonable to use kvmalloc() consistently, also considering that we don't have special memory requirements here. Suggested-by: Linus Torvalds Tested-by: Andrea Righi Signed-off-by: Andrea Righi Signed-off-by: Linus Torvalds commit ca219be012786654d5c802ee892433aaa0016d10 Merge: 21e80f3841c01 b836c4d29f274 Author: Linus Torvalds Date: Thu Nov 2 06:53:22 2023 -1000 Merge tag 'integrity-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity Pull integrity updates from Mimi Zohar: "Four integrity changes: two IMA-overlay updates, an integrity Kconfig cleanup, and a secondary keyring update" * tag 'integrity-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: ima: detect changes to the backing overlay file certs: Only allow certs signed by keys on the builtin keyring integrity: fix indentation of config attributes ima: annotate iint mutex to avoid lockdep false positive warnings commit d84b139f53e8fa8048f16814c6b2a53d7bc15c3d Author: Björn Töpel Date: Thu Nov 2 11:35:37 2023 +0100 selftests/bpf: Fix broken build where char is unsigned There are architectures where char is not signed. If so, the following error is triggered: | xdp_hw_metadata.c:435:42: error: result of comparison of constant -1 \ | with expression of type 'char' is always true \ | [-Werror,-Wtautological-constant-out-of-range-compare] | 435 | while ((opt = getopt(argc, argv, "mh")) != -1) { | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~ | 1 error generated. Correct by changing the char to int. Fixes: bb6a88885fde ("selftests/bpf: Add options and frags to xdp_hw_metadata") Signed-off-by: Björn Töpel Acked-by: Larysa Zaremba Tested-by: Anders Roxell Link: https://lore.kernel.org/r/20231102103537.247336-1-bjorn@kernel.org Signed-off-by: Alexei Starovoitov commit d9a6d78096056a3cb5c5f07a730ab92f2f9ac4e6 Author: Shyam Prasad N Date: Mon Oct 30 11:00:11 2023 +0000 cifs: force interface update before a fresh session setup During a session reconnect, it is possible that the server moved to another physical server (happens in case of Azure files). So at this time, force a query of server interfaces again (in case of multichannel session), such that the secondary channels connect to the right IP addresses (possibly updated now). Cc: stable@vger.kernel.org Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 6e5e64c9477d58e73cb1a0e83eacad1f8df247cf Author: Shyam Prasad N Date: Mon Oct 30 11:00:10 2023 +0000 cifs: do not reset chan_max if multichannel is not supported at mount If the mount command has specified multichannel as a mount option, but multichannel is found to be unsupported by the server at the time of mount, we set chan_max to 1. Which means that the user needs to remount the share if the server starts supporting multichannel. This change removes this reset. What it means is that if the user specified multichannel or max_channels during mount, and at this time, multichannel is not supported, but the server starts supporting it at a later point, the client will be capable of scaling out the number of channels. Cc: stable@vger.kernel.org Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit c3326a61cdbf3ce1273d9198b6cbf90965d7e029 Author: Shyam Prasad N Date: Mon Oct 30 11:00:09 2023 +0000 cifs: reconnect helper should set reconnect for the right channel We introduced a helper function to be used by non-cifsd threads to mark the connection for reconnect. For multichannel, when only a particular channel needs to be reconnected, this had a bug. This change fixes that by marking that particular channel for reconnect. Fixes: dca65818c80c ("cifs: use a different reconnect helper for non-cifsd threads") Cc: stable@vger.kernel.org Signed-off-by: Shyam Prasad N Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 5c86919455c1edec99ebd3338ad213b59271a71b Author: Paulo Alcantara Date: Mon Oct 30 17:19:56 2023 -0300 smb: client: fix use-after-free in smb2_query_info_compound() The following UAF was triggered when running fstests generic/072 with KASAN enabled against Windows Server 2022 and mount options 'multichannel,max_channels=2,vers=3.1.1,mfsymlinks,noperm' BUG: KASAN: slab-use-after-free in smb2_query_info_compound+0x423/0x6d0 [cifs] Read of size 8 at addr ffff888014941048 by task xfs_io/27534 CPU: 0 PID: 27534 Comm: xfs_io Not tainted 6.6.0-rc7 #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014 Call Trace: dump_stack_lvl+0x4a/0x80 print_report+0xcf/0x650 ? srso_alias_return_thunk+0x5/0x7f ? srso_alias_return_thunk+0x5/0x7f ? __phys_addr+0x46/0x90 kasan_report+0xda/0x110 ? smb2_query_info_compound+0x423/0x6d0 [cifs] ? smb2_query_info_compound+0x423/0x6d0 [cifs] smb2_query_info_compound+0x423/0x6d0 [cifs] ? __pfx_smb2_query_info_compound+0x10/0x10 [cifs] ? srso_alias_return_thunk+0x5/0x7f ? __stack_depot_save+0x39/0x480 ? kasan_save_stack+0x33/0x60 ? kasan_set_track+0x25/0x30 ? ____kasan_slab_free+0x126/0x170 smb2_queryfs+0xc2/0x2c0 [cifs] ? __pfx_smb2_queryfs+0x10/0x10 [cifs] ? __pfx___lock_acquire+0x10/0x10 smb311_queryfs+0x210/0x220 [cifs] ? __pfx_smb311_queryfs+0x10/0x10 [cifs] ? srso_alias_return_thunk+0x5/0x7f ? __lock_acquire+0x480/0x26c0 ? lock_release+0x1ed/0x640 ? srso_alias_return_thunk+0x5/0x7f ? do_raw_spin_unlock+0x9b/0x100 cifs_statfs+0x18c/0x4b0 [cifs] statfs_by_dentry+0x9b/0xf0 fd_statfs+0x4e/0xb0 __do_sys_fstatfs+0x7f/0xe0 ? __pfx___do_sys_fstatfs+0x10/0x10 ? srso_alias_return_thunk+0x5/0x7f ? lockdep_hardirqs_on_prepare+0x136/0x200 ? srso_alias_return_thunk+0x5/0x7f do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 Allocated by task 27534: kasan_save_stack+0x33/0x60 kasan_set_track+0x25/0x30 __kasan_kmalloc+0x8f/0xa0 open_cached_dir+0x71b/0x1240 [cifs] smb2_query_info_compound+0x5c3/0x6d0 [cifs] smb2_queryfs+0xc2/0x2c0 [cifs] smb311_queryfs+0x210/0x220 [cifs] cifs_statfs+0x18c/0x4b0 [cifs] statfs_by_dentry+0x9b/0xf0 fd_statfs+0x4e/0xb0 __do_sys_fstatfs+0x7f/0xe0 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 Freed by task 27534: kasan_save_stack+0x33/0x60 kasan_set_track+0x25/0x30 kasan_save_free_info+0x2b/0x50 ____kasan_slab_free+0x126/0x170 slab_free_freelist_hook+0xd0/0x1e0 __kmem_cache_free+0x9d/0x1b0 open_cached_dir+0xff5/0x1240 [cifs] smb2_query_info_compound+0x5c3/0x6d0 [cifs] smb2_queryfs+0xc2/0x2c0 [cifs] This is a race between open_cached_dir() and cached_dir_lease_break() where the cache entry for the open directory handle receives a lease break while creating it. And before returning from open_cached_dir(), we put the last reference of the new @cfid because of !@cfid->has_lease. Besides the UAF, while running xfstests a lot of missed lease breaks have been noticed in tests that run several concurrent statfs(2) calls on those cached fids CIFS: VFS: \\w22-root1.gandalf.test No task to wake, unknown frame... CIFS: VFS: \\w22-root1.gandalf.test Cmd: 18 Err: 0x0 Flags: 0x1... CIFS: VFS: \\w22-root1.gandalf.test smb buf 00000000715bfe83 len 108 CIFS: VFS: Dump pending requests: CIFS: VFS: \\w22-root1.gandalf.test No task to wake, unknown frame... CIFS: VFS: \\w22-root1.gandalf.test Cmd: 18 Err: 0x0 Flags: 0x1... CIFS: VFS: \\w22-root1.gandalf.test smb buf 000000005aa7316e len 108 ... To fix both, in open_cached_dir() ensure that @cfid->has_lease is set right before sending out compounded request so that any potential lease break will be get processed by demultiplex thread while we're still caching @cfid. And, if open failed for some reason, re-check @cfid->has_lease to decide whether or not put lease reference. Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit c37ed2d7d09869f30d291b9c6cba56ea4f0b0417 Author: Paulo Alcantara Date: Mon Oct 30 17:19:53 2023 -0300 smb: client: remove extra @chan_count check in __cifs_put_smb_ses() If @ses->chan_count <= 1, then for-loop body will not be executed so no need to check it twice. Reviewed-by: Shyam Prasad N Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit efa5f1311c4998e9e6317c52bc5ee93b3a0f36df Author: Patrick Thompson Date: Mon Oct 30 16:50:14 2023 -0400 net: r8169: Disable multicast filter for RTL8168H and RTL8107E RTL8168H and RTL8107E ethernet adapters erroneously filter unicast eapol packets unless allmulti is enabled. These devices correspond to RTL_GIGA_MAC_VER_46 and VER_48. Add an exception for VER_46 and VER_48 in the same way that VER_35 has an exception. Fixes: 6e1d0b898818 ("r8169:add support for RTL8168H and RTL8107E") Signed-off-by: Patrick Thompson Reviewed-by: Jacob Keller Reviewed-by: Heiner Kallweit Link: https://lore.kernel.org/r/20231030205031.177855-1-ptf@google.com Signed-off-by: Paolo Abeni commit 2966bd3698451a2172a57e7e97eebb4adbfc48a2 Merge: 86098bcddeb10 98a0465531a59 Author: Petr Mladek Date: Thu Nov 2 13:04:59 2023 +0100 Merge branch 'rework/nbcon-base' into for-linus commit 86098bcddeb10ae7975d701c3440d912bd2ebe12 Merge: adb982ad4b9d6 29fda1ad2a64a Author: Petr Mladek Date: Thu Nov 2 13:00:34 2023 +0100 Merge branch 'rework/misc-cleanups' into for-linus commit adb982ad4b9d691f707061fbe90eff80d391a0ef Merge: 9277abd2c1727 72fcce70faf06 Author: Petr Mladek Date: Thu Nov 2 13:00:20 2023 +0100 Merge branch 'for-6.7' into for-linus commit ff2c051fdc70081addbffbb09da1ade704eeaa08 Merge: a1602d7490973 23be1e0e2a83a Author: Paolo Abeni Date: Thu Nov 2 12:56:03 2023 +0100 Merge branch 'dccp-tcp-relocate-security_inet_conn_request' Kuniyuki Iwashima says: ==================== dccp/tcp: Relocate security_inet_conn_request(). security_inet_conn_request() reads reqsk's remote address, but it's not initialised in some places. Let's make sure the address is set before security_inet_conn_request(). ==================== Link: https://lore.kernel.org/r/20231030201042.32885-1-kuniyu@amazon.com Signed-off-by: Paolo Abeni commit 23be1e0e2a83a8543214d2599a31d9a2185a796b Author: Kuniyuki Iwashima Date: Mon Oct 30 13:10:42 2023 -0700 dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. Initially, commit 4237c75c0a35 ("[MLSXFRM]: Auto-labeling of child sockets") introduced security_inet_conn_request() in some functions where reqsk is allocated. The hook is added just after the allocation, so reqsk's IPv6 remote address was not initialised then. However, SELinux/Smack started to read it in netlbl_req_setattr() after commit e1adea927080 ("calipso: Allow request sockets to be relabelled by the lsm."). Commit 284904aa7946 ("lsm: Relocate the IPv4 security_inet_conn_request() hooks") fixed that kind of issue only in TCPv4 because IPv6 labeling was not supported at that time. Finally, the same issue was introduced again in IPv6. Let's apply the same fix on DCCPv6 and TCPv6. Fixes: e1adea927080 ("calipso: Allow request sockets to be relabelled by the lsm.") Signed-off-by: Kuniyuki Iwashima Acked-by: Paul Moore Signed-off-by: Paolo Abeni commit fa2df45af13091f76b89adb84a28f13818d5d631 Author: Kuniyuki Iwashima Date: Mon Oct 30 13:10:41 2023 -0700 dccp: Call security_inet_conn_request() after setting IPv4 addresses. Initially, commit 4237c75c0a35 ("[MLSXFRM]: Auto-labeling of child sockets") introduced security_inet_conn_request() in some functions where reqsk is allocated. The hook is added just after the allocation, so reqsk's IPv4 remote address was not initialised then. However, SELinux/Smack started to read it in netlbl_req_setattr() after the cited commits. This bug was partially fixed by commit 284904aa7946 ("lsm: Relocate the IPv4 security_inet_conn_request() hooks"). This patch fixes the last bug in DCCPv4. Fixes: 389fb800ac8b ("netlabel: Label incoming TCP connections correctly in SELinux") Fixes: 07feee8f812f ("netlabel: Cleanup the Smack/NetLabel code to fix incoming TCP connections") Signed-off-by: Kuniyuki Iwashima Acked-by: Paul Moore Signed-off-by: Paolo Abeni commit a1602d749097386ec9e8e411a16a9c37ff6cd5fc Author: Gerd Bayer Date: Mon Oct 30 18:03:43 2023 +0100 net/smc: fix documentation of buffer sizes Since commit 833bac7ec392 ("net/smc: Fix setsockopt and sysctl to specify same buffer size again") the SMC protocol uses its own default values for the smc.rmem and smc.wmem sysctl variables which are no longer derived from the TCP IPv4 buffer sizes. Fixup the kernel documentation to reflect this change, too. Fixes: 833bac7ec392 ("net/smc: Fix setsockopt and sysctl to specify same buffer size again") Signed-off-by: Gerd Bayer Reviewed-by: Wenjia Zhang Reviewed-by: Dust Li Link: https://lore.kernel.org/r/20231030170343.748097-1-gbayer@linux.ibm.com Signed-off-by: Paolo Abeni commit 8ffbd1669ed1d58939d6e878dffaa2f60bf961a4 Author: Jian Shen Date: Mon Oct 30 17:12:56 2023 +0800 net: page_pool: add missing free_percpu when page_pool_init fail When ptr_ring_init() returns failure in page_pool_init(), free_percpu() is not called to free pool->recycle_stats, which may cause memory leak. Fixes: ad6fa1e1ab1b ("page_pool: Add recycle stats") Signed-off-by: Jian Shen Signed-off-by: Jijie Shao Reviewed-by: Yunsheng Lin Reviewed-by: Jiri Pirko Reviewed-by: Somnath Kotur Reviewed-by: Ilias Apalodimas Link: https://lore.kernel.org/r/20231030091256.2915394-1-shaojijie@huawei.com Signed-off-by: Paolo Abeni commit f55d8e60f10909dbc5524e261041e1d28d7d20d8 Author: Andrew Lunn Date: Sat Oct 28 21:25:11 2023 +0200 net: ethtool: Fix documentation of ethtool_sprintf() This function takes a pointer to a pointer, unlike sprintf() which is passed a plain pointer. Fix up the documentation to make this clear. Fixes: 7888fe53b706 ("ethtool: Add common function for filling out strings") Cc: Alexander Duyck Cc: Justin Stitt Cc: stable@vger.kernel.org Signed-off-by: Andrew Lunn Reviewed-by: Justin Stitt Link: https://lore.kernel.org/r/20231028192511.100001-1-andrew@lunn.ch Signed-off-by: Paolo Abeni commit 5a22fbcc10f3f7d94c5d88afbbffa240a3677057 Author: Alexander Sverdlin Date: Fri Oct 27 08:57:38 2023 +0200 net: dsa: lan9303: consequently nested-lock physical MDIO When LAN9303 is MDIO-connected two callchains exist into mdio->bus->write(): 1. switch ports 1&2 ("physical" PHYs): virtual (switch-internal) MDIO bus (lan9303_switch_ops->phy_{read|write})-> lan9303_mdio_phy_{read|write} -> mdiobus_{read|write}_nested 2. LAN9303 virtual PHY: virtual MDIO bus (lan9303_phy_{read|write}) -> lan9303_virt_phy_reg_{read|write} -> regmap -> lan9303_mdio_{read|write} If the latter functions just take mutex_lock(&sw_dev->device->bus->mdio_lock) it triggers a LOCKDEP false-positive splat. It's false-positive because the first mdio_lock in the second callchain above belongs to virtual MDIO bus, the second mdio_lock belongs to physical MDIO bus. Consequent annotation in lan9303_mdio_{read|write} as nested lock (similar to lan9303_mdio_phy_{read|write}, it's the same physical MDIO bus) prevents the following splat: WARNING: possible circular locking dependency detected 5.15.71 #1 Not tainted ------------------------------------------------------ kworker/u4:3/609 is trying to acquire lock: ffff000011531c68 (lan9303_mdio:131:(&lan9303_mdio_regmap_config)->lock){+.+.}-{3:3}, at: regmap_lock_mutex but task is already holding lock: ffff0000114c44d8 (&bus->mdio_lock){+.+.}-{3:3}, at: mdiobus_read which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&bus->mdio_lock){+.+.}-{3:3}: lock_acquire __mutex_lock mutex_lock_nested lan9303_mdio_read _regmap_read regmap_read lan9303_probe lan9303_mdio_probe mdio_probe really_probe __driver_probe_device driver_probe_device __device_attach_driver bus_for_each_drv __device_attach device_initial_probe bus_probe_device deferred_probe_work_func process_one_work worker_thread kthread ret_from_fork -> #0 (lan9303_mdio:131:(&lan9303_mdio_regmap_config)->lock){+.+.}-{3:3}: __lock_acquire lock_acquire.part.0 lock_acquire __mutex_lock mutex_lock_nested regmap_lock_mutex regmap_read lan9303_phy_read dsa_slave_phy_read __mdiobus_read mdiobus_read get_phy_device mdiobus_scan __mdiobus_register dsa_register_switch lan9303_probe lan9303_mdio_probe mdio_probe really_probe __driver_probe_device driver_probe_device __device_attach_driver bus_for_each_drv __device_attach device_initial_probe bus_probe_device deferred_probe_work_func process_one_work worker_thread kthread ret_from_fork other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&bus->mdio_lock); lock(lan9303_mdio:131:(&lan9303_mdio_regmap_config)->lock); lock(&bus->mdio_lock); lock(lan9303_mdio:131:(&lan9303_mdio_regmap_config)->lock); *** DEADLOCK *** 5 locks held by kworker/u4:3/609: #0: ffff000002842938 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work #1: ffff80000bacbd60 (deferred_probe_work){+.+.}-{0:0}, at: process_one_work #2: ffff000007645178 (&dev->mutex){....}-{3:3}, at: __device_attach #3: ffff8000096e6e78 (dsa2_mutex){+.+.}-{3:3}, at: dsa_register_switch #4: ffff0000114c44d8 (&bus->mdio_lock){+.+.}-{3:3}, at: mdiobus_read stack backtrace: CPU: 1 PID: 609 Comm: kworker/u4:3 Not tainted 5.15.71 #1 Workqueue: events_unbound deferred_probe_work_func Call trace: dump_backtrace show_stack dump_stack_lvl dump_stack print_circular_bug check_noncircular __lock_acquire lock_acquire.part.0 lock_acquire __mutex_lock mutex_lock_nested regmap_lock_mutex regmap_read lan9303_phy_read dsa_slave_phy_read __mdiobus_read mdiobus_read get_phy_device mdiobus_scan __mdiobus_register dsa_register_switch lan9303_probe lan9303_mdio_probe ... Cc: stable@vger.kernel.org Fixes: dc7005831523 ("net: dsa: LAN9303: add MDIO managed mode support") Signed-off-by: Alexander Sverdlin Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20231027065741.534971-1-alexander.sverdlin@siemens.com Signed-off-by: Paolo Abeni commit 7aeeb2cb7a2570bb69a87ad14018b03e06ce5be5 Author: Ratheesh Kannoth Date: Fri Oct 27 07:49:53 2023 +0530 octeontx2-pf: Fix holes in error code Error code strings are not getting printed properly due to holes. Print error code as well. Fixes: 51afe9026d0c ("octeontx2-pf: NIX TX overwrites SQ_CTX_HW_S[SQ_INT]") Signed-off-by: Ratheesh Kannoth Reviewed-by: Wojciech Drewek Link: https://lore.kernel.org/r/20231027021953.1819959-2-rkannoth@marvell.com Signed-off-by: Paolo Abeni commit 96b9a68d1a6e4f889d453874c9e359aa720b520f Author: Ratheesh Kannoth Date: Fri Oct 27 07:49:52 2023 +0530 octeontx2-pf: Fix error codes Some of error codes were wrong. Fix the same. Fixes: 51afe9026d0c ("octeontx2-pf: NIX TX overwrites SQ_CTX_HW_S[SQ_INT]") Signed-off-by: Ratheesh Kannoth Reviewed-by: Wojciech Drewek Link: https://lore.kernel.org/r/20231027021953.1819959-1-rkannoth@marvell.com Signed-off-by: Paolo Abeni commit 63f1ee206170ad2363aa25fd99bd5ae529c690ae Author: Masami Hiramatsu Date: Thu Oct 26 00:10:05 2023 +0900 locking/atomic: sh: Use generic_cmpxchg_local for arch_cmpxchg_local() Use __generic_cmpxchg_local() for arch_cmpxchg_local() implementation on SH architecture because it does not implement arch_cmpxchg_local(). Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310241310.Ir5uukOG-lkp@intel.com/ Signed-off-by: Masami Hiramatsu (Google) Reviewed-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/169824660459.24340.14614817132696360531.stgit@devnote2 Signed-off-by: John Paul Adrian Glaubitz commit 1726483b79a72e0150734d5367e4a0238bf8fcff Author: Eric Dumazet Date: Wed Oct 25 14:10:37 2023 +0000 inet: shrink struct flowi_common I am looking at syzbot reports triggering kernel stack overflows involving a cascade of ipvlan devices. We can save 8 bytes in struct flowi_common. This patch alone will not fix the issue, but is a start. Fixes: 24ba14406c5c ("route: Add multipath_hash in flowi_common to make user-define hash") Signed-off-by: Eric Dumazet Cc: wenxu Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20231025141037.3448203-1-edumazet@google.com Signed-off-by: Paolo Abeni commit 21e80f3841c01aeaf32d7aee7bbc87b3db1aa0c6 Merge: 426ee5196d182 ea0b0bcef4917 Author: Linus Torvalds Date: Wed Nov 1 21:09:37 2023 -1000 Merge tag 'modules-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull modules updates from Luis Chamberlain: "The only thing worth highligthing is that gzip moves to use vmalloc() instead of kmalloc just as we had a fix for this for zstd on v6.6-rc1. The rest is regular house keeping, keeping things neat, tidy, and boring" [ The kmalloc -> vmalloc conversion is not the right approach. Unless you know you need huge areas or know you need to use virtual mappings for some reason (playing with protection bits or whatever), you should use kvmalloc()/kvfree, which automatically picks the right allocation model - Linus ] * tag 'modules-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: module: Annotate struct module_notes_attrs with __counted_by module: Fix comment typo module: Make is_valid_name() return bool module: Make is_mapping_symbol() return bool module/decompress: use vmalloc() for gzip decompression workspace MAINTAINERS: add include/linux/module*.h to modules module: Clarify documentation of module_param_call() commit 426ee5196d1821d70192923e70c0f8347faade47 Merge: babe393974de0 8b793bcda61f6 Author: Linus Torvalds Date: Wed Nov 1 20:51:41 2023 -1000 Merge tag 'sysctl-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull sysctl updates from Luis Chamberlain: "To help make the move of sysctls out of kernel/sysctl.c not incur a size penalty sysctl has been changed to allow us to not require the sentinel, the final empty element on the sysctl array. Joel Granados has been doing all this work. On the v6.6 kernel we got the major infrastructure changes required to support this. For v6.7-rc1 we have all arch/ and drivers/ modified to remove the sentinel. Both arch and driver changes have been on linux-next for a bit less than a month. It is worth re-iterating the value: - this helps reduce the overall build time size of the kernel and run time memory consumed by the kernel by about ~64 bytes per array - the extra 64-byte penalty is no longer inncurred now when we move sysctls out from kernel/sysctl.c to their own files For v6.8-rc1 expect removal of all the sentinels and also then the unneeded check for procname == NULL. The last two patches are fixes recently merged by Krister Johansen which allow us again to use softlockup_panic early on boot. This used to work but the alias work broke it. This is useful for folks who want to detect softlockups super early rather than wait and spend money on cloud solutions with nothing but an eventual hung kernel. Although this hadn't gone through linux-next it's also a stable fix, so we might as well roll through the fixes now" * tag 'sysctl-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: (23 commits) watchdog: move softlockup_panic back to early_param proc: sysctl: prevent aliased sysctls from getting passed to init intel drm: Remove now superfluous sentinel element from ctl_table array Drivers: hv: Remove now superfluous sentinel element from ctl_table array raid: Remove now superfluous sentinel element from ctl_table array fw loader: Remove the now superfluous sentinel element from ctl_table array sgi-xp: Remove the now superfluous sentinel element from ctl_table array vrf: Remove the now superfluous sentinel element from ctl_table array char-misc: Remove the now superfluous sentinel element from ctl_table array infiniband: Remove the now superfluous sentinel element from ctl_table array macintosh: Remove the now superfluous sentinel element from ctl_table array parport: Remove the now superfluous sentinel element from ctl_table array scsi: Remove now superfluous sentinel element from ctl_table array tty: Remove now superfluous sentinel element from ctl_table array xen: Remove now superfluous sentinel element from ctl_table array hpet: Remove now superfluous sentinel element from ctl_table array c-sky: Remove now superfluous sentinel element from ctl_talbe array powerpc: Remove now superfluous sentinel element from ctl_table arrays riscv: Remove now superfluous sentinel element from ctl_table array x86/vdso: Remove now superfluous sentinel element from ctl_table array ... commit 94e88b8a3e50d3e60c3ba6a5c316729587595210 Merge: 698b8c5e3b550 3c41971550f58 Author: Alexei Starovoitov Date: Wed Nov 1 22:54:28 2023 -0700 Merge branch 'bpf-fix-precision-tracking-for-bpf_alu-bpf_to_be-bpf_end' Shung-Hsi Yu says: ==================== bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END Changes since v1: - add test for negation and bswap (Alexei, Eduard) - add test for BPF_TO_LE as well to cover all types of BPF_END opcode - remove vals map and trigger backtracking with jump instead, based of Eduard's code - v1 at https://lore.kernel.org/bpf/20231030132145.20867-1-shung-hsi.yu@suse.com This patchset fixes and adds selftest for the issue reported by Mohamed Mahmoud and Toke Høiland-Jørgensen where the kernel can run into a verifier bug during backtracking of BPF_ALU | BPF_TO_BE | BPF_END instruction[0]. As seen in the verifier log below, r0 was incorrectly marked as precise even tough its value was not being used. Patch 1 fixes the issue based on Andrii's analysis, and patch 2 adds a selftest for such case using inline assembly. Please see individual patch for detail. ... mark_precise: frame2: regs=r2 stack= before 1891: (77) r2 >>= 56 mark_precise: frame2: regs=r2 stack= before 1890: (dc) r2 = be64 r2 mark_precise: frame2: regs=r0,r2 stack= before 1889: (73) *(u8 *)(r1 +47) = r3 ... mark_precise: frame2: regs=r0 stack= before 212: (85) call pc+1617 BUG regs 1 processed 5112 insns (limit 1000000) max_states_per_insn 4 total_states 92 peak_states 90 mark_read 20 0: https://lore.kernel.org/r/87jzrrwptf.fsf@toke.dk Shung-Hsi Yu (2): bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END selftests/bpf: precision tracking test for BPF_NEG and BPF_END kernel/bpf/verifier.c | 7 +- .../selftests/bpf/prog_tests/verifier.c | 2 + .../selftests/bpf/progs/verifier_precision.c | 93 +++++++++++++++++++ 3 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/bpf/progs/verifier_precision.c base-commit: c17cda15cc86e65e9725641daddcd7a63cc9ad01 ==================== Link: https://lore.kernel.org/r/20231102053913.12004-1-shung-hsi.yu@suse.com Signed-off-by: Alexei Starovoitov commit 3c41971550f58f2e006c58aa71e8c23ad312110f Author: Shung-Hsi Yu Date: Thu Nov 2 13:39:05 2023 +0800 selftests/bpf: precision tracking test for BPF_NEG and BPF_END As seen from previous commit that fix backtracking for BPF_ALU | BPF_TO_BE | BPF_END, both BPF_NEG and BPF_END require special handling. Add tests written with inline assembly to check that the verifier does not incorrecly use the src_reg field of BPF_NEG and BPF_END (including bswap added in v4). Suggested-by: Eduard Zingerman Signed-off-by: Shung-Hsi Yu Link: https://lore.kernel.org/r/20231102053913.12004-4-shung-hsi.yu@suse.com Signed-off-by: Alexei Starovoitov commit 291d044fd51f8484066300ee42afecf8c8db7b3a Author: Shung-Hsi Yu Date: Thu Nov 2 13:39:03 2023 +0800 bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END BPF_END and BPF_NEG has a different specification for the source bit in the opcode compared to other ALU/ALU64 instructions, and is either reserved or use to specify the byte swap endianness. In both cases the source bit does not encode source operand location, and src_reg is a reserved field. backtrack_insn() currently does not differentiate BPF_END and BPF_NEG from other ALU/ALU64 instructions, which leads to r0 being incorrectly marked as precise when processing BPF_ALU | BPF_TO_BE | BPF_END instructions. This commit teaches backtrack_insn() to correctly mark precision for such case. While precise tracking of BPF_NEG and other BPF_END instructions are correct and does not need fixing, this commit opt to process all BPF_NEG and BPF_END instructions within the same if-clause to better align with current convention used in the verifier (e.g. check_alu_op). Fixes: b5dc0163d8fd ("bpf: precise scalar_value tracking") Cc: stable@vger.kernel.org Reported-by: Mohamed Mahmoud Closes: https://lore.kernel.org/r/87jzrrwptf.fsf@toke.dk Tested-by: Toke Høiland-Jørgensen Tested-by: Tao Lyu Acked-by: Eduard Zingerman Signed-off-by: Shung-Hsi Yu Link: https://lore.kernel.org/r/20231102053913.12004-2-shung-hsi.yu@suse.com Signed-off-by: Alexei Starovoitov commit 698b8c5e3b5505ac00102caf9e4843b71192b586 Merge: 9af3775962afa d8234d47c4aa4 Author: Alexei Starovoitov Date: Wed Nov 1 22:49:20 2023 -0700 Merge branch 'relax-allowlist-for-open-coded-css_task-iter' Chuyi Zhou says: ==================== Relax allowlist for open-coded css_task iter Hi, The patchset aims to relax the allowlist for open-coded css_task iter suggested by Alexei[1]. Please see individual patches for more details. And comments are always welcome. Patch summary: * Patch #1: Relax the allowlist and let css_task iter can be used in bpf iters and any sleepable progs. * Patch #2: Add a test in cgroup_iters.c which demonstrates how css_task iters can be combined with cgroup iter. * Patch #3: Add a test to prove css_task iter can be used in normal * sleepable progs. link[1]:https://lore.kernel.org/lkml/CAADnVQKafk_junRyE=-FVAik4hjTRDtThymYGEL8hGTuYoOGpA@mail.gmail.com/ --- Changes in v2: * Fix the incorrect logic in check_css_task_iter_allowlist. Use expected_attach_type to check whether we are using bpf_iters. * Link to v1:https://lore.kernel.org/bpf/20231022154527.229117-1-zhouchuyi@bytedance.com/T/#m946f9cde86b44a13265d9a44c5738a711eb578fd Changes in v3: * Add a testcase to prove css_task can be used in fentry.s * Link to v2:https://lore.kernel.org/bpf/20231024024240.42790-1-zhouchuyi@bytedance.com/T/#m14a97041ff56c2df21bc0149449abd275b73f6a3 Changes in v4: * Add Yonghong's ack for patch #1 and patch #2. * Solve Yonghong's comments for patch #2 * Move prog 'iter_css_task_for_each_sleep' from iters_task_failure.c to iters_css_task.c. Use RUN_TESTS to prove we can load this prog. * Link to v3:https://lore.kernel.org/bpf/20231025075914.30979-1-zhouchuyi@bytedance.com/T/#m3200d8ad29af4ffab97588e297361d0a45d7585d --- ==================== Link: https://lore.kernel.org/r/20231031050438.93297-1-zhouchuyi@bytedance.com Signed-off-by: Alexei Starovoitov commit d8234d47c4aa494d789b85562fa90e837b4575f9 Author: Chuyi Zhou Date: Tue Oct 31 13:04:38 2023 +0800 selftests/bpf: Add test for using css_task iter in sleepable progs This Patch add a test to prove css_task iter can be used in normal sleepable progs. Signed-off-by: Chuyi Zhou Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20231031050438.93297-4-zhouchuyi@bytedance.com Signed-off-by: Alexei Starovoitov commit f49843afde6771ef6ed5d021eacafacfc98a58bf Author: Chuyi Zhou Date: Tue Oct 31 13:04:37 2023 +0800 selftests/bpf: Add tests for css_task iter combining with cgroup iter This patch adds a test which demonstrates how css_task iter can be combined with cgroup iter and it won't cause deadlock, though cgroup iter is not sleepable. Signed-off-by: Chuyi Zhou Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20231031050438.93297-3-zhouchuyi@bytedance.com Signed-off-by: Alexei Starovoitov commit 3091b667498b0a212e760e1033e5f9b8c33a948f Author: Chuyi Zhou Date: Tue Oct 31 13:04:36 2023 +0800 bpf: Relax allowlist for css_task iter The newly added open-coded css_task iter would try to hold the global css_set_lock in bpf_iter_css_task_new, so the bpf side has to be careful in where it allows to use this iter. The mainly concern is dead locking on css_set_lock. check_css_task_iter_allowlist() in verifier enforced css_task can only be used in bpf_lsm hooks and sleepable bpf_iter. This patch relax the allowlist for css_task iter. Any lsm and any iter (even non-sleepable) and any sleepable are safe since they would not hold the css_set_lock before entering BPF progs context. This patch also fixes the misused BPF_TRACE_ITER in check_css_task_iter_allowlist which compared bpf_prog_type with bpf_attach_type. Fixes: 9c66dc94b62ae ("bpf: Introduce css_task open-coded iterator kfuncs") Signed-off-by: Chuyi Zhou Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20231031050438.93297-2-zhouchuyi@bytedance.com Signed-off-by: Alexei Starovoitov commit 9af3775962afa8b5cd0cc30c1e454405a650c1f3 Author: Andrii Nakryiko Date: Sat Oct 28 18:15:09 2023 -0700 selftests/bpf: fix test_maps' use of bpf_map_create_opts Use LIBBPF_OPTS() macro to properly initialize bpf_map_create_opts in test_maps' tests. Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20231029011509.2479232-1-andrii@kernel.org Signed-off-by: Alexei Starovoitov commit fd381ce60a2d79cc967506208085336d3d268ae0 Author: Hou Tao Date: Mon Oct 30 14:36:16 2023 +0800 bpf: Check map->usercnt after timer->timer is assigned When there are concurrent uref release and bpf timer init operations, the following sequence diagram is possible. It will break the guarantee provided by bpf_timer: bpf_timer will still be alive after userspace application releases or unpins the map. It also will lead to kmemleak for old kernel version which doesn't release bpf_timer when map is released. bpf program X: bpf_timer_init() lock timer->lock read timer->timer as NULL read map->usercnt != 0 process Y: close(map_fd) // put last uref bpf_map_put_uref() atomic_dec_and_test(map->usercnt) array_map_free_timers() bpf_timer_cancel_and_free() // just return read timer->timer is NULL t = bpf_map_kmalloc_node() timer->timer = t unlock timer->lock Fix the problem by checking map->usercnt after timer->timer is assigned, so when there are concurrent uref release and bpf timer init, either bpf_timer_cancel_and_free() from uref release reads a no-NULL timer or the newly-added atomic64_read() returns a zero usercnt. Because atomic_dec_and_test(map->usercnt) and READ_ONCE(timer->timer) in bpf_timer_cancel_and_free() are not protected by a lock, so add a memory barrier to guarantee the order between map->usercnt and timer->timer. Also use WRITE_ONCE(timer->timer, x) to match the lockless read of timer->timer in bpf_timer_cancel_and_free(). Reported-by: Hsin-Wei Hung Closes: https://lore.kernel.org/bpf/CABcoxUaT2k9hWsS1tNgXyoU3E-=PuOgMn737qK984fbFmfYixQ@mail.gmail.com Fixes: b00628b1c7d5 ("bpf: Introduce bpf timers.") Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20231030063616.1653024-1-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 5b5b5806f22390808b8e8fa180fe35b003a4a74d Author: Varadarajan Narayanan Date: Tue Oct 31 12:41:39 2023 +0530 cpufreq: qcom-nvmem: Introduce cpufreq for ipq95xx IPQ95xx SoCs have different OPPs available for the CPU based on the SoC variant. This can be determined from an eFuse register present in the silicon. Added support for ipq95xx on nvmem driver which helps to determine OPPs at runtime based on the eFuse register which has the CPU frequency limits. opp-supported-hw dt binding can be used to indicate the available OPPs for each limit. Reviewed-by: Dmitry Baryshkov Signed-off-by: Praveenkumar I Signed-off-by: Kathiravan T Signed-off-by: Varadarajan Narayanan [ Viresh: Fixed subject ] Signed-off-by: Viresh Kumar commit ba5a61a08d83b18b99c461b4ddb9009947a4aa0e Author: Varadarajan Narayanan Date: Tue Oct 31 12:41:38 2023 +0530 cpufreq: qcom-nvmem: Enable cpufreq for ipq53xx IPQ53xx have different OPPs available for the CPU based on SoC variant. This can be determined through use of an eFuse register present in the silicon. Added support for ipq53xx on nvmem driver which helps to determine OPPs at runtime based on the eFuse register which has the CPU frequency limits. opp-supported-hw dt binding can be used to indicate the available OPPs for each limit. nvmem driver also creates the "cpufreq-dt" platform_device after passing the version matching data to the OPP framework so that the cpufreq-dt handles the actual cpufreq implementation. Reviewed-by: Dmitry Baryshkov Reviewed-by: Bryan O'Donoghue Signed-off-by: Kathiravan T Signed-off-by: Varadarajan Narayanan [ Viresh: Fixed subject ] Signed-off-by: Viresh Kumar commit 0b9cd949136f1b63f7aa9424b6e583a1ab261e36 Author: Robert Marko Date: Fri Oct 13 19:20:02 2023 +0200 cpufreq: qcom-nvmem: add support for IPQ8074 IPQ8074 comes in 3 families: * IPQ8070A/IPQ8071A (Acorn) up to 1.4GHz * IPQ8172/IPQ8173/IPQ8174 (Oak) up to 1.4GHz * IPQ8072A/IPQ8074A/IPQ8076A/IPQ8078A (Hawkeye) up to 2.2GHz So, in order to be able to share one OPP table lets add support for IPQ8074 family based of SMEM SoC ID-s as speedbin fuse is always 0 on IPQ8074. IPQ8074 compatible is blacklisted from DT platdev as the cpufreq device will get created by NVMEM CPUFreq driver. Signed-off-by: Robert Marko Acked-by: Konrad Dybcio [ Viresh: Fixed rebase conflict. ] Signed-off-by: Viresh Kumar commit 477348dbfd37d3f4c813ff8e62ec96a6bbbfd06a Merge: 038ef0d990a0a e9104e73d4fc8 Author: Viresh Kumar Date: Thu Nov 2 11:04:33 2023 +0530 Merge branch 'cpufreq/arm/qcom-nvmem' into HEAD Merge base changes for cpufreq support for IPQ8074. commit 15fb6f2b6c4c3c129adc2412ae12ec15e60a6adb Author: Dave Marchevsky Date: Tue Oct 31 14:56:25 2023 -0700 bpf: Add __bpf_hook_{start,end} macros Not all uses of __diag_ignore_all(...) in BPF-related code in order to suppress warnings are wrapping kfunc definitions. Some "hook point" definitions - small functions meant to be used as attach points for fentry and similar BPF progs - need to suppress -Wmissing-declarations. We could use __bpf_kfunc_{start,end}_defs added in the previous patch in such cases, but this might be confusing to someone unfamiliar with BPF internals. Instead, this patch adds __bpf_hook_{start,end} macros, currently having the same effect as __bpf_kfunc_{start,end}_defs, then uses them to suppress warnings for two hook points in the kernel itself and some bpf_testmod hook points as well. Signed-off-by: Dave Marchevsky Cc: Yafang Shao Acked-by: Jiri Olsa Acked-by: Yafang Shao Link: https://lore.kernel.org/r/20231031215625.2343848-2-davemarchevsky@fb.com Signed-off-by: Alexei Starovoitov commit 391145ba2accc48b596f3d438af1a6255b62a555 Author: Dave Marchevsky Date: Tue Oct 31 14:56:24 2023 -0700 bpf: Add __bpf_kfunc_{start,end}_defs macros BPF kfuncs are meant to be called from BPF programs. Accordingly, most kfuncs are not called from anywhere in the kernel, which the -Wmissing-prototypes warning is unhappy about. We've peppered __diag_ignore_all("-Wmissing-prototypes", ... everywhere kfuncs are defined in the codebase to suppress this warning. This patch adds two macros meant to bound one or many kfunc definitions. All existing kfunc definitions which use these __diag calls to suppress -Wmissing-prototypes are migrated to use the newly-introduced macros. A new __diag_ignore_all - for "-Wmissing-declarations" - is added to the __bpf_kfunc_start_defs macro based on feedback from Andrii on an earlier version of this patch [0] and another recent mailing list thread [1]. In the future we might need to ignore different warnings or do other kfunc-specific things. This change will make it easier to make such modifications for all kfunc defs. [0]: https://lore.kernel.org/bpf/CAEf4BzaE5dRWtK6RPLnjTW-MW9sx9K3Fn6uwqCTChK2Dcb1Xig@mail.gmail.com/ [1]: https://lore.kernel.org/bpf/ZT+2qCc%2FaXep0%2FLf@krava/ Signed-off-by: Dave Marchevsky Suggested-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Cc: Jiri Olsa Acked-by: Jiri Olsa Acked-by: David Vernet Acked-by: Yafang Shao Link: https://lore.kernel.org/r/20231031215625.2343848-1-davemarchevsky@fb.com Signed-off-by: Alexei Starovoitov commit cd60f410ddc0cd663045d15936155421b6f708fd Author: Manu Bretelle Date: Tue Oct 31 15:36:06 2023 -0700 selftests/bpf: fix test_bpffs Currently this tests tries to umount /sys/kernel/debug (TDIR) but the system it is running on may have mounts below. For example, danobi/vmtest [0] VMs have mount -t tracefs tracefs /sys/kernel/debug/tracing as part of their init. This change instead creates a "random" directory under /tmp and uses this as TDIR. If the directory already exists, ignore the error and keep moving on. Test: Originally: $ vmtest -k $KERNEL_REPO/arch/x86_64/boot/bzImage "./test_progs -vv -a test_bpffs" => bzImage ===> Booting ===> Setting up VM ===> Running command [ 2.138818] bpf_testmod: loading out-of-tree module taints kernel. [ 2.140913] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel bpf_testmod.ko is already unloaded. Loading bpf_testmod.ko... Successfully loaded bpf_testmod.ko. test_test_bpffs:PASS:clone 0 nsec fn:PASS:unshare 0 nsec fn:PASS:mount / 0 nsec fn:FAIL:umount /sys/kernel/debug unexpected error: -1 (errno 16) bpf_testmod.ko is already unloaded. Loading bpf_testmod.ko... Successfully loaded bpf_testmod.ko. test_test_bpffs:PASS:clone 0 nsec test_test_bpffs:PASS:waitpid 0 nsec test_test_bpffs:FAIL:bpffs test failed 255#282 test_bpffs:FAIL Summary: 0/0 PASSED, 0 SKIPPED, 1 FAILED Successfully unloaded bpf_testmod.ko. Command failed with exit code: 1 After this change: $ vmtest -k $(make image_name) 'cd tools/testing/selftests/bpf && ./test_progs -vv -a test_bpffs' => bzImage ===> Booting ===> Setting up VM ===> Running command [ 2.295696] bpf_testmod: loading out-of-tree module taints kernel. [ 2.296468] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel bpf_testmod.ko is already unloaded. Loading bpf_testmod.ko... Successfully loaded bpf_testmod.ko. test_test_bpffs:PASS:clone 0 nsec fn:PASS:unshare 0 nsec fn:PASS:mount / 0 nsec fn:PASS:mount tmpfs 0 nsec fn:PASS:mkdir /tmp/test_bpffs_testdir/fs1 0 nsec fn:PASS:mkdir /tmp/test_bpffs_testdir/fs2 0 nsec fn:PASS:mount bpffs /tmp/test_bpffs_testdir/fs1 0 nsec fn:PASS:mount bpffs /tmp/test_bpffs_testdir/fs2 0 nsec fn:PASS:reading /tmp/test_bpffs_testdir/fs1/maps.debug 0 nsec fn:PASS:reading /tmp/test_bpffs_testdir/fs2/progs.debug 0 nsec fn:PASS:creating /tmp/test_bpffs_testdir/fs1/a 0 nsec fn:PASS:creating /tmp/test_bpffs_testdir/fs1/a/1 0 nsec fn:PASS:creating /tmp/test_bpffs_testdir/fs1/b 0 nsec fn:PASS:create_map(ARRAY) 0 nsec fn:PASS:pin map 0 nsec fn:PASS:stat(/tmp/test_bpffs_testdir/fs1/a) 0 nsec fn:PASS:renameat2(/fs1/a, /fs1/b, RENAME_EXCHANGE) 0 nsec fn:PASS:stat(/tmp/test_bpffs_testdir/fs1/b) 0 nsec fn:PASS:b should have a's inode 0 nsec fn:PASS:access(/tmp/test_bpffs_testdir/fs1/b/1) 0 nsec fn:PASS:stat(/tmp/test_bpffs_testdir/fs1/map) 0 nsec fn:PASS:renameat2(/fs1/c, /fs1/b, RENAME_EXCHANGE) 0 nsec fn:PASS:stat(/tmp/test_bpffs_testdir/fs1/b) 0 nsec fn:PASS:b should have c's inode 0 nsec fn:PASS:access(/tmp/test_bpffs_testdir/fs1/c/1) 0 nsec fn:PASS:renameat2(RENAME_NOREPLACE) 0 nsec fn:PASS:access(/tmp/test_bpffs_testdir/fs1/b) 0 nsec bpf_testmod.ko is already unloaded. Loading bpf_testmod.ko... Successfully loaded bpf_testmod.ko. test_test_bpffs:PASS:clone 0 nsec test_test_bpffs:PASS:waitpid 0 nsec test_test_bpffs:PASS:bpffs test 0 nsec #282 test_bpffs:OK Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED Successfully unloaded bpf_testmod.ko. [0] https://github.com/danobi/vmtest This is a follow-up of https://lore.kernel.org/bpf/20231024201852.1512720-1-chantr4@gmail.com/T/ v1 -> v2: - use a TDIR name that is related to test - use C-style comments Signed-off-by: Manu Bretelle Acked-by: Jiri Olsa Link: https://lore.kernel.org/r/20231031223606.2927976-1-chantr4@gmail.com Signed-off-by: Alexei Starovoitov commit b479d38ba959a8e3ffc4d9f760a9f2e4b9027e66 Merge: 05670f81d1287 85eb035e6cfd6 Author: Alexei Starovoitov Date: Wed Nov 1 22:30:27 2023 -0700 Merge branch 'bpf-fix-incorrect-immediate-spill' Hao Sun says: ==================== bpf: Fix incorrect immediate spill Immediate is incorrectly cast to u32 before being spilled, losing sign information. The range information is incorrect after load again. Fix immediate spill by remove the cast. The second patch add a test case for this. Signed-off-by: Hao Sun --- Changes in v3: - Change the expected log to fix the test case - Link to v2: https://lore.kernel.org/r/20231101-fix-check-stack-write-v2-0-cb7c17b869b0@gmail.com Changes in v2: - Add fix and cc tags. - Link to v1: https://lore.kernel.org/r/20231026-fix-check-stack-write-v1-0-6b325ef3ce7e@gmail.com --- ==================== Link: https://lore.kernel.org/r/20231101-fix-check-stack-write-v3-0-f05c2b1473d5@gmail.com Signed-off-by: Alexei Starovoitov commit 85eb035e6cfd615071256592e1dbe72c1d99c24b Author: Hao Sun Date: Wed Nov 1 13:33:52 2023 +0100 selftests/bpf: Add test for immediate spilled to stack Add a test to check if the verifier correctly reason about the sign of an immediate spilled to stack by BPF_ST instruction. Signed-off-by: Hao Sun Link: https://lore.kernel.org/r/20231101-fix-check-stack-write-v3-2-f05c2b1473d5@gmail.com Signed-off-by: Alexei Starovoitov commit 811c363645b33e6e22658634329e95f383dfc705 Author: Hao Sun Date: Wed Nov 1 13:33:51 2023 +0100 bpf: Fix check_stack_write_fixed_off() to correctly spill imm In check_stack_write_fixed_off(), imm value is cast to u32 before being spilled to the stack. Therefore, the sign information is lost, and the range information is incorrect when load from the stack again. For the following prog: 0: r2 = r10 1: *(u64*)(r2 -40) = -44 2: r0 = *(u64*)(r2 - 40) 3: if r0 s<= 0xa goto +2 4: r0 = 1 5: exit 6: r0 = 0 7: exit The verifier gives: func#0 @0 0: R1=ctx(off=0,imm=0) R10=fp0 0: (bf) r2 = r10 ; R2_w=fp0 R10=fp0 1: (7a) *(u64 *)(r2 -40) = -44 ; R2_w=fp0 fp-40_w=4294967252 2: (79) r0 = *(u64 *)(r2 -40) ; R0_w=4294967252 R2_w=fp0 fp-40_w=4294967252 3: (c5) if r0 s< 0xa goto pc+2 mark_precise: frame0: last_idx 3 first_idx 0 subseq_idx -1 mark_precise: frame0: regs=r0 stack= before 2: (79) r0 = *(u64 *)(r2 -40) 3: R0_w=4294967252 4: (b7) r0 = 1 ; R0_w=1 5: (95) exit verification time 7971 usec stack depth 40 processed 6 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0 So remove the incorrect cast, since imm field is declared as s32, and __mark_reg_known() takes u64, so imm would be correctly sign extended by compiler. Fixes: ecdf985d7615 ("bpf: track immediate values written to stack by BPF_ST instruction") Cc: stable@vger.kernel.org Signed-off-by: Hao Sun Acked-by: Shung-Hsi Yu Acked-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231101-fix-check-stack-write-v3-1-f05c2b1473d5@gmail.com Signed-off-by: Alexei Starovoitov commit 61e4a86600029e6e8d468d1fad6b6c749bebed19 Author: David Howells Date: Fri Oct 27 00:49:34 2023 +0100 rxrpc: Fix two connection reaping bugs Fix two connection reaping bugs: (1) rxrpc_connection_expiry is in units of seconds, so rxrpc_disconnect_call() needs to multiply it by HZ when adding it to jiffies. (2) rxrpc_client_conn_reap_timeout() should set RXRPC_CLIENT_REAP_TIMER if local->kill_all_client_conns is clear, not if it is set (in which case we don't need the timer). Without this, old client connections don't get cleaned up until the local endpoint is cleaned up. Fixes: 5040011d073d ("rxrpc: Make the local endpoint hold a ref on a connected call") Fixes: 0d6bf319bc5a ("rxrpc: Move the client conn cache management to the I/O thread") Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/783911.1698364174@warthog.procyon.org.uk Signed-off-by: Jakub Kicinski commit 05670f81d1287c40ec861186e4c4e3401013e7fb Author: Matthieu Baerts Date: Wed Nov 1 19:16:01 2023 +0100 bpf: fix compilation error without CGROUPS Our MPTCP CI complained [1] -- and KBuild too -- that it was no longer possible to build the kernel without CONFIG_CGROUPS: kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_new': kernel/bpf/task_iter.c:919:14: error: 'CSS_TASK_ITER_PROCS' undeclared (first use in this function) 919 | case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED: | ^~~~~~~~~~~~~~~~~~~ kernel/bpf/task_iter.c:919:14: note: each undeclared identifier is reported only once for each function it appears in kernel/bpf/task_iter.c:919:36: error: 'CSS_TASK_ITER_THREADED' undeclared (first use in this function) 919 | case CSS_TASK_ITER_PROCS | CSS_TASK_ITER_THREADED: | ^~~~~~~~~~~~~~~~~~~~~~ kernel/bpf/task_iter.c:927:60: error: invalid application of 'sizeof' to incomplete type 'struct css_task_iter' 927 | kit->css_it = bpf_mem_alloc(&bpf_global_ma, sizeof(struct css_task_iter)); | ^~~~~~ kernel/bpf/task_iter.c:930:9: error: implicit declaration of function 'css_task_iter_start'; did you mean 'task_seq_start'? [-Werror=implicit-function-declaration] 930 | css_task_iter_start(css, flags, kit->css_it); | ^~~~~~~~~~~~~~~~~~~ | task_seq_start kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_next': kernel/bpf/task_iter.c:940:16: error: implicit declaration of function 'css_task_iter_next'; did you mean 'class_dev_iter_next'? [-Werror=implicit-function-declaration] 940 | return css_task_iter_next(kit->css_it); | ^~~~~~~~~~~~~~~~~~ | class_dev_iter_next kernel/bpf/task_iter.c:940:16: error: returning 'int' from a function with return type 'struct task_struct *' makes pointer from integer without a cast [-Werror=int-conversion] 940 | return css_task_iter_next(kit->css_it); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ kernel/bpf/task_iter.c: In function 'bpf_iter_css_task_destroy': kernel/bpf/task_iter.c:949:9: error: implicit declaration of function 'css_task_iter_end' [-Werror=implicit-function-declaration] 949 | css_task_iter_end(kit->css_it); | ^~~~~~~~~~~~~~~~~ This patch simply surrounds with a #ifdef the new code requiring CGroups support. It seems enough for the compiler and this is similar to bpf_iter_css_{new,next,destroy}() functions where no other #ifdef have been added in kernel/bpf/helpers.c and in the selftests. Fixes: 9c66dc94b62a ("bpf: Introduce css_task open-coded iterator kfuncs") Link: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/6665206927 Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310260528.aHWgVFqq-lkp@intel.com/ Signed-off-by: Matthieu Baerts [ added missing ifdefs for BTF_ID cgroup definitions ] Signed-off-by: Jiri Olsa Link: https://lore.kernel.org/r/20231101181601.1493271-1-jolsa@kernel.org Signed-off-by: Alexei Starovoitov commit 74da77921333171766031ea213b11f1e650814f9 Author: Dan Carpenter Date: Tue Oct 31 12:51:09 2023 +0300 net/tcp_sigpool: Fix some off by one bugs The "cpool_populated" variable is the number of elements in the cpool[] array that have been populated. It is incremented in tcp_sigpool_alloc_ahash() every time we populate a new element. Unpopulated elements are NULL but if we have populated every element then this code will read one element beyond the end of the array. Fixes: 8c73b26315aa ("net/tcp: Prepare tcp_md5sig_pool for TCP-AO") Signed-off-by: Dan Carpenter Reviewed-by: Dmitry Safonov Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/ce915d61-04bc-44fb-b450-35fcc9fc8831@moroto.mountain Signed-off-by: Jakub Kicinski commit 19b3f72a41a8751e26bffc093bb7e1cef29ad579 Author: Shigeru Yoshida Date: Mon Oct 30 16:55:40 2023 +0900 tipc: Change nla_policy for bearer-related names to NLA_NUL_STRING syzbot reported the following uninit-value access issue [1]: ===================================================== BUG: KMSAN: uninit-value in strlen lib/string.c:418 [inline] BUG: KMSAN: uninit-value in strstr+0xb8/0x2f0 lib/string.c:756 strlen lib/string.c:418 [inline] strstr+0xb8/0x2f0 lib/string.c:756 tipc_nl_node_reset_link_stats+0x3ea/0xb50 net/tipc/node.c:2595 genl_family_rcv_msg_doit net/netlink/genetlink.c:971 [inline] genl_family_rcv_msg net/netlink/genetlink.c:1051 [inline] genl_rcv_msg+0x11ec/0x1290 net/netlink/genetlink.c:1066 netlink_rcv_skb+0x371/0x650 net/netlink/af_netlink.c:2545 genl_rcv+0x40/0x60 net/netlink/genetlink.c:1075 netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline] netlink_unicast+0xf47/0x1250 net/netlink/af_netlink.c:1368 netlink_sendmsg+0x1238/0x13d0 net/netlink/af_netlink.c:1910 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg net/socket.c:753 [inline] ____sys_sendmsg+0x9c2/0xd60 net/socket.c:2541 ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2595 __sys_sendmsg net/socket.c:2624 [inline] __do_sys_sendmsg net/socket.c:2633 [inline] __se_sys_sendmsg net/socket.c:2631 [inline] __x64_sys_sendmsg+0x307/0x490 net/socket.c:2631 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Uninit was created at: slab_post_alloc_hook+0x12f/0xb70 mm/slab.h:767 slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x577/0xa80 mm/slub.c:3523 kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:559 __alloc_skb+0x318/0x740 net/core/skbuff.c:650 alloc_skb include/linux/skbuff.h:1286 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1214 [inline] netlink_sendmsg+0xb34/0x13d0 net/netlink/af_netlink.c:1885 sock_sendmsg_nosec net/socket.c:730 [inline] sock_sendmsg net/socket.c:753 [inline] ____sys_sendmsg+0x9c2/0xd60 net/socket.c:2541 ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2595 __sys_sendmsg net/socket.c:2624 [inline] __do_sys_sendmsg net/socket.c:2633 [inline] __se_sys_sendmsg net/socket.c:2631 [inline] __x64_sys_sendmsg+0x307/0x490 net/socket.c:2631 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd TIPC bearer-related names including link names must be null-terminated strings. If a link name which is not null-terminated is passed through netlink, strstr() and similar functions can cause buffer overrun. This causes the above issue. This patch changes the nla_policy for bearer-related names from NLA_STRING to NLA_NUL_STRING. This resolves the issue by ensuring that only null-terminated strings are accepted as bearer-related names. syzbot reported similar uninit-value issue related to bearer names [2]. The root cause of this issue is that a non-null-terminated bearer name was passed. This patch also resolved this issue. Fixes: 7be57fc69184 ("tipc: add link get/dump to new netlink api") Fixes: 0655f6a8635b ("tipc: add bearer disable/enable to new netlink api") Reported-and-tested-by: syzbot+5138ca807af9d2b42574@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=5138ca807af9d2b42574 [1] Reported-and-tested-by: syzbot+9425c47dccbcb4c17d51@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=9425c47dccbcb4c17d51 [2] Signed-off-by: Shigeru Yoshida Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231030075540.3784537-1-syoshida@redhat.com Signed-off-by: Jakub Kicinski commit 876f8ab52363f649bcc74072157dfd7adfbabc0d Author: Dan Carpenter Date: Fri Oct 27 15:19:01 2023 +0300 hsr: Prevent use after free in prp_create_tagged_frame() The prp_fill_rct() function can fail. In that situation, it frees the skb and returns NULL. Meanwhile on the success path, it returns the original skb. So it's straight forward to fix bug by using the returned value. Fixes: 451d8123f897 ("net: prp: add packet handling support") Signed-off-by: Dan Carpenter Acked-by: Paolo Abeni Link: https://lore.kernel.org/r/57af1f28-7f57-4a96-bcd3-b7a0f2340845@moroto.mountain Signed-off-by: Jakub Kicinski commit 7b3ba18703a63f6fd487183b9262b08e5632da1b Author: Willem de Bruijn Date: Wed Oct 25 19:42:38 2023 -0400 llc: verify mac len before reading mac header LLC reads the mac header with eth_hdr without verifying that the skb has an Ethernet header. Syzbot was able to enter llc_rcv on a tun device. Tun can insert packets without mac len and with user configurable skb->protocol (passing a tun_pi header when not configuring IFF_NO_PI). BUG: KMSAN: uninit-value in llc_station_ac_send_test_r net/llc/llc_station.c:81 [inline] BUG: KMSAN: uninit-value in llc_station_rcv+0x6fb/0x1290 net/llc/llc_station.c:111 llc_station_ac_send_test_r net/llc/llc_station.c:81 [inline] llc_station_rcv+0x6fb/0x1290 net/llc/llc_station.c:111 llc_rcv+0xc5d/0x14a0 net/llc/llc_input.c:218 __netif_receive_skb_one_core net/core/dev.c:5523 [inline] __netif_receive_skb+0x1a6/0x5a0 net/core/dev.c:5637 netif_receive_skb_internal net/core/dev.c:5723 [inline] netif_receive_skb+0x58/0x660 net/core/dev.c:5782 tun_rx_batched+0x3ee/0x980 drivers/net/tun.c:1555 tun_get_user+0x54c5/0x69c0 drivers/net/tun.c:2002 Add a mac_len test before all three eth_hdr(skb) calls under net/llc. There are further uses in include/net/llc_pdu.h. All these are protected by a test skb->protocol == ETH_P_802_2. Which does not protect against this tun scenario. But the mac_len test added in this patch in llc_fixup_skb will indirectly protect those too. That is called from llc_rcv before any other LLC code. It is tempting to just add a blanket mac_len check in llc_rcv, but not sure whether that could break valid LLC paths that do not assume an Ethernet header. 802.2 LLC may be used on top of non-802.3 protocols in principle. The below referenced commit shows that used to, on top of Token Ring. At least one of the three eth_hdr uses goes back to before the start of git history. But the one that syzbot exercises is introduced in this commit. That commit is old enough (2008), that effectively all stable kernels should receive this. Fixes: f83f1768f833 ("[LLC]: skb allocation size for responses") Reported-by: syzbot+a8c7be6dee0de1b669cc@syzkaller.appspotmail.com Signed-off-by: Willem de Bruijn Link: https://lore.kernel.org/r/20231025234251.3796495-1-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski commit d280783c3ad9ae31c01c1b3bdd2e8353a223599b Author: Linus Walleij Date: Sat Oct 28 22:48:35 2023 +0200 net: xscale: Drop unused PHY number For some cargoculted reason on incomplete cleanup, we have a PHY number which refers to nothing and gives confusing messages about PHY 0 on all ports. Print the name of the actual PHY device instead. Reported-by: Howard Harte Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20231028-ixp4xx-eth-id-v1-1-57be486d7f0f@linaro.org Signed-off-by: Jakub Kicinski commit 2b7ac0c87d985c92e519995853c52b9649ea4b07 Author: Jakub Kicinski Date: Fri Oct 27 15:34:08 2023 -0700 tools: ynl-gen: don't touch the output file if content is the same I often regenerate all YNL files in the tree to make sure they are in sync with the codegen and specs. Generator rewrites the files unconditionally, so since make looks at file modification time to decide what to rebuild - my next build takes longer. We already generate the code to a tempfile most of the time, only overwrite the target when we have to. Before: $ stat include/uapi/linux/netdev.h File: include/uapi/linux/netdev.h Size: 2307 Blocks: 8 IO Block: 4096 regular file Access: 2023-10-27 15:19:56.347071940 -0700 Modify: 2023-10-27 15:19:45.089000900 -0700 Change: 2023-10-27 15:19:45.089000900 -0700 Birth: 2023-10-27 15:19:45.088000894 -0700 $ ./tools/net/ynl/ynl-regen.sh -f [...] $ stat include/uapi/linux/netdev.h File: include/uapi/linux/netdev.h Size: 2307 Blocks: 8 IO Block: 4096 regular file Access: 2023-10-27 15:19:56.347071940 -0700 Modify: 2023-10-27 15:22:18.417968446 -0700 Change: 2023-10-27 15:22:18.417968446 -0700 Birth: 2023-10-27 15:19:45.088000894 -0700 After: $ stat include/uapi/linux/netdev.h File: include/uapi/linux/netdev.h Size: 2307 Blocks: 8 IO Block: 4096 regular file Access: 2023-10-27 15:22:41.520114221 -0700 Modify: 2023-10-27 15:22:18.417968446 -0700 Change: 2023-10-27 15:22:18.417968446 -0700 Birth: 2023-10-27 15:19:45.088000894 -0700 $ ./tools/net/ynl/ynl-regen.sh -f [...] $ stat include/uapi/linux/netdev.h File: include/uapi/linux/netdev.h Size: 2307 Blocks: 8 IO Block: 4096 regular file Access: 2023-10-27 15:22:41.520114221 -0700 Modify: 2023-10-27 15:22:18.417968446 -0700 Change: 2023-10-27 15:22:18.417968446 -0700 Birth: 2023-10-27 15:19:45.088000894 -0700 Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231027223408.1865704-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 05f0431bb90f2ee3657e7fc2678f11a1f9b778b7 Author: Jiri Pirko Date: Mon Oct 30 17:17:50 2023 +0100 netlink: specs: devlink: add forgotten port function caps enum values Add two enum values that the blamed commit omitted. Fixes: f2f9dd164db0 ("netlink: specs: devlink: add the remaining command to generate complete split_ops") Signed-off-by: Jiri Pirko Link: https://lore.kernel.org/r/20231030161750.110420-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 5ed8499b64c664c39bf8cd712a0f3f959b075267 Merge: aca080970e4eb 031fba65fc202 Author: Jakub Kicinski Date: Wed Nov 1 21:50:58 2023 -0700 Merge branch 'add-missing-module_descriptions' Andrew Lunn says: ==================== Add missing MODULE_DESCRIPTIONS Fixup PHY and MDIO drivers which are missing MODULE_DESCRIPTION. ==================== Link: https://lore.kernel.org/r/20231028184458.99448-1-andrew@lunn.ch Signed-off-by: Jakub Kicinski commit 031fba65fc202abf1f193e321be7a2c274fd88ba Author: Andrew Lunn Date: Sat Oct 28 20:44:58 2023 +0200 net: mdio: fill in missing MODULE_DESCRIPTION()s W=1 builds now warn if a module is built without a MODULE_DESCRIPTION(). Fill them in based on the Kconfig text, or similar. Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli Acked-by: Andrew Jeffery Link: https://lore.kernel.org/r/20231028184458.99448-3-andrew@lunn.ch Signed-off-by: Jakub Kicinski commit dd9d75fcf0f427ddcde4bde736908684ee05c353 Author: Andrew Lunn Date: Sat Oct 28 20:44:57 2023 +0200 net: phy: fill in missing MODULE_DESCRIPTION()s W=1 builds now warn if a module is built without a MODULE_DESCRIPTION(). Fill them in based on the Kconfig text, or similar. Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli Acked-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20231028184458.99448-2-andrew@lunn.ch Signed-off-by: Jakub Kicinski commit aca080970e4eb371bb2520ef4f67a8286f66f336 Merge: ff269e2cd5adc f96118c5d86f0 Author: Jakub Kicinski Date: Wed Nov 1 21:49:11 2023 -0700 Merge branch 'net-sched-fill-in-missing-module_descriptions-for-net-sched' Victor Nogueira says: ==================== net: sched: Fill in missing MODULE_DESCRIPTIONs for net/sched W=1 builds now warn if module is built without a MODULE_DESCRIPTION(). Fill in the missing MODULE_DESCRIPTIONs for net/sched ==================== Link: https://lore.kernel.org/r/20231027155045.46291-1-victor@mojatatu.com Signed-off-by: Jakub Kicinski commit f96118c5d86f03d81bc24c7941f133ae5dd56a7b Author: Victor Nogueira Date: Fri Oct 27 08:50:45 2023 -0700 net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs W=1 builds now warn if module is built without a MODULE_DESCRIPTION(). Fill in missing MODULE_DESCRIPTIONs for TC qdiscs. Signed-off-by: Victor Nogueira Acked-by: Jamal Hadi Salim Reviewed-by: Vinicius Costa Gomes Link: https://lore.kernel.org/r/20231027155045.46291-4-victor@mojatatu.com Signed-off-by: Jakub Kicinski commit a9c92771fa23b263ac747fc5a12e0e233aed23d5 Author: Victor Nogueira Date: Fri Oct 27 08:50:44 2023 -0700 net: sched: Fill in missing MODULE_DESCRIPTION for classifiers W=1 builds now warn if module is built without a MODULE_DESCRIPTION(). Fill in missing MODULE_DESCRIPTIONs for TC classifiers. Signed-off-by: Victor Nogueira Acked-by: Jamal Hadi Salim Reviewed-by: Vinicius Costa Gomes Link: https://lore.kernel.org/r/20231027155045.46291-3-victor@mojatatu.com Signed-off-by: Jakub Kicinski commit 49b02a19c23a6541026ae8d36fee85ce8af11b60 Author: Victor Nogueira Date: Fri Oct 27 08:50:43 2023 -0700 net: sched: Fill in MODULE_DESCRIPTION for act_gate W=1 builds now warn if module is built without a MODULE_DESCRIPTION(). Gate is the only TC action that is lacking such description. Fill MODULE_DESCRIPTION for Gate TC ACTION. Signed-off-by: Victor Nogueira Acked-by: Jamal Hadi Salim Reviewed-by: Vinicius Costa Gomes Link: https://lore.kernel.org/r/20231027155045.46291-2-victor@mojatatu.com Signed-off-by: Jakub Kicinski commit 70a9affa930c7aeba27893c7d402ef1294f43aa2 Author: Christophe JAILLET Date: Wed Nov 1 18:59:06 2023 +0100 seq_buf: Export seq_buf_puts() Mark seq_buf_puts() which is part of the seq_buf API to be exported to kernel loadable GPL modules. Link: https://lkml.kernel.org/r/b9e3737f66ec2450221b492048ce0d9c65c84953.1698861216.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Steven Rostedt (Google) commit 685b38c7650a0f461f56761cf61936b453d5bb24 Author: Christophe JAILLET Date: Wed Nov 1 18:59:05 2023 +0100 seq_buf: Export seq_buf_putc() Mark seq_buf_putc() which is part of the seq_buf API to be exported to kernel loadable GPL modules. Link: https://lkml.kernel.org/r/5c9a5ed97ac37dbdcd9c1e7bcbdec9ac166e79be.1698861216.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Steven Rostedt (Google) commit 407c6726ca71b33330d2d6345d9ea7ebc02575e9 Author: Steven Rostedt (Google) Date: Wed Nov 1 13:25:49 2023 -0400 eventfs: Use simple_recursive_removal() to clean up dentries Looking at how dentry is removed via the tracefs system, I found that eventfs does not do everything that it did under tracefs. The tracefs removal of a dentry calls simple_recursive_removal() that does a lot more than a simple d_invalidate(). As it should be a requirement that any eventfs_inode that has a dentry, so does its parent. When removing a eventfs_inode, if it has a dentry, a call to simple_recursive_removal() on that dentry should clean up all the dentries underneath it. Add WARN_ON_ONCE() to check for the parent having a dentry if any children do. Link: https://lore.kernel.org/all/20231101022553.GE1957730@ZenIV/ Link: https://lkml.kernel.org/r/20231101172650.552471568@goodmis.org Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Andrew Morton Cc: Al Viro Fixes: 5bdcd5f5331a2 ("eventfs: Implement removal of meta data from eventfs") Signed-off-by: Steven Rostedt (Google) commit 62d65cac119d08d39f751b4e3e2063ed996edc05 Author: Steven Rostedt (Google) Date: Wed Nov 1 13:25:48 2023 -0400 eventfs: Remove special processing of dput() of events directory The top level events directory is no longer special with regards to how it should be delete. Remove the extra processing for it in eventfs_set_ei_status_free(). Link: https://lkml.kernel.org/r/20231101172650.340876747@goodmis.org Cc: Ajay Kaher Cc: Mark Rutland Cc: Andrew Morton Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 020010fbfa202aa528a52743eba4ab0da3400a4e Author: Steven Rostedt (Google) Date: Wed Nov 1 13:25:47 2023 -0400 eventfs: Delete eventfs_inode when the last dentry is freed There exists a race between holding a reference of an eventfs_inode dentry and the freeing of the eventfs_inode. If user space has a dentry held long enough, it may still be able to access the dentry's eventfs_inode after it has been freed. To prevent this, have he eventfs_inode freed via the last dput() (or via RCU if the eventfs_inode does not have a dentry). This means reintroducing the eventfs_inode del_list field at a temporary place to put the eventfs_inode. It needs to mark it as freed (via the list) but also must invalidate the dentry immediately as the return from eventfs_remove_dir() expects that they are. But the dentry invalidation must not be called under the eventfs_mutex, so it must be done after the eventfs_inode is marked as free (put on a deletion list). Link: https://lkml.kernel.org/r/20231101172650.123479767@goodmis.org Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Andrew Morton Cc: Ajay Kaher Fixes: 5bdcd5f5331a2 ("eventfs: Implement removal of meta data from eventfs") Signed-off-by: Steven Rostedt (Google) commit 44365329f8219fc379097c2c9a75ff53f123764f Author: Steven Rostedt (Google) Date: Wed Nov 1 13:25:46 2023 -0400 eventfs: Hold eventfs_mutex when calling callback functions The callback function that is used to create inodes and dentries is not protected by anything and the data that is passed to it could become stale. After eventfs_remove_dir() is called by the tracing system, it is free to remove the events that are associated to that directory. Unfortunately, that means the callbacks must not be called after that. CPU0 CPU1 ---- ---- eventfs_root_lookup() { eventfs_remove_dir() { mutex_lock(&event_mutex); ei->is_freed = set; mutex_unlock(&event_mutex); } kfree(event_call); for (...) { entry = &ei->entries[i]; r = entry->callback() { call = data; // call == event_call above if (call->flags ...) [ USE AFTER FREE BUG ] The safest way to protect this is to wrap the callback with: mutex_lock(&eventfs_mutex); if (!ei->is_freed) r = entry->callback(); else r = -1; mutex_unlock(&eventfs_mutex); This will make sure that the callback will not be called after it is freed. But now it needs to be known that the callback is called while holding internal eventfs locks, and that it must not call back into the eventfs / tracefs system. There's no reason it should anyway, but document that as well. Link: https://lore.kernel.org/all/CA+G9fYu9GOEbD=rR5eMR-=HJ8H6rMsbzDC2ZY5=Y50WpWAE7_Q@mail.gmail.com/ Link: https://lkml.kernel.org/r/20231101172649.906696613@goodmis.org Cc: Ajay Kaher Cc: Mark Rutland Cc: Andrew Morton Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_inode") Reported-by: Linux Kernel Functional Testing Reported-by: Naresh Kamboju Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 28e12c09f5aa081b2d13d1340e3610070b6c624d Author: Steven Rostedt (Google) Date: Wed Nov 1 13:25:45 2023 -0400 eventfs: Save ownership and mode Now that inodes and dentries are created on the fly, they are also reclaimed on memory pressure. Since the ownership and file mode are saved in the inode, if they are freed, any changes to the ownership and mode will be lost. To counter this, if the user changes the permissions or ownership, save them, and when creating the inodes again, restore those changes. Link: https://lkml.kernel.org/r/20231101172649.691841445@goodmis.org Cc: stable@vger.kernel.org Cc: Ajay Kaher Cc: Mark Rutland Cc: Andrew Morton Fixes: 63940449555e7 ("eventfs: Implement eventfs lookup, read, open functions") Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 77a06c33a22d13f3a6e31f06f6ee6bca666e6898 Author: Steven Rostedt (Google) Date: Wed Nov 1 13:25:44 2023 -0400 eventfs: Test for ei->is_freed when accessing ei->dentry The eventfs_inode (ei) is protected by SRCU, but the ei->dentry is not. It is protected by the eventfs_mutex. Anytime the eventfs_mutex is released, and access to the ei->dentry needs to be done, it should first check if ei->is_freed is set under the eventfs_mutex. If it is, then the ei->dentry is invalid and must not be used. The ei->dentry must only be accessed under the eventfs_mutex and after checking if ei->is_freed is set. When the ei is being freed, it will (under the eventfs_mutex) set is_freed and at the same time move the dentry to a free list to be cleared after the eventfs_mutex is released. This means that any access to the ei->dentry must check first if ei->is_freed is set, because if it is, then the dentry is on its way to be freed. Also add comments to describe this better. Link: https://lore.kernel.org/all/CA+G9fYt6pY+tMZEOg=SoEywQOe19fGP3uR15SGowkdK+_X85Cg@mail.gmail.com/ Link: https://lore.kernel.org/all/CA+G9fYuDP3hVQ3t7FfrBAjd_WFVSurMgCepTxunSJf=MTe=6aA@mail.gmail.com/ Link: https://lkml.kernel.org/r/20231101172649.477608228@goodmis.org Cc: Ajay Kaher Cc: Mark Rutland Cc: Andrew Morton Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_inode") Reported-by: Linux Kernel Functional Testing Reported-by: Naresh Kamboju Reported-by: Beau Belgrave Reviewed-by: Masami Hiramatsu (Google) Tested-by: Linux Kernel Functional Testing Tested-by: Naresh Kamboju Tested-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit db3a397209b00d2e4e0a068608e5c546fc064b82 Author: Steven Rostedt (Google) Date: Wed Nov 1 13:25:43 2023 -0400 eventfs: Have a free_ei() that just frees the eventfs_inode As the eventfs_inode is freed in two different locations, make a helper function free_ei() to make sure all the allocated fields of the eventfs_inode is freed. This requires renaming the existing free_ei() which is called by the srcu handler to free_rcu_ei() and have free_ei() just do the freeing, where free_rcu_ei() will call it. Link: https://lkml.kernel.org/r/20231101172649.265214087@goodmis.org Cc: Ajay Kaher Cc: Mark Rutland Cc: Andrew Morton Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit f2f496370afcbc5227d7002da28c74b91fed12ff Author: Steven Rostedt (Google) Date: Wed Nov 1 13:25:42 2023 -0400 eventfs: Remove "is_freed" union with rcu head The eventfs_inode->is_freed was a union with the rcu_head with the assumption that when it was on the srcu list the head would contain a pointer which would make "is_freed" true. But that was a wrong assumption as the rcu head is a single link list where the last element is NULL. Instead, split the nr_entries integer so that "is_freed" is one bit and the nr_entries is the next 31 bits. As there shouldn't be more than 10 (currently there's at most 5 to 7 depending on the config), this should not be a problem. Link: https://lkml.kernel.org/r/20231101172649.049758712@goodmis.org Cc: stable@vger.kernel.org Cc: Mark Rutland Cc: Andrew Morton Cc: Ajay Kaher Fixes: 63940449555e7 ("eventfs: Implement eventfs lookup, read, open functions") Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 9037caa09ed345b35325200f0e4acf5a94ae0a65 Author: Steven Rostedt (Google) Date: Mon Oct 30 12:15:23 2023 -0400 eventfs: Fix kerneldoc of eventfs_remove_rec() The eventfs_remove_rec() had some missing parameters in the kerneldoc comment above it. Also, rephrase the description a bit more to have a bit more correct grammar. Link: https://lore.kernel.org/linux-trace-kernel/20231030121523.0b2225a7@gandalf.local.home Cc: Masami Hiramatsu Cc: Mark Rutland Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_inode"); Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310052216.4SgqasWo-lkp@intel.com/ Signed-off-by: Steven Rostedt (Google) commit 4f7969bcd6d33042d62e249b41b5578161e4c868 Author: Steven Rostedt (Google) Date: Tue Oct 31 15:10:33 2023 -0400 tracing: Have the user copy of synthetic event address use correct context A synthetic event is created by the synthetic event interface that can read both user or kernel address memory. In reality, it reads any arbitrary memory location from within the kernel. If the address space is in USER (where CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE is set) then it uses strncpy_from_user_nofault() to copy strings otherwise it uses strncpy_from_kernel_nofault(). But since both functions use the same variable there's no annotation to what that variable is (ie. __user). This makes sparse complain. Quiet sparse by typecasting the strncpy_from_user_nofault() variable to a __user pointer. Link: https://lore.kernel.org/linux-trace-kernel/20231031151033.73c42e23@gandalf.local.home Cc: stable@vger.kernel.org Cc: Masami Hiramatsu Cc: Mark Rutland Fixes: 0934ae9977c2 ("tracing: Fix reading strings from synthetic events"); Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202311010013.fm8WTxa5-lkp@intel.com/ Signed-off-by: Steven Rostedt (Google) commit 77bc4d4921bd3497678ba8e7f4e480de35692f05 Author: Steven Rostedt (Google) Date: Tue Oct 31 12:42:29 2023 -0400 eventfs: Remove extra dget() in eventfs_create_events_dir() The creation of the top events directory does a dget() at the end of the creation in eventfs_create_events_dir() with a comment saying the final dput() will happen when it is removed. The problem is that a dget() is already done on the dentry when it was created with tracefs_start_creating()! The dget() now just causes a memory leak of that dentry. Remove the extra dget() as the final dput() in the deletion of the events directory actually matches the one in tracefs_start_creating(). Link: https://lore.kernel.org/linux-trace-kernel/20231031124229.4f2e3fa1@gandalf.local.home Cc: Masami Hiramatsu Cc: Mark Rutland Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_inode") Signed-off-by: Steven Rostedt (Google) commit bb32500fb9b78215e4ef6ee8b4345c5f5d7eafb4 Author: Steven Rostedt (Google) Date: Tue Oct 31 12:24:53 2023 -0400 tracing: Have trace_event_file have ref counters The following can crash the kernel: # cd /sys/kernel/tracing # echo 'p:sched schedule' > kprobe_events # exec 5>>events/kprobes/sched/enable # > kprobe_events # exec 5>&- The above commands: 1. Change directory to the tracefs directory 2. Create a kprobe event (doesn't matter what one) 3. Open bash file descriptor 5 on the enable file of the kprobe event 4. Delete the kprobe event (removes the files too) 5. Close the bash file descriptor 5 The above causes a crash! BUG: kernel NULL pointer dereference, address: 0000000000000028 #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: 6 PID: 877 Comm: bash Not tainted 6.5.0-rc4-test-00008-g2c6b6b1029d4-dirty #186 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 RIP: 0010:tracing_release_file_tr+0xc/0x50 What happens here is that the kprobe event creates a trace_event_file "file" descriptor that represents the file in tracefs to the event. It maintains state of the event (is it enabled for the given instance?). Opening the "enable" file gets a reference to the event "file" descriptor via the open file descriptor. When the kprobe event is deleted, the file is also deleted from the tracefs system which also frees the event "file" descriptor. But as the tracefs file is still opened by user space, it will not be totally removed until the final dput() is called on it. But this is not true with the event "file" descriptor that is already freed. If the user does a write to or simply closes the file descriptor it will reference the event "file" descriptor that was just freed, causing a use-after-free bug. To solve this, add a ref count to the event "file" descriptor as well as a new flag called "FREED". The "file" will not be freed until the last reference is released. But the FREE flag will be set when the event is removed to prevent any more modifications to that event from happening, even if there's still a reference to the event "file" descriptor. Link: https://lore.kernel.org/linux-trace-kernel/20231031000031.1e705592@gandalf.local.home/ Link: https://lore.kernel.org/linux-trace-kernel/20231031122453.7a48b923@gandalf.local.home Cc: stable@vger.kernel.org Cc: Mark Rutland Fixes: f5ca233e2e66d ("tracing: Increase trace array ref count on enable and filter files") Reported-by: Beau Belgrave Tested-by: Beau Belgrave Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit babe393974de0351c0e6cca50f5f84edaf8d7fa1 Merge: 7dc0e9c7dda66 cf63348b4c453 Author: Linus Torvalds Date: Wed Nov 1 17:11:41 2023 -1000 Merge tag 'docs-6.7' of git://git.lwn.net/linux Pull documentation updates from Jonathan Corbet: "The number of commits for documentation is not huge this time around, but there are some significant changes nonetheless: - Some more Spanish-language and Chinese translations - The much-discussed documentation of the confidential-computing threat model - Powerpc and RISCV documentation move under Documentation/arch - these complete this particular bit of documentation churn - A large traditional-Chinese documentation update - A new document on backporting and conflict resolution - Some kernel-doc and Sphinx fixes Plus the usual smattering of smaller updates and typo fixes" * tag 'docs-6.7' of git://git.lwn.net/linux: (40 commits) scripts/kernel-doc: Fix the regex for matching -Werror flag docs: backporting: address feedback Documentation: driver-api: pps: Update PPS generator documentation speakup: Document USB support doc: blk-ioprio: Bring the doc in line with the implementation docs: usb: fix reference to nonexistent file in UVC Gadget docs: doc-guide: mention 'make refcheckdocs' Documentation: fix typo in dynamic-debug howto scripts/kernel-doc: match -Werror flag strictly Documentation/sphinx: Remove the repeated word "the" in comments. docs: sparse: add SPDX-License-Identifier docs/zh_CN: Add subsystem-apis Chinese translation docs/zh_TW: update contents for zh_TW docs: submitting-patches: encourage direct notifications to commenters docs: add backporting and conflict resolution document docs: move riscv under arch docs: update link to powerpc/vmemmap_dedup.rst mm/memory-hotplug: fix typo in documentation docs: move powerpc under arch PCI: Update the devres documentation regarding to pcim_*() ... commit 7dc0e9c7dda66bd91eeada00d90033e3eb647fc3 Merge: 5eda8f25377f3 5247e6dbed004 Author: Linus Torvalds Date: Wed Nov 1 17:08:10 2023 -1000 Merge tag 'linux_kselftest-next-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull kselftest updates from Shuah Khan: - kbuild kselftest-merge target fixes - fixes to several tests - resctrl test fixes and enhancements - ksft_perror() helper and reporting improvements - printf attribute to kselftest prints to improve reporting - documentation and clang build warning fixes The bulk of the patches are for resctrl fixes and enhancements. * tag 'linux_kselftest-next-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (51 commits) selftests/resctrl: Fix MBM test failure when MBA unavailable selftests/clone3: Report descriptive test names selftests:modify the incorrect print format selftests/efivarfs: create-read: fix a resource leak selftests/ftrace: Add riscv support for kprobe arg tests selftests/ftrace: add loongarch support for kprobe args char tests selftests/amd-pstate: Added option to provide perf binary path selftests/amd-pstate: Fix broken paths to run workloads in amd-pstate-ut selftests/resctrl: Move run_benchmark() to a more fitting file selftests/resctrl: Fix schemata write error check selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests selftests/resctrl: Fix feature checks selftests/resctrl: Refactor feature check to use resource and feature name selftests/resctrl: Move _GNU_SOURCE define into Makefile selftests/resctrl: Remove duplicate feature check from CMT test selftests/resctrl: Extend signal handler coverage to unmount on receiving signal selftests/resctrl: Fix uninitialized .sa_flags selftests/resctrl: Cleanup benchmark argument parsing selftests/resctrl: Remove ben_count variable selftests/resctrl: Make benchmark command const and build it with pointers ... commit 5eda8f25377f3d6de697eaa1d9801b9781d09dbc Merge: 463f46e114f74 8040345fdae4c Author: Linus Torvalds Date: Wed Nov 1 17:02:29 2023 -1000 Merge tag 'linux_kselftest-kunit-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull kunit updates from Shuah Khan: - string-stream testing enhancements - several fixes memory leaks - fix to reset status during parameter handling * tag 'linux_kselftest-kunit-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: kunit: test: Fix the possible memory leak in executor_test kunit: Fix possible memory leak in kunit_filter_suites() kunit: Fix the wrong kfree of copy for kunit_filter_suites() kunit: Fix missed memory release in kunit_free_suite_set() kunit: Reset test status on each param iteration kunit: string-stream: Test performance of string_stream kunit: Use string_stream for test log kunit: string-stream: Add tests for freeing resource-managed string_stream kunit: string-stream: Decouple string_stream from kunit kunit: string-stream: Add kunit_alloc_string_stream() kunit: Don't use a managed alloc in is_literal() kunit: string-stream-test: Add cases for string_stream newline appending kunit: string-stream: Add option to make all lines end with newline kunit: string-stream: Improve testing of string_stream kunit: string-stream: Don't create a fragment for empty strings commit 463f46e114f74465cf8d01b124e7b74ad1ce2afd Merge: ff269e2cd5adc b2b67c997bf74 Author: Linus Torvalds Date: Wed Nov 1 16:44:56 2023 -1000 Merge tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd Pull iommufd updates from Jason Gunthorpe: "This brings three new iommufd capabilities: - Dirty tracking for DMA. AMD/ARM/Intel CPUs can now record if a DMA writes to a page in the IOPTEs within the IO page table. This can be used to generate a record of what memory is being dirtied by DMA activities during a VM migration process. A VMM like qemu will combine the IOMMU dirty bits with the CPU's dirty log to determine what memory to transfer. VFIO already has a DMA dirty tracking framework that requires PCI devices to implement tracking HW internally. The iommufd version provides an alternative that the VMM can select, if available. The two are designed to have very similar APIs. - Userspace controlled attributes for hardware page tables (HWPT/iommu_domain). There are currently a few generic attributes for HWPTs (support dirty tracking, and parent of a nest). This is an entry point for the userspace iommu driver to control the HW in detail. - Nested translation support for HWPTs. This is a 2D translation scheme similar to the CPU where a DMA goes through a first stage to determine an intermediate address which is then translated trough a second stage to a physical address. Like for CPU translation the first stage table would exist in VM controlled memory and the second stage is in the kernel and matches the VM's guest to physical map. As every IOMMU has a unique set of parameter to describe the S1 IO page table and its associated parameters the userspace IOMMU driver has to marshal the information into the correct format. This is 1/3 of the feature, it allows creating the nested translation and binding it to VFIO devices, however the API to support IOTLB and ATC invalidation of the stage 1 io page table, and forwarding of IO faults are still in progress. The series includes AMD and Intel support for dirty tracking. Intel support for nested translation. Along the way are a number of internal items: - New iommu core items: ops->domain_alloc_user(), ops->set_dirty_tracking, ops->read_and_clear_dirty(), IOMMU_DOMAIN_NESTED, and iommu_copy_struct_from_user - UAF fix in iopt_area_split() - Spelling fixes and some test suite improvement" * tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd: (52 commits) iommufd: Organize the mock domain alloc functions closer to Joerg's tree iommufd/selftest: Fix page-size check in iommufd_test_dirty() iommufd: Add iopt_area_alloc() iommufd: Fix missing update of domains_itree after splitting iopt_area iommu/vt-d: Disallow read-only mappings to nest parent domain iommu/vt-d: Add nested domain allocation iommu/vt-d: Set the nested domain to a device iommu/vt-d: Make domain attach helpers to be extern iommu/vt-d: Add helper to setup pasid nested translation iommu/vt-d: Add helper for nested domain allocation iommu/vt-d: Extend dmar_domain to support nested domain iommufd: Add data structure for Intel VT-d stage-1 domain allocation iommu/vt-d: Enhance capability check for nested parent domain allocation iommufd/selftest: Add coverage for IOMMU_HWPT_ALLOC with nested HWPTs iommufd/selftest: Add nested domain allocation for mock domain iommu: Add iommu_copy_struct_from_user helper iommufd: Add a nested HW pagetable object iommu: Pass in parent domain with user_data to domain_alloc_user op iommufd: Share iommufd_hwpt_alloc with IOMMUFD_OBJ_HWPT_NESTED iommufd: Derive iommufd_hwpt_paging from iommufd_hw_pagetable ... commit ff269e2cd5adce4ae14f883fc9c8803bc43ee1e9 Merge: 05bf73aa27ba8 f2fbb90811231 Author: Linus Torvalds Date: Wed Nov 1 16:33:20 2023 -1000 Merge tag 'net-next-6.7-followup' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next Pull more networking updates from Jakub Kicinski: - Support GRO decapsulation for IPsec ESP in UDP - Add a handful of MODULE_DESCRIPTION()s - Drop questionable alignment check in TCP AO to avoid build issue after changes in the crypto tree * tag 'net-next-6.7-followup' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: net: tcp: remove call to obsolete crypto_ahash_alignmask() net: fill in MODULE_DESCRIPTION()s under drivers/net/ net: fill in MODULE_DESCRIPTION()s under net/802* net: fill in MODULE_DESCRIPTION()s under net/core net: fill in MODULE_DESCRIPTION()s in kuba@'s modules xfrm: policy: fix layer 4 flowi decoding xfrm Fix use after free in __xfrm6_udp_encap_rcv. xfrm: policy: replace session decode with flow dissector xfrm: move mark and oif flowi decode into common code xfrm: pass struct net to xfrm_decode_session wrappers xfrm: Support GRO for IPv6 ESP in UDP encapsulation xfrm: Support GRO for IPv4 ESP in UDP encapsulation xfrm: Use the XFRM_GRO to indicate a GRO call on input xfrm: Annotate struct xfrm_sec_ctx with __counted_by xfrm: Remove unused function declarations commit 05bf73aa27ba89474763cea7b9cd2626eda61e01 Merge: 1b10d2c8c6219 4758560fa268c Author: Linus Torvalds Date: Wed Nov 1 16:15:42 2023 -1000 Merge tag 'probes-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull probes updates from Masami Hiramatsu: "Cleanups: - kprobes: Fixes typo in kprobes samples - tracing/eprobes: Remove 'break' after return kretprobe/fprobe performance improvements: - lib: Introduce new `objpool`, which is a high performance lockless object queue. This uses per-cpu ring array to allocate/release objects from the pre-allocated object pool. Since the index of ring array is a 32bit sequential counter, we can retry to push/pop the object pointer from the ring without lock (as seq-lock does) - lib: Add an objpool test module to test the functionality and evaluate the performance under some circumstances - kprobes/fprobe: Improve kretprobe and rethook scalability performance with objpool. This improves both legacy kretprobe and fprobe exit handler (which is based on rethook) to be scalable on SMP systems. Even with 8-threads parallel test, it shows a great scalability improvement - Remove unneeded freelist.h which is replaced by objpool - objpool: Add maintainers entry for the objpool - objpool: Fix to remove unused include header lines" * tag 'probes-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: kprobes: unused header files removed MAINTAINERS: objpool added kprobes: freelist.h removed kprobes: kretprobe scalability improvement lib: objpool test module added lib: objpool added: ring-array based lockless MPMC tracing/eprobe: drop unneeded breaks samples: kprobes: Fixes a typo commit 1b10d2c8c6219bfc86d8c7d53a4f97a0a706d1ba Merge: 1e0c505e13162 acbc3ecb806e2 Author: Linus Torvalds Date: Wed Nov 1 16:07:05 2023 -1000 Merge tag 'bootconfig-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull bootconfig updates from Masami Hiramatsu: - Documentation update for /proc/cmdline, which includes both the parameters from bootloader and the embedded parameters in the kernel - fs/proc: Add bootloader argument as a comment line to /proc/bootconfig so that the user can distinguish what parameters were passed from bootloader even if bootconfig modified that - Documentation fix to add /proc/bootconfig to proc.rst * tag 'bootconfig-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: doc: Add /proc/bootconfig to proc.rst fs/proc: Add boot loader arguments as comment to /proc/bootconfig doc: Update /proc/cmdline documentation to include boot config commit 2ba446f82142d0d42fc5ea7bea7af581d33a7939 Merge: 631808095a82e 1399ebacbf590 Author: Dave Airlie Date: Thu Nov 2 11:52:50 2023 +1000 Merge tag 'shmob-drm-atomic-dt-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into drm-next drm: renesas: shmobile: Atomic conversion + DT support Currently, there are two drivers for the LCD controller on Renesas SuperH-based and ARM-based SH-Mobile and R-Mobile SoCs: 1. sh_mobile_lcdcfb, using the fbdev framework, 2. shmob_drm, using the DRM framework. However, only the former driver is used, as all platform support integrates the former. None of these drivers support DT-based systems. Convert the SH-Mobile DRM driver to atomic modesetting, and add DT support, complemented by the customary set of fixes and improvements. Acked-by: Laurent Pinchart Link: https://lore.kernel.org/r/cover.1694767208.git.geert+renesas@glider.be/ Signed-off-by: Dave Airlie From: Geert Uytterhoeven Link: https://patchwork.freedesktop.org/patch/msgid/CAMuHMdUF61V5qNyKbrTGxZfEJvCVuLO7q2R5MqZYkzRC_cNr0w@mail.gmail.com commit 1e0c505e13162a2abe7c984309cfe2ae976b428d Merge: 4684e928dbee0 550087a0ba91e Author: Linus Torvalds Date: Wed Nov 1 15:28:33 2023 -1000 Merge tag 'asm-generic-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull ia64 removal and asm-generic updates from Arnd Bergmann: - The ia64 architecture gets its well-earned retirement as planned, now that there is one last (mostly) working release that will be maintained as an LTS kernel. - The architecture specific system call tables are updated for the added map_shadow_stack() syscall and to remove references to the long-gone sys_lookup_dcookie() syscall. * tag 'asm-generic-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: hexagon: Remove unusable symbols from the ptrace.h uapi asm-generic: Fix spelling of architecture arch: Reserve map_shadow_stack() syscall number for all architectures syscalls: Cleanup references to sys_lookup_dcookie() Documentation: Drop or replace remaining mentions of IA64 lib/raid6: Drop IA64 support Documentation: Drop IA64 from feature descriptions kernel: Drop IA64 support from sig_fault handlers arch: Remove Itanium (IA-64) architecture commit dc7a15fb90bf658be8289c9540c11f50993d10ff Author: Kent Overstreet Date: Fri Oct 27 19:37:24 2023 -0400 bcachefs: Skip deleted members in member_to_text() This fixes show-super output - we shouldn't be printing members that have been deleted. Signed-off-by: Kent Overstreet commit df94cb2e57b2cc539f325003e7abb76d3060d55b Author: Kent Overstreet Date: Fri Oct 27 17:19:31 2023 -0400 bcachefs: Fix an integer overflow Fixes: bcachefs (e7fdc10e-54a3-49d9-bd0c-390370889d84): disk usage increased 4294967296 more than 2823707312 sectors reserved) transaction updates for __bchfs_fallocate journal seq 467859 update: btree=extents cached=0 bch2_trans_update+0x4e8/0x540 old u64s 5 type deleted 536925940:3559337304:4294967283 len 0 ver 0 new u64s 6 type reservation 536925940:3559337304:4294967283 len 3559337304 ver 0: generation 0 replicas 2 update: btree=inodes cached=1 bch2_extent_update_i_size_sectors+0x305/0x3b0 old u64s 19 type inode_v3 0:536925940:4294967283 len 0 ver 0: mode 100600 flags 15300000 journal_seq 467859 bi_size 0 bi_sectors 0 bi_version 0 bi_atime 40905301656446 bi_ctime 40905301656446 bi_mtime 40905301656446 bi_otime 40905301656446 bi_uid 0 bi_gid 0 bi_nlink 0 bi_generation 0 bi_dev 0 bi_data_checksum 0 bi_compression 0 bi_project 0 bi_background_compression 0 bi_data_replicas 0 bi_promote_target 0 bi_foreground_target 0 bi_background_target 0 bi_erasure_code 0 bi_fields_set 0 bi_dir 1879048193 bi_dir_offset 3384856038735393365 bi_subvol 0 bi_parent_subvol 0 bi_nocow 0 new u64s 19 type inode_v3 0:536925940:4294967283 len 0 ver 0: mode 100600 flags 15300000 journal_seq 467859 bi_size 0 bi_sectors 3559337304 bi_version 0 bi_atime 40905301656446 bi_ctime 40905301656446 bi_mtime 40905301656446 bi_otime 40905301656446 bi_uid 0 bi_gid 0 bi_nlink 0 bi_generation 0 bi_dev 0 bi_data_checksum 0 bi_compression 0 bi_project 0 bi_background_compression 0 bi_data_replicas 0 bi_promote_target 0 bi_foreground_target 0 bi_background_target 0 bi_erasure_code 0 bi_fields_set 0 bi_dir 1879048193 bi_dir_offset 3384856038735393365 bi_subvol 0 bi_parent_subvol 0 bi_nocow 0 Kernel panic - not syncing: bcachefs (e7fdc10e-54a3-49d9-bd0c-390370889d84): panic after error CPU: 4 PID: 5154 Comm: rsync Not tainted 6.5.9-gateway-gca1614174cc0-dirty #1 Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./X570 Phantom Gaming 4, BIOS P4.20 08/02/2021 Call Trace: dump_stack_lvl+0x5a/0x90 panic+0x105/0x300 ? console_unlock+0xf1/0x130 ? bch2_printbuf_exit+0x16/0x30 ? srso_return_thunk+0x5/0x10 bch2_inconsistent_error+0x6f/0x80 bch2_trans_fs_usage_apply+0x279/0x3d0 __bch2_trans_commit+0x112a/0x1df0 ? bch2_extent_update+0x13a/0x1d0 bch2_extent_update+0x13a/0x1d0 bch2_extent_fallocate+0x58e/0x740 bch2_fallocate_dispatch+0xb7c/0x1030 ? do_filp_open+0xa0/0x140 vfs_fallocate+0x18e/0x1d0 __x64_sys_fallocate+0x46/0x70 do_syscall_64+0x48/0xa0 ? exit_to_user_mode_prepare+0x4d/0xa0 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 RIP: 0033:0x7fc85d91bbb3 Code: 64 89 02 b8 ff ff ff ff eb bd 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 80 3d 31 da 0d 00 00 49 89 ca 74 14 b8 1d 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 5d c3 0f 1f 40 00 48 83 ec 28 48 89 54 24 10 Signed-off-by: Kent Overstreet commit be9e782df3cb557715630a61dc79d9f966737859 Author: Kent Overstreet Date: Fri Oct 27 15:23:46 2023 -0400 bcachefs: Don't downgrade locks on transaction restart We should only be downgrading locks on success - otherwise, our transaction restarts won't be getting the correct locks and we'll livelock. Signed-off-by: Kent Overstreet commit 2e7acdfbcad8b60eeef29d3beb3eb9a7085e3768 Author: Kent Overstreet Date: Fri Oct 27 13:53:07 2023 -0400 bcachefs: Fix deleted inodes btree in snapshot deletion Signed-off-by: Kent Overstreet commit 85103d15ca3fe3b987f912873cb4f91b6f557c6c Author: Kent Overstreet Date: Thu Oct 26 23:02:42 2023 -0400 bcachefs: Fix error path in bch2_replicas_gc_end() We were dropping a lock we hadn't taken when entering with an error. Signed-off-by: Kent Overstreet commit b65db750e2bb9252321fd54c284edd73c1595a09 Author: Kent Overstreet Date: Tue Oct 24 20:44:36 2023 -0400 bcachefs: Enumerate fsck errors This patch adds a superblock error counter for every distinct fsck error; this means that when analyzing filesystems out in the wild we'll be able to see what sorts of inconsistencies are being found and repair, and hence what bugs to look for. Errors validating bkeys are not yet considered distinct fsck errors, but this patch adds a new helper, bkey_fsck_err(), in order to add distinct error types for them as well. Signed-off-by: Kent Overstreet commit f5d26fa31ed2e260589f0bc8af010bb742f1231e Author: Kent Overstreet Date: Wed Oct 25 15:51:16 2023 -0400 bcachefs: bch_sb_field_errors Add a new superblock section to keep counts of errors seen since filesystem creation: we'll be addingcounters for every distinct fsck error. The new superblock section has entries of the for [ id, count, time_of_last_error ]; this is intended to let us see what errors are occuring - and getting fixed - via show-super output. Signed-off-by: Kent Overstreet commit 94119eeb02d114aa1f78dcfaabdca50b9b626790 Author: Kent Overstreet Date: Wed Oct 25 16:29:37 2023 -0400 bcachefs: Add IO error counts to bch_member We now track IO errors per device since filesystem creation. IO error counts can be viewed in sysfs, or with the 'bcachefs show-super' command. Signed-off-by: Kent Overstreet commit 5394fe9494011de19baff276ce02a2f00eef568a Author: Kent Overstreet Date: Thu Oct 26 16:20:08 2023 -0400 bcachefs: Fix snapshot skiplists Signed-off-by: Kent Overstreet commit e84843489c15bf9d39eec3a9a95870f98a71ac24 Author: Kent Overstreet Date: Thu Oct 26 17:00:36 2023 -0400 bcachefs: Fix a kasan splat in bch2_dev_add() This fixes a use after free - mi is dangling after the resize call. Additionally, resizing the device's member info section was useless - we were attempting to preallocate the space required before adding it to the filesystem superblock, but there's other sections that we should have been preallocating as well for that to work. Signed-off-by: Kent Overstreet commit 5c1ab40e76dd873bfbfbe4df98ca3e08de31d30d Author: Kent Overstreet Date: Thu Oct 26 14:56:53 2023 -0400 bcachefs: Fix kasan splat in members_v1_get() This fixes an incorrect memcpy() in the recent members_v2 code - a members_v1 member is BCH_MEMBER_V1_BYTES, not sizeof(struct bch_member). Signed-off-by: Kent Overstreet commit fb3f57bb1177ae4d5550bbb431f90ebf277329e8 Author: Kent Overstreet Date: Fri Oct 20 13:33:14 2023 -0400 bcachefs: rebalance_work This adds a new btree, rebalance_work, to eliminate scanning required for finding extents that need work done on them in the background - i.e. for the background_target and background_compression options. rebalance_work is a bitset btree, where a KEY_TYPE_set corresponds to an extent in the extents or reflink btree at the same pos. A new extent field is added, bch_extent_rebalance, which indicates that this extent has work that needs to be done in the background - and which options to use. This allows per-inode options to be propagated to indirect extents - at least in some circumstances. In this patch, changing IO options on a file will not propagate the new options to indirect extents pointed to by that file. Updating (setting/clearing) the rebalance_work btree is done by the extent trigger, which looks at the bch_extent_rebalance field. Scanning is still requrired after changing IO path options - either just for a given inode, or for the whole filesystem. We indicate that scanning is required by adding a KEY_TYPE_cookie key to the rebalance_work btree: the cookie counter is so that we can detect that scanning is still required when an option has been flipped mid-way through an existing scan. Future possible work: - Propagate options to indirect extents when being changed - Add other IO path options - nr_replicas, ec, to rebalance_work so they can be applied in the background when they change - Add a counter, for bcachefs fs usage output, showing the pending amount of rebalance work: we'll probably want to do this after the disk space accounting rewrite (moving it to a new btree) Signed-off-by: Kent Overstreet commit 4684e928dbee00d625b5102ea23c216cc2d85f46 Merge: a39ba9b429a46 a9838799e2fa9 Author: Linus Torvalds Date: Wed Nov 1 15:06:28 2023 -1000 Merge tag 'soc-arm-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC code updates from Arnd Bergmann: "The AMD Pensando DPU platform gets added to arm64, and some minor updates make it into Renesas' 32-bit platforms" * tag 'soc-arm-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: arm: debug: reuse the config DEBUG_OMAP2UART{1,2} for OMAP{3,4,5} arm64: Add config for AMD Pensando SoC platforms MAINTAINERS: Add entry for AMD PENSANDO ARM: shmobile: sh73a0: Reserve boot area when SMP is enabled ARM: shmobile: r8a7779: Reserve boot area when SMP is enabled ARM: shmobile: rcar-gen2: Reserve boot area when SMP is enabled ARM: shmobile: rcar-gen2: Remove unneeded once handling commit a39ba9b429a4671913e79da9d6a20476f10796b1 Merge: 385903a7ec75b 216da5ebb83a1 Author: Linus Torvalds Date: Wed Nov 1 15:04:32 2023 -1000 Merge tag 'soc-defconfig-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM defconfig updates from Arnd Bergmann: "These are the usual trivial changes to enable a couple of newly added device drivers and remove lines for Kconfig options that are no longer needed" * tag 'soc-defconfig-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (24 commits) arm64: defconfig: enable DisplayPort altmode support arm64: defconfig: enable CONFIG_TYPEC_QCOM_PMIC arm64: defconfig: add various drivers for Amlogic based boards ARM: config: aspeed: Remove FIRMWARE_MEMMAP ARM: config: aspeed_g5: Enable SSIF BMC driver ARM: config: aspeed: Add Ampere SMPro drivers ARM: config: aspeed: Add new FSI drivers arm64: defconfig: Enable TPS6593 PMIC for SK-AM62A ARM: exynos_defconfig: add driver for ISL29018 ARM: multi_v7_defconfig: add drivers for S5C73M3 & S5K6A3 camera sensors arm64: defconfig: Enable RZ/G3S (R9A08G045) SoC ARM: multi_v7_defconfig: add tm2-touchkey driver ARM: exynos_defconfig: replace SATA_AHCI_PLATFORM with AHCI_DWC driver ARM: multi_v7_defconfig: add AHCI_DWC driver ARM: multi_v7_defconfig: make Exynos related PHYs modules ARM: s5pv210_defconfig: enable IIO required by MAX17040 ARM: shmobile: defconfig: Refresh for v6.6-rc3 ARM: defconfig: cleanup orphaned CONFIGs arm64: defconfig: Enable Samsung DSIM driver arm64: defconfig: Enable CONFIG_USB_MASS_STORAGE ... commit 385903a7ec75bb400f4bf0f07d8d5ad61390270d Merge: c035f0268b87f dfae947836d86 Author: Linus Torvalds Date: Wed Nov 1 14:46:51 2023 -1000 Merge tag 'soc-drivers-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull SoC driver updates from Arnd Bergmann: "The highlights for the driver support this time are - Qualcomm platforms gain support for the Qualcomm Secure Execution Environment firmware interface to access EFI variables on certain devices, and new features for multiple platform and firmware drivers. - Arm FF-A firmware support gains support for v1.1 specification features, in particular notification and memory transaction descriptor changes. - SCMI firmware support now support v3.2 features for clock and DVFS configuration and a new transport for Qualcomm platforms. - Minor cleanups and bugfixes are added to pretty much all the active platforms: qualcomm, broadcom, dove, ti-k3, rockchip, sifive, amlogic, atmel, tegra, aspeed, vexpress, mediatek, samsung and more. In particular, this contains portions of the treewide conversion to use __counted_by annotations and the device_get_match_data helper" * tag 'soc-drivers-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (156 commits) soc: qcom: pmic_glink_altmode: Print return value on error firmware: qcom: scm: remove unneeded 'extern' specifiers firmware: qcom: scm: add a missing forward declaration for struct device firmware: qcom: move Qualcomm code into its own directory soc: samsung: exynos-chipid: Convert to platform remove callback returning void soc: qcom: apr: Add __counted_by for struct apr_rx_buf and use struct_size() soc: qcom: pmic_glink: fix connector type to be DisplayPort soc: ti: k3-socinfo: Avoid overriding return value soc: ti: k3-socinfo: Fix typo in bitfield documentation soc: ti: knav_qmss_queue: Use device_get_match_data() firmware: ti_sci: Use device_get_match_data() firmware: qcom: qseecom: add missing include guards soc/pxa: ssp: Convert to platform remove callback returning void soc/mediatek: mtk-mmsys: Convert to platform remove callback returning void soc/mediatek: mtk-devapc: Convert to platform remove callback returning void soc/loongson: loongson2_guts: Convert to platform remove callback returning void soc/litex: litex_soc_ctrl: Convert to platform remove callback returning void soc/ixp4xx: ixp4xx-qmgr: Convert to platform remove callback returning void soc/ixp4xx: ixp4xx-npe: Convert to platform remove callback returning void soc/hisilicon: kunpeng_hccs: Convert to platform remove callback returning void ... commit c035f0268b87fc21f517f638b3bad26c81babc85 Merge: deefd5024f077 c505e1e4b10d7 Author: Linus Torvalds Date: Wed Nov 1 14:37:04 2023 -1000 Merge tag 'soc-dt-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull SoC DT updates from Arnd Bergmann: "There are a couple new SoCs that are supported for the first time: - AMD Pensando Elba is a data processing unit based on Cortex-A72 CPU cores - Sophgo makes RISC-V based chips, and we now support the CV1800B chip used in the milkv-duo board and the massive sg2042 chip in the milkv-pioneer, a 64-core developer workstation. - Qualcomm Snapdragon 720G (sm7125) is a close relative of Snapdragon 7c and gets added with some Xiaomi phones - Renesas gains support for the R8A779F4 (R-Car S4-8) automotive SoC and the RZ/G3S (R9A08G045) embedded SoC. There are also a bunch of newly supported machines that use already supported chips. On the 32-bit side, we have: - USRobotics USR8200 is a NAS/Firewall/router based on the ancient Intel IXP4xx platform - A couple of machines based on the NXP i.MX5 and i.MX6 platforms - One machine each for Allwinner V3s, Aspeed AST2600, Microchip sama5d29 and ST STM32mp157 The other ones all use arm64 cores on chips from allwinner, amlogic, freescale, mediatek, qualcomm and rockchip" * tag 'soc-dt-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (641 commits) ARM: dts: BCM5301X: Set switch ports for Linksys EA9200 ARM: dts: BCM5301X: Set fixed-link for extra Netgear R8000 CPU ports ARM: dts: BCM5301X: Explicitly disable unused switch CPU ports ARM: dts: BCM5301X: Relicense Vivek's code to the GPL 2.0+ / MIT ARM: dts: BCM5301X: Relicense Felix's code to the GPL 2.0+ / MIT ARM: dts: BCM5301X: Set MAC address for Asus RT-AC87U arm64: dts: socionext: add missing cache properties riscv: dts: thead: convert isa detection to new properties arm64: dts: Update cache properties for socionext arm64: dts: ti: k3-am654-idk: Add ICSSG Ethernet ports arm64: dts: ti: k3-am654-icssg2: add ICSSG2 Ethernet support arm64: dts: ti: k3-am65-main: Add ICSSG IEP nodes arm64: dts: ti: k3-am62p5-sk: Updates for SK EVM arm64: dts: ti: k3-am62p: Add nodes for more IPs arm64: dts: rockchip: Add Turing RK1 SoM support dt-bindings: arm: rockchip: Add Turing RK1 dt-bindings: vendor-prefixes: add turing arm64: dts: rockchip: Add DFI to rk3588s arm64: dts: rockchip: Add DFI to rk356x arm64: dts: rockchip: Always enable DFI on rk3399 ... commit deefd5024f0772cf56052ace9a8c347dc70bcaf3 Merge: 009fbfc97b636 2b88119e35b00 Author: Linus Torvalds Date: Wed Nov 1 13:55:40 2023 -1000 Merge tag 'vfio-v6.7-rc1' of https://github.com/awilliam/linux-vfio Pull VFIO updates from Alex Williamson: - Add support for "chunk mode" in the mlx5-vfio-pci variant driver, which allows both larger device image sizes for migration, beyond the previous 4GB limit, and also read-ahead support for improved migration performance (Yishai Hadas) - A new bus master control interface for the CDX bus driver where there is no in-band mechanism to toggle device DMA as there is through config space on PCI devices (Nipun Gupta) - Add explicit alignment directives to vfio data structures to reduce the chance of breaking 32-bit userspace. In most cases this is transparent and the remaining cases where data structures are padded work within the existing rules for extending data structures within vfio (Stefan Hajnoczi) - Resolve a bug in the cdx bus driver noted when compiled with clang where missing parenthesis result in the wrong operation (Nathan Chancellor) - Resolve errors reported by smatch for a function when dealing with invalid inputs (Alex Williamson) - Add migration support to the mtty vfio/mdev sample driver for testing and integration purposes, allowing CI of migration without specific hardware requirements. Also resolve many of the short- comings of this driver relative to implementation of the vfio interrupt ioctl along the way (Alex Williamson) * tag 'vfio-v6.7-rc1' of https://github.com/awilliam/linux-vfio: vfio/mtty: Enable migration support vfio/mtty: Overhaul mtty interrupt handling vfio: Fix smatch errors in vfio_combine_iova_ranges() vfio/cdx: Add parentheses between bitwise AND expression and logical NOT vfio/mlx5: Activate the chunk mode functionality vfio/mlx5: Add support for READING in chunk mode vfio/mlx5: Add support for SAVING in chunk mode vfio/mlx5: Pre-allocate chunks for the STOP_COPY phase vfio/mlx5: Rename some stuff to match chunk mode vfio/mlx5: Enable querying state size which is > 4GB vfio/mlx5: Refactor the SAVE callback to activate a work only upon an error vfio/mlx5: Wake up the reader post of disabling the SAVING migration file vfio: use __aligned_u64 in struct vfio_device_ioeventfd vfio: use __aligned_u64 in struct vfio_device_gfx_plane_info vfio: trivially use __aligned_u64 for ioctl structs vfio-cdx: add bus mastering device feature support vfio: add bus master feature to device feature ioctl cdx: add support for bus mastering commit 009fbfc97b6367762efa257f1478ec86d37949f9 Merge: 3c86a44d623ee 36d91e851598a Author: Linus Torvalds Date: Wed Nov 1 13:15:54 2023 -1000 Merge tag 'dma-mapping-6.7-2023-10-30' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping updates from Christoph Hellwig: - get rid of the fake support for coherent DMA allocation on coldfire with caches (Christoph Hellwig) - add a few Kconfig dependencies so that Kconfig catches the use of invalid configurations (Christoph Hellwig) - fix a type in dma-debug output (Chuck Lever) - rewrite a comment in swiotlb (Sean Christopherson) * tag 'dma-mapping-6.7-2023-10-30' of git://git.infradead.org/users/hch/dma-mapping: dma-debug: Fix a typo in a debugging eye-catcher swiotlb: rewrite comment explaining why the source is preserved on DMA_FROM_DEVICE m68k: remove unused includes from dma.c m68k: don't provide arch_dma_alloc for nommu/coldfire net: fec: use dma_alloc_noncoherent for data cache enabled coldfire m68k: use the coherent DMA code for coldfire without data cache dma-direct: warn when coherent allocations aren't supported dma-direct: simplify the use atomic pool logic in dma_direct_alloc dma-direct: add a CONFIG_ARCH_HAS_DMA_ALLOC symbol dma-direct: add dependencies to CONFIG_DMA_GLOBAL_POOL commit 3c86a44d623ee8734a02636d3544812e31496460 Merge: 40aa597c4a53f 9e0cceadb7a50 Author: Linus Torvalds Date: Wed Nov 1 13:09:46 2023 -1000 Merge tag 'pmdomain-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm Pull pmdomain updates from Ulf Hansson: - Move Kconfig files into the pmdomain subsystem - Drop use of genpd's redundant ->opp_to_performance_state() callback - amlogic: - Add support for the T7 power-domains controller - Fix mask for the second NNA mem power-domain - bcm: Fixup ASB register read and comparison for bcm2835-power - imx: Fix device link problem for consumers of the pgc power-domain - mediatek: Add support for the MT8365 power domains - qcom: - Add support for the rpmhpds for SC8380XP power-domains - Add support for the rpmhpds for SM8650 power-domains - Add support for the rpmhpd clocks for SM7150 - Add support for the rpmpds for MSM8917 (families) power-domains - starfive: Add support for the JH7110 AON PMU * tag 'pmdomain-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: (56 commits) pmdomain: amlogic: Fix mask for the second NNA mem PD domain pmdomain: qcom: rpmhpd: Add SC8380XP power domains pmdomain: qcom: rpmhpd: Add SM8650 RPMh Power Domains dt-bindings: power: rpmpd: Add SC8380XP support dt-bindings: power: qcom,rpmhpd: Add GMXC PD index dt-bindings: power: qcom,rpmpd: document the SM8650 RPMh Power Domains pmdomain: imx: Make imx pgc power domain also set the fwnode pmdomain: qcom: rpmpd: Add QM215 power domains pmdomain: qcom: rpmpd: Add MSM8917 power domains dt-bindings: power: rpmpd: Add MSM8917, MSM8937 and QM215 pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable pmdomain: qcom: rpmhpd: Drop the ->opp_to_performance_state() callback pmdomain: qcom: rpmpd: Drop the ->opp_to_performance_state() callback pmdomain: qcom: cpr: Drop the ->opp_to_performance_state() callback pmdomain: Use device_get_match_data() pmdomain: ti: add missing of_node_put pmdomain: mediatek: Add support for MT8365 pmdomain: mediatek: Add support for MTK_SCPD_STRICT_BUS_PROTECTION cap pmdomain: mediatek: Add support for WAY_EN operations pmdomain: mediatek: Unify configuration for infracfg and smi ... commit 40aa597c4a53f7269367d1b5298bd44afcdcf473 Merge: 0364249d2073c 5428a40a308f2 Author: Linus Torvalds Date: Wed Nov 1 13:05:44 2023 -1000 Merge tag 'mmc-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC updates from Ulf Hansson: " MMC core: - Enable host caps to be modified via debugfs to test speed-modes - Improve random I/O writes for 4k buffers for hsq enabled hosts MMC host: - atmel-mci/sdhci-of-at91: Aubin Constans takes over as maintainer - dw_mmc-starfive: Re-work tuning support - meson-gx: Fix bogus IRQ when using CMD_CFG_ERROR - mmci: Use peripheral flow control for the STM32 variant - renesas,sdhi: Add support for the RZ/G3S variant - sdhci-esdhc-imx: Optimize the manual tuning logic - sdhci-msm: Add support for the SM8650 variant - sdhci-npcm: Add driver to support the Nuvoton NPCM BMC variant - sdhci-pci-gli: Add workaround to allow GL9750 to enter ASPM L1.2" * tag 'mmc-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (25 commits) dt-bindings: mmc: sdhci-msm: document the SM8650 SDHCI Controller mmc: meson-gx: Remove setting of CMD_CFG_ERROR MAINTAINERS: mmc: take over as maintainer of MCI & SDHCI MICROCHIP DRIVERS mmc: jz4740: Use device_get_match_data() mmc: sdhci-npcm: Add NPCM SDHCI driver dt-bindings: mmc: npcm,sdhci: Document NPCM SDHCI controller mmc: sdhci-pltfm: Make driver OF independent mmc: sdhci-pltfm: Drop unnecessary error messages in sdhci_pltfm_init() mmc: sdhci-pci: Switch to use acpi_evaluate_dsm_typed() mmc: debugfs: Allow host caps to be modified mmc: core: Always reselect card type mmc: mmci: use peripheral flow control for STM32 mmc: vub300: replace deprecated strncpy with strscpy memstick: jmb38x_ms: Annotate struct jmb38x_ms with __counted_by mmc: starfive: Change tuning implementation dt-bindings: mmc: starfive: Remove properties from required mmc: hsq: Improve random I/O write performance for 4k buffers mmc: core: Allow dynamical updates of the number of requests for hsq mmc: sdhci-pci-gli: A workaround to allow GL9750 to enter ASPM L1.2 dt-bindings: mmc: renesas,sdhi: Document RZ/G3S support ... commit 0364249d2073c32c5214f02866999ce940bc35a2 Merge: 39714efc23beb 9793c269da6cd Author: Linus Torvalds Date: Wed Nov 1 12:55:54 2023 -1000 Merge tag 'for-6.7/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper updates from Mike Snitzer: - Update DM core to directly call the map function for both the linear and stripe targets; which are provided by DM core - Various updates to use new safer string functions - Update DM core to respect REQ_NOWAIT flag in normal bios so that memory allocations are always attempted with GFP_NOWAIT - Add Mikulas Patocka to MAINTAINERS as a DM maintainer! - Improve DM delay target's handling of short delays (< 50ms) by using a kthread to check expiration of IOs rather than timers and a wq - Update the DM error target so that it works with zoned storage. This helps xfstests to provide proper IO error handling coverage when testing a filesystem with native zoned storage support - Update both DM crypt and integrity targets to improve performance by using crypto_shash_digest() rather than init+update+final sequence - Fix DM crypt target by backfilling missing memory allocation accounting for compound pages * tag 'for-6.7/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm crypt: account large pages in cc->n_allocated_pages dm integrity: use crypto_shash_digest() in sb_mac() dm crypt: use crypto_shash_digest() in crypt_iv_tcw_whitening() dm error: Add support for zoned block devices dm delay: for short delays, use kthread instead of timers and wq MAINTAINERS: add Mikulas Patocka as a DM maintainer dm: respect REQ_NOWAIT flag in normal bios issued to DM dm: enhance alloc_multiple_bios() to be more versatile dm: make __send_duplicate_bios return unsigned int dm log userspace: replace deprecated strncpy with strscpy dm ioctl: replace deprecated strncpy with strscpy_pad dm crypt: replace open-coded kmemdup_nul dm cache metadata: replace deprecated strncpy with strscpy dm: shortcut the calls to linear_map and stripe_map commit 39714efc23beb38ce850b29f4f132da6d997fc22 Merge: 90d624af2e5a9 0e533cba38011 Author: Linus Torvalds Date: Wed Nov 1 12:50:12 2023 -1000 Merge tag 'ata-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ATA updates from Damien Le Moal: - Modify the AHCI driver to print the link power management policy used on scan, to help with debugging issues (Niklas) - Add support for the ASM2116 series adapters to the AHCI driver (Szuying) - Prepare libata for the coming gcc and Clang __counted_by attribute (Kees) - Following the recent estensive fixing of libata suspend/resume handling, several patches further cleanup and improve disk power state management (me) - Reduce the verbosity of some error messages for non-fatal temporary errors, e.g. slow response to device reset when scanning a port, and warning messages that are in fact normal, e.g. disabling a device on suspend or when removing it (me) - Cleanup DMA helper functions (me) - Fix sata_mv drive handling of potential errors durring probe (Ma) - Cleanup the xgene and imx drivers using the functions of_device_get_match_data() and device_get_match_data() (Rob) - Improve the tegra driver device tree (Rob) * tag 'ata-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: (22 commits) dt-bindings: ata: tegra: Disallow undefined properties ata: libata-core: Improve ata_dev_power_set_active() ata: libata-eh: Spinup disk on resume after revalidation ata: imx: Use device_get_match_data() ata: xgene: Use of_device_get_match_data() ata: sata_mv: aspeed: fix value check in mv_platform_probe() ata: ahci: Add Intel Alder Lake-P AHCI controller to low power chipsets list ata: libata: Cleanup inline DMA helper functions ata: libata-eh: Reduce "disable device" message verbosity ata: libata-eh: Improve reset error messages ata: libata-sata: Improve ata_sas_slave_configure() ata: libata-core: Do not resume runtime suspended ports ata: libata-core: Do not poweroff runtime suspended ports ata: libata-core: Remove ata_port_resume_async() ata: libata-core: Remove ata_port_suspend_async() ata: libata-core: Detach a port devices on shutdown ata: libata-core: Synchronize ata_port_detach() with hotplug ata: libata-scsi: Cleanup ata_scsi_start_stop_xlat() scsi: Remove scsi device no_start_on_resume flag ata: libata: Annotate struct ata_cpr_log with __counted_by ... commit 90d624af2e5a9945eedd5cafd6ae6d88f32cc977 Merge: 4de520f1fcefd 0c696bb38f4cc Author: Linus Torvalds Date: Wed Nov 1 12:30:07 2023 -1000 Merge tag 'for-6.7/block-2023-10-30' of git://git.kernel.dk/linux Pull block updates from Jens Axboe: - Improvements to the queue_rqs() support, and adding null_blk support for that as well (Chengming) - Series improving badblocks support (Coly) - Key store support for sed-opal (Greg) - IBM partition string handling improvements (Jan) - Make number of ublk devices supported configurable (Mike) - Cancelation improvements for ublk (Ming) - MD pull requests via Song: - Handle timeout in md-cluster, by Denis Plotnikov - Cleanup pers->prepare_suspend, by Yu Kuai - Rewrite mddev_suspend(), by Yu Kuai - Simplify md_seq_ops, by Yu Kuai - Reduce unnecessary locking array_state_store(), by Mariusz Tkaczyk - Make rdev add/remove independent from daemon thread, by Yu Kuai - Refactor code around quiesce() and mddev_suspend(), by Yu Kuai - NVMe pull request via Keith: - nvme-auth updates (Mark) - nvme-tcp tls (Hannes) - nvme-fc annotaions (Kees) - Misc cleanups and improvements (Jiapeng, Joel) * tag 'for-6.7/block-2023-10-30' of git://git.kernel.dk/linux: (95 commits) block: ublk_drv: Remove unused function md: cleanup pers->prepare_suspend() nvme-auth: allow mixing of secret and hash lengths nvme-auth: use transformed key size to create resp nvme-auth: alloc nvme_dhchap_key as single buffer nvmet-tcp: use 'spin_lock_bh' for state_lock() powerpc/pseries: PLPKS SED Opal keystore support block: sed-opal: keystore access for SED Opal keys block:sed-opal: SED Opal keystore ublk: simplify aborting request ublk: replace monitor with cancelable uring_cmd ublk: quiesce request queue when aborting queue ublk: rename mm_lock as lock ublk: move ublk_cancel_dev() out of ub->mutex ublk: make sure io cmd handled in submitter task context ublk: don't get ublk device reference in ublk_abort_queue() ublk: Make ublks_max configurable ublk: Limit dev_id/ub_number values md-cluster: check for timeout while a new disk adding nvme: rework NVME_AUTH Kconfig selection ... commit 4de520f1fcefd4ebb7dddcf28bde1b330c2f6b5d Merge: f5277ad1e9768 8f350194d5cfd Author: Linus Torvalds Date: Wed Nov 1 11:25:08 2023 -1000 Merge tag 'io_uring-futex-2023-10-30' of git://git.kernel.dk/linux Pull io_uring futex support from Jens Axboe: "This adds support for using futexes through io_uring - first futex wake and wait, and then the vectored variant of waiting, futex waitv. For both wait/wake/waitv, we support the bitset variant, as the 'normal' variants can be easily implemented on top of that. PI and requeue are not supported through io_uring, just the above mentioned parts. This may change in the future, but in the spirit of keeping this small (and based on what people have been asking for), this is what we currently have. Wake support is pretty straight forward, most of the thought has gone into the wait side to avoid needing to offload wait operations to a blocking context. Instead, we rely on the usual callbacks to retry and post a completion event, when appropriate. As far as I can recall, the first request for futex support with io_uring came from Andres Freund, working on postgres. His aio rework of postgres was one of the early adopters of io_uring, and futex support was a natural extension for that. This is relevant from both a usability point of view, as well as for effiency and performance. In Andres's words, for the former: Futex wait support in io_uring makes it a lot easier to avoid deadlocks in concurrent programs that have their own buffer pool: Obviously pages in the application buffer pool have to be locked during IO. If the initiator of IO A needs to wait for a held lock B, the holder of lock B might wait for the IO A to complete. The ability to wait for a lock and IO completions at the same time provides an efficient way to avoid such deadlocks and in terms of effiency, even without unlocking the full potential yet, Andres says: Futex wake support in io_uring is useful because it allows for more efficient directed wakeups. For some "locks" postgres has queues implemented in userspace, with wakeup logic that cannot easily be implemented with FUTEX_WAKE_BITSET on a single "futex word" (imagine waiting for journal flushes to have completed up to a certain point). Thus a "lock release" sometimes need to wake up many processes in a row. A quick-and-dirty conversion to doing these wakeups via io_uring lead to a 3% throughput increase, with 12% fewer context switches, albeit in a fairly extreme workload" * tag 'io_uring-futex-2023-10-30' of git://git.kernel.dk/linux: io_uring: add support for vectored futex waits futex: make the vectored futex operations available futex: make futex_parse_waitv() available as a helper futex: add wake_data to struct futex_q io_uring: add support for futex wake and wait futex: abstract out a __futex_wake_mark() helper futex: factor out the futex wake handling futex: move FUTEX2_VALID_MASK to futex.h commit f5277ad1e9768dbd05b1ae8dcdba690215d8c5b7 Merge: ffa059b262ba7 b9ec913212e6e Author: Linus Torvalds Date: Wed Nov 1 11:16:34 2023 -1000 Merge tag 'for-6.7/io_uring-sockopt-2023-10-30' of git://git.kernel.dk/linux Pull io_uring {get,set}sockopt support from Jens Axboe: "This adds support for using getsockopt and setsockopt via io_uring. The main use cases for this is to enable use of direct descriptors, rather than first instantiating a normal file descriptor, doing the option tweaking needed, then turning it into a direct descriptor. With this support, we can avoid needing a regular file descriptor completely. The net and bpf bits have been signed off on their side" * tag 'for-6.7/io_uring-sockopt-2023-10-30' of git://git.kernel.dk/linux: selftests/bpf/sockopt: Add io_uring support io_uring/cmd: Introduce SOCKET_URING_OP_SETSOCKOPT io_uring/cmd: Introduce SOCKET_URING_OP_GETSOCKOPT io_uring/cmd: return -EOPNOTSUPP if net is disabled selftests/net: Extract uring helpers to be reusable tools headers: Grab copy of io_uring.h io_uring/cmd: Pass compat mode in issue_flags net/socket: Break down __sys_getsockopt net/socket: Break down __sys_setsockopt bpf: Add sockptr support for setsockopt bpf: Add sockptr support for getsockopt commit a80712b9cc7e57830260ec5e1feb9cdb59e1da2f Author: Frederic Weisbecker Date: Fri Oct 27 16:40:49 2023 +0200 rcu/tasks-trace: Handle new PF_IDLE semantics The commit: cff9b2332ab7 ("kernel/sched: Modify initial boot task idle setup") has changed the semantics of what is to be considered an idle task in such a way that the idle task of an offline CPU may not carry the PF_IDLE flag anymore. However RCU-tasks-trace tests the opposite assertion, still assuming that idle tasks carry the PF_IDLE flag during their whole lifecycle. Remove this assumption to avoid spurious warnings but keep the initial test verifying that the idle task is the current task on any offline CPU. Reported-by: Naresh Kamboju Fixes: cff9b2332ab7 ("kernel/sched: Modify initial boot task idle setup") Suggested-by: Joel Fernandes Suggested-by: Paul E . McKenney" Acked-by: Peter Zijlstra (Intel) Signed-off-by: Frederic Weisbecker commit ffa059b262ba72571e7fefe7fa2b4ebb6776b277 Merge: ca995ce438cc6 6ce4a93dbb5bd Author: Linus Torvalds Date: Wed Nov 1 11:09:19 2023 -1000 Merge tag 'for-6.7/io_uring-2023-10-30' of git://git.kernel.dk/linux Pull io_uring updates from Jens Axboe: "This contains the core io_uring updates, of which there are not many, and adds support for using WAITID through io_uring and hence not needing to block on these kinds of events. Outside of that, tweaks to the legacy provided buffer handling and some cleanups related to cancelations for uring_cmd support" * tag 'for-6.7/io_uring-2023-10-30' of git://git.kernel.dk/linux: io_uring/poll: use IOU_F_TWQ_LAZY_WAKE for wakeups io_uring/kbuf: Use slab for struct io_buffer objects io_uring/kbuf: Allow the full buffer id space for provided buffers io_uring/kbuf: Fix check of BID wrapping in provided buffers io_uring/rsrc: cleanup io_pin_pages() io_uring: cancelable uring_cmd io_uring: retain top 8bits of uring_cmd flags for kernel internal use io_uring: add IORING_OP_WAITID support exit: add internal include file with helpers exit: add kernel_waitid_prepare() helper exit: move core of do_wait() into helper exit: abstract out should_wake helper for child_wait_callback() io_uring/rw: add support for IORING_OP_READ_MULTISHOT io_uring/rw: mark readv/writev as vectored in the opcode definition io_uring/rw: split io_read() into a helper commit 9715ed501b585d47444865071674c961c0cc0020 Author: Frederic Weisbecker Date: Fri Oct 27 16:40:48 2023 +0200 rcu/tasks: Handle new PF_IDLE semantics The commit: cff9b2332ab7 ("kernel/sched: Modify initial boot task idle setup") has changed the semantics of what is to be considered an idle task in such a way that CPU boot code preceding the actual idle loop is excluded from it. This has however introduced new potential RCU-tasks stalls when either: 1) Grace period is started before init/0 had a chance to set PF_IDLE, keeping it stuck in the holdout list until idle ever schedules. 2) Grace period is started when some possible CPUs have never been online, keeping their idle tasks stuck in the holdout list until the CPU ever boots up. 3) Similar to 1) but with secondary CPUs: Grace period is started concurrently with secondary CPU booting, putting its idle task in the holdout list because PF_IDLE isn't yet observed on it. It stays then stuck in the holdout list until that CPU ever schedules. The effect is mitigated here by the hotplug AP thread that must run to bring the CPU up. Fix this with handling the new semantics of PF_IDLE, keeping in mind that it may or may not be set on an idle task. Take advantage of that to strengthen the coverage of an RCU-tasks quiescent state within an idle task, excluding the CPU boot code from it. Only the code running within the idle loop is now a quiescent state, along with offline CPUs. Fixes: cff9b2332ab7 ("kernel/sched: Modify initial boot task idle setup") Suggested-by: Joel Fernandes Suggested-by: Paul E . McKenney" Acked-by: Peter Zijlstra (Intel) Signed-off-by: Frederic Weisbecker commit 2be4686d866ad5896f2bb94d82fe892197aea9c7 Author: Frederic Weisbecker Date: Fri Oct 27 16:40:47 2023 +0200 rcu: Introduce rcu_cpu_online() Export the RCU point of view as to when a CPU is considered offline (ie: when does RCU consider that a CPU is sufficiently down in the hotplug process to not feature any possible read side). This will be used by RCU-tasks whose vision of an offline CPU should reasonably match the one of RCU core. Fixes: cff9b2332ab7 ("kernel/sched: Modify initial boot task idle setup") Acked-by: Peter Zijlstra (Intel) Signed-off-by: Frederic Weisbecker commit ca995ce438cc641c47d4b8e4abeb1878a3d07c5f Merge: 8999ad99f4cb1 2c269f42d0f38 Author: Linus Torvalds Date: Wed Nov 1 10:46:48 2023 -1000 Merge tag 'for-linus-6.7-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from Juergen Gross: - two small cleanup patches - a fix for PCI passthrough under Xen - a four patch series speeding up virtio under Xen with user space backends * tag 'for-linus-6.7-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen-pciback: Consider INTx disabled when MSI/MSI-X is enabled xen: privcmd: Add support for ioeventfd xen: evtchn: Allow shared registration of IRQ handers xen: irqfd: Use _IOW instead of the internal _IOC() macro xen: Make struct privcmd_irqfd's layout architecture independent xen/xenbus: Add __counted_by for struct read_buffer and use struct_size() xenbus: fix error exit in xenbus_init() commit 85d68222ddc5f4522e456d97d201166acb50f716 Author: Peter Zijlstra Date: Tue Oct 31 09:53:08 2023 +0100 rcu: Break rcu_node_0 --> &rq->__lock order Commit 851a723e45d1 ("sched: Always clear user_cpus_ptr in do_set_cpus_allowed()") added a kfree() call to free any user provided affinity mask, if present. It was changed later to use kfree_rcu() in commit 9a5418bc48ba ("sched/core: Use kfree_rcu() in do_set_cpus_allowed()") to avoid a circular locking dependency problem. It turns out that even kfree_rcu() isn't safe for avoiding circular locking problem. As reported by kernel test robot, the following circular locking dependency now exists: &rdp->nocb_lock --> rcu_node_0 --> &rq->__lock Solve this by breaking the rcu_node_0 --> &rq->__lock chain by moving the resched_cpu() out from under rcu_node lock. [peterz: heavily borrowed from Waiman's Changelog] [paulmck: applied Z qiang feedback] Fixes: 851a723e45d1 ("sched: Always clear user_cpus_ptr in do_set_cpus_allowed()") Reported-by: kernel test robot Acked-by: Waiman Long Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/oe-lkp/202310302207.a25f1a30-oliver.sang@intel.com Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 8999ad99f4cb19638d9ecb8017831f9a0ab8dc3d Merge: f00593e09968e 9ee4318c157b9 Author: Linus Torvalds Date: Wed Nov 1 10:28:32 2023 -1000 Merge tag 'x86_tdx_for_6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 TDX updates from Dave Hansen: "The majority of this is a rework of the assembly and C wrappers that are used to talk to the TDX module and VMM. This is a nice cleanup in general but is also clearing the way for using this code when Linux is the TDX VMM. There are also some tidbits to make TDX guests play nicer with Hyper-V and to take advantage the hardware TSC. Summary: - Refactor and clean up TDX hypercall/module call infrastructure - Handle retrying/resuming page conversion hypercalls - Make sure to use the (shockingly) reliable TSC in TDX guests" [ TLA reminder: TDX is "Trust Domain Extensions", Intel's guest VM confidentiality technology ] * tag 'x86_tdx_for_6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/tdx: Mark TSC reliable x86/tdx: Fix __noreturn build warning around __tdx_hypercall_failed() x86/virt/tdx: Make TDX_MODULE_CALL handle SEAMCALL #UD and #GP x86/virt/tdx: Wire up basic SEAMCALL functions x86/tdx: Remove 'struct tdx_hypercall_args' x86/tdx: Reimplement __tdx_hypercall() using TDX_MODULE_CALL asm x86/tdx: Make TDX_HYPERCALL asm similar to TDX_MODULE_CALL x86/tdx: Extend TDX_MODULE_CALL to support more TDCALL/SEAMCALL leafs x86/tdx: Pass TDCALL/SEAMCALL input/output registers via a structure x86/tdx: Rename __tdx_module_call() to __tdcall() x86/tdx: Make macros of TDCALLs consistent with the spec x86/tdx: Skip saving output regs when SEAMCALL fails with VMFailInvalid x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro x86/tdx: Retry partially-completed page conversion hypercalls commit 984a4afdc87a1fc226fd657b1cd8255c13d3fc1a Author: Ben Wolsieffer Date: Wed Nov 1 10:29:27 2023 -0400 regmap: prevent noinc writes from clobbering cache Currently, noinc writes are cached as if they were standard incrementing writes, overwriting unrelated register values in the cache. Instead, we want to cache the last value written to the register, as is done in the accelerated noinc handler (regmap_noinc_readwrite). Fixes: cdf6b11daa77 ("regmap: Add regmap_noinc_write API") Signed-off-by: Ben Wolsieffer Link: https://lore.kernel.org/r/20231101142926.2722603-2-ben.wolsieffer@hefring.com Signed-off-by: Mark Brown commit f00593e09968ed6dfcd10aebb13f470fbe3343b4 Merge: 979ff1e5af8a4 8a32aa17c1cd4 Author: Linus Torvalds Date: Wed Nov 1 10:21:07 2023 -1000 Merge tag 'parisc-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc updates from Helge Deller: "Usual fixes and updates: - Add up to 12 nops after TLB inserts for PA8x00 CPUs as the specification requires (Dave Anglin) - Simplify the parisc smp_prepare_boot_cpu() code (Russell King) - Use 64-bit little-endian values in SBA IOMMU PDIR table for AGP Since there is upcoming support for booting a 64-bit kernel on QEMU, some corner cases were fixed and improvements added: - Fix 64-bit kernel crash in STI (graphics console) font setup code which miscalculated the font start address as it gets signed vs unsigned offsets wrong - Support building an uncompressed Linux kernel - Add support for soft power-off in qemu" * tag 'parisc-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: fbdev: stifb: Make the STI next font pointer a 32-bit signed offset parisc: Show default CPU PSW.W setting as reported by PDC parisc/pdc: Add width field to struct pdc_model parisc: Add nop instructions after TLB inserts parisc: simplify smp_prepare_boot_cpu() parisc/agp: Use 64-bit LE values in SBA IOMMU PDIR table parisc/firmware: Use PDC constants for narrow/wide firmware parisc: Move parisc_narrow_firmware variable to header file parisc/power: Trivial whitespace cleanups and license update parisc/power: Add power soft-off when running on qemu parisc: Allow building uncompressed Linux kernel parisc: Add some missing PDC functions and constants parisc: sba-iommu: Fix comment when calculating IOC number commit 979ff1e5af8a46f75a69ffa86209f8650547f42f Merge: 56ec8e4cd8cbf 03191fb3db3d2 Author: Linus Torvalds Date: Wed Nov 1 10:13:07 2023 -1000 Merge tag 'm68k-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k updates from Geert Uytterhoeven: - misc aesthetical improvements for the floating point emulator - remove the last user of strlcpy() - use kernel's generic libgcc functions - misc fixes for W=1 builds - misc indentation fixes - misc fixes and improvements - defconfig updates * tag 'm68k-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: (72 commits) m68k: lib: Include for __muldi3() m68k: fpsp040: Fix indentation by 5 spaces m68k: Fix indentation by 2 or 5 spaces in m68k: kernel: Fix indentation by 7 spaces in traps.c m68k: sun3: Fix indentation by 5 or 7 spaces m68k: Fix indentation by 7 spaces in m68k: defconfig: Update virt_defconfig for v6.6-rc3 m68k: defconfig: Update defconfigs for v6.6-rc1 m68k: io: Mark mmio read addresses as const m68k: Replace GPL 2.0+ README.legal boilerplate with SPDX m68k: sun3: Change led_pattern[] to unsigned char m68k: Add missing types to asm/irq.h m68k: sun3/3x: Add and use "sun3.h" m68k: sun3x: Make dvma_print() static m68k: sun3x: Make sun3x_halt() static m68k: sun3x: Do not mark dvma_map_iommu() inline m68k: sun3x: Fix signature of sun3_leds() m68k: sun3: Make sun3_platform_init() static m68k: sun3: Make print_pte() static m68k: sun3: Annotate prom_printf() with __printf() ... commit ea0b0bcef4917a2640ecc100c768b8e785784834 Author: Kees Cook Date: Fri Sep 22 10:52:53 2023 -0700 module: Annotate struct module_notes_attrs with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct module_notes_attrs. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Luis Chamberlain Cc: linux-modules@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Luis Chamberlain commit fd06da776130ec2611c30272a0868f6a54cdf9d2 Author: Zhu Mao Date: Wed Sep 20 17:13:09 2023 -0700 module: Fix comment typo Delete duplicated word in comment. Signed-off-by: Zhu Mao Signed-off-by: Luis Chamberlain commit 04311b9b306388288f72cf6ebde659274b06ffd6 Author: Tiezhu Yang Date: Fri Jun 16 09:51:33 2023 +0800 module: Make is_valid_name() return bool The return value of is_valid_name() is true or false, so change its type to reflect that. Signed-off-by: Tiezhu Yang Signed-off-by: Luis Chamberlain commit 60da3640b07ce03706a8c77a3740ebad8b9af063 Author: Tiezhu Yang Date: Fri Jun 16 09:51:32 2023 +0800 module: Make is_mapping_symbol() return bool The return value of is_mapping_symbol() is true or false, so change its type to reflect that. Suggested-by: Xi Zhang Signed-off-by: Tiezhu Yang Signed-off-by: Luis Chamberlain commit 3737df782c740b944912ed93420c57344b1cf864 Author: Andrea Righi Date: Wed Aug 30 17:58:20 2023 +0200 module/decompress: use vmalloc() for gzip decompression workspace Use a similar approach as commit a419beac4a07 ("module/decompress: use vmalloc() for zstd decompression workspace") and replace kmalloc() with vmalloc() also for the gzip module decompression workspace. In this case the workspace is represented by struct inflate_workspace that can be fairly large for kmalloc() and it can potentially lead to allocation errors on certain systems: $ pahole inflate_workspace struct inflate_workspace { struct inflate_state inflate_state; /* 0 9544 */ /* --- cacheline 149 boundary (9536 bytes) was 8 bytes ago --- */ unsigned char working_window[32768]; /* 9544 32768 */ /* size: 42312, cachelines: 662, members: 2 */ /* last cacheline: 8 bytes */ }; Considering that there is no need to use continuous physical memory, simply switch to vmalloc() to provide a more reliable in-kernel module decompression. Fixes: b1ae6dc41eaa ("module: add in-kernel support for decompressing") Signed-off-by: Andrea Righi Signed-off-by: Luis Chamberlain commit 62eedac264159690b4fed78aeec4d3623ce253b7 Author: Luis Chamberlain Date: Wed Sep 20 14:07:58 2023 -0700 MAINTAINERS: add include/linux/module*.h to modules Use glob include/linux/module*.h to capture all module changes. Suggested-by: Kees Cook Reviewed-by: Kees Cook Signed-off-by: Luis Chamberlain commit 2c7ccb3c362bc86aeb3e52d6fbf15f7f480ca961 Author: Kees Cook Date: Wed Sep 13 16:54:14 2023 -0700 module: Clarify documentation of module_param_call() Commit 9bbb9e5a3310 ("param: use ops in struct kernel_param, rather than get and set fns directly") added the comment that module_param_call() was deprecated, during a large scale refactoring to bring sanity to type casting back then. In 2017 following more cleanups, it became useful again as it wraps a common pattern of creating an ops struct for a given get/set pair: b2f270e87473 ("module: Prepare to convert all module_param_call() prototypes") ece1996a21ee ("module: Do not paper over type mismatches in module_param_call()") static const struct kernel_param_ops __param_ops_##name = \ { .flags = 0, .set = _set, .get = _get }; \ __module_param_call(MODULE_PARAM_PREFIX, \ name, &__param_ops_##name, arg, perm, -1, 0) __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1, 0) Many users of module_param_cb() appear to be almost universally open-coding the same thing that module_param_call() does now. Don't discourage[1] people from using module_param_call(): clarify the comment to show that module_param_cb() is useful if you repeatedly use the same pair of get/set functions. [1] https://lore.kernel.org/lkml/202308301546.5C789E5EC@keescook/ Cc: Luis Chamberlain Cc: Johan Hovold Cc: Jessica Yu Cc: Sagi Grimberg Cc: Nick Desaulniers Cc: Miguel Ojeda Cc: Joe Perches Cc: linux-modules@vger.kernel.org Reviewed-by: Miguel Ojeda Signed-off-by: Kees Cook Signed-off-by: Luis Chamberlain commit 6620999f0d41e4fd6f047727936a964c3399d249 Author: Ben Wolsieffer Date: Tue Oct 31 16:22:36 2023 -0400 scripts/gdb/vmalloc: disable on no-MMU vmap_area does not exist on no-MMU, therefore the GDB scripts fail to load: Traceback (most recent call last): File "<...>/vmlinux-gdb.py", line 51, in import linux.vmalloc File "<...>/scripts/gdb/linux/vmalloc.py", line 14, in vmap_area_ptr_type = vmap_area_type.get_type().pointer() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "<...>/scripts/gdb/linux/utils.py", line 28, in get_type self._type = gdb.lookup_type(self._name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ gdb.error: No struct type named vmap_area. To fix this, disable the command and add an informative error message if CONFIG_MMU is not defined, following the example of lx-slabinfo. Link: https://lkml.kernel.org/r/20231031202235.2655333-2-ben.wolsieffer@hefring.com Fixes: 852622bf3616 ("scripts/gdb/vmalloc: add vmallocinfo support") Signed-off-by: Ben Wolsieffer Cc: Jan Kiszka Cc: Kieran Bingham Cc: Kuan-Ying Lee Cc: Signed-off-by: Andrew Morton commit 16501630bdeb107141a0139ddc33f92ab5582c6f Author: Clément Léger Date: Tue Oct 31 13:49:04 2023 +0000 scripts/gdb: fix usage of MOD_TEXT not defined when CONFIG_MODULES=n MOD_TEXT is only defined if CONFIG_MODULES=y which lead to loading failure of the gdb scripts when kernel is built without CONFIG_MODULES=y: Reading symbols from vmlinux... Traceback (most recent call last): File "/foo/vmlinux-gdb.py", line 25, in import linux.constants File "/foo/scripts/gdb/linux/constants.py", line 14, in LX_MOD_TEXT = gdb.parse_and_eval("MOD_TEXT") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ gdb.error: No symbol "MOD_TEXT" in current context. Add a conditional check on CONFIG_MODULES to fix this error. Link: https://lkml.kernel.org/r/20231031134848.119391-1-da.gomez@samsung.com Fixes: b4aff7513df3 ("scripts/gdb: use mem instead of core_layout to get the module address") Signed-off-by: Clément Léger Tested-by: Daniel Gomez Signed-off-by: Daniel Gomez Cc: Jan Kiszka Cc: Kieran Bingham Cc: Luis Chamberlain Cc: Pankaj Raghav Signed-off-by: Andrew Morton commit 4aa8f278b94e1885a9b42c1c765c4edddfdc42f1 Author: Bagas Sanjaya Date: Tue Oct 31 08:40:00 2023 +0700 .mailmap: add address mapping for Tomeu Vizoso He's no longer working in Collabora (and his email address there bounces). Map it to his personal address. Link: https://lkml.kernel.org/r/20231031014009.22765-2-bagasdotme@gmail.com Signed-off-by: Bagas Sanjaya Acked-by: Tomeu Vizoso Cc: Bjorn Andersson Cc: Heiko Stuebner Cc: Jakub Kicinski Cc: Jens Axboe Cc: Konrad Dybcio Cc: Stephen Hemminger Signed-off-by: Andrew Morton commit fbbc2af38463add04af0117671b006866052e43b Author: Claudiu Beznea Date: Mon Oct 30 08:36:32 2023 +0200 mailmap: update email address for Claudiu Beznea Claudiu Beznea's Microchip email address is no longer valid. Map it to a valid one. Link: https://lkml.kernel.org/r/20231030063632.1707372-1-claudiu.beznea@tuxon.dev Signed-off-by: Claudiu Beznea Cc: Bjorn Andersson Cc: Heiko Stuebner Cc: Jakub Kicinski Cc: Jens Axboe Cc: Konrad Dybcio Cc: Oleksij Rempel Signed-off-by: Andrew Morton commit 2ffc27b15b11c9584ac46335c2ed2248d2aa4137 Author: Itaru Kitayama Date: Mon Oct 30 17:54:45 2023 +0900 tools/testing/selftests/mm/run_vmtests.sh: lower the ptrace permissions On Ubuntu and probably other distros, ptrace permissions are tightend a bit by default; i.e., /proc/sys/kernel/yama/ptrace_score is set to 1. This cases memfd_secret's ptrace attach test fails with a permission error. Set it to 0 piror to running the program. Link: https://lkml.kernel.org/r/20231030-selftest-v1-1-743df68bb996@linux.dev Signed-off-by: Itaru Kitayama Cc: Shuah Khan Signed-off-by: Andrew Morton commit 90723a82d8a54d98b3ed77161eb5f786ec2b3927 Author: Bagas Sanjaya Date: Mon Oct 30 21:24:55 2023 +0700 .mailmap: map Benjamin Poirier's address Map out to his gmail address as he had left SUSE some time ago. Link: https://lkml.kernel.org/r/20231030142454.22127-2-bagasdotme@gmail.com Signed-off-by: Bagas Sanjaya Acked-by: Benjamin Poirier Cc: Bjorn Andersson Cc: Greg Kroah-Hartman Cc: Heiko Stuebner Cc: Jakub Kicinski Cc: Konrad Dybcio Cc: Oleksij Rempel Cc: Stephen Hemminger Signed-off-by: Andrew Morton commit cd24f44050f31d69ed5851b55ef77ea6346aa814 Author: Deepak Gupta Date: Thu Oct 26 16:38:23 2023 -0700 scripts/gdb: add lx_current support for riscv csr_sscratch CSR holds current task_struct address when hart is in user space. Trap handler on entry spills csr_sscratch into "tp" (x2) register and zeroes out csr_sscratch CSR. Trap handler on exit reloads "tp" with expected user mode value and place current task_struct address again in csr_sscratch CSR. This patch assumes "tp" is pointing to task_struct. If value in csr_sscratch is numerically greater than "tp" then it assumes csr_sscratch is correct address of current task_struct. This logic holds when - hart is in user space, "tp" will be less than csr_sscratch. - hart is in kernel space but not in trap handler, "tp" will be more than csr_sscratch (csr_sscratch being equal to 0). - hart is executing trap handler - "tp" is still pointing to user mode but csr_sscratch contains ptr to task_struct. Thus numerically higher. - "tp" is pointing to task_struct but csr_sscratch now contains either 0 or numerically smaller value (transiently holds user mode tp) Link: https://lkml.kernel.org/r/20231026233837.612405-1-debug@rivosinc.com Signed-off-by: Deepak Gupta Reviewed-by: Andrew Jones Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Tested-by: Hsieh-Tseng Shen Cc: Albert Ou Cc: Glenn Washburn Cc: Jan Kiszka Cc: Jeff Xie Cc: Kieran Bingham Cc: Palmer Dabbelt Cc: Paul Walmsley Signed-off-by: Andrew Morton commit e3bc0c427f2aee757c249e0f087b0a0e810d66e3 Author: Kunwu Chan Date: Wed Oct 25 15:29:06 2023 +0800 ocfs2: fix a spelling typo in comment Fix a spelling typo in comment. Link: https://lkml.kernel.org/r/20231025072906.14285-1-chentao@kylinos.cn Signed-off-by: Kunwu Chan Acked-by: Joseph Qi Signed-off-by: Andrew Morton commit bf5add391eeb450b502d2593c05f84982724e6a2 Author: Swarup Laxman Kotiaklapudi Date: Fri Oct 27 17:26:24 2023 +0300 proc: test ProtectionKey in proc-empty-vm test Check ProtectionKey field in /proc/*/smaps output, if system supports protection keys feature. [adobriyan@gmail.com: test support in the beginning of the program, use syscall, not glibc pkey_alloc(3) which may not compile] Link: https://lkml.kernel.org/r/ac05efa7-d2a0-48ad-b704-ffdd5450582e@p183 Signed-off-by: Swarup Laxman Kotiaklapudi Signed-off-by: Alexey Dobriyan Reviewed-by: Swarup Laxman Kotikalapudi Tested-by: Swarup Laxman Kotikalapudi Signed-off-by: Andrew Morton commit 20e34aa7e08dbac5d7f757fea81fae8df462aa42 Author: Alexey Dobriyan Date: Fri Oct 27 17:21:03 2023 +0300 proc: fix proc-empty-vm test with vsyscall * fix embarassing /proc/*/smaps test bug due to a typo in variable name it tested only the first line of the output if vsyscall is enabled: ffffffffff600000-ffffffffff601000 r-xp ... so test passed but tested only VMA location and permissions. * add "KSM" entry, unnoticed because (1) * swap "r-xp" and "--xp" vsyscall test strings, also unnoticed because (1) Link: https://lkml.kernel.org/r/76f42cce-b1ab-45ec-b6b2-4c64f0dccb90@p183 Signed-off-by: Alexey Dobriyan Tested-by: Swarup Laxman Kotikalapudi Signed-off-by: Andrew Morton commit 639931020e1a70308a5c71f4702443429cb6899c Author: Yang Li Date: Thu Oct 26 08:56:34 2023 +0800 fs/proc/base.c: remove unneeded semicolon ./fs/proc/base.c:3829:2-3: Unneeded semicolon Link: https://lkml.kernel.org/r/20231026005634.6581-1-yang.lee@linux.alibaba.com Signed-off-by: Yang Li Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7057 Acked-by: Oleg Nesterov Signed-off-by: Andrew Morton commit 1df4bd83cdfdbd0720ddb2c6488b7e9a432ba468 Author: Oleg Nesterov Date: Mon Oct 23 17:34:05 2023 +0200 do_io_accounting: use sig->stats_lock Rather than lock_task_sighand(), sig->stats_lock was specifically designed for this type of use. This way the "if (whole)" branch runs lockless in the likely case. Link: https://lkml.kernel.org/r/20231023153405.GA4639@redhat.com Signed-off-by: Oleg Nesterov Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton commit 2320222067887f58dc9d7dba2e3ec285d02d45f3 Author: Oleg Nesterov Date: Mon Oct 23 17:33:43 2023 +0200 do_io_accounting: use __for_each_thread() Rather than while_each_thread() which should be avoided when possible. This makes the code more clear and allows the next change. Link: https://lkml.kernel.org/r/20231023153343.GA4629@redhat.com Signed-off-by: Oleg Nesterov Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton commit 873ed7222c17cfd3cba1b1147552171581ffa6ca Author: Jia Rui Date: Thu Oct 19 03:18:11 2023 +0800 ocfs2: replace BUG_ON() at ocfs2_num_free_extents() with ocfs2_error() The BUG_ON() at ocfs2_num_free_extents() handles the error that l_tree_deepth of leaf extent block just read form disk is invalid. This error is mostly caused by file system metadata corruption on the disk. There is no need to call BUG_ON() to handle such errors. We can return error code, since the caller can deal with errors from ocfs2_num_free_extents(). Also, we should make the file system read-only to avoid the damage from expanding. Therefore, BUG_ON() is removed and ocfs2_error() is called instead. Link: https://lkml.kernel.org/r/20231018191811.412458-1-jindui71@gmail.com Signed-off-by: Jia Rui Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton commit f003a717ae9086b1e8a4663124a96862df7282e7 Author: Matthew Wilcox (Oracle) Date: Fri Sep 15 18:33:33 2023 +0100 nfs: Convert nfs_symlink() to use a folio Use the folio APIs, saving about four calls to compound_head(). Convert back to a page in each of the individual protocol implementations. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Trond Myklebust commit bfca5fb4e97c46503ddfc582335917b0cc228264 Author: felix Date: Mon Oct 23 09:40:19 2023 +0800 SUNRPC: Fix RPC client cleaned up the freed pipefs dentries RPC client pipefs dentries cleanup is in separated rpc_remove_pipedir() workqueue,which takes care about pipefs superblock locking. In some special scenarios, when kernel frees the pipefs sb of the current client and immediately alloctes a new pipefs sb, rpc_remove_pipedir function would misjudge the existence of pipefs sb which is not the one it used to hold. As a result, the rpc_remove_pipedir would clean the released freed pipefs dentries. To fix this issue, rpc_remove_pipedir should check whether the current pipefs sb is consistent with the original pipefs sb. This error can be catched by KASAN: ========================================================= [ 250.497700] BUG: KASAN: slab-use-after-free in dget_parent+0x195/0x200 [ 250.498315] Read of size 4 at addr ffff88800a2ab804 by task kworker/0:18/106503 [ 250.500549] Workqueue: events rpc_free_client_work [ 250.501001] Call Trace: [ 250.502880] kasan_report+0xb6/0xf0 [ 250.503209] ? dget_parent+0x195/0x200 [ 250.503561] dget_parent+0x195/0x200 [ 250.503897] ? __pfx_rpc_clntdir_depopulate+0x10/0x10 [ 250.504384] rpc_rmdir_depopulate+0x1b/0x90 [ 250.504781] rpc_remove_client_dir+0xf5/0x150 [ 250.505195] rpc_free_client_work+0xe4/0x230 [ 250.505598] process_one_work+0x8ee/0x13b0 ... [ 22.039056] Allocated by task 244: [ 22.039390] kasan_save_stack+0x22/0x50 [ 22.039758] kasan_set_track+0x25/0x30 [ 22.040109] __kasan_slab_alloc+0x59/0x70 [ 22.040487] kmem_cache_alloc_lru+0xf0/0x240 [ 22.040889] __d_alloc+0x31/0x8e0 [ 22.041207] d_alloc+0x44/0x1f0 [ 22.041514] __rpc_lookup_create_exclusive+0x11c/0x140 [ 22.041987] rpc_mkdir_populate.constprop.0+0x5f/0x110 [ 22.042459] rpc_create_client_dir+0x34/0x150 [ 22.042874] rpc_setup_pipedir_sb+0x102/0x1c0 [ 22.043284] rpc_client_register+0x136/0x4e0 [ 22.043689] rpc_new_client+0x911/0x1020 [ 22.044057] rpc_create_xprt+0xcb/0x370 [ 22.044417] rpc_create+0x36b/0x6c0 ... [ 22.049524] Freed by task 0: [ 22.049803] kasan_save_stack+0x22/0x50 [ 22.050165] kasan_set_track+0x25/0x30 [ 22.050520] kasan_save_free_info+0x2b/0x50 [ 22.050921] __kasan_slab_free+0x10e/0x1a0 [ 22.051306] kmem_cache_free+0xa5/0x390 [ 22.051667] rcu_core+0x62c/0x1930 [ 22.051995] __do_softirq+0x165/0x52a [ 22.052347] [ 22.052503] Last potentially related work creation: [ 22.052952] kasan_save_stack+0x22/0x50 [ 22.053313] __kasan_record_aux_stack+0x8e/0xa0 [ 22.053739] __call_rcu_common.constprop.0+0x6b/0x8b0 [ 22.054209] dentry_free+0xb2/0x140 [ 22.054540] __dentry_kill+0x3be/0x540 [ 22.054900] shrink_dentry_list+0x199/0x510 [ 22.055293] shrink_dcache_parent+0x190/0x240 [ 22.055703] do_one_tree+0x11/0x40 [ 22.056028] shrink_dcache_for_umount+0x61/0x140 [ 22.056461] generic_shutdown_super+0x70/0x590 [ 22.056879] kill_anon_super+0x3a/0x60 [ 22.057234] rpc_kill_sb+0x121/0x200 Fixes: 0157d021d23a ("SUNRPC: handle RPC client pipefs dentries by network namespace aware routines") Signed-off-by: felix Signed-off-by: Trond Myklebust commit 5cc7688bae7f0757c39c1d3dfdd827b724061067 Author: Olga Kornievskaia Date: Fri Oct 13 11:04:10 2023 -0400 NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO If the client is doing pnfs IO and Kerberos is configured and EXCHANGEID successfully negotiated SP4_MACH_CRED and WRITE/COMMIT are on the list of state protected operations, then we need to make sure to choose the DS's rpc_client structure instead of the MDS's one. Fixes: fb91fb0ee7b2 ("NFS: Move call to nfs4_state_protect_write() to nfs4_write_setup()") Signed-off-by: Olga Kornievskaia Signed-off-by: Trond Myklebust commit 4f3ed837186fc0d2722ba8d2457a594322e9c2ef Author: Dan Carpenter Date: Wed Oct 11 11:00:22 2023 +0300 SUNRPC: Add an IS_ERR() check back to where it was This IS_ERR() check was deleted during in a cleanup because, at the time, the rpcb_call_async() function could not return an error pointer. That changed in commit 25cf32ad5dba ("SUNRPC: Handle allocation failure in rpc_new_task()") and now it can return an error pointer. Put the check back. A related revert was done in commit 13bd90141804 ("Revert "SUNRPC: Remove unreachable error condition""). Fixes: 037e910b52b0 ("SUNRPC: Remove unreachable error condition in rpcb_getport_async()") Signed-off-by: Dan Carpenter Signed-off-by: Trond Myklebust commit 6bd1a77dc72dea0b0d8b6014f231143984d18f6d Author: Olga Kornievskaia Date: Fri Sep 15 15:21:16 2023 -0400 NFSv4.1: fix handling NFS4ERR_DELAY when testing for session trunking Currently when client sends an EXCHANGE_ID for a possible trunked connection, for any error that happened, the trunk will be thrown out. However, an NFS4ERR_DELAY is a transient error that should be retried instead. Fixes: e818bd085baf ("NFSv4.1 remove xprt from xprt_switch if session trunking test fails") Signed-off-by: Olga Kornievskaia Signed-off-by: Trond Myklebust commit a68c6fbb638a1aaad34b99f9e647072dcc711021 Author: Mkrtchyan, Tigran Date: Mon Sep 11 16:59:04 2023 +0200 nfs41: drop dependency between flexfiles layout driver and NFSv3 modules The flexfiles layout driver depends on NFSv3 module as data servers might be configure to provide nfsv3 only. Disabling the nfsv3 protocol completely disables the flexfiles layout driver, however, the data server still might support v4.1 protocol. Thus the strond couling betwwen flexfiles and nfsv3 modules should be relaxed, as layout driver will return UNSUPPORTED if not matching protocol is found. Signed-off-by: Tigran Mkrtchyan Signed-off-by: Trond Myklebust commit 9732336006764e2ee61225387e3c70eae9139035 Author: SeongJae Park Date: Tue Oct 31 17:01:31 2023 +0000 mm/damon/sysfs: update monitoring target regions for online input commit When user input is committed online, DAMON sysfs interface is ignoring the user input for the monitoring target regions. Such request is valid and useful for fixed monitoring target regions-based monitoring ops like 'paddr' or 'fvaddr'. Update the region boundaries as user specified, too. Note that the monitoring results of the regions that overlap between the latest monitoring target regions and the new target regions are preserved. Treat empty monitoring target regions user request as a request to just make no change to the monitoring target regions. Otherwise, users should set the monitoring target regions same to current one for every online input commit, and it could be challenging for dynamic monitoring target regions update DAMON ops like 'vaddr'. If the user really need to remove all monitoring target regions, they can simply remove the target and then create the target again with empty target regions. Link: https://lkml.kernel.org/r/20231031170131.46972-1-sj@kernel.org Fixes: da87878010e5 ("mm/damon/sysfs: support online inputs update") Signed-off-by: SeongJae Park Cc: [5.19+] Signed-off-by: Andrew Morton commit 19467a950b49432a84bf6dbadbbb17bdf89418b7 Author: SeongJae Park Date: Sun Oct 22 21:07:33 2023 +0000 mm/damon/sysfs: remove requested targets when online-commit inputs damon_sysfs_set_targets(), which updates the targets of the context for online commitment, do not remove targets that removed from the corresponding sysfs files. As a result, more than intended targets of the context can exist and hence consume memory and monitoring CPU resource more than expected. Fix it by removing all targets of the context and fill up again using the user input. This could cause unnecessary memory dealloc and realloc operations, but this is not a hot code path. Also, note that damon_target is stateless, and hence no data is lost. [sj@kernel.org: fix unnecessary monitoring results removal] Link: https://lkml.kernel.org/r/20231028213353.45397-1-sj@kernel.org Link: https://lkml.kernel.org/r/20231022210735.46409-2-sj@kernel.org Fixes: da87878010e5 ("mm/damon/sysfs: support online inputs update") Signed-off-by: SeongJae Park Cc: Brendan Higgins Cc: [5.19.x] Signed-off-by: Andrew Morton commit 6479b29203dedb724f4f4e08e1cc0dcf432c333b Author: Nhat Pham Date: Fri Oct 20 15:20:09 2023 -0700 selftests: add a sanity check for zswap We recently encountered a bug that makes all zswap store attempt fail. Specifically, after: "141fdeececb3 mm/zswap: delay the initialization of zswap" if we build a kernel with zswap disabled by default, then enabled after the swapfile is set up, the zswap tree will not be initialized. As a result, all zswap store calls will be short-circuited. We have to perform another swapon to get zswap working properly again. Fortunately, this issue has since been fixed by the patch that kills frontswap: "42c06a0e8ebe mm: kill frontswap" which performs zswap_swapon() unconditionally, i.e always initializing the zswap tree. This test add a sanity check that ensure zswap storing works as intended. Link: https://lkml.kernel.org/r/20231020222009.2358953-1-nphamcs@gmail.com Signed-off-by: Nhat Pham Acked-by: Rik van Riel Cc: Domenico Cerasuolo Cc: Johannes Weiner Cc: Shuah Khan Cc: Tejun Heo Cc: Zefan Li Signed-off-by: Andrew Morton commit 9e1b016a0bc97112a18427bce1b6849d28c6eb91 Author: Tom Yang Date: Mon Oct 23 17:57:37 2023 +0800 Documentation: maple_tree: fix word spelling error The "first" is spelled "fist". Link: https://lkml.kernel.org/r/20231023095737.21823-1-yangqixiao@inspur.com Signed-off-by: Tom Yang Reviewed-by: Liam R. Howlett Signed-off-by: Andrew Morton commit ca6c2ce1b481996ae5b16e4589d3c0dd61899fa8 Author: Baoquan He Date: Wed Oct 18 22:50:14 2023 +0800 mm/vmalloc: fix the unchecked dereference warning in vread_iter() LKP reported smatch warning as below: =================== smatch warnings: mm/vmalloc.c:3689 vread_iter() error: we previously assumed 'vm' could be null (see line 3667) ...... 06c8994626d1b7 @3667 size = vm ? get_vm_area_size(vm) : va_size(va); ...... 06c8994626d1b7 @3689 else if (!(vm->flags & VM_IOREMAP)) ^^^^^^^^^ Unchecked dereference ===================== This is not a runtime bug because the possible null 'vm' in the pointed place could only happen when flags == VMAP_BLOCK. However, the case 'flags == VMAP_BLOCK' should never happen and has been detected with WARN_ON. Please check vm_map_ram() implementation and the earlier checking in vread_iter() at below: ~~~~~~~~~~~~~~~~~~~~~~~~~~ /* * VMAP_BLOCK indicates a sub-type of vm_map_ram area, need * be set together with VMAP_RAM. */ WARN_ON(flags == VMAP_BLOCK); if (!vm && !flags) continue; ~~~~~~~~~~~~~~~~~~~~~~~~~~ So add checking on whether 'vm' could be null when dereferencing it in vread_iter(). This mutes smatch complaint. Link: https://lkml.kernel.org/r/ZTCURc8ZQE+KrTvS@MiWiFi-R3L-srv Link: https://lkml.kernel.org/r/ZS/2k6DIMd0tZRgK@MiWiFi-R3L-srv Signed-off-by: Baoquan He Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202310171600.WCrsOwFj-lkp@intel.com/ Cc: Lorenzo Stoakes Cc: Philip Li Signed-off-by: Andrew Morton commit cb61dad80fdc6a8f01b101e823a9335cd6d61071 Author: Nhat Pham Date: Tue Oct 24 16:45:09 2023 -0700 zswap: export compression failure stats During a zswap store attempt, the compression algorithm could fail (for e.g due to the page containing incompressible random data). This is not tracked in any of existing zswap counters, making it hard to monitor for and investigate. We have run into this problem several times in our internal investigations on zswap store failures. This patch adds a dedicated debugfs counter for compression algorithm failures. Link: https://lkml.kernel.org/r/20231024234509.2680539-1-nphamcs@gmail.com Signed-off-by: Nhat Pham Reviewed-by: Sergey Senozhatsky Cc: Dan Streetman Cc: Domenico Cerasuolo Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Cc: Roman Gushchin Cc: Seth Jennings Cc: Shakeel Butt Cc: Vitaly Wool Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 9fb2047d23d5087e124e7bc7a0abdc3f0d7f5d7e Author: Andrey Konovalov Date: Tue Oct 24 17:37:50 2023 +0200 Documentation: ubsan: drop "the" from article title Drop "the" from the title of the documentation article for UBSAN, as it is redundant. Also add SPDX-License-Identifier for ubsan.rst. Link: https://lkml.kernel.org/r/5fb11a4743eea9d9232a5284dea0716589088fec.1698161845.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Signed-off-by: Andrew Morton commit 56ec8e4cd8cbff3c96c53cd8303bba924613b5ce Merge: 7d461b291e659 14dcf78a6c042 Author: Linus Torvalds Date: Wed Nov 1 09:34:55 2023 -1000 Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 updates from Catalin Marinas: "No major architecture features this time around, just some new HWCAP definitions, support for the Ampere SoC PMUs and a few fixes/cleanups. The bulk of the changes is reworking of the CPU capability checking code (cpus_have_cap() etc). - Major refactoring of the CPU capability detection logic resulting in the removal of the cpus_have_const_cap() function and migrating the code to "alternative" branches where possible - Backtrace/kgdb: use IPIs and pseudo-NMI - Perf and PMU: - Add support for Ampere SoC PMUs - Multi-DTC improvements for larger CMN configurations with multiple Debug & Trace Controllers - Rework the Arm CoreSight PMU driver to allow separate registration of vendor backend modules - Fixes: add missing MODULE_DEVICE_TABLE to the amlogic perf driver; use device_get_match_data() in the xgene driver; fix NULL pointer dereference in the hisi driver caused by calling cpuhp_state_remove_instance(); use-after-free in the hisi driver - HWCAP updates: - FEAT_SVE_B16B16 (BFloat16) - FEAT_LRCPC3 (release consistency model) - FEAT_LSE128 (128-bit atomic instructions) - SVE: remove a couple of pseudo registers from the cpufeature code. There is logic in place already to detect mismatched SVE features - Miscellaneous: - Reduce the default swiotlb size (currently 64MB) if no ZONE_DMA bouncing is needed. The buffer is still required for small kmalloc() buffers - Fix module PLT counting with !RANDOMIZE_BASE - Restrict CPU_BIG_ENDIAN to LLVM IAS 15.x or newer move synchronisation code out of the set_ptes() loop - More compact cpufeature displaying enabled cores - Kselftest updates for the new CPU features" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (83 commits) arm64: Restrict CPU_BIG_ENDIAN to GNU as or LLVM IAS 15.x or newer arm64: module: Fix PLT counting when CONFIG_RANDOMIZE_BASE=n arm64, irqchip/gic-v3, ACPI: Move MADT GICC enabled check into a helper perf: hisi: Fix use-after-free when register pmu fails drivers/perf: hisi_pcie: Initialize event->cpu only on success drivers/perf: hisi_pcie: Check the type first in pmu::event_init() arm64: cpufeature: Change DBM to display enabled cores arm64: cpufeature: Display the set of cores with a feature perf/arm-cmn: Enable per-DTC counter allocation perf/arm-cmn: Rework DTC counters (again) perf/arm-cmn: Fix DTC domain detection drivers: perf: arm_pmuv3: Drop some unused arguments from armv8_pmu_init() drivers: perf: arm_pmuv3: Read PMMIR_EL1 unconditionally drivers/perf: hisi: use cpuhp_state_remove_instance_nocalls() for hisi_hns3_pmu uninit process clocksource/drivers/arm_arch_timer: limit XGene-1 workaround arm64: Remove system_uses_lse_atomics() arm64: Mark the 'addr' argument to set_ptes() and __set_pte_at() as unused drivers/perf: xgene: Use device_get_match_data() perf/amlogic: add missing MODULE_DEVICE_TABLE arm64/mm: Hoist synchronization out of set_ptes() loop ... commit a9b8d90f87263f985fa14250fc8caf7bfcde8803 Author: Benjamin Coddington Date: Thu Aug 24 14:52:19 2023 -0400 NFSv4: fairly test all delegations on a SEQ4_ revocation When the client is required to use TEST_STATEID to discover which delegation(s) have been revoked, it may continually test delegations at the head of the list if the server continues to be unsatisfied and send SEQ4_STATUS_RECALLABLE_STATE_REVOKED. For a large number of delegations this behavior is prone to live-lock because the client may never be able to test and free revoked state at the end of the list since the SEQ4_STATUS_RECALLABLE_STATE_REVOKED will cause us to flag delegations at the head of the list to be tested. This problem is further exacerbated by the state manager's willingness to be scheduled out on a busy system while testing the list of delegations. Keep a generation counter for each attempt to test all delegations, and skip delegations that have already been tested in the current pass. Signed-off-by: Benjamin Coddington Tested-by: Torkil Svensgaard Tested-by: Ruben Vestergaard Signed-off-by: Trond Myklebust commit 8b793bcda61f6c3ed4f5b2ded7530ef6749580cb Author: Krister Johansen Date: Fri Oct 27 14:46:53 2023 -0700 watchdog: move softlockup_panic back to early_param Setting softlockup_panic from do_sysctl_args() causes it to take effect later in boot. The lockup detector is enabled before SMP is brought online, but do_sysctl_args runs afterwards. If a user wants to set softlockup_panic on boot and have it trigger should a softlockup occur during onlining of the non-boot processors, they could do this prior to commit f117955a2255 ("kernel/watchdog.c: convert {soft/hard}lockup boot parameters to sysctl aliases"). However, after this commit the value of softlockup_panic is set too late to be of help for this type of problem. Restore the prior behavior. Signed-off-by: Krister Johansen Cc: stable@vger.kernel.org Fixes: f117955a2255 ("kernel/watchdog.c: convert {soft/hard}lockup boot parameters to sysctl aliases") Signed-off-by: Luis Chamberlain commit 8001f49394e353f035306a45bcf504f06fca6355 Author: Krister Johansen Date: Fri Oct 27 14:46:40 2023 -0700 proc: sysctl: prevent aliased sysctls from getting passed to init The code that checks for unknown boot options is unaware of the sysctl alias facility, which maps bootparams to sysctl values. If a user sets an old value that has a valid alias, a message about an invalid parameter will be printed during boot, and the parameter will get passed to init. Fix by checking for the existence of aliased parameters in the unknown boot parameter code. If an alias exists, don't return an error or pass the value to init. Signed-off-by: Krister Johansen Cc: stable@vger.kernel.org Fixes: 0a477e1ae21b ("kernel/sysctl: support handling command line aliases") Signed-off-by: Luis Chamberlain commit 5c81f752c95313e0d7e7ab148b61c7152d1a824c Merge: ab5201e20c181 b729598c17475 Author: Mark Brown Date: Wed Nov 1 17:02:32 2023 +0000 ASoC: codecs: Modify some error codes Merge series from wangweidong.a@awinic.com: The maximum value that calib can set should be consistent with the maximum value of re. An error code should be return when the re is greater than the maximum value or less than the minimum value The value of vsense_select should be either 32 or 0 in both cases, so modify the AW88399_DEV_VDSEL_VSENSE macro to 32. commit 7d461b291e65938f15f56fe58da2303b07578a76 Merge: 8bc9e65151839 631808095a82e Author: Linus Torvalds Date: Wed Nov 1 06:28:35 2023 -1000 Merge tag 'drm-next-2023-10-31-1' of git://anongit.freedesktop.org/drm/drm Pull drm updates from Dave Airlie: "Highlights: - AMD adds some more upcoming HW platforms - Intel made Meteorlake stable and started adding Lunarlake - nouveau has a bunch of display rework in prepartion for the NVIDIA GSP firmware support - msm adds a7xx support - habanalabs has finished migration to accel subsystem Detail summary: kernel: - add initial vmemdup-user-array core: - fix platform remove() to return void - drm_file owner updated to reflect owner - move size calcs to drm buddy allocator - let GPUVM build as a module - allow variable number of run-queues in scheduler edid: - handle bad h/v sync_end in EDIDs panfrost: - add Boris as maintainer fbdev: - use fb_ops helpers more - only allow logo use from fbcon - rename fb_pgproto to pgprot_framebuffer - add HPD state to drm_connector_oob_hotplug_event - convert to fbdev i/o mem helpers i915: - Enable meteorlake by default - Early Xe2 LPD/Lunarlake display enablement - Rework subplatforms into IP version checks - GuC based TLB invalidation for Meteorlake - Display rework for future Xe driver integration - LNL FBC features - LNL display feature capability reads - update recommended fw versions for DG2+ - drop fastboot module parameter - added deviceid for Arrowlake-S - drop preproduction workarounds - don't disable preemption for resets - cleanup inlines in headers - PXP firmware loading fix - Fix sg list lengths - DSC PPS state readout/verification - Add more RPL P/U PCI IDs - Add new DG2-G12 stepping - DP enhanced framing support to state checker - Improve shared link bandwidth management - stop using GEM macros in display code - refactor related code into display code - locally enable W=1 warnings - remove PSR watchdog timers on LNL amdgpu: - RAS/FRU EEPROM updatse - IP discovery updatses - GC 11.5 support - DCN 3.5 support - VPE 6.1 support - NBIO 7.11 support - DML2 support - lots of IP updates - use flexible arrays for bo list handling - W=1 fixes - Enable seamless boot in more cases - Enable context type property for HDMI - Rework GPUVM TLB flushing - VCN IB start/size alignment fixes amdkfd: - GC 10/11 fixes - GC 11.5 support - use partial migration in GPU faults radeon: - W=1 Fixes - fix some possible buffer overflow/NULL derefs nouveau: - update uapi for NO_PREFETCH - scheduler/fence fixes - rework suspend/resume for GSP-RM - rework display in preparation for GSP-RM habanalabs: - uapi: expose tsc clock - uapi: block access to eventfd through control device - uapi: force dma-buf export to PAGE_SIZE alignments - complete move to accel subsystem - move firmware interface include files - perform hard reset on PCIe AXI drain event - optimise user interrupt handling msm: - DP: use existing helpers for DPCD - DPU: interrupts reworked - gpu: a7xx (a730/a740) support - decouple msm_drv from kms for headless devices mediatek: - MT8188 dsi/dp/edp support - DDP GAMMA - 12 bit LUT support - connector dynamic selection capability rockchip: - rv1126 mipi-dsi/vop support - add planar formats ast: - rename constants panels: - Mitsubishi AA084XE01 - JDI LPM102A188A - LTK050H3148W-CTA6 ivpu: - power management fixes qaic: - add detach slice bo api komeda: - add NV12 writeback tegra: - support NVSYNC/NHSYNC - host1x suspend fixes ili9882t: - separate into own driver" * tag 'drm-next-2023-10-31-1' of git://anongit.freedesktop.org/drm/drm: (1803 commits) drm/amdgpu: Remove unused variables from amdgpu_show_fdinfo drm/amdgpu: Remove duplicate fdinfo fields drm/amd/amdgpu: avoid to disable gfxhub interrupt when driver is unloaded drm/amdgpu: Add EXT_COHERENT support for APU and NUMA systems drm/amdgpu: Retrieve CE count from ce_count_lo_chip in EccInfo table drm/amdgpu: Identify data parity error corrected in replay mode drm/amdgpu: Fix typo in IP discovery parsing drm/amd/display: fix S/G display enablement drm/amdxcp: fix amdxcp unloads incompletely drm/amd/amdgpu: fix the GPU power print error in pm info drm/amdgpu: Use pcie domain of xcc acpi objects drm/amd: check num of link levels when update pcie param drm/amdgpu: Add a read to GFX v9.4.3 ring test drm/amd/pm: call smu_cmn_get_smc_version in is_mode1_reset_supported. drm/amdgpu: get RAS poison status from DF v4_6_2 drm/amdgpu: Use discovery table's subrevision drm/amd/display: 3.2.256 drm/amd/display: add interface to query SubVP status drm/amd/display: Read before writing Backlight Mode Set Register drm/amd/display: Disable SYMCLK32_SE RCO on DCN314 ... commit 4d75fc6ceba4d154f8a9b0905c669bac6ac570c2 Author: Darrick J. Wong Date: Tue Oct 31 16:48:20 2023 -0700 iomap: rotate maintainers Per a discussion last week, let's improve coordination between fs/iomap/ and the rest of the VFS by shifting Christian into the role of git tree maintainer. I'll stay on as reviewer and main developer, which will free up some more time to clean up the code base a bit and help filesystem maintainers port off of bufferheads and onto iomap. Link: https://lore.kernel.org/linux-fsdevel/20231026-gehofft-vorfreude-a5079bff7373@brauner/ Signed-off-by: Darrick J. Wong Link: https://lore.kernel.org/r/20231031234820.GB1205221@frogsfrogsfrogs Signed-off-by: Christian Brauner commit 9f23a5d2f6b01c2ab91d791109731a0d87ec2239 Author: Clément Léger Date: Wed Oct 4 17:14:05 2023 +0200 riscv: add support for PR_SET_UNALIGN and PR_GET_UNALIGN Now that trap support is ready to handle misalignment errors in S-mode, allow the user to control the behavior of misaligned accesses using prctl(PR_SET_UNALIGN). Add an align_ctl flag in thread_struct which will be used to determine if we should SIGBUS the process or not on such fault. Signed-off-by: Clément Léger Reviewed-by: Björn Töpel Link: https://lore.kernel.org/r/20231004151405.521596-9-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt commit 71c54b3d169db5569655cbd2a3616bc701fd5eec Author: Clément Léger Date: Wed Oct 4 17:14:04 2023 +0200 riscv: report misaligned accesses emulation to hwprobe hwprobe provides a way to report if misaligned access are emulated. In order to correctly populate that feature, we can check if it actually traps when doing a misaligned access. This can be checked using an exception table entry which will actually be used when a misaligned access is done from kernel mode. Signed-off-by: Clément Léger Link: https://lore.kernel.org/r/20231004151405.521596-8-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt commit 90b11b470b2e88ff583e04be109e6441cb69f54d Author: Clément Léger Date: Wed Oct 4 17:14:03 2023 +0200 riscv: annotate check_unaligned_access_boot_cpu() with __init This function is solely called as an initcall, thus annotate it with __init. Signed-off-by: Clément Léger Reviewed-by: Evan Green Link: https://lore.kernel.org/r/20231004151405.521596-7-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt commit bc38f61313d316d74c16ce7287d6dba2f42502c9 Author: Clément Léger Date: Wed Oct 4 17:14:02 2023 +0200 riscv: add support for sysctl unaligned_enabled control This sysctl tuning option allows the user to disable misaligned access handling globally on the system. This will also be used by misaligned detection code to temporarily disable misaligned access handling. Signed-off-by: Clément Léger Reviewed-by: Björn Töpel Link: https://lore.kernel.org/r/20231004151405.521596-6-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt commit 7c586a555a48a952f64d883d2f20402fb61d9164 Author: Clément Léger Date: Wed Oct 4 17:14:01 2023 +0200 riscv: add floating point insn support to misaligned access emulation This support is partially based of openSBI misaligned emulation floating point instruction support. It provides support for the existing floating point instructions (both for 32/64 bits as well as compressed ones). Since floating point registers are not part of the pt_regs struct, we need to modify them directly using some assembly. We also dirty the pt_regs status in case we modify them to be sure context switch will save FP state. With this support, Linux is on par with openSBI support. Signed-off-by: Clément Léger Link: https://lore.kernel.org/r/20231004151405.521596-5-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt commit 89c12fecdc4d46c1f08a81dab5d305304cc626eb Author: Clément Léger Date: Wed Oct 4 17:14:00 2023 +0200 riscv: report perf event for misaligned fault Add missing calls to account for misaligned fault event using perf_sw_event(). Signed-off-by: Clément Léger Reviewed-by: Björn Töpel Link: https://lore.kernel.org/r/20231004151405.521596-4-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt commit 7c83232161f609bbc452a1255f823f41afc411dd Author: Clément Léger Date: Wed Oct 4 17:13:59 2023 +0200 riscv: add support for misaligned trap handling in S-mode Misalignment trap handling is only supported for M-mode and uses direct accesses to user memory. In S-mode, when handling usermode fault, this requires to use the get_user()/put_user() accessors. Implement load_u8(), store_u8() and get_insn() using these accessors for userspace and direct text access for kernel. Signed-off-by: Clément Léger Reviewed-by: Björn Töpel Link: https://lore.kernel.org/r/20231004151405.521596-3-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt commit f19c3b4239f5bfb69aacbaf75d4277c095e7aa7d Author: Clément Léger Date: Wed Oct 4 17:13:58 2023 +0200 riscv: remove unused functions in traps_misaligned.c Replace macros by the only two function calls that are done from this file, store_u8() and load_u8(). Signed-off-by: Clément Léger Link: https://lore.kernel.org/r/20231004151405.521596-2-cleger@rivosinc.com Signed-off-by: Palmer Dabbelt commit 72fcce70faf06dd7442bf0b41b71f071d7fa29a4 Author: Alexey Dobriyan Date: Fri Oct 27 17:13:58 2023 +0300 vsprintf: uninline simple_strntoull(), reorder arguments * uninline simple_strntoull(), gcc overinlines and this function is not performance critical * reorder arguments, so that appending INT_MAX as 4th argument generates very efficient tail call Space savings: add/remove: 1/0 grow/shrink: 0/3 up/down: 27/-179 (-152) Function old new delta simple_strntoll - 27 +27 simple_strtoull 15 10 -5 simple_strtoll 41 7 -34 vsscanf 1930 1790 -140 Signed-off-by: Alexey Dobriyan Reviewed-by: Andy Shevchenko Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/all/82a2af6e-9b6c-4a09-89d7-ca90cc1cdad1@p183/ commit 5f56cb030e4bcf14be2233332d5cd83fff62a376 Author: Masahiro Yamada Date: Wed Nov 1 03:11:57 2023 +0900 kbuild: support 'userldlibs' syntax This syntax is useful to specify libraries linked to all userspace programs in the Makefile. Signed-off-by: Masahiro Yamada commit 1bfaa37fd3486e66131de9cb87747c84b4c89a05 Author: Jiri Slaby (SUSE) Date: Mon Oct 30 12:34:16 2023 +0100 kbuild: dummy-tools: pretend we understand -fpatchable-function-entry Commit 0f71dcfb4aef ("powerpc/ftrace: Add support for -fpatchable-function-entry") added a script to check for -fpatchable-function-entry compiler support. The script expects compiler to emit the section __patchable_function_entries and few nops after a function entry. If the compiler understands and emits the above, CONFIG_ARCH_USING_PATCHABLE_FUNCTION_ENTRY is set. So teach dummy-tools' gcc about this. Signed-off-by: Jiri Slaby (SUSE) Reviewed-by: Nathan Chancellor Signed-off-by: Masahiro Yamada commit e07754e0a1ea2d63fb29574253d1fd7405607343 Author: Dan Carpenter Date: Fri Oct 27 15:12:54 2023 +0300 vhost-vdpa: fix use after free in vhost_vdpa_probe() The put_device() calls vhost_vdpa_release_dev() which calls ida_simple_remove() and frees "v". So this call to ida_simple_remove() is a use after free and a double free. Fixes: ebe6a354fa7e ("vhost-vdpa: Call ida_simple_remove() when failed") Signed-off-by: Dan Carpenter Message-Id: Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit b2c8b644fac1087dfe69a1762c04df090178a5ae Author: Jakub Sitnicki Date: Wed Oct 25 16:53:19 2023 +0200 virtio_pci: Switch away from deprecated irq_set_affinity_hint Since commit 65c7cdedeb30 ("genirq: Provide new interfaces for affinity hints") irq_set_affinity_hint is being phased out. Switch to new interfaces for setting and applying irq affinity hints. Signed-off-by: Jakub Sitnicki Message-Id: <20231025145319.380775-1-jakub@cloudflare.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo commit f2de37a572853d340f945a7748f74e3ed8c6b743 Author: Björn Töpel Date: Thu Oct 12 12:28:52 2023 +0200 riscv, qemu_fw_cfg: Add support for RISC-V architecture Qemu fw_cfg support was missing for RISC-V, which made it hard to do proper vmcore dumps from qemu. Add the missing RISC-V arch-defines. You can now do vmcore dumps from qemu. Add "-device vmcoreinfo" to the qemu command-line. From the qemu monitor: (qemu) dump-guest-memory vmcore The vmcore can now be used, e.g., with the "crash" utility. Acked-by: "Michael S. Tsirkin" Acked-by: Alistair Francis Tested-by: Clément Léger Signed-off-by: Björn Töpel Message-Id: <20231012102852.234442-1-bjorn@kernel.org> Signed-off-by: Michael S. Tsirkin commit 0d82410252ea324f0064e75b9865bb74cccc1dda Author: Stefano Garzarella Date: Tue Oct 31 15:43:39 2023 +0100 vdpa_sim_blk: allocate the buffer zeroed Deleting and recreating a device can lead to having the same content as the old device, so let's always allocate buffers completely zeroed out. Fixes: abebb16254b3 ("vdpa_sim_blk: support shared backend") Suggested-by: Qing Wang Signed-off-by: Stefano Garzarella Message-Id: <20231031144339.121453-1-sgarzare@redhat.com> Signed-off-by: Michael S. Tsirkin Acked-by: Eugenio Pérez Acked-by: Jason Wang commit 3503895788d402d6a3814085ed582c364ec3e903 Author: Michael S. Tsirkin Date: Tue Oct 31 12:02:06 2023 -0400 virtio_pci: move structure to a header These are guest/host interfaces, so they belong in the header where e.g. qemu will know to find them. Note: we added a new structure as opposed to extending existing one because someone might be relying on the size of the existing structure staying unchanged. Add a warning to avoid using sizeof. Signed-off-by: Michael S. Tsirkin Reviewed-by: Xuan Zhuo commit 86f6c224c97911b4392cb7b402e6a4ed323a449e Author: Si-Wei Liu Date: Sat Oct 21 02:25:19 2023 -0700 vdpa_sim: implement .reset_map support In order to reduce excessive memory mapping cost in live migration and VM reboot, it is desirable to decouple the vhost-vdpa IOTLB abstraction from the virtio device life cycle, i.e. mappings can be kept intact across virtio device reset. Leverage the .reset_map callback, which is meant to destroy the iotlb on the given ASID and recreate the 1:1 passthrough/identity mapping. To be consistent, the mapping on device creation is initiailized to passthrough/identity with PA 1:1 mapped as IOVA. With this the device .reset op doesn't have to maintain and clean up memory mappings by itself. Additionally, implement .compat_reset to cater for older userspace, which may wish to see mapping to be cleared during reset. Signed-off-by: Si-Wei Liu Tested-by: Stefano Garzarella Message-Id: <1697880319-4937-8-git-send-email-si-wei.liu@oracle.com> Signed-off-by: Michael S. Tsirkin Tested-by: Lei Yang commit 2eacf4b5e3ebe771f0fca0c8913c5a10a1953b72 Author: Si-Wei Liu Date: Sat Oct 21 02:25:18 2023 -0700 vdpa/mlx5: implement .reset_map driver op Since commit 6f5312f80183 ("vdpa/mlx5: Add support for running with virtio_vdpa"), mlx5_vdpa starts with preallocate 1:1 DMA MR at device creation time. This 1:1 DMA MR will be implicitly destroyed while the first .set_map call is invoked, in which case callers like vhost-vdpa will start to set up custom mappings. When the .reset callback is invoked, the custom mappings will be cleared and the 1:1 DMA MR will be re-created. In order to reduce excessive memory mapping cost in live migration, it is desirable to decouple the vhost-vdpa IOTLB abstraction from the virtio device life cycle, i.e. mappings can be kept around intact across virtio device reset. Leverage the .reset_map callback, which is meant to destroy the regular MR (including cvq mapping) on the given ASID and recreate the initial DMA mapping. That way, the device .reset op runs free from having to maintain and clean up memory mappings by itself. Additionally, implement .compat_reset to cater for older userspace, which may wish to see mapping to be cleared during reset. Co-developed-by: Dragos Tatulea Signed-off-by: Dragos Tatulea Signed-off-by: Si-Wei Liu Message-Id: <1697880319-4937-7-git-send-email-si-wei.liu@oracle.com> Signed-off-by: Michael S. Tsirkin Tested-by: Lei Yang commit bc91df5c70ac720eca18bd1f4a288f2582713d3e Author: Si-Wei Liu Date: Sat Oct 21 02:25:17 2023 -0700 vhost-vdpa: clean iotlb map during reset for older userspace Using .compat_reset op from the previous patch, the buggy .reset behaviour can be kept as-is on older userspace apps, which don't ack the IOTLB_PERSIST backend feature. As this compatibility quirk is limited to those drivers that used to be buggy in the past, it won't affect change the behaviour or affect ABI on the setups with API compliant driver. The separation of .compat_reset from the regular .reset allows vhost-vdpa able to know which driver had broken behaviour before, so it can apply the corresponding compatibility quirk to the individual driver whenever needed. Compared to overloading the existing .reset with flags, .compat_reset won't cause any extra burden to the implementation of every compliant driver. [mst: squashed in two fixup commits] Message-Id: <1697880319-4937-6-git-send-email-si-wei.liu@oracle.com> Message-Id: <1698102863-21122-1-git-send-email-si-wei.liu@oracle.com> Reported-by: Dragos Tatulea Tested-by: Dragos Tatulea Message-Id: <1698275594-19204-1-git-send-email-si-wei.liu@oracle.com> Reported-by: Lei Yang Signed-off-by: Si-Wei Liu Signed-off-by: Michael S. Tsirkin Tested-by: Lei Yang commit a26f2e4e68ee3130e5d5acb4f58807041aaea905 Author: Si-Wei Liu Date: Sat Oct 21 02:25:16 2023 -0700 vdpa: introduce .compat_reset operation callback Some device specific IOMMU parent drivers have long standing bogus behaviour that mistakenly clean up the maps during .reset. By definition, this is violation to the on-chip IOMMU ops (i.e. .set_map, or .dma_map & .dma_unmap) in those offending drivers, as the removal of internal maps is completely agnostic to the upper layer, causing inconsistent view between the userspace and the kernel. Some userspace app like QEMU gets around of this brokenness by proactively removing and adding back all the maps around vdpa device reset, but such workaround actually penaltize other well-behaved driver setup, where vdpa reset always comes with the associated mapping cost, especially for kernel vDPA devices (use_va=false) that have high cost on pinning. It's imperative to rectify this behaviour and remove the problematic code from all those non-compliant parent drivers. However, we cannot unconditionally remove the bogus map-cleaning code from the buggy .reset implementation, as there might exist userspace apps that already rely on the behaviour on some setup. Introduce a .compat_reset driver op to keep compatibility with older userspace. New and well behaved parent driver should not bother to implement such op, but only those drivers that are doing or used to do non-compliant map-cleaning reset will have to. Signed-off-by: Si-Wei Liu Message-Id: <1697880319-4937-5-git-send-email-si-wei.liu@oracle.com> Signed-off-by: Michael S. Tsirkin Tested-by: Lei Yang commit 4398776f7a6d532c466f9e41f601c9a291fac5ef Author: Si-Wei Liu Date: Sat Oct 21 02:25:15 2023 -0700 vhost-vdpa: introduce IOTLB_PERSIST backend feature bit Userspace needs this feature flag to distinguish if vhost-vdpa iotlb in the kernel can be trusted to persist IOTLB mapping across vDPA reset. Without it, userspace has no way to tell apart if it's running on an older kernel, which could silently drop all iotlb mapping across vDPA reset, especially with broken parent driver implementation for the .reset driver op. The broken driver may incorrectly drop all mappings of its own as part of .reset, which inadvertently ends up with corrupted mapping state between vhost-vdpa userspace and the kernel. As a workaround, to make the mapping behaviour predictable across reset, userspace has to pro-actively remove all mappings before vDPA reset, and then restore all the mappings afterwards. This workaround is done unconditionally on top of all parent drivers today, due to the parent driver implementation issue and no means to differentiate. This workaround had been utilized in QEMU since day one when the corresponding vhost-vdpa userspace backend came to the world. There are 3 cases that backend may claim this feature bit on for: - parent device that has to work with platform IOMMU - parent device with on-chip IOMMU that has the expected .reset_map support in driver - parent device with vendor specific IOMMU implementation with persistent IOTLB mapping already that has to specifically declare this backend feature The reason why .reset_map is being one of the pre-condition for persistent iotlb is because without it, vhost-vdpa can't switch back iotlb to the initial state later on, especially for the on-chip IOMMU case which starts with identity mapping at device creation. virtio-vdpa requires on-chip IOMMU to perform 1:1 passthrough translation from PA to IOVA as-is to begin with, and .reset_map is the only means to turn back iotlb to the identity mapping mode after vhost-vdpa is gone. The difference in behavior did not matter as QEMU unmaps all the memory unregistering the memory listener at vhost_vdpa_dev_start( started = false), but the backend acknowledging this feature flag allows QEMU to make sure it is safe to skip this unmap & map in the case of vhost stop & start cycle. In that sense, this feature flag is actually a signal for userspace to know that the driver bug has been solved. Not offering it indicates that userspace cannot trust the kernel will retain the maps. Signed-off-by: Si-Wei Liu Acked-by: Eugenio Pérez Message-Id: <1697880319-4937-4-git-send-email-si-wei.liu@oracle.com> Signed-off-by: Michael S. Tsirkin Tested-by: Lei Yang commit 1d0f874bfe7871837fb215999979284d579fc373 Author: Si-Wei Liu Date: Sat Oct 21 02:25:14 2023 -0700 vhost-vdpa: reset vendor specific mapping to initial state in .release Devices with on-chip IOMMU or vendor specific IOTLB implementation may need to restore iotlb mapping to the initial or default state using the .reset_map op, as it's desirable for some parent devices to not work with DMA ops and maintain a simple IOMMU model with .reset_map. In particular, device reset should not cause mapping to go away on such IOTLB model, so persistent mapping is implied across reset. Before the userspace process using vhost-vdpa is gone, give it a chance to reset iotlb back to the initial state in vhost_vdpa_cleanup(). Signed-off-by: Si-Wei Liu Acked-by: Eugenio Pérez Message-Id: <1697880319-4937-3-git-send-email-si-wei.liu@oracle.com> Signed-off-by: Michael S. Tsirkin Tested-by: Lei Yang commit d2cf1b6e3b85dcb2bb3e8cd7924beede34fbbf0e Author: Si-Wei Liu Date: Sat Oct 21 02:25:13 2023 -0700 vdpa: introduce .reset_map operation callback Some device specific IOMMU parent drivers have long standing bogus behavior that mistakenly clean up the maps during .reset. By definition, this is violation to the on-chip IOMMU ops (i.e. .set_map, or .dma_map & .dma_unmap) in those offending drivers, as the removal of internal maps is completely agnostic to the upper layer, causing inconsistent view between the userspace and the kernel. Some userspace app like QEMU gets around of this brokenness by proactively removing and adding back all the maps around vdpa device reset, but such workaround actually penalize other well-behaved driver setup, where vdpa reset always comes with the associated mapping cost, especially for kernel vDPA devices (use_va=false) that have high cost on pinning. It's imperative to rectify this behavior and remove the problematic code from all those non-compliant parent drivers. The reason why a separate .reset_map op is introduced is because this allows a simple on-chip IOMMU model without exposing too much device implementation detail to the upper vdpa layer. The .dma_map/unmap or .set_map driver API is meant to be used to manipulate the IOTLB mappings, and has been abstracted in a way similar to how a real IOMMU device maps or unmaps pages for certain memory ranges. However, apart from this there also exists other mapping needs, in which case 1:1 passthrough mapping has to be used by other users (read virtio-vdpa). To ease parent/vendor driver implementation and to avoid abusing DMA ops in an unexpacted way, these on-chip IOMMU devices can start with 1:1 passthrough mapping mode initially at the time of creation. Then the .reset_map op can be used to switch iotlb back to this initial state without having to expose a complex two-dimensional IOMMU device model. The .reset_map is not a MUST for every parent that implements the .dma_map or .set_map API, because device may work with DMA ops directly by implement their own to manipulate system memory mappings, so don't have to use .reset_map to achieve a simple IOMMU device model for 1:1 passthrough mapping. Signed-off-by: Si-Wei Liu Acked-by: Eugenio Pérez Acked-by: Jason Wang Message-Id: <1697880319-4937-2-git-send-email-si-wei.liu@oracle.com> Signed-off-by: Michael S. Tsirkin Tested-by: Lei Yang commit e0592acd1ef2497b861ef7ed6eda14b092b1e667 Author: Xuan Zhuo Date: Thu Oct 19 11:49:02 2023 +0800 virtio_pci: add check for common cfg size Some buggy devices, the common cfg size may not match the features. This patch checks the common cfg size for the features(VIRTIO_F_NOTIF_CONFIG_DATA, VIRTIO_F_RING_RESET). When the common cfg size does not match the corresponding feature, we fail the probe and print error message. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Message-Id: <20231019034902.7346-1-xuanzhuo@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin commit fafb51a67fb883eb2dde352539df939a251851be Author: zhenwei pi Date: Mon Sep 4 14:10:45 2023 +0800 virtio-blk: fix implicit overflow on virtio_max_dma_size The following codes have an implicit conversion from size_t to u32: (u32)max_size = (size_t)virtio_max_dma_size(vdev); This may lead overflow, Ex (size_t)4G -> (u32)0. Once virtio_max_dma_size() has a larger size than U32_MAX, use U32_MAX instead. Signed-off-by: zhenwei pi Message-Id: <20230904061045.510460-1-pizhenwei@bytedance.com> Signed-off-by: Michael S. Tsirkin commit 327e0ab32cd050513ffaf0aa9234884a2b4ca424 Author: Xuan Zhuo Date: Tue Oct 10 11:11:20 2023 +0800 virtio_pci: add build offset check for the new common cfg items Add checks to the check_offsets(void) for queue_notify_data and queue_reset. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Message-Id: <20231010031120.81272-5-xuanzhuo@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin commit 70e16c90ee23233bdd45462e1ebba72ff0c25c3a Author: Xuan Zhuo Date: Tue Oct 10 11:11:17 2023 +0800 virtio: add definition of VIRTIO_F_NOTIF_CONFIG_DATA feature bit This patch adds the definition of VIRTIO_F_NOTIF_CONFIG_DATA feature bit in the relevant header file. This feature indicates that the driver uses the data provided by the device as a virtqueue identifier in available buffer notifications. It comes from here: https://github.com/oasis-tcs/virtio-spec/issues/89 Signed-off-by: Xuan Zhuo Message-Id: <20231010031120.81272-2-xuanzhuo@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 484f0a071f8d482649eaf025dee7b76a7202fec9 Author: Greg Kroah-Hartman Date: Fri Oct 6 16:30:44 2023 +0200 vduse: make vduse_class constant Now that the driver core allows for struct class to be in read-only memory, we should make all 'class' structures declared at build time placing them into read-only memory, instead of having to be dynamically allocated at runtime. Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Xuan Zhuo Cc: Xie Yongji Signed-off-by: Greg Kroah-Hartman Message-Id: <2023100643-tricolor-citizen-6c2d@gregkh> Signed-off-by: Michael S. Tsirkin Reviewed-by: Xie Yongji Acked-by: Jason Wang commit 5ff1f51eefb1cd2c20c3f49538a64c09a1cc98be Author: Geert Uytterhoeven Date: Thu Sep 28 14:18:33 2023 +0200 vhost-scsi: Spelling s/preceeding/preceding/g Fix a misspelling of "preceding". Signed-off-by: Geert Uytterhoeven Message-Id: Signed-off-by: Michael S. Tsirkin Reviewed-by: Simon Horman Reviewed-by: Stefan Hajnoczi commit a5d7df87843dd9025015e4038dd927e893cc8b8b Author: Shannon Nelson Date: Mon Sep 11 14:31:04 2023 -0700 virtio: kdoc for struct virtio_pci_modern_device Finally following up to Simon's suggestion for some kdoc attention on struct virtio_pci_modern_device. Link: https://lore.kernel.org/netdev/ZE%2FQS0lnUvxFacjf@corigine.com/ Cc: Simon Horman Signed-off-by: Shannon Nelson Acked-by: Eugenio Pérez Message-Id: <20230911213104.14391-1-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit fbe299388c9496f04172ec59bf9bb211f0d2defa Author: Shawn.Shao Date: Mon Aug 21 09:15:35 2023 +0800 vdpa: Update sysfs ABI documentation Fix the wrong drivers_autoprobe path name in the document Signed-off-by: Shawn.Shao Message-Id: <20230821011535.1117-1-shawn.shao@jaguarmicro.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit dd1f4bc143a7845579d22ca1302e1c498e52182d Author: Dragos Tatulea Date: Mon Sep 25 19:06:51 2023 +0300 MAINTAINERS: Add myself as mlx5_vdpa driver As Eli Cohen moved to other work, I'll be the contact point for mlx5_vdpa. Acked-by: Jason Wang Signed-off-by: Dragos Tatulea Message-Id: <20230925160654.1558627-1-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin commit 0cd43eef0ae275611557f29cc2ba2c6211a4c5fa Author: Xueshi Hu Date: Sun Aug 13 22:07:09 2023 +0800 virtio-balloon: correct the comment of virtballoon_migratepage() After commit 68f2736a8583 ("mm: Convert all PageMovable users to movable_operations"), the execution path has been changed to move_to_new_folio movable_operations->migrate_page balloon_page_migrate balloon_page_migrate->balloon_page_migrate balloon_page_migrate Correct the outdated comment. Signed-off-by: Xueshi Hu Message-Id: <20230813140709.835536-1-xueshi.hu@smartx.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: David Hildenbrand Reviewed-by: Xuan Zhuo commit c695964474f3a80e1b7503e7cb15dd7d7f7245a1 Author: Eugenio Pérez Date: Mon Jul 3 16:25:14 2023 +0200 mlx5_vdpa: offer VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK Offer this backend feature as mlx5 is compatible with it. It allows it to do live migration with CVQ, dynamically switching between passthrough and shadow virtqueue. Signed-off-by: Eugenio Pérez Message-Id: <20230703142514.363256-1-eperezma@redhat.com> Signed-off-by: Michael S. Tsirkin commit 5dc31bd245a4fd7fe2d1fd79b7a2a81c96d6d33c Author: Dragos Tatulea Date: Wed Oct 18 20:14:55 2023 +0300 vdpa/mlx5: Update cvq iotlb mapping on ASID change For the following sequence: - cvq group is in ASID 0 - .set_map(1, cvq_iotlb) - .set_group_asid(cvq_group, 1) ... the cvq mapping from ASID 0 will be used. This is not always correct behaviour. This patch adds support for the above mentioned flow by saving the iotlb on each .set_map and updating the cvq iotlb with it on a cvq group change. Acked-by: Jason Wang Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea Message-Id: <20231018171456.1624030-18-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit cf6e024cf7683551ae218ce9af56b82e68a0ef06 Author: Dragos Tatulea Date: Wed Oct 18 20:14:54 2023 +0300 vdpa/mlx5: Make iotlb helper functions more generic They will be used in a follow-up patch. For dup_iotlb, avoid the src == dst case. This is an error. Acked-by: Jason Wang Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea Message-Id: <20231018171456.1624030-17-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit 03dd63c8fae4599439a30e0dde91061789260dbe Author: Dragos Tatulea Date: Wed Oct 18 20:14:53 2023 +0300 vdpa/mlx5: Enable hw support for vq descriptor mapping Vq descriptor mappings are supported in hardware by filling in an additional mkey which contains the descriptor mappings to the hw vq. A previous patch in this series added support for hw mkey (mr) creation for ASID 1. This patch fills in both the vq data and vq descriptor mkeys based on group ASID mapping. The feature is signaled to the vdpa core through the presence of the .get_vq_desc_group op. Acked-by: Jason Wang Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea Message-Id: <20231018171456.1624030-16-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit 55229eab8cd767a5811a4fb112b3ca9db6eaa9d2 Author: Dragos Tatulea Date: Wed Oct 18 20:14:52 2023 +0300 vdpa/mlx5: Introduce mr for vq descriptor Introduce the vq descriptor group and mr per ASID. Until now .set_map on ASID 1 was only updating the cvq iotlb. From now on it also creates a mkey for it. The current patch doesn't use it but follow-up patches will add hardware support for mapping the vq descriptors. Acked-by: Jason Wang Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea Message-Id: <20231018171456.1624030-15-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit 625e4b59a923d2bb30759b88ecca34d12735fa7e Author: Dragos Tatulea Date: Wed Oct 18 20:14:51 2023 +0300 vdpa/mlx5: Improve mr update flow The current flow for updating an mr works directly on mvdev->mr which makes it cumbersome to handle multiple new mr structs. This patch makes the flow more straightforward by having mlx5_vdpa_create_mr return a new mr which will update the old mr (if any). The old mr will be deleted and unlinked from mvdev. For the case when the iotlb is empty (not NULL), the old mr will be cleared. This change paves the way for adding mrs for different ASIDs. The initialized bool is no longer needed as mr is now a pointer in the mlx5_vdpa_dev struct which will be NULL when not initialized. Acked-by: Eugenio Pérez Acked-by: Jason Wang Signed-off-by: Dragos Tatulea Message-Id: <20231018171456.1624030-14-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit 186e25387ed6f1403a1b464e31f5381ba4424681 Author: Dragos Tatulea Date: Wed Oct 18 20:14:50 2023 +0300 vdpa/mlx5: Move mr mutex out of mr struct The mutex is named like it is supposed to protect only the mkey but in reality it is a global lock for all mr resources. Shift the mutex to it's rightful location (struct mlx5_vdpa_dev) and give it a more appropriate name. Signed-off-by: Dragos Tatulea Acked-by: Eugenio Pérez Acked-by: Jason Wang Message-Id: <20231018171456.1624030-13-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit 1b3ce9576f169ce2122ab98b39bf2357d377ee5b Author: Dragos Tatulea Date: Wed Oct 18 20:14:49 2023 +0300 vdpa/mlx5: Allow creation/deletion of any given mr struct This patch adapts the mr creation/deletion code to be able to work with any given mr struct pointer. All the APIs are adapted to take an extra parameter for the mr. mlx5_vdpa_create/delete_mr doesn't need a ASID parameter anymore. The check is done in the caller instead (mlx5_set_map). This change is needed for a followup patch which will introduce an additional mr for the vq descriptor data. Signed-off-by: Dragos Tatulea Acked-by: Eugenio Pérez Acked-by: Jason Wang Message-Id: <20231018171456.1624030-12-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit 07a2da402416891c97335b79a00f23e06549c578 Author: Dragos Tatulea Date: Wed Oct 18 20:14:48 2023 +0300 vdpa/mlx5: Rename mr destroy functions Make mlx5_destroy_mr symmetric to mlx5_create_mr. Acked-by: Jason Wang Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea Message-Id: <20231018171456.1624030-11-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit 1c06cd56746a33047d89df02716ff6af9187dd80 Author: Dragos Tatulea Date: Wed Oct 18 20:14:47 2023 +0300 vdpa/mlx5: Collapse "dvq" mr add/delete functions Now that the cvq code is out of mlx5_vdpa_create/destroy_mr, the "dvq" functions can be folded into their callers. Having "dvq" in the naming will no longer be accurate in the downstream patches. Acked-by: Jason Wang Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea Message-Id: <20231018171456.1624030-10-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit 4c6b97416a0427146c221039ed62718c9e897ec0 Author: Dragos Tatulea Date: Wed Oct 18 20:14:46 2023 +0300 vdpa/mlx5: Take cvq iotlb lock during refresh The reslock is taken while refresh is called but iommu_lock is more specific to this resource. So take the iommu_lock during cvq iotlb refresh. Based on Eugenio's patch [0]. [0] https://lore.kernel.org/lkml/20230112142218.725622-4-eperezma@redhat.com/ Acked-by: Jason Wang Suggested-by: Eugenio Pérez Reviewed-by: Eugenio Pérez Signed-off-by: Dragos Tatulea Message-Id: <20231018171456.1624030-9-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit 512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9 Author: Dragos Tatulea Date: Wed Oct 18 20:14:45 2023 +0300 vdpa/mlx5: Decouple cvq iotlb handling from hw mapping code The handling of the cvq iotlb is currently coupled with the creation and destruction of the hardware mkeys (mr). This patch moves cvq iotlb handling into its own function and shifts it to a scope that is not related to mr handling. As cvq handling is just a prune_iotlb + dup_iotlb cycle, put it all in the same "update" function. Finally, the destruction path is handled by directly pruning the iotlb. After this move is done the ASID mr code can be collapsed into a single function. Acked-by: Jason Wang Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea Message-Id: <20231018171456.1624030-8-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit 049cbeab861ef483e39f1f65540305400d33771a Author: Dragos Tatulea Date: Wed Oct 18 20:14:44 2023 +0300 vdpa/mlx5: Create helper function for dma mappings Necessary for upcoming cvq separation from mr allocation. Acked-by: Jason Wang Signed-off-by: Dragos Tatulea Message-Id: <20231018171456.1624030-7-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit c8068d9bae0c78e8880451b94668253449b2d71d Author: Si-Wei Liu Date: Wed Oct 18 20:14:43 2023 +0300 vhost-vdpa: uAPI to get dedicated descriptor group id With _F_DESC_ASID backend feature, the device can now support the VHOST_VDPA_GET_VRING_DESC_GROUP ioctl, and it may expose the descriptor table (including avail and used ring) in a different group than the buffers it contains. This new uAPI will fetch the group ID of the descriptor table. Signed-off-by: Si-Wei Liu Acked-by: Eugenio Pérez Acked-by: Jason Wang Message-Id: <20231018171456.1624030-6-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit 7db0d6027e69f47431800b510192436563ba415b Author: Si-Wei Liu Date: Wed Oct 18 20:14:42 2023 +0300 vhost-vdpa: introduce descriptor group backend feature Userspace knows if the device has dedicated descriptor group or not by checking this feature bit. It's only exposed if the vdpa driver backend implements the .get_vq_desc_group() operation callback. Userspace trying to negotiate this feature when it or the dependent _F_IOTLB_ASID feature hasn't been exposed will result in an error. Signed-off-by: Si-Wei Liu Acked-by: Eugenio Pérez Acked-by: Jason Wang Message-Id: <20231018171456.1624030-5-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit a72cac6067fdfde280ece0ec5c055659a8de6508 Author: Si-Wei Liu Date: Wed Oct 18 20:14:41 2023 +0300 vdpa: introduce dedicated descriptor group for virtqueue In some cases, the access to the virtqueue's descriptor area, device and driver areas (precluding indirect descriptor table in guest memory) may have to be confined to a different address space than where its buffers reside. Without loss of simplicity and generality with already established terminology, let's fold up these 3 areas and call them as a whole as descriptor table group, or descriptor group for short. Specifically, in case of split virtqueues, descriptor group consists of regions for Descriptor Table, Available Ring and Used Ring; for packed virtqueues layout, descriptor group contains Descriptor Ring, Driver and Device Event Suppression structures. The group ID for a dedicated descriptor group can be obtained through a new .get_vq_desc_group() op. If driver implements this op, it means that the descriptor, device and driver areas of the virtqueue may reside in a dedicated group than where its buffers reside, a.k.a the default virtqueue group through the .get_vq_group() op. In principle, the descriptor group may or may not have same group ID as the default group. Even if the descriptor group has a different ID, meaning the vq's descriptor group areas can optionally move to a separate address space than where guest memory resides, the descriptor group may still start from a default address space, same as where its buffers reside. To move the descriptor group to a different address space, .set_group_asid() has to be called to change the ASID binding for the group, which is no different than what needs to be done on any other virtqueue group. On the other hand, the .reset() semantics also applies on descriptor table group, meaning the device reset will clear all ASID bindings and move all virtqueue groups including descriptor group back to the default address space, i.e. in ASID 0. QEMU's shadow virtqueue is going to utilize dedicated descriptor group to speed up map and unmap operations, yielding tremendous downtime reduction by avoiding the full and slow remap cycle in SVQ switching. Signed-off-by: Si-Wei Liu Acked-by: Eugenio Pérez Acked-by: Jason Wang Message-Id: <20231018171456.1624030-4-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Tested-by: Si-Wei Liu Tested-by: Lei Yang commit ab5201e20c181563774631258f737caeefed2364 Author: David Rau Date: Wed Nov 1 10:25:07 2023 +0800 ASoC: da7219: Improve system suspend and resume handling When DA7219 is suspended, prevent the AAD IRQ handler is unexpectedly executed and cause the I2C driver "Transfer while suspended" failure. Signed-off-by: David Rau Link: https://lore.kernel.org/r/20231101022507.6226-1-David.Rau.opensource@dm.renesas.com Signed-off-by: Mark Brown commit b729598c1747576bb9a4c997190be3f7c2915726 Author: Weidong Wang Date: Wed Nov 1 17:02:10 2023 +0800 ASoC: codecs: Modify macro value error The value of vsense_select should be either 32 or 0 in both cases, so modify the AW88399_DEV_VDSEL_VSENSE macro to 32. Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20231101090211.177125-4-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit baf46c3c763809fbeabcff5ec6e2ff3081f755f2 Author: Weidong Wang Date: Wed Nov 1 17:02:09 2023 +0800 ASoC: codecs: Modify the wrong judgment of re value An error code should be return when the re is greater than the maximum value or less than the minimum value Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20231101090211.177125-3-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit c9e920ffa752b9047d65041cd70495409c768dd7 Author: Weidong Wang Date: Wed Nov 1 17:02:08 2023 +0800 ASoC: codecs: Modify the maximum value of calib The maximum value that calib can set should be consistent with the maximum value of re. Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20231101090211.177125-2-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit 71d47b31e9ab579a00698cf9c059fa3adc312882 Merge: ffc253263a137 d424348b060d8 Author: Michael S. Tsirkin Date: Wed Nov 1 09:14:52 2023 -0400 Merge branch 'mlx5-vhost' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git This merges a single commit that contains changes to mlx5_ifc.h It's required to support vq descriptor mappings in mlx5/vdpa Signed-off-by: Michael S. Tsirkin commit b9604be241587fb29c0f40450e53d0a37dc611b5 Author: Su Hui Date: Fri Oct 20 17:19:31 2023 +0800 leds: lp5521: Add an error check in lp5521_post_init_device lp55xx_write() can return an error code, add a check for this. Signed-off-by: Su Hui Link: https://lore.kernel.org/r/20231020091930.207870-1-suhui@nfschina.com Signed-off-by: Lee Jones commit 2038d3fdc7434d522369c58cb7a4acd5315eebec Author: Andy Shevchenko Date: Mon Oct 16 19:10:05 2023 +0300 leds: gpio: Update headers Include headers which we are direct users of, no need to have proxies. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231016161005.1471768-6-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit 7b2d8a059c77344eca0f5281f97224d1accfb88a Author: Andy Shevchenko Date: Mon Oct 16 19:10:04 2023 +0300 leds: gpio: Remove unneeded assignment The initial ret is not used anywhere, drop the unneeded assignment. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231016161005.1471768-5-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit 54e657d604ae27a30ce4f84c243661d9b744bbce Author: Andy Shevchenko Date: Mon Oct 16 19:10:03 2023 +0300 leds: gpio: Move temporary variable for struct device to gpio_led_probe() Use temporary variable for struct device in gpio_led_probe() in order to make code neater. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231016161005.1471768-4-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit 5ac50ec712921f6250188732387bf5dac33736ae Author: Andy Shevchenko Date: Mon Oct 16 19:10:02 2023 +0300 leds: gpio: Refactor code to use devm_gpiod_get_index_optional() Instead of checking for the specific error codes, replace devm_gpiod_get_index() with devm_gpiod_get_index_optional(). In this case we just return all errors to the caller and simply check for NULL in case if legacy GPIO is being used. As the result the code is easier to read and maintain. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231016161005.1471768-3-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit f5ad594e389c57dfe19059ce868392809f9b1a71 Author: Andy Shevchenko Date: Mon Oct 16 19:10:01 2023 +0300 leds: gpio: Utilise PTR_ERR_OR_ZERO() Avoid a boilerplate code by using PTR_ERR_OR_ZERO() in create_gpio_led(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231016161005.1471768-2-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit e80fc4bfc820aa44c500cf4c61e08765f36d3c63 Author: Andy Shevchenko Date: Mon Oct 16 19:10:00 2023 +0300 leds: gpio: Keep driver firmware interface agnostic The of.h is used as a proxy to mod_devicetable, replace former by latter. The commit 2d6180147e92 ("leds: gpio: Configure per-LED pin control") added yet another unneeded OF APIs. Replace with direct use of fwnode. Altogether this makes driver agnostic to the firmware interface in use. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231016161005.1471768-1-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit 49e50aad22aebaaca3ff7abbdd462deaf16c5f35 Author: Andy Shevchenko Date: Mon Oct 16 18:30:51 2023 +0300 leds: core: Refactor led_update_brightness() to use standard pattern The standard conditional pattern is to check for errors first and bail out if any. Refactor led_update_brightness() accordingly. While at it, drop unneeded assignment and return 0 unconditionally on success. Signed-off-by: Andy Shevchenko Acked-by: Denis Osterland-Heim Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20231016153051.1409074-1-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit 78cbcfd8b13cefe089296d053f222934a53e153d Author: Marek Behún Date: Mon Oct 16 16:15:38 2023 +0200 leds: turris-omnia: Fix brightness setting and trigger activating I have improperly refactored commits 4d5ed2621c24 ("leds: turris-omnia: Make set_brightness() more efficient") and aaf38273cf76 ("leds: turris-omnia: Support HW controlled mode via private trigger") after Lee requested a change in API semantics of the new functions I introduced in commit 28350bc0ac77 ("leds: turris-omnia: Do not use SMBUS calls"). Before the change, the function omnia_cmd_write_u8() returned 0 on success, and afterwards it returned a positive value (number of bytes written). The latter version was applied, but the following commits did not properly account for this change. This results in non-functional LED's .brightness_set_blocking() and trigger's .activate() methods. The main reasoning behind the semantics change was that read/write methods should return the number of read/written bytes on success. It was pointed to me [1] that this is not always true (for example the regmap API does not do so), and since the driver never uses this number of read/written bytes information, I decided to fix this issue by changing the functions to the original semantics (return 0 on success). [1] https://lore.kernel.org/linux-gpio/ZQnn+Gi0xVlsGCYA@smile.fi.intel.com/ Fixes: 28350bc0ac77 ("leds: turris-omnia: Do not use SMBUS calls") Signed-off-by: Marek Behún Link: https://lore.kernel.org/r/20231016141538.30037-1-kabel@kernel.org Signed-off-by: Lee Jones commit 50be9e029b3ac72848685d7a74d1bd32b36309bf Author: Chunyan Zhang Date: Fri Oct 13 10:20:10 2023 +0800 leds: sc27xx: Move mutex_init() down Move the mutex_init() to avoid redundant mutex_destroy() calls after that for each time the probe fails. Signed-off-by: Chunyan Zhang Reviewed-by: Baolin Wang Link: https://lore.kernel.org/r/20231013022010.854367-1-chunyan.zhang@unisoc.com Signed-off-by: Lee Jones commit 259e33cbb1712a7dd844fc9757661cc47cb0e39b Author: Christian Marangi Date: Sat Oct 7 15:10:42 2023 +0200 leds: trigger: netdev: Move size check in set_device_name GCC 13.2 complains about array subscript 17 is above array bounds of 'char[16]' with IFNAMSIZ set to 16. The warning is correct but this scenario is impossible. set_device_name is called by device_name_store (store sysfs entry) and netdev_trig_activate. device_name_store already check if size is >= of IFNAMSIZ and return -EINVAL. (making the warning scenario impossible) netdev_trig_activate works on already defined interface, where the name has already been checked and should already follow the condition of strlen() < IFNAMSIZ. Aside from the scenario being impossible, set_device_name can be improved to both mute the warning and make the function safer. To make it safer, move size check from device_name_store directly to set_device_name and prevent any out of bounds scenario. Cc: stable@vger.kernel.org Fixes: 28a6a2ef18ad ("leds: trigger: netdev: refactor code setting device name") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309192035.GTJEEbem-lkp@intel.com/ Signed-off-by: Christian Marangi Link: https://lore.kernel.org/r/20231007131042.15032-1-ansuelsmth@gmail.com Signed-off-by: Lee Jones commit 0ebdb7210943eb345992bea9892adbd15a206193 Author: André Apitzsch Date: Mon Oct 2 18:48:28 2023 +0200 leds: Add ktd202x driver This commit adds support for Kinetic KTD2026/7 RGB/White LED driver. Signed-off-by: André Apitzsch Link: https://lore.kernel.org/r/20231002-ktd202x-v6-2-26be8eefeb88@apitzsch.eu Signed-off-by: Lee Jones commit 000b1eab4fce227dc81c312cd5fef05fce71d004 Author: André Apitzsch Date: Mon Oct 2 18:48:27 2023 +0200 dt-bindings: leds: Add Kinetic KTD2026/2027 LED Document Kinetic KTD2026/2027 LED driver devicetree bindings. Signed-off-by: André Apitzsch Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231002-ktd202x-v6-1-26be8eefeb88@apitzsch.eu Signed-off-by: Lee Jones commit a067943129b4ec6b835e02cfd5fbef01093c1471 Author: Ondrej Jirman Date: Sun Oct 8 16:40:13 2023 +0200 leds: core: Add more colors from DT bindings to led_colors The colors are already part of DT bindings. Make sure the kernel is able to convert them to strings. Signed-off-by: Ondrej Jirman Link: https://lore.kernel.org/r/20231008144014.1180334-1-megi@xff.cz Signed-off-by: Lee Jones commit 43962eb5de20d8d19f17556ce2a01b3fa4528ac2 Author: Ondrej Jirman Date: Sun Oct 8 16:21:00 2023 +0200 dt-bindings: leds: Last color ID is now 14 (LED_COLOR_ID_LIME) Increase the limit to match available values in dt-bindings/leds/common.h Fixes: 472d7b9e8141 ("dt-bindings: leds: Expand LED_COLOR_ID definitions") Signed-off-by: Ondrej Jirman Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231008142103.1174028-1-megi@xff.cz Signed-off-by: Lee Jones commit 9ddf40434ee4e1aac6ce2535fa852fbbad6f6d68 Author: Andy Shevchenko Date: Mon Oct 2 16:56:29 2023 +0300 leds: tca6507: Don't use fixed GPIO base First of all, the fixed GPIO base is source of troubles and it doesn't scale. Second, there is no in-kernel user of this base, so drop it. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231002135629.2605462-1-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit fc8e107e7b15906a92afbeed9b289cc695984d5e Author: Mark Brown Date: Fri Sep 29 17:23:38 2023 +0200 leds: lp3952: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-leds-maple-v1-4-ba5f9dcb1e75@kernel.org Signed-off-by: Lee Jones commit 5d97716f3fd2bb0f4462df23e4e1088dfcd85e5d Author: Mark Brown Date: Fri Sep 29 17:23:37 2023 +0200 leds: lm392x: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-leds-maple-v1-3-ba5f9dcb1e75@kernel.org Signed-off-by: Lee Jones commit 65e9b51344cbd5a71fce160ae3142fdc70e43989 Author: Mark Brown Date: Fri Sep 29 17:23:36 2023 +0200 leds: aw200xx: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-leds-maple-v1-2-ba5f9dcb1e75@kernel.org Signed-off-by: Lee Jones commit 8e31906c75bcb8d36b51992fea318c879f2ae82b Author: Mark Brown Date: Fri Sep 29 17:23:35 2023 +0200 leds: lm3601x: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-leds-maple-v1-1-ba5f9dcb1e75@kernel.org Signed-off-by: Lee Jones commit 4a11dbf04f31c71eb458c062129e95b7aa308464 Author: Linus Walleij Date: Tue Sep 26 23:48:13 2023 +0200 leds: triggers: gpio: Rewrite to use trigger-sources By providing a GPIO line as "trigger-sources" in the FWNODE (such as from the device tree) and combining with the GPIO trigger, we can support a GPIO LED trigger in a natural way from the hardware description instead of using the custom sysfs and deprecated global GPIO numberspace. Example: gpio: gpio@0 { compatible "my-gpio"; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; #trigger-source-cells = <2>; }; leds { compatible = "gpio-leds"; led-my-gpio { label = "device:blue:myled"; gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; default-state = "off"; linux,default-trigger = "gpio"; trigger-sources = <&gpio 1 GPIO_ACTIVE_HIGH>; }; }; Make this the norm, unmark the driver as broken. Delete the sysfs handling of GPIOs. Since GPIO descriptors inherently can describe inversion, the inversion handling can just be deleted. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230926-gpio-led-trigger-dt-v2-3-e06e458b788e@linaro.org Signed-off-by: Lee Jones commit f9be4d5bb62ab41723db04d7b3abed2ad6c34825 Author: Linus Walleij Date: Tue Sep 26 23:48:12 2023 +0200 dt-bindings: leds: Mention GPIO triggers We reuse the trigger-sources phandle to just point to GPIOs we may want to use as LED triggers. Example: gpio: gpio@0 { compatible "my-gpio"; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; #trigger-source-cells = <2>; }; leds { compatible = "gpio-leds"; led-my-gpio { label = "device:blue:myled"; gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; default-state = "off"; linux,default-trigger = "gpio"; trigger-sources = <&gpio 1 GPIO_ACTIVE_HIGH>; }; }; Signed-off-by: Linus Walleij Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230926-gpio-led-trigger-dt-v2-2-e06e458b788e@linaro.org Signed-off-by: Lee Jones commit 8d3fd7edd5f70fb814c07a321f347b5fe21d3fac Author: Biju Das Date: Sat Sep 23 18:19:21 2023 +0100 leds: pca955x: Cleanup OF/ID table terminators Some cleanups: * Remove the trailing comma in the terminator entry for the OF table making code robust against (theoretical) misrebases or other similar things where the new entry goes _after_ the termination without the compiler noticing. * Drop a space from terminator entry for ID table. While at it, move OF/ID table near to the user. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230923171921.53503-3-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones commit 3b581cb58816d07b033c800d42a040d7ba566fb6 Author: Biju Das Date: Sat Sep 23 18:19:20 2023 +0100 leds: pca955x: Convert enum->pointer for data in the match tables Convert enum->pointer for data in the match tables, so that device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c bus type match support added to it. Replace enum->struct *pca955x_chipdefs for data in the match table. Simplify the probe() by replacing device_get_match_data() and ID lookup for retrieving data by i2c_get_match_data(). While at it, add const definition to pca955x_chipdefs[]. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230923171921.53503-2-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones commit a337ee0d25ba24212269c2442981dc4fb5232a8c Author: Justin Stitt Date: Fri Sep 22 15:27:17 2023 +0000 leds: lp3952: Replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect `dest` to be NUL-terminated due to its use with dev_err. lp3952_get_label()'s dest argument is priv->leds[i].name: | acpi_ret = lp3952_get_label(&priv->client->dev, led_name_hdl[i], | priv->leds[i].name); ... which is then assigned to: | priv->leds[i].cdev.name = priv->leds[i].name; ... which is used with a format string | dev_err(&priv->client->dev, | "couldn't register LED %s\n", | priv->leds[i].cdev.name); There is no indication that NUL-padding is required but if it is let's opt for strscpy_pad. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230922-strncpy-drivers-leds-leds-lp3952-c-v1-1-4941d6f60ca4@google.com Signed-off-by: Lee Jones commit ff50f53276131a3059e8307d11293af388ed2bcd Author: Christophe JAILLET Date: Sat Sep 23 09:15:38 2023 +0200 leds: trigger: ledtrig-cpu:: Fix 'output may be truncated' issue for 'cpu' In order to teach the compiler that 'trig->name' will never be truncated, we need to tell it that 'cpu' is not negative. When building with W=1, this fixes the following warnings: drivers/leds/trigger/ledtrig-cpu.c: In function ‘ledtrig_cpu_init’: drivers/leds/trigger/ledtrig-cpu.c:155:56: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 5 [-Werror=format-truncation=] 155 | snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu); | ^~ drivers/leds/trigger/ledtrig-cpu.c:155:52: note: directive argument in the range [-2147483648, 7] 155 | snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu); | ^~~~~~~ drivers/leds/trigger/ledtrig-cpu.c:155:17: note: ‘snprintf’ output between 5 and 15 bytes into a destination of size 8 155 | snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 8f88731d052d ("led-triggers: create a trigger for CPU activity") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/3f4be7a99933cf8566e630da54f6ab913caac432.1695453322.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones commit 76fe464c8e64e71b2e4af11edeef0e5d85eeb6aa Author: Uwe Kleine-König Date: Fri Sep 22 21:28:34 2023 +0200 leds: pwm: Don't disable the PWM when the LED should be off Disabling a PWM (i.e. calling pwm_apply_state with .enabled = false) gives no guarantees what the PWM output does. It might freeze where it currently is, or go in a High-Z state or drive the active or inactive state, it might even continue to toggle. To ensure that the LED gets really disabled, don't disable the PWM even when .duty_cycle is zero. This fixes disabling a leds-pwm LED on i.MX28. The PWM on this SoC is one of those that freezes its output on disable, so if you disable an LED that is full on, it stays on. If you disable a LED with half brightness it goes off in 50% of the cases and full on in the other 50%. Fixes: 41c42ff5dbe2 ("leds: simple driver for pwm driven LEDs") Reported-by: Rogan Dawes Reported-by: Fabio Estevam Signed-off-by: Uwe Kleine-König Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20230922192834.1695727-1-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones commit 43e9082fbccc7df8b2028c1ba040c58cefda703f Author: Marek Behún Date: Mon Sep 18 18:11:04 2023 +0200 leds: turris-omnia: Add support for enabling/disabling HW gamma correction If the MCU on Turris Omnia is running newer firmware versions, the LED controller supports RGB gamma correction (and enables it by default for newer boards). Determine whether the gamma correction setting feature is supported and add the ability to set it via sysfs attribute file. Signed-off-by: Marek Behún Link: https://lore.kernel.org/r/20230918161104.20860-5-kabel@kernel.org Signed-off-by: Lee Jones commit cbd6954fecbeb822cf380fa2573ccb4a3a457e88 Author: Marek Behún Date: Mon Sep 18 18:11:03 2023 +0200 leds: turris-omnia: Support HW controlled mode via private trigger Add support for enabling MCU controlled mode of the Turris Omnia LEDs via a LED private trigger called "omnia-mcu". Recall that private LED triggers will only be listed in the sysfs trigger file for LEDs that support them (currently there is no user of this mechanism). When in MCU controlled mode, the user can still set LED color, but the blinking is done by MCU, which does different things for different LEDs: - WAN LED is blinked according to the LED[0] pin of the WAN PHY - LAN LEDs are blinked according to the LED[0] output of the corresponding port of the LAN switch - PCIe LEDs are blinked according to the logical OR of the MiniPCIe port LED pins In the future I want to make the netdev trigger to transparently offload the blinking to the HW if user sets compatible settings for the netdev trigger (for LEDs associated with network devices). There was some work on this already, and hopefully we will be able to complete it sometime, but for now there are still multiple blockers for this, and even if there weren't, we still would not be able to configure HW controlled mode for the LEDs associated with MiniPCIe ports. In the meantime let's support HW controlled mode via the private LED trigger mechanism. If, in the future, we manage to complete the netdev trigger offloading, we can still keep this private trigger for backwards compatibility, if needed. We also set "omnia-mcu" to cdev->default_trigger, so that the MCU keeps control until the user first wants to take over it. If a different default trigger is specified in device-tree via the 'linux,default-trigger' property, LED class will overwrite cdev->default_trigger, and so the DT property will be respected. Signed-off-by: Marek Behún Link: https://lore.kernel.org/r/20230918161104.20860-4-kabel@kernel.org Signed-off-by: Lee Jones commit 9f028c9e1c32249cb2487d2103512d6b9597b932 Author: Marek Behún Date: Mon Sep 18 18:11:02 2023 +0200 leds: turris-omnia: Make set_brightness() more efficient Implement caching of the LED color and state values that are sent to MCU in order to make the set_brightness() operation more efficient by avoiding I2C transactions which are not needed. On Turris Omnia's MCU, which acts as the RGB LED controller, each LED has a RGB color, and a ON/OFF state, which are configurable via I2C commands CMD_LED_COLOR and CMD_LED_STATE. The CMD_LED_COLOR command sends 5 bytes and the CMD_LED_STATE command 2 bytes over the I2C bus, which operates at 100 kHz. With I2C overhead this allows ~1670 color changing commands and ~3200 state changing commands per second (or around 1000 color + state changes per second). This may seem more than enough, but the issue is that the I2C bus is shared with another peripheral, the MCU. The MCU exposes an interrupt interface, and it can trigger hundreds of interrupts per second. Each time, we need to read the interrupt state register over this I2C bus. Whenever we are sending a LED color/state changing command, the interrupt reading is waiting. Currently, every time LED brightness or LED multi intensity is changed, we send a CMD_LED_STATE command, and if the computed color (brightness adjusted multi_intensity) is non-zero, we also send a CMD_LED_COLOR command. Consider for example the situation when we have a netdev trigger enabled for a LED. The netdev trigger does not change the LED color, only the brightness (either to 0 or to currently configured brightness), and so there is no need to send the CMD_LED_COLOR command. But each change of brightness to 0 sends one CMD_LED_STATE command, and each change of brightness to max_brightness sends one CMD_LED_STATE command and one CMD_LED_COLOR command: set_brightness(0) -> CMD_LED_STATE set_brightness(255) -> CMD_LED_STATE + CMD_LED_COLOR (unnecessary) We can avoid the unnecessary I2C transactions if we cache the values of state and color that are sent to the controller. If the color does not change from the one previously sent, there is no need to do the CMD_LED_COLOR I2C transaction, and if the state does not change, there is no need to do the CMD_LED_STATE transaction. Because we need to make sure that our cached values are consistent with the controller state, add explicit setting of the LED color to white at probe time (this is the default setting when MCU resets, but does not necessarily need to be the case, for example if U-Boot played with the LED colors). Signed-off-by: Marek Behún Link: https://lore.kernel.org/r/20230918161104.20860-3-kabel@kernel.org Signed-off-by: Lee Jones commit 6de283b96b31b4890e3ee8c86caca2a3a30d1011 Author: Marek Behún Date: Mon Sep 18 18:11:01 2023 +0200 leds: turris-omnia: Do not use SMBUS calls The leds-turris-omnia driver uses three function for I2C access: - i2c_smbus_write_byte_data() and i2c_smbus_read_byte_data(), which cause an emulated SMBUS transfer, - i2c_master_send(), which causes an ordinary I2C transfer. The Turris Omnia MCU LED controller is not semantically SMBUS, it operates as a simple I2C bus. It does not implement any of the SMBUS specific features, like PEC, or procedure calls, or anything. Moreover the I2C controller driver also does not implement SMBUS, and so the emulated SMBUS procedure from drivers/i2c/i2c-core-smbus.c is used for the SMBUS calls, which gives an unnecessary overhead. When I first wrote the driver, I was unaware of these facts, and I simply used the first function that worked. Drop the I2C SMBUS calls and instead use simple I2C transfers. Fixes: 089381b27abe ("leds: initial support for Turris Omnia LEDs") Signed-off-by: Marek Behún Link: https://lore.kernel.org/r/20230918161104.20860-2-kabel@kernel.org Signed-off-by: Lee Jones commit 7c977019c53ed2689e5509ebd1d89a424cf3d313 Author: Stefan Eichenberger Date: Mon Sep 18 16:32:38 2023 +0200 leds: lp55xx: Use gpiod_set_value_cansleep() Use gpiod_set_value_cansleep in the init_device function. Without this change, the driver may print a warning if the LP55xx enable pin is connected to a GPIO chip which can sleep (e.g. a GPIO expander): WARNING: CPU: 0 PID: 2719 at drivers/gpio/gpiolib.c:3051 gpiod_set_value+0x64/0xbc Signed-off-by: Stefan Eichenberger Link: https://lore.kernel.org/r/20230918143238.75600-1-eichest@gmail.com Signed-off-by: Lee Jones commit e3c9d952139c1eb42f35bdcdcb85a66a72587b34 Author: Kees Cook Date: Fri Sep 15 13:10:52 2023 -0700 leds: mt6370: Annotate struct mt6370_priv with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mt6370_priv. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230915201051.never.429-kees@kernel.org Signed-off-by: Lee Jones commit 476301c15d44831413b94d54f248233b14c0ad85 Author: Kees Cook Date: Fri Sep 15 13:10:20 2023 -0700 leds: mt6360: Annotate struct mt6360_priv with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mt6360_priv. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230915201020.never.433-kees@kernel.org Signed-off-by: Lee Jones commit 6061302092305a0584aacf0d82a9d5e66653884c Author: Uwe Kleine-König Date: Sun Sep 17 15:09:47 2023 +0200 leds: Convert all platform drivers to return void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). All platform drivers below drivers/leds/ unconditionally return zero in their remove callback and so can be converted trivially to the variant returning void. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230917130947.1122198-1-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones commit eccc489ef68d70cfdd850ba24933f1febbf2893e Author: Uwe Kleine-König Date: Sat Sep 16 18:45:16 2023 +0200 leds: simatic-ipc-leds-gpio: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Make simatic_ipc_leds_gpio_remove() return void instead of returning zero unconditionally. After that the three remove callbacks that use this function were trivial to convert to return void, too. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230916164516.1063380-1-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones commit 0847c33bafe5b58f2f223153c007c1e185f84f48 Author: Kees Cook Date: Fri Sep 15 13:11:00 2023 -0700 leds: qcom-lpg: Annotate struct lpg_led with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct lpg_led. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230915201059.never.086-kees@kernel.org Signed-off-by: Lee Jones commit bcbadbb29cb6aa6f51505514ae635fd467ebca43 Author: Kees Cook Date: Fri Sep 15 13:10:10 2023 -0700 leds: lm3697: Annotate struct lm3697 with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct lm3697. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230915201010.never.399-kees@kernel.org Signed-off-by: Lee Jones commit 52cd75108a426bdd43161d0e73e7bee95d103ed1 Author: Kees Cook Date: Fri Sep 15 13:10:04 2023 -0700 leds: gpio: Annotate struct gpio_leds_priv with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct gpio_leds_priv. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230915201003.never.148-kees@kernel.org Signed-off-by: Lee Jones commit a29feca113687cc691fe9f0f23652fafbafddc90 Author: Kees Cook Date: Fri Sep 15 13:09:56 2023 -0700 leds: el15203000: Annotate struct el15203000 with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct el15203000. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230915200955.never.871-kees@kernel.org Signed-off-by: Lee Jones commit 679cec1809b4140add538f28638546ea2f5c8959 Author: Kees Cook Date: Fri Sep 15 13:09:48 2023 -0700 leds: cr0014114: Annotate struct cr0014114 with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct cr0014114. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230915200948.never.728-kees@kernel.org Signed-off-by: Lee Jones commit ff861ca9f2d54a81d10cd3e8d2384fe17c10fdc4 Author: Kees Cook Date: Fri Sep 15 13:09:39 2023 -0700 leds: aw200xx: Annotate struct aw200xx with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct aw200xx. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230915200938.never.767-kees@kernel.org Signed-off-by: Lee Jones commit a09af0551f5cfa850ca4d39be4395bb3526c8bdf Author: Justin Stitt Date: Wed Aug 16 19:37:52 2023 +0000 leds: pca955x: Fix -Wvoid-pointer-to-enum-cast warning When building with clang 18 I see the following warning: | drivers/leds/leds-pca955x.c:487:15: warning: cast to smaller integer | type 'enum pca955x_type' from 'const void *' [-Wvoid-pointer-to-enum-cast] | 487 | chip_type = (enum pca955x_type)md; This is due to the fact that `md` is a void* while `enum pca995x_type` has the size of an int. Add uintptr_t cast to silence clang warning while also keeping enum cast for readability and consistency with other `chip_type` assignment just a few lines below: | chip_type = (enum pca955x_type)id->driver_data; Reported-by: Nathan Chancellor Closes: https://github.com/ClangBuiltLinux/linux/issues/1910 Signed-off-by: Justin Stitt Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20230816-void-drivers-leds-leds-pca955x-v1-1-2967e4c1bdcc@google.com Signed-off-by: Lee Jones commit 2b481822446e30943fb7c02744a7b49ebec0e696 Author: Andy Shevchenko Date: Tue Oct 24 19:06:50 2023 +0300 mfd: lpc_ich: Mark *_gpio_offsets data with const There is no reason why the GPIO resource offsets should not be const. Mark them accordingly and update a qualifier in struct lpc_ich_gpio_info definition. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231024160650.3898959-1-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit 272f99edab36974b58347e97ee105885e385fa88 Author: Johan Hovold Date: Tue Oct 3 17:29:27 2023 +0200 spmi: rename spmi device lookup helper Rename the SPMI device helper which is used to lookup a device from its OF node as spmi_find_device_by_of_node() so that it reflects the implementation and matches how other helpers like this are named. This will specifically make it more clear that this is a lookup function which returns a reference counted structure. Signed-off-by: Johan Hovold Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20231003152927.15000-6-johan+linaro@kernel.org Signed-off-by: Lee Jones commit ade7941a478e797f781040f96ae530a0abf7cbfe Author: Johan Hovold Date: Tue Oct 3 17:29:26 2023 +0200 spmi: document spmi_device_from_of() refcounting Add a comment documenting that the spmi_device_from_of() takes a reference to the embedded struct device that needs to be dropped after use. Signed-off-by: Johan Hovold Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20231003152927.15000-5-johan+linaro@kernel.org Signed-off-by: Lee Jones commit 36af195f7f35c205f716cddf5a8a8954c2e70bff Author: Rob Herring Date: Fri Oct 20 09:22:51 2023 -0500 dt-bindings: mfd: armltd: Move Arm board syscon's to separate schema The Arm Ltd board bindings are a bit unusual in that they define child nodes for various syscon's. The schemas are also incomplete as they lack constraints on having additional properties and some properties are missing. As the bindings for the different platforms only vary by compatibles, combine them into a single schema doc. Add the "arm,im-pd1-syscon" compatible which was not documented. Add "ranges", "#address-cells", and "#size-cells properties which were missing. With this, fix the error exposed in the register-bit-led binding. Signed-off-by: Rob Herring Reviewed-by: Linus Walleij Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20231020142252.3113716-2-robh@kernel.org Signed-off-by: Lee Jones commit b0227e7081404448a0059b8698fdffd2dec280d2 Author: Ondrej Jirman Date: Thu Oct 19 18:57:26 2023 +0200 mfd: rk8xx: Add support for RK806 power off Use DEV_OFF bit to power off the RK806 PMIC, when system-power-controller is used in DTS. Signed-off-by: Ondrej Jirman Reviewed-by: Sebastian Reichel Link: https://lore.kernel.org/r/20231019165732.3818789-5-megi@xff.cz Signed-off-by: Lee Jones commit 2a46cd97f401a669d71b3d36b78bd6653f8424ee Author: Ondrej Jirman Date: Thu Oct 19 18:57:25 2023 +0200 mfd: rk8xx: Add support for standard system-power-controller property DT property rockchip,system-power-controller is now deprecated. Signed-off-by: Ondrej Jirman Reviewed-by: Sebastian Reichel Link: https://lore.kernel.org/r/20231019165732.3818789-4-megi@xff.cz Signed-off-by: Lee Jones commit f0eb624455426cf7ddb453c4e5204b388d134c2e Author: Ondrej Jirman Date: Thu Oct 19 18:57:24 2023 +0200 dt-bindings: mfd: rk806: Allow system-power-controller property Declare support for this property. Signed-off-by: Ondrej Jirman Reviewed-by: Rob Herring Reviewed-by: Sebastian Reichel Link: https://lore.kernel.org/r/20231019165732.3818789-3-megi@xff.cz Signed-off-by: Lee Jones commit 961748bb155590570c76b94e6e5fe2a5e2cb4029 Author: Ondrej Jirman Date: Thu Oct 19 18:57:23 2023 +0200 dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller Deprecate support for this property in favor of standard system-power-controller one. Signed-off-by: Ondrej Jirman Reviewed-by: Rob Herring Reviewed-by: Sebastian Reichel Link: https://lore.kernel.org/r/20231019165732.3818789-2-megi@xff.cz Signed-off-by: Lee Jones commit 93fae36e030d8f74ea3a862814f3c45755639929 Author: Sebastian Reichel Date: Mon Oct 23 15:12:20 2023 +0200 dt-bindings: mfd: max8925: Convert to DT schema format Convert the binding to DT schema format. The sub-functions of this MFD device do not have their own compatible string and are thus described directly in the MFD binding document after being converted to YAML. Signed-off-by: Sebastian Reichel Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20231023131409.1796451-1-sebastian.reichel@collabora.com Signed-off-by: Lee Jones commit 0db434f513d5cde5420787f737c7538b21f93998 Author: Rob Herring Date: Tue Oct 17 15:36:02 2023 -0500 mfd: Use i2c_get_match_data() in a selection of drivers Use preferred i2c_get_match_data() instead of of_match_device() and i2c driver_data to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Chanwoo Choi Link: https://lore.kernel.org/r/20231017203603.2700864-1-robh@kernel.org Signed-off-by: Lee Jones commit 830fafce06e6fc2e63e141799833f7c7a73cf62b Author: Rob Herring Date: Tue Oct 17 15:36:10 2023 -0500 mfd: Use device_get_match_data() in a bunch of drivers Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Reviewed-by: Chen-Yu Tsai Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231017203612.2701060-1-robh@kernel.org Signed-off-by: Lee Jones commit 15d71e678ec14ce26f7a271fef363e5c04ec24bf Author: Rob Herring Date: Tue Oct 17 15:35:49 2023 -0500 mfd: mc13xxx-spi/wm831x-spi: Use spi_get_device_match_data() Use preferred spi_get_device_match_data() instead of of_match_device() and spi_get_device_id() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231017203550.2700601-1-robh@kernel.org Signed-off-by: Lee Jones tils.feedkeys.call.run(35) all.run(37) all.run(39) commit 9f58744c5eee149fae13c64b0b8b5b4405de3aa4 Author: Rob Herring Date: Tue Oct 17 15:35:36 2023 -0500 mfd: motorola-cpcap: Drop unnecessary of_match_device() call If probe is reached, we've already matched the device and in the case of DT matching, the struct device_node pointer will be set. Therefore, there is no need to call of_match_device() in probe. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231017203537.2700340-1-robh@kernel.org Signed-off-by: Lee Jones commit 831d1af85133e1763d41e20414912d9a1058ea72 Author: Hans de Goede Date: Sat Oct 14 22:54:14 2023 +0200 mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs Commit 9e86b2ad4c11 changed the channel used for HPDET detection (headphones vs lineout detection) from being hardcoded to ARIZONA_ACCDET_MODE_HPL (HP left channel) to it being configurable through arizona_pdata.hpdet_channel the DT/OF parsing added for filling arizona_pdata on devicetree platforms ensures that arizona_pdata.hpdet_channel gets set to ARIZONA_ACCDET_MODE_HPL when not specified in the devicetree-node. But on ACPI platforms where arizona_pdata is filled by arizona_spi_acpi_probe() arizona_pdata.hpdet_channel was not getting set, causing it to default to 0 aka ARIZONA_ACCDET_MODE_MIC. This causes headphones to get misdetected as line-out on some models. Fix this by setting hpdet_channel = ARIZONA_ACCDET_MODE_HPL. Fixes: e933836744a2 ("mfd: arizona: Add support for ACPI enumeration of WM5102 connected over SPI") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231014205414.59415-1-hdegoede@redhat.com Signed-off-by: Lee Jones commit 10450565b417d3520ef267a62cea07cd5590c982 Author: Johan Hovold Date: Tue Oct 3 17:29:25 2023 +0200 mfd: qcom-spmi-pmic: Switch to EXPORT_SYMBOL_GPL() Switch to using EXPORT_SYMBOL_GPL() for the revid helper as there is no reason not to use it. Signed-off-by: Johan Hovold Reviewed-by: Konrad Dybcio Acked-by: Caleb Connolly Link: https://lore.kernel.org/r/20231003152927.15000-4-johan+linaro@kernel.org Signed-off-by: Lee Jones commit 7b439aaa62fee474a0d84d67a25f4984467e7b95 Author: Johan Hovold Date: Tue Oct 3 17:29:24 2023 +0200 mfd: qcom-spmi-pmic: Fix revid implementation The Qualcomm SPMI PMIC revid implementation is broken in multiple ways. First, it assumes that just because the sibling base device has been registered that means that it is also bound to a driver, which may not be the case (e.g. due to probe deferral or asynchronous probe). This could trigger a NULL-pointer dereference when attempting to access the driver data of the unbound device. Second, it accesses driver data of a sibling device directly and without any locking, which means that the driver data may be freed while it is being accessed (e.g. on driver unbind). Third, it leaks a struct device reference to the sibling device which is looked up using the spmi_device_from_of() every time a function (child) device is calling the revid function (e.g. on probe). Fix this mess by reimplementing the revid lookup so that it is done only at probe of the PMIC device; the base device fetches the revid info from the hardware, while any secondary SPMI device fetches the information from the base device and caches it so that it can be accessed safely from its children. If the base device has not been probed yet then probe of a secondary device is deferred. Fixes: e9c11c6e3a0e ("mfd: qcom-spmi-pmic: expose the PMIC revid information to clients") Cc: stable@vger.kernel.org # 6.0 Signed-off-by: Johan Hovold Acked-by: Caleb Connolly Link: https://lore.kernel.org/r/20231003152927.15000-3-johan+linaro@kernel.org Signed-off-by: Lee Jones commit a0fa44c261e448c531f9adb3a5189a3520f3e316 Author: Johan Hovold Date: Tue Oct 3 17:29:23 2023 +0200 mfd: qcom-spmi-pmic: Fix reference leaks in revid helper The Qualcomm SPMI PMIC revid implementation is broken in multiple ways. First, it totally ignores struct device_node reference counting and leaks references to the parent bus node as well as each child it iterates over using an open-coded for_each_child_of_node(). Second, it leaks references to each spmi device on the bus that it iterates over by failing to drop the reference taken by the spmi_device_from_of() helper. Fix the struct device_node leaks by reimplementing the lookup using for_each_child_of_node() and adding the missing reference count decrements. Fix the sibling struct device leaks by dropping the unnecessary lookups of devices with the wrong USID. Note that this still leaves one struct device reference leak in case a base device is found but it is not the parent of the device used for the lookup. This will be addressed in a follow-on patch. Fixes: e9c11c6e3a0e ("mfd: qcom-spmi-pmic: expose the PMIC revid information to clients") Cc: stable@vger.kernel.org # 6.0 Signed-off-by: Johan Hovold Acked-by: Caleb Connolly Link: https://lore.kernel.org/r/20231003152927.15000-2-johan+linaro@kernel.org Signed-off-by: Lee Jones commit fe74f7a96616faa3a3ec12b6ed1371e79974f2ab Author: Russ Weight Date: Thu Sep 28 09:47:38 2023 -0700 mfd: intel-m10-bmc: Change contact for ABI docs Change ABI documentation contact information from Russ Weight to Peter Colberg. Signed-off-by: Russ Weight Acked-by: Peter Colberg Link: https://lore.kernel.org/r/20230928164738.278635-1-russell.h.weight@intel.com Signed-off-by: Lee Jones commit 4fddf148f7266fda21d1f3bf7b201695cf743449 Author: Mark Brown Date: Sun Oct 1 00:47:07 2023 +0100 mfd: max8907: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231001-mfd-maxim-maple-v1-3-cdfeb48a4d15@kernel.org Signed-off-by: Lee Jones commit 728f337477a7559e1f6316d8d32394cbd4084689 Author: Mark Brown Date: Sun Oct 1 00:47:06 2023 +0100 mfd: max77686: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanwoo Choi Link: https://lore.kernel.org/r/20231001-mfd-maxim-maple-v1-2-cdfeb48a4d15@kernel.org Signed-off-by: Lee Jones commit fc12429b406ebe8c545fa1b9d3996706ff07ef0c Author: Mark Brown Date: Sun Oct 1 00:47:05 2023 +0100 mfd: max77620: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20231001-mfd-maxim-maple-v1-1-cdfeb48a4d15@kernel.org Signed-off-by: Lee Jones commit aaca37ae369da657e6ba45b4e2f0e698692204c2 Author: Luca Weiss Date: Mon Oct 2 09:00:11 2023 +0200 dt-bindings: mfd: qcom,spmi-pmic: Drop unused labels from examples There's not much point in having unused labels in the binding example, so drop them. This patch was originally motivated by ea25d61b448a ("arm64: dts: qcom: Use plural _gpios node label for PMIC gpios") updating all dts files to use the plural _gpios label instead of the singular _gpio as label but this example wasn't updated. But since we should just drop the label alltogether, do that. Signed-off-by: Luca Weiss Acked-by: Conor Dooley Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231002-pm7250b-gpio-fixup-v2-1-debb8b599989@fairphone.com Signed-off-by: Lee Jones commit e53b22b10c6e0de0cf2a03a92b18fdad70f266c7 Author: Jarkko Nikula Date: Mon Oct 2 11:33:44 2023 +0300 mfd: intel-lpss: Add Intel Lunar Lake-M PCI IDs Add Intel Lunar Lake-M SoC PCI IDs. Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20231002083344.75611-1-jarkko.nikula@linux.intel.com Signed-off-by: Lee Jones commit 7f70d4590d949e1488f8ff7ebc35ee238a1e0661 Author: Mark Brown Date: Sun Oct 1 00:44:22 2023 +0100 mfd: rk8xx: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20231001-mfd-rk88x-maple-v1-1-90434cfb2f90@kernel.org Signed-off-by: Lee Jones commit 1c943dfd80075d15ac8c976d4b27bc77732d5d47 Author: Mark Brown Date: Sun Oct 1 11:27:54 2023 +0100 mfd: twl: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-7-0657862de3f6@kernel.org Signed-off-by: Lee Jones commit 214fbbd05ba95b9357f1e56c3787cf2e7258e392 Author: Mark Brown Date: Sun Oct 1 11:27:53 2023 +0100 mfd: tps65912: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-6-0657862de3f6@kernel.org Signed-off-by: Lee Jones commit 535cd579bc7be8c149b8cf0dd76891f5f53a1019 Author: Mark Brown Date: Sun Oct 1 11:27:52 2023 +0100 mfd: tps65910: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-5-0657862de3f6@kernel.org Signed-off-by: Lee Jones commit e142b022b3c155180f452452e075eae717b9b532 Author: Mark Brown Date: Sun Oct 1 11:27:51 2023 +0100 mfd: tps6586x: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-4-0657862de3f6@kernel.org Signed-off-by: Lee Jones commit 2e9a3fc2f98e1f017b85316ec2f8a296f3ae81c3 Author: Mark Brown Date: Sun Oct 1 11:27:50 2023 +0100 mfd: tps65128: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-3-0657862de3f6@kernel.org Signed-off-by: Lee Jones commit 778eea25bff27b4cdc7c7f4e2c045e5c2008a924 Author: Mark Brown Date: Sun Oct 1 11:27:49 2023 +0100 mfd: tps65090: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-2-0657862de3f6@kernel.org Signed-off-by: Lee Jones commit 6917c33322d14882b0e85fd338e203df7fbd3b1b Author: Mark Brown Date: Sun Oct 1 11:27:48 2023 +0100 mfd: tps65086: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20231001-mfd-ti-maple-v1-1-0657862de3f6@kernel.org Signed-off-by: Lee Jones commit 6bce629689f094bb7729ac77567a76763912b392 Author: Justin Stitt Date: Wed Sep 27 05:10:54 2023 +0000 mfd: db8500-prcmu: Replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect project_name to be NUL-terminated based on its use with pr_info: | pr_info("PRCMU firmware: %s(%d), version %d.%d.%d\n", | fw_info.version.project_name, | fw_info.version.project, | fw_info.version.api_version, | fw_info.version.func_version, | fw_info.version.errata); Moreover, NUL-padding does not seem to be needed. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Let's also change `PRCMU_FW_PROJECT_NAME_LEN` to just sizeof(fw_info.version.project_name) as this is more idiomatic strscpy usage. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230927-strncpy-drivers-mfd-db8500-prcmu-c-v1-1-db9693f92a68@google.com Signed-off-by: Lee Jones commit 61fdd1f1d2c183ec256527d16d75e75c3582af82 Author: Chen-Yu Tsai Date: Thu Sep 28 16:55:24 2023 +0800 dt-bindings: mfd: mt6397: Split out compatible for MediaTek MT6366 PMIC The MT6366 PMIC is mostly, but not fully, compatible with MT6358. It has a different set of regulators. Specifically, it lacks the camera related VCAM* LDOs and VLDO28, but has additional VM18, VMDDR, and VSRAM_CORE LDOs. The PMICs contain a chip ID register that can be used to detect which exact model is preset, so it is possible to share a common base compatible string. Add a separate compatible for the MT6366 PMIC, with a fallback to the MT6358 PMIC. Fixes: 49be16305587 ("dt-bindings: mfd: Add compatible for the MediaTek MT6366 PMIC") Signed-off-by: Chen-Yu Tsai Acked-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230928085537.3246669-2-wenst@chromium.org Signed-off-by: Lee Jones commit b4e40505f90a9936e7dd2dd0b98a1af97d8941f0 Author: Andy Shevchenko Date: Tue Sep 26 22:08:34 2023 +0300 mfd: lpc_ich: Add a platform device for pinctrl Denverton This is to cater the need in non-ACPI system whereby a platform device has to be created in order to bind with the Denverton pinctrl driver. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230926190834.932233-4-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit 1f84f88dc15036d63fa7c84833a440370f22a74b Author: Andy Shevchenko Date: Tue Sep 26 22:08:33 2023 +0300 mfd: lpc_ich: Move APL GPIO resources to a custom structure We are expecting more platforms that want to instantiate the GPIO device via P2SB. For them prepare the custom structure and move Apollo Lake data there. Refactor the code accordingly. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230926190834.932233-3-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit 16c4c1bb7e01d5de797c43d7a2396434f2078b0a Author: Andy Shevchenko Date: Tue Sep 26 22:08:32 2023 +0300 mfd: lpc_ich: Convert gpio_version to be enum We have an anonymous enum for the GPIO versions. Make it named and use this type for the gpio_version member of struct lpc_ich_info. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230926190834.932233-2-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit b0eb61880f004290a62b71b135825e9c5f5bde99 Author: Andy Shevchenko Date: Tue Sep 26 22:08:31 2023 +0300 mfd: lpc_ich: Make struct lpc_ich_priv use enum for chipset member We have a specific enum for the supported chipsets. Make struct lpc_ich_priv use better type for the chipset member. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230926190834.932233-1-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones commit 8cdbe51c2dcceb3fa15c16176849309fe6f99389 Author: Rob Herring Date: Mon Sep 25 16:27:24 2023 -0500 dt-bindings: mfd: Add missing unevaluatedProperties on child node schemas Just as unevaluatedProperties or additionalProperties are required at the top level of schemas, they should (and will) also be required for child node schemas. That ensures only documented properties are present for any node. Add unevaluatedProperties as needed, and then add any missing properties flagged by the addition. Signed-off-by: Rob Herring Acked-by: Conor Dooley Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230925212729.1976117-1-robh@kernel.org Signed-off-by: Lee Jones commit fd7a0ecf4e715c5f68a2a219fe774e1de730d0b7 Author: Andre Przywara Date: Tue Sep 19 11:39:12 2023 +0100 dt-bindings: mfd: x-powers,axp152: Make interrupt optional for more chips All X-Powers PMICs described by this binding have an IRQ pin, and so far (almost) all boards connected this to some NMI pin or GPIO on the SoC they are connected to. However we start to see boards that omit this connection, and technically the IRQ pin is not essential to the basic PMIC operation. The existing Linux driver allows skipping the IRQ pin setup for two chips already, so update the binding to also make the DT property optional for the missing chip. And while we are at it, add the AXP313a to that list, as they are actually boards out there not connecting the IRQ pin. This allows to have DTs correctly describing those boards not wiring up the interrupt. Signed-off-by: Andre Przywara Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230919103913.463156-2-andre.przywara@arm.com Signed-off-by: Lee Jones commit 759c409bc5fc496cbc22cd0b392d3cbb0c0e23eb Author: Dinghao Liu Date: Mon Sep 25 10:41:33 2023 +0800 mfd: dln2: Fix double put in dln2_probe The dln2_free() already contains usb_put_dev(). Therefore, the redundant usb_put_dev() before dln2_free() may lead to a double free. Fixes: 96da8f148396 ("mfd: dln2: Fix memory leak in dln2_probe()") Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20230925024134.9683-1-dinghao.liu@zju.edu.cn Signed-off-by: Lee Jones commit c4974eea6ca9f4080557bfdf0adc48396d8575f4 Author: Biju Das Date: Sat Sep 23 18:49:28 2023 +0100 mfd: max8998: Simplify obtaining I2C match data and drop max8998_i2c_get_driver_data() Simplify probe() by using i2c_get_match_data() instead of max8998_i2c_get_driver_data() for retrieving match data from OF/ID tables. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230923174928.56824-5-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones commit bffa42885f3bbddce56e17e619e083f041812f8a Author: Biju Das Date: Sat Sep 23 18:49:27 2023 +0100 mfd: max77541: Simplify obtaining I2C match data Simplify probe() by replacing device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230923174928.56824-4-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones commit f1f23a1a79512a22f9153e9b6d1c98a2b4ab300f Author: Biju Das Date: Sat Sep 23 18:49:26 2023 +0100 mfd: madera-i2c: Simplify obtaining I2C match data Simplify probe() by replacing of_device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230923174928.56824-3-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones commit 7ec9f1f31d8b41a0725777e220d2eb6e9d0dbc83 Author: Biju Das Date: Sat Sep 23 18:49:25 2023 +0100 mfd: arizona-i2c: Simplify obtaining I2C match data Simplify probe() by replacing device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). After this drop intializing the variable type. Signed-off-by: Biju Das Acked-by: Charles Keepax Tested-by: Charles Keepax Link: https://lore.kernel.org/r/20230923174928.56824-2-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones commit 69c3f9154553c22066108427eb24d94f1645551b Author: Kees Cook Date: Fri Sep 22 10:53:38 2023 -0700 mfd: iqs62x: Annotate struct iqs62x_fw_blk with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct iqs62x_fw_blk. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922175337.work.150-kees@kernel.org Signed-off-by: Lee Jones commit 1c7ea43fc42b09080657c83683846c4be672bd91 Author: Fabrice Gasnier Date: Tue Aug 29 15:40:25 2023 +0200 mfd: stm32-timers: Add support for interrupts There are two types of STM32 timers that may have: - a global interrupt line - 4 dedicated interrupt lines. Those interrupts are optional as defined in the dt-bindings. Enforce checks on either one, four or no interrupts are provided with their names. Optionally get them here, to be used by child devices. Signed-off-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20230829134029.2402868-5-fabrice.gasnier@foss.st.com Signed-off-by: Lee Jones commit 63416320419e99ea4c6530587658e5d14e9402ba Author: Andreas Kemnade Date: Sat Sep 16 12:05:13 2023 +0200 mfd: twl-core: Add a clock subdevice for the TWL6032 Clock device needs no separate devicetree node, so add it as a platform device. Other devices in the family also have controllable clocks, but due to the lack of testing, just add it for the TWL6032 now. Signed-off-by: Andreas Kemnade Link: https://lore.kernel.org/r/20230916100515.1650336-4-andreas@kemnade.info Signed-off-by: Lee Jones commit b06545fcb3c696f36fac6ba4c73023cef96d2f7f Author: Andreas Kemnade Date: Sat Sep 16 12:05:12 2023 +0200 dt-bindings: mfd: ti,twl: Add clock provider properties Since these devices provide clock outputs, add the corresponding property. Signed-off-by: Andreas Kemnade Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230916100515.1650336-3-andreas@kemnade.info Signed-off-by: Lee Jones commit 611ed1a5f394b41ab8ab892942c2e2ab42499245 Author: Andreas Kemnade Date: Sat Sep 16 12:05:11 2023 +0200 dt-bindings: mfd: Convert twl-family.txt to json-schema Convert the TWL[46]030 binding to DT schema format. To do it as a step by step work, do not include / handle nodes for subdevices yet, just convert things with minimal corrections. There are already some bindings for its subdevices in the tree. Signed-off-by: Andreas Kemnade Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230916100515.1650336-2-andreas@kemnade.info Signed-off-by: Lee Jones commit ad3a3c6e4aef5d77c4e5c1f9e46f40e8240079f7 Author: Manikandan Muralidharan Date: Fri Sep 15 16:18:42 2023 +0530 mfd: atmel-hlcdc: Add compatible for sam9x75 XLCD controller Add compatible for sam9x75 XLCD controller. Signed-off-by: Manikandan Muralidharan Link: https://lore.kernel.org/r/20230915104849.187146-2-manikandan.m@microchip.com Signed-off-by: Lee Jones commit cb523495ee2a5938fbdd30b8a35094d386c55c12 Author: Andrew Davis Date: Mon Sep 11 09:25:55 2023 -0500 dt-bindings: mfd: syscon: Add ti,am654-dss-oldi-io-ctrl compatible Add TI DSS OLDI-IO control registers compatible. This is a region of 5 32bit registers found in the TI AM65 CTRL_MMR0 register space[0]. They are used to control the characteristics of the OLDI DATA/CLK IO as needed by the DSS display controller node. [0] https://www.ti.com/lit/pdf/spruid7 Signed-off-by: Andrew Davis Acked-by: Krzysztof Kozlowski Reviewed-by: Aradhya Bhatia Link: https://lore.kernel.org/r/20230911142556.64108-1-afd@ti.com Signed-off-by: Lee Jones commit 89b00c328f5623c428e6aa8563c3a648f8190252 Author: Ying Sun Date: Wed Sep 13 16:45:59 2023 +0800 mfd: ab8500: Remove non-existent configuration "#ifdef CONFIG_AB8500_DEBUG" The CONFIG_AB8500_DEBUG has been deleted in: 3d4d1266597c0 ("mfd: ab8500: Drop debugfs module") The condition "#ifdef CONFIG_AB8500_DEBUG" in: include/linux/mfd/abx500/ab8500.h:502 ...cannot be valid. It is recommended to delete redundant code. Suggested-by: Yanjie Ren Signed-off-by: Ying Sun Link: https://lore.kernel.org/r/20230913084559.18141-1-sunying@nj.iscas.ac.cn Signed-off-by: Lee Jones commit a50afa310d6a4c765a1787742b206eb149bb1d12 Author: Mark Brown Date: Tue Sep 12 12:36:46 2023 +0100 mfd: wcd934x: Update to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. In v6.5 it has also acquired the ability to generate multi-register writes in sync operations, bringing performance up to parity with the rbtree cache there. Update the wcd934x to use the more modern data structure. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230912-mfd-wcd934x-maple-v2-1-292a154113e3@kernel.org Signed-off-by: Lee Jones commit a8e498368d75230988860e818b6e565ad70a2c66 Author: Krzysztof Kozlowski Date: Mon Sep 11 14:01:35 2023 +0200 dt-bindings: mfd: maxim,max8998: Convert to DT schema Convert the bindings for Maxim MAX8998, National/TI LP3974 Power Management IC to DT schema. Adjust example to real DTS and make second interrupt optional (like on s5pv210-aries.dtsi). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230911120135.37528-1-krzysztof.kozlowski@linaro.org Signed-off-by: Lee Jones commit 917991aae60f4f8a224b30a9eca6701be08d64b5 Author: Tengfei Fan Date: Fri Sep 8 14:58:43 2023 +0800 dt-bindings: mfd: qcom,tcsr: Add compatible for sm4450 Document the qcom,sm4450-tcsr compatible. Signed-off-by: Tengfei Fan Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230908065847.28382-3-quic_tengfan@quicinc.com Signed-off-by: Lee Jones commit b2cb2ae22278f1918f7526b89760ee00b4a81393 Author: Andre Przywara Date: Mon Aug 28 22:32:29 2023 +0100 mfd: axp20x: Generalise handling without interrupt At the moment we allow the AXP15060 and the AXP806 PMICs to omit the interrupt line to the SoC, and we skip registering the PEK (power key) driver in this case, since that crashes when no IRQ is described in the DT node. The IRQ pin potentially not being connected to anything does affect more PMICs, though, and the PEK driver is not the only one requiring an interrupt: at least the AC power supply driver crashes in a similar fashion. Generalise the handling of AXP MFD devices when the platform tables describe no interrupt, by allowing each device to specify an alternative MFD list for this case. If no specific alternative is specified, we go with the safe default of "just the regulators", which matches the current situation. This enables new devices using the AXP313a PMIC, but not connecting the IRQ pin. Signed-off-by: Andre Przywara Reviewed-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230828213229.20332-1-andre.przywara@arm.com Signed-off-by: Lee Jones commit 9a41c31e40d867bb4ad93b527b0ba7cfaae4c9c4 Author: Biju Das Date: Thu Aug 31 19:31:53 2023 +0100 mfd: palmas: Make similar OF and ID table Make similar OF and ID table to extend support for ID match using i2c_match_data(). Currently it works only for OF match tables as the driver_data is wrong for ID match. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230831183153.63750-5-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones commit a17e0bc66fd4f63c5a6090bdd140c988df8b6c47 Author: Biju Das Date: Thu Aug 31 19:31:52 2023 +0100 mfd: palmas: Move OF table closer to its consumer Move OF table near to the user. While at it, arrange compatible and data in single line. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230831183153.63750-4-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones commit 93ec3d0e02806e19caf2908d9b592ee509e2df9c Author: Biju Das Date: Thu Aug 31 19:31:51 2023 +0100 mfd: palmas: Constify .data in OF table and {palmas,tps65917}_irq_chip Constify .data in OF table and {palmas,tps65917}_irq_chip and replace the variable *features->features in struct palmas_driver_data and drop the {palmas,tps659038}_features variables and use their values directly in the named initialization. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230831183153.63750-3-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones commit 3f9a06dc7975d6261bdd252ba7e099d8f3514466 Author: Biju Das Date: Thu Aug 31 19:31:50 2023 +0100 mfd: palmas: Remove trailing comma in the terminator entry Remove trailing comma in the terminator entry for OF table. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230831183153.63750-2-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones commit e7df2d7c83a98d0fc0384d0315c86f3bb89de27d Author: Geert Uytterhoeven Date: Wed Aug 30 16:53:43 2023 +0200 dt-bindings: mfd: stericsson,db8500-prcmu: Spelling s/Cortex A-/Cortex-A/ Fix a misspelling of "Cortex-A9". Signed-off-by: Geert Uytterhoeven Reviewed-by: Linus Walleij Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/0789000f012122a7fa27ef709c738101b00cd834.1693407196.git.geert+renesas@glider.be Signed-off-by: Lee Jones commit 719a205707d67e715c5e807643edf4169a5ef1a3 Author: Alex Bee Date: Tue Aug 29 19:16:17 2023 +0200 dt-bindings: mfd: syscon: Add rockchip,rk3128-qos compatible Document Rockchip RK3128 SoC compatible for qos registers. Signed-off-by: Alex Bee Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230829171647.187787-2-knaerzche@gmail.com Signed-off-by: Lee Jones commit 7ba7bdef4d14e3722e2842da3b48cbadb73e52d6 Author: Herve Codina Date: Fri Aug 18 18:39:17 2023 +0200 mfd: core: Ensure disabled devices are skipped without aborting The loop searching for a matching device based on its compatible string is aborted when a matching disabled device is found. This abort prevents to add devices as soon as one disabled device is found. Continue searching for an other device instead of aborting on the first disabled one fixes the issue. Fixes: 22380b65dc70 ("mfd: mfd-core: Ensure disabled devices are ignored without error") Signed-off-by: Herve Codina Reviewed-by: Christophe Leroy Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/528425d6472176bb1d02d79596b51f8c28a551cc.1692376361.git.christophe.leroy@csgroup.eu Signed-off-by: Lee Jones commit 0202e408fa0c7da34adeb26958f42248c999a1a8 Author: Bryan O'Donoghue Date: Wed Aug 16 12:51:45 2023 +0100 dt-bindings: mfd: qcom,spmi-pmic: Add typec to SPMI device types Add the PMIC Type-C port driver to the list of devices. Signed-off-by: Bryan O'Donoghue Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230816115151.501736-2-bryan.odonoghue@linaro.org Signed-off-by: Lee Jones commit 676c26722333301e2d8794401f3c14e6c225f27f Author: Biju Das Date: Mon Aug 28 17:02:24 2023 +0100 mfd: max8997: Simplify obtaining I2C match data and drop max8997_i2c_get_driver_data() Simplify probe() by using i2c_get_match_data() instead of max8997_i2c_get_driver_data() for retrieving match data from OF/ID tables. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230828160224.92037-1-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones commit 3c70342f1f0045dc827bb2f02d814ce31e0e0d05 Author: Michał Mirosław Date: Mon Aug 28 22:16:11 2023 +0200 mfd: core: Un-constify mfd_cell.of_reg Enable dynamically filling in the whole mfd_cell structure. All other fields already allow that. Fixes: 466a62d7642f ("mfd: core: Make a best effort attempt to match devices with the correct of_nodes") Signed-off-by: Michał Mirosław Link: https://lore.kernel.org/r/b73fe4bc4bd6ba1af90940a640ed65fe254c0408.1693253717.git.mirq-linux@rere.qmqm.pl Signed-off-by: Lee Jones commit 26329c97fbba6467cdbb2e63fb37d12d03a40925 Author: Dmitry Baryshkov Date: Sun Aug 27 16:24:50 2023 +0300 dt-bindings: mfd: qcom-pm8xxx: Add missing child nodes Add gpio, keypad, led, mpps, pwrkey, vibrator and xoadc as possible child nodes of qcom,pm8xxx, referencing existint schema files. Signed-off-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230827132525.951475-3-dmitry.baryshkov@linaro.org Signed-off-by: Lee Jones commit ea927f1909866350ec3cc4c83da835bf4065723b Author: Dmitry Baryshkov Date: Tue Aug 22 02:25:32 2023 +0300 dt-bindings: mfd: qcom-spmi-pmic: Add pm8450 entry Add bindings for the PM8450 PMIC (qcom,pm8450). No driver changes are necessary, since the PMIC is handled by the generic qcom,spmi-pmic entry. Signed-off-by: Dmitry Baryshkov Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230821232532.3110607-1-dmitry.baryshkov@linaro.org Signed-off-by: Lee Jones commit 55bb1a507fe3940fb2db99077d9e31046ad52247 Merge: 0bb80ecc33a8f 510f276df2b91 Author: Lee Jones Date: Wed Nov 1 10:00:28 2023 +0000 Merge tag 'ib-mfd-i2c-reboot-v6.7' into ibs-for-mfd-merged Immutable branch between MFD, I2C and Reboot due for the v6.7 merge window commit a312e07a65fb598ed239b940434392721385c722 Author: Eric Biggers Date: Fri Oct 27 13:30:17 2023 -0700 crypto: adiantum - flush destination page before unmapping Upon additional review, the new fast path in adiantum_finish() is missing the call to flush_dcache_page() that scatterwalk_map_and_copy() was doing. It's apparently debatable whether flush_dcache_page() is actually needed, as per the discussion at https://lore.kernel.org/lkml/YYP1lAq46NWzhOf0@casper.infradead.org/T/#u. However, it appears that currently all the helper functions that write to a page, such as scatterwalk_map_and_copy(), memcpy_to_page(), and memzero_page(), do the dcache flush. So do it to be consistent. Fixes: dadf5e56c967 ("crypto: adiantum - add fast path for single-page messages") Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit b030c45844cfe0d4c89202cd6c9f4697b3a25a6a Author: Eric Biggers Date: Fri Oct 27 12:52:06 2023 -0700 crypto: testmgr - move pkcs1pad(rsa,sha3-*) to correct place alg_test_descs[] needs to be in sorted order, since it is used for binary search. This fixes the following boot-time warning: testmgr: alg_test_descs entries in wrong order: 'pkcs1pad(rsa,sha512)' before 'pkcs1pad(rsa,sha3-256)' Fixes: ee62afb9d02d ("crypto: rsa-pkcs1pad - Add FIPS 202 SHA-3 support") Signed-off-by: Eric Biggers Reviewed-by: Dimitri John Ledkov Signed-off-by: Herbert Xu commit 8bc9e6515183935fa0cccaf67455c439afe4982b Merge: f9ae180416e04 fe612629746cf Author: Linus Torvalds Date: Tue Oct 31 18:50:13 2023 -1000 Merge tag 'devicetree-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: - Add a kselftest to check for unprobed DT devices - Fix address translation for some 3 address cells cases - Refactor firmware node refcounting for AMBA bus - Add bindings for qcom,sm4450-pdc, Qualcomm Kryo 465 CPU, and Freescale QMC HDLC - Add Marantec vendor prefix - Convert qcom,pm8921-keypad, cnxt,cx92755-wdt, da9062-wdt, and atmel,at91rm9200-wdt bindings to DT schema - Several additionalProperties/unevaluatedProperties on child node schemas fixes - Drop reserved-memory bindings which now live in dtschema project - Fix a reference to rockchip,inno-usb2phy.yaml - Remove backlight nodes from display panel examples - Expand example for using DT_SCHEMA_FILES - Merge simple LVDS panel bindings to one binding doc * tag 'devicetree-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (34 commits) dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Add support for QMC HDLC dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Add 'additionalProperties: false' in child nodes dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Fix example property name dt-bindings: arm,coresight-cti: Add missing additionalProperties on child nodes dt-bindings: arm,coresight-cti: Drop type for 'cpu' property dt-bindings: soundwire: Add reference to soundwire-controller.yaml schema dt-bindings: input: syna,rmi4: Make "additionalProperties: true" explicit media: dt-bindings: ti,ds90ub960: Add missing type for "i2c-alias" dt-bindings: input: qcom,pm8921-keypad: convert to YAML format of: overlay: unittest: overlay_bad_unresolved: Spelling s/ok/okay/ of: address: Consolidate bus .map() functions of: address: Store number of bus flag cells rather than bool of: unittest: Add tests for address translations of: address: Remove duplicated functions of: address: Fix address translation when address-size is greater than 2 dt-bindings: watchdog: cnxt,cx92755-wdt: convert txt to yaml dt-bindings: watchdog: da9062-wdt: convert txt to yaml dt-bindings: watchdog: fsl,scu-wdt: Document imx8dl dt-bindings: watchdog: atmel,at91rm9200-wdt: convert txt to yaml dt-bindings: usb: rockchip,dwc3: update inno usb2 phy binding name ... commit f9ae180416e04bcee4d3cd216a6264a50f9299e6 Merge: fe4ae2fab00b4 469d31745b9fb Author: Linus Torvalds Date: Tue Oct 31 18:47:03 2023 -1000 Merge tag 'for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: "Core changes: - propagate of_node to child device - change from atomic to blocking notifier_call_chain New drivers: - pm8916 battery management system - mm8013 fuel gauge New features: - maxim max17040: add temperature support - gpio-poweroff: make priority configurable Cleanups: - simplify reset drivers using builtin_platform_driver() - convert all platform drivers to remove_new callback - replace all strncpy occurrences with strscpy - started converting drivers to i2c_get_match_data() - misc fixes and cleanups" * tag 'for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (91 commits) power: reset: vexpress: Use device_get_match_data() power: supply: surface-charger: replace deprecated strncpy with strscpy power: supply: surface_battery: replace deprecated strncpy with strscpy power: supply: charger-manager: replace deprecated strncpy with strscpy power: supply: bq25980: replace deprecated strncpy with strscpy power: supply: bq256xx: replace deprecated strncpy with strscpy power: supply: bq2515x: replace deprecated strncpy with strscpy power: supply: bq24190_charger: replace deprecated strncpy with strscpy power: supply: cpcap: Drop non-DT driver matching power: reset: brcmstb: Depend on actual SoC dependencies power: reset: gpio-poweroff: make sys handler priority configurable dt-bindings: power: reset: gpio-poweroff: Add priority property power: reset: gpio-poweroff: use sys-off handler API power: reset: gpio-poweroff: use a struct to store the module variables power: supply: rt5033_charger: Replace "&pdev->dev" by "charger->dev" in probe power: supply: rt5033_charger: Simplify initialization of rt5033_charger_data power: supply: rt5033_charger: Add cable detection and USB OTG supply power: supply: core: remove opencoded string_lower() dt-bindings: power: supply: sbs-manager: Add missing unevaluatedProperties on child node schemas power: supply: mm8013: Fix an error checking issue in mm8013_checkdevice() ... commit fe4ae2fab00b4751265580c5865fdf23b62d80b3 Merge: c52894359395e 0a6d7f8275f25 Author: Linus Torvalds Date: Tue Oct 31 18:42:56 2023 -1000 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk driver updates from Stephen Boyd: "Herein lies a smallish collection of clk driver updates and some core clk framework changes for the merge window. The core framework changes are only improving the debugfs interface to allow phase adjustments and report which consumers of a clk there are. These are most likely only of interest to kernel developers. On the clk driver side, it's a ghastly amount of updates with only a handful of new clk drivers. We have a couple new clk drivers for Qualcomm, per usual, and a driver for Renesas, Amlogic, and TI respectively. The updates are spread throughout the clk drivers. Some highlights are fixing kunit tests for different configurations like lockdep and big-endian, avoiding integer overflow in rate settable clks, moving clk_hw_onecell_data to the end of allocations so that drivers don't corrupt their private data, and migrating clk drivers to the regmap maple tree. Otherwise it's the usual fixes to clk drivers that only come along with testing the drivers on real hardware. New Drivers: - Add clock driver for TWL6032 - Initial support for the Qualcomm SM4450 Global Clock Controller and SM4450 RPMh clock controllers - Add Camera Clock Controller on Qualcomm SM8550 - Add support for the Renesas RZ/G3S (R9A08G045) SoC - Add Amlogic s4 main clock controller support Updates: - Make clk kunit tests work with lockdep - Fix clk gate kunit test for big-endian - Convert more than a handful of clk drivers to use regmap maple tree - Consider the CLK_FRAC_DIVIDER_ZERO_BASED in fractional divider clk implementation - Add consumer info to clk debugfs - Fix various clk drivers that have clk_hw_onecell_data not at the end of an allocation - Drop CLK_SET_RATE_PARENT for clocks with fixed-rate GPLLs across a variety of Qualcomm IPQ platforms - Add missing parent of APCS PLL on Qualcomm IPQ6018 - Add I2C QUP6 clk on Qualcomm IPQ6018 but mark it critical to avoid problems with RPM - Implement safe source switching for a53pll and use on Qualcomm IPQ5332 - Add support for Stromer Plus PLLs to Qualcomm clk driver - Switch Qualcomm SM8550 Video and GPU clock controllers to use OLE PLL configure method - Non critical fixes to halt bit checks in Qualcomm clk drivers - Add SMMU GDSC for Qualcomm MSM8998 - Fix possible integer overflow in Qualcomm RCG frequency calculation code - Remove RPM managed clks from Qualcomm MSM8996 GCC driver - Add HFPLL configuration for the three HFPLLs in Qualcomm MSM8976 - Switch Qualcomm MSM8996 CBF clock driver's remove function to return void - Fix missing dependency for s4 clock controllers - Select MXC_CLK when building in the CLK_IMX8QXP - Fixes for error handling paths in i.MX8 ACM driver - Move the clocks check in i.MX8 ACM driver in order to log any error - Drop the unused return value of clk_imx_acm_detach_pm_domains - Drop non-existant IMX8MP_CLK_AUDIOMIX_PDM_ROOT clock - Fix error handling in i.MX8MQ clock driver - Allow a different LCDIF1 clock parent if DT describes it for i.MX6SX - Keep the SCU resource table sorted in the i.MX8DXL rsrc driver - Move the elcdif PLL clock registration above lcd_clk, as it is its parent - Correct some ENET specific clocks for i.MX8DXL platform - Drop the VPU_UART and VPUCORE from i.MX8QM as latest HW revision doesn't have them - Remove "de-featured" MLB support from i.MX8QM/QXP/DXL platforms - Skip registering clocks owned by Cortex-A partition SCU-based platforms - Add CAN_1/2 to i.MX8QM and M4_0, PI_0_PWM_0 and PI_0_I2C_0 to i.MX8QXP resources" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (128 commits) clk: Fix clk gate kunit test on big-endian CPUs clk: si521xx: Increase stack based print buffer size in probe clk: mediatek: fix double free in mtk_clk_register_pllfh() clk: socfpga: agilex: Add bounds-checking coverage for struct stratix10_clock_data clk: socfpga: Fix undefined behavior bug in struct stratix10_clock_data clk: sifive: Allow building the driver as a module clk: analogbits: Allow building the library as a module clk: sprd: Composite driver support offset config clk: Allow phase adjustment from debugfs clk: Show active consumers of clocks in debugfs clk: Use device_get_match_data() clk: visconti: Add bounds-checking coverage for struct visconti_pll_provider clk: visconti: Fix undefined behavior bug in struct visconti_pll_provider clk: cdce925: Extend match support for OF tables clk: si570: Simplify probe clk: si5351: Simplify probe clk: rs9: Use i2c_get_match_data() instead of device_get_match_data() clk: clk-si544: Simplify probe() and is_valid_frequency() clk: si521xx: Use i2c_get_match_data() instead of device_get_match_data() clk: meson: S4: select CONFIG_COMMON_CLK_MESON_CLKC_UTILS ... commit c52894359395ea0a562b3ed556848ed66fbfff86 Merge: 59fff63cc2b75 fc62d5e214df2 Author: Linus Torvalds Date: Tue Oct 31 18:32:51 2023 -1000 Merge tag 'for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pateldipen1984/linux Pull hte/timestamp updates from Dipen Patel: - Improve comments in the translate function - Reflect the GPIOLIB API changes during calculation of the GPIO base - Improve error handling in Tegra test and provider drivers - Improve code to set the line name * tag 'for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pateldipen1984/linux: hte: Use kasprintf() instead of fixed buffer formatting hte: tegra: Fix missing error code in tegra_hte_test_probe() hte: tegra194: Switch to LATE_SIMPLE_DEV_PM_OPS() hte: tegra194: Remove redundant dev_err() hte: tegra194: improve the GPIO-related comment hte: allow building modules with COMPILE_TEST enabled hte: Annotate struct hte_device with __counted_by commit 59fff63cc2b75dcfe08f9eeb4b2187d73e53843d Merge: 3475b91ff258b 94ace9eda8822 Author: Linus Torvalds Date: Tue Oct 31 17:53:00 2023 -1000 Merge tag 'platform-drivers-x86-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver updates from Ilpo Järvinen: - asus-wmi: Support for screenpad and solve brightness key press duplication - int3472: Eliminate the last use of deprecated GPIO functions - mlxbf-pmc: New HW support - msi-ec: Support new EC configurations - thinkpad_acpi: Support reading aux MAC address during passthrough - wmi: Fixes & improvements - x86-android-tablets: Detection fix and avoid use of GPIO private APIs - Debug & metrics interface improvements - Miscellaneous cleanups / fixes / improvements * tag 'platform-drivers-x86-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (80 commits) platform/x86: inspur-platform-profile: Add platform profile support platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e platform/x86: wmi: Decouple WMI device removal from wmi_block_list platform/x86: wmi: Fix opening of char device platform/x86: wmi: Fix probe failure when failing to register WMI devices platform/x86: wmi: Fix refcounting of WMI devices in legacy functions platform/x86: wmi: Decouple probe deferring from wmi_block_list platform/x86/amd/hsmp: Fix iomem handling platform/x86: asus-wmi: Do not report brightness up/down keys when also reported by acpi_video platform/x86: thinkpad_acpi: replace deprecated strncpy with memcpy tools/power/x86/intel-speed-select: v1.18 release tools/power/x86/intel-speed-select: Use cgroup isolate for CPU 0 tools/power/x86/intel-speed-select: Increase max CPUs in one request tools/power/x86/intel-speed-select: Display error for core-power support tools/power/x86/intel-speed-select: No TRL for non compute domains tools/power/x86/intel-speed-select: turbo-mode enable disable swapped tools/power/x86/intel-speed-select: Update help for TRL tools/power/x86/intel-speed-select: Sanitize integer arguments platform/x86: acer-wmi: Remove void function return platform/x86/amd/pmc: Add dump_custom_stb module parameter ... commit 3475b91ff258b998b891964e8c263cff48384c01 Merge: f9a7eda4d73d4 47ea0ddb1f560 Author: Linus Torvalds Date: Tue Oct 31 17:47:40 2023 -1000 Merge tag 'tag-chrome-platform-for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform updates from Tzung-Bi Shih: "Improvements: - Annotate flexible array members with __counted_by - Convert platform drivers' .remove callbacks to return void Fixes: - Avoid MKBP event timeouts by disabling/enabling IRQ later/earlier Misc: - Minor cleanups and fixes" * tag 'tag-chrome-platform-for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: (21 commits) platform/chrome: cros_ec_lpc: Separate host command and irq disable platform/chrome: kunit: make EC protocol tests independent platform/chrome: kunit: initialize lock for fake ec_dev platform/chrome: cros_ec: fix compilation warning platform/chrome: cros_ec_proto: Mark outdata as const platform/chrome: cros_typec_vdm: Mark port_amode_ops const platform/chrome: cros_ec_typec: Use dev_err_probe() more platform/chrome: cros_ec_typec: Use semi-colons instead of commas platform/chrome/wilco_ec: telemetry: Convert to platform remove callback returning void platform/chrome/wilco_ec: debugfs: Convert to platform remove callback returning void platform/chrome/wilco_ec: core: Convert to platform remove callback returning void platform/chrome: cros_usbpd_notify: Convert to platform remove callback returning void platform/chrome: cros_usbpd_logger: Convert to platform remove callback returning void platform/chrome: cros_typec_switch: Convert to platform remove callback returning void platform/chrome: cros_ec_vbc: Convert to platform remove callback returning void platform/chrome: cros_ec_sysfs: Convert to platform remove callback returning void platform/chrome: cros_ec_lpc: Convert to platform remove callback returning void platform/chrome: cros_ec_lightbar: Convert to platform remove callback returning void platform/chrome: cros_ec_debugfs: Convert to platform remove callback returning void platform/chrome: cros_ec_chardev: Convert to platform remove callback returning void ... commit f9a7eda4d73d44dc1d17d05cdc9aeb9fc5660740 Merge: 34aac0a33de21 0f564130e5c76 Author: Linus Torvalds Date: Tue Oct 31 17:44:17 2023 -1000 Merge tag 'hwmon-for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "New drivers: - Driver for LTC2991 - Driver for POWER-Z Added chip / system support to existing drivers: - The ina238 driver now also supports INA237 - The asus-ec-sensors driver now supports ROG Crosshair X670E Gene - The aquacomputer_d5next now supports Aquacomputer High Flow USB and MPS Flow - The pmbus/mpq7932 driver now also supports MPQ2286 - The nct6683 now also supports ASRock X670E Taichi Various other minor improvements and fixes: - One patch series to call out is the conversion of hwmon platform drivers to use the platform remove callback returning void" * tag 'hwmon-for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (69 commits) hwmon: (aquacomputer_d5next) Check if temp sensors of legacy devices are connected hwmon: (aquacomputer_d5next) Add support for Aquacomputer High Flow USB and MPS Flow dt-bindings: hwmon: npcm: Add npcm845 compatible string hwmon: Add driver for ltc2991 dt-bindings: hwmon: ltc2991: add bindings hwmon: (pmbus/max31785) Add delay between bus accesses hwmon: (ina238) add ina237 support dt-bindings: hwmon: ti,ina2xx: add ti,ina237 hwmon: (asus-ec-sensors) add ROG Crosshair X670E Gene. hwmon: (max31827) handle vref regulator hwmon: (ina3221) Add support for channel summation disable dt-bindings: hwmon: ina3221: Add ti,summation-disable dt-bindings: hwmon: ina3221: Convert to json-schema hwmon: (pmbus/mpq7932) Add a support for mpq2286 Power Management IC hwmon: (pmbus/core) Add helper macro to define single pmbus regulator regulator: dt-bindings: Add mps,mpq2286 power-management IC hwmon: (pmbus/mpq7932) Get page count based on chip info dt-bindings: hwmon: Add possible new properties to max31827 bindings hwmon: (max31827) Modify conversion wait time hwmon: (max31827) Make code cleaner ... commit 34aac0a33de21ec6e03b689342c0933a4989fbc2 Merge: 9d6c80f8054f7 1b2e883e1af89 Author: Linus Torvalds Date: Tue Oct 31 17:40:35 2023 -1000 Merge tag 'spi-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "This is a very quiet release for SPI, we've got cleanups and minor fixes but only a few new driver specific features. The bulk of the changes in terms of diffstat are the cleanups, plus one bit of performance work for McSPI. - Conversions to use devm_clk_get_enabled() and to remove outdated terms for controller and device - Device mode support for the Renesas CSI - Cleanups and improvements to the device tree bindings aimed at making validation better - PIO FIFO usage for the OMAP2 McSPI, improving performance" * tag 'spi-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (75 commits) spi: omap2-mcspi: Add FIFO support without DMA spi: stm32: Explicitly include correct DT includes spi: Export acpi_spi_find_controller_by_adev() spi: nxp-fspi: use the correct ioremap function spi: Don't use flexible array in struct spi_message definition spi: bcm2835: add a sentinel at the end of the lookup array spi: spi-geni-qcom: Rename the label unmap_if_dma spi: rzv2m-csi: Add target mode support spi: renesas,rzv2m-csi: Add CSI (SPI) target related property spi: spidev: make spidev_class constant spi: mpc52xx-psc: Make mpc52xx_psc_spi_transfer_one_message() static spi: spi-cadence-quadspi: Fix missing unwind goto warnings spi: omap2-mcspi: Fix hardcoded reference clock spi: dt-bindings: Make "additionalProperties: true" explicit spi: at91-usart: Remove some dead code spi: dt-bindings: st,stm32-spi: Move "st,spi-midi-ns" to spi-peripheral-props.yaml spi: qup: Vote for interconnect bandwidth to DRAM spi: dt-bindings: qup: Document interconnects spi: qup: Parse OPP table for DVFS support spi: dt-bindings: qup: Document power-domains and OPP ... commit 9d6c80f8054f75326939b947185ec47ba3755d42 Merge: 5cbff4b2d9e2a 3e0569ff81267 Author: Linus Torvalds Date: Tue Oct 31 17:33:21 2023 -1000 Merge tag 'regulator-v6.7' 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 changes are dominated by some new drivers and a quite large set of cleanups and filling in the blanks of features for the existing MT6358 driver. - Cleanups and additional features for the Mediatek MT6358 driver - Under voltage detection in the fixed regulator - Support for Maxim MAX77503, Mediatek MT6366, Qualcomm PM8909, PM8919, PMA8048 and PMC8380" * tag 'regulator-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (45 commits) regulator (max5970): Remove duplicate line regulator (max5970): Add hwmon support regulator: qcom-rpmh: Fix smps4 regulator for pm8550ve regulator: qcom,rpmh: Add PMC8380 compatible regulator: qcom-rpmh: Add regulators support for PMC8380 regulator: fixed: add support for under-voltage IRQ regulator: dt-bindings: fixed-regulator: Add under-voltage interrupt support dt-bindings: regulator: dlg,da9210: Convert to json-schema regulator: dt-bindings: Add ADI MAX77503 support regulator: max77503: Add ADI MAX77503 support regulator: Use device_get_match_data() regulator: da9121: Use i2c_get_match_data() regulator: Drop unnecessary of_match_device() calls regulator: da9063: Annotate struct da9063_regulators with __counted_by regulator: da9062: Annotate struct da9062_regulators with __counted_by regulator: mt6358: Add supply names for MT6366 regulators regulator: mt6358: Add missing regulators for MT6366 regulator: mt6358: Make MT6366 vcn18 LDO configurable regulator: mt6358: fix and drop type prefix in MT6366 regulator node names regulator: mt6358: Add supply names for MT6358 regulators ... commit 5cbff4b2d9e2a59f4096af8b8f967e2b30f025f2 Merge: b05ddad00903b 6bbebcc11a69a Author: Linus Torvalds Date: Tue Oct 31 17:28:48 2023 -1000 Merge tag 'regmap-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap updates from Mark Brown: "The main change here is a fix for an issue where we were letting the selector for windowed register ranges get out of sync with the hardware during a cache sync plus associated KUnit tests. This was reported just at the end of the release cycle and only in -next for a day prior to the merge window so it seemed better to hold off for now, the bug had been present for more than a decade so wasn't causing too many practical problems hopefully. There's also a fix for error handling in the debugfs output from Christope Jaillet" * tag 'regmap-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: Ensure range selector registers are updated after cache sync regmap: kunit: Add test for cache sync interaction with ranges regmap: kunit: Fix marking of the range window as volatile regmap: debugfs: Fix a erroneous check after snprintf() commit b05ddad00903b24931cb4b45516f1bc1b5c288f2 Merge: ad1871ad8d9b3 9bc633117d6a8 Author: Linus Torvalds Date: Tue Oct 31 17:21:54 2023 -1000 Merge tag 'gpio-updates-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio updates from Bartosz Golaszewski: "We don't have any new drivers. The loongson driver is getting extended with support for new models. There's a big refactor of gpio-pca953x and many small improvements to others. The GPIO code in the kernel has acquired a lot of cruft over the years as well as many abusers of the API across the kernel tree. This release cycle we have started a major cleanup and improvement effort that will most likely span several releases. We have started by converting external users of struct gpio_chip to accessing the wrapper around it - struct gpio_device. This is because the latter is reference counted while the former is removed when the provider is unbound. We also removed several instances of drivers accessing private GPIOLIB structures and including the private header from drivers/gpio/. To that end you'll see several commits aimed at different subsystems (acked by relevant maintainers) as well as two merges from the x86/platform tree. We'll then rework the locking in GPIOLIB which currently uses a big spinlock for many different things and could use becoming more fine-grained, especially as it doesn't even get the locking right. We'll also use SRCU for protecting the gpio_chip pointer against in-kernel hot-unplug crashes similar to what we saw triggered from user-space and fixed with semaphores in gpiolib-cdev. The core GPIOLIB is still vulnerable to these use-cases. I'm just mentioning the plans here, this is not part of this PR. You'll see some new instances of using __free(). We've added a gpio_device_put cleanup helper similar to the put_device one introduced by Peter Zijlstra and used it according to the preferred pattern except where it didn't make sense. GPIOLIB core: - provide interfaces allowing users to retrieve, manage and query the reference counted GPIO device instead of accessing the private gpio_chip structure - replace gpiochip_find() with gpio_device_find() - remove unused acpi_get_and_request_gpiod() - improve the ignore_interrupt functionality in GPIO ACPI - correct notifier return codes in gpiolib-of - unexport gpiod_set_transitory() as it's unused outside of core GPIO code - while there are still external users accessing struct gpio_chip, let's make gpiochip_get_desc() public so that they at least use the preferred helper - improve locking for lookup tables - annotate struct linereq with __counted_by - improve GPIOLIB docs - add an OF quirk for LED trigger sources Driver improvements: - convert all GPIO drivers with .remove() callbacks to using the new variant returning void instead of int - stop accessing the GPIOLIB private structures in gpio-mockup, i2c-mux-gpio, hte-tegra194, gpio-sim - use the recommended pattern for autofree variables in gpio-sim - add support for more models to gpio-loongson - use a notifier chain to notify other blocks about interrupts in gpio-eic-sprd instead of looking up GPIO devices on every interrupt - convert gpio-pca953x and gpio-fx6408 to using the maple tree regmap cache - don't include GPIOLIB internal headers in drivers which don't need them - move the ingenic NAND quirk into gpiolib-of - add an ignore interrupt quirk for Peaq C1010 - drop static GPIO base from gpio-omap, gpio-f7188x - use the preferred device_get_match_data() function in drivers that still don't - refactor gpio-pca953x: switch to using DEFINE_SIMPLE_DEV_PM_OPS(), use cleanup helpers, use dev_err_probe() where it makes sense, fully convert to using devres and some other minor tweaks DT bindings: - add support for a new model to gpio-vf610 and update existing properties - add support for more loongson models - add missing support for imx models that are used but undocumented - convert bindings for Intel IXP4xx to schema Minor stuff: - deprecate gpio-mockup in favor of gpio-sim - include missing headers here and there - stop using gpiochip_find() in OMAP1 board files - minor tweaks in gpio-vf610, gpio-hisi - remove unneeded 'extern' specifiers from headers" * tag 'gpio-updates-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (108 commits) hte: tegra194: add GPIOLIB dependency hte: tegra194: don't access struct gpio_chip gpiolib: provide gpio_device_get_base() i2c: mux: gpio: don't fiddle with GPIOLIB internals gpiolib: provide gpiod_to_gpio_device() gpiolib: provide gpio_device_to_device() gpio: hisi: Fix format specifier gpiolib: provide gpio_device_find_by_fwnode() gpio: acpi: remove acpi_get_and_request_gpiod() gpio: Use device_get_match_data() gpio: vf610: update comment for i.MX8ULP and i.MX93 legacy compatibles platform/x86: int3472: Switch to devm_get_gpiod() platform/x86: int3472: Stop using gpiod_toggle_active_low() platform/x86: int3472: Add new skl_int3472_gpiod_get_from_temp_lookup() helper platform/x86: int3472: Add new skl_int3472_fill_gpiod_lookup() helper gpio: vf610: simplify code by dropping data check gpio: vf610: add i.MX8ULP of_device_id entry dt-bindings: gpio: vf610: add i.MX95 compatible dt-bindings: gpio: vf610: correct i.MX8ULP and i.MX93 dt-bindings: gpio: vf610: update gpio-ranges ... commit a6bdc082ad1c91d389a6ba0c7a1945818f732114 Merge: ffc253263a137 99c9991f4e5d7 Author: Huacai Chen Date: Wed Nov 1 10:55:00 2023 +0800 Merge 'bpf-next 2023-10-16' into loongarch-next LoongArch architecture changes for 6.7 (BPF CPU v4 support) depend on the bpf changes to fix conflictions in selftests and work, so merge them to create a base. commit b8c2f6617fd734e6cf265b3b38383f16e47d2037 Merge: 87615e95f6f9c 2960f371f1653 Author: Palmer Dabbelt Date: Thu Oct 26 09:40:36 2023 -0700 Merge patch series "RISC-V: ACPI improvements" Sunil V L says: This series is a set of patches which were originally part of RFC v1 series [1] to add ACPI support in RISC-V interrupt controllers. Since these patches are independent of the interrupt controllers, creating this new series which helps to merge instead of waiting for big series. This set of patches primarily adds support below ECR [2] which is approved by the ASWG and adds below features. - Get CBO block sizes from RHCT on ACPI based systems. Additionally, the series contains a patch to improve acpi_os_ioremap(). [1] - https://lore.kernel.org/lkml/20230803175202.3173957-1-sunilvl@ventanamicro.com/ [2] - https://drive.google.com/file/d/1sKbOa8m1UZw1JkquZYe3F1zQBN1xXsaf/view?usp=sharing * b4-shazam-merge: RISC-V: cacheflush: Initialize CBO variables on ACPI systems RISC-V: ACPI: RHCT: Add function to get CBO block sizes RISC-V: ACPI: Update the return value of acpi_get_rhct() RISC-V: ACPI: Enhance acpi_os_ioremap with MMIO remapping Link: https://lore.kernel.org/r/20231018124007.1306159-1-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 87615e95f6f9ccd36d4a3905a2d87f91967ea9d2 Author: Nam Cao Date: Mon Aug 21 16:57:09 2023 +0200 riscv: put interrupt entries into .irqentry.text The interrupt entries are expected to be in the .irqentry.text section. For example, for kprobes to work properly, exception code cannot be probed; this is ensured by blacklisting addresses in the .irqentry.text section. Fixes: 7db91e57a0ac ("RISC-V: Task implementation") Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/20230821145708.21270-1-namcaov@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 559fe94a449cba5b50a7cffea60474b385598c00 Author: Song Shuai Date: Wed Aug 9 11:10:23 2023 +0800 riscv: mm: Update the comment of CONFIG_PAGE_OFFSET Since the commit 011f09d12052 set sv57 as default for CONFIG_64BIT, the comment of CONFIG_PAGE_OFFSET should be updated too. Fixes: 011f09d12052 ("riscv: mm: Set sv57 on defaultly") Signed-off-by: Song Shuai Link: https://lore.kernel.org/r/20230809031023.3575407-1-songshuaishuai@tinylab.org Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit dd16ac404a685cce07e67261a94c6225d90ea7ba Author: Minda Chen Date: Wed Aug 2 14:42:15 2023 +0800 riscv: Using TOOLCHAIN_HAS_ZIHINTPAUSE marco replace zihintpause Actually it is a part of Conor's commit aae538cd03bc ("riscv: fix detection of toolchain Zihintpause support"). It is looks like a merge issue. Samuel's commit 0b1d60d6dd9e ("riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y") do not base on Conor's commit and revert to __riscv_zihintpause. So this patch can fix it. Signed-off-by: Minda Chen Fixes: 3c349eacc559 ("Merge patch "riscv: Fix build with CONFIG_CC_OPTIMIZE_FOR_SIZE=y"") Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230802064215.31111-1-minda.chen@starfivetech.com Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 92235d3d8365d24f6cc6701b545e764ef144806a Author: Xiao Wang Date: Thu Sep 21 22:16:52 2023 +0800 riscv/mm: Fix the comment for swap pte format Swap type takes bits 7-11 and swap offset should start from bit 12. Signed-off-by: Xiao Wang Reviewed-by: David Hildenbrand Link: https://lore.kernel.org/r/20230921141652.2657054-1-xiao.w.wang@intel.com Signed-off-by: Palmer Dabbelt commit 8f501be87e45112eff74d0569dcfaab6bce39ef5 Author: Tsukasa OI Date: Wed Jul 26 05:44:16 2023 +0000 RISC-V: clarify the QEMU workaround in ISA parser Extensions prefixed with "Su" won't corrupt the workaround in many cases. The only exception is when the first multi-letter extension in the ISA string begins with "Su" and is not prefixed with an underscore. For instance, following ISA string can confuse this QEMU workaround. * "rv64imacsuclic" (RV64I + M + A + C + "Suclic") However, this case is very unlikely because extensions prefixed by either "Z", "Sm" or "Ss" will most likely precede first. For instance, the "Suclic" extension (draft as of now) will be placed after related "Smclic" and "Ssclic" extensions. It's also highly likely that other unprivileged extensions like "Zba" will precede. It's also possible to suppress the issue in the QEMU workaround with an underscore. Following ISA string won't confuse the QEMU workaround. * "rv64imac_suclic" (RV64I + M + A + C + delimited "Suclic") This fix is to tell kernel developers the nature of this workaround precisely. There are some "Su*" extensions to be ratified but don't worry about this workaround too much. This commit comes with other minor editorial fixes (for minor wording and spacing issues, without changing the meaning). Signed-off-by: Tsukasa OI Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/8a127608cf6194a6d288289f2520bd1744b81437.1690350252.git.research_trasio@irq.a4lg.com Signed-off-by: Palmer Dabbelt commit e59e5e2754bf983fc58ad18f99b5eec01f1a0745 Author: Song Shuai Date: Tue Aug 29 21:39:20 2023 -0700 riscv: correct pt_level name via pgtable_l5/4_enabled The pt_level uses CONFIG_PGTABLE_LEVELS to display page table names. But if page mode is downgraded from kernel cmdline or restricted by the hardware in 64BIT, it will give a wrong name. Like, using no4lvl for sv39, ptdump named the 1G-mapping as "PUD" that should be "PGD": 0xffffffd840000000-0xffffffd900000000 0x00000000c0000000 3G PUD D A G . . W R V So select "P4D/PUD" or "PGD" via pgtable_l5/4_enabled to correct it. Fixes: e8a62cc26ddf ("riscv: Implement sv48 support") Reviewed-by: Alexandre Ghiti Signed-off-by: Song Shuai Link: https://lore.kernel.org/r/20230712115740.943324-1-suagrfillet@gmail.com Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230830044129.11481-3-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt commit 10128f8b1663a8bce27df051c750d116bb8cd737 Author: Palmer Dabbelt Date: Tue Aug 29 21:39:19 2023 -0700 RISC-V: Provide pgtable_l5_enabled on rv32 A few of the other page table level helpers are defined on rv32, but not pgtable_l5_enabled. This adds the definition as a constant and converts pgtable_l4_enabled to a constant as well. Link: https://lore.kernel.org/r/20230830044129.11481-2-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt commit 60c46877e9cd4f7fd13fa844258f60cca4eb3e34 Author: Anup Patel Date: Mon Jul 10 18:49:02 2023 +0530 clocksource: timer-riscv: Increase rating of clock_event_device for Sstc When Sstc is available the RISC-V timer clock_event_device should be the preferred clock_event_device hence we increase clock_event_device rating for Sstc. Signed-off-by: Anup Patel Reviewed-by: Conor Dooley Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230710131902.1459180-3-apatel@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 5d98446f03c622cb917e15a5561601587c64aab2 Author: Anup Patel Date: Mon Jul 10 18:49:01 2023 +0530 clocksource: timer-riscv: Don't enable/disable timer interrupt Currently, we enable/disable timer interrupt at runtime to start/stop timer events. This makes timer interrupt state go out-of-sync with the Linux interrupt subsystem. To address the above issue, we can stop a per-HART timer interrupt by setting U64_MAX in timecmp CSR (or sbi_set_timer()) at the time of handling timer interrupt. Signed-off-by: Anup Patel Reviewed-by: Conor Dooley Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/20230710131902.1459180-2-apatel@ventanamicro.com Signed-off-by: Palmer Dabbelt commit a9429d5f99bc25885ba5d4c2c58a25467f5d741b Merge: 71e11d066c1db a29e2a48afe35 Author: Palmer Dabbelt Date: Thu Sep 21 04:22:30 2023 -0700 Merge patch series "RISC-V: Enable cbo.zero in usermode" Andrew Jones says: In order for usermode to issue cbo.zero, it needs privilege granted to issue the extension instruction (patch 2) and to know that the extension is available and its block size (patch 3). Patch 1 could be separate from this series (it just fixes up some error messages), patches 4-5 convert the hwprobe selftest to a statically-linked, TAP test and patch 6 adds a new hwprobe test for the new information as well as testing CBO instructions can or cannot be issued as appropriate. * b4-shazam-merge: RISC-V: selftests: Add CBO tests RISC-V: selftests: Convert hwprobe test to kselftest API RISC-V: selftests: Statically link hwprobe test RISC-V: hwprobe: Expose Zicboz extension and its block size RISC-V: Enable cbo.zero in usermode RISC-V: Make zicbom/zicboz errors consistent Link: https://lore.kernel.org/r/20230918131518.56803-8-ajones@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 71e11d066c1db20f85240d248cd8c3c6ae8bd7d7 Merge: 0bb80ecc33a8f 0f5f46a869a5e Author: Palmer Dabbelt Date: Tue Oct 31 19:15:41 2023 -0700 Merge patch series "riscv: kexec: cleanup and fixups" Song Shuai says: This series contains a cleanup for riscv_kexec_relocate() and two fixups for KEXEC_FILE and had passed the basic kexec test in my 64bit Qemu-virt. You can use this kexec-tools[3] to test the kexec-file-syscall and these patches. riscv: kexec: Cleanup riscv_kexec_relocate (patch1) ================================================== For readability and simplicity, cleanup the riscv_kexec_relocate code: - Re-sort the first 4 `mv` instructions against `riscv_kexec_method()` - Eliminate registers for debugging (s9,s10,s11) and storing const-value (s5,s6) - Replace `jalr` with `jr` for no-link jump riscv: kexec: Align the kexeced kernel entry (patch2) ================================================== The current riscv boot protocol requires 2MB alignment for RV64 and 4MB alignment for RV32. In KEXEC_FILE path, the elf_find_pbase() function should align the kexeced kernel entry according to the requirement, otherwise the kexeced kernel would silently BUG at the setup_vm(). riscv: kexec: Remove -fPIE for PURGATORY_CFLAGS (patch3) ================================================== With CONFIG_RELOCATABLE enabled, KBUILD_CFLAGS had a -fPIE option and then the purgatory/string.o was built to reference _ctype symbol via R_RISCV_GOT_HI20 relocations which can't be handled by purgatory. As a consequence, the kernel failed kexec_load_file() with: [ 880.386562] kexec_image: The entry point of kernel at 0x80200000 [ 880.388650] kexec_image: Unknown rela relocation: 20 [ 880.389173] kexec_image: Error loading purgatory ret=-8 So remove the -fPIE option for PURGATORY_CFLAGS to generate R_RISCV_PCREL_HI20 relocations type making puragtory work as it was. arch/riscv/kernel/elf_kexec.c | 8 ++++- arch/riscv/kernel/kexec_relocate.S | 52 +++++++++++++----------------- arch/riscv/purgatory/Makefile | 4 +++ 3 files changed, 34 insertions(+), 30 deletions(-) * b4-shazam-merge: riscv: kexec: Remove -fPIE for PURGATORY_CFLAGS riscv: kexec: Align the kexeced kernel entry riscv: kexec: Cleanup riscv_kexec_relocate Link: https://lore.kernel.org/r/20230907103304.590739-1-songshuaishuai@tinylab.org Signed-off-by: Palmer Dabbelt commit ad1871ad8d9b3d252390ade8e2bcab7b773173ad Merge: d4b671d4c66cd bf224871c27a7 Author: Linus Torvalds Date: Tue Oct 31 15:38:12 2023 -1000 Merge tag 'pm-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: "These add new hardware support (new Qualcomm SoC versions in cpufreq, RK3568/RK3588 in devfreq), extend the OPP (operating performance points) framework, improve cpufreq governors, fix issues and clean up code (most of the changes are in cpufreq and devfreq). Specifics: - Add support for several Qualcomm SoC versions and other similar changes (Christian Marangi, Dmitry Baryshkov, Luca Weiss, Neil Armstrong, Richard Acayan, Robert Marko, Rohit Agarwal, Stephan Gerhold and Varadarajan Narayanan) - Clean up the tegra cpufreq driver (Sumit Gupta) - Use of_property_read_reg() to parse "reg" in pmac32 driver (Rob Herring) - Add support for TI's am62p5 Soc (Bryan Brattlof) - Make ARM_BRCMSTB_AVS_CPUFREQ depends on !ARM_SCMI_CPUFREQ (Florian Fainelli) - Update Kconfig to mention i.MX7 as well (Alexander Stein) - Revise global turbo disable check in intel_pstate (Srinivas Pandruvada) - Carry out initialization of sg_cpu in the schedutil cpufreq governor in one loop (Liao Chang) - Simplify the condition for storing 'down_threshold' in the conservative cpufreq governor (Liao Chang) - Use fine-grained mutex in the userspace cpufreq governor (Liao Chang) - Move is_managed indicator in the userspace cpufreq governor into a per-policy structure (Liao Chang) - Rebuild sched-domains when removing cpufreq driver (Pierre Gondois) - Fix buffer overflow detection in trans_stats() (Christian Marangi) - Switch to dev_pm_opp_find_freq_(ceil/floor)_indexed() APIs to support specific devices like UFS which handle multiple clocks through OPP (Operating Performance Point) framework (Manivannan Sadhasivam) - Add perf support to the Rockchip DFI (DDR Monitor Module) devfreq- event driver: * Generalize rockchip-dfi.c to support new RK3568/RK3588 using different DDR type (Sascha Hauer). * Convert DT binding document format to yaml (Sascha Hauer). * Add perf support for DFI (a unit suitable for measuring DDR utilization) to rockchip-dfi.c to extend DFI usage (Sascha Hauer) - Add locking to the OPP handling code in the Mediatek CCI devfreq driver, because the voltage of shared OPP might be changed by multiple drivers (Mark Tseng, Dan Carpenter) - Use device_get_match_data() in the Samsung Exynos PPMU devfreq-event driver (Rob Herring) - Extend support for the opp-level beyond required-opps (Ulf Hansson) - Add dev_pm_opp_find_level_floor() (Krishna chaitanya chundru) - dt-bindings: Allow opp-peak-kBpsfor kryo CPUs, support Qualcomm Krait SoCs and document named opp-microvolt property (Bjorn Andersson, Dmitry Baryshkov and Christian Marangi) - Fix -Wunsequenced warning _of_add_opp_table_v1() (Nathan Chancellor) - General cleanup of OPP code (Viresh Kumar) - Use __get_safe_page() rather than touching the list in hibernation snapshot code (Brian Geffon) - Fix symbol export for _SIMPLE_ variants of _PM_OPS() (Raag Jadav) - Clean up sync_read handling in snapshot_write_next() (Brian Geffon) - Fix kerneldoc comments for swsusp_check() and swsusp_close() to better match code (Christoph Hellwig) - Downgrade BIOS locked limits pr_warn() in the Intel RAPL power capping driver to pr_debug() (Ville Syrjälä) - Change the minimum python version for the intel_pstate_tracer utility from 2.7 to 3.6 (Doug Smythies)" * tag 'pm-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (82 commits) dt-bindings: cpufreq: qcom-hw: document SM8650 CPUFREQ Hardware cpufreq: arm: Kconfig: Add i.MX7 to supported SoC for ARM_IMX_CPUFREQ_DT cpufreq: qcom-nvmem: add support for IPQ8064 cpufreq: qcom-nvmem: also accept operating-points-v2-krait-cpu cpufreq: qcom-nvmem: drop pvs_ver for format a fuses dt-bindings: cpufreq: qcom-cpufreq-nvmem: Document krait-cpu cpufreq: qcom-nvmem: add support for IPQ6018 dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ6018 cpufreq: qcom-nvmem: Add MSM8909 cpufreq: qcom-nvmem: Simplify driver data allocation powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug() cpufreq: stats: Fix buffer overflow detection in trans_stats() dt-bindings: devfreq: event: rockchip,dfi: Add rk3588 support dt-bindings: devfreq: event: rockchip,dfi: Add rk3568 support dt-bindings: devfreq: event: convert Rockchip DFI binding to yaml PM / devfreq: rockchip-dfi: add support for RK3588 PM / devfreq: rockchip-dfi: account for multiple DDRMON_CTRL registers PM / devfreq: rockchip-dfi: make register stride SoC specific PM / devfreq: rockchip-dfi: Add perf support PM / devfreq: rockchip-dfi: give variable a better name ... commit d4b671d4c66cd57ccebeae659d9b18e28a4fc9e8 Merge: 4ac4677fdb76f f4cb34a75e4a4 Author: Linus Torvalds Date: Tue Oct 31 15:33:26 2023 -1000 Merge tag 'acpi-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "These fix issues, add new quirks, rearrange the IRQ override quirk definitions, add new helpers and switch over code to using them, rework a couple of interfaces to be more flexible, eliminate strncpy() usage from PNP, extend the ACPI PCC mailbox driver and clean up code. This is based on ACPI thermal driver changes that are present in the thermal control updates for 6.7-rc1 pull request (they are depended on by the ACPI utilities updates). However, the ACPI thermal driver changes are not included in the list of specific ACPI changes below. Specifics: - Add symbol definitions related to CDAT to the ACPICA code (Dave Jiang) - Use the acpi_device_is_present() helper in more places and rename acpi_scan_device_not_present() to be about enumeration (James Morse) - Add __printf format attribute to acpi_os_vprintf() (Su Hui) - Clean up departures from kernel coding style in the low-level interface for ACPICA (Jonathan Bergh) - Replace strncpy() with strscpy() in acpi_osi_setup() (Justin Stitt) - Fail FPDT parsing on zero length records and add proper handling for fpdt_process_subtable() to acpi_init_fpdt() (Vasily Khoruzhick) - Rework acpi_handle_list handling so as to manage it dynamically, including size computation (Rafael Wysocki) - Clean up ACPI utilities code so as to make it follow the kernel coding style (Jonathan Bergh) - Consolidate IRQ trigger-type override DMI tables and drop .ident values from dmi_system_id tables used for ACPI resources management quirks (Hans de Goede) - Add ACPI IRQ override for TongFang GMxXGxx (Werner Sembach) - Allow _DSD buffer data only for byte accessors and document the _DSD data buffer GUID (Andy Shevchenko) - Drop BayTrail and Lynxpoint pinctrl device IDs from the ACPI LPSS driver, because it does not need them (Raag Jadav) - Add acpi_backlight=vendor quirk for Toshiba Portégé R100 (Ondrej Zary) - Add "vendor" backlight quirks for 3 Lenovo x86 Android tablets (Hans de Goede) - Move Xiaomi Mi Pad 2 backlight quirk to its own section (Hans de Goede) - Annotate struct prm_module_info with __counted_by (Kees Cook) - Fix AER info corruption in aer_recover_queue() when error status data has multiple sections (Shiju Jose) - Make APEI use ERST maximum execution time for slow devices (Jeshua Smith) - Add support for platform notification handling to the PCC mailbox driver and modify it to support shared interrupts for multiple subspaces (Huisong Li) - Define common macros to use when referring to various bitfields in the PCC generic communications channel command and status fields and use them in some drivers (Sudeep Holla) - Add EC GPE detection quirk for HP 250 G7 Notebook PC (Jonathan Denose) - Fix and clean up create_pnp_modalias() and create_of_modalias() (Christophe JAILLET) - Modify 2 pieces of code to use acpi_evaluate_dsm_typed() (Andy Shevchenko) - Define acpi_dev_uid_match() for matching _UID and use it in several places (Raag Jadav) - Use acpi_device_uid() for fetching _UID in 2 places (Raag Jadav) - Add context argument to acpi_dev_install_notify_handler() (Rafael Wysocki) - Clarify ACPI bus concepts in the ACPI device enumeration documentation (Rafael Wysocki) - Switch over the ACPI AC and ACPI PAD drivers to using the platform driver interface which, is more logically consistent than binding a driver directly to an ACPI device object, and clean them up (Michal Wilczynski) - Replace strncpy() in the PNP code with either memcpy() or strscpy() as appropriate (Justin Stitt) - Clean up coding style in pnp.h (GuoHua Cheng)" * tag 'acpi-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (54 commits) ACPI: resource: Do IRQ override on TongFang GMxXGxx perf: arm_cspmu: use acpi_dev_hid_uid_match() for matching _HID and _UID ACPI: EC: Add quirk for HP 250 G7 Notebook PC ACPI: x86: use acpi_dev_uid_match() for matching _UID ACPI: utils: use acpi_dev_uid_match() for matching _UID pinctrl: intel: use acpi_dev_uid_match() for matching _UID ACPI: utils: Introduce acpi_dev_uid_match() for matching _UID ACPI: sysfs: Clean up create_pnp_modalias() and create_of_modalias() ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() ACPI: acpi_pad: Rename ACPI device from device to adev ACPI: acpi_pad: Use dev groups for sysfs ACPI: acpi_pad: Replace acpi_driver with platform_driver ACPI: APEI: Use ERST timeout for slow devices ACPI: scan: Rename acpi_scan_device_not_present() to be about enumeration PNP: replace deprecated strncpy() with memcpy() PNP: ACPI: replace deprecated strncpy() with strscpy() perf: qcom: use acpi_device_uid() for fetching _UID ACPI: sysfs: use acpi_device_uid() for fetching _UID ACPI: scan: Use the acpi_device_is_present() helper in more places ACPI: AC: Rename ACPI device from device to adev ... commit 4ac4677fdb76f644e09a6331bab65919b85f617d Merge: 89ed67ef126c4 607218deac6e2 Author: Linus Torvalds Date: Tue Oct 31 15:28:37 2023 -1000 Merge tag 'thermal-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull thermal control updates from Rafael Wysocki: "These further rework the ACPI thermal driver, after the changes made to it in the previous cycle, to make it easier to grasp, get rid of redundant pieces of internal data structures and eliminate its reliance on a specific ordering of trip point objects in the thermal core, make thermal core adjustments needed for the ACPI thermal driver rework, modify the thermal governor interface so as to use trip pointers for representing trip points in it, switch over multiple thermal drivers to using void platform driver remove callbacks, add support for 2 hardware features to the Intel int340x thermal driver, add support for new hardware on ARM platforms, update documentation, fix problems, clean up code and update the MAINTAINERS record for thermal control. Specifics: - Untangle the initialization and updates of passive and active trip points in the ACPI thermal driver (Rafael Wysocki) - Reduce code duplication related to the initialization and updates of trip points in the ACPI thermal driver (Rafael Wysocki) - Use trip pointers for cooling device binding in the ACPI thermal driver (Rafael Wysocki) - Simplify critical and hot trips representation in the ACPI thermal driver (Rafael Wysocki) - Use trip pointers in thermal governors and in the related part of the thermal core (Rafael Wysocki) - Drop the trips_disabled bitmask that has become redundant from the thermal core (Rafael Wysocki) - Avoid updating trip points when the thermal zone temperature falls into a trip point's hysteresis range (ícolas F. R. A. Prado) - Add power floor notifications support to the int340x thermal control driver (Srinivas Pandruvada) - Rework updating trip points in the int340x thermal driver so that it does not access thermal zone internals directly (Rafael Wysocki) - Use param_get_byte() instead of param_get_int() as the max_idle module parameter .get() callback in the Intel powerclamp thermal driver to avoid possible out-of-bounds access (David Arcari) - Add workload hints support to the int340x thermal driver (Srinivas Pandruvada) - Add support for Mediatek LVTS MT8192 along with suspend/resume routines (Balsam Chihi) - Fix probe for THERMAL_V2 in the Mediatek LVTS driver (Markus Schneider-Pargmann) - Remove duplicate error message from the max76620 driver when thermal_of_zone_register() fails (Thierry Reding) - Add i.MX7D compatible bindings to fix a warning from dtbs_check for the imx6ul platform (Alexander Stein) - Add sa8775p compatible to the QCom tsens driver (Priyansh Jain) - Fix error check in lvts_debugfs_init() to be against PTR_ERR() in the LVTS Mediatek driver (Minjie Du) - Remove unused variable in thermal/tools (Kuan-Wei Chiu) - Document the imx8dl thermal sensor (Fabio Estevam) - Add variable names in callback prototypes to prevent warning from checkpatch.pl in the imx8mm driver (Bragatheswaran Manickavel) - Add missing unevaluatedProperties on child node schemas for tegra124 (Rob Herring) - Add mt7988 support to the Mediatek LVTS driver (Frank Wunderlich)" * tag 'thermal-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (111 commits) thermal: ACPI: Include the right header file thermal: core: Don't update trip points inside the hysteresis range thermal: core: Pass trip pointer to governor throttle callback thermal: gov_step_wise: Fold update_passive_instance() into its caller thermal: gov_power_allocator: Use trip pointers instead of trip indices thermal: gov_fair_share: Rearrange get_trip_level() thermal: trip: Define for_each_trip() macro thermal: trip: Simplify computing trip indices thermal/qcom/tsens: Drop ops_v0_1 thermal/drivers/mediatek/lvts_thermal: Update calibration data documentation thermal/drivers/mediatek/lvts_thermal: Add mt8192 support thermal/drivers/mediatek/lvts_thermal: Add suspend and resume dt-bindings: thermal: mediatek: Add LVTS thermal controller definition for mt8192 thermal/drivers/mediatek: Fix probe for THERMAL_V2 thermal/drivers/max77620: Remove duplicate error message dt-bindings: timer: add imx7d compatible dt-bindings: net: microchip: Allow nvmem-cell usage dt-bindings: imx-thermal: Add #thermal-sensor-cells property dt-bindings: thermal: tsens: Add sa8775p compatible thermal/drivers/mediatek/lvts_thermal: Fix error check in lvts_debugfs_init() ... commit 91562895f8030cb9a0470b1db49de79346a69f91 Author: Jan Kara Date: Fri Oct 13 14:13:50 2023 +0200 ext4: properly sync file size update after O_SYNC direct IO Gao Xiang has reported that on ext4 O_SYNC direct IO does not properly sync file size update and thus if we crash at unfortunate moment, the file can have smaller size although O_SYNC IO has reported successful completion. The problem happens because update of on-disk inode size is handled in ext4_dio_write_iter() *after* iomap_dio_rw() (and thus dio_complete() in particular) has returned and generic_file_sync() gets called by dio_complete(). Fix the problem by handling on-disk inode size update directly in our ->end_io completion handler. References: https://lore.kernel.org/all/02d18236-26ef-09b0-90ad-030c4fe3ee20@linux.alibaba.com Reported-by: Gao Xiang CC: stable@vger.kernel.org Fixes: 378f32bab371 ("ext4: introduce direct I/O write using iomap infrastructure") Signed-off-by: Jan Kara Tested-by: Joseph Qi Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/20231013121350.26872-1-jack@suse.cz Signed-off-by: Theodore Ts'o commit ce56d21355cd6f6937aca32f1f44ca749d1e4808 Author: Brian Foster Date: Mon Oct 2 14:50:20 2023 -0400 ext4: fix racy may inline data check in dio write syzbot reports that the following warning from ext4_iomap_begin() triggers as of the commit referenced below: if (WARN_ON_ONCE(ext4_has_inline_data(inode))) return -ERANGE; This occurs during a dio write, which is never expected to encounter an inode with inline data. To enforce this behavior, ext4_dio_write_iter() checks the current inline state of the inode and clears the MAY_INLINE_DATA state flag to either fall back to buffered writes, or enforce that any other writers in progress on the inode are not allowed to create inline data. The problem is that the check for existing inline data and the state flag can span a lock cycle. For example, if the ilock is originally locked shared and subsequently upgraded to exclusive, another writer may have reacquired the lock and created inline data before the dio write task acquires the lock and proceeds. The commit referenced below loosens the lock requirements to allow some forms of unaligned dio writes to occur under shared lock, but AFAICT the inline data check was technically already racy for any dio write that would have involved a lock cycle. Regardless, lift clearing of the state bit to the same lock critical section that checks for preexisting inline data on the inode to close the race. Cc: stable@kernel.org Reported-by: syzbot+307da6ca5cb0d01d581a@syzkaller.appspotmail.com Fixes: 310ee0902b8d ("ext4: allow concurrent unaligned dio overwrites") Signed-off-by: Brian Foster Link: https://lore.kernel.org/r/20231002185020.531537-1-bfoster@redhat.com Signed-off-by: Theodore Ts'o commit 1372e73a18139d4f74731cc900085a6bf3c59daf Merge: e12f065db4729 d45f72b3c2751 Author: Jiri Kosina Date: Wed Nov 1 00:18:10 2023 +0100 Merge branch 'for-6.7/uclogic' into for-linus - fixes for crashes detected by CONFIG_KUNIT_ALL_TESTS in hid-uclogic driver (Jinjie Ruan) commit e12f065db4729f46bbc73afba91a1f4322fb5df3 Merge: eacaa65efaa70 91939636cac45 Author: Jiri Kosina Date: Wed Nov 1 00:17:20 2023 +0100 Merge branch 'for-6.7/selftests' into for-linus - HID selftests fixes and improvements (Benjamin Tissoires) commit eacaa65efaa70b292c174629a672916c60981059 Merge: 93cfa25b1795e 81701f7132f8c Author: Jiri Kosina Date: Wed Nov 1 00:16:20 2023 +0100 Merge branch 'for-6.7/nvidia-shield' into for-linus - probe error handling path fixes in hid-nvidia-shield driver (Christophe JAILLET) commit 93cfa25b1795ec5f47fdba2241acc2d4957be597 Merge: 54021f902b374 928276075f169 Author: Jiri Kosina Date: Wed Nov 1 00:14:25 2023 +0100 Merge branch 'for-6.7/nintendo' into for-linus - cleanup of LED handling in hid-nintendo (Martino Fontana) commit 54021f902b374793ebcf90de2720a57b3bcaf9e3 Merge: 7601fef449c79 3e6b0bb22a803 Author: Jiri Kosina Date: Wed Nov 1 00:12:42 2023 +0100 Merge branch 'for-6.7/logitech' into for-linus - big cleanup of logitech-hidpp probe code (Hans de Goede) commit 7601fef449c7994c18cda47cbf470cb189e00fbd Merge: f5883ef15644b 2f2bd7cbd1d15 Author: Jiri Kosina Date: Wed Nov 1 00:10:54 2023 +0100 Merge branch 'for-6.7/lenovo' into for-linus - Suspend/Resume fix for USB Thinkpad Compact Keyboard (Jamie Lentin) - firmware detection improvement for Lenovo cptkbd (Mikhail Khvainitski) commit f5883ef15644bdaf5f0850b9c0469e00d40bfb4f Merge: 20cd569d7ee8f dc3115e6c5d98 Author: Jiri Kosina Date: Wed Nov 1 00:09:51 2023 +0100 Merge branch 'for-6.7/cp2112' into for-linus - IRQ shutdown and workqueue initialization fixes for hid-cp2112 driver (Danny Kaehn) commit 20cd569d7ee8fce24e8753f0f43af6c420557b1f Merge: 62cc9c3cb3ec1 eeebfe6259ba2 Author: Jiri Kosina Date: Wed Nov 1 00:07:35 2023 +0100 Merge branch 'for-6.7/config_pm' into for-linus - #ifdef CONFIG_PM removal from HID code (Thomas Weißschuh) commit 2bfb0ca3dd0c40b929ecedf1fc941c139945d055 Author: Yang Wang Date: Tue Oct 31 10:12:00 2023 +0800 drm/amdgpu: remove unused macro HW_REV remove unused macro HW_REV Signed-off-by: Yang Wang Reviewed-by: Kenneth Feng Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 7f3e6b840fa8b0889d776639310a5dc672c1e9e1 Author: Ma Jun Date: Tue Oct 31 11:11:04 2023 +0800 drm/amd/pm: Fix error of MACO flag setting code MACO only works if BACO is supported Signed-off-by: Ma Jun Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org # 6.1.x commit 9ae587f850a6702428273fcf4a2a9b392349b2a3 Author: Arunpravin Paneer Selvam Date: Mon Oct 30 09:25:37 2023 -0700 drm/amdgpu: Fix the vram base start address If the size returned by drm buddy allocator is higher than the required size, we take the higher size to calculate the buffer start address. This is required if we couldn't trim the buffer to the requested size. This will fix the display corruption issue on APU's which has limited VRAM size. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2859 Fixes: 0a1844bf0b53 ("drm/buddy: Improve contiguous memory allocation") Signed-off-by: Arunpravin Paneer Selvam Acked-by: Christian König Signed-off-by: Alex Deucher commit 5d09c63f11f083707b60c8ea0bb420651c47740f Author: Dan Williams Date: Tue Oct 31 14:09:19 2023 -0700 cxl/hdm: Remove broken error path Dan reports that cxl_decoder_commit() potentially leaks a hold of cxl_dpa_rwsem. The potential error case is a "should not" happen scenario, turn it into a "can not" happen scenario by adding the error check to cxl_port_setup_targets() where other setting validation occurs. Reported-by: Dan Carpenter Closes: http://lore.kernel.org/r/63295673-5d63-4919-b851-3b06d48734c0@moroto.mountain Reviewed-by: Dave Jiang Reviewed-by: Ira Weiny Fixes: 176baefb2eb5 ("cxl/hdm: Commit decoder state to hardware") Signed-off-by: Dan Williams commit d539b0ad7c7cea6f7ebd8a1f12d2877c15563e73 Author: Tao Zhou Date: Fri Oct 27 12:02:05 2023 +0800 drm/amdgpu: set XGMI IP version manually for v6_4 The version can't be queried from discovery table. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 69d56b15a7941680aba8c3175b165221ecdf54b6 Author: Dan Carpenter Date: Tue Oct 31 12:53:52 2023 +0300 cxl/hdm: Fix && vs || bug If "info" is NULL then this code will crash. || was intended instead of &&. Fixes: 8ce520fdea24 ("cxl/hdm: Use stored Component Register mappings to map HDM decoder capability") Signed-off-by: Dan Carpenter Reviewed-by: Robert Richter Link: https://lore.kernel.org/r/60028378-d3d5-4d6d-90fd-f915f061e731@moroto.mountain Signed-off-by: Dan Williams commit 853eebe6ec4f6a277b8c8fb34da268aca6cf720b Author: Tong Liu01 Date: Fri Oct 27 11:26:46 2023 +0800 drm/amdgpu: add unmap latency when gfx11 set kiq resources [why] If driver does not set unmap latency for KIQ, the default value of KIQ unmap latency is zero. When do unmap queue, KIQ will return that almost immediately after receiving unmap command. So, the queue status will be saved to MQD incorrectly or lost in some chance. [how] Set unmap latency when do kiq set resources. The unmap latency is set to be 1 second that is synchronized with Windows driver. Acked-by: Alex Deucher Signed-off-by: Tong Liu01 Signed-off-by: Alex Deucher commit 5f38ac54e60562323ea4abb1bfb37d043ee23357 Author: Kenneth Feng Date: Wed Oct 25 11:20:38 2023 +0800 drm/amd/pm: fix the high voltage and temperature issue fix the high voltage and temperature issue after the driver is unloaded on smu 13.0.0, smu 13.0.7 and smu 13.0.10 v2 - fix the code format and make sure it is used on the unload case only. Signed-off-by: Kenneth Feng Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit a17f574ab4a2d3dcbd9a49e3c1710fb0cbe8a901 Author: Yifan Zhang Date: Thu Oct 26 21:23:06 2023 +0800 drm/amdgpu: remove amdgpu_mes_self_test in gpu recover gpu tlb flush is skipped if reset sem is held, it makes mes_self_test fail since it involves add_hw_queue/remove_hw_queue which needs tlb flush functional. Remove mes_self_test in gpu recover sequence. This patch is to fix the recover failure in gfx11. [ 1831.768292] [drm] ring sdma_32769.3.3 was added [ 1831.768313] [drm] ring gfx_32769.1.1 ib test pass [ 1831.768337] [drm] ring compute_32769.2.2 ib test pass [ 1831.768399] amdgpu 0000:c2:00.0: amdgpu: [gfxhub] page fault (src_id:0 ring:24 vmid:8 pasid:32769, for process pid 0 thread pid 0) [ 1831.768434] amdgpu 0000:c2:00.0: amdgpu: in page starting at address 0x0000aec200000000 from client 10 [ 1831.768456] amdgpu 0000:c2:00.0: amdgpu: GCVM_L2_PROTECTION_FAULT_STATUS:0x00800A30 [ 1831.768473] amdgpu 0000:c2:00.0: amdgpu: Faulty UTCL2 client ID: CPC (0x5) [ 1831.768489] amdgpu 0000:c2:00.0: amdgpu: MORE_FAULTS: 0x0 [ 1831.768501] amdgpu 0000:c2:00.0: amdgpu: WALKER_ERROR: 0x0 [ 1831.768513] amdgpu 0000:c2:00.0: amdgpu: PERMISSION_FAULTS: 0x3 [ 1831.768521] amdgpu 0000:c2:00.0: amdgpu: MAPPING_ERROR: 0x0 [ 1831.768529] amdgpu 0000:c2:00.0: amdgpu: RW: 0x0 [ 1831.931229] amdgpu 0000:c2:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring sdma_32769.3.3 test failed (-110) [ 1832.062917] [drm:mes_v11_0_submit_pkt_and_poll_completion.constprop.0 [amdgpu]] *ERROR* MES failed to response msg=3 [ 1832.063107] [drm:amdgpu_mes_remove_hw_queue [amdgpu]] *ERROR* failed to remove hardware queue, queue id = 3 Fixes: e2e3788850b9 ("drm/amdgpu: rework lock handling for flush_tlb v2") Reported-by: Li Ma Reviewed-by: Christian König Signed-off-by: Yifan Zhang Signed-off-by: Alex Deucher commit e020d01575166eaf4133f207bbf71d61774c5e68 Author: Candice Li Date: Fri Oct 27 18:13:28 2023 +0800 drm/amdgpu: Drop deferred error in uncorrectable error check Drop checking deferred error which can be handled by poison consumption. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5575ce213241be6c495e1bd10f70cb59d2817db1 Author: Lijo Lazar Date: Fri Oct 27 11:02:26 2023 +0530 drm/amd/pm: Fix warnings Fixes warnings: drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c:286:45: warning: '%s' directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=] drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_6_ppt.c:286:52: warning: '%s' directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=] drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu14/smu_v14_0.c:72:45: warning: '%s' directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=] drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu14/smu_v14_0.c:72:52: warning: '%s' directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-truncation=] Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang Reported-by: kernel test robot Signed-off-by: Alex Deucher commit d1d4c0b7b65b7fab2bc6f97af9e823b1c42ccdb0 Author: Tao Zhou Date: Wed Oct 25 11:03:24 2023 +0800 drm/amdgpu: check RAS supported first in ras_reset_error_count Not all platforms support RAS. Fixes: 73582be11ac8 ("drm/amdgpu: bypass RAS error reset in some conditions") Signed-off-by: Tao Zhou Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 45b890f7689eb0aba454fc5831d2d79763781677 Merge: be47941980d56 123f42f0ad681 Author: Paolo Bonzini Date: Tue Oct 31 16:37:07 2023 -0400 Merge tag 'kvmarm-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 updates for 6.7 - Generalized infrastructure for 'writable' ID registers, effectively allowing userspace to opt-out of certain vCPU features for its guest - Optimization for vSGI injection, opportunistically compressing MPIDR to vCPU mapping into a table - Improvements to KVM's PMU emulation, allowing userspace to select the number of PMCs available to a VM - Guest support for memory operation instructions (FEAT_MOPS) - Cleanups to handling feature flags in KVM_ARM_VCPU_INIT, squashing bugs and getting rid of useless code - Changes to the way the SMCCC filter is constructed, avoiding wasted memory allocations when not in use - Load the stage-2 MMU context at vcpu_load() for VHE systems, reducing the overhead of errata mitigations - Miscellaneous kernel and selftest fixes commit f2fbb908112311423b09cd0d2b4978f174b99585 Author: Stephen Rothwell Date: Mon Oct 30 16:09:53 2023 +1100 net: tcp: remove call to obsolete crypto_ahash_alignmask() linux-next hit the following build error: net/ipv4/tcp_ao.c: In function 'tcp_ao_key_alloc': net/ipv4/tcp_ao.c:1536:13: error: implicit declaration of function 'crypto_ahash_alignmask'; did you mean 'crypto_ahash_alg_name'? [-Werror=implicit-function-declaration] 1536 | if (crypto_ahash_alignmask(tfm) > TCP_AO_KEY_ALIGN) { | ^~~~~~~~~~~~~~~~~~~~~~ | crypto_ahash_alg_name Caused by commit from the crypto tree 0f8660c82b79 ("crypto: ahash - remove crypto_ahash_alignmask") interacting with commit 4954f17ddefc ("net/tcp: Introduce TCP_AO setsockopt()s") from networking. crypto_ahash_alignmask() has been phased out by the former commit, drop the call in networking. Eric confirms that the check is safe to remove and was questionable here in the first place. Signed-off-by: Stephen Rothwell Acked-by: Herbert Xu Reviewed-by: Dmitry Safonov Signed-off-by: Jakub Kicinski commit 9793c269da6cd339757de6ba5b2c8681b54c99af Author: Mikulas Patocka Date: Tue Oct 31 19:12:54 2023 +0100 dm crypt: account large pages in cc->n_allocated_pages The commit 5054e778fcd9c ("dm crypt: allocate compound pages if possible") changed dm-crypt to use compound pages to improve performance. Unfortunately, there was an oversight: the allocation of compound pages was not accounted at all. Normal pages are accounted in a percpu counter cc->n_allocated_pages and dm-crypt is limited to allocate at most 2% of memory. Because compound pages were not accounted at all, dm-crypt could allocate memory over the 2% limit. Fix this by adding the accounting of compound pages, so that memory consumption of dm-crypt is properly limited. Signed-off-by: Mikulas Patocka Fixes: 5054e778fcd9c ("dm crypt: allocate compound pages if possible") Cc: stable@vger.kernel.org # v6.5+ Signed-off-by: Mike Snitzer commit b3cfdbf6a062bcfb431153f92d6bc1ad20bfc687 Merge: de5512b2a2938 05e37b2138a6d Author: Dan Williams Date: Tue Oct 31 11:00:08 2023 -0700 Merge branch 'for-6.7/cxl-commited' into cxl/next Add the committed decoder sysfs attribute for v6.7. commit de5512b2a293863261c6b04c0c73ec0ec09ed550 Merge: 624eda92abd47 fae6389f912eb Author: Dan Williams Date: Tue Oct 31 10:59:44 2023 -0700 Merge branch 'for-6.7/cxl' into cxl/next Pickup some misc. CXL updates for v6.7. commit 624eda92abd47f35386028e4a54d423037a75d12 Merge: 7f946e6d830fb a103f46633fdc Author: Dan Williams Date: Tue Oct 31 10:59:26 2023 -0700 Merge branch 'for-6.7/cxl-qtg' into cxl/next Merge some prep-work for CXL QOS class support. This cycle saw large collisions with mm on this topic, so the bulk of this topic needs to wait. commit 7f946e6d830fbdf411cd0641314edf11831efc88 Merge: 8f61d48c83f6e e8db0701605bc Author: Dan Williams Date: Tue Oct 31 10:59:00 2023 -0700 Merge branch 'for-6.7/cxl-rch-eh' into cxl/next Restricted CXL Host (RCH) Error Handling undoes the topology munging of CXL 1.1 to enabled some AER recovery, and lands some base infrastructure for handling Root-Complex-Event-Collectors (RCECs) with CXL. Include this long running series finally for v6.7. commit 4cf6e1101a25ca5e63d48adf49b0a8a64bae790f Author: Shyam Prasad N Date: Mon Oct 30 11:00:08 2023 +0000 cifs: add xid to query server interface call We were passing 0 as the xid for the call to query server interfaces. This is not great for debugging. This change adds a real xid. Signed-off-by: Shyam Prasad N Reviewed-by: Bharath SM Signed-off-by: Steve French commit 52768695d36a44d352e9fb79ba27468a5363ab8d Author: Shyam Prasad N Date: Mon Oct 30 11:00:07 2023 +0000 cifs: print server capabilities in DebugData In the output of /proc/fs/cifs/DebugData, we do not print the server->capabilities field today. With this change, we will do that. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 783fa2c94f4150fe1b7f7d88b3baf6d98f82b41b Author: Eric Biggers Date: Sat Oct 28 22:03:00 2023 -0700 smb: use crypto_shash_digest() in symlink_hash() Simplify symlink_hash() by using crypto_shash_digest() instead of an init+update+final sequence. This should also improve performance. Signed-off-by: Eric Biggers Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit d328c09ee9f15ee5a26431f5aad7c9239fa85e62 Author: Paulo Alcantara Date: Tue Oct 24 13:49:15 2023 -0300 smb: client: fix use-after-free bug in cifs_debug_data_proc_show() Skip SMB sessions that are being teared down (e.g. @ses->ses_status == SES_EXITING) in cifs_debug_data_proc_show() to avoid use-after-free in @ses. This fixes the following GPF when reading from /proc/fs/cifs/DebugData while mounting and umounting [ 816.251274] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6d81: 0000 [#1] PREEMPT SMP NOPTI ... [ 816.260138] Call Trace: [ 816.260329] [ 816.260499] ? die_addr+0x36/0x90 [ 816.260762] ? exc_general_protection+0x1b3/0x410 [ 816.261126] ? asm_exc_general_protection+0x26/0x30 [ 816.261502] ? cifs_debug_tcon+0xbd/0x240 [cifs] [ 816.261878] ? cifs_debug_tcon+0xab/0x240 [cifs] [ 816.262249] cifs_debug_data_proc_show+0x516/0xdb0 [cifs] [ 816.262689] ? seq_read_iter+0x379/0x470 [ 816.262995] seq_read_iter+0x118/0x470 [ 816.263291] proc_reg_read_iter+0x53/0x90 [ 816.263596] ? srso_alias_return_thunk+0x5/0x7f [ 816.263945] vfs_read+0x201/0x350 [ 816.264211] ksys_read+0x75/0x100 [ 816.264472] do_syscall_64+0x3f/0x90 [ 816.264750] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 816.265135] RIP: 0033:0x7fd5e669d381 Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit e6322fd177c6885a21dd4609dc5e5c973d1a2eb7 Author: Paulo Alcantara Date: Wed Oct 25 14:58:35 2023 -0300 smb: client: fix potential deadlock when releasing mids All release_mid() callers seem to hold a reference of @mid so there is no need to call kref_put(&mid->refcount, __release_mid) under @server->mid_lock spinlock. If they don't, then an use-after-free bug would have occurred anyways. By getting rid of such spinlock also fixes a potential deadlock as shown below CPU 0 CPU 1 ------------------------------------------------------------------ cifs_demultiplex_thread() cifs_debug_data_proc_show() release_mid() spin_lock(&server->mid_lock); spin_lock(&cifs_tcp_ses_lock) spin_lock(&server->mid_lock) __release_mid() smb2_find_smb_tcon() spin_lock(&cifs_tcp_ses_lock) *deadlock* Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit dc6e08b1a2ae262c23e14f5c259b4ca63a554e4f Author: Harshit Mogalapalli Date: Mon Oct 30 00:08:36 2023 -0700 ALSA: hda: cs35l41: Fix missing error code in cs35l41_smart_amp() When firmware status is invalid, assign -EINVAL to ret as ret is '0' at that point and returning success is incorrect when firmware status is invalid. Fixes: a51d8ba03a4f ("ALSA: hda: cs35l41: Check CSPL state after loading firmware") Signed-off-by: Harshit Mogalapalli Link: https://lore.kernel.org/r/20231030070836.3234385-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Takashi Iwai commit 72bc63f5e23a38b65ff2a201bdc11401d4223fa9 Author: Steve French Date: Thu Oct 19 23:01:49 2023 -0500 smb3: fix creating FIFOs when mounting with "sfu" mount option Fixes some xfstests including generic/564 and generic/157 The "sfu" mount option can be useful for creating special files (character and block devices in particular) but could not create FIFOs. It did recognize existing empty files with the "system" attribute flag as FIFOs but this is too general, so to support creating FIFOs more safely use a new tag (but the same length as those for char and block devices ie "IntxLNK" and "IntxBLK") "LnxFIFO" to indicate that the file should be treated as a FIFO (when mounted with the "sfu"). For some additional context note that "sfu" followed the way that "Services for Unix" on Windows handled these special files (at least for character and block devices and symlinks), which is different than newer Windows which can handle special files as reparse points (which isn't an option to many servers). Cc: stable@vger.kernel.org Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit 4b27d5c420335dad7aea1aa6e799fe1d05c63b7e Author: Dan Carpenter Date: Tue Oct 31 12:53:06 2023 +0300 ACPI: thermal: Fix acpi_thermal_unregister_thermal_zone() cleanup The acpi_thermal_unregister_thermal_zone() is paired with acpi_thermal_register_thermal_zone() so it should mirror it. It should clean up all the resources that the register function allocated and leave the stuff that was allocated elsewhere. Unfortunately, it doesn't call thermal_zone_device_disable(). Also it calls kfree(tz->trip_table) when it shouldn't. That was allocated in acpi_thermal_add(). Putting the kfree() here leads to a double free in the acpi_thermal_add() clean up function. Likewise, the acpi_thermal_remove() should mirror acpi_thermal_add() so it should have an explicit kfree(tz->trip_table) as well. Fixes: ec23c1c462de ("ACPI: thermal: Use trip point table to register thermal zones") Signed-off-by: Dan Carpenter Signed-off-by: Rafael J. Wysocki commit 55c11a159d3ca4ca7f9d5c1275d0768474b12195 Author: Kent Overstreet Date: Fri Oct 20 14:05:31 2023 -0400 bcachefs: bch2_inum_opts_get() New helper for new rebalance code Signed-off-by: Kent Overstreet commit 96a363a7e68832054f2a93249335fd3efd870aa3 Author: Kent Overstreet Date: Mon Oct 23 16:21:54 2023 -0400 bcachefs: move: move_stats refactoring data_progress_list is gone - it was redundant with moving_context_list The upcoming rebalance rewrite is going to have it using two different move_stats objects with the same moving_context, depending on whether it's scanning or using the rebalance_work btree - this patch plumbs stats around a bit differently so that will work. Signed-off-by: Kent Overstreet commit d5eade93452bd1a892e2155e9bb723f04992bdac Author: Kent Overstreet Date: Mon Oct 23 15:36:45 2023 -0400 bcachefs: move: convert to bbpos Signed-off-by: Kent Overstreet commit 633169035a7ccdfe3a9eba0202dc2135baa07c72 Author: Kent Overstreet Date: Fri Oct 20 13:32:42 2023 -0400 bcachefs: moving_context now owns a btree_trans btree_trans and moving_context are used together, and having the moving_context owns the transaction object reduces some plumbing. Signed-off-by: Kent Overstreet commit a0bfe3b065cabc669933063cb5a9066b104be406 Author: Kent Overstreet Date: Fri Oct 20 13:32:42 2023 -0400 bcachefs: move.c exports, refactoring Prep work for the new rebalance code - we need a few helpers exported. Signed-off-by: Kent Overstreet commit 6ddedca2180b095aacca0f628e0d03a32477f68f Author: Kent Overstreet Date: Sun Oct 22 18:29:54 2023 -0400 bcachefs: Guard against unknown compression options Since compression options now include compression level, proper validation is a bit more involved. This adds bch2_compression_opt_valid(), and plumbs it around appropriately. Signed-off-by: Kent Overstreet commit ef435abd6a99206d9bb93462a1b0508e0d876adb Author: Kent Overstreet Date: Sun Oct 22 15:06:27 2023 -0400 bcachefs: trivial extents.c refactoring Signed-off-by: Kent Overstreet commit 48f866e90f520855b6d941eebe46d75dbfbb9a81 Author: Kent Overstreet Date: Sun Oct 22 17:22:53 2023 -0400 bcachefs: Fix bch2_prt_bitflags() This fixes an infinite loop when there's a set bit at position >= 32. Signed-off-by: Kent Overstreet commit 9db2f86060a8e54e80f99e3c3366832ce6a67d76 Author: Kent Overstreet Date: Sun Oct 22 11:33:02 2023 -0400 bcachefs: Check for too-large encoded extents We don't yet repair (split) them, just check. Signed-off-by: Kent Overstreet commit 2d39081291470750cc605c917531d7cd85aebf94 Author: Kent Overstreet Date: Sun Oct 22 11:19:34 2023 -0400 bcachefs: Ensure we don't exceed encoded_extent_max The write path may (rarely) see an encoded (checksummed) extent that exceeds encoded_extent_max - this can happen when we're moving an existing extent that was not checksummed, but was given a checksum by bch2_write_rechecksum(). Signed-off-by: Kent Overstreet commit e677179b35b7ecbe3cefe33011b69d45171e5e9f Author: Kent Overstreet Date: Sun Oct 22 11:12:14 2023 -0400 bcachefs: bch2_disk_path_to_text() no longer takes sb_lock We're going to be using bch2_target_to_text() -> bch2_disk_path_to_text() from bch2_bkey_ptrs_to_text() and bch2_bkey_ptrs_invalid(), which can be called in any context. This patch adds the actual label to bch_disk_group_cpu so that it can be used by bch2_disk_path_to_text, and splits out bch2_disk_path_to_text() into two variants - like the previous patch, one for when we have a running filesystem and another for when we only have a superblock. Signed-off-by: Kent Overstreet commit 37707bb183b4746f27b0beaf0c3273fd7c79dc66 Author: Kent Overstreet Date: Sun Oct 22 10:58:38 2023 -0400 bcachefs: Split out disk_groups_types.h Signed-off-by: Kent Overstreet commit bf0d9e89de2e62fe9967ebb77b68d58d3812e4db Author: Kent Overstreet Date: Sun Oct 22 10:54:24 2023 -0400 bcachefs: Split apart bch2_target_to_text(), bch2_target_to_text_sb() Previously we just had bch2_opt_target_to_text() which could be passed either a filesystem object or just a superblock - depending on if we have a running filesystem or not. Split these into two functions for clarity. Signed-off-by: Kent Overstreet commit 523f33efbf406f2eb0f071123d17fbbd9e40d692 Author: Kent Overstreet Date: Thu Jun 22 20:18:12 2023 -0400 bcachefs: All triggers are BTREE_TRIGGER_WANTS_OLD_AND_NEW Upcoming rebalance_work btree will require extent triggers to be BTREE_TRIGGER_WANTS_OLD_AND_NEW - so to reduce potential confusion, let's just make all triggers BTREE_TRIGGER_WANTS_OLD_AND_NEW. Signed-off-by: Kent Overstreet commit 8480905765c3729025331720d23735ce085ef070 Author: Kent Overstreet Date: Sat Oct 21 15:03:05 2023 -0400 bcachefs: Improve io option handling in data move path The data move path now correctly picks IO options when inodes in different snapshots have different options applied. Signed-off-by: Kent Overstreet commit bbe682c76789d679cb75effd7792d41b09efea00 Author: Kent Overstreet Date: Sat Oct 21 13:54:39 2023 -0400 bcachefs: Ensure devices are always correctly initialized We can't mark device superblocks or allocate journal on a device that isn't online. That means we may need to do this on every mount, because we may have formatted a new filesystem and then done the first mount (bch2_fs_initialize()) in degraded mode. Signed-off-by: Kent Overstreet commit d0261559c434abbd7254c9c97c68f5e024daabf4 Author: Kent Overstreet Date: Sat Oct 21 13:19:54 2023 -0400 bcachefs: Delete duplicate time stats initialization This code duplicated initialization already done in bch2_fs_btree_iter_init(). Signed-off-by: Kent Overstreet commit e38356d65ed085a2c0ba056fa9048ad8845da1d0 Author: Kent Overstreet Date: Fri Oct 20 14:40:23 2023 -0400 bcachefs: Kill dead code extent_save() Signed-off-by: Kent Overstreet commit 253ba178c8d9065748fa56b39343e6a5a55b0023 Author: Kent Overstreet Date: Fri Oct 20 12:24:36 2023 -0400 bcachefs: Fix ca->oldest_gen allocation The ca->oldest_gen array needs to be the same size as the bucket_gens array; ca->mi.nbuckets is updated with only state_lock held, not gc_lock, so bch2_gc_gens() could race with device resize and allocate too small of an oldest_gens array. Signed-off-by: Kent Overstreet commit a1d97d8417d3c2f2477847541303621c32652976 Author: Kent Overstreet Date: Fri Oct 20 12:02:14 2023 -0400 bcachefs: Fix shrinker names Shrinkers are now exported to debugfs, so the names can't have slashes in them. Signed-off-by: Kent Overstreet commit 50a38ca1baace3dc66027ad41393917b05318b14 Author: Kent Overstreet Date: Fri Oct 20 00:01:53 2023 -0400 bcachefs: Fix btree_node_type enum More forwards compatibility fixups: having BKEY_TYPE_btree at the end of the enum conflicts with unnkown btree IDs, this shifts BKEY_TYPE_btree to slot 0 and fixes things up accordingly. Signed-off-by: Kent Overstreet commit 88dfe193bd2abd08926c1a0d48b770bb68ac8ccb Author: Kent Overstreet Date: Thu Oct 19 22:49:08 2023 -0400 bcachefs: bch2_btree_id_str() Since we can run with unknown btree IDs, we can't directly index btree IDs into fixed size arrays. Signed-off-by: Kent Overstreet commit b0b5bbf99fc269e10d01c2a9873de5a042bdc7f5 Author: Kent Overstreet Date: Thu Oct 19 21:25:04 2023 -0400 bcachefs: Don't run bch2_delete_dead_snapshots() unnecessarily Be a bit more careful about when bch2_delete_dead_snapshots needs to run: it only needs to run synchronously if we're running fsck, and it only needs to run at all if we have snapshot nodes to delete or if fsck has noticed that it needs to run. Also: Rename BCH_FS_HAVE_DELETED_SNAPSHOTS -> BCH_FS_NEED_DELETE_DEAD_SNAPSHOTS Kill bch2_delete_dead_snapshots_hook(), move functionality to bch2_mark_snapshot() Factor out bch2_check_snapshot_needs_deletion(), to explicitly check if we need to be running snapshot deletion. Signed-off-by: Kent Overstreet commit 0dd092bf1091a114f22136e5776aec21e6e4af2a Author: Kent Overstreet Date: Thu Oct 19 15:23:56 2023 -0400 bcachefs: Fix lock ordering with snapshot_create_lock We must not hold btree locks while taking snapshot_create_lock - this fixes a lockdep splat. Signed-off-by: Kent Overstreet commit 89ed67ef126c4160349c1b96fdb775ea6170ac90 Merge: 5a6a09e97199d f1c73396133cb Author: Linus Torvalds Date: Tue Oct 31 05:10:11 2023 -1000 Merge tag 'net-next-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next Pull networking updates from Jakub Kicinski: "Core & protocols: - Support usec resolution of TCP timestamps, enabled selectively by a route attribute. - Defer regular TCP ACK while processing socket backlog, try to send a cumulative ACK at the end. Increase single TCP flow performance on a 200Gbit NIC by 20% (100Gbit -> 120Gbit). - The Fair Queuing (FQ) packet scheduler: - add built-in 3 band prio / WRR scheduling - support bypass if the qdisc is mostly idle (5% speed up for TCP RR) - improve inactive flow reporting - optimize the layout of structures for better cache locality - Support TCP Authentication Option (RFC 5925, TCP-AO), a more modern replacement for the old MD5 option. - Add more retransmission timeout (RTO) related statistics to TCP_INFO. - Support sending fragmented skbs over vsock sockets. - Make sure we send SIGPIPE for vsock sockets if socket was shutdown(). - Add sysctl for ignoring lower limit on lifetime in Router Advertisement PIO, based on an in-progress IETF draft. - Add sysctl to control activation of TCP ping-pong mode. - Add sysctl to make connection timeout in MPTCP configurable. - Support rcvlowat and notsent_lowat on MPTCP sockets, to help apps limit the number of wakeups. - Support netlink GET for MDB (multicast forwarding), allowing user space to request a single MDB entry instead of dumping the entire table. - Support selective FDB flushing in the VXLAN tunnel driver. - Allow limiting learned FDB entries in bridges, prevent OOM attacks. - Allow controlling via configfs netconsole targets which were created via the kernel cmdline at boot, rather than via configfs at runtime. - Support multiple PTP timestamp event queue readers with different filters. - MCTP over I3C. BPF: - Add new veth-like netdevice where BPF program defines the logic of the xmit routine. It can operate in L3 and L2 mode. - Support exceptions - allow asserting conditions which should never be true but are hard for the verifier to infer. With some extra flexibility around handling of the exit / failure: https://lwn.net/Articles/938435/ - Add support for local per-cpu kptr, allow allocating and storing per-cpu objects in maps. Access to those objects operates on the value for the current CPU. This allows to deprecate local one-off implementations of per-CPU storage like BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE maps. - Extend cgroup BPF sockaddr hooks for UNIX sockets. The use case is for systemd to re-implement the LogNamespace feature which allows running multiple instances of systemd-journald to process the logs of different services. - Enable open-coded task_vma iteration, after maple tree conversion made it hard to directly walk VMAs in tracing programs. - Add open-coded task, css_task and css iterator support. One of the use cases is customizable OOM victim selection via BPF. - Allow source address selection with bpf_*_fib_lookup(). - Add ability to pin BPF timer to the current CPU. - Prevent creation of infinite loops by combining tail calls and fentry/fexit programs. - Add missed stats for kprobes to retrieve the number of missed kprobe executions and subsequent executions of BPF programs. - Inherit system settings for CPU security mitigations. - Add BPF v4 CPU instruction support for arm32 and s390x. Changes to common code: - overflow: add DEFINE_FLEX() for on-stack definition of structs with flexible array members. - Process doc update with more guidance for reviewers. Driver API: - Simplify locking in WiFi (cfg80211 and mac80211 layers), use wiphy mutex in most places and remove a lot of smaller locks. - Create a common DPLL configuration API. Allow configuring and querying state of PLL circuits used for clock syntonization, in network time distribution. - Unify fragmented and full page allocation APIs in page pool code. Let drivers be ignorant of PAGE_SIZE. - Rework PHY state machine to avoid races with calls to phy_stop(). - Notify DSA drivers of MAC address changes on user ports, improve correctness of offloads which depend on matching port MAC addresses. - Allow antenna control on injected WiFi frames. - Reduce the number of variants of napi_schedule(). - Simplify error handling when composing devlink health messages. Misc: - A lot of KCSAN data race "fixes", from Eric. - A lot of __counted_by() annotations, from Kees. - A lot of strncpy -> strscpy and printf format fixes. - Replace master/slave terminology with conduit/user in DSA drivers. - Handful of KUnit tests for netdev and WiFi core. Removed: - AppleTalk COPS. - AppleTalk ipddp. - TI AR7 CPMAC Ethernet driver. Drivers: - Ethernet high-speed NICs: - Intel (100G, ice, idpf): - add a driver for the Intel E2000 IPUs - make CRC/FCS stripping configurable - cross-timestamping for E823 devices - basic support for E830 devices - use aux-bus for managing client drivers - i40e: report firmware versions via devlink - nVidia/Mellanox: - support 4-port NICs - increase max number of channels to 256 - optimize / parallelize SF creation flow - Broadcom (bnxt): - enhance NIC temperature reporting - support PAM4 speeds and lane configuration - Marvell OcteonTX2: - PTP pulse-per-second output support - enable hardware timestamping for VFs - Solarflare/AMD: - conntrack NAT offload and offload for tunnels - Wangxun (ngbe/txgbe): - expose HW statistics - Pensando/AMD: - support PCI level reset - narrow down the condition under which skbs are linearized - Netronome/Corigine (nfp): - support CHACHA20-POLY1305 crypto in IPsec offload - Ethernet NICs embedded, slower, virtual: - Synopsys (stmmac): - add Loongson-1 SoC support - enable use of HW queues with no offload capabilities - enable PPS input support on all 5 channels - increase TX coalesce timer to 5ms - RealTek USB (r8152): improve efficiency of Rx by using GRO frags - xen: support SW packet timestamping - add drivers for implementations based on TI's PRUSS (AM64x EVM) - nVidia/Mellanox Ethernet datacenter switches: - avoid poor HW resource use on Spectrum-4 by better block selection for IPv6 multicast forwarding and ordering of blocks in ACL region - Ethernet embedded switches: - Microchip: - support configuring the drive strength for EMI compliance - ksz9477: partial ACL support - ksz9477: HSR offload - ksz9477: Wake on LAN - Realtek: - rtl8366rb: respect device tree config of the CPU port - Ethernet PHYs: - support Broadcom BCM5221 PHYs - TI dp83867: support hardware LED blinking - CAN: - add support for Linux-PHY based CAN transceivers - at91_can: clean up and use rx-offload helpers - WiFi: - MediaTek (mt76): - new sub-driver for mt7925 USB/PCIe devices - HW wireless <> Ethernet bridging in MT7988 chips - mt7603/mt7628 stability improvements - Qualcomm (ath12k): - WCN7850: - enable 320 MHz channels in 6 GHz band - hardware rfkill support - enable IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS to make scan faster - read board data variant name from SMBIOS - QCN9274: mesh support - RealTek (rtw89): - TDMA-based multi-channel concurrency (MCC) - Silicon Labs (wfx): - Remain-On-Channel (ROC) support - Bluetooth: - ISO: many improvements for broadcast support - mark BCM4378/BCM4387 as BROKEN_LE_CODED - add support for QCA2066 - btmtksdio: enable Bluetooth wakeup from suspend" * tag 'net-next-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (1816 commits) net: pcs: xpcs: Add 2500BASE-X case in get state for XPCS drivers net: bpf: Use sockopt_lock_sock() in ip_sock_set_tos() net: mana: Use xdp_set_features_flag instead of direct assignment vxlan: Cleanup IFLA_VXLAN_PORT_RANGE entry in vxlan_get_size() iavf: delete the iavf client interface iavf: add a common function for undoing the interrupt scheme iavf: use unregister_netdev iavf: rely on netdev's own registered state iavf: fix the waiting time for initial reset iavf: in iavf_down, don't queue watchdog_task if comms failed iavf: simplify mutex_trylock+sleep loops iavf: fix comments about old bit locks doc/netlink: Update schema to support cmd-cnt-name and cmd-max-name tools: ynl: introduce option to process unknown attributes or types ipvlan: properly track tx_errors netdevsim: Block until all devices are released nfp: using napi_build_skb() to replace build_skb() net: dsa: microchip: ksz9477: Fix spelling mistake "Enery" -> "Energy" net: dsa: microchip: Ensure Stable PME Pin State for Wake-on-LAN net: dsa: microchip: Refactor switch shutdown routine for WoL preparation ... commit 070bb43ab01e891db1b742d4ddd7291c7f8d7022 Author: Eric Biggers Date: Sat Oct 28 21:59:44 2023 -0700 dm integrity: use crypto_shash_digest() in sb_mac() Simplify sb_mac() by using crypto_shash_digest() instead of an init+update+final sequence. This should also improve performance. Signed-off-by: Eric Biggers Signed-off-by: Mike Snitzer commit 6d0ee3b68092ef556703d7827ead3d1b7d275399 Author: Eric Biggers Date: Sat Oct 28 21:59:23 2023 -0700 dm crypt: use crypto_shash_digest() in crypt_iv_tcw_whitening() Simplify crypt_iv_tcw_whitening() by using crypto_shash_digest() instead of an init+update+final sequence. This should also improve performance. Signed-off-by: Eric Biggers Signed-off-by: Mike Snitzer commit a951104333bd25bb6e5d0f5bee9cbf155b66fac1 Author: Damien Le Moal Date: Thu Oct 26 14:12:05 2023 +0900 dm error: Add support for zoned block devices dm-error is used in several test cases in the xfstests test suite to check the handling of IO errors in file systems. However, with several file systems getting native support for zoned block devices (e.g. btrfs and f2fs), dm-error's lack of zoned block device support creates problems as the file system attempts executing zone commands (e.g. a zone append operation) against a dm-error non-zoned block device, which causes various issues in the block layer (e.g. WARN_ON triggers). This commit adds supports for zoned block devices to dm-error, allowing a DM device table containing an error target to be exposed as a zoned block device (if all targets have a compatible zoned model support and mapping). This is done as follows: 1) Allow passing 2 arguments to an error target, similar to dm-linear: a backing device and a start sector. These arguments are optional and dm-error retains its characteristics if the arguments are not specified. 2) Implement the iterate_devices method so that dm-core can normally check the zone support and restrictions (e.g. zone alignment of the targets). When the backing device arguments are not specified, the iterate_devices method never calls the fn() argument. When no backing device is specified, as before, we assume that the DM device is not zoned. When the backing device arguments are specified, the zoned model of the DM device will depend on the backing device type: - If the backing device is zoned and its model and mapping is compatible with other targets of the device, the resulting device will be zoned, with the dm-error mapped portion always returning errors (similar to the default non-zoned case). - If the backing device is not zoned, then the DM device will not be either. This zone support for dm-error requires the definition of a functional report_zones operation so that dm_revalidate_zones() can operate correctly and resources for emulating zone append operations initialized. This is necessary for cases where dm-error is used to partially map a device and have an overall correct handling of zone append. This means that dm-error does not fail report zones operations. Two changes that are not obvious are included to avoid issues: 1) dm_table_supports_zoned_model() is changed to directly check if the backing device of a wildcard target (= dm-error target) is zoned. Otherwise, we wouldn't be able to catch the invalid setup of dm-error without a backing device (non zoned case) being combined with zoned targets. 2) dm_table_supports_dax() is modified to return false if the wildcard target is found. Otherwise, when dm-error is set without a backing device, we end up with a NULL pointer dereference in set_dax_synchronous (dax_dev is NULL). This is consistent with the current behavior because dm_table_supports_dax() always returned false for targets that do not define the iterate_devices method. Signed-off-by: Damien Le Moal Tested-by: Christoph Hellwig Signed-off-by: Mike Snitzer commit 70bbeb29fab09d6ea6cfe64109db60a97d84d739 Author: Christian Loehle Date: Fri Oct 20 12:46:05 2023 +0100 dm delay: for short delays, use kthread instead of timers and wq DM delay's current design of using timers and wq to realize the delays is insufficient for delays below ~50ms. This commit enhances the design to use a kthread to flush the expired delays, trading some CPU time (in some cases) for better delay accuracy and delays closer to what the user requested for smaller delays. The new design is chosen as long as all the delays are below 50ms. Since bios can't be completed in interrupt context using a kthread is probably the most reasonable way to approach this. Testing with echo "0 2097152 zero" | dmsetup create dm-zeros for i in $(seq 0 20); do echo "0 2097152 delay /dev/mapper/dm-zeros 0 $i" | dmsetup create dm-delay-${i}ms; done Some performance numbers for comparison, on beaglebone black (single core) CONFIG_HZ_1000=y: fio --name=1msread --rw=randread --bs=4k --runtime=60 --time_based \ --filename=/dev/mapper/dm-delay-1ms Theoretical maximum: 1000 IOPS Previous: 250 IOPS Kthread: 500 IOPS fio --name=10msread --rw=randread --bs=4k --runtime=60 --time_based \ --filename=/dev/mapper/dm-delay-10ms Theoretical maximum: 100 IOPS Previous: 45 IOPS Kthread: 50 IOPS fio --name=1mswrite --rw=randwrite --direct=1 --bs=4k --runtime=60 \ --time_based --filename=/dev/mapper/dm-delay-1ms Theoretical maximum: 1000 IOPS Previous: 498 IOPS Kthread: 1000 IOPS fio --name=10mswrite --rw=randwrite --direct=1 --bs=4k --runtime=60 \ --time_based --filename=/dev/mapper/dm-delay-10ms Theoretical maximum: 100 IOPS Previous: 90 IOPS Kthread: 100 IOPS (This one is just to prove the new design isn't impacting throughput, not really about delays): fio --name=10mswriteasync --rw=randwrite --direct=1 --bs=4k \ --runtime=60 --time_based --filename=/dev/mapper/dm-delay-10ms \ --numjobs=32 --iodepth=64 --ioengine=libaio --group_reporting Previous: 13.3k IOPS Kthread: 13.3k IOPS Signed-off-by: Christian Loehle [Harshit: kthread_create error handling fix in delay_ctr] Signed-off-by: Harshit Mogalapalli Signed-off-by: Mike Snitzer commit ed2232d49187cebc007ecf4e6374069b11ab3219 Author: Syed Saba Kareem Date: Tue Oct 31 19:29:34 2023 +0530 ASoC: amd: acp: fix for i2s mode register field update I2S mode register field will be set to 1 when tdm mode is enabled. Update the I2S mode field based on tdm_mode flag check. This will fix below smatch checker warning. sound/soc/amd/acp/acp-i2s.c:59 acp_set_i2s_clk() warn: odd binop '0x0 & 0x2' Fixes: 40f74d5f09d7 ("ASoC: amd: acp: refactor acp i2s clock generation code") Reported-By: Dan Carpenter Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231031135949.1064581-3-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit be47941980d56238455eb54401c7b3de4ac5e269 Merge: d5cde2e0b317b 0068299540969 Author: Paolo Bonzini Date: Tue Oct 31 10:22:43 2023 -0400 Merge tag 'kvm-x86-svm-6.7' of https://github.com/kvm-x86/linux into HEAD KVM SVM changes for 6.7: - Report KVM_EXIT_SHUTDOWN instead of EINVAL if KVM intercepts SHUTDOWN while running an SEV-ES guest. - Clean up handling "failures" when KVM detects it can't emulate the "skip" action for an instruction that has already been partially emulated. Drop a hack in the SVM code that was fudging around the emulator code not giving SVM enough information to do the right thing. commit d5cde2e0b317bb179a39204b4a7820ac8b9011cc Merge: e122d7a100876 fad505b2cb838 Author: Paolo Bonzini Date: Tue Oct 31 10:22:23 2023 -0400 Merge tag 'kvm-x86-pmu-6.7' of https://github.com/kvm-x86/linux into HEAD KVM PMU change for 6.7: - Handle NMI/SMI requests after PMU/PMI requests so that a PMI=>NMI doesn't require redoing the entire run loop due to the NMI not being detected until the final kvm_vcpu_exit_request() check before entering the guest. commit e122d7a1008769af080b9dbd78fce54d3cd77f6f Merge: f0f59d069e0a3 409f2e92a27a2 Author: Paolo Bonzini Date: Tue Oct 31 10:21:42 2023 -0400 Merge tag 'kvm-x86-xen-6.7' of https://github.com/kvm-x86/linux into HEAD KVM x86 Xen changes for 6.7: - Omit "struct kvm_vcpu_xen" entirely when CONFIG_KVM_XEN=n. - Use the fast path directly from the timer callback when delivering Xen timer events. Avoid the problematic races with using the fast path by ensuring the hrtimer isn't running when (re)starting the timer or saving the timer information (for userspace). - Follow the lead of upstream Xen and ignore the VCPU_SSHOTTMR_future flag. commit f0f59d069e0a33bd43afe664e16b4a86cf9d079c Merge: f292dc8aad10f 1de9992f9de0a Author: Paolo Bonzini Date: Tue Oct 31 10:17:43 2023 -0400 Merge tag 'kvm-x86-mmu-6.7' of https://github.com/kvm-x86/linux into HEAD KVM x86 MMU changes for 6.7: - Clean up code that deals with honoring guest MTRRs when the VM has non-coherent DMA and host MTRRs are ignored, i.e. EPT is enabled. - Zap EPT entries when non-coherent DMA assignment stops/start to prevent using stale entries with the wrong memtype. - Don't ignore guest PAT for CR0.CD=1 && KVM_X86_QUIRK_CD_NW_CLEARED=y, as there's zero reason to ignore guest PAT if the effective MTRR memtype is WB. This will also allow for future optimizations of handling guest MTRR updates for VMs with non-coherent DMA and the quirk enabled. - Harden the fast page fault path to guard against encountering an invalid root when walking SPTEs. commit 2ef422f063b74adcc4a4a9004b0a87bb55e0a836 Author: George Kennedy Date: Tue Oct 24 13:01:58 2023 -0500 IB/mlx5: Fix init stage error handling to avoid double free of same QP and UAF In the unlikely event that workqueue allocation fails and returns NULL in mlx5_mkey_cache_init(), delete the call to mlx5r_umr_resource_cleanup() (which frees the QP) in mlx5_ib_stage_post_ib_reg_umr_init(). This will avoid attempted double free of the same QP when __mlx5_ib_add() does its cleanup. Resolves a splat: Syzkaller reported a UAF in ib_destroy_qp_user workqueue: Failed to create a rescuer kthread for wq "mkey_cache": -EINTR infiniband mlx5_0: mlx5_mkey_cache_init:981:(pid 1642): failed to create work queue infiniband mlx5_0: mlx5_ib_stage_post_ib_reg_umr_init:4075:(pid 1642): mr cache init failed -12 ================================================================== BUG: KASAN: slab-use-after-free in ib_destroy_qp_user (drivers/infiniband/core/verbs.c:2073) Read of size 8 at addr ffff88810da310a8 by task repro_upstream/1642 Call Trace: kasan_report (mm/kasan/report.c:590) ib_destroy_qp_user (drivers/infiniband/core/verbs.c:2073) mlx5r_umr_resource_cleanup (drivers/infiniband/hw/mlx5/umr.c:198) __mlx5_ib_add (drivers/infiniband/hw/mlx5/main.c:4178) mlx5r_probe (drivers/infiniband/hw/mlx5/main.c:4402) ... Allocated by task 1642: __kmalloc (./include/linux/kasan.h:198 mm/slab_common.c:1026 mm/slab_common.c:1039) create_qp (./include/linux/slab.h:603 ./include/linux/slab.h:720 ./include/rdma/ib_verbs.h:2795 drivers/infiniband/core/verbs.c:1209) ib_create_qp_kernel (drivers/infiniband/core/verbs.c:1347) mlx5r_umr_resource_init (drivers/infiniband/hw/mlx5/umr.c:164) mlx5_ib_stage_post_ib_reg_umr_init (drivers/infiniband/hw/mlx5/main.c:4070) __mlx5_ib_add (drivers/infiniband/hw/mlx5/main.c:4168) mlx5r_probe (drivers/infiniband/hw/mlx5/main.c:4402) ... Freed by task 1642: __kmem_cache_free (mm/slub.c:1826 mm/slub.c:3809 mm/slub.c:3822) ib_destroy_qp_user (drivers/infiniband/core/verbs.c:2112) mlx5r_umr_resource_cleanup (drivers/infiniband/hw/mlx5/umr.c:198) mlx5_ib_stage_post_ib_reg_umr_init (drivers/infiniband/hw/mlx5/main.c:4076 drivers/infiniband/hw/mlx5/main.c:4065) __mlx5_ib_add (drivers/infiniband/hw/mlx5/main.c:4168) mlx5r_probe (drivers/infiniband/hw/mlx5/main.c:4402) ... Fixes: 04876c12c19e ("RDMA/mlx5: Move init and cleanup of UMR to umr.c") Link: https://lore.kernel.org/r/1698170518-4006-1-git-send-email-george.kennedy@oracle.com Suggested-by: Leon Romanovsky Signed-off-by: George Kennedy Signed-off-by: Jason Gunthorpe commit f292dc8aad10f8e3be2cfaa4714b92464f42c710 Merge: fadaf574a7fab 2770d4722036d Author: Paolo Bonzini Date: Tue Oct 31 10:15:15 2023 -0400 Merge tag 'kvm-x86-misc-6.7' of https://github.com/kvm-x86/linux into HEAD KVM x86 misc changes for 6.7: - Add CONFIG_KVM_MAX_NR_VCPUS to allow supporting up to 4096 vCPUs without forcing more common use cases to eat the extra memory overhead. - Add IBPB and SBPB virtualization support. - Fix a bug where restoring a vCPU snapshot that was taken within 1 second of creating the original vCPU would cause KVM to try to synchronize the vCPU's TSC and thus clobber the correct TSC being set by userspace. - Compute guest wall clock using a single TSC read to avoid generating an inaccurate time, e.g. if the vCPU is preempted between multiple TSC reads. - "Virtualize" HWCR.TscFreqSel to make Linux guests happy, which complain about a "Firmware Bug" if the bit isn't set for select F/M/S combos. - Don't apply side effects to Hyper-V's synthetic timer on writes from userspace to fix an issue where the auto-enable behavior can trigger spurious interrupts, i.e. do auto-enabling only for guest writes. - Remove an unnecessary kick of all vCPUs when synchronizing the dirty log without PML enabled. - Advertise "support" for non-serializing FS/GS base MSR writes as appropriate. - Use octal notation for file permissions through KVM x86. - Fix a handful of typo fixes and warts. commit fadaf574a7fabe27016f734bd02a3bd27d0fcc10 Merge: f23364676018d b35babd3abea0 Author: Paolo Bonzini Date: Tue Oct 31 10:12:45 2023 -0400 Merge tag 'kvm-x86-docs-6.7' of https://github.com/kvm-x86/linux into HEAD KVM x86 Documentation updates for 6.7: - Fix various typos, notably a confusing reference to the non-existent "struct kvm_vcpu_event" (the actual structure is kvm_vcpu_events, plural). - Update x86's kvm_mmu_page documentation to bring it closer to the code (this raced with the removal of async zapping and so the documentation is already stale; my bad). - Document the behavior of x86 PMU filters on fixed counters. commit f23364676018db8432f91c6247a30529195aff60 Merge: 140139c5bd9f0 629d3698f6958 Author: Paolo Bonzini Date: Tue Oct 31 10:11:19 2023 -0400 Merge tag 'kvm-x86-apic-6.7' of https://github.com/kvm-x86/linux into HEAD KVM x86 APIC changes for 6.7: - Purge VMX's posted interrupt descriptor *before* loading APIC state when handling KVM_SET_LAPIC. Purging the PID after loading APIC state results in lost APIC timer IRQs as the APIC timer can be armed as part of loading APIC state, i.e. can immediately pend an IRQ if the expiry is in the past. - Clear the ICR.BUSY bit when handling trap-like x2APIC writes. This avoids a WARN, due to KVM expecting the BUSY bit to be cleared when sending IPIs. commit 140139c5bd9f0f95706a6138fc41bfa59792695e Merge: 957eedc70350a 70fea30195168 Author: Paolo Bonzini Date: Tue Oct 31 10:10:15 2023 -0400 Merge tag 'kvm-s390-next-6.7-1' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD - nested page table management performance counters commit 957eedc70350ad1b31aa76c4ed826372a46006fa Merge: ef12ea629e69d d9c00f44e5de5 Author: Paolo Bonzini Date: Tue Oct 31 10:09:39 2023 -0400 Merge tag 'kvm-riscv-6.7-1' of https://github.com/kvm-riscv/linux into HEAD KVM/riscv changes for 6.7 - Smstateen and Zicond support for Guest/VM - Virtualized senvcfg CSR for Guest/VM - Added Smstateen registers to the get-reg-list selftests - Added Zicond to the get-reg-list selftests - Virtualized SBI debug console (DBCN) for Guest/VM - Added SBI debug console (DBCN) to the get-reg-list selftests commit a53e215f90079f617360439b1b6284820731e34c Author: Moshe Shemesh Date: Wed Oct 25 20:49:59 2023 +0300 RDMA/mlx5: Fix mkey cache WQ flush The cited patch tries to ensure no pending works on the mkey cache workqueue by disabling adding new works and call flush_workqueue(). But this workqueue also has delayed works which might still be pending the delay time to be queued. Add cancel_delayed_work() for the delayed works which waits to be queued and then the flush_workqueue() will flush all works which are already queued and running. Fixes: 374012b00457 ("RDMA/mlx5: Fix mkey cache possible deadlock on cleanup") Link: https://lore.kernel.org/r/b8722f14e7ed81452f791764a26d2ed4cfa11478.1698256179.git.leon@kernel.org Signed-off-by: Moshe Shemesh Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ef12ea629e69d12c8713218014bf569a788f17ae Merge: ffc253263a137 2c10cda4b777b Author: Paolo Bonzini Date: Tue Oct 31 09:55:40 2023 -0400 Merge tag 'loongarch-kvm-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson into HEAD LoongArch KVM changes for v6.7 Add LoongArch's KVM support. Loongson 3A5000/3A6000 supports hardware assisted virtualization. With cpu virtualization, there are separate hw-supported user mode and kernel mode in guest mode. With memory virtualization, there are two-level hw mmu table for guest mode and host mode. Also there is separate hw cpu timer with consant frequency in guest mode, so that vm can migrate between hosts with different freq. Currently, we are able to boot LoongArch Linux Guests. Few key aspects of KVM LoongArch added by this series are: 1. Enable kvm hardware function when kvm module is loaded. 2. Implement VM and vcpu related ioctl interface such as vcpu create, vcpu run etc. GET_ONE_REG/SET_ONE_REG ioctl commands are use to get general registers one by one. 3. Hardware access about MMU, timer and csr are emulated in kernel. 4. Hardwares such as mmio and iocsr device are emulated in user space such as IPI, irqchips, pci devices etc. commit 162e3480246ef69386d4647d2320d86741bf08a2 Merge: d4b2d165714c0 ffc253263a137 Author: Jason Gunthorpe Date: Tue Oct 31 10:54:48 2023 -0300 Merge tag 'v6.6' into rdma.git for-next Resolve conflict by taking the spin_lock hunk from for-next: https://lore.kernel.org/r/20230928113851.5197a1ec@canb.auug.org.au Required for the next patch. Signed-off-by: Jason Gunthorpe commit b836c4d29f2744200b2af41e14bf50758dddc818 Author: Mimi Zohar Date: Wed Oct 18 14:47:02 2023 -0400 ima: detect changes to the backing overlay file Commit 18b44bc5a672 ("ovl: Always reevaluate the file signature for IMA") forced signature re-evaulation on every file access. Instead of always re-evaluating the file's integrity, detect a change to the backing file, by comparing the cached file metadata with the backing file's metadata. Verifying just the i_version has not changed is insufficient. In addition save and compare the i_ino and s_dev as well. Reviewed-by: Amir Goldstein Tested-by: Eric Snowberg Tested-by: Raul E Rangel Cc: stable@vger.kernel.org Signed-off-by: Mimi Zohar commit b46503068cb9ed63ff1d8250f143354ead0b16eb Author: Mimi Zohar Date: Sun Oct 15 20:18:03 2023 -0400 certs: Only allow certs signed by keys on the builtin keyring Originally the secondary trusted keyring provided a keyring to which extra keys may be added, provided those keys were not blacklisted and were vouched for by a key built into the kernel or already in the secondary trusted keyring. On systems with the machine keyring configured, additional keys may also be vouched for by a key on the machine keyring. Prevent loading additional certificates directly onto the secondary keyring, vouched for by keys on the machine keyring, yet allow these certificates to be loaded onto other trusted keyrings. Reviewed-by: Jarkko Sakkinen Signed-off-by: Mimi Zohar commit 7b5c3086d1f85448a2a81947b685119c6c9894c8 Author: Prasad Pandit Date: Sun Oct 22 12:17:23 2023 +0530 integrity: fix indentation of config attributes Fix indentation of config attributes. Attributes are generally indented with a leading tab(\t) character. Signed-off-by: Prasad Pandit Signed-off-by: Mimi Zohar commit e044374a8a0a99e46f4e6d6751d3042b6d9cc12e Author: Amir Goldstein Date: Thu Oct 5 14:15:58 2023 +0300 ima: annotate iint mutex to avoid lockdep false positive warnings It is not clear that IMA should be nested at all, but as long is it measures files both on overlayfs and on underlying fs, we need to annotate the iint mutex to avoid lockdep false positives related to IMA + overlayfs, same as overlayfs annotates the inode mutex. Reported-and-tested-by: syzbot+b42fe626038981fb7bfa@syzkaller.appspotmail.com Signed-off-by: Amir Goldstein Cc: stable@vger.kernel.org Signed-off-by: Mimi Zohar commit 1a0ac8bd7a4fa5b2f4ef14c3b1e9d6e5a5faae06 Author: Gao Xiang Date: Tue Oct 31 14:05:24 2023 +0800 erofs: fix erofs_insert_workgroup() lockref usage As Linus pointed out [1], lockref_put_return() is fundamentally designed to be something that can fail. It behaves as a fastpath-only thing, and the failure case needs to be handled anyway. Actually, since the new pcluster was just allocated without being populated, it won't be accessed by others until it is inserted into XArray, so lockref helpers are actually unneeded here. Let's just set the proper reference count on initializing. [1] https://lore.kernel.org/r/CAHk-=whCga8BeQnJ3ZBh_Hfm9ctba_wpF444LpwRybVNMzO6Dw@mail.gmail.com Fixes: 7674a42f35ea ("erofs: use struct lockref to replace handcrafted approach") Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20231031060524.1103921-1-hsiangkao@linux.alibaba.com Signed-off-by: Gao Xiang commit acbc3ecb806e24eb9c0cafc29e0884490dda6169 Author: Paul E. McKenney Date: Thu Oct 5 10:17:47 2023 -0700 doc: Add /proc/bootconfig to proc.rst Add /proc/bootconfig description to Documentation/filesystems/proc.rst. Link: https://lore.kernel.org/all/20231005171747.541123-3-paulmck@kernel.org/ Reported-by: Masami Hiramatsu Signed-off-by: Paul E. McKenney Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit 2dc15ff73b6a7b47db0e848498cb5b0479e781c6 Merge: c468b5dd759ed bdb7e1922052b Author: Takashi Iwai Date: Tue Oct 31 09:01:25 2023 +0100 Merge tag 'asoc-v6.7-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v6.7 More updates for v6,7 following the early merge request: - Fixes for handling of component name prefixing when name prefixes are used by the machine driver. - Fixes for noise when stopping some Sounwire CODECs. - Support for AMD ACP 6.3 and 7.0, Awinc AW88399, more Intel platforms and more Qualcomm SC7180 platforms. commit c468b5dd759ede754b23cbc9c50b048a781d4217 Merge: 99248c8902f50 f71e0be5d297b Author: Takashi Iwai Date: Tue Oct 31 08:58:36 2023 +0100 Merge branch 'for-next' into for-linus Pull 6.7 materials Signed-off-by: Takashi Iwai commit 5a6a09e97199d6600d31383055f9d43fbbcbe86f Merge: 866b8870b6e6f a41796b5537dd Author: Linus Torvalds Date: Mon Oct 30 20:58:48 2023 -1000 Merge tag 'cgroup-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup updates from Tejun Heo: - cpuset now supports remote partitions where CPUs can be reserved for exclusive use down the tree without requiring all the intermediate nodes to be partitions. This makes it easier to use partitions without modifying existing cgroup hierarchy. - cpuset partition configuration behavior improvement - cgroup_favordynmods= boot param added to allow setting the flag on boot on cgroup1 - Misc code and doc updates * tag 'cgroup-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: docs/cgroup: Add the list of threaded controllers to cgroup-v2.rst cgroup: use legacy_name for cgroup v1 disable info cgroup/cpuset: Cleanup signedness issue in cpu_exclusive_check() cgroup/cpuset: Enable invalid to valid local partition transition cgroup: add cgroup_favordynmods= command-line option cgroup/cpuset: Extend test_cpuset_prs.sh to test remote partition cgroup/cpuset: Documentation update for partition cgroup/cpuset: Check partition conflict with housekeeping setup cgroup/cpuset: Introduce remote partition cgroup/cpuset: Add cpuset.cpus.exclusive for v2 cgroup/cpuset: Add cpuset.cpus.exclusive.effective for v2 cgroup/cpuset: Fix load balance state in update_partition_sd_lb() cgroup: Avoid extra dereference in css_populate_dir() cgroup: Check for ret during cgroup1_base_files cft addition commit 866b8870b6e6f478e9a1c51e732c9ba26dddbe91 Merge: 639409a4ac8e1 265f3ed077036 Author: Linus Torvalds Date: Mon Oct 30 20:45:29 2023 -1000 Merge tag 'wq-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue update from Tejun Heo: "Just one commit to improve lockdep annotation for work_on_cpu() to avoid spurious warnings" * tag 'wq-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: Provide one lock class key per work_on_cpu() callsite commit 639409a4ac8e1578ce34715338c6a4ddf9941294 Merge: 455cdcb45f8fa 15b286d1fd056 Author: Linus Torvalds Date: Mon Oct 30 20:35:48 2023 -1000 Merge tag 'wq-for-6.7-rust-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue rust bindings from Tejun Heo: "Add rust bindings to allow rust code to schedule work items on workqueues. While the current bindings don't cover all of the workqueue API, it provides enough for basic usage and can be expanded as needed" * tag 'wq-for-6.7-rust-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: rust: workqueue: add examples rust: workqueue: add `try_spawn` helper method rust: workqueue: implement `WorkItemPointer` for pointer types rust: workqueue: add helper for defining work_struct fields rust: workqueue: define built-in queues rust: workqueue: add low-level workqueue bindings rust: sync: add `Arc::{from_raw, into_raw}` commit 455cdcb45f8fa9e7c70273e7bec0537ff02d5247 Merge: 2b93c2c3c02f4 3857af38e57a8 Author: Linus Torvalds Date: Mon Oct 30 20:30:49 2023 -1000 Merge tag 'rust-6.7' of https://github.com/Rust-for-Linux/linux Pull rust updates from Miguel Ojeda: "A small one compared to the previous one in terms of features. In terms of lines, as usual, the 'alloc' version upgrade accounts for most of them. Toolchain and infrastructure: - Upgrade to Rust 1.73.0 This time around, due to how the kernel and Rust schedules have aligned, there are two upgrades in fact. They contain the fixes for a few issues we reported to the Rust project. In addition, a few cleanups indicated by the upgraded compiler or possible thanks to it. For instance, the compiler now detects redundant explicit links. - A couple changes to the Rust 'Makefile' so that it can be used with toybox tools, allowing Rust to be used in the Android kernel build. x86: - Enable IBT if enabled in C Documentation: - Add "The Rust experiment" section to the Rust index page MAINTAINERS: - Add Maintainer Entry Profile field ('P:'). - Update our 'W:' field to point to the webpage we have been building this year" * tag 'rust-6.7' of https://github.com/Rust-for-Linux/linux: docs: rust: add "The Rust experiment" section x86: Enable IBT in Rust if enabled in C rust: Use grep -Ev rather than relying on GNU grep rust: Use awk instead of recent xargs rust: upgrade to Rust 1.73.0 rust: print: use explicit link in documentation rust: task: remove redundant explicit link rust: kernel: remove `#[allow(clippy::new_ret_no_self)]` MAINTAINERS: add Maintainer Entry Profile field for Rust MAINTAINERS: update Rust webpage rust: upgrade to Rust 1.72.1 rust: arc: add explicit `drop()` around `Box::from_raw()` commit 2b93c2c3c02f4243d4c773b880fc86e2788f013d Merge: f5fc9e4a117d4 e508560672890 Author: Linus Torvalds Date: Mon Oct 30 20:13:17 2023 -1000 Merge tag 'lsm-pr-20231030' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm Pull LSM updates from Paul Moore: - Add new credential functions, get_cred_many() and put_cred_many() to save some atomic_t operations for a few operations. While not strictly LSM related, this patchset had been rotting on the mailing lists for some time and since the LSMs do care a lot about credentials I thought it reasonable to give this patch a home. - Five patches to constify different LSM hook parameters. - Fix a spelling mistake. * tag 'lsm-pr-20231030' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm: lsm: fix a spelling mistake cred: add get_cred_many and put_cred_many lsm: constify 'sb' parameter in security_sb_kern_mount() lsm: constify 'bprm' parameter in security_bprm_committed_creds() lsm: constify 'bprm' parameter in security_bprm_committing_creds() lsm: constify 'file' parameter in security_bprm_creds_from_file() lsm: constify 'sb' parameter in security_quotactl() commit f5fc9e4a117d4c118c95abb37e9d34d52b748c99 Merge: b9886c976668c 19c1c9916dbf9 Author: Linus Torvalds Date: Mon Oct 30 19:47:06 2023 -1000 Merge tag 'selinux-pr-20231030' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull selinux updates from Paul Moore: - improve the SELinux debugging configuration controls in Kconfig - print additional information about the hash table chain lengths when when printing SELinux debugging information - simplify the SELinux access vector hash table calcaulations - use a better hashing function for the SELinux role tansition hash table - improve SELinux load policy time through the use of optimized functions for calculating the number of bits set in a field - addition of a __counted_by annotation - simplify the avtab_inert_node() function through a simplified prototype * tag 'selinux-pr-20231030' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: simplify avtab_insert_node() prototype selinux: hweight optimization in avtab_read_item selinux: improve role transition hashing selinux: simplify avtab slot calculation selinux: improve debug configuration selinux: print sum of chain lengths^2 for hash tables selinux: Annotate struct sidtab_str_cache with __counted_by commit b9886c976668cae1614b46922b56f14b467da7be Merge: b9ff774548cd9 47846d51348dd Author: Linus Torvalds Date: Mon Oct 30 19:44:52 2023 -1000 Merge tag 'audit-pr-20231030' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit update from Paul Moore: "Only two audit patches for v6.7, both fairly small with a combined 11 lines of changes. The first patch is a simple __counted_by annontation, and the second fixes a a problem where audit could deadlock on task_lock() when an exe filter is configured. More information is available in the commit description and the patch is tagged for stable" * tag 'audit-pr-20231030' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: don't take task_lock() in audit_exe_compare() code path audit: Annotate struct audit_chunk with __counted_by commit b9ff774548cd91b45003b3b0d41f15cd52b25509 Merge: d82c0a37d431a 03acb9ccec3f8 Author: Linus Torvalds Date: Mon Oct 30 19:41:52 2023 -1000 Merge tag 'tpmdd-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull tpm updates from Jarkko Sakkinen: "This is a small sized pull request. One commit I would like to pinpoint is my fix for init_trusted() rollback, as for actual patch I did not receive any feedback" * tag 'tpmdd-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: keys: Remove unused extern declarations integrity: powerpc: Do not select CA_MACHINE_KEYRING KEYS: trusted: tee: Refactor register SHM usage KEYS: trusted: Rollback init_trusted() consistently commit d82c0a37d431ada0d1dae9a2665fcfe17b0f9e14 Merge: 5e37269945b4d 21ca59b365c09 Author: Linus Torvalds Date: Mon Oct 30 19:28:19 2023 -1000 Merge tag 'execve-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull execve updates from Kees Cook: - Support non-BSS ELF segments with zero filesz Eric Biederman and I refactored ELF segment loading to handle the case where a segment has a smaller filesz than memsz. Traditionally linkers only did this for .bss and it was always the last segment. As a result, the kernel only handled this case when it was the last segment. We've had two recent cases where linkers were trying to use these kinds of segments for other reasons, and the were in the middle of the segment list. There was no good reason for the kernel not to support this, and the refactor actually ends up making things more readable too. - Enable namespaced binfmt_misc Christian Brauner has made it possible to use binfmt_misc with mount namespaces. This means some traditionally root-only interfaces (for adding/removing formats) are now more exposed (but believed to be safe). - Remove struct tag 'dynamic' from ELF UAPI Alejandro Colomar noticed that the ELF UAPI has been polluting the struct namespace with an unused and overly generic tag named "dynamic" for no discernible reason for many many years. After double-checking various distro source repositories, it has been removed. - Clean up binfmt_elf_fdpic debug output (Greg Ungerer) * tag 'execve-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: binfmt_misc: enable sandboxed mounts binfmt_misc: cleanup on filesystem umount binfmt_elf_fdpic: clean up debug warnings mm: Remove unused vm_brk() binfmt_elf: Only report padzero() errors when PROT_WRITE binfmt_elf: Use elf_load() for library binfmt_elf: Use elf_load() for interpreter binfmt_elf: elf_bss no longer used by load_elf_binary() binfmt_elf: Support segments with 0 filesz and misaligned starts elf, uapi: Remove struct tag 'dynamic' commit 5e37269945b4d6117770666a40081848558f9501 Merge: befaa609f4c78 a19d48f7c5d57 Author: Linus Torvalds Date: Mon Oct 30 19:26:39 2023 -1000 Merge tag 'pstore-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull pstore updates from Kees Cook: - Check for out-of-memory condition during initialization (Jiasheng Jiang) - Fix documentation typos (Tudor Ambarus) * tag 'pstore-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: pstore/platform: Add check for kstrdup docs: pstore-blk.rst: fix typo, s/console/ftrace docs: pstore-blk.rst: use "about" as a preposition after "care" commit 7e6bd6409b66f57741dd69e0ee20f4ed4434b67c Author: Dave Airlie Date: Mon Oct 30 11:26:56 2023 +1000 nouveau/disp: fix post-gsp build on 32-bit arm. This converts a bunch of divides into the proper macros. Reviewed-by: Danilo Krummrich Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231030012814.1208972-2-airlied@gmail.com commit b76827a3a930fe8737ca64854e17c113687e94a9 Author: Dave Airlie Date: Mon Oct 30 11:26:17 2023 +1000 nouveau: fix r535 build on 32-bit arm. This needs the proper division macros. Reviewed-by: Danilo Krummrich Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231030012814.1208972-1-airlied@gmail.com commit befaa609f4c784f505c02ea3ff036adf4f4aa814 Merge: fdce8bd38037a 9cca73d7b4bfe Author: Linus Torvalds Date: Mon Oct 30 19:09:55 2023 -1000 Merge tag 'hardening-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening updates from Kees Cook: "One of the more voluminous set of changes is for adding the new __counted_by annotation[1] to gain run-time bounds checking of dynamically sized arrays with UBSan. - Add LKDTM test for stuck CPUs (Mark Rutland) - Improve LKDTM selftest behavior under UBSan (Ricardo Cañuelo) - Refactor more 1-element arrays into flexible arrays (Gustavo A. R. Silva) - Analyze and replace strlcpy and strncpy uses (Justin Stitt, Azeem Shaikh) - Convert group_info.usage to refcount_t (Elena Reshetova) - Add __counted_by annotations (Kees Cook, Gustavo A. R. Silva) - Add Kconfig fragment for basic hardening options (Kees Cook, Lukas Bulwahn) - Fix randstruct GCC plugin performance mode to stay in groups (Kees Cook) - Fix strtomem() compile-time check for small sources (Kees Cook)" * tag 'hardening-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: (56 commits) hwmon: (acpi_power_meter) replace open-coded kmemdup_nul reset: Annotate struct reset_control_array with __counted_by kexec: Annotate struct crash_mem with __counted_by virtio_console: Annotate struct port_buffer with __counted_by ima: Add __counted_by for struct modsig and use struct_size() MAINTAINERS: Include stackleak paths in hardening entry string: Adjust strtomem() logic to allow for smaller sources hardening: x86: drop reference to removed config AMD_IOMMU_V2 randstruct: Fix gcc-plugin performance mode to stay in group mailbox: zynqmp: Annotate struct zynqmp_ipi_pdata with __counted_by drivers: thermal: tsens: Annotate struct tsens_priv with __counted_by irqchip/imx-intmux: Annotate struct intmux_data with __counted_by KVM: Annotate struct kvm_irq_routing_table with __counted_by virt: acrn: Annotate struct vm_memory_region_batch with __counted_by hwmon: Annotate struct gsc_hwmon_platform_data with __counted_by sparc: Annotate struct cpuinfo_tree with __counted_by isdn: kcapi: replace deprecated strncpy with strscpy_pad isdn: replace deprecated strncpy with strscpy NFS/flexfiles: Annotate struct nfs4_ff_layout_segment with __counted_by nfs41: Annotate struct nfs4_file_layout_dsaddr with __counted_by ... commit 015185cc670e8cb3325990dd41b1ddb502dd3a36 Author: Ben Skeggs Date: Tue Sep 19 06:21:49 2023 +1000 drm/nouveau/ofa/r535: initial support Adds support for allocating OFA classes from RM. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-45-skeggsb@gmail.com commit ca9686340aba42e8316202c428ef76a304bed75a Author: Ben Skeggs Date: Tue Sep 19 06:21:48 2023 +1000 drm/nouveau/nvjpg/r535: initial support Adds support for allocating NVJPG classes from RM. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-44-skeggsb@gmail.com commit 08ab88f5a033c67625272eda99de4d245809e0f6 Author: Ben Skeggs Date: Tue Sep 19 06:21:47 2023 +1000 drm/nouveau/nvenc/r535: initial support Adds support for allocating VIDEO_ENCODER classes from RM. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-43-skeggsb@gmail.com commit 142cd60243cac1dfa18d3714ed4dd0cdc3786180 Author: Ben Skeggs Date: Tue Sep 19 06:21:46 2023 +1000 drm/nouveau/nvdec/r535: initial support Adds support for allocating VIDEO_DECODER classes from RM. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-42-skeggsb@gmail.com commit 361c3cd8ae1277e601ab6e547cc62368dc5499a7 Author: Ben Skeggs Date: Tue Sep 19 06:21:45 2023 +1000 drm/nouveau/gr/r535: initial support Adds support for allocating GR classes from RM. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-41-skeggsb@gmail.com commit b5ce219ab368bbb430f9f59a3e0b8f05bc7354ae Author: Ben Skeggs Date: Tue Sep 19 06:21:44 2023 +1000 drm/nouveau/ce/r535: initial support Adds support for allocating DMA_COPY classes from RM. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-40-skeggsb@gmail.com commit 2a77d015b538866d6fbc90681e8da2dc7c5ff90b Author: Ben Skeggs Date: Tue Sep 19 06:21:43 2023 +1000 drm/nouveau/fifo/r535: initial support - Adds support for allocating CHANNEL_GPFIFO classes from RM. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-39-skeggsb@gmail.com commit 9e99444490238d210a421cef3598432c5da2e086 Author: Ben Skeggs Date: Tue Sep 19 06:21:42 2023 +1000 drm/nouveau/disp/r535: initial support Adds support for modesetting on RM. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-38-skeggsb@gmail.com commit 5bf0257136a223d0e887441799527b320fc8313f Author: Ben Skeggs Date: Tue Sep 19 06:21:41 2023 +1000 drm/nouveau/mmu/r535: initial support - Valid VRAM regions are read from GSP-RM, and used to construct our MM - BAR1/BAR2 VMMs modified to be shared with RM - Client VMMs have RM VASPACE objects created for them - Adds FBSR to backup system objects in VRAM across suspend Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-37-skeggsb@gmail.com commit 830531e94712973af2eee1c0b731de8426aa5b70 Author: Ben Skeggs Date: Tue Sep 19 06:21:40 2023 +1000 drm/nouveau/gsp/r535: add interrupt handling Fetches the interrupt table from RM, and hooks up the GSP interrupt handler to message queue processing to catch async messages. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-36-skeggsb@gmail.com commit 37e328a17c1f4f6dded7354fd9afa1fa5c74854a Author: Ben Skeggs Date: Tue Sep 19 06:21:39 2023 +1000 drm/nouveau/gsp/r535: add support for rm alloc Adds the plumbing to be able to allocate and free RM objects, and implements RM client/device/subdevice allocation with it. These will be used by subsequent patches. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-35-skeggsb@gmail.com commit 4cf2c83eb3a4c42aebe31f4767c3db5788d362ea Author: Ben Skeggs Date: Tue Sep 19 06:21:38 2023 +1000 drm/nouveau/gsp/r535: add support for rm control Adds the plumbing to start making RM control calls, and initialises objects to represent internal RM objects provided to us during init. These will be used by subsequent patches. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-34-skeggsb@gmail.com commit 176fdcbddfd288408ce8571c1760ad618d962096 Author: Ben Skeggs Date: Tue Sep 19 06:21:37 2023 +1000 drm/nouveau/gsp/r535: add support for booting GSP-RM This commit adds the initial code needed to boot the GSP-RM firmware provided by NVIDIA, bringing with it the beginnings of Ada support. Until it's had more testing and time to bake, support is disabled by default (except on Ada). GSP-RM usage can be enabled by passing the "config=NvGspRm=1" module option. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-33-skeggsb@gmail.com commit 17a74021a339a4d4bd27be1dd95b99442455a4ad Author: Ben Skeggs Date: Tue Sep 19 06:21:36 2023 +1000 drm/nouveau/nvkm: support loading fws into sg_table - preparation for GSP-RM, which has massive FW images - based on a patch by Dave Airlie Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-32-skeggsb@gmail.com commit e672f5f30dd37460702ea7797d3d4591f8b5773c Author: Ben Skeggs Date: Tue Sep 19 06:21:35 2023 +1000 drm/nouveau/kms/tu102-: disable vbios parsing when running on RM - on HW, parts of this will still be used to support LVDS - LVDS appears to have dissapeared before Turing, so this won't be needed at all when running on RM Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-31-skeggsb@gmail.com commit f4032134b4612b8f40e793e2cf5be2e0a317f4c9 Author: Ben Skeggs Date: Tue Sep 19 06:21:34 2023 +1000 drm/nouveau/sec2/tu102-: prepare for GSP-RM - add (initial) R535 implementation of SEC2, needed for boot Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-30-skeggsb@gmail.com commit 47c9136b0dae802b0e44412cea97e8a47ae6f0ec Author: Ben Skeggs Date: Tue Sep 19 06:21:33 2023 +1000 drm/nouveau/nvenc/tu102-: prepare for GSP-RM - (temporarily) disable if GSP-RM detected, will be added later - provide empty class list for non-GSP paths - split tu102 from gm107, it will provide host classes later Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-29-skeggsb@gmail.com commit 796928c6592722321324c02111590a39307b1d94 Author: Ben Skeggs Date: Tue Sep 19 06:21:32 2023 +1000 drm/nouveau/nvdec/tu102-: prepare for GSP-RM - (temporarily) disable if GSP-RM detected, will be added later - provide empty class list for non-GSP paths - split tu102- from gm107, they will provide host classes later - fixup HW engine instance masks Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-28-skeggsb@gmail.com commit a6f992a83f0d7ae8ef9355bcd12cc0baa9d49f2f Author: Ben Skeggs Date: Tue Sep 19 06:21:31 2023 +1000 drm/nouveau/gr/tu102-: prepare for GSP-RM - (temporarily) disable if GSP-RM detected, will be added later - make init() optional Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-27-skeggsb@gmail.com commit da1fbcc09e0fec7ad8981b56d2f7634bc8241742 Author: Ben Skeggs Date: Tue Sep 19 06:21:30 2023 +1000 drm/nouveau/fifo/tu102-: prepare for GSP-RM - (temporarily) disable if GSP-RM detected, will be added later - add dtor() so GSP-RM paths can cleanup properly - add alternate engine context mapping interface for RM engines - add alternate chid interfaces to handle RM USERD oddities Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-26-skeggsb@gmail.com commit 8c186c83f995d81bf5761c30872e5fc525feb84f Author: Ben Skeggs Date: Tue Sep 19 06:21:29 2023 +1000 drm/nouveau/disp/tu102-: prepare for GSP-RM - (temporarily) disable if GSP-RM detected, will be added later - pass "suspend" flag down to chipset-specific DISP code Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-25-skeggsb@gmail.com commit 0e55453fc8ab1dac5b3dc8b2de55789009f175b1 Author: Ben Skeggs Date: Tue Sep 19 06:21:28 2023 +1000 drm/nouveau/ce/tu102-: prepare for GSP-RM - (temporarily) disable if GSP-RM detected, will be added later Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-24-skeggsb@gmail.com commit 426cce57053c5504f24d09db99cb3d500bf3e2ba Author: Ben Skeggs Date: Tue Sep 19 06:21:27 2023 +1000 drm/nouveau/vfn/tu102-: prepare for GSP-RM - add R535 implementation of VFN, minus interrupt table Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-23-skeggsb@gmail.com commit d4c9cd346fcb3d61fa975a98746dc1ccd93482c6 Author: Ben Skeggs Date: Tue Sep 19 06:21:26 2023 +1000 drm/nouveau/top/tu102-: prepare for GSP-RM - disable TOP completely when GSP-RM detected Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-22-skeggsb@gmail.com commit f2b76a18251d08aae035288190c562b28da9bf35 Author: Ben Skeggs Date: Tue Sep 19 06:21:25 2023 +1000 drm/nouveau/therm/tu102-: prepare for GSP-RM - disable THERM completely when GSP-RM detected Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-21-skeggsb@gmail.com commit fd7d598270724cc787982ea48bbe17ad383a8b7f Author: Ben Skeggs Date: Tue Sep 19 06:21:24 2023 +1000 drm/nouveau/privring/tu102-: prepare for GSP-RM - disable PRIVRING completely when GSP-RM detected Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-20-skeggsb@gmail.com commit ab724be7a3d9ae47e80938ad00b111a62bf4266b Author: Ben Skeggs Date: Tue Sep 19 06:21:23 2023 +1000 drm/nouveau/pmu/tu102-: prepare for GSP-RM - disable PMU completely when GSP-RM detected Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-19-skeggsb@gmail.com commit f5a533a81e51d963bd267acc08dd1924bd93503e Author: Ben Skeggs Date: Tue Sep 19 06:21:22 2023 +1000 drm/nouveau/mmu/tu102-: prepare for GSP-RM - (temporarily) disable if GSP-RM detected, will be added later Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-18-skeggsb@gmail.com commit 3cd7924e0eddfd525ea532397932005d0ff2686b Author: Ben Skeggs Date: Tue Sep 19 06:21:21 2023 +1000 drm/nouveau/mc/tu102-: prepare for GSP-RM - disable MC completely when GSP-RM detected Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-17-skeggsb@gmail.com commit 1dc750dab1b14ac526c5192964176e756770a33d Author: Ben Skeggs Date: Tue Sep 19 06:21:20 2023 +1000 drm/nouveau/ltc/tu102-: prepare for GSP-RM - disable LTC completely when GSP-RM detected Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-16-skeggsb@gmail.com commit 624c6f78cc8d9d1a87eeb4d905f231ea128f4a4f Author: Ben Skeggs Date: Tue Sep 19 06:21:19 2023 +1000 drm/nouveau/imem/tu102-: prepare for GSP-RM - move suspend/resume paths to HW-specific code - allow (future) RM paths to be based on nv50_instmem Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-15-skeggsb@gmail.com commit a25a5d560dada2d2edec1891bf1a89c12d9808ad Author: Ben Skeggs Date: Tue Sep 19 06:21:18 2023 +1000 drm/nouveau/i2c/tu102-: prepare for GSP-RM - disable I2C completely when GSP-RM detected Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-14-skeggsb@gmail.com commit 2cfad4b0489cc13a1f980782ca4af070e2675128 Author: Ben Skeggs Date: Tue Sep 19 06:21:17 2023 +1000 drm/nouveau/gpio/tu102-: prepare for GSP-RM - disable GPIO completely when GSP-RM detected Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-13-skeggsb@gmail.com commit c41aebc9aca41116c40e6fabce1d52250fc91b36 Author: Ben Skeggs Date: Tue Sep 19 06:21:16 2023 +1000 drm/nouveau/fuse/tu102-: prepare for GSP-RM - disable FUSE completely when GSP-RM detected Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-12-skeggsb@gmail.com commit 834a712b6ed2f5ae83ad0a0b038d0a3e1782abbb Author: Ben Skeggs Date: Tue Sep 19 06:21:15 2023 +1000 drm/nouveau/fb/tu102-: prepare for GSP-RM - add (initial) R535 implementation of FB, need VRAM size etc for boot - expose a way to "wrap" vram at a specific address/size as a standard nvkm_memory allocation, which will be used to write PTEs etc for RM- defined memory regions Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-11-skeggsb@gmail.com commit a613e7f3fe6d4be5e19429f28c21178ca74c3b56 Author: Ben Skeggs Date: Tue Sep 19 06:21:14 2023 +1000 drm/nouveau/fault/tu102-: prepare for GSP-RM - disable FAULT completely when GSP-RM detected - SVM support will be disabled when running on RM because of this Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-10-skeggsb@gmail.com commit 15740541e8f0b2b966e718fa6d384b1818ebe555 Author: Ben Skeggs Date: Tue Sep 19 06:21:13 2023 +1000 drm/nouveau/devinit/tu102-: prepare for GSP-RM - add R535 implementation of DEVINIT, we need some of this for boot - add display disable fuse for ga100- Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-9-skeggsb@gmail.com commit 6a0fd03a23fd833c98277701bedb6e7f25df22bd Author: Ben Skeggs Date: Tue Sep 19 06:21:12 2023 +1000 drm/nouveau/bus/tu102-: prepare for GSP-RM - disable BUS completely when GSP-RM detected Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-8-skeggsb@gmail.com commit 45655ff0848040f09e4a4f812fe4aa79e1363624 Author: Ben Skeggs Date: Tue Sep 19 06:21:11 2023 +1000 drm/nouveau/bar/tu102-: prepare for GSP-RM - (temporarily) disable if GSP-RM detected, will be added later - move BAR2 teardown from dtor(), it doesn't belong there Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-7-skeggsb@gmail.com commit 74e2011b11e0427908ff4e6a106f9ab96641cdd8 Author: Ben Skeggs Date: Tue Sep 19 06:21:10 2023 +1000 drm/nouveau/acr/tu102-: prepare for GSP-RM - disable ACR completely when GSP-RM detected Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-6-skeggsb@gmail.com commit 015ef6187f69eca7d9029e3f8e358a86041e403a Author: Ben Skeggs Date: Tue Sep 19 06:21:09 2023 +1000 drm/nouveau/gsp: prepare for GSP-RM - move TOP after GSP, so we can disable TOP if GSP is in use - provide plumbing to support falcon-only and GSP-RM paths - provide a method for subdevs to detect GSP-RM paths - split tu102/tu116/ga100 paths from gv100, which can't support GSP-RM Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-5-skeggsb@gmail.com commit e866927013557aa4562cd4ddf55433a64e3cab4f Author: Ben Skeggs Date: Tue Sep 19 06:21:08 2023 +1000 drm/nouveau/nvkm: bump maximum number of NVJPG RM (and GH100) support 8 NVJPG instances. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-4-skeggsb@gmail.com commit 7e731d42aee7876f5b74518f875508e412c40eca Author: Ben Skeggs Date: Tue Sep 19 06:21:07 2023 +1000 drm/nouveau/nvkm: bump maximum number of NVDEC RM (and GH100) support 8 NVDEC instances. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-3-skeggsb@gmail.com commit 743b7fc481f9e844c374bb51986f0d4db8a684a0 Author: Ben Skeggs Date: Tue Sep 19 06:21:06 2023 +1000 drm/nouveau/mmu/tu102-: remove write to 0x100e68 during tlb invalidate This was cargo-culted from traces of RM when the code was written, but we probably shouldn't be touching NV_PFB regs while GSP-RM is running. From traces, it looks like NVIDIA dropped this sometime between 510.54 and 515.48.07, so I guess we can too. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-2-skeggsb@gmail.com commit fdce8bd38037a4a2b2961ca4abffaab195690b30 Merge: 2656821f1f202 90f055df11216 Author: Linus Torvalds Date: Mon Oct 30 19:03:30 2023 -1000 Merge tag 'slab-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab Pull slab updates from Vlastimil Babka: - SLUB: slab order calculation refactoring (Vlastimil Babka, Feng Tang) Recent proposals to tune the slab order calculations have prompted us to look at the current code and refactor it to make it easier to follow and eliminate some odd corner cases. The refactoring is mostly non-functional changes, but should make the actual tuning easier to implement and review. * tag 'slab-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: mm/slub: refactor calculate_order() and calc_slab_order() mm/slub: attempt to find layouts up to 1/2 waste in calculate_order() mm/slub: remove min_objects loop from calculate_order() mm/slub: simplify the last resort slab order calculation mm/slub: add sanity check for slub_min/max_order cmdline setup commit 2656821f1f202d58224551b71eff41aafd1edf8b Merge: 9a0f53e0cfc2e d97ae6474ca04 Author: Linus Torvalds Date: Mon Oct 30 18:01:41 2023 -1000 Merge tag 'rcu-next-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks Pull RCU updates from Frederic Weisbecker: - RCU torture, locktorture and generic torture infrastructure updates that include various fixes, cleanups and consolidations. Among the user visible things, ftrace dumps can now be found into their own file, and module parameters get better documented and reported on dumps. - Generic and misc fixes all over the place. Some highlights: * Hotplug handling has seen some light cleanups and comments * An RCU barrier can now be triggered through sysfs to serialize memory stress testing and avoid OOM * Object information is now dumped in case of invalid callback invocation * Also various SRCU issues, too hard to trigger to deserve urgent pull requests, have been fixed - RCU documentation updates - RCU reference scalability test minor fixes and doc improvements. - RCU tasks minor fixes - Stall detection updates. Introduce RCU CPU Stall notifiers that allows a subsystem to provide informations to help debugging. Also cure some false positive stalls. * tag 'rcu-next-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks: (56 commits) srcu: Only accelerate on enqueue time locktorture: Check the correct variable for allocation failure srcu: Fix callbacks acceleration mishandling rcu: Comment why callbacks migration can't wait for CPUHP_RCUTREE_PREP rcu: Standardize explicit CPU-hotplug calls rcu: Conditionally build CPU-hotplug teardown callbacks rcu: Remove references to rcu_migrate_callbacks() from diagrams rcu: Assume rcu_report_dead() is always called locally rcu: Assume IRQS disabled from rcu_report_dead() rcu: Use rcu_segcblist_segempty() instead of open coding it rcu: kmemleak: Ignore kmemleak false positives when RCU-freeing objects srcu: Fix srcu_struct node grpmask overflow on 64-bit systems torture: Convert parse-console.sh to mktemp rcutorture: Traverse possible cpu to set maxcpu in rcu_nocb_toggle() rcutorture: Replace schedule_timeout*() 1-jiffy waits with HZ/20 torture: Add kvm.sh --debug-info argument locktorture: Rename readers_bind/writers_bind to bind_readers/bind_writers doc: Catch-up update for locktorture module parameters locktorture: Add call_rcu_chains module parameter locktorture: Add new module parameters to lock_torture_print_module_parms() ... commit 9a0f53e0cfc2ef262c05b8e4ab89e7f2accaf96c Merge: 6750f0de53b7d 94b3f0b5af2c7 Author: Linus Torvalds Date: Mon Oct 30 17:56:53 2023 -1000 Merge tag 'csd-lock.2023.10.23a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull CSD lock update from Paul McKenney: "This adds a kernel boot parameter that causes the kernel to panic if one of the call_smp_function() APIs is stalled for more than the specified duration. This is useful in deployments in which a clean panic is preferable to an indefinite stall" * tag 'csd-lock.2023.10.23a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: smp,csd: Throw an error if a CSD lock is stuck for too long commit 6750f0de53b7d64a4deffa62944ea431a153ec48 Merge: c9049984f0e47 1566bf4b13daa Author: Linus Torvalds Date: Mon Oct 30 17:54:43 2023 -1000 Merge tag 'lkmm.2023.10.28a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull Linux Kernel Memory Model updates from Paul McKenney: "This update adds paragraphs to the portions of memory-barriers.txt that have been marked historical due to changes in the way that the Linux kernel handles DEC Alpha. These paragraphs includes information on where to find the corresponding up-to-date information" * tag 'lkmm.2023.10.28a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: docs: memory-barriers: Add note on compiler transformation and address deps commit c9049984f0e470af865c497c7f785fe895e5da9c Merge: eb55307e6716b b8c60e8fc6f75 Author: Linus Torvalds Date: Mon Oct 30 17:52:45 2023 -1000 Merge tag 'nolibc.2023.10.23a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull nolibc updates from Paul McKenney: - Add stdarg.h header and a few additional system-call upgrades - Add support for constructors and destructors - Add tests to verify the ability to link multiple .o files against nolibc - Numerous string-function optimizations and improvements - Prevent redundant kernel relinks by avoiding embedding of initramfs into the kernel image - Allow building i386 with multiarch compiler and make ppc64le use qemu-system-ppc64 - Miscellaneous fixups, including addition of -nostdinc for nolibc-test, avoiding -Wstringop-overflow warnings, and avoiding unused parameter warnings for ENOSYS fallbacks * tag 'nolibc.2023.10.23a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: selftests/nolibc: add tests for multi-object linkage selftests/nolibc: use qemu-system-ppc64 for ppc64le tools/nolibc: add support for constructors and destructors tools/nolibc: drop test for getauxval(AT_PAGESZ) tools/nolibc: automatically detect necessity to use pselect6 tools/nolibc: don't define new syscall number tools/nolibc: avoid unused parameter warnings for ENOSYS fallbacks selftests/nolibc: allow building i386 with multiarch compiler selftests/nolibc: don't embed initramfs into kernel image selftests/nolibc: libc-test: avoid -Wstringop-overflow warnings tools/nolibc: string: Remove the `_nolibc_memcpy_up()` function tools/nolibc: string: Remove the `_nolibc_memcpy_down()` function tools/nolibc: x86-64: Use `rep stosb` for `memset()` tools/nolibc: x86-64: Use `rep movsb` for `memcpy()` and `memmove()` selftests/nolibc: use -nostdinc for nolibc-test tools/nolibc: add stdarg.h header commit eb55307e6716b1a02f7db05e27d60e8ca2289c03 Merge: 943af0e73a370 92fe9bb77b0c9 Author: Linus Torvalds Date: Mon Oct 30 17:37:47 2023 -1000 Merge tag 'x86-core-2023-10-29-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 core updates from Thomas Gleixner: - Limit the hardcoded topology quirk for Hygon CPUs to those which have a model ID less than 4. The newer models have the topology CPUID leaf 0xB correctly implemented and are not affected. - Make SMT control more robust against enumeration failures SMT control was added to allow controlling SMT at boottime or runtime. The primary purpose was to provide a simple mechanism to disable SMT in the light of speculation attack vectors. It turned out that the code is sensible to enumeration failures and worked only by chance for XEN/PV. XEN/PV has no real APIC enumeration which means the primary thread mask is not set up correctly. By chance a XEN/PV boot ends up with smp_num_siblings == 2, which makes the hotplug control stay at its default value "enabled". So the mask is never evaluated. The ongoing rework of the topology evaluation caused XEN/PV to end up with smp_num_siblings == 1, which sets the SMT control to "not supported" and the empty primary thread mask causes the hotplug core to deny the bringup of the APS. Make the decision logic more robust and take 'not supported' and 'not implemented' into account for the decision whether a CPU should be booted or not. - Fake primary thread mask for XEN/PV Pretend that all XEN/PV vCPUs are primary threads, which makes the usage of the primary thread mask valid on XEN/PV. That is consistent with because all of the topology information on XEN/PV is fake or even non-existent. - Encapsulate topology information in cpuinfo_x86 Move the randomly scattered topology data into a separate data structure for readability and as a preparatory step for the topology evaluation overhaul. - Consolidate APIC ID data type to u32 It's fixed width hardware data and not randomly u16, int, unsigned long or whatever developers decided to use. - Cure the abuse of cpuinfo for persisting logical IDs. Per CPU cpuinfo is used to persist the logical package and die IDs. That's really not the right place simply because cpuinfo is subject to be reinitialized when a CPU goes through an offline/online cycle. Use separate per CPU data for the persisting to enable the further topology management rework. It will be removed once the new topology management is in place. - Provide a debug interface for inspecting topology information Useful in general and extremly helpful for validating the topology management rework in terms of correctness or "bug" compatibility. * tag 'x86-core-2023-10-29-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits) x86/apic, x86/hyperv: Use u32 in hv_snp_boot_ap() too x86/cpu: Provide debug interface x86/cpu/topology: Cure the abuse of cpuinfo for persisting logical ids x86/apic: Use u32 for wakeup_secondary_cpu[_64]() x86/apic: Use u32 for [gs]et_apic_id() x86/apic: Use u32 for phys_pkg_id() x86/apic: Use u32 for cpu_present_to_apicid() x86/apic: Use u32 for check_apicid_used() x86/apic: Use u32 for APIC IDs in global data x86/apic: Use BAD_APICID consistently x86/cpu: Move cpu_l[l2]c_id into topology info x86/cpu: Move logical package and die IDs into topology info x86/cpu: Remove pointless evaluation of x86_coreid_bits x86/cpu: Move cu_id into topology info x86/cpu: Move cpu_core_id into topology info hwmon: (fam15h_power) Use topology_core_id() scsi: lpfc: Use topology_core_id() x86/cpu: Move cpu_die_id into topology info x86/cpu: Move phys_proc_id into topology info x86/cpu: Encapsulate topology information in cpuinfo_x86 ... commit 943af0e73a370b0c856340fd873c140e42822ec7 Merge: 63a3f11975997 b56ebe7c896dc Author: Linus Torvalds Date: Mon Oct 30 17:27:56 2023 -1000 Merge tag 'x86-apic-2023-10-29-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 APIC updates from Thomas Gleixner: - Make the quirk for non-maskable MSI interrupts in the affinity setter functional again. It was broken by a MSI core code update, which restructured the code in a way that the quirk flag was not longer set correctly. Trying to restore the core logic caused a deeper inspection and it turned out that the extra quirk flag is not required at all because it's the inverse of the reservation mode bit, which only can be set when the MSI interrupt is maskable. So the trivial fix is to use the reservation mode check in the affinity setter function and remove almost 40 lines of code related to the no-mask quirk flag. - Cure a Kconfig dependency issue which causes compile failures by correcting the conditionals in the affected header files. - Clean up coding style in the UV APIC driver. * tag 'x86-apic-2023-10-29-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/apic/msi: Fix misconfigured non-maskable MSI quirk x86/msi: Fix compile error caused by CONFIG_GENERIC_MSI_IRQ=y && !CONFIG_X86_LOCAL_APIC x86/platform/uv/apic: Clean up inconsistent indenting commit 63a3f11975997e0851b108b49d7b5f4e84a18d08 Merge: c891e98ab32d5 f4febfdbb45ad Author: Linus Torvalds Date: Mon Oct 30 17:25:41 2023 -1000 Merge tag 'timers-core-2023-10-29-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer updates from Thomas Gleixner: "Updates for time, timekeeping and timers: Core: - Avoid superfluous deactivation of the tick in the low resolution tick NOHZ interrupt handler as the deactivation is handled already in the idle loop and on interrupt exit. - Update stale comments in the tick NOHZ code and rename the tick handler functions to be self-explanatory. - Remove an unused function in the tick NOHZ code, which was forgotten when the last user went away. - Handle RTC alarms which exceed the maximum alarm time of the underlying RTC hardware gracefully. Setting RTC alarms which exceed the maximum alarm time of the RTC hardware failed so far and caused suspend operations to abort. Cure this by limiting the alarm to the maximum alarm time of the RTC hardware, which is provided by the driver. This causes early resume wakeups, but that's way better than not suspending at all. Drivers: - Add a proper clocksource/event driver for the ancient Cirrus Logic EP93xx SoC family, which is one of the last non device-tree holdouts in arch/arm. - The usual boring device tree bindings updates and small fixes and enhancements all over the place" * tag 'timers-core-2023-10-29-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clocksource: ep93xx: Add driver for Cirrus Logic EP93xx dt-bindings: timers: Add Cirrus EP93xx clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware clocksource/timer-riscv: ACPI: Add timer_cannot_wakeup_cpu clocksource/drivers/sun5i: Remove surplus dev_err() when using platform_get_irq() drivers/clocksource/timer-ti-dm: Don't call clk_get_rate() in stop function clocksource/drivers/timer-imx-gpt: Fix potential memory leak dt-bindings: timer: renesas,rz-mtu3: Document RZ/{G2UL,Five} SoCs dt-bindings: timer: renesas,rz-mtu3: Improve documentation dt-bindings: timer: renesas,rz-mtu3: Fix overflow/underflow interrupt names alarmtimer: Use maximum alarm time for suspend rtc: Add API function to return alarm time bound by hardware limit tick/nohz: Update comments some more tick/nohz: Remove unused tick_nohz_idle_stop_tick_protected() tick/nohz: Don't shutdown the lowres tick from itself tick/nohz: Update obsolete comments tick/nohz: Rename the tick handlers to more self-explanatory names commit c891e98ab32d55b25d87e380d919c279a8b228e0 Merge: b08eccef9fa05 38685e2a04761 Author: Linus Torvalds Date: Mon Oct 30 17:12:36 2023 -1000 Merge tag 'smp-core-2023-10-29-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull SMP and CPU hotplug updates from Thomas Gleixner: - Switch the smp_call_function*() @csd argument to call_single_data_t type, which is a cache-line aligned typedef of the underlying struct __call_single_data. This ensures that the call data is not crossing a cacheline which avoids bouncing an extra cache-line for the SMP function call - Prevent offlining of the last housekeeping CPU when CPU isolation is active. Offlining the last housekeeping CPU makes no sense in general, but also caused the scheduler to panic due to the empty CPU mask when rebuilding the scheduler domains. - Remove an unused CPU hotplug state * tag 'smp-core-2023-10-29-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: cpu/hotplug: Don't offline the last non-isolated CPU cpu/hotplug: Remove unused cpuhp_state CPUHP_AP_X86_VDSO_VMA_ONLINE smp: Change function signatures to use call_single_data_t commit b08eccef9fa05f8e14fe180d55d603447c76a992 Merge: 9cc6fea175e41 f99b926f6543f Author: Linus Torvalds Date: Mon Oct 30 17:07:19 2023 -1000 Merge tag 'irq-core-2023-10-29-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq updates from Thomas Gleixner: "Core: - Exclude managed interrupts in the calculation of interrupts which are targeted to a CPU which is about to be offlined to ensure that there are enough free vectors on the still online CPUs to migrate them over. Managed interrupts do not need to be accounted because they are either shut down on offline or migrated to an already reserved and guaranteed slot on a still online CPU in the interrupts affinity mask. Including managed interrupts is overaccounting and can result in needlessly aborting hibernation on large server machines. - The usual set of small improvements Drivers: - Make the generic interrupt chip implementation handle interrupt domains correctly and initialize the name pointers correctly - Add interrupt affinity setting support to the Renesas RZG2L chip driver. - Prevent registering syscore operations multiple times in the SiFive PLIC chip driver. - Update device tree handling in the NXP Layerscape MSI chip driver" * tag 'irq-core-2023-10-29-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/sifive-plic: Fix syscore registration for multi-socket systems irqchip/ls-scfg-msi: Use device_get_match_data() genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() PCI/MSI: Provide stubs for IMS functions irqchip/renesas-rzg2l: Enhance driver to support interrupt affinity setting genirq/generic-chip: Fix the irq_chip name for /proc/interrupts irqdomain: Annotate struct irq_domain with __counted_by commit 9cc6fea175e41580000419a90fa744ba46aa4722 Merge: ecb8cd2a9f7af 1aabbc532413c Author: Linus Torvalds Date: Mon Oct 30 17:03:32 2023 -1000 Merge tag 'core-core-2023-10-29-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull core updates from Thomas Gleixner: "Two small updates to ptrace_stop(): - Add a comment to explain that the preempt_disable() before unlocking tasklist lock is not a correctness problem and just avoids the tracer to preempt the tracee before the tracee schedules out. - Make that preempt_disable() conditional on PREEMPT_RT=n. RT enabled kernels cannot disable preemption at this point because cgroup_enter_frozen() and sched_submit_work() acquire spinlocks or rwlocks which are substituted by sleeping locks on RT. Acquiring a sleeping lock in a preemption disable region is obviously not possible. This obviously brings back the potential slowdown of ptrace() for RT enabled kernels, but that's a price to be paid for latency guarantees" * tag 'core-core-2023-10-29-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: signal: Don't disable preemption in ptrace_stop() on PREEMPT_RT signal: Add a proper comment about preempt_disable() in ptrace_stop() commit 67797da8a4b82446d42c52b6ee1419a3100d78ff Author: Namjae Jeon Date: Sun Oct 29 20:58:28 2023 +0900 ksmbd: no need to wait for binded connection termination at logoff The connection could be binded to the existing session for Multichannel. session will be destroyed when binded connections are released. So no need to wait for that's connection at logoff. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 631808095a82e6b6f8410a95f8b12b8d0d38b161 Merge: 915b6d034b544 dd3dd9829bf9a Author: Dave Airlie Date: Tue Oct 31 12:36:55 2023 +1000 Merge tag 'amd-drm-next-6.7-2023-10-27' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-6.7-2023-10-27: amdgpu: - RAS fixes - Seamless boot fixes - NBIO 7.7 fix - SMU 14.0 fixes - GC 11.5 fixes - DML2 fixes - ASPM fixes - VPE fixes - Misc code cleanups - SRIOV fixes - Add some missing copyright notices - DCN 3.5 fixes - FAMS fixes - Backlight fix - S/G display fix - fdinfo cleanups - EXT_COHERENT fixes for APU and NUMA systems amdkfd: - Misc fixes - Misc code cleanups - SVM fixes Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20231027200343.57132-1-alexander.deucher@amd.com commit 20e425d301d673dbd5df0c9d4b186c70b43813bb Author: Kent Overstreet Date: Sun Feb 5 16:18:59 2023 -0500 six locks: Lock contended tracepoints Signed-off-by: Kent Overstreet commit ecb8cd2a9f7af7f99a6d4fa0a5a31822f6cfe255 Merge: f0d25b5d0f8ef 70c8dc9104275 Author: Linus Torvalds Date: Mon Oct 30 16:10:06 2023 -1000 Merge tag 'x86-build-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 build update from Ingo Molnar: "Enable CONFIG_DEBUG_ENTRY=y in the x86 defconfigs" * tag 'x86-build-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/defconfig: Enable CONFIG_DEBUG_ENTRY=y commit ee526b88caaa4b4182144bf2576af2c3b1e9c759 Author: Kent Overstreet Date: Tue Oct 24 14:46:58 2023 -0400 closures: Fix race in closure_sync() As pointed out by Linus, closure_sync() was racy; we could skip blocking immediately after a get() and a put(), but then that would skip any barrier corresponding to the other thread's put() barrier. To fix this, always do the full __closure_sync() sequence whenever any get() has happened and the closure might have been used by other threads. Signed-off-by: Kent Overstreet commit 2bce6368c46b835a133f7f4946eea9c4513828dd Author: Kent Overstreet Date: Tue Oct 24 14:46:58 2023 -0400 closures: Better memory barriers atomic_(dec|sub)_return_release() are a thing now - use them. Also, delete the useless barrier in set_closure_fn(): it's redundant with the memory barrier in closure_put(0. Since closure_put() would now otherwise just have a release barrier, we also need a new barrier when the ref hits 0 - smp_acquire__after_ctrl_dep(). Signed-off-by: Kent Overstreet commit f0d25b5d0f8ef0ad35f1beff17da5843279d47a1 Merge: 1641b9b04002c a1e2b8b36820d Author: Linus Torvalds Date: Mon Oct 30 15:40:57 2023 -1000 Merge tag 'x86-mm-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 mm handling updates from Ingo Molnar: - Add new NX-stack self-test - Improve NUMA partial-CFMWS handling - Fix #VC handler bugs resulting in SEV-SNP boot failures - Drop the 4MB memory size restriction on minimal NUMA nodes - Reorganize headers a bit, in preparation to header dependency reduction efforts - Misc cleanups & fixes * tag 'x86-mm-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size selftests/x86/lam: Zero out buffer for readlink() x86/sev: Drop unneeded #include x86/sev: Move sev_setup_arch() to mem_encrypt.c x86/tdx: Replace deprecated strncpy() with strtomem_pad() selftests/x86/mm: Add new test that userspace stack is in fact NX x86/sev: Make boot_ghcb_page[] static x86/boot: Move x86_cache_alignment initialization to correct spot x86/sev-es: Set x86_virt_bits to the correct value straight away, instead of a two-phase approach x86/sev-es: Allow copy_from_kernel_nofault() in earlier boot x86_64: Show CR4.PSE on auxiliaries like on BSP x86/iommu/docs: Update AMD IOMMU specification document URL x86/sev/docs: Update document URL in amd-memory-encryption.rst x86/mm: Move arch_memory_failure() and arch_is_platform_page() definitions from to ACPI/NUMA: Apply SRAT proximity domain to entire CFMWS window x86/numa: Introduce numa_fill_memblks() commit 1641b9b04002c22f616a51a164c04b7f679d241f Merge: ed766c26119c4 f44075ecafb72 Author: Linus Torvalds Date: Mon Oct 30 15:39:38 2023 -1000 Merge tag 'x86-irq-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 irq fix from Ingo Molnar: "Fix out-of-order NMI nesting checks resulting in false positive warnings" * tag 'x86-irq-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/nmi: Fix out-of-order NMI nesting checks & false positive warning commit ed766c26119c4cf9b1f909f045c2eb987180ace3 Merge: 5780e39edbb49 1a09a27153f91 Author: Linus Torvalds Date: Mon Oct 30 15:27:27 2023 -1000 Merge tag 'x86-entry-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 entry updates from Ingo Molnar: - Make IA32_EMULATION boot time configurable with the new ia32_emulation= boot option - Clean up fast syscall return validation code: convert it to C and refactor the code - As part of this, optimize the canonical RIP test code * tag 'x86-entry-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/entry/32: Clean up syscall fast exit tests x86/entry/64: Use TASK_SIZE_MAX for canonical RIP test x86/entry/64: Convert SYSRET validation tests to C x86/entry/32: Remove SEP test for SYSEXIT x86/entry/32: Convert do_fast_syscall_32() to bool return type x86/entry/compat: Combine return value test from syscall handler x86/entry/64: Remove obsolete comment on tracing vs. SYSRET x86: Make IA32_EMULATION boot time configurable x86/entry: Make IA32 syscalls' availability depend on ia32_enabled() x86/elf: Make loading of 32bit processes depend on ia32_enabled() x86/entry: Compile entry_SYSCALL32_ignore() unconditionally x86/entry: Rename ignore_sysret() x86: Introduce ia32_enabled() commit ee785c15b5906a69d4007b4754e8ae40fb41e0b4 Author: Yuezhang Mo Date: Thu Jul 20 14:40:08 2023 +0800 exfat: support create zero-size directory This commit adds mount option 'zero_size_dir'. If this option enabled, don't allocate a cluster to directory when creating it, and set the directory size to 0. On Windows, a cluster is allocated for a directory when it is created, so the mount option is disabled by default. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru Signed-off-by: Namjae Jeon commit dab48b8f2fe7264d51ec9eed0adea0fe3c78830a Author: Yuezhang Mo Date: Thu Jul 20 14:23:08 2023 +0800 exfat: support handle zero-size directory After repairing a corrupted file system with exfatprogs' fsck.exfat, zero-size directories may result. It is also possible to create zero-size directories in other exFAT implementation, such as Paragon ufsd dirver. As described in the specification, the lower directory size limits is 0 bytes. Without this commit, sub-directories and files cannot be created under a zero-size directory, and it cannot be removed. Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru Signed-off-by: Namjae Jeon commit 0ab8ba71868594acfc717b8c7d1738b9118118ec Author: Jan Cincera Date: Mon Oct 30 20:53:18 2023 +0900 exfat: add ioctls for accessing attributes Add GET and SET attributes ioctls to enable attribute modification. We already do this in FAT and a few userspace utils made for it would benefit from this also working on exFAT, namely fatattr. Signed-off-by: Jan Cincera Signed-off-by: Namjae Jeon commit 915b6d034b54425b42705c8772ddb7a121759eb1 Merge: 5258dfd4a6adb b70438004a14f Author: Dave Airlie Date: Tue Oct 31 10:47:49 2023 +1000 Merge tag 'drm-misc-next-2023-10-27' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v6.7-rc1: drm-misc-next-2023-10-19 + following: UAPI Changes: Cross-subsystem Changes: - Convert fbdev drivers to use fbdev i/o mem helpers. Core Changes: - Use cross-references for macros in docs. - Make drm_client_buffer_addb use addfb2. - Add NV20 and NV30 YUV formats. - Documentation updates for create_dumb ioctl. - CI fixes. - Allow variable number of run-queues in scheduler. Driver Changes: - Rename drm/ast constants. - Make ili9882t its own driver. - Assorted fixes in ivpu, vc4, bridge/synopsis, amdgpu. - Add planar formats to rockchip. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/3d92fae8-9b1b-4165-9ca8-5fda11ee146b@linux.intel.com commit 5780e39edbb49bb441f1c8eb9e6cb8be92dee31d Merge: 2b95bb052656d 8ae292c66dcb1 Author: Linus Torvalds Date: Mon Oct 30 14:18:00 2023 -1000 Merge tag 'x86-asm-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 assembly code updates from Ingo Molnar: - Micro-optimize the x86 bitops code - Define target-specific {raw,this}_cpu_try_cmpxchg{64,128}() to improve code generation - Define and use raw_cpu_try_cmpxchg() preempt_count_set() - Do not clobber %rsi in percpu_{try_,}cmpxchg{64,128}_op - Remove the unused __sw_hweight64() implementation on x86-32 - Misc fixes and cleanups * tag 'x86-asm-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/lib: Address kernel-doc warnings x86/entry: Fix typos in comments x86/entry: Remove unused argument %rsi passed to exc_nmi() x86/bitops: Remove unused __sw_hweight64() assembly implementation on x86-32 x86/percpu: Do not clobber %rsi in percpu_{try_,}cmpxchg{64,128}_op x86/percpu: Use raw_cpu_try_cmpxchg() in preempt_count_set() x86/percpu: Define raw_cpu_try_cmpxchg and this_cpu_try_cmpxchg() x86/percpu: Define {raw,this}_cpu_try_cmpxchg{64,128} x86/asm/bitops: Use __builtin_clz{l|ll} to evaluate constant expressions commit 2b95bb052656d46c2073b87f9487a53ef5e79732 Merge: 3b8b4b4fc4135 50dcc2e0d62e3 Author: Linus Torvalds Date: Mon Oct 30 14:11:57 2023 -1000 Merge tag 'x86-boot-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 boot updates from Ingo Molnar: - Rework PE header generation, primarily to generate a modern, 4k aligned kernel image view with narrower W^X permissions. - Further refine init-lifetime annotations - Misc cleanups & fixes * tag 'x86-boot-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits) x86/boot: efistub: Assign global boot_params variable x86/boot: Rename conflicting 'boot_params' pointer to 'boot_params_ptr' x86/head/64: Move the __head definition to x86/head/64: Add missing __head annotation to startup_64_load_idt() x86/head/64: Mark 'startup_gdt[]' and 'startup_gdt_descr' as __initdata x86/boot: Harmonize the style of array-type parameter for fixup_pointer() calls x86/boot: Fix incorrect startup_gdt_descr.size x86/boot: Compile boot code with -std=gnu11 too x86/boot: Increase section and file alignment to 4k/512 x86/boot: Split off PE/COFF .data section x86/boot: Drop PE/COFF .reloc section x86/boot: Construct PE/COFF .text section from assembler x86/boot: Derive file size from _edata symbol x86/boot: Define setup size in linker script x86/boot: Set EFI handover offset directly in header asm x86/boot: Grab kernel_info offset from zoffset header directly x86/boot: Drop references to startup_64 x86/boot: Drop redundant code setting the root device x86/boot: Omit compression buffer from PE/COFF image memory footprint x86/boot: Remove the 'bugger off' message ... commit 3b8b4b4fc4135160f295cf308dfe43c721990356 Merge: bceb7accb7b60 8b01de80306cb Author: Linus Torvalds Date: Mon Oct 30 14:04:23 2023 -1000 Merge tag 'x86-headers-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 header file cleanup from Ingo Molnar: "Replace uses with and then remove " * tag 'x86-headers-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/headers: Remove x86/headers: Replace #include with #include x86/headers: Remove unnecessary #include commit bceb7accb7b60f9844807c7433af06493ed058b7 Merge: cd063c8b9e1e9 744940f1921c8 Author: Linus Torvalds Date: Mon Oct 30 13:44:35 2023 -1000 Merge tag 'perf-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull performance event updates from Ingo Molnar: - Add AMD Unified Memory Controller (UMC) events introduced with Zen 4 - Simplify & clean up the uncore management code - Fall back from RDPMC to RDMSR on certain uncore PMUs - Improve per-package and cstate event reading - Extend the Intel ref-cycles event to GP counters - Fix Intel MTL event constraints - Improve the Intel hybrid CPU handling code - Micro-optimize the RAPL code - Optimize perf_cgroup_switch() - Improve large AUX area error handling - Misc fixes and cleanups * tag 'perf-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (26 commits) perf/x86/amd/uncore: Pass through error code for initialization failures, instead of -ENODEV perf/x86/amd/uncore: Fix uninitialized return value in amd_uncore_init() x86/cpu: Fix the AMD Fam 17h, Fam 19h, Zen2 and Zen4 MSR enumerations perf: Optimize perf_cgroup_switch() perf/x86/amd/uncore: Add memory controller support perf/x86/amd/uncore: Add group exclusivity perf/x86/amd/uncore: Use rdmsr if rdpmc is unavailable perf/x86/amd/uncore: Move discovery and registration perf/x86/amd/uncore: Refactor uncore management perf/core: Allow reading package events from perf_event_read_local perf/x86/cstate: Allow reading the package statistics from local CPU perf/x86/intel/pt: Fix kernel-doc comments perf/x86/rapl: Annotate 'struct rapl_pmus' with __counted_by perf/core: Rename perf_proc_update_handler() -> perf_event_max_sample_rate_handler(), for readability perf/x86/rapl: Fix "Using plain integer as NULL pointer" Sparse warning perf/x86/rapl: Use local64_try_cmpxchg in rapl_event_update() perf/x86/rapl: Stop doing cpu_relax() in the local64_cmpxchg() loop in rapl_event_update() perf/core: Bail out early if the request AUX area is out of bound perf/x86/intel: Extend the ref-cycles event to GP counters perf/x86/intel: Fix broken fixed event constraints extension ... commit cd063c8b9e1e95560e90bac7816234d8b2ee2897 Merge: 63ce50fff9240 60fd39af33d3f Author: Linus Torvalds Date: Mon Oct 30 13:20:02 2023 -1000 Merge tag 'objtool-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool updates from Ingo Molnar: "Misc fixes and cleanups: - Fix potential MAX_NAME_LEN limit related build failures - Fix scripts/faddr2line symbol filtering bug - Fix scripts/faddr2line on LLVM=1 - Fix scripts/faddr2line to accept readelf output with mapping symbols - Minor cleanups" * tag 'objtool-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: scripts/faddr2line: Skip over mapping symbols in output from readelf scripts/faddr2line: Use LLVM addr2line and readelf if LLVM=1 scripts/faddr2line: Don't filter out non-function symbols from readelf objtool: Remove max symbol name length limitation objtool: Propagate early errors objtool: Use 'the fallthrough' pseudo-keyword x86/speculation, objtool: Use absolute relocations for annotations x86/unwind/orc: Remove redundant initialization of 'mid' pointer in __orc_find() commit 63ce50fff9240d66cf3b59663f458f55ba6dcfcc Merge: 3cf3fabccb9dc 984ffb6a43667 Author: Linus Torvalds Date: Mon Oct 30 13:12:15 2023 -1000 Merge tag 'sched-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler updates from Ingo Molnar: "Fair scheduler (SCHED_OTHER) improvements: - Remove the old and now unused SIS_PROP code & option - Scan cluster before LLC in the wake-up path - Use candidate prev/recent_used CPU if scanning failed for cluster wakeup NUMA scheduling improvements: - Improve the VMA access-PID code to better skip/scan VMAs - Extend tracing to cover VMA-skipping decisions - Improve/fix the recently introduced sched_numa_find_nth_cpu() code - Generalize numa_map_to_online_node() Energy scheduling improvements: - Remove the EM_MAX_COMPLEXITY limit - Add tracepoints to track energy computation - Make the behavior of the 'sched_energy_aware' sysctl more consistent - Consolidate and clean up access to a CPU's max compute capacity - Fix uclamp code corner cases RT scheduling improvements: - Drive dl_rq->overloaded with dl_rq->pushable_dl_tasks updates - Drive the ->rto_mask with rt_rq->pushable_tasks updates Scheduler scalability improvements: - Rate-limit updates to tg->load_avg - On x86 disable IBRS when CPU is offline to improve single-threaded performance - Micro-optimize in_task() and in_interrupt() - Micro-optimize the PSI code - Avoid updating PSI triggers and ->rtpoll_total when there are no state changes Core scheduler infrastructure improvements: - Use saved_state to reduce some spurious freezer wakeups - Bring in a handful of fast-headers improvements to scheduler headers - Make the scheduler UAPI headers more widely usable by user-space - Simplify the control flow of scheduler syscalls by using lock guards - Fix sched_setaffinity() vs. CPU hotplug race Scheduler debuggability improvements: - Disallow writing invalid values to sched_rt_period_us - Fix a race in the rq-clock debugging code triggering warnings - Fix a warning in the bandwidth distribution code - Micro-optimize in_atomic_preempt_off() checks - Enforce that the tasklist_lock is held in for_each_thread() - Print the TGID in sched_show_task() - Remove the /proc/sys/kernel/sched_child_runs_first sysctl ... and misc cleanups & fixes" * tag 'sched-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (82 commits) sched/fair: Remove SIS_PROP sched/fair: Use candidate prev/recent_used CPU if scanning failed for cluster wakeup sched/fair: Scan cluster before scanning LLC in wake-up path sched: Add cpus_share_resources API sched/core: Fix RQCF_ACT_SKIP leak sched/fair: Remove unused 'curr' argument from pick_next_entity() sched/nohz: Update comments about NEWILB_KICK sched/fair: Remove duplicate #include sched/psi: Update poll => rtpoll in relevant comments sched: Make PELT acronym definition searchable sched: Fix stop_one_cpu_nowait() vs hotplug sched/psi: Bail out early from irq time accounting sched/topology: Rename 'DIE' domain to 'PKG' sched/psi: Delete the 'update_total' function parameter from update_triggers() sched/psi: Avoid updating PSI triggers and ->rtpoll_total when there are no state changes sched/headers: Remove comment referring to rq::cpu_load, since this has been removed sched/numa: Complete scanning of inactive VMAs when there is no alternative sched/numa: Complete scanning of partial VMAs regardless of PID activity sched/numa: Move up the access pid reset logic sched/numa: Trace decisions related to skipping VMAs ... commit f5deddce60b50b55bcafeebaab1408d203b0f204 Author: Ferry Meng Date: Thu Oct 26 10:16:27 2023 +0800 erofs: tidy up redundant includes - Remove unused includes like and ; - Move common includes into "internal.h". Signed-off-by: Ferry Meng Reviewed-by: Gao Xiang Reviewed-by: Yue Hu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20231026021627.23284-2-mengferry@linux.alibaba.com Signed-off-by: Gao Xiang commit 6b8a113cae6cc517579a33ad484355c3e4b3d8e7 Author: Ferry Meng Date: Thu Oct 26 10:16:26 2023 +0800 erofs: get rid of ROOT_NID() Let's open code this helper for simplicity. Signed-off-by: Ferry Meng Reviewed-by: Gao Xiang Reviewed-by: Yue Hu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20231026021627.23284-1-mengferry@linux.alibaba.com Signed-off-by: Gao Xiang commit efb4fb02cef3ab410b603c8f0e1c67f61d55f542 Author: Gao Xiang Date: Sun Oct 22 21:09:57 2023 +0800 erofs: simplify compression configuration parser Move erofs_load_compr_cfgs() into decompressor.c as well as introduce a callback instead of a hard-coded switch for each algorithm for simplicity. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20231022130957.11398-1-xiang@kernel.org commit 798eecaea0f0366306cbc76986a83041a7e8669f Author: Gao Xiang Date: Sat Oct 21 10:01:37 2023 +0800 erofs: don't warn MicroLZMA format anymore The LZMA algorithm support has been landed for more than one year since Linux 5.16. Besides, the new XZ Utils 5.4 has been available in most Linux distributions. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20231021020137.1646959-1-hsiangkao@linux.alibaba.com commit 3cf3fabccb9dc821ffaec3ad6bf0cd6b278bd012 Merge: 9cda4eb04a68a c73801ae4f22b Author: Linus Torvalds Date: Mon Oct 30 12:38:48 2023 -1000 Merge tag 'locking-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking updates from Info Molnar: "Futex improvements: - Add the 'futex2' syscall ABI, which is an attempt to get away from the multiplex syscall and adds a little room for extentions, while lifting some limitations. - Fix futex PI recursive rt_mutex waiter state bug - Fix inter-process shared futexes on no-MMU systems - Use folios instead of pages Micro-optimizations of locking primitives: - Improve arch_spin_value_unlocked() on asm-generic ticket spinlock architectures, to improve lockref code generation - Improve the x86-32 lockref_get_not_zero() main loop by adding build-time CMPXCHG8B support detection for the relevant lockref code, and by better interfacing the CMPXCHG8B assembly code with the compiler - Introduce arch_sync_try_cmpxchg() on x86 to improve sync_try_cmpxchg() code generation. Convert some sync_cmpxchg() users to sync_try_cmpxchg(). - Micro-optimize rcuref_put_slowpath() Locking debuggability improvements: - Improve CONFIG_DEBUG_RT_MUTEXES=y to have a fast-path as well - Enforce atomicity of sched_submit_work(), which is de-facto atomic but was un-enforced previously. - Extend 's no_free_ptr() with __must_check semantics - Fix ww_mutex self-tests - Clean up const-propagation in and simplify the API-instantiation macros a bit RT locking improvements: - Provide the rt_mutex_*_schedule() primitives/helpers and use them in the rtmutex code to avoid recursion vs. rtlock on the PI state. - Add nested blocking lockdep asserts to rt_mutex_lock(), rtlock_lock() and rwbase_read_lock() .. plus misc fixes & cleanups" * tag 'locking-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits) futex: Don't include process MM in futex key on no-MMU locking/seqlock: Fix grammar in comment alpha: Fix up new futex syscall numbers locking/seqlock: Propagate 'const' pointers within read-only methods, remove forced type casts locking/lockdep: Fix string sizing bug that triggers a format-truncation compiler-warning locking/seqlock: Change __seqprop() to return the function pointer locking/seqlock: Simplify SEQCOUNT_LOCKNAME() locking/atomics: Use atomic_try_cmpxchg_release() to micro-optimize rcuref_put_slowpath() locking/atomic, xen: Use sync_try_cmpxchg() instead of sync_cmpxchg() locking/atomic/x86: Introduce arch_sync_try_cmpxchg() locking/atomic: Add generic support for sync_try_cmpxchg() and its fallback locking/seqlock: Fix typo in comment futex/requeue: Remove unnecessary ‘NULL’ initialization from futex_proxy_trylock_atomic() locking/local, arch: Rewrite local_add_unless() as a static inline function locking/debug: Fix debugfs API return value checks to use IS_ERR() locking/ww_mutex/test: Make sure we bail out instead of livelock locking/ww_mutex/test: Fix potential workqueue corruption locking/ww_mutex/test: Use prng instead of rng to avoid hangs at bootup futex: Add sys_futex_requeue() futex: Add flags2 argument to futex_requeue() ... commit 9cda4eb04a68aee4d795438917a4e958b2b2aa07 Merge: f155f3b3ed1af 90879f5dfcf6c Author: Linus Torvalds Date: Mon Oct 30 12:36:41 2023 -1000 Merge tag 'x86_fpu_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fpu fixlet from Borislav Petkov: - kernel-doc fix * tag 'x86_fpu_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/fpu/xstate: Address kernel-doc warning commit f155f3b3ed1af23884ffaffe8a669722b87ac9d6 Merge: ca2e9c3beec67 2a565258b3f4b Author: Linus Torvalds Date: Mon Oct 30 12:32:48 2023 -1000 Merge tag 'x86_platform_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 platform updates from Borislav Petkov: - Make sure PCI function 4 IDs of AMD family 0x19, models 0x60-0x7f are actually used in the amd_nb.c enumeration - Add support for extracting NUMA information from devicetree for Hyper-V usages - Add PCI device IDs for the new AMD MI300 AI accelerators - Annotate an array in struct uv_rtc_timer_head with the new __counted_by attribute - Rework UV's NMI action parameter handling * tag 'x86_platform_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/amd_nb: Use Family 19h Models 60h-7Fh Function 4 IDs x86/numa: Add Devicetree support x86/of: Move the x86_flattree_get_config() call out of x86_dtb_init() x86/amd_nb: Add AMD Family MI300 PCI IDs x86/platform/uv: Annotate struct uv_rtc_timer_head with __counted_by x86/platform/uv: Rework NMI "action" modparam handling commit 24e16e385f2272b1a9df51337a5c32d28a29c7ad Author: Amir Goldstein Date: Mon Oct 30 20:34:42 2023 +0200 ovl: add support for appending lowerdirs one by one Add new mount options lowerdir+ and datadir+ that can be used to add layers to lower layers stack one by one. Unlike the legacy lowerdir mount option, special characters (i.e. colons and cammas) are not unescaped with these new mount options. The new mount options can be repeated to compose a large stack of lower layers, but they may not be mixed with the lagacy lowerdir mount option, because for displaying lower layers in mountinfo, we do not want to mix escaped with unescaped lower layers path syntax. Similar to data-only layer rules with the lowerdir mount option, the datadir+ option must follow at least one lowerdir+ option and the lowerdir+ option must not follow the datadir+ option. If the legacy lowerdir mount option follows lowerdir+ and datadir+ mount options, it overrides them. Sepcifically, calling: fsconfig(FSCONFIG_SET_STRING, "lowerdir", "", 0); can be used to reset previously setup lower layers. Suggested-by: Miklos Szeredi Link: https://lore.kernel.org/r/CAJfpegt7VC94KkRtb1dfHG8+4OzwPBLYqhtc8=QFUxpFJE+=RQ@mail.gmail.com/ Signed-off-by: Amir Goldstein commit 819829f0319a759e8a6ccb7e4f1113f3f9f07aa3 Author: Amir Goldstein Date: Sun Oct 29 14:00:39 2023 +0200 ovl: refactor layer parsing helpers In preparation for new mount options to add lowerdirs one by one, generalize ovl_parse_param_upperdir() into helper ovl_parse_layer() that will be used for parsing a single lower layers. Suggested-by: Miklos Szeredi Link: https://lore.kernel.org/r/CAJfpegt7VC94KkRtb1dfHG8+4OzwPBLYqhtc8=QFUxpFJE+=RQ@mail.gmail.com/ Signed-off-by: Amir Goldstein commit 0cea4c097d97fdc89de488bd4202d0b087ccec58 Author: Amir Goldstein Date: Sat Oct 28 11:25:30 2023 +0300 ovl: store and show the user provided lowerdir mount option We are about to add new mount options for adding lowerdir one by one, but those mount options will not support escaping. For the existing case, where lowerdir mount option is provided as a colon separated list, store the user provided (possibly escaped) string and display it as is when showing the lowerdir mount option. Signed-off-by: Amir Goldstein commit c835110b588a750650988ca5000913c3c60d246b Author: Amir Goldstein Date: Sat Oct 28 12:07:45 2023 +0300 ovl: remove unused code in lowerdir param parsing Commit beae836e9c61 ("ovl: temporarily disable appending lowedirs") removed the ability to append lowerdirs with syntax lowerdir=":". Remove leftover code and comments that are irrelevant with lowerdir append mode disabled. Signed-off-by: Amir Goldstein commit bb7055a7349904623fe489b4461e12803da18ce6 Author: Alexander Larsson Date: Wed Aug 16 12:57:41 2023 +0200 ovl: Add documentation on nesting of overlayfs mounts Signed-off-by: Alexander Larsson Reviewed-by: Amir Goldstein Signed-off-by: Amir Goldstein commit bc8df7a3dc035903426a17ea3027f55817de13a8 Author: Alexander Larsson Date: Wed Aug 23 16:33:42 2023 +0200 ovl: Add an alternative type of whiteout An xattr whiteout (called "xwhiteout" in the code) is a reguar file of zero size with the "overlay.whiteout" xattr set. A file like this in a directory with the "overlay.whiteouts" xattrs set will be treated the same way as a regular whiteout. The "overlay.whiteouts" directory xattr is used in order to efficiently handle overlay checks in readdir(), as we only need to checks xattrs in affected directories. The advantage of this kind of whiteout is that they can be escaped using the standard overlay xattr escaping mechanism. So, a file with a "overlay.overlay.whiteout" xattr would be unescaped to "overlay.whiteout", which could then be consumed by another overlayfs as a whiteout. Overlayfs itself doesn't create whiteouts like this, but a userspace mechanism could use this alternative mechanism to convert images that may contain whiteouts to be used with overlayfs. To work as a whiteout for both regular overlayfs mounts as well as userxattr mounts both the "user.overlay.whiteout*" and the "trusted.overlay.whiteout*" xattrs will need to be created. Signed-off-by: Alexander Larsson Reviewed-by: Amir Goldstein Signed-off-by: Amir Goldstein commit dad02fad84cbce30f317b69a4f2391f90045f79d Author: Alexander Larsson Date: Tue Aug 15 09:40:50 2023 +0200 ovl: Support escaped overlay.* xattrs There are cases where you want to use an overlayfs mount as a lowerdir for another overlayfs mount. For example, if the system rootfs is on overlayfs due to composefs, or to make it volatile (via tmps), then you cannot currently store a lowerdir on the rootfs. This means you can't e.g. store on the rootfs a prepared container image for use using overlayfs. To work around this, we introduce an escapment mechanism for overlayfs xattrs. Whenever the lower/upper dir has a xattr named "overlay.overlay.XYZ", we list it as "overlay.XYZ" in listxattrs, and when the user calls getxattr or setxattr on "overlay.XYZ", we apply to "overlay.overlay.XYZ" in the backing directories. This allows storing any kind of overlay xattrs in a overlayfs mount that can be used as a lowerdir in another mount. It is possible to stack this mechanism multiple times, such that "overlay.overlay.overlay.XYZ" will survive two levels of overlay mounts, however this is not all that useful in practice because of stack depth limitations of overlayfs mounts. Note: These escaped xattrs are copied to upper during copy-up. Signed-off-by: Alexander Larsson Reviewed-by: Amir Goldstein Signed-off-by: Amir Goldstein commit d431e652600bf2708f5a5ca3b46fa1b53606d1cf Author: Alexander Larsson Date: Tue Aug 15 09:33:44 2023 +0200 ovl: Add OVL_XATTR_TRUSTED/USER_PREFIX_LEN macros These match the ones for e.g. XATTR_TRUSTED_PREFIX_LEN. Signed-off-by: Alexander Larsson Reviewed-by: Amir Goldstein Signed-off-by: Amir Goldstein commit 420a62dde6ebca7bc22e6c57c9cb25d7967ff1ea Author: Amir Goldstein Date: Tue Oct 10 14:17:59 2023 +0300 ovl: Move xattr support to new xattrs.c file This moves the code from super.c and inode.c, and makes ovl_xattr_get/set() static. This is in preparation for doing more work on xattrs support. Signed-off-by: Alexander Larsson Reviewed-by: Amir Goldstein Signed-off-by: Amir Goldstein commit 5b02bfc1e7e3811c5bf7f0fa626a0694d0dbbd77 Author: Amir Goldstein Date: Wed Aug 16 16:47:59 2023 +0300 ovl: do not encode lower fh with upper sb_writers held When lower fs is a nested overlayfs, calling encode_fh() on a lower directory dentry may trigger copy up and take sb_writers on the upper fs of the lower nested overlayfs. The lower nested overlayfs may have the same upper fs as this overlayfs, so nested sb_writers lock is illegal. Move all the callers that encode lower fh to before ovl_want_write(). Signed-off-by: Amir Goldstein commit c63e56a4a6523fcb1358e1878607d77a40b534bb Author: Amir Goldstein Date: Wed Aug 16 12:42:18 2023 +0300 ovl: do not open/llseek lower file with upper sb_writers held overlayfs file open (ovl_maybe_lookup_lowerdata) and overlay file llseek take the ovl_inode_lock, without holding upper sb_writers. In case of nested lower overlay that uses same upper fs as this overlay, lockdep will warn about (possibly false positive) circular lock dependency when doing open/llseek of lower ovl file during copy up with our upper sb_writers held, because the locking ordering seems reverse to the locking order in ovl_copy_up_start(): - lower ovl_inode_lock - upper sb_writers Let the copy up "transaction" keeps an elevated mnt write count on upper mnt, but leaves taking upper sb_writers to lower level helpers only when they actually need it. This allows to avoid holding upper sb_writers during lower file open/llseek and prevents the lockdep warning. Minimizing the scope of upper sb_writers during copy up is also needed for fixing another possible deadlocks by a following patch. Signed-off-by: Amir Goldstein commit 162d06444070c12827d604a2cb6b6bd98d48cbb0 Author: Amir Goldstein Date: Thu Jul 20 12:51:21 2023 +0300 ovl: reorder ovl_want_write() after ovl_inode_lock() Make the locking order of ovl_inode_lock() strictly between the two vfs stacked layers, i.e.: - ovl vfs locks: sb_writers, inode_lock, ... - ovl_inode_lock - upper vfs locks: sb_writers, inode_lock, ... To that effect, move ovl_want_write() into the helpers ovl_nlink_start() and ovl_copy_up_start which currently take the ovl_inode_lock() after ovl_want_write(). Signed-off-by: Amir Goldstein commit d08d3b3c2caf6c482703bbc5efaa7b9ae95dea20 Author: Amir Goldstein Date: Wed Aug 16 12:18:15 2023 +0300 ovl: split ovl_want_write() into two helpers ovl_get_write_access() gets write access to upper mnt without taking freeze protection on upper sb and ovl_start_write() only takes freeze protection on upper sb. These helpers will be used to breakup the large ovl_want_write() scope during copy up into finer grained freeze protection scopes. Signed-off-by: Amir Goldstein commit c002728f608183449673818076380124935e6b9b Author: Amir Goldstein Date: Wed Sep 27 13:43:44 2023 +0300 ovl: add helper ovl_file_modified() A simple wrapper for updating ovl inode size/mtime, to conform with ovl_file_accessed(). Signed-off-by: Amir Goldstein commit f7621b11e8acc8efa208c9420ff3ecb198b20e29 Author: Amir Goldstein Date: Thu Aug 24 14:51:17 2023 +0300 ovl: protect copying of realinode attributes to ovl inode ovl_copyattr() may be called concurrently from aio completion context without any lock and that could lead to overlay inode attributes getting permanently out of sync with real inode attributes. Use ovl inode spinlock to protect ovl_copyattr(). Signed-off-by: Amir Goldstein commit 389a4a4a19851211bb9c40d31c664591fb206f69 Author: Amir Goldstein Date: Tue Aug 22 20:50:59 2023 +0300 ovl: punt write aio completion to workqueue We want to protect concurrent updates of ovl inode size and mtime (i.e. ovl_copyattr()) from aio completion context. Punt write aio completion to a workqueue so that we can protect ovl_copyattr() with a spinlock. Export sb_init_dio_done_wq(), so that overlayfs can use its own dio workqueue to punt aio completions. Suggested-by: Jens Axboe Link: https://lore.kernel.org/r/8620dfd3-372d-4ae0-aa3f-2fe97dda1bca@kernel.dk/ Signed-off-by: Amir Goldstein commit 5f034d34737e8c440bbbd13e5ef283793d841140 Author: Amir Goldstein Date: Tue Aug 29 16:25:47 2023 +0300 ovl: propagate IOCB_APPEND flag on writes to realfile If ovl file is opened O_APPEND, the underlying realfile is also opened O_APPEND, so it makes sense to propagate the IOCB_APPEND flags on sync writes to realfile, just as we do with aio writes. Effectively, because sync ovl writes are protected by inode lock, this change only makes a difference if the realfile is written to (size extending writes) from underneath overlayfs. The behavior in this case is undefined, so it is ok if we change the behavior (to fail the ovl IOCB_APPEND write). Signed-off-by: Amir Goldstein commit db5b5e83eee46ec5e3d685282c9e4f38946cb0ea Author: Amir Goldstein Date: Wed Sep 6 10:52:13 2023 +0300 ovl: use simpler function to convert iocb to rw flags Overlayfs implements its own function to translate iocb flags into rw flags, so that they can be passed into another vfs call. With commit ce71bfea207b4 ("fs: align IOCB_* flags with RWF_* flags") Jens created a 1:1 matching between the iocb flags and rw flags, simplifying the conversion. Signed-off-by: Alessio Balsini Signed-off-by: Amir Goldstein commit ca2e9c3beec67dc90944f3d2a72f77652fb9cefc Merge: 9ab021a1b5700 b5034c63858d8 Author: Linus Torvalds Date: Mon Oct 30 12:10:24 2023 -1000 Merge tag 'x86_cpu_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cpuid updates from Borislav Petkov: - Make sure the "svm" feature flag is cleared from /proc/cpuinfo when virtualization support is disabled in the BIOS on AMD and Hygon platforms - A minor cleanup * tag 'x86_cpu_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpu/amd: Remove redundant 'break' statement x86/cpu: Clear SVM feature if disabled by BIOS commit 9ab021a1b57007a22761f6f41d91eb4aae10d145 Merge: f84a52eef5c35 4cee14bcb1488 Author: Linus Torvalds Date: Mon Oct 30 12:07:29 2023 -1000 Merge tag 'x86_cache_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 resource control updates from Borislav Petkov: - Add support for non-contiguous capacity bitmasks being added to Intel's CAT implementation - Other improvements to resctrl code: better configuration, simplifications, debugging support, fixes * tag 'x86_cache_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/resctrl: Display RMID of resource group x86/resctrl: Add support for the files of MON groups only x86/resctrl: Display CLOSID for resource group x86/resctrl: Introduce "-o debug" mount option x86/resctrl: Move default group file creation to mount x86/resctrl: Unwind properly from rdt_enable_ctx() x86/resctrl: Rename rftype flags for consistency x86/resctrl: Simplify rftype flag definitions x86/resctrl: Add multiple tasks to the resctrl group at once Documentation/x86: Document resctrl's new sparse_masks x86/resctrl: Add sparse_masks file in info x86/resctrl: Enable non-contiguous CBMs in Intel CAT x86/resctrl: Rename arch_has_sparse_bitmaps x86/resctrl: Fix remaining kernel-doc warnings commit f84a52eef5c35b49947b132ddd9b79d6767469af Merge: 01ae815c50215 9d9c22cc444af Author: Linus Torvalds Date: Mon Oct 30 11:48:49 2023 -1000 Merge tag 'x86_bugs_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 hw mitigation updates from Borislav Petkov: - A bunch of improvements, cleanups and fixlets to the SRSO mitigation machinery and other, general cleanups to the hw mitigations code, by Josh Poimboeuf - Improve the return thunk detection by objtool as it is absolutely important that the default return thunk is not used after returns have been patched. Future work to detect and report this better is pending - Other misc cleanups and fixes * tag 'x86_bugs_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits) x86/retpoline: Document some thunk handling aspects x86/retpoline: Make sure there are no unconverted return thunks due to KCSAN x86/callthunks: Delete unused "struct thunk_desc" x86/vdso: Run objtool on vdso32-setup.o objtool: Fix return thunk patching in retpolines x86/srso: Remove unnecessary semicolon x86/pti: Fix kernel warnings for pti= and nopti cmdline options x86/calldepth: Rename __x86_return_skl() to call_depth_return_thunk() x86/nospec: Refactor UNTRAIN_RET[_*] x86/rethunk: Use SYM_CODE_START[_LOCAL]_NOALIGN macros x86/srso: Disentangle rethunk-dependent options x86/srso: Move retbleed IBPB check into existing 'has_microcode' code block x86/bugs: Remove default case for fully switched enums x86/srso: Remove 'pred_cmd' label x86/srso: Unexport untraining functions x86/srso: Improve i-cache locality for alias mitigation x86/srso: Fix unret validation dependencies x86/srso: Fix vulnerability reporting for missing microcode x86/srso: Print mitigation for retbleed IBPB case x86/srso: Print actual mitigation if requested mitigation isn't possible ... commit 01ae815c5021532aecf8c5e280cf50cdaa72a9d6 Merge: 66cc8838c72b1 1bae0cfe4a171 Author: Linus Torvalds Date: Mon Oct 30 11:47:03 2023 -1000 Merge tag 'ras_core_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 RAS updates from Borislav Petkov: - Specify what error addresses reported on AMD are actually usable memory error addresses for further decoding * tag 'ras_core_for_6.7_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Cleanup mce_usable_address() x86/mce: Define amd_mce_usable_address() x86/MCE/AMD: Split amd_mce_is_memory_error() commit 66cc8838c72b165048f49f88fc9d1be996abd35b Merge: 9e87705289667 6f15b178cd631 Author: Linus Torvalds Date: Mon Oct 30 11:45:36 2023 -1000 Merge tag 'edac_updates_for_v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC updates from Borislav Petkov: - A new EDAC driver for Xilinx's Versal integrated memory controller * tag 'edac_updates_for_v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/versal: Add a Xilinx Versal memory controller driver dt-bindings: memory-controllers: Add support for Xilinx Versal EDAC for DDRMC commit e0f9f0e0737f47f643a66c6db158af61818336bc Merge: 55c900477f5b3 eefed7662ff22 Author: Jakub Kicinski Date: Mon Oct 30 14:36:56 2023 -0700 Merge tag 'ipsec-next-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next Steffen Klassert says: ==================== pull request (net-next): ipsec-next 2023-10-28 1) Remove unused function declarations of xfrm4_extract_input and xfrm6_extract_input. From Yue Haibing. 2) Annotate struct xfrm_sec_ctx with __counted_by. From Kees Cook. 3) Support GRO decapsulation for ESP in UDP encapsulation. From Antony Antony et all. 4) Replace the xfrm session decode with flow dissector. From Florian Westphal. 5) Fix a use after free in __xfrm6_udp_encap_rcv. 6) Fix the layer 4 flowi decoding. From Florian Westphal. * tag 'ipsec-next-2023-10-28' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next: xfrm: policy: fix layer 4 flowi decoding xfrm Fix use after free in __xfrm6_udp_encap_rcv. xfrm: policy: replace session decode with flow dissector xfrm: move mark and oif flowi decode into common code xfrm: pass struct net to xfrm_decode_session wrappers xfrm: Support GRO for IPv6 ESP in UDP encapsulation xfrm: Support GRO for IPv4 ESP in UDP encapsulation xfrm: Use the XFRM_GRO to indicate a GRO call on input xfrm: Annotate struct xfrm_sec_ctx with __counted_by xfrm: Remove unused function declarations ==================== Link: https://lore.kernel.org/r/20231028084328.3119236-1-steffen.klassert@secunet.com Signed-off-by: Jakub Kicinski commit fe612629746cf5cc7040529f780d46929605d0a6 Author: Herve Codina Date: Wed Oct 11 08:14:12 2023 +0200 dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Add support for QMC HDLC The QMC (QUICC mutichannel controller) is a controller present in some PowerQUICC SoC such as MPC885. The QMC HDLC uses the QMC controller to transfer HDLC data. Additionally, a framer can be connected to the QMC HDLC. If present, this framer is the interface between the TDM bus used by the QMC HDLC and the E1/T1 line. The QMC HDLC can use this framer to get information about the E1/T1 line and configure the E1/T1 line. Signed-off-by: Herve Codina Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20231011061437.64213-9-herve.codina@bootlin.com Signed-off-by: Rob Herring commit 527de94b0fb38502f4f563e9f60c372d37fe0203 Author: Herve Codina Date: Wed Oct 11 08:14:11 2023 +0200 dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Add 'additionalProperties: false' in child nodes Additional properties in child node should not be allowed. Prevent them adding 'additionalProperties: false' Signed-off-by: Herve Codina Acked-by: Conor Dooley Acked-by: Rob Herring Link: https://lore.kernel.org/r/20231011061437.64213-8-herve.codina@bootlin.com Signed-off-by: Rob Herring commit f2147371a83c6de1128093c163dc17bc61096362 Author: Herve Codina Date: Wed Oct 11 08:14:10 2023 +0200 dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Fix example property name The given example mentions the 'fsl,mode' property whereas the correct property name, the one described, is 'fsl,operational-mode'. Fix the example to use the correct property name. Fixes: a9b121327c93 ("dt-bindings: soc: fsl: cpm_qe: Add QMC controller") Signed-off-by: Herve Codina Acked-by: Conor Dooley Acked-by: Rob Herring Link: https://lore.kernel.org/r/20231011061437.64213-7-herve.codina@bootlin.com Signed-off-by: Rob Herring commit 0a6d7f8275f255eda823c0f0b61d024f6f5b483d Merge: 720e4a4a68670 7e52b1164a474 Author: Stephen Boyd Date: Mon Oct 30 14:12:53 2023 -0700 Merge branch 'clk-cleanup' into clk-next * clk-cleanup: clk: si521xx: Increase stack based print buffer size in probe clk: Use device_get_match_data() clk: cdce925: Extend match support for OF tables clk: si570: Simplify probe clk: si5351: Simplify probe clk: rs9: Use i2c_get_match_data() instead of device_get_match_data() clk: clk-si544: Simplify probe() and is_valid_frequency() clk: si521xx: Use i2c_get_match_data() instead of device_get_match_data() clk: npcm7xx: Fix incorrect kfree clk: at91: remove unnecessary conditions clk: ti: fix double free in of_ti_divider_clk_setup() clk: keystone: pll: fix a couple NULL vs IS_ERR() checks clk: ralink: mtmips: quiet unused variable warning clk: gate: fix comment typo and grammar clk: asm9620: Remove 'hw' local variable that isn't checked commit 720e4a4a68670dfda638da236d374fc7a4be0a28 Merge: d33050aec3f6b c3f187461f090 75357829cc8ef 9e952929dfe22 2790e2a33aa9e Author: Stephen Boyd Date: Mon Oct 30 14:12:20 2023 -0700 Merge branches 'clk-renesas', 'clk-kunit', 'clk-regmap' and 'clk-frac-divider' into clk-next - Make clk kunit tests work with lockdep - Fix clk gate kunit test for big-endian - Convert more than a handful of clk drivers to use regmap maple tree - Consider the CLK_FRAC_DIVIDER_ZERO_BASED in fractional divider clk implementation * clk-renesas: (23 commits) clk: renesas: r9a08g045: Add clock and reset support for SDHI1 and SDHI2 clk: renesas: rzg2l: Use %x format specifier to print CLK_ON_R() clk: renesas: Add minimal boot support for RZ/G3S SoC clk: renesas: rzg2l: Add divider clock for RZ/G3S clk: renesas: rzg2l: Refactor SD mux driver clk: renesas: rzg2l: Remove CPG_SDHI_DSEL from generic header clk: renesas: rzg2l: Add struct clk_hw_data clk: renesas: rzg2l: Add support for RZ/G3S PLL clk: renesas: rzg2l: Remove critical area clk: renesas: rzg2l: Fix computation formula clk: renesas: rzg2l: Trust value returned by hardware clk: renesas: rzg2l: Lock around writes to mux register clk: renesas: rzg2l: Wait for status bit of SD mux before continuing clk: renesas: rcar-gen3: Extend SDnH divider table dt-bindings: clock: renesas,rzg2l-cpg: Document RZ/G3S SoC clk: renesas: r8a7795: Constify r8a7795_*_clks clk: renesas: r9a06g032: Name anonymous structs clk: renesas: r9a06g032: Fix kerneldoc warning clk: renesas: rzg2l: Use u32 for flag and mux_flags clk: renesas: rzg2l: Use FIELD_GET() for PLL register fields ... * clk-kunit: clk: Fix clk gate kunit test on big-endian CPUs clk: Parameterize clk_leaf_mux_set_rate_parent clk: Drive clk_leaf_mux_set_rate_parent test from clk_ops * clk-regmap: clk: versaclock7: Convert to use maple tree register cache clk: versaclock5: Convert to use maple tree register cache clk: versaclock3: Convert to use maple tree register cache clk: versaclock3: Remove redundant _is_writeable() clk: si570: Convert to use maple tree register cache clk: si544: Convert to use maple tree register cache clk: si5351: Convert to use maple tree register cache clk: si5341: Convert to use maple tree register cache clk: si514: Convert to use maple tree register cache clk: cdce925: Convert to use maple tree register cache * clk-frac-divider: clk: fractional-divider: tests: Add test suite for edge cases clk: fractional-divider: Improve approximation when zero based and export commit d33050aec3f6b37294dc318e9cdb969ed5094a2d Merge: 702a582b5cf93 e43d31915cc4f 48a8748fd0d18 c8e1d8ae6aba7 65f9e1becb559 0dea4e30fedad Author: Stephen Boyd Date: Mon Oct 30 14:10:51 2023 -0700 Merge branches 'clk-debugfs', 'clk-spreadtrum', 'clk-sifive', 'clk-counted' and 'clk-qcom' into clk-next - Add consumer info to clk debugfs - Fix various clk drivers that have clk_hw_onecell_data not at the end of an allocation * clk-debugfs: clk: Allow phase adjustment from debugfs clk: Show active consumers of clocks in debugfs * clk-spreadtrum: clk: sprd: Composite driver support offset config * clk-sifive: clk: sifive: Allow building the driver as a module clk: analogbits: Allow building the library as a module * clk-counted: clk: socfpga: agilex: Add bounds-checking coverage for struct stratix10_clock_data clk: socfpga: Fix undefined behavior bug in struct stratix10_clock_data clk: visconti: Add bounds-checking coverage for struct visconti_pll_provider clk: visconti: Fix undefined behavior bug in struct visconti_pll_provider * clk-qcom: (36 commits) clk: qcom: apss-ipq6018: add the GPLL0 clock also as clock provider clk: qcom: ipq5332: drop the CLK_SET_RATE_PARENT flag from GPLL clocks clk: qcom: ipq9574: drop the CLK_SET_RATE_PARENT flag from GPLL clocks clk: qcom: ipq5018: drop the CLK_SET_RATE_PARENT flag from GPLL clocks clk: qcom: ipq6018: drop the CLK_SET_RATE_PARENT flag from PLL clocks clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks clk: qcom: gcc-ipq6018: add QUP6 I2C clock clk: qcom: apss-ipq6018: ipq5332: add safe source switch for a53pll clk: qcom: apss-ipq-pll: Fix 'l' value for ipq5332_pll_config clk: qcom: apss-ipq-pll: Use stromer plus ops for stromer plus pll clk: qcom: clk-alpha-pll: introduce stromer plus ops clk: qcom: config IPQ_APSS_6018 should depend on QCOM_SMEM clk: qcom: videocc-sm8550: switch to clk_lucid_ole_pll_configure clk: qcom: gpucc-sm8550: switch to clk_lucid_ole_pll_configure clk: qcom: Replace of_device.h with explicit includes clk: qcom: smd-rpm: Move CPUSS_GNoC clock to interconnect clk: qcom: cbf-msm8996: Convert to platform remove callback returning void clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src clk: qcom: Add GCC driver support for SM4450 dt-bindings: clock: qcom: Add GCC clocks for SM4450 ... commit 702a582b5cf930211f3cea9e6550bc9de9a145a8 Merge: 790437bbe0ef7 84aefafe6b294 b79a08af32349 bd54ccc0f1470 4eb15b0363670 701d1057654f9 Author: Stephen Boyd Date: Mon Oct 30 14:10:39 2023 -0700 Merge branches 'clk-doc', 'clk-amlogic', 'clk-mediatek', 'clk-twl' and 'clk-imx' into clk-next - Add clock driver for TWL6032 * clk-doc: clk: linux/clk-provider.h: fix kernel-doc warnings and typos * clk-amlogic: clk: meson: S4: select CONFIG_COMMON_CLK_MESON_CLKC_UTILS clk: meson: S4: add support for Amlogic S4 SoC peripheral clock controller clk: meson: S4: add support for Amlogic S4 SoC PLL clock driver dt-bindings: clock: document Amlogic S4 SoC peripherals clock controller dt-bindings: clock: document Amlogic S4 SoC PLL clock controller * clk-mediatek: clk: mediatek: fix double free in mtk_clk_register_pllfh() clk: mediatek: clk-mt2701: Add check for mtk_alloc_clk_data clk: mediatek: clk-mt7629: Add check for mtk_alloc_clk_data clk: mediatek: clk-mt7629-eth: Add check for mtk_alloc_clk_data clk: mediatek: clk-mt6797: Add check for mtk_alloc_clk_data clk: mediatek: clk-mt6779: Add check for mtk_alloc_clk_data clk: mediatek: clk-mt6765: Add check for mtk_alloc_clk_data * clk-twl: clk: twl: add clock driver for TWL6032 * clk-imx: clk: imx: imx8qm/qxp: add more resources to whitelist clk: imx: scu: ignore clks not owned by Cortex-A partition clk: imx8: remove MLB support clk: imx: imx8qm-rsrc: drop VPU_UART/VPUCORE clk: imx: imx8qxp: correct the enet clocks for i.MX8DXL clk: imx: imx8qxp: Fix elcdif_pll clock clk: imx: imx8dxl-rsrc: keep sorted in the ascending order clk: imx: imx6sx: Allow a different LCDIF1 clock parent clk: imx: imx8mq: correct error handling path clk: imx8mp: Remove non-existent IMX8MP_CLK_AUDIOMIX_PDM_ROOT clk: imx: imx8: Simplify clk_imx_acm_detach_pm_domains() clk: imx: imx8: Add a message in case of devm_clk_hw_register_mux_parent_data_table() error clk: imx: imx8: Fix an error handling path in imx8_acm_clk_probe() clk: imx: imx8: Fix an error handling path if devm_clk_hw_register_mux_parent_data_table() fails clk: imx: imx8: Fix an error handling path in clk_imx_acm_attach_pm_domains() clk: imx: Select MXC_CLK for CLK_IMX8QXP commit 9e87705289667a6c5185c619ea32f3d39314eb1b Merge: d5acbc60fafbe b827ac419721a Author: Linus Torvalds Date: Mon Oct 30 11:09:38 2023 -1000 Merge tag 'bcachefs-2023-10-30' of https://evilpiepirate.org/git/bcachefs Pull initial bcachefs updates from Kent Overstreet: "Here's the bcachefs filesystem pull request. One new patch since last week: the exportfs constants ended up conflicting with other filesystems that are also getting added to the global enum, so switched to new constants picked by Amir. The only new non fs/bcachefs/ patch is the objtool patch that adds bcachefs functions to the list of noreturns. The patch that exports osq_lock() has been dropped for now, per Ingo" * tag 'bcachefs-2023-10-30' of https://evilpiepirate.org/git/bcachefs: (2781 commits) exportfs: Change bcachefs fid_type enum to avoid conflicts bcachefs: Refactor memcpy into direct assignment bcachefs: Fix drop_alloc_keys() bcachefs: snapshot_create_lock bcachefs: Fix snapshot skiplists during snapshot deletion bcachefs: bch2_sb_field_get() refactoring bcachefs: KEY_TYPE_error now counts towards i_sectors bcachefs: Fix handling of unknown bkey types bcachefs: Switch to unsafe_memcpy() in a few places bcachefs: Use struct_size() bcachefs: Correctly initialize new buckets on device resize bcachefs: Fix another smatch complaint bcachefs: Use strsep() in split_devs() bcachefs: Add iops fields to bch_member bcachefs: Rename bch_sb_field_members -> bch_sb_field_members_v1 bcachefs: New superblock section members_v2 bcachefs: Add new helper to retrieve bch_member from sb bcachefs: bucket_lock() is now a sleepable lock bcachefs: fix crc32c checksum merge byte order problem bcachefs: Fix bch2_inode_delete_keys() ... commit 70b416afc99863d9f5a5959f6555bbb290d70eee Author: Rob Herring Date: Mon Sep 25 17:05:06 2023 -0500 dt-bindings: arm,coresight-cti: Add missing additionalProperties on child nodes Just as unevaluatedProperties or additionalProperties are required at the top level of schemas, they should (and will) also be required for child node schemas. That ensures only documented properties are present for any node. Adding additionalProperties constraint on 'trig-conns' nodes results in warnings that 'cpu' and 'arm,cs-dev-assoc' are not allowed. These are already defined for the parent node, but need to be duplicated for the child node. Drop the free form description that the properties also apply to the child nodes. Acked-by: Conor Dooley Reviewed-by: Mike Leach Link: https://lore.kernel.org/r/20230925220511.2026514-2-robh@kernel.org Signed-off-by: Rob Herring commit 5027cf58e402351bf5585d3d22fb8d92056782eb Author: Rob Herring Date: Mon Sep 25 17:05:05 2023 -0500 dt-bindings: arm,coresight-cti: Drop type for 'cpu' property 'cpu' has been added as a single phandle type to dtschema, so drop the type here. Reviewed-by: Mike Leach Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230925220511.2026514-1-robh@kernel.org Signed-off-by: Rob Herring commit 4d2309224ec25a4997e40a45b5f74f7defd3ecf2 Author: Rob Herring Date: Mon Oct 16 10:55:37 2023 -0500 dt-bindings: soundwire: Add reference to soundwire-controller.yaml schema The soundwire-controller.yaml schema already defines the form for devices in child nodes, so there's no need to do the same in the QCom controller binding. Add a $ref to the soundwire-controller.yaml schema and drop the child node schema. Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231016155537.2973625-1-robh@kernel.org Signed-off-by: Rob Herring commit b2b67c997bf74453f3469d8b54e4859f190943bd Author: Jason Gunthorpe Date: Mon Oct 30 15:11:20 2023 -0300 iommufd: Organize the mock domain alloc functions closer to Joerg's tree Patches in Joerg's iommu tree to convert the mock driver to use domain_alloc_paging() that clash badly with the way the selftest changes for nesting were structured. Massage the selftest so that it looks closer the code after the domain_alloc_paging() conversion to ease the merge. Change __mock_domain_alloc_paging() into mock_domain_alloc_paging() in the same way as the iommu tree. The merge resolution then trivially takes both and deletes mock_domain_alloc(). Link: https://lore.kernel.org/r/0-v1-90a855762c96+19de-mock_merge_jgg@nvidia.com Reviewed-by: Nicolin Chen Reviewed-by: Kevin Tian Reviewed-by: Yi Liu Signed-off-by: Jason Gunthorpe commit a9f32acf102546b1ce0af03c072bef090f3d84e8 Author: Rob Herring Date: Tue Sep 26 09:42:44 2023 -0500 dt-bindings: input: syna,rmi4: Make "additionalProperties: true" explicit Make it explicit that the not yet documented child nodes have additional properties and the child node schema is not complete. Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230926144249.4053202-1-robh@kernel.org Signed-off-by: Rob Herring commit fed3a1be6433e15833068c701bfde7b422d8b988 Merge: c43c64f8a1c68 4fa008a2db484 Author: Namhyung Kim Date: Mon Oct 30 13:39:28 2023 -0700 Merge tag 'perf-tools-fixes-for-v6.6-2-2023-10-20' into perf-tools-next To get the latest fixes in the perf tools including perf stat output, dlfilter and LLVM feature detection. Signed-off-by: Namhyung Kim commit d5acbc60fafbe0fc94c552ce916dd592cd4c6371 Merge: 8829687a4ac1d c6e8f898f56fa Author: Linus Torvalds Date: Mon Oct 30 10:42:06 2023 -1000 Merge tag 'for-6.7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs updates from David Sterba: "New features: - raid-stripe-tree New tree for logical file extent mapping where the physical mapping may not match on multiple devices. This is now used in zoned mode to implement RAID0/RAID1* profiles, but can be used in non-zoned mode as well. The support for RAID56 is in development and will eventually fix the problems with the current implementation. This is a backward incompatible feature and has to be enabled at mkfs time. - simple quota accounting (squota) A simplified mode of qgroup that accounts all space on the initial extent owners (a subvolume), the snapshots are then cheap to create and delete. The deletion of snapshots in fully accounting qgroups is a known CPU/IO performance bottleneck. The squota is not suitable for the general use case but works well for containers where the original subvolume exists for the whole time. This is a backward incompatible feature as it needs extending some structures, but can be enabled on an existing filesystem. - temporary filesystem fsid (temp_fsid) The fsid identifies a filesystem and is hard coded in the structures, which disallows mounting the same fsid found on different devices. For a single device filesystem this is not strictly necessary, a new temporary fsid can be generated on mount e.g. after a device is cloned. This will be used by Steam Deck for root partition A/B testing, or can be used for VM root images. Other user visible changes: - filesystems with partially finished metadata_uuid conversion cannot be mounted anymore and the uuid fixup has to be done by btrfs-progs (btrfstune). Performance improvements: - reduce reservations for checksum deletions (with enabled free space tree by factor of 4), on a sample workload on file with many extents the deletion time decreased by 12% - make extent state merges more efficient during insertions, reduce rb-tree iterations (run time of critical functions reduced by 5%) Core changes: - the integrity check functionality has been removed, this was a debugging feature and removal does not affect other integrity checks like checksums or tree-checker - space reservation changes: - more efficient delayed ref reservations, this avoids building up too much work or overusing or exhausting the global block reserve in some situations - move delayed refs reservation to the transaction start time, this prevents some ENOSPC corner cases related to exhaustion of global reserve - improvements in reducing excessive reservations for block group items - adjust overcommit logic in near full situations, account for one more chunk to eventually allocate metadata chunk, this is mostly relevant for small filesystems (<10GiB) - single device filesystems are scanned but not registered (except seed devices), this allows temp_fsid to work - qgroup iterations do not need GFP_ATOMIC allocations anymore - cleanups, refactoring, reduced data structure size, function parameter simplifications, error handling fixes" * tag 'for-6.7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (156 commits) btrfs: open code timespec64 in struct btrfs_inode btrfs: remove redundant log root tree index assignment during log sync btrfs: remove redundant initialization of variable dirty in btrfs_update_time() btrfs: sysfs: show temp_fsid feature btrfs: disable the device add feature for temp-fsid btrfs: disable the seed feature for temp-fsid btrfs: update comment for temp-fsid, fsid, and metadata_uuid btrfs: remove pointless empty log context list check when syncing log btrfs: update comment for struct btrfs_inode::lock btrfs: remove pointless barrier from btrfs_sync_file() btrfs: add and use helpers for reading and writing last_trans_committed btrfs: add and use helpers for reading and writing fs_info->generation btrfs: add and use helpers for reading and writing log_transid btrfs: add and use helpers for reading and writing last_log_commit btrfs: support cloned-device mount capability btrfs: add helper function find_fsid_by_disk btrfs: stop reserving excessive space for block group item insertions btrfs: stop reserving excessive space for block group item updates btrfs: reorder btrfs_inode to fill gaps btrfs: open code btrfs_ordered_inode_tree in btrfs_inode ... commit 123f42f0ad6815014f54d0cc6eb9039c46ee2907 Merge: 53ce49ea75602 62708be351fe7 Author: Oliver Upton Date: Mon Oct 30 20:24:07 2023 +0000 Merge branch kvm-arm64/pmu_pmcr_n into kvmarm/next * kvm-arm64/pmu_pmcr_n: : User-defined PMC limit, courtesy Raghavendra Rao Ananta : : Certain VMMs may want to reserve some PMCs for host use while running a : KVM guest. This was a bit difficult before, as KVM advertised all : supported counters to the guest. Userspace can now limit the number of : advertised PMCs by writing to PMCR_EL0.N, as KVM's sysreg and PMU : emulation enforce the specified limit for handling guest accesses. KVM: selftests: aarch64: vPMU test for validating user accesses KVM: selftests: aarch64: vPMU register test for unimplemented counters KVM: selftests: aarch64: vPMU register test for implemented counters KVM: selftests: aarch64: Introduce vpmu_counter_access test tools: Import arm_pmuv3.h KVM: arm64: PMU: Allow userspace to limit PMCR_EL0.N for the guest KVM: arm64: Sanitize PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR} before first run KVM: arm64: Add {get,set}_user for PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR} KVM: arm64: PMU: Set PMCR_EL0.N for vCPU based on the associated PMU KVM: arm64: PMU: Add a helper to read a vCPU's PMCR_EL0 KVM: arm64: Select default PMU in KVM_ARM_VCPU_INIT handler KVM: arm64: PMU: Introduce helpers to set the guest's PMU Signed-off-by: Oliver Upton commit 8829687a4ac1d484639425a691da46f6e361aec1 Merge: 8b16da681eb0c 15baf55481de7 Author: Linus Torvalds Date: Mon Oct 30 10:23:42 2023 -1000 Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux Pull fscrypt updates from Eric Biggers: "This update adds support for configuring the crypto data unit size (i.e. the granularity of file contents encryption) to be less than the filesystem block size. This can allow users to use inline encryption hardware in some cases when it wouldn't otherwise be possible. In addition, there are two commits that are prerequisites for the extent-based encryption support that the btrfs folks are working on" * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/linux: fscrypt: track master key presence separately from secret fscrypt: rename fscrypt_info => fscrypt_inode_info fscrypt: support crypto data unit size less than filesystem block size fscrypt: replace get_ino_and_lblk_bits with just has_32bit_inodes fscrypt: compute max_lblk_bits from s_maxbytes and block size fscrypt: make the bounce page pool opt-in instead of opt-out fscrypt: make it clearer that key_prefix is deprecated commit 53ce49ea75602b51a1feb3844d535ced42b2d8c2 Merge: a87a36436cb0c e0bb80c62cfd0 Author: Oliver Upton Date: Mon Oct 30 20:21:19 2023 +0000 Merge branch kvm-arm64/mops into kvmarm/next * kvm-arm64/mops: : KVM support for MOPS, courtesy of Kristina Martsenko : : MOPS adds new instructions for accelerating memcpy(), memset(), and : memmove() operations in hardware. This series brings virtualization : support for KVM guests, and allows VMs to run on asymmetrict systems : that may have different MOPS implementations. KVM: arm64: Expose MOPS instructions to guests KVM: arm64: Add handler for MOPS exceptions Signed-off-by: Oliver Upton commit a87a36436cb0cc6e576731f6a4409841e46d3ed1 Merge: 54b44ad26c429 70c7b704ca725 Author: Oliver Upton Date: Mon Oct 30 20:21:09 2023 +0000 Merge branch kvm-arm64/writable-id-regs into kvmarm/next * kvm-arm64/writable-id-regs: : Writable ID registers, courtesy of Jing Zhang : : This series significantly expands the architectural feature set that : userspace can manipulate via the ID registers. A new ioctl is defined : that makes the mutable fields in the ID registers discoverable to : userspace. KVM: selftests: Avoid using forced target for generating arm64 headers tools headers arm64: Fix references to top srcdir in Makefile KVM: arm64: selftests: Test for setting ID register from usersapce tools headers arm64: Update sysreg.h with kernel sources KVM: selftests: Generate sysreg-defs.h and add to include path perf build: Generate arm64's sysreg-defs.h and add to include path tools: arm64: Add a Makefile for generating sysreg-defs.h KVM: arm64: Document vCPU feature selection UAPIs KVM: arm64: Allow userspace to change ID_AA64ZFR0_EL1 KVM: arm64: Allow userspace to change ID_AA64PFR0_EL1 KVM: arm64: Allow userspace to change ID_AA64MMFR{0-2}_EL1 KVM: arm64: Allow userspace to change ID_AA64ISAR{0-2}_EL1 KVM: arm64: Bump up the default KVM sanitised debug version to v8p8 KVM: arm64: Reject attempts to set invalid debug arch version KVM: arm64: Advertise selected DebugVer in DBGDIDR.Version KVM: arm64: Use guest ID register values for the sake of emulation KVM: arm64: Document KVM_ARM_GET_REG_WRITABLE_MASKS KVM: arm64: Allow userspace to get the writable masks for feature ID registers Signed-off-by: Oliver Upton commit 70c7b704ca7251b09dd4ce22a31b5bea8c797d24 Author: Oliver Upton Date: Fri Oct 27 00:54:39 2023 +0000 KVM: selftests: Avoid using forced target for generating arm64 headers The 'prepare' target that generates the arm64 sysreg headers had no prerequisites, so it wound up forcing a rebuild of all KVM selftests each invocation. Add a rule for the generated headers and just have dependents use that for a prerequisite. Reported-by: Nina Schoetterl-Glausch Fixes: 9697d84cc3b6 ("KVM: selftests: Generate sysreg-defs.h and add to include path") Tested-by: Nina Schoetterl-Glausch Link: https://lore.kernel.org/r/20231027005439.3142015-3-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit fbb075c11663a6fb7beb4ef386e069e06594e229 Author: Oliver Upton Date: Fri Oct 27 00:54:38 2023 +0000 tools headers arm64: Fix references to top srcdir in Makefile Aishwarya reports that KVM selftests for arm64 fail with the following error: | make[4]: Entering directory '/tmp/kci/linux/tools/testing/selftests/kvm' | Makefile:270: warning: overriding recipe for target | '/tmp/kci/linux/build/kselftest/kvm/get-reg-list' | Makefile:265: warning: ignoring old recipe for target | '/tmp/kci/linux/build/kselftest/kvm/get-reg-list' | make -C ../../../../tools/arch/arm64/tools/ | make[5]: Entering directory '/tmp/kci/linux/tools/arch/arm64/tools' | Makefile:10: ../tools/scripts/Makefile.include: No such file or directory | make[5]: *** No rule to make target '../tools/scripts/Makefile.include'. | Stop. It would appear that this only affects builds from the top-level Makefile (e.g. make kselftest-all), as $(srctree) is set to ".". Work around the issue by shadowing the kselftest naming scheme for the source tree variable. Reported-by: Aishwarya TCV Fixes: 0359c946b131 ("tools headers arm64: Update sysreg.h with kernel sources") Link: https://lore.kernel.org/r/20231027005439.3142015-2-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 54b44ad26c4296f341a26456ef121d2fd2ac0c59 Merge: df26b77915be7 f9940416f193d Author: Oliver Upton Date: Mon Oct 30 20:19:13 2023 +0000 Merge branch kvm-arm64/sgi-injection into kvmarm/next * kvm-arm64/sgi-injection: : vSGI injection improvements + fixes, courtesy Marc Zyngier : : Avoid linearly searching for vSGI targets using a compressed MPIDR to : index a cache. While at it, fix some egregious bugs in KVM's mishandling : of vcpuid (user-controlled value) and vcpu_idx. KVM: arm64: Clarify the ordering requirements for vcpu/RD creation KVM: arm64: vgic-v3: Optimize affinity-based SGI injection KVM: arm64: Fast-track kvm_mpidr_to_vcpu() when mpidr_data is available KVM: arm64: Build MPIDR to vcpu index cache at runtime KVM: arm64: Simplify kvm_vcpu_get_mpidr_aff() KVM: arm64: Use vcpu_idx for invalidation tracking KVM: arm64: vgic: Use vcpu_idx for the debug information KVM: arm64: vgic-v2: Use cpuid from userspace as vcpu_id KVM: arm64: vgic-v3: Refactor GICv3 SGI generation KVM: arm64: vgic-its: Treat the collection target address as a vcpu_id KVM: arm64: vgic: Make kvm_vgic_inject_irq() take a vcpu pointer Signed-off-by: Oliver Upton commit df26b77915be7813a0ca06ddd06f04fb4e13e471 Merge: 51e607961463f fe49fd940e225 Author: Oliver Upton Date: Mon Oct 30 20:18:56 2023 +0000 Merge branch kvm-arm64/stage2-vhe-load into kvmarm/next * kvm-arm64/stage2-vhe-load: : Setup stage-2 MMU from vcpu_load() for VHE : : Unlike nVHE, there is no need to switch the stage-2 MMU around on guest : entry/exit in VHE mode as the host is running at EL2. Despite this KVM : reloads the stage-2 on every guest entry, which is needless. : : This series moves the setup of the stage-2 MMU context to vcpu_load() : when running in VHE mode. This is likely to be a win across the board, : but also allows us to remove an ISB on the guest entry path for systems : with one of the speculative AT errata. KVM: arm64: Move VTCR_EL2 into struct s2_mmu KVM: arm64: Load the stage-2 MMU context in kvm_vcpu_load_vhe() KVM: arm64: Rename helpers for VHE vCPU load/put KVM: arm64: Reload stage-2 for VMID change on VHE KVM: arm64: Restore the stage-2 context in VHE's __tlb_switch_to_host() KVM: arm64: Don't zero VTTBR in __tlb_switch_to_host() Signed-off-by: Oliver Upton commit 51e607961463f45646449a24574163838556d3ea Merge: 25a35c1a3d8fd 3f7915ccc9026 Author: Oliver Upton Date: Mon Oct 30 20:18:46 2023 +0000 Merge branch kvm-arm64/nv-trap-fixes into kvmarm/next * kvm-arm64/nv-trap-fixes: : NV trap forwarding fixes, courtesy Miguel Luis and Marc Zyngier : : - Explicitly define the effects of HCR_EL2.NV on EL2 sysregs in the : NV trap encoding : : - Make EL2 registers that access AArch32 guest state UNDEF or RAZ/WI : where appropriate for NV guests KVM: arm64: Handle AArch32 SPSR_{irq,abt,und,fiq} as RAZ/WI KVM: arm64: Do not let a L1 hypervisor access the *32_EL2 sysregs KVM: arm64: Refine _EL2 system register list that require trap reinjection arm64: Add missing _EL2 encodings arm64: Add missing _EL12 encodings Signed-off-by: Oliver Upton commit 25a35c1a3d8fd4b10805f05b109a76c9b8b0200c Merge: 7ff7dfe946ab6 4202bcac5e65d Author: Oliver Upton Date: Mon Oct 30 20:18:37 2023 +0000 Merge branch kvm-arm64/smccc-filter-cleanups into kvmarm/next * kvm-arm64/smccc-filter-cleanups: : Cleanup the management of KVM's SMCCC maple tree : : Avoid the cost of maintaining the SMCCC filter maple tree if userspace : hasn't writen a rule to the filter. While at it, rip out the now : unnecessary VM flag to indicate whether or not the SMCCC filter was : configured. KVM: arm64: Use mtree_empty() to determine if SMCCC filter configured KVM: arm64: Only insert reserved ranges when SMCCC filter is used KVM: arm64: Add a predicate for testing if SMCCC filter is configured Signed-off-by: Oliver Upton commit 7ff7dfe946ab696a3335a98bdc30210f2b567825 Merge: d47dcb67fcf61 ae8d3522e5b72 Author: Oliver Upton Date: Mon Oct 30 20:18:23 2023 +0000 Merge branch kvm-arm64/pmevtyper-filter into kvmarm/next * kvm-arm64/pmevtyper-filter: : Fixes to KVM's handling of the PMUv3 exception level filtering bits : : - NSH (count at EL2) and M (count at EL3) should be stateful when the : respective EL is advertised in the ID registers but have no effect on : event counting. : : - NSU and NSK modify the event filtering of EL0 and EL1, respectively. : Though the kernel may not use these bits, other KVM guests might. : Implement these bits exactly as written in the pseudocode if EL3 is : advertised. KVM: arm64: Add PMU event filter bits required if EL3 is implemented KVM: arm64: Make PMEVTYPER_EL0.NSH RES0 if EL2 isn't advertised Signed-off-by: Oliver Upton commit d47dcb67fcf619df971f2c6df6ce1a81426917b6 Merge: 054056bf98922 1de10b7d13a97 Author: Oliver Upton Date: Mon Oct 30 20:18:14 2023 +0000 Merge branch kvm-arm64/feature-flag-refactor into kvmarm/next * kvm-arm64/feature-flag-refactor: : vCPU feature flag cleanup : : Clean up KVM's handling of vCPU feature flags to get rid of the : vCPU-scoped bitmaps and remove failure paths from kvm_reset_vcpu(). KVM: arm64: Get rid of vCPU-scoped feature bitmap KVM: arm64: Remove unused return value from kvm_reset_vcpu() KVM: arm64: Hoist NV+SVE check into KVM_ARM_VCPU_INIT ioctl handler KVM: arm64: Prevent NV feature flag on systems w/o nested virt KVM: arm64: Hoist PAuth checks into KVM_ARM_VCPU_INIT ioctl KVM: arm64: Hoist SVE check into KVM_ARM_VCPU_INIT ioctl handler KVM: arm64: Hoist PMUv3 check into KVM_ARM_VCPU_INIT ioctl handler KVM: arm64: Add generic check for system-supported vCPU features Signed-off-by: Oliver Upton commit 054056bf98922767a7df93876ef09f20948b8693 Merge: 6465e260f4879 d11974dc5f208 Author: Oliver Upton Date: Mon Oct 30 20:18:00 2023 +0000 Merge branch kvm-arm64/misc into kvmarm/next * kvm-arm64/misc: : Miscellaneous updates : : - Put an upper bound on the number of I-cache invalidations by : cacheline to avoid soft lockups : : - Get rid of bogus refererence count transfer for THP mappings : : - Do a local TLB invalidation on permission fault race : : - Fixes for page_fault_test KVM selftest : : - Add a tracepoint for detecting MMIO instructions unsupported by KVM KVM: arm64: Add tracepoint for MMIO accesses where ISV==0 KVM: arm64: selftest: Perform ISB before reading PAR_EL1 KVM: arm64: selftest: Add the missing .guest_prepare() KVM: arm64: Always invalidate TLB for stage-2 permission faults KVM: arm64: Do not transfer page refcount for THP adjustment KVM: arm64: Avoid soft lockups due to I-cache maintenance arm64: tlbflush: Rename MAX_TLBI_OPS KVM: arm64: Don't use kerneldoc comment for arm64_check_features() Signed-off-by: Oliver Upton commit d11974dc5f208ae1c0fe62a9bcb47c0cdcd7b081 Author: Oliver Upton Date: Thu Oct 26 20:53:06 2023 +0000 KVM: arm64: Add tracepoint for MMIO accesses where ISV==0 It is a pretty well known fact that KVM does not support MMIO emulation without valid instruction syndrome information (ESR_EL2.ISV == 0). The current kvm_pr_unimpl() is pretty useless, as it contains zero context to relate the event to a vCPU. Replace it with a precise tracepoint that dumps the relevant context so the user can make sense of what the guest is doing. Acked-by: Zenghui Yu Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20231026205306.3045075-1-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 06899aa5dd3d76e888b28d7e8d7304c0a7ec6262 Author: Zenghui Yu Date: Sat Oct 7 20:40:43 2023 +0800 KVM: arm64: selftest: Perform ISB before reading PAR_EL1 It looks like a mistake to issue ISB *after* reading PAR_EL1, we should instead perform it between the AT instruction and the reads of PAR_EL1. As according to DDI0487J.a IJTYVP, "When an address translation instruction is executed, explicit synchronization is required to guarantee the result is visible to subsequent direct reads of PAR_EL1." Otherwise all guest_at testcases fail on my box with ==== Test Assertion Failure ==== aarch64/page_fault_test.c:142: par & 1 == 0 pid=1355864 tid=1355864 errno=4 - Interrupted system call 1 0x0000000000402853: vcpu_run_loop at page_fault_test.c:681 2 0x0000000000402cdb: run_test at page_fault_test.c:730 3 0x0000000000403897: for_each_guest_mode at guest_modes.c:100 4 0x00000000004019f3: for_each_test_and_guest_mode at page_fault_test.c:1105 5 (inlined by) main at page_fault_test.c:1131 6 0x0000ffffb153c03b: ?? ??:0 7 0x0000ffffb153c113: ?? ??:0 8 0x0000000000401aaf: _start at ??:? 0x1 != 0x0 (par & 1 != 0) Signed-off-by: Zenghui Yu Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20231007124043.626-2-yuzenghui@huawei.com Signed-off-by: Oliver Upton commit beaf35b480875d05d7c751d50951a659ce6dff94 Author: Zenghui Yu Date: Sat Oct 7 20:40:42 2023 +0800 KVM: arm64: selftest: Add the missing .guest_prepare() Running page_fault_test on a Cortex A72 fails with Test: ro_memslot_no_syndrome_guest_cas Testing guest mode: PA-bits:40, VA-bits:48, 4K pages Testing memory backing src type: anonymous ==== Test Assertion Failure ==== aarch64/page_fault_test.c:117: guest_check_lse() pid=1944087 tid=1944087 errno=4 - Interrupted system call 1 0x00000000004028b3: vcpu_run_loop at page_fault_test.c:682 2 0x0000000000402d93: run_test at page_fault_test.c:731 3 0x0000000000403957: for_each_guest_mode at guest_modes.c:100 4 0x00000000004019f3: for_each_test_and_guest_mode at page_fault_test.c:1108 5 (inlined by) main at page_fault_test.c:1134 6 0x0000ffff868e503b: ?? ??:0 7 0x0000ffff868e5113: ?? ??:0 8 0x0000000000401aaf: _start at ??:? guest_check_lse() because we don't have a guest_prepare stage to check the presence of FEAT_LSE and skip the related guest_cas testing, and we end-up failing in GUEST_ASSERT(guest_check_lse()). Add the missing .guest_prepare() where it's indeed required. Signed-off-by: Zenghui Yu Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20231007124043.626-1-yuzenghui@huawei.com Signed-off-by: Oliver Upton commit be097997a273259f1723baac5463cf19d8564efa Author: Oliver Upton Date: Fri Sep 22 22:32:29 2023 +0000 KVM: arm64: Always invalidate TLB for stage-2 permission faults It is possible for multiple vCPUs to fault on the same IPA and attempt to resolve the fault. One of the page table walks will actually update the PTE and the rest will return -EAGAIN per our race detection scheme. KVM elides the TLB invalidation on the racing threads as the return value is nonzero. Before commit a12ab1378a88 ("KVM: arm64: Use local TLBI on permission relaxation") KVM always used broadcast TLB invalidations when handling permission faults, which had the convenient property of making the stage-2 updates visible to all CPUs in the system. However now we do a local invalidation, and TLBI elision leads to the vCPU thread faulting again on the stale entry. Remember that the architecture permits the TLB to cache translations that precipitate a permission fault. Invalidate the TLB entry responsible for the permission fault if the stage-2 descriptor has been relaxed, regardless of which thread actually did the job. Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20230922223229.1608155-1-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 8b16da681eb0c9b9cb2f9abd0dade67559cfb48d Merge: 14ab6d425e806 3fd2ca5be07f6 Author: Linus Torvalds Date: Mon Oct 30 10:12:29 2023 -1000 Merge tag 'nfsd-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd updates from Chuck Lever: "This release completes the SunRPC thread scheduler work that was begun in v6.6. The scheduler can now find an svc thread to wake in constant time and without a list walk. Thanks again to Neil Brown for this overhaul. Lorenzo Bianconi contributed infrastructure for a netlink-based NFSD control plane. The long-term plan is to provide the same functionality as found in /proc/fs/nfsd, plus some interesting additions, and then migrate the NFSD user space utilities to netlink. A long series to overhaul NFSD's NFSv4 operation encoding was applied in this release. The goals are to bring this family of encoding functions in line with the matching NFSv4 decoding functions and with the NFSv2 and NFSv3 XDR functions, preparing the way for better memory safety and maintainability. A further improvement to NFSD's write delegation support was contributed by Dai Ngo. This adds a CB_GETATTR callback, enabling the server to retrieve cached size and mtime data from clients holding write delegations. If the server can retrieve this information, it does not have to recall the delegation in some cases. The usual panoply of bug fixes and minor improvements round out this release. As always I am grateful to all contributors, reviewers, and testers" * tag 'nfsd-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (127 commits) svcrdma: Fix tracepoint printk format svcrdma: Drop connection after an RDMA Read error NFSD: clean up alloc_init_deleg() NFSD: Fix frame size warning in svc_export_parse() NFSD: Rewrite synopsis of nfsd_percpu_counters_init() nfsd: Clean up errors in nfs3proc.c nfsd: Clean up errors in nfs4state.c NFSD: Clean up errors in stats.c NFSD: simplify error paths in nfsd_svc() NFSD: Clean up nfsd4_encode_seek() NFSD: Clean up nfsd4_encode_offset_status() NFSD: Clean up nfsd4_encode_copy_notify() NFSD: Clean up nfsd4_encode_copy() NFSD: Clean up nfsd4_encode_test_stateid() NFSD: Clean up nfsd4_encode_exchange_id() NFSD: Clean up nfsd4_do_encode_secinfo() NFSD: Clean up nfsd4_encode_access() NFSD: Clean up nfsd4_encode_readdir() NFSD: Clean up nfsd4_encode_entry4() NFSD: Add an nfsd4_encode_nfs_cookie4() helper ... commit ba026ac33694bab2d4383a8f432879dc8a02bf91 Author: Rob Herring Date: Fri Oct 20 12:02:24 2023 -0500 media: dt-bindings: ti,ds90ub960: Add missing type for "i2c-alias" Every DT property needs a type defined, but "i2c-alias" is missing any type definition. It's a "uint32", so add a type reference. Fixes: 313e8b32c616 ("media: dt-bindings: media: add TI DS90UB960 FPD-Link III Deserializer") Reviewed-by: Laurent Pinchart Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231020170225.3632933-1-robh@kernel.org Signed-off-by: Rob Herring commit 53ed3233e6b5fbfb63abc945d1fc156222f4eb62 Author: Dmitry Baryshkov Date: Thu Sep 28 14:02:34 2023 +0300 dt-bindings: input: qcom,pm8921-keypad: convert to YAML format Convert the bindings for the keypad subdevices of Qualcomm PM8921 and PM8058 PMICs from text to YAML format. While doing the conversion also drop the linux,keypad-no-autorepeat The property was never used by DT files. Both input and DT binding maintainers consider that bindings should switch to assertive (linux,autorepeat) instead of negating (no-autorepeat) property. Cc: Dmitry Torokhov Reviewed-by: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230928110309.1212221-2-dmitry.baryshkov@linaro.org Signed-off-by: Rob Herring commit 14ab6d425e80674b6a0145f05719b11e82e64824 Merge: 7352a6765cf5d 12cd440236516 Author: Linus Torvalds Date: Mon Oct 30 09:47:13 2023 -1000 Merge tag 'vfs-6.7.ctime' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs Pull vfs inode time accessor updates from Christian Brauner: "This finishes the conversion of all inode time fields to accessor functions as discussed on list. Changing timestamps manually as we used to do before is error prone. Using accessors function makes this robust. It does not contain the switch of the time fields to discrete 64 bit integers to replace struct timespec and free up space in struct inode. But after this, the switch can be trivially made and the patch should only affect the vfs if we decide to do it" * tag 'vfs-6.7.ctime' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs: (86 commits) fs: rename inode i_atime and i_mtime fields security: convert to new timestamp accessors selinux: convert to new timestamp accessors apparmor: convert to new timestamp accessors sunrpc: convert to new timestamp accessors mm: convert to new timestamp accessors bpf: convert to new timestamp accessors ipc: convert to new timestamp accessors linux: convert to new timestamp accessors zonefs: convert to new timestamp accessors xfs: convert to new timestamp accessors vboxsf: convert to new timestamp accessors ufs: convert to new timestamp accessors udf: convert to new timestamp accessors ubifs: convert to new timestamp accessors tracefs: convert to new timestamp accessors sysv: convert to new timestamp accessors squashfs: convert to new timestamp accessors server: convert to new timestamp accessors client: convert to new timestamp accessors ... commit 7352a6765cf5d95888b3952ac89efbb817b4c3cf Merge: df9c65b5fc7ef a640d888953cd Author: Linus Torvalds Date: Mon Oct 30 09:29:44 2023 -1000 Merge tag 'vfs-6.7.xattr' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs Pull vfs xattr updates from Christian Brauner: "The 's_xattr' field of 'struct super_block' currently requires a mutable table of 'struct xattr_handler' entries (although each handler itself is const). However, no code in vfs actually modifies the tables. This changes the type of 's_xattr' to allow const tables, and modifies existing file systems to move their tables to .rodata. This is desirable because these tables contain entries with function pointers in them; moving them to .rodata makes it considerably less likely to be modified accidentally or maliciously at runtime" * tag 'vfs-6.7.xattr' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs: (30 commits) const_structs.checkpatch: add xattr_handler net: move sockfs_xattr_handlers to .rodata shmem: move shmem_xattr_handlers to .rodata overlayfs: move xattr tables to .rodata xfs: move xfs_xattr_handlers to .rodata ubifs: move ubifs_xattr_handlers to .rodata squashfs: move squashfs_xattr_handlers to .rodata smb: move cifs_xattr_handlers to .rodata reiserfs: move reiserfs_xattr_handlers to .rodata orangefs: move orangefs_xattr_handlers to .rodata ocfs2: move ocfs2_xattr_handlers and ocfs2_xattr_handler_map to .rodata ntfs3: move ntfs_xattr_handlers to .rodata nfs: move nfs4_xattr_handlers to .rodata kernfs: move kernfs_xattr_handlers to .rodata jfs: move jfs_xattr_handlers to .rodata jffs2: move jffs2_xattr_handlers to .rodata hfsplus: move hfsplus_xattr_handlers to .rodata hfs: move hfs_xattr_handlers to .rodata gfs2: move gfs2_xattr_handlers_max to .rodata fuse: move fuse_xattr_handlers to .rodata ... commit df9c65b5fc7ef1caabdb7a01a2415cbb8a00908d Merge: 3b3f874cc1d07 b5f0e20f444cd Author: Linus Torvalds Date: Mon Oct 30 09:24:21 2023 -1000 Merge tag 'vfs-6.7.iov_iter' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs Pull iov_iter updates from Christian Brauner: "This contain's David's iov_iter cleanup work to convert the iov_iter iteration macros to inline functions: - Remove last_offset from iov_iter as it was only used by ITER_PIPE - Add a __user tag on copy_mc_to_user()'s dst argument on x86 to match that on powerpc and get rid of a sparse warning - Convert iter->user_backed to user_backed_iter() in the sound PCM driver - Convert iter->user_backed to user_backed_iter() in a couple of infiniband drivers - Renumber the type enum so that the ITER_* constants match the order in iterate_and_advance*() - Since the preceding patch puts UBUF and IOVEC at 0 and 1, change user_backed_iter() to just use the type value and get rid of the extra flag - Convert the iov_iter iteration macros to always-inline functions to make the code easier to follow. It uses function pointers, but they get optimised away - Move the check for ->copy_mc to _copy_from_iter() and copy_page_from_iter_atomic() rather than in memcpy_from_iter_mc() where it gets repeated for every segment. Instead, we check once and invoke a side function that can use iterate_bvec() rather than iterate_and_advance() and supply a different step function - Move the copy-and-csum code to net/ where it can be in proximity with the code that uses it - Fold memcpy_and_csum() in to its two users - Move csum_and_copy_from_iter_full() out of line and merge in csum_and_copy_from_iter() since the former is the only caller of the latter - Move hash_and_copy_to_iter() to net/ where it can be with its only caller" * tag 'vfs-6.7.iov_iter' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs: iov_iter, net: Move hash_and_copy_to_iter() to net/ iov_iter, net: Merge csum_and_copy_from_iter{,_full}() together iov_iter, net: Fold in csum_and_memcpy() iov_iter, net: Move csum_and_copy_to/from_iter() to net/ iov_iter: Don't deal with iter->copy_mc in memcpy_from_iter_mc() iov_iter: Convert iterate*() to inline funcs iov_iter: Derive user-backedness from the iterator type iov_iter: Renumber ITER_* constants infiniband: Use user_backed_iter() to see if iterator is UBUF/IOVEC sound: Fix snd_pcm_readv()/writev() to use iov access functions iov_iter, x86: Be consistent about the __user tag on copy_mc_to_user() iov_iter: Remove last_offset from iov_iter as it was for ITER_PIPE commit 3b3f874cc1d074bdcffc224d683925fd11808fe7 Merge: 0d63d8b2294b2 61d4fb0b349ec Author: Linus Torvalds Date: Mon Oct 30 09:14:19 2023 -1000 Merge tag 'vfs-6.7.misc' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs Pull misc vfs updates from Christian Brauner: "This contains the usual miscellaneous features, cleanups, and fixes for vfs and individual fses. Features: - Rename and export helpers that get write access to a mount. They are used in overlayfs to get write access to the upper mount. - Print the pretty name of the root device on boot failure. This helps in scenarios where we would usually only print "unknown-block(1,2)". - Add an internal SB_I_NOUMASK flag. This is another part in the endless POSIX ACL saga in a way. When POSIX ACLs are enabled via SB_POSIXACL the vfs cannot strip the umask because if the relevant inode has POSIX ACLs set it might take the umask from there. But if the inode doesn't have any POSIX ACLs set then we apply the umask in the filesytem itself. So we end up with: (1) no SB_POSIXACL -> strip umask in vfs (2) SB_POSIXACL -> strip umask in filesystem The umask semantics associated with SB_POSIXACL allowed filesystems that don't even support POSIX ACLs at all to raise SB_POSIXACL purely to avoid umask stripping. That specifically means NFS v4 and Overlayfs. NFS v4 does it because it delegates this to the server and Overlayfs because it needs to delegate umask stripping to the upper filesystem, i.e., the filesystem used as the writable layer. This went so far that SB_POSIXACL is raised eve on kernels that don't even have POSIX ACL support at all. Stop this blatant abuse and add SB_I_NOUMASK which is an internal superblock flag that filesystems can raise to opt out of umask handling. That should really only be the two mentioned above. It's not that we want any filesystems to do this. Ideally we have all umask handling always in the vfs. - Make overlayfs use SB_I_NOUMASK too. - Now that we have SB_I_NOUMASK, stop checking for SB_POSIXACL in IS_POSIXACL() if the kernel doesn't have support for it. This is a very old patch but it's only possible to do this now with the wider cleanup that was done. - Follow-up work on fake path handling from last cycle. Citing mostly from Amir: When overlayfs was first merged, overlayfs files of regular files and directories, the ones that are installed in file table, had a "fake" path, namely, f_path is the overlayfs path and f_inode is the "real" inode on the underlying filesystem. In v6.5, we took another small step by introducing of the backing_file container and the file_real_path() helper. This change allowed vfs and filesystem code to get the "real" path of an overlayfs backing file. With this change, we were able to make fsnotify work correctly and report events on the "real" filesystem objects that were accessed via overlayfs. This method works fine, but it still leaves the vfs vulnerable to new code that is not aware of files with fake path. A recent example is commit db1d1e8b9867 ("IMA: use vfs_getattr_nosec to get the i_version"). This commit uses direct referencing to f_path in IMA code that otherwise uses file_inode() and file_dentry() to reference the filesystem objects that it is measuring. This contains work to switch things around: instead of having filesystem code opt-in to get the "real" path, have generic code opt-in for the "fake" path in the few places that it is needed. Is it far more likely that new filesystems code that does not use the file_dentry() and file_real_path() helpers will end up causing crashes or averting LSM/audit rules if we keep the "fake" path exposed by default. This change already makes file_dentry() moot, but for now we did not change this helper just added a WARN_ON() in ovl_d_real() to catch if we have made any wrong assumptions. After the dust settles on this change, we can make file_dentry() a plain accessor and we can drop the inode argument to ->d_real(). - Switch struct file to SLAB_TYPESAFE_BY_RCU. This looks like a small change but it really isn't and I would like to see everyone on their tippie toes for any possible bugs from this work. Essentially we've been doing most of what SLAB_TYPESAFE_BY_RCU for files since a very long time because of the nasty interactions between the SCM_RIGHTS file descriptor garbage collection. So extending it makes a lot of sense but it is a subtle change. There are almost no places that fiddle with file rcu semantics directly and the ones that did mess around with struct file internal under rcu have been made to stop doing that because it really was always dodgy. I forgot to put in the link tag for this change and the discussion in the commit so adding it into the merge message: https://lore.kernel.org/r/20230926162228.68666-1-mjguzik@gmail.com Cleanups: - Various smaller pipe cleanups including the removal of a spin lock that was only used to protect against writes without pipe_lock() from O_NOTIFICATION_PIPE aka watch queues. As that was never implemented remove the additional locking from pipe_write(). - Annotate struct watch_filter with the new __counted_by attribute. - Clarify do_unlinkat() cleanup so that it doesn't look like an extra iput() is done that would cause issues. - Simplify file cleanup when the file has never been opened. - Use module helper instead of open-coding it. - Predict error unlikely for stale retry. - Use WRITE_ONCE() for mount expiry field instead of just commenting that one hopes the compiler doesn't get smart. Fixes: - Fix readahead on block devices. - Fix writeback when layztime is enabled and inodes whose timestamp is the only thing that changed reside on wb->b_dirty_time. This caused excessively large zombie memory cgroup when lazytime was enabled as such inodes weren't handled fast enough. - Convert BUG_ON() to WARN_ON_ONCE() in open_last_lookups()" * tag 'vfs-6.7.misc' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs: (26 commits) file, i915: fix file reference for mmap_singleton() vfs: Convert BUG_ON to WARN_ON_ONCE in open_last_lookups writeback, cgroup: switch inodes with dirty timestamps to release dying cgwbs chardev: Simplify usage of try_module_get() ovl: rely on SB_I_NOUMASK fs: fix umask on NFS with CONFIG_FS_POSIX_ACL=n fs: store real path instead of fake path in backing file f_path fs: create helper file_user_path() for user displayed mapped file path fs: get mnt_writers count for an open backing file's real path vfs: stop counting on gcc not messing with mnt_expiry_mark if not asked vfs: predict the error in retry_estale as unlikely backing file: free directly vfs: fix readahead(2) on block devices io_uring: use files_lookup_fd_locked() file: convert to SLAB_TYPESAFE_BY_RCU vfs: shave work on failed file open fs: simplify misleading code to remove ambiguity regarding ihold()/iput() watch_queue: Annotate struct watch_filter with __counted_by fs/pipe: use spinlock in pipe_read() only if there is a watch_queue fs/pipe: remove unnecessary spinlock from pipe_write() ... commit 0d63d8b2294b228147bf58def506dde35e57daef Merge: d4e175f2c460f d3c50061765d4 Author: Linus Torvalds Date: Mon Oct 30 09:10:21 2023 -1000 Merge tag 'vfs-6.7.autofs' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs Pull autofs mount api updates from Christian Brauner: "This ports autofs to the new mount api. The patchset has existed for quite a while but never made it upstream. Ian picked it back up. This also fixes a bug where fs_param_is_fd() was passed a garbage param->dirfd but it expected it to be set to the fd that was used to set param->file otherwise result->uint_32 contains nonsense. So make sure it's set. One less filesystem using the old mount api. We're getting there, albeit rather slow. The last remaining major filesystem that hasn't converted is btrfs. Patches exist - I even wrote them - but so far they haven't made it upstream" * tag 'vfs-6.7.autofs' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs: autofs: fix add autofs_parse_fd() fsconfig: ensure that dirfd is set to aux autofs: fix protocol sub version setting autofs: convert autofs to use the new mount api autofs: validate protocol version autofs: refactor parse_options() autofs: reformat 0pt enum declaration autofs: refactor super block info init autofs: add autofs_parse_fd() autofs: refactor autofs_prepare_pipe() commit d4e175f2c460fd54011117d835aa017d2d4a8c08 Merge: ffc253263a137 5aa9130acb98b Author: Linus Torvalds Date: Mon Oct 30 08:59:05 2023 -1000 Merge tag 'vfs-6.7.super' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs Pull vfs superblock updates from Christian Brauner: "This contains the work to make block device opening functions return a struct bdev_handle instead of just a struct block_device. The same struct bdev_handle is then also passed to block device closing functions. This allows us to propagate context from opening to closing a block device without having to modify all users everytime. Sidenote, in the future we might even want to try and have block device opening functions return a struct file directly but that's a series on top of this. These are further preparatory changes to be able to count writable opens and blocking writes to mounted block devices. That's a separate piece of work for next cycle and for that we absolutely need the changes to btrfs that have been quietly dropped somehow. Originally the series contained a patch that removed the old blkdev_*() helpers. But since this would've caused needles churn in -next for bcachefs we ended up delaying it. The second piece of work addresses one of the major annoyances about the work last cycle, namely that we required dropping s_umount whenever we used the superblock and fs_holder_ops for a block device. The reason for that requirement had been that in some codepaths s_umount could've been taken under disk->open_mutex (that's always been the case, at least theoretically). For example, on surprise block device removal or media change. And opening and closing block devices required grabbing disk->open_mutex as well. So we did the work and went through the block layer and fixed all those places so that s_umount is never taken under disk->open_mutex. This means no more brittle games where we yield and reacquire s_umount during block device opening and closing and no more requirements where block devices need to be closed. Filesystems don't need to care about this. There's a bunch of other follow-up work such as moving block device freezing and thawing to holder operations which makes it work for all block devices and not just the main block device just as we did for surprise removal. But that is for next cycle. Tested with fstests for all major fses, blktests, LTP" * tag 'vfs-6.7.super' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs: (37 commits) porting: update locking requirements fs: assert that open_mutex isn't held over holder ops block: assert that we're not holding open_mutex over blk_report_disk_dead block: move bdev_mark_dead out of disk_check_media_change block: WARN_ON_ONCE() when we remove active partitions block: simplify bdev_del_partition() fs: Avoid grabbing sb->s_umount under bdev->bd_holder_lock jfs: fix log->bdev_handle null ptr deref in lbmStartIO bcache: Fixup error handling in register_cache() xfs: Convert to bdev_open_by_path() reiserfs: Convert to bdev_open_by_dev/path() ocfs2: Convert to use bdev_open_by_dev() nfs/blocklayout: Convert to use bdev_open_by_dev/path() jfs: Convert to bdev_open_by_dev() f2fs: Convert to bdev_open_by_dev/path() ext4: Convert to bdev_open_by_dev() erofs: Convert to use bdev_open_by_path() btrfs: Convert to bdev_open_by_path() fs: Convert to bdev_open_by_dev() mm/swap: Convert to use bdev_open_by_dev() ... commit 696444a544ecd6d62c1edc89516b376cefb28929 Author: Colin Ian King Date: Thu Jul 27 16:01:17 2023 +0100 rtla: Fix uninitialized variable found Variable found is not being initialized, in the case where the desired mount is not found the variable contains garbage. Fix this by initializing it to zero. Link: https://lore.kernel.org/all/20230727150117.627730-1-colin.i.king@gmail.com/ Fixes: a957cbc02531 ("rtla: Add -C cgroup support") Signed-off-by: Colin Ian King Signed-off-by: Daniel Bristot de Oliveira commit cba4590036855f4e3110d43c14385d2401080dbb Author: Nathan Chancellor Date: Fri Oct 27 09:54:25 2023 -0700 ASoC: codecs: aw88399: Fix -Wuninitialized in aw_dev_set_vcalb() Clang warns (or errors with CONFIG_WERROR=y): sound/soc/codecs/aw88399.c:441:18: error: variable 'vsense_select' is uninitialized when used here [-Werror,-Wuninitialized] 441 | vsense_select = vsense_select & (~AW88399_VDSEL_MASK); | ^~~~~~~~~~~~~ sound/soc/codecs/aw88399.c:431:28: note: initialize the variable 'vsense_select' to silence this warning 431 | unsigned int vsense_select, vsense_value; | ^ | = 0 1 error generated. This clearly should have been using the value received from regmap_read(). Use the correct variable to resolve the warning. Closes: https://github.com/ClangBuiltLinux/linux/issues/1952 Fixes: 8ade6cc7e261 ("ASoC: codecs: Add aw88399 amplifier driver") Signed-off-by: Nathan Chancellor Reviewed-by: Weidong Wang Link: https://lore.kernel.org/r/20231027-asoc-aw88399-fix-wuninitialized-v1-1-b1044493e4cd@kernel.org Signed-off-by: Mark Brown commit cf63348b4c45384d02126f86676d5afc75d661a7 Author: Yujie Liu Date: Mon Oct 30 16:54:04 2023 +0800 scripts/kernel-doc: Fix the regex for matching -Werror flag Swarup reported a "make htmldocs" warning: Variable length lookbehind is experimental in regex; marked by <-- HERE in m/(?<=^|\s)-Werror(?=$|\s) <-- HERE / at ./scripts/kernel-doc line 188. Akira managed to reproduce it by perl v5.34.0. On second thought, it is not necessary to have the complicated "lookahead and lookbehind" things, and the regex can be simplified. Generally, the kernel-doc warnings should be considered as errors only when "-Werror" flag is set in KCFLAGS, but not when "-Werror=" is set, which means there needs to be a space or start of string before "-Werror", and a space or end of string after "-Werror". The following cases have been tested to work as expected: * kernel-doc warnings are considered as errors: $ KCFLAGS="-Werror" make W=1 $ KCFLAGS="-Wcomment -Werror" make W=1 $ KCFLAGS="-Werror -Wundef" make W=1 $ KCFLAGS="-Wcomment -Werror -Wundef" make W=1 * kernel-doc warnings remain as warnings: $ KCFLAGS="-Werror=return-type" make W=1 $ KCFLAGS="-Wcomment -Werror=return-type" make W=1 $ KCFLAGS="-Werror=return-type -Wundef" make W=1 $ KCFLAGS="-Wcomment -Werror=return-type -Wundef" make W=1 The "Variable length lookbehind is experimental in regex" warning is also resolved by this patch. Fixes: 91f950e8b9d8 ("scripts/kernel-doc: match -Werror flag strictly") Reported-by: Swarup Laxman Kotiaklapudi Signed-off-by: Yujie Liu Closes: https://lore.kernel.org/r/20231028182231.123996-1-swarupkotikalapudi@gmail.com/ Reviewed-by: Akira Yokosawa Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20231030085404.3343403-1-yujie.liu@intel.com commit a0c04a3243f1db6cb47b04ba05b65af97f75a278 Author: Alessandro Carminati (Red Hat) Date: Wed Sep 6 15:57:03 2023 +0000 verification/dot2k: Delete duplicate imports The presence of duplicate import lines appears to be a typo. Removing them. Link: https://lore.kernel.org/r/20230906155703.3917918-1-alessandro.carminati@gmail.com Fixes: 24bce201d798 ("tools/rv: Add dot2k") Signed-off-by: Alessandro Carminati (Red Hat) Signed-off-by: Daniel Bristot de Oliveira commit 1a3b7eab8500a6b923f7b62cc8aa4d832c7dfb3e Author: Shuming Fan Date: Mon Oct 30 18:36:44 2023 +0800 ASoC: rt712-sdca: fix speaker route missing issue Sometimes the codec probe would be called earlier than the hardware initialization. Therefore, the speaker route should be added before the the first_hw_init check. Signed-off-by: Shuming Fan Fixes: f3da2ed110e2 ("ASoC: rt1712-sdca: enable pm_runtime in probe, keep status as 'suspended'")? Link: https://lore.kernel.org/r/20231030103644.1787948-1-shumingf@realtek.com Signed-off-by: Mark Brown commit 04f8c76de983a5c1e8913e442e791a9e8d0e0dfd Author: Rob Herring Date: Mon Oct 30 09:23:38 2023 -0500 ASoC: rockchip: Fix unused rockchip_i2s_tdm_match warning for !CONFIG_OF Commit 9958d85968ed ("ASoC: Use device_get_match_data()") dropped the unconditional use of rockchip_i2s_tdm_match resulting in this warning: sound/soc/rockchip/rockchip_i2s_tdm.c:1315:34: warning: 'rockchip_i2s_tdm_match' defined but not used [-Wunused-const-variable=] The fix is to drop of_match_ptr() which is not necessary because DT is always used for this driver. Fixes: 9958d85968ed ("ASoC: Use device_get_match_data()") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310121802.CDAGVdF2-lkp@intel.com/ Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231030142337.814907-2-robh@kernel.org Signed-off-by: Mark Brown commit 2e22aac3ea9cfc0ec3209c96644f60c1806a8117 Author: Joao Martins Date: Mon Oct 30 11:34:46 2023 +0000 iommufd/selftest: Fix page-size check in iommufd_test_dirty() iommufd_test_dirty()/IOMMU_TEST_OP_DIRTY sets the dirty bits in the mock domain implementation that the userspace side validates against what it obtains via the UAPI. However in introducing iommufd_test_dirty() it forgot to validate page_size being 0 leading to two possible divide-by-zero problems: one at the beginning when calculating @max and while calculating the IOVA in the XArray PFN tracking list. While at it, validate the length to require non-zero value as well, as we can't be allocating a 0-sized bitmap. Link: https://lore.kernel.org/r/20231030113446.7056-1-joao.m.martins@oracle.com Reported-by: syzbot+25dc7383c30ecdc83c38@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-iommu/00000000000005f6aa0608b9220f@google.com/ Fixes: a9af47e382a4 ("iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP") Signed-off-by: Joao Martins Signed-off-by: Jason Gunthorpe commit 7588b83066db9b9dc10c1a43b8e52a028ad327d2 Author: Steve French Date: Sun Oct 8 23:04:01 2023 -0500 Add definition for new smb3.1.1 command type Add structs and defines for new SMB3.1.1 command, server to client notification. See MS-SMB2 section 2.2.44 Signed-off-by: Steve French commit d5a3c153fd00f5e951c4f20b4c65feb1e1cfbfcb Author: Steve French Date: Sun Oct 8 23:11:38 2023 -0500 SMB3: clarify some of the unused CreateOption flags Update comments to show flags which should be not set (zero). See MS-SMB2 section 2.2.13 Signed-off-by: Steve French commit 361d744ddd61de065fbeb042aaed590d32dd92ec Author: Jason Gunthorpe Date: Mon Oct 30 11:26:33 2023 -0300 iommufd: Add iopt_area_alloc() We never initialize the two interval tree nodes, and zero fill is not the same as RB_CLEAR_NODE. This can hide issues where we missed adding the area to the trees. Factor out the allocation and clear the two nodes. Fixes: 51fe6141f0f6 ("iommufd: Data structure to provide IOVA to PFN mapping") Link: https://lore.kernel.org/r/20231030145035.GG691768@ziepe.ca Signed-off-by: Jason Gunthorpe commit e7250ab7ca4998fe026f2149805b03e09dc32498 Author: Koichiro Den Date: Sat Oct 28 01:29:42 2023 +0900 iommufd: Fix missing update of domains_itree after splitting iopt_area In iopt_area_split(), if the original iopt_area has filled a domain and is linked to domains_itree, pages_nodes have to be properly reinserted. Otherwise the domains_itree becomes corrupted and we will UAF. Fixes: 51fe6141f0f6 ("iommufd: Data structure to provide IOVA to PFN mapping") Link: https://lore.kernel.org/r/20231027162941.2864615-2-den@valinux.co.jp Cc: stable@vger.kernel.org Signed-off-by: Koichiro Den Signed-off-by: Jason Gunthorpe commit 8a32aa17c1cd48df1ddaa78e45abcb8c7a2220d6 Author: Helge Deller Date: Fri Oct 27 13:36:48 2023 +0200 fbdev: stifb: Make the STI next font pointer a 32-bit signed offset The pointer to the next STI font is actually a signed 32-bit offset. With this change the 64-bit kernel will correctly subract the (signed 32-bit) offset instead of adding a (unsigned 32-bit) offset. It has no effect on 32-bit kernels. This fixes the stifb driver with a 64-bit kernel on qemu. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org commit b63b4f1a79e6ad34e110b547efee9f2256da2bde Author: Helge Deller Date: Mon Oct 23 20:38:08 2023 +0200 parisc: Show default CPU PSW.W setting as reported by PDC The last word shows the default PSW.W setting. Signed-off-by: Helge Deller commit 6240553b52c475d9fc9674de0521b77e692f3764 Author: Helge Deller Date: Sun Oct 22 11:48:11 2023 +0200 parisc/pdc: Add width field to struct pdc_model PDC2.0 specifies the additional PSW-bit field. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org commit ad4aa06e1d92b06ed56c7240252927bd60632efe Author: John David Anglin Date: Fri Oct 20 20:49:07 2023 +0000 parisc: Add nop instructions after TLB inserts An excerpt from the PA8800 ERS states: * The PA8800 violates the seven instruction pipeline rule when performing TLB inserts or PxTLBE instructions with the PSW C bit on. The instruction will take effect by the 12th instruction after the insert or purge. I believe we have a problem with handling TLB misses. We don't fill the pipeline following TLB inserts. As a result, we likely fault again after returning from the interruption. The above statement indicates that we need at least seven instructions after the insert on pre PA8800 processors and we need 12 instructions on PA8800/PA8900 processors. Here we add macros and code to provide the required number instructions after a TLB insert. Signed-off-by: John David Anglin Suggested-by: Helge Deller Cc: stable@vger.kernel.org Signed-off-by: Helge Deller commit 1c7431b39a9ca14f7d3d57fce80838c8550b7db3 Author: Russell King (Oracle) Date: Fri Oct 20 15:45:30 2023 +0100 parisc: simplify smp_prepare_boot_cpu() smp_prepare_boot_cpu() reads the cpuid of the first CPU, printing a message to state which processor booted, and setting it online and present. This cpuid is retrieved from per_cpu(cpu_data, 0).cpuid, which is initialised in arch/parisc/kernel/processor.c:processor_probe() thusly: p = &per_cpu(cpu_data, cpuid); ... p->cpuid = cpuid; /* save CPU id */ Consequently, the cpuid retrieved seems to be guaranteed to also be zero, meaning that the message printed in this boils down to: pr_info("SMP: bootstrap CPU ID is 0\n"); Moreover, since kernel/cpu.c::boot_cpu_init() already sets CPU 0 to be present and online, there is no need to do this again in smp_prepare_boot_cpu(). Remove this code, and simplify the printk(). Signed-off-by: Russell King (Oracle) Signed-off-by: Helge Deller commit 86bb854d134f4429feb35d2e05f55c6e036770d2 Author: Helge Deller Date: Wed Oct 18 19:24:14 2023 +0200 parisc/agp: Use 64-bit LE values in SBA IOMMU PDIR table The PDIR table of the System Bus Adapter (SBA) I/O MMU uses 64-bit little-endian pointers. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v6.4+ commit 9f5989d79d3b89246e5e8e5147eeb8c3ae71e6e1 Author: Helge Deller Date: Wed Oct 18 19:52:39 2023 +0200 parisc/firmware: Use PDC constants for narrow/wide firmware PDC uses the PDC_MODEL_OS64 and PDC_MODEL_OS32 constants, so use those constants for the internal WIDE_FIRMWARE/NARROW_FIRMWARE too. Signed-off-by: Helge Deller commit 06a2e4998a0879cb24b0536b26c7a07482ed274e Author: Helge Deller Date: Wed Oct 18 19:47:29 2023 +0200 parisc: Move parisc_narrow_firmware variable to header file Signed-off-by: Helge Deller commit fe0a9b8b22248eb74983ae37af9347c1c068012c Author: Helge Deller Date: Tue Oct 17 22:33:30 2023 +0200 parisc/power: Trivial whitespace cleanups and license update Signed-off-by: Helge Deller commit d0c219472980d15f5cbc5c8aec736848bda3f235 Author: Helge Deller Date: Tue Oct 17 22:19:53 2023 +0200 parisc/power: Add power soft-off when running on qemu Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v6.0+ commit 01fef8267390ccb6e763a8aa90b6a10385aa3145 Author: Helge Deller Date: Tue Oct 17 21:00:11 2023 +0200 parisc: Allow building uncompressed Linux kernel Add HAVE_KERNEL_UNCOMPRESSED flag and fix build in boot directory. Signed-off-by: Helge Deller commit b9c515f7e3f52151e33e982f982f369975734e1d Author: Helge Deller Date: Tue Oct 17 20:45:58 2023 +0200 parisc: Add some missing PDC functions and constants Signed-off-by: Helge Deller commit 58ad89e866768b0af962305b6c714ea8f0b5ca51 Author: Helge Deller Date: Tue Oct 17 20:40:45 2023 +0200 parisc: sba-iommu: Fix comment when calculating IOC number Signed-off-by: Helge Deller commit 63bffc2d3a99eaabc786c513eea71be3f597f175 Author: Rob Herring Date: Mon Oct 9 12:29:13 2023 -0500 pinctrl: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20231009172923.2457844-18-robh@kernel.org Signed-off-by: Linus Walleij commit fbb74e56378d8306f214658e3d525a8b3f000c5a Author: Tony Lindgren Date: Mon Oct 30 07:23:38 2023 +0200 ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings We need to check for an active device as otherwise we get warnings for some mcbsp instances for "Runtime PM usage count underflow!". Reported-by: Andreas Kemnade Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20231030052340.13415-1-tony@atomide.com Signed-off-by: Mark Brown commit 1b2e883e1af895b62808b044ac96b77e7c9017b1 Merge: 75223bbea840e c3aa5cb264a38 Author: Mark Brown Date: Mon Oct 30 13:20:58 2023 +0000 spi: Merge up fix One small fix that didn't seem worth sending before the merge window. commit 3e0569ff812675e896cbdcbbaec10c99b544b947 Merge: 804bf07a1f726 bc00d9f3813a4 Author: Mark Brown Date: Mon Oct 30 13:14:27 2023 +0000 regulator: Merge up pending fix One small fix didn't get sent before the merge window. commit 6bbebcc11a69aef269eb2a33212f76992a4cfb1a Merge: 6a2e332c2cbdd 0ec7731655de1 Author: Mark Brown Date: Mon Oct 30 13:05:15 2023 +0000 regmap: Merge up fix for window/paging issue This was too late and could potentially impact too many drivers for me to be comfortable sending it before the merge window. commit 471aa951bf1206d3c10d0daa67005b8e4db4ff83 Author: Harshit Mogalapalli Date: Fri Oct 27 10:28:22 2023 -0700 i915/perf: Fix NULL deref bugs with drm_dbg() calls When i915 perf interface is not available dereferencing it will lead to NULL dereferences. As returning -ENOTSUPP is pretty clear return when perf interface is not available. Fixes: 2fec539112e8 ("i915/perf: Replace DRM_DEBUG with driver specific drm_dbg call") Suggested-by: Tvrtko Ursulin Signed-off-by: Harshit Mogalapalli Reviewed-by: Tvrtko Ursulin Cc: # v6.0+ Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20231027172822.2753059-1-harshit.m.mogalapalli@oracle.com [tursulin: added stable tag] (cherry picked from commit 36f27350ff745bd228ab04d7845dfbffc177a889) Signed-off-by: Jani Nikula commit ce4941c2d6459664761c9854701015d8e99414fb Author: Chaitanya Kumar Borah Date: Wed Oct 18 17:06:22 2023 +0530 drm/i915/mtl: Support HBR3 rate with C10 phy and eDP in MTL eDP specification supports HBR3 link rate since v1.4a. Moreover, C10 phy can support HBR3 link rate for both DP and eDP. Therefore, do not clamp the supported rates for eDP at 6.75Gbps. Cc: BSpec: 70073 74224 Signed-off-by: Chaitanya Kumar Borah Reviewed-by: Mika Kahola Signed-off-by: Mika Kahola Link: https://patchwork.freedesktop.org/patch/msgid/20231018113622.2761997-1-chaitanya.kumar.borah@intel.com (cherry picked from commit a3431650f30a94b179d419ef87c21213655c28cd) Signed-off-by: Jani Nikula commit 7d7a328d0e8d6edefb7b0d665185d468667588d0 Author: Nirmoy Das Date: Wed Oct 18 11:38:15 2023 +0200 drm/i915: Flush WC GGTT only on required platforms gen8_ggtt_invalidate() is only needed for limited set of platforms where GGTT is mapped as WC. This was added as way to fix WC based GGTT in commit 0f9b91c754b7 ("drm/i915: flush system agent TLBs on SNB") and there are no reference in HW docs that forces us to use this on non-WC backed GGTT. This can also cause unwanted side-effects on XE_HP platforms where GFX_FLSH_CNTL_GEN6 is not valid anymore. v2: Add a func to detect wc ggtt detection (Ville) v3: Improve commit log and add reference commit (Daniel) Fixes: d2eae8e98d59 ("drm/i915/dg2: Drop force_probe requirement") Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: Joonas Lahtinen Cc: Jani Nikula Cc: Jonathan Cavitt Cc: John Harrison Cc: Andi Shyti Cc: Ville Syrjälä Cc: Daniel Vetter Cc: # v6.2+ Suggested-by: Matt Roper Signed-off-by: Nirmoy Das Reviewed-by: Matt Roper Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231018093815.1349-1-nirmoy.das@intel.com (cherry picked from commit 81de3e296b10a13e5c9f13172825b0d8d9495c68) Signed-off-by: Jani Nikula commit 390001d648ffa027b750b7dceb5d43f4c1d1a39e Author: Arnd Bergmann Date: Mon Oct 16 22:10:04 2023 +0200 drm/i915/mtl: avoid stringop-overflow warning The newly added memset() causes a warning for some reason I could not figure out: In file included from arch/x86/include/asm/string.h:3, from drivers/gpu/drm/i915/gt/intel_rc6.c:6: In function 'rc6_res_reg_init', inlined from 'intel_rc6_init' at drivers/gpu/drm/i915/gt/intel_rc6.c:610:2: arch/x86/include/asm/string_32.h:195:29: error: '__builtin_memset' writing 16 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=] 195 | #define memset(s, c, count) __builtin_memset(s, c, count) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/i915/gt/intel_rc6.c:584:9: note: in expansion of macro 'memset' 584 | memset(rc6->res_reg, INVALID_MMIO_REG.reg, sizeof(rc6->res_reg)); | ^~~~~~ In function 'intel_rc6_init': Change it to an normal initializer and an added memcpy() that does not have this problem. Fixes: 4bb9ca7ee074 ("drm/i915/mtl: C6 residency and C state type for MTL SAMedia") Signed-off-by: Arnd Bergmann Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20231016201012.1022812-1-arnd@kernel.org (cherry picked from commit 0520b30b219053cd789909bca45b3c486ef3ee09) Signed-off-by: Jani Nikula commit 94565e95e247c188fed4d3da1034402f3fb297de Author: Javier Martinez Canillas Date: Sat Oct 21 00:52:57 2023 +0200 drm/ssd130x: Fix possible uninitialized usage of crtc_state variable Avoid a possible uninitialized use of the crtc_state variable in function ssd132x_primary_plane_atomic_check() and avoid the following Smatch warn: drivers/gpu/drm/solomon/ssd130x.c:921 ssd132x_primary_plane_atomic_check() error: uninitialized symbol 'crtc_state'. Fixes: fdd591e00a9c ("drm/ssd130x: Add support for the SSD132x OLED controller family") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/dri-devel/7dd6ca45-8263-44fe-a318-2fd9d761425d@moroto.mountain/ Signed-off-by: Javier Martinez Canillas Acked-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231020225338.1686974-1-javierm@redhat.com (cherry picked from commit 9e4db199e66d427c50458f4d72734cc4f0b92948) Signed-off-by: Javier Martinez Canillas commit a49cf37d538c764a687ff4be9d279b878a3e6521 Author: Javier Martinez Canillas Date: Sat Oct 21 00:30:17 2023 +0200 dt-bindings: display: ssd132x: Remove '-' before compatible enum This is a leftover from when the binding schema had the compatible string property enum as a 'oneOf' child and the '-' was not removed when 'oneOf' got dropped during the binding review process. Reported-by: Rob Herring Closes: https://lore.kernel.org/dri-devel/CAL_Jsq+h8DcnpKqhokQOODCc8+Qi3M0PrxRFKz_Y4v37yMJvvA@mail.gmail.com/ Signed-off-by: Javier Martinez Canillas Acked-by: Conor Dooley Reviewed-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20231020223029.1667190-1-javierm@redhat.com (cherry picked from commit 171c5f641031c0eee424ba79a3db4736c32e18ca) Signed-off-by: Javier Martinez Canillas commit a4000df5300fdbe10d84e3b70e2d6a98686310a9 Author: Greg Kroah-Hartman Date: Mon Oct 30 09:54:14 2023 +0100 Revert "staging: octeon: remove typedef in enum cvmx_spi_mode_t" This reverts commit 7bebd832177670e6cce1783cf144f989cd3cf4b5. The patch series that removed typedefs from the octeon driver was not actually built properly, and broke the build (it's hard to test-build this driver for some reason.) Remove them all at this point in time to make sure the build works properly. Link: https://lore.kernel.org/r/32e9ad3c-191e-4dd1-b1cc-07f7b93c3f28@roeck-us.net Reported-by: Guenter Roeck Cc: Oliver Crumrine Signed-off-by: Greg Kroah-Hartman commit 3db9eb6dee8aacf27903bc84c3a68d05d1d49519 Author: Greg Kroah-Hartman Date: Mon Oct 30 09:54:14 2023 +0100 Revert "staging: octeon: remove typedef in enum cvmx_helper_interface_mode_t" This reverts commit a13f7e45823cd29af716ed6be1f53a344e0b9268. The patch series that removed typedefs from the octeon driver was not actually built properly, and broke the build (it's hard to test-build this driver for some reason.) Remove them all at this point in time to make sure the build works properly. Link: https://lore.kernel.org/r/32e9ad3c-191e-4dd1-b1cc-07f7b93c3f28@roeck-us.net Reported-by: Guenter Roeck Cc: Oliver Crumrine Signed-off-by: Greg Kroah-Hartman commit d8fecfe8f41edf6762256f9a888e9f906181a641 Author: Greg Kroah-Hartman Date: Mon Oct 30 09:54:13 2023 +0100 Revert "staging: octeon: remove typedef in enum cvmx_pow_wait_t" This reverts commit 28fae776c69bdac005fa77a7e0daa64725d0f4f8. The patch series that removed typedefs from the octeon driver was not actually built properly, and broke the build (it's hard to test-build this driver for some reason.) Remove them all at this point in time to make sure the build works properly. Link: https://lore.kernel.org/r/32e9ad3c-191e-4dd1-b1cc-07f7b93c3f28@roeck-us.net Reported-by: Guenter Roeck Cc: Oliver Crumrine Signed-off-by: Greg Kroah-Hartman commit 4de20132b029c0fd894faf1fcb7c523243dc1cc1 Author: Greg Kroah-Hartman Date: Mon Oct 30 09:54:12 2023 +0100 Revert "staging: octeon: remove typedef in struct cvmx_pko_lock_t" This reverts commit 8d26aa90458f82b952dcaa64e7c4afed9c862d68. The patch series that removed typedefs from the octeon driver was not actually built properly, and broke the build (it's hard to test-build this driver for some reason.) Remove them all at this point in time to make sure the build works properly. Link: https://lore.kernel.org/r/32e9ad3c-191e-4dd1-b1cc-07f7b93c3f28@roeck-us.net Reported-by: Guenter Roeck Cc: Oliver Crumrine Signed-off-by: Greg Kroah-Hartman commit 06bab96a6e5b730dd68f6dfcc3c5152e439876ad Author: Greg Kroah-Hartman Date: Mon Oct 30 09:54:11 2023 +0100 Revert "staging: octeon: remove typedef in enum cvmx_pko_status_t" This reverts commit 4fffe4733cfb08a4c08eca722a8eb819b842c043. The patch series that removed typedefs from the octeon driver was not actually built properly, and broke the build (it's hard to test-build this driver for some reason.) Remove them all at this point in time to make sure the build works properly. Link: https://lore.kernel.org/r/32e9ad3c-191e-4dd1-b1cc-07f7b93c3f28@roeck-us.net Reported-by: Guenter Roeck Cc: Oliver Crumrine Signed-off-by: Greg Kroah-Hartman commit c312b8b3c1279d3b3d9f71f027d945898173fded Author: Greg Kroah-Hartman Date: Mon Oct 30 09:54:10 2023 +0100 Revert "staging: octeon: remove typedef in structs cvmx_pip_port_status_t and cvmx_pko_port_status_t" This reverts commit b33a296d831189d8a8eedee360e889509b9c81e6. The patch series that removed typedefs from the octeon driver was not actually built properly, and broke the build (it's hard to test-build this driver for some reason.) Remove them all at this point in time to make sure the build works properly. Link: https://lore.kernel.org/r/32e9ad3c-191e-4dd1-b1cc-07f7b93c3f28@roeck-us.net Reported-by: Guenter Roeck Cc: Oliver Crumrine Signed-off-by: Greg Kroah-Hartman commit 0f564130e5c76f1e5cf0008924f6a6cd138929d9 Author: Aleksa Savic Date: Mon Oct 16 10:35:57 2023 +0200 hwmon: (aquacomputer_d5next) Check if temp sensors of legacy devices are connected Return -ENODATA if a temp sensor of a legacy device does not contain a reading. Originally-from: Leonard Anderweit Signed-off-by: Aleksa Savic Link: https://lore.kernel.org/r/20231016083559.139341-2-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck commit ceaa22402e44e09ab34840a3a83888f93785c772 Author: Aleksa Savic Date: Mon Oct 16 10:35:58 2023 +0200 hwmon: (aquacomputer_d5next) Add support for Aquacomputer High Flow USB and MPS Flow Extend aquacomputer_d5next driver to expose various hardware sensors of the Aquacomputer High Flow USB flow sensor, which communicates through a proprietary USB HID protocol. This commit also adds support for the sensors of the MPS Flow devices, as they have the same USB product ID and sensor layouts. Implemented by Leonard Anderweit [1]. Internal and external temp sensor readings are available, along with the flow sensor. Additionally, serial number and firmware version are exposed through debugfs. [1] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/pull/90 Originally-from: Leonard Anderweit Signed-off-by: Aleksa Savic Link: https://lore.kernel.org/r/20231016083559.139341-3-savicaleksa83@gmail.com Signed-off-by: Guenter Roeck commit e56a5e3dfd149573e6134b7eb373d56bc81bd0de Author: Tomer Maimon Date: Wed Oct 18 21:19:24 2023 +0300 dt-bindings: hwmon: npcm: Add npcm845 compatible string Add a compatible string for Nuvoton BMC NPCM845 Pulse Width Modulation (PWM) and Fan tach controller. Signed-off-by: Tomer Maimon Acked-by: Rob Herring Link: https://lore.kernel.org/r/20231018181925.1826042-2-tmaimon77@gmail.com Signed-off-by: Guenter Roeck commit 2b9ea4262ae9114b0b86ac893b4d6175d8520001 Author: Antoniu Miclaus Date: Thu Oct 26 13:33:13 2023 +0300 hwmon: Add driver for ltc2991 Add support for LTC2991 Octal I2C Voltage, Current, and Temperature Monitor. The LTC2991 is used to monitor system temperatures, voltages and currents. Through the I2C serial interface, the eight monitors can individually measure supply voltages and can be paired for differential measurements of current sense resistors or temperature sensing transistors. Additional measurements include internal temperature and internal VCC. Signed-off-by: Antoniu Miclaus Link: https://lore.kernel.org/r/20231026103413.27800-2-antoniu.miclaus@analog.com [groeck: Fixed up documentation warning] Signed-off-by: Guenter Roeck commit 10e806d39d304f837ed2921f36499f17a774a220 Author: Jason Yan Date: Tue Apr 28 14:31:38 2020 +0800 i2c: s3c2410: make i2c_s3c_irq_nextbyte() void Fix the following coccicheck warning: drivers/i2c/busses/i2c-s3c2410.c:391:5-8: Unneeded variable: "ret". Return "0" on line 552 Signed-off-by: Jason Yan Signed-off-by: Wolfram Sang commit ca562a9cf7178859a9767e72eaa7286f1c79bd3e Author: Shawn Guo Date: Mon Mar 1 15:54:06 2021 +0800 i2c: qcom-geni: add ACPI device id for sc8180x It adds ACPI device id for sc8180x platform, so that the devices can be probed for ACPI boot. Signed-off-by: Shawn Guo Signed-off-by: Wolfram Sang commit 0161ee9dd38aafad6260ccb47bdc3e1b975eddbf Author: Wolfram Sang Date: Sun Oct 29 20:41:43 2023 +0100 Documentation: i2c: add fault code for not supporting 10 bit addresses Document the specific fault code when 10 bit addresses cannot be supported. It is used for years, only the documentation slipped through the cracks. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 5ac61d26b8baff5b2e5a9f3dc1ef63297e4b53e7 Author: Axel Lin Date: Wed Apr 13 08:54:30 2016 +0800 i2c: sun6i-p2wi: Prevent potential division by zero Make sure we don't OOPS in case clock-frequency is set to 0 in a DT. The variable set here is later used as a divisor. Signed-off-by: Axel Lin Acked-by: Boris Brezillon Signed-off-by: Wolfram Sang commit d9387eda56a49b2cf4487b3c4f12500190e6bb88 Author: ye xingchen Date: Wed Dec 7 10:48:33 2022 +0800 i2c: mux: demux-pinctrl: Convert to use sysfs_emit_at() API Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: ye xingchen Tested-by: Wolfram Sang [wsa: proper subject prefix] Signed-off-by: Wolfram Sang commit 9d08e5909c81188eb1df26ef9d1c8df58ea5a44d Author: Huqiang Qin Date: Fri Oct 27 18:43:56 2023 +0800 dt-bindings: watchdog: Add support for Amlogic C3 and S4 SoCs Update dt-binding document for watchdog of Amlogic C3 and S4 SoCs. Signed-off-by: Huqiang Qin Acked-by: Conor Dooley Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231027104358.342861-2-huqiang.qin@amlogic.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit d4c85a483e348f264f41060259f3372a23ffb84f Author: Michael Shych Date: Thu Oct 26 08:25:58 2023 +0000 watchdog: mlx-wdt: Parameter desctiption warning fix Add parameter desription to fix warning. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310241044.lvqeOGli-lkp@intel.com Signed-off-by: Michael Shych Signed-off-by: Vadim Pasternak Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231026082558.12142-1-michaelsh@nvidia.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 6a6c7b006e5cd55cce0fc4e7be0e7bb3a94b064b Author: Zev Weiss Date: Fri Sep 22 03:42:34 2023 -0700 watchdog: aspeed: Add support for aspeed,reset-mask DT property This property allows the device-tree to specify how the Aspeed watchdog timer's reset mask register(s) should be set, so that peripherals can be individually exempted from (or opted in to) being reset when the watchdog timer expires. Signed-off-by: Zev Weiss Reviewed-by: Joel Stanley Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230922104231.1434-6-zev@bewilderbeest.net Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 9931be2cfca35be7040f35a272a7b82b31ec1c71 Author: Zev Weiss Date: Fri Sep 22 03:42:33 2023 -0700 dt-bindings: watchdog: aspeed-wdt: Add aspeed,reset-mask property This property configures the Aspeed watchdog timer's reset mask, which controls which peripherals are reset when the watchdog timer expires. Some platforms require that certain devices be left untouched across a reboot; aspeed,reset-mask can now be used to express such constraints. Signed-off-by: Zev Weiss Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230922104231.1434-5-zev@bewilderbeest.net Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 78ca4d6902f4a9631ab74cc96d485eb1f1e5fac9 Author: Janne Grunau Date: Mon Oct 16 08:58:01 2023 +0200 watchdog: apple: Deactivate on suspend The watchdog remains active after putting the system into suspend. Add PM callbacks to deactivate the watchdog on suspend an re-activate it on resume. Signed-off-by: Janne Grunau Reviewed-by: Eric Curtin Reviewed-by: Neal Gompa Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231016-apple-watchdog-suspend-v2-1-7ffff8042dbc@jannau.net Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 49bd08b36143d521579929316a1ea5664d86f451 Author: Matti Lehtimäki Date: Wed Oct 11 18:33:13 2023 +0200 dt-bindings: watchdog: qcom-wdt: Add MSM8226 and MSM8974 compatibles Add compatibles for the MSM8226 and MSM8974 platforms to the Qualcomm watchdog binding. Signed-off-by: Matti Lehtimäki Signed-off-by: Luca Weiss Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231011-msm8226-msm8974-watchdog-v1-1-2c472818fbce@z3ntu.xyz Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 89c7e70d9c056e98de8f6b974493139c9e38c5b4 Author: Jacky Bai Date: Tue Oct 10 16:19:08 2023 +0800 dt-bindings: watchdog: fsl-imx7ulp-wdt: Add 'fsl,ext-reset-output' The wdog may generate wdog_any external reset if the int_en bit is configured, so add a property for this purpose in dt-binding doc. Signed-off-by: Jacky Bai Reviewed-by: Peng Fan Acked-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231010081909.2899101-2-ping.bai@nxp.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 423fc66eb6ce7ad1091091017c47a1ed320c4017 Author: Jacky Bai Date: Tue Oct 10 16:19:07 2023 +0800 wdog: imx7ulp: Enable wdog int_en bit for watchdog any reset The wdog INT_EN bit in CS register should be set to '1' to trigger WDOG_ANY external reset on i.MX93. Signed-off-by: Jacky Bai Reviewed-by: Peng Fan Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231010081909.2899101-1-ping.bai@nxp.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 946af15b9614f49f3a28b62d516867031428d561 Author: George Cherian Date: Mon Oct 9 10:10:37 2023 +0530 drivers: watchdog: marvell_gti: Program the max_hw_heartbeat_ms Program the max_hw_heartbeat_ms value so that the watchdog_pretimeout worker is activated. This kernel worker thread makes sure to ping the watchdog in case the userspace is unable to do so. This kernel worker ping will be done only till the full watchdog timeout there by maintaining the watchdog functionality in case of a real hang. Signed-off-by: George Cherian Signed-off-by: Bharat Bhushan Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231009044037.514570-2-bbhushan2@marvell.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit cc5cfc112a62a4e97ed068513928f5cafd0e6285 Author: Bharat Bhushan Date: Mon Oct 9 10:10:36 2023 +0530 drivers: watchdog: marvell_gti: fix zero pretimeout handling When pretimeout is set to 0 then do not reprogram timer with zero timeout, this will reset device immediately. Also disable interrupt to stop pretimeout notification. Signed-off-by: Bharat Bhushan Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231009044037.514570-1-bbhushan2@marvell.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit cd09da4703775d458fd5d0916ec22694b7f55d02 Author: Rob Herring Date: Tue Oct 10 15:56:36 2023 -0500 watchdog: marvell_gti: Replace of_platform.h with explicit includes The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it was merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other and pull in various other headers. In preparation to fix this, adjust the includes for what is actually needed. of_platform.h isn't needed, but of.h was implicitly included by it (via of_device.h). Signed-off-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231010205636.1584480-1-robh@kernel.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 06fdbf4ddb21b53c2e2fbf7f00df51c1b4e735c4 Author: Jacky Bai Date: Tue Oct 10 15:46:26 2023 +0800 watchdog: imx_sc_wdt: continue if the wdog already enabled if the wdog is already enabled, and try to enabled it again, we should ignore the error and continue, rather than return error. Signed-off-by: Jacky Bai Reviewed-by: Peng Fan Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231010074626.2787383-1-ping.bai@nxp.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit c7e2f4e672364604193d4592c4c3d276137d04c0 Author: Rob Herring Date: Mon Oct 9 16:13:48 2023 -0500 watchdog: st_lpc: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Patrice Chotard Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231009211356.3242037-18-robh@kernel.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 725b6a89ed82e72fdcb5cb2c946c65aaa17910e6 Author: Xing Tong Wu Date: Sat Oct 7 16:21:25 2023 +0800 watchdog: wdat_wdt: Add timeout value as a param in ping method According to the WDAT spec that states about WATCHDOG_ACTION_SET_COUNTDOWN_PERIOD: "This action is required if WATCHDOG_ACTION_RESET does not explicitly write a new countdown value to a register during a reset." And that implies, WATCHDOG_ACTION_RESET may write a countdown value, thus may come with a WATCHDOG_INSTRUCTION_WRITE_COUNTDOWN, thus need the timeout value as parameter or would otherwise write 0. The watchdog for SIONCT6126 need a entry WATCHDOG_INSTRUCTION_WRITE_COUNTDOWN for WATCHDOG_ACTION_RESET action, I send this patch to support it. Signed-off-by: Xing Tong Wu Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231007082125.4699-1-xingtong_wu@163.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 7e5bca6e5561c11ac9c541189cce3e6bf420f8b1 Author: Andy Shevchenko Date: Mon Sep 25 15:35:43 2023 +0300 watchdog: gpio_wdt: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Include mod_devicetable.h explicitly to replace the dropped of.h which included mod_devicetable.h indirectly. Signed-off-by: Andy Shevchenko Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230925123543.2945710-1-andriy.shevchenko@linux.intel.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 5d6aa89bba5bd6af2580f872b57f438dab883738 Author: Darren Hart Date: Thu Sep 21 02:02:36 2023 -0700 sbsa_gwdt: Calculate timeout with 64-bit math Commit abd3ac7902fb ("watchdog: sbsa: Support architecture version 1") introduced new timer math for watchdog revision 1 with the 48 bit offset register. The gwdt->clk and timeout are u32, but the argument being calculated is u64. Without a cast, the compiler performs u32 operations, truncating intermediate steps, resulting in incorrect values. A watchdog revision 1 implementation with a gwdt->clk of 1GHz and a timeout of 600s writes 3647256576 to the one shot watchdog instead of 300000000000, resulting in the watchdog firing in 3.6s instead of 600s. Force u64 math by casting the first argument (gwdt->clk) as a u64. Make the order of operations explicit with parenthesis. Fixes: abd3ac7902fb ("watchdog: sbsa: Support architecture version 1") Reported-by: Vanshidhar Konda Signed-off-by: Darren Hart Cc: Wim Van Sebroeck Cc: Guenter Roeck Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: # 5.14.x Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/7d1713c5ffab19b0f3de796d82df19e8b1f340de.1695286124.git.darren@os.amperecomputing.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit b4075ecfe348a44209534c75ad72392c63a489a6 Author: Linus Walleij Date: Tue Sep 26 11:13:44 2023 +0200 watchdog: ixp4xx: Make sure restart always works The IXP4xx watchdog in early "A0" silicon is unreliable and cannot be registered, however for some systems such as the USRobotics USR8200 the watchdog is the only restart option, so implement a "dummy" watchdog that can only support restart in this case. Fixes: 1aea522809e6 ("watchdog: ixp4xx: Implement restart") Signed-off-by: Linus Walleij Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230926-ixp4xx-wdt-restart-v2-1-15cf4639b423@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e2c520c4022016ccf20ba1c57af9fc2e56a1516f Author: Werner Fischer Date: Mon Sep 25 15:09:46 2023 +0200 watchdog: it87_wdt: add IT8613 ID This patch adds watchdog support for the ITE IT8613 watchdog. IT8613 watchdog works in the same way as the other watchdogs supported by it87_wdt. Before this patch, IT8613 watchdog is not supported. After a modprobe, dmesg reports: it87_wdt: Unknown Chip found, Chip 8613 Revision 000c With this patch, modprobe it87_wdt recognizes the watchdog as the dmesg output shows: it87_wdt: Chip IT8613 revision 12 initialized. timeout=60 sec (nowayout=0 testmode=0) Watchdog tests on a LES v4 have been successful, the watchdog works as expected with this patch [1]. [1] https://www.thomas-krenn.com/en/wiki/Watchdog#LES_v4 Signed-off-by: Werner Fischer Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/3bc0a1c2d768b23a0cd6e9f5fa0c0b5577427668.camel@wefi.net Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 4b2b39f9395bc66c616d8d5a83642950fc3719b1 Author: Dan Carpenter Date: Thu Sep 7 12:53:15 2023 +0300 watchdog: marvell_gti_wdt: Fix error code in probe() This error path accidentally returns success. Return -EINVAL instead. Fixes: ef9e7fe2c890 ("Watchdog: Add marvell GTI watchdog driver") Signed-off-by: Dan Carpenter Reviewed-by: Bharat Bhushan Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/af326fd7-ac71-43a1-b7de-81779b61d242@moroto.mountain Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit f71e0be5d297b25453fdf4c1757b3e83e94b5f98 Author: Arnd Bergmann Date: Fri Oct 27 17:25:09 2023 +0200 ALSA: hda: cs35l41: mark cs35l41_verify_id() static The newly introduced function is global but only called in this one file and has no extern prototype, so it should probably be static: sound/pci/hda/cs35l41_hda.c:733:5: error: no previous prototype for 'cs35l41_verify_id' [-Werror=missing-prototypes] 733 | int cs35l41_verify_id(struct cs35l41_hda *cs35l41, unsigned int *regid, unsigned int *reg_revid) Fixes: 881b7bce0c25 ("ALSA: hda: cs35l41: Run boot process during resume callbacks") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231027152515.482411-1-arnd@kernel.org Signed-off-by: Takashi Iwai commit 28d3fe32354701decc3e76d89712569c269b5e4f Author: Li Zetao Date: Tue Aug 15 13:13:46 2023 -0700 Input: walkera0701 - use module_parport_driver macro to simplify the code Use the module_parport_driver macro to simplify the code, which is the same as declaring with module_init() and module_exit(). Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230815080107.1089401-1-lizetao1@huawei.com Signed-off-by: Dmitry Torokhov commit eb988e46da2e4eae89f5337e047ce372fe33d5b1 Author: Dan Carpenter Date: Sun Oct 29 02:53:36 2023 +0000 Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() The put_device() calls rmi_release_function() which frees "fn" so the dereference on the next line "fn->num_of_irqs" is a use after free. Move the put_device() to the end to fix this. Fixes: 24d28e4f1271 ("Input: synaptics-rmi4 - convert irq distribution to irq_domain") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/706efd36-7561-42f3-adfa-dd1d0bd4f5a1@moroto.mountain Signed-off-by: Dmitry Torokhov commit 290e44badacd8bb62f0f0fddec78381b237b8b83 Author: Fabio Estevam Date: Sun Oct 29 01:44:24 2023 +0000 dt-bindings: input: fsl,scu-key: Document wakeup-source The SCU Key controller can be used as a system wakeup source. Document the 'wakeup-source' property. This fixes the following schema warning: system-controller: keys: 'wakeup-source' does not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/firmware/fsl,scu.yaml# Signed-off-by: Fabio Estevam Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230926122957.341094-1-festevam@gmail.com Signed-off-by: Dmitry Torokhov commit 75690493591fe283e4c92a3ba7c4420e9858abdb Author: Zhihao Cheng Date: Sat Sep 23 11:28:59 2023 +0800 ubifs: ubifs_link: Fix wrong name len calculating when UBIFS is encrypted The length of dentry name is calculated after the raw name is encrypted, except for ubifs_link(), which could make the size of dir underflow. Here is a reproducer: touch $TMP/file mkdir $TMP/dir stat $TMP/dir for i in $(seq 1 8) do ln $TMP/file $TMP/dir/$i unlink $TMP/dir/$i done stat $TMP/dir The size of dir will be underflow(-96). Fix it by calculating dentry name's length after the name is encrypted. Fixes: f4f61d2cc6d8 ("ubifs: Implement encrypted filenames") Reported-by: Roland Ruckerbauer Link: https://lore.kernel.org/linux-mtd/1638777819.2925845.1695222544742.JavaMail.zimbra@robart.cc/T/#u Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit d07cec9c238ae8fc6c1a9f3f5d30a2f8ec6cdc71 Author: ZhaoLong Wang Date: Thu Sep 21 10:01:42 2023 +0800 ubi: block: Fix use-after-free in ubiblock_cleanup The following BUG is reported when a ubiblock is removed: ================================================================== BUG: KASAN: slab-use-after-free in ubiblock_cleanup+0x88/0xa0 [ubi] Read of size 4 at addr ffff88810c8f3804 by task ubiblock/1716 CPU: 5 PID: 1716 Comm: ubiblock Not tainted 6.6.0-rc2+ #135 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190727_073836-buildvm-ppc64le-16.ppc.fedoraproject.org-3.fc31 04/01/2014 Call Trace: dump_stack_lvl+0x37/0x50 print_report+0xd0/0x620 kasan_report+0xb6/0xf0 ubiblock_cleanup+0x88/0xa0 [ubi] ubiblock_remove+0x121/0x190 [ubi] vol_cdev_ioctl+0x355/0x630 [ubi] __x64_sys_ioctl+0xc7/0x100 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 RIP: 0033:0x7f08d7445577 Code: b3 66 90 48 8b 05 11 89 2c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e1 8 RSP: 002b:00007ffde05a3018 EFLAGS: 00000206 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00000000ffffffff RCX: 00007f08d7445577 RDX: 0000000000000000 RSI: 0000000000004f08 RDI: 0000000000000003 RBP: 0000000000816010 R08: 00000000008163a7 R09: 0000000000000000 R10: 0000000000000003 R11: 0000000000000206 R12: 0000000000000003 R13: 00007ffde05a3130 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 1715: kasan_save_stack+0x22/0x50 kasan_set_track+0x25/0x30 __kasan_kmalloc+0x7f/0x90 __alloc_disk_node+0x40/0x2b0 __blk_mq_alloc_disk+0x3e/0xb0 ubiblock_create+0x2ba/0x620 [ubi] vol_cdev_ioctl+0x581/0x630 [ubi] __x64_sys_ioctl+0xc7/0x100 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 Freed by task 0: kasan_save_stack+0x22/0x50 kasan_set_track+0x25/0x30 kasan_save_free_info+0x2b/0x50 __kasan_slab_free+0x10e/0x190 __kmem_cache_free+0x96/0x220 bdev_free_inode+0xa4/0xf0 rcu_core+0x496/0xec0 __do_softirq+0xeb/0x384 The buggy address belongs to the object at ffff88810c8f3800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 4 bytes inside of freed 1024-byte region [ffff88810c8f3800, ffff88810c8f3c00) The buggy address belongs to the physical page: page:00000000d03de848 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10c8f0 head:00000000d03de848 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x200000000000840(slab|head|node=0|zone=2) page_type: 0xffffffff() raw: 0200000000000840 ffff888100042dc0 ffffea0004244400 dead000000000002 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88810c8f3700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88810c8f3780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88810c8f3800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810c8f3880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810c8f3900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Fix it by using a local variable to record the gendisk ID. Fixes: 77567b25ab9f ("ubi: use blk_mq_alloc_disk and blk_cleanup_disk") Signed-off-by: ZhaoLong Wang Reviewed-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit d81efd66106c03771ffc8637855a6ec24caa6350 Author: Konstantin Meskhidze Date: Tue Sep 5 18:12:22 2023 +0800 ubifs: fix possible dereference after free 'old_idx' could be dereferenced after free via 'rb_link_node' function call. Fixes: b5fda08ef213 ("ubifs: Fix memleak when insert_old_idx() failed") Co-developed-by: Ivanov Mikhail Signed-off-by: Konstantin Meskhidze Reviewed-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit ac085cfe57df2cc1d7a5c4c5e64b8780c8ad452f Author: Zhihao Cheng Date: Mon Aug 28 14:38:45 2023 +0800 ubi: fastmap: Add control in 'UBI_IOCATT' ioctl to reserve PEBs for filling pools This patch imports a new field 'need_resv_pool' in struct 'ubi_attach_req' to control whether or not reserving free PEBs for filling pool/wl_pool. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217787 Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit d4c48e5b58f12835de779f5425ef741c4d0fb53e Author: Zhihao Cheng Date: Mon Aug 28 14:38:44 2023 +0800 ubi: fastmap: Add module parameter to control reserving filling pool PEBs Adding 6th module parameter in 'mtd=xxx' to control whether or not reserving PEBs for filling pool/wl_pool. Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 90e0be56144b064be1a816cbdd184d2a8be7061b Author: Zhihao Cheng Date: Mon Aug 28 14:38:43 2023 +0800 ubi: fastmap: Fix lapsed wear leveling for first 64 PEBs The anchor PEB must be picked from first 64 PEBs, these PEBs could have large erase counter greater than other PEBs especially when free space is nearly running out. The ubi_update_fastmap will be called as long as pool/wl_pool is empty, old anchor PEB is erased when updating fastmap. Given an UBI device with N PEBs, free PEBs is nearly running out and pool will be filled with 1 PEB every time ubi_update_fastmap invoked. So t=N/POOL_SIZE[1]/64 means that in worst case the erase counter of first 64 PEBs is t times greater than other PEBs in theory. After running fsstress for 24h, the erase counter statistics for two UBI devices shown as follow(CONFIG_MTD_UBI_WL_THRESHOLD=128): Device A(1024 PEBs, pool=50, wl_pool=25): ========================================================= from to count min avg max --------------------------------------------------------- 0 .. 9: 0 0 0 0 10 .. 99: 0 0 0 0 100 .. 999: 0 0 0 0 1000 .. 9999: 0 0 0 0 10000 .. 99999: 960 29224 29282 29362 100000 .. inf: 64 117897 117934 117940 --------------------------------------------------------- Total : 1024 29224 34822 117940 Device B(8192 PEBs, pool=256, wl_pool=128): ========================================================= from to count min avg max --------------------------------------------------------- 0 .. 9: 0 0 0 0 10 .. 99: 0 0 0 0 100 .. 999: 0 0 0 0 1000 .. 9999: 8128 2253 2321 2387 10000 .. 99999: 64 35387 35387 35388 100000 .. inf: 0 0 0 0 --------------------------------------------------------- Total : 8192 2253 2579 35388 The key point is reducing fastmap updating frequency by enlarging POOL_SIZE, so let UBI reserve ubi->fm_pool.max_size PEBs during attaching. Then POOL_SIZE will become ubi->fm_pool.max_size/2 even in free space running out case. Given an UBI device with 8192 PEBs(16384\8192\4096 is common large-capacity flash), t=8192/128/64=1. The fastmap updating will happen in either wl_pool or pool is empty, so setting fm_pool_rsv_cnt as ubi->fm_pool.max_size can fill wl_pool in full state. After pool reservation, running fsstress for 24h: Device A(1024 PEBs, pool=50, wl_pool=25): ========================================================= from to count min avg max --------------------------------------------------------- 0 .. 9: 0 0 0 0 10 .. 99: 0 0 0 0 100 .. 999: 0 0 0 0 1000 .. 9999: 0 0 0 0 10000 .. 99999: 1024 33801 33997 34056 100000 .. inf: 0 0 0 0 --------------------------------------------------------- Total : 1024 33801 33997 34056 Device B(8192 PEBs, pool=256, wl_pool=128): ========================================================= from to count min avg max --------------------------------------------------------- 0 .. 9: 0 0 0 0 10 .. 99: 0 0 0 0 100 .. 999: 0 0 0 0 1000 .. 9999: 8192 2205 2397 2460 10000 .. 99999: 0 0 0 0 100000 .. inf: 0 0 0 0 --------------------------------------------------------- Total : 8192 2205 2397 2460 The difference of erase counter between first 64 PEBs and others is under WL_FREE_MAX_DIFF(2*UBI_WL_THRESHOLD=2*128=256). Device A: 34056 - 33801 = 255 Device B: 2460 - 2205 = 255 Next patch will add a switch to control whether UBI needs to reserve PEBs for filling pool. Fixes: dbb7d2a88d2a ("UBI: Add fastmap core") Link: https://bugzilla.kernel.org/show_bug.cgi?id=217787 Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 761893bd490b039258fda893c2a15fa59334c820 Author: Zhihao Cheng Date: Mon Aug 28 14:38:42 2023 +0800 ubi: fastmap: Get wl PEB even ec beyonds the 'max' if free PEBs are run out This is the part 2 to fix cyclically reusing single fastmap data PEBs. Consider one situation, if there are four free PEBs for fm_anchor, pool, wl_pool and fastmap data PEB with erase counter 100, 100, 100, 5096 (ubi->beb_rsvd_pebs is 0). PEB with erase counter 5096 is always picked for fastmap data according to the realization of find_wl_entry(), since fastmap data PEB is not scheduled for wl, finally there are two PEBs (fm data) with great erase counter than other PEBS. Get wl PEB even its erase counter exceeds the 'max' in find_wl_entry() when free PEBs are run out after filling pools and fm data. Then the PEB with biggest erase conter is taken as wl PEB, it can be scheduled for wl. Fixes: dbb7d2a88d2a ("UBI: Add fastmap core") Link: https://bugzilla.kernel.org/show_bug.cgi?id=217787 Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit dcc4e5728eeaeda84878ca0018758cff1abfca21 Author: Kees Cook Date: Fri Oct 27 08:56:38 2023 -0700 seq_buf: Introduce DECLARE_SEQ_BUF and seq_buf_str() Solve two ergonomic issues with struct seq_buf; 1) Too much boilerplate is required to initialize: struct seq_buf s; char buf[32]; seq_buf_init(s, buf, sizeof(buf)); Instead, we can build this directly on the stack. Provide DECLARE_SEQ_BUF() macro to do this: DECLARE_SEQ_BUF(s, 32); 2) %NUL termination is fragile and requires 2 steps to get a valid C String (and is a layering violation exposing the "internals" of seq_buf): seq_buf_terminate(s); do_something(s->buffer); Instead, we can just return s->buffer directly after terminating it in the refactored seq_buf_terminate(), now known as seq_buf_str(): do_something(seq_buf_str(s)); Link: https://lore.kernel.org/linux-trace-kernel/20231027155634.make.260-kees@kernel.org Link: https://lore.kernel.org/linux-trace-kernel/20231026194033.it.702-kees@kernel.org/ Cc: Yosry Ahmed Cc: "Matthew Wilcox (Oracle)" Cc: Christoph Hellwig Cc: Justin Stitt Cc: Kent Overstreet Cc: Petr Mladek Cc: Andy Shevchenko Cc: Rasmus Villemoes Cc: Sergey Senozhatsky Cc: Masami Hiramatsu Cc: Greg Kroah-Hartman Cc: Arnd Bergmann Cc: Jonathan Corbet Cc: Yun Zhou Cc: Jacob Keller Cc: Zhen Lei Signed-off-by: Kees Cook Signed-off-by: Steven Rostedt (Google) commit eada823e6a6fb856548f6e0c7a343cd5c41bb9d3 Author: Zhihao Cheng Date: Mon Aug 28 14:38:41 2023 +0800 ubi: fastmap: may_reserve_for_fm: Don't reserve PEB if fm_anchor exists This is the part 1 to fix cyclically reusing single fastmap data PEBs. After running fsstress on UBIFS for a while, UBI (16384 blocks, fastmap takes 2 blocks) has an erase block(PEB: 8031) with big erase counter greater than any other pebs: ========================================================= from to count min avg max --------------------------------------------------------- 0 .. 9: 0 0 0 0 10 .. 99: 532 84 92 99 100 .. 999: 15787 100 147 229 1000 .. 9999: 64 4699 4765 4826 10000 .. 99999: 0 0 0 0 100000 .. inf: 1 272935 272935 272935 --------------------------------------------------------- Total : 16384 84 180 272935 Not like fm_anchor, there is no candidate PEBs for fastmap data area, so old fastmap data pebs will be reused after all free pebs are filled into pool/wl_pool: ubi_update_fastmap for (i = 1; i < new_fm->used_blocks; i++) erase_block(ubi, old_fm->e[i]->pnum) new_fm->e[i] = old_fm->e[i] According to wear leveling algorithm, UBI selects one small erase counter PEB from ubi->used and one big erase counter PEB from wl_pool, the reused fastmap data PEB is not in these trees. UBI won't schedule this PEB for wl even it is in ubi->used because wl algorithm expects small erase counter for used PEB. Don't reserve PEB for fastmap in may_reserve_for_fm() if fm_anchor already exists. Otherwise, when UBI is running out of free PEBs, the only one free PEB (pnum < 64) will be skipped and fastmap data will be written on the same old PEB. Fixes: dbb7d2a88d2a ("UBI: Add fastmap core") Link: https://bugzilla.kernel.org/show_bug.cgi?id=217787 Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 415e4723c4325464d489c1ef3335eb6679905471 Author: Zhihao Cheng Date: Mon Aug 28 14:38:40 2023 +0800 ubi: fastmap: Remove unneeded break condition while filling pools Change pool filling stop condition. Commit d09e9a2bddba ("ubi: fastmap: Fix high cpu usage of ubi_bgt by making sure wl_pool not empty") reserves fastmap data PEBs after filling 1 PEB in wl_pool. Now wait_free_pebs_for_pool() makes enough free PEBs before filling pool, there will still be at least 1 PEB in pool and 1 PEB in wl_pool after doing ubi_refill_pools(). Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit a2ea69dac674df0fba59c66146a21145108a85ed Author: Zhihao Cheng Date: Mon Aug 28 14:38:39 2023 +0800 ubi: fastmap: Wait until there are enough free PEBs before filling pools Wait until there are enough free PEBs before filling pool/wl_pool, sometimes erase_worker is not scheduled in time, which causes two situations: A. There are few PEBs filled in pool, which makes ubi_update_fastmap is frequently called and leads first 64 PEBs are erased more times than other PEBs. So waiting free PEBs before filling pool reduces fastmap updating frequency and prolongs flash service life. B. In situation that space is nearly running out, ubi_refill_pools() cannot make sure pool and wl_pool are filled with free PEBs, caused by the delay of erase_worker. After this patch applied, there must exist free PEBs in pool after one call of ubi_update_fastmap. Besides, this patch is a preparetion for fixing large erase counter in fastmap data block and fixing lapsed wear leveling for first 64 PEBs. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217787 Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 8ff4e620ac93a5d332735e4f5a4ff31d80682b9a Author: Zhihao Cheng Date: Mon Aug 28 14:38:38 2023 +0800 ubi: fastmap: Use free pebs reserved for bad block handling If new bad PEBs occur, UBI firstly consumes ubi->beb_rsvd_pebs, and then ubi->avail_pebs, finally UBI becomes read-only if above two items are 0, which means that the amount of PEBs for user volumes is not effected. Besides, UBI reserves count of free PBEs is ubi->beb_rsvd_pebs while filling wl pool or getting free PEBs, but ubi->avail_pebs is not reserved. So ubi->beb_rsvd_pebs and ubi->avail_pebs have nothing to do with the usage of free PEBs, UBI can use all free PEBs. Commit 78d6d497a648 ("UBI: Move fastmap specific functions out of wl.c") has removed beb_rsvd_pebs checking while filling pool. Now, don't reserve ubi->beb_rsvd_pebs while filling wl_pool. This will fill more PEBs in pool and also reduce fastmap updating frequency. Also remove beb_rsvd_pebs checking in ubi_wl_get_fm_peb. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217787 Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit c19286d70aaa361cdb073a68a1f66232c359e2fd Author: Zhihao Cheng Date: Mon Aug 28 14:38:37 2023 +0800 ubi: Replace erase_block() with sync_erase() Since erase_block() has same logic with sync_erase(), just replace it with sync_erase(), also rename 'sync_erase()' to 'ubi_sync_erase()'. Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit a033ab4fec5fd9194d1b6c0306efbdc75f70b142 Author: Zhihao Cheng Date: Mon Aug 28 14:38:36 2023 +0800 ubi: fastmap: Allocate memory with GFP_NOFS in ubi_update_fastmap Function ubi_update_fastmap could be called in IO context, for example: ubifs_writepage do_writepage ubifs_jnl_write_data write_head ubifs_wbuf_write_nolock ubifs_leb_write ubi_leb_write ubi_eba_write_leb try_write_vid_and_data ubi_wl_get_peb ubi_update_fastmap erase_block So it's better to allocate memory with GFP_NOFS mode, in case waiting page writeback(dead loop). Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 08a4267874164b2e9c8c50831acd466f47208acc Author: Zhihao Cheng Date: Mon Aug 28 14:38:35 2023 +0800 ubi: fastmap: erase_block: Get erase counter from wl_entry rather than flash Just like sync_erase() does, getting erase counter from wl_entry is faster than reading from flash. Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 4d18b5a57b16c21cf868369ca555068722c32b2d Author: Zhihao Cheng Date: Mon Aug 28 14:38:34 2023 +0800 ubi: fastmap: Fix missed ec updating after erasing old fastmap data block After running fsstress on ubifs for a long time, UBI(16384 blocks, fastmap takes 2 blocks) has an erase block with different erase counters displayed from two views: From ubiscan view: PEB 8031 has erase counter 31581 ========================================================= from to count min avg max --------------------------------------------------------- 0 .. 9: 0 0 0 0 10 .. 99: 0 0 0 0 100 .. 999: 16383 290 315 781 1000 .. 9999: 0 0 0 0 10000 .. 99999: 1 31581 31581 31581 100000 .. inf: 0 0 0 0 --------------------------------------------------------- Total : 16384 290 317 31581 From detailed_erase_block_info view: PEB 8031 has erase counter 7 physical_block_number erase_count 8030 421 8031 7 # mem info is different from disk info 8032 434 8033 425 8034 431 Following process missed updating erase counter in wl_entry(in memory): ubi_update_fastmap for (i = 1; i < new_fm->used_blocks; i++) // update fastmap data if (!tmp_e) if (old_fm && old_fm->e[i]) erase_block(ubi, old_fm->e[i]->pnum) ret = ubi_io_sync_erase(ubi, pnum, 0) ec = be64_to_cpu(ec_hdr->ec) ec += ret ec_hdr->ec = cpu_to_be64(ec) ubi_io_write_ec_hdr(ubi, pnum, ec_hdr) // ec is updated on flash // ec is not updated in old_fm->e[i] (in memory) Fix it by passing wl_enter into erase_block() and updating erase counter in erase_block(). Fixes: dbb7d2a88d2a ("UBI: Add fastmap core") Signed-off-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 60f2f4a81d486348587a6901e744ca8f22dd9637 Author: Ferry Meng Date: Fri Aug 18 17:18:48 2023 +0800 ubifs: Fix missing error code err Fix smatch warning: fs/ubifs/journal.c:1610 ubifs_jnl_truncate() warn: missing error code 'err' Signed-off-by: Ferry Meng Reviewed-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit f4a04c97fb3b7edd7694e725b7dcf0d6901ebcdd Author: Vincent Whitchurch Date: Tue Jul 18 14:41:45 2023 +0200 ubifs: Fix memory leak of bud->log_hash Ensure that the allocated bud->log_hash (if any) is freed in all cases when the bud itself is freed, to fix this leak caught by kmemleak: # keyctl add logon foo:bar data @s # echo clear > /sys/kernel/debug/kmemleak # mount -t ubifs /dev/ubi0_0 mnt -o auth_hash_name=sha256,auth_key=foo:bar # echo a > mnt/x # umount mnt # mount -t ubifs /dev/ubi0_0 mnt -o auth_hash_name=sha256,auth_key=foo:bar # umount mnt # sleep 5 # echo scan > /sys/kernel/debug/kmemleak # echo scan > /sys/kernel/debug/kmemleak # cat /sys/kernel/debug/kmemleak unreferenced object 0xff... (size 128): comm "mount" backtrace: __kmalloc __ubifs_hash_get_desc+0x5d/0xe0 ubifs ubifs_replay_journal ubifs_mount ... Fixes: da8ef65f9573 ("ubifs: Authenticate replayed journal") Signed-off-by: Vincent Whitchurch Reviewed-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 48ec6328de6c153a64474d9e5b6ec95f20f4142b Author: Yang Li Date: Wed Jul 12 15:46:37 2023 +0800 ubifs: Fix some kernel-doc comments Add description of @time and @flags in ubifs_update_time(). to silence the warnings: fs/ubifs/file.c:1383: warning: Function parameter or member 'time' not described in 'ubifs_update_time' fs/ubifs/file.c:1383: warning: Function parameter or member 'flags' not described in 'ubifs_update_time' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5848 Signed-off-by: Yang Li Reviewed-by: Zhihao Cheng Signed-off-by: Richard Weinberger commit 50b3ef14c26b20476e67af582e788b17512023cf Merge: 5897c174028a6 0fce6e5c87fae Author: Bjorn Helgaas Date: Sat Oct 28 13:31:05 2023 -0500 Merge branch 'pci/misc' - Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device so dwc3 can claim it instead (Vicki Pfau) - Make pci_assign_unassigned_resources() non-init because sparc uses it after init-time (Randy Dunlap) - Remove logic_outb(), _outw(), outl() duplicate declarations (John Sanpe) - Remove unnecessary UTF-8 in Kconfig help text that confuses menuconfig (Liu Song) - Fix double free in __pci_epc_create() (Dan Carpenter) - Simplify pcie_capability_clear_and_set_word() cases that could be pcie_capability_clear_word() (Ilpo Järvinen) * pci/misc: PCI: Simplify pcie_capability_clear_and_set_word() to ..._clear_word() PCI: endpoint: Fix double free in __pci_epc_create() PCI: Replace unnecessary UTF-8 in Kconfig logic_pio: Remove logic_outb(), _outw(), outl() duplicate declarations PCI: Make pci_assign_unassigned_resources() non-init PCI: Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device commit 5897c174028a6a05169b6ecdbcd20fe4d1a8bcda Merge: 65de3fd8f5c8a 8a0395578a9bb Author: Bjorn Helgaas Date: Sat Oct 28 13:31:05 2023 -0500 Merge branch 'pci/field-get' - Use FIELD_GET()/FIELD_PREP() when possible throughout drivers/pci/ (Ilpo Järvinen, Bjorn Helgaas) - Rework DPC control programming for clarity (Ilpo Järvinen) * pci/field-get: PCI/portdrv: Use FIELD_GET() PCI/VC: Use FIELD_GET() PCI/PTM: Use FIELD_GET() PCI/PME: Use FIELD_GET() PCI/ATS: Use FIELD_GET() PCI/ATS: Show PASID Capability register width in bitmasks PCI: Use FIELD_GET() in Sapphire RX 5600 XT Pulse quirk PCI: Use FIELD_GET() PCI/MSI: Use FIELD_GET/PREP() PCI/DPC: Use defines with DPC reason fields PCI/DPC: Use defined fields with DPC_CTL register PCI/DPC: Use FIELD_GET() PCI: hotplug: Use FIELD_GET/PREP() PCI: dwc: Use FIELD_GET/PREP() PCI: cadence: Use FIELD_GET() PCI: Use FIELD_GET() to extract Link Width PCI: mvebu: Use FIELD_PREP() with Link Width PCI: tegra194: Use FIELD_GET()/FIELD_PREP() with Link Width fields # Conflicts: # drivers/pci/controller/dwc/pcie-tegra194.c commit 65de3fd8f5c8a910e5bebc0607f8790158ad673a Merge: d100de085c1e6 875760900b44f Author: Bjorn Helgaas Date: Sat Oct 28 13:31:03 2023 -0500 Merge branch 'pci/config-errs' - Simplify config accessor error checking (Ilpo Järvinen) * pci/config-errs: scsi: ipr: Do PCI error checks on own line PCI: xgene: Do PCI error check on own line & keep return value PCI: Do error check on own line to split long "if" conditions atm: iphase: Do PCI error checks on own line sh: pci: Do PCI error check on own line alpha: Streamline convoluted PCI error handling commit d100de085c1e6577417a66705a083496e4c26306 Merge: fb3d102fc20b2 8d786149d78c7 Author: Bjorn Helgaas Date: Sat Oct 28 13:31:02 2023 -0500 Merge branch 'pci/controller/xilinx-xdma' - Move Xilinx IRQ definitions to a common header shared by pcie-xilinx-cpm and xilinx-xdma (Thippeswamy Havalige) - Add Xilinx XDMA driver and DT schema (Thippeswamy Havalige) * pci/controller/xilinx-xdma: PCI: xilinx-xdma: Add Xilinx XDMA Root Port driver dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx XDMA PCIe Root Port Bridge PCI: xilinx-cpm: Move IRQ definitions to a common header commit fb3d102fc20b2f150fa9a0ba576cd44af79e3518 Merge: a4179c60a9936 2fccd11518f19 Author: Bjorn Helgaas Date: Sat Oct 28 13:31:02 2023 -0500 Merge branch 'pci/controller/xilinx-ecam' - Drop xilinx-nwl updates of bridge bus number fields, since PCI core already does that (Thippeswamy Havalige) - Update xilinx-nwl driver and ECAM size in devicetree example to allow up to 256 buses (Thippeswamy Havalige) * pci/controller/xilinx-ecam: PCI: xilinx-nwl: Modify ECAM size to enable support for 256 buses PCI: xilinx-nwl: Rename the NWL_ECAM_VALUE_DEFAULT macro dt-bindings: PCI: xilinx-nwl: Modify ECAM size in the DT example PCI: xilinx-nwl: Remove redundant code that sets Type 1 header fields commit a4179c60a993671b52b5ff32a783316c6a7a2f9a Merge: d97ab9e5330dc 4c64d708f9937 Author: Bjorn Helgaas Date: Sat Oct 28 13:31:02 2023 -0500 Merge branch 'pci/controller/vmd' - Fix space/tab whitespace issue (Xinghui Li) * pci/controller/vmd: PCI: vmd: Fix inconsistent indentation in vmd_resume() commit d97ab9e5330dc14cc3692167f26bf664fce4c75a Merge: db20113d702e4 85e9eb3e7727e Author: Bjorn Helgaas Date: Sat Oct 28 13:31:02 2023 -0500 Merge branch 'pci/controller/speed' - Use PCIE_SPEED2MBS_ENC() macro in qcom host and endpoint to encode link speed instead of hard-coding the link speed in MBps (Manivannan Sadhasivam) - Use Mbps_to_icc() (not MBps_to_icc()) in tegra194 instead of explicitly doing the bytes-to-bits conversion (Manivannan Sadhasivam) * pci/controller/speed: PCI: tegra194: Use Mbps_to_icc() macro for setting icc speed PCI: qcom-ep: Use PCIE_SPEED2MBS_ENC() macro for encoding link speed PCI: qcom: Use PCIE_SPEED2MBS_ENC() macro for encoding link speed commit db20113d702e4f44d614676a967d0f74013fd25b Merge: eecffeb045738 6c4b39937f4e6 Author: Bjorn Helgaas Date: Sat Oct 28 13:31:01 2023 -0500 Merge branch 'pci/controller/rcar' - Add generic T_PVPERL macro for the required interval between power being stable and PERST# being inactive (Yoshihiro Shimoda) - Factor out dw_pcie_link_set_max_link_width() (Yoshihiro Shimoda) - Update PCI_EXP_LNKCAP_MLW so Link Capabilities shows the correct max link width (Yoshihiro Shimoda) - Drop tegra194 PCI_EXP_LNKCAP_MLW setting since dw_pcie_setup() already does it (Yoshihiro Shimoda) - Add dwc support for different dbi and dbi2 register offsets, to be used for R-Car Gen4 controllers (Yoshihiro Shimoda) - Add EDMA_UNROLL capability flag for R-Car Gen4 controllers that don't correctly advertise unrolled mapping via their eDMA CTRL register (Yoshihiro Shimoda) - Export dw_pcie_ep_exit() for use by the modular R-Car Gen4 driver (Yoshihiro Shimoda) - Add .pre_init() and .deinit() hooks for use by R-Car Gen4 controllers (Yoshihiro Shimoda) - Increase snps,dw-pcie DT reg and reg-names maxItems for R-Car Gen4 controllers (Yoshihiro Shimoda) - Add rcar-gen4-pci host and endpoint DT bindings and drivers (Yoshihiro Shimoda) - Add Renesas R8A779F0 Device ID to pci_endpoint_test to allow testing on R-Car S4-8 (Yoshihiro Shimoda) * pci/controller/rcar: misc: pci_endpoint_test: Add Device ID for R-Car S4-8 PCIe controller MAINTAINERS: Update PCI DRIVER FOR RENESAS R-CAR for R-Car Gen4 PCI: rcar-gen4: Add endpoint mode support PCI: rcar-gen4: Add R-Car Gen4 PCIe controller support for host mode dt-bindings: PCI: renesas: Add R-Car Gen4 PCIe Endpoint dt-bindings: PCI: renesas: Add R-Car Gen4 PCIe Host dt-bindings: PCI: dwc: Update maxItems of reg and reg-names PCI: dwc: endpoint: Introduce .pre_init() and .deinit() PCI: dwc: Expose dw_pcie_write_dbi2() to module PCI: dwc: Expose dw_pcie_ep_exit() to module PCI: dwc: Add EDMA_UNROLL capability flag PCI: dwc: endpoint: Add multiple PFs support for dbi2 PCI: tegra194: Drop PCI_EXP_LNKSTA_NLW setting PCI: dwc: Add missing PCI_EXP_LNKCAP_MLW handling PCI: dwc: Add dw_pcie_link_set_max_link_width() PCI: Add T_PVPERL macro commit eecffeb045738b0214219c3ad44cd0502836efdf Merge: e365a36eaca02 a07d2497ed657 Author: Bjorn Helgaas Date: Sat Oct 28 13:31:01 2023 -0500 Merge branch 'pci/controller/qcom-ep' - Add qcom-ep callback to write DBI2 registers (Manivannan Sadhasivam) * pci/controller/qcom-ep: PCI: qcom-ep: Add dedicated callback for writing to DBI2 registers commit e365a36eaca029520e5cae555849934fde398c82 Merge: 7fa8fe0bd9263 81ef01bc5934f Author: Bjorn Helgaas Date: Sat Oct 28 13:31:01 2023 -0500 Merge branch 'pci/controller/layerscape' - Set 64-bit DMA mask for layerscape-ep (Guanhua Gao) * pci/controller/layerscape: PCI: layerscape-ep: Set 64-bit DMA mask commit 7fa8fe0bd926329e5e2383e45c4a6ed71d25120c Merge: c97e5905ab8ec f741bcadfe52e Author: Bjorn Helgaas Date: Sat Oct 28 13:31:00 2023 -0500 Merge branch 'pci/controller/hyperv' - Annotate struct hv_dr_state with __counted_by to prepare for array access bounds checking (Kees Cook) * pci/controller/hyperv: PCI: hv: Annotate struct hv_dr_state with __counted_by commit c97e5905ab8ec2a8a5be024ecb28fa85c173a4b3 Merge: 86b812dc491e1 e111ac7025cb8 Author: Bjorn Helgaas Date: Sat Oct 28 13:31:00 2023 -0500 Merge branch 'pci/controller/cadence' - Drop unused struct cdns_plat_pcie.is_rc member (Li Chen) * pci/controller/cadence: PCI: cadence: Drop unused member from struct cdns_plat_pcie commit 86b812dc491e1c6a959e74637d8e140a9d66128f Merge: dbf9527ca13da 9f4f3dfad8cf0 Author: Bjorn Helgaas Date: Sat Oct 28 13:31:00 2023 -0500 Merge branch 'pci/controller/aspm' - Add a dwc .host_post_init() callback for configuration after downstream devices are scanned (Manivannan Sadhasivam) - Enable ASPM for devices below qcom 1.9.0 host controllers (Manivannan Sadhasivam) * pci/controller/aspm: PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops PCI: dwc: Add host_post_init() callback commit dbf9527ca13da9afa0cabde32fd4fbdc73c0ae9d Merge: 79a8394a909e4 94cfada2a9cad Author: Bjorn Helgaas Date: Sat Oct 28 13:31:00 2023 -0500 Merge branch 'pci/vga' - Add pci_is_vga() helper, which checks for both PCI_CLASS_DISPLAY_VGA and PCI_CLASS_NOT_DEFINED_VGA (which catches ancient devices built before Class Codes were defined) (Sui Jingfeng) - Use the new pci_is_vga() to identify devices for the VGA arbiter, the sysfs "boot_vga" attribute, and the virtio and qxl drivers (SUi Jingfeng) * pci/vga: drm/qxl: Use pci_is_vga() to identify VGA devices drm/virtio: Use pci_is_vga() to identify VGA devices PCI/sysfs: Enable 'boot_vga' attribute via pci_is_vga() PCI/VGA: Select VGA devices earlier PCI/VGA: Use pci_is_vga() to identify VGA devices PCI: Add pci_is_vga() helper commit 79a8394a909e43422df68165189a9bb5e25dd23b Merge: 2afbbc65be459 c9260693aa0c1 Author: Bjorn Helgaas Date: Sat Oct 28 13:30:59 2023 -0500 Merge branch 'pci/reset' - Lengthen reset delay for VideoPropulsion Torrent QN16e card, which seems to require longer delay than spec requires (Lukas Wunner) * pci/reset: PCI: Lengthen reset delay for VideoPropulsion Torrent QN16e card commit 2afbbc65be459f628719f21cb8ca6ce4c852b11c Merge: 209491885f827 7d08f21f8c630 Author: Bjorn Helgaas Date: Sat Oct 28 13:30:59 2023 -0500 Merge branch 'pci/pm' - Protect driver's D3cold preference from being overwritten by user space via sysfs (Lukas Wunner) - Avoid PME from D3hot/D3cold for AMD Rembrandt and Phoenix USB4 to fix wakeup by USB4-attached devices (Mario Limonciello) * pci/pm: x86/PCI: Avoid PME from D3hot/D3cold for AMD Rembrandt and Phoenix USB4 PCI/sysfs: Protect driver's D3cold preference from user space commit 209491885f827f04302c6abad587f45f744e9d90 Merge: adfe8d727dc57 805b196fb3bce Author: Bjorn Helgaas Date: Sat Oct 28 13:30:59 2023 -0500 Merge branch 'pci/p2pdma' - Move struct dev_pagemap (a flexible structure) to end of struct pci_p2pdma_pagemap to avoid overwriting things after dev_pagemap (Gustavo A. R. Silva) * pci/p2pdma: PCI/P2PDMA: Remove redundant goto PCI/P2PDMA: Fix undefined behavior bug in struct pci_p2pdma_pagemap commit adfe8d727dc5720da787725e6cf9a80591e5cd78 Merge: 553b84bf46774 820f59ed9680c Author: Bjorn Helgaas Date: Sat Oct 28 13:30:58 2023 -0500 Merge branch 'pci/hotplug' - Add driver for Ampere Altra Attention Indicators (D Scott Phillips) * pci/hotplug: PCI: hotplug: Add Ampere Altra Attention Indicator extension driver PCI: acpiphp: Allow built-in drivers for Attention Indicators commit 553b84bf467746b95f893f1bb92b143674a1aaf0 Merge: 4eccbed8f48c6 7994db905c0fd Author: Bjorn Helgaas Date: Sat Oct 28 13:30:58 2023 -0500 Merge branch 'pci/enumeration' - Add and use pci_get_base_class() to search for all PCI_BASE_CLASS_DISPLAY devices (Sui Jingfeng) - Fix a vmd check for multi-function devices (Ilpo Järvinen) - Add PCI_HEADER_TYPE_MFD and use it to replace literals (Ilpo Järvinen) - Use acpi_evaluate_dsm_typed() instead of open-coding it (Andy Shevchenko) - Keep .remove() and .probe() callbacks (previously marked __init) in case they're used via sysfs (Uwe Kleine-König) * pci/enumeration: PCI: keystone: Don't discard .probe() callback PCI: keystone: Don't discard .remove() callback PCI: kirin: Don't discard .remove() callback PCI: exynos: Don't discard .remove() callback PCI/ACPI: Use acpi_evaluate_dsm_typed() PCI: Use PCI_HEADER_TYPE_* instead of literals PCI: Add PCI_HEADER_TYPE_MFD definition PCI: vmd: Correct PCI Header Type Register's multi-function check drm/radeon: Use pci_get_base_class() to reduce duplicated code drm/amdgpu: Use pci_get_base_class() to reduce duplicated code drm/nouveau: Use pci_get_base_class() to reduce duplicated code ALSA: hda: Use pci_get_base_class() to reduce duplicated code PCI: Add pci_get_base_class() helper commit 4eccbed8f48c6cdcfe97b76be2b36d69e8f0845a Merge: 3c14a0507299d 63a0b7dc15376 Author: Bjorn Helgaas Date: Sat Oct 28 13:30:58 2023 -0500 Merge branch 'pci/endpoint' - Use IS_ERR_OR_NULL() helper function instead of open-coding it (Ruan Jinjie) * pci/endpoint: PCI: endpoint: Use IS_ERR_OR_NULL() helper function commit 3c14a0507299d4275f983cc8c339f7087ebcf61a Merge: b63c6dfe41446 a18615b1cfc04 Author: Bjorn Helgaas Date: Sat Oct 28 13:30:57 2023 -0500 Merge branch 'pci/ats' - Disable ATS for Intel IPU E2000 A- and B-stepping devices to avoid invalidation message endianness erratum (Bartosz Pawlowski) * pci/ats: PCI: Disable ATS for specific Intel IPU E2000 devices PCI: Extract ATS disabling to a helper function commit b63c6dfe41446c0711f76608c49b4900f795bf39 Merge: b3fabba9a4866 8e37372ad0bea Author: Bjorn Helgaas Date: Sat Oct 28 13:30:57 2023 -0500 Merge branch 'pci/aspm' * pci/aspm: PCI/ASPM: Fix L1 substate handling in aspm_attr_store_common() Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables L1" PCI/ASPM: Convert printk() to pr_*() and add include PCI/ASPM: Remove unnecessary includes PCI/ASPM: Use FIELD_MAX() instead of literals PCI/ASPM: Use time constants PCI/ASPM: Return U32_MAX instead of bit magic construct PCI/ASPM: Use FIELD_GET/PREP() to access PCIe capability fields PCI: Add PCI_L1SS_CTL2 fields commit b3fabba9a4866af5537516d3f584fd065d049efb Merge: 0bb80ecc33a8f 13cf36c648df0 Author: Bjorn Helgaas Date: Sat Oct 28 13:30:57 2023 -0500 Merge branch 'pci/aer' - Factor out AER interrupt enable/disable (Kai-Heng Feng) * pci/aer: PCI/AER: Factor out interrupt toggling into helpers commit 4bac088e2b12d40c49ad96c77be470eb2be7bae0 Author: Antoniu Miclaus Date: Thu Oct 26 13:33:12 2023 +0300 dt-bindings: hwmon: ltc2991: add bindings Add dt-bindings for ltc2991 octal i2c voltage, current and temperature monitor. Signed-off-by: Antoniu Miclaus Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20231026103413.27800-1-antoniu.miclaus@analog.com Signed-off-by: Guenter Roeck commit 205e0c0577faec05f5a9b92349cfd3454f2b00ec Author: Lakshmi Yadlapati Date: Thu Oct 26 23:43:46 2023 -0500 hwmon: (pmbus/max31785) Add delay between bus accesses The MAX31785 has shown erratic behaviour across multiple system designs, unexpectedly clock stretching and NAKing transactions. Experimentation shows that this seems to be triggered by a register access directly back to back with a previous register write. Experimentation also shows that inserting a small delay after register writes makes the issue go away. Use a similar solution to what the max15301 driver does to solve the same problem. Create a custom set of bus read and write functions that make sure that the delay is added. Signed-off-by: Lakshmi Yadlapati Link: https://lore.kernel.org/r/20231027044346.2167548-1-lakshmiy@us.ibm.com Signed-off-by: Guenter Roeck commit 2358151bfb304aedda44348384557c161151bf57 Author: Richard Leitner Date: Thu Oct 26 09:08:49 2023 +0200 hwmon: (ina238) add ina237 support The INA237 "85-V, 16-Bit, Precision Power Monitor With I2C Interface" is basically the same as INA328. Therefore add a corresponding compatible to the driver. According to the datasheet the main difference is the current and power monitoring accuracy: +------------------------+---------------+---------------+ | | INA238 | INA237 | +------------------------+---------------+---------------+ | Offset voltage | +/- 5µV | +/- 50µV | | Offset drift | +/- 0.02µV/°C | +/- 0.02µV/°C | | Gain error | +/- 0.1% | +/- 0.3% | | Gain error drift | +/- 25ppm/°C | +/- 50ppm/°C | | Common mode rejection | 140dB | 120dB | | Power accuracy | 0.7% | 1.6% | +------------------------+---------------+---------------+ As well as the missing DEVICE_ID register at 0x3F, which is currently not in use by the driver. Signed-off-by: Richard Leitner Link: https://lore.kernel.org/r/20231026-ina237-v2-1-dec44811a3c9@linux.dev Signed-off-by: Guenter Roeck commit b1f05cb4b310a8b8a48a1fac50fd76aeed30aa54 Author: Richard Leitner Date: Thu Oct 26 09:08:50 2023 +0200 dt-bindings: hwmon: ti,ina2xx: add ti,ina237 Add ti,ina237 binding to ti,ina2xx as they are very similar and may share the same properties. Signed-off-by: Richard Leitner Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231026-ina237-v2-2-dec44811a3c9@linux.dev Signed-off-by: Guenter Roeck commit f7ac3020036b500cc474f9173481fdaed964b381 Author: Ellie Hermaszewska Date: Thu Oct 26 18:43:22 2023 +0800 hwmon: (asus-ec-sensors) add ROG Crosshair X670E Gene. Only the temp sensors that I can verify are present. T_Sensor is the temperature reading of a 10kΩ β=3435K NTC thermistor optionally connected to the T_SENSOR header. The other sensors are as found on the X670E Hero. Signed-off-by: Ellie Hermaszewska Link: https://lore.kernel.org/r/20231026104332.906357-1-kernel@monoid.al Signed-off-by: Guenter Roeck commit 6dbd3e041d4b19c9654a630ca8c2933a1f85a7e1 Author: Antoniu Miclaus Date: Mon Sep 25 15:29:28 2023 +0300 hwmon: (max31827) handle vref regulator Add missing implementation for the max31827 supply regulator. This is a hardware required property that is not handled. Signed-off-by: Antoniu Miclaus Link: https://lore.kernel.org/r/20230925122929.10610-1-antoniu.miclaus@analog.com Signed-off-by: Guenter Roeck commit 7b64906c98fe503338066b97d3ff2dad65debf2b Author: Ninad Malwade Date: Fri Sep 29 11:36:49 2023 +0100 hwmon: (ina3221) Add support for channel summation disable The INA3221 allows the Critical alert pin to be controlled by the summation control function. This function adds the single shunt-voltage conversions for the desired channels in order to compare the combined sum to the programmed limit. The Shunt-Voltage Sum Limit register contains the programmed value that is compared to the value in the Shunt-Voltage Sum register in order to determine if the total summed limit is exceeded. If the shunt-voltage sum limit value is exceeded, the Critical alert pin pulls low. For the summation limit to have a meaningful value, we have to use the same shunt-resistor value on all included channels. Unless equal shunt-resistor values are used for each channel, the summation control function cannot be used and it is not enabled by the driver. To address this, add support to disable the summation of specific channels via device tree property "ti,summation-disable". The channel which has this property would be excluded from the calculation of summation control function. For example, summation control function calculates Shunt-Voltage Sum as: - input_shunt_voltage_summation = input_shunt_voltage_channel1 + input_shunt_voltage_channel2 + input_shunt_voltage_channel3 If we want the summation to only use channel1 and channel3, we can add 'ti,summation-disable' property in device tree node for channel2. Then the calculation will skip channel2. - input_shunt_voltage_summation = input_shunt_voltage_channel1 + input_shunt_voltage_channel3 Note that we only want the channel to be skipped for summation control function rather than completely disabled. Therefore, even if we add the property 'ti,summation-disable', the channel is still enabled and functional. Finally, create debugfs entries that display if summation is disabled for each of the channels. Signed-off-by: Rajkumar Kasirajan Signed-off-by: Ninad Malwade Co-developed-by: Jon Hunter Signed-off-by: Jon Hunter Link: https://lore.kernel.org/r/20230929103650.86074-4-jonathanh@nvidia.com Signed-off-by: Guenter Roeck commit 13ab5fdc2cc60b24016546a8f402acd239280b68 Author: Jon Hunter Date: Fri Sep 29 11:36:48 2023 +0100 dt-bindings: hwmon: ina3221: Add ti,summation-disable The INA3221 has a critical alert pin that can be controlled by the summation control function. This function adds the single shunt-voltage conversions for the desired channels in order to compare the combined sum to the programmed limit. The Shunt-Voltage Sum Limit register contains the programmed value that is compared to the value in the Shunt-Voltage Sum register in order to determine if the total summed limit is exceeded. If the shunt-voltage sum limit value is exceeded, the critical alert pin pulls low. For the summation limit to have a meaningful value, it is necessary to use the same shunt-resistor value on all included channels. Add a new vendor specific property, 'ti,summation-disable', to allow specific channels to be excluded from the summation control function if the shunt resistor is different to other channels or the channel should not be considered for triggering the critical alert pin. Note that the ina3221 has always supported summing the various input channels and summation is enabled by default if the shunt-resistor values are the same. This change simply provides a way to exclude inputs from the summation. If this property is not populated, then the functionality of the driver does not change. Signed-off-by: Jon Hunter Signed-off-by: Ninad Malwade Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230929103650.86074-3-jonathanh@nvidia.com Signed-off-by: Guenter Roeck commit 81b75e336c139be9ad4b3dce56d24e722850d2b4 Author: Ninad Malwade Date: Fri Sep 29 11:36:47 2023 +0100 dt-bindings: hwmon: ina3221: Convert to json-schema Convert the TI INA3221 bindings from the free-form text format to json-schema. Note that the INA3221 input channels default to enabled in the chip. Unless channels are explicitly disabled in device-tree, input channels will be enabled. Signed-off-by: Thierry Reding Signed-off-by: Ninad Malwade Signed-off-by: Jon Hunter Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230929103650.86074-2-jonathanh@nvidia.com Signed-off-by: Guenter Roeck commit fe0eba175e96820ae6b8ff2d6407ca5ab40a1d31 Author: Saravanan Sekar Date: Wed Oct 11 22:17:54 2023 +0530 hwmon: (pmbus/mpq7932) Add a support for mpq2286 Power Management IC The MPQ2286 is a programmable, high frequency synchronous buck regulator designed to power a variety of Automotive system peripherals. Single buck converters with hardware monitoring capability is configurable over PMBus interface. Signed-off-by: Saravanan Sekar Link: https://lore.kernel.org/r/20231011164754.449399-5-saravanan@linumiz.com [groeck: Updated subject (mpq2286 -> mpq7932)] Signed-off-by: Guenter Roeck commit 88b5970e92d0d3f6df67fb80f441a84b2c36b23f Author: Saravanan Sekar Date: Wed Oct 11 22:17:53 2023 +0530 hwmon: (pmbus/core) Add helper macro to define single pmbus regulator The bindings for single instance regulator should be named with no instance (e.g., buck not buck0). Introduce a new helper macro to define the single pmbus regulator. Signed-off-by: Saravanan Sekar Link: https://lore.kernel.org/r/20231011164754.449399-4-saravanan@linumiz.com Signed-off-by: Guenter Roeck commit 90a801d5657a4b28d2c45023ee3a789463db2d64 Author: Saravanan Sekar Date: Wed Oct 11 22:17:52 2023 +0530 regulator: dt-bindings: Add mps,mpq2286 power-management IC Document mpq2286 power-management IC. Signed-off-by: Saravanan Sekar Acked-by: Mark Brown Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231011164754.449399-3-saravanan@linumiz.com Signed-off-by: Guenter Roeck commit b1a55c0af684fdab2229770a40e708b4138c6389 Author: Saravanan Sekar Date: Wed Oct 11 22:17:51 2023 +0530 hwmon: (pmbus/mpq7932) Get page count based on chip info Get page count using compatible match to support the series of chipsets which differs in number of regualator/page. Signed-off-by: Saravanan Sekar Link: https://lore.kernel.org/r/20231011164754.449399-2-saravanan@linumiz.com Signed-off-by: Guenter Roeck commit 6632b45606bdcf14a9ee576c21f0d8331a99df9f Author: Daniel Matyas Date: Tue Sep 19 12:34:51 2023 +0300 dt-bindings: hwmon: Add possible new properties to max31827 bindings These modify the corresponding bits in the configuration register. adi,comp-int is a hardware property, because it affects the behavior of the interrupt signal and whatever it is connected to. adi,timeout-enable is a hardware property, because it affects i2c bus operation. Signed-off-by: Daniel Matyas Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230919093456.10592-3-daniel.matyas@analog.com Signed-off-by: Guenter Roeck commit 8824557037d50f7819cef07b32ca9974965bd7ba Author: Daniel Matyas Date: Tue Sep 19 12:34:50 2023 +0300 hwmon: (max31827) Modify conversion wait time There is nothing in the datasheet indicating that the 1ms error is needed and I didn't encounter any error during testing with 140ms wait time. Signed-off-by: Daniel Matyas Link: https://lore.kernel.org/r/20230919093456.10592-2-daniel.matyas@analog.com Signed-off-by: Guenter Roeck commit 9ca6696718cc3f8ca94172d834567f35500f21bf Author: Daniel Matyas Date: Tue Sep 19 12:34:49 2023 +0300 hwmon: (max31827) Make code cleaner Used enums and while loops to replace switch for selecting and getting update interval from conversion rate bits. Divided the write_alarm_val function into 2 functions. The new function is more generic: it can be used not only for alarm writes, but for any kind of writes which require the device to be in shutdown mode. Signed-off-by: Daniel Matyas Link: https://lore.kernel.org/r/20230919093456.10592-1-daniel.matyas@analog.com [groeck: Reverted error return value change (EOPNOTSUPP -> EINVAL)] Signed-off-by: Guenter Roeck commit b344041db783c4cb1e1944a1d5eae6651af72483 Author: Hal Feng Date: Thu Sep 28 15:52:49 2023 +0800 MAINTAINERS: Add Hal as one of the maintainers of SFCTEMP HWMON DRIVER As he is the submitter of this driver, add his mail so he can maintain the driver and easily reply in the mailing list. Acked-by: Emil Renner Berthing Signed-off-by: Hal Feng Link: https://lore.kernel.org/r/20230928075249.109459-1-hal.feng@starfivetech.com Signed-off-by: Guenter Roeck commit 05b68e18ec64663be11119dd48de52fec927dfde Author: Alexander Koskovich Date: Mon Oct 23 18:24:59 2023 +0000 hwmon: (nct6683) Add another customer ID for ASRock X670E Taichi This value was found on an ASRock X670E Taichi with an NCT6686D chip. Signed-off-by: Alexander Koskovich Link: https://lore.kernel.org/r/20231023182442.21943-1-akoskovich@pm.me Signed-off-by: Guenter Roeck commit 10b02902048737f376104bc69e5212466e65a542 Author: Antoniu Miclaus Date: Wed Oct 11 16:57:53 2023 +0300 hwmon: (ltc2992) Avoid division by zero Do not allow setting shunt resistor to 0. This results in a division by zero when performing current value computations based on input voltages and connected resistor values. Signed-off-by: Antoniu Miclaus Link: https://lore.kernel.org/r/20231011135754.13508-1-antoniu.miclaus@analog.com Signed-off-by: Guenter Roeck commit b92b2984a5b62099ab7731bc3a30a0d7c83a01d4 Author: Su Hui Date: Fri Oct 20 16:55:19 2023 +0800 hwmon: (npcm750-pwm) Add an error code check in npcm7xx_en_pwm_fan npcm7xx_pwm_config_set() can return '-ENODEV' for failed. So check the value of 'ret' after calling npcm7xx_pwm_config_set(). Signed-off-by: Su Hui Link: https://lore.kernel.org/r/20231020085518.198477-1-suhui@nfschina.com Signed-off-by: Guenter Roeck commit 748465a53eedbc2c440ac07f6b2328de6263dbfd Author: Colin Ian King Date: Mon Oct 23 14:58:28 2023 +0100 hwmon: (hs3001) remove redundant store on division Currently the local variable hum is being divided by a constant and the results is being re-assigned back to hum before the value is being returned to the caller. The assignment to hum is redundant and can be removed. Cleans up clang scan build warning: drivers/hwmon/hs3001.c:65:9: warning: Although the value stored to 'hum' is used in the enclosing expression, the value is never actually read from 'hum' [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20231023135828.667297-1-colin.i.king@gmail.com Signed-off-by: Guenter Roeck commit 1b515cfee17810e74cda9cf020e302747821d46c Author: Raag Jadav Date: Tue Oct 24 11:50:17 2023 +0530 hwmon: (nct6775) use acpi_dev_hid_uid_match() for matching _HID and _UID Convert manual _UID references to use the standard ACPI helper. Signed-off-by: Raag Jadav Link: https://lore.kernel.org/r/20231024062018.23839-6-raag.jadav@intel.com Signed-off-by: Guenter Roeck commit d9e5d9221d7f82a2736f091bbc5b54ab8d6ef701 Author: Amir Goldstein Date: Thu Oct 26 23:45:40 2023 +0300 fs: fix build error with CONFIG_EXPORTFS=m or not defined Many of the filesystems that call the generic exportfs helpers do not select the EXPORTFS config. Move generic_encode_ino32_fh() to libfs.c, same as generic_fh_to_*() to avoid having to fix all those config dependencies. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310262151.renqMvme-lkp@intel.com/ Fixes: dfaf653dc415 ("exportfs: make ->encode_fh() a mandatory method for NFS export") Suggested-by: Arnd Bergmann Signed-off-by: Amir Goldstein Link: https://lore.kernel.org/r/20231026204540.143217-1-amir73il@gmail.com Tested-by: Arnd Bergmann Signed-off-by: Christian Brauner commit ceb33880431c8284b58de5602b15dfb7ac0a4aa5 Author: Amir Goldstein Date: Tue Oct 24 15:14:57 2023 +0300 freevxfs: derive f_fsid from bdev->bd_dev The majority of blockdev filesystems, which do not have a UUID in their on-disk format, derive f_fsid of statfs(2) from bdev->bd_dev. Use the same practice for freevxfs. This will allow reporting fanotify events with fanotify_event_info_fid. Signed-off-by: Amir Goldstein Link: https://lore.kernel.org/r/20231024121457.3014063-1-amir73il@gmail.com Reviewed-by: Christoph Hellwig Signed-off-by: Christian Brauner commit ae62bcb5e7e5a1ab6f85518949f3f759c6e9a8e0 Author: Amir Goldstein Date: Mon Oct 23 17:30:49 2023 +0300 fs: report f_fsid from s_dev for "simple" filesystems There are many "simple" filesystems (*) that report null f_fsid in statfs(2). Those "simple" filesystems report sb->s_dev as the st_dev field of the stat syscalls for all inodes of the filesystem (**). In order to enable fanotify reporting of events with fsid on those "simple" filesystems, report the sb->s_dev number in f_fsid field of statfs(2). (*) For most of the "simple" filesystem refered to in this commit, the ->statfs() operation is simple_statfs(). Some of those fs assign the simple_statfs() method directly in their ->s_op struct and some assign it indirectly via a call to simple_fill_super() or to pseudo_fs_fill_super() with either custom or "simple" s_op. We also make the same change to efivarfs and hugetlbfs, although they do not use simple_statfs(), because they use the simple_* inode opreations (e.g. simple_lookup()). (**) For most of the "simple" filesystems, the ->getattr() method is not assigned, so stat() is implemented by generic_fillattr(). A few "simple" filesystem use the simple_getattr() method which also calls generic_fillattr() to fill most of the stat struct. The two exceptions are procfs and 9p. procfs implements several different ->getattr() methods, but they all end up calling generic_fillattr() to fill the st_dev field from sb->s_dev. 9p has more complicated ->getattr() methods, but they too, end up calling generic_fillattr() to fill the st_dev field from sb->s_dev. Note that 9p and kernfs also call simple_statfs() from custom ->statfs() methods which already fill the f_fsid field, but v9fs_statfs() calls simple_statfs() only in case f_fsid was not filled and kenrfs_statfs() overwrites f_fsid after calling simple_statfs(). Link: https://lore.kernel.org/r/20230919094820.g5bwharbmy2dq46w@quack3/ Signed-off-by: Amir Goldstein Link: https://lore.kernel.org/r/20231023143049.2944970-1-amir73il@gmail.com Reviewed-by: Jan Kara Signed-off-by: Christian Brauner commit 64343119d7b80b4ee9ba7703390681608a17f2c5 Author: Amir Goldstein Date: Mon Oct 23 21:08:01 2023 +0300 exportfs: support encoding non-decodeable file handles by default AT_HANDLE_FID was added as an API for name_to_handle_at() that request the encoding of a file id, which is not intended to be decoded. This file id is used by fanotify to describe objects in events. So far, overlayfs is the only filesystem that supports encoding non-decodeable file ids, by providing export_operations with an ->encode_fh() method and without a ->decode_fh() method. Add support for encoding non-decodeable file ids to all the filesystems that do not provide export_operations, by encoding a file id of type FILEID_INO64_GEN from { i_ino, i_generation }. A filesystem may that does not support NFS export, can opt-out of encoding non-decodeable file ids for fanotify by defining an empty export_operations struct (i.e. with a NULL ->encode_fh() method). This allows the use of fanotify events with file ids on filesystems like 9p which do not support NFS export to bring fanotify in feature parity with inotify on those filesystems. Note that fanotify also requires that the filesystems report a non-null fsid. Currently, many simple filesystems that have support for inotify (e.g. debugfs, tracefs, sysfs) report a null fsid, so can still not be used with fanotify in file id reporting mode. Reviewed-by: Jan Kara Reviewed-by: Jeff Layton Signed-off-by: Amir Goldstein Link: https://lore.kernel.org/r/20231023180801.2953446-5-amir73il@gmail.com Signed-off-by: Christian Brauner commit 41d1ddd2717c758b8606a66d57d2cc63b41373c0 Author: Amir Goldstein Date: Mon Oct 23 21:08:00 2023 +0300 exportfs: define FILEID_INO64_GEN* file handle types Similar to the common FILEID_INO32* file handle types, define common FILEID_INO64* file handle types. The type values of FILEID_INO64_GEN and FILEID_INO64_GEN_PARENT are the values returned by fuse and xfs for 64bit ino encoded file handle types. Note that these type value are filesystem specific and they do not define a universal file handle format, for example: fuse encodes FILEID_INO64_GEN as [ino-hi32,ino-lo32,gen] and xfs encodes FILEID_INO64_GEN as [hostr-order-ino64,gen] (a.k.a xfs_fid64). The FILEID_INO64_GEN fhandle type is going to be used for file ids for fanotify from filesystems that do not support NFS export. Reviewed-by: Jan Kara Reviewed-by: Jeff Layton Signed-off-by: Amir Goldstein Link: https://lore.kernel.org/r/20231023180801.2953446-4-amir73il@gmail.com Signed-off-by: Christian Brauner commit e21fc2038c1b978b89bbc3d45a4c5c6ef598e178 Author: Amir Goldstein Date: Mon Oct 23 21:07:59 2023 +0300 exportfs: make ->encode_fh() a mandatory method for NFS export Rename the default helper for encoding FILEID_INO32_GEN* file handles to generic_encode_ino32_fh() and convert the filesystems that used the default implementation to use the generic helper explicitly. After this change, exportfs_encode_inode_fh() no longer has a default implementation to encode FILEID_INO32_GEN* file handles. This is a step towards allowing filesystems to encode non-decodeable file handles for fanotify without having to implement any export_operations. Reviewed-by: Jan Kara Reviewed-by: Jeff Layton Acked-by: Chuck Lever Signed-off-by: Amir Goldstein Link: https://lore.kernel.org/r/20231023180801.2953446-3-amir73il@gmail.com Acked-by: Dave Kleikamp Reviewed-by: Christoph Hellwig Signed-off-by: Christian Brauner commit d8d9919f4579a04d250b754e15597bfcf9379c14 Author: Heiner Kallweit Date: Sun Oct 15 23:36:17 2023 +0200 i2c: i801: Use new helper acpi_use_parent_companion Use new helper acpi_use_parent_companion to simplify the code. Signed-off-by: Heiner Kallweit Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 29166faac5486cbc34228431cd049e1c1be451ac Author: Heiner Kallweit Date: Sun Oct 15 23:34:25 2023 +0200 ACPI: Add helper acpi_use_parent_companion In several drivers devices use the ACPI companion of the parent. Add a helper for this use case to avoid code duplication. Signed-off-by: Heiner Kallweit Acked-by: Rafael J. Wysocki Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 3d6cd1af37cb937bb8b65e6047dffc2fb5be7d1c Author: Wolfram Sang Date: Sat Oct 28 14:23:08 2023 +0200 MAINTAINERS: add YAML file for i2c-demux-pinctrl Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 53801d2e762a611d972e91d151df56c3412ca5cf Author: Daniel Mack Date: Wed Oct 18 11:46:13 2023 +0200 i2c: core: fix lockdep warning for sparsely nested adapter chain When adapters are chained in a sparse manner (with intermediate MFD devices, for instance) the code currently fails to use the correct subclass for the adapter's bus_lock which leads to false-positive lockdep warnings. Fix this by walking the entire pedigree of the device and count all adapters along the way instead of just checking the immediate parent. Signed-off-by: Daniel Mack Signed-off-by: Wolfram Sang commit 702c0dd7bcf169c44cb4a67447532861877c2744 Author: Randy Dunlap Date: Wed Oct 25 22:39:18 2023 -0700 i2c: axxia: eliminate kernel-doc warnings Add kernel-doc for 'slave' and 'irq' in struct axxia_i2c_dev. Drop kernel-doc notation ("/**") for static functions since they are not usually documented with kernel-doc. Prevents these kernel-doc warnings: i2c-axxia.c:150: warning: Function parameter or member 'slave' not described in 'axxia_i2c_dev' i2c-axxia.c:150: warning: Function parameter or member 'irq' not described in 'axxia_i2c_dev' i2c-axxia.c:172: warning: Function parameter or member 'ns' not described in 'ns_to_clk' i2c-axxia.c:172: warning: Function parameter or member 'clk_mhz' not described in 'ns_to_clk' i2c-axxia.c:172: warning: No description found for return value of 'ns_to_clk' i2c-axxia.c:271: warning: Function parameter or member 'idev' not described in 'axxia_i2c_empty_rx_fifo' i2c-axxia.c:271: warning: No description found for return value of 'axxia_i2c_empty_rx_fifo' i2c-axxia.c:303: warning: Function parameter or member 'idev' not described in 'axxia_i2c_fill_tx_fifo' Signed-off-by: Randy Dunlap Reported-by: kernel test robot Closes: https://lore.kernel.org/all/202310181049.Vo62moV1-lkp@intel.com/ Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 766b7007a1cc2a4bb687311d9cec6681cbe0d5e2 Author: Simon Glass Date: Thu Oct 26 20:26:23 2023 +1300 kbuild: Correct missing architecture-specific hyphens These should add a hyphen to indicate that it makes a adjective. Fix them. Signed-off-by: Simon Glass Signed-off-by: Masahiro Yamada commit 34fcf231dcf94d7dea29c070228c4b93849f4850 Author: Masahiro Yamada Date: Mon Oct 23 02:06:13 2023 +0900 modpost: squash ALL_{INIT,EXIT}_TEXT_SECTIONS to ALL_TEXT_SECTIONS ALL_INIT_TEXT_SECTIONS and ALL_EXIT_TEXT_SECTIONS are only used in the macro definition of ALL_TEXT_SECTIONS. Signed-off-by: Masahiro Yamada commit b3d4f446fc0f6bf6d50abfc403eb375d9b9f6378 Author: Masahiro Yamada Date: Mon Oct 23 02:06:12 2023 +0900 modpost: merge sectioncheck table entries regarding init/exit sections Check symbol references from normal sections to init/exit sections in a single entry. Signed-off-by: Masahiro Yamada commit e578e4e3110635b20786e442baa3aeff9bb65f95 Author: Masahiro Yamada Date: Mon Oct 23 02:06:11 2023 +0900 modpost: use ALL_INIT_SECTIONS for the section check from DATA_SECTIONS ALL_INIT_SECTIONS is defined as follows: #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS Signed-off-by: Masahiro Yamada commit a3df1526da480c089c20868b7f4d486b9f266001 Author: Masahiro Yamada Date: Mon Oct 23 02:06:10 2023 +0900 modpost: disallow the combination of EXPORT_SYMBOL and __meminit* Theoretically, we could export conditionally-discarded code sections, such as .meminit*, if all the users can become modular under a certain condition. However, that would be difficult to control and such a tricky case has never occurred. Signed-off-by: Masahiro Yamada commit 48cd8df7afd1eef22cf7b125697a6d7c3d168c5c Author: Masahiro Yamada Date: Mon Oct 23 02:06:09 2023 +0900 modpost: remove EXIT_SECTIONS macro ALL_EXIT_SECTIONS and EXIT_SECTIONS are the same. Remove the latter. Signed-off-by: Masahiro Yamada commit 473a45bb35f080e31cb4fe45e905bfe3bd407fdf Author: Masahiro Yamada Date: Mon Oct 23 02:06:08 2023 +0900 modpost: remove MEM_INIT_SECTIONS macro ALL_XXXINIT_SECTIONS and MEM_INIT_SECTIONS are the same. Remove the latter. Signed-off-by: Masahiro Yamada commit e1dc1bfe5b27842c9e43a1f2d42c34decb0660c3 Author: Masahiro Yamada Date: Mon Oct 23 02:06:07 2023 +0900 modpost: remove more symbol patterns from the section check whitelist These symbol patterns were whitelisted to allow them to reference to functions with the old __devinit and __devexit annotations. We stopped doing this a long time ago, for example, commit 6f039790510f ("Drivers: scsi: remove __dev* attributes.") remove those annotations from the scsi drivers. Keep *_ops, *_probe, and *_console, otherwise they will really cause section mismatch warnings. Signed-off-by: Masahiro Yamada commit 50cccec15c48814765895891ca0d95d989b6a419 Author: Masahiro Yamada Date: Mon Oct 23 02:06:06 2023 +0900 modpost: disallow *driver to reference .meminit* sections Drivers must not reference .meminit* sections, which are discarded when CONFIG_MEMORY_HOTPLUG=n. The reason for whitelisting "*driver" in the section mismatch check was to allow drivers to reference symbols annotated as __devinit or __devexit that existed in the past. Those annotations were removed by the following commits: - 54b956b90360 ("Remove __dev* markings from init.h") - 92e9e6d1f984 ("modpost.c: Stop checking __dev* section mismatches") Remove the stale whitelist. Signed-off-by: Masahiro Yamada commit 6a4e59eeedc3018cb57722eecfcbb49431aeb05f Author: Masahiro Yamada Date: Mon Oct 23 02:06:05 2023 +0900 linux/init: remove __memexit* annotations We have never used __memexit, __memexitdata, or __memexitconst. These were unneeded. Signed-off-by: Masahiro Yamada Acked-by: Arnd Bergmann commit 3ada34b0f6559b2388f1983366614fbe8027b6fd Author: Masahiro Yamada Date: Mon Oct 23 02:06:04 2023 +0900 modpost: remove ALL_EXIT_DATA_SECTIONS macro This is unused. Signed-off-by: Masahiro Yamada commit 4411a2ccbaf6ef7b6efe487ea97079961dfa8b18 Author: Geert Uytterhoeven Date: Mon Oct 23 15:53:00 2023 +0200 dt-bindings: i2c: i2c-demux-pinctrl: Convert to json-schema Convert the pinctrl-based I2C bus demultiplexer Device Tree binding documentation to json-schema. Update the example to match reality. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Reviewed-by: Conor Dooley Signed-off-by: Wolfram Sang commit 1b1595cd04bb1eff448e68ef2789d37f1268b879 Author: Masahiro Yamada Date: Mon Oct 23 01:30:14 2023 +0900 kbuild: simplify cmd_ld_multi_m $(patsubst %.o,%.mod,$@) can be replaced with $<. Signed-off-by: Masahiro Yamada commit 72d091846de935e0942a8a0f1fe24ff739d85d76 Author: Masahiro Yamada Date: Thu Oct 19 00:19:48 2023 +0900 kbuild: avoid too many execution of scripts/pahole-flags.sh scripts/pahole-flags.sh is executed so many times. You can confirm it, as follows: $ cat <> scripts/pahole-flags.sh > echo "scripts/pahole-flags.sh was executed" >&2 > EOF $ make -s scripts/pahole-flags.sh was executed scripts/pahole-flags.sh was executed scripts/pahole-flags.sh was executed scripts/pahole-flags.sh was executed scripts/pahole-flags.sh was executed [ lots of repeated lines... ] This scripts is executed more than 20 times during the kernel build because PAHOLE_FLAGS is a recursively expanded variable and exported to sub-processes. With GNU Make >= 4.4, it is executed more than 60 times because exported variables are also passed to other $(shell ) invocations. Without careful coding, it is known to cause an exponential fork explosion. [1] The use of $(shell ) in an exported recursive variable is likely wrong because $(shell ) is always evaluated due to the 'export' keyword, and the evaluation can occur multiple times by the nature of recursive variables. Convert the shell script to a Makefile, which is included only when CONFIG_DEBUG_INFO_BTF=y. [1]: https://savannah.gnu.org/bugs/index.php?64746 Signed-off-by: Masahiro Yamada Reviewed-by: Alan Maguire Tested-by: Alan Maguire Reviewed-by: Nicolas Schier Tested-by: Miguel Ojeda Acked-by: Miguel Ojeda Acked-by: Jiri Olsa Reviewed-by: Martin Rodriguez Reboredo commit 7f6d8f7e43fb516f060cf71672a922031aa5faa9 Author: Masahiro Yamada Date: Thu Oct 19 00:19:47 2023 +0900 kbuild: remove ARCH_POSTLINK from module builds The '%.ko' rule in arch/*/Makefile.postlink does nothing but call the 'true' command. Remove the unneeded code. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 9d361173edc4f8c25440f6db3ab46f5ab7c107cf Author: Masahiro Yamada Date: Sat Oct 14 19:54:36 2023 +0900 kbuild: unify no-compiler-targets and no-sync-config-targets Now that vdso_install does not depend on any in-tree build artifact, it no longer needs a compiler, making no-compiler-targets the same as no-sync-config-targets. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 56769ba4b297a629148eb24d554aef72d1ddfd9e Author: Masahiro Yamada Date: Sat Oct 14 19:54:35 2023 +0900 kbuild: unify vdso_install rules Currently, there is no standard implementation for vdso_install, leading to various issues: 1. Code duplication Many architectures duplicate similar code just for copying files to the install destination. Some architectures (arm, sparc, x86) create build-id symlinks, introducing more code duplication. 2. Unintended updates of in-tree build artifacts The vdso_install rule depends on the vdso files to install. It may update in-tree build artifacts. This can be problematic, as explained in commit 19514fc665ff ("arm, kbuild: make "make install" not depend on vmlinux"). 3. Broken code in some architectures Makefile code is often copied from one architecture to another without proper adaptation. 'make vdso_install' for parisc does not work. 'make vdso_install' for s390 installs vdso64, but not vdso32. To address these problems, this commit introduces a generic vdso_install rule. Architectures that support vdso_install need to define vdso-install-y in arch/*/Makefile. vdso-install-y lists the files to install. For example, arch/x86/Makefile looks like this: vdso-install-$(CONFIG_X86_64) += arch/x86/entry/vdso/vdso64.so.dbg vdso-install-$(CONFIG_X86_X32_ABI) += arch/x86/entry/vdso/vdsox32.so.dbg vdso-install-$(CONFIG_X86_32) += arch/x86/entry/vdso/vdso32.so.dbg vdso-install-$(CONFIG_IA32_EMULATION) += arch/x86/entry/vdso/vdso32.so.dbg These files will be installed to $(MODLIB)/vdso/ with the .dbg suffix, if exists, stripped away. vdso-install-y can optionally take the second field after the colon separator. This is needed because some architectures install a vdso file as a different base name. The following is a snippet from arch/arm64/Makefile. vdso-install-$(CONFIG_COMPAT_VDSO) += arch/arm64/kernel/vdso32/vdso.so.dbg:vdso32.so This will rename vdso.so.dbg to vdso32.so during installation. If such architectures change their implementation so that the base names match, this workaround will go away. Signed-off-by: Masahiro Yamada Acked-by: Sven Schnelle # s390 Reviewed-by: Nicolas Schier Reviewed-by: Guo Ren Acked-by: Helge Deller # parisc Acked-by: Catalin Marinas Acked-by: Russell King (Oracle) commit 5aa9130acb98bacacc8bd9f1489a9269430d0eb8 Author: Christian Brauner Date: Wed Oct 18 12:26:20 2023 +0200 porting: update locking requirements Now that s_umount is never taken under open_mutex update the documentation to say so. Link: https://lore.kernel.org/r/20231017184823.1383356-1-hch@lst.de Signed-off-by: Christian Brauner commit 3b224e1df650df22541724c4bd5f1622b40d4ba4 Author: Christian Brauner Date: Tue Oct 17 20:48:23 2023 +0200 fs: assert that open_mutex isn't held over holder ops With recent block level changes we should never be in a situation where we hold disk->open_mutex when calling into these helpers. So assert that in the code. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20231017184823.1383356-6-hch@lst.de Reviewed-by: Ming Lei Reviewed-by: Jan Kara Reviewed-by: Jens Axboe Signed-off-by: Christian Brauner commit f61033390bc34cd22ad4b4c12619a1e7a8a75600 Author: Christian Brauner Date: Tue Oct 17 20:48:22 2023 +0200 block: assert that we're not holding open_mutex over blk_report_disk_dead blk_report_disk_dead() has the following major callers: (1) del_gendisk() (2) blk_mark_disk_dead() Since del_gendisk() acquires disk->open_mutex it's clear that all callers are assumed to be called without disk->open_mutex held. In turn, blk_report_disk_dead() is called without disk->open_mutex held in del_gendisk(). All callers of blk_mark_disk_dead() call it without disk->open_mutex as well. Ensure that it is clear that blk_report_disk_dead() is called without disk->open_mutex on purpose by asserting it and a comment in the code. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20231017184823.1383356-5-hch@lst.de Reviewed-by: Ming Lei Reviewed-by: Jan Kara Reviewed-by: Jens Axboe Signed-off-by: Christian Brauner commit 6e57236ed6e070607868da70fac3d52ae24e5417 Author: Christoph Hellwig Date: Tue Oct 17 20:48:21 2023 +0200 block: move bdev_mark_dead out of disk_check_media_change disk_check_media_change is mostly called from ->open where it makes little sense to mark the file system on the device as dead, as we are just opening it. So instead of calling bdev_mark_dead from disk_check_media_change move it into the few callers that are not in an open instance. This avoid calling into bdev_mark_dead and thus taking s_umount with open_mutex held. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20231017184823.1383356-4-hch@lst.de Reviewed-by: Ming Lei Reviewed-by: Christian Brauner Reviewed-by: Jan Kara Reviewed-by: Jens Axboe Signed-off-by: Christian Brauner commit 51b4cb4f3e2265cf8303ffd9a4f239ee3805d3ca Author: Christian Brauner Date: Tue Oct 17 20:48:20 2023 +0200 block: WARN_ON_ONCE() when we remove active partitions The logic for disk->open_partitions is: blkdev_get_by_*() -> bdev_is_partition() -> blkdev_get_part() -> blkdev_get_whole() // bdev_whole->bd_openers++ -> if (part->bd_openers == 0) disk->open_partitions++ part->bd_openers In other words, when we first claim/open a partition we increment disk->open_partitions and only when all part->bd_openers are closed will disk->open_partitions be zero. That should mean that disk->open_partitions is always > 0 as long as there's anyone that has an open partition. So the check for disk->open_partitions should mean that we can never remove an active partition that has a holder and holder ops set. Assert that in the code. The main disk isn't removed so that check doesn't work for disk->part0 which is what we want. After all we only care about partition not about the main disk. Link: https://lore.kernel.org/r/20231017184823.1383356-3-hch@lst.de Reviewed-by: Ming Lei Reviewed-by: Jan Kara Reviewed-by: Jens Axboe Signed-off-by: Christian Brauner commit c30b9787a48118d2ed0283b6c8f2abee873a1d19 Author: Christian Brauner Date: Tue Oct 17 20:48:19 2023 +0200 block: simplify bdev_del_partition() BLKPG_DEL_PARTITION refuses to delete partitions that still have openers, i.e., that has an elevated @bdev->bd_openers count. If a device is claimed by setting @bdev->bd_holder and @bdev->bd_holder_ops @bdev->bd_openers and @bdev->bd_holders are incremented. @bdev->bd_openers is effectively guaranteed to be >= @bdev->bd_holders. So as long as @bdev->bd_openers isn't zero we know that this partition is still in active use and that there might still be @bdev->bd_holder and @bdev->bd_holder_ops set. The only current example is @fs_holder_ops for filesystems. But that means bdev_mark_dead() which calls into bdev->bd_holder_ops->mark_dead::fs_bdev_mark_dead() is a nop. As long as there's an elevated @bdev->bd_openers count we can't delete the partition and if there isn't an elevated @bdev->bd_openers count then there's no @bdev->bd_holder or @bdev->bd_holder_ops. So simply open-code what we need to do. This gets rid of one more instance where we acquire s_umount under @disk->open_mutex. Link: https://lore.kernel.org/r/20231016-fototermin-umriss-59f1ea6c1fe6@brauner Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Reviewed-by: Jens Axboe Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20231017184823.1383356-2-hch@lst.de Reviewed-by: Ming Lei Signed-off-by: Christian Brauner commit fd1464105cb37a3b50a72c1d2902e97a71950af8 Author: Jan Kara Date: Wed Oct 18 17:29:24 2023 +0200 fs: Avoid grabbing sb->s_umount under bdev->bd_holder_lock The implementation of bdev holder operations such as fs_bdev_mark_dead() and fs_bdev_sync() grab sb->s_umount semaphore under bdev->bd_holder_lock. This is problematic because it leads to disk->open_mutex -> sb->s_umount lock ordering which is counterintuitive (usually we grab higher level (e.g. filesystem) locks first and lower level (e.g. block layer) locks later) and indeed makes lockdep complain about possible locking cycles whenever we open a block device while holding sb->s_umount semaphore. Implement a function bdev_super_lock_shared() which safely transitions from holding bdev->bd_holder_lock to holding sb->s_umount on alive superblock without introducing the problematic lock dependency. We use this function fs_bdev_sync() and fs_bdev_mark_dead(). Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20231018152924.3858-1-jack@suse.cz Link: https://lore.kernel.org/r/20231017184823.1383356-1-hch@lst.de Reviewed-by: Christoph Hellwig Signed-off-by: Christian Brauner commit 6306ff39a7fcb7e9c59a00e6860b933b71a2ed3e Author: Lizhi Xu Date: Mon Oct 9 17:45:57 2023 +0800 jfs: fix log->bdev_handle null ptr deref in lbmStartIO When sbi->flag is JFS_NOINTEGRITY in lmLogOpen(), log->bdev_handle can't be inited, so it value will be NULL. Therefore, add the "log ->no_integrity=1" judgment in lbmStartIO() to avoid such problems. Reported-and-tested-by: syzbot+23bc20037854bb335d59@syzkaller.appspotmail.com Signed-off-by: Lizhi Xu Link: https://lore.kernel.org/r/20231009094557.1398920-1-lizhi.xu@windriver.com Reviewed-by: Jan Kara Signed-off-by: Christian Brauner commit b3856da7906257a80a764d3dfc6b25e876a4403c Author: Jan Kara Date: Wed Oct 4 11:37:57 2023 +0200 bcache: Fixup error handling in register_cache() Coverity has noticed that the printing of error message in register_cache() uses already freed bdev_handle to get to bdev. In fact the problem has been there even before commit "bcache: Convert to bdev_open_by_path()" just a bit more subtle one - cache object itself could have been freed by the time we looked at ca->bdev and we don't hold any reference to bdev either so even that could in principle go away (due to device unplug or similar). Fix all these problems by printing the error message before closing the bdev. Fixes: dc893f51d24a ("bcache: Convert to bdev_open_by_path()") Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20231004093757.11560-1-jack@suse.cz Asked-by: Coly Li Signed-off-by: Christian Brauner commit e340dd63f6a11402424b3d77e51149bce8fcba7d Author: Jan Kara Date: Wed Sep 27 11:34:34 2023 +0200 xfs: Convert to bdev_open_by_path() Convert xfs to use bdev_open_by_path() and pass the handle around. CC: "Darrick J. Wong" CC: linux-xfs@vger.kernel.org Acked-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-28-jack@suse.cz Acked-by: "Darrick J. Wong" Reviewed-by: "Darrick J. Wong" Signed-off-by: Christian Brauner commit ba1787a5edd90731e8ccd317012deb55bcd4cb9d Author: Jan Kara Date: Wed Sep 27 11:34:33 2023 +0200 reiserfs: Convert to bdev_open_by_dev/path() Convert reiserfs to use bdev_open_by_dev/path() and pass the handle around. CC: reiserfs-devel@vger.kernel.org Acked-by: Christoph Hellwig Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-27-jack@suse.cz Signed-off-by: Christian Brauner commit ebc4185497eac671e428f09bbaafb036d02323bd Author: Jan Kara Date: Wed Sep 27 11:34:32 2023 +0200 ocfs2: Convert to use bdev_open_by_dev() Convert ocfs2 heartbeat code to use bdev_open_by_dev() and pass the handle around. CC: Joseph Qi CC: ocfs2-devel@oss.oracle.com Acked-by: Christoph Hellwig Reviewed-by: Joseph Qi Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-26-jack@suse.cz Signed-off-by: Christian Brauner commit 3fe5d9fb0b31075dc85ccd2d142474c18af76f93 Author: Jan Kara Date: Wed Sep 27 11:34:31 2023 +0200 nfs/blocklayout: Convert to use bdev_open_by_dev/path() Convert block device handling to use bdev_open_by_dev/path() and pass the handle around. CC: linux-nfs@vger.kernel.org CC: Trond Myklebust CC: Anna Schumaker Acked-by: Christoph Hellwig Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-25-jack@suse.cz Signed-off-by: Christian Brauner commit 898c57f456b537e90493a9e9222226aa3ea66267 Author: Jan Kara Date: Wed Sep 27 11:34:30 2023 +0200 jfs: Convert to bdev_open_by_dev() Convert jfs to use bdev_open_by_dev() and pass the handle around. CC: Dave Kleikamp CC: jfs-discussion@lists.sourceforge.net Acked-by: Christoph Hellwig Acked-by: Dave Kleikamp Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-24-jack@suse.cz Signed-off-by: Christian Brauner commit 2b107946f80ae29032dd88482b6a3a561d1b35b0 Author: Jan Kara Date: Wed Sep 27 11:34:29 2023 +0200 f2fs: Convert to bdev_open_by_dev/path() Convert f2fs to use bdev_open_by_dev/path() and pass the handle around. CC: Jaegeuk Kim CC: Chao Yu CC: linux-f2fs-devel@lists.sourceforge.net Acked-by: Christoph Hellwig Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-23-jack@suse.cz Signed-off-by: Christian Brauner commit d577c8aaed2035fb7bcc970058a9d8c46c26fcaa Author: Jan Kara Date: Wed Sep 27 11:34:28 2023 +0200 ext4: Convert to bdev_open_by_dev() Convert ext4 to use bdev_open_by_dev() and pass the handle around. CC: linux-ext4@vger.kernel.org CC: Ted Tso Acked-by: Christoph Hellwig Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-22-jack@suse.cz Signed-off-by: Christian Brauner commit 49845720080dff0afd5813eaebf0758b01b6312c Author: Jan Kara Date: Wed Sep 27 11:34:27 2023 +0200 erofs: Convert to use bdev_open_by_path() Convert erofs to use bdev_open_by_path() and pass the handle around. CC: Gao Xiang CC: Chao Yu CC: linux-erofs@lists.ozlabs.org Acked-by: Christoph Hellwig Acked-by: Gao Xiang Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-21-jack@suse.cz Signed-off-by: Christian Brauner commit 86ec15d00bf85801bda57b5d181a2978f828a8cf Author: Jan Kara Date: Wed Sep 27 11:34:26 2023 +0200 btrfs: Convert to bdev_open_by_path() Convert btrfs to use bdev_open_by_path() and pass the handle around. We also drop the holder from struct btrfs_device as it is now not needed anymore. CC: David Sterba CC: linux-btrfs@vger.kernel.org Acked-by: Christoph Hellwig Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-20-jack@suse.cz Signed-off-by: Christian Brauner commit f4a48bc36cdfae7c603e8e3f2a51e2a283f3f365 Author: Jan Kara Date: Wed Sep 27 11:34:25 2023 +0200 fs: Convert to bdev_open_by_dev() Convert mount code to use bdev_open_by_dev() and propagate the handle around to bdev_release(). Acked-by: Christoph Hellwig Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-19-jack@suse.cz Signed-off-by: Christian Brauner commit 4c6bca43c547fe9bc1d7d1519b1d6430fee2cae2 Author: Jan Kara Date: Wed Sep 27 11:34:24 2023 +0200 mm/swap: Convert to use bdev_open_by_dev() Convert swapping code to use bdev_open_by_dev() and pass the handle around. CC: linux-mm@kvack.org CC: Andrew Morton Acked-by: Christoph Hellwig Acked-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-18-jack@suse.cz Signed-off-by: Christian Brauner commit 93745df18e52157778a8a74cb888ac785844a7fe Author: Jan Kara Date: Wed Sep 27 11:34:23 2023 +0200 PM: hibernate: Drop unused snapshot_test argument snapshot_test argument is now unused in swsusp_close() and load_image_and_restore(). Drop it CC: linux-pm@vger.kernel.org Acked-by: Christoph Hellwig Acked-by: "Rafael J. Wysocki" Acked-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-17-jack@suse.cz Signed-off-by: Christian Brauner commit e017d304c74079c5169265c8ee9ac8abc8079145 Author: Jan Kara Date: Wed Sep 27 11:34:22 2023 +0200 PM: hibernate: Convert to bdev_open_by_dev() Convert hibernation code to use bdev_open_by_dev(). CC: linux-pm@vger.kernel.org Acked-by: Christoph Hellwig Acked-by: "Rafael J. Wysocki" Acked-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-16-jack@suse.cz Signed-off-by: Christian Brauner commit e6aafdc8a76bd70ccc9ca8724d09fefba089c3e7 Author: Jan Kara Date: Wed Sep 27 11:34:21 2023 +0200 scsi: target: Convert to bdev_open_by_path() Convert iblock and pscsi drivers to use bdev_open_by_path() and pass the handle around. CC: target-devel@vger.kernel.org CC: linux-scsi@vger.kernel.org Acked-by: Christoph Hellwig Acked-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-15-jack@suse.cz Reviewed-by: "Martin K. Petersen" Signed-off-by: Christian Brauner commit a8ab90ff47bf2a2c9b1353592e14e46f87551b82 Author: Jan Kara Date: Wed Sep 27 11:34:20 2023 +0200 s390/dasd: Convert to bdev_open_by_path() Convert dasd to use bdev_open_by_path() and pass the handle around. CC: linux-s390@vger.kernel.org CC: Christian Borntraeger CC: Sven Schnelle Acked-by: Christoph Hellwig Acked-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-14-jack@suse.cz Signed-off-by: Christian Brauner commit 2a4936e933e369387294a9073a0e9f630fc7f350 Author: Jan Kara Date: Wed Sep 27 11:34:19 2023 +0200 nvmet: Convert to bdev_open_by_path() Convert nvmet to use bdev_open_by_path() and pass the handle around. CC: linux-nvme@lists.infradead.org Acked-by: Christoph Hellwig Acked-by: Christian Brauner Reviewed-by: Chaitanya Kulkarni Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-13-jack@suse.cz Signed-off-by: Christian Brauner commit 3817d4b11212ca9d49d6e7141d41524aa48791c5 Author: Jan Kara Date: Wed Sep 27 11:34:18 2023 +0200 mtd: block2mtd: Convert to bdev_open_by_dev/path() Convert block2mtd to use bdev_open_by_dev() and bdev_open_by_path() and pass the handle around. CC: Joern Engel CC: linux-mtd@lists.infradead.org Acked-by: Christoph Hellwig Acked-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-12-jack@suse.cz Signed-off-by: Christian Brauner commit 9f0f5a30d34cb92257e94a042b8e86d9a680e416 Author: Jan Kara Date: Wed Sep 27 11:34:17 2023 +0200 md: Convert to bdev_open_by_dev() Convert md to use bdev_open_by_dev() and pass the handle around. We also don't need the 'Holder' flag anymore so remove it. CC: linux-raid@vger.kernel.org CC: Song Liu Acked-by: Song Liu Acked-by: Christoph Hellwig Acked-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-11-jack@suse.cz Signed-off-by: Christian Brauner commit c2fce61fb22e3235d29512558c4e93e184e2f68b Author: Jan Kara Date: Wed Sep 27 11:34:16 2023 +0200 dm: Convert to bdev_open_by_dev() Convert device mapper to use bdev_open_by_dev() and pass the handle around. CC: Alasdair Kergon CC: Mike Snitzer CC: dm-devel@redhat.com Acked-by: Christoph Hellwig Acked-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-10-jack@suse.cz Signed-off-by: Christian Brauner commit 631b001fd6bccb2438a6252dbb62d09cbba3350b Author: Jan Kara Date: Wed Sep 27 11:34:15 2023 +0200 bcache: Convert to bdev_open_by_path() Convert bcache to use bdev_open_by_path() and pass the handle around. CC: linux-bcache@vger.kernel.org CC: Coly Li CC: Kent Overstreet Acked-by: Christoph Hellwig Acked-by: Christian Brauner Acked-by: Coly Li Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-9-jack@suse.cz Signed-off-by: Christian Brauner commit eed993a0910338fa751191264d5caa2c386c3f8f Author: Jan Kara Date: Wed Sep 27 11:34:14 2023 +0200 zram: Convert to use bdev_open_by_dev() Convert zram to use bdev_open_by_dev() and pass the handle around. CC: Minchan Kim CC: Sergey Senozhatsky Acked-by: Christoph Hellwig Acked-by: Christian Brauner Reviewed-by: Sergey Senozhatsky Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-8-jack@suse.cz Signed-off-by: Christian Brauner commit 436d3705bfee5dc748cdf4ffdb40ac17183307c2 Author: Jan Kara Date: Wed Sep 27 11:34:13 2023 +0200 xen/blkback: Convert to bdev_open_by_dev() Convert xen/blkback to use bdev_open_by_dev() and pass the handle around. CC: xen-devel@lists.xenproject.org Acked-by: Christoph Hellwig Acked-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-7-jack@suse.cz Signed-off-by: Christian Brauner commit c2114f11a30ede1d1dbab09dab6e6f4024bb2fbb Author: Jan Kara Date: Wed Sep 27 11:34:12 2023 +0200 rnbd-srv: Convert to use bdev_open_by_path() Convert rnbd-srv to use bdev_open_by_path() and pass the handle around. CC: Jack Wang CC: "Md. Haris Iqbal" Acked-by: "Md. Haris Iqbal" Acked-by: Christoph Hellwig Acked-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-6-jack@suse.cz Signed-off-by: Christian Brauner commit 7ac86df899f0025cfd554c057efb30e5a4ef95b0 Author: Jan Kara Date: Wed Sep 27 11:34:11 2023 +0200 pktcdvd: Convert to bdev_open_by_dev() Convert pktcdvd to use bdev_open_by_dev(). Acked-by: Christoph Hellwig Acked-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-5-jack@suse.cz Signed-off-by: Christian Brauner commit 75e27d373425c349954c3770bee659a1bbdb3cc0 Author: Jan Kara Date: Wed Sep 27 11:34:10 2023 +0200 drdb: Convert to use bdev_open_by_path() Convert drdb to use bdev_open_by_path(). CC: drbd-dev@lists.linbit.com Acked-by: Christoph Hellwig Acked-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-4-jack@suse.cz Signed-off-by: Christian Brauner commit acb083b55597872dcaebe9e0352da7fdf1684def Author: Jan Kara Date: Wed Sep 27 11:34:09 2023 +0200 block: Use bdev_open_by_dev() in disk_scan_partitions() and blkdev_bszset() Convert disk_scan_partitions() and blkdev_bszset() to use bdev_open_by_dev(). Acked-by: Christoph Hellwig Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-3-jack@suse.cz Signed-off-by: Christian Brauner commit 841dd789b8625eb9288aaa2be9f10872e6622033 Author: Jan Kara Date: Wed Sep 27 11:34:08 2023 +0200 block: Use bdev_open_by_dev() in blkdev_open() Convert blkdev_open() to use bdev_open_by_dev(). To be able to propagate handle from blkdev_open() to blkdev_release() we need to stop using existence of file->private_data to determine exclusive block device opens. Use bdev_handle->mode for this purpose since file->f_flags isn't usable for this (O_EXCL is cleared from the flags during open). Acked-by: Christoph Hellwig Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-2-jack@suse.cz Signed-off-by: Christian Brauner commit e719b4d156749f02eafed31a3c515f2aa9dcc72a Author: Jan Kara Date: Wed Sep 27 11:34:07 2023 +0200 block: Provide bdev_open_* functions Create struct bdev_handle that contains all parameters that need to be passed to blkdev_put() and provide bdev_open_* functions that return this structure instead of plain bdev pointer. This will eventually allow us to pass one more argument to blkdev_put() (renamed to bdev_release()) without too much hassle. Acked-by: Christoph Hellwig Reviewed-by: Christian Brauner Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20230927093442.25915-1-jack@suse.cz Signed-off-by: Christian Brauner commit 55c900477f5b3897d9038446f72a281cae0efd86 Author: Jakub Kicinski Date: Fri Oct 27 14:13:11 2023 -0700 net: fill in MODULE_DESCRIPTION()s under drivers/net/ W=1 builds now warn if module is built without a MODULE_DESCRIPTION(). Acked-by: Willem de Bruijn Acked-by: Jamal Hadi Salim Acked-by: Arnd Bergmann Acked-by: Jason Wang Acked-by: Taehee Yoo Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit ce1afe280419911b29bc7228f28d4ae85d7e7a2b Author: Jakub Kicinski Date: Fri Oct 27 14:13:10 2023 -0700 net: fill in MODULE_DESCRIPTION()s under net/802* W=1 builds now warn if module is built without a MODULE_DESCRIPTION(). Reviewed-by: Greg Kroah-Hartman Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit beb5eed32a73e13f29c4b640a53d004f3faf019e Author: Jakub Kicinski Date: Fri Oct 27 14:13:09 2023 -0700 net: fill in MODULE_DESCRIPTION()s under net/core W=1 builds now warn if module is built without a MODULE_DESCRIPTION(). Reviewed-by: Oleksij Rempel Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 1fff1f799038a99cd1f2ae3999661ad9d506bb8c Author: Jakub Kicinski Date: Fri Oct 27 14:13:08 2023 -0700 net: fill in MODULE_DESCRIPTION()s in kuba@'s modules W=1 builds now warn if module is built without a MODULE_DESCRIPTION(). Fill it in for the modules I maintain. Acked-by: Kalle Valo Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit c70793fb7632a153862ee9060e6d48131469a29c Author: Shuzhen Wang Date: Fri Oct 27 11:34:40 2023 -0700 usb: gadget: uvc: Add missing initialization of ssp config descriptor In case the uvc gadget is super speed plus, the corresponding config descriptor wasn't initialized. As a result, the host will not recognize the devices when using super speed plus connection. This patch initializes them to super speed descriptors. Reviewed-by: Laurent Pinchart Signed-off-by: Shuzhen Wang Link: https://lore.kernel.org/r/20231027183440.1994315-1-shuzhenwang@google.com Signed-off-by: Greg Kroah-Hartman commit 0e3139e6543b241b3e65956a55c712333bef48ac Author: LihaSika Date: Fri Oct 27 20:28:04 2023 +0300 usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility Change lower bcdDevice value for "Super Top USB 2.0 SATA BRIDGE" to match 1.50. I have such an older device with bcdDevice=1.50 and it will not work otherwise. Cc: stable@vger.kernel.org Signed-off-by: Liha Sikanen Link: https://lore.kernel.org/r/ccf7d12a-8362-4916-b3e0-f4150f54affd@gmail.com Signed-off-by: Greg Kroah-Hartman commit c43c64f8a1c68da370bf8d458ba52e24183a5264 Author: Ian Rogers Date: Wed Oct 25 17:31:49 2023 -0700 perf vendor events intel: Update tsx_cycles_per_elision metrics Update tsx_cycles_per_elision as per: https://github.com/intel/perfmon/pull/116 Prefer the el-start event rather than cycles-t for detecting whether the metric will work as HLE may be disabled. Remove the metric from sapphirerapids that has no el-start event. Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Edward Baker Cc: Zhengjun Xing Link: https://lore.kernel.org/r/20231026003149.3287633-9-irogers@google.com Signed-off-by: Namhyung Kim commit c44c31185923637e672c10e60142e1e1106d1600 Author: Ian Rogers Date: Wed Oct 25 17:31:48 2023 -0700 perf vendor events intel: Update bonnell version number to v5 Spelling fixes were already incorporated in the Linux perf tree, update the version number to reflect this. Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Edward Baker Cc: Zhengjun Xing Link: https://lore.kernel.org/r/20231026003149.3287633-8-irogers@google.com Signed-off-by: Namhyung Kim commit b6292081615bda443842d34108adcdfe20822695 Author: Ian Rogers Date: Wed Oct 25 17:31:47 2023 -0700 perf vendor events intel: Update westmereex events to v4 Update westmereex events from v3 to v4 fixing a spelling issue. Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Edward Baker Cc: Zhengjun Xing Link: https://lore.kernel.org/r/20231026003149.3287633-7-irogers@google.com Signed-off-by: Namhyung Kim commit 247730767c63b06a07272e8a3f06796f2df32d9c Author: Ian Rogers Date: Wed Oct 25 17:31:46 2023 -0700 perf vendor events intel: Update meteorlake events to v1.06 Update meteorlake from v1.04 to v1.06 adding the changes from: https://github.com/intel/perfmon/commit/bc84df043091ec7c98c0629f3d074d9d7a108194 https://github.com/intel/perfmon/commit/405d3ee987d756b5b5d9a64d8a8fa77559822ecf Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Edward Baker Cc: Zhengjun Xing Link: https://lore.kernel.org/r/20231026003149.3287633-6-irogers@google.com Signed-off-by: Namhyung Kim commit f9418b524d14f20c57444f5609f5603b45fffa09 Author: Ian Rogers Date: Wed Oct 25 17:31:45 2023 -0700 perf vendor events intel: Update knightslanding events to v16 Update knightslanding from v10 to v16 adding the changes from: https://github.com/intel/perfmon/commit/6c1f169f6ed63ee1fd75ebb303d0fd06d71196f5 https://github.com/intel/perfmon/commit/b22ca587ec8b5ac20471ea2f14924f63e63afe9d https://github.com/intel/perfmon/commit/e685286f083ee81cb7dafd0cd8546c79ee433187 Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Edward Baker Cc: Zhengjun Xing Link: https://lore.kernel.org/r/20231026003149.3287633-5-irogers@google.com Signed-off-by: Namhyung Kim commit 20e6a51f61bc061f8944b62288057098117b5dfb Author: Ian Rogers Date: Wed Oct 25 17:31:44 2023 -0700 perf vendor events intel: Add typo fix for ivybridge FP Add a missed space. Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Edward Baker Cc: Zhengjun Xing Link: https://lore.kernel.org/r/20231026003149.3287633-4-irogers@google.com Signed-off-by: Namhyung Kim commit 99a8a4c990f5a16c9971f10bc44e4894e0045d2a Author: Ian Rogers Date: Wed Oct 25 17:31:43 2023 -0700 perf vendor events intel: Update a spelling in haswell/haswellx The spelling of "in-flight" was switched to "inflight". Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Edward Baker Cc: Zhengjun Xing Link: https://lore.kernel.org/r/20231026003149.3287633-3-irogers@google.com Signed-off-by: Namhyung Kim commit 8a94d3bfaf45e7995ef12be1a51ec47684c7cb64 Author: Ian Rogers Date: Wed Oct 25 17:31:42 2023 -0700 perf vendor events intel: Update emeraldrapids to v1.01 Update emeraldrapids to v1.01 from v1.00 adding the changes from: https://github.com/intel/perfmon/commit/3993b600e032a9fd443ffd828aab73de7cb167e5 Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Edward Baker Cc: Zhengjun Xing Link: https://lore.kernel.org/r/20231026003149.3287633-2-irogers@google.com Signed-off-by: Namhyung Kim commit a28a0f6773747a8759140578f1ce23d81c6ee0d9 Author: Ian Rogers Date: Wed Oct 25 17:31:41 2023 -0700 perf vendor events intel: Update alderlake/alderlake events to v1.23 Update alderlake and alderlaken events from v1.21 to v1.23 adding the changes from: https://github.com/intel/perfmon/commit/8df4db9433a2aab59dbbac1a70281032d1af7734 https://github.com/intel/perfmon/commit/846bd247c6e04acc572ca56c992e9e65852bbe63 The tsx_cycles_per_elision metric is updated from PR: https://github.com/intel/perfmon/pull/116 Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Alexandre Torgue Cc: Maxime Coquelin Cc: Edward Baker Cc: Zhengjun Xing Link: https://lore.kernel.org/r/20231026003149.3287633-1-irogers@google.com Signed-off-by: Namhyung Kim commit a103f46633fdcddc2aaca506420f177e8803a2bd Author: Dave Jiang Date: Thu Oct 12 11:53:54 2023 -0700 acpi: Move common tables helper functions to common lib Some of the routines in ACPI driver/acpi/tables.c can be shared with parsing CDAT. CDAT is a device-provided data structure that is formatted similar to a platform provided ACPI table. CDAT is used by CXL and can exist on platforms that do not use ACPI. Split out the common routine from ACPI to accommodate platforms that do not support ACPI and move that to /lib. The common routines can be built outside of ACPI if FIRMWARE_TABLES is selected. Link: https://lore.kernel.org/linux-cxl/CAJZ5v0jipbtTNnsA0-o5ozOk8ZgWnOg34m34a9pPenTyRLj=6A@mail.gmail.com/ Suggested-by: "Rafael J. Wysocki" Reviewed-by: Hanjun Guo Reviewed-by: Jonathan Cameron Signed-off-by: Dave Jiang Acked-by: "Rafael J. Wysocki" Link: https://lore.kernel.org/r/169713683430.2205276.17899451119920103445.stgit@djiang5-mobl3 Signed-off-by: Dan Williams commit 8358e8f1596b0b23d3bbc4cf5df5e5e55afc0122 Author: Dave Jiang Date: Thu Oct 12 11:53:48 2023 -0700 cxl: Add support for reading CXL switch CDAT table Add read_cdat_data() call in cxl_switch_port_probe() to allow reading of CDAT data for CXL switches. read_cdat_data() needs to be adjusted for the retrieving of the PCIe device depending on if the passed in port is endpoint or switch. Reviewed-by: Davidlohr Bueso Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/169713682855.2205276.6418370379144967443.stgit@djiang5-mobl3 Signed-off-by: Dan Williams commit 670e4e88f3b1a88a5a089be329b95c51592973ee Author: Dave Jiang Date: Thu Oct 12 11:53:42 2023 -0700 cxl: Add checksum verification to CDAT from CXL A CDAT table is available from a CXL device. The table is read by the driver and cached in software. With the CXL subsystem needing to parse the CDAT table, the checksum should be verified. Add checksum verification after the CDAT table is read from device. Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Reviewed-by: Davidlohr Bueso Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/169713682277.2205276.2687265961314933628.stgit@djiang5-mobl3 Signed-off-by: Dan Williams commit 529c0a44045e59c3c067f1f2c5887759644c50ae Author: Dave Jiang Date: Thu Oct 12 11:53:37 2023 -0700 cxl: Export QTG ids from CFMWS to sysfs as qos_class attribute Export the QoS Throttling Group ID from the CXL Fixed Memory Window Structure (CFMWS) under the root decoder sysfs attributes as qos_class. CXL rev3.0 9.17.1.3 CXL Fixed Memory Window Structure (CFMWS) cxl cli will use this id to match with the _DSM retrieved id for a hot-plugged CXL memory device DPA memory range to make sure that the DPA range is under the right CFMWS window. Reviewed-by: Davidlohr Bueso Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/169713681699.2205276.14475306324720093079.stgit@djiang5-mobl3 Signed-off-by: Dan Williams commit 05e37b2138a6deb1f23daf1282dc86b29968a1ab Author: Dave Jiang Date: Mon Oct 16 10:57:54 2023 -0700 cxl: Add decoders_committed sysfs attribute to cxl_port This attribute allows cxl-cli to determine whether there are decoders committed to a memdev. This is only a snapshot of the state, and doesn't offer any protection or serialization against a concurrent disable-region operation. Reviewed-by: Jim Harris Suggested-by: Dan Williams Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/169747907439.272156.10261062080830155662.stgit@djiang5-mobl3 Signed-off-by: Dan Williams commit 458ba8189cb4380aa6a6cc4d52ab067f80a64829 Author: Dave Jiang Date: Mon Oct 16 10:57:48 2023 -0700 cxl: Add cxl_decoders_committed() helper Add a helper to retrieve the number of decoders committed for the port. Replace all the open coding of the calculation with the helper. Link: https://lore.kernel.org/linux-cxl/651c98472dfed_ae7e729495@dwillia2-xfh.jf.intel.com.notmuch/ Suggested-by: Dan Williams Signed-off-by: Dave Jiang Reviewed-by: Jonathan Cameron Reviewed-by: Jim Harris Reviewed-by: Alison Schofield Link: https://lore.kernel.org/r/169747906849.272156.1729290904857372335.stgit@djiang5-mobl3 Signed-off-by: Dan Williams commit e8db0701605bccbeb8d7907ecd2e50f346a725bd Author: Robert Richter Date: Wed Oct 18 19:17:13 2023 +0200 cxl/core/regs: Rework cxl_map_pmu_regs() to use map->dev for devm struct cxl_register_map carries a @dev parameter for devm operations. Simplify the function interface to use that instead of a separate @dev argument. Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20231018171713.1883517-21-rrichter@amd.com Signed-off-by: Dan Williams commit d3970f006f084e5aab5091a865203899259e4d70 Author: Robert Richter Date: Wed Oct 18 19:17:12 2023 +0200 cxl/core/regs: Rename phys_addr in cxl_map_component_regs() Trivial change that renames variable phys_addr in cxl_map_component_regs() to shorten its length to keep the 80 char size limit for the line and also for consistency between the different paths. Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20231018171713.1883517-20-rrichter@amd.com Signed-off-by: Dan Williams commit b7e9392d5d46a67fb5b66dbb2c257dd0d48eec70 Author: Robert Richter Date: Wed Oct 18 19:17:11 2023 +0200 PCI/AER: Unmask RCEC internal errors to enable RCH downstream port error handling AER corrected and uncorrectable internal errors (CIE/UIE) are masked in their corresponding mask registers per default once in power-up state. [1][2] Enable internal errors for RCECs to receive CXL downstream port errors of Restricted CXL Hosts (RCHs). [1] CXL 3.0 Spec, 12.2.1.1 - RCH Downstream Port Detected Errors [2] PCIe Base Spec r6.0, 7.8.4.3 Uncorrectable Error Mask Register, 7.8.4.6 Correctable Error Mask Register Co-developed-by: Terry Bowman Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Acked-by: Bjorn Helgaas Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20231018171713.1883517-19-rrichter@amd.com Signed-off-by: Dan Williams commit 0a867568bb0d203ca3d28634a611a1367d7c892d Author: Robert Richter Date: Wed Oct 18 19:17:10 2023 +0200 PCI/AER: Forward RCH downstream port-detected errors to the CXL.mem dev handler In Restricted CXL Device (RCD) mode a CXL device is exposed as an RCiEP, but CXL downstream and upstream ports are not enumerated and not visible in the PCIe hierarchy. [1] Protocol and link errors from these non-enumerated ports are signaled as internal AER errors, either Uncorrectable Internal Error (UIE) or Corrected Internal Errors (CIE) via an RCEC. Restricted CXL host (RCH) downstream port-detected errors have the Requester ID of the RCEC set in the RCEC's AER Error Source ID register. A CXL handler must then inspect the error status in various CXL registers residing in the dport's component register space (CXL RAS capability) or the dport's RCRB (PCIe AER extended capability). [2] Errors showing up in the RCEC's error handler must be handled and connected to the CXL subsystem. Implement this by forwarding the error to all CXL devices below the RCEC. Since the entire CXL device is controlled only using PCIe Configuration Space of device 0, function 0, only pass it there [3]. The error handling is limited to currently supported devices with the Memory Device class code set (CXL Type 3 Device, PCI_CLASS_MEMORY_CXL, 502h), handle downstream port errors in the device's cxl_pci driver. Support for other CXL Device Types (e.g. a CXL.cache Device) can be added later. To handle downstream port errors in addition to errors directed to the CXL endpoint device, a handler must also inspect the CXL RAS and PCIe AER capabilities of the CXL downstream port the device is connected to. Since CXL downstream port errors are signaled using internal errors, the handler requires those errors to be unmasked. This is subject of a follow-on patch. The reason for choosing this implementation is that the AER service driver claims the RCEC device, but does not allow it to register a custom specific handler to support CXL. Connecting the RCEC hard-wired with a CXL handler does not work, as the CXL subsystem might not be present all the time. The alternative to add an implementation to the portdrv to allow the registration of a custom RCEC error handler isn't worth doing it as CXL would be its only user. Instead, just check for an CXL RCEC and pass it down to the connected CXL device's error handler. With this approach the code can entirely be implemented in the PCIe AER driver and is independent of the CXL subsystem. The CXL driver only provides the handler. [1] CXL 3.0 spec: 9.11.8 CXL Devices Attached to an RCH [2] CXL 3.0 spec, 12.2.1.1 RCH Downstream Port-detected Errors [3] CXL 3.0 spec, 8.1.3 PCIe DVSEC for CXL Devices Co-developed-by: Terry Bowman Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Cc: Oliver O'Halloran Cc: Bjorn Helgaas Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-pci@vger.kernel.org Acked-by: Bjorn Helgaas Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20231018171713.1883517-18-rrichter@amd.com Signed-off-by: Dan Williams commit d1a9def33d7043df7445114cb89c0aa65818ae91 Author: Terry Bowman Date: Wed Oct 18 19:17:09 2023 +0200 cxl/pci: Disable root port interrupts in RCH mode The RCH root port contains root command AER registers that should not be enabled.[1] Disable these to prevent root port interrupts. [1] CXL 3.0 - 12.2.1.1 RCH Downstream Port-detected Errors Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20231018171713.1883517-17-rrichter@amd.com Signed-off-by: Dan Williams commit 6ac07883dbb5f60f7bc56a13b7a84a382aa9c1ab Author: Terry Bowman Date: Wed Oct 18 19:17:08 2023 +0200 cxl/pci: Add RCH downstream port error logging RCH downstream port error logging is missing in the current CXL driver. The missing AER and RAS error logging is needed for communicating driver error details to userspace. Update the driver to include PCIe AER and CXL RAS error logging. Add RCH downstream port error handling into the existing RCiEP handler. The downstream port error handler is added to the RCiEP error handler because the downstream port is implemented in a RCRB, is not PCI enumerable, and as a result is not directly accessible to the PCI AER root port driver. The AER root port driver calls the RCiEP handler for handling RCD errors and RCH downstream port protocol errors. Update existing RCiEP correctable and uncorrectable handlers to also call the RCH handler. The RCH handler will read the RCH AER registers, check for error severity, and if an error exists will log using an existing kernel AER trace routine. The RCH handler will also log downstream port RAS errors if they exist. Co-developed-by: Robert Richter Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20231018171713.1883517-16-rrichter@amd.com Signed-off-by: Dan Williams commit 6c5f3aacb2963d49a11d4f8accb1188db6a6404b Author: Terry Bowman Date: Wed Oct 18 19:17:07 2023 +0200 cxl/pci: Map RCH downstream AER registers for logging protocol errors The restricted CXL host (RCH) error handler will log protocol errors using AER and RAS status registers. The AER and RAS registers need to be virtually memory mapped before enabling interrupts. Create the initializer function devm_cxl_setup_parent_dport() for this when the endpoint is connected with the dport. The initialization sets up the RCH RAS and AER mappings. Add 'struct cxl_regs' to 'struct cxl_dport' for saving a pointer to the RCH downstream port's AER and RAS registers. Signed-off-by: Terry Bowman Co-developed-by: Robert Richter Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20231018171713.1883517-15-rrichter@amd.com Signed-off-by: Dan Williams commit bf6c9fa846e2a0f7db2a2eabd52ad4f8d4335bcb Author: Terry Bowman Date: Wed Oct 18 19:17:06 2023 +0200 cxl/pci: Update CXL error logging to use RAS register address The CXL error handler currently only logs endpoint RAS status. The CXL topology includes several components providing RAS details to be logged during error handling.[1] Update the current handler's RAS logging to use a RAS register address. Also, update the error handler function names to be consistent with correctable and uncorrectable RAS. This will allow for adding support to log other CXL component's RAS details in the future. [1] CXL3.0 Table 8-22 CXL_Capability_ID Assignment Co-developed-by: Robert Richter Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20231018171713.1883517-14-rrichter@amd.com Signed-off-by: Dan Williams commit 6777877eb7a3290cf0a8a6b621e46f72f9d94b6b Author: Terry Bowman Date: Wed Oct 18 19:17:05 2023 +0200 PCI/AER: Refactor cper_print_aer() for use by CXL driver module The CXL driver plans to use cper_print_aer() for logging restricted CXL host (RCH) AER errors. cper_print_aer() is not currently exported and therefore not usable by the CXL drivers built as loadable modules. Export the cper_print_aer() function. Use the EXPORT_SYMBOL_NS_GPL() variant to restrict the export to CXL drivers. The CONFIG_ACPI_APEI_PCIEAER kernel config is currently used to enable cper_print_aer(). cper_print_aer() logs the AER registers and is useful in PCIE AER logging outside of APEI. Remove the CONFIG_ACPI_APEI_PCIEAER dependency to enable cper_print_aer(). The cper_print_aer() function name implies CPER specific use but is useful in non-CPER cases as well. Rename cper_print_aer() to pci_print_aer(). Also, update cxl_core to import CXL namespace imports. Co-developed-by: Robert Richter Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Cc: Mahesh J Salgaonkar Cc: Oliver O'Halloran Cc: Bjorn Helgaas Cc: linux-pci@vger.kernel.org Reviewed-by: Jonathan Cameron Acked-by: Bjorn Helgaas Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20231018171713.1883517-13-rrichter@amd.com Signed-off-by: Dan Williams commit f05fd10d138d8ba795fcd72ace99e9c8eb7e777e Author: Robert Richter Date: Fri Oct 27 15:08:06 2023 -0700 cxl/pci: Add RCH downstream port AER register discovery Restricted CXL host (RCH) downstream port AER information is not currently logged while in the error state. One problem preventing the error logging is the AER and RAS registers are not accessible. The CXL driver requires changes to find RCH downstream port AER and RAS registers for purpose of error logging. RCH downstream ports are not enumerated during a PCI bus scan and are instead discovered using system firmware, ACPI in this case.[1] The downstream port is implemented as a Root Complex Register Block (RCRB). The RCRB is a 4k memory block containing PCIe registers based on the PCIe root port.[2] The RCRB includes AER extended capability registers used for reporting errors. Note, the RCH's AER Capability is located in the RCRB memory space instead of PCI configuration space, thus its register access is different. Existing kernel PCIe AER functions can not be used to manage the downstream port AER capabilities and RAS registers because the port was not enumerated during PCI scan and the registers are not PCI config accessible. Discover RCH downstream port AER extended capability registers. Use MMIO accesses to search for extended AER capability in RCRB register space. [1] CXL 3.0 Spec, 9.11.2 - System Firmware View of CXL 1.1 Hierarchy [2] CXL 3.0 Spec, 8.2.1.1 - RCH Downstream Port RCRB Co-developed-by: Robert Richter Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20231018171713.1883517-12-rrichter@amd.com Signed-off-by: Dan Williams commit a2fcb84a1978e4e855d632a07412030e99819cb8 Author: Robert Richter Date: Wed Oct 18 19:17:02 2023 +0200 cxl/port: Remove Component Register base address from struct cxl_port The Component Register base address @component_reg_phys is no longer used after the rework of the Component Register setup which now uses struct member @reg_map instead. Remove the base address. Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20231018171713.1883517-10-rrichter@amd.com Signed-off-by: Dan Williams commit f611d98a003644f76ad8fea7c3ca786a8ca69aff Author: Robert Richter Date: Wed Oct 18 19:17:01 2023 +0200 cxl/pci: Remove Component Register base address from struct cxl_dev_state The Component Register base address @component_reg_phys is no longer used after the rework of the Component Register setup which now uses struct member @reg_map instead. Remove the base address. Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20231018171713.1883517-9-rrichter@amd.com Signed-off-by: Dan Williams commit 8ce520fdea245c9e17ebc0659973984362bc1fde Author: Robert Richter Date: Wed Oct 18 19:17:00 2023 +0200 cxl/hdm: Use stored Component Register mappings to map HDM decoder capability Now, that the Component Register mappings are stored, use them to enable and map the HDM decoder capabilities. The Component Registers do not need to be probed again for this, remove probing code. The HDM capability applies to Endpoints, USPs and VH Host Bridges. The Endpoint's component register mappings are located in the cxlds and else in the port's structure. Duplicate the cxlds->reg_map in port->reg_map for endpoint ports. Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Dave Jiang [rework to drop cxl_port_get_comp_map()] Link: https://lore.kernel.org/r/20231018171713.1883517-8-rrichter@amd.com Signed-off-by: Dan Williams commit 2dd18279202f6247904e6e23738c1ec6a86b24b1 Author: Robert Richter Date: Wed Oct 18 19:16:59 2023 +0200 cxl/pci: Store the endpoint's Component Register mappings in struct cxl_dev_state Same as for ports and dports, also store the endpoint's Component Register mappings, use struct cxl_dev_state for that. Keep the Component Register base address @component_reg_phys a bit to not break functionality. It will be removed after the transition in a later patch. Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20231018171713.1883517-7-rrichter@amd.com Signed-off-by: Dan Williams commit 4d758764e7f9db83806135f3bfcff1ab64f16e60 Author: Robert Richter Date: Wed Oct 18 19:16:58 2023 +0200 cxl/port: Pre-initialize component register mappings The component registers of a component may not exist and cxl_setup_comp_regs() will fail for that reason. In another case, Software may not use and set those registers up. cxl_setup_comp_regs() is then called with a base address of CXL_RESOURCE_NONE. Both are valid cases, but the function returns without initializing the register map. Now, a missing component register block is not necessarily a reason to fail (feature is optional or its existence checked later). Change cxl_setup_comp_regs() to also use components with the component register block missing. Thus, always initialize struct cxl_register_map with valid values, set @dev and make @resource CXL_RESOURCE_NONE. The change is in preparation of follow-on patches. Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20231018171713.1883517-6-rrichter@amd.com Signed-off-by: Dan Williams commit d8add49263a98d766e5758dc2ec9f83c3b685c12 Author: Robert Richter Date: Wed Oct 18 19:16:57 2023 +0200 cxl/port: Rename @comp_map to @reg_map in struct cxl_register_map Name the field @reg_map, because @reg_map->host will be used for mapping operations beyond component registers (i.e. AER registers). This is valid for all occurrences of @comp_map. Change them all. Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20231018171713.1883517-5-rrichter@amd.com Signed-off-by: Dan Williams commit 33d9c987bf8fb68a9292aba7cc4b1711fcb1be4d Author: Dan Williams Date: Wed Oct 18 19:16:56 2023 +0200 cxl/port: Fix @host confusion in cxl_dport_setup_regs() commit 5d2ffbe4b81a ("cxl/port: Store the downstream port's Component Register mappings in struct cxl_dport") ...moved the dport component registers from a raw component_reg_phys passed in at dport instantiation time to a 'struct cxl_register_map' populated with both the component register data *and* the "host" device for mapping operations. While typical CXL switch dports are mapped by their associated 'struct cxl_port', an RCH host bridge dport registered by cxl_acpi needs to wait until the cxl_mem driver makes the attachment to map the registers. This is because there are no intervening 'struct cxl_port' instances between the root cxl_port and the endpoint port in an RCH topology. For now just mark the host as NULL in the RCH dport case until code that needs to map the dport registers arrives. This patch is not flagged for -stable since nothing in the current driver uses the dport->comp_map. Now, I am slightly uneasy that cxl_setup_comp_regs() sets map->host to a wrong value and then cxl_dport_setup_regs() fixes it up, but the alternatives I came up with are more messy. For example, adding an @logdev to 'struct cxl_register_map' that the dev_printk()s can fall back to when @host is NULL. I settled on "post-fixup+comment" since it is only RCH dports that have this special case where register probing is split between a host-bridge RCRB lookup and when cxl_mem_probe() does the association of the cxl_memdev and endpoint port. [moved rename of @comp_map to @reg_map into next patch] Fixes: 5d2ffbe4b81a ("cxl/port: Store the downstream port's Component Register mappings in struct cxl_dport") Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20231018171713.1883517-4-rrichter@amd.com Signed-off-by: Dan Williams commit dd22581f89537163f065e8ef7c125ce0fddf62cc Author: Robert Richter Date: Wed Oct 18 19:16:55 2023 +0200 cxl/core/regs: Rename @dev to @host in struct cxl_register_map The primary role of @dev is to host the mappings for devm operations. @dev is too ambiguous as a name. I.e. when does @dev refer to the 'struct device *' instance that the registers belong, and when does @dev refer to the 'struct device *' instance hosting the mapping for devm operations? Clarify the role of @dev in cxl_register_map by renaming it to @host. Also, rename local variables to 'host' where map->host is used. Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20231018171713.1883517-3-rrichter@amd.com Signed-off-by: Dan Williams commit 47ea0ddb1f5604ba3496baa19110aec6a3151f2e Author: Lalith Rajendran Date: Fri Oct 27 16:02:22 2023 -0500 platform/chrome: cros_ec_lpc: Separate host command and irq disable Both cros host command and irq disable were moved to suspend prepare stage from late suspend recently. This is causing EC to report MKBP event timeouts during suspend stress testing. When the MKBP event timeouts happen during suspend, subsequent wakeup of AP by EC using MKBP doesn't happen properly. Move the irq disabling part back to late suspend stage which is a general suggestion from the suspend kernel documentaiton to do irq disable as late as possible. Fixes: 4b9abbc132b8 ("platform/chrome: cros_ec_lpc: Move host command to prepare/complete") Signed-off-by: Lalith Rajendran Link: https://lore.kernel.org/r/20231027160221.v4.1.I1725c3ed27eb7cd9836904e49e8bfa9fb0200a97@changeid Signed-off-by: Tzung-Bi Shih commit 8d2ad999ca3c64cb08cf6a58d227b9d9e746d708 Author: Dan Williams Date: Fri Oct 27 20:13:23 2023 -0700 cxl/port: Fix delete_endpoint() vs parent unregistration race The CXL subsystem, at cxl_mem ->probe() time, establishes a lineage of ports (struct cxl_port objects) between an endpoint and the root of a CXL topology. Each port including the endpoint port is attached to the cxl_port driver. Given that setup, it follows that when either any port in that lineage goes through a cxl_port ->remove() event, or the memdev goes through a cxl_mem ->remove() event. The hierarchy below the removed port, or the entire hierarchy if the memdev is removed needs to come down. The delete_endpoint() callback is careful to check whether it is being called to tear down the hierarchy, or if it is only being called to teardown the memdev because an ancestor port is going through ->remove(). That care needs to take the device_lock() of the endpoint's parent. Which requires 2 bugs to be fixed: 1/ A reference on the parent is needed to prevent use-after-free scenarios like this signature: BUG: spinlock bad magic on CPU#0, kworker/u56:0/11 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS edk2-20230524-3.fc38 05/24/2023 Workqueue: cxl_port detach_memdev [cxl_core] RIP: 0010:spin_bug+0x65/0xa0 Call Trace: do_raw_spin_lock+0x69/0xa0 __mutex_lock+0x695/0xb80 delete_endpoint+0xad/0x150 [cxl_core] devres_release_all+0xb8/0x110 device_unbind_cleanup+0xe/0x70 device_release_driver_internal+0x1d2/0x210 detach_memdev+0x15/0x20 [cxl_core] process_one_work+0x1e3/0x4c0 worker_thread+0x1dd/0x3d0 2/ In the case of RCH topologies, the parent device that needs to be locked is not always @port->dev as returned by cxl_mem_find_port(), use endpoint->dev.parent instead. Fixes: 8dd2bc0f8e02 ("cxl/mem: Add the cxl_mem driver") Cc: Reported-by: Robert Richter Closes: http://lore.kernel.org/r/20231018171713.1883517-2-rrichter@amd.com Signed-off-by: Dan Williams commit 1768d3a0144c7aae55b9cee66dabf94946eec01e Author: Arnaldo Carvalho de Melo Date: Fri Oct 27 11:18:47 2023 -0300 perf build: Disable BPF skeletons if clang version is < 12.0.1 While building on a wide range of distros and clang versions it was noticed that at least version 12.0.1 (noticed on Alpine 3.15 with "Alpine clang version 12.0.1") is needed to not fail with BTF generation errors such as: Debian:10 Debian clang version 11.0.1-2~deb10u1: CLANG /tmp/build/perf/util/bpf_skel/.tmp/sample_filter.bpf.o GENSKEL /tmp/build/perf/util/bpf_skel/sample_filter.skel.h libbpf: failed to find BTF for extern 'bpf_cast_to_kern_ctx' [21] section: -2 Error: failed to open BPF object file: No such file or directory make[2]: *** [Makefile.perf:1121: /tmp/build/perf/util/bpf_skel/sample_filter.skel.h] Error 254 make[2]: *** Deleting file '/tmp/build/perf/util/bpf_skel/sample_filter.skel.h' Amazon Linux 2: clang version 11.1.0 (Amazon Linux 2 11.1.0-1.amzn2.0.2) GENSKEL /tmp/build/perf/util/bpf_skel/sample_filter.skel.h libbpf: elf: skipping unrecognized data section(18) .eh_frame libbpf: elf: skipping relo section(19) .rel.eh_frame for section(18) .eh_frame libbpf: failed to find BTF for extern 'bpf_cast_to_kern_ctx' [21] section: -2 Error: failed to open BPF object file: No such file or directory make[2]: *** [/tmp/build/perf/util/bpf_skel/sample_filter.skel.h] Error 254 make[2]: *** Deleting file `/tmp/build/perf/util/bpf_skel/sample_filter.skel.h' Ubuntu 20.04: clang version 10.0.0-4ubuntu1 CLANG /tmp/build/perf/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o GENSKEL /tmp/build/perf/util/bpf_skel/bench_uprobe.skel.h GENSKEL /tmp/build/perf/util/bpf_skel/bperf_leader.skel.h libbpf: sec '.reluprobe': corrupted symbol #27 pointing to invalid section #65522 for relo #0 GENSKEL /tmp/build/perf/util/bpf_skel/bperf_follower.skel.h Error: failed to open BPF object file: BPF object format invalid make[2]: *** [Makefile.perf:1121: /tmp/build/perf/util/bpf_skel/bench_uprobe.skel.h] Error 95 make[2]: *** Deleting file '/tmp/build/perf/util/bpf_skel/bench_uprobe.skel.h' So check if the version is at least 12.0.1 otherwise disable building BPF skels and provide a message about it, continuing the build. The message, when running on amazonlinux:2: Makefile.config:698: Warning: Disabled BPF skeletons as reliable BTF generation needs at least clang version 12.0.1 Signed-off-by: Arnaldo Carvalho de Melo Reviewed-by: Ian Rogers Link: https://lore.kernel.org/r/ZTvGx/Ou6BVnYBqi@kernel.org Signed-off-by: Namhyung Kim commit ee40490dd7cdcda38ece6d081f63ecddd3fdbe25 Author: Colin Ian King Date: Fri Oct 27 09:46:33 2023 +0100 perf callchain: Fix spelling mistake "statisitcs" -> "statistics" There are a couple of spelling mistakes in perror messages. Fix them. Signed-off-by: Colin Ian King Cc: kernel-janitors@vger.kernel.org Link: https://lore.kernel.org/r/20231027084633.1167530-1-colin.i.king@gmail.com Signed-off-by: Namhyung Kim commit 0e0f03d7fc933ffe22c67feeec4b49bdd4cbfbd1 Author: Colin Ian King Date: Fri Oct 27 09:40:11 2023 +0100 perf report: Fix spelling mistake "heirachy" -> "hierarchy" There is a spelling mistake in a ui error message. Fix it. Signed-off-by: Colin Ian King Cc: kernel-janitors@vger.kernel.org Link: https://lore.kernel.org/r/20231027084011.1167091-1-colin.i.king@gmail.com Signed-off-by: Namhyung Kim commit 93c65d61433bcec4070fc61b7c737c79fc25f09a Author: Arnaldo Carvalho de Melo Date: Fri Oct 27 10:33:30 2023 -0300 perf python: Fix binding linkage due to rename and move of evsel__increase_rlimit() The changes in ("perf evsel: Rename evsel__increase_rlimit to rlimit__increase_nofile") ended up breaking the python binding that now references the rlimit__increase_nofile function, add the util/rlimit.o to the tools/perf/util/python-ext-sources to cure that. This was detected by the 'perf test python' regression test: $ perf test python 14: 'import perf' in python : FAILED! $ perf test -v python Couldn't bump rlimit(MEMLOCK), failures may take place when creating BPF maps, etc 14: 'import perf' in python : --- start --- test child forked, pid 2912462 python usage test: "echo "import sys ; sys.path.insert(0, '/tmp/build/perf-tools-next/python'); import perf" | '/usr/bin/python3' " Traceback (most recent call last): File "", line 1, in ImportError: /tmp/build/perf-tools-next/python/perf.cpython-311-x86_64-linux-gnu.so: undefined symbol: rlimit__increase_nofile test child finished with -1 ---- end ---- 'import perf' in python: FAILED! $ Fixes: e093a222d7cba1eb ("perf evsel: Rename evsel__increase_rlimit to rlimit__increase_nofile") Acked-by: Namhyung Kim Acked-by: Yang Jihong Link: https://lore.kernel.org/lkml/ZTrCS5Z3PZAmfPdV@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Namhyung Kim commit 75357829cc8ef20808f38b6256fa167f36267c9f Author: Stephen Boyd Date: Fri Oct 27 15:58:21 2023 -0700 clk: Fix clk gate kunit test on big-endian CPUs The clk gate kunit test checks that the implementation of the basic clk gate reads and writes the proper bits in an MMIO register. The implementation of the basic clk gate type uses writel() and readl() which operate on little-endian registers. This test fails on big-endian CPUs because the clk gate implementation writes to 'fake_reg' with writel(), which converts the value to be written to little-endian before storing the value in the fake register. When the test checks the bits in the fake register on a big-endian machine it falsely assumes the format of the register is also big-endian, when it is really always little-endian. Suffice to say things don't work very well. Mark 'fake_reg' as __le32 and push through endian accessor fixes wherever the value is inspected to make this test endian agnostic. There's a CLK_GATE_BIG_ENDIAN flag for big-endian MMIO devices, which this test isn't using. A follow-up patch will test with and without that flag. Reported-by: Boqun Feng Closes: https://lore.kernel.org/r/ZTLH5o0GlFBYsAHq@boqun-archlinux Tested-by: Boqun Feng Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20231027225821.95833-1-sboyd@kernel.org commit 2f06996d72df779a47852bcf059fc04a555fe342 Author: Lin, Meng-Bo Date: Fri Oct 27 15:56:33 2023 -0700 Input: cyttsp5 - add handling for vddio regulator The Cypress touchscreen controllers are often used with external pull-up for the interrupt line and the I2C lines, so we might need to enable a regulator to bring the lines into usable state. Otherwise, this might cause spurious interrupts and reading from I2C will fail. Implement support for a "vddio-supply" that is enabled by the cyttsp5 driver so that the regulator gets enabled when needed. Signed-off-by: Lin, Meng-Bo Acked-by: Alistair Francis Link: https://lore.kernel.org/r/20221117190507.87535-3-linmengbo0689@protonmail.com Signed-off-by: Dmitry Torokhov commit fade5a92931c241be5b7e185d946205cfdfcb26f Author: Lin, Meng-Bo Date: Fri Oct 27 15:53:59 2023 -0700 dt-bindings: input: cyttsp5: document vddio-supply The Samsung touchscreen controllers are often used with external pull-up for the interrupt line and the I2C lines, so we might need to enable a regulator to bring the lines into usable state. Otherwise, this might cause spurious interrupts and reading from I2C will fail. Document support for a "vddio-supply" that is enabled by the cyttsp5 driver so that the regulator gets enabled when needed. Signed-off-by: Lin, Meng-Bo Acked-by: Krzysztof Kozlowski Reviewed-by: Alistair Francis Link: https://lore.kernel.org/r/20221117190507.87535-2-linmengbo0689@protonmail.com Signed-off-by: Dmitry Torokhov commit f1c73396133cb3d913e2075298005644ee8dfade Author: Raju Lakkaraju Date: Fri Oct 27 10:13:06 2023 +0530 net: pcs: xpcs: Add 2500BASE-X case in get state for XPCS drivers Add DW_2500BASEX case in xpcs_get_state( ) to update speed, duplex and pause Signed-off-by: Raju Lakkaraju Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20231027044306.291250-1-Raju.Lakkaraju@microchip.com Signed-off-by: Jakub Kicinski commit 06497763c8f15d08c0e356e651a61f2930a8987c Author: Yonghong Song Date: Fri Oct 27 11:24:24 2023 -0700 net: bpf: Use sockopt_lock_sock() in ip_sock_set_tos() With latest sync from net-next tree, bpf-next has a bpf selftest failure: [root@arch-fb-vm1 bpf]# ./test_progs -t setget_sockopt ... [ 76.194349] ============================================ [ 76.194682] WARNING: possible recursive locking detected [ 76.195039] 6.6.0-rc7-g37884503df08-dirty #67 Tainted: G W OE [ 76.195518] -------------------------------------------- [ 76.195852] new_name/154 is trying to acquire lock: [ 76.196159] ffff8c3e06ad8d30 (sk_lock-AF_INET){+.+.}-{0:0}, at: ip_sock_set_tos+0x19/0x30 [ 76.196669] [ 76.196669] but task is already holding lock: [ 76.197028] ffff8c3e06ad8d30 (sk_lock-AF_INET){+.+.}-{0:0}, at: inet_listen+0x21/0x70 [ 76.197517] [ 76.197517] other info that might help us debug this: [ 76.197919] Possible unsafe locking scenario: [ 76.197919] [ 76.198287] CPU0 [ 76.198444] ---- [ 76.198600] lock(sk_lock-AF_INET); [ 76.198831] lock(sk_lock-AF_INET); [ 76.199062] [ 76.199062] *** DEADLOCK *** [ 76.199062] [ 76.199420] May be due to missing lock nesting notation [ 76.199420] [ 76.199879] 2 locks held by new_name/154: [ 76.200131] #0: ffff8c3e06ad8d30 (sk_lock-AF_INET){+.+.}-{0:0}, at: inet_listen+0x21/0x70 [ 76.200644] #1: ffffffff90f96a40 (rcu_read_lock){....}-{1:2}, at: __cgroup_bpf_run_filter_sock_ops+0x55/0x290 [ 76.201268] [ 76.201268] stack backtrace: [ 76.201538] CPU: 4 PID: 154 Comm: new_name Tainted: G W OE 6.6.0-rc7-g37884503df08-dirty #67 [ 76.202134] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 [ 76.202699] Call Trace: [ 76.202858] [ 76.203002] dump_stack_lvl+0x4b/0x80 [ 76.203239] __lock_acquire+0x740/0x1ec0 [ 76.203503] lock_acquire+0xc1/0x2a0 [ 76.203766] ? ip_sock_set_tos+0x19/0x30 [ 76.204050] ? sk_stream_write_space+0x12a/0x230 [ 76.204389] ? lock_release+0xbe/0x260 [ 76.204661] lock_sock_nested+0x32/0x80 [ 76.204942] ? ip_sock_set_tos+0x19/0x30 [ 76.205208] ip_sock_set_tos+0x19/0x30 [ 76.205452] do_ip_setsockopt+0x4b3/0x1580 [ 76.205719] __bpf_setsockopt+0x62/0xa0 [ 76.205963] bpf_sock_ops_setsockopt+0x11/0x20 [ 76.206247] bpf_prog_630217292049c96e_bpf_test_sockopt_int+0xbc/0x123 [ 76.206660] bpf_prog_493685a3bae00bbd_bpf_test_ip_sockopt+0x49/0x4b [ 76.207055] bpf_prog_b0bcd27f269aeea0_skops_sockopt+0x44c/0xec7 [ 76.207437] __cgroup_bpf_run_filter_sock_ops+0xda/0x290 [ 76.207829] __inet_listen_sk+0x108/0x1b0 [ 76.208122] inet_listen+0x48/0x70 [ 76.208373] __sys_listen+0x74/0xb0 [ 76.208630] __x64_sys_listen+0x16/0x20 [ 76.208911] do_syscall_64+0x3f/0x90 [ 76.209174] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 ... Both ip_sock_set_tos() and inet_listen() calls lock_sock(sk) which caused a dead lock. To fix the issue, use sockopt_lock_sock() in ip_sock_set_tos() instead. sockopt_lock_sock() will avoid lock_sock() if it is in bpf context. Fixes: 878d951c6712 ("inet: lock the socket in ip_sock_set_tos()") Suggested-by: Martin KaFai Lau Signed-off-by: Yonghong Song Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20231027182424.1444845-1-yonghong.song@linux.dev Signed-off-by: Jakub Kicinski commit f5247a6ed5b5bbaa609f97049de868974eb7a7c2 Author: Konstantin Taranov Date: Fri Oct 27 11:06:51 2023 -0700 net: mana: Use xdp_set_features_flag instead of direct assignment This patch uses a helper function for assignment of xdp_features. This change simplifies backports. Signed-off-by: Konstantin Taranov Signed-off-by: Haiyang Zhang Link: https://lore.kernel.org/r/1698430011-21562-1-git-send-email-haiyangz@microsoft.com Signed-off-by: Jakub Kicinski commit 6d90b64256f39511d0083111e167321dc6a6add2 Author: Benjamin Poirier Date: Fri Oct 27 14:44:10 2023 -0400 vxlan: Cleanup IFLA_VXLAN_PORT_RANGE entry in vxlan_get_size() This patch is basically a followup to commit 4e4b1798cc90 ("vxlan: Add missing entries to vxlan_get_size()"). All of the attributes in vxlan_get_size() appear in the same order that they are filled in vxlan_fill_info() except for IFLA_VXLAN_PORT_RANGE. For consistency, move that entry to match its order and add a comment, like for all other entries. Signed-off-by: Benjamin Poirier Link: https://lore.kernel.org/r/20231027184410.236671-1-bpoirier@nvidia.com Signed-off-by: Jakub Kicinski commit a4213705b88e61cadb5df41e3bc7aae4f4b7f3ec Merge: 6479c975b20a7 36d0395b30f82 Author: Jakub Kicinski Date: Fri Oct 27 15:35:51 2023 -0700 Merge branch 'intel-wired-lan-driver-updates-for-2023-10-23-iavf' Jacob Keller says: ==================== Intel Wired LAN Driver Updates for 2023-10-23 (iavf) This series includes iAVF driver cleanups from Michal Schmidt. Michal removes and updates stale comments, fixes some locking anti-patterns, improves handling of resets when the PF is slow, avoids unnecessary duplication of netdev state, refactors away some duplicate code, and finally removes the never-actually-used client interface. Changes since v1: * Dropped patch ("iavf: in iavf_down, disable queues when removing the driver") which was applied directly to net. * Fixed a merge conflict due to 7db311104388 ("iavf: initialize waitqueues before starting watchdog_task"). V1 was originally posted at: https://lore.kernel.org/netdev/20231027104109.4f536f51@kernel.org/T/#mfadbdb39313eeccc616fdee80a4fdd6bda7e2822 ==================== Link: https://lore.kernel.org/r/20231027175941.1340255-1-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 36d0395b30f822ab4910cdac5438ab0185a6723f Author: Michal Schmidt Date: Fri Oct 27 10:59:41 2023 -0700 iavf: delete the iavf client interface The iavf client interface was added in 2017 by commit ed0e894de7c1 ("i40evf: add client interface"), but there have never been any in-tree callers. It's not useful for future development either. The Intel out-of-tree iavf and irdma drivers instead use an auxiliary bus, which is a better solution. Remove the iavf client interface code. Also gone are the client_task work and the client_lock mutex. Signed-off-by: Michal Schmidt Reviewed-by: Jacob Keller Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231027175941.1340255-9-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit b5b219a1fa5faeb69b356e0ed3e14136887a905c Author: Michal Schmidt Date: Fri Oct 27 10:59:40 2023 -0700 iavf: add a common function for undoing the interrupt scheme Add a new function iavf_free_interrupt_scheme that does the inverse of iavf_init_interrupt_scheme. Symmetry is nice. And there will be three callers already. Signed-off-by: Michal Schmidt Reviewed-by: Wojciech Drewek Reviewed-by: Jacob Keller Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231027175941.1340255-8-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 5c4e1d187442c07b8bcbb7097a70e65e8b187598 Author: Michal Schmidt Date: Fri Oct 27 10:59:39 2023 -0700 iavf: use unregister_netdev Use unregister_netdev, which takes rtnl_lock for us. We don't have to check the reg_state under rtnl_lock. There's nothing to race with. We have just cancelled the finish_config work. Signed-off-by: Michal Schmidt Reviewed-by: Wojciech Drewek Reviewed-by: Jacob Keller Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231027175941.1340255-7-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 34ad34bf06cae3cf2f7b8361aebc28b7d51fb7dc Author: Michal Schmidt Date: Fri Oct 27 10:59:38 2023 -0700 iavf: rely on netdev's own registered state The information whether a netdev has been registered is already present in the netdev itself. There's no need for a driver flag with the same meaning. Signed-off-by: Michal Schmidt Reviewed-by: Wojciech Drewek Reviewed-by: Jacob Keller Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231027175941.1340255-6-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 54584b17880632085906faa49284bc13f7dca06f Author: Michal Schmidt Date: Fri Oct 27 10:59:37 2023 -0700 iavf: fix the waiting time for initial reset Every time I create VFs on ice, I receive at least one "Device is still in reset (-16), retrying" message per VF. It recovers fine, but typical usecases should not trigger scary-looking messages. The waiting for reset is too short. It makes no sense to check every 10 microseconds. Typical reset waiting times are at least tens of milliseconds and can be several seconds. I suspect the polling interval was meant to be 10 milliseconds all along. IAVF_RESET_WAIT_COMPLETE_COUNT is defined as 2000, so the total waiting time could be over 20 seconds. I have seen resets take 5 seconds (with 128 VFs on ice). The added benefit of not triggering the "Device is still in reset" path is that we avoid going through the __IAVF_INIT_FAILED state, which would take a full second before retrying. Signed-off-by: Michal Schmidt Reviewed-by: Wojciech Drewek Tested-by: Rafal Romanowski Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231027175941.1340255-5-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 6a0d989d3cdb1b7653ca264ff41f4a4517a79500 Author: Michal Schmidt Date: Fri Oct 27 10:59:36 2023 -0700 iavf: in iavf_down, don't queue watchdog_task if comms failed The reason for queueing watchdog_task is to have it process the aq_required flags that are being set here. If comms failed, there's nothing to do, so return early. Signed-off-by: Michal Schmidt Reviewed-by: Wojciech Drewek Tested-by: Rafal Romanowski Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231027175941.1340255-4-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 5902ee6dc651f4bb536fbc19e654edc7b6d711d2 Author: Michal Schmidt Date: Fri Oct 27 10:59:35 2023 -0700 iavf: simplify mutex_trylock+sleep loops This pattern appears in two places in the iavf source code: while (!mutex_trylock(...)) usleep_range(...); That's just mutex_lock with extra steps. The pattern is a leftover from when iavf used bit flags instead of mutexes for locking. Commit 5ac49f3c2702 ("iavf: use mutexes for locking of critical sections") replaced test_and_set_bit with !mutex_trylock, preserving the pattern. Simplify it to mutex_lock. Signed-off-by: Michal Schmidt Reviewed-by: Wojciech Drewek Tested-by: Rafal Romanowski Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231027175941.1340255-3-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 77361cb9c1d6587d460215f096590e9d1f75f9f3 Author: Michal Schmidt Date: Fri Oct 27 10:59:34 2023 -0700 iavf: fix comments about old bit locks Bit lock __IAVF_IN_CRITICAL_TASK does not exist anymore since commit 5ac49f3c2702 ("iavf: use mutexes for locking of critical sections"). Adjust the comments accordingly. Signed-off-by: Michal Schmidt Reviewed-by: Wojciech Drewek Tested-by: Rafal Romanowski Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231027175941.1340255-2-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 6479c975b20a7fe6ecacec3a60dc6f838ecee9d6 Author: Davide Caratti Date: Fri Oct 27 16:04:54 2023 +0200 doc/netlink: Update schema to support cmd-cnt-name and cmd-max-name allow specifying cmd-cnt-name and cmd-max-name in netlink specs, in accordance with Documentation/userspace-api/netlink/c-code-gen.rst. Use cmd-cnt-name and attr-cnt-name in the mptcp yaml spec and in the corresponding uAPI headers, to preserve the #defines we had in the past and avoid adding new ones. v2: - squash modification in mptcp.yaml and MPTCP uAPI headers Suggested-by: Jakub Kicinski Signed-off-by: Davide Caratti Link: https://lore.kernel.org/r/12d4ed0116d8883cf4b533b856f3125a34e56749.1698415310.git.dcaratti@redhat.com Signed-off-by: Jakub Kicinski commit d96e48a3d55db7ee62e607ad2d89eee1a8585028 Author: Jiri Pirko Date: Fri Oct 27 11:25:25 2023 +0200 tools: ynl: introduce option to process unknown attributes or types In case the kernel sends message back containing attribute not defined in family spec, following exception is raised to the user: $ sudo ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/devlink.yaml --do trap-get --json '{"bus-name": "netdevsim", "dev-name": "netdevsim1", "trap-name": "source_mac_is_multicast"}' Traceback (most recent call last): File "/home/jiri/work/linux/tools/net/ynl/lib/ynl.py", line 521, in _decode attr_spec = attr_space.attrs_by_val[attr.type] ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ KeyError: 132 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/jiri/work/linux/./tools/net/ynl/cli.py", line 61, in main() File "/home/jiri/work/linux/./tools/net/ynl/cli.py", line 49, in main reply = ynl.do(args.do, attrs, args.flags) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jiri/work/linux/tools/net/ynl/lib/ynl.py", line 731, in do return self._op(method, vals, flags) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jiri/work/linux/tools/net/ynl/lib/ynl.py", line 719, in _op rsp_msg = self._decode(decoded.raw_attrs, op.attr_set.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jiri/work/linux/tools/net/ynl/lib/ynl.py", line 525, in _decode raise Exception(f"Space '{space}' has no attribute with value '{attr.type}'") Exception: Space 'devlink' has no attribute with value '132' Introduce a command line option "process-unknown" and pass it down to YnlFamily class constructor to allow user to process unknown attributes and types and print them as binaries. $ sudo ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/devlink.yaml --do trap-get --json '{"bus-name": "netdevsim", "dev-name": "netdevsim1", "trap-name": "source_mac_is_multicast"}' --process-unknown {'UnknownAttr(129)': {'UnknownAttr(0)': b'\x00\x00\x00\x00\x00\x00\x00\x00', 'UnknownAttr(1)': b'\x00\x00\x00\x00\x00\x00\x00\x00', 'UnknownAttr(2)': b'\x0e\x00\x00\x00\x00\x00\x00\x00'}, 'UnknownAttr(132)': b'\x00', 'UnknownAttr(133)': b'', 'UnknownAttr(134)': {'UnknownAttr(0)': b''}, 'bus-name': 'netdevsim', 'dev-name': 'netdevsim1', 'trap-action': 'drop', 'trap-group-name': 'l2_drops', 'trap-name': 'source_mac_is_multicast'} Signed-off-by: Jiri Pirko Link: https://lore.kernel.org/r/20231027092525.956172-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit ff672b9ffeb3f82135488ac16c5c5eb4b992999b Author: Eric Dumazet Date: Thu Oct 26 13:14:46 2023 +0000 ipvlan: properly track tx_errors Both ipvlan_process_v4_outbound() and ipvlan_process_v6_outbound() increment dev->stats.tx_errors in case of errors. Unfortunately there are two issues : 1) ipvlan_get_stats64() does not propagate dev->stats.tx_errors to user. 2) Increments are not atomic. KCSAN would complain eventually. Use DEV_STATS_INC() to not miss an update, and change ipvlan_get_stats64() to copy the value back to user. Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.") Signed-off-by: Eric Dumazet Cc: Mahesh Bandewar Link: https://lore.kernel.org/r/20231026131446.3933175-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 6aff7cbfe7bfafbed86a6948e660e280848c4d97 Author: Ido Schimmel Date: Thu Oct 26 11:33:43 2023 +0300 netdevsim: Block until all devices are released Like other buses, devices on the netdevsim bus have a release callback that is invoked when the reference count of the device drops to zero. However, unlike other buses such as PCI, the release callback is not necessarily built into the kernel, as netdevsim can be built as a module. The above is problematic as nothing prevents the module from being unloaded before the release callback has been invoked, which can happen asynchronously. One such example can be found in commit a380687200e0 ("devlink: take device reference for devlink object") where devlink calls put_device() from an RCU callback. The issue is not theoretical and the reproducer in [1] can reliably crash the kernel. The conclusion of this discussion was that the issue should be solved in netdevsim, which is what this patch is trying to do. Add a reference count that is increased when a device is added to the bus and decreased when a device is released. Signal a completion when the reference count drops to zero and wait for the completion when unloading the module so that the module will not be unloaded before all the devices were released. The reference count is initialized to one so that completion is only signaled when unloading the module. With this patch, the reproducer in [1] no longer crashes the kernel. [1] https://lore.kernel.org/netdev/20230619125015.1541143-2-idosch@nvidia.com/ Fixes: a380687200e0 ("devlink: take device reference for devlink object") Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231026083343.890689-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 1a86a77a2328ad7405bd25b8f4c470445e966622 Author: Fei Qin Date: Thu Oct 26 10:00:58 2023 +0200 nfp: using napi_build_skb() to replace build_skb() The napi_build_skb() can reuse the skb in skb cache per CPU or can allocate skbs in bulk, which helps improve the performance. Signed-off-by: Fei Qin Signed-off-by: Louis Peens Reviewed-by: Wojciech Drewek Link: https://lore.kernel.org/r/20231026080058.22810-1-louis.peens@corigine.com Signed-off-by: Jakub Kicinski commit 796dc3c79d6e9295771100fbaa24faf14896cf01 Author: Colin Ian King Date: Thu Oct 26 07:54:08 2023 +0100 net: dsa: microchip: ksz9477: Fix spelling mistake "Enery" -> "Energy" There is a spelling mistake in a dev_dbg message. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Simon Horman Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/all/20231026065408.1087824-1-colin.i.king@gmail.com/ Signed-off-by: Jakub Kicinski commit dfaed0e9f1e7c0a261ece2242294e4f7891dbadb Merge: 3a04927f8d4b7 8afb91acc4a3e Author: Jakub Kicinski Date: Fri Oct 27 14:43:55 2023 -0700 Merge branch 'net-dsa-microchip-provide-wake-on-lan-support-part-2' Oleksij Rempel says: ==================== net: dsa: microchip: provide Wake on LAN support (part 2) This patch series introduces extensive Wake on LAN (WoL) support for the Microchip KSZ9477 family of switches, coupled with some code refactoring and error handling enhancements. The principal aim is to enable and manage Wake on Magic Packet and other PHY event triggers for waking up the system, whilst ensuring that the switch isn't reset during a shutdown if WoL is active. The Wake on LAN functionality is optional and is particularly beneficial if the PME pins are connected to the SoC as a wake source or to a PMIC that can enable or wake the SoC. ==================== Link: https://lore.kernel.org/r/20231026051051.2316937-1-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski commit 8afb91acc4a3ea25ce15160df1fcab93b155b75e Author: Oleksij Rempel Date: Thu Oct 26 07:10:51 2023 +0200 net: dsa: microchip: Ensure Stable PME Pin State for Wake-on-LAN Ensures a stable PME (Power Management Event) pin state by disabling PME on system start and enabling it on shutdown only if WoL (Wake-on-LAN) is configured. This is needed to avoid issues with some PMICs (Power Management ICs). Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20231026051051.2316937-6-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski commit 77c819cb493acf04bcbb52411debc4ef044429b2 Author: Oleksij Rempel Date: Thu Oct 26 07:10:50 2023 +0200 net: dsa: microchip: Refactor switch shutdown routine for WoL preparation Centralize the switch shutdown routine in a dedicated function, ksz_switch_shutdown(), to enhance code maintainability and reduce redundancy. This change abstracts the common shutdown operations previously duplicated in ksz9477_i2c_shutdown() and ksz_spi_shutdown(). This refactoring is a preparatory step for an upcoming patch to avoid reset on shutdown if Wake-on-LAN (WoL) is enabled. Signed-off-by: Oleksij Rempel Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20231026051051.2316937-5-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski commit 818cdb0f4b3834b342a32040ba0ee12fefb548e0 Author: Oleksij Rempel Date: Thu Oct 26 07:10:49 2023 +0200 net: dsa: microchip: Add error handling for ksz_switch_macaddr_get() Enhance the ksz_switch_macaddr_get() function to handle errors that may occur during the call to ksz_write8(). Specifically, this update checks the return value of ksz_write8(), which may fail if regmap ranges validation is not passed and returns the error code. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20231026051051.2316937-4-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski commit 78c21fca0b391792cb105e4a505bcba88ea737e1 Author: Oleksij Rempel Date: Thu Oct 26 07:10:48 2023 +0200 net: dsa: microchip: Refactor comment for ksz_switch_macaddr_get() function Update the comment to follow kernel-doc format. Signed-off-by: Oleksij Rempel Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20231026051051.2316937-3-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski commit 3b454b6390c32d5a6a31ee67f510095b138264d1 Author: Oleksij Rempel Date: Thu Oct 26 07:10:47 2023 +0200 net: dsa: microchip: ksz9477: Add Wake on Magic Packet support Introduce Wake on Magic Packet (WoL) functionality to the ksz9477 driver. Major changes include: 1. Extending the `ksz9477_handle_wake_reason` function to identify Magic Packet wake events alongside existing wake reasons. 2. Updating the `ksz9477_get_wol` and `ksz9477_set_wol` functions to handle WAKE_MAGIC alongside the existing WAKE_PHY option, and to program the switch's MAC address register accordingly when Magic Packet wake-up is enabled. This change will prevent WAKE_MAGIC activation if the related port has a different MAC address compared to a MAC address already used by HSR or an already active WAKE_MAGIC on another port. 3. Adding a restriction in `ksz_port_set_mac_address` to prevent MAC address changes on ports with active Wake on Magic Packet, as the switch's MAC address register is utilized for this feature. Signed-off-by: Oleksij Rempel Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20231026051051.2316937-2-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski commit 245561ba6d5de42bf73d501f910b181bc7fa5601 Author: Sami Tolvanen Date: Wed Sep 27 22:48:04 2023 +0000 lkdtm: Fix CFI_BACKWARD on RISC-V On RISC-V, the return address is before the current frame pointer, unlike on most other architectures. Use the correct offset on RISC-V to fix the CFI_BACKWARD test. Signed-off-by: Sami Tolvanen Acked-by: Kees Cook Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/20230927224757.1154247-14-samitolvanen@google.com Signed-off-by: Palmer Dabbelt commit c40fef858d002fb027033c572ac8bdf8756a2c6b Author: Sami Tolvanen Date: Wed Sep 27 22:48:03 2023 +0000 riscv: Use separate IRQ shadow call stacks When both CONFIG_IRQ_STACKS and SCS are enabled, also use a separate per-CPU shadow call stack. Signed-off-by: Sami Tolvanen Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/20230927224757.1154247-13-samitolvanen@google.com Signed-off-by: Palmer Dabbelt commit d1584d791a297aa8ed93503382a682a6ecfc4218 Author: Sami Tolvanen Date: Wed Sep 27 22:48:02 2023 +0000 riscv: Implement Shadow Call Stack Implement CONFIG_SHADOW_CALL_STACK for RISC-V. When enabled, the compiler injects instructions to all non-leaf C functions to store the return address to the shadow stack and unconditionally load it again before returning, which makes it harder to corrupt the return address through a stack overflow, for example. The active shadow call stack pointer is stored in the gp register, which makes SCS incompatible with gp relaxation. Use --no-relax-gp to ensure gp relaxation is disabled and disable global pointer loading. Add SCS pointers to struct thread_info, implement SCS initialization, and task switching Signed-off-by: Sami Tolvanen Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/20230927224757.1154247-12-samitolvanen@google.com Signed-off-by: Palmer Dabbelt commit e609b4f4252a2ad2454736078693571b9fbff019 Author: Sami Tolvanen Date: Wed Sep 27 22:48:01 2023 +0000 riscv: Move global pointer loading to a macro In Clang 17, -fsanitize=shadow-call-stack uses the newly declared platform register gp for storing shadow call stack pointers. As this is obviously incompatible with gp relaxation, in preparation for CONFIG_SHADOW_CALL_STACK support, move global pointer loading to a single macro, which we can cleanly disable when SCS is used instead. Link: https://reviews.llvm.org/rGaa1d2693c256 Link: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/commit/a484e843e6eeb51f0cb7b8819e50da6d2444d769 Signed-off-by: Sami Tolvanen Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/20230927224757.1154247-11-samitolvanen@google.com Signed-off-by: Palmer Dabbelt commit 82982fdd5133fa7e0b2dfaf746d18d6f29922b82 Author: Sami Tolvanen Date: Wed Sep 27 22:48:00 2023 +0000 riscv: Deduplicate IRQ stack switching With CONFIG_IRQ_STACKS, we switch to a separate per-CPU IRQ stack before calling handle_riscv_irq or __do_softirq. We currently have duplicate inline assembly snippets for stack switching in both code paths. Now that we can access per-CPU variables in assembly, implement call_on_irq_stack in assembly, and use that instead of redundant inline assembly. Signed-off-by: Sami Tolvanen Tested-by: Nathan Chancellor Reviewed-by: Guo Ren Link: https://lore.kernel.org/r/20230927224757.1154247-10-samitolvanen@google.com Signed-off-by: Palmer Dabbelt commit be97d0db5f44c0674480cb79ac6f5b0529b84c76 Author: Deepak Gupta Date: Wed Sep 27 22:47:59 2023 +0000 riscv: VMAP_STACK overflow detection thread-safe commit 31da94c25aea ("riscv: add VMAP_STACK overflow detection") added support for CONFIG_VMAP_STACK. If overflow is detected, CPU switches to `shadow_stack` temporarily before switching finally to per-cpu `overflow_stack`. If two CPUs/harts are racing and end up in over flowing kernel stack, one or both will end up corrupting each other state because `shadow_stack` is not per-cpu. This patch optimizes per-cpu overflow stack switch by directly picking per-cpu `overflow_stack` and gets rid of `shadow_stack`. Following are the changes in this patch - Defines an asm macro to obtain per-cpu symbols in destination register. - In entry.S, when overflow is detected, per-cpu overflow stack is located using per-cpu asm macro. Computing per-cpu symbol requires a temporary register. x31 is saved away into CSR_SCRATCH (CSR_SCRATCH is anyways zero since we're in kernel). Please see Links for additional relevant disccussion and alternative solution. Tested by `echo EXHAUST_STACK > /sys/kernel/debug/provoke-crash/DIRECT` Kernel crash log below Insufficient stack space to handle exception!/debug/provoke-crash/DIRECT Task stack: [0xff20000010a98000..0xff20000010a9c000] Overflow stack: [0xff600001f7d98370..0xff600001f7d99370] CPU: 1 PID: 205 Comm: bash Not tainted 6.1.0-rc2-00001-g328a1f96f7b9 #34 Hardware name: riscv-virtio,qemu (DT) epc : __memset+0x60/0xfc ra : recursive_loop+0x48/0xc6 [lkdtm] epc : ffffffff808de0e4 ra : ffffffff0163a752 sp : ff20000010a97e80 gp : ffffffff815c0330 tp : ff600000820ea280 t0 : ff20000010a97e88 t1 : 000000000000002e t2 : 3233206874706564 s0 : ff20000010a982b0 s1 : 0000000000000012 a0 : ff20000010a97e88 a1 : 0000000000000000 a2 : 0000000000000400 a3 : ff20000010a98288 a4 : 0000000000000000 a5 : 0000000000000000 a6 : fffffffffffe43f0 a7 : 00007fffffffffff s2 : ff20000010a97e88 s3 : ffffffff01644680 s4 : ff20000010a9be90 s5 : ff600000842ba6c0 s6 : 00aaaaaac29e42b0 s7 : 00fffffff0aa3684 s8 : 00aaaaaac2978040 s9 : 0000000000000065 s10: 00ffffff8a7cad10 s11: 00ffffff8a76a4e0 t3 : ffffffff815dbaf4 t4 : ffffffff815dbaf4 t5 : ffffffff815dbab8 t6 : ff20000010a9bb48 status: 0000000200000120 badaddr: ff20000010a97e88 cause: 000000000000000f Kernel panic - not syncing: Kernel stack overflow CPU: 1 PID: 205 Comm: bash Not tainted 6.1.0-rc2-00001-g328a1f96f7b9 #34 Hardware name: riscv-virtio,qemu (DT) Call Trace: [] dump_backtrace+0x30/0x38 [] show_stack+0x40/0x4c [] dump_stack_lvl+0x44/0x5c [] dump_stack+0x18/0x20 [] panic+0x126/0x2fe [] walk_stackframe+0x0/0xf0 [] recursive_loop+0x48/0xc6 [lkdtm] SMP: stopping secondary CPUs ---[ end Kernel panic - not syncing: Kernel stack overflow ]--- Cc: Guo Ren Cc: Jisheng Zhang Link: https://lore.kernel.org/linux-riscv/Y347B0x4VUNOd6V7@xhacker/T/#t Link: https://lore.kernel.org/lkml/20221124094845.1907443-1-debug@rivosinc.com/ Signed-off-by: Deepak Gupta Co-developed-by: Sami Tolvanen Signed-off-by: Sami Tolvanen Acked-by: Guo Ren Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/20230927224757.1154247-9-samitolvanen@google.com Signed-off-by: Palmer Dabbelt commit 88862247ce8090da001d310152899644ec6597d9 Author: Geert Uytterhoeven Date: Wed Oct 25 12:05:21 2023 +0200 of: overlay: unittest: overlay_bad_unresolved: Spelling s/ok/okay/ While "ok" is recognized, the proper status value for an operational device is "okay". Fixes: eb38b9529aefa344 ("of: overlay: unittest: Add test for unresolved symbol") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/923f4f605b86f23d001c6efc9c2237ab449d447d.1698228277.git.geert+renesas@glider.be Signed-off-by: Rob Herring commit 73ae308801a89f273cd888b4f5be5726a747c842 Author: Rob Herring Date: Thu Oct 26 08:53:59 2023 -0500 of: address: Consolidate bus .map() functions The bus .map() functions vary only by checking the flag cells values and skipping over any flag cells to read the addresses. Otherwise they all do the same reading 'ranges' address and size and returning the address's offset if it is within the 'ranges' entry. Refactor all the .map() functions to pass in the flag cell size so that each bus can check the bus specific flags and then call a common function to do everything else. Acked-by: Herve Codina Link: https://lore.kernel.org/r/20231026135358.3564307-3-robh@kernel.org Signed-off-by: Rob Herring commit 88696db08b7efa3b6bb722014ea7429e78f6be32 Author: Rob Herring Date: Thu Oct 26 08:53:58 2023 -0500 of: address: Store number of bus flag cells rather than bool It is more useful to know how many flags cells a bus has rather than whether a bus has flags or not as ultimately the number of cells is the information used. Replace 'has_flags' boolean with 'flag_cells' count. Acked-by: Herve Codina Link: https://lore.kernel.org/r/20231026135358.3564307-2-robh@kernel.org Signed-off-by: Rob Herring commit 4d9ec5f04bad67abdbbd036801edba37e642f87d Author: Herve Codina Date: Tue Oct 17 13:02:18 2023 +0200 of: unittest: Add tests for address translations Add tests to exercise address translations based on ranges properties. Tests added cover "default" (2cell) address translations, "default flags" (3cell) address translations and PCI address translations. They also cover PCI BAR translations introduced in commit 407d1a51921e ("PCI: Create device tree node for bridge"). Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20231017110221.189299-4-herve.codina@bootlin.com Signed-off-by: Rob Herring commit bdb7e1922052b1e7fcce63e2cfa195958ff97e05 Merge: 0262a8a079896 805ce81826c89 Author: Mark Brown Date: Fri Oct 27 22:33:15 2023 +0100 ASoC: Merge up workaround for CODECs that play noise on stopped stream This was sent too late to actually make it for v6.6 but was sent against v6.6 so merge it up here. commit fc62d5e214df2dd64f5d675f01b609d86a422a2b Author: Andy Shevchenko Date: Tue Oct 10 17:11:23 2023 +0300 hte: Use kasprintf() instead of fixed buffer formatting Improve readability and maintainability by replacing a hardcoded string allocation and formatting by the use of the kasprintf() helper. Signed-off-by: Andy Shevchenko Reviewed-by: Dipen Patel Signed-off-by: Dipen Patel commit b7c3ca3553d1de5e86c85636828e186d30cd0628 Author: Harshit Mogalapalli Date: Thu Oct 26 00:53:28 2023 -0700 hte: tegra: Fix missing error code in tegra_hte_test_probe() The value of 'ret' is zero when of_hte_req_count() fails to get number of entitties to timestamp. And returning success(zero) on this failure path is incorrect. Fixes: 9a75a7cd03c9 ("hte: Add Tegra HTE test driver") Signed-off-by: Harshit Mogalapalli Reviewed-by: Dipen Patel Signed-off-by: Dipen Patel commit fad505b2cb838fb52cb72fa22830824c80330f2f Author: Mingwei Zhang Date: Mon Oct 2 04:08:39 2023 +0000 KVM: x86: Service NMI requests after PMI requests in VM-Enter path Service NMI and SMI requests after PMI requests in vcpu_enter_guest() so that KVM does not need to cancel and redo the VM-Enter if the guest configures its PMIs to be delivered as NMIs (likely) or SMIs (unlikely). Because APIC emulation "injects" NMIs via KVM_REQ_NMI, handling PMI requests after NMI requests (the likely case) means KVM won't detect the pending NMI request until the final check for outstanding requests. Detecting requests at the final stage is costly as KVM has already loaded guest state, potentially queued events for injection, disabled IRQs, dropped SRCU, etc., most of which needs to be unwound. Note that changing the order of request processing doesn't change the end result, as KVM's final check for outstanding requests prevents entering the guest until all requests are serviced. I.e. KVM will ultimately coalesce events (or not) regardless of the ordering. Using SPEC2017 benchmark programs running along with Intel vtune in a VM demonstrates that the following code change reduces 800~1500 canceled VM-Enters per second. Some glory details: Probe the invocation to vmx_cancel_injection(): $ perf probe -a vmx_cancel_injection $ perf stat -a -e probe:vmx_cancel_injection -I 10000 # per 10 seconds Partial results when SPEC2017 with Intel vtune are running in the VM: On kernel without the change: 10.010018010 14254 probe:vmx_cancel_injection 20.037646388 15207 probe:vmx_cancel_injection 30.078739816 15261 probe:vmx_cancel_injection 40.114033258 15085 probe:vmx_cancel_injection 50.149297460 15112 probe:vmx_cancel_injection 60.185103088 15104 probe:vmx_cancel_injection On kernel with the change: 10.003595390 40 probe:vmx_cancel_injection 20.017855682 31 probe:vmx_cancel_injection 30.028355883 34 probe:vmx_cancel_injection 40.038686298 31 probe:vmx_cancel_injection 50.048795162 20 probe:vmx_cancel_injection 60.069057747 19 probe:vmx_cancel_injection Suggested-by: Sean Christopherson Signed-off-by: Mingwei Zhang Link: https://lore.kernel.org/r/20231002040839.2630027-1-mizhang@google.com [sean: hoist PMU/PMI above SMI too, massage changelog] Signed-off-by: Sean Christopherson commit 0262a8a079896440fab98844124a951d85b63166 Merge: bd0f7498bc908 d933333694a7e Author: Mark Brown Date: Fri Oct 27 21:07:18 2023 +0100 ASoC: Intel: avs: Add support for rt5514 codec Merge series from Amadeusz Sławiński : There are machines which use codec rt5514 as DMIC, add support for them. commit 8f61d48c83f6e3525a770e44692604595693f787 Author: Vishal Verma Date: Thu Oct 26 11:32:41 2023 -0600 tools/testing/cxl: Slow down the mock firmware transfer The cxl-cli unit test for firmware update does operations like starting an asynchronous firmware update, making sure it is in progress, and attempting to cancel it. In some cases, such as with no or minimal dynamic debugging turned on, the firmware update completes too quickly, not allowing the test to have a chance to verify it was in progress. This caused a failure of the signature: expected fw_update_in_progress:true test/cxl-update-firmware.sh: failed at line 88 Fix this by adding a delay (~1.5 - 2 ms) to each firmware transfer request handled by the mocked interface. Reported-by: Dan Williams Tested-by: Dan Williams Signed-off-by: Vishal Verma Link: https://lore.kernel.org/r/20231026-vv-fw_upd_test_fix-v2-1-5282fd193883@intel.com Signed-off-by: Dan Williams commit 98a04c7aced2b43b3ac4befe216c4eecc7257d4b Author: Jim Harris Date: Thu Oct 26 10:09:06 2023 -0700 cxl/region: Fix x1 root-decoder granularity calculations Root decoder granularity must match value from CFWMS, which may not be the region's granularity for non-interleaved root decoders. So when calculating granularities for host bridge decoders, use the region's granularity instead of the root decoder's granularity to ensure the correct granularities are set for the host bridge decoders and any downstream switch decoders. Test configuration is 1 host bridge * 2 switches * 2 endpoints per switch. Region created with 2048 granularity using following command line: cxl create-region -m -d decoder0.0 -w 4 mem0 mem2 mem1 mem3 \ -g 2048 -s 2048M Use "cxl list -PDE | grep granularity" to get a view of the granularity set at each level of the topology. Before this patch: "interleave_granularity":2048, "interleave_granularity":2048, "interleave_granularity":512, "interleave_granularity":2048, "interleave_granularity":2048, "interleave_granularity":512, "interleave_granularity":256, After: "interleave_granularity":2048, "interleave_granularity":2048, "interleave_granularity":4096, "interleave_granularity":2048, "interleave_granularity":2048, "interleave_granularity":4096, "interleave_granularity":2048, Fixes: 27b3f8d13830 ("cxl/region: Program target lists") Cc: Signed-off-by: Jim Harris Link: https://lore.kernel.org/r/169824893473.1403938.16110924262989774582.stgit@bgt-140510-bm03.eng.stellus.in [djbw: fixup the prebuilt cxl_test region] Signed-off-by: Dan Williams commit 3531b27f1f04a6bc9c95cf00d40efe618d57aa93 Author: Li Zhijian Date: Wed Oct 25 16:54:50 2023 +0800 cxl/region: Fix cxl_region_rwsem lock held when returning to user space Fix a missed "goto out" to unlock on error to cleanup this splat: WARNING: lock held when returning to user space! 6.6.0-rc3-lizhijian+ #213 Not tainted ------------------------------------------------ cxl/673 is leaving the kernel with locks still held! 1 lock held by cxl/673: #0: ffffffffa013b9d0 (cxl_region_rwsem){++++}-{3:3}, at: commit_store+0x7d/0x3e0 [cxl_core] In terms of user visible impact of this bug for backports: cxl_region_invalidate_memregion() on x86 invokes wbinvd which is a problematic instruction for virtualized environments. So, on virtualized x86, cxl_region_invalidate_memregion() returns an error. This failure case got missed because CXL memory-expander device passthrough is not a production use case, and emulation of CXL devices is typically limited to kernel development builds with CONFIG_CXL_REGION_INVALIDATION_TEST=y, that makes cxl_region_invalidate_memregion() succeed. In other words, the expected exposure of this bug is limited to CXL subsystem development environments using QEMU that neglected CONFIG_CXL_REGION_INVALIDATION_TEST=y. Fixes: d1257d098a5a ("cxl/region: Move cache invalidation before region teardown, and before setup") Signed-off-by: Li Zhijian Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20231025085450.2514906-1-lizhijian@fujitsu.com Signed-off-by: Dan Williams commit 0cf36a85c1408f86a967fb1db721de1b89b9e675 Author: Alison Schofield Date: Wed Oct 25 13:01:34 2023 -0700 cxl/region: Use cxl_calc_interleave_pos() for auto-discovery For auto-discovered regions the driver must assign each target to a valid position in the region interleave set based on the decoder topology. The current implementation fails to parse valid decode topologies, as it does not consider the child offset into a parent port. The sort put all targets of one port ahead of another port when an interleave was expected, causing the region assembly to fail. Replace the existing relative sort with cxl_calc_interleave_pos() that finds the exact position in a region interleave for an endpoint based on a walk up the ancestral tree from endpoint to root decoder. cxl_calc_interleave_pos() was introduced in a prior patch, so the work here is to use it in cxl_region_sort_targets(). Remove the obsoleted helper functions from the prior sort. Testing passes on pre-production hardware with BIOS defined regions that natively trigger this autodiscovery path of the region driver. Testing passes a CXL unit test using the dev_dbg() calculation test (see cxl_region_attach()) across an expanded set of region configs: 1, 1, 1+1, 1+1+1, 2, 2+2, 2+2+2, 2+2+2+2, 4, 4+4, where each number represents the count of endpoints per host bridge. Fixes: a32320b71f08 ("cxl/region: Add region autodiscovery") Reported-by: Dmytro Adamenko Signed-off-by: Alison Schofield Reviewed-by: Dave Jiang Reviewed-by: Jim Harris Link: https://lore.kernel.org/r/3946cc55ddc19678733eddc9de2c317749f43f3b.1698263080.git.alison.schofield@intel.com Signed-off-by: Dan Williams commit a3e00c964fb943934af916f48f0dd43b5110c866 Author: Alison Schofield Date: Fri Oct 27 13:04:48 2023 -0700 cxl/region: Calculate a target position in a region interleave Introduce a calculation to find a target's position in a region interleave. Perform a self-test of the calculation on user-defined regions. The region driver uses the kernel sort() function to put region targets in relative order. Positions are assigned based on each target's index in that sorted list. That relative sort doesn't consider the offset of a port into its parent port which causes some auto-discovered regions to fail creation. In one failure case, a 2 + 2 config (2 host bridges each with 2 endpoints), the sort puts all the targets of one port ahead of another port when they were expected to be interleaved. In preparation for repairing the autodiscovery region assembly, introduce a new method for discovering a target position in the region interleave. cxl_calc_interleave_pos() adds a method to find the target position by ascending from an endpoint to a root decoder. The calculation starts with the endpoint's local position and position in the parent port. It traverses towards the root decoder and examines both position and ways in order to allow the position to be refined all the way to the root decoder. This calculation: position = position * parent_ways + parent_pos; applied iteratively yields the correct position. Include a self-test that exercises this new position calculation against every successfully configured user-defined region. Signed-off-by: Alison Schofield Link: https://lore.kernel.org/r/0ac32c75cf81dd8b86bf07d70ff139d33c2300bc.1698263080.git.alison.schofield@intel.com Signed-off-by: Dan Williams commit 0dea4e30fedad73ce3223b4d3d546fafc1aa77a6 Merge: 0bb80ecc33a8f e0e6373d653b7 Author: Stephen Boyd Date: Fri Oct 27 12:21:17 2023 -0700 Merge tag 'qcom-clk-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into clk-qcom Pull Qualcomm clk driver updates from Bjorn Andersson: - Initial support for the SM4450 Global Clock Controller and RPMh clock controllers - Drop CLK_SET_RATE_PARENT for clocks with fixed-rate GPLLs across a variety of IPQ platforms - Add missing parent of APCS PLL on IPQ6018 - Add I2C QUP6 clk on IPQ6018 but mark it critical to avoid problems with RPM - Implement safe source switching for a53pll and use on IPQ5332 - Add support for Stromer Plus PLLs - Switch SM8550 Video and GPU clock controllers to use OLE PLL configure method - Non critical fixes to halt bit checks - Add SMMU GDSC for MSM8998 - Fix possible integer overflow in RCG frequency calculation code - Remove RPM managed clks from MSM8996 GCC driver - Add Camera Clock Controller on SM8550 - Add HFPLL configuration for the three HFPLLs in MSM8976 - Switch MSM8996 CBF clock driver's remove function to return void * tag 'qcom-clk-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (36 commits) clk: qcom: apss-ipq6018: add the GPLL0 clock also as clock provider clk: qcom: ipq5332: drop the CLK_SET_RATE_PARENT flag from GPLL clocks clk: qcom: ipq9574: drop the CLK_SET_RATE_PARENT flag from GPLL clocks clk: qcom: ipq5018: drop the CLK_SET_RATE_PARENT flag from GPLL clocks clk: qcom: ipq6018: drop the CLK_SET_RATE_PARENT flag from PLL clocks clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks clk: qcom: gcc-ipq6018: add QUP6 I2C clock clk: qcom: apss-ipq6018: ipq5332: add safe source switch for a53pll clk: qcom: apss-ipq-pll: Fix 'l' value for ipq5332_pll_config clk: qcom: apss-ipq-pll: Use stromer plus ops for stromer plus pll clk: qcom: clk-alpha-pll: introduce stromer plus ops clk: qcom: config IPQ_APSS_6018 should depend on QCOM_SMEM clk: qcom: videocc-sm8550: switch to clk_lucid_ole_pll_configure clk: qcom: gpucc-sm8550: switch to clk_lucid_ole_pll_configure clk: qcom: Replace of_device.h with explicit includes clk: qcom: smd-rpm: Move CPUSS_GNoC clock to interconnect clk: qcom: cbf-msm8996: Convert to platform remove callback returning void clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src clk: qcom: Add GCC driver support for SM4450 dt-bindings: clock: qcom: Add GCC clocks for SM4450 ... commit 7e52b1164a474dc7b90f68fbb40e35ccd7f7e2e2 Author: Marek Vasut Date: Fri Oct 27 10:58:24 2023 +0200 clk: si521xx: Increase stack based print buffer size in probe Increase the size of temporary print buffer on stack to fix the following warnings reported by LKP. Since all the input parameters of snprintf() are under control of this driver, it is not possible to trigger and overflow here, but since the print buffer is on stack and discarded once driver probe() finishes, it is not an issue to increase it by 10 bytes and fix the warning in the process. Make it so. " drivers/clk/clk-si521xx.c: In function 'si521xx_probe': >> drivers/clk/clk-si521xx.c:318:26: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=] snprintf(name, 6, "DIFF%d", i); ^~ drivers/clk/clk-si521xx.c:318:21: note: directive argument in the range [0, 2147483647] snprintf(name, 6, "DIFF%d", i); ^~~~~~~~ drivers/clk/clk-si521xx.c:318:3: note: 'snprintf' output between 6 and 15 bytes into a destination of size 6 snprintf(name, 6, "DIFF%d", i); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " Fixes: edc12763a3a2 ("clk: si521xx: Clock driver for Skyworks Si521xx I2C PCIe clock generators") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310260412.AGASjFN4-lkp@intel.com/ Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20231027085840.30098-1-marex@denx.de Signed-off-by: Stephen Boyd commit dd3dd9829bf9a4ecd55482050745efdd9f7f97fc Author: Umio Yasuno Date: Thu Oct 26 22:05:57 2023 +0000 drm/amdgpu: Remove unused variables from amdgpu_show_fdinfo Remove unused variables from amdgpu_show_fdinfo Reviewed-by: Christian König Signed-off-by: Umio Yasuno Signed-off-by: Alex Deucher commit e8e696c307c36ef2d5addb65fc3ba42d54ca2dbb Author: Rob Clark Date: Thu Oct 26 22:05:49 2023 +0000 drm/amdgpu: Remove duplicate fdinfo fields Some of the fields that are handled by drm_show_fdinfo() crept back in when rebasing the patch. Remove them again. Fixes: 376c25f8ca47 ("drm/amdgpu: Switch to fdinfo helper") Reviewed-by: Christian König Signed-off-by: Rob Clark Reviewed-by: Co-developed-by: Umio Yasuno Signed-off-by: Umio Yasuno Signed-off-by: Alex Deucher commit f4febfdbb45ad2322a508d3d650b3af7c8286cb2 Merge: 8ceea12d183cf c28ca80ba3b53 Author: Thomas Gleixner Date: Fri Oct 27 20:18:34 2023 +0200 Merge tag 'timers-v6.7-rc1' of https://git.linaro.org/people/daniel.lezcano/linux into timers/core Pull timer driver updates from Daniel Lezcano: - Fix DT bindings typos, readability and wrong information about underflow and overflow interrupts for the RZ/G2L MTU3a driver (Biju Das) - Fix a memory leak in the error path when probing the i.MX GPT timer (Jacky Bai) - Don't use clk_get_rate() in atomic context as the function might sleep. Store the clock and use notifiers to receive a clocke rate change notification (Ivaylo Dimitrov) - Remove superfluous error message when platform_get_irq() fails because the underlying function already prints one (Yang Li) - Add wakeup capability flag for the risc-V ACPI timer (Sunil V L) - Fix initialization of the TCB timers which are in cascade as the second timer is reset after the first wraps up leading to inconsistent scheduler behavior (Ronald Wahl) - Add DT bindings and driver for Cirrus Logic EP93xx (Nikita Shubin) commit 3ea8dd3758ba551f0e3999faefd5b0bb80cbf2f1 Author: Kenneth Feng Date: Tue Oct 24 11:20:27 2023 +0800 drm/amd/amdgpu: avoid to disable gfxhub interrupt when driver is unloaded avoid to disable gfxhub interrupt when driver is unloaded on gmc 11 Signed-off-by: Kenneth Feng Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 142262a1c02ad4d334ca1152dc4a0f6db3ef3bfc Author: David Francis Date: Thu Oct 12 10:35:20 2023 -0400 drm/amdgpu: Add EXT_COHERENT support for APU and NUMA systems On gfx943 APU, EXT_COHERENT should give MTYPE_CC for local and MTYPE_UC for nonlocal memory. On NUMA systems, local memory gets the local mtype, set by an override callback. If EXT_COHERENT is set, memory will be set as MTYPE_UC by default, with local memory MTYPE_CC. Add an option in the override function for this case, and add a check to ensure it is not used on UNCACHED memory. V2: Combined APU and NUMA code into one patch V3: Fixed a potential nullptr in amdgpu_vm_bo_update Signed-off-by: David Francis Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a395f7ffcebe59477d80f049889cb652d80db040 Author: Candice Li Date: Thu Oct 26 12:28:15 2023 +0800 drm/amdgpu: Retrieve CE count from ce_count_lo_chip in EccInfo table Retrieve correctable error count from ce_count_lo_chip instead of mca_umc_status. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d59fcfb0848b49d5efc62079d3aad4bbaf760aa1 Author: Candice Li Date: Wed Oct 25 17:27:16 2023 +0800 drm/amdgpu: Identify data parity error corrected in replay mode Use ErrorCodeExt field to identify data parity error in replay mode. Signed-off-by: Candice Li Reviewed-by: Tao Zhou Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit f7a17b2b36043a4cc9e2d0b0eea7647133f78b13 Author: Mukul Joshi Date: Thu Oct 26 13:52:23 2023 -0400 drm/amdgpu: Fix typo in IP discovery parsing Fix a typo in parsing of the GC info table header when reading the IP discovery table. Fixes: 0e64c9aad031 ("drm/amdgpu: add type conversion for gc info") Signed-off-by: Mukul Joshi Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 1efdd37cc015ed1cade8c1c12227ad25ebb17c77 Author: Hamza Mahfooz Date: Thu Oct 26 11:50:45 2023 -0400 drm/amd/display: fix S/G display enablement An assignment statement was reversed during a refactor which effectively disabled S/G display outright. Since, we use adev->mode_info.gpu_vm_support to indicate to the rest of the driver that S/G display should be enabled and currently it is always set to false. So, to fix this set adev->mode_info.gpu_vm_support's value to that of init_data.flags.gpu_vm_support (and not vice versa). Fixes: 098c13079c6f ("drm/amd/display: enable S/G display for for recent APUs by default") Reported-by: Mark Broadworth Tested-by: Mark Broadworth Acked-by: Alex Deucher Reviewed-by: Harry Wentland Reviewed-by: Yifan Zhang Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 565fe150624ee77dc63a735cc1b3bff5101f38a3 Author: Linus Walleij Date: Fri Oct 20 22:30:29 2023 +0200 mtd: cfi_cmdset_0001: Byte swap OTP info Currently the offset into the device when looking for OTP bits can go outside of the address of the MTD NOR devices, and if that memory isn't readable, bad things happen on the IXP4xx (added prints that illustrate the problem before the crash): cfi_intelext_otp_walk walk OTP on chip 0 start at reg_prot_offset 0x00000100 ixp4xx_copy_from copy from 0x00000100 to 0xc880dd78 cfi_intelext_otp_walk walk OTP on chip 0 start at reg_prot_offset 0x12000000 ixp4xx_copy_from copy from 0x12000000 to 0xc880dd78 8<--- cut here --- Unable to handle kernel paging request at virtual address db000000 [db000000] *pgd=00000000 (...) This happens in this case because the IXP4xx is big endian and the 32- and 16-bit fields in the struct cfi_intelext_otpinfo are not properly byteswapped. Compare to how the code in read_pri_intelext() byteswaps the fields in struct cfi_pri_intelext. Adding a small byte swapping loop for the OTP in read_pri_intelext() and the crash goes away. The problem went unnoticed for many years until I enabled CONFIG_MTD_OTP on the IXP4xx as well, triggering the bug. Cc: stable@vger.kernel.org Reviewed-by: Nicolas Pitre Signed-off-by: Linus Walleij Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20231020-mtd-otp-byteswap-v4-1-0d132c06aa9d@linaro.org commit 5a985960a4dd041c21dbe9956958c1633d2da706 Author: Yi Yang Date: Thu Oct 19 06:55:48 2023 +0000 mtd: rawnand: meson: check return value of devm_kasprintf() devm_kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Ensure the allocation was successful by checking the pointer validity. Fixes: 1e4d3ba66888 ("mtd: rawnand: meson: fix the clock") Signed-off-by: Yi Yang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20231019065548.318443-1-yiyang13@huawei.com commit 74ac5b5e2375f1e8ef797ac7770887e9969f2516 Author: Yi Yang Date: Thu Oct 19 06:55:37 2023 +0000 mtd: rawnand: intel: check return value of devm_kasprintf() devm_kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Ensure the allocation was successful by checking the pointer validity. Fixes: 0b1039f016e8 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC") Signed-off-by: Yi Yang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20231019065537.318391-1-yiyang13@huawei.com commit 60ec53ace2cb8a6f5678af1ea614f8582e32c081 Author: Uwe Kleine-König Date: Mon Oct 16 12:35:41 2023 +0200 mtd: rawnand: sh_flctl: Convert to module_platform_driver() The driver doesn't benefit from the advantages that module_platform_driver_probe() allows (i.e. putting the probe function in .init.text and the .remove function into .exit.text). So use module_platform_driver() instead which allows to bind the driver also after booting (or module loading) and unbinding via sysfs. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20231016103540.1566865-2-u.kleine-koenig@pengutronix.de commit 8388cba9d1eb5c54385ea624d2979983f356a596 Author: Mike Snitzer Date: Thu Oct 26 13:02:31 2023 -0400 MAINTAINERS: add Mikulas Patocka as a DM maintainer Mikulas is a long-time contributor to the DM subsystem and has effectively been a shadow DM maintainer. It is time to formally name Mikulas as a DM maintainer. In practice this doesn't imply any process changes for DM maintenance (Mikulas can still just feed changes and contribute review like normal). This change does allow the possibility for Mikulas to take on more responsibility in actually sending DM changes upstream. Signed-off-by: Mike Snitzer commit 6f25dd1c57b8ba92d899eae4eda16573a2f78ffc Author: Mike Snitzer Date: Wed Oct 25 19:29:03 2023 -0400 dm: respect REQ_NOWAIT flag in normal bios issued to DM Update DM core's normal IO submission to allocate required memory using GFP_NOWAIT if REQ_NOWAIT is set. Tested with simple test provided in commit a9ce385344f916 ("dm: don't attempt to queue IO under RCU protection") that was enhanced to check error codes. Also tested using fio's pvsync2 with nowait=1. But testing with induced GFP_NOWAIT allocation failures wasn't performed (yet). Signed-off-by: Mike Snitzer commit 4a2fe2960891f1ccd7805d0973284fd44c2f12b4 Author: Mike Snitzer Date: Fri Oct 27 11:29:36 2023 -0400 dm: enhance alloc_multiple_bios() to be more versatile alloc_multiple_bios() has the useful ability to try allocating bios with GFP_NOWAIT but will fallback to using GFP_NOIO. The callers service both empty flush bios and abnormal bios (e.g. discard). alloc_multiple_bios() enhancements offered in this commit: - don't require table_devices_lock if num_bios = 1 - allow caller to pass GFP_NOWAIT to do usual GFP_NOWAIT with GFP_NOIO fallback - allow caller to pass GFP_NOIO to _only_ allocate using GFP_NOIO Flush bios with data may be issued to DM with REQ_NOWAIT, as such it makes sense to attempt servicing them with GFP_NOWAIT allocations. But abnormal IO should never be issued using REQ_NOWAIT (if that changes in the future that's fine, but no sense supporting it now). While at it, rename __send_changing_extent_only() to __send_abnormal_io(). [Thanks to both Ming and Mikulas for help with translating known possible IO scenarios to requirements.] Suggested-by: Ming Lei Suggested-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 805ce81826c896dd3c351a32814b28557f9edf54 Author: Srinivas Kandagatla Date: Fri Oct 27 11:57:47 2023 +0100 ASoC: codecs: wsa883x: make use of new mute_unmute_on_trigger flag In the current setup the PA is left unmuted even when the Soundwire ports are not started streaming. This can lead to click and pop sounds during start. There is a same issue in the reverse order where in the PA is left unmute even after the data stream is stopped, the time between data stream stopping and port closing is long enough to accumulate DC on the line resulting in Click/Pop noise during end of stream. making use of new mute_unmute_on_trigger flag is helping a lot with this Click/Pop issues reported on this Codec Signed-off-by: Srinivas Kandagatla Tested-by: Johan Hovold Link: https://lore.kernel.org/r/20231027105747.32450-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit f0220575e65abe09c09cd17826a3cdea76e8d58f Author: Srinivas Kandagatla Date: Fri Oct 27 11:57:46 2023 +0100 ASoC: soc-dai: add flag to mute and unmute stream during trigger In some setups like Speaker amps which are very sensitive, ex: keeping them unmute without actual data stream for very short duration results in a static charge and results in pop and clicks. To minimize this, provide a way to mute and unmute such codecs during trigger callbacks. Signed-off-by: Srinivas Kandagatla Tested-by: Johan Hovold Link: https://lore.kernel.org/r/20231027105747.32450-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 804bf07a1f726d4fe391d21b24a68ffc2381ba89 Author: Naresh Solanki Date: Fri Oct 27 15:28:29 2023 +0000 regulator (max5970): Remove duplicate line Remove redundant/duplicate line. Signed-off-by: Naresh Solanki Link: https://lore.kernel.org/r/20231027152830.1269895-2-naresh.solanki@9elements.com Signed-off-by: Mark Brown commit f5afdd13ed6c643c7243e685fe3cf5484b3fdfae Author: Naresh Solanki Date: Fri Oct 27 15:28:28 2023 +0000 regulator (max5970): Add hwmon support Utilize the integrated 10-bit ADC in Max5970/Max5978 to enable voltage and current monitoring. This feature is seamlessly integrated through the hwmon subsystem. Signed-off-by: Naresh Solanki Acked-by: Guenter Roeck Link: https://lore.kernel.org/r/20231027152830.1269895-1-naresh.solanki@9elements.com Signed-off-by: Mark Brown commit bd0f7498bc9084d8cccc5484cd004b40f314b763 Author: Kuninori Morimoto Date: Fri Oct 27 00:09:56 2023 +0000 ASoC: ams-delta.c: use component after check static void cx81801_close() { ... (A) struct snd_soc_dapm_context *dapm = &component->card->dapm; ... (B) if (!component) return; } (A) uses component before NULL check (B). This patch moves it after (B). Fixes: d0fdfe34080c ("ASoC: cx20442: replace codec to component") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/3e608474-e99a-4866-ae98-3054a4221f09@moroto.mountain Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87ttqdq623.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit a65cdffbef7bfdb9f55a3acb07ccf18d4f97b3a5 Author: Arnd Bergmann Date: Fri Oct 27 17:23:54 2023 +0200 ASoC: amd: acp: select SND_SOC_AMD_ACP_LEGACY_COMMON for ACP63 Without this dependency, acp63 fails to link: x86_64-linux-ld: sound/soc/amd/acp/acp63.o: in function `acp63_audio_remove': acp63.c:(.text+0x22): undefined reference to `acp_disable_interrupts' x86_64-linux-ld: sound/soc/amd/acp/acp63.o: in function `acp63_i2s_master_clock_generate.isra.0': acp63.c:(.text+0x6f): undefined reference to `smn_read' x86_64-linux-ld: acp63.c:(.text+0x81): undefined reference to `smn_write' x86_64-linux-ld: acp63.c:(.text+0x8e): undefined reference to `smn_read' x86_64-linux-ld: sound/soc/amd/acp/acp63.o: in function `acp63_pcm_resume': acp63.c:(.text+0x230): undefined reference to `restore_acp_i2s_params' x86_64-linux-ld: acp63.c:(.text+0x23d): undefined reference to `restore_acp_pdm_params' x86_64-linux-ld: sound/soc/amd/acp/acp63.o: in function `acp63_audio_probe': acp63.c:(.text+0x474): undefined reference to `acp_enable_interrupts' Fixes: d4c2d5391d7e ("ASoC: amd: acp: add Kconfig options for acp6.3 based platform driver") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231027152403.386257-3-arnd@kernel.org Signed-off-by: Mark Brown commit cf046ecbcd1cd0ef1d762b3365b9918175e121ab Author: Arnd Bergmann Date: Fri Oct 27 17:23:53 2023 +0200 ASoC: codecs: aw88399: fix typo in Kconfig select The aw88395_lib module is shared by all the aw883* drivers that need to select the corresponding Kconfig symbol. The newly added aw88399 incorrectly selects SND_SOC_AW88399_LIB instead, which is not defined anywhere in the kernel, causing a link failure when the actual one is missing: arm-linux-gnueabi-ld: sound/soc/codecs/aw88399.o: in function `aw88399_codec_probe': aw88399.c:(.text+0xbc6): undefined reference to `aw88395_dev_load_acf_check' arm-linux-gnueabi-ld: aw88399.c:(.text+0xbea): undefined reference to `aw88395_dev_cfg_load' Fixes: 8ade6cc7e261 ("ASoC: codecs: Add aw88399 amplifier driver") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231027152403.386257-2-arnd@kernel.org Signed-off-by: Mark Brown commit 0b38362018c79bc6cf9d8ba4ee9a2a3827ba6328 Author: Arnd Bergmann Date: Fri Oct 27 17:23:52 2023 +0200 ASoC: amd: acp: add ACPI dependency A newly added function requires CONFIG_ACPI to avoid a build error: sound/soc/amd/acp/acp-legacy-common.c: In function 'check_acp_pdm': sound/soc/amd/acp/acp-legacy-common.c:401:19: error: implicit declaration of function 'acpi_find_child_device'; did you mean 'acpi_match_device'? [-Werror=implicit-function-declaration] 401 | pdm_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), pdm_addr, 0); | ^~~~~~~~~~~~~~~~~~~~~~ | acpi_match_device The acp drivers really only work when ACPI is enabled already, so just avoid the build failure with hard dependency in everything that enables the acp-legacy-common portion. Fixes: 3a94c8ad0aae ("ASoC: amd: acp: add code for scanning acp pdm controller") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231027152403.386257-1-arnd@kernel.org Signed-off-by: Mark Brown commit d933333694a7e63b0893d23f65b104430a1d6cf6 Author: Amadeusz Sławiński Date: Fri Oct 27 13:05:37 2023 +0200 ASoC: Intel: avs: Add rt5514 machine board In order to support Eve chromebooks add rt5514 configuration to board lookup table. rt5514 is used for capture in DMIC configuration on SSP 0 and TDM 1. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231027110537.2103712-3-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 8b78fbf7bffac4f7b1b747fbce45ac32f530c96e Author: Amadeusz Sławiński Date: Fri Oct 27 13:05:36 2023 +0200 ASoC: Intel: avs: Add rt5514 machine board To support AVS-rt5514 configuration add machine board connecting AVS platform component driver with rt5514 codec one. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231027110537.2103712-2-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 3a04927f8d4b7a4f008f04af41e31173002eb1ea Author: Kuniyuki Iwashima Date: Thu Oct 26 14:23:05 2023 -0700 af_unix: Remove module remnants. Since commit 97154bcf4d1b ("af_unix: Kconfig: make CONFIG_UNIX bool"), af_unix.c is no longer built as module. Let's remove unnecessary #if condition, exitcall, and module macros. Signed-off-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20231026212305.45545-1-kuniyu@amazon.com Signed-off-by: Jakub Kicinski commit f12f8f84509a084399444c4422661345a15cc713 Author: Mickaël Salaün Date: Fri Oct 27 17:46:15 2023 +0200 selftests/landlock: Add tests for FS topology changes with network rules Add 2 tests to the layout1 fixture: * topology_changes_with_net_only: Checks that FS topology changes are not denied by network-only restrictions. * topology_changes_with_net_and_fs: Make sure that FS topology changes are still denied with FS and network restrictions. This specifically test commit d7220364039f ("landlock: Allow FS topology changes for domains without such rule type"). Cc: Konstantin Meskhidze Link: https://lore.kernel.org/r/20231027154615.815134-1-mic@digikod.net Signed-off-by: Mickaël Salaün commit 14da0d2570eb08e9ab9d2162ddb6f70127e4491c Merge: 79fa29570bd34 629b35a225b0d Author: Jakub Kicinski Date: Fri Oct 27 08:47:30 2023 -0700 Merge branch 'mptcp-fixes-and-cleanup-for-v6-7' Mat Martineau says: ==================== mptcp: Fixes and cleanup for v6.7 This series includes three initial patches that we had queued in our mptcp-net branch, but given the likely timing of net/net-next syncs this week, the need to avoid introducing branch conflicts, and another batch of net-next patches pending in the mptcp tree, the most practical route is to send everything for net-next. Patches 1 & 2 fix some intermittent selftest failures by adjusting timing. Patch 3 removes an unneccessary userspace path manager restriction on the removal of subflows with subflow ID 0. The remainder of the patches are all cleanup or selftest changes: Patches 4-8 clean up kernel code by removing unused parameters, making more consistent use of existing helper functions, and reducing extra casting of socket pointers. Patch 9 removes an unused variable in a selftest script. Patch 10 adds a little more detail to some mptcp_join test output. ==================== Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org Signed-off-by: Jakub Kicinski commit 629b35a225b0d49fbcff3b5c22e3b983c7c7b36f Author: Geliang Tang Date: Wed Oct 25 16:37:11 2023 -0700 selftests: mptcp: display simult in extra_msg Just like displaying "invert" after "Info: ", "simult" should be displayed too when rm_subflow_nr doesn't match the expect value in chk_rm_nr(): syn [ ok ] synack [ ok ] ack [ ok ] add [ ok ] echo [ ok ] rm [ ok ] rmsf [ ok ] 3 in [2:4] Info: invert simult syn [ ok ] synack [ ok ] ack [ ok ] add [ ok ] echo [ ok ] rm [ ok ] rmsf [ ok ] Info: invert Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-10-db8f25f798eb@kernel.org Signed-off-by: Jakub Kicinski commit e71aab6777a4f906149d0b5f12507fad5e164b3b Author: Geliang Tang Date: Wed Oct 25 16:37:10 2023 -0700 selftests: mptcp: sockopt: drop mptcp_connect var Global var mptcp_connect defined at the front of mptcp_sockopt.sh is duplicate with local var mptcp_connect defined in do_transfer(), drop this useless global one. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-9-db8f25f798eb@kernel.org Signed-off-by: Jakub Kicinski commit 14cb0e0bf39bd10429ba14e9e2f905f1144226fc Author: Geliang Tang Date: Wed Oct 25 16:37:09 2023 -0700 mptcp: define more local variables sk '(struct sock *)msk' is used several times in mptcp_nl_cmd_announce(), mptcp_nl_cmd_remove() or mptcp_userspace_pm_set_flags() in pm_userspace.c, it's worth adding a local variable sk to point it. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-8-db8f25f798eb@kernel.org Signed-off-by: Jakub Kicinski commit a6c85fc61c088c7ef43ba81e80b48c263a80602a Author: Geliang Tang Date: Wed Oct 25 16:37:08 2023 -0700 mptcp: move sk assignment statement ahead If we move the sk assignment statement ahead in mptcp_nl_cmd_sf_create() or mptcp_nl_cmd_sf_destroy(), right after the msk null-check statements, sk can be used after the create_err or destroy_err labels instead of open-coding it again. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-7-db8f25f798eb@kernel.org Signed-off-by: Jakub Kicinski commit a16c054b527bbaed611fef03e8b19e111a1769ef Author: Geliang Tang Date: Wed Oct 25 16:37:07 2023 -0700 mptcp: use mptcp_get_ext helper Use mptcp_get_ext() helper defined in protocol.h instead of open-coding it in mptcp_sendmsg_frag(). Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-6-db8f25f798eb@kernel.org Signed-off-by: Jakub Kicinski commit 83d580ddbe1b3297c346b24070c23fcf6698393c Author: Geliang Tang Date: Wed Oct 25 16:37:06 2023 -0700 mptcp: use mptcp_check_fallback helper Use __mptcp_check_fallback() helper defined in net/mptcp/protocol.h, instead of open-coding it in both __mptcp_do_fallback() and mptcp_diag_fill_info(). Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-5-db8f25f798eb@kernel.org Signed-off-by: Jakub Kicinski commit 74cbb0c65b2963c1f1b51e2426cf0774ed828bc0 Author: Geliang Tang Date: Wed Oct 25 16:37:05 2023 -0700 mptcp: drop useless ssk in pm_subflow_check_next The code using 'ssk' parameter of mptcp_pm_subflow_check_next() has been dropped in commit "95d686517884 (mptcp: fix subflow accounting on close)". So drop this useless parameter ssk. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-4-db8f25f798eb@kernel.org Signed-off-by: Jakub Kicinski commit 84c531f54ad9a124a924c9505d74e33d16965146 Author: Geliang Tang Date: Wed Oct 25 16:37:04 2023 -0700 mptcp: userspace pm send RM_ADDR for ID 0 This patch adds the ability to send RM_ADDR for local ID 0. Check whether id 0 address is removed, if not, put id 0 into a removing list, pass it to mptcp_pm_remove_addr() to remove id 0 address. There is no reason not to allow the userspace to remove the initial address (ID 0). This special case was not taken into account not letting the userspace to delete all addresses as announced. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/379 Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-3-db8f25f798eb@kernel.org Signed-off-by: Jakub Kicinski commit 9168ea02b898d3dde98b51e4bd3fb082bd438dab Author: Geliang Tang Date: Wed Oct 25 16:37:03 2023 -0700 selftests: mptcp: fix wait_rm_addr/sf parameters The second input parameter of 'wait_rm_addr/sf $1 1' is misused. If it's 1, wait_rm_addr/sf will never break, and will loop ten times, then 'wait_rm_addr/sf' equals to 'sleep 1'. This delay time is too long, which can sometimes make the tests fail. A better way to use wait_rm_addr/sf is to use rm_addr/sf_count to obtain the current value, and then pass into wait_rm_addr/sf. Fixes: 4369c198e599 ("selftests: mptcp: test userspace pm out of transfer") Cc: stable@vger.kernel.org Suggested-by: Matthieu Baerts Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-2-db8f25f798eb@kernel.org Signed-off-by: Jakub Kicinski commit f4a75e9d11001481dca005541b6dc861e1472f03 Author: Geliang Tang Date: Wed Oct 25 16:37:02 2023 -0700 selftests: mptcp: run userspace pm tests slower Some userspace pm tests failed are reported by CI: 112 userspace pm add & remove address syn [ ok ] synack [ ok ] ack [ ok ] add [ ok ] echo [ ok ] mptcp_info subflows=1:1 [ ok ] subflows_total 2:2 [ ok ] mptcp_info add_addr_signal=1:1 [ ok ] rm [ ok ] rmsf [ ok ] Info: invert mptcp_info subflows=0:0 [ ok ] subflows_total 1:1 [fail] got subflows 0:0 expected 1:1 Server ns stats TcpPassiveOpens 2 0.0 TcpInSegs 118 0.0 This patch fixes them by changing 'speed' to 5 to run the tests much more slowly. Fixes: 4369c198e599 ("selftests: mptcp: test userspace pm out of transfer") Cc: stable@vger.kernel.org Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-1-db8f25f798eb@kernel.org Signed-off-by: Jakub Kicinski commit 216da5ebb83a13caece8032ee443acfd6a6083b6 Merge: 56185e0249525 f9010eb938beb Author: Arnd Bergmann Date: Fri Oct 27 17:28:10 2023 +0200 Merge tag 'ti-k3-config-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into soc/defconfig TI K3 defconfig updates Enable TPS6593 PMIC driver as module to support PMIC on AM62A SK board * tag 'ti-k3-config-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: arm64: defconfig: Enable TPS6593 PMIC for SK-AM62A Link: https://lore.kernel.org/r/9c820e96-21e4-451e-b0ab-a6400d68bdf7@ti.com Signed-off-by: Arnd Bergmann commit 79fa29570bd340d5cb6229f047f2b9127dbff32c Author: Jakub Kicinski Date: Wed Oct 25 19:29:16 2023 -0700 net: selftests: use ethtool_sprintf() During a W=1 build GCC 13.2 says: net/core/selftests.c: In function ‘net_selftest_get_strings’: net/core/selftests.c:404:52: error: ‘%s’ directive output may be truncated writing up to 279 bytes into a region of size 28 [-Werror=format-truncation=] 404 | snprintf(p, ETH_GSTRING_LEN, "%2d. %s", i + 1, | ^~ net/core/selftests.c:404:17: note: ‘snprintf’ output between 5 and 284 bytes into a destination of size 32 404 | snprintf(p, ETH_GSTRING_LEN, "%2d. %s", i + 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 405 | net_selftests[i].name); | ~~~~~~~~~~~~~~~~~~~~~~ avoid it by using ethtool_sprintf(). Reviewed-by: Oleksij Rempel Tested-by: Oleksij Rempel Link: https://lore.kernel.org/r/20231026022916.566661-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 62c11e461c7b669e8d42c0e49c8193a5e14d002a Author: Timothy Pearson Date: Thu Sep 14 17:39:47 2023 -0500 hwmon: (adt7475) Add support for Imon readout on ADT7490 Add support for the ADT7490's Imon voltage readout. It is handled largely the same way as the existing Vtt readout. Signed-off-by: Timothy Pearson Co-developed-by: Shawn Anastasio Signed-off-by: Shawn Anastasio Link: https://lore.kernel.org/r/20230914223947.829025-1-tpearson@raptorengineering.com Signed-off-by: Guenter Roeck commit 2232f10d714f2198d037b8047f482c09f7ad3b9a Author: Thomas Weißschuh Date: Mon Sep 11 07:44:42 2023 +0200 hwmon: (powerz) add support for ChargerLAB KM002C The KM002C is similar to the KM003C and seems to use the same protocol and firmware. Reported-by: Douglas Gilbert Closes: https://lore.kernel.org/lkml/290ebce4-54f0-8ac1-2a13-cbc806d80d64@interlog.com/ Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20230911-powerz-km002c-v1-1-898bd79b9bae@weissschuh.net Signed-off-by: Guenter Roeck commit 9ab6fe910b1a00b51e6f9396950092e658211474 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:51 2023 +0200 hwmon: (xgene-hwmon) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-25-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit bc70de33250e1b9b8ae6909140943fe251b81571 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:50 2023 +0200 hwmon: (w83781d) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-24-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit eaac830a7e736bf493e9096453d620d29f39c695 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:49 2023 +0200 hwmon: (w83627hf) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-23-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 5b4000065cde815dbe3475f24a1a7fe527a68d9b Author: Uwe Kleine-König Date: Mon Sep 18 10:59:48 2023 +0200 hwmon: (vt8231) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-22-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 6e4c7bafcd0cc7e221a6d06605f645616529fb2a Author: Uwe Kleine-König Date: Mon Sep 18 10:59:47 2023 +0200 hwmon: (vt1211) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-21-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 680a1b08096c97727819d5b257c85e5a8b46be04 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:46 2023 +0200 hwmon: (via686a) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-20-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 88ac8226a34fa82f82d8a12a8d99b2436a35e2ff Author: Uwe Kleine-König Date: Mon Sep 18 10:59:45 2023 +0200 hwmon: (via-cputemp) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-19-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit b875359995fad1ca20ed198e7969e2d1d308c202 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:44 2023 +0200 hwmon: (ultra45_env) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-18-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 39797753fdc208ea5771acbcf338a1649086afa9 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:43 2023 +0200 hwmon: (sis5595) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-17-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit a93a2c415486fbe9304543a943de789f0a89727a Author: Uwe Kleine-König Date: Mon Sep 18 10:59:42 2023 +0200 hwmon: (sht15) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-16-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit e44e19945ca10d9a260916b414d3345dfb671735 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:41 2023 +0200 hwmon: (sch5636) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-15-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit d29041681aa69c15dc0ac4688cb6e6f5b1a7d7f8 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:40 2023 +0200 hwmon: (pc87427) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-14-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit c45af5d2f3161910d86819741e64b9d801ae99ed Author: Uwe Kleine-König Date: Mon Sep 18 10:59:39 2023 +0200 hwmon: (pc87360) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-13-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit ade539199bdade09382a1fa2a8a5a68474507f61 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:38 2023 +0200 hwmon: (occ/p9_sbe) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-12-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 13af7eeeb6be5895c3ca9752c6ff8d719b2228c9 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:37 2023 +0200 hwmon: (mc13783-adc) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-11-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 19eae13a8980eb71e789e676ce94869b3b76ed50 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:36 2023 +0200 hwmon: (max197) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-10-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 62f5e95d409c20a946942f65455e17c9c59b75fd Author: Uwe Kleine-König Date: Mon Sep 18 10:59:35 2023 +0200 hwmon: (i5k_amb) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-9-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit a8f208d2a4c8fc20109d217d05490d23fcd1109f Author: Uwe Kleine-König Date: Mon Sep 18 10:59:34 2023 +0200 hwmon: (f71882fg) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-8-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit f79fe155cb7c326cf9ba58b5c4c289a994bd3e98 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:33 2023 +0200 hwmon: (f71805f) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-7-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 63d35e96e0c01cbdc5ecd76cb231b0678f5602fd Author: Uwe Kleine-König Date: Mon Sep 18 10:59:32 2023 +0200 hwmon: (dme1737) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-6-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit f5681a839c03a71c485228eb28430d58e7a5d3f7 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:31 2023 +0200 hwmon: (da9052-hwmon) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-5-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit f23e759737e643255e04ce5d52dfda0a466c8c95 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:30 2023 +0200 hwmon: (abituguru3) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918085951.1234172-4-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit 68d66551eb5ead02a826cd0c235f0f94f384ac09 Author: Uwe Kleine-König Date: Mon Sep 18 10:59:29 2023 +0200 hwmon: (abituguru) Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230918085951.1234172-3-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit a7dee82af86c190570b04f202b1ef04d29249a2f Author: Uwe Kleine-König Date: Mon Sep 18 10:59:28 2023 +0200 hwmon: (abitguru{,3}) Enable build testing on !X86 The two drivers compile fine on arm64, powerpc, m68k and s390. So make it possible to enable the drivers in the presence of COMPILE_TEST. Signed-off-by: Uwe Kleine-König Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230918085951.1234172-2-u.kleine-koenig@pengutronix.de Signed-off-by: Guenter Roeck commit e09b750526210775287c52d57b5ee2494847f5ed Author: Armin Wolf Date: Thu Sep 7 07:26:39 2023 +0200 hwmon: (sch5627) Document behaviour of limit registers The values of the limit registers affect the fan speed in a particular way. Document this behaviour so that future users can exploit it if required. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20230907052639.16491-6-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 10655bb6df25514e0ae8406637c3b4acbc812fe5 Author: Armin Wolf Date: Thu Sep 7 07:26:38 2023 +0200 hwmon: (sch5627) Add support for writing limit registers After some testing on a Fujitsu Esprimo P720, it turned out that the limit registers are indeed writable and affect the fan control algorithm. This is supported by the datasheet, which says that the fan control functions are based on the limit and parameter registers. Since accessing those registers is very inefficient, the existing regmap cache is used to cache those registers values. Tested on a Fujitsu Esprimo P720. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20230907052639.16491-5-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit a54fe61639d9f3b6765fee32edda7cfceb6d705a Author: Armin Wolf Date: Thu Sep 7 07:26:37 2023 +0200 hwmon: (sch5627) Use regmap for pwm map register caching Accessing virtual registers is very inefficient, so pwm map values should be cached when possible, else userspace could effectively do a DOS attack by reading pwm map values in a while loop. Use the regmap cache to cache those values. Tested on a Fujitsu Esprimo P720. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20230907052639.16491-4-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 7da8a635436029957c5350da3acf51d78ed64071 Author: Armin Wolf Date: Thu Sep 7 07:26:36 2023 +0200 hwmon: (sch5627) Disallow write access if virtual registers are locked When the lock bit inside SCH5627_REG_CTRL is set, then the virtual registers become read-only until the next power cycle. Disallow write access to those registers in such a case. Tested on a Fujitsu Esprimo P720. Fixes: aa9f833dfc12 ("hwmon: (sch5627) Add pwmX_auto_channels_temp support") Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20230907052639.16491-3-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 7f0b28e0653f36b51542d25dd54ed312c397ecfc Author: Armin Wolf Date: Thu Sep 7 07:26:35 2023 +0200 hwmon: (sch5627) Use bit macros when accessing the control register Use bit macros then accessing SCH5627_REG_CTRL, so that people do not need to look at the datasheet to find out what each bit does. Tested on a Fujitsu Esprimo P720. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20230907052639.16491-2-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 27887b06597bbfef8924985d1ed21db3ab01c417 Author: Biju Das Date: Thu Sep 7 08:14:04 2023 +0100 hwmon: tmp513: Simplify tmp51x_read_properties() Simplify tmp51x_read_properties() by replacing 'nfactor' ->'data->nfactor' in device_property_read_u32_array() and drop the local variable as it is unused. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230907071404.24334-3-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck commit fb99e07a9e396402f643a138c2aef4699671b44a Author: Biju Das Date: Thu Sep 7 08:14:03 2023 +0100 hwmon: tmp513: Add max_channels variable to struct tmp51x_data The tmp512 chip has 3 channels whereas tmp513 has 4 channels. Avoid using tmp51x_ids for this HW difference by replacing OF/ID table data with maximum channels supported by the device. Replace id->max_channels variable from struct tmp51x_data and drop the macros TMP51{2,3}_TEMP_CONFIG_DEFAULT as it can be derived from the macro TMP51X_TEMP_CONFIG_DEFAULT and update the logic in tmp51x_is_visible(), tmp51x_read_properties() and tmp51x_init() using max_channels. While at it, drop enum tmp51x_ids as there is no user and remove trailing comma in the terminator entry for OF table. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230907071404.24334-2-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck commit 923774d759c9f83d13b900bda9d146a918f65a45 Author: Patrick Rudolph Date: Thu Aug 31 21:07:29 2023 +0200 hwmon: (pmbus/tda38640) Add workaround for SVID mode TDA38640 can operate in either PMBus mode or SVID mode. In SVID mode, by design ENABLE pin is the only option for controlling the output rail i.e., ENABLE pin is chained to power good of another reglator & FPGA. In cases where the chip is configured for SVID mode, and the ENABLE pin is set at a fixed level or is left unconnected (with an internal pull-down), while requiring software control, the following workaround is necessary. The workaround utilizes ENABLE pin polarity flipping to control output rail. If property 'infineon,en-pin-fixed-level' is specified then determine if chip is in SVID mode by checking BIT15 of MTP memory offset 0x44 as described in the datasheet. If chip is in SVID mode then apply the workaround by 1. Determine EN pin level 2. Maps BIT7 of OPERATION(01h) to EN_PIN_POLARITY(BIT1) of PB_ON_OFF_CONFIG. Signed-off-by: Patrick Rudolph Signed-off-by: Naresh Solanki Link: https://lore.kernel.org/r/20230831190731.265099-3-Naresh.Solanki@9elements.com [groeck: Dropped unnecessary line continuation] Signed-off-by: Guenter Roeck commit 05010fcf58e818cf71e2b4df338d84916644b749 Author: Patrick Rudolph Date: Thu Aug 31 21:07:28 2023 +0200 hwmon: (pmbus) Add ON_OFF_CONFIG register bits Add bits found in the ON_OFF_CONFIG register. Signed-off-by: Patrick Rudolph Signed-off-by: Naresh Solanki Link: https://lore.kernel.org/r/20230831190731.265099-2-Naresh.Solanki@9elements.com Signed-off-by: Guenter Roeck commit 30eea19c67d546bde1fbbc61e434b3a446a313dc Author: Patrick Rudolph Date: Thu Aug 31 21:07:27 2023 +0200 dt-bindings: hwmon: Add Infineon TDA38640 Add the DT property 'infineon,en-pin-fixed-level' to indicated that the chip EN pin is at fixed level or left unconnected(has internal pull-down). Signed-off-by: Patrick Rudolph Signed-off-by: Naresh Solanki Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230831190731.265099-1-Naresh.Solanki@9elements.com [groeck: Dropped empty line at end] Signed-off-by: Guenter Roeck commit 4381a36abdf1c5c0323c1c51f869dc000115eb20 Author: Thomas Weißschuh Date: Sat Sep 2 09:47:01 2023 +0200 hwmon: add POWER-Z driver POWER-Z is a series of devices to monitor power characteristics of USB-C connections and display those on a on-device display. Some of the devices, notably KM002C and KM003C, contain an additional port which exposes the measurements via USB. This is a driver for this monitor port. It was developed and tested with the KM003C. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20230902-powerz-v4-1-7ec2c1440687@weissschuh.net [groeck: Release urb after hwmon registration error; Move priv->status initialization to correct place before reinit_completion ] Signed-off-by: Guenter Roeck commit 9da2901c47332b030ea4d2a2302bc7c0b83fc67c Author: Naresh Solanki Date: Fri Oct 27 10:33:52 2023 +0000 hwmon: (pmbus/mp2975) Move PGOOD fix The PGOOD fix was intended for MP2973 & MP2971 & not for MP2975. Fixes: acda945afb46 ("hwmon: (pmbus/mp2975) Fix PGOOD in READ_STATUS_WORD") Signed-off-by: Naresh Solanki Link: https://lore.kernel.org/r/20231027103352.918895-1-naresh.solanki@9elements.com Signed-off-by: Guenter Roeck commit 62cc9c3cb3ec1bf31cc116146185ed97b450836a Author: Jiri Kosina Date: Fri Oct 27 15:32:09 2023 +0200 HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W This device needs ALWAYS_POLL quirk, otherwise it keeps reconnecting indefinitely. Reported-by: Robert Ayrapetyan Signed-off-by: Jiri Kosina commit 94ace9eda88229c73698b8dd8d3c06dd0831319c Author: Ai Chao Date: Fri Oct 20 10:40:07 2023 +0800 platform/x86: inspur-platform-profile: Add platform profile support Add support for Inspur platforms to used the platform profile feature. This will allow users to determine and control the platform modes between low-power, balanced and performance modes. Signed-off-by: Ai Chao Reviewed-by: Thomas Weißschuh Reviewed-by: Armin Wolf Link: https://lore.kernel.org/r/20231020024007.1677962-1-aichao@kylinos.cn [ij: Removed kerneldoc markers from non-kerneldoc comments.] Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 916646758aea81a143ce89103910f715ed923346 Author: Olli Asikainen Date: Tue Oct 24 22:09:21 2023 +0300 platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e Thinkpad X120e also needs this battery quirk. Signed-off-by: Olli Asikainen Link: https://lore.kernel.org/r/20231024190922.2742-1-olli.asikainen@gmail.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit effd7c70eaa0440688b60b9d419243695ede3c45 Author: Mukesh Ojha Date: Thu Oct 26 19:57:39 2023 +0530 firmware_loader: Abort all upcoming firmware load request once reboot triggered There could be following scenario where there is a ongoing reboot is going from processA which tries to call all the reboot notifier callback and one of them is firmware reboot call which tries to abort all the ongoing firmware userspace request under fw_lock but there could be another processB which tries to do request firmware, which came just after abort done from ProcessA and ask for userspace to load the firmware and this can stop the ongoing reboot ProcessA to stall for next 60s(default timeout) which may not be expected behaviour everyone like to see, instead we should abort any firmware load request which came once firmware knows about the reboot through notification. ProcessA ProcessB kernel_restart_prepare blocking_notifier_call_chain fw_shutdown_notify kill_pending_fw_fallback_reqs __fw_load_abort fw_state_aborted request_firmware __fw_state_set firmware_fallback_sysfs ... fw_load_from_user_helper .. ... . .. usermodehelper_read_trylock fw_load_sysfs_fallback fw_sysfs_wait_timeout usermodehelper_disable __usermodehelper_disable down_write() Signed-off-by: Mukesh Ojha Acked-by: Luis Chamberlain Link: https://lore.kernel.org/r/1698330459-31776-2-git-send-email-quic_mojha@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 87ffa98eeee8d62a56afdad80ea697e7a6e5c354 Author: Mukesh Ojha Date: Thu Oct 26 19:57:38 2023 +0530 firmware_loader: Refactor kill_pending_fw_fallback_reqs() Rename 'only_kill_custom' and refactor logic related to it to be more meaningful. Signed-off-by: Mukesh Ojha Acked-by: Luis Chamberlain Link: https://lore.kernel.org/r/1698330459-31776-1-git-send-email-quic_mojha@quicinc.com Signed-off-by: Greg Kroah-Hartman commit fa10f413091a43f801f82b3cf484f15d6fc9266f Author: Abhijit Gangurde Date: Tue Oct 17 21:35:05 2023 +0530 cdx: add sysfs for subsystem, class and revision CDX controller provides subsystem vendor, subsystem device, class and revision info of the device along with vendor and device ID in native endian format. CDX Bus system uses this information to bind the cdx device to the cdx device driver. Co-developed-by: Puneet Gupta Signed-off-by: Puneet Gupta Co-developed-by: Nipun Gupta Signed-off-by: Nipun Gupta Signed-off-by: Abhijit Gangurde Reviewed-by: Pieter Jansen van Vuuren Tested-by: Nikhil Agarwal Link: https://lore.kernel.org/r/20231017160505.10640-8-abhijit.gangurde@amd.com Signed-off-by: Greg Kroah-Hartman commit 0174f5810401ae6390bfe15354346b5ea660d40c Author: Abhijit Gangurde Date: Tue Oct 17 21:35:04 2023 +0530 cdx: add sysfs for bus reset Add sysfs interface reset to reset all the devices on the CDX bus. Signed-off-by: Abhijit Gangurde Link: https://lore.kernel.org/r/20231017160505.10640-7-abhijit.gangurde@amd.com Signed-off-by: Greg Kroah-Hartman commit e3cfd49cb9491ac1cc233a4b9e098688b4ab281d Author: Abhijit Gangurde Date: Tue Oct 17 21:35:03 2023 +0530 cdx: add support for bus enable and disable CDX bus needs to be disabled before updating/writing devices in the FPGA. Once the devices are written, the bus shall be rescanned. This change provides sysfs entry to enable/disable the CDX bus. Co-developed-by: Nipun Gupta Signed-off-by: Nipun Gupta Signed-off-by: Abhijit Gangurde Link: https://lore.kernel.org/r/20231017160505.10640-6-abhijit.gangurde@amd.com Signed-off-by: Greg Kroah-Hartman commit ce558a391d80b9f47a462107977e8e81fe2f2962 Author: Abhijit Gangurde Date: Tue Oct 17 21:35:02 2023 +0530 cdx: Register cdx bus as a device on cdx subsystem While scanning for CDX devices, register newly discovered bus as a cdx device. CDX device attributes are visible based on device type. Signed-off-by: Abhijit Gangurde Link: https://lore.kernel.org/r/20231017160505.10640-5-abhijit.gangurde@amd.com Signed-off-by: Greg Kroah-Hartman commit e3ed12f37e261a0b35cf0b4ae505adf7ea0f48ec Author: Abhijit Gangurde Date: Tue Oct 17 21:35:01 2023 +0530 cdx: Create symbol namespaces for cdx subsystem Create CDX_BUS and CDX_BUS_CONTROLLER symbol namespace for cdx bus subsystem. CDX controller modules are required to import symbols from CDX_BUS_CONTROLLER namespace and other than controller modules to import from CDX_BUS namespace. Signed-off-by: Abhijit Gangurde Link: https://lore.kernel.org/r/20231017160505.10640-4-abhijit.gangurde@amd.com Signed-off-by: Greg Kroah-Hartman commit f0af816834667b626dc5a3aa09cced82c46f0e62 Author: Abhijit Gangurde Date: Tue Oct 17 21:35:00 2023 +0530 cdx: Introduce lock to protect controller ops Add a mutex lock to prevent race between controller ops initiated by the bus subsystem and the controller registration/unregistration. Signed-off-by: Abhijit Gangurde Link: https://lore.kernel.org/r/20231017160505.10640-3-abhijit.gangurde@amd.com Signed-off-by: Greg Kroah-Hartman commit 54b406e10f0334ee0245d5129c8def444a49cd9b Author: Abhijit Gangurde Date: Tue Oct 17 21:34:59 2023 +0530 cdx: Remove cdx controller list from cdx bus system Remove xarray list of cdx controller. Instead, use platform bus to locate the cdx controller using compat string used by cdx controller platform driver. Also, use ida to allocate a unique id for the controller. Signed-off-by: Abhijit Gangurde Link: https://lore.kernel.org/r/20231017160505.10640-2-abhijit.gangurde@amd.com Signed-off-by: Greg Kroah-Hartman commit c40e66539051158e1c9fdc4cf18babe3a7b34e8e Author: Ayush Singh Date: Tue Oct 17 15:41:14 2023 +0530 dts: ti: k3-am625-beagleplay: Add beaglecc1352 The BeaglePlay board by BeagleBoard.org has a CC1352P7 co-processor connected to the main AM62 (running Linux) over UART. In the BeagleConnect Technology, CC1352 is responsible for handling 6LoWPAN communication with beagleconnect freedom nodes as well as their discovery. This mcu is used by gb-beagleplay, a Greybus driver for BeaglePlay. Signed-off-by: Ayush Singh Link: https://lore.kernel.org/r/20231017101116.178041-4-ayushdevel1325@gmail.com Signed-off-by: Greg Kroah-Hartman commit ec558bbfea671ac020a6dc6be8bf8f0ee556cce0 Author: Ayush Singh Date: Tue Oct 17 15:41:13 2023 +0530 greybus: Add BeaglePlay Linux Driver Add the Greybus host driver for BeaglePlay board by BeagleBoard.org. The current greybus setup involves running SVC in a user-space application (GBridge) and using netlink to communicate with kernel space. GBridge itself uses wpanusb kernel driver, so the greybus messages travel from kernel space (gb_netlink) to user-space (GBridge) and then back to kernel space (wpanusb) before reaching CC1352. This driver directly communicates with CC1352 (running SVC Zephyr application). Thus, it simplifies the complete greybus setup eliminating user-space GBridge. This driver is responsible for the following: - Start SVC (CC1352) on driver load. - Send/Receive Greybus messages to/from CC1352 using HDLC over UART. - Print Logs from CC1352. - Stop SVC (CC1352) on driver load. Signed-off-by: Ayush Singh Link: https://lore.kernel.org/r/20231017101116.178041-3-ayushdevel1325@gmail.com Signed-off-by: Greg Kroah-Hartman commit c966c715c77717bd8bdda32a46b33868acb7a4e2 Author: Ayush Singh Date: Tue Oct 17 15:41:12 2023 +0530 dt-bindings: net: Add ti,cc1352p7 Add DT bindings for Texas Instruments Simplelink CC1352P7 wireless MCU BeaglePlay has CC1352P7 co-processor connected to the main AM62 (running Linux) over UART. In the BeagleConnect Technology, CC1352 is responsible for handling 6LoWPAN communication with beagleconnect freedom nodes as well as their discovery. Signed-off-by: Ayush Singh Reviewed-by: Krzysztof Kozlowski Reviewed-by: Nishanth Menon Link: https://lore.kernel.org/r/20231017101116.178041-2-ayushdevel1325@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2b107158f8095d0de9773080b68b1df38a6017bd Author: Rafał Miłecki Date: Tue Oct 24 19:12:53 2023 +0200 dt-bindings: eeprom: at24: allow NVMEM cells based on old syntax This binding supported NVMEM cells as subnodes and that syntax is used by few in-kenel DTS files. Modify binding to allow it. Reported-by: Rob Herring Fixes: c5330723d5a0 ("dt-bindings: nvmem: move deprecated cells binding to its own file") Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20231024171253.19976-2-zajec5@gmail.com Signed-off-by: Greg Kroah-Hartman commit ed758ca69c0c0fe5820403e98c4fe427a302d553 Author: Rafał Miłecki Date: Tue Oct 24 19:12:52 2023 +0200 dt-bindings: nvmem: SID: allow NVMEM cells based on old syntax This binding supported NVMEM cells as subnodes and that syntax is used by few in-kenel DTS files. Modify binding to allow it. Reported-by: Rob Herring Fixes: c5330723d5a0 ("dt-bindings: nvmem: move deprecated cells binding to its own file") Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20231024171253.19976-1-zajec5@gmail.com Signed-off-by: Greg Kroah-Hartman commit f4cf4e5db331a5ce69e3f0b21d322cac0f4e4b5d Author: Rafał Miłecki Date: Mon Oct 23 12:27:59 2023 +0200 Revert "nvmem: add new config option" This reverts commit 517f14d9cf3533d5ab4fded195ab6f80a92e378f. Config option "no_of_node" is no longer needed since adding a more explicit and targeted option "add_legacy_fixed_of_cells". That "no_of_node" config option was needed *earlier* to help mtd's case. DT nodes of MTD partitions (that are also NVMEM devices) may contain subnodes. Those SHOULD NOT be treated as NVMEM fixed cells. To prevent NVMEM core code from parsing subnodes a "no_of_node" option was added (and set to true in mtd) to make for_each_child_of_node() in NVMEM a no-op. That was a bit hacky because it was messing with "of_node" pointer to achieve some side-effect. With the introduction of "add_legacy_fixed_of_cells" config option things got more explicit. MTD subsystem simply tells NVMEM when to look for fixed cells and there is no need to hack "of_node" pointer anymore. Signed-off-by: Rafał Miłecki Reviewed-by: Miquel Raynal Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20231023102759.31529-1-zajec5@gmail.com Signed-off-by: Greg Kroah-Hartman commit a07d2497ed657eb2efeb967af47e22f573dcd1d6 Author: Manivannan Sadhasivam Date: Wed Oct 25 18:30:29 2023 +0530 PCI: qcom-ep: Add dedicated callback for writing to DBI2 registers The DWC core driver exposes the write_dbi2() callback for writing to the DBI2 registers in a vendor-specific way. On the Qcom EP platforms, the DBI_CS2 bit in the ELBI region needs to be asserted before writing to any DBI2 registers and deasserted once done. So, let's implement the callback for the Qcom PCIe EP driver so that the DBI2 writes are correctly handled in the hardware. Without this callback, the DBI2 register writes like BAR size won't go through and as a result, the default BAR size is set for all BARs. [kwilczynski: commit log, renamed function to match the DWC convention] Fixes: f55fee56a631 ("PCI: qcom-ep: Add Qualcomm PCIe Endpoint controller driver") Suggested-by: Serge Semin Link: https://lore.kernel.org/linux-pci/20231025130029.74693-2-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Krzysztof Wilczyński Reviewed-by: Serge Semin Cc: stable@vger.kernel.org # 5.16+ commit 61e54dea807d202d5bfd563d926b163b43b7fecd Author: James Clark Date: Fri Oct 20 16:41:03 2023 +0100 MAINTAINERS: coresight: Add missing Coresight files There are a few files missing from the list like test_arm_coresight.sh and arm-coresight.txt so add the missing entries. Signed-off-by: James Clark Link: https://lore.kernel.org/r/20231020154103.55936-1-james.clark@arm.com Signed-off-by: Greg Kroah-Hartman commit 8293703a492ae97c86af27c75b76e6239ec86483 Author: Siddharth Vadapalli Date: Fri Oct 20 17:32:48 2023 +0530 misc: pci_endpoint_test: Add deviceID for J721S2 PCIe EP device support Add DEVICE_ID for J721S2 and enable support for endpoints configured with this DEVICE_ID in the pci_endpoint_test driver. Signed-off-by: Siddharth Vadapalli Cc: stable Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20231020120248.3168406-1-s-vadapalli@ti.com Signed-off-by: Greg Kroah-Hartman commit 79614953e815b8c3b063fe68efa3cf508260ac0d Author: Rajan Vaja Date: Fri Oct 27 00:53:58 2023 +0530 firmware: xilinx: Move EXPORT_SYMBOL_GPL next to zynqmp_pm_feature definition As mentioned in Documentation/process/coding-style.rst: In source files, separate functions with one blank line. If the function is exported, the **EXPORT** macro for it should follow immediately after the closing function brace line. So inline with guideline move zynqmp_pm_feature export symbol after its definition. Signed-off-by: Rajan Vaja Signed-off-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/1698348238-2320426-1-git-send-email-radhey.shyam.pandey@amd.com Signed-off-by: Greg Kroah-Hartman commit 41196b0bbe8a1ce663b85aca2141800214c186f1 Author: Pavan Bobba Date: Fri Oct 27 14:21:59 2023 +0530 staging: vt6655: Type encoding info dropped from variable name "byRxRate" variable name "byRxRate" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Link: https://lore.kernel.org/r/16d6e4f4fbf643b45a9e2e5b4c48c93450543ecc.1698396278.git.opensource206@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3b9325d8aa05222070f25ce73e7494a97f8c86f2 Author: Pavan Bobba Date: Fri Oct 27 14:21:58 2023 +0530 staging: vt6655: Type encoding info dropped from function name "CARDbUpdateTSF" function name "CARDbUpdateTSF" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Link: https://lore.kernel.org/r/926ec04bbfc69926cd1af92684fef392f2d6e04a.1698396278.git.opensource206@gmail.com Signed-off-by: Greg Kroah-Hartman commit c97dbf1dcd7533282e1e5bacc0f88b494e671d44 Author: Pavan Bobba Date: Fri Oct 27 14:21:57 2023 +0530 staging: vt6655: Type encoding info dropped from function name "CARDvSetRSPINF" function name "CARDvSetRSPINF" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Link: https://lore.kernel.org/r/63ab11bce827d20cf30eafd874d96128a6e969f8.1698396278.git.opensource206@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1904b721541c7b03039eb9b21999a8b9de40b76f Author: Pavan Bobba Date: Fri Oct 27 14:21:56 2023 +0530 staging: vt6655: Type encoding info dropped from function name "CARDbyGetPktType" function name "CARDbyGetPktType" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Link: https://lore.kernel.org/r/387aa7f3e3c21cab541442d772cec0048f3463ba.1698396278.git.opensource206@gmail.com Signed-off-by: Greg Kroah-Hartman commit 956ab42b8e4f2e0ead19a7dd68e14a83e71e6d19 Author: Pavan Bobba Date: Fri Oct 27 14:21:55 2023 +0530 staging: vt6655: Type encoding info dropped from variable name "byPacketType" variable name "byPacketType" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Link: https://lore.kernel.org/r/308813545f9364da18dfc3cdb051ed59eca18f7f.1698396278.git.opensource206@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4922f5d1e54cecbd6d0acf57983ea62c3eb94c6c Author: Pavan Bobba Date: Fri Oct 27 14:21:54 2023 +0530 staging: vt6655: Type encoding info dropped from function name "CARDbSetPhyParameter" function name "CARDbSetPhyParameter" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Link: https://lore.kernel.org/r/66beb307ac7983b2aa82fa81f6f2362353209859.1698396278.git.opensource206@gmail.com Signed-off-by: Greg Kroah-Hartman commit cb1fe713eca14c92ac950d0ec1d1ea4353fcc8c5 Author: Pavan Bobba Date: Fri Oct 27 14:21:53 2023 +0530 staging: vt6655: Type encoding info dropped from variable name "pbyRsvTime" variable name "pbyRsvTime" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Link: https://lore.kernel.org/r/137b6c433e2d11b6ce99043f1fedf208789e380c.1698396278.git.opensource206@gmail.com Signed-off-by: Greg Kroah-Hartman commit eb88265fa551f04cb200357995aacc91537e3a6b Author: Pavan Bobba Date: Fri Oct 27 14:21:52 2023 +0530 staging: vt6655: Type encoding info dropped from variable name "pbyTxRate" variable name "pbyTxRate" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Link: https://lore.kernel.org/r/409a80898ccbb398c31f222dc29cea4725a0cfb3.1698396278.git.opensource206@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8b46d9ff8af01a2c4df9bc8227dcd09628f64aa2 Author: Pavan Bobba Date: Fri Oct 27 14:21:51 2023 +0530 staging: vt6655: Type encoding info dropped from function name "s_vCalculateOFDMRParameter" function name "s_vCalculateOFDMRParameter" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Link: https://lore.kernel.org/r/de4817b8c29a1cf5e50afb553e3e30bc0fc44572.1698396278.git.opensource206@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6c149083e7b955f6340e6a5f2514d937b5968bbe Author: Pavan Bobba Date: Fri Oct 27 14:21:50 2023 +0530 staging: vt6655: Type encoding info dropped from array name "cwRXBCNTSFOff" array name "cwRXBCNTSFOff" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Link: https://lore.kernel.org/r/b66d2cfebc199c20ff05143185400b6afd351f5a.1698396278.git.opensource206@gmail.com Signed-off-by: Greg Kroah-Hartman commit b83b7368258aeb5104c2ff7331326bfeefea9370 Author: Uwe Kleine-König Date: Thu Oct 26 23:44:08 2023 +0200 staging: fbtft: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. The function fbtft_driver_remove_pdev() (that exists several times as it's part of a macro expansion) returns zero unconditionally, so it can be trivially converted to return void without semantic changes. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231026214407.2508590-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 0210a684cdb277714380553f8d8d8964b2f744fc Author: Heiner Kallweit Date: Thu Oct 26 22:49:21 2023 +0200 staging: olpc_dcon: Remove I2C_CLASS_DDC support olpc_dcon is the only remaining i2c client device driver declaring I2C_CLASS_DDC support after the legacy eeprom driver has been removed. olpc_dcon is only used on olpc devices, connected to an i2c adapter driven by scx200_acb. This adapter driver declares support for I2C_CLASS_HWMON and I2C_CLASS_SPD. Therefore we can safely drop I2C_CLASS_DDC support in olpc_dcon. That's the last step before I2C_CLASS_DDC can be removed in general. This patch is solely based on documentation, and I don't have an olpc device for testing. Therefore some testing would be appreciated before patch is applied. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/da3070d9-e016-4167-843f-a08d5b2dc1fe@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3d69b023a9f520366425b2403119bb1689969129 Author: Ricardo B. Marliere Date: Wed Oct 25 09:26:34 2023 -0300 staging: vc04_services: use snprintf instead of sprintf All the occurrences of sprintf usage under vc04_services can be safely replaced by snprintf, so as to avoid any possible overflow. Suggested-by: Dan Carpenter Suggested-by: Umang Jain Signed-off-by: "Ricardo B. Marliere" Reviewed-by: Umang Jain Link: https://lore.kernel.org/r/20231025122632.307385-4-ricardo@marliere.net Signed-off-by: Greg Kroah-Hartman commit 75c1e5968f5c549c148c253ab331130aa3a74f33 Author: Philipp Hortmann Date: Thu Oct 26 20:18:21 2023 +0200 staging: rtl8192e: Fix line break issue at priv->rx_buf[priv->rx_idx] Fix line break at priv->rx_buf[priv->rx_idx] to increase readability. Suggested-by: Dan Carpenter Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/20231026181821.GA21819@matrix-ESPRIMO-P710 Signed-off-by: Greg Kroah-Hartman commit 60b46910c8c647c621cbf5fdc91f475e04f8c9f3 Author: Philipp Hortmann Date: Thu Oct 26 07:44:30 2023 +0200 staging: rtl8192e: Remove unused constants starting with MAX_RX_QUEUE Remove unused constants. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/0809e3380ce76354d689edd80b82adada5a18d4e.1698295861.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6d03b437c66a3bf073fdab103461931e91ada770 Author: Philipp Hortmann Date: Thu Oct 26 07:44:24 2023 +0200 staging: rtl8192e: Convert array rx_idx[] to variable rx_idx Convert array rx_idx[] to variable rx_idx as index is always 0. Remove unused rx_queue_idx as well. This increases readability. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/f9e3ee95cdc2de810687a9c71f1a9f8d8fdbeac1.1698295861.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 336023659882924cb5921438f1f52d5a741d4a24 Author: Philipp Hortmann Date: Thu Oct 26 07:44:18 2023 +0200 staging: rtl8192e: Convert array rx_ring_dma[] to variable rx_ring_dma Convert array rx_ring_dma[] to variable rx_ring_dma as index is always 0. This increases readability. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/51d3be0a715452cefe5ac6dd29a86fbe65b824fa.1698295861.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 81c412cb8ca76fefced52f2188579e8226f45f00 Author: Philipp Hortmann Date: Thu Oct 26 07:44:11 2023 +0200 staging: rtl8192e: Convert array rx_buf[][] to array rx_buf[] Convert array rx_buf[][] to array rx_buf[] as index is always 0. This increases readability. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/967337963336cf09383003050b12c43c779e1562.1698295861.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8e842c479ac8c8be54f79b1b01ac12d79139d438 Author: Philipp Hortmann Date: Thu Oct 26 07:44:05 2023 +0200 staging: rtl8192e: Convert array rx_ring[] to variable rx_ring Convert array rx_ring[] to variable rx_ring as index is always 0. This increases readability. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/c53ff4251eba0adae6d8279a918c8ab4914b4780.1698295861.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 510c8f18c1fa989f727186e8eb7b0746ede8c525 Author: Philipp Hortmann Date: Thu Oct 26 07:43:59 2023 +0200 staging: rtl8192e: Remove loops with constant MAX_RX_QUEUE MAX_RX_QUEUE is set to 1. All loops with MAX_RX_QUEUE run only one cycle. Remove loops. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/8bc9d3c15fba082a928ea2c0916a6aef5f76f456.1698295861.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit ac32633f231fd43691f9cc0970c8223ac916a1a9 Author: Philipp Hortmann Date: Thu Oct 26 07:43:52 2023 +0200 staging: rtl8192e: Remove HTIOTActIsDisableEDCATurbo() Remove HTIOTActIsDisableEDCATurbo() as it always returns false which leads to one evaluation that is always false. Remove dead code. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/904ca224c6a0a1968012e131c0197a71e5b67f81.1698295861.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit da8e981c735e56b1f5e81d177d484136fbb58708 Author: Philipp Hortmann Date: Thu Oct 26 07:43:46 2023 +0200 staging: rtl8192e: Remove HTIOTActIsDisableMCSTwoSpatialStream() Remove HTIOTActIsDisableMCSTwoSpatialStream() as it always returns false which leads to one evaluation that is always false. Remove dead code. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/a446837ff1107c81f52d3cf9e727d6ef4e2678af.1698295861.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7db86bafb531e626401f291bde5fbb276094cd30 Author: Philipp Hortmann Date: Thu Oct 26 07:43:39 2023 +0200 staging: rtl8192e: Remove HTIOTActIsDisableMCS15() Remove HTIOTActIsDisableMCS15() as it always returns false which leads to one evaluation that is always false. Remove dead code. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/004b43b098f14f82e9614578ea9f04ca95b48b4c.1698295861.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4c0be6c26dcd263ede434fc83ae86e3d55cb7379 Author: Philipp Hortmann Date: Thu Oct 26 07:43:33 2023 +0200 staging: rtl8192e: Remove HTIOTActIsDisableMCS14() Remove HTIOTActIsDisableMCS14() as it always returns zero which leads to one evaluation that is always false. Remove dead code. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/7ff3c7f8daf9bccb004129fdc1128ca0b0cb4e70.1698295861.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 64ebf8797249e792af2143eb9e4bd404d10a022e Author: Andy Shevchenko Date: Tue Oct 24 15:41:15 2023 +0300 serdev: Replace custom code with device_match_acpi_handle() Since driver core provides a generic device_match_acpi_handle() we may replace the custom code with it. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231024124115.3598090-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit ddab72ea7e5be7d1ae0433fa3d399e05837008d1 Author: Andy Shevchenko Date: Tue Oct 24 15:41:14 2023 +0300 serdev: Simplify devm_serdev_device_open() function Use devm_add_action_or_reset() instead of devres_alloc() and devres_add(), which works the same. This will simplify the code. There is no functional changes. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231024124115.3598090-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit aef0f5a1841e76fe13621edc7123076b38d458b0 Author: Andy Shevchenko Date: Tue Oct 24 15:41:13 2023 +0300 serdev: Make use of device_set_node() Use device_set_node() instead of assigning ctrl->dev.of_node directly because it also sets the firmware node. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231024124115.3598090-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit c3a383d8d382e066038ab245c8d2b6d02f4bf8a2 Author: Andrey Konovalov Date: Thu Oct 26 22:01:14 2023 +0200 usb: raw-gadget: report suspend, resume, reset, and disconnect events Update USB_RAW_IOCTL_EVENT_FETCH to also report suspend, resume, reset, and disconnect events. This allows the code that emulates a USB device via Raw Gadget to handle these events. For example, the device can restart enumeration when it gets reset. Also do not print a WARNING when the event queue overflows. With these new events being queued, the queue might overflow if the device emulation code stops fetching events. Also print debug messages when a non-control event is received. Signed-off-by: Andrey Konovalov Link: https://lore.kernel.org/r/d610b629a5f32fb76c24012180743f7f0f1872c0.1698350424.git.andreyknvl@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1f97e3f429cff941b5f7adc9fcbb1b5138cd6125 Author: Andrey Konovalov Date: Thu Oct 26 22:01:13 2023 +0200 usb: raw-gadget: don't disable device if usb_ep_queue fails During device operation, the host might decide to reset a device emulated via Raw Gadget. In this case, if the device emulation code has endpoint requests queued, usb_ep_queue will fail with -ESHUTDOWN. Currently, this disables the Raw Gadget device and makes the emulation code unable to proceed. Do not disable the Raw Gadget device if usb_ep_queue fails. Signed-off-by: Andrey Konovalov Link: https://lore.kernel.org/r/3c5df3dddb67623b4aeb11c5546370363e65d8e2.1698350424.git.andreyknvl@gmail.com Signed-off-by: Greg Kroah-Hartman commit e8033bde451eddfb9b1bbd6e2d848c1b5c277222 Author: Andrey Konovalov Date: Thu Oct 26 22:01:12 2023 +0200 usb: raw-gadget: properly handle interrupted requests Currently, if a USB request that was queued by Raw Gadget is interrupted (via a signal), wait_for_completion_interruptible returns -ERESTARTSYS. Raw Gadget then attempts to propagate this value to userspace as a return value from its ioctls. However, when -ERESTARTSYS is returned by a syscall handler, the kernel internally restarts the syscall. This doesn't allow userspace applications to interrupt requests queued by Raw Gadget (which is required when the emulated device is asked to switch altsettings). It also violates the implied interface of Raw Gadget that a single ioctl must only queue a single USB request. Instead, make Raw Gadget do what GadgetFS does: check whether the request was interrupted (dequeued with status == -ECONNRESET) and report -EINTR to userspace. Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface") Cc: stable Signed-off-by: Andrey Konovalov Link: https://lore.kernel.org/r/0db45b1d7cc466e3d4d1ab353f61d63c977fbbc5.1698350424.git.andreyknvl@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2998874736bca1031ca84b0a3235a2cd09dfa426 Author: Pawel Laszczak Date: Thu Oct 26 09:37:37 2023 +0200 usb:cdnsp: remove TRB_FLUSH_ENDPOINT command Patch removes TRB_FLUSH_ENDPOINT command from driver. This command is not supported by controller and USBSSP returns TRB Error completion code for it. Signed-off-by: Pawel Laszczak Acked-by: Peter Chen Link: https://lore.kernel.org/r/20231026073737.165450-1-pawell@cadence.com Signed-off-by: Greg Kroah-Hartman commit 3d56e5aa6727f5055d1ad879342ad1a8acec2134 Author: Uwe Kleine-König Date: Fri Oct 27 00:17:02 2023 +0200 usb: gadget: aspeed_udc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). ast_udc_remove() is one of these functions that return an error code after doing only a partial cleanup. Replace the core's error message by a more drastic one and still convert the driver to .remove_new(). Note the only semantic change here is the changed error message. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231026221701.2521483-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit c3097719e438ab6d07b8b20b5575f985ab07b5a5 Author: Luca Weiss Date: Fri Oct 20 11:33:20 2023 +0200 dt-bindings: usb: fsa4480: Add compatible for OCP96011 The Orient-Chip OCP96011 is generally compatible with the FSA4480, add a compatible for it with the fallback on fsa4480. However the AUX/SBU connections are expected to be swapped compared to FSA4480, so document this in the data-lanes description. Signed-off-by: Luca Weiss Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20231020-fsa4480-swap-v2-3-9a7f9bb59873@fairphone.com Signed-off-by: Greg Kroah-Hartman commit cf07c55f992228465da7eb0e300351206de6171f Author: Luca Weiss Date: Fri Oct 20 11:33:19 2023 +0200 usb: typec: fsa4480: Add support to swap SBU orientation On some hardware designs the AUX+/- lanes are connected reversed to SBU1/2 compared to the expected design by FSA4480. Made more complicated, the otherwise compatible Orient-Chip OCP96011 expects the lanes to be connected reversed compared to FSA4480. * FSA4480 block diagram shows AUX+ connected to SBU2 and AUX- to SBU1. * OCP96011 block diagram shows AUX+ connected to SBU1 and AUX- to SBU2. So if OCP96011 is used as drop-in for FSA4480 then the orientation handling in the driver needs to be reversed to match the expectation of the OCP96011 hardware. Support parsing the data-lanes parameter in the endpoint node to swap this in the driver. The parse_data_lanes_mapping function is mostly taken from nb7vpq904m.c. Reviewed-by: Neil Armstrong Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20231020-fsa4480-swap-v2-2-9a7f9bb59873@fairphone.com Signed-off-by: Greg Kroah-Hartman commit fad89aa14c35f469ea7d3bf49ee1d5840eea0375 Author: Luca Weiss Date: Fri Oct 20 11:33:18 2023 +0200 dt-bindings: usb: fsa4480: Add data-lanes property to endpoint Allow specifying data-lanes to reverse the muxing orientation between AUX+/- and SBU1/2 where necessary by the hardware design. In the mux there's a switch that needs to be controlled from the OS, and it either connects AUX+ -> SBU1 and AUX- -> SBU2, or the reverse: AUX+ -> SBU2 and AUX- -> SBU1, depending on the orientation of how the USB-C connector is plugged in. With this data-lanes property we can now specify that AUX+ and AUX- connections are swapped between the SoC and the mux, therefore the OS needs to consider this and reverse the direction of this switch in the mux. _______ _______ | | | |-- HP --| | |-- MIC --| |or SoC | | MUX |-- SBU1 ---> To the USB-C Codec |-- AUX+ --| |-- SBU2 ---> connected |-- AUX- --| | ______| |_____| (thanks to Neil Armstrong for this ASCII art) Signed-off-by: Luca Weiss Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20231020-fsa4480-swap-v2-1-9a7f9bb59873@fairphone.com Signed-off-by: Greg Kroah-Hartman commit 4987daf86c152ff882d51572d154ad12e4ff3a4b Author: Jimmy Hu Date: Fri Oct 20 01:21:32 2023 +0000 usb: typec: tcpm: Fix NULL pointer dereference in tcpm_pd_svdm() It is possible that typec_register_partner() returns ERR_PTR on failure. When port->partner is an error, a NULL pointer dereference may occur as shown below. [91222.095236][ T319] typec port0: failed to register partner (-17) ... [91225.061491][ T319] Unable to handle kernel NULL pointer dereference at virtual address 000000000000039f [91225.274642][ T319] pc : tcpm_pd_data_request+0x310/0x13fc [91225.274646][ T319] lr : tcpm_pd_data_request+0x298/0x13fc [91225.308067][ T319] Call trace: [91225.308070][ T319] tcpm_pd_data_request+0x310/0x13fc [91225.308073][ T319] tcpm_pd_rx_handler+0x100/0x9e8 [91225.355900][ T319] kthread_worker_fn+0x178/0x58c [91225.355902][ T319] kthread+0x150/0x200 [91225.355905][ T319] ret_from_fork+0x10/0x30 Add a check for port->partner to avoid dereferencing a NULL pointer. Fixes: 5e1d4c49fbc8 ("usb: typec: tcpm: Determine common SVDM Version") Cc: stable@vger.kernel.org Signed-off-by: Jimmy Hu Link: https://lore.kernel.org/r/20231020012132.100960-1-hhhuuu@google.com Signed-off-by: Greg Kroah-Hartman commit a5901f27dcf13203e5b342b7e9439314a775bf32 Author: Geoffrey D. Bennett Date: Fri Oct 27 20:31:21 2023 +1030 ALSA: scarlett2: Add missing check with firmware version control scarlett2_add_firmware_version_ctl() may return an error, but the return value was not being checked. Add the missing check. Signed-off-by: Geoffrey D. Bennett Fixes: 701949cc0128 ("ALSA: scarlett2: Add support for reading firmware version") Link: https://lore.kernel.org/r/ZTuKcXajVnuelBEb@m.b4.vu Signed-off-by: Takashi Iwai commit 6808918343a8b4b6970ba52ba2d1d511a0976748 Author: Nikolay Aleksandrov Date: Fri Oct 27 13:05:49 2023 +0300 net: bridge: fill in MODULE_DESCRIPTION() Fill in bridge's module description. Suggested-by: Jakub Kicinski Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit f2b88bab69c86d4dab2bfd25a0e741d7df411f7a Author: Dimitri John Ledkov Date: Sun Oct 22 19:22:08 2023 +0100 Documentation/module-signing.txt: bring up to date Update the documentation to mention that ECC NIST P-384 automatic keypair generation is available to use ECDSA signature type, in addition to the RSA. Drop mentions of the now removed SHA-1 and SHA-224 options. Add the just added FIPS 202 SHA-3 module signature hashes. Signed-off-by: Dimitri John Ledkov Signed-off-by: Herbert Xu commit 446b1e0b7b39e2bf2187c58ba2a1cc60fb01de8b Author: Dimitri John Ledkov Date: Sun Oct 22 19:22:07 2023 +0100 module: enable automatic module signing with FIPS 202 SHA-3 Add Kconfig options to use SHA-3 for kernel module signing. 256 size for RSA only, and higher sizes for RSA and NIST P-384. Signed-off-by: Dimitri John Ledkov Signed-off-by: Herbert Xu commit fdb4f66c9545f29742be5a8d325798e6016c3c4e Author: Dimitri John Ledkov Date: Sun Oct 22 19:22:06 2023 +0100 crypto: asymmetric_keys - allow FIPS 202 SHA-3 signatures Add FIPS 202 SHA-3 hash signature support in x509 certificates, pkcs7 signatures, and authenticode signatures. Supports hashes of size 256 and up, as 224 is too weak for any practical purposes. Signed-off-by: Dimitri John Ledkov Signed-off-by: Herbert Xu commit ee62afb9d02dd279a7b73245614f13f8fe777a6d Author: Dimitri John Ledkov Date: Sun Oct 22 19:22:05 2023 +0100 crypto: rsa-pkcs1pad - Add FIPS 202 SHA-3 support Add support in rsa-pkcs1pad for FIPS 202 SHA-3 hashes, sizes 256 and up. As 224 is too weak for any practical purposes. Signed-off-by: Dimitri John Ledkov Signed-off-by: Herbert Xu commit 4b057654ebc3e071e2a95ea2edfd15b5682cedba Author: Dimitri John Ledkov Date: Sun Oct 22 19:22:04 2023 +0100 crypto: FIPS 202 SHA-3 register in hash info for IMA Register FIPS 202 SHA-3 hashes in hash info for IMA and other users. Sizes 256 and up, as 224 is too weak for any practical purposes. Signed-off-by: Dimitri John Ledkov Signed-off-by: Herbert Xu commit 2ee7c1bcf3d1c91ede9d914c52fa2f56c449b75a Author: Dimitri John Ledkov Date: Sun Oct 22 19:22:03 2023 +0100 x509: Add OIDs for FIPS 202 SHA-3 hash and signatures Add OID for FIPS 202 SHA-3 family of hash functions, RSA & ECDSA signatures using those. Limit to 256 or larger sizes, for interoperability reasons. 224 is too weak for any practical uses. Signed-off-by: Dimitri John Ledkov Signed-off-by: Herbert Xu commit 2f1f34c1bf7b309b296bc04321a09e6b5dba0673 Author: Eric Biggers Date: Sun Oct 22 01:11:00 2023 -0700 crypto: ahash - optimize performance when wrapping shash The "ahash" API provides access to both CPU-based and hardware offload- based implementations of hash algorithms. Typically the former are implemented as "shash" algorithms under the hood, while the latter are implemented as "ahash" algorithms. The "ahash" API provides access to both. Various kernel subsystems use the ahash API because they want to support hashing hardware offload without using a separate API for it. Yet, the common case is that a crypto accelerator is not actually being used, and ahash is just wrapping a CPU-based shash algorithm. This patch optimizes the ahash API for that common case by eliminating the extra indirect call for each ahash operation on top of shash. It also fixes the double-counting of crypto stats in this scenario (though CONFIG_CRYPTO_STATS should *not* be enabled by anyone interested in performance anyway...), and it eliminates redundant checking of CRYPTO_TFM_NEED_KEY. As a bonus, it also shrinks struct crypto_ahash. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 85b84327b3f0df32be19e01257fb375972be115c Author: Eric Biggers Date: Sun Oct 22 01:10:59 2023 -0700 crypto: ahash - check for shash type instead of not ahash type Since the previous patch made crypto_shash_type visible to ahash.c, change checks for '->cra_type != &crypto_ahash_type' to '->cra_type == &crypto_shash_type'. This makes more sense and avoids having to forward-declare crypto_ahash_type. The result is still the same, since the type is either shash or ahash here. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit ecf889b70b6c0a174965a902a381f967bfd06914 Author: Eric Biggers Date: Sun Oct 22 01:10:58 2023 -0700 crypto: hash - move "ahash wrapping shash" functions to ahash.c The functions that are involved in implementing the ahash API on top of an shash algorithm belong better in ahash.c, not in shash.c where they currently are. Move them. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 9826d1d6ed5f86cb3d61610b3b1fe31e96a40418 Author: Eric Biggers Date: Sun Oct 22 01:10:57 2023 -0700 crypto: talitos - stop using crypto_ahash::init The function pointer crypto_ahash::init is an internal implementation detail of the ahash API that exists to help it support both ahash and shash algorithms. With an upcoming refactoring of how the ahash API supports shash algorithms, this field will be removed. Some drivers are invoking crypto_ahash::init to call into their own code, which is unnecessary and inefficient. The talitos driver is one of those drivers. Make it just call its own code directly. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 9416210fb0b4b63ee7b812856ab6f989cfa7acbe Author: Eric Biggers Date: Sun Oct 22 01:10:56 2023 -0700 crypto: chelsio - stop using crypto_ahash::init The function pointer crypto_ahash::init is an internal implementation detail of the ahash API that exists to help it support both ahash and shash algorithms. With an upcoming refactoring of how the ahash API supports shash algorithms, this field will be removed. Some drivers are invoking crypto_ahash::init to call into their own code, which is unnecessary and inefficient. The chelsio driver is one of those drivers. Make it just call its own code directly. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 4d707a47517674434a7adb3a11ca9e1c9d4a1adf Author: Eric Biggers Date: Sun Oct 22 01:10:55 2023 -0700 crypto: ahash - improve file comment Improve the file comment for crypto/ahash.c. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit c2435e81a6930fed5aeb0aecc219b467a3045f5d Author: Eric Biggers Date: Sun Oct 22 01:10:54 2023 -0700 crypto: ahash - remove struct ahash_request_priv struct ahash_request_priv is unused, so remove it. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 0f8660c82b79af595b056f6b9f4f227edeb88574 Author: Eric Biggers Date: Sun Oct 22 01:10:53 2023 -0700 crypto: ahash - remove crypto_ahash_alignmask crypto_ahash_alignmask() no longer has any callers, and it always returns 0 now that neither ahash nor shash algorithms support nonzero alignmasks anymore. Therefore, remove it. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 33fe2fb763a84152a297e97b144bbda19fde67e4 Author: Eric Biggers Date: Sun Oct 22 01:10:52 2023 -0700 crypto: gcm - stop using alignmask of ahash Now that the alignmask for ahash and shash algorithms is always 0, simplify crypto_gcm_create_common() accordingly. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 381a796a187a3c1ab477e7d1e5ea0c6aea1e9404 Author: Eric Biggers Date: Sun Oct 22 01:10:51 2023 -0700 crypto: chacha20poly1305 - stop using alignmask of ahash Now that the alignmask for ahash and shash algorithms is always 0, simplify chachapoly_create() accordingly. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 36cfc05715a7ca0c989a355f173cbe6ec469c1f9 Author: Eric Biggers Date: Sun Oct 22 01:10:50 2023 -0700 crypto: ccm - stop using alignmask of ahash Now that the alignmask for ahash and shash algorithms is always 0, simplify crypto_ccm_create_common() accordingly. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 0a6bfaa0e695facb072f2fedfb55df37c4483b50 Author: Eric Biggers Date: Sun Oct 22 01:10:49 2023 -0700 net: ipv6: stop checking crypto_ahash_alignmask Now that the alignmask for ahash and shash algorithms is always 0, crypto_ahash_alignmask() always returns 0 and will be removed. In preparation for this, stop checking crypto_ahash_alignmask() in ah6.c. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit e77f5dd701381cef35b9ea8b6dea6e62c8a7f9f3 Author: Eric Biggers Date: Sun Oct 22 01:10:48 2023 -0700 net: ipv4: stop checking crypto_ahash_alignmask Now that the alignmask for ahash and shash algorithms is always 0, crypto_ahash_alignmask() always returns 0 and will be removed. In preparation for this, stop checking crypto_ahash_alignmask() in ah4.c. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 93f367a9a41ab539e905b1ea91254868e4cf8faa Author: Eric Biggers Date: Sun Oct 22 01:10:47 2023 -0700 crypto: testmgr - stop checking crypto_ahash_alignmask Now that the alignmask for ahash and shash algorithms is always 0, crypto_ahash_alignmask() always returns 0 and will be removed. In preparation for this, stop checking crypto_ahash_alignmask() in testmgr. As a result of this change, test_sg_division::offset_relative_to_alignmask and testvec_config::key_offset_relative_to_alignmask no longer have any effect on ahash (or shash) algorithms. Therefore, also stop setting these flags in default_hash_testvec_configs[]. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 03be4e45074e2a9cb5e06bf527141716262574e6 Author: Eric Biggers Date: Sun Oct 22 01:10:46 2023 -0700 crypto: authencesn - stop using alignmask of ahash Now that the alignmask for ahash and shash algorithms is always 0, simplify the code in authenc accordingly. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 58e4bb5f16e7b643f7ee5d30cd355cefb44b2da9 Author: Eric Biggers Date: Sun Oct 22 01:10:45 2023 -0700 crypto: authenc - stop using alignmask of ahash Now that the alignmask for ahash and shash algorithms is always 0, simplify the code in authenc accordingly. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit c626910f3f1bbce6ad18bc613d895d2a089ed95e Author: Eric Biggers Date: Sun Oct 22 01:10:44 2023 -0700 crypto: ahash - remove support for nonzero alignmask Currently, the ahash API checks the alignment of all key and result buffers against the algorithm's declared alignmask, and for any unaligned buffers it falls back to manually aligned temporary buffers. This is virtually useless, however. First, since it does not apply to the message, its effect is much more limited than e.g. is the case for the alignmask for "skcipher". Second, the key and result buffers are given as virtual addresses and cannot (in general) be DMA'ed into, so drivers end up having to copy to/from them in software anyway. As a result it's easy to use memcpy() or the unaligned access helpers. The crypto_hash_walk_*() helper functions do use the alignmask to align the message. But with one exception those are only used for shash algorithms being exposed via the ahash API, not for native ahashes, and aligning the message is not required in this case, especially now that alignmask support has been removed from shash. The exception is the n2_core driver, which doesn't set an alignmask. In any case, no ahash algorithms actually set a nonzero alignmask anymore. Therefore, remove support for it from ahash. The benefit is that all the code to handle "misaligned" buffers in the ahash API goes away, reducing the overhead of the ahash API. This follows the same change that was made to shash. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 54eea8e29026c6cceeb52151f46e3b994de5513a Author: Eric Biggers Date: Sun Oct 22 01:10:43 2023 -0700 crypto: stm32 - remove unnecessary alignmask for ahashes The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the stm32 driver no longer use it. This driver didn't actually rely on it; it only writes to the result buffer in stm32_hash_finish(), simply using memcpy(). And stm32_hash_setkey() does not assume any alignment for the key buffer. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 8c87553e2db672254d858991c42964030ad7da45 Author: Eric Biggers Date: Sun Oct 22 01:10:42 2023 -0700 crypto: starfive - remove unnecessary alignmask for ahashes The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the starfive driver no longer use it. This driver did actually rely on it, but only for storing to the result buffer using int stores in starfive_hash_copy_hash(). This patch makes starfive_hash_copy_hash() use put_unaligned() instead. (It really should use a specific endianness, but that's an existing bug.) Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 2d91a839f5da3836e3b3f27452fe38a84fc403c6 Author: Eric Biggers Date: Sun Oct 22 01:10:41 2023 -0700 crypto: rockchip - remove unnecessary alignmask for ahashes The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the rockchip driver no longer use it. This driver didn't actually rely on it; it only writes to the result buffer in rk_hash_run(), already using put_unaligned_le32(). And this driver only supports unkeyed hash algorithms, so the key buffer need not be considered. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit f35a4e237f4ecfac0cbf51fc840fe70955431fa9 Author: Eric Biggers Date: Sun Oct 22 01:10:40 2023 -0700 crypto: omap-sham - stop setting alignmask for ahashes The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the omap-sham driver no longer use it. This driver did actually rely on it, but only for storing to the result buffer using __u32 stores in omap_sham_copy_ready_hash(). This patch makes omap_sham_copy_ready_hash() use put_unaligned() instead. (It really should use a specific endianness, but that's an existing bug.) Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 492444c3ed8fee48dda3ade814b5592374897c29 Author: Eric Biggers Date: Sun Oct 22 01:10:39 2023 -0700 crypto: talitos - remove unnecessary alignmask for ahashes The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the talitos driver no longer use it. This driver didn't actually rely on it; it only writes to the result buffer in common_nonsnoop_hash_unmap(), simply using memcpy(). And this driver's "ahash_setkey()" function does not assume any alignment for the key buffer. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 13d13bba26a0930a4c9527bf2e589d79074b45e5 Author: Eric Biggers Date: Sun Oct 22 01:10:38 2023 -0700 crypto: s5p-sss - remove unnecessary alignmask for ahashes The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the s5p-sss driver no longer use it. This driver didn't actually rely on it; it only writes to the result buffer in s5p_hash_copy_result(), simply using memcpy(). And this driver only supports unkeyed hash algorithms, so the key buffer need not be considered. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit d39caf81248703164dee256611dc801102653830 Author: Eric Biggers Date: Sun Oct 22 01:10:37 2023 -0700 crypto: mxs-dcp - remove unnecessary alignmask for ahashes The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the mxs-dcp driver no longer use it. This driver didn't actually rely on it; it only writes to the result buffer in dcp_sha_req_to_buf(), using a bytewise copy. And this driver only supports unkeyed hash algorithms, so the key buffer need not be considered. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit a06f7a8a8397ca05cee3805a5850fbb84e585fb0 Author: Eric Biggers Date: Sun Oct 22 01:10:36 2023 -0700 crypto: artpec6 - stop setting alignmask for ahashes The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the artpec6 driver no longer use it. This driver is unusual in that it DMAs the digest directly to the result buffer. This is broken because the crypto API provides the result buffer as an arbitrary virtual address, which might not be valid for DMA, even after the crypto API applies the alignmask. Maybe the alignmask (which this driver set only to 3) made this code work in a few more cases than it otherwise would have. But even if so, it doesn't make sense for this single driver that is broken anyway to block removal of the alignmask support. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit a5e12d04e5226cd7afecd020a4f66d7ac73fd90e Author: Eric Biggers Date: Sun Oct 22 01:10:35 2023 -0700 crypto: atmel - remove unnecessary alignmask for ahashes The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the atmel driver no longer use it. This driver didn't actually rely on it; it only writes to the result buffer in atmel_sha_copy_ready_hash(), simply using memcpy(). And this driver didn't set an alignmask for any keyed hash algorithms, so the key buffer need not be considered. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 028a14470e0f937f037d2193d836148af8dc2d5c Author: Eric Biggers Date: Sun Oct 22 01:10:34 2023 -0700 crypto: sun8i-ss - remove unnecessary alignmask for ahashes The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the sun8i-ss driver no longer use it. This driver didn't actually rely on it; it only writes to the result buffer in sun8i_ss_hash_run(), simply using memcpy(). And sun8i_ss_hmac_setkey() does not assume any alignment for the key buffer. Signed-off-by: Eric Biggers Acked-by: Corentin Labbe Signed-off-by: Herbert Xu commit 12e06ca3b98326e6320b74c18d344db294f2e5ae Author: Eric Biggers Date: Sun Oct 22 01:10:33 2023 -0700 crypto: sun8i-ce - remove unnecessary alignmask for ahashes The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the sun8i-ce driver no longer use it. This driver didn't actually rely on it; it only writes to the result buffer in sun8i_ce_hash_run(), simply using memcpy(). And this driver only supports unkeyed hash algorithms, so the key buffer need not be considered. Signed-off-by: Eric Biggers Acked-by: Corentin Labbe Signed-off-by: Herbert Xu commit 977755579d3f7f6ad6b719b0f50c924c89ea8c1e Author: Eric Biggers Date: Sun Oct 22 01:10:32 2023 -0700 crypto: sun4i-ss - remove unnecessary alignmask for ahashes The crypto API's support for alignmasks for ahash algorithms is nearly useless, as its only effect is to cause the API to align the key and result buffers. The drivers that happen to be specifying an alignmask for ahash rarely actually need it. When they do, it's easily fixable, especially considering that these buffers cannot be used for DMA. In preparation for removing alignmask support from ahash, this patch makes the sun4i-ss driver no longer use it. This driver didn't actually rely on it; it only writes to the result buffer in sun4i_hash(), already using the unaligned access helpers. And this driver only supports unkeyed hash algorithms, so the key buffer need not be considered. Signed-off-by: Eric Biggers Acked-by: Corentin Labbe Signed-off-by: Herbert Xu commit acd7799574e57f1e494a5b85741eee78d1e93aca Author: Eric Biggers Date: Sun Oct 22 01:10:31 2023 -0700 crypto: shash - remove crypto_shash_ctx_aligned() crypto_shash_ctx_aligned() is no longer used, and it is useless now that shash algorithms don't support nonzero alignmasks, so remove it. Also remove crypto_tfm_ctx_aligned() which was only called by crypto_shash_ctx_aligned(). It's unlikely to be useful again, since it seems inappropriate to use cra_alignmask to represent alignment for the tfm context when it already means alignment for inputs/outputs. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 201c0da4d0298cfcd06a4548f94b90e3817b2e1b Author: Lukas Wunner Date: Sat Oct 21 13:23:44 2023 +0200 treewide: Add SPDX identifier to IETF ASN.1 modules Per section 4.c. of the IETF Trust Legal Provisions, "Code Components" in IETF Documents are licensed on the terms of the BSD-3-Clause license: https://trustee.ietf.org/documents/trust-legal-provisions/tlp-5/ The term "Code Components" specifically includes ASN.1 modules: https://trustee.ietf.org/documents/trust-legal-provisions/code-components-list-3/ Add an SPDX identifier as well as a copyright notice pursuant to section 6.d. of the Trust Legal Provisions to all ASN.1 modules in the tree which are derived from IETF Documents. Section 4.d. of the Trust Legal Provisions requests that each Code Component identify the RFC from which it is taken, so link that RFC in every ASN.1 module. Signed-off-by: Lukas Wunner Signed-off-by: Herbert Xu commit 45b40f9cf10d9ad33828f00e952e9942adf1e114 Author: Ashish Kalra Date: Fri Oct 20 21:22:34 2023 +0000 MAINTAINERS: update AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER - SEV SUPPORT Brijesh is no longer with AMD. Signed-off-by: Ashish Kalra Reviewed-by: Michael Roth Acked-by: Tom Lendacky Signed-off-by: Herbert Xu commit 203b01001c4d741205b9c329acddc5193ed56fbd Author: Giovanni Cabiddu Date: Fri Oct 20 16:33:21 2023 +0100 crypto: qat - fix deadlock in backlog processing If a request has the flag CRYPTO_TFM_REQ_MAY_BACKLOG set, the function qat_alg_send_message_maybacklog(), enqueues it in a backlog list if either (1) there is already at least one request in the backlog list, or (2) the HW ring is nearly full or (3) the enqueue to the HW ring fails. If an interrupt occurs right before the lock in qat_alg_backlog_req() is taken and the backlog queue is being emptied, then there is no request in the HW queues that can trigger a subsequent interrupt that can clear the backlog queue. In addition subsequent requests are enqueued to the backlog list and not sent to the hardware. Fix it by holding the lock while taking the decision if the request needs to be included in the backlog queue or not. This synchronizes the flow with the interrupt handler that drains the backlog queue. For performance reasons, the logic has been changed to try to enqueue first without holding the lock. Fixes: 386823839732 ("crypto: qat - add backlog mechanism") Reported-by: Mikulas Patocka Closes: https://lore.kernel.org/all/af9581e2-58f9-cc19-428f-6f18f1f83d54@redhat.com/T/ Signed-off-by: Giovanni Cabiddu Reviewed-by: Mikulas Patocka Signed-off-by: Herbert Xu commit 03c76e8e7a8d0d465838b8eaffcc07bdcc364f4d Author: Giovanni Cabiddu Date: Fri Oct 20 15:52:51 2023 +0100 crypto: qat - move adf_cfg_services The file adf_cfg_services.h cannot be included in header files since it instantiates the structure adf_cfg_services. Move that structure to its own file and export the symbol. This does not introduce any functional change. Signed-off-by: Giovanni Cabiddu Reviewed-by: Damian Muszynski Signed-off-by: Herbert Xu commit 71fed09b49c168435fc28d57870007495475d946 Author: Ciunas Bennett Date: Fri Oct 20 15:49:31 2023 +0200 crypto: qat - add num_rps sysfs attribute Add the attribute `num_rps` to the `qat` attribute group. This returns the number of ring pairs that a single device has. This allows to know the maximum value that can be set to the attribute `rp2svc`. Signed-off-by: Ciunas Bennett Reviewed-by: Giovanni Cabiddu Reviewed-by: Damian Muszynski Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit dbc8876dd873a6ac5e3191b419d2de5ca613165f Author: Ciunas Bennett Date: Fri Oct 20 15:49:30 2023 +0200 crypto: qat - add rp2svc sysfs attribute Add the attribute `rp2svc` to the `qat` attribute group. This provides a way for a user to query a specific ring pair for the type of service that is currently configured for. When read, the service will be returned for the defined ring pair. When written to this value will be stored as the ring pair to return the service of. Signed-off-by: Ciunas Bennett Reviewed-by: Giovanni Cabiddu Reviewed-by: Damian Muszynski Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit db74e16258198094701f18ab4da3410c44ffdb2e Author: Ciunas Bennett Date: Fri Oct 20 15:49:29 2023 +0200 crypto: qat - add rate limiting sysfs interface Add an interface for the rate limiting feature which allows to add, remove and modify a QAT SLA (Service Level Agreement). This adds a new sysfs attribute group, `qat_rl`, which can be accessed from /sys/bus/pci/devices/ with the following hierarchy: |-+ qat_rl |---- id (RW) # SLA identifier |---- cir (RW) # Committed Information Rate |---- pir (RW) # Peak Information Rate |---- srv (RW) # Service to be rate limited |---- rp (RW) (HEX) # Ring pairs to be rate limited |---- cap_rem (RW) # Remaining capability for a service |---- sla_op (WO) # Allows to perform an operation on an SLA The API works by setting the appropriate RW attributes and then issuing a command through the `sla_op`. For example, to create an SLA, a user needs to input the necessary data into the attributes cir, pir, srv and rp and then write into `sla_op` the command `add` to execute the operation. The API also provides `cap_rem` attribute to get information about the remaining device capability within a certain service which is required when setting an SLA. Signed-off-by: Ciunas Bennett Reviewed-by: Giovanni Cabiddu Reviewed-by: Damian Muszynski Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit d9fb8408376e70a903d06ac86e42e0d0f44a5785 Author: Damian Muszynski Date: Fri Oct 20 15:49:28 2023 +0200 crypto: qat - add rate limiting feature to qat_4xxx The Rate Limiting (RL) feature allows to control the rate of requests that can be submitted on a ring pair (RP). This allows sharing a QAT device among multiple users while ensuring a guaranteed throughput. The driver provides a mechanism that allows users to set policies, that are programmed to the device. The device is then enforcing those policies. Configuration of RL is accomplished through entities called SLAs (Service Level Agreement). Each SLA object gets a unique identifier and defines the limitations for a single service across up to four ring pairs (RPs count allocated to a single VF). The rate is determined using two fields: * CIR (Committed Information Rate), i.e., the guaranteed rate. * PIR (Peak Information Rate), i.e., the maximum rate achievable when the device has available resources. The rate values are expressed in permille scale i.e. 0-1000. Ring pair selection is achieved by providing a 64-bit mask, where each bit corresponds to one of the ring pairs. This adds an interface and logic that allow to add, update, retrieve and remove an SLA. Signed-off-by: Damian Muszynski Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit c7fd53796dbd09c3ef55032925bc7f8f238f9405 Author: Damian Muszynski Date: Fri Oct 20 15:49:27 2023 +0200 crypto: qat - add retrieval of fw capabilities The QAT firmware provides a mechanism to retrieve its capabilities through the init admin interface. Add logic to retrieve the firmware capability mask from the firmware through the init/admin channel. This mask reports if the power management, telemetry and rate limiting features are supported. The fw capabilities are stored in the accel_dev structure and are used to detect if a certain feature is supported by the firmware loaded in the device. This is supported only by devices which have an admin AE. Signed-off-by: Damian Muszynski Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit 02e7f67c47269135f41650ac1b693034e3e8f507 Author: Damian Muszynski Date: Fri Oct 20 15:49:26 2023 +0200 crypto: qat - add bits.h to icp_qat_hw.h Some enums use the macro BIT. Include bits.h as it is missing. Signed-off-by: Damian Muszynski Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit e8eed5f7366f1f5decb694168bd06fb59ef6b12c Author: Damian Muszynski Date: Fri Oct 20 15:49:25 2023 +0200 units: Add BYTES_PER_*BIT There is going to be a new user of the BYTES_PER_[K/M/G]BIT definition besides possibly existing ones. Add them to the header. Signed-off-by: Damian Muszynski Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit 8e6857f76dafba874593107f9e5c20030c5956ed Author: Giovanni Cabiddu Date: Fri Oct 20 15:49:24 2023 +0200 crypto: qat - move admin api The admin API is growing and deserves its own include. Move it from adf_common_drv.h to adf_admin.h. Signed-off-by: Giovanni Cabiddu Reviewed-by: Damian Muszynski Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit a238487f7965d102794ed9f8aff0b667cd2ae886 Author: Giovanni Cabiddu Date: Fri Oct 20 15:49:23 2023 +0200 crypto: qat - fix ring to service map for QAT GEN4 The 4xxx drivers hardcode the ring to service mapping. However, when additional configurations where added to the driver, the mappings were not updated. This implies that an incorrect mapping might be reported through pfvf for certain configurations. Add an algorithm that computes the correct ring to service mapping based on the firmware loaded on the device. Fixes: 0cec19c761e5 ("crypto: qat - add support for compression for 4xxx") Signed-off-by: Giovanni Cabiddu Reviewed-by: Damian Muszynski Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit f7df2329eec1729a606bba8ed1566a1b3c248bad Author: Giovanni Cabiddu Date: Fri Oct 20 15:49:22 2023 +0200 crypto: qat - use masks for AE groups The adf_fw_config structures hardcode a bit mask that represents the acceleration engines (AEs) where a certain firmware image will have to be loaded to. Remove the hardcoded masks and replace them with defines. This does not introduce any functional change. Signed-off-by: Giovanni Cabiddu Reviewed-by: Damian Muszynski Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit 2990d2edac6061c6f0f646a46e40957244be2268 Author: Giovanni Cabiddu Date: Fri Oct 20 15:49:21 2023 +0200 crypto: qat - refactor fw config related functions The logic that selects the correct adf_fw_config structure based on the configured service is replicated twice in the uof_get_name() and uof_get_ae_mask() functions. Refactor the code so that there is no replication. This does not introduce any functional change. Signed-off-by: Giovanni Cabiddu Reviewed-by: Damian Muszynski Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit 99b1c9826e481c3ebe6e7d905b7a0edf853639fd Author: Shashank Gupta Date: Fri Oct 20 11:32:53 2023 +0100 crypto: qat - count QAT GEN4 errors Add logic to count correctable, non fatal and fatal error for QAT GEN4 devices. These counters are reported through sysfs attributes in the group qat_ras. Signed-off-by: Shashank Gupta Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit 532d7f6bc458042571752168bcb5e1fdc576b8c4 Author: Shashank Gupta Date: Fri Oct 20 11:32:52 2023 +0100 crypto: qat - add error counters Introduce ras counters interface for counting QAT specific device errors and expose them through the newly created qat_ras sysfs group attribute. This adds the following attributes: - errors_correctable: number of correctable errors - errors_nonfatal: number of uncorrectable non fatal errors - errors_fatal: number of uncorrectable fatal errors - reset_error_counters: resets all counters These counters are initialized during device bring up and cleared during device shutdown and are applicable only to QAT GEN4 devices. Signed-off-by: Shashank Gupta Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit 22289dc95833c6584aea1f4e8ab9f4f1641bb076 Author: Shashank Gupta Date: Fri Oct 20 11:32:51 2023 +0100 crypto: qat - add handling of errors from ERRSOU3 for QAT GEN4 Add logic to detect, report and handle uncorrectable errors reported through the ERRSOU3 register in QAT GEN4 devices. Signed-off-by: Shashank Gupta Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit 86df79c3a40a0085555aaa475b4b16c8728ef952 Author: Shashank Gupta Date: Fri Oct 20 11:32:50 2023 +0100 crypto: qat - add adf_get_aram_base() helper function Add the function adf_get_aram_base() which allows to return the base address of the aram bar. Signed-off-by: Shashank Gupta Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit b67bf7babe36c6c15623ec22ed13ec9069a6cf37 Author: Shashank Gupta Date: Fri Oct 20 11:32:49 2023 +0100 crypto: qat - add handling of compression related errors for QAT GEN4 Add logic to detect, report and handle correctable and uncorrectable errors related to the compression hardware. These are detected through the EXPRPSSMXLT, EXPRPSSMCPR and EXPRPSSMDCPR registers. Signed-off-by: Shashank Gupta Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit 895f7d532c843f49e0b6dc8341bb911b26da4731 Author: Shashank Gupta Date: Fri Oct 20 11:32:48 2023 +0100 crypto: qat - add handling of errors from ERRSOU2 for QAT GEN4 Add logic to detect, report and handle uncorrectable errors reported through the ERRSOU2 register in QAT GEN4 devices. Signed-off-by: Shashank Gupta Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit 4926e89d19b0631d8f5f5f292c4caf0f0de08f4f Author: Shashank Gupta Date: Fri Oct 20 11:32:47 2023 +0100 crypto: qat - add reporting of errors from ERRSOU1 for QAT GEN4 Add logic to detect and report uncorrectable errors reported through the ERRSOU1 register in QAT GEN4 devices. This also introduces the adf_dev_err_mask structure as part of adf_hw_device_data which will allow to provide different error masks per device generation. Signed-off-by: Shashank Gupta Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit df8c184b77a9c6d52e6c7627bbcb902cdc4d2171 Author: Shashank Gupta Date: Fri Oct 20 11:32:46 2023 +0100 crypto: qat - add reporting of correctable errors for QAT GEN4 Add logic to detect and report correctable errors in QAT GEN4 devices. This includes (1) enabling, disabling and handling error reported through the ERRSOU0 register and (2) logic to log the errors in the system log. Signed-off-by: Shashank Gupta Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit 93b2f7de7db598b0fe429948c739c212f8316330 Author: Shashank Gupta Date: Fri Oct 20 11:32:45 2023 +0100 crypto: qat - add infrastructure for error reporting Add infrastructure for enabling, disabling and reporting errors in the QAT driver. This adds a new structure, adf_ras_ops, to adf_hw_device_data that contains the following methods: - enable_ras_errors(): allows to enable RAS errors at device initialization. - disable_ras_errors(): allows to disable RAS errors at device shutdown. - handle_interrupt(): allows to detect if there is an error and report if a reset is required. This is executed immediately after the error is reported, in the context of an ISR. An initial, empty, implementation of the methods above is provided for QAT GEN4. Signed-off-by: Shashank Gupta Reviewed-by: Giovanni Cabiddu Reviewed-by: Tero Kristo Signed-off-by: Herbert Xu commit 33fc506d2ac514be1072499a263c3bff8c7c95a0 Author: Longfang Liu Date: Fri Oct 20 17:35:58 2023 +0800 crypto: hisilicon/qm - prevent soft lockup in receive loop In the scenario where the accelerator business is fully loaded. When the workqueue receiving messages and performing callback processing, there are a large number of messages that need to be received, and there are continuously messages that have been processed and need to be received. This will cause the receive loop here to be locked for a long time. This scenario will cause watchdog timeout problems on OS with kernel preemption turned off. The error logs: watchdog: BUG: soft lockup - CPU#23 stuck for 23s! [kworker/u262:1:1407] [ 1461.978428][ C23] Call trace: [ 1461.981890][ C23] complete+0x8c/0xf0 [ 1461.986031][ C23] kcryptd_async_done+0x154/0x1f4 [dm_crypt] [ 1461.992154][ C23] sec_skcipher_callback+0x7c/0xf4 [hisi_sec2] [ 1461.998446][ C23] sec_req_cb+0x104/0x1f4 [hisi_sec2] [ 1462.003950][ C23] qm_poll_req_cb+0xcc/0x150 [hisi_qm] [ 1462.009531][ C23] qm_work_process+0x60/0xc0 [hisi_qm] [ 1462.015101][ C23] process_one_work+0x1c4/0x470 [ 1462.020052][ C23] worker_thread+0x150/0x3c4 [ 1462.024735][ C23] kthread+0x108/0x13c [ 1462.028889][ C23] ret_from_fork+0x10/0x18 Therefore, it is necessary to add an actively scheduled operation in the while loop to prevent this problem. After adding it, no matter whether the OS turns on or off the kernel preemption function. Neither will cause watchdog timeout issues. Signed-off-by: Longfang Liu Signed-off-by: Herbert Xu commit bc456c7e24a2f3645117621926178c7ed20040e7 Author: Uwe Kleine-König Date: Fri Oct 20 09:56:04 2023 +0200 crypto: xilinx/zynqmp-sha - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Michal Simek Signed-off-by: Herbert Xu commit 02f393c1dcadfc10d07f916ef314e9947a871609 Author: Uwe Kleine-König Date: Fri Oct 20 09:56:03 2023 +0200 crypto: xilinx/zynqmp-aes-gcm - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Michal Simek Signed-off-by: Herbert Xu commit ce52705e6d1fbb00e43195063ba79c6be7873c95 Author: Uwe Kleine-König Date: Fri Oct 20 09:56:02 2023 +0200 crypto: talitos - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 88b01c8abfc40b473665343ec2b8a353ad9444a4 Author: Uwe Kleine-König Date: Fri Oct 20 09:56:01 2023 +0200 crypto: stm32/cryp - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. The driver adapted here suffered from this wrong assumption and had several error paths resulting in resource leaks. The check for cryp being non-NULL is harmless. This can never happen as .remove() is only called after .probe() completed successfully and in that case drvdata was set to a non-NULL value. So this check can just be dropped. If pm_runtime_get() fails, the other resources held by the device must still be freed. Only clk_disable_unprepare() should be skipped as the pm_runtime_get() failed to call clk_prepare_enable(). After these changes the remove function returns zero unconditionally and can trivially be converted to the prototype required for .remove_new(). Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit afa39e6e2b8569ec280fd3e91d519537ef747d9a Author: Uwe Kleine-König Date: Fri Oct 20 09:56:00 2023 +0200 crypto: stm32/crc32 - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. The driver adapted here suffered from this wrong assumption and had an error paths resulting in resource leaks. If pm_runtime_get() fails, the other resources held by the device must still be freed. Only clk_disable() should be skipped as the pm_runtime_get() failed to call clk_enable(). After this change the remove function returns zero unconditionally and can trivially be converted to the prototype required for .remove_new(). Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit a48c68aa298ccee2512c8bd2081350d465e95bc3 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:59 2023 +0200 crypto: sahara - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit b1010711c029cb3b21e1f8407b91434158327446 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:58 2023 +0200 crypto: sa2ul - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 09f8f67ff1c6e13db1d47e0d027e80d51e231875 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:57 2023 +0200 crypto: s5p-sss - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit 0a5cb2615e042012c4985fcf909c8aefef0a3444 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:56 2023 +0200 crypto: rockchip/rk3288 - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Heiko Stuebner Acked-by: Corentin Labbe Signed-off-by: Herbert Xu commit 37548f1dd35de924bb9a1b1dafdb4d4bffd42ddd Author: Uwe Kleine-König Date: Fri Oct 20 09:55:55 2023 +0200 crypto: qcom-rng - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Konrad Dybcio Signed-off-by: Herbert Xu commit a37049f3532b97b597b2f4a228a5b5cc4ab29c9d Author: Uwe Kleine-König Date: Fri Oct 20 09:55:54 2023 +0200 crypto: qce - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit cf5334f09972941fc1513e73ae852be972577ae7 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:53 2023 +0200 crypto: omap-sham - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit edfb5a04a103d77794f4ee68bb822c9c8207ad80 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:52 2023 +0200 crypto: omap-des - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit e0dffa0ea94269d660f521ac74018b8f7ed4be37 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:51 2023 +0200 crypto: omap-aes - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit a0061b93c6e38024ba002f6a678401b9a66b3876 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:50 2023 +0200 crypto: n2_core - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit fdfe6c3248748b0ba21e9f4b94d4abc75deedfae Author: Uwe Kleine-König Date: Fri Oct 20 09:55:49 2023 +0200 crypto: mxs-dcp - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit e79de44e9d7b4b319990508c3c8a585a7c709bf2 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:48 2023 +0200 crypto: marvell/cesa - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit b28e9179dc5fd28db2205c35fedf733f705fde33 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:47 2023 +0200 crypto: intel/keembay-ocs-hcu - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit b6b73a24fbdb1cb6753635b0b36eb61f1a3799ec Author: Uwe Kleine-König Date: Fri Oct 20 09:55:46 2023 +0200 crypto: intel/keembay-ocs-ecc - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 98272bf6388dff93dde26e782d5485793d9790f5 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:45 2023 +0200 crypto: intel/keembay-ocs-aes - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 2fd7c206317beb185ac6dcb0aa420862da29c370 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:44 2023 +0200 crypto: intel/ixp4xx-crypto - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Corentin Labbe Signed-off-by: Herbert Xu commit 4f7f841f0922863aede9588b767fda080d924f79 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:43 2023 +0200 crypto: inside-secure/safexcel - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 5c5d9715c693b6be52a609892e1d3a6415defabe Author: Uwe Kleine-König Date: Fri Oct 20 09:55:42 2023 +0200 crypto: img-hash - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 151356ceb974b93106159f0368b6ab1f1699031a Author: Uwe Kleine-König Date: Fri Oct 20 09:55:41 2023 +0200 crypto: hisilicon/trng - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Weili Qian Signed-off-by: Herbert Xu commit 31ce0b0676ef22baf8719f4dffd73fb33bae0d10 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:40 2023 +0200 crypto: hisilicon/sec - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit aa2f8e9a3f74f6e808da5a91c716679cc797a3ef Author: Uwe Kleine-König Date: Fri Oct 20 09:55:39 2023 +0200 crypto: gemini/sl3516-ce - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Corentin Labbe Signed-off-by: Herbert Xu commit b0d49b30ef64ac879b491080bf80ef7bcb293ef6 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:38 2023 +0200 crypto: exynos-rng - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Krzysztof Kozlowski Reviewed-by: Andi Shyti Signed-off-by: Herbert Xu commit e7edfb41718a40b8a95785f376d41d876cc360a8 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:37 2023 +0200 crypto: ccree/cc - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 11575ef99fe1f8d2c7a77f5f3fbe6c54134f613d Author: Uwe Kleine-König Date: Fri Oct 20 09:55:36 2023 +0200 crypto: ccp/sp - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Tom Lendacky Signed-off-by: Herbert Xu commit 304a2efe9d55875c6805f3c2957bc39ceebbc5c0 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:35 2023 +0200 crypto: caam/jr - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. The driver adapted here suffers from this wrong assumption. Returning -EBUSY if there are still users results in resource leaks and probably a crash. Also further down passing the error code of caam_jr_shutdown() to the caller only results in another error message and has no further consequences compared to returning zero. Still convert the driver to return no value in the remove callback. This also allows to drop caam_jr_platform_shutdown() as the only function called by it now has the same prototype. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 580399bbc43bce232b46251e175e600407b08f5b Author: Uwe Kleine-König Date: Fri Oct 20 09:55:34 2023 +0200 crypto: bcm/cipher - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit a63e2236dd46503b8617255b9da88ef2f102e523 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:33 2023 +0200 crypto: axis/artpec6 - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jesper Nilsson Signed-off-by: Herbert Xu commit 5cc3e7bca8854c09429989317457e421de017a5a Author: Uwe Kleine-König Date: Fri Oct 20 09:55:32 2023 +0200 crypto: atmel-tdes - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 413f850d022db401a99d85886d42f965e447253f Author: Uwe Kleine-König Date: Fri Oct 20 09:55:31 2023 +0200 crypto: atmel-sha - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 5d966381bf7a2cdb4ce5830d06035cf94de9264d Author: Uwe Kleine-König Date: Fri Oct 20 09:55:30 2023 +0200 crypto: atmel-aes - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Hari Prasath Gujulan Elango Signed-off-by: Herbert Xu commit 7866701cd27403a57b046caa4773862574b92f0b Author: Uwe Kleine-König Date: Fri Oct 20 09:55:29 2023 +0200 crypto: aspeed-hace - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Jeffery Signed-off-by: Herbert Xu commit 8819da7e685008de2c1926c067a388b1ecaeb8aa Author: Uwe Kleine-König Date: Fri Oct 20 09:55:28 2023 +0200 crypto: aspeed-acry - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Jeffery Signed-off-by: Herbert Xu commit 015e07aa043d50985787f51f230f486851fd2401 Author: Uwe Kleine-König Date: Fri Oct 20 09:55:27 2023 +0200 crypto: amlogic-gxl-core - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Corentin Labbe Signed-off-by: Herbert Xu commit 49f49d64348985d893eb919f48f77311ba2678fe Author: Uwe Kleine-König Date: Fri Oct 20 09:55:26 2023 +0200 crypto: amcc/crypto4xx - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit a345d0a956673191f2263565570b1f11ac951f0f Author: Uwe Kleine-König Date: Fri Oct 20 09:55:25 2023 +0200 crypto: sun8i-ss - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andre Przywara Reviewed-by: Jernej Skrabec Acked-by: Corentin Labbe Signed-off-by: Herbert Xu commit 57e5d4de0713fbc10b4b7f821413a2475cadf04a Author: Uwe Kleine-König Date: Fri Oct 20 09:55:24 2023 +0200 crypto: sun8i-ce - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andre Przywara Reviewed-by: Jernej Skrabec Acked-by: Corentin Labbe Signed-off-by: Herbert Xu commit 4f5e6c9921112a8eebbaca344d36054418ac6e3a Author: Uwe Kleine-König Date: Fri Oct 20 09:55:23 2023 +0200 crypto: sun4i-ss - Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andre Przywara Reviewed-by: Jernej Skrabec Acked-by: Corentin Labbe Signed-off-by: Herbert Xu commit cf27d9475f37fb69b5bc293e6e6d6c1d03cf7cc6 Author: Stephan Müller Date: Thu Oct 19 09:40:42 2023 +0200 crypto: jitter - use permanent health test storage The health test result in the current code is only given for the currently processed raw time stamp. This implies to react on the health test error, the result must be checked after each raw time stamp being processed. To avoid this constant checking requirement, any health test error is recorded and stored to be analyzed at a later time, if needed. This change ensures that the power-up test catches any health test error. Without that patch, the power-up health test result is not enforced. The introduced changes are already in use with the user space version of the Jitter RNG. Fixes: 04597c8dd6c4 ("jitter - add RCT/APT support for different OSRs") Reported-by: Joachim Vandersmissen Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 3dca18fcfebf33f2a73876f9314f7621c2e2fb0b Author: Eric Biggers Date: Wed Oct 18 22:53:43 2023 -0700 crypto: shash - remove crypto_shash_alignmask crypto_shash_alignmask() no longer has any callers, and it always returns 0 now that the shash algorithm type no longer supports nonzero alignmasks. Therefore, remove it. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit f6f1514cf72e5d9c2b7c2bc53c43f482b6183d29 Author: Eric Biggers Date: Wed Oct 18 22:53:42 2023 -0700 crypto: hctr2 - stop using alignmask of shash_alg Now that the shash algorithm type does not support nonzero alignmasks, shash_alg::base.cra_alignmask is always 0, so OR-ing it into another value is a no-op. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 321dfe9777a88cdafe676bb03bab07af26c6cfd8 Author: Eric Biggers Date: Wed Oct 18 22:53:41 2023 -0700 crypto: adiantum - stop using alignmask of shash_alg Now that the shash algorithm type does not support nonzero alignmasks, shash_alg::base.cra_alignmask is always 0, so OR-ing it into another value is a no-op. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 2125c11efd83a5aeb9bf04bcbc83b49e8d7e2afb Author: Eric Biggers Date: Wed Oct 18 22:53:40 2023 -0700 crypto: testmgr - stop checking crypto_shash_alignmask Now that the shash algorithm type does not support nonzero alignmasks, crypto_shash_alignmask() always returns 0 and will be removed. In preparation for this, stop checking crypto_shash_alignmask() in testmgr. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit eed577b9a9220dc9f3968b54d055a3884d219897 Author: Eric Biggers Date: Wed Oct 18 22:53:39 2023 -0700 crypto: drbg - stop checking crypto_shash_alignmask Now that the shash algorithm type does not support nonzero alignmasks, crypto_shash_alignmask() always returns 0 and will be removed. In preparation for this, stop checking crypto_shash_alignmask() in drbg. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 69dde0a1fa9a45faf2d863cfc0deb1e82ba5c7a9 Author: Eric Biggers Date: Wed Oct 18 22:53:38 2023 -0700 libceph: stop checking crypto_shash_alignmask Now that the shash algorithm type does not support nonzero alignmasks, crypto_shash_alignmask() always returns 0 and will be removed. In preparation for this, stop checking crypto_shash_alignmask() in net/ceph/messenger_v2.c. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 345bfa3c10ced43281877ce68ae7b3bf360afc76 Author: Eric Biggers Date: Wed Oct 18 22:53:37 2023 -0700 crypto: shash - remove support for nonzero alignmask Currently, the shash API checks the alignment of all message, key, and digest buffers against the algorithm's declared alignmask, and for any unaligned buffers it falls back to manually aligned temporary buffers. This is virtually useless, however. In the case of the message buffer, cryptographic hash functions internally operate on fixed-size blocks, so implementations end up needing to deal with byte-aligned data anyway because the length(s) passed to ->update might not be divisible by the block size. Word-alignment of the message can theoretically be helpful for CRCs, like what was being done in crc32c-sparc64. But in practice it's better for the algorithms to use unaligned accesses or align the message themselves. A similar argument applies to the key and digest. In any case, no shash algorithms actually set a nonzero alignmask anymore. Therefore, remove support for it from shash. The benefit is that all the code to handle "misaligned" buffers in the shash API goes away, reducing the overhead of the shash API. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit a2b1118052c41ca92cbc2366e77b2f0ff3b054ba Author: Eric Biggers Date: Wed Oct 18 22:53:36 2023 -0700 crypto: xcbc - remove unnecessary alignment logic The xcbc template is setting its alignmask to that of its underlying 'cipher'. Yet, it doesn't care itself about how its inputs and outputs are aligned, which is ostensibly the point of the alignmask. Instead, xcbc actually just uses its alignmask itself to runtime-align certain fields in its tfm and desc contexts appropriately for its underlying cipher. That is almost entirely pointless too, though, since xcbc is already using the cipher API functions that handle alignment themselves, and few ciphers set a nonzero alignmask anyway. Also, even without runtime alignment, an alignment of at least 4 bytes can be guaranteed. Thus, at best this code is optimizing for the rare case of ciphers that set an alignmask >= 7, at the cost of hurting the common cases. Therefore, this patch removes the manual alignment code from xcbc and makes it stop setting an alignmask. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 1fb90689bc7ced529152fec406faddd0bcbf99f1 Author: Eric Biggers Date: Wed Oct 18 22:53:35 2023 -0700 crypto: vmac - don't set alignmask The vmac template is setting its alignmask to that of its underlying 'cipher'. This doesn't actually accomplish anything useful, though, so stop doing it. (vmac_update() does have an alignment bug, where it assumes u64 alignment when it shouldn't, but that bug exists both before and after this patch.) This is a prerequisite for removing support for nonzero alignmasks from shash. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 25c74a39e0f637a44982c3820a583755aedc9811 Author: Eric Biggers Date: Wed Oct 18 22:53:34 2023 -0700 crypto: hmac - remove unnecessary alignment logic The hmac template is setting its alignmask to that of its underlying unkeyed hash algorithm, and it is aligning the ipad and opad fields in its tfm context to that alignment. However, hmac does not actually need any sort of alignment itself, which makes this pointless except to keep the pads aligned to what the underlying algorithm prefers. But very few shash algorithms actually set an alignmask, and it is being removed from those remaining ones; also, after setkey, the pads are only passed to crypto_shash_import and crypto_shash_export which ignore the alignmask. Therefore, make the hmac template stop setting an alignmask and simply use natural alignment for ipad and opad. Note, this change also moves the pads from the beginning of the tfm context to the end, which makes much more sense; the variable-length fields should be at the end. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit f9dc9f2e4072de356614d95940c9d7f448a4e334 Author: Eric Biggers Date: Wed Oct 18 22:53:33 2023 -0700 crypto: cmac - remove unnecessary alignment logic The cmac template is setting its alignmask to that of its underlying 'cipher'. Yet, it doesn't care itself about how its inputs and outputs are aligned, which is ostensibly the point of the alignmask. Instead, cmac actually just uses its alignmask itself to runtime-align certain fields in its tfm and desc contexts appropriately for its underlying cipher. That is almost entirely pointless too, though, since cmac is already using the cipher API functions that handle alignment themselves, and few ciphers set a nonzero alignmask anyway. Also, even without runtime alignment, an alignment of at least 4 bytes can be guaranteed. Thus, at best this code is optimizing for the rare case of ciphers that set an alignmask >= 7, at the cost of hurting the common cases. Therefore, this patch removes the manual alignment code from cmac and makes it stop setting an alignmask. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 21415bfe8b5543c41b64b19674e5fcc2c942623e Author: Eric Biggers Date: Wed Oct 18 22:53:32 2023 -0700 crypto: cbcmac - remove unnecessary alignment logic The cbcmac template is aligning a field in its desc context to the alignmask of its underlying 'cipher', at runtime. This is almost entirely pointless, since cbcmac is already using the cipher API functions that handle alignment themselves, and few ciphers set a nonzero alignmask anyway. Also, even without runtime alignment, an alignment of at least 4 bytes can be guaranteed. Thus, at best this code is optimizing for the rare case of ciphers that set an alignmask >= 7, at the cost of hurting the common cases. Therefore, remove the manual alignment code from cbcmac. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit d72c46f7985a22ceb39a69a3bfe05606ec891504 Author: Eric Biggers Date: Wed Oct 18 22:53:31 2023 -0700 crypto: loongarch/crc32 - remove redundant setting of alignmask to 0 This unnecessary explicit setting of cra_alignmask to 0 shows up when grepping for shash algorithms that set an alignmask. Remove it. No change in behavior. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 9cf52f7b083d11a1c404c76baf601e71bfc3fb6b Author: Eric Biggers Date: Wed Oct 18 22:53:30 2023 -0700 crypto: mips/crc32 - remove redundant setting of alignmask to 0 This unnecessary explicit setting of cra_alignmask to 0 shows up when grepping for shash algorithms that set an alignmask. Remove it. No change in behavior. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 71e8c241b22618484137255f39fcb67efa5ef962 Author: Eric Biggers Date: Wed Oct 18 22:53:29 2023 -0700 crypto: xilinx/zynqmp-sha - remove unnecessary alignmask The zynqmp-sha3-384 algorithm sets a nonzero alignmask, but it doesn't appear to actually need it. Therefore, stop setting it. This will allow this algorithm to keep being registered after alignmask support is removed from shash. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 0174275a08e1ed72b3a4ddee462ee3d75c13cc65 Author: Eric Biggers Date: Wed Oct 18 22:53:28 2023 -0700 crypto: stm32 - remove unnecessary alignmask The stm32 crc32 algorithms set a nonzero alignmask, but they don't seem to actually need it. Their ->update function already has code that handles aligning the data to the same alignment that the alignmask specifies, their ->setkey function already uses get_unaligned_le32(), and their ->final function already uses put_unaligned_le32(). Therefore, stop setting the alignmask. This will allow these algorithms to keep being registered after alignmask support is removed from shash. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 9924003807a9738b3f5295174b6c623f5a85eb97 Author: Eric Biggers Date: Wed Oct 18 22:53:27 2023 -0700 crypto: sparc/crc32c - stop using the shash alignmask As far as I can tell, "crc32c-sparc64" is the only "shash" algorithm in the kernel that sets a nonzero alignmask and actually relies on it to get the crypto API to align the inputs and outputs. This capability is not really useful, though. To unblock removing the support for alignmask from shash_alg, this patch updates crc32c-sparc64 to no longer use the alignmask. This means doing 8-byte alignment of the data when doing an update, using get_unaligned_le32() when setting a non-default initial CRC, and using put_unaligned_le32() to output the final CRC. Partially tested with: export ARCH=sparc64 CROSS_COMPILE=sparc64-linux-gnu- make sparc64_defconfig echo CONFIG_CRYPTO_CRC32C_SPARC64=y >> .config echo '# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set' >> .config echo CONFIG_DEBUG_KERNEL=y >> .config echo CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y >> .config make olddefconfig make -j$(getconf _NPROCESSORS_ONLN) qemu-system-sparc64 -kernel arch/sparc/boot/image -nographic However, qemu doesn't actually support the sparc CRC32C instructions, so for the test I temporarily replaced crc32c_sparc64() with __crc32c_le() and made sparc64_has_crc32c_opcode() always return true. So essentially I tested the glue code, not the actual SPARC part which is unchanged. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 08debaa5cb31da50725a8cb2f06d3f617a9caa98 Author: Eric Biggers Date: Wed Oct 18 15:34:55 2023 -0700 crypto: shash - eliminate indirect call for default import and export Most shash algorithms don't have custom ->import and ->export functions, resulting in the memcpy() based default being used. Yet, crypto_shash_import() and crypto_shash_export() still make an indirect call, which is expensive. Therefore, change how the default import and export are called to make it so that crypto_shash_import() and crypto_shash_export() don't do an indirect call in this case. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit a411f6debeb33e2ec8f5825f0c41497317c0504e Author: Om Prakash Singh Date: Mon Oct 16 20:04:28 2023 +0530 dt-bindings: crypto: qcom,prng: document SA8775P and SC7280 Document SA8775P and SC7280 compatible for the True Random Number Generator. Signed-off-by: Om Prakash Singh Reviewed-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Signed-off-by: Herbert Xu commit f5fb88e5301ba7b8cb85063d6b6b3bd378907e25 Author: Herbert Xu Date: Mon Oct 16 13:57:30 2023 +0800 crypto: rsa - Add module alias for pkcs1pad Add a module alias for pkcs1pas so that it can be auto-loaded by modprobe. Signed-off-by: Herbert Xu commit 04a93202ed7c3b451bf22d3ff4bcd379df27f299 Author: Herbert Xu Date: Mon Oct 16 13:21:44 2023 +0800 certs: Break circular dependency when selftest is modular The modular build fails because the self-test code depends on pkcs7 which in turn depends on x509 which contains the self-test. Split the self-test out into its own module to break the cycle. Fixes: 3cde3174eb91 ("certs: Add FIPS selftests") Signed-off-by: Herbert Xu Reviewed-by: Jarkko Sakkinen Signed-off-by: Herbert Xu commit 7ddc21e317b360c3444de3023bcc83b85fabae2f Author: WangJinchao Date: Mon Oct 16 09:15:21 2023 +0800 padata: Fix refcnt handling in padata_free_shell() In a high-load arm64 environment, the pcrypt_aead01 test in LTP can lead to system UAF (Use-After-Free) issues. Due to the lengthy analysis of the pcrypt_aead01 function call, I'll describe the problem scenario using a simplified model: Suppose there's a user of padata named `user_function` that adheres to the padata requirement of calling `padata_free_shell` after `serial()` has been invoked, as demonstrated in the following code: ```c struct request { struct padata_priv padata; struct completion *done; }; void parallel(struct padata_priv *padata) { do_something(); } void serial(struct padata_priv *padata) { struct request *request = container_of(padata, struct request, padata); complete(request->done); } void user_function() { DECLARE_COMPLETION(done) padata->parallel = parallel; padata->serial = serial; padata_do_parallel(); wait_for_completion(&done); padata_free_shell(); } ``` In the corresponding padata.c file, there's the following code: ```c static void padata_serial_worker(struct work_struct *serial_work) { ... cnt = 0; while (!list_empty(&local_list)) { ... padata->serial(padata); cnt++; } local_bh_enable(); if (refcount_sub_and_test(cnt, &pd->refcnt)) padata_free_pd(pd); } ``` Because of the high system load and the accumulation of unexecuted softirq at this moment, `local_bh_enable()` in padata takes longer to execute than usual. Subsequently, when accessing `pd->refcnt`, `pd` has already been released by `padata_free_shell()`, resulting in a UAF issue with `pd->refcnt`. The fix is straightforward: add `refcount_dec_and_test` before calling `padata_free_pd` in `padata_free_shell`. Fixes: 07928d9bfc81 ("padata: Remove broken queue flushing") Signed-off-by: WangJinchao Acked-by: Daniel Jordan Acked-by: Daniel Jordan Signed-off-by: Herbert Xu commit 5428a40a308f220dbbffda66cb01b212f88e9a06 Merge: 5eb8323803a8c 57925e16c9f7d Author: Ulf Hansson Date: Fri Oct 27 12:00:35 2023 +0200 mmc: Merge branch fixes into next Merge the mmc fixes for v6.6-rc[n] into the next branch, to allow them to get tested together with the new mmc changes that are targeted for v6.7. Signed-off-by: Ulf Hansson commit 5eb8323803a8cc6dc260a29b350b90ebdafa0da7 Author: Neil Armstrong Date: Wed Oct 25 10:28:30 2023 +0200 dt-bindings: mmc: sdhci-msm: document the SM8650 SDHCI Controller Document the SDHCI Controller on the SM8650 Platform. Signed-off-by: Neil Armstrong Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231025-topic-sm8650-upstream-bindings-sdhci-v2-1-0406fca99033@linaro.org Signed-off-by: Ulf Hansson commit 57925e16c9f7d18012bcf45bfa658f92c087981a Author: Rong Chen Date: Thu Oct 26 15:31:56 2023 +0800 mmc: meson-gx: Remove setting of CMD_CFG_ERROR For the t7 and older SoC families, the CMD_CFG_ERROR has no effect. Starting from SoC family C3, setting this bit without SG LINK data address will cause the controller to generate an IRQ and stop working. To fix it, don't set the bit CMD_CFG_ERROR anymore. Fixes: 18f92bc02f17 ("mmc: meson-gx: make sure the descriptor is stopped on errors") Signed-off-by: Rong Chen Reviewed-by: Jerome Brunet Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231026073156.2868310-1-rong.chen@amlogic.com Signed-off-by: Ulf Hansson commit 61217d8f6360437329af1b16b8bbd9143167718d Author: Eric Dumazet Date: Thu Oct 26 17:18:40 2023 +0000 virtio_net: use u64_stats_t infra to avoid data-races syzbot reported a data-race in virtnet_poll / virtnet_stats [1] u64_stats_t infra has very nice accessors that must be used to avoid potential load-store tearing. [1] BUG: KCSAN: data-race in virtnet_poll / virtnet_stats read-write to 0xffff88810271b1a0 of 8 bytes by interrupt on cpu 0: virtnet_receive drivers/net/virtio_net.c:2102 [inline] virtnet_poll+0x6c8/0xb40 drivers/net/virtio_net.c:2148 __napi_poll+0x60/0x3b0 net/core/dev.c:6527 napi_poll net/core/dev.c:6594 [inline] net_rx_action+0x32b/0x750 net/core/dev.c:6727 __do_softirq+0xc1/0x265 kernel/softirq.c:553 invoke_softirq kernel/softirq.c:427 [inline] __irq_exit_rcu kernel/softirq.c:632 [inline] irq_exit_rcu+0x3b/0x90 kernel/softirq.c:644 common_interrupt+0x7f/0x90 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:636 __sanitizer_cov_trace_const_cmp8+0x0/0x80 kernel/kcov.c:306 jbd2_write_access_granted fs/jbd2/transaction.c:1174 [inline] jbd2_journal_get_write_access+0x94/0x1c0 fs/jbd2/transaction.c:1239 __ext4_journal_get_write_access+0x154/0x3f0 fs/ext4/ext4_jbd2.c:241 ext4_reserve_inode_write+0x14e/0x200 fs/ext4/inode.c:5745 __ext4_mark_inode_dirty+0x8e/0x440 fs/ext4/inode.c:5919 ext4_evict_inode+0xaf0/0xdc0 fs/ext4/inode.c:299 evict+0x1aa/0x410 fs/inode.c:664 iput_final fs/inode.c:1775 [inline] iput+0x42c/0x5b0 fs/inode.c:1801 do_unlinkat+0x2b9/0x4f0 fs/namei.c:4405 __do_sys_unlink fs/namei.c:4446 [inline] __se_sys_unlink fs/namei.c:4444 [inline] __x64_sys_unlink+0x30/0x40 fs/namei.c:4444 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd read to 0xffff88810271b1a0 of 8 bytes by task 2814 on cpu 1: virtnet_stats+0x1b3/0x340 drivers/net/virtio_net.c:2564 dev_get_stats+0x6d/0x860 net/core/dev.c:10511 rtnl_fill_stats+0x45/0x320 net/core/rtnetlink.c:1261 rtnl_fill_ifinfo+0xd0e/0x1120 net/core/rtnetlink.c:1867 rtnl_dump_ifinfo+0x7f9/0xc20 net/core/rtnetlink.c:2240 netlink_dump+0x390/0x720 net/netlink/af_netlink.c:2266 netlink_recvmsg+0x425/0x780 net/netlink/af_netlink.c:1992 sock_recvmsg_nosec net/socket.c:1027 [inline] sock_recvmsg net/socket.c:1049 [inline] ____sys_recvmsg+0x156/0x310 net/socket.c:2760 ___sys_recvmsg net/socket.c:2802 [inline] __sys_recvmsg+0x1ea/0x270 net/socket.c:2832 __do_sys_recvmsg net/socket.c:2842 [inline] __se_sys_recvmsg net/socket.c:2839 [inline] __x64_sys_recvmsg+0x46/0x50 net/socket.c:2839 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0x000000000045c334 -> 0x000000000045c376 Fixes: 3fa2a1df9094 ("virtio-net: per cpu 64 bit stats (v2)") Signed-off-by: Eric Dumazet Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit 303d77a6e1707498f09c9d8ee91b1dc07ca315a5 Merge: 36e826b568e41 b7bce570430e4 Author: Michael Ellerman Date: Fri Oct 27 20:58:03 2023 +1100 Merge branch 'topic/ppc-kvm' into next Merge our KVM topic branch, this has been independently included in linux-next for most of the development cycle. commit c73801ae4f22b390228ebf471d55668e824198b6 Author: Ben Wolsieffer Date: Thu Oct 19 16:45:49 2023 -0400 futex: Don't include process MM in futex key on no-MMU On no-MMU, all futexes are treated as private because there is no need to map a virtual address to physical to match the futex across processes. This doesn't quite work though, because private futexes include the current process's mm_struct as part of their key. This makes it impossible for one process to wake up a shared futex being waited on in another process. Fix this bug by excluding the mm_struct from the key. With a single address space, the futex address is already a unique key. Fixes: 784bdf3bb694 ("futex: Assume all mappings are private on !MMU systems") Signed-off-by: Ben Wolsieffer Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra Cc: Thomas Gleixner Cc: Darren Hart Cc: Davidlohr Bueso Cc: André Almeida Link: https://lore.kernel.org/r/20231019204548.1236437-2-ben.wolsieffer@hefring.com commit bc4c48e74312d0c96d02f7e7cf75b01f3ba19543 Merge: eff8313be8b0e 0514dd05939a9 Author: David S. Miller Date: Fri Oct 27 10:51:42 2023 +0100 Merge branch 'mdb-get' Ido Schimmel says: ==================== Add MDB get support This patchset adds MDB get support, allowing user space to request a single MDB entry to be retrieved instead of dumping the entire MDB. Support is added in both the bridge and VXLAN drivers. Patches #1-#6 are small preparations in both drivers. Patches #7-#8 add the required uAPI attributes for the new functionality and the MDB get net device operation (NDO), respectively. Patches #9-#10 implement the MDB get NDO in both drivers. Patch #11 registers a handler for RTM_GETMDB messages in rtnetlink core. The handler derives the net device from the ifindex specified in the ancillary header and invokes its MDB get NDO. Patches #12-#13 add selftests by converting tests that use MDB dump with grep to the new MDB get functionality. iproute2 changes can be found here [1]. v2: * Patch #7: Add a comment to describe attributes structure. * Patch #9: Add a comment above spin_lock_bh(). [1] https://github.com/idosch/iproute2/tree/submit/mdb_get_v1 ==================== Signed-off-by: David S. Miller commit 0514dd05939a998abcd2f03f69cc15908072a198 Author: Ido Schimmel Date: Wed Oct 25 15:30:20 2023 +0300 selftests: vxlan_mdb: Use MDB get instead of dump Test the new MDB get functionality by converting dump and grep to MDB get. Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit e8bba9e83c88ea951dafd3319c97c55a52b3637d Author: Ido Schimmel Date: Wed Oct 25 15:30:19 2023 +0300 selftests: bridge_mdb: Use MDB get instead of dump Test the new MDB get functionality by converting dump and grep to MDB get. Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit ddd17a54e692bef1b646febf5242db10982e1965 Author: Ido Schimmel Date: Wed Oct 25 15:30:18 2023 +0300 rtnetlink: Add MDB get support Now that both the bridge and VXLAN drivers implement the MDB get net device operation, expose the functionality to user space by registering a handler for RTM_GETMDB messages. Derive the net device from the ifindex specified in the ancillary header and invoke its MDB get NDO. Note that unlike other get handlers, the allocation of the skb containing the response is not performed in the common rtnetlink code as the size is variable and needs to be determined by the respective driver. Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 32d9673e96dc636cbfca2381b2c93b7a15dc3369 Author: Ido Schimmel Date: Wed Oct 25 15:30:17 2023 +0300 vxlan: mdb: Add MDB get support Implement support for MDB get operation by looking up a matching MDB entry, allocating the skb according to the entry's size and then filling in the response. Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 68b380a395a72ace8b77463f6cd2d7fd6dcb5a1b Author: Ido Schimmel Date: Wed Oct 25 15:30:16 2023 +0300 bridge: mcast: Add MDB get support Implement support for MDB get operation by looking up a matching MDB entry, allocating the skb according to the entry's size and then filling in the response. The operation is performed under the bridge multicast lock to ensure that the entry does not change between the time the reply size is determined and when the reply is filled in. Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 62f47bf9e2c00eea457cad8fa43c24ed0282b37a Author: Ido Schimmel Date: Wed Oct 25 15:30:15 2023 +0300 net: Add MDB get device operation Add MDB net device operation that will be invoked by rtnetlink code in response to received RTM_GETMDB messages. Subsequent patches will implement the operation in the bridge and VXLAN drivers. Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 83c1bbeb864f2a197603b91b3e0f748cca64543d Author: Ido Schimmel Date: Wed Oct 25 15:30:14 2023 +0300 bridge: add MDB get uAPI attributes Add MDB get attributes that correspond to the MDB set attributes used in RTM_NEWMDB messages. Specifically, add 'MDBA_GET_ENTRY' which will hold a 'struct br_mdb_entry' and 'MDBA_GET_ENTRY_ATTRS' which will hold 'MDBE_ATTR_*' attributes that are used as indexes (source IP and source VNI). An example request will look as follows: [ struct nlmsghdr ] [ struct br_port_msg ] [ MDBA_GET_ENTRY ] struct br_mdb_entry [ MDBA_GET_ENTRY_ATTRS ] [ MDBE_ATTR_SOURCE ] struct in_addr / struct in6_addr [ MDBE_ATTR_SRC_VNI ] u32 Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 14c32a46d992412bc276b3365a0c3e5b8b1af9f2 Author: Ido Schimmel Date: Wed Oct 25 15:30:13 2023 +0300 vxlan: mdb: Factor out a helper for remote entry size calculation Currently, netlink notifications are sent for individual remote entries and not for the entire MDB entry itself. Subsequent patches are going to add MDB get support which will require the VXLAN driver to reply with an entire MDB entry. Therefore, as a preparation, factor out a helper to calculate the size of an individual remote entry. When determining the size of the reply this helper will be invoked for each remote entry in the MDB entry. No functional changes intended. Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit ff97d2a956a142bc0383f52560dd46e003c216dd Author: Ido Schimmel Date: Wed Oct 25 15:30:12 2023 +0300 vxlan: mdb: Adjust function arguments Adjust the function's arguments and rename it to allow it to be reused by future call sites that only have access to 'struct vxlan_mdb_entry_key', but not to 'struct vxlan_mdb_config'. No functional changes intended. Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 6d0259dd6c533e4ccc41b40075c1bdfd0f1efbd7 Author: Ido Schimmel Date: Wed Oct 25 15:30:11 2023 +0300 bridge: mcast: Rename MDB entry get function The current name is going to conflict with the upcoming net device operation for the MDB get operation. Rename the function to br_mdb_entry_skb_get(). No functional changes intended. Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 62ef9cba98a2e401b1e8b5dedcc56b735031e744 Author: Ido Schimmel Date: Wed Oct 25 15:30:10 2023 +0300 bridge: mcast: Factor out a helper for PG entry size calculation Currently, netlink notifications are sent for individual port group entries and not for the entire MDB entry itself. Subsequent patches are going to add MDB get support which will require the bridge driver to reply with an entire MDB entry. Therefore, as a preparation, factor out an helper to calculate the size of an individual port group entry. When determining the size of the reply this helper will be invoked for each port group entry in the MDB entry. No functional changes intended. Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 1b6d993509c13d180b2a9fbfe0ebc48e344348df Author: Ido Schimmel Date: Wed Oct 25 15:30:09 2023 +0300 bridge: mcast: Account for missing attributes The 'MDBA_MDB' and 'MDBA_MDB_ENTRY' nest attributes are not accounted for when calculating the size of MDB notifications. Add them along with comments for existing attributes. Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit b9109b5b77f0cb437fe9fd5575e29e944c0b2580 Author: Ido Schimmel Date: Wed Oct 25 15:30:08 2023 +0300 bridge: mcast: Dump MDB entries even when snooping is disabled Currently, the bridge driver does not dump MDB entries when multicast snooping is disabled although the entries are present in the kernel: # bridge mdb add dev br0 port swp1 grp 239.1.1.1 permanent # bridge mdb show dev br0 dev br0 port swp1 grp 239.1.1.1 permanent dev br0 port br0 grp ff02::6a temp dev br0 port br0 grp ff02::1:ff9d:e61b temp # ip link set dev br0 type bridge mcast_snooping 0 # bridge mdb show dev br0 # ip link set dev br0 type bridge mcast_snooping 1 # bridge mdb show dev br0 dev br0 port swp1 grp 239.1.1.1 permanent dev br0 port br0 grp ff02::6a temp dev br0 port br0 grp ff02::1:ff9d:e61b temp This behavior differs from other netlink dump interfaces that dump entries regardless if they are used or not. For example, VLANs are dumped even when VLAN filtering is disabled: # ip link set dev br0 type bridge vlan_filtering 0 # bridge vlan show dev swp1 port vlan-id swp1 1 PVID Egress Untagged Remove the check and always dump MDB entries: # bridge mdb add dev br0 port swp1 grp 239.1.1.1 permanent # bridge mdb show dev br0 dev br0 port swp1 grp 239.1.1.1 permanent dev br0 port br0 grp ff02::6a temp dev br0 port br0 grp ff02::1:ffeb:1a4d temp # ip link set dev br0 type bridge mcast_snooping 0 # bridge mdb show dev br0 dev br0 port swp1 grp 239.1.1.1 permanent dev br0 port br0 grp ff02::6a temp dev br0 port br0 grp ff02::1:ffeb:1a4d temp # ip link set dev br0 type bridge mcast_snooping 1 # bridge mdb show dev br0 dev br0 port swp1 grp 239.1.1.1 permanent dev br0 port br0 grp ff02::6a temp dev br0 port br0 grp ff02::1:ffeb:1a4d temp Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 3e238417254bfdcc23fe207780b59cbb08656762 Author: Geert Uytterhoeven Date: Wed Oct 25 10:37:11 2023 +0200 media: nuvoton: VIDEO_NPCM_VCD_ECE should depend on ARCH_NPCM The Nuvoton NPCM Video Capture/Differentiation Engine (VCD) and Encoding Compression Engine (ECE) are only present on Nuvoton NPCM SoCs. Hence add a dependency on ARCH_NPCM, to prevent asking the user about these drivers when configuring a kernel without Nuvoton NPCM Architecture support. Fixes: 46c15a4ff1f4 ("media: nuvoton: Add driver for NPCM video capture and encoding engine") Signed-off-by: Geert Uytterhoeven Signed-off-by: Hans Verkuil commit 9b6db9a3a675fc2f33b587a9909dcef20c4b3794 Merge: ec09897036423 a558892b3456d Author: Greg Kroah-Hartman Date: Fri Oct 27 11:41:07 2023 +0200 Merge tag 'thunderbolt-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next Mika writes: thunderbolt: Changes for v6.7 merge window This includes following USB4/Thunderbolt changes for the v6.7 merge window: - Configure asymmetric link if the DisplayPort bandwidth requires so - Enable path power management packet support for USB4 v2 routers - Make the bandwidth reservations to follow the USB4 v2 connection manager guide suggestions - DisplayPort tunneling improvements - Small cleanups and improvements around the driver. All these have been in linux-next with no reported issues. * tag 'thunderbolt-for-v6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: (25 commits) thunderbolt: Fix one kernel-doc comment thunderbolt: Configure asymmetric link if needed and bandwidth allows thunderbolt: Add support for asymmetric link thunderbolt: Introduce tb_switch_depth() thunderbolt: Introduce tb_for_each_upstream_port_on_path() thunderbolt: Introduce tb_port_path_direction_downstream() thunderbolt: Set path power management packet support bit for USB4 v2 routers thunderbolt: Change bandwidth reservations to comply USB4 v2 thunderbolt: Make is_gen4_link() available to the rest of the driver thunderbolt: Use weight constants in tb_usb3_consumed_bandwidth() thunderbolt: Use constants for path weight and priority thunderbolt: Add DP IN added last in the head of the list of DP resources thunderbolt: Create multiple DisplayPort tunnels if there are more DP IN/OUT pairs thunderbolt: Log NVM version of routers and retimers thunderbolt: Use tb_tunnel_xxx() log macros in tb.c thunderbolt: Expose tb_tunnel_xxx() log macros to the rest of the driver thunderbolt: Use tb_tunnel_dbg() where possible to make logging more consistent thunderbolt: Fix typo of HPD bit for Hot Plug Detect thunderbolt: Fix typo in enum tb_link_width kernel-doc thunderbolt: Fix debug log when DisplayPort adapter not available for pairing ... commit 5ab1a0474ce4ec5359f4514468371bcd9ccdcacd Merge: 800dce42777cb b3edc3463d64b Author: Greg Kroah-Hartman Date: Fri Oct 27 11:37:12 2023 +0200 Merge tag 'extcon-next-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next Chanwoo writes: Update extcon next for v6.7 Detailed description for this pull request: - Add new Realtek DHC(Digital Home Hub) RTD SoC external connector driver : Detect USB Type C cable detection for USB and USB_HOST cable and support USB Type-C connector class. The extcon-rtk-type-c.c driver supports the following Realtek RTD SoC: - realtek,rtd1295-type-c - realtek,rtd1312c-type-c - realtek,rtd1315e-type-c - realtek,rtd1319-type-c - realtek,rtd1319d-type-c - realtek,rtd1395-type-c - realtek,rtd1619-type-c - realtek,rtd1619b-type-c - Add device-tree compatible string for extcon-max77693 and extcon-77843.c. * tag 'extcon-next-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: extcon: realtek: add the error handler for nvmem_cell_read extcon: max77843: add device-tree compatible string extcon: max77693: add device-tree compatible string dt-bindings: usb: Add Realtek DHC RTD SoC Type-C extcon: add Realtek DHC RTD SoC Type-C driver commit eff8313be8b0e9e5d9bd03b7bfc3b915339deab0 Merge: cc54d2e2c58a4 7fe0e38bb669a Author: David S. Miller Date: Fri Oct 27 10:35:47 2023 +0100 Merge branch 'tcp-ao' Dmitry Safonov says: ==================== net/tcp: Add TCP-AO support This is version 16 of TCP-AO support. It addresses the build warning in the middle of patch set, reported by kernel test robot. There's one Sparse warning introduced by tcp_sigpool_start(): __cond_acquires() seems to currently being broken. I've described the reasoning for it on v9 cover letter. Also, checkpatch.pl warnings were addressed, but yet I've left the ones that are more personal preferences (i.e. 80 columns limit). Please, ping me if you have a strong feeling about one of them. ==================== Signed-off-by: David S. Miller commit 7fe0e38bb669aff739c95846b59b63925570d7ef Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:15 2023 +0100 Documentation/tcp: Add TCP-AO documentation It has Frequently Asked Questions (FAQ) on RFC 5925 - I found it very useful answering those before writing the actual code. It provides answers to common questions that arise on a quick read of the RFC, as well as how they were answered. There's also comparison to TCP-MD5 option, evaluation of per-socket vs in-kernel-DB approaches and description of uAPI provided. Hopefully, it will be as useful for reviewing the code as it was for writing. Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit faadfaba5e018ca0f9595f17115ff48416b7b85e Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:14 2023 +0100 net/tcp: Add TCP_AO_REPAIR Add TCP_AO_REPAIR setsockopt(), getsockopt(). They let a user to repair TCP-AO ISNs/SNEs. Also let the user hack around when (tp->repair) is on and add ao_info on a socket in any supported state. As SNEs now can be read/written at any moment, use WRITE_ONCE()/READ_ONCE() to set/read them. Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 248411b8cb8974a1e1c8e43123c1e682fbd64969 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:13 2023 +0100 net/tcp: Wire up l3index to TCP-AO Similarly how TCP_MD5SIG_FLAG_IFINDEX works for TCP-MD5, TCP_AO_KEYF_IFINDEX is an AO-key flag that binds that MKT to a specified by L3 ifinndex. Similarly, without this flag the key will work in the default VRF l3index = 0 for connections. To prevent AO-keys from overlapping, it's restricted to add key B for a socket that has key A, which have the same sndid/rcvid and one of the following is true: - !(A.keyflags & TCP_AO_KEYF_IFINDEX) or !(B.keyflags & TCP_AO_KEYF_IFINDEX) so that any key is non-bound to a VRF - A.l3index == B.l3index both want to work for the same VRF Additionally, it's restricted to match TCP-MD5 keys for the same peer the following way: |--------------|--------------------|----------------|---------------| | | MD5 key without | MD5 key | MD5 key | | | l3index | l3index=0 | l3index=N | |--------------|--------------------|----------------|---------------| | TCP-AO key | | | | | without | reject | reject | reject | | l3index | | | | |--------------|--------------------|----------------|---------------| | TCP-AO key | | | | | l3index=0 | reject | reject | allow | |--------------|--------------------|----------------|---------------| | TCP-AO key | | | | | l3index=N | reject | allow | reject | |--------------|--------------------|----------------|---------------| This is done with the help of tcp_md5_do_lookup_any_l3index() to reject adding AO key without TCP_AO_KEYF_IFINDEX if there's TCP-MD5 in any VRF. This is important for case where sysctl_tcp_l3mdev_accept = 1 Similarly, for TCP-AO lookups tcp_ao_do_lookup() may be used with l3index < 0, so that __tcp_ao_key_cmp() will match TCP-AO key in any VRF. Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 67fa83f7c86a86913ab9cd5a13b4bebd8d2ebb43 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:12 2023 +0100 net/tcp: Add static_key for TCP-AO Similarly to TCP-MD5, add a static key to TCP-AO that is patched out when there are no keys on a machine and dynamically enabled with the first setsockopt(TCP_AO) adds a key on any socket. The static key is as well dynamically disabled later when the socket is destructed. The lifetime of enabled static key here is the same as ao_info: it is enabled on allocation, passed over from full socket to twsk and destructed when ao_info is scheduled for destruction. Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit d6732b95b6fbbc6d5bb9d2f809e275763640c4a2 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:11 2023 +0100 net/tcp: Allow asynchronous delete for TCP-AO keys (MKTs) Delete becomes very, very fast - almost free, but after setsockopt() syscall returns, the key is still alive until next RCU grace period. Which is fine for listen sockets as userspace needs to be aware of setsockopt(TCP_AO) and accept() race and resolve it with verification by getsockopt() after TCP connection was accepted. The benchmark results (on non-loaded box, worse with more RCU work pending): > ok 33 Worst case delete 16384 keys: min=5ms max=10ms mean=6.93904ms stddev=0.263421 > ok 34 Add a new key 16384 keys: min=1ms max=4ms mean=2.17751ms stddev=0.147564 > ok 35 Remove random-search 16384 keys: min=5ms max=10ms mean=6.50243ms stddev=0.254999 > ok 36 Remove async 16384 keys: min=0ms max=0ms mean=0.0296107ms stddev=0.0172078 Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit ef84703a911f4ee52ca585e8308b7084093941f4 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:10 2023 +0100 net/tcp: Add TCP-AO getsockopt()s Introduce getsockopt(TCP_AO_GET_KEYS) that lets a user get TCP-AO keys and their properties from a socket. The user can provide a filter to match the specific key to be dumped or ::get_all = 1 may be used to dump all keys in one syscall. Add another getsockopt(TCP_AO_INFO) for providing per-socket/per-ao_info stats: packet counters, Current_key/RNext_key and flags like ::ao_required and ::accept_icmps. Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 7753c2f0a857bfa6501e67deee03988dd0bcaae7 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:09 2023 +0100 net/tcp: Add option for TCP-AO to (not) hash header Provide setsockopt() key flag that makes TCP-AO exclude hashing TCP header for peers that match the key. This is needed for interraction with middleboxes that may change TCP options, see RFC5925 (9.2). Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 953af8e3acb68d2db11937cec3bc5da31de5c12e Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:08 2023 +0100 net/tcp: Ignore specific ICMPs for TCP-AO connections Similarly to IPsec, RFC5925 prescribes: ">> A TCP-AO implementation MUST default to ignore incoming ICMPv4 messages of Type 3 (destination unreachable), Codes 2-4 (protocol unreachable, port unreachable, and fragmentation needed -- ’hard errors’), and ICMPv6 Type 1 (destination unreachable), Code 1 (administratively prohibited) and Code 4 (port unreachable) intended for connections in synchronized states (ESTABLISHED, FIN-WAIT-1, FIN- WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT) that match MKTs." A selftest (later in patch series) verifies that this attack is not possible in this TCP-AO implementation. Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 2717b5adea9e2558798c30eb0e93c01722edbb0a Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:07 2023 +0100 net/tcp: Add tcp_hash_fail() ratelimited logs Add a helper for logging connection-detailed messages for failed TCP hash verification (both MD5 and AO). Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 64382c71a5575741933dfdb0cf7162c6e9b8854e Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:06 2023 +0100 net/tcp: Add TCP-AO SNE support Add Sequence Number Extension (SNE) for TCP-AO. This is needed to protect long-living TCP-AO connections from replaying attacks after sequence number roll-over, see RFC5925 (6.2). Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit af09a341dcf63b34ce742295ad1ce876246c5de2 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:05 2023 +0100 net/tcp: Add TCP-AO segments counters Introduce segment counters that are useful for troubleshooting/debugging as well as for writing tests. Now there are global snmp counters as well as per-socket and per-key. Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 0a3a809089eb1d4a0a2fd0c16b520d603988c859 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:04 2023 +0100 net/tcp: Verify inbound TCP-AO signed segments Now there is a common function to verify signature on TCP segments: tcp_inbound_hash(). It has checks for all possible cross-interactions with MD5 signs as well as with unsigned segments. The rules from RFC5925 are: (1) Any TCP segment can have at max only one signature. (2) TCP connections can't switch between using TCP-MD5 and TCP-AO. (3) TCP-AO connections can't stop using AO, as well as unsigned connections can't suddenly start using AO. Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 9427c6aa3ec92f66b3d38f5d5f7af6b94b648a66 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:03 2023 +0100 net/tcp: Sign SYN-ACK segments with TCP-AO Similarly to RST segments, wire SYN-ACKs to TCP-AO. tcp_rsk_used_ao() is handy here to check if the request socket used AO and needs a signature on the outgoing segments. Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 06b22ef29591f625ef877ae00d82192938e29e60 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:02 2023 +0100 net/tcp: Wire TCP-AO to request sockets Now when the new request socket is created from the listening socket, it's recorded what MKT was used by the peer. tcp_rsk_used_ao() is a new helper for checking if TCP-AO option was used to create the request socket. tcp_ao_copy_all_matching() will copy all keys that match the peer on the request socket, as well as preparing them for the usage (creating traffic keys). Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit decde2586b34b99684faff1eab41e5c496c27fb6 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:01 2023 +0100 net/tcp: Add TCP-AO sign to twsk Add support for sockets in time-wait state. ao_info as well as all keys are inherited on transition to time-wait socket. The lifetime of ao_info is now protected by ref counter, so that tcp_ao_destroy_sock() will destruct it only when the last user is gone. Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit ba7783ad45c8f0fb7a70640f6b6fcdc54ed48412 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:22:00 2023 +0100 net/tcp: Add AO sign to RST packets Wire up sending resets to TCP-AO hashing. Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit f7dca36fc54afa2eb76bff8d0589a2ef18caea91 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:21:59 2023 +0100 net/tcp: Add tcp_parse_auth_options() Introduce a helper that: (1) shares the common code with TCP-MD5 header options parsing (2) looks for hash signature only once for both TCP-MD5 and TCP-AO (3) fails with -EEXIST if any TCP sign option is present twice, see RFC5925 (2.2): ">> A single TCP segment MUST NOT have more than one TCP-AO in its options sequence. When multiple TCP-AOs appear, TCP MUST discard the segment." Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 1e03d32bea8e782b7d31769c25a5fae8a5044488 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:21:58 2023 +0100 net/tcp: Add TCP-AO sign to outgoing packets Using precalculated traffic keys, sign TCP segments as prescribed by RFC5925. Per RFC, TCP header options are included in sign calculation: "The TCP header, by default including options, and where the TCP checksum and TCP-AO MAC fields are set to zero, all in network- byte order." (5.1.3) tcp_ao_hash_header() has exclude_options parameter to optionally exclude TCP header from hash calculation, as described in RFC5925 (9.1), this is needed for interaction with middleboxes that may change "some TCP options". This is wired up to AO key flags and setsockopt() later. Similarly to TCP-MD5 hash TCP segment fragments. From this moment a user can start sending TCP-AO signed segments with one of crypto ahash algorithms from supported by Linux kernel. It can have a user-specified MAC length, to either save TCP option header space or provide higher protection using a longer signature. The inbound segments are not yet verified, TCP-AO option is ignored and they are accepted. Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 7c2ffaf21bd67f73d21560995ce17eaf5fc1d37f Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:21:57 2023 +0100 net/tcp: Calculate TCP-AO traffic keys Add traffic key calculation the way it's described in RFC5926. Wire it up to tcp_finish_connect() and cache the new keys straight away on already established TCP connections. Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 0aadc73995d08f6b0dc061c14a564ffa46f5914e Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:21:56 2023 +0100 net/tcp: Prevent TCP-MD5 with TCP-AO being set Be as conservative as possible: if there is TCP-MD5 key for a given peer regardless of L3 interface - don't allow setting TCP-AO key for the same peer. According to RFC5925, TCP-AO is supposed to replace TCP-MD5 and there can't be any switch between both on any connected tuple. Later it can be relaxed, if there's a use, but in the beginning restrict any intersection. Note: it's still should be possible to set both TCP-MD5 and TCP-AO keys on a listening socket for *different* peers. Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 4954f17ddefc51d218625dcdfaf422a253dad3fa Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:21:55 2023 +0100 net/tcp: Introduce TCP_AO setsockopt()s Add 3 setsockopt()s: 1. TCP_AO_ADD_KEY to add a new Master Key Tuple (MKT) on a socket 2. TCP_AO_DEL_KEY to delete present MKT from a socket 3. TCP_AO_INFO to change flags, Current_key/RNext_key on a TCP-AO sk Userspace has to introduce keys on every socket it wants to use TCP-AO option on, similarly to TCP_MD5SIG/TCP_MD5SIG_EXT. RFC5925 prohibits definition of MKTs that would match the same peer, so do sanity checks on the data provided by userspace. Be as conservative as possible, including refusal of defining MKT on an established connection with no AO, removing the key in-use and etc. (1) and (2) are to be used by userspace key manager to add/remove keys. (3) main purpose is to set RNext_key, which (as prescribed by RFC5925) is the KeyID that will be requested in TCP-AO header from the peer to sign their segments with. At this moment the life of ao_info ends in tcp_v4_destroy_sock(). Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit c845f5f3590ef4669fe5464f8a42be6442cd174b Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:21:54 2023 +0100 net/tcp: Add TCP-AO config and structures Introduce new kernel config option and common structures as well as helpers to be used by TCP-AO code. Co-developed-by: Francesco Ruggeri Signed-off-by: Francesco Ruggeri Co-developed-by: Salam Noureddine Signed-off-by: Salam Noureddine Signed-off-by: Dmitry Safonov Acked-by: David Ahern Signed-off-by: David S. Miller commit 8c73b26315aadb82218360d0a9a05e515f6e4118 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Mon Oct 23 20:21:53 2023 +0100 net/tcp: Prepare tcp_md5sig_pool for TCP-AO TCP-AO, similarly to TCP-MD5, needs to allocate tfms on a slow-path, which is setsockopt() and use crypto ahash requests on fast paths, which are RX/TX softirqs. Also, it needs a temporary/scratch buffer for preparing the hash. Rework tcp_md5sig_pool in order to support other hashing algorithms than MD5. It will make it possible to share pre-allocated crypto_ahash descriptors and scratch area between all TCP hash users. Internally tcp_sigpool calls crypto_clone_ahash() API over pre-allocated crypto ahash tfm. Kudos to Herbert, who provided this new crypto API. I was a little concerned over GFP_ATOMIC allocations of ahash and crypto_request in RX/TX (see tcp_sigpool_start()), so I benchmarked both "backends" with different algorithms, using patched version of iperf3[2]. On my laptop with i7-7600U @ 2.80GHz: clone-tfm per-CPU-requests TCP-MD5 2.25 Gbits/sec 2.30 Gbits/sec TCP-AO(hmac(sha1)) 2.53 Gbits/sec 2.54 Gbits/sec TCP-AO(hmac(sha512)) 1.67 Gbits/sec 1.64 Gbits/sec TCP-AO(hmac(sha384)) 1.77 Gbits/sec 1.80 Gbits/sec TCP-AO(hmac(sha224)) 1.29 Gbits/sec 1.30 Gbits/sec TCP-AO(hmac(sha3-512)) 481 Mbits/sec 480 Mbits/sec TCP-AO(hmac(md5)) 2.07 Gbits/sec 2.12 Gbits/sec TCP-AO(hmac(rmd160)) 1.01 Gbits/sec 995 Mbits/sec TCP-AO(cmac(aes128)) [not supporetd yet] 2.11 Gbits/sec So, it seems that my concerns don't have strong grounds and per-CPU crypto_request allocation can be dropped/removed from tcp_sigpool once ciphers get crypto_clone_ahash() support. [1]: https://lore.kernel.org/all/ZDefxOq6Ax0JeTRH@gondor.apana.org.au/T/#u [2]: https://github.com/0x7f454c46/iperf/tree/tcp-md5-ao Signed-off-by: Dmitry Safonov Reviewed-by: Steen Hegelund Acked-by: David Ahern Signed-off-by: David S. Miller commit 800dce42777cb720fbfb731a8efc36892a1d84ad Merge: 40ea89fb19fdb d4c720a19e9ac Author: Greg Kroah-Hartman Date: Fri Oct 27 11:35:06 2023 +0200 Merge tag 'icc-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next Georgi writes: interconnect changes for 6.7 This pull request contains the interconnect changes for the 6.7-rc1 merge window which contains just driver changes with the following highlights: Driver changes: - New interconnect driver for the SDX75 platform. - Support for coefficients to allow node-specific rate adjustments. - Update DT bindings according to the recent changes of how we represent the SMD and RPM bus clocks on Qualcomm platforms. - Misc fixes and cleanups. Signed-off-by: Georgi Djakov * tag 'icc-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: (36 commits) interconnect: qcom: Convert to platform remove callback returning void dt-bindings: interconnect: qcom,rpmh: do not require reg on SDX65 MC virt interconnect: imx: Replace inclusion of kernel.h in the header interconnect: fix error handling in qnoc_probe() interconnect: qcom: osm-l3: Replace custom implementation of COUNT_ARGS() interconnect: msm8974: Replace custom implementation of COUNT_ARGS() interconnect: imx: Replace custom implementation of COUNT_ARGS() interconnect: qcom: Add SDX75 interconnect provider driver dt-bindings: interconnect: Add compatibles for SDX75 interconnect: qcom: sm8350: Set ACV enable_mask interconnect: qcom: sm8250: Set ACV enable_mask interconnect: qcom: sm8150: Set ACV enable_mask interconnect: qcom: sm6350: Set ACV enable_mask interconnect: qcom: sdm845: Set ACV enable_mask interconnect: qcom: sdm670: Set ACV enable_mask interconnect: qcom: sc8280xp: Set ACV enable_mask interconnect: qcom: sc8180x: Set ACV enable_mask interconnect: qcom: sc7280: Set ACV enable_mask interconnect: qcom: sc7180: Set ACV enable_mask interconnect: qcom: qdu1000: Set ACV enable_mask ... commit fe981e67568c41de6caae25d70b5f203b94452cc Author: Matias Ezequiel Vara Larsen Date: Wed Oct 25 11:49:19 2023 +0200 ALSA: virtio: use ack callback This commit uses the ack() callback to determine when a buffer has been updated, then exposes it to guest. The current mechanism splits a dma buffer into descriptors that are exposed to the device. This dma buffer is shared with the user application. When the device consumes a buffer, the driver moves the request from the used ring to available ring. The driver exposes the buffer to the device without knowing if the content has been updated from the user. The section 2.8.21.1 of the virtio spec states that: "The device MAY access the descriptor chains the driver created and the memory they refer to immediately". If the device picks up buffers from the available ring just after it is notified, it happens that the content may be old. When the ack() callback is invoked, the driver exposes only the buffers that have already been updated, i.e., enqueued in the available ring. Thus, the device always picks up a buffer that is updated. For capturing, the driver starts by exposing all the available buffers to device. After device updates the content of a buffer, it enqueues it in the used ring. It is only after the ack() for capturing is issued that the driver re-enqueues the buffer in the available ring. Co-developed-by: Anton Yakovlev Signed-off-by: Anton Yakovlev Signed-off-by: Matias Ezequiel Vara Larsen Link: https://lore.kernel.org/r/ZTjkn1YAFz67yfqx@fedora Signed-off-by: Takashi Iwai commit 3473185f31df29ac572be94fdb87ad8267108bec Author: Geoffrey D. Bennett Date: Fri Oct 27 04:38:26 2023 +1030 ALSA: scarlett2: Remap Level Meter values The values previously returned by the Level Meter control were passed through from the interface without interpretation, but it has been discovered that the order of the values matches the mux assignment order (which is not presented to userspace). In addition, the values for disabled mux outputs, and mux outputs which share a source are invalid. This patch adds a per-device meter_map[], and a dynamic meter_level_map[] which is updated on routing changes. The meter level map gets used by scarlett2_meter_ctl_get() to both present the values in a standard order, and to fix up the invalid values by zeroing them (for disabled outputs) and copying them (for mux outputs which share a source). Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/d437ace603eff685d2e0c3d0960589d7a09dd647.1698342632.git.g@b4.vu Signed-off-by: Takashi Iwai commit 2190b9aea4eb92ccf3176e35c17c959e40f1a81b Author: Geoffrey D. Bennett Date: Fri Oct 27 04:36:16 2023 +1030 ALSA: scarlett2: Allow passing any output to line_out_remap() Line outputs 3 & 4 on the Gen 3 18i8 are internally the analogue 7 and 8 outputs, and this renumbering is hidden from the user by line_out_remap(). By allowing higher values (representing non-analogue outputs) to be passed to line_out_remap(), repeated code from scarlett2_mux_src_enum_ctl_get() and scarlett2_mux_src_enum_ctl_put() can be removed. Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/3b70267931f5994628ab27306c73cddd17b93c8f.1698342632.git.g@b4.vu Signed-off-by: Takashi Iwai commit 701949cc01283675054636f741f505f2627454b7 Author: Geoffrey D. Bennett Date: Fri Oct 27 04:35:46 2023 +1030 ALSA: scarlett2: Add support for reading firmware version The 84 bytes read during initialisation step 2 were previously ignored. This patch retrieves the firmware version from bytes 8-11, stores it in the scarlett2_data struct, and makes it available through a new control "Firmware Version". Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/e76cd80c3445769e60c95df12c4635fc8abfe5c7.1698342632.git.g@b4.vu Signed-off-by: Takashi Iwai commit f3c42a2da45f87d84bd046e83d1e964d7c41dbb5 Author: Geoffrey D. Bennett Date: Fri Oct 27 04:32:39 2023 +1030 ALSA: scarlett2: Rename Gen 3 config sets The config sets are named NO_MIXER, GEN_2, GEN_3, and CLARETT currently. Rename NO_MIXER and GEN_3 to GEN_3A and GEN_3B respectively as NO_MIXER is only for the smaller Gen 3 devices. Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/19ae5eea7fc499945efa8eeda7fcd8afe73f62d9.1698342632.git.g@b4.vu Signed-off-by: Takashi Iwai commit efc3d7d20361cc59325a9f0525e079333b4459c0 Author: Geoffrey D. Bennett Date: Fri Oct 27 04:31:28 2023 +1030 ALSA: scarlett2: Rename scarlett_gen2 to scarlett2 This driver was originally developed for the Focusrite Scarlett Gen 2 series. Since then Focusrite have used a similar protocol for their Gen 3, Gen 4, Clarett USB, Clarett+, and Vocaster series. Let's call this common protocol the "Scarlett 2 Protocol" and rename the driver to scarlett2 to not imply that it is restricted to Gen 2 series devices. Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/e1ad7f69a1e20cdb39094164504389160c1a0a0b.1698342632.git.g@b4.vu Signed-off-by: Takashi Iwai commit 9e0cceadb7a5099c637e787191a9adbf9ec424cd Merge: 2050c9bc4f7bb b131329b9bfbd Author: Ulf Hansson Date: Fri Oct 27 11:02:11 2023 +0200 pmdomain: Merge branch fixes into next Merge the pmdomain fixes for v6.6-rc[n] into the next branch, to allow them to get tested together with the new pmdomain changes that are targeted for v6.7. Signed-off-by: Ulf Hansson commit b131329b9bfbd1b4c0c5e088cb0c6ec03a12930f Author: Tomeu Vizoso Date: Mon Oct 16 10:02:04 2023 +0200 pmdomain: amlogic: Fix mask for the second NNA mem PD domain Without this change, the NPU hangs when the 8th NN core is used. It matches what the out-of-tree driver does. Signed-off-by: Tomeu Vizoso Fixes: 9a217b7e8953 ("soc: amlogic: meson-pwrc: Add NNA power domain for A311D") Acked-by: Neil Armstrong Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231016080205.41982-2-tomeu@tomeuvizoso.net Signed-off-by: Ulf Hansson commit eefed7662ff223f70ba8b1af07f1a096a5ece588 Author: Florian Westphal Date: Thu Oct 26 16:45:42 2023 +0200 xfrm: policy: fix layer 4 flowi decoding The commit shipped with two bugs: fl4->fl4_icmp_type = flkeys->icmp.type; fl4->fl4_icmp_type = flkeys->icmp.code; ~~~~ should have been "code". But the more severe bug is that I got fooled by flowi member defines: fl4_icmp_type, fl4_gre_key and fl4_dport share the same union/address. Fix typo and make gre/icmp key setting depend on the l4 protocol. Fixes: 7a0207094f1b ("xfrm: policy: replace session decode with flow dissector") Reported-and-tested-by: Antony Antony Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert commit f99b926f6543faeadba1b4524d8dc9c102489135 Author: Anup Patel Date: Wed Oct 25 19:58:20 2023 +0530 irqchip/sifive-plic: Fix syscore registration for multi-socket systems Multi-socket systems have a separate PLIC in each socket, so __plic_init() is invoked for each PLIC. __plic_init() registers syscore operations, which obviously fails on the second invocation. Move it into the already existing condition for installing the CPU hotplug state so it is only invoked once when the first PLIC is initialized. [ tglx: Massaged changelog ] Fixes: e80f0b6a2cf3 ("irqchip/irq-sifive-plic: Add syscore callbacks for hibernation") Signed-off-by: Anup Patel Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20231025142820.390238-4-apatel@ventanamicro.com commit e6b3d55b67d00c084a2b98c594330411fb4ebeac Author: Daniel Starke Date: Fri Oct 27 07:39:03 2023 +0200 tty: n_gsm: add copyright Siemens Mobility GmbH More than 1/3 of the n_gsm code has been contributed by us in the last 1.5 years, completing conformance with the standard and stabilizing the driver: - added UI (unnumbered information) frame support - added PN (parameter negotiation) message handling and function support - added optional keep-alive control link supervision via test messages - added TIOCM_OUT1 and TIOCM_OUT2 to allow responder to operate as modem - added TIOCMIWAIT support on virtual ttys - added additional ioctls and parameters to configure the new functions - added overall locking mechanism to avoid data race conditions - added outgoing data flow to decouple physical from virtual tty handling for better performance and to avoid dead-locks - fixed advanced option mode implementation - fixed convergence layer type 2 implementation - fixed handling of CLD (multiplexer close down) messages - fixed broken muxer close down procedure - and many more bug fixes With this most of our initial RFC has been implemented. It gives the driver a quality boost unseen in the decade before. Add a copyright notice to the n_gsm files to highlight this contribution. Link: https://lore.kernel.org/all/20220225080758.2869-1-daniel.starke@siemens.com/ Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20231027053903.1886-1-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit 08d4c174828d868d314d2475fbcaa1393f0bbba9 Author: Rob Herring Date: Fri Oct 20 08:02:56 2023 -0500 irqchip/ls-scfg-msi: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data in a single step without the unnecessary intermediate match pointer. With this, adjust the includes to explicitly include the correct headers. That also serves as preparation to remove implicit includes within the DT headers. of_platform.h currently includes platform_device.h among others. Signed-off-by: Rob Herring Signed-off-by: Thomas Gleixner Tested-by: Vladimir Oltean Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20231020130255.2954415-3-robh@kernel.org commit 5e7afb2eb7b2a7c81e9f608cbdf74a07606fd1b5 Author: Herve Codina Date: Tue Oct 24 17:03:35 2023 +0200 genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware irq_remove_generic_chip() calculates the Linux interrupt number for removing the handler and interrupt chip based on gc::irq_base as a linear function of the bit positions of set bits in the @msk argument. When the generic chip is present in an irq domain, i.e. created with a call to irq_alloc_domain_generic_chips(), gc::irq_base contains not the base Linux interrupt number. It contains the base hardware interrupt for this chip. It is set to 0 for the first chip in the domain, 0 + N for the next chip, where $N is the number of hardware interrupts per chip. That means the Linux interrupt number cannot be calculated based on gc::irq_base for irqdomain based chips without a domain map lookup, which is currently missing. Rework the code to take the irqdomain case into account and calculate the Linux interrupt number by a irqdomain lookup of the domain specific hardware interrupt number. [ tglx: Massage changelog. Reshuffle the logic and add a proper comment. ] Fixes: cfefd21e693d ("genirq: Add chip suspend and resume callbacks") Signed-off-by: Herve Codina Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231024150335.322282-1-herve.codina@bootlin.com commit e8cca466a84a75f8ff2a7a31173c99ee6d1c59d2 Merge: 6e6c6d6bc6c96 f7da9c081517d aa5cabc4ce8e6 9e13ec61de2a5 e82c175e63229 cedc811c76778 3613047280ec4 92bce97f0c341 Author: Joerg Roedel Date: Fri Oct 27 09:13:40 2023 +0200 Merge branches 'iommu/fixes', 'arm/tegra', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd', 'core' and 's390' into next commit 40ea89fb19fdb73472f63a4b00c728ebb55af1b5 Author: Greg Kroah-Hartman Date: Tue Oct 24 13:49:59 2023 +0200 uacce: make uacce_class constant Now that the driver core allows for struct class to be in read-only memory, we should make all 'class' structures declared at build time placing them into read-only memory, instead of having to be dynamically allocated at runtime. Cc: Zhou Wang Cc: Arnd Bergmann Cc: linux-accelerators@lists.ozlabs.org Tested-by: Zhangfei Gao Link: https://lore.kernel.org/r/2023102458-designate-vicinity-4c86@gregkh Signed-off-by: Greg Kroah-Hartman commit cc54d2e2c58a40a82dfd39afa95d3d27f3d6509d Author: Bagas Sanjaya Date: Wed Oct 25 20:03:32 2023 +0700 MAINTAINERS: Remove linuxwwan@intel.com mailing list Messages submitted to the ML bounce (address not found error). In fact, the ML was mistagged as person maintainer instead of mailing list. Remove the ML to keep Cc: lists a bit shorter and not to spam everyone's inbox with postmaster notifications. Signed-off-by: Bagas Sanjaya Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231025130332.67995-2-bagasdotme@gmail.com Signed-off-by: Jakub Kicinski commit ce07087964208eee2ca2f9ee4a98f8b5d9027fe6 Author: Hangyu Hua Date: Fri Oct 27 11:03:02 2023 +0800 9p/net: fix possible memory leak in p9_check_errors() When p9pdu_readf() is called with "s?d" attribute, it allocates a pointer that will store a string. But when p9pdu_readf() fails while handling "d" then this pointer will not be freed in p9_check_errors(). Fixes: 51a87c552dfd ("9p: rework client code to use new protocol support functions") Reviewed-by: Christian Schoenebeck Signed-off-by: Hangyu Hua Message-ID: <20231027030302.11927-1-hbh25y@gmail.com> Signed-off-by: Dominique Martinet commit e02be6390d6fddae6b4b9053caea9fc5ca011f32 Author: Dominique Martinet Date: Thu Oct 26 07:27:52 2023 +0900 9p/fs: add MODULE_DESCIPTION Fix modpost warning that MODULE_DESCRIPTION is missing in fs/9p/9p.o Signed-off-by: Dominique Martinet Message-ID: <20231025223107.1274963-1-asmadeus@codewreck.org> Reviewed-by: Christian Schoenebeck commit 39763480dd19fae66c0051a5f42d1ee4dfdc18cb Author: Dominique Martinet Date: Wed Oct 25 19:34:45 2023 +0900 9p/net: xen: fix false positive printf format overflow warning Use the constant to make the compiler happy about this warning: net/9p/trans_xen.c: In function ‘xen_9pfs_front_changed’: net/9p/trans_xen.c:444:39: warning: ‘%d’ directive writing between 1 and 11 bytes into a region of size 8 [-Wformat-overflow=] 444 | sprintf(str, "ring-ref%d", i); | ^~ In function ‘xen_9pfs_front_init’, inlined from ‘xen_9pfs_front_changed’ at net/9p/trans_xen.c:516:8, inlined from ‘xen_9pfs_front_changed’ at net/9p/trans_xen.c:504:13: net/9p/trans_xen.c:444:30: note: directive argument in the range [-2147483644, 2147483646] 444 | sprintf(str, "ring-ref%d", i); | ^~~~~~~~~~~~ net/9p/trans_xen.c:444:17: note: ‘sprintf’ output between 10 and 20 bytes into a destination of size 16 444 | sprintf(str, "ring-ref%d", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ net/9p/trans_xen.c: In function ‘xen_9pfs_front_changed’: net/9p/trans_xen.c:450:45: warning: ‘%d’ directive writing between 1 and 11 bytes into a region of size 2 [-Wformat-overflow=] 450 | sprintf(str, "event-channel-%d", i); | ^~ In function ‘xen_9pfs_front_init’, inlined from ‘xen_9pfs_front_changed’ at net/9p/trans_xen.c:516:8, inlined from ‘xen_9pfs_front_changed’ at net/9p/trans_xen.c:504:13: net/9p/trans_xen.c:450:30: note: directive argument in the range [-2147483644, 2147483646] 450 | sprintf(str, "event-channel-%d", i); | ^~~~~~~~~~~~~~~~~~ net/9p/trans_xen.c:450:17: note: ‘sprintf’ output between 16 and 26 bytes into a destination of size 16 450 | sprintf(str, "event-channel-%d", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There is no change in logic: there only are a constant number of rings, and there also already is a BUILD_BUG_ON that checks if that constant goes over 9 as anything bigger would no longer fit the event-channel-%d destination size. In theory having that size as part of the struct means it could be modified by another thread and makes the compiler lose track of possible values for 'i' here, using the constant directly here makes it work. Signed-off-by: Dominique Martinet Message-ID: <20231025103445.1248103-3-asmadeus@codewreck.org> Reviewed-by: Christian Schoenebeck commit dbc0fd481cd05bc5000136245ba49501d568936e Merge: edd68156bccf1 ba20ecb1d1bb5 Author: Jakub Kicinski Date: Thu Oct 26 20:34:25 2023 -0700 Merge branch 'intel-wired-lan-driver-updates-for-2023-10-25-ice' Jacob Keller says: ==================== Intel Wired LAN Driver Updates for 2023-10-25 (ice) This series extends the ice driver with basic support for the E830 device line. It does not include support for all device features, but enables basic functionality to load and pass traffic. Alice adds the 200G speed and PHY types supported by E830 hardware. Dan extends the DDP package logic to support the E830 package segment. Paul adds the basic registers and macros used by E830 hardware, and adds support for handling variable length link status information from firmware. Pawel removes some redundant zeroing of the PCI IDs list, and extends the list to include the E830 device IDs. ==================== Link: https://lore.kernel.org/r/20231025214157.1222758-1-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit ba20ecb1d1bb52173d8599c9c613c73adadd5225 Author: Pawel Chmielewski Date: Wed Oct 25 14:41:57 2023 -0700 ice: Hook up 4 E830 devices by adding their IDs As the previous patches provide support for E830 hardware, add E830 specific IDs to the PCI device ID table, so these devices can now be probed by the kernel. Reviewed-by: Jesse Brandeburg Signed-off-by: Pawel Chmielewski Reviewed-by: Simon Horman Signed-off-by: Paul Greenwalt Tested-by: Tony Brelinski Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231025214157.1222758-7-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit f8ab08c0b769e69a8f6773ab6ffcb44a8d5e57a2 Author: Pawel Chmielewski Date: Wed Oct 25 14:41:56 2023 -0700 ice: Remove redundant zeroing of the fields. Remove zeroing of the fields, as all the fields are in fact initialized with zeros automatically Reviewed-by: Jesse Brandeburg Signed-off-by: Pawel Chmielewski Reviewed-by: Simon Horman Signed-off-by: Paul Greenwalt Tested-by: Tony Brelinski Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231025214157.1222758-6-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 3cbdb0343022a2ca672cd8913e745cede24b365c Author: Dan Nowlin Date: Wed Oct 25 14:41:55 2023 -0700 ice: Add support for E830 DDP package segment Add support for E830 DDP package segment. For the E830 package, signature buffers will not be included inline in the configuration buffers. Instead, the signature buffers will be located in a signature segment. Reviewed-by: Jesse Brandeburg Signed-off-by: Dan Nowlin Co-developed-by: Paul Greenwalt Signed-off-by: Paul Greenwalt Reviewed-by: Simon Horman Tested-by: Tony Brelinski Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231025214157.1222758-5-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 2777d24ec6d1c0b1bbebb5142465b29c116094e6 Author: Paul Greenwalt Date: Wed Oct 25 14:41:54 2023 -0700 ice: Add ice_get_link_status_datalen The Get Link Status data length can vary with different versions of ice_aqc_get_link_status_data. Add ice_get_link_status_datalen() to return datalen for the specific ice_aqc_get_link_status_data version. Add new link partner fields to ice_aqc_get_link_status_data; PHY type, FEC, and flow control. Reviewed-by: Jesse Brandeburg Co-developed-by: Pawel Chmielewski Signed-off-by: Pawel Chmielewski Reviewed-by: Simon Horman Signed-off-by: Paul Greenwalt Tested-by: Tony Brelinski Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231025214157.1222758-4-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 24407a01e57c07aa919279ce85495ad38680cc39 Author: Alice Michael Date: Wed Oct 25 14:41:53 2023 -0700 ice: Add 200G speed/phy type use Add the support for 200G phy speeds and the mapping for their advertisement in link. Add the new PHY type bits for AQ command, as needed for 200G E830 controllers. Signed-off-by: Alice Michael Co-developed-by: Pawel Chmielewski Signed-off-by: Pawel Chmielewski Reviewed-by: Simon Horman Signed-off-by: Paul Greenwalt Tested-by: Tony Brelinski Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231025214157.1222758-3-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit ba1124f58afd37d9ff155d4ab7c9f209346aaed9 Author: Paul Greenwalt Date: Wed Oct 25 14:41:52 2023 -0700 ice: Add E830 device IDs, MAC type and registers E830 is the 200G NIC family which uses the ice driver. Add specific E830 registers. Embed macros to use proper register based on (hw)->mac_type & name those macros to [ORIGINAL]_BY_MAC(hw). Registers only available on one of the macs will need to be explicitly referred to as E800_NAME instead of just NAME. PTP is not yet supported. Co-developed-by: Milena Olech Signed-off-by: Milena Olech Co-developed-by: Dan Nowlin Signed-off-by: Dan Nowlin Co-developed-by: Scott Taylor Signed-off-by: Scott Taylor Co-developed-by: Pawel Chmielewski Signed-off-by: Pawel Chmielewski Reviewed-by: Simon Horman Signed-off-by: Paul Greenwalt Tested-by: Tony Brelinski Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231025214157.1222758-2-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit edd68156bccf1af233576ad847f4b138e8b88040 Merge: c6f9b7138bf5c 1002f8171d966 Author: Jakub Kicinski Date: Thu Oct 26 20:27:57 2023 -0700 Merge tag 'wireless-next-2023-10-26' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Kalle Valo says: ==================== wireless-next patches for v6.7 The third, and most likely the last, features pull request for v6.7. Fixes all over and only few small new features. Major changes: iwlwifi - more Multi-Link Operation (MLO) work ath12k - QCN9274: mesh support ath11k - firmware-2.bin container file format support * tag 'wireless-next-2023-10-26' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (155 commits) wifi: ray_cs: Remove unnecessary (void*) conversions Revert "wifi: ath11k: call ath11k_mac_fils_discovery() without condition" wifi: ath12k: Introduce and use ath12k_sta_to_arsta() wifi: ath12k: fix htt mlo-offset event locking wifi: ath12k: fix dfs-radar and temperature event locking wifi: ath11k: fix gtk offload status event locking wifi: ath11k: fix htt pktlog locking wifi: ath11k: fix dfs radar event locking wifi: ath11k: fix temperature event locking wifi: ath12k: rename the sc naming convention to ab wifi: ath12k: rename the wmi_sc naming convention to wmi_ab wifi: ath11k: add firmware-2.bin support wifi: ath11k: qmi: refactor ath11k_qmi_m3_load() wifi: rtw89: cleanup firmware elements parsing wifi: rt2x00: rework MT7620 PA/LNA RF calibration wifi: rt2x00: rework MT7620 channel config function wifi: rt2x00: improve MT7620 register initialization MAINTAINERS: wifi: rt2x00: drop Helmut Schaa wifi: wlcore: main: replace deprecated strncpy with strscpy wifi: wlcore: boot: replace deprecated strncpy with strscpy ... ==================== Link: https://lore.kernel.org/r/20231026090411.B2426C433CB@smtp.kernel.org Signed-off-by: Jakub Kicinski commit c6f9b7138bf5c6b826175c9e0ad5f5dbfff4fa36 Merge: cc33a80b81640 ea41b880cc85f Author: Jakub Kicinski Date: Thu Oct 26 20:02:40 2023 -0700 Merge tag 'for-netdev' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2023-10-26 We've added 51 non-merge commits during the last 10 day(s) which contain a total of 75 files changed, 5037 insertions(+), 200 deletions(-). The main changes are: 1) Add open-coded task, css_task and css iterator support. One of the use cases is customizable OOM victim selection via BPF, from Chuyi Zhou. 2) Fix BPF verifier's iterator convergence logic to use exact states comparison for convergence checks, from Eduard Zingerman, Andrii Nakryiko and Alexei Starovoitov. 3) Add BPF programmable net device where bpf_mprog defines the logic of its xmit routine. It can operate in L3 and L2 mode, from Daniel Borkmann and Nikolay Aleksandrov. 4) Batch of fixes for BPF per-CPU kptr and re-enable unit_size checking for global per-CPU allocator, from Hou Tao. 5) Fix libbpf which eagerly assumed that SHT_GNU_verdef ELF section was going to be present whenever a binary has SHT_GNU_versym section, from Andrii Nakryiko. 6) Fix BPF ringbuf correctness to fold smp_mb__before_atomic() into atomic_set_release(), from Paul E. McKenney. 7) Add a warning if NAPI callback missed xdp_do_flush() under CONFIG_DEBUG_NET which helps checking if drivers were missing the former, from Sebastian Andrzej Siewior. 8) Fix missed RCU read-lock in bpf_task_under_cgroup() which was throwing a warning under sleepable programs, from Yafang Shao. 9) Avoid unnecessary -EBUSY from htab_lock_bucket by disabling IRQ before checking map_locked, from Song Liu. 10) Make BPF CI linked_list failure test more robust, from Kumar Kartikeya Dwivedi. 11) Enable samples/bpf to be built as PIE in Fedora, from Viktor Malik. 12) Fix xsk starving when multiple xsk sockets were associated with a single xsk_buff_pool, from Albert Huang. 13) Clarify the signed modulo implementation for the BPF ISA standardization document that it uses truncated division, from Dave Thaler. 14) Improve BPF verifier's JEQ/JNE branch taken logic to also consider signed bounds knowledge, from Andrii Nakryiko. 15) Add an option to XDP selftests to use multi-buffer AF_XDP xdp_hw_metadata and mark used XDP programs as capable to use frags, from Larysa Zaremba. 16) Fix bpftool's BTF dumper wrt printing a pointer value and another one to fix struct_ops dump in an array, from Manu Bretelle. * tag 'for-netdev' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (51 commits) netkit: Remove explicit active/peer ptr initialization selftests/bpf: Fix selftests broken by mitigations=off samples/bpf: Allow building with custom bpftool samples/bpf: Fix passing LDFLAGS to libbpf samples/bpf: Allow building with custom CFLAGS/LDFLAGS bpf: Add more WARN_ON_ONCE checks for mismatched alloc and free selftests/bpf: Add selftests for netkit selftests/bpf: Add netlink helper library bpftool: Extend net dump with netkit progs bpftool: Implement link show support for netkit libbpf: Add link-based API for netkit tools: Sync if_link uapi header netkit, bpf: Add bpf programmable net device bpf: Improve JEQ/JNE branch taken logic bpf: Fold smp_mb__before_atomic() into atomic_set_release() bpf: Fix unnecessary -EBUSY from htab_lock_bucket xsk: Avoid starving the xsk further down the list bpf: print full verifier states on infinite loop detection selftests/bpf: test if state loops are detected in a tricky case bpf: correct loop detection for iterators convergence ... ==================== Link: https://lore.kernel.org/r/20231026150509.2824-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit cc33a80b816406f900a53c7f98a50f6eacdd2e31 Author: Alexey Makhalov Date: Wed Oct 25 16:19:31 2023 -0700 MAINTAINERS: Maintainer change for ptp_vmw driver Deep has decided to transfer the maintainership of the VMware virtual PTP clock driver (ptp_vmw) to Jeff. Update the MAINTAINERS file to reflect this change. Signed-off-by: Alexey Makhalov Acked-by: Deep Shah Acked-by: Jeff Sipek Link: https://lore.kernel.org/r/20231025231931.76842-1-amakhalov@vmware.com Signed-off-by: Jakub Kicinski commit 9cfe8cf5027bf4354e752d40c784219225f74004 Author: Michael Chan Date: Wed Oct 25 18:32:31 2023 -0700 bnxt_en: Fix 2 stray ethtool -S counters The recent firmware interface change has added 2 counters in struct rx_port_stats_ext. This caused 2 stray ethtool counters to be displayed. Since new counters are added from time to time, fix it so that the ethtool logic will only display up to the maximum known counters. These 2 counters are not used by production firmware yet. Fixes: 754fbf604ff6 ("bnxt_en: Update firmware interface to 1.10.2.171") Reviewed-by: Ajit Khaparde Signed-off-by: Michael Chan Link: https://lore.kernel.org/r/20231026013231.53271-1-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit eb9df668381d350e462fdf840907388e0a9b80fe Author: Jakub Kicinski Date: Wed Oct 25 11:27:39 2023 -0700 tools: ynl-gen: respect attr-cnt-name at the attr set level Davide reports that we look for the attr-cnt-name in the wrong object. We try to read it from the family, but the schema only allows for it to exist at attr-set level. Reported-by: Davide Caratti Link: https://lore.kernel.org/all/CAKa-r6vCj+gPEUKpv7AsXqM77N6pB0evuh7myHq=585RA3oD5g@mail.gmail.com/ Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231025182739.184706-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit bc30bb88ff3153fba7693557d15733179adf7492 Author: Jakub Kicinski Date: Wed Oct 25 09:22:53 2023 -0700 netlink: specs: support conditional operations Page pool code is compiled conditionally, but the operations are part of the shared netlink family. We can handle this by reporting empty list of pools or -EOPNOTSUPP / -ENOSYS but the cleanest way seems to be removing the ops completely at compilation time. That way user can see that the page pool ops are not present using genetlink introspection. Same way they'd check if the kernel is "new enough" to support the ops. Extend the specs with the ability to specify the config condition under which op (and its policies, etc.) should be hidden. Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231025162253.133159-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit ea23fbd2a8f7dadfa9cd9b9d73f3b8a69eec0671 Author: Jakub Kicinski Date: Wed Oct 25 09:22:04 2023 -0700 netlink: make range pointers in policies const struct nla_policy is usually constant itself, but unless we make the ranges inside constant we won't be able to make range structs const. The ranges are not modified by the core. Reviewed-by: Johannes Berg Reviewed-by: David Ahern Reviewed-by: Nikolay Aleksandrov Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231025162204.132528-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit e2ae32d8c2a303af58d22ee61b3b7aa7021e54c9 Author: James Zhu Date: Thu Sep 7 10:41:00 2023 -0400 drm/amdxcp: fix amdxcp unloads incompletely amdxcp unloads incompletely, and below error will be seen during load/unload, sysfs: cannot create duplicate filename '/devices/platform/amdgpu_xcp.0' devres_release_group will free xcp device at first, platform device will be unregistered later in platform_device_unregister. Signed-off-by: James Zhu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit f0b8f65b482548c9d1d87c20fa4850c61305ff47 Author: Li Ma Date: Tue Oct 24 18:28:24 2023 +0800 drm/amd/amdgpu: fix the GPU power print error in pm info Modify the print format of the fractional part to avoid display error. Signed-off-by: Li Ma Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit d055714a21cc0287c7e1b15c355795c42fb3a5cf Author: Lijo Lazar Date: Thu Oct 19 12:49:57 2023 +0530 drm/amdgpu: Use pcie domain of xcc acpi objects PCI domain/segment information of xccs is available through ACPI DSM methods. Consider that also while looking for devices. Signed-off-by: Lijo Lazar Reviewed-by: Rajneesh Bhardwaj Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 406e8845356d18bdf3d3a23b347faf67706472ec Author: Lin.Cao Date: Wed Oct 25 11:32:41 2023 +0800 drm/amd: check num of link levels when update pcie param In SR-IOV environment, the value of pcie_table->num_of_link_levels will be 0, and num_of_levels - 1 will cause array index out of bounds Signed-off-by: Lin.Cao Acked-by: Jingwen Chen Signed-off-by: Alex Deucher commit 3f69d5860f5beeb7714922b0c4a653db7d667190 Author: Lijo Lazar Date: Fri Oct 20 12:23:37 2023 +0530 drm/amdgpu: Add a read to GFX v9.4.3 ring test Issue a read to confirm the register write before ringing doorbell. With multiple XCCs there is chance for race condition. Signed-off-by: Lijo Lazar Acked-by: Hawking Zhang Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit 5bd8e05fe203aa33721cf301a6883b28493f73ab Author: Yifan Zhang Date: Tue Oct 24 21:16:26 2023 +0800 drm/amd/pm: call smu_cmn_get_smc_version in is_mode1_reset_supported. is_mode1_reset_supported may be called before smu init, when smu_context is unitialized in driver load/unload test. Call smu_cmn_get_smc_version explicitly in is_mode1_reset_supported. v2: apply to aldebaran in case is_mode1_reset_supported will be uncommented (Candice Li) Fixes: 710d9caec70c ("drm/amd/pm: drop most smu_cmn_get_smc_version in smu") Signed-off-by: Yifan Zhang Reviewed-by: Candice Li Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 2cea7bb9110d3c52e55977824f79875777b574b4 Author: Tao Zhou Date: Mon Sep 11 18:05:22 2023 +0800 drm/amdgpu: get RAS poison status from DF v4_6_2 Add DF block and RAS poison mode query for DF v4_6_2. Signed-off-by: Tao Zhou Reviewed-by: Stanley.Yang Acked-by: Hawking Zhang Signed-off-by: Alex Deucher commit dd2687f5d9b2cf950fbe17fbc7c4f64489b19cd6 Author: Lijo Lazar Date: Thu Oct 12 15:09:38 2023 +0530 drm/amdgpu: Use discovery table's subrevision Use subrevision of IP version in discovery table to identify SOC revision id for NBIO v7.9 SOCs. Only newer bootloaders update subrevision field. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit ae8cffe353b510d0bbb12488f7ed0ea01ace4823 Author: Aric Cyr Date: Mon Oct 9 13:11:32 2023 -0400 drm/amd/display: 3.2.256 DC v3.2.256 Summary: * Fixes null-deref regression after "drm/amd/display: Update OPP counter from new interface" * Fixes display flashing when VSR and HDR enabled on dcn32 * Fixes dcn3x intermittent hangs due to FPO * Fixes MST Multi-Stream light up on dcn35 * Fixes green screen on DCN31x when DVI and HDMI monitors attached * Adds DML2 improvements * Adds idle power optimization improvements * Accommodates panels with lower nit backlight * Updates SDP VSC colorimetry from DP test automation request * Reverts "drm/amd/display: allow edp updates for virtual signal" Acked-by: Roman Li Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 670da29faf5ff160043a1f02e6ac2ed8345b5d7e Author: Aurabindo Pillai Date: Tue Oct 10 16:32:23 2023 -0400 drm/amd/display: add interface to query SubVP status [Why&How] To enable automated testing through IGT, expose an API that is accessible through debugfs to query current status of SubVP feature. Reviewed-by: Alvin Lee Acked-by: Roman Li Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b231933da7d6be53d08139f8adf2560a90b47ca9 Author: Iswara Nagulendran Date: Fri Sep 29 11:20:46 2023 -0400 drm/amd/display: Read before writing Backlight Mode Set Register [HOW&WHY] Reading the value from DP_EDP_BACKLIGHT_MODE_SET_REGISTER, DPCD 0x721 before setting the BP_EDP_PANEL_LUMINANC_CONTROL_ENABLE bit to ensure there are no accidental overwrites. Reviewed-by: Sreeja Golui Reviewed-by: Harry Vanzylldejong Acked-by: Roman Li Signed-off-by: Iswara Nagulendran Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1b9ec7cb424441de67d09c3abad46467f82ff161 Author: Michael Strauss Date: Tue Oct 10 10:47:55 2023 -0400 drm/amd/display: Disable SYMCLK32_SE RCO on DCN314 [WHY] Currently causes some DP link layer failures, backing out until the failures are root caused. Reviewed-by: Nicholas Kazlauskas Acked-by: Roman Li Signed-off-by: Michael Strauss Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 85ca6e85303c10019710f31d4abedafab7994d68 Author: Ilya Bakoulin Date: Fri Oct 6 15:57:28 2023 -0400 drm/amd/display: Fix shaper using bad LUT params [Why] LUT params are not cleared after setting blend TF, which can lead to same params being used for the shaper, if the shaper func is bypassed. [How] Set lut_params to NULL after program_1dlut. Reviewed-by: Krunoslav Kovac Acked-by: Roman Li Signed-off-by: Ilya Bakoulin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8d0f4cd2ae44ebe50ff85a49fb248e64f28b6d66 Author: Samson Tam Date: Fri Oct 6 17:36:16 2023 -0400 drm/amd/display: add null check for invalid opps [Why] In cases where number of pipes available is less than num_opp, there will opp instances that are null [How] Add null check to skip over these opp instances Fixes: 40de8403b998 ("drm/amd/display: Update OPP counter from new interface") Reviewed-by: Alvin Lee Acked-by: Roman Li Signed-off-by: Samson Tam Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f583db812bc9a97384303761932768e44d1d92a3 Author: Alvin Lee Date: Fri Oct 6 18:01:24 2023 -0400 drm/amd/display: Update FAMS sequence for DCN30 & DCN32 Provide DCN32 specific sequence and update DCN30 sequence Reviewed-by: Samson Tam Acked-by: Roman Li Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 79f3f1b66753b3a3a269d73676bf50987921f267 Author: Samson Tam Date: Thu Oct 5 01:31:12 2023 -0400 drm/amd/display: fix num_ways overflow error [Why] Helper function calculates num_ways using 32-bit. But is returned as 8-bit. If num_ways exceeds 8-bit, then it reports back the incorrect num_ways and erroneously uses MALL when it should not [How] Make returned value 32-bit and convert after it checks against caps.cache_num_ways, which is under 8-bit Reviewed-by: Alvin Lee Acked-by: Roman Li Signed-off-by: Samson Tam Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c4066d8be4d8c7c01d74ba1872cab2bc589d4912 Author: Rodrigo Siqueira Date: Thu Oct 5 10:41:33 2023 -0600 drm/amd/display: Add prefix for plane functions This commit adds the amdgpu_dm_plane_ prefix for all functions in the amdgpu_dm_plane.c. This change enables an easy way to filter code paths via ftrace. Reviewed-by: Aurabindo Pillai Acked-by: Roman Li Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6ce4f9ee25ffc1f6be693a103c37d6d47edb0f0d Author: Rodrigo Siqueira Date: Thu Oct 5 08:27:45 2023 -0600 drm/amd/display: Add prefix to amdgpu crtc functions The ftrace debug feature allows filtering functions based on a prefix, which can be helpful in some complex debug scenarios. The driver can benefit more from this feature if the function name follows some patterns; for this reason, this commit adds the prefix amdgpu_dm_crtc_ to all the functions that do not have it in the amdgpu_dm_crtc.c file. Reviewed-by: Aurabindo Pillai Acked-by: Roman Li Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0d93f39516b0608384317923f9feda6d1ae210fb Author: Rodrigo Siqueira Date: Thu Oct 5 10:58:51 2023 -0600 drm/amd/display: Correct enum typo This commit just replaces dc_interrupt_po*r*larity with its correct name, which is dc_interrupt_polarity. Reviewed-by: Aurabindo Pillai Acked-by: Roman Li Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit fc0479ac5dd9ac48673ade462622a4efbda30223 Author: Alex Hung Date: Tue Oct 3 15:25:30 2023 -0600 drm/amd/display: Set emulated sink type to HDMI accordingly. [WHY & HOW] Virtual sink is not audio-capable and this causes kms_hdmi_inject's inject-audio to fail. Set it to HDMI according to EDID. Reviewed-by: Chao-kai Wang Acked-by: Roman Li Signed-off-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0604ffead6e5927d2e70698df6bcb1c68690ad0e Author: Alex Hung Date: Tue Oct 3 09:48:11 2023 -0600 drm/amd/display: Revert "drm/amd/display: allow edp updates for virtual signal" This reverts commit 4ad3ee5ccc77aa3f9d702f7b9ad4d9cfeca6c443. [WHY & HOW] Virtual signal is not supported as audio capable by DC. Reviewed-by: Chao-kai Wang Acked-by: Roman Li Signed-off-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2a6a491dfc0073b2bd28a69d1270c5bb8d3fc33a Author: Sung Joon Kim Date: Thu Oct 5 14:56:24 2023 -0400 drm/amd/display: Fix HDMI framepack 3D test issue [why] Bandwidth validation failure on framepack tests. Need to double pixel clock when 3D format is framepack. Also for HDMI displays, we need to keep the ITC flag to 1 by default. [how] Double the pixel clock when using framepack 3D format. Set hdmi ITC bit to 1. Reviewed-by: Charlene Liu Acked-by: Roman Li Signed-off-by: Sung Joon Kim Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit da2d16fcdda344b18ec9a4a55dff9805d5d781d2 Author: Nicholas Kazlauskas Date: Thu Oct 5 11:48:44 2023 -0400 drm/amd/display: Fix IPS handshake for idle optimizations [Why] Intermittent reboot hangs are observed introduced by "Improve x86 and dmub ips handshake". [How] Bring back the commit but fix the polling. Avoid hanging in place forever by bounding the delay and ensure that we still message DMCUB on IPS2 exit to notify driver idle has been cleared. Reviewed-by: Duncan Ma Reviewed-by: Jun Lei Acked-by: Roman Li Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 488bb99d42e607a40524ee1514b0b1246b1f69c8 Author: Wenjing Liu Date: Wed Oct 4 14:30:30 2023 -0400 drm/amd/display: implement map dc pipe with callback in DML2 [why] Unify pipe resource management logic in dc resource layer. V2: Add default case for switch. CC: Hamza Mahfooz Reviewed-by: Chaitanya Dhere Signed-off-by: Wenjing Liu Reviewed-by: Rodrigo Siqueira Reviewed-by: Jun Lei Acked-by: Roman Li Signed-off-by: Qingqing Zhuo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2c071cae6bb0f942136a530039faaa707c48893c Author: Wenjing Liu Date: Wed Oct 4 12:12:57 2023 -0400 drm/amd/display: add pipe resource management callbacks to DML2 [why] Need DML2 to support new pipe resource management APIs. Reviewed-by: Chaitanya Dhere Acked-by: Roman Li Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5edb7cdff85af8f8c5fda5b88310535ab823f663 Author: Swapnil Patel Date: Wed Oct 4 15:58:57 2023 -0400 drm/amd/display: Reduce default backlight min from 5 nits to 1 nits [Why & How] Currently set_default_brightness_aux function uses 5 nits as lower limit to check for valid default_backlight setting. However some newer panels can support even lower default settings Reviewed-by: Agustin Gutierrez Acked-by: Roman Li Signed-off-by: Swapnil Patel Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a67f7a0b18c09d5b62eafb6d5c2f54e6f6ea6cf1 Author: George Shen Date: Mon Oct 2 15:31:16 2023 -0400 drm/amd/display: Update SDP VSC colorimetry from DP test automation request [Why] Certain test equipment vendors check the SDP VSC for colorimetry against the value from the test request during certain DP link layer tests for YCbCr test cases. [How] Update SDP VSC with colorimetry from test automation request. Reviewed-by: Wenjing Liu Acked-by: Roman Li Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d591284288c29f04e52ae4f3d605e2f39c3e316c Author: Sung Joon Kim Date: Fri Sep 29 12:12:47 2023 -0400 drm/amd/display: Add a check for idle power optimization [why] Need a helper function to check idle power is allowed so that dc doesn't access any registers that are power-gated. [how] Implement helper function to check idle power optimization. Enable a hook to check if detection is allowed. V2: Add function hooks for set and get idle states. Check if function hook was properly initialized. Reviewed-by: Aric Cyr Reviewed-by: Nicholas Choi Acked-by: Roman Li Signed-off-by: Sung Joon Kim Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d5f9a92bd1e234b8a7cf6f350b5bc0169221ae59 Author: Nicholas Kazlauskas Date: Tue Oct 3 12:18:44 2023 -0400 drm/amd/display: Revert "Improve x86 and dmub ips handshake" This reverts commit 1288d702080949f87688d49dfeeacc99f40adc9b. Causes intermittent hangs during reboot stress testing. Reviewed-by: Duncan Ma Acked-by: Roman Li Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 543068f0e3721e1cbd6cee48c17f277950f59670 Author: Fangzhi Zuo Date: Mon Oct 2 16:38:02 2023 -0400 drm/amd/display: Fix MST Multi-Stream Not Lighting Up on dcn35 dcn35 misses .enable_symclk_se hook that makes MST DSC not functional when having multiple FE clk to be enabled. Reviewed-by: Rodrigo Siqueira Acked-by: Roman Li Signed-off-by: Fangzhi Zuo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5af8d8ce643478d754ef72fc239466f6ad0e2562 Author: Przemek Kitszel Date: Wed Oct 25 16:50:50 2023 +0200 net/mlx5: fix uninit value use Avoid use of uninitialized state variable. In case of mlx5e_tx_reporter_build_diagnose_output_sq_common() it's better to still collect other data than bail out entirely. Reported-by: Dan Carpenter Link: https://lore.kernel.org/netdev/8bd30131-c9f2-4075-a575-7fa2793a1760@moroto.mountain Fixes: d17f98bf7cc9 ("net/mlx5: devlink health: use retained error fmsg API") Signed-off-by: Przemek Kitszel Reviewed-by: Michal Swiatkowski Link: https://lore.kernel.org/r/20231025145050.36114-1-przemyslaw.kitszel@intel.com Signed-off-by: Jakub Kicinski commit 2757a848cb0f184850d3e0a33b4a69e8014fdc5d Author: Mario Limonciello Date: Mon Oct 23 15:50:05 2023 -0500 drm/amd: Explicitly disable ASPM when dynamic switching disabled Currently there are separate but related checks: * amdgpu_device_should_use_aspm() * amdgpu_device_aspm_support_quirk() * amdgpu_device_pcie_dynamic_switching_supported() Simplify into checking whether DPM was enabled or not in the auto case. This works because amdgpu_device_pcie_dynamic_switching_supported() populates that value. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 1a6513de493d13f8d7501611fcc5bbaea4c799b3 Author: Mario Limonciello Date: Mon Oct 23 15:47:43 2023 -0500 drm/amd: Move AMD_IS_APU check for ASPM into top level function There is no need for every ASIC driver to perform the same check. Move the duplicated code into amdgpu_device_should_use_aspm(). Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit fbf1035b033a51eee48d5f42e781b02fff272ca0 Author: Mario Limonciello Date: Mon Oct 23 15:42:00 2023 -0500 drm/amd: Disable PP_PCIE_DPM_MASK when dynamic speed switching not supported Rather than individual ASICs checking for the quirk, set the quirk at the driver level. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 541c341d2ee351f8deabef467dab4ba68bfb024f Author: Philip Yang Date: Mon Oct 23 16:08:34 2023 -0400 Revert "drm/amdkfd: Use partial migrations in GPU page faults" This reverts commit dc427a473e5d119232ddb27530920d9796cdea70. The change prevents migrating the entire range to VRAM because retry fault restore_pages map the remaining system memory range to GPUs. It will work correctly to submit together with partial mapping to GPU patch later. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit afaec204d2912305d907abeac14c640f1cad2592 Author: Philip Yang Date: Mon Oct 23 16:05:24 2023 -0400 Revert "drm/amdkfd:remove unused code" This reverts commit f9caf6cdd5cc1f4006fd7b6b113658c0b0159f23. Needed for the next revert patch. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 78964fcac47fc1525ecb4c37cd5fbc873c28320b Author: Stylon Wang Date: Thu Oct 19 22:49:15 2023 +0800 drm/amd/display: Fix copyright notice in DC code [Why & How] Fix incomplete copyright notice in DC code. Reviewed-by: Harry Wentland Signed-off-by: Stylon Wang Signed-off-by: Alex Deucher commit d30a584cd70ebc5a8be3bd38ea1f184018bff151 Author: Stylon Wang Date: Thu Oct 19 22:46:51 2023 +0800 drm/amd/display: Fix copyright notice in DML2 code [Why & How] Fix incomplete copyright notice in DML2 code. Reviewed-by: Harry Wentland Signed-off-by: Stylon Wang Signed-off-by: Alex Deucher commit b258a4d5b383f0c087dd231dee2662126f3d0d83 Author: Stylon Wang Date: Thu Oct 19 22:43:05 2023 +0800 drm/amd/display: Add missing copyright notice in DMUB [Why & How] Add missing/incomplete copyright notice in DMUB files Reviewed-by: Harry Wentland Signed-off-by: Stylon Wang Signed-off-by: Alex Deucher commit 9ee819285c2c13fb9283c4cf8b1b9b69fbba986f Author: Lin.Cao Date: Wed Oct 18 10:15:06 2023 +0800 drm/amdgpu remove restriction of sriov max_pfn on Vega10 Remove restriction of sriov max_pfn so that TBA and TMA can move to high 47 bits address. Regression test: change range alloc flag of libdrm as AMDGPU_VA_RANGE_HIGH and there is no flr occur when testing amdgpu_test of drm. Signed-off-by: Lin.Cao Acked-by: Christian König Signed-off-by: Alex Deucher commit 0300882ed6238bfd6343bbd06eb776eb65dedece Author: Srinivasan Shanmugam Date: Mon Oct 23 21:35:30 2023 +0530 drm/amdkfd: Address 'remap_list' not described in 'svm_range_add' Fixes the below: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:2073: warning: Function parameter or member 'remap_list' not described in 'svm_range_add' Cc: Felix Kuehling Cc: Christian König Cc: Alex Deucher Cc: "Pan, Xinhui" Signed-off-by: Srinivasan Shanmugam Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 5104fdf50d326db2c1a994f8b35dcd46e63ae4ad Author: Qu Huang Date: Mon Oct 23 12:56:37 2023 +0000 drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL In certain types of chips, such as VEGA20, reading the amdgpu_regs_smc file could result in an abnormal null pointer access when the smc_rreg pointer is NULL. Below are the steps to reproduce this issue and the corresponding exception log: 1. Navigate to the directory: /sys/kernel/debug/dri/0 2. Execute command: cat amdgpu_regs_smc 3. Exception Log:: [4005007.702554] BUG: kernel NULL pointer dereference, address: 0000000000000000 [4005007.702562] #PF: supervisor instruction fetch in kernel mode [4005007.702567] #PF: error_code(0x0010) - not-present page [4005007.702570] PGD 0 P4D 0 [4005007.702576] Oops: 0010 [#1] SMP NOPTI [4005007.702581] CPU: 4 PID: 62563 Comm: cat Tainted: G OE 5.15.0-43-generic #46-Ubunt u [4005007.702590] RIP: 0010:0x0 [4005007.702598] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6. [4005007.702600] RSP: 0018:ffffa82b46d27da0 EFLAGS: 00010206 [4005007.702605] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffa82b46d27e68 [4005007.702609] RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff9940656e0000 [4005007.702612] RBP: ffffa82b46d27dd8 R08: 0000000000000000 R09: ffff994060c07980 [4005007.702615] R10: 0000000000020000 R11: 0000000000000000 R12: 00007f5e06753000 [4005007.702618] R13: ffff9940656e0000 R14: ffffa82b46d27e68 R15: 00007f5e06753000 [4005007.702622] FS: 00007f5e0755b740(0000) GS:ffff99479d300000(0000) knlGS:0000000000000000 [4005007.702626] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [4005007.702629] CR2: ffffffffffffffd6 CR3: 00000003253fc000 CR4: 00000000003506e0 [4005007.702633] Call Trace: [4005007.702636] [4005007.702640] amdgpu_debugfs_regs_smc_read+0xb0/0x120 [amdgpu] [4005007.703002] full_proxy_read+0x5c/0x80 [4005007.703011] vfs_read+0x9f/0x1a0 [4005007.703019] ksys_read+0x67/0xe0 [4005007.703023] __x64_sys_read+0x19/0x20 [4005007.703028] do_syscall_64+0x5c/0xc0 [4005007.703034] ? do_user_addr_fault+0x1e3/0x670 [4005007.703040] ? exit_to_user_mode_prepare+0x37/0xb0 [4005007.703047] ? irqentry_exit_to_user_mode+0x9/0x20 [4005007.703052] ? irqentry_exit+0x19/0x30 [4005007.703057] ? exc_page_fault+0x89/0x160 [4005007.703062] ? asm_exc_page_fault+0x8/0x30 [4005007.703068] entry_SYSCALL_64_after_hwframe+0x44/0xae [4005007.703075] RIP: 0033:0x7f5e07672992 [4005007.703079] Code: c0 e9 b2 fe ff ff 50 48 8d 3d fa b2 0c 00 e8 c5 1d 02 00 0f 1f 44 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 0f 05 <48> 3d 00 f0 ff ff 77 56 c3 0f 1f 44 00 00 48 83 e c 28 48 89 54 24 [4005007.703083] RSP: 002b:00007ffe03097898 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 [4005007.703088] RAX: ffffffffffffffda RBX: 0000000000020000 RCX: 00007f5e07672992 [4005007.703091] RDX: 0000000000020000 RSI: 00007f5e06753000 RDI: 0000000000000003 [4005007.703094] RBP: 00007f5e06753000 R08: 00007f5e06752010 R09: 00007f5e06752010 [4005007.703096] R10: 0000000000000022 R11: 0000000000000246 R12: 0000000000022000 [4005007.703099] R13: 0000000000000003 R14: 0000000000020000 R15: 0000000000020000 [4005007.703105] [4005007.703107] Modules linked in: nf_tables libcrc32c nfnetlink algif_hash af_alg binfmt_misc nls_ iso8859_1 ipmi_ssif ast intel_rapl_msr intel_rapl_common drm_vram_helper drm_ttm_helper amd64_edac t tm edac_mce_amd kvm_amd ccp mac_hid k10temp kvm acpi_ipmi ipmi_si rapl sch_fq_codel ipmi_devintf ipm i_msghandler msr parport_pc ppdev lp parport mtd pstore_blk efi_pstore ramoops pstore_zone reed_solo mon ip_tables x_tables autofs4 ib_uverbs ib_core amdgpu(OE) amddrm_ttm_helper(OE) amdttm(OE) iommu_v 2 amd_sched(OE) amdkcl(OE) drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops cec rc_core drm igb ahci xhci_pci libahci i2c_piix4 i2c_algo_bit xhci_pci_renesas dca [4005007.703184] CR2: 0000000000000000 [4005007.703188] ---[ end trace ac65a538d240da39 ]--- [4005007.800865] RIP: 0010:0x0 [4005007.800871] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6. [4005007.800874] RSP: 0018:ffffa82b46d27da0 EFLAGS: 00010206 [4005007.800878] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffa82b46d27e68 [4005007.800881] RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff9940656e0000 [4005007.800883] RBP: ffffa82b46d27dd8 R08: 0000000000000000 R09: ffff994060c07980 [4005007.800886] R10: 0000000000020000 R11: 0000000000000000 R12: 00007f5e06753000 [4005007.800888] R13: ffff9940656e0000 R14: ffffa82b46d27e68 R15: 00007f5e06753000 [4005007.800891] FS: 00007f5e0755b740(0000) GS:ffff99479d300000(0000) knlGS:0000000000000000 [4005007.800895] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [4005007.800898] CR2: ffffffffffffffd6 CR3: 00000003253fc000 CR4: 00000000003506e0 Signed-off-by: Qu Huang Signed-off-by: Alex Deucher commit 73582be11ac8f6d6765e185bf48f22efb9d28c3b Author: Tao Zhou Date: Thu Oct 12 14:33:37 2023 +0800 drm/amdgpu: bypass RAS error reset in some conditions PMFW is responsible for RAS error reset in some conditions, driver can skip the operation. v2: add check for ras->in_recovery, it's set earlier than amdgpu_in_reset. v3: fix error in gpu reset check. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f3a3bbf1566c7b6b0f9ac36e8e597c73dc0afdf8 Author: Tao Zhou Date: Fri Oct 20 17:21:58 2023 +0800 drm/amdgpu: enable RAS poison mode for APU Enable it by default on APU platform. Signed-off-by: Tao Zhou Reviewed-by: Stanley.Yang Signed-off-by: Alex Deucher commit fc4981b69c59b8c8ddedf0df47520cb592894c03 Author: Lang Yu Date: Mon Oct 23 17:04:19 2023 +0800 drm/amdgpu/vpe: correct queue stop programing Otherwise IB test would fail during GPU reset. Signed-off-by: Lang Yu Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 210aa6650c10ee4aae60e7533303b7b28947c684 Author: Rodrigo Siqueira Date: Fri Oct 20 10:06:50 2023 -0600 drm/amd/display: Fix DMUB errors introduced by DML2 When DML 2 was introduced, it changed part of the generic sequence of DC, which caused issues on previous DCNs with DMUB support. This commit ensures the new sequence only works for new DCNs from 3.5 and above. Changes since V1: - Harry: Use the attribute using_dml2 instead of check the DCN version. Cc: Vitaly Prosyak Cc: Roman Li Cc: Qingqing Zhuo Cc: Daniel Wheeler Cc: Alex Deucher Tested-by: Daniel Wheeler Reviewed-by: Harry Wentland Fixes: 7966f319c66d ("drm/amd/display: Introduce DML2") Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit e5f52a84bf0a817016ecd13e320fe3c3c807a83c Author: Mario Limonciello Date: Fri Oct 20 10:26:29 2023 -0500 drm/amd: Disable ASPM for VI w/ all Intel systems Originally we were quirking ASPM disabled specifically for VI when used with Alder Lake, but it appears to have problems with Rocket Lake as well. Like we've done in the case of dpm for newer platforms, disable ASPM for all Intel systems. Cc: stable@vger.kernel.org # 5.15+ Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default") Reported-and-tested-by: Paolo Gentili Closes: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2036742 Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b0399e22ada096435de3e3e73899aa8bc026820d Author: Agustin Gutierrez Date: Mon Oct 2 10:21:08 2023 -0400 drm/amd/display: Remove power sequencing check [Why] Some ASICs keep backlight powered on after dpms off command has been issued. [How] The check for no edp power sequencing was never going to pass. The value is never changed from what it is set by design. Cc: stable@vger.kernel.org # 6.1+ Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2765 Reviewed-by: Swapnil Patel Acked-by: Roman Li Signed-off-by: Agustin Gutierrez Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 79de4d9ade7411ffdddf0b69c87020311731d155 Author: Rodrigo Siqueira Date: Fri Oct 20 15:17:09 2023 -0600 drm/amd/display: Set the DML2 attribute to false in all DCNs older than version 3.5 When DML2 was introduced, it targeted only new DCN versions. For controlling which ASIC should use this new version of DML, it was introduced the using_dml2 attribute. To avoid ambiguities, this commit explicitly sets using_dml2 to false in all ASICs that do not support DML2. Cc: Vitaly Prosyak Cc: Roman Li Cc: Qingqing Zhuo Cc: Daniel Wheeler Cc: Alex Deucher Reviewed-by: Harry Wentland Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit d8da213478bcd0b2dde7a4591a0a6924a97592c7 Author: Ma Jun Date: Wed Oct 18 15:17:40 2023 +0800 drm/amd/pm: Fix the return value in default case Fix the return value in default case and drop redundant 'break'. Signed-off-by: Ma Jun Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit 8eece69acee335580449ced3356f150610916fba Author: Lijo Lazar Date: Thu Oct 12 15:07:41 2023 +0530 drm/amdgpu: Add API to get full IP version Fetch the full version of IP including variant and subrevision. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 037fb9c600240fd4e7e525c7e08e42645a44b2f7 Author: Jiadong Zhu Date: Wed Sep 6 08:58:02 2023 +0800 drm/amdgpu: add tmz support for GC IP v11.5.0 Add tmz support for GC 11.5.0. Signed-off-by: Jiadong Zhu Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit af0b7df70b4738f89061a8084015f7f93078bb71 Author: Jiadong Zhu Date: Wed Aug 30 16:36:37 2023 +0800 drm/amd/pm: drop unneeded dpm features disablement for SMU 14.0.0 PMFW will handle the features disablement properly for gpu reset case, driver involvement may cause some unexpected issues. Signed-off-by: Jiadong Zhu Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 493c75bbe3a89b5b178e61ef80f185a9614cbfaf Author: Li Ma Date: Wed Oct 18 13:34:29 2023 +0800 drm/amdgpu: modify if condition in nbio_v7_7.c remove unnecessary "enable" in if condition. Signed-off-by: Li Ma Reviewed-by: Tim Huang Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 282c1d793076c2edac6c3db51b7e8ed2b41d60a5 Author: Jesse Zhang Date: Fri Oct 20 09:43:51 2023 +0800 drm/amdkfd: Fix shift out-of-bounds issue [ 567.613292] shift exponent 255 is too large for 64-bit type 'long unsigned int' [ 567.614498] CPU: 5 PID: 238 Comm: kworker/5:1 Tainted: G OE 6.2.0-34-generic #34~22.04.1-Ubuntu [ 567.614502] Hardware name: AMD Splinter/Splinter-RPL, BIOS WS43927N_871 09/25/2023 [ 567.614504] Workqueue: events send_exception_work_handler [amdgpu] [ 567.614748] Call Trace: [ 567.614750] [ 567.614753] dump_stack_lvl+0x48/0x70 [ 567.614761] dump_stack+0x10/0x20 [ 567.614763] __ubsan_handle_shift_out_of_bounds+0x156/0x310 [ 567.614769] ? srso_alias_return_thunk+0x5/0x7f [ 567.614773] ? update_sd_lb_stats.constprop.0+0xf2/0x3c0 [ 567.614780] svm_range_split_by_granularity.cold+0x2b/0x34 [amdgpu] [ 567.615047] ? srso_alias_return_thunk+0x5/0x7f [ 567.615052] svm_migrate_to_ram+0x185/0x4d0 [amdgpu] [ 567.615286] do_swap_page+0x7b6/0xa30 [ 567.615291] ? srso_alias_return_thunk+0x5/0x7f [ 567.615294] ? __free_pages+0x119/0x130 [ 567.615299] handle_pte_fault+0x227/0x280 [ 567.615303] __handle_mm_fault+0x3c0/0x720 [ 567.615311] handle_mm_fault+0x119/0x330 [ 567.615314] ? lock_mm_and_find_vma+0x44/0x250 [ 567.615318] do_user_addr_fault+0x1a9/0x640 [ 567.615323] exc_page_fault+0x81/0x1b0 [ 567.615328] asm_exc_page_fault+0x27/0x30 [ 567.615332] RIP: 0010:__get_user_8+0x1c/0x30 Signed-off-by: Jesse Zhang Suggested-by: Philip Yang Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit ec3e0a9167e2cc97a9b12d9f2a619afd78b77223 Author: Yang Wang Date: Thu Oct 19 18:16:14 2023 +0800 drm/amdgpu: refine ras error kernel log print refine ras error kernel log to avoid user-ridden ambiguity. Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 53d4d7792757d195979a630a6402f272d3fd2a47 Author: Yang Wang Date: Fri Oct 20 10:12:07 2023 +0800 drm/amdgpu: fix find ras error node error the origin function might return the wrong node. Fixes: 5b1270beb380 ("drm/amdgpu: add ras_err_info to identify RAS error source") Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bf795156105150a7a242389c56fca382ddc984c5 Author: Hugo Hu Date: Tue Aug 22 17:01:39 2023 +0800 drm/amd/display: reprogram det size while seamless boot [Why] During system boot in second screen only mode on a seamless boot system, there is a chance that the pipe's det size might not be reset. [How] Reset the det size while resetting the pipe during seamless boot. Reviewed-by: Dmytro Laktyushkin Acked-by: Roman Li Signed-off-by: Hugo Hu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4dd9f5404c7180f573b911f034df1a144abb78be Author: Tao Zhou Date: Thu Oct 12 11:24:10 2023 +0800 drm/amd/pm: record mca debug mode in RAS Call amdgpu_ras_set_mca_debug_mode when we set mca debug mode in smu v13_0_6. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5258dfd4a6adb5f45f046b0dd2e73c680f880d9d Author: Dave Airlie Date: Fri Oct 27 07:53:50 2023 +1000 usb: typec: altmodes/displayport: fixup drm internal api change vs new user. usb: typec: altmodes/displayport: Signal hpd low when exiting mode and drm: Add HPD state to drm_connector_oob_hotplug_event() sideswiped each other. Signal disconnected always. Signed-off-by: Dave Airlie commit ec4c20ca09831ddba8fac10a7d82a9902e96e717 Merge: ef113733c288e c17cda15cc86e Author: Jakub Kicinski Date: Thu Oct 26 13:42:19 2023 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. Conflicts: net/mac80211/rx.c 91535613b609 ("wifi: mac80211: don't drop all unprotected public action frames") 6c02fab72429 ("wifi: mac80211: split ieee80211_drop_unencrypted_mgmt() return value") Adjacent changes: drivers/net/ethernet/apm/xgene/xgene_enet_main.c 61471264c018 ("net: ethernet: apm: Convert to platform remove callback returning void") d2ca43f30611 ("net: xgene: Fix unused xgene_enet_of_match warning for !CONFIG_OF") net/vmw_vsock/virtio_transport.c 64c99d2d6ada ("vsock/virtio: support to send non-linear skb") 53b08c498515 ("vsock/virtio: initialize the_virtio_vsock before using VQs") Signed-off-by: Jakub Kicinski commit b827ac419721a106ae2fccaa40576b0594edad92 Author: Kent Overstreet Date: Thu Oct 26 16:37:58 2023 -0400 exportfs: Change bcachefs fid_type enum to avoid conflicts Per Amir Goldstein, the fid types that bcachefs picked conflicted with xfs and fuse, which previously were in use but not deviced in the master enum. Since bcachefs is still out of tree, we can move. https://lore.kernel.org/linux-next/20231026203733.fx65mjyic4pka3e5@moria.home.lan/T/#ma59f65ba61f605b593e69f4690dbd317526d83ba Signed-off-by: Kent Overstreet commit b70438004a14f4d0f9890b3297cd66248728546c Author: Alex Deucher Date: Wed Oct 25 13:19:28 2023 -0400 drm/amdgpu: move buffer funcs setting up a level Rather than doing this in the IP code for the SDMA paging engine, move it up to the core device level init level. This should fix the scheduler init ordering. v2: drop extra parens v3: drop SDMA helpers v4: Added a Fixes tag because amdgpu dereferences an uninitialized scheduler without this patch, and this patch fixes this. (Luben) Tested-by: Luben Tuikov Signed-off-by: Alex Deucher Link: https://lore.kernel.org/r/20231025171928.3318505-1-alexander.deucher@amd.com Acked-by: Christian König Fixes: 56e449603f0ac5 ("drm/sched: Convert the GPU scheduler to variable number of run-queues") Signed-off-by: Luben Tuikov commit c07bf1636f0005f9eb7956404490672286ea59d3 Author: Luben Tuikov Date: Thu Oct 26 12:37:30 2023 -0400 MAINTAINERS: Update the GPU Scheduler email Update the GPU Scheduler maintainer email. Cc: Alex Deucher Cc: Christian König Cc: Daniel Vetter Cc: Dave Airlie Cc: AMD Graphics Cc: Direct Rendering Infrastructure - Development Signed-off-by: Luben Tuikov Acked-by: Alex Deucher Link: https://lore.kernel.org/r/20231026174438.18427-2-ltuikov89@gmail.com commit 101c9f637efa1655f55876644d4439e552267527 Author: Erik Kurzinger Date: Wed Aug 16 09:26:05 2023 -0700 drm/syncobj: fix DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE If DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT is invoked with the DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE flag set but no fence has yet been submitted for the given timeline point the call will fail immediately with EINVAL. This does not match the intended behavior where the call should wait until the fence has been submitted (or the timeout expires). The following small example program illustrates the issue. It should wait for 5 seconds and then print ETIME, but instead it terminates right away after printing EINVAL. #include #include #include #include #include int main(void) { int fd = open("/dev/dri/card0", O_RDWR); uint32_t syncobj; drmSyncobjCreate(fd, 0, &syncobj); struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); uint64_t point = 1; if (drmSyncobjTimelineWait(fd, &syncobj, &point, 1, ts.tv_sec * 1000000000 + ts.tv_nsec + 5000000000, // 5s DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE, NULL)) { printf("drmSyncobjTimelineWait failed %d\n", errno); } } Fixes: 01d6c3578379 ("drm/syncobj: add support for timeline point wait v8") Signed-off-by: Erik Kurzinger Reviewed by: Simon Ser Signed-off-by: Simon Ser Link: https://patchwork.freedesktop.org/patch/msgid/1fac96f1-2f3f-f9f9-4eb0-340f27a8f6c0@nvidia.com commit 51442e8d64bcb7ac92d0cde5dccda0cfa94630fa Author: Konstantin Meskhidze Date: Thu Oct 26 09:47:51 2023 +0800 landlock: Document network support Describe network access rules for TCP sockets. Add network access example in the tutorial. Add kernel configuration support for network. Signed-off-by: Konstantin Meskhidze Link: https://lore.kernel.org/r/20231026014751.414649-13-konstantin.meskhidze@huawei.com [mic: Update date, and do light cosmetic changes] Signed-off-by: Mickaël Salaün commit 5e990dcef12eebf683d209bac5e14591308dc216 Author: Konstantin Meskhidze Date: Thu Oct 26 09:47:50 2023 +0800 samples/landlock: Support TCP restrictions Add TCP restrictions to the sandboxer demo. It's possible to allow a sandboxer to bind/connect to a list of specified ports restricting network actions to the rest of them. This is controlled with the new LL_TCP_BIND and LL_TCP_CONNECT environment variables. Rename ENV_PATH_TOKEN to ENV_DELIMITER. Signed-off-by: Konstantin Meskhidze Link: https://lore.kernel.org/r/20231026014751.414649-12-konstantin.meskhidze@huawei.com [mic: Extend commit message] Signed-off-by: Mickaël Salaün commit a549d055a22e4fc5559ef642b30721899fa07b75 Author: Konstantin Meskhidze Date: Thu Oct 26 09:47:49 2023 +0800 selftests/landlock: Add network tests Add 82 test suites to check edge cases related to bind() and connect() actions. They are defined with 6 fixtures and their variants: The "protocol" fixture is extended with 12 variants defined as a matrix of: sandboxed/not-sandboxed, IPv4/IPv6/unix network domain, and stream/datagram socket. 4 related tests suites are defined: * bind: Tests bind action. * connect: Tests connect action. * bind_unspec: Tests bind action with the AF_UNSPEC socket family. * connect_unspec: Tests connect action with the AF_UNSPEC socket family. The "ipv4" fixture is extended with 4 variants defined as a matrix of: sandboxed/not-sandboxed, and stream/datagram socket. 1 related test suite is defined: * from_unix_to_inet: Tests to make sure unix sockets' actions are not restricted by Landlock rules applied to TCP ones. The "tcp_layers" fixture is extended with 8 variants defined as a matrix of: IPv4/IPv6 network domain, and different number of landlock rule layers. 2 related tests suites are defined: * ruleset_overlap: Tests nested layers with less constraints. * ruleset_expand: Tests nested layers with more constraints. In the "mini" fixture 4 tests suites are defined: * network_access_rights: Tests handling of known access rights. * unknown_access_rights: Tests handling of unknown access rights. * inval: Tests unhandled allowed access and zero access value. * tcp_port_overflow: Tests with port values greater than 65535. The "ipv4_tcp" fixture supports IPv4 network domain with stream socket. 2 tests suites are defined: * port_endianness: Tests with big/little endian port formats. * with_fs: Tests a ruleset with both filesystem and network restrictions. The "port_specific" fixture is extended with 4 variants defined as a matrix of: sandboxed/not-sandboxed, IPv4/IPv6 network domain, and stream socket. 2 related tests suites are defined: * bind_connect_zero: Tests with port 0. * bind_connect_1023: Tests with port 1023. Test coverage for security/landlock is 92.4% of 710 lines according to gcc/gcov-13. Signed-off-by: Konstantin Meskhidze Link: https://lore.kernel.org/r/20231026014751.414649-11-konstantin.meskhidze@huawei.com [mic: Extend commit message, update test coverage, clean up capability use, fix useless TEST_F_FORK, and improve ipv4_tcp.with_fs] Co-developed-by: Mickaël Salaün Signed-off-by: Mickaël Salaün commit 1fa335209f6ad9d554655bb802c5b49b855d6237 Author: Konstantin Meskhidze Date: Thu Oct 26 09:47:48 2023 +0800 selftests/landlock: Share enforce_ruleset() helper Move enforce_ruleset() helper function to common.h so that it can be used both by filesystem tests and network ones. Signed-off-by: Konstantin Meskhidze Link: https://lore.kernel.org/r/20231026014751.414649-10-konstantin.meskhidze@huawei.com Signed-off-by: Mickaël Salaün commit fff69fb03dde1dfa348cfdb74b13287dabe42c25 Author: Konstantin Meskhidze Date: Thu Oct 26 09:47:47 2023 +0800 landlock: Support network rules with TCP bind and connect Add network rules support in the ruleset management helpers and the landlock_create_ruleset() syscall. Extend user space API to support network actions: * Add new network access rights: LANDLOCK_ACCESS_NET_BIND_TCP and LANDLOCK_ACCESS_NET_CONNECT_TCP. * Add a new network rule type: LANDLOCK_RULE_NET_PORT tied to struct landlock_net_port_attr. The allowed_access field contains the network access rights, and the port field contains the port value according to the controlled protocol. This field can take up to a 64-bit value but the maximum value depends on the related protocol (e.g. 16-bit value for TCP). Network port is in host endianness [1]. * Add a new handled_access_net field to struct landlock_ruleset_attr that contains network access rights. * Increment the Landlock ABI version to 4. Implement socket_bind() and socket_connect() LSM hooks, which enable to control TCP socket binding and connection to specific ports. Expand access_masks_t from u16 to u32 to be able to store network access rights alongside filesystem access rights for rulesets' handled access rights. Access rights are not tied to socket file descriptors but checked at bind() or connect() call time against the caller's Landlock domain. For the filesystem, a file descriptor is a direct access to a file/data. However, for network sockets, we cannot identify for which data or peer a newly created socket will give access to. Indeed, we need to wait for a connect or bind request to identify the use case for this socket. Likewise a directory file descriptor may enable to open another file (i.e. a new data item), but this opening is also restricted by the caller's domain, not the file descriptor's access rights [2]. [1] https://lore.kernel.org/r/278ab07f-7583-a4e0-3d37-1bacd091531d@digikod.net [2] https://lore.kernel.org/r/263c1eb3-602f-57fe-8450-3f138581bee7@digikod.net Signed-off-by: Konstantin Meskhidze Link: https://lore.kernel.org/r/20231026014751.414649-9-konstantin.meskhidze@huawei.com [mic: Extend commit message, fix typo in comments, and specify endianness in the documentation] Co-developed-by: Mickaël Salaün Signed-off-by: Mickaël Salaün commit 0e0fc7e8eb4a11bd9f89a9c74bc7c0e144c56203 Author: Konstantin Meskhidze Date: Thu Oct 26 09:47:46 2023 +0800 landlock: Refactor landlock_add_rule() syscall Change the landlock_add_rule() syscall to support new rule types with next commits. Add the add_rule_path_beneath() helper to support current filesystem rules. Signed-off-by: Konstantin Meskhidze Link: https://lore.kernel.org/r/20231026014751.414649-8-konstantin.meskhidze@huawei.com Signed-off-by: Mickaël Salaün commit 7a11275c378753fbdf00f2cfc80bc86a119ca67d Author: Konstantin Meskhidze Date: Thu Oct 26 09:47:45 2023 +0800 landlock: Refactor layer helpers Add a new key_type argument to the landlock_init_layer_masks() helper. Add a masks_array_size argument to the landlock_unmask_layers() helper. These modifications support implementing new rule types in the next Landlock versions. Signed-off-by: Konstantin Meskhidze Link: https://lore.kernel.org/r/20231026014751.414649-7-konstantin.meskhidze@huawei.com Signed-off-by: Mickaël Salaün commit 0e7410112964168a65578002269ae3b80b207936 Author: Konstantin Meskhidze Date: Thu Oct 26 09:47:44 2023 +0800 landlock: Move and rename layer helpers Move and rename landlock_unmask_layers() and landlock_init_layer_masks() helpers to ruleset.c to share them with Landlock network implementation in following commits. Signed-off-by: Konstantin Meskhidze Link: https://lore.kernel.org/r/20231026014751.414649-6-konstantin.meskhidze@huawei.com Signed-off-by: Mickaël Salaün commit 6146b6141770206792d0e1155794cc48697c7985 Author: Konstantin Meskhidze Date: Thu Oct 26 09:47:43 2023 +0800 landlock: Refactor merge/inherit_ruleset helpers Refactor merge_ruleset() and inherit_ruleset() functions to support new rule types. Add merge_tree() and inherit_tree() helpers. They use a specific ruleset's red-black tree according to a key type argument. Signed-off-by: Konstantin Meskhidze Link: https://lore.kernel.org/r/20231026014751.414649-5-konstantin.meskhidze@huawei.com Signed-off-by: Mickaël Salaün commit a4ac404b3032562ed6a34232b5266d0f446dd799 Author: Konstantin Meskhidze Date: Thu Oct 26 09:47:42 2023 +0800 landlock: Refactor landlock_find_rule/insert_rule helpers Add a new landlock_key union and landlock_id structure to support a socket port rule type. A struct landlock_id identifies a unique entry in a ruleset: either a kernel object (e.g. inode) or typed data (e.g. TCP port). There is one red-black tree per key type. Add is_object_pointer() and get_root() helpers. is_object_pointer() returns true if key type is LANDLOCK_KEY_INODE. get_root() helper returns a red-black tree root pointer according to a key type. Refactor landlock_insert_rule() and landlock_find_rule() to support coming network modifications. Adding or searching a rule in ruleset can now be done thanks to a Landlock ID argument passed to these helpers. Signed-off-by: Konstantin Meskhidze Link: https://lore.kernel.org/r/20231026014751.414649-4-konstantin.meskhidze@huawei.com [mic: Fix commit message typo] Co-developed-by: Mickaël Salaün Signed-off-by: Mickaël Salaün commit d7220364039f6beb76f311c05f74cad89da5fad5 Author: Mickaël Salaün Date: Thu Oct 26 09:47:41 2023 +0800 landlock: Allow FS topology changes for domains without such rule type Allow mount point and root directory changes when there is no filesystem rule tied to the current Landlock domain. This doesn't change anything for now because a domain must have at least a (filesystem) rule, but this will change when other rule types will come. For instance, a domain only restricting the network should have no impact on filesystem restrictions. Add a new get_current_fs_domain() helper to quickly check filesystem rule existence for all filesystem LSM hooks. Remove unnecessary inlining. Link: https://lore.kernel.org/r/20231026014751.414649-3-konstantin.meskhidze@huawei.com Signed-off-by: Mickaël Salaün commit 13fc6455fa19b0859e1b9640bf09903bec8df4f4 Author: Konstantin Meskhidze Date: Thu Oct 26 09:47:40 2023 +0800 landlock: Make ruleset's access masks more generic Rename ruleset's access masks and modify it's type to access_masks_t to support network type rules in following commits. Add filesystem helper functions to add and get filesystem mask. Signed-off-by: Konstantin Meskhidze Link: https://lore.kernel.org/r/20231026014751.414649-2-konstantin.meskhidze@huawei.com Signed-off-by: Mickaël Salaün commit 0b783d2e82d827af73c779e8e8f95d07e992b451 Author: James Clark Date: Mon Oct 23 14:15:49 2023 +0100 perf tests: test_arm_coresight: Simplify source iteration There are two reasons to do this, firstly there is a shellcheck warning in cs_etm_dev_name(), which can be completely deleted. And secondly the current iteration method doesn't support systems with both ETE and ETM because it picks one or the other. There isn't a known system with this configuration, but it could happen in the future. Iterating over all the sources for each CPU can be done by going through /sys/bus/event_source/devices/cs_etm/cpu* and following the symlink back to the Coresight device in /sys/bus/coresight/devices. This will work whether the device is ETE, ETM or any future name, and is much simpler and doesn't require any hard coded version numbers Suggested-by: Suzuki K Poulose Signed-off-by: James Clark Acked-by: Ian Rogers Tested-by: Leo Yan Cc: tianruidong@linux.alibaba.com Cc: Kajol Jain Cc: Anushree Mathur Cc: Tiezhu Yang Cc: atrajeev@linux.vnet.ibm.com Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20231023131550.487760-1-james.clark@arm.com Signed-off-by: Namhyung Kim commit e7abea958b7f0d65baafb20af60bdf2073fb2b28 Author: Vegard Nossum Date: Mon Oct 23 15:57:22 2023 +0200 docs: backporting: address feedback This addresses a few comments/issues in my v2 submission: - repeated word: 'run' from kernel test robot - emacs/ediff mode from Jon Corbet - various comments from Willy Tarreau - more backporting advice from Ben Hutchings - a couple more cherry-pick tips from Harshit Mogalapalli - add a bit about stable submissions Signed-off-by: Vegard Nossum Link: https://lore.kernel.org/r/20231023135722.949510-1-vegard.nossum@oracle.com Signed-off-by: Jonathan Corbet commit fae6389f912eb0b6aea1366814b5501077b5dbac Author: Vishal Verma Date: Thu Oct 26 11:43:20 2023 -0600 MAINTAINERS: Add tools/testing/cxl files to CXL tools/testing/cxl contains the unit test infrastructure for mocking CXL hierarchies. These are under the purview of the CXL subsystem maintainers. Add the 'F:' entry for this to MAINTAINERS so that get_maintainer.pl works as expected for patches to this area. Signed-off-by: Vishal Verma Link: https://lore.kernel.org/r/20231026-vv-mainteners-fix-v1-1-0a0f25634073@intel.com Signed-off-by: Dan Williams commit 55ed837d7cf11a9c506f83da79d39f9ada597740 Author: Pandith N Date: Mon Oct 16 15:49:53 2023 +0530 Documentation: driver-api: pps: Update PPS generator documentation PPS documentation has a generalized section for generators. Update the section so any new generator documentation can be appended. Signed-off-by: Pandith N Signed-off-by: Lakshmi Sowjanya D Reviewed-by: Andy Shevchenko Acked-by: Rodolfo Giometti Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20231016101953.27308-1-lakshmi.sowjanya.d@intel.com commit 07d87ceaecdde1835866d6acd0e1c1e08500ec82 Author: Samuel Thibault Date: Fri Oct 20 20:10:59 2023 +0200 speakup: Document USB support Speakup has been supporting USB for a while already. Signed-off-by: Samuel Thibault Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20231020181059.7rtj2csi7t6vorrm@begin commit c1081a7b16abc80af7048672dcae1d3b57b6f257 Author: Tang Yizhou Date: Thu Oct 12 10:42:28 2023 +0800 doc: blk-ioprio: Bring the doc in line with the implementation Our system administrator have noted that the names 'rt-to-be' and 'all-to-idle' in the I/O priority policies table appeared without explanations, leading to confusion. Let's bring these names in line with the naming in the 'attribute' section. Additionally, 1. Correct the interface name to 'io.prio.class'. 2. Add a table entry of 'promote-to-rt' for consistency. 3. Fix a typo of 'priority'. Suggested-by: Yingfu Zhou Reviewed-by: Hou Tao Signed-off-by: Tang Yizhou Reviewed-by: Bart Van Assche Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20231012024228.2161283-1-yizhou.tang@shopee.com commit 4ece2a7e88e1624f52c56d44394e4af1a13b1137 Author: Ian Rogers Date: Tue Sep 26 13:59:48 2023 -0700 perf vendor events intel: Add tigerlake two metrics Add tma_info_system_socket_clks and uncore_freq metrics. The associated converter script fix is in: https://github.com/intel/perfmon/pull/112 Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Caleb Biggers Cc: Perry Taylor Link: https://lore.kernel.org/r/20230926205948.1399594-3-irogers@google.com Signed-off-by: Namhyung Kim commit 19a214bffdf7abb8d472895bb944d9c269ab1699 Author: Ian Rogers Date: Tue Sep 26 13:59:47 2023 -0700 perf vendor events intel: Add broadwellde two metrics Add tma_info_system_socket_clks and uncore_freq metrics that require a broadwellx style uncore event for UNC_CLOCK. The associated converter script fix is in: https://github.com/intel/perfmon/pull/112 Fixes: 7d124303d620 ("perf vendor events intel: Update broadwell variant events/metrics") Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Caleb Biggers Cc: Perry Taylor Link: https://lore.kernel.org/r/20230926205948.1399594-2-irogers@google.com Signed-off-by: Namhyung Kim commit 2960f371f1653f6d8bc2321120eba2a14c861d4c Author: Sunil V L Date: Wed Oct 18 18:10:07 2023 +0530 RISC-V: cacheflush: Initialize CBO variables on ACPI systems Initialize the CBO variables on ACPI based systems using information in RHCT. Signed-off-by: Sunil V L Reviewed-by: Andrew Jones Reviewed-by: Samuel Holland Link: https://lore.kernel.org/r/20231018124007.1306159-5-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 9ca87564190cf0e5bb72695fb0db9947fcc47843 Author: Sunil V L Date: Wed Oct 18 18:10:06 2023 +0530 RISC-V: ACPI: RHCT: Add function to get CBO block sizes Cache Block Operation (CBO) related block size in ACPI is provided by RHCT. Add support to read the CMO node in RHCT to get this information. Signed-off-by: Sunil V L Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20231018124007.1306159-4-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit a06835227280436c1aae021a3f43d3abfcba3835 Author: Sunil V L Date: Wed Oct 18 18:10:05 2023 +0530 RISC-V: ACPI: Update the return value of acpi_get_rhct() acpi_get_rhct() currently returns pointer to acpi_table_header structure. But since this is specific to RHCT, return pointer to acpi_table_rhct structure itself. Suggested-by: Andrew Jones Signed-off-by: Sunil V L Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20231018124007.1306159-3-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit e8065df5b0c46086ad539beb7745ea26b26a7623 Author: Sunil V L Date: Wed Oct 18 18:10:04 2023 +0530 RISC-V: ACPI: Enhance acpi_os_ioremap with MMIO remapping Enhance the acpi_os_ioremap() to support opregions in MMIO space. Also, have strict checks using EFI memory map to allow remapping the RAM similar to arm64. Signed-off-by: Sunil V L Reviewed-by: Andrew Jones Reviewed-by: Alexandre Ghiti Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231018124007.1306159-2-sunilvl@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 0fce6e5c87faec2c8bf28d2abc8cb595f4e244b6 Author: Ilpo Järvinen Date: Thu Oct 26 15:19:23 2023 +0300 PCI: Simplify pcie_capability_clear_and_set_word() to ..._clear_word() When using pcie_capability_clear_and_set_word() but not actually *setting* anything, use pcie_capability_clear_word() instead. Link: https://lore.kernel.org/r/20231026121924.2164-1-ilpo.jarvinen@linux.intel.com Link: https://lore.kernel.org/r/20231026121924.2164-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen [bhelgaas: squash] Signed-off-by: Bjorn Helgaas commit c9501d268944d6c0475ecb3e740a084a7da9cbfe Author: Dan Carpenter Date: Wed Oct 25 14:57:23 2023 +0300 PCI: endpoint: Fix double free in __pci_epc_create() The pci_epc_release() function frees "epc" so the kfree() on the next line is a double free. Drop the redundant free. Fixes: 7711cbb4862a ("PCI: endpoint: Fix WARN() when an endpoint driver is removed") Link: https://lore.kernel.org/r/2ce68694-87a7-4c06-b8a4-9870c891b580@moroto.mountain Signed-off-by: Dan Carpenter Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit 14dcf78a6c042dd9421b11485b394c6273568bca Merge: 2baca17e6a54b e8d4006dc24e6 Author: Catalin Marinas Date: Thu Oct 26 17:10:18 2023 +0100 Merge branch 'for-next/cpus_have_const_cap' into for-next/core * for-next/cpus_have_const_cap: (38 commits) : cpus_have_const_cap() removal arm64: Remove cpus_have_const_cap() arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_REPEAT_TLBI arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_NVIDIA_CARMEL_CNP arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_CAVIUM_23154 arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_2645198 arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_1742098 arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_1542419 arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_843419 arm64: Avoid cpus_have_const_cap() for ARM64_UNMAP_KERNEL_AT_EL0 arm64: Avoid cpus_have_const_cap() for ARM64_{SVE,SME,SME2,FA64} arm64: Avoid cpus_have_const_cap() for ARM64_SPECTRE_V2 arm64: Avoid cpus_have_const_cap() for ARM64_SSBS arm64: Avoid cpus_have_const_cap() for ARM64_MTE arm64: Avoid cpus_have_const_cap() for ARM64_HAS_TLB_RANGE arm64: Avoid cpus_have_const_cap() for ARM64_HAS_WFXT arm64: Avoid cpus_have_const_cap() for ARM64_HAS_RNG arm64: Avoid cpus_have_const_cap() for ARM64_HAS_EPAN arm64: Avoid cpus_have_const_cap() for ARM64_HAS_PAN arm64: Avoid cpus_have_const_cap() for ARM64_HAS_GIC_PRIO_MASKING arm64: Avoid cpus_have_const_cap() for ARM64_HAS_DIT ... commit 2baca17e6a54b70e3b6d1b50f98ab71f770e4b95 Merge: 023113fe66b48 72e301956dbb3 Author: Catalin Marinas Date: Thu Oct 26 17:10:07 2023 +0100 Merge branch 'for-next/feat_lse128' into for-next/core * for-next/feat_lse128: : HWCAP for FEAT_LSE128 kselftest/arm64: add FEAT_LSE128 to hwcap test arm64: add FEAT_LSE128 HWCAP commit 023113fe66b4866b0d211b705e8bd287728f2e98 Merge: 2a3f8ce3bb2fc 80652cc0c0485 Author: Catalin Marinas Date: Thu Oct 26 17:10:05 2023 +0100 Merge branch 'for-next/feat_lrcpc3' into for-next/core * for-next/feat_lrcpc3: : HWCAP for FEAT_LRCPC3 selftests/arm64: add HWCAP2_LRCPC3 test arm64: add FEAT_LRCPC3 HWCAP commit 2a3f8ce3bb2fca943e6b3225f796ce06c29621fd Merge: 1519018ccb421 3accaef1f61e0 Author: Catalin Marinas Date: Thu Oct 26 17:10:01 2023 +0100 Merge branch 'for-next/feat_sve_b16b16' into for-next/core * for-next/feat_sve_b16b16: : Add support for FEAT_SVE_B16B16 (BFloat16) kselftest/arm64: Verify HWCAP2_SVE_B16B16 arm64/sve: Report FEAT_SVE_B16B16 to userspace commit 1519018ccb421349db5426b97f836f79e6e9f4c7 Merge: b805cafc604bf 391208485c3ad ef31b8ce313ea 11a7a42ea76e6 146a15b873353 04d402a453c37 Author: Catalin Marinas Date: Thu Oct 26 17:09:52 2023 +0100 Merge branches 'for-next/sve-remove-pseudo-regs', 'for-next/backtrace-ipi', 'for-next/kselftest', 'for-next/misc' and 'for-next/cpufeat-display-cores', remote-tracking branch 'arm64/for-next/perf' into for-next/core * arm64/for-next/perf: perf: hisi: Fix use-after-free when register pmu fails drivers/perf: hisi_pcie: Initialize event->cpu only on success drivers/perf: hisi_pcie: Check the type first in pmu::event_init() perf/arm-cmn: Enable per-DTC counter allocation perf/arm-cmn: Rework DTC counters (again) perf/arm-cmn: Fix DTC domain detection drivers: perf: arm_pmuv3: Drop some unused arguments from armv8_pmu_init() drivers: perf: arm_pmuv3: Read PMMIR_EL1 unconditionally drivers/perf: hisi: use cpuhp_state_remove_instance_nocalls() for hisi_hns3_pmu uninit process drivers/perf: xgene: Use device_get_match_data() perf/amlogic: add missing MODULE_DEVICE_TABLE docs/perf: Add ampere_cspmu to toctree to fix a build warning perf: arm_cspmu: ampere_cspmu: Add support for Ampere SoC PMU perf: arm_cspmu: Support implementation specific validation perf: arm_cspmu: Support implementation specific filters perf: arm_cspmu: Split 64-bit write to 32-bit writes perf: arm_cspmu: Separate Arm and vendor module * for-next/sve-remove-pseudo-regs: : arm64/fpsimd: Remove the vector length pseudo registers arm64/sve: Remove SMCR pseudo register from cpufeature code arm64/sve: Remove ZCR pseudo register from cpufeature code * for-next/backtrace-ipi: : Add IPI for backtraces/kgdb, use NMI arm64: smp: Don't directly call arch_smp_send_reschedule() for wakeup arm64: smp: avoid NMI IPIs with broken MediaTek FW arm64: smp: Mark IPI globals as __ro_after_init arm64: kgdb: Implement kgdb_roundup_cpus() to enable pseudo-NMI roundup arm64: smp: IPI_CPU_STOP and IPI_CPU_CRASH_STOP should try for NMI arm64: smp: Add arch support for backtrace using pseudo-NMI arm64: smp: Remove dedicated wakeup IPI arm64: idle: Tag the arm64 idle functions as __cpuidle irqchip/gic-v3: Enable support for SGIs to act as NMIs * for-next/kselftest: : Various arm64 kselftest updates kselftest/arm64: Validate SVCR in streaming SVE stress test * for-next/misc: : Miscellaneous patches arm64: Restrict CPU_BIG_ENDIAN to GNU as or LLVM IAS 15.x or newer arm64: module: Fix PLT counting when CONFIG_RANDOMIZE_BASE=n arm64, irqchip/gic-v3, ACPI: Move MADT GICC enabled check into a helper clocksource/drivers/arm_arch_timer: limit XGene-1 workaround arm64: Remove system_uses_lse_atomics() arm64: Mark the 'addr' argument to set_ptes() and __set_pte_at() as unused arm64/mm: Hoist synchronization out of set_ptes() loop arm64: swiotlb: Reduce the default size if no ZONE_DMA bouncing needed * for-next/cpufeat-display-cores: : arm64 cpufeature display enabled cores arm64: cpufeature: Change DBM to display enabled cores arm64: cpufeature: Display the set of cores with a feature commit 56e449603f0ac580700621a356d35d5716a62ce5 Author: Luben Tuikov Date: Sat Oct 14 21:15:35 2023 -0400 drm/sched: Convert the GPU scheduler to variable number of run-queues The GPU scheduler has now a variable number of run-queues, which are set up at drm_sched_init() time. This way, each driver announces how many run-queues it requires (supports) per each GPU scheduler it creates. Note, that run-queues correspond to scheduler "priorities", thus if the number of run-queues is set to 1 at drm_sched_init(), then that scheduler supports a single run-queue, i.e. single "priority". If a driver further sets a single entity per run-queue, then this creates a 1-to-1 correspondence between a scheduler and a scheduled entity. Cc: Lucas Stach Cc: Russell King Cc: Qiang Yu Cc: Rob Clark Cc: Abhinav Kumar Cc: Dmitry Baryshkov Cc: Danilo Krummrich Cc: Matthew Brost Cc: Boris Brezillon Cc: Alex Deucher Cc: Christian König Cc: Emma Anholt Cc: etnaviv@lists.freedesktop.org Cc: lima@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Luben Tuikov Acked-by: Christian König Link: https://lore.kernel.org/r/20231023032251.164775-1-luben.tuikov@amd.com commit 60781d2d5899d6fc5fd173c1bcffaaec39643e17 Merge: 246f388ec12b2 8619fd0e9026c Author: Mark Brown Date: Thu Oct 26 17:03:01 2023 +0100 ASoC: Intel: bytcr_wm5102: add various quirks Merge series from Hans de Goede : Hi Mark, As requested here is a v2 of my series to add various quirks to the bytcr_wm5102 Intel board driver to make it more flexible. Changes in v2: - Dropped 2 already merged patches - Rebased on top of broonie/sound/for-6.7 Regards, Hans Hans de Goede (4): ASoC: Intel: bytcr_wm5102: Add BYT_WM5102_SSP2 quirk ASoC: Intel: bytcr_wm5102: Add BYT_WM5102_MCLK_19_2MHZ quirk ASoC: Intel: bytcr_wm5102: Add BYT_WM5102_OUT_MAP quirk ASoC: Intel: bytcr_wm5102: Add BYT_WM5102_IN_MAP quirk sound/soc/intel/boards/bytcr_wm5102.c | 229 +++++++++++++++++++++++--- 1 file changed, 202 insertions(+), 27 deletions(-) -- 2.41.0 commit 246f388ec12b2e6659fd002a1049f5a34203d423 Merge: 11817547b7a2c 4531f512e3ef1 Author: Mark Brown Date: Thu Oct 26 17:02:53 2023 +0100 sc7180: Add qdsp based soundcard Merge series from Nikita Travkin : Some devices, such as Acer Aspire 1, can't use lpass dirrectly, but instead must use adsp core to play sound. Since otherwise the hardware is, usually, very similar across the devices on the same platform, it makes sense to reuse the same boardfile. This series refactors the sc7180.c slightly and adds the functions to control clocks via adsp instead of controlling the hardware directly. commit 11817547b7a2cfad46e17e772a9002dc3e60f747 Merge: 926f192f005fe f82eb06a40c86 Author: Mark Brown Date: Thu Oct 26 17:02:46 2023 +0100 ASoC: fix widget name comparisons (consider DAI name Merge series from Krzysztof Kozlowski : Some codec drivers compare widget names with strcmp, ignoring the component name prefix. If prefix is used, the comparisons start failing. Except Qualcomm lpass-rx-macro, none of the patches were tested on hardware. commit 926f192f005fe957ea1bfe4635af10219ba363a2 Merge: b97f4dac40eec 8ade6cc7e2617 Author: Mark Brown Date: Thu Oct 26 17:02:39 2023 +0100 ASoC: codecs: Add aw88399 amplifier driver Merge series from wangweidong.a@awinic.com: Add the awinic,aw88399 property to the awinic,aw88395.yaml file. Add i2c and amplifier registration for aw88399 and their associated operation functions. commit 76c121821a3128eb9d0183a525cf334beb9ccc47 Author: Stefan Binding Date: Thu Oct 26 16:05:58 2023 +0100 ASoC: cs35l41: Detect CSPL errors when sending CSPL commands The existing code checks for the correct state transition after sending a command. However, it is possible for the message box to return -1, which indicates an error, if an error has occurred in the firmware. We can detect if the error has occurred, and return a different error. In addition, there is no recovering from a CSPL error, so the retry mechanism is not needed in this case, and we can return immediately. Signed-off-by: Stefan Binding Acked-by: Mark Brown Link: https://lore.kernel.org/r/20231026150558.2105827-9-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit a51d8ba03a4fc92940d5e349f0325f36e85a89cb Author: Stefan Binding Date: Thu Oct 26 16:05:57 2023 +0100 ALSA: hda: cs35l41: Check CSPL state after loading firmware CSPL firmware should be in RUNNING or PAUSED state after loading. If not, the firmware has not been loaded correctly, and we can unload it and pass the error up. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231026150558.2105827-8-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 33790d1f039114a829433b89fc55a0d781d38d62 Author: Stefan Binding Date: Thu Oct 26 16:05:56 2023 +0100 ALSA: hda: cs35l41: Do not unload firmware before reset in system suspend Given the part is about to reset due to system suspend, and we are already in hibernate, there is no need to wake up the amp, just to get it ready to be reset. We just need to ensure cs_dsp is ready for reset by resetting the states. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231026150558.2105827-7-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 2ee06ff5d7cf5f68bab2bf65a946bb2ffe9982dd Author: Stefan Binding Date: Thu Oct 26 16:05:55 2023 +0100 ALSA: hda: cs35l41: Force a software reset after hardware reset To ensure the chip has correctly reset during probe and system suspend, we need to force a software reset, in case of systems where the hardware reset is not available. The software reset register was labelled as volatile but not readable, however, it is readable, (just returns 0x0). Adding it to readable registers means it will be correctly treated as volatile, and thus will not be cached. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231026150558.2105827-6-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 881b7bce0c250386680b49b637455d31238a4b30 Author: Stefan Binding Date: Thu Oct 26 16:05:54 2023 +0100 ALSA: hda: cs35l41: Run boot process during resume callbacks During initial probe, after reset is asserted for the first time, the driver goes through a boot process to ensure the amp is ready to be used. This involves verifying a boot flag, as well as verifying the chip ids. This is necessary since it is possible for the amp to have been fully reset by the system suspend calls. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231026150558.2105827-5-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit fff393db71c1d53a13f9eb2f8da77c1f5e4e30bc Author: Stefan Binding Date: Thu Oct 26 16:05:53 2023 +0100 ALSA: hda: cs35l41: Assert Reset prior to de-asserting in probe and system resume To ensure we are in a known state, exiting from reset at the point of probe or in system resume, assert reset before we de-assert it. Since the BIOS may enter into a pre-boot environment to control the amps (for example for boot beep), we need to ensure we start from a known, reset state prior to probe or system resume. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231026150558.2105827-4-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit a7423e9019a9a595919da44104725eef8a518652 Author: Stefan Binding Date: Thu Oct 26 16:05:52 2023 +0100 ALSA: hda: cs35l41: Assert reset before system suspend Some system suspend modes may remove power supplies. To ensure we are not running during this time, we should assert reset. Note: since the amps use a shared reset, asserting reset prior to system suspend only works if the amps are suspended in the reverse order to probe. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231026150558.2105827-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit f01b371b0794f43586d4f0b7dd0d9226c25553e5 Author: Stefan Binding Date: Thu Oct 26 16:05:51 2023 +0100 ALSA: hda: cs35l41: Use reset label to get GPIO for HP Zbook Fury 17 G9 This laptop has an incorrect setting in its _DSD for boost type, but the rest of the _DSD is correct, and we can still use the reset label to obtain the reset gpio. Also fix channel map so that amp 0 is right, and amp 1 is left. Fixes: 581523ee3652 ("ALSA: hda: cs35l41: Override the _DSD for HP Zbook Fury 17 G9 to correct boost type") Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20231026150558.2105827-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 0ec7731655de196bc1e4af99e495b38778109d22 Author: Mark Brown Date: Thu Oct 26 16:49:19 2023 +0100 regmap: Ensure range selector registers are updated after cache sync When we sync the register cache we do so with the cache bypassed in order to avoid overhead from writing the synced values back into the cache. If the regmap has ranges and the selector register for those ranges is in a register which is cached this has the unfortunate side effect of meaning that the physical and cached copies of the selector register can be out of sync after a cache sync. The cache will have whatever the selector was when the sync started and the hardware will have the selector for the register that was synced last. Fix this by rewriting all cached selector registers after every sync, ensuring that the hardware and cache have the same content. This will result in extra writes that wouldn't otherwise be needed but is simple so hopefully robust. We don't read from the hardware since not all devices have physical read support. Given that nobody noticed this until now it is likely that we are rarely if ever hitting this case. Reported-by: Hector Martin Cc: stable@vger.kernel.org Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20231026-regmap-fix-selector-sync-v1-1-633ded82770d@kernel.org Signed-off-by: Mark Brown commit 1110581412c7a223439bb3ecdcdd9f4432e08231 Author: Alison Schofield Date: Thu Oct 26 08:46:54 2023 -0700 cxl/region: Prepare the decoder match range helper for reuse match_decoder_by_range() and decoder_match_range() both determine if an HPA range matches a decoder. The first does it for root decoders and the second one operates on switch decoders. Tidy these up with clear naming and make the switch helper more like the root decoder helper in style and functionality. Make it take the actual range, rather than an endpoint decoder from which it extracts the range. Require an exact match on switch decoders, because unlike a root decoder that maps an entire region, Linux only supports 1:1 mapping of switch to endpoint decoders. Note that root-decoders are a super-set of switch-decoders and the range they cover is a super-set of a region, hence the use of range_contains() for that case. Aside from aesthetics and maintainability, this is in preparation for reuse. Signed-off-by: Alison Schofield Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Reviewed-by: Jim Harris Link: https://lore.kernel.org/r/011b1f498e1758bb8df17c5951be00bd8d489e3b.1698263080.git.alison.schofield@intel.com [djbw: fixup root decoder vs switch decoder range checks] Signed-off-by: Dan Williams commit 146a15b873353f8ac28dc281c139ff611a3c4848 Author: Nathan Chancellor Date: Wed Oct 25 10:21:28 2023 -0700 arm64: Restrict CPU_BIG_ENDIAN to GNU as or LLVM IAS 15.x or newer Prior to LLVM 15.0.0, LLVM's integrated assembler would incorrectly byte-swap NOP when compiling for big-endian, and the resulting series of bytes happened to match the encoding of FNMADD S21, S30, S0, S0. This went unnoticed until commit: 34f66c4c4d5518c1 ("arm64: Use a positive cpucap for FP/SIMD") Prior to that commit, the kernel would always enable the use of FPSIMD early in boot when __cpu_setup() initialized CPACR_EL1, and so usage of FNMADD within the kernel was not detected, but could result in the corruption of user or kernel FPSIMD state. After that commit, the instructions happen to trap during boot prior to FPSIMD being detected and enabled, e.g. | Unhandled 64-bit el1h sync exception on CPU0, ESR 0x000000001fe00000 -- ASIMD | CPU: 0 PID: 0 Comm: swapper Not tainted 6.6.0-rc3-00013-g34f66c4c4d55 #1 | Hardware name: linux,dummy-virt (DT) | pstate: 400000c9 (nZcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) | pc : __pi_strcmp+0x1c/0x150 | lr : populate_properties+0xe4/0x254 | sp : ffffd014173d3ad0 | x29: ffffd014173d3af0 x28: fffffbfffddffcb8 x27: 0000000000000000 | x26: 0000000000000058 x25: fffffbfffddfe054 x24: 0000000000000008 | x23: fffffbfffddfe000 x22: fffffbfffddfe000 x21: fffffbfffddfe044 | x20: ffffd014173d3b70 x19: 0000000000000001 x18: 0000000000000005 | x17: 0000000000000010 x16: 0000000000000000 x15: 00000000413e7000 | x14: 0000000000000000 x13: 0000000000001bcc x12: 0000000000000000 | x11: 00000000d00dfeed x10: ffffd414193f2cd0 x9 : 0000000000000000 | x8 : 0101010101010101 x7 : ffffffffffffffc0 x6 : 0000000000000000 | x5 : 0000000000000000 x4 : 0101010101010101 x3 : 000000000000002a | x2 : 0000000000000001 x1 : ffffd014171f2988 x0 : fffffbfffddffcb8 | Kernel panic - not syncing: Unhandled exception | CPU: 0 PID: 0 Comm: swapper Not tainted 6.6.0-rc3-00013-g34f66c4c4d55 #1 | Hardware name: linux,dummy-virt (DT) | Call trace: | dump_backtrace+0xec/0x108 | show_stack+0x18/0x2c | dump_stack_lvl+0x50/0x68 | dump_stack+0x18/0x24 | panic+0x13c/0x340 | el1t_64_irq_handler+0x0/0x1c | el1_abort+0x0/0x5c | el1h_64_sync+0x64/0x68 | __pi_strcmp+0x1c/0x150 | unflatten_dt_nodes+0x1e8/0x2d8 | __unflatten_device_tree+0x5c/0x15c | unflatten_device_tree+0x38/0x50 | setup_arch+0x164/0x1e0 | start_kernel+0x64/0x38c | __primary_switched+0xbc/0xc4 Restrict CONFIG_CPU_BIG_ENDIAN to a known good assembler, which is either GNU as or LLVM's IAS 15.0.0 and newer, which contains the linked commit. Closes: https://github.com/ClangBuiltLinux/linux/issues/1948 Link: https://github.com/llvm/llvm-project/commit/1379b150991f70a5782e9a143c2ba5308da1161c Signed-off-by: Nathan Chancellor Cc: stable@vger.kernel.org Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20231025-disable-arm64-be-ias-b4-llvm-15-v1-1-b25263ed8b23@kernel.org Signed-off-by: Catalin Marinas commit 3ddba96b0d7e714dee4db5aed4f7d413be43b4ba Author: Helen Koike Date: Tue Sep 19 15:22:49 2023 -0300 MAINTAINERS: drm/ci: add entries for xfail files DRM CI keeps track of which tests are failing, flaking or being skipped by the ci in the expectations files. Add entries for those files to the corresponding driver maintainer, so they can be notified when they change. Signed-off-by: Helen Koike Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230919182249.153499-1-helen.koike@collabora.com Signed-off-by: Maxime Ripard commit 56185e0249525e2fff70cf19baf223c3aba5af40 Merge: 40fa0489a2942 f93b8a5705c68 Author: Arnd Bergmann Date: Thu Oct 26 17:26:35 2023 +0200 Merge tag 'qcom-arm64-defconfig-for-6.7-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/defconfig Few more ARM64 defconfig updates for v6.7 This enables the Qualcomm PMIC-based USB Type-C port manager, found in e.g. SM8250, and hence RB5, as well as the Type-C DisplayPort altmode support to get display working on the same. * tag 'qcom-arm64-defconfig-for-6.7-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: defconfig: enable DisplayPort altmode support arm64: defconfig: enable CONFIG_TYPEC_QCOM_PMIC Link: https://lore.kernel.org/r/20231025191841.1015192-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit a9838799e2fa9fedd77867942e661b657d5591a0 Author: Lukas Bulwahn Date: Wed Oct 25 13:21:36 2023 +0200 arm: debug: reuse the config DEBUG_OMAP2UART{1,2} for OMAP{3,4,5} Commit d2b310b0234c ("ARM: debug: Use generic 8250 debug_ll for omap2 and omap3/4/5 common uarts") adds address definitions of DEBUG_UART_PHYS for OMAP2, OMAP3, OMAP4 and OMAP5 in ./arch/arm/Kconfig.debug. These definitions depend on DEBUG_OMAP{2,3,4,5}UART{1,2}; however, only DEBUG_OMAP2UART{1,2} are defined in ./arch/arm/Kconfig.debug, and DEBUG_OMAP{3,4,5}UART{1,2} are not defined. Hence, the script ./scripts/checkkconfigsymbols.py warns here on non-existing symbols. Simply reuse the config DEBUG_OMAP2UART{1,2}; there is no need to define separate config symbols for OMAP{3,4,5}. So, just delete the dead references to DEBUG_OMAP{3,4,5}UART{1,2}. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20231025112136.3445-1-lukas.bulwahn@gmail.com Signed-off-by: Arnd Bergmann commit 3613047280ec42a4e1350fdc1a6dd161ff4008cc Merge: bbc70e0aec287 05d3ef8bba77c Author: Joerg Roedel Date: Thu Oct 26 17:05:58 2023 +0200 Merge tag 'v6.6-rc7' into core Linux 6.6-rc7 commit 8d786149d78c7784144c7179e25134b6530b714b Author: Thippeswamy Havalige Date: Tue Oct 3 23:04:53 2023 +0530 PCI: xilinx-xdma: Add Xilinx XDMA Root Port driver Add support for Xilinx XDMA Soft IP core as Root Port. The Zynq UltraScale+ MPSoCs devices support XDMA soft IP module in programmable logic. The integrated XDMA Soft IP block has integrated bridge function that can act as PCIe Root Port. [kwilczynski: correct indentation and whitespaces, Kconfig help update] Link: https://lore.kernel.org/linux-pci/20231003173453.938190-4-thippeswamy.havalige@amd.com Signed-off-by: Thippeswamy Havalige Signed-off-by: Bharat Kumar Gogada Signed-off-by: Krzysztof Wilczyński commit bbc70e0aec287e164344b1a071bd46466a4f29b3 Author: Jason Gunthorpe Date: Wed Sep 27 20:47:39 2023 -0300 iommu/dart: Remove the force_bypass variable This flag just caches if the IO page size is larger than the CPU PAGE_SIZE. This only needs to be checked in two places so remove the confusingly named cache. dart would like to not support paging domains at all if the IO page size is larger than the CPU page size. In this case we should ideally fail domain_alloc_paging(), as there is no point in creating a domain that can never be attached. Move the test into apple_dart_finalize_domain(). The check in apple_dart_mod_streams() will prevent the domain from being attached to the wrong dart There is no HW limitation that prevents BLOCKED domains from working, remove that test. The check in apple_dart_of_xlate() is redundant since immediately after the pgsize is checked. Remove it. Remove the variable. Suggested-by: Janne Grunau Signed-off-by: Jason Gunthorpe Reviewed-by: Janne Grunau Acked-by: Sven Peter Link: https://lore.kernel.org/r/9-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 482feb5c649261cd2a7ad02e4ca63c159d6ec795 Author: Jason Gunthorpe Date: Wed Sep 27 20:47:38 2023 -0300 iommu/dart: Call apple_dart_finalize_domain() as part of alloc_paging() In many cases the dev argument will now be !NULL so we should use it to finalize the domain at allocation. Make apple_dart_finalize_domain() accept the correct type. Reviewed-by: Janne Grunau Signed-off-by: Jason Gunthorpe Acked-by: Sven Peter Link: https://lore.kernel.org/r/8-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 9c3ef90c4ccbee0a000b0f6b1b28c38773de87c7 Author: Jason Gunthorpe Date: Wed Sep 27 20:47:37 2023 -0300 iommu/dart: Convert to domain_alloc_paging() Since the IDENTITY and BLOCKED behaviors were moved to global statics all that remains is the paging domain. Rename to apple_dart_attach_dev_paging() and remove the left over type check. Reviewed-by: Janne Grunau Signed-off-by: Jason Gunthorpe Acked-by: Sven Peter Link: https://lore.kernel.org/r/7-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 17ef8d6876e01165836790d83d908eb21da3f08e Author: Jason Gunthorpe Date: Wed Sep 27 20:47:36 2023 -0300 iommu/dart: Move the blocked domain support to a global static Move to the new static global for blocked domains. Move the blocked specific code to apple_dart_attach_dev_blocked(). Reviewed-by: Janne Grunau Signed-off-by: Jason Gunthorpe Acked-by: Sven Peter Link: https://lore.kernel.org/r/6-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 7993085d8d5d271a83045c5c7d01982a7e89a52e Author: Jason Gunthorpe Date: Wed Sep 27 20:47:35 2023 -0300 iommu/dart: Use static global identity domains Move to the new static global for identity domains. Move the identity specific code to apple_dart_attach_dev_identity(). Reviewed-by: Janne Grunau Signed-off-by: Jason Gunthorpe Acked-by: Sven Peter Link: https://lore.kernel.org/r/5-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 13fbceb1b8e9d1101d9dcd5ceec483cb6d203a3c Author: Jason Gunthorpe Date: Wed Sep 27 20:47:34 2023 -0300 iommufd: Convert to alloc_domain_paging() Move the global static blocked domain to the ops and convert the unmanaged domain to domain_alloc_paging. Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian Acked-by: Sven Peter Link: https://lore.kernel.org/r/4-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 7d12eb2d2f59e348b74fd36add42a3208a1eaeaa Author: Jason Gunthorpe Date: Wed Sep 27 20:47:33 2023 -0300 iommu/vt-d: Use ops->blocked_domain Trivially migrate to the ops->blocked_domain for the existing global static. Reviewed-by: Lu Baolu Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian Acked-by: Sven Peter Link: https://lore.kernel.org/r/3-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 7b6dd84e703147f5c71f163b84b0cb729a320541 Author: Jason Gunthorpe Date: Wed Sep 27 20:47:32 2023 -0300 iommu/vt-d: Update the definition of the blocking domain The global static should pre-define the type and the NOP free function can be now left as NULL. Reviewed-by: Lu Baolu Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian Acked-by: Sven Peter Link: https://lore.kernel.org/r/2-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com Signed-off-by: Joerg Roedel commit e5d8be7406ca7b6b251c09b786f08176337c0999 Author: Jason Gunthorpe Date: Wed Sep 27 20:47:31 2023 -0300 iommu: Move IOMMU_DOMAIN_BLOCKED global statics to ops->blocked_domain Following the pattern of identity domains, just assign the BLOCKED domain global statics to a value in ops. Update the core code to use the global static directly. Update powerpc to use the new scheme and remove its empty domain_alloc callback. Reviewed-by: Lu Baolu Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian Acked-by: Sven Peter Link: https://lore.kernel.org/r/1-v2-bff223cf6409+282-dart_paging_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 4ae1cd7d4be2d1388bcfcd8371eb001a4cec88e2 Author: Thippeswamy Havalige Date: Tue Oct 3 23:04:52 2023 +0530 dt-bindings: PCI: xilinx-xdma: Add schemas for Xilinx XDMA PCIe Root Port Bridge Add YAML devicetree schemas for Xilinx XDMA Soft IP PCIe Root Port Bridge. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/20231003173453.938190-3-thippeswamy.havalige@amd.com Signed-off-by: Thippeswamy Havalige Signed-off-by: Bharat Kumar Gogada Signed-off-by: Krzysztof Wilczyński Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring commit 2050c9bc4f7bbdd7d1dc0b6bf7749ec4f7b6f407 Author: Abel Vesa Date: Wed Oct 25 19:29:43 2023 +0530 pmdomain: qcom: rpmhpd: Add SC8380XP power domains Add the power domains exposed by RPMH in the Qualcomm SC8380XP platform. Signed-off-by: Abel Vesa Signed-off-by: Rajendra Nayak Co-developed-by: Sibi Sankar Signed-off-by: Sibi Sankar Reviewed-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231025135943.13854-4-quic_sibis@quicinc.com Signed-off-by: Ulf Hansson commit 9c82c9005cb0ca14ed8885bab27d81894ba184d9 Author: Neil Armstrong Date: Wed Oct 25 09:32:03 2023 +0200 pmdomain: qcom: rpmhpd: Add SM8650 RPMh Power Domains Add RPMh Power Domains support for the SM8650 platform. Signed-off-by: Neil Armstrong Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20231025-topic-sm8650-upstream-rpmpd-v1-2-f25d313104c6@linaro.org Signed-off-by: Ulf Hansson commit 11cc498cf875c1242006f5b8028800c11673b8d5 Merge: 1df91d85f29f4 c638b9516abd6 Author: Ulf Hansson Date: Thu Oct 26 16:21:46 2023 +0200 pmdomain: Merge branch genpd_dt into next Merge the immutable branch genpd_dt into next, to allow the DT bindings to be tested together with new pmdomain changes that are targeted for v6.7. Signed-off-by: Ulf Hansson commit c638b9516abd60aebccdbded5041a3e9d1c519f3 Author: Abel Vesa Date: Wed Oct 25 19:29:42 2023 +0530 dt-bindings: power: rpmpd: Add SC8380XP support Add compatible and constants for the power domains exposed by the RPMH in the Qualcomm SC8380XP platform. Signed-off-by: Abel Vesa Signed-off-by: Rajendra Nayak Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20231025135943.13854-3-quic_sibis@quicinc.com Signed-off-by: Ulf Hansson commit 7eb31ec5e1cdb4705450e4d728407767cae2b919 Author: Sibi Sankar Date: Wed Oct 25 19:29:41 2023 +0530 dt-bindings: power: qcom,rpmhpd: Add GMXC PD index Document GMXC (Graphics MXC) power domain index which will be used on SC8380XP SoCs. Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20231025135943.13854-2-quic_sibis@quicinc.com [Ulf: Re-based to step up the index number] Signed-off-by: Ulf Hansson commit d4d56c079ddd19293b11de1f2309add0b8972af2 Author: Neil Armstrong Date: Wed Oct 25 09:32:02 2023 +0200 dt-bindings: power: qcom,rpmpd: document the SM8650 RPMh Power Domains Document the RPMh Power Domains on the SM8650 Platform. Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20231025-topic-sm8650-upstream-rpmpd-v1-1-f25d313104c6@linaro.org Signed-off-by: Ulf Hansson commit 03476e687eb07b94f7cdb07cd3c7c4304b6c58b3 Author: Lu Baolu Date: Wed Oct 25 21:42:16 2023 -0700 iommu/vt-d: Disallow read-only mappings to nest parent domain When remapping hardware is configured by system software in scalable mode as Nested (PGTT=011b) and with PWSNP field Set in the PASID-table-entry, it may Set Accessed bit and Dirty bit (and Extended Access bit if enabled) in first-stage page-table entries even when second-stage mappings indicate that corresponding first-stage page-table is Read-Only. As the result, contents of pages designated by VMM as Read-Only can be modified by IOMMU via PML5E (PML4E for 4-level tables) access as part of address translation process due to DMAs issued by Guest. This disallows read-only mappings in the domain that is supposed to be used as nested parent. Reference from Sapphire Rapids Specification Update [1], errata details, SPR17. Userspace should know this limitation by checking the IOMMU_HW_INFO_VTD_ERRATA_772415_SPR17 flag reported in the IOMMU_GET_HW_INFO ioctl. [1] https://www.intel.com/content/www/us/en/content-details/772415/content-details.html Link: https://lore.kernel.org/r/20231026044216.64964-9-yi.l.liu@intel.com Reviewed-by: Kevin Tian Signed-off-by: Lu Baolu Signed-off-by: Yi Liu Signed-off-by: Jason Gunthorpe commit b41e38e225398191aaa0f1115d6234f57ffd0741 Author: Lu Baolu Date: Wed Oct 25 21:42:15 2023 -0700 iommu/vt-d: Add nested domain allocation This adds the support for IOMMU_HWPT_DATA_VTD_S1 type. And 'nested_parent' is added to mark the nested parent domain to sanitize the input parent domain. Link: https://lore.kernel.org/r/20231026044216.64964-8-yi.l.liu@intel.com Signed-off-by: Lu Baolu Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 9838f2bb6b6be1e648b9377fc97ee7b18d9f2fbf Author: Yi Liu Date: Wed Oct 25 21:42:14 2023 -0700 iommu/vt-d: Set the nested domain to a device This adds the helper for setting the nested domain to a device hence enable nested domain usage on Intel VT-d. Link: https://lore.kernel.org/r/20231026044216.64964-7-yi.l.liu@intel.com Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit d86724d4dc45ba2ed80eebb704e12bb71c35d901 Author: Yi Liu Date: Wed Oct 25 21:42:13 2023 -0700 iommu/vt-d: Make domain attach helpers to be extern This makes the helpers visible to nested.c. Link: https://lore.kernel.org/r/20231026044216.64964-6-yi.l.liu@intel.com Suggested-by: Lu Baolu Reviewed-by: Kevin Tian Reviewed-by: Lu Baolu Signed-off-by: Yi Liu Signed-off-by: Jason Gunthorpe commit 111bf85c68f6edb2d06c6705faab9d1649348bdb Author: Lu Baolu Date: Wed Oct 25 21:42:12 2023 -0700 iommu/vt-d: Add helper to setup pasid nested translation The configurations are passed in from the user when the user domain is allocated. This helper interprets these configurations according to the data structure defined in uapi/linux/iommufd.h. The EINVAL error will be returned if any of configurations are not compatible with the hardware capabilities. The caller can retry with another compatible user domain. The encoding of fields of each pasid entry is defined in section 9.6 of the VT-d spec. Link: https://lore.kernel.org/r/20231026044216.64964-5-yi.l.liu@intel.com Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Signed-off-by: Yi Liu Signed-off-by: Jason Gunthorpe commit 79ae1eccd3f7fb010064c0f6242da8f8944c21fd Author: Lu Baolu Date: Wed Oct 25 21:42:11 2023 -0700 iommu/vt-d: Add helper for nested domain allocation This adds helper for accepting user parameters and allocate a nested domain. Link: https://lore.kernel.org/r/20231026044216.64964-4-yi.l.liu@intel.com Reviewed-by: Kevin Tian Signed-off-by: Jacob Pan Signed-off-by: Lu Baolu Signed-off-by: Yi Liu Signed-off-by: Jason Gunthorpe commit 04f261ac2356ee8962fbd67e38a35e86cbe3c5d8 Author: Lu Baolu Date: Wed Oct 25 21:42:10 2023 -0700 iommu/vt-d: Extend dmar_domain to support nested domain The nested domain fields are exclusive to those that used for a DMA remapping domain. Use union to avoid memory waste. Link: https://lore.kernel.org/r/20231026044216.64964-3-yi.l.liu@intel.com Reviewed-by: Kevin Tian Signed-off-by: Lu Baolu Signed-off-by: Yi Liu Signed-off-by: Jason Gunthorpe commit 82b6661c9c35e60946dee536545b4848f25eafab Author: Yi Liu Date: Wed Oct 25 21:42:09 2023 -0700 iommufd: Add data structure for Intel VT-d stage-1 domain allocation This adds IOMMU_HWPT_DATA_VTD_S1 for stage-1 hw_pagetable of Intel VT-d and the corressponding data structure for userspace specified parameter for the domain allocation. Link: https://lore.kernel.org/r/20231026044216.64964-2-yi.l.liu@intel.com Reviewed-by: Kevin Tian Signed-off-by: Yi Liu Signed-off-by: Jason Gunthorpe commit a2cdecdf9d234455fdfc8f539bbf5818711bc29d Author: Yi Liu Date: Tue Oct 24 08:00:11 2023 -0700 iommu/vt-d: Enhance capability check for nested parent domain allocation This adds the scalable mode check before allocating the nested parent domain as checking nested capability is not enough. User may turn off scalable mode which also means no nested support even if the hardware supports it. Fixes: c97d1b20d383 ("iommu/vt-d: Add domain_alloc_user op") Link: https://lore.kernel.org/r/20231024150011.44642-1-yi.l.liu@intel.com Signed-off-by: Yi Liu Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 55a01657cbee07d772b1d3cb144f867a326e4673 Author: Nicolin Chen Date: Wed Oct 25 21:39:38 2023 -0700 iommufd/selftest: Add coverage for IOMMU_HWPT_ALLOC with nested HWPTs The IOMMU_HWPT_ALLOC ioctl now supports passing user_data to allocate a user-managed domain for nested HWPTs. Add its coverage for that. Also, update _test_cmd_hwpt_alloc() and add test_cmd/err_hwpt_alloc_nested(). Link: https://lore.kernel.org/r/20231026043938.63898-11-yi.l.liu@intel.com Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 65fe32f7a4472e19331a524b9c980b3444dd20a2 Author: Nicolin Chen Date: Wed Oct 25 21:39:37 2023 -0700 iommufd/selftest: Add nested domain allocation for mock domain Add nested domain support in the ->domain_alloc_user op with some proper sanity checks. Then, add a domain_nested_ops for all nested domains and split the get_md_pagetable helper into paging and nested helpers. Also, add an iotlb as a testing property of a nested domain. Link: https://lore.kernel.org/r/20231026043938.63898-10-yi.l.liu@intel.com Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit e9d36c07bb787840e4813fb09a929a17d522a69f Author: Nicolin Chen Date: Wed Oct 25 21:39:36 2023 -0700 iommu: Add iommu_copy_struct_from_user helper Wrap up the data type/pointer/len sanity and a copy_struct_from_user call for iommu drivers to copy driver specific data via struct iommu_user_data. And expect it to be used in the domain_alloc_user op for example. Link: https://lore.kernel.org/r/20231026043938.63898-9-yi.l.liu@intel.com Signed-off-by: Nicolin Chen Co-developed-by: Yi Liu Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe commit bd529dbb661d62bd9f03e44c9fc837d98a190499 Author: Nicolin Chen Date: Wed Oct 25 21:39:35 2023 -0700 iommufd: Add a nested HW pagetable object IOMMU_HWPT_ALLOC already supports iommu_domain allocation for usersapce. But it can only allocate a hw_pagetable that associates to a given IOAS, i.e. only a kernel-managed hw_pagetable of IOMMUFD_OBJ_HWPT_PAGING type. IOMMU drivers can now support user-managed hw_pagetables, for two-stage translation use cases that require user data input from the user space. Add a new IOMMUFD_OBJ_HWPT_NESTED type with its abort/destroy(). Pair it with a new iommufd_hwpt_nested structure and its to_hwpt_nested() helper. Update the to_hwpt_paging() helper, so a NESTED-type hw_pagetable can be handled in the callers, for example iommufd_hw_pagetable_enforce_rr(). Screen the inputs including the parent PAGING-type hw_pagetable that has a need of a new nest_parent flag in the iommufd_hwpt_paging structure. Extend the IOMMU_HWPT_ALLOC ioctl to accept an IOMMU driver specific data input which is tagged by the enum iommu_hwpt_data_type. Also, update the @pt_id to accept hwpt_id too besides an ioas_id. Then, use them to allocate a hw_pagetable of IOMMUFD_OBJ_HWPT_NESTED type using the iommufd_hw_pagetable_alloc_nested() allocator. Link: https://lore.kernel.org/r/20231026043938.63898-8-yi.l.liu@intel.com Signed-off-by: Nicolin Chen Co-developed-by: Yi Liu Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe commit 2bdabb8e82f564d19eeeb7c83e6b2467af0707cb Author: Yi Liu Date: Wed Oct 25 21:39:34 2023 -0700 iommu: Pass in parent domain with user_data to domain_alloc_user op domain_alloc_user op already accepts user flags for domain allocation, add a parent domain pointer and a driver specific user data support as well. The user data would be tagged with a type for iommu drivers to add their own driver specific user data per hw_pagetable. Add a struct iommu_user_data as a bundle of data_ptr/data_len/type from an iommufd core uAPI structure. Make the user data opaque to the core, since a userspace driver must match the kernel driver. In the future, if drivers share some common parameter, there would be a generic parameter as well. Link: https://lore.kernel.org/r/20231026043938.63898-7-yi.l.liu@intel.com Signed-off-by: Lu Baolu Co-developed-by: Nicolin Chen Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe commit b5021cb264e67baf051569a41debe277c279952b Author: Nicolin Chen Date: Wed Oct 25 21:39:33 2023 -0700 iommufd: Share iommufd_hwpt_alloc with IOMMUFD_OBJ_HWPT_NESTED Allow iommufd_hwpt_alloc() to have a common routine but jump to different allocators corresponding to different user input pt_obj types, either an IOMMUFD_OBJ_IOAS for a PAGING hwpt or an IOMMUFD_OBJ_HWPT_PAGING as the parent for a NESTED hwpt. Also, move the "flags" validation to the hwpt allocator (paging), so that later the hwpt_nested allocator can do its own separate flags validation. Link: https://lore.kernel.org/r/20231026043938.63898-6-yi.l.liu@intel.com Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe commit 89db31635c87a7856e205c7ebf9f562e4bb206fe Author: Nicolin Chen Date: Wed Oct 25 21:39:32 2023 -0700 iommufd: Derive iommufd_hwpt_paging from iommufd_hw_pagetable To prepare for IOMMUFD_OBJ_HWPT_NESTED, derive struct iommufd_hwpt_paging from struct iommufd_hw_pagetable, by leaving the common members in struct iommufd_hw_pagetable. Add a __iommufd_object_alloc and to_hwpt_paging() helpers for the new structure. Then, update "hwpt" to "hwpt_paging" throughout the files, accordingly. Link: https://lore.kernel.org/r/20231026043938.63898-5-yi.l.liu@intel.com Suggested-by: Jason Gunthorpe Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe commit 58d84f430dc7f737d21c60906de0f39104c89e9d Author: Jason Gunthorpe Date: Wed Oct 25 21:39:31 2023 -0700 iommufd/device: Wrap IOMMUFD_OBJ_HWPT_PAGING-only configurations Some of the configurations during the attach/replace() should only apply to IOMMUFD_OBJ_HWPT_PAGING. Once IOMMUFD_OBJ_HWPT_NESTED gets introduced in a following patch, keeping them unconditionally in the common routine will not work. Wrap all of those PAGING-only configurations together into helpers. Do a hwpt_is_paging check whenever calling them or their fallback routines. Link: https://lore.kernel.org/r/20231026043938.63898-4-yi.l.liu@intel.com Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe commit 9744a7ab62cc7354096aaff788c08b947f86ba60 Author: Jason Gunthorpe Date: Wed Oct 25 21:39:30 2023 -0700 iommufd: Rename IOMMUFD_OBJ_HW_PAGETABLE to IOMMUFD_OBJ_HWPT_PAGING To add a new IOMMUFD_OBJ_HWPT_NESTED, rename the HWPT object to confine it to PAGING hwpts/domains. The following patch will separate the hwpt structure as well. Link: https://lore.kernel.org/r/20231026043938.63898-3-yi.l.liu@intel.com Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe commit 54d606816b32401de5431f6776a78b1de135bfa2 Author: Lu Baolu Date: Wed Oct 25 21:39:29 2023 -0700 iommu: Add IOMMU_DOMAIN_NESTED Introduce a new domain type for a user I/O page table, which is nested on top of another user space address represented by a PAGING domain. This new domain can be allocated by the domain_alloc_user op, and attached to a device through the existing iommu_attach_device/group() interfaces. The mappings of a nested domain are managed by user space software, so it is not necessary to have map/unmap callbacks. Link: https://lore.kernel.org/r/20231026043938.63898-2-yi.l.liu@intel.com Signed-off-by: Lu Baolu Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe commit a977ee945e9490fabd33dcc33399e992252598cf Author: Thippeswamy Havalige Date: Tue Oct 3 23:04:51 2023 +0530 PCI: xilinx-cpm: Move IRQ definitions to a common header Move the interrupt bit definitions to the pcie-xilinx-common.h file, which then can be shared between pcie-xilinx-cpm and the new xilinx-xdma drivers. While at it, also rename them so these definitions are not CPM-specific. No functional change intended. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/20231003173453.938190-2-thippeswamy.havalige@amd.com Signed-off-by: Thippeswamy Havalige Signed-off-by: Bharat Kumar Gogada Signed-off-by: Krzysztof Wilczyński commit 3eb030c60835668997d5763b1a0c7938faf169f6 Author: Herve Codina Date: Tue Oct 17 13:02:17 2023 +0200 of: address: Remove duplicated functions The recently added of_bus_default_flags_translate() performs the exact same operation as of_bus_pci_translate() and of_bus_isa_translate(). Avoid duplicated code replacing both of_bus_pci_translate() and of_bus_isa_translate() with of_bus_default_flags_translate(). Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20231017110221.189299-3-herve.codina@bootlin.com Signed-off-by: Rob Herring commit 42604f8eb7ba04b589375049cc76282dad4677d2 Author: Herve Codina Date: Tue Oct 17 13:02:16 2023 +0200 of: address: Fix address translation when address-size is greater than 2 With the recent addition of of_pci_prop_ranges() in commit 407d1a51921e ("PCI: Create device tree node for bridge"), the ranges property can have a 3 cells child address, a 3 cells parent address and a 2 cells child size. A range item property for a PCI device is filled as follow: 0 0 <-- Child --> <-- Parent (PCI definition) --> <- BAR size (64bit) --> This allow to translate BAR addresses from the DT. For instance: pci@0,0 { #address-cells = <0x03>; #size-cells = <0x02>; device_type = "pci"; compatible = "pci11ab,100", "pciclass,060400", "pciclass,0604"; ranges = <0x82000000 0x00 0xe8000000 0x82000000 0x00 0xe8000000 0x00 0x4400000>; ... dev@0,0 { #address-cells = <0x03>; #size-cells = <0x02>; compatible = "pci1055,9660", "pciclass,020000", "pciclass,0200"; /* Translations for BAR0 to BAR5 */ ranges = <0x00 0x00 0x00 0x82010000 0x00 0xe8000000 0x00 0x2000000 0x01 0x00 0x00 0x82010000 0x00 0xea000000 0x00 0x1000000 0x02 0x00 0x00 0x82010000 0x00 0xeb000000 0x00 0x800000 0x03 0x00 0x00 0x82010000 0x00 0xeb800000 0x00 0x800000 0x04 0x00 0x00 0x82010000 0x00 0xec000000 0x00 0x20000 0x05 0x00 0x00 0x82010000 0x00 0xec020000 0x00 0x2000>; ... pci-ep-bus@0 { #address-cells = <0x01>; #size-cells = <0x01>; compatible = "simple-bus"; /* Translate 0xe2000000 to BAR0 and 0xe0000000 to BAR1 */ ranges = <0xe2000000 0x00 0x00 0x00 0x2000000 0xe0000000 0x01 0x00 0x00 0x1000000>; ... }; }; }; During the translation process, the "default-flags" map() function is used to select the matching item in the ranges table and determine the address offset from this matching item. This map() function simply calls of_read_number() and when address-size is greater than 2, the map() function skips the extra high address part (ie part over 64bit). This lead to a wrong matching item and a wrong offset computation. Also during the translation itself, the extra high part related to the parent address is not present in the translated address. Fix the "default-flags" map() and translate() in order to take into account the child extra high address part in map() and the parent extra high address part in translate() and so having a correct address translation for ranges patterns such as the one given in the example above. Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20231017110221.189299-2-herve.codina@bootlin.com Signed-off-by: Rob Herring commit 1df91d85f29f4f1bf34b74e63a5df4f5943f18c1 Merge: fad5bf2e2c900 374de39d38f97 Author: Ulf Hansson Date: Thu Oct 26 16:01:03 2023 +0200 pmdomain: Merge branch fixes into next Merge the pmdomain fixes for v6.6-rc[n] into the next branch, to allow them to get tested together with the new pmdomain changes that are targeted for v6.7. Signed-off-by: Ulf Hansson commit ea41b880cc85f0a992571f66e4554a69f7806246 Author: Nikolay Aleksandrov Date: Thu Oct 26 12:41:05 2023 +0300 netkit: Remove explicit active/peer ptr initialization Remove the explicit NULLing of active/peer pointers and rely on the implicit one done at net device allocation. Suggested-by: Jiri Pirko Signed-off-by: Nikolay Aleksandrov Signed-off-by: Daniel Borkmann Reviewed-by: Jiri Pirko Acked-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20231026094106.1505892-2-razor@blackwall.org commit 374de39d38f97b0e58cfee88da590b2d056ccf7f Author: Pengfei Li Date: Sat Oct 21 02:59:49 2023 +0800 pmdomain: imx: Make imx pgc power domain also set the fwnode Currently, The imx pgc power domain doesn't set the fwnode pointer, which results in supply regulator device can't get consumer imx pgc power domain device from fwnode when creating a link. This causes the driver core to instead try to create a link between the parent gpc device of imx pgc power domain device and supply regulator device. However, at this point, the gpc device has already been bound, and the link creation will fail. So adding the fwnode pointer to the imx pgc power domain device will fix this issue. Signed-off-by: Pengfei Li Tested-by: Emil Kronborg Fixes: 3fb16866b51d ("driver core: fw_devlink: Make cycle detection more robust") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231020185949.537083-1-pengfei.li_1@nxp.com Signed-off-by: Ulf Hansson commit e2b0bac1aae44d603817b55d62553f3d3557d5a7 Author: Krzysztof Kozlowski Date: Wed Oct 18 16:57:50 2023 +0200 dt-bindings: pinctrl: qcom,sa8775p-tlmm: add missing wakeup-parent Add missing wakeup-parent property, already used by DTS to indicate that pins are wakeup capable: sa8775p-ride.dtb: pinctrl@f000000: 'wakeup-parent' does not match any of the regexes: '-state$', 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20231018145750.429385-1-krzysztof.kozlowski@linaro.org Signed-off-by: Linus Walleij commit 399f6185a1c02f39bcadb8749bc2d9d48685816f Author: Yafang Shao Date: Wed Oct 25 03:11:44 2023 +0000 selftests/bpf: Fix selftests broken by mitigations=off When we configure the kernel command line with 'mitigations=off' and set the sysctl knob 'kernel.unprivileged_bpf_disabled' to 0, the commit bc5bc309db45 ("bpf: Inherit system settings for CPU security mitigations") causes issues in the execution of `test_progs -t verifier`. This is because 'mitigations=off' bypasses Spectre v1 and Spectre v4 protections. Currently, when a program requests to run in unprivileged mode (kernel.unprivileged_bpf_disabled = 0), the BPF verifier may prevent it from running due to the following conditions not being enabled: - bypass_spec_v1 - bypass_spec_v4 - allow_ptr_leaks - allow_uninit_stack While 'mitigations=off' enables the first two conditions, it does not enable the latter two. As a result, some test cases in 'test_progs -t verifier' that were expected to fail to run may run successfully, while others still fail but with different error messages. This makes it challenging to address them comprehensively. Moreover, in the future, we may introduce more fine-grained control over CPU mitigations, such as enabling only bypass_spec_v1 or bypass_spec_v4. Given the complexity of the situation, rather than fixing each broken test case individually, it's preferable to skip them when 'mitigations=off' is in effect and introduce specific test cases for the new 'mitigations=off' scenario. For instance, we can introduce new BTF declaration tags like '__failure__nospec', '__failure_nospecv1' and '__failure_nospecv4'. In this patch, the approach is to simply skip the broken test cases when 'mitigations=off' is enabled. The result of `test_progs -t verifier` as follows after this commit, Before this commit ================== - without 'mitigations=off' - kernel.unprivileged_bpf_disabled = 2 Summary: 74/948 PASSED, 388 SKIPPED, 0 FAILED - kernel.unprivileged_bpf_disabled = 0 Summary: 74/1336 PASSED, 0 SKIPPED, 0 FAILED <<<< - with 'mitigations=off' - kernel.unprivileged_bpf_disabled = 2 Summary: 74/948 PASSED, 388 SKIPPED, 0 FAILED - kernel.unprivileged_bpf_disabled = 0 Summary: 63/1276 PASSED, 0 SKIPPED, 11 FAILED <<<< 11 FAILED After this commit ================= - without 'mitigations=off' - kernel.unprivileged_bpf_disabled = 2 Summary: 74/948 PASSED, 388 SKIPPED, 0 FAILED - kernel.unprivileged_bpf_disabled = 0 Summary: 74/1336 PASSED, 0 SKIPPED, 0 FAILED <<<< - with this patch, with 'mitigations=off' - kernel.unprivileged_bpf_disabled = 2 Summary: 74/948 PASSED, 388 SKIPPED, 0 FAILED - kernel.unprivileged_bpf_disabled = 0 Summary: 74/948 PASSED, 388 SKIPPED, 0 FAILED <<<< SKIPPED Fixes: bc5bc309db45 ("bpf: Inherit system settings for CPU security mitigations") Reported-by: Alexei Starovoitov Signed-off-by: Yafang Shao Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Closes: https://lore.kernel.org/bpf/CAADnVQKUBJqg+hHtbLeeC2jhoJAWqnmRAzXW3hmUCNSV9kx4sQ@mail.gmail.com Link: https://lore.kernel.org/bpf/20231025031144.5508-1-laoar.shao@gmail.com commit 37db10bc247d5d0b448babd7ff386f092246e732 Author: Viktor Malik Date: Wed Oct 25 08:19:14 2023 +0200 samples/bpf: Allow building with custom bpftool samples/bpf build its own bpftool boostrap to generate vmlinux.h as well as some BPF objects. This is a redundant step if bpftool has been already built, so update samples/bpf/Makefile such that it accepts a path to bpftool passed via the BPFTOOL variable. The approach is practically the same as tools/testing/selftests/bpf/Makefile uses. Signed-off-by: Viktor Malik Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/bd746954ac271b02468d8d951ff9f11e655d485b.1698213811.git.vmalik@redhat.com commit f56bcfadf7d6d56b099726df4fc262b76486b0e0 Author: Viktor Malik Date: Wed Oct 25 08:19:13 2023 +0200 samples/bpf: Fix passing LDFLAGS to libbpf samples/bpf/Makefile passes LDFLAGS=$(TPROGS_LDFLAGS) to libbpf build without surrounding quotes, which may cause compilation errors when passing custom TPROGS_USER_LDFLAGS. For example: $ make -C samples/bpf/ TPROGS_USER_LDFLAGS="-Wl,--as-needed -specs=/usr/lib/gcc/x86_64-redhat-linux/13/libsanitizer.spec" make: Entering directory './samples/bpf' make -C ../../ M=./samples/bpf BPF_SAMPLES_PATH=./samples/bpf make[1]: Entering directory '.' make -C ./samples/bpf/../../tools/lib/bpf RM='rm -rf' EXTRA_CFLAGS="-Wall -O2 -Wmissing-prototypes -Wstrict-prototypes -I./usr/include -I./tools/testing/selftests/bpf/ -I./samples/bpf/libbpf/include -I./tools/include -I./tools/perf -I./tools/lib -DHAVE_ATTR_TEST=0" \ LDFLAGS=-Wl,--as-needed -specs=/usr/lib/gcc/x86_64-redhat-linux/13/libsanitizer.spec srctree=./samples/bpf/../../ \ O= OUTPUT=./samples/bpf/libbpf/ DESTDIR=./samples/bpf/libbpf prefix= \ ./samples/bpf/libbpf/libbpf.a install_headers make: invalid option -- 'c' make: invalid option -- '=' make: invalid option -- '/' make: invalid option -- 'u' make: invalid option -- '/' [...] Fix the error by properly quoting $(TPROGS_LDFLAGS). Suggested-by: Donald Zickus Signed-off-by: Viktor Malik Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/c690de6671cc6c983d32a566d33fd7eabd18b526.1698213811.git.vmalik@redhat.com commit 870f09f1ba3014e2c157b14299c172b4bb716638 Author: Viktor Malik Date: Wed Oct 25 08:19:12 2023 +0200 samples/bpf: Allow building with custom CFLAGS/LDFLAGS Currently, it is not possible to specify custom flags when building samples/bpf. The flags are defined in TPROGS_CFLAGS/TPROGS_LDFLAGS variables, however, when trying to override those from the make command, compilation fails. For example, when trying to build with PIE: $ make -C samples/bpf TPROGS_CFLAGS="-fpie" TPROGS_LDFLAGS="-pie" This is because samples/bpf/Makefile updates these variables, especially appends include paths to TPROGS_CFLAGS and these updates are overridden by setting the variables from the make command. This patch introduces variables TPROGS_USER_CFLAGS/TPROGS_USER_LDFLAGS for this purpose, which can be set from the make command and their values are propagated to TPROGS_CFLAGS/TPROGS_LDFLAGS. Signed-off-by: Viktor Malik Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/2d81100b830a71f0e72329cc7781edaefab75f62.1698213811.git.vmalik@redhat.com commit 7dc5a2779f84c3b822789b8423ebb70fcd8dc89c Author: Helen Koike Date: Mon Oct 23 21:45:25 2023 -0300 drm/ci: docs: add step about how to request privileges Clarify the procedure developer must follow to request privileges to run tests on Freedesktop gitlab CI. This measure was added to avoid untrusted people to misuse the infrastructure. Signed-off-by: Helen Koike Reviewed-by: David Heidelberg Link: https://lore.kernel.org/r/20231024004525.169002-11-helen.koike@collabora.com Signed-off-by: Maxime Ripard commit c2cdbb7a30fe6ff43c1a068121ba332f7399ed54 Author: Helen Koike Date: Mon Oct 23 21:45:24 2023 -0300 drm/ci: do not automatically retry on error Since the kernel doesn't use a bot like Mesa that requires tests to pass in order to merge the patches, leave it to developers and/or maintainers to manually retry. Suggested-by: Rob Clark Signed-off-by: Helen Koike Reviewed-by: David Heidelberg Link: https://lore.kernel.org/r/20231024004525.169002-10-helen.koike@collabora.com Signed-off-by: Maxime Ripard commit 80b6434b57a137afa965dc762716c30938b4e6bf Author: Helen Koike Date: Mon Oct 23 21:45:23 2023 -0300 drm/ci: export kernel config Export the resultant kernel config, making it easier to verify if the resultant config was correctly generated. Suggested-by: Rob Clark Signed-off-by: Helen Koike Acked-by: Dmitry Baryshkov Reviewed-by: David Heidelberg Link: https://lore.kernel.org/r/20231024004525.169002-9-helen.koike@collabora.com Signed-off-by: Maxime Ripard commit 5fa8f128462c5b3b20576b12286dca7fe95b3af1 Author: Helen Koike Date: Mon Oct 23 21:45:22 2023 -0300 drm/ci: increase i915 job timeout to 1h30m With the new sharding, the default job timeout is not enough for i915 and their jobs are failing before completing. See below the current execution time: 🞋 job i915:tgl 8/8 has new status: success (37m3s) 🞋 job i915:tgl 7/8 has new status: success (19m43s) 🞋 job i915:tgl 6/8 has new status: success (21m47s) 🞋 job i915:tgl 5/8 has new status: success (18m16s) 🞋 job i915:tgl 4/8 has new status: success (21m43s) 🞋 job i915:tgl 3/8 has new status: success (17m59s) 🞋 job i915:tgl 2/8 has new status: success (22m15s) 🞋 job i915:tgl 1/8 has new status: success (18m52s) 🞋 job i915:cml 2/2 has new status: success (1h19m58s) 🞋 job i915:cml 1/2 has new status: success (55m45s) 🞋 job i915:whl 2/2 has new status: success (1h8m56s) 🞋 job i915:whl 1/2 has new status: success (54m3s) 🞋 job i915:kbl 3/3 has new status: success (37m43s) 🞋 job i915:kbl 2/3 has new status: success (36m37s) 🞋 job i915:kbl 1/3 has new status: success (34m52s) 🞋 job i915:amly 2/2 has new status: success (1h7m60s) 🞋 job i915:amly 1/2 has new status: success (59m18s) 🞋 job i915:glk 2/2 has new status: success (58m26s) 🞋 job i915:glk 1/2 has new status: success (50m23s) 🞋 job i915:apl 3/3 has new status: success (1h6m39s) 🞋 job i915:apl 2/3 has new status: success (1h4m45s) 🞋 job i915:apl 1/3 has new status: success (1h7m38s) (generated with ci_run_n_monitor.py script) The longest job is 1h19m58s, so adjust the timeout. Signed-off-by: Helen Koike Link: https://lore.kernel.org/r/20231024004525.169002-8-helen.koike@collabora.com Signed-off-by: Maxime Ripard commit 68a3f17732d1d72be958576b6ce0e6c29686a40b Author: Helen Koike Date: Mon Oct 23 21:45:21 2023 -0300 drm/ci: add subset-1-gfx to LAVA_TAGS and adjust shards The Collabora Lava farm added a tag called `subset-1-gfx` to half of devices the graphics community use. Lets use this tag so we don't occupy all the resources. This is particular important because Mesa3D shares the resources with DRM-CI and use them to do pre-merge tests, so it can block developers from getting their patches merged. Signed-off-by: Helen Koike Reviewed-by: David Heidelberg Link: https://lore.kernel.org/r/20231024004525.169002-7-helen.koike@collabora.com Signed-off-by: Maxime Ripard commit 81224d948ceb8433eb25fe33528b0696f1fcfc42 Author: Helen Koike Date: Mon Oct 23 21:45:20 2023 -0300 drm/ci: clean up xfails (specially flakes list) Since the script that collected the list of the expectation files was bogus and placing test to the flakes list incorrectly, restart the expectation files with the correct script. This reduces a lot the number of tests in the flakes list. Signed-off-by: Helen Koike Reviewed-by: David Heidelberg Link: https://lore.kernel.org/r/20231024004525.169002-6-helen.koike@collabora.com Signed-off-by: Maxime Ripard commit 57e3cd26c14bc53666f9cbaaca000fdcbff9ee5b Author: Helen Koike Date: Mon Oct 23 21:45:19 2023 -0300 drm/ci: uprev IGT and make sure core_getversion is run IGT has recently merged a patch that makes code_getversion test to fails if the driver isn't loaded or if it isn't the expected one defined in variable IGT_FORCE_DRIVER. Without this test, jobs were passing when the driver didn't load or probe for some reason, giving the illusion that everything was ok. Uprev IGT to include this modification and include core_getversion test in all the shards. Signed-off-by: Helen Koike Reviewed-by: David Heidelberg Link: https://lore.kernel.org/r/20231024004525.169002-5-helen.koike@collabora.com Signed-off-by: Maxime Ripard commit d70896f296ff24764a7ba90efe1afa6c680e104c Author: Helen Koike Date: Mon Oct 23 21:45:18 2023 -0300 drm/ci: add helper script update-xfails.py Add helper script that given a gitlab pipeline url, analyse which are the failures and flakes and update the xfails folder accordingly. Example: Trigger a pipeline in gitlab infrastructure, than re-try a few jobs more than once (so we can have data if failures are consistent across jobs with the same name or if they are flakes) and execute: update-xfails.py https://gitlab.freedesktop.org/helen.fornazier/linux/-/pipelines/970661 git diff should show you that it updated files in xfails folder. Signed-off-by: Helen Koike Tested-by: Vignesh Raman Reviewed-by: David Heidelberg Link: https://lore.kernel.org/r/20231024004525.169002-4-helen.koike@collabora.com Signed-off-by: Maxime Ripard commit 2b126e065ea0cea6cac2aa6c9b9d3ec014a006c9 Author: Helen Koike Date: Mon Oct 23 21:45:17 2023 -0300 drm/ci: fix DEBIAN_ARCH and get amdgpu probing amdgpu driver wasn't loading because amdgpu firmware wasn't being installed in the rootfs due to the wrong DEBIAN_ARCH variable. rename ARCH to DEBIAN_ARCH also, so we don't have the confusing DEBIAN_ARCH, KERNEL_ARCH and ARCH. Signed-off-by: Helen Koike Reviewed-by: David Heidelberg Link: https://lore.kernel.org/r/20231024004525.169002-3-helen.koike@collabora.com Signed-off-by: Maxime Ripard commit 1887de00867d7a700babefc9647ccb9e0d11ee56 Author: Helen Koike Date: Mon Oct 23 21:45:16 2023 -0300 drm/ci: uprev mesa version: fix container build & crosvm When building containers, some rust packages were installed without locking the dependencies version, which got updated and started giving errors like: error: failed to compile `bindgen-cli v0.62.0`, intermediate artifacts can be found at `/tmp/cargo-installkNKRwf` Caused by: package `rustix v0.38.13` cannot be built because it requires rustc 1.63 or newer, while the currently active rustc version is 1.60.0 A patch to Mesa was added fixing this error, so update it. Also, commit in linux kernel 6.6 rc3 broke booting in crosvm. Mesa has upreved crosvm to fix this issue. Signed-off-by: Helen Koike [crosvm mesa update] Co-Developed-by: Vignesh Raman Signed-off-by: Vignesh Raman [v1 container build uprev] Tested-by: Jessica Zhang Acked-by: Jessica Zhang Reviewed-by: David Heidelberg Link: https://lore.kernel.org/r/20231024004525.169002-2-helen.koike@collabora.com Signed-off-by: Maxime Ripard commit b829e932eeef272c1d898cc316ce9abcc041b4c1 Author: Rob Clark Date: Mon Oct 2 09:47:14 2023 -0700 drm/ci: Enable CONFIG_BACKLIGHT_CLASS_DEVICE Dependency for CONFIG_DRM_PANEL_EDP. Missing this was causing the drm driver to not probe on devices that use panel-edp. Signed-off-by: Rob Clark Tested-by: Helen Koike Acked-by: Helen Koike Link: https://lore.kernel.org/r/20231002164715.157298-1-robdclark@gmail.com Signed-off-by: Maxime Ripard commit b1abb484417ec8edd68df0c9bf8cb1c1fc035fd2 Author: Dmitry Baryshkov Date: Sun Oct 8 16:23:20 2023 +0300 drm/ci: force-enable CONFIG_MSM_MMCC_8996 as built-in Enable CONFIG_MSM_MMCC_8996, the multimedia clock controller on Qualcomm MSM8996 to prevent the the board from hitting the probe deferral timeouts in CI run. Signed-off-by: Dmitry Baryshkov Tested-by: Helen Koike Acked-by: Helen Koike Link: https://lore.kernel.org/r/20231008132320.762542-2-dmitry.baryshkov@linaro.org Signed-off-by: Maxime Ripard commit f9b4fbcb4567ed5fc4af76b5ef82b71417ff9adf Author: Dmitry Baryshkov Date: Sun Oct 8 16:23:19 2023 +0300 drm/ci: pick up -external-fixes from the merge target repo In case of the merge requests it might be useful to push repo-specific fixes which have not yet propagated to the -external-fixes branch in the main UPSTREAM_REPO. For example, in case of drm/msm development, we are staging fixes locally for testing, before pushing them to the drm/drm repo. Thus, if the CI run was triggered by merge request, also pick up the -external fixes basing on the the CI_MERGE target repo / and branch. Signed-off-by: Dmitry Baryshkov Acked-by: Helen Koike Link: https://lore.kernel.org/r/20231008132320.762542-1-dmitry.baryshkov@linaro.org Signed-off-by: Maxime Ripard commit ef113733c288eccadc105579b8e8c1bfdcc09ad1 Author: Beniamino Galvani Date: Wed Oct 25 11:44:41 2023 +0200 bareudp: use ports to lookup route The source and destination ports should be taken into account when determining the route destination; they can affect the result, for example in case there are routing rules defined. Signed-off-by: Beniamino Galvani Reviewed-by: Przemek Kitszel Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20231025094441.417464-1-b.galvani@gmail.com Signed-off-by: Paolo Abeni commit bf224871c27a7c7e2146d667176977ffe3752750 Merge: 78b1f56a6f962 ffc843fc9c7a4 a60ec4485f1c7 e68cb15bdc93b Author: Rafael J. Wysocki Date: Thu Oct 26 15:16:03 2023 +0200 Merge branches 'pm-sleep', 'powercap' and 'pm-tools' Merge updates related to system sleep handling, one power capping update and one PM utility update for 6.7-rc1: - Use __get_safe_page() rather than touching the list in hibernation snapshot code (Brian Geffon). - Fix symbol export for _SIMPLE_ variants of _PM_OPS() (Raag Jadav). - Clean up sync_read handling in snapshot_write_next() (Brian Geffon). - Fix kerneldoc comments for swsusp_check() and swsusp_close() to better match code (Christoph Hellwig). - Downgrade BIOS locked limits pr_warn() in the Intel RAPL power capping driver to pr_debug() (Ville Syrjälä). - Change the minimum python version for the intel_pstate_tracer utility from 2.7 to 3.6 (Doug Smythies). * pm-sleep: PM: hibernate: fix the kerneldoc comment for swsusp_check() and swsusp_close() PM: hibernate: Clean up sync_read handling in snapshot_write_next() PM: sleep: Fix symbol export for _SIMPLE_ variants of _PM_OPS() PM: hibernate: Use __get_safe_page() rather than touching the list * powercap: powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug() * pm-tools: tools/power/x86/intel_pstate_tracer: python minimum version commit 78b1f56a6f9623d5ac42dc2e9860a58273e8ccae Merge: c1bdc9aaf8d05 7c35584899ff4 Author: Rafael J. Wysocki Date: Thu Oct 26 15:14:38 2023 +0200 Merge branch 'pm-cpufreq' Merge cpufreq updates for 6.7-rc1: - Add support for several Qualcomm SoC versions and other similar changes (Christian Marangi, Dmitry Baryshkov, Luca Weiss, Neil Armstrong, Richard Acayan, Robert Marko, Rohit Agarwal, Stephan Gerhold and Varadarajan Narayanan). - Clean up the tegra cpufreq driver (Sumit Gupta). - Use of_property_read_reg() to parse "reg" in pmac32 driver (Rob Herring). - Add support for TI's am62p5 Soc (Bryan Brattlof). - Make ARM_BRCMSTB_AVS_CPUFREQ depends on !ARM_SCMI_CPUFREQ (Florian Fainelli). - Update Kconfig to mention i.MX7 as well (Alexander Stein). - Revise global turbo disable check in intel_pstate (Srinivas Pandruvada). - Carry out initialization of sg_cpu in the schedutil cpufreq governor in one loop (Liao Chang). - Simplify the condition for storing 'down_threshold' in the conservative cpufreq governor (Liao Chang). - Use fine-grained mutex in the userspace cpufreq governor (Liao Chang). - Move is_managed indicator in the userspace cpufreq governor into a per-policy structure (Liao Chang). - Rebuild sched-domains when removing cpufreq driver (Pierre Gondois). - Fix buffer overflow detection in trans_stats() (Christian Marangi). * pm-cpufreq: (32 commits) dt-bindings: cpufreq: qcom-hw: document SM8650 CPUFREQ Hardware cpufreq: arm: Kconfig: Add i.MX7 to supported SoC for ARM_IMX_CPUFREQ_DT cpufreq: qcom-nvmem: add support for IPQ8064 cpufreq: qcom-nvmem: also accept operating-points-v2-krait-cpu cpufreq: qcom-nvmem: drop pvs_ver for format a fuses dt-bindings: cpufreq: qcom-cpufreq-nvmem: Document krait-cpu cpufreq: qcom-nvmem: add support for IPQ6018 dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ6018 cpufreq: qcom-nvmem: Add MSM8909 cpufreq: qcom-nvmem: Simplify driver data allocation cpufreq: stats: Fix buffer overflow detection in trans_stats() dt-bindings: cpufreq: cpufreq-qcom-hw: Add SDX75 compatible cpufreq: ARM_BRCMSTB_AVS_CPUFREQ cannot be used with ARM_SCMI_CPUFREQ cpufreq: ti-cpufreq: Add opp support for am62p5 SoCs cpufreq: dt-platdev: add am62p5 to blocklist cpufreq: tegra194: remove redundant AND with cpu_online_mask cpufreq: tegra194: use refclk delta based loop instead of udelay cpufreq: tegra194: save CPU data to avoid repeated SMP calls cpufreq: Rebuild sched-domains when removing cpufreq driver cpufreq: userspace: Move is_managed indicator into per-policy structure ... commit c1bdc9aaf8d05e12c80f6cbd26f187f29fbe163a Merge: 067e61399d3d5 af6664668de98 Author: Rafael J. Wysocki Date: Thu Oct 26 15:13:00 2023 +0200 Merge branch 'pm-devfreq' Merge devfreq updates for 6.7-rc1: - Switch to dev_pm_opp_find_freq_(ceil/floor)_indexed() APIs to support specific devices like UFS which handle multiple clocks through OPP (Operationg Performance Point) framework (Manivannan Sadhasivam). - Add perf support to the Rockchip DFI (DDR Monitor Module) devfreq- event driver: * Generalize rockchip-dfi.c to support new RK3568/RK3588 using different DDR type (Sascha Hauer). * Convert devicetree bidning document format to yaml (Sascha Hauer). * Add perf support for DFI (a unit suitable for measuring DDR utilization) to rockchip-dfi.c to extend DFI usage (Sascha Hauer). - Add locking to the OPP handling code in the Mediatek CCI devfreq driver, because the voltage of shared OPP might be changed by multiple drivers (Mark Tseng, Dan Carpenter). - Use device_get_match_data() in the Samsung Exynos PPMU devfreq-event driver (Rob Herring). * pm-devfreq: (26 commits) dt-bindings: devfreq: event: rockchip,dfi: Add rk3588 support dt-bindings: devfreq: event: rockchip,dfi: Add rk3568 support dt-bindings: devfreq: event: convert Rockchip DFI binding to yaml PM / devfreq: rockchip-dfi: add support for RK3588 PM / devfreq: rockchip-dfi: account for multiple DDRMON_CTRL registers PM / devfreq: rockchip-dfi: make register stride SoC specific PM / devfreq: rockchip-dfi: Add perf support PM / devfreq: rockchip-dfi: give variable a better name PM / devfreq: rockchip-dfi: Prepare for multiple users PM / devfreq: rockchip-dfi: Pass private data struct to internal functions PM / devfreq: rockchip-dfi: Handle LPDDR4X PM / devfreq: rockchip-dfi: Handle LPDDR2 correctly PM / devfreq: rockchip-dfi: Add RK3568 support PM / devfreq: rockchip-dfi: Clean up DDR type register defines PM / devfreq: rk3399_dmc,dfi: generalize DDRTYPE defines PM / devfreq: rockchip-dfi: introduce channel mask PM / devfreq: rockchip-dfi: Use free running counter PM / devfreq: mediatek: unlock on error in mtk_ccifreq_target() PM / devfreq: exynos-ppmu: Use device_get_match_data() PM / devfreq: rockchip-dfi: dfi store raw values in counter struct ... commit f4cb34a75e4a4aee09ff832ea2147cf8322a6a7f Merge: 3660e641ef68d c7b59371fe56f 5ccd40c5c7ada 50cbdaf1b93a2 Author: Rafael J. Wysocki Date: Thu Oct 26 15:06:01 2023 +0200 Merge branches 'acpi-ac', 'acpi-pad' and 'pnp' Merge updates of the ACPI AC and ACPI PAD drivers and PNP updates for 6.7-rc1: - Switch over the ACPI AC and ACPI PAD drivers to using the platform driver interface which, is more logically consistent than binding a driver directly to an ACPI device object, and clean them up (Michal Wilczynski). - Replace strncpy() in the PNP code with either memcpy() or strscpy() as appropriate (Justin Stitt). - Clean up coding style in pnp.h (GuoHua Cheng). * acpi-ac: ACPI: AC: Rename ACPI device from device to adev ACPI: AC: Replace acpi_driver with platform_driver ACPI: AC: Use string_choices API instead of ternary operator ACPI: AC: Remove redundant checks * acpi-pad: ACPI: acpi_pad: Rename ACPI device from device to adev ACPI: acpi_pad: Use dev groups for sysfs ACPI: acpi_pad: Replace acpi_driver with platform_driver * pnp: PNP: replace deprecated strncpy() with memcpy() PNP: ACPI: replace deprecated strncpy() with strscpy() PNP: Clean up coding style in pnp.h commit 3660e641ef68dc2503e3c3120814e80359e0e66b Merge: e8c3c7f97aa79 470508f63ad24 Author: Rafael J. Wysocki Date: Thu Oct 26 15:04:49 2023 +0200 Merge branch 'acpi-bus' Merge ACPI bus type driver updates for 6.7-rc1: - Add context argument to acpi_dev_install_notify_handler() (Rafael Wysocki). - Clarify ACPI bus concepts in the ACPI device enumeration documentation (Rafael Wysocki). * acpi-bus: ACPI: bus: Add context argument to acpi_dev_install_notify_handler() ACPI: docs: enumeration: Clarify ACPI bus concepts commit 6a2e332c2cbddd17d7dcb8f334953593f1324c8e Author: Mark Brown Date: Mon Oct 23 18:19:12 2023 +0100 regmap: kunit: Add test for cache sync interaction with ranges Hector Martin reports that since when doing a cache sync we enable cache bypass if the selector register for a range is cached then we might leave the physical selector register pointing to a different value to that which we have in the cache. If we then try to write to the page that our cache tells us is selected we will not update the selector register and write to the wrong page. Add a test case covering this. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20231023-regmap-test-window-cache-v1-2-d8a71f441968@kernel.org Signed-off-by: Mark Brown commit fabe32cc1eca7857837abcb56b242bc4845b7067 Author: Mark Brown Date: Mon Oct 23 18:19:11 2023 +0100 regmap: kunit: Fix marking of the range window as volatile For some reason the regmap used for testing ranges was not including the end of the range of paged registers as volatile since it found the end by counting from the selector register rather than the base of the window. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20231023-regmap-test-window-cache-v1-1-d8a71f441968@kernel.org Signed-off-by: Mark Brown commit e8c3c7f97aa79c93713aecba5bdf83273076cf5d Merge: f3c0d6a1a25f2 891ddc03e2f43 bc8f7abe97159 553921875ff7b 6fdba3db14802 Author: Rafael J. Wysocki Date: Thu Oct 26 14:59:52 2023 +0200 Merge branches 'acpi-ec', 'acpi-sysfs', 'acpi-misc' and 'acpi-uid' Merge ACPI EC driver updates, ACPI sysfs interface updates, misc updates related to ACPI and changes related to ACPI _UID handling for 6.7-rc1: - Add EC GPE detection quirk for HP 250 G7 Notebook PC (Jonathan Denose). - Fix and clean up create_pnp_modalias() and create_of_modalias() (Christophe JAILLET). - Modify 2 pieces of code to use acpi_evaluate_dsm_typed() (Andy Shevchenko). - Define acpi_dev_uid_match() for matching _UID and use it in several places (Raag Jadav). - Use acpi_device_uid() for fetching _UID in 2 places (Raag Jadav). * acpi-ec: ACPI: EC: Add quirk for HP 250 G7 Notebook PC * acpi-sysfs: ACPI: sysfs: Clean up create_pnp_modalias() and create_of_modalias() ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() * acpi-misc: ACPI: x86: s2idle: Switch to use acpi_evaluate_dsm_typed() ACPI: PCI: Switch to use acpi_evaluate_dsm_typed() * acpi-uid: perf: arm_cspmu: use acpi_dev_hid_uid_match() for matching _HID and _UID ACPI: x86: use acpi_dev_uid_match() for matching _UID ACPI: utils: use acpi_dev_uid_match() for matching _UID pinctrl: intel: use acpi_dev_uid_match() for matching _UID ACPI: utils: Introduce acpi_dev_uid_match() for matching _UID perf: qcom: use acpi_device_uid() for fetching _UID ACPI: sysfs: use acpi_device_uid() for fetching _UID commit f3c0d6a1a25f24421aa0554da52cd2158cd162dc Merge: ea4007528c8a2 35a341c9b25da 2e89345764c6a fac475aab70b2 aa2e505c80ba6 Author: Rafael J. Wysocki Date: Thu Oct 26 14:58:20 2023 +0200 Merge branches 'acpi-video', 'acpi-prm', 'acpi-apei' and 'acpi-pcc' Merge ACPI backlight driver updates, ACPI APEI updates, ACPI PRM updates and changes related to ACPI PCC for 6.7-rc1: - Add acpi_backlight=vendor quirk for Toshiba Portégé R100 (Ondrej Zary). - Add "vendor" backlight quirks for 3 Lenovo x86 Android tablets (Hans de Goede). - Move Xiaomi Mi Pad 2 backlight quirk to its own section (Hans de Goede). - Annotate struct prm_module_info with __counted_by (Kees Cook). - Fix AER info corruption in aer_recover_queue() when error status data has multiple sections (Shiju Jose). - Make APEI use ERST max execution time value for slow devices (Jeshua Smith). - Add support for platform notification handling to the PCC mailbox driver and modify it to support shared interrupts for multiple subspaces (Huisong Li). - Define common macros to use when referring to various bitfields in the PCC generic communications channel command and status fields and use them in some drivers (Sudeep Holla). * acpi-video: ACPI: video: Add acpi_backlight=vendor quirk for Toshiba Portégé R100 ACPI: video: Add "vendor" quirks for 3 Lenovo x86 Android tablets ACPI: video: Move Xiaomi Mi Pad 2 quirk to its own section * acpi-prm: ACPI: PRM: Annotate struct prm_module_info with __counted_by * acpi-apei: ACPI: APEI: Use ERST timeout for slow devices ACPI: APEI: Fix AER info corruption when error status data has multiple sections * acpi-pcc: soc: kunpeng_hccs: Migrate to use generic PCC shmem related macros hwmon: (xgene) Migrate to use generic PCC shmem related macros i2c: xgene-slimpro: Migrate to use generic PCC shmem related macros ACPI: PCC: Add PCC shared memory region command and status bitfields mailbox: pcc: Support shared interrupt for multiple subspaces mailbox: pcc: Add support for platform notification handling commit ea4007528c8a2645630b19dfeacc3d4321a1860b Merge: 93003de27a5e2 6b54bdd1685a3 0da9eccde3270 43451c4bf9b04 bda3df10fb1ee Author: Rafael J. Wysocki Date: Thu Oct 26 14:55:04 2023 +0200 Merge branches 'acpi-utils', 'acpi-resource', 'acpi-property' and 'acpi-soc' Merge ACPI utilities updates, ACPI resource management updates, ACPI device properties management updates and ACPI LPSS (Intel SoC) driver update for 6.7-rc1: - Rework acpi_handle_list handling so as to manage it dynamically, including size computation (Rafael Wysocki). - Clean up ACPI utilities code so as to make it follow the kernel coding style (Jonathan Bergh). - Consolidate IRQ trigger-type override DMI tables and drop .ident values from dmi_system_id tables used for ACPI resources management quirks (Hans de Goede). - Add ACPI IRQ override for TongFang GMxXGxx (Werner Sembach). - Allow _DSD buffer data only for byte accessors and document the _DSD data buffer GUID (Andy Shevchenko). - Drop BayTrail and Lynxpoint pinctrl device IDs from the ACPI LPSS driver, because it does not need them (Raag Jadav). * acpi-utils: ACPI: utils: Remove redundant braces around individual statement ACPI: utils: Fix up white space in a few places ACPI: utils: Dynamically determine acpi_handle_list size ACPI: thermal: Merge trip initialization functions ACPI: thermal: Collapse trip devices update function wrappers ACPI: thermal: Collapse trip devices update functions ACPI: thermal: Add device list to struct acpi_thermal_trip ACPI: thermal: Fix a small leak in acpi_thermal_add() ACPI: thermal: Drop valid flag from struct acpi_thermal_trip ACPI: thermal: Drop redundant trip point flags ACPI: thermal: Untangle initialization and updates of active trips ACPI: thermal: Untangle initialization and updates of the passive trip ACPI: thermal: Simplify critical and hot trips representation ACPI: thermal: Create and populate trip points table earlier ACPI: thermal: Determine the number of trip points earlier ACPI: thermal: Fold acpi_thermal_get_info() into its caller ACPI: thermal: Simplify initialization of critical and hot trips * acpi-resource: ACPI: resource: Do IRQ override on TongFang GMxXGxx ACPI: resource: Drop .ident values from dmi_system_id tables ACPI: resource: Consolidate IRQ trigger-type override DMI tables * acpi-property: ACPI: property: Document the _DSD data buffer GUID ACPI: property: Allow _DSD buffer data only for byte accessors * acpi-soc: ACPI: LPSS: drop BayTrail and Lynxpoint pinctrl HIDs commit 93003de27a5e20f4977bf24f1d33c2abb7d177d0 Merge: d633c387f28f2 8c6fdbd635d4a a1da3b78c0835 f1fce1cf4509a a83c68a3bf7c4 Author: Rafael J. Wysocki Date: Thu Oct 26 14:44:04 2023 +0200 Merge branches 'acpi-scan', 'acpi-osl', 'acpi-osi' and 'acpi-tables' Merge ACPI updates related to device enumeration, low-level interface for ACPICA (OSL), _OSI handling and table parsing for 6.7-rc1: - Use the acpi_device_is_present() helper in more places and rename acpi_scan_device_not_present() to be about enumeration (James Morse). - Add __printf format attribute to acpi_os_vprintf() (Su Hui). - Clean up departures from kernel coding style in the low-level interface for ACPICA (Jonathan Bergh). - Replace strncpy() with strscpy() in acpi_osi_setup() (Justin Stitt). - Fail FPDT parsing on zero length records and add proper handling for fpdt_process_subtable() to acpi_init_fpdt() (Vasily Khoruzhick). * acpi-scan: ACPI: scan: Rename acpi_scan_device_not_present() to be about enumeration ACPI: scan: Use the acpi_device_is_present() helper in more places * acpi-osl: ACPI: OSL: Add empty lines after local variable declarations ACPI: OSL: Remove redundant parentheses in return statements ACPI: OSL: Fix up white space in parameter lists ACPI: OSL: add __printf format attribute to acpi_os_vprintf() * acpi-osi: ACPI: OSI: refactor deprecated strncpy() * acpi-tables: ACPI: FPDT: properly handle invalid FPDT subtables commit c421c12586b3f00fb96b5c9af15c9a051a9090b1 Author: Hou Tao Date: Sat Oct 21 09:49:59 2023 +0800 bpf: Add more WARN_ON_ONCE checks for mismatched alloc and free There are two possible mismatched alloc and free cases in BPF memory allocator: 1) allocate from cache X but free by cache Y with a different unit_size 2) allocate from per-cpu cache but free by kmalloc cache or vice versa So add more WARN_ON_ONCE checks in free_bulk() and __free_by_rcu() to spot these mismatched alloc and free early. Signed-off-by: Hou Tao Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20231021014959.3563841-1-houtao@huaweicloud.com commit 2fccd11518f19571f3802f22d2aad6e72b254c3e Author: Thippeswamy Havalige Date: Mon Oct 16 10:41:02 2023 +0530 PCI: xilinx-nwl: Modify ECAM size to enable support for 256 buses The PCIe Root Port controller expects ECAM size to be set through software. As such, update the value of the NWL_ECAM_VALUE_DEFAULT macro to 16 to allow the controller to address the 256 MB ECAM region and, as such, enable support for detecting up to 256 buses. [kwilczynski: commit log] Link: https://patchwork.kernel.org/project/linux-pci/patch/20231016051102.1180432-5-thippeswamy.havalige@amd.com/ Signed-off-by: Thippeswamy Havalige Signed-off-by: Krzysztof Wilczyński commit 177692115f6f7abac90d05dfa9054f40818718c2 Author: Thippeswamy Havalige Date: Mon Oct 16 10:41:01 2023 +0530 PCI: xilinx-nwl: Rename the NWL_ECAM_VALUE_DEFAULT macro Rename the NWL_ECAM_VALUE_DEFAULT macro to NWL_ECAM_MAX_SIZE and drop the no longer needed ecam_value variable from struct nwl_pcie. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/20231016051102.1180432-4-thippeswamy.havalige@amd.com Signed-off-by: Thippeswamy Havalige Signed-off-by: Krzysztof Wilczyński commit 22f38a2442730183289c28652b2c01264e66a563 Author: Thippeswamy Havalige Date: Mon Oct 16 10:41:00 2023 +0530 dt-bindings: PCI: xilinx-nwl: Modify ECAM size in the DT example Update ECAM size in the devicetree example to allow for the discovery of up to 256 buses. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/20231016051102.1180432-3-thippeswamy.havalige@amd.com Signed-off-by: Thippeswamy Havalige Signed-off-by: Krzysztof Wilczyński Acked-by: Rob Herring commit a2492ff1fcb94ee823d38a3965138e6ab33a4f80 Author: Thippeswamy Havalige Date: Mon Oct 16 10:40:59 2023 +0530 PCI: xilinx-nwl: Remove redundant code that sets Type 1 header fields The PCI core already updates the primary, secondary and subordinate bus number registers fields of the Type 1 header. Thus, remove the redundant code from the nwl_pcie_bridge_init(). [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/20231016051102.1180432-2-thippeswamy.havalige@amd.com Signed-off-by: Thippeswamy Havalige Signed-off-by: Krzysztof Wilczyński commit b56ebe7c896dc78b5865ec2c4b1dae3c93537517 Author: Koichiro Den Date: Thu Oct 26 12:20:36 2023 +0900 x86/apic/msi: Fix misconfigured non-maskable MSI quirk commit ef8dd01538ea ("genirq/msi: Make interrupt allocation less convoluted"), reworked the code so that the x86 specific quirk for affinity setting of non-maskable PCI/MSI interrupts is not longer activated if necessary. This could be solved by restoring the original logic in the core MSI code, but after a deeper analysis it turned out that the quirk flag is not required at all. The quirk is only required when the PCI/MSI device cannot mask the MSI interrupts, which in turn also prevents reservation mode from being enabled for the affected interrupt. This allows ot remove the NOMASK quirk bit completely as msi_set_affinity() can instead check whether reservation mode is enabled for the interrupt, which gives exactly the same answer. Even in the momentary non-existing case that the reservation mode would be not set for a maskable MSI interrupt this would not cause any harm as it just would cause msi_set_affinity() to go needlessly through the functionaly equivalent slow path, which works perfectly fine with maskable interrupts as well. Rework msi_set_affinity() to query the reservation mode and remove all NOMASK quirk logic from the core code. [ tglx: Massaged changelog ] Fixes: ef8dd01538ea ("genirq/msi: Make interrupt allocation less convoluted") Suggested-by: Thomas Gleixner Signed-off-by: Koichiro Den Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231026032036.2462428-1-den@valinux.co.jp commit 168d97844a61db302dec76d44406e9d4d7106b8e Author: Cezary Rojewski Date: Thu Oct 26 10:25:58 2023 +0200 ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails Error path in snd_skl_parse_uuids() shall free last allocated module if its instance_id allocation fails. Fixes: f8e066521192 ("ASoC: Intel: Skylake: Fix uuid_module memory leak in failure case") Signed-off-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231026082558.1864910-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit f82eb06a40c86c9a82537e956de401d497203d3a Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:28 2023 +0200 ASoC: tegra: machine: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231023095428.166563-18-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 317dd0dbadd8bd4de2d69fa6a0611456f3e15b1a Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:27 2023 +0200 ASoC: samsung: speyside: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231023095428.166563-17-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 86cfaf99e4d3c7b4707fb8cc9eb06d8db10c1414 Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:26 2023 +0200 ASoC: mediatek: mt8192: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231023095428.166563-16-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit d1ecaabe9f1a669354de7420261bd8737da4bf48 Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:25 2023 +0200 ASoC: mediatek: mt8188: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Trevor Wu Link: https://lore.kernel.org/r/20231023095428.166563-15-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 0fe153a99fcc2edeae4e863b03c5a8f71376629e Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:24 2023 +0200 ASoC: mediatek: mt8186: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231023095428.166563-14-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit e84c7f5db97474cb4becd863a93d4ea541dc4110 Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:23 2023 +0200 ASoC: mediatek: mt8183: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231023095428.166563-13-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 343b62590d5b950c8bf7f78fef7c81103c5f982c Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:22 2023 +0200 ASoC: codecs: wm8995: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20231023095428.166563-12-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit e13b63c47578a27dbf8907974f0dcba0bb2efe58 Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:21 2023 +0200 ASoC: codecs: wm8994: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20231023095428.166563-11-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit e54db8826f48c9ca52f2abd108d6e030ff20cae5 Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:20 2023 +0200 ASoC: codecs: wm8962: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20231023095428.166563-10-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 7df1e6a3c608ab0c345b8898f9ee5d5ac19f2eb4 Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:19 2023 +0200 ASoC: codecs: wcd9335: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231023095428.166563-9-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit e2d38e1196f61735716f9c2dd89dff32c0655529 Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:18 2023 +0200 ASoC: codecs: rtq9128: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231023095428.166563-8-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit b2056ce3cf61a39796041dc5c94d7255de7f9f0c Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:17 2023 +0200 ASoC: codecs: rt5682s: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231023095428.166563-7-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit a1fa72a780f428ddc956cf5ed4b97e2be76ceba3 Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:16 2023 +0200 ASoC: codecs: max9867: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Nuno Sa Link: https://lore.kernel.org/r/20231023095428.166563-6-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 5efc1c903e2b43a267ad13696698fcc152ed873a Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:15 2023 +0200 ASoC: codecs: lpass-rx-macro: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231023095428.166563-5-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit ecea1812b911fed5e675b2d37b29ad4265c067ce Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:14 2023 +0200 ASoC: codecs: adav80x: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Nuno Sa Link: https://lore.kernel.org/r/20231023095428.166563-4-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 7a0762587a814387e631c07ae81169a7c646f012 Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:13 2023 +0200 ASoC: codecs: adau1373: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Nuno Sa Link: https://lore.kernel.org/r/20231023095428.166563-3-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit ccd0c6c7097b52b01a2c5951cfe96714d4421cd2 Author: Krzysztof Kozlowski Date: Mon Oct 23 11:54:12 2023 +0200 ASoC: codecs: 88pm860x: Handle component name prefix Use snd_soc_dapm_widget_name_cmp() helper when comparing widget names, to include also the component's name prefix. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231023095428.166563-2-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit cdcd6aef9db5797995d4153ea19fdf56d189f0e4 Author: Maxime Ripard Date: Tue Oct 24 12:56:40 2023 +0200 drm/vc4: tests: Fix UAF in the mock helpers The VC4 mock helpers allocate the CRTC, encoders and connectors using a call to kunit_kzalloc(), but the DRM device they are attache to survives for longer than the test itself which leads to use-after-frees reported by KASAN. Switch to drmm_kzalloc to tie the lifetime of these objects to the main DRM device. Fixes: f759f5b53f1c ("drm/vc4: tests: Introduce a mocking infrastructure") Reported-by: Linux Kernel Functional Testing Closes: https://lore.kernel.org/all/CA+G9fYvJA2HGqzR9LGgq63v0SKaUejHAE6f7+z9cwWN-ourJ_g@mail.gmail.com/ Tested-by: Anders Roxell Reviewed-by: Maíra Canal Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20231024105640.352752-1-mripard@kernel.org commit 820f59ed9680cd145138c39fb2956a140a0e38f0 Author: D Scott Phillips Date: Fri Sep 29 17:20:36 2023 -0700 PCI: hotplug: Add Ampere Altra Attention Indicator extension driver On Ampere Altra, PCIe hotplug is handled through ACPI. A side interface is also present to request system firmware control of the hotplug Attention Indicators. Add an ACPI PCI Hotplug companion driver to support Attention Indicator control. Link: https://lore.kernel.org/r/20230930002036.6491-2-scott@os.amperecomputing.com Signed-off-by: D Scott Phillips [bhelgaas: mask domain to low 4 bits] Signed-off-by: Bjorn Helgaas Acked-by: "Rafael J. Wysocki" commit 0da9eccde3270b832c059ad618bf66e510c75d33 Author: Werner Sembach Date: Mon Oct 16 18:08:28 2023 +0200 ACPI: resource: Do IRQ override on TongFang GMxXGxx The TongFang GMxXGxx/TUXEDO Stellaris/Pollaris Gen5 needs IRQ overriding for the keyboard to work. Adding an entry for this laptop to the override_table makes the internal keyboard functional. Signed-off-by: Werner Sembach Cc: All applicable Reviewed-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 78fdccdc8b9f941d6575625c625f2f4e86db53ce Merge: f9b3ea02555e6 424009ab20308 Author: Rafael J. Wysocki Date: Thu Oct 26 12:26:41 2023 +0200 Merge back earlier ACPI resources management changes for v6.7. commit 39673361266bcb76a9782ee9e27dad1be5dcadcc Merge: df3bc66219e32 9cdee06347698 Author: Paolo Abeni Date: Thu Oct 26 12:20:35 2023 +0200 Merge tag 'nf-next-23-10-25' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Pablo Neira Ayuso says: ==================== Netfilter updates for net-next The following patchset contains Netfilter updates for net-next. Mostly nf_tables updates with two patches for connlabel and br_netfilter. 1) Rename function name to perform on-demand GC for rbtree elements, and replace async GC in rbtree by sync GC. Patches from Florian Westphal. 2) Use commit_mutex for NFT_MSG_GETRULE_RESET to ensure that two concurrent threads invoking this command do not underrun stateful objects. Patches from Phil Sutter. 3) Use single hook to deal with IP and ARP packets in br_netfilter. Patch from Florian Westphal. 4) Use atomic_t in netns->connlabel use counter instead of using a spinlock, also patch from Florian. 5) Cleanups for stateful objects infrastructure in nf_tables. Patches from Phil Sutter. 6) Flush path uses opaque set element offered by the iterator, instead of calling pipapo_deactivate() which looks up for it again. 7) Set backend .flush interface always succeeds, make it return void instead. 8) Add struct nft_elem_priv placeholder structure and use it by replacing void * to pass opaque set element representation from backend to frontend which defeats compiler type checks. 9) Shrink memory consumption of set element transactions, by reducing struct nft_trans_elem object size and reducing stack memory usage. 10) Use struct nft_elem_priv also for set backend .insert operation too. 11) Carry reset flag in nft_set_dump_ctx structure, instead of passing it as a function argument, from Phil Sutter. netfilter pull request 23-10-25 * tag 'nf-next-23-10-25' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next: netfilter: nf_tables: Carry reset boolean in nft_set_dump_ctx netfilter: nf_tables: set->ops->insert returns opaque set element in case of EEXIST netfilter: nf_tables: shrink memory consumption of set elements netfilter: nf_tables: expose opaque set element as struct nft_elem_priv netfilter: nf_tables: set backend .flush always succeeds netfilter: nft_set_pipapo: no need to call pipapo_deactivate() from flush netfilter: nf_tables: Carry reset boolean in nft_obj_dump_ctx netfilter: nf_tables: nft_obj_filter fits into cb->ctx netfilter: nf_tables: Carry s_idx in nft_obj_dump_ctx netfilter: nf_tables: A better name for nft_obj_filter netfilter: nf_tables: Unconditionally allocate nft_obj_filter netfilter: nf_tables: Drop pointless memset in nf_tables_dump_obj netfilter: conntrack: switch connlabels to atomic_t br_netfilter: use single forward hook for ip and arp netfilter: nf_tables: Add locking for NFT_MSG_GETRULE_RESET requests netfilter: nf_tables: Introduce nf_tables_getrule_single() netfilter: nf_tables: Open-code audit log call in nf_tables_getrule() netfilter: nft_set_rbtree: prefer sync gc to async worker netfilter: nft_set_rbtree: rename gc deactivate+erase function ==================== Link: https://lore.kernel.org/r/20231025212555.132775-1-pablo@netfilter.org Signed-off-by: Paolo Abeni commit d633c387f28f2bdb0226762887b6ef95639fd3b0 Merge: 611da07b89fdd 178e1ea6a68f1 Author: Rafael J. Wysocki Date: Thu Oct 26 11:47:50 2023 +0200 Merge branch 'acpica' Merge an ACPICA change for 6.7-rc1 which adds symbol definitions related to CDAT (Dave Jiang). * acpica: ACPICA: Add defines for CDAT SSLBIS commit 3a75b205de43365f80a33b98ec9289785da56243 Author: Daniel Starke Date: Thu Oct 26 07:58:43 2023 +0200 tty: n_gsm: fix race condition in status line change on dead connections gsm_cleanup_mux() cleans up the gsm by closing all DLCIs, stopping all timers, removing the virtual tty devices and clearing the data queues. This procedure, however, may cause subsequent changes of the virtual modem status lines of a DLCI. More data is being added the outgoing data queue and the deleted kick timer is restarted to handle this. At this point many resources have already been removed by the cleanup procedure. Thus, a kernel panic occurs. Fix this by proving in gsm_modem_update() that the cleanup procedure has not been started and the mux is still alive. Note that writing to a virtual tty is already protected by checks against the DLCI specific connection state. Fixes: c568f7086c6e ("tty: n_gsm: fix missing timer to handle stalled links") Cc: stable Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20231026055844.3127-1-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit 51c2385f608b08025600dd8015c43a8811c714c6 Author: Maxime Ripard Date: Wed Oct 25 16:24:41 2023 +0200 drm/doc: ci: Require more context for flaky tests Flaky tests can be very difficult to reproduce after the facts, which will make it even harder to ever fix. Let's document the metadata we agreed on to provide more context to anyone trying to address these fixes. Link: https://lore.kernel.org/dri-devel/CAPj87rPbJ1V1-R7WMTHkDat2A4nwSd61Df9mdGH2PR=ZzxaU=Q@mail.gmail.com/ Acked-by: Daniel Vetter Acked-by: Helen Koike Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20231025142441.745947-1-mripard@kernel.org commit 3e6b0bb22a803532a7ddf8ba255c46213c24a478 Author: Hans de Goede Date: Wed Oct 25 21:01:51 2023 +0200 HID: logitech-hidpp: Stop IO before calling hid_connect() hid_connect() will call hid_pidff_init() which does hid_device_io_start() leading to an "io already started" warning. To fix this call hid_device_io_stop() before calling hid_connect(), stopping IO means that connect events may be lost while hid_connect() runs, re-enable IO and move the hidpp_connect_event() work queuing after the hid_connect(). Note re-enabling IO is also necessary for the g920_get_config() call later during hidpp_probe(). Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231025190151.302376-1-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires commit 970171a9050e554168751494f88aa90692148f2d Author: Takashi Iwai Date: Wed Oct 25 15:23:14 2023 +0200 ALSA: seq: Replace with __packed attribute Replace the old __attribute__((packed)) with the new __packed. Only cleanup, no functional changes. Link: https://lore.kernel.org/r/20231025132314.5878-12-tiwai@suse.de Signed-off-by: Takashi Iwai commit ba238233e454a2c11eccb80d8aacf8028439097c Author: Takashi Iwai Date: Wed Oct 25 15:23:13 2023 +0200 ALSA: wavefront: Drop obsoleted comments and definitions The header file contains lots of outdated comments and definitions. Drop those as cleanup. Link: https://lore.kernel.org/r/20231025132314.5878-11-tiwai@suse.de Signed-off-by: Takashi Iwai commit 0e646fc3a2b0435a1a171bea817a76050f59ee97 Author: Takashi Iwai Date: Wed Oct 25 15:23:12 2023 +0200 ALSA: wavefront: Replace with __packed attribute Replace the old __attribute__((packed)) with the new __packed. Only cleanup, no functional changes. Link: https://lore.kernel.org/r/20231025132314.5878-10-tiwai@suse.de Signed-off-by: Takashi Iwai commit 9ffbedf07d556af1203dd8d5fc28b59a0563a49f Author: Takashi Iwai Date: Wed Oct 25 15:23:11 2023 +0200 ALSA: opl3: Replace with __packed attribute Replace the old __attribute__((packed)) with the new __packed. Only cleanup, no functional changes. Link: https://lore.kernel.org/r/20231025132314.5878-9-tiwai@suse.de Signed-off-by: Takashi Iwai commit ce8466cd4c0920929e43816b6a812093e7ba4f5a Author: Takashi Iwai Date: Wed Oct 25 15:23:10 2023 +0200 ALSA: aoa: Replace with __packed attribute Replace the old __attribute__((packed)) with the new __packed. Only cleanup, no functional changes. Link: https://lore.kernel.org/r/20231025132314.5878-8-tiwai@suse.de Signed-off-by: Takashi Iwai commit 98a4e82e57063653593c6257660afc659acc0a2b Author: Takashi Iwai Date: Wed Oct 25 15:23:09 2023 +0200 ALSA: caiaq: Replace with __packed attribute Replace the old __attribute__((packed)) with the new __packed. Only cleanup, no functional changes. Link: https://lore.kernel.org/r/20231025132314.5878-7-tiwai@suse.de Signed-off-by: Takashi Iwai commit e244953ef618f19a3df65cc8d15c2bd3da64c4dd Author: Takashi Iwai Date: Wed Oct 25 15:23:08 2023 +0200 ALSA: mixart: Replace with __packed attribute Replace the old __attribute__((packed)) with the new __packed. Only cleanup, no functional changes. Link: https://lore.kernel.org/r/20231025132314.5878-6-tiwai@suse.de Signed-off-by: Takashi Iwai commit afcd82afd2022191532c5492edd9e28da0617fcf Author: Takashi Iwai Date: Wed Oct 25 15:23:07 2023 +0200 ALSA: azt3328: Replace with __packed attribute Replace the old __attribute__((packed)) with the new __packed. Only cleanup, no functional changes. Link: https://lore.kernel.org/r/20231025132314.5878-5-tiwai@suse.de Signed-off-by: Takashi Iwai commit 2fb203dbeaea54255d1ca8ae93b8a69a096d44b2 Author: Takashi Iwai Date: Wed Oct 25 15:23:06 2023 +0200 ALSA: rawmidi: Replace with __packed attribute Replace the old __attribute__((packed)) with the new __packed. Only cleanup, no functional changes. Link: https://lore.kernel.org/r/20231025132314.5878-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit fdbe0f20445cc005f951088eae9d210382846f87 Author: Takashi Iwai Date: Wed Oct 25 15:23:05 2023 +0200 ALSA: pcm: Replace with __packed attribute Replace the old __attribute__((packed)) with the new __packed. Only cleanup, no functional changes. Link: https://lore.kernel.org/r/20231025132314.5878-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit b7cbd9c934ec08c3dd9436e1f4d1bd190553b202 Author: Takashi Iwai Date: Wed Oct 25 15:23:04 2023 +0200 ALSA: control: Replace with __packed attribute Replace the old __attribute__((packed)) with the new __packed. Only cleanup, no functional changes. Link: https://lore.kernel.org/r/20231025132314.5878-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 47846d51348dd62e5231a83be040981b17c955fa Author: Paul Moore Date: Mon Oct 9 13:18:49 2023 -0400 audit: don't take task_lock() in audit_exe_compare() code path The get_task_exe_file() function locks the given task with task_lock() which when used inside audit_exe_compare() can cause deadlocks on systems that generate audit records when the task_lock() is held. We resolve this problem with two changes: ignoring those cases where the task being audited is not the current task, and changing our approach to obtaining the executable file struct to not require task_lock(). With the intent of the audit exe filter being to filter on audit events generated by processes started by the specified executable, it makes sense that we would only want to use the exe filter on audit records associated with the currently executing process, e.g. @current. If we are asked to filter records using a non-@current task_struct we can safely ignore the exe filter without negatively impacting the admin's expectations for the exe filter. Knowing that we only have to worry about filtering the currently executing task in audit_exe_compare() we can do away with the task_lock() and call get_mm_exe_file() with @current->mm directly. Cc: Fixes: 5efc244346f9 ("audit: fix exe_file access in audit_exe_compare") Reported-by: Andreas Steinmetz Reviewed-by: John Johansen Reviewed-by: Mateusz Guzik Signed-off-by: Paul Moore commit 29e06c10702e81a7d0b75020ca514d2f2962704a Author: Steven Rostedt (Google) Date: Tue Oct 24 13:10:24 2023 -0400 eventfs: Fix typo in eventfs_inode union comment It's eventfs_inode not eventfs_indoe. There's no deer involved! Link: https://lore.kernel.org/linux-trace-kernel/20231024131024.5634c743@gandalf.local.home Cc: Masami Hiramatsu Cc: Mark Rutland Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_inode") Signed-off-by: Steven Rostedt (Google) commit a9de4eb15ad430fe45747c211e367da745a90093 Author: Steven Rostedt (Google) Date: Tue Oct 24 12:36:28 2023 -0400 eventfs: Fix WARN_ON() in create_file_dentry() As the comment right above a WARN_ON() in create_file_dentry() states: * Note, with the mutex held, the e_dentry cannot have content * and the ei->is_freed be true at the same time. But the WARN_ON() only has: WARN_ON_ONCE(ei->is_free); Where to match the comment (and what it should actually do) is: dentry = *e_dentry; WARN_ON_ONCE(dentry && ei->is_free) Also in that case, set dentry to NULL (although it should never happen). Link: https://lore.kernel.org/linux-trace-kernel/20231024123628.62b88755@gandalf.local.home Cc: Masami Hiramatsu Cc: Mark Rutland Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_inode") Signed-off-by: Steven Rostedt (Google) commit 0f7f544af60a6082cfaa3ed4c8f4ca1a858807ee Author: Matthew Wilcox (Oracle) Date: Tue Oct 24 15:55:59 2023 +0100 powerpc: Remove initialisation of readpos While powerpc doesn't use the seq_buf readpos, it did explicitly initialise it for no good reason. Link: https://lore.kernel.org/linux-trace-kernel/20231024145600.739451-1-willy@infradead.org Cc: Christoph Hellwig Cc: Justin Stitt Cc: Kent Overstreet Cc: Petr Mladek Cc: Andy Shevchenko Cc: Rasmus Villemoes Cc: Sergey Senozhatsky Cc: Michael Ellerman Reviewed-by: Kees Cook Fixes: d0ed46b60396 ("tracing: Move readpos from seq_buf to trace_seq") Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Steven Rostedt (Google) commit df3bc66219e32377b2fd251c121c43bf031a5854 Merge: d8c4ef76d7ccd ec575f885e3ec Author: Jakub Kicinski Date: Wed Oct 25 18:23:08 2023 -0700 Merge branch 'net-ipv6-addrconf-ensure-that-temporary-addresses-preferred-lifetimes-are-in-the-valid-range' Alex Henrie says: ==================== net: ipv6/addrconf: ensure that temporary addresses' preferred lifetimes are in the valid range No changes from v2, but there are only four patches now because the first patch has already been applied. https://lore.kernel.org/all/20230829054623.104293-1-alexhenrie24@gmail.com/ ==================== Link: https://lore.kernel.org/r/20231024212312.299370-1-alexhenrie24@gmail.com Signed-off-by: Jakub Kicinski commit ec575f885e3eca6b003e007f4acfba9a0ec3c04a Author: Alex Henrie Date: Tue Oct 24 15:23:10 2023 -0600 Documentation: networking: explain what happens if temp_prefered_lft is too small or too large Signed-off-by: Alex Henrie Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20231024212312.299370-5-alexhenrie24@gmail.com Signed-off-by: Jakub Kicinski commit 433d6c8048cb297c3e25af237d6d006daa2195f9 Author: Alex Henrie Date: Tue Oct 24 15:23:09 2023 -0600 Documentation: networking: explain what happens if temp_valid_lft is too small Signed-off-by: Alex Henrie Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20231024212312.299370-4-alexhenrie24@gmail.com Signed-off-by: Jakub Kicinski commit 629df6701c8a9172f4274af6de9dfa99e2c7ac56 Author: Alex Henrie Date: Tue Oct 24 15:23:08 2023 -0600 net: ipv6/addrconf: clamp preferred_lft to the minimum required If the preferred lifetime was less than the minimum required lifetime, ipv6_create_tempaddr would error out without creating any new address. On my machine and network, this error happened immediately with the preferred lifetime set to 1 second, after a few minutes with the preferred lifetime set to 4 seconds, and not at all with the preferred lifetime set to 5 seconds. During my investigation, I found a Stack Exchange post from another person who seems to have had the same problem: They stopped getting new addresses if they lowered the preferred lifetime below 3 seconds, and they didn't really know why. The preferred lifetime is a preference, not a hard requirement. The kernel does not strictly forbid new connections on a deprecated address, nor does it guarantee that the address will be disposed of the instant its total valid lifetime expires. So rather than disable IPv6 privacy extensions altogether if the minimum required lifetime swells above the preferred lifetime, it is more in keeping with the user's intent to increase the temporary address's lifetime to the minimum necessary for the current network conditions. With these fixes, setting the preferred lifetime to 3 or 4 seconds "just works" because the extra fraction of a second is practically unnoticeable. It's even possible to reduce the time before deprecation to 1 or 2 seconds by also disabling duplicate address detection (setting /proc/sys/net/ipv6/conf/*/dad_transmits to 0). I realize that that is a pretty niche use case, but I know at least one person who would gladly sacrifice performance and convenience to be sure that they are getting the maximum possible level of privacy. Link: https://serverfault.com/a/1031168/310447 Signed-off-by: Alex Henrie Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20231024212312.299370-3-alexhenrie24@gmail.com Signed-off-by: Jakub Kicinski commit bfbf81b31093e0dc3d61b390a9bd0904d3bf5374 Author: Alex Henrie Date: Tue Oct 24 15:23:07 2023 -0600 net: ipv6/addrconf: clamp preferred_lft to the maximum allowed Without this patch, there is nothing to stop the preferred lifetime of a temporary address from being greater than its valid lifetime. If that was the case, the valid lifetime was effectively ignored. Signed-off-by: Alex Henrie Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20231024212312.299370-2-alexhenrie24@gmail.com Signed-off-by: Jakub Kicinski commit d8c4ef76d7ccd478f8c9a3b7de1ba0b25fdffbee Merge: 8846f9a04b10b 03d6c848bfb40 Author: Jakub Kicinski Date: Wed Oct 25 18:04:31 2023 -0700 Merge branch 'ipv6-avoid-atomic-fragment-on-gso-output' Yan Zhai says: ==================== ipv6: avoid atomic fragment on GSO output When the ipv6 stack output a GSO packet, if its gso_size is larger than dst MTU, then all segments would be fragmented. However, it is possible for a GSO packet to have a trailing segment with smaller actual size than both gso_size as well as the MTU, which leads to an "atomic fragment". Atomic fragments are considered harmful in RFC-8021. An Existing report from APNIC also shows that atomic fragments are more likely to be dropped even it is equivalent to a no-op [1]. The series contains following changes: * drop feature RTAX_FEATURE_ALLFRAG, which has been broken. This helps simplifying other changes in this set. * refactor __ip6_finish_output code to separate GSO and non-GSO packet processing, mirroring IPv4 side logic. * avoid generating atomic fragment on GSO packets. Link: https://www.potaroo.net/presentations/2022-03-01-ipv6-frag.pdf [1] V4: https://lore.kernel.org/netdev/cover.1698114636.git.yan@cloudflare.com/ V3: https://lore.kernel.org/netdev/cover.1697779681.git.yan@cloudflare.com/ V2: https://lore.kernel.org/netdev/ZS1%2Fqtr0dZJ35VII@debian.debian/ ==================== Link: https://lore.kernel.org/r/cover.1698156966.git.yan@cloudflare.com Signed-off-by: Jakub Kicinski commit 03d6c848bfb406e9ef6d9846d759e97beaeea113 Author: Yan Zhai Date: Tue Oct 24 07:26:40 2023 -0700 ipv6: avoid atomic fragment on GSO packets When the ipv6 stack output a GSO packet, if its gso_size is larger than dst MTU, then all segments would be fragmented. However, it is possible for a GSO packet to have a trailing segment with smaller actual size than both gso_size as well as the MTU, which leads to an "atomic fragment". Atomic fragments are considered harmful in RFC-8021. An Existing report from APNIC also shows that atomic fragments are more likely to be dropped even it is equivalent to a no-op [1]. Add an extra check in the GSO slow output path. For each segment from the original over-sized packet, if it fits with the path MTU, then avoid generating an atomic fragment. Link: https://www.potaroo.net/presentations/2022-03-01-ipv6-frag.pdf [1] Fixes: b210de4f8c97 ("net: ipv6: Validate GSO SKB before finish IPv6 processing") Reported-by: David Wragg Signed-off-by: Yan Zhai Link: https://lore.kernel.org/r/90912e3503a242dca0bc36958b11ed03a2696e5e.1698156966.git.yan@cloudflare.com Signed-off-by: Jakub Kicinski commit 1f7ec1b3721d7f49f13d01e6f5ed5f28a305e3b6 Author: Yan Zhai Date: Tue Oct 24 07:26:37 2023 -0700 ipv6: refactor ip6_finish_output for GSO handling Separate GSO and non-GSO packets handling to make the logic cleaner. For GSO packets, frag_max_size check can be omitted because it is only useful for packets defragmented by netfilter hooks. Both local output and GRO logic won't produce GSO packets when defragment is needed. This also mirrors what IPv4 side code is doing. Suggested-by: Florian Westphal Signed-off-by: Yan Zhai Reviewed-by: Willem de Bruijn Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/0e1d4599f858e2becff5c4fe0b5f843236bc3fe8.1698156966.git.yan@cloudflare.com Signed-off-by: Jakub Kicinski commit e57a34478586fe3562560ccebd655b707a5b4a56 Author: Yan Zhai Date: Tue Oct 24 07:26:33 2023 -0700 ipv6: drop feature RTAX_FEATURE_ALLFRAG RTAX_FEATURE_ALLFRAG was added before the first git commit: https://www.mail-archive.com/bk-commits-head@vger.kernel.org/msg03399.html The feature would send packets to the fragmentation path if a box receives a PMTU value with less than 1280 byte. However, since commit 9d289715eb5c ("ipv6: stop sending PTB packets for MTU < 1280"), such message would be simply discarded. The feature flag is neither supported in iproute2 utility. In theory one can still manipulate it with direct netlink message, but it is not ideal because it was based on obsoleted guidance of RFC-2460 (replaced by RFC-8200). The feature would always test false at the moment, so remove related code or mark them as unused. Signed-off-by: Yan Zhai Reviewed-by: Florian Westphal Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/d78e44dcd9968a252143ffe78460446476a472a1.1698156966.git.yan@cloudflare.com Signed-off-by: Jakub Kicinski commit 88c91dc58582f1d0c6f5f501051b0262d06ec4ed Author: Hugh Dickins Date: Tue Oct 3 02:29:00 2023 -0700 mempolicy: migration attempt to match interleave nodes Improve alloc_migration_target_by_mpol()'s treatment of MPOL_INTERLEAVE. Make an effort in do_mbind(), to identify the correct interleave index for the first page to be migrated, so that it and all subsequent pages from the same vma will be targeted to precisely their intended nodes. Pages from following vmas will still be interleaved from the requested nodemask, but perhaps starting from a different base. Whether this is worth doing at all, or worth improving further, is arguable: queue_folio_required() is right not to care about the precise placement on interleaved nodes; but this little effort seems appropriate. [hughd@google.com: do vma_iter search under mmap_write_unlock()] Link: https://lkml.kernel.org/r/3311d544-fb05-a7f1-1b74-16aa0f6cd4fe@google.com Link: https://lkml.kernel.org/r/77954a5-9c9b-1c11-7d5c-3262c01b895f@google.com Signed-off-by: Hugh Dickins Cc: Andi Kleen Cc: Christoph Lameter Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: "Huang, Ying" Cc: Kefeng Wang Cc: Matthew Wilcox (Oracle) Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Nhat Pham Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Tejun heo Cc: Vishal Moola (Oracle) Cc: Yang Shi Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 72e315f7a750281b4410ac30d8930f735459e72d Author: Hugh Dickins Date: Tue Oct 3 02:27:47 2023 -0700 mempolicy: mmap_lock is not needed while migrating folios mbind(2) holds down_write of current task's mmap_lock throughout (exclusive because it needs to set the new mempolicy on the vmas); migrate_pages(2) holds down_read of pid's mmap_lock throughout. They both hold mmap_lock across the internal migrate_pages(), under which all new page allocations (huge or small) are made. I'm nervous about it; and migrate_pages() certainly does not need mmap_lock itself. It's done this way for mbind(2), because its page allocator is vma_alloc_folio() or alloc_hugetlb_folio_vma(), both of which depend on vma and address. Now that we have alloc_pages_mpol(), depending on (refcounted) memory policy and interleave index, mbind(2) can be modified to use that or alloc_hugetlb_folio_nodemask(), and then not need mmap_lock across the internal migrate_pages() at all: add alloc_migration_target_by_mpol() to replace mbind's new_page(). (After that change, alloc_hugetlb_folio_vma() is used by nothing but a userfaultfd function: move it out of hugetlb.h and into the #ifdef.) migrate_pages(2) has chosen its target node before migrating, so can continue to use the standard alloc_migration_target(); but let it take and drop mmap_lock just around migrate_to_node()'s queue_pages_range(): neither the node-to-node calculations nor the page migrations need it. It seems unlikely, but it is conceivable that some userspace depends on the kernel's mmap_lock exclusion here, instead of doing its own locking: more likely in a testsuite than in real life. It is also possible, of course, that some pages on the list will be munmapped by another thread before they are migrated, or a newer memory policy applied to the range by that time: but such races could happen before, as soon as mmap_lock was dropped, so it does not appear to be a concern. Link: https://lkml.kernel.org/r/21e564e8-269f-6a89-7ee2-fd612831c289@google.com Signed-off-by: Hugh Dickins Cc: Andi Kleen Cc: Christoph Lameter Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: "Huang, Ying" Cc: Kefeng Wang Cc: Matthew Wilcox (Oracle) Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Nhat Pham Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Tejun heo Cc: Vishal Moola (Oracle) Cc: Yang Shi Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit ddc1a5cbc05dc62743a2f409b96faa5cf95ba064 Author: Hugh Dickins Date: Thu Oct 19 13:39:08 2023 -0700 mempolicy: alloc_pages_mpol() for NUMA policy without vma Shrink shmem's stack usage by eliminating the pseudo-vma from its folio allocation. alloc_pages_mpol(gfp, order, pol, ilx, nid) becomes the principal actor for passing mempolicy choice down to __alloc_pages(), rather than vma_alloc_folio(gfp, order, vma, addr, hugepage). vma_alloc_folio() and alloc_pages() remain, but as wrappers around alloc_pages_mpol(). alloc_pages_bulk_*() untouched, except to provide the additional args to policy_nodemask(), which subsumes policy_node(). Cleanup throughout, cutting out some unhelpful "helpers". It would all be much simpler without MPOL_INTERLEAVE, but that adds a dynamic to the constant mpol: complicated by v3.6 commit 09c231cb8bfd ("tmpfs: distribute interleave better across nodes"), which added ino bias to the interleave, hidden from mm/mempolicy.c until this commit. Hence "ilx" throughout, the "interleave index". Originally I thought it could be done just with nid, but that's wrong: the nodemask may come from the shared policy layer below a shmem vma, or it may come from the task layer above a shmem vma; and without the final nodemask then nodeid cannot be decided. And how ilx is applied depends also on page order. The interleave index is almost always irrelevant unless MPOL_INTERLEAVE: with one exception in alloc_pages_mpol(), where the NO_INTERLEAVE_INDEX passed down from vma-less alloc_pages() is also used as hint not to use THP-style hugepage allocation - to avoid the overhead of a hugepage arg (though I don't understand why we never just added a GFP bit for THP - if it actually needs a different allocation strategy from other pages of the same order). vma_alloc_folio() still carries its hugepage arg here, but it is not used, and should be removed when agreed. get_vma_policy() no longer allows a NULL vma: over time I believe we've eradicated all the places which used to need it e.g. swapoff and madvise used to pass NULL vma to read_swap_cache_async(), but now know the vma. [hughd@google.com: handle NULL mpol being passed to __read_swap_cache_async()] Link: https://lkml.kernel.org/r/ea419956-4751-0102-21f7-9c93cb957892@google.com Link: https://lkml.kernel.org/r/74e34633-6060-f5e3-aee-7040d43f2e93@google.com Link: https://lkml.kernel.org/r/1738368e-bac0-fd11-ed7f-b87142a939fe@google.com Signed-off-by: Hugh Dickins Cc: Andi Kleen Cc: Christoph Lameter Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: Huang Ying Cc: Kefeng Wang Cc: Matthew Wilcox (Oracle) Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Nhat Pham Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Tejun heo Cc: Vishal Moola (Oracle) Cc: Yang Shi Cc: Yosry Ahmed Cc: Domenico Cerasuolo Cc: Johannes Weiner Signed-off-by: Andrew Morton commit 23e4883248f0472d806c8b3422ba6257e67bf1a5 Author: Hugh Dickins Date: Tue Oct 3 02:25:33 2023 -0700 mm: add page_rmappable_folio() wrapper folio_prep_large_rmappable() is being used repeatedly along with a conversion from page to folio, a check non-NULL, a check order > 1: wrap it all up into struct folio *page_rmappable_folio(struct page *). Link: https://lkml.kernel.org/r/8d92c6cf-eebe-748-e29c-c8ab224c741@google.com Signed-off-by: Hugh Dickins Cc: Andi Kleen Cc: Christoph Lameter Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: "Huang, Ying" Cc: Kefeng Wang Cc: Matthew Wilcox (Oracle) Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Nhat Pham Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Tejun heo Cc: Vishal Moola (Oracle) Cc: Yang Shi Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 2cafb582173f3870240af90de3f31d18b0728882 Author: Hugh Dickins Date: Tue Oct 3 02:24:18 2023 -0700 mempolicy: remove confusing MPOL_MF_LAZY dead code v3.8 commit b24f53a0bea3 ("mm: mempolicy: Add MPOL_MF_LAZY") introduced MPOL_MF_LAZY, and included it in the MPOL_MF_VALID flags; but a720094ded8 ("mm: mempolicy: Hide MPOL_NOOP and MPOL_MF_LAZY from userspace for now") immediately removed it from MPOL_MF_VALID flags, pending further review. "This will need to be revisited", but it has not been reinstated. The present state is confusing: there is dead code in mm/mempolicy.c to handle MPOL_MF_LAZY cases which can never occur. Remove that: it can be resurrected later if necessary. But keep the definition of MPOL_MF_LAZY, which must remain in the UAPI, even though it always fails with EINVAL. https://lore.kernel.org/linux-mm/1553041659-46787-1-git-send-email-yang.shi@linux.alibaba.com/ links to a previous request to remove MPOL_MF_LAZY. Link: https://lkml.kernel.org/r/80c9665c-1c3f-17ba-21a3-f6115cebf7d@google.com Signed-off-by: Hugh Dickins Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Yang Shi Cc: Andi Kleen Cc: Christoph Lameter Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: "Huang, Ying" Cc: Kefeng Wang Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Nhat Pham Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Tejun heo Cc: Vishal Moola (Oracle) Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 35ec8fa0207b3c7f7c3c22337c9a507d7b291626 Author: Hugh Dickins Date: Tue Oct 3 02:22:59 2023 -0700 mempolicy: mpol_shared_policy_init() without pseudo-vma mpol_shared_policy_init() does not need to use a pseudo-vma: it can use sp_alloc() and sp_insert() directly, since the object's shared policy tree is empty and inaccessible (needing no lock) at get_inode() time. Link: https://lkml.kernel.org/r/3bef62d8-ae78-4c2-533-56a44ae425c@google.com Signed-off-by: Hugh Dickins Cc: Andi Kleen Cc: Christoph Lameter Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: "Huang, Ying" Cc: Kefeng Wang Cc: Matthew Wilcox (Oracle) Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Nhat Pham Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Tejun heo Cc: Vishal Moola (Oracle) Cc: Yang Shi Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 93397c3b7684555b7cec726cd13eef6742d191fe Author: Hugh Dickins Date: Tue Oct 3 02:21:34 2023 -0700 mempolicy trivia: use pgoff_t in shared mempolicy tree Prefer the more explicit "pgoff_t" to "unsigned long" when dealing with a shared mempolicy tree. Delete confusing comment about pseudo mm vmas. Link: https://lkml.kernel.org/r/5451157-3818-4af5-fd2c-5d26a5d1dc53@google.com Signed-off-by: Hugh Dickins Cc: Andi Kleen Cc: Christoph Lameter Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: "Huang, Ying" Cc: Kefeng Wang Cc: Matthew Wilcox (Oracle) Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Nhat Pham Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Tejun heo Cc: Vishal Moola (Oracle) Cc: Yang Shi Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit c36f6e6dff4d32ec8b6da8f553933727a57a7a4a Author: Hugh Dickins Date: Tue Oct 3 02:20:14 2023 -0700 mempolicy trivia: slightly more consistent naming Before getting down to work, do a little cleanup, mainly of inconsistent variable naming. I gave up trying to rationalize mpol versus pol versus policy, and node versus nid, but let's avoid p and nd. Remove a few superfluous blank lines, but add one; and here prefer vma->vm_policy to vma_policy(vma) - the latter being appropriate in other sources, which have to allow for !CONFIG_NUMA. That intriguing line about KERNEL_DS? should have gone in v2.6.15, when numa_policy_init() stopped using set_mempolicy(2)'s system call handler. Link: https://lkml.kernel.org/r/68287974-b6ae-7df-4ba-d19ddd69cbf@google.com Signed-off-by: Hugh Dickins Reviewed-by: Matthew Wilcox (Oracle) Cc: Andi Kleen Cc: Christoph Lameter Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: "Huang, Ying" Cc: Kefeng Wang Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Nhat Pham Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Tejun heo Cc: Vishal Moola (Oracle) Cc: Yang Shi Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 7f1ee4e2070883d18a431c761db8bb30a958b654 Author: Hugh Dickins Date: Tue Oct 3 02:19:00 2023 -0700 mempolicy trivia: delete those ancient pr_debug()s Delete those ancient pr_debug()s - PDprintk()s in Andi Kleen's original submission of core NUMA API, and useful when debugging shared mempolicy lifetime back then, but not used recently. Link: https://lkml.kernel.org/r/f25135-ffb2-40d8-9577-720772b333@google.com Signed-off-by: Hugh Dickins Reviewed-by: Matthew Wilcox (Oracle) Cc: Andi Kleen Cc: Christoph Lameter Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: "Huang, Ying" Cc: Kefeng Wang Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Nhat Pham Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Tejun heo Cc: Vishal Moola (Oracle) Cc: Yang Shi Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 1cb5d11a370f661c5d0d888bb0cfc2cdc5791382 Author: Hugh Dickins Date: Tue Oct 3 02:17:43 2023 -0700 mempolicy: fix migrate_pages(2) syscall return nr_failed "man 2 migrate_pages" says "On success migrate_pages() returns the number of pages that could not be moved". Although 5.3 and 5.4 commits fixed mbind(MPOL_MF_STRICT|MPOL_MF_MOVE*) to fail with EIO when not all pages could be moved (because some could not be isolated for migration), migrate_pages(2) was left still reporting only those pages failing at the migration stage, forgetting those failing at the earlier isolation stage. Fix that by accumulating a long nr_failed count in struct queue_pages, returned by queue_pages_range() when it's not returning an error, for adding on to the nr_failed count from migrate_pages() in mm/migrate.c. A count of pages? It's more a count of folios, but changing it to pages would entail more work (also in mm/migrate.c): does not seem justified. queue_pages_range() itself should only return -EIO in the "strictly unmovable" case (STRICT without any MOVEs): in that case it's best to break out as soon as nr_failed gets set; but otherwise it should continue to isolate pages for MOVing even when nr_failed - as the mbind(2) manpage promises. There's a case when nr_failed should be incremented when it was missed: queue_folios_pte_range() and queue_folios_hugetlb() count the transient migration entries, like queue_folios_pmd() already did. And there's a case when nr_failed should not be incremented when it would have been: in meeting later PTEs of the same large folio, which can only be isolated once: fixed by recording the current large folio in struct queue_pages. Clean up the affected functions, fixing or updating many comments. Bool migrate_folio_add(), without -EIO: true if adding, or if skipping shared (but its arguable folio_estimated_sharers() heuristic left unchanged). Use MPOL_MF_WRLOCK flag to queue_pages_range(), instead of bool lock_vma. Use explicit STRICT|MOVE* flags where queue_pages_test_walk() checks for skipping, instead of hiding them behind MPOL_MF_VALID. Link: https://lkml.kernel.org/r/9a6b0b9-3bb-dbef-8adf-efab4397b8d@google.com Signed-off-by: Hugh Dickins Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: "Huang, Ying" Cc: Andi Kleen Cc: Christoph Lameter Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: Kefeng Wang Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Nhat Pham Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Tejun heo Cc: Vishal Moola (Oracle) Cc: Yang Shi Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 4b981bc1aa73c204c2aa7f99b5f4f74d03b0e381 Author: Hugh Dickins Date: Tue Oct 3 02:16:29 2023 -0700 kernfs: drop shared NUMA mempolicy hooks It seems strange that kernfs should be an outlier with a set_policy and get_policy in its kernfs_vm_ops. Ah, it dates back to v2.6.30's commit 095160aee954 ("sysfs: fix some bin_vm_ops errors"), when I had crashed on powerpc's pci_mmap_legacy_page_range() fallback to shmem_zero_setup(). Well, that was commendably thorough, to give sysfs-bin a set_policy and get_policy, just to avoid the way it was coded resulting in EINVAL from mmap when CONFIG_NUMA; but somehow feels a bit over-the-top to me now. It's easier to say that nobody should expect to manage a shmem object's shared NUMA mempolicy via some kernfs backdoor to that object: delete that code (and there's no longer an EINVAL from mmap in the NUMA case). This then leaves set_policy/get_policy as implemented only by shmem - though importantly also by SysV SHM, which has to interface with shmem which implements them, and with SHM_HUGETLB which does not. Link: https://lkml.kernel.org/r/302164-a760-4a9e-879b-6870c9b4013@google.com Signed-off-by: Hugh Dickins Reviewed-by: Matthew Wilcox (Oracle) Cc: Andi Kleen Cc: Christoph Lameter Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: "Huang, Ying" Cc: Kefeng Wang Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Nhat Pham Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Tejun heo Cc: Vishal Moola (Oracle) Cc: Yang Shi Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit 10969b5571387047cd461a9c701b8b9cd007f6c7 Author: Hugh Dickins Date: Tue Oct 3 02:15:09 2023 -0700 hugetlbfs: drop shared NUMA mempolicy pretence Patch series "mempolicy: cleanups leading to NUMA mpol without vma", v2. Mostly cleanups in mm/mempolicy.c, but finally removing the pseudo-vma from shmem folio allocation, and removing the mmap_lock around folio migration for mbind and migrate_pages syscalls. This patch (of 12): hugetlbfs_fallocate() goes through the motions of pasting a shared NUMA mempolicy onto its pseudo-vma, but how could there ever be a shared NUMA mempolicy for this file? hugetlb_vm_ops has never offered a set_policy method, and hugetlbfs_parse_param() has never supported any mpol options for a mount-wide default policy. It's just an illusion: clean it away so as not to confuse others, giving us more freedom to adjust shmem's set_policy/get_policy implementation. But hugetlbfs_inode_info is still required, just to accommodate seals. Yes, shared NUMA mempolicy support could be added to hugetlbfs, with a set_policy method and/or mpol mount option (Andi's first posting did include an admitted-unsatisfactory hugetlb_set_policy()); but it seems that nobody has bothered to add that in the nineteen years since v2.6.7 made it possible, and there is at least one company that has invested enough into hugetlbfs, that I guess they have learnt well enough how to manage its NUMA, without needing shared mempolicy. Remove linux/mempolicy.h from linux/hugetlb.h: include linux/pagemap.h in its place, because hugetlb.h's recently added use of filemap_lock_folio() requires that (although most .configs and .c's get it in some other way). Link: https://lkml.kernel.org/r/ebc0987e-beff-8bfb-9283-234c2cbd17c5@google.com Link: https://lkml.kernel.org/r/cae82d4b-904a-faaf-282a-34fcc188c81f@google.com Signed-off-by: Hugh Dickins Reviewed-by: Matthew Wilcox (Oracle) Cc: Andi Kleen Cc: Christoph Lameter Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: "Huang, Ying" Cc: Kefeng Wang Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Kravetz Cc: Sidhartha Kumar Cc: Suren Baghdasaryan Cc: Tejun heo Cc: Vishal Moola (Oracle) Cc: Yang Shi Cc: Nhat Pham Cc: Yosry Ahmed Signed-off-by: Andrew Morton commit b8ee5575f763c239902f8523d82103a45c153b29 Author: SeongJae Park Date: Sun Oct 22 21:07:34 2023 +0000 mm/damon/sysfs-test: add a unit test for damon_sysfs_set_targets() damon_sysfs_set_targets() had a bug that can result in unexpected memory usage and monitoring overhead increase. The bug has fixed by a previous commit. Add a unit test for avoiding a similar bug of future. Link: https://lkml.kernel.org/r/20231022210735.46409-3-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Signed-off-by: Andrew Morton commit 62f76a7b53bfa2ecfe1570a5b1d0d574c576a56d Author: SeongJae Park Date: Thu Oct 19 19:49:24 2023 +0000 mm/damon/core: avoid divide-by-zero from pseudo-moving window length calculation When calculating the pseudo-moving access rate, DAMON divides some values by the maximum nr_accesses. However, due to the type of the related variables, simple division-based calculation of the divisor can return zero. As a result, divide-by-zero is possible. Fix it by using damon_max_nr_accesses(), which handles the case. Note that this is a fix for a commit that not in the mainline but mm tree. Link: https://lkml.kernel.org/r/20231019194924.100347-6-sj@kernel.org Fixes: ace30fb21af5 ("mm/damon/core: use pseudo-moving sum for nr_accesses_bp") Reported-by: Jakub Acs Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit 44063f125af4bb4efd1d500d8091fa33a98af325 Author: SeongJae Park Date: Thu Oct 19 19:49:23 2023 +0000 mm/damon/lru_sort: avoid divide-by-zero in hot threshold calculation When calculating the hotness threshold for lru_prio scheme of DAMON_LRU_SORT, the module divides some values by the maximum nr_accesses. However, due to the type of the related variables, simple division-based calculation of the divisor can return zero. As a result, divide-by-zero is possible. Fix it by using damon_max_nr_accesses(), which handles the case. Link: https://lkml.kernel.org/r/20231019194924.100347-5-sj@kernel.org Fixes: 40e983cca927 ("mm/damon: introduce DAMON-based LRU-lists Sorting") Signed-off-by: SeongJae Park Reported-by: Jakub Acs Cc: [6.0+] Signed-off-by: Andrew Morton commit 3bafc47d3c4a2fc4d3b382aeb3c087f8fc84d9fd Author: SeongJae Park Date: Thu Oct 19 19:49:22 2023 +0000 mm/damon/ops-common: avoid divide-by-zero during region hotness calculation When calculating the hotness of each region for the under-quota regions prioritization, DAMON divides some values by the maximum nr_accesses. However, due to the type of the related variables, simple division-based calculation of the divisor can return zero. As a result, divide-by-zero is possible. Fix it by using damon_max_nr_accesses(), which handles the case. Link: https://lkml.kernel.org/r/20231019194924.100347-4-sj@kernel.org Fixes: 198f0f4c58b9 ("mm/damon/vaddr,paddr: support pageout prioritization") Signed-off-by: SeongJae Park Reported-by: Jakub Acs Cc: [5.16+] Signed-off-by: Andrew Morton commit d35963bfb05877455228ecec6b194f624489f96a Author: SeongJae Park Date: Thu Oct 19 19:49:21 2023 +0000 mm/damon/core: avoid divide-by-zero during monitoring results update When monitoring attributes are changed, DAMON updates access rate of the monitoring results accordingly. For that, it divides some values by the maximum nr_accesses. However, due to the type of the related variables, simple division-based calculation of the divisor can return zero. As a result, divide-by-zero is possible. Fix it by using damon_max_nr_accesses(), which handles the case. Link: https://lkml.kernel.org/r/20231019194924.100347-3-sj@kernel.org Fixes: 2f5bef5a590b ("mm/damon/core: update monitoring results for new monitoring attributes") Signed-off-by: SeongJae Park Reported-by: Jakub Acs Cc: [6.3+] Signed-off-by: Andrew Morton commit 35f5d94187a6a3a8df2cba54beccca1c2379edb8 Author: SeongJae Park Date: Thu Oct 19 19:49:20 2023 +0000 mm/damon: implement a function for max nr_accesses safe calculation Patch series "avoid divide-by-zero due to max_nr_accesses overflow". The maximum nr_accesses of given DAMON context can be calculated by dividing the aggregation interval by the sampling interval. Some logics in DAMON uses the maximum nr_accesses as a divisor. Hence, the value shouldn't be zero. Such case is avoided since DAMON avoids setting the agregation interval as samller than the sampling interval. However, since nr_accesses is unsigned int while the intervals are unsigned long, the maximum nr_accesses could be zero while casting. Avoid the divide-by-zero by implementing a function that handles the corner case (first patch), and replaces the vulnerable direct max nr_accesses calculations (remaining patches). Note that the patches for the replacements are divided for broken commits, to make backporting on required tres easier. Especially, the last patch is for a patch that not yet merged into the mainline but in mm tree. This patch (of 4): The maximum nr_accesses of given DAMON context can be calculated by dividing the aggregation interval by the sampling interval. Some logics in DAMON uses the maximum nr_accesses as a divisor. Hence, the value shouldn't be zero. Such case is avoided since DAMON avoids setting the agregation interval as samller than the sampling interval. However, since nr_accesses is unsigned int while the intervals are unsigned long, the maximum nr_accesses could be zero while casting. Implement a function that handles the corner case. Note that this commit is not fixing the real issue since this is only introducing the safe function that will replaces the problematic divisions. The replacements will be made by followup commits, to make backporting on stable series easier. Link: https://lkml.kernel.org/r/20231019194924.100347-1-sj@kernel.org Link: https://lkml.kernel.org/r/20231019194924.100347-2-sj@kernel.org Fixes: 198f0f4c58b9 ("mm/damon/vaddr,paddr: support pageout prioritization") Signed-off-by: SeongJae Park Reported-by: Jakub Acs Cc: [5.16+] Signed-off-by: Andrew Morton commit b1454b463c217e5bc553acc44b2389d9257c9708 Author: Hugh Dickins Date: Mon Oct 23 23:38:41 2023 -0700 mm: mlock: avoid folio_within_range() on KSM pages Since commit dc68badcede4 ("mm: mlock: update mlock_pte_range to handle large folio") I've just occasionally seen VM_WARN_ON_FOLIO(folio_test_ksm) warnings from folio_within_range(), in a splurge after testing with KSM hyperactive. folio_referenced_one()'s use of folio_within_vma() is safe because it checks folio_test_large() first; but allow_mlock_munlock() needs to do the same to avoid those warnings (or check !folio_test_ksm() itself? Or move either check into folio_within_range()? Hard to tell without more examples of its use). Link: https://lkml.kernel.org/r/23852f6a-5bfa-1ffd-30db-30c5560ad426@google.com Fixes: dc68badcede4 ("mm: mlock: update mlock_pte_range to handle large folio") Signed-off-by: Hugh Dickins Reviewed-by: Yin Fengwei Cc: Lorenzo Stoakes Cc: Matthew Wilcox (Oracle) Cc: Stefan Roesch Signed-off-by: Andrew Morton commit 1cbf0a58847b30507611f92ad69964ef37264d14 Author: Hugh Dickins Date: Mon Oct 23 23:26:08 2023 -0700 ext4: add __GFP_NOWARN to GFP_NOWAIT in readahead Since commit e509ad4d77e6 ("ext4: use bdev_getblk() to avoid memory reclaim in readahead path") rightly replaced GFP_NOFAIL allocations by GFP_NOWAIT allocations, I've occasionally been seeing "page allocation failure: order:0" warnings under load: all with ext4_sb_breadahead_unmovable() in the stack. I don't think those warnings are of any interest: suppress them with __GFP_NOWARN. Link: https://lkml.kernel.org/r/7bc6ad16-9a4d-dd90-202e-47d6cbb5a136@google.com Fixes: e509ad4d77e6 ("ext4: use bdev_getblk() to avoid memory reclaim in readahead path") Signed-off-by: Hugh Dickins Reviewed-by: Jan Kara Cc: Hui Zhu Cc: Matthew Wilcox (Oracle) Cc: Theodore Ts'o Signed-off-by: Andrew Morton commit eebb3dabbb5cc590afe32880b5d3726d0fbf88db Author: Baolin Wang Date: Sat Oct 21 12:33:22 2023 +0800 mm: migrate: record the mlocked page status to remove unnecessary lru drain When doing compaction, I found the lru_add_drain() is an obvious hotspot when migrating pages. The distribution of this hotspot is as follows: - 18.75% compact_zone - 17.39% migrate_pages - 13.79% migrate_pages_batch - 11.66% migrate_folio_move - 7.02% lru_add_drain + 7.02% lru_add_drain_cpu + 3.00% move_to_new_folio 1.23% rmap_walk + 1.92% migrate_folio_unmap + 3.20% migrate_pages_sync + 0.90% isolate_migratepages The lru_add_drain() was added by commit c3096e6782b7 ("mm/migrate: __unmap_and_move() push good newpage to LRU") to drain the newpage to LRU immediately, to help to build up the correct newpage->mlock_count in remove_migration_ptes() for mlocked pages. However, if there are no mlocked pages are migrating, then we can avoid this lru drain operation, especailly for the heavy concurrent scenarios. So we can record the source pages' mlocked status in migrate_folio_unmap(), and only drain the lru list when the mlocked status is set in migrate_folio_move(). In addition, the page was already isolated from lru when migrating, so checking the mlocked status is stable by folio_test_mlocked() in migrate_folio_unmap(). After this patch, I can see the hotpot of the lru_add_drain() is gone: - 9.41% migrate_pages_batch - 6.15% migrate_folio_move - 3.64% move_to_new_folio + 1.80% migrate_folio_extra + 1.70% buffer_migrate_folio + 1.41% rmap_walk + 0.62% folio_add_lru + 3.07% migrate_folio_unmap Meanwhile, the compaction latency shows some improvements when running thpscale: base patched Amean fault-both-1 1131.22 ( 0.00%) 1112.55 * 1.65%* Amean fault-both-3 2489.75 ( 0.00%) 2324.15 * 6.65%* Amean fault-both-5 3257.37 ( 0.00%) 3183.18 * 2.28%* Amean fault-both-7 4257.99 ( 0.00%) 4079.04 * 4.20%* Amean fault-both-12 6614.02 ( 0.00%) 6075.60 * 8.14%* Amean fault-both-18 10607.78 ( 0.00%) 8978.86 * 15.36%* Amean fault-both-24 14911.65 ( 0.00%) 11619.55 * 22.08%* Amean fault-both-30 14954.67 ( 0.00%) 14925.66 * 0.19%* Amean fault-both-32 16654.87 ( 0.00%) 15580.31 * 6.45%* Link: https://lkml.kernel.org/r/06e9153a7a4850352ec36602df3a3a844de45698.1697859741.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: "Huang, Ying" Reviewed-by: Zi Yan Cc: Hugh Dickins Cc: Mel Gorman Cc: Vlastimil Babka Cc: Yin Fengwei Signed-off-by: Andrew Morton commit e5b16c862884a62c09ab60cbfc6c7b544670bf9e Author: Vegard Nossum Date: Sun Oct 22 20:56:19 2023 +0200 mm: hugetlb_vmemmap: fix reference to nonexistent file The directory this file is in was renamed but the reference didn't get updated. Fix it. Link: https://lkml.kernel.org/r/20231022185619.919397-1-vegard.nossum@oracle.com Fixes: ee65728e103b ("docs: rename Documentation/vm to Documentation/mm") Signed-off-by: Vegard Nossum Acked-by: Mike Rapoport (IBM) Reviewed-by: Muchun Song Reviewed-by: Rik van Riel Acked-by: Mike Kravetz Cc: Matthew Wilcox Cc: Ira Weiny Cc: Jonathan Corbet Cc: Wu XiangCheng Signed-off-by: Andrew Morton commit 76f26535d1446373d4735a252ea4247c39d64ba6 Author: Hyesoo Yu Date: Mon Oct 23 17:32:16 2023 +0900 mm: page_alloc: check the order of compound page even when the order is zero For compound pages, the head sets the PG_head flag and the tail sets the compound_head to indicate the head page. If a user allocates a compound page and frees it with a different order, the compound page information will not be properly initialized. To detect this problem, compound_order(page) and the order argument are compared, but this is not checked when the order argument is zero. That error should be checked regardless of the order. Link: https://lkml.kernel.org/r/20231023083217.1866451-1-hyesoo.yu@samsung.com Signed-off-by: Hyesoo Yu Reviewed-by: Vishal Moola (Oracle) Signed-off-by: Andrew Morton commit be16dd764a69752a31096d1a6b2ad775b728b1bd Author: Muhammad Muzammil Date: Mon Oct 23 17:44:05 2023 +0500 mm: fix multiple typos in multiple files Link: https://lkml.kernel.org/r/20231023124405.36981-1-m.muzzammilashraf@gmail.com Signed-off-by: Muhammad Muzammil Reviewed-by: Randy Dunlap Cc: "James E.J. Bottomley" Cc: Matthew Wilcox (Oracle) Cc: Muhammad Muzammil Signed-off-by: Andrew Morton commit 98b32d296d95d7aa0516c36b72406277412268cd Author: Vishal Moola (Oracle) Date: Fri Oct 20 11:33:31 2023 -0700 mm/khugepaged: convert collapse_pte_mapped_thp() to use folios This removes 2 calls to compound_head() and helps convert khugepaged to use folios throughout. Previously, if the address passed to collapse_pte_mapped_thp() corresponded to a tail page, the scan would fail immediately. Using filemap_lock_folio() we get the corresponding folio back and try to operate on the folio instead. Link: https://lkml.kernel.org/r/20231020183331.10770-6-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Rik van Riel Reviewed-by: Yang Shi Cc: Kefeng Wang Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit b455f39d228935f88eebcd1f7c1a6981093c6a3b Author: Vishal Moola (Oracle) Date: Fri Oct 20 11:33:30 2023 -0700 mm/khugepaged: convert alloc_charge_hpage() to use folios Also remove count_memcg_page_event now that its last caller no longer uses it and reword hpage_collapse_alloc_page() to hpage_collapse_alloc_folio(). This removes 1 call to compound_head() and helps convert khugepaged to use folios throughout. Link: https://lkml.kernel.org/r/20231020183331.10770-5-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Rik van Riel Reviewed-by: Yang Shi Cc: Kefeng Wang Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit dbf85c21e4aff90912b5d7755d2b25611f9191e9 Author: Vishal Moola (Oracle) Date: Fri Oct 20 11:33:29 2023 -0700 mm/khugepaged: convert is_refcount_suitable() to use folios Both callers of is_refcount_suitable() have been converted to use folios, so convert it to take in a folio. Both callers only operate on head pages of folios so mapcount/refcount conversions here are trivial. Removes 3 calls to compound head, and removes 315 bytes of kernel text. Link: https://lkml.kernel.org/r/20231020183331.10770-4-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Reviewed-by: David Hildenbrand Reviewed-by: Yang Shi Cc: Kefeng Wang Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 5c07ebb372d66423e508ecfb8e00324f8797f072 Author: Vishal Moola (Oracle) Date: Fri Oct 20 11:33:28 2023 -0700 mm/khugepaged: convert hpage_collapse_scan_pmd() to use folios Replaces 5 calls to compound_head(), and removes 1385 bytes of kernel text. Link: https://lkml.kernel.org/r/20231020183331.10770-3-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Rik van Riel Reviewed-by: Yang Shi Cc: Kefeng Wang Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 8dd1e896735f6e5abf66525dfd39bbd7b8c0c6d6 Author: Vishal Moola (Oracle) Date: Fri Oct 20 11:33:27 2023 -0700 mm/khugepaged: convert __collapse_huge_page_isolate() to use folios Patch series "Some khugepaged folio conversions", v3. This patchset converts a number of functions to use folios. This cleans up some khugepaged code and removes a large number of hidden compound_head() calls. This patch (of 5): Replaces 11 calls to compound_head() with 1, and removes 1348 bytes of kernel text. Link: https://lkml.kernel.org/r/20231020183331.10770-1-vishal.moola@gmail.com Link: https://lkml.kernel.org/r/20231020183331.10770-2-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand Reviewed-by: Yang Shi Cc: Kefeng Wang Signed-off-by: Andrew Morton commit b7812c86c7403283f8b3775ee11c6c01d457016c Author: Qi Zheng Date: Thu Oct 19 18:43:55 2023 +0800 mm: memory_hotplug: drop memoryless node from fallback lists In offline_pages(), if a node becomes memoryless, we will clear its N_MEMORY state by calling node_states_clear_node(). But we do this after rebuilding the zonelists by calling build_all_zonelists(), which will cause this memoryless node to still be in the fallback nodes (node_order[]) of other nodes. To drop memoryless nodes from fallback nodes in this case, just call node_states_clear_node() before calling build_all_zonelists(). In this way, we will not try to allocate pages from memoryless node0, then the panic mentioned in [1] will also be fixed. Even though this problem has been solved by dropping the NODE_MIN_SIZE constrain in x86 [2], it would be better to fix it in the core MM as well. https://lore.kernel.org/all/20230212110305.93670-1-zhengqi.arch@bytedance.com/ [1] https://lore.kernel.org/all/20231017062215.171670-1-rppt@kernel.org/ [2] Link: https://lkml.kernel.org/r/9f1dbe7ee1301c7163b2770e32954ff5e3ecf2c4.1697711415.git.zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Acked-by: David Hildenbrand Acked-by: Ingo Molnar Cc: Aneesh Kumar K.V Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Rapoport Cc: Oscar Salvador Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit c2baef394af88af19e3945f861145679e92ff3e4 Author: Qi Zheng Date: Thu Oct 19 18:43:54 2023 +0800 mm: page_alloc: skip memoryless nodes entirely Patch series "handle memoryless nodes more appropriately", v3. Currently, in the process of initialization or offline memory, memoryless nodes will still be built into the fallback list of itself or other nodes. This is not what we expected, so this patch series removes memoryless nodes from the fallback list entirely. This patch (of 2): In find_next_best_node(), we skipped the memoryless nodes when building the zonelists of other normal nodes (N_NORMAL), but did not skip the memoryless node itself when building the zonelist. This will cause it to be traversed at runtime. For example, say we have node0 and node1, node0 is memoryless node, then the fallback order of node0 and node1 as follows: [ 0.153005] Fallback order for Node 0: 0 1 [ 0.153564] Fallback order for Node 1: 1 After this patch, we skip memoryless node0 entirely, then the fallback order of node0 and node1 as follows: [ 0.155236] Fallback order for Node 0: 1 [ 0.155806] Fallback order for Node 1: 1 So it becomes completely invisible, which will reduce runtime overhead. And in this way, we will not try to allocate pages from memoryless node0, then the panic mentioned in [1] will also be fixed. Even though this problem has been solved by dropping the NODE_MIN_SIZE constrain in x86 [2], it would be better to fix it in core MM as well. [1]. https://lore.kernel.org/all/20230212110305.93670-1-zhengqi.arch@bytedance.com/ [2]. https://lore.kernel.org/all/20231017062215.171670-1-rppt@kernel.org/ [zhengqi.arch@bytedance.com: update comment, per Ingo] Link: https://lkml.kernel.org/r/7300fc00a057eefeb9a68c8ad28171c3f0ce66ce.1697799303.git.zhengqi.arch@bytedance.com Link: https://lkml.kernel.org/r/cover.1697799303.git.zhengqi.arch@bytedance.com Link: https://lkml.kernel.org/r/cover.1697711415.git.zhengqi.arch@bytedance.com Link: https://lkml.kernel.org/r/157013e978468241de4a4c05d5337a44638ecb0e.1697711415.git.zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Acked-by: David Hildenbrand Acked-by: Ingo Molnar Cc: Aneesh Kumar K.V Cc: "Huang, Ying" Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Mel Gorman Cc: Michal Hocko Cc: Mike Rapoport Cc: Oscar Salvador Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 49cac03a8f0a56cafa5329911564c97c130ced43 Author: Zi Yan Date: Tue Oct 17 12:31:29 2023 -0400 mm/migrate: add nr_split to trace_mm_migrate_pages stats. Add nr_split to trace_mm_migrate_pages for large folio (including THP) split events. [akpm@linux-foundation.org: cleanup per Huang, Ying] Link: https://lkml.kernel.org/r/20231017163129.2025214-2-zi.yan@sent.com Signed-off-by: Zi Yan Reviewed-by: "Huang, Ying" Reviewed-by: Baolin Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit a259945efe6ada94087ef666e9b38f8e34ea34ba Author: Zi Yan Date: Tue Oct 17 12:31:28 2023 -0400 mm/migrate: correct nr_failed in migrate_pages_sync() nr_failed was missing the large folio splits from migrate_pages_batch() and can cause a mismatch between migrate_pages() return value and the number of not migrated pages, i.e., when the return value of migrate_pages() is 0, there are still pages left in the from page list. It will happen when a non-PMD THP large folio fails to migrate due to -ENOMEM and is split successfully but not all the split pages are not migrated, migrate_pages_batch() would return non-zero, but astats.nr_thp_split = 0. nr_failed would be 0 and returned to the caller of migrate_pages(), but the not migrated pages are left in the from page list without being added back to LRU lists. Fix it by adding a new nr_split counter for large folio splits and adding it to nr_failed in migrate_page_sync() after migrate_pages_batch() is done. Link: https://lkml.kernel.org/r/20231017163129.2025214-1-zi.yan@sent.com Fixes: 2ef7dbb26990 ("migrate_pages: try migrate in batch asynchronously firstly") Signed-off-by: Zi Yan Acked-by: Huang Ying Reviewed-by: Baolin Wang Cc: David Hildenbrand Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 245245c2fffd0050772a3f30ba50e2be92537a32 Author: Liu Shixin Date: Mon Oct 23 10:51:25 2023 +0800 mm/kmemleak: move the initialisation of object to __link_object In patch (mm: kmemleak: split __create_object into two functions), the initialisation of object has been splited in two places. Catalin said it feels a bit weird and error prone. So leave __alloc_object() to just do the actual allocation and let __link_object() do the full initialisation. Link: https://lkml.kernel.org/r/20231023025125.90972-1-liushixin2@huawei.com Signed-off-by: Liu Shixin Suggested-by: Catalin Marinas Signed-off-by: Andrew Morton commit 5e4fc577db2514fee3cc2729415d0e2589d5d056 Author: Liu Shixin Date: Wed Oct 18 18:29:52 2023 +0800 mm/kmemleak: fix partially freeing unknown object warning delete_object_part() can be called by multiple callers in the same time. If an object is found and removed by a caller, and then another caller try to find it too, it failed and return directly. It still be recorded by kmemleak even if it has already been freed to buddy. With DEBUG on, kmemleak will report the following warning, kmemleak: Partially freeing unknown object at 0xa1af86000 (size 4096) CPU: 0 PID: 742 Comm: test_huge Not tainted 6.6.0-rc3kmemleak+ #54 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Call Trace: dump_stack_lvl+0x37/0x50 kmemleak_free_part_phys+0x50/0x60 hugetlb_vmemmap_optimize+0x172/0x290 ? __pfx_vmemmap_remap_pte+0x10/0x10 __prep_new_hugetlb_folio+0xe/0x30 prep_new_hugetlb_folio.isra.0+0xe/0x40 alloc_fresh_hugetlb_folio+0xc3/0xd0 alloc_surplus_hugetlb_folio.constprop.0+0x6e/0xd0 hugetlb_acct_memory.part.0+0xe6/0x2a0 hugetlb_reserve_pages+0x110/0x2c0 hugetlbfs_file_mmap+0x11d/0x1b0 mmap_region+0x248/0x9a0 ? hugetlb_get_unmapped_area+0x15c/0x2d0 do_mmap+0x38b/0x580 vm_mmap_pgoff+0xe6/0x190 ksys_mmap_pgoff+0x18a/0x1f0 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 Expand __create_object() and move __alloc_object() to the beginning. Then use kmemleak_lock to protect __find_and_remove_object() and __link_object() as a whole, which can guarantee all objects are processed sequentialally. Link: https://lkml.kernel.org/r/20231018102952.3339837-8-liushixin2@huawei.com Fixes: 53238a60dd4a ("kmemleak: Allow partial freeing of memory blocks") Signed-off-by: Liu Shixin Reviewed-by: Catalin Marinas Cc: Kefeng Wang Cc: Patrick Wang Signed-off-by: Andrew Morton commit 858a195b9330d0bd36f59e8652f693a1beb7da2f Author: Liu Shixin Date: Wed Oct 18 18:29:51 2023 +0800 mm: kmemleak: add __find_and_remove_object() Add new __find_and_remove_object() without kmemleak_lock protect, it is in preparation for the next patch. Link: https://lkml.kernel.org/r/20231018102952.3339837-7-liushixin2@huawei.com Signed-off-by: Liu Shixin Acked-by: Catalin Marinas Cc: Kefeng Wang Cc: Patrick Wang Signed-off-by: Andrew Morton commit 2e1d47385f98aa0fa7d71aeee32d26cc6f8493e0 Author: Liu Shixin Date: Wed Oct 18 18:29:50 2023 +0800 mm: kmemleak: use mem_pool_free() to free object The kmemleak object is allocated by mem_pool_alloc(), which could be from slab or mem_pool[], so it's not suitable using __kmem_cache_free() to free the object, use __mem_pool_free() instead. Link: https://lkml.kernel.org/r/20231018102952.3339837-6-liushixin2@huawei.com Fixes: 0647398a8c7b ("mm: kmemleak: simple memory allocation pool for kmemleak objects") Signed-off-by: Liu Shixin Reviewed-by: Catalin Marinas Cc: Kefeng Wang Cc: Patrick Wang Signed-off-by: Andrew Morton commit 0edd7b58293340d26380d7510fd4fc08e5902511 Author: Liu Shixin Date: Wed Oct 18 18:29:49 2023 +0800 mm: kmemleak: split __create_object into two functions __create_object() consists of two part, the first part allocate a kmemleak object and initialize it, the second part insert it into object tree. This function need kmemleak_lock but actually only the second part need lock. Split it into two functions, the first function __alloc_object only allocate a kmemleak object, and the second function __link_object() will initialize the object and insert it into object tree, use the kmemleak_lock to protect __link_object() only. [akpm@linux-foundation.org: coding-style cleanups] Link: https://lkml.kernel.org/r/20231018102952.3339837-5-liushixin2@huawei.com Signed-off-by: Liu Shixin Cc: Catalin Marinas Cc: Kefeng Wang Cc: Patrick Wang Signed-off-by: Andrew Morton commit 62047e0f3e3a707599afe6d43cf684a2a02d05d5 Author: Liu Shixin Date: Wed Oct 18 18:29:48 2023 +0800 mm/kmemleak: fix print format of pointer in pr_debug() With 0x%p, the pointer will be hashed and print (____ptrval____) instead. And with 0x%pa, the pointer can be successfully printed but with duplicate prefixes, which looks like: kmemleak: kmemleak_free(0x(____ptrval____)) kmemleak: kmemleak_free_percpu(0x(____ptrval____)) kmemleak: kmemleak_free_part_phys(0x0x0000000a1af86000) Use 0x%px instead of 0x%p or 0x%pa to print the pointer. Then the print will be like: kmemleak: kmemleak_free(0xffff9111c145b020) kmemleak: kmemleak_free_percpu(0x00000000000333b0) kmemleak: kmemleak_free_part_phys(0x0000000a1af80000) Link: https://lkml.kernel.org/r/20231018102952.3339837-4-liushixin2@huawei.com Signed-off-by: Liu Shixin Acked-by: Catalin Marinas Cc: Kefeng Wang Cc: Patrick Wang Signed-off-by: Andrew Morton commit 80203f1ca086835100843f1474bd6dd4a48cc73b Author: Liu Shixin Date: Wed Oct 18 18:29:47 2023 +0800 bootmem: use kmemleak_free_part_phys in free_bootmem_page Since kmemleak_alloc_phys() rather than kmemleak_alloc() was called from memblock_alloc_range_nid(), kmemleak_free_part_phys() should be used to delete kmemleak object in free_bootmem_page(). In debug mode, there are following warning: kmemleak: Partially freeing unknown object at 0xffff97345aff7000 (size 4096) Link: https://lkml.kernel.org/r/20231018102952.3339837-3-liushixin2@huawei.com Fixes: 028725e73375 ("bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page") Signed-off-by: Liu Shixin Acked-by: Catalin Marinas Cc: Kefeng Wang Cc: Patrick Wang Signed-off-by: Andrew Morton commit 6d4e2cda62af38f7c21052b6847ffff08ea7173f Author: Liu Shixin Date: Wed Oct 18 18:29:46 2023 +0800 bootmem: use kmemleak_free_part_phys in put_page_bootmem Patch series "Some bugfix about kmemleak", v3. Some bugfixes for kmemleak and the printed info from debug mode. This patch (of 7): Since kmemleak_alloc_phys() rather than kmemleak_alloc() was called from memblock_alloc_range_nid(), kmemleak_free_part_phys() should be used to delete kmemleak object in put_page_bootmem(). In debug mode, there are following warning: kmemleak: Partially freeing unknown object at 0xffff97345aff7000 (size 4096) Link: https://lkml.kernel.org/r/20231018102952.3339837-1-liushixin2@huawei.com Link: https://lkml.kernel.org/r/20231018102952.3339837-2-liushixin2@huawei.com Fixes: dd0ff4d12dd2 ("bootmem: remove the vmemmap pages from kmemleak in put_page_bootmem") Signed-off-by: Liu Shixin Acked-by: Catalin Marinas Cc: Kefeng Wang Cc: Patrick Wang Signed-off-by: Andrew Morton commit 8f0f4788b1247c2f92ecacd8f86ce0b379b807b9 Author: Kefeng Wang Date: Wed Oct 18 22:08:06 2023 +0800 mm: remove page_cpupid_xchg_last() Since all calls use folio_xchg_last_cpupid(), remove page_cpupid_xchg_last(). Link: https://lkml.kernel.org/r/20231018140806.2783514-20-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit c2c3b5148052cef670d359b81d338d20b96bf47f Author: Kefeng Wang Date: Wed Oct 18 22:08:05 2023 +0800 mm: use folio_xchg_last_cpupid() in wp_page_reuse() Convert to use folio_xchg_last_cpupid() in wp_page_reuse(), and remove page variable. Since now only normal and PMD-mapped page is handled by numa balancing, it's enough to only update the entire folio's last cpupid. Link: https://lkml.kernel.org/r/20231018140806.2783514-19-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit a86bc96b77df40c27ead5ef4ac3837904b7eb53f Author: Kefeng Wang Date: Wed Oct 18 22:08:04 2023 +0800 mm: convert wp_page_reuse() and finish_mkwrite_fault() to take a folio Saves one compound_head() call, also in preparation for page_cpupid_xchg_last() conversion. Link: https://lkml.kernel.org/r/20231018140806.2783514-18-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit c08b7e3830dbf24dd2552ddeea84f00393842f1b Author: Kefeng Wang Date: Wed Oct 18 22:08:03 2023 +0800 mm: make finish_mkwrite_fault() static Make finish_mkwrite_fault static since it is not used outside of memory.c. Link: https://lkml.kernel.org/r/20231018140806.2783514-17-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit c82530113480f8db9dd9584c51ec9326e6ce9790 Author: Kefeng Wang Date: Wed Oct 18 22:08:02 2023 +0800 mm: huge_memory: use folio_xchg_last_cpupid() in __split_huge_page_tail() Convert to use folio_xchg_last_cpupid() in __split_huge_page_tail(). Link: https://lkml.kernel.org/r/20231018140806.2783514-16-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit 4e694fe4d2fa3031392bdbeaa88066f67c886a0c Author: Kefeng Wang Date: Wed Oct 18 22:08:01 2023 +0800 mm: migrate: use folio_xchg_last_cpupid() in folio_migrate_flags() Convert to use folio_xchg_last_cpupid() in folio_migrate_flags(), also directly use folio_nid() instead of page_to_nid(&folio->page). Link: https://lkml.kernel.org/r/20231018140806.2783514-15-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit 1b143cc77f2074dd43b610d6bfffc822d20b6e16 Author: Kefeng Wang Date: Wed Oct 18 22:08:00 2023 +0800 sched/fair: use folio_xchg_last_cpupid() in should_numa_migrate_memory() Convert to use folio_xchg_last_cpupid() in should_numa_migrate_memory(). Link: https://lkml.kernel.org/r/20231018140806.2783514-14-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit 136d0b47576f8701d68c2d504e7237d9fdc4ebbd Author: Kefeng Wang Date: Wed Oct 18 22:07:59 2023 +0800 mm: add folio_xchg_last_cpupid() Add folio_xchg_last_cpupid() wrapper, which is required to convert page_cpupid_xchg_last() to folio vertion later in the series. Link: https://lkml.kernel.org/r/20231018140806.2783514-13-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit f393084382fa3bbd5840b428d538dbcb33be0186 Author: Kefeng Wang Date: Wed Oct 18 22:07:58 2023 +0800 mm: remove xchg_page_access_time() Since all calls use folio_xchg_access_time(), remove xchg_page_access_time(). Link: https://lkml.kernel.org/r/20231018140806.2783514-12-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit d986ba2b1953f761d3859c22160e82c58ed4287d Author: Kefeng Wang Date: Wed Oct 18 22:07:57 2023 +0800 mm: huge_memory: use a folio in change_huge_pmd() Use a folio in change_huge_pmd(), which helps to remove last xchg_page_access_time() caller. Link: https://lkml.kernel.org/r/20231018140806.2783514-11-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit ec1778807a8053d14cde7cfd75fbd66e0c7b9c9f Author: Kefeng Wang Date: Wed Oct 18 22:07:56 2023 +0800 mm: mprotect: use a folio in change_pte_range() Use a folio in change_pte_range() to save three compound_head() calls. Since now only normal and PMD-mapped page is handled by numa balancing, it is enough to only update the entire folio's access time. Link: https://lkml.kernel.org/r/20231018140806.2783514-10-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit 0b201c3624ae9f58ebfff8484f304f3008fb01b8 Author: Kefeng Wang Date: Wed Oct 18 22:07:55 2023 +0800 sched/fair: use folio_xchg_access_time() in numa_hint_fault_latency() Convert to use folio_xchg_access_time() in numa_hint_fault_latency(). Link: https://lkml.kernel.org/r/20231018140806.2783514-9-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit 55c199385c4465e9abe1a3d6d1aba348d0356e03 Author: Kefeng Wang Date: Wed Oct 18 22:07:54 2023 +0800 mm: add folio_xchg_access_time() Add folio_xchg_access_time() wrapper, which is required to convert xchg_page_access_time() to folio vertion later in the series. Link: https://lkml.kernel.org/r/20231018140806.2783514-8-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit f39eac30a8f334f0765ef78fe4d13b3fd5bfa3fd Author: Kefeng Wang Date: Wed Oct 18 22:07:53 2023 +0800 mm: remove page_cpupid_last() Since all calls use folio_last_cpupid(), remove page_cpupid_last(). Link: https://lkml.kernel.org/r/20231018140806.2783514-7-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit 19c1ac02ce02158fa22eb53f2750525ae93da9ef Author: Kefeng Wang Date: Wed Oct 18 22:07:52 2023 +0800 mm: huge_memory: use folio_last_cpupid() in __split_huge_page_tail() Convert to use folio_last_cpupid() in __split_huge_page_tail(). Link: https://lkml.kernel.org/r/20231018140806.2783514-6-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit c4a8d2faab1f9165df1543795254b1c2470ce7f8 Author: Kefeng Wang Date: Wed Oct 18 22:07:51 2023 +0800 mm: huge_memory: use folio_last_cpupid() in do_huge_pmd_numa_page() Convert to use folio_last_cpupid() in do_huge_pmd_numa_page(). Link: https://lkml.kernel.org/r/20231018140806.2783514-5-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit 67b33e3ff58374b3fca929933ccc04a1858fda6a Author: Kefeng Wang Date: Wed Oct 18 22:07:50 2023 +0800 mm: memory: use folio_last_cpupid() in do_numa_page() Convert to use folio_last_cpupid() in do_numa_page(). Link: https://lkml.kernel.org/r/20231018140806.2783514-4-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit 155c98cfcf961327adedabd629edfc2301cf354b Author: Kefeng Wang Date: Wed Oct 18 22:07:49 2023 +0800 mm: add folio_last_cpupid() Add folio_last_cpupid() wrapper, which is required to convert page_cpupid_last() to folio vertion later in the series. Link: https://lkml.kernel.org/r/20231018140806.2783514-3-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit 1d44f2e6d178163a94980fd5f9a4b04b6b36535b Author: Kefeng Wang Date: Wed Oct 18 22:07:48 2023 +0800 mm_types: add virtual and _last_cpupid into struct folio Patch series "mm: convert page cpupid functions to folios", v3. The cpupid(or access time) used by numa balancing is stored in flags or _last_cpupid(if LAST_CPUPID_NOT_IN_PAGE_FLAGS) of page, this is to convert page cpupid to folio cpupid, a new _last_cpupid is added into folio, which make us to use folio->_last_cpupid directly, and the page cpupid functions are converted to folio ones. page_cpupid_last() -> folio_last_cpupid() xchg_page_access_time() -> folio_xchg_access_time() page_cpupid_xchg_last() -> folio_xchg_last_cpupid() This patch (of 19): If WANT_PAGE_VIRTUAL and LAST_CPUPID_NOT_IN_PAGE_FLAGS defined, the 'virtual' and '_last_cpupid' are in struct page, and since _last_cpupid is used by numa balancing feature, it is better to move it before KMSAN metadata from struct page, also add them into struct folio to make us to access them from folio directly. Link: https://lkml.kernel.org/r/20231018140806.2783514-1-wangkefeng.wang@huawei.com Link: https://lkml.kernel.org/r/20231018140806.2783514-2-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Peter Zijlstra Cc: Vincent Guittot Cc: Zi Yan Signed-off-by: Andrew Morton commit e5b306a082982cb98bc7ec48a382225522401a61 Author: Kairui Song Date: Tue Oct 17 09:17:28 2023 +0800 mm/swap: avoid a xa load for swapout path A variable is never used for swapout path (shadowp is NULL) and compiler is unable to optimize out the unneeded load since it's a function call. The was introduced by 3852f6768ede ("mm/swapcache: support to handle the shadow entries"). Link: https://lkml.kernel.org/r/20231017011728.37508-1-ryncsn@gmail.com Signed-off-by: Kairui Song Reviewed-by: Matthew Wilcox (Oracle) Cc: Huang Ying Signed-off-by: Andrew Morton commit e56808fef8f71a192b2740c0b6ea8be7ab865d54 Author: Roman Gushchin Date: Thu Oct 19 15:53:46 2023 -0700 mm: kmem: reimplement get_obj_cgroup_from_current() Reimplement get_obj_cgroup_from_current() using current_obj_cgroup(). get_obj_cgroup_from_current() and current_obj_cgroup() share 80% of the code, so the new implementation is almost trivial. get_obj_cgroup_from_current() is a convenient function used by the bpf subsystem, so there is no reason to get rid of it completely. Link: https://lkml.kernel.org/r/20231019225346.1822282-7-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin (Cruise) Reviewed-by: Vlastimil Babka Acked-by: Shakeel Butt Cc: David Rientjes Cc: Dennis Zhou Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Cc: Naresh Kamboju Signed-off-by: Andrew Morton commit c63b835d0eafc956c43b8c6605708240ac52b8cd Author: Roman Gushchin Date: Thu Oct 19 15:53:45 2023 -0700 percpu: scoped objcg protection Similar to slab and kmem, switch to a scope-based protection of the objcg pointer to avoid. Link: https://lkml.kernel.org/r/20231019225346.1822282-6-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin (Cruise) Tested-by: Naresh Kamboju Acked-by: Shakeel Butt Reviewed-by: Vlastimil Babka Cc: David Rientjes Cc: Dennis Zhou Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Signed-off-by: Andrew Morton commit e86828e5446d95676835679837d995dec188d2be Author: Roman Gushchin Date: Thu Oct 19 15:53:44 2023 -0700 mm: kmem: scoped objcg protection Switch to a scope-based protection of the objcg pointer on slab/kmem allocation paths. Instead of using the get_() semantics in the pre-allocation hook and put the reference afterwards, let's rely on the fact that objcg is pinned by the scope. It's possible because: 1) if the objcg is received from the current task struct, the task is keeping a reference to the objcg. 2) if the objcg is received from an active memcg (remote charging), the memcg is pinned by the scope and has a reference to the corresponding objcg. Link: https://lkml.kernel.org/r/20231019225346.1822282-5-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin (Cruise) Tested-by: Naresh Kamboju Acked-by: Shakeel Butt Reviewed-by: Vlastimil Babka Cc: David Rientjes Cc: Dennis Zhou Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Signed-off-by: Andrew Morton commit 675d6c9b59e313ca2573c93e8fd87011a99bb8ce Author: Roman Gushchin Date: Thu Oct 19 15:53:43 2023 -0700 mm: kmem: make memcg keep a reference to the original objcg Keep a reference to the original objcg object for the entire life of a memcg structure. This allows to simplify the synchronization on the kernel memory allocation paths: pinning a (live) memcg will also pin the corresponding objcg. The memory overhead of this change is minimal because object cgroups usually outlive their corresponding memory cgroups even without this change, so it's only an additional pointer per memcg. Link: https://lkml.kernel.org/r/20231019225346.1822282-4-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin (Cruise) Tested-by: Naresh Kamboju Acked-by: Shakeel Butt Reviewed-by: Vlastimil Babka Cc: David Rientjes Cc: Dennis Zhou Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Signed-off-by: Andrew Morton commit 1aacbd354313f25c855e662e41c04e2abf71444a Author: Roman Gushchin Date: Thu Oct 19 15:53:42 2023 -0700 mm: kmem: add direct objcg pointer to task_struct To charge a freshly allocated kernel object to a memory cgroup, the kernel needs to obtain an objcg pointer. Currently it does it indirectly by obtaining the memcg pointer first and then calling to __get_obj_cgroup_from_memcg(). Usually tasks spend their entire life belonging to the same object cgroup. So it makes sense to save the objcg pointer on task_struct directly, so it can be obtained faster. It requires some work on fork, exit and cgroup migrate paths, but these paths are way colder. To avoid any costly synchronization the following rules are applied: 1) A task sets it's objcg pointer itself. 2) If a task is being migrated to another cgroup, the least significant bit of the objcg pointer is set atomically. 3) On the allocation path the objcg pointer is obtained locklessly using the READ_ONCE() macro and the least significant bit is checked. If it's set, the following procedure is used to update it locklessly: - task->objcg is zeroed using cmpxcg - new objcg pointer is obtained - task->objcg is updated using try_cmpxchg - operation is repeated if try_cmpxcg fails It guarantees that no updates will be lost if task migration is racing against objcg pointer update. It also allows to keep both read and write paths fully lockless. Because the task is keeping a reference to the objcg, it can't go away while the task is alive. This commit doesn't change the way the remote memcg charging works. Link: https://lkml.kernel.org/r/20231019225346.1822282-3-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin (Cruise) Tested-by: Naresh Kamboju Acked-by: Johannes Weiner Acked-by: Shakeel Butt Reviewed-by: Vlastimil Babka Cc: David Rientjes Cc: Dennis Zhou Cc: Michal Hocko Cc: Muchun Song Signed-off-by: Andrew Morton commit 7d0715d0d6b28a831b6fdfefb29c5a7a4929fa49 Author: Roman Gushchin Date: Thu Oct 19 15:53:41 2023 -0700 mm: kmem: optimize get_obj_cgroup_from_current() Patch series "mm: improve performance of accounted kernel memory allocations", v5. This patchset improves the performance of accounted kernel memory allocations by ~30% as measured by a micro-benchmark [1]. The benchmark is very straightforward: 1M of 64 bytes-large kmalloc() allocations. Below are results with the disabled kernel memory accounting, the original state and with this patchset applied. | | Kmem disabled | Original | Patched | Delta | |-------------+---------------+----------+---------+--------| | User cgroup | 29764 | 84548 | 59078 | -30.0% | | Root cgroup | 29742 | 48342 | 31501 | -34.8% | As we can see, the patchset removes the majority of the overhead when there is no actual accounting (a task belongs to the root memory cgroup) and almost halves the accounting overhead otherwise. The main idea is to get rid of unnecessary memcg to objcg conversions and switch to a scope-based protection of objcgs, which eliminates extra operations with objcg reference counters under a rcu read lock. More details are provided in individual commit descriptions. This patch (of 5): Manually inline memcg_kmem_bypass() and active_memcg() to speed up get_obj_cgroup_from_current() by avoiding duplicate in_task() checks and active_memcg() readings. Also add a likely() macro to __get_obj_cgroup_from_memcg(): obj_cgroup_tryget() should succeed at almost all times except a very unlikely race with the memcg deletion path. Link: https://lkml.kernel.org/r/20231019225346.1822282-1-roman.gushchin@linux.dev Link: https://lkml.kernel.org/r/20231019225346.1822282-2-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin (Cruise) Tested-by: Naresh Kamboju Acked-by: Shakeel Butt Acked-by: Johannes Weiner Reviewed-by: Vlastimil Babka Cc: David Rientjes Cc: Dennis Zhou Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Signed-off-by: Andrew Morton commit 6ccdcb6d3a741c4e005ca6ffd4a62ddf8b5bead3 Author: Huang Ying Date: Mon Oct 16 13:30:02 2023 +0800 mm, pcp: reduce detecting time of consecutive high order page freeing In current PCP auto-tuning design, if the number of pages allocated is much more than that of pages freed on a CPU, the PCP high may become the maximal value even if the allocating/freeing depth is small, for example, in the sender of network workloads. If a CPU was used as sender originally, then it is used as receiver after context switching, we need to fill the whole PCP with maximal high before triggering PCP draining for consecutive high order freeing. This will hurt the performance of some network workloads. To solve the issue, in this patch, we will track the consecutive page freeing with a counter in stead of relying on PCP draining. So, we can detect consecutive page freeing much earlier. On a 2-socket Intel server with 128 logical CPU, we tested SCTP_STREAM_MANY test case of netperf test suite with 64-pair processes. With the patch, the network bandwidth improves 5.0%. This restores the performance drop caused by PCP auto-tuning. Link: https://lkml.kernel.org/r/20231016053002.756205-10-ying.huang@intel.com Signed-off-by: "Huang, Ying" Cc: Mel Gorman Cc: Vlastimil Babka Cc: David Hildenbrand Cc: Johannes Weiner Cc: Dave Hansen Cc: Michal Hocko Cc: Pavel Tatashin Cc: Matthew Wilcox Cc: Christoph Lameter Cc: Arjan van de Ven Cc: Sudeep Holla Signed-off-by: Andrew Morton commit 57c0419c5f0ea2ccab8700895c8fac20ba1eb21f Author: Huang Ying Date: Mon Oct 16 13:30:01 2023 +0800 mm, pcp: decrease PCP high if free pages < high watermark One target of PCP is to minimize pages in PCP if the system free pages is too few. To reach that target, when page reclaiming is active for the zone (ZONE_RECLAIM_ACTIVE), we will stop increasing PCP high in allocating path, decrease PCP high and free some pages in freeing path. But this may be too late because the background page reclaiming may introduce latency for some workloads. So, in this patch, during page allocation we will detect whether the number of free pages of the zone is below high watermark. If so, we will stop increasing PCP high in allocating path, decrease PCP high and free some pages in freeing path. With this, we can reduce the possibility of the premature background page reclaiming caused by too large PCP. The high watermark checking is done in allocating path to reduce the overhead in hotter freeing path. Link: https://lkml.kernel.org/r/20231016053002.756205-9-ying.huang@intel.com Signed-off-by: "Huang, Ying" Cc: Mel Gorman Cc: Vlastimil Babka Cc: David Hildenbrand Cc: Johannes Weiner Cc: Dave Hansen Cc: Michal Hocko Cc: Pavel Tatashin Cc: Matthew Wilcox Cc: Christoph Lameter Cc: Arjan van de Ven Cc: Sudeep Holla Signed-off-by: Andrew Morton commit 51a755c56dc05a8b31ed28d24f28354946dc7529 Author: Huang Ying Date: Mon Oct 16 13:30:00 2023 +0800 mm: tune PCP high automatically The target to tune PCP high automatically is as follows, - Minimize allocation/freeing from/to shared zone - Minimize idle pages in PCP - Minimize pages in PCP if the system free pages is too few To reach these target, a tuning algorithm as follows is designed, - When we refill PCP via allocating from the zone, increase PCP high. Because if we had larger PCP, we could avoid to allocate from the zone. - In periodic vmstat updating kworker (via refresh_cpu_vm_stats()), decrease PCP high to try to free possible idle PCP pages. - When page reclaiming is active for the zone, stop increasing PCP high in allocating path, decrease PCP high and free some pages in freeing path. So, the PCP high can be tuned to the page allocating/freeing depth of workloads eventually. One issue of the algorithm is that if the number of pages allocated is much more than that of pages freed on a CPU, the PCP high may become the maximal value even if the allocating/freeing depth is small. But this isn't a severe issue, because there are no idle pages in this case. One alternative choice is to increase PCP high when we drain PCP via trying to free pages to the zone, but don't increase PCP high during PCP refilling. This can avoid the issue above. But if the number of pages allocated is much less than that of pages freed on a CPU, there will be many idle pages in PCP and it is hard to free these idle pages. 1/8 (>> 3) of PCP high will be decreased periodically. The value 1/8 is kind of arbitrary. Just to make sure that the idle PCP pages will be freed eventually. On a 2-socket Intel server with 224 logical CPU, we run 8 kbuild instances in parallel (each with `make -j 28`) in 8 cgroup. This simulates the kbuild server that is used by 0-Day kbuild service. With the patch, the build time decreases 3.5%. The cycles% of the spinlock contention (mostly for zone lock) decreases from 11.0% to 0.5%. The number of PCP draining for high order pages freeing (free_high) decreases 65.6%. The number of pages allocated from zone (instead of from PCP) decreases 83.9%. Link: https://lkml.kernel.org/r/20231016053002.756205-8-ying.huang@intel.com Signed-off-by: "Huang, Ying" Suggested-by: Mel Gorman Suggested-by: Michal Hocko Cc: Vlastimil Babka Cc: David Hildenbrand Cc: Johannes Weiner Cc: Dave Hansen Cc: Pavel Tatashin Cc: Matthew Wilcox Cc: Christoph Lameter Cc: Arjan van de Ven Cc: Sudeep Holla Signed-off-by: Andrew Morton commit 90b41691b9881376fe784e13b5766ec3676fdb55 Author: Huang Ying Date: Mon Oct 16 13:29:59 2023 +0800 mm: add framework for PCP high auto-tuning The page allocation performance requirements of different workloads are usually different. So, we need to tune PCP (per-CPU pageset) high to optimize the workload page allocation performance. Now, we have a system wide sysctl knob (percpu_pagelist_high_fraction) to tune PCP high by hand. But, it's hard to find out the best value by hand. And one global configuration may not work best for the different workloads that run on the same system. One solution to these issues is to tune PCP high of each CPU automatically. This patch adds the framework for PCP high auto-tuning. With it, pcp->high of each CPU will be changed automatically by tuning algorithm at runtime. The minimal high (pcp->high_min) is the original PCP high value calculated based on the low watermark pages. While the maximal high (pcp->high_max) is the PCP high value when percpu_pagelist_high_fraction sysctl knob is set to MIN_PERCPU_PAGELIST_HIGH_FRACTION. That is, the maximal pcp->high that can be set via sysctl knob by hand. It's possible that PCP high auto-tuning doesn't work well for some workloads. So, when PCP high is tuned by hand via the sysctl knob, the auto-tuning will be disabled. The PCP high set by hand will be used instead. This patch only adds the framework, so pcp->high will be set to pcp->high_min (original default) always. We will add actual auto-tuning algorithm in the following patches in the series. Link: https://lkml.kernel.org/r/20231016053002.756205-7-ying.huang@intel.com Signed-off-by: "Huang, Ying" Acked-by: Mel Gorman Cc: Vlastimil Babka Cc: David Hildenbrand Cc: Johannes Weiner Cc: Dave Hansen Cc: Michal Hocko Cc: Pavel Tatashin Cc: Matthew Wilcox Cc: Christoph Lameter Cc: Arjan van de Ven Cc: Sudeep Holla Signed-off-by: Andrew Morton commit c0a242394cb980bd00e1f61dc8aacb453d2bbe6a Author: Huang Ying Date: Mon Oct 16 13:29:58 2023 +0800 mm, page_alloc: scale the number of pages that are batch allocated When a task is allocating a large number of order-0 pages, it may acquire the zone->lock multiple times allocating pages in batches. This may unnecessarily contend on the zone lock when allocating very large number of pages. This patch adapts the size of the batch based on the recent pattern to scale the batch size for subsequent allocations. On a 2-socket Intel server with 224 logical CPU, we run 8 kbuild instances in parallel (each with `make -j 28`) in 8 cgroup. This simulates the kbuild server that is used by 0-Day kbuild service. With the patch, the cycles% of the spinlock contention (mostly for zone lock) decreases from 12.6% to 11.0% (with PCP size == 367). Link: https://lkml.kernel.org/r/20231016053002.756205-6-ying.huang@intel.com Signed-off-by: "Huang, Ying" Suggested-by: Mel Gorman Acked-by: Mel Gorman Cc: Vlastimil Babka Cc: David Hildenbrand Cc: Johannes Weiner Cc: Dave Hansen Cc: Michal Hocko Cc: Pavel Tatashin Cc: Matthew Wilcox Cc: Christoph Lameter Cc: Arjan van de Ven Cc: Sudeep Holla Signed-off-by: Andrew Morton commit 52166607ecc980391b1fffbce0be3074a96d0c7b Author: Huang Ying Date: Mon Oct 16 13:29:57 2023 +0800 mm: restrict the pcp batch scale factor to avoid too long latency In page allocator, PCP (Per-CPU Pageset) is refilled and drained in batches to increase page allocation throughput, reduce page allocation/freeing latency per page, and reduce zone lock contention. But too large batch size will cause too long maximal allocation/freeing latency, which may punish arbitrary users. So the default batch size is chosen carefully (in zone_batchsize(), the value is 63 for zone > 1GB) to avoid that. In commit 3b12e7e97938 ("mm/page_alloc: scale the number of pages that are batch freed"), the batch size will be scaled for large number of page freeing to improve page freeing performance and reduce zone lock contention. Similar optimization can be used for large number of pages allocation too. To find out a suitable max batch scale factor (that is, max effective batch size), some tests and measurement on some machines were done as follows. A set of debug patches are implemented as follows, - Set PCP high to be 2 * batch to reduce the effect of PCP high - Disable free batch size scaling to get the raw performance. - The code with zone lock held is extracted from rmqueue_bulk() and free_pcppages_bulk() to 2 separate functions to make it easy to measure the function run time with ftrace function_graph tracer. - The batch size is hard coded to be 63 (default), 127, 255, 511, 1023, 2047, 4095. Then will-it-scale/page_fault1 is used to generate the page allocation/freeing workload. The page allocation/freeing throughput (page/s) is measured via will-it-scale. The page allocation/freeing average latency (alloc/free latency avg, in us) and allocation/freeing latency at 99 percentile (alloc/free latency 99%, in us) are measured with ftrace function_graph tracer. The test results are as follows, Sapphire Rapids Server ====================== Batch throughput free latency free latency alloc latency alloc latency page/s avg / us 99% / us avg / us 99% / us ----- ---------- ------------ ------------ ------------- ------------- 63 513633.4 2.33 3.57 2.67 6.83 127 517616.7 4.35 6.65 4.22 13.03 255 520822.8 8.29 13.32 7.52 25.24 511 524122.0 15.79 23.42 14.02 49.35 1023 525980.5 30.25 44.19 25.36 94.88 2047 526793.6 59.39 84.50 45.22 140.81 Ice Lake Server =============== Batch throughput free latency free latency alloc latency alloc latency page/s avg / us 99% / us avg / us 99% / us ----- ---------- ------------ ------------ ------------- ------------- 63 620210.3 2.21 3.68 2.02 4.35 127 627003.0 4.09 6.86 3.51 8.28 255 630777.5 7.70 13.50 6.17 15.97 511 633651.5 14.85 22.62 11.66 31.08 1023 637071.1 28.55 42.02 20.81 54.36 2047 638089.7 56.54 84.06 39.28 91.68 Cascade Lake Server =================== Batch throughput free latency free latency alloc latency alloc latency page/s avg / us 99% / us avg / us 99% / us ----- ---------- ------------ ------------ ------------- ------------- 63 404706.7 3.29 5.03 3.53 4.75 127 422475.2 6.12 9.09 6.36 8.76 255 411522.2 11.68 16.97 10.90 16.39 511 428124.1 22.54 31.28 19.86 32.25 1023 414718.4 43.39 62.52 40.00 66.33 2047 429848.7 86.64 120.34 71.14 106.08 Commet Lake Desktop =================== Batch throughput free latency free latency alloc latency alloc latency page/s avg / us 99% / us avg / us 99% / us ----- ---------- ------------ ------------ ------------- ------------- 63 795183.13 2.18 3.55 2.03 3.05 127 803067.85 3.91 6.56 3.85 5.52 255 812771.10 7.35 10.80 7.14 10.20 511 817723.48 14.17 27.54 13.43 30.31 1023 818870.19 27.72 40.10 27.89 46.28 Coffee Lake Desktop =================== Batch throughput free latency free latency alloc latency alloc latency page/s avg / us 99% / us avg / us 99% / us ----- ---------- ------------ ------------ ------------- ------------- 63 510542.8 3.13 4.40 2.48 3.43 127 514288.6 5.97 7.89 4.65 6.04 255 516889.7 11.86 15.58 8.96 12.55 511 519802.4 23.10 28.81 16.95 26.19 1023 520802.7 45.30 52.51 33.19 45.95 2047 519997.1 90.63 104.00 65.26 81.74 From the above data, to restrict the allocation/freeing latency to be less than 100 us in most times, the max batch scale factor needs to be less than or equal to 5. Although it is reasonable to use 5 as max batch scale factor for the systems tested, there are also slower systems. Where smaller value should be used to constrain the page allocation/freeing latency. So, in this patch, a new kconfig option (PCP_BATCH_SCALE_MAX) is added to set the max batch scale factor. Whose default value is 5, and users can reduce it when necessary. Link: https://lkml.kernel.org/r/20231016053002.756205-5-ying.huang@intel.com Signed-off-by: "Huang, Ying" Acked-by: Andrew Morton Acked-by: Mel Gorman Cc: Vlastimil Babka Cc: David Hildenbrand Cc: Johannes Weiner Cc: Dave Hansen Cc: Michal Hocko Cc: Pavel Tatashin Cc: Matthew Wilcox Cc: Christoph Lameter Cc: Arjan van de Ven Cc: Sudeep Holla Signed-off-by: Andrew Morton commit 362d37a106dd3f6431b2fdd91d9208b0d023b50d Author: Huang Ying Date: Mon Oct 16 13:29:56 2023 +0800 mm, pcp: reduce lock contention for draining high-order pages In commit f26b3fa04611 ("mm/page_alloc: limit number of high-order pages on PCP during bulk free"), the PCP (Per-CPU Pageset) will be drained when PCP is mostly used for high-order pages freeing to improve the cache-hot pages reusing between page allocating and freeing CPUs. On system with small per-CPU data cache slice, pages shouldn't be cached before draining to guarantee cache-hot. But on a system with large per-CPU data cache slice, some pages can be cached before draining to reduce zone lock contention. So, in this patch, instead of draining without any caching, "pcp->batch" pages will be cached in PCP before draining if the size of the per-CPU data cache slice is more than "3 * batch". In theory, if the size of per-CPU data cache slice is more than "2 * batch", we can reuse cache-hot pages between CPUs. But considering the other usage of cache (code, other data accessing, etc.), "3 * batch" is used. Note: "3 * batch" is chosen to make sure the optimization works on recent x86_64 server CPUs. If you want to increase it, please check whether it breaks the optimization. On a 2-socket Intel server with 128 logical CPU, with the patch, the network bandwidth of the UNIX (AF_UNIX) test case of lmbench test suite with 16-pair processes increase 70.5%. The cycles% of the spinlock contention (mostly for zone lock) decreases from 46.1% to 21.3%. The number of PCP draining for high order pages freeing (free_high) decreases 89.9%. The cache miss rate keeps 0.2%. Link: https://lkml.kernel.org/r/20231016053002.756205-4-ying.huang@intel.com Signed-off-by: "Huang, Ying" Acked-by: Mel Gorman Cc: Sudeep Holla Cc: Vlastimil Babka Cc: David Hildenbrand Cc: Johannes Weiner Cc: Dave Hansen Cc: Michal Hocko Cc: Pavel Tatashin Cc: Matthew Wilcox Cc: Christoph Lameter Cc: Arjan van de Ven Signed-off-by: Andrew Morton commit 94a3bfe4073cd88b05f7fb201ea7bf9dfa2cf5d5 Author: Huang Ying Date: Mon Oct 16 13:29:55 2023 +0800 cacheinfo: calculate size of per-CPU data cache slice This can be used to estimate the size of the data cache slice that can be used by one CPU under ideal circumstances. Both DATA caches and UNIFIED caches are used in calculation. So, the users need to consider the impact of the code cache usage. Because the cache inclusive/non-inclusive information isn't available now, we just use the size of the per-CPU slice of LLC to make the result more predictable across architectures. This may be improved when more cache information is available in the future. A brute-force algorithm to iterate all online CPUs is used to avoid to allocate an extra cpumask, especially in offline callback. Link: https://lkml.kernel.org/r/20231016053002.756205-3-ying.huang@intel.com Signed-off-by: "Huang, Ying" Acked-by: Mel Gorman Cc: Sudeep Holla Cc: Vlastimil Babka Cc: David Hildenbrand Cc: Johannes Weiner Cc: Dave Hansen Cc: Michal Hocko Cc: Pavel Tatashin Cc: Matthew Wilcox Cc: Christoph Lameter Cc: Arjan van de Ven Signed-off-by: Andrew Morton commit ca71fe1ad9221a89c6a25f49159c600d9e598ae1 Author: Huang Ying Date: Mon Oct 16 13:29:54 2023 +0800 mm, pcp: avoid to drain PCP when process exit Patch series "mm: PCP high auto-tuning", v3. The page allocation performance requirements of different workloads are often different. So, we need to tune the PCP (Per-CPU Pageset) high on each CPU automatically to optimize the page allocation performance. The list of patches in series is as follows, [1/9] mm, pcp: avoid to drain PCP when process exit [2/9] cacheinfo: calculate per-CPU data cache size [3/9] mm, pcp: reduce lock contention for draining high-order pages [4/9] mm: restrict the pcp batch scale factor to avoid too long latency [5/9] mm, page_alloc: scale the number of pages that are batch allocated [6/9] mm: add framework for PCP high auto-tuning [7/9] mm: tune PCP high automatically [8/9] mm, pcp: decrease PCP high if free pages < high watermark [9/9] mm, pcp: reduce detecting time of consecutive high order page freeing Patch [1/9], [2/9], [3/9] optimize the PCP draining for consecutive high-order pages freeing. Patch [4/9], [5/9] optimize batch freeing and allocating. Patch [6/9], [7/9], [8/9] implement and optimize a PCP high auto-tuning method. Patch [9/9] optimize the PCP draining for consecutive high order page freeing based on PCP high auto-tuning. The test results for patches with performance impact are as follows, kbuild ====== On a 2-socket Intel server with 224 logical CPU, we run 8 kbuild instances in parallel (each with `make -j 28`) in 8 cgroup. This simulates the kbuild server that is used by 0-Day kbuild service. build time lock contend% free_high alloc_zone ---------- ---------- --------- ---------- base 100.0 14.0 100.0 100.0 patch1 99.5 12.8 19.5 95.6 patch3 99.4 12.6 7.1 95.6 patch5 98.6 11.0 8.1 97.1 patch7 95.1 0.5 2.8 15.6 patch9 95.0 1.0 8.8 20.0 The PCP draining optimization (patch [1/9], [3/9]) and PCP batch allocation optimization (patch [5/9]) reduces zone lock contention a little. The PCP high auto-tuning (patch [7/9], [9/9]) reduces build time visibly. Where the tuning target: the number of pages allocated from zone reduces greatly. So, the zone contention cycles% reduces greatly. With PCP tuning patches (patch [7/9], [9/9]), the average used memory during test increases up to 18.4% because more pages are cached in PCP. But at the end of the test, the number of the used memory decreases to the same level as that of the base patch. That is, the pages cached in PCP will be released to zone after not being used actively. netperf SCTP_STREAM_MANY ======================== On a 2-socket Intel server with 128 logical CPU, we tested SCTP_STREAM_MANY test case of netperf test suite with 64-pair processes. score lock contend% free_high alloc_zone cache miss rate% ----- ---------- --------- ---------- ---------------- base 100.0 2.1 100.0 100.0 1.3 patch1 99.4 2.1 99.4 99.4 1.3 patch3 106.4 1.3 13.3 106.3 1.3 patch5 106.0 1.2 13.2 105.9 1.3 patch7 103.4 1.9 6.7 90.3 7.6 patch9 108.6 1.3 13.7 108.6 1.3 The PCP draining optimization (patch [1/9]+[3/9]) improves performance. The PCP high auto-tuning (patch [7/9]) reduces performance a little because PCP draining cannot be triggered in time sometimes. So, the cache miss rate% increases. The further PCP draining optimization (patch [9/9]) based on PCP tuning restore the performance. lmbench3 UNIX (AF_UNIX) ======================= On a 2-socket Intel server with 128 logical CPU, we tested UNIX (AF_UNIX socket) test case of lmbench3 test suite with 16-pair processes. score lock contend% free_high alloc_zone cache miss rate% ----- ---------- --------- ---------- ---------------- base 100.0 51.4 100.0 100.0 0.2 patch1 116.8 46.1 69.5 104.3 0.2 patch3 199.1 21.3 7.0 104.9 0.2 patch5 200.0 20.8 7.1 106.9 0.3 patch7 191.6 19.9 6.8 103.8 2.8 patch9 193.4 21.7 7.0 104.7 2.1 The PCP draining optimization (patch [1/9], [3/9]) improves performance much. The PCP tuning (patch [7/9]) reduces performance a little because PCP draining cannot be triggered in time sometimes. The further PCP draining optimization (patch [9/9]) based on PCP tuning restores the performance partly. The patchset adds several fields in struct per_cpu_pages. The struct layout before/after the patchset is as follows, base ==== struct per_cpu_pages { spinlock_t lock; /* 0 4 */ int count; /* 4 4 */ int high; /* 8 4 */ int batch; /* 12 4 */ short int free_factor; /* 16 2 */ short int expire; /* 18 2 */ /* XXX 4 bytes hole, try to pack */ struct list_head lists[13]; /* 24 208 */ /* size: 256, cachelines: 4, members: 7 */ /* sum members: 228, holes: 1, sum holes: 4 */ /* padding: 24 */ } __attribute__((__aligned__(64))); patched ======= struct per_cpu_pages { spinlock_t lock; /* 0 4 */ int count; /* 4 4 */ int high; /* 8 4 */ int high_min; /* 12 4 */ int high_max; /* 16 4 */ int batch; /* 20 4 */ u8 flags; /* 24 1 */ u8 alloc_factor; /* 25 1 */ u8 expire; /* 26 1 */ /* XXX 1 byte hole, try to pack */ short int free_count; /* 28 2 */ /* XXX 2 bytes hole, try to pack */ struct list_head lists[13]; /* 32 208 */ /* size: 256, cachelines: 4, members: 11 */ /* sum members: 237, holes: 2, sum holes: 3 */ /* padding: 16 */ } __attribute__((__aligned__(64))); The size of the struct doesn't changed with the patchset. This patch (of 9): In commit f26b3fa04611 ("mm/page_alloc: limit number of high-order pages on PCP during bulk free"), the PCP (Per-CPU Pageset) will be drained when PCP is mostly used for high-order pages freeing to improve the cache-hot pages reusing between page allocation and freeing CPUs. But, the PCP draining mechanism may be triggered unexpectedly when process exits. With some customized trace point, it was found that PCP draining (free_high == true) was triggered with the order-1 page freeing with the following call stack, => free_unref_page_commit => free_unref_page => __mmdrop => exit_mm => do_exit => do_group_exit => __x64_sys_exit_group => do_syscall_64 Checking the source code, this is the page table PGD freeing (mm_free_pgd()). It's a order-1 page freeing if CONFIG_PAGE_TABLE_ISOLATION=y. Which is a common configuration for security. Just before that, page freeing with the following call stack was found, => free_unref_page_commit => free_unref_page_list => release_pages => tlb_batch_pages_flush => tlb_finish_mmu => exit_mmap => __mmput => exit_mm => do_exit => do_group_exit => __x64_sys_exit_group => do_syscall_64 So, when a process exits, - a large number of user pages of the process will be freed without page allocation, it's highly possible that pcp->free_factor becomes > 0. In fact, this is expected behavior to improve process exit performance. - after freeing all user pages, the PGD will be freed, which is a order-1 page freeing, PCP will be drained. All in all, when a process exits, it's high possible that the PCP will be drained. This is an unexpected behavior. To avoid this, in the patch, the PCP draining will only be triggered for 2 consecutive high-order page freeing. On a 2-socket Intel server with 224 logical CPU, we run 8 kbuild instances in parallel (each with `make -j 28`) in 8 cgroup. This simulates the kbuild server that is used by 0-Day kbuild service. With the patch, the cycles% of the spinlock contention (mostly for zone lock) decreases from 14.0% to 12.8% (with PCP size == 367). The number of PCP draining for high order pages freeing (free_high) decreases 80.5%. This helps network workload too for reduced zone lock contention. On a 2-socket Intel server with 128 logical CPU, with the patch, the network bandwidth of the UNIX (AF_UNIX) test case of lmbench test suite with 16-pair processes increase 16.8%. The cycles% of the spinlock contention (mostly for zone lock) decreases from 51.4% to 46.1%. The number of PCP draining for high order pages freeing (free_high) decreases 30.5%. The cache miss rate keeps 0.2%. Link: https://lkml.kernel.org/r/20231016053002.756205-1-ying.huang@intel.com Link: https://lkml.kernel.org/r/20231016053002.756205-2-ying.huang@intel.com Signed-off-by: "Huang, Ying" Acked-by: Mel Gorman Cc: Vlastimil Babka Cc: David Hildenbrand Cc: Johannes Weiner Cc: Dave Hansen Cc: Michal Hocko Cc: Pavel Tatashin Cc: Matthew Wilcox Cc: Christoph Lameter Cc: Arjan van de Ven Cc: Sudeep Holla Signed-off-by: Andrew Morton commit 1f4f7f0f8845dbac40289cc3d50b81314c5a12b8 Author: Kairui Song Date: Mon Oct 16 19:31:03 2023 +0800 mm/oom_killer: simplify OOM killer info dump helper There is only one caller wants to dump the kill victim info, so just let it call the standalone helper, no need to make the generic info dump helper take an extra argument for that. Result of bloat-o-meter: ./scripts/bloat-o-meter ./mm/oom_kill.old.o ./mm/oom_kill.o add/remove: 0/0 grow/shrink: 1/2 up/down: 131/-142 (-11) Function old new delta oom_kill_process 412 543 +131 out_of_memory 1422 1418 -4 dump_header 562 424 -138 Total: Before=21514, After=21503, chg -0.05% Link: https://lkml.kernel.org/r/20231016113103.86477-1-ryncsn@gmail.com Signed-off-by: Kairui Song Acked-by: Michal Hocko Cc: Christian Brauner Cc: Suren Baghdasaryan Signed-off-by: Andrew Morton commit 09aec5f9b2505c73a9380800f61ad920cc64a7cd Author: Pedro Falcato Date: Mon Oct 16 16:34:46 2023 +0100 mm: kmsan: panic on failure to allocate early boot metadata Given large enough allocations and a machine with low enough memory (i.e a default QEMU VM), it's entirely possible that kmsan_init_alloc_meta_for_range's shadow+origin allocation fails. Instead of eating a NULL deref kernel oops, check explicitly for memblock_alloc() failure and panic with a nice error message. Alexander Potapenko said: For posterity, it is generally quite important for the allocated shadow and origin to be contiguous, otherwise an unaligned memory write may result in memory corruption (the corresponding unaligned shadow write will be assuming that shadow pages are adjacent). So instead of panicking we could have split the range into smaller ones until the allocation succeeds, but that would've led to hard-to-debug problems in the future. Link: https://lkml.kernel.org/r/20231016153446.132763-1-pedro.falcato@gmail.com Signed-off-by: Pedro Falcato Reviewed-by: Alexander Potapenko Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton commit 0a88810d9b76e6ecfd234f5728e27344a39e3ff8 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:14 2023 +0100 buffer: remove folio_create_empty_buffers() With all users converted, remove the old create_empty_buffers() and rename folio_create_empty_buffers() to create_empty_buffers(). Link: https://lkml.kernel.org/r/20231016201114.1928083-28-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit c9f2480ed7b221baf738edf431757e5ca4115bca Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:13 2023 +0100 ufs: remove ufs_get_locked_page() Both callers are now converted to ufs_get_locked_folio(). Link: https://lkml.kernel.org/r/20231016201114.1928083-27-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit c7e8812ce5cfcb16c69faa86d38b36ddd3141ba9 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:12 2023 +0100 ufs: convert ufs_change_blocknr() to use folios Convert the locked_page argument to a folio, then use folios throughout. Saves three hidden calls to compound_head(). Link: https://lkml.kernel.org/r/20231016201114.1928083-26-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit e7ca7f1725b3b0b276dd7c5119326b5e098abb53 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:11 2023 +0100 ufs: use ufs_get_locked_folio() in ufs_alloc_lastblock() Switch to the folio APIs, saving one folio->page->folio conversion. Link: https://lkml.kernel.org/r/20231016201114.1928083-25-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 5fb7bd50b3516a9d5fea5775e7ebd43f0c96bb3d Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:10 2023 +0100 ufs: add ufs_get_locked_folio and ufs_put_locked_folio Convert the _page variants to call them. Saves a few hidden calls to compound_head(). Link: https://lkml.kernel.org/r/20231016201114.1928083-24-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 44f68575267ecfc439d11bb782c69ba2598b3ed0 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:09 2023 +0100 reiserfs: convert writepage to use a folio Convert the incoming page to a folio and then use it throughout the writeback path. This definitely isn't enough to support large folios, but I don't expect reiserfs to gain support for those before it is removed. Link: https://lkml.kernel.org/r/20231016201114.1928083-23-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 414ae0a440333143dcac39faaef00f098cceeff5 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:08 2023 +0100 ocfs2: convert ocfs2_map_page_blocks to use a folio Convert the page argument to a folio and then use the folio APIs throughout. Replaces three hidden calls to compound_head() with one explicit one. Link: https://lkml.kernel.org/r/20231016201114.1928083-22-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit c3f4200ac61ae98ea29d28519ea5076c04f22e06 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:07 2023 +0100 ntfs3: convert ntfs_zero_range() to use a folio Use the folio API throughout, saving six hidden calls to compound_head(). Link: https://lkml.kernel.org/r/20231016201114.1928083-21-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 24a7b35285c5514393e7ed46407111c68f4602ba Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:06 2023 +0100 ntfs: convert ntfs_prepare_pages_for_non_resident_write() to folios Convert each element of the pages array to a folio before using it. This in no way renders the function large-folio safe, but it does remove a lot of hidden calls to compound_head(). Link: https://lkml.kernel.org/r/20231016201114.1928083-20-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit a04eb7cb186b4d537eefc2d68dba8a7e5eb7e6d7 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:05 2023 +0100 ntfs: convert ntfs_writepage to use a folio Use folio APIs throughout. Saves many hidden calls to compound_head(). Link: https://lkml.kernel.org/r/20231016201114.1928083-19-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit a2da3afce96ce747ec0e1670bfc73fec85d20f95 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:04 2023 +0100 ntfs: convert ntfs_read_block() to use a folio The caller already has the folio, so pass it in and use the folio API throughout saving five hidden calls to compound_head(). Link: https://lkml.kernel.org/r/20231016201114.1928083-18-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 922b12eff0b293fc13ae4045c7d7264e18938878 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:03 2023 +0100 nilfs2: convert nilfs_lookup_dirty_data_buffers to use folio_create_empty_buffers This function was already using a folio, so this update to the new API removes a single folio->page->folio conversion. Link: https://lkml.kernel.org/r/20231016201114.1928083-17-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Ryusuke Konishi Cc: Andreas Gruenbacher Cc: Pankaj Raghav Signed-off-by: Andrew Morton commit 73c32e07a3977f8470b29889d30d2f808e6fee4a Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:02 2023 +0100 nilfs2: remove nilfs_page_get_nth_block All users have now been converted to get_nth_block(). Link: https://lkml.kernel.org/r/20231016201114.1928083-16-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Ryusuke Konishi Cc: Andreas Gruenbacher Cc: Pankaj Raghav Signed-off-by: Andrew Morton commit 664c87b75ef6ec3ebb97383891a6787b63925547 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:01 2023 +0100 nilfs2: convert nilfs_mdt_get_frozen_buffer to use a folio Remove a number of folio->page->folio conversions. Link: https://lkml.kernel.org/r/20231016201114.1928083-15-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Ryusuke Konishi Cc: Andreas Gruenbacher Cc: Pankaj Raghav Signed-off-by: Andrew Morton commit 1a846bf3884694b2f9ecbd70011927c2fb40f224 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:11:00 2023 +0100 nilfs2: convert nilfs_mdt_forget_block() to use a folio Remove a number of folio->page->folio conversions. Link: https://lkml.kernel.org/r/20231016201114.1928083-14-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Ryusuke Konishi Cc: Andreas Gruenbacher Cc: Pankaj Raghav Signed-off-by: Andrew Morton commit 4093602d6bbb2c82b922d1b442a022a069cdb59e Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:10:59 2023 +0100 nilfs2: convert nilfs_copy_page() to nilfs_copy_folio() Both callers already have a folio, so pass it in and use it directly. Removes a lot of hidden calls to compound_head(). Link: https://lkml.kernel.org/r/20231016201114.1928083-13-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Ryusuke Konishi Cc: Andreas Gruenbacher Cc: Pankaj Raghav Signed-off-by: Andrew Morton commit c5521c7689b892c8ea684a284722b5584ba1ce8f Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:10:58 2023 +0100 nilfs2: convert nilfs_grab_buffer() to use a folio Remove a number of folio->page->folio conversions. Link: https://lkml.kernel.org/r/20231016201114.1928083-12-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Ryusuke Konishi Cc: Andreas Gruenbacher Cc: Pankaj Raghav Signed-off-by: Andrew Morton commit 6c346be91dcf2b588510e41e4e04c0638af3d536 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:10:57 2023 +0100 nilfs2: convert nilfs_mdt_freeze_buffer to use a folio Remove a number of folio->page->folio conversions. Link: https://lkml.kernel.org/r/20231016201114.1928083-11-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Ryusuke Konishi Cc: Andreas Gruenbacher Cc: Pankaj Raghav Signed-off-by: Andrew Morton commit 4064a0aa8a6a341b14fb9ee8cf0f0bb86c575e3b Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:10:56 2023 +0100 gfs2: convert gfs2_write_buf_to_page() to use a folio Remove several folio->page->folio conversions. Link: https://lkml.kernel.org/r/20231016201114.1928083-10-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit c646e573729bfe885280c343203c775f1f5d71c2 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:10:55 2023 +0100 gfs2: convert gfs2_getjdatabuf to use a folio Use the folio APIs, saving four hidden calls to compound_head(). Link: https://lkml.kernel.org/r/20231016201114.1928083-9-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 0eb751791df86dc05a87fff1ada8d37044267a7e Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:10:54 2023 +0100 gfs2: convert gfs2_getbuf() to folios Remove several folio->page->folio conversions. Also use __GFP_NOFAIL instead of calling yield() and the new get_nth_bh(). Link: https://lkml.kernel.org/r/20231016201114.1928083-8-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 81cb277ebdfd73b4b4cbfcdf377b4b514e90520a Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:10:53 2023 +0100 gfs2: convert inode unstuffing to use a folio Use the folio APIs, removing numerous hidden calls to compound_head(). Also remove the stale comment about the page being looked up if it's NULL. Link: https://lkml.kernel.org/r/20231016201114.1928083-7-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Andreas Gruenbacher Cc: Pankaj Raghav Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 0217fbb0271a7c78e16629cf45375916ec2eb35f Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:10:52 2023 +0100 buffer: add get_nth_bh() Extract this useful helper from nilfs_page_get_nth_block() Link: https://lkml.kernel.org/r/20231016201114.1928083-6-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Ryusuke Konishi Cc: Andreas Gruenbacher Cc: Pankaj Raghav Signed-off-by: Andrew Morton commit d4059993674b533798a551859042957bb5578332 Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:10:51 2023 +0100 ext4: convert to folio_create_empty_buffers Remove an unnecessary folio->page->folio conversion and take advantage of the new return value from folio_create_empty_buffers(). Link: https://lkml.kernel.org/r/20231016201114.1928083-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Pankaj Raghav Cc: Andreas Gruenbacher Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 4f05f139e3f8938c4c456bd886355c9bbcc3190d Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:10:50 2023 +0100 mpage: convert map_buffer_to_folio() to folio_create_empty_buffers() Saves a folio->page->folio conversion. Link: https://lkml.kernel.org/r/20231016201114.1928083-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Pankaj Raghav Cc: Andreas Gruenbacher Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit 3decb8564eff88a2533f83b01cec2cf9259c3eaf Author: Matthew Wilcox (Oracle) Date: Mon Oct 16 21:10:49 2023 +0100 buffer: make folio_create_empty_buffers() return a buffer_head Patch series "Finish the create_empty_buffers() transition", v2. Pankaj recently added folio_create_empty_buffers() as the folio equivalent to create_empty_buffers(). This patch set finishes the conversion by first converting all remaining filesystems to call folio_create_empty_buffers(), then renaming it back to create_empty_buffers(). I took the opportunity to make a few simplifications like making folio_create_empty_buffers() return the head buffer and extracting get_nth_bh() from nilfs2. A few of the patches in this series aren't directly related to create_empty_buffers(), but I saw them while I was working on this and thought they'd be easy enough to add to this series. Compile-tested only, other than ext4. This patch (of 26): Almost all callers want to know the first BH that was allocated for this folio. We already have that handy, so return it. Link: https://lkml.kernel.org/r/20231016201114.1928083-1-willy@infradead.org Link: https://lkml.kernel.org/r/20231016201114.1928083-3-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Pankaj Raghav Cc: Andreas Gruenbacher Cc: Ryusuke Konishi Signed-off-by: Andrew Morton commit c5ad3233ead566d74918bd76ba2dbdbe83ba1d9d Author: Usama Arif Date: Wed Oct 11 15:45:57 2023 +0100 hugetlb_vmemmap: use folio argument for hugetlb_vmemmap_* functions Most function calls in hugetlb.c are made with folio arguments. This brings hugetlb_vmemmap calls inline with them by using folio instead of head struct page. Head struct page is still needed within these functions. The set/clear/test functions for hugepages are also changed to folio versions. Link: https://lkml.kernel.org/r/20231011144557.1720481-2-usama.arif@bytedance.com Signed-off-by: Usama Arif Reviewed-by: Muchun Song Cc: Fam Zheng Cc: Mike Kravetz Cc: Punit Agrawal Signed-off-by: Andrew Morton commit c24f188b22892908a2a3bb2de0ce7d121dd72989 Author: Mike Kravetz Date: Wed Oct 18 19:31:10 2023 -0700 hugetlb: batch TLB flushes when restoring vmemmap Update the internal hugetlb restore vmemmap code path such that TLB flushing can be batched. Use the existing mechanism of passing the VMEMMAP_REMAP_NO_TLB_FLUSH flag to indicate flushing should not be performed for individual pages. The routine hugetlb_vmemmap_restore_folios is the only user of this new mechanism, and it will perform a global flush after all vmemmap is restored. Link: https://lkml.kernel.org/r/20231019023113.345257-9-mike.kravetz@oracle.com Signed-off-by: Joao Martins Signed-off-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Anshuman Khandual Cc: Barry Song <21cnbao@gmail.com> Cc: David Hildenbrand Cc: David Rientjes Cc: James Houghton Cc: Konrad Dybcio Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Michal Hocko Cc: Naoya Horiguchi Cc: Oscar Salvador Cc: Sergey Senozhatsky Cc: Usama Arif Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit f13b83fdd996409e3dbf6f34c7629a9d13fdb9c1 Author: Joao Martins Date: Wed Oct 18 19:31:09 2023 -0700 hugetlb: batch TLB flushes when freeing vmemmap Now that a list of pages is deduplicated at once, the TLB flush can be batched for all vmemmap pages that got remapped. Expand the flags field value to pass whether to skip the TLB flush on remap of the PTE. The TLB flush is global as we don't have guarantees from caller that the set of folios is contiguous, or to add complexity in composing a list of kVAs to flush. Modified by Mike Kravetz to perform TLB flush on single folio if an error is encountered. Link: https://lkml.kernel.org/r/20231019023113.345257-8-mike.kravetz@oracle.com Signed-off-by: Joao Martins Signed-off-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Anshuman Khandual Cc: Barry Song <21cnbao@gmail.com> Cc: David Hildenbrand Cc: David Rientjes Cc: James Houghton Cc: Konrad Dybcio Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Michal Hocko Cc: Naoya Horiguchi Cc: Oscar Salvador Cc: Sergey Senozhatsky Cc: Usama Arif Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit f4b7e3efaddbf8fa7cffacb5956b0823b7a7730a Author: Joao Martins Date: Wed Oct 18 19:31:08 2023 -0700 hugetlb: batch PMD split for bulk vmemmap dedup In an effort to minimize amount of TLB flushes, batch all PMD splits belonging to a range of pages in order to perform only 1 (global) TLB flush. Add a flags field to the walker and pass whether it's a bulk allocation or just a single page to decide to remap. First value (VMEMMAP_SPLIT_NO_TLB_FLUSH) designates the request to not do the TLB flush when we split the PMD. Rebased and updated by Mike Kravetz Link: https://lkml.kernel.org/r/20231019023113.345257-7-mike.kravetz@oracle.com Signed-off-by: Joao Martins Signed-off-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Anshuman Khandual Cc: Barry Song <21cnbao@gmail.com> Cc: David Hildenbrand Cc: David Rientjes Cc: James Houghton Cc: Konrad Dybcio Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Michal Hocko Cc: Naoya Horiguchi Cc: Oscar Salvador Cc: Sergey Senozhatsky Cc: Usama Arif Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit 91f386bf0772c1976622bd0b119b78094603c3d0 Author: Mike Kravetz Date: Wed Oct 18 19:31:07 2023 -0700 hugetlb: batch freeing of vmemmap pages Now that batching of hugetlb vmemmap optimization processing is possible, batch the freeing of vmemmap pages. When freeing vmemmap pages for a hugetlb page, we add them to a list that is freed after the entire batch has been processed. This enhances the ability to return contiguous ranges of memory to the low level allocators. Link: https://lkml.kernel.org/r/20231019023113.345257-6-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Anshuman Khandual Cc: Barry Song <21cnbao@gmail.com> Cc: David Hildenbrand Cc: David Rientjes Cc: James Houghton Cc: Joao Martins Cc: Konrad Dybcio Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Michal Hocko Cc: Naoya Horiguchi Cc: Oscar Salvador Cc: Sergey Senozhatsky Cc: Usama Arif Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit cfb8c75099dbf152db1b075eead5029c5a30ce51 Author: Mike Kravetz Date: Wed Oct 18 19:31:06 2023 -0700 hugetlb: perform vmemmap restoration on a list of pages The routine update_and_free_pages_bulk already performs vmemmap restoration on the list of hugetlb pages in a separate step. In preparation for more functionality to be added in this step, create a new routine hugetlb_vmemmap_restore_folios() that will restore vmemmap for a list of folios. This new routine must provide sufficient feedback about errors and actual restoration performed so that update_and_free_pages_bulk can perform optimally. Special care must be taken when encountering an error from hugetlb_vmemmap_restore_folios. We want to continue making as much forward progress as possible. A new routine bulk_vmemmap_restore_error handles this specific situation. Link: https://lkml.kernel.org/r/20231019023113.345257-5-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Anshuman Khandual Cc: Barry Song <21cnbao@gmail.com> Cc: David Hildenbrand Cc: David Rientjes Cc: James Houghton Cc: Joao Martins Cc: Konrad Dybcio Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Michal Hocko Cc: Naoya Horiguchi Cc: Oscar Salvador Cc: Sergey Senozhatsky Cc: Usama Arif Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit 79359d6d24df2f304abbf6f137b01d2b76175ce3 Author: Mike Kravetz Date: Wed Oct 18 19:31:05 2023 -0700 hugetlb: perform vmemmap optimization on a list of pages When adding hugetlb pages to the pool, we first create a list of the allocated pages before adding to the pool. Pass this list of pages to a new routine hugetlb_vmemmap_optimize_folios() for vmemmap optimization. Due to significant differences in vmemmmap initialization for bootmem allocated hugetlb pages, a new routine prep_and_add_bootmem_folios is created. We also modify the routine vmemmap_should_optimize() to check for pages that are already optimized. There are code paths that might request vmemmap optimization twice and we want to make sure this is not attempted. Link: https://lkml.kernel.org/r/20231019023113.345257-4-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Anshuman Khandual Cc: Barry Song <21cnbao@gmail.com> Cc: David Hildenbrand Cc: David Rientjes Cc: James Houghton Cc: Joao Martins Cc: Konrad Dybcio Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Michal Hocko Cc: Naoya Horiguchi Cc: Oscar Salvador Cc: Sergey Senozhatsky Cc: Usama Arif Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit d67e32f26713c35669e343edfdce6fa97a7d6bbc Author: Mike Kravetz Date: Wed Oct 18 19:31:04 2023 -0700 hugetlb: restructure pool allocations Allocation of a hugetlb page for the hugetlb pool is done by the routine alloc_pool_huge_page. This routine will allocate contiguous pages from a low level allocator, prep the pages for usage as a hugetlb page and then add the resulting hugetlb page to the pool. In the 'prep' stage, optional vmemmap optimization is done. For performance reasons we want to perform vmemmap optimization on multiple hugetlb pages at once. To do this, restructure the hugetlb pool allocation code such that vmemmap optimization can be isolated and later batched. The code to allocate hugetlb pages from bootmem was also modified to allow batching. No functional changes, only code restructure. Link: https://lkml.kernel.org/r/20231019023113.345257-3-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Muchun Song Tested-by: Sergey Senozhatsky Cc: Anshuman Khandual Cc: Barry Song <21cnbao@gmail.com> Cc: David Hildenbrand Cc: David Rientjes Cc: James Houghton Cc: Joao Martins Cc: Konrad Dybcio Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Michal Hocko Cc: Naoya Horiguchi Cc: Oscar Salvador Cc: Usama Arif Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit d2cf88c27f51361dfe2982e510a444411d2fc78a Author: Mike Kravetz Date: Wed Oct 18 19:31:03 2023 -0700 hugetlb: optimize update_and_free_pages_bulk to avoid lock cycles Patch series "Batch hugetlb vmemmap modification operations", v8. When hugetlb vmemmap optimization was introduced, the overhead of enabling the option was measured as described in commit 426e5c429d16 [1]. The summary states that allocating a hugetlb page should be ~2x slower with optimization and freeing a hugetlb page should be ~2-3x slower. Such overhead was deemed an acceptable trade off for the memory savings obtained by freeing vmemmap pages. It was recently reported that the overhead associated with enabling vmemmap optimization could be as high as 190x for hugetlb page allocations. Yes, 190x! Some actual numbers from other environments are: Bare Metal 8 socket Intel(R) Xeon(R) CPU E7-8895 ------------------------------------------------ Unmodified next-20230824, vm.hugetlb_optimize_vmemmap = 0 time echo 500000 > .../hugepages-2048kB/nr_hugepages real 0m4.119s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m4.477s Unmodified next-20230824, vm.hugetlb_optimize_vmemmap = 1 time echo 500000 > .../hugepages-2048kB/nr_hugepages real 0m28.973s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m36.748s VM with 252 vcpus on host with 2 socket AMD EPYC 7J13 Milan ----------------------------------------------------------- Unmodified next-20230824, vm.hugetlb_optimize_vmemmap = 0 time echo 524288 > .../hugepages-2048kB/nr_hugepages real 0m2.463s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m2.931s Unmodified next-20230824, vm.hugetlb_optimize_vmemmap = 1 time echo 524288 > .../hugepages-2048kB/nr_hugepages real 2m27.609s time echo 0 > .../hugepages-2048kB/nr_hugepages real 2m29.924s In the VM environment, the slowdown of enabling hugetlb vmemmap optimization resulted in allocation times being 61x slower. A quick profile showed that the vast majority of this overhead was due to TLB flushing. Each time we modify the kernel pagetable we need to flush the TLB. For each hugetlb that is optimized, there could be potentially two TLB flushes performed. One for the vmemmap pages associated with the hugetlb page, and potentially another one if the vmemmap pages are mapped at the PMD level and must be split. The TLB flushes required for the kernel pagetable, result in a broadcast IPI with each CPU having to flush a range of pages, or do a global flush if a threshold is exceeded. So, the flush time increases with the number of CPUs. In addition, in virtual environments the broadcast IPI can’t be accelerated by hypervisor hardware and leads to traps that need to wakeup/IPI all vCPUs which is very expensive. Because of this the slowdown in virtual environments is even worse than bare metal as the number of vCPUS/CPUs is increased. The following series attempts to reduce amount of time spent in TLB flushing. The idea is to batch the vmemmap modification operations for multiple hugetlb pages. Instead of doing one or two TLB flushes for each page, we do two TLB flushes for each batch of pages. One flush after splitting pages mapped at the PMD level, and another after remapping vmemmap associated with all hugetlb pages. Results of such batching are as follows: Bare Metal 8 socket Intel(R) Xeon(R) CPU E7-8895 ------------------------------------------------ next-20230824 + Batching patches, vm.hugetlb_optimize_vmemmap = 0 time echo 500000 > .../hugepages-2048kB/nr_hugepages real 0m4.719s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m4.245s next-20230824 + Batching patches, vm.hugetlb_optimize_vmemmap = 1 time echo 500000 > .../hugepages-2048kB/nr_hugepages real 0m7.267s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m13.199s VM with 252 vcpus on host with 2 socket AMD EPYC 7J13 Milan ----------------------------------------------------------- next-20230824 + Batching patches, vm.hugetlb_optimize_vmemmap = 0 time echo 524288 > .../hugepages-2048kB/nr_hugepages real 0m2.715s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m3.186s next-20230824 + Batching patches, vm.hugetlb_optimize_vmemmap = 1 time echo 524288 > .../hugepages-2048kB/nr_hugepages real 0m4.799s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m5.273s With batching, results are back in the 2-3x slowdown range. This patch (of 8): update_and_free_pages_bulk is designed to free a list of hugetlb pages back to their associated lower level allocators. This may require allocating vmemmmap pages associated with each hugetlb page. The hugetlb page destructor must be changed before pages are freed to lower level allocators. However, the destructor must be changed under the hugetlb lock. This means there is potentially one lock cycle per page. Minimize the number of lock cycles in update_and_free_pages_bulk by: 1) allocating necessary vmemmap for all hugetlb pages on the list 2) take hugetlb lock and clear destructor for all pages on the list 3) free all pages on list back to low level allocators Link: https://lkml.kernel.org/r/20231019023113.345257-1-mike.kravetz@oracle.com Link: https://lkml.kernel.org/r/20231019023113.345257-2-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Muchun Song Acked-by: James Houghton Cc: Anshuman Khandual Cc: Barry Song <21cnbao@gmail.com> Cc: David Hildenbrand Cc: David Rientjes Cc: Joao Martins Cc: Konrad Dybcio Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Michal Hocko Cc: Naoya Horiguchi Cc: Oscar Salvador Cc: Sergey Senozhatsky Cc: Usama Arif Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit fa8c4f9a665bd0cf5a475327aea4fd179e896216 Author: Huang Ying Date: Fri Aug 11 17:08:19 2023 +0800 mm: fix draining remote pageset If there is no memory allocation/freeing in the PCP (Per-CPU Pageset) of a remote zone (zone in remote NUMA node) after some time (3 seconds for now), the pages of the PCP of the remote zone will be drained to avoid memory wastage. This behavior was introduced in the commit 4ae7c03943fc ("[PATCH] Periodically drain non local pagesets") and the commit 4037d452202e ("Move remote node draining out of slab allocators") But, after the commit 7cc36bbddde5 ("vmstat: on-demand vmstat workers V8"), the vmstat updater worker which is used to drain the PCP of remote zones may not be re-queued when we are waiting for the timeout (pcp->expire != 0) if there are no vmstat changes on this CPU, for example, when the CPU goes idle or runs user space only workloads. This may cause the pages of a remote zone be kept in PCP of this CPU for long time. So that, the page reclaiming of the remote zone may be triggered prematurely. This isn't a severe problem in practice, because the PCP of the remote zone will be drained if some memory are allocated/freed again on this CPU. And, the PCP will eventually be drained during the direct reclaiming if necessary. Anyway, the problem still deserves a fix via guaranteeing that the vmstat updater worker will always be re-queued when we are waiting for the timeout. In effect, this restores the original behavior before the commit 7cc36bbddde5. We can reproduce the bug via allocating/freeing pages from a remote zone then go idle as follows. And the patch can fix it. - Run some workloads, use `numactl` to bind CPU to node 0 and memory to node 1. So the PCP of the CPU on node 0 for zone on node 1 will be filled. - After workloads finish, idle for 60s - Check /proc/zoneinfo With the original kernel, the number of pages in the PCP of the CPU on node 0 for zone on node 1 is non-zero after idle. With the patched kernel, it becomes 0 after idle. That is, we avoid to keep pages in the remote PCP during idle. Link: https://lkml.kernel.org/r/20231007062356.187621-1-ying.huang@intel.com Link: https://lkml.kernel.org/r/20230811090819.60845-1-ying.huang@intel.com Fixes: 7cc36bbddde5 ("vmstat: on-demand vmstat workers V8") Signed-off-by: "Huang, Ying" Reviewed-by: Christoph Lameter Cc: Mel Gorman Cc: Vlastimil Babka Cc: Michal Hocko Signed-off-by: Andrew Morton commit 13cf36c648df0c7de6b74ca7163713d8fcae53e2 Author: Kai-Heng Feng Date: Fri May 12 08:00:12 2023 +0800 PCI/AER: Factor out interrupt toggling into helpers There are many places that enable and disable AER interrupt, so move them into helpers. Link: https://lore.kernel.org/r/20230512000014.118942-1-kai.heng.feng@canonical.com Signed-off-by: Kai-Heng Feng Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg Reviewed-by: Kuppuswamy Sathyanarayanan Reviewed-by: Jonathan Cameron commit 3779416eed25a843364b940decee452620a1de4b Author: Ian Rogers Date: Mon Sep 25 20:10:34 2023 -0700 perf vendor events intel: Fix broadwellde tma_info_system_dram_bw_use metric Broadwell-de has a consumer core and server uncore. The uncore_arb PMU isn't present and the broadwellx style cbox PMU should be used instead. Fix the tma_info_system_dram_bw_use metric to use the server metric rather than client. The associated converter script fix is in: https://github.com/intel/perfmon/pull/111 Fixes: 7d124303d620 ("perf vendor events intel: Update broadwell variant events/metrics") Signed-off-by: Ian Rogers Reviewed-by: Kan Liang Cc: Caleb Biggers Cc: Perry Taylor Link: https://lore.kernel.org/r/20230926031034.1201145-1-irogers@google.com Signed-off-by: Namhyung Kim commit 9b5c6281838fc84683dd99b47302d81fce399918 Author: Dominique Martinet Date: Wed Oct 25 19:34:44 2023 +0900 9p: v9fs_listxattr: fix %s null argument warning W=1 warns about null argument to kprintf: In file included from fs/9p/xattr.c:12: In function ‘v9fs_xattr_get’, inlined from ‘v9fs_listxattr’ at fs/9p/xattr.c:142:9: include/net/9p/9p.h:55:2: error: ‘%s’ directive argument is null [-Werror=format-overflow=] 55 | _p9_debug(level, __func__, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Use an empty string instead of : - this is ok 9p-wise because p9pdu_vwritef serializes a null string and an empty string the same way (one '0' word for length) - since this degrades the print statements, add new single quotes for xattr's name delimter (Old: "file = (null)", new: "file = ''") Link: https://lore.kernel.org/r/20231008060138.517057-1-suhui@nfschina.com Suggested-by: Su Hui Signed-off-by: Dominique Martinet Acked-by: Christian Schoenebeck Message-ID: <20231025103445.1248103-2-asmadeus@codewreck.org> commit 355f074609dbf3042900ea9d30fcd2b0c323a365 Author: Marco Elver Date: Wed Oct 25 19:34:43 2023 +0900 9p/trans_fd: Annotate data-racy writes to file::f_flags syzbot reported: | BUG: KCSAN: data-race in p9_fd_create / p9_fd_create | | read-write to 0xffff888130fb3d48 of 4 bytes by task 15599 on cpu 0: | p9_fd_open net/9p/trans_fd.c:842 [inline] | p9_fd_create+0x210/0x250 net/9p/trans_fd.c:1092 | p9_client_create+0x595/0xa70 net/9p/client.c:1010 | v9fs_session_init+0xf9/0xd90 fs/9p/v9fs.c:410 | v9fs_mount+0x69/0x630 fs/9p/vfs_super.c:123 | legacy_get_tree+0x74/0xd0 fs/fs_context.c:611 | vfs_get_tree+0x51/0x190 fs/super.c:1519 | do_new_mount+0x203/0x660 fs/namespace.c:3335 | path_mount+0x496/0xb30 fs/namespace.c:3662 | do_mount fs/namespace.c:3675 [inline] | __do_sys_mount fs/namespace.c:3884 [inline] | [...] | | read-write to 0xffff888130fb3d48 of 4 bytes by task 15563 on cpu 1: | p9_fd_open net/9p/trans_fd.c:842 [inline] | p9_fd_create+0x210/0x250 net/9p/trans_fd.c:1092 | p9_client_create+0x595/0xa70 net/9p/client.c:1010 | v9fs_session_init+0xf9/0xd90 fs/9p/v9fs.c:410 | v9fs_mount+0x69/0x630 fs/9p/vfs_super.c:123 | legacy_get_tree+0x74/0xd0 fs/fs_context.c:611 | vfs_get_tree+0x51/0x190 fs/super.c:1519 | do_new_mount+0x203/0x660 fs/namespace.c:3335 | path_mount+0x496/0xb30 fs/namespace.c:3662 | do_mount fs/namespace.c:3675 [inline] | __do_sys_mount fs/namespace.c:3884 [inline] | [...] | | value changed: 0x00008002 -> 0x00008802 Within p9_fd_open(), O_NONBLOCK is added to f_flags of the read and write files. This may happen concurrently if e.g. mounting process modifies the fd in another thread. Mark the plain read-modify-writes as intentional data-races, with the assumption that the result of executing the accesses concurrently will always result in the same result despite the accesses themselves not being atomic. Reported-by: syzbot+e441aeeb422763cc5511@syzkaller.appspotmail.com Signed-off-by: Marco Elver Link: https://lore.kernel.org/r/ZO38mqkS0TYUlpFp@elver.google.com Signed-off-by: Dominique Martinet Message-ID: <20231025103445.1248103-1-asmadeus@codewreck.org> commit d621a46d05107f4e510383d6a38f2160c62d28f7 Author: Guenter Roeck Date: Wed Oct 25 14:32:40 2023 -0700 Revert "hwmon: (sch56xx-common) Add automatic module loading on supported devices" This reverts commit 393935baa45e5ccb9603cf7f9f020ed1bc0915f7. As reported by Ian Nartowicz, this and the next patch result in a failure to load the driver on Celsius W280. While the alternative would be to add the board to the DMI override table, it is quite likely that other systems are also affected. Revert the offending patches to avoid future problems. Fixes: 393935baa45e ("hwmon: (sch56xx-common) Add automatic module loading on supported devices") Reported-by: Ian Nartowicz Closes: https://lore.kernel.org/linux-hwmon/20231025192239.3c5389ae@debian.org/T/#t Cc: Armin Wolf Signed-off-by: Guenter Roeck commit 28da9dee3594423534f3ea1e1f61e6bb2d2fa651 Author: Guenter Roeck Date: Wed Oct 25 14:28:49 2023 -0700 Revert "hwmon: (sch56xx-common) Add DMI override table" This reverts commit fd2d53c367ae9983c2100ac733a834e0c79d7537. As reported by Ian Nartowicz, this and the preceding patch result in a failure to load the driver on Celsius W280. While the alternative would be to add the board to the DMI override table, it is quite likely that other systems are also affected. Revert the offending patches to avoid future problems. Fixes: fd2d53c367ae ("hwmon: (sch56xx-common) Add DMI override table") Reported-by: Ian Nartowicz Closes: https://lore.kernel.org/linux-hwmon/20231025192239.3c5389ae@debian.org/T/#t Cc: Armin Wolf Signed-off-by: Guenter Roeck commit c505e1e4b10d751e93ca361d56d2270d6180a183 Merge: f652f84a9fbdc 2806a69f3fef6 Author: Arnd Bergmann Date: Wed Oct 25 23:11:54 2023 +0200 Merge tag 'v6.7-rockchip-dts64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into soc/dt One new board the Turing RK1 system on module. Support for DFI (DDR performance monitoring) for rk3588, rk3568 and an enable-fix for rk3399 as well as some small fixups for the RGB30 handheld (non-existent uart and better vpll frequency). * tag 'v6.7-rockchip-dts64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: Add Turing RK1 SoM support dt-bindings: arm: rockchip: Add Turing RK1 dt-bindings: vendor-prefixes: add turing arm64: dts: rockchip: Add DFI to rk3588s arm64: dts: rockchip: Add DFI to rk356x arm64: dts: rockchip: Always enable DFI on rk3399 arm64: dts: rockchip: Remove UART2 from RGB30 arm64: dts: rockchip: Update VPLL Frequency for RGB30 Link: https://lore.kernel.org/r/2777623.BEx9A2HvPv@phil Signed-off-by: Arnd Bergmann commit f652f84a9fbdc8db29d00c0b65aaf120e9152b2c Merge: a26dffc163614 a4d5bc3214ebb Author: Arnd Bergmann Date: Wed Oct 25 23:10:28 2023 +0200 Merge tag 'ti-k3-dt-for-v6.7-part2' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into soc/dt TI K3 device-tree updates for v6.7 - part 2 Second round of few DT updates for K3 platforms. These have been in linux-next for a few days without issues. Most of the additions is for newer AM62P SoC dtsi bringing support on par with rest of AM62x family. New features: AM62P SoCs: Support for wide range of peripherals such as eMMC/SD, CPSW Ethernet, OSPI, etc similar to AM62 J721s2/J784s4/AM69 SoCs: Display support via DP and HDMI interfaces and associated SerDes support AM654 EVM/IDK: ICSSG/PRU based industrial Ethernet support * tag 'ti-k3-dt-for-v6.7-part2' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: arm64: dts: ti: k3-am654-idk: Add ICSSG Ethernet ports arm64: dts: ti: k3-am654-icssg2: add ICSSG2 Ethernet support arm64: dts: ti: k3-am65-main: Add ICSSG IEP nodes arm64: dts: ti: k3-am62p5-sk: Updates for SK EVM arm64: dts: ti: k3-am62p: Add nodes for more IPs arm64: dts: ti: k3-am69-sk: Add DP and HDMI support arm64: dts: ti: k3-j784s4-evm: Enable DisplayPort-0 arm64: dts: ti: k3-j784s4-main: Add DSS and DP-bridge node arm64: dts: ti: k3-j784s4-main: Add WIZ and SERDES PHY nodes arm64: dts: ti: k3-j784s4-main: Add system controller and SERDES lane mux Link: https://lore.kernel.org/r/35a3c4c9-5c1b-4891-9ea2-e3f648a9afe0@ti.com Signed-off-by: Arnd Bergmann commit a26dffc16361438d96ff90d7451e43915589a0fa Merge: e209b029c7d7f 253358f373492 Author: Arnd Bergmann Date: Wed Oct 25 23:09:25 2023 +0200 Merge tag 'arm-soc/for-6.7/devicetree' of https://github.com/Broadcom/stblinux into soc/dt This pull request contains Broadcom ARM-based SoCs changes for 6.7, please pull the following: - Rafal makes a number of updates to the BCM5301X (Northstar) SoCs DTS to set MAC addresses for D-LInk DIR-885L, Asus, RT-AC87U, he relicenses parts of the DTSI to GPL 2.0+ / MIT, and finally fixes a number of Ethernet switch ports properties to enable/disable ports adequately. * tag 'arm-soc/for-6.7/devicetree' of https://github.com/Broadcom/stblinux: ARM: dts: BCM5301X: Set switch ports for Linksys EA9200 ARM: dts: BCM5301X: Set fixed-link for extra Netgear R8000 CPU ports ARM: dts: BCM5301X: Explicitly disable unused switch CPU ports ARM: dts: BCM5301X: Relicense Vivek's code to the GPL 2.0+ / MIT ARM: dts: BCM5301X: Relicense Felix's code to the GPL 2.0+ / MIT ARM: dts: BCM5301X: Set MAC address for Asus RT-AC87U ARM: dts: BCM5301X: Set MACs for D-Link DIR-885L Link: https://lore.kernel.org/r/20231024155927.977263-1-florian.fainelli@broadcom.com Signed-off-by: Arnd Bergmann commit e209b029c7d7f6205e510633d6ba966900b87ac2 Merge: f0bb192440e6a 4a48fa417abc5 Author: Arnd Bergmann Date: Wed Oct 25 23:08:35 2023 +0200 Merge tag 'samsung-dt-6.7-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/dt Samsung DTS ARM changes for v6.7, part two Two minor improvements for Midas boards (Exynos4412, e.g. Samsung Galaxy S3): 1. Correct the middle hardware key to emit KEY_OK instead of KEY_MENU, because there is already separate touchkey providing KEY_MENU and both label and node name suggests this should be KEY_OK. 2. Use defines for other key input constants. * tag 'samsung-dt-6.7-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: samsung: exynos4412-midas: use Linux event codes for input keys ARM: dts: samsung: exynos4412-midas: fix key-ok event code Link: https://lore.kernel.org/r/20231024132615.65609-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit dfae947836d867e127e2b64f981ebb299c28f0dc Merge: 759c2e043a60a 723d346173e74 Author: Arnd Bergmann Date: Wed Oct 25 22:58:30 2023 +0200 Merge tag 'qcom-drivers-for-6.7-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/drivers More Qualcomm driver updates for v6.7 The Qualcomm SMC an QSEECOM drivers are moved into a "qcom" subdirectory, to declutter the base directory. Missing include guards are added to the qseecom header file. Unneded extern specifiers are removed from the scm call wrappers. __counted_by is added to the apr_rx_buf structure, in the APR driver. Lastly in the pmic_glink driver the pmic_glink drm_bridge type is corrected to DisplayPort, over the incorrect "USB" value. The return values are added to error prints for the various typec set() calls. * tag 'qcom-drivers-for-6.7-2' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: soc: qcom: pmic_glink_altmode: Print return value on error firmware: qcom: scm: remove unneeded 'extern' specifiers firmware: qcom: scm: add a missing forward declaration for struct device firmware: qcom: move Qualcomm code into its own directory soc: qcom: apr: Add __counted_by for struct apr_rx_buf and use struct_size() soc: qcom: pmic_glink: fix connector type to be DisplayPort firmware: qcom: qseecom: add missing include guards Link: https://lore.kernel.org/r/20231025201109.1016121-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit 759c2e043a60a4603580bfd63342602ef11f1cec Merge: 8519f9c3c3992 112cd2f9614d5 Author: Arnd Bergmann Date: Wed Oct 25 22:56:23 2023 +0200 Merge tag 'arm-soc/for-6.7/drivers' of https://github.com/Broadcom/stblinux into soc/drivers This pull request contains Broadcom ARM/ARM64/MIPS SoCs drivers changes for 6.7, please pull the following: - Kieran fixes the kdoc for devm_rpi_firmware_get - Peter updates the dependices of the brcmstb SoC driver and brcmstb_gisb drivers which are ARCH_BRCMSTB specific * tag 'arm-soc/for-6.7/drivers' of https://github.com/Broadcom/stblinux: bus: brcmstb_gisb: Depend on SoC specifics over generic arm soc: bcm: brcmstb: depend on ARCH_BRCMSTB over arm arches firmware: raspberrypi: Fix devm_rpi_firmware_get documentation Link: https://lore.kernel.org/r/20231024155927.977263-2-florian.fainelli@broadcom.com Signed-off-by: Arnd Bergmann commit 56e144fe98260a0f8a17326993ceb576ef859ed5 Author: Ian Rogers Date: Tue Oct 24 15:23:14 2023 -0700 perf mem_info: Add and use map_symbol__exit and addr_map_symbol__exit Fix leak where mem_info__put wouldn't release the maps/map as used by perf mem. Add exit functions and use elsewhere that the maps and map are released. Signed-off-by: Ian Rogers Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Sandipan Das Cc: Anshuman Khandual Cc: German Gomez Cc: James Clark Cc: Nick Terrell Cc: Sean Christopherson Cc: Changbin Du Cc: liuwenyu Cc: Yang Jihong Cc: Masami Hiramatsu Cc: Miguel Ojeda Cc: Song Liu Cc: Leo Yan Cc: Kajol Jain Cc: Andi Kleen Cc: Kan Liang Cc: Athira Rajeev Cc: Yanteng Si Cc: Liam Howlett Cc: Paolo Bonzini Link: https://lore.kernel.org/r/20231024222353.3024098-12-irogers@google.com Signed-off-by: Namhyung Kim commit dec07fe5d4fd29aed2faf17f56140cd402175d72 Author: Ian Rogers Date: Tue Oct 24 15:23:13 2023 -0700 perf callchain: Minor layout changes to callchain_list Avoid 6 byte hole for padding. Place more frequently used fields first in an attempt to use just 1 cacheline in the common case. Before: ``` struct callchain_list { u64 ip; /* 0 8 */ struct map_symbol ms; /* 8 24 */ struct { _Bool unfolded; /* 32 1 */ _Bool has_children; /* 33 1 */ }; /* 32 2 */ /* XXX 6 bytes hole, try to pack */ u64 branch_count; /* 40 8 */ u64 from_count; /* 48 8 */ u64 predicted_count; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ u64 abort_count; /* 64 8 */ u64 cycles_count; /* 72 8 */ u64 iter_count; /* 80 8 */ u64 iter_cycles; /* 88 8 */ struct branch_type_stat * brtype_stat; /* 96 8 */ const char * srcline; /* 104 8 */ struct list_head list; /* 112 16 */ /* size: 128, cachelines: 2, members: 13 */ /* sum members: 122, holes: 1, sum holes: 6 */ }; ``` After: ``` struct callchain_list { struct list_head list; /* 0 16 */ u64 ip; /* 16 8 */ struct map_symbol ms; /* 24 24 */ const char * srcline; /* 48 8 */ u64 branch_count; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ u64 from_count; /* 64 8 */ u64 cycles_count; /* 72 8 */ u64 iter_count; /* 80 8 */ u64 iter_cycles; /* 88 8 */ struct branch_type_stat * brtype_stat; /* 96 8 */ u64 predicted_count; /* 104 8 */ u64 abort_count; /* 112 8 */ struct { _Bool unfolded; /* 120 1 */ _Bool has_children; /* 121 1 */ }; /* 120 2 */ /* size: 128, cachelines: 2, members: 13 */ /* padding: 6 */ }; ``` Signed-off-by: Ian Rogers Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Sandipan Das Cc: Anshuman Khandual Cc: German Gomez Cc: James Clark Cc: Nick Terrell Cc: Sean Christopherson Cc: Changbin Du Cc: liuwenyu Cc: Yang Jihong Cc: Masami Hiramatsu Cc: Miguel Ojeda Cc: Song Liu Cc: Leo Yan Cc: Kajol Jain Cc: Andi Kleen Cc: Kan Liang Cc: Athira Rajeev Cc: Yanteng Si Cc: Liam Howlett Cc: Paolo Bonzini Link: https://lore.kernel.org/r/20231024222353.3024098-11-irogers@google.com Signed-off-by: Namhyung Kim commit 6ba29fbb0b3863fa50c809d098680a0f3e0bd625 Author: Ian Rogers Date: Tue Oct 24 15:23:12 2023 -0700 perf callchain: Make brtype_stat in callchain_list optional struct callchain_list is 352bytes in size, 232 of which are brtype_stat. brtype_stat is only used for certain callchain_list items so make it optional, allocating when necessary. So that printing doesn't need to deal with an optional brtype_stat, pass an empty/zero version. Before: ``` struct callchain_list { u64 ip; /* 0 8 */ struct map_symbol ms; /* 8 24 */ struct { _Bool unfolded; /* 32 1 */ _Bool has_children; /* 33 1 */ }; /* 32 2 */ /* XXX 6 bytes hole, try to pack */ u64 branch_count; /* 40 8 */ u64 from_count; /* 48 8 */ u64 predicted_count; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ u64 abort_count; /* 64 8 */ u64 cycles_count; /* 72 8 */ u64 iter_count; /* 80 8 */ u64 iter_cycles; /* 88 8 */ struct branch_type_stat brtype_stat; /* 96 232 */ /* --- cacheline 5 boundary (320 bytes) was 8 bytes ago --- */ const char * srcline; /* 328 8 */ struct list_head list; /* 336 16 */ /* size: 352, cachelines: 6, members: 13 */ /* sum members: 346, holes: 1, sum holes: 6 */ /* last cacheline: 32 bytes */ }; ``` After: ``` struct callchain_list { u64 ip; /* 0 8 */ struct map_symbol ms; /* 8 24 */ struct { _Bool unfolded; /* 32 1 */ _Bool has_children; /* 33 1 */ }; /* 32 2 */ /* XXX 6 bytes hole, try to pack */ u64 branch_count; /* 40 8 */ u64 from_count; /* 48 8 */ u64 predicted_count; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ u64 abort_count; /* 64 8 */ u64 cycles_count; /* 72 8 */ u64 iter_count; /* 80 8 */ u64 iter_cycles; /* 88 8 */ struct branch_type_stat * brtype_stat; /* 96 8 */ const char * srcline; /* 104 8 */ struct list_head list; /* 112 16 */ /* size: 128, cachelines: 2, members: 13 */ /* sum members: 122, holes: 1, sum holes: 6 */ }; ``` Signed-off-by: Ian Rogers Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Sandipan Das Cc: Anshuman Khandual Cc: German Gomez Cc: James Clark Cc: Nick Terrell Cc: Sean Christopherson Cc: Changbin Du Cc: liuwenyu Cc: Yang Jihong Cc: Masami Hiramatsu Cc: Miguel Ojeda Cc: Song Liu Cc: Leo Yan Cc: Kajol Jain Cc: Andi Kleen Cc: Kan Liang Cc: Athira Rajeev Cc: Yanteng Si Cc: Liam Howlett Cc: Paolo Bonzini Link: https://lore.kernel.org/r/20231024222353.3024098-10-irogers@google.com Signed-off-by: Namhyung Kim commit d47d876d72624ee1ef31f2e491be4393d4eacaf0 Author: Ian Rogers Date: Tue Oct 24 15:23:11 2023 -0700 perf callchain: Make display use of branch_type_stat const Display code doesn't modify the branch_type_stat so switch uses to const. This is done to aid refactoring struct callchain_list where current the branch_type_stat is embedded even if not used. Signed-off-by: Ian Rogers Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Sandipan Das Cc: Anshuman Khandual Cc: German Gomez Cc: James Clark Cc: Nick Terrell Cc: Sean Christopherson Cc: Changbin Du Cc: liuwenyu Cc: Yang Jihong Cc: Masami Hiramatsu Cc: Miguel Ojeda Cc: Song Liu Cc: Leo Yan Cc: Kajol Jain Cc: Andi Kleen Cc: Kan Liang Cc: Athira Rajeev Cc: Yanteng Si Cc: Liam Howlett Cc: Paolo Bonzini Link: https://lore.kernel.org/r/20231024222353.3024098-9-irogers@google.com Signed-off-by: Namhyung Kim commit 67a3ebf1c3588ee2ab994a4c96ef19179209c132 Author: Ian Rogers Date: Tue Oct 24 15:23:10 2023 -0700 perf offcpu: Add missed btf_free Caught by address/leak sanitizer. Signed-off-by: Ian Rogers Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Sandipan Das Cc: Anshuman Khandual Cc: German Gomez Cc: James Clark Cc: Nick Terrell Cc: Sean Christopherson Cc: Changbin Du Cc: liuwenyu Cc: Yang Jihong Cc: Masami Hiramatsu Cc: Miguel Ojeda Cc: Song Liu Cc: Leo Yan Cc: Kajol Jain Cc: Andi Kleen Cc: Kan Liang Cc: Athira Rajeev Cc: Yanteng Si Cc: Liam Howlett Cc: Paolo Bonzini Link: https://lore.kernel.org/r/20231024222353.3024098-8-irogers@google.com Signed-off-by: Namhyung Kim commit 7b2e444b76ceff71dad53fb8705780741421b570 Author: Ian Rogers Date: Tue Oct 24 15:23:09 2023 -0700 perf threads: Remove unused dead thread list Commit 40826c45eb0b ("perf thread: Remove notion of dead threads") removed dead threads but the list head wasn't removed. Remove it here. Signed-off-by: Ian Rogers Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Sandipan Das Cc: Anshuman Khandual Cc: German Gomez Cc: James Clark Cc: Nick Terrell Cc: Sean Christopherson Cc: Changbin Du Cc: liuwenyu Cc: Yang Jihong Cc: Masami Hiramatsu Cc: Miguel Ojeda Cc: Song Liu Cc: Leo Yan Cc: Kajol Jain Cc: Andi Kleen Cc: Kan Liang Cc: Athira Rajeev Cc: Yanteng Si Cc: Liam Howlett Cc: Paolo Bonzini Link: https://lore.kernel.org/r/20231024222353.3024098-7-irogers@google.com Signed-off-by: Namhyung Kim commit c1149037f65bcf0334886180ebe3d5efcf214912 Author: Ian Rogers Date: Tue Oct 24 15:23:08 2023 -0700 perf hist: Add missing puts to hist__account_cycles Caught using reference count checking on perf top with "--call-graph=lbr". After this no memory leaks were detected. Fixes: 57849998e2cd ("perf report: Add processing for cycle histograms") Signed-off-by: Ian Rogers Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Sandipan Das Cc: Anshuman Khandual Cc: German Gomez Cc: James Clark Cc: Nick Terrell Cc: Sean Christopherson Cc: Changbin Du Cc: liuwenyu Cc: Yang Jihong Cc: Masami Hiramatsu Cc: Miguel Ojeda Cc: Song Liu Cc: Leo Yan Cc: Kajol Jain Cc: Andi Kleen Cc: Kan Liang Cc: Athira Rajeev Cc: Yanteng Si Cc: Liam Howlett Cc: Paolo Bonzini Link: https://lore.kernel.org/r/20231024222353.3024098-6-irogers@google.com Signed-off-by: Namhyung Kim commit 78c32f4cb12f9430e29402118635dcf972b7d325 Author: Ian Rogers Date: Tue Oct 24 15:23:07 2023 -0700 libperf rc_check: Add RC_CHK_EQUAL Comparing pointers with reference count checking is tricky to avoid a SEGV. Add a convenience macro to simplify and use. Signed-off-by: Ian Rogers Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Sandipan Das Cc: Anshuman Khandual Cc: German Gomez Cc: James Clark Cc: Nick Terrell Cc: Sean Christopherson Cc: Changbin Du Cc: liuwenyu Cc: Yang Jihong Cc: Masami Hiramatsu Cc: Miguel Ojeda Cc: Song Liu Cc: Leo Yan Cc: Kajol Jain Cc: Andi Kleen Cc: Kan Liang Cc: Athira Rajeev Cc: Yanteng Si Cc: Liam Howlett Cc: Paolo Bonzini Link: https://lore.kernel.org/r/20231024222353.3024098-5-irogers@google.com Signed-off-by: Namhyung Kim commit 75265320d290c5f5891f16967b94883676c46705 Author: Ian Rogers Date: Tue Oct 24 15:23:06 2023 -0700 libperf rc_check: Make implicit enabling work for GCC Make the implicit REFCOUNT_CHECKING robust to when building with GCC. Fixes: 9be6ab181b7b ("libperf rc_check: Enable implicitly with sanitizers") Signed-off-by: Ian Rogers Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Sandipan Das Cc: Anshuman Khandual Cc: German Gomez Cc: James Clark Cc: Nick Terrell Cc: Sean Christopherson Cc: Changbin Du Cc: liuwenyu Cc: Yang Jihong Cc: Masami Hiramatsu Cc: Miguel Ojeda Cc: Song Liu Cc: Leo Yan Cc: Kajol Jain Cc: Andi Kleen Cc: Kan Liang Cc: Athira Rajeev Cc: Yanteng Si Cc: Liam Howlett Cc: Paolo Bonzini Link: https://lore.kernel.org/r/20231024222353.3024098-4-irogers@google.com Signed-off-by: Namhyung Kim commit ab8ce150781d326c6bfbe1e09f175ffde1186f80 Author: Ian Rogers Date: Tue Oct 24 15:23:05 2023 -0700 perf machine: Avoid out of bounds LBR memory read Running perf top with address sanitizer and "--call-graph=lbr" fails due to reading sample 0 when no samples exist. Add a guard to prevent this. Fixes: e2b23483eb1d ("perf machine: Factor out lbr_callchain_add_lbr_ip()") Signed-off-by: Ian Rogers Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Sandipan Das Cc: Anshuman Khandual Cc: German Gomez Cc: James Clark Cc: Nick Terrell Cc: Sean Christopherson Cc: Changbin Du Cc: liuwenyu Cc: Yang Jihong Cc: Masami Hiramatsu Cc: Miguel Ojeda Cc: Song Liu Cc: Leo Yan Cc: Kajol Jain Cc: Andi Kleen Cc: Kan Liang Cc: Athira Rajeev Cc: Yanteng Si Cc: Liam Howlett Cc: Paolo Bonzini Link: https://lore.kernel.org/r/20231024222353.3024098-3-irogers@google.com Signed-off-by: Namhyung Kim commit 7a8f349e9d14da1633e021c2fe87234b21ab181d Author: Ian Rogers Date: Tue Oct 24 15:23:04 2023 -0700 perf rwsem: Add debug mode that uses a mutex Mutex error check will capture trying to take the lock recursively and other problems that rwlock won't. At the expense of concurrency, adda debug mode that uses a mutex in place of a rwsem. Signed-off-by: Ian Rogers Cc: K Prateek Nayak Cc: Ravi Bangoria Cc: Sandipan Das Cc: Anshuman Khandual Cc: German Gomez Cc: James Clark Cc: Nick Terrell Cc: Sean Christopherson Cc: Changbin Du Cc: liuwenyu Cc: Yang Jihong Cc: Masami Hiramatsu Cc: Miguel Ojeda Cc: Song Liu Cc: Leo Yan Cc: Kajol Jain Cc: Andi Kleen Cc: Kan Liang Cc: Athira Rajeev Cc: Yanteng Si Cc: Liam Howlett Cc: Paolo Bonzini Link: https://lore.kernel.org/r/20231024222353.3024098-2-irogers@google.com Signed-off-by: Namhyung Kim commit 61d4fb0b349ec1b33119913c3b0bd109de30142c Author: Christian Brauner Date: Wed Oct 25 12:14:37 2023 +0200 file, i915: fix file reference for mmap_singleton() Today we got a report at [1] for rcu stalls on the i915 testsuite in [2] due to the conversion of files to SLAB_TYPSSAFE_BY_RCU. Afaict, get_file_rcu() goes into an infinite loop trying to carefully verify that i915->gem.mmap_singleton hasn't changed - see the splat below. So I stared at this code to figure out what it actually does. It seems that the i915->gem.mmap_singleton pointer itself never had rcu semantics. The i915->gem.mmap_singleton is replaced in file->f_op->release::singleton_release(): static int singleton_release(struct inode *inode, struct file *file) { struct drm_i915_private *i915 = file->private_data; cmpxchg(&i915->gem.mmap_singleton, file, NULL); drm_dev_put(&i915->drm); return 0; } The cmpxchg() is ordered against a concurrent update of i915->gem.mmap_singleton from mmap_singleton(). IOW, when mmap_singleton() fails to get a reference on i915->gem.mmap_singleton: While mmap_singleton() does rcu_read_lock(); file = get_file_rcu(&i915->gem.mmap_singleton); rcu_read_unlock(); it allocates a new file via anon_inode_getfile() and does smp_store_mb(i915->gem.mmap_singleton, file); So, then what happens in the case of this bug is that at some point fput() is called and drops the file->f_count to zero leaving the pointer in i915->gem.mmap_singleton in tact. Now, there might be delays until file->f_op->release::singleton_release() is called and i915->gem.mmap_singleton is set to NULL. Say concurrently another task hits mmap_singleton() and does: rcu_read_lock(); file = get_file_rcu(&i915->gem.mmap_singleton); rcu_read_unlock(); When get_file_rcu() fails to get a reference via atomic_inc_not_zero() it will try the reload from i915->gem.mmap_singleton expecting it to be NULL, assuming it has comparable semantics as we expect in __fget_files_rcu(). But it hasn't so it reloads the same pointer again, trying the same atomic_inc_not_zero() again and doing so until file->f_op->release::singleton_release() of the old file has been called. So, in contrast to __fget_files_rcu() here we want to not retry when atomic_inc_not_zero() has failed. We only want to retry in case we managed to get a reference but the pointer did change on reload. <3> [511.395679] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: <3> [511.395716] rcu: Tasks blocked on level-1 rcu_node (CPUs 0-9): P6238 <3> [511.395934] rcu: (detected by 16, t=65002 jiffies, g=123977, q=439 ncpus=20) <6> [511.395944] task:i915_selftest state:R running task stack:10568 pid:6238 tgid:6238 ppid:1001 flags:0x00004002 <6> [511.395962] Call Trace: <6> [511.395966] <6> [511.395974] ? __schedule+0x3a8/0xd70 <6> [511.395995] ? asm_sysvec_apic_timer_interrupt+0x1a/0x20 <6> [511.396003] ? lockdep_hardirqs_on+0xc3/0x140 <6> [511.396013] ? asm_sysvec_apic_timer_interrupt+0x1a/0x20 <6> [511.396029] ? get_file_rcu+0x10/0x30 <6> [511.396039] ? get_file_rcu+0x10/0x30 <6> [511.396046] ? i915_gem_object_mmap+0xbc/0x450 [i915] <6> [511.396509] ? i915_gem_mmap+0x272/0x480 [i915] <6> [511.396903] ? mmap_region+0x253/0xb60 <6> [511.396925] ? do_mmap+0x334/0x5c0 <6> [511.396939] ? vm_mmap_pgoff+0x9f/0x1c0 <6> [511.396949] ? rcu_is_watching+0x11/0x50 <6> [511.396962] ? igt_mmap_offset+0xfc/0x110 [i915] <6> [511.397376] ? __igt_mmap+0xb3/0x570 [i915] <6> [511.397762] ? igt_mmap+0x11e/0x150 [i915] <6> [511.398139] ? __trace_bprintk+0x76/0x90 <6> [511.398156] ? __i915_subtests+0xbf/0x240 [i915] <6> [511.398586] ? __pfx___i915_live_setup+0x10/0x10 [i915] <6> [511.399001] ? __pfx___i915_live_teardown+0x10/0x10 [i915] <6> [511.399433] ? __run_selftests+0xbc/0x1a0 [i915] <6> [511.399875] ? i915_live_selftests+0x4b/0x90 [i915] <6> [511.400308] ? i915_pci_probe+0x106/0x200 [i915] <6> [511.400692] ? pci_device_probe+0x95/0x120 <6> [511.400704] ? really_probe+0x164/0x3c0 <6> [511.400715] ? __pfx___driver_attach+0x10/0x10 <6> [511.400722] ? __driver_probe_device+0x73/0x160 <6> [511.400731] ? driver_probe_device+0x19/0xa0 <6> [511.400741] ? __driver_attach+0xb6/0x180 <6> [511.400749] ? __pfx___driver_attach+0x10/0x10 <6> [511.400756] ? bus_for_each_dev+0x77/0xd0 <6> [511.400770] ? bus_add_driver+0x114/0x210 <6> [511.400781] ? driver_register+0x5b/0x110 <6> [511.400791] ? i915_init+0x23/0xc0 [i915] <6> [511.401153] ? __pfx_i915_init+0x10/0x10 [i915] <6> [511.401503] ? do_one_initcall+0x57/0x270 <6> [511.401515] ? rcu_is_watching+0x11/0x50 <6> [511.401521] ? kmalloc_trace+0xa3/0xb0 <6> [511.401532] ? do_init_module+0x5f/0x210 <6> [511.401544] ? load_module+0x1d00/0x1f60 <6> [511.401581] ? init_module_from_file+0x86/0xd0 <6> [511.401590] ? init_module_from_file+0x86/0xd0 <6> [511.401613] ? idempotent_init_module+0x17c/0x230 <6> [511.401639] ? __x64_sys_finit_module+0x56/0xb0 <6> [511.401650] ? do_syscall_64+0x3c/0x90 <6> [511.401659] ? entry_SYSCALL_64_after_hwframe+0x6e/0xd8 <6> [511.401684] Link: [1]: https://lore.kernel.org/intel-gfx/SJ1PR11MB6129CB39EED831784C331BAFB9DEA@SJ1PR11MB6129.namprd11.prod.outlook.com Link: [2]: https://intel-gfx-ci.01.org/tree/linux-next/next-20231013/bat-dg2-11/igt@i915_selftest@live@mman.html#dmesg-warnings10963 Cc: Jann Horn , Cc: Linus Torvalds Link: https://lore.kernel.org/r/20231025-formfrage-watscheln-84526cd3bd7d@brauner Signed-off-by: Christian Brauner commit a31226cdc877133081b131c2e7c79fc94890b1c7 Author: Nik Bune Date: Mon Oct 23 22:26:22 2023 +0200 dt-bindings: watchdog: cnxt,cx92755-wdt: convert txt to yaml Convert txt file to yaml. Add maintainers list. Signed-off-by: Nik Bune Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231023202622.18558-1-n2h9z4@gmail.com Signed-off-by: Rob Herring commit bd888a4377ae10303ba8c967dfccf2a1e4bbdcd1 Author: Nik Bune Date: Sat Oct 14 19:04:34 2023 +0200 dt-bindings: watchdog: da9062-wdt: convert txt to yaml Convert txt file to yaml. Add a mainterner block. Took a value from dlg,da9063 PMIC. Signed-off-by: Nik Bune Reviewed-by: Guenter Roeck Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231014170434.159310-1-n2h9z4@gmail.com Signed-off-by: Rob Herring commit 7b43addcd15a05c8e6f43bac70503247d33088e1 Author: Fabio Estevam Date: Wed Oct 4 15:20:43 2023 -0300 dt-bindings: watchdog: fsl,scu-wdt: Document imx8dl imx8dxl also contains the SCU watchdog block. Add an entry for 'fsl,imx8dxl-sc-wdt'. Cc: Wim Van Sebroeck Cc: Guenter Roeck Signed-off-by: Fabio Estevam Acked-by: Conor Dooley Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231004182043.2309790-1-festevam@gmail.com Signed-off-by: Rob Herring commit 22c3888e55bf5c86be536a3d9e06a50e7bf3a39f Author: Nik Bune Date: Sun Sep 24 20:19:59 2023 +0200 dt-bindings: watchdog: atmel,at91rm9200-wdt: convert txt to yaml Convert txt file to yaml. Signed-off-by: Nik Bune Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230924181959.64264-1-n2h9z4@gmail.com Signed-off-by: Rob Herring commit 920057ad521dc8669e534736c2a12c14ec9fb2d7 Author: Zev Weiss Date: Fri Sep 29 13:08:23 2023 -0700 hwmon: (nct6775) Fix incorrect variable reuse in fan_div calculation In the regmap conversion in commit 4ef2774511dc ("hwmon: (nct6775) Convert register access to regmap API") I reused the 'reg' variable for all three register reads in the fan speed calculation loop in nct6775_update_device(), but failed to notice that the value from the first one (data->REG_FAN[i]) is actually used in the call to nct6775_select_fan_div() at the end of the loop body. Since that patch the register value passed to nct6775_select_fan_div() has been (conditionally) incorrectly clobbered with the value of a different register than intended, which has in at least some cases resulted in fan speeds being adjusted down to zero. Fix this by using dedicated temporaries for the two intermediate register reads instead of 'reg'. Signed-off-by: Zev Weiss Fixes: 4ef2774511dc ("hwmon: (nct6775) Convert register access to regmap API") Reported-by: Thomas Zajic Tested-by: Thomas Zajic Cc: stable@vger.kernel.org # v5.19+ Link: https://lore.kernel.org/r/20230929200822.964-2-zev@bewilderbeest.net Signed-off-by: Guenter Roeck commit 8846f9a04b10b7f61214425409838d764df7080d Merge: aad36cd32982d 8005184fd1ca6 Author: Jakub Kicinski Date: Wed Oct 25 12:23:36 2023 -0700 Merge branch 'mptcp-features-and-fixes-for-v6-7' Mat Martineau says: ==================== mptcp: Features and fixes for v6.7 Patch 1 adds a configurable timeout for the MPTCP connection when all subflows are closed, to support break-before-make use cases. Patch 2 is a fix for a 1-byte error in rx data counters with MPTCP fastopen connections. Patch 3 is a minor code cleanup. Patches 4 & 5 add handling of rcvlowat for MPTCP sockets, with a prerequisite patch to use a common scaling ratio between TCP and MPTCP. Patch 6 improves efficiency of memory copying in MPTCP transmit code. Patch 7 refactors syncing of socket options from the MPTCP socket to its subflows. Patches 8 & 9 help the MPTCP packet scheduler perform well by changing the handling of notsent_lowat in subflows and how available buffer space is calculated for MPTCP-level sends. ==================== Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-2-v1-0-9dc60939d371@kernel.org Signed-off-by: Jakub Kicinski commit 8005184fd1ca6aeb3fea36f4eb9463fc1b90c114 Author: Paolo Abeni Date: Mon Oct 23 13:44:42 2023 -0700 mptcp: refactor sndbuf auto-tuning The MPTCP protocol account for the data enqueued on all the subflows to the main socket send buffer, while the send buffer auto-tuning algorithm set the main socket send buffer size as the max size among the subflows. That causes bad performances when at least one subflow is sndbuf limited, e.g. due to very high latency, as the MPTCP scheduler can't even fill such buffer. Change the send-buffer auto-tuning algorithm to compute the main socket send buffer size as the sum of all the subflows buffer size. Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-2-v1-9-9dc60939d371@kernel.org Signed-off-by: Jakub Kicinski commit 9fdc779331bd3e0b2570c2bced396d53a04a33b9 Author: Paolo Abeni Date: Mon Oct 23 13:44:41 2023 -0700 mptcp: ignore notsent_lowat setting at the subflow level Any latency related tuning taking action at the subflow level does not really affect the user-space, as only the main MPTCP socket is relevant. Anyway any limiting setting may foul the MPTCP scheduler, not being able to fully use the subflow-level cwin, leading to very poor b/w usage. Enforce notsent_lowat to be a no-op on every subflow. Note that TCP_NOTSENT_LOWAT is currently not supported, and properly dealing with that will require more invasive changes. Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-2-v1-8-9dc60939d371@kernel.org Signed-off-by: Jakub Kicinski commit a1ab24e5fc4a3048a1b3a24ab0ddc7b73358baa9 Author: Paolo Abeni Date: Mon Oct 23 13:44:40 2023 -0700 mptcp: consolidate sockopt synchronization Move the socket option synchronization for active subflows at subflow creation time. This allows removing the now unused unlocked variant of such helper. While at that, clean-up a bit the mptcp_subflow_create_socket() errors path. Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-2-v1-7-9dc60939d371@kernel.org Signed-off-by: Jakub Kicinski commit 0ffe8e74904027aa48d1f8bd52675c6f0a4c88d1 Author: Paolo Abeni Date: Mon Oct 23 13:44:39 2023 -0700 mptcp: use copy_from_iter helpers on transmit The perf traces show an high cost for the MPTCP transmit path memcpy. It turn out that the helper currently in use carries quite a bit of unneeded overhead, e.g. to map/unmap the memory pages. Moving to the 'copy_from_iter' variant removes such overhead and additionally gains the no-cache support. Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-2-v1-6-9dc60939d371@kernel.org Signed-off-by: Jakub Kicinski commit 5684ab1a0effbfeb706f47d85785f653005b97b1 Author: Paolo Abeni Date: Mon Oct 23 13:44:38 2023 -0700 mptcp: give rcvlowat some love The MPTCP protocol allow setting sk_rcvlowat, but the value there is currently ignored. Additionally, the default subflows sk_rcvlowat basically disables per subflow delayed ack: the MPTCP protocol move the incoming data from the subflows into the msk socket as soon as the TCP stacks invokes the subflow data_ready callback. Later, when __tcp_ack_snd_check() takes action, the subflow-level copied_seq matches rcv_nxt, and that mandate for an immediate ack. Let the mptcp receive path be aware of such threshold, explicitly tracking the amount of data available to be ready and checking vs sk_rcvlowat in mptcp_poll() and before waking-up readers. Additionally implement the set_rcvlowat() callback, to properly handle the rcvbuf auto-tuning on sk_rcvlowat changes. Finally to properly handle delayed ack, force the subflow level threshold to 0 and instead explicitly ask for an immediate ack when the msk level th is not reached. Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-2-v1-5-9dc60939d371@kernel.org Signed-off-by: Jakub Kicinski commit 849ee75a38b297187c760bb1d23d8f2a7b1fc73e Author: Paolo Abeni Date: Mon Oct 23 13:44:37 2023 -0700 tcp: define initial scaling factor value as a macro So that other users could access it. Notably MPTCP will use it in the next patch. No functional change intended. Acked-by: Matthieu Baerts Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-2-v1-4-9dc60939d371@kernel.org Signed-off-by: Jakub Kicinski commit f1f26512a9bf18f7a4c0d59df113a49f39d7d4b6 Author: Paolo Abeni Date: Mon Oct 23 13:44:36 2023 -0700 mptcp: use plain bool instead of custom binary enum The 'data_avail' subflow field is already used as plain boolean, drop the custom binary enum type and switch to bool. No functional changed intended. Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-2-v1-3-9dc60939d371@kernel.org Signed-off-by: Jakub Kicinski commit bf0e96108fb6707613dd055aff5e98b02b99bb14 Author: Paolo Abeni Date: Mon Oct 23 13:44:35 2023 -0700 mptcp: properly account fastopen data Currently the socket level counter aggregating the received data does not take in account the data received via fastopen. Address the issue updating the counter as required. Fixes: 38967f424b5b ("mptcp: track some aggregate data counters") Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-2-v1-2-9dc60939d371@kernel.org Signed-off-by: Jakub Kicinski commit d866ae9aaa4325f1097e8b7a50f202348ca89b87 Author: Paolo Abeni Date: Mon Oct 23 13:44:34 2023 -0700 mptcp: add a new sysctl for make after break timeout The MPTCP protocol allows sockets with no alive subflows to stay in ESTABLISHED status for and user-defined timeout, to allow for later subflows creation. Currently such timeout is constant - TCP_TIMEWAIT_LEN. Let the user-space configure them via a newly added sysctl, to better cope with busy servers and simplify (make them faster) the relevant pktdrill tests. Note that the new know does not apply to orphaned MPTCP socket waiting for the data_fin handshake completion: they always wait TCP_TIMEWAIT_LEN. Reviewed-by: Mat Martineau Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-2-v1-1-9dc60939d371@kernel.org Signed-off-by: Jakub Kicinski commit bbfff736d30e5283ad09e748caff979d75ddef7f Author: Zhang Rui Date: Wed Oct 25 20:23:16 2023 +0800 hwmon: (coretemp) Fix potentially truncated sysfs attribute name When build with W=1 and "-Werror=format-truncation", below error is observed in coretemp driver, drivers/hwmon/coretemp.c: In function 'create_core_data': >> drivers/hwmon/coretemp.c:393:34: error: '%s' directive output may be truncated writing likely 5 or more bytes into a region of size between 3 and 13 [-Werror=format-truncation=] 393 | "temp%d_%s", attr_no, suffixes[i]); | ^~ drivers/hwmon/coretemp.c:393:26: note: assuming directive output of 5 bytes 393 | "temp%d_%s", attr_no, suffixes[i]); | ^~~~~~~~~~~ drivers/hwmon/coretemp.c:392:17: note: 'snprintf' output 7 or more bytes (assuming 22) into a destination of size 19 392 | snprintf(tdata->attr_name[i], CORETEMP_NAME_LENGTH, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 393 | "temp%d_%s", attr_no, suffixes[i]); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Given that 1. '%d' could take 10 charactors, 2. '%s' could take 10 charactors ("crit_alarm"), 3. "temp", "_" and the NULL terminator take 6 charactors, fix the problem by increasing CORETEMP_NAME_LENGTH to 28. Signed-off-by: Zhang Rui Fixes: 7108b80a542b ("hwmon/coretemp: Handle large core ID value") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310200443.iD3tUbbK-lkp@intel.com/ Link: https://lore.kernel.org/r/20231025122316.836400-1-rui.zhang@intel.com Signed-off-by: Guenter Roeck commit 2a5b3370a1d9750eca325292e291c8c7cb8cf2e0 Author: Dragos Bogdan Date: Wed Oct 25 15:21:00 2023 +0200 hwmon: (axi-fan-control) Fix possible NULL pointer dereference axi_fan_control_irq_handler(), dependent on the private axi_fan_control_data structure, might be called before the hwmon device is registered. That will cause an "Unable to handle kernel NULL pointer dereference" error. Fixes: 8412b410fa5e ("hwmon: Support ADI Fan Control IP") Signed-off-by: Dragos Bogdan Signed-off-by: Nuno Sa Link: https://lore.kernel.org/r/20231025132100.649499-1-nuno.sa@analog.com Signed-off-by: Guenter Roeck commit 82dd620653b322a908db2d4741bbf64c12cbdb54 Author: Matthew Wilcox (Oracle) Date: Thu Sep 21 15:06:01 2023 -0400 ext2: Convert ext2_prepare_chunk and ext2_commit_chunk to folios All callers now have a folio, so pass it in. Saves one call to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Jan Kara commit da3a849a5cc012f932d956cf6f4656c0de38c729 Author: Matthew Wilcox (Oracle) Date: Thu Sep 21 21:07:46 2023 +0100 ext2: Convert ext2_make_empty() to use a folio Remove two hidden calls to compound_head() by using the folio API. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Jan Kara Message-Id: <20230921200746.3303942-9-willy@infradead.org> commit c2d20492e28c1071abfdc079f4d34acaf965b9b4 Author: Matthew Wilcox (Oracle) Date: Thu Sep 21 21:07:45 2023 +0100 ext2: Convert ext2_unlink() and ext2_rename() to use folios This involves changing ext2_find_entry(), ext2_dotdot(), ext2_inode_by_name(), ext2_set_link() and ext2_delete_entry() to take a folio. These were also the last users of ext2_get_page() and ext2_put_page(), so remove those at the same time. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Jan Kara Message-Id: <20230921200746.3303942-8-willy@infradead.org> commit 7e56bbf15d95b888f781b67f4ed2f3e08edc899a Author: Matthew Wilcox (Oracle) Date: Thu Sep 21 21:07:44 2023 +0100 ext2: Convert ext2_delete_entry() to use folios Save some calls to compound_head() by using the folio API. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Jan Kara Message-Id: <20230921200746.3303942-7-willy@infradead.org> commit f4b830cfceffb05d8feb899fbd28fd592f1bb0ae Author: Matthew Wilcox (Oracle) Date: Thu Sep 21 21:07:43 2023 +0100 ext2: Convert ext2_empty_dir() to use a folio Save two calls to compound_head() by using the folio API. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Jan Kara Message-Id: <20230921200746.3303942-6-willy@infradead.org> commit 1de0736c3af9dadb688cad23871f9760ff22265f Author: Matthew Wilcox (Oracle) Date: Thu Sep 21 21:07:42 2023 +0100 ext2: Convert ext2_add_link() to use a folio Remove five hidden calls to compound_head() and fix a couple of places that assumed PAGE_SIZE. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Jan Kara Message-Id: <20230921200746.3303942-5-willy@infradead.org> commit 51706b6fd42edd30c3761a20a41c30bd184e59f7 Author: Matthew Wilcox (Oracle) Date: Thu Sep 21 21:07:41 2023 +0100 ext2: Convert ext2_readdir to use a folio Saves a hidden call to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Jan Kara Message-Id: <20230921200746.3303942-4-willy@infradead.org> commit 52df49ee835d79d8e50f38d89d75bf0891854511 Author: Matthew Wilcox (Oracle) Date: Thu Sep 21 21:07:40 2023 +0100 ext2: Add ext2_get_folio() Convert ext2_get_page() into ext2_get_folio() and keep the original function around as a temporary wrapper. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Jan Kara Message-Id: <20230921200746.3303942-3-willy@infradead.org> commit 46f84a9bea2c44e80b52afa56b34d9e3e84dc358 Author: Matthew Wilcox (Oracle) Date: Thu Sep 21 21:07:39 2023 +0100 ext2: Convert ext2_check_page to ext2_check_folio Support in this function for large folios is limited to supporting filesystems with block size > PAGE_SIZE. This new functionality will only be supported on machines without HIGHMEM, so the problem of kmap_local only being able to map a single page in the folio can be ignored. We will not use large folios for ext2 directories on HIGHMEM machines. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Jan Kara Message-Id: <20230921200746.3303942-2-willy@infradead.org> commit 3de6047f1832010d24963f58206298fc75085816 Author: Matthew Wilcox (Oracle) Date: Thu Sep 21 21:07:38 2023 +0100 highmem: Add folio_release_kmap() This is the folio equivalent of unmap_and_put_page(), which remains as a wrapper for it. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Jan Kara Message-Id: <20230921200746.3303942-1-willy@infradead.org> commit 33883eeda456f9ea73f7a2d65e321b3c82fd9294 Author: D Scott Phillips Date: Fri Sep 29 17:20:35 2023 -0700 PCI: acpiphp: Allow built-in drivers for Attention Indicators Since the introduction of the attention callback in acpiphp, a non-zero struct module *owner has been required in acpiphp_register_attention(). The intent seemed to be that the core code could hold a refcount on the module while invoking a callback. This check accidentally precludes the possibility of attention callbacks to built-in drivers. Remove the check on `struct module *owner` in acpiphp_register_attention() so attention callbacks can also be registered from built-in drivers. Link: https://lore.kernel.org/r/20230930002036.6491-1-scott@os.amperecomputing.com Signed-off-by: D Scott Phillips Signed-off-by: Bjorn Helgaas commit bc00d9f3813a40bc2d854ae0edab14c6b43a3219 Author: Abel Vesa Date: Tue Oct 24 16:46:26 2023 +0300 regulator: qcom-rpmh: Fix smps4 regulator for pm8550ve The type of the smps4 regulator from pm8550ve is actually FTSMPS525 medium voltage. So fix it accordingly. Fixes: e6e3776d682d ("regulator: qcom-rpmh: Add support for PM8550 regulators") Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20231024134626.2364426-1-abel.vesa@linaro.org Signed-off-by: Mark Brown commit ae61939cdf378ae3acc5716ccb43fef3cdace36e Author: Rajendra Nayak Date: Wed Oct 25 19:25:49 2023 +0530 regulator: qcom,rpmh: Add PMC8380 compatible Add PMC8380 compatibles for PMIC found in SC8380XP platform. Signed-off-by: Rajendra Nayak Signed-off-by: Sibi Sankar Link: https://lore.kernel.org/r/20231025135550.13162-2-quic_sibis@quicinc.com Signed-off-by: Mark Brown commit afb823a5843e6790106fcfe5029cfa736e05007f Author: Rajendra Nayak Date: Wed Oct 25 19:25:50 2023 +0530 regulator: qcom-rpmh: Add regulators support for PMC8380 Add support from RPMH regulators found in PMC8380 for SC8380XP platform. Signed-off-by: Rajendra Nayak Signed-off-by: Sibi Sankar Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20231025135550.13162-3-quic_sibis@quicinc.com Signed-off-by: Mark Brown commit 1002f8171d966f73e3d97b05fc0178e115fb5dca Author: Wu Yunchuan Date: Fri Oct 20 17:34:31 2023 +0800 wifi: ray_cs: Remove unnecessary (void*) conversions No need cast (void *) to (struct net_device *). Signed-off-by: Wu Yunchuan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231020093432.214001-1-yunchuan@nfschina.com commit b6144dcdd445d1bf8b7973b73c9a2dd5b44661cf Merge: 7d7b6f2953b34 f59065401602f Author: Kalle Valo Date: Wed Oct 25 20:10:23 2023 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v6.7. Major changes: ath12k * QCN9274: mesh support ath11k * firmware-2.bin support commit b27778ed5d1d21cdb4fa83ff5185e7e438fd653f Author: Arnaldo Carvalho de Melo Date: Wed Oct 25 08:23:05 2023 -0300 perf build: Address stray '\' before # that is warned about since grep 3.8 To address this grep 3.8 warning: grep: warning: stray \ before # We needed to remove the '' around the grep expression and keep the \ before # so that it is escaped by the $(shell grep ...) and thus doesn't get to grep. We need that \ before the #, otherwise we get this: Makefile.perf:364: *** unterminated call to function 'shell': missing ')'. Stop. As everything after the # will be considered a comment. Removing the single quotes needs some more escaping so that _some_ of the escaped chars gets to grep, like the '\|' that becomes '\\\|´. Running on debian:10, where there is no libtraceevent-devel available, we get: Makefile.perf:367: *** PYTHON_EXT_SRCS= util/python.c ../lib/ctype.c util/cap.c util/evlist.c util/evsel.c util/evsel_fprintf.c util/perf_event_attr_fprintf.c util/cpumap.c util/memswap.c util/mmap.c util/namespaces.c ../lib/bitmap.c ../lib/find_bit.c ../lib/list_sort.c ../lib/hweight.c ../lib/string.c ../lib/vsprintf.c util/thread_map.c util/util.c util/cgroup.c util/parse-branch-options.c util/rblist.c util/counts.c util/print_binary.c util/strlist.c ../lib/rbtree.c util/string.c util/symbol_fprintf.c util/units.c util/affinity.c util/rwsem.c util/hashmap.c util/perf_regs.c util/fncache.c util/perf-regs-arch/perf_regs_aarch64.c util/perf-regs-arch/perf_regs_arm.c util/perf-regs-arch/perf_regs_csky.c util/perf-regs-arch/perf_regs_loongarch.c util/perf-regs-arch/perf_regs_mips.c util/perf-regs-arch/perf_regs_powerpc.c util/perf-regs-arch/perf_regs_riscv.c util/perf-regs-arch/perf_regs_s390.c util/perf-regs-arch/perf_regs_x86.c. Stop. make[1]: *** [Makefile.perf:242: sub-make] Error 2 I.e. both the comments and the util/trace-event.c were removed. When using: msg := $(error PYTHON_EXT_SRCS=$(PYTHON_EXT_SRCS)) While on the more recent fedora:38, with the new grep and make packages and libtraceevent-devel installed: Makefile.perf:367: *** PYTHON_EXT_SRCS= util/python.c ../lib/ctype.c util/cap.c util/evlist.c util/evsel.c util/evsel_fprintf.c util/perf_event_attr_fprintf.c util/cpumap.c util/memswap.c util/mmap.c util/namespaces.c ../lib/bitmap.c ../lib/find_bit.c ../lib/list_sort.c ../lib/hweight.c ../lib/string.c ../lib/vsprintf.c util/thread_map.c util/util.c util/cgroup.c util/parse-branch-options.c util/rblist.c util/counts.c util/print_binary.c util/strlist.c util/trace-event.c ../lib/rbtree.c util/string.c util/symbol_fprintf.c util/units.c util/affinity.c util/rwsem.c util/hashmap.c util/perf_regs.c util/fncache.c util/perf-regs-arch/perf_regs_aarch64.c util/perf-regs-arch/perf_regs_arm.c util/perf-regs-arch/perf_regs_csky.c util/perf-regs-arch/perf_regs_loongarch.c util/perf-regs-arch/perf_regs_mips.c util/perf-regs-arch/perf_regs_powerpc.c util/perf-regs-arch/perf_regs_riscv.c util/perf-regs-arch/perf_regs_s390.c util/perf-regs-arch/perf_regs_x86.c. Stop. make[1]: *** [Makefile.perf:242: sub-make] Error 2 make: *** [Makefile:113: install-bin] Error 2 make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf' $ I.e. only the comments were removed. If we build it on the same fedora:38 system, but using NO_LIBTRACEEVENT=1 $ make NO_LIBTRACEEVENT=1 CORESIGHT=1 O=/tmp/build/$(basename $PWD) -C tools/perf install-bin Makefile.perf:367: *** PYTHON_EXT_SRCS= util/python.c ../lib/ctype.c util/cap.c util/evlist.c util/evsel.c util/evsel_fprintf.c util/perf_event_attr_fprintf.c util/cpumap.c util/memswap.c util/mmap.c util/namespaces.c ../lib/bitmap.c ../lib/find_bit.c ../lib/list_sort.c ../lib/hweight.c ../lib/string.c ../lib/vsprintf.c util/thread_map.c util/util.c util/cgroup.c util/parse-branch-options.c util/rblist.c util/counts.c util/print_binary.c util/strlist.c ../lib/rbtree.c util/string.c util/symbol_fprintf.c util/units.c util/affinity.c util/rwsem.c util/hashmap.c util/perf_regs.c util/fncache.c util/perf-regs-arch/perf_regs_aarch64.c util/perf-regs-arch/perf_regs_arm.c util/perf-regs-arch/perf_regs_csky.c util/perf-regs-arch/perf_regs_loongarch.c util/perf-regs-arch/perf_regs_mips.c util/perf-regs-arch/perf_regs_powerpc.c util/perf-regs-arch/perf_regs_riscv.c util/perf-regs-arch/perf_regs_s390.c util/perf-regs-arch/perf_regs_x86.c. Stop. make[1]: *** [Makefile.perf:242: sub-make] Error 2 make: *** [Makefile:113: install-bin] Error 2 make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf' $ Both comments and the util/trace-event.c file removed. Signed-off-by: Arnaldo Carvalho de Melo Acked-by: Ian Rogers Link: https://lore.kernel.org/r/ZTj6mfM9UqY2DggC@kernel.org Signed-off-by: Namhyung Kim commit a6e4a4a14a8eb6376278db0d3441a2ba124cc30c Author: Namhyung Kim Date: Tue Oct 24 17:31:21 2023 -0700 perf report: Fix hierarchy mode on pipe input The hierarchy mode needs to setup output formats for each evsel. Normally setup_sorting() handles this at the beginning, but it cannot do that if data comes from a pipe since there's no evsel info before reading the data. And then perf report cannot process the samples in hierarchy mode and think as if there's no sample. Let's check the condition and setup the output formats after reading data so that it can find evsels. Before: $ ./perf record -o- true | ./perf report -i- --hierarchy -q [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] Error: The - data has no samples! After: $ ./perf record -o- true | ./perf report -i- --hierarchy -q [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] 94.76% true 94.76% [kernel.kallsyms] 94.76% [k] filemap_fault 5.24% perf-ex 5.24% [kernel.kallsyms] 5.06% [k] __memset 0.18% [k] native_write_msr Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20231025003121.2811738-1-namhyung@kernel.org Signed-off-by: Namhyung Kim commit b5711042a1c8cc88ed40a5ebf612b36e83a4e2e4 Author: Namhyung Kim Date: Fri Oct 20 13:47:41 2023 -0700 perf lock contention: Use per-cpu array map for spinlocks Currently lock contention timestamp is maintained in a hash map keyed by pid. That means it needs to get and release a map element (which is proctected by spinlock!) on each contention begin and end pair. This can impact on performance if there are a lot of contention (usually from spinlocks). It used to go with task local storage but it had an issue on memory allocation in some critical paths. Although it's addressed in recent kernels IIUC, the tool should support old kernels too. So it cannot simply switch to the task local storage at least for now. As spinlocks create lots of contention and they disabled preemption during the spinning, it can use per-cpu array to keep the timestamp to avoid overhead in hashmap update and delete. In contention_begin, it's easy to check the lock types since it can see the flags. But contention_end cannot see it. So let's try to per-cpu array first (unconditionally) if it has an active element (lock != 0). Then it should be used and per-task tstamp map should not be used until the per-cpu array element is cleared which means nested spinlock contention (if any) was finished and it nows see (the outer) lock. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Hao Luo Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231020204741.1869520-3-namhyung@kernel.org commit 6a070573f290f99a6129ac3e13b9df521a1a65de Author: Namhyung Kim Date: Fri Oct 20 13:47:40 2023 -0700 perf lock contention: Check race in tstamp elem creation When pelem is NULL, it'd create a new entry with zero data. But it might be preempted by IRQ/NMI just before calling bpf_map_update_elem() then there's a chance to call it twice for the same pid. So it'd be better to use BPF_NOEXIST flag and check the return value to prevent the race. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Hao Luo Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231020204741.1869520-2-namhyung@kernel.org commit d99317f214ca3d381f7b17a75c41263885664e06 Author: Namhyung Kim Date: Fri Oct 20 13:47:39 2023 -0700 perf lock contention: Clear lock addr after use It checks the current lock to calculated the delta of contention time. The address is saved in the tstamp map which is allocated at begining of contention and released at end of contention. But it's possible for bpf_map_delete_elem() to fail. In that case, the element in the tstamp map kept for the current lock and it makes the next contention for the same lock tracked incorrectly. Specificially the next contention begin will see the existing element for the task and it'd just return. Then the next contention end will see the element and calculate the time using the timestamp for the previous begin. This can result in a large value for two small contentions happened from time to time. Let's clear the lock address so that it can be updated next time even if the bpf_map_delete_elem() failed. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Hao Luo Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231020204741.1869520-1-namhyung@kernel.org commit e093a222d7cba1eb6c36887e58ce8a4ff249f1c6 Author: Yang Jihong Date: Mon Oct 23 03:31:44 2023 +0000 perf evsel: Rename evsel__increase_rlimit to rlimit__increase_nofile evsel__increase_rlimit() helper does nothing with evsel, and description of the functionality is inaccurate, rename it and move to util/rlimit.c. By the way, fix a checkppatch warning about misplaced license tag: WARNING: Misplaced SPDX-License-Identifier tag - use line 1 instead #160: FILE: tools/perf/util/rlimit.h:3: /* SPDX-License-Identifier: LGPL-2.1 */ No functional change. Signed-off-by: Yang Jihong Link: https://lore.kernel.org/r/20231023033144.1011896-1-yangjihong1@huawei.com Signed-off-by: Namhyung Kim commit 79a3371bdf453bedb9d2c80df5adc201dddc11b5 Author: Namhyung Kim Date: Tue Oct 17 13:23:42 2023 -0700 perf bench sched pipe: Add -G/--cgroups option The -G/--cgroups option is to put sender and receiver in different cgroups in order to measure cgroup context switch overheads. Users need to make sure the cgroups exist and accessible. The following example should the effect of this change. Please don't forget taskset before the perf bench to measure cgroup switches properly. Otherwise each task would run on a different CPU and generate cgroup switches regardless of this change. # perf stat -e context-switches,cgroup-switches \ > taskset -c 0 perf bench sched pipe -l 10000 > /dev/null Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000': 20,001 context-switches 2 cgroup-switches 0.053449651 seconds time elapsed 0.011286000 seconds user 0.041869000 seconds sys # perf stat -e context-switches,cgroup-switches \ > taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB > /dev/null Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB': 20,001 context-switches 20,001 cgroup-switches 0.052768627 seconds time elapsed 0.006284000 seconds user 0.046266000 seconds sys Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/r/20231017202342.1353124-1-namhyung@kernel.org commit cbf5f58461b25f3f3e19704e2e51ad002c11080c Author: Michael Petlan Date: Thu Oct 19 11:11:37 2023 +0200 perf test: Skip CoreSight tests if cs_etm// event is not available CoreSight might be not available, in such case, skip the tests. Signed-off-by: Michael Petlan Reviewed-by: Leo Yan Reviewed-by: Carsten Haitzler Cc: vmolnaro@redhat.com Link: https://lore.kernel.org/r/20231019091137.22525-1-mpetlan@redhat.com Signed-off-by: Namhyung Kim commit 9ce363aa009c9ec1b921e3c316cbed7639c024e0 Author: Hans de Goede Date: Tue Oct 10 12:20:29 2023 +0200 HID: logitech-hidpp: Drop HIDPP_QUIRK_UNIFYING HIDPP unifying is only checked once in probe() and it is also set by probe() itself. Drop the quirk and replace its one check by the condition which is used to set the quirk in the first place. This series has been tested on the following devices: Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0) Logitech M720 Triathlon (bluetooth, HID++ 4.5) Logitech M720 Triathlon (unifying, HID++ 4.5) Logitech K400 Pro (unifying, HID++ 4.1) Logitech K270 (eQUAD nano Lite, HID++ 2.0) Logitech M185 (eQUAD nano Lite, HID++ 4.5) Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0) Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0) And by bentiss: Logitech Touchpad T650 (unifying) Logitech Touchpad T651 (bluetooth) Logitech MX Master 3B (BLE) Logitech G403 (plain USB / Gaming receiver) Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231010102029.111003-13-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires commit f3c4ee7166f2048b88dfe3a4a9cc68a58f0abeb4 Author: Hans de Goede Date: Tue Oct 10 12:20:28 2023 +0200 HID: logitech-hidpp: Drop delayed_work_cb() Drop delayed_work_cb() instead make hidpp_connect_event() the workqueue function itself. Besides resulting in a small cleanup this will hopefully also make it clearer that going forward hidpp_connect_event() should only be run from a workqueue and not be directly invoked. This series has been tested on the following devices: Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0) Logitech M720 Triathlon (bluetooth, HID++ 4.5) Logitech M720 Triathlon (unifying, HID++ 4.5) Logitech K400 Pro (unifying, HID++ 4.1) Logitech K270 (eQUAD nano Lite, HID++ 2.0) Logitech M185 (eQUAD nano Lite, HID++ 4.5) Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0) Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0) And by bentiss: Logitech Touchpad T650 (unifying) Logitech Touchpad T651 (bluetooth) Logitech MX Master 3B (BLE) Logitech G403 (plain USB / Gaming receiver) Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231010102029.111003-12-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires commit 680ee411a98e875f0f3baba735205ced61693e67 Author: Hans de Goede Date: Tue Oct 10 12:20:27 2023 +0200 HID: logitech-hidpp: Fix connect event race There is a connect event race in hidpp_probe() in these 2 lines: connected = hidpp_root_get_protocol_version(hidpp) == 0; atomic_set(&hidpp->connected, connected); Specifically the following can happen: 1. This line from hidpp_probe() is executed: connected = hidpp_root_get_protocol_version(hidpp) == 0; and sets connected to false; 2. A connect-event packet is received and does: atomic_set(&hidpp->connected, true); 3. The next line from hidpp_probe() is executed: atomic_set(&hidpp->connected, connected); and sets the atomic_t back to 0 again. 4. hidpp_connect_event() runs and sees the connected device as disconnected because of this. To fix this make hidpp_connect_event() query the connection status of the device itself instead of having it rely on possibly stale data cached in struct hidpp_device. This series has been tested on the following devices: Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0) Logitech M720 Triathlon (bluetooth, HID++ 4.5) Logitech M720 Triathlon (unifying, HID++ 4.5) Logitech K400 Pro (unifying, HID++ 4.1) Logitech K270 (eQUAD nano Lite, HID++ 2.0) Logitech M185 (eQUAD nano Lite, HID++ 4.5) Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0) Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0) And by bentiss: Logitech Touchpad T650 (unifying) Logitech Touchpad T651 (bluetooth) Logitech MX Master 3B (BLE) Logitech G403 (plain USB / Gaming receiver) Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231010102029.111003-11-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires commit bb17b2c6dd876d2bf6ef518d440b90f2095c5ea1 Author: Hans de Goede Date: Tue Oct 10 12:20:26 2023 +0200 HID: logitech-hidpp: Remove unused connected param from *_connect() Remove the unused connected function parameter from wtp_connect(), m560_send_config_command() and k400_connect(). This is a preparation patch for moving all connected state handling to hidpp_connect_event(). This series has been tested on the following devices: Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0) Logitech M720 Triathlon (bluetooth, HID++ 4.5) Logitech M720 Triathlon (unifying, HID++ 4.5) Logitech K400 Pro (unifying, HID++ 4.1) Logitech K270 (eQUAD nano Lite, HID++ 2.0) Logitech M185 (eQUAD nano Lite, HID++ 4.5) Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0) Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0) And by bentiss: Logitech Touchpad T650 (unifying) Logitech Touchpad T651 (bluetooth) Logitech MX Master 3B (BLE) Logitech G403 (plain USB / Gaming receiver) Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231010102029.111003-10-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires commit 6f335b47adc396ed40655ab37aa9b2284c8f3783 Author: Hans de Goede Date: Tue Oct 10 12:20:25 2023 +0200 HID: logitech-hidpp: Remove connected check for non-unifying devices Non-unifying devices (USB, Bluetooth) are always connected during probe(), remove the unnecessary connected check. This is a preparation patch for moving all connected state handling to hidpp_connect_event(). This series has been tested on the following devices: Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0) Logitech M720 Triathlon (bluetooth, HID++ 4.5) Logitech M720 Triathlon (unifying, HID++ 4.5) Logitech K400 Pro (unifying, HID++ 4.1) Logitech K270 (eQUAD nano Lite, HID++ 2.0) Logitech M185 (eQUAD nano Lite, HID++ 4.5) Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0) Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0) And by bentiss: Logitech Touchpad T650 (unifying) Logitech Touchpad T651 (bluetooth) Logitech MX Master 3B (BLE) Logitech G403 (plain USB / Gaming receiver) Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231010102029.111003-9-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires commit c14f1485c60507c0db00d1ba187bafb563fae318 Author: Hans de Goede Date: Tue Oct 10 12:20:24 2023 +0200 HID: logitech-hidpp: Add hidpp_non_unifying_init() helper Turn hidpp_overwrite_name() into a hidpp_non_unifying_init() helper which takes care of setting both the name and the serial for non unifying devices. This mirrors the hidpp_unifying_init() helper for unifying devices. This series has been tested on the following devices: Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0) Logitech M720 Triathlon (bluetooth, HID++ 4.5) Logitech M720 Triathlon (unifying, HID++ 4.5) Logitech K400 Pro (unifying, HID++ 4.1) Logitech K270 (eQUAD nano Lite, HID++ 2.0) Logitech M185 (eQUAD nano Lite, HID++ 4.5) Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0) Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0) And by bentiss: Logitech Touchpad T650 (unifying) Logitech Touchpad T651 (bluetooth) Logitech MX Master 3B (BLE) Logitech G403 (plain USB / Gaming receiver) Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231010102029.111003-8-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires commit 8954dac18c681fe59855e294b133d967873e5325 Author: Hans de Goede Date: Tue Oct 10 12:20:23 2023 +0200 HID: logitech-hidpp: Move hidpp_overwrite_name() to before connect check Move the hidpp_overwrite_name() call to before the connect check, this puts it at the same place in the probe() order as hidpp_serial_init() which seems more logical. This should not make a difference since this is in the non-unifying path and only unifying devices can be probed in non-connected state. This is a preparation patch for moving all connected state handling to hidpp_connect_event(). Doing this before the connect check requires dropping the protocol version check since protocol_major is not set yet now. Instead this relies on hidpp_root_get_feature(HIDPP_PAGE_GET_DEVICE_NAME_TYPE) failing on older devices, just like how hidpp_get_serial() relies on hidpp_root_get_feature(HIDPP_PAGE_DEVICE_INFORMATION) failing on older devices. So this again makes the code more consistent. Also stop printing an error on failure now, since with the proto version check gone failures are expected to happen on older devices. This series has been tested on the following devices: Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0) Logitech M720 Triathlon (bluetooth, HID++ 4.5) Logitech M720 Triathlon (unifying, HID++ 4.5) Logitech K400 Pro (unifying, HID++ 4.1) Logitech K270 (eQUAD nano Lite, HID++ 2.0) Logitech M185 (eQUAD nano Lite, HID++ 4.5) Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0) Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0) And by bentiss: Logitech Touchpad T650 (unifying) Logitech Touchpad T651 (bluetooth) Logitech MX Master 3B (BLE) Logitech G403 (plain USB / Gaming receiver) Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231010102029.111003-7-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires commit 219ccfb60003a4b3874ddc0205588c8e925fd946 Author: Hans de Goede Date: Tue Oct 10 12:20:22 2023 +0200 HID: logitech-hidpp: Move g920_get_config() to just before hidpp_ff_init() The data retrieved by g920_get_config() is only used by hidpp_ff_init(). Now that the hw is kept open till the end of probe() the g920_get_config() call can be moved to just before hidpp_ff_init() to have all the HIDPP_QUIRK_CLASS_G920 together in a single place. This series has been tested on the following devices: Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0) Logitech M720 Triathlon (bluetooth, HID++ 4.5) Logitech M720 Triathlon (unifying, HID++ 4.5) Logitech K400 Pro (unifying, HID++ 4.1) Logitech K270 (eQUAD nano Lite, HID++ 2.0) Logitech M185 (eQUAD nano Lite, HID++ 4.5) Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0) Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0) And by bentiss: Logitech Touchpad T650 (unifying) Logitech Touchpad T651 (bluetooth) Logitech MX Master 3B (BLE) Logitech G403 (plain USB / Gaming receiver) Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231010102029.111003-6-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires commit a3643036d7a8c9c81f574b235afcc0582cce76ab Author: Hans de Goede Date: Tue Oct 10 12:20:21 2023 +0200 HID: logitech-hidpp: Remove wtp_get_config() call from probe() For WTP devices which start disconnected (paired with the unifying receiver, but not connected atm) hidpp_connect_event() takes care of calling wtp_get_config() when the device later connects. There is no need to have a separate code path for WTP devices which are connected at probe() time, these can use the same code-path since probe() will queue hidpp_connect_event() for those at probe time. Drop the unnecessary wtp_get_config() call from probe(). This series has been tested on the following devices: Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0) Logitech M720 Triathlon (bluetooth, HID++ 4.5) Logitech M720 Triathlon (unifying, HID++ 4.5) Logitech K400 Pro (unifying, HID++ 4.1) Logitech K270 (eQUAD nano Lite, HID++ 2.0) Logitech M185 (eQUAD nano Lite, HID++ 4.5) Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0) Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0) And by bentiss: Logitech Touchpad T650 (unifying) Logitech Touchpad T651 (bluetooth) Logitech MX Master 3B (BLE) Logitech G403 (plain USB / Gaming receiver) Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231010102029.111003-5-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires commit ba9de350509504fb748837b71e23d7e84c83d93c Author: Hans de Goede Date: Tue Oct 10 12:20:20 2023 +0200 HID: logitech-hidpp: Move get_wireless_feature_index() check to hidpp_connect_event() Calling get_wireless_feature_index() from probe() causes the wireless_feature_index to only get set for unifying devices which are already connected at probe() time. It does not get set for devices which connect later. Fix this by moving get_wireless_feature_index() to hidpp_connect_event(), this does not make a difference for devices connected at probe() since probe() will queue the hidpp_connect_event() for those at probe time. This series has been tested on the following devices: Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0) Logitech M720 Triathlon (bluetooth, HID++ 4.5) Logitech M720 Triathlon (unifying, HID++ 4.5) Logitech K400 Pro (unifying, HID++ 4.1) Logitech K270 (eQUAD nano Lite, HID++ 2.0) Logitech M185 (eQUAD nano Lite, HID++ 4.5) Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0) Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0) And by bentiss: Logitech Touchpad T650 (unifying) Logitech Touchpad T651 (bluetooth) Logitech MX Master 3B (BLE) Logitech G403 (plain USB / Gaming receiver) Fixes: 0da0a63b7cba ("HID: logitech-hidpp: Support WirelessDeviceStatus connect events") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231010102029.111003-4-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires commit 55bf70362ffc4ddd7c8745e2fe880edac00e4aff Author: Hans de Goede Date: Tue Oct 10 12:20:19 2023 +0200 HID: logitech-hidpp: Revert "Don't restart communication if not necessary" Commit 91cf9a98ae41 ("HID: logitech-hidpp: make .probe usbhid capable") makes hidpp_probe() first call hid_hw_start(hdev, 0) to allow IO without connecting any hid subdrivers (hid-input, hidraw). This is done to allow to retrieve the device's name and serial number and store these in hdev->name and hdev->uniq. Then later on IO was stopped and started again with hid_hw_start(hdev, HID_CONNECT_DEFAULT) connecting hid-input and hidraw after the name and serial number have been setup. Commit 498ba2069035 ("HID: logitech-hidpp: Don't restart communication if not necessary") changed the probe() code to only do the start with a 0 connect-mask + restart later for unifying devices. But for non unifying devices hdev->name and hdev->uniq are updated too. So this change re-introduces the problem for which the start with a 0 connect-mask + restart later behavior was introduced. The previous patch in this series changes the unifying path to instead of restarting IO only call hid_connect() later. This avoids possible issues with restarting IO seen on non unifying devices. Revert the change to limit the restart behavior to unifying devices to fix hdev->name changing after userspace facing devices have already been registered. This series has been tested on the following devices: Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0) Logitech M720 Triathlon (bluetooth, HID++ 4.5) Logitech M720 Triathlon (unifying, HID++ 4.5) Logitech K400 Pro (unifying, HID++ 4.1) Logitech K270 (eQUAD nano Lite, HID++ 2.0) Logitech M185 (eQUAD nano Lite, HID++ 4.5) Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0) Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0) And by bentiss: Logitech Touchpad T650 (unifying) Logitech Touchpad T651 (bluetooth) Logitech MX Master 3B (BLE) Logitech G403 (plain USB / Gaming receiver) Fixes: 498ba2069035 ("HID: logitech-hidpp: Don't restart communication if not necessary") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231010102029.111003-3-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires commit 11ca0322a41920df2b462d2e45b0731e47ff475b Author: Hans de Goede Date: Tue Oct 10 12:20:18 2023 +0200 HID: logitech-hidpp: Don't restart IO, instead defer hid_connect() only Restarting IO causes 2 problems: 1. Some devices do not like IO being restarted this was addressed in commit 498ba2069035 ("HID: logitech-hidpp: Don't restart communication if not necessary"), but that change has issues of its own and needs to be reverted. 2. Restarting IO and specifically calling hid_device_io_stop() causes received packets to be missed, which may cause connect-events to get missed. Restarting IO was introduced in commit 91cf9a98ae41 ("HID: logitech-hidpp: make .probe usbhid capable") to allow to retrieve the device's name and serial number and store these in hdev->name and hdev->uniq before connecting any hid subdrivers (hid-input, hidraw) exporting this info to userspace. But this does not require restarting IO, this merely requires deferring calling hid_connect(). Calling hid_hw_start() with a connect-mask of 0 makes it skip calling hid_connect(), so hidpp_probe() can simply call hid_connect() later without needing to restart IO. Remove the stop + restart of IO and instead just call hid_connect() later to avoid the issues caused by restarting IO. Now that IO is no longer stopped, hid_hw_close() must be called at the end of probe() to balance the hid_hw_open() done at the beginning probe(). This series has been tested on the following devices: Logitech Bluetooth Laser Travel Mouse (bluetooth, HID++ 1.0) Logitech M720 Triathlon (bluetooth, HID++ 4.5) Logitech M720 Triathlon (unifying, HID++ 4.5) Logitech K400 Pro (unifying, HID++ 4.1) Logitech K270 (eQUAD nano Lite, HID++ 2.0) Logitech M185 (eQUAD nano Lite, HID++ 4.5) Logitech LX501 keyboard (27 Mhz, HID++ builtin scroll-wheel, HID++ 1.0) Logitech M-RAZ105 mouse (27 Mhz, HID++ extra mouse buttons, HID++ 1.0) And by bentiss: Logitech Touchpad T650 (unifying) Logitech Touchpad T651 (bluetooth) Logitech MX Master 3B (BLE) Logitech G403 (plain USB / Gaming receiver) Fixes: 498ba2069035 ("HID: logitech-hidpp: Don't restart communication if not necessary") Suggested-by: Benjamin Tissoires Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231010102029.111003-2-hdegoede@redhat.com Signed-off-by: Benjamin Tissoires commit eeebfe6259ba2d5b0980eb7b0df384eb77e9e4f5 Author: Thomas Weißschuh Date: Thu Oct 12 12:23:41 2023 +0200 HID: rmi: remove #ifdef CONFIG_PM Through the usage of pm_ptr() the CONFIG_PM-dependent code will always be compiled, protecting against bitrot. The linker will then garbage-collect the unused function avoiding any overhead. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20231012-hid-pm_ptr-v1-4-0a71531ca93b@weissschuh.net Signed-off-by: Benjamin Tissoires commit fc2543414c3e9c5a0d3ac218ae93fb561a503deb Author: Thomas Weißschuh Date: Thu Oct 12 12:23:40 2023 +0200 HID: multitouch: remove #ifdef CONFIG_PM Through the usage of pm_ptr() the CONFIG_PM-dependent code will always be compiled, protecting against bitrot. The linker will then garbage-collect the unused function avoiding any overhead. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20231012-hid-pm_ptr-v1-3-0a71531ca93b@weissschuh.net Signed-off-by: Benjamin Tissoires commit f354872108ebc5558653db5ff9b8c5edf375599d Author: Thomas Weißschuh Date: Thu Oct 12 12:23:39 2023 +0200 HID: usbhid: remove #ifdef CONFIG_PM Through the usage of pm_ptr() the CONFIG_PM-dependent code will always be compiled, protecting against bitrot. The linker will then garbage-collect the unused function avoiding any overhead. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20231012-hid-pm_ptr-v1-2-0a71531ca93b@weissschuh.net Signed-off-by: Benjamin Tissoires commit df8b030d82dd1224881acb4e778fa06c4824f72b Author: Thomas Weißschuh Date: Thu Oct 12 12:23:38 2023 +0200 HID: core: remove #ifdef CONFIG_PM from hid_driver Allow HID drivers to pass ->suspend, ->resume and ->reset_resume via pm_ptr(). Through the usage of pm_ptr() the CONFIG_PM-dependent code will always be compiled, protecting against bitrot. The linker will then garbage-collect the unused function avoiding any overhead. The only overhead in the final kernel image and at runtime are a few extra bytes in 'struct hid_driver'. The same approach is chosen by 'struct usb_driver' and other subsystems. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20231012-hid-pm_ptr-v1-1-0a71531ca93b@weissschuh.net Signed-off-by: Benjamin Tissoires commit 2f2bd7cbd1d1548137b351040dc4e037d18cdfdc Author: Jamie Lentin Date: Mon Oct 2 15:09:14 2023 +0000 hid: lenovo: Resend all settings on reset_resume for compact keyboards The USB Compact Keyboard variant requires a reset_resume function to restore keyboard configuration after a suspend in some situations. Move configuration normally done on probe to lenovo_features_set_cptkbd(), then recycle this for use on reset_resume. Without, the keyboard and driver would end up in an inconsistent state, breaking middle-button scrolling amongst other problems, and twiddling sysfs values wouldn't help as the middle-button mode won't be set until the driver is reloaded. Tested on a USB and Bluetooth Thinkpad Compact Keyboard. CC: stable@vger.kernel.org Fixes: 94eefa271323 ("HID: lenovo: Use native middle-button mode for compact keyboards") Signed-off-by: Jamie Lentin Signed-off-by: Martin Kepplinger Link: https://lore.kernel.org/r/20231002150914.22101-1-martink@posteo.de Signed-off-by: Benjamin Tissoires commit b97f4dac40eecfc2fc9b818b427a8eda44cb7763 Author: Syed Saba Kareem Date: Sat Oct 21 20:20:54 2023 +0530 ASoC: amd: acp: add machine driver support for acp7.0 add machine driver support for ACP7.0 on legacy stack. Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231021145110.478744-13-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit e84db124cb2158b538820f31f641c28b86fb3ca3 Author: Syed Saba Kareem Date: Sat Oct 21 20:20:53 2023 +0530 ASoC: amd: acp: Add pci legacy driver support for acp7.0 platform Add pci legacy driver support and create platform driver for acp7.0 platform. Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231021145110.478744-12-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit caa126f2b0c821811eedf2e2fd435b11844bf0f1 Author: Syed Saba Kareem Date: Sat Oct 21 20:20:52 2023 +0530 ASoC: amd: acp: change acp power on mask macro value change acp power on mask macro value so that same macro can be used for all amd platforms. Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231021145110.478744-11-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 1b6180c095bc9a6c25e38ae1ec6481f8df20a81f Author: Syed Saba Kareem Date: Sat Oct 21 20:20:51 2023 +0530 ASoC: amd: acp: change acp-deinit function arguments acp-deinit function will not be same for all platforms. To make platform specific changes in acp-deinit function, instead of passing base address pass chip structure which contains acp_rev feild. chip->acp_rev will be used to add platform specific code in acp-deinit(). Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231021145110.478744-10-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 39d9ee47167a2210d803f651c8fdcac84f03e766 Author: Syed Saba Kareem Date: Sat Oct 21 20:20:50 2023 +0530 ASoC: amd: acp: add machine driver support for pdm use case add pdm use case machine driver support Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231021145110.478744-9-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 16fb2a25440a85708778f6442914066c98dc2f1e Author: Syed Saba Kareem Date: Sat Oct 21 20:20:49 2023 +0530 ASoC: amd: acp: add condition check for i2s clock generation for only PDM endpoint i2s master clock is not required. Add a condition check for the same based on chip flag value. Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231021145110.478744-8-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 57e857770f6021a73af85e6b201203520cb1a529 Author: Syed Saba Kareem Date: Sat Oct 21 20:20:48 2023 +0530 ASoC: amd: acp: add platform and flag data to acp data structure add name of the platform and flag data in private data structure. name of the platform will be used to differentiate platforms where as flag will be used to know what kind of endpoint configuration is selected where its legacy(I2S + PDM) or only ACP PDM. Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231021145110.478744-7-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 3a94c8ad0aae2b14a55059869871ea2d199af489 Author: Syed Saba Kareem Date: Sat Oct 21 20:20:47 2023 +0530 ASoC: amd: acp: add code for scanning acp pdm controller Add common code for scanning acp pdm controller and create platform device for the same. Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231021145110.478744-6-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit d4c2d5391d7efc29fdd59d54355526c9ace16bec Author: Syed Saba Kareem Date: Sat Oct 21 20:20:46 2023 +0530 ASoC: amd: acp: add Kconfig options for acp6.3 based platform driver ACP6.3 based platform legacy drivers can be built by selecting necessary kernel config option. This patch enables build support of the same. Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231021145110.478744-5-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 9393bfb4c4dea406dd345820a6b39b9c70a7f934 Author: Syed Saba Kareem Date: Sat Oct 21 20:20:45 2023 +0530 ASoC: amd: acp: add machine driver support for acp6.3 platform add legacy machine driver support for acp6.3 based platform. Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231021145110.478744-4-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit c7bf9156f811bcffb4201a0bf5d1b32d97ec0e5f Author: Syed Saba Kareem Date: Sat Oct 21 20:20:44 2023 +0530 ASoC: amd: acp: add i2s clock generation support for acp6.3 based platforms Add I2S LRCLK & BCLK generation code for ACP6.3 based platforms. Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231021145110.478744-3-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 40f74d5f09d7c068bd7a980dc06a688dc8d2b3e3 Author: Syed Saba Kareem Date: Sat Oct 21 20:20:43 2023 +0530 ASoC: amd: acp: refactor acp i2s clock generation code Refactor acp i2s LRCLK,BCLK generation code and move to commnon file. Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231021145110.478744-2-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit 33d120a49b970acbe465041d7b71e0cd6a1d1de0 Author: Syed Saba Kareem Date: Sat Oct 21 20:20:42 2023 +0530 ASoC: amd: acp: Add acp6.3 pci legacy driver support Add pci legacy driver support and create platform driver for acp6.3 based platforms. Signed-off-by: Syed Saba Kareem Link: https://lore.kernel.org/r/20231021145110.478744-1-Syed.SabaKareem@amd.com Signed-off-by: Mark Brown commit f5c7bc7a1fad4e1e8d3d29d71dd9f430a3350f42 Author: Su Hui Date: Fri Oct 20 17:26:20 2023 +0800 ASoC: Intel: Skylake: add an error code check in skl_pcm_trigger skl_decoupled_trigger() can return error code like -EPIPE if failed, add check for this. Signed-off-by: Su Hui Link: https://lore.kernel.org/r/20231020092619.210520-1-suhui@nfschina.com Signed-off-by: Mark Brown commit 7618ab524935667699afed76fb83bc9bb38710ec Author: Krzysztof Kozlowski Date: Thu Oct 19 16:41:08 2023 +0200 ASoC: codecs: wcd938x: use defines for entries in snd_soc_dai_driver array snd_soc_dai_driver array in wcd938x driver has two entries whose order must match order of wcd938x->sdw_priv array. The wcd938x_bind() and wcd938x_codec_set_sdw_stream() rely on this order. wcd938x->sdw_priv array is indexed by enum with AIF1_PB and AIF1_CAP, so use the same defines instead of raw numners for snd_soc_dai_driver array. No functional impact. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231019144108.42853-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit e29de7abdaf56f58141b01f74862b320191c9203 Author: Krzysztof Kozlowski Date: Tue Oct 17 18:14:29 2023 +0200 ASoC: qcom: q6apm-lpass-dais: pass max number of channels to Audioreach Using the params_channels() helper when setting hw_params, results in passing to Audioreach minimum number of channels valid for given hardware. This is not valid for any hardware which sets minimum channels to two and maximum to something bigger, like four channels. Instead pass the maximum number of supported channels to allow playback of multi-channel formats. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231017161429.431663-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 4531f512e3ef147f07d47bceb256c0af5ab130b7 Author: Nikita Travkin Date: Fri Oct 20 20:33:47 2023 +0500 ASoC: qcom: sc7180: Add support for qdsp6 baked sound Some sc7180 devices use audio adsp to play sound. The setup for this adsp is similar to the dirrect lpass usage but requires the use of different link ids and clocks. This commit adds support for the qdsp based audio, reusing the common parts like audio codec setup and jack creation. Since the setup is mostly generic and codec specific setup is guarded behind a check, a generic compatible is added, similar to other platforms. Even though those changes target Acer Aspire 1 as the only user of the adsp audio on this platform present upstream at the moment of the commit, those changes should be either dirrectly compatible or trivially expandable to the other devices that will be added in the future. Signed-off-by: Nikita Travkin Link: https://lore.kernel.org/r/20231020-sc7180-qdsp-sndcard-v1-2-157706b7d06f@trvn.ru Signed-off-by: Mark Brown commit 5443d186163c6ab0084a5b23c901e0f9ba792463 Author: Nikita Travkin Date: Fri Oct 20 20:33:46 2023 +0500 ASoC: dt-bindings: qcom,sm8250: Add sc7180-qdsp6-sndcard sc7180 can make use of the adsp-baked soundcard, add relevant compatible to the documentation. Signed-off-by: Nikita Travkin Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231020-sc7180-qdsp-sndcard-v1-1-157706b7d06f@trvn.ru Signed-off-by: Mark Brown commit 8619fd0e9026c10841e162ec403f4223fe1f3846 Author: Hans de Goede Date: Wed Oct 25 16:35:13 2023 +0200 ASoC: Intel: bytcr_wm5102: Add BYT_WM5102_IN_MAP quirk Unlike all designs supported sofar the Lenovo Yoga Tab 3 YT3-X90 does not have its internal microphone (intmic) on IN3L with the headset microphone on IN1L. Instead this tablet has the intmic on IN1L and the hsmic on IN2L. Add a BYT_WM5102_IN_MAP quirk mechanism to allow selecting between different input maps and add support for both setups with the current settings being the default map. The new INTMIC_IN1L_HSMIC_IN2L map is enabled by default on CHT because the Lenovo Yoga Tab 3 YT3-X90 model is the only Cherry Trail design currently supported. If different CHT designs turn up which need different input maps we can add DMI quirks to select a different map later. The userspace UCM profile also needs to know about this so extend the components string with this info too. Acked-by: Pierre-Louis Bossart Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231025143513.291753-5-hdegoede@redhat.com Signed-off-by: Mark Brown commit c556d202bef1b74dbfa0369bf221ccd83dfa7a59 Author: Hans de Goede Date: Wed Oct 25 16:35:12 2023 +0200 ASoC: Intel: bytcr_wm5102: Add BYT_WM5102_OUT_MAP quirk Some x86 WM5102 designs don't use the SPK pins for speaker output instead they use the HPOUT2L + HPOUT2R for the speakers. Add an BYT_WM5102_OUT_MAP quirk mechanism to allow selecting between 2 output maps, one for the speakers on the SPK output pins and one for the speakers on the HPOUT2 pins. The new HPOUT2 map is enabled by default on CHT because this is used on the Lenovo Yoga Tab 3 YT3-X90 model which is the only Cherry Trail design currently supported. If different CHT designs turn up which need different output maps we can add DMI quirks to select a different map later. The userspace UCM profile also needs to know about this so setup a components string with this info too. While at it also drop the unused "Line Out" route. Acked-by: Pierre-Louis Bossart Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231025143513.291753-4-hdegoede@redhat.com Signed-off-by: Mark Brown commit bce4b014cc215afd1eca06977dbe91a1eb63551c Author: Hans de Goede Date: Wed Oct 25 16:35:11 2023 +0200 ASoC: Intel: bytcr_wm5102: Add BYT_WM5102_MCLK_19_2MHZ quirk The Cherry Trail SoC only supports 19200000 as clk-frequency for the pmc_plt_clk used for the audio codec. Add a BYT_WM5102_MCLK_19_2MHZ quirk for this and enable this by default on Cherry Trail SoCs. Acked-by: Pierre-Louis Bossart Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231025143513.291753-3-hdegoede@redhat.com Signed-off-by: Mark Brown commit 95504218c688d286fb6bfd5f4dd394b74c80832f Author: Hans de Goede Date: Wed Oct 25 16:35:10 2023 +0200 ASoC: Intel: bytcr_wm5102: Add BYT_WM5102_SSP2 quirk Add the standard intel board file quirk mechanism also used in many other intel board drivers and add a BYT_WM5102_SSP2 quirk setting for designs using SSP2 instead of SSP0. And enable the new BYT_WM5102_SSP2 quirk on Cherry Trail devices since those always use SSP2. The logging of the quirks uses dev_info_once() because probe() may run multiple times because of snd_soc_register_card() returning -EPROBE_DEFER. Acked-by: Pierre-Louis Bossart Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231025143513.291753-2-hdegoede@redhat.com Signed-off-by: Mark Brown commit 6feb1a9641197ee630bf43b5c34ea1d9f8b4a0aa Author: Vegard Nossum Date: Sun Oct 22 20:54:46 2023 +0200 cpupower: fix reference to nonexistent document This file was renamed from .txt to .rst and left a dangling reference. Fix it. Fixes: 151f4e2bdc7a ("docs: power: convert docs to ReST and rename to *.rst") Cc: Mauro Carvalho Chehab Cc: Bjorn Helgaas Cc: Mark Brown Cc: Srivatsa S. Bhat (VMware) Cc: Srinivas Pandruvada Cc: Jacob Pan Cc: Arjan van de Ven Cc: Rafael J. Wysocki Cc: Len Brown Signed-off-by: Vegard Nossum Signed-off-by: Shuah Khan commit b8644c4ae2b646b89b40892bf93cbb6f7451c868 Author: Simon Ser Date: Mon Aug 21 13:15:56 2023 +0000 drm/doc: document DRM_IOCTL_MODE_CREATE_DUMB The main motivation is to repeat that dumb buffers should not be abused for anything else than basic software rendering with KMS. User-space devs are more likely to look at the IOCTL docs than to actively search for the driver-oriented "Dumb Buffer Objects" section. v2: reference DRM_CAP_DUMB_BUFFER, DRM_CAP_DUMB_PREFERRED_DEPTH and DRM_CAP_DUMB_PREFER_SHADOW (Pekka) Signed-off-by: Simon Ser Acked-by: Daniel Vetter Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/20230821131548.269204-1-contact@emersion.fr commit e82c175e63229ea495a0a0b5305a98b5b6ee5346 Author: Lu Baolu Date: Wed Oct 25 21:18:54 2023 +0800 Revert "iommu/vt-d: Remove unused function" This reverts commit c61c255e114c52682546447ed44d3470b5708134. The pasid_set_wpe() helper, which was removed by the reverted commit, is still used by the nesting translation support in the iommufd tree. To avoid a merge conflict, revert the commit. Link: https://lore.kernel.org/linux-kernel/20231025153455.283c5b12@canb.auug.org.au/ Signed-off-by: Lu Baolu Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20231025131854.375388-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit a0b0bad10587ae2948a7c36ca4ffc206007fbcf3 Author: Chen Yu Date: Fri Oct 20 15:25:22 2023 +0800 genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() When a CPU is about to be offlined, x86 validates that all active interrupts which are targeted to this CPU can be migrated to the remaining online CPUs. If not, the offline operation is aborted. The validation uses irq_matrix_allocated() to retrieve the number of vectors which are allocated on the outgoing CPU. The returned number of allocated vectors includes also vectors which are associated to managed interrupts. That's overaccounting because managed interrupts are: - not migrated when the affinity mask of the interrupt targets only the outgoing CPU - migrated to another CPU, but in that case the vector is already pre-allocated on the potential target CPUs and must not be taken into account. As a consequence the check whether the remaining online CPUs have enough capacity for migrating the allocated vectors from the outgoing CPU might fail incorrectly. Let irq_matrix_allocated() return only the number of allocated non-managed interrupts to make this validation check correct. [ tglx: Amend changelog and fixup kernel-doc comment ] Fixes: 2f75d9e1c905 ("genirq: Implement bitmap matrix allocator") Reported-by: Wendy Wang Signed-off-by: Chen Yu Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20231020072522.557846-1-yu.c.chen@intel.com commit 78a96c86a0ff2be546f2ecca210fde5dca30fb59 Author: Geert Uytterhoeven Date: Thu Oct 19 11:46:44 2023 +0200 Documentation: kernel-parameters: Add earlyprintk=bios on SH Document the use of the "earlyprintk=bios[,keep]" kernel parameter option on SuperH systems with a SuperH standard BIOS. Signed-off-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/febc920964f2f0919d21775132e84c5cc270177e.1697708489.git.geert+renesas@glider.be Signed-off-by: John Paul Adrian Glaubitz commit 553f7ac78fbb41b2c93ab9b9d78e42274d27daa9 Author: Geert Uytterhoeven Date: Thu Oct 19 11:46:43 2023 +0200 sh: bios: Revive earlyprintk support The SuperH BIOS earlyprintk code is protected by CONFIG_EARLY_PRINTK. However, when this protection was added, it was missed that SuperH no longer defines an EARLY_PRINTK config symbol since commit e76fe57447e88916 ("sh: Remove old early serial console code V2"), so BIOS earlyprintk can no longer be used. Fix this by reviving the EARLY_PRINTK config symbol. Fixes: d0380e6c3c0f6edb ("early_printk: consolidate random copies of identical code") Signed-off-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/c40972dfec3dcc6719808d5df388857360262878.1697708489.git.geert+renesas@glider.be Signed-off-by: John Paul Adrian Glaubitz commit 4c02add1d949890d5381789f0c374e72c193559d Author: Arnd Bergmann Date: Thu Sep 14 17:55:23 2023 +0200 sh: machvec: Remove custom ioport_{un,}map() These functions were only used on the microdev board that is now gone, so remove them to simplify the ioport handling. This could be further simplified to use the generic I/O port accessors now. Signed-off-by: Arnd Bergmann Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230914155523.3839811-4-arnd@kernel.org Signed-off-by: John Paul Adrian Glaubitz commit 8daaed76383aaae1d094d3d65d34890b2c6da24b Author: Arnd Bergmann Date: Thu Sep 14 17:55:22 2023 +0200 sh: Remove superhyway bus support The superhyway bus driver was only referenced on SH4-202, which is now gone, so remove it all as well. I could find no trace of anything ever calling superhyway_register_driver(), not in the git history but also not on the web, so I assume this has never served any purpose on mainline kernels. Signed-off-by: Arnd Bergmann Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230914155523.3839811-3-arnd@kernel.org Signed-off-by: John Paul Adrian Glaubitz commit 6c329558c1c68c56d35e451b3e7950dbe11a8ee5 Author: Arnd Bergmann Date: Thu Sep 14 17:55:21 2023 +0200 sh: Remove unused SH4-202 support This early prototype of the SH4 CPU was only used in the "microdev" board that is now removed, so all of the SH4-202 supoprt can also be removed. Signed-off-by: Arnd Bergmann Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230914155523.3839811-2-arnd@kernel.org Signed-off-by: John Paul Adrian Glaubitz commit 3ca64d0669b467e951d6020f154a7fd8810db35b Author: Arnd Bergmann Date: Thu Sep 14 17:55:20 2023 +0200 sh: Remove stale microdev board This board was an early prototype platform for early SH4 CPUs and related to the already removed SH5 cayman platform. The microdev board itself has been kept in the tree for this long despite being in a bad shape even 20 years ago when it got merged, with no working PCI support and ugly workarounds for its I/O port implementation that try to emulate PC style peripheral access despite being quite different in reality. As far as I can tell, the ethernet, display, USB and PCI devices on it already broke at some point (afbb9d8d5266b, 46bc85872040a), so I think we can just removeit entirely. Link: https://lore.kernel.org/lkml/09094baf-dadf-4bce-9f63-f2a1f255f9a8@app.fastmail.com/ Signed-off-by: Arnd Bergmann Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/20230914155523.3839811-1-arnd@kernel.org Signed-off-by: John Paul Adrian Glaubitz commit aad36cd32982d59470de6365f97f154c5af5d1d2 Author: Jakub Kicinski Date: Wed Oct 25 07:22:37 2023 -0700 Revert "Merge branch 'mv88e6xxx-dsa-bindings'" This reverts the following commits: commit 53313ed25ba8 ("dt-bindings: marvell: Add Marvell MV88E6060 DSA schema") commit 0f35369b4efe ("dt-bindings: marvell: Rewrite MV88E6xxx in schema") commit 605a5f5d406d ("ARM64: dts: marvell: Fix some common switch mistakes") commit bfedd8423643 ("ARM: dts: nxp: Fix some common switch mistakes") commit 2b83557a588f ("ARM: dts: marvell: Fix some common switch mistakes") commit ddae07ce9bb3 ("dt-bindings: net: mvusb: Fix up DSA example") commit b5ef61718ad7 ("dt-bindings: net: dsa: Require ports or ethernet-ports") As repoted by Vladimir, it breaks boot on the Turris MOX board. Link: https://lore.kernel.org/all/20231025093632.fb2qdtunzaznd73z@skbuf/ Signed-off-by: Jakub Kicinski commit d45f72b3c275101a620dd69881343e0dda72f877 Author: Jinjie Ruan Date: Mon Oct 9 14:42:45 2023 +0800 HID: uclogic: Fix a work->entry not empty bug in __queue_work() When CONFIG_HID_UCLOGIC=y and CONFIG_KUNIT_ALL_TESTS=y, launch kernel and then the below work->entry not empty bug occurs. In hid_test_uclogic_exec_event_hook_test(), the filter->work is not initialized to be added to p.event_hooks->list, and then the schedule_work() in uclogic_exec_event_hook() will call __queue_work(), which check whether the work->entry is empty and cause the below warning call trace. So call INIT_WORK() with a fake work to solve the issue. After applying this patch, the below work->entry not empty bug never occurs. WARNING: CPU: 0 PID: 2177 at kernel/workqueue.c:1787 __queue_work.part.0+0x780/0xad0 Modules linked in: CPU: 0 PID: 2177 Comm: kunit_try_catch Tainted: G B W N 6.6.0-rc2+ #30 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 RIP: 0010:__queue_work.part.0+0x780/0xad0 Code: 44 24 20 0f b6 00 84 c0 74 08 3c 03 0f 8e 52 03 00 00 f6 83 00 01 00 00 02 74 6f 4c 89 ef e8 c7 d8 f1 02 f3 90 e9 e5 f8 ff ff <0f> 0b e9 63 fc ff ff 89 e9 49 8d 57 68 4c 89 e6 4c 89 ff 83 c9 02 RSP: 0000:ffff888102bb7ce8 EFLAGS: 00010086 RAX: 0000000000000000 RBX: ffff888106b8e460 RCX: ffffffff84141cc7 RDX: 1ffff11020d71c8c RSI: 0000000000000004 RDI: ffff8881001d0118 RBP: dffffc0000000000 R08: 0000000000000001 R09: ffffed1020576f92 R10: 0000000000000003 R11: ffff888102bb7980 R12: ffff888106b8e458 R13: ffff888119c38800 R14: 0000000000000000 R15: ffff8881001d0100 FS: 0000000000000000(0000) GS:ffff888119c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff888119506000 CR3: 0000000005286001 CR4: 0000000000770ef0 DR0: ffffffff8fdd6ce0 DR1: ffffffff8fdd6ce1 DR2: ffffffff8fdd6ce3 DR3: ffffffff8fdd6ce5 DR6: 00000000fffe0ff0 DR7: 0000000000000600 PKRU: 55555554 Call Trace: ? __warn+0xc9/0x260 ? __queue_work.part.0+0x780/0xad0 ? report_bug+0x345/0x400 ? handle_bug+0x3c/0x70 ? exc_invalid_op+0x14/0x40 ? asm_exc_invalid_op+0x16/0x20 ? _raw_spin_lock+0x87/0xe0 ? __queue_work.part.0+0x780/0xad0 ? __queue_work.part.0+0x249/0xad0 queue_work_on+0x48/0x50 uclogic_exec_event_hook.isra.0+0xf7/0x160 hid_test_uclogic_exec_event_hook_test+0x2f1/0x5d0 ? try_to_wake_up+0x151/0x13e0 ? uclogic_exec_event_hook.isra.0+0x160/0x160 ? _raw_spin_lock_irqsave+0x8d/0xe0 ? __sched_text_end+0xa/0xa ? __sched_text_end+0xa/0xa ? migrate_enable+0x260/0x260 ? kunit_try_run_case_cleanup+0xe0/0xe0 kunit_generic_run_threadfn_adapter+0x4a/0x90 ? kunit_try_catch_throw+0x80/0x80 kthread+0x2b5/0x380 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x2d/0x70 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork_asm+0x11/0x20 Fixes: a251d6576d2a ("HID: uclogic: Handle wireless device reconnection") Signed-off-by: Jinjie Ruan Reviewed-by: José Expósito Link: https://lore.kernel.org/r/20231009064245.3573397-3-ruanjinjie@huawei.com Signed-off-by: Benjamin Tissoires commit 91cfe0bbaa1c434d4271eb6e1d7aaa1fe8d121f6 Author: Jinjie Ruan Date: Mon Oct 9 14:42:44 2023 +0800 HID: uclogic: Fix user-memory-access bug in uclogic_params_ugee_v2_init_event_hooks() When CONFIG_HID_UCLOGIC=y and CONFIG_KUNIT_ALL_TESTS=y, launch kernel and then the below user-memory-access bug occurs. In hid_test_uclogic_params_cleanup_event_hooks(),it call uclogic_params_ugee_v2_init_event_hooks() with the first arg=NULL, so when it calls uclogic_params_ugee_v2_has_battery(), the hid_get_drvdata() will access hdev->dev with hdev=NULL, which will cause below user-memory-access. So add a fake_device with quirks member and call hid_set_drvdata() to assign hdev->dev->driver_data which avoids the null-ptr-def bug for drvdata->quirks in uclogic_params_ugee_v2_has_battery(). After applying this patch, the below user-memory-access bug never occurs. general protection fault, probably for non-canonical address 0xdffffc0000000329: 0000 [#1] PREEMPT SMP KASAN KASAN: probably user-memory-access in range [0x0000000000001948-0x000000000000194f] CPU: 5 PID: 2189 Comm: kunit_try_catch Tainted: G B W N 6.6.0-rc2+ #30 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 RIP: 0010:uclogic_params_ugee_v2_init_event_hooks+0x87/0x600 Code: f3 f3 65 48 8b 14 25 28 00 00 00 48 89 54 24 60 31 d2 48 89 fa c7 44 24 30 00 00 00 00 48 c7 44 24 28 02 f8 02 01 48 c1 ea 03 <80> 3c 02 00 0f 85 2c 04 00 00 48 8b 9d 48 19 00 00 48 b8 00 00 00 RSP: 0000:ffff88810679fc88 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000000004 RCX: 0000000000000000 RDX: 0000000000000329 RSI: ffff88810679fd88 RDI: 0000000000001948 RBP: 0000000000000000 R08: 0000000000000000 R09: ffffed1020f639f0 R10: ffff888107b1cf87 R11: 0000000000000400 R12: 1ffff11020cf3f92 R13: ffff88810679fd88 R14: ffff888100b97b08 R15: ffff8881030bb080 FS: 0000000000000000(0000) GS:ffff888119e80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000005286001 CR4: 0000000000770ee0 DR0: ffffffff8fdd6cf4 DR1: ffffffff8fdd6cf5 DR2: ffffffff8fdd6cf6 DR3: ffffffff8fdd6cf7 DR6: 00000000fffe0ff0 DR7: 0000000000000600 PKRU: 55555554 Call Trace: ? die_addr+0x3d/0xa0 ? exc_general_protection+0x144/0x220 ? asm_exc_general_protection+0x22/0x30 ? uclogic_params_ugee_v2_init_event_hooks+0x87/0x600 ? sched_clock_cpu+0x69/0x550 ? uclogic_parse_ugee_v2_desc_gen_params+0x70/0x70 ? load_balance+0x2950/0x2950 ? rcu_trc_cmpxchg_need_qs+0x67/0xa0 hid_test_uclogic_params_cleanup_event_hooks+0x9e/0x1a0 ? uclogic_params_ugee_v2_init_event_hooks+0x600/0x600 ? __switch_to+0x5cf/0xe60 ? migrate_enable+0x260/0x260 ? __kthread_parkme+0x83/0x150 ? kunit_try_run_case_cleanup+0xe0/0xe0 kunit_generic_run_threadfn_adapter+0x4a/0x90 ? kunit_try_catch_throw+0x80/0x80 kthread+0x2b5/0x380 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x2d/0x70 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork_asm+0x11/0x20 Modules linked in: Dumping ftrace buffer: (ftrace buffer empty) ---[ end trace 0000000000000000 ]--- RIP: 0010:uclogic_params_ugee_v2_init_event_hooks+0x87/0x600 Code: f3 f3 65 48 8b 14 25 28 00 00 00 48 89 54 24 60 31 d2 48 89 fa c7 44 24 30 00 00 00 00 48 c7 44 24 28 02 f8 02 01 48 c1 ea 03 <80> 3c 02 00 0f 85 2c 04 00 00 48 8b 9d 48 19 00 00 48 b8 00 00 00 RSP: 0000:ffff88810679fc88 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000000004 RCX: 0000000000000000 RDX: 0000000000000329 RSI: ffff88810679fd88 RDI: 0000000000001948 RBP: 0000000000000000 R08: 0000000000000000 R09: ffffed1020f639f0 R10: ffff888107b1cf87 R11: 0000000000000400 R12: 1ffff11020cf3f92 R13: ffff88810679fd88 R14: ffff888100b97b08 R15: ffff8881030bb080 FS: 0000000000000000(0000) GS:ffff888119e80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000005286001 CR4: 0000000000770ee0 DR0: ffffffff8fdd6cf4 DR1: ffffffff8fdd6cf5 DR2: ffffffff8fdd6cf6 DR3: ffffffff8fdd6cf7 DR6: 00000000fffe0ff0 DR7: 0000000000000600 PKRU: 55555554 Kernel panic - not syncing: Fatal exception Dumping ftrace buffer: (ftrace buffer empty) Kernel Offset: disabled Rebooting in 1 seconds.. Fixes: a251d6576d2a ("HID: uclogic: Handle wireless device reconnection") Signed-off-by: Jinjie Ruan Reviewed-by: José Expósito Link: https://lore.kernel.org/r/20231009064245.3573397-2-ruanjinjie@huawei.com Signed-off-by: Benjamin Tissoires commit 550087a0ba91eb001c139f563a193b1e9ef5a8dd Author: Thomas Huth Date: Wed Oct 25 09:38:02 2023 +0200 hexagon: Remove unusable symbols from the ptrace.h uapi Kernel-internal prototypes, references to current_thread_info() and code hidden behind a CONFIG_HEXAGON_ARCH_VERSION switch are certainly not usable in userspace, so this should not reside in a uapi header. Move the code into an internal version of ptrace.h instead. Signed-off-by: Thomas Huth Signed-off-by: Arnd Bergmann commit 8519f9c3c3992d6634d4cd82cce2b4ed0158a412 Merge: 80957adc47fdd cc3b17cabe9fd Author: Arnd Bergmann Date: Wed Oct 25 15:28:49 2023 +0200 Merge tag 'mvebu-arm-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into soc/drivers mvebu arm for 6.7 (part 1) Fix missing of_node_put in dove code base * tag 'mvebu-arm-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: soc: dove: add missing of_node_put Link: https://lore.kernel.org/r/87zg0e8w4v.fsf@BL-laptop Signed-off-by: Arnd Bergmann commit 80957adc47fddda469daef4c96225fd73a0d9831 Merge: f1243fcea5a3f 3aeb0d3694e16 Author: Arnd Bergmann Date: Wed Oct 25 15:26:42 2023 +0200 Merge tag 'ti-driver-soc-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into soc/drivers TI SoC driver updates for v6.7 - Generic fixups: Convert to platform remove callback returning void - ti_sci: Minor fixups and mark driver as non-removable - k3-socinfo: Documentation fixups, cosmetic fixups - knav_qmss_queue: Optimize with device_get_match_data Signed-off-by: Nishanth Menon * tag 'ti-driver-soc-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: soc: ti: k3-socinfo: Avoid overriding return value soc: ti: k3-socinfo: Fix typo in bitfield documentation soc: ti: knav_qmss_queue: Use device_get_match_data() firmware: ti_sci: Use device_get_match_data() soc/ti: wkup_m3_ipc: Convert to platform remove callback returning void soc/ti: smartreflex: Convert to platform remove callback returning void soc/ti: pruss: Convert to platform remove callback returning void soc/ti: pm33xx: Convert to platform remove callback returning void soc/ti: knav_qmss_queue: Convert to platform remove callback returning void soc/ti: knav_dma: Convert to platform remove callback returning void soc/ti: k3-ringacc: Convert to platform remove callback returning void firmware: ti_sci: Mark driver as non removable firmware: ti_sci: refactor deprecated strncpy firmware: ti_sci: Use list_for_each_entry() helper Link: https://lore.kernel.org/r/20231018165226.33x5cjn5jmgnm3di@magnolia Signed-off-by: Arnd Bergmann commit dc3115e6c5d9863ec1a9ff1acf004ede93c34361 Author: Danny Kaehn Date: Wed Oct 11 13:23:17 2023 -0500 hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip Previously cp2112_gpio_irq_shutdown() always cancelled the gpio_poll_worker, even if other IRQs were still active, and did not set the gpio_poll flag to false. This resulted in any call to _shutdown() resulting in interrupts no longer functioning on the chip until a _remove() occurred (a.e. the cp2112 is unplugged or system rebooted). Only cancel polling if all IRQs are disabled/masked, and correctly set the gpio_poll flag, allowing polling to restart when an interrupt is next enabled. Signed-off-by: Danny Kaehn Fixes: 13de9cca514e ("HID: cp2112: add IRQ chip handling") Link: https://lore.kernel.org/r/20231011182317.1053344-1-danny.kaehn@plexus.com Signed-off-by: Benjamin Tissoires commit 991a211aa99f468cd291a97b8dcb448ebc77f6c4 Author: Justin Stitt Date: Mon Oct 23 19:24:38 2023 +0000 s390/cio: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect both `params` and `id` to be NUL-terminated based on their usage with format strings: format_node_data(iuparams, iunodeid, &lir->incident_node); format_node_data(auparams, aunodeid, &lir->attached_node); switch (lir->iq.class) { case LIR_IQ_CLASS_DEGRADED: pr_warn("Link degraded: RS=%02x RSID=%04x IC=%02x " "IUPARAMS=%s IUNODEID=%s AUPARAMS=%s AUNODEID=%s\n", sei_area->rs, sei_area->rsid, lir->ic, iuparams, iunodeid, auparams, aunodeid); NUL-padding is not required as both `params` and `id` have been memset to 0: memset(params, 0, PARAMS_LEN); memset(id, 0, NODEID_LEN); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Note that there's no overread bugs in the current implementation as the string literal "n/a" has a size much smaller than PARAMS_LEN or NODEID_LEN. Nonetheless, let's favor strscpy(). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Vineeth Vijayan Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231023-strncpy-drivers-s390-cio-chsc-c-v1-1-8b76a7b83260@google.com Signed-off-by: Vasily Gorbik commit e37988bcd1fddb726cf08e4f04a1b8dc4a2f80aa Author: Justin Stitt Date: Mon Oct 23 19:14:49 2023 +0000 s390/sclp: replace deprecated strncpy with strtomem Let's move away from using strncpy() as it is deprecated [1]. Instead use strtomem() as `e.id` is already marked as nonstring: | char id[4] __nonstring; We don't need strtomem_pad() because `e` is already memset to 0 -- rendering any additional NUL-padding useless. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231023-strncpy-drivers-s390-char-sclp-c-v1-1-eaeef80522bb@google.com Signed-off-by: Vasily Gorbik commit e78002aa9a5a9eaf18bc29ccaef7f405616fd68e Author: Peter Oberparleiter Date: Fri Aug 18 15:14:02 2023 +0200 s390/cio: fix virtual vs physical address confusion Fix virtual vs physical address confusion (which currently are the same). Reviewed-by: Vineeth Vijayan Signed-off-by: Peter Oberparleiter Signed-off-by: Vasily Gorbik commit f48781d220ee6bb59816383237bf0abd1c65c493 Author: Peter Oberparleiter Date: Fri Aug 18 15:11:18 2023 +0200 s390/cio: export CMG value as decimal Change format of the "cmg" sysfs attribute from hex to decimal to make it easier to consume. Note that this should not break any existing users since only values 2 and 3 are currently exported. Also the main user already assumes decimal notation [1]. [1] https://sourceforge.net/p/sblim/gather/ci/master/tree/plugin/metriczCH.c Reviewed-by: Vineeth Vijayan Signed-off-by: Peter Oberparleiter Signed-off-by: Vasily Gorbik commit f139a7a2f88190ef28162d3e485324bab8a4e12e Author: Ilya Leoshkevich Date: Mon Jul 31 17:07:02 2023 +0200 s390: delete the unused store_prefix() function Its last usage was deleted in commit 4df29d2b9024 ("s390/smp: rework absolute lowcore access"). Reviewed-by: Alexander Gordeev Signed-off-by: Ilya Leoshkevich Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 84bb41d5df48868055d159d9247b80927f1f70f9 Author: Heiko Carstens Date: Tue Oct 24 10:15:20 2023 +0200 s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir If the cmma no-dat feature is available the kernel page tables are walked to identify and mark all pages which are used for address translation (all region, segment, and page tables). In a subsequent loop all other pages are marked as "no-dat" pages with the ESSA instruction. This information is visible to the hypervisor, so that the hypervisor can optimize purging of guest TLB entries. All pages used for swapper_pg_dir and invalid_pg_dir are incorrectly marked as no-dat, which in turn can result in incorrect guest TLB flushes. Fix this by marking those pages correctly as being used for DAT. Cc: Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 44d93045247661acbd50b1629e62f415f2747577 Author: Heiko Carstens Date: Tue Oct 24 10:15:19 2023 +0200 s390/cmma: fix detection of DAT pages If the cmma no-dat feature is available the kernel page tables are walked to identify and mark all pages which are used for address translation (all region, segment, and page tables). In a subsequent loop all other pages are marked as "no-dat" pages with the ESSA instruction. This information is visible to the hypervisor, so that the hypervisor can optimize purging of guest TLB entries. The initial loop however is incorrect: only the first three of the four pages which belong to segment and region tables will be marked as being used for DAT. The last page is incorrectly marked as no-dat. This can result in incorrect guest TLB flushes. Fix this by simply marking all four pages. Cc: Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit e3f4170ccf20ebe2985b8e166184dd2d54220b60 Author: Sumanth Korikkar Date: Fri Sep 29 19:12:04 2023 +0200 s390/sclp: handle default case in sclp memory notifier When new memory notifier types are added in common code and unimplemented on s390, return success instead of EINVAL return code. This prevents breakage when new memory notifier types are added. Reviewed-by: Heiko Carstens Signed-off-by: Sumanth Korikkar Signed-off-by: Vasily Gorbik commit aecd5a37b5ef4de4f6402dc079672e4243cc4c13 Author: Thomas Richter Date: Wed Oct 18 11:53:52 2023 +0200 s390/pai_crypto: remove per-cpu variable assignement in event initialization Function paicrypt_event_init() initializes the PMU device driver specific details for an event. It is called once per event creation. The function paicrypt_event_init() is not necessarily executed on that CPU the event will be used for. When an event is activated, function paicrypt_start() is used to start the event on that CPU. The per CPU data structure struct paicrypt_map has a pointer to the event which is active for a particular CPU. This pointer is set in function paicrypt_start() to point to the currently installed event. There is no need to also set this pointer in function paicrypt_event_init() where is might be assigned to the wrong CPU. Therefore remove this assignment in paicrypt_event_init(). Acked-by: Sumanth Korikkar Signed-off-by: Thomas Richter Signed-off-by: Vasily Gorbik commit b286997e83dcf7b498329a66a8a22fc8a5bf50f0 Author: Thomas Richter Date: Wed Oct 11 12:09:30 2023 +0200 s390/pai: initialize event count once at initialization Event count value is initialized and set to zero in function paicrypt_start(). This function is called once per CPU when an event is started on that CPU. This leads to event count value being set to zero as many times as there are online CPUs. This is not necessary. The event count value is bound to the event and it is sufficient to initialize the event counter once at event creation time. This is done when the event structure is dynamicly allocated with __GFP_ZERO flag. This sets member count to zero. Acked-by: Sumanth Korikkar Signed-off-by: Thomas Richter Signed-off-by: Vasily Gorbik commit a13e8bdf0f788552aa37e1f9a6fe5fcca4095d2b Author: Thomas Richter Date: Tue Oct 10 16:14:22 2023 +0200 s390/pai_crypto: use PERF_ATTACH_TASK define for per task detection Use define PERF_ATTACH_TASK bit in event->attach_state to determine system wide invocation or per task invocation in event initialization. This bit is set in common code and before calling PMU device driver specific event initialization. It is set once and never changes. It is save to use and also in sync with other PMU specific code. No functional change. Acked-by: Sumanth Korikkar Signed-off-by: Thomas Richter Signed-off-by: Vasily Gorbik commit 1954da4a2b621a3328a63382cae7e5f5e2af502c Author: Heiko Carstens Date: Fri Oct 20 17:26:50 2023 +0200 s390/mm: add missing arch_set_page_dat() call to gmap allocations If the cmma no-dat feature is available all pages that are not used for dynamic address translation are marked as "no-dat" with the ESSA instruction. This information is visible to the hypervisor, so that the hypervisor can optimize purging of guest TLB entries. This also means that pages which are used for dynamic address translation must not be marked as "no-dat", since the hypervisor may then incorrectly not purge guest TLB entries. Region, segment, and page tables allocated within the gmap code are incorrectly marked as "no-dat", since an explicit call to arch_set_page_dat() is missing, which would remove the "no-dat" mark. In order to fix this add a new gmap_alloc_crst() function which should be used to allocate region and segment tables, and which also calls arch_set_page_dat(). Also add the arch_set_page_dat() call to page_table_alloc_pgste(). Cc: Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit af6664668de9867c539ff64742a45ca68c586803 Merge: 05d3ef8bba77c 8f0cd531ee18c Author: Rafael J. Wysocki Date: Wed Oct 25 14:46:34 2023 +0200 Merge tag 'devfreq-next-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux Merge devfreq updates for v6.7 from Chanwoo Choi: " Detailed description for this pull request: 1. Update devfreq core - Switch to dev_pm_opp_find_freq_(ceil/floor)_indexed() APIs to support the specific device like UFS which handle the multiple clocks through OPP (Operationg Performance Point) framework. 2. Update the devfreq / devfreq-event drivers - Add perf support to the Rockchip DFI(DDR Monitor Module) devfreq-event driver. : Generalize rockchip-dfi.c to support new RK3568/RK3588 using different DDR type. : Covert devicetree bidning document format to yaml. : DFI is a unit which is suitable for measuring DDR utilization for the DDR frequency scaling driver. Add perf support feature to rockchip-dfi.c to extend DFI usage. The perf support has been tested on a RK3568 and a RK3399. - Protect the OPP handling code in critical section because the voltage of shared OPP might be changed by multiple drivers on Mediatek CCI devfreq driver. - Use device_get_match_data() on Samsung Exynos PPMU devfreq-event driver." * tag 'devfreq-next-for-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux: (26 commits) dt-bindings: devfreq: event: rockchip,dfi: Add rk3588 support dt-bindings: devfreq: event: rockchip,dfi: Add rk3568 support dt-bindings: devfreq: event: convert Rockchip DFI binding to yaml PM / devfreq: rockchip-dfi: add support for RK3588 PM / devfreq: rockchip-dfi: account for multiple DDRMON_CTRL registers PM / devfreq: rockchip-dfi: make register stride SoC specific PM / devfreq: rockchip-dfi: Add perf support PM / devfreq: rockchip-dfi: give variable a better name PM / devfreq: rockchip-dfi: Prepare for multiple users PM / devfreq: rockchip-dfi: Pass private data struct to internal functions PM / devfreq: rockchip-dfi: Handle LPDDR4X PM / devfreq: rockchip-dfi: Handle LPDDR2 correctly PM / devfreq: rockchip-dfi: Add RK3568 support PM / devfreq: rockchip-dfi: Clean up DDR type register defines PM / devfreq: rk3399_dmc,dfi: generalize DDRTYPE defines PM / devfreq: rockchip-dfi: introduce channel mask PM / devfreq: rockchip-dfi: Use free running counter PM / devfreq: mediatek: unlock on error in mtk_ccifreq_target() PM / devfreq: exynos-ppmu: Use device_get_match_data() PM / devfreq: rockchip-dfi: dfi store raw values in counter struct ... commit 067e61399d3d514239eebcb119a2c57b1cd2d3b2 Merge: 05d3ef8bba77c 35e0964e4876c Author: Rafael J. Wysocki Date: Wed Oct 25 14:44:46 2023 +0200 Merge tag 'opp-updates-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Merge OPP (operating performance points) updates for 6.7 from Viresh Kumar: "- Extend support for the opp-level beyond required-opps (Ulf Hansson). - Add dev_pm_opp_find_level_floor() (Krishna chaitanya chundru). - dt-bindings: Allow opp-peak-kBpsfor kryo CPUs, support Qualcomm Krait SoCs and document named opp-microvolt property (Bjorn Andersson, Dmitry Baryshkov and Christian Marangi). - Fix -Wunsequenced warning (Nathan Chancellor). - General cleanup (Viresh Kumar)." * tag 'opp-updates-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: dt-bindings: opp: opp-v2-kryo-cpu: Document named opp-microvolt property OPP: No need to defer probe from _opp_attach_genpd() OPP: Remove genpd_virt_dev_lock OPP: Reorder code in _opp_set_required_opps_genpd() OPP: Add _link_required_opps() to avoid code duplication OPP: Fix formatting of if/else block dt-bindings: opp: opp-v2-kryo-cpu: support Qualcomm Krait SoCs OPP: Fix -Wunsequenced in _of_add_opp_table_v1() dt-bindings: opp: opp-v2-kryo-cpu: Allow opp-peak-kBps OPP: debugfs: Fix warning with W=1 builds OPP: Remove doc style comments for internal routines OPP: Add dev_pm_opp_find_level_floor() OPP: Extend support for the opp-level beyond required-opps OPP: Switch to use dev_pm_domain_set_performance_state() OPP: Extend dev_pm_opp_data with a level OPP: Add dev_pm_opp_add_dynamic() to allow more flexibility PM: domains: Implement the ->set_performance_state() callback for genpd PM: domains: Introduce dev_pm_domain_set_performance_state() commit ecb6f1f456144e9ade5a492192287decbeef4cfe Author: Oleksij Rempel Date: Wed Oct 25 10:46:12 2023 +0200 regulator: fixed: add support for under-voltage IRQ Add interrupt support for under-voltage notification. This functionality can be used on systems capable to detect under-voltage state and having enough capacity to let the SoC do some emergency preparation. This change enforce default policy to shutdown system as soon as interrupt is triggered. Signed-off-by: Oleksij Rempel Link: https://lore.kernel.org/r/20231025084614.3092295-6-o.rempel@pengutronix.de Signed-off-by: Mark Brown commit 0ab1dc9c657f30434ca55a3dcc87e624af0b2116 Author: Oleksij Rempel Date: Wed Oct 25 10:46:10 2023 +0200 regulator: dt-bindings: fixed-regulator: Add under-voltage interrupt support Add under-voltage interrupt support. This can be used with simple regulators having no other way to communicate an under-voltage event except as by toggling some GPIO line. Signed-off-by: Oleksij Rempel Link: https://lore.kernel.org/r/20231025084614.3092295-4-o.rempel@pengutronix.de Signed-off-by: Mark Brown commit 607218deac6e29c52f4ce521ed467a0d75090a0d Merge: 8aa49284f3673 9618efe343ead Author: Rafael J. Wysocki Date: Wed Oct 25 14:41:10 2023 +0200 Merge tag 'thermal-v6.7-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux Merge thermal control (ARM drivers mostly) updates for 6.7-rc1 from Daniel Lezcano: "- Add support for Mediatek LVTS MT8192 driver along with the suspend/resume routines (Balsam Chihi) - Fix probe for THERMAL_V2 for the Mediatek LVTS driver (Markus Schneider-Pargmann) - Remove duplicate error message in the max76620 driver when thermal_of_zone_register() fails as the sub routine already show one (Thierry Reding) - Add i.MX7D compatible bindings to fix a warning from dtbs_check for the imx6ul platform (Alexander Stein) - Add sa8775p compatible for the QCom tsens driver (Priyansh Jain) - Fix error check in lvts_debugfs_init() which is checking against NULL instead of PTR_ERR() on the LVTS Mediatek driver (Minjie Du) - Remove unused variable in the thermal/tools (Kuan-Wei Chiu) - Document the imx8dl thermal sensor (Fabio Estevam) - Add variable names in callback prototypes to prevent warning from checkpatch.pl for the imx8mm driver (Bragatheswaran Manickavel) - Add missing unevaluatedProperties on child node schemas for tegra124 (Rob Herring) - Add mt7988 support for the Mediatek LVTS driver (Frank Wunderlich)" * tag 'thermal-v6.7-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: thermal/qcom/tsens: Drop ops_v0_1 thermal/drivers/mediatek/lvts_thermal: Update calibration data documentation thermal/drivers/mediatek/lvts_thermal: Add mt8192 support thermal/drivers/mediatek/lvts_thermal: Add suspend and resume dt-bindings: thermal: mediatek: Add LVTS thermal controller definition for mt8192 thermal/drivers/mediatek: Fix probe for THERMAL_V2 thermal/drivers/max77620: Remove duplicate error message dt-bindings: timer: add imx7d compatible dt-bindings: net: microchip: Allow nvmem-cell usage dt-bindings: imx-thermal: Add #thermal-sensor-cells property dt-bindings: thermal: tsens: Add sa8775p compatible thermal/drivers/mediatek/lvts_thermal: Fix error check in lvts_debugfs_init() tools/thermal: Remove unused 'mds' and 'nrhandler' variables dt-bindings: thermal: fsl,scu-thermal: Document imx8dl thermal/drivers/imx8mm_thermal: Fix function pointer declaration by adding identifier name dt-bindings: thermal: nvidia,tegra124-soctherm: Add missing unevaluatedProperties on child node schemas thermal/drivers/mediatek/lvts_thermal: Add mt7988 support thermal/drivers/mediatek/lvts_thermal: Make coeff configurable dt-bindings: thermal: mediatek: Add LVTS thermal sensors for mt7988 dt-bindings: thermal: mediatek: Add mt7988 lvts compatible commit 8ade6cc7e26175529474690fdbc1965901ec2024 Author: Weidong Wang Date: Wed Oct 25 19:26:25 2023 +0800 ASoC: codecs: Add aw88399 amplifier driver Add i2c and amplifier registration for aw88399 and their associated operation functions. Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20231025112625.959587-4-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit 725f3b967a507c515c5b14b4103840d22c217ef7 Author: Weidong Wang Date: Wed Oct 25 19:26:24 2023 +0800 ASoC: codecs: Add code for bin parsing compatible with aw88399 Add aw88399 compatible code to the aw88395_lib.c file so that it can parse aw88399's bin file. Reviewed-by: Herve Codina Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20231025112625.959587-3-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit debd9fa7bf17251c44a01ac1536d97566df45ca6 Author: Weidong Wang Date: Wed Oct 25 19:26:23 2023 +0800 ASoC: dt-bindings: Add schema for "awinic,aw88399" Add the awinic,aw88399 property to the awinic,aw88395.yaml file. Signed-off-by: Weidong Wang Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231025112625.959587-2-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit 7c35584899ff4ba8c60a65ec7cf8af4e661911a9 Merge: ea167a7fc2426 038ef0d990a0a Author: Rafael J. Wysocki Date: Wed Oct 25 14:37:01 2023 +0200 Merge tag 'cpufreq-arm-updates-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Merge ARM cpufreq updates for 6.7 from Viresh Kumar: "- Add support for several Qualcomm SoC versions and other similar changes (Christian Marangi, Dmitry Baryshkov, Luca Weiss, Neil Armstrong, Richard Acayan, Robert Marko, Rohit Agarwal, Stephan Gerhold and Varadarajan Narayanan). - Cleanups to the tegra cpufreq driver (Sumit Gupta). - Use of_property_read_reg() to parse "reg" in pmac32 driver (Rob Herring). - Add support for TI's am62p5 Soc (Bryan Brattlof). - Make ARM_BRCMSTB_AVS_CPUFREQ depends on !ARM_SCMI_CPUFREQ (Florian Fainelli). - Update Kconfig to mention i.MX7 as well (Alexander Stein)." * tag 'cpufreq-arm-updates-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: (25 commits) dt-bindings: cpufreq: qcom-hw: document SM8650 CPUFREQ Hardware cpufreq: arm: Kconfig: Add i.MX7 to supported SoC for ARM_IMX_CPUFREQ_DT cpufreq: qcom-nvmem: add support for IPQ8064 cpufreq: qcom-nvmem: also accept operating-points-v2-krait-cpu cpufreq: qcom-nvmem: drop pvs_ver for format a fuses dt-bindings: cpufreq: qcom-cpufreq-nvmem: Document krait-cpu cpufreq: qcom-nvmem: add support for IPQ6018 dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ6018 cpufreq: qcom-nvmem: Add MSM8909 cpufreq: qcom-nvmem: Simplify driver data allocation dt-bindings: cpufreq: cpufreq-qcom-hw: Add SDX75 compatible cpufreq: ARM_BRCMSTB_AVS_CPUFREQ cannot be used with ARM_SCMI_CPUFREQ cpufreq: ti-cpufreq: Add opp support for am62p5 SoCs cpufreq: dt-platdev: add am62p5 to blocklist cpufreq: tegra194: remove redundant AND with cpu_online_mask cpufreq: tegra194: use refclk delta based loop instead of udelay cpufreq: tegra194: save CPU data to avoid repeated SMP calls dt-bindings: cpufreq: cpufreq-qcom-hw: add SDM670 compatible dt-bindings: cpufreq: qcom-nvmem: Document MSM8909 cpufreq: dt: platdev: Add MSM8909 to blocklist ... commit 6fdba3db14802f9ba0e427a9429560b22192798e Author: Raag Jadav Date: Tue Oct 24 11:50:18 2023 +0530 perf: arm_cspmu: use acpi_dev_hid_uid_match() for matching _HID and _UID Convert manual _UID references to use the standard ACPI helpers. Signed-off-by: Raag Jadav Reviewed-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki commit ae094de38e430e921437ffd56adb89b09ddeb65d Author: Umang Jain Date: Wed Oct 25 02:07:17 2023 -0400 staging: vc04_services: Use %p4cc format modifier to print FourCC codes Drop VCHIQ_FOURCC_AS_4CHARS macro in favour of %p4cc format modifier to print FourCC codes in the logs. vchiq_use_internal() and vchiq_release_internal() uses entity character-array to store a transient string that contains a FourCC code. Increase the length of entity array(to 64 bytes) since %p4cc requires more bytes to hold the output characters. Suggested-by: Kieran Bingham Signed-off-by: Umang Jain Link: https://lore.kernel.org/r/20231025060717.71895-2-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit b640e8f5a15074c79096999226832c6defcbb4bf Author: Umang Jain Date: Tue Oct 24 07:44:28 2023 -0400 staging: vc04_services: Drop log level mechanisms Drop the log level remnants since the logs are now ported to use dynamic logging. Drop macros, externs and global variables which were used in the log level mechanisms along with debugfs log entries. Signed-off-by: Umang Jain Link: https://lore.kernel.org/r/20231024114428.443528-9-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit c1d7fd5f67253e9aac71cb6d7da222dfe43fd9aa Author: Umang Jain Date: Tue Oct 24 07:44:27 2023 -0400 staging: vc04_services: Drop VCHIQ_LOG_PREFIX macro The macro is not used anymore, so drop it. Signed-off-by: Umang Jain Link: https://lore.kernel.org/r/20231024114428.443528-8-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 9748de55a37ee331f33e9c77b9e24025c99156f6 Author: Umang Jain Date: Tue Oct 24 07:44:26 2023 -0400 staging: vc04: Convert vchiq_log_trace() to use dynamic debug Move vchiq_log_trace() custom logging wrapper based on printk to use dynamic debug. The log category is dictated by enum vchiq_log_category which will become the part of the trace string format that will be logged to dynamic debug (for grep). All the vchiq_log_trace() calls are adjusted to use the modified wrapper. Signed-off-by: Umang Jain Link: https://lore.kernel.org/r/20231024114428.443528-7-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit f67af5940d6d2e9a9fbc5893cf1e16bae166d9ff Author: Umang Jain Date: Tue Oct 24 07:44:25 2023 -0400 staging: vc04: Convert(and rename) vchiq_log_info() to use dynamic debug Convert(and rename) vchiq_log_info() custom logging wrapping based on printk to use dynamic debug. The wrapper is now renamed to vchiq_log_debug() since most of the usage is around printing debug information. The log category is dictated by enum vchiq_log_category which will become the part of the debug string format that will be logged to dynamic debug (for grep). All the vchiq_log_info() calls are adjusted to use the modified wrapper vchiq_log_debug(). The existing custom logging for vchiq_log_info() also tries to log trace messages using SRVTRACE_LEVEL. This is simply moved to use the vchiq_log_debug() directly. Signed-off-by: Umang Jain Link: https://lore.kernel.org/r/20231024114428.443528-6-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 0b12086306d0563c897a2abc103a044f82088468 Author: Umang Jain Date: Tue Oct 24 07:44:24 2023 -0400 staging: vc04: Convert vchiq_log_warning() to use dynamic debug Move vchiq_log_warning() custom logging wrapper based on printk to use dynamic debug. The log category is dictated by vchiq_log_category which will become the part of the warning string format that will be logged to dynamic debug (for grep). All the vchiq_log_warning() calls are adjusted to use the modified wrapper. While at that, remove the extraneous "----" from few of the warning string text. Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/20231024114428.443528-5-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 1d8915cf889932e085880f4bdbf7ae0f3d8605e5 Author: Umang Jain Date: Tue Oct 24 07:44:23 2023 -0400 staging: vc04: Convert vchiq_log_error() to use dynamic debug Move vchiq_log_error() custom logging wrapper based on printk, to use dynamic debug. To categorise, enum vchiq_log_category has been introduced, which will become the part of the error string format that will be logged to dynamic debug (for grep). All the vchiq_log_error() calls are adjusted to use the dynamic debug wrapper. vchiq_loud_error_*() has been removed as a part of this patch and replaced with dev_err (so that they directly end up in kernel log, even if dynamic debug isn't enabled), which serves the purpose. Signed-off-by: Umang Jain Link: https://lore.kernel.org/r/20231024114428.443528-4-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 33bdf010685806033821045acd17fce9ea5055f2 Author: Umang Jain Date: Tue Oct 24 07:44:22 2023 -0400 staging: vc04_services: Pass struct device to vchiq_init_slots() Pass struct device pointer to vchiq_init_slots(). In subsequent commits, vchiq_log_* macros will be ported to use dynamic debug (dev_dbg()), hence they need access to a struct device pointer. No functional changes intended in this commit. Signed-off-by: Umang Jain Link: https://lore.kernel.org/r/20231024114428.443528-3-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 17dd991a81001af0f732053b80993cf8c3718fd0 Author: Umang Jain Date: Tue Oct 24 07:44:21 2023 -0400 staging: vc04_services: Pass struct device to vchiq_log_dump_mem() Pass struct device pointer to vchiq_log_dump_mem(). In subsequent commits, vchiq_log_* macros will be ported to use dynamic debug (dev_dbg()), hence they need access to a struct device pointer. No functional changes intended in this commit. Signed-off-by: Umang Jain Link: https://lore.kernel.org/r/20231024114428.443528-2-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit e26511f672432417cc1286e00bc65ab82012f5af Author: Michael Straube Date: Mon Oct 23 11:00:01 2023 +0200 staging: vme_user: prefer strscpy over strcpy Using strcpy has potential for buffer overflows. It should be replaced with strscpy where possible. In this case the return value of strcpy is not used, so we can safely replace it with strscpy. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20231023090001.7273-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5e3441ebe93c82f85e582eed8e34eb7eee541e7e Author: Philipp Hortmann Date: Mon Oct 23 08:40:43 2023 +0200 staging: rtl8192e: Remove unused variables TClasProc and TClasNum Remove unused variables to shorten code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/04ce3eaaaf3897a22dcb95ce2f449658199770d8.1698042685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0f920ffb0bc25a27cb2b5fcaea1934adc5e7bb13 Author: Philipp Hortmann Date: Mon Oct 23 08:40:36 2023 +0200 staging: rtl8192e: Remove unused union qos_tclas Remove union qos_tclas as it is just set to 0 and never used. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/7e4d32fe7a1219a9131ce49308f68790e07fb83e.1698042685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3590786a714d59f70aaf35aef673e15cece44f55 Author: Philipp Hortmann Date: Mon Oct 23 08:40:31 2023 +0200 staging: rtl8192e: Remove last three parameters of MakeTSEntry() Remove last three parameters of MakeTSEntry() as those are always Null or 0. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/ebcd7eaeba89bdc4f19053681b98fd1b8cce5aaf.1698042685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 53561277c8878df5d29562712b76b14924fb4c4d Author: Philipp Hortmann Date: Mon Oct 23 08:40:23 2023 +0200 staging: rtl8192e: Remove unused struct acm Remove unused struct acm to shorten code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/5cc31651cbf63e11c4172b4e42274dd862a7c310.1698042685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit b04885e7b9c5b130cb78b87f1f4117d3928fba21 Author: Philipp Hortmann Date: Mon Oct 23 08:40:18 2023 +0200 staging: rtl8192e: Replace union qos_tsinfo with embedded struct Replace union qos_tsinfo with embedded struct as it has only one element. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/3bedc504ad678332e4ab2a3d99f2a94ab5aed03a.1698042685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 64cc56bacb428902d1e883dbd359451d4b584419 Author: Philipp Hortmann Date: Mon Oct 23 08:40:10 2023 +0200 staging: rtl8192e: Replace union tspec_body including embedded struct Replace union tspec_body including embedded struct with embedded union as it has only one element. This will increase readability of the code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/be3e7cc62c2cdce652c24d3d3dbf7651b6ca71bc.1698042685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6e4b8282dd9e12a2de3aeb62492061ee6ea2ced7 Author: Philipp Hortmann Date: Mon Oct 23 08:40:04 2023 +0200 staging: rtl8192e: Remove unused variables from union tspec_body Remove unused variables to shorten code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/ffeb86f15454ec17d7fc2ce66151393b6757d0a7.1698042685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit cbc045bbd49aafe8b5cdfcd03661a70cea34db85 Author: Philipp Hortmann Date: Mon Oct 23 08:39:57 2023 +0200 staging: rtl8192e: Remove written but unevaluated variable ucUP Remove variable ucUP as its value is written but never evaluated. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/724cf398d27f74cb7e0f290e1a8e55ed67dffcc3.1698042685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit a50c4bfa42531a4915d564b106d5932a954e5983 Author: Philipp Hortmann Date: Mon Oct 23 08:39:47 2023 +0200 staging: rtl8192e: Remove unused variables ucReserved and friends Remove unused variables ucReserved, ucSchedule, ucTSInfoAckPolicy, ucPSB, ucAggregation, ucAccessPolicy, ucTrafficType and charData. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/4edfbe350e05649d1f6028777dcadb15af25238c.1698042685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 86dbdd2934594604534caf313f695fc99f68950f Author: Philipp Hortmann Date: Mon Oct 23 08:39:41 2023 +0200 staging: rtl8192e: Replace BIT10 to BIT31 with BIT(10) to BIT(31) Replace custom macros BIT10 to BIT31 with standard kernel macros BIT(10) to BIT(31) to shorten code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/294ff1d0b92a474a9ae0d48a54a9f99f14008053.1698042685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit fba47d8923d0a6f9ed29fadcc74bcb4bf4bcada8 Author: Philipp Hortmann Date: Mon Oct 23 08:39:33 2023 +0200 staging: rtl8192e: Replace BIT0 to BIT9 with BIT(0) to BIT(9) Replace custom macros BIT0 to BIT9 with standard kernel macros BIT(0) to BIT(9) to shorten code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/07e7de26d364d0781e41892d5738e1b6b93faf53.1698042685.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 39a5d0d1d41c16526cd81463dba1be6846dbeb40 Author: Nandha Kumar Singaram Date: Sun Oct 22 05:22:11 2023 -0700 staging: greybus: bootrom: fixed prefer using ftrace warning Adhere to linux coding style. Reported by checkpatch.pl: WARNING: Unnecessary ftrace-like logging - prefer using ftrace Signed-off-by: Nandha Kumar Singaram Link: https://lore.kernel.org/r/39be7bb04ce1362b00aa31a638ebe2e88dd81fec.1697976302.git.nandhakumar.singaram@gmail.com Signed-off-by: Greg Kroah-Hartman commit 559dd2a2a459d32a6795a639eabfa4f802bbfcfd Author: Nandha Kumar Singaram Date: Sun Oct 22 05:18:01 2023 -0700 staging: greybus: camera: Modify lines end with a '(' Adhere to linux coding style. Reported by checkpatch.pl: CHECK: Lines should not end with a '(' Signed-off-by: Nandha Kumar Singaram Link: https://lore.kernel.org/r/5f63b332c83f5f0e95f59e673b0292c27fecb411.1697976302.git.nandhakumar.singaram@gmail.com Signed-off-by: Greg Kroah-Hartman commit f2bb7d33c2072c4178d3e5d01db47d04afb546de Author: Nandha Kumar Singaram Date: Sun Oct 22 05:15:57 2023 -0700 staging: greybus: camera: Alignment should match open parenthesis Adhere to linux coding style. Reported by checkpatch.pl: CHECK: Alignment should match open parenthesis Signed-off-by: Nandha Kumar Singaram Link: https://lore.kernel.org/r/d2630a16ff9eca40b03dcade63c197fdd5e5b78f.1697976302.git.nandhakumar.singaram@gmail.com Signed-off-by: Greg Kroah-Hartman commit f59065401602f06dc5c5364284f3be30d52002ae Author: Kalle Valo Date: Mon Oct 23 19:41:20 2023 +0300 Revert "wifi: ath11k: call ath11k_mac_fils_discovery() without condition" This reverts commit e149353e6562f3e3246f75dfc4cca6a0cc5b4efc. The commit caused QCA6390 hw2.0 firmware WLAN.HST.1.0.1-05266-QCAHSTSWPLZ_V2_TO_X86-1 to crash during disconnect: [71990.787525] ath11k_pci 0000:72:00.0: firmware crashed: MHI_CB_EE_RDDM Closes: https://lore.kernel.org/all/87edhu3550.fsf@kernel.org/ Signed-off-by: Kalle Valo Reviewed-by: Jeff Johnson Link: https://lore.kernel.org/r/20231023164120.651151-1-kvalo@kernel.org commit 9ef118152ee032b374590014f98d1c0b79300a65 Author: Jeff Johnson Date: Thu Oct 19 09:57:50 2023 -0700 wifi: ath12k: Introduce and use ath12k_sta_to_arsta() Currently, the logic to return an ath12k_sta pointer, given a ieee80211_sta pointer, uses typecasting throughout the driver. In general, conversion functions are preferable to typecasting since using a conversion function allows the compiler to validate the types of both the input and output parameters. ath12k already defines a conversion function ath12k_vif_to_arvif() for a similar conversion. So introduce ath12k_sta_to_arsta() for this use case, and convert all of the existing typecasting to use this function. Signed-off-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231019-upstream-ath12k_sta_to_arsta-v1-1-06f06f693338@quicinc.com commit 038ef0d990a0a5fbc2024084f51e8af7d9bc95a2 Author: Neil Armstrong Date: Wed Oct 25 10:27:44 2023 +0200 dt-bindings: cpufreq: qcom-hw: document SM8650 CPUFREQ Hardware Document the CPUFREQ Hardware on the SM8650 Platform. Signed-off-by: Neil Armstrong Signed-off-by: Viresh Kumar commit 9e3254ff645d805b52355ebff75ca21885f2c78a Author: Alexander Stein Date: Mon Oct 23 11:47:01 2023 +0200 cpufreq: arm: Kconfig: Add i.MX7 to supported SoC for ARM_IMX_CPUFREQ_DT Since commit a5a9dffcc903 ("ARM: imx: Switch imx7d to imx-cpufreq-dt for speed-grading") i.MX7 uses this driver as well. Add it to the description text. Signed-off-by: Alexander Stein Signed-off-by: Viresh Kumar commit 4a3754f73ef48518a98c3c3a5e0edb9b605740cf Author: Christian Marangi Date: Wed Oct 25 15:04:27 2023 +0530 cpufreq: qcom-nvmem: add support for IPQ8064 IPQ8064 comes in 3 families: * IPQ8062 up to 1.0GHz * IPQ8064/IPQ8066/IPQ8068 up to 1.4GHz * IPQ8065/IPQ8069 up to 1.7Ghz So, in order to be able to support one OPP table, add support for IPQ8064 family based of SMEM SoC ID-s and correctly set the version so opp-supported-hw can be correctly used. Bit are set with the following logic: * IPQ8062 BIT 0 * IPQ8064/IPQ8066/IPQ8068 BIT 1 * IPQ8065/IPQ8069 BIT 2 speed is never fused, only pvs values are fused. IPQ806x SoC doesn't have pvs_version so we drop and we use the new pattern: opp-microvolt-speed0-pvs Example: - for ipq8062 psv2 opp-microvolt-speed0-pvs2 = < 925000 878750 971250> Fixes: a8811ec764f9 ("cpufreq: qcom: Add support for krait based socs") Signed-off-by: Christian Marangi [ Viresh: Fixed rebase conflict. ] Signed-off-by: Viresh Kumar commit ff63282ed2271d242baaa2026cd8acb0c0b990ff Author: Dmitry Baryshkov Date: Thu Oct 19 12:50:09 2023 +0200 cpufreq: qcom-nvmem: also accept operating-points-v2-krait-cpu the qcom-cpufreq-nvmem driver attempts to support both Qualcomm Kryo (newer 64-bit ARMv8 cores) and Krait (older 32-bit ARMv7 cores). It makes no sense to use 'operating-points-v2-kryo-cpu' compatibility node for the Krait cores. Add support for 'operating-points-v2-krait-cpu' compatibility string. Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Signed-off-by: Christian Marangi Signed-off-by: Viresh Kumar commit a243a1ed7b4a410b588404592b2028e0cbed8d48 Author: Dmitry Baryshkov Date: Thu Oct 19 12:50:08 2023 +0200 cpufreq: qcom-nvmem: drop pvs_ver for format a fuses The fuses used on msm8960 / apq8064 / ipq806x families of devices do not have the pvs version. Drop this argument from parsing function. Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Signed-off-by: Christian Marangi Signed-off-by: Viresh Kumar commit 7f6aa81d68376741ea216f4fe59e5509107116bc Author: Christian Marangi Date: Fri Oct 13 19:38:51 2023 +0200 dt-bindings: cpufreq: qcom-cpufreq-nvmem: Document krait-cpu Document newly introduced operating-points-v2-krait-cpu compatible to the list of accepted compatible for opp-v2-kryo-cpu nodes. Signed-off-by: Christian Marangi Acked-by: Rob Herring Signed-off-by: Viresh Kumar commit 47e161a7873b0891f4e01a69a839f6161d816ea8 Author: Robert Marko Date: Wed Oct 25 14:57:57 2023 +0530 cpufreq: qcom-nvmem: add support for IPQ6018 IPQ6018 SoC series comes in multiple SKU-s, and not all of them support high frequency OPP points. SoC itself does however have a single bit in QFPROM to indicate the CPU speed-bin. That bit is used to indicate frequency limit of 1.5GHz, but that alone is not enough as IPQ6000 only goes up to 1.2GHz, but SMEM ID can be used to limit it further. IPQ6018 compatible is blacklisted from DT platdev as the cpufreq device will get created by NVMEM CPUFreq driver. Signed-off-by: Robert Marko [ Viresh: Fixed rebase conflict. ] Signed-off-by: Viresh Kumar commit 6afc57ea315e0f660b1f870a681737bb7b71faef Author: Johan Hovold Date: Thu Oct 19 13:36:50 2023 +0200 wifi: ath12k: fix htt mlo-offset event locking The ath12k active pdevs are protected by RCU but the htt mlo-offset event handling code calling ath12k_mac_get_ar_by_pdev_id() was not marked as a read-side critical section. Mark the code in question as an RCU read-side critical section to avoid any potential use-after-free issues. Compile tested only. Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Cc: stable@vger.kernel.org # v6.2 Signed-off-by: Johan Hovold Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231019113650.9060-3-johan+linaro@kernel.org commit 69bd216e049349886405b1c87a55dce3d35d1ba7 Author: Johan Hovold Date: Thu Oct 19 13:36:49 2023 +0200 wifi: ath12k: fix dfs-radar and temperature event locking The ath12k active pdevs are protected by RCU but the DFS-radar and temperature event handling code calling ath12k_mac_get_ar_by_pdev_id() was not marked as a read-side critical section. Mark the code in question as RCU read-side critical sections to avoid any potential use-after-free issues. Note that the temperature event handler looks like a place holder currently but would still trigger an RCU lockdep splat. Compile tested only. Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Cc: stable@vger.kernel.org # v6.2 Signed-off-by: Johan Hovold Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231019113650.9060-2-johan+linaro@kernel.org commit 1dea3c0720a146bd7193969f2847ccfed5be2221 Author: Johan Hovold Date: Thu Oct 19 17:53:42 2023 +0200 wifi: ath11k: fix gtk offload status event locking The ath11k active pdevs are protected by RCU but the gtk offload status event handling code calling ath11k_mac_get_arvif_by_vdev_id() was not marked as a read-side critical section. Mark the code in question as an RCU read-side critical section to avoid any potential use-after-free issues. Compile tested only. Fixes: a16d9b50cfba ("ath11k: support GTK rekey offload") Cc: stable@vger.kernel.org # 5.18 Cc: Carl Huang Signed-off-by: Johan Hovold Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231019155342.31631-1-johan+linaro@kernel.org commit 3f77c7d605b29df277d77e9ee75d96e7ad145d2d Author: Johan Hovold Date: Thu Oct 19 13:25:21 2023 +0200 wifi: ath11k: fix htt pktlog locking The ath11k active pdevs are protected by RCU but the htt pktlog handling code calling ath11k_mac_get_ar_by_pdev_id() was not marked as a read-side critical section. Mark the code in question as an RCU read-side critical section to avoid any potential use-after-free issues. Compile tested only. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Cc: stable@vger.kernel.org # 5.6 Signed-off-by: Johan Hovold Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231019112521.2071-1-johan+linaro@kernel.org commit 3b6c14833165f689cc5928574ebafe52bbce5f1e Author: Johan Hovold Date: Thu Oct 19 17:31:15 2023 +0200 wifi: ath11k: fix dfs radar event locking The ath11k active pdevs are protected by RCU but the DFS radar event handling code calling ath11k_mac_get_ar_by_pdev_id() was not marked as a read-side critical section. Mark the code in question as an RCU read-side critical section to avoid any potential use-after-free issues. Compile tested only. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Cc: stable@vger.kernel.org # 5.6 Acked-by: Jeff Johnson Signed-off-by: Johan Hovold Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231019153115.26401-3-johan+linaro@kernel.org commit 1a5352a81b4720ba43d9c899974e3bddf7ce0ce8 Author: Johan Hovold Date: Thu Oct 19 17:31:14 2023 +0200 wifi: ath11k: fix temperature event locking The ath11k active pdevs are protected by RCU but the temperature event handling code calling ath11k_mac_get_ar_by_pdev_id() was not marked as a read-side critical section as reported by RCU lockdep: ============================= WARNING: suspicious RCU usage 6.6.0-rc6 #7 Not tainted ----------------------------- drivers/net/wireless/ath/ath11k/mac.c:638 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 no locks held by swapper/0/0. ... Call trace: ... lockdep_rcu_suspicious+0x16c/0x22c ath11k_mac_get_ar_by_pdev_id+0x194/0x1b0 [ath11k] ath11k_wmi_tlv_op_rx+0xa84/0x2c1c [ath11k] ath11k_htc_rx_completion_handler+0x388/0x510 [ath11k] Mark the code in question as an RCU read-side critical section to avoid any potential use-after-free issues. Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Fixes: a41d10348b01 ("ath11k: add thermal sensor device support") Cc: stable@vger.kernel.org # 5.7 Signed-off-by: Johan Hovold Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231019153115.26401-2-johan+linaro@kernel.org commit cda8607e824b8f4f1e5f26fef17736c8be4358f8 Author: Karthikeyan Periyasamy Date: Wed Oct 18 21:00:08 2023 +0530 wifi: ath12k: rename the sc naming convention to ab In PCI and HAL interface layer module, the identifier sc is used to represent an instance of ath12k_base structure. However, within ath12k, the convention is to use "ab" to represent an SoC "base" struct. So change the all instances of sc to ab. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00125-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Periyasamy Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231018153008.29820-3-quic_periyasa@quicinc.com commit 25ebf4c3c1416b271ab9f1f674f719910128943c Author: Karthikeyan Periyasamy Date: Wed Oct 18 21:00:07 2023 +0530 wifi: ath12k: rename the wmi_sc naming convention to wmi_ab In WMI layer module, the identifier wmi_sc is used to represent an instance of ath12k_wmi_base structure. However, within ath12k, the convention is to use "ab" to represent an SoC "base" struct. So change the all instances of wmi_sc to wmi_ab. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00125-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Periyasamy Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231018153008.29820-2-quic_periyasa@quicinc.com commit 7db88b962f06a52af5e9a32971012e8f3427cec0 Author: Anilkumar Kolli Date: Wed Oct 18 11:37:06 2023 +0300 wifi: ath11k: add firmware-2.bin support Firmware IE containers can dynamically provide various information what firmware supports. Also it can embed more than one image so updating firmware is easy, user just needs to update one file in /lib/firmware/. The firmware API 2 or higher will use the IE container format, the current API 1 will not use the new format but it still is supported for some time. Firmware API 2 files are named as firmware-2.bin (which contains both amss.bin and m3.bin images) and API 1 files are amss.bin and m3.bin. Currently ath11k PCI driver provides firmware binary (amss.bin) path to MHI driver, MHI driver reads firmware from filesystem and boots it. Add provision to read firmware files from ath11k driver and provide the amss.bin firmware data and size to MHI using a pointer. Currently enum ath11k_fw_features is empty, the patches adding features will add the flags. With AHB devices there's no amss.bin or m3.bin, so no changes in how AHB firmware files are used. But AHB devices can use future additions to the meta data, for example in enum ath11k_fw_features. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.9 Co-developed-by: P Praneesh Signed-off-by: P Praneesh Signed-off-by: Anilkumar Kolli Co-developed-by: Kalle Valo Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230727100430.3603551-4-kvalo@kernel.org commit b49381d3de3af1b84b4b1f08eda301b8befb4b05 Author: Kalle Valo Date: Wed Oct 18 11:37:06 2023 +0300 wifi: ath11k: qmi: refactor ath11k_qmi_m3_load() Simple refactoring to make it easier to add firmware-2.bin support in the following patch. Earlier ath11k_qmi_m3_load() supported changing m3.bin contents while ath11k is running. But that's not going to actually work, m3.bin is supposed to be the same during the lifetime of ath11k, for example we don't support changing the firmware capabilities on the fly. Due to this ath11k requests m3.bin firmware file first and only then checks m3_mem->vaddr, so we are basically requesting the firmware file even if it's not needed. Reverse the code so that m3_mem buffer is checked first, and only if it doesn't exist, then m3.bin is requested from user space. Checking for m3_mem->size is redundant when m3_mem->vaddr is NULL, we would not be able to use the buffer in that case. So remove the check for size. Simplify the exit handling and use 'goto out'. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.9 Signed-off-by: Kalle Valo Reviewed-by: Jeff Johnson Link: https://lore.kernel.org/r/20230727100430.3603551-3-kvalo@kernel.org commit ac9bc85c49ffcfca8c1b117e1a9e94dd32680c68 Author: Armin Wolf Date: Fri Oct 20 23:10:05 2023 +0200 platform/x86: wmi: Decouple WMI device removal from wmi_block_list Use device_for_each_child_reverse() to find and unregister WMI devices belonging to a WMI bus device instead of iterating thru the entire wmi_block_list. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20231020211005.38216-6-W_Armin@gmx.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit eba9ac7abab91c8f6d351460239108bef5e7a0b6 Author: Armin Wolf Date: Fri Oct 20 23:10:04 2023 +0200 platform/x86: wmi: Fix opening of char device Since commit fa1f68db6ca7 ("drivers: misc: pass miscdevice pointer via file private data"), the miscdevice stores a pointer to itself inside filp->private_data, which means that private_data will not be NULL when wmi_char_open() is called. This might cause memory corruption should wmi_char_open() be unable to find its driver, something which can happen when the associated WMI device is deleted in wmi_free_devices(). Fix the problem by using the miscdevice pointer to retrieve the WMI device data associated with a char device using container_of(). This also avoids wmi_char_open() picking a wrong WMI device bound to a driver with the same name as the original driver. Fixes: 44b6b7661132 ("platform/x86: wmi: create userspace interface for drivers") Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20231020211005.38216-5-W_Armin@gmx.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit ed85891a276edaf7a867de0e9acd0837bc3008f2 Author: Armin Wolf Date: Fri Oct 20 23:10:03 2023 +0200 platform/x86: wmi: Fix probe failure when failing to register WMI devices When a WMI device besides the first one somehow fails to register, retval is returned while still containing a negative error code. This causes the ACPI device fail to probe, leaving behind zombie WMI devices leading to various errors later. Handle the single error path separately and return 0 unconditionally after trying to register all WMI devices to solve the issue. Also continue to register WMI devices even if some fail to allocate memory. Fixes: 6ee50aaa9a20 ("platform/x86: wmi: Instantiate all devices before adding them") Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20231020211005.38216-4-W_Armin@gmx.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 7444f8347487df8d898fbc022249942806c80fc9 Author: Armin Wolf Date: Fri Oct 20 23:10:02 2023 +0200 platform/x86: wmi: Fix refcounting of WMI devices in legacy functions Until now, legacy GUID-based functions where using find_guid() when searching for WMI devices, which did no refcounting on the returned WMI device. This meant that the WMI device could disappear at any moment, potentially leading to various errors. Fix this by using bus_find_device() which returns an actual reference to the found WMI device. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20231020211005.38216-3-W_Armin@gmx.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 4186a47dbfbce2f97b0c025a7eac32bb5130df05 Author: Armin Wolf Date: Fri Oct 20 23:10:01 2023 +0200 platform/x86: wmi: Decouple probe deferring from wmi_block_list Many aggregate WMI drivers do not use -EPROBE_DEFER when they cannot find a WMI device during probe, instead they require all WMI devices associated with an platform device to become available at once. This is currently achieved by adding those WMI devices to the wmi_block_list before they are registered, which is then used by the deprecated GUID-based functions to search for WMI devices. Replace this approach with a device link which defers probing of the WMI device until the associated platform device has finished probing (and has registered all WMI devices). New aggregate WMI drivers should not rely on this behaviour. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20231020211005.38216-2-W_Armin@gmx.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit d0110443cf4a15267322f84210007943f5b01ae0 Author: Bragatheswaran Manickavel Date: Tue Oct 24 23:50:51 2023 +0530 amd/pds_core: core: No need for Null pointer check before kfree kfree()/vfree() internally perform NULL check on the pointer handed to it and take no action if it indeed is NULL. Hence there is no need for a pre-check of the memory pointer before handing it to kfree()/vfree(). Issue reported by ifnullfree.cocci Coccinelle semantic patch script. Signed-off-by: Bragatheswaran Manickavel Reviewed-by: Shannon Nelson Reviewed-by: Wojciech Drewek Signed-off-by: David S. Miller commit 02a258ac3ebf8a530d340ec24a694c13ac9d25c0 Author: Armin Wolf Date: Thu Oct 19 15:51:22 2023 +0200 platform/x86/amd/hsmp: Fix iomem handling Since the metrics table is marked as io memory, use memcpy_fromio() when copying its contents. Compile-tested only. Fixes: 5150542b8ec5 ("platform/x86/amd/hsmp: add support for metrics tbl") Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20231019135122.21774-1-W_Armin@gmx.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 858bd78c9d324781217bb42a87766ca9194809ca Author: Hans de Goede Date: Sat Oct 21 11:48:41 2023 +0200 platform/x86: asus-wmi: Do not report brightness up/down keys when also reported by acpi_video For a long time now the acpi_video driver reports evdev brightness up/down key events for the brightness hotkeys on most (non ancient) laptops. asus-wmi also reports evdev brightness up/down key events for these keys leading to each press being reported twice and e.g. GNOME increasing the brightness by 2 steps instead of 1 step. Use the acpi_video_handles_brightness_key_presses() helper to detect if acpi_video is reporting brightness key-presses and if it is then don't report the same events also from the asus-wmi driver. Note there is a chance that this may lead to regressions where the brightness hotkeys stop working because they are not actually reported by the acpi_video driver. Unfortunately the only way to find out if this is a problem is to try. To at least avoid regressions on old hw using the eeepc-wmi driver, implement this as a key filter in asus-nb-wmi so that the eeepc-wmi driver is not affected. Reported-by: James John Closes: https://lore.kernel.org/platform-driver-x86/a2c441fe-457e-44cf-a146-0ecd86b037cf@donjajo.com/ Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231021094841.7419-1-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 61450abfc98f9edc983b381164f559faa1c22ae6 Merge: 70f06c115bcca 53313ed25ba89 Author: David S. Miller Date: Wed Oct 25 10:28:00 2023 +0100 Merge branch 'mv88e6xxx-dsa-bindings' Linus Walleij says: ==================== Create a binding for the Marvell MV88E6xxx DSA switches The Marvell switches are lacking DT bindings. I need proper schema checking to add LED support to the Marvell switch. Just how it is, it can't go on like this. Some Device Tree fixes are included in the series, these remove the major and most annoying warnings fallout noise: some warnings remain, and these are of more serious nature, such as missing phy-mode. They can be applied individually, or to the networking tree with the rest of the patches. Thanks to Andrew Lunn, Vladimir Oltean and Russell King for excellent review and feedback! --- Changes in v7: - Fix the elaborate spacing to satisfy yamllint in the ports/ethernet-ports requirement. - Link to v6: https://lore.kernel.org/r/20231024-marvell-88e6152-wan-led-v6-0-993ab0949344@linaro.org Changes in v6: - Fix ports/ethernet-ports requirement with proper indenting (hopefully). - Link to v5: https://lore.kernel.org/r/20231023-marvell-88e6152-wan-led-v5-0-0e82952015a7@linaro.org Changes in v5: - Consistently rename switch@n to ethernet-switch@n in all cleanup patches - Consistently rename ports to ethernet-ports in all cleanup patches - Consistently rename all port@n to ethernet-port@n in all cleanup patches - Consistently rename all phy@n to ethernet-phy@n in all cleanup patches - Restore the nodename on the Turris MOX which has a U-Boot binary using the nodename as ABI, put in a blurb warning about this so no-one else tries to change it in the future. - Drop dsa.yaml direct references where we reference dsa.yaml#/$defs/ethernet-ports - Replace the conjured MV88E6xxx example by a better one based on imx6qdl plus strictly named nodes and added reset-gpios for a more complete example, and another example using the interrupt controller based on armada-381-netgear-gs110emx.dts - Bump lineage to 2008 as Vladimir says the code was developed starting 2008. - Link to v4: https://lore.kernel.org/r/20231018-marvell-88e6152-wan-led-v4-0-3ee0c67383be@linaro.org Changes in v4: - Rebase the series on top of Rob's series "dt-bindings: net: Child node schema cleanups" (or the hex numbered ports will not work) - Fix up a whitespacing error corrupting v3... - Add a new patch making the generic DSA binding require ports or ethernet-ports in the switch node. - Drop any corrections of port@a in the patches. - Drop oneOf in the compatible enum for mv88e6xxx - Use ethernet-switch, ethernet-ports and ethernet-phy in the examples - Transclude the dsa.yaml#/$defs/ethernet-ports define for ports - Move the DTS and binding fixes first, before the actual bindings, so they apply without (too many) warnings as fallout. - Drop stray colon in text. - Drop example port in the mveusb binding. - Link to v3: https://lore.kernel.org/r/20231016-marvell-88e6152-wan-led-v3-0-38cd449dfb15@linaro.org Changes in v3: - Fix up a related mvusb example in a different binding that the scripts were complaining about. - Fix up the wording on internal vs external MDIO buses in the mv88e6xxx binding document. - Remove pointless label and put the right rev-mii into the MV88E6060 schema. - Link to v2: https://lore.kernel.org/r/20231014-marvell-88e6152-wan-led-v2-0-7fca08b68849@linaro.org Changes in v2: - Break out a separate Marvell MV88E6060 binding file. I stand corrected. - Drop the idea to rely on nodename mdio-external for the external MDIO bus, keep the compatible, drop patch for the driver. - Fix more Marvell DT mistakes. - Fix NXP DT mistakes in a separate patch. - Fix Marvell ARM64 mistakes in a separate patch. - Link to v1: https://lore.kernel.org/r/20231013-marvell-88e6152-wan-led-v1-0-0712ba99857c@linaro.org ==================== Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit 53313ed25ba8935af30021a1603225a0fed8e402 Author: Linus Walleij Date: Tue Oct 24 15:20:33 2023 +0200 dt-bindings: marvell: Add Marvell MV88E6060 DSA schema The Marvell MV88E6060 is one of the oldest DSA switches from Marvell, and it has DT bindings used in the wild. Let's define them properly. It is different enough from the rest of the MV88E6xxx switches that it deserves its own binding. Reviewed-by: Andrew Lunn Reviewed-by: Vladimir Oltean Reviewed-by: Rob Herring Signed-off-by: Linus Walleij Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 0f35369b4efe30c2a7307d2a492e991032cfcfee Author: Linus Walleij Date: Tue Oct 24 15:20:32 2023 +0200 dt-bindings: marvell: Rewrite MV88E6xxx in schema This is an attempt to rewrite the Marvell MV88E6xxx switch bindings in YAML schema. The current text binding says: WARNING: This binding is currently unstable. Do not program it into a FLASH never to be changed again. Once this binding is stable, this warning will be removed. Well that never happened before we switched to YAML markup, we can't have it like this, what about fixing the mess? Reviewed-by: Andrew Lunn Reviewed-by: Rob Herring Signed-off-by: Linus Walleij Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 605a5f5d406df0c01d92e36a7b5419ffaf62a4ce Author: Linus Walleij Date: Tue Oct 24 15:20:31 2023 +0200 ARM64: dts: marvell: Fix some common switch mistakes Fix some errors in the Marvell MV88E6xxx switch descriptions: - The top node had no address size or cells. - switch0@0 is not OK, should be ethernet-switch@0. - ports should be ethernet-ports - port@0 should be ethernet-port@0 - PHYs should be named ethernet-phy@ Reviewed-by: Andrew Lunn Signed-off-by: Linus Walleij Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit bfedd8423643825f37c06bd3cb87973d5206cc45 Author: Linus Walleij Date: Tue Oct 24 15:20:30 2023 +0200 ARM: dts: nxp: Fix some common switch mistakes Fix some errors in the Marvell MV88E6xxx switch descriptions: - switch0@0 is not OK, should be ethernet-switch@0 - ports should be ethernet-ports - port should be ethernet-port - phy should be ethernet-phy Reviewed-by: Andrew Lunn Signed-off-by: Linus Walleij Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 2b83557a588f739fd0a63efe1c3bc851cdf3d5f6 Author: Linus Walleij Date: Tue Oct 24 15:20:29 2023 +0200 ARM: dts: marvell: Fix some common switch mistakes Fix some errors in the Marvell MV88E6xxx switch descriptions: - The top node had no address size or cells. - switch0@0 is not OK, should be ethernet-switch@0. - The ports node should be named ethernet-ports - The ethernet-ports node should have port@0 etc children, no plural "ports" in the children. - Ports should be named ethernet-port@0 etc - PHYs should be named ethernet-phy@0 etc This serves as an example of fixes needed for introducing a schema for the bindings, but the patch can simply be applied. Reviewed-by: Andrew Lunn Signed-off-by: Linus Walleij Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit ddae07ce9bb35a939318dfb22fa799f7cd6893ae Author: Linus Walleij Date: Tue Oct 24 15:20:28 2023 +0200 dt-bindings: net: mvusb: Fix up DSA example When adding a proper schema for the Marvell mx88e6xxx switch, the scripts start complaining about this embedded example: dtschema/dtc warnings/errors: net/marvell,mvusb.example.dtb: switch@0: ports: '#address-cells' is a required property from schema $id: http://devicetree.org/schemas/net/dsa/marvell,mv88e6xxx.yaml# net/marvell,mvusb.example.dtb: switch@0: ports: '#size-cells' is a required property from schema $id: http://devicetree.org/schemas/net/dsa/marvell,mv88e6xxx.yaml# Fix this up by extending the example with those properties in the ports node. While we are at it, rename "ports" to "ethernet-ports" and rename "switch" to "ethernet-switch" as this is recommended practice. Reviewed-by: Andrew Lunn Reviewed-by: Vladimir Oltean Reviewed-by: Rob Herring Signed-off-by: Linus Walleij Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit b5ef61718ad7c003687c759095fc4ae1419bf602 Author: Linus Walleij Date: Tue Oct 24 15:20:27 2023 +0200 dt-bindings: net: dsa: Require ports or ethernet-ports Bindings using dsa.yaml#/$defs/ethernet-ports specify that a DSA switch node need to have a ports or ethernet-ports subnode, and that is actually required, so add requirements using oneOf. Suggested-by: Rob Herring Signed-off-by: Linus Walleij Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 70f06c115bcca26ceeebf938e48bc8143668e38b Author: Florian Westphal Date: Tue Oct 24 13:05:51 2023 +0200 sched: act_ct: switch to per-action label counting net->ct.labels_used was meant to convey 'number of ip/nftables rules that need the label extension allocated'. act_ct enables this for each net namespace, which voids all attempts to avoid ct->ext allocation when possible. Move this increment to the control plane to request label extension space allocation only when its needed. Signed-off-by: Florian Westphal Reviewed-by: Pedro Tammela Reviewed-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 4b55159b6668cf9c88b432401d22101dd6a10c12 Author: Robert Marko Date: Mon Oct 16 19:55:15 2023 +0200 dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ6018 Document IPQ6018 compatible for Qcom NVMEM CPUFreq driver. Signed-off-by: Robert Marko Signed-off-by: Viresh Kumar commit f0d64f4ae793fc17d5e9dad3e775367d8eb40722 Author: Stephan Gerhold Date: Wed Oct 18 10:06:04 2023 +0200 cpufreq: qcom-nvmem: Add MSM8909 When the MSM8909 SoC is used together with the PM8909 PMIC the primary power supply for the CPU (VDD_APC) is shared with other components to the SoC, namely the VDD_CX power domain typically supplied by the PM8909 S1 regulator. This means that all votes for necessary performance states go via the RPM firmware which collects the requirements from all the processors in the SoC. The RPM firmware then chooses the actual voltage based on the performance states ("corners"), depending on calibration values in the NVMEM and other factors. The MSM8909 SoC is also sometimes used with the PM8916 or PM660 PMIC. In that case there is a dedicated regulator connected to VDD_APC and Linux is responsible to do adaptive voltage scaling using CPR (similar to the existing code for QCS404). This difference can be described in the device tree, by either assigning the CPU a power domain from RPMPD or from the CPR driver. Describe this using "perf" as generic power domain name, which is also used already for SCMI based platforms. Also add a simple function that reads the speedbin from a NVMEM cell and sets it as-is for opp-supported-hw. The actual bit position can be described in the device tree without additional driver changes. Signed-off-by: Stephan Gerhold Acked-by: Konrad Dybcio Reviewed-by: Ulf Hansson [ Viresh: Fixed rebase conflict. ] Signed-off-by: Viresh Kumar commit 2a5d46c3ad6b0e62d2b04356ad999d504fb564e0 Author: Stephan Gerhold Date: Wed Oct 18 10:06:02 2023 +0200 cpufreq: qcom-nvmem: Simplify driver data allocation Simplify the allocation and cleanup of driver data by using devm together with a flexible array. Prepare for adding additional per-CPU data by defining a struct qcom_cpufreq_drv_cpu instead of storing the opp_tokens directly. Signed-off-by: Stephan Gerhold Reviewed-by: Konrad Dybcio Signed-off-by: Viresh Kumar commit cf3c415d7d2c21288fc85d7ed5da9b9af36d0de9 Author: Greg Kroah-Hartman Date: Tue Oct 24 13:49:04 2023 +0200 ocxl: make ocxl_class constant Now that the driver core allows for struct class to be in read-only memory, we should make all 'class' structures declared at build time placing them into read-only memory, instead of having to be dynamically allocated at runtime. Cc: Andrew Donnellan Cc: Arnd Bergmann Cc: linuxppc-dev@lists.ozlabs.org Acked-by: Frederic Barrat Link: https://lore.kernel.org/r/2023102403-squirt-defraud-6c0c@gregkh Signed-off-by: Greg Kroah-Hartman commit d223192634ffac3182cc38fda3cca0a8814276ea Author: Greg Kroah-Hartman Date: Tue Oct 24 13:48:35 2023 +0200 cxl: make cxl_class constant Now that the driver core allows for struct class to be in read-only memory, we should make all 'class' structures declared at build time placing them into read-only memory, instead of having to be dynamically allocated at runtime. Cc: Andrew Donnellan Cc: Arnd Bergmann Cc: linuxppc-dev@lists.ozlabs.org Acked-by: Frederic Barrat Link: https://lore.kernel.org/r/2023102434-haiku-uphill-0c11@gregkh Signed-off-by: Greg Kroah-Hartman commit 7d7b6f2953b342bf6eab81886a03680109f3cb1c Author: Dmitry Antipov Date: Fri Oct 20 07:09:36 2023 +0300 wifi: rtw89: cleanup firmware elements parsing When compiling with clang-18, I've noticed the following: drivers/net/wireless/realtek/rtw89/fw.c:389:28: warning: cast to smaller integer type 'enum rtw89_fw_type' from 'const void *' [-Wvoid-pointer-to-enum-cast] 389 | enum rtw89_fw_type type = (enum rtw89_fw_type)data; | ^~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/wireless/realtek/rtw89/fw.c:569:13: warning: cast to smaller integer type 'enum rtw89_rf_path' from 'const void *' [-Wvoid-pointer-to-enum-cast] 569 | rf_path = (enum rtw89_rf_path)data; | ^~~~~~~~~~~~~~~~~~~~~~~~ So avoid brutal everything-to-const-void-and-back casts, introduce 'union rtw89_fw_element_arg' to pass parameters to element handler callbacks, and adjust all of the related bits accordingly. Compile tested only. Signed-off-by: Dmitry Antipov Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231020040940.33154-1-dmantipov@yandex.ru commit f6c086ef8417b4c6941628ab043c4688e2fd17c2 Author: Greg Kroah-Hartman Date: Tue Oct 24 13:49:35 2023 +0200 misc: phantom: make phantom_class constant Now that the driver core allows for struct class to be in read-only memory, we should make all 'class' structures declared at build time placing them into read-only memory, instead of having to be dynamically allocated at runtime. Cc: Arnd Bergmann Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/2023102434-font-feast-98e3@gregkh Signed-off-by: Greg Kroah-Hartman commit cca74bed37af1c8217bcd8282d9b384efdbf73bd Author: Shiji Yang Date: Thu Oct 19 19:58:58 2023 +0800 wifi: rt2x00: rework MT7620 PA/LNA RF calibration 1. Move MT7620 PA/LNA calibration code to dedicated functions. 2. For external PA/LNA devices, restore RF and BBP registers before R-Calibration. 3. Do Rx DCOC calibration again before RXIQ calibration. 4. Add some missing LNA related registers' initialization. Signed-off-by: Shiji Yang Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/TYAP286MB0315979F92DC563019B8F238BCD4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM commit a28533c6be1711584bf3ec978309d5c590029821 Author: Shiji Yang Date: Thu Oct 19 19:58:57 2023 +0800 wifi: rt2x00: rework MT7620 channel config function 1. Move the channel configuration code from rt2800_vco_calibration() to the rt2800_config_channel(). 2. Use MT7620 SoC specific AGC initial LNA value instead of the RT5592's value. 3. BBP{195,196} pairing write has been replaced with rt2800_bbp_glrt_write() to reduce redundant code. Signed-off-by: Shiji Yang Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/TYAP286MB0315622A4340BFFA530B1B86BCD4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM commit 1ffe76d5ae78553948d67a978acd9945c2f0a175 Author: Shiji Yang Date: Thu Oct 19 19:58:56 2023 +0800 wifi: rt2x00: improve MT7620 register initialization 1. Do not hard reset the BBP. We can use soft reset instead. This change has some help to the calibration failure issue. 2. Enable falling back to legacy rate from the HT/RTS rate by setting the HT_FBK_TO_LEGACY register. 3. Implement MCS rate specific maximum PSDU size. It can improve the transmission quality under the low RSSI condition. 4. Set BBP_84 register value to 0x19. This is used for extension channel overlapping IOT. Signed-off-by: Shiji Yang Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/TYAP286MB031553CCD4B7A3B89C85935DBCD4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM commit 8ee2843f4d52026ab67e7577eaa49d444e1976b8 Author: Hao Chen Date: Tue Oct 24 11:20:34 2023 +0800 net: hns3: add some link modes for hisilicon device Add HCLGE_SUPPORT_50G_R1_BIT and HCLGE_SUPPORT_100G_R2_BIT two capability bits and Corresponding link modes. Signed-off-by: Hao Chen Signed-off-by: Jijie Shao Reviewed-by: Wojciech Drewek Signed-off-by: David S. Miller commit d4b2d165714c0ce8777d5131f6e0aad617b7adc4 Author: Leon Romanovsky Date: Tue Oct 24 18:07:31 2023 +0300 RDMA/hfi1: Workaround truncation compilation error Increase name array to be large enough to overcome the following compilation error. drivers/infiniband/hw/hfi1/efivar.c: In function ‘read_hfi1_efi_var’: drivers/infiniband/hw/hfi1/efivar.c:124:44: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] 124 | snprintf(name, sizeof(name), "%s-%s", prefix_name, kind); | ^ drivers/infiniband/hw/hfi1/efivar.c:124:9: note: ‘snprintf’ output 2 or more bytes (assuming 65) into a destination of size 64 124 | snprintf(name, sizeof(name), "%s-%s", prefix_name, kind); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/hw/hfi1/efivar.c:133:52: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] 133 | snprintf(name, sizeof(name), "%s-%s", prefix_name, kind); | ^ drivers/infiniband/hw/hfi1/efivar.c:133:17: note: ‘snprintf’ output 2 or more bytes (assuming 65) into a destination of size 64 133 | snprintf(name, sizeof(name), "%s-%s", prefix_name, kind); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[6]: *** [scripts/Makefile.build:243: drivers/infiniband/hw/hfi1/efivar.o] Error 1 Fixes: c03c08d50b3d ("IB/hfi1: Check upper-case EFI variables") Signed-off-by: Leon Romanovsky Link: https://lore.kernel.org/r/238fa39a8fd60e87a5ad7e1ca6584fcdf32e9519.1698159993.git.leonro@nvidia.com Acked-by: Dennis Dalessandro Signed-off-by: Leon Romanovsky commit 2f19c4b8395ccb6eb25ccafee883c8cfbe3fc193 Author: Chengfeng Ye Date: Tue Sep 26 10:11:16 2023 +0000 IB/hfi1: Fix potential deadlock on &irq_src_lock and &dd->uctxt_lock handle_receive_interrupt_napi_sp() running inside interrupt handler could introduce inverse lock ordering between &dd->irq_src_lock and &dd->uctxt_lock, if read_mod_write() is preempted by the isr. [CPU0] | [CPU1] hfi1_ipoib_dev_open() | --> hfi1_netdev_enable_queues() | --> enable_queues(rx) | --> hfi1_rcvctrl() | --> set_intr_bits() | --> read_mod_write() | --> spin_lock(&dd->irq_src_lock) | | hfi1_poll() | --> poll_next() | --> spin_lock_irq(&dd->uctxt_lock) | | --> hfi1_rcvctrl() | --> set_intr_bits() | --> read_mod_write() | --> spin_lock(&dd->irq_src_lock) | --> handle_receive_interrupt_napi_sp() | --> set_all_fastpath() | --> hfi1_rcd_get_by_index() | --> spin_lock_irqsave(&dd->uctxt_lock) | This flaw was found by an experimental static analysis tool I am developing for irq-related deadlock. To prevent the potential deadlock, the patch use spin_lock_irqsave() on &dd->irq_src_lock inside read_mod_write() to prevent the possible deadlock scenario. Signed-off-by: Chengfeng Ye Link: https://lore.kernel.org/r/20230926101116.2797-1-dg573847474@gmail.com Acked-by: Dennis Dalessandro Signed-off-by: Leon Romanovsky commit 93aa731e613399f5145166940b20224a8d116920 Merge: e43e6d9582e0d d264f24409b87 Author: David S. Miller Date: Wed Oct 25 08:47:33 2023 +0100 Merge branch 'dsa-microchip-WoL-support' commit d264f24409b87f0ba63d81d6f28165b8fd4fdf24 Author: Oleksij Rempel Date: Mon Oct 23 11:33:38 2023 +0200 net: dsa: microchip: ksz9477: add Wake on LAN support Add WoL support for KSZ9477 family of switches. This code was tested on KSZ8563 chip. KSZ9477 family of switches supports multiple PHY events: - wake on Link Up - wake on Energy Detect. Since current UAPI can't differentiate between this PHY events, map all of them to WAKE_PHY. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit aed7425d65108bc6e7cb2f64a11aa35b9f5e4397 Author: Oleksij Rempel Date: Mon Oct 23 11:33:37 2023 +0200 net: dsa: microchip: use wakeup-source DT property to enable PME output KSZ switches with WoL support signals wake event over PME pin. If this pin is attached to some external PMIC or System Controller can't be described as GPIO, the only way to describe it in the devicetree is to use wakeup-source property. So, add support for this property and enable PME switch output if this property is present. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 4e1799ae84fc9e1af5c965ee4f20c5b0f7a8d566 Author: Oleksij Rempel Date: Mon Oct 23 11:33:36 2023 +0200 dt-bindings: net: dsa: microchip: add wakeup-source property Add wakeup-source property to enable Wake on Lan functionality in the switch. Since PME wake pin is not always attached to the SoC, use wakeup-source instead of wakeup-gpios Signed-off-by: Oleksij Rempel Acked-by: Conor Dooley Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 02e987f52cf0dc8465e937f49ddfa3a047796fda Author: Oleksij Rempel Date: Mon Oct 23 11:33:35 2023 +0200 net: dsa: microchip: Add missing MAC address register offset for ksz8863 Add the missing offset for the global MAC address register (REG_SW_MAC_ADDR) for the ksz8863 family of switches. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Reviewed-by: Russell King (Oracle) Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 99248c8902f505ec064cf2b0f74629016f2f4c82 Author: Max McCarthy Date: Tue Oct 24 12:30:19 2023 +0000 ALSA: usb-audio: add quirk flag to enable native DSD for McIntosh devices McIntosh devices supporting native DSD require the feature to be explicitly exposed. Add a flag that fixes an issue where DSD audio was defaulting to DSD over PCM instead of delivering raw DSD data. Signed-off-by: Max McCarthy Cc: Link: https://lore.kernel.org/r/BL0PR13MB4433226005162D186A8DFF4AD6DFA@BL0PR13MB4433.namprd13.prod.outlook.com Signed-off-by: Takashi Iwai commit 264aeb994ea8db4a39a393d91b1f551b42309759 Author: Takashi Iwai Date: Mon Oct 23 17:36:05 2023 +0200 ASoC: SOF: Make return of remove_late void, too Like the change we've done for remove callback, the newly introduced remove_late callback should be changed to void return, too. Fixes: 17baaa1f950b ("ASoC: SOF: core: Add probe_early and remove_late callbacks") Acked-by: Mark Brown Link: https://lore.kernel.org/r/20231023153605.863-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 36e826b568e412f61d68fedc02a67b4d8b7583cc Author: Aditya Gupta Date: Mon Oct 23 12:56:12 2023 +0530 powerpc/vmcore: Add MMU information to vmcoreinfo Since below commit, address mapping for vmemmap has changed for Radix MMU, where address mapping is stored in kernel page table itself, instead of earlier used 'vmemmap_list'. commit 368a0590d954 ("powerpc/book3s64/vmemmap: switch radix to use a different vmemmap handling function") Hence with upstream kernel, in case of Radix MMU, makedumpfile fails to do address translation for vmemmap addresses, as it depended on vmemmap_list, which can now be empty. While fixing the address translation in makedumpfile, it was identified that currently makedumpfile cannot distinguish between Hash MMU and Radix MMU, unless VMLINUX is passed with -x flag to makedumpfile. And hence fails to assign offsets and shifts correctly (such as in L4 to PGDIR offset calculation in makedumpfile). For getting the MMU, makedumpfile uses `cur_cpu_spec.mmu_features`. Add `cur_cpu_spec` symbol and offset of `mmu_features` in the `cpu_spec` struct, to VMCOREINFO, so that makedumpfile can assign the offsets correctly, without needing a VMLINUX. Also, even along with `cur_cpu_spec->mmu_features` makedumpfile has to depend on the 'MMU_FTR_TYPE_RADIX' flag in mmu_features, implying kernel developers need to be cautious of changes to 'MMU_FTR_*' defines. A more stable approach was suggested in the below thread by contributors: https://lore.kernel.org/linuxppc-dev/20230920105706.853626-1-adityag@linux.ibm.com/ The suggestion was to add whether 'RADIX_MMU' is enabled in vmcoreinfo This patch also implements the suggestion, by adding 'RADIX_MMU' in vmcoreinfo, which makedumpfile can use to get whether the crashed system had RADIX MMU (in which case 'NUMBER(RADIX_MMU)=1') or not (in which case 'NUMBER(RADIX_MMU)=0') Fixes: 368a0590d954 ("powerpc/book3s64/vmemmap: switch radix to use a different vmemmap handling function") Reported-by: Sachin Sant Signed-off-by: Aditya Gupta Signed-off-by: Michael Ellerman Link: https://msgid.link/20231023072612.50874-1-adityag@linux.ibm.com commit 357673120af6bd2939b9c99dec58962fff65a110 Author: Michael Ellerman Date: Mon Oct 23 20:37:06 2023 +1100 Revert "powerpc: add `cur_cpu_spec` symbol to vmcoreinfo" This reverts commit 7135b921b32966d7602ede396b7286d372aee63f. I applied this commit prematurely while there was still discussion ongoing. Revert it so the final patch can be applied cleanly. Signed-off-by: Michael Ellerman commit a75a16c62a2540f11eeae4f2b50e95deefb652ea Author: Daniel Mentz Date: Tue Oct 17 11:20:26 2023 -0700 scsi: ufs: core: Leave space for '\0' in utf8 desc string utf16s_to_utf8s does not NULL terminate the output string. For us to be able to add a NULL character when utf16s_to_utf8s returns, we need to make sure that there is space for such NULL character at the end of the output buffer. We can achieve this by passing an output buffer size to utf16s_to_utf8s that is one character less than what we allocated. Other call sites of utf16s_to_utf8s appear to be using the same technique where they artificially reduce the buffer size by one to leave space for a NULL character or line feed character. Fixes: 4b828fe156a6 ("scsi: ufs: revamp string descriptor reading") Reviewed-by: Mars Cheng Reviewed-by: Bart Van Assche Reviewed-by: Yen-lin Lai Signed-off-by: Daniel Mentz Link: https://lore.kernel.org/r/20231017182026.2141163-1-danielmentz@google.com Reviewed-by: Avri Altman Signed-off-by: Martin K. Petersen commit 6997283f64d968cf6bc8a68876930f67f48e1a6c Author: Bragatheswaran Manickavel Date: Wed Oct 25 00:04:01 2023 +0530 scsi: ufs: core: Conversion to bool not necessary A logical evaluation already results in bool. There is no need for using a ternary operator based evaluation and bool conversion of the outcome. Issue identified using boolconv.cocci Coccinelle semantic patch. Signed-off-by: Bragatheswaran Manickavel Link: https://lore.kernel.org/r/20231024183401.48888-1-bragathemanick0908@gmail.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit a5181c8955145431e809158ad370258f77c3b77f Author: Alice Chao Date: Tue Oct 24 16:43:21 2023 +0800 scsi: ufs: core: Fix race between force complete and ISR While error handler force complete command (Thread A) and completion IRQ raising (Thread B) of the same command, it may cause race condition. Below is racing step (from 1 to 6): ufshcd_mcq_compl_pending_transfer (Thread A) 1 if (cmd && !test_bit(SCMD_STATE_COMPLETE, &cmd->state)) { 5 spin_lock_irqsave(&hwq->cq_lock, flags); // wait lock release set_host_byte(cmd, DID_REQUEUE); 6 ufshcd_release_scsi_cmd(hba, lrbp); // access null pointer scsi_done(cmd); spin_unlock_irqrestore(&hwq->cq_lock, flags); } ufshcd_mcq_poll_cqe_lock (Thread B) 2 spin_lock_irqsave(&hwq->cq_lock, flags); ufshcd_mcq_poll_cqe_nolock() ufshcd_compl_one_cqe() 3 ufshcd_release_scsi_cmd() // lrbp->cmd = NULL; 4 spin_unlock_irqrestore(&hwq->cq_lock, flags); Signed-off-by: Alice Chao Link: https://lore.kernel.org/r/20231024084324.12197-1-alice.chao@mediatek.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit f2d79aa16aee19e8f4aea3c3a6f6724124060e65 Author: Hannes Reinecke Date: Mon Oct 23 09:30:21 2023 +0200 scsi: megaraid: Fix up debug message in megaraid_abort_and_reset() Found by Smatch. Fixes: 5bcd3bfbda02 ("scsi: megaraid: Pass in NULL scb for host reset") Reported-by: Dan Carpenter Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231023073021.21954-1-hare@suse.de Signed-off-by: Martin K. Petersen commit c7f4c5dec651090f99b0d2b946e028e1ea90d22a Author: Hannes Reinecke Date: Mon Oct 23 09:30:14 2023 +0200 scsi: aic79xx: Fix up NULL command in ahd_done() Found by smatch. Fixes: c67e63800446 ("scsi: aic79xx: Do not reference SCSI command when resetting device") Reported-by: Dan Carpenter Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231023073014.21438-1-hare@suse.de Signed-off-by: Martin K. Petersen commit 4b1c07913239b7a02592084d449c3938ce22b106 Author: Hannes Reinecke Date: Mon Oct 23 09:30:05 2023 +0200 scsi: message: fusion: Initialize return value in mptfc_bus_reset() Detected by smatch. Fixes: 17865dc2eccc ("scsi: message: fusion: Open-code mptfc_block_error_handler() for bus reset") Reported-by: Dan Carpenter Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231023073005.20766-1-hare@suse.de Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 3c978492c333f0c08248a8d51cecbe5eb5f617c9 Author: Ranjan Kumar Date: Fri Oct 20 16:28:49 2023 +0530 scsi: mpt3sas: Fix loop logic The retry loop continues to iterate until the count reaches 30, even after receiving the correct value. Exit loop when a non-zero value is read. Fixes: 4ca10f3e3174 ("scsi: mpt3sas: Perform additional retries if doorbell read returns 0") Cc: stable@vger.kernel.org Signed-off-by: Ranjan Kumar Link: https://lore.kernel.org/r/20231020105849.6350-1-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen commit 44a31659ea60de5b022f8827ec11029a6b3daca1 Author: Su Hui Date: Fri Oct 20 10:33:27 2023 +0800 scsi: snic: Remove useless code in snic_dr_clean_pending_req() Return error code directly to save space and be more clear. Signed-off-by: Su Hui Link: https://lore.kernel.org/r/20231020023326.43898-1-suhui@nfschina.com Reviewed-by: Dan Carpenter Signed-off-by: Martin K. Petersen commit 82f52b2cd5fccc61290e14c970f1280791ca4dee Author: Wenchao Hao Date: Wed Oct 18 19:37:46 2023 +0800 scsi: core: Add comment to target_destroy in scsi_host_template Add comment to indicate that the callback function target_destroy in the scsi_host_template must not sleep. Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231018113746.1940197-3-haowenchao2@huawei.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3dc985bfbd00e1fb3dac4b1359efd6b71855b81f Author: Wenchao Hao Date: Wed Oct 18 19:37:45 2023 +0800 scsi: core: Clean up scsi_dev_queue_ready() This is just a cleanup for scsi_dev_queue_ready() to avoid a redundant goto and if statement. No functional change. Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231018113746.1940197-2-haowenchao2@huawei.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 0b1b4b04444fc3e8f2489cde43513dcddb9f3f60 Author: Hannes Reinecke Date: Mon Oct 23 09:29:57 2023 +0200 scsi: pmcraid: Add missing scsi_device_put() in pmcraid_eh_target_reset_handler() When breaking out of an shost_for_each_device() loop one needs to do an explicit scsi_device_put(). Fixes: c2a14ab3b9b3 ("scsi: pmcraid: Select device in pmcraid_eh_target_reset_handler()") Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231023072957.20191-1-hare@suse.de Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 96f41cddbc7baf1a96a388693dcfac0051db070d Author: Yang Li Date: Tue Oct 17 11:09:13 2023 +0800 scsi: target: core: Fix kernel-doc comment Fix kernel-doc comment to silence the warnings: drivers/target/target_core_transport.c:1930: warning: Excess function parameter 'cmd' description in 'target_submit' drivers/target/target_core_transport.c:1930: warning: Function parameter or member 'se_cmd' not described in 'target_submit' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6844 Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20231017030913.89973-1-yang.lee@linux.alibaba.com Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen commit 9e1c911ecbbc92ebdae4aa69cf7691cf792ba32d Author: Yang Li Date: Tue Oct 17 10:58:53 2023 +0800 scsi: pmcraid: Fix kernel-doc comment Fix kernel-doc comment to silence the warnings: drivers/scsi/pmcraid.c:2697: warning: Excess function parameter 'scsi_cmd' description in 'pmcraid_reset_device' drivers/scsi/pmcraid.c:2697: warning: Function parameter or member 'scsi_dev' not described in 'pmcraid_reset_device' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6843 Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20231017025853.67562-1-yang.lee@linux.alibaba.com Signed-off-by: Martin K. Petersen commit 3857af38e57a80b15b994e19d1f4301cac796481 Author: Miguel Ojeda Date: Wed Oct 18 18:09:22 2023 +0200 docs: rust: add "The Rust experiment" section Clarify that the Rust experiment is still going on to avoid confusion for both kernel maintainers and end users. Reviewed-by: Carlos Bilbao Link: https://lore.kernel.org/r/20231018160922.1018962-1-ojeda@kernel.org [ Changed last paragraph as discussed in the mailing list. ] Signed-off-by: Miguel Ojeda commit 0ecf4aa32b7896b9160688bdbd20153dc06a50fb Merge: 11ae5eb516b65 5b2c54e0d0ea0 Author: Dave Airlie Date: Wed Oct 25 10:54:10 2023 +1000 Merge tag 'amd-drm-next-6.7-2023-10-20' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-6.7-2023-10-20: amdgpu: - SMU 13 updates - UMSCH updates - DC MPO fixes - RAS updates - MES 11 fixes - Fix possible memory leaks in error pathes - GC 11.5 fixes - Kernel doc updates - PSP updates - APU IMU fixes - Misc code cleanups - SMU 11 fixes - OD fix - Frame size warning fixes - SR-IOV fixes - NBIO 7.11 updates - NBIO 7.7 updates - XGMI fixes - devcoredump updates amdkfd: - Misc code cleanups - SVM fixes Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20231020195043.4937-1-alexander.deucher@amd.com commit e43e6d9582e0dcd20532310dbb9f47dfe7a74ace Author: Justin Stitt Date: Mon Oct 23 19:39:39 2023 +0000 s390/qeth: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect new_entry->dbf_name to be NUL-terminated based on its use with strcmp(): | if (strcmp(entry->dbf_name, name) == 0) { Moreover, NUL-padding is not required as new_entry is kzalloc'd just before this assignment: | new_entry = kzalloc(sizeof(struct qeth_dbf_entry), GFP_KERNEL); ... rendering any future NUL-byte assignments (like the ones strncpy() does) redundant. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Thorsten Winkler Tested-by: Thorsten Winkler Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231023-strncpy-drivers-s390-net-qeth_core_main-c-v1-1-e7ce65454446@google.com Signed-off-by: Jakub Kicinski commit 19d1c64b7741d588af56dc70aa21e028737cd73f Author: Justin Stitt Date: Mon Oct 23 19:35:07 2023 +0000 s390/ctcm: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect chid to be NUL-terminated based on its use with format strings: CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO, "%s(%s) %s", CTCM_FUNTAIL, chid, ok ? "OK" : "failed"); Moreover, NUL-padding is not required as it is _only_ used in this one instance with a format string. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. We can also drop the +1 from chid's declaration as we no longer need to be cautious about leaving a spot for a NUL-byte. Let's use the more idiomatic strscpy usage of (dest, src, sizeof(dest)) as this more closely ties the destination buffer to the length. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Thorsten Winkler Tested-by: Thorsten Winkler Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231023-strncpy-drivers-s390-net-ctcm_main-c-v1-1-265db6e78165@google.com Signed-off-by: Jakub Kicinski commit 3f7915ccc90261c201664b5fdce139db09480a36 Author: Marc Zyngier Date: Mon Oct 23 10:54:44 2023 +0100 KVM: arm64: Handle AArch32 SPSR_{irq,abt,und,fiq} as RAZ/WI When trapping accesses from a NV guest that tries to access SPSR_{irq,abt,und,fiq}, make sure we handle them as RAZ/WI, as if AArch32 wasn't implemented. This involves a bit of repainting to make the visibility handler more generic. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231023095444.1587322-6-maz@kernel.org Signed-off-by: Oliver Upton commit c7d11a61c7f7de75e4e269485644ea8c5a4e0bf6 Author: Marc Zyngier Date: Mon Oct 23 10:54:43 2023 +0100 KVM: arm64: Do not let a L1 hypervisor access the *32_EL2 sysregs DBGVCR32_EL2, DACR32_EL2, IFSR32_EL2 and FPEXC32_EL2 are required to UNDEF when AArch32 isn't implemented, which is definitely the case when running NV. Given that this is the only case where these registers can trap, unconditionally inject an UNDEF exception. Signed-off-by: Marc Zyngier Reviewed-by: Oliver Upton Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20231023095444.1587322-5-maz@kernel.org Signed-off-by: Oliver Upton commit 04cf5465055442c15c37bbedb1febe2d8f3a47be Author: Miguel Luis Date: Mon Oct 23 10:54:42 2023 +0100 KVM: arm64: Refine _EL2 system register list that require trap reinjection Implement a fine grained approach in the _EL2 sysreg range instead of the current wide cast trap. This ensures that we don't mistakenly inject the wrong exception into the guest. [maz: commit message massaging, dropped secure and AArch32 registers from the list] Fixes: d0fc0a2519a6 ("KVM: arm64: nv: Add trap forwarding for HCR_EL2") Reviewed-by: Eric Auger Signed-off-by: Miguel Luis Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231023095444.1587322-4-maz@kernel.org Signed-off-by: Oliver Upton commit 41f6c9344713e6b895a77f2bdd596cf56d4cc197 Author: Miguel Luis Date: Mon Oct 23 10:54:41 2023 +0100 arm64: Add missing _EL2 encodings Some _EL2 encodings are missing. Add them. Signed-off-by: Miguel Luis Reviewed-by: Eric Auger [maz: dropped secure encodings] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231023095444.1587322-3-maz@kernel.org Signed-off-by: Oliver Upton commit d5cb781b77416a9ed4129960712932dbcf8a9f30 Author: Miguel Luis Date: Mon Oct 23 10:54:40 2023 +0100 arm64: Add missing _EL12 encodings Some _EL12 encodings are missing. Add them. Reviewed-by: Eric Auger Signed-off-by: Miguel Luis Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231023095444.1587322-2-maz@kernel.org Signed-off-by: Oliver Upton commit 42c815c545a8b5202a0525c5d2cf1a87c98bdbea Author: Lorenzo Bianconi Date: Tue Oct 24 00:01:30 2023 +0200 net: ethernet: mtk_wed: remove wo pointer in wo_r32/wo_w32 signature wo pointer is no longer used in wo_r32 and wo_w32 routines so get rid of it. Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/530537db0872f7523deff21f0a5dfdd9b75fdc9d.1698098459.git.lorenzo@kernel.org Signed-off-by: Jakub Kicinski commit c35d7636991fe09175fb33287cbb4e02e25d2c53 Author: Lorenzo Bianconi Date: Tue Oct 24 00:00:19 2023 +0200 net: ethernet: mtk_wed: fix firmware loading for MT7986 SoC The WED mcu firmware does not contain all the memory regions defined in the dts reserved_memory node (e.g. MT7986 WED firmware does not contain cpu-boot region). Reverse the mtk_wed_mcu_run_firmware() logic to check all the fw sections are defined in the dts reserved_memory node. Fixes: c6d961aeaa77 ("net: ethernet: mtk_wed: move mem_region array out of mtk_wed_mcu_load_firmware") Tested-by: Frank Wunderlich Signed-off-by: Lorenzo Bianconi Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/d983cbfe8ea562fef9264de8f0c501f7d5705bd5.1698098381.git.lorenzo@kernel.org Signed-off-by: Jakub Kicinski commit 898ae9bdbb7efa3d80fcf039b52c24068f7e6c6e Merge: 37a38e439d4ed 2fc75e370e1d6 Author: Jakub Kicinski Date: Tue Oct 24 16:16:20 2023 -0700 Merge branch 'net-ethernet-renesas-infrastructure-preparations-for-upcoming-driver' Wolfram Sang says: ==================== net: ethernet: renesas: infrastructure preparations for upcoming driver Before we upstream a new driver, Niklas and I thought that a few cleanups for Kconfig/Makefile will help readability and maintainability. Here they are, looking forward to comments. ==================== Link: https://lore.kernel.org/r/20231022205316.3209-1-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit 2fc75e370e1d6d22aaebb9a0d517367e096eb309 Author: Wolfram Sang Date: Sun Oct 22 22:53:16 2023 +0200 net: ethernet: renesas: drop SoC names in Kconfig Mentioning SoCs in Kconfig descriptions tends to get stale (e.g. RAVB is missing RZV2M) or imprecise (e.g. SH_ETH is not available on all R8A779x). Drop them instead of providing vague information. Improve the file description a tad while here. Signed-off-by: Wolfram Sang Reviewed-by: Sergey Shtylyov Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/20231022205316.3209-3-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit de0ad34b56de71824a8a4a4760bfc49c2bccb420 Author: Wolfram Sang Date: Sun Oct 22 22:53:15 2023 +0200 net: ethernet: renesas: group entries in Makefile A new Renesas driver shall be added soon. Prepare the Makefile by grouping the specific objects to the Kconfig symbol for better readability. Improve the file description a tad while here. Signed-off-by: Wolfram Sang Reviewed-by: Sergey Shtylyov Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/20231022205316.3209-2-wsa+renesas@sang-engineering.com Signed-off-by: Jakub Kicinski commit 22360fad5889cbefe1eca695b0cc0273ab280b56 Merge: 42d31dd601fa4 ace15f91e5691 Author: Martin KaFai Lau Date: Tue Oct 24 16:05:02 2023 -0700 Merge branch 'Add bpf programmable net device' Daniel Borkmann says: ==================== This work adds a BPF programmable device which can operate in L3 or L2 mode where the BPF program is part of the xmit routine. It's program management is done via bpf_mprog and it comes with BPF link support. For details see patch 1 and following. Thanks! v3 -> v4: - Moved netkit_release_all() into ndo_uninit (Stan) - Two small commit msg corrections (Toke) - Added Acked/Reviewed-by v2 -> v3: - Remove setting dev->min_mtu to ETH_MIN_MTU (Andrew) - Do not populate ethtool info->version (Andrew) - Populate netdev private data before register_netdevice (Andrew) - Use strscpy for ifname template (Jakub) - Use GFP_KERNEL_ACCOUNT for link kzalloc (Jakub) - Carry and dump link attach type for bpftool (Toke) v1 -> v2: - Rename from meta (Toke, Andrii, Alexei) - Reuse skb_scrub_packet (Stan) - Remove IFF_META and use netdev_ops (Toke) - Add comment to multicast handler (Toke) - Remove silly version info (Toke) - Fix attach_type_name (Quentin) - Rework libbpf link attach api to be similar as tcx (Andrii) - Move flags last for bpf_netkit_opts (Andrii) - Rebased to bpf_mprog query api changes - Folded link support patch into main one ==================== Signed-off-by: Martin KaFai Lau commit ace15f91e569172dac71ae0aeb3a2e76d1ce1b17 Author: Daniel Borkmann Date: Tue Oct 24 23:49:04 2023 +0200 selftests/bpf: Add selftests for netkit Add a bigger batch of test coverage to assert correct operation of netkit devices and their BPF program management: # ./test_progs -t tc_netkit [...] [ 1.166267] bpf_testmod: loading out-of-tree module taints kernel. [ 1.166831] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel [ 1.270957] tsc: Refined TSC clocksource calibration: 3407.988 MHz [ 1.272579] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fc932722, max_idle_ns: 440795381586 ns [ 1.275336] clocksource: Switched to clocksource tsc #257 tc_netkit_basic:OK #258 tc_netkit_device:OK #259 tc_netkit_multi_links:OK #260 tc_netkit_multi_opts:OK #261 tc_netkit_neigh_links:OK Summary: 5/0 PASSED, 0 SKIPPED, 0 FAILED [...] Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20231024214904.29825-8-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit 51f1892b5289f0c09745d3bedb36493555d6d90c Author: Daniel Borkmann Date: Tue Oct 24 23:49:03 2023 +0200 selftests/bpf: Add netlink helper library Add a minimal netlink helper library for the BPF selftests. This has been taken and cut down and cleaned up from iproute2. This covers basics such as netdevice creation which we need for BPF selftests / BPF CI given iproute2 package cannot cover it yet. Stanislav Fomichev suggested that this could be replaced in future by ynl tool generated C code once it has RTNL support to create devices. Once we get to this point the BPF CI would also need to add libmnl. If no further extensions are needed, a second option could be that we remove this code again once iproute2 package has support. Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20231024214904.29825-7-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit bec981a4add6dd6a63065e54e2b2e67c2af6c3fa Author: Daniel Borkmann Date: Tue Oct 24 23:49:02 2023 +0200 bpftool: Extend net dump with netkit progs Add support to dump BPF programs on netkit via bpftool. This includes both the BPF link and attach ops programs. Dumped information contain the attach location, function entry name, program ID and link ID when applicable. Example with tc BPF link: # ./bpftool net xdp: tc: nk1(22) netkit/peer tc1 prog_id 43 link_id 12 [...] Example with json dump: # ./bpftool net --json | jq [ { "xdp": [], "tc": [ { "devname": "nk1", "ifindex": 18, "kind": "netkit/primary", "name": "tc1", "prog_id": 29, "prog_flags": [], "link_id": 8, "link_flags": [] } ], "flow_dissector": [], "netfilter": [] } ] Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20231024214904.29825-6-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit 92a85e18ad4705c66ace55a19f4f8301ef0eb59f Author: Daniel Borkmann Date: Tue Oct 24 23:49:01 2023 +0200 bpftool: Implement link show support for netkit Add support to dump netkit link information to bpftool in similar way as we have for XDP. The netkit link info only exposes the ifindex and the attach_type. Below shows an example link dump output, and a cgroup link is included for comparison, too: # bpftool link [...] 10: cgroup prog 2466 cgroup_id 1 attach_type cgroup_inet6_post_bind [...] 8: netkit prog 35 ifindex nk1(18) attach_type netkit_primary [...] Equivalent json output: # bpftool link --json [...] { "id": 10, "type": "cgroup", "prog_id": 2466, "cgroup_id": 1, "attach_type": "cgroup_inet6_post_bind" }, [...] { "id": 12, "type": "netkit", "prog_id": 61, "devname": "nk1", "ifindex": 21, "attach_type": "netkit_primary" } [...] Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20231024214904.29825-5-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit 05c31b4ab20527c4d1695130aaecc54ef59a0e54 Author: Daniel Borkmann Date: Tue Oct 24 23:49:00 2023 +0200 libbpf: Add link-based API for netkit This adds bpf_program__attach_netkit() API to libbpf. Overall it is very similar to tcx. The API looks as following: LIBBPF_API struct bpf_link * bpf_program__attach_netkit(const struct bpf_program *prog, int ifindex, const struct bpf_netkit_opts *opts); The struct bpf_netkit_opts is done in similar way as struct bpf_tcx_opts for supporting bpf_mprog control parameters. The attach location for the primary and peer device is derived from the program section "netkit/primary" and "netkit/peer", respectively. Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20231024214904.29825-4-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit 5c1b994de4be8a27afa3281be2ff58b38e8bc50c Author: Daniel Borkmann Date: Tue Oct 24 23:48:59 2023 +0200 tools: Sync if_link uapi header Sync if_link uapi header to the latest version as we need the refresher in tooling for netkit device. Given it's been a while since the last sync and the diff is fairly big, it has been done as its own commit. Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20231024214904.29825-3-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit 35dfaad7188cdc043fde31709c796f5a692ba2bd Author: Daniel Borkmann Date: Tue Oct 24 23:48:58 2023 +0200 netkit, bpf: Add bpf programmable net device This work adds a new, minimal BPF-programmable device called "netkit" (former PoC code-name "meta") we recently presented at LSF/MM/BPF. The core idea is that BPF programs are executed within the drivers xmit routine and therefore e.g. in case of containers/Pods moving BPF processing closer to the source. One of the goals was that in case of Pod egress traffic, this allows to move BPF programs from hostns tcx ingress into the device itself, providing earlier drop or forward mechanisms, for example, if the BPF program determines that the skb must be sent out of the node, then a redirect to the physical device can take place directly without going through per-CPU backlog queue. This helps to shift processing for such traffic from softirq to process context, leading to better scheduling decisions/performance (see measurements in the slides). In this initial version, the netkit device ships as a pair, but we plan to extend this further so it can also operate in single device mode. The pair comes with a primary and a peer device. Only the primary device, typically residing in hostns, can manage BPF programs for itself and its peer. The peer device is designated for containers/Pods and cannot attach/detach BPF programs. Upon the device creation, the user can set the default policy to 'pass' or 'drop' for the case when no BPF program is attached. Additionally, the device can be operated in L3 (default) or L2 mode. The management of BPF programs is done via bpf_mprog, so that multi-attach is supported right from the beginning with similar API and dependency controls as tcx. For details on the latter see commit 053c8e1f235d ("bpf: Add generic attach/detach/query API for multi-progs"). tc BPF compatibility is provided, so that existing programs can be easily migrated. Going forward, we plan to use netkit devices in Cilium as the main device type for connecting Pods. They will be operated in L3 mode in order to simplify a Pod's neighbor management and the peer will operate in default drop mode, so that no traffic is leaving between the time when a Pod is brought up by the CNI plugin and programs attached by the agent. Additionally, the programs we attach via tcx on the physical devices are using bpf_redirect_peer() for inbound traffic into netkit device, hence the latter is also supporting the ndo_get_peer_dev callback. Similarly, we use bpf_redirect_neigh() for the way out, pushing from netkit peer to phys device directly. Also, BIG TCP is supported on netkit device. For the follow-up work in single device mode, we plan to convert Cilium's cilium_host/_net devices into a single one. An extensive test suite for checking device operations and the BPF program and link management API comes as BPF selftests in this series. Co-developed-by: Nikolay Aleksandrov Signed-off-by: Nikolay Aleksandrov Signed-off-by: Daniel Borkmann Reviewed-by: Toke Høiland-Jørgensen Acked-by: Stanislav Fomichev Acked-by: Martin KaFai Lau Link: https://github.com/borkmann/iproute2/tree/pr/netkit Link: http://vger.kernel.org/bpfconf2023_material/tcx_meta_netdev_borkmann.pdf (24ff.) Link: https://lore.kernel.org/r/20231024214904.29825-2-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit 9214c9d56c470b183f3d374c7aed7c8756f80fd9 Author: Alison Schofield Date: Tue Aug 15 10:20:52 2023 -0700 cxl/mbox: Remove useless cast in cxl_mem_create_range_info() DEFINE_RES_MEM() is a wrapper around the DEFINE_RES_NAMED() macro which already has the (struct resource) for the compound literal. The user of the macro should not repeat the cast. Cleans up these sparse warnings: drivers/cxl/core/mbox.c:1184:18: warning: cast to non-scalar drivers/cxl/core/mbox.c:1184:18: warning: cast from non-scalar Fixes: 52c4d11f1dce ("resource: Convert DEFINE_RES_NAMED() to be compound literal") Signed-off-by: Alison Schofield Reviewed-by: Jonathan Cameron Reviewed-by: Davidlohr Bueso Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230815172052.22514-1-alison.schofield@intel.com Signed-off-by: Dan Williams commit 62708be351fe7b06be6f6fd30e95c94095bf21d3 Author: Raghavendra Rao Ananta Date: Fri Oct 20 21:40:52 2023 +0000 KVM: selftests: aarch64: vPMU test for validating user accesses Add a vPMU test scenario to validate the userspace accesses for the registers PM{C,I}NTEN{SET,CLR} and PMOVS{SET,CLR} to ensure that KVM honors the architectural definitions of these registers for a given PMCR.N. Signed-off-by: Raghavendra Rao Ananta Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231020214053.2144305-13-rananta@google.com Signed-off-by: Oliver Upton commit e1cc87206348f36fb78e417b5813f78f672a4aef Author: Reiji Watanabe Date: Fri Oct 20 21:40:51 2023 +0000 KVM: selftests: aarch64: vPMU register test for unimplemented counters Add a new test case to the vpmu_counter_access test to check if PMU registers or their bits for unimplemented counters are not accessible or are RAZ, as expected. Signed-off-by: Reiji Watanabe Signed-off-by: Raghavendra Rao Ananta Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231020214053.2144305-12-rananta@google.com [Oliver: fix issues relating to exception return address] Signed-off-by: Oliver Upton commit ada1ae68262deea2685ccd38136ea2db233dfc4c Author: Reiji Watanabe Date: Fri Oct 20 21:40:50 2023 +0000 KVM: selftests: aarch64: vPMU register test for implemented counters Add a new test case to the vpmu_counter_access test to check if PMU registers or their bits for implemented counters on the vCPU are readable/writable as expected, and can be programmed to count events. Signed-off-by: Reiji Watanabe Signed-off-by: Raghavendra Rao Ananta Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231020214053.2144305-11-rananta@google.com Signed-off-by: Oliver Upton commit 8d0aebe1ca2bd6f86ee2b4de30c8a4aafcf2908b Author: Reiji Watanabe Date: Fri Oct 20 21:40:49 2023 +0000 KVM: selftests: aarch64: Introduce vpmu_counter_access test Introduce vpmu_counter_access test for arm64 platforms. The test configures PMUv3 for a vCPU, sets PMCR_EL0.N for the vCPU, and check if the guest can consistently see the same number of the PMU event counters (PMCR_EL0.N) that userspace sets. This test case is done with each of the PMCR_EL0.N values from 0 to 31 (With the PMCR_EL0.N values greater than the host value, the test expects KVM_SET_ONE_REG for the PMCR_EL0 to fail). Signed-off-by: Reiji Watanabe Signed-off-by: Raghavendra Rao Ananta Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231020214053.2144305-10-rananta@google.com Signed-off-by: Oliver Upton commit 9f4b3273dfbe0ecb628b65fe9a80aae17caba20f Author: Raghavendra Rao Ananta Date: Fri Oct 20 21:40:48 2023 +0000 tools: Import arm_pmuv3.h Import kernel's include/linux/perf/arm_pmuv3.h, with the definition of PMEVN_SWITCH() additionally including an assert() for the 'default' case. The following patches will use macros defined in this header. Signed-off-by: Raghavendra Rao Ananta Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231020214053.2144305-9-rananta@google.com Signed-off-by: Oliver Upton commit ea9ca904d24ff15ded92fd76c16462c47bcae2f8 Author: Reiji Watanabe Date: Fri Oct 20 21:40:47 2023 +0000 KVM: arm64: PMU: Allow userspace to limit PMCR_EL0.N for the guest KVM does not yet support userspace modifying PMCR_EL0.N (With the previous patch, KVM ignores what is written by userspace). Add support userspace limiting PMCR_EL0.N. Disallow userspace to set PMCR_EL0.N to a value that is greater than the host value as KVM doesn't support more event counters than what the host HW implements. Also, make this register immutable after the VM has started running. To maintain the existing expectations, instead of returning an error, KVM returns a success for these two cases. Finally, ignore writes to read-only bits that are cleared on vCPU reset, and RES{0,1} bits (including writable bits that KVM doesn't support yet), as those bits shouldn't be modified (at least with the current KVM). Co-developed-by: Marc Zyngier Signed-off-by: Marc Zyngier Signed-off-by: Reiji Watanabe Signed-off-by: Raghavendra Rao Ananta Link: https://lore.kernel.org/r/20231020214053.2144305-8-rananta@google.com Signed-off-by: Oliver Upton commit 27131b199f9fdc0e15baa0ff9d1695b54a96e39c Author: Raghavendra Rao Ananta Date: Fri Oct 20 21:40:46 2023 +0000 KVM: arm64: Sanitize PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR} before first run For unimplemented counters, the registers PM{C,I}NTEN{SET,CLR} and PMOVS{SET,CLR} are expected to have the corresponding bits RAZ. Hence to ensure correct KVM's PMU emulation, mask out the RES0 bits. Defer this work to the point that userspace can no longer change the number of advertised PMCs. Signed-off-by: Raghavendra Rao Ananta Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231020214053.2144305-7-rananta@google.com Signed-off-by: Oliver Upton commit a45f41d754e0b37de4b7dc1fb3c6b7a1285882fc Author: Raghavendra Rao Ananta Date: Fri Oct 20 21:40:45 2023 +0000 KVM: arm64: Add {get,set}_user for PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR} For unimplemented counters, the bits in PM{C,I}NTEN{SET,CLR} and PMOVS{SET,CLR} registers are expected to RAZ. To honor this, explicitly implement the {get,set}_user functions for these registers to mask out unimplemented counters for userspace reads and writes. Co-developed-by: Marc Zyngier Signed-off-by: Marc Zyngier Signed-off-by: Raghavendra Rao Ananta Link: https://lore.kernel.org/r/20231020214053.2144305-6-rananta@google.com [Oliver: drop unnecessary locking] Signed-off-by: Oliver Upton commit 4d20debf9ca160720a0b01ba4f2dc3d62296c4d1 Author: Raghavendra Rao Ananta Date: Fri Oct 20 21:40:44 2023 +0000 KVM: arm64: PMU: Set PMCR_EL0.N for vCPU based on the associated PMU The number of PMU event counters is indicated in PMCR_EL0.N. For a vCPU with PMUv3 configured, the value is set to the same value as the current PE on every vCPU reset. Unless the vCPU is pinned to PEs that has the PMU associated to the guest from the initial vCPU reset, the value might be different from the PMU's PMCR_EL0.N on heterogeneous PMU systems. Fix this by setting the vCPU's PMCR_EL0.N to the PMU's PMCR_EL0.N value. Track the PMCR_EL0.N per guest, as only one PMU can be set for the guest (PMCR_EL0.N must be the same for all vCPUs of the guest), and it is convenient for updating the value. To achieve this, the patch introduces a helper, kvm_arm_pmu_get_max_counters(), that reads the maximum number of counters from the arm_pmu associated to the VM. Make the function global as upcoming patches will be interested to know the value while setting the PMCR.N of the guest from userspace. KVM does not yet support userspace modifying PMCR_EL0.N. The following patch will add support for that. Reviewed-by: Sebastian Ott Co-developed-by: Marc Zyngier Signed-off-by: Marc Zyngier Signed-off-by: Reiji Watanabe Signed-off-by: Raghavendra Rao Ananta Link: https://lore.kernel.org/r/20231020214053.2144305-5-rananta@google.com Signed-off-by: Oliver Upton commit 57fc267f1b5caa56dfb46f60e20e673cbc4cc4a8 Author: Reiji Watanabe Date: Fri Oct 20 21:40:43 2023 +0000 KVM: arm64: PMU: Add a helper to read a vCPU's PMCR_EL0 Add a helper to read a vCPU's PMCR_EL0, and use it whenever KVM reads a vCPU's PMCR_EL0. Currently, the PMCR_EL0 value is tracked per vCPU. The following patches will make (only) PMCR_EL0.N track per guest. Having the new helper will be useful to combine the PMCR_EL0.N field (tracked per guest) and the other fields (tracked per vCPU) to provide the value of PMCR_EL0. No functional change intended. Reviewed-by: Sebastian Ott Signed-off-by: Reiji Watanabe Signed-off-by: Raghavendra Rao Ananta Reviewed-by: Eric Auger Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231020214053.2144305-4-rananta@google.com Signed-off-by: Oliver Upton commit 427733579744ef22ee6d0da9907560d79d937458 Author: Reiji Watanabe Date: Fri Oct 20 21:40:42 2023 +0000 KVM: arm64: Select default PMU in KVM_ARM_VCPU_INIT handler Future changes to KVM's sysreg emulation will rely on having a valid PMU instance to determine the number of implemented counters (PMCR_EL0.N). This is earlier than when userspace is expected to modify the vPMU device attributes, where the default is selected today. Select the default PMU when handling KVM_ARM_VCPU_INIT such that it is available in time for sysreg emulation. Reviewed-by: Sebastian Ott Co-developed-by: Marc Zyngier Signed-off-by: Marc Zyngier Signed-off-by: Reiji Watanabe Signed-off-by: Raghavendra Rao Ananta Link: https://lore.kernel.org/r/20231020214053.2144305-3-rananta@google.com [Oliver: rewrite changelog] Signed-off-by: Oliver Upton commit 8a0395578a9bb8937d1cc88c3f2e17e437467c2d Author: Bjorn Helgaas Date: Tue Oct 10 15:44:36 2023 -0500 PCI/portdrv: Use FIELD_GET() Use FIELD_GET() to remove dependences on the field position, i.e., the shift value. No functional change intended. Link: https://lore.kernel.org/r/20231010204436.1000644-11-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Ilpo Järvinen Reviewed-by: Jonathan Cameron Reviewed-by: Kuppuswamy Sathyanarayanan commit cf17770598a2a2451739c724f4dfe4fb1b6cd5d3 Author: Bjorn Helgaas Date: Tue Oct 10 15:44:35 2023 -0500 PCI/VC: Use FIELD_GET() Use FIELD_GET() to remove dependences on the field position, i.e., the shift value. No functional change intended. Link: https://lore.kernel.org/r/20231010204436.1000644-10-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Ilpo Järvinen Reviewed-by: Jonathan Cameron Reviewed-by: Kuppuswamy Sathyanarayanan commit 83728ff4943b599dc89cebfbb3102275e8444c33 Author: Bjorn Helgaas Date: Tue Oct 10 15:44:34 2023 -0500 PCI/PTM: Use FIELD_GET() Use FIELD_GET() and FIELD_PREP() to remove dependences on the field position, i.e., the shift value. No functional change intended. Link: https://lore.kernel.org/r/20231010204436.1000644-9-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Jonathan Cameron Reviewed-by: Kuppuswamy Sathyanarayanan commit ec302b118a59785511d6f90592a8be097d67341c Author: Bjorn Helgaas Date: Tue Oct 10 15:44:33 2023 -0500 PCI/PME: Use FIELD_GET() Use FIELD_GET() to remove dependences on the field position, i.e., the shift value. No functional change intended. Link: https://lore.kernel.org/r/20231010204436.1000644-8-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Ilpo Järvinen Reviewed-by: Jonathan Cameron Reviewed-by: Kuppuswamy Sathyanarayanan commit e0701bd0e6669e4c4b0d11254f5948ebf8d0b732 Author: Bjorn Helgaas Date: Tue Oct 10 15:44:31 2023 -0500 PCI/ATS: Use FIELD_GET() Use FIELD_GET() to remove dependences on the field position, i.e., the shift value. No functional change intended. Link: https://lore.kernel.org/r/20231010204436.1000644-6-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Jonathan Cameron Reviewed-by: Ilpo Järvinen Reviewed-by: Kuppuswamy Sathyanarayanan commit d30fea25845ff65ea1fb255d7b615cd02b65095b Author: Bjorn Helgaas Date: Tue Oct 10 15:44:30 2023 -0500 PCI/ATS: Show PASID Capability register width in bitmasks The PASID Capability and Control registers are both 16 bits wide. Use 16-bit wide constants in field names to match the register width. No functional change intended. Link: https://lore.kernel.org/r/20231010204436.1000644-5-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Ilpo Järvinen Reviewed-by: Jonathan Cameron Reviewed-by: Kuppuswamy Sathyanarayanan commit 8e37372ad0bea4c9b4712d9943f6ae96cff9491f Author: Heiner Kallweit Date: Wed Oct 11 09:46:45 2023 +0200 PCI/ASPM: Fix L1 substate handling in aspm_attr_store_common() aspm_attr_store_common(), which handles sysfs control of ASPM, has the same problem as fb097dcd5a28 ("PCI/ASPM: Disable only ASPM_STATE_L1 when driver disables L1"): disabling L1 adds only ASPM_L1 (but not any of the L1.x substates) to the "aspm_disable" mask. Enabling one substate, e.g., L1.1, via sysfs removes ASPM_L1 from the disable mask. Since disabling L1 via sysfs doesn't add any of the substates to the disable mask, enabling L1.1 actually enables *all* the substates. In this scenario: - Write 0 to "l1_aspm" to disable L1 - Write 1 to "l1_1_aspm" to enable L1.1 the intention is to disable L1 and all L1.x substates, then enable just L1.1, but in fact, *all* L1.x substates are enabled. Fix this by explicitly disabling all the L1.x substates when disabling L1. Fixes: 72ea91afbfb0 ("PCI/ASPM: Add sysfs attributes for controlling ASPM link states") Link: https://lore.kernel.org/r/6ba7dd79-9cfe-4ed0-a002-d99cb842f361@gmail.com Signed-off-by: Heiner Kallweit [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit 3cb4f534bac010258b2688395c2f13459a932be9 Author: Heiner Kallweit Date: Wed Oct 11 09:36:40 2023 +0200 Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables L1" This reverts commit fb097dcd5a28c0a2325632405c76a66777a6bed9. After fb097dcd5a28 ("PCI/ASPM: Disable only ASPM_STATE_L1 when driver disables L1"), disabling L1 via pci_disable_link_state(PCIE_LINK_STATE_L1), then enabling one substate, e.g., L1.1, via sysfs actually enables *all* the substates. For example, r8169 disables L1 because of hardware issues on a number of systems, which implicitly disables the L1.1 and L1.2 substates. On some systems, L1 and L1.1 work fine, but L1.2 causes missed rx packets. Enabling L1.1 via the sysfs "aspm_l1_1" attribute unexpectedly enables L1.2 as well as L1.1. After fb097dcd5a28, pci_disable_link_state(PCIE_LINK_STATE_L1) adds only ASPM_L1 (but not any of the L1.x substates) to the "aspm_disable" mask: --- Before fb097dcd5a28 +++ After fb097dcd5a28 # r8169 disables L1: pci_disable_link_state(PCIE_LINK_STATE_L1) - disable |= ASPM_L1 | ASPM_L1_1 | ASPM_L1_2 | ... # disable L1, L1.x + disable |= ASPM_L1 # disable L1 only # write "1" to sysfs "aspm_l1_1" attribute: l1_1_aspm aspm_attr_store_common(state = ASPM_L1_1) disable &= ~ASPM_L1_1 # enable L1.1 if (state & (ASPM_L1_1 | ...)) # if enabling any substate disable &= ~ASPM_L1 # enable L1 # final state: - disable = ASPM_L1_2 | ... # L1, L1.1 enabled; L1.2 disabled + disable = 0 # L1, L1.1, L1.2 all enabled Enabling an L1.x substate removes the substate and L1 from the "aspm_disable" mask. After fb097dcd5a28, the substates were not added to the mask when disabling L1, so enabling one substate implicitly enables all of them. Revert fb097dcd5a28 so enabling one substate doesn't enable the others. Link: https://lore.kernel.org/r/c75931ac-7208-4200-9ca1-821629cf5e28@gmail.com Signed-off-by: Heiner Kallweit [bhelgaas: work through example in commit log] Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit 0718588c7aaa7a1510b4de972370535b61dddd0d Author: Jim Harris Date: Wed Oct 11 14:51:31 2023 +0000 cxl/region: Do not try to cleanup after cxl_region_setup_targets() fails Commit 5e42bcbc3fef ("cxl/region: decrement ->nr_targets on error in cxl_region_attach()") tried to avoid 'eiw' initialization errors when ->nr_targets exceeded 16, by just decrementing ->nr_targets when cxl_region_setup_targets() failed. Commit 86987c766276 ("cxl/region: Cleanup target list on attach error") extended that cleanup to also clear cxled->pos and p->targets[pos]. The initialization error was incidentally fixed separately by: Commit 8d4285425714 ("cxl/region: Fix port setup uninitialized variable warnings") which was merged a few days after 5e42bcbc3fef. But now the original cleanup when cxl_region_setup_targets() fails prevents endpoint and switch decoder resources from being reused: 1) the cleanup does not set the decoder's region to NULL, which results in future dpa_size_store() calls returning -EBUSY 2) the decoder is not properly freed, which results in future commit errors associated with the upstream switch Now that the initialization errors were fixed separately, the proper cleanup for this case is to just return immediately. Then the resources associated with this target get cleanup up as normal when the failed region is deleted. The ->nr_targets decrement in the error case also helped prevent a p->targets[] array overflow, so add a new check to prevent against that overflow. Tested by trying to create an invalid region for a 2 switch * 2 endpoint topology, and then following up with creating a valid region. Fixes: 5e42bcbc3fef ("cxl/region: decrement ->nr_targets on error in cxl_region_attach()") Cc: Signed-off-by: Jim Harris Reviewed-by: Jonathan Cameron Acked-by: Dan Carpenter Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/169703589120.1202031.14696100866518083806.stgit@bgt-140510-bm03.eng.stellus.in Signed-off-by: Dan Williams commit 9cca73d7b4bfec75b2fcef751015f31691afa792 Author: Justin Stitt Date: Tue Sep 26 06:59:15 2023 +0000 hwmon: (acpi_power_meter) replace open-coded kmemdup_nul `strncpy` is deprecated for use on NUL-terminated destination strings [1]. Let's refactor this kcalloc() + strncpy() into a kmemdup_nul() which has more obvious behavior and is less error prone. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230926-strncpy-drivers-hwmon-acpi_power_meter-c-v5-1-3fc31a9daf99@google.com Signed-off-by: Kees Cook commit fed2ef7abaebe5e0207cd52ae52721ea3da3b5ba Author: Kees Cook Date: Fri Sep 22 10:52:29 2023 -0700 reset: Annotate struct reset_control_array with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct reset_control_array. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Philipp Zabel Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175229.work.838-kees@kernel.org Signed-off-by: Kees Cook commit 15fcedd43a0810a5482ef759a18ab852d012cead Author: Kees Cook Date: Fri Sep 22 10:52:24 2023 -0700 kexec: Annotate struct crash_mem with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct crash_mem. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Eric Biederman Cc: kexec@lists.infradead.org Acked-by: Baoquan He Link: https://lore.kernel.org/r/20230922175224.work.712-kees@kernel.org Signed-off-by: Kees Cook commit bf5abc17bc434f27e20d3702b1992d9b5e4a7239 Author: Kees Cook Date: Fri Sep 22 10:51:15 2023 -0700 virtio_console: Annotate struct port_buffer with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct port_buffer. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Amit Shah Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: virtualization@lists.linux-foundation.org Reviewed-by: "Gustavo A. R. Silva" Reviewed-by: Amit Shah Link: https://lore.kernel.org/r/20230922175115.work.059-kees@kernel.org Signed-off-by: Kees Cook commit 2b88119e35b00d8cb418d86abbace3b90a993bd7 Author: Alex Williamson Date: Mon Oct 16 16:47:36 2023 -0600 vfio/mtty: Enable migration support The mtty driver exposes a PCI serial device to userspace and therefore makes an easy target for a sample device supporting migration. The device does not make use of DMA, therefore we can easily claim support for the migration P2P states, as well as dirty logging. This implementation also makes use of PRE_COPY support in order to provide migration stream compatibility testing, which should generally be considered good practice. Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20231016224736.2575718-3-alex.williamson@redhat.com Signed-off-by: Alex Williamson commit 293fbc28818135743f54d46c418ede3e4a20a742 Author: Alex Williamson Date: Mon Oct 16 16:47:35 2023 -0600 vfio/mtty: Overhaul mtty interrupt handling The mtty driver does not currently conform to the vfio SET_IRQS uAPI. For example, it claims to support mask and unmask of INTx, but actually does nothing. It claims to support AUTOMASK for INTx, but doesn't. It fails to teardown eventfds under the full semantics specified by the SET_IRQS ioctl. It also fails to teardown eventfds when the device is closed, leading to memory leaks. It claims to support the request IRQ, but doesn't. Fix all these. A side effect of this is that QEMU will now report a warning: vfio : Failed to set up UNMASK eventfd signaling for interrupt \ INTX-0: VFIO_DEVICE_SET_IRQS failure: Inappropriate ioctl for device The fact is that the unmask eventfd was never supported but quietly failed. mtty never honored the AUTOMASK behavior, therefore there was nothing to unmask. QEMU is verbose about the failure, but properly falls back to userspace unmasking. Fixes: 9d1a546c53b4 ("docs: Sample driver to demonstrate how to use Mediated device framework.") Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20231016224736.2575718-2-alex.williamson@redhat.com Signed-off-by: Alex Williamson commit 37a38e439d4ed0e90d7359708ed9fca0216631b6 Author: Swarup Laxman Kotiaklapudi Date: Mon Oct 23 18:04:22 2023 +0530 selftests: net: change ifconfig with ip command Change ifconfig with ip command, on a system where ifconfig is not used this script will not work correcly. Test result with this patchset: sudo make TARGETS="net" kselftest .... TAP version 13 1..1 timeout set to 1500 selftests: net: route_localnet.sh run arp_announce test net.ipv4.conf.veth0.route_localnet = 1 net.ipv4.conf.veth1.route_localnet = 1 net.ipv4.conf.veth0.arp_announce = 2 net.ipv4.conf.veth1.arp_announce = 2 PING 127.25.3.14 (127.25.3.14) from 127.25.3.4 veth0: 56(84) bytes of data. 64 bytes from 127.25.3.14: icmp_seq=1 ttl=64 time=0.038 ms 64 bytes from 127.25.3.14: icmp_seq=2 ttl=64 time=0.068 ms 64 bytes from 127.25.3.14: icmp_seq=3 ttl=64 time=0.068 ms 64 bytes from 127.25.3.14: icmp_seq=4 ttl=64 time=0.068 ms 64 bytes from 127.25.3.14: icmp_seq=5 ttl=64 time=0.068 ms --- 127.25.3.14 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4073ms rtt min/avg/max/mdev = 0.038/0.062/0.068/0.012 ms ok run arp_ignore test net.ipv4.conf.veth0.route_localnet = 1 net.ipv4.conf.veth1.route_localnet = 1 net.ipv4.conf.veth0.arp_ignore = 3 net.ipv4.conf.veth1.arp_ignore = 3 PING 127.25.3.14 (127.25.3.14) from 127.25.3.4 veth0: 56(84) bytes of data. 64 bytes from 127.25.3.14: icmp_seq=1 ttl=64 time=0.032 ms 64 bytes from 127.25.3.14: icmp_seq=2 ttl=64 time=0.065 ms 64 bytes from 127.25.3.14: icmp_seq=3 ttl=64 time=0.066 ms 64 bytes from 127.25.3.14: icmp_seq=4 ttl=64 time=0.065 ms 64 bytes from 127.25.3.14: icmp_seq=5 ttl=64 time=0.065 ms --- 127.25.3.14 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4092ms rtt min/avg/max/mdev = 0.032/0.058/0.066/0.013 ms ok ok 1 selftests: net: route_localnet.sh ... Signed-off-by: Swarup Laxman Kotiaklapudi Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20231023123422.2895-1-swarupkotikalapudi@gmail.com Signed-off-by: Jakub Kicinski commit 58ab91718cb5bc30e3d9c17eb5e0067fe2a33b6e Merge: 00e984cb986b3 87cd83714f30e Author: Jakub Kicinski Date: Tue Oct 24 13:08:15 2023 -0700 Merge branch 'switch-dsa-to-inclusive-terminology' Florian Fainelli says: ==================== Switch DSA to inclusive terminology One of the action items following Netconf'23 is to switch subsystems to use inclusive terminology. DSA has been making extensive use of the "master" and "slave" words which are now replaced by "conduit" and "user" respectively. ==================== Link: https://lore.kernel.org/r/20231023181729.1191071-1-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski commit 87cd83714f30ef2f19f0390e98beb8d78e173f0f Author: Florian Fainelli Date: Mon Oct 23 11:17:29 2023 -0700 net: dsa: Rename IFLA_DSA_MASTER to IFLA_DSA_CONDUIT This preserves the existing IFLA_DSA_MASTER which is part of the uAPI and creates an alias named IFLA_DSA_CONDUIT. Reviewed-by: Andrew Lunn Reviewed-by: Vladimir Oltean Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20231023181729.1191071-3-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski commit 6ca80638b90cec66547011ee1ef79e534589989a Author: Florian Fainelli Date: Mon Oct 23 11:17:28 2023 -0700 net: dsa: Use conduit and user terms Use more inclusive terms throughout the DSA subsystem by moving away from "master" which is replaced by "conduit" and "slave" which is replaced by "user". No functional changes. Acked-by: Rob Herring Acked-by: Stephen Hemminger Reviewed-by: Vladimir Oltean Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20231023181729.1191071-2-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski commit a60ec4485f1c72dfece365cf95e6de82bdd74300 Author: Ville Syrjälä Date: Tue Oct 24 22:17:19 2023 +0300 powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug() Before the refactoring the pr_warn() only triggered when someone explicitly tried to write to a BIOS locked limit. After the refactoring the warning is also triggering during system resume. The user can't do anything about this so printing scary warnings doesn't make sense Keep the printk but make it pr_debug() instead of pr_warn() to make it clear it's not a serious issue. Fixes: 9050a9cd5e4c ("powercap: intel_rapl: Cleanup Power Limits support") Signed-off-by: Ville Syrjälä Cc: 6.5+ # 6.5+ Signed-off-by: Rafael J. Wysocki commit 00e984cb986b31e9313745e51daceaa1e1eb7351 Author: Gerhard Engleder Date: Mon Oct 23 20:38:56 2023 +0200 tsnep: Fix tsnep_request_irq() format-overflow warning Compiler warns about a possible format-overflow in tsnep_request_irq(): drivers/net/ethernet/engleder/tsnep_main.c:884:55: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=] sprintf(queue->name, "%s-rx-%d", name, ^ drivers/net/ethernet/engleder/tsnep_main.c:881:55: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=] sprintf(queue->name, "%s-tx-%d", name, ^ drivers/net/ethernet/engleder/tsnep_main.c:878:49: warning: '-txrx-' directive writing 6 bytes into a region of size between 5 and 25 [-Wformat-overflow=] sprintf(queue->name, "%s-txrx-%d", name, ^~~~~~ Actually overflow cannot happen. Name is limited to IFNAMSIZ, because netdev_name() is called during ndo_open(). queue_index is single char, because less than 10 queues are supported. Fix warning with snprintf(). Additionally increase buffer to 32 bytes, because those 7 additional bytes were unused anyway. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310182028.vmDthIUa-lkp@intel.com/ Signed-off-by: Gerhard Engleder Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231023183856.58373-1-gerhard@engleder-embedded.com Signed-off-by: Jakub Kicinski commit a389c8f3928b0df73419284861c20daf8362a341 Author: Johan Jonker Date: Thu Feb 2 14:59:35 2023 +0100 dt-bindings: usb: rockchip,dwc3: update inno usb2 phy binding name The binding for the inno usb2 phy was given a name in more a common format, so update the reference in rockchip,dwc3.yaml as well. Reported-by: kernel test robot Signed-off-by: Johan Jonker Link: https://lore.kernel.org/r/f8747552-d23b-c4cd-cb17-5033fb7f8eb6@gmail.com Signed-off-by: Rob Herring commit fcc017e3bc7ffff81d6d79678b3d5f6ce99b66ca Merge: fb1c535b13b7f ce4cfa2318afc Author: Jakub Kicinski Date: Tue Oct 24 13:03:00 2023 -0700 Merge branch 'net-deduplicate-netdev-name-allocation' Jakub Kicinski says: ==================== net: deduplicate netdev name allocation After recent fixes we have even more duplicated code in netdev name allocation helpers. There are two complications in this code. First, __dev_alloc_name() clobbers its output arg even if allocation fails, forcing callers to do extra copies. Second as our experience in commit 55a5ec9b7710 ("Revert "net: core: dev_get_valid_name is now the same as dev_alloc_name_ns"") and commit 029b6d140550 ("Revert "net: core: maybe return -EEXIST in __dev_alloc_name"") taught us, user space is very sensitive to the exact error codes. Align the callers of __dev_alloc_name(), and remove some of its complexity. v1: https://lore.kernel.org/all/20231020011856.3244410-1-kuba@kernel.org/ ==================== Link: https://lore.kernel.org/r/20231023152346.3639749-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit ce4cfa2318afcd74cc41992e306a28fa04e5d484 Author: Jakub Kicinski Date: Mon Oct 23 08:23:46 2023 -0700 net: remove else after return in dev_prep_valid_name() Remove unnecessary else clauses after return. I copied this if / else construct from somewhere, it makes the code harder to read. Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231023152346.3639749-7-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 70e1b14c1bcbbb0854311ff8bed6cf4db75d5f05 Author: Jakub Kicinski Date: Mon Oct 23 08:23:45 2023 -0700 net: remove dev_valid_name() check from __dev_alloc_name() __dev_alloc_name() is only called by dev_prep_valid_name(), which already checks that name is valid. Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231023152346.3639749-6-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 7ad17b04dc7bdcdd1f85e460c38da55b0afa2422 Author: Jakub Kicinski Date: Mon Oct 23 08:23:44 2023 -0700 net: trust the bitmap in __dev_alloc_name() Prior to restructuring __dev_alloc_name() handled both printf and non-printf names. In a clever attempt at code reuse it always prints the name into a buffer and checks if it's a duplicate. Trust the bitmap, and return an error if its full. This shrinks the possible ID space by one from 32K to 32K - 1, as previously the max value would have been tried as a valid ID. It seems very unlikely that anyone would care as we heard no requests to increase the max beyond 32k. Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231023152346.3639749-5-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 9a810468126c846299d867f73dd7053064c29be1 Author: Jakub Kicinski Date: Mon Oct 23 08:23:43 2023 -0700 net: reduce indentation of __dev_alloc_name() All callers of __dev_valid_name() go thru dev_prep_valid_name() which handles the non-printf case. Focus __dev_alloc_name() on the sprintf case, remove the indentation level. Minor functional change of returning -EINVAL if % is not found, which should now never happen. Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231023152346.3639749-4-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 556c755a4d8143007c745b6ad894611a04173b53 Author: Jakub Kicinski Date: Mon Oct 23 08:23:42 2023 -0700 net: make dev_alloc_name() call dev_prep_valid_name() __dev_alloc_name() handles both the sprintf and non-sprintf target names. This complicates the code. dev_prep_valid_name() already handles the non-sprintf case, before calling __dev_alloc_name(), make the only other caller also go thru dev_prep_valid_name(). This way we can drop the non-sprintf handling in __dev_alloc_name() in one of the next changes. commit 55a5ec9b7710 ("Revert "net: core: dev_get_valid_name is now the same as dev_alloc_name_ns"") and commit 029b6d140550 ("Revert "net: core: maybe return -EEXIST in __dev_alloc_name"") tell us that we can't start returning -EEXIST from dev_alloc_name() on name duplicates. Bite the bullet and pass the expected errno to dev_prep_valid_name(). dev_prep_valid_name() must now propagate out the allocated id for printf names. Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231023152346.3639749-3-kuba@kernel.org Signed-off-by: Jakub Kicinski commit bd07063dd11f6fda903802a5868960be3690d327 Author: Jakub Kicinski Date: Mon Oct 23 08:23:41 2023 -0700 net: don't use input buffer of __dev_alloc_name() as a scratch space Callers of __dev_alloc_name() want to pass dev->name as the output buffer. Make __dev_alloc_name() not clobber that buffer on failure, and remove the workarounds in callers. dev_alloc_name_ns() is now completely unnecessary. The extra strscpy() added here will be gone by the end of the patch series. Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231023152346.3639749-2-kuba@kernel.org Signed-off-by: Jakub Kicinski commit ea167a7fc2426f7685c3735e104921c1a20a6d3f Author: Christian Marangi Date: Tue Oct 24 20:30:14 2023 +0200 cpufreq: stats: Fix buffer overflow detection in trans_stats() Commit 3c0897c180c6 ("cpufreq: Use scnprintf() for avoiding potential buffer overflow") switched from snprintf to the more secure scnprintf but never updated the exit condition for PAGE_SIZE. As the commit say and as scnprintf document, what scnprintf returns what is actually written not counting the '\0' end char. This results in the case of len exceeding the size, len set to PAGE_SIZE - 1, as it can be written at max PAGE_SIZE - 1 (as '\0' is not counted) Because of len is never set to PAGE_SIZE, the function never break early, never prints the warning and never return -EFBIG. Fix this by changing the condition to PAGE_SIZE - 1 to correctly trigger the error. Cc: 5.10+ # 5.10+ Fixes: 3c0897c180c6 ("cpufreq: Use scnprintf() for avoiding potential buffer overflow") Signed-off-by: Christian Marangi [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit fb1c535b13b7fa013e70265535182638ef2f04d6 Merge: 6d25d1dc76bf5 aab4d8564947f Author: Jakub Kicinski Date: Tue Oct 24 13:00:33 2023 -0700 Merge branch 'mptcp-convert-netlink-code-to-use-yaml-spec' Mat Martineau says: ==================== mptcp: convert Netlink code to use YAML spec This series from Davide converts most of the MPTCP Netlink interface (plus uAPI bits) to use sources generated by YNL using a YAML spec file. This new YAML file is useful to validate the API and to generate a good documentation page. Patch 1 modifies YNL spec to support "uns-admin-perm" for genetlink legacy. Patch 2 adds support for validating exact length of netlink attrs. Patch 3 converts Netlink structures from small_ops to ops to prepare the switch to YAML. Patch 4 adds the Netlink YAML spec for MPTCP. Patch 5 adds and uses a new header file generated from the new YAML spec. Patch 6 renames some handlers to match the ones generated from the YAML spec. Patch 7 adds and uses Netlink policies automatically generated from the YAML spec. ==================== Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-1-v2-0-16b1f701f900@kernel.org Signed-off-by: Jakub Kicinski commit aab4d8564947f391674391e5c346d7f6f1c49f89 Author: Davide Caratti Date: Mon Oct 23 11:17:11 2023 -0700 net: mptcp: use policy generated by YAML spec generated with: $ ./tools/net/ynl/ynl-gen-c.py --mode kernel \ > --spec Documentation/netlink/specs/mptcp.yaml --source \ > -o net/mptcp/mptcp_pm_gen.c $ ./tools/net/ynl/ynl-gen-c.py --mode kernel \ > --spec Documentation/netlink/specs/mptcp.yaml --header \ > -o net/mptcp/mptcp_pm_gen.h Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/340 Acked-by: Paolo Abeni Signed-off-by: Davide Caratti Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-1-v2-7-16b1f701f900@kernel.org Signed-off-by: Jakub Kicinski commit 1e07938e29c587eaae069f6c624daa4c2a56331c Author: Davide Caratti Date: Mon Oct 23 11:17:10 2023 -0700 net: mptcp: rename netlink handlers to mptcp_pm_nl__{doit,dumpit} so that they will match names generated from YAML spec. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/340 Suggested-by: Paolo Abeni Acked-by: Paolo Abeni Signed-off-by: Davide Caratti Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-1-v2-6-16b1f701f900@kernel.org Signed-off-by: Jakub Kicinski commit 9d1ed17f93ce873cda16698267bdee096a768839 Author: Davide Caratti Date: Mon Oct 23 11:17:09 2023 -0700 uapi: mptcp: use header file generated from YAML spec generated with: $ ./tools/net/ynl/ynl-gen-c.py --mode uapi \ > --spec Documentation/netlink/specs/mptcp.yaml \ > --header -o include/uapi/linux/mptcp_pm.h Link: https://github.com/multipath-tcp/mptcp_net-next/issues/340 Acked-by: Paolo Abeni Signed-off-by: Davide Caratti Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-1-v2-5-16b1f701f900@kernel.org Signed-off-by: Jakub Kicinski commit bc8aeb2045e22fe8fc86b6b4a7d63f61c29734c9 Author: Davide Caratti Date: Mon Oct 23 11:17:08 2023 -0700 Documentation: netlink: add a YAML spec for mptcp it describes most of the current netlink interface (uAPI definitions, doit/dumpit operations and attributes) Link: https://github.com/multipath-tcp/mptcp_net-next/issues/340 Acked-by: Paolo Abeni Signed-off-by: Davide Caratti Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-1-v2-4-16b1f701f900@kernel.org Signed-off-by: Jakub Kicinski commit 1d0507f46843b14b0cb051fe50ebc7e6432111ab Author: Davide Caratti Date: Mon Oct 23 11:17:07 2023 -0700 net: mptcp: convert netlink from small_ops to ops in the current MPTCP control plane, all operations use a netlink attribute of the same type "MPTCP_PM_ATTR". However, add/del/get/flush operations only parse the first element in the message _ the one that describes MPTCP endpoints (that was named MPTCP_PM_ATTR_ADDR and mostly used in ADD_ADDR operations _ probably the similarity of "attr", "addr" and "add" might cause some confusion to human readers). Convert MPTCP from 'small_ops' to 'ops', thus allowing different attributes for each single operation, hopefully makes all this clearer to human readers. - use a separate attribute set for add/del/get/flush address operation, binary compatible with the existing one, to store the endpoint address. MPTCP_PM_ENDPOINT_ADDR is added to the uAPI (with the same value as MPTCP_PM_ATTR_ADDR) for these operations. - convert mptcp_pm_ops[] and add policy files accordingly. this prepares MPTCP control plane to be described as YAML spec. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/340 Acked-by: Paolo Abeni Signed-off-by: Davide Caratti Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-1-v2-3-16b1f701f900@kernel.org Signed-off-by: Jakub Kicinski commit 0c63ad3795269849782ca24a084952206986d3bf Author: Davide Caratti Date: Mon Oct 23 11:17:06 2023 -0700 tools: ynl-gen: add support for exact-len validation add support for 'exact-len' validation on netlink attributes. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/340 Acked-by: Matthieu Baerts Signed-off-by: Davide Caratti Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-1-v2-2-16b1f701f900@kernel.org Signed-off-by: Jakub Kicinski commit 52c121f4bf27592530f3fedf123b89ed79397af8 Author: Davide Caratti Date: Mon Oct 23 11:17:05 2023 -0700 tools: ynl: add uns-admin-perm to genetlink legacy this flag maps to GENL_UNS_ADMIN_PERM and will be used by future specs. Acked-by: Paolo Abeni Signed-off-by: Davide Caratti Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231023-send-net-next-20231023-1-v2-1-16b1f701f900@kernel.org Signed-off-by: Jakub Kicinski commit 891ddc03e2f4395e24795596e032f57d5ab37fe7 Author: Jonathan Denose Date: Tue Oct 24 09:13:36 2023 -0500 ACPI: EC: Add quirk for HP 250 G7 Notebook PC Add GPE quirk entry for HP 250 G7 Notebook PC. This change allows the lid switch to be identified as the lid switch and not a keyboard button. With the lid switch properly identified, the device triggers suspend correctly on lid close. Signed-off-by: Jonathan Denose Signed-off-by: Rafael J. Wysocki commit 45f56711daa8e219f6bf5a18746b072e37c988d6 Author: Raag Jadav Date: Tue Oct 24 11:50:16 2023 +0530 ACPI: x86: use acpi_dev_uid_match() for matching _UID Convert manual _UID references to use the standard ACPI helper. Signed-off-by: Raag Jadav Reviewed-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki commit 3a3cc54605e4854b241ac3e2771b6f2a77aedd90 Author: Raag Jadav Date: Tue Oct 24 11:50:15 2023 +0530 ACPI: utils: use acpi_dev_uid_match() for matching _UID Convert manual _UID references to use the standard ACPI helper. Signed-off-by: Raag Jadav Signed-off-by: Rafael J. Wysocki commit 2d5bd3cbb0119d8626f706176a01ad9e59bfd89b Author: Raag Jadav Date: Tue Oct 24 11:50:14 2023 +0530 pinctrl: intel: use acpi_dev_uid_match() for matching _UID Convert manual _UID references to use the standard ACPI helper. Signed-off-by: Raag Jadav Reviewed-by: Mika Westerberg Acked-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki commit a3a62ca256ab1d1ba771ee243ec4a8e8b7856f08 Author: Raag Jadav Date: Tue Oct 24 11:50:13 2023 +0530 ACPI: utils: Introduce acpi_dev_uid_match() for matching _UID Introduce acpi_dev_uid_match() helper that matches the device with supplied _UID string. Signed-off-by: Raag Jadav Reviewed-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki commit d4b384228562848e4b76b608a5876c92160e993c Author: Jonas Karlman Date: Mon Oct 23 17:37:15 2023 +0000 drm/rockchip: vop: Add NV15, NV20 and NV30 support Add support for displaying 10-bit 4:2:0 and 4:2:2 formats produced by the Rockchip Video Decoder on RK322X, RK3288, RK3328 and RK3399. Also add support for 10-bit 4:4:4 format while at it. V5: Use drm_format_info_min_pitch() for correct bpp Add missing NV21, NV61 and NV42 formats V4: Rework RK3328/RK3399 win0/1 data to not affect RK3368 V2: Added NV30 support Signed-off-by: Jonas Karlman Reviewed-by: Sandy Huang Reviewed-by: Christopher Obbard Tested-by: Christopher Obbard Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231023173718.188102-3-jonas@kwiboo.se commit 728c15b4b5f3369cbde73d5e0f14701ab370f985 Author: Jonas Karlman Date: Mon Oct 23 17:37:14 2023 +0000 drm/fourcc: Add NV20 and NV30 YUV formats DRM_FORMAT_NV20 and DRM_FORMAT_NV30 formats is the 2x1 and non-subsampled variant of NV15, a 10-bit 2-plane YUV format that has no padding between components. Instead, luminance and chrominance samples are grouped into 4s so that each group is packed into an integer number of bytes: YYYY = UVUV = 4 * 10 bits = 40 bits = 5 bytes The '20' and '30' suffix refers to the optimum effective bits per pixel which is achieved when the total number of luminance samples is a multiple of 4. V2: Added NV30 format Signed-off-by: Jonas Karlman Reviewed-by: Sandy Huang Reviewed-by: Christopher Obbard Tested-by: Christopher Obbard Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231023173718.188102-2-jonas@kwiboo.se commit bc8f7abe97159ee68106e5a99d5fc242cd01f150 Author: Christophe JAILLET Date: Mon Oct 23 21:33:17 2023 +0200 ACPI: sysfs: Clean up create_pnp_modalias() and create_of_modalias() 'modalias' is only written with snprintf() and it is already guaranteed to be nul-terminated, so remove the unneeded (but harmless) writes of a trailing '\0' to it. Also snprintf() never returns negative values, so remove redundant (but harmless) checks for it. Signed-off-by: Christophe JAILLET [ rjw: Merge two patches into one, combine changelogs, add subject ] Signed-off-by: Rafael J. Wysocki commit 48cf49d31994ff97b33c4044e618560ec84d35fb Author: Christophe JAILLET Date: Mon Oct 23 20:32:54 2023 +0200 ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() snprintf() does not return negative values on error. To know if the buffer was too small, the returned value needs to be compared with the length of the passed buffer. If it is greater or equal, the output has been truncated, so add checks for the truncation to create_pnp_modalias() and create_of_modalias(). Also make them return -ENOMEM in that case, as they already do that elsewhere. Moreover, the remaining size of the buffer used by snprintf() needs to be updated after the first write to avoid out-of-bounds access as already done correctly in create_pnp_modalias(), but not in create_of_modalias(), so change the latter accordingly. Fixes: 8765c5ba1949 ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Christophe JAILLET [ rjw: Merge two patches into one, combine changelogs, add subject ] Signed-off-by: Rafael J. Wysocki commit 215737e37d07ade8952048339e37aec6c6f82223 Author: Andy Yan Date: Wed Oct 18 17:43:39 2023 +0800 drm/rockchip: vop2: rename window formats to show window type using them formats_win_full_10bit is for cluster window, formats_win_full_10bit_yuyv is for rk356x esmart, rk3588 esmart window will support more format. formats_win_lite is for smart window. Rename it based the windows type may let meaning is clearer Signed-off-by: Andy Yan Acked-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231018094339.2476142-1-andyshrk@163.com commit bfd8a5c228fa3bb97884f77529c09e8745da08b9 Author: Andy Yan Date: Wed Oct 18 17:43:18 2023 +0800 drm/rockchip: vop2: Add more supported 10bit formats Add 10 bit RGB and AFBC based YUV format supported by vop2. Signed-off-by: Andy Yan Acked-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231018094318.2476081-1-andyshrk@163.com commit 01d5a75370a60c3a8d691347ae6ebb2a9f8dc44a Author: Andy Yan Date: Wed Oct 18 17:42:39 2023 +0800 drm/rockchip: vop2: remove the unsupported format of cluster window The cluster window on vop2 doesn't support linear yuv format(NV12/16/24), it only support afbc based yuv format(DRM_FORMAT_YUV420_8BIT/10BIT), which will be added in next patch. Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver") Signed-off-by: Andy Yan Acked-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231018094239.2475851-1-andyshrk@163.com commit 45ad07c7053df0b67e13d8deb574920d11651fb2 Author: Andy Yan Date: Wed Oct 18 17:42:10 2023 +0800 drm/rockchip: vop: fix format bpp calculation We can't rely on cpp for bpp calculation as the cpp of some formats(DRM_FORMAT_YUV420_8BIT/10BIT, etc) is zero. Signed-off-by: Andy Yan Acked-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231018094210.2475771-1-andyshrk@163.com commit ae8d3522e5b7208d238c893a00957864536983dc Author: Oliver Upton Date: Thu Oct 19 18:56:18 2023 +0000 KVM: arm64: Add PMU event filter bits required if EL3 is implemented Suzuki noticed that KVM's PMU emulation is oblivious to the NSU and NSK event filter bits. On systems that have EL3 these bits modify the filter behavior in non-secure EL0 and EL1, respectively. Even though the kernel doesn't use these bits, it is entirely possible some other guest OS does. Additionally, it would appear that these and the M bit are required by the architecture if EL3 is implemented. Allow the EL3 event filter bits to be set if EL3 is advertised in the guest's ID register. Implement the behavior of NSU and NSK according to the pseudocode, and entirely ignore the M bit for perf event creation. Reported-by: Suzuki K Poulose Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20231019185618.3442949-3-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit bc512d6a9b92390760f0e8c895501c5016539929 Author: Oliver Upton Date: Thu Oct 19 18:56:17 2023 +0000 KVM: arm64: Make PMEVTYPER_EL0.NSH RES0 if EL2 isn't advertised The NSH bit, which filters event counting at EL2, is required by the architecture if an implementation has EL2. Even though KVM doesn't support nested virt yet, it makes no effort to hide the existence of EL2 from the ID registers. Userspace can, however, change the value of PFR0 to hide EL2. Align KVM's sysreg emulation with the architecture and make NSH RES0 if EL2 isn't advertised. Keep in mind the bit is ignored when constructing the backing perf event. While at it, build the event type mask using explicit field definitions instead of relying on ARMV8_PMU_EVTYPE_MASK. KVM probably should've been doing this in the first place, as it avoids changes to the aforementioned mask affecting sysreg emulation. Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20231019185618.3442949-2-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 1616ca6f3c10723c1b60ae44724212fae88f502d Author: Reiji Watanabe Date: Fri Oct 20 21:40:41 2023 +0000 KVM: arm64: PMU: Introduce helpers to set the guest's PMU Introduce new helper functions to set the guest's PMU (kvm->arch.arm_pmu) either to a default probed instance or to a caller requested one, and use it when the guest's PMU needs to be set. These helpers will make it easier for the following patches to modify the relevant code. No functional change intended. Reviewed-by: Sebastian Ott Signed-off-by: Reiji Watanabe Signed-off-by: Raghavendra Rao Ananta Reviewed-by: Eric Auger Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231020214053.2144305-2-rananta@google.com Signed-off-by: Oliver Upton commit 5ccd40c5c7ada69d7465478336eb50ea93d54d6d Author: Michal Wilczynski Date: Wed Oct 18 22:09:45 2023 +0300 ACPI: acpi_pad: Rename ACPI device from device to adev Since transformation from ACPI driver to platform driver there are two devices on which the driver operates - ACPI device and platform device. For the sake of reader this calls for the distinction in their naming, to avoid confusion. Rename device to adev, as corresponding platform device is called pdev. Signed-off-by: Michal Wilczynski Signed-off-by: Rafael J. Wysocki commit d7228c7169e7f84013a909055c52585a8d4e1ab0 Author: Michal Wilczynski Date: Wed Oct 18 22:09:44 2023 +0300 ACPI: acpi_pad: Use dev groups for sysfs Change the way sysfs files are created. Use dev_groups, as it's a better approach - it allows to declare attributes, and the core code would take care of the lifecycle of those objects. Suggested-by: Andy Shevchenko Signed-off-by: Michal Wilczynski Signed-off-by: Rafael J. Wysocki commit dd0261bb9e4435a426cd86a28516129c46929ea4 Author: Michal Wilczynski Date: Wed Oct 18 22:09:43 2023 +0300 ACPI: acpi_pad: Replace acpi_driver with platform_driver The acpi_pad driver uses struct acpi_driver to register itself while it would be more logically consistent to use struct platform_driver for this purpose, because the corresponding platform device is present and the role of struct acpi_device is to amend the other bus types. ACPI devices are not meant to be used as proper representation of hardware entities, but to collect information on those hardware entities provided by the platform firmware. Use struct platform_driver for registering the acpi_pad driver. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski Signed-off-by: Rafael J. Wysocki commit fac475aab70b2b6d44f54edea85e8bd276a1fe60 Author: Jeshua Smith Date: Wed Jul 12 22:34:48 2023 +0000 ACPI: APEI: Use ERST timeout for slow devices Slow devices such as flash may not meet the default 1ms timeout value, so use the ERST max execution time value that they provide as the timeout if it is larger. Signed-off-by: Jeshua Smith Reviewed-by: Tony Luck Signed-off-by: Rafael J. Wysocki commit 93e82bb4de0196c4caeca1d8a6eef67863981d8f Author: Liu Ying Date: Wed Oct 18 11:52:12 2023 +0800 drm/bridge: synopsys: dw-mipi-dsi: Fix hcomponent lbcc for burst mode In order to support burst mode, vendor drivers set lane_mbps higher than bandwidth through DPI interface. So, calculate horizontal component lane byte clock cycle(lbcc) based on lane_mbps instead of pixel clock rate for burst mode. Fixes: ac87d23694f4 ("drm/bridge: synopsys: dw-mipi-dsi: Use pixel clock rate to calculate lbcc") Reported-by: Heiko Stübner Closes: https://lore.kernel.org/linux-arm-kernel/5979575.UjTJXf6HLC@diego/T/#u Tested-by: Heiko Stübner # px30 minievb with xinpeng xpp055c272 Signed-off-by: Liu Ying Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231018035212.1778767-1-victor.liu@nxp.com commit bd54ccc0f147019dac38e7841876a7415459b875 Author: Dan Carpenter Date: Tue Oct 24 08:00:53 2023 +0300 clk: mediatek: fix double free in mtk_clk_register_pllfh() The mtk_clk_register_pll_ops() currently frees the "pll" parameter. The function has two callers, mtk_clk_register_pll() and mtk_clk_register_pllfh(). The first one, the _pll() function relies on the free, but for the second _pllfh() function it causes a double free bug. Really the frees should be done in the caller because that's where the allocation is. Fixes: d7964de8a8ea ("clk: mediatek: Add new clock driver to handle FHCTL hardware") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/cd7fa365-28cc-4c34-ac64-6da57c98baa6@moroto.mountain Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit 70c8dc9104275037a39ab0b2a4ed6eaacac39e32 Author: Ingo Molnar Date: Tue Oct 24 19:09:17 2023 +0200 x86/defconfig: Enable CONFIG_DEBUG_ENTRY=y A bug was recently found via CONFIG_DEBUG_ENTRY=y, and the x86 tree kinda is the main source of changes to the x86 entry code, so enable this debug option by default in our defconfigs. Signed-off-by: Ingo Molnar Cc: linux-kernel@vger.kernel.org commit 7a198e0d48167db90e50777aab5a83a74e351f71 Author: Geert Uytterhoeven Date: Mon Oct 23 11:04:45 2023 +0200 dt-bindings: regulator: dlg,da9210: Convert to json-schema Convert the Dialog Semiconductor DA9210 Multi-Phase 12A DC-DC Buck Converter Device Tree binding documentation to json-schema. Signed-off-by: Geert Uytterhoeven Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/bfd1cf9d620a8229f5a5e62e6fe9e59c153d0830.1698051619.git.geert+renesas@glider.be Signed-off-by: Mark Brown commit 109cb2160128211ca7b17bad79cb0441f1440bc9 Author: Hans de Goede Date: Sat Oct 21 23:15:29 2023 +0200 ASoC: Intel: bytcr_wm5102: Add support for Lenovo Yoga Tab 3 Pro YT3-X90 The Lenovo Yoga Tab 3 Pro YT3-X90 x86 tablet, which ships with Android with a custom kernel as factory OS, does not list the used WM5102 codec inside its DSDT. So acpi_dev_get_first_match_dev() is going to fail on this board. Fallback to using "spi-$(mach->id)" as codec device name in this case to allow bytcr_wm5102 to work on these tablets. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231021211534.114991-2-hdegoede@redhat.com Signed-off-by: Mark Brown commit 2cb54788393134d8174ee594002baae3ce52c61e Author: Hans de Goede Date: Sat Oct 21 23:15:28 2023 +0200 ASoC: Intel: soc-acpi-cht: Add Lenovo Yoga Tab 3 Pro YT3-X90 quirk The Lenovo Yoga Tab 3 Pro YT3-X90 x86 tablet, which ships with Android with a custom kernel as factory OS, does not list the used WM5102 codec inside its DSDT. Workaround this with a new snd_soc_acpi_intel_baytrail_machines[] entry which matches on the SST id instead of the codec id like nocodec does, combined with using a machine_quirk callback which returns NULL on other machines to skip the new entry on other machines. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231021211534.114991-1-hdegoede@redhat.com Signed-off-by: Mark Brown commit 2e2a1613342658962250873cb8a0406bebdab9e3 Author: Colin Ian King Date: Mon Oct 23 16:17:04 2023 +0100 ASoC: mediatek: mt8186: remove redundant assignments to variable tdm_con There are two occurrences where variable tdm_con is being initialized to zero and the next statement re-assigns tdm_con to a new value. The initializations are redundant and can be removed. Signed-off-by: Colin Ian King Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231023151704.670240-1-colin.i.king@gmail.com Signed-off-by: Mark Brown commit b32dcf23a03eb170dfaa482fc28d4b01d39eda80 Author: Rob Herring Date: Fri Oct 13 15:08:49 2023 -0500 dt-bindings: Drop kernel copy of common reserved-memory bindings The common reserved-memory bindings have recently been copied from the kernel tree into dtschema. The preference is to host common, stable bindings in dtschema. As reserved-memory is documented in the DT Spec, it meets the criteria. The v2023.09 version of dtschema is what contains the reserved-memory schemas we depend on, so bump the minimum version to that. Otherwise, references to these schemas will generate errors. Reviewed-by: Simon Glass Reviewed-by: Mathieu Poirier Link: https://lore.kernel.org/r/20231013200851.347042-1-robh@kernel.org Signed-off-by: Rob Herring commit 8c2d2383d2904aa3077f8dd3b3154160fa5b4f97 Merge: 91e174fc04b19 0e20929434080 Author: Mark Brown Date: Tue Oct 24 17:38:40 2023 +0100 ASoC: mediatek: Remove redundant code and add Merge series from Maso Huang : Add support for sample rate checking on the MT7986. commit 6ae2ff23aa43a0c421cf315c34b105bdfe317f63 Author: Geert Uytterhoeven Date: Sun Oct 15 16:27:04 2023 +0200 drm/client: Convert drm_client_buffer_addfb() to drm_mode_addfb2() Currently drm_client_buffer_addfb() uses the legacy drm_mode_addfb(), which uses bpp and depth to guess the wanted buffer format. However, drm_client_buffer_addfb() already knows the exact buffer format, so there is no need to convert back and forth between buffer format and bpp/depth, and the function can just call drm_mode_addfb2() directly instead. Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Signed-off-by: Hamza Mahfooz Link: https://patchwork.freedesktop.org/patch/msgid/4b84adfc686288714e69d0442d22f1259ff74903.1697379891.git.geert@linux-m68k.org commit 66c62769bcf6aa142e2309278980a2e52f4b08db Author: Amir Goldstein Date: Mon Oct 23 21:07:58 2023 +0300 exportfs: add helpers to check if filesystem can encode/decode file handles The logic of whether filesystem can encode/decode file handles is open coded in many places. In preparation to changing the logic, move the open coded logic into inline helpers. Reviewed-by: Jan Kara Reviewed-by: Jeff Layton Signed-off-by: Amir Goldstein Link: https://lore.kernel.org/r/20231023180801.2953446-2-amir73il@gmail.com Signed-off-by: Christian Brauner commit 2ccabf81ddff81355bf044bdad3c44e9e6ac32d9 Author: Nicolin Chen Date: Mon Oct 23 18:29:58 2023 -0700 iommufd: Only enforce cache coherency in iommufd_hw_pagetable_alloc According to the conversation in the following link: https://lore.kernel.org/linux-iommu/20231020135501.GG3952@nvidia.com/ The enforce_cache_coherency should be set/enforced in the hwpt allocation routine. The iommu driver in its attach_dev() op should decide whether to reject or not a device that doesn't match with the configuration of cache coherency. Drop the enforce_cache_coherency piece in the attach/replace() and move the remaining "num_devices" piece closer to the refcount that is using it. Accordingly drop its function prototype in the header and mark it static. Also add some extra comments to clarify the expected behaviors. Link: https://lore.kernel.org/r/20231024012958.30842-1-nicolinc@nvidia.com Suggested-by: Kevin Tian Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Signed-off-by: Nicolin Chen Signed-off-by: Jason Gunthorpe commit 04e82fa5951ca66495d7b05665eff673aa3852b4 Author: Bjorn Helgaas Date: Tue Oct 10 15:44:28 2023 -0500 PCI: Use FIELD_GET() in Sapphire RX 5600 XT Pulse quirk Use FIELD_GET() to remove dependences on the field position, i.e., the shift value. No functional change intended. Separate because this isn't as trivial as the other FIELD_GET() changes. See 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse") Link: https://lore.kernel.org/r/20231010204436.1000644-3-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Ilpo Järvinen Reviewed-by: Jonathan Cameron Reviewed-by: Kuppuswamy Sathyanarayanan Cc: Nirmoy Das commit e0f0a16f5ff3670f2b26f0ef4b8fd5c55ebefd81 Author: Bjorn Helgaas Date: Tue Oct 10 15:44:27 2023 -0500 PCI: Use FIELD_GET() Use FIELD_GET() and FIELD_PREP() to remove dependences on the field position, i.e., the shift value. No functional change intended. Link: https://lore.kernel.org/r/20231010204436.1000644-2-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Jonathan Cameron Reviewed-by: Kuppuswamy Sathyanarayanan commit 682f5311e3a4f637ad3fae835a14494c2769bc2b Author: Ilpo Järvinen Date: Wed Oct 18 14:32:54 2023 +0300 PCI/MSI: Use FIELD_GET/PREP() Instead of custom masking and shifting, use FIELD_GET/PREP() with register fields. Link: https://lore.kernel.org/r/20231018113254.17616-8-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit 74f0b5ffe172f913c56e4f5291678bad2a55b6b1 Author: Ilpo Järvinen Date: Wed Oct 18 14:32:53 2023 +0300 PCI/DPC: Use defines with DPC reason fields Add new defines for DPC reason fields and use them instead of literals. Link: https://lore.kernel.org/r/20231018113254.17616-7-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen [bhelgaas: shorten comments] Signed-off-by: Bjorn Helgaas commit f00e8dbdedfb0dc2b5712d2170e7fcbe4eb93603 Author: Ilpo Järvinen Date: Wed Oct 18 14:32:52 2023 +0300 PCI/DPC: Use defined fields with DPC_CTL register Instead of using a literal to clear bits, add PCI_EXP_DPC_CTL_EN_MASK and use the usual pattern to modify a bitfield. While at it, rearrange RMW code more logically together. Link: https://lore.kernel.org/r/20231018113254.17616-6-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit 9a9eec4765737b9b2a8d6ae03de6480a5f12dd5c Author: Bjorn Helgaas Date: Wed Oct 18 14:32:51 2023 +0300 PCI/DPC: Use FIELD_GET() Use FIELD_GET() to remove dependencies on the field position, i.e., the shift value. No functional change intended. Link: https://lore.kernel.org/r/20231018113254.17616-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit abaaac4845a0d6f39f83cbaba4c3b46ba5f93170 Author: Ilpo Järvinen Date: Wed Oct 18 14:32:50 2023 +0300 PCI: hotplug: Use FIELD_GET/PREP() Instead of handcrafted shifts to handle register fields, use FIELD_GET/FIELD_PREP(). Link: https://lore.kernel.org/r/20231018113254.17616-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit 92af77ca26f75f7874634c8ac2f744f86ec56e88 Author: Ilpo Järvinen Date: Tue Oct 24 14:03:36 2023 +0300 PCI: dwc: Use FIELD_GET/PREP() Convert open-coded variants of PCI field access into FIELD_GET/PREP() to make the code easier to understand. Add two missing defines into pci_regs.h. Logically, the Max No-Snoop Latency Register is a separate word sized register in the PCIe spec, but the pre-existing LTR defines in pci_regs.h with dword long values seem to consider the registers together (the same goes for the only user). Thus, follow the custom and make the new values also take both word long LTR registers as a joint dword register. Link: https://lore.kernel.org/r/20231024110336.26264-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit 253358f373492608348136e569366d73cb969f6a Author: Rafał Miłecki Date: Tue Oct 24 09:26:05 2023 +0200 ARM: dts: BCM5301X: Set switch ports for Linksys EA9200 This patch was developed as OpenWrt downstream change and was recently confirmed to work as expected. Tested-by: Rani Hod Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20231024072605.32517-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 7a1c2abf9a2be7d969b25e8d65567933335ca88e Author: Yang Li Date: Tue Oct 24 08:38:15 2023 +0800 RDMA/core: Remove NULL check before dev_{put, hold} The call netdev_{put, hold} of dev_{put, hold} will check NULL, so there is no need to check before using dev_{put, hold}, remove it to silence the warning: ./drivers/infiniband/core/nldev.c:375:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7047 Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20231024003815.89742-1-yang.lee@linux.alibaba.com Signed-off-by: Leon Romanovsky commit 0795b305da8902e7d092f90bf9a1a2c98f34b1db Author: Joao Martins Date: Tue Oct 24 14:51:09 2023 +0100 iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR flag Change test_mock_dirty_bitmaps() to pass a flag where it specifies the flag under test. The test does the same thing as the GET_DIRTY_BITMAP regular test. Except that it tests whether the dirtied bits are fetched all the same a second time, as opposed to observing them cleared. Link: https://lore.kernel.org/r/20231024135109.73787-19-joao.m.martins@oracle.com Signed-off-by: Joao Martins Signed-off-by: Jason Gunthorpe commit ae36fe70cea4d7c177452ab41e6734fa3cbd4ad8 Author: Joao Martins Date: Tue Oct 24 14:51:08 2023 +0100 iommufd/selftest: Test out_capabilities in IOMMU_GET_HW_INFO Enumerate the capabilities from the mock device and test whether it advertises as expected. Include it as part of the iommufd_dirty_tracking fixture. Link: https://lore.kernel.org/r/20231024135109.73787-18-joao.m.martins@oracle.com Signed-off-by: Joao Martins Signed-off-by: Jason Gunthorpe commit a9af47e382a4d517685cb13c780272e7f300ebc5 Author: Joao Martins Date: Tue Oct 24 14:51:07 2023 +0100 iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP Add a new test ioctl for simulating the dirty IOVAs in the mock domain, and implement the mock iommu domain ops that get the dirty tracking supported. The selftest exercises the usual main workflow of: 1) Setting dirty tracking from the iommu domain 2) Read and clear dirty IOPTEs Different fixtures will test different IOVA range sizes, that exercise corner cases of the bitmaps. Link: https://lore.kernel.org/r/20231024135109.73787-17-joao.m.martins@oracle.com Signed-off-by: Joao Martins Signed-off-by: Jason Gunthorpe commit 7adf267d66d1d737ea8318976fd1ce93733fd3a4 Author: Joao Martins Date: Tue Oct 24 14:51:06 2023 +0100 iommufd/selftest: Test IOMMU_HWPT_SET_DIRTY_TRACKING Change mock_domain to supporting dirty tracking and add tests to exercise the new SET_DIRTY_TRACKING API in the iommufd_dirty_tracking selftest fixture. Link: https://lore.kernel.org/r/20231024135109.73787-16-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 266ce58989ba05e2a24460fdbf402d766c2e3870 Author: Joao Martins Date: Tue Oct 24 14:51:05 2023 +0100 iommufd/selftest: Test IOMMU_HWPT_ALLOC_DIRTY_TRACKING In order to selftest the iommu domain dirty enforcing implement the mock_domain necessary support and add a new dev_flags to test that the hwpt_alloc/attach_device fails as expected. Expand the existing mock_domain fixture with a enforce_dirty test that exercises the hwpt_alloc and device attachment. Link: https://lore.kernel.org/r/20231024135109.73787-15-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit e04b23c8d4ed977dbab4a4159f9e4d9a878b5c65 Author: Joao Martins Date: Tue Oct 24 14:51:04 2023 +0100 iommufd/selftest: Expand mock_domain with dev_flags Expand mock_domain test to be able to manipulate the device capabilities. This allows testing with mockdev without dirty tracking support advertised and thus make sure enforce_dirty test does the expected. To avoid breaking IOMMUFD_TEST UABI replicate the mock_domain struct and thus add an input dev_flags at the end. Link: https://lore.kernel.org/r/20231024135109.73787-14-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit f35f22cc760eb2c7034bf53251399685d611e03f Author: Joao Martins Date: Tue Oct 24 14:51:03 2023 +0100 iommu/vt-d: Access/Dirty bit support for SS domains IOMMU advertises Access/Dirty bits for second-stage page table if the extended capability DMAR register reports it (ECAP, mnemonic ECAP.SSADS). The first stage table is compatible with CPU page table thus A/D bits are implicitly supported. Relevant Intel IOMMU SDM ref for first stage table "3.6.2 Accessed, Extended Accessed, and Dirty Flags" and second stage table "3.7.2 Accessed and Dirty Flags". First stage page table is enabled by default so it's allowed to set dirty tracking and no control bits needed, it just returns 0. To use SSADS, set bit 9 (SSADE) in the scalable-mode PASID table entry and flush the IOTLB via pasid_flush_caches() following the manual. Relevant SDM refs: "3.7.2 Accessed and Dirty Flags" "6.5.3.3 Guidance to Software for Invalidations, Table 23. Guidance to Software for Invalidations" PTE dirty bit is located in bit 9 and it's cached in the IOTLB so flush IOTLB to make sure IOMMU attempts to set the dirty bit again. Note that iommu_dirty_bitmap_record() will add the IOVA to iotlb_gather and thus the caller of the iommu op will flush the IOTLB. Relevant manuals over the hardware translation is chapter 6 with some special mention to: "6.2.3.1 Scalable-Mode PASID-Table Entry Programming Considerations" "6.2.4 IOTLB" Select IOMMUFD_DRIVER only if IOMMUFD is enabled, given that IOMMU dirty tracking requires IOMMUFD. Link: https://lore.kernel.org/r/20231024135109.73787-13-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 421a511a293fe1c73b37f6147c6676c4ee6efa04 Author: Joao Martins Date: Tue Oct 24 14:51:02 2023 +0100 iommu/amd: Access/Dirty bit support in IOPTEs IOMMU advertises Access/Dirty bits if the extended feature register reports it. Relevant AMD IOMMU SDM ref[0] "1.3.8 Enhanced Support for Access and Dirty Bits" To enable it set the DTE flag in bits 7 and 8 to enable access, or access+dirty. With that, the IOMMU starts marking the D and A flags on every Memory Request or ATS translation request. It is on the VMM side to steer whether to enable dirty tracking or not, rather than wrongly doing in IOMMU. Relevant AMD IOMMU SDM ref [0], "Table 7. Device Table Entry (DTE) Field Definitions" particularly the entry "HAD". To actually toggle on and off it's relatively simple as it's setting 2 bits on DTE and flush the device DTE cache. To get what's dirtied use existing AMD io-pgtable support, by walking the pagetables over each IOVA, with fetch_pte(). The IOTLB flushing is left to the caller (much like unmap), and iommu_dirty_bitmap_record() is the one adding page-ranges to invalidate. This allows caller to batch the flush over a big span of IOVA space, without the iommu wondering about when to flush. Worthwhile sections from AMD IOMMU SDM: "2.2.3.1 Host Access Support" "2.2.3.2 Host Dirty Support" For details on how IOMMU hardware updates the dirty bit see, and expects from its consequent clearing by CPU: "2.2.7.4 Updating Accessed and Dirty Bits in the Guest Address Tables" "2.2.7.5 Clearing Accessed and Dirty Bits" Quoting the SDM: "The setting of accessed and dirty status bits in the page tables is visible to both the CPU and the peripheral when sharing guest page tables. The IOMMU interlocked operations to update A and D bits must be 64-bit operations and naturally aligned on a 64-bit boundary" .. and for the IOMMU update sequence to Dirty bit, essentially is states: 1. Decodes the read and write intent from the memory access. 2. If P=0 in the page descriptor, fail the access. 3. Compare the A & D bits in the descriptor with the read and write intent in the request. 4. If the A or D bits need to be updated in the descriptor: * Start atomic operation. * Read the descriptor as a 64-bit access. * If the descriptor no longer appears to require an update, release the atomic lock with no further action and continue to step 5. * Calculate the new A & D bits. * Write the descriptor as a 64-bit access. * End atomic operation. 5. Continue to the next stage of translation or to the memory access. Access/Dirty bits readout also need to consider the non-default page-sizes (aka replicated PTEs as mentined by manual), as AMD supports all powers of two (except 512G) page sizes. Select IOMMUFD_DRIVER only if IOMMUFD is enabled considering that IOMMU dirty tracking requires IOMMUFD. Link: https://lore.kernel.org/r/20231024135109.73787-12-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Suravee Suthikulpanit Signed-off-by: Jason Gunthorpe commit 134288158a415cd863b1c32c7dcddc0a1dc32aab Author: Joao Martins Date: Tue Oct 24 14:51:01 2023 +0100 iommu/amd: Add domain_alloc_user based domain allocation Add the domain_alloc_user op implementation. To that end, refactor amd_iommu_domain_alloc() to receive a dev pointer and flags, while renaming it too, such that it becomes a common function shared with domain_alloc_user() implementation. The sole difference with domain_alloc_user() is that we initialize also other fields that iommu_domain_alloc() does. It lets it return the iommu domain correctly initialized in one function. This is in preparation to add dirty enforcement on AMD implementation of domain_alloc_user. Link: https://lore.kernel.org/r/20231024135109.73787-11-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Suravee Suthikulpanit Signed-off-by: Jason Gunthorpe commit 609848132c71316df3260d1ec066539c21bba585 Author: Joao Martins Date: Tue Oct 24 14:51:00 2023 +0100 iommufd: Add a flag to skip clearing of IOPTE dirty VFIO has an operation where it unmaps an IOVA while returning a bitmap with the dirty data. In reality the operation doesn't quite query the IO pagetables that the PTE was dirty or not. Instead it marks as dirty on anything that was mapped, and doing so in one syscall. In IOMMUFD the equivalent is done in two operations by querying with GET_DIRTY_IOVA followed by UNMAP_IOVA. However, this would incur two TLB flushes given that after clearing dirty bits IOMMU implementations require invalidating their IOTLB, plus another invalidation needed for the UNMAP. To allow dirty bits to be queried faster, add a flag (IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR) that requests to not clear the dirty bits from the PTE (but just reading them), under the expectation that the next operation is the unmap. An alternative is to unmap and just perpectually mark as dirty as that's the same behaviour as today. So here equivalent functionally can be provided with unmap alone, and if real dirty info is required it will amortize the cost while querying. There's still a race against DMA where in theory the unmap of the IOVA (when the guest invalidates the IOTLB via emulated iommu) would race against the VF performing DMA on the same IOVA. As discussed in [0], we are accepting to resolve this race as throwing away the DMA and it doesn't matter if it hit physical DRAM or not, the VM can't tell if we threw it away because the DMA was blocked or because we failed to copy the DRAM. [0] https://lore.kernel.org/linux-iommu/20220502185239.GR8364@nvidia.com/ Link: https://lore.kernel.org/r/20231024135109.73787-10-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 7623683857e52b75184d37862c70f1230aef2edd Author: Joao Martins Date: Tue Oct 24 14:50:59 2023 +0100 iommufd: Add capabilities to IOMMU_GET_HW_INFO Extend IOMMUFD_CMD_GET_HW_INFO op to query generic iommu capabilities for a given device. Capabilities are IOMMU agnostic and use device_iommu_capable() API passing one of the IOMMU_CAP_*. Enumerate IOMMU_CAP_DIRTY_TRACKING for now in the out_capabilities field returned back to userspace. Link: https://lore.kernel.org/r/20231024135109.73787-9-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit b9a60d6f850e4470017b60f731220a58cda199aa Author: Joao Martins Date: Tue Oct 24 14:50:58 2023 +0100 iommufd: Add IOMMU_HWPT_GET_DIRTY_BITMAP Connect a hw_pagetable to the IOMMU core dirty tracking read_and_clear_dirty iommu domain op. It exposes all of the functionality for the UAPI that read the dirtied IOVAs while clearing the Dirty bits from the PTEs. In doing so, add an IO pagetable API iopt_read_and_clear_dirty_data() that performs the reading of dirty IOPTEs for a given IOVA range and then copying back to userspace bitmap. Underneath it uses the IOMMU domain kernel API which will read the dirty bits, as well as atomically clearing the IOPTE dirty bit and flushing the IOTLB at the end. The IOVA bitmaps usage takes care of the iteration of the bitmaps user pages efficiently and without copies. Within the iterator function we iterate over io-pagetable contigous areas that have been mapped. Contrary to past incantation of a similar interface in VFIO the IOVA range to be scanned is tied in to the bitmap size, thus the application needs to pass a appropriately sized bitmap address taking into account the iova range being passed *and* page size ... as opposed to allowing bitmap-iova != iova. Link: https://lore.kernel.org/r/20231024135109.73787-8-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit e2a4b294784957fc28ecb1fed8a7e69da18eb18d Author: Joao Martins Date: Tue Oct 24 14:50:57 2023 +0100 iommufd: Add IOMMU_HWPT_SET_DIRTY_TRACKING Every IOMMU driver should be able to implement the needed iommu domain ops to control dirty tracking. Connect a hw_pagetable to the IOMMU core dirty tracking ops, specifically the ability to enable/disable dirty tracking on an IOMMU domain (hw_pagetable id). To that end add an io_pagetable kernel API to toggle dirty tracking: * iopt_set_dirty_tracking(iopt, [domain], state) The intended caller of this is via the hw_pagetable object that is created. Internally it will ensure the leftover dirty state is cleared /right before/ dirty tracking starts. This is also useful for iommu drivers which may decide that dirty tracking is always-enabled at boot without wanting to toggle dynamically via corresponding iommu domain op. Link: https://lore.kernel.org/r/20231024135109.73787-7-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 5f9bdbf4c65860cc8b9c544d92bfd76fbea8d9c5 Author: Joao Martins Date: Tue Oct 24 14:50:56 2023 +0100 iommufd: Add a flag to enforce dirty tracking on attach Throughout IOMMU domain lifetime that wants to use dirty tracking, some guarantees are needed such that any device attached to the iommu_domain supports dirty tracking. The idea is to handle a case where IOMMU in the system are assymetric feature-wise and thus the capability may not be supported for all devices. The enforcement is done by adding a flag into HWPT_ALLOC namely: IOMMU_HWPT_ALLOC_DIRTY_TRACKING .. Passed in HWPT_ALLOC ioctl() flags. The enforcement is done by creating a iommu_domain via domain_alloc_user() and validating the requested flags with what the device IOMMU supports (and failing accordingly) advertised). Advertising the new IOMMU domain feature flag requires that the individual iommu driver capability is supported when a future device attachment happens. Link: https://lore.kernel.org/r/20231024135109.73787-6-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 750e2e902b7180cb82d2f9b1e372e32087bb8b1b Author: Joao Martins Date: Tue Oct 24 14:50:55 2023 +0100 iommu: Add iommu_domain ops for dirty tracking Add to iommu domain operations a set of callbacks to perform dirty tracking, particulary to start and stop tracking and to read and clear the dirty data. Drivers are generally expected to dynamically change its translation structures to toggle the tracking and flush some form of control state structure that stands in the IOVA translation path. Though it's not mandatory, as drivers can also enable dirty tracking at boot, and just clear the dirty bits before setting dirty tracking. For each of the newly added IOMMU core APIs: iommu_cap::IOMMU_CAP_DIRTY_TRACKING: new device iommu_capable value when probing for capabilities of the device. .set_dirty_tracking(): an iommu driver is expected to change its translation structures and enable dirty tracking for the devices in the iommu_domain. For drivers making dirty tracking always-enabled, it should just return 0. .read_and_clear_dirty(): an iommu driver is expected to walk the pagetables for the iova range passed in and use iommu_dirty_bitmap_record() to record dirty info per IOVA. When detecting that a given IOVA is dirty it should also clear its dirty state from the PTE, *unless* the flag IOMMU_DIRTY_NO_CLEAR is passed in -- flushing is steered from the caller of the domain_op via iotlb_gather. The iommu core APIs use the same data structure in use for dirty tracking for VFIO device dirty (struct iova_bitmap) abstracted by iommu_dirty_bitmap_record() helper function. domain::dirty_ops: IOMMU domains will store the dirty ops depending on whether the iommu device supports dirty tracking or not. iommu drivers can then use this field to figure if the dirty tracking is supported+enforced on attach. The enforcement is enable via domain_alloc_user() which is done via IOMMUFD hwpt flag introduced later. Link: https://lore.kernel.org/r/20231024135109.73787-5-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Jason Gunthorpe Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 13578d4ebe8be1c16146f37c0c91f2579611cff2 Author: Joao Martins Date: Tue Oct 24 14:50:54 2023 +0100 iommufd/iova_bitmap: Move symbols to IOMMUFD namespace Have the IOVA bitmap exported symbols adhere to the IOMMUFD symbol export convention i.e. using the IOMMUFD namespace. In doing so, import the namespace in the current users. This means VFIO and the vfio-pci drivers that use iova_bitmap_set(). Link: https://lore.kernel.org/r/20231024135109.73787-4-joao.m.martins@oracle.com Suggested-by: Jason Gunthorpe Signed-off-by: Joao Martins Reviewed-by: Jason Gunthorpe Reviewed-by: Brett Creeley Reviewed-by: Kevin Tian Reviewed-by: Alex Williamson Signed-off-by: Jason Gunthorpe commit 8c9c727b6142325ed5697240fceb99cbeb4ac2ec Author: Joao Martins Date: Tue Oct 24 14:50:53 2023 +0100 vfio: Move iova_bitmap into iommufd Both VFIO and IOMMUFD will need iova bitmap for storing dirties and walking the user bitmaps, so move to the common dependency into IOMMUFD. In doing so, create the symbol IOMMUFD_DRIVER which designates the builtin code that will be used by drivers when selected. Today this means MLX5_VFIO_PCI and PDS_VFIO_PCI. IOMMU drivers will do the same (in future patches) when supporting dirty tracking and select IOMMUFD_DRIVER accordingly. Given that the symbol maybe be disabled, add header definitions in iova_bitmap.h for when IOMMUFD_DRIVER=n Link: https://lore.kernel.org/r/20231024135109.73787-3-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Jason Gunthorpe Reviewed-by: Brett Creeley Reviewed-by: Kevin Tian Reviewed-by: Alex Williamson Signed-off-by: Jason Gunthorpe commit 53f0b020218fcc0a56a11df39630dbd379e4d9a6 Author: Joao Martins Date: Tue Oct 24 14:50:52 2023 +0100 vfio/iova_bitmap: Export more API symbols In preparation to move iova_bitmap into iommufd, export the rest of API symbols that will be used in what could be used by modules, namely: iova_bitmap_alloc iova_bitmap_free iova_bitmap_for_each Link: https://lore.kernel.org/r/20231024135109.73787-2-joao.m.martins@oracle.com Suggested-by: Alex Williamson Signed-off-by: Joao Martins Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Alex Williamson Signed-off-by: Jason Gunthorpe commit b55706366c5ed63749186f22bfb0a15a1de7c074 Author: Colin Ian King Date: Mon Oct 23 15:17:33 2023 +0100 RDMA/hfi1: Remove redundant assignment to pointer ppd Pointer ppd is being assigned a value in a for-loop however it is never read. The assignment is redundant and can be removed. Cleans up clang scan build warning: drivers/infiniband/hw/hfi1/init.c:1030:3: warning: Value stored to 'ppd' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20231023141733.667807-1-colin.i.king@gmail.com Signed-off-by: Leon Romanovsky commit d35686444fc80950c731e33a2f6ad4a55822be9b Author: Maria Yu Date: Tue Oct 24 09:09:54 2023 +0800 arm64: module: Fix PLT counting when CONFIG_RANDOMIZE_BASE=n The counting of module PLTs has been broken when CONFIG_RANDOMIZE_BASE=n since commit: 3e35d303ab7d22c4 ("arm64: module: rework module VA range selection") Prior to that commit, when CONFIG_RANDOMIZE_BASE=n, the kernel image and all modules were placed within a 128M region, and no PLTs were necessary for B or BL. Hence count_plts() and partition_branch_plt_relas() skipped handling B and BL when CONFIG_RANDOMIZE_BASE=n. After that commit, modules can be placed anywhere within a 2G window regardless of CONFIG_RANDOMIZE_BASE, and hence PLTs may be necessary for B and BL even when CONFIG_RANDOMIZE_BASE=n. Unfortunately that commit failed to update count_plts() and partition_branch_plt_relas() accordingly. Due to this, module_emit_plt_entry() may fail if an insufficient number of PLT entries have been reserved, resulting in modules failing to load with -ENOEXEC. Fix this by counting PLTs regardless of CONFIG_RANDOMIZE_BASE in count_plts() and partition_branch_plt_relas(). Fixes: 3e35d303ab7d ("arm64: module: rework module VA range selection") Signed-off-by: Maria Yu Cc: # 6.5.x Acked-by: Ard Biesheuvel Fixes: 3e35d303ab7d ("arm64: module: rework module VA range selection") Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20231024010954.6768-1-quic_aiquny@quicinc.com Signed-off-by: Catalin Marinas commit c54e52f84d7aa590e90e1f73f462517ac40051e1 Author: James Morse Date: Mon Oct 23 14:35:03 2023 +0100 arm64, irqchip/gic-v3, ACPI: Move MADT GICC enabled check into a helper ACPI, irqchip and the architecture code all inspect the MADT enabled bit for a GICC entry in the MADT. The addition of an 'online capable' bit means all these sites need updating. Move the current checks behind a helper to make future updates easier. Signed-off-by: James Morse Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Signed-off-by: "Russell King (Oracle)" Acked-by: "Rafael J. Wysocki" Reviewed-by: Sudeep Holla Link: https://lore.kernel.org/r/E1quv5D-00AeNJ-U8@rmk-PC.armlinux.org.uk Signed-off-by: Catalin Marinas commit 02e7d139e5e24abb5fde91934fc9dc0344ac1926 Author: Patrisious Haddad Date: Thu Oct 19 11:47:05 2023 +0300 RDMA/mlx5: Change the key being sent for MPV device affiliation Change the key that we send from IB driver to EN driver regarding the MPV device affiliation, since at that stage the IB device is not yet initialized, so its index would be zero for different IB devices and cause wrong associations between unrelated master and slave devices. Instead use a unique value from inside the core device which is already initialized at this stage. Fixes: 0d293714ac32 ("RDMA/mlx5: Send events from IB driver about device affiliation state") Signed-off-by: Patrisious Haddad Link: https://lore.kernel.org/r/ac7e66357d963fc68d7a419515180212c96d137d.1697705185.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit 2e6fc0b81555c1d51b0a33c54aa31d2c22a4644f Author: Alexander Stein Date: Thu Aug 10 16:44:51 2023 +0200 dt-bindings: timer: fsl,imxgpt: Add optional osc_per clock Since commit bad3db104f89 ("ARM: imx: source gpt per clk from OSC for system timer") osc_per can be used for clocking the GPT which is not scaled when entering low bus mode. This clock source is available only on i.MX6Q (incl. i.MX6QP) and i.MX6DL. Signed-off-by: Alexander Stein Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230810144451.1459985-7-alexander.stein@ew.tq-group.com Signed-off-by: Rob Herring commit 9cdee063476988102bbc5e0e9551e10c5ed00d3e Author: Phil Sutter Date: Tue Oct 24 15:10:40 2023 +0200 netfilter: nf_tables: Carry reset boolean in nft_set_dump_ctx Relieve the dump callback from having to check nlmsg_type upon each call. Prep work for set element reset locking. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit cf5ab01c87030a085e211a0a327535932ec6f719 Author: Ashok Raj Date: Mon Oct 2 14:00:11 2023 +0200 x86/microcode/intel: Add a minimum required revision for late loading In general users, don't have the necessary information to determine whether late loading of a new microcode version is safe and does not modify anything which the currently running kernel uses already, e.g. removal of CPUID bits or behavioural changes of MSRs. To address this issue, Intel has added a "minimum required version" field to a previously reserved field in the microcode header. Microcode updates should only be applied if the current microcode version is equal to, or greater than this minimum required version. Thomas made some suggestions on how meta-data in the microcode file could provide Linux with information to decide if the new microcode is suitable candidate for late loading. But even the "simpler" option requires a lot of metadata and corresponding kernel code to parse it, so the final suggestion was to add the 'minimum required version' field in the header. When microcode changes visible features, microcode will set the minimum required version to its own revision which prevents late loading. Old microcode blobs have the minimum revision field always set to 0, which indicates that there is no information and the kernel considers it unsafe. This is a pure OS software mechanism. The hardware/firmware ignores this header field. For early loading there is no restriction because OS visible features are enumerated after the early load and therefore a change has no effect. The check is always enabled, but by default not enforced. It can be enforced via Kconfig or kernel command line. If enforced, the kernel refuses to late load microcode with a minimum required version field which is zero or when the currently loaded microcode revision is smaller than the minimum required revision. If not enforced the load happens independent of the revision check to stay compatible with the existing behaviour, but it influences the decision whether the kernel is tainted or not. If the check signals that the late load is safe, then the kernel is not tainted. Early loading is not affected by this. [ tglx: Massaged changelog and fixed up the implementation ] Suggested-by: Thomas Gleixner Signed-off-by: Ashok Raj Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115903.776467264@linutronix.de commit 9407bda845dd19756e276d4f3abc15a20777ba45 Author: Thomas Gleixner Date: Tue Oct 17 23:24:16 2023 +0200 x86/microcode: Prepare for minimal revision check Applying microcode late can be fatal for the running kernel when the update changes functionality which is in use already in a non-compatible way, e.g. by removing a CPUID bit. There is no way for admins which do not have access to the vendors deep technical support to decide whether late loading of such a microcode is safe or not. Intel has added a new field to the microcode header which tells the minimal microcode revision which is required to be active in the CPU in order to be safe. Provide infrastructure for handling this in the core code and a command line switch which allows to enforce it. If the update is considered safe the kernel is not tainted and the annoying warning message not emitted. If it's enforced and the currently loaded microcode revision is not safe for late loading then the load is aborted. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211724.079611170@linutronix.de commit 8f849ff63bcbc77670da03cb8f2b78b06257f455 Author: Thomas Gleixner Date: Mon Oct 2 14:00:08 2023 +0200 x86/microcode: Handle "offline" CPUs correctly Offline CPUs need to be parked in a safe loop when microcode update is in progress on the primary CPU. Currently, offline CPUs are parked in mwait_play_dead(), and for Intel CPUs, its not a safe instruction, because the MWAIT instruction can be patched in the new microcode update that can cause instability. - Add a new microcode state 'UCODE_OFFLINE' to report status on per-CPU basis. - Force NMI on the offline CPUs. Wake up offline CPUs while the update is in progress and then return them back to mwait_play_dead() after microcode update is complete. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115903.660850472@linutronix.de commit 9cab5fb776d4367e26950cf759211e948335288e Author: Thomas Gleixner Date: Mon Oct 2 14:00:07 2023 +0200 x86/apic: Provide apic_force_nmi_on_cpu() When SMT siblings are soft-offlined and parked in one of the play_dead() variants they still react on NMI, which is problematic on affected Intel CPUs. The default play_dead() variant uses MWAIT on modern CPUs, which is not guaranteed to be safe when updated concurrently. Right now late loading is prevented when not all SMT siblings are online, but as they still react on NMI, it is possible to bring them out of their park position into a trivial rendezvous handler. Provide a function which allows to do that. I does sanity checks whether the target is in the cpus_booted_once_mask and whether the APIC driver supports it. Mark X2APIC and XAPIC as capable, but exclude 32bit and the UV and NUMACHIP variants as that needs feedback from the relevant experts. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115903.603100036@linutronix.de commit 1582c0f4a21303792f523fe2839dd8433ee630c0 Author: Thomas Gleixner Date: Mon Oct 2 14:00:06 2023 +0200 x86/microcode: Protect against instrumentation The wait for control loop in which the siblings are waiting for the microcode update on the primary thread must be protected against instrumentation as instrumentation can end up in #INT3, #DB or #PF, which then returns with IRET. That IRET reenables NMI which is the opposite of what the NMI rendezvous is trying to achieve. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115903.545969323@linutronix.de commit 7eb314a22800457396f541c655697dabd71e44a7 Author: Thomas Gleixner Date: Mon Oct 2 14:00:05 2023 +0200 x86/microcode: Rendezvous and load in NMI stop_machine() does not prevent the spin-waiting sibling from handling an NMI, which is obviously violating the whole concept of rendezvous. Implement a static branch right in the beginning of the NMI handler which is nopped out except when enabled by the late loading mechanism. The late loader enables the static branch before stop_machine() is invoked. Each CPU has an nmi_enable in its control structure which indicates whether the CPU should go into the update routine. This is required to bridge the gap between enabling the branch and actually being at the point where it is required to enter the loader wait loop. Each CPU which arrives in the stopper thread function sets that flag and issues a self NMI right after that. If the NMI function sees the flag clear, it returns. If it's set it clears the flag and enters the rendezvous. This is safe against a real NMI which hits in between setting the flag and sending the NMI to itself. The real NMI will be swallowed by the microcode update and the self NMI will then let stuff continue. Otherwise this would end up with a spurious NMI. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115903.489900814@linutronix.de commit 0bf871651211b58c7b19f40b746b646d5311e2ec Author: Thomas Gleixner Date: Mon Oct 2 14:00:03 2023 +0200 x86/microcode: Replace the all-in-one rendevous handler with a new handler which just separates the control flow of primary and secondary CPUs. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115903.433704135@linutronix.de commit 6067788f04b1020b316344fe34746f96d594a042 Author: Thomas Gleixner Date: Mon Oct 2 14:00:02 2023 +0200 x86/microcode: Provide new control functions The current all in one code is unreadable and really not suited for adding future features like uniform loading with package or system scope. Provide a set of new control functions which split the handling of the primary and secondary CPUs. These will replace the current rendezvous all in one function in the next step. This is intentionally a separate change because diff makes an complete unreadable mess otherwise. So the flow separates the primary and the secondary CPUs into their own functions which use the control field in the per CPU ucode_ctrl struct. primary() secondary() wait_for_all() wait_for_all() apply_ucode() wait_for_release() release() apply_ucode() Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115903.377922731@linutronix.de commit ba3aeb97cb2c53025356f31c5a0a294385194115 Author: Thomas Gleixner Date: Mon Oct 2 14:00:01 2023 +0200 x86/microcode: Add per CPU control field Add a per CPU control field to ucode_ctrl and define constants for it which are going to be used to control the loading state machine. In theory this could be a global control field, but a global control does not cover the following case: 15 primary CPUs load microcode successfully 1 primary CPU fails and returns with an error code With global control the sibling of the failed CPU would either try again or the whole operation would be aborted with the consequence that the 15 siblings do not invoke the apply path and end up with inconsistent software state. The result in dmesg would be inconsistent too. There are two additional fields added and initialized: ctrl_cpu and secondaries. ctrl_cpu is the CPU number of the primary thread for now, but with the upcoming uniform loading at package or system scope this will be one CPU per package or just one CPU. Secondaries hands the control CPU a CPU mask which will be required to release the secondary CPUs out of the wait loop. Preparatory change for implementing a properly split control flow for primary and secondary CPUs. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115903.319959519@linutronix.de commit 4b753955e9151ad2f722137a7bcbafda756186b3 Author: Thomas Gleixner Date: Tue Oct 17 23:24:05 2023 +0200 x86/microcode: Add per CPU result state The microcode rendezvous is purely acting on global state, which does not allow to analyze fails in a coherent way. Introduce per CPU state where the results are written into, which allows to analyze the return codes of the individual CPUs. Initialize the state when walking the cpu_present_mask in the online check to avoid another for_each_cpu() loop. Enhance the result print out with that. The structure is intentionally named ucode_ctrl as it will gain control fields in subsequent changes. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211723.632681010@linutronix.de commit 0772b9aa1a8f7322dce8588c231cff8b57298a53 Author: Thomas Gleixner Date: Mon Oct 2 13:59:59 2023 +0200 x86/microcode: Sanitize __wait_for_cpus() The code is too complicated for no reason: - The return value is pointless as this is a strict boolean. - It's way simpler to count down from num_online_cpus() and check for zero. - The timeout argument is pointless as this is always one second. - Touching the NMI watchdog every 100ns does not make any sense, neither does checking every 100ns. This is really not a hotpath operation. Preload the atomic counter with the number of online CPUs and simplify the whole timeout logic. Delay for one microsecond and touch the NMI watchdog once per millisecond. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115903.204251527@linutronix.de commit 6f059e634dcd0d725854514c94c114bbdd83950d Author: Thomas Gleixner Date: Mon Oct 2 13:59:57 2023 +0200 x86/microcode: Clarify the late load logic reload_store() is way too complicated. Split the inner workings out and make the following enhancements: - Taint the kernel only when the microcode was actually updated. If. e.g. the rendezvous fails, then nothing happened and there is no reason for tainting. - Return useful error codes Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Nikolay Borisov Link: https://lore.kernel.org/r/20231002115903.145048840@linutronix.de commit 634ac23ad609b3ddd9e0e478bd5afbf49d3a2556 Author: Thomas Gleixner Date: Mon Oct 2 13:59:56 2023 +0200 x86/microcode: Handle "nosmt" correctly On CPUs where microcode loading is not NMI-safe the SMT siblings which are parked in one of the play_dead() variants still react to NMIs. So if an NMI hits while the primary thread updates the microcode the resulting behaviour is undefined. The default play_dead() implementation on modern CPUs is using MWAIT which is not guaranteed to be safe against a microcode update which affects MWAIT. Take the cpus_booted_once_mask into account to detect this case and refuse to load late if the vendor specific driver does not advertise that late loading is NMI safe. AMD stated that this is safe, so mark the AMD driver accordingly. This requirement will be partially lifted in later changes. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115903.087472735@linutronix.de commit ba48aa32388ac652256baa8d0a6092d350160da0 Author: Thomas Gleixner Date: Mon Oct 2 13:59:55 2023 +0200 x86/microcode: Clean up mc_cpu_down_prep() This function has nothing to do with suspend. It's a hotplug callback. Remove the bogus comment. Drop the pointless debug printk. The hotplug core provides tracepoints which track the invocation of those callbacks. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115903.028651784@linutronix.de commit 2e1997335ceb6fc819862804f51d4fe83593c138 Author: Thomas Gleixner Date: Tue Oct 17 23:23:58 2023 +0200 x86/microcode: Get rid of the schedule work indirection Scheduling work on all CPUs to collect the microcode information is just another extra step for no value. Let the CPU hotplug callback registration do it. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211723.354748138@linutronix.de commit 8529e8ab6c6fab8ebf06ead98e77d7646b42fc48 Author: Thomas Gleixner Date: Tue Oct 17 23:23:56 2023 +0200 x86/microcode: Mop up early loading leftovers Get rid of the initrd_gone hack which was required to keep find_microcode_in_initrd() functional after init. As find_microcode_in_initrd() is now only used during init, mark it accordingly. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211723.298854846@linutronix.de commit 5af05b8d51a8e3ff5905663655c0f46d1aaae44a Author: Thomas Gleixner Date: Tue Oct 17 23:23:55 2023 +0200 x86/microcode/amd: Use cached microcode for AP load Now that the microcode cache is initialized before the APs are brought up, there is no point in scanning builtin/initrd microcode during AP loading. Convert the AP loader to utilize the cache, which in turn makes the CPU hotplug callback which applies the microcode after initrd/builtin is gone, obsolete as the early loading during late hotplug operations including the resume path depends now only on the cache. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211723.243426023@linutronix.de commit a7939f01672034a58ad3fdbce69bb6c665ce0024 Author: Thomas Gleixner Date: Tue Oct 17 23:23:53 2023 +0200 x86/microcode/amd: Cache builtin/initrd microcode early There is no reason to scan builtin/initrd microcode on each AP. Cache the builtin/initrd microcode in an early initcall so that the early AP loader can utilize the cache. The existing fs initcall which invoked save_microcode_in_initrd_amd() is still required to maintain the initrd_gone flag. Rename it accordingly. This will be removed once the AP loader code is converted to use the cache. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211723.187566507@linutronix.de commit d419d28261e72e1c9ec418711b3da41df2265139 Author: Thomas Gleixner Date: Tue Oct 10 17:08:43 2023 +0200 x86/microcode/amd: Cache builtin microcode too save_microcode_in_initrd_amd() fails to cache builtin microcode and only scans initrd. Use find_blobs_in_containers() instead which covers both. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231010150702.495139089@linutronix.de commit ecfd41089348fa4cc767dc588367e9fdf8cb6b9d Author: Thomas Gleixner Date: Tue Oct 10 17:08:41 2023 +0200 x86/microcode/amd: Use correct per CPU ucode_cpu_info find_blobs_in_containers() is invoked on every CPU but overwrites unconditionally ucode_cpu_info of CPU0. Fix this by using the proper CPU data and move the assignment into the call site apply_ucode_from_containers() so that the function can be reused. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231010150702.433454320@linutronix.de commit b48b26f992a3828b4ae274669f99ce68451d4904 Author: Thomas Gleixner Date: Tue Oct 17 23:23:49 2023 +0200 x86/microcode: Remove pointless apply() invocation Microcode is applied on the APs during early bringup. There is no point in trying to apply the microcode again during the hotplug operations and neither at the point where the microcode device is initialized. Collect CPU info and microcode revision in setup_online_cpu() for now. This will move to the CPU hotplug callback later. [ bp: Leave the starting notifier for the following scenario: - boot, late load, suspend to disk, resume without the starting notifier, only the last core manages to update the microcode upon resume: # rdmsr -a 0x8b 10000bf 10000bf 10000bf 10000bf 10000bf 10000dc <---- This is on an AMD F10h machine. For the future, one should check whether potential unification of the CPU init path could cover the resume path too so that this can be simplified even more. tglx: This is caused by the odd handling of APs which try to find the microcode blob in builtin or initrd instead of caching the microcode blob during early init before the APs are brought up. Will be cleaned up in a later step. ] Signed-off-by: Borislav Petkov (AMD) Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20231017211723.018821624@linutronix.de commit b7fcd995b261c9976e05f47554529c98a0f1cbb0 Author: Thomas Gleixner Date: Mon Oct 2 13:59:50 2023 +0200 x86/microcode/intel: Rework intel_find_matching_signature() Take a cpu_signature argument and work from there. Move the match() helper next to the callsite as there is no point for having it in a header. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115902.797820205@linutronix.de commit 11f96ac4c21e701650c7d8349b252973185ac6ce Author: Thomas Gleixner Date: Mon Oct 2 13:59:49 2023 +0200 x86/microcode/intel: Reuse intel_cpu_collect_info() No point for an almost duplicate function. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115902.741173606@linutronix.de commit 164aa1ca537238c46923ccacd8995b4265aee47b Author: Thomas Gleixner Date: Tue Oct 17 23:23:45 2023 +0200 x86/microcode/intel: Rework intel_cpu_collect_info() Nothing needs struct ucode_cpu_info. Make it take struct cpu_signature, let it return a boolean and simplify the implementation. Rename it now that the silly name clash with collect_cpu_info() is gone. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211722.851573238@linutronix.de commit 3973718cff1e3a5d88ea78ec28ecca2afa60b30b Author: Thomas Gleixner Date: Tue Oct 17 23:23:44 2023 +0200 x86/microcode/intel: Unify microcode apply() functions Deduplicate the early and late apply() functions. [ bp: Rename the function which does the actual application to __apply_microcode() to differentiate it from microcode_ops.apply_microcode(). ] Signed-off-by: Borislav Petkov (AMD) Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20231017211722.795508212@linutronix.de commit f24f204405f9875bc539c6e88553fd5ac913c867 Author: Thomas Gleixner Date: Mon Oct 2 13:59:45 2023 +0200 x86/microcode/intel: Switch to kvmalloc() Microcode blobs are getting larger and might soon reach the kmalloc() limit. Switch over kvmalloc(). Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115902.564323243@linutronix.de commit 2a1dada3d1cf8f80a27663653a371d99dbf5d540 Author: Thomas Gleixner Date: Mon Oct 2 13:59:44 2023 +0200 x86/microcode/intel: Save the microcode only after a successful late-load There are situations where the late microcode is loaded into memory but is not applied: 1) The rendezvous fails 2) The microcode is rejected by the CPUs If any of this happens then the pointer which was updated at firmware load time is stale and subsequent CPU hotplug operations either fail to update or create inconsistent microcode state. Save the loaded microcode in a separate pointer before the late load is attempted and when successful, update the hotplug pointer accordingly via a new microcode_ops callback. Remove the pointless fallback in the loader to a microcode pointer which is never populated. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115902.505491309@linutronix.de commit dd5e3e3ca6ac011582a9f3f987493bf6741568c0 Author: Thomas Gleixner Date: Mon Oct 2 13:59:43 2023 +0200 x86/microcode/intel: Simplify early loading The early loading code is overly complicated: - It scans the builtin/initrd for microcode not only on the BSP, but also on all APs during early boot and then later in the boot process it scans again to duplicate and save the microcode before initrd goes away. That's a pointless exercise because this can be simply done before bringing up the APs when the memory allocator is up and running. - Saving the microcode from within the scan loop is completely non-obvious and a left over of the microcode cache. This can be done at the call site now which makes it obvious. Rework the code so that only the BSP scans the builtin/initrd microcode once during early boot and save it away in an early initcall for later use. [ bp: Test and fold in a fix from tglx ontop which handles the need to distinguish what save_microcode() does depending on when it is called: - when on the BSP during early load, it needs to find a newer revision than the one currently loaded on the BSP - later, before SMP init, it still runs on the BSP and gets the BSP revision just loaded and uses that revision to know which patch to save for the APs. For that it needs to find the exact one as on the BSP. ] Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211722.629085215@linutronix.de commit 42d31dd601fa43b9afdf069d1ba410b2306a4c76 Author: Andrii Nakryiko Date: Sun Oct 22 13:57:37 2023 -0700 bpf: Improve JEQ/JNE branch taken logic When determining if an if/else branch will always or never be taken, use signed range knowledge in addition to currently used unsigned range knowledge. If either signed or unsigned range suggests that condition is always/never taken, return corresponding branch_taken verdict. Current use of unsigned range for this seems arbitrary and unnecessarily incomplete. It is possible for *signed* operations to be performed on register, which could "invalidate" unsigned range for that register. In such case branch_taken will be artificially useless, even if we can still tell that some constant is outside of register value range based on its signed bounds. veristat-based validation shows zero differences across selftests, Cilium, and Meta-internal BPF object files. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Shung-Hsi Yu Link: https://lore.kernel.org/bpf/20231022205743.72352-2-andrii@kernel.org commit b805cafc604bfdb671fae7347a57f51154afa735 Author: Junhao He Date: Tue Oct 24 19:36:30 2023 +0800 perf: hisi: Fix use-after-free when register pmu fails When we fail to register the uncore pmu, the pmu context may not been allocated. The error handing will call cpuhp_state_remove_instance() to call uncore pmu offline callback, which migrate the pmu context. Since that's liable to lead to some kind of use-after-free. Use cpuhp_state_remove_instance_nocalls() instead of cpuhp_state_remove_instance() so that the notifiers don't execute after the PMU device has been failed to register. Fixes: a0ab25cd82ee ("drivers/perf: hisi: Add support for HiSilicon PA PMU driver") FIxes: 3bf30882c3c7 ("drivers/perf: hisi: Add support for HiSilicon SLLC PMU driver") Signed-off-by: Junhao He Link: https://lore.kernel.org/r/20231024113630.13472-1-hejunhao3@huawei.com Signed-off-by: Will Deacon commit 0e20929434080aa87614fa0135c97bb9337ece27 Author: Maso Huang Date: Tue Oct 24 11:50:19 2023 +0800 ASoC: mediatek: mt7986: add sample rate checker mt7986 only supports 8/12/16/24/32/48/96/192 kHz Signed-off-by: Maso Huang Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231024035019.11732-4-maso.huang@mediatek.com Signed-off-by: Mark Brown commit 0f10adb0ed0c0d74f8bc5facf2c70bc515210295 Author: Maso Huang Date: Tue Oct 24 11:50:18 2023 +0800 ASoC: mediatek: mt7986: remove the mt7986_wm8960_priv structure Remove the mt7986_wm8960_priv structure. Signed-off-by: Maso Huang Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231024035019.11732-3-maso.huang@mediatek.com Signed-off-by: Mark Brown commit 3e92ea2a460bc410789b24f328de9985ddc3eea6 Author: Maso Huang Date: Tue Oct 24 11:50:17 2023 +0800 ASoC: mediatek: mt7986: drop the remove callback of mt7986_wm8960 Drop the remove callback of mt7986_wm8960. Signed-off-by: Maso Huang Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231024035019.11732-2-maso.huang@mediatek.com Signed-off-by: Mark Brown commit 06646da01458682023321bdc7553b8140e95d077 Author: Paul E. McKenney Date: Wed Oct 18 15:28:32 2023 -0700 bpf: Fold smp_mb__before_atomic() into atomic_set_release() The bpf_user_ringbuf_drain() BPF_CALL function uses an atomic_set() immediately preceded by smp_mb__before_atomic() so as to order storing of ring-buffer consumer and producer positions prior to the atomic_set() call's clearing of the ->busy flag, as follows: smp_mb__before_atomic(); atomic_set(&rb->busy, 0); Although this works given current architectures and implementations, and given that this only needs to order prior writes against a later write. However, it does so by accident because the smp_mb__before_atomic() is only guaranteed to work with read-modify-write atomic operations, and not at all with things like atomic_set() and atomic_read(). Note especially that smp_mb__before_atomic() will not, repeat *not*, order the prior write to "a" before the subsequent non-read-modify-write atomic read from "b", even on strongly ordered systems such as x86: WRITE_ONCE(a, 1); smp_mb__before_atomic(); r1 = atomic_read(&b); Therefore, replace the smp_mb__before_atomic() and atomic_set() with atomic_set_release() as follows: atomic_set_release(&rb->busy, 0); This is no slower (and sometimes is faster) than the original, and also provides a formal guarantee of ordering that the original lacks. Signed-off-by: Paul E. McKenney Signed-off-by: Daniel Borkmann Acked-by: David Vernet Link: https://lore.kernel.org/bpf/ec86d38e-cfb4-44aa-8fdb-6c925922d93c@paulmck-laptop commit d35381aa73f7e1e8b25f3ed5283287a64d9ddff5 Author: Song Liu Date: Wed Oct 11 22:57:41 2023 -0700 bpf: Fix unnecessary -EBUSY from htab_lock_bucket htab_lock_bucket uses the following logic to avoid recursion: 1. preempt_disable(); 2. check percpu counter htab->map_locked[hash] for recursion; 2.1. if map_lock[hash] is already taken, return -BUSY; 3. raw_spin_lock_irqsave(); However, if an IRQ hits between 2 and 3, BPF programs attached to the IRQ logic will not able to access the same hash of the hashtab and get -EBUSY. This -EBUSY is not really necessary. Fix it by disabling IRQ before checking map_locked: 1. preempt_disable(); 2. local_irq_save(); 3. check percpu counter htab->map_locked[hash] for recursion; 3.1. if map_lock[hash] is already taken, return -BUSY; 4. raw_spin_lock(). Similarly, use raw_spin_unlock() and local_irq_restore() in htab_unlock_bucket(). Fixes: 20b6cc34ea74 ("bpf: Avoid hashtab deadlock with map_locked") Suggested-by: Tejun Heo Signed-off-by: Song Liu Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/7a9576222aa40b1c84ad3a9ba3e64011d1a04d41.camel@linux.ibm.com Link: https://lore.kernel.org/bpf/20231012055741.3375999-1-song@kernel.org commit 8c6fdbd635d4afbcd57243083319a55624d2e168 Author: James Morse Date: Fri Oct 20 19:47:04 2023 +0100 ACPI: scan: Rename acpi_scan_device_not_present() to be about enumeration acpi_scan_device_not_present() is called when a device in the hierarchy is not available for enumeration. Historically enumeration was only based on whether the device was present. To add support for only enumerating devices that are both present and enabled, this helper should be renamed. It was only ever about enumeration, rename it acpi_scan_device_not_enumerated(). No change in behaviour is intended. Signed-off-by: James Morse Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) Reviewed-by: Miguel Luis Signed-off-by: Rafael J. Wysocki commit 078996fcd657e6e0c3a72b7d5806d04c32e74250 Author: Pablo Neira Ayuso Date: Wed Oct 18 22:23:35 2023 +0200 netfilter: nf_tables: set->ops->insert returns opaque set element in case of EEXIST Return struct nft_elem_priv instead of struct nft_set_ext for consistency with ("netfilter: nf_tables: expose opaque set element as struct nft_elem_priv") and to prepare the introduction of element timeout updates from control path. Signed-off-by: Pablo Neira Ayuso commit 0e1ea651c9717ddcd8e0648d8468477a31867b0a Author: Pablo Neira Ayuso Date: Mon Oct 16 14:29:27 2023 +0200 netfilter: nf_tables: shrink memory consumption of set elements Instead of copying struct nft_set_elem into struct nft_trans_elem, store the pointer to the opaque set element object in the transaction. Adapt set backend API (and set backend implementations) to take the pointer to opaque set element representation whenever required. This patch deconstifies .remove() and .activate() set backend API since these modify the set element opaque object. And it also constify nft_set_elem_ext() this provides access to the nft_set_ext struct without updating the object. According to pahole on x86_64, this patch shrinks struct nft_trans_elem size from 216 to 24 bytes. This patch also reduces stack memory consumption by removing the template struct nft_set_elem object, using the opaque set element object instead such as from the set iterator API, catchall elements and the get element command. Signed-off-by: Pablo Neira Ayuso commit 868f8a709874729998bcad3422124b678b18b755 Author: Yicong Yang Date: Tue Oct 24 17:29:54 2023 +0800 drivers/perf: hisi_pcie: Initialize event->cpu only on success Initialize the event->cpu only on success. To be more reasonable and keep consistent with other PMUs. Signed-off-by: Yicong Yang Link: https://lore.kernel.org/r/20231024092954.42297-3-yangyicong@huawei.com Signed-off-by: Will Deacon commit 6d7d51e88e21c0af1ca96a3617afef334bfeffcf Author: Yicong Yang Date: Tue Oct 24 17:29:53 2023 +0800 drivers/perf: hisi_pcie: Check the type first in pmu::event_init() Check whether the event type matches the PMU type firstly in pmu::event_init() before touching the event. Otherwise we'll change the events of others and lead to incorrect results. Since in perf_init_event() we may call every pmu's event_init() in a certain case, we should not modify the event if it's not ours. Fixes: 8404b0fbc7fb ("drivers/perf: hisi: Add driver for HiSilicon PCIe PMU") Signed-off-by: Yicong Yang Link: https://lore.kernel.org/r/20231024092954.42297-2-yangyicong@huawei.com Signed-off-by: Will Deacon commit 9dad402b89e81a0516bad5e0ac009b7a0a80898f Author: Pablo Neira Ayuso Date: Wed Oct 18 22:23:07 2023 +0200 netfilter: nf_tables: expose opaque set element as struct nft_elem_priv Add placeholder structure and place it at the beginning of each struct nft_*_elem for each existing set backend, instead of exposing elements as void type to the frontend which defeats compiler type checks. Use this pointer to this new type to replace void *. This patch updates the following set backend API to use this new struct nft_elem_priv placeholder structure: - update - deactivate - flush - get as well as the following helper functions: - nft_set_elem_ext() - nft_set_elem_init() - nft_set_elem_destroy() - nf_tables_set_elem_destroy() This patch adds nft_elem_priv_cast() to cast struct nft_elem_priv to native element representation from the corresponding set backend. BUILD_BUG_ON() makes sure this .priv placeholder is always at the top of the opaque set element representation. Suggested-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 6509a2e410c3cb36c78a0a85c6102debe171337e Author: Pablo Neira Ayuso Date: Wed Oct 18 22:20:23 2023 +0200 netfilter: nf_tables: set backend .flush always succeeds .flush is always successful since this results from iterating over the set elements to toggle mark the element as inactive in the next generation. Signed-off-by: Pablo Neira Ayuso commit 26cec9d4144eb23c45cd5c033d5c141f04d61a9c Author: Pablo Neira Ayuso Date: Wed Oct 18 22:20:10 2023 +0200 netfilter: nft_set_pipapo: no need to call pipapo_deactivate() from flush Use the element object that is already offered instead. Signed-off-by: Pablo Neira Ayuso commit a552339063d37b3b1133d9dfc31f851edafb27bb Author: Phil Sutter Date: Fri Oct 20 19:34:33 2023 +0200 netfilter: nf_tables: Carry reset boolean in nft_obj_dump_ctx Relieve the dump callback from having to inspect nlmsg_type upon each call, just do it once at start of the dump. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 5a893b9cdf6fa5758f43d323a1d7fa6d1bf489ff Author: Phil Sutter Date: Fri Oct 20 19:34:32 2023 +0200 netfilter: nf_tables: nft_obj_filter fits into cb->ctx No need to allocate it if one may just use struct netlink_callback's scratch area for it. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 2eda95cfa2fc43bcb21a801dc1d16a0b7cc73860 Author: Phil Sutter Date: Fri Oct 20 19:34:31 2023 +0200 netfilter: nf_tables: Carry s_idx in nft_obj_dump_ctx Prep work for moving the context into struct netlink_callback scratch area. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit ecf49cad807061d880bea27a5da8e0114ddc7690 Author: Phil Sutter Date: Fri Oct 20 19:34:30 2023 +0200 netfilter: nf_tables: A better name for nft_obj_filter Name it for what it is supposed to become, a real nft_obj_dump_ctx. No functional change intended. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 4279cc60b354d2d2b970655a70a151cbfa1d958b Author: Phil Sutter Date: Fri Oct 20 19:34:29 2023 +0200 netfilter: nf_tables: Unconditionally allocate nft_obj_filter Prep work for moving the filter into struct netlink_callback's scratch area. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit ff16111cc10c82ee065ffbd9fa8d6210394ff8c6 Author: Phil Sutter Date: Fri Oct 20 19:34:28 2023 +0200 netfilter: nf_tables: Drop pointless memset in nf_tables_dump_obj The code does not make use of cb->args fields past the first one, no need to zero them. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 643d1260366424412e8269caead410d333e3263f Author: Florian Westphal Date: Fri Oct 20 14:38:15 2023 +0200 netfilter: conntrack: switch connlabels to atomic_t The spinlock is back from the day when connabels did not have a fixed size and reallocation had to be supported. Remove it. This change also allows to call the helpers from softirq or timers without deadlocks. Also add WARN()s to catch refcounting imbalances. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit ee6f05dcd6727669b6f49a8a6dafad94a40ee872 Author: Florian Westphal Date: Fri Oct 20 13:14:25 2023 +0200 br_netfilter: use single forward hook for ip and arp br_netfilter registers two forward hooks, one for ip and one for arp. Just use a common function for both and then call the arp/ip helper as needed. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 3cb03edb4de33fd04c4ea55f47397b96a8657c53 Author: Phil Sutter Date: Thu Oct 19 16:03:36 2023 +0200 netfilter: nf_tables: Add locking for NFT_MSG_GETRULE_RESET requests Rule reset is not concurrency-safe per-se, so multiple CPUs may reset the same rule at the same time. At least counter and quota expressions will suffer from value underruns in this case. Prevent this by introducing dedicated locking callbacks for nfnetlink and the asynchronous dump handling to serialize access. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 1578c32877191815f631af32ba5dfc1f1b20c1b4 Author: Phil Sutter Date: Thu Oct 19 16:03:35 2023 +0200 netfilter: nf_tables: Introduce nf_tables_getrule_single() Outsource the reply skb preparation for non-dump getrule requests into a distinct function. Prep work for rule reset locking. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 8877393029e764036892d39614900987cbd21ca6 Author: Phil Sutter Date: Thu Oct 19 16:03:34 2023 +0200 netfilter: nf_tables: Open-code audit log call in nf_tables_getrule() The table lookup will be dropped from that function, so remove that dependency from audit logging code. Using whatever is in nla[NFTA_RULE_TABLE] is sufficient as long as the previous rule info filling succeded. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 7d259f021aaa78904b6c836d975e8e00d83a182a Author: Florian Westphal Date: Fri Oct 13 14:18:16 2023 +0200 netfilter: nft_set_rbtree: prefer sync gc to async worker There is no need for asynchronous garbage collection, rbtree inserts can only happen from the netlink control plane. We already perform on-demand gc on insertion, in the area of the tree where the insertion takes place, but we don't do a full tree walk there for performance reasons. Do a full gc walk at the end of the transaction instead and remove the async worker. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 8079fc30f79799e59d9602e7e080d434936a482d Author: Florian Westphal Date: Fri Oct 13 14:18:15 2023 +0200 netfilter: nft_set_rbtree: rename gc deactivate+erase function Next patch adds a cllaer that doesn't hold the priv->write lock and will need a similar function. Rename the existing function to make it clear that it can only be used for opportunistic gc during insertion. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 6d25d1dc76bf5943a5c1f4bb74d66d5eac58eb77 Author: Liu Jian Date: Mon Oct 23 14:47:29 2023 +0800 net: sched: sch_qfq: Use non-work-conserving warning handler A helper function for printing non-work-conserving alarms is added in commit b00355db3f88 ("pkt_sched: sch_hfsc: sch_htb: Add non-work-conserving warning handler."). In this commit, use qdisc_warn_nonwc() instead of WARN_ONCE() to handle the non-work-conserving warning in qfq Qdisc. Signed-off-by: Liu Jian Link: https://lore.kernel.org/r/20231023064729.370649-1-liujian56@huawei.com Signed-off-by: Paolo Abeni commit fad5bf2e2c900232277288460b7a91b147954aab Author: Otto Pflüger Date: Sat Oct 14 15:38:23 2023 +0200 pmdomain: qcom: rpmpd: Add QM215 power domains QM215 is typically paired with a PM8916 PMIC and uses its SMPA1 and LDOA2 regulators in voltage level mode for VDDCX and VDDMX, respectively. Signed-off-by: Otto Pflüger Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231014133823.14088-4-otto.pflueger@abscue.de Signed-off-by: Ulf Hansson commit d975a9a9d631da97d22af06a9c806a0530b0f90b Author: Otto Pflüger Date: Sat Oct 14 15:38:22 2023 +0200 pmdomain: qcom: rpmpd: Add MSM8917 power domains MSM8917 uses the SMPA2 and LDOA3 regulators provided by the PM8937 PMIC for the VDDCX and VDDMX power domains in voltage level mode, respectively. These definitions should also work on MSM8937. Signed-off-by: Otto Pflüger Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231014133823.14088-3-otto.pflueger@abscue.de Signed-off-by: Ulf Hansson commit 1817d56ec81c419b9976d1ee968039519b915ae2 Merge: 55089e1fb2d8b 61848698288d9 Author: Ulf Hansson Date: Tue Oct 24 12:48:56 2023 +0200 pmdomain: Merge branch genpd_dt into next Merge the immutable branch genpd_dt into next, to allow the DT bindings to be tested together with new pmdomain changes that are targeted for v6.7. Signed-off-by: Ulf Hansson commit 61848698288d93a230cab9c0585e726df66f2402 Author: Otto Pflüger Date: Sat Oct 14 15:38:21 2023 +0200 dt-bindings: power: rpmpd: Add MSM8917, MSM8937 and QM215 The MSM8917, MSM8937 and QM215 SoCs have VDDCX and VDDMX power domains controlled in voltage level mode. Define the MSM8937 and QM215 power domains as aliases because these SoCs are similar to MSM8917 and may share some parts of the device tree. Also add the compatibles for these SoCs to the documentation, with qcom,msm8937-rpmpd using qcom,msm8917-rpmpd as a fallback compatible because there are no known differences. QM215 is not compatible with these because it uses different regulators. Signed-off-by: Otto Pflüger Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231014133823.14088-2-otto.pflueger@abscue.de Signed-off-by: Ulf Hansson commit 2e75396f1df61e1f1d26d0d703fc7292c4ae4371 Author: Maíra Canal Date: Tue Oct 24 07:10:40 2023 -0300 pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable The commit c494a447c14e ("soc: bcm: bcm2835-power: Refactor ASB control") refactored the ASB control by using a general function to handle both the enable and disable. But this patch introduced a subtle regression: we need to check if !!(readl(base + reg) & ASB_ACK) == enable, not just check if (readl(base + reg) & ASB_ACK) == true. Currently, this is causing an invalid register state in V3D when unloading and loading the driver, because `bcm2835_asb_disable()` will return -ETIMEDOUT and `bcm2835_asb_power_off()` will fail to disable the ASB slave for V3D. Fixes: c494a447c14e ("soc: bcm: bcm2835-power: Refactor ASB control") Signed-off-by: Maíra Canal Reviewed-by: Florian Fainelli Reviewed-by: Stefan Wahren Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231024101251.6357-2-mcanal@igalia.com Signed-off-by: Ulf Hansson commit 99b29a499b5fdfb7ab274835b8e4d4c11df2f6d7 Author: Albert Huang Date: Mon Oct 23 20:57:31 2023 +0800 xsk: Avoid starving the xsk further down the list In the previous implementation, when multiple xsk sockets were associated with a single xsk_buff_pool, a situation could arise where the xsk_tx_list maintained data at the front for one xsk socket while starving the xsk sockets at the back of the list. This could result in issues such as the inability to transmit packets, increased latency, and jitter. To address this problem, we introduce a new variable called tx_budget_spent, which limits each xsk to transmit a maximum of MAX_PER_SOCKET_BUDGET tx descriptors. This allocation ensures equitable opportunities for subsequent xsk sockets to send tx descriptors. The value of MAX_PER_SOCKET_BUDGET is set to 32. Signed-off-by: Albert Huang Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20231023125732.82261-1-huangjie.albert@bytedance.com commit ec098970364234411f39cd6821e6f95937b4070c Author: Greg Kroah-Hartman Date: Tue Oct 24 11:51:04 2023 +0200 Revert "dt-bindings: usb: Add bindings for multiport properties on DWC3 controller" This reverts commit eb3f1d9e42b1499152442e97b51bc1bcfee29d71. The patches for the features that these bindings described are still under active development, so odds are these bindings will also have to be changed in the future. As no in-tree code requires these bindings at the moment, revert them. Reported-by: Johan Hovold Link: https://lore.kernel.org/r/ZTeObdjSSok0tttg@hovoldconsulting.com Cc: Bjorn Andersson Cc: Krishna Kurapati Signed-off-by: Greg Kroah-Hartman commit d026fc7b73a58ea3b2fe567674e71cccd90f6a84 Author: Greg Kroah-Hartman Date: Tue Oct 24 11:50:57 2023 +0200 Revert "dt-bindings: usb: qcom,dwc3: Add bindings for SC8280 Multiport" This reverts commit ca58c4ae75b65e1d78408b134f129ea91e9595b8. The patches for the features that these bindings described are still under active development, so odds are these bindings will also have to be changed in the future. As no in-tree code requires these bindings at the moment, revert them. Reported-by: Johan Hovold Link: https://lore.kernel.org/r/ZTeObdjSSok0tttg@hovoldconsulting.com Cc: Krishna Kurapati Cc: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman commit 6f699743aebf07538e506a46c5965eb8bdd2c716 Author: Tony Lindgren Date: Mon Oct 23 10:48:54 2023 +0300 serial: core: Fix runtime PM handling for pending tx Richard reported that a serial port may end up sometimes with tx data pending in the buffer for long periods of time. Turns out we bail out early on any errors from pm_runtime_get(), including -EINPROGRESS. To fix the issue, we need to ignore -EINPROGRESS as we only care about the runtime PM usage count at this point. We check for an active runtime PM state later on for tx. Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") Cc: stable Reported-by: Richard Purdie Cc: Bruce Ashfield Cc: Mikko Rapeli Cc: Paul Gortmaker Cc: Randy MacLeod Signed-off-by: Tony Lindgren Tested-by: Richard Purdie Link: https://lore.kernel.org/r/20231023074856.61896-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit f30a51a41828986687997a5aa95b9f8085228cff Author: Adam Ford Date: Sun Oct 22 10:19:11 2023 -0500 net: ethernet: davinci_emac: Use MAC Address from Device Tree Currently there is a device tree entry called "local-mac-address" which can be filled by the bootloader or manually set.This is useful when the user does not want to use the MAC address programmed into the SoC. Currently, the davinci_emac reads the MAC from the DT, copies it from pdata->mac_addr to priv->mac_addr, then blindly overwrites it by reading from registers in the SoC, and falls back to a random MAC if it's still not valid. This completely ignores any MAC address in the device tree. In order to use the local-mac-address, check to see if the contents of priv->mac_addr are valid before falling back to reading from the SoC when the MAC address is not valid. Signed-off-by: Adam Ford Reviewed-by: Andrew Lunn Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231022151911.4279-1-aford173@gmail.com Signed-off-by: Paolo Abeni commit 0217f3944aebad1d4beec5894ec80472b94b4139 Author: Willy Tarreau Date: Sun Oct 15 15:09:59 2023 +0200 Documentation: security-bugs.rst: linux-distros relaxed their rules The linux-distros list relaxed their rules to try to adapt better to how the Linux kernel works. Let's update the Coordination part to explain why and when to contact them or not to and how to avoid trouble in the future. Link: https://www.openwall.com/lists/oss-security/2023/09/08/4 Cc: Kees Cook Cc: Solar Designer Cc: Vegard Nossum Acked-by: Jiri Kosina Signed-off-by: Willy Tarreau Link: https://lore.kernel.org/r/20231015130959.26242-1-w@1wt.eu Signed-off-by: Greg Kroah-Hartman commit d3c50061765d4b5616dc97f5804fc18122598a9b Author: Ian Kent Date: Mon Oct 23 17:33:59 2023 +0800 autofs: fix add autofs_parse_fd() We are seeing systemd hang on its autofs direct mount at /proc/sys/fs/binfmt_misc. Historically this was due to a mismatch in the communication structure size between a 64 bit kernel and a 32 bit user space and was fixed by making the pipe communication record oriented. During autofs v5 development I decided to stay with the existing usage instead of changing to a packed structure for autofs <=> user space communications which turned out to be a mistake on my part. Problems arose and they were fixed by allowing for the 64 bit to 32 bit size difference in the automount(8) code. Along the way systemd started to use autofs and eventually encountered this problem too. systemd refused to compensate for the length difference insisting it be fixed in the kernel. Fortunately Linus implemented the packetized pipe which resolved the problem in a straight forward and simple way. In the autofs mount api conversion series I inadvertatly dropped the packet pipe flag settings when adding the autofs_parse_fd() function. This patch fixes that omission. Fixes: 546694b8f658 ("autofs: add autofs_parse_fd()") Signed-off-by: Ian Kent Link: https://lore.kernel.org/r/20231023093359.64265-1-raven@themaw.net Tested-by: Anders Roxell Cc: Bill O'Donnell Cc: Christian Brauner Cc: Arnd Bergmann Cc: Dan Carpenter Cc: Anders Roxell Cc: Naresh Kamboju Cc: Stephen Rothwell Reported-by: Linux Kernel Functional Testing Reported-by: Anders Roxell Signed-off-by: Christian Brauner commit c04d905f6c7c41f137de7e4a9279e5c938eb19ef Author: Bernd Schubert Date: Mon Oct 23 20:47:18 2023 +0200 vfs: Convert BUG_ON to WARN_ON_ONCE in open_last_lookups The calling code actually handles -ECHILD, so this BUG_ON can be converted to WARN_ON_ONCE. Signed-off-by: Bernd Schubert Link: https://lore.kernel.org/r/20231023184718.11143-1-bschubert@ddn.com Cc: Christian Brauner Cc: Al Viro Cc: Amir Goldstein Cc: Dharmendra Singh Cc: Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner commit 984ffb6a4366752c949f7b39640aecdce222607f Author: Peter Zijlstra Date: Fri Oct 20 12:35:33 2023 +0200 sched/fair: Remove SIS_PROP SIS_UTIL seems to work well, lets remove the old thing. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Vincent Guittot Link: https://lkml.kernel.org/r/20231020134337.GD33965@noisy.programming.kicks-ass.net commit 22165f61d0c4092adf40f967c899e5d8b8a0d703 Author: Yicong Yang Date: Thu Oct 19 11:33:23 2023 +0800 sched/fair: Use candidate prev/recent_used CPU if scanning failed for cluster wakeup Chen Yu reports a hackbench regression of cluster wakeup when hackbench threads equal to the CPU number [1]. Analysis shows it's because we wake up more on the target CPU even if the prev_cpu is a good wakeup candidate and leads to the decrease of the CPU utilization. Generally if the task's prev_cpu is idle we'll wake up the task on it without scanning. On cluster machines we'll try to wake up the task in the same cluster of the target for better cache affinity, so if the prev_cpu is idle but not sharing the same cluster with the target we'll still try to find an idle CPU within the cluster. This will improve the performance at low loads on cluster machines. But in the issue above, if the prev_cpu is idle but not in the cluster with the target CPU, we'll try to scan an idle one in the cluster. But since the system is busy, we're likely to fail the scanning and use target instead, even if the prev_cpu is idle. Then leads to the regression. This patch solves this in 2 steps: o record the prev_cpu/recent_used_cpu if they're good wakeup candidates but not sharing the cluster with the target. o on scanning failure use the prev_cpu/recent_used_cpu if they're recorded as idle [1] https://lore.kernel.org/all/ZGzDLuVaHR1PAYDt@chenyu5-mobl1/ Closes: https://lore.kernel.org/all/ZGsLy83wPIpamy6x@chenyu5-mobl1/ Reported-by: Chen Yu Signed-off-by: Yicong Yang Tested-and-reviewed-by: Chen Yu Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lkml.kernel.org/r/20231019033323.54147-4-yangyicong@huawei.com commit 8881e1639f1f899b64e9bccf6cc14d51c1d3c822 Author: Barry Song Date: Thu Oct 19 11:33:22 2023 +0800 sched/fair: Scan cluster before scanning LLC in wake-up path For platforms having clusters like Kunpeng920, CPUs within the same cluster have lower latency when synchronizing and accessing shared resources like cache. Thus, this patch tries to find an idle cpu within the cluster of the target CPU before scanning the whole LLC to gain lower latency. This will be implemented in 2 steps in select_idle_sibling(): 1. When the prev_cpu/recent_used_cpu are good wakeup candidates, use them if they're sharing cluster with the target CPU. Otherwise trying to scan for an idle CPU in the target's cluster. 2. Scanning the cluster prior to the LLC of the target CPU for an idle CPU to wakeup. Testing has been done on Kunpeng920 by pinning tasks to one numa and two numa. On Kunpeng920, Each numa has 8 clusters and each cluster has 4 CPUs. With this patch, We noticed enhancement on tbench and netperf within one numa or cross two numa on top of tip-sched-core commit 9b46f1abc6d4 ("sched/debug: Print 'tgid' in sched_show_task()") tbench results (node 0): baseline patched 1: 327.2833 372.4623 ( 13.80%) 4: 1320.5933 1479.8833 ( 12.06%) 8: 2638.4867 2921.5267 ( 10.73%) 16: 5282.7133 5891.5633 ( 11.53%) 32: 9810.6733 9877.3400 ( 0.68%) 64: 7408.9367 7447.9900 ( 0.53%) 128: 6203.2600 6191.6500 ( -0.19%) tbench results (node 0-1): baseline patched 1: 332.0433 372.7223 ( 12.25%) 4: 1325.4667 1477.6733 ( 11.48%) 8: 2622.9433 2897.9967 ( 10.49%) 16: 5218.6100 5878.2967 ( 12.64%) 32: 10211.7000 11494.4000 ( 12.56%) 64: 13313.7333 16740.0333 ( 25.74%) 128: 13959.1000 14533.9000 ( 4.12%) netperf results TCP_RR (node 0): baseline patched 1: 76546.5033 90649.9867 ( 18.42%) 4: 77292.4450 90932.7175 ( 17.65%) 8: 77367.7254 90882.3467 ( 17.47%) 16: 78519.9048 90938.8344 ( 15.82%) 32: 72169.5035 72851.6730 ( 0.95%) 64: 25911.2457 25882.2315 ( -0.11%) 128: 10752.6572 10768.6038 ( 0.15%) netperf results TCP_RR (node 0-1): baseline patched 1: 76857.6667 90892.2767 ( 18.26%) 4: 78236.6475 90767.3017 ( 16.02%) 8: 77929.6096 90684.1633 ( 16.37%) 16: 77438.5873 90502.5787 ( 16.87%) 32: 74205.6635 88301.5612 ( 19.00%) 64: 69827.8535 71787.6706 ( 2.81%) 128: 25281.4366 25771.3023 ( 1.94%) netperf results UDP_RR (node 0): baseline patched 1: 96869.8400 110800.8467 ( 14.38%) 4: 97744.9750 109680.5425 ( 12.21%) 8: 98783.9863 110409.9637 ( 11.77%) 16: 99575.0235 110636.2435 ( 11.11%) 32: 95044.7250 97622.8887 ( 2.71%) 64: 32925.2146 32644.4991 ( -0.85%) 128: 12859.2343 12824.0051 ( -0.27%) netperf results UDP_RR (node 0-1): baseline patched 1: 97202.4733 110190.1200 ( 13.36%) 4: 95954.0558 106245.7258 ( 10.73%) 8: 96277.1958 105206.5304 ( 9.27%) 16: 97692.7810 107927.2125 ( 10.48%) 32: 79999.6702 103550.2999 ( 29.44%) 64: 80592.7413 87284.0856 ( 8.30%) 128: 27701.5770 29914.5820 ( 7.99%) Note neither Kunpeng920 nor x86 Jacobsville supports SMT, so the SMT branch in the code has not been tested but it supposed to work. Chen Yu also noticed this will improve the performance of tbench and netperf on a 24 CPUs Jacobsville machine, there are 4 CPUs in one cluster sharing L2 Cache. [https://lore.kernel.org/lkml/Ytfjs+m1kUs0ScSn@worktop.programming.kicks-ass.net] Suggested-by: Peter Zijlstra Signed-off-by: Barry Song Signed-off-by: Yicong Yang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Tim Chen Reviewed-by: Chen Yu Reviewed-by: Gautham R. Shenoy Reviewed-by: Vincent Guittot Tested-and-reviewed-by: Chen Yu Tested-by: Yicong Yang Link: https://lkml.kernel.org/r/20231019033323.54147-3-yangyicong@huawei.com commit b95303e0aeaf446b65169dd4142cacdaeb7d4c8b Author: Barry Song Date: Thu Oct 19 11:33:21 2023 +0800 sched: Add cpus_share_resources API Add cpus_share_resources() API. This is the preparation for the optimization of select_idle_cpu() on platforms with cluster scheduler level. On a machine with clusters cpus_share_resources() will test whether two cpus are within the same cluster. On a non-cluster machine it will behaves the same as cpus_share_cache(). So we use "resources" here for cache resources. Signed-off-by: Barry Song Signed-off-by: Yicong Yang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Gautham R. Shenoy Reviewed-by: Tim Chen Reviewed-by: Vincent Guittot Tested-and-reviewed-by: Chen Yu Tested-by: K Prateek Nayak Link: https://lkml.kernel.org/r/20231019033323.54147-2-yangyicong@huawei.com commit 5ebde09d91707a4a9bec1e3d213e3c12ffde348f Author: Hao Jia Date: Thu Oct 12 17:00:03 2023 +0800 sched/core: Fix RQCF_ACT_SKIP leak Igor Raits and Bagas Sanjaya report a RQCF_ACT_SKIP leak warning. This warning may be triggered in the following situations: CPU0 CPU1 __schedule() *rq->clock_update_flags <<= 1;* unregister_fair_sched_group() pick_next_task_fair+0x4a/0x410 destroy_cfs_bandwidth() newidle_balance+0x115/0x3e0 for_each_possible_cpu(i) *i=0* rq_unpin_lock(this_rq, rf) __cfsb_csd_unthrottle() raw_spin_rq_unlock(this_rq) rq_lock(*CPU0_rq*, &rf) rq_clock_start_loop_update() rq->clock_update_flags & RQCF_ACT_SKIP <-- raw_spin_rq_lock(this_rq) The purpose of RQCF_ACT_SKIP is to skip the update rq clock, but the update is very early in __schedule(), but we clear RQCF_*_SKIP very late, causing it to span that gap above and triggering this warning. In __schedule() we can clear the RQCF_*_SKIP flag immediately after update_rq_clock() to avoid this RQCF_ACT_SKIP leak warning. And set rq->clock_update_flags to RQCF_UPDATED to avoid rq->clock_update_flags < RQCF_ACT_SKIP warning that may be triggered later. Fixes: ebb83d84e49b ("sched/core: Avoid multiple calling update_rq_clock() in __cfsb_csd_unthrottle()") Closes: https://lore.kernel.org/all/20230913082424.73252-1-jiahao.os@bytedance.com Reported-by: Igor Raits Reported-by: Bagas Sanjaya Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Hao Jia Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/a5dd536d-041a-2ce9-f4b7-64d8d85c86dc@gmail.com commit 66e6369e312d161708786123fb44ecd53ff32d82 Author: Abel Wu Date: Thu Oct 19 20:00:26 2023 +0800 sock: Ignore memcg pressure heuristics when raising allocated Before sockets became aware of net-memcg's memory pressure since commit e1aab161e013 ("socket: initial cgroup code."), the memory usage would be granted to raise if below average even when under protocol's pressure. This provides fairness among the sockets of same protocol. That commit changes this because the heuristic will also be effective when only memcg is under pressure which makes no sense. So revert that behavior. After reverting, __sk_mem_raise_allocated() no longer considers memcg's pressure. As memcgs are isolated from each other w.r.t. memory accounting, consuming one's budget won't affect others. So except the places where buffer sizes are needed to be tuned, allow workloads to use the memory they are provisioned. Signed-off-by: Abel Wu Acked-by: Shakeel Butt Acked-by: Paolo Abeni Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231019120026.42215-3-wuyun.abel@bytedance.com Signed-off-by: Paolo Abeni commit 2e12072c67b5f65fc71a569985a1262531fbdc06 Author: Abel Wu Date: Thu Oct 19 20:00:25 2023 +0800 sock: Doc behaviors for pressure heurisitics There are now two accounting infrastructures for skmem, while the heuristics in __sk_mem_raise_allocated() were actually introduced before memcg was born. Add some comments to clarify whether they can be applied to both infrastructures or not. Suggested-by: Shakeel Butt Signed-off-by: Abel Wu Acked-by: Shakeel Butt Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231019120026.42215-2-wuyun.abel@bytedance.com Signed-off-by: Paolo Abeni commit 2def8ff3fdb66d10ebe3ec84787799ac0244eb23 Author: Abel Wu Date: Thu Oct 19 20:00:24 2023 +0800 sock: Code cleanup on __sk_mem_raise_allocated() Code cleanup for both better simplicity and readability. No functional change intended. Signed-off-by: Abel Wu Acked-by: Shakeel Butt Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231019120026.42215-1-wuyun.abel@bytedance.com Signed-off-by: Paolo Abeni commit f6e12277011d39a42e2c01fabb4222c09cb099fc Author: Jan Kiszka Date: Sun Oct 22 10:56:22 2023 +0200 net: ti: icssg-prueth: Add phys_port_name support Helps identifying the ports in udev rules e.g. Signed-off-by: Jan Kiszka Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/895ae9c1-b6dd-4a97-be14-6f2b73c7b2b5@siemens.com Signed-off-by: Paolo Abeni commit 3f6074cf467f6c2beb7db0b0d685fb53f25ae9aa Author: Li kunyu Date: Mon Oct 23 14:23:59 2023 +0800 printk: printk: Remove unnecessary statements'len = 0;' In the following two functions, len has already been assigned a value of 0 when defining the variable, so remove 'len=0;'. Signed-off-by: Li kunyu Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20231023062359.130633-1-kunyu@nfschina.com commit 169e0a5e43208fc5a6c5bc6476348cbd7203ae8a Author: Vishvambar Panth S Date: Sat Oct 21 00:28:01 2023 +0530 net: microchip: lan743x: improve throughput with rx timestamp config Currently all RX frames are timestamped which results in a performance penalty when timestamping is not needed. The default is now being changed to not timestamp any Rx frames (HWTSTAMP_FILTER_NONE), but support has been added to allow changing the desired RX timestamping mode (HWTSTAMP_FILTER_ALL - which was the previous setting and HWTSTAMP_FILTER_PTP_V2_EVENT are now supported) using SIOCSHWTSTAMP. All settings were tested using the hwstamp_ctl application. It is also noted that ptp4l, when started, preconfigures the device to timestamp using HWTSTAMP_FILTER_PTP_V2_EVENT, so this driver continues to work properly "out of the box". Test setup: x64 PC with LAN7430 ---> x64 PC as partner iperf3 with - Timestamp all incoming packets: - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-5.05 sec 517 MBytes 859 Mbits/sec 0 sender [ 5] 0.00-5.00 sec 515 MBytes 864 Mbits/sec receiver iperf Done. iperf3 with - Timestamp only PTP packets: - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-5.04 sec 563 MBytes 937 Mbits/sec 0 sender [ 5] 0.00-5.00 sec 561 MBytes 941 Mbits/sec receiver Signed-off-by: Vishvambar Panth S Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231020185801.25649-1-vishvambarpanth.s@microchip.com Signed-off-by: Paolo Abeni commit b0eaf27f202813f28af77e33e80ec0f05a34df01 Author: Arnd Bergmann Date: Tue Oct 24 07:44:02 2023 +0200 vgacon: fix mips/sibyte build regression The conversion to vgacon_register_screen() was missing an #include statement for the swarm board: arch/mips/sibyte/swarm/setup.c:146:9: error: implicit declaration of function 'vgacon_register_screen' [-Werror=implicit-function-declaration] Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310240429.UqeQ2Cpr-lkp@intel.com/ Fixes: 555624c0d10b vgacon: clean up global screen_info instances Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231024054412.2291220-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 956dbd3de400a5665faf08a8588556db9c1bb56e Author: Sumeet Pawnikar Date: Tue May 23 17:46:45 2023 +0530 tools/power/turbostat: Add initial support for LunarLake Add initial support for LunarLake platform. It shares the same features with CannonLake. Signed-off-by: Sumeet Pawnikar commit 7b57e7b683e3872b02117f46bd7dc7ad765888a8 Author: Sumeet Pawnikar Date: Tue May 23 17:46:45 2023 +0530 tools/power/turbostat: Add initial support for ArrowLake Add initial support for ArrowLake platform. It shares the same features with CannonLake. Signed-off-by: Sumeet Pawnikar commit 5a6efcb9102af4210d5a59182dbfbc594ae50fd4 Author: Zhang Rui Date: Thu Oct 19 11:00:07 2023 +0800 tools/power/turbostat: Add initial support for GrandRidge Add initial support for GrandRidge. It shares the same features as SierraForest, except that it does not support PC2/PC6. Signed-off-by: Zhang Rui commit d33605f367414c7e0009978d1fbe9af01a36e221 Author: Zhang Rui Date: Thu Sep 28 13:09:02 2023 +0800 tools/power/turbostat: Add initial support for SierraForest Add initial support for SierraForest. It shares the same features with SapphireRapids, except that it has MSR_MODULE_C6_RES_MS support. Signed-off-by: Zhang Rui commit 5feab4a6b8a730438a0fe8758dfa0700f951edde Author: Zhang Rui Date: Sat Sep 9 13:28:07 2023 +0800 tools/power/turbostat: Add initial support for GraniteRapids Add initial support for GraniteRapids. It shares the same features with SapphireRapids. Signed-off-by: Zhang Rui commit 0e3f10e6aa97b0134b526ec9cdc3ccdac2239b43 Author: Zhang Rui Date: Thu Oct 19 11:04:33 2023 +0800 tools/power/turbostat: Add MSR_CORE_C1_RES support for spr_features Add MSR_CORE_C1_RES support for spr_features because both Sapphirerapids and Emeraldrapids support this MSR. Signed-off-by: Zhang Rui commit 37f68a2940558b4f6f8e51b7b1d00f084b4bdde2 Author: Srinivas Pandruvada Date: Tue Jan 24 10:39:53 2023 -0800 tools/power/turbostat: Move process to root cgroup When available CPUs are reduced via cgroup cpuset controller, turbostat will exit with errors (For example): get_counters: Could not migrate to CPU 0 turbostat: re-initialized with num_cpus 20 get_counters: Could not migrate to CPU 0 turbostat: re-initialized with num_cpus 20 Move the turbostat to root cgroup, which has every CPU. Writing the value 0 to a cgroup.procs file causes the writing process to be moved to the corresponding cgroup. Signed-off-by: Srinivas Pandruvada Tested-by: Zhang Rui commit f638858da0925b29122f05135663013dc240eaf9 Author: Zhang Rui Date: Fri Oct 20 09:39:22 2023 +0800 tools/power/turbostat: Handle cgroup v2 cpu limitation CPUs can be isolated via cgroup settings and turbostat should avoid migrating to these CPUs, just like it does for the '-c' cpus. Introduce cpu_effective_set to save the cgroup cpu limitation info from /sys/fs/cgroup/cpuset.cpus.effective. And use cpu_allowed_set as the intersection of cpu_present_set, cpu_effective_set and cpu_subset. Signed-off-by: Zhang Rui commit 8c3dd2c9e54273922ea71b2a4c0e77fc624c396b Author: Zhang Rui Date: Fri Oct 20 09:45:21 2023 +0800 tools/power/turbostat: Abstrct function for parsing cpu string Abstract parse_cpu_str() which can update any specified cpu_set by a given cpu string. This can be used to handle further CPU limitations from other sources like cgroup. The cpu string parsing code is also enhanced to handle the strings that have an extra '\n' before string terminator. Signed-off-by: Zhang Rui commit a321af9dd0957713180e51c4ffc5225fc4cdc4f4 Author: Yue Haibing Date: Mon Aug 7 22:17:26 2023 +0800 fs/9p: Remove unused function declaration v9fs_inode2stat() Commit 531b1094b743 ("[PATCH] v9fs: zero copy implementation") declared but never implemented this. Signed-off-by: Yue Haibing Message-ID: <20230807141726.38860-1-yuehaibing@huawei.com> Signed-off-by: Dominique Martinet commit 58e3ce767307130e911408c75f054d6a6673c8a3 Author: Sishuai Gong Date: Tue Aug 8 12:44:31 2023 -0400 9p/trans_fd: avoid sending req to a cancelled conn When a connection is cancelled by p9_conn_cancel(), all requests on it should be cancelled---mark req->status as REQ_STATUS_ERROR. However, because a race over m->err between p9_conn_cancel() and p9_fd_request(), p9_fd_request might see the old value of m->err, think that the connection is NOT cancelled, and then add new requests to this cancelled connection. Fixing this issue by lock-protecting the check on m->err. Signed-off-by: Sishuai Gong Message-ID: Signed-off-by: Dominique Martinet Reviewed-by: Christian Schoenebeck commit dedd6c894110371d3c218cf24ecca2f0730408ac Merge: b63dadd6f9752 b4d8239534fdd Author: Alexei Starovoitov Date: Mon Oct 23 21:49:32 2023 -0700 Merge branch 'exact-states-comparison-for-iterator-convergence-checks' Eduard Zingerman says: ==================== exact states comparison for iterator convergence checks Iterator convergence logic in is_state_visited() uses state_equals() for states with branches counter > 0 to check if iterator based loop converges. This is not fully correct because state_equals() relies on presence of read and precision marks on registers. These marks are not guaranteed to be finalized while state has branches. Commit message for patch #3 describes a program that exhibits such behavior. This patch-set aims to fix iterator convergence logic by adding notion of exact states comparison. Exact comparison does not rely on presence of read or precision marks and thus is more strict. As explained in commit message for patch #3 exact comparisons require addition of speculative register bounds widening. The end result for BPF verifier users could be summarized as follows: (!) After this update verifier would reject programs that conjure an imprecise value on the first loop iteration and use it as precise on the second (for iterator based loops). I urge people to at least skim over the commit message for patch #3. Patches are organized as follows: - patches #1,2: moving/extracting utility functions; - patch #3: introduces exact mode for states comparison and adds widening heuristic; - patch #4: adds test-cases that demonstrate why the series is necessary; - patch #5: extends patch #3 with a notion of state loop entries, these entries have to be tracked to correctly identify that different verifier states belong to the same states loop; - patch #6: adds a test-case that demonstrates a program which requires loop entry tracking for correct verification; - patch #7: just adds a few debug prints. The following actions are planned as a followup for this patch-set: - implementation has to be adapted for callbacks handling logic as a part of a fix for [1]; - it is necessary to explore ways to improve widening heuristic to handle iters_task_vma test w/o need to insert barrier_var() calls; - explored states eviction logic on cache miss has to be extended to either: - allow eviction of checkpoint states -or- - be sped up in case if there are many active checkpoints associated with the same instruction. The patch-set is a followup for mailing list discussion [1]. Changelog: - V2 [3] -> V3: - correct check for stack spills in widen_imprecise_scalars(), added test case progs/iters.c:widen_spill to check the behavior (suggested by Andrii); - allow eviction of checkpoint states in is_state_visited() to avoid pathological verifier performance when iterator based loop does not converge (discussion with Alexei). - V1 [2] -> V2, applied changes suggested by Alexei offlist: - __explored_state() function removed; - same_callsites() function is now used in clean_live_states(); - patches #1,2 are added as preparatory code movement; - in process_iter_next_call() a safeguard is added to verify that cur_st->parent exists and has expected insn index / call sites. [1] https://lore.kernel.org/bpf/97a90da09404c65c8e810cf83c94ac703705dc0e.camel@gmail.com/ [2] https://lore.kernel.org/bpf/20231021005939.1041-1-eddyz87@gmail.com/ [3] https://lore.kernel.org/bpf/20231022010812.9201-1-eddyz87@gmail.com/ ==================== Link: https://lore.kernel.org/r/20231024000917.12153-1-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit b4d8239534fddc036abe4a0fdbf474d9894d4641 Author: Eduard Zingerman Date: Tue Oct 24 03:09:17 2023 +0300 bpf: print full verifier states on infinite loop detection Additional logging in is_state_visited(): if infinite loop is detected print full verifier state for both current and equivalent states. Acked-by: Andrii Nakryiko Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231024000917.12153-8-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 64870feebecb7130291a55caf0ce839a87405a70 Author: Eduard Zingerman Date: Tue Oct 24 03:09:16 2023 +0300 selftests/bpf: test if state loops are detected in a tricky case A convoluted test case for iterators convergence logic that demonstrates that states with branch count equal to 0 might still be a part of not completely explored loop. E.g. consider the following state diagram: initial Here state 'succ' was processed first, | it was eventually tracked to produce a V state identical to 'hdr'. .---------> hdr All branches from 'succ' had been explored | | and thus 'succ' has its .branches == 0. | V | .------... Suppose states 'cur' and 'succ' correspond | | | to the same instruction + callsites. | V V In such case it is necessary to check | ... ... whether 'succ' and 'cur' are identical. | | | If 'succ' and 'cur' are a part of the same loop | V V they have to be compared exactly. | succ <- cur | | | V | ... | | '----' Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231024000917.12153-7-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 2a0992829ea3864939d917a5c7b48be6629c6217 Author: Eduard Zingerman Date: Tue Oct 24 03:09:15 2023 +0300 bpf: correct loop detection for iterators convergence It turns out that .branches > 0 in is_state_visited() is not a sufficient condition to identify if two verifier states form a loop when iterators convergence is computed. This commit adds logic to distinguish situations like below: (I) initial (II) initial | | V V .---------> hdr .. | | | | V V | .------... .------.. | | | | | | V V V V | ... ... .-> hdr .. | | | | | | | V V | V V | succ <- cur | succ <- cur | | | | | V | V | ... | ... | | | | '----' '----' For both (I) and (II) successor 'succ' of the current state 'cur' was previously explored and has branches count at 0. However, loop entry 'hdr' corresponding to 'succ' might be a part of current DFS path. If that is the case 'succ' and 'cur' are members of the same loop and have to be compared exactly. Co-developed-by: Andrii Nakryiko Co-developed-by: Alexei Starovoitov Reviewed-by: Andrii Nakryiko Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231024000917.12153-6-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 389ede06c2974b2f878a7ebff6b0f4f707f9db74 Author: Eduard Zingerman Date: Tue Oct 24 03:09:14 2023 +0300 selftests/bpf: tests with delayed read/precision makrs in loop body These test cases try to hide read and precision marks from loop convergence logic: marks would only be assigned on subsequent loop iterations or after exploring states pushed to env->head stack first. Without verifier fix to use exact states comparison logic for iterators convergence these tests (except 'triple_continue') would be errorneously marked as safe. Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231024000917.12153-5-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 2793a8b015f7f1caadb9bce9c63dc659f7522676 Author: Eduard Zingerman Date: Tue Oct 24 03:09:13 2023 +0300 bpf: exact states comparison for iterator convergence checks Convergence for open coded iterators is computed in is_state_visited() by examining states with branches count > 1 and using states_equal(). states_equal() computes sub-state relation using read and precision marks. Read and precision marks are propagated from children states, thus are not guaranteed to be complete inside a loop when branches count > 1. This could be demonstrated using the following unsafe program: 1. r7 = -16 2. r6 = bpf_get_prandom_u32() 3. while (bpf_iter_num_next(&fp[-8])) { 4. if (r6 != 42) { 5. r7 = -32 6. r6 = bpf_get_prandom_u32() 7. continue 8. } 9. r0 = r10 10. r0 += r7 11. r8 = *(u64 *)(r0 + 0) 12. r6 = bpf_get_prandom_u32() 13. } Here verifier would first visit path 1-3, create a checkpoint at 3 with r7=-16, continue to 4-7,3 with r7=-32. Because instructions at 9-12 had not been visitied yet existing checkpoint at 3 does not have read or precision mark for r7. Thus states_equal() would return true and verifier would discard current state, thus unsafe memory access at 11 would not be caught. This commit fixes this loophole by introducing exact state comparisons for iterator convergence logic: - registers are compared using regs_exact() regardless of read or precision marks; - stack slots have to have identical type. Unfortunately, this is too strict even for simple programs like below: i = 0; while(iter_next(&it)) i++; At each iteration step i++ would produce a new distinct state and eventually instruction processing limit would be reached. To avoid such behavior speculatively forget (widen) range for imprecise scalar registers, if those registers were not precise at the end of the previous iteration and do not match exactly. This a conservative heuristic that allows to verify wide range of programs, however it precludes verification of programs that conjure an imprecise value on the first loop iteration and use it as precise on the second. Test case iter_task_vma_for_each() presents one of such cases: unsigned int seen = 0; ... bpf_for_each(task_vma, vma, task, 0) { if (seen >= 1000) break; ... seen++; } Here clang generates the following code: : 24: r8 = r6 ; stash current value of ... body ... 'seen' 29: r1 = r10 30: r1 += -0x8 31: call bpf_iter_task_vma_next 32: r6 += 0x1 ; seen++; 33: if r0 == 0x0 goto +0x2 ; exit on next() == NULL 34: r7 += 0x10 35: if r8 < 0x3e7 goto -0xc ; loop on seen < 1000 : ... exit ... Note that counter in r6 is copied to r8 and then incremented, conditional jump is done using r8. Because of this precision mark for r6 lags one state behind of precision mark on r8 and widening logic kicks in. Adding barrier_var(seen) after conditional is sufficient to force clang use the same register for both counting and conditional jump. This issue was discussed in the thread [1] which was started by Andrew Werner demonstrating a similar bug in callback functions handling. The callbacks would be addressed in a followup patch. [1] https://lore.kernel.org/bpf/97a90da09404c65c8e810cf83c94ac703705dc0e.camel@gmail.com/ Co-developed-by: Andrii Nakryiko Co-developed-by: Alexei Starovoitov Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231024000917.12153-4-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 4c97259abc9bc8df7712f76f58ce385581876857 Author: Eduard Zingerman Date: Tue Oct 24 03:09:12 2023 +0300 bpf: extract same_callsites() as utility function Extract same_callsites() from clean_live_states() as a utility function. This function would be used by the next patch in the set. Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231024000917.12153-3-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit 3c4e420cb6536026ddd50eaaff5f30e4f144200d Author: Eduard Zingerman Date: Tue Oct 24 03:09:11 2023 +0300 bpf: move explored_state() closer to the beginning of verifier.c Subsequent patches would make use of explored_state() function. Move it up to avoid adding unnecessary prototype. Signed-off-by: Eduard Zingerman Link: https://lore.kernel.org/r/20231024000917.12153-2-eddyz87@gmail.com Signed-off-by: Alexei Starovoitov commit a558892b3456d44f2a89d238f5d650f0574fa3b2 Author: Yang Li Date: Tue Oct 24 08:43:30 2023 +0800 thunderbolt: Fix one kernel-doc comment Fix a spelling errors in kernel doc comment, silence the warning: drivers/thunderbolt/tb.c:760: warning: expecting prototype for tb_maximum_banwidth(). Prototype was for tb_maximum_bandwidth() instead Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7048 Signed-off-by: Yang Li Signed-off-by: Mika Westerberg commit 65f9e1becb5592c120c9f11adce97f5ca31dce9b Author: Gustavo A. R. Silva Date: Mon Oct 23 21:31:42 2023 -0600 clk: socfpga: agilex: Add bounds-checking coverage for struct stratix10_clock_data In order to gain the bounds-checking coverage that __counted_by provides to flexible-array members at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions), we must make sure that the counter member, in this case `num`, is updated before the first access to the flex-array member, in this case array `hws`. commit f316cdff8d67 ("clk: Annotate struct clk_hw_onecell_data with __counted_by") introduced `__counted_by` for `struct clk_hw_onecell_data` together with changes to relocate some of assignments of counter `num` before `hws` is accessed: include/linux/clk-provider.h: 1380 struct clk_hw_onecell_data { 1381 unsigned int num; 1382 struct clk_hw *hws[] __counted_by(num); 1383 }; However, this structure is used as a member in other structs, in this case in `struct sstratix10_clock_data`: drivers/clk/socfpga/stratix10-clk.h: 9 struct stratix10_clock_data { 10 void __iomem *base; 11 12 /* Must be last */ 13 struct clk_hw_onecell_data clk_data; 14 }; Hence, we need to move the assignments to `clk_data->clk_data.num` after allocations for `struct stratix10_clock_data` and before accessing the flexible array `clk_data->clk_data.hws`. And, as assignments for both `clk_data->clk_data.num` and `clk_data->base` are originally adjacent to each other, relocate both assignments together. Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/385c516c498e07eb9a521107e16a7efd26e86ea5.1698117815.git.gustavoars@kernel.org Signed-off-by: Stephen Boyd commit d761bb01c85b22d5b44abe283eb89019693f6595 Author: Gustavo A. R. Silva Date: Mon Oct 23 21:30:52 2023 -0600 clk: socfpga: Fix undefined behavior bug in struct stratix10_clock_data `struct clk_hw_onecell_data` is a flexible structure, which means that it contains flexible-array member at the bottom, in this case array `hws`: include/linux/clk-provider.h: 1380 struct clk_hw_onecell_data { 1381 unsigned int num; 1382 struct clk_hw *hws[] __counted_by(num); 1383 }; This could potentially lead to an overwrite of the objects following `clk_data` in `struct stratix10_clock_data`, in this case `void __iomem *base;` at run-time: drivers/clk/socfpga/stratix10-clk.h: 9 struct stratix10_clock_data { 10 struct clk_hw_onecell_data clk_data; 11 void __iomem *base; 12 }; There are currently three different places where memory is allocated for `struct stratix10_clock_data`, including the flex-array `hws` in `struct clk_hw_onecell_data`: drivers/clk/socfpga/clk-agilex.c: 469 clk_data = devm_kzalloc(dev, struct_size(clk_data, clk_data.hws, 470 num_clks), GFP_KERNEL); drivers/clk/socfpga/clk-agilex.c: 509 clk_data = devm_kzalloc(dev, struct_size(clk_data, clk_data.hws, 510 num_clks), GFP_KERNEL); drivers/clk/socfpga/clk-s10.c: 400 clk_data = devm_kzalloc(dev, struct_size(clk_data, clk_data.hws, 401 num_clks), GFP_KERNEL); I'll use just one of them to describe the issue. See below. Notice that a total of 440 bytes are allocated for flexible-array member `hws` at line 469: include/dt-bindings/clock/agilex-clock.h: 70 #define AGILEX_NUM_CLKS 55 drivers/clk/socfpga/clk-agilex.c: 459 struct stratix10_clock_data *clk_data; 460 void __iomem *base; ... 466 467 num_clks = AGILEX_NUM_CLKS; 468 469 clk_data = devm_kzalloc(dev, struct_size(clk_data, clk_data.hws, 470 num_clks), GFP_KERNEL); `struct_size(clk_data, clk_data.hws, num_clks)` above translates to sizeof(struct stratix10_clock_data) + sizeof(struct clk_hw *) * 55 == 16 + 8 * 55 == 16 + 440 ^^^ | allocated bytes for flex-array `hws` 474 for (i = 0; i < num_clks; i++) 475 clk_data->clk_data.hws[i] = ERR_PTR(-ENOENT); 476 477 clk_data->base = base; and then some data is written into both `hws` and `base` objects. Fix this by placing the declaration of object `clk_data` at the end of `struct stratix10_clock_data`. Also, add a comment to make it clear that this object must always be last in the structure. -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting ready to enable it globally. Fixes: ba7e258425ac ("clk: socfpga: Convert to s10/agilex/n5x to use clk_hw") Cc: stable@vger.kernel.org Reviewed-by: Kees Cook Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/1da736106d8e0806aeafa6e471a13ced490eae22.1698117815.git.gustavoars@kernel.org Signed-off-by: Stephen Boyd commit c8e1d8ae6aba7521d96d5cde21384edde1f06d3d Author: Samuel Holland Date: Mon Jul 24 17:42:48 2023 -0700 clk: sifive: Allow building the driver as a module This can reduce the kernel image size in multiplatform configurations. Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20230725004248.381868-2-samuel.holland@sifive.com Signed-off-by: Stephen Boyd commit ee58d6a115cefd7e8065eb469788dafa00b999d1 Author: Samuel Holland Date: Mon Jul 24 17:42:47 2023 -0700 clk: analogbits: Allow building the library as a module This library is only used by the SiFive PRCI driver. When that driver is built as a module, it makes sense to build this library as a module too. Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20230725004248.381868-1-samuel.holland@sifive.com Signed-off-by: Stephen Boyd commit 48a8748fd0d18b07741f311cd6929982490c5903 Author: Zhifeng Tang Date: Wed Sep 13 19:52:11 2023 +0800 clk: sprd: Composite driver support offset config The composite interface support the offset configuration, which is used to support mux and div in different registers. Because some sprd projects, the divider has different addresses from mux for one composite clk. Signed-off-by: Zhifeng Tang Reviewed-by: Chunyan Zhang Link: https://lore.kernel.org/r/20230913115211.11512-1-zhifeng.tang@unisoc.com Signed-off-by: Stephen Boyd commit e43d31915cc4fca4e04daeca6c0ff25cc57cf956 Author: John Keeping Date: Thu Apr 20 11:38:04 2023 +0100 clk: Allow phase adjustment from debugfs For testing it may be useful to manually adjust a clock's phase. Add support for writing to the existing clk_phase debugfs file, with the written value clamped to [0, 360) to match the behaviour of the clk_set_phase() function. This is a dangerous feature, so use the existing define CLOCK_ALLOW_WRITE_DEBUGFS to allow it only if the source is modified. Signed-off-by: John Keeping Link: https://lore.kernel.org/r/20230420103805.125246-1-john@metanate.com Signed-off-by: Stephen Boyd commit dcce5cc7826e9c6b3a2443e5e6b7f8d02a103c35 Author: Vishal Badole Date: Sun Nov 27 22:53:19 2022 +0530 clk: Show active consumers of clocks in debugfs This feature lists the clock consumer's name and respective connection id. Using this feature user can easily check that which user has acquired and enabled a particular clock. Usage: >> cat /sys/kernel/debug/clk/clk_summary enable prepare protect duty hardware Connection clock count count count rate accuracy phase cycle enable consumer Id ------------------------------------------------------------------------------------------------------------------------------ clk_mcasp0_fixed 0 0 0 24576000 0 0 50000 Y deviceless of_clk_get_from_provider deviceless no_connection_id clk_mcasp0 0 0 0 24576000 0 0 50000 N simple-audio-card,cpu no_connection_id deviceless no_connection_id Co-developed-by: Chinmoy Ghosh Signed-off-by: Chinmoy Ghosh Co-developed-by: Mintu Patel Signed-off-by: Mintu Patel Co-developed-by: Vimal Kumar Signed-off-by: Vimal Kumar Signed-off-by: Vishal Badole Link: https://lore.kernel.org/r/1669569799-8526-1-git-send-email-badolevishal1116@gmail.com Signed-off-by: Stephen Boyd commit 409c39ec92a35e3708f5b5798c78eae78512cd71 Author: Rob Herring Date: Fri Oct 6 16:39:58 2023 -0500 clk: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006213959.334439-1-robh@kernel.org Reviewed-by: Dmitry Baryshkov #msm part Acked-by: Krzysztof Kozlowski # Samsung Acked-by: David Lechner Acked-by: Chanwoo Choi Acked-by: Charles Keepax Reviewed-by: Bjorn Andersson Signed-off-by: Stephen Boyd commit 397d887c1601a71e8a8abdb6beea67d58f0472d3 Author: Gustavo A. R. Silva Date: Mon Oct 16 16:06:16 2023 -0600 clk: visconti: Add bounds-checking coverage for struct visconti_pll_provider In order to gain the bounds-checking coverage that __counted_by provides to flexible-array members at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions), we must make sure that the counter member, in this particular case `num`, is updated before the first access to the flex-array member, in this particular case array `hws`. See below: commit f316cdff8d67 ("clk: Annotate struct clk_hw_onecell_data with __counted_by") introduced `__counted_by` for `struct clk_hw_onecell_data` together with changes to relocate some of assignments of counter `num` before `hws` is accessed: include/linux/clk-provider.h: 1380 struct clk_hw_onecell_data { 1381 unsigned int num; 1382 struct clk_hw *hws[] __counted_by(num); 1383 }; However, this structure is used as a member in other structs, in this case in `struct visconti_pll_provider`: drivers/clk/visconti/pll.h: 16 struct visconti_pll_provider { 17 void __iomem *reg_base; 18 struct device_node *node; 19 20 /* Must be last */ 21 struct clk_hw_onecell_data clk_data; 22 }; Hence, we need to move the assignments to `ctx->clk_data.num` after allocation for `struct visconti_pll_provider` and before accessing the flexible array `ctx->clk_data.hws`. And, as assignments for all members in `struct visconti_pll_provider` are originally adjacent to each other, relocate all assignments together, so we don't split up `ctx->clk_data.hws = nr_plls` from the rest. :) Reviewed-by: Kees Cook Acked-by: Nobuhiro Iwamatsu Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/e3189f3e40e8723b6d794fb2260e2e9ab6b960bd.1697492890.git.gustavoars@kernel.org Signed-off-by: Stephen Boyd commit 5ad1e217a2b23aa046b241183bd9452d259d70d0 Author: Gustavo A. R. Silva Date: Mon Oct 16 16:05:27 2023 -0600 clk: visconti: Fix undefined behavior bug in struct visconti_pll_provider `struct clk_hw_onecell_data` is a flexible structure, which means that it contains flexible-array member at the bottom, in this case array `hws`: include/linux/clk-provider.h: 1380 struct clk_hw_onecell_data { 1381 unsigned int num; 1382 struct clk_hw *hws[] __counted_by(num); 1383 }; This could potentially lead to an overwrite of the objects following `clk_data` in `struct visconti_pll_provider`, in this case `struct device_node *node;`, at run-time: drivers/clk/visconti/pll.h: 16 struct visconti_pll_provider { 17 void __iomem *reg_base; 18 struct clk_hw_onecell_data clk_data; 19 struct device_node *node; 20 }; Notice that a total of 56 bytes are allocated for flexible-array `hws` at line 328. See below: include/dt-bindings/clock/toshiba,tmpv770x.h: 14 #define TMPV770X_NR_PLL 7 drivers/clk/visconti/pll-tmpv770x.c: 69 ctx = visconti_init_pll(np, reg_base, TMPV770X_NR_PLL); drivers/clk/visconti/pll.c: 321 struct visconti_pll_provider * __init visconti_init_pll(struct device_node *np, 322 void __iomem *base, 323 unsigned long nr_plls) 324 { 325 struct visconti_pll_provider *ctx; ... 328 ctx = kzalloc(struct_size(ctx, clk_data.hws, nr_plls), GFP_KERNEL); `struct_size(ctx, clk_data.hws, nr_plls)` above translates to sizeof(struct visconti_pll_provider) + sizeof(struct clk_hw *) * 7 == 24 + 8 * 7 == 24 + 56 ^^^^ | allocated bytes for flex array `hws` $ pahole -C visconti_pll_provider drivers/clk/visconti/pll.o struct visconti_pll_provider { void * reg_base; /* 0 8 */ struct clk_hw_onecell_data clk_data; /* 8 8 */ struct device_node * node; /* 16 8 */ /* size: 24, cachelines: 1, members: 3 */ /* last cacheline: 24 bytes */ }; And then, after the allocation, some data is written into all members of `struct visconti_pll_provider`: 332 for (i = 0; i < nr_plls; ++i) 333 ctx->clk_data.hws[i] = ERR_PTR(-ENOENT); 334 335 ctx->node = np; 336 ctx->reg_base = base; 337 ctx->clk_data.num = nr_plls; Fix all these by placing the declaration of object `clk_data` at the end of `struct visconti_pll_provider`. Also, add a comment to make it clear that this object must always be last in the structure, and prevent this bug from being introduced again in the future. -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting ready to enable it globally. Fixes: b4cbe606dc36 ("clk: visconti: Add support common clock driver and reset driver") Cc: stable@vger.kernel.org Reviewed-by: Kees Cook Acked-by: Nobuhiro Iwamatsu Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/57a831d94ee2b3889b11525d4ad500356f89576f.1697492890.git.gustavoars@kernel.org Signed-off-by: Stephen Boyd commit faf6b92ee0091ff7a7bba03a1726a1a97112e9db Author: Biju Das Date: Sat Sep 9 16:05:16 2023 +0100 clk: cdce925: Extend match support for OF tables The driver has an OF match table, still, it uses an ID lookup table for retrieving match data. Currently, the driver is working on the assumption that an I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using i2c_get_match_data() if the devices are registered via OF/ID. Unify the OF/ID table by using struct clk_cdce925_chip_info as match data for both these tables and replace the ID lookup table for the match data by i2c_get_match_data(). Split the array clk_cdce925_chip_info_tbl[] as individual variables, and make lines shorter by referring to e.g. &clk_cdce913_info instead of &clk_cdce925_chip_info_tbl[CDCE913]. Drop enum related to chip type as there is no user. While at it, remove the trailing comma in the terminator entry for the OF table making code robust against (theoretical) misrebases or other similar things where the new entry goes _after_ the termination without the compiler noticing. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230909150516.10353-1-biju.das.jz@bp.renesas.com Signed-off-by: Stephen Boyd commit 15f5e2e4225a94fe76302e87ecdf95e56e571382 Author: Biju Das Date: Sat Sep 9 17:47:38 2023 +0100 clk: si570: Simplify probe The driver has an OF match table, still, it uses an ID lookup table for retrieving match data. Currently, the driver is working on the assumption that an I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using i2c_get_match_data() if the devices are registered via OF/ID. Unify the OF/ID table by adding struct clk_si570_info as match data instead of clk_si570_variant and replace the ID lookup table for the match data by i2c_get_match_data(). This allows to simplify probe(). Drop enum clk_si570_variant as there is no user. While at it, remove the trailing comma in the terminator entry for the OF table making code robust against (theoretical) misrebases or other similar things where the new entry goes _after_ the termination without the compiler noticing. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230909164738.47708-1-biju.das.jz@bp.renesas.com Signed-off-by: Stephen Boyd commit f234f028727f8634973f8a9ef2ec933eb0eade5b Author: Biju Das Date: Sat Sep 9 17:20:47 2023 +0100 clk: si5351: Simplify probe The driver has an OF match table, still, it uses an ID lookup table for retrieving match data. Currently, the driver is working on the assumption that an I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using i2c_get_match_data() if the devices are registered via OF/ID. Simplify probe() by replacing ID lookup table for retrieving match data with i2c_get_match_data(). Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230909162047.41845-1-biju.das.jz@bp.renesas.com Signed-off-by: Stephen Boyd commit 38a929ab128d7f0ac61f7cb506e6687d145b9eba Author: Biju Das Date: Sat Sep 9 17:02:18 2023 +0100 clk: rs9: Use i2c_get_match_data() instead of device_get_match_data() The device_get_match_data(), is to get match data for firmware interfaces such as just OF/ACPI. This driver has I2C matching table as well. Use i2c_get_match_data() to get match data for I2C, ACPI and DT-based matching. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230909160218.33078-1-biju.das.jz@bp.renesas.com Signed-off-by: Stephen Boyd commit b28f95c61965fd31ca15556e7ac65dfc84a15fad Author: Biju Das Date: Sat Sep 9 16:54:18 2023 +0100 clk: clk-si544: Simplify probe() and is_valid_frequency() The driver has an OF match table, still, it uses an ID lookup table for retrieving match data. Currently, the driver is working on the assumption that an I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using i2c_get_match_data() if the devices are registered via OF/ID. Unify the OF/ID table by using max_freq as match data instead of enum si544_speed_grade and replace the ID lookup table for the match data by i2c_get_match_data(). This allows to simplify both probe() and is_valid_frequency(). Drop enum si544_speed_grade as there is no user. While at it, remove the trailing comma in the terminator entry for the OF table making code robust against (theoretical) misrebases or other similar things where the new entry goes _after_ the termination without the compiler noticing. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230909155418.24426-1-biju.das.jz@bp.renesas.com Signed-off-by: Stephen Boyd commit ebcae17f87b34f71e8e55512226c4da35a9e3233 Author: Biju Das Date: Sat Sep 9 16:28:47 2023 +0100 clk: si521xx: Use i2c_get_match_data() instead of device_get_match_data() The device_get_match_data(), is to get match data for firmware interfaces such as just OF/ACPI. This driver has I2C matching table as well. Use i2c_get_match_data() to get match data for I2C, ACPI and DT-based matching. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230909152847.16216-1-biju.das.jz@bp.renesas.com Signed-off-by: Stephen Boyd commit efb3e0e1649f944c032095e3f0533a235a7477d3 Merge: f4dbc2bb7a54d 2d0de67da51a9 Author: Jakub Kicinski Date: Mon Oct 23 19:14:51 2023 -0700 Merge branch 'introduce-page_pool_alloc-related-api' Yunsheng Lin says: ==================== introduce page_pool_alloc() related API In [1] & [2] & [3], there are usecases for veth and virtio_net to use frag support in page pool to reduce memory usage, and it may request different frag size depending on the head/tail room space for xdp_frame/shinfo and mtu/packet size. When the requested frag size is large enough that a single page can not be split into more than one frag, using frag support only have performance penalty because of the extra frag count handling for frag support. So this patchset provides a page pool API for the driver to allocate memory with least memory utilization and performance penalty when it doesn't know the size of memory it need beforehand. 1. https://patchwork.kernel.org/project/netdevbpf/patch/d3ae6bd3537fbce379382ac6a42f67e22f27ece2.1683896626.git.lorenzo@kernel.org/ 2. https://patchwork.kernel.org/project/netdevbpf/patch/20230526054621.18371-3-liangchen.linux@gmail.com/ 3. https://github.com/alobakin/linux/tree/iavf-pp-frag ==================== Link: https://lore.kernel.org/r/20231020095952.11055-1-linyunsheng@huawei.com Signed-off-by: Jakub Kicinski commit 2d0de67da51a90c6acf7bf08d7b0501f45408002 Author: Yunsheng Lin Date: Fri Oct 20 17:59:52 2023 +0800 net: veth: use newly added page pool API for veth with xdp Use page_pool_alloc() API to allocate memory with least memory utilization and performance penalty. Signed-off-by: Yunsheng Lin CC: Lorenzo Bianconi CC: Alexander Duyck CC: Liang Chen CC: Alexander Lobakin Link: https://lore.kernel.org/r/20231020095952.11055-6-linyunsheng@huawei.com Signed-off-by: Jakub Kicinski commit 8ab32fa1c7947f4807b1d98af2d411a2587bb841 Author: Yunsheng Lin Date: Fri Oct 20 17:59:51 2023 +0800 page_pool: update document about fragment API As more drivers begin to use the fragment API, update the document about how to decide which API to use for the driver author. Signed-off-by: Yunsheng Lin CC: Lorenzo Bianconi CC: Alexander Duyck CC: Liang Chen CC: Alexander Lobakin CC: Dima Tisnek Link: https://lore.kernel.org/r/20231020095952.11055-5-linyunsheng@huawei.com Signed-off-by: Jakub Kicinski commit de97502e16fc406a74edee8359612e518986cf59 Author: Yunsheng Lin Date: Fri Oct 20 17:59:50 2023 +0800 page_pool: introduce page_pool_alloc() API Currently page pool supports the below use cases: use case 1: allocate page without page splitting using page_pool_alloc_pages() API if the driver knows that the memory it need is always bigger than half of the page allocated from page pool. use case 2: allocate page frag with page splitting using page_pool_alloc_frag() API if the driver knows that the memory it need is always smaller than or equal to the half of the page allocated from page pool. There is emerging use case [1] & [2] that is a mix of the above two case: the driver doesn't know the size of memory it need beforehand, so the driver may use something like below to allocate memory with least memory utilization and performance penalty: if (size << 1 > max_size) page = page_pool_alloc_pages(); else page = page_pool_alloc_frag(); To avoid the driver doing something like above, add the page_pool_alloc() API to support the above use case, and update the true size of memory that is acctually allocated by updating '*size' back to the driver in order to avoid exacerbating truesize underestimate problem. Rename page_pool_free() which is used in the destroy process to __page_pool_destroy() to avoid confusion with the newly added API. 1. https://lore.kernel.org/all/d3ae6bd3537fbce379382ac6a42f67e22f27ece2.1683896626.git.lorenzo@kernel.org/ 2. https://lore.kernel.org/all/20230526054621.18371-3-liangchen.linux@gmail.com/ Signed-off-by: Yunsheng Lin CC: Lorenzo Bianconi CC: Alexander Duyck CC: Liang Chen CC: Alexander Lobakin Link: https://lore.kernel.org/r/20231020095952.11055-4-linyunsheng@huawei.com Signed-off-by: Jakub Kicinski commit 09d96ee5674a0eaa800c664353756ecc45c4a87f Author: Yunsheng Lin Date: Fri Oct 20 17:59:49 2023 +0800 page_pool: remove PP_FLAG_PAGE_FRAG PP_FLAG_PAGE_FRAG is not really needed after pp_frag_count handling is unified and page_pool_alloc_frag() is supported in 32-bit arch with 64-bit DMA, so remove it. Signed-off-by: Yunsheng Lin CC: Lorenzo Bianconi CC: Alexander Duyck CC: Liang Chen CC: Alexander Lobakin Link: https://lore.kernel.org/r/20231020095952.11055-3-linyunsheng@huawei.com Signed-off-by: Jakub Kicinski commit 58d53d8f7da63dd13903bec0a40b3009a841b61b Author: Yunsheng Lin Date: Fri Oct 20 17:59:48 2023 +0800 page_pool: unify frag_count handling in page_pool_is_last_frag() Currently when page_pool_create() is called with PP_FLAG_PAGE_FRAG flag, page_pool_alloc_pages() is only allowed to be called under the below constraints: 1. page_pool_fragment_page() need to be called to setup page->pp_frag_count immediately. 2. page_pool_defrag_page() often need to be called to drain the page->pp_frag_count when there is no more user will be holding on to that page. Those constraints exist in order to support a page to be split into multi fragments. And those constraints have some overhead because of the cache line dirtying/bouncing and atomic update. Those constraints are unavoidable for case when we need a page to be split into more than one fragment, but there is also case that we want to avoid the above constraints and their overhead when a page can't be split as it can only hold a fragment as requested by user, depending on different use cases: use case 1: allocate page without page splitting. use case 2: allocate page with page splitting. use case 3: allocate page with or without page splitting depending on the fragment size. Currently page pool only provide page_pool_alloc_pages() and page_pool_alloc_frag() API to enable the 1 & 2 separately, so we can not use a combination of 1 & 2 to enable 3, it is not possible yet because of the per page_pool flag PP_FLAG_PAGE_FRAG. So in order to allow allocating unsplit page without the overhead of split page while still allow allocating split page we need to remove the per page_pool flag in page_pool_is_last_frag(), as best as I can think of, it seems there are two methods as below: 1. Add per page flag/bit to indicate a page is split or not, which means we might need to update that flag/bit everytime the page is recycled, dirtying the cache line of 'struct page' for use case 1. 2. Unify the page->pp_frag_count handling for both split and unsplit page by assuming all pages in the page pool is split into a big fragment initially. As page pool already supports use case 1 without dirtying the cache line of 'struct page' whenever a page is recyclable, we need to support the above use case 3 with minimal overhead, especially not adding any noticeable overhead for use case 1, and we are already doing an optimization by not updating pp_frag_count in page_pool_defrag_page() for the last fragment user, this patch chooses to unify the pp_frag_count handling to support the above use case 3. There is no noticeable performance degradation and some justification for unifying the frag_count handling with this patch applied using a micro-benchmark testing in [1]. 1. https://lore.kernel.org/all/bf2591f8-7b3c-4480-bb2c-31dc9da1d6ac@huawei.com/ Signed-off-by: Yunsheng Lin CC: Lorenzo Bianconi CC: Alexander Duyck CC: Liang Chen CC: Alexander Lobakin Link: https://lore.kernel.org/r/20231020095952.11055-2-linyunsheng@huawei.com Signed-off-by: Jakub Kicinski commit 11ae5eb516b656e8a0e4efbea90ea24c152a346d Merge: 3f5ba636d6987 06ab64a0d836a Author: Dave Airlie Date: Tue Oct 24 11:13:24 2023 +1000 Merge tag 'topic/vmemdup-user-array-2023-10-24-1' of git://anongit.freedesktop.org/drm/drm into drm-next vmemdup-user-array API and changes with it. This is just a process PR to merge the topic branch into drm-next, this contains some core kernel and drm changes. Signed-off-by: Dave Airlie From: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20231024010905.646830-1-airlied@redhat.com commit 4758560fa268cecfa1144f015aa9f2525d164b7e Author: wuqiang.matt Date: Mon Oct 23 19:22:45 2023 +0800 kprobes: unused header files removed As kernel test robot reported, lib/test_objpool.c (trace:probes/for-next) has linux/version.h included, but version.h is not used at all. Then more unused headers are found in test_objpool.c and rethook.c, and all of them should be removed. Link: https://lore.kernel.org/all/20231023112245.6112-1-wuqiang.matt@bytedance.com/ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310191512.vvypKU5Z-lkp@intel.com/ Signed-off-by: wuqiang.matt Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit 03acb9ccec3f8cbcc0ed93c188b7a119ef30ef64 Author: YueHaibing Date: Sat Jul 29 10:40:26 2023 +0800 keys: Remove unused extern declarations Since commit b2a4df200d57 ("KEYS: Expand the capacity of a keyring") iterate_over_keyring() is never used, so can be removed. And commit b5f545c880a2 ("[PATCH] keys: Permit running process to instantiate keys") left behind keyring_search_instkey(). Fixes: b2a4df200d57 ("KEYS: Expand the capacity of a keyring") Fixes: b5f545c880a2 ("[PATCH] keys: Permit running process to instantiate keys") Signed-off-by: YueHaibing Reviewed-by: Paul Moore Signed-off-by: Jarkko Sakkinen commit 3edc22655647378dea01900f7b04e017ff96bda9 Author: Michal Suchanek Date: Thu Sep 7 18:52:19 2023 +0200 integrity: powerpc: Do not select CA_MACHINE_KEYRING No other platform needs CA_MACHINE_KEYRING, either. This is policy that should be decided by the administrator, not Kconfig dependencies. Cc: stable@vger.kernel.org # v6.6+ Fixes: d7d91c4743c4 ("integrity: PowerVM machine keyring enablement") Signed-off-by: Michal Suchanek Signed-off-by: Jarkko Sakkinen commit c745cd1718b7825d69315fe7127e2e289e617598 Author: Sumit Garg Date: Tue Aug 22 16:59:33 2023 +0530 KEYS: trusted: tee: Refactor register SHM usage The OP-TEE driver using the old SMC based ABI permits overlapping shared buffers, but with the new FF-A based ABI each physical page may only be registered once. As the key and blob buffer are allocated adjancently, there is no need for redundant register shared memory invocation. Also, it is incompatibile with FF-A based ABI limitation. So refactor register shared memory implementation to use only single invocation to register both key and blob buffers. [jarkko: Added cc to stable.] Cc: stable@vger.kernel.org # v5.16+ Fixes: 4615e5a34b95 ("optee: add FF-A support") Reported-by: Jens Wiklander Signed-off-by: Sumit Garg Tested-by: Jens Wiklander Reviewed-by: Jens Wiklander Signed-off-by: Jarkko Sakkinen commit 31de287345f41bbfaec36a5c8cbdba035cf76442 Author: Jarkko Sakkinen Date: Wed Oct 11 02:08:25 2023 +0300 KEYS: trusted: Rollback init_trusted() consistently Do bind neither static calls nor trusted_key_exit() before a successful init, in order to maintain a consistent state. In addition, depart the init_trusted() in the case of a real error (i.e. getting back something else than -ENODEV). Reported-by: Linus Torvalds Closes: https://lore.kernel.org/linux-integrity/CAHk-=whOPoLaWM8S8GgoOPT7a2+nMH5h3TLKtn=R_3w4R1_Uvg@mail.gmail.com/ Cc: stable@vger.kernel.org # v5.13+ Fixes: 5d0682be3189 ("KEYS: trusted: Add generic trusted keys framework") Signed-off-by: Jarkko Sakkinen commit b79a08af323494c8f144b5b790fa53017a63515e Merge: 90cf94edaad91 98408df6ad1fa Author: Stephen Boyd Date: Mon Oct 23 16:58:46 2023 -0700 Merge tag 'clk-meson-v6.7-2' of https://github.com/BayLibre/clk-meson into clk-amlogic Pull another amlogic clk driver update from Jerome Brunet: - Fix missing dependency for s4 clock controllers * tag 'clk-meson-v6.7-2' of https://github.com/BayLibre/clk-meson: clk: meson: S4: select CONFIG_COMMON_CLK_MESON_CLKC_UTILS commit f4dbc2bb7a54d3bff234a9f1915f1b7187bedb1f Merge: 4fb56e3e92bca 530886897c789 Author: Jakub Kicinski Date: Mon Oct 23 16:44:18 2023 -0700 Merge tag 'for-net-next-2023-10-23' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next Luiz Augusto von Dentz says: ==================== bluetooth-next pull request for net-next: - Add 0bda:b85b for Fn-Link RTL8852BE - ISO: Many fixes for broadcast support - Mark bcm4378/bcm4387 as BROKEN_LE_CODED - Add support ITTIM PE50-M75C - Add RTW8852BE device 13d3:3570 - Add support for QCA2066 - Add support for Intel Misty Peak - 8087:0038 * tag 'for-net-next-2023-10-23' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next: Bluetooth: hci_sync: Fix Opcode prints in bt_dev_dbg/err Bluetooth: Fix double free in hci_conn_cleanup Bluetooth: btmtksdio: enable bluetooth wakeup in system suspend Bluetooth: btusb: Add 0bda:b85b for Fn-Link RTL8852BE Bluetooth: hci_bcm4377: Mark bcm4378/bcm4387 as BROKEN_LE_CODED Bluetooth: ISO: Copy BASE if service data matches EIR_BAA_SERVICE_UUID Bluetooth: Make handle of hci_conn be unique Bluetooth: btusb: Add date->evt_skb is NULL check Bluetooth: ISO: Fix bcast listener cleanup Bluetooth: msft: __hci_cmd_sync() doesn't return NULL Bluetooth: ISO: Match QoS adv handle with BIG handle Bluetooth: ISO: Allow binding a bcast listener to 0 bises Bluetooth: btusb: Add RTW8852BE device 13d3:3570 to device tables Bluetooth: qca: add support for QCA2066 Bluetooth: ISO: Set CIS bit only for devices with CIS support Bluetooth: Add support for Intel Misty Peak - 8087:0038 Bluetooth: Add support ITTIM PE50-M75C Bluetooth: ISO: Pass BIG encryption info through QoS Bluetooth: ISO: Fix BIS cleanup ==================== Link: https://lore.kernel.org/r/20231023182119.3629194-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit 4fb56e3e92bcac98625ebb85bd931785e7779cec Merge: 70b1aca365cbb cebe7306073d4 Author: Jakub Kicinski Date: Mon Oct 23 16:16:52 2023 -0700 Merge branch 'devlink-finish-conversion-to-generated-split_ops' Jiri Pirko says: ==================== devlink: finish conversion to generated split_ops This patchset converts the remaining genetlink commands to generated split_ops and removes the existing small_ops arrays entirely alongside with shared netlink attribute policy. Patches #1-#6 are just small preparations and small fixes on multiple places. Note that couple of patches contain the "Fixes" tag but no need to put them into -net tree. Patch #7 is a simple rename preparation Patch #8 is the main one in this set and adds actual definitions of cmds in to yaml file. Patches #9-#10 finalize the change removing bits that are no longer in use. ==================== Link: https://lore.kernel.org/r/20231021112711.660606-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit cebe7306073d4afeb24886f9063417e559fa2e22 Author: Jiri Pirko Date: Sat Oct 21 13:27:11 2023 +0200 devlink: remove netlink small_ops All commands are now covered by generated split_ops. Remove the small_ops entirely alongside with unified devlink netlink policy array. Signed-off-by: Jiri Pirko Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231021112711.660606-11-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 15c80e7a53d28aeb7354ef6d79d0ff55452e53f1 Author: Jiri Pirko Date: Sat Oct 21 13:27:10 2023 +0200 devlink: remove duplicated netlink callback prototypes The prototypes are now generated, remove the old ones. Signed-off-by: Jiri Pirko Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231021112711.660606-10-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit f2f9dd164db079161a834c8698c68a94a50b4168 Author: Jiri Pirko Date: Sat Oct 21 13:27:09 2023 +0200 netlink: specs: devlink: add the remaining command to generate complete split_ops Currently, some of the commands are not described in devlink yaml file and are manually filled in net/devlink/netlink.c in small_ops. To make all part of split_ops, add definitions of the rest of the commands alongside with needed attributes and enums. Note that this focuses on the kernel side. The requests are fully described in order to generate split_op alongside with policies. Follow-up will describe the replies in order to make the userspace helpers complete. Signed-off-by: Jiri Pirko Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231021112711.660606-9-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 53590934ba9549c55c57a32e2a6980139af00345 Author: Jiri Pirko Date: Sat Oct 21 13:27:08 2023 +0200 devlink: rename netlink callback to be aligned with the generated ones All remaining doit and dumpit netlink callback functions are going to be used by generated split ops. They expect certain name format. Rename the callback to be aligned with generated names. Signed-off-by: Jiri Pirko Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231021112711.660606-8-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit e3570f040836b2f6332ce5cb4db0fd070448aeb5 Author: Jiri Pirko Date: Sat Oct 21 13:27:07 2023 +0200 devlink: make devlink_flash_overwrite enum named one Since this enum is going to be used in generated userspace file, name it properly. Signed-off-by: Jiri Pirko Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231021112711.660606-7-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 6cc8ad97c101912e02733d807bc5273ce6d938bd Author: Jiri Pirko Date: Sat Oct 21 13:27:06 2023 +0200 netlink: specs: devlink: make dont-validate single line Make dont-validate field more compact and push it into a single line. Reviewed-by: Jakub Kicinski Signed-off-by: Jiri Pirko Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231021112711.660606-6-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit c48066b0cc2c02d2193a710c823e7d6f41d2ea85 Author: Jiri Pirko Date: Sat Oct 21 13:27:05 2023 +0200 netlink: specs: devlink: remove reload-action from devlink-get cmd reply devlink-get command does not contain reload-action attr in reply. Remove it. Signed-off-by: Jiri Pirko Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231021112711.660606-5-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 2260d39cd01aff3b5791db25810e40fe03ae71bf Author: Jiri Pirko Date: Sat Oct 21 13:27:04 2023 +0200 tools: ynl-gen: render rsp_parse() helpers if cmd has only dump op Due to the check in RenderInfo class constructor, type_consistent flag is set to False to avoid rendering the same response parsing helper for do and dump ops. However, in case there is no do, the helper needs to be rendered for dump op. So split check to achieve that. Signed-off-by: Jiri Pirko Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231021112711.660606-4-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 4e2846fd6684227c8f8129ec184fbf090279216d Author: Jiri Pirko Date: Sat Oct 21 13:27:03 2023 +0200 tools: ynl-gen: introduce support for bitfield32 attribute type Introduce support for attribute type bitfield32. Note that since the generated code works with struct nla_bitfield32, the generator adds netlink.h to the list of includes for userspace headers in case any bitfield32 is present. Note that this is added only to genetlink-legacy scheme as requested by Jakub Kicinski. Signed-off-by: Jiri Pirko Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231021112711.660606-3-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit f862ed2d0bf0cf51c28c1a69e3c2a1558d5a2978 Author: Jiri Pirko Date: Sat Oct 21 13:27:02 2023 +0200 genetlink: don't merge dumpit split op for different cmds into single iter Currently, split ops of doit and dumpit are merged into a single iter item when they are subsequent. However, there is no guarantee that the dumpit op is for the same cmd as doit op. Fix this by checking if cmd is the same for both. This problem does not occur in existing families. Signed-off-by: Jiri Pirko Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231021112711.660606-2-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 70b1aca365cbbbc7c4570463306c77ed1776bc3d Merge: 81a4169856987 46d913d4800e5 Author: Jakub Kicinski Date: Mon Oct 23 15:55:33 2023 -0700 Merge branch 'intel-wired-lan-driver-updates-2023-10-19-idpf' Jacob Keller says: ==================== Intel Wired LAN Driver Updates 2023-10-19 (idpf) This series contains two fixes for the recently merged idpf driver. Michal adds missing logic for programming the scheduling mode of completion queues. Pavan fixes a call trace caused by the mailbox work item not being canceled properly if an error occurred during initialization. ==================== Link: https://lore.kernel.org/r/20231023202655.173369-1-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 46d913d4800e5b02fa20683785d873404f1667c4 Author: Pavan Kumar Linga Date: Mon Oct 23 13:26:55 2023 -0700 idpf: cancel mailbox work in error path In idpf_vc_core_init, the mailbox work is queued on a mailbox workqueue but it is not cancelled on error. This results in a call trace when idpf_mbx_task tries to access the freed mailbox queue pointer. Fix it by cancelling the mailbox work in the error path. Fixes: 4930fbf419a7 ("idpf: add core init and interrupt request") Reviewed-by: Wojciech Drewek Signed-off-by: Pavan Kumar Linga Tested-by: Krishneil Singh Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231023202655.173369-3-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit d38b4d0d95bc0c7243ca54a32c256c0583b6a9fc Author: Michal Kubiak Date: Mon Oct 23 13:26:54 2023 -0700 idpf: set scheduling mode for completion queue The HW must be programmed differently for queue-based scheduling mode. To program the completion queue context correctly, the control plane must know the scheduling mode not only for the Tx queue, but also for the completion queue. Unfortunately, currently the driver sets the scheduling mode only for the Tx queues. Propagate the scheduling mode data for the completion queue as well when sending the queue configuration messages. Fixes: 1c325aac10a8 ("idpf: configure resources for TX queues") Reviewed-by: Alexander Lobakin Signed-off-by: Michal Kubiak Reviewed-by: Alan Brady Reviewed-by: Przemek Kitszel Tested-by: Krishneil Singh Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231023202655.173369-2-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 81a4169856987b65918a93e9b9f53a28496575cf Author: Eric Dumazet Date: Fri Oct 20 20:12:54 2023 +0000 net_sched: sch_fq: fastpath needs to take care of sk->sk_pacing_status If packets of a TCP flows take the fast path, we need to make sure sk->sk_pacing_status is set to SK_PACING_FQ otherwise TCP might fallback to internal pacing, which is not optimal. Fixes: 076433bd78d7 ("net_sched: sch_fq: add fast path for mostly idle qdisc") Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Link: https://lore.kernel.org/r/20231020201254.732527-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 06e4dd18f86876bc29786d66165f781cd0265b7c Author: Eric Dumazet Date: Fri Oct 20 20:00:53 2023 +0000 net_sched: sch_fq: fix off-by-one error in fq_dequeue() A last minute change went wrong. We need to look for a packet in all 3 bands, not only two. Fixes: 29f834aa326e ("net_sched: sch_fq: add 3 bands and WRR scheduling") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202310201422.a22b0999-oliver.sang@intel.com Signed-off-by: Eric Dumazet Cc: Soheil Hassas Yeganeh Cc: Dave Taht Cc: Toke Høiland-Jørgensen Tested-by: Willem de Bruijn Link: https://lore.kernel.org/r/20231020200053.675951-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit d313b0e9070a7100ca55e64fe3b081d176d8806d Author: Rafał Miłecki Date: Fri Oct 13 12:33:14 2023 +0200 ARM: dts: BCM5301X: Set fixed-link for extra Netgear R8000 CPU ports Ports 5 and 7 are disabled by default because the standard use case is for port 8 to manage all CPU directed traffic. For experimentation purposes however it is desirable to provide adequate properties such that people can experiment with using different ports without having to figure out their configuration. Some of the use cases include but are not limited to doubling or tripling the bandwidth by leveraging the additional ports/Ethernet MAC combinations. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20231013103314.10306-2-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 473baeab929444295b0530f8766e4becb6a08973 Author: Rafał Miłecki Date: Fri Oct 13 12:33:13 2023 +0200 ARM: dts: BCM5301X: Explicitly disable unused switch CPU ports When redescribing ports I assumed that missing "label" (like "cpu") means switch port isn't used. That was incorrect and I realized my change made Linux always use the first (5) CPU port (there are 3 of them). While above should technically be possible it often isn't correct: 1. Non-default switch ports are often connected to Ethernet interfaces not fully covered by vendor setup (they may miss MACs) 2. On some devices non-default ports require specifying fixed link This fixes network connectivity for some devices. It was reported & tested for Netgear R8000. It also affects Linksys EA9200 with its downstream DTS. Fixes: ba4aebce23b2 ("ARM: dts: BCM5301X: Describe switch ports in the main DTS") Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20231013103314.10306-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit b8d4f7c1be04d66c37c119c501c87bccc4197694 Author: Rafał Miłecki Date: Sat Sep 16 10:58:55 2023 +0200 ARM: dts: BCM5301X: Relicense Vivek's code to the GPL 2.0+ / MIT Move code added by Vivek to the bcm-ns.dtsi which uses dual licensing. That syncs more Northstar code to be based on the same licensing schema. This code was added in the commit 37f6130ec39f ("ARM: dts: BCM5301X: Make USB 3.0 PHY use MDIO PHY driver"). Cc: Vivek Unune Signed-off-by: Rafał Miłecki Acked-by: Vivek Unune Link: https://lore.kernel.org/r/20230916085855.28375-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 81ea360a16978a4df61df9db56b171909bd659c0 Author: Rafał Miłecki Date: Sat Sep 16 10:30:57 2023 +0200 ARM: dts: BCM5301X: Relicense Felix's code to the GPL 2.0+ / MIT Move code added by Felix to the bcm-ns.dtsi which uses dual licensing. That syncs more Northstar code to be based on the same licensing schema. This code was added in the commit 1ff80363524c ("ARM: BCM5301X: Add profiling support"). Cc: Felix Fietkau Signed-off-by: Rafał Miłecki Acked-by: Felix Fietkau Link: https://lore.kernel.org/r/20230916083057.10458-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit a9e79863b62aaaefcdf469fc331bf482ae00db0d Author: Rafał Miłecki Date: Fri Sep 1 14:43:11 2023 +0200 ARM: dts: BCM5301X: Set MAC address for Asus RT-AC87U Specify NVRAM access and use its "et1macaddr" NVMEM cell. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20230901124311.31156-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 701d1057654f99c374fde56f34fccc1853d1bf45 Merge: 0bb80ecc33a8f 2838820800dca Author: Stephen Boyd Date: Mon Oct 23 15:09:18 2023 -0700 Merge tag 'clk-imx-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux into clk-imx Pull i.MX clk driver updates from Abel Vesa: - Select MXC_CLK when building in the CLK_IMX8QXP - Fixes for error handling paths in i.MX8 ACM driver - Move the clocks check in i.MX8 ACM driver in order to log any error - Drop the unused return value of clk_imx_acm_detach_pm_domains - Drop non-existant IMX8MP_CLK_AUDIOMIX_PDM_ROOT clock - Fix error handling in i.MX8MQ clock driver - Allow a different LCDIF1 clock parent if DT describes it for i.MX6SX - Keep the SCU resource table sorted in the i.MX8DXL rsrc driver - Move the elcdif PLL clock registration above lcd_clk, as it is its parent - Correct some ENET specific clocks for i.MX8DXL platform - Drop the VPU_UART and VPUCORE from i.MX8QM as latest HW revision doesn't have them - Remove "de-featured" MLB support from i.MX8QM/QXP/DXL platforms - Skip registering clocks owned by Cortex-A partition SCU-based platforms - Add CAN_1/2 to i.MX8QM and M4_0, PI_0_PWM_0 and PI_0_I2C_0 to i.MX8QXP resources * tag 'clk-imx-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux: clk: imx: imx8qm/qxp: add more resources to whitelist clk: imx: scu: ignore clks not owned by Cortex-A partition clk: imx8: remove MLB support clk: imx: imx8qm-rsrc: drop VPU_UART/VPUCORE clk: imx: imx8qxp: correct the enet clocks for i.MX8DXL clk: imx: imx8qxp: Fix elcdif_pll clock clk: imx: imx8dxl-rsrc: keep sorted in the ascending order clk: imx: imx6sx: Allow a different LCDIF1 clock parent clk: imx: imx8mq: correct error handling path clk: imx8mp: Remove non-existent IMX8MP_CLK_AUDIOMIX_PDM_ROOT clk: imx: imx8: Simplify clk_imx_acm_detach_pm_domains() clk: imx: imx8: Add a message in case of devm_clk_hw_register_mux_parent_data_table() error clk: imx: imx8: Fix an error handling path in imx8_acm_clk_probe() clk: imx: imx8: Fix an error handling path if devm_clk_hw_register_mux_parent_data_table() fails clk: imx: imx8: Fix an error handling path in clk_imx_acm_attach_pm_domains() clk: imx: Select MXC_CLK for CLK_IMX8QXP commit b63dadd6f97522513fe9497b5fde84a154e39a0b Author: Daniel Borkmann Date: Mon Oct 23 20:50:15 2023 +0200 bpf, tcx: Get rid of tcx_link_const Small clean up to get rid of the extra tcx_link_const() and only retain the tcx_link(). Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/r/20231023185015.21152-1-daniel@iogearbox.net Signed-off-by: Martin KaFai Lau commit f0bb192440e6a86d17e078feed7a5779445c5ced Merge: e035ddb68bb28 23e4a49943624 Author: Arnd Bergmann Date: Mon Oct 23 21:18:43 2023 +0200 Merge tag 'samsung-dt64-6.7-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/dt Samsung DTS ARM64 changes for v6.7, part two Add ramoops reserved memory region to E850-96 board for debugging purposes. * tag 'samsung-dt64-6.7-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: arm64: dts: exynos: Add reserved memory for pstore on E850-96 Link: https://lore.kernel.org/r/20231023165412.529762-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit e035ddb68bb2827cff3aad1a6ff17ecc6e62f07e Author: Krzysztof Kozlowski Date: Mon Oct 23 11:12:21 2023 +0900 arm64: dts: socionext: add missing cache properties As all level 2 and level 3 caches are unified, add required cache-unified property to fix warnings like: uniphier-ld11-ref.dtb: l2-cache: 'cache-unified' is a required property Signed-off-by: Krzysztof Kozlowski Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20231023021221.2884828-3-hayashi.kunihiko@socionext.com Signed-off-by: Arnd Bergmann commit 2a6e483ad047654a220c798080d0fc861ead2e07 Author: Justin Stitt Date: Mon Oct 23 18:12:28 2023 +0000 rpmsg: virtio: Replace deprecated strncpy with strscpy/_pad strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. This patch replaces 3 callsites of strncpy(). The first two populate the destination buffer `nsm.name` -- which we expect to be NUL-terminated based on their use with format strings. Firstly, as I understand it, virtio_rpmsg_announce_create() creates an rpmsg_ns_msg and sends via: virtio_rpmsg_bus.c: 336: err = rpmsg_sendto(rpdev->ept, &nsm, sizeof(nsm), RPMSG_NS_ADDR); ... which uses: virtio_rpmsg_sendto() -> rpmsg_send_offchannel_raw() ... which copies its data into an rpmsg_hdr `msg` in virtio_rpmsg_bus.c 618: memcpy(msg->data, data, len); This callback is invoked when a message is received from the remote processor: rpmsg_ns.c: 30: /* invoked when a name service announcement arrives */ 31: static int rpmsg_ns_cb(struct rpmsg_device *rpdev, void *data, int len, 32: void *priv, u32 src) 33: { 34: struct rpmsg_ns_msg *msg = data; ... 50: /* don't trust the remote processor for null terminating the name */ 51: msg->name[RPMSG_NAME_SIZE - 1] = '\0'; ... which leads into the use of `name` within a format string: rpmsg_ns.c: 57: dev_info(dev, "%sing channel %s addr 0x%x\n", 58: rpmsg32_to_cpu(rpdev, msg->flags) & RPMSG_NS_DESTROY ? 59: "destroy" : "creat", msg->name, chinfo.dst); We can also observe that `nsm` is not zero-initialized and as such we should maintain the NUL-padding behavior that strncpy() provides: virtio_rpmsg_bus.c: 330: struct rpmsg_ns_msg nsm; Considering the above, a suitable replacement is `strscpy_pad` due to the fact that it guarantees both NUL-termination and NUL-padding on the destination buffer. Now, for the third and final destination buffer rpdev->id.name we can just go for strscpy() (not _pad()) as rpdev points to &vch->rpdev: | rpdev = &vch->rpdev; ... and vch is zero-allocated: | vch = kzalloc(sizeof(*vch), GFP_KERNEL); ... this renders any additional NUL-byte assignments (like the ones strncpy() or strscpy_pad() does) redundant. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Link: https://lore.kernel.org/r/20231023-strncpy-drivers-rpmsg-virtio_rpmsg_bus-c-v2-1-dc591c36f5ed@google.com Signed-off-by: Mathieu Poirier commit 0804f3bec9e9a3e9f3b5431ac9a11417041bc4c2 Author: Conor Dooley Date: Sun Oct 22 23:41:35 2023 +0800 riscv: dts: thead: convert isa detection to new properties Convert the th1520 devicetrees to use the new properties "riscv,isa-base" & "riscv,isa-extensions". For compatibility with other projects, "riscv,isa" remains. Reviewed-by: Jisheng Zhang Acked-by: Guo Ren Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20231022154135.3746-1-jszhang@kernel.org Signed-off-by: Arnd Bergmann commit 8d4f9145f52e9d1c5e6e86402ef8ca24cadb38f9 Author: Pierre Gondois Date: Fri Oct 20 14:50:22 2023 -0500 arm64: dts: Update cache properties for socionext The DeviceTree Specification v0.3 specifies that the cache node 'compatible' and 'cache-level' properties are 'required'. Cf. s3.8 Multi-level and Shared Cache Nodes The 'cache-unified' property should be present if one of the properties for unified cache is present ('cache-size', ...). Update the Device Trees accordingly. Signed-off-by: Pierre Gondois Reviewed-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20221107155825.1644604-21-pierre.gondois@arm.com Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231020195022.4183862-2-robh@kernel.org Signed-off-by: Arnd Bergmann commit 23b336e9825d998dfc7035a8826cb9b26fb75b4d Merge: 2707977650633 660b8b2f39447 Author: Arnd Bergmann Date: Mon Oct 23 21:05:00 2023 +0200 Merge tag 'mvebu-dt64-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into soc/dt mvebu dt64 for 6.7 (part 1) Declare switch on eDPU (Armada 3720 based) Use proper suffix -gpios for SFP GPIO properties on uDPU (Armada 3720 based) Use appropriate label for spi1 pins on cn9310 boards * tag 'mvebu-dt64-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: arm64: dts: marvell: eDPU: add support for version with external switch arm64: dts: marvell: uDPU: rename the SFP GPIO properties ARM64: dts: marvell: cn9310: Use appropriate label for spi1 pins Link: https://lore.kernel.org/r/8734y6aaqb.fsf@BL-laptop Signed-off-by: Arnd Bergmann commit fe49fd940e22592988552e3bcd03f5a64facdecf Author: Marc Zyngier Date: Thu Oct 12 21:51:08 2023 +0100 KVM: arm64: Move VTCR_EL2 into struct s2_mmu We currently have a global VTCR_EL2 value for each guest, even if the guest uses NV. This implies that the guest's own S2 must fit in the host's. This is odd, for multiple reasons: - the PARange values and the number of IPA bits don't necessarily match: you can have 33 bits of IPA space, and yet you can only describe 32 or 36 bits of PARange - When userspace set the IPA space, it creates a contract with the kernel saying "this is the IPA space I'm prepared to handle". At no point does it constraint the guest's own IPA space as long as the guest doesn't try to use a [I]PA outside of the IPA space set by userspace - We don't even try to hide the value of ID_AA64MMFR0_EL1.PARange. And then there is the consequence of the above: if a guest tries to create a S2 that has for input address something that is larger than the IPA space defined by the host, we inject a fatal exception. This is no good. For all intent and purposes, a guest should be able to have the S2 it really wants, as long as the *output* address of that S2 isn't outside of the IPA space. For that, we need to have a per-s2_mmu VTCR_EL2 setting, which allows us to represent the full PARange. Move the vctr field into the s2_mmu structure, which has no impact whatsoever, except for NV. Note that once we are able to override ID_AA64MMFR0_EL1.PARange from userspace, we'll also be able to restrict the size of the shadow S2 that NV uses. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231012205108.3937270-1-maz@kernel.org Signed-off-by: Oliver Upton commit 91e174fc04b1975b0e4d431a7020779635ff7c05 Author: Colin Ian King Date: Mon Oct 23 16:49:17 2023 +0100 ASoC: codecs: rt298: remove redundant assignment to d_len_code Variable d_len_code is being initialized to zero and then re-assigned a different value in all the valid cases in the following switch statement. The only place it is not being assigned a value is on the return for a default case and in this case it does not need to be assigned. The initialization is redundant and can be removed. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20231023154917.671595-1-colin.i.king@gmail.com Signed-off-by: Mark Brown commit 7790bccd7bac3af28bf044e188215041eb142d56 Author: Janusz Krzysztofik Date: Sun Oct 8 15:53:10 2023 +0200 ASoC: ti: ams-delta: Allow it to be test compiled The driver is now built only when MACH_AMS_DELTA is selected, which requires a very specific selection of ARCH settings. As a consequence, it gets very little attention from build-bots, if not none. Drop the driver dependency on , no longer required since conversion to snd_soc_register_card() and drop of machine_is_ams_delta(). With that in place, allow the driver to be built in any environment as long as COMPILE_TEST is selected. Take care of not selecting SND_SOC_OMAP_MCBSP if COMMON_CLK is not selected. Signed-off-by: Janusz Krzysztofik Link: https://lore.kernel.org/r/20231008135601.542356-1-jmkrzyszt@gmail.com Signed-off-by: Mark Brown commit 4fc4db7a68c2c04522880c4f89317f7874a4188f Merge: 61f85372d2932 05d3ef8bba77c Author: Mark Brown Date: Mon Oct 23 19:38:22 2023 +0100 ASoC: Merge up v6.6-rc7 Get fixes needed so we can enable build of ams-delta in more configurations. commit 9bc633117d6a8411c6912cb0194b3e0f83ef9d56 Author: Arnd Bergmann Date: Mon Oct 23 20:06:58 2023 +0200 hte: tegra194: add GPIOLIB dependency The driver started calling into a few interfaces that are part of GPIOLIB and don't have stub implementations otherwise: drivers/hte/hte-tegra194.c: In function 'tegra_hte_line_xlate': drivers/hte/hte-tegra194.c:424:48: error: implicit declaration of function 'gpio_device_get_base'; did you mean 'gpio_device_get_desc'? [-Werror=implicit-function-declaration] 424 | line_id = desc->attr.line_id - gpio_device_get_base(gs->gdev); | ^~~~~~~~~~~~~~~~~~~~ | gpio_device_get_desc Add a Kconfig dependency to only allow building when this is defined. Fixes: dc850faa28ee0 ("hte: tegra194: don't access struct gpio_chip") Signed-off-by: Arnd Bergmann Acked-by: Dipen Patel Signed-off-by: Bartosz Golaszewski commit 8aa49284f3673879dcabfb116f7cac265b4cb0f5 Merge: 598c20f964d15 d4d27e5a1a88f Author: Rafael J. Wysocki Date: Mon Oct 23 20:06:58 2023 +0200 Merge branch 'thermal-intel' Merge changes in Intel thermal control drivers for 6.7-rc1: - Add power floor notifications support to the int340x thermal control driver (Srinivas Pandruvada). - Rework updating trip points in the int340x thermal driver so that it does not access thermal zone internals directly (Rafael Wysocki). - Use param_get_byte() instead of param_get_int() as the max_idle module parameter .get() callback in the Intel powerclamp thermal driver to avoid possible out-of-bounds access (David Arcari). - Add workload hints support to the the int340x thermal driver (Srinivas Pandruvada). * thermal-intel: selftests/thermel/intel: Add test to read power floor status thermal: int340x: processor_thermal: Enable power floor support thermal: int340x: processor_thermal: Handle power floor interrupts thermal: int340x: processor_thermal: Support power floor notifications thermal: int340x: processor_thermal: Set feature mask before proc_thermal_add thermal: int340x: processor_thermal: Common function to clear SOC interrupt thermal: int340x: processor_thermal: Move interrupt status MMIO offset to common header thermal: intel: powerclamp: fix mismatch in get function for max_idle thermal: int340x: Use thermal_zone_for_each_trip() thermal: int340x: processor_thermal: Ack all PCI interrupts thermal: int340x: Add ArrowLake-S PCI ID selftests/thermel/intel: Add test to read workload hint thermal: int340x: Handle workload hint interrupts thermal: int340x: processor_thermal: Add workload type hint interface thermal: int340x: Remove PROC_THERMAL_FEATURE_WLT_REQ for Meteor Lake thermal: int340x: processor_thermal: Use non MSI interrupts by default thermal: int340x: processor_thermal: Add interrupt configuration function thermal: int340x: processor_thermal: Move mailbox code to common module commit 530886897c789cf77c9a0d4a7cc5549f0768b5f8 Author: Marcel Ziswiler Date: Wed Oct 18 16:47:35 2023 +0200 Bluetooth: hci_sync: Fix Opcode prints in bt_dev_dbg/err Printed Opcodes may be missing leading zeros: Bluetooth: hci0: Opcode 0x c03 failed: -110 Fix this by always printing leading zeros: Bluetooth: hci0: Opcode 0x0c03 failed: -110 Fixes: d0b137062b2d ("Bluetooth: hci_sync: Rework init stages") Fixes: 6a98e3836fa2 ("Bluetooth: Add helper for serialized HCI command execution") Signed-off-by: Marcel Ziswiler Signed-off-by: Luiz Augusto von Dentz commit a85fb91e3d728bdfc80833167e8162cce8bc7004 Author: ZhengHan Wang Date: Wed Oct 18 12:30:55 2023 +0200 Bluetooth: Fix double free in hci_conn_cleanup syzbot reports a slab use-after-free in hci_conn_hash_flush [1]. After releasing an object using hci_conn_del_sysfs in the hci_conn_cleanup function, releasing the same object again using the hci_dev_put and hci_conn_put functions causes a double free. Here's a simplified flow: hci_conn_del_sysfs: hci_dev_put put_device kobject_put kref_put kobject_release kobject_cleanup kfree_const kfree(name) hci_dev_put: ... kfree(name) hci_conn_put: put_device ... kfree(name) This patch drop the hci_dev_put and hci_conn_put function call in hci_conn_cleanup function, because the object is freed in hci_conn_del_sysfs function. This patch also fixes the refcounting in hci_conn_add_sysfs() and hci_conn_del_sysfs() to take into account device_add() failures. This fixes CVE-2023-28464. Link: https://syzkaller.appspot.com/bug?id=1bb51491ca5df96a5f724899d1dbb87afda61419 [1] Signed-off-by: ZhengHan Wang Co-developed-by: Luiz Augusto von Dentz Signed-off-by: Luiz Augusto von Dentz commit 4ed924fc122f759e383df7eccd89a2e57d9c4c5d Author: Zhengping Jiang Date: Fri Oct 13 12:47:07 2023 -0700 Bluetooth: btmtksdio: enable bluetooth wakeup in system suspend The BTMTKSDIO_BT_WAKE_ENABLED flag is set for bluetooth interrupt during system suspend and increases wakeup count for bluetooth event. Signed-off-by: Zhengping Jiang Signed-off-by: Luiz Augusto von Dentz commit da06ff1f585ea784c79f80e7fab0e0c4ebb49c1c Author: Guan Wentao Date: Thu Oct 12 19:21:17 2023 +0800 Bluetooth: btusb: Add 0bda:b85b for Fn-Link RTL8852BE Add PID/VID 0bda:b85b for Realtek RTL8852BE USB bluetooth part. The PID/VID was reported by the patch last year. [1] Some SBCs like rockpi 5B A8 module contains the device. And it`s founded in website. [2] [3] Here is the device tables in /sys/kernel/debug/usb/devices . T: Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0bda ProdID=b85b 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 Link: https://lore.kernel.org/all/20220420052402.19049-1-tangmeng@uniontech.com/ [1] Link: https://forum.radxa.com/t/bluetooth-on-ubuntu/13051/4 [2] Link: https://ubuntuforums.org/showthread.php?t=2489527 [3] Cc: stable@vger.kernel.org Signed-off-by: Meng Tang Signed-off-by: Guan Wentao Signed-off-by: Luiz Augusto von Dentz commit 41e9cdea9c4ab6606ca462ff4ec901a82d022c05 Author: Janne Grunau Date: Mon Oct 16 09:13:08 2023 +0200 Bluetooth: hci_bcm4377: Mark bcm4378/bcm4387 as BROKEN_LE_CODED bcm4378 and bcm4387 claim to support LE Coded PHY but fail to pair (reliably) with BLE devices if it is enabled. On bcm4378 pairing usually succeeds after 2-3 tries. On bcm4387 pairing appears to be completely broken. Cc: stable@vger.kernel.org # 6.4.y+ Link: https://discussion.fedoraproject.org/t/mx-master-3-bluetooth-mouse-doesnt-connect/87072/33 Link: https://github.com/AsahiLinux/linux/issues/177 Fixes: 288c90224eec ("Bluetooth: Enable all supported LE PHY by default") Signed-off-by: Janne Grunau Reviewed-by: Eric Curtin Reviewed-by: Neal Gompa Signed-off-by: Luiz Augusto von Dentz commit f4da3ee15de9944482382181329bb6d7335ca003 Author: Claudia Draghicescu Date: Thu Sep 28 11:02:08 2023 +0300 Bluetooth: ISO: Copy BASE if service data matches EIR_BAA_SERVICE_UUID Copy the content of a Periodic Advertisement Report to BASE only if the service UUID is Basic Audio Announcement Service UUID. Signed-off-by: Claudia Draghicescu Signed-off-by: Luiz Augusto von Dentz commit 181a42edddf51d5d9697ecdf365d72ebeab5afb0 Author: Ziyang Xuan Date: Wed Oct 11 17:57:31 2023 +0800 Bluetooth: Make handle of hci_conn be unique The handle of new hci_conn is always HCI_CONN_HANDLE_MAX + 1 if the handle of the first hci_conn entry in hci_dev->conn_hash->list is not HCI_CONN_HANDLE_MAX + 1. Use ida to manage the allocation of hci_conn->handle to make it be unique. Fixes: 9f78191cc9f1 ("Bluetooth: hci_conn: Always allocate unique handles") Signed-off-by: Ziyang Xuan Signed-off-by: Luiz Augusto von Dentz commit 624820f7c8826dd010e8b1963303c145f99816e9 Author: youwan Wang Date: Wed Oct 11 13:14:47 2023 +0800 Bluetooth: btusb: Add date->evt_skb is NULL check fix crash because of null pointers [ 6104.969662] BUG: kernel NULL pointer dereference, address: 00000000000000c8 [ 6104.969667] #PF: supervisor read access in kernel mode [ 6104.969668] #PF: error_code(0x0000) - not-present page [ 6104.969670] PGD 0 P4D 0 [ 6104.969673] Oops: 0000 [#1] SMP NOPTI [ 6104.969684] RIP: 0010:btusb_mtk_hci_wmt_sync+0x144/0x220 [btusb] [ 6104.969688] RSP: 0018:ffffb8d681533d48 EFLAGS: 00010246 [ 6104.969689] RAX: 0000000000000000 RBX: ffff8ad560bb2000 RCX: 0000000000000006 [ 6104.969691] RDX: 0000000000000000 RSI: ffffb8d681533d08 RDI: 0000000000000000 [ 6104.969692] RBP: ffffb8d681533d70 R08: 0000000000000001 R09: 0000000000000001 [ 6104.969694] R10: 0000000000000001 R11: 00000000fa83b2da R12: ffff8ad461d1d7c0 [ 6104.969695] R13: 0000000000000000 R14: ffff8ad459618c18 R15: ffffb8d681533d90 [ 6104.969697] FS: 00007f5a1cab9d40(0000) GS:ffff8ad578200000(0000) knlGS:00000 [ 6104.969699] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 6104.969700] CR2: 00000000000000c8 CR3: 000000018620c001 CR4: 0000000000760ef0 [ 6104.969701] PKRU: 55555554 [ 6104.969702] Call Trace: [ 6104.969708] btusb_mtk_shutdown+0x44/0x80 [btusb] [ 6104.969732] hci_dev_do_close+0x470/0x5c0 [bluetooth] [ 6104.969748] hci_rfkill_set_block+0x56/0xa0 [bluetooth] [ 6104.969753] rfkill_set_block+0x92/0x160 [ 6104.969755] rfkill_fop_write+0x136/0x1e0 [ 6104.969759] __vfs_write+0x18/0x40 [ 6104.969761] vfs_write+0xdf/0x1c0 [ 6104.969763] ksys_write+0xb1/0xe0 [ 6104.969765] __x64_sys_write+0x1a/0x20 [ 6104.969769] do_syscall_64+0x51/0x180 [ 6104.969771] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 6104.969773] RIP: 0033:0x7f5a21f18fef [ 6104.9] RSP: 002b:00007ffeefe39010 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 [ 6104.969780] RAX: ffffffffffffffda RBX: 000055c10a7560a0 RCX: 00007f5a21f18fef [ 6104.969781] RDX: 0000000000000008 RSI: 00007ffeefe39060 RDI: 0000000000000012 [ 6104.969782] RBP: 00007ffeefe39060 R08: 0000000000000000 R09: 0000000000000017 [ 6104.969784] R10: 00007ffeefe38d97 R11: 0000000000000293 R12: 0000000000000002 [ 6104.969785] R13: 00007ffeefe39220 R14: 00007ffeefe391a0 R15: 000055c10a72acf0 Signed-off-by: youwan Wang Signed-off-by: Luiz Augusto von Dentz commit fcb89f120376c054005e6d7a82bb89f95b3b04ef Author: Iulia Tanasescu Date: Wed Oct 11 17:24:07 2023 +0300 Bluetooth: ISO: Fix bcast listener cleanup This fixes the cleanup callback for slave bis and pa sync hcons. Closing all bis hcons will trigger BIG Terminate Sync, while closing all bises and the pa sync hcon will also trigger PA Terminate Sync. Signed-off-by: Iulia Tanasescu Signed-off-by: Luiz Augusto von Dentz commit 41c56aa94c647a0f84c5c33fffb3f283e6f0e5bf Author: Dan Carpenter Date: Thu Oct 5 14:19:23 2023 +0300 Bluetooth: msft: __hci_cmd_sync() doesn't return NULL The __hci_cmd_sync() function doesn't return NULL. Checking for NULL doesn't make the code safer, it just confuses people. When a function returns both error pointers and NULL then generally the NULL is a kind of success case. For example, maybe we look up an item then errors mean we ran out of memory but NULL means the item is not found. Or if we request a feature, then error pointers mean that there was an error but NULL means that the feature has been deliberately turned off. In this code it's different. The NULL is handled as if there is a bug in __hci_cmd_sync() where it accidentally returns NULL instead of a proper error code. This was done consistently until commit 9e14606d8f38 ("Bluetooth: msft: Extended monitor tracking by address filter") which deleted the work around for the potential future bug and treated NULL as success. Predicting potential future bugs is complicated, but we should just fix them instead of working around them. Instead of debating whether NULL is failure or success, let's just say it's currently impossible and delete the dead code. Signed-off-by: Dan Carpenter Signed-off-by: Luiz Augusto von Dentz commit 71b7bb48b9837ca97c75a521cc68398641dcb1d6 Author: Iulia Tanasescu Date: Tue Oct 3 17:37:39 2023 +0300 Bluetooth: ISO: Match QoS adv handle with BIG handle In case the user binds multiple sockets for the same BIG, the BIG handle should be matched with the associated adv handle, if it has already been allocated previously. Signed-off-by: Iulia Tanasescu Signed-off-by: Luiz Augusto von Dentz commit 31ca583b38e55007d49ecc81722d30b6395fec30 Author: Iulia Tanasescu Date: Tue Oct 3 17:49:33 2023 +0300 Bluetooth: ISO: Allow binding a bcast listener to 0 bises This makes it possible to bind a broadcast listener to a broadcaster address without asking for any BIS indexes to sync with. Signed-off-by: Iulia Tanasescu Signed-off-by: Luiz Augusto von Dentz commit 598c20f964d159fa55343e03216fbdb8199e9d7d Merge: 27fa2b6043831 c27d08f786aca Author: Rafael J. Wysocki Date: Mon Oct 23 20:00:51 2023 +0200 Merge branch 'thermal-core' Merge thermal core changes for 6.7-rc1: - Use trip pointers in thermal governors and in the related part of the thermal core (Rafael Wysocki). - Avoid updating trip points when the thermal zone temperature falls into a trip point's hysteresis range (ícolas F. R. A. Prado). * thermal-core: thermal: ACPI: Include the right header file thermal: core: Don't update trip points inside the hysteresis range thermal: core: Pass trip pointer to governor throttle callback thermal: gov_step_wise: Fold update_passive_instance() into its caller thermal: gov_power_allocator: Use trip pointers instead of trip indices thermal: gov_fair_share: Rearrange get_trip_level() thermal: trip: Define for_each_trip() macro thermal: trip: Simplify computing trip indices commit 02be109d3a405dbc4d53fb4b4473d7a113548088 Author: Masum Reza Date: Sun Sep 24 16:46:55 2023 +0530 Bluetooth: btusb: Add RTW8852BE device 13d3:3570 to device tables This device is used in TP-Link TX20E WiFi+Bluetooth adapter. Relevant information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=01 Lev=01 Prnt=01 Port=08 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=13d3 ProdID=3570 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: Masum Reza Signed-off-by: Luiz Augusto von Dentz commit a7f8dedb4be2cc930a29af24427b885405ecd15d Author: Tim Jiang Date: Tue Sep 12 17:39:57 2023 +0800 Bluetooth: qca: add support for QCA2066 This patch adds support for QCA2066 firmware patch and NVM downloading. as the RF performance of QCA2066 SOC chip from different foundries may vary. Therefore we use different NVM to configure them based on board ID. Changes in v2 - optimize the function qca_generate_hsp_nvm_name - remove redundant debug code for function qca_read_fw_board_id Signed-off-by: Tim Jiang Signed-off-by: Luiz Augusto von Dentz commit 5af69ab9bc623bd9293c5a931fb0827ed5201b5c Author: Vlad Pruteanu Date: Tue Sep 12 09:33:29 2023 +0300 Bluetooth: ISO: Set CIS bit only for devices with CIS support Currently the CIS bit that can be set by the host is set for any device that has CIS or BIS support. In reality, devices that support BIS may not allow that bit to be set and so, the HCI bring up fails for them. This commit fixes this by only setting the bit for CIS capable devices. Signed-off-by: Vlad Pruteanu Signed-off-by: Luiz Augusto von Dentz commit a97258dba7d298669899d86e5aecb9f718bee531 Author: Vijay Satija Date: Thu Sep 7 14:45:50 2023 +0530 Bluetooth: Add support for Intel Misty Peak - 8087:0038 Devices from /sys/kernel/debug/usb/devices: T: Bus=01 Lev=01 Prnt=01 Port=13 Cnt=02 Dev#= 3 Spd=12 MxCh= 0 D: Ver= 2.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=8087 ProdID=0038 Rev= 0.00 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= 64 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 I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms Signed-off-by: Vijay Satija Signed-off-by: Kiran K Signed-off-by: Luiz Augusto von Dentz commit 00b1c3c4b682ba4b4f9fc46e047b537e668576af Author: Jingyang Wang Date: Wed Sep 6 16:31:47 2023 +0800 Bluetooth: Add support ITTIM PE50-M75C -Device(35f5:7922) from /sys/kernel/debug/usb/devices P: Vendor=35f5 ProdID=7922 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: Jingyang Wang Signed-off-by: Luiz Augusto von Dentz commit 1d11d70d1f6b23e7d3fc00396c17b90b876162a4 Author: Iulia Tanasescu Date: Wed Sep 6 17:01:03 2023 +0300 Bluetooth: ISO: Pass BIG encryption info through QoS This enables a broadcast sink to be informed if the PA it has synced with is associated with an encrypted BIG, by retrieving the socket QoS and checking the encryption field. After PA sync has been successfully established and the first BIGInfo advertising report is received, a new hcon is added and notified to the ISO layer. The ISO layer sets the encryption field of the socket and hcon QoS according to the encryption parameter of the BIGInfo advertising report event. After that, the userspace is woken up, and the QoS of the new PA sync socket can be read, to inspect the encryption field and follow up accordingly. Signed-off-by: Iulia Tanasescu Signed-off-by: Luiz Augusto von Dentz commit ec189da923fb06acb0ee38e2d0ee55239995e9d6 Author: Justin Stitt Date: Fri Oct 20 23:18:59 2023 +0000 rpmsg: Replace deprecated strncpy with strscpy_pad strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect chinfo.name to be NUL-terminated based on its use with format strings: | dev_err(&ctrldev->dev, "failed to create %s channel\n", chinfo.name); Since chinfo is not default initialized, we should NUL-pad the `name` field so that the behavior is consistent with what strncpy() provides: | struct rpmsg_channel_info chinfo; Considering the above, a suitable replacement is `strscpy_pad` due to the fact that it guarantees both NUL-termination and NUL-padding on the destination buffer. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Link: https://lore.kernel.org/r/20231020-strncpy-drivers-rpmsg-rpmsg_ns-c-v1-1-99b16b00c36c@google.com Signed-off-by: Mathieu Poirier commit a9580b9b36a88f8cc92ae52820a386f92c8d6065 Author: Justin Stitt Date: Fri Oct 20 19:56:59 2023 +0000 rpmsg: core: Replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect chinfo.name to be NUL-terminated based on its usage with strncmp(): rpmsg_core.c: 389: if (strncmp(chinfo->name, rpdev->id.name, RPMSG_NAME_SIZE)) Moreover, NUL-padding is not required as chinfo has stack default initialized all fields to zero: rpmsg_core.c: 539: struct rpmsg_channel_info chinfo = {}; Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Also, favor the more idiomatic strscpy() usage of: (dest, src, sizeof(dest)). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Link: https://lore.kernel.org/r/20231020-strncpy-drivers-rpmsg-rpmsg_core-c-v1-1-a86b7930c1cf@google.com Signed-off-by: Mathieu Poirier commit a254b90c9aac3d3d938a07e019773e35a977451b Author: Iulia Tanasescu Date: Wed Sep 6 16:59:54 2023 +0300 Bluetooth: ISO: Fix BIS cleanup This fixes the master BIS cleanup procedure - as opposed to CIS cleanup, no HCI disconnect command should be issued. A master BIS should only be terminated by disabling periodic and extended advertising, and terminating the BIG. In case of a Broadcast Receiver, all BIS and PA connections can be cleaned up by calling hci_conn_failed, since it contains all function calls that are necessary for successful cleanup. Signed-off-by: Iulia Tanasescu Signed-off-by: Luiz Augusto von Dentz commit 27fa2b60438310d824cb980af44854daf50a8bd3 Merge: d3bff6277087c 108ffd12be24b Author: Rafael J. Wysocki Date: Mon Oct 23 19:51:26 2023 +0200 Merge branch 'acpi-thermal' Merge ACPI thermal driver changes are related thermal core changes for v6.7-rc1: - Untangle the initialization and updates of passive and active trip points in the ACPI thermal driver (Rafael Wysocki). - Reduce code duplication related to the initialization and updates of trip points in the ACPI thermal driver (Rafael Wysocki). - Use trip pointers for cooling device binding in the ACPI thermal driver (Rafael Wysocki). - Simplify critical and hot trips representation in the ACPI thermal driver (Rafael Wysocki). * acpi-thermal: (26 commits) thermal: trip: Drop lockdep assertion from thermal_zone_trip_id() thermal: trip: Remove lockdep assertion from for_each_thermal_trip() thermal: core: Drop thermal_zone_device_exec() ACPI: thermal: Use thermal_zone_for_each_trip() for updating trips ACPI: thermal: Combine passive and active trip update functions ACPI: thermal: Move get_active_temp() ACPI: thermal: Fix up function header formatting in two places ACPI: thermal: Drop list of device ACPI handles from struct acpi_thermal ACPI: thermal: Rename structure fields holding temperature in deci-Kelvin ACPI: thermal: Drop critical_valid and hot_valid trip flags ACPI: thermal: Do not use trip indices for cooling device binding ACPI: thermal: Mark uninitialized active trips as invalid ACPI: thermal: Merge trip initialization functions ACPI: thermal: Collapse trip devices update function wrappers ACPI: thermal: Collapse trip devices update functions ACPI: thermal: Add device list to struct acpi_thermal_trip ACPI: thermal: Fix a small leak in acpi_thermal_add() ACPI: thermal: Drop valid flag from struct acpi_thermal_trip ACPI: thermal: Drop redundant trip point flags ACPI: thermal: Untangle initialization and updates of active trips ... commit 6f15b178cd6315c997981f76c6ebed7ad39144c5 Author: Shubhrajyoti Datta Date: Thu Oct 5 15:42:42 2023 +0530 EDAC/versal: Add a Xilinx Versal memory controller driver Add a EDAC driver for the RAS capabilities on the Xilinx integrated DDR Memory Controllers (DDRMCs) which support both DDR4 and LPDDR4/4X memory interfaces. It has four programmable Network-on-Chip (NoC) interface ports and is designed to handle multiple streams of traffic. The driver reports correctable and uncorrectable errors, and also creates debugfs entries for testing through error injection. [ bp: - Add a pointer to the documentation about the register unlock code. - Squash in a fix for a Smatch static checker issue as reported by Dan Carpenter: https://lore.kernel.org/r/a4db6f93-8e5f-4d55-a7b8-b5a987d48a58@moroto.mountain ] Co-developed-by: Sai Krishna Potthuri Signed-off-by: Sai Krishna Potthuri Signed-off-by: Shubhrajyoti Datta Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231005101242.14621-3-shubhrajyoti.datta@amd.com commit 0057680ec79acaf16c5432768d7fe0a3d8ed1049 Author: Stanislaw Gruszka Date: Thu Oct 19 22:26:51 2023 +0200 MAINTAINERS: wifi: rt2x00: drop Helmut Schaa Helmut hasn't been responding to rt2x00 related emails since 2016, remove him from rt2x00 mainterner list. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231019202651.518136-1-stf_xl@wp.pl commit 545db7e21e64766e6b7cb987fbfd3e79419726ce Author: Christophe JAILLET Date: Sat Oct 21 16:42:41 2023 +0200 tracing/histograms: Simplify last_cmd_set() Turn a kzalloc()+strcpy()+strncat() into an equivalent and less verbose kasprintf(). Link: https://lore.kernel.org/linux-trace-kernel/30b6fb04dadc10a03cc1ad08f5d8a93ef623a167.1697899346.git.christophe.jaillet@wanadoo.fr Cc: Masami Hiramatsu Signed-off-by: Christophe JAILLET Reviewed-by: Mukesh ojha Signed-off-by: Steven Rostedt (Google) commit 3f791c60cccd506e05ac36d895969618a93014ed Author: Justin Stitt Date: Wed Oct 18 21:50:01 2023 +0000 wifi: wlcore: main: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect fw_version strings to be NUL-terminated based on other similar assignments: wireless/broadcom/brcm80211/brcmsmac/main.c 7867: snprintf(wlc->wiphy->fw_version, 7868: sizeof(wlc->wiphy->fw_version), "%u.%u", rev, patch); wireless/broadcom/b43legacy/main.c 1765: snprintf(wiphy->fw_version, sizeof(wiphy->fw_version), "%u.%u", wireless/broadcom/b43/main.c 2730: snprintf(wiphy->fw_version, sizeof(wiphy->fw_version), "%u.%u", wireless/intel/iwlwifi/dvm/main.c 1465: snprintf(priv->hw->wiphy->fw_version, 1466: sizeof(priv->hw->wiphy->fw_version), wireless/intel/ipw2x00/ipw2100.c 5905: snprintf(info->fw_version, sizeof(info->fw_version), "%s:%d:%s", Based on this, NUL-padding is not required. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231018-strncpy-drivers-net-wireless-ti-wlcore-main-c-v1-1-1b1055f482a1@google.com commit 75fdaa28f10310776fd8370b88ef366e42996f83 Author: Justin Stitt Date: Wed Oct 18 21:36:56 2023 +0000 wifi: wlcore: boot: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect wl->chip.fw_ver_str to be NUL-terminated based on its usage with DRIVER_STATE_PRINT_STR() in debugfs.c: 491 | DRIVER_STATE_PRINT_STR(chip.fw_ver_str); ... which uses DRIVER_STATE_PRINT(): 444 | #define DRIVER_STATE_PRINT_STR(x) DRIVER_STATE_PRINT(x, "%s") ... which relies on scnprintf: 434 | #define DRIVER_STATE_PRINT(x, fmt) \ 435 | (res += scnprintf(buf + res, DRIVER_STATE_BUF_LEN - res,\ 436 | #x " = " fmt "\n", wl->x)) Moreover, NUL-padding is not required. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Similar-to: https://lore.kernel.org/all/20231018-strncpy-drivers-net-wireless-ti-wl18xx-main-c-v2-1-ab828a491ce5@google.com/ Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231018-strncpy-drivers-net-wireless-ti-wlcore-boot-c-v1-1-d3c6cc6b80fe@google.com commit fb329e8b1d88dd09b6f46d7ba3d9243599221b68 Author: Justin Stitt Date: Wed Oct 18 21:18:24 2023 +0000 wifi: wl18xx: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. wl->chip.phy_fw_ver_str is obviously intended to be NUL-terminated by the deliberate comment telling us as much. Furthermore, its only use is drivers/net/wireless/ti/wlcore/debugfs.c shows us it should be NUL-terminated since its used in scnprintf: 492 | DRIVER_STATE_PRINT_STR(chip.phy_fw_ver_str); which is defined as: | #define DRIVER_STATE_PRINT_STR(x) DRIVER_STATE_PRINT(x, "%s") ... | #define DRIVER_STATE_PRINT(x, fmt) \ | (res += scnprintf(buf + res, DRIVER_STATE_BUF_LEN - res,\ | #x " = " fmt "\n", wl->x)) We can also see that NUL-padding is not required. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. The very fact that a plain-english comment had to be made alongside a manual NUL-byte assignment for such a simple purpose shows why strncpy is faulty. It has non-obvious behavior that has to be clarified every time it is used (and if it isn't then the reader suffers). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231018-strncpy-drivers-net-wireless-ti-wl18xx-main-c-v2-1-ab828a491ce5@google.com commit 70bd8e0d01f6c098a72bdd799907c5208ccb8dfe Author: Justin Stitt Date: Wed Oct 18 21:15:23 2023 +0000 wifi: wl1251: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. Based on other assignments of similar fw_version fields we can see that NUL-termination is required but not NUL-padding: ethernet/intel/ixgbe/ixgbe_ethtool.c 1111: strscpy(drvinfo->fw_version, adapter->eeprom_id, 1112: sizeof(drvinfo->fw_version)); ethernet/intel/igc/igc_ethtool.c 147: scnprintf(adapter->fw_version, 148: sizeof(adapter->fw_version), 153: strscpy(drvinfo->fw_version, adapter->fw_version, 154: sizeof(drvinfo->fw_version)); wireless/broadcom/brcm80211/brcmfmac/core.c 569: strscpy(info->fw_version, drvr->fwver, sizeof(info->fw_version)); wireless/broadcom/brcm80211/brcmsmac/main.c 7867: snprintf(wlc->wiphy->fw_version, 7868: sizeof(wlc->wiphy->fw_version), "%u.%u", rev, patch); wireless/broadcom/b43legacy/main.c 1765: snprintf(wiphy->fw_version, sizeof(wiphy->fw_version), "%u.%u", wireless/broadcom/b43/main.c 2730: snprintf(wiphy->fw_version, sizeof(wiphy->fw_version), "%u.%u", wireless/intel/iwlwifi/dvm/main.c 1465: snprintf(priv->hw->wiphy->fw_version, 1466: sizeof(priv->hw->wiphy->fw_version), wireless/intel/ipw2x00/ipw2100.c 5905: snprintf(info->fw_version, sizeof(info->fw_version), "%s:%d:%s", A suitable replacement is `strscpy` due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231018-strncpy-drivers-net-wireless-ti-wl1251-main-c-v2-1-67b63dfcb1b8@google.com commit 169b7acb847e8dc656cd2289a91ff668f72405a0 Author: Ming Yen Hsieh Date: Wed Oct 18 12:29:35 2023 +0800 wifi: mt76: mt7921: fix kernel panic by accessing invalid 6GHz channel info When the chip not support 6GHz capability, the channels of 6GHz information should not be updated. This caused a crash: [ 19.442078] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000014 [ 19.457535] Mem abort info: [ 19.465329] ESR = 0x0000000096000004 [ 19.473295] EC = 0x25: DABT (current EL), IL = 32 bits [ 19.482354] SET = 0, FnV = 0 [ 19.489143] EA = 0, S1PTW = 0 [ 19.495991] FSC = 0x04: level 0 translation fault [ 19.504554] Data abort info: [ 19.511111] ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000 [ 19.520269] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 [ 19.528988] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [ 19.537960] user pgtable: 4k pages, 48-bit VAs, pgdp=00000001027a9000 [ 19.548014] [0000000000000014] pgd=0000000000000000, p4d=000000000000 [ 19.558429] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP [ 19.568270] Modules linked in: mt7921e mt7921_common mt792x_lib mt76_connac_lib mt76 mac80211 btusb btintel cfg80211 btmtk snd_sof_ipc_msg_ btrtl snd_sof_ipc_flood_test btbcm bluetooth snd_sof_mt8195 uvcvideo mtk_adsp_common snd_sof_xtensa_dsp uvc snd_sof_of snd_sof videobuf2_vmalloc ecdh_generic ecc snd_sof_utils cros_ec_lid_angle cros_ec_sensors crct10dif_ cros_ec_sensors_core cros_usbpd_logger crypto_user fuse ip_tables ipv6 [ 19.614237] CPU: 1 PID: 105 Comm: kworker/1:1 Not tainted 6.6.0-rc6-next-20231017+ #324 [ 19.625957] Hardware name: Acer Tomato (rev2) board (DT) [ 19.634970] Workqueue: events mt7921_init_work [mt7921_common] [ 19.644522] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTY [ 19.655182] pc : mt7921_regd_notifier+0x180/0x290 [mt7921_common] [ 19.664983] lr : mt7921_regd_notifier+0xd4/0x290 [mt7921_common] [ 19.674679] sp : ffff800080acba80 [ 19.681649] x29: ffff800080acba80 x28: 0000000000000000 x27: ffff4faf [ 19.692483] x26: 0000000000000000 x25: 0000000000000000 x24: ffff4faf [ 19.703294] x23: 00000000ffffe926 x22: ffff4faf16031fa0 x21: 00000000 [ 19.714108] x20: 000000000000001c x19: ffff4faf16ba6f40 x18: 00000000 [ 19.724928] x17: 0000000000000000 x16: ffffac6b891c2750 x15: ffff8000 [ 19.735722] x14: 0000000000000180 x13: 0000000000000000 x12: 00000000 [ 19.746478] x11: 0000000000000002 x10: ffff4faf01c21780 x9 : ffffac6b [ 19.757214] x8 : 00000000006c0000 x7 : ffffac6b6b020cf0 x6 : ffffac6b [ 19.767945] x5 : ffffac6b6b020d00 x4 : ffffac6b6b020cf8 x3 : ffff4faf [ 19.778648] x2 : 0000000000000000 x1 : 000000000000001c x0 : 00000000 [ 19.789366] Call trace: [ 19.795381] mt7921_regd_notifier+0x180/0x290 [mt7921_common] [ 19.804675] wiphy_update_regulatory+0x2bc/0xa08 [cfg80211] [ 19.813864] wiphy_regulatory_register+0x4c/0x88 [cfg80211] [ 19.823029] wiphy_register+0x75c/0x8d0 [cfg80211] [ 19.831446] ieee80211_register_hw+0x70c/0xc10 [mac80211] [ 19.840479] mt76_register_device+0x168/0x2e8 [mt76] [ 19.849008] mt7921_init_work+0xdc/0x250 [mt7921_common] [ 19.857817] process_one_work+0x148/0x3c0 [ 19.865292] worker_thread+0x32c/0x450 [ 19.872489] kthread+0x11c/0x128 [ 19.879173] ret_from_fork+0x10/0x20 [ 19.886153] Code: f0000041 9100a021 94000aef aa0003f9 (b9401780) [ 19.895634] ---[ end trace 0000000000000000 ]--- Reported-by: AngeloGioacchino Del Regno Closes: https://lore.kernel.org/all/927e7d50-826d-4c92-9931-3c59b18c6945@collabora.com/ Fixes: 09382d8f8641 ("wifi: mt76: mt7921: update the channel usage when the regd domain changed") Signed-off-by: Ming Yen Hsieh Signed-off-by: Deren Wu Tested-by: AngeloGioacchino Del Regno Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/cf77a58a60d81c77a28388bc8d312b87ffb48434.1697603002.git.deren.wu@mediatek.com commit 8890b9bca38f16274bd3f612986f78f81a886c8b Author: Justin Stitt Date: Tue Oct 17 21:48:15 2023 +0000 wifi: ipw2x00: replace deprecated strncpy with strscpy_pad strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. `extra` is intended to be NUL-terminated which is evident by the manual assignment of a NUL-byte as well as its immediate usage with strlen(). Moreover, many of these getters and setters are NUL-padding buffers with memset(): 2439 | memset(&tx_power, 0, sizeof(tx_power)); 9998 | memset(sys_config, 0, sizeof(struct ipw_sys_config)); 10084 | memset(tfd, 0, sizeof(*tfd)); 10261 | memset(&dummystats, 0, sizeof(dummystats)); ... let's maintain this behavior and NUL-pad our destination buffer. Considering the above, a suitable replacement is `strscpy_pad` due to the fact that it guarantees both NUL-termination and NUL-padding on the destination buffer. To be clear, there is no bug in the current implementation as MAX_WX_STRING is much larger than the size of the string literals being copied from. Also, strncpy() does NUL-pad the destination buffer and using strscpy_pad() simply matches that behavior. All in all, there should be no functional change but we are one step closer to eliminating usage of strncpy(). Do note that we cannot use the more idiomatic strscpy invocation of (dest, src, sizeof(dest)) as the destination buffer cannot have its size determined at compile time. So, let's stick with (dest, src, LEN). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231017-strncpy-drivers-net-wireless-intel-ipw2x00-ipw2200-c-v2-1-465e10dc817c@google.com commit 69708fbb2c698f262e03360d064c7066e0679953 Author: Shiji Yang Date: Sat Oct 14 14:55:01 2023 +0800 wifi: rt2x00: fix rt2800 watchdog function The watchdog function is broken on rt2800 series SoCs. This patch fixes the incorrect watchdog logic to make it work again. 1. Update current wdt queue index if it's not equal to the previous index. Watchdog compares the current and previous queue index to judge if the queue hung. 2. Make sure hung_{rx,tx} 'true' status won't be override by the normal queue. Any queue hangs should trigger a reset action. 3. Clear the watchdog counter of all queues before resetting the hardware. This change may help to avoid the reset loop. 4. Change hang check function return type to bool as we only need to return two status, yes or no. Signed-off-by: Shiji Yang Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/TYAP286MB0315BC1D83D31154924F0D39BCD1A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM commit 359342795d62548f3ba4831914fccf20a24446b5 Author: Kalle Valo Date: Thu Oct 12 16:58:54 2023 +0300 wifi: ath9k_htc: fix format-truncation warning On v6.6-rc4 with GCC 13.2 I see: drivers/net/wireless/ath/ath9k/hif_usb.c:1223:42: warning: '.0.fw' directive output may be truncated writing 5 bytes into a region of size between 4 and 11 [-Wformat-truncation=] drivers/net/wireless/ath/ath9k/hif_usb.c:1222:17: note: 'snprintf' output between 27 and 34 bytes into a destination of size 32 Fix it by increasing the size of the fw_name field to 64 bytes. Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231012135854.3473332-3-kvalo@kernel.org commit c253e43e10783f0cf2da330ccf48fa7e96346234 Author: Kalle Valo Date: Thu Oct 12 16:58:53 2023 +0300 wifi: ipw2x00: fix format-truncation warnings On v6.6-rc4 with GCC 13.2 I see: drivers/net/wireless/intel/ipw2x00/ipw2100.c:5905:63: warning: '%s' directive output may be truncated writing up to 63 bytes into a region of size 32 [-Wformat-truncation=] drivers/net/wireless/intel/ipw2x00/ipw2100.c:5905:9: note: 'snprintf' output between 4 and 140 bytes into a destination of size 32 drivers/net/wireless/intel/ipw2x00/ipw2200.c:10392:63: warning: '%s' directive output may be truncated writing up to 63 bytes into a region of size 32 [-Wformat-truncation=] drivers/net/wireless/intel/ipw2x00/ipw2200.c:10392:9: note: 'snprintf' output between 4 and 98 bytes into a destination of size 32 Fix this by copying only the firmware version and not providing any extra information via ethtool. This is an ancient driver anyway and most likely removed soon so it doesn't really matter. Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231012135854.3473332-2-kvalo@kernel.org commit fab22496c9827b46b83833d4eb2c7c923502c78b Author: Kalle Valo Date: Thu Oct 12 16:58:52 2023 +0300 wifi: brcmfmac: fix format-truncation warnings On v6.6-rc4 with GCC 13.2 I see: drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:262:52: warning: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size 4 [-Wformat-truncation=] drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:262:46: note: directive argument in the range [0, 65535] drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:262:46: note: directive argument in the range [0, 65535] drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:262:9: note: 'snprintf' output between 9 and 17 bytes into a destination of size 9 drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:265:55: warning: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size 4 [-Wformat-truncation=] drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:265:48: note: directive argument in the range [0, 65535] drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:265:48: note: directive argument in the range [0, 65535] drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:265:9: note: 'snprintf' output between 10 and 18 bytes into a destination of size 10 drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:342:50: warning: '/' directive output may be truncated writing 1 byte into a region of size between 0 and 4 [-Wformat-truncation=] drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:342:42: note: directive argument in the range [0, 65535] drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:342:9: note: 'snprintf' output between 10 and 18 bytes into a destination of size 10 Fix these by increasing the buffer sizes to 20 bytes to make sure there's enough space. Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231012135854.3473332-1-kvalo@kernel.org commit 805b196fb3bceda87f785ac34824fff9246c800f Author: Tadeusz Struk Date: Mon Oct 23 10:40:50 2023 +0200 PCI/P2PDMA: Remove redundant goto Remove redundant goto in pci_alloc_p2pmem(). Link: https://lore.kernel.org/r/20231023084050.55230-1-tstruk@gmail.com Signed-off-by: Tadeusz Struk Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit d6e48462e88fe7efc78b455ecde5b0ca43ec50b7 Author: Rob Herring Date: Thu Oct 19 13:23:45 2023 -0500 net: mdio: xgene: Fix unused xgene_mdio_of_match warning for !CONFIG_OF Commit a243ecc323b9 ("net: mdio: xgene: Use device_get_match_data()") dropped the unconditional use of xgene_mdio_of_match resulting in this warning: drivers/net/mdio/mdio-xgene.c:303:34: warning: unused variable 'xgene_mdio_of_match' [-Wunused-const-variable] The fix is to drop of_match_ptr() which is not necessary because DT is always used for this driver (well, it could in theory support ACPI only, but CONFIG_OF is always enabled for arm64). Fixes: a243ecc323b9 ("net: mdio: xgene: Use device_get_match_data()") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310170832.xnVXw1bb-lkp@intel.com/ Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231019182345.833136-1-robh@kernel.org Signed-off-by: Jakub Kicinski commit c0119e62b2fe990a512a5ab8fb7c30e28fa619b8 Author: Jakub Kicinski Date: Fri Oct 20 15:18:27 2023 -0700 tools: ynl-gen: change spacing around __attribute__ checkpatch gets confused and treats __attribute__ as a function call. It complains about white space before "(": WARNING:SPACING: space prohibited between function name and open parenthesis '(' + struct netdev_queue_get_rsp obj __attribute__ ((aligned (8))); No spaces wins in the kernel: $ git grep 'attribute__((.*aligned(' | wc -l 480 $ git grep 'attribute__ ((.*aligned (' | wc -l 110 $ git grep 'attribute__ ((.*aligned(' | wc -l 94 $ git grep 'attribute__((.*aligned (' | wc -l 63 So, whatever, change the codegen. Note that checkpatch also thinks we should use __aligned(), but this is user space code. Link: https://lore.kernel.org/all/202310190900.9Dzgkbev-lkp@intel.com/ Acked-by: Stanislav Fomichev Reviewed-by: Amritha Nambiar Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231020221827.3436697-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit b7c4f5730a9fa258c8e79f6387a03f3a95c681a2 Author: Sabrina Dubroca Date: Fri Oct 20 16:00:55 2023 +0200 tls: don't reset prot->aad_size and prot->tail_size for TLS_HW Prior to commit 1a074f7618e8 ("tls: also use init_prot_info in tls_set_device_offload"), setting TLS_HW on TX didn't touch prot->aad_size and prot->tail_size. They are set to 0 during context allocation (tls_prot_info is embedded in tls_context, kzalloc'd by tls_ctx_create). When the RX key is configured, tls_set_sw_offload is called (for both TLS_SW and TLS_HW). If the TX key is configured in TLS_HW mode after the RX key has been installed, init_prot_info will now overwrite the correct values of aad_size and tail_size, breaking SW decryption and causing -EBADMSG errors to be returned to userspace. Since TLS_HW doesn't use aad_size and tail_size at all (for TLS1.2, tail_size is always 0, and aad_size is equal to TLS_HEADER_SIZE + rec_seq_size), we can simply drop this hunk. Fixes: 1a074f7618e8 ("tls: also use init_prot_info in tls_set_device_offload") Signed-off-by: Sabrina Dubroca Acked-by: Jakub Kicinski Tested-by: Ran Rozenstein Link: https://lore.kernel.org/r/979d2f89a6a994d5bb49cae49a80be54150d094d.1697653889.git.sd@queasysnail.net Signed-off-by: Jakub Kicinski commit 34dbaa88cab121437d711bb7b9673c16eed4f922 Author: Mikulas Patocka Date: Tue Oct 3 13:34:54 2023 +0200 dm: make __send_duplicate_bios return unsigned int All the callers cast the value returned by __send_duplicate_bios to unsigned int type, so we can return unsigned int as well. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 18ac52332959aaf4bee54ee1b760959beeb13ae2 Author: Justin Stitt Date: Mon Sep 25 07:06:03 2023 +0000 dm log userspace: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. `lc` is already zero-allocated: | lc = kzalloc(sizeof(*lc), GFP_KERNEL); ... as such, any future NUL-padding is superfluous. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Let's also go with the more idiomatic `dest, src, sizeof(dest)` pattern for destination buffers that the compiler can calculate the size for. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Reviewed-by: Kees Cook Signed-off-by: Justin Stitt Signed-off-by: Mike Snitzer commit 0ffb645ea821fbad4215b6a5681b823639c24660 Author: Justin Stitt Date: Mon Sep 25 06:54:51 2023 +0000 dm ioctl: replace deprecated strncpy with strscpy_pad `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect `spec->target_type` to be NUL-terminated based on its use with a format string after `dm_table_add_target()` is called | r = dm_table_add_target(table, spec->target_type, | (sector_t) spec->sector_start, | (sector_t) spec->length, | target_params); ... wherein `spec->target_type` is passed as parameter `type` and later printed with DMERR: | DMERR("%s: %s: unknown target type", dm_device_name(t->md), type); It appears that `spec` is not zero-allocated and thus NUL-padding may be required in this ioctl context. Considering the above, a suitable replacement is `strscpy_pad` due to the fact that it guarantees NUL-termination whilst maintaining the NUL-padding behavior that strncpy provides. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Reviewed-by: Kees Cook Signed-off-by: Justin Stitt Signed-off-by: Mike Snitzer commit e9d7bd2c8664aa43866c7985d9050a052516c07d Author: Justin Stitt Date: Mon Sep 25 06:35:54 2023 +0000 dm crypt: replace open-coded kmemdup_nul kzalloc() followed by strncpy() on an expected NUL-terminated string is just kmemdup_nul(). Let's simplify this code (while also dropping a deprecated strncpy() call [1]). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Reviewed-by: Kees Cook Signed-off-by: Justin Stitt Signed-off-by: Mike Snitzer commit ac4149ba7efd6bc327c1e15e812091984f3a16b2 Author: Justin Stitt Date: Mon Sep 25 06:13:12 2023 +0000 dm cache metadata: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. It seems `cmd->policy_name` is intended to be NUL-terminated based on a now changed line of code from Commit (c6b4fcbad044e6ff "dm: add cache target"): | if (strcmp(cmd->policy_name, policy_name)) { // ... However, now a length-bounded strncmp is used: | if (strncmp(cmd->policy_name, policy_name, sizeof(cmd->policy_name))) ... which means NUL-terminated may not strictly be required. However, I believe the intent of the code is clear and we should maintain NUL-termination of policy_names. Moreover, __begin_transaction_flags() zero-allocates `cmd` before calling read_superblock_fields(): | cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); Also, `disk_super->policy_name` is zero-initialized | memset(disk_super->policy_name, 0, sizeof(disk_super->policy_name)); ... therefore any NUL-padding is redundant. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Reviewed-by: Kees Cook Signed-off-by: Justin Stitt Signed-off-by: Mike Snitzer commit 69a19170303ff2f802049be94cfcf62f714002a3 Author: Denys Zagorui Date: Thu Oct 19 04:35:21 2023 -0700 samples: bpf: Fix syscall_tp openat argument This modification doesn't change behaviour of the syscall_tp But such code is often used as a reference so it should be correct anyway Signed-off-by: Denys Zagorui Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20231019113521.4103825-1-dzagorui@cisco.com commit 61f85372d293241f4139731c14cab9ac8e9436fb Merge: 145d7e5ae8f4e 7242265213893 Author: Mark Brown Date: Mon Oct 23 17:56:55 2023 +0100 ASoc: Another series to convert to struct Merge series from Uwe Kleine-König : This is another series to convert ASoC drivers to use struct platform_driver:remove_new(). The rockchip one was already send before but with a wrong subject prefix, the cs42l43 driver is newer than the last series. The remaining five patches are for driver combos that my coccinelle patch failed to detect before. commit 09cda0a400519b1541591c506e54c9c48e3101bf Author: Heiko Carstens Date: Tue Oct 17 21:07:04 2023 +0200 s390/mm: add missing arch_set_page_dat() call to vmem_crst_alloc() If the cmma no-dat feature is available all pages that are not used for dynamic address translation are marked as "no-dat" with the ESSA instruction. This information is visible to the hypervisor, so that the hypervisor can optimize purging of guest TLB entries. This also means that pages which are used for dynamic address translation must not be marked as "no-dat", since the hypervisor may then incorrectly not purge guest TLB entries. Region and segment tables allocated via vmem_crst_alloc() are incorrectly marked as "no-dat", as soon as slab_is_available() returns true. Such tables are allocated e.g. when kernel page tables are split, memory is hotplugged, or a DCSS segment is loaded. Fix this by adding the missing arch_set_page_dat() call. Cc: Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 16ba44826a04834d3eeeda4b731c2ea3481062b7 Author: Heiko Carstens Date: Tue Oct 17 21:07:03 2023 +0200 s390/cmma: fix initial kernel address space page table walk If the cmma no-dat feature is available the kernel page tables are walked to identify and mark all pages which are used for address translation (all region, segment, and page tables). In a subsequent loop all other pages are marked as "no-dat" pages with the ESSA instruction. This information is visible to the hypervisor, so that the hypervisor can optimize purging of guest TLB entries. The initial loop however does not cover the complete kernel address space. This can result in pages being marked as not being used for dynamic address translation, even though they are. In turn guest TLB entries incorrectly may not be purged. Fix this by adjusting the end address of the kernel address range being walked. Cc: Reviewed-by: Claudio Imbrenda Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit c8b5d574fcea49e9974b7658d5337f93d1921f8c Author: Heiko Carstens Date: Wed Oct 18 12:33:05 2023 +0200 s390/diag: add missing virt_to_phys() translation to diag224() Diagnose 224 expects a physical address, but all users pass a virtual address. Translate the address to fix this. Reported-by: Mete Durlu Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit b20c8216c1e0d5a5a5c9f40df0cf9bbc795e84f1 Author: Heiko Carstens Date: Thu Oct 12 09:40:52 2023 +0200 s390/mm,fault: move VM_FAULT_ERROR handling to do_exception() Get rid of do_fault_error() and move its contents to do_exception(), which makes do_exception(). With removing do_fault_error() it is also possible to get rid of the handle_fault_error_nolock() wrapper. Instead rename do_no_context() to handle_fault_error_nolock(). In result the whole fault handling looks much more like on other architectures. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 7c194d84a9ce662426b2ecb59da54bb80c6b1d91 Author: Heiko Carstens Date: Thu Oct 12 09:40:51 2023 +0200 s390/mm,fault: remove VM_FAULT_BADMAP and VM_FAULT_BADACCESS Remove the last two private vm_fault reasons: VM_FAULT_BADMAP and VM_FAULT_BADACCESS. In order to achieve this add an si_code parameter to do_no_context() and it's wrappers and directly call the wrappers instead of relying on do_fault_error() handling. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit b61a0922b6dc7dfa6cef5c6d8ab1036826c43b8d Author: Heiko Carstens Date: Thu Oct 12 09:40:50 2023 +0200 s390/mm,fault: remove VM_FAULT_SIGNAL Remove VM_FAULT_SIGNAL and open-code it at the only two locations where it is used. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 0f86ac4ba71329936c44ef71222f1c50284a8928 Author: Heiko Carstens Date: Thu Oct 12 09:40:49 2023 +0200 s390/mm,fault: remove VM_FAULT_BADCONTEXT Remove VM_FAULT_BADCONTEXT and instead call do_no_context() via wrappers. This adds two new wrappers similar to what x86 has: handle_fault_error() and handle_fault_error_nolock(). Both of them simply call do_no_context(), while handle_fault_error() also unlocks mmap lock, which avoids adding lots of mmap_read_unlock() calls with this and subsequent patches. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 0f1a14e0348eb48e93e139af569944349b725f3f Author: Heiko Carstens Date: Thu Oct 12 09:40:48 2023 +0200 s390/mm,fault: simplify kfence fault handling do_no_context() can be simplified by removing its fault parameter, which is only used to decide if kfence_handle_page_fault() should be called. If the fault happened within the kernel space it is ok to always check if this happened on a page which was unmapped because of the kfence feature. Limiting the check to the VM_FAULT_BADCONTEXT case doesn't add any value. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 64ea33fb09f8fdcc9eb9f253906886a5801bb48a Author: Heiko Carstens Date: Thu Oct 12 09:40:47 2023 +0200 s390/mm,fault: call do_fault_error() only from do_exception() Remove duplicated fault error handling and handle it only once within do_exception(). Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 5db06565cad67442e4677e7c0da7f7dad1eccb03 Author: Heiko Carstens Date: Thu Oct 12 09:40:46 2023 +0200 s390/mm,fault: get rid of do_low_address() There is only one caller of do_low_address(). Given that this code is quite special just get rid of do_low_address, and add it to do_protection_exception() in order to make the code a bit more readable. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit cca12b427d43bb57be207d634e1d44e9792d1cb4 Author: Heiko Carstens Date: Thu Oct 12 09:40:45 2023 +0200 s390/mm,fault: remove VM_FAULT_PFAULT Handling of VM_FAULT_PFAULT and VM_FAULT_BADCONTEXT is nearly identical; the only difference is within do_no_context() where however the fault_type (KERNEL_FAULT vs GMAP_FAULT) makes sure that both types will be handled differently. Therefore it is possible to get rid of VM_FAULT_PFAULT and use VM_FAULT_BADCONTEXT instead. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit f67c2da9f1c2d56e3adab342fc39c00c0c5ec790 Author: Heiko Carstens Date: Thu Oct 12 09:40:44 2023 +0200 s390/mm,fault: use get_kernel_nofault() to dereference in dump_pagetable() The page table dumper uses get_kernel_nofault() to test if dereferencing page table entries is possible. Use the result, which is the required page table entry, instead of throwing it away and dereferencing a second time without any safe guard. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 5be05c35e72f7492105987e0231afab46b69935e Author: Heiko Carstens Date: Thu Oct 12 09:40:43 2023 +0200 s390/mm,fault: improve readability by using teid union Get rid of some magic numbers, and use the teid union and also some ptrace PSW defines to improve readability. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 44ae766353af6eb3007308b8565f39cd8d0dd19a Author: Heiko Carstens Date: Thu Oct 12 09:40:42 2023 +0200 s390/mm: move translation-exception identification structure to fault.h Move translation-exception identification structure to new fault.h header file, change it to a union, and change existing kvm code accordingly. The new union will be used by subsequent patches. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 4416d2ed816699b8e7491f1e8e8b15f69685af57 Author: Heiko Carstens Date: Thu Oct 12 09:40:41 2023 +0200 s390/mm,fault: use static key for store indication Generate slightly better code by using a static key to implement store indication. This allows to get rid of a memory access on the hot path. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 9641613f48bbf8626355118de58f96eec5aebf49 Author: Heiko Carstens Date: Thu Oct 12 09:40:40 2023 +0200 s390/mm,fault: use get_fault_address() everywhere Use the get_fault_address() helper function instead of open-coding it at many locations. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit ae626f686351d220d5eab746dc3a19e90bb1de9a Author: Heiko Carstens Date: Thu Oct 12 09:40:39 2023 +0200 s390/mm,fault: replace WARN_ON_ONCE() with unreachable() do_secure_storage_access() contains a switch statements which handles all possible return values from get_fault_type(). Therefore remove the pointless default case error handling and replace it with unreachable(). Reviewed-by: Janosch Frank Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 5c845de331d980d90c6d18028942812fa491fe69 Author: Heiko Carstens Date: Thu Oct 12 09:40:38 2023 +0200 s390/mm,fault: remove noinline attribute from all functions Remove all noinline attribute from all functions and leave the inlining decisions up to the compiler. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 4df5ec98581eb2271d940975186fbe5716158491 Author: Heiko Carstens Date: Thu Oct 12 09:40:37 2023 +0200 s390/mm,fault: remove line break chechpatch reports: CHECK: Alignment should match open parenthesis + if (IS_ENABLED(CONFIG_PGSTE) && gmap && + (flags & FAULT_FLAG_RETRY_NOWAIT)) { Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit e23c53467ba03a538f4e8f837ca80f0bb058a4ee Author: Heiko Carstens Date: Thu Oct 12 09:40:36 2023 +0200 s390/mm,fault: include linux/mmu_context.h Include linux/mmu_context.h instead asm/mmu_context.h. checkpatch reports: CHECK: Consider using #include instead of +#include Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 8dbc33dc81638cfcd8d3b4103ba315d76c3c2aff Author: Heiko Carstens Date: Thu Oct 12 09:40:35 2023 +0200 s390/mm,fault: have balanced braces, remove unnecessary blanks Remove unnecessary braces and also blanks after casts. Add braces to have balanced braces where missing. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 760f6511096c5e37e9c9cf240d1ad525259bac86 Author: Heiko Carstens Date: Thu Oct 12 09:40:34 2023 +0200 s390/mm,fault: use pr_warn(), pr_cont(), ... instead of open-coding Use pr_warn() and friends instead of open-coding with printk(). Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit c9b611bf6e576aa1a03ac097b74322af56cb7052 Author: Heiko Carstens Date: Thu Oct 12 09:40:33 2023 +0200 s390/mm,fault: use pr_warn_ratelimited() Use pr_warn_ratelimited() instead of printk_ratelimited(). checkpatch reports: WARNING: Prefer ... pr_warn_ratelimited(... to printk_ratelimited(KERN_WARNING ... + printk_ratelimited(KERN_WARNING Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 28f3e0002aeaf9b02ace41551c92dc1c04f0de6e Author: Heiko Carstens Date: Thu Oct 12 09:40:32 2023 +0200 s390/mm,fault: use __ratelimit() instead of printk_ratelimit() Just like other architectures make use __ratelimit() instead of printk_ratelimit(). Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 7c915a84e5e2cacf71f7328b940aa783c1b7f2e4 Author: Heiko Carstens Date: Thu Oct 12 09:40:31 2023 +0200 s390/mm,fault: reverse x-mas tree coding style Have reverse x-mas tree coding style for variables everywhere. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 3aad8c044297799bee37492fc9695aafd7513d0b Author: Heiko Carstens Date: Thu Oct 12 09:40:30 2023 +0200 s390/mm,fault: remove and improve comments, adjust whitespace Remove wrong, outdated, and pointless comments. Adjust wording for some comments, and adjust whitespace at some places. Reviewed-by: Claudio Imbrenda Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 04d402a453c37f74487d690d11caeccd59fdeb9f Author: Jeremy Linton Date: Tue Oct 17 00:23:21 2023 -0500 arm64: cpufeature: Change DBM to display enabled cores Now that we have the ability to display the list of cores with a feature when its selectivly enabled, lets convert DBM to use that as well. Signed-off-by: Jeremy Linton Link: https://lore.kernel.org/r/20231017052322.1211099-3-jeremy.linton@arm.com Signed-off-by: Catalin Marinas commit 23b727dc2092d4b0604347ff3f0a75705078058a Author: Jeremy Linton Date: Tue Oct 17 00:23:20 2023 -0500 arm64: cpufeature: Display the set of cores with a feature The AMU feature can be enabled on a subset of the cores in a system. Because of that, it prints a message for each core as it is detected. This becomes tedious when there are hundreds of cores. Instead, for CPU features which can be enabled on a subset of the present cores, lets wait until update_cpu_capabilities() and print the subset of cores the feature was enabled on. Signed-off-by: Jeremy Linton Reviewed-by: Ionela Voinescu Tested-by: Ionela Voinescu Reviewed-by: Punit Agrawal Tested-by: Punit Agrawal Link: https://lore.kernel.org/r/20231017052322.1211099-2-jeremy.linton@arm.com Signed-off-by: Catalin Marinas commit 60fd39af33d3f63c4c94bd06784ebdf0d883f5c9 Author: Will Deacon Date: Mon Oct 2 17:57:49 2023 +0100 scripts/faddr2line: Skip over mapping symbols in output from readelf Mapping symbols emitted in the readelf output can confuse the 'faddr2line' symbol size calculation, resulting in the erroneous rejection of valid offsets. This is especially prevalent when building an arm64 kernel with CONFIG_CFI_CLANG=y, where most functions are prefixed with a 32-bit data value in a '$d.n' section. For example: 447538: ffff800080014b80 548 FUNC GLOBAL DEFAULT 2 do_one_initcall 104: ffff800080014c74 0 NOTYPE LOCAL DEFAULT 2 $x.73 106: ffff800080014d30 0 NOTYPE LOCAL DEFAULT 2 $x.75 111: ffff800080014da4 0 NOTYPE LOCAL DEFAULT 2 $d.78 112: ffff800080014da8 0 NOTYPE LOCAL DEFAULT 2 $x.79 36: ffff800080014de0 200 FUNC LOCAL DEFAULT 2 run_init_process Adding a warning to do_one_initcall() results in: | WARNING: CPU: 0 PID: 1 at init/main.c:1236 do_one_initcall+0xf4/0x260 Which 'faddr2line' refuses to accept: $ ./scripts/faddr2line vmlinux do_one_initcall+0xf4/0x260 skipping do_one_initcall address at 0xffff800080014c74 due to size mismatch (0x260 != 0x224) no match for do_one_initcall+0xf4/0x260 Filter out these entries from readelf using a shell reimplementation of is_mapping_symbol(), so that the size of a symbol is calculated as a delta to the next symbol present in ksymtab. Suggested-by: Masahiro Yamada Signed-off-by: Will Deacon Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20231002165750.1661-4-will@kernel.org Signed-off-by: Josh Poimboeuf commit 86bf86e19d308a1dba41e5f1f7e8cc105a5efa49 Author: Will Deacon Date: Mon Oct 2 17:57:48 2023 +0100 scripts/faddr2line: Use LLVM addr2line and readelf if LLVM=1 GNU utilities cannot necessarily parse objects built by LLVM, which can result in confusing errors when using 'faddr2line': $ CROSS_COMPILE=aarch64-linux-gnu- ./scripts/faddr2line vmlinux do_one_initcall+0xf4/0x260 aarch64-linux-gnu-addr2line: vmlinux: unknown type [0x13] section `.relr.dyn' aarch64-linux-gnu-addr2line: DWARF error: invalid or unhandled FORM value: 0x25 do_one_initcall+0xf4/0x260: aarch64-linux-gnu-addr2line: vmlinux: unknown type [0x13] section `.relr.dyn' aarch64-linux-gnu-addr2line: DWARF error: invalid or unhandled FORM value: 0x25 $x.73 at main.c:? Although this can be worked around by setting CROSS_COMPILE to "llvm=-", it's cleaner to follow the same syntax as the top-level Makefile and accept LLVM= as an indication to use the llvm- tools, optionally specifying their location or specific version number. Suggested-by: Masahiro Yamada Signed-off-by: Will Deacon Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20231002165750.1661-3-will@kernel.org Signed-off-by: Josh Poimboeuf commit 180af1a5bdaf8d4964837a46a9fce8c3a7fd2d97 Author: Will Deacon Date: Mon Oct 2 17:57:47 2023 +0100 scripts/faddr2line: Don't filter out non-function symbols from readelf As Josh points out in 20230724234734.zy67gm674vl3p3wv@treble: > Problem is, I think the kernel's symbol printing code prints the > nearest kallsyms symbol, and there are some valid non-FUNC code > symbols. For example, syscall_return_via_sysret. so we shouldn't be considering only 'FUNC'-type symbols in the output from readelf. Drop the function symbol type filtering from the faddr2line outer loop. Suggested-by: Josh Poimboeuf Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20230724234734.zy67gm674vl3p3wv@treble Signed-off-by: Will Deacon Link: https://lore.kernel.org/r/20231002165750.1661-2-will@kernel.org Signed-off-by: Josh Poimboeuf commit 7ba2b17a87466e1410ae0ccc94d8eb381de177c2 Author: Andi Shyti Date: Mon Jun 12 00:56:59 2023 +0200 i2c: stm32f7: Use devm_clk_get_enabled() Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Acked-by: Alain Volmat Signed-off-by: Wolfram Sang commit 06c5a1d68f540ea056f8c4d07020a938619cd5be Author: Andi Shyti Date: Mon Jun 12 00:56:58 2023 +0200 i2c: stm32f4: Use devm_clk_get_enabled() Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Acked-by: Alain Volmat Signed-off-by: Wolfram Sang commit a0536c67965dafe3d84a7700160b7a67ca3e4f45 Author: Alain Volmat Date: Mon Oct 23 10:50:15 2023 +0200 i2c: stm32f7: add description of atomic in struct stm32f7_i2c_dev Add missing description of the atomic boolean in struct stm32f7_i2c_dev. Signed-off-by: Alain Volmat Signed-off-by: Wolfram Sang commit 6af79f7fe748fe6a3c5c3a63d7f35981a82c2769 Author: Wolfram Sang Date: Fri Sep 29 11:19:52 2023 +0200 i2c: fix memleak in i2c_new_client_device() Yang Yingliang reported a memleak: === I got memory leak as follows when doing fault injection test: unreferenced object 0xffff888014aec078 (size 8): comm "xrun", pid 356, jiffies 4294910619 (age 16.332s) hex dump (first 8 bytes): 31 2d 30 30 31 63 00 00 1-001c.. backtrace: [<00000000eb56c0a9>] __kmalloc_track_caller+0x1a6/0x300 [<000000000b220ea3>] kvasprintf+0xad/0x140 [<00000000b83203e5>] kvasprintf_const+0x62/0x190 [<000000002a5eab37>] kobject_set_name_vargs+0x56/0x140 [<00000000300ac279>] dev_set_name+0xb0/0xe0 [<00000000b66ebd6f>] i2c_new_client_device+0x7e4/0x9a0 If device_register() returns error in i2c_new_client_device(), the name allocated by i2c_dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. === I think this solution is less intrusive and more robust than he originally proposed solutions, though. Reported-by: Yang Yingliang Closes: http://patchwork.ozlabs.org/project/linux-i2c/patch/20221124085448.3620240-1-yangyingliang@huawei.com/ Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit 8c906cc0aea53aaa7178ca58780e32c14564c139 Author: Camel Guo Date: Mon Sep 12 10:59:43 2022 +0200 i2c: exynos5: Calculate t_scl_l, t_scl_h according to i2c spec Previously the duty cycle was divided equally into h_scl_l, t_scl_h. This makes the low period of the SCL clock in Fast Mode is only 1.25us which is way lower than the minimal value (1.3) specified in i2c specification. In order to make sure t_scl_l, t_scl_h always fullfill i2c specification, this commit calculates t_scl_l using this formula: t_scl_l = clk_cycle * ((t_low_min + (scl_clock - t_low_min - t_high_min) / 2) / scl_clock) where: t_low_min is the minimal value of low period of the SCL clock in us; t_high_min is the minimal value of high period of the SCL clock in us; scl_clock is converted from SCL clock frequency into us. Signed-off-by: Camel Guo Tested-by: Marek Szyprowski Reviewed-by: Marek Szyprowski Signed-off-by: Wolfram Sang commit f70a6691751ce6af4d6d8f2273609ed330ee5ef9 Author: Simon Ser Date: Wed Jul 12 13:57:26 2023 +0000 drm/doc: use cross-references for macros These will show up as monospace, and will get linkified as soon as we document the macro they point to. Signed-off-by: Simon Ser Acked-by: Daniel Vetter Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/20230712135723.173506-1-contact@emersion.fr commit f2971219a9caf7bdb675ab41f13957ff6a3bf563 Author: Dario Binacchi Date: Mon Oct 23 10:59:20 2023 +0200 drm/vc4: fix typo Replace 'pack' with 'back'. Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for Raspberry Pi.") Signed-off-by: Dario Binacchi Reviewed-by: Dave Stevenson Reviewed-by: Bagas Sanjaya Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20231023085929.1445594-1-dario.binacchi@amarulasolutions.com commit 942a4a61b64e182d756a1a5776aa500d3b3d862f Author: Justin Stitt Date: Fri Oct 20 17:52:43 2023 +0000 platform/x86: thinkpad_acpi: replace deprecated strncpy with memcpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous interfaces. We expect ec_fw_string to be NUL-terminated based on its use with format strings in thinkpad_acpi.c: 11241 | pr_notice("ThinkPad firmware release %s doesn't match the known patterns\n", 11242 | ec_fw_string); Moreover, NUL-padding is not required since ec_fw_string is explicitly zero-initialized: 11185 | char ec_fw_string[18] = {0}; When carefully copying bytes from one buffer to another in pre-determined blocks (like what's happening here with dmi_data): | static void find_new_ec_fwstr(const struct dmi_header *dm, void *private) | { | char *ec_fw_string = (char *) private; | const char *dmi_data = (const char *)dm; | /* | * ThinkPad Embedded Controller Program Table on newer models | * | * Offset | Name | Width | Description | * ---------------------------------------------------- | * 0x00 | Type | BYTE | 0x8C | * 0x01 | Length | BYTE | | * 0x02 | Handle | WORD | Varies | * 0x04 | Signature | BYTEx6 | ASCII for "LENOVO" | * 0x0A | OEM struct offset | BYTE | 0x0B | * 0x0B | OEM struct number | BYTE | 0x07, for this structure | * 0x0C | OEM struct revision | BYTE | 0x01, for this format | * 0x0D | ECP version ID | STR ID | | * 0x0E | ECP release date | STR ID | | */ | | /* Return if data structure not match */ | if (dm->type != 140 || dm->length < 0x0F || | memcmp(dmi_data + 4, "LENOVO", 6) != 0 || | dmi_data[0x0A] != 0x0B || dmi_data[0x0B] != 0x07 || | dmi_data[0x0C] != 0x01) | return; | | /* fwstr is the first 8byte string */ | strncpy(ec_fw_string, dmi_data + 0x0F, 8); ... we shouldn't be using a C string api. Let's instead use memcpy() as this more properly relays the intended behavior. Do note that ec_fw_string will still end up being NUL-terminated since we are memcpy'ing only 8 bytes into a buffer full of 18 zeroes. There's still some trailing NUL-bytes there. To ensure this behavior, let's add a BUILD_BUG_ON checking the length leaves space for at least one trailing NUL-byte. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: Kees Cook Signed-off-by: Justin Stitt Reviewed-by: Mark Pearson Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231020-strncpy-drivers-platform-x86-thinkpad_acpi-c-v1-1-312f2e33034f@google.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 6a5c032c4b7e4262488703086ab280406dc51298 Author: Matthew Maurer Date: Mon Oct 9 22:42:54 2023 +0000 x86: Enable IBT in Rust if enabled in C These flags are not made conditional on compiler support because at the moment exactly one version of rustc supported, and that one supports these flags. Building without these additional flags will manifest as objtool printing a large number of errors about missing ENDBR and if CFI is enabled (not currently possible) will result in incorrectly structured function prefixes. Signed-off-by: Matthew Maurer Reviewed-by: Nick Desaulniers Acked-by: "Peter Zijlstra (Intel)" Link: https://lore.kernel.org/r/20231009224347.2076221-1-mmaurer@google.com Signed-off-by: Miguel Ojeda commit d97ae6474ca0411bb8c2696e5764ec946dba43d0 Merge: cefe8ce559b5f 8a77f38bcd28d a9930e85290ef 8a4c0c90f2796 0325e8a1282df b96e7a5fa0ba9 Author: Frederic Weisbecker Date: Mon Oct 23 15:24:11 2023 +0200 Merge branches 'rcu/torture', 'rcu/fixes', 'rcu/docs', 'rcu/refscale', 'rcu/tasks' and 'rcu/stall' into rcu/next rcu/torture: RCU torture, locktorture and generic torture infrastructure rcu/fixes: Generic and misc fixes rcu/docs: RCU documentation updates rcu/refscale: RCU reference scalability test updates rcu/tasks: RCU tasks updates rcu/stall: Stall detection updates commit 41a3056e4e73172d09dad6921e70d0f04b57cdf0 Author: Jaroslav Kysela Date: Fri Oct 20 09:12:47 2023 +0200 MAINTAINERS: ALSA: change mailing list to linux-sound on vger As discussed on alsa-devel mailing list [1], it is useful to have an open mailing list to avoid moderation delays for the kernel patch work. Use linux-sound mailing list for kernel driver related threads. In the first stage, change the list for the ALSA core, ASoC and tests. [1] https://lore.kernel.org/alsa-devel/20231019-posture-cache-fe060b@meerkat/ Signed-off-by: Jaroslav Kysela Reviewed-by: Mark Brown Acked-by: Ivan Orlov Acked-by: Konstantin Ryabitsev Link: https://lore.kernel.org/r/20231020071247.973909-1-perex@perex.cz Signed-off-by: Takashi Iwai commit 98408df6ad1fa14ad352f8d28d68eacdc94ca382 Author: Arnd Bergmann Date: Mon Oct 23 12:28:02 2023 +0200 clk: meson: S4: select CONFIG_COMMON_CLK_MESON_CLKC_UTILS Without this, the newly added drivers fail to link: aarch64-linux-ld: drivers/clk/meson/s4-pll.o: in function `meson_s4_pll_probe': s4-pll.c:(.text+0x13c): undefined reference to `meson_clk_hw_get' aarch64-linux-ld: drivers/clk/meson/s4-peripherals.o: in function `meson_s4_periphs_probe': s4-peripherals.c:(.text+0xb0): undefined reference to `meson_clk_hw_get' Fixes: e787c9c55eda ("clk: meson: S4: add support for Amlogic S4 SoC PLL clock driver") Reviewed-by: Jerome Brunet Reviewed-by: Neil Armstrong Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231023102810.4001943-1-arnd@kernel.org [jbrunet: use 12 char for the Fixes as recommended ] Signed-off-by: Jerome Brunet commit ab33c66fd8f124f7c4a35c96fcfbcd262764b0f6 Author: Robin Murphy Date: Fri Oct 20 18:51:27 2023 +0100 perf/arm-cmn: Enable per-DTC counter allocation Finally enable independent per-DTC-domain counter allocation, except on CMN-600 where we still need to cope with not knowing the domain topology and thus keep counter indices sychronised across domains. This allows users to simultaneously count up to 8 targeted events per domain, rather than 8 globally, for up to 4x wider coverage on maximum configurations. Even though this now looks deceptively simple, I stand by my previous assertion that it was a flippin' nightmare to implement; all the real head-scratchers are hidden in the foundations in the previous patch... Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/849f65566582cb102c6d0843d0f26e231180f8ac.1697824215.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 7633ec2c262fab3e7c5bf3cd3876b5748f584a57 Author: Robin Murphy Date: Fri Oct 20 18:51:26 2023 +0100 perf/arm-cmn: Rework DTC counters (again) The bitmap-based scheme for tracking DTC counter usage turns out to be a complete dead-end for its imagined purpose, since by the time we have to keep track of a per-DTC counter index anyway, we already have enough information to make the bitmap itself redundant. Revert the remains of it back to almost the original scheme, but now expanded to track per-DTC indices, in preparation for making use of them in anger. Note that since cycle count events always use a dedicated counter on a single DTC, we reuse the field to encode their DTC index directly. Signed-off-by: Robin Murphy Reviewed-by: Ilkka Koskinen Link: https://lore.kernel.org/r/5f6ade76b47f033836d7a36c03555da896dfb4a3.1697824215.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit e3e73f511c49c741f6309862c2248958ad77bbaa Author: Robin Murphy Date: Fri Oct 20 18:51:25 2023 +0100 perf/arm-cmn: Fix DTC domain detection It transpires that dtm_unit_info is another register which got shuffled in CMN-700 without me noticing. Fix that in a way which also proactively fixes the fragile laziness of its consumer, just in case any further fields ever get added alongside dtc_domain. Fixes: 23760a014417 ("perf/arm-cmn: Add CMN-700 support") Signed-off-by: Robin Murphy Reviewed-by: Ilkka Koskinen Link: https://lore.kernel.org/r/3076ee83d0554f6939fbb6ee49ab2bdb28d8c7ee.1697824215.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 6c4b39937f4e65688ea294725ae432b2565821ff Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:31 2023 +0900 misc: pci_endpoint_test: Add Device ID for R-Car S4-8 PCIe controller Add Renesas R8A779F0 in pci_device_id table so that pci-epf-test can be used for testing PCIe EP on R-Car S4-8. Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-16-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Acked-by: Manivannan Sadhasivam commit 6a87c0931b21074d2dc21809f01862493048a5cb Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:30 2023 +0900 MAINTAINERS: Update PCI DRIVER FOR RENESAS R-CAR for R-Car Gen4 Update this entry for R-Car Gen4's source code. Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-15-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Serge Semin Acked-by: Manivannan Sadhasivam commit e311b3834dfa73e1f3b5ae2dad0346c37692a9b2 Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:29 2023 +0900 PCI: rcar-gen4: Add endpoint mode support Add R-Car Gen4 PCIe controller for endpoint mode. This controller is based on Synopsys DesignWare PCIe. Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-14-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Manivannan Sadhasivam Reviewed-by: Serge Semin commit 0d0c551011df4519c232f7114cdace9000e86c51 Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:28 2023 +0900 PCI: rcar-gen4: Add R-Car Gen4 PCIe controller support for host mode Add R-Car Gen4 PCIe controller support for host mode. This controller is based on Synopsys DesignWare PCIe. However, this particular controller has a number of vendor-specific registers, and as such, requires initialization code like mode setting and retraining and so on. Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-13-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Manivannan Sadhasivam Reviewed-by: Serge Semin commit bad659dfd2f6bd342ca319ef8f99928b378f487f Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:27 2023 +0900 dt-bindings: PCI: renesas: Add R-Car Gen4 PCIe Endpoint Document bindings for Renesas R-Car Gen4 and R-Car S4-8 (R8A779F0) PCIe endpoint module. Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-12-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Reviewed-by: Serge Semin Acked-by: Conor Dooley Acked-by: Manivannan Sadhasivam commit 220cb6bef93031ee2fc795a7782e86fe65b7044b Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:26 2023 +0900 dt-bindings: PCI: renesas: Add R-Car Gen4 PCIe Host Document bindings for Renesas R-Car Gen4 and R-Car S4-8 (R8A779F0) PCIe host module. Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-11-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Reviewed-by: Serge Semin Acked-by: Conor Dooley commit 9197bf4bb93238ee23ab7fc84db57d9c474d61cf Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:25 2023 +0900 dt-bindings: PCI: dwc: Update maxItems of reg and reg-names Update maxItems of reg and reg-names on both host and endpoint for supporting Renesas R-Car Gen4 PCIe controllers later. Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-10-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Serge Semin Acked-by: Conor Dooley Acked-by: Manivannan Sadhasivam Acked-by: Rob Herring commit 9baa8a18e31b7167885c11c38841ce92bbe20f4f Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:24 2023 +0900 PCI: dwc: endpoint: Introduce .pre_init() and .deinit() Renesas R-Car Gen4 PCIe controllers require vendor-specific initialization before .init(). To use dw->dbi and dw->num-lanes in the initialization code, introduce .pre_init() into struct dw_pcie_ep_ops. While at it, also introduce .deinit() to disable the controller by using vendor-specific de-initialization. Note that the ep_init in the struct dw_pcie_ep_ops should be renamed to init later. Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-9-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Manivannan Sadhasivam Reviewed-by: Serge Semin commit 303e845351f5d2b4ff349bb3e59aba2b554d8229 Author: Yoshihiro Shimoda Date: Tue Sep 26 21:24:22 2023 +0900 PCI: dwc: Expose dw_pcie_write_dbi2() to module Since no PCIe controller drivers call this, this change is not required for now. But, Renesas R-Car Gen4 PCIe controller driver will call this and if the controller driver is built as a kernel module, the following build error happens: ERROR: modpost: "dw_pcie_write_dbi2" [drivers/pci/controller/dwc/pcie-rcar-gen4-host-drv.ko] undefined! So, expose dw_pcie_write_dbi2() for it. Link: https://lore.kernel.org/linux-pci/20230926122431.3974714-8-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Serge Semin commit 75223bbea840e125359fc63942b5f93462b474c6 Author: Vaishnav Achath Date: Fri Oct 13 14:56:29 2023 +0530 spi: omap2-mcspi: Add FIFO support without DMA Currently, the built-in 64-byte FIFO on the MCSPI controller is not enabled in PIO mode and is used only when DMA is enabled. Enable the FIFO in PIO mode by default for transactions larger than the FIFO depth and fallback only if FIFO is not available. When DMA is not enabled, it is efficient to enable the RX FIFO almost full and TX FIFO almost empty events after each FIFO fill instead of each word. Update omap2_mcspi_set_fifo() to enable the events accordingly and also rely on OMAP2_MCSPI_CHSTAT_RXS for the last transfer instead of the FIFO events to handle the case when the transfer size is not a multiple of FIFO depth. See J721E Technical Reference Manual (SPRUI1C), section 12.1.5 for further details: http://www.ti.com/lit/pdf/spruil1 Signed-off-by: Vaishnav Achath Link: https://lore.kernel.org/r/20231013092629.19005-1-vaishnav.a@ti.com Signed-off-by: Mark Brown commit ff5f76b820a95957df0420bba4c67b02978e6c52 Author: Gokhan Celik Date: Sun Oct 22 21:52:51 2023 +0300 regulator: dt-bindings: Add ADI MAX77503 support Add ADI MAX77503 buck converter devicetree document. Signed-off-by: Gokhan Celik Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/fb2cb32219eb1a5f85169d6c85cd2c057c5bb4a9.1698000185.git.gokhan.celik@analog.com Signed-off-by: Mark Brown commit a0c543bdf4ba4f10d21fb2d44a9abc5715184966 Author: Gokhan Celik Date: Sun Oct 22 21:52:50 2023 +0300 regulator: max77503: Add ADI MAX77503 support Add ADI MAX77503 buck converter driver support. Signed-off-by: Gokhan Celik Link: https://lore.kernel.org/r/10bb3894fea31a098d768e346c8721e730d7cb21.1698000185.git.gokhan.celik@analog.com Signed-off-by: Mark Brown commit 145d7e5ae8f4e553478232fe3095379b60fa5496 Author: Vijendar Mukunda Date: Fri Oct 20 11:58:15 2023 +0530 ASoC: SOF: amd: add option to use sram for data bin loading Provide an option to load DSP data bin to ACP SRAM. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20231020062822.3913760-5-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 135e0d49cde383395afcaf285d6304be9230a06f Author: Vijendar Mukunda Date: Fri Oct 20 11:58:14 2023 +0530 ASoC: SOF: amd: refactor acp dram usage for data bin loading DSP data bin can be loaded in to ACP DRAM or ACP SRAM. Add conditional check for ACP DRAM usage for data bin loading. Rename DRAM base address macro to have symmetry. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20231020062822.3913760-4-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 4dbee5104b7858e39d94b2512ab99b82b8feb894 Author: Vijendar Mukunda Date: Fri Oct 20 11:58:13 2023 +0530 ASoC: SOF: amd: increase DSP cache window range Increase DSP cache window range to 2.5MB to align with ACP memory. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20231020062822.3913760-3-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 848c0d34f70c4c9f6f166ec891d309936a26aa14 Author: Vijendar Mukunda Date: Fri Oct 20 11:58:12 2023 +0530 ASoC: SOF: amd: add support for acp6.3 based platform Add SOF support for ACP6.3 version based platform Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20231020062822.3913760-2-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit bb98b592cfd387eccc9430d4cd5ebc1678775a88 Author: Vijendar Mukunda Date: Fri Oct 20 11:58:11 2023 +0530 ASoC: amd: Add acpi machine id for acp6.3 version based platform Add acpi machine id for ACP6.3 version based platform and configure driver data to enable SOF sound card support on newer boards. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20231020062822.3913760-1-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 18562fc36c21d572582049e6259c43bf1a01f3e0 Author: Chris Morgan Date: Fri Oct 20 12:15:39 2023 -0500 ASoC: es8328: Use rounded rate for es8328_set_sysclk() I have a board (RK3588 based) that sets the sysclk to 12287999. The es8328 driver fails to match this to the 12288000 rate and fails to load. Allow the rate comparison to work if the frequency is within 100hz by dividing it by 100 and rounding it, then multiplying it back by 100. Note the 100hz value was chosen arbitrarily by me, but it has only been tested with a 1hz difference. Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20231020171539.65513-1-macroalpha82@gmail.com Signed-off-by: Mark Brown commit f1c406866af5dacdd9601cfa3be4873ebd801b86 Author: Weidong Wang Date: Fri Oct 20 16:34:24 2023 +0800 ASoC: codecs: Modify max_register usage error Modify the value of max_register, otherwirse the AW88261_EFRL1_REG register will not be accessible. Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20231020083426.302925-3-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit 7242265213893e053457240f833d06ecd75b7ab3 Author: Uwe Kleine-König Date: Sat Oct 14 00:19:53 2023 +0200 ASoC: uniphier: Make uniphier_aio_remove() return void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. uniphier_aio_remove() returned zero unconditionally. Make it return void instead and convert all users to struct platform_device::remove_new(). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231013221945.1489203-16-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit d0cc676c426d1958989fac2a0d45179fb9992f0a Author: Uwe Kleine-König Date: Sat Oct 14 00:19:52 2023 +0200 ASoC: qcom: lpass: Make asoc_qcom_lpass_cpu_platform_remove() return void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. asoc_qcom_lpass_cpu_platform_remove() returned zero unconditionally. Make it return void instead and convert all users to struct platform_device::remove_new(). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231013221945.1489203-15-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 8210f496c3e12410fa240c7fbc63f71ef78e253f Author: Uwe Kleine-König Date: Sat Oct 14 00:19:51 2023 +0200 ASoC: meson: Make meson_card_remove() return void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. meson_card_remove() returned zero unconditionally. Make it return void instead and convert all users to struct platform_device::remove_new(). Signed-off-by: Uwe Kleine-König Reviewed-by: Jerome Brunet Link: https://lore.kernel.org/r/20231013221945.1489203-14-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 393df6f321c757d164fa412b7eae527a8e2acb75 Author: Uwe Kleine-König Date: Sat Oct 14 00:19:50 2023 +0200 ASoC: simple-card-utils: Make simple_util_remove() return void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. simple_util_remove() returned zero unconditionally. Make it return void instead and convert all users to struct platform_device::remove_new(). Signed-off-by: Uwe Kleine-König Reviewed-by: Herve Codina Link: https://lore.kernel.org/r/20231013221945.1489203-13-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 6b02f5a6f1853c6d5f73b000afbc177f5ee59d9e Author: Uwe Kleine-König Date: Sat Oct 14 00:19:49 2023 +0200 ASoC: starfive/jh7110-pwmdac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231013221945.1489203-12-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 491a1132f5cb77c8f1abb44d9928f8f184fc3df7 Author: Uwe Kleine-König Date: Sat Oct 14 00:19:48 2023 +0200 ASoC: cs42l43: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231013221945.1489203-11-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 46dd58bef32dea55b663141858ca1659a85a1505 Author: Uwe Kleine-König Date: Sat Oct 14 00:19:47 2023 +0200 ASoC: rockchip: i2s_tdm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231013221945.1489203-10-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 7dd692217b861a8292ff8ac2c9d4458538fd6b96 Author: Mark Hasemeyer Date: Fri Oct 20 14:59:53 2023 -0600 ASoC: SOF: sof-pci-dev: Fix community key quirk detection Some Chromebooks do not populate the product family DMI value resulting in firmware load failures. Add another quirk detection entry that looks for "Google" in the BIOS version. Theoretically, PRODUCT_FAMILY could be replaced with BIOS_VERSION, but it is left as a quirk to be conservative. Cc: stable@vger.kernel.org Signed-off-by: Mark Hasemeyer Acked-by: Curtis Malainey Link: https://lore.kernel.org/r/20231020145953.v1.1.Iaf5702dc3f8af0fd2f81a22ba2da1a5e15b3604c@changeid Signed-off-by: Mark Brown commit 9e630efb5a4af56fdb15aa10405f5cfd3f5f5b83 Author: Zhang Shurong Date: Thu Oct 12 21:03:15 2023 +0800 ASoC: fsl: Fix PM disable depth imbalance in fsl_easrc_probe The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. We fix it by calling pm_runtime_disable when error returns. Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers") Signed-off-by: Zhang Shurong Link: https://lore.kernel.org/r/tencent_C0D62E6D89818179A02A04A0C248F0DDC40A@qq.com Signed-off-by: Mark Brown commit 07e78e2151886c0af385698add84e0465c1cff6d Author: Aubin Constans Date: Mon Sep 11 17:32:46 2023 +0200 MAINTAINERS: mmc: take over as maintainer of MCI & SDHCI MICROCHIP DRIVERS On the one hand Eugen has taken responsibilities outside Microchip, on the other hand I have some experience with the Microchip SDMMC SDHCI controller. Change Eugen as reviewer and take over maintainership of the SDHCI MICROCHIP DRIVER. Also, take over maintainership of its predecessor, that is the MCI MICROCHIP DRIVER. Signed-off-by: Aubin Constans Acked-by: Ludovic Desroches Acked-by: Nicolas Ferre Acked-by: Eugen Hristev Link: https://lore.kernel.org/r/20230911153246.137148-1-aubin.constans@microchip.com Signed-off-by: Ulf Hansson commit f3bd5932780091e214959ffdb1d91032ea4744be Author: Johannes Berg Date: Sun Oct 1 13:01:09 2023 +0300 wifi: mac80211: drop robust action frames before assoc To be able to more easily understand the code, drop robust action frames before being associated, even if there's no MFP in the end, as they are Class 3 Frames and shouldn't be transmitted in the first place. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231001125722.b2fd37083371.Ie9f4906e2f6c698989bce6681956ed2f9454f27c@changeid Signed-off-by: Johannes Berg commit e4e7e3af73694380f0d9a742d13b80598a3393e9 Author: Vinayak Yadawad Date: Tue Sep 26 16:02:22 2023 +0530 wifi: cfg80211: Allow AP/P2PGO to indicate port authorization to peer STA/P2PClient In 4way handshake offload, cfg80211_port_authorized enables driver to indicate successful 4way handshake to cfg80211 layer. Currently this path of port authorization is restricted to interface type NL80211_IFTYPE_STATION and NL80211_IFTYPE_P2P_CLIENT. This patch extends the support for NL80211_IFTYPE_AP and NL80211_IFTYPE_P2P_GO interfaces to authorize peer STA/P2P_CLIENT, whenever authentication is offloaded on the AP/P2P_GO interface. Signed-off-by: Vinayak Yadawad Link: https://lore.kernel.org/r/dee3b0a2b4f617e932c90bff4504a89389273632.1695721435.git.vinayak.yadawad@broadcom.com Signed-off-by: Johannes Berg commit cf912ca1a3c3d2e6fcacb6568e66f72cca05277d Author: Dmitry Antipov Date: Tue Oct 3 12:20:46 2023 +0300 wifi: iwlwifi: drop NULL pointer check in iwl_mvm_tzone_set_trip_temp() Since 'tz_device' is an in-place member of 'struct iwl_mvm', it can't be NULL and so relevant check may be dropped. Compile tested only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov Acked-by: Gregory Greenman Link: https://lore.kernel.org/r/20231003092048.24998-1-dmantipov@yandex.ru Signed-off-by: Johannes Berg commit 06f1372e8e7aad72449de2feaa2ae7f42ebde228 Author: Gregory Greenman Date: Sun Oct 22 17:55:56 2023 +0300 wifi: iwlwifi: bump FW API to 86 for AX/BZ/SC devices Start supporting API version 86 for new devices. Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231022173519.e2f720799600.I6e22188a47efe0cbb4e013259955c4019843799f@changeid Signed-off-by: Johannes Berg commit cb5666edab4e5712f5d6e798c28c55e404aaec46 Author: Daniel Gabay Date: Sun Oct 22 17:55:55 2023 +0300 wifi: iwlwifi: read DSM func 2 for specific RF types By definition, this DSM func is valid only for HR/JF RF types. Until now firmware ignored this bit (if set) on other than the above types, but in future firmware versions sending this bit will lead to firmware 0x3426 assert. Avoid that by verifying the HW in driver first. Signed-off-by: Daniel Gabay Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231022173519.eec3b5d6152f.Ibc7ffe5ef1c156d878f1300c6059c6c91b374114@changeid Signed-off-by: Johannes Berg commit d6144e2725cdbfd55ce2d402deec4b2c46582ad9 Author: Johannes Berg Date: Sun Oct 22 17:55:54 2023 +0300 wifi: iwlwifi: mvm: show dump even for pldr_sync Worst case it's extra (garbage) data, best case we see why things failed ... Seems the trade-off is better if we print it. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231022173519.30e614ecd540.I47324f555ebcf22d0dd0afa94e7ca0af53a9fdba@changeid Signed-off-by: Johannes Berg commit f1b1dd518721768f7b29ed5c729af13b8a530653 Author: Johannes Berg Date: Sun Oct 22 17:55:53 2023 +0300 wifi: iwlwifi: mvm: cycle FW link on chanctx removal When the vif is in MLD mode, we'll get a vif links change from non-zero to zero on disassociation, which removes all links in the firmware and adds the 'deflink' the driver/mac80211 has. This causes the firmware to clear some internal state. However, in non-MLD mode, this doesn't happen, and causes some state to be left around in firmware, which can particularly cause trouble with the ref-BSSID in multi-BSSID, leading to an assert later if immediately making a new multi-BSSID connection with a different ref-BSSID. Fix this by removing/re-adding the link in the non-MLD case when the channel is removed from the vif. This way, all of the state will get cleared out, even if we need the deflink, which is more for software architecture purposes than otherwise. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231022173519.90c82837ba4d.I341fa30c480f7673b14b48a0e29a2241472c2e13@changeid Signed-off-by: Johannes Berg commit 0b67ab5d4f6d143dbad52864853e919e2e7c7ba7 Author: Johannes Berg Date: Sun Oct 22 17:55:52 2023 +0300 wifi: iwlwifi: trace full frames with TX status request If upper layers requested a TX status, then the frames are more important, so trace frames in that case. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231022173519.0dfb60a2eaec.I3c3e46ed0eb05700a4d05d293f80d727354a402f@changeid Signed-off-by: Johannes Berg commit 658939fc68d3241f9a0019e224cd7154438c23f2 Author: Miri Korenblit Date: Sun Oct 22 17:55:51 2023 +0300 wifi: iwlwifi: empty overflow queue during flush If a TX queue has no space for new TX frames, the driver will keep these frames in the overflow queue, and during reclaim flow it will retry to send the frames from that queue. But if the reclaim flow was invoked from TX queue flush, we will also TX these frames, which is wrong as we don't want to TX anything after flush. This might also cause assert 0x125F when removing the queue, saying that the driver removes a non-empty queue Fix this by TXing the overflow queue's frames only if we are not in flush queue flow. Fixes: a44509805895 ("iwlwifi: move reclaim flows to the queue file") Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231022173519.caf06c8709d9.Ibf664ccb3f952e836f8fa461ea58fc08e5c46e88@changeid Signed-off-by: Johannes Berg commit 4a9bb5b4d94999af8a9156e7004cad28db8cde38 Author: Mukesh Sisodiya Date: Sun Oct 22 17:55:50 2023 +0300 wifi: iwlwifi: fw: Add support for UATS table in UHB Driver need to provide details of VLP, AFC AP type supported for the specific MCC to firmware. Driver will read the UATS (UHB AP type support) table from BIOS and sent to firmware using UATS_TABLE_CMD. Add the support for the same in the driver. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231022173519.eb6cf7be17b2.I8977a660564412056d9fd383d57b236cd4b22d00@changeid Signed-off-by: Johannes Berg commit 48a25b5d05bba140e2b8bfa7f222f81080dbf80f Author: Miri Korenblit Date: Sun Oct 22 17:55:49 2023 +0300 wifi: iwlwifi: mvm: add a print when sending RLC command Expand RLC logging to simplify the debug. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231022173519.ec227229263f.Iea36e64d4092e04ad561beb87002c7bb8c52596f@changeid Signed-off-by: Johannes Berg commit a2d450e383901c932108a4d17463b17967c238bd Author: Anjaneyulu Date: Sun Oct 22 17:55:48 2023 +0300 wifi: iwlwifi: mvm: debugfs for fw system stats Add debgufs handler for fw system statistics command. Signed-off-by: Anjaneyulu Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231022173519.e77efee7cd85.I99f370f26f94f73e06aec2a8eaf21ebcc82f60a9@changeid Signed-off-by: Johannes Berg commit b6e3d1ba4fcf02176846d03a930203d8133c0aaf Author: Anjaneyulu Date: Sun Oct 22 17:55:47 2023 +0300 wifi: iwlwifi: mvm: implement new firmware API for statistics The new firmware API uses a new command and notification, the command configures in which statistics types driver is interested and the notification is sent periodically. An additional change in the API is that most of the statistics data is accumulated and reported by the firmware per MLO link. Implement new command and notification handlers and adjust to per-link statistics. Signed-off-by: Anjaneyulu Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231022173519.8cc7df0ebff2.If1dcb57145841c5b3c68ed112bbfcd0201f7acc3@changeid Signed-off-by: Johannes Berg commit ea02a208cf4cefc38ebaaad168fe499e14408841 Author: Gregory Greenman Date: Tue Oct 17 12:16:49 2023 +0300 wifi: iwlwifi: mvm: fix regdb initialization In order to get regulatory domain, driver sends MCC_UPDATE_CMD to the FW. One of the parameters in the response is the status which can tell if the regdomain has changed or not. When iwl_mvm_init_mcc() is called during iwl_op_mode_mvm_start(), then sband is still NULL and channel parameters (i.e. chan->flags) cannot be initialized. When, further in the flow, iwl_mvm_update_mcc() is called during iwl_mvm_up(), it first checks if the regdomain has changed and then skips the update if it remains the same. But, since channel parameters weren't initialized yet, the update should be forced in this codepath. Fix that by adding a corresponding parameter to iwl_mvm_init_fw_regd(). Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.78b2c5b891b0.Iac49d52e0bfc0317372015607c63ea9276bbb188@changeid Signed-off-by: Johannes Berg commit ac0c6fdc4c56b669abc1c4a323f1c7a3a1422dd2 Author: Yedidya Benshimol Date: Tue Oct 17 12:16:48 2023 +0300 wifi: iwlwifi: mvm: update IGTK in mvmvif upon D3 resume During the D3 resume flow, all new rekeys are passed from the FW. Because the FW supports only one IGTK at a time, every IGTK rekey update should be done by removing the last IGTK. The mvmvif holds a pointer to the last IGTK for that reason and thus should be updated when a new IGTK is passed upon resume. Fixes: 04f78e242fff ("wifi: iwlwifi: mvm: Add support for IGTK in D3 resume flow") Signed-off-by: Yedidya Benshimol Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.8ceaf7e5ece7.Ief444f6a2703ed76648b4d414f12bb4130bab36e@changeid Signed-off-by: Johannes Berg commit ff8e3a40d78bc414213b2724ad775adf98780a5a Author: Emmanuel Grumbach Date: Tue Oct 17 12:16:47 2023 +0300 wifi: iwlwifi: mvm: simplify the reorder buffer The firmware / hardware of devices supporting RSS is able to report duplicates and packets that time out inside the reoder buffer. We can now remove all the complex logic that was implemented to keep all the Rx queues more the less synchronized: we used to send a message to all the queues through the firmware to teach the different queues about what is the current SSN every 2048 packets. Now that we rely on the firmware / hardware to detect duplicates, we can completely remove the code that did that in the driver and it has been reported that this code was spuriously dropping legit packets. Suggested-by: Sultan Alsawaf Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.54cf4d3d5956.Ic06a08c9fb1e1ec315a4b49d632b78b8474dab79@changeid Signed-off-by: Johannes Berg commit 29fa9a984b6d1075020f12071a89897fd62ed27f Author: Emmanuel Grumbach Date: Tue Oct 17 12:16:46 2023 +0300 wifi: iwlwifi: disable multi rx queue for 9000 Multi rx queue allows to spread the load of the Rx streams on different CPUs. 9000 series required complex synchronization mechanisms from the driver side since the hardware / firmware is not able to provide information about duplicate packets and timeouts inside the reordering buffer. Users have complained that for newer devices, all those synchronization mechanisms have caused spurious packet drops. Those packet drops disappeared if we simplify the code, but unfortunately, we can't have RSS enabled on 9000 series without this complex code. Remove support for RSS on 9000 so that we can make the code much simpler for newer devices and fix the bugs for them. The down side of this patch is a that all the Rx path will be routed to a single CPU, but this has never been an issue, the modern CPUs are just fast enough to cope with all the traffic. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.2917eb8b7af9.Iddd7dcf335387ba46fcbbb6067ef4ff9cd3755a7@changeid Signed-off-by: Johannes Berg commit ac139aa3483c2a20adfd78d950def062820aece1 Author: Benjamin Berg Date: Tue Oct 17 12:16:45 2023 +0300 wifi: iwlwifi: mvm: Return success if link could not be removed iwl_mvm_remove_link would return an error if the link could not be removed. However, doing so prevents recovery if a link was not uploaded to the FW in the first place and the link_info was not allocated or fw_link_id is not set. Returning success means that we can still try to continue with adding new links in change_vif_links. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.f89bc05aadf6.Idc8fbd671362d962c02b1df87fa6258733631580@changeid Signed-off-by: Johannes Berg commit e25bd1853cc8308158d97e5b3696ea3689fa0840 Author: Gregory Greenman Date: Tue Oct 17 12:16:44 2023 +0300 wifi: iwlwifi: mvm: fix size check for fw_link_id Check that fw_link_id does not exceed the size of link_id_to_link_conf array. There's no any codepath that can cause that, but it's still safer to verify in case fw_link_id gets corrupted. Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.3385bd11f423.I2d30fdb464f951c648217553c47901857a0046c7@changeid Signed-off-by: Johannes Berg commit 37fb29bd1f90f16d1abc95c0e9f0ff8eec9829ad Author: Johannes Berg Date: Tue Oct 17 12:16:43 2023 +0300 wifi: iwlwifi: pcie: synchronize IRQs before NAPI When we want to synchronize the NAPI, which was added in commit 5af2bb3168db ("wifi: iwlwifi: call napi_synchronize() before freeing rx/tx queues"), we also need to make sure we can't actually reschedule the NAPI. Yes, this happens while interrupts are disabled, but interrupts may still be running or pending. Also call iwl_pcie_synchronize_irqs() to ensure we won't reschedule the NAPI. Fixes: 4cf2f5904d97 ("iwlwifi: queue: avoid memory leak in reset flow") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.a0f4104b479a.Id5c50a944f709092aa6256e32d8c63b2b8d8d3ac@changeid Signed-off-by: Johannes Berg commit a634386cb8c6e1d5c1f12a1236f191e7f05d4e4d Author: Daniel Gabay Date: Tue Oct 17 12:16:42 2023 +0300 wifi: iwlwifi: add support for SNPS DPHYIP region type Add the required logic for parsing and dumping this new region. Signed-off-by: Daniel Gabay Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.c859539194e7.I965482de2871e28b09f4572f1aa87ae4e3b366be@changeid Signed-off-by: Johannes Berg commit 08365d3b9140c751a84f8027ac7d2e662958f768 Author: Johannes Berg Date: Tue Oct 17 12:16:41 2023 +0300 wifi: iwlwifi: mvm: fix netif csum flags We shouldn't advertise arbitrary checksum flags since we had to remove support for it due to broken hardware. Fixes: ec18e7d4d20d ("wifi: iwlwifi: mvm: use old checksum for Bz A-step") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.e37327f1a129.Iaee86b00db4db791cd90adaf15384b8c87d2ad49@changeid Signed-off-by: Johannes Berg commit a32973ee4f59ba7d943067dfbfd5405abdfdfe1f Author: Johannes Berg Date: Tue Oct 17 12:16:40 2023 +0300 wifi: iwlwifi: mvm: remove set_tim callback for MLD ops In new firmware, we don't need this any more and it won't be called any more by mac80211, since powersave handling is all done by firmware. Remove it from the MLD ops. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.1a1ded96ffc2.Ie49d3004acdd6299fb84346c76b2b2b2f195196b@changeid Signed-off-by: Johannes Berg commit 52f4bd183f5c4aef3dc2be77cf8e2cd97ea63d32 Author: Johannes Berg Date: Tue Oct 17 12:16:39 2023 +0300 wifi: iwlwifi: api: fix center_freq label in PHY diagram Somehow I managed to put the EHT line in the wrong place and also didn't indent the center_freq label correctly. Fix it. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.08ac3cf524c0.I538f424e1ab30f73b0af8381224f377893e15526@changeid Signed-off-by: Johannes Berg commit 085d33c53012866b6c088b69b603af7cf69c0a53 Author: Miri Korenblit Date: Tue Oct 17 12:16:38 2023 +0300 wifi: iwlwifi: support link id in SESSION_PROTECTION_NOTIF FW is introducing an API change in which link ID will be used for session protection notif. Add support for it. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.4c59b149086e.I74fe93a6337f4ec9d1bd6f791d315411ac5b40da@changeid Signed-off-by: Johannes Berg commit 1350658373106eace418eea673a058a0285f8334 Author: Miri Korenblit Date: Tue Oct 17 12:16:37 2023 +0300 wifi: iwlwifi: support link_id in SESSION_PROTECTION cmd FW is introducing an API change in which link ID will be used for session protection cmd. Add support for it. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.a3cb29ed0617.I85b8a85b0d9186d3dd4d704254e46775b0ccf7de@changeid Signed-off-by: Johannes Berg commit 236730413d5f71b6f224f1f6ca6ccba05a4d9107 Author: Miri Korenblit Date: Tue Oct 17 12:16:36 2023 +0300 wifi: iwlwifi: make time_events MLO aware As session protection API is moving to be per link instead of per mac, move the time events to be per link too. Since there is only one concurrent time event per mac, it feels unnecessary to have the time_event as a member of iwl_mvm_link_info. (That way we will have to iterate over all links each time we want to clear a time event, and also we will need mac80211 to tell us the link id when mgd_tx_complete() is called.) So leave this as a member of iwl_mvm_vif, but add the link id to the time_event structure. The link id in time_event will only be maintained and used for: 1. When SESSION_PROTECTION_CMD is supported (before it, we don't have MLO) 2. For time_events of types SESSION_PROTECT_CONF_ASSOC, SESSION_PROTECT_CONF_P2P_DEVICE_DISCOV, and SESSION_PROTECT_CONF_P2P_GO_NEGOTIATION (not for aux roc/ Hot Spot time_events). For P2P, non-MLO connections, and pre-MLD API, deflink id, meaning 0, will be used Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231017115047.21496bcacb18.I79d037325b4fae4c12a22d9477e53fc9c537ad46@changeid Signed-off-by: Johannes Berg commit e5dfb9416b6eecb19a3ee0277b0432aa0f9b9f7c Author: Johannes Berg Date: Fri Oct 20 09:38:28 2023 +0200 wifi: mac80211: fix another key installation error path Due to overlapping changes and merges, another error path ended up broken. Fix this one as well. Reported-by: Jakub Kicinski Signed-off-by: Johannes Berg commit 8e4687f6061ec00d16b06cb2ed6d2593cae19c46 Author: Kalle Valo Date: Thu Oct 12 14:42:29 2023 +0300 wifi: mac80211: rename struct cfg80211_rx_assoc_resp to cfg80211_rx_assoc_resp_data make htmldocs warns: Documentation/driver-api/80211/cfg80211:48: ./include/net/cfg80211.h:7290: WARNING: Duplicate C declaration, also defined at cfg80211:7251. Declaration is '.. c:function:: void cfg80211_rx_assoc_resp (struct net_device *dev, struct cfg80211_rx_assoc_resp *data)'. This is because there's a function named cfg80211_rx_assoc_resp() and a struct named cfg80211_rx_assoc_resp, see previous patch for more info. To workaround this rename the struct to cfg80211_rx_assoc_resp_data. The parameter for the function is named 'data' anyway so the naming here is consistent. Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231012114229.2931808-3-kvalo@kernel.org Signed-off-by: Johannes Berg commit 2703bc8513996e848b5aefa2deb1ff3baae5d79b Author: Kalle Valo Date: Thu Oct 12 14:42:28 2023 +0300 wifi: mac80211: rename ieee80211_tx_status() to ieee80211_tx_status_skb() make htmldocs warns: Documentation/driver-api/80211/mac80211:109: ./include/net/mac80211.h:5170: WARNING: Duplicate C declaration, also defined at mac80211:1117. Declaration is '.. c:function:: void ieee80211_tx_status (struct ieee80211_hw *hw, struct sk_buff *skb)'. This is because there's a function named ieee80211_tx_status() and a struct named ieee80211_tx_status. This has been discussed previously but no solution found: https://lore.kernel.org/all/20220521114629.6ee9fc06@coco.lan/ There's also a bug open for three years with no solution in sight: https://github.com/sphinx-doc/sphinx/pull/8313 So I guess we have no other solution than to a workaround this in the code, for example to rename the function to ieee80211_tx_status_skb() to avoid the name conflict. I got the idea for the name from ieee80211_tx_status_noskb() in which the skb is not provided as an argument, instead with ieee80211_tx_status_skb() the skb is provided. Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231012114229.2931808-2-kvalo@kernel.org Signed-off-by: Johannes Berg commit c3e5f5f60ef2da3976c77a4f389aeecc5cf31f6b Author: Miri Korenblit Date: Wed Oct 11 13:07:31 2023 +0300 wifi: iwlwifi: add support for activating UNII-1 in WW via BIOS There is a requirement from OEMs to support a new bit in DSM function 8, which will indicate that this device is an indoor one, and that it should activate UNII-1 (5.2GHz) sub band in the World Wide Geo Profile. Add support for this by reading this bit from BIOS and sending it to the FW. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.86d4ad178042.Ief40acc08b5482ff147fd17e74e36f1933e43def@changeid Signed-off-by: Johannes Berg commit 7b404c5cff3d4270fcd5212b6776c8484623ac74 Author: Johannes Berg Date: Wed Oct 11 13:07:30 2023 +0300 wifi: iwlwifi: mvm: remove TDLS stations from FW When we remove TDLS stations, we need to remove them from FW immediately, even while associated. Some previous refactoring here lost the sta ID condition, add it back. Fixes: 57974a55d995 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.933011e710a9.I77c069c781e8b2b698b86cc3f43fc3c7e2dde114@changeid Signed-off-by: Johannes Berg commit 43874283ce6c5bd32ac9d30878b2c96a974357cb Author: Johannes Berg Date: Wed Oct 11 13:07:29 2023 +0300 wifi: iwlwifi: mvm: fix iwl_mvm_mac_flush_sta() When I implemented iwl_mvm_mac_flush_sta() I completely botched it; it basically always happens after the iwl_mvm_sta_pre_rcu_remove() call, and that already clears mvm->fw_id_to_mac_id[] entries, so we cannot rely on those at iwl_mvm_mac_flush_sta() time. This means it never did anything. Fix this by just going through the station IDs and now with the new API for iwl_mvm_flush_sta(), call those. Fixes: a6cc6ccb1c8a ("wifi: iwlwifi: mvm: support new flush_sta method") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.0b5878e93118.I1093e60163052e7be64d2b01424097cd6a272979@changeid Signed-off-by: Johannes Berg commit 391762969769b089c808defc8fce5544a945f9eb Author: Johannes Berg Date: Wed Oct 11 13:07:28 2023 +0300 wifi: iwlwifi: mvm: change iwl_mvm_flush_sta() API This API is type unsafe and needs an extra parameter to know what kind of station was passed, so it has two, but really it only needs two values. Just pass the values instead of doing this type-unsafe dance, which will also make it better to use for multi-link. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.aeb3bf4204cd.I5b0e6d64a67455784bc8fbdaf9ceaf03699d9ce1@changeid Signed-off-by: Johannes Berg commit abea0d067d4c57e6506537249636c95e71c4ed28 Author: Haim Dreyfuss Date: Wed Oct 11 13:07:27 2023 +0300 wifi: iwlwifi: mvm: extend alive timeout to 2 seconds There are devices that need longer time to get the alive notification. Signed-off-by: Haim Dreyfuss Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.f1f0aa1794e6.I34a06ef24b642a32af69c0bd109694de469d5177@changeid Signed-off-by: Johannes Berg commit 34cc3a4a49a6908790234e87cde14cde1a1c5f91 Author: Emmanuel Grumbach Date: Wed Oct 11 13:07:26 2023 +0300 wifi: iwlwifi: mvm: fix the PHY context resolution for p2p device We seem to have an issue in case we had a BSS and a P2P device on channel 1 and then, the P2P device gets an ROC on channel 6. We would change the channel of the PHY context to channel 6 even if the BSS was using that same PHY context. Revamp that code and don't try to change a PHY context, it doesn't mean much for the firmware anyway. Just remove it and allocate a new one. This makes the logic easier to follow. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.4bc8b90d7be0.I1232dca3fe007362ec0ae0cf1d96217f2544e0d2@changeid Signed-off-by: Johannes Berg commit a32a84948e3b1bb9d76bb198e20c616c4b7810d7 Author: Emmanuel Grumbach Date: Wed Oct 11 13:07:25 2023 +0300 wifi: iwlwifi: mvm: fold the ref++ into iwl_mvm_phy_ctxt_add When we want to add a phy_ctxt, we need to increase the ref. Note that all the WARN_ONs are already in place: * We check that we don't add a context with ref != 0 * We check that we don't modify a context with ref = 0 Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.c19c07746b26.I5b0cbe0760811631a320218a10b88870b5bf0897@changeid Signed-off-by: Johannes Berg commit f3276ff0d498a364dfdff74cc1825b5f6e27f472 Author: Emmanuel Grumbach Date: Wed Oct 11 13:07:24 2023 +0300 wifi: iwlwifi: mvm: don't add dummy phy context From its very first stages of development, iwlmvm added all the PHY context immediately upon firmware boot. Then, all we needed to do is to modify the contexts. This was fine if the addition of a PHY context that we don't need is free. This was true until now. Newer devices will run calibrations upon the addition of a PHY context. Change the way we work with PHY context in iwlmvm. Fortunately, we already have all the ref counting in place so that it is not very hard to do. Also, since we now remove the PHY context before the link is removed (but after it has been de-activated of course), it'll confuse the firmware if we put the late phy_id into the LINK command that removes the link. Change this to put an invalid phy_id just like we do when we add a link that has no PHY context yet. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.55a1a78719be.I2032a7d227b57f4fc4370a2793476d47538404fd@changeid Signed-off-by: Johannes Berg commit df7e30980cb5250604a15f8861c251779ab8bc12 Author: Miri Korenblit Date: Wed Oct 11 13:07:23 2023 +0300 wifi: iwlwifi: mvm: cleanup MLO and non-MLO unification code bss_info_changed() callback of mac80211 was originally in both MLD and non-MLD API. Therefore, we extracted the common part to a function which receives a callback structure with the mode-specific (non-MLO\MLO) ops. Eventually, for MLO API, bss_info_changed() callback was split into 2 callbacks: link_info_changed() and vif_cfg_changed() so it is no longer in use for MLO, only for non-MLO. Remove the code that uses the mode-specific callback structure. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.b65fbcdb9295.I2a64a6f1178ee0466755d728addc77acbb2ed6f4@changeid Signed-off-by: Johannes Berg commit 67ac248e4db0a754ee85a7e41fa363b330df00e5 Author: Shaul Triebitz Date: Wed Oct 11 13:07:22 2023 +0300 wifi: iwlwifi: mvm: implement ROC version 3 Define the new API for ROC command and notification. Use ROC version 3 command and notificaiton for hotspot. Signed-off-by: Shaul Triebitz Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.0cff02aecc16.If0a89ddc6b2339988ff51efa6709d4a883569969@changeid Signed-off-by: Johannes Berg commit c8e01fe070d4e663f4040250c579723ca1edb7d6 Author: Alon Giladi Date: Wed Oct 11 13:07:21 2023 +0300 wifi: iwlwifi: send EDT table to FW Read the EDT (Energy detection threshold) optimization configuration table from BIOS using DSM Function and send it to FW. Signed-off-by: Alon Giladi Signed-off-by: Anjaneyulu Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.0b78ee48219a.I8ecbd39d258e2ee0514a7e28632f6c18fb798a83@changeid Signed-off-by: Johannes Berg commit 8f9a791a8edd87fa64b35037d9c3bce89a1b8d21 Author: Ilan Peer Date: Wed Oct 11 13:07:20 2023 +0300 wifi: iwlwifi: mvm: Fix key flags for IGTK on AP interface When an IGTK is installed for an AP interface, there is no station associated with it. However, the MFP flag must be set for the installed key as otherwise the FW wouldn't use it. Fix the security key flag to set the MFP flag also when the AP is an AP interface and the key index matches that of an IGTK. Fixes: 5c75a208c244 ("wifi: iwlwifi: mvm: support new key API") Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.f67005e2d4d2.I6832c6e87f3c79fff00689eb10a3a30810e1ee83@changeid Signed-off-by: Johannes Berg commit 8bbe27db8eb10a0f3650550a120fc535715d1463 Author: Matt Chen Date: Wed Oct 11 13:07:19 2023 +0300 wifi: iwlmvm: fw: Add new OEM vendor to tas approved list Add new oem/odm pair to tas approved vendors list when specified by platform. Signed-off-by: Matt Chen Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.a6f10aaae473.I65c3321535674bbc08d96200961a78fab5e7a09f@changeid Signed-off-by: Johannes Berg commit 574c5ef18e792af274c458d49762a4ed4e167144 Author: Ilan Peer Date: Wed Oct 11 13:07:18 2023 +0300 wifi: iwlwifi: mvm: Fix unreachable code path Fix unreachable code path that was introduced in the P2P Device linking refactoring. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.39d76eeea781.I2dc1fc6152a2cd4cf68827f4d3bf83e2293d3dfb@changeid Signed-off-by: Johannes Berg commit 5356b8c8f652039481e9569575e4491d594482f7 Author: Mukesh Sisodiya Date: Wed Oct 11 13:07:17 2023 +0300 wifi: iwlwifi: add new RF support for wifi7 Add the support for new RF based on step-id. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231011130030.d902aa8cfd1b.I7c7b357ba41c00015d6c6255b45b3d17549948f0@changeid Signed-off-by: Johannes Berg commit c3745ee2e3506b75051f9d427cba24d95f75d6bf Author: Gregory Greenman Date: Thu Oct 12 15:41:48 2023 +0300 wifi: iwlwifi: fw: increase fw_version string size In reality 64 bytes are enough to hold fw version string, but some compilers can complain (with W=1) that output may be truncated when building this string with snprintf. Increase the size to avoid this sort of warnings and state explicitely that we want the size to be trancated to 32 bytes. Signed-off-by: Gregory Greenman Tested-by: Kalle Valo Link: https://lore.kernel.org/r/20231012153950.f4465b4b4e2b.Idced2e8d63c492872edcde1a3ce2cdd6cc0f8eb7@changeid Signed-off-by: Johannes Berg commit 74a7c93f45abba538914a65dd2ef2ea7cf7150e2 Author: Johannes Berg Date: Thu Oct 12 12:34:47 2023 +0200 wifi: mac80211: fix change_address deadlock during unregister When using e.g. bonding, and doing a sequence such as # iw wlan0 set type __ap # ip link add name bond1 type bond # ip link set wlan0 master bond1 # iw wlan0 interface del we deadlock, since the wlan0 interface removal will cause bonding to reset the MAC address of wlan0. The locking would be somewhat difficult to fix, but since this only happens during removal, we can simply ignore the MAC address change at this time. Reported-by: syzbot+25b3a0b24216651bc2af@syzkaller.appspotmail.com Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20231012123447.9f9d7fd1f237.Ic3a5ef4391b670941a69cec5592aefc79d9c2890@changeid Signed-off-by: Johannes Berg commit 9118796dfa67a58d17281e019acab4f651eb8dfa Author: Gustavo A. R. Silva Date: Mon Oct 9 11:59:41 2023 -0600 wifi: mac80211: Add __counted_by for struct ieee802_11_elems and use struct_size() Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). While there, use struct_size() helper, instead of the open-coded version, to calculate the size for the allocation of the whole flexible structure including, of course, the flexible-array member. This code was found with the help of Coccinelle, and audited and fixed manually. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/ZSQ/jcmTAf/PKHg/@work Signed-off-by: Johannes Berg commit 19e67e01eb1e84f3529770d084b93f16a4894c42 Author: Patrick Whewell Date: Wed Jul 19 14:49:42 2023 -0700 media: venus: Fix firmware path for resources The firmware path for some of the resources is still the old format. This fixes the path to address the firmware correctly using the new .mbn format. Signed-off-by: Patrick Whewell Signed-off-by: Stanimir Varbanov Signed-off-by: Hans Verkuil commit 4c99885d592ea53f9d4872595858e3f14eaf0823 Author: Gustavo A. R. Silva Date: Mon Oct 9 12:42:05 2023 -0600 media: venus: hfi_cmds: Replace one-element array with flex-array member and use __counted_by Array `data` in `struct hfi_sfr` is being used as a fake flexible array at run-time: drivers/media/platform/qcom/venus/hfi_venus.c: 1033 p = memchr(sfr->data, '\0', sfr->buf_size); 1034 /* 1035 * SFR isn't guaranteed to be NULL terminated since SYS_ERROR indicates 1036 * that Venus is in the process of crashing. 1037 */ 1038 if (!p) 1039 sfr->data[sfr->buf_size - 1] = '\0'; 1040 1041 dev_err_ratelimited(dev, "SFR message from FW: %s\n", sfr->data); Fake flexible arrays are deprecated, and should be replaced by flexible-array members. So, replace one-element array with a flexible-array member in `struct hfi_sfr`. While there, also annotate array `data` with __counted_by() to prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). This results in no differences in binary output. This issue was found with the help of Coccinelle, and audited and fixed manually. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Stanimir Varbanov Signed-off-by: Hans Verkuil commit 0768a9dd809ef52440b5df7dce5a1c1c7e97abbd Author: Vikash Garodia Date: Thu Aug 10 07:55:04 2023 +0530 media: venus: hfi_parser: Add check to keep the number of codecs within range Supported codec bitmask is populated from the payload from venus firmware. There is a possible case when all the bits in the codec bitmask is set. In such case, core cap for decoder is filled and MAX_CODEC_NUM is utilized. Now while filling the caps for encoder, it can lead to access the caps array beyong 32 index. Hence leading to OOB write. The fix counts the supported encoder and decoder. If the count is more than max, then it skips accessing the caps. Cc: stable@vger.kernel.org Fixes: 1a73374a04e5 ("media: venus: hfi_parser: add common capability parser") Signed-off-by: Vikash Garodia Signed-off-by: Stanimir Varbanov Signed-off-by: Hans Verkuil commit 8d0b89398b7ebc52103e055bf36b60b045f5258f Author: Vikash Garodia Date: Thu Aug 10 07:55:03 2023 +0530 media: venus: hfi: add checks to handle capabilities from firmware The hfi parser, parses the capabilities received from venus firmware and copies them to core capabilities. Consider below api, for example, fill_caps - In this api, caps in core structure gets updated with the number of capabilities received in firmware data payload. If the same api is called multiple times, there is a possibility of copying beyond the max allocated size in core caps. Similar possibilities in fill_raw_fmts and fill_profile_level functions. Cc: stable@vger.kernel.org Fixes: 1a73374a04e5 ("media: venus: hfi_parser: add common capability parser") Signed-off-by: Vikash Garodia Signed-off-by: Stanimir Varbanov Signed-off-by: Hans Verkuil commit b18e36dfd6c935da60a971310374f3dfec3c82e1 Author: Vikash Garodia Date: Thu Aug 10 07:55:02 2023 +0530 media: venus: hfi: fix the check to handle session buffer requirement Buffer requirement, for different buffer type, comes from video firmware. While copying these requirements, there is an OOB possibility when the payload from firmware is more than expected size. Fix the check to avoid the OOB possibility. Cc: stable@vger.kernel.org Fixes: 09c2845e8fe4 ("[media] media: venus: hfi: add Host Firmware Interface (HFI)") Reviewed-by: Nathan Hebert Signed-off-by: Vikash Garodia Signed-off-by: Stanimir Varbanov Signed-off-by: Hans Verkuil commit 5e538fce33589da6d7cb2de1445b84d3a8a692f7 Author: Vikash Garodia Date: Thu Aug 10 07:55:01 2023 +0530 media: venus: hfi: add checks to perform sanity on queue pointers Read and write pointers are used to track the packet index in the memory shared between video driver and firmware. There is a possibility of OOB access if the read or write pointer goes beyond the queue memory size. Add checks for the read and write pointer to avoid OOB access. Cc: stable@vger.kernel.org Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") Signed-off-by: Vikash Garodia Signed-off-by: Stanimir Varbanov Signed-off-by: Hans Verkuil commit 3c8aaaa7557b1e33e6ef95a27a5d8a139dcd0874 Author: Dmitry Antipov Date: Mon Oct 9 20:04:49 2023 +0300 wifi: iwlwifi: check for kmemdup() return value in iwl_parse_tlv_firmware() In 'iwl_parse_tlv_firmware()', check for 'kmemdup()' return value when handling IWL_UCODE_TLV_CURRENT_PC and set the number of parsed entries only if an allocation was successful (just like it does with handling IWL_UCODE_TLV_CMD_VERSIONS above). Compile tested only. Signed-off-by: Dmitry Antipov Acked-by: Gregory Greenman Link: https://lore.kernel.org/r/20231009170453.149905-1-dmantipov@yandex.ru Signed-off-by: Johannes Berg commit 89141f965325de9aac3805cd506df788179b2809 Author: Dmitry Antipov Date: Wed Oct 4 18:30:29 2023 +0300 wifi: remove unused argument of ieee80211_get_tdls_action() Remove unused 'hdr_size' argument of 'ieee80211_get_tdls_action()' and adjust 'ieee80211_report_used_skb()' accordingly. Signed-off-by: Dmitry Antipov Link: https://lore.kernel.org/r/20231004153032.206134-1-dmantipov@yandex.ru Signed-off-by: Johannes Berg commit 35b9281fb710ea9fa47dca56774f4a9606fe9154 Author: Ilan Peer Date: Wed Oct 4 12:36:34 2023 +0300 wifi: iwlwifi: mvm: Correctly set link configuration In case the link puncturing is changed such that the channel is no longer punctured, configure the FW correctly indicating the EHT parameters changed (with a 0 punctured map). Allow EHT parameters configuration only when the link really supports EHT. Fixes: 55eb1c5fa4b2 ("wifi: iwlwifi: mvm: add support for the new LINK command") Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.2666ef86e032.I4b0e95722660acc5345ceefba7e8866a69572e8e@changeid Signed-off-by: Johannes Berg commit 7dd7f99b17c3293c39cd75604f9d98549b819a0d Author: Mukesh Sisodiya Date: Wed Oct 4 12:36:33 2023 +0300 wifi: iwlwifi: fix the rf step and flavor bits range The macros used to get the RF step and flavour are using wrong bit range. Update the bit range for both macros. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.cfd0aaaa5eb3.Ie2dd6c3a3062647f19cb5e888c46f0fdca103484@changeid Signed-off-by: Johannes Berg commit 048449fc666d736a1a17d950fde0b5c5c8fd10cc Author: Mukesh Sisodiya Date: Wed Oct 4 12:36:32 2023 +0300 wifi: iwlwifi: fw: Fix debugfs command sending During debugfs command handling transport function is used directly, this bypasses the locking used by runtime operation function and leads to a kernel warning when two commands are sent in parallel. Fix it by using runtime operations function when sending debugfs command. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.4f80ac90658a.Ia1dfa1195c919f3002fe08db3eefbd2bfa921bbf@changeid Signed-off-by: Johannes Berg commit 3f5e8522f8a6075882ab1ba49528dbf6cee79bb1 Author: Ayala Beker Date: Wed Oct 4 12:36:31 2023 +0300 wifi: iwlwifi: mvm: advertise support for SCS traffic description This doesn't require any special implementation from our device, just allows transmission of SCS request frame containing a QoS characteristics sub element. Signed-off-by: Ayala Beker Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.cc15de23b07b.I35fa1fbacf113b87ba7a13c37760f893eb57643a@changeid Signed-off-by: Johannes Berg commit 84ef7cbe90e9e54c71c1da4e645ba34e1b33da77 Author: Ilan Peer Date: Wed Oct 4 12:36:30 2023 +0300 wifi: iwlwifi: mvm: Don't always bind/link the P2P Device interface It is not necessary to keep the P2P Device bound/linked to a PHY context when there is no active ROC. Modify the P2P Device flows so the binding/linking would be done only while ROC is active. With this change the switch_phy_ctxt() is no longer needed so remove it. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.c5b83b4bf9de.Ia80daf3ba0b5fec7d0919247fcbdbdb58bddf02b@changeid Signed-off-by: Johannes Berg commit 706f1b5d83cae70187062d52ffb2b9e925811948 Author: iallouch Date: Wed Oct 4 12:36:29 2023 +0300 wifi: iwlwifi: mvm: add start mac ctdp sum calculation debugfs handler mac_ctdp_sum contains the power consumption, appears in power save report, and is used for debugging and collection of statistics. Add a debugfs handler to start this calculation, iff ctdp command is supported in the firmware. While on it, add an option to force start/stop this calculation, which is safe from the firmware API side. Signed-off-by: iallouch Signed-off-by: Nitsan Bar Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.024d75df9e03.I69fdc826f2931a6e1435b450f0602ea060704697@changeid Signed-off-by: Johannes Berg commit 3c6a0b1f0add72e7f522bc9145222b86d0a7712a Author: Miri Korenblit Date: Wed Oct 4 12:36:28 2023 +0300 wifi: iwlwifi: abort scan when rfkill on but device enabled In RFKILL we first set the RFKILL bit, then we abort scan (if one exists) by waiting for the notification from FW and notifying mac80211. And then we stop the device. But in case we have a scan ongoing in the period of time between rfkill on and before the device is stopped - we will not wait for the FW notification because of the iwl_mvm_is_radio_killed() condition, and then the scan_status and uid_status are misconfigured, (scan_status is cleared but uid_status not) and when the notification suddenly arrives (before stopping the device) we will get into the assert about scan_status and uid_status mismatch. Fix this by waiting for FW notif when rfkill is on but the device isn't disabled yet. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.c43b69aa2c77.Icc7b5efb47974d6f499156ff7510b786e177993b@changeid Signed-off-by: Johannes Berg commit b9be67fb4207592eed3880725fa51648ef2f538d Author: Ilan Peer Date: Wed Oct 4 12:36:27 2023 +0300 wifi: iwlwifi: mvm: Add basic link selection logic Add simple logic that would allow using EMLSR in case there are multiple valid links: - In case the connection establishment has just been completed try to find a valid link pair for EMLSR functionality where one of the links in the pair is the current active link. - In case the valid links changed after connection was already established, try to find a valid link pair for EMLSR functionality, in case the EMSLR is not active yet. If a valid link pair is found call mac80211 to asynchronously set the new link pair, otherwise continue using the current active links. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.0c7b89ab29c2.I6600bd16551d75e2bf520d8d0add525568a9f85f@changeid Signed-off-by: Johannes Berg commit f26b118031205135c23b43a311712fe8f34febf9 Author: Johannes Berg Date: Wed Oct 4 12:36:26 2023 +0300 wifi: iwlwifi: mei: return error from register when not built When MEI isn't built, it seems like successfully registering would be wrong. Change this to an error so that in the rest of the driver, mei_registered won't be true. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.d410a97cddfb.I7891544938d5edd5e6e7d2d99540b3637f2f1b1b@changeid Signed-off-by: Johannes Berg commit 3277baa9a76732dd90f356144590d302231ca0d3 Author: Johannes Berg Date: Wed Oct 4 12:36:25 2023 +0300 wifi: iwlwifi: mvm: fix SB CFG check We shouldn't check the 0x10 bit here, since the register holds different values (not just bit masks.). Check for the exact value where this is needed only. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.ab21c7d5e219.I4f9906ebc7ecf38fd276510a276280a9261c8f7f@changeid Signed-off-by: Johannes Berg commit e9dd25550770a0ad301b482db860032cdd890548 Author: Miri Korenblit Date: Wed Oct 4 12:36:24 2023 +0300 wifi: iwlwifi: mvm: add a per-link debugfs Add a per-link debugfs entry in iwlmvm level so we can read/write link related parameters. Do it by implementing the link_add_debugfs API introduced by mac80211. Each entry will have a path like this: .../netdev:wlan0/link-X/iwlmvm/ for each link X. For non-MLD vifs this callback is called when the original vif debugfs dir is also created, so handle that case by not creating the 'iwlmvm' directory again. Note that we don't have to worry about the cleaning the iwlmvm/* directory as it is already done by mac80211 when removing the link (or netdev). Signed-off-by: Miri Korenblit Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.6a161f021ae8.Ic8f40f2b4682270c94036e3c11c3996ae34266fa@changeid Signed-off-by: Johannes Berg commit c36235acb34fb3a2916558d3845203cae181e0be Author: Johannes Berg Date: Wed Oct 4 12:36:23 2023 +0300 wifi: iwlwifi: mvm: rework debugfs handling mac80211 added a new callback to add a vif debugfs. Implement it instead of adding the debugfs directly, which will make it properly preserved over switching the vif from non-MLD/MLD and back. This requires some rework so that we still have the symlink but trust mac80211 to add/remove the debugfs. Signed-off-by: Miri Korenblit Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.818810e242e6.I805a28f9fbef5c52a3a575d04e7a6a909ecf9078@changeid Signed-off-by: Johannes Berg commit 65008777b9dcd2002414ddb2c2158293a6e2fd6f Author: Rotem Saado Date: Wed Oct 4 12:36:22 2023 +0300 wifi: iwlwifi: yoyo: swap cdb and jacket bits values The bits are wrong, the jacket bit should be 5 and cdb bit 4. Fix it. Fixes: 1f171f4f1437 ("iwlwifi: Add support for getting rf id with blank otp") Signed-off-by: Rotem Saado Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.356d8dacda2f.I349ab888b43a11baa2453a1d6978a6a703e422f0@changeid Signed-off-by: Johannes Berg commit 66125c42fd59b452e3db13ee796d1e85275f6b13 Author: Miri Korenblit Date: Wed Oct 4 12:36:21 2023 +0300 wifi: iwlwifi: add support for new ini region types YoYo introduces 2 new region types: prph mac and phy blocks. The data in this regions consists of a list of (base address, size) pairs. This way we can set a block of consecutive registers by the base address and the size, instead of a list of registers. Add support for parsing and dumping these new region types Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.0a10320f4259.I680ef6e16267d95329ee239f05d0999f5a1719ac@changeid Signed-off-by: Johannes Berg commit 440a561c438a6c476d785823a08648d8aab3d733 Author: Miri Korenblit Date: Wed Oct 4 12:36:20 2023 +0300 wifi: iwlwifi: Extract common prph mac/phy regions data dump logic YoYo (debug data collection mechanism) is introducing 2 new types of regions: prph mac/phy ranges. These types will have a common logic of reading the data from the device as the mac/phy prph has. Put it in a separate function so it can be reused. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004123422.16f06414c65c.Ie911bc83a1e2f8fddb27b4c5bd24f933f8b674b6@changeid Signed-off-by: Johannes Berg commit 8c90b8b4e8eb671929dc684b96e059cd862c067f Author: Randy Dunlap Date: Sun Oct 1 12:16:33 2023 -0700 wifi: nl80211: fix doc typos Correct some typos. Signed-off-by: Randy Dunlap Cc: Johannes Berg Cc: Kalle Valo Cc: linux-wireless@vger.kernel.org Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: netdev@vger.kernel.org Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231001191633.19090-3-rdunlap@infradead.org Signed-off-by: Johannes Berg commit cbb56fbaafd95e7e8d7e95d3753477a9069e795f Author: Randy Dunlap Date: Sun Oct 1 12:16:32 2023 -0700 wifi: mac80211: fix header kernel-doc typos Correct typos and fix run-on sentences. Signed-off-by: Randy Dunlap Cc: Johannes Berg Cc: Kalle Valo Cc: linux-wireless@vger.kernel.org Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: netdev@vger.kernel.org Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231001191633.19090-2-rdunlap@infradead.org Signed-off-by: Johannes Berg commit 98e0c7f85773ab161d804103649b33f8a97cf1b3 Author: Randy Dunlap Date: Sun Oct 1 12:16:31 2023 -0700 wifi: cfg80211: fix header kernel-doc typos Correct spelling of several words. Signed-off-by: Randy Dunlap Cc: Johannes Berg Cc: Kalle Valo Cc: linux-wireless@vger.kernel.org Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: netdev@vger.kernel.org Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231001191633.19090-1-rdunlap@infradead.org Signed-off-by: Johannes Berg commit e76f3b4a73ea60ef098c5762b2aef4d11e094a04 Author: Miri Korenblit Date: Thu Sep 28 17:35:34 2023 +0300 wifi: mac80211: add link id to mgd_prepare_tx() As we are moving to MLO and links terms, also the airtime protection will be done for a link rather than for a vif. Thus, some drivers will need to know for which link to protect airtime. Add link id as a parameter to the mgd_prepare_tx() callback. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.c7fc59a6780b.Ic88a5037d31e184a2dce0b031ece1a0a93a3a9da@changeid Signed-off-by: Johannes Berg commit e433304ab437a6edff6b666246f7251d9a596b91 Author: Miri Korenblit Date: Wed Oct 4 12:12:02 2023 +0300 wifi: mac80211: Check if we had first beacon with relevant links If there is a disassoc before the fisrt beacon we need to protect a session for the deauth frame. Currently we are checking if we had a beacon in the default link, which is wrong in a MLO connection and link id != 0. Fix this by checking all the active links, if none had a beacon then protect a session. If at least one link had a beacon there is no need for session protection. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20231004120820.d290f0ab77b0.Ic1505cf3d60f74580d31efa7e52046947c490b85@changeid Signed-off-by: Johannes Berg commit 1358706907d89e798e6c8930f82b210edc3c3a0c Author: Andreas Gruenbacher Date: Sat Oct 21 21:59:03 2023 +0200 gfs2: Stop using GFS2_BASIC_BLOCK and GFS2_BASIC_BLOCK_SHIFT Header gfs2_ondisk.h defines GFS2_BASIC_BLOCK and GFS2_BASIC_BLOCK_SHIFT in a misguided attempt to abstract away the fact that sectors on block devices are 512 or (1 << 9) bytes in size. Stop using those definitions. I would be inclinded to remove those definitions altogether, but the gfs2 user-space tools are using them. In addition, instead of GFS2_SB(inode)->sd_sb.sb_bsize_shift, simply use inode->i_blkbits. Signed-off-by: Andreas Gruenbacher Cc: Andrew Price commit 2d8d7990619878a848b1d916c2f936d3012ee17d Author: Andreas Gruenbacher Date: Sat Oct 21 20:51:13 2023 +0200 gfs2: setattr_chown: Add missing initialization Add a missing initialization of variable ap in setattr_chown(). Without, chown() may be able to bypass quotas. Signed-off-by: Andreas Gruenbacher commit 06d6af4e1223339bb597b02fa8ad3f979ddb5511 Author: Johannes Berg Date: Thu Sep 28 17:35:39 2023 +0300 wifi: mac80211: flush STA queues on unauthorization When the station is marked as no longer authorized, we shouldn't transmit to it any longer, but in particular we shouldn't be able to transmit to it after removing keys, which might lead to frames being sent out unencrypted depending on the exact hardware offload mechanism. Thus, instead of flushing only on station destruction, which covers only some cases, always flush on unauthorization. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.d47f528829e7.I96903652c7ee0c5c66891f8b2364383da8e45a1f@changeid Signed-off-by: Johannes Berg commit 3831f6d8ce9c3c237a561219a2fb9c41ec800331 Author: Miri Korenblit Date: Thu Sep 28 17:35:38 2023 +0300 wifi: mac80211: purge TX queues in flush_queues flow When this flow is invoked with the "drop" parameter as true, we only drop the frames from the hw queues, but not from the sw queues. So when we call wake_queues() after hw queue purging, all the frames from the sw queues will be TX'ed, when what we actually want to do is to purge all queues in order to not TX anything... This can cause, for example, TXing data frames to the peer after the deauth frame was sent. Fix this by purging the sw queues in addition to the hw queues if the drop parameter is true. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.8fc2ee23e56f.I8b3f6def9c28ea96261e2d31df8786986fb5385b@changeid Signed-off-by: Johannes Berg commit c7d91ccb442538fb75a55ac55b44a00d5bef2841 Author: Johannes Berg Date: Thu Sep 28 17:35:37 2023 +0300 wifi: cfg80211: wext: convert return value to kernel-doc Since I'm getting a warning here right now, fix the kernel-doc to be "Returns:" rather than just writing that out in the doc paragraph. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.ab3b9274bf07.If263f9f6726d6ad4661f8603e6a4485e0385d67f@changeid Signed-off-by: Johannes Berg commit 9ad08fb1bcfdebfe71f9485affacfc24dd1b486b Author: Emmanuel Grumbach Date: Thu Sep 28 17:35:36 2023 +0300 wifi: mac80211: fix a expired vs. cancel race in roc When the remain on channel is removed at the time it should have expired, we have a race: the driver could be handling the flow of the expiration while mac80211 is cancelling that very same remain on channel request. This wouldn't be problem in itself, but since mac80211 can send the next request to the driver in the cancellation flow, we can get to the following situation: CPU0 CPU1 expiration of roc in driver ieee80211_remain_on_channel_expired() Cancellation of the roc schedules a worker (hw_roc_done) Add next roc hw_roc_done_wk runs and ends the second roc prematurely. Since, by design, there is only one single request sent to the driver at a time, we can safely assume that after the cancel() request returns from the driver, we should not handle any worker that handles the expiration of the request. Cancel the hw_roc_done worker after the cancellation to make sure we start the next one with a clean slate. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.4e4469be20ac.Iab0525f5cc4698acf23eab98b8b1eec02099cde0@changeid Signed-off-by: Johannes Berg commit 271d14b37fa5f2f9bd9e22711c3ba6b1532c8de1 Author: Miri Korenblit Date: Thu Sep 28 17:35:35 2023 +0300 wifi: mac80211: make mgd_protect_tdls_discover MLO-aware Since userspace can choose now what link to establish the TDLS on, we should know on what channel to do session protection. Add a link id parameter to this callback. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.ef12ce3eb835.If864f406cfd9e24f36a2b88fd13a37328633fcf9@changeid Signed-off-by: Johannes Berg commit ec06bdb22500c8f10f17326d6db3f8ad3e2347b1 Author: Ilan Peer Date: Thu Sep 28 17:35:32 2023 +0300 wifi: cfg80211: Fix typo in documentation Fix a small typo in a comment. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.9dce226e393f.I929bfb9371e31c9e8d2bb1c1a96e9b1f3d02f2d0@changeid Signed-off-by: Johannes Berg commit e7182c4e6bbeafa272612e6c06fa92b42ad107ad Author: Ilan Peer Date: Thu Sep 28 17:35:31 2023 +0300 wifi: mac80211: Fix setting vif links When setting the interface links, ignore the change iff both the valid links and the dormant links did not change. This is needed to support cases where the valid links didn't change but the dormant links did. Fixes: 6d543b34dbcf ("wifi: mac80211: Support disabled links during association") Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.0357b6306587.I7dbfec347949b629fea680d246a650d6207ff217@changeid Signed-off-by: Johannes Berg commit 0fca7784b7a14d4ede64f479662afb98876ec7f8 Author: Ilan Peer Date: Thu Sep 28 17:35:30 2023 +0300 wifi: cfg80211: Handle specific BSSID in 6GHz scanning When the scan parameters for a 6GHz scan specify a unicast BSSID address, and the corresponding AP is found in the scan list, add a corresponding entry in the collocated AP list, so this AP would be directly probed even if it was not advertised as a collocated AP. This is needed for handling a scan request that is intended for a ML probe flow, where user space can requests a scan to retrieve information for other links in the AP MLD. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.54b954bc02ad.I1c072793d3d77a4c8fbbc64b4db5cce1bbb00382@changeid Signed-off-by: Johannes Berg commit c00de1c49294cb83ecf11c2f9306df5fec5c16a0 Author: Benjamin Berg Date: Thu Sep 28 17:35:29 2023 +0300 wifi: mac80211: mesh: fix some kdoc warnings These were mostly missing or incorrectly tagged return values. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.33fea2968c62.I41d197b570370ab7cad1405518512fdd36e08717@changeid Signed-off-by: Johannes Berg commit 256caff27874c40c6f02f3e047e47bf4ae7702bc Author: Ilan Peer Date: Thu Sep 28 17:35:28 2023 +0300 wifi: cfg80211: Include operating class 137 in 6GHz band Draft P802.11be_D3.1 added operating class to describe 320 MHz operation in the 6GHz band. Include this new operating class in ieee80211_operating_class_to_band(). Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.bed4a007d81b.I3eb4b8fe39c0c1a988c98a103b11a9f45a92b038@changeid Signed-off-by: Johannes Berg commit 00f823b68ecee865bb2e4e6d5b7f4359eef0b3e3 Author: Ilan Peer Date: Thu Sep 28 17:35:27 2023 +0300 wifi: mac80211: Rename and update IEEE80211_VIF_DISABLE_SMPS_OVERRIDE EMLSR operation and SMPS operation cannot coexist. Thus, when EMLSR is enabled, all SMPS signaling towards the AP should be stopped (it is expected that the AP will consider SMPS to be off). Rename IEEE80211_VIF_DISABLE_SMPS_OVERRIDE to IEEE80211_VIF_EML_ACTIVE and use the flag as an indication from the driver that EMLSR is enabled. When EMLSR is enabled SMPS flows towards the AP MLD should be stopped. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.fb2c2f9a0645.If6df5357568abd623a081f0f33b07e63fb8bba99@changeid Signed-off-by: Johannes Berg commit c942398f95efb06d5434f86ea00fabe267f57af8 Author: Miri Korenblit Date: Thu Sep 28 17:35:26 2023 +0300 wifi: mac80211: handle debugfs when switching to/from MLO In MLO, we have a per-link debugfs directory which contains the per-link files. In case of non-MLO we would like to put the per-link files in the netdev directory to keep it how it was before MLO. - Upon interface creation the netdev will be created with the per-link files in it. - Upon switching to MLO: delete the entire netdev directory and then recreate it without the per-link files. Then the per-link directories with the per-link files in it will be created in ieee80211_link_init() - Upon switching to non-MLO: delete the entire netdev directory (including the per-link directories) and recreate it with the per-link files in it. Note that this also aligns to always call the vif link debugfs method for the deflink as promised in the documentation, which wasn't done before. Signed-off-by: Miri Korenblit Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.082e698caca9.I5bef7b2026e0f58b4a958b3d1f459ac5baeccfc9@changeid Signed-off-by: Johannes Berg commit a1f5dcb1c0c1e26a7e158ce9fc28355041f26909 Author: Miri Korenblit Date: Thu Sep 28 17:35:25 2023 +0300 wifi: mac80211: add a driver callback to add vif debugfs Add a callback which the driver can use to add the vif debugfs. We used to have this back until commit d260ff12e776 ("mac80211: remove vif debugfs driver callbacks") where we thought that it will be easier to just add them during interface add/remove. However, now with multi-link, we want to have proper debugfs for drivers for multi-link where some files might be in the netdev for non-MLO connections, and in the links for MLO ones, so we need to do some reconstruction when switching the mode. Moving to this new call enables that and MLO drivers will have to use it for proper debugfs operation. Signed-off-by: Miri Korenblit Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.ac38913f6ab7.Iee731d746bb08fcc628fa776f337016a12dc62ac@changeid Signed-off-by: Johannes Berg commit 822cab1987a0e028e38b60aecd98af0289b46e7b Author: Johannes Berg Date: Thu Sep 28 17:35:24 2023 +0300 wifi: mac80211: don't recreate driver link debugfs in reconfig We can delete any that we want to remove, but we can't recreate the links as they already exist. Fixes: 170cd6a66d9a ("wifi: mac80211: add netdev per-link debugfs data and driver hook") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.3d0214838421.I512a0ff86f631ff42bf25ea0cb2e8e8616794a94@changeid Signed-off-by: Johannes Berg commit 6b398f1c28f033b82c7363caa73f5669ce4a1853 Author: Benjamin Berg Date: Thu Sep 28 17:35:22 2023 +0300 wifi: mac80211: cleanup auth_data only if association continues If the association command fails then the authentication is still valid and it makes sense to keep it alive. Otherwise, we would currently get into an inconsistent state because mac80211 on the one hand is disconnected but on the other hand the state is not entirely cleared and a new authentication could not continue. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230928172905.c9855f46ebc8.I7f3dcd4120a186484a91b87560e9b7201d40984f@changeid Signed-off-by: Johannes Berg commit 7dbbf557b77946de4aa341a1cf24c1ebe7ec681a Author: Gregory Greenman Date: Tue Sep 26 11:07:21 2023 +0300 wifi: iwlwifi: bump FW API to 84 for AX/BZ/SC devices Start supporting API version 84 for new devices. Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230926110319.eae20f9fdc06.Ifa9be6482121ea6df364bddc96ea6a7d101366b6@changeid Signed-off-by: Johannes Berg commit 63ef576c9facf5d92702e249ad213fa73eb434bf Author: Johannes Berg Date: Tue Sep 26 11:07:20 2023 +0300 wifi: iwlwifi: mvm: use correct sta ID for IGTK/BIGTK We don't (yet) send the IGTK down to the firmware, but when we do it needs to be with the broadcast station ID, not the multicast station ID. Same for the BIGTK, which we may send already if firmware advertises it (but it doesn't yet.) Fixes: a5de7de7e78e ("wifi: iwlwifi: mvm: enable TX beacon protection") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230926110319.dbc653913353.I82e90c86010f0b9588a180d9835fd11f666f5196@changeid Signed-off-by: Johannes Berg commit f05d1e04c43fb2047b00a2a73646f73d2ac62724 Author: Johannes Berg Date: Tue Sep 26 11:07:19 2023 +0300 wifi: iwlwifi: mvm: offload IGTK in AP if BIGTK is supported We can't really know easily if a BIGTK will be used, but in case firmware supports BIGTK it also supports the very easy IGTK use (nothing to do on the host), and requires that we program both IGTK and BIGTK to be able to use the BIGTK. Thus, change the condition here to set the keys in firmware (both IGTK/BIGTK) if BIGTK is supported. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230926110319.425ebc1ce484.If485ec962636c23d463b678e7da86e11b6fa86c9@changeid Signed-off-by: Johannes Berg commit ff2687612c21a87a58c76099f3d59f8db376b995 Author: Avraham Stern Date: Tue Sep 26 11:07:18 2023 +0300 wifi: iwlwifi: mvm: fix removing pasn station for responder In case of MLD operation the station should be removed using the mld api. Fixes: fd940de72d49 ("wifi: iwlwifi: mvm: FTM responder MLO support") Signed-off-by: Avraham Stern Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230926110319.7eb353abb95c.I2b30be09b99f5a2379956e010bafaa465ff053ba@changeid Signed-off-by: Johannes Berg commit 717361d2f6f78a9944bc5b5c51149d7b799effa0 Author: Johannes Berg Date: Tue Sep 26 11:07:17 2023 +0300 wifi: iwlwifi: pcie: clean up WFPM control bits We define the same bit twice, remove the less precise definition and use the better one instead. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230926110319.82d2744690b3.I90c08a27dca26a181dacb069184f39ece77849b5@changeid Signed-off-by: Johannes Berg commit 7186d271acec33496de73b3a9271e780b94241e6 Author: Johannes Berg Date: Tue Sep 26 11:07:16 2023 +0300 wifi: iwlwifi: fix opmode start/stop race There's a race when the device is unbound (maybe because the module is unloaded) while the opmode start hasn't finished yet. The complete(request_firmware_complete) after the opmode start was meant (and commented accordingly) to prevent this problem, but it's not sufficient when the opmode module is loaded after the firmware load already completed, which happens regularly now because firmware load doesn't require userspace, unlike module load. Fix this by using the existing opmode registration mutex to protected the start/stop flows against each other properly. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230926110319.85951554fed8.I62f20f40d79d0f136fa05e46d7fc16dc437fa3db@changeid Signed-off-by: Johannes Berg commit eb8efbac9087230fccce8e6873c873f837a05219 Author: Johannes Berg Date: Tue Sep 26 11:07:15 2023 +0300 wifi: iwlwifi: skip opmode start retries on dead transport These retries aren't going to succeed if the device was deemed dead and needs to be unbound/rebound/... to be recovered; skip the retries in that case. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230926110319.9f472069d75d.Ib6684c5b2ea8ed98f082c9b0e9bb2b03c3ea4fe3@changeid Signed-off-by: Johannes Berg commit 77e7427ef23de26e528ab16d82fdeaf7e42312fa Author: Johannes Berg Date: Tue Sep 26 11:07:14 2023 +0300 wifi: iwlwifi: pcie: propagate iwl_pcie_gen2_apm_init() error If iwl_pcie_gen2_apm_init() fails, we should propagate the error code up, rather than ignoring it. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230926110319.883768afe77b.Ic47cb8ce0a0abba3b4745cc2a721217c33360d6c@changeid Signed-off-by: Johannes Berg commit 5a86dcb4a908845e6b7ff39b78fb1141b895408f Author: Avraham Stern Date: Tue Sep 26 11:07:13 2023 +0300 wifi: iwlwifi: mvm: update station's MFP flag after association The management frames protection flag is always set when the station is not yet authorized. However, it was not cleared after association even if the association did not use MFP. As a result, all public action frames are not parsed by fw (which will cause FTM to fail, for example). Update the station MFP flag after the station is authorized. Fixes: 4c8d5c8d079e ("wifi: iwlwifi: mvm: tell firmware about per-STA MFP enablement") Signed-off-by: Avraham Stern Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230926110319.2488cbd01bde.Ic0f08b7d3efcbdce27ec897f84d740fec8d169ef@changeid Signed-off-by: Johannes Berg commit 90d862f370b6e9de1b5d607843c5a2f9823990f3 Author: Hari Bathini Date: Fri Oct 20 19:43:58 2023 +0530 powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free] Use bpf_jit_binary_pack_alloc in powerpc jit. The jit engine first writes the program to the rw buffer. When the jit is done, the program is copied to the final location with bpf_jit_binary_pack_finalize. With multiple jit_subprogs, bpf_jit_free is called on some subprograms that haven't got bpf_jit_binary_pack_finalize() yet. Implement custom bpf_jit_free() like in commit 1d5f82d9dd47 ("bpf, x86: fix freeing of not-finalized bpf_prog_pack") to call bpf_jit_binary_pack_finalize(), if necessary. As bpf_flush_icache() is not needed anymore, remove it. Signed-off-by: Hari Bathini Acked-by: Song Liu Signed-off-by: Michael Ellerman Link: https://msgid.link/20231020141358.643575-6-hbathini@linux.ibm.com commit de04e40600ae15fa5e484be242e74aad6de7418f Author: Hari Bathini Date: Fri Oct 20 19:43:57 2023 +0530 powerpc/bpf: rename powerpc64_jit_data to powerpc_jit_data powerpc64_jit_data is a misnomer as it is meant for both ppc32 and ppc64. Rename it to powerpc_jit_data. Signed-off-by: Hari Bathini Acked-by: Song Liu Signed-off-by: Michael Ellerman Link: https://msgid.link/20231020141358.643575-5-hbathini@linux.ibm.com commit 033ffaf0af1f974ecf401db3f70aae6fe1a90fc5 Author: Hari Bathini Date: Fri Oct 20 19:43:56 2023 +0530 powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack Implement bpf_arch_text_invalidate and use it to fill unused part of the bpf_prog_pack with trap instructions when a BPF program is freed. Signed-off-by: Hari Bathini Acked-by: Song Liu Signed-off-by: Michael Ellerman Link: https://msgid.link/20231020141358.643575-4-hbathini@linux.ibm.com commit 6efc1675acb88eef45ef0156b93f95d66a8ee759 Author: Hari Bathini Date: Fri Oct 20 19:43:55 2023 +0530 powerpc/bpf: implement bpf_arch_text_copy bpf_arch_text_copy is used to dump JITed binary to RX page, allowing multiple BPF programs to share the same page. Use the newly introduced patch_instructions() to implement it. Signed-off-by: Hari Bathini Acked-by: Song Liu Signed-off-by: Michael Ellerman Link: https://msgid.link/20231020141358.643575-3-hbathini@linux.ibm.com commit 465cabc97b42405eb89380ea6ba8d8b03e4ae1a2 Author: Hari Bathini Date: Fri Oct 20 19:43:54 2023 +0530 powerpc/code-patching: introduce patch_instructions() patch_instruction() entails setting up pte, patching the instruction, clearing the pte and flushing the tlb. If multiple instructions need to be patched, every instruction would have to go through the above drill unnecessarily. Instead, introduce patch_instructions() function that sets up the pte, clears the pte and flushes the tlb only once per page range of instructions to be patched. Duplicate most of the patch_instruction() code instead of merging with it, to avoid the performance degradation observed on ppc32, for patch_instruction(), with the code path merged. Also, setup poking_init() always as BPF expects poking_init() to be setup even when STRICT_KERNEL_RWX is off. Signed-off-by: Hari Bathini Acked-by: Song Liu Signed-off-by: Michael Ellerman Link: https://msgid.link/20231020141358.643575-2-hbathini@linux.ibm.com commit aad26d3b6af13c055b1d05dd253d2484551bde55 Author: Michael Ellerman Date: Mon Oct 23 20:23:19 2023 +1100 powerpc/32s: Implement local_flush_tlb_page_psize() There's a single call to local_flush_tlb_page_psize() in the code patching code. That call is never executed on 32-bit Book3S, because it's guarded by mm_patch_enabled() which is essentially a radix_enabled() check, which is always false on 32s. However depending on how the optimiser sees things it may still trip over the BUILD_BUG() in the 32s stub of local_flush_tlb_page_psize(). To avoid that, implement it in terms of flush_range() so that if it ever becomes called it should function, even if not optimally. Note that flush_range() deals with page aligning the address and so on, and that 32s doesn't support huge pages so there should be no issue with non-standard page sizes needing to be flushed. Signed-off-by: Michael Ellerman Link: https://msgid.link/20231023092319.1507325-1-mpe@ellerman.id.au commit 4e5b65a22ba0cabe58f895cd797cb10a763d6994 Merge: 4c456c9ad334a 05d3ef8bba77c Author: Ingo Molnar Date: Mon Oct 23 11:32:25 2023 +0200 Merge tag 'v6.6-rc7' into sched/core, to pick up fixes Pick up recent sched/urgent fixes merged upstream. Signed-off-by: Ingo Molnar commit 6e7ce2d71bb99096d811918341fde61e66bfff2c Author: Su Hui Date: Fri Oct 20 17:16:26 2023 +0800 net: lan966x: remove useless code in lan966x_xtr_irq_handler 'err' is useless after break, remove this to save space and be more clear. Signed-off-by: Su Hui Signed-off-by: David S. Miller commit bdf24b4bdfa59b124f9d0ff837f8d35a908da3b8 Merge: 35c1b27320634 a77a0f5c7f23a Author: David S. Miller Date: Mon Oct 23 09:35:02 2023 +0100 Merge branch 'tcp-ts-usec-resolution' Eric Dumazet says: ==================== tcp: add optional usec resolution to TCP TS As discussed in various public places in 2016, Google adopted usec resolution in RFC 7323 TS values, at Van Jacobson suggestion. Goals were : 1) better observability of delays in networking stacks/fabrics. 2) better disambiguation of events based on TSval/ecr values. 3) building block for congestion control modules needing usec resolution. Back then we implemented a schem based on private SYN options to safely negotiate the feature. For upstream submission, we chose to use a much simpler route attribute because this feature is probably going to be used in private networks. ip route add 10/8 ... features tcp_usec_ts References: https://www.ietf.org/proceedings/97/slides/slides-97-tcpm-tcp-options-for-low-latency-00.pdf https://datatracker.ietf.org/doc/draft-wang-tcpm-low-latency-opt/ First two patches are fixing old minor bugs and might be taken by stable teams (thanks to appropriate Fixes: tags) ==================== Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit a77a0f5c7f23a8a4981a2a3ff47baa91ceaf1f53 Author: Eric Dumazet Date: Fri Oct 20 12:57:48 2023 +0000 tcp: add TCPI_OPT_USEC_TS Add the ability to report in tcp_info.tcpi_options if a flow is using usec resolution in TCP TS val. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 614e8316aa4cafba3e204cb8ee48bd12b92f3d93 Author: Eric Dumazet Date: Fri Oct 20 12:57:47 2023 +0000 tcp: add support for usec resolution in TCP TS values Back in 2015, Van Jacobson suggested to use usec resolution in TCP TS values. This has been implemented in our private kernels. Goals were : 1) better observability of delays in networking stacks. 2) better disambiguation of events based on TSval/ecr values. 3) building block for congestion control modules needing usec resolution. Back then we implemented a schem based on private SYN options to negotiate the feature. For upstream submission, we chose to use a route attribute, because this feature is probably going to be used in private networks [1] [2]. ip route add 10/8 ... features tcp_usec_ts Note that RFC 7323 recommends a "timestamp clock frequency in the range 1 ms to 1 sec per tick.", but also mentions "the maximum acceptable clock frequency is one tick every 59 ns." [1] Unfortunately RFC 7323 5.5 (Outdated Timestamps) suggests to invalidate TS.Recent values after a flow was idle for more than 24 days. This is the part making usec_ts a problem for peers following this recommendation for long living idle flows. [2] Attempts to standardize usec ts went nowhere: https://www.ietf.org/proceedings/97/slides/slides-97-tcpm-tcp-options-for-low-latency-00.pdf https://datatracker.ietf.org/doc/draft-wang-tcpm-low-latency-opt/ Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit af7721448a609d1912b57c825194ef6e17fc71a4 Author: Eric Dumazet Date: Fri Oct 20 12:57:46 2023 +0000 tcp: introduce TCP_PAWS_WRAP tcp_paws_check() uses TCP_PAWS_24DAYS constant to detect if TCP TS values might have wrapped after a long idle period. This mechanism is described in RFC 7323 5.5 (Outdated Timestamps) TCP_PAWS_24DAYS value was based on the assumption of a clock of 1 Khz. As we want to adopt a 1 Mhz clock in the future, we reduce this constant. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 3d44de9a10ea2b1658dfaed8ea6d3d7b6e0defbb Author: Eric Dumazet Date: Fri Oct 20 12:57:45 2023 +0000 tcp: add RTAX_FEATURE_TCP_USEC_TS This new dst feature flag will be used to allow TCP to use usec based timestamps instead of msec ones. ip route .... feature tcp_usec_ts Also document that RTAX_FEATURE_SACK and RTAX_FEATURE_TIMESTAMP are unused. RTAX_FEATURE_ALLFRAG is also going away soon. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit b04c3320885a88a94e4bbb2f9dbc4871c9bc336f Author: Eric Dumazet Date: Fri Oct 20 12:57:44 2023 +0000 tcp: add tcp_rtt_tsopt_us() Before adding usec TS support, add tcp_rtt_tsopt_us() helper to factorize code. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 9d0c00f5ca05be9e89649c156f9d5b9421fc534e Author: Eric Dumazet Date: Fri Oct 20 12:57:43 2023 +0000 tcp: rename tcp_time_stamp() to tcp_time_stamp_ts() This helper returns a TSval from a TCP socket. It currently calls tcp_time_stamp_ms() but will soon be able to return a usec based TSval, depending on an upcoming tp->tcp_usec_ts field. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 003e07a1e48e9423647d2fef1c86b4caab3a94be Author: Eric Dumazet Date: Fri Oct 20 12:57:42 2023 +0000 tcp: move tcp_ns_to_ts() to net/ipv4/syncookies.c tcp_ns_to_ts() is only used once from cookie_init_timestamp(). Also add the 'bool usec_ts' parameter to enable usec TS later. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit d1a02ed66fe62aa2edd77bd54e270ebc33bd12ff Author: Eric Dumazet Date: Fri Oct 20 12:57:41 2023 +0000 tcp: rename tcp_skb_timestamp() This helper returns a 32bit TCP TSval from skb->tstamp. As we are going to support usec or ms units soon, rename it to tcp_skb_timestamp_ts() and add a boolean to select the unit. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 16cf6477741bdaa287d5e4531a1a503618a41a22 Author: Eric Dumazet Date: Fri Oct 20 12:57:40 2023 +0000 tcp: replace tcp_time_stamp_raw() In preparation of usec TCP TS support, remove tcp_time_stamp_raw() in favor of tcp_clock_ts() helper. This helper will return a suitable 32bit result to feed TS values, depending on a socket field. Also add tcp_tw_tsval() and tcp_rsk_tsval() helpers to factorize the details. We do not yet support usec timestamps. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 2a7c8d291ffeba69a47d8528987156f625cc05b0 Author: Eric Dumazet Date: Fri Oct 20 12:57:39 2023 +0000 tcp: introduce tcp_clock_ms() It delivers current TCP time stamp in ms unit, and is used in place of confusing tcp_time_stamp_raw() It is the same family than tcp_clock_ns() and tcp_clock_ms(). tcp_time_stamp_raw() will be replaced later for TSval contexts with a more descriptive name. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 99d679556d737a14391c68e562d94076c2983252 Author: Eric Dumazet Date: Fri Oct 20 12:57:38 2023 +0000 tcp: add tcp_time_stamp_ms() helper In preparation of adding usec TCP TS values, add tcp_time_stamp_ms() for contexts needing ms based values. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 73ed8e03388d16c12fc577e5c700b58a29045a15 Author: Eric Dumazet Date: Fri Oct 20 12:57:37 2023 +0000 tcp: fix cookie_init_timestamp() overflows cookie_init_timestamp() is supposed to return a 64bit timestamp suitable for both TSval determination and setting of skb->tstamp. Unfortunately it uses 32bit fields and overflows after 2^32 * 10^6 nsec (~49 days) of uptime. Generated TSval are still correct, but skb->tstamp might be set far away in the past, potentially confusing other layers. tcp_ns_to_ts() is changed to return a full 64bit value, ts and ts_now variables are changed to u64 type, and TSMASK is removed in favor of shifts operations. While we are at it, change this sequence: ts >>= TSBITS; ts--; ts <<= TSBITS; ts |= options; to: ts -= (1UL << TSBITS); Fixes: 9a568de4818d ("tcp: switch TCP TS option (RFC 7323) to 1ms clock") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 225d9ddbacb102621af6d28ff7bf5a0b4ce249d8 Author: Eric Dumazet Date: Fri Oct 20 12:57:36 2023 +0000 chtls: fix tp->rcv_tstamp initialization tp->rcv_tstamp should be set to tcp_jiffies, not tcp_time_stamp(). Fixes: cc35c88ae4db ("crypto : chtls - CPL handler definition") Signed-off-by: Eric Dumazet Cc: Ayush Sawal Signed-off-by: David S. Miller commit 3f5ba636d6987ddffeaa056dea1c524da63912f3 Merge: 7cd62eab9babd b08d26dac1a10 Author: Dave Airlie Date: Mon Oct 23 18:29:18 2023 +1000 Merge tag 'drm-msm-next-2023-10-17' of https://gitlab.freedesktop.org/drm/msm into drm-next Updates for v6.7 DP: - use existing helpers for DPCD handling instead of open-coded functions - set the subconnector type according to the plugged cable / dongle skip validity check for DP CTS EDID checksum DPU: - continued migration of feature flags to use core revision checks - reworked interrupts code to use '0' as NO_IRQ, removed raw IRQ indices from log / trace output gpu: - a7xx support (a730, a740) - fixes and additional speedbins for a635, a643 core: - decouple msm_drv from kms to more cleanly support headless devices (like imx5+a2xx) From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvzkBL2_OgyOeP_b6rVEjrNdfm8jcKzaB04HqHyT5jYwA@mail.gmail.com Signed-off-by: Dave Airlie commit 2bdcdad6933d1420caf6db2c7f7391b3213e7488 Author: Rob Herring Date: Fri Oct 20 12:00:16 2023 -0500 dt-bindings: pinctrl: nuvoton,npcm845: Add missing additionalProperties on gpio child nodes Just as unevaluatedProperties or additionalProperties are required at the top level of schemas, they should (and will) also be required for child node schemas. That ensures only documented properties are present for any node. Add the missing addtionalProperties to the 'gpio' child nodes. Signed-off-by: Rob Herring Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231020170017.3610978-1-robh@kernel.org Signed-off-by: Linus Walleij commit caf963efd4b0b9ff42ca12e52b8efe277264d35b Author: Rob Herring Date: Fri Oct 20 13:52:02 2023 -0500 dt-bindings: pinctrl: brcm: Ensure all child node properties are documented The Broadcom pinctrl bindings are incomplete for child nodes as they are missing 'unevaluatedProperties: false' to prevent unknown properties. Fixing this reveals many warnings including having grandchild nodes in some cases. Many cases in the examples use 'group' property which is undocumented and not used by the driver. As the schemas define 'pins', I assume that is the correct name except for the one case, 6358, using 'groups' which is documented. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231020185203.3941590-2-robh@kernel.org Signed-off-by: Linus Walleij commit 7cd62eab9babd1fed9c497141650b31168f4f430 Merge: 035fdc38c1f6d 05d3ef8bba77c Author: Dave Airlie Date: Mon Oct 23 18:20:06 2023 +1000 BackMerge tag 'v6.6-rc7' into drm-next This is needed to add the msm pr which is based on a higher base. Signed-off-by: Dave Airlie commit 35c1b273206346c4178928b1121675dc143e61d2 Merge: 92fc97ae9cfd1 2aceb896ee18a Author: David S. Miller Date: Mon Oct 23 08:48:57 2023 +0100 Merge branch 'consolidate-udp-ipv6-route-lookups' Beniamino Galvani says: ==================== net: consolidate IPv6 route lookup for UDP tunnels At the moment different UDP tunnels rely on different functions for IPv6 route lookup, and those functions all implement the same logic. Extend the generic lookup function so that it is suitable for all UDP tunnel implementations, and then adapt bareudp, geneve and vxlan to use it. This is similar to what already done for IPv4. ==================== Signed-off-by: David S. Miller commit 2aceb896ee18ae35b21b14c978d8c2ef8c7b439d Author: Beniamino Galvani Date: Fri Oct 20 13:55:29 2023 +0200 vxlan: use generic function for tunnel IPv6 route lookup The route lookup can be done now via generic function udp_tunnel6_dst_lookup() to replace the custom implementation in vxlan6_get_route(). This is similar to what already done for IPv4 in commit 6f19b2c136d9 ("vxlan: use generic function for tunnel IPv4 route lookup"). Suggested-by: Guillaume Nault Signed-off-by: Beniamino Galvani Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 69d72587c17b48e928f558d360f1b3c0574bf4dd Author: Beniamino Galvani Date: Fri Oct 20 13:55:28 2023 +0200 geneve: use generic function for tunnel IPv6 route lookup The route lookup can be done now via generic function udp_tunnel6_dst_lookup() to replace the custom implementation in geneve_get_v6_dst(). This is similar to what already done for IPv4 in commit daa2ba7ed1d1 ("geneve: use generic function for tunnel IPv4 route lookup"). Suggested-by: Guillaume Nault Signed-off-by: Beniamino Galvani Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 946fcfdbc5b97e26d31339ebca2d9a51a4f975ff Author: Beniamino Galvani Date: Fri Oct 20 13:55:27 2023 +0200 ipv6: add new arguments to udp_tunnel6_dst_lookup() We want to make the function more generic so that it can be used by other UDP tunnel implementations such as geneve and vxlan. To do that, add the following arguments: - source and destination UDP port; - ifindex of the output interface, needed by vxlan; - the tos, because in some cases it is not taken from struct ip_tunnel_info (for example, when it's inherited from the inner packet); - the dst cache, because not all tunnel types (e.g. vxlan) want to use the one from struct ip_tunnel_info. With these parameters, the function no longer needs the full struct ip_tunnel_info as argument and we can pass only the relevant part of it (struct ip_tunnel_key). This is similar to what already done for IPv4 in commit 72fc68c6356b ("ipv4: add new arguments to udp_tunnel_dst_lookup()"). Suggested-by: Guillaume Nault Signed-off-by: Beniamino Galvani Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 7e937dcf96d0489b3cdd1cff9dfd049617d28492 Author: Beniamino Galvani Date: Fri Oct 20 13:55:26 2023 +0200 ipv6: remove "proto" argument from udp_tunnel6_dst_lookup() The function is now UDP-specific, the protocol is always IPPROTO_UDP. This is similar to what already done for IPv4 in commit 78f3655adcb5 ("ipv4: remove "proto" argument from udp_tunnel_dst_lookup()"). Suggested-by: Guillaume Nault Signed-off-by: Beniamino Galvani Reviewed-by: David Ahern Signed-off-by: David S. Miller commit fc47e86dbfb75a864c0c9dd8e78affb6506296bb Author: Beniamino Galvani Date: Fri Oct 20 13:55:25 2023 +0200 ipv6: rename and move ip6_dst_lookup_tunnel() At the moment ip6_dst_lookup_tunnel() is used only by bareudp. Ideally, other UDP tunnel implementations should use it, but to do so the function needs to accept new parameters that are specific for UDP tunnels, such as the ports. Prepare for these changes by renaming the function to udp_tunnel6_dst_lookup() and move it to file net/ipv6/ip6_udp_tunnel.c. This is similar to what already done for IPv4 in commit bf3fcbf7e7a0 ("ipv4: rename and move ip_route_output_tunnel()"). Suggested-by: Guillaume Nault Signed-off-by: Beniamino Galvani Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 92fc97ae9cfd1e8c13d973ac92d224a185056840 Author: Gavrilov Ilia Date: Fri Oct 20 12:21:16 2023 +0000 net: atm: Remove redundant check. Checking the 'adev' variable is unnecessary, because 'cdev' has already been checked earlier. Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 656d98b09d57 ("[ATM]: basic sysfs support for ATM devices") Signed-off-by: Gavrilov Ilia Signed-off-by: David S. Miller commit 6cede10161be00d129a24e8b84c2674785a32cf8 Author: Yang Li Date: Mon Oct 23 09:11:24 2023 +0800 apparmor: Fix some kernel-doc comments Fix some kernel-doc comments to silence the warnings: security/apparmor/policy.c:117: warning: Function parameter or member 'kref' not described in 'aa_pdb_free_kref' security/apparmor/policy.c:117: warning: Excess function parameter 'kr' description in 'aa_pdb_free_kref' security/apparmor/policy.c:882: warning: Function parameter or member 'subj_cred' not described in 'aa_may_manage_policy' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7037 Signed-off-by: Yang Li Signed-off-by: John Johansen commit cd269ca9a7b90e8b7b11eec09f1caab622338840 Author: Yang Li Date: Mon Oct 23 09:11:23 2023 +0800 apparmor: Fix one kernel-doc comment Fix one kernel-doc comment to silence the warnings: security/apparmor/domain.c:46: warning: Function parameter or member 'to_cred' not described in 'may_change_ptraced_domain' security/apparmor/domain.c:46: warning: Excess function parameter 'cred' description in 'may_change_ptraced_domain' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7036 Signed-off-by: Yang Li Signed-off-by: John Johansen commit 6a81051398bc3fa84199fc701b94aadc37da1684 Author: Yang Li Date: Mon Oct 23 08:55:17 2023 +0800 apparmor: Fix some kernel-doc comments Fix some kernel-doc comments to silence the warnings: security/apparmor/capability.c:66: warning: Function parameter or member 'ad' not described in 'audit_caps' security/apparmor/capability.c:66: warning: Excess function parameter 'as' description in 'audit_caps' security/apparmor/capability.c:154: warning: Function parameter or member 'subj_cred' not described in 'aa_capable' security/apparmor/capability.c:154: warning: Excess function parameter 'subj_cread' description in 'aa_capable' Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7035 Signed-off-by: Yang Li Signed-off-by: John Johansen commit f5b55f32ce4ba953c270b2e9c3f5d4cd6951b1a1 Author: Deepak R Varma Date: Thu Oct 19 00:43:54 2023 +0530 accel/ivpu: Delete the TODO file The work items listed in the TODO file of this driver file are either completed or dropped. The file is no more significant according to the maintainers. Hence removing it from the sources. Suggested-by: Stanislaw Gruszka Signed-off-by: Deepak R Varma Reviewed-by: Stanislaw Gruszka Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/ZTAucrOT69/tQK2o@runicha.com commit b43cb6680b343bde54f18b458c3d0e72788fd4d1 Author: Stanislaw Gruszka Date: Fri Oct 20 12:45:01 2023 +0200 accel/ivpu/37xx: Remove support for FPGA and simics We do not run 37xx VPU on non-silicon platforms any longer. Remove deprecated code to make it cleaner. Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20231020104501.697763-7-stanislaw.gruszka@linux.intel.com commit f956bf2080862cfc97412e1eaa08689bc9838d20 Author: Stanislaw Gruszka Date: Fri Oct 20 12:45:00 2023 +0200 accel/ivpu: Do not initialize parameters on power up Initialize HW specific parameters only once. We do not have to do this on every power_up (performed during initialization and on resume). Move corresponding code to ->info_init() Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20231020104501.697763-6-stanislaw.gruszka@linux.intel.com commit a3cd664e7f971b0f33acb3ba790c142669cd34e5 Author: Krystian Pradzynski Date: Fri Oct 20 12:44:59 2023 +0200 accel/ivpu: Print IPC type string instead of number Introduce ivpu_jsm_msg_type_to_str() helper to print type of IPC message. This will make reading logs and debugging IPC issues easier. Co-developed-by: Maciej Falkowski Signed-off-by: Maciej Falkowski Signed-off-by: Krystian Pradzynski Reviewed-by: Stanislaw Gruszka Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20231020104501.697763-5-stanislaw.gruszka@linux.intel.com commit c39dc15191c4d40c58ce986e5f0daf94c84b7324 Author: Karol Wachowski Date: Fri Oct 20 12:44:58 2023 +0200 accel/ivpu: Read clock rate only if device is up Do not unnecessarily wake up device to read clock rate. Return 0 as clk_rate if device is suspended. Signed-off-by: Karol Wachowski Reviewed-by: Stanislaw Gruszka Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20231020104501.697763-4-stanislaw.gruszka@linux.intel.com commit 74ce0f3873821f12391bcf5469d81583d34f4c6c Author: Krystian Pradzynski Date: Fri Oct 20 12:44:57 2023 +0200 accel/ivpu: Fix verbose version of REG_POLL macros Remove two out of four _POLL macros. For two remaining _POLL macros add message about polling register start and finish. Additionally avoid inconsequence when using REGV_WR/RD macros in MMU code - passing raw register offset instead of register name. Signed-off-by: Krystian Pradzynski Reviewed-by: Stanislaw Gruszka Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20231020104501.697763-3-stanislaw.gruszka@linux.intel.com commit 276e4834b7e3984fff8f0b14eac5030892936a0a Author: Krystian Pradzynski Date: Fri Oct 20 12:44:56 2023 +0200 accel/ivpu: Use ratelimited warn and err in IPC/JSM Quite often during test corner cases IPC, JSM functions can flood dmesg with warn or err messages. With that lost dmesg history. Change warn, err to ratelimited versions in IPC, JSM to suppress dmesg spam occurrence during fail test scenarios. Signed-off-by: Krystian Pradzynski Reviewed-by: Stanislaw Gruszka Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20231020104501.697763-2-stanislaw.gruszka@linux.intel.com commit 14a537983b228cb050ceca3a5b743d01315dc4aa Author: Catherine Hoang Date: Tue Oct 17 13:12:08 2023 -0700 xfs: allow read IO and FICLONE to run concurrently One of our VM cluster management products needs to snapshot KVM image files so that they can be restored in case of failure. Snapshotting is done by redirecting VM disk writes to a sidecar file and using reflink on the disk image, specifically the FICLONE ioctl as used by "cp --reflink". Reflink locks the source and destination files while it operates, which means that reads from the main vm disk image are blocked, causing the vm to stall. When an image file is heavily fragmented, the copy process could take several minutes. Some of the vm image files have 50-100 million extent records, and duplicating that much metadata locks the file for 30 minutes or more. Having activities suspended for such a long time in a cluster node could result in node eviction. Clone operations and read IO do not change any data in the source file, so they should be able to run concurrently. Demote the exclusive locks taken by FICLONE to shared locks to allow reads while cloning. While a clone is in progress, writes will take the IOLOCK_EXCL, so they block until the clone completes. Link: https://lore.kernel.org/linux-xfs/8911B94D-DD29-4D6E-B5BC-32EAF1866245@oracle.com/ Signed-off-by: Catherine Hoang Reviewed-by: "Darrick J. Wong" Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Chandan Babu R commit d688c8264b8ed25edbdafac46ea2b41b2e77416a Author: Yang Li Date: Tue Oct 17 11:16:35 2023 +0800 phy: Remove duplicated include in phy-ralink-usb.c ./drivers/phy/ralink/phy-ralink-usb.c: linux/platform_device.h is included more than once. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6851 Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20231017031635.105993-1-yang.lee@linux.alibaba.com Signed-off-by: Vinod Koul commit d0ec7b9c3153c941f98226001d4019d9c03faf81 Author: Sakari Ailus Date: Tue Oct 17 11:03:54 2023 +0300 phy: Kconfig: Select GENERIC_PHY for GENERIC_PHY_MIPI_DPHY GENERIC_PHY can be selected by GENERIC_PHY_MIPI_DPHY directly as GENERIC_PHY has no dependencies. This way drivers that depend on GENERIC_PHY_MIPI_DPHY can avoid having to select both --- which they apparently often omit, too, which further leads to build failures. Signed-off-by: Sakari Ailus Reviewed-by: Randy Dunlap Tested-by: Randy Dunlap Link: https://lore.kernel.org/r/20231017080354.538047-1-sakari.ailus@linux.intel.com Signed-off-by: Vinod Koul commit 8e11a94e15a49221510dd4737a70c8dd56eb9678 Author: Mrinmay Sarkar Date: Thu Oct 19 17:07:08 2023 +0530 phy: qcom-qmp-pcie: add endpoint support for sa8775p Add support for dual lane end point mode PHY found on sa8755p platform. Signed-off-by: Mrinmay Sarkar Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/1697715430-30820-4-git-send-email-quic_msarkar@quicinc.com Signed-off-by: Vinod Koul commit f5d5a0b5553aa1a4e165e6fc6c582db487768846 Author: Sergio Paracuellos Date: Sun Oct 22 18:30:06 2023 +0200 dt-bindings: phy: ralink-usb-phy: convert to dtschema Convert the ralink-usb-phy bindings to DT schema. Signed-off-by: Sergio Paracuellos Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231022163006.803800-1-sergio.paracuellos@gmail.com Signed-off-by: Vinod Koul commit 36d91e851598a9ea523ad4681dd11fa661d59695 Author: Chuck Lever Date: Thu Oct 19 11:25:38 2023 -0400 dma-debug: Fix a typo in a debugging eye-catcher Signed-off-by: Chuck Lever Signed-off-by: Christoph Hellwig commit 1132a1dc053ef4391bb09fdb2242a628615291bb Author: Sean Christopherson Date: Fri Oct 20 08:42:15 2023 -0700 swiotlb: rewrite comment explaining why the source is preserved on DMA_FROM_DEVICE Rewrite the comment explaining why swiotlb copies the original buffer to the TLB buffer before initiating DMA *from* the device, i.e. before the device DMAs into the TLB buffer. The existing comment's argument that preserving the original data can prevent a kernel memory leak is bogus. If the driver that triggered the mapping _knows_ that the device will overwrite the entire mapping, or the driver will consume only the written parts, then copying from the original memory is completely pointless. If neither of the above holds true, then copying from the original adds value only if preserving the data is necessary for functional correctness, or the driver explicitly initialized the original memory. If the driver didn't initialize the memory, then copying the original buffer to the TLB buffer simply changes what kernel data is leaked to user space. Writing the entire TLB buffer _does_ prevent leaking stale TLB buffer data from a previous bounce, but that can be achieved by simply zeroing the TLB buffer when grabbing a slot. The real reason swiotlb ended up initializing the TLB buffer with the original buffer is that it's necessary to make swiotlb operate as transparently as possible, i.e. to behave as closely as possible to hardware, and to avoid corrupting the original buffer, e.g. if the driver knows the device will do partial writes and is relying on the unwritten data to be preserved. Reviewed-by: Robin Murphy Link: https://lore.kernel.org/all/ZN5elYQ5szQndN8n@google.com Signed-off-by: Sean Christopherson Signed-off-by: Christoph Hellwig commit 35dc55b9e80cb9ec4bcb969302000b002b2ed850 Author: Christoph Hellwig Date: Wed Oct 11 07:16:26 2023 +0200 xfs: handle nimaps=0 from xfs_bmapi_write in xfs_alloc_file_space If xfs_bmapi_write finds a delalloc extent at the requested range, it tries to convert the entire delalloc extent to a real allocation. But if the allocator cannot find a single free extent large enough to cover the start block of the requested range, xfs_bmapi_write will return 0 but leave *nimaps set to 0. In that case we simply need to keep looping with the same startoffset_fsb so that one of the following allocations will eventually reach the requested range. Note that this could affect any caller of xfs_bmapi_write that covers an existing delayed allocation. As far as I can tell we do not have any other such caller, though - the regular writeback path uses xfs_bmapi_convert_delalloc to convert delayed allocations to real ones, and direct I/O invalidates the page cache first. Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" Signed-off-by: Chandan Babu R commit 2b99e410b28f5a75ae417e6389e767c7745d6fce Author: Cheng Lin Date: Tue Oct 10 10:09:01 2023 +0800 xfs: introduce protection for drop nlink When abnormal drop_nlink are detected on the inode, return error, to avoid corruption propagation. Signed-off-by: Cheng Lin Reviewed-by: "Darrick J. Wong" Signed-off-by: Chandan Babu R commit 9fa8753aa1f177dfb859ee22daed47c337c84278 Merge: 830b4abfe2de6 e0f7422f54b09 Author: Chandan Babu R Date: Mon Oct 23 10:59:22 2023 +0530 Merge tag 'rtalloc-speedups-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.7-mergeA xfs: CPU usage optimizations for realtime allocator [v2.3] This is version 2 of [Omar's] XFS realtime allocator opimization patch series. Changes since v1 [1]: - Fixed potential overflow in patch 4. - Changed deprecated typedefs to normal struct names - Fixed broken indentation - Used xfs_fileoff_t instead of xfs_fsblock_t where appropriate. - Added calls to xfs_rtbuf_cache_relse anywhere that the cache is used instead of relying on the buffers being dirtied and thus attached to the transaction. - Clarified comments and commit messages in a few places. - Added Darrick's Reviewed-bys. Cover letter from v1: Our distributed storage system uses XFS's realtime device support as a way to split an XFS filesystem between an SSD and an HDD -- we configure the HDD as the realtime device so that metadata goes on the SSD and data goes on the HDD. We've been running this in production for a few years now, so we have some fairly fragmented filesystems. This has exposed various CPU inefficiencies in the realtime allocator. These became even worse when we experimented with using XFS_XFLAG_EXTSIZE to force files to be allocated contiguously. This series adds several optimizations that don't change the realtime allocator's decisions, but make them happen more efficiently, mainly by avoiding redundant work. We've tested these in production and measured ~10%% lower CPU utilization. Furthermore, it made it possible to use XFS_XFLAG_EXTSIZE to force contiguous allocations -- without these patches, our most fragmented systems would become unresponsive due to high CPU usage in the realtime allocator, but with them, CPU utilization is actually ~4-6%% lower than before, and disk I/O utilization is 15-20%% lower. Patches 2 and 3 are preparations for later optimizations; the remaining patches are the optimizations themselves. 1: https://lore.kernel.org/linux-xfs/cover.1687296675.git.osandov@osandov.com/ v2.1: djwong rebased everything atop his own cleanups, added dave's rtalloc_args v2.2: rebase with new apis and clean them up too v2.3: move struct definition around for lolz With a bit of luck, this should all go splendidly. Signed-off-by: Darrick J. Wong Signed-off-by: Chandan Babu R * tag 'rtalloc-speedups-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux: xfs: don't look for end of extent further than necessary in xfs_rtallocate_extent_near() xfs: don't try redundant allocations in xfs_rtallocate_extent_near() xfs: limit maxlen based on available space in xfs_rtallocate_extent_near() xfs: return maximum free size from xfs_rtany_summary() xfs: invert the realtime summary cache xfs: simplify rt bitmap/summary block accessor functions xfs: simplify xfs_rtbuf_get calling conventions xfs: cache last bitmap block in realtime allocator xfs: consolidate realtime allocation arguments commit 830b4abfe2de63691a2bb5bcc17d7254b61b7c7d Merge: 035e32f7524dd 663b8db7b0256 Author: Chandan Babu R Date: Mon Oct 23 10:54:45 2023 +0530 Merge tag 'refactor-rtbitmap-accessors-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.7-mergeA xfs: refactor rtbitmap/summary accessors [v1.2] Since the rtbitmap and rtsummary accessor functions have proven more controversial than the rest of the macro refactoring, split the patchset into two to make review easier. v1.1: various cleanups suggested by hch v1.2: rework the accessor functions to reduce the amount of cursor tracking required, and create explicit bitmap/summary logging functions With a bit of luck, this should all go splendidly. Signed-off-by: Darrick J. Wong Signed-off-by: Chandan Babu R * tag 'refactor-rtbitmap-accessors-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux: xfs: use accessor functions for summary info words xfs: create helpers for rtsummary block/wordcount computations xfs: use accessor functions for bitmap words xfs: create a helper to handle logging parts of rt bitmap/summary blocks commit 035e32f7524dd30f187ee23d2331832a61f3fc87 Merge: 9d4ca5afa604d d0448fe76ac1a Author: Chandan Babu R Date: Mon Oct 23 10:49:53 2023 +0530 Merge tag 'refactor-rtbitmap-macros-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.7-mergeA xfs: refactor rtbitmap/summary macros [v1.1] In preparation for adding block headers and enforcing endian order in rtbitmap and rtsummary blocks, replace open-coded geometry computations and fugly macros with proper helper functions that can be typechecked. Soon we'll be needing to add more complex logic to the helpers. v1.1: various cleanups suggested by hch With a bit of luck, this should all go splendidly. Signed-off-by: Darrick J. Wong Signed-off-by: Chandan Babu R * tag 'refactor-rtbitmap-macros-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux: xfs: create helpers for rtbitmap block/wordcount computations xfs: convert rt summary macros to helpers xfs: convert open-coded xfs_rtword_t pointer accesses to helper xfs: remove XFS_BLOCKWSIZE and XFS_BLOCKWMASK macros xfs: convert the rtbitmap block and bit macros to static inline functions commit 9d4ca5afa604d35c2e9caba0982a53ffe0fa4469 Merge: 3ef52c010973e ef5a83b7e5970 Author: Chandan Babu R Date: Mon Oct 23 10:45:10 2023 +0530 Merge tag 'refactor-rt-unit-conversions-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.7-mergeA xfs: refactor rt extent unit conversions [v1.1] This series replaces all the open-coded integer division and multiplication conversions between rt blocks and rt extents with calls to static inline helpers. Having cleaned all that up, the helpers are augmented to skip the expensive operations in favor of bit shifts and masking if the rt extent size is a power of two. v1.1: various cleanups suggested by hch With a bit of luck, this should all go splendidly. Signed-off-by: Darrick J. Wong Signed-off-by: Chandan Babu R * tag 'refactor-rt-unit-conversions-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux: xfs: use shifting and masking when converting rt extents, if possible xfs: create rt extent rounding helpers for realtime extent blocks xfs: convert do_div calls to xfs_rtb_to_rtx helper calls xfs: create helpers to convert rt block numbers to rt extent numbers xfs: create a helper to convert extlen to rtextlen xfs: create a helper to compute leftovers of realtime extents xfs: create a helper to convert rtextents to rtblocks commit 53a5b4f2ea858482a427878bca988a7fa9b2ebdc Author: Steffen Klassert Date: Fri Oct 20 10:05:55 2023 +0200 xfrm Fix use after free in __xfrm6_udp_encap_rcv. A recent patch changed xfrm6_udp_encap_rcv to not free the skb itself anymore but fogot the case where xfrm4_udp_encap_rcv is called subsequently. Fix this by moving the call to xfrm4_udp_encap_rcv from __xfrm6_udp_encap_rcv to xfrm6_udp_encap_rcv. Fixes: 221ddb723d90 ("xfrm: Support GRO for IPv6 ESP in UDP encapsulation") Signed-off-by: Steffen Klassert commit 3ef52c010973e3fae53b1a9eabc156a79b01cd8c Merge: d0e85e79d680d 2d5f216b77e33 Author: Chandan Babu R Date: Mon Oct 23 10:40:39 2023 +0530 Merge tag 'clean-up-realtime-units-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.7-mergeA xfs: clean up realtime type usage [v1.1] The realtime code uses xfs_rtblock_t and xfs_fsblock_t in a lot of places, and it's very confusing. Clean up all the type usage so that an xfs_rtblock_t is always a block within the realtime volume, an xfs_fileoff_t is always a file offset within a realtime metadata file, and an xfs_rtxnumber_t is always a rt extent within the realtime volume. v1.1: various cleanups suggested by hch With a bit of luck, this should all go splendidly. Signed-off-by: Darrick J. Wong Signed-off-by: Chandan Babu R * tag 'clean-up-realtime-units-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux: xfs: convert rt extent numbers to xfs_rtxnum_t xfs: rename xfs_verify_rtext to xfs_verify_rtbext xfs: convert rt bitmap extent lengths to xfs_rtbxlen_t xfs: convert rt bitmap/summary block numbers to xfs_fileoff_t xfs: convert xfs_extlen_t to xfs_rtxlen_t in the rt allocator xfs: move the xfs_rtbitmap.c declarations to xfs_rtbitmap.h xfs: make sure maxlen is still congruent with prod when rounding down xfs: fix units conversion error in xfs_bmap_del_extent_delay commit d0e85e79d680de8413f42e24493ab36b03e58bd6 Merge: 05d3ef8bba77c c2988eb5cff75 Author: Chandan Babu R Date: Mon Oct 23 10:36:35 2023 +0530 Merge tag 'realtime-fixes-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.7-mergeA xfs: minor bugfixes for rt stuff [v1.1] This is a preparatory patchset that fixes a few miscellaneous bugs before we start in on larger cleanups of realtime units usage. v1.1: various cleanups suggested by hch With a bit of luck, this should all go splendidly. Signed-off-by: Darrick J. Wong Signed-off-by: Chandan Babu R * tag 'realtime-fixes-6.7_2023-10-19' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux: xfs: rt stubs should return negative errnos when rt disabled xfs: prevent rt growfs when quota is enabled xfs: hoist freeing of rt data fork extent mappings xfs: bump max fsgeom struct version commit 16794ed32de9c7678021e599665e5c44dc7d027e Author: Vegard Nossum Date: Sun Oct 22 20:53:11 2023 +0200 docs: usb: fix reference to nonexistent file in UVC Gadget Fix a typo in the path of this reference. Fixes: 094f391013ba ("docs: usb: Add documentation for the UVC Gadget") Cc: Daniel Scally Cc: Greg Kroah-Hartman Signed-off-by: Vegard Nossum Signed-off-by: Jonathan Corbet Message-ID: <20231022185311.919325-1-vegard.nossum@oracle.com> commit 40d35bf9633d76185877f162e167eb09d7ccea0a Author: Vegard Nossum Date: Sun Oct 22 20:49:10 2023 +0200 docs: doc-guide: mention 'make refcheckdocs' Add this to the section on fixing warnings. Cc: Mauro Carvalho Chehab Cc: Jonathan Corbet Signed-off-by: Vegard Nossum Signed-off-by: Jonathan Corbet Message-ID: <20231022184910.919201-1-vegard.nossum@oracle.com> commit a10874e8db9421731bb2bb26ada4412043494471 Author: Jade Lovelace Date: Thu Oct 19 16:16:55 2023 -0700 Documentation: fix typo in dynamic-debug howto Signed-off-by: Jade Lovelace Signed-off-by: Jonathan Corbet Message-ID: <20231019231655.3162225-1-lists@jade.fyi> commit 91f950e8b9d8419d72e9f06250b6471cdfd534d7 Author: Yujie Liu Date: Thu Oct 19 17:56:37 2023 +0800 scripts/kernel-doc: match -Werror flag strictly In our CI testing, we use some commands as below to only turn a specific type of warnings into errors, but we notice that kernel-doc warnings are also turned into errors unexpectedly. $ make KCFLAGS="-Werror=return-type" W=1 kernel/fork.o kernel/fork.c:1406: warning: Function parameter or member 'mm' not described in 'set_mm_exe_file' kernel/fork.c:1406: warning: Function parameter or member 'new_exe_file' not described in 'set_mm_exe_file' kernel/fork.c:1441: warning: Function parameter or member 'mm' not described in 'replace_mm_exe_file' kernel/fork.c:1441: warning: Function parameter or member 'new_exe_file' not described in 'replace_mm_exe_file' kernel/fork.c:1491: warning: Function parameter or member 'mm' not described in 'get_mm_exe_file' kernel/fork.c:1510: warning: Function parameter or member 'task' not described in 'get_task_exe_file' kernel/fork.c:1534: warning: Function parameter or member 'task' not described in 'get_task_mm' kernel/fork.c:2109: warning: bad line: kernel/fork.c:2130: warning: Function parameter or member 'ret' not described in '__pidfd_prepare' kernel/fork.c:2130: warning: Excess function parameter 'pidfd' description in '__pidfd_prepare' kernel/fork.c:2179: warning: Function parameter or member 'ret' not described in 'pidfd_prepare' kernel/fork.c:2179: warning: Excess function parameter 'pidfd' description in 'pidfd_prepare' kernel/fork.c:3195: warning: expecting prototype for clone3(). Prototype was for sys_clone3() instead 13 warnings as Errors make[3]: *** [scripts/Makefile.build:243: kernel/fork.o] Error 13 make[3]: *** Deleting file 'kernel/fork.o' make[2]: *** [scripts/Makefile.build:480: kernel] Error 2 make[1]: *** [/root/linux/Makefile:1913: .] Error 2 make: *** [Makefile:234: __sub-make] Error 2 >From the git history, commit 2c12c8103d8f ("scripts/kernel-doc: optionally treat warnings as errors") introduces a new command-line option to make kernel-doc warnings into errors. It can also read the KCFLAGS environment variable to decide whether to turn this option on, but the regex used for matching may not be accurate enough. It can match both "-Werror" and "-Werror=", so the option is turned on by mistake in the latter case. Fix this by strictly matching the flag "-Werror": there must be a space or start of string in the front, and a space or end of string at the end. This can handle all the following cases correctly: KCFLAGS="-Werror" make W=1 [MATCH] KCFLAGS="-Werror=return-type" make W=1 [NO MATCH] KCFLAGS="-Wcomment -Werror -Wundef" make W=1 [MATCH] KCFLAGS="-Wcomment -Werror=return-type -Wundef" make W=1 [NO MATCH] Fixes: 2c12c8103d8f ("scripts/kernel-doc: optionally treat warnings as errors") Signed-off-by: Yujie Liu Signed-off-by: Jonathan Corbet Message-ID: <20231019095637.2471840-1-yujie.liu@intel.com> commit 6037487045629e1d33b9aeb93624f75d372ed1d0 Author: Charles Han Date: Wed Oct 18 10:30:46 2023 +0800 Documentation/sphinx: Remove the repeated word "the" in comments. Remove the repeated word "the" in comments. Signed-off-by: Charles Han Signed-off-by: Jonathan Corbet Message-ID: <20231018023046.30022-1-hanchunchao@inspur.com> commit eda5a18efa99f51f0dbff3209684a57532c93f23 Author: Min-Hua Chen Date: Thu Oct 12 07:37:56 2023 +0800 docs: sparse: add SPDX-License-Identifier Add SPDX-License-Identifier to fix the checkpatch warning: WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier tag in line 1 \#26: FILE: Documentation/translations/zh_TW/dev-tools/index.rst:1: +.. include:: ../disclaimer-zh_TW.rst Signed-off-by: Min-Hua Chen Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310110859.tumJoXFl-lkp@intel.com/ Signed-off-by: Jonathan Corbet Message-ID: <20231011233757.181652-1-minhuadotchen@gmail.com> commit 4c38b676d688844668afb4e688a60bfae66feba0 Author: Tang Yizhou Date: Wed Oct 11 23:25:20 2023 +0800 docs/zh_CN: Add subsystem-apis Chinese translation Translate subsystem-apis.rst into Chinese. The existence of this document is crucial. Without it, other Chinese documents included in (such as sched-design-CFS.rst) will not be displayed correctly in the left side of the web page. Signed-off-by: Tang Yizhou Reviewed-by: Yanteng Si Signed-off-by: Jonathan Corbet Message-ID: <20231011152520.31079-1-tangyeechou@gmail.com> commit 0c180317c654a494fe429adbf7bc9b0793caf9e2 Author: Namjae Jeon Date: Sat Oct 21 21:01:20 2023 +0900 ksmbd: add support for surrogate pair conversion ksmbd is missing supporting to convert filename included surrogate pair characters. It triggers a "file or folder does not exist" error in Windows client. [Steps to Reproduce for bug] 1. Create surrogate pair file touch $(echo -e '\xf0\x9d\x9f\xa3') touch $(echo -e '\xf0\x9d\x9f\xa4') 2. Try to open these files in ksmbd share through Windows client. This patch update unicode functions not to consider about surrogate pair (and IVS). Reviewed-by: Marios Makassikis Tested-by: Marios Makassikis Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit ecce70cf17d91c3dd87a0c4ea00b2d1387729701 Author: Kangjing Huang Date: Sat Oct 21 03:42:07 2023 -0400 ksmbd: fix missing RDMA-capable flag for IPoIB device in ksmbd_rdma_capable_netdev() Physical ib_device does not have an underlying net_device, thus its association with IPoIB net_device cannot be retrieved via ops.get_netdev() or ib_device_get_by_netdev(). ksmbd reads physical ib_device port GUID from the lower 16 bytes of the hardware addresses on IPoIB net_device and match its underlying ib_device using ib_find_gid() Signed-off-by: Kangjing Huang Acked-by: Namjae Jeon Reviewed-by: Tom Talpey Signed-off-by: Steve French commit 807252f028c59b9a3bac4d62ad84761548c10f11 Author: Marios Makassikis Date: Sat Oct 14 12:48:25 2023 +0900 ksmbd: fix recursive locking in vfs helpers Running smb2.rename test from Samba smbtorture suite against a kernel built with lockdep triggers a "possible recursive locking detected" warning. This is because mnt_want_write() is called twice with no mnt_drop_write() in between: -> ksmbd_vfs_mkdir() -> ksmbd_vfs_kern_path_create() -> kern_path_create() -> filename_create() -> mnt_want_write() -> mnt_want_write() Fix this by removing the mnt_want_write/mnt_drop_write calls from vfs helpers that call kern_path_create(). Full lockdep trace below: ============================================ WARNING: possible recursive locking detected 6.6.0-rc5 #775 Not tainted -------------------------------------------- kworker/1:1/32 is trying to acquire lock: ffff888005ac83f8 (sb_writers#5){.+.+}-{0:0}, at: ksmbd_vfs_mkdir+0xe1/0x410 but task is already holding lock: ffff888005ac83f8 (sb_writers#5){.+.+}-{0:0}, at: filename_create+0xb6/0x260 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(sb_writers#5); lock(sb_writers#5); *** DEADLOCK *** May be due to missing lock nesting notation 4 locks held by kworker/1:1/32: #0: ffff8880064e4138 ((wq_completion)ksmbd-io){+.+.}-{0:0}, at: process_one_work+0x40e/0x980 #1: ffff888005b0fdd0 ((work_completion)(&work->work)){+.+.}-{0:0}, at: process_one_work+0x40e/0x980 #2: ffff888005ac83f8 (sb_writers#5){.+.+}-{0:0}, at: filename_create+0xb6/0x260 #3: ffff8880057ce760 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: filename_create+0x123/0x260 Cc: stable@vger.kernel.org Fixes: 40b268d384a2 ("ksmbd: add mnt_want_write to ksmbd vfs functions") Signed-off-by: Marios Makassikis Acked-by: Namjae Jeon Signed-off-by: Steve French commit 3354db668808d5b6d7c5e0cb19ff4c9da4bb5e58 Author: Namjae Jeon Date: Tue Oct 10 00:04:10 2023 +0900 ksmbd: fix kernel-doc comment of ksmbd_vfs_setxattr() Fix argument list that the kdoc format and script verified in ksmbd_vfs_setxattr(). fs/smb/server/vfs.c:929: warning: Function parameter or member 'path' not described in 'ksmbd_vfs_setxattr' Reported-by: kernel test robot Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 1819a904299942b309f687cc0f08b123500aa178 Author: Namjae Jeon Date: Mon Oct 9 23:57:20 2023 +0900 ksmbd: reorganize ksmbd_iov_pin_rsp() If ksmbd_iov_pin_rsp fail, io vertor should be rollback. This patch moves memory allocations to before setting the io vector to avoid rollbacks. Fixes: e2b76ab8b5c9 ("ksmbd: add support for read compound") Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit eacc655e18d1dec9b50660d16a1ddeeb4d6c48f2 Author: Cheng-Han Wu Date: Mon Oct 2 13:32:03 2023 +0800 ksmbd: Remove unused field in ksmbd_user struct fs/smb/server/mgmt/user_config.h:21: Remove the unused field 'failed_login_count' from the ksmbd_user struct. Signed-off-by: Cheng-Han Wu Acked-by: Namjae Jeon Signed-off-by: Steve French commit 1460720c5913c11415e4d7c4df5a287eb2ad3f3e Author: Meetakshi Setiya Date: Wed Oct 4 07:17:55 2023 -0400 cifs: Add client version details to NTLM authenticate message The NTLM authenticate message currently sets the NTLMSSP_NEGOTIATE_VERSION flag but does not populate the VERSION structure. This commit fixes this bug by ensuring that the flag is set and the version details are included in the message. Signed-off-by: Meetakshi Setiya Reviewed-by: Bharath SM Reviewed-by: Paulo Alcantara (SUSE) Reviewed-by: Shyam Prasad N Signed-off-by: Steve French commit 475efd9808a3094944a56240b2711349e433fb66 Author: Steve French Date: Mon Oct 16 12:18:23 2023 -0500 smb3: fix touch -h of symlink For example: touch -h -t 02011200 testfile where testfile is a symlink would not change the timestamp, but touch -t 02011200 testfile does work to change the timestamp of the target Suggested-by: David Howells Reported-by: Micah Veilleux Closes: https://bugzilla.samba.org/show_bug.cgi?id=14476 Cc: stable@vger.kernel.org Signed-off-by: Steve French commit 59464b262ff5b35840f1af77c52173dee9f4de31 Author: Trond Myklebust Date: Sun Sep 17 14:59:40 2023 -0400 SUNRPC: SOFTCONN tasks should time out when on the sending list SOFTCONN tasks need to periodically check if the transport is still connected, so that they can time out if that is not the case. Signed-off-by: Trond Myklebust commit f663507e29ff061d3b6e5e8f3b75689ee9dc7214 Author: Trond Myklebust Date: Sun Sep 17 14:57:39 2023 -0400 SUNRPC: Force close the socket when a hard error is reported Fix up xs_wake_error() to close the socket when a hard error is being reported. Usually, that means an ECONNRESET was received on a connection attempt. Signed-off-by: Trond Myklebust commit caa388f7e54ba4ec603f9aeb2705d75adbddea20 Author: Trond Myklebust Date: Sun Sep 17 11:26:27 2023 -0400 SUNRPC: Don't skip timeout checks in call_connect_status() Signed-off-by: Trond Myklebust commit 4b09ca1508a60be30b2e3940264e93d7aeb5c97e Author: Trond Myklebust Date: Sun Sep 17 09:06:05 2023 -0400 SUNRPC: ECONNRESET might require a rebind If connect() is returning ECONNRESET, it usually means that nothing is listening on that port. If so, a rebind might be required in order to obtain the new port on which the RPC service is listening. Fixes: fd01b2597941 ("SUNRPC: ECONNREFUSED should cause a rebind.") Signed-off-by: Trond Myklebust commit 6e7434abcd07e8beb67fdc4af6207ae0490d5274 Author: Trond Myklebust Date: Sat Sep 9 19:16:53 2023 -0400 NFSv4/pnfs: Allow layoutget to return EAGAIN for softerr mounts If we're using the 'softerr' mount option, we may want to allow layoutget to return EAGAIN to allow knfsd server threads to return a JUKEBOX/DELAY error to the client instead of busy waiting. Signed-off-by: Trond Myklebust commit 5b9d31ae1c925bb5f15975e31b31ff5ae3c81f8f Author: Trond Myklebust Date: Sat Sep 9 12:23:01 2023 -0400 NFSv4: Add a parameter to limit the number of retries after NFS4ERR_DELAY When using a 'softerr' mount, the NFSv4 client can get stuck waiting forever while the server just returns NFS4ERR_DELAY. Among other things, this causes the knfsd server threads to busy wait. Add a parameter that tells the NFSv4 client how many times to retry before giving up. Signed-off-by: Trond Myklebust commit 07a37547bd1766f2d01e93a33ce055820f1ada99 Author: David Wronek Date: Sat Oct 21 09:16:19 2023 +0200 dt-bindings: arm: cpus: Add Qualcomm Kryo 465 Add a compatible for the Qualcomm Kryo 465 found in SM7125. Signed-off-by: David Wronek Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231021071619.187374-1-davidwronek@gmail.com Signed-off-by: Rob Herring commit 2508b608f4028c6fe0d63698f64a9bfc3eb6b780 Author: Greg Ungerer Date: Wed Sep 13 00:09:22 2023 +1000 m68k: 68000: fix warning in timer code When building with W=1: CC arch/m68k/68000/timers.o arch/m68k/68000/timers.c:120:5: warning: no previous prototype for ‘m68328_hwclk’ [-Wmissing-prototypes] int m68328_hwclk(int set, struct rtc_time *t) ^~~~~~~~~~~~ Include m68328.h to get prototype for m68328_hwclk(). Signed-off-by: Greg Ungerer commit 19f144f43f4cf5d56409a8908125405e5cf6c3e0 Author: Greg Ungerer Date: Wed Sep 13 00:02:53 2023 +1000 m68k: 68000: fix warnings in 68000 interrupt handling When building with W=1: CC arch/m68k/68000/ints.o arch/m68k/68000/ints.c:77:6: warning: no previous prototype for ‘process_int’ [-Wmissing-prototypes] void process_int(int vec, struct pt_regs *fp) ^~~~~~~~~~~ arch/m68k/68000/ints.c:153:13: warning: no previous prototype for ‘trap_init’ [-Wmissing-prototypes] void __init trap_init(void) ^~~~~~~~~ Include linux/cpu.h to get the prototype for taps_init(). Create a local ints.h for prototype of process_int(). Also mark process_int() as asmlinkage, since it is called from the first level interrupt assembly handler. Signed-off-by: Greg Ungerer commit 0a49a430e6dee8aa036df81898d17ce8abc397fa Author: Greg Ungerer Date: Tue Sep 12 23:31:39 2023 +1000 m68k: coldfire: remove unused variable in MMU code When building with W=1: CC arch/m68k/mm/mcfmmu.o arch/m68k/mm/mcfmmu.c: In function ‘paging_init’: arch/m68k/mm/mcfmmu.c:41:30: warning: variable ‘bootmem_end’ set but not used [-Wunused-but-set-variable] unsigned long next_pgtable, bootmem_end; ^~~~~~~~~~~ Remove variable bootmem_end and its unused setting. Signed-off-by: Greg Ungerer commit 3b4497668f721513eb7287f6bb0c4d651759c7c4 Author: Greg Ungerer Date: Tue Sep 12 22:29:23 2023 +1000 m68k: coldfire: fix warnings in uboot argument processing When building with W=1: CC arch/m68k/kernel/uboot.o arch/m68k/kernel/uboot.c: In function ‘parse_uboot_commandline’: arch/m68k/kernel/uboot.c:68:36: warning: variable ‘uboot_initrd_end’ set but not used [-Wunused-but-set-variable] unsigned long uboot_initrd_start, uboot_initrd_end; ^~~~~~~~~~~~~~~~ arch/m68k/kernel/uboot.c:68:16: warning: variable ‘uboot_initrd_start’ set but not used [-Wunused-but-set-variable] unsigned long uboot_initrd_start, uboot_initrd_end; ^~~~~~~~~~~~~~~~~~ arch/m68k/kernel/uboot.c:66:16: warning: variable ‘uboot_kbd’ set but not used [-Wunused-but-set-variable] unsigned long uboot_kbd; ^~~~~~~~~ arch/m68k/kernel/uboot.c: At top level: arch/m68k/kernel/uboot.c:90:13: warning: no previous prototype for ‘process_uboot_commandline’ [-Wmissing-prototypes] __init void process_uboot_commandline(char *commandp, int size) ^~~~~~~~~~~~~~~~~~~~~~~~~ A couple of issues here. Firstly we already have a bootinfo.h that has a prototype for process_uboot_commandline(), we should include that. Secondly uboot_kbd is not used at all and can be removed. Thirdly the conditional code based on CONFIG_BLK_DEV_INITRD means that sometimes uboot_initrd_start and uboot_initrd_end are not needed. Make their declaration and asignment conditional on CONFIG_BLK_DEV_INITRD same as the code that uses them. Signed-off-by: Greg Ungerer commit 7c2aa8d195cd34ec47ac26994adac43bfd5037b8 Author: Greg Ungerer Date: Tue Sep 12 13:58:06 2023 +1000 m68k: coldfire: make mcf_maskimr() static When building with W=1: CC arch/m68k/coldfire/intc.o arch/m68k/coldfire/intc.c:83:6: warning: no previous prototype for ‘mcf_maskimr’ [-Wmissing-prototypes] void mcf_maskimr(unsigned int mask) ^~~~~~~~~~~ The mcf_maskimr() function is only used within this file, make it static to reduce name space pollution and fix warning. Signed-off-by: Greg Ungerer commit 863dafa74eceaa7dc45c781566efc5395085f178 Author: Greg Ungerer Date: Tue Sep 12 12:07:42 2023 +1000 m68k: coldfire: ensure gpio prototypes visible When building with W=1: CC arch/m68k/coldfire/gpio.o arch/m68k/coldfire/gpio.c:19:5: warning: no previous prototype for ‘__mcfgpio_get_value’ [-Wmissing-prototypes] int __mcfgpio_get_value(unsigned gpio) ^~~~~~~~~~~~~~~~~~~ arch/m68k/coldfire/gpio.c:25:6: warning: no previous prototype for ‘__mcfgpio_set_value’ [-Wmissing-prototypes] void __mcfgpio_set_value(unsigned gpio, int value) ^~~~~~~~~~~~~~~~~~~ arch/m68k/coldfire/gpio.c:50:5: warning: no previous prototype for ‘__mcfgpio_direction_input’ [-Wmissing-prototypes] int __mcfgpio_direction_input(unsigned gpio) ^~~~~~~~~~~~~~~~~~~~~~~~~ arch/m68k/coldfire/gpio.c:65:5: warning: no previous prototype for ‘__mcfgpio_direction_output’ [-Wmissing-prototypes] int __mcfgpio_direction_output(unsigned gpio, int value) ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/m68k/coldfire/gpio.c:96:5: warning: no previous prototype for ‘__mcfgpio_request’ [-Wmissing-prototypes] int __mcfgpio_request(unsigned gpio) ^~~~~~~~~~~~~~~~~ arch/m68k/coldfire/gpio.c:102:6: warning: no previous prototype for ‘__mcfgpio_free’ [-Wmissing-prototypes] void __mcfgpio_free(unsigned gpio) ^~~~~~~~~~~~~~ The local m68k asm version of gpio.h has prototypes for all of these, but they are not always visible depending on the config options enabled. Move the prototypes so they are always visible. Signed-off-by: Greg Ungerer commit b6880019ff3ed72b0813b6bcb5c23afdf8b8e75c Author: Greg Ungerer Date: Tue Sep 12 00:05:04 2023 +1000 m68k: coldfire: add and use "vectors.h" When building with W=1: arch/m68k/coldfire/vectors.c:43:13: warning: no previous prototype for ‘trap_init’ [-Wmissing-prototypes] void __init trap_init(void) ^~~~~~~~~ Fix this by introducing a new header file "vectors.h" for holding the prototypes of functions implemented in arch/m68k/coldfire/vectors.c. Signed-off-by: Greg Ungerer commit 7bc3db03e3dd344c3dc93c1dfe684d53d2a5ffbf Author: Greg Ungerer Date: Wed Sep 13 22:41:51 2023 +1000 m68knommu: fix compilation for ColdFire/Cleopatra boards The ColdFire based Cleopatra family of boards use mostly the same external pin arrangements as the NETtel board family. The build uses the NETtel specific code as needed, but not all the conditional defines allow for this. If you have the CONFIG_NETtel config option set everything compiles as expected, but if you only select the CONFIG_CLEOPATRA board type then you will get compile failures: arch/m68k/coldfire/nettel.c: In function ‘nettel_smc91x_init’: arch/m68k/coldfire/nettel.c:126:2: error: implicit declaration of function ‘mcf_setppdata’; did you mean ‘xas_set_update’? [-Werror=implicit-function-declaration] mcf_setppdata(0, 0x0080); ^~~~~~~~~~~~~ xas_set_update Fix the nettel.h include conditional checks to cover all board types. This also means some code paths need to check for the 5407 SoC - since one of the Cleopatra board types is based on that. It is very similar to the 5307 specific code, and it can use that "as-is". Signed-off-by: Greg Ungerer commit 0100f67c46c04628ff4ce81d1f2f04924b83b14e Author: Greg Ungerer Date: Wed Sep 13 21:58:22 2023 +1000 m68knommu: improve config ROM setting defaults The ROM region configuration settings used on some nommu m68k systems (historically mostly 68328 (Dragonball) CPUs) default to an address of 0. That can easily clash with default RAM address settings which also default to 0. Of course that is invalid and those ranges overlap, but if you make no value selection that is what you end up with. Those default values produce a valid configuration but will fail compilation like this: m68k-linux-ld: section .rodata VMA [0000000000001000,0000000000262227] overlaps section .text VMA [0000000000000400,0000000000455e7f] Looking at the platforms that use the ROM region configuration settings it is clear that we can choose much better defaults than 0. By far the most common ROM region settings are these: CONFIG_ROMVEC=0x10c10000 CONFIG_ROMSTART=0x10c10400 So lets make these the default values. It is still possible to configure overlapping ROM and RAM regions, but at least the default selections are now valid. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305301407.z33zOjcG-lkp@intel.com/ Signed-off-by: Greg Ungerer commit 7413ab70cbc15bd8f35a78569ec5a778fb9a3e1e Author: Kees Cook Date: Wed Oct 18 16:07:32 2023 -0700 bcachefs: Refactor memcpy into direct assignment The memcpy() in bch2_bkey_append_ptr() is operating on an embedded fake flexible array which looks to the compiler like it has 0 size. This causes W=1 builds to emit warnings due to -Wstringop-overflow: In file included from include/linux/string.h:254, from include/linux/bitmap.h:11, from include/linux/cpumask.h:12, from include/linux/smp.h:13, from include/linux/lockdep.h:14, from include/linux/radix-tree.h:14, from include/linux/backing-dev-defs.h:6, from fs/bcachefs/bcachefs.h:182: fs/bcachefs/extents.c: In function 'bch2_bkey_append_ptr': include/linux/fortify-string.h:57:33: warning: writing 8 bytes into a region of size 0 [-Wstringop-overflow=] 57 | #define __underlying_memcpy __builtin_memcpy | ^ include/linux/fortify-string.h:648:9: note: in expansion of macro '__underlying_memcpy' 648 | __underlying_##op(p, q, __fortify_size); \ | ^~~~~~~~~~~~~ include/linux/fortify-string.h:693:26: note: in expansion of macro '__fortify_memcpy_chk' 693 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ | ^~~~~~~~~~~~~~~~~~~~ fs/bcachefs/extents.c:235:17: note: in expansion of macro 'memcpy' 235 | memcpy((void *) &k->v + bkey_val_bytes(&k->k), | ^~~~~~ fs/bcachefs/bcachefs_format.h:287:33: note: destination object 'v' of size 0 287 | struct bch_val v; | ^ Avoid making any structure changes and just replace the u64 copy into a direct assignment, side-stepping the entire problem. Cc: Kent Overstreet Cc: Brian Foster Cc: linux-bcachefs@vger.kernel.org Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309192314.VBsjiIm5-lkp@intel.com/ Link: https://lore.kernel.org/r/20231010235609.work.594-kees@kernel.org Signed-off-by: Kees Cook Signed-off-by: Kent Overstreet commit 795413c5488536476dacff9e565e53a51d7798d8 Author: Kent Overstreet Date: Fri Sep 29 16:13:00 2023 -0400 bcachefs: Fix drop_alloc_keys() For consistency with the rest of the reconstruct_alloc option, we should be skipping all alloc keys. Signed-off-by: Kent Overstreet commit 37fad9497f5d37d89ed06faa64d580d1451be664 Author: Kent Overstreet Date: Fri Sep 29 01:15:33 2023 -0400 bcachefs: snapshot_create_lock Add a new lock for snapshot creation - this addresses a few races with logged operations and snapshot deletion. Signed-off-by: Kent Overstreet commit 1e2d399970ca1d66fa1c715f4d80a0251f2a122e Author: Kent Overstreet Date: Fri Sep 29 00:46:30 2023 -0400 bcachefs: Fix snapshot skiplists during snapshot deletion In snapshot deleion, we have to pick new skiplist nodes for entries that point to nodes being deleted. The function that finds a new skiplist node, skipping over entries being deleted, was incorrect: if n = 0, but the parent node is being deleted, we also need to skip over that node. Signed-off-by: Kent Overstreet commit 4637429e3946d083eedde1668c17a4fadaf3c0b1 Author: Kent Overstreet Date: Tue Sep 26 17:49:34 2023 -0400 bcachefs: bch2_sb_field_get() refactoring Instead of using token pasting to generate methods for each superblock section, just make the type a parameter to bch2_sb_field_get(). Signed-off-by: Kent Overstreet commit be47e0ba4fc92bd065ac0b7ad345913eea1bc6fc Author: Kent Overstreet Date: Fri Sep 29 15:49:16 2023 -0400 bcachefs: KEY_TYPE_error now counts towards i_sectors KEY_TYPE_error is used when all replicas in an extent are marked as failed; it indicates that data was present, but has been lost. So that i_sectors doesn't change when replacing extents with KEY_TYPE_error, we now have to count error keys as allocations - this fixes fsck errors later. Signed-off-by: Kent Overstreet commit 6929d5e74e473fb8b15875c627f7c5ad963c1889 Author: Kent Overstreet Date: Thu Sep 28 20:24:21 2023 -0400 bcachefs: Fix handling of unknown bkey types min_val_size was U8_MAX for unknown key types, causing us to flag any known key as invalid - it should have been 0. Signed-off-by: Kent Overstreet commit 88d39fd544d44e1243668eb192ff1cc5cdc2d770 Author: Kent Overstreet Date: Fri Oct 6 13:47:31 2023 -0400 bcachefs: Switch to unsafe_memcpy() in a few places The new fortify checking doesn't work for us in all places; this switches to unsafe_memcpy() where appropriate to silence a few warnings/errors. Signed-off-by: Kent Overstreet commit c2d81c24123361e5092c88e67d790097308c5b95 Author: Christophe JAILLET Date: Sun Oct 1 09:13:54 2023 +0200 bcachefs: Use struct_size() Use struct_size() instead of hand writing it. This is less verbose and more robust. While at it, prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). Signed-off-by: Christophe JAILLET Signed-off-by: Kent Overstreet commit 69d1f052d1675c2af7da496f0265f68673328afb Author: Kent Overstreet Date: Thu Sep 28 17:57:21 2023 -0400 bcachefs: Correctly initialize new buckets on device resize bch2_dev_resize() was never updated for the allocator rewrite with persistent freelists, and it wasn't noticed because the tests weren't running fsck - oops. Fix this by running bch2_dev_freespace_init() for the new buckets. Signed-off-by: Kent Overstreet commit 4fc1f402c6c259b1f44e45c096ac6666925a9b87 Author: Kent Overstreet Date: Thu Sep 28 00:54:12 2023 -0400 bcachefs: Fix another smatch complaint This should be harmless, but initialize last_seq anyways. Signed-off-by: Kent Overstreet commit dc08c661a291f5e479fdde8322a4c295c69a3aef Author: Kent Overstreet Date: Thu Sep 28 00:50:27 2023 -0400 bcachefs: Use strsep() in split_devs() Minor refactoring to fix a smatch complaint. Signed-off-by: Kent Overstreet commit 40f7914e8dc87f8530ebbd853036cb370656b947 Author: Hunter Shaffer Date: Mon Sep 25 00:46:28 2023 -0400 bcachefs: Add iops fields to bch_member Signed-off-by: Hunter Shaffer Signed-off-by: Kent Overstreet commit 9af26120f06e03ee8cdd0f7d9f767f537f5148bd Author: Hunter Shaffer Date: Mon Sep 25 00:06:32 2023 -0400 bcachefs: Rename bch_sb_field_members -> bch_sb_field_members_v1 Signed-off-by: Hunter Shaffer Signed-off-by: Kent Overstreet commit 3f7b9713dae09df31067c6d1d33c6eb1f617529f Author: Hunter Shaffer Date: Mon Sep 25 00:02:56 2023 -0400 bcachefs: New superblock section members_v2 members_v2 has dynamically resizable entries so that we can extend bch_member. The members can no longer be accessed with simple array indexing Instead members_v2_get is used to find a member's exact location within the array and returns a copy of that member. Alternatively member_v2_get_mut retrieves a mutable point to a member. Signed-off-by: Hunter Shaffer Signed-off-by: Kent Overstreet commit 1241df5872b439ff1e5a8c70e0ce82345264904f Author: Hunter Shaffer Date: Sun Sep 24 23:55:37 2023 -0400 bcachefs: Add new helper to retrieve bch_member from sb Prep work for introducing bch_sb_field_members_v2 - introduce new helpers that will check for members_v2 if it exists, otherwise using v1 Signed-off-by: Hunter Shaffer Signed-off-by: Kent Overstreet commit 73bbeaa2de1d429590a1b5ddd706dfeaf6d7d0e1 Author: Kent Overstreet Date: Wed Sep 27 19:51:29 2023 -0400 bcachefs: bucket_lock() is now a sleepable lock fsck_err() may sleep - it takes a mutex and may allocate memory, so bucket_lock() needs to be a sleepable lock. Signed-off-by: Kent Overstreet commit 3c40841cdcf374d661ff14e7a707681342565166 Author: Brian Foster Date: Wed Sep 27 07:23:37 2023 -0400 bcachefs: fix crc32c checksum merge byte order problem An fsstress task on a big endian system (s390x) quickly produces a bunch of CRC errors in the system logs. Most of these are related to the narrow CRCs path, but the fundamental problem can be reduced to a single write and re-read (after dropping caches) of a previously merged extent. The key merge path that handles extent merges eventually calls into bch2_checksum_merge() to combine the CRCs of the associated extents. This code attempts to avoid a byte order swap by feeding the le64 values into the crc32c code, but the latter casts the resulting u64 value down to a u32, which truncates the high bytes where the actual crc value ends up. This results in a CRC value that does not change (since it is merged with a CRC of 0), and checksum failures ensue. Fix the checksum merge code to swap to cpu byte order on the boundaries to the external crc code such that any value casting is handled properly. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 4220666398de7f5127bab5437b5276b3eb155282 Author: Kent Overstreet Date: Wed Sep 27 14:44:56 2023 -0400 bcachefs: Fix bch2_inode_delete_keys() bch2_inode_delete_keys() was using BTREE_ITER_NOT_EXTENTS, on the assumption that it would never need to split extents. But that caused a race with extents being split by other threads - specifically, the data move path. Extents iterators have the iterator position pointing to the start of the extent, which avoids the race. Signed-off-by: Kent Overstreet commit 7dcf62c06d11195e8caecd7b2236aa5b07e3ef8c Author: Kent Overstreet Date: Tue Sep 26 17:21:21 2023 -0400 bcachefs: Make btree root read errors recoverable The entire btree will be lost, but that is better than the entire filesystem not being recoverable. Signed-off-by: Kent Overstreet commit 1ee608c65d652af30cf69eaca425d8a5c06712d7 Author: Kent Overstreet Date: Tue Sep 26 17:20:39 2023 -0400 bcachefs: Fall back to requesting passphrase directly We can only do this in userspace, unfortunately - but kernel keyrings have never seemed to worked reliably, this is a useful fallback. Signed-off-by: Kent Overstreet commit d281701b00fc857755cd0fc08a415a694d5f49c0 Author: Kent Overstreet Date: Tue Sep 26 17:11:23 2023 -0400 bcachefs: Fix looping around bch2_propagate_key_to_snapshot_leaves() Signed-off-by: Kent Overstreet commit d2a990d1b132c8124a3856706f6b3663b9059bb5 Author: Kent Overstreet Date: Tue Sep 26 16:02:06 2023 -0400 bcachefs: bch_err_msg(), bch_err_fn() now filters out transaction restart errors These errors aren't actual errors, and should never be printed - do this in the common helpers. Signed-off-by: Kent Overstreet commit a190cbcfa029b7921cfda484e2a125649496941e Author: Kent Overstreet Date: Tue Sep 26 01:39:25 2023 -0400 bcachefs: Silence transaction restart error message Signed-off-by: Kent Overstreet commit 1e3b40980b931728f5d2c0ef8352f6aed6799a69 Author: Kent Overstreet Date: Sun Sep 24 16:25:06 2023 -0400 bcachefs: More assertions for nocow locking - assert in shutdown path that no nocow locks are held - check for overflow when taking nocow locks Signed-off-by: Kent Overstreet commit efedfc2ece141389a9f522a298781cc929262701 Author: Kent Overstreet Date: Sun Sep 24 21:05:50 2023 -0400 bcachefs: nocow locking: Fix lock leak Signed-off-by: Kent Overstreet commit 793a06d984511593c6375d219b38cc84f5a71aff Author: Kent Overstreet Date: Sat Sep 23 19:07:16 2023 -0400 bcachefs: Fixes for building in userspace Signed-off-by: Kent Overstreet commit 03ef80b469d5d83530ce1ce15be78a40e5300f9b Author: Kent Overstreet Date: Sat Sep 23 18:41:51 2023 -0400 bcachefs: Ignore unknown mount options This makes mount option handling consistent with other filesystems - options may be handled at different layers, so an option we don't know about might not be intended for us. Signed-off-by: Kent Overstreet commit b560e32ef78f8e748b74a27009ee417b9072dd88 Author: Kent Overstreet Date: Sat Sep 23 17:45:03 2023 -0400 bcachefs: Always check for invalid bkeys in main commit path Previously, we would check for invalid bkeys at transaction commit time, but only if CONFIG_BCACHEFS_DEBUG=y. This check is important enough to always be on - it appears there's been corruption making it into the journal that would have been caught by it. Signed-off-by: Kent Overstreet commit eebe8a8459f78bbac5a12d0ef76838929d736ad2 Author: Kent Overstreet Date: Sat Sep 23 16:55:03 2023 -0400 bcachefs: Make sure to initialize equiv when creating new snapshots Previously, equiv was set in the snapshot deletion path, which is where it's needed - equiv, for snapshot ID equivalence classes, would ideally be a private data structure to the snapshot deletion path. But if a new snapshot is created while snapshot deletion is running, move_key_to_correct_snapshot() moves a key to snapshot id 0 - oops. Fixes: https://github.com/koverstreet/bcachefs/issues/593 Signed-off-by: Kent Overstreet commit 82142a5541063addd15c84fcda890675035df8aa Author: Kent Overstreet Date: Fri Sep 22 14:19:52 2023 -0400 bcachefs: Fix a null ptr deref in bch2_get_alloc_in_memory_pos() Reported-by: smatch Signed-off-by: Kent Overstreet commit d8b6f8c3c6fe7eb279d031c5f7bdde086185f0d1 Author: Torge Matthies Date: Thu Sep 21 23:25:54 2023 +0200 bcachefs: Fix changing durability using sysfs Signed-off-by: Torge Matthies Signed-off-by: Kent Overstreet commit 7239f8e0ee7fb0504d18b9570172688684f3606d Author: Brian Foster Date: Fri Sep 15 08:51:54 2023 -0400 bcachefs: initial freeze/unfreeze support Initial support for the vfs superblock freeze and unfreeze operations. Superblock freeze occurs in stages, where the vfs attempts to quiesce high level write operations, page faults, fs internal operations, and then finally calls into the filesystem for any last stage steps (i.e. log flushing, etc.) before marking the superblock frozen. The majority of write paths are covered by freeze protection (i.e. sb_start_write() and friends) in higher level common code, with the exception of the fs-internal SB_FREEZE_FS stage (i.e. sb_start_intwrite()). This typically maps to active filesystem transactions in a manner that allows the vfs to implement a barrier of internal fs operations during the freeze sequence. This is not a viable model for bcachefs, however, because it utilizes transactions both to populate the journal as well as to perform journal reclaim. This means that mapping intwrite protection to transaction lifecycle or transaction commit is likely to deadlock freeze, as quiescing the journal requires transactional operations blocked by the final stage of freeze. The flipside of this is that bcachefs does already maintain its own internal sets of write references for similar purposes, currently utilized for transitions from read-write to read-only mode. Since this largely mirrors the high level sequence involved with freeze, we can simply invoke this mechanism in the freeze callback to fully quiesce the filesystem in the final stage. This means that while the SB_FREEZE_FS stage is essentially a no-op, the ->freeze_fs() callback that immediately follows begins by performing effectively the same step by quiescing all internal write references. One caveat to this approach is that without integration of internal freeze protection, write operations gated on internal write refs will fail with an internal -EROFS error rather than block on acquiring freeze protection. IOW, this is roughly equivalent to only having support for sb_start_intwrite_trylock(), and not the blocking variant. Many of these paths already use non-blocking internal write refs and so would map into an sb_start_intwrite_trylock() anyways. The only instance of this I've been able to uncover that doesn't explicitly rely on a higher level non-blocking write ref is the bch2_rbio_narrow_crcs() path, which updates crcs in certain read cases, and Kent has pointed out isn't critical if it happens to fail due to read-only status. Given that, implement basic freeze support as described above and leave tighter integration with internal freeze protection as a possible future enhancement. There are multiple potential ideas worth exploring here. For example, we could implement a multi-stage freeze callback that might allow bcachefs to quiesce its internal write references without deadlocks, we could integrate intwrite protection with bcachefs' internal write references somehow or another, or perhaps consider implementing blocking support for internal write refs to be used specifically for freeze, etc. In the meantime, this enables functional freeze support and the associated test coverage that comes with it. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 40a53b92150fe9576538f775138413c40cdb30cf Author: Kent Overstreet Date: Wed Sep 20 01:32:20 2023 -0400 bcachefs: More minor smatch fixes - fix a few uninitialized return values - return a proper error code in lookup_lostfound() Signed-off-by: Kent Overstreet commit 51c801bc6414e88d686fb3229c54d7dda1508778 Author: Kent Overstreet Date: Wed Sep 20 01:31:00 2023 -0400 bcachefs: Minor bch2_btree_node_get() smatch fixes - it's no longer possible for trans to be NULL - also, move "wait for read to complete" to the slowpath, __bch2_btree_node_get(). Signed-off-by: Kent Overstreet commit d04fdf5c1017b9ebfd45efbcc2c8cd95f7f4e30d Author: Kent Overstreet Date: Wed Sep 20 01:20:40 2023 -0400 bcachefs: snapshots: Use kvfree_rcu_mightsleep() kvfree_rcu() was renamed - not removed. Signed-off-by: Kent Overstreet commit 97ecc23632fad75c43809b3f5010800289884a08 Author: Kent Overstreet Date: Wed Sep 20 01:19:53 2023 -0400 bcachefs: Fix strndup_user() error checking strndup_user() returns an error pointer, not NULL. Reported-by: Dan Carpenter Signed-off-by: Kent Overstreet commit cfda31c03315ac8cf2a57142f5a6c7510b3f3706 Author: Kent Overstreet Date: Tue Sep 19 22:36:30 2023 -0400 bcachefs: drop journal lock before calling journal_write bch2_journal_write() expects process context, it takes journal_lock as needed. Reported-by: Dan Carpenter Signed-off-by: Kent Overstreet commit 4b33a1916a351ba3bf5af42fb38a988a5dce11bf Author: Kent Overstreet Date: Tue Sep 19 22:26:18 2023 -0400 bcachefs: bch2_ioctl_disk_resize_journal(): check for integer truncation Reported-by: Dan Carpenter Signed-off-by: Kent Overstreet commit 75e0c4789b623db0abae497160202bc5f5d2522e Author: Kent Overstreet Date: Tue Sep 19 22:20:25 2023 -0400 bcachefs: Fix error checks in bch2_chacha_encrypt_key() crypto_alloc_sync_skcipher() returns an ERR_PTR, not NULL. Reported-by: Dan Carpenter Signed-off-by: Kent Overstreet commit a55fc65eb2c71da5d422937db767a78c6438f9b6 Author: Kent Overstreet Date: Tue Sep 19 22:18:39 2023 -0400 bcachefs: Fix an overflow check When bucket sector counts were changed from u16s to u32s, a few things were missed. This fixes an overflow check, and a truncation that prevented the overflow check from firing. Reported-by: Dan Carpenter Signed-off-by: Kent Overstreet commit f7f6943a8c6dccbd085600bbb7bae4f6f6047dc4 Author: Kent Overstreet Date: Tue Sep 19 17:09:22 2023 -0400 bcachefs: Fix copy_to_user() usage in flush_buf() copy_to_user() returns the number of bytes successfully copied - not an errcode. Reported-by: Dan Carpenter Signed-off-by: Kent Overstreet commit 3e55189b504f961e68e631b72a2ed71991397ef9 Author: Brian Foster Date: Fri Sep 15 08:51:53 2023 -0400 bcachefs: fix race between journal entry close and pin set bcachefs freeze testing via fstests generic/390 occasionally reproduces the following BUG from bch2_fs_read_only(): BUG_ON(atomic_long_read(&c->btree_key_cache.nr_dirty)); This indicates that one or more dirty key cache keys still exist after the attempt to flush and quiesce the fs. The sequence that leads to this problem actually occurs on unfreeze (ro->rw), and looks something like the following: - Task A begins a transaction commit and acquires journal_res for the current seq. This transaction intends to perform key cache insertion. - Task B begins a bch2_journal_flush() via bch2_sync_fs(). This ends up in journal_entry_want_write(), which closes the current journal entry and drops the reference to the pin list created on entry open. The pin put pops the front of the journal via fast reclaim since the reference count has dropped to 0. - Task A attempts to set the journal pin for the associated cached key, but bch2_journal_pin_set() skips the pin insert because the seq of the transaction reservation is behind the front of the pin list fifo. The end result is that the pin associated with the cached key is not added, which prevents a subsequent reclaim from processing the key and thus leaves it dangling at freeze time. The fundamental cause of this problem is that the front of the journal is allowed to pop before a transaction with outstanding reservation on the associated journal seq is able to add a pin. The count for the pin list associated with the seq drops to zero and is prematurely reclaimed as a result. The logical fix for this problem lies in how the journal buffer is managed in similar scenarios where the entry might have been closed before a transaction with outstanding reservations happens to be committed. When a journal entry is opened, the current sequence number is bumped, the associated pin list is initialized with a reference count of 1, and the journal buffer reference count is bumped (via journal_state_inc()). When a journal reservation is acquired, the reservation also acquires a reference on the associated buffer. If the journal entry is closed in the meantime, it drops both the pin and buffer references held by the open entry, but the buffer still has references held by outstanding reservation. After the associated transaction commits, the reservation release drops the associated buffer references and the buffer is written out once the reference count has dropped to zero. The fundamental problem here is that the lifecycle of the pin list reference held by an open journal entry is too short to cover the processing of transactions with outstanding reservations. The simplest way to address this is to expand the pin list reference to the lifecycle of the buffer vs. the shorter lifecycle of the open journal entry. This ensures the pin list for a seq with outstanding reservation cannot be popped and reclaimed before all outstanding reservations have been released, even if the associated journal entry has been closed for further reservations. Move the pin put from journal entry close to where final processing of the journal buffer occurs. Create a duplicate helper to cover the case where the caller doesn't already hold the journal lock. This allows generic/390 to pass reliably. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit fc08031bb84b2b4660406faf9f30db8cdd09d022 Author: Brian Foster Date: Fri Sep 15 08:51:52 2023 -0400 bcachefs: prepare journal buf put to handle pin put bcachefs freeze testing has uncovered some raciness between journal entry open/close and pin list reference count management. The details of the problem are described in a separate patch. In preparation for the associated fix, refactor the journal buffer put path a bit to allow it to eventually handle dropping the pin list reference currently held by an open journal entry. Retain the journal write dispatch helper since the closure code is inlined and we don't want to increase the amount of inline code in the transaction commit path, but rename the function to reflect the purpose of final processing of the journal buffer. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 92b63f5bf0774eab2e62b86f85bb4efb915edef1 Author: Brian Foster Date: Fri Sep 15 08:51:51 2023 -0400 bcachefs: refactor pin put helpers We have a couple journal pin put helpers to handle cases where the journal lock is already held or not. Refactor the helpers to lock and reclaim from the highest level and open code the reclaim from the one caller of the internal variant. The latter call will be moved into the journal buf release helper in a later patch. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit d67a72bfc92b0c0dab9c134964090c4700892e67 Author: Dan Carpenter Date: Fri Sep 15 15:56:37 2023 +0300 bcachefs: snapshot: Add missing assignment in bch2_delete_dead_snapshots() This code accidentally left out the "ret = " assignment so the errors from for_each_btree_key2() are not checked. Fixes: 53534482a250 ("bcachefs: for_each_btree_key2()") Signed-off-by: Dan Carpenter Signed-off-by: Kent Overstreet commit 1f12900ab52304a7c41714b6ad86990eb428fbc9 Author: Dan Carpenter Date: Fri Sep 15 15:55:23 2023 +0300 bcachefs: fs-ioctl: Fix copy_to_user() error code The copy_to_user() function returns the number of bytes that it wasn't able to copy but we want to return -EFAULT to the user. Fixes: e0750d947352 ("bcachefs: Initial commit") Signed-off-by: Dan Carpenter Signed-off-by: Kent Overstreet commit b6c22147e0fcfd16e672093178d940db3ea6923e Author: Dan Carpenter Date: Fri Sep 15 15:56:07 2023 +0300 bcachefs: acl: Add missing check in bch2_acl_chmod() The "ret = bkey_err(k);" assignment was accidentally left out so the call to bch2_btree_iter_peek_slot() is not checked for errors. Fixes: 53306e096d91 ("bcachefs: Always check for transaction restarts") Signed-off-by: Dan Carpenter Signed-off-by: Kent Overstreet commit e9a0a26ed05a93034f3d49374dd5ef943db2d5b7 Author: Dan Carpenter Date: Fri Sep 15 15:55:40 2023 +0300 bcachefs: acl: Uninitialized variable in bch2_acl_chmod() The clean up code at the end of the function uses "acl" so it needs to be initialized to NULL. Fixes: 53306e096d91 ("bcachefs: Always check for transaction restarts") Signed-off-by: Dan Carpenter Signed-off-by: Kent Overstreet commit 265cc423155d56030e44068680085adb59800326 Author: Nick Desaulniers Date: Tue Sep 19 13:38:31 2023 -0700 bcachefs: Fix -Wself-assign Fixes the following observed error reported by Nathan on IRC. fs/bcachefs/io_misc.c:467:6: error: explicitly assigning value of variable of type 'int' to itself [-Werror,-Wself-assign] 467 | ret = ret; | ~~~ ^ ~~~ Reported-by: Nathan Chancellor Signed-off-by: Nick Desaulniers Signed-off-by: Kent Overstreet commit 3b59fbec86e3cda0fae2ad15139ac458e024fab1 Author: Jiapeng Chong Date: Thu Sep 14 14:05:54 2023 +0800 bcachefs: Remove duplicate include ./fs/bcachefs/btree_update.h: journal.h is included more than once. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6573 Signed-off-by: Jiapeng Chong Signed-off-by: Kent Overstreet commit 867c1fe0187f6df4dca84a34332e00f21ef80f69 Author: Dan Carpenter Date: Thu Sep 14 12:47:44 2023 +0300 bcachefs: fix error checking in bch2_fs_alloc() There is a typo here where it uses ";" instead of "?:". The result is that bch2_fs_fs_io_direct_init() is called unconditionally and the errors from it are not checked. Fixes: 0060c68159fc ("bcachefs: Split up fs-io.[ch]") Signed-off-by: Dan Carpenter Signed-off-by: Kent Overstreet Reviewed-by: Brian Foster commit 4ba985b84de627ba4f257c9843d0dd7146df2180 Author: Dan Carpenter Date: Thu Sep 14 17:59:10 2023 +0300 bcachefs: chardev: fix an integer overflow (32 bit only) On 32 bit systems, "sizeof(*arg) + replica_entries_bytes" can have an integer overflow leading to memory corruption. Use size_add() to prevent this. Fixes: b44dd3797034 ("bcachefs: Redo filesystem usage ioctls") Signed-off-by: Dan Carpenter Signed-off-by: Kent Overstreet commit 301e0237cadfc7c446e16eab6df38073ade3631d Author: Dan Carpenter Date: Thu Sep 14 17:58:07 2023 +0300 bcachefs: chardev: return -EFAULT if copy_to_user() fails The copy_to_user() function returns the number of bytes remaining but we want to return -EFAULT to the user. Fixes: e0750d947352 ("bcachefs: Initial commit") Signed-off-by: Dan Carpenter Signed-off-by: Kent Overstreet commit 8c2d82a6fe6fa0e3503c56c08d7fc599d66e2b79 Author: Kent Overstreet Date: Wed Sep 13 20:33:06 2023 -0400 bcachefs: Change bucket_lock() to use bit_spin_lock() bucket_lock() previously open coded a spinlock, because we need to cram a spinlock into a single byte. But it turns out not all archs support xchg() on a single byte; since we need struct bucket to be small, this means we have to play fun games with casts and ifdefs for endianness. This fixes building on 32 bit arm, and likely other architectures. Signed-off-by: Kent Overstreet Cc: linux-bcachefs@vger.kernel.org Signed-off-by: Kent Overstreet commit 439c172bc763fc1ef33246a0fb23920c1e01ffa7 Author: Kent Overstreet Date: Wed Sep 13 20:39:31 2023 -0400 bcachefs: Kill other unreachable() uses Per previous commit, bare unreachable() considered harmful, convert to BUG() Signed-off-by: Kent Overstreet commit 3764647b255aafb590d03066d5c1a344463e3637 Author: Josh Poimboeuf Date: Wed Sep 13 23:08:29 2023 +0200 bcachefs: Remove undefined behavior in bch2_dev_buckets_reserved() In general it's a good idea to avoid using bare unreachable() because it introduces undefined behavior in compiled code. In this case it even confuses GCC into emitting an empty unused bch2_dev_buckets_reserved.part.0() function. Use BUG() instead, which is nice and defined. While in theory it should never trigger, if something were to go awry and the BCH_WATERMARK_NR case were to actually hit, the failure mode is much more robust. Fixes the following warnings: vmlinux.o: warning: objtool: bch2_bucket_alloc_trans() falls through to next function bch2_reset_alloc_cursors() vmlinux.o: warning: objtool: bch2_dev_buckets_reserved.part.0() is missing an ELF size annotation Reported-by: Randy Dunlap Signed-off-by: Josh Poimboeuf Signed-off-by: Kent Overstreet commit 0198b2356b5d0343ce933f8387a74972be6a2b10 Author: Christophe JAILLET Date: Wed Sep 13 18:44:09 2023 +0200 bcachefs: Remove a redundant and harmless bch2_free_super() call Remove a redundant call to bch2_free_super(). This is harmless because bch2_free_super() has a memset() at its end. So a second call would only lead to from kfree(NULL). Remove the redundant call and only rely on the error handling path. Signed-off-by: Christophe JAILLET Signed-off-by: Kent Overstreet commit 71933fb69b7c5fe5efd2119b645d4fde337a6f3f Author: Christophe JAILLET Date: Wed Sep 13 18:44:08 2023 +0200 bcachefs: Fix use-after-free in bch2_dev_add() If __bch2_dev_attach_bdev() fails, bch2_dev_free() is called twice. Once here and another time in the error handling path. This leads to several use-after-free. Remove the redundant call and only rely on the error handling path. Fixes: 6a44735653d4 ("bcachefs: Improved superblock-related error messages") Signed-off-by: Christophe JAILLET Signed-off-by: Kent Overstreet commit a9737e0b38352e984fc67d5694b2c207c6b9679f Author: Brian Foster Date: Wed Sep 13 10:14:30 2023 -0400 bcachefs: add module description to fix modpost warning modpost produces the following warning: WARNING: modpost: missing MODULE_DESCRIPTION() in fs/bcachefs/bcachefs.o Add a module description for bcachefs. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 6bd68ec266ad71827ef940151067b67b62fb8fed Author: Kent Overstreet Date: Tue Sep 12 17:16:02 2023 -0400 bcachefs: Heap allocate btree_trans We're using more stack than we'd like in a number of functions, and btree_trans is the biggest object that we stack allocate. But we have to do a heap allocatation to initialize it anyways, so there's no real downside to heap allocating the entire thing. Signed-off-by: Kent Overstreet commit 96dea3d599dbc31f59eb786af2ac5079122beb88 Author: Kent Overstreet Date: Tue Sep 12 18:41:22 2023 -0400 bcachefs: Fix W=12 build errors Signed-off-by: Kent Overstreet commit b5e85d4d0ccf819df1ee73db41bf388ddd6e1830 Author: Yang Li Date: Wed Sep 13 08:57:56 2023 +0800 bcachefs: Remove unneeded semicolon ./fs/bcachefs/btree_gc.c:1249:2-3: Unneeded semicolon ./fs/bcachefs/btree_gc.c:1521:2-3: Unneeded semicolon ./fs/bcachefs/btree_gc.c:1575:2-3: Unneeded semicolon ./fs/bcachefs/counters.c:46:2-3: Unneeded semicolon Signed-off-by: Yang Li Signed-off-by: Kent Overstreet commit 7bba0dc6fc1e18400fe247d6385b1ce8ef566397 Author: Kent Overstreet Date: Tue Sep 12 18:41:09 2023 -0400 bcachefs: Add a missing prefetch include Signed-off-by: Kent Overstreet commit e82f5f40f2b936063361812cad9338ce792dde2f Author: Nathan Chancellor Date: Tue Sep 12 12:15:44 2023 -0700 bcachefs: Fix -Wcompare-distinct-pointer-types in bch2_copygc_get_buckets() When building bcachefs for 32-bit ARM, there is a warning when using max() to compare an expression involving 'size_t' with an 'unsigned long' literal: fs/bcachefs/movinggc.c:159:21: error: comparison of distinct pointer types ('typeof (16UL) *' (aka 'unsigned long *') and 'typeof (buckets_in_flight->nr / 4) *' (aka 'unsigned int *')) [-Werror,-Wcompare-distinct-pointer-types] 159 | size_t nr_to_get = max(16UL, buckets_in_flight->nr / 4); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:76:19: note: expanded from macro 'max' 76 | #define max(x, y) __careful_cmp(x, y, >) | ^~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:38:24: note: expanded from macro '__careful_cmp' 38 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~~~~~~~ include/linux/minmax.h:28:4: note: expanded from macro '__safe_cmp' 28 | (__typecheck(x, y) && __no_side_effects(x, y)) | ^~~~~~~~~~~~~~~~~ include/linux/minmax.h:22:28: note: expanded from macro '__typecheck' 22 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ 1 error generated. On 64-bit architectures, size_t is 'unsigned long', so there is no warning when comparing these two expressions. Use max_t(size_t, ...) for this situation, eliminating the warning. Fixes: dd49018737d4 ("bcachefs: Rhashtable based buckets_in_flight for copygc") Signed-off-by: Nathan Chancellor Signed-off-by: Kent Overstreet commit 53eda6f7130adb194cb3b089bc38fc32d9a1f7d5 Author: Nathan Chancellor Date: Tue Sep 12 12:15:43 2023 -0700 bcachefs: Fix -Wcompare-distinct-pointer-types in do_encrypt() When building bcachefs for 32-bit ARM, there is a warning when using min() to compare a variable of type 'size_t' with an expression of type 'unsigned long': fs/bcachefs/checksum.c:142:22: error: comparison of distinct pointer types ('typeof (len) *' (aka 'unsigned int *') and 'typeof (((1UL) << 12) - offset) *' (aka 'unsigned long *')) [-Werror,-Wcompare-distinct-pointer-types] 142 | unsigned pg_len = min(len, PAGE_SIZE - offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:69:19: note: expanded from macro 'min' 69 | #define min(x, y) __careful_cmp(x, y, <) | ^~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:38:24: note: expanded from macro '__careful_cmp' 38 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~~~~~~~ include/linux/minmax.h:28:4: note: expanded from macro '__safe_cmp' 28 | (__typecheck(x, y) && __no_side_effects(x, y)) | ^~~~~~~~~~~~~~~~~ include/linux/minmax.h:22:28: note: expanded from macro '__typecheck' 22 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ 1 error generated. On 64-bit architectures, size_t is 'unsigned long', so there is no warning when comparing these two expressions. Use min_t(size_t, ...) for this situation, eliminating the warning. Fixes: 1fb50457684f ("bcachefs: Fix memory corruption in encryption path") Signed-off-by: Nathan Chancellor Signed-off-by: Kent Overstreet commit 1f70225d7791e67084073e54489440d7cf8017e0 Author: Nathan Chancellor Date: Tue Sep 12 12:15:42 2023 -0700 bcachefs: Fix -Wincompatible-function-pointer-types-strict from key_invalid callbacks When building bcachefs with -Wincompatible-function-pointer-types-strict, a clang warning designed to catch issues with mismatched function pointer types, which will be fatal at runtime due to kernel Control Flow Integrity (kCFI), there are several instances along the lines of: fs/bcachefs/bkey_methods.c:118:2: error: incompatible function pointer types initializing 'int (*)(const struct bch_fs *, struct bkey_s_c, enum bkey_invalid_flags, struct printbuf *)' with an expression of type 'int (const struct bch_fs *, struct bkey_s_c, unsigned int, struct printbuf *)' [-Werror,-Wincompatible-function-pointer-types-strict] 118 | BCH_BKEY_TYPES() | ^~~~~~~~~~~~~~~~ fs/bcachefs/bcachefs_format.h:342:2: note: expanded from macro 'BCH_BKEY_TYPES' 342 | x(deleted, 0) \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~ fs/bcachefs/bkey_methods.c:117:41: note: expanded from macro 'x' 117 | #define x(name, nr) [KEY_TYPE_##name] = bch2_bkey_ops_##name, | ^~~~~~~~~~~~~~~~~~~~ :206:1: note: expanded from here 206 | bch2_bkey_ops_deleted | ^~~~~~~~~~~~~~~~~~~~~ fs/bcachefs/bkey_methods.c:34:17: note: expanded from macro 'bch2_bkey_ops_deleted' 34 | .key_invalid = deleted_key_invalid, \ | ^~~~~~~~~~~~~~~~~~~ The flags parameter should be of type 'enum bkey_invalid_flags', not 'unsigned int'. Adjust the type everywhere so that there is no more warning. Signed-off-by: Nathan Chancellor Signed-off-by: Kent Overstreet commit 0940863fd2186c521d91aaf58b28d872fb1bba6c Author: Nathan Chancellor Date: Tue Sep 12 12:15:41 2023 -0700 bcachefs: Fix -Wformat in bch2_bucket_gens_invalid() When building bcachefs for 32-bit ARM, there is a compiler warning in bch2_bucket_gens_invalid() due to use of an incorrect format specifier: fs/bcachefs/alloc_background.c:530:10: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] 529 | prt_printf(err, "bad val size (%lu != %zu)", | ~~~ | %zu 530 | bkey_val_bytes(k.k), sizeof(struct bch_bucket_gens)); | ^~~~~~~~~~~~~~~~~~~ fs/bcachefs/util.h:223:54: note: expanded from macro 'prt_printf' 223 | #define prt_printf(_out, ...) bch2_prt_printf(_out, __VA_ARGS__) | ^~~~~~~~~~~ On 64-bit architectures, size_t is 'unsigned long', so there is no warning when using %lu but on 32-bit architectures, size_t is 'unsigned int'. Use '%zu', the format specifier for 'size_t', to eliminate the warning. Fixes: 4be0d766a7e9 ("bcachefs: bucket_gens btree") Signed-off-by: Nathan Chancellor Signed-off-by: Kent Overstreet commit 14f63ff3f6617902cd54edb468b906214ab00f34 Author: Nathan Chancellor Date: Tue Sep 12 12:15:40 2023 -0700 bcachefs: Fix -Wformat in bch2_alloc_v4_invalid() When building bcachefs for 32-bit ARM, there is a compiler warning in bch2_alloc_v4_invalid() due to use of an incorrect format specifier: fs/bcachefs/alloc_background.c:246:30: error: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Werror,-Wformat] 245 | prt_printf(err, "bad val size (%u > %lu)", | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | %u 246 | alloc_v4_u64s(a.v), bkey_val_u64s(k.k)); | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ fs/bcachefs/bkey.h:58:27: note: expanded from macro 'bkey_val_u64s' 58 | #define bkey_val_u64s(_k) ((_k)->u64s - BKEY_U64s) | ^ fs/bcachefs/util.h:223:54: note: expanded from macro 'prt_printf' 223 | #define prt_printf(_out, ...) bch2_prt_printf(_out, __VA_ARGS__) | ^~~~~~~~~~~ This expression is of type 'size_t'. On 64-bit architectures, size_t is 'unsigned long', so there is no warning when using %lu but on 32-bit architectures, size_t is 'unsigned int'. Use '%zu', the format specifier for 'size_t' to eliminate the warning. Fixes: 11be8e8db283 ("bcachefs: New on disk format: Backpointers") Signed-off-by: Nathan Chancellor Signed-off-by: Kent Overstreet commit f7ed15eb177ffd55e97c5817e2ccaacc364be4cd Author: Nathan Chancellor Date: Tue Sep 12 12:15:39 2023 -0700 bcachefs: Fix -Wformat in bch2_btree_key_cache_to_text() When building bcachefs for 32-bit ARM, there is a compiler warning in bch2_btree_key_cache_to_text() due to use of an incorrect format specifier: fs/bcachefs/btree_key_cache.c:1060:36: error: format specifies type 'size_t' (aka 'unsigned int') but the argument has type 'long' [-Werror,-Wformat] 1060 | prt_printf(out, "nr_freed:\t%zu", atomic_long_read(&c->nr_freed)); | ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | %ld fs/bcachefs/util.h:223:54: note: expanded from macro 'prt_printf' 223 | #define prt_printf(_out, ...) bch2_prt_printf(_out, __VA_ARGS__) | ^~~~~~~~~~~ 1 error generated. On 64-bit architectures, size_t is 'unsigned long', so there is no warning when using %zu but on 32-bit architectures, size_t is 'unsigned int'. Use '%lu' to match the other format specifiers used in this function for printing values returned from atomic_long_read(). Fixes: 6d799930ce0f ("bcachefs: btree key cache pcpu freedlist") Signed-off-by: Nathan Chancellor Signed-off-by: Kent Overstreet commit fac1250a8cc3af0e45c07ad59d7e1eabf5213688 Author: Nathan Chancellor Date: Tue Sep 12 12:15:38 2023 -0700 bcachefs: Fix -Wformat in bch2_set_bucket_needs_journal_commit() When building bcachefs for 32-bit ARM, there is a compiler warning in bch2_set_bucket_needs_journal_commit() due to a debug print using the wrong specifier: fs/bcachefs/buckets_waiting_for_journal.c:137:30: error: format specifies type 'size_t' (aka 'unsigned int') but the argument has type 'unsigned long' [-Werror,-Wformat] 136 | pr_debug("took %zu rehashes, table at %zu/%zu elements", | ~~~ | %lu 137 | nr_rehashes, nr_elements, 1UL << b->t->bits); | ^~~~~~~~~~~~~~~~~ include/linux/printk.h:579:26: note: expanded from macro 'pr_debug' 579 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | ~~~ ^~~~~~~~~~~ include/linux/dynamic_debug.h:270:22: note: expanded from macro 'dynamic_pr_debug' 270 | pr_fmt(fmt), ##__VA_ARGS__) | ~~~ ^~~~~~~~~~~ include/linux/dynamic_debug.h:250:59: note: expanded from macro '_dynamic_func_call' 250 | _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__) | ^~~~~~~~~~~ include/linux/dynamic_debug.h:248:65: note: expanded from macro '_dynamic_func_call_cls' 248 | __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__) | ^~~~~~~~~~~ include/linux/dynamic_debug.h:224:15: note: expanded from macro '__dynamic_func_call_cls' 224 | func(&id, ##__VA_ARGS__); \ | ^~~~~~~~~~~ 1 error generated. On 64-bit architectures, size_t is 'unsigned long', so there is no warning when using %zu but on 32-bit architectures, size_t is 'unsigned int'. Use the correct specifier to resolve the warning. Fixes: 7a82e75ddaef ("bcachefs: New data structure for buckets waiting on journal commit") Signed-off-by: Nathan Chancellor Signed-off-by: Kent Overstreet commit 6bf3766b5211dde53e5a2f88082d71073ea6e7df Author: Colin Ian King Date: Tue Sep 12 09:25:27 2023 +0100 bcachefs: Fix a handful of spelling mistakes in various messages There are several spelling mistakes in error messages. Fix these. Signed-off-by: Colin Ian King Signed-off-by: Kent Overstreet commit 74c1e4221b6630e864d1efe4e718538dcee5d816 Author: Colin Ian King Date: Tue Sep 12 13:37:44 2023 +0100 bcachefs: remove redundant pointer q The pointer q is being assigned a value but it is never read. The assignment and pointer are redundant and can be removed. Cleans up clang scan build warning: fs/bcachefs/quota.c:813:2: warning: Value stored to 'q' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Kent Overstreet commit 2a831e4ba9b09e1b30384b65eca7c2ac33aa69b2 Author: Colin Ian King Date: Tue Sep 12 13:37:43 2023 +0100 bcachefs: remove duplicated assignment to variable offset_into_extent Variable offset_into_extent is being assigned to zero and a few statements later it is being re-assigned again to the save value. The second assignment is redundant and can be removed. Cleans up clang-scan build warning: fs/bcachefs/io.c:2722:3: warning: Value stored to 'offset_into_extent' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Kent Overstreet commit c04cbc0dfd261bb8310cde82996e0360e4c38d39 Author: Colin Ian King Date: Tue Sep 12 13:37:42 2023 +0100 bcachefs: remove redundant initializations of variables start_offset and end_offset The variables start_offset and end_offset are being initialized with values that are never read, they being re-assigned later on. The initializations are redundant and can be removed. Cleans up clang-scan build warnings: fs/bcachefs/fs-io.c:243:11: warning: Value stored to 'start_offset' during its initialization is never read [deadcode.DeadStores] fs/bcachefs/fs-io.c:244:11: warning: Value stored to 'end_offset' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Kent Overstreet commit 519d6c884509b639c8102f4456ca91e354ae1205 Author: Colin Ian King Date: Tue Sep 12 13:37:41 2023 +0100 bcachefs: remove redundant initialization of pointer dst The pointer dst is being initialized with a value that is never read, it is being re-assigned later on when it is used in a while-loop The initialization is redundant and can be removed. Cleans up clang-scan build warning: fs/bcachefs/disk_groups.c:186:30: warning: Value stored to 'dst' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Kent Overstreet commit 7cb0e6992e5c56c2751e08c8161203ba0566f510 Author: Colin Ian King Date: Tue Sep 12 13:37:40 2023 +0100 bcachefs: remove redundant initialization of pointer d The pointer d is being initialized with a value that is never read, it is being re-assigned later on when it is used in a for-loop. The initialization is redundant and can be removed. Cleans up clang-scan build warning: fs/bcachefs/buckets.c:1303:25: warning: Value stored to 'd' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Kent Overstreet commit feb5cc398120ce09fd7c72d361b3d14d9e280b96 Author: Kent Overstreet Date: Mon Sep 11 20:44:33 2023 -0400 bcachefs: trace_read_nopromote() Add a tracepoint to print the reason a read wasn't promoted. Signed-off-by: Kent Overstreet commit f3e374efbf1e32fc0235d44abc68abae06a8f7ab Author: Kent Overstreet Date: Sun Sep 10 19:11:47 2023 -0400 bcachefs: Log finsert/fcollapse operations Now that we have the logged operations btree, we can make finsert/fcollapse atomic w.r.t. unclean shutdown as well. This adds bch_logged_op_finsert to represent the state of an finsert or fcollapse, which is a bit more complicated than truncate since we need to track our position in the "shift extents" operation. Signed-off-by: Kent Overstreet commit b030e262b517b6bddc4bfa88ed8d335ef9de7671 Author: Kent Overstreet Date: Sun Sep 10 16:42:30 2023 -0400 bcachefs: Log truncate operations Previously, we guaranteed atomicity of truncate after unclean shutdown with the BCH_INODE_I_SIZE_DIRTY flag - which required a full scan of the inodes btree. Recently the deleted inodes btree was added so that we no longer have to scan for deleted inodes, but truncate was unfinished and that change left it broken. This patch uses the new logged operations btree to fix truncate atomicity; we now log an operation that can be replayed at the start of a truncate. Signed-off-by: Kent Overstreet commit aaad530ac6b1c836de4a29d227ab68be97e39a73 Author: Kent Overstreet Date: Sun Aug 27 18:27:41 2023 -0400 bcachefs: BTREE_ID_logged_ops Add a new btree for long running logged operations - i.e. for logging operations that we can't do within a single btree transaction, so that they can be resumed if we crash. Keys in the logged operations btree will represent operations in progress, with the state of the operation stored in the value. Signed-off-by: Kent Overstreet commit 5902cc283c060f0a006ee9b2f2a64855a09399b4 Author: Kent Overstreet Date: Mon Sep 4 05:38:30 2023 -0400 bcachefs: New io_misc.c helpers This pulls the non vfs specific parts of truncate and finsert/fcollapse out of fs-io.c, and moves them to io_misc.c. This is prep work for logging these operations, to make them atomic in the event of a crash. Signed-off-by: Kent Overstreet commit 1809b8cba756d32bd6e976ed4ee64efdf66c6d94 Author: Kent Overstreet Date: Sun Sep 10 18:05:17 2023 -0400 bcachefs: Break up io.c More reorganization, this splits up io.c into - io_read.c - io_misc.c - fallocate, fpunch, truncate - io_write.c Signed-off-by: Kent Overstreet commit cbf57db53f311b09de2c17b514e104d421d72871 Author: Kent Overstreet Date: Mon Sep 11 19:50:42 2023 -0400 bcachefs: bch2_trans_update_get_key_cache() Factor out a slowpath into a separate function. Signed-off-by: Kent Overstreet commit aef32bf7cc040fc770199f0c1a0a2cd26f164f45 Author: Kent Overstreet Date: Mon Sep 11 19:48:07 2023 -0400 bcachefs: __bch2_btree_insert() -> bch2_btree_insert_trans() Signed-off-by: Kent Overstreet commit 39791d7de2833ca4dae0061017621ca562748306 Author: Kent Overstreet Date: Mon Sep 11 14:34:56 2023 -0400 bcachefs: Kill incorrect assertion In the bch2_fs_alloc() error path we call bch2_fs_free() without setting BCH_FS_STOPPING - this is fine. Signed-off-by: Kent Overstreet commit e46c181af9e230c4c5dbc701fdadc295d6191eec Author: Kent Overstreet Date: Mon Sep 11 01:37:34 2023 -0400 bcachefs: Convert more code to bch_err_msg() Signed-off-by: Kent Overstreet commit da187cacb8a59e668ce716214865612ae3921e91 Author: Kent Overstreet Date: Sun Sep 10 22:05:50 2023 -0400 bcachefs: Kill missing inode warnings in bch2_quota_read() bch2_quota_read(), when scanning for inodes, may attempt to look up inodes that have been deleted in the main subvolume - this is not an error. Signed-off-by: Kent Overstreet commit c7afec9bd63dc00047c35f9b747aa2be505533e6 Author: Kent Overstreet Date: Sun Sep 10 02:13:33 2023 -0400 bcachefs: Fix bch_sb_handle type blk_mode_t was recently introduced; we should be using it now, instead of fmode_t. Signed-off-by: Kent Overstreet commit c872afa22420cbbeb8c78656926928b9e2abae18 Author: Kent Overstreet Date: Sun Sep 10 16:24:02 2023 -0400 bcachefs: Fix bch2_propagate_key_to_snapshot_leaves() When we handle a transaction restart in a nested context, we need to return -BCH_ERR_transaction_restart_nested because we invalidated the outer context's iterators and locks. bch2_propagate_key_to_snapshot_leaves() wasn't doing this, this patch fixes it to use trans_was_restarted(). Signed-off-by: Kent Overstreet commit 5b7fbdcd5b04b618178d6339e36435997ef6b086 Author: Kent Overstreet Date: Sat Sep 9 21:14:54 2023 -0400 bcachefs: Fix silent enum conversion error This changes mark_btree_node_locked() to take an enum btree_node_locked_type, not a six_lock_type, since BTREE_NODE_UNLOCKED is -1 which may cause problems converting back and forth to six_lock_type if short enums are in use. With this change, we never store BTREE_NODE_UNLOCKED in a six_lock_type enum. Signed-off-by: Kent Overstreet commit 5cfd69775eb5460ef78bb5034a37eb0dc52ab65d Author: Kent Overstreet Date: Sat Sep 9 20:10:11 2023 -0400 bcachefs: Array bounds fixes It's no longer legal to use a zero size array as a flexible array member - this causes UBSAN to complain. This patch switches our zero size arrays to normal flexible array members when possible, and inserts casts in other places (e.g. where we use the zero size array as a marker partway through an array). Signed-off-by: Kent Overstreet commit a9a7bbab1469f0c427f90c309720c543e37ab110 Author: Kent Overstreet Date: Fri Sep 8 18:14:08 2023 -0400 bcachefs: bch2_acl_to_text() We can now print out acls from bch2_xattr_to_text(), when the xattr contains an acl. Signed-off-by: Kent Overstreet commit 197763a70b6a530d959659abb917166a2f193520 Author: Brian Foster Date: Wed Aug 30 06:45:59 2023 -0400 bcachefs: restart journal reclaim thread on ro->rw transitions Commit c2d5ff36065a4 ("bcachefs: Start journal reclaim thread earlier") tweaked reclaim thread management to start a bit earlier in the mount sequence by moving the start call from __bch2_fs_read_write() to bch2_fs_journal_start(). This has the side effect of never starting the reclaim thread on a ro->rw transition, which can be observed by monitoring reclaim behavior via the journal_reclaim tracepoints. I.e. once an fs has remounted ro->rw, we only ever rely on direct reclaim from that point forward. Since bch2_journal_reclaim_start() properly handles the case where the reclaim thread has already been created, restore the start call in the read-write helper. This allows the reclaim thread to start early when appropriate and also exit/restart on remounts or freeze cycles. In the latter case it may be possible to simply allow the task to freeze rather than destroy it, but for now just fix the immediate bug. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 097d4cc8fde898334569271c9b3e24d99788ade0 Author: Kent Overstreet Date: Mon Aug 28 15:17:31 2023 -0400 bcachefs: Fix snapshot_skiplist_good() We weren't correctly checking snapshot skiplist nodes - we were checking if they were in the same tree, not if they were an actual ancestor. Signed-off-by: Kent Overstreet commit cba37d81f5c34197e815bcd60f075be232ae6783 Author: Kent Overstreet Date: Thu Aug 24 17:07:50 2023 -0400 bcachefs: Kill stripe check in bch2_alloc_v4_invalid() Since we set bucket data type to BCH_DATA_stripe based on the data pointer, not just the stripe pointer, it doesn't make sense to check for no stripe in the .key_invalid method - this is a situation that shouldn't happen, but our other fsck/repair code handles it. Signed-off-by: Kent Overstreet commit 9d2a7bd8b7f747c85a113a4967ffd5d65ef72dfa Author: Kent Overstreet Date: Wed Aug 23 21:20:42 2023 -0400 bcachefs: Improve bch2_moving_ctxt_to_text() Print more information out about moving contexts - fold in the output of the redundant bch2_data_jobs_to_text(), and also include information relevant to whether move_data() should be blocked. Signed-off-by: Kent Overstreet commit cc07773f158331b5a9f5401e8d50cd7ed43c90ba Author: Kent Overstreet Date: Tue Aug 22 20:29:35 2023 -0400 bcachefs: Put bkey invalid check in commit path in a more useful place When doing updates early in recovery, before we can go RW, we still want to check that keys are valid at commit time - this moves key invalid checking to before the "btree updates to journal" path. Signed-off-by: Kent Overstreet commit 71aba590297e9b5f71e760b9336ecb3b44c728ef Author: Kent Overstreet Date: Tue Aug 22 18:48:09 2023 -0400 bcachefs: Always check alloc data type Signed-off-by: Kent Overstreet commit 4491283f8d827bdfc6baed27028ae636494bdbac Author: Kent Overstreet Date: Tue Aug 22 18:47:16 2023 -0400 bcachefs: Fix a double free on invalid bkey Signed-off-by: Kent Overstreet commit a111901f52140f7f6f7ff0034c5ffa15448c784b Author: Kent Overstreet Date: Fri Aug 18 21:14:33 2023 -0400 bcachefs: bch2_propagate_key_to_snapshot_leaves() If fsck finds a key that needs work done, the primary example being an unlinked inode that needs to be deleted, and the key is in an internal snapshot node, we have a bit of a conundrum. The conundrum is that internal snapshot nodes are shared, and we in general do updates in internal snapshot nodes because there may be overwrites in some snapshots and not others, and this may affect other keys referenced by this key (i.e. extents). For example, we might be seeing an unlinked inode in an internal snapshot node, but then in one child snapshot the inode might have been reattached and might not be unlinked. Deleting the inode in the internal snapshot node would be wrong, because then we'll delete all the extents that the child snapshot references. But if an unlinked inode does not have any overwrites in child snapshots, we're fine: the inode is overwrritten in all child snapshots, so we can do the deletion at the point of comonality in the snapshot tree, i.e. the node where we found it. This patch adds a new helper, bch2_propagate_key_to_snapshot_leaves(), to handle the case where we need a to update a key that does have overwrites in child snapshots: we copy the key to leaf snapshot nodes, and then rewind fsck and process the needed updates there. With this, fsck can now always correctly handle unlinked inodes found in internal snapshot nodes. Signed-off-by: Kent Overstreet commit f55d6e07bc6c9b90f58586daf9c432adb5f5ce25 Author: Kent Overstreet Date: Thu Aug 17 22:10:02 2023 -0400 bcachefs: Cleanup redundant snapshot nodes After deleteing snapshots, we may be left with a snapshot tree where some nodes only have one child, and we have a linear chain. Interior snapshot nodes are never used directly (i.e. they never have subvolumes that point to them), they are only referered to by child snapshot nodes - hence, they are redundant. The existing code talks about redundant snapshot nodes as forming and equivalence class; i.e. nodes for which snapshot_t->equiv is equal. In a given equivalence class, we only ever need a single key at a given position - i.e. multiple versions with different snapshot fields are redundant. The existing snapshot cleanup code deletes these redundant keys, but not redundant nodes. It turns out this is buggy, because we assume that after snapshot deletion finishes we should only have a single key per equivalence class, but the btree update path doesn't preserve this - overwriting keys in old snapshots doesn't check for the equivalence class being equal, and thus we can end up with duplicate keys in the same equivalence class and fsck complaining about snapshot deletion not having run correctly. The equivalence class notion has been leaking out of the core snapshots code and into too much other code, i.e. fsck, so this patch takes a different approach: snapshot deletion now moves keys to the node in an equivalence class being kept (the leafiest node) and then deletes the redundant nodes in the equivalance class. Some work has to be done to correctly delete interior snapshot nodes; snapshot node depth and skiplist fields for descendent nodes have to be fixed. Signed-off-by: Kent Overstreet commit da525760802b9f18cd9eb9ecdb23952f41723de2 Author: Kent Overstreet Date: Mon Aug 21 19:57:34 2023 -0400 bcachefs: Fix btree write buffer with snapshots btrees Signed-off-by: Kent Overstreet commit 66487c54ad8207ef1c029df45ffaeaafbcc11f77 Author: Kent Overstreet Date: Thu Jul 13 02:43:29 2023 -0400 bcachefs: Fix is_ancestor bitmap The is_ancestor bitmap is at optimization for bch2_snapshot_is_ancestor; once we get sufficiently close to the ancestor ID we're searching for we test a bitmap. But initialization of the is_ancestor bitmap was broken; we do it by using bch2_snapshot_parent(), but we call that on nodes that haven't been initialized yet with bch2_mark_snapshot(). Fix this by adding a separate loop in bch2_snapshots_read() for initializing the is_ancestor bitmap, and also add some new debug asserts for checking this sort of breakage in the future. Signed-off-by: Kent Overstreet commit fa5bed376a184f2dcb48dba5c076583ed6c61340 Author: Kent Overstreet Date: Fri Aug 18 21:13:44 2023 -0400 bcachefs: move check_pos_snapshot_overwritten() to snapshot.c Signed-off-by: Kent Overstreet commit 7573041ab958a14407621ef9756be49548f937e6 Author: Kent Overstreet Date: Fri Aug 18 17:44:21 2023 -0400 bcachefs: Fix bch2_mount error path In the bch2_mount() error path, we were calling deactivate_locked_super(), which calls ->kill_sb(), which in our case was calling bch2_fs_free() without __bch2_fs_stop(). This changes bch2_mount() to just call bch2_fs_stop() directly. Signed-off-by: Kent Overstreet commit adc0e9509184da7204397f4d0410b61f75bac706 Author: Kent Overstreet Date: Fri Aug 18 00:05:35 2023 -0400 bcachefs: Delete a faulty assertion Signed-off-by: Kent Overstreet commit 55d5276d2e7b7ac88a21a7ab89efd308734bb775 Author: Kent Overstreet Date: Thu Aug 17 22:04:20 2023 -0400 bcachefs: Improve btree_path_relock_fail tracepoint In https://github.com/koverstreet/bcachefs/issues/450, we're seeing unexplained btree_path_relock_fail events - according to the information currently in the tracepoint, it appears the relock should be succeeding. This adds lock counts to the tracepoint to help track it down. Signed-off-by: Kent Overstreet commit d0445e131e3ff1a68492f7f6e754cd672db4774d Author: Kent Overstreet Date: Thu Aug 17 16:35:58 2023 -0400 bcachefs: Fix divide by zero in rebalance_work() This fixes https://github.com/koverstreet/bcachefs-tools/issues/159 Signed-off-by: Kent Overstreet commit 8e877caaad818595ecb6754355cea2058fd9848e Author: Kent Overstreet Date: Wed Aug 16 16:54:33 2023 -0400 bcachefs: Split out snapshot.c subvolume.c has gotten a bit large, this splits out a separate file just for managing snapshot trees - BTREE_ID_snapshots. Signed-off-by: Kent Overstreet commit e5570df295fc951546fec782bc087f72a47277e0 Author: Kent Overstreet Date: Wed Aug 16 15:05:18 2023 -0400 bcachefs: stack_trace_save_tsk() depends on CONFIG_STACKTRACE Signed-off-by: Kent Overstreet commit 62898dd12ba017c56c39a74ef891845118b0c190 Author: Kent Overstreet Date: Mon Aug 14 22:29:41 2023 -0400 bcachefs: Fix swallowing of data in buffered write path In __bch2_buffered_write, if we fail to write to an entire !uptodate folio, we have to back out the write, bail out and retry. But we were missing an iov_iter_revert() call, so the data written to the folio was lost and the rest of the write shifted to the wrong offset. Signed-off-by: Kent Overstreet commit 8c9b0f7bdc4183573d57f0442693d99cc9758617 Author: Brian Foster Date: Mon Aug 14 10:49:42 2023 -0400 bcachefs: fix up wonky error handling in bch2_seek_pagecache_hole() The folio_hole_offset() helper returns a mix of bool and int types. The latter is to support a possible -EAGAIN error code when using nonblocking locks. This is not only confusing, but the only caller also essentially ignores errors outside of stopping the range iteration. This means an -EAGAIN error can't return directly from folio_hole_offset() and may be lost via bch2_clamp_data_hole(). Fix up the error handling and make it more readable. __filemap_get_folio() returns -ENOENT instead of NULL when no folio exists, so reuse the same error code in folio_hole_offset(). Fix up bch2_seek_pagecache_hole() to return the current offset on -ENOENT, but otherwise return unexpected error code up to the caller. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 029b85fe417c36b5689093dd4861c7980299a50f Author: Kent Overstreet Date: Sun Aug 13 19:34:02 2023 -0400 bcachefs: Fix bkey format calculation For extents, we increase the number of bits of the size field to allow extents to get bigger due to merging - but this code didn't check for overflow. Signed-off-by: Kent Overstreet commit c8ef8c3eb573ae2d7f7f41d93f0e34b8f6dfcd6f Author: Kent Overstreet Date: Sun Aug 13 18:04:32 2023 -0400 bcachefs: Fix bch2_extent_fallocate() - There was no need for a retry loop in bch2_extent_fallocate(); if we have to retry we may be overwriting something different and we need to return an error and let the caller retry. - The bch2_alloc_sectors_start() error path was wrong, and wasn't running our cleanup at the end of the function This also fixes a very rare open bucket leak due to the missing cleanup. Signed-off-by: Kent Overstreet commit ff5b741c25fb9546d876ca4c0c1d8720f6a2471c Author: Kent Overstreet Date: Sun Aug 13 18:15:53 2023 -0400 bcachefs: Zero btree_paths on allocation This fixes a bug in the cycle detector, bch2_check_for_deadlock() - we have to make sure the node pointers in the btree paths array are set to something not-garbage before another thread may see them. Signed-off-by: Kent Overstreet commit e9679b4a0618b0b55d22ec555bc9c6b2dab39809 Author: Kent Overstreet Date: Sun Aug 13 13:04:08 2023 -0400 bcachefs: Fix 'pointer to invalid device' check This fixes the device removal tests, which have been failing at random due to the fact that when we're running the .key_invalid checks in the write path the key may actually no longer exist - we might be racing with the keys being deleted. Signed-off-by: Kent Overstreet commit a125c0742ccb0b5f2bc84f3f1a8bcee173c1130d Author: Joshua Ashton Date: Sun Aug 13 16:53:45 2023 +0100 bcachefs: Lower BCH_NAME_MAX to 512 To ensure we aren't shooting ourselves in the foot after merge for potentially doing future revisions for dirent or for storing multiple names for casefolding, limit this to 512 for now. Previously this define was linked to the max size a d_name in bch_dirent could be. Signed-off-by: Joshua Ashton Signed-off-by: Kent Overstreet commit 29c336afebb9013706334c1b451f31fe5ff37f34 Author: Joshua Ashton Date: Sat Aug 12 22:26:30 2023 +0100 bcachefs: Optimize bch2_dirent_name_bytes Avoids doing a full strnlen for getting the length of the name of a dirent entry. Given the fact that the name of dirents is stored at the end of the bkey's value, and we know the length of that in u64s, we can find the last u64 and figure out how many NUL bytes are at the end of the string. On little endian systems this ends up being the leading zeros of the last u64, whereas on big endian systems this ends up being the trailing zeros of the last u64. We can take that value in bits and divide it by 8 to get the number of NUL bytes at the end. There is no endian-fixup or other compatibility here as this is string data interpreted as a u64. Signed-off-by: Joshua Ashton Signed-off-by: Kent Overstreet commit 01a7e74fe14179cba90bf3f52ad3188a1d6819d2 Author: Joshua Ashton Date: Sat Aug 12 22:26:29 2023 +0100 bcachefs: Introduce bch2_dirent_get_name A nice cleanup that avoids a bunch of open-coding name/string usage around dirent usage. Will be used by casefolding impl in future commits. Signed-off-by: Joshua Ashton Signed-off-by: Kent Overstreet commit f854ce4d0a3f7281b5b99b28dd028abe21c1b0c8 Author: Kent Overstreet Date: Sat Aug 12 17:10:42 2023 -0400 bcachefs: six locks: Guard against wakee exiting in __six_lock_wakeup() Signed-off-by: Kent Overstreet commit 93ee2c4b211b6fcfa0d796801372732a8214617c Author: Kent Overstreet Date: Sat Aug 12 16:51:45 2023 -0400 bcachefs: Don't open code closure_nr_remaining() Signed-off-by: Kent Overstreet commit df5a915a15a7343170f6ce707d807daa9efc245c Author: Kent Overstreet Date: Sat Aug 12 16:52:33 2023 -0400 bcachefs: Fix lifetime in bch2_write_done(), add assertion We're hunting for an open_bucket leak, add an assertion to help track it down: also, we can't use the bch_fs after dropping our write ref to it. Signed-off-by: Kent Overstreet commit 73ded163e5ec47d229683b32c501e548b745d032 Author: Kent Overstreet Date: Sat Aug 12 16:46:54 2023 -0400 bcachefs: Add a comment for should_drop_open_bucket() Signed-off-by: Kent Overstreet commit c294ea50da4b1a0ee84253f46391aa87a6efe91c Author: Kent Overstreet Date: Sat Aug 12 15:05:06 2023 -0400 bcachefs: six locks: Fix missing barrier on wait->lock_acquired Six locks do lock handoff via the wakeup path: the thread doing the wakeup also takes the lock on behalf of the waiter, which means the waiter only has to look at its waitlist entry, and doesn't have to touch the lock cacheline while another thread is using it. Linus noticed that this needs a real barrier, which this patch fixes. Also add a comment for the should_sleep_fn() error path. Signed-off-by: Kent Overstreet Cc: Linus Torvalds Cc: Boqun Feng Cc: linux-bcachefs@vger.kernel.org Cc: linux-kernel@vger.kernel.org commit c036359197705e5b133b30154771c3ebad5698b0 Author: Kent Overstreet Date: Sat Aug 12 12:34:47 2023 -0400 bcachefs: Check for directories in deleted inodes btree Signed-off-by: Kent Overstreet commit 791236b85c2dfd3bc6b857431658efb49de83343 Author: Joshua Ashton Date: Sat Aug 12 15:47:45 2023 +0100 bcachefs: Add btree_trans* to inode_set_fn This will be used when we need to re-hash a directory tree when setting flags. It is not possible to have concurrent btree_trans on a thread. Signed-off-by: Joshua Ashton Signed-off-by: Kent Overstreet commit e6375481c9efb765687cc4d6c1396b335c3d5ef1 Author: Kent Overstreet Date: Sat Aug 12 12:13:19 2023 -0400 bcachefs: Improve bch2_write_points_to_text() Now we also print the open_buckets owned by each write_point - this is to help with debugging a shutdown hang. Signed-off-by: Kent Overstreet commit e0a2b00a42e347a1be596fd9d1c071f0cd8c3f1f Author: Kent Overstreet Date: Fri Aug 11 22:22:31 2023 -0400 bcachefs: Fix check_version_upgrade() We were failing to upgrade to the latest compatible version - whoops. Signed-off-by: Kent Overstreet commit 83b3d9598a650d28071dbda0b97c7a9a6abd6e4a Author: Kent Overstreet Date: Fri Aug 11 19:30:38 2023 -0400 bcachefs: Fix 'journal not marked as containing replicas' This fixes the replicas_write_errors test: the patch bcachefs: mark journal replicas before journal write submission partially fixed replicas marking for the journal, but it broke the case where one replica failed - this patch re-adds marking after the journal write completes, when we know how many replicas succeeded. Additionally, we do not consider it a fsck error when the very last journal entry is not correctly marked, since there is an inherent race there. Signed-off-by: Kent Overstreet commit 401585fe87c2359f7aa24a309ec90e2589da9b46 Author: Kent Overstreet Date: Sat Aug 5 16:08:44 2023 -0400 bcachefs: btree_journal_iter.c Split out a new file from recovery.c for managing the list of keys we read from the journal: before journal replay finishes the btree iterator code needs to be able to iterate over and return keys from the journal as well, so there's a fair bit of code here. Signed-off-by: Kent Overstreet commit a37ad1a3aba957b20c8c434a88c1724e49409eb3 Author: Kent Overstreet Date: Sat Aug 5 15:54:38 2023 -0400 bcachefs: sb-clean.c Pull code for bch_sb_field_clean out into its own file. Signed-off-by: Kent Overstreet commit 0ec3985694802bebbeb087165328810062e73130 Author: Kent Overstreet Date: Sat Aug 5 15:43:00 2023 -0400 bcachefs: Move bch_sb_field_crypt code to checksum.c Signed-off-by: Kent Overstreet commit fb8e5b4cae91b1837006df3b6f81424e71ee8572 Author: Kent Overstreet Date: Sat Aug 5 15:40:21 2023 -0400 bcachefs: sb-members.c Split out a new file for bch_sb_field_members - we'll likely want to move more code here in the future. Signed-off-by: Kent Overstreet commit 8079aab085f2203960b352a153f07245d0507bf8 Author: Kent Overstreet Date: Sat Aug 5 12:55:08 2023 -0400 bcachefs: Split up btree_update_leaf.c We now have btree_trans_commit.c btree_update.c Signed-off-by: Kent Overstreet commit dbbfca9f41e86903501dded3fd494e1a56f3c310 Author: Kent Overstreet Date: Thu Aug 3 18:18:21 2023 -0400 bcachefs: Split up fs-io.[ch] fs-io.c is too big - time for some reorganization - fs-dio.c: direct io - fs-pagecache.c: pagecache data structures (bch_folio), utility code Signed-off-by: Kent Overstreet commit 1e81f89b020758fb424f8bb0f13405706d29dfc7 Author: Kent Overstreet Date: Mon Aug 7 12:04:05 2023 -0400 bcachefs: Fix assorted checkpatch nits Signed-off-by: Kent Overstreet commit 6fe893eade864665c0956a2ac2eff78b86dc8145 Author: Kent Overstreet Date: Mon Aug 7 20:44:56 2023 -0400 bcachefs: Fix for sb buffer being misaligned On old kernels, kmalloc() may return an allocation that's not naturally aligned - this resulted in a bug where we allocated a bio with not enough biovecs. Fix this by using buf_pages(). Signed-off-by: Kent Overstreet commit c4e382e234778197c95c5553024e0b3f93103382 Author: Kent Overstreet Date: Sun Aug 6 12:43:31 2023 -0400 bcachefs: Convert journal validation to bkey_invalid_flags This fixes a bug where we were already passing bkey_invalid_flags around, but treating the parameter as just read/write - so the compat code wasn't being run correctly. Signed-off-by: Kent Overstreet commit a8712967bf07dace4d6660bdcfe939b9043f1f16 Author: Kent Overstreet Date: Sun Aug 6 10:57:25 2023 -0400 bcachefs: Improve journal_entry_err_msg() Signed-off-by: Kent Overstreet commit e08e63e44e65761e6eb53fcd568d194f607daa61 Author: Kent Overstreet Date: Sun Aug 6 10:04:37 2023 -0400 bcachefs: BCH_COMPAT_bformat_overflow_done no longer required Awhile back, we changed bkey_format generation to ensure that the packed representation could never represent fields larger than the unpacked representation. This was to ensure that bkey_packed_successor() always gave a sensible result, but in the current code bkey_packed_successor() is only used in a debug assertion - not for anything important. This kills the requirement that we've gotten rid of those weird bkey formats, and instead changes the assertion to check if we're dealing with an old weird bkey format. Signed-off-by: Kent Overstreet commit 58705da67aedc3f68db322d2529ff52a5cdec0fa Author: Kent Overstreet Date: Sun Aug 6 10:02:41 2023 -0400 bcachefs: kill EBUG_ON() redefinition in bkey.c our debug mode assertions in bkey.c haven't been getting run, whoops Signed-off-by: Kent Overstreet commit e691b391f02b2ddef1a784ea2d4cd3f46bb6a62a Author: Kent Overstreet Date: Sun Aug 6 10:04:05 2023 -0400 bcachefs: Add logging to bch2_inode_peek() & related Add error messages when we fail to lookup an inode, and also add a few missing bch2_err_class() calls. Signed-off-by: Kent Overstreet commit 4198bf03bed27aa758de36595416beb604600912 Author: Kent Overstreet Date: Thu Aug 3 03:39:49 2023 -0400 bcachefs: Fix lock thrashing in __bchfs_fallocate() We've observed significant lock thrashing on fstests generic/083 in fallocate, due to dropping and retaking btree locks when checking the pagecache for data. This adds a nonblocking mode to bch2_clamp_data_hole(), where we only use folio_trylock(), and can thus be used safely while btree locks are held - thus we only have to drop btree locks as a fallback, on actual lock contention. Signed-off-by: Kent Overstreet commit f6e6f42bbbe5e421b57182bb0c92a237701ca889 Author: Kent Overstreet Date: Fri Aug 4 10:51:02 2023 -0400 bcachefs: Fix for bch2_copygc() spuriously returning -EEXIST Signed-off-by: Kent Overstreet commit 56046e3ecce5e9acf543884577d7fbad454de856 Author: Kent Overstreet Date: Thu Aug 3 19:36:28 2023 -0400 bcachefs: Convert btree_err_type to normal error codes Signed-off-by: Kent Overstreet commit 73adfcaf54c8fae86d80da9acad828ee2001cd60 Author: Kent Overstreet Date: Thu Aug 3 20:32:46 2023 -0400 bcachefs: Fix btree_err() macro Error code wasn't being propagated correctly, change it to match fsck_err() Signed-off-by: Kent Overstreet commit 0ed4ca146efda60057782ccda6dc056bf538cc75 Author: Kent Overstreet Date: Thu Aug 3 20:57:06 2023 -0400 bcachefs: Ensure topology repair runs This fixes should_restart_for_topology_repair() - previously it was returning false if the btree io path had already seleceted topology repair to run, even if it hadn't run yet. Signed-off-by: Kent Overstreet commit ad52bac251589cdcd206bfec46d670ba00e6edab Author: Kent Overstreet Date: Thu Aug 3 20:37:32 2023 -0400 bcachefs: Log a message when running an explicit recovery pass Signed-off-by: Kent Overstreet commit a1d1072fe75a52786b74f8a6093db3fa6a5d15d6 Author: Kent Overstreet Date: Thu Aug 3 17:33:20 2023 -0400 bcachefs: Print out required recovery passes on version upgrade Signed-off-by: Kent Overstreet commit 77212d3a76a4becabeac8736b686a533dd75913b Author: Kent Overstreet Date: Thu Aug 3 16:38:36 2023 -0400 bcachefs: Fix shift by 64 in set_inc_field() UBSAN was complaining about a shift by 64 in set_inc_field(). This only happened when the value being shifted was 0, so in theory should be harmless - a shift by 64 (or register width) should logically give a result of 0, but CPUs will in practice leave the input unchanged when the number of bits to shift by wraps - and since our input here is 0, the output is still what we want. But, it's still undefined behaviour and we need our UBSAN output to be clean, so it needs to be fixed. Signed-off-by: Kent Overstreet commit 6c6439650ec913c83d48055da63b8f204075afb7 Author: Kent Overstreet Date: Thu Aug 3 14:42:37 2023 -0400 bcachefs: bkey_format helper improvements - add a to_text() method for bkey_format - convert bch2_bkey_format_validate() to modern error message style, where we pass a printbuf for the error string instead of returning a static string Signed-off-by: Kent Overstreet commit dde8cb11645b7d95766dfd13f273facde27923a9 Author: Kent Overstreet Date: Mon Jul 17 00:56:29 2023 -0400 bcachefs: bcachefs_metadata_version_deleted_inodes Add a new bitset btree for inodes pending deletion; this means we no longer have to scan the full inodes btree after an unclean shutdown. Specifically, this adds: - a trigger to update the deleted_inodes btree based on changes to the inodes btree - a new recovery pass - and check_inodes is now only a fsck pass. Signed-off-by: Kent Overstreet commit 0a6d694584aeb739b976bf69646fa3c23ee117c3 Author: Kent Overstreet Date: Thu Aug 3 03:29:42 2023 -0400 bcachefs: Fix folio leak in folio_hole_offset() Signed-off-by: Kent Overstreet commit e2bd06178c458d0178265f75d7210e6c090bbfdb Author: Kent Overstreet Date: Thu Jul 20 22:42:26 2023 -0400 bcachefs: Fix overlapping extent repair A number of smallish fixes for overlapping extent repair, and (part of) a new unit test. This fixes all the issues turned up by bhzhu203, in his filesystem image from running mongodb + snapshots. Signed-off-by: Kent Overstreet commit b56b787c7d5e8300dba41d80ddd41472a39ca86f Author: Kent Overstreet Date: Wed Aug 2 20:19:58 2023 -0400 bcachefs: In debug mode, run fsck again after fixing errors We want to ensure that fsck actually fixed all the errors it found - the second fsck run should be clean. Signed-off-by: Kent Overstreet commit 1074a21c8858d088261387d449d3a64e188c906c Author: Kent Overstreet Date: Wed Aug 2 19:49:24 2023 -0400 bcachefs: recovery_types.h Move some code out of bcachefs.h, which is too much of an everything header. Signed-off-by: Kent Overstreet commit cf416e7ae6ea9699524cdce1a51a7cd427193203 Author: Kent Overstreet Date: Wed Aug 2 12:51:51 2023 -0400 bcachefs: Handle weird opt string from sys_fsconfig() Signed-off-by: Kent Overstreet commit bf5a261c7af80a2ac10bcc3ce0382cb238eccb8b Author: Kent Overstreet Date: Tue Aug 1 20:06:45 2023 -0400 bcachefs: Assorted fixes for clang clang had a few more warnings about enum conversion, and also didn't like the opts.c initializer. Signed-off-by: Kent Overstreet commit 7904c82ceae963b0f89e96a49dc714adffe3adc6 Author: Kent Overstreet Date: Fri Jul 21 03:20:08 2023 -0400 bcachefs: Move fsck_inode_rm() to inode.c Prep work for the new deleted inodes btree Signed-off-by: Kent Overstreet commit e8d2fe3b4bfad1c902f9b0acea1edc8d5291deb9 Author: Kent Overstreet Date: Fri Jul 21 05:38:45 2023 -0400 bcachefs: Consolidate btree id properties This refactoring centralizes defining per-btree properties. bch2_key_types_allowed was also about to overflow a u32, so expand that to a u64. Signed-off-by: Kent Overstreet commit 85beefefd2f8c0d8fa0a93660b0a1676073c57dc Author: Kent Overstreet Date: Fri Jul 21 00:27:19 2023 -0400 bcachefs: bch2_trans_update_extent_overwrite() Factor out a new helper, to be used when fsck has to repair overlapping extents. Signed-off-by: Kent Overstreet commit 3f4ab4c1e63ed2713e237b2af0d442380d8cdb49 Author: Kent Overstreet Date: Thu Jul 20 23:13:43 2023 -0400 bcachefs: Fix minor memory leak on invalid bkey Signed-off-by: Kent Overstreet commit ac319b4f89b9ff1377d294013aef59129a88b2d7 Author: Kent Overstreet Date: Thu Jul 20 23:14:05 2023 -0400 bcachefs: Move some declarations to the correct header Signed-off-by: Kent Overstreet commit 4437590d5f1a44078d54c0b959f38e22a8703fc7 Author: Kent Overstreet Date: Thu Jul 20 22:47:59 2023 -0400 bcachefs: Fix btree iter leak in __bch2_insert_snapshot_whiteouts() Signed-off-by: Kent Overstreet commit 2a89a3e9682b127c1978ac31eb38ef73a39a416e Author: Kent Overstreet Date: Thu Jul 20 19:30:53 2023 -0400 bcachefs: Fix a null ptr deref in check_xattr() We were attempting to initialize inode hash info when no inodes were found. Signed-off-by: Kent Overstreet commit 8e992c6c1f3869d0b33c754d4b6730603d3586c4 Author: Kent Overstreet Date: Mon Jul 17 00:56:07 2023 -0400 bcachefs: bch2_btree_bit_mod() New helper for bitset btrees. Signed-off-by: Kent Overstreet commit 4dc5bb9adf3035246e77d5e9cf7931b8af0fcaac Author: Kent Overstreet Date: Mon Jul 17 00:41:48 2023 -0400 bcachefs: move inode triggers to inode.c bit of reorg Signed-off-by: Kent Overstreet commit 9d8a3c95dce626d4d792228dead1edbf3251dda6 Author: Kent Overstreet Date: Mon Jul 17 00:12:58 2023 -0400 bcachefs: fsck: delete dead code Delete the old, now reimplemented overlapping extent check/repair. Signed-off-by: Kent Overstreet commit 922bc5a037ecf82d3cbad1c9976274f441328274 Author: Kent Overstreet Date: Sun Jul 16 23:19:49 2023 -0400 bcachefs: Make topology repair a normal recovery pass This adds bch2_run_explicit_recovery_pass(), for rewinding recovery and explicitly running a specific recovery pass - this is a more general replacement for how we were running topology repair before. Signed-off-by: Kent Overstreet commit ae2e13d7809d79ea4d7c0cd8ee060b7911012e37 Author: Kent Overstreet Date: Sun Jul 16 23:21:17 2023 -0400 bcachefs: bch2_run_explicit_recovery_pass() This introduces bch2_run_explicit_recovery_pass() and uses it for when fsck detects that we need to re-run dead snaphots cleanup, and makes dead snapshot cleanup more like a normal recovery pass. Signed-off-by: Kent Overstreet commit ef1634f0f19d676483888c2a05d7e406b366d2db Author: Kent Overstreet Date: Thu Jul 20 18:09:26 2023 -0400 bcachefs: Print version, options earlier in startup path Signed-off-by: Kent Overstreet commit 60a5b898007d766d6180ca101634bf7cad98d82f Author: Brian Foster Date: Wed Jul 19 08:53:06 2023 -0400 bcachefs: use prejournaled key updates for write buffer flushes The write buffer mechanism journals keys twice in certain situations. A key is always journaled on write buffer insertion, and is potentially journaled again if a write buffer flush falls into either of the slow btree insert paths. This has shown to cause journal recovery ordering problems in the event of an untimely crash. For example, consider if a key is inserted into index 0 of a write buffer, the active write buffer switches to index 1, the key is deleted in index 1, and then index 0 is flushed. If the original key is rejournaled in the btree update from the index 0 flush, the (now deleted) key is journaled in a seq buffer ahead of the latest version of key (which was journaled when the key was deleted in index 1). If the fs crashes while this is still observable in the log, recovery sees the key from the btree update after the delete key from the write buffer insert, which is the incorrect order. This problem is occasionally reproduced by generic/388 and generally manifests as one or more backpointer entry inconsistencies. To avoid this problem, never rejournal write buffered key updates to the associated btree. Instead, use prejournaled key updates to pass the journal seq of the write buffer insert down to the btree insert, which updates the btree leaf pin to reflect the seq of the key. Note that tracking the seq is required instead of just using NOJOURNAL here because otherwise we lose protection of the write buffer pin when the buffer is flushed, which means the key can fall off the tail of the on-disk journal before the btree leaf is flushed and lead to similar recovery inconsistencies. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit eabb10dc9561525661d4fda229134a6f8716e007 Author: Brian Foster Date: Wed Jul 19 08:53:05 2023 -0400 bcachefs: support btree updates of prejournaled keys Introduce support for prejournaled key updates. This allows a transaction to commit an update for a key that already exists (and is pinned) in the journal. This is required for btree write buffer updates as the current scheme of journaling both on write buffer insertion and write buffer (slow path) flush is unsafe in certain crash recovery scenarios. Create a small trans update wrapper to pass along the seq where the key resides into the btree_insert_entry. From there, trans commit passes the seq into the btree insert path where it is used to manage the journal pin for the associated btree leaf. Note that this patch only introduces the underlying mechanism and otherwise includes no functional changes. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 78623ee0d0d72c497967be41277f022c0052631c Author: Brian Foster Date: Wed Jul 19 08:53:04 2023 -0400 bcachefs: fold bch2_trans_update_by_path_trace() into callers There is only one other caller so eliminate some boilerplate. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit a2437bba0561e94abe2f9254297b25ca13c92c23 Author: Brian Foster Date: Wed Jul 19 08:53:03 2023 -0400 bcachefs: remove unnecessary btree_insert_key_leaf() wrapper This is in preparation to support prejournaled keys. We want the ability to optionally pass a seq stored in the btree update rather than the seq of the committing transaction. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 2110f21ec0a294360f2a510ff33d38605af45d88 Author: Brian Foster Date: Wed Jul 19 08:53:02 2023 -0400 bcachefs: remove duplicate code between backpointer update paths Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit f7b3e651de8e269887ac25f1a26a96396c8fb91d Author: Brian Foster Date: Thu Jul 20 09:00:33 2023 -0400 MAINTAINERS: add Brian Foster as a reviewer for bcachefs Brian has been playing with bcachefs for several months now and has offerred to commit time to patch review. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 970a5096acc223e90c9fad853575c87ee85b02ae Author: Kent Overstreet Date: Sun Jul 16 22:31:19 2023 -0400 bcachefs: Suppresss various error messages in no_data_io mode We commonly use no_data_io mode when debugging filesystem metadata dumps, where data checksum/compression errors are expected and unimportant - this patch suppresses these. Signed-off-by: Kent Overstreet commit 20e6d9a8d4050220f4e0a0195d102abaf2c8439b Author: Kent Overstreet Date: Sun Jul 16 21:56:18 2023 -0400 bcachefs: Fix lookup_inode_for_snapshot() This fixes a use-after-free. Signed-off-by: Kent Overstreet commit 6b20d746adb7d7e662f8fc6b93fab8513654d51e Author: Kent Overstreet Date: Sun Jul 16 21:09:37 2023 -0400 bcachefs: need_snapshot_cleanup shouldn't be a fsck error We currently don't track whether snapshot cleanup still needs to finish (aside from running a full fsck), so it shouldn't be a fsck error yet - fsck -n after fsck has succesfully completed shouldn't error. Signed-off-by: Kent Overstreet commit 464ee1929b7761d2939ad76573e6679b4246dc82 Author: Kent Overstreet Date: Sun Jul 16 18:15:01 2023 -0400 bcachefs: Improve key_visible_in_snapshot() Delete a redundant bch2_snapshot_is_ancestor() check, and convert some assertions to debug assertions. Signed-off-by: Kent Overstreet commit a397b8df5e2f2981427f2609252f37066a0cf780 Author: Kent Overstreet Date: Sun Jul 16 15:12:25 2023 -0400 bcachefs: Refactor overlapping extent checks Make the overlapping extent check/repair code more self contained. This is prep work for hopefully reducing key_visible_in_snapshot() usage here as well, and also includes a nice performance optimization to not check ref_visible2() unless the extents potentially overlap. Signed-off-by: Kent Overstreet commit a0076086da73297228665957c3b3bfac2492d67d Author: Kent Overstreet Date: Sun Jul 16 14:55:33 2023 -0400 bcachefs: check_extent(): don't use key_visible_in_snapshot() This changes the main part of check_extents(), that checks the extent against the corresponding inode, to not use key_visible_in_snapshot(). key_visible_in_snapshot() has to iterate over the list of ancestor overwrites repeatedly calling bch2_snapshot_is_ancestor(), so this is a significant performance improvement. Signed-off-by: Kent Overstreet commit 650eb16b45183c7ea7c17e56ac862dc1ad1ec849 Author: Kent Overstreet Date: Sun Jul 16 14:45:23 2023 -0400 bcachefs: check_extent() refactoring More prep work for reducing key_visible_in_snapshot() usage - this rearranges how KEY_TYPE_whitout keys are handled, so that they can be marked off in inode_warker->inode->seen_this_pos. Signed-off-by: Kent Overstreet commit a57f4d611320a38b1985b2e5ba342d923b35964f Author: Kent Overstreet Date: Sun Jul 16 14:19:08 2023 -0400 bcachefs: fsck: walk_inode() now takes is_whiteout We only want to synthesize an inode for the current snapshot ID for non whiteouts - this refactoring lets us call walk_inode() earlier and clean up some control flow. Signed-off-by: Kent Overstreet commit 0d8f320dd7e8fb4f1ac125f168e939b952ca3f8c Author: Kent Overstreet Date: Thu Jul 13 01:41:02 2023 -0400 bcachefs: Simplify check_extent() Minor refactoring/dead code deletion, prep work for reworking check_extent() to avoid key_visible_in_snapshot(). Signed-off-by: Kent Overstreet commit 43b81a4eaca01ef13293d139670981cc4da18d3c Author: Kent Overstreet Date: Thu Jul 13 03:11:16 2023 -0400 bcachefs: overlapping_extents_found() This improves the repair path for overlapping extents - we now verify that we find in the btree the overlapping extents that the algorithm detected, and fail the fsck run with a more useful error if it doesn't match. Signed-off-by: Kent Overstreet commit f9f52bc4f0342ddc68690ebdc581eedfbd4a9c6b Author: Kent Overstreet Date: Sun Jul 16 14:24:36 2023 -0400 bcachefs: fsck: inode_walker: last_pos, seen_this_pos Prep work for changing check_extent() to avoid key_visible_in_snapshot() - this adds the state to track whether an inode has seen an extent at this pos. Signed-off-by: Kent Overstreet commit 5897505e67f542452b4f26b6eba949c71e3da7d5 Author: Kent Overstreet Date: Sun Jul 16 14:33:57 2023 -0400 bcachefs: check_extents(): make sure to check i_sectors for last inode Signed-off-by: Kent Overstreet commit 93de9e92c32c73d25bccbd82b1dabff3e3c2b7d2 Author: Kent Overstreet Date: Sun Jul 16 15:59:40 2023 -0400 bcachefs: Inline bch2_snapshot_is_ancestor() fast path Signed-off-by: Kent Overstreet commit 813e0cecd1473d7328376f9ca56f9239bc5b8146 Author: Kent Overstreet Date: Sat Jul 15 21:03:26 2023 -0400 bcachefs: Upgrade path fixes Some minor fixes to not print errors that are actually due to a verson upgrade. Signed-off-by: Kent Overstreet commit 6132c84cacbff39e7b060abffc4175244347885d Author: Kent Overstreet Date: Thu Jul 13 02:43:29 2023 -0400 bcachefs: is_ancestor bitmap Further optimization for bch2_snapshot_is_ancestor(). We add a small inline bitmap to snapshot_t, which indicates which of the next 128 snapshot IDs are ancestors of the current id - eliminating the last few iterations of the loop in bch2_snapshot_is_ancestor(). Signed-off-by: Kent Overstreet commit 5eaa76d813d48a524a1ce040539048b851a0a20c Author: Mikulas Patocka Date: Thu Jul 13 18:00:28 2023 +0200 bcachefs: mark bch_inode_info and bkey_cached as reclaimable Mark these caches as reclaimable, so that available memory is correctly reported when there is a lot of cached inodes. Note that more work is needed - you should add __GFP_RECLAIMABLE to some of the kmalloc calls, so that they are allocated from the "kmalloc-rcl-*" caches. Signed-off-by: Mikulas Patocka Signed-off-by: Kent Overstreet commit 986e9842fb6825f65918ed400b29c8c878359b7a Author: Kent Overstreet Date: Wed Jul 12 22:27:16 2023 -0400 bcachefs: Compression levels This allows including a compression level when specifying a compression type, e.g. compression=zstd:15 Values from 1 through 15 indicate compression levels, 0 or unspecified indicates the default. For LZ4, values 3-15 specify that the HC algorithm should be used. Note that for compatibility, extents themselves only include the compression type, not the compression level. This means that specifying the same compression algorithm but different compression levels for the compression and background_compression options will have no effect. XXX: perhaps we could add a warning for this Signed-off-by: Kent Overstreet commit e86e9124ca6c762f02cc412ce71feb9ed2e4890d Author: Kent Overstreet Date: Wed Jul 12 22:06:37 2023 -0400 bcachefs: Extent sb compression type fields to 8 bits The upper 4 bits are for compression level. Signed-off-by: Kent Overstreet commit a5cf5a4b41f3ca1ef7eb2d8fede50b2fa791b928 Author: Kent Overstreet Date: Wed Jul 12 22:06:11 2023 -0400 bcachefs: bcachefs_format.h should be using __u64 Signed-off-by: Kent Overstreet commit a0f8faea5f47d6e18253225e8f2f88cdc49d27d8 Author: Kent Overstreet Date: Tue Jul 11 23:47:29 2023 -0400 bcachefs: fix_errors option is now a proper enum Before, it was parsed as a bool but internally it was really an enum: this lets us pass in all the possible values. But we special case the option parsing: no supplied value is parsed as FSCK_FIX_yes, to match the previous behaviour. Signed-off-by: Kent Overstreet commit 9f343e24f541bef3d5f081925eae5734c2c39c28 Author: Kent Overstreet Date: Wed Jul 12 21:48:32 2023 -0400 bcachefs: bch_opt_fn Minor refactoring to get rid of some unneeded token pasting. Signed-off-by: Kent Overstreet commit 8479938d7a0f6c6cf6362c72880e753b3d7a707a Author: Kent Overstreet Date: Wed Jul 12 13:55:03 2023 -0400 bcachefs: Convert snapshot table to RCU array This switches the generic radix tree for the in-memory table of snapshot nodes to a simple rcu array. This means we have to add new locking to deal with reallocations, but is faster than traversing the radix tree. Signed-off-by: Kent Overstreet commit d82978ca1593890a1b41eab6d06fe6e5950e4722 Author: Kent Overstreet Date: Wed Jul 12 11:43:03 2023 -0400 bcachefs: Add a race_fault() for write buffer slowpath We haven't hooked up dynamic fault injection quite yet, but we will soon Signed-off-by: Kent Overstreet commit f39d1aca4de011949b1b1c636de3146f3b7c1384 Author: Kent Overstreet Date: Mon Jul 10 20:30:04 2023 -0400 bcachefs: Add buffered IO fallback for userspace In userspace, we want to be able to switch to buffered IO when we're dealing with an image on a filesystem/device that doesn't support the blocksize the filesystem was formatted with. This plumbs through !opts.direct_io -> FMODE_BUFFERED, which will be supported by the shim version of blkdev_get_by_path() in -tools, and it adds a fallback to disable direct IO and retry for userspace. Signed-off-by: Kent Overstreet commit a09818c7e78633ee8a6d147ea5bf074d60ea66cd Author: Kent Overstreet Date: Sun Jul 9 22:28:08 2023 -0400 bcachefs: Fallocate now checks page cache Previously, fallocate would only check the state of the extents btree when determining if we need to create a reservation. But the page cache might already have dirty data or a disk reservation. This changes __bchfs_fallocate() to call bch2_seek_pagecache_hole() to check for this. Signed-off-by: Kent Overstreet commit ea28c86722954a58e3bab24eec3e7624e8d4956b Author: Kent Overstreet Date: Mon Jul 10 17:23:59 2023 -0400 bcachefs: Don't start copygc until recovery is finished With "bcachefs: Snapshot depth, skiplist fields", we now can't run data move operations until after bch2_check_snapshots() is complete. Ideally we'd have the copygc (and rebalance) threads wait until c->curr_recovery_pass has advanced, but the waitlist handling is tricky - so for now, move starting copygc back to read_write_late(). Signed-off-by: Kent Overstreet commit b912913613a1195ba86cbb1bc9b1c12b4c6c4a14 Author: Kent Overstreet Date: Mon Jul 10 15:56:05 2023 -0400 bcachefs: Fix build error on weird gcc fixes ./include/linux/stddef.h:8:14: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init] Signed-off-by: Kent Overstreet commit f26c67f4a7c4951a312547790b11066bc510822e Author: Kent Overstreet Date: Sun Jun 25 18:04:46 2023 -0400 bcachefs: Snapshot depth, skiplist fields This extents KEY_TYPE_snapshot to include some new fields: - depth, to indicate depth of this particular node from the root - skip[3], skiplist entries for quickly walking back up to the root These are to improve bch2_snapshot_is_ancestor(), making it O(ln(n)) instead of O(n) in the snapshot tree depth. Skiplist nodes are picked at random from the set of ancestor nodes, not some fixed fraction. This introduces bcachefs_metadata_version 1.1, snapshot_skiplists. Signed-off-by: Kent Overstreet commit 065bd3356ce490ae9454d8b3c98ff298e13d09ac Author: Kent Overstreet Date: Mon Jul 10 13:42:26 2023 -0400 bcachefs: Version table now lists required recovery passes Now that we've got forward compatibility sorted out, we should be doing more frequent version upgrades in the future. To avoid having to run a full fsck for every version upgrade, this improves the BCH_METADATA_VERSIONS() table to explicitly specify a bitmask of recovery passes to run when upgrading to or past a given version. This means we can also delete PASS_UPGRADE(). Signed-off-by: Kent Overstreet commit 6619d84626ff266721f4c3c24339c60ca8cb12e0 Author: Kent Overstreet Date: Mon Jul 10 12:23:01 2023 -0400 bcachefs: bch2_sb_maybe_downgrade(), bch2_sb_upgrade() Add some new helpers, and fix upgrade/downgrade in bch2_fs_initialize(). Signed-off-by: Kent Overstreet commit 01e691e830edae9a145eeb70f8983223d606e2ca Author: Kent Overstreet Date: Mon Jul 10 11:17:56 2023 -0400 bcachefs: Fix a write buffer flush deadlock We're not supposed to block if BTREE_INSERT_JOURNAL_RECLAIM && watermark != BCH_WATERMARK_reclaim. This should really be a separate BTREE_INSERT_NONBLOCK flag - add some comments to that effect, it's not important for this patch. btree write buffer flush depends on this behaviour though - the first loop tries to flush sequentially, which doesn't free up space in the journal optimally. If that can't proceed we bail out and flush in journal order - that won't work if we're blocked instead of returning an error. Signed-off-by: Kent Overstreet commit ba8eeae8eee0aae03eb6be0372519b72057d312c Author: Kent Overstreet Date: Tue Jun 27 22:09:35 2023 -0400 bcachefs: bcachefs_metadata_version_major_minor This introduces major/minor versioning to the superblock version number. Major version number changes indicate incompatible releases; we can move forward to a new major version number, but not backwards. Minor version numbers indicate compatible changes - these add features, but can still be mounted and used by old versions. With the recent patches that make it possible to roll out new btrees and key types without breaking compatibility, we should be able to roll out most new features without incompatible changes. Signed-off-by: Kent Overstreet commit 30a8278a1e2f627b1f28ab521e40eecacb223efc Author: Kent Overstreet Date: Sun Jul 9 15:13:30 2023 -0400 bcachefs: Add new assertions for shutdown path We've been seeing assertions pop that indicate the btree node cache or key cache have dirty items when we just did a clean shutdown. Add some more assertions so we can catch this when we're dirtying items. Signed-off-by: Kent Overstreet commit 07f293c8630d5bdae1615e6add90c76fed333d20 Author: Kent Overstreet Date: Sun Jul 9 14:18:28 2023 -0400 bcachefs: bch2_xattr_set() now updates ctime Fixes fstests generic/728 Signed-off-by: Kent Overstreet commit ca630f1d3767c20026b33ba1603017e5c8e9da5a Author: Kent Overstreet Date: Sun Jul 9 14:12:58 2023 -0400 bcachefs: Kill bch2_xattr_get() Inline it into the only caller Signed-off-by: Kent Overstreet commit e8ee5cc733319496cbe8a97bc75ccdb6058d2da7 Author: Kent Overstreet Date: Sun Jul 9 13:49:34 2023 -0400 bcachefs: Fix try_decrease_writepoints() We were freeing open buckets on the writepoint list, but forgetting to take them off the writepoint list - whoops Signed-off-by: Kent Overstreet commit dbc7deb2afc71aa466c9ed4c3cefd838d823bff7 Author: Kent Overstreet Date: Sun Jul 9 13:20:29 2023 -0400 bcachefs: Mark as EXPERIMENTAL As discussed on list, bcachefs is going to be marked as experimental for a few releases, until the inevitable tide of new bug reports subsides. Signed-off-by: Kent Overstreet commit 067d228bb0c40542620398ef1d79f00f47c05cbb Author: Kent Overstreet Date: Fri Jul 7 02:42:28 2023 -0400 bcachefs: Enumerate recovery passes Recovery and fsck have many different passes/jobs to do, which always run in the same order - but not all of them run all the time. Some are for fsck, some for unclean shutdown, some for version upgrades. This adds some new structure: a defined list of recovery passes that we can run in a loop, as well as consolidating the log messages. The main benefit is consolidating the "should run this recovery pass" logic, as well as cleaning up the "this recovery pass has finished" state; instead of having a bunch of ad-hoc state bits in c->flags, we've now got c->curr_recovery_pass. By consolidating the "should run this recovery pass" logic, in the future on disk format upgrades will be able to say "upgrading to this version requires x passes to run", instead of forcing all of fsck to run. Signed-off-by: Kent Overstreet commit 78328fec704e316b36142a9a13af8665cd46da47 Author: Kent Overstreet Date: Sat Jul 8 22:33:29 2023 -0400 bcachefs: Stash journal replay params in bch_fs For the upcoming enumeration of recovery passes, we need all recovery passes to be called the same way - including journal replay. Signed-off-by: Kent Overstreet commit 10a6ced2da8e4b53a14ab172b0ce70b83543bbfb Author: Kent Overstreet Date: Sat Jul 8 22:27:03 2023 -0400 bcachefs: Kill bch2_bucket_gens_read() This folds bch2_bucket_gens_read() into bch2_alloc_read(), doing the version check there. This is prep work for enumarating all recovery passes: we need some cleanup first to make calling all the recovery passes consistent. Signed-off-by: Kent Overstreet commit 9a644843c4701f86594fe0386f00af6b847f747d Author: Kent Overstreet Date: Sat Jul 8 22:21:45 2023 -0400 bcachefs: Fix error path in bch2_journal_flush_device_pins() We need to always call bch2_replicas_gc_end() after we've called bch2_replicas_gc_start(), else we leave state around that needs to be cleaned up. Partial fix for: https://github.com/koverstreet/bcachefs/issues/560 Signed-off-by: Kent Overstreet commit 3045bb958acf5d3bc799c791d14e40676477bd16 Author: Kent Overstreet Date: Tue Jun 27 23:34:02 2023 -0400 bcachefs: version_upgrade is now an enum The version_upgrade parameter is now an enum, not a bool, and it's persistent in the superblock: - compatible (default): upgrade to the latest compatible version - incompatible: upgrade to latest incompatible version - none Currently all upgrades are incompatible upgrades, but the next release will introduce major:minor versions. Signed-off-by: Kent Overstreet commit 24964e1c5c89e00ca55909ab24ce8d28e2b46406 Author: Kent Overstreet Date: Wed Jun 28 19:59:56 2023 -0400 bcachefs: BCH_SB_VERSION_UPGRADE_COMPLETE() Version upgrades are not atomic operations: when we do a version upgrade we need to update the superblock before we start using new features, and then when the upgrade completes we need to update the superblock again. This adds a new superblock field so we can detect and handle incomplete version upgrades. Signed-off-by: Kent Overstreet commit 7c50140fce00120b1dcf674759393267689ca2d8 Author: Kent Overstreet Date: Fri Jul 7 17:09:26 2023 -0400 bcachefs: Convert more -EROFS to private error codes Signed-off-by: Kent Overstreet commit c8b4534d820f47480e7d5efb38d13e10919ccc7c Author: Kent Overstreet Date: Fri Jul 7 04:38:29 2023 -0400 bcachefs: Delete redundant log messages Now that we have distinct error codes for different memory allocation failures, the early init log messages are no longer needed. Signed-off-by: Kent Overstreet commit 8726dc936fb79fda4a0280033cdd180f7f343cdd Author: Kent Overstreet Date: Thu Jul 6 21:16:10 2023 -0400 bcachefs: Change check for invalid key types As part of the forward compatibility patch series, we need to allow for new key types without complaining loudly when running an old version. This patch changes the flags parameter of bkey_invalid to an enum, and adds a new flag to indicate we're being called from the transaction commit path. Signed-off-by: Kent Overstreet commit 73bd774d28d2b2e6a05c31bf7afb9247e02a8e49 Author: Kent Overstreet Date: Thu Jul 6 22:47:42 2023 -0400 bcachefs: Assorted sparse fixes - endianness fixes - mark some things static - fix a few __percpu annotations - fix silent enum conversions Signed-off-by: Kent Overstreet commit 236b68da5017b5336b332f941323a5bc450594b3 Author: Kent Overstreet Date: Thu Jul 6 20:11:36 2023 -0400 bcachefs: Refactor bch_sb_field_ops handling This changes bch_sb_field_ops lookup to match how bkey_ops now works; for an unknown field type we return an empty ops struct. Signed-off-by: Kent Overstreet commit 183e9c430ea9775fdd1f7097f309ef61471562fc Author: Kent Overstreet Date: Thu Jul 6 19:23:27 2023 -0400 bcachefs: Allow for unknown key types This adds a new helper for lookups bkey_ops for a given key type, which returns a null bkey_ops for unknown key types; various bkey_ops users are tweaked as well to handle unknown key types. Signed-off-by: Kent Overstreet commit faa6cb6c13c7223240366ebbf0217a6191fbfc32 Author: Kent Overstreet Date: Wed Jun 28 22:09:13 2023 -0400 bcachefs: Allow for unknown btree IDs We need to allow filesystems with metadata from newer versions to be mountable and usable by older versions. This patch enables us to roll out new btrees without a new major version number; we can now handle btree roots for unknown btree types. The unknown btree roots will be retained, and fsck (including backpointers) will check them, the same as other btree types. We add a dynamic array for the extra, unknown btree roots, in addition to the fixed size btree root array, and add new helpers for looking up btree roots. Signed-off-by: Kent Overstreet commit bc652905c60b504ded266448b2810242d24c8d88 Author: Brian Foster Date: Fri Jun 30 13:09:46 2023 -0400 bcachefs: flush journal to avoid invalid dev usage entries on recovery A crash immediately after device removal can result in an unmountable filesystem due to recovery failure. The following command reliably reproduces on a multi-device fs: bcachefs device remove && xfs_io -xc shutdown The post-crash mount fails with an error similar to the following, reported by fsck: invalid journal entry dev_usage at offset 7994/8034 seq 12: bad dev, fixing This refers to a device usage entry in the journal that refers to the index of the just removed device. Recovery considers this an invalid entry and fails to proceed. Device usage entries are added to journal buffer writes via bch_journal_write() -> bch2_journal_super_entries_add_common(), which means any journal buffer write has content that refers to member devices at the time of the journal write. The device remove sequence already removes metadata references to the device being removed. It then flushes any pins that refer to the device, clears replica entries, removes the in-memory device object and lastly updates the superblock to reflect that the device is no longer present. The problem is that any journal writes that occur during this sequence will include a dev usage entry so long as the device is present. To avoid this problem, we can flush the journal once more after the device entry is removed from the in-core structures, but before the superblock is updated to fully remove the device on-disk. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit d14bfd1010c4ce8bede5bd98d0b332e3b34b8bd5 Author: Brian Foster Date: Fri Jun 30 10:51:46 2023 -0400 bcachefs: mark active journal devices on journal replicas gc A simple device evacuate, remove, add test loop with concurrent shutdowns occasionally reproduces a problem where the filesystem fails to mount. The mount failure occurs because the filesystem was uncleanly shut down, yet no member device is marked for journal data in the superblock. An fsck detects the problem, restores the mark and allows the mount to proceed without further consistency issues. The reason for the lack of journal data marks is the gc mechanism invoked via bch2_journal_flush_device_pins() runs while the journal happens to be empty. This results in garbage collection of all journal replicas entries. Once the updated replicas table is written to the superblock, the filesystem is put in a transiently unrecoverable state until further journal data is written, because journal recovery expects to find at least one marked journal device whenever the filesystem is not otherwise marked clean (i.e. as on clean unmount). To fix this problem, update the journal replicas gc algorithm to always mark currently active journal replicas entries by writing to the journal. This ensures that only entries for devices that are no longer used for journaling are garbage collected, not just those that don't happen to currently hold journal data. This preserves the journal recovery invariant above and avoids putting the fs into a transiently unrecoverable state. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit a02a0121b3de81f985d6c751f1557c7aea832b9a Author: Kent Overstreet Date: Wed Jun 28 20:27:07 2023 -0400 bcachefs: bch2_version_compatible() This adds a new helper for checking if an on-disk version is compatible with the running version of bcachefs - prep work for introducing major:minor version numbers. Signed-off-by: Kent Overstreet commit e3804b55e4358cf5a235fa1ba32204af9f7046dd Author: Kent Overstreet Date: Wed Jun 28 19:53:05 2023 -0400 bcachefs: bch2_version_to_text() Add a new helper for printing out metadata versions in a standard format. Signed-off-by: Kent Overstreet commit f33c58fc46a9c5bd6cbf90edb6ce17fa3fd912d5 Author: Kent Overstreet Date: Tue Jun 27 17:32:48 2023 -0400 bcachefs: Kill BTREE_INSERT_USE_RESERVE Now that we have journal watermarks and alloc watermarks unified, BTREE_INSERT_USE_RESERVE is redundant and can be deleted. Signed-off-by: Kent Overstreet commit 65db60490a36cbfc0500cb86bf539614c89501d3 Author: Kent Overstreet Date: Wed Jun 28 00:01:19 2023 -0400 bcachefs: Fix a null ptr deref in bch2_fs_alloc() error path This fixes a null ptr deref in bch2_free_pending_node_rewrites() when the list head wasn't initialized. Signed-off-by: Kent Overstreet commit 0b9fbce235c3ae545b6f31b8f2de2de030689595 Author: Kent Overstreet Date: Tue Jun 27 23:28:17 2023 -0400 bcachefs: Fix a format string warning Signed-off-by: Kent Overstreet commit ec14fc6010fdcc40e54e289afc657a676ce93e72 Author: Kent Overstreet Date: Tue Jun 27 17:32:38 2023 -0400 bcachefs: Kill JOURNAL_WATERMARK This unifies JOURNAL_WATERMARK with BCH_WATERMARK; we're working towards specifying watermarks once in the transaction commit path. Signed-off-by: Kent Overstreet commit 494036d862dfff1de9782492692da225479b7146 Author: Kent Overstreet Date: Tue Jun 27 17:29:20 2023 -0400 bcachefs: BCH_WATERMARK_reclaim Add another watermark for journal reclaim - this is needed for the next patches, that unify BCH_WATERMARK with JOURNAL_WATERMARK. Signed-off-by: Kent Overstreet commit 2766876d5d118abd59d14fbe5b31e7e208ea11f2 Author: Kent Overstreet Date: Tue Jun 27 19:02:17 2023 -0400 bcachefs: struct bch_extent_rebalance This adds the extent entry for extents that rebalance needs to do something with. We're adding this ahead of the main rebalance_work patchset, because adding new extent entries can't be done in a forwards-compatible way. Signed-off-by: Kent Overstreet commit 4e1430a728499ce8088e1bdd0dd6467ce3447ca0 Author: Kent Overstreet Date: Tue Jun 27 18:01:09 2023 -0400 bcachefs: Expand BTREE_NODE_ID We now have 20 bits for the btree ID in the on disk format - sufficient for 1 million distinct btrees. Signed-off-by: Kent Overstreet commit e4eb661d3a5764273cb854d7c441819943692971 Author: Kent Overstreet Date: Tue Jun 27 19:10:24 2023 -0400 bcachefs: Fix btree node write error message Error messages should include the error code, when available. Signed-off-by: Kent Overstreet commit 06dcca5191dcae948fa8ffd9369deb832881ffcd Author: Kent Overstreet Date: Sun Jun 25 16:35:49 2023 -0400 bcachefs: fsck: Break walk_inode() up into multiple functions Some refactoring, prep work for algorithm improvements related to snapshots. we need to add a bitmap to the list of inodes for "seen this snapshot"; for this bitmap to correctly be available, we'll need to gather the list of inodes first, and later look up the inode for a given snapshot. Signed-off-by: Kent Overstreet commit 1fa3e87ac50a24a4f6a71986a4d9bc2f16d0667e Author: Kent Overstreet Date: Tue Jun 27 16:20:05 2023 -0400 bcachefs: Fix leak in backpointers fsck We were forgetting to exit a printbuf - whoops. Signed-off-by: Kent Overstreet commit b3591acc3bc25d120dd9cb72f462e009e046a254 Author: Kent Overstreet Date: Mon Jun 26 23:31:49 2023 -0400 bcachefs: unregister_shrinker() now safe on not-registered shrinker Signed-off-by: Kent Overstreet commit 0ce4e0e759614ec19b140e8f19a67305c01cca78 Author: Kent Overstreet Date: Mon Jun 26 23:10:21 2023 -0400 bcachefs: Add a missing rhashtable_destroy() call Fixes https://lore.kernel.org/linux-bcachefs/784c3e6a-75bd-e6ca-535a-43b3e1daf643@kernel.dk/T/#mbf7caf005f960018eba23b58795d06c06c947411 Signed-off-by: Kent Overstreet commit 0fb3355d0a3b055af8735fa25b5af63f4dd9a034 Author: Kent Overstreet Date: Mon Jun 26 18:36:24 2023 -0400 bcachefs: Improve bch2_bkey_make_mut() bch2_bkey_make_mut() now takes the bkey_s_c by reference and points it at the new, mutable key. This helps in some fsck paths that may have multiple repair operations on the same key. Signed-off-by: Kent Overstreet commit 298ac24e6346b517148a6645c7c5686565868753 Author: Kent Overstreet Date: Mon Jun 26 22:26:04 2023 -0400 bcachefs: Reduce stack frame size of bch2_check_alloc_info() Excessive inlining may (on some versions of gcc?) cause excessive stack usage; this turns off some inlining in bch2_check_alloc_info. Signed-off-by: Kent Overstreet commit 75da97640a75878cd197f6dd9c50b46cac6cb9a8 Author: Kent Overstreet Date: Sun Jun 25 01:34:45 2023 -0400 bcachefs: fsck needs BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE A few fsck paths weren't using BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE - oops. Signed-off-by: Kent Overstreet commit 454377d8432fdfaa5ebfca05a9bfa3af311d5b9a Author: Kent Overstreet Date: Sat Jun 24 23:22:20 2023 -0400 bcachefs: Improve error message for overlapping extents We now print out the full previous extent we overlapping with, to aid in debugging and searching through the journal. Signed-off-by: Kent Overstreet commit 8f507f89b8b87d2ee4adc990b96388001444967e Author: Kent Overstreet Date: Sat Jun 24 23:20:39 2023 -0400 bcachefs: Fix check_pos_snapshot_overwritten() Signed-off-by: Kent Overstreet commit e53a961c6b1ced2ac1ab69fdf56706cf21e6f7a6 Author: Kent Overstreet Date: Sat Jun 24 19:30:10 2023 -0400 bcachefs: Rename enum alloc_reserve -> bch_watermark This is prep work for consolidating with JOURNAL_WATERMARK. Signed-off-by: Kent Overstreet commit e9d017234ff96ed9820dc7cd3a4c940af44330bf Author: Kent Overstreet Date: Sat Jun 24 15:59:03 2023 -0400 bcachefs: BCH_ERR_fsck -> EINVAL When we return errors outside of bcachefs, we need to return a standard error code - fix this for BCH_ERR_fsck. Signed-off-by: Kent Overstreet commit 3a63b32f121262f0566f8b89e98dd0c10f610325 Author: Kent Overstreet Date: Sat Jun 24 12:17:57 2023 -0400 bcachefs: bch2_trans_mark_pointer() refactoring bch2_bucket_backpointer_mod() doesn't need to update the alloc key, we can exit the alloc iter earlier. Signed-off-by: Kent Overstreet commit 9473cff989c8519d01c6a285bd94d2ed35d30251 Author: Kent Overstreet Date: Wed Jun 21 06:44:44 2023 -0400 bcachefs: Fix more lockdep splats in debug.c Similar to previous fixes, we can't incur page faults while holding btree locks. Signed-off-by: Kent Overstreet commit 462f494bc56052e3d17c9ae48a6e407b3f9d2c0c Author: Kent Overstreet Date: Wed Jun 21 06:00:04 2023 -0400 bcachefs: Fix lockdep splat in bch2_readdir dir_emit() can fault (taking mmap_lock); thus we can't be holding btree locks. Signed-off-by: Kent Overstreet commit b6898917f2b5532ca7ad9b16131a5a6b513285e5 Author: Kent Overstreet Date: Wed Jun 21 00:31:49 2023 -0400 bcachefs: Check for ERR_PTR() from filemap_lock_folio() Signed-off-by: Kent Overstreet commit 1bb3c2a9747c404d23012088fbefb4499b884415 Author: Kent Overstreet Date: Tue Jun 20 13:49:25 2023 -0400 bcachefs: New error message helpers Add two new helpers for printing error messages with __func__ and bch2_err_str(): - bch_err_fn - bch_err_msg Also kill the old error strings in the recovery path, which were causing us to incorrectly report memory allocation failures - they're not needed anymore. Signed-off-by: Kent Overstreet commit a83e108fc1964b8273c6f51cc62588ee774a5a48 Author: Kent Overstreet Date: Mon Jun 19 21:12:05 2023 -0400 bcachefs: fiemap: Fix a lockdep splat As with the previous patch, we generally can't hold btree locks while copying to userspace, as that may incur a page fault and require mmap_lock. Signed-off-by: Kent Overstreet commit a5b696ee6e10103def82ea9abc18958912e81b00 Author: Kent Overstreet Date: Mon Jun 19 21:01:13 2023 -0400 bcachefs: seqmutex; fix a lockdep splat We can't be holding btree_trans_lock while copying to user space, which might incur a page fault. To fix this, convert it to a seqmutex so we can unlock/relock. Signed-off-by: Kent Overstreet commit 6547ebabdaac4407ccc978f63f4dc4d9f8936783 Author: Kent Overstreet Date: Mon Jun 19 00:07:40 2023 -0400 bcachefs: Don't call lock_graph_descend() with wait lock held This fixes a deadlock: 01305 WARNING: possible circular locking dependency detected 01305 6.3.0-ktest-gf4de9bee61af #5305 Tainted: G W 01305 ------------------------------------------------------ 01305 cat/14658 is trying to acquire lock: 01305 ffffffc00982f460 (fs_reclaim){+.+.}-{0:0}, at: __kmem_cache_alloc_node+0x48/0x278 01305 01305 but task is already holding lock: 01305 ffffff8011aaf040 (&lock->wait_lock){+.+.}-{2:2}, at: bch2_check_for_deadlock+0x4b8/0xa58 01305 01305 which lock already depends on the new lock. 01305 01305 01305 the existing dependency chain (in reverse order) is: 01305 01305 -> #2 (&lock->wait_lock){+.+.}-{2:2}: 01305 _raw_spin_lock+0x54/0x70 01305 __six_lock_wakeup+0x40/0x1b0 01305 six_unlock_ip+0xe8/0x248 01305 bch2_btree_key_cache_scan+0x720/0x940 01305 shrink_slab.constprop.0+0x284/0x770 01305 shrink_node+0x390/0x828 01305 balance_pgdat+0x390/0x6d0 01305 kswapd+0x2e4/0x718 01305 kthread+0x184/0x1a8 01305 ret_from_fork+0x10/0x20 01305 01305 -> #1 (&c->lock#2){+.+.}-{3:3}: 01305 __mutex_lock+0x104/0x14a0 01305 mutex_lock_nested+0x30/0x40 01305 bch2_btree_key_cache_scan+0x5c/0x940 01305 shrink_slab.constprop.0+0x284/0x770 01305 shrink_node+0x390/0x828 01305 balance_pgdat+0x390/0x6d0 01305 kswapd+0x2e4/0x718 01305 kthread+0x184/0x1a8 01305 ret_from_fork+0x10/0x20 01305 01305 -> #0 (fs_reclaim){+.+.}-{0:0}: 01305 __lock_acquire+0x19d0/0x2930 01305 lock_acquire+0x1dc/0x458 01305 fs_reclaim_acquire+0x9c/0xe0 01305 __kmem_cache_alloc_node+0x48/0x278 01305 __kmalloc_node_track_caller+0x5c/0x278 01305 krealloc+0x94/0x180 01305 bch2_printbuf_make_room.part.0+0xac/0x118 01305 bch2_prt_printf+0x150/0x1e8 01305 bch2_btree_bkey_cached_common_to_text+0x170/0x298 01305 bch2_btree_trans_to_text+0x244/0x348 01305 print_cycle+0x7c/0xb0 01305 break_cycle+0x254/0x528 01305 bch2_check_for_deadlock+0x59c/0xa58 01305 bch2_btree_deadlock_read+0x174/0x200 01305 full_proxy_read+0x94/0xf0 01305 vfs_read+0x15c/0x3a8 01305 ksys_read+0xb8/0x148 01305 __arm64_sys_read+0x48/0x60 01305 invoke_syscall.constprop.0+0x64/0x138 01305 do_el0_svc+0x84/0x138 01305 el0_svc+0x34/0x80 01305 el0t_64_sync_handler+0xb0/0xb8 01305 el0t_64_sync+0x14c/0x150 01305 01305 other info that might help us debug this: 01305 01305 Chain exists of: 01305 fs_reclaim --> &c->lock#2 --> &lock->wait_lock 01305 01305 Possible unsafe locking scenario: 01305 01305 CPU0 CPU1 01305 ---- ---- 01305 lock(&lock->wait_lock); 01305 lock(&c->lock#2); 01305 lock(&lock->wait_lock); 01305 lock(fs_reclaim); 01305 01305 *** DEADLOCK *** Signed-off-by: Kent Overstreet commit e96f5a61cb8008a1acae9a14cc9d382554da60b4 Author: Kent Overstreet Date: Sun Jun 18 13:25:35 2023 -0400 bcachefs: Fix bch2_check_discard_freespace_key() We weren't correctly checking the freespace btree - it's an extents btree, which means we need to iterate over each bucket in a freespace extent. Signed-off-by: Kent Overstreet commit 25aa8c2167306a3919fb6503494cd6078e33a71e Author: Kent Overstreet Date: Sun Jun 18 13:25:09 2023 -0400 bcachefs: bch2_trans_unlock_noassert() This fixes a spurious assert in the btree node read path. Signed-off-by: Kent Overstreet commit 45a1ab57ddb53a8b392baab2142c909154a8d37c Author: Kent Overstreet Date: Fri Jun 16 23:30:02 2023 -0400 bcachefs: Fix bch2_btree_update_start() The calculation for number of nodes to allocate in bch2_btree_update_start() was incorrect - this fixes a BUG_ON() on the small nodes test. Signed-off-by: Kent Overstreet commit 91ecd41b7f02b95279dddcb2193af454efd39497 Author: Kent Overstreet Date: Tue Jun 13 15:12:04 2023 -0400 bcachefs: bch2_extent_ptr_desired_durability() This adds a new helper for getting a pointer's durability irrespective of the device state, and uses it in the the data update path. This fixes a bug where we do a data update but request 0 replicas to be allocated, because the replica being rewritten is on a device marked as failed. Signed-off-by: Kent Overstreet commit 253748a26a14ae22123f3ab670ae04eb15fccc2e Author: Kent Overstreet Date: Tue Jun 13 15:05:40 2023 -0400 bcachefs: snapshot_to_text() includes snapshot tree Signed-off-by: Kent Overstreet commit 995f9128e03f769e4cdbcf6dbea8f0db5ce75c69 Author: Kent Overstreet Date: Thu Mar 16 18:05:00 2023 -0400 bcachefs: Fix try_decrease_writepoints() - We may need to drop btree locks before taking the writepoint_lock, as is done in other places. - We should be using open_bucket_free_unused(), so that we don't waste space. Signed-off-by: Kent Overstreet commit 25c70097a65a22a5799442c8935fa927d91bddaf Author: Kent Overstreet Date: Sun Jun 11 18:24:04 2023 -0400 bcachefs: Delete weird hacky transaction restart injection since we currently don't have a good fault injection library, bch2_btree_insert_node() was randomly injecting faults based on local_clock(). At the very least this should have been a debug mode only thing, but this is a brittle method so let's just delete it. Signed-off-by: Kent Overstreet commit 8e5b1115f1dd88125cbb06c344ba1f4214265042 Author: Kent Overstreet Date: Sun Jun 11 19:45:21 2023 -0400 bcachefs: Write buffer flush needs BTREE_INSERT_NOCHECK_RW btree write buffer flush is only invoked from contexts that already hold a write ref, and checking if we're still RW could cause us to fail to completely flush the write buffer when shutting down. Signed-off-by: Kent Overstreet commit 7724664f0ee4520f1c7fd3c0cc26223ba532986f Author: Kent Overstreet Date: Sun Jun 11 19:21:16 2023 -0400 bcachefs: New assertions when marking filesystem clean Signed-off-by: Kent Overstreet commit 99a3d39893615ac107a4f82e86d4c26792131b91 Author: Kent Overstreet Date: Sat Jun 10 01:37:16 2023 -0400 bcachefs: ec: Fix a lost wakeup Signed-off-by: Kent Overstreet commit 954ed17e029fbf810826739aa190cd559b6e4036 Author: Mikulas Patocka Date: Tue May 30 08:15:41 2023 -0400 bcachefs: fix NULL pointer dereference in try_alloc_bucket On Mon, 29 May 2023, Mikulas Patocka wrote: > The oops happens in set_btree_iter_dontneed and it is caused by the fact > that iter->path is NULL. The code in try_alloc_bucket is buggy because it > sets "struct btree_iter iter = { NULL };" and then jumps to the "err" > label that tries to dereference values in "iter". Here I'm sending a patch for it. From: Mikulas Patocka The function try_alloc_bucket sets the variable "iter" to NULL and then (on various error conditions) jumps to the label "err". On the "err" label, it calls "set_btree_iter_dontneed" that tries to dereference "iter->trans" and "iter->path". So, we get an oops on error condition. This patch fixes the crash by testing that iter.trans and iter.path is non-zero before calling set_btree_iter_dontneed. Signed-off-by: Mikulas Patocka Signed-off-by: Kent Overstreet commit b0e8c75e40a863dd40ecdf8fd6f8cdceacb965e5 Author: Kent Overstreet Date: Fri Jun 9 15:41:41 2023 -0400 bcachefs: Fix subvol deletion deadlock d_prune_aliases() may call bch2_evict_inode(), which needs c->vfs_inodes_list_lock. Fix this by always calling igrab() before putting the inodes onto our disposal list, and then calling d_prune_aliases() with c->vfs_inodes_lock dropped. Signed-off-by: Kent Overstreet commit 5bc740820e7ae01b26a4dbb612df086f41f79785 Author: Brian Foster Date: Tue May 30 14:51:12 2023 -0400 bcachefs: don't spin in rebalance when background target is not usable If a bcachefs filesystem is configured with a background device (disk group), rebalance will relocate data to this device in the background by checking extent keys for whether they currently reside in the specified target. For keys that do not, rebalance performs a read/write cycle to allow the write path to properly relocate data. If the background target is not usable (read-only, for example), however, the write path doesn't actually move data to another device. Instead, rebalance spins indefinitely reading and rewriting the same data over and over to the same device. If the background target is made available again, the rebalance picks this up, relocates the data, and eventually terminates. To avoid this spinning behavior, update the rebalance background target logic to not only check whether the extent is not in the target, but whether the target is actually usable as well. If not, then don't mark the key for rewrite. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit a1dd428b8bb78a03f210e18b05b0d73cac86fb7d Author: Brian Foster Date: Tue May 30 14:48:58 2023 -0400 bcachefs: push rcu lock down into bch2_target_to_mask() We have one caller that cycles the rcu lock solely for this call (via target_rw_devs()), and we'd like to add another. Simplify things by pushing the rcu lock down into bch2_target_to_mask(), similar to how bch2_dev_in_target() works. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit fec4fc82b531beb2cc67b734140ffe776af33f7c Author: Brian Foster Date: Tue May 30 14:41:50 2023 -0400 bcachefs: create internal disk_groups sysfs file We have bch2_sb_disk_groups_to_text() to dump disk group labels, but no good information on device group membership at runtime. Add bch2_disk_groups_to_text() and an associated 'disk_groups' sysfs file to print group and device relationships. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 28551613b725c28552210121499f4e2f6c6a9054 Author: Kent Overstreet Date: Mon Jun 5 01:16:00 2023 -0400 bcachefs: Clean up tests code - delete redundant error messages - convert various code to bch2_trans_run Signed-off-by: Kent Overstreet commit bc166d711d4eeff64c101fd4c57bfaaa3a4e7e9e Author: Kent Overstreet Date: Mon Jun 5 01:15:33 2023 -0400 bcachefs: Improve backpointers error message the error message here dated from when backpointers could be stored in alloc keys; now, we should always print the full key. Signed-off-by: Kent Overstreet commit 49c7cd9d8d5545cf45ef91f548d25b6dd23c72c7 Author: Kent Overstreet Date: Tue May 30 04:59:30 2023 -0400 bcachefs: More drop_locks_do() conversions Using drop_locks_do() ensures that every unlock() is paired with a relock(), with proper error checking. Signed-off-by: Kent Overstreet commit bb125baf512bffef19c510f1c53353a378537070 Author: Kent Overstreet Date: Sun Jun 4 19:40:35 2023 -0400 bcachefs: Delete warning from promote_alloc() It's possible to see a -BCH_ERR_ENOSPC_disk_reservation here, and that's fine. Signed-off-by: Kent Overstreet commit 4f2c166ebe5baef20e28866b27dd97b0caa585f1 Author: Kent Overstreet Date: Sun Jun 4 18:08:56 2023 -0400 bcachefs: Fix bch2_fsck_ask_yn() - getline() output includes a newline, without stripping that we were just looping - Make the prompt clearer Signed-off-by: Kent Overstreet commit 21da6101bd947a08104dbf7d7cb22b40be7730e8 Author: Kent Overstreet Date: Sun May 28 19:23:35 2023 -0400 bcachefs: replicas_deltas_realloc() uses allocate_dropping_locks() Signed-off-by: Kent Overstreet commit 5ff10c0a04c4217b24997d9b127c50602d717ab3 Author: Kent Overstreet Date: Sun May 28 03:44:38 2023 -0400 bcachefs: Convert acl.c to allocate_dropping_locks() More work to avoid allocating memory with btree locks held. Signed-off-by: Kent Overstreet commit d95dd378c207ddec7551cce2e047e6067c3c27ab Author: Kent Overstreet Date: Sun May 28 03:44:38 2023 -0400 bcachefs: allocate_dropping_locks() Add two new helpers for allocating memory with btree locks held: The idea is to first try the allocation with GFP_NOWAIT|__GFP_NOWARN, then if that fails - unlock, retry with GFP_KERNEL, and then call trans_relock(). Signed-off-by: Kent Overstreet commit 3ebfc8fe95c5ec560d2d5c7e7bef62ebaa33a9c4 Author: Kent Overstreet Date: Mon May 29 16:27:11 2023 -0400 bcachefs: Use unlikely() in bch2_err_matches() Signed-off-by: Kent Overstreet commit 4c4a8f20d1767b2ed927d25ccc363de72d48d28f Author: Kent Overstreet Date: Mon May 29 02:26:04 2023 -0400 bcachefs: Fix error handling in promote path The promote path had a BUG_ON() for unknown error type, which we're now seeing: change it to a WARN_ON() - because we're curious what this is - and otherwise handle it in the normal error path. Signed-off-by: Kent Overstreet commit 5718fda0b5ef777ef56edbe53ef6a830b845c0fa Author: Kent Overstreet Date: Sun May 28 00:59:26 2023 -0400 bcachefs: fs-io: Eliminate GFP_NOFS usage GFP_NOFS doesn't ever make sense. If we're allocatingc memory it should be GFP_NOWAIT if btree locks are held, GFP_KERNEL otherwise. Signed-off-by: Kent Overstreet commit 78367aaa5af322b64d44a3a3354f4c75c499fef0 Author: Kent Overstreet Date: Sun May 28 01:09:50 2023 -0400 bcachefs: bch2_trans_kmalloc no longer allocates memory with btree locks held When allocating memory, gfp flags should generally be - GFP_NOWAIT|__GFP_NOWARN if btree locks are held - GFP_NOFS if in the IO path or otherwise holding resources needed for IO submission - GFP_KERNEL otherwise Signed-off-by: Kent Overstreet commit b5fd75669ab1283e7a9caf6288c425108bd382b0 Author: Kent Overstreet Date: Sun May 28 18:06:27 2023 -0400 bcachefs: drop_locks_do() Add a new helper for the common pattern of: - trans_unlock() - do something - trans_relock() Signed-off-by: Kent Overstreet commit 19c304bebda4d8815a20c8d3330459a112c329f6 Author: Kent Overstreet Date: Sun May 28 18:02:38 2023 -0400 bcachefs: GFP_NOIO -> GFP_NOFS GFP_NOIO dates from the bcache days, when we operated under the block layer. Now, GFP_NOFS is more appropriate, so switch all GFP_NOIO uses to GFP_NOFS. Signed-off-by: Kent Overstreet commit e1d29c5fa1205c75dd96303f76d7aa4991555aaa Author: Kent Overstreet Date: Sun May 28 02:35:34 2023 -0400 bcachefs: Ensure bch2_btree_node_get() calls relock() after unlock() Fix a bug where bch2_btree_node_get() might call bch2_trans_unlock() (in fill) without calling bch2_trans_relock(); this is a bug when it's done in the core btree code. Also, twea bch2_btree_node_mem_alloc() to drop btree locks before doing a blocking memory allocation. Signed-off-by: Kent Overstreet commit 70d41c9e276c5e7b130d328a6ece92c9130a6572 Author: Kent Overstreet Date: Sun May 28 00:35:35 2023 -0400 bcachefs: Avoid __GFP_NOFAIL We've been using __GFP_NOFAIL for allocating struct bch_folio, our private per-folio state. However, that struct is variable size - it holds state for each sector in the folio, and folios can be quite large now, which means it's possible for bch_folio to be larger than PAGE_SIZE now. __GFP_NOFAIL allocations are undesirable in normal circumstances, but particularly so at >= PAGE_SIZE, and warnings are emitted for that. So, this patch adds proper error paths and eliminates most uses of __GFP_NOFAIL. Also, do some more cleanup of gfp flags w.r.t. btree node locks: we can use GFP_KERNEL, but only if we're not holding btree locks, and if we are holding btree locks we should be using GFP_NOWAIT. Signed-off-by: Kent Overstreet commit ad520141b155786800261cc7e02ec02f0afe2643 Author: Kent Overstreet Date: Sat May 27 23:19:13 2023 -0400 bcachefs: Fix corruption with writeable snapshots When partially overwriting an extent in an older snapshot, the existing extent has to be split. If the existing extent was overwritten in a different (sibling) snapshot, we have to ensure that the split won't be visible in the sibling snapshot. data_update.c already has code for this, bch2_insert_snapshot_writeouts() - we just need to move it into btree_update_leaf.c and change bch2_trans_update_extent() to use it as well. Signed-off-by: Kent Overstreet commit e47a390aa5946e3c5bea7a4a350a88d3bb3ba5b4 Author: Kent Overstreet Date: Sat May 27 19:59:59 2023 -0400 bcachefs: Convert -ENOENT to private error codes As with previous conversions, replace -ENOENT uses with more informative private error codes. Signed-off-by: Kent Overstreet commit f154c3eb429a340d66a06e8f8d2221d28d25ab45 Author: Kent Overstreet Date: Sat May 27 19:55:54 2023 -0400 bcachefs: trans_for_each_path_safe() bch2_btree_trans_to_text() is used on btree_trans objects that are owned by different threads - when printing out deadlock cycles - so we need a safe version of trans_for_each_path(), else we race with seeing a btree_path that was just allocated and not fully initialized: Signed-off-by: Kent Overstreet commit e7ffda565a762a6bdf782b4978af5ccfe4ab5d0d Author: Kent Overstreet Date: Sat May 27 20:00:13 2023 -0400 bcachefs: Fix a quota read bug bch2_fs_quota_read() could see an inode that's been deleted (KEY_TYPE_inode_generation) - bch2_fs_quota_read_inode() needs to check for that instead of erroring. Signed-off-by: Kent Overstreet commit c26463ce9940d150dfeaac0a1a0747db9b1ca600 Author: Kent Overstreet Date: Fri May 26 18:12:55 2023 -0400 bcachefs: Fix move_extent_fail counter fail counters need to be events, not numbers of sectors - or the calculations the tests use for determining if we've had too many slowpath events don't work. Signed-off-by: Kent Overstreet commit fc0ee376bb5b08844198fba13fb809102afd0b29 Author: Kent Overstreet Date: Thu May 25 23:37:06 2023 -0400 bcachefs: Don't reuse reflink btree keyspace We've been seeing difficult to debug "missing indirect extent" bugs, that fsck doesn't seem to find. One possibility is that there was a missing indirect extent, but then a new indirect extent was created at the location of the previous indirect extent. This patch eliminates that possibility by always creating new indirect extents right after the last one, at the end of the reflink btree. Signed-off-by: Kent Overstreet commit db32bb9a5fd6bd7c7031b4b9d6c9a5e27b651e5d Author: Kent Overstreet Date: Sun Jun 4 17:58:56 2023 -0400 mean and variance: Add a missing include abs() is in math.h Signed-off-by: Kent Overstreet commit 65bc41090720cdc249c1b0b9b9b8a8f062b41268 Author: Kent Overstreet Date: Thu May 25 22:22:25 2023 -0400 mean and variance: More tests Add some more tests that test conventional and weighted mean simultaneously, and with a table of values that represents events that we'll be using this to look for so we can verify-by-eyeball that the output looks sane. Signed-off-by: Kent Overstreet commit aab5e0972a32790c0dbfac64929529820114c674 Author: Kent Overstreet Date: Sat Jun 10 10:57:23 2023 -0400 six locks: Disable percpu read lock mode in userspace When running in userspace, we currently don't have a real percpu implementation available - at least in bcachefs-tools, which is where this code is currently used in userspace. Signed-off-by: Kent Overstreet commit 2d9200cfe004b8208a04ea15b3967f9a14135be6 Author: Kent Overstreet Date: Thu May 25 14:35:06 2023 -0400 six locks: Use atomic_try_cmpxchg_acquire() This switches to a newer cmpxchg variant which updates @old for us on failure, simplifying the cmpxchg loops a bit and supposedly generating better code. Signed-off-by: Kent Overstreet commit c4687a4a7536c3b2139faa63e66afd1d3da5bf15 Author: Kent Overstreet Date: Thu May 25 18:10:04 2023 -0400 six locks: Fix an unitialized var In the conversion to atomic_t, six_lock_slowpath() ended up calling six_lock_wakeup() in the failure path with a state variable that was never initialized - whoops. Signed-off-by: Kent Overstreet commit 96e53e909d0433f73831315b106f16895a74b843 Author: Kent Overstreet Date: Tue May 23 00:21:22 2023 -0400 six locks: Delete redundant comment Signed-off-by: Kent Overstreet commit 2ab62310fd1c723bd8ab8e8242e31fa494c9681f Author: Kent Overstreet Date: Mon May 22 12:11:13 2023 -0400 six locks: Tiny bit more tidying Signed-off-by: Kent Overstreet commit 32913f49f54f0cf9ccf581e3abd2d1fc6ba4debf Author: Kent Overstreet Date: Fri Jun 16 15:56:42 2023 -0400 six locks: Seq now only incremented on unlock Signed-off-by: Kent Overstreet commit 2804d0f15bda386fa86c7b6b432edb758e785bce Author: Kent Overstreet Date: Mon May 22 00:17:40 2023 -0400 six locks: Split out seq, use atomic_t instead of atomic64_t Signed-off-by: Kent Overstreet commit a4e9e1f0cb71dfceaca0d2088465af05a747c710 Author: Kent Overstreet Date: Fri Jun 16 19:21:21 2023 -0400 six locks: Single instance of six_lock_vals Since we're not generating different versions of the lock functions for each lock type, the constant propagation we were trying to do before is no longer useful - this is now a small code size decrease. Signed-off-by: Kent Overstreet commit 357c1261526db604dd4593638620a801c44d02bd Author: Kent Overstreet Date: Mon May 22 17:54:19 2023 -0400 six_locks: Kill test_bit()/set_bit() usage This deletes the crazy cast-atomic-to-unsigned-long, and replaces them with atomic_and() and atomic_or(). Signed-off-by: Kent Overstreet commit b60c8e9e7b082abac290ebdb9166b806e7d83fb7 Author: Kent Overstreet Date: Fri Jun 16 18:24:05 2023 -0400 six locks: lock->state.seq no longer used for write lock held lock->state.seq is shortly being moved out of lock->state, to kill the depedency on atomic64; in preparation for that, we change the write locking bit to write locked. Signed-off-by: Kent Overstreet commit dc88b65f3e54b5f25dcfe1259ae21c19a6e69d7f Author: Kent Overstreet Date: Fri Jun 16 15:00:48 2023 -0400 six locks: Simplify six_relock() The next patch is going to move lock->seq out of lock->state. This replaces six_relock() with a much simpler implementation based on trylock. Signed-off-by: Kent Overstreet commit 37f612bea5bd921e71537df3559a117dffb0956d Author: Kent Overstreet Date: Sun May 21 23:41:56 2023 -0400 six locks: Improve spurious wakeup handling in pcpu reader mode Signed-off-by: Kent Overstreet commit 91d16f16d0fd4b6eb8503068ea7f6ad8305e32db Author: Kent Overstreet Date: Sun May 21 15:40:40 2023 -0400 six locks: Documentation, renaming - Expanded and revamped overview documentation in six.h, giving an overview of all features - docbook-comments for all external interfaces - Rename some functions for simplicity, i.e. six_lock_ip_type() -> six_lock_ip() Signed-off-by: Kent Overstreet commit 1fb4fe63178881a0ac043a5c05288d9fff85d6b8 Author: Kent Overstreet Date: Sat May 20 23:57:48 2023 -0400 six locks: Kill six_lock_state union As suggested by Linus, this drops the six_lock_state union in favor of raw bitmasks. On the one hand, bitfields give more type-level structure to the code. However, a significant amount of the code was working with six_lock_state as a u64/atomic64_t, and the conversions from the bitfields to the u64 were deemed a bit too out-there. More significantly, because bitfield order is poorly defined (#ifdef __LITTLE_ENDIAN_BITFIELD can be used, but is gross), incrementing the sequence number would overflow into the rest of the bitfield if the compiler didn't put the sequence number at the high end of the word. The new code is a bit saner when we're on an architecture without real atomic64_t support - all accesses to lock->state now go through atomic64_*() operations. On architectures with real atomic64_t support, we additionally use atomic bit ops for setting/clearing individual bits. Text size: 7467 bytes -> 4649 bytes - compilers still suck at bitfields. Signed-off-by: Kent Overstreet commit c4bd3491b1c0b335f63599ec96d1d4ab0d37a3c1 Author: Kent Overstreet Date: Sat May 20 21:44:30 2023 -0400 six locks: Simplify dispatch Originally, we used inlining/flattening to cause the compiler to generate different versions of lock/trylock/relock/unlock for each lock type - read, intent, and write. This made the individual functions smaller and let the compiler eliminate table lookups: however, as the code has gotten more complicated these optimizations have gotten less worthwhile, and all the tricky inlining and dispatching made the code less readable. Text size: 11015 bytes -> 7467 bytes, and benchmarks show no loss of performance. Signed-off-by: Kent Overstreet commit d2c86b77de5894bbe26ecbf5214227f61855aed7 Author: Kent Overstreet Date: Sat May 20 20:37:53 2023 -0400 six locks: Centralize setting of waiting bit Originally, the waiting bit was always set by trylock() on failure: however, it's now set by __six_lock_type_slowpath(), with wait_lock held - which is the more correct place to do it. That made setting the waiting bit in trylock redundant, so this patch deletes that. Signed-off-by: Kent Overstreet commit 0157f9c5a7c77b1cb89756351929dba4b28d5f75 Author: Kent Overstreet Date: Sun May 21 16:38:09 2023 -0400 six locks: Remove hacks for percpu mode lost wakeup The lost wakeup bug hasn't been observed in awhile, and we're trying to provoke it and determine if it still exists. This patch removes some defenses that were added to attempt to track it down; if it still exists, this should make it easier to see it. Signed-off-by: Kent Overstreet commit 0d2234a79e877b1bfa71b2c8c712a155be419827 Author: Kent Overstreet Date: Sat May 20 20:57:55 2023 -0400 six locks: Kill six_lock_pcpu_(alloc|free) six_lock_pcpu_alloc() is an unsafe interface: it's not safe to allocate or free the percpu reader count on an existing lock that's in use, the only safe time to allocate percpu readers is when the lock is first being initialized. This patch adds a flags parameter to six_lock_init(), and instead of six_lock_pcpu_free() we now expose six_lock_exit(), which does the same thing but is less likely to be misused. Signed-off-by: Kent Overstreet commit 01bf56a9771466147d94a013bc5678d0ed1b1382 Author: Kent Overstreet Date: Sat May 20 20:40:08 2023 -0400 six locks: six_lock_readers_add() This moves a helper out of the bcachefs code that shouldn't have been there, since it touches six lock internals. Signed-off-by: Kent Overstreet commit f375d6ca58d5f28b9c0a3af449a0dd640ddcc6a1 Author: Kent Overstreet Date: Fri Jun 16 18:55:07 2023 -0400 bcachefs: Don't call local_clock() twice in trans_begin() local_clock() is not as cheap as we'd like it to be, alas Signed-off-by: Kent Overstreet commit 962210b281b327b236215c736b9f648369f0d39d Author: Kent Overstreet Date: Mon May 22 14:39:44 2023 -0400 bcachefs: Fix a buffer overrun in bch2_fs_usage_read() We were copying the size of a struct bch_fs_usage_online to a struct bch_fs_usage, which is 8 bytes smaller. This adds some new helpers so we can do this correctly, and get rid of some magic +1s too. Signed-off-by: Kent Overstreet commit 0b438c5bfaebda3fdf6edc35d9572d4e2f66aef1 Author: Kent Overstreet Date: Mon May 22 00:49:06 2023 -0400 bcachefs: Clear btree_node_just_written() when node reused or evicted This fixes the following bug: Journal reclaim attempts to flush a node, but races with the node being evicted from the btree node cache; when we lock the node, the data buffers have already been freed. We don't evict a node that's dirty, so calling btree_node_write() is fine - it's a noop - except that the btree_node_just_written bit causes bch2_btree_post_write_cleanup() to run (resorting the node), which then causes a null ptr deref. 00078 Unable to handle kernel NULL pointer dereference at virtual address 000000000000009e 00078 Mem abort info: 00078 ESR = 0x0000000096000005 00078 EC = 0x25: DABT (current EL), IL = 32 bits 00078 SET = 0, FnV = 0 00078 EA = 0, S1PTW = 0 00078 FSC = 0x05: level 1 translation fault 00078 Data abort info: 00078 ISV = 0, ISS = 0x00000005 00078 CM = 0, WnR = 0 00078 user pgtable: 4k pages, 39-bit VAs, pgdp=000000007ed64000 00078 [000000000000009e] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000 00078 Internal error: Oops: 0000000096000005 [#1] SMP 00078 Modules linked in: 00078 CPU: 75 PID: 1170 Comm: stress-ng-utime Not tainted 6.3.0-ktest-g5ef5b466e77e #2078 00078 Hardware name: linux,dummy-virt (DT) 00078 pstate: 80001005 (Nzcv daif -PAN -UAO -TCO -DIT +SSBS BTYPE=--) 00078 pc : btree_node_sort+0xc4/0x568 00078 lr : bch2_btree_post_write_cleanup+0x6c/0x1c0 00078 sp : ffffff803e30b350 00078 x29: ffffff803e30b350 x28: 0000000000000001 x27: ffffff80076e52a8 00078 x26: 0000000000000002 x25: 0000000000000000 x24: ffffffc00912e000 00078 x23: ffffff80076e52a8 x22: 0000000000000000 x21: ffffff80076e52bc 00078 x20: ffffff80076e5200 x19: 0000000000000000 x18: 0000000000000000 00078 x17: fffffffff8000000 x16: 0000000008000000 x15: 0000000008000000 00078 x14: 0000000000000002 x13: 0000000000000000 x12: 00000000000000a0 00078 x11: ffffff803e30b400 x10: ffffff803e30b408 x9 : 0000000000000001 00078 x8 : 0000000000000000 x7 : ffffff803e480000 x6 : 00000000000000a0 00078 x5 : 0000000000000088 x4 : 0000000000000000 x3 : 0000000000000010 00078 x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffffff80076e52a8 00078 Call trace: 00078 btree_node_sort+0xc4/0x568 00078 bch2_btree_post_write_cleanup+0x6c/0x1c0 00078 bch2_btree_node_write+0x108/0x148 00078 __btree_node_flush+0x104/0x160 00078 bch2_btree_node_flush0+0x1c/0x30 00078 journal_flush_pins.constprop.0+0x184/0x2d0 00078 __bch2_journal_reclaim+0x4d4/0x508 00078 bch2_journal_reclaim+0x1c/0x30 00078 __bch2_journal_preres_get+0x244/0x268 00078 bch2_trans_journal_preres_get_cold+0xa4/0x180 00078 __bch2_trans_commit+0x61c/0x1bb0 00078 bch2_setattr_nonsize+0x254/0x318 00078 bch2_setattr+0x5c/0x78 00078 notify_change+0x2bc/0x408 00078 vfs_utimes+0x11c/0x218 00078 do_utimes+0x84/0x140 00078 __arm64_sys_utimensat+0x68/0xa8 00078 invoke_syscall.constprop.0+0x54/0xf0 00078 do_el0_svc+0x48/0xd8 00078 el0_svc+0x14/0x48 00078 el0t_64_sync_handler+0xb0/0xb8 00078 el0t_64_sync+0x14c/0x150 00078 Code: 8b050265 910020c6 8b060266 910060ac (79402cad) 00078 ---[ end trace 0000000000000000 ]--- Signed-off-by: Kent Overstreet commit faa62a2036a491a919deffd980abc867be51b6f1 Author: Kent Overstreet Date: Sat May 20 02:20:28 2023 -0400 bcachefs: alloc_v4_u64s() fix With the recent bkey_ops.min_val_size addition, bkey values are automatically extended to the size of the current version. The check in bch2_alloc_v4_invalid() needs to be updated to take this into account. Signed-off-by: Kent Overstreet commit a49bd8c007e4f4840f8c4d7fe7d62c7bdc7fffca Author: Kent Overstreet Date: Sun May 14 23:01:14 2023 -0400 bcachefs: Delete an incorrect bch2_trans_unlock() These deletes a bch2_trans_unlock() call from __bch2_move_data(). It was redundant; bch2_move_extent() has the correct unlock call, and it was buggy because when move_extent calls bch2_extent_drop_ptrs() we don't want the transaction to be unlocked yet - this fixes a btree_iter.c assertion. Fixes https://github.com/koverstreet/bcachefs/issues/511. Signed-off-by: Kent Overstreet commit d598a9b7e27158d3b6972077e2f7296f279c2e8b Author: Kent Overstreet Date: Sat May 13 17:21:55 2023 -0400 bcachefs: Use memcpy_u64s_small() for copying keys Small performance optimization; an open coded loop is better than rep ; movsq for small copies. Signed-off-by: Kent Overstreet commit 73da30e8e0f8ffcc91691934f202ab6e2f985604 Author: Kent Overstreet Date: Sat May 13 00:11:14 2023 -0400 bcachefs: Fix check_overlapping_extents() A error check had a flipped conditional - whoops. Signed-off-by: Kent Overstreet commit 4a2e5d7ba5b8208ea5a20eeb274b2b0333ab5dcf Author: Kent Overstreet Date: Fri May 12 20:28:54 2023 -0400 bcachefs: Replace a BUG_ON() with fatal error A user hit this BUG_ON() - it's unclear how it happened, so replace it with a fatal error that will cause us to go read only, and print out more information. Signed-off-by: Kent Overstreet commit 92e637cef4fc9380363b425de740827d7c492219 Author: Kent Overstreet Date: Mon May 8 14:23:08 2023 -0400 bcachefs: Delete some dead code in bch2_replicas_gc_end() bch2_replicas_gc_(start|end) is now only used for journal replicas entries, which don't have bucket sector counts - so this code is entirely dead and can be deleted. Signed-off-by: Kent Overstreet commit a7b29b8d9a17297499a409274e75d674e7930ff9 Author: Brian Foster Date: Thu May 4 12:44:15 2023 -0400 bcachefs: mark journal replicas before journal write submission The journal write submission path marks the associated replica entries for journal data in journal_write_done(), which is just after journal write bio submission. This creates a small window where journal entries might have been written out, but the associated replica is not marked such that recovery does not know that the associated device contains journal data. Move the replica marking a bit earlier in the write path such that recovery is guaranteed to recognize that the device contains journal data in the event of a crash. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 38e3d93fa1da7e3f0bc61b240a65cee7fb024400 Author: Kent Overstreet Date: Tue May 2 18:22:12 2023 -0400 bcachefs: Improved comment for bch2_replicas_gc2() Signed-off-by: Kent Overstreet commit cb1b479dc1c78d1d224e4aa6aba212a7bd3263a4 Author: Kent Overstreet Date: Fri Apr 28 03:50:57 2023 -0400 bcachefs: Fix quotas + snapshots Now that we can reliably designate and find the master subvolume out of a tree of snapshots, we can finally make quotas work with snapshots: That is - quotas will now _ignore_ snapshot subvolumes, and only be in effect for the master (non snapshot) subvolume. Signed-off-by: Kent Overstreet commit 653693beea8ac93e57fc17afc7353bd158bcd5ff Author: Kent Overstreet Date: Wed Mar 29 11:18:59 2023 -0400 bcachefs: Add otime, parent to bch_subvolume Add two new fields to bch_subvolume: - otime: creation time - parent: For snapshots, this is the id of the subvolume the snapshot was created from Signed-off-by: Kent Overstreet commit 1c59b483a3d249e08f0dcff43d9b78851d216fc1 Author: Kent Overstreet Date: Wed Mar 29 11:18:52 2023 -0400 bcachefs: BTREE_ID_snapshot_tree This adds a new btree which gets us a persistent per-snapshot-tree identifier. - BTREE_ID_snapshot_trees - KEY_TYPE_snapshot_tree - bch_snapshot now has a field that points to a snapshot_tree This is going to be used to designate one snapshot ID/subvolume out of a given tree of snapshots as the "main" subvolume, so that we can do quota accounting in that subvolume and not the rest. Signed-off-by: Kent Overstreet commit 51e84d3bbff55f5ac79fef0d1bbf515d6d397289 Author: Kent Overstreet Date: Thu Apr 27 23:20:18 2023 -0400 bcachefs: bch2_bkey_get_empty_slot() Add a new helper for allocating a new slot in a btree. Signed-off-by: Kent Overstreet commit dbda63bbb0dbce070f22132339a07146bf1af850 Author: Kent Overstreet Date: Sun Apr 30 19:21:06 2023 -0400 bcachefs: bch2_bkey_make_mut() now calls bch2_trans_update() It's safe to call bch2_trans_update with a k/v pair where the value hasn't been filled out, as long as the key part has been and the value is filled out by transaction commit time. This patch folds the bch2_trans_update() call into bch2_bkey_make_mut(), eliminating a bit of boilerplate. Signed-off-by: Kent Overstreet commit f12a798a898dec36de9705d40a1b03e2418aabe0 Author: Kent Overstreet Date: Sun Apr 30 18:46:24 2023 -0400 bcachefs: bch2_bkey_get_mut() now calls bch2_trans_update() It's safe to call bch2_trans_update with a k/v pair where the value hasn't been filled out, as long as the key part has been and the value is filled out by transaction commit time. This patch folds the bch2_trans_update() call into bch2_bkey_get_mut(), eliminating a bit of boilerplate. Signed-off-by: Kent Overstreet commit f8cb35fda161715e384df340f0bae4de37c5576f Author: Kent Overstreet Date: Sun Apr 30 18:59:28 2023 -0400 bcachefs: bch2_bkey_alloc() now calls bch2_trans_update() It's safe to call bch2_trans_update with a k/v pair where the value hasn't been filled out, as long as the key part has been and the value is filled out by transaction commit time. This patch folds the bch2_trans_update() call into bch2_bkey_alloc(), eliminating a bit of boilerplate. Signed-off-by: Kent Overstreet commit 34dfa5db191fe227c0c413624b7387f1f1804029 Author: Kent Overstreet Date: Thu Apr 27 23:48:33 2023 -0400 bcachefs: bch2_bkey_get_mut() improvements - bch2_bkey_get_mut() now handles types increasing in size, allocating a buffer for the type's current size when necessary - bch2_bkey_make_mut_typed() - bch2_bkey_get_mut() now initializes the iterator, like bch2_bkey_get_iter() Also, refactor so that most of the code is in functions - now macros are only used for wrappers. Signed-off-by: Kent Overstreet commit d67a16df9c5e03e3e4a672bd6547812baad0bf2c Author: Kent Overstreet Date: Sun Apr 30 20:58:59 2023 -0400 bcachefs: Move bch2_bkey_make_mut() to btree_update.h It's for doing updates - this is where it belongs, and next pathes will be changing these helpers to use items from btree_update.h. Signed-off-by: Kent Overstreet commit bcb79a51cb52033bb12c5ed2eb46770e984b5542 Author: Kent Overstreet Date: Sat Apr 29 19:33:09 2023 -0400 bcachefs: bch2_bkey_get_iter() helpers Introduce new helpers for a common pattern: bch2_trans_iter_init(); bch2_btree_iter_peek_slot(); - bch2_bkey_get_iter_type() returns -ENOENT if it doesn't find a key of the correct type - bch2_bkey_get_val_typed() copies the val out of the btree to a (typically stack allocated) variable; it handles the case where the value in the btree is smaller than the current version of the type, zeroing out the remainder. Signed-off-by: Kent Overstreet commit 174f930b8e1cad3915819a46bb20da214f68f2b5 Author: Kent Overstreet Date: Sat Apr 29 13:24:18 2023 -0400 bcachefs: bkey_ops.min_val_size This adds a new field to bkey_ops for the minimum size of the value, which standardizes that check and also enforces the new rule (previously done somewhat ad-hoc) that we can extend value types by adding new fields on to the end. To make that work we do _not_ initialize min_val_size with sizeof, instead we initialize it to the size of the first version of those values. Signed-off-by: Kent Overstreet commit ab158fce47220df20f0fe2360767227328f6765b Author: Kent Overstreet Date: Sun Apr 30 13:02:05 2023 -0400 bcachefs: Converting to typed bkeys is now allowed for err, null ptrs Signed-off-by: Kent Overstreet commit 95b595a5fc4832305fe1323d934bdcae5f2b9439 Author: Kent Overstreet Date: Sun Apr 30 18:04:43 2023 -0400 bcachefs: Btree iterator, update flags no longer conflict Change btree_update_flags to start after the last btree iterator flag, so that we can pass both in the same flags argument. This is needed for the upcoming bch2_bkey_get_mut() helper. Signed-off-by: Kent Overstreet commit 0a23574ebb48844a19cf46672b28e7d439e56454 Author: Brian Foster Date: Mon May 1 09:08:26 2023 -0400 bcachefs: remove unused key cache coherency flag Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 3c434cdff0a47df50779bd55a023c363f658c69a Author: Brian Foster Date: Mon May 1 07:09:33 2023 -0400 bcachefs: fix accounting corruption race between reclaim and dev add When a device is removed from a bcachefs volume, the associated content is removed from the various btrees. The alloc tree uses the key cache, so when keys are removed the deletes exist in cache for a period of time until reclaim comes along and flushes outstanding updates. When a device is re-added to the bcachefs volume, the add process re-adds some of these previously deleted keys. When marking device superblock locations on device add, the keys will likely refer to some of the same alloc keys that were just removed. The memory triggers for these key updates are responsible for further updates, such as bch2_mark_alloc() calling into bch2_dev_usage_update() to update per-device usage accounting. When a new key is added to key cache, the trans update path also flushes the key to the backing btree for coherency reasons for tree walks. With all of this context, if a device is removed and re-added quickly enough such that some key deletes from the remove are still pending a key cache flush, the trans update path can view this as addition of a new key because the old key in the insert entry refers to a deleted key. However the deleted cached key has not been filled by absence of a btree key, but rather refers to an explicit deletion of an existing key that occurred during device removal. The trans update path adds a new update to flush the key and tags the original (cached) update to skip running the memory triggers. This results in running triggers on the non-cached update instead, which in turn will perform accounting updates based on incoherent values. For example, bch2_dev_usage_update() subtracts the the old alloc key dirty sector count in the non-cached btree key from the newly initialized (i.e. zeroed) per device counters, leading to underflow and accounting corruption. There are at least a few ways to avoid this problem, the simplest of which may be to run triggers against the cached update rather than the non-cached update. If the key only needs to be flushed when the key is not present in the tree, however, then this still performs an unnecessary update. We could potentially use the cached key dirty state to determine whether the delete is a dirty, cached update vs. a clean cache fill, but this may require transmitting key cache dirty state across layers, which adds complexity and seems to be of limited value. Instead, update flush_new_cached_update() to handle this by simply checking for the key in the btree and only perform the flush when a backing key is not present. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 958c347b4b16dd3883c3765f5f99cacfe1b862b5 Author: Kent Overstreet Date: Sat Apr 29 16:21:51 2023 -0400 bcachefs: Mark bch2_copygc() noinline This works around a "stack from too large" error. Signed-off-by: Kent Overstreet commit 3140a3d0e990f5528707b676787faa7e29545f32 Author: Kent Overstreet Date: Thu Apr 27 14:02:31 2023 -0400 bcachefs: Delete obsolete btree ptr check This patch deletes a .key_invalid check for btree pointers that only applies to _very_ old on disk format versions, and potentially complicates the upgrade process. Signed-off-by: Kent Overstreet commit 6b52bcde4a2f3c073151356bf960596d2da9716e Author: Kent Overstreet Date: Wed Apr 26 17:47:09 2023 -0400 bcachefs: Always run topology error when CONFIG_BCACHEFS_DEBUG=y Improved test coverage. Signed-off-by: Kent Overstreet commit a0668d77f04dd95a394cf421125a2cfd6ab68fad Author: Kent Overstreet Date: Wed Apr 26 17:47:00 2023 -0400 bcachefs: Fix a userspace build error Signed-off-by: Kent Overstreet commit c8d5b71411473187db4fbc6ca419496b716778b8 Author: Kent Overstreet Date: Tue Apr 25 14:32:39 2023 -0400 bcachefs: Make sure hash info gets initialized in fsck We had some bugs with setting/using first_this_inode in the inode walker in the dirents/xattr code. This patch changes to not clear first_this_inode until after initializing the new hash info. Also, we fix an error message to not print on transaction restart, and add a comment to related fsck error code. Signed-off-by: Kent Overstreet commit 1af5227c1d6b3513106f82808fe163bf0bd70df8 Author: Kent Overstreet Date: Fri Apr 21 03:42:41 2023 -0400 bcachefs: Kill bch2_verify_bucket_evacuated() With backpointers, it's now impossible for bch2_evacuate_bucket() to be completely reliable: it can race with an extent being partially overwritten or split, which needs a new write buffer flush for the backpointer to be seen. This shouldn't be a real issue in practice; the previous patch added a new tracepoint so we'll be able to see more easily if it is. Signed-off-by: Kent Overstreet commit 5a21764db13877eb1166baf12d2782ebb38b196e Author: Kent Overstreet Date: Thu Apr 20 15:24:07 2023 -0400 bcachefs: Improve move path tracepoints Move path tracepoints now include the key being moved. Also, add new tracepoints for the start of move_extent, and evacuate_bucket. Signed-off-by: Kent Overstreet commit 09ebfa61130edaa990c0f1865fe2fa536d67c313 Author: Kent Overstreet Date: Fri Apr 21 03:33:45 2023 -0400 bcachefs: Drop a redundant error message When we're already read-only, we don't need to print out errors from writing btree nodes. Signed-off-by: Kent Overstreet commit 02d51bb9a7315eb569a160363058ca2cd140faa1 Author: Brian Foster Date: Wed Apr 19 11:47:03 2023 -0400 bcachefs: remove bucket_gens btree keys on device removal If a device has keys in the bucket_gens btree associated with its buckets and is removed from a bcachefs volume, fsck will complain about the presence of keys associated with an invalid device index. A repair removes the associated keys and restores correctness. Update bch2_dev_remove_alloc() to remove device related keys at device removal time to avoid the problem. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 251babb55d53d79bba9568d6516fd11128c34606 Author: Brian Foster Date: Tue Apr 18 13:05:47 2023 -0400 bcachefs: fix NULL bch_dev deref when checking bucket_gens keys fsck removes bucket_gens keys for devices that do not exist in the volume (i.e., if the device was removed). In 'fsck -n' mode, the associated fsck_err_on() wrapper returns false to skip the key removal. This proceeds on to the rest of the function, which eventually segfaults on a NULL bch_dev because the device does not exist. Update bch2_check_bucket_gens_key() to skip out of the rest of the function when the associated device does not exist, regardless of running fsck in check or repair mode. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit bf98ee10d45af8e97c0802e39cc77ee607072633 Author: Brian Foster Date: Mon Apr 3 08:17:26 2023 -0400 bcachefs: folio pos to bch_folio_sector index helper Create a small helper to translate from file offset to the associated bch_folio_sector index in the underlying bch_folio. The helper assumes the file offset is covered by the passed folio. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit e3dc75eb551599c356a9a3f8c00ae6396164457d Author: Kent Overstreet Date: Sun Apr 16 21:49:12 2023 -0400 bcachefs: Fix a null ptr deref in fsck check_extents() It turns out, in rare situations we need to be passing in a disk reservation, which will be used internally by the transaction commit path when needed. Pass one in... Signed-off-by: Kent Overstreet commit 615fccada50247abbc61c6c0a0d9c717b3fb6290 Author: Kent Overstreet Date: Sun Apr 16 07:10:46 2023 -0400 bcachefs: Fix a slab-out-of-bounds In __bch2_alloc_to_v4_mut(), we overrun the buffer we allocate if the alloc key had backpointers stored in it (which we no longer support). Fix this with a max() call. Signed-off-by: Kent Overstreet commit 853b7393c20d5e129f2b16719102a05bbb5dc36f Author: Kent Overstreet Date: Sat Apr 15 14:26:14 2023 -0400 bcachefs: Allow answering y or n to all fsck errors of given type This changes the ask_yn() function used by fsck to accept Y or N, meaning yes or no for all errors of a given type. With this, the user can be prompted only for distinct error types - useful when a filesystem has lots of errors. Signed-off-by: Kent Overstreet commit 6b9857b208d7566d8bfd332a543b1dca92202c2b Author: Brian Foster Date: Wed Mar 29 10:43:23 2023 -0400 bcachefs: use u64 for folio end pos to avoid overflows Some of the folio_end_*() helpers are prone to overflow of signed 64-bit types because the mapping is only limited by the max value of loff_t and the associated helpers return the start offset of the next folio. Therefore, a folio_end_pos() of the max allowable folio in a mapping returns a value that overflows loff_t. This makes it hard to rely on such values when doing folio processing across a range of a file, as bcachefs attempts to do with the recent folio changes. For example, generic/564 causes problems in the buffered write path when testing writes at max boundary conditions. The current understanding is that the pagecache historically limited the mapping to one less page to avoid this problem and this was dropped with some of the folio conversions, but may be reinstated to properly address the problem. In the meantime, update the internal folio_end_*() helpers in bcachefs to return a u64, and all of the associated code to use or cast to u64 to avoid overflow problems. This allows generic/564 to pass and can be reverted back to using loff_t if at any point the pagecache subsystem can guarantee these boundary conditions will not overflow. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 335f7d4f22fd27ea86398a3617ce41ab3d478ae6 Author: Brian Foster Date: Wed Mar 29 11:23:15 2023 -0400 bcachefs: clean up post-eof folios on -ENOSPC The buffered write path batches folio creations in the file mapping based on the requested size of the write. Under low free space conditions, it is possible to add a bunch of folios to the mapping and then return a short write or -ENOSPC due to lack of space. If this occurs on an extending write, the file size is updated based on the amount of data successfully written to the file. If folios were added beyond the final i_size, they may hang around until reclaimed, truncated or encountered unexpectedly by another operation. For example, generic/083 reproduces a sequence of events where a short write leaves around one or more post-EOF folios on an inode, a subsequent zero range request extends beyond i_size and overlaps with an aforementioned folio, and __bch2_truncate_folio() happens across it and complains. Update __bch2_buffered_write() to keep track of the start offset of the last folio added to the mapping for a prospective write. After i_size is updated, check whether this offset starts beyond EOF. If so, truncate pagecache beyond the latest EOF to clean up any folios that don't reside at least partially within EOF upon completion of the write. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 4ad6aa46e1c19c04e5542e8cca859d9aaa9e70b6 Author: Brian Foster Date: Wed Mar 29 09:49:04 2023 -0400 bcachefs: fix truncate overflow if folio is beyond EOF generic/083 occasionally reproduces a panic caused by an overflow when accessing the bch_folio_sector array of the folio being processed by __bch2_truncate_folio(). The immediate cause of the overflow is that the folio offset is beyond i_size, and therefore the sector index calculation underflows on subtraction of the folio offset. One cause of this is mainly observed on nocow mounts. When nocow is enabled, fallocate performs physical block allocation (as opposed to block reservation in cow mode), which range_has_data() then interprets as valid data that requires partial zeroing on truncate. Therefore, if a post-eof zero range request lands across post-eof preallocated blocks, __bch2_truncate_folio() may actually create a post-eof folio in order to perform zeroing. To avoid this problem, update range_has_data() to filter out unwritten blocks from folio creation and partial zeroing. Even though we should never create folios beyond EOF like this, the mere existence of such folios is not necessarily a fatal error. Fix up the truncate code to warn about this condition and not overflow the sector array and possibly crash the system. The addition of this warning without the corresponding unwritten extent fix has shown that various other fstests are able to reproduce this problem fairly frequently, but often in ways that doesn't necessarily result in a kernel panic or a change in user observable behavior, and therefore the problem goes undetected. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 550a6a496d33034878172ed789e03feaee6cee43 Author: Kent Overstreet Date: Sun Mar 19 16:47:30 2023 -0400 bcachefs: Enable large folios Signed-off-by: Kent Overstreet commit 34fdcf0632a5e549c5bfed1847a6d6995606ec17 Author: Kent Overstreet Date: Mon Mar 27 16:55:27 2023 -0400 bcachefs: Check for folios that don't have bch_folio attached With large folios, it's now incidentally possible to end up with a clean, uptodate folio in the page cache that doesn't have a bch_folio attached, if a folio has to be split. This patch fixes __bch2_truncate_folio() to check for this; other code paths appear to handle it. Signed-off-by: Kent Overstreet commit 9567413c82d9dbad24ff6edd0dd160da8b6d9d8f Author: Kent Overstreet Date: Fri Mar 17 19:24:44 2023 -0400 bcachefs: bch2_readahead() large folio conversion Readahead now uses the new filemap_get_contig_folios_d() helper. Signed-off-by: Kent Overstreet commit 40022c0115d29da11da262ced6ca8d1d5426a8b4 Author: Kent Overstreet Date: Thu Mar 23 12:51:47 2023 -0400 bcachefs: filemap_get_contig_folios_d() Add a new helper for getting a range of contiguous folios and returning them in a darray. Signed-off-by: Kent Overstreet commit a1774a05641cebd4c42c4b5e14ca20319b32711d Author: Kent Overstreet Date: Thu Mar 23 11:08:04 2023 -0400 bcachefs: bch_folio_sector_state improvements - X-macro-ize the bch_folio_sector_state enum: this means we can easily generate strings, which is helpful for debugging. - Add helpers for state transitions: folio_sector_dirty(), folio_sector_undirty(), folio_sector_reserve() - Add folio_sector_set(), a single helper for changing folio sector state just so that we have a single place to instrument when we're debugging. Signed-off-by: Kent Overstreet commit 959f7368d60c89513ce44184bdfcb7304fea17ee Author: Kent Overstreet Date: Sun Mar 19 18:03:22 2023 -0400 bcachefs: bch2_truncate_page() large folio conversion Signed-off-by: Kent Overstreet commit c42b57c451abe522f9eb499b2c421fa8c56eb8bf Author: Kent Overstreet Date: Sat Mar 18 21:37:43 2023 -0400 bcachefs: bch2_buffered_write large folio conversion Signed-off-by: Kent Overstreet commit 49fe78ff33de4319aff7085aadda0e2c699ffd97 Author: Kent Overstreet Date: Fri Mar 17 19:46:25 2023 -0400 bcachefs: bch_folio can now handle multi-order folios Signed-off-by: Kent Overstreet commit 33e2eb9677054f6e79fa188788f3027152cca8ff Author: Kent Overstreet Date: Fri Mar 17 15:37:34 2023 -0400 bcachefs: More assorted large folio conversion Various misc small conversions in fs-io.c for large folios. Signed-off-by: Kent Overstreet commit a86a92cb0d7837b2e23f6b503242810db5ec93c7 Author: Kent Overstreet Date: Sun Mar 19 19:07:28 2023 -0400 bcachefs: bch2_seek_pagecache_data() folio conversion This converts bch2_seek_pagecache_data() to handle large folios. Signed-off-by: Kent Overstreet commit e8d28c3e47d25f6a9bf83a6548395078c851d532 Author: Kent Overstreet Date: Sun Mar 19 19:06:42 2023 -0400 bcachefs: bch2_seek_pagecache_hole() folio conversion This converts bch2_seek_pagecache_hole() to handle large folios. Signed-off-by: Kent Overstreet commit ff9c301f287657c445136d9168261b5fa7f7ae91 Author: Kent Overstreet Date: Sun Mar 19 18:59:21 2023 -0400 bcachefs: bio_for_each_segment_all() -> bio_for_each_folio_all() This converts the writepage end_io path to folios. Signed-off-by: Kent Overstreet commit 30bff5944eb51a1d28b286c766599845939d2a47 Author: Kent Overstreet Date: Fri Mar 17 14:55:53 2023 -0400 bcachefs: Initial folio conversion This converts fs-io.c to pass folios, not pages. We're not handling large folios yet, there's no functional changes in this patch - just a lot of churn doing the initial type conversions. Signed-off-by: Kent Overstreet commit 3342ac134d403d4451e533ab7eb3aee19b01f478 Author: Kent Overstreet Date: Fri Mar 17 12:53:15 2023 -0400 bcachefs: Rename bch_page_state -> bch_folio Start of the large folio conversion. Signed-off-by: Kent Overstreet commit c437e1537916e3c0fcc04387888e402a5940e49c Author: Kent Overstreet Date: Mon Mar 27 15:16:24 2023 -0400 bcachefs: Add a bch_page_state assert Seeing an odd bug with page/folio state not being properly initialized, this is to help track it down. Signed-off-by: Kent Overstreet commit 2776369266ad04095204128d72cf0d429b5fb678 Author: Kent Overstreet Date: Tue Apr 4 13:25:06 2023 -0400 bcachefs: Add a cond_resched() call to journal_keys_sort() We're just doing cpu work here and it could take awhile, a cond_resched() is definitely needed. Signed-off-by: Kent Overstreet commit bb6c4b92fd8566aeb92e56f464ff809ae7e60155 Author: Kent Overstreet Date: Fri Mar 10 17:34:29 2023 -0500 bcachefs: Improve trace_move_extent_fail() This greatly expands the move_extent_fail tracepoint - now it includes all the information we have available, including exactly why the extent wasn't updated. Signed-off-by: Kent Overstreet commit 8669199438aeb5daf8b17f76bc853286b93f058e Author: Kent Overstreet Date: Thu Mar 30 18:49:02 2023 -0400 bcachefs: Print out counters correctly Most counters aren't in units of sectors, and the ones that are should just be switched to bytes, for simplicity. Signed-off-by: Kent Overstreet commit dde72e182758e455891ff61c11746085db8c27c1 Author: Kent Overstreet Date: Thu Mar 30 20:16:06 2023 -0400 bcachefs: Add missing bch2_err_class() call We're not supposed to return our private error codes to userspace. Signed-off-by: Kent Overstreet commit 62a03559d667c1b0552a692ac01c576358847318 Author: Kent Overstreet Date: Fri Mar 31 16:24:45 2023 -0400 bcachefs: Rip out code for storing backpointers in alloc keys We don't store backpointers in alloc keys anymore, since we gained the btree write buffer. This patch drops support for backpointers in alloc keys, and revs the on disk format version so that we know a fsck is required. Signed-off-by: Kent Overstreet commit 349b1d832ba534b802a28f316e40128c54643c32 Author: Brian Foster Date: Wed Mar 22 08:27:58 2023 -0400 bcachefs: use reservation for log messages during recovery If we block on journal reservation attempting to log journal messages during recovery, particularly for the first message(s) before we start doing actual work, chances are the filesystem ends up deadlocked. Allow logged messages to use reserved journal space to mitigate this problem. In the worst case where no space is available whatsoever, this at least allows the fs to recognize that the journal is stuck and fail the mount gracefully. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 3d86f13df67b554a7b27e28a4b144425710409bf Author: Kent Overstreet Date: Thu Mar 30 16:04:02 2023 -0400 bcachefs: Improve trans_restart_split_race tracepoint Seeing occasional test failures where we get stuck in a livelock that involves this event - this will help track it down. Signed-off-by: Kent Overstreet commit 25d8f40560e75aea107b0e773f8712931173ded6 Author: Kent Overstreet Date: Wed Mar 29 22:47:30 2023 -0400 bcachefs: Data update path no longer leaves cached replicas It turns out that it's currently impossible to invalidate buckets containing only cached data if they're part of a stripe. The normal bucket invalidate path can't do it because we have to be able to incerement the bucket's gen, which isn't correct becasue it's still a member of the stripe - and the bucket invalidate path makes the bucket availabel for reuse right away, which also isn't correct for buckets in stripes. What would work is invalidating cached data by following backpointers, except that cached replicas don't currently get backpointers - because they would be awkward for the existing bucket invalidate path to delete and they haven't been needed elsewhere. So for the time being, to prevent running out of space in stripes, switch the data update path to not leave cached replicas; we may revisit this in the future. Signed-off-by: Kent Overstreet commit 32de2ea0d5b7e2bc2a4eeac47e38aceb0ff25cc9 Author: Kent Overstreet Date: Sat Mar 11 14:44:41 2023 -0500 bcachefs: Rhashtable based buckets_in_flight for copygc Previously, copygc used a fifo for tracking buckets in flight - this had the disadvantage of being fixed size, since we pass references to elements into the move code. This restructures it to be a hash table and linked list, since with erasure coding we need to be able to pipeline across an arbitrary number of buckets. Signed-off-by: Kent Overstreet commit 6bdefe9c3900b3bb7a028486423520cdc975d9a8 Author: Kent Overstreet Date: Wed Mar 29 13:10:36 2023 -0400 bcachefs: Use BTREE_ITER_INTENT in ec_stripe_update_extent() This adds a flags param to bch2_backpointer_get_key() so that we can pass BTREE_ITER_INTENT, since ec_stripe_update_extent() is updating the extent immediately. Signed-off-by: Kent Overstreet commit 4f77dcde2841e43e4c5fe9f178a64ec40be72e17 Author: Kent Overstreet Date: Wed Mar 29 11:01:12 2023 -0400 bcachefs: move snapshot_t to subvolume_types.h this doesn't need to be in bcachefs.h Signed-off-by: Kent Overstreet commit 1546cf972709d9b10c39fdb3bff9da3f22a57226 Author: Kent Overstreet Date: Tue Mar 28 19:37:25 2023 -0400 bcachefs: Fix bch2_get_key_or_hole() This fixes an off by one error, due to confusing closed vs. half open intervals. Signed-off-by: Kent Overstreet commit 2a6c302fb3a00bd74dfc3882698d290482bc5382 Author: Kent Overstreet Date: Tue Mar 28 19:15:53 2023 -0400 bcachefs: Check return code from need_whiteout_for_snapshot() This could return a transaction restart; we need to check for that. Signed-off-by: Kent Overstreet commit e9b9e475eaef1c50e89072e4efc3910ff25a0552 Author: Kent Overstreet Date: Wed Mar 22 21:22:51 2023 -0400 bcachefs: bch2_dev_freespace_init() Print out status every 10 seconds It appears freespace init can still take awhile, and we've had a report or two of it getting stuck - let's have it print out where it's at every 10 seconds. Signed-off-by: Kent Overstreet commit b1c945b3fd926ea121172eedc271f4b816b44387 Author: Kent Overstreet Date: Wed Mar 22 20:48:37 2023 -0400 bcachefs: Run freespace init in device hot add path Like in the recovery, and device add, we have to check if devices don't have the freespace btree initialized - this was missed in the device hot add path. Signed-off-by: Kent Overstreet commit 0fb11e0801962007adef5b628fec0f334e5358f2 Author: Kent Overstreet Date: Fri Mar 17 09:59:17 2023 -0400 bcachefs: Improved copygc wait debugging This just adds a line for how long copygc has been waiting to sysfs copygc_wait, helpful for debugging why copygc isn't running. Signed-off-by: Kent Overstreet commit 11f117374a2a353c378f8eccff8904d209643695 Author: Kent Overstreet Date: Tue Mar 21 12:18:10 2023 -0400 bcachefs: Call bch2_path_put_nokeep() before bch2_path_put() bch2_path_put_nokeep() is sketchy, and we should consider removing it: it unconditionally frees btree_paths once their ref hits 0. The assumption is that we only use it for paths that have never been visible outside the btree core btree code; i.e. higher level code will never be making assumptions about locking based on these paths. However, there's subtle brokenness with this approach: - If we call bch2_path_put(), then bch2_path_put_nokeep(), bch2_path_put() may free the first path on the assumption that we we have another path keeping a node locked - but then bch2_path_put_nokeep() just unconditionally frees it. The same bug may arise if we're calling bch2_path_put() and bch2_path_put_nokeep() on the same (refcounted) path, or two adjacent paths that point to the same btree node. This patch hacks around one of these bugs by calling bch2_path_put_nokeep() first in bch2_trans_iter_exit. Signed-off-by: Kent Overstreet commit 030e9f9264a9d6bbbdb29ed20429bf943ed34315 Author: Brian Foster Date: Tue Mar 21 08:09:16 2023 -0400 bcachefs: drop unnecessary journal stuck check from space calculation The journal stucking check in bch2_journal_space_available() is particularly aggressive and can lead to premature shutdown in some rare cases. This is difficult to reproduce, but also comes along with a fatal error and so is worthwhile to be cautious. For example, we've seen instances where the journal is under heavy reservation pressure, the journal allocation path transitions into the final available journal bucket, the journal write path immediately consumes that bucket and calls into bch2_journal_space_available(), which then in turn flags the journal as stuck because there is no available space and shuts down the filesystem instead of submitting the journal write (that would have otherwise succeeded). To avoid this problem, simplify the journal stuck checking by just relying on the higher level logic in the journal reservation path. This produces more useful debug output and is a more reliable indicator that things have bogged down. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit db1bf7290591115e4d37428ff822c20a1694a69b Author: Brian Foster Date: Tue Mar 21 08:03:18 2023 -0400 bcachefs: refactor journal stuck checking into standalone helper bcachefs checks for journal stuck conditions both in the journal space calculation code and the journal reservation slow path. The logic in both places is rather tricky and can result in non-deterministic failure characteristics and debug output. In preparation to condense journal stuck handling to a single place, refactor the __journal_res_get() logic into a standalone helper. Since multiple callers into the reservation code can result in duplicate reports, use the ->err_seq field as a serialization mechanism for the debug dump. Finally, add some comments to help explain the logic and hopefully facilitate further improvements in the future. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 23fd4f4dc622c36124515401d223607baec01a0d Author: Brian Foster Date: Mon Mar 20 13:21:19 2023 -0400 bcachefs: gracefully unwind journal res slowpath on shutdown bcachefs detects journal stuck conditions in a couple different places. If the logic in the journal reservation slow path happens to detect the problem, I've seen instances where the filesystem remains deadlocked even though it has been shut down. This is occasionally reproduced by generic/333, and usually manifests as one or more tasks stuck in the journal reservation slow path. To help avoid this problem, repeat the journal error check in __journal_res_get() once under spinlock to cover the case where the previous lock holder might have triggered shutdown. This also helps avoid spurious/duplicate stuck reports. Also, wake the journal from the halt code to make sure blocked callers of the journal res slowpath have a chance to wake up and observe the pending error. This survives an overnight looping run of generic/333 without the aforementioned lockups. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 873555f04d81b49a96ea03b37dcd499c13e67742 Author: Brian Foster Date: Fri Mar 17 08:54:01 2023 -0400 bcachefs: more aggressive fast path write buffer key flushing The btree write buffer flush code is prone to causing journal deadlock due to inefficient use and release of reservation space. Reservation is not pre-reserved for write buffered keys (as is done for key cache keys, for example), because the write buffer flush side uses a fast path that attempts insertion without need for any reservation at all. The write buffer flush attempts to deal with this by inserting keys using the BTREE_INSERT_JOURNAL_RECLAIM flag to return an error on journal reservations that require blocking. Upon first error, it falls back to a slow path that inserts in journal order and supports moving the associated journal pin forward. The problem is that under pathological conditions (i.e. smaller log, larger write buffer and journal reservation pressure), we've seen instances where the fast path fails fairly quickly without having completed many insertions, and then the slow path is unable to push the journal pin forward enough to free up the space it needs to completely flush the buffer. This problem is occasionally reproduced by fstest generic/333. To avoid this problem, update the fast path algorithm to skip key inserts that fail due to inability to acquire needed journal reservation without immediately breaking out of the loop. Instead, insert as many keys as possible, zap the sequence numbers to mark them as processed, and then fall back to the slow path to process the remaining set in journal order. This reduces the amount of journal reservation that might be required to flush the entire buffer and increases the odds that the slow path is able to move the journal pin forward and free up space as keys are processed. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 8bff9875a695ce9c6635693ff45fb3196688c1c6 Author: Brian Foster Date: Thu Mar 23 14:09:05 2023 -0400 bcachefs: use dedicated workqueue for tasks holding write refs A workqueue resource deadlock has been observed when running fsck on a filesystem with a full/stuck journal. fsck is not currently able to repair the fs due to fairly rapid emergency shutdown, but rather than exit gracefully the fsck process hangs during the shutdown sequence. Fortunately this is easily recoverable from userspace, but the root cause involves code shared between the kernel and userspace and so should be addressed. The deadlock scenario involves the main task in the bch2_fs_stop() -> bch2_fs_read_only() path waiting on write references to drain with the fs state lock held. A bch2_read_only_work() workqueue task is scheduled on the system_long_wq, blocked on the state lock. Finally, various other write ref holding workqueue tasks are scheduled to run on the same workqueue and must complete in order to release references that the initial task is waiting on. To avoid this problem, we can split the dependent workqueue tasks across different workqueues. It's a bit of a waste to create a dedicated wq for the read-only worker, but there are several tasks throughout the fs that follow the pattern of acquiring a write reference and then scheduling to the system wq. Use a local wq for such tasks to break the subtle dependency between these and the read-only worker. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 76c70c57f093d26fcb5a1aac75db12a5caa5614d Author: Brian Foster Date: Wed Mar 22 09:17:26 2023 -0400 bcachefs: remove unused bch2_trans_log_msg() Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit ffc76edbbea3a55876fcd91d10db4ce38b27cac6 Author: Kent Overstreet Date: Mon Mar 27 16:25:15 2023 -0400 bcachefs: Fix bch2_verify_bucket_evacuated() We were going into an infinite loop when printing out backpointers, due to never incrementing bp_offset - whoops. Also limit the number of backpointers we print to 10; this is debug code and we only need to print a sample, not all of them. Signed-off-by: Kent Overstreet commit d59ca7e8c072b4587113ced8e00358368f315626 Author: Kent Overstreet Date: Sun Mar 19 14:32:23 2023 -0400 bcachefs: verify_bucket_evacuated() -> set_btree_iter_dontneed() This should help with excessive 'would deadlock' transaction restarts. Signed-off-by: Kent Overstreet commit 330970c2c61686b43cfef47ab99a84f659271ede Author: Kent Overstreet Date: Sun Mar 19 14:29:51 2023 -0400 bcachefs: Make reconstruct_alloc quieter We shouldn't be printing out fsck errors for expected errors - this helps make test logs more readable, and makes it easier to see what the actual failure was. Signed-off-by: Kent Overstreet commit 3e36e572f14bfa2bac80c3ba07af67e204eb7820 Author: Kent Overstreet Date: Sun Mar 19 14:13:17 2023 -0400 bcachefs: Fix an unhandled transaction restart error This is a bit awkward: we're passing around a btree_trans, but we're not in a context where transaction restarts are handled - we should try to come up with a better way to denote situations like this. Signed-off-by: Kent Overstreet commit dc6274bcb87dbf50c62d9dbacba770bae2f10279 Author: Kent Overstreet Date: Sun Mar 19 13:01:06 2023 -0400 bcachefs: Fix nocow write path closure bug With regular waitlists, we need to ensure we always call finish_wait(). With closures, the equivalent is that we need to call closure_sync() before returning with a stack-allocated closure. Signed-off-by: Kent Overstreet commit ac77810cb4ffd16976487d787e2f81ba9cb5fd0c Author: Kent Overstreet Date: Sun Mar 19 12:50:05 2023 -0400 bcachefs: Nocow write error path fix The nocow write error path was iterating over pointers in an extent, aftre we'd dropped btree locks - oops. Fortunately we'd already stashed what we need in nocow_lock_bucket, so use that instead. Signed-off-by: Kent Overstreet commit abab7609de92c973bfa3ad069a622c0a107b6386 Author: Kent Overstreet Date: Fri Mar 17 10:56:44 2023 -0400 bcachefs: Fix bch2_extent_fallocate() in nocow mode When we allocate disk space, we need to be incrementing the WRITE io clock, which perhaps should be renamed to sectors allocated - copygc uses this io clock to know when to run. Also, we should be incrementing the same clock when allocating btree nodes. Signed-off-by: Kent Overstreet commit 711bf946d55d28336dcc4f87209c8b74e6279481 Author: Kent Overstreet Date: Wed Mar 15 19:04:05 2023 -0400 bcachefs: Add an assert in inode_write for -ENOENT Signed-off-by: Kent Overstreet commit 9edbcc72f6987bbb58f113d04e7704b7a84106a6 Author: Kent Overstreet Date: Wed Mar 15 11:53:51 2023 -0400 bcachefs: Fix bch2_evict_subvolume_inodes() This fixes a bug in bch2_evict_subvolume_inodes(): d_mark_dontcache() doesn't handle the case where i_count is already 0, we need to grab and put the inode in order for it to be dropped. Signed-off-by: Kent Overstreet commit e1e7ecafe6482464ccc510afb38e1b9b306ce5dc Author: Kent Overstreet Date: Thu Mar 16 12:47:35 2023 -0400 bcachefs: Improve error handling in bch2_ioctl_subvolume_destroy() Pure style fixes Signed-off-by: Kent Overstreet commit 2d33036ca9360bacef23ba32e7768ff9ea87f2be Author: Kent Overstreet Date: Thu Mar 16 11:04:28 2023 -0400 bcachefs: Fix for 'missing subvolume' error Subvolumes, including their root inodes, get deleted asynchronously after an unlink. But we still need to ensure that we tell the VFS the inode has been deleted, otherwise VFS writeback could fire after asynchronous deletion has finished, and try to write to an inode/subvolume that no longer exists. Signed-off-by: Kent Overstreet commit 56cc033dfcf002eb8a957097fe7290546829b7c0 Author: Kent Overstreet Date: Wed Mar 15 14:41:07 2023 -0400 bcachefs: Don't run transaction hooks multiple times transaction hooks aren't supposed to run unless we know the transaction is going to commit succesfully: this fixes a bug with attempting to delete a subvolume multiple times. Signed-off-by: Kent Overstreet commit 26559553e47c9f2a14b5254cb307fc755ac316c8 Author: Kent Overstreet Date: Wed Mar 15 11:02:00 2023 -0400 bcachefs: Add a fallback when journal_keys doesn't fit in ram We may end up in a situation where allocating the buffer for the sorted journal_keys fails - but it would likely succeed, post compaction where we drop duplicates. We've had reports of this allocation failing, so this adds a slowpath to do the compaction incrementally. This is only a band-aid fix; we need to look at limiting the number of keys in the journal based on the amount of system RAM. Signed-off-by: Kent Overstreet commit 2f0815840c80075bc35f210a7acfa8b48717be5a Author: Kent Overstreet Date: Tue Mar 14 14:39:54 2023 -0400 bcachefs: Improve the backpointer to missing extent message We now print the pos where the backpointer was found in the btree, as well as the exact bucket:bucket_offset of the data, to aid in grepping through logs. Signed-off-by: Kent Overstreet commit 40a18fe27335706789b1322934f4d8b458f302e3 Author: Kent Overstreet Date: Tue Mar 14 16:21:16 2023 -0400 bcachefs: Add error message for failing to allocate sorted journal keys Signed-off-by: Kent Overstreet commit b40901b0f7182557851c8e9af31bacfbbd76b1ec Author: Kent Overstreet Date: Mon Mar 13 22:01:47 2023 -0400 bcachefs: New erasure coding shutdown path This implements a new shutdown path for erasure coding, which is needed for the upcoming BCH_WRITE_WAIT_FOR_EC write path. The process is: - Cancel new stripes being built up - Close out/cancel open buckets on write points or the partial list that are for stripes - Shutdown rebalance/copygc - Then wait for in flight new stripes to finish With BCH_WRITE_WAIT_FOR_EC, move ops will be waiting on stripes to fill up before they complete; the new ec shutdown path is needed for shutting down copygc/rebalance without deadlocking. Signed-off-by: Kent Overstreet commit b9fa375bab2786d0d2c5435b5e3fceaf6594aaf3 Author: Kent Overstreet Date: Sat Mar 11 20:38:46 2023 -0500 bcachefs: bch2_fs_moving_ctxts_to_text() This also adds bch2_write_op_to_text(): now we can see outstand moves, useful for debugging shutdown with the upcoming BCH_WRITE_WAIT_FOR_EC and likely for other things in the future. Signed-off-by: Kent Overstreet commit 65d48e35250fe46a560dffa13876830336b152c9 Author: Kent Overstreet Date: Tue Mar 14 15:35:57 2023 -0400 bcachefs: Private error codes: ENOMEM This adds private error codes for most (but not all) of our ENOMEM uses, which makes it easier to track down assorted allocation failures. Signed-off-by: Kent Overstreet commit 872c0311675bdb73b29ee74c7f27afc82d4918e9 Author: Kent Overstreet Date: Tue Mar 14 12:54:21 2023 -0400 bcachefs: Fix bch2_check_extents_to_backpointers() In rare cases, bch2_check_extents_to_backpointers() would incorrectly flag an extent has having a missing backpointer when we just needed to flush the btree write buffer - we weren't tracking the last flushed position correctly. This adds a level field to the last_flushed pos, fixing a bug where we'd sometimes fail on a new root node. Signed-off-by: Kent Overstreet commit c639c29ce6882f4f77a81d778ef4741d5a5979d9 Author: Kent Overstreet Date: Tue Mar 14 11:48:07 2023 -0400 bcachefs: Fix an assert in copygc thread shutdown path We're not supposed to have nested (locked) btree_trans on the stack: this means copygc shutdown needs to exit our btree_trans before exiting the move_ctxt, which calls bch2_write(). Signed-off-by: Kent Overstreet commit 2d004446c8044e1660adc53e55d151c607a472d6 Author: Kent Overstreet Date: Tue Mar 14 08:35:04 2023 -0400 bcachefs: bch2_bucket_is_movable() -> BTREE_ITER_CACHED BTREE_ITER_CACHED should really be the default for cached btrees - this is an easy mistake to make. Signed-off-by: Kent Overstreet commit 3997989ae1541dea4bb144bd2bf8b7dc6cae743f Author: Kent Overstreet Date: Mon Mar 13 21:58:14 2023 -0400 bcachefs: Don't use BTREE_ITER_INTENT in make_extent_indirect() This is a workaround for a btree path overflow - searching with BTREE_ITER_INTENT periodically saves the iterator position for updates, which eventually overflows. Signed-off-by: Kent Overstreet commit aebe7a679cbdd827769e85f632562a66d2a2b9f3 Author: Kent Overstreet Date: Mon Mar 13 09:53:04 2023 -0400 bcachefs: Fix stripe create error path If we errored out on a new stripe before fully allocating it, we shouldn't be zeroing out unwritten data. Signed-off-by: Kent Overstreet commit ae1f56238d55ad6d16564455559d1fa9a8cea2f6 Author: Kent Overstreet Date: Mon Mar 13 07:09:33 2023 -0400 bcachefs: Mark new snapshots earlier in create path This fixes a null ptr deref when creating new snapshots: bch2_create_trans() will lookup the subvolume and find the _new_ snapshot in the BCH_CREATE_SUBVOL path that's being created in that transaction. We have to call bch2_mark_snapshot() earlier so that it's properly initialized, instead of leaving it for transaction commit. Signed-off-by: Kent Overstreet commit e6539b0aebd384549aef4dc3b917658f24bb6b83 Author: Kent Overstreet Date: Sat Mar 11 17:23:08 2023 -0500 bcachefs: Improve bch2_new_stripes_to_text() Print out the alloc reserve, and format it a bit more nicely. Signed-off-by: Kent Overstreet commit 751c025f0de7ca55ad5f77099645b5247623de98 Author: Kent Overstreet Date: Sat Mar 11 17:21:30 2023 -0500 bcachefs: Kill bch_write_op->btree_update_ready This changes the write path to not add write ops to to the write_point's list of pending work items until it's ready; this means we have to change the lock protecting it to an irq-safe lock, but means bch2_write_point_do_index_updates() no longer has to iterate over the list, which is beneficial with the way the new BCH_WRITE_WAIT_FOR_EC code works. Signed-off-by: Kent Overstreet commit e28ef07e0ef47c03f773571d85bc82fcce831376 Author: Kent Overstreet Date: Fri Mar 10 23:37:19 2023 -0500 bcachefs: Simplify stripe_idx_to_delete This is not technically correct - it's subject to a race if we ever end up with a stripe with all empty blocks (that needs to be deleted) being held open. But the "correct" version was much too inefficient, and soon we'll be adding a stripes LRU. Signed-off-by: Kent Overstreet commit 46e14854fca4a262a823079c1958a204f983fa4e Author: Kent Overstreet Date: Sat Mar 11 15:52:37 2023 -0500 bcachefs: Fix next_bucket() This fixes an infinite loop in bch2_get_key_or_real_bucket_hole(). Signed-off-by: Kent Overstreet commit fba053d2aaca8f9a4486e865452d80245a8cc215 Author: Kent Overstreet Date: Thu Mar 9 10:18:09 2023 -0500 bcachefs: Second layer of refcounting for new stripes This will be used for move writes, which will be waiting until the stripe is created to do the index update. They need to prevent the stripe from being reclaimed until their index update is done, so we need another refcount that just keeps the stripe open. Signed-off-by: Kent Overstreet # Conflicts: # fs/bcachefs/ec.c # fs/bcachefs/io.c commit 10d9f7d2853d5e4c6f21a0dc96f6e98c2d0828e7 Author: Kent Overstreet Date: Fri Mar 10 16:46:24 2023 -0500 bcachefs: ec: fall back to creating new stripes for copygc Signed-off-by: Kent Overstreet commit 57c723de7d4c592ab3a38e77d414d0021e8483ee Author: Kent Overstreet Date: Sat Mar 4 03:21:34 2023 -0500 bcachefs: Rework __bch2_data_update_index_update() This makes some improvements to the logic for adding/removing replicas, as part of the larger erasure coding improvements. We now directly consider number of replicas desired for the given inode, and extent/pointer durability: this ensures that the extent ends up with the desired number of replicas when we're replacing multiple pointers with one that has higher durability (e.g. erasure coded). Signed-off-by: Kent Overstreet commit 702ffea204840455e4f2d918538c39cc5c59666b Author: Kent Overstreet Date: Fri Mar 10 16:28:37 2023 -0500 bcachefs: Extent helper improvements - __bch2_bkey_drop_ptr() -> bch2_bkey_drop_ptr_noerror(), now available outside extents. - Split bch2_bkey_has_device() and bch2_bkey_has_device_c(), const and non const versions - bch2_extent_has_ptr() now returns the pointer it found Signed-off-by: Kent Overstreet commit 3f5d3fb4025a7196e75250ecee8b6478f086a145 Author: Kent Overstreet Date: Fri Mar 10 18:00:10 2023 -0500 bcachefs: evacuate_bucket() no longer moves cached ptrs Signed-off-by: Kent Overstreet commit 5bf9db0179c3eb1b7d9f9b3c3fe0d30f1364bb1f Author: Kent Overstreet Date: Fri Mar 10 17:40:21 2023 -0500 bcachefs: evacuate_bucket() no longer calls verify_bucket_evacuated() The copygc code itself now calls this when all moves from a given bucket are complete. Signed-off-by: Kent Overstreet commit 51fe0332b1e39822a6d67a0da656fcfc0db03e99 Author: Kent Overstreet Date: Fri Mar 10 14:34:30 2023 -0500 bcachefs: Suppress transaction restart err message This isn't a real error, and doesn't need to be printed. Signed-off-by: Kent Overstreet commit 7635e1a6d6740ce76e1c2204f9237f01c98153b3 Author: Kent Overstreet Date: Sat Feb 25 02:22:49 2023 -0500 bcachefs: Rework open bucket partial list allocation Now, any open_bucket can go on the partial list: allocating from the partial list has been moved to its own dedicated function, open_bucket_add_bucets() -> bucket_alloc_set_partial(). In particular, this means that erasure coded buckets can safely go on the partial list; the new location works with the "allocate an ec bucket first, then the rest" logic. Signed-off-by: Kent Overstreet commit e53d03fe39f1458065ddb5f7309ade066ba6fb95 Author: Brian Foster Date: Thu Mar 2 09:03:37 2023 -0500 bcachefs: don't bump key cache journal seq on nojournal commits fstest generic/388 occasionally reproduces corruptions where an inode has extents beyond i_size. This is a deliberate crash and recovery test, and the post crash+recovery characteristics are usually the same: the inode exists on disk in an early (i.e. just allocated) state based on the journal sequence number associated with the inode. Subsequent inode updates exist in the journal at higher sequence numbers, but the inode hadn't been written back before the associated crash and the post-crash recovery processes a set of journal sequence numbers that doesn't include updates to the inode. In fact, the sequence with the most recent inode key update always happens to be the sequence just before the front of the journal processed by recovery. This last bit is a significant hint that the problem relates to an on-disk journal update of the front of the journal. The root cause of this problem is basically that the inode is updated (multiple times) in-core and in the key cache, each time bumping the key cache sequence number used to control the cache flush. The cache flush skips one or more times, bumping the associated key cache journal pin to the key cache seq value. This has a side effect of holding the inode in memory a bit longer than normal, which helps exacerbate this problem, but is also unsafe in certain cases where the key cache seq may have been updated by a transaction commit that didn't journal the associated key. For example, consider an inode that has been allocated, updated several times in the key cache, journaled, but not yet written back. At this stage, everything should be consistent if the fs happens to crash because the latest update has been journal. Now consider a key update via bch2_extent_update_i_size_sectors() that uses the BTREE_UPDATE_NOJOURNAL flag. While this update may not change inode state, it can have the side effect of bumping ck->seq in bch2_btree_insert_key_cached(). In turn, if a subsequent key cache flush skips due to seq not matching the former, the ck->journal pin is updated to ck->seq even though the most recent key update was not journaled. If this pin happens to reside at the front (tail) of the journal, this means a subsequent journal write can update last_seq to a value beyond that which includes the most recent update to the inode. If this occurs and the fs happens to crash before the inode happens to flush, recovery will see the latest last_seq, fail to recover the inode and leave the inode in the inconsistent state described above. To avoid this problem, skip the key cache seq update on NOJOURNAL commits, except on initial pin add. Pass the insert entry directly to bch2_btree_insert_key_cached() to make the associated flag available and be consistent with btree_insert_key_leaf(). Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 83ec519aea326beed20dbac1c5a4432215adf35d Author: Kent Overstreet Date: Tue Mar 7 07:28:20 2023 -0500 bcachefs: When shutting down, flush btree node writes last Signed-off-by: Kent Overstreet commit adac06fad3333f9b9638ad9271346065d69e9c79 Author: Kent Overstreet Date: Tue Mar 7 07:25:12 2023 -0500 bcachefs: Verbose on by default when CONFIG_BCACHEFS_DEBUG=y Signed-off-by: Kent Overstreet commit db64a8e8a1688f70bdb254aed704f48a76dc7a7e Author: Kent Overstreet Date: Mon Mar 6 10:20:36 2023 -0500 fixup bcachefs: Use for_each_btree_key_upto() more consistently Signed-off-by: Kent Overstreet commit 4b5b13da527b1ce02ee9a96382684496e8d83696 Author: Kent Overstreet Date: Mon Mar 6 07:57:51 2023 -0500 six locks: be more careful about lost wakeups This is a workaround for a lost wakeup bug we've been seeing - we still need to discover the actual bug. Signed-off-by: Kent Overstreet commit 2640faeb1741db94b717d2678f6cd644f90e3061 Author: Kent Overstreet Date: Mon Mar 6 05:29:12 2023 -0500 bcachefs: Journal resize fixes - Fix a sleeping-in-atomic bug due to calling bch2_journal_buckets_to_sb() under the journal lock. - Additionally, now we mark buckets as journal buckets before adding them to the journal in memory and the superblock. This ensures that if we crash part way through we'll never be writing to journal buckets that aren't marked correctly. Signed-off-by: Kent Overstreet commit 511b629aca6007a8784a6005a023dd166ffaa787 Author: Kent Overstreet Date: Mon Mar 6 04:01:22 2023 -0500 bcachefs: bch2_btree_iter_peek_node_and_restart() Minor refactoring for the Rust interface. Signed-off-by: Kent Overstreet commit b65499b7b16b99575f1e7921da402b3b59c47de6 Author: Kent Overstreet Date: Mon Mar 6 02:53:25 2023 -0500 bcachefs: bch2_btree_node_ondisk_to_text() Pulling out a helper from cmd_list.c, as the rest is being rewritten in Rust but we're not ready to rewrite lower-level btree code in Rust. Signed-off-by: Kent Overstreet commit a345b0f393da49be9d1110ec9e43066191f0e466 Author: Kent Overstreet Date: Mon Mar 6 02:34:59 2023 -0500 bcachefs: bch2_btree_node_to_text() const correctness This is for the Rust interface - Rust cares more about const than C does. Signed-off-by: Kent Overstreet commit 26bab33b6974d42f5db6d2b7c2198e3af4993cf8 Author: Kent Overstreet Date: Mon Mar 6 00:10:14 2023 -0500 bcachefs: Fix "btree node in stripe" error Signed-off-by: Kent Overstreet commit 2a912a9a39bf0ce7709d53f00d1d341d2478c96e Author: Kent Overstreet Date: Sun Mar 5 23:52:49 2023 -0500 bcachefs: Kill bch2_ec_bucket_written() Signed-off-by: Kent Overstreet commit 81c771b26639112603bb558bf66441ed3d229eed Author: Kent Overstreet Date: Wed Mar 8 03:57:32 2023 -0500 bcachefs: Improve bch2_new_stripes_to_text() Signed-off-by: Kent Overstreet commit 8fcdf81418f16ef878de7a7535e90599e396fd69 Author: Kent Overstreet Date: Mon Feb 27 22:58:01 2023 -0500 bcachefs: Improved copygc pipelining This improves copygc pipelining across multiple buckets: we now track each in flight bucket we're evacuating, with separate moving_contexts. This means that whereas previously we had to wait for outstanding moves to complete to ensure we didn't try to evacuate the same bucket twice, we can now just check buckets we want to evacuate against the pending list. This also mean we can run the verify_bucket_evacuated() check without killing pipelining - meaning it can now always be enabled, not just on debug builds. This is going to be important for the upcoming erasure coding work, where moving IOs that are being erasure coded will now skip the initial replication step; instead the IOs will wait on the stripe to complete. Signed-off-by: Kent Overstreet commit 0b943b973c67c2780cb991c3011ad3279f670fa4 Author: Kent Overstreet Date: Sun Mar 5 03:11:00 2023 -0500 bcachefs: Free move buffers as early as possible Signed-off-by: Kent Overstreet commit 5be6a274ff7a7cd9640555db63d60127c6434e1a Author: Kent Overstreet Date: Sun Mar 5 02:52:40 2023 -0500 bcachefs: Fix stripe reuse path It's possible that we reuse a stripe that doesn't have quite the same configuration as the stripe_head we're allocating from. In that case, we have to make sure that the new stripe uses the settings from the stripe we resue, not the stripe head, and make sure the buffer is allocated correctly. This fixes the ec_mixed_tiers test. Signed-off-by: Kent Overstreet commit ac2ccddc2689d5889fd1520383738b60dbafc1d0 Author: Kent Overstreet Date: Sat Mar 4 23:05:55 2023 -0500 bcachefs: Drop some anonymous structs, unions Rust bindgen doesn't cope well with anonymous structs and unions. This patch drops the fancy anonymous structs & unions in bkey_i that let us use the same helpers for bkey_i and bkey_packed; since bkey_packed is an internal type that's never exposed to outside code, it's only a minor inconvenienc. Signed-off-by: Kent Overstreet commit 45dd05b3ecc371560f9e36e4b57295ee338ee879 Author: Kent Overstreet Date: Sat Mar 4 22:36:02 2023 -0500 bcachefs: BKEY_PADDED_ONSTACK() Rust bindgen doesn't do anonymous structs very nicely: BKEY_PADDED() only needs the anonymous struct when it's used on the stack, to guarantee layout, not when it's embedded in another struct. Signed-off-by: Kent Overstreet commit 2f528663c5abf101aae90b2adcce715bda424bfc Author: Kent Overstreet Date: Sat Mar 4 02:51:12 2023 -0500 bcachefs: moving_context->stats is allowed to be NULL Signed-off-by: Kent Overstreet commit e84face6f0c9512d896eb1bf6c8238ea2fa7edd0 Author: Kent Overstreet Date: Thu Mar 2 01:54:17 2023 -0500 bcachefs: RESERVE_stripe Rework stripe creation path - new algorithm for deciding when to create new stripes or reuse existing stripes. We add a new allocation watermark, RESERVE_stripe, above RESERVE_none. Then we always try to create a new stripe by doing RESERVE_stripe allocations; if this fails, we reuse an existing stripe and allocate buckets for it with the reserve watermark for the given write (RESERVE_none or RESERVE_movinggc). Signed-off-by: Kent Overstreet commit d57c9add59b187a6fcd76cb80d60f36234ca8033 Author: Kent Overstreet Date: Fri Mar 3 23:08:11 2023 -0500 bcachefs: Improve error message for stripe block sector counts wrong Signed-off-by: Kent Overstreet commit 9d32097f3b6617680c75ccbb5cd36d89bcff0dfc Author: Kent Overstreet Date: Fri Mar 3 03:11:06 2023 -0500 bcachefs: More stripe create cleanup/fixes Signed-off-by: Kent Overstreet commit a1fb08f5df6a8b2995d9daf8c2997cd478b51c55 Author: Kent Overstreet Date: Fri Mar 3 02:43:39 2023 -0500 bcachefs: Plumb alloc_reserve through stripe create path Signed-off-by: Kent Overstreet commit 910659763edaba58aa04bd5924dd933bc08cc56f Author: Kent Overstreet Date: Wed Mar 1 21:47:07 2023 -0500 bcachefs: Mark stripe buckets with correct data type Currently, we don't use bucket data type for tracking whether buckets are part of a stripe; parity buckets are BCH_DATA_parity, but data buckets in a stripe are BCH_DATA_user. There's a separate counter, buckets_ec, outside the BCH_DATA_TYPES system for tracking number of buckets on a device that are part of a stripe. The trouble with this approach is that it's too coarse grained, and we need better information on fragmentation for debugging copygc. With this patch, data buckets in a stripe are now tracked as BCH_DATA_stripe buckets. This doesn't yet differentiate between erasure coded and non-erasure coded data in a stripe bucket, nor do we yet track empty data buckets in stripes. Signed-off-by: Kent Overstreet commit 3329cf1bb91d6293a96cf35ad72b2a2e1e1c0e3d Author: Kent Overstreet Date: Fri Mar 3 00:03:01 2023 -0500 bcachefs: Centralize btree node lock initialization This fixes some confusion in the lockdep code due to initializing btree node/key cache locks with the same lockdep key, but different names. Signed-off-by: Kent Overstreet commit 1306f87de399a0c791f03d68b50e03bdb3f409ae Author: Kent Overstreet Date: Thu Mar 2 02:12:18 2023 -0500 bcachefs: Plumb btree_trans through btree cache code Soon, __bch2_btree_node_write() is going to require a btree_trans: zoned device support is going to require a new allocation for every btree node write. This is a bit of prep work. Signed-off-by: Kent Overstreet commit b1cfe5ed2b5d5dbd2d8bcb2a4c1131513a1b3e1c Author: Kent Overstreet Date: Thu Mar 2 01:08:46 2023 -0500 bcachefs: Improve dev_alloc_debug_to_text() Now we also print the number of buckets reserved for each watermark. Signed-off-by: Kent Overstreet commit c85d7796090741fe6a75f953afae964344066448 Author: Kent Overstreet Date: Wed Mar 1 23:10:39 2023 -0500 bcachefs: bch2_copygc_wait_to_text() Signed-off-by: Kent Overstreet commit 2611a041ae9c35b1bf4e7e1462c77c4096490a4e Author: Kent Overstreet Date: Wed Mar 1 22:14:31 2023 -0500 bcachefs: bch2_mark_key() now takes btree_id & level btree & level are passed to trans_mark - for backpointers - bch2_mark_key() should take them as well. Signed-off-by: Kent Overstreet commit e902095868819c23433c6eba6636e2f1122da126 Author: Kent Overstreet Date: Tue Feb 28 23:08:04 2023 -0500 bcachefs: bch2_write_queue() Signed-off-by: Kent Overstreet commit 8f2bbcdd9bc8f9c0a2d4b6801d1dfeb20e28e954 Author: Kent Overstreet Date: Tue Feb 28 23:11:36 2023 -0500 bcachefs: ec: Improve error message for btree node in stripe Signed-off-by: Kent Overstreet commit 2f4e9472fa67ff528973f71729175c4c715b1912 Author: Kent Overstreet Date: Tue Feb 28 23:08:48 2023 -0500 bcachefs: bch2_open_bucket_to_text() Factor out a common helper Signed-off-by: Kent Overstreet commit 11bb67a4a31d9581a3148a75e023e680197f25fe Author: Kent Overstreet Date: Mon Feb 27 23:16:37 2023 -0500 bcachefs: bch2_data_update_init() considers ptr durability Signed-off-by: Kent Overstreet commit a64adedb8663ded044e535159b2e723a04396845 Author: Kent Overstreet Date: Mon Feb 27 22:30:54 2023 -0500 bcachefs: ec: Ensure new stripe is closed in error path This fixes a use-after-free bug. Signed-off-by: Kent Overstreet commit f3a65bb98b4612745cf2505734c78404344e2c9e Author: Kent Overstreet Date: Mon Feb 27 22:12:06 2023 -0500 bcachefs: Convert constants to consts Rust bindgen doesn't handle macros, but it does handle integer constants: this conversion aids in implementing safe Rust wrapper interfaces. Signed-off-by: Kent Overstreet commit 0f2ea6550f1fbfabbe2db276107246c1236018ab Author: Kent Overstreet Date: Mon Feb 27 21:26:07 2023 -0500 bcachefs: bch2_btree_iter_peek_and_restart_outlined() Needed for interfacing with Rust - bindgen can't handle inline functions, alas. Signed-off-by: Kent Overstreet commit 94bc95c468344d6a329dd87ab4461532584a7b71 Author: Kent Overstreet Date: Sun Feb 26 17:12:36 2023 -0500 bcachefs: ec: zero_out_rest_of_ec_bucket() Occasionally, we won't write to an entire bucket. This fixes the EC code to handle this case, zeroing out the rest of the bucket as needed. Signed-off-by: Kent Overstreet commit 039c45feef4f9a46aa0ee0b5ecfafdfd4c0dde76 Author: Kent Overstreet Date: Sun Feb 26 17:12:05 2023 -0500 bcachefs: bch2_data_update_index_update() -> bch2_trans_run() Convert to use the standard helper Signed-off-by: Kent Overstreet commit e07cb97460b9dd057c510e6d2294a29e72e60797 Author: Kent Overstreet Date: Sat Feb 25 05:22:37 2023 -0500 bcachefs: Flush write buffer as needed in backpointers repair Signed-off-by: Kent Overstreet commit 747ded6ddfe88eb9644ee0512c061e46fe2fb09d Author: Kent Overstreet Date: Sun Feb 26 15:48:39 2023 -0500 bcachefs: Fix for shared paths in write buffer flush It's possible for bch2_write_buffer_flush_one() to end up with a shared path, if called from a context that already has a btree iterator pointing to a key being flushed. We have to be careful when that happens, since we can't clone a path that holds write locks. Signed-off-by: Kent Overstreet commit 39a1ea129a6906a0d6127036222bdb68ec01a277 Author: Kent Overstreet Date: Sat Feb 25 00:32:34 2023 -0500 bcachefs: Single open_bucket_partial list Signed-off-by: Kent Overstreet commit 0d763863af0b1d70dcb64e515df4b9242bc9c28d Author: Kent Overstreet Date: Fri Feb 24 19:26:03 2023 -0500 bcachefs: Improve bch2_stripe_to_text() We now print pointers as bucket:offset, the same as how we print extent pointers. Signed-off-by: Kent Overstreet commit 33669e0cc94e9554cf162cbe2e63155887a10231 Author: Kent Overstreet Date: Fri Feb 24 19:07:21 2023 -0500 bcachefs: Add option for completely disabling nocow This adds an option for completely disabling nocow mode, including the locking in the data move path. Signed-off-by: Kent Overstreet commit 1a14e255100cb17cface9ca179ca7ddba87fd8b9 Author: Kent Overstreet Date: Fri Feb 24 19:06:32 2023 -0500 bcachefs: Make bucket_alloc tracepoint more readable Print bucket in dev:bucket notation, to be consistent with how we refer to buckets elsewhere. Signed-off-by: Kent Overstreet commit e9b70146545120f7d4bdba87eb8ec9a8f1669c7d Author: Kent Overstreet Date: Wed Feb 22 19:39:02 2023 -0500 bcachefs: Don't call bch2_trans_update() unlocked Signed-off-by: Kent Overstreet commit 70ded998c5abef9907b8d42a5118dddd3de67160 Author: Kent Overstreet Date: Wed Feb 22 19:28:58 2023 -0500 bcachefs: get_stripe_key_trans() Another nested btree_trans fix Signed-off-by: Kent Overstreet commit e3877382fb9d0a8ae43c7e012742622bbd6e6d17 Author: Kent Overstreet Date: Wed Feb 22 18:35:51 2023 -0500 bcachefs: Fix erasure coding shutdown path It's possible when shutting down to for a stripe head to have a new stripe that doesn't yet have any blocks allocated - we just need to free it. Signed-off-by: Kent Overstreet commit 64784ade4fd75cdd47d7ddfbfcbed3506fe10523 Author: Kent Overstreet Date: Wed Feb 22 17:57:59 2023 -0500 bcachefs: Fix buffer overrun in ec_stripe_update_extent() Signed-off-by: Kent Overstreet commit 43b0e8787ecb92760202c0682172141ed4b22c62 Author: Kent Overstreet Date: Tue Feb 21 23:51:19 2023 -0500 bcachefs: Check for redundant ec entries/stripe ptrs Signed-off-by: Kent Overstreet commit c9163bb03b81e465019cf56d2edf47b70798e3ee Author: Kent Overstreet Date: Tue Feb 21 19:22:44 2023 -0500 bcachefs: Cached pointers should not be erasure coded There's no reason to erasure code cached pointers: we'll always have another copy, and it'll be cheaper to read the other copy than do a reconstruct read. And erasure coded cached pointers would add complications that we'd rather not have to deal with, so let's make sure to disallow them. Signed-off-by: Kent Overstreet commit e094beccc139b1d2975563cdba0b661d14e6e06b Author: Kent Overstreet Date: Wed Feb 22 00:56:41 2023 -0500 bcachefs: Kill bch2_keylist_add_in_order() Dead code, so delete Signed-off-by: Kent Overstreet commit e151580d3072e7326732edcaf2a77ea423c695f5 Author: Kent Overstreet Date: Mon Feb 20 16:41:03 2023 -0500 bcachefs: Add tracepoint & counter for btree split race Signed-off-by: Kent Overstreet commit 930256d4fbe7b8dee8f1a1658630655d8c6043f8 Author: Kent Overstreet Date: Mon Feb 20 14:33:46 2023 -0500 bcachefs: __bch2_btree_insert uses BTREE_INSERT_CACHED Cached btrees should be doing cached updates by default: this fixes a bug in the migrate tool. Signed-off-by: Kent Overstreet commit 93bd2f877f221f05a1b51dcfac09d196c8bcda5c Author: Kent Overstreet Date: Mon Feb 20 14:34:38 2023 -0500 bcachefs: Improve a verbose log message We should be using bch2_err_str() where applicable. Signed-off-by: Kent Overstreet commit 9f6db1276c0c80b017f9278d6f081f20cecbeb33 Author: Kent Overstreet Date: Sun Feb 19 00:49:51 2023 -0500 bcachefs: bch2_journal_entries_postprocess() This brings back journal_entries_compact(), but in a more efficient form - we need to do multiple postprocess steps, so iterate over the journal entries being written just once to make it more efficient. Signed-off-by: Kent Overstreet commit 7546c78df1963c60b2b6b80265daa26462b87ec5 Author: Kent Overstreet Date: Sun Feb 19 00:43:10 2023 -0500 bcachefs: Fix ec repair code check Signed-off-by: Kent Overstreet commit 27616a31241e0625ee063f2cacd8c8e339b2de65 Author: Kent Overstreet Date: Sat Feb 18 22:11:50 2023 -0500 bcachefs: Simplify ec stripes heap Now that we have a separate data structure for tracking open stripes, the stripes heap can track all existing stripes, which is a nice simplification. Signed-off-by: Kent Overstreet commit 4b1e669995a6c19f1e1cc8a600101edf7fe9277e Author: Kent Overstreet Date: Sat Feb 18 21:07:25 2023 -0500 bcachefs: Erasure coding: Track open stripes This adds a new hash table for stripes being created or updated, instead of hackily relying on the stripes heap. This lets us reserve the slot for the new stripe up front, at the same time as we would pick an existing stripe - if we were updating an existing stripe - making the overall code more consistent. Signed-off-by: Kent Overstreet commit ba7c37d330816bcc10c55c8eaab268afca2447e8 Author: Kent Overstreet Date: Sat Feb 18 21:31:07 2023 -0500 bcachefs: Stripe deletion now checks what it's deleting Signed-off-by: Kent Overstreet commit ebe8bd75a073c303e695589c11f298fcc3a1fb1c Author: Kent Overstreet Date: Sat Feb 18 21:10:13 2023 -0500 bcachefs: Improve c->writes refcounting for stripe create path This makes our handling of c->writes more consistent with other asynchronous work items. Signed-off-by: Kent Overstreet commit 627a231239e050e70cf55a9eec316a8270a2fd63 Author: Kent Overstreet Date: Sat Feb 18 20:49:37 2023 -0500 bcachefs: Switch ec_stripes_heap_lock to a mutex Signed-off-by: Kent Overstreet commit 5e2d8be8bd7985aa590dcccec14fb38fb529b3f0 Author: Kent Overstreet Date: Sat Feb 18 21:20:18 2023 -0500 bcachefs: Split trans->last_begin_ip and trans->last_restarted_ip These are two different things - this improves our debug assert messages. Signed-off-by: Kent Overstreet commit 73d86dfd888541fd85f7e4d03c898f2ad8486196 Author: Kent Overstreet Date: Fri Feb 17 22:43:47 2023 -0500 bcachefs: Fix erasure coding locking This adds a new helper, bch2_trans_mutex_lock(), for locking a mutex - dropping and retaking btree locks as needed. Signed-off-by: Kent Overstreet commit af0ee5bcf3012be753ab15ce9c27971e5b34bd74 Author: Kent Overstreet Date: Fri Feb 17 21:04:46 2023 -0500 bcachefs: Don't block on ec_stripe_head_lock with btree locks held Signed-off-by: Kent Overstreet commit 6623c0fcdffe22db466ec38c5f9f4b3a44c33003 Author: Kent Overstreet Date: Fri Feb 17 20:51:52 2023 -0500 bcachefs: Add an assertion for using multiple btree_trans A thread should never be using more than one btree_trans - doing so is an invitation for deadlocks. Signed-off-by: Kent Overstreet commit 2c7dd446d91681e90396c82e20c703b93f8daa2f Author: Kent Overstreet Date: Fri Feb 17 20:50:55 2023 -0500 bcachefs: Erasure coding now uses bch2_bucket_alloc_trans This code predates plumbing btree_trans through the bucket allocation path: switching to it fixes a deadlock due to using multiple btree_trans at the same time, which we never want to do. Signed-off-by: Kent Overstreet commit 84ddb8b98e674c0d052dd56a406efc5275c9508a Author: Kent Overstreet Date: Fri Feb 17 20:33:12 2023 -0500 bcachefs: Don't invalidate open buckets Like bch2_trans_mark_bucket(), we shouldn't be incrementing a bucket gen while it's still open - erasure coding was hitting this. Signed-off-by: Kent Overstreet commit 80c33085783656617d0d07e1bc9fba70a592ce5c Author: Kent Overstreet Date: Mon Dec 5 10:24:19 2022 -0500 bcachefs: Fragmentation LRU Now that we have much more efficient updates to the LRU btree, this patch adds a new LRU that indexes buckets by fragmentation. This means copygc no longer has to scan every bucket to find buckets that need to be evacuated. Changes: - A new field in bch_alloc_v4, fragmentation_lru - this corresponds to the bucket's position in the fragmentation LRU. We add a new field for this instead of calculating it as needed because we may make the fragmentation LRU optional; this field indicates whether a bucket is on the fragmentation LRU. Also, zoned devices will introduce variable bucket sizes; explicitly recording the LRU position will be safer for them. - A new copygc path for using the fragmentation LRU instead of scanning every bucket and building up an in-memory heap. Signed-off-by: Kent Overstreet commit 1b30ed5fd87828b5e29647510eefb18a363e4d19 Author: Kent Overstreet Date: Mon Feb 6 18:51:42 2023 -0500 bcachefs: Use btree write buffer for LRU btree Signed-off-by: Kent Overstreet commit f2c6e4b3621778103805fe4d5f384db3fcd96159 Author: Kent Overstreet Date: Fri Feb 17 16:06:51 2023 -0500 bcachefs: Fix integer overflow warnings on 32 bit Signed-off-by: Kent Overstreet commit f2a53270c7d6bceae5441ed180516d3b76799680 Author: Kent Overstreet Date: Thu Feb 16 23:42:09 2023 -0500 bcachefs: Fix insert_snapshot_whiteouts() - We were failing to set the key type on the whiteouts it was creating, oops. - Also, we need to create whiteouts when generating front splits, not just back splits. Signed-off-by: Kent Overstreet commit 19d6521964ed0439a7a03776d8cf0451afb63c1d Author: Kent Overstreet Date: Fri Feb 17 00:39:12 2023 -0500 bcachefs: bch2_mark_snapshot() now called like other triggers This fixes a bug where bch2_mark_snapshot() wasn't called for existing snapshot nodes being updated when child nodes were added. This led to the data update path thinking the key being updated was for a snapshot that didn't have children, causing it to fail to insert whiteouts when splitting existing extents. Signed-off-by: Kent Overstreet commit 2ffe3ad62dafac036c523204c6e2e2f39b23cb6f Author: Kent Overstreet Date: Thu Feb 16 23:36:41 2023 -0500 bcachefs: Snapshot whiteout fix When fully overwriting an existing extent, we may need to generate a whiteout - not just if the extent being overwritten was in an older snapshot, but also if it was overwriting an extent in an older snapshot. Signed-off-by: Kent Overstreet commit c58029ec807594856ae69dd7864eb7b3afb92f4a Author: Daniel Hill Date: Sun May 8 15:03:28 2022 +1200 bcachefs: Reimplement repair for overlapping extents Repair now checks if overlapping extents exist in the same snapshot and calls update_trans_update_extent to do the repair work. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 9c5d38bba034253dace198e5801dc7bad6fb8c7e Author: Kent Overstreet Date: Thu Feb 16 21:02:14 2023 -0500 bcachefs: Don't print out duplicate fsck errors Signed-off-by: Kent Overstreet commit 2798143aa8eb796be19775dcb5ae3927bf983730 Author: Kent Overstreet Date: Thu Feb 16 23:09:27 2023 -0500 bcachefs: bch2_btree_insert_nonextent() This adds a new helper to delete some redundant code in bch2_trans_update_extent(). Signed-off-by: Kent Overstreet commit 564fbd9dd6329abde8aca143da26ffbada13ff7d Author: Kent Overstreet Date: Fri Feb 17 15:36:46 2023 -0500 bcachefs: Fix a 64 bit divide This fixes a build failure on 32 bit Signed-off-by: Kent Overstreet commit 0cc1bc84d69138531d8a5e163caa57dfacd58cf2 Author: Kent Overstreet Date: Wed Feb 15 18:29:16 2023 -0500 six locks: Simplify six_lock_counts() Signed-off-by: Kent Overstreet commit 70f0b0fd7e9b85a14fdb8b3f229572b7439d8915 Author: Kent Overstreet Date: Mon Feb 13 18:21:40 2023 -0500 bcachefs: Fix verify_update_old_key() This fixes a very-rare race in our assertion, with needs_whiteout being modified in the btree key. Signed-off-by: Kent Overstreet commit 3ea4219d9894130008d723fb9e9c24290d4a42b6 Author: Kent Overstreet Date: Sun Feb 12 23:15:53 2023 -0500 bcachefs: New backtrace utility code Signed-off-by: Kent Overstreet commit 429dd4270fab3c88a8bfcb5b2b8c6d60ec6a1f2a Author: Kent Overstreet Date: Sun Feb 12 22:42:31 2023 -0500 bcachefs: Fix verify_bucket_evacuated() This fixes an incorrectly handled transaction restart. Signed-off-by: Kent Overstreet commit 4bd4035e64c2a90b9c939135e95be0106205b370 Author: Kent Overstreet Date: Sun Feb 12 22:08:39 2023 -0500 bcachefs: Handle sb buffer resizing in __copy_super() This fixes a rare buffer overrun when one field is growing and another field is shrinking - and is a nice simplification as well. Signed-off-by: Kent Overstreet commit 806c8a6aa83410cf78dc13fc63bb5df6352670f2 Author: Kent Overstreet Date: Sun Feb 12 19:24:34 2023 -0500 bcachefs: Fix failure to read btree roots If failed to read a btree root - or if we're not using a btree root, because of the reconstruct_alloc option - make sure we update the corresponding info for the key/level for the root on disk. Signed-off-by: Kent Overstreet commit 3277081522d8620f7410b173881d4b0267ce58f9 Author: Daniel Hill Date: Sun Feb 12 15:51:45 2023 +1300 bcachefs: Don't run triggers when repairing in __bch2_mark_reflink_p() Triggers current trip-up on the faulty reflink we're trying to repair, Disabling them lets us fix broken reflink and continue. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 8ffa11a2c523b49836ca05f8755e22a4607d86a7 Author: Daniel Hill Date: Fri Jan 20 01:27:30 2023 +1300 bcachefs: let __bch2_btree_insert() pass in flags This patch is prep work for the following patch. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 76966dbfa9eb4a723cb899ba07f55448e5b21bbe Author: Kent Overstreet Date: Sat Feb 11 16:53:59 2023 -0500 bcachefs: Improve locking in __bch2_set_nr_journal_buckets() This refactors to not call bch2_journal_block() with c->sb_lock held. Signed-off-by: Kent Overstreet commit c1f59ef6d00940f22fa5e88d1d7705c85ec6d118 Author: Kent Overstreet Date: Sat Feb 11 19:31:03 2023 -0500 bcachefs: More info on check_bucket_ref() error Signed-off-by: Kent Overstreet commit 930c0c4cefede8532765cc4f74ec3ff05dc1db15 Author: Kent Overstreet Date: Sat Feb 11 19:30:41 2023 -0500 bcachefs: Add missing include Signed-off-by: Kent Overstreet commit a1f26d700aa51fc942ca07ee501b9117075c84e0 Author: Kent Overstreet Date: Sat Feb 11 12:57:04 2023 -0500 bcachefs: Handle btree node rewrites before going RW Signed-off-by: Kent Overstreet commit 09d70d0be1d5670a9df24656c5e429ab4f239c16 Author: Kent Overstreet Date: Sat Feb 11 12:38:28 2023 -0500 bcachefs: Nocow locking fixup Signed-off-by: Kent Overstreet commit 12795a1937460020af999e3cf54c146598402455 Author: Kent Overstreet Date: Fri Feb 10 15:47:46 2023 -0500 bcachefs: Add some logging for btree node rewrites due to errors Signed-off-by: Kent Overstreet commit 637de729fc86effe021bd067cccd68efd07f59c0 Author: Kent Overstreet Date: Thu Nov 11 15:50:22 2021 -0500 bcachefs: Ensure btree node cache is not more than half dirty Tweak journal reclaim to ensure the btree node cache isn't more than half dirty so that memory reclaim can always make progress - the same as we do for the btree key cache. Signed-off-by: Kent Overstreet commit c782c5832e9251ab6f4df837932d959f3e02ab25 Author: Kent Overstreet Date: Mon Jan 9 01:45:18 2023 -0500 bcachefs: Add max nr of IOs in flight to the move path Signed-off-by: Kent Overstreet commit 01efebd8f13c41341754a2f0b431aa81209f8f30 Author: Kent Overstreet Date: Thu Jan 26 13:36:30 2023 -0500 bcachefs: Add an assert to bch2_bucket_nocow_unlock() Signed-off-by: Kent Overstreet commit 3482dd6a250397fe1dc088a16bc9e50d72f217e6 Author: Daniel Hill Date: Fri Jan 6 21:11:07 2023 +1300 bcachefs: don't block reads if we're promoting The promote path calls data_update_init() and now that we take locks here, there's potential for promote to block our read path, just error when we can't take the lock instead of blocking. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 0093b9e9704cc932363c66b2b072b762771ffe1f Author: Kent Overstreet Date: Thu Jan 5 03:55:23 2023 -0500 bcachefs: Fix promote path leak Signed-off-by: Kent Overstreet commit 629a21b621c466deac6e7ce20242308091f09735 Author: Kent Overstreet Date: Tue Jan 3 23:54:10 2023 -0500 bcachefs: Improve invalidate_one_bucket() error messages Make sure to check for lru entries that point to buckets that don't exist as well as buckets in the wrong state, and improve the error message we print out. Signed-off-by: Kent Overstreet commit 46eea9cb9ec14684d1b6e90c17db1ac896f26a5b Author: Kent Overstreet Date: Tue Jan 3 23:39:42 2023 -0500 bcachefs: Fix move_ctxt_wait_event() We shouldn't be evaluating cond again if it already returned true. This fixes a bug when this helper is used for taking nocow locks. Signed-off-by: Kent Overstreet commit 7ffb6a7ec6712eb1ba84a80137c2f712e67c4171 Author: Kent Overstreet Date: Mon Jan 2 17:53:02 2023 -0500 bcachefs: Fix deadlock on nocow locks in data move path The recent nocow locking rework introduced a deadlock in the data move path: the new nocow locking scheme uses a hash table with a fixed size array for chaining, meaning on hash collision we may have to wait for other locks to be released before we can lock a bucket. And since the data move path needs to submit writes from the same thread that's taking nocow locks and submitting reads, this introduces a deadlock. This shouldn't happen often in practice, but since the data move path can keep large numbers of IOs in flight simultaneously, it's something we have to handle. This patch makes move_ctxt_wait_event() available to bch2_data_update_init() and uses it when appropriate, which is our normal solution to this kind of thing. Signed-off-by: Kent Overstreet commit dbe17f18838df6d0facf51b43cdc5efd372c28d6 Author: Kent Overstreet Date: Tue Dec 20 20:00:34 2022 -0500 bcachefs: BKEY_INVALID_FROM_JOURNAL Signed-off-by: Kent Overstreet commit facafdcbc157686311dbe58649ef9d29fcf8e610 Author: Kent Overstreet Date: Tue Dec 20 19:58:16 2022 -0500 bcachefs: Change bkey_invalid() rw param to flags Signed-off-by: Kent Overstreet commit 83f33d686553c5105ff36da4dd554c34125094e9 Author: Kent Overstreet Date: Mon Dec 5 16:49:13 2022 -0500 bcachefs: Rework lru btree This patch changes how the LRU index works: Instead of using KEY_TYPE_lru where the bucket the lru entry points to is part of the value, this switches to KEY_TYPE_set and encoding the bucket we refer to in the low bits of the key. This means that we no longer have to check for collisions when inserting LRU entries. We'll be making using of this in the next patch, which adds a btree write buffer - a pure write buffer for btree updates, where updates are appended to a simple array and then periodically sorted and batch inserted. This is a new on disk format version, and a forced upgrade. Signed-off-by: Kent Overstreet commit 350175bf9b0fe5da12a2fd8bfd453a49f038ceb4 Author: Kent Overstreet Date: Wed Dec 14 20:52:11 2022 -0500 bcachefs: Improved nocow locking This improves the nocow lock table so that hash table entries have multiple locks, and locks specify which bucket they're for - i.e. we can now resolve hash collisions. This is important because the allocator has to skip buckets that are locked in the nocow lock table, and previously hash collisions would cause it to spuriously skip unlocked buckets. Signed-off-by: Kent Overstreet commit f3a37e76cade1469871c4309584ebbc358becf40 Author: Daniel Hill Date: Fri Dec 9 12:37:56 2022 +1300 bcachefs: handle failed data_update_init cleanup data_update_init allocates several resources, but we forget to clean these up when it fails. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 71fe14655f49f717b06d92192f2492c22da6b3af Author: Daniel Hill Date: Wed Dec 7 18:41:21 2022 +1300 bcachefs: expose nocow_lock table in sysfs Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 5250b74d55e16246a47bdcf1182b7469e28e0652 Author: Kent Overstreet Date: Fri Nov 25 23:14:30 2022 -0500 bcachefs: bucket_gens btree To improve mount times, add a btree for just bucket gens, 256 of them per key: this means we'll have to scan drastically less metadata at startup. This adds - trigger for keeping it in sync with the all btree - initialization code, for filesystems from previous versions - new path for reading bucket gens - new fsck code And a new on disk format version. Signed-off-by: Kent Overstreet commit 19fe87e00b6a601b2ec8251d0231f4c9b3bb5002 Author: Kent Overstreet Date: Wed Nov 23 12:22:39 2022 -0500 bcachefs: Inline bch2_two_state_(trylock|unlock) Standard inlining of fast paths - these locks are now used by our new nocow mode. Signed-off-by: Kent Overstreet commit a8b3a677e786fa869d220a6a78b5532a36dc2f4d Author: Kent Overstreet Date: Wed Nov 2 17:12:00 2022 -0400 bcachefs: Nocow support This adds support for nocow mode, where we do writes in-place when possible. Patch components: - New boolean filesystem and inode option, nocow: note that when nocow is enabled, data checksumming and compression are implicitly disabled - To prevent in-place writes from racing with data moves (data_update.c) or bucket reuse (i.e. a bucket being reused and re-allocated while a nocow write is in flight, we have a new locking mechanism. Buckets can be locked for either data update or data move, using a fixed size hash table of two_state_shared locks. We don't have any chaining, meaning updates and moves to different buckets that hash to the same lock will wait unnecessarily - we'll want to watch for this becoming an issue. - The allocator path also needs to check for in-place writes in flight to a given bucket before giving it out: thus we add another counter to bucket_alloc_state so we can track this. - Fsync now may need to issue cache flushes to block devices instead of flushing the journal. We add a device bitmask to bch_inode_info, ei_devs_need_flush, which tracks devices that need to have flushes issued - note that this will lead to unnecessary flushes when other codepaths have already issued flushes, we may want to replace this with a sequence number. - New nocow write path: look up extents, and if they're writable write to them - otherwise fall back to the normal COW write path. XXX: switch to sequence numbers instead of bitmask for devs needing journal flush XXX: ei_quota_lock being a mutex means bch2_nocow_write_done() needs to run in process context - see if we can improve this Signed-off-by: Kent Overstreet commit 4dcd1cae72912ab08d313ee5a730608022b211d4 Author: Kent Overstreet Date: Mon Nov 14 01:31:10 2022 -0500 bcachefs: Data update support for unwritten extents The data update path requires special support for unwritten extents - we still need to be able to move them, but there's no need to read or write anything. This patch adds a new error code to tell bch2_move_extent() that we're short circuiting the read, and adds bch2_update_unwritten_extent() to create a reservation then call __bch2_data_update_index_update(). Signed-off-by: Kent Overstreet commit 792031116bee35e13be7c8ae8cf1b8eec141b136 Author: Kent Overstreet Date: Sun Nov 13 18:59:01 2022 -0500 bcachefs: Unwritten extents support - bch2_extent_merge checks unwritten bit - read path returns 0s for unwritten extents without actually reading - reflink path skips over unwritten extents - bch2_bkey_ptrs_invalid() checks for extents with both written and unwritten extents, and non-normal extents (stripes, btree ptrs) with unwritten ptrs - fiemap checks for unwritten extents and returns FIEMAP_EXTENT_UNWRITTEN Signed-off-by: Kent Overstreet commit 2f1f7fe98d1da65c5ef646a90770b17cb012f1ee Author: Kent Overstreet Date: Mon Nov 14 23:41:18 2022 -0500 bcachefs: bch2_extent_update_i_size_sectors() In the io path, when we do the extent update we also have to update the inode - for i_size and i_sectors updates, as well as for bi_journal_seq for fsync. This factors that out into a new helper which will be used in the new nocow mode, in the unwritten extent conversion path. Signed-off-by: Kent Overstreet commit 70de7a47e2c56adbd76c24c80e95cf2203a9e74f Author: Kent Overstreet Date: Sun Nov 13 18:54:37 2022 -0500 bcachefs: bch2_extent_fallocate() This factors out part of __bchfs_fallocate() in fs-io.c into an new, lower level io.c helper, which creates a single extent reservation. This is prep work for nocow support - the new helper will shortly gain the ability to create unwritten extents. Signed-off-by: Kent Overstreet commit 9bcbc0307d9cbaae5836a8051c91b468fe1571c9 Author: Kent Overstreet Date: Fri Oct 21 13:42:38 2022 -0400 bcachefs: Skip inode unpack/pack in bch2_extent_update() This takes advantage of the new inode type to skip the expensive pack/unpack when inode updates are required in the extent update path. Additionally, we now skip the inode update entirely when i_sectors and i_size aren't changing. Signed-off-by: Kent Overstreet commit b08b492ed3068b80122bb58476baeacad2d0fa4c Author: Kent Overstreet Date: Mon Nov 8 12:30:47 2021 -0500 bcachefs: Drop old maybe_extending optimization The extend update path had an optimization to avoid updating the inode if we knew we were definitely not extending the file. But now that we're updating inodes on every extent update - for fsync - that code can be deleted. Signed-off-by: Kent Overstreet commit 8dd69d9f64e92529037550c97a07b1b78296e92c Author: Kent Overstreet Date: Fri Oct 21 13:21:03 2022 -0400 bcachefs: KEY_TYPE_inode_v3, metadata_version_inode_v3 Move bi_size and bi_sectors into the non-varint portion of the inode, so that the write path can update them without going through the relatively expensive unpack/pack operations. Other changes: - Add a field for the offset of the varint section, so we can add new non-varint fields without needing a new inode type, like alloc_v3 - Move bi_mode into the flags field, so that the varint section can be u64 aligned Signed-off-by: Kent Overstreet commit 47b323a0b0612c5310c35935a40012125a3e18b8 Author: Kent Overstreet Date: Thu Jan 19 03:37:44 2023 -0500 bcachefs: Start snapshots before bch2_gc() bch2_gc may require snapshots to be started - the repair path when checking the reflink btree may do updates to the extents btree. This moves bch2_fs_initialize_subvolumes() and bch2_fs_snapshots_start() to before bch2_gc() - since we haven't gone RW yet, the updates in bch2_fs_initialize_subvolumes() are done via the journal replay keys list, so it's fine to do this before bch2_gc(). Signed-off-by: Kent Overstreet commit d23124c757490641c2ec8281d54079aea3f3a7ad Author: Kent Overstreet Date: Wed Nov 30 13:25:17 2022 -0500 bcachefs: Improve bch2_check_alloc_info() This factors out a new helper from bch2_dev_freespace_init(), bch2_get_key_or_hole(), and uses it in bch2_check_alloc_info(): we're now able to process holes in the alloc btree as ranges, instead of one bucket at a time. This will improve fsck performance on new filesystems, or filesystems where not every bucket has been used yet. Signed-off-by: Kent Overstreet commit cc65f5659941a4d30608b47c3edfadb5e0e7b02e Author: Kent Overstreet Date: Sat Nov 26 04:37:11 2022 -0500 bcachefs: Improve bch2_dev_freespace_init() This makes bch2_dev_freespace_init() much faster: instead of processing every bucket on the device one at a time, we handle ranges of missing keys all at once: the freespace btree is an extents style btree, so we only have to insert one freespace key for every range of missing keys in the alloc btree. Signed-off-by: Kent Overstreet commit 7c057d35098613b2936c361aa8289590fef987ba Author: Kent Overstreet Date: Sun Feb 12 14:25:59 2023 -0500 fixup bcachefs: New on disk format: Backpointers Signed-off-by: Kent Overstreet commit 53b1c6f44b1a98ea6def11b74c1fde9710f2a0b9 Author: Kent Overstreet Date: Fri Oct 14 07:02:36 2022 -0400 bcachefs: Don't use key cache during fsck The btree key cache mainly helps with lock contention, at the cost of additional memory overhead. During some fsck passes the memory overhead really matters, but fsck is single threaded so lock contention is an issue - so skipping the key cache during fsck will help with performance. Signed-off-by: Kent Overstreet commit b32f9a577b8d532d31ee7d71e58d1ec512a25a9a Author: Kent Overstreet Date: Wed Sep 28 10:06:10 2022 -0400 bcachefs: Run check_extents_to_backpointers() in multiple passes Similer to the previous patch for check_backpointers_to_extents(), if the alloc + backpointers btrees do not fit in ram we need to run into multiple passes. The counting of btree nodes that fit in memory is different here, because we have to walk the alloc and backpointers btrees at the same time, since a backpointer could reside in either of them and we don't know which without checking both. Signed-off-by: Kent Overstreet commit 23792a712d29ee8adc6f5c165e61e8624838169d Author: Kent Overstreet Date: Sun Oct 9 22:18:06 2022 -0400 bcachefs: Run bch2_check_backpointers_to_extents() in multiple passes if necessary When the extents + reflink btrees don't fit into memory this fsck pass becomes _much_ slower, since we're doing random lookups. This patch changes this pass to check how much of the relevant btrees will fit into memory, and run in multiple passes if needed. Signed-off-by: Kent Overstreet commit 15949c549993a2383ebacf6c563b85722278fba3 Author: Kent Overstreet Date: Sun Oct 9 04:26:06 2022 -0400 bcachefs: Don't stop copygc while removing devices With the new backpointer based copygc we don't need an explicit copygc reserve, we're always evacuating buckets one at a time - so this is no longer needed, and in fact removing it fixes a deadlock in bch2_dev_allocator_remove(). Signed-off-by: Kent Overstreet commit c9828cea312e83f3f17f4a80990f91739ff33d06 Author: Kent Overstreet Date: Sun Oct 9 00:47:18 2022 -0400 bcachefs: Delete in memory ec backpointers Post btree backpointers, these aren't needed anymore. Signed-off-by: Kent Overstreet commit dea5647e16d15ee7c47dbe11b1f68ec221dc51be Author: Kent Overstreet Date: Sun Oct 9 00:29:51 2022 -0400 bcachefs: Erasure coding now uses backpointers This is only a start to updating erasure coding for backpointers - it's still not working yet. The subsequent patch will delete our old in memory backpointers for copygc, and this fixes a spurious EPERM bug/error message. Signed-off-by: Kent Overstreet commit 8e3f913e2ab6ac2cb9e75a0a8635d0b44f838c33 Author: Kent Overstreet Date: Fri Mar 18 00:42:09 2022 -0400 bcachefs: Copygc now uses backpointers Previously, copygc needed to walk the entire extents & reflink btrees to find extents that needed to be moved. Now that we have backpointers, this patch implements bch2_evacuate_bucket() in the move code, which copygc now uses for evacuating mostly empty buckets. Also, thanks to the new backpointers code, copygc can now move btree nodes. Signed-off-by: Kent Overstreet commit a8c752bb1d93a24a0de753e209d4f4d58d65c878 Author: Kent Overstreet Date: Thu Mar 17 20:51:27 2022 -0400 bcachefs: New on disk format: Backpointers This patch adds backpointers: we now have a reverse index from device and offset on that device (specifically, offset within a bucket) back to btree nodes and (non cached) data extents. The first 40 backpointers within a bucket are stored in the alloc key; after that backpointers spill over to the next backpointers btree. This is to help avoid performance regressions from additional btree updates on large streaming workloads. This patch adds all the code for creating, checking and repairing backpointers. The next patch in the series is going to use backpointers for copygc - finally getting rid of the need to scan all extents to do copygc. Signed-off-by: Kent Overstreet commit 920e69bc3db88d3825c69190cafd43f0a1918d3b Author: Kent Overstreet Date: Wed Jan 4 00:00:50 2023 -0500 bcachefs: Btree write buffer This adds a new method of doing btree updates - a straight write buffer, implemented as a flat fixed size array. This is only useful when we don't need to read from the btree in order to do the update, and when reading is infrequent - perfect for the LRU btree. This will make LRU btree updates fast enough that we'll be able to use it for persistently indexing buckets by fragmentation, which will be a massive boost to copygc performance. Changes: - A new btree_insert_type enum, for btree_insert_entries. Specifies btree, btree key cache, or btree write buffer. - bch2_trans_update_buffered(): updates via the btree write buffer don't need a btree path, so we need a new update path. - Transaction commit path changes: The update to the btree write buffer both mutates global, and can fail if there isn't currently room. Therefore we do all write buffer updates in the transaction all at once, and also if it fails we have to revert filesystem usage counter changes. If there isn't room we flush the write buffer in the transaction commit error path and retry. - A new persistent option, for specifying the number of entries in the write buffer. Signed-off-by: Kent Overstreet commit f2b542ba42a8b35d9dc43f5eab9791fea76bfd3a Author: Kent Overstreet Date: Sun Dec 11 19:14:30 2022 -0500 bcachefs: Go RW before check_alloc_info() It's possible to do btree updates before going RW by adding them to the list of updates for journal replay to do, but this is limited by what fits in RAM. This patch switches the second alloc info phase to run after going RW - btree_gc has already ensured the alloc btree itself is correct - and tweaks the allocation path to deal with the potential small inconsistencies. Signed-off-by: Kent Overstreet commit 5f5c74661713327309f124e247de61db6729bc3d Author: Kent Overstreet Date: Mon Oct 17 04:51:58 2022 -0400 bcachefs: Start copygc when first going read-write In the distant past, it wasn't possible to start copygc until after journal replay had finished. Now, the btree iterator code overlays keys from the journal, so there's no reason not to start it earlier - and it solves a rare deadlock. Signed-off-by: Kent Overstreet commit 30ca6ece88f2d11647c3854faf0dce528c32d5cf Author: Kent Overstreet Date: Thu Feb 9 13:22:12 2023 -0500 bcachefs: Kill trans->flags Recursive transaction commits are occasionally necessary - in particular, for the upcoming btree write buffer's flush path. This avoids bugs due to trans->flags being accidentally mutated mid-commit, which can cause c->writes refcount leaks. Signed-off-by: Kent Overstreet commit 60b5538877a2d34396280615484b995911e09b69 Author: Kent Overstreet Date: Thu Feb 9 14:48:54 2023 -0500 bcachefs: trans->notrace_relock_fail When we unlock in order to submit IO, the next relock event is likely to fail if submit_bio() blocked - we shouldn't those events in our _fail stats, since those are expected events and shouldn't cause test failures. Signed-off-by: Kent Overstreet commit d94189ad568f6cbd80d372cf7aa6e4898b6c5c17 Author: Kent Overstreet Date: Thu Feb 9 12:21:45 2023 -0500 bcachefs: Debug mode for c->writes references This adds a debug mode where we split up the c->writes refcount into distinct refcounts for every codepath that takes a reference, and adds sysfs code to print the value of each ref. This will make it easier to debug shutdown hangs due to refcount leaks. Signed-off-by: Kent Overstreet commit dd81a060eb0680e09d133b81db54b90442c32b5e Author: Kent Overstreet Date: Thu Feb 9 12:22:58 2023 -0500 bcachefs: ec_stripe_delete_work() now takes ref on c->writes Signed-off-by: Kent Overstreet commit 06ab86d596170b9f3b88ce3f8e9fea7e9c1ea0c2 Author: Kent Overstreet Date: Thu Feb 9 21:13:37 2023 -0500 bcachefs: Fix btree_node_write_blocked() not being cleared The btree_node_write_blocked bit was a later addition to this code, it only mirrors the state of the b->write_blocked list (empty or nonempty) - unfortunately, when it was added it wasn't correctly kept in sync - oops. Signed-off-by: Kent Overstreet commit 434b1c75a4e79ee63cd58225567f752311cf3cd0 Author: Kent Overstreet Date: Thu Feb 9 15:49:25 2023 -0500 bcachefs: Switch a BUG_ON() to a panic() This assert is popping - rarely - in the CI, this will help us track it down from the logs. Signed-off-by: Kent Overstreet commit 992fa4e62020d257197efa4ec567499d52e9c381 Author: Kent Overstreet Date: Wed Feb 8 18:04:22 2023 -0500 bcachefs: Fix btree_path_alloc() We need to call bch2_trans_update_max_paths() before marking the new path as allocated, since we're not initializing it yet. Signed-off-by: Kent Overstreet commit d7afe651ffa29fca79725a3cf5580a3fd2421fed Author: Brett Holman Date: Fri Feb 10 16:36:55 2023 -0700 bcachefs: Fix memleak in replicas_table_update() Signed-off-by: Brett Holman Signed-off-by: Kent Overstreet commit c72f687a1ff1801b404fab804fdddcaf034e6ef4 Author: Kent Overstreet Date: Tue Oct 11 04:32:41 2022 -0400 bcachefs: Use for_each_btree_key_upto() more consistently It's important that in BTREE_ITER_FILTER_SNAPSHOTS mode we always use peek_upto() and provide an end for the interval we're searching for - otherwise, when we hit the end of the inode the next inode be in a different subvolume and not have any keys in the current snapshot, and we'd iterate over arbitrarily many keys before returning one. Signed-off-by: Kent Overstreet commit 5b3008bc6182e56fdd5ba36fdf324430d0792e0c Author: Kent Overstreet Date: Thu Mar 2 23:51:47 2023 -0500 bcachefs: Don't call bch2_journal_pin_drop() under key cache lock This fixes a (harmless) lockdep splat, due to a lock order violation in the key cache exit path. Signed-off-by: Kent Overstreet commit 91db80668149a4eb19ab3bfcfecf9f09ad1f2c8f Author: Kent Overstreet Date: Sun Feb 5 14:09:30 2023 -0500 six locks: Improved optimistic spinning This adds a threshold for the maximum spin time, similar to the rwsem code, and a flag to the lock itself indicating when we've spun too long so other threads also refrain from spinning. Signed-off-by: Kent Overstreet commit 94c69fafa7081d84be89ba1067558be39b4ea44b Author: Kent Overstreet Date: Sat Feb 4 19:39:59 2023 -0500 bcachefs: Use six_lock_ip() This uses the new _ip() interface to six locks and hooks it up to btree_path->ip_allocated, when available. Signed-off-by: Kent Overstreet commit f746c62ca5d02f43d92c9666ffd3dab01f1972ff Author: Kent Overstreet Date: Sat Feb 4 19:38:43 2023 -0500 six locks: Expose tracepoint IP This adds _ip variations of the various lock functions that allow an IP to be passed in, which is used by lockstat. Signed-off-by: Kent Overstreet commit 12344c7cb966e1dbcb213ad1507c2ef3932790a3 Author: Kent Overstreet Date: Wed Feb 1 16:15:51 2023 -0500 bcachefs: bch2_trans_in_restart_error() This replaces various BUG_ON() assertions with panics that tell us where the restart was done and the restart type. Signed-off-by: Kent Overstreet commit 2e98404000e9c48c235c234bd179bb1acbf4c4e2 Author: Kent Overstreet Date: Wed Feb 1 15:45:45 2023 -0500 bcachefs: Improve btree node read error path This ensures that failure to read a btree node error is treated as a topology error, and returns the correct error so that the topology repair pass will be run. Signed-off-by: Kent Overstreet commit 464b415539cc543addb45b85e76c44da145b114c Author: Kent Overstreet Date: Sun Feb 5 14:07:34 2023 -0500 bcachefs: Fix bch2_trans_reset_updates() This should have been resetting trans->fs_usage_deltas as well. Signed-off-by: Kent Overstreet commit 4e3d18991a7d1138604f0975e7849d9a2d82c524 Author: Kent Overstreet Date: Sat Feb 4 20:40:29 2023 -0500 bcachefs: Inline bch2_btree_path_traverse() fastpath Signed-off-by: Kent Overstreet commit 419fc65f8cfbadb29b2024457bf914787af8db91 Author: Kent Overstreet Date: Wed Feb 1 16:46:42 2023 -0500 bcachefs: Fix hash_check_key() On hash collision when we have to check for duplicates or incorrect hash value, we weren't specifying a snapshot ID to iterate with. Signed-off-by: Kent Overstreet commit b8c5b16f970b32a5b8e8d75a9e4b96041db73d43 Author: Kent Overstreet Date: Wed Jan 25 12:16:23 2023 -0500 bcachefs: Don't emit tracepoints for expected events Signed-off-by: Kent Overstreet commit 3e57db65cdd93bee55d1ecf53ff4ab895e05c40e Author: Kent Overstreet Date: Wed Jan 25 10:18:32 2023 -0500 bcachefs: Use trylock in bch2_prt_backtrace() Easy workaround for a lockdep splat - and since bch2_prt_backtrace() is only used in debug code this is fine. Signed-off-by: Kent Overstreet commit 01ad673727b59664c9d12df4e5b6f5bad1ea2825 Author: Kent Overstreet Date: Wed Nov 23 20:14:55 2022 -0500 bcachefs: bch2_inode_opts_get() This improves io_opts() and makes it a non-inline function - it's big enough that it probably shouldn't be. Also, bch_io_opts no longer needs fields for whether options are defined, so we can slim it down a bit. We'd like to stop passing around the full bch_io_opts, but that'll be tricky because of bch2_rebalance_add_key(). Signed-off-by: Kent Overstreet commit f52dd1ae20ac8094eb881f816e7274d3f7910a84 Author: Kent Overstreet Date: Mon Dec 19 15:55:38 2022 -0500 bcachefs: Fix bch_alloc_to_text() We weren't guarding against the alloc key having an invalid data type. Signed-off-by: Kent Overstreet commit 393a1f6863790fddf8b53bfb81f2c984cdbc1990 Author: Kent Overstreet Date: Thu Nov 24 18:03:55 2022 -0500 bcachefs: Better inlining in core write path Provide inline versions of some allocation functions - bch2_alloc_sectors_done_inlined() - bch2_alloc_sectors_append_ptrs_inlined() and use them in the core IO path. Also, inline bch2_extent_update_i_size_sectors() and bch2_bkey_append_ptr(). In the core write path, function call overhead matters - every function call is a jump to a new location and a potential cache miss. Signed-off-by: Kent Overstreet commit 19a614d2e4beed7faf52ab95cb48ce38a3c38c04 Author: Kent Overstreet Date: Mon Jan 30 20:58:43 2023 -0500 bcachefs: Better inlining for bch2_alloc_to_v4_mut This separates out the slowpath into a separate function, and inlines bch2_alloc_v4_mut into bch2_trans_start_alloc_update(), the main place it's called. Signed-off-by: Kent Overstreet commit adf6360b5d6071ea268fa6f5f03befba4909ffaa Author: Kent Overstreet Date: Wed Feb 1 22:51:51 2023 -0500 bcachefs: Improve btree_reserve_get_fail tracepoint Now we include the return code. Signed-off-by: Kent Overstreet commit db36c1477d1753f4d5bebaed074ca4e4477df3ea Author: Kent Overstreet Date: Mon Jan 23 20:28:59 2023 -0500 bcachefs: Fix bch2_bucket_alloc_early() We were incorrectly retrying after a transaction restart. Signed-off-by: Kent Overstreet commit 9fea089a9502784f42868b2649a732724f4c1d0b Author: Kent Overstreet Date: Wed Jan 4 00:00:55 2023 -0500 bcachefs: Check for lru entries with time=0 These are invalid. Signed-off-by: Kent Overstreet commit d7dd3fb84f05a0d221be3979929706a4828fb252 Author: Kent Overstreet Date: Sat Jan 7 22:55:42 2023 -0500 bcachefs: Fix rereplicate when we already have a cached pointer When we need to add more replicas to an extent, it might be the case that we already have a replica on every device, but some of them are cached. This patch fixes a bug where we'd spin on that extent because the write path fails to find a device we can allocate from: we allow allocating from devices that already have cached replicas on them, and change bch2_data_update_index_update() to drop the cached replica if needed. Signed-off-by: Kent Overstreet commit 7c909f654bae57083a0965f105e52ac8737a0785 Author: Kent Overstreet Date: Fri Jan 20 17:02:56 2023 -0500 bcachefs: Fix repair path in bch2_mark_reflink_p() Signed-off-by: Kent Overstreet commit 0329631c9165d2dddd5a89da5f72f3175011b49f Author: Kent Overstreet Date: Wed Jan 25 10:08:50 2023 -0500 bcachefs: Dump transaction updates before panicing When errors=panic, we need to dump transaction updates before calling bch2_inconsistent_error(). Signed-off-by: Kent Overstreet commit ad5d3d820a97500d8af0d5f337f8f523c6099ac6 Author: Kent Overstreet Date: Wed Jan 25 10:07:52 2023 -0500 bcachefs: Kill fs_usage_apply_warn() We now have bch2_trans_inconsistent() which generically does the same thing - dumps pending btree transaction updates. Signed-off-by: Kent Overstreet commit 834dc29d521d34718602bfb8d93d370093a5d430 Author: Kent Overstreet Date: Tue Jan 24 19:42:04 2023 -0500 bcachefs: debug: Fix some locking bugs This fixes a few error paths in debug code that lead to locks failing to be dropped. Signed-off-by: Kent Overstreet commit 87ced107f37fc017d34b8f56afeb7daa06c87310 Author: Kent Overstreet Date: Tue Dec 13 15:17:40 2022 -0500 bcachefs: Convert EAGAIN errors to private error codes More error code cleanup, for better error messages and debugability. Signed-off-by: Kent Overstreet commit 858536c7cea8bb86511501768ef797d103642498 Author: Kent Overstreet Date: Sun Dec 11 20:37:11 2022 -0500 bcachefs: Convert EROFS errors to private error codes More error code improvements - this gets us more useful error messages. Signed-off-by: Kent Overstreet commit e9a1da97377f89f09e6b0b484554fe7a0e2dbe3e Author: Kent Overstreet Date: Sat Dec 3 15:44:54 2022 -0500 bcachefs: Fix compat path for old inode formats Old inode formats don't have all the fields of the current inode format: when unpacking inodes in the current format we can thus skip zeroing out the destination buffer, but that doesn't work on for the old formats. Signed-off-by: Kent Overstreet commit 313816363a843f1b812ae9190f6dcb4c49145057 Author: Kent Overstreet Date: Tue Jan 24 00:26:48 2023 -0500 bcachefs: bch2_trans_relock_notrace() Signed-off-by: Kent Overstreet commit ee2c6ea7760eceee3051ef2f2046d16dc5ab06ec Author: Kent Overstreet Date: Mon Jan 9 01:11:18 2023 -0500 bcachefs: btree_iter->ip_allocated In debug mode, we now track where btree iterators and paths are initialized/allocated - helpful in tracking down btree path overflows. Signed-off-by: Kent Overstreet commit 6c36318cc702f05d302fb98a99636e320392bdf1 Author: Kent Overstreet Date: Sat Jan 7 05:46:52 2023 -0500 bcachefs: key cache: Don't hold btree locks while using GFP_RECLAIM This is something we need to do more widely: instead of bothering with GFP_NOIO/GFP_NOFS, if we need to allocate memory while holding locks: - first attempt the allocation with GFP_NOWAIT - if that fails, drop btree locks with bch2_trans_unlock(), then retry with GFP_KERNEL. Signed-off-by: Kent Overstreet commit 7af365eb3694b7ef7ce2b90b6de4b830a49cdda4 Author: Kent Overstreet Date: Sun Jan 8 00:05:30 2023 -0500 bcachefs: Improve bkey_cached_lock_for_evict() We don't need a write lock to check if a key is dirty. Signed-off-by: Kent Overstreet commit c82ed3047b8875b07b19e6e287c48f27a37b756f Author: Kent Overstreet Date: Sun Jan 8 00:04:30 2023 -0500 bcachefs: Fix bch2_btree_path_traverse_all() We need to take a ref on a path while we're traversing it: this fixes a bug with paths getting reused while being traversed, in the key cache fill code. Signed-off-by: Kent Overstreet commit ee94c413a7ef5f10a2768826b2e576981990c4b8 Author: Kent Overstreet Date: Fri Jan 6 22:58:19 2023 -0500 bcachefs: Delete a faulty assertion Signed-off-by: Kent Overstreet commit c515e3f019fe0ab60ae6f5343d211f52b8a2c759 Author: Kent Overstreet Date: Fri Jan 6 06:29:04 2023 -0500 bcachefs: Kill bch2_extent_trim_atomic() usage Signed-off-by: Kent Overstreet commit 494dcc57a7bf639c39364b5f84c1b6db39a0f83a Author: Kent Overstreet Date: Tue Jan 3 17:32:16 2023 -0500 bcachefs: Plumb saw_error through to btree_err() The btree node read path has the ability to kick off an asynchronous btree node rewrite if we saw and corrected an error. Previously this was only used for errors that caused one of the replicas to be unusable - this patch plumbs it through to all error paths, so that normal fsck errors can be corrected. Signed-off-by: Kent Overstreet commit b8fe1b1dfecc10e571f82327d61c693720d39b19 Author: Kent Overstreet Date: Tue Jan 3 17:14:07 2023 -0500 bcachefs: Convert btree_err() to a function This makes the code more readable, and reduces text size by 8 kb. Signed-off-by: Kent Overstreet commit 149651dc6c1250b3b51c38391b3677261ac94075 Author: Kent Overstreet Date: Sun Dec 25 15:31:27 2022 -0500 bcachefs: fix fsck error Signed-off-by: Kent Overstreet commit 60573ff5d0de3f54a8af397f5ba9d3ab443f274e Author: Kent Overstreet Date: Tue Dec 20 19:27:02 2022 -0500 bcachefs: Make log message at startup a bit cleaner Don't print out opts= if no options have been specified. Signed-off-by: Kent Overstreet commit 5bbe3f2d0e1e52c03f32cb40cc749e1ace6453d0 Author: Kent Overstreet Date: Wed Dec 14 10:39:04 2022 -0500 bcachefs: Log more messages in the journal This patch - Adds a mechanism for queuing up journal entries prior to the journal being started, which will be used for early journal log messages - Adds bch2_fs_log_msg() and improves bch2_trans_log_msg(), which now take format strings. bch2_fs_log_msg() can be used before or after the journal has been started, and will use the appropriate mechanism. - Deletes the now obsolete bch2_journal_log_msg() - And adds more log messages to the recovery path - messages for journal/filesystem started, journal entries being blacklisted, and journal replay starting/finishing. Signed-off-by: Kent Overstreet commit 9d7f2a4111be34eac6b23ed62271efb12f36815f Author: Kent Overstreet Date: Wed Jan 4 21:34:41 2023 -0500 bcachefs: bch2_btree_trans_to_text(): print blocked time Signed-off-by: Kent Overstreet commit 2cc9c0db89f7b6e3c3218ddaa7964055af8d95af Author: Kent Overstreet Date: Wed Dec 28 15:17:07 2022 -0500 bcachefs: Fix some memcpy() warnings With CONFIG_FORTIFY_SOURCE, the compiler attempts to warn about mempcys that extend past struct field boundaries. This results in some spurious warnings where we use embedded variable length structs, this patch switches to unsafe_mecpy() to fix the warnings. Signed-off-by: Kent Overstreet commit 84464e57529b45e235c24bc7db24b60ffba7f540 Author: Kent Overstreet Date: Tue Dec 20 19:43:41 2022 -0500 bcachefs: Be less restrictive when validating journal overwrite entries Signed-off-by: Kent Overstreet commit a2b9a5b272f2bbfc3988f4b5c8e92d9951885bcb Author: Kent Overstreet Date: Mon Mar 7 01:35:55 2022 -0500 bcachefs: Fix bch2_journal_flush_device_pins() It's now legal for the pin fifo to be empty, which means this code needs to be updated in order to not hit an assert. Signed-off-by: Kent Overstreet commit e242b92af5ef74cdf40b237c9e904034c081b144 Author: Kent Overstreet Date: Thu Dec 15 21:44:32 2022 -0500 bcachefs: Fix for long running btree transactions & key cache While a btree transaction is running, we hold a SRCU read lock on the btree key cache that prevents btree key cache keys from being freed - this is so that relock() operations won't access freed memory. The downside of this is that long running btree transactions prevent memory from being freed from the key cache. This adds a check in bch2_trans_begin() - if the transaction has been running longer than 1 second, drop and retake the SRCU read lock and zero out pointers to unlock key cache paths. Signed-off-by: Kent Overstreet commit 67ace2724603378fec0c5321736e2772d459fd8c Author: Kent Overstreet Date: Thu Dec 22 20:51:02 2022 -0500 bcachefs: Add a missing bch2_err_str() call Signed-off-by: Kent Overstreet commit 47a0ea6abeef60115e3ca60ed0a640bba376a7d0 Author: Kent Overstreet Date: Wed Nov 23 20:11:46 2022 -0500 bcachefs: Add some unlikely() annotations Add a few easy unlikely() optimizations. These are mainly worthwhile because the compiler will (usually) put the branch-not-taken path at the end of the function, meaning better icache utilization. Signed-off-by: Kent Overstreet commit 994ba475433a9395cb71e2ffb1928ce9fdb98e80 Author: Kent Overstreet Date: Wed Nov 23 22:13:19 2022 -0500 bcachefs: New btree helpers This introduces some new conveniences, to help cut down on boilerplate: - bch2_trans_kmalloc_nomemzero() - performance optimiation - bch2_bkey_make_mut() - bch2_bkey_get_mut() - bch2_bkey_get_mut_typed() - bch2_bkey_alloc() Signed-off-by: Kent Overstreet commit a16b19cd1d91366e38c06f1195437b200b32e980 Author: Kent Overstreet Date: Fri Dec 2 20:36:06 2022 -0500 bcachefs: Allow for more btrees Expand some bitfields so we can keep adding more btrees. Signed-off-by: Kent Overstreet commit 1ba8a796b427d312aa68c2e04e00b42ec742883e Author: Kent Overstreet Date: Wed Dec 14 14:47:42 2022 -0500 bcachefs: Recover from blacklisted journal entries If it so happens that we crash while dirty, meaning we don't have the superblock clean section, and we erroneously mark a journal entry we wrote as blacklisted, we won't be able to recover. This patch fixes this by adding a fallback: if we've got no superblock clean section, and no non-ignored journal entries, we try the most recent ignored journal entry. Signed-off-by: Kent Overstreet commit 14d7d61fac9c151a270c6ef6f969993eae9f1bbf Author: Kent Overstreet Date: Tue Dec 13 14:43:03 2022 -0500 bcachefs: Fix btree_gc when multiple passes required We weren't resetting filesystem & device usage when restarting gc, which was spotted when free bucket counters overflowed - whoops. Signed-off-by: Kent Overstreet commit 1ae40fd816ca6f52b46a8d74f799f8a85ecb92ad Author: Kent Overstreet Date: Tue Dec 13 18:19:30 2022 -0500 bcachefs: Fix error path in bch2_trans_commit_write_locked() Previously, we were journalling extra_journal_entries (which is used for new btree roots, and irreversably mutates system state) before calling bch2_trans_fs_usage_apply(), which can fail - whoops. Signed-off-by: Kent Overstreet commit 08f7803159f63e0ce5660acca061cbd6bac06166 Author: Kent Overstreet Date: Wed Nov 23 18:46:03 2022 -0500 bcachefs: bch2_trans_revalidate_updates_in_node() When we started stashing the key being overwritten in btree_insert_entry, this introduced a typical iterator invalidation problem, triggered by btree node splits or resorts. Previously, dealt with this by unconditionally re-validating those stashed pointers in the transaction commit path. This patch gets rid of that by doing it only when needed, in bch2_trans_node_add() or bch2_trans_node_reinit_iter(). Signed-off-by: Kent Overstreet commit 321bdc73f3aaba5acb9ed7082cf222444541eb74 Author: Kent Overstreet Date: Fri Nov 25 15:01:36 2022 -0500 bcachefs: bkey_min(), bkey_max() Parallel to bpos_min(), bpos_max() - trivial refactoring. Signed-off-by: Kent Overstreet commit 78c0b75c34209c471616566b3978eac4c1c53e99 Author: Kent Overstreet Date: Sat Nov 19 22:39:08 2022 -0500 bcachefs: More errcode cleanup We shouldn't be overloading standard error codes now that we have provisions for bcachefs-specific errorcodes: this patch converts super.c and super-io.c to per error site errcodes, with a bit of cleanup. Signed-off-by: Kent Overstreet commit 5f659376fc1b9ad23b00a35242179b8961e0bc2d Author: Kent Overstreet Date: Wed Oct 12 16:11:31 2022 -0400 bcachefs: Suppress -EROFS messages when shutting down This isn't actually an error condition, this just indicates a normal shutdown - no reason for these to be in the log. Signed-off-by: Kent Overstreet commit ef0732861a3af5bd1c5b08b6f64ca5b2cbee04bc Author: Kent Overstreet Date: Fri Dec 9 16:22:36 2022 -0500 bcachefs: Add a missing bch2_btree_path_traverse() call bch2_btree_iter_peek_upto() in snapshots mode may need to keep a btree_path for the insert position, not just the position of the key we're returning. The code was incorrectly assuming this would be in the same btree node - we were missing a bch2_btree_path_traverse() call. Signed-off-by: Kent Overstreet commit 4f948723eda1ca44e470c31fcab4a453ed53aa13 Author: Kent Overstreet Date: Fri Dec 9 14:09:14 2022 -0500 bcachefs: Fix bch2_journal_keys_peek_upto() bch2_journal_keys_peek_upto() was comparing against btree_id & level incorrectly - fix this by using __journal_key_cmp(). Signed-off-by: Kent Overstreet commit ac9fa4bdc79bb54e639f5dc262f9f5976a5ccd21 Author: Kent Overstreet Date: Wed Dec 7 11:39:34 2022 -0500 bcachefs: Kill btree_insert_ret enum Replace with standard bcachefs-private error codes. Signed-off-by: Kent Overstreet commit 5c792e1b64cb5b87129f7226d610fd63465039bd Author: Kent Overstreet Date: Fri Dec 2 12:45:37 2022 -0500 bcachefs: Fix a btree iter assertion pop This fixes a (harmless) broken invariant in __bch2_btree_path_set_pos(): iterators to interior nodes should point to the first non whiteout. Signed-off-by: Kent Overstreet commit 230fa1c735496a2f89eb8bcc1471a46f0d917975 Author: Kent Overstreet Date: Thu Dec 1 21:59:25 2022 -0500 bcachefs: Simplify journal read path This just cleans up and simplifies the code that decides where to resume writing in the journal - when the code was originally written we weren't saving the precise location of every journal write found. Signed-off-by: Kent Overstreet commit b9004e8576b1c2803ee7d7b3f28fbcc779f05ffb Author: Kent Overstreet Date: Fri Dec 2 11:45:58 2022 -0500 bcachefs: Fix a "no journal entries found" bug On startup, we need to ensure the first journal entry written is a flush write: after a clean shutdown we generally don't read the journal, which means we might be overwriting whatever was there previously, and there must always be at least one flush entry in the journal or recovery will fail. Found by fstests generic/388. Signed-off-by: Kent Overstreet commit e0de429a3ab5f9485ca781d6d4d7368a2e12d835 Author: Kent Overstreet Date: Thu Dec 1 11:17:18 2022 -0500 bcachefs: Don't error out when just reading the journal This tweaks the recovery and journal paths so that we don't error out before we need to: the list_journal command should work, even if we wouldn't be able to replay successfully. Signed-off-by: Kent Overstreet commit 6f90e6b28180cb567b0abdb753ccac4c7d840cb2 Author: Kent Overstreet Date: Wed Jan 25 10:15:39 2023 -0500 bcachefs: Fix a livelock in key cache fill path We weren't setting path->uptodate before calling bch2_btree_key_cache_fill() - which causes __bch2_btree_path_upgrade() to fail. Signed-off-by: Kent Overstreet commit 1617d56dc9bc3d9fd56824e8e488e88acbba152f Author: Kent Overstreet Date: Tue Nov 22 20:15:33 2022 -0500 bcachefs: Key cache now works for snapshots btrees This switches btree_key_cache_fill() to use a btree iterator, not a btree path, so that it can search for keys in previous snapshots. We also add another iterator flag, BTREE_ITER_KEY_CACHE_FILL, to avoid recursion back into the key cache. This will allow us to re-enable the key cache for inodes in the next patch. Signed-off-by: Kent Overstreet commit 087e53c255b6fe8ec6b573acbdf12a555aae493b Author: Kent Overstreet Date: Tue Dec 20 11:26:57 2022 -0500 bcachefs: Bring back BTREE_ITER_CACHED_NOFILL Signed-off-by: Kent Overstreet commit dcced069421c2e1f8c2d2bff2263a48c319b6166 Author: Kent Overstreet Date: Tue Dec 20 16:02:09 2022 -0500 bcachefs: Kill __btree_trans_peek_key_cache() There was no reason for this to be a separate helper - we always want the relock call that btree_trans_peek_key_cache() did. Signed-off-by: Kent Overstreet commit a52a4da4fd07ad32f7beceaa61672e74efd7f03a Author: Kent Overstreet Date: Tue Dec 20 11:13:19 2022 -0500 bcachefs: bch2_btree_path_peek_slot_exact() When we start using the key cache for inodes again, it'll be possible for bch2_btree_path_peek_slot() to return a key in a different snapshot with a key cache path. This isn't what we want when triggers are checking what they're overwriting, so introduce a new helper for the commit path. Signed-off-by: Kent Overstreet commit 52bf51b91f5d19ab0555b901023def61d60f1a97 Author: Kent Overstreet Date: Tue Dec 20 10:51:20 2022 -0500 bcachefs: Fix __btree_trans_peek_key_cache() We were returning a pointer to a variable on the stack - oops. Signed-off-by: Kent Overstreet commit e88a75ebe86c1df42f0ca9ab6e8fa50db26e7cef Author: Kent Overstreet Date: Thu Nov 24 03:12:22 2022 -0500 bcachefs: New bpos_cmp(), bkey_cmp() replacements This patch introduces - bpos_eq() - bpos_lt() - bpos_le() - bpos_gt() - bpos_ge() and equivalent replacements for bkey_cmp(). Looking at the generated assembly these could probably be improved further, but we already see a significant code size improvement with this patch. Signed-off-by: Kent Overstreet commit e15382125948523cd5c887c5fe4fa4303e9a9dc1 Author: Kent Overstreet Date: Fri Dec 2 19:46:49 2022 -0500 bcachefs: New magic number Add a new bcachefs-specific magic number for the superblock, instead of continuing to use the old bcache magic number3 Signed-off-by: Kent Overstreet commit 6530d89e0a598592badde77930269740b44ea2ee Author: Kent Overstreet Date: Sat Nov 26 04:36:56 2022 -0500 bcachefs: extents no longer require special handling for packing Extent overwrite used to be handled differently, underneath the journaling layer and within the core btree code. This imposed restrictions on bkey packing/packed formats, which no longer apply. This patch deletes those restrictions. Signed-off-by: Kent Overstreet commit e2fcf7f6306f12c50ad2ec655fdb8d1918c23bdd Author: Kent Overstreet Date: Fri Nov 25 18:29:36 2022 -0500 bcachefs: Fix BCH_IOCTL_DISK_SET_STATE - Ensure we print an error message if necessary. Ideally we'd return the precise error code to userspace and leave printing the error message to the userspace tool, but we haven't decided to make our private error codes ABI-stable yet. - Return standard error code to userspace Signed-off-by: Kent Overstreet commit 447e92274af6c7e8dcdc7921a6af238afcc87a0a Author: Kent Overstreet Date: Fri Nov 25 16:04:42 2022 -0500 bcachefs: Don't set accessed bit on btree node fill Btree nodes shouldn't have their accessed bit set when entering the btree cache by being read in from disk - this fixes linear scans thrashing the cache. Signed-off-by: Kent Overstreet commit b6804b6103263417994602482e9186fb3697a3e6 Author: Kent Overstreet Date: Fri Nov 25 16:15:14 2022 -0500 bcachefs: Fix an include Signed-off-by: Kent Overstreet commit 42fab2695bfea686dc5eef92da0b4ce3277484a0 Author: Kent Overstreet Date: Fri Nov 25 12:56:49 2022 -0500 bcachefs: Kill BCH_FEATURE_incompressible This isn't needed anymore, we only support metadata versions that have this. Signed-off-by: Kent Overstreet commit 30c92ffe4752b10059cfe00cea775d4af2f5196c Author: Kent Overstreet Date: Wed Nov 23 18:23:48 2022 -0500 bcachefs: Better inlining in bch2_time_stats_update() Move the actual slowpath off into a new function - bch2_time_stats_clear_buffer() - and inline bch2_time_stats_update_one(). Alo, use the new inlined update functions from mean_and_variance. Signed-off-by: Kent Overstreet commit c96f108b053b394d622f56f2bcefeccb32d0394c Author: Kent Overstreet Date: Fri Nov 25 00:40:27 2022 -0500 bcachefs: Optimize bch2_trans_iter_init() When flags & btree_id are constants, we can constant fold the entire calculation of the actual iterator flags - and the whole thing becomes small enough to inline. Signed-off-by: Kent Overstreet commit 4d868d18e569e1f74c2a59d70ee7f0f0f099f677 Author: Kent Overstreet Date: Thu Nov 24 23:52:28 2022 -0500 bcachefs: More dio inlining Eliminate another function call in the O_DIRECT write path. Signed-off-by: Kent Overstreet commit 4a390fec24a3d6f88678b43f2baa8ad9c2f0716c Author: Kent Overstreet Date: Wed Nov 23 18:51:27 2022 -0500 bcachefs: Kill some unneeded references to c->flags This drops some unneeded references to JOURNAL_REPLAY_DONE in c->flags: we're already mirroring it in btree_trans, we just weren't using it consistently. We may want to do this with more flags: btree_iter.c: unsigned nr = test_bit(BCH_FS_STARTED, &c->flags) btree_update_leaf.c: if (unlikely(!test_bit(BCH_FS_MAY_GO_RW, &c->flags))) { Signed-off-by: Kent Overstreet commit abb936fb9f2ab4a447a266477d65e50d476277a5 Author: Kent Overstreet Date: Wed Nov 23 20:28:15 2022 -0500 bcachefs: Improve bch2_inode_opts_to_opts() It turns out the *_defined entries of bch_io_opts are only used in one place - in the xattr get path - and there we immediately convert to a bch_opts struct, which also has the *_defined entries. This patch changes bch2_inode_opts_to_opts() to go directly from bch_inode_unpacked to bch_opts, which is a minor simplification and will also let us slim down struct bch_io_opts in another patch. Signed-off-by: Kent Overstreet commit 98638ffa1d914e780a527c0bd92323f0b7307f09 Author: Kent Overstreet Date: Wed Nov 23 18:22:59 2022 -0500 bcachefs: Better inlining in bch2_subvolume_get_snapshot() This provides an inlined version of bch2_subvolume_get() and uses it in bch2_subvolume_get_snapshot(), since this is the version that's used all over the place and in fast paths (e.g. IO paths). Signed-off-by: Kent Overstreet commit 0aba9eba76442d6887dc98924bb8c0396a79c984 Author: Kent Overstreet Date: Thu Nov 24 03:38:31 2022 -0500 bcachefs: Inline bch2_bkey_format_add_key() This is only called in two places, and when it's used we use it in a tight loop - it's definitely worth inlining. Signed-off-by: Kent Overstreet commit a2519a9688d3eeb6c4b2df3ab80b70e62458528d Author: Kent Overstreet Date: Tue Nov 22 23:47:22 2022 -0500 bcachefs: Tiny bch2_trans_update_by_path_trace() optimization This just removes a redundant comparison - there's more work we could do here to remove some redundant copying. Signed-off-by: Kent Overstreet commit c9ee99ad8c52a9d7f93e2e9f786a172a849622fd Author: Kent Overstreet Date: Tue Nov 22 22:06:04 2022 -0500 bcachefs: Move some asserts behind CONFIG_BCACHEFS_DEBUG Convert some non-critical asserts in long-stable code to debug asserts. Signed-off-by: Kent Overstreet commit 001783e2614ea333267e443a9b38ac25644f839b Author: Kent Overstreet Date: Tue Nov 22 22:05:45 2022 -0500 bcachefs: Split out __bch2_btree_node_get() Standard splitting out of the slow path from the fast path of a function. We may follow this up in another patch with inlining the fast path into btree_iter.c. Signed-off-by: Kent Overstreet commit dab1e24867f0e694c8ab73c075d10676c2699d85 Author: Kent Overstreet Date: Sat Nov 19 21:40:35 2022 -0500 bcachefs: Handle last journal write being torn If the last journal write didn't complete sucessfully due to a torn write, we'll detect it as a checksum error. In that case, we should just pretend that journal entry was never written. Signed-off-by: Kent Overstreet commit ff56d68cf9ea04504be94eb7a476efcb92028a42 Author: Kent Overstreet Date: Sat Nov 19 21:20:58 2022 -0500 bcachefs: Improve journal_read() logging Print out the journal entries we read and will replay as soon as possible - if we get an error walidating keys it's helpful to know where it was in the journal. Signed-off-by: Kent Overstreet commit 96c2e01083f19c75421002bebb819a668839184e Author: Kent Overstreet Date: Thu Nov 17 19:07:40 2022 -0500 bcachefs: Fix a transaction path overflow It turns out we need bch2_extent_trim_atomi() even when we're deleting extents one at a time because it's possible for one reflink_p to reference arbitrarily many reflink_v extents. This doesn't normally happen, but the data move path can fragment existing extents in the background. Signed-off-by: Kent Overstreet commit 42af0ad569edbfcd252e9abf0badd97b895c34be Author: Kent Overstreet Date: Thu Nov 17 16:03:15 2022 -0500 bcachefs: Fix a race with b->write_type b->write_type needs to be set atomically with setting the btree_node_need_write flag, so move it into b->flags. Signed-off-by: Kent Overstreet commit 7fec8266af12b655e98978050e716e12e8544fe6 Author: Kent Overstreet Date: Tue Nov 15 20:25:08 2022 -0500 bcachefs: Error message improvement - Centralize format strings in bcachefs.h - Add bch2_fmt_inum_offset() and related helpers - Switch error messages for inodes to also print out the offset, in bytes Signed-off-by: Kent Overstreet commit 8eb71e9e1af8aaec3c70673560931a328fe840bd Author: Kent Overstreet Date: Tue Nov 15 15:57:07 2022 -0500 bcachefs: Improve a few warnings Warnings ought to always have a format string/log message - makes them considerably more useful. Signed-off-by: Kent Overstreet commit 3bce13837395f1af2fd585ef6dd4b54d80c2d1fb Author: Kent Overstreet Date: Tue Nov 15 23:17:55 2022 -0500 bcachefs: Fix for_each_btree_key2() Previously, when we exited from the loop body with a break statement _ret wouldn't have been assigned to yet, and we could spuriously return a transaction restart error. Signed-off-by: Kent Overstreet commit 4fcdd6ec345e1aeed23fbdbe53d62965c1a79b99 Author: Kent Overstreet Date: Tue Nov 15 21:52:12 2022 -0500 bcachefs: Btree split improvement This improves the bkey_format calculation when splitting btree nodes. Previously, we'd use a format calculated for the original node for the lower of the two new nodes. This was particularly bad on sequential insertions, where we iteratively split the last btree node, whos format has to include KEY_MAX. Now, we calculate formats precisely for the keys the two new nodes will contain. This also should make splitting a bit more efficient, since we're only copying keys once (from the original node to the new node, instead of new node, replacement node, then upper split). Signed-off-by: Kent Overstreet commit 0f35e0860a73a35e8c3aa1afebc45e75eb2fbae6 Author: Kent Overstreet Date: Tue Nov 15 22:48:03 2022 -0500 bcachefs: Fix return code from btree_path_traverse_one() trans->restarted is a positive error code, not the usual negative Signed-off-by: Kent Overstreet commit 6b1b186a5a8e9cf4770e9546c3606fef40666830 Author: Kent Overstreet Date: Sun Nov 13 22:43:37 2022 -0500 bcachefs: Minor dio write path improvements This switches where we take quota reservations to be per bch_wirte_op instead of per dio_write, so we can drop the quota reservation in the same place as we call i_sectors_acct(), and only take/release ei_quota_lock once. In the future we'd like ei_quota_lock to not be a mutex, so that we can avoid punting to process context before deliving write completions in nocow mode. Signed-off-by: Kent Overstreet commit 84fea8e5b3abc9147a20211e608ba8844c479998 Author: Kent Overstreet Date: Sun Nov 13 22:35:55 2022 -0500 bcachefs: Quota: Don't allocate memory under lock The genradix code can handle multiple threads trying to allocate at the same time - we don't need the genradix_ptr_alloc() call to happen under a lock. Signed-off-by: Kent Overstreet commit 061f7999a6322c639dd6616dc6d3785957de2bc3 Author: Kent Overstreet Date: Mon Nov 14 02:22:30 2022 -0500 bcachefs: Fix a use after free This fixes a regression from percpu freedlists in the btree key cache code: in a rare error path, we were immediately freeing a bkey_cached that had been used before and should've waited for an SRCU barrier. Signed-off-by: Kent Overstreet commit 961cbdef3c270266e17aa831cf22eb14b900af65 Author: Kent Overstreet Date: Sun Nov 13 20:53:24 2022 -0500 bcachefs: Delete atomic_inc_bug() These were wrappers around atomic operations that verified that the counter wasn't negative, but they're dead code - delete. Signed-off-by: Kent Overstreet commit b2d1d56b1d34bcfb6da77eb74a2fbcdea92514f9 Author: Kent Overstreet Date: Sun Nov 13 20:01:42 2022 -0500 bcachefs: Fixes for building in userspace - Marking a non-static function as inline doesn't actually work and is now causing problems - drop that - Introduce BCACHEFS_LOG_PREFIX for when we want to prefix log messages with bcachefs (filesystem name) - Userspace doesn't have real percpu variables (maybe we can get this fixed someday), put an #ifdef around bch2_disk_reservation_add() fastpath Signed-off-by: Kent Overstreet commit a7ecd30c8300624448c4e66cd7a7e7209b96ea61 Author: Kent Overstreet Date: Fri Nov 4 13:25:57 2022 -0400 bcachefs: Factor out two_state_shared_lock We have a unique lock used for controlling adding to the pagecache: the lock has two states, where both states are shared - the lock may be held multiple times for either state - but not both states at the same time. This is exactly what we need for nocow mode locking, so this patch pulls it out of fs.c into its own file. Signed-off-by: Kent Overstreet commit a1ee777bfcceeb916d837321144c782e12082588 Author: Kent Overstreet Date: Thu Nov 3 00:29:43 2022 -0400 bcachefs: Kill BCH_WRITE_FLUSH BCH_WRITE_FLUSH is a write flag that causes a journal flush. It's only used in the direct IO path, and this will allow for some consolidation with the regular fsync path, which will help with the upcoming nocow mode. Signed-off-by: Kent Overstreet commit 03e83f630223261978e23875299e87ae61403548 Author: Kent Overstreet Date: Thu Nov 3 11:14:04 2022 -0400 bcachefs: bch2_trans_commit_bkey_invalid() - factor out more slowpath code into non-inline function - use bch2_print_string_as_lines(), so our error message doesn't get truncated Signed-off-by: Kent Overstreet commit 07de1803b888131ef1675b17a0260b50d684175e Author: Kent Overstreet Date: Wed Nov 2 15:41:32 2022 -0400 bcachefs: Kill bch2_alloc_sectors_start() Only used in one place, just inline it there. Signed-off-by: Kent Overstreet commit 984dc67e3bceb8871444961df0d2c2a45d5a3f4e Author: Kent Overstreet Date: Tue Nov 1 04:23:24 2022 -0400 bcachefs: Improve __bch2_btree_path_make_mut() btree_path_copy() doesn't need to call bch2_btree_path_check_sort_fast() - the newly allocated path will always be in the correct position, post copy; also delete some redundant branches from __bch2_btree_path_make_mut(). Signed-off-by: Kent Overstreet commit 0cc455b3ca5ffc9b0d5e9b1a21a9f3cd7fde8247 Author: Kent Overstreet Date: Tue Nov 1 03:37:53 2022 -0400 bcachefs: Inlining improvements - Don't call into bch2_encrypt_bio() when we're not encrypting - Pull slowpath out of trans_lock_write() - Make sure bc2h_trans_journal_res_get() gets inlined. Signed-off-by: Kent Overstreet commit 182c7bbfbfe8d435672b8cb9730b07e88e103670 Author: Kent Overstreet Date: Mon Oct 31 20:30:27 2022 -0400 bcachefs: DIO write path optimization - With BCH_WRITE_SYNC, we no longer need the completion in struct dio_write - Pull out bch2_dio_write_copy_iov() into a separate non-inline function, it's code that doesn't run in the common case - Copy mapping and inode pointers into dio_write, avoiding pointer chasing at the start of bch2_dio_write_loop() - kthread_use_mm() is not needed in the common case; move it into bch2_dio_write_loop_async() - factor out various helpers from bch2_dio_write_loop() and rework control flow for better icache utilization Other small optimizations: - bch2_keylist_free() is only used in one place, at the end of the bch2_write() path - drop the reinit - in bch2_disk_reservation_put(), check if res->sectors is nonzero before touching c->online_reserved, since that will likely be a cache miss Signed-off-by: Kent Overstreet bcachefs: More DIO write path optimization Better code prefetching (?) Signed-off-by: Kent Overstreet commit 1df3e19996a3b29ed82315bf03cb02ac4e4e70ab Author: Kent Overstreet Date: Sat Oct 29 15:54:17 2022 -0400 bcachefs: BCH_WRITE_SYNC This adds a new flag for the write path, BCH_WRITE_SYNC, and switches the O_DIRECT write path to use it when we're not running asynchronously. It runs the btree update after the write in the original thread's context instead of a kworker, cutting context switches in half. Signed-off-by: Kent Overstreet commit a10195764901e0a41e64d596de57a957e7f982f0 Author: Kent Overstreet Date: Sat Oct 22 15:59:53 2022 -0400 bcachefs: More style fixes Fixes for various checkpatch errors. Signed-off-by: Kent Overstreet commit d4bce63636ab81ca4aed03d6641ad70c8416e921 Author: Kent Overstreet Date: Sun Oct 30 22:21:11 2022 -0400 bcachefs: Kill BCH_WRITE_JOURNAL_SEQ_PTR Dead code, delete. Signed-off-by: Kent Overstreet commit 2cb75179694a646e192247cd56b62cf375af3ae9 Author: Kent Overstreet Date: Fri Oct 28 18:56:31 2022 -0400 bcachefs: should_compact_all() This factors out a properly-documented helper for deciding when we want to sort a btree node with MAX_BSETS bsets down to a single bset. Signed-off-by: Kent Overstreet commit 46fee692eebb850b8478531e185fb5a5f942d3ea Author: Kent Overstreet Date: Fri Oct 28 17:08:41 2022 -0400 bcachefs: Improved btree write statistics This replaces sysfs btree_avg_write_size with btree_write_stats, which now breaks out statistics by the source of the btree write. Btree writes that are too small are a source of inefficiency, and excessive btree resort overhead - this will let us see what's causing them. Signed-off-by: Kent Overstreet commit 8852501fe570c4956c0e29246e1e5636f09b58fb Author: Kent Overstreet Date: Mon Oct 24 13:34:17 2022 -0400 bcachefs: Improve fs_usage_apply_warn() message Signed-off-by: Kent Overstreet commit 80fe580c8db02059d833d2ded6143e90641184ab Author: Kent Overstreet Date: Mon Oct 24 15:10:14 2022 -0400 bcachefs: Fix a spurious warning Fixes fstests generic/648 Signed-off-by: Kent Overstreet commit 353448f3ea42e5deec298d6d2c577ade7028b7fd Author: Kent Overstreet Date: Sun Oct 23 22:01:50 2022 -0400 bcachefs: Fix buffered write path for generic/275 Per fstests generic/275, on -ENOSPC we're supposed write until the filesystem is full - i.e. do a partial write instead of failing the full write. This is a partial fix for the buffered write path: we'll still fail on a page boundary. Signed-off-by: Kent Overstreet commit c167f9e54100179a009051ad6eac1dfb0bcd21f6 Author: Kent Overstreet Date: Sun Oct 23 17:37:23 2022 -0400 bcachefs: Journal keys overlay fixes - In the btree iterator code that overlays keys from the journal, we were incorrectly specifying level=0 instead of the btree_path's current level in a few places - When we didn't do journal replay, we shouldn't free the journal keys: this fixes cmd_list and cmd_dump, which run in norecovery mode Signed-off-by: Kent Overstreet commit 1f69368c5cfce6770d101aaeff46ef22d22de07c Author: Kent Overstreet Date: Sat Oct 22 16:19:27 2022 -0400 bcachefs: Fix an out-of-bounds shift roundup_pow_of_two() is undefined for 0 - oops. Signed-off-by: Kent Overstreet commit df6a24f81aa29a0e844afb53f7d5bc8989cdbac3 Author: Kent Overstreet Date: Sat Oct 22 15:10:28 2022 -0400 bcachefs: Make error messages more uniform Use __func__ in error messages that refer to function name, and do so more uniformly - suggested by checkpatch.pl Signed-off-by: Kent Overstreet commit fd0c767966327c1b938b489de0f6d2d2036b9055 Author: Kent Overstreet Date: Sat Oct 22 15:00:16 2022 -0400 bcachefs: Convert to __packed and __aligned Signed-off-by: Kent Overstreet commit e5baf3dad91a6561ab81e2514217876d58648c1a Author: Kent Overstreet Date: Fri Oct 21 19:20:09 2022 -0400 bcachefs: bch2_bkey_cmp_packed_inlined() This adds an inlined version of bch2_bkey_cmp_packed(), and uses it in bch2_sort_keys(), where it's part of the inner loop. Signed-off-by: Kent Overstreet commit 77671e8fffdd09f37de2ed0cdcdc92069f3597e8 Author: Kent Overstreet Date: Fri Oct 21 19:15:07 2022 -0400 bcachefs: Move bkey bkey_unpack_key() to bkey.h Long ago, bkey_unpack_key() was added to bset.h instead of bkey.h because bkey.h didn't include btree_types.h, which it needs for the compiled unpack function. This patch finally moves it to the proper location. Signed-off-by: Kent Overstreet commit 005def8ff16885743b9d711fe19fc039c0254eed Author: Kent Overstreet Date: Fri Oct 21 17:37:42 2022 -0400 bcachefs: Optimize __bch2_btree_node_iter_advance() This replaces an expensive memmove() call with an open-coded version. Signed-off-by: Kent Overstreet commit c81f5836a41fc796f37a5ff2bb39f7c76d07d35d Author: Kent Overstreet Date: Fri Oct 21 17:26:49 2022 -0400 bcachefs: Don't touch c->flags in bch2_trans_iter_init() This moves the JOURNAL_REPLAY_DONE flag check from bch2_trans_iter_init() to bch2_trans_init(), where we stash a copy in btree_trans - gaining us a small performance improvement. Signed-off-by: Kent Overstreet commit 3e3e02e6bce627ed9e3a5d9fd3118e6569dc2548 Author: Kent Overstreet Date: Wed Oct 19 18:31:33 2022 -0400 bcachefs: Assorted checkpatch fixes checkpatch.pl gives lots of warnings that we don't want - suggested ignore list: ASSIGN_IN_IF UNSPECIFIED_INT - bcachefs coding style prefers single token type names NEW_TYPEDEFS - typedefs are occasionally good FUNCTION_ARGUMENTS - we prefer to look at functions in .c files (hopefully with docbook documentation), not .h file prototypes MULTISTATEMENT_MACRO_USE_DO_WHILE - we have _many_ x-macros and other macros where we can't do this Signed-off-by: Kent Overstreet commit ed80c5699a23c4005ba8e81d4b8fb3e1b922fa40 Author: Kent Overstreet Date: Fri Oct 21 14:01:19 2022 -0400 bcachefs: Optimize bch2_dev_usage_read() - add bch2_dev_usage_read_fast(), which doesn't return by value - bch_dev_usage is big enough that we don't want the silent memcpy - tweak the allocation path to only call bch2_dev_usage_read() once per bucket allocated Signed-off-by: Kent Overstreet commit 2d485df3da368193dafc78be933669d427b7ddf7 Author: Daniel Hill Date: Tue Oct 11 21:33:56 2022 +1300 bcachefs: fix bch2_write_extent() crc corruption. crc.compression_type & nouce gets reset to inside bch2_rechecksum_bio(), we set it back to the previous values calculated. This fixes incompressible extents being marked as uncompressed. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 55b8550d304a1c0884e98d0bb7126d490a96128f Author: Daniel B. Hill Date: Tue Oct 18 09:54:32 2022 +1300 bcachefs: fix security warning in pr_name_and_units Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit f83009cda309ca1012cc206102284802b86da70b Author: Kent Overstreet Date: Mon Oct 17 07:32:57 2022 -0400 bcachefs: Don't issue transaction restart on key cache realloc This shouldn't be needed anymore, since we don't rely on the pointer validity that this was guarding against anymore - we get a new good reference and save it right after this function. Signed-off-by: Kent Overstreet commit ef035f42a03888da62cbe29cd2132d78e5ba393a Author: Kent Overstreet Date: Mon Oct 17 07:31:37 2022 -0400 bcachefs: Separate out flush_new_cached_update() This separates out the slowpath of bch2_trans_update_by_path_trace() into a new non-inlined helper. Signed-off-by: Kent Overstreet commit b0c5b15cc8969f79b410a825efe9894cdec85738 Author: Kent Overstreet Date: Mon Oct 17 07:19:34 2022 -0400 bcachefs: Optimize __bkey_unpack_key_format_checked() Delete some code when CONFIG_BCACHEFS_DEBUG=n Signed-off-by: Kent Overstreet commit 3e8b4b3afedc4757c2d8aaad9a900e98a453d110 Author: Kent Overstreet Date: Mon Oct 17 07:09:02 2022 -0400 bcachefs: Inline bch2_inode_pack() It's mainly used from bch2_inode_write(), so inline it there. Signed-off-by: Kent Overstreet commit adf16c6dfa279fee088a85bac9d602f282699915 Author: Kent Overstreet Date: Mon Oct 17 07:07:28 2022 -0400 bcachefs: bucket_alloc_fail tracepoint should only fire when we have to block We don't want to fire the bucket_alloc_fail tracepoint on transaction restart, when we can retry immediately - only when we the allocation actually has to block. Also, switch from sched_clock() to local_clock(), as we've been doing elsewhere. Signed-off-by: Kent Overstreet commit 307e3c13192002f684bdfc23865a57274e6bb4ad Author: Kent Overstreet Date: Mon Oct 17 07:03:11 2022 -0400 bcachefs: Optimize bch2_trans_init() Now we store the transaction's fn idx in a local variable, instead of redoing the lookup every time we call bch2_trans_init(). Signed-off-by: Kent Overstreet commit 29aa78f15e1bbd984cc14f395544d62b6f0a2a33 Author: Kent Overstreet Date: Mon Oct 17 02:04:31 2022 -0400 bcachefs: Split out __btree_path_up_until_good_node() This breaks up btree_path_up_until_good_node() so that only the fastpath gets inlined. Signed-off-by: Kent Overstreet commit b2f83e769f607409753888c95a9b46dc927dc856 Author: Kent Overstreet Date: Mon Oct 17 02:08:07 2022 -0400 bcachefs: Btree key cache shrinker fix The shrinker assumes freed key cache items are ordered by age, so that it doesn't have to scan the full list to find items that are old enough (according to the srcu code) to be freed. But percpu freelists broke this ordering; this patch fixes this by ensuring we insert items into the proper position. Signed-off-by: Kent Overstreet commit be75bb7a0e0565c0c409842048567e8d07f28675 Author: Daniel Hill Date: Sun Oct 16 02:25:54 2022 +1300 bcachefs: __bio_compress() fix up. A single block can't be compressed, so it's incompressible. This stops rebalance repeatably marking extents as uncompressed. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 597c6d17b18e2d53e7ab30c5626f38422fe4848b Author: Daniel Hill Date: Wed May 25 16:11:56 2022 +1200 bcachefs: make durability a read-write sysfs option Sometimes the user may need to change durability after formatting to match current hardware setup, this option provides a quick and flexible alternative to removing then adding the device. It is HIGHLY ADVISED TO RUN REREPLICATE after changing this value so the system doesn't remain degraded. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit b5ac23c465c4ef8e94f6f2c9f2333193dccf9fc3 Author: Daniel Hill Date: Thu Oct 6 15:53:36 2022 +1300 bcachefs: improve behaviour of btree_cache_scan() Appending new nodes to the end of the list means we're more likely to evict old entries when btree_cache_scan() is started. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit bd954215cad1dbe4304736e6968d8a0c10d1e048 Author: Kent Overstreet Date: Sat Oct 15 03:52:28 2022 -0400 bcachefs: Quota fixes - We now correctly allow soft limits to be exceeded, instead of always returning -EDQUOT - Disk quota grate times/warnings can now be set, not just the systemwide defaults Signed-off-by: Kent Overstreet commit d7e4e51370ef62776ea4af22f83047640425efda Author: Kent Overstreet Date: Sat Oct 15 01:03:14 2022 -0400 bcachefs: Switch to local_clock() for fastpath time source local_clock() isn't always completely accurate - e.g. on machines with TSC drift - but ktime_get_ns() overhead is too high, unfortunately. Signed-off-by: Kent Overstreet commit fe5b37f699c02f90505933959797f70645ba95fb Author: Kent Overstreet Date: Sat Oct 15 00:47:21 2022 -0400 bcachefs: Btree key cache improvements - In userspace, we don't have real percpu variables; this patch disables the percpu freelists in userspace - add some error messages for the asserts in bch2_fs_btree_key_cache_exit(); we've been hitting this (only in userspace, oddly), perhaps this will help us track down the error. - bkey_cached_reuse() should likely be taking the key cache lock, and it's a slowpath so it doesn't hurt to Signed-off-by: Kent Overstreet commit dccedaaa5262cfbf537b740d83aabf52e94c3143 Author: Kent Overstreet Date: Fri Oct 14 07:20:05 2022 -0400 bcachefs: Fix btree node prefetchig We were forgetting to count down the number of nodes to prefetch, firing off _way_ more than intended - whoops. Signed-off-by: Kent Overstreet commit 0196eb89abb9a794d1350684de8e73484f32a19a Author: Kent Overstreet Date: Fri Oct 14 06:48:23 2022 -0400 bcachefs: bch2_btree_key_cache_scan() doesn't need trylock We don't actually allocate memory under the btree key cache lock - so there's no recursion concerns, and the shrinker can just use mutex_lock(). Signed-off-by: Kent Overstreet commit d1b2c864e001c4a709ab040d299c553284bcdb2b Author: Kent Overstreet Date: Thu Oct 13 22:52:40 2022 -0400 bcachefs: Defer full journal entry validation On journal read, previously we would do full journal entry validation immediately after reading a journal entry. However, this would lead to errors for journal entries we weren't actually going to use, either because they were too old or too new (newer than the most recent flush). We've observed write tearing on journal entries newer than the newest flush - which makes sense, prior to a flush there's no guarantees about write persistence. This patch defers full journal entry validation until the end of the journal read path, when we know which journal entries we'll want to use. Signed-off-by: Kent Overstreet commit 17fe3b6452f62c0ee353f3b4f0107685cfd6847d Author: Kent Overstreet Date: Fri Oct 14 01:14:15 2022 -0400 bcachefs: Improve journal_entry_add() Prep work for the next patch, to defer journal entry validation: we now track for each replica whether we had a good checksum. Signed-off-by: Kent Overstreet commit bf8f8b20a1e729170493d99a2014c90c5cf5b84b Author: Daniel Hill Date: Fri Aug 12 09:03:28 2022 +1200 bcachefs: time stats now uses the mean_and_variance module. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 92095781e0f607e735971c1a6462ca6dad8826d2 Author: Daniel Hill Date: Sat Aug 6 14:48:49 2022 +1200 bcachefs: Mean and variance This module provides a fast 64bit implementation of basic statistics functions, including mean, variance and standard deviation in both weighted and unweighted variants, the unweighted variant has a 32bit limitation per sample to prevent overflow when squaring. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 07bfcc0b4c92a569b7f613a3202f45c89f983b4f Author: Kent Overstreet Date: Thu Oct 13 00:44:34 2022 -0400 bcachefs: Fix for not dropping privs in fallocate When modifying a file, we may be required to drop the suid/sgid bits - we were missing a file_modified() call to do this. Signed-off-by: Kent Overstreet commit 3a4d3656e5620df8323448c7d33f4b1401ff14ec Author: Kent Overstreet Date: Thu Oct 13 00:24:17 2022 -0400 bcachefs: Fix bch2_write_begin() An error case was jumping to the wrong label, creating an infinite loop - oops. This fixes fstests generic/648. Signed-off-by: Kent Overstreet commit 40405557b92dfe9cd581f914a5fa5f2c0e82d797 Author: Kent Overstreet Date: Fri Jan 20 15:35:07 2023 -0500 fixup bcachefs: Deadlock cycle detector Signed-off-by: Kent Overstreet commit 80df5b8cacceb25962621ccf4cf555413bdfbdbb Author: Kent Overstreet Date: Fri Jan 20 15:35:07 2023 -0500 fixup bcachefs: Deadlock cycle detector Signed-off-by: Kent Overstreet commit 896f1b316f8e8f51f83095ab4b0e319471d93803 Author: Kent Overstreet Date: Wed Oct 12 18:17:49 2022 -0400 bcachefs: Fix lock_graph_remove_non_waiters() We were removing 1 more entry than we were supposed to - oops. Also some other simplifications and cleanups, and bring back the abort preference code in a better fashion. Signed-off-by: Kent Overstreet commit 65ff2d3a7abb9f1cc41dc824a9fc374a2c81eaf3 Author: Kent Overstreet Date: Wed Oct 12 16:21:08 2022 -0400 bcachefs: Support FS_XFLAG_PROJINHERIT We already have support for the flag's semantics: inode options are inherited by children if they were explicitly set on the parent. This patch just maps the FS_XFLAG_PROJINHERIT flag to the "this option was epxlicitly set" bit. Signed-off-by: Kent Overstreet commit bf9cb250edf776454d0600b4341c6667974bedb8 Author: Kent Overstreet Date: Wed Oct 12 16:12:27 2022 -0400 bcachefs: Don't allow hardlinks when inherited attrs would change This is the right thing to do, and conforms with our own behaviour on rename and xfs's behaviour on hardlink. Signed-off-by: Kent Overstreet commit f866870f5dbe9c9fb745f5a24bb30b6477ec619a Author: Kent Overstreet Date: Wed Oct 12 14:47:58 2022 -0400 bcachefs: Initialize sb_quota with default 1 week timer For compliance with other quota implementations, we should be initializing quota information with a default 1 week timelimit: this fixes fstests generic/235. Also, this adds to_text() functions for some quota structs - useful debugging aids. Signed-off-by: Kent Overstreet commit de107dc8008fe559ac39e89cabc4d21d0129684e Author: Kent Overstreet Date: Wed Oct 12 11:04:28 2022 -0400 bcachefs: Call bch2_btree_update_add_new_node() before dropping write lock btree nodes can be written by other threads (shrinker, journal reclaim) with only a read lock, but brand new nodes should only be written by the thread doing the split/interior update. bch2_btree_update_add_new_node() sets btree node flags to indicate that this is a new node and should not be written out by other threads, thus we need to call it before dropping our write lock. Signed-off-by: Kent Overstreet commit e8540e56812360d4253b6a30e46452ce7448b24b Author: Kent Overstreet Date: Tue Oct 11 04:32:14 2022 -0400 bcachefs: Reflink now respects quotas This adds a new helper, quota_reserve_range(), which takes a quota reservation for unallocated blocks in a given file range, and uses it in bch2_remap_file_range(). Signed-off-by: Kent Overstreet commit f42238b5cde2f1624b2be5f64c813e6127a8012a Author: Kent Overstreet Date: Wed Oct 12 07:58:50 2022 -0400 bcachefs: Fix a rare path in bch2_btree_path_peek_slot() In the drop_alloc tests, we may end up calling bch2_btree_iter_peek_slot() on an interior level that doesn't exist. Previously, this would hit the path->uptodate assertion in bch2_btree_path_peek_slot(); this path first checks a NULL btree node, which is how we know we're at the end of the btree. Signed-off-by: Kent Overstreet commit 7dcbdbd85cc3af14c0b9b5b80eb87cca8a322285 Author: Kent Overstreet Date: Tue Oct 11 06:37:56 2022 -0400 bcachefs: bch2_path_put_nokeep() The btree iterator code may allocate extra btree paths, temporarily, that do not refer to keys being returned: we don't need to wait until transaction restart to drop these, when they're not referenced they should be deleted right away. This fixes a transaction path overflow bug. Signed-off-by: Kent Overstreet commit 5b3243cb528f96e5d90d65f56f96ad179c666ff5 Author: Kent Overstreet Date: Tue Oct 11 04:49:23 2022 -0400 bcachefs: Fix cached data accounting Negating without casting to a signed integer means the value wasn't getting sign extended properly - oops. Signed-off-by: Kent Overstreet commit 1f0f731ffef13bde3b2cd5a439c886d94d2bb3cc Author: Kent Overstreet Date: Tue Sep 27 18:57:34 2022 -0400 bcachefs: Btree splits now only take the locks they need Previously, bch2_btree_update_start() would always take all intent locks, all the way up to the root. We've finally got data from users where this became a scalability issue - so, this patch fixes bch2_btree_update_start() to only take the locks we need. Signed-off-by: Kent Overstreet commit 969576ecaeb9b36250f0e099424713e95ca6d730 Author: Kent Overstreet Date: Sun Oct 9 22:25:19 2022 -0400 bcachefs: bch2_btree_iter_peek() now works with interior nodes Needed by the next patch, which will be iterating over keys in nodes at level 1. Signed-off-by: Kent Overstreet commit 1ff7849f3b2478a4b4ec8abf77ce5e35acac70be Author: Kent Overstreet Date: Sun Oct 9 05:04:38 2022 -0400 bcachefs: bch2_btree_insert_node() no longer uses lock_write_nofail Now that we have an error path plumbed through, there's no need to be using bch2_btree_node_lock_write_nofail(). Signed-off-by: Kent Overstreet commit a8eefbd324cd40fab57ab8eef88347d4f745db93 Author: Kent Overstreet Date: Sat Oct 1 22:15:30 2022 -0400 bcachefs: Add error path to btree_split() The next patch in the series is (finally!) going to change btree splits (and interior updates in general) to not take intent locks all the way up to the root - instead only locking the nodes they'll need to modify. However, this will be introducing a race since if we're not holding a write lock on a btree node it can be written out by another thread, and then we might not have enough space for a new bset entry. We can handle this by retrying - we just need to introduce a new error path. Signed-off-by: Kent Overstreet commit 8cbb0002509a605972781c0e747ae68112f94f54 Author: Kent Overstreet Date: Sat Oct 1 00:34:02 2022 -0400 bcachefs: Write new btree nodes after parent update In order to avoid locking all btree nodes up to the root for btree node splits, we're going to have to introduce a new error path into bch2_btree_insert_node(); this mean we can't have done any writes or modified global state before that point. Signed-off-by: Kent Overstreet commit fe2de9a8dc8312a0992d91c1d63d93bf28574bcf Author: Kent Overstreet Date: Sun Oct 9 04:55:02 2022 -0400 bcachefs: Simplify break_cycle() We'd like to prioritize aborting transactions that have done less work - however, it appears breaking cycles by telling other threads to abort may still be buggy, so disable that for now. Signed-off-by: Kent Overstreet commit 1148a97f1fb9b80ef5355021f0c2dfc7b8f003a2 Author: Kent Overstreet Date: Sun Oct 9 04:29:04 2022 -0400 bcachefs: Print cycle on unrecoverable deadlock Some lock operations can't fail; a cycle of nofail locks is impossible to recover from. So we want to get rid of these nofail locking operations, but as this is tricky it'll be done incrementally. If such a cycle happens, this patch prints out which codepaths are involved so we know what to work on next. Signed-off-by: Kent Overstreet commit 1be887979bc12a6c88b33b0d53dfdc369bfa9d49 Author: Kent Overstreet Date: Sun Oct 9 03:32:17 2022 -0400 bcachefs: Handle dropping pointers in data_update path Cached pointers are generally dropped, not moved: this led to an assertion firing in the data update path when there were no new replicas being written. This path adds a data_options field for pointers to be dropped, and tweaks move_extent() to check if we're only dropping pointers, not writing new ones, before kicking off a data update operation. Signed-off-by: Kent Overstreet commit 160dff6dad43d9428b1250f927721a9a8756cfd9 Author: Kent Overstreet Date: Sun Oct 9 02:30:50 2022 -0400 bcachefs: Ratelimit ec error message We should fix this, but for now this makes this more usable. Signed-off-by: Kent Overstreet commit 2da671dc4a62da6de4ce0de529fc3e80f1f8f603 Author: Kent Overstreet Date: Sun Oct 9 02:25:53 2022 -0400 bcachefs: Use btree_type_has_ptrs() more consistently Signed-off-by: Kent Overstreet commit 6c22eb7085d3ee055a178ed0a4e8d0e5d18800f3 Author: Kent Overstreet Date: Sun Oct 9 01:08:51 2022 -0400 bcachefs: Fix "multiple types of data in same bucket" with ec Signed-off-by: Kent Overstreet commit 22f516213358379732d63367432d334157cbbe4d Author: Kent Overstreet Date: Sun Oct 9 00:54:36 2022 -0400 bcachefs: Ensure fsck error is printed before panic When errors=panic, we want to make sure we print the error before calling bch2_inconsistent_error(). Signed-off-by: Kent Overstreet commit 8aaee94d463f781fbd5377b7d96234342de9c6eb Author: Kent Overstreet Date: Mon Oct 3 16:41:17 2022 -0400 bcachefs: Fix a deadlock in btree_update_nodes_written() btree_node_lock_nopath() is something we'd like to get rid of, it's always prone to deadlocks if we accidentally are holding other locks, because it doesn't mark the lock it's taking in a path: we'll want to get rid of it in the future, but for now this patch works it by calling bch2_trans_unlock(). Signed-off-by: Kent Overstreet commit 13bc41a7151a6af26107240fbdd2562d95adad44 Author: Kent Overstreet Date: Mon Oct 3 16:39:49 2022 -0400 bcachefs: bch2_trans_locked() Useful debugging function. Signed-off-by: Kent Overstreet commit 40a44873a5ca9843532344d12583e6a3a78ea848 Author: Kent Overstreet Date: Sun Oct 2 01:41:08 2022 -0400 bcachefs: Improve btree_deadlock debugfs output This changes bch2_check_for_deadlock() to print the longest chains it finds - when we have a deadlock because the cycle detector isn't finding something, this will let us see what it's missing. Signed-off-by: Kent Overstreet commit 943f9946a6cc58e2c15ae39970547cddbe845190 Author: Kent Overstreet Date: Sat Oct 1 23:54:46 2022 -0400 bcachefs: Don't quash error in bch2_bucket_alloc_set_trans() We were incorrectly returning -BCH_ERR_insufficient_devices when we'd received a different error from bch2_bucket_alloc_trans(), which (erronously) turns into -EROFS further up the call chain. Signed-off-by: Kent Overstreet commit 685e0f0c477dfc2b2147a20137a349f25b0a1f62 Author: Kent Overstreet Date: Wed Sep 28 10:16:57 2022 -0400 bcachefs: Fix a trans path overflow in bch2_btree_delete_range_trans() bch2_btree_delete_range_trans() was using btree_trans_too_many_iters() to avoid path overflow, but this was buggy here (and also btree_trans_too_many_iters() is suspect in general). btree_trans_too_many_iters() only returns true when we're close to the maximum number of paths - within 8 - but extent insert/delete assumes that it can use more paths than that. Instead, we need to call bch2_trans_begin() on every loop iteration. Since we don't want to call bch2_trans_begin() (restarting the outer transaction) if the call was a no-op - if we had no work to do - we have to structure things a bit oddly. Signed-off-by: Kent Overstreet commit ae10fe017bf54653a61a93e49fac1c3e2b474e20 Author: Kent Overstreet Date: Fri Nov 4 16:06:55 2022 -0400 bcachefs: bucket_alloc_state This refactoring puts our various allocation path counters into a dedicated struct - the upcoming nocow patch is going to add another counter. Signed-off-by: Kent Overstreet commit 29cea6f4834b36f6a51832e08218e03b60002a9a Author: Kent Overstreet Date: Tue Sep 27 18:56:57 2022 -0400 bcachefs: Fix bch2_btree_path_up_until_good_node() There was a rare bug when path->locks_want was nonzero, but not BTREE_MAX_DEPTH, where we'd return on a valid node that wasn't locked - oops. Signed-off-by: Kent Overstreet commit e0eaf8625974d91b4e50a0911b11af5d46c811c9 Author: Kent Overstreet Date: Tue Sep 27 17:17:23 2022 -0400 bcachefs: Factor out bch2_write_drop_io_error_ptrs() Move slowpath code to a separate, non-inline function. Signed-off-by: Kent Overstreet commit 99e2146bea04d092d9fe2825c4dcd1fb19994bce Author: Kent Overstreet Date: Mon Sep 26 22:34:49 2022 -0400 bcachefs: Break out bch2_btree_path_traverse_cached_slowpath() Prep work for further refactoring. Signed-off-by: Kent Overstreet commit 2d848dacb2a7b7b6766c43b1945351ef360f4344 Author: Kent Overstreet Date: Mon Sep 26 18:21:07 2022 -0400 bcachefs: Kill io_in_flight semaphore This used to be needed more for buffered IO, but now the block layer has writeback throttling - we can delete this now. Signed-off-by: Kent Overstreet commit 68b6cd194ab23d0696a9d7adb024eabca95d4920 Author: Kent Overstreet Date: Mon Sep 26 18:18:00 2022 -0400 bcachefs: Improve bucket_alloc tracepoint It now includes more info - whether the bucket was for metadata or data - and also call it in the same place as the bucket_alloc_fail tracepoint. Signed-off-by: Kent Overstreet commit c298fd7d346f5a7c55c4f1d01f97fbd39da9ff53 Author: Kent Overstreet Date: Mon Sep 26 18:15:33 2022 -0400 bcachefs; Mark __bch2_trans_iter_init as inline This function is fairly small and only used in two places: one very hot, the other cold, so it should definitely be inlined. Signed-off-by: Kent Overstreet commit 25b4b3308e3a0dd45677b6eeeea4431ee08a32c1 Author: Kent Overstreet Date: Mon Sep 26 18:13:29 2022 -0400 bcachefs: Inline fast path of check_pos_snapshot_overwritten() This moves the slowpath of check_pos_snapshot_overwritten() to a separate function, and inlines the fast path - helping performance on btrees that don't use snapshot and for users that aren't using snapshots. Signed-off-by: Kent Overstreet commit c23a9e088259193dc883371cf49c99fed675e951 Author: Kent Overstreet Date: Mon Sep 26 16:23:19 2022 -0400 bcachefs: Improve jset_validate() Previously, jset_validate() was formatting the initial part of an error string for every entry it validating - expensive. This moves that code to journal_entry_err_msg(), which is now only called if there's an actual error. Signed-off-by: Kent Overstreet commit 3f3bc66ef0601e425a3c2901b34a825d4166da63 Author: Kent Overstreet Date: Mon Sep 26 16:19:56 2022 -0400 bcachefs: Optimize btree_path_alloc() - move slowpath code to a separate function, btree_path_overflow() - no need to use hweight64 - copy nr_max_paths from btree_transaction_stats to btree_trans, avoiding a data dependency in the fast path Signed-off-by: Kent Overstreet commit 14d8f26ad09d05676e90dc4fe1e6728e13d84607 Author: Kent Overstreet Date: Mon Sep 26 16:15:17 2022 -0400 bcachefs: Inline bch2_trans_kmalloc() fast path Small performance optimization. Signed-off-by: Kent Overstreet commit f3b8403ee70e5dcce5a16d3517b411bd8839319b Author: Kent Overstreet Date: Sun Sep 25 22:26:48 2022 -0400 bcachefs: Run bch2_fs_counters_init() earlier We need counters to be initialized before initializing shrinkers - the shrinker callbacks will update those counters. This fixes a segfault in userspace. Signed-off-by: Kent Overstreet commit d704d62355b76e3f1f7efbe9b3072627fd4b4a3f Author: Kent Overstreet Date: Sun Sep 25 18:22:54 2022 -0400 bcachefs: btree_err() now uses bch2_print_string_as_lines() We've seen long error messages get truncated here, so convert to the new bch2_print_string_as_lines(). Signed-off-by: Kent Overstreet commit dbb9936b0dc905657db6e5289be18e425f1b60d3 Author: Kent Overstreet Date: Sun Sep 25 18:18:48 2022 -0400 bcachefs: Improve bch2_fsck_err() - factor out fsck_err_get() - if the "bcachefs (%s):" prefix has already been applied, don't duplicate it - convert to printbufs instead of static char arrays - tidy up control flow a bit - use bch2_print_string_as_lines(), to avoid messages getting truncated Signed-off-by: Kent Overstreet commit a8f35428430446d8c9e871b36ab2b49c0a9daec7 Author: Kent Overstreet Date: Sun Sep 25 16:43:55 2022 -0400 bcachefs: bch2_print_string_as_lines() This adds a helper for printing a large buffer one line at a time, to avoid the 1k printk limit. Signed-off-by: Kent Overstreet commit e9174370d0522b466ea770576230b487941101f8 Author: Kent Overstreet Date: Sun Sep 25 16:42:53 2022 -0400 bcachefs: bch2_btree_node_relock_notrace() Most of the node_relock_fail trace events are generated from bch2_btree_path_verify_level(), when debugcheck_iterators is enabled - but we're not interested in these trace events, they don't indicate that we're in a slowpath. Signed-off-by: Kent Overstreet commit c36ff038fd3af6092e356cb4ed1c79a041b77b19 Author: Kent Overstreet Date: Sun Sep 25 14:49:14 2022 -0400 bcachefs: bch2_btree_cache_scan() improvement We're still seeing OOM issues caused by the btree node cache shrinker not sufficiently freeing memory: thus, this patch changes the shrinker to not exit if __GFP_FS was not supplied. Instead, tweak btree node memory allocation so that we never invoke memory reclaim while holding the btree node cache lock. Signed-off-by: Kent Overstreet commit c6cf49a95ac7aea3450cacb66b7de1d46671deeb Author: Kent Overstreet Date: Fri Sep 23 21:00:24 2022 -0400 bcachefs: Fix blocking with locks held This is a major oopsy - we should always be unlocking before calling closure_sync(), else we'll cause a deadlock. Signed-off-by: Kent Overstreet commit 01ed3359b2705d7b862ad0644dabc616774f8779 Author: Kent Overstreet Date: Fri Sep 23 00:20:21 2022 -0400 bcachefs: btree_update_nodes_written() needs BTREE_INSERT_USE_RESERVE This fixes an obvious deadlock - whoops. Signed-off-by: Kent Overstreet commit d602657cd185784bf4b227ecd1a88ed90735eae5 Author: Kent Overstreet Date: Thu Sep 22 21:27:42 2022 -0400 bcachefs: Fix error handling in bch2_btree_update_start() We were checking for -EAGAIN, but we're not returned that when we didn't pass a closure to wait with - oops. Signed-off-by: Kent Overstreet commit afbc71946861902cfee7bee2b16c8e1570375e0e Author: Kent Overstreet Date: Thu Sep 1 22:56:27 2022 -0400 bcachefs: Improve bch2_btree_trans_to_text() This is just a formatting/readability improvement. Signed-off-by: Kent Overstreet commit 8b31e4fc7d9e27fd5dc56bb063acf9e4ea575973 Author: Kent Overstreet Date: Mon Aug 22 15:29:53 2022 -0400 bcachefs: Kill normalize_read_intent_locks() Before we had the deadlock cycle detector, we didn't want to be holding read locks when taking intent locks, because blocking on an intent lock while holding a read lock was a lock ordering violation that could cause a deadlock. With the cycle detector this is no longer an issue, so this code can be deleted. Signed-off-by: Kent Overstreet commit 2ec254c098da677295c2487ae36e75a26d557222 Author: Kent Overstreet Date: Mon Mar 6 08:58:02 2023 -0500 bcachefs: Ensure bch2_btree_node_lock_write_nofail() never fails In order for bch2_btree_node_lock_write_nofail() to never produce a deadlock, we must ensure we're never holding read locks when using it. Fortunately, it's only used from code paths where any read locks may be safely dropped. Signed-off-by: Kent Overstreet commit 0d7009d7ca99ad9261a7cffcecd515108377a6ac Author: Kent Overstreet Date: Mon Aug 22 15:29:53 2022 -0400 bcachefs: Delete old deadlock avoidance code This deletes our old lock ordering based deadlock avoidance code. Signed-off-by: Kent Overstreet commit 96d994b37cfcf468bf1d71527ae95ad93a311e38 Author: Kent Overstreet Date: Mon Aug 22 23:12:11 2022 -0400 bcachefs: Print deadlock cycle in debugfs In the event that we're not finished debugging the cycle detector, this adds a new file to debugfs that shows what the cycle detector finds, if anything. By comparing this with btree_transactions, which shows held locks for every btree_transaction, we'll be able to determine if it's the cycle detector that's buggy or something else. Signed-off-by: Kent Overstreet commit 33bd5d068603f9e81e0b73dbe50e9b88b2e56d0d Author: Kent Overstreet Date: Mon Aug 22 13:23:47 2022 -0400 bcachefs: Deadlock cycle detector We've outgrown our own deadlock avoidance strategy. The btree iterator API provides an interface where the user doesn't need to concern themselves with lock ordering - different btree iterators can be traversed in any order. Without special care, this will lead to deadlocks. Our previous strategy was to define a lock ordering internally, and whenever we attempt to take a lock and trylock() fails, we'd check if the current btree transaction is holding any locks that cause a lock ordering violation. If so, we'd issue a transaction restart, and then bch2_trans_begin() would re-traverse all previously used iterators, but in the correct order. That approach had some issues, though. - Sometimes we'd issue transaction restarts unnecessarily, when no deadlock would have actually occured. Lock ordering restarts have become our primary cause of transaction restarts, on some workloads totally 20% of actual transaction commits. - To avoid deadlock or livelock, we'd often have to take intent locks when we only wanted a read lock: with the lock ordering approach, it is actually illegal to hold _any_ read lock while blocking on an intent lock, and this has been causing us unnecessary lock contention. - It was getting fragile - the various lock ordering rules are not trivial, and we'd been seeing occasional livelock issues related to this machinery. So, since bcachefs is already a relational database masquerading as a filesystem, we're stealing the next traditional database technique and switching to a cycle detector for avoiding deadlocks. When we block taking a btree lock, after adding ourself to the waitlist but before sleeping, we do a DFS of btree transactions waiting on other btree transactions, starting with the current transaction and walking our held locks, and transactions blocking on our held locks. If we find a cycle, we emit a transaction restart. Occasionally (e.g. the btree split path) we can not allow the lock() operation to fail, so if necessary we'll tell another transaction that it has to fail. Result: trans_restart_would_deadlock events are reduced by a factor of 10 to 100, and we'll be able to delete a whole bunch of grotty, fragile code. Signed-off-by: Kent Overstreet commit 62448afee714354a26db8a0f3c644f58628f0792 Author: Kent Overstreet Date: Fri Aug 5 13:06:44 2022 -0400 bcachefs: Fix bch2_btree_node_upgrade() Previously, if we were trying to upgrade from a read to an intent lock but we held an additional read lock via another btree_path, bch2_btree_node_upgrade() would always fail, in six_lock_tryupgrade(). This patch factors out the code that __bch2_btree_node_lock_write() uses to temporarily drop extra read locks, so that six_lock_tryupgrade() can succeed. Signed-off-by: Kent Overstreet commit 845cffed0d343ecea9f6ff3883cac9a6872d9920 Author: Kent Overstreet Date: Mon Sep 19 14:14:01 2022 -0400 bcachefs: Add a debug assert Chasing down a strange locking bug. Signed-off-by: Kent Overstreet commit 84a37cbf62e04480607ddd1940e3d8ce65b3828d Author: Kent Overstreet Date: Fri Aug 26 19:22:24 2022 -0400 six locks: Wakeup now takes lock on behalf of waiter This brings back an important optimization, to avoid touching the wait lists an extra time, while preserving the property that a thread is on a lock waitlist iff it is waiting - it is never removed from the waitlist until it has the lock. Signed-off-by: Kent Overstreet commit e4b7254c754b676a6f4d607fd92cd71d221ff130 Author: Kent Overstreet Date: Sat Oct 15 00:34:38 2022 -0400 six locks: Fix a lost wakeup There was a lost wakeup between a read unlock in percpu mode and a write lock. The unlock path unlocks, then executes a barrier, then checks for waiters; correspondingly, the lock side should set the wait bit and execute a barrier, then attempt to take the lock. Signed-off-by: Kent Overstreet commit 5b254da5733d9b8c6a13073fecc506c2861aaeb2 Author: Kent Overstreet Date: Sat Sep 24 00:13:56 2022 -0400 six locks: Enable lockdep Now that we have lockdep_set_no_check_recursion(), we can enable lockdep checking. Signed-off-by: Kent Overstreet commit f6ea2d575d70ab0e1aaa9f9fced1d04e6dd6ef4f Author: Kent Overstreet Date: Sat Sep 24 01:33:13 2022 -0400 six locks: Add start_time to six_lock_waiter This is needed by the cycle detector in bcachefs - we need a way to iterater over waitlist entries while dropping and retaking the waitlist lock. Signed-off-by: Kent Overstreet commit 0bfb9f42b7b16aa11a7b5d283b0b7b98d11476b7 Author: Kent Overstreet Date: Sat Aug 27 16:22:51 2022 -0400 six locks: six_lock_waiter() This allows passing in the wait list entry - to be used for a deadlock cycle detector. Signed-off-by: Kent Overstreet commit ebc6f76a667f5fc599a5f76515f6881dfb82af2f Author: Kent Overstreet Date: Thu Aug 25 10:49:52 2022 -0400 six locks: Simplify wait lists This switches to a single list of waiters, instead of separate lists for read and intent, and switches write locks to also use the wait lists instead of being handled differently. Also, removal from the wait list is now done by the process waiting on the lock, not the process doing the wakeup. This is needed for the new deadlock cycle detector - we need tasks to stay on the waitlist until they've successfully acquired the lock. Signed-off-by: Kent Overstreet commit 098ef98d5bff461c66c3798fbebca7b1c06fdf79 Author: Kent Overstreet Date: Sun Sep 18 17:10:33 2022 -0400 bcachefs: Add private error codes for ENOSPC Continuing the saga of introducing private dedicated error codes for each error path, this patch converts ENOSPC to error codes that are subtypes of ENOSPC. We've recently had a test failure where we got -ENOSPC where we shouldn't have, and didn't have enough information to tell where it came from, so this patch will solve that problem. Signed-off-by: Kent Overstreet commit 5c1ef830f6786059f85bebe7501b63dffed0b633 Author: Kent Overstreet Date: Sun Sep 18 15:43:50 2022 -0400 bcachefs: Errcodes can now subtype standard error codes The next patch is going to be adding private error codes for all the places we return -ENOSPC. Additionally, this patch updates return paths at all module boundaries to call bch2_err_class(), to return the standard error code. Signed-off-by: Kent Overstreet commit 57ce827442c4e7b0f38b14b91c97413c5d779697 Author: Kent Overstreet Date: Sun Sep 18 13:37:34 2022 -0400 bcachefs: Make an assertion more informative Signed-off-by: Kent Overstreet commit e4215d0fec777e6516306f5f1b69a45a4205dce0 Author: Kent Overstreet Date: Fri Sep 16 14:42:38 2022 -0400 bcachefs: All held locks must be in a btree path With the new deadlock cycle detector, it's critical that all held locks be marked in a btree_path, because that's what the cycle detector traverses - any locks that aren't correctly marked will cause deadlocks. This changes the btree_path to allocate some btree_paths for the new nodes, since until the final update is done we otherwise don't have a path referencing them. Signed-off-by: Kent Overstreet commit 367d72dd5fd5b9e0b87633cbcb11b58b91d6bcc5 Author: Kent Overstreet Date: Sat Sep 17 14:36:24 2022 -0400 bcachefs: bch2_btree_path_upgrade() now emits transaction restart Centralizing the transaction restart/tracepoint in bch2_btree_path_upgrade() lets us improve the tracepoint - now it emits old and new locks_want. Signed-off-by: Kent Overstreet commit b8eec675912ecb7e53dabe35d2869c2da60c45c9 Author: Kent Overstreet Date: Sat Sep 17 15:20:13 2022 -0400 bcachefs: Add a manual trigger for lock wakeups Spotted a lockup once that appeared to be a lost wakeup. Adding a manual trigger for lock wakeups will make it easy to tell if that's what it is next time it occurs. Signed-off-by: Kent Overstreet commit 5a82c7c7d1925f6f060a427f38ea17b53c6945f1 Author: Kent Overstreet Date: Fri Sep 16 18:39:01 2022 -0400 bcachefs: Fix sb_field_counters formatting We have counters with longer names now, so adjust the tabstop - also, make sure there's always a space printed between the name and the number. Signed-off-by: Kent Overstreet commit 5877d8876afe1c5843731244f39d1739eba2665f Author: Kent Overstreet Date: Sun Sep 4 14:10:12 2022 -0400 bcachefs: Re-enable hash_redo_key() When subvolumes & snapshots were rolled out, hash_redo_key() was disabled due to some new complications - namely, bch2_hash_set() works at the subvolume level, and fsck does not run in a defined subvolume, instead working at the snapshot ID level. This patch splits out bch2_hash_set_snapshot() from bch2_hash_set(), and makes one small tweak for fsck: - Normally, bch2_hash_set() (and other dirent code) needs to know what subvolume we're in, because dirents that point to other subvolumes should only be visible in the subvolume they were created in, not other snapshots. We can't check that in fsck, so we just assume that all dirents are visible. Signed-off-by: Kent Overstreet commit 1ffb876fb0f31632b761ee721f633e0d7491ca7b Author: Kent Overstreet Date: Mon Sep 12 02:22:47 2022 -0400 bcachefs: Kill journal_keys->journal_seq_base This removes an optimization that didn't actually save us any memory, due to alignment, but did make the code more complicated than it needed to be. We were also seeing a bug where journal_seq_base wasn't getting correctly initailized, so hopefully it'll fix that too. Signed-off-by: Kent Overstreet commit e87b0e4a7120eeca1850666351b75bf8ceb9d5c9 Author: Kent Overstreet Date: Sun Sep 4 01:28:51 2022 -0400 bcachefs: Fix redundant transaction restart Little bit of tidying up, this makes the counters a little bit clearer as to what's happening. Signed-off-by: Kent Overstreet commit 1bb9123301834fbeb81de9e52181ba71b06a011a Author: Kent Overstreet Date: Sat Sep 3 22:24:16 2022 -0400 bcachefs: Ensure intent locks are marked before taking write locks Locks must be correctly marked for the cycle detector to work. Signed-off-by: Kent Overstreet commit 38474c264252475196a5e3c555b2625a5bc36a00 Author: Kent Overstreet Date: Fri Sep 2 22:59:39 2022 -0400 bcachefs: Avoid using btree_node_lock_nopath() With the upcoming cycle detector, we have to be careful about using btree_node_lock_nopath - in particular, using it to take write locks can cause deadlocks. All held locks need to be tracked in a btree_path, so that the cycle detector knows about them - unless we know that we cannot cause deadlocks for other reasons: e.g. we are only taking read locks, or we're in very early fsck (topology repair). Signed-off-by: Kent Overstreet commit 3d21d48e898a2eadc9055c44e0fd51e6087c9e9f Author: Kent Overstreet Date: Sat Sep 3 22:07:31 2022 -0400 bcachefs: Fix usage of six lock's percpu mode, key cache version Similar to "bcachefs: Fix usage of six lock's percpu mode", six locks have a percpu mode, but we can't switch between percpu and non percpu modes while a lock is in use: threads attempting to take a read lock may race, and we'll end up with the read count permanently off. Fixing this the "correct" way, in six_lock_pcpu_(alloc|free) would require an RCU barrier, and we don't want to do that - instead, we have to permanently segragate percpu and non percpu objects, including when on freelists. Signed-off-by: Kent Overstreet commit 0242130fb67fdcc617229fb9112c50f4caabab3c Author: Kent Overstreet Date: Sat Sep 3 21:14:53 2022 -0400 bcachefs: Refactor bkey_cached_alloc() path Clean up the arguments passed and make them more consistent. Signed-off-by: Kent Overstreet commit da4474f20961f995a1d54f82b4c462c94ea03552 Author: Kent Overstreet Date: Sat Sep 3 21:09:54 2022 -0400 bcachefs: Convert more locking code to btree_bkey_cached_common Ideally, all the code in btree_locking.c should be converted, but then we'd want to convert btree_path to point to btree_key_cached_common too, and then we'd be in for a much bigger cleanup - but a bit of incremental cleanup will still be helpful for the next patches. Signed-off-by: Kent Overstreet commit 4e6defd106b69c3a78da380d694fd43275125dda Author: Kent Overstreet Date: Wed Aug 31 18:53:42 2022 -0400 bcachefs: btree_bkey_cached_common->cached Add a type descriptor to btree_bkey_cached_common - there's no reason not to since we've got padding that was otherwise unused, and this is a nice cleanup (and helpful in later patches). Signed-off-by: Kent Overstreet commit 6b81f194f345d15dd15601ee7b604a0640445895 Author: Kent Overstreet Date: Thu Sep 1 22:05:16 2022 -0400 bcachefs: Fix six_lock_readers_add() Have to be careful with bit fields - when subtracting, this was overflowing into the write_locking bit. Signed-off-by: Kent Overstreet commit d5024b011cb37b03aeeddd4b38857db427a04f11 Author: Kent Overstreet Date: Mon Aug 22 23:39:23 2022 -0400 bcachefs: bch2_btree_node_lock_write_nofail() Taking a write lock will be able to fail, with the new cycle detector - unless we pass it nofail, which is possible but not preferred. Signed-off-by: Kent Overstreet commit ca7d8fcabf29fae627babb72bda9b51763f9a145 Author: Kent Overstreet Date: Sun Aug 21 14:29:43 2022 -0400 bcachefs: New locking functions In the future, with the new deadlock cycle detector, we won't be using bare six_lock_* anymore: lock wait entries will all be embedded in btree_trans, and we will need a btree_trans context whenever locking a btree node. This patch plumbs a btree_trans to the few places that need it, and adds two new locking functions - btree_node_lock_nopath, which may fail returning a transaction restart, and - btree_node_lock_nopath_nofail, to be used in places where we know we cannot deadlock (i.e. because we're holding no other locks). Signed-off-by: Kent Overstreet commit 546180874ade7225676bc0cd5ea4e2388e2374bc Author: Kent Overstreet Date: Fri Aug 26 14:55:00 2022 -0400 bcachefs: Mark write locks before taking lock six locks are unfair: while a thread is blocked trying to take a write lock, new read locks will fail. The new deadlock cycle detector makes use of our existing lock tracing, so we need to tell it we're holding a write lock before we take the lock for it to work correctly. Signed-off-by: Kent Overstreet commit 534a591e4cf98d036e478b93de4a95ff126fb018 Author: Kent Overstreet Date: Sat Aug 27 17:47:27 2022 -0400 bcachefs: Delete time_stats for lock contended times Since we've now got time_stats for lock hold times (per btree transaction), we don't need this anymore. Signed-off-by: Kent Overstreet commit c919f53f3bcba3598fc6ce1ee5c5aed75d0834b7 Author: Kent Overstreet Date: Tue Aug 30 11:40:03 2022 -0400 bcachefs: Don't leak lock pcpu counts memory This fixes a small memory leak. Signed-off-by: Kent Overstreet commit f5178b34b9f1b53d2a97a2a210d3c284966428e4 Author: Kent Overstreet Date: Sat Aug 27 15:00:59 2022 -0400 six locks: Delete six_lock_pcpu_free_rcu() Didn't have any users, and wasn't a good idea to begin with - delete it. Signed-off-by: Kent Overstreet commit 674cfc26240b7807f078a23a4f04681ccae49b02 Author: Kent Overstreet Date: Sat Aug 27 12:48:36 2022 -0400 bcachefs: Add persistent counters for all tracepoints Also, do some reorganizing/renaming, convert atomic counters in bch_fs to persistent counters, and add a few missing counters. Signed-off-by: Kent Overstreet commit d97e6aaed60a9c2c727cce2979ca311fe232163f Author: Kent Overstreet Date: Sat Aug 27 12:37:05 2022 -0400 bcachefs: Fix bch2_btree_update_start() to return -BCH_ERR_journal_reclaim_would_deadlock On failure to get a journal pre-reservation because we're called from journal reclaim we're not supposed to return a transaction restart error - this fixes a livelock. Signed-off-by: Kent Overstreet commit 8a9c1b1cb0edacdf4ac9c378c4ec4fc376fc8bac Author: Kent Overstreet Date: Sat Aug 27 12:28:09 2022 -0400 bcachefs: Improve bch2_btree_node_relock() This moves the IS_ERR_OR_NULL() check to the inline part, since that's a fast path event. Signed-off-by: Kent Overstreet commit ce56bf7fc23b6c2cf6edfbdfba1805c1842641ca Author: Kent Overstreet Date: Sat Aug 27 12:23:38 2022 -0400 bcachefs: Improve trans_restart_journal_preres_get tracepoint It now includes journal_flags. Signed-off-by: Kent Overstreet commit 5f1dd9a633dd0aa8429742cdba08d9566f49177b Author: Kent Overstreet Date: Sat Aug 27 12:11:18 2022 -0400 bcachefs: Improve btree_node_relock_fail tracepoint It now prints the error name when the btree node is an error pointer; also, don't trace failures when the the btree node is BCH_ERR_no_btree_node_up. Signed-off-by: Kent Overstreet commit b1cdc398ae36689300b4108ce9c90c58cac1ba34 Author: Kent Overstreet Date: Sat Aug 27 10:30:36 2022 -0400 bcachefs: Make more btree_paths available - Don't decrease BTREE_ITER_MAX when building with CONFIG_LOCKDEP anymore. The lockdep table sizes are configurable now, we don't need this anymore. - btree_trans_too_many_iters() is less conservative now. Previously it was causing a transaction restart if we had used more than BTREE_ITER_MAX / 2 paths, change this to BTREE_ITER_MAX - 8. This helps with excessive transaction restarts/livelocks in the bucket allocator path. Signed-off-by: Kent Overstreet commit 06a53943222be722e5f85782721e4701bcd424e8 Author: Kent Overstreet Date: Thu Aug 25 21:42:46 2022 -0400 bcachefs: Correctly initialize bkey_cached->lock We need to use the right class for some assertions to work correctly. Signed-off-by: Kent Overstreet commit 131dcd5af7e2f1b13c2c0baf3095d7e449eb9859 Author: Kent Overstreet Date: Mon Aug 22 21:05:31 2022 -0400 bcachefs: Track held write locks The upcoming lock cycle detection code will need to know precisely which locks every btree_trans is holding, including write locks - this patch updates btree_node_locked_type to include write locks. Signed-off-by: Kent Overstreet commit c240c3a94427346f27a7ff48f02cbe03f2c2ebd6 Author: Kent Overstreet Date: Tue Aug 23 01:20:24 2022 -0400 bcachefs: Print lock counts in debugs btree_transactions Improve our debugfs output, to help in debugging deadlocks: this shows, for every btree node we print, the current number of readers/intent locks/write locks held. Signed-off-by: Kent Overstreet commit 14599cce443323ce23b4b266068b7018e42bd30c Author: Kent Overstreet Date: Mon Aug 22 13:21:10 2022 -0400 bcachefs: Switch btree locking code to struct btree_bkey_cached_common This is just some type safety cleanup. Signed-off-by: Kent Overstreet commit 616928c30f594775953ca75eb7ccc312a8abeb73 Author: Kent Overstreet Date: Mon Aug 22 21:49:55 2022 -0400 bcachefs: Track maximum transaction memory This patch - tracks maximum bch2_trans_kmalloc() memory used in btree_transaction_stats - makes it available in debugfs - switches bch2_trans_init() to using that for the amount of memory to preallocate, instead of the parameter passed in This drastically reduces transaction restarts, and means we no longer need to track this in the source code. Signed-off-by: Kent Overstreet commit e3738c6909d69e980d8b56d33df2e438a2c1c798 Author: Kent Overstreet Date: Sun Aug 21 23:08:53 2022 -0400 six locks: Improve six_lock_count six_lock_count now counts up whether a write lock held, and this patch now also correctly counts six_lock->intent_lock_recurse. Signed-off-by: Kent Overstreet commit 2e27f6567b2662a2f7440a651e007ebc77cdcc7a Author: Kent Overstreet Date: Sun Aug 21 17:20:42 2022 -0400 bcachefs: Kill nodes_intent_locked Previously, we used two different bit arrays for tracking held btree node locks. This patch switches to an array of two bit integers, which will let us track, in a future patch, when we hold a write lock. Signed-off-by: Kent Overstreet commit d4263e563879f6dda86052881fbbc9e21e6e07f5 Author: Kent Overstreet Date: Sun Aug 21 18:17:51 2022 -0400 bcachefs: Better use of locking helpers Held btree locks are tracked in btree_path->nodes_locked and btree_path->nodes_intent_locked. Upcoming patches are going to change the representation in struct btree_path, so this patch switches to proper helpers instead of direct access to these fields. Signed-off-by: Kent Overstreet commit 8e5696698d140f599586426fb9a897abb0eaa576 Author: Kent Overstreet Date: Fri Aug 19 19:50:18 2022 -0400 bcachefs: Reorganize btree_locking.[ch] Tidy things up a bit before doing more work in this file. Signed-off-by: Kent Overstreet commit cd5afabea1acd2bc351ec08d59511302b397f150 Author: Kent Overstreet Date: Fri Aug 19 15:35:34 2022 -0400 bcachefs: btree_locking.c Start to centralize some of the locking code in a new file; more locking code will be moving here in the future. Signed-off-by: Kent Overstreet commit 02afcb8c26b14ae317754d8c79339f41b3dfeaae Author: Kent Overstreet Date: Thu Aug 18 17:57:24 2022 -0400 bcachefs: Fix adding a device with a label Device labels are represented as pointers in the member info section: we need to get and then set the label for it to be kept correctly. Signed-off-by: Kent Overstreet commit 12043cf1511420ecf38f4925a0089c1ae1aa058b Author: Kent Overstreet Date: Thu Aug 18 17:00:12 2022 -0400 bcachefs: fsck: Another transaction restart handling fix Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 42590b53fef427f96fc50da4974923564e9033cd Author: Kent Overstreet Date: Thu Aug 18 13:00:26 2022 -0400 bcachefs: bch2_btree_delete_range_trans() now returns -BCH_ERR_transaction_restart_nested The new convention is that functions that handle transaction restarts within an existing transaction context should return -BCH_ERR_transaction_restart_nested when they did so, since they invalidated the outer transaction context. This also means bch2_btree_delete_range_trans() is changed to only call bch2_trans_begin() after a transaction restart, not on every loop iteration. This is to fix a bug in fsck, in check_inode() when we truncate an inode with BCH_INODE_I_SIZE_DIRTY set. Signed-off-by: Kent Overstreet commit efd0d03816dd0d5127217220f85f1f0e621974d1 Author: Kent Overstreet Date: Wed Aug 17 22:17:08 2022 -0400 bcachefs: Minor transaction restart handling fix - fsck_inode_rm() wasn't returning BCH_ERR_transaction_restart_nested - change bch2_trans_verify_not_restarted() to call panic() - we don't want these errors to be missed Signed-off-by: Kent Overstreet commit 23dfb3a2f7757593249b745f2a17b56b756d2874 Author: Kent Overstreet Date: Wed Aug 17 17:49:12 2022 -0400 bcachefs: Fix bch2_btree_iter_peek_slot() error path iter->k needs to be consistent with iter->pos - required for bch2_btree_iter_(rewind|advance) to work correctly. Signed-off-by: Kent Overstreet commit 8192f8a58626ca3903a20f942ce86a6beb959a71 Author: Kent Overstreet Date: Tue Aug 16 03:08:15 2022 -0400 bcachefs: Another should_be_locked fixup When returning a key from the key cache, in BTREE_ITER_WITH_KEY_CACHE mode, we don't want to set should_be_locked on iter->path; we're not returning a key from that path, so we donn't need to, and also since we traversed the key cache iterator before setting should_be_locked on that path it might be unlocked (if we unlocked, bch2_trans_relock() won't have relocked it). Signed-off-by: Kent Overstreet commit d0b50524f1d9b60318b92830546b45cd3325cfe2 Author: Kent Overstreet Date: Sun Aug 14 14:44:17 2022 -0400 bcachefs: bch2_bkey_packed_to_binary_text() For debugging the eytzinger search tree code, and low level bkey packing code, it can be helpful to see things in binary: this patch improves our helpers for doing so. Signed-off-by: Kent Overstreet commit f0d2e9f2e511c137b75f15d0d13abd0217239253 Author: Kent Overstreet Date: Thu Jul 7 00:37:46 2022 -0400 bcachefs: Add assertions for unexpected transaction restarts Signed-off-by: Kent Overstreet commit 223b560e02098502b4e1c87aa9767620852d1bfd Author: Kent Overstreet Date: Mon Aug 15 18:55:20 2022 -0400 bcachefs: btree_path_down() optimization We should be calling btree_node_mem_ptr_set() before path_level_init(), since we already touched the key that btree_node_mem_ptr_set() will modify and path_level_init() will be doing the lookup in the child btree node we're recursing to. Signed-off-by: Kent Overstreet commit bbf4288401519a7554201caf9b945c79f29753b3 Author: Kent Overstreet Date: Wed Aug 17 14:20:48 2022 -0400 bcachefs: Always rebuild aux search trees when node boundaries change Topology repair may change btree node min/max keys: when it does so, we need to always rebuild eytzinger search trees because nodes directly depend on those values. This fixes a bug found by the 'kill_btree_node' test, where we'd pop an assertion in bch2_bset_search_linear(). Signed-off-by: Kent Overstreet commit 15bc0948e73d9a858a6b69fc4eb34d176436044c Author: Kent Overstreet Date: Mon Aug 15 14:05:44 2022 -0400 bcachefs: Add an overflow check in set_bkey_val_u64s() For now this is just a BUG_ON() - we may want to change this to return an error in the future. Signed-off-by: Kent Overstreet commit efa8a7014d288b713781404367b54ef10aa2477f Author: Olexa Bilaniuk Date: Mon Aug 15 14:20:22 2022 -0400 bcachefs: remove dead whiteout_u64s argument. Signed-off-by: Olexa Bilaniuk Signed-off-by: Kent Overstreet commit 9375fbc20079ed0c8a10d8d387b2c173a3dc04d7 Author: Kent Overstreet Date: Sun Aug 14 16:11:35 2022 -0400 bcachefs: Debugfs cleanup This improves flush_buf() so that it always returns nonzero when we're done reading and ready to return to userspace, and so that it returns the value we want to return to userspace (number of bytes read, if there wasn't an error). In the future we'll be better abstracting this mechanism and pulling it out of bcachefs, and using it to replace seq_file. Signed-off-by: Kent Overstreet commit c59d66b51b11064f17d87d5b9695e0216b8ade99 Author: Kent Overstreet Date: Mon Aug 15 14:01:56 2022 -0400 bcachefs: Fix bch2_fs_check_snapshots() We were iterating starting at BCACHEFS_ROOT_INO, but snapshots start at POS_MIN - meaning this code was never getting run. Signed-off-by: Kent Overstreet Reported-by: Olexa Bilaniuk commit c497df8b85a7be22373d3d2e57e067285ebcd731 Author: Kent Overstreet Date: Fri Aug 12 12:45:01 2022 -0400 bcachefs: Increment restart count in bch2_trans_begin() Instead of counting transaction restarts, count when the transaction is restarted: if bch2_trans_begin() was called when the transaction wasn't restarted we need to ensure restart_count is still incremented. Signed-off-by: Kent Overstreet commit 45b033fa1afd35a8eab0af003ffac9413548f476 Author: Kent Overstreet Date: Thu Aug 11 21:06:43 2022 -0400 bcachefs: Fix assertion in bch2_btree_key_cache_drop() Turns out this assertion was something we could legitimately hit - add a comment describing what's going on, and handle it. Signed-off-by: Kent Overstreet commit ff7dc3651d5bdcc9d9fe4ace3da21f0f5c2bd778 Author: Kent Overstreet Date: Thu Aug 11 21:06:02 2022 -0400 bcachefs: Print last line in debugfs/btree_transaction_stats We need to turn the flush_buf() thing into a proper API, to replace seq_file. Signed-off-by: Kent Overstreet commit 5c0bb66ae341c71e5f62c193ea4d7b0cf278a914 Author: Kent Overstreet Date: Thu Aug 11 20:14:54 2022 -0400 bcachefs: Track the maximum btree_paths ever allocated by each transaction We need a way to check if the machinery for handling btree_paths with in a transaction is behaving reasonably, as it often has not been - we've had bugs with transaction path overflows caused by duplicate paths and plenty of other things. This patch tracks, per transaction fn, the most btree paths ever allocated by that transaction and makes it available in debugfs. Signed-off-by: Kent Overstreet commit 4aba7d4569f70167edf183055e809a37cd73cdd1 Author: Kent Overstreet Date: Thu Aug 11 19:36:24 2022 -0400 bcachefs: Rename lock_held_stats -> btree_transaction_stats Going to be adding more things to this in the next patch. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 11c1a62f3b872d2345c97e72700ed4d1b2511888 Author: Kent Overstreet Date: Thu Aug 11 17:25:25 2022 -0400 bcachefs: Switch bch2_btree_delete_range() to bch2_trans_run() This fixes an assertion about unexpected transaction restarts - bch2_delete_range_trans() handles transaction restarts. Signed-off-by: Kent Overstreet commit 7c812ab786c4a689989aabf9e865164eb4f8004d Author: Kent Overstreet Date: Thu Aug 11 13:23:04 2022 -0400 bcachefs: Fix btree_path->uptodate inconsistency This fixes an assertion in bch2_btree_path_peek_slot(). Signed-off-by: Kent Overstreet commit a300261ad19d69e080278ec4950d39caef3ffbf1 Author: Kent Overstreet Date: Wed Aug 10 20:05:14 2022 -0400 bcachefs: Fix duplicate paths left by bch2_path_put() bch2_path_put() is supposed to drop paths that aren't needed on transaction restart, or to hold locks that we're supposed to keep until transaction commit: but it was failing to free paths in some cases that it should have, leading to transaction path overflows with lots of duplicate paths. Signed-off-by: Kent Overstreet commit 6fae65c112d9fb0a9827bad094e5633fdf2bcbda Author: Kent Overstreet Date: Thu Aug 11 12:23:21 2022 -0400 bcachefs: Kill BTREE_ITER_CACHED_(NOFILL|NOCREATE) These were used more prior to getting rid of the in-memory bucket arrays - they don't serve much purpose anymore, and deleting them lets us write better assertions. Signed-off-by: Kent Overstreet commit 9f96568c0ab983fbb0f6eefa36ad799a72bc9358 Author: Kent Overstreet Date: Wed Aug 10 12:42:55 2022 -0400 bcachefs: Tracepoint improvements Our types are exported to the tracepoint code, so it's not necessary to break things out individually when passing them to tracepoints - we can also call other functions from TP_fast_assign(). Signed-off-by: Kent Overstreet commit c7be3cb546e3bb2704008506bd6c50ad5ea02441 Author: Kent Overstreet Date: Wed Aug 10 20:22:01 2022 -0400 bcachefs: "Snapshot deletion did not run correctly" should be a fsck err This was noticed when a test hit this error and didn't fail, because fsck wasn't returning that it fixed errors. Signed-off-by: Kent Overstreet commit fa3ae3ca4e13d86fe5f97c275748b3820c873091 Author: Kent Overstreet Date: Wed Aug 10 12:34:18 2022 -0400 bcachefs: six_lock_counts() is now in six.c Signed-off-by: Kent Overstreet commit 315c9ba6da5b480618a80dcb91a74a86e49366bb Author: Kent Overstreet Date: Wed Aug 10 19:08:30 2022 -0400 bcachefs: BTREE_ITER_NO_NODE -> BCH_ERR codes Signed-off-by: Kent Overstreet commit fd211bc71c9b4093ed39d4fc93294f9ff423febc Author: Kent Overstreet Date: Wed Aug 10 18:55:53 2022 -0400 bcachefs: Don't set should_be_locked on paths that aren't locked It doesn't make any sense to set should_be_locked on btree_paths that aren't locked, and is often a bug - this patch adds assertions and fixes some of those bugs. Signed-off-by: Kent Overstreet commit 31301dd46975b2423fd38fc64bc58728d89dbcac Author: Kent Overstreet Date: Tue Aug 9 13:47:03 2022 -0400 bcachefs: Fix missing error handling in bch2_subvolume_delete() This fixes an assertion when the transaction has been unexpectedly restarted. Signed-off-by: Kent Overstreet commit 15f11c1aa8a98f3b6805d0b2a300a87ef0205d34 Author: Kent Overstreet Date: Sat Aug 6 23:02:09 2022 -0400 bcachefs: Improve an error message Update an error message to use bch2_err_str(). Signed-off-by: Kent Overstreet commit 49e401fa55ab128461f84a4eeb1f2d974f3281c1 Author: Kent Overstreet Date: Sun Aug 7 13:43:32 2022 -0400 bcachefs: Tracepoint improvements - use strlcpy(), not strncpy() - add tracepoints for btree_path alloc and free - give the tracepoint for key cache upgrade fail a proper name - add a tracepoint for btree_node_upgrade_fail Signed-off-by: Kent Overstreet commit 17047fbced563cf5abe5aa546f6a92af48900b69 Author: Kent Overstreet Date: Fri Aug 5 17:08:35 2022 -0400 bcachefs: Fix incorrectly freeing btree_path in alloc path Clearing path->preserve means the path will be dropping in bch2_trans_begin() - but on transaction restart, we're likely to need that path again. This fixes a livelock in the allocation path. Signed-off-by: Kent Overstreet commit 86b74451931790eafa018021fe900faea3230189 Author: Kent Overstreet Date: Fri Aug 5 11:36:13 2022 -0400 bcachefs: Fix bch2_btree_trans_to_text() bch2_btree_trans_to_text() is used to print btree_transactions owned by other threads; thus, it needs to be particularly careful. This fixes a null ptr deref caused by racing with the owning thread changing path->l[].b. Signed-off-by: Kent Overstreet commit ae33e7a274abe6863bc4a1f4ea1e4c5f65b533f9 Author: Kent Overstreet Date: Thu Aug 4 12:46:37 2022 -0400 bcachefs: Add distinct error code for key_cache_upgrade This aids in debugging. Signed-off-by: Kent Overstreet commit 4a7f7e9e4de665d94e1a7610bf5506265df414d3 Author: Kent Overstreet Date: Tue Jul 26 00:50:25 2022 -0400 bcachefs: Fix not punting to worqueue when promoting Signed-off-by: Kent Overstreet commit 0763c552e7ef024ce6dbc9cbc828b8715dff251c Author: Kent Overstreet Date: Fri Jul 22 06:57:05 2022 -0400 bcachefs: fsck: Fix nested transaction handling This uses the new trans->restart count to make sure we always correctly return -BCH_ERR_transaction_restart_nested when we restart a nested transaction - eliminating some other hacks and preparing for new assertions. Signed-off-by: Kent Overstreet commit 91f1b9fdd2c02a7375e46bb2628870f3c6116072 Author: Kent Overstreet Date: Thu Jul 21 15:41:29 2022 -0400 bcachefs: Add an O_DIRECT option (for userspace) Sometimes we see IO errors due to O_DIRECT alignment issues - having an option to use buffered IO will be helpful. Signed-off-by: Kent Overstreet commit 01eed77178049b85ec1850717fc81bcb24e19c70 Author: Kent Overstreet Date: Thu Jul 21 09:53:28 2022 -0400 bcachefs: Tighten up btree_path assertions Currently seeing a very rare and difficult to explain btree_path inconsistency - this patch adds assertions to the only place that seems to be missing them. Signed-off-by: Kent Overstreet commit db346e7120a6dec1534184ea2abf9d22edbb9b8a Author: Kent Overstreet Date: Sun Jul 17 02:46:46 2022 -0400 bcachefs: bch2_bucket_alloc_trans_early -> for_each_btree_key_norestart Nested btree transactions require special care, and an upcoming patch is going to add assertions to that effect. We don't want to be using them unnecessarily, so this patch switches bch2_bucket_trans_early() to not handle transaction restarts. This patch also adds a cursor so that on transaction restart we can continue scanning from where the previous search for an empty bucket left off. Signed-off-by: Kent Overstreet commit 7903e3d2d7e5266dde40c9db746fafb078f84f4f Author: Kent Overstreet Date: Wed Jul 20 17:35:57 2022 -0400 bcachefs: Fix check_i_sectors() bch2_count_inode_sectors() uses for_each_btree_key() internally, which handles lock restarts - the lockrestart_do() in check_i_sectors() is redundant, and buggy here since the count that bch2_count_inode_sectors() returns was interpreted as an error by lockrestart_do(). Signed-off-by: Kent Overstreet commit d7228ecc483e1e104179a24a7e1e4568ae9235cb Author: Kent Overstreet Date: Wed Jul 20 16:50:26 2022 -0400 bcachefs: Convert debugfs code to for_each_btree_key2() This fixes a bug where we were leaking a transaction restart error to userspace. Signed-off-by: Kent Overstreet commit 84ece59ad5c1cd972619cae5a5df8998cc5e779f Author: Kent Overstreet Date: Wed Jul 20 16:25:00 2022 -0400 bcachefs: Unit test updates - Convert to for_each_btree_key2(), for_each_btree_key_commit(), for_each_btree_key_reverse() - No more bare bch2_btree_iter_peek(); we're now fault-injection lock restarts, so we always need a lockrestart_do() or equivalent. Signed-off-by: Kent Overstreet commit 4f84b7e30b3aa72ce5de032380799a1a5ba044fd Author: Kent Overstreet Date: Wed Jul 20 16:13:27 2022 -0400 bcachefs: for_each_btree_key_reverse() This adds a new macro, like for_each_btree_key2(), but for iterating in reverse order. Also, change for_each_btree_key2() to properly check the return value of bch2_btree_iter_advance(). Signed-off-by: Kent Overstreet commit 1ed0a5d280ef7a1183b42b2fcc13d919925f1b6e Author: Kent Overstreet Date: Tue Jul 19 17:20:18 2022 -0400 bcachefs: Convert fsck errors to errcode.h Signed-off-by: Kent Overstreet commit a0cb8d784f309d22323974e47b103bf01d0b62c0 Author: Kent Overstreet Date: Sun Jul 17 20:22:30 2022 -0400 bcachefs: Inject transaction restarts in debug mode In CONFIG_BCACHEFS_DEBUG mode, we'll now randomly issue transaction restarts - with a decaying probability based on the number of restarts we've already had, to ensure that transactions eventually make forward progress. This should help shake out some bugs. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 549d173c1bd9b58c2ad41217522462e012a6545f Author: Kent Overstreet Date: Sun Jul 17 23:06:38 2022 -0400 bcachefs: EINTR -> BCH_ERR_transaction_restart Now that we have error codes, with subtypes, we can switch to our own error code for transaction restarts - and even better, a distinct error code for each transaction restart reason: clearer code and better debugging. Signed-off-by: Kent Overstreet commit 0990efaeeab14de1e3e3bf2791808afebadd1cc4 Author: Kent Overstreet Date: Tue Jul 5 17:27:44 2022 -0400 bcachefs: btree_trans_too_many_iters() is now a transaction restart All transaction restarts need a tracepoint - this is essential for debugging Signed-off-by: Kent Overstreet commit 90cecb921cfe95858a32995019f11c20b6339607 Author: Kent Overstreet Date: Tue Jul 19 14:51:52 2022 -0400 bcachefs: Prevent a btree iter overflow in alloc path In bch2_bucket_alloc_trans(), we're iterating over buckets - but not directly with an iterator, since we're iterating over the freespace btree. This means that we need to clear iter->path->preserve, otherwise we'll end up retaining a btree_path for every alloc key we touched - which is not what we want here. Signed-off-by: Kent Overstreet commit d4bf5eecd78a90d019b933929a14c91d6d41af62 Author: Kent Overstreet Date: Mon Jul 18 19:42:58 2022 -0400 bcachefs: Use bch2_err_str() in error messages Signed-off-by: Kent Overstreet commit 615f867c14b2d70efb02dafb8e668d984e74d0e3 Author: Kent Overstreet Date: Sun Jul 17 22:31:21 2022 -0400 bcachefs: Improved errcodes Instead of overloading standard error codes (EINTR/EAGAIN), and defining short lists of error codes in multiple places that potentially end up overlapping & conflicting, we're now going to have one master list of error codes. Error codes are defined with an x-macro: thus we also have bch2_err_str() now. Also, error codes have a class field. Now, instead of checking for errors with ==, code should use bch2_err_matches(), which returns true if the error is equal to or a sub-error of the error class. This means we can define unique errors for every source location where an error is generated, which will help improve our error messages. Signed-off-by: Kent Overstreet commit 3ab25c1b4ef2a57b8bc55e786e90af63f7d06663 Author: Kent Overstreet Date: Wed Jun 22 23:06:16 2022 -0400 bcachefs: We can handle missing btree roots for all alloc btrees We can rebuild alloc info if these btree roots are missing - no need to bail out and say the filesystem is unrecoverable Signed-off-by: Kent Overstreet commit b962552eabd59f0026dcc21c14775b9d78336baf Author: Kent Overstreet Date: Sun Jul 17 22:59:01 2022 -0400 bcachefs: Fix should_invalidate_buckets() Like bch2_copygc_wait_amount, should_invalidate_buckets() needs to try to ensure that there are always more buckets free than the largest reserve. Signed-off-by: Kent Overstreet commit 175379db206a3a36a80585b00bb974a6ab6c43c0 Author: Kent Overstreet Date: Sun Jul 17 20:08:37 2022 -0400 bcachefs: ec_stripe_bkey_insert() -> for_each_btree_key_norestart() With the upcoming patches to add assertions for incorrect nested transaction restart handling, this code is now bogus. Switch it to for_each_btree_key_norestart() so that transaction restarts are only handled in one place. Signed-off-by: Kent Overstreet commit 0a5156334c721295928b4c5f42eabb9c625cd73e Author: Kent Overstreet Date: Sun Jul 17 00:44:19 2022 -0400 bcachefs: Convert erasure coding to for_each_btree_key_commit() The new for_each_btree_key2() macro handles transaction retries, allowing us to avoid nested transactions - which we want to avoid since they're tricky to do completely correctly and upcoming assertions are going to be checking for that. Signed-off-by: Kent Overstreet commit e941ae7d3afc68127adef917a2b779dabe83fdfe Author: Kent Overstreet Date: Sun Jul 17 19:35:38 2022 -0400 bcachefs: Add a counter for btree_trans restarts This will help us improve nested transactions - we need to add assertions that whenever an inner transaction handles a restart, it still returns -EINTR to the outer transaction. This also adds nested_lockrestart_do() and nested_commit_do() which use the new counters to correctly return -EINTR when the transaction was restarted. Signed-off-by: Kent Overstreet commit 445d184af25abd70575539f7d7b2c8e25b8c49c8 Author: Kent Overstreet Date: Sun Jul 17 00:44:19 2022 -0400 bcachefs: Convert alloc code to for_each_btree_key_commit() The new for_each_btree_key2() macro handles transaction retries, allowing us to avoid nested transactions - which we want to avoid since they're tricky to do completely correctly and upcoming assertions are going to be checking for that. Signed-off-by: Kent Overstreet commit 6738dd19db5c96e574af79a3b7c1754fb2ecf2bd Author: Kent Overstreet Date: Sun Jul 17 00:44:19 2022 -0400 bcachefs: Convert subvol code to for_each_btree_key_commit() The new for_each_btree_key2() macro handles transaction retries, allowing us to avoid nested transactions - which we want to avoid since they're tricky to do completely correctly and upcoming assertions are going to be checking for that. Signed-off-by: Kent Overstreet commit 8933315689bcb57a3b282bad262ac584e095a2f5 Author: Kent Overstreet Date: Sun Jul 17 00:31:40 2022 -0400 bcachefs: Convert bch2_dev_usrdata_drop() to for_each_btree_key2() The new for_each_btree_key2() macro handles transaction retries, allowing us to avoid nested transactions - which we want to avoid since they're tricky to do completely correctly and upcoming assertions are going to be checking for that. Signed-off-by: Kent Overstreet commit d04801a0f452f022fcb278b6428853460db75ab8 Author: Kent Overstreet Date: Sun Jul 17 00:31:40 2022 -0400 bcachefs: Convert bch2_do_invalidates_work() to for_each_btree_key2() The new for_each_btree_key2() macro handles transaction retries, allowing us to avoid nested transactions - which we want to avoid since they're tricky to do completely correctly and upcoming assertions are going to be checking for that. Signed-off-by: Kent Overstreet commit dadecd02c49c7bb14c04445fc514c394e28c1ae3 Author: Kent Overstreet Date: Thu Jul 14 02:08:58 2022 -0400 bcachefs: bch2_trans_run() This adds a new helper, bch2_trans_run(), that runs a function with a btree_transaction context but without handling transaction restarts. We're adding checks for nested transaction restart handling: when an inner transaction handles a transaction restart it will still have to return it to the outer transaction, or else assertions will be popped in the outer transaction. But some places don't need restart handling at the outer scope, so this helper does what they need. Signed-off-by: Kent Overstreet commit 326568f18cb57ed95a420361da9a64330e122cda Author: Kent Overstreet Date: Sun Jul 17 00:44:19 2022 -0400 bcachefs: Convert bch2_gc_done() for_each_btree_key2() This converts bch2_gc_stripes_done() and bch2_gc_reflink_done() to the new for_each_btree_key_commit() macro. The new for_each_btree_key2() and for_each_btree_key_commit() macros handles transaction retries, allowing us to avoid nested transactions - which we want to avoid since they're tricky to do completely correctly and upcoming assertions are going to be checking for that. Signed-off-by: Kent Overstreet commit eace11a730b36e7e8ee184675927ce7e658e7616 Author: Kent Overstreet Date: Sun Jul 17 00:44:19 2022 -0400 bcachefs: Convert more fsck code to for_each_btree_key2() The new for_each_btree_key2() macro handles transaction retries, allowing us to avoid nested transactions - which we want to avoid since they're tricky to do completely correctly and upcoming assertions are going to be checking for that. Signed-off-by: Kent Overstreet commit 1329c7ce5651df67e5986e08fd16545c36a029a2 Author: Kent Overstreet Date: Sun Jul 17 00:44:19 2022 -0400 bcachefs: Convert more quota code to for_each_btree_key2() The new for_each_btree_key2() macro handles transaction retries, allowing us to avoid nested transactions - which we want to avoid since they're tricky to do completely correctly and upcoming assertions are going to be checking for that. Signed-off-by: Kent Overstreet commit 1615505cdf2c681c72ca7ab742c9a3fd39fccfe3 Author: Kent Overstreet Date: Sun Jul 17 00:44:19 2022 -0400 bcachefs: Convert bch2_check_lrus() to for_each_btree_key_commit() The new for_each_btree_key2() macro handles transaction retries, allowing us to avoid nested transactions - which we want to avoid since they're tricky to do completely correctly and upcoming assertions are going to be checking for that. Signed-off-by: Kent Overstreet commit ca91f40ff79f432772660b1d10e04cfc71214458 Author: Kent Overstreet Date: Sun Jul 17 00:44:19 2022 -0400 bcachefs: Convert bch2_dev_freespace_init() to for_each_btree_key_commit() The new for_each_btree_key2() macro handles transaction retries, allowing us to avoid nested transactions - which we want to avoid since they're tricky to do completely correctly and upcoming assertions are going to be checking for that. Signed-off-by: Kent Overstreet commit 4910a9506cff4760d56e8a362619dee3319bee8b Author: Kent Overstreet Date: Sun Jul 17 00:31:40 2022 -0400 bcachefs: Convert bch2_do_discards_work() to for_each_btree_key2() The new for_each_btree_key2() macro handles transaction retries, allowing us to avoid nested transactions - which we want to avoid since they're tricky to do completely correctly and upcoming assertions are going to be checking for that. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8ef983139940439b3c169ea90dbb8c21e5dcadd3 Author: Kent Overstreet Date: Sun Jul 17 21:40:39 2022 -0400 bcachefs: Improve bucket_alloc_fail tracepoint We should be printing the number of free buckets, not just the number of available buckets. Signed-off-by: Kent Overstreet commit f501ad2b8108a7910adf494fcc5c59bbbfa886e8 Author: Kent Overstreet Date: Sun Jul 17 21:33:00 2022 -0400 bcachefs: bch2_mark_alloc(): Do wakeups after updating usage We have an obvious wake up race if we do the wakeup _before_ updating the counters the thing doing the waiting is reading. Signed-off-by: Kent Overstreet commit c807ca95a6e20bedbbb84287bc7087c2b2b775de Author: Daniel Hill Date: Thu Jul 14 20:33:09 2022 +1200 bcachefs: added lock held time stats We now record the length of time btree locks are held and expose this in debugfs. Enabled via CONFIG_BCACHEFS_LOCK_TIME_STATS. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 25055c690f9ab3d4fb72b8a07323bf952c2682dc Author: Daniel Hill Date: Thu Jul 14 20:31:36 2022 +1200 bcachefs: bch2_time_stats_to_text now indents properly Printbufs indentation feature doesn't yet work with '\n' and '\t'. So we've replaced all instances of '\n' with prt_newline. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 8bfe14e86a00a44eb7bfbeff1d7368e44c93bb7c Author: Daniel Hill Date: Thu Jul 14 18:58:23 2022 +1200 bcachefs: lock time stats prep work. We need the caller name and a place to store our results, btree_trans provides this. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 43de721a33b214b253c07672c4c6ba7548f2d3e7 Author: Kent Overstreet Date: Wed Jul 13 06:03:21 2022 -0400 bcachefs: Unlock in bch2_trans_begin() if we've held locks more than 10us We try to ensure we never hold btree locks for too long - bcachefs tries to be soft realtime. This adds a check when restarting a transaction, where a transaction restart is cheap - if we've been holding locks for too long, drop and retake them. Signed-off-by: Kent Overstreet commit a1783320d46e878ddf5d2bb3380c181d515a5ff3 Author: Kent Overstreet Date: Fri Jul 15 20:51:09 2022 -0400 bcachefs: for_each_btree_key2() This introduces two new macros for iterating through the btree, with transaction restart handling - for_each_btree_key2() - for_each_btree_key_commit() Every iteration is now in an implicit transaction, and - as with lockrestart_do() and commit_do() - returning -EINTR will cause the transaction to be restarted, at the same key. This patch converts a bunch of code that was open coding this to these new macros, saving a substantial amount of code. Signed-off-by: Kent Overstreet commit 0d06b4eca687b3a6a07b62fd4ca83d635103c77f Author: Kent Overstreet Date: Sat Jul 16 23:31:28 2022 -0400 bcachefs: Fix repair for extent past end of inode When we find an extent past an inode's i_size, we need to do the deletion in the inode's snapshot (which will emit a whiteout if necessary); and we also need to note that we now have an a key at that position and snapshot, so that we don't go into an infinite loop. Also, switch to walking inodes in reverse older, oldest snapshot to newest, so that we emit the fewest whiteouts possible. Signed-off-by: Kent Overstreet commit c7a09cb1b13995da938f4e1df52adeba44515d7d Author: Kent Overstreet Date: Sat Jul 16 23:21:15 2022 -0400 bcachefs: When fsck finds redundant snapshot keys, trigger snapshots cleanup Fsck now checks for keys in different snapshot IDs that are now redundant due to other snapshots being deleted - it needs to for its own algorithms to not get confused. When it detects this it should re-run the post snapshot deletion cleanup - this patch does that. Signed-off-by: Kent Overstreet commit 35f1a5034d81416ca820032452bed583f78f1f5e Author: Kent Overstreet Date: Thu Jul 14 05:44:10 2022 -0400 bcachefs: Improve fsck for subvols/snapshots - Bunch of refactoring, and move some code out of bch2_snapshots_start() and into bch2_snapshots_check(), for constency with the rest of fsck - Interior snapshot nodes no longer point to a subvolume; this is so we don't end up with dangling subvol references when deleting or require scanning the full snapshots btree. Signed-off-by: Kent Overstreet commit 49124d8a7f3bc0f2bd33ba6cdfa2e9514a74b109 Author: Kent Overstreet Date: Thu Jul 14 02:47:36 2022 -0400 bcachefs: Improve snapshots_seen This makes the snapshots_seen data structure fsck private and improves it; we now also track the equivalence class for each snapshot id we've seen, which means we can detect when snapshot deletion hasn't finished or run correctly (which will otherwise confuse fsck). Signed-off-by: Kent Overstreet commit 4ab35c34d5ab258fdd7325315fe5d94699e51eb4 Author: Kent Overstreet Date: Thu Jul 14 01:10:24 2022 -0400 bcachefs: Fix subvol/snapshot deleting in recovery fsck doesn't want to run while we're cleaning up deleted snapshots - if that work needs to be done, we want it to have finished before fsck runs, otherwise fsck will get confused when it finds multiple keys in the same snapshot ID equivalence class (i.e. the mechanism that snapshot deletion uses for cleaning up redundant keys). Signed-off-by: Kent Overstreet commit e4085b70f21f0e4b578a50a9fd7e84f2a055010f Author: Kent Overstreet Date: Thu Jul 14 00:44:09 2022 -0400 bcachefs: fsck_inode_rm() shouldn't delete subvols We should never see an inode marked as unlinked that's a subvolume root (or a directory) in fsck, but even if we do it's not correct for fsck to delete the subvolume: subvolumes are owned by dirents, and if we find a dangling subvolume (not marked as unlinked) we want fsck to reattach it. Signed-off-by: Kent Overstreet commit 597dee1cd67d591cd5aeba184fdb69d0da0ceb78 Author: Kent Overstreet Date: Thu Jul 14 02:34:48 2022 -0400 bcachefs: Switch data_update path to snapshot_id_list snapshots_seen is becoming private to fsck, and snapshot_id_list is actually what the data update path needs. Signed-off-by: Kent Overstreet commit 416cc426c0d79c65d85de52d3548a32de06ab3e8 Author: Kent Overstreet Date: Tue Jul 12 09:11:52 2022 -0400 bcachefs: Fix snapshot deletion Snapshots being deleted won't in general have a corresponding subvolume: this fixes a spurious fsck error where we'd complain about a snapshot pointing to a missing subvolume - but the subvolume had been deleted, and the snapshot was pending deletion as well. Signed-off-by: Kent Overstreet commit e68914ca849fa51167e2136ad9f6b43c22956d3c Author: Kent Overstreet Date: Wed Jul 13 05:25:29 2022 -0400 bcachefs: Rename __bch2_trans_do() -> commit_do() Better/more descriptive naming, and prep for adding nested_lockrestart_do() and nested_commit_do(). Signed-off-by: Kent Overstreet commit 80b3bf33d35e8f5bf4323be71777e9aab66c3a90 Author: Kent Overstreet Date: Mon Jul 11 21:06:52 2022 -0400 bcachefs: Silence some fsck errors when reconstructing alloc info There's no need to print fsck errors for errors that are expected, and the user has already opted to repair. Signed-off-by: Kent Overstreet commit 1534ebb706efe9765787c0899dfa5ec52331ba8f Author: Kent Overstreet Date: Mon Jul 11 22:32:04 2022 -0400 bcachefs: Put some repair messages behind opts->verbose These messages log the updates we're doing in bch2_check_fix_ptrs(), which is useful when debugging but not usually needed. Signed-off-by: Kent Overstreet commit e28307a10656d90a2d33fbf4dc64b881f81c68cf Author: Kent Overstreet Date: Tue Jul 5 16:46:40 2022 -0400 bcachefs: Silence unimportant tracepoints Signed-off-by: Kent Overstreet commit 7c0732b88dfb87b5f32dcf5fdd7984d2acb992b9 Author: Kent Overstreet Date: Wed Jun 29 17:14:06 2022 -0400 bcachefs: Fix move path when move_stats == NULL This isn't done very often, but it is legitimate Signed-off-by: Kent Overstreet commit 4081ace307c15fb0c15bcc65fce2e3792c1979d9 Author: Kent Overstreet Date: Mon Jun 20 19:43:35 2022 -0400 bcachefs: Get ref on c->writes in move.c There's no point reading an extent in order to move it if the write is going to fail because we're shutting down. This patch changes the move path so that moving_io now owns a ref on c->writes - as a bonus, rebalance and copygc will now notice that we're shutting down and exit quicker. Signed-off-by: Kent Overstreet commit 0337cc7eeed19e81e50414b5199bb65029ca0ed5 Author: Kent Overstreet Date: Mon Jun 20 15:40:26 2022 -0400 bcachefs: move.c refactoring - add bch2_moving_ctxt_(init|exit) - split out __bch2_evacutae_bucket() which takes an existing moving_ctxt, this will be used for improving copygc performance by pipelining across multiple buckets Signed-off-by: Kent Overstreet commit c91996c50a9ad6569cf9cb52e79c171f0d34814d Author: Daniel Hill Date: Thu Jun 16 02:06:43 2022 +1200 bcachefs: data jobs, including rebalance wait for copygc. move_ratelimit() now has a bool that specifies whether we want to wait for copygc to finish. When copygc is running, we're probably low on free buckets instead of consuming the remaining buckets, we want to wait for copygc to finish. This should help with performance, and run away bucket fragmentation. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 7f5c5d20f01483ba53233e3e2c54848e0b2d9ecd Author: Kent Overstreet Date: Mon Jun 13 19:17:45 2022 -0400 bcachefs: Redo data_update interface This patch significantly cleans up and simplifies the data_update interface. Instead of only being able to specify a single pointer by device to rewrite, we're now able to specify any or all of the pointers in the original extent to be rewrited, as a bitmask. data_cmd is no more: the various pred functions now just return true if the extent should be moved/updated. All the data_update path does is rewrite existing replicas, or add new ones. This fixes a bug where with background compression on replicated filesystems, where rebalance -> data_update would incorrectly drop the wrong old replica, and keep trying to recompress an extent pointer and each time failing to drop the right replica. Oops. Now, the data update path doesn't look at the io options to decide which pointers to keep and which to drop - it only goes off of the data_update_options passed to it. Signed-off-by: Kent Overstreet commit 47ab0c5f6a1e6ac1e9387181585fb39393fec4ea Author: Kent Overstreet Date: Sun Jun 26 20:34:34 2022 -0400 bcachefs: Fix bch2_check_alloc_key() bch2_check_alloc_key() was failing to check buckets that didn't have alloc keys yet (because they'd never been used) - they still need to be added to the freespace btree. Signed-off-by: Kent Overstreet commit e34da43e33f8c0b42b74bf9aa86042d16884183b Author: Kent Overstreet Date: Sun Jun 19 22:43:00 2022 -0400 bcachefs: Improve bch2_check_alloc_info - In check_alloc_key(), previously we were re-initializing iterators for the need_discard and freespace btrees for every alloc key we checked. But this was causing us to redo lookups into the journal keys every time, since those lookups are cached in struct btree_iter. This initializes the iterators in bch2_check_alloc_info and passes them into check_alloc_key(). - Make the looping more consistent/efficient in bch2_check_alloc_info() Signed-off-by: Kent Overstreet commit 22add2ec6705cd66977717c49105e0910b2ef144 Author: Kent Overstreet Date: Sun Jun 26 18:31:51 2022 -0400 bcachefs: Use BTREE_INSERT_LAZY_RW in bch2_check_alloc_info() This runs before we go rw for journal replay, but after we're allowed to go rw. It might be time to consider killing BTREE_INSERT_LAZY_RW, though. Signed-off-by: Kent Overstreet commit 38585367442f09606d7a529be3290f2fd4cbcf84 Author: Kent Overstreet Date: Mon Jun 20 22:26:41 2022 -0400 bcachefs: Bucket invalidate path improvements - invalidate_one_bucket() now returns 1 when we don't have any buckets on this device to invalidate, ensuring we don't spin - the tracepoint invocation is moved to after the transaction commit, and we now include the number of cached sectors in the tracepoint Signed-off-by: Kent Overstreet commit 962ad1a76669443126c6531352380f56d6e5d7d2 Author: Kent Overstreet Date: Thu Jun 23 18:26:01 2022 -0400 bcachefs: Don't BUG_ON() inode link count underflow This switches that assertion to a bch2_trans_inconsistent() call, as it should be. Signed-off-by: Kent Overstreet commit 7a47d0993be95bf68e2e04653f40d311e3c25bed Author: Kent Overstreet Date: Wed Jun 22 22:53:43 2022 -0400 bcachefs: Always descend to leaf nodes it btree_gc If a btree node is unreadable, it's the topology repair that fixes that and it's kicked off by btree_gc, so btree_gc needs to touch every node and very that they can be read. Signed-off-by: Kent Overstreet commit 58aaa0836be3be279f17db9ba07f3a58da033a9f Author: Daniel Hill Date: Thu Jun 23 10:28:30 2022 +1200 bcachefs: fix __dev_available(). __dev_available() now calculates available buckets correctly. Previously it would almost always return 0 when we have cached data. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 2817d453819a10654ac72e5f4937d4653dea1648 Author: Kent Overstreet Date: Wed Jun 22 21:33:43 2022 -0400 bcachefs: Fix assertion in topology repair If we were at the end of the node, when breaking out of the loop we'd pop the assertion on line 446 when cur wasn't NULL. Signed-off-by: Kent Overstreet commit 5a3c24714c8bd5e0d01d1547c0848147f2f79f69 Author: Kent Overstreet Date: Wed Jun 22 17:56:25 2022 -0400 bcachefs: Make verbose option settable at runtime -o verbose is very useful, and we're starting to use it more for runtime debug statements - making it possible to enable at runtime is a no brainer. Signed-off-by: Kent Overstreet commit 54feff0a7ac5ae44b99e697f0fadf81471b33801 Author: Kent Overstreet Date: Fri Jun 17 18:30:17 2022 -0400 bcachefs: Improve "copygc requested to run" error message This improves the "copygc requested to run but no buckets found" to show the device that requires copygc to be run on - we'll definitely need to improve this more. Signed-off-by: Kent Overstreet commit c501fef6deb1de13d45d22a3df32906adf17275b Author: Kent Overstreet Date: Mon Jun 13 19:07:19 2022 -0400 bcachefs: Pull out data_update.c This is the start of reorganizing the data IO paths. The plan is to also break apart io.c into data_read.c and data_write.c, and migrate_write will be renamed to the data_update path. Signed-off-by: Kent Overstreet commit 30f0349d62429effd729ae9272c6fb57f47d1436 Author: Kent Overstreet Date: Tue Jun 14 17:51:20 2022 -0400 bcachefs: Split out dev_buckets_free() Previously, dev_buckets_available() only counted buckets that are eligible to be allocated right now - i.e. buckets that don't have cached data, or need discard, or need gc gens, etc. But most users of this function want to know how many buckets are eligible to be allocated from without moving data around - copygc, allocator striping, which means we should be including cached data buckets etc. Signed-off-by: Kent Overstreet commit 8f7f566f5774d36196bfa87bc097522fd497d4dc Author: Kent Overstreet Date: Fri Jun 17 01:07:54 2022 -0400 bcachefs: btree key cache pcpu freedlist Originally, the btree key cache code would always allocate new entries by reusing from the recently-freed list, if that list wasn't empty. But that behaviour was dropped, for lock contention reasons. But it seems that entries stranded on the freed list have been contributing to some of our oom issues, because long running btree transactions will prevent them from being freed. This patch re-adds allocating from the freed list, but it also adds percpu buffers to solve the lock contention issues - and the new percpu freed lists will improve the evict paths, too. Signed-off-by: Kent Overstreet commit 7bb61e8c0e37fdf5684bc1fa1f6e0b5644cc7f75 Author: Kent Overstreet Date: Sun Jun 19 23:03:07 2022 -0400 bcachefs: Make IO in flight by copygc/rebalance configurable This adds a new option, move_bytes_in_flight, for configuring the amount of IO in flight by copygc/rebalance - users with many devices in their filesystem will want to increase this. In the future we should be smarter about this, but this is an easy improvement. Signed-off-by: Kent Overstreet commit b5f73fd79f4c710024ef4385626aecbaee6fc3f1 Author: Kent Overstreet Date: Thu Jun 16 22:38:10 2022 -0400 bcachefs: Check for extents with too many ptrs We have a hardcoded maximum on number of pointers in an extent that's used by some other data structures - notably bch_devs_list - but we weren't actually checking for it. Oops. Signed-off-by: Kent Overstreet commit 1c6ff39445553f84f9a46c2c60a4768c7f4ef226 Author: Kent Overstreet Date: Mon Jun 20 19:48:16 2022 -0400 bcachefs: Fix refcount leak in bch2_do_invalidates() If we fail to queue the work item because it's already in process, we need to drop the ref we just took. Signed-off-by: Kent Overstreet commit a3d7afa5c1b62140168982747fd15c1999d991f4 Author: Kent Overstreet Date: Sat Jun 18 19:55:32 2022 -0400 bcachefs: Always use percpu_ref_tryget_live() on c->writes If we're trying to get a ref and the refcount has been killed, it means we're doing an emergency shutdown - we always want tryget_live(). Signed-off-by: Kent Overstreet commit 23189da9eb6b34fc1ceb077edb32e308d0ad6760 Author: Kent Overstreet Date: Sat Jun 18 19:03:25 2022 -0400 bcachefs: Improve checksum error messages We're seeing checksum errors in the bch2_rechecksum_bio() path - give it a better error message to help track this down. Signed-off-by: Kent Overstreet commit 50b13beef09f445e1fb8fbf1e1f852df06baf05a Author: Kent Overstreet Date: Fri Jun 17 20:12:02 2022 -0400 bcachefs: Improve an error message When inserting a key type that's not valid for a given btree, we should print out which btree we were inserting into. Signed-off-by: Kent Overstreet commit 2ed6248ab3a58dbbe5819cbd0e60e4e3a5b72c47 Author: Kent Overstreet Date: Fri Jun 17 19:15:26 2022 -0400 bcachefs: Fix assertion in bch2_dev_list_add_dev() We were only allowing 4 devices in a dev_list, not 16. Signed-off-by: Kent Overstreet commit b7c1104612e4ab46d8e481e323fbe1cca07f5cbd Author: Kent Overstreet Date: Thu May 19 15:29:50 2022 -0400 bcachefs: Increase max size for btree_trans bump allocator With backpointers, alloc keys have gotten bigger, so we're needing more memory here. We're probably going to need to go with something more sophisticated than a bump allocator, but - let's see if we can avoid doing that just yet. Signed-off-by: Kent Overstreet commit 6f44a9940c600c5a0663b825bdd89aad0639e3a0 Author: Kent Overstreet Date: Mon Jun 13 23:32:09 2022 -0400 bcachefs: Add a persistent counter for bucket discards Like the previous patch for bucket invalidates, add another counter for a core allocator path. Signed-off-by: Kent Overstreet commit c9bd67321e9b9bae0a9ba151a3906086878159b6 Author: Kent Overstreet Date: Tue Jun 14 01:37:16 2022 -0400 bcachefs: Fix btree node read retries b->written wasn't being reset to 0 in the btree node read retry path, causing decrypting & validation of previously read bsets to not be re-run - ouch. Signed-off-by: Kent Overstreet commit 440c15cc912d630320bfb684d799ab225be4178e Author: Kent Overstreet Date: Mon Jun 13 19:45:07 2022 -0400 bcachefs: Add a persistent counter for bucket invalidation Signed-off-by: Kent Overstreet commit 0e96f5dcd7ff678c5448f64cb957117399754d2e Author: Kent Overstreet Date: Mon Jun 13 19:34:17 2022 -0400 bcachefs: Call bch2_do_invalidates() when going read write Like bch2_do_discards(), we should check if this needs to be done when going rw. Also, add some sysfs code for debugging bucket invalidation. Signed-off-by: Kent Overstreet commit a5d18f9ec0e2cfce1e0dc50f07d614ba21edaae9 Author: Kent Overstreet Date: Fri Jun 10 19:45:19 2022 -0400 bcachefs: Improved human readable integer parsing Printbufs recently switched to using string_get_size() for printing integers in human readable units. This updates __bch2_strtoh() to parse numbers printed by string_get_size() - we now have to handle floating point numbers, and new unit suffixes. Signed-off-by: Kent Overstreet commit df8c2ccb9309f342724f3104fd9d68d7e4ce65da Author: Kent Overstreet Date: Fri Jun 10 19:39:00 2022 -0400 bcachefs: Fix freespace initialization bch2_dev_freespace_init() was using __bch2_trans_do() incorrectly, and calling bch2_bucket_do_index() with a stale alloc key. Signed-off-by: Kent Overstreet commit 401ec4db630802729f10d53ad995083ced98caca Author: Kent Overstreet Date: Fri Feb 3 21:01:40 2023 -0500 bcachefs: Printbuf rework This converts bcachefs to the modern printbuf interface/implementation, synced with the version to be submitted upstream. Signed-off-by: Kent Overstreet commit 652018d66190412669a898c2dc3e75073eac8679 Author: Kent Overstreet Date: Mon Jun 6 22:09:11 2022 -0400 bcachefs: Fix btree node read error path We were forgetting to clear the read_in_flight flag - oops. This also fixes it to not call bch2_fatal_error() before topology repair has had a chance to do its thing. Signed-off-by: Kent Overstreet commit 576179021c90bea808ac12c491bd9b239ca80c2e Author: Kent Overstreet Date: Mon Jun 6 21:59:34 2022 -0400 bcachefs: Fix btree_and_journal_iter We had a bug where btree_and_journal_iter would return the same key twice - after deleting it (perhaps because it was present in both the btree and the journal?) This reworks btree_and_journal_iter to track the current position, much like btree_paths, which makes the logic considerably simpler and more robust. Signed-off-by: Kent Overstreet commit f2aa02657561b0e6d96089eb8ee44e4154f4acad Author: Kent Overstreet Date: Mon Jun 6 23:04:33 2022 -0400 bcachefs: Fix for cmd_list_journal cmd_list_journal wasn't correctly listing the most recent journal entries as blacklisted - because in the recovery path when just reading the journal, we were failing to add those to the blacklist table. Signed-off-by: Kent Overstreet commit cb685ce72cc7e91733d3197346bbfe61e8ad54eb Author: Kent Overstreet Date: Sun Jun 5 15:32:57 2022 -0400 bcachefs: Also log overwrites in journal Lately we've been doing a lot of debugging by looking at the journal to see what was changed, and by what code path. This patch adds a new journal entry type for recording overwrites, so that we don't have to search backwards through the journal to see what was being overwritten in order to work out what the triggers were supposed to be doing. Signed-off-by: Kent Overstreet commit 43ddf4483491b3dff8e050f57b595c34822cb6de Author: Kent Overstreet Date: Sun Jun 5 15:29:00 2022 -0400 bcachefs: Refactor journal entry adding This takes copying the payload out of bch2_journal_add_entry(), which means we can use it for journal_transaction_name() - also prep work for journalling overwrites. Signed-off-by: Kent Overstreet commit 4a7a7ea1f59032e182b9faba06df61d6375a1f97 Author: Kent Overstreet Date: Sat Jun 4 14:49:02 2022 -0400 bcachefs: Add some missing error messages bch2_opt_parse() was failing to generate error messages in error path. Signed-off-by: Kent Overstreet commit 636d4eef1eefe447deef134bdf8e34c979ff009e Author: Kent Overstreet Date: Fri Jun 3 02:34:14 2022 -0400 bcachefs: Fix memory corruption in encryption path When do_encrypt() was passed a vmalloc address and the buffer spanned more than a single page, we were encrypting/decrypting completely different pages than the ones intended. Signed-off-by: Kent Overstreet commit 0fbf71f80d60c077f491f0ac97000c3a0c9be3aa Author: Kent Overstreet Date: Sun May 29 11:38:48 2022 -0400 bcachefs: bch2_trans_reset_updates() Factor out a new helper. Signed-off-by: Kent Overstreet commit 9b688da35072910ec205697d2f51226cd3fd9f90 Author: Kent Overstreet Date: Sat May 28 16:21:01 2022 -0400 bcachefs: Fix error checking in bch2_fs_alloc() One of the init calls had a ; instead of a ?:, and errors after that got dropped - oops. Signed-off-by: Kent Overstreet commit c737267821c15f1678a9575f23fe2fee0c2d9053 Author: Kent Overstreet Date: Thu May 26 15:19:20 2022 -0400 bcachefs: Print message on btree node read retry success Right now, we print an error message on btree node read error, and we print that we're retrying, but we don't explicitly say if the retry succeeded - this makes things a little clearer. Signed-off-by: Kent Overstreet commit 30525f68633740e071c0960c11c4380f1f6851af Author: Kent Overstreet Date: Sat May 21 13:10:39 2022 -0400 bcachefs: Fix journal_keys_search() overhead Previously, on every btree_iter_peek() operation we were searching the journal keys, doing a full binary search - which was slow. This patch fixes that by saving our position in the journal keys, so that we only do a full binary search when moving our position backwards or a large jump forwards. Signed-off-by: Kent Overstreet commit 11f5e595bf7cd11c395f0041cdd6448f238a5614 Author: Kent Overstreet Date: Wed May 25 21:34:11 2022 -0400 bcachefs: Always print when doing journal replay in fsck This logging improvement helps see when the previous fsck pass has completed. Signed-off-by: Kent Overstreet commit a8dea22703b18822662befa676e5c7bfef1f7759 Author: Daniel Hill Date: Wed May 25 14:57:39 2022 +1200 bcachefs: Rename group to label for remaining strings. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit c346def9af1d3890ee604905fb08d689e8383855 Author: Kent Overstreet Date: Mon May 23 22:37:01 2022 -0400 bcachefs: Fix encryption path on arm flush_dcache_page() is not a noop on arm, but we were using virt_to_page() instead of vmalloc_to_page() for an address on the kernel stack - vmalloc memory, leading to an oops in flush_dcache_page(). Signed-off-by: Kent Overstreet commit 232697ab9ded81d56afa8a2e47edb48deea5f9e6 Author: Kent Overstreet Date: Sat May 14 07:00:22 2022 -0400 bcachefs: Switch to key_type_user, not logon The only difference key_type_logon and key_type_user is that key_type_logon keys can't be read by userspace. However, userspace has actually been adding keys to both the logon and user keychains, because userspace fsck requires the keychain interface - so we might as well just use user and drop the logon keychain. Signed-off-by: Kent Overstreet commit d8a161ad5493016aa6eba8853990456aa78316c9 Author: Kent Overstreet Date: Sat May 14 06:58:51 2022 -0400 bcachefs: LRU repair tweaks - Drop old unneeded parameter for whether we're in initial GC - which was from when btree updates had to be done differently before we went RW. Signed-off-by: Kent Overstreet commit facc81479cab081cbcb962bfbe5d61f25230d013 Author: Kent Overstreet Date: Thu May 5 17:20:41 2022 -0400 bcachefs: Delete bch_writepage Per Dave Chinner and the xfs folks, .writepage is no longer needed, and it's better not to define it if .writepages is the intended path. Signed-off-by: Kent Overstreet commit 372c11125a2e07485fcd4cb08601f24d8a3bc3c6 Author: Brett Holman Date: Tue May 3 16:50:57 2022 -0600 bcachefs: Make bch_option compatible with Rust ffi Rust FFI lacks support for unnamed structs and unions. The space saved in bch_option is not enough to be significant. Signed-off-by: Brett Holman Signed-off-by: Kent Overstreet commit ee4d17d0325c5806c7ef0f4b3c8604d5ebf65000 Author: Kent Overstreet Date: Mon Apr 25 02:12:03 2022 -0400 bcachefs: Put btree_trans_verify_sorted() behind debug_check_iterators This is pretty expensive, and we've tested sufficiently with it now that it doesn't need to be on by default. Signed-off-by: Kent Overstreet commit e320b42dfeb5797a618edbba5186060b3907ba89 Author: Kent Overstreet Date: Sun Apr 24 23:03:02 2022 -0400 bcachefs: Fix extent merging When merging extents, we have to check that we won't overflow size fields in any CRC entries - but the check for this was wrong, because in the loop it was in we weren't keeping a pointer to the (packed, encoded) CRC field. Fix this by moving it to its own loop. Signed-off-by: Kent Overstreet commit ae21f74e3135efacf73d37919b5cc9ceadda7219 Author: Kent Overstreet Date: Mon Apr 18 23:43:08 2022 -0400 bcachefs: Improve invalid bkey error message Bkeys have gotten a lot bigger since this code was written and now are often formatted across multiple lines - while the reason a bkey is invalid will still be short and fit on a single line. This patch prints the error bfore the bkey, making it a bit more readable. Signed-off-by: Kent Overstreet commit 099989c1b230e0f36ee7146d1df948822c999f6a Author: Kent Overstreet Date: Thu Apr 21 00:34:58 2022 -0400 bcachefs: Fix journal_iters_fix() journal_iters_fix() was incorrectly rewinding iterators past keys they had already returned, leading to those keys being double counted in the bch2_gc() path - oops. Signed-off-by: Kent Overstreet commit 1cab5a82cc67a09705fbe0607e6ab751f6663524 Author: Kent Overstreet Date: Thu Apr 21 13:13:57 2022 -0400 bcachefs: Go RW before bch2_check_lrus() btree updates before going RW are expensive if they're in random order, since they use the list of keys for journal replay to insert, which is just a gap buffer. This patch improves the bucket invalidate path so that if bch2_check_lrus() hasn't finished it only prints warnings instead of doing an emergency shutdown, which means we can now set BCH_FS_MAY_GO_RW before bch2_check_lrus(). Also, the filesystem state bits are reorganized a bit. Signed-off-by: Kent Overstreet commit 104c69745fdf7e5f8aa022f60bc9d568987bd8b8 Author: Daniel Hill Date: Tue Mar 15 21:36:33 2022 +1300 bcachefs: Add persistent counters This adds a new superblock field for persisting counters and adds a sysfs interface in counters/ exposing these counters. The superblock field is ignored by older versions letting us avoid an on disk version bump. Each sysfs file outputs a counter that tracks since filesystem creation and a counter for the current mount session. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 1f93726e6347938343190913cb959623e67ecf78 Author: Kent Overstreet Date: Sun Apr 17 18:06:31 2022 -0400 bcachefs: Tracepoint improvements Delete some obsolete tracepoints, organize alloc tracepoints better, make a few tracepoints more consistent. Signed-off-by: Kent Overstreet commit 8cc052db636d5502319d967198d84f64e7e5f65d Author: Kent Overstreet Date: Mon Apr 18 22:03:17 2022 -0400 bcachefs: Don't kick journal reclaim unless low on space We shouldn't kick journal reclaim unnecessarily, it's got its own timer for that. Signed-off-by: Kent Overstreet commit fd4cecd2583e784ff28b851de2ff5046201c57d7 Author: Kent Overstreet Date: Mon Apr 18 21:50:19 2022 -0400 bcachefs: Lock ordering fix Can't take btree node locks while holding btree_reserve_cache_lock - it would be nice if we could check this with lockdep. Signed-off-by: Kent Overstreet commit c0960603e2d42d097fea4afd6b720619441061bd Author: Kent Overstreet Date: Sun Apr 17 17:30:49 2022 -0400 bcachefs: Shutdown path improvements We're seeing occasional firings of the assertion in the key cache shutdown code that nr_dirty == 0, which means we must sometimes be doing transaction commits after we've gone read only. Cleanups & changes: - BCH_FS_ALLOC_CLEAN renamed to BCH_FS_CLEAN_SHUTDOWN - new helper bch2_btree_interior_updates_flush(), which returns true if it had to wait - bch2_btree_flush_writes() now also returns true if there were btree writes in flight - __bch2_fs_read_only now checks if btree writes were in flight in the shutdown loop: btree write completion does a transaction update, to update the pointer in the parent node - assert that !BCH_FS_CLEAN_SHUTDOWN in __bch2_trans_commit Signed-off-by: Kent Overstreet commit d8f31407c842331a13c48404bc030f49d60f25aa Author: Kent Overstreet Date: Sun Apr 17 19:02:04 2022 -0400 bcachefs: Fix hash_check_key() hash_check_key() was incorrectly handling transaction restarts - switch it to for_each_btree_key_norestart(). Signed-off-by: Kent Overstreet commit a729e489ab0805fb93047508fb9439cd1464cf70 Author: Kent Overstreet Date: Sun Apr 17 17:50:47 2022 -0400 bcachefs: Allocate some extra room in btree_key_cache_fill() If we allocate a buffer that's a bit bigger than necessary the transaction commit path will be much less likely to have to reallocate - which requires a transaction restart. Signed-off-by: Kent Overstreet commit b0babf2a34233c651060e54b68fa3cd0b9e7a6e7 Author: Kent Overstreet Date: Tue Apr 12 18:04:08 2022 -0400 bcachefs: bch2_btree_iter_peek_all_levels() This adds bch2_btree_iter_peek_all_levels(), which returns keys from every level of the btree - interior nodes included - in monotonically increasing order, soon to be used by the backpointers check & repair code. - BTREE_ITER_ALL_LEVELS can now be passed to for_each_btree_key() to iterate thusly, much like BTREE_ITER_SLOTS - The existing algorithm in bch2_btree_iter_advance() doesn't work with peek_all_levels(): we have to defer the actual advancing until the next time we call peek, where we have the btree path traversed and uptodate. So, we add an advanced bit to btree_iter; when BTREE_ITER_ALL_LEVELS is set bch2_btree_iter_advanced() just marks the iterator as advanced. Signed-off-by: Kent Overstreet commit c4bce586752376b226cff28139cbefdd7346497d Author: Kent Overstreet Date: Thu Apr 14 15:43:37 2022 -0400 bcachefs: btree_path_set_level_(up|down) This adds two new helpers to btree_iter.c for changing the level of a path up or down - to be used by the new bch2_btree_iter_peek_all_levels(). Signed-off-by: Kent Overstreet commit 2ae4573e57384f4df256f52c6ec2e0305136aa8b Author: Kent Overstreet Date: Thu Apr 14 15:45:00 2022 -0400 bcachefs: bch2_btree_iter_peek_slot() now works on interior nodes The new backpointers code will be using bch2_btree_iter_peek_slot() on interior nodes - this patch updates peek_slot() to make that work. - Pass the correct level to bch2_journal_keys_peek_slot() - We should only set BTREE_ITER_CACHED or BTREE_ITER_WITH_KEY_CACHE when using bch2_trans_iter_init(), not bch2_trans_node_iter_init() - Update assertions Signed-off-by: Kent Overstreet commit 7419646b254a599d7881e7815fc5e61b18c94b7e Author: Kent Overstreet Date: Thu Apr 14 15:37:16 2022 -0400 bcachefs: btree_update_interior.c prep for backpointers Previously, btree_update_interior.c passed keys to bch2_trans_mark_* that hadn't been fully initialized - they didn't have the key field filled out, just the value. With backpointers, we need to make sure keys are fully initialized before marking them - because the backpointer points back to the original key. This patch tweaks the interior update paths to fix this. Signed-off-by: Kent Overstreet commit e1b8f5f5ca247f65211ca4e3e0e493dd3a54c98e Author: Kent Overstreet Date: Thu Mar 31 21:44:55 2022 -0400 bcachefs: Plumb btree_id & level to trans_mark For backpointers, we'll need the full key location - that means btree_id and btree level. This patch plumbs it through. Signed-off-by: Kent Overstreet commit 0095aa94bca372b411d616a1aa1101ffa38ad09d Author: Kent Overstreet Date: Sat Apr 16 18:59:58 2022 -0400 bcachefs: Improve some fsck error messages We have string names for d_type; use it. Signed-off-by: Kent Overstreet commit b33bf1bc0d1e81d614aad0f73f46f10e02906d20 Author: Kent Overstreet Date: Sat Apr 16 16:06:59 2022 -0400 bcachefs: Go emergency RO when i_blocks underflows This improves some of our warnings and assertions - they imply possible filesystem inconsistencies, so they should be calling bch2_fs_inconsistent(). Signed-off-by: Kent Overstreet commit 42796f74f42ea5b7d9f2d7df661a87d1425968bf Author: Kent Overstreet Date: Thu Apr 14 20:30:30 2022 -0400 bcachefs: Ensure sysfs show fns print a newline Signed-off-by: Kent Overstreet commit 75c8d0305a5eecbe84b8ffef20e1c049f30f4123 Author: Kent Overstreet Date: Tue Apr 12 20:03:19 2022 -0400 bcachefs: Kill old rebuild_replicas option This option was useful when the replicas mechism was new and still being debugged, but hasn't been used in ages - let's delete it. Signed-off-by: Kent Overstreet commit 41fc86222480c34d8647661b36d3fb1e9312fd33 Author: Kent Overstreet Date: Tue Apr 12 13:09:09 2022 -0400 bcachefs: In fsck, pass BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE when deleting dirents A user reported an error where we hit an assertion due to deleting a key in an internal snapshot node, when deleting a dirent that points to a nonexisting inode. We try to avoid doing updates to keys for internal snapshot nodes, but upon inspection of the places where we remove dirents in fsck it appears BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE is correct for all of them: either the target dirent doesn't exist, or it's a directory with multiple dirents pointing to it. Signed-off-by: Kent Overstreet commit c609947b5eae4bee096fde660a53a719ee65e191 Author: Kent Overstreet Date: Tue Apr 12 01:31:33 2022 -0400 bcachefs: Fix for getting stuck in journal replay In journal replay, we weren't immediately dropping journal pins when we start doing updates that ewern't from journal replay - leading to journal reclaim getting stuck. Signed-off-by: Kent Overstreet commit e492e7b6f64fe128b83e165ef82f7d4b9fcc12cd Author: Kent Overstreet Date: Mon Apr 11 22:36:53 2022 -0400 bcachefs: Improve error logging in fsck.c This adds error logging to a bunch of functions in fsck.c - in fsck, reduntant error messages is probably better than not enough. Signed-off-by: Kent Overstreet commit e296b1f9cadfc4ee7ebe5933fb98497263ce9999 Author: Kent Overstreet Date: Mon Apr 11 22:36:13 2022 -0400 bcachefs: Fix inode_backpointer_exists() If the dirent an inode points to doesn't exist, we shouldn't be returning an error - just 0/false. Signed-off-by: Kent Overstreet commit 0b090326535c8fe5a1da6ca3d7bd4a3fa9dfd6c9 Author: Kent Overstreet Date: Mon Apr 11 20:57:01 2022 -0400 bcachefs: Improve bch2_lru_delete() error messages When we detect a filesystem inconsistency, we should include the relevent keys in the error message. This patch adds a parameter to pass the key with the lru entry to bch2_lru_delete(), so that it can be printed. Signed-off-by: Kent Overstreet commit 5650bb46be89a1254609d47e4c87d1e9cf9121fb Author: Kent Overstreet Date: Mon Apr 11 20:28:13 2022 -0400 bcachefs: Introduce bch2_journal_keys_peek_(upto|slot)() When many journal replay keys have been overwritten, bch2_journal_keys_peek() was taking excessively long to scan before it found a key to return. Fix this by introducing bch2_journal_keys_peek_upto() which takes a parameter for the end of the range we want, so that we can terminate the search much sooner, and replace all uses of bch2_journal_keys_peek() with peek_upto() or peek_slot(). Signed-off-by: Kent Overstreet commit 9b93596c33f6c23de96c05dce82b9aead271a286 Author: Kent Overstreet Date: Mon Apr 11 17:23:39 2022 -0400 bcachefs: Improve error message when alloc key doesn't match lru entry Error messages should always print out the full key when available - this gives us a starting point when looking through the journal to debug what went wrong. Signed-off-by: Kent Overstreet commit 7003589dabcdfd10345ede31044ce5e13ee65e7f Author: Kent Overstreet Date: Sun Apr 10 19:59:26 2022 -0400 bcachefs: Ensure buckets have io_time[READ] set It's an error if a bucket is in state BCH_DATA_cached but not on the LRU btree - i.e io_time[READ] == 0 - so, make sure it's set before adding it. Also, make some of the LRU code a bit clearer and more direct. Signed-off-by: Kent Overstreet commit 84befe8ef9a07be1cd9bac4e1a1c66c667f71499 Author: Kent Overstreet Date: Sun Apr 10 18:12:04 2022 -0400 bcachefs: Use bch2_trans_inconsistent_on() in more places This gets us better error messages. Signed-off-by: Kent Overstreet commit 3518e6faeff20d1de1f0c7388d9d9c6f2fe7f5a7 Author: Kent Overstreet Date: Sun Apr 10 18:04:24 2022 -0400 bcachefs: Improve bch2_open_buckets_to_text() This patch updates bch2_open_buckets_to_text() to include the device and bucket the open_bucket owns. Signed-off-by: Kent Overstreet commit ec7ccbde6baa50760c2679a5c54b2fccfd5ca64e Author: Kent Overstreet Date: Sun Apr 10 16:26:34 2022 -0400 bcachefs: Fix CPU usage in journal read path In journal_entry_add(), we were repeatedly scanning the journal entries radix tree to scan for old entries that can be freed, with O(n^2) behaviour. This patch tweaks things to remember the previous last_seq, so we don't have to scan for entries to free from the start. Signed-off-by: Kent Overstreet commit 6e811bbbc2ea3b20854c45fa29811640881bb534 Author: Kent Overstreet Date: Sun Apr 10 14:36:10 2022 -0400 bcachefs: Fix a null ptr deref We start doing allocations before the GC thread is created, which means we need to check for that to avoid a null ptr deref. Signed-off-by: Kent Overstreet commit cf0dd697ebc9090d0aeafa933e0e688e291a24fc Author: Kent Overstreet Date: Sun Apr 10 00:48:36 2022 -0400 bcachefs: Don't trigger extra assertions in journal replay We now pass a rw argument to .key_invalid methods so they can trigger assertions for updates but not on existing keys. We shouldn't trigger these extra assertions in journal replay - this patch changes the transaction commit path accordingly. Signed-off-by: Kent Overstreet commit a9c0a4cbf1ceb9842fee5d7084817509a5e962aa Author: Kent Overstreet Date: Sat Apr 9 15:15:36 2022 -0400 bcachefs: Minor device removal fixes - We weren't clearing the LRU btree - bch2_alloc_read() runs before bch2_check_alloc_key() deletes alloc keys for devices/buckets that don't exists, so it needs to check for that - bch2_check_lrus() needs to check that buckets exists - improve some error messages Signed-off-by: Kent Overstreet commit 502f973dba660ed04f295e5ba129f2d369cc1aa6 Author: Kent Overstreet Date: Sat Apr 9 20:29:26 2022 -0400 bcachefs: Fix a few warnings on 32 bit These showed up when building for mips. Signed-off-by: Kent Overstreet commit aae29082c63a4bfb7b6be5bc22b4727b7da14a7f Author: Kent Overstreet Date: Sat Apr 9 15:07:11 2022 -0400 bcachefs: bch2_btree_delete_extent_at() New helper, for deleting extents. Signed-off-by: Kent Overstreet commit 7c4ca54ae68c4ae24dbfb8b209657a5249a5f0b7 Author: Kent Overstreet Date: Fri Apr 8 23:54:14 2022 -0400 bcachefs: Don't skip triggers in fcollapse() With backpointers this doesn't work anymore - backpointers always need to be updated to point to the new extent position. Signed-off-by: Kent Overstreet commit 84c72755b9aab31ed43e50eb5c7229d7ef042f7d Author: Kent Overstreet Date: Sat Apr 9 01:23:50 2022 -0400 bcachefs: Initialize ec work structs early We need to ensure that work structs in bch_fs always get initialized - otherwise an error in filesystem initialization can pop a warning in the workqueue code when we try to cancel a work struct that wasn't initialized. Signed-off-by: Kent Overstreet commit ce6201c456571d919e722eec3c17f868f0575b05 Author: Kent Overstreet Date: Mon Mar 21 00:15:53 2022 -0400 bcachefs: Use a genradix for reading journal entries Previously, the journal read path used a linked list for storing the journal entries we read from disk. But there's been a bug that's been causing journal_flush_delay to incorrectly be set to 0, leading to far more journal entries than is normal being written out, which then means filesystems are no longer able to start due to the O(n^2) behaviour of inserting into/searching that linked list. Fix this by switching to a radix tree. Signed-off-by: Kent Overstreet commit 95752a02cb5d38bc97d76625de2607510ac94e69 Author: Kent Overstreet Date: Mon Mar 21 00:15:53 2022 -0400 bcachefs: Refactor journal_keys_sort() to return an error code When there weren't any keys in the journal there's no need to allocate the buffer - but doing that causes a spurious -ENOMEM. Signed-off-by: Kent Overstreet commit 822835ffeae411bbc8af104da9331fdf63a7bc12 Author: Kent Overstreet Date: Fri Apr 1 01:29:59 2022 -0400 bcachefs: Fold bucket_state in to BCH_DATA_TYPES() Previously, we were missing accounting for buckets in need_gc_gens and need_discard states. This matters because buckets in those states need other btree operations done before they can be used, so they can't be conuted when checking current number of free buckets against the allocation watermark. Also, we weren't directly counting free buckets at all. Now, data type 0 == BCH_DATA_free, and free buckets are counted; this means we can get rid of the separate (poorly defined) count of unavailable buckets. This is a new on disk format version, with upgrade and fsck required for the accounting changes. Signed-off-by: Kent Overstreet commit 8058ea64c31c8700eaab48c38a143d1c3817f1de Author: Kent Overstreet Date: Thu Apr 7 18:38:16 2022 -0400 bcachefs: Add a sysfs attr for triggering discards We're currently debugging an issue with discards not getting run; this patch adds a manual trigger so we can then watch the tracepoint while it runs. Signed-off-by: Kent Overstreet commit 48620e5177ae7cd91722f5c504c5138160b90df4 Author: Kent Overstreet Date: Thu Apr 7 17:41:02 2022 -0400 bcachefs: Topology repair fixes - We were failing to start topology repair, because we hadn't set the superblock flag indicating it needed to run - set_node_min() forget to update the btree node's key - bch2_gc_alloc_reset() didn't reset data type, leading to inserting an invalid key that was empty but had nonzero data type Signed-off-by: Kent Overstreet commit 5e05d7ed3d128c3d4dadee3260cd5b3f3fa1bb0d Author: Kent Overstreet Date: Thu Apr 7 17:34:57 2022 -0400 bcachefs: Use bch2_trans_inconsistent() more This gets us better error messages. Signed-off-by: Kent Overstreet commit 62491956f48e1afda98f50250d4690131e87d6ea Author: Kent Overstreet Date: Thu Apr 7 17:32:57 2022 -0400 bcachefs: Move alloc assertion to .key_invalid() .key_invalid is a better place for this assertion. Signed-off-by: Kent Overstreet commit 1d8a268940045b73f43f86e6332bdfdfe64d0fa0 Author: Kent Overstreet Date: Thu Apr 7 17:28:09 2022 -0400 bcachefs: Improve btree_bad_header() In the future printbufs will be mempool-ified, so we shouldn't be using more than one at a time if we don't have to. This also fixes an extra trailing newline. Signed-off-by: Kent Overstreet commit 11c7d3e8176a2e674faefa9d9d14210f5062326c Author: Kent Overstreet Date: Wed Apr 6 17:22:47 2022 -0400 bcachefs: Check for read_time == 0 in bch2_alloc_v4_invalid() We've been seeing this error in fsck and we weren't able to track down where it came from - but now that .key_invalid methods take a rw argument, we can safely check for this. Signed-off-by: Kent Overstreet commit 292dea86dfc974e96a4b4972f4268611c2470d28 Author: Kent Overstreet Date: Wed Apr 6 14:35:10 2022 -0400 bcachefs: fsck: Work around transaction restarts In check_extents() and check_dirents(), we're working towards only handling transaction restarts in one place, at the top level - but we're not there yet. check_i_sectors() and check_subdir_count() handle transaction restarts locally, which means the iterator for the dirent/extent is left unlocked (should_be_locked == 0), leading to asserts popping when we go to do updates. This patch hacks around this for now, until we can delete the offending code. Signed-off-by: Kent Overstreet commit 275c8426fb8fd475e9991b3aa1b20f66069e594f Author: Kent Overstreet Date: Sun Apr 3 21:50:25 2022 -0400 bcachefs: Add rw to .key_invalid() This adds a new parameter to .key_invalid() methods for whether the key is being read or written; the idea being that methods can do more aggressive checks when a key is newly created and being written, when we wouldn't want to delete the key because of those checks. Signed-off-by: Kent Overstreet commit e1effd42a1cb40048002f594c12e823b5e33ed5d Author: Kent Overstreet Date: Tue Apr 5 13:44:18 2022 -0400 bcachefs: More improvements for alloc info checks - Move checks for whether the device & bucket are valid from the .key_invalid method to bch2_check_alloc_key(). This is because .key_invalid() is called on keys that may no longer exist (post journal replay), which is a problem when removing/resizing devices. - We weren't checking the need_discard btree to ensure that every set bucket has a corresponding alloc key. This refactors the code for checking the freespace btree, so that it now checks both. Signed-off-by: Kent Overstreet commit afb6f7f61ba38f4d4d96e8d1bf5fb9e7809e6c10 Author: Kent Overstreet Date: Mon Apr 4 23:36:56 2022 -0400 bcachefs: Silence spurious copygc err when shutting down Signed-off-by: Kent Overstreet commit f0ac7df23d04f3c6d4cd82899aad7f06f6a0b1d4 Author: Kent Overstreet Date: Sun Apr 3 17:50:01 2022 -0400 bcachefs: Convert .key_invalid methods to printbufs Signed-off-by: Kent Overstreet commit d1d7737fd9df0cc57cd276b0189faf8c92c1426f Author: Kent Overstreet Date: Mon Apr 4 01:09:26 2022 -0400 bcachefs: Gap buffer for journal keys Btree updates before we go RW work by inserting into the array of keys that journal replay will insert - but inserting into a flat array is O(n), meaning if btree_gc needs to update many alloc keys, we're O(n^2). Fortunately, the updates btree_gc does happens in sequential order, which means a gap buffer works nicely here - this patch implements a gap buffer for journal keys. Signed-off-by: Kent Overstreet commit 7c7e071d90ac278e462640570d739dd165d3acd0 Author: Kent Overstreet Date: Sun Apr 3 20:36:32 2022 -0400 bcachefs: Don't normalize to pages in btree cache shrinker This behavior dates from the early, early days of bcache, and upon further delving appears to not make any sense. The shrinker only works in terms of 'objects' of unknown size; normalizing to pages only had the effect of changing the batch size, which we could do directly - if we wanted; we probably don't. Normalizing to pages meant our batch size was very small, which seems to have been keeping us from doing as much shrinking as we should be under heavy memory pressure; this patch appears to alleviate some OOMs we've been seeing. Signed-off-by: Kent Overstreet commit 4254f5bf6e3d62ab7108a556d5afc54188e17041 Author: Kent Overstreet Date: Sun Apr 3 15:13:20 2022 -0400 bcachefs: Add a tracepoint for superblock writes Signed-off-by: Kent Overstreet commit c6b6d416126da015e4b6b6a66b4c6fd3eda40f1f Author: Kent Overstreet Date: Sat Apr 2 18:00:04 2022 -0400 bcachefs: gc mark fn fixes, cleanups mark_stripe_bucket() was busted; it was using @new unitialized. Also, clean up all the gc mark functions, and convert them to the same style. Signed-off-by: Kent Overstreet commit 80c80164a5f131307b9b870f7a366ed45b901b88 Author: Kent Overstreet Date: Sat Apr 2 17:24:25 2022 -0400 bcachefs: Don't write partially-initialized superblocks This neatly avoids bugs where we fail partway through initializing a new filesystem, if we just don't write out partly-initialized state. Signed-off-by: Kent Overstreet commit 64afbbc9096f819ee5d2c0d98bef203612630e1d Author: Kent Overstreet Date: Sat Apr 2 16:57:29 2022 -0400 bcachefs: Improve read_from_stale_dirty_pointer() message With printbufs, it's now easy to build up multi-line log messages and emit them with one call, which is good because it prevents multiple multi-line log messages from getting Interspersed in the log buffer; this patch also improves the formatting and converts it to latest style. Signed-off-by: Kent Overstreet commit 75f02de43f4f7e76b9453096c5f4255d4476eda8 Author: Kent Overstreet Date: Thu Mar 31 22:05:33 2022 -0400 bcachefs: Use crc_is_compressed() Trivial cleanup. Signed-off-by: Kent Overstreet commit c32fc674d4ca13f3b889693a2b59365d93a77144 Author: Kent Overstreet Date: Sat Apr 2 16:30:37 2022 -0400 bcachefs: Fix pr_buf() calls In a few places we were passing a variable to pr_buf() for the format string - oops. Signed-off-by: Kent Overstreet commit 66d90823857ed9196ef52361518ab703e468c53b Author: Kent Overstreet Date: Mon Feb 14 00:07:38 2022 -0500 bcachefs: Kill struct bucket_mark This switches struct bucket to using a lock, instead of cmpxchg. And now that the protected members no longer need to fit into a u64, we can expand the sector counts to 32 bits. Signed-off-by: Kent Overstreet commit 5735608c14e791c10ebcb6a20fab1c8fa4cf3123 Author: Kent Overstreet Date: Thu Feb 10 19:26:55 2022 -0500 bcachefs: Kill main in-memory bucket array All code using the in-memory bucket array, excluding GC, has now been converted to use the alloc btree directly - so we can finally delete it. Signed-off-by: Kent Overstreet commit 5f43f99c6ef74f592c380b39069ee68dcfe3ee58 Author: Kent Overstreet Date: Thu Feb 10 19:09:40 2022 -0500 bcachefs: bch2_dev_usage_update() no longer depends on bucket_mark This is one of the last steps in getting rid of the main in-memory bucket array. This changes bch2_dev_usage_update() to take bkey_alloc_unpacked instead of bucket_mark, and for the places where we are in fact working with bucket_mark and don't have bkey_alloc_unpacked, we add a wrapper that takes bucket_mark and converts to bkey_alloc_unpacked. Signed-off-by: Kent Overstreet commit 5add07d56a5e714a6ac1bedffa9b999d2966708c Author: Kent Overstreet Date: Thu Feb 17 03:11:39 2022 -0500 bcachefs: Fsck for need_discard & freespace btrees Signed-off-by: Kent Overstreet commit caece7fe3f1199f0da42b4537434166f99f0c11f Author: Kent Overstreet Date: Thu Feb 10 18:18:41 2022 -0500 bcachefs: New bucket invalidate path In the old allocator code, preparing an existing empty bucket was part of the same code path that invalidated buckets containing cached data. In the new allocator code this is no longer the case: the main allocator path finds empty buckets (via the new freespace btree), and can't allocate buckets that contain cached data. We now need a separate code path to invalidate buckets containing cached data when we're low on empty buckets, which this patch implements. When the number of free buckets decreases that triggers the new invalidate path to run, which uses the LRU btree to pick cached data buckets to invalidate until we're above our watermark. Signed-off-by: Kent Overstreet commit 59cc38b8d43b529d91c249c2eef35c8c3fc9fbd8 Author: Kent Overstreet Date: Thu Feb 10 04:32:19 2022 -0500 bcachefs: New discard implementation In the old allocator code, buckets would be discarded just prior to being used - this made sense in bcache where we were discarding buckets just after invalidating the cached data they contain, but in a filesystem where we typically have more free space we want to be discarding buckets when they become empty. This patch implements the new behaviour - it checks the need_discard btree for buckets awaiting discards, and then clears the appropriate bit in the alloc btree, which moves the buckets to the freespace btree. Additionally, discards are now enabled by default. Signed-off-by: Kent Overstreet commit f25d8215f499418c17dfde0b3158a66e03c758dc Author: Kent Overstreet Date: Sun Jan 9 20:48:31 2022 -0500 bcachefs: Kill allocator threads & freelists Now that we have new persistent data structures for the allocator, this patch converts the allocator to use them. Now, foreground bucket allocation uses the freespace btree to find buckets to allocate, instead of popping buckets off the freelist. The background allocator threads are no longer needed and are deleted, as well as the allocator freelists. Now we only need background tasks for invalidating buckets containing cached data (when we are low on empty buckets), and for issuing discards. Signed-off-by: Kent Overstreet commit c6b2826cd14c5421bc50a768e923d078a71139c1 Author: Kent Overstreet Date: Sat Dec 11 17:13:09 2021 -0500 bcachefs: Freespace, need_discard btrees This adds two new btrees for the upcoming allocator rewrite: an extents btree of free buckets, and a btree for buckets awaiting discards. We also add a new trigger for alloc keys to keep the new btrees up to date, and a compatibility path to initialize them on existing filesystems. Signed-off-by: Kent Overstreet commit 3d48a7f85f83a51a0eb0d0a6537be26a20691260 Author: Kent Overstreet Date: Fri Dec 31 20:03:29 2021 -0500 bcachefs: KEY_TYPE_alloc_v4 This introduces a new alloc key which doesn't use varints. Soon we'll be adding backpointers and storing them in alloc keys, which means our pack/unpack workflow for alloc keys won't really work - we'll need to be mutating alloc keys in place. Instead of bch2_alloc_unpack(), we now have bch2_alloc_to_v4() that converts older types of alloc keys to v4 if needed. Signed-off-by: Kent Overstreet commit d326ab2f5de201b9b7e790c653a2b925e7032d3b Author: Kent Overstreet Date: Sun Dec 5 00:31:54 2021 -0500 bcachefs: LRU btree This implements new persistent LRUs, to be used for buckets containing cached data, as well as stripes ordered by time when a block became empty. Signed-off-by: Kent Overstreet commit 179e3434fac14a100bad2edba4fd401bffb67802 Author: Kent Overstreet Date: Wed Jan 5 22:13:13 2022 -0500 bcachefs: KEY_TYPE_set A new empty key type, to be used when using a btree as a set. Signed-off-by: Kent Overstreet commit 25be2e5d4a051ff2408c7ab007394e96798cf559 Author: Kent Overstreet Date: Thu Mar 10 16:43:52 2022 -0500 bcachefs: bch_sb_field_journal_v2 Add a new superblock field which represents journal buckets as ranges: also move code for the superblock journal fields to journal_sb.c. This also reworks the code for resizing the journal to write the new superblock before using the new journal buckets, and thus be a bit safer. Signed-off-by: Kent Overstreet commit b17d3cec14b487924df709dbeffb900f124a2607 Author: Kent Overstreet Date: Mon Oct 31 16:13:05 2022 -0400 bcachefs: Run btree updates after write out of write_point In the write path, after the write to the block device(s) complete we have to punt to process context to do the btree update. Instead of using the work item embedded in op->cl, this patch switches to a per write-point work item. This helps with two different issues: - lock contention: btree updates to the same writepoint will (usually) be updating the same alloc keys - context switch overhead: when we're bottlenecked on btree updates, having a thread (running out of a work item) checking the write point for completed ops is cheaper than queueing up a new work item and waking up a kworker. In an arbitrary benchmark, 4k random writes with fio running inside a VM, this patch resulted in a 10% improvement in total iops. Signed-off-by: Kent Overstreet commit 5f417394033a0d8bfb31d02b3becf7381dc13867 Author: Kent Overstreet Date: Tue Jan 11 23:24:43 2022 -0500 bcachefs: bch2_btree_update_start() refactoring This simplifies the logic in bch2_btree_update_start() a bit, handling the unlock/block logic more locally. Signed-off-by: Kent Overstreet commit 31f63fd1244d9609265eb5cfc522c142b35cdacc Author: Kent Overstreet Date: Mon Mar 14 21:48:42 2022 -0400 bcachefs: Introduce a separate journal watermark for copygc Since journal reclaim -> btree key cache flushing may require the allocation of new btree nodes, it has an implicit dependency on copygc in order to make forward progress - so we should avoid blocking copygc unless the journal is really close to full. This introduces watermarks to replace our single MAY_GET_UNRESERVED bit in the journal, and adds a watermark for copygc and plumbs it through. Signed-off-by: Kent Overstreet commit d905f67ec89fda758bcfa70d0b5c3d3006bbdb3e Author: Kent Overstreet Date: Tue Mar 15 16:40:55 2022 -0400 bcachefs: Copygc allocations shouldn't be nowait We don't actually want copygc allocations to be nowait - an allocation for copygc might fail and then later succeed due to a bucket needing to wait on journal commit, or to be discarded. Signed-off-by: Kent Overstreet commit 70a9953c424ccba616a3b74368780de13a80dabd Author: Kent Overstreet Date: Thu Jan 5 10:13:37 2023 -0500 bcachefs: Fix bch2_journal_pin_set() When bch2_journal_pin_set() is updating an existing pin, we shouldn't call bch2_journal_reclaim_fast() after dropping the old pin and before dropping the new pin - that could reclaim the entry we're trying to pin. Signed-off-by: Kent Overstreet commit 3e1547116fe70f49c88e1ee400966a1c7b1bec3a Author: Kent Overstreet Date: Sun Mar 13 19:27:55 2022 -0400 bcachefs: x-macroize alloc_reserve enum This makes an array of strings available, like our other enums. Signed-off-by: Kent Overstreet commit f13fd87a39225eae57d4ddf824a09acb1955abd1 Author: Kent Overstreet Date: Wed Mar 30 23:39:48 2022 -0400 bcachefs: Run overwrite triggers before insert For backpointers, we'll need to delete old backpointers before adding new backpointers - otherwise we'll run into spurious duplicate backpointer errors. Signed-off-by: Kent Overstreet commit 78668fe0bbd9bd04c0dbc7b9f60dd2c36a9a16a9 Author: Kent Overstreet Date: Thu Mar 31 00:03:37 2022 -0400 bcachefs: Move deletion of refcount=0 indirect extents to their triggers For backpointers, we need to switch the order triggers are run in: we need to run triggers for deletions/overwrites before triggers for inserts. To avoid breaking the reflink triggers, this patch moves deleting of indirect extents with refcount=0 to their triggers, instead of doing it when we update those keys. Signed-off-by: Kent Overstreet commit 1296ab552040e09b35f37b8c523d4f1711ac8435 Author: Kent Overstreet Date: Wed Mar 30 23:40:19 2022 -0400 bcachefs: Improve bch2_bkey_ptrs_to_text() Print bucket:offset when the filesystem is online; this makes debugging easier when correlating with alloc updates. Signed-off-by: Kent Overstreet commit 5aabb32442c44c9cfc41a2c29638aebeb3e9cb26 Author: Kent Overstreet Date: Wed Mar 30 15:44:12 2022 -0400 bcachefs: bch2_trans_log_msg() Add a new helper for logging messages to the journal - a new debugging tool, an alternative to trace_printk(). Signed-off-by: Kent Overstreet commit 2a6870ada4340c3a72e381143bc67252f4d243a4 Author: Kent Overstreet Date: Tue Mar 29 16:29:10 2022 -0400 bcachefs: Use darray for extra_journal_entries Signed-off-by: Kent Overstreet commit d864842581e70d2280f2a51ceb2ad6e7cefeed94 Author: Kent Overstreet Date: Wed Mar 30 13:47:07 2022 -0400 bcachefs: btree_path_make_mut() clears should_be_locked This fixes a bug where __bch2_btree_node_update_key() wasn't clearing should_be_locked, leading to bch2_btree_path_traverse() always failing - all callers of btree_path_make_mut() want should_be_locked cleared, so do it there. Signed-off-by: Kent Overstreet commit 7071878bab9cbb38b03ac8612af9ea3021c34137 Author: Kent Overstreet Date: Wed Mar 30 13:10:03 2022 -0400 bcachefs: Add a missing btree_path_set_dirty() calls bch2_btree_iter_next_node() was mucking with other btree_path state without setting path->update to be consistent with the fact that the path is very much no longer uptodate - oops. Signed-off-by: Kent Overstreet commit 81cdc8f3070561786a906c66d697666e6a3319b9 Author: Kent Overstreet Date: Mon Mar 28 16:31:26 2022 -0400 bcachefs: Fix error path in bch2_snapshot_set_equiv() We weren't properly catching errors from snapshot_live() - oops. Signed-off-by: Kent Overstreet commit 7fda0f08fa86731f057367ca36054d29d0c0344c Author: Kent Overstreet Date: Mon Mar 28 16:21:26 2022 -0400 bcachefs: Work around a journal self-deadlock bch2_journal_space_available -> bch2_journal_halt() self deadlocks on journal lock; work around this by dropping/retaking journal lock before we call bch2_fatal_error(). Signed-off-by: Kent Overstreet commit 30690c441a6b481aadb0284d1b9bf487f8d28bfc Author: Kent Overstreet Date: Mon Mar 28 12:31:22 2022 -0400 bcachefs: Heap code fix When deleting an entry from a heap that was at entry h->used - 1, we'd end up calling heap_sift() on an entry outside the heap - the entry we just removed - which would end up re-adding it to the heap and deleting something we didn't want to delete. Oops... Signed-off-by: Kent Overstreet commit fd1e9c69959ec2dd0946f3d2285548c87f9d6ea3 Author: Kent Overstreet Date: Mon Mar 21 19:34:48 2022 -0400 bcachefs: Fix an unitialized var warning in userspace Signed-off-by: Kent Overstreet commit 3756111d138b6c5983d0c7cc2de12a7ec3d1e3d4 Author: Kent Overstreet Date: Mon Mar 21 18:05:39 2022 -0400 bcachefs: Add printf format attribute to bch2_pr_buf() This tells the compiler to check printf format strings, and catches a few bugs. Signed-off-by: Kent Overstreet commit b8559f1a212a7035b430b83e0a01e94a872adc23 Author: Kent Overstreet Date: Mon Mar 21 03:03:03 2022 -0400 bcachefs: Reset journal flush delay to default value if zeroed We've been seeing a very strange bug where journal flush & reclaim delay end up getting inexplicably zeroed, in the superblock. We're now validating all the options in bch2_validate_super(), and 0 is no longer a valid value for those options, but we need to be careful not to prevent people's filesystems from mounting because of the new validation. Signed-off-by: Kent Overstreet commit b0be2fcfb425022025203c27ed75a20db8c6feda Author: Kent Overstreet Date: Sun Mar 20 20:12:53 2022 -0400 bcachefs: Change journal_io.c assertion to error message Something funny is going on with the new code for restoring the journal write point, and it's hard to reproduce. We do want to debug this because resuming writing to the journal in the wrong spot could be something serious. For now, replace the assertion with an error message and revert to old behaviour when it happens. Signed-off-by: Kent Overstreet commit 7a6f4411aeaae888a7b2880f0c046f9efb0d83cc Author: Kent Overstreet Date: Mon Mar 21 00:27:10 2022 -0400 bcachefs: Make minimum journal_flush_delay nonzero We're seeing a very strange bug where journal_flush_delay sometimes gets set to 0 in the superblock. Together with the preceding patch, this should help us track it down. Signed-off-by: Kent Overstreet commit 63c4b25453828ee0670162d35f928ab43635e7fc Author: Kent Overstreet Date: Mon Mar 21 00:15:38 2022 -0400 bcachefs: Better superblock opt validation This moves validation of superblock options to bch2_sb_validate(), so they'll be checked in the write path as well. Signed-off-by: Kent Overstreet commit 74b33393db54dd321c807c621fad966eb9ec54e5 Author: Kent Overstreet Date: Sun Mar 20 23:34:11 2022 -0400 bcachefs: x-macro metadata version enum Now we've got strings for metadata versions - this changes bch2_sb_to_text() and our mount log message to use it. Signed-off-by: Kent Overstreet commit 3a306f3c2c303febffefea4caf09b2326107507a Author: Kent Overstreet Date: Thu Mar 17 21:35:51 2022 -0400 bcachefs: Fix large key cache keys Previously, we'd go into an infinite loop when attempting to cache a bkey in the key cache larger than 128 u64s - since we were only using a u8 for the size field, it'd get rounded up to 256 then truncated to 0. Oops. Signed-off-by: Kent Overstreet commit f8494d253534d3c49e80a483b74469bbeb01367f Author: Kent Overstreet Date: Wed Mar 16 20:31:15 2022 -0400 bcachefs: Convert some WARN_ONs to WARN_ON_ONCE These warnings are symptomatic of something else going wrong, we don't want them spamming up the logs as that'll make it harder to find the real issue. Signed-off-by: Kent Overstreet commit 062afcbae3b269a7d01cf5087df92d5bd8732012 Author: Kent Overstreet Date: Tue Mar 15 02:41:21 2022 -0400 bcachefs: Restore journal write point at startup This patch tweaks the journal recovery path so that we start writing right after where we left off, instead of the next empty bucket. This is partly prep work for supporting zoned devices, but it's also good to do in general to avoid the journal completely filling up and getting stuck. Signed-off-by: Kent Overstreet commit 91d961badfd123b6759488bc4aa7a4d014b739f1 Author: Kent Overstreet Date: Tue Mar 29 15:48:45 2022 -0400 bcachefs: darrays Inspired by CCAN darray - simple, stupid resizable (dynamic) arrays. Signed-off-by: Kent Overstreet commit 5d93a842c1eb292e2cde9f5025628269d7d386e0 Author: Kent Overstreet Date: Sun Mar 13 00:30:16 2022 -0500 bcachefs: Fix BTREE_TRIGGER_WANTS_OLD_AND_NEW BTREE_TRIGGER_WANTS_OLD_AND_NEW didn't work correctly when the old and new key were both alloc keys, but different versions - it required old and new key type to be identical, and this bug is a problem for the new allocator rewrite. This patch fixes it by checking if the old and new key have the same trigger functions - the different versions of alloc (and inode) keys have the same trigger functions. Signed-off-by: Kent Overstreet commit 880e2275f9f1461c87cd113a8da291861cc01400 Author: Kent Overstreet Date: Sun Mar 13 00:26:52 2022 -0500 bcachefs: Move trigger fns to bkey_ops This replaces the switch statements in bch2_mark_key(), bch2_trans_mark_key() with new bkey methods - prep work for the next patch, which fixes BTREE_TRIGGER_WANTS_OLD_AND_NEW. Signed-off-by: Kent Overstreet commit d13f9ee61dac0b5d663844c5778309ec8af1561f Author: Kent Overstreet Date: Sat Mar 12 16:14:55 2022 -0500 bcachefs: Revalidate pointer to old bkey val before calling mem triggers We recently started stashing a copy of the key being overwritten in btree_insert_entry: this is helpful for avoiding multiple calls to bch2_btree_path_peek_slot() and bch2_journal_keys_peek() in the transaction commit path. But it turns out this has a problem - when we run mem/atomic triggers, we've done a couple things that can invalidate the pointer to the old key's value. This makes the optimization of stashing a pointer to the old value questionable, but for now this patch revalidates that pointer before running mem triggers. Signed-off-by: Kent Overstreet commit 8570d775ca90192f8663ddd828a09d0c6698c71c Author: Kent Overstreet Date: Fri Mar 11 18:38:24 2022 -0500 bcachefs: bch2_trans_updates_to_text() This turns bch2_dump_trans_updates() into a to_text() method - this way it can be used by debug tracing. Signed-off-by: Kent Overstreet commit 2158fe463b9d78c7cf90f74b8b5e9b81249d4347 Author: Kent Overstreet Date: Wed Mar 2 22:18:56 2022 -0500 bcachefs: bch2_trans_inconsistent() Add a new error macro that also dumps transaction updates in addition to doing an emergency shutdown - when a transaction update discovers or is causing a fs inconsistency, it's helpful to see what updates it was doing. Signed-off-by: Kent Overstreet commit 0576ba9ae7c7939d2402cdad9614f39785b70d2b Author: Kent Overstreet Date: Fri Mar 11 18:16:42 2022 -0500 bcachefs: Drop !did_work path from do_btree_insert_one() As we've already reserved space in the journal this optimization doesn't actually buy us anything, and when doing list_journal debugging it deletes information we want. Signed-off-by: Kent Overstreet commit 85d8cf161f98993f544c0b2c614873caf7b9c14f Author: Kent Overstreet Date: Fri Mar 11 12:31:52 2022 -0500 bcachefs: bch2_btree_iter_peek_upto() In BTREE_ITER_FILTER_SNAPHOTS mode, we skip over keys in unrelated snapshots. When we hit the end of an inode, if the next inode(s) are in a different subvolume, we could potentially have to skip past many keys before finding a key we can return to the caller, so they can terminate the iteration. This adds a peek_upto() variant to solve this problem, to be used when we know the range we're searching within. Signed-off-by: Kent Overstreet commit d4d24a6509548a6457f185fddd927df7d148464a Author: Kent Overstreet Date: Thu Mar 10 23:22:49 2022 -0500 bcachefs: Delay setting path->should_be_locked Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit cc23255e9a9fcaf7423e0fe7e197605bf10a3f06 Author: Kent Overstreet Date: Thu Mar 10 17:35:06 2022 -0500 bcachefs: Add a missing wakeup This fixes a rare bug with bch2_btree_flush_all_writes() getting stuck. Signed-off-by: Kent Overstreet commit f6c92ebbb8f84ad9b993691b02d5b38736b7a922 Author: Kent Overstreet Date: Thu Mar 10 15:49:03 2022 -0500 bcachefs: Allocate journal buckets sequentially This tweaks __bch2_set_nr_journal_buckets() so that we aren't reversing their order in the jorunal anymore - nice for rotating disks. Signed-off-by: Kent Overstreet commit d5d3be7dc5d09f9cf8d12b3e3cefbcd8020cddae Author: Kent Overstreet Date: Thu Mar 10 14:25:16 2022 -0500 bcachefs: bch2_journal_log_msg() This adds bch2_journal_log_msg(), which just logs a message to the journal, and uses it to mark startup and when journal replay finishes. Signed-off-by: Kent Overstreet commit a9bae40fda067eae70751302cbbc9f362453f310 Author: Kent Overstreet Date: Sat Mar 5 18:23:47 2022 -0500 bcachefs: Change flags param to bch2_btree_delete_range to update_flags It wasn't used as iter_flags (excepting the unit tests, which this patch fixes), and the next patch is going to need to pass in BTREE_TRIGGER_NORUN. Signed-off-by: Kent Overstreet commit 61a66469a4bf63a1357b6af36242682ae339ca2a Author: Kent Overstreet Date: Sun Mar 6 21:17:43 2022 -0500 bcachefs: Fix lock ordering under traverse_all() traverse_all() traverses btree paths in sorted order, so it should never see transaction restarts due to lock ordering violations. But some code in __bch2_btree_path_upgrade(), while necessary when not running under traverse_all(), was causing some confusing lock ordering violations - disabling this code under traverse_all() will let us put in some more assertions. Signed-off-by: Kent Overstreet commit a897ef682781824c9b82f01d107d653f3dbf38e5 Author: Kent Overstreet Date: Mon Mar 7 22:05:49 2022 -0500 bcachefs: Fix error handling in traverse_all() In btree_path_traverse_all() we were failing to check for -EIO in the retry loop, and after btree node read error we'd go into an infinite loop. Signed-off-by: Kent Overstreet commit 9552e19f6fff86d9907bb088f8b1eb786562f9d3 Author: Kent Overstreet Date: Wed Mar 9 15:37:42 2022 -0500 bcachefs: Fix dio write path with loopback dio mode When the iov_iter is a bvec iter, it's possible the IO was submitted from a kthread that didn't have an mm to switch to. Signed-off-by: Kent Overstreet commit 4d126dc8b30c2c1c69cbf600d604e7ceb8ca7f8d Author: Kent Overstreet Date: Tue Mar 8 13:52:58 2022 -0500 bcachefs: Use bio_iov_vecs_to_alloc() This fixes a bug in the DIO read path where, when using a loopback device in DIO mode, we'd allocate a biovec that would get overwritten and leaked in bio_iov_iter_get_pages() -> bio_iov_bvec_set(). Signed-off-by: Kent Overstreet commit 590b91cf3fa419eefc917f4e37152af616c3ba5f Author: Kent Overstreet Date: Mon Mar 7 14:13:22 2022 -0500 bcachefs: Revert UUID format-specifier change "bcachefs: Log & error message improvements" accidentally changed the format specifier we use for converting UUIDs to strings, which broke mounting of encrypted filesystems - this patch reverts that change. Signed-off-by: Kent Overstreet commit 718ce1eb8a84f47f66d0c89de43c6d0f0b14a20e Author: Kent Overstreet Date: Sun Mar 6 17:20:39 2022 -0500 bcachefs: Skip periodic wakeup of journal reclaim when journal empty Less system noise. Signed-off-by: Kent Overstreet commit f0cc5d2931378b7a2a7e797c726a2ab760d4a84d Author: Kent Overstreet Date: Sun Mar 6 15:15:41 2022 -0500 bcachefs: Check for rw before setting opts via sysfs This isn't a correctness issue, it just eliminates errors in the dmesg log when we're RO. Signed-off-by: Kent Overstreet commit 07b8121f07056480c54fca99046870d84a657d13 Author: Kent Overstreet Date: Sun Mar 6 14:04:34 2022 -0500 bcachefs: Fix pr_tab_rjust() pr_tab_rjust() was broken and leaving a null somewhere in the output string - this patch fixes it and simplifies it a bit. Signed-off-by: Kent Overstreet commit e1f7fa06a8ed48feedd5f538fc4724734c6e1869 Author: Kent Overstreet Date: Sat Mar 5 15:21:07 2022 -0500 bcachefs: Don't keep around btree_paths unnecessarily When bch2_trans_begin() is called and there hasn't been a transaction restart, we presume that we're now doing something new - iterating over different keys, and we now shouldn't keep aruond paths related to the previous transaction, excepting the subvolumes btree. This should fix some of our "transaction path overflow" bugs. Signed-off-by: Kent Overstreet commit b60c380bca5458be9e4c0ff77289f0979fbbb52f Author: Kent Overstreet Date: Sat Mar 5 13:38:54 2022 -0500 bcachefs: Don't arm journal->write_work when journal entry !open This fixes a shutdown race where we were rearming journal->write_work after the journal has already shut down. Signed-off-by: Kent Overstreet commit 5521b1dfa20262a9cb8d1214c095c9ca2a4cb127 Author: Kent Overstreet Date: Sat Mar 5 12:01:16 2022 -0500 bcachefs: Convert bch2_sb_to_text to master option list Options no longer have to be manually added to bch2_sb_to_text() - it now uses the master list of options in opts.h. Also, improve some of the formatting by converting it to tabstops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4eea53de8a1882e75d3640dce06c8c2874a77b05 Author: Kent Overstreet Date: Fri Mar 4 21:57:11 2022 -0500 bcachefs: Fix transaction path overflow in fiemap Signed-off-by: Kent Overstreet commit 102a6a8f69b06df0e6594af4932ef47804f645c6 Author: Daniel Hill Date: Sat Mar 5 17:45:27 2022 +1300 bcachefs: respect superblock discard flag. We were accidentally using default mount options and overwriting the discard flag. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet commit 3098553776a16c08446c408005090423d62e6b54 Author: Kent Overstreet Date: Fri Mar 4 19:16:04 2022 -0500 bcachefs: Fix usage of six lock's percpu mode Six locks have a percpu mode, which we use for interior btree nodes, as well as btree key cache keys for the subvolumes btree. We've been switching locks back and forth between percpu and non percpu mode as needed, but it turns out this is racy - when we're reusing an existing node, other threads could be attempting to lock it while we're switching it between modes. This patch fixes this by never switching 'struct btree' between the two modes, and instead segragating them between two different freed lists. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5b3f780540aa5e39859a0c00ace61713da054a0f Author: Kent Overstreet Date: Fri Mar 4 19:50:28 2022 -0500 bcachefs: Refactor bch2_btree_node_mem_alloc() This is prep work for the next patch, which is going to fix our usage of the percpu mode of six locks by never switching struct btree between the two modes - which means we need separate freed lists. Signed-off-by: Kent Overstreet commit ee68105f619b90ef7daef9f9ebab1270209d6151 Author: Kent Overstreet Date: Fri Mar 4 19:15:46 2022 -0500 bcachefs: Simplify parameters to bch2_btree_update_start() We don't need to pass the number of nodes required to bch2_btree_update_start, just whether we're doing a split at @level. This is prep work for a fix to our usage of six lock's percpu mode, which is going to require us to count up and allocate interior nodes and leaf nodes seperately. Signed-off-by: Kent Overstreet commit 05a49d22750ec4977b52c9da09039a931c0f2644 Author: Kent Overstreet Date: Thu Mar 3 11:04:01 2022 -0500 bcachefs: Make bch2_btree_cache_scan() try harder Previously, when bch2_btree_cache_scan() attempted to reclaim a node but failed (because trylock failed, because it was dirty, etc.), it would count that against the number of nodes it was scanning and attempting to free. This patch changes that behaviour, so that now we only count nodes that we then don't free if they have the accessed bit (which we also clear). Signed-off-by: Kent Overstreet commit e0c014e7e4ccd4d865b637721e3e580505c29b07 Author: Kent Overstreet Date: Mon Feb 28 18:48:33 2022 -0500 bcachefs: Finish writing journal after journal error After emergency shutdown, all journal entries will be written as noflush entries, meaning they will never be used - but they'll still exist for debugging tools to examine. Signed-off-by: Kent Overstreet commit 24a3d53b28398d2edd4dc717bede21eaf4a3b874 Author: Kent Overstreet Date: Mon Feb 28 19:29:19 2022 -0500 bcachefs: __journal_entry_close() never fails Previous patch just moved responsibility for incrementing the journal sequence number and initializing the new journal entry from __journal_entry_close() to journal_entry_open(); this patch makes the analagous change for journal reservation state, incrementing the index into array of journal_bufs at open time. This means that __journal_entry_close() never fails to close an open journal entry, which is important for the next patch that will change our emergency shutdown behaviour. Signed-off-by: Kent Overstreet commit 30ef633a0b46e06860f46bf7df0f5a313e6e1a19 Author: Kent Overstreet Date: Mon Feb 28 19:17:27 2022 -0500 bcachefs: Refactor journal code to not use unwritten_idx It makes the code more readable if we work off of sequence numbers, instead of direct indexes into the array of journal buffers. Signed-off-by: Kent Overstreet commit f0a3a2ccabc5ae1e2c7d588a6a4f77d216b1d4cf Author: Kent Overstreet Date: Mon Feb 28 16:35:42 2022 -0500 bcachefs: Journal seq now incremented at entry open, not close This patch changes journal_entry_open() to initialize the new journal entry, not __journal_entry_close(). This also means that journal_cur_seq() refers to the sequence number of the last journal entry when we don't have an open journal entry, not the next one. Signed-off-by: Kent Overstreet commit b66fbf33425f30aacbbb95182c22d2df5b1d3b12 Author: Kent Overstreet Date: Tue Mar 1 15:31:20 2022 -0500 bcachefs: Drop unneeded journal pin in bch2_btree_update_start() When we do an interior btree update, we create new btree nodes and link them into the btree in memory, but they don't become reachable on disk until later, when btree_update_nodes_written_trans() runs. Updates to the new nodes can thus happen before they're reachable on disk, and if the updates to those new nodes are written before the nodes become reachable, we would then drop the journal pin for those updates before the btree has them. This is what the journal pin in bch2_btree_update_start() was protecting against. However, it's not actually needed because we don't allow subsequent append writes to btree nodes until the node is reachable on disk. Dropping this unneeded pin also fixes a bug introduced by "bcachefs: Journal seq now incremented at entry open, not close" - in the new code, if the journal is completely empty a journal pin list for journal_cur_seq() won't exist. Signed-off-by: Kent Overstreet commit dfc0f7ea00a71e12772d174e5f070dd5b1bf8981 Author: Kent Overstreet Date: Mon Feb 28 16:21:07 2022 -0500 bcachefs: bch2_journal_halt() now takes journal lock This change is prep work for moving some work from __journal_entry_close() to journal_entry_open(): without this change, journal_entry_open() doesn't know if it's going to be able to open a new journal entry until the cmpxchg loop, meaning it can't create the new journal pin entry and update other global state because those have to be done prior to the cmpxchg opening the new journal entry. Fortunately, we don't call bch2_journal_halt() from interrupt context. Signed-off-by: Kent Overstreet commit fbec3b8800ac8244ce751d0ba5b83d94ee48fc76 Author: Kent Overstreet Date: Fri Feb 25 10:28:20 2022 -0500 bcachefs: Kill JOURNAL_NEED_WRITE This replaces the journal flag JOURNAL_NEED_WRITE with per-journal buf state - more explicit, and solving a race in the old code that would lead to entries being opened and written unnecessarily. Signed-off-by: Kent Overstreet commit 506bac7e59d93cfd883dab0697ed91850f319be6 Author: Kent Overstreet Date: Mon Feb 28 15:51:24 2022 -0500 bcachefs: Delete some dead journal code Signed-off-by: Kent Overstreet commit ddf11d8c60b0d46dd25520d388243b508d6e9016 Author: Kent Overstreet Date: Sun Feb 27 11:34:21 2022 -0500 bcachefs: Fix a use after free This fixes a regression from "bcachefs: Stash a copy of key being overwritten in btree_insert_entry". In btree_key_can_insert_cached(), we may reallocate the key cache key, invalidating pointers previously returned by peek() - fix it by issuing a transaction restart. Signed-off-by: Kent Overstreet commit 7db4cbd0a52554ddec4cabf2ebd69fc7bcd53a31 Author: Kent Overstreet Date: Sun Feb 27 11:57:42 2022 -0500 bcachefs: Fix a memory leak This fixes a regression from "bcachefs: Heap allocate printbufs" - bch2_sb_field_validate() was leaking an error string. Signed-off-by: Kent Overstreet commit bf3efff5e4fc2dcd6e6c15578d3f08c301a13229 Author: Kent Overstreet Date: Sun Feb 27 09:56:33 2022 -0500 bcachefs: Fix race leading to btree node write getting stuck Checking btree_node_may_write() isn't atomic with the other btree flags, dirty and need_write in particular. There was a rare race where we'd unblock a node from writing while __btree_node_flush() was setting need_write, and no thread would notice that the node was now both able to write and needed to be written. Fix this by adding btree node flags for will_make_reachable and write_blocked that can be checked in the cmpxchg loop in __bch2_btree_node_write. Signed-off-by: Kent Overstreet commit 6f5f747c318be4adf3824ee7716a7886da35f9a3 Author: Kent Overstreet Date: Sun Feb 27 09:42:46 2022 -0500 bcachefs: Kill bch2_btree_node_write_cond() bch2_btree_node_write_cond() was only used in one place - this inlines it into __btree_node_flush() and makes the cmpxchg loop actually correct. Signed-off-by: Kent Overstreet commit 82732ef510b8455bbf9e9292b6fd04cb724bdadf Author: Kent Overstreet Date: Sat Feb 26 21:46:41 2022 -0500 bcachefs: Improve btree_node_write_if_need() btree_node_write_if_need() kicks off a btree node write only if need_write is set; this makes the locking easier to reason about by moving the check into the cmpxchg loop in __bch2_btree_node_write(). Signed-off-by: Kent Overstreet commit 39dcace83889f43d5619d07c2ec76c286c88a85b Author: Kent Overstreet Date: Sat Feb 26 21:35:16 2022 -0500 bcachefs: Fix locking in btree_node_write_done() There was a rare recursive locking bug, in __bch2_btree_node_write() nowrite path -> btree_node_write_done(), in the path that kicks off another write. This splits out an inner __btree_node_write_done() that expects to be run with the btree node lock held. Signed-off-by: Kent Overstreet commit 75ef2c59bc2f4d3c3ecd48286ac36ee7b868321c Author: Kent Overstreet Date: Sat Feb 26 11:48:34 2022 -0500 bcachefs: Start moving debug info from sysfs to debugfs In sysfs, files can only output at most PAGE_SIZE. This is a problem for debug info that needs to list an arbitrary number of times, and because of this limit some of our debug info has been terser and harder to read than we'd like. This patch moves info about journal pins and cached btree nodes to debugfs, and greatly expands and improves the output we return. Signed-off-by: Kent Overstreet commit 734f7141ce45360203ddaa64782279653c1c9588 Author: Kent Overstreet Date: Wed Dec 28 17:13:08 2022 -0500 bcachefs: Improve struct journal layout This cacheline aligns struct journal, and puts j->reservations and j->prereserved on their own cacheline - we may want to split them up in a separate patch. Signed-off-by: Kent Overstreet commit de517c95513d420d465ca26d354a56d9e6ed6e17 Author: Kent Overstreet Date: Sat Feb 26 11:10:20 2022 -0500 bcachefs: Use x-macros for btree node flags This is for adding an array of strings for btree node flag names. Signed-off-by: Kent Overstreet commit 55334d78974fa44735bb59229eedde0bcc300ed6 Author: Kent Overstreet Date: Sat Feb 26 20:25:15 2022 -0500 bcachefs: Kill BCH_FS_HOLD_BTREE_WRITES This was just dead code. Signed-off-by: Kent Overstreet commit 2975cd4701b71d5b28753861a9388bf67db26231 Author: Kent Overstreet Date: Fri Feb 25 22:45:58 2022 -0500 bcachefs: Don't spin in journal reclaim If we're not able to flush anything, we shouldn't keep looping. Signed-off-by: Kent Overstreet commit a0a07c59f5b4646b9371a1c119feeb6ee52b0012 Author: Kent Overstreet Date: Fri Feb 25 22:33:01 2022 -0500 bcachefs: Fix btree path sorting In btree_update_interior.c, we were changing a path's level directly - which affects path sort order - without re-sorting paths, leading to assertions when bch2_path_get() verified paths were sorted correctly. Signed-off-by: Kent Overstreet commit cb598111836fbca03b1353a6238cde8a66e5ddf0 Author: Kent Overstreet Date: Fri Feb 25 22:14:35 2022 -0500 bcachefs: Fix journal_flush_done() journal_flush_done() was overwriting did_work, thus occasionally returning false when it did do work and occasional assertions in the shutdown sequence because we didn't completely flush the key cache. Signed-off-by: Kent Overstreet commit fa8e94faeece12c20b541f647059f29867e98bc0 Author: Kent Overstreet Date: Fri Feb 25 13:18:19 2022 -0500 bcachefs: Heap allocate printbufs This patch changes printbufs dynamically allocate and reallocate a buffer as needed. Stack usage has become a bit of a problem, and a major cause of that has been static size string buffers on the stack. The most involved part of this refactoring is that printbufs must now be exited with printbuf_exit(). Signed-off-by: Kent Overstreet commit 2be7b16eee9442f2c45ebde19bd3b50fcd030515 Author: Kent Overstreet Date: Fri Feb 25 13:17:48 2022 -0500 bcachefs: Convert bch2_pd_controller_print_debug() to a printbuf Fewer random on-stack char arrays. Signed-off-by: Kent Overstreet commit eb7bd15fe4e7a4a6cf05d9086722aad49f80c259 Author: Kent Overstreet Date: Thu Feb 24 19:04:11 2022 -0500 bcachefs: Improve debug assertion We're hitting a strange bug with transaction paths not being sorted correctly - this dumps transaction paths in the order we thought was sorted, which will hopefully shed some light as to what's going on. Signed-off-by: Kent Overstreet commit eac91bf27f088ecb0676873ff298db2dcd5ff9fa Author: Kent Overstreet Date: Thu Feb 24 18:19:32 2022 -0500 bcachefs: Fix bch2_journal_pins_to_text() When key cache pins were put onto their own list, we neglected to update bch2_journal_pins_to_text() to print them. Signed-off-by: Kent Overstreet commit 25a7723182ee62a8e74b204acbd117e4d6c12341 Author: Kent Overstreet Date: Thu Feb 24 13:27:31 2022 -0500 bcachefs: Always clear should_be_locked in bch2_trans_begin() bch2_trans_begin() invalidates all iterators, until they're revalidated by calling peek() or traverse(). Signed-off-by: Kent Overstreet commit 0c10cf852551edca80a2b711de1c84fd001ffd02 Author: Kent Overstreet Date: Thu Jan 6 01:20:41 2022 -0500 bcachefs: Run alloc triggers last Triggers can generate additional btree updates - we need to run alloc triggers after all other triggers have run, because they generate updates for the alloc btree. Signed-off-by: Kent Overstreet commit 96d3a0afe04af0c50243e08f9a889c889f9cd131 Author: Kent Overstreet Date: Thu Feb 24 11:02:58 2022 -0500 bcachefs: Trigger code uses stashed copy of old key Signed-off-by: Kent Overstreet commit 3598c56eb93b9774d3aa06b3e3c0eab0bbbc26f0 Author: Kent Overstreet Date: Thu Feb 24 11:30:17 2022 -0500 bcachefs: Consolidate trigger code a bit Upcoming patches are doing more work on the triggers code, this patch just moves code around. Signed-off-by: Kent Overstreet commit ae94c78fb1d5acc8315b7d17583ddb92df29bd3a Author: Kent Overstreet Date: Fri Dec 10 17:04:26 2021 -0500 bcachefs: bch2_trans_mark_key() now takes a bkey_i * We're now coming up with triggers that modify the update being done. A bkey_s_c is const - bkey_i is the correct type to be using here. Signed-off-by: Kent Overstreet commit 82697a10dd4b9a6f7c6f98a525778d032db2f2fb Author: Kent Overstreet Date: Wed Feb 23 11:46:34 2022 -0500 bcachefs: Fix 32 bit build vstruct_bytes() was returning a u64 - it should be a size_t, the corect type for the size of anything that fits in memory. Also replace a 64 bit divide with div_u64(). Signed-off-by: Kent Overstreet commit 78a8f36280e178df4e78382c82a20e3af1704e65 Author: Kent Overstreet Date: Wed Feb 23 10:32:43 2022 -0500 bcachefs: Improve some btree node read error messages On btree node read error, it's helpful to see what we were trying to read - was it all zeroes? Signed-off-by: Kent Overstreet commit a69e7e6a8732ab336548359020fe865150ae8a5a Author: Kent Overstreet Date: Sat Feb 19 03:56:44 2022 -0500 bcachefs: Use unlikely() in err_on() macros Should be obviously a good thing. Signed-off-by: Kent Overstreet commit b0551285e11edbf86bebe6df0396adf84e032f5c Author: Kent Overstreet Date: Sat Feb 19 03:06:28 2022 -0500 bcachefs: Improve reflink repair code When a reflink pointer points to a missing indirect extent, we replace it with an error key. Instead of replacing the entire reflink pointer with an error key, this patch replaces only the missing range with an error key. Signed-off-by: Kent Overstreet commit 78c8fe20be12d0e4b6427d9149fd1eb9a69e2290 Author: Kent Overstreet Date: Sat Feb 19 02:48:27 2022 -0500 bcachefs: Normal update/commit path now works before going RW This improves __bch2_trans_commit - early in the recovery process, when we're running btree_gc and before we want to go RW, it now uses bch2_journal_key_insert() to add the update to the list of updates for journal replay to do, instead of btree_gc having to use separate interfaces depending on whether we're running at bringup or, later, runtime. Signed-off-by: Kent Overstreet commit b66b2bc0f64a57c042ea1fa51dbd5904557bf67f Author: Kent Overstreet Date: Wed Feb 23 06:56:35 2022 -0500 bcachefs: Revert "Ensure journal doesn't get stuck in nochanges mode" This patch was originally to work around the journal geting stuck in nochanges mode - but that was just a hack, we needed to fix the actual bug. It should be fixed now, so revert it. Signed-off-by: Kent Overstreet commit e201f70b116513cb0d17ba32e1f00c234dee9d7e Author: Kent Overstreet Date: Wed Feb 23 10:26:10 2022 -0500 bcachefs: Fix for journal getting stuck The journal can get stuck if we need to get a journal reservation for something we have a pre-reservation for, but aren't able to reclaim space, or if the pin fifo is full - it's impractical to resize the pin fifo at runtime. Previously, we reserved 8 entries in the pin fifo for pre-reservations, but that seems small - we're seeing the journal occasionally get stuck. Let's reserve a quarter of it. Signed-off-by: Kent Overstreet commit 6e44568cc311b39613ed292c9dc1dd8cbec86db7 Author: Kent Overstreet Date: Tue Feb 22 17:16:45 2022 -0500 bcachefs: Set BTREE_NODE_SEQ() correctly in merge path BTREE_NODE_SEQ() is supposed to give us a time ordering of btree nodes on disk, so that we can tell which btree node is newer if we ever have to scan the entire device to find btree nodes. The btree node merge path wasn't setting it correctly on the new node - oops. Signed-off-by: Kent Overstreet commit 5838c1702b7d99741273888644a8cd4423b8a440 Author: Kent Overstreet Date: Wed Feb 23 07:00:34 2022 -0500 bcachefs: Drop journal_write_compact() Long ago it was possible to get a journal reservation and not use it, but that's no longer allowed, which means journal_write_compact() has very little work to do, and isn't really worth the code anymore. Signed-off-by: Kent Overstreet commit 8322a9376eb21c47829128684fd900016a0e0169 Author: Kent Overstreet Date: Wed Jan 4 04:34:16 2023 -0500 bcachefs: Btree key cache optimization This helps with lock contention in the journalling code: instead of updating our journal pin on every write, only get a journal pin if we don't have one. This means we can avoid hammering on journal locks nearly so much, at the cost of carrying around a journal pin for an older entry than the one we actually need. To handle that, if needed we update our journal pin to the correct one when flushed by journal reclaim. Signed-off-by: Kent Overstreet commit 702a4ef07774fbc565f3e567073d2f83f9602667 Author: Kent Overstreet Date: Tue Feb 22 04:53:48 2022 -0500 bcachefs: Add tabstops to printbufs Now, when outputting to printbufs, we can set tabstops and left or right justify text to them - this is to be used by the userspace 'bcachefs fs usage' command. Signed-off-by: Kent Overstreet commit f61816d0fc6091e14b3f4ffce962dc5084a1b6cd Author: Kent Overstreet Date: Mon Feb 21 13:22:11 2022 -0500 bcachefs: Fix a use after free In move_read_endio, we were checking if the next pending write has its read completed - but this can turn after a use after free (and we were accessing the list without a lock), so instead just better to just unconditionally do the wakeup. Signed-off-by: Kent Overstreet commit 12bf93a429c981cf337ce2c27504ec0171157f76 Author: Kent Overstreet Date: Sun Feb 20 05:00:45 2022 -0500 bcachefs: Add .to_text() methods for all superblock sections This patch improves the superblock .to_text() methods and adds methods for all types that were missing them. It also improves printbufs by allowing them to specfiy what units we want to be printing in, and adds new wrapper methods for unifying our kernel and userspace environments. Signed-off-by: Kent Overstreet commit d4b691522c4b60220087a01c276f3fa9781405b0 Author: Kent Overstreet Date: Sun Feb 20 04:52:44 2022 -0500 bcachefs: Kill bch_scnmemcpy() bch_scnmemcpy was for printing length-limited strings that might not have a terminating null - turns out sprintf & pr_buf can do this with %.*s. Signed-off-by: Kent Overstreet commit 3117db99f30b26ebf09ecc323cbefcd51d83467b Author: Kent Overstreet Date: Mon Feb 21 05:05:29 2022 -0500 bcachefs: Don't issue discards when in nochanges mode When the nochanges option is selected, we're supposed to never issue writes. Unfortunately, it seems discards were missed when implemnting this, leading to some painful filesystem corruption. Signed-off-by: Kent Overstreet commit 8ccf4dff09e49b34c6ed2e161720634e8dafb99f Author: Kent Overstreet Date: Sat Feb 19 05:15:53 2022 -0500 bcachefs: opts.read_journal_only Add an option that tells recovery to only read the journal, to be used by the list_journal command. Signed-off-by: Kent Overstreet commit 06a98c966f9ae5d978b53986eca2a9cd99d2a6f3 Author: Kent Overstreet Date: Sat Feb 19 02:40:45 2022 -0500 bcachefs: Change __bch2_trans_commit() to run triggers then get RW This is prep work for the next patch, which is going to change __bch2_trans_commit() to use bch2_journal_key_insert() when very early in the recovery process, so that we have a unified interface for doing btree updates. Signed-off-by: Kent Overstreet commit 10b93677d35281766fe5439dcd7982fce67f82a7 Author: Kent Overstreet Date: Sat Feb 19 02:39:56 2022 -0500 bcachefs: Delete some flag bits that are no longer used Signed-off-by: Kent Overstreet commit 72b7d6332b0a769b0b76c78b372aa733a3715c42 Author: Kent Overstreet Date: Sat Feb 19 01:18:18 2022 -0500 bcachefs: Store logical location of journal entries When viewing what's in the journal, it's more useful to have the logical location - journal bucket and offset within that bucket - than just the offset on that device. Signed-off-by: Kent Overstreet commit a9de137bf63107245b43e9046cddc1acc447221a Author: Kent Overstreet Date: Sat Feb 19 00:42:12 2022 -0500 bcachefs: Check for errors from crypto_skcipher_encrypt() Apparently it actually is possible for crypto_skcipher_encrypt() to return an error - not sure why that would be - but we need to replace our assertion with actual error handling. Signed-off-by: Kent Overstreet commit 8f9ad91a02c4fd1391ce852cadd9a0227fdd624a Author: Kent Overstreet Date: Fri Feb 18 00:47:45 2022 -0500 bcachefs: Fix failure to allocate btree node in cache The error code when we fail to allocate a node in the btree node cache doesn't make it to bch2_btree_path_traverse_all(). Instead, we need to stash a flag in btree_trans so we know we have to take the cannibalize lock. Signed-off-by: Kent Overstreet commit bf7e49a4ae564108d08d314e514a6f802748d73b Author: Kent Overstreet Date: Wed Feb 16 06:23:06 2022 -0500 bcachefs: Change bch2_dev_lookup() to not use lookup_bdev() bch2_dev_lookup() is used from the extended attribute set methods, for setting the target options, where we're already holding an inode lock - it turns out pathname lookups also take inode locks, so that was susceptible to deadlocks. Fortunately we already stash the device name in ca->name. This does change user-visible behaviour though: instead of specifying e.g. /dev/sda1, user must now specify sda1. Signed-off-by: Kent Overstreet commit 2232fa397c2be92ed80ee48d52de98a1a2916b06 Author: Kent Overstreet Date: Mon Feb 14 01:42:31 2022 -0500 bcachefs: Only allocate buckets_nouse when requested It's only needed by the migrate tool - this patch adds an option to enable allocating it. Signed-off-by: Kent Overstreet commit c929f2306e61500bf68a39cb2a16006bfe844d52 Author: Kent Overstreet Date: Sun Feb 13 01:58:12 2022 -0500 bcachefs: Stale ptr cleanup is now done by gc_gens Before we had dedicated gc code for bucket->oldest_gen this was btree_gc's responsibility, but now that we have that we can rip it out, simplifying the already overcomplicated btree_gc. Signed-off-by: Kent Overstreet commit e7bc7cdff813719479d555d9a3ebb62bef3050ce Author: Kent Overstreet Date: Wed Feb 16 02:50:39 2022 -0500 bcachefs: Improve journal_entry_btree_keys_to_text() This improves the formatting of journal_entry_btree_keys_to_text() by putting each key on its own line. Signed-off-by: Kent Overstreet commit 33aa419db96077993af90eddb49adac1270a96e0 Author: Kent Overstreet Date: Wed Feb 16 03:13:36 2022 -0500 bcachefs: Fix __btree_path_traverse_all The loop that traverses paths in traverse_all() needs to be a little bit tricky, because traversing a path can cause other paths to be added (or perhaps removed) at about the same position. The old logic was buggy, replace it with simpler logic. Signed-off-by: Kent Overstreet commit 4b59a319ad29815aa8f629513df2c291c2108bf9 Author: Kent Overstreet Date: Wed Feb 16 00:42:34 2022 -0500 bcachefs: Fix slow tracepoints Some of our tracepoints were calling snprintf("pS") - which does symbol table lookups - in TP_fast_assign(), which turns out to be a really bad idea. This was done because perf trace wasn't correctly printing tracepoints that use %pS anymore - but it turns out trace-cmd does handle it correctly. Signed-off-by: Kent Overstreet commit eb331fe5a4e801dc11d96ba7fbda0a91c8bd626c Author: Kent Overstreet Date: Tue Feb 15 00:06:59 2022 -0500 bcachefs: Check for stale dirty pointer before reads Since we retry reads when we discover we read from a pointer that went stale, if a dirty pointer is erroniously stale it would cause us to loop retrying that read forever - unless we check before issuing the read, while the btree is still locked, when we know that a dirty pointer should never be stale. This patch adds that check, along with printing some helpful debug info. Signed-off-by: Kent Overstreet commit fcf01959eaa828b1005f8f30732949e64edb8c4d Author: Kent Overstreet Date: Mon Feb 14 04:20:39 2022 -0500 bcachefs: Kill verify_not_stale() This is ancient code that's more effectively checked in other places now. Signed-off-by: Kent Overstreet commit 7abda8c1d8af41266e543160bb3290dea963fdd0 Author: Kent Overstreet Date: Tue Feb 15 22:01:33 2022 -0500 bcachefs: Fix __bch2_btree_node_lock __bch2_btree_node_lock() was implementing the wrong lock ordering for cached vs. non cached paths - this fixes it to match the btree path sort order as defined by __btree_path_cmp(), and also simplifies the code some. Signed-off-by: Kent Overstreet commit c7ce27328ba133d6cce76a4df7667088009d4543 Author: Kent Overstreet Date: Tue Feb 15 22:28:37 2022 -0500 bcachefs: Also show when blocked on write locks This consolidates some of the btree node lock path, so that when we're blocked taking a write lock on a node it shows up in bch2_btree_trans_to_text(), along with intent and read locks. Signed-off-by: Kent Overstreet commit 8be1aff0092a1f747973bf978ab8411b257af461 Author: Kent Overstreet Date: Tue Feb 15 21:45:04 2022 -0500 bcachefs: Delete redundant tracepoint We were emitting two trace events on transaction restart in this code path - delete the redundant one. Signed-off-by: Kent Overstreet commit 52eef42c5fecb037b626cbab2dd06f34e5f0fddb Author: Kent Overstreet Date: Tue Feb 15 23:40:30 2022 -0500 bcachefs: Fix locking in data move path We need to ensure we don't have any btree locks held when calling do_pending_writes() - besides issuing IOs, upcoming allocator changes will have allocations doing btree lookups directly. Signed-off-by: Kent Overstreet commit 2ce8fbd9bbfaea9786f56012a633dedb86349c5a Author: Kent Overstreet Date: Sun Feb 13 22:16:45 2022 -0500 bcachefs: Kill bch2_bkey_debugcheck The old .debugcheck methods are no more and this just calls the .invalid method, which doesn't add much since we already check that when doing btree updates and when reading metadata in. Signed-off-by: Kent Overstreet commit 0f78264a6b84733cc9ef36d22c547133cab21270 Author: Kent Overstreet Date: Sun Feb 13 20:47:05 2022 -0500 bcachefs: Print a better message for mark and sweep pass Btree gc, aka mark and sweep, checks allocations - so let's just print that. Signed-off-by: Kent Overstreet commit 9e34316156a2c148b0675087beeaca26f7eb79f9 Author: Kent Overstreet Date: Sun Feb 13 20:42:12 2022 -0500 bcachefs: Small fsck fix The check_dirents pass handles transaction restarts at the toplevel - check_subdir_count() was incorrectly handling transaction restarts without returning -EINTR, meaning that the iterator pointing to the dirent being checked was left invalid. Signed-off-by: Kent Overstreet commit aa8982c3f2cbfca89fb73daad9d6e65f7be022c2 Author: Kent Overstreet Date: Thu Feb 10 03:40:44 2022 -0500 bcachefs: Fix reflink repair code The reflink repair code was incorrectly inserting a nonzero deleted key via journal replay - this is due to bch2_journal_key_insert() being somewhat hacky, and so this fix is also hacky for now. Signed-off-by: Kent Overstreet commit c45c866761671ddfc180a7fffa2e9f96bb8affd2 Author: Kent Overstreet Date: Fri Dec 24 04:51:10 2021 -0500 bcachefs: bch2_gc_gens() no longer uses bucket array Like the previous patches, this converts bch2_gc_gens() to use the alloc btree directly, and private arrays of generation numbers for its own recalculation of oldest_gen. Signed-off-by: Kent Overstreet commit d73e0d2cd185c313b8a9063b11b3fb91df9db261 Author: Kent Overstreet Date: Sat Dec 25 03:37:52 2021 -0500 bcachefs: Copygc no longer uses bucket array This converts the copygc code to use the alloc btree directly to find buckets that need to be evacuated instead of the in-memory bucket array, which is finally going away soon. Signed-off-by: Kent Overstreet commit ec061b215d63b5e85ebf1a4ecfae661c01578c2e Author: Kent Overstreet Date: Sat Dec 25 20:39:19 2021 -0500 bcachefs: btree_gc no longer uses main in-memory bucket array This changes the btree_gc code to only use the second bucket array, the one dedicated to GC. On completion, it compares what's in its in memory bucket array to the allocation information in the btree and writes it directly, instead of updating the main in-memory bucket array and writing that. Signed-off-by: Kent Overstreet commit 63a2edce9487b1fcea7257676614456846f9ab09 Author: Kent Overstreet Date: Mon Jan 9 02:25:08 2023 -0500 bcachefs: Inode create no longer needs to probe key cache Now that we have full key cache coherency, we can simplify bch2_inode_create(). Signed-off-by: Kent Overstreet commit 12ce5b7df1e0e432bcac22079e4493cab5cd8b23 Author: Kent Overstreet Date: Wed Jan 12 01:14:47 2022 -0500 bcachefs: Btree key cache coherency - Updates to non key cache iterators will now be transparently redirected to the key cache for cached btrees. - Except when creating new keys: then the update goes to underlying btree For for iterating over a cached btree to work, we need to ensure that if a key exists in the key cache, it also exists in the btree - otherwise the iterator code will skip past it and not check the key cache. Otherwise, for consistency, all updates should go to the same place - the key cache. Signed-off-by: Kent Overstreet commit f7b6ca23b6456b8b441b506ef977ff53972b35c2 Author: Kent Overstreet Date: Sun Feb 6 23:15:12 2022 -0500 bcachefs: BTREE_ITER_WITH_KEY_CACHE This is the start of cache coherency with the btree key cache - this adds a btree iterator flag that causes lookups to also check the key cache when we're iterating over the btree (not iterating over the key cache). Note that we could still race with another thread creating at item in the key cache and updating it, since we aren't holding the key cache locked if it wasn't found. The next patch for the update path will address this by causing the transaction to restart if the key cache is found to be dirty. Signed-off-by: Kent Overstreet commit 45e4cd9e3a088d476929c5ee245e83baeee6cdd5 Author: Kent Overstreet Date: Thu Feb 24 08:08:53 2022 -0500 bcachefs: run_one_trigger() now checks journal keys Previously, when doing updates and running triggers before journal replay completes, triggers would see the incorrect key for the old key being overwritten - this patch updates the trigger code to check the journal keys when necessary, needed for the upcoming allocator rewrite. Signed-off-by: Kent Overstreet commit 2e63e180665d527f52b2200acca4aeced065e63f Author: Kent Overstreet Date: Thu Feb 24 11:02:58 2022 -0500 bcachefs: Stash a copy of key being overwritten in btree_insert_entry We currently need to call bch2_btree_path_peek_slot() multiple times in the transaction commit path - and some of those need to be updated to also check the keys from journal replay, too. Let's consolidate this and stash the key being overwritten in btree_insert_entry. Signed-off-by: Kent Overstreet commit ce91abd60b0aa26e50e6b44b599a0e232b80a8b9 Author: Kent Overstreet Date: Sun Feb 6 22:21:44 2022 -0500 bcachefs: bch2_btree_path_set_pos() bch2_btree_path_set_pos() is now available outside of btree_iter.c Signed-off-by: Kent Overstreet commit 7c8f6f980dc85fefea69dc1aa161fd2af2d8b3d5 Author: Kent Overstreet Date: Wed Jan 12 02:13:21 2022 -0500 bcachefs: btree_id_cached() Add a new helper that returns true if the given btree ID uses the btree key cache. This enables some new cleanups, since the helper can check the options for whether caching is enabled on a given btree. Signed-off-by: Kent Overstreet commit a9c0b125d8162bf648f7a004f70d4cff6e84ddd9 Author: Kent Overstreet Date: Wed Jan 12 00:49:23 2022 -0500 bcachefs: Improve btree_key_cache_flush_pos() btree_key_cache_flush_pos() uses BTREE_ITER_CACHED_NOFILL - but it wasn't checking for !ck->valid. It does check for the entry being dirty, so it shouldn't matter, but this refactor it a bit and adds and assertion. Signed-off-by: Kent Overstreet commit 80bf2f345411b9952a984b6105cd860500b01228 Author: Kent Overstreet Date: Sun Feb 6 19:20:36 2022 -0500 bcachefs: Fix freeing in bch2_dev_buckets_resize() We were double-freeing old_buckets and not freeing old_buckets_gens: also, the code was supposed to free buckets, not old_buckets; old_buckets is only needed because we have to use rcu_assign_pointer() instead of swap(), and won't be set if we hit the error path. Signed-off-by: Kent Overstreet commit 35228ecb7e4d45822c0e2acbb0fb9555da31ef31 Author: Kent Overstreet Date: Mon Feb 7 01:19:39 2022 -0500 bcachefs: Don't keep nodes in btree_reserve locked These nodes aren't reachable by other threads, so there's no need to keep it locked - and this fixes a bug with the assertion in bch2_trans_unlock() firing on transaction restart. Signed-off-by: Kent Overstreet commit b74b147ddabe29a91a00d9f2cefeb6892e6a5a0a Author: Kent Overstreet Date: Tue Jan 11 22:08:44 2022 -0500 bcachefs: Log message improvements Change the error messages in bch2_inconsistent_error() and bch2_fatal_error() so we can distinguish them. Also, prefer bch2_fs_fatal_error() (which also logs an error message) to bch2_fatal_error(), and change a call to bch2_inconsistent_error() to bch2_fatal_error() when we can't continue. Signed-off-by: Kent Overstreet commit 54460a6292b08a8045d8681ac4331dfb9c385017 Author: Kent Overstreet Date: Tue Jan 11 00:19:52 2022 -0500 bcachefs: Delete some dead code __bch2_mark_replicas() is now only used in one place, so inline it into the caller. Signed-off-by: Kent Overstreet commit 0678cbe2cbc586c0055de2c04602bf8136bcc3fc Author: Kent Overstreet Date: Mon Jan 10 19:46:39 2022 -0500 bcachefs: Ignore cached data when calculating fragmentation Previously, bucket fragmentation was considered to be bucket size - total amount of live data, both dirty and cached. This meant that if a bucket was full but only a small amount of data in it was dirty - the rest cached, we'd get stuck: copygc wouldn't move the dirty data out of the bucket and the allocator wouldn't be able to invalidate and drop the cached data. This changes fragmentation to exclude cached data, so that copygc will evacuate these buckets and copygc/the allocator will always be able to make forward progress. Signed-off-by: Kent Overstreet commit 3763cb9566a65966cd404cf3e0c5f218e5cf5d16 Author: Kent Overstreet Date: Sat Dec 25 20:36:47 2021 -0500 bcachefs: Don't use in-memory bucket array for alloc updates More prep work for getting rid of the in-memory bucket array: now that we have BTREE_ITER_WITH_JOURNAL, the allocator code can do ntree lookups before journal replay is finished, and there's no longer any need for it to get allocation information from the in-memory bucket array. Signed-off-by: Kent Overstreet commit 1f5f52bd036ca019d77b2446b8e20981483d1b9d Author: Kent Overstreet Date: Fri Dec 24 00:34:48 2021 -0500 bcachefs: Kill allocator short-circuit invalidate The allocator thread invalidates buckets (increments their generation number) prior to discarding them and putting them on freelists. We've had a short circuit path for some time to only update the in-memory bucket mark when doing the invalidate if we're not invalidating cached data, but that short-circuit path hasn't really been needed for quite some time (likely since the btree key cache code was added). We're deleting it now as part of deleting/converting code that uses the in memory bucket array. Signed-off-by: Kent Overstreet commit 6214485b6f74c098615401ae3cde74f87396a298 Author: Kent Overstreet Date: Sun Jan 9 20:55:58 2022 -0500 bcachefs: BTREE_INSERT_LAZY_RW is only for recovery path BTREE_INSERT_LAZY_RW shouldn't do anything after the filesystem has finished starting up - otherwise, it might interfere with going read-only as part of shutting down. Signed-off-by: Kent Overstreet commit 8ede99101ec354053ac755419df9da5434a13733 Author: Kent Overstreet Date: Sun Jan 9 20:52:10 2022 -0500 bcachefs: Handle transaction restarts in __bch2_move_data() We weren't checking for -EINTR in the main loop in __bch2_move_data - this code predates modern transaction restarts. Signed-off-by: Kent Overstreet commit d5030164ec53ab212f6acaff8938b352c654b67e Author: Kent Overstreet Date: Mon Dec 27 18:25:23 2021 -0500 bcachefs: Simplify bch2_inode_delete_keys() Had a bug report that implies bch2_inode_delete_keys() returned -EINTR before it completed, so this patch simplifies it and makes the flow control a little more conventional. Signed-off-by: Kent Overstreet commit 1f2d9192502917a190ef9bbf7541960d129d30fe Author: Kent Overstreet Date: Sat Jan 8 21:22:31 2022 -0500 bcachefs: iter->update_path With BTREE_ITER_FILTER_SNAPSHOTS, we have to distinguish between the path where the key was found, and the path for inserting into the current snapshot. This adds a new field to struct btree_iter for saving a path for the current snapshot, and plumbs it through bch2_trans_update(). Signed-off-by: Kent Overstreet commit a1e82d35f89793f6347945ab48d799ce1802df87 Author: Kent Overstreet Date: Sun Jan 9 01:07:29 2022 -0500 bcachefs: Refactor bch2_btree_iter() This splits bch2_btree_iter() up into two functions: an inner function that handles BTREE_ITER_WITH_JOURNAL, BTREE_ITER_WITH_UPDATES, and iterating acrcoss leaf nodes, and an outer one that implements BTREE_ITER_FILTER_SNAPHSOTS. This is prep work for remember a btree_path at our update position in BTREE_ITER_FILTER_SNAPSHOTS mode. Signed-off-by: Kent Overstreet commit bc82d08bae53b48ca64e204392f6d336fc9509a9 Author: Kent Overstreet Date: Sat Jan 8 22:59:58 2022 -0500 bcachefs: Tracepoint improvements This improves the transaction restart tracepoints - adding distinct tracepoints for all the locations and reasons a transaction might have been restarted, and ensures that there's a tracepoint for every transaction restart. Signed-off-by: Kent Overstreet commit 7f6ff935f74e8bb3257314f7e31182b6ad96198a Author: Kent Overstreet Date: Wed Dec 29 13:50:50 2021 -0500 bcachefs: New snapshot unit test This still needs to be expanded more, but this adds a basic test for BTREE_ITER_FILTER_SNAPSHOTS. Signed-off-by: Kent Overstreet commit c4ecf802fbfae032730caf40fd74fb27c057a916 Author: Kent Overstreet Date: Sat Jan 8 19:07:32 2022 -0500 bcachefs: Fix an error path in bch2_snapshot_node_create() Signed-off-by: Kent Overstreet commit b674bfadd86aa7f815156f15cc01af95440380f9 Author: Kent Overstreet Date: Sat Jan 8 03:39:54 2022 -0500 bcachefs: Use BTREE_INSERT_USE_RESERVE in btree_update_key() bch2_btree_update_key() is used in the btree node write path - before delivering the completion we have to update the parent pointer with the number of sectors written. Signed-off-by: Kent Overstreet commit 7d782ae447ddbbadf02bb320691ee9cb92f61790 Author: Kent Overstreet Date: Thu Jan 6 01:20:12 2022 -0500 bcachefs: Refactor trigger code This breaks bch2_trans_commit_run_triggers() up into multiple functions, and deletes a bit of duplication - prep work for triggers on alloc keys, which will need to run last. Signed-off-by: Kent Overstreet commit acc3e09b67a350bc9ce6dc9d0d96cc398a850e7c Author: Kent Overstreet Date: Thu Jan 6 21:38:08 2022 -0500 bcachefs: Rename data_op_data_progress -> data_jobs Mild refactoring. Signed-off-by: Kent Overstreet commit a74313481ae24cd301b79b5fca3161079e739a21 Author: Kent Overstreet Date: Thu Jan 6 00:04:56 2022 -0500 bcachefs: Fix check_pos_snapshot_overwritten for !snapshots It shouldn't run if the btree being checked doesn't have snapshots. Signed-off-by: Kent Overstreet commit 21aec962dfec2df11694350e5b2d3a9a9c298e7d Author: Kent Overstreet Date: Tue Jan 4 22:32:09 2022 -0500 bcachefs: New data structure for buckets waiting on journal commit Implement a hash table, using cuckoo hashing, for empty buckets that are waiting on a journal commit before they can be reused. This replaces the journal_seq field of bucket_mark, and is part of eventually getting rid of the in memory bucket array. We may need to make bch2_bucket_needs_journal_commit() lockless, pending profiling and testing. Signed-off-by: Kent Overstreet commit f443fa66c98f012412b677afc4f7096ed24108de Author: Kent Overstreet Date: Sun Feb 13 18:15:35 2022 -0500 bcachefs: Also print out in-memory gen on stale dirty pointer We're trying to track down a bug that shows itself as newly-created extents having stale dirty pointers - possibly due to the in memory gen and the btree gen being inconsistent. This patch changes the error message to also print out the in memory bucket gen when this happens. Signed-off-by: Kent Overstreet commit 8f11548edbccc316939dddf7a52d0aa8151a5ba6 Author: Kent Overstreet Date: Sat Jan 1 23:16:15 2022 -0500 bcachefs: Improve path for when btree_gc needs another pass btree_gc sometimes needs another pass when it corrects bucket generation numbers or data types - when it finds multiple pointers of different data types to the same bucket, it may want to keep the second one it found. When this happens, we now clear out bucket sector counts _without_ resetting the bucket generation/data types that we already found, instead of resetting them to what we have in the alloc btree. Signed-off-by: Kent Overstreet commit 4e08446db05427ad0972eba58d6447b21c1ca7e1 Author: Kent Overstreet Date: Tue Jan 4 18:35:00 2022 -0500 bcachefs: Fix bch2_check_fix_ptrs() The repair for for btree_ptrs was saying one thing and doing another - fortunately, that code can just be deleted. Also, when we update a btree node pointer, we also have to update node in memery, if it exists in the btree node cache - this fixes bch2_check_fix_ptrs() to do that. Signed-off-by: Kent Overstreet commit 9714baaa52d63416d1f7577b630831fc885bfa1f Author: Kent Overstreet Date: Tue Jan 4 19:45:39 2022 -0500 bcachefs: Fix an uninitialized variable Only userspace builds were complaining about it, oddly enough. Signed-off-by: Kent Overstreet commit 9b6e2f1e7036d639ca07434fdb27a739b37beb76 Author: Kent Overstreet Date: Tue Jan 4 19:41:23 2022 -0500 Revert "bcachefs: Delete some obsolete journal_seq_blacklist code" This reverts commit f95b61228efd04c9c158123da5827c96e9773b29. It turns out, we're seeing filesystems in the wild end up with blacklisted btree node bsets - this should not be happening, and until we understand why and fix it we need to keep this code around. Signed-off-by: Kent Overstreet commit 03ea3962ab99adf0cf7de9949716e6baeda230f3 Author: Kent Overstreet Date: Tue Jan 4 19:05:08 2022 -0500 bcachefs: Log & error message improvements - Add a shim uuid_unparse_lower() in the kernel, since %pU doesn't work in userspace - We don't need to print the bcachefs: or the filesystem name prefix in userspace - Improve a few error messages Signed-off-by: Kent Overstreet commit 57cfdd8b54b945fe80191767e36595b46893e5e0 Author: Kent Overstreet Date: Tue Jan 4 18:24:55 2022 -0500 bcachefs: BTREE_ITER_FILTER_SNAPSHOTS is selected automatically It doesn't have to be specified - this patch deletes the two instances where it was. Signed-off-by: Kent Overstreet commit 669f87a5da1c7b91b64f3c6308820b316e241cc2 Author: Kent Overstreet Date: Tue Jan 4 00:33:52 2022 -0500 bcachefs: Switch to __func__for recording where btree_trans was initialized Symbol decoding, via %ps, isn't supported in userspace - this will also be faster when we're using trans->fn in the fast path, as with the new BCH_JSET_ENTRY_log journal messages. Signed-off-by: Kent Overstreet commit 98c80d6df67168035e4e84080959f070e9055bd2 Author: Kent Overstreet Date: Tue Jan 4 00:07:23 2022 -0500 bcachefs: Fix bch2_journal_seq_blacklist_add() The old code correctly handled the case where we were blacklisting a range that exactly matched an existing entry, but not the case where the new range partially overlaps an existing entry. Signed-off-by: Kent Overstreet commit 365f64f36c55b79d8510a5f476b2740a22c682eb Author: Kent Overstreet Date: Tue Jan 4 00:06:49 2022 -0500 bcachefs: Add verbose log messages for journal read Signed-off-by: Kent Overstreet commit efe68e1d65c008dd1f19517378d0ad0688c6a643 Author: Kent Overstreet Date: Mon Jan 3 23:38:50 2022 -0500 bcachefs: Improved superblock-related error messages This patch converts bch2_sb_validate() and the .validate methods for the various superblock sections to take printbuf, to which they can print detailed error messages, including printing the entire section that was invalid. This is a great improvement over the previous situation, where we could only return static strings that didn't have precise information about what was wrong. Signed-off-by: Kent Overstreet commit fe312f81ef62f8aec0c21dabb703baeb4a7533fc Author: Kent Overstreet Date: Mon Jan 3 04:17:02 2022 -0500 bcachefs: Use kvmalloc() for array of sorted keys in journal replay Signed-off-by: Kent Overstreet commit 72492d55cea359c2fce3e372da5c7387b50a21ef Author: Kent Overstreet Date: Mon Jan 3 00:22:29 2022 -0500 bcachefs: Make eytzinger size parameter more conventional Signed-off-by: Kent Overstreet commit 17563164b392b97fedd997cbc972337801ed678f Author: Kent Overstreet Date: Mon Jan 3 00:14:39 2022 -0500 bcachefs: Kill bch2_bset_fix_invalidated_key() Was dead code, so delete it. Signed-off-by: Kent Overstreet commit 6558e61dfe1ec1d54a39cb4604d00efa5bcaaa7e Author: Kent Overstreet Date: Sun Jan 2 22:24:43 2022 -0500 bcachefs: Fix an assertion bch2_trans_commit() can legitimately return -ENOSPC with BTREE_INSERT_NOFAIL set if BTREE_INSERT_NOWAIT was also set. Signed-off-by: Kent Overstreet commit eacb2574f09f5b71acc468d44e7a1633847fd08d Author: Kent Overstreet Date: Sun Jan 2 21:45:35 2022 -0500 bcachefs: bch_dev->dev Add a field to bch_dev for the dev_t of the underlying block device - this fixes a null ptr deref in tracepoints. Signed-off-by: Kent Overstreet commit d8601afca840d36203d0cf2da94ce4f92003956e Author: Kent Overstreet Date: Mon Dec 27 23:10:06 2021 -0500 bcachefs: Simplify journal replay With BTREE_ITER_WITH_JOURNAL, there's no longer any restrictions on the order we have to replay keys from the journal in, and we can also start up journal reclaim right away - and delete a bunch of code. Signed-off-by: Kent Overstreet commit 8e432d98a5011de5b1304fa9c8591588bea59b96 Author: Kent Overstreet Date: Sun Sep 10 23:35:25 2023 -0400 fixup! bcachefs: Factor out __bch2_btree_iter_set_pos() Signed-off-by: Kent Overstreet commit 5222a4607cd8b9d8882e81796917c10193d10be0 Author: Kent Overstreet Date: Sat Dec 25 20:07:00 2021 -0500 bcachefs: BTREE_ITER_WITH_JOURNAL This adds a new btree iterator flag, BTREE_ITER_WITH_JOURNAL, that is automatically enabled when initializing a btree iterator before journal replay has completed - it overlays the contents of the journal with the btree. This lets us delete bch2_btree_and_journal_walk() and just use the normal btree iterator interface instead - which also lets us delete a significant amount of duplicated code. Note that BTREE_ITER_WITH_JOURNAL is still unoptimized in this patch - we're redoing the binary search over keys in the journal every time we call bch2_btree_iter_peek(). Signed-off-by: Kent Overstreet commit f28620c108a9476c7b4b25b8e36b94b6b2b29295 Author: Kent Overstreet Date: Sat Jan 1 20:45:30 2022 -0500 bcachefs: Tweak journal reclaim order Signed-off-by: Kent Overstreet commit cd7c2d3d8d31d4ed3076078457a3df6d9dcaede8 Author: Kent Overstreet Date: Sat Jan 1 19:46:12 2022 -0500 bcachefs: Make sure BCH_FS_FSCK_DONE gets set If we're not running fsck we still want to set BCH_FS_FSCK_DONE, so that bch2_fsck_err() calls are interpreted as bch2_inconsistent_error() calls(). Signed-off-by: Kent Overstreet commit bf15946316757a4fd23c87e51434520bd6a87f64 Author: Kent Overstreet Date: Sat Jan 1 19:04:33 2022 -0500 bcachefs: Improve error messages in superblock write path Signed-off-by: Kent Overstreet commit 2a84de33607d66b57a49581376c850dda5f3d9e4 Author: Kent Overstreet Date: Sat Jan 1 18:27:50 2022 -0500 bcachefs: Log what we're doing when repairing Signed-off-by: Kent Overstreet commit dfd41fb9f24699393a042f9c34bd46496da1174d Author: Kent Overstreet Date: Fri Dec 31 17:54:13 2021 -0500 bcachefs: Fix race between btree updates & journal replay Add a flag to indicate whether a journal replay key has been overwritten, and set/test it with appropriate btree locks held. This fixes a race between the allocator - invalidating buckets, and doing btree updates - and journal replay, which before this patch could clobber the allocator thread's update with an older version of the key from the journal. Signed-off-by: Kent Overstreet commit 528b18e6d1c67ccf4ab01cdee94299f3ac61e1ec Author: Kent Overstreet Date: Fri Dec 31 17:06:29 2021 -0500 bcachefs: bch2_journal_entry_to_text() This adds a _to_text() pretty printer for journal entries - including every subtype - which will shortly be used by the 'bcachefs list_journal' subcommand. Signed-off-by: Kent Overstreet commit fb64f3fdac7171d1b2c62239d512b749dec9582a Author: Kent Overstreet Date: Fri Dec 31 16:12:54 2021 -0500 bcachefs: BCH_JSET_ENTRY_log Add a journal entry type for logging messages, and add an option to use it to log the transaction name - this makes for a very handy debugging tool, as with it we can use the 'bcachefs list_journal' command to see not only what updates were done, but what was doing them. Signed-off-by: Kent Overstreet commit f0f41a6d74f7f682327eead3708473c11577b131 Author: Kent Overstreet Date: Thu Dec 30 20:14:52 2021 -0500 bcachefs: Add error messages for memory allocation failures This adds some missing diagnostics from rare but annoying to debug runtime allocation failure paths. Signed-off-by: Kent Overstreet commit 5ba2fd1145444b354ee4d014e3766f642ac14d6e Author: Kent Overstreet Date: Wed Dec 29 15:55:25 2021 -0500 bcachefs: Journal replay does't resort main list of keys The upcoming BTREE_ITER_WITH_JOURNAL patch will require journal keys to stay in sorted order, so the btree iterator code can overlay them over btree keys. Signed-off-by: Kent Overstreet commit d248ee5637d4cc7952e9e2ad5a6a9099b2d54c48 Author: Kent Overstreet Date: Wed Dec 29 13:49:34 2021 -0500 bcachefs: Add iter_flags arg to bch2_btree_delete_range() Will be used by the new snapshot tests, to pass in BTREE_ITER_ALL_SNAPSHOTS. Signed-off-by: Kent Overstreet commit 200472e91c6c6745e6ddf42d1b33265f84b26e68 Author: Kent Overstreet Date: Mon Dec 27 21:28:50 2021 -0500 bcachefs: Add an error message for copygc spinning Signed-off-by: Kent Overstreet commit 74ef5b0d3f3f8e290686b309ae595559a8963fde Author: Kent Overstreet Date: Wed Dec 29 11:27:47 2021 -0500 bcachefs: Fix keylist size in btree_update This fixes a buffer overrun, fortunately caught by a BUG_ON(). Signed-off-by: Kent Overstreet commit e8536925884144f1966de2628f78c0b2a295d247 Author: Kent Overstreet Date: Tue Dec 28 16:31:57 2021 -0500 bcachefs: Improve error messages in device add path This converts the error messages in the device add to a better style, and adds some missing ones. Signed-off-by: Kent Overstreet commit 042b0f38642f534fe92122c5b5695739390bbe34 Author: Kent Overstreet Date: Tue Dec 28 16:01:25 2021 -0500 bcachefs: bch2_hprint(): don't print decimal if conversion was exact There's places where we parse these numbers, and our parsing doesn't cope with decimals currently - this is a hack to get the device_add path working again where for the device blocksize there doesn't ever need to be a decimal. Signed-off-by: Kent Overstreet commit e3ad29379e47014461d540629628c2cc158c025d Author: Kent Overstreet Date: Mon Dec 27 23:56:13 2021 -0500 bcachefs: Optimize bucket reuse If the btree updates pointing to a bucket were never flushed by the journal before the bucket became empty again, we can reuse the bucket without a journal flush. This tweaks the tracking of journal sequence numbers in alloc keys to implement this optimization: now, we only update the journal sequence number in alloc keys on transitions to and from empty. When a bucket becomes empty, we check if we can tell the journal not to flush entries starting from when the bucket was used. Signed-off-by: Kent Overstreet commit 8d65e475b20610854419fef8dba155200b45a687 Author: Kent Overstreet Date: Sat Feb 12 02:32:11 2022 -0500 bcachefs: Always check for bucket reuse after read Since dirty extents can be moved or overwritten, it's not just cached data that we need the ptr_stale() check in bc2h_read_endio for - this fixes data checksum errors seen in the tiering ktest tests. Signed-off-by: Kent Overstreet commit 5b2e599f506891eec8163c1d90800168a0016d14 Author: Kent Overstreet Date: Mon Dec 27 23:51:48 2021 -0500 bcachefs: bch2_journal_noflush_seq() Add bch2_journal_noflush_seq(), for telling the journal that entries before a given sequence number should not be flushes - to be used by an upcoming allocator optimization. Signed-off-by: Kent Overstreet commit c7ce813fe49a58344ba11219c0bd3a2fdb2e8b9e Author: Kent Overstreet Date: Mon Dec 27 20:45:07 2021 -0500 bcachefs: Add a tracepoint for the btree cache shrinker This is to help with diagnosing why the btree node can doesn't seem to be shrinking - we've had issues in the past with granularity/batch size, since btree nodes are so big. Signed-off-by: Kent Overstreet commit d93cf6858fe67a84e90af76994a2fe4b390c0a0b Author: Kent Overstreet Date: Mon Dec 27 20:05:07 2021 -0500 bcachefs: Run scan_old_btree_nodes after version upgrade In the recovery path, we scan for old btree nodes if we don't have certain compat bits set. If we do this, we should be doing it after we upgraded to the newest on disk format. Signed-off-by: Kent Overstreet commit 862bfd5062a0a512369ae647b94310ee873f95f3 Author: Kent Overstreet Date: Mon Dec 27 19:58:12 2021 -0500 bcachefs: Update sysfs compression_stats for snapshots - BTREE_ITER_ALL_SNAPSHOTS flag is required here - change it to also walk the reflink btree - change it to accumulate stats for all pointers in an extent - change it to account for incompressible data Signed-off-by: Kent Overstreet commit 13f914ecb99b84e6c10cbbeba375e41735239828 Author: Kent Overstreet Date: Sun Dec 26 22:27:10 2021 -0500 bcachefs: Kill bch2_ec_mem_alloc() bch2_ec_mem_alloc() was only used by GC, and there's no real need to preallocate the stripes radix tree since we can cope fine with memory allocation failure when we use the radix tree. This deletes a fair bit of code, and it's also needed for the upcoming patch because bch2_btree_iter_peek_prev() won't be working before journal replay completes (and using it was incorrect previously, as well). Signed-off-by: Kent Overstreet commit 36f035e90804d30dba4336daafe1b89c9a8ffe98 Author: Kent Overstreet Date: Sun Dec 26 21:41:09 2021 -0500 bcachefs: Fix allocator + journal interaction The allocator needs to wait until the last update touching a bucket has been commited before writing to it again. However, the code was checking against the last dirty journal sequence number, not the last flushed journal sequence number. Signed-off-by: Kent Overstreet commit a786087744fcff140ecce0e1dd93a43186edf8ad Author: Kent Overstreet Date: Sat Dec 25 19:55:34 2021 -0500 bcachefs: New in-memory array for bucket gens The main in-memory bucket array is going away, but we'll still need to keep bucket generations in memory, at least for now - ptr_stale() needs to be an efficient operation. Signed-off-by: Kent Overstreet commit 47ac34ec988f01e1e0d00a5281abe0812bad4fcc Author: Kent Overstreet Date: Sat Dec 25 22:37:19 2021 -0500 bcachefs: Separate out gc_bucket() Since the main in memory bucket array is going away, we don't want to be calling bucket() or __bucket() when what we want is the GC in-memory bucket. Signed-off-by: Kent Overstreet commit 9ddffaf83b5ac7cf79917cfe9a1435cc07d071b6 Author: Kent Overstreet Date: Sat Dec 25 21:43:29 2021 -0500 bcachefs: Put open_buckets in a hashtable This is so that the copygc code doesn't have to refer to bucket_mark.owned_by_allocator - assisting in getting rid of the in memory bucket array. Signed-off-by: Kent Overstreet commit abe19d458e8fffbebacaad3aad64604d2819913a Author: Kent Overstreet Date: Sat Dec 25 21:21:46 2021 -0500 bcachefs: Refactor open_bucket code Prep work for adding a hash table of open buckets - instead of embedding a bch_extent_ptr, we need to refer to the bucket directly so that we're not calling sector_to_bucket() in the hash table lookup code, which has an expensive divide. Signed-off-by: Kent Overstreet commit 57af63b286a532f425e425c0684eda6fb5f7c284 Author: Kent Overstreet Date: Sat Dec 25 21:14:49 2021 -0500 bcachefs: bch2_alloc_sectors_append_ptrs() now takes cached flag Signed-off-by: Kent Overstreet commit 04f0f77df2324e5a2c3d60df4acda7cbe464d38e Author: Kent Overstreet Date: Sun Dec 26 16:59:36 2021 -0500 bcachefs: Delete some obsolete journal_seq_blacklist code Since metadata version bcachefs_metadata_version_btree_ptr_sectors_written, we haven't needed the journal seq blacklist mechanism for ignoring blacklisted btree node writes - we now only need it for ignoring journal entries that were written after the newest flush journal entry, and then we only need to keep those blacklist entries around until journal replay is finished. That means we can delete the code for scanning btree nodes to GC journal_seq_blacklist entries. Signed-off-by: Kent Overstreet commit 8511632d44a5846f8edc387e90858ae208715574 Author: Kent Overstreet Date: Mon Dec 20 16:55:49 2021 -0500 bcachefs: Journal initialization fixes This fixes a rare bug when mounting & unmounting RO - flushing a clean filesystem that never went RO should be a no op. Signed-off-by: Kent Overstreet commit ffa7d26244e4100600e595e537f4f144a48ab517 Author: Kent Overstreet Date: Sat Dec 25 20:13:47 2021 -0500 bcachefs: Use BTREE_ITER_NOPRESERVE in bch2_btree_iter_verify_ret() This fixes a transaction path overflow. Signed-off-by: Kent Overstreet commit 4141fde0be05beb529ee6433b9808f815254901b Author: Kent Overstreet Date: Sat Dec 25 18:40:15 2021 -0500 bcachefs: Fix bch2_journal_meta() This patch ensures that the journal entry written gets written as flush entry, which is important for the shutdown path - the last entry written needs to be a flush entry. Signed-off-by: Kent Overstreet commit e75b2d4c1c829142f8e3e64a9b3cf7faedcfb640 Author: Kent Overstreet Date: Thu Dec 23 21:35:28 2021 -0500 bcachefs: bch2_journal_key_insert() no longer transfers ownership bch2_journal_key_insert() used to assume that the key passed to it was allocated with kmalloc(), and on success took ownership. This patch deletes that behaviour, making it more similar to bch2_trans_update()/bch2_trans_commit(). Signed-off-by: Kent Overstreet commit 4b674b09a950fb20aa30e902331e4eba12059b80 Author: Kent Overstreet Date: Fri Dec 24 03:08:06 2021 -0500 bcachefs: Kill ptr_bucket_mark() Only used in one place, we can just delete it. Signed-off-by: Kent Overstreet commit c64740ef27cfe2092e3a56509b3bf44e9b10ae49 Author: Kent Overstreet Date: Thu Dec 30 19:30:42 2021 -0500 bcachefs: Don't start allocator threads too early If the allocator threads start before journal replay has finished replaying alloc keys, journal replay might overwrite the allocator's btree updates. Signed-off-by: Kent Overstreet commit 77170d0dd7020ed72cd748a0c354bf0c0345b6b3 Author: Kent Overstreet Date: Fri Dec 24 04:27:01 2021 -0500 bcachefs: bch2_bucket_alloc_new_fs() no longer depends on bucket marks Now that bch2_bucket_alloc_new_fs() isn't looking at bucket marks to decide what buckets are eligible to allocate, we can clean up the filesystem initialization and device add paths. Previously, we had to use ancient code to mark superblock/journal buckets in the in memory bucket marks as we allocated them, and then zero that out and re-do that marking using the newer transational bucket mark paths. Now, we can simply delete the in-memory bucket marking. Signed-off-by: Kent Overstreet commit 09943313d70fd04eb9475ef9a83c1538234874fe Author: Kent Overstreet Date: Fri Dec 24 04:22:20 2021 -0500 bcachefs: Rewrite bch2_bucket_alloc_new_fs() This changes bch2_bucket_alloc_new_fs() to a simple bump allocator that doesn't need to use the in memory bucket array, part of a larger patch series to entirely get rid of the in memory bucket array, except for gc/fsck. Signed-off-by: Kent Overstreet commit 7243498de74d32d0afe3b923cd893a6b49f70c3c Author: Kent Overstreet Date: Fri Dec 24 02:55:11 2021 -0500 bcachefs: Kill non-lru cache replacement policies Prep work for persistent LRUs and getting rid of the in memory bucket array. Signed-off-by: Kent Overstreet commit 73b460977eb8782a769ff81200a8b40cf1a3a91d Author: Kent Overstreet Date: Wed Dec 22 22:39:50 2021 -0500 bcachefs: Fix a null ptr deref in bch2_inode_delete_keys() Similarly to bch2_btree_delete_range_trans(), bch2_inode_delete_keys() may sometimes split compressed extents, and needs to pass in a disk reservation. Signed-off-by: Kent Overstreet commit e409999069928bc1da79f32e7adff88f981c65a5 Author: Kent Overstreet Date: Tue Dec 14 14:34:03 2021 -0500 bcachefs: Turn encoded_extent_max into a regular option It'll now be handled at format time and in sysfs like other options - it still can only be set at format time, though. Signed-off-by: Kent Overstreet commit 8244f3209b5b49a6bde9921d7825af9f57161b23 Author: Kent Overstreet Date: Tue Dec 14 14:24:41 2021 -0500 bcachefs: Option improvements This adds flags for options that must be a power of two (block size and btree node size), and options that are stored in the superblock as a power of two (encoded extent max). Also: options are now stored in memory in the same units they're displayed in (bytes): we now convert when getting and setting from the superblock. Signed-off-by: Kent Overstreet commit d05117e36a7290cbfa8ebcc05c6facb60a5bcefb Author: Kent Overstreet Date: Tue Dec 21 21:57:10 2021 -0500 bcachefs: Fix debugfs -bfloat-failed It wasn't updated for snapshots - it's iterating across keys in all snapshots, so needs to be specifying BTREE_ITER_ALL_SNAPSHOTS. Signed-off-by: Kent Overstreet commit f3e1f4443383f72975f12caece6f13e63f21a719 Author: Kent Overstreet Date: Tue Dec 21 20:48:26 2021 -0500 bcachefs: BTREE_ITER_NOPRESERVE This adds a flag to not mark the initial btree_path as preserve, for paths that we expect to be cheap to reconstitute if necessary - this solves a btree_path overflow caused by need_whiteout_for_snapshot(). Signed-off-by: Kent Overstreet commit 99fafb0425ea9c68b45699053d6124a3e32d844d Author: Kent Overstreet Date: Mon Dec 20 18:18:35 2021 -0500 bcachefs: Fix some shutdown path bugs This fixes some bugs when we hit an error very early in the filesystem startup path, before most things have been initialized. Signed-off-by: Kent Overstreet commit 1aeed4549de41cabf8e7f52c62646bac7b20a385 Author: Kent Overstreet Date: Sun Dec 19 19:02:50 2021 -0500 bcachefs: Optimize memory accesses in bch2_btree_node_get() This puts a load behind some branches before where it's used, so that it can execute in parallel with other loads. Signed-off-by: Kent Overstreet commit 6be1b6d9df9dfe7065220b64b32de339b1120f1b Author: Kent Overstreet Date: Mon Dec 20 12:53:06 2021 -0500 bcachefs: Make sure bch2_bucket_alloc_new_fs() obeys buckets_nouse This fixes the filesystem migrate tool. Signed-off-by: Kent Overstreet commit 6df893fb1115083765a877302cdc25866ce5a87e Author: Kent Overstreet Date: Tue Dec 14 14:24:04 2021 -0500 bcachefs: Kill some obsolete sysfs code fs internal/alloc_debug doesn't show anything bcachefs fs usage shows. Signed-off-by: Kent Overstreet commit 7a0e4afb1a1116a3580144c7c902e6024333f20e Author: Kent Overstreet Date: Sun Dec 19 19:01:41 2021 -0500 bcachefs: Don't call bch2_bkey_transform() unnecessarily If the packed format isn't changing, there's no need to call bch2_bkey_transform(). Signed-off-by: Kent Overstreet commit 62d5bd955fd81320d1e03fdebb4342ee14df1d1f Author: Kent Overstreet Date: Sun Dec 19 18:59:22 2021 -0500 bcachefs: Kill bch2_sort_repack_merge() The main function of bch2_sort_repack_merge() was to call .key_normalize on every key, which drops stale (cached) pointers - it hasn't actually merged extents in quite some time. But bch2_gc_gens() now works on individual keys - we used to gc old gens by rewriting entire btree nodes. With that gone, there's no need for internal btree code to be calling .key_normalize anymore. Signed-off-by: Kent Overstreet commit b84d42c31f34094c74d6306e11e3a0bc224c7575 Author: Kent Overstreet Date: Thu Dec 16 20:36:26 2021 -0500 bcachefs: Split out CONFIG_BCACHEFS_DEBUG_TRANSACTIONS This puts the btree_transactions sysfs/debugfs file behind a separate config option - it's highly useful, but not cheap enough to enable permenantly. Signed-off-by: Kent Overstreet commit 51c4e406aa5706cdb224ff16eef1d560c504c3ac Author: Kent Overstreet Date: Wed Dec 15 20:35:45 2021 -0500 bcachefs: Fix an assertion in bch2_truncate() We recently added an assertion that when we truncate a file to 0, i_blocks should also go to 0 - but that's not necessarily true if we're doing an emergency shutdown, lots of invariants no longer hold true in that case. Signed-off-by: Kent Overstreet commit 2a863c6c80e3c14eb3920c0d8474ba112c82197a Author: Kent Overstreet Date: Tue Dec 14 16:05:47 2021 -0500 bcachefs: Fix debug build in userspace This fixes some compiler warnings that only trigger in userspace - dead code, a maybe uninitialed variable, a maybe null ptr passed to printk. Signed-off-by: Kent Overstreet commit dbd8b46b90852c0dbaffc48fc1d8b3869b078cf2 Author: Kent Overstreet Date: Tue Dec 14 00:08:06 2021 -0500 bcachefs: Add missing bch2_trans_iter_exit() call This fixes a bug where the filesystem goes read only when reading from debugfs. Signed-off-by: Kent Overstreet commit 20572300dcc537c22b435a1f01b810a9d7c140c9 Author: Kent Overstreet Date: Fri Dec 10 21:24:36 2021 -0500 bcachefs: Improve alloc_mem_to_key() This moves some common code into alloc_mem_to_key(), which translates from the in-memory format for a bucket to the btree key format. Signed-off-by: Kent Overstreet commit fb0e480872ac858d836d5d6d713d0f31ae08c64d Author: Kent Overstreet Date: Fri Dec 10 20:58:44 2021 -0500 bcachefs: bch2_alloc_write() This adds a new helper that much like the one we have for inode updates, that allocates the packed alloc key, packs it and calls bch2_trans_update. Signed-off-by: Kent Overstreet commit 991ba0211290884df42f9506499aba7e933a2bb8 Author: Kent Overstreet Date: Fri Dec 10 15:41:38 2021 -0500 bcachefs: Add more time_stats This adds more latency/event measurements and breaks some apart into more events. Journal writes are broken apart into flush writes and noflush writes, btree compactions are broken out from btree splits, btree mergers are added, as well as btree_interior_updates - foreground and total. Signed-off-by: Kent Overstreet commit f44906775981e368b77474f0c0750e9d1a4f229b Author: Kent Overstreet Date: Fri Dec 10 14:03:42 2021 -0500 bcachefs: Print out OPT_SECTORS options in bytes This matches the conversion the parsing code does. Signed-off-by: Kent Overstreet commit 198141e51cc0dadc5ddf7c7fe5e975c3bb6f546b Author: Kent Overstreet Date: Thu Dec 9 15:21:26 2021 -0500 bcachefs: Fix null ptr deref in fsck_inode_rm() bch2_btree_delete_range() can split compressed extents, thus needs to pass in a disk reservation when we're operating on extents btrees. Signed-off-by: Kent Overstreet commit bf0fdb4d89bf16bbcd3a0a340a10ffde25b13d57 Author: Kent Overstreet Date: Thu Dec 9 14:19:18 2021 -0500 bcachefs: Don't erasure code cached ptrs It doesn't make much sense to be erasure coding cached pointers, we should be erasure coding one of the dirty pointers in an extent. This patch makes sure we're passing BCH_WRITE_CACHED when we expect the new pointer to be a cached pointer, and tweaks the write path to not allocate from a stripe when BCH_WRITE_CACHED is set - and fixes an assertion we were hitting in the ec path where when adding the stripe to an extent and deleting the other pointers the pointer to the stripe didn't exist (because dropping all dirty pointers from an extent turns it into a KEY_TYPE_error key). Signed-off-by: Kent Overstreet commit 990d42d1873c16b6080c887f6bb27e56c0f885cf Author: Kent Overstreet Date: Sat Dec 4 23:07:33 2021 -0500 bcachefs: Split out struct gc_stripe from struct stripe We have two radix trees of stripes - one that mirrors some information from the stripes btree in normal operation, and another that GC uses to recalculate block usage counts. The normal one is now only used for finding partially empty stripes in order to reuse them - the normal stripes radix tree and the GC stripes radix tree are used significantly differently, so this patch splits them into separate types. In an upcoming patch we'll be replacing c->stripes with a btree that indexes stripes by the order we want to reuse them. Signed-off-by: Kent Overstreet commit f54788cc8c79cad2ac8016d1c4a8a1373a4d7707 Author: Kent Overstreet Date: Wed Dec 8 13:31:36 2021 -0500 bcachefs: Convert a BUG_ON() to a warning A user reported hitting this assertion, and we can't reproduce it yet, but it shouldn't be fatal - so convert it to a warning. Signed-off-by: Kent Overstreet commit 94a3e1a6c1bd441b58972ee0216593fc0b09ee75 Author: Kent Overstreet Date: Sun Dec 5 00:30:49 2021 -0500 bcachefs: bch2_trans_update() is now __must_check With snapshots, bch2_trans_update() has to check if we need a whitout, which can cause a transaction restart, so this is important now. Signed-off-by: Kent Overstreet commit 1d81313f22205bfd844bd2e13e7e3ea5d50cd673 Author: Kent Overstreet Date: Sat Dec 4 22:03:07 2021 -0500 bcachefs: Make __bch2_journal_debug_to_text() more readable Switch to one line of output per pr_buf() call - longer lines but quite a bit more readable. Signed-off-by: Kent Overstreet commit 506717865bd68997dd0490409fd51a9f68915cf2 Author: Kent Overstreet Date: Sat Dec 4 21:53:13 2021 -0500 bcachefs: Specify filesystem options We've got three types of options now - filesystem, device and inode, and a given option may belong to more than one of those types. This patch changes the options to specify explicitly when they're a filesystem option - in the future we'll probably be adding more device options. Signed-off-by: Kent Overstreet commit 47b15c5760d5eec6c69f207eda7f779c2170e285 Author: Kent Overstreet Date: Sat Dec 4 21:52:09 2021 -0500 bcachefs: Fix copygc sectors_to_move calculation With erasure coding, copygc's count of sectors to move was off, which matters for the debug statement it prints out when it's not able to move all the data it tried to. Signed-off-by: Kent Overstreet commit 2430e72f42778a9448ff386686856b61b49f5074 Author: Kent Overstreet Date: Sat Dec 4 20:07:19 2021 -0500 bcachefs: Convert journal sysfs params to regular options This converts journal_write_delay, journal_flush_disabled, and journal_reclaim_delay to normal filesystems options, and also adds them to the superblock. Signed-off-by: Kent Overstreet commit 92d2ec10926d2ba8c38ba0ecada69cfd7a4dd3c4 Author: Kent Overstreet Date: Wed Dec 1 03:47:54 2021 -0500 bcachefs: Fix btree_path leaks in bch2_trans_update() bch2_trans_update() had some dodgy gets() and puts() - this fixes a few leaks. Signed-off-by: Kent Overstreet commit b547d005d54209dc3a14ffd7924c73e32ba2e3a2 Author: Kent Overstreet Date: Mon Nov 29 16:38:27 2021 -0500 bcachefs: Erasure coding fixes When we added the stripe and stripe_redundancy fields to alloc keys, we neglected to add them to the functions that convert back and forth with the in-memory types. Signed-off-by: Kent Overstreet commit 181fe42a75c60ecf37509f6c39162115cc66216b Author: Kent Overstreet Date: Sun Nov 28 15:13:54 2021 -0500 bcachefs: Handle replica marking fsck errors locally This simplifies the code quite a bit and eliminates an inconsistency - a given bkey doesn't necessarily translate to a single replicas entry for disk space accounting. Signed-off-by: Kent Overstreet commit 58e1ea4bcb057388636b0098524d6e0647eb40c2 Author: Kent Overstreet Date: Sun Nov 28 14:31:19 2021 -0500 bcachefs: Push c->mark_lock usage down to where it is needed This changes the bch2_mark_key() and related paths to take mark lock where it is needed, instead of taking it in the upper transaction commit path - by pushing down locking we'll be able to handle fsck errors locally instead of requiring a separate check in the btree_gc code for replicas being marked. Signed-off-by: Kent Overstreet commit 502cfb3591ec1f3d133c7eb281b8b93ca2bb2768 Author: Kent Overstreet Date: Sun Nov 28 14:08:58 2021 -0500 bcachefs: Kill bch2_replicas_delta_list_marked() This changes bch2_trans_fs_usage_apply() to handle failure (replicas entry missing) by reverting the changes it made - meaning we can make the main transaction commit path a bit slimmer, and perhaps also simplify some locking in upcoming patches. Signed-off-by: Kent Overstreet commit f449bedb068447d3e9b1d64a41852b2aaca36fda Author: Kent Overstreet Date: Mon Nov 29 16:36:50 2021 -0500 bcachefs: Fix reflink path for snapshots make_extent_indirect() was missing the BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE - it's updating the extent in the original snapshot, not the curret one. Signed-off-by: Kent Overstreet commit fc6c01e2ea5292a740ddedb5b2b3805e8ecb3f4b Author: Kent Overstreet Date: Sun Nov 28 13:42:05 2021 -0500 bcachefs: Convert bucket_alloc_ret to negative error codes Start a new header, errcode.h, for bcachefs-private error codes - more error codes will be converted later. This patch just converts bucket_alloc_ret so that they can be mixed with standard error codes and passed as ERR_PTR errors - the ec.c code was doing this already, but incorrectly. Signed-off-by: Kent Overstreet commit dcfc593f7b3a35e340f0cefa3281a3285ddb48e8 Author: Kent Overstreet Date: Tue Nov 23 18:21:09 2021 -0500 bcachefs: Fix page state after fallocate This tweaks the fallocate code to also update the page cache to reflect the new on disk reservations, giving us better i_sectors consistency. Signed-off-by: Kent Overstreet commit e6ec361f95fcbaffab65221cd4a56e0e10fdafc2 Author: Kent Overstreet Date: Tue Nov 23 18:17:04 2021 -0500 bcachefs: Fix page state when reading into !PageUptodate pages This patch adds code to read page state before writing to pages that aren't uptodate, which corrects i_sectors being tempororarily too large and means we may not need to get a disk reservation. Signed-off-by: Kent Overstreet # Conflicts: # fs/bcachefs/fs-io.c commit 7279c1a24c3dd523b5824aaf24cee9e2a55c76f0 Author: Kent Overstreet Date: Tue Nov 23 20:00:34 2021 -0500 bcachefs: Kill PAGE_SECTOR_SHIFT Replace it with the new, standard PAGE_SECTORS_SHIFT Signed-off-by: Kent Overstreet commit 084d42bbd67c5b2de607f56a94c7295459b16b61 Author: Kent Overstreet Date: Tue Nov 23 19:00:23 2021 -0500 bcachefs: Apply workaround for too many btree iters to read path Reading from cached data, which calls bch2_bucket_io_time_reset(), is leading to transaction iterator overflows - this standardizes the workaround. Signed-off-by: Kent Overstreet commit 9ca4853b98af5fa15a2ddc47a45f8e103027f95d Author: Kent Overstreet Date: Wed Oct 27 13:05:56 2021 -0400 bcachefs: Fix quota support for snapshots Quota support was disabled when snapshots were released, because of some tricky interactions with snpashots. We're sidestepping that for now - we're simply disabling quota accounting on snapshot subvolumes. Signed-off-by: Kent Overstreet commit b44a66a64123efb3e6aebaa0cedec722ecbfbba4 Author: Kent Overstreet Date: Tue Nov 23 17:05:56 2021 -0500 bcachefs: SECTOR_DIRTY_RESERVED This fixes another i_sectors accounting bug - we need to differentiate between dirty writes that overwrite a reservation and dirty writes to unallocated space - dirty writes to unallocated space increase i_sectors, dirty writes over a reservation do not. Signed-off-by: Kent Overstreet commit b19d307dc11586df2e2b7430c0ccbfa439bf7a0b Author: Kent Overstreet Date: Mon Nov 22 12:47:20 2021 -0500 bcachefs: Fix i_sectors_leak in bch2_truncate_page When bch2_truncate_page() discards dirty sectors in the page cache, we need to account for that - we don't need to account for allocated sectors because that'll be done by the bch2_fpunch() call when it updates the btree. Signed-off-by: Kent Overstreet commit 8810386f6bd55cf3287a1219901c2993b3bac959 Author: Kent Overstreet Date: Sun Nov 21 22:34:26 2021 -0500 bcachefs: Fix an i_sectors accounting bug We weren't checking for errors before calling i_sectors_acct() Signed-off-by: Kent Overstreet commit 7468c4effc8c93464ec0fd4336494312bebb8033 Author: Kent Overstreet Date: Sun Nov 21 16:15:48 2021 -0500 bcachefs: Fix BCH_FS_ERROR flag handling We were setting BCH_FS_ERROR on startup if the superblock was marked as containing errors, which is not what we wanted - BCH_FS_ERROR indicates whether errors have been found, so that after a successful fsck we're able to clear the error bit in the superblock. Signed-off-by: Kent Overstreet commit e5464a371d048865cd4fcba48879c4b37727df2e Author: Kent Overstreet Date: Sat Nov 20 22:59:25 2021 -0500 bcachefs: Add a bit of missing repair code This adds repair code to drop very stale pointers. Signed-off-by: Kent Overstreet commit 9be1efe9c57e3eed5fc569caee47d0ddc96530db Author: Kent Overstreet Date: Mon Nov 15 17:30:11 2021 -0500 bcachefs: Fix error reporting from bch2_journal_flush_seq - bch2_journal_halt() was unconditionally overwriting j->err_seq, the sequence number that we failed to write - journal_write_done was updating seq_ondisk and flushed_seq_ondisk even for writes that errored, which broke the way bch2_journal_flush_seq_async() locklessly checked for completions. Signed-off-by: Kent Overstreet commit f0c3f88b35e1fac6e3b7cec5635e43d4e595cf7a Author: Kent Overstreet Date: Wed Oct 27 12:51:12 2021 -0400 bcachefs: Run insert triggers before overwrite triggers Currently, btree triggers are run in natural key order, which presents a problem for fallocate in INSERT_RANGE mode: since we're moving existing extents to higher offsets, the trigger for deleting the old extent runs before the trigger that adds the new extent, potentially leading to indirect extents being deleted that shouldn't be when the delete causes the refcount to hit 0. This changes the order we run triggers so that for a givin btree, we run all insert triggers before overwrite triggers, nicely sidestepping this issue. Signed-off-by: Kent Overstreet commit c714614bd06cc422f56c02475adf03dc618bf385 Author: Kent Overstreet Date: Mon Nov 15 15:02:13 2021 -0500 bcachefs: Disk space accounting fix on brand-new fs The filesystem initialization path first marks superblock and journal buckets non transactionally, since the btree isn't functional yet. That path was updating the per-journal-buf percpu counters via bch2_dev_usage_update(), and updating the wrong set of counters so those updates didn't get written out until journal entry 4. The relevant code is going to get significantly rewritten in the future as we transition away from the in memory bucket array, so this just hacks around it for now. Signed-off-by: Kent Overstreet commit 0a84a066f9a1455ce703850ac5918270d7a4019d Author: Kent Overstreet Date: Mon Nov 15 15:03:06 2021 -0500 bcachefs: Also log device name in userspace Change log messages in userspace to be closer to what they are in kernel space, and include the device name - it's also useful in userspace. Signed-off-by: Kent Overstreet commit 85e95ca7cc48c23f772387b069d794f69116192b Author: Kent Overstreet Date: Sat Nov 13 19:49:14 2021 -0500 bcachefs: Update export_operations for snapshots When support for snapshots was merged, export operations weren't updated yet. This patch adds new filehandle types for bcachefs that include the subvolume ID and updates export operations for subvolumes - and also .get_parent, support for which was added just prior to snapshots. Signed-off-by: Kent Overstreet commit 697e546fb38fb8c3e274c1561aaaab18178809a5 Author: Kent Overstreet Date: Tue Oct 26 17:35:58 2021 -0400 bcachefs: Refactor journal replay code This consolidates duplicated code in journal replay - it's only a few flags that are different for replaying alloc keys. Signed-off-by: Kent Overstreet commit 1c9e6d50e28c89d03bebfe3e3946746dc1eeab74 Author: Kent Overstreet Date: Sat Nov 13 17:57:52 2021 -0500 bcachefs: Fix missing field initialization When unpacking v1 inodes, we were failing to initialize the journal_seq field, leading to a BUG_ON() when fsync tries to flush a garbage journal sequence number. Signed-off-by: Kent Overstreet commit 531b69e9afed954156b193264daf32c067454952 Author: Kent Overstreet Date: Sat Nov 13 17:53:55 2021 -0500 bcachefs: Convert journal BUG_ON() to a warning It's definitely indicative of a bug if we request to flush a journal sequence number that hasn't happened yet, but it's more useful if we warn and print out the relevant sequence numbers instead of just dying. Signed-off-by: Kent Overstreet commit 61d876c25d65c6732f1db1e7611a158fc2c55be3 Author: Kent Overstreet Date: Sat Nov 13 17:44:13 2021 -0500 bcachefs: Improve bch2_reflink_p_to_text() .to_text methods generally ought to print all the value fields. Signed-off-by: Kent Overstreet commit 6404dcc9c246c1b71ace52c1a942c675c89c4ffe Author: Kent Overstreet Date: Thu Nov 11 12:11:33 2021 -0500 bcachefs: More enum strings This patch converts more enums in the on disk format to our standard x-macro-with-strings deal - to enable better pretty-printing. Signed-off-by: Kent Overstreet commit e3f2db39b39b69538db5bfbd9e359e99dcf1c986 Author: Kent Overstreet Date: Sat Nov 13 13:36:26 2021 -0500 bcachefs: Tweak vfs cache shrinker behaviour In bcachefs, inodes and dentries are also cached - more compactly - by the btree node cache, they don't require seeks to recreate. Signed-off-by: Kent Overstreet commit 496b7238794ac9209c68fba3592b59576140fa55 Author: Kent Overstreet Date: Sat Nov 13 12:57:00 2021 -0500 bcachefs: Fix an exiting of uninitialized iterator bch2_dirent_lookup had an error path where we'd exit a btree_iter that hadn't been properly initialized. Signed-off-by: Kent Overstreet commit 54b2db3d58eadb4496a671d43b1e7c0506dd0220 Author: Kent Overstreet Date: Thu Nov 11 15:50:22 2021 -0500 bcachefs: Fix infinite loop in bch2_btree_cache_scan() When attempting to free btree nodes, we might not be able to free all the nodes that were requested. But the code was looping until it had freed _all_ the nodes requested, when it should have only been attempting to free nr nodes. Signed-off-by: Kent Overstreet commit f74a5051b0e58a8f4fab26a2fc65b95ee17df7a0 Author: Kent Overstreet Date: Thu Nov 11 13:02:03 2021 -0500 bcachefs: Don't check for -ENOSPC in page writeback If at all possible we'd prefer to not fail page writeback unless the filesystem has been shutdown; allowing errors in page writeback means things we'd like to assert about i_size consistency between the VFS and the btree go out the window. Signed-off-by: Kent Overstreet commit 770e821485e0021ea325f7aa2133fddb46ba0821 Author: Kent Overstreet Date: Tue Nov 9 17:20:06 2021 -0500 bcachefs: Inode updates should generally be BTREE_INSERT_NOFAIL This fixes a bug where i_size may become inconsistent between the VFS cache and the btree, when the filesystem is nearly full. Signed-off-by: Kent Overstreet commit 74163da7c81ac5bb4ecd625f9e41a241ec5d8758 Author: Kent Overstreet Date: Sat Nov 6 13:39:42 2021 -0400 bcachefs: Fallocate fixes - fpunch wasn't always correctly updating i_size - when we drop buffered writes that were extending a file, we become responsible for writing i_size. - fzero was sometimes zeroing out more data that it should have - block_start and block_end were being rounded in the wrong directions Signed-off-by: Kent Overstreet commit 0397a2e8e1778ce5c8fe893e0b0377d11d57cc5f Author: Kent Overstreet Date: Sun Nov 7 12:10:57 2021 -0500 bcachefs: Refactor bch2_fpunch_at() This cleans up the error hanlding and flow control a bit. Signed-off-by: Kent Overstreet commit 32b26e8c7f6418b2d8bd404c7482c44141ba52e5 Author: Kent Overstreet Date: Sat Nov 6 00:03:40 2021 -0400 bcachefs: bch2_assert_pos_locked() This adds a new assertion to be used by bch2_inode_update_after_write(), which updates the VFS inode based on the update to the btree inode we just did - we require that the btree inode still be locked when we do that update. Signed-off-by: Kent Overstreet commit 9a74f63c97a5c8fcfd0469a87afb0aa95f55f806 Author: Kent Overstreet Date: Sun Nov 7 10:19:37 2021 -0500 bcachefs: path->should_be_locked fixes - We should only be clearing should_be_locked in btree_path_set_pos() - it's the responsiblity of the btree_path code, not the btree_iter code. - bch2_path_put() needs to pay attention to path->should_be_locked, to ensure we don't drop locks we're supposed to be keeping. Signed-off-by: Kent Overstreet commit e2b605601ad56904c700569a11fc73db7ecc7acd Author: Kent Overstreet Date: Fri Nov 5 21:28:17 2021 -0400 bcachefs: Clean up error reporting in the startup path It used to be that error reporting in the startup path was done by returning strings describing the error, but that turned out to be a rather silly idea - if there's something we can describe about the error, just print it right away. This converts a good chunk of code to returning error codes, as is more typical style. Signed-off-by: Kent Overstreet commit 7be9ab637fb9c5283c5d1b3f41d81bc2c01ad548 Author: Chris Webb Date: Thu Nov 4 21:03:16 2021 +0000 bcachefs: Return -ENOKEY/EINVAL when mount decryption fails bch2_fs_encryption_init() correctly passes back -ENOKEY from request_key() when no unlock key is found, or -EINVAL if superblock decryption fails because of an invalid key. However, these get absorbed into a generic NULL return from bch2_fs_alloc() and later returned to user space as -ENOMEM, leading to a misleading error from mount(1): mount(2) system call failed: Out of memory. Return explicit error pointers out of bch2_fs_alloc() and handle them in both callers, so the user instead sees mount(2) system call failed: Required key not available. when attempting to mount a filesystem which is still locked. Signed-off-by: Chris Webb Signed-off-by: Kent Overstreet commit 076c783cd31f0d46782f9365fd79725d1248712d Author: Kent Overstreet Date: Sat Nov 6 00:05:12 2021 -0400 bcachefs: Fix upgrade path for reflink_p fix Signed-off-by: Kent Overstreet commit 68a2054d88f7cd2866806148d9a2e4389eb46992 Author: Kent Overstreet Date: Fri Nov 5 15:17:13 2021 -0400 bcachefs: Switch fsync to use bi_journal_seq Now that we're recording in each inode the journal sequence number of the most recent update, fsync becomes a lot simpler and we can delete all the plumbing for ei_journal_seq. Signed-off-by: Kent Overstreet commit e15a57ac05a9384d81f340ff870633dde62e5d5d Author: Kent Overstreet Date: Thu Nov 4 11:44:13 2021 -0400 bcachefs: Kill bucket quantiles sysfs code We're getting rid of code that uses the in memory bucket array - and we now have better mechanisms for viewing most of what the bucket quantiles code gave us (especially internal fragmentation). Signed-off-by: Kent Overstreet commit 0e030f5e2014bf9a33e977820cf64fce4258cf1d Author: Kent Overstreet Date: Wed Nov 3 22:33:32 2021 -0400 bcachefs: Kill journal buf bloom filter This was used for recording which inodes have been modified by in flight journal writes, but was broken and has been superceded. Signed-off-by: Kent Overstreet commit 3e52c22255143bb86860abf26ef29a077ac30314 Author: Kent Overstreet Date: Fri Oct 29 21:14:23 2021 -0400 bcachefs: Add journal_seq to inode & alloc keys Add fields to inode & alloc keys that record the journal sequence number when they were most recently modified. For alloc keys, this is needed to know what journal sequence number we have to flush before the bucket can be reused. Currently this is tracked in memory, but we'll be getting rid of the in memory bucket array. For inodes, this is needed for fsync when the inode has been evicted from the vfs cache. Currently we use a bloom filter per outstanding journal buf - but that mechanism has been broken since we added the ability to not issue a flush/fua for every journal write. Signed-off-by: Kent Overstreet commit 1db84979c7b640c15abae8a013485546bcca3623 Author: Kent Overstreet Date: Wed Nov 3 22:35:34 2021 -0400 bcachefs: Update inode on every write This is going to be a performance regression until we get the btree key cache re-enabled - but it's needed for fixing fsync. Upcoming patches will record the journal_seq an inode was updated at in the inode itself. Signed-off-by: Kent Overstreet commit 34d74830b25c7d0b4f6affda90225e4849296255 Author: Kent Overstreet Date: Sat Dec 31 00:15:23 2022 -0500 bcachefs: BTREE_UPDATE_NOJOURNAL We're going to have btree updates that don't need to be journalled; add a flag for that. Signed-off-by: Kent Overstreet commit c27314b448d3ef1aa44a82d77ff1e1eec0c5a682 Author: Kent Overstreet Date: Wed Nov 3 21:22:46 2021 -0400 bcachefs: Fix __remove_dirent() __lookup_inode() doesn't work for what __remove_dirent() wants - it just wants the first inode at a given inode number, they all have the same hash info. Signed-off-by: Kent Overstreet commit 47f80bbf38df59e41c98fd1f9681cf63af82a5fd Author: Kent Overstreet Date: Wed Nov 3 20:25:35 2021 -0400 bcachefs: Fix check_inodes() We were starting at the wrong btree position, and thus not actually checking any inodes - oops. Also, make check_key_has_snapshot() a mustfix fsck error, since later fsck code assumes that all keys have valid snapshot IDs. Signed-off-by: Kent Overstreet commit d647db314adb8b5b60224a7604566746e7203c22 Author: Kent Overstreet Date: Wed Nov 3 17:23:49 2021 -0400 bcachefs: Improve error message in bch2_write_super() It's helpful to know what the superblock write is for. Signed-off-by: Kent Overstreet commit 85eb2bae7fd18f424b28c3f873d106c95e6b9733 Author: Kent Overstreet Date: Wed Nov 3 17:23:03 2021 -0400 bcachefs: Fix trans_lock_write() On failure to get a write lock (because we had a conflicting read lock), we need to make sure to upgrade the read lock to an intent lock - or we could end up spinning. Signed-off-by: Kent Overstreet commit f527afea5a2f3c2645080584dafeb6cc5314b652 Author: Kent Overstreet Date: Wed Nov 3 12:08:02 2021 -0400 bcachefs: Fix upgrade_readers() The bch2_btree_path_upgrade() call was failing and tripping an assert - path->level + 1 is in this case not necessarily exactly what we want, fix it by upgrading exactly the locks we want. Signed-off-by: Kent Overstreet commit d7407292723ea79028afe6729432602ced243972 Author: Kent Overstreet Date: Sat Oct 30 05:28:27 2021 -0400 bcachefs: Fix faulty assertion Signed-off-by: Kent Overstreet commit 2debb1b875c140c7a5490d5eb9e88b3c51f375e2 Author: Kent Overstreet Date: Fri Oct 29 18:58:50 2021 -0400 bcachefs: BTREE_TRIGGER_INSERT now only means insert This allows triggers to distinguish between a key entering the btree - i.e. being called from the trans commit path - vs. being called on a key that already exists, i.e. by GC. Signed-off-by: Kent Overstreet commit 904823de497fa6637db8bc7c3b017f121b72bdf3 Author: Kent Overstreet Date: Fri Oct 29 18:43:18 2021 -0400 bcachefs: Convert bch2_mark_key() to take a btree_trans * This helps to unify the interface between bch2_mark_key() and bch2_trans_mark_key() - and it also gives access to the journal reservation and journal seq in the mark_key path. Signed-off-by: Kent Overstreet commit 961b2d62821f23f9f963ee069b64eb8806f05e40 Author: Kent Overstreet Date: Fri Oct 29 16:29:13 2021 -0400 bcachefs: Assorted ec fixes - The backpointer that ec_stripe_update_ptrs() uses now needs to include the snapshot ID, which means we have to change where we add the backpointer to after getting the snapshot ID for the new extents - ec_stripe_update_ptrs() needs to be calling bch2_trans_begin() - improve error message in bch2_mark_stripe() Signed-off-by: Kent Overstreet commit 37f72492f401671f1f773cc62dddf742e7fc553b Author: Kent Overstreet Date: Fri Oct 29 18:21:05 2021 -0400 bcachefs: Fix bch2_mark_update() When the old or new key doesn't exist, we should still pass in a deleted key with the correct pos. This fixes a bug in the ec code, when bch2_mark_stripe() was looking up the wrong in-memory stripe. Signed-off-by: Kent Overstreet commit fae1157d184084f1716a10273423f8e949d8471f Author: Kent Overstreet Date: Thu Oct 28 18:22:25 2021 -0400 bcachefs: Ensure journal doesn't get stuck in nochanges mode This tweaks the journal code to always act as if there's space available in nochanges mode, when we're not going to be doing any writes. This helps in recovering filesystems that won't mount because they need journal replay and the journal has gotten stuck. Signed-off-by: Kent Overstreet commit 285b181ad460bb240041a9ca7935f9e884040405 Author: Kent Overstreet Date: Thu Oct 28 16:16:55 2021 -0400 bcachefs: Improve transaction restart handling in fsck code The fsck code has been handling transaction restarts locally, to avoid calling fsck_err() multiple times (and asking the user/logging the error multiple times) on transaction restart. However, with our improving assertions about iterator validity, this isn't working anymore - the code wasn't entirely correct, in ways that are fine for now but are going to matter once we start wanting online fsck. This code converts much of the fsck code to handle transaction restarts in a more rigorously correct way - moving restart handling up to the top level of check_dirent, check_xattr and others - at the cost of logging errors multiple times on transaction restart. Fixing the issues with logging errors multiple times is probably going to require memoizing calls to fsck_err() - we'll leave that for future improvements. Signed-off-by: Kent Overstreet commit 6caf05785060b2522f577b000849bbc172efb135 Author: Kent Overstreet Date: Thu Oct 28 16:34:17 2021 -0400 bcachefs: Fix bch2_btree_iter_advance() Was popping an assertion on !BTREE_ITER_ALL_SNAPSHOTS iters when getting to the end. Signed-off-by: Kent Overstreet commit 41f9b7d39fb11c9f306809681bb6991ac96f9b2e Author: Kent Overstreet Date: Thu Oct 28 16:24:39 2021 -0400 bcachefs: Move bch2_evict_subvolume_inodes() to fs.c This fixes building in userspace - code that's coupled to the kernel VFS interface should live in fs.c Signed-off-by: Kent Overstreet commit 8325cd1ed480633651edd33fbb5f3be16c4afa47 Author: Kent Overstreet Date: Wed Oct 27 17:53:20 2021 -0400 bcachefs: Don't do upgrades in nochanges mode nochanges mode is often used for getting data off of otherwise nonrecoverable filesystems, which is often because of errors hit during fsck. Don't force version upgrade & fsck in nochanges mode, so that it's more likely to mount. Signed-off-by: Kent Overstreet commit f124345e2bed01f852a77776aaed1d106cabafbe Author: Kent Overstreet Date: Tue Oct 26 16:03:28 2021 -0400 bcachefs: Drop bch2_journal_meta() call when going RW Back when we relied on the journal sequence number blacklist machinery for consistency between btree and the journal, we needed to ensure a new journal entry was written before any btree writes were done. But, this had the side effect of consuming some space in the journal prior to doing journal replay - which could lead to a very wedged filesystem, since we don't yet have a way to grow the journal prior to going RW. Fortunately, the journal sequence number blacklist machinery isn't needed anymore, as btree node pointers now record the numer of sectors currently written to that node - that code should all be ripped out. Signed-off-by: Kent Overstreet commit 2027875bd8318171159495c948461eae2f84936d Author: Kent Overstreet Date: Mon Oct 11 12:03:19 2021 -0400 bcachefs: Add BCH_SUBVOLUME_UNLINKED Snapshot deletion needs to become a multi step process, where we unlink, then tear down the page cache, then delete the subvolume - the deleting flag is equivalent to an inode with i_nlink = 0. Signed-off-by: Kent Overstreet commit f3b1e1937973624d3bc5f3ba0824e228ae256b88 Author: Kent Overstreet Date: Tue Oct 26 14:07:43 2021 -0400 bcachefs: Improve error messages in trans_mark_reflink_p() We should always print out the key we were marking. Signed-off-by: Kent Overstreet commit 6b3d8b8992e59d3a145f67173a0d75fa25e6e750 Author: Kent Overstreet Date: Mon Oct 25 19:30:24 2021 -0400 bcachefs: Don't run triggers in fix_reflink_p_key() It seems some users have reflink pointers which span many indirect extents, from a short window in time when merging of reflink pointers was allowed. Now, we're seeing transaction path overflows in fix_reflink_p(), the code path to clear out the reflink_p fields now used for front/back pad - but, we don't actually need to be running triggers in that path, which is an easy partial fix. Signed-off-by: Kent Overstreet commit d121172561d670c8152559614b3575322d709d8d Author: Kent Overstreet Date: Mon Oct 25 18:30:28 2021 -0400 bcachefs: More general fix for transaction paths overflow for_each_btree_key() now calls bch2_trans_begin() as needed; that means, we can also call it when we're in danger of overflowing transaction paths. Signed-off-by: Kent Overstreet commit 396a887d8fdf37d9e3e9a5b2db823184f8ec2eaa Author: Kent Overstreet Date: Thu Oct 21 15:48:05 2021 -0400 bcachefs: Fix fsck path for refink pointers The way __bch2_mark_reflink_p returns errors was clashing with returning the number of sectors processed - we weren't returning FSCK_ERR_EXIT correctly. Fix this by only using the return code for errors, which actually ends up simplifying the overall logic. Signed-off-by: Kent Overstreet commit 23af498cc44bc7615f3f208f39daab637bcac023 Author: Kent Overstreet Date: Sun Oct 24 17:00:33 2021 -0400 bcachefs: Ensure we flush btree updates in evacuate path This fixes a possible race where we fail to remove a device because of btree nodes still on it, that are being deleted by in flight btree updates. Signed-off-by: Kent Overstreet commit f3cf0999ac1c70676ba2b4d3db7b6f02f213a2d7 Author: Kent Overstreet Date: Sun Oct 24 16:59:33 2021 -0400 bcachefs: bch2_btree_node_rewrite() now returns transaction restarts We have been getting away from handling transaction restarts locally - convert bch2_btree_node_rewrite() to the newer style. Signed-off-by: Kent Overstreet commit 979735df980972dc9ffdaca8a5171664ac658248 Author: Kent Overstreet Date: Sun Oct 24 16:55:17 2021 -0400 bcachefs: Fix bch2_btree_iter_next_node() We were modifying state, then return -EINTR, causing us to skip nodes - ouch. Signed-off-by: Kent Overstreet commit b0d1b70af85718a58e4edd796251a3600a20b6d5 Author: Kent Overstreet Date: Sun Oct 24 16:40:05 2021 -0400 bcachefs: Must check for errors from bch2_trans_cond_resched() But we don't need to call it from outside the btree iterator code anymore, since it's called by bch2_trans_begin() and bch2_btree_path_traverse(). Signed-off-by: Kent Overstreet commit 114eea75c73dfd95ae529eb841aad0330793f446 Author: Kent Overstreet Date: Sun Oct 24 11:57:47 2021 -0400 bcachefs: Fix dev accounting after device add This is a hacky but effective fix to device usage stats for superblock and journal being wrong on a newly added device (following the comment that already told us how it needed to be done!) Reported-by: Chris Webb Signed-off-by: Kent Overstreet commit ab44d7bdeebe316a03f37c08c1f66c13ea9aa5d5 Author: Kent Overstreet Date: Fri Oct 22 17:33:38 2021 -0400 bcachefs: Fix a transaction path overflow readdir() in a directory with many subvolumes could overflow transaction paths - this is a simple hack around the issue. Signed-off-by: Kent Overstreet commit de924abbe7a62bdeb6baaba0f2fe2d1c64ef888b Author: Kent Overstreet Date: Thu Oct 21 14:33:31 2021 -0400 bcachefs: Fix error handling in bch2_trans_extent_merging The back merging case wasn't returning errors correctly. Signed-off-by: Kent Overstreet commit 4db650277d42c0c80cde8fa3571ff1fb2fded8d9 Author: Kent Overstreet Date: Tue Oct 12 12:06:02 2021 -0400 bcachefs: Subvol dirents are now only visible in parent subvol This changes the on disk format for dirents that point to subvols so that they also record the subvolid of the parent subvol, so that we can filter them out in other subvolumes. This also updates the dirent code to do that filtering, and in particular tweaks the rename code - we need to ensure that there's only ever one dirent (counting multiplicities in different snapshots) that point to a subvolume. Signed-off-by: Kent Overstreet commit e5fa91d7ac88ac6a8385c14dbc8dcbe1a053e62f Author: Kent Overstreet Date: Thu Oct 21 12:05:21 2021 -0400 bcachefs: Fix restart handling in for_each_btree_key() Code that uses for_each_btree_key often wants transaction restarts to be handled locally and not returned. Originally, we wouldn't return transaction restarts if there was a single iterator in the transaction - the reasoning being if there weren't other iterators being invalidated, and the current iterator was being advanced/retraversed, there weren't any locks or iterators we were required to preserve. But with the btree_path conversion that approach doesn't work anymore - even when we're using for_each_btree_key() with a single iterator there will still be two paths in the transaction, since we now always preserve the path at the pos the iterator was initialized at - the reason being that on restart we often restart from the same place. And it turns out there's now a lot of for_each_btree_key() uses that _do not_ want transaction restarts handled locally, and should be returning them. This patch splits out for_each_btree_key_norestart() and for_each_btree_key_continue_norestart(), and converts existing users as appropriate. for_each_btree_key(), for_each_btree_key_continue(), and for_each_btree_node() now handle transaction restarts themselves by calling bch2_trans_begin() when necessary - and the old hack to not return transaction restarts when there's a single path in the transaction has been deleted. Signed-off-by: Kent Overstreet commit d17bc1739c5adaf9421cbc51b40e50da677c6b54 Author: Kent Overstreet Date: Thu Oct 21 00:38:13 2021 -0400 bcachefs: cached data shouldn't prevent fs from mounting It's not an error if we don't have cached data - skip BCH_DATA_cached in bch2_have_enough_devs(). Signed-off-by: Kent Overstreet commit 521b80676927df6b4ad4fc87b7756aad43b96d12 Author: Kent Overstreet Date: Wed Oct 20 20:50:07 2021 -0400 bcachefs: Delete dentry when deleting snapshots This fixes a bug where subsequently doing creates with the same name fails. Signed-off-by: Kent Overstreet commit 6e0c886d3ccd81d87054269b96de6e4eb6ba0edd Author: Kent Overstreet Date: Wed Oct 20 17:59:38 2021 -0400 bcachefs: Fix check_path() for snapshots check_path() wasn't checking the snapshot ID when checking for directory structure loops - so, snapshots would cause us to detect a loop that wasn't actually a loop. Signed-off-by: Kent Overstreet commit 6d76aefea1902a11c47e20fec5495d30a39891f3 Author: Kent Overstreet Date: Thu Oct 14 09:54:47 2021 -0400 bcachefs: Fix for leaking of reflinked extents When a reflink pointer points to only part of an indirect extent, and then that indirect extent is fragmented (e.g. by copygc), if the reflink pointer only points to one of the fragments we leak a reference. Fix this by storing front/back pad values in reflink pointers - when inserting reflink pointesr, we initialize them to cover the full range of the indirect extents we reference. Signed-off-by: Kent Overstreet commit bfe88863cf3063204fc49a04307fa6635554d6e3 Author: Kent Overstreet Date: Tue Oct 19 17:30:16 2021 -0400 bcachefs: New on disk format to fix reflink_p pointers We had a bug where reflink_p pointers weren't being initialized to 0, and when we started using the second word, things broke badly. This patch revs the on disk format version and adds cleanup code to zero out the second word of reflink_p pointers before we start using it. Signed-off-by: Kent Overstreet commit b71717dac64d76879ba3c70cfcfccf57991205f8 Author: Kent Overstreet Date: Tue Oct 19 15:11:45 2021 -0400 bcachefs: Handle transaction restarts in bch2_blacklist_entries_gc() It shouldn't be necessary when we're only using a single iterator and not doing updates, but that's harder to debug at the moment. Signed-off-by: Kent Overstreet commit 9a796fdb06b56a1811f1afdd40b793e2848a990e Author: Kent Overstreet Date: Tue Oct 19 15:08:00 2021 -0400 bcachefs: bch2_trans_exit() no longer returns errors Now that peek_node()/next_node() are converted to return errors directly, we don't need bch2_trans_exit() to return errors - it's cleaner this way and wasn't used much anymore. Signed-off-by: Kent Overstreet commit d355c6f4f73060c8f3eba95b9ae72929669f7516 Author: Kent Overstreet Date: Tue Oct 19 14:20:50 2021 -0400 bcachefs: for_each_btree_node() now returns errors directly This changes for_each_btree_node() to work like for_each_btree_key(), and to that end bch2_btree_iter_peek_node() and next_node() also return error ptrs. Signed-off-by: Kent Overstreet commit dfc276df911cb7bf026482a9af7c30a60726daff Author: Kent Overstreet Date: Tue Oct 19 12:27:47 2021 -0400 bcachefs: Improve reflink repair code When a reflink pointer points to an indirect extent that doesn't exist, we need to replace it with a KEY_TYPE_error key. Signed-off-by: Kent Overstreet commit 488f97764a9adb68d2ebec0a6e5b96f0f0a7bf38 Author: Kent Overstreet Date: Tue Oct 19 01:08:05 2021 -0400 bcachefs: Fix check_path() across subvolumes Checking of directory structure across subvolumes was broken - we need to look up the snapshot ID of the parent subvolume when crossing subvol boundaries. Signed-off-by: Kent Overstreet commit ca130b9c5e120994483a34c72526dcd4bf308d84 Author: Kent Overstreet Date: Mon Oct 18 14:46:57 2021 -0400 bcachefs: Fix a cache coherency bug in bch2_subvolume_create() Subvolume deletion doesn't flush & evict the btree key cache - ideally it would, but that's tricky, so instead bch2_subvolume_create() needs to make sure the slot doesn't exist in the key cache to avoid triggering assertions. Signed-off-by: Kent Overstreet commit 6a0f414e2018fe7a2b001fbc8ccd4a8f4f946214 Author: Brett Holman Date: Sat Oct 16 19:13:53 2021 -0600 bcachefs: Fix compiler warnings Type size_t is architecture-specific. Fix warnings for some non-amd64 arches. Signed-off-by: Brett Holman Signed-off-by: Kent Overstreet commit 70d61a7036c8d046889a4bf4eda504a6a56b2642 Author: Kent Overstreet Date: Mon Oct 18 11:32:06 2021 -0400 bcachefs: Zero out reflink_p val in bch2_make_extent_indirect() This bug was only discovered when we started using the 2nd word in the val, which should have been zeroed out as those fields had never been used before - ouch. Signed-off-by: Kent Overstreet commit bd547c8acb1aa76ceab1987109ac6ceae698fcc9 Author: Kent Overstreet Date: Thu Oct 14 13:14:40 2021 -0400 bcachefs: Fix __bch2_dirent_read_target() We were shadowing our exist status, oops Signed-off-by: Kent Overstreet commit 60816d9ba69bf746e3f6beda4b6e62e914690024 Author: Kent Overstreet Date: Thu Oct 14 11:47:52 2021 -0400 bcachefs: Improve bch2_dump_trans_paths_updates() Also print the key beyng overwritten for each update. Signed-off-by: Kent Overstreet commit edeb986b017e9489add4daa7e61bc79cdbfb913c Author: Kent Overstreet Date: Wed Oct 13 13:45:46 2021 -0400 bcachefs: Don't allocate too-big bios This fixes a null ptr deref in bio_alloc_bioset() -> biovec_slab() Signed-off-by: Kent Overstreet commit b9a7d8ac5f6d66619de8a4e37b23574d1ca107cf Author: Kent Overstreet Date: Wed Oct 13 13:12:26 2021 -0400 bcachefs: Fix implementation of KEY_TYPE_error When force-removing a device, we were silently dropping extents that we no longer had pointers for - we should have been switching them to KEY_TYPE_error, so that reads for data that was lost return errors. This patch adds the logic for switching a key to KEY_TYPE_error to bch2_bkey_drop_ptr(), and improves the logic somewhat. Signed-off-by: Kent Overstreet commit 776eaddb2cef366b16dac8857899dbb4cc5dfdb1 Author: Kent Overstreet Date: Tue Oct 12 14:25:13 2021 -0400 bcachefs: Fix deletion in __bch2_dev_usrdata_drop() With snapshots, __bch2_dev_usr_data_drop() now uses an ALL_SNAPSHOTS iterator, which isn't an extent iterator - meaning we shouldn't be inserting whiteouts with nonzero size to delete. This fixes a bug where we go RO because we tried to insert an invalid key in the device remove path. Signed-off-by: Kent Overstreet commit 395576807555fa9ffb2ae038cae1fe2699f85b89 Author: Brett Holman Date: Tue Oct 12 21:11:25 2021 -0600 bcachefs: Add a valgrind memcheck hint Prevent false positives in bch2_varint_decode_fast() Signed-off-by: Brett Holman Signed-off-by: Kent Overstreet commit e8bde78a178798a414289f2ad5c1f015d8d53139 Author: Kent Overstreet Date: Tue Oct 12 14:15:45 2021 -0400 bcachefs: Fix rereplicate_pred() It was switching off of the key type incorrectly - this code must've been quite old, and not rereplicating anything that wasn't a btree_ptr_v1 or a plain old extent. Signed-off-by: Kent Overstreet commit 7bd68c73044f1ba39f505082bbed3b2e26f69a13 Author: Kent Overstreet Date: Thu Sep 30 20:09:08 2021 -0400 bcachefs: Snapshot deletion fix When we delete a snapshot, we unlink the inode but we don't want to run the inode_rm path - the unlink path deletes the subvolume directly, which does everything we need. Also allowing the inode_rm path to run was getting us "missing subvolume" errors. There's still another bug with snapshot deletion: we need to make snapshot deletion a multi stage process, where we unlink the root dentry, then tear down the page cache, then delete the snapshot. Signed-off-by: Kent Overstreet commit 107fe5af562303cda985c6bb72d36dbcd2076f06 Author: Kent Overstreet Date: Thu Oct 7 18:18:01 2021 -0400 bcachefs: Fix a pcpu var splat this_cpu_ptr() emits a warning when used without preemption disabled - harmless in this case, as we have other locking where bch2_acc_percpu_u64s() is used. Signed-off-by: Kent Overstreet commit 4b09ef12e76c3c0e37ecce6c1e33243d65026398 Author: Kent Overstreet Date: Thu Oct 7 18:08:01 2021 -0400 bcachefs: Fix bch2_move_btree() bch2_trans_begin() is now required for transaction restarts. Signed-off-by: Kent Overstreet commit 56767d66e888e0e998eabbbcffa5c6da49ef5402 Author: Kent Overstreet Date: Thu Oct 7 14:59:00 2021 -0400 bcachefs: Fixes for usrdata/metadata drop paths These paths weren't updated for btree_path and snapshots - a couple of minor fixes. Signed-off-by: Kent Overstreet commit d697b9abbae2f2c387aaa4e702afe12e31984a18 Author: Kent Overstreet Date: Thu Oct 7 14:56:56 2021 -0400 bcachefs: More btree iterator fixes - check for getting to the end of the btree in bch2_path_verify_locks and __btree_path_traverse_all(), this fixes an infinite loop in __btree_path_traverse_all(). - relax requirement in bch2_btree_node_upgrade() that we must want an intent lock, this fixes bugs with paths that point to interior nodes (nonzero level). - bch2_btree_node_update_key(): fix it to upgrade the path to an intent lock, if necessary Signed-off-by: Kent Overstreet commit 502027a8b2c0f0d46daf948cd1315694a46294e3 Author: Kent Overstreet Date: Thu Oct 7 14:54:50 2021 -0400 bcachefs: Ensure btree_path consistent with node iterators Btree node iterators want the interior btree_path to point to the same pos as the returned btree node - this fixes a regression from the introduction of btree_path, where rewriting/updating keys of btree nodes (e.g. in bch2_dev_metadata_drop()) via btree node iterators. Signed-off-by: Kent Overstreet commit a9cb0a6706038292bbc22f50546859783ac492bc Author: Kent Overstreet Date: Thu Oct 7 14:53:21 2021 -0400 bcachefs: Fix bch2_dev_remove_alloc() It was missing a lockrestart_do(), to call bch2_trans_begin() and also handle transaction restarts. Signed-off-by: Kent Overstreet commit 97996ddfdb9b0b4df22913d04ce01a069a944430 Author: Kent Overstreet Date: Thu Sep 30 19:46:23 2021 -0400 bcachefs: bch2_subvolume_get() Factor out a little helper. Signed-off-by: Kent Overstreet commit 69294246b7a441a112d1a550ffc8e4e1e45142a4 Author: Kent Overstreet Date: Fri Oct 1 10:08:13 2021 -0400 bcachefs: Fix allocator shutdown error message We return 1 to indicate kthread_should_stop() returned true - we shouldn't be printing an error. Signed-off-by: Kent Overstreet commit e59a4d787507592ea19dbf48bc71b3120ff5df4d Author: Kent Overstreet Date: Thu Sep 30 17:51:18 2021 -0400 bcachefs: Fix a spurious fsck error We were getting spurious "multiple types of data in same bucket" errors in fsck, because the check was running for (cached) stale pointers - oops. Signed-off-by: Kent Overstreet commit ea0531f84eec65a1204a13167965bc151e0f072c Author: Kent Overstreet Date: Thu Sep 30 11:09:26 2021 -0400 bcachefs: Fix check_inode_update_hardlinks() We were incorrectly using bch2_inode_write(), which gets the snapshot ID from the iterator, with a BTREE_ITER_ALL_SNAPSHOTS iterator - fortunately caught by an assertion in the update path. Signed-off-by: Kent Overstreet commit 0476fa948e6fac0b7fa04b5bb0ed30631cbf50ea Author: Kent Overstreet Date: Mon Sep 27 13:25:18 2021 -0400 bcachefs: Rev the on disk format version for snapshots This will cause the compat code to be run that creates entries in the subvolumes and snapshots btrees. Signed-off-by: Kent Overstreet commit 71ed0056dc1f03346eabcdaa37272041e5d52fe9 Author: Kent Overstreet Date: Mon Sep 27 01:56:31 2021 -0400 bcachefs: Fix an assertion We can end up in a strange situation where a btree_path points to a node being freed even after pointers to it should have been replaced by pointers to the new node - if the btree node has been reused since the pointer to it was created. Signed-off-by: Kent Overstreet commit 42d237320e9817a94f3a0a2de28156523596b086 Author: Kent Overstreet Date: Tue Mar 16 23:28:43 2021 -0400 bcachefs: Snapshot creation, deletion This is the final patch in the patch series implementing snapshots. This patch implements two new ioctls that work like creation and deletion of directories, but fancier. - BCH_IOCTL_SUBVOLUME_CREATE, for creating new subvolumes and snaphots - BCH_IOCTL_SUBVOLUME_DESTROY, for deleting subvolumes and snapshots Signed-off-by: Kent Overstreet commit a861c7225b9e31da745c262711d625782b5d766a Author: Kent Overstreet Date: Mon Mar 15 22:34:00 2021 -0400 bcachefs: Require snapshot id to be set Now that all the existing code has been converted for snapshots, this patch changes the code for initializing a btree iterator to require a snapshot to be specified, and also change bkey_invalid() to allow for non U32_MAX snapshot IDs. Signed-off-by: Kent Overstreet commit 6f83cb84bb74cd766f888380cfb5f9268e55d9f1 Author: Kent Overstreet Date: Wed Dec 15 20:38:56 2021 -0500 bcachefs: Fix unit & perf tests for snapshots This finishes updating the unit & perf tests for snapshots - btrees that use snapshots now always require the snapshot field of the start position to be a valid snapshot ID. Signed-off-by: Kent Overstreet commit 18443cb9f005b5563e2e3da9b8ccd374a552c3b1 Author: Kent Overstreet Date: Thu Aug 5 00:41:41 2021 -0400 bcachefs: Update data move path for snapshots The data move path operates on existing extents, and not within a subvolume as the regular IO paths do. It needs to change because it may cause existing extents to be split, and when splitting an existing extent in an ancestor snapshot we need to make sure the new split has the same visibility in child snapshots as the existing extent. Signed-off-by: Kent Overstreet commit 7a7d17b2f7c23c0891b0cbd13fafd3bc805b1b29 Author: Kent Overstreet Date: Tue Feb 2 17:09:10 2021 -0500 bcachefs: Whiteouts for snapshots This patch adds KEY_TYPE_whiteout, a new type of whiteout for snapshots, when we're deleting and the key being deleted is in an ancestor snapshot - and updates the transaction update/commit path to use it. Signed-off-by: Kent Overstreet commit 8c6d298ab22fc1b2912ccef4ffd4a01b35f9c5b4 Author: Kent Overstreet Date: Fri Mar 12 20:30:39 2021 -0500 bcachefs: Convert io paths for snapshots This plumbs around the subvolume ID as was done previously for other filesystem code, but now for the IO paths - the control flow in the IO paths is trickier so the changes in this patch are more involved. Signed-off-by: Kent Overstreet commit ef1669ffc69c4926066451e1d0bc32e5ed6fc7d7 Author: Kent Overstreet Date: Tue Apr 20 00:15:44 2021 -0400 bcachefs: Update fsck for snapshots This updates the fsck algorithms to handle snapshots - meaning there will be multiple versions of the same key (extents, inodes, dirents, xattrs) in different snapshots, and we have to carefully consider which keys are visible in which snapshot. Signed-off-by: Kent Overstreet commit 6fed42bb7750e217b0d1169ccfccc7639a3e1d3f Author: Kent Overstreet Date: Tue Mar 16 00:28:17 2021 -0400 bcachefs: Plumb through subvolume id To implement snapshots, we need every filesystem btree operation (every btree operation without a subvolume) to start by looking up the subvolume and getting the current snapshot ID, with bch2_subvolume_get_snapshot() - then, that snapshot ID is used for doing btree lookups in BTREE_ITER_FILTER_SNAPSHOTS mode. This patch adds those bch2_subvolume_get_snapshot() calls, and also switches to passing around a subvol_inum instead of just an inode number. Signed-off-by: Kent Overstreet commit c075ff700ff397671636bf45f6ef6ef330258d3e Author: Kent Overstreet Date: Thu Mar 4 22:29:25 2021 -0500 bcachefs: BTREE_ITER_FILTER_SNAPSHOTS For snapshots, we need to implement btree lookups that return the first key that's an ancestor of the snapshot ID the lookup is being done in - and filter out keys in unrelated snapshots. This patch adds the btree iterator flag BTREE_ITER_FILTER_SNAPSHOTS which does that filtering. Signed-off-by: Kent Overstreet commit 284ae18c1d7aa44232baedf860a004ceb32fea62 Author: Kent Overstreet Date: Tue Mar 16 01:33:39 2021 -0400 bcachefs: Add subvolume to ei_inode_info Filesystem operations generally operate within a subvolume: at the start of every btree transaction we'll be looking up (and locking) the subvolume to get the current snapshot ID, which we then use for our other btree lookups in BTREE_ITER_FILTER_SNAPSHOTS mode. But inodes don't record what subvolume they're in - they can't, because if they did we'd have to update every single inode within a subvolume when taking a snapshot in order to keep that field up to date. So it needs to be tracked in memory, based on how we got to that inode. Hence this patch adds a subvolume field to ei_inode_info, and switches to iget5() so we can index by it in the inode hash table. Signed-off-by: Kent Overstreet commit 81ed9ce3671125ee384c1a205747a853ca2a1739 Author: Kent Overstreet Date: Mon Apr 19 23:31:40 2021 -0400 bcachefs: Per subvolume lost+found On existing filesystems, we have a single global lost+found. Introducing subvolumes means we need to introduce per subvolume lost+found directories, because inodes are added to lost+found by their inode number, and inode numbers are now only unique within a subvolume. This patch adds support to fsck for per subvolume lost+found. Signed-off-by: Kent Overstreet commit b9e1adf57988fb4632b86c43fde1551a24299b86 Author: Kent Overstreet Date: Tue Mar 16 00:46:26 2021 -0400 bcachefs: Add support for dirents that point to subvolumes Dirents currently always point to inodes. Subvolumes add a new type of dirent, with d_type DT_SUBVOL, that instead points to an entry in the subvolumes btree, and the subvolume has a pointer to the root inode. This patch adds bch2_dirent_read_target() to get the inode (and potentially subvolume) a dirent points to, and changes existing code to use that instead of reading from d_inum directly. Signed-off-by: Kent Overstreet commit 14b393ee768e8339b9c64f82df24e8c081bdbff9 Author: Kent Overstreet Date: Tue Mar 16 00:42:25 2021 -0400 bcachefs: Subvolumes, snapshots This patch adds subvolume.c - support for the subvolumes and snapshots btrees and related data types and on disk data structures. The next patches will start hooking up this new code to existing code. Signed-off-by: Kent Overstreet commit 8948fc8f1521702d87a21b9c43c1228e53e3fc29 Author: Kent Overstreet Date: Sun Sep 26 13:54:14 2021 -0400 bcachefs: Disable quota support Existing quota support breaks badly with snapshots. We're not deleting the code because some of it will be needed when we reimplement quotas along the lines of btrfs subvolume quotas. Signed-off-by: Kent Overstreet commit 3074bc0f7de749440c5e2b01a03ee2226fe69b52 Author: Kent Overstreet Date: Wed Sep 15 11:15:18 2021 -0400 Revert "bcachefs: Add more assertions for locking btree iterators out of order" Figured out the bug we were chasing, and it had nothing to do with locking btree iterators/paths out of order. This reverts commit ff08733dd298c969aec7c7828095458f73fd5374. Signed-off-by: Kent Overstreet commit aae4eea60cf0c824abe6be809f0260df8574f49a Author: Kent Overstreet Date: Mon Sep 13 16:04:49 2021 -0400 bcachefs: Improve btree_node_mem_ptr optimization This patch checks b->hash_val before attempting to lock the node in the btree, which makes it more equivalent to the "lookup in hash table" path - and potentially avoids an unnecessary transaction restart if btree_node_mem_ptr(k) no longer points to the node we want. Signed-off-by: Kent Overstreet commit aa76bd3321f018af08629bb98ba2d5f0b4b18546 Author: Kent Overstreet Date: Mon Sep 13 12:38:40 2021 -0400 bcachefs: Add a missing bch2_trans_relock() call This was causing an assertion to pop in fsck, in one of the repair paths. Signed-off-by: Kent Overstreet commit c79272d1e4bb2ff65f4d68f193239d900658c5e6 Author: Kent Overstreet Date: Thu Sep 9 19:05:34 2021 -0400 bcachefs: Fix some compiler warnings gcc couldn't always deduce that written wasn't used uninitialized Signed-off-by: Kent Overstreet commit 5b5b03e7320dedcdfef968a1add47c18ab7b98a2 Author: Kent Overstreet Date: Tue Sep 7 23:04:04 2021 -0400 bcachefs: Add missing BTREE_ITER_INTENT No reason not to be using it here... Signed-off-by: Kent Overstreet commit caaa66aa546a27e75fb3cf32df1906140f85f1c9 Author: Kent Overstreet Date: Tue Sep 7 21:25:32 2021 -0400 bcachefs: Better approach to write vs. read lock deadlocks Instead of unconditionally upgrading read locks to intent locks in do_bch2_trans_commit(), this patch changes the path that takes write locks to first trylock, and then if trylock fails check if we have a conflicting read lock, and restart the transaction if necessary. Signed-off-by: Kent Overstreet commit b301105b48d2805ca0e29b1b0f660cf2232511ee Author: Kent Overstreet Date: Tue Sep 7 21:24:05 2021 -0400 bcachefs: normalize_read_intent_locks This is a new approach to avoiding the self deadlock we'd get if we tried to take a write lock on a node while holding a read lock - we simply upgrade the readers to intent. Signed-off-by: Kent Overstreet commit 8ee0134e03b541f3723d92586f1385ab50e42ac2 Author: Kent Overstreet Date: Tue Sep 7 20:23:30 2021 -0400 bcachefs: Consolidate intent lock code in btree_path_up_until_good_node We need to take all needed intent locks when relocking an iterator: bch2_btree_path_traverse() had a special cased, faster version of this, but it really should be in up_until_good_node() so that set_pos() can use it too. Signed-off-by: Kent Overstreet commit db92f2ea5ed576748b538d15446cebb65bb8d31f Author: Kent Overstreet Date: Tue Sep 7 15:34:16 2021 -0400 bcachefs: Optimize btree lookups in write path This patch significantly reduces the number of btree lookups required in the extent update path. Signed-off-by: Kent Overstreet commit c404f2038602580b6bdddeff5e9a4d42717da3b8 Author: Kent Overstreet Date: Tue Sep 7 13:55:33 2021 -0400 bcachefs: Add a missing btree_path_make_mut() call Also add another small helper, btree_path_clone(). Signed-off-by: Kent Overstreet commit 8ffa63cd7eed11597d90d83a5fdac0ba5fdf6834 Author: Kent Overstreet Date: Tue Sep 7 00:58:13 2021 -0400 bcachefs: Enabled shard_inode_numbers by default We'd like performance increasing options to be on by default. Signed-off-by: Kent Overstreet commit cf3c68cda684b41bcdd4d9a8dba4abd4abb32881 Author: Kent Overstreet Date: Mon Sep 6 15:38:12 2021 -0400 bcachefs: No need to clone iterators for update Since btree_path is now internally refcounted, we don't need to clone an iterator before calling bch2_trans_update() if we'll be mutating it. Signed-off-by: Kent Overstreet commit 22b383ad7e1928de8da14d66a7154a9bfebf9a46 Author: Kent Overstreet Date: Sun Sep 5 00:22:32 2021 -0400 bcachefs: Kill retry loop in btree merge path Signed-off-by: Kent Overstreet commit f48361b00c4e6854a66ebf32c11849d4762a239e Author: Kent Overstreet Date: Sun Sep 5 00:05:08 2021 -0400 bcachefs: Drop some fast path tracepoints These haven't turned out to be useful Signed-off-by: Kent Overstreet commit 1d3ecd7ea790cb650d8c80741ecd4f03780ff78b Author: Kent Overstreet Date: Sat Sep 4 21:23:11 2021 -0400 bcachefs: Tighten up btree locking invariants New rule is: if a btree path holds any locks it should be holding precisely the locks wanted (accoringing to path->level and path->locks_want). Signed-off-by: Kent Overstreet commit 1ae29c1faaa3af9e8c490206634f2648016634cd Author: Kent Overstreet Date: Sat Sep 4 21:19:48 2021 -0400 bcachefs: Extent btree iterators are no longer special Since iter->real_pos was introduced, we no longer have to deal with extent btree iterators that have skipped past deleted keys - this is a real performance improvement on btree updates. Signed-off-by: Kent Overstreet commit 068bcaa589e268fe0bca1f972b3a08a18be8c5dc Author: Kent Overstreet Date: Fri Sep 3 17:18:57 2021 -0400 bcachefs: Add more assertions for locking btree iterators out of order btree_path_traverse_all() traverses btree iterators in sorted order, and thus shouldn't see transaction restarts due to potential deadlocks - but sometimes we do. This patch adds some more assertions and tracks some more state to help track this down. Signed-off-by: Kent Overstreet commit 807dda8c83620ab0fd1d93bbe8bdc4a289cbd045 Author: Kent Overstreet Date: Mon Aug 30 15:18:31 2021 -0400 bcachefs: Kill bpos_diff() XXX check for perf regression This improves the btree iterator lookup code by using trans_for_each_iter_inorder(). Signed-off-by: Kent Overstreet commit 67e0dd8f0d8b4bf09098c4692abcb43a20089dff Author: Kent Overstreet Date: Mon Aug 30 15:18:31 2021 -0400 bcachefs: btree_path This splits btree_iter into two components: btree_iter is now the externally visible componont, and it points to a btree_path which is now reference counted. This means we no longer have to clone iterators up front if they might be mutated - btree_path can be shared by multiple iterators, and cloned if an iterator would mutate a shared btree_path. This will help us use iterators more efficiently, as well as slimming down the main long lived state in btree_trans, and significantly cleans up the logic for iterator lifetimes. Signed-off-by: Kent Overstreet commit 8f54337dc6825f323f7761c182d98efdd180ce70 Author: Kent Overstreet Date: Fri Sep 3 17:32:42 2021 -0400 bcachefs: Fix initialization of bch_write_op.nonce If an extent ends up with a replica that is encrypted an a replica that isn't encrypted (due the user changing options), and then copygc/rebalance moves one of the replicas by reading from the unencrypted replica, we had a bug where we wouldn't correctly initialize op->nonce - for each crc field in an extent, crc.offset + crc.nonce must be equal. This patch fixes that by moving op.nonce initialization to bch2_migrate_write_init. Signed-off-by: Kent Overstreet commit fbf14104dabe91e6c3b5544f9289eebc94a52c93 Author: Kent Overstreet Date: Wed Sep 1 18:06:01 2021 -0400 bcachefs: Improve an error message When we detect an invalid key being inserted, we should print what code was doing the update. Signed-off-by: Kent Overstreet commit cab8e233734d89cd3c857ee42fe26e49f57d5e75 Author: Kent Overstreet Date: Wed Sep 1 00:50:18 2021 -0400 bcachefs: Add an assertion for removing btree nodes from cache Chasing a bug that has something to do with the btree node cache. Signed-off-by: Kent Overstreet commit f21566f17aa8f100b6d106f657a75964a3482f54 Author: Kent Overstreet Date: Mon Aug 30 15:54:41 2021 -0400 bcachefs: Kill BTREE_ITER_NODES We really only need to distinguish between btree iterators and btree key cache iterators - this is more prep work for btree_path. Signed-off-by: Kent Overstreet commit deb0e573b4c1f1f0733662976230a77624160794 Author: Kent Overstreet Date: Mon Aug 30 17:31:09 2021 -0400 bcachefs: Kill BTREE_ITER_NEED_PEEK This was used for an optimization that hasn't existing in quite awhile - iter->uptodate will probably be going away as well. Signed-off-by: Kent Overstreet commit 6fba6b83b426cf489c3c133d0e2a0260889aba2e Author: Kent Overstreet Date: Mon Aug 30 16:08:34 2021 -0400 bcachefs: Prefer using btree_insert_entry to btree_iter This moves some data dependencies forward, to improve pipelining. Signed-off-by: Kent Overstreet commit a0a568794d09a2092062ed4137499ed0884cf2b4 Author: Kent Overstreet Date: Mon Aug 30 14:45:11 2021 -0400 bcachefs: More renaming Signed-off-by: Kent Overstreet commit f7a966a3e2546a7fc76bc34b78e7dad7cebfa8c2 Author: Kent Overstreet Date: Mon Aug 30 14:36:03 2021 -0400 bcachefs: Clean up/rename bch2_trans_node_* fns These utility functions are for managing btree node state within a btree_trans - rename them for consistency, and drop some unneeded arguments. Signed-off-by: Kent Overstreet commit 78cf784eaac1ebfc8982e815618b0fcc5927fafb Author: Kent Overstreet Date: Mon Aug 30 14:22:43 2021 -0400 bcachefs: Further reduce iter->trans usage This is prep work for splitting btree_path out from btree_iter - btree_path will not have a pointer to btree_trans. Signed-off-by: Kent Overstreet commit 05046a962f0cdfbeec91d64714df84456ce09a1b Author: Kent Overstreet Date: Fri Aug 27 20:55:44 2021 -0400 bcachefs: Better algorithm for btree node merging in write path The existing algorithm was O(n^2) in the number of updates in the commit. Signed-off-by: Kent Overstreet commit 5f8077cca89bdcc3d7660567462b17831356826d Author: Kent Overstreet Date: Sun Aug 29 19:34:37 2021 -0400 bcachefs: Kill BTREE_ITER_SET_POS_AFTER_COMMIT BTREE_ITER_SET_POS_AFTER_COMMIT is used internally to automagically advance extent btree iterators on sucessful commit. But with the upcomnig btree_path patch it's getting more awkward to support, and it adds overhead to core data structures that's only used in a few places, and can be easily done by the caller instead. Signed-off-by: Kent Overstreet commit 638c6ff951bfebbecde5b6912ce22a02a77fafc1 Author: Kent Overstreet Date: Wed Aug 25 01:03:25 2021 -0400 bcachefs: Refactor bch2_trans_update_extent() This consolidates the code for doing extent updates, and makes the btree iterator usage a bit cleaner and more efficient. Signed-off-by: Kent Overstreet commit 9f6bd30703a32c25988c6aca87c1be1baddc57bd Author: Kent Overstreet Date: Tue Aug 24 21:30:06 2021 -0400 bcachefs: Reduce iter->trans usage Disfavoured, and should go away. Signed-off-by: Kent Overstreet commit 84841b0d1320c2084facb2f040d6ac0dfced943e Author: Kent Overstreet Date: Tue Aug 24 21:26:43 2021 -0400 bcachefs: bch2_dump_trans_iters_updates() This factors out bch2_dump_trans_iters_updates() from the iter alloc overflow path, and makes some small improvements to what it prints. Signed-off-by: Kent Overstreet commit e6e024e9bf250e24cc8f8546a4645d7271d7f090 Author: Kent Overstreet Date: Tue Aug 24 16:54:36 2021 -0400 bcachefs: Ensure iter->real_pos is consistent with key returned iter->real_pos needs to match the key returned or bad things will happen when we go to update the key at that position. When we returned a pending update from btree_trans_peek_updates(), this wasn't necessarily the case. Signed-off-by: Kent Overstreet commit 1865ccff159cce61d017d1c93e024d2f482d6a0c Author: Kent Overstreet Date: Tue Aug 24 20:31:44 2021 -0400 bcachefs: Add SPOS_MAX to bpos_to_text() Better pretty printing ftw Signed-off-by: Kent Overstreet commit dc02bed6d9b8c85a8db686fecac5749fbde8cba1 Author: Kent Overstreet Date: Mon Aug 23 17:19:17 2021 -0400 bcachefs: Free iterator if we have duplicate This helps - but does not fully fix - the outstanding "transaction iterator overflow" bugs. Signed-off-by: Kent Overstreet commit f4ccfe07e20e52a5f6ace9ef995bca1c07a70fac Author: Kent Overstreet Date: Sun Aug 22 12:56:56 2021 -0400 bcachefs: Fix unhandled transaction restart in bch2_gc_btree_gens() This fixes https://github.com/koverstreet/bcachefs/issues/305 Signed-off-by: Kent Overstreet commit 8dd6ed9451894e2168328e2203d227303b472ca3 Author: Brett Holman Date: Fri Jul 23 13:57:19 2021 -0600 bcachefs: add progress stats to sysfs This adds progress stats to sysfs for copygc, rebalance, recovery, and the cmd_job ioctls. Signed-off-by: Brett Holman Signed-off-by: Kent Overstreet commit fd0bd123d5bc11d665ad0e80eaf4b458619f8b3d Author: Brett Holman Date: Tue Aug 17 17:14:26 2021 -0600 bcachefs: Fix 32 bit build failures This fix replaces multiple 64 bit divisions with do_div() equivalents. Signed-off-by: Brett Holman Signed-off-by: Kent Overstreet commit 28624ba424fd73154438fd6552e6b555b3376a65 Author: Kent Overstreet Date: Wed Aug 18 16:19:28 2021 -0400 bcachefs: Be sure to check ptr->dev in copygc pred function Signed-off-by: Kent Overstreet commit 62df3d443c389115f1664676ef75ba0fd157c2a4 Author: Kent Overstreet Date: Tue Aug 17 15:29:21 2021 -0400 bcachefs: Disk space accounting fix DIV_ROUND_UP() wasn't doing what we wanted when passing it negative numbers - fix it by just not passing it negative numbers anymore. Also, no need to do the scaling by compression ratio for incompressible data. Signed-off-by: Kent Overstreet commit 8ddef4d6ccedcd571c9b81f6cd8dff8ddcdb918a Author: Kent Overstreet Date: Tue Aug 17 15:03:53 2021 -0400 bcachefs: Fix a valgrind conditional jump Valgrind was complaining about a jump depending on uninitialized memory - we weren't, but this change makes the code less confusing for valgrind to follow. Signed-off-by: Kent Overstreet commit c8476a4eb29972d756df33c3eb85c5792f798748 Author: Kent Overstreet Date: Sat Aug 7 18:19:33 2021 -0400 bcachefs: Minor btree iter refactoring This makes the flow control in bch2_btree_iter_peek() and bch2_btree_iter_peek_prev() a bit cleaner. Signed-off-by: Kent Overstreet commit d2c50773946dfc21021c18c03aa35f1ccb47669a Author: Kent Overstreet Date: Sat Aug 7 18:21:35 2021 -0400 bcachefs: Fix btree_trans_peek_updates() Should have been using bpos_cmp(), not bkey_cmp(). Signed-off-by: Kent Overstreet commit 3737e0ddfbce4791a6415fa685e235b03924ff01 Author: Kent Overstreet Date: Thu Aug 5 13:02:39 2021 -0400 bcachefs: Fix an unhandled transaction restart __bch2_read() -> __bch2_read_extent() -> bch2_bucket_io_time_reset() may cause a transaction restart, which we don't return an error for because it doesn't prevent us from making forward progress on the read we're submitting. Instead, change __bch2_read() and bchfs_read() to check for transaction restarts. Signed-off-by: Kent Overstreet commit e3637266024de9bafa64f315d7d03cf0291ace6a Author: Kent Overstreet Date: Fri Jul 30 18:01:33 2021 -0400 bcachefs: Ensure that new inodes hit underlying btree Inode creation is done with non-cached btree iterators, but then in the same transaction the inode may be updated again with a cached iterator - it makes cache coherency easier if new inodes always land in the underlying btree. This patch adds a check to bch2_trans_update() - if the same key is updated multiple times in the same transaction with both cached and non cache iterators, use the non cached iterator. Signed-off-by: Kent Overstreet commit 0f120eac34f31e7e6c4904d9e92e2e95e2edfbaa Author: Kent Overstreet Date: Fri Jul 30 17:59:37 2021 -0400 bcachefs: Add flags field to bch2_inode_to_text() Signed-off-by: Kent Overstreet commit 0423fb7185e3c0178b3a09f24afc3777c2ef9522 Author: Kent Overstreet Date: Sat Jun 12 15:45:45 2021 -0400 bcachefs: Keep a sorted list of btree iterators This will be used to make other operations on btree iterators within a transaction more efficient, and enable some other improvements to how we manage btree iterators. Signed-off-by: Kent Overstreet commit 877da05ffb13c1a998070707e0d15df0167f9364 Author: Kent Overstreet Date: Fri Jul 30 14:33:06 2021 -0400 bcachefs: Zero out mem_ptr field in btree ptr keys from journal replay This fixes a bad ptr deref on recovery from unclean shutdown in bch2_btree_node_get_noiter(). Signed-off-by: Kent Overstreet commit 9cba7bf7c7edc6ae6579945588964b3b90e33258 Author: Kent Overstreet Date: Tue Jul 27 22:28:39 2021 -0400 bcachefs: Don't drop read locks at transaction commit time Signed-off-by: Kent Overstreet commit 0d32711ef65511ff52b5c42e5618a6e83b406cad Author: Kent Overstreet Date: Tue Jul 27 22:32:05 2021 -0400 bcachefs: traverse_all() shouldn't be restarting the transaction We're only called by bch2_trans_begin() now. Signed-off-by: Kent Overstreet commit 1a488e73067c65086191a63fe61e57692383fb27 Author: Kent Overstreet Date: Tue Jul 27 22:15:04 2021 -0400 bcachefs: Kill BTREE_INSERT_NOUNLOCK With the recent transaction restart changes, it's no longer needed - all transaction commits have BTREE_INSERT_NOUNLOCK semantics. Signed-off-by: Kent Overstreet commit b253a90d06b8a8004eeb057e82f72dc8120d972b Author: Kent Overstreet Date: Sat Jul 24 14:25:01 2021 -0400 bcachefs: Btree splits no longer automatically cause a transaction restart With the new and improved handling of transaction restarts, this should finally be safe. Signed-off-by: Kent Overstreet commit 955af634410cbaead0498485ac376165b0f947fb Author: Kent Overstreet Date: Sat Jul 24 23:57:28 2021 -0400 bcachefs: __bch2_trans_commit() no longer calls bch2_trans_reset() It's now the caller's responsibility to call bch2_trans_begin. Signed-off-by: Kent Overstreet commit e829b7175b54c9ccdf4412baea592bc495bc97f1 Author: Kent Overstreet Date: Thu Jul 22 12:39:11 2021 -0400 bcachefs: Ensure btree_iter_traverse() obeys iter->should_be_locked iter->should_be_locked means that if bch2_btree_iter_relock() fails, we need to restart the transaction. Signed-off-by: Kent Overstreet commit b4e09b351be7085cada5c08c1eabee5f0eb498b0 Author: Kent Overstreet Date: Tue Jul 27 18:01:52 2021 -0400 bcachefs: bch2_btree_iter_traverse() shouldn't normally call traverse_all() If there's more than one iterator in the btree_trans, it's requried to call bch2_trans_begin() to handle transaction restarts. Signed-off-by: Kent Overstreet commit e5af273fcefb13cdd9e3c27d9ee6c52ee6b12264 Author: Kent Overstreet Date: Sun Jul 25 17:19:52 2021 -0400 bcachefs: trans->restarted Start tracking when btree transactions have been restarted - and assert that we're always calling bch2_trans_begin() immediately after transaction restart. Signed-off-by: Kent Overstreet commit 3cc5288a62f2657b99faab428f993673ca9d033f Author: Kent Overstreet Date: Wed Jul 28 16:17:10 2021 -0400 bcachefs: Change lockrestart_do() to always call bch2_trans_begin() More consistent behaviour means less likely to trip over ourselves in silly ways. Signed-off-by: Kent Overstreet commit a88171c9e6150e0692b392362fc2d56d83cef998 Author: Kent Overstreet Date: Sat Jul 24 17:38:15 2021 -0400 bcachefs: Clean up interior update paths Btree node merging now happens prior to transaction commit, not after, so we don't need to pay attention to BTREE_INSERT_NOUNLOCK. Also, foreground_maybe_merge shouldn't be calling bch2_btree_iter_traverse_all() - this is becoming private to the btree iterator code and should only be called by bch2_trans_begin(). Signed-off-by: Kent Overstreet commit 700c25b32a776a70849c025d898ba1a7431279e4 Author: Kent Overstreet Date: Sat Jul 24 20:24:10 2021 -0400 bcachefs: Use bch2_trans_begin() more consistently Upcoming patch will require that a transaction restart is always immediately followed by bch2_trans_begin(). Signed-off-by: Kent Overstreet commit 8b3e9bd65f61dde939538452cbb2a608bc562d34 Author: Kent Overstreet Date: Sat Jul 24 19:50:40 2021 -0400 bcachefs: Always check for transaction restarts On transaction restart iterators won't be locked anymore - make sure we're always checking for errors. Signed-off-by: Kent Overstreet commit 67b07638f1fab974284846d77cce771fed88ded3 Author: Kent Overstreet Date: Sat Jul 24 17:43:35 2021 -0400 bcachefs: traverse_all() is responsible for clearing should_be_locked bch2_btree_iter_traverse_all() may loop, and it needs to clear iter->should_be_locked on every iteration. Signed-off-by: Kent Overstreet commit fe5233979ace0008b2fab4a05be897d449e44094 Author: Kent Overstreet Date: Tue Jul 27 17:58:58 2021 -0400 bcachefs: bch2_trans_relock() only relocks iters that should be locked This avoids unexpected lock restarts in bch2_btree_iter_traverse_all(). Signed-off-by: Kent Overstreet commit 6918bb55f6ae106c14fa3bb0428fd6588e107982 Author: Kent Overstreet Date: Sun Jul 25 14:20:43 2021 -0400 bcachefs: Don't traverse iterators in __bch2_trans_commit() They should already be traversed, and we're asserting that since the introduction of iter->should_be_locked Signed-off-by: Kent Overstreet commit a32b9573c742c9a9289aa26e0a28d0f9a9c439a4 Author: Kent Overstreet Date: Mon Jul 26 15:52:41 2021 -0400 bcachefs: Add an option for btree node mem ptr optimization bch2_btree_node_ptr_v2 has a field for stashing a pointer to the in memory btree node; this is safe because we clear this field when reading in nodes from disk and we never free in memory btree nodes - but, we have bug reports that indicate something might be faulty with this optimization, so let's add an option for it. Signed-off-by: Kent Overstreet commit 2b4e4b8cfa3857cd44506b2e57fd587e7494d777 Author: Kent Overstreet Date: Sat Jul 24 17:31:25 2021 -0400 bcachefs: Minor tracepoint improvements Btree iterator tracepoints should print whether they're for the key cache. Signed-off-by: Kent Overstreet commit 6e075b54a3749d3f94e4b87ed8294f8d6ab09bac Author: Kent Overstreet Date: Sat Jul 24 17:12:51 2021 -0400 bcachefs: bch2_btree_iter_relock_intent() This adds a new helper for btree_cache.c that does what we want where the iterator is still being traverse - and also eliminates some unnecessary transaction restarts. Signed-off-by: Kent Overstreet commit a6eba44b889f9da03ff701f9676297148ed5dcc3 Author: Kent Overstreet Date: Fri Jul 23 18:26:38 2021 -0400 bcachefs: Use bch2_trans_do() in bch2_btree_key_cache_journal_flush() We're working to standardize handling of transaction restarts. Signed-off-by: Kent Overstreet commit ed5580b43b083a96fe2cbcf6b1cfe340fa52fca2 Author: Kent Overstreet Date: Sat Jul 24 20:20:02 2021 -0400 bcachefs: Fix a btree iterator leak Signed-off-by: Kent Overstreet commit d7b21954b9049d749b98b50dad14f35d44f3340f Author: Kent Overstreet Date: Wed Jul 21 13:55:51 2021 -0400 bcachefs: Pretty-ify bch2_bkey_val_to_text() Don't print out the ": " when there isn't a value to print. Signed-off-by: Kent Overstreet commit 382005442674a327e7238d6dc8c16071bfc723f3 Author: Kent Overstreet Date: Wed Jul 21 13:23:50 2021 -0400 bcachefs: Don't squash return code in check_dirents() We were squashing BCH_FSCK_ERRORS_NOT_FIXED. Signed-off-by: Kent Overstreet commit b97bbd4ec35d5359398513d381345765cd80c012 Author: Kent Overstreet Date: Tue Jul 20 21:18:16 2021 -0400 bcachefs: Use bch2_inode_find_by_inum() in truncate This is needed for snapshots because we need to start handling lock restarts even when just calling bch2_inode_peek(). Signed-off-by: Kent Overstreet commit 4909fe50b31ad919d998329002d707dd097094ff Author: Kent Overstreet Date: Tue Jul 20 21:07:21 2021 -0400 bcachefs: Handle lock restarts in bch2_xattr_get() Snapshots add another btree lookup, thus we need to handle lock restarts. Signed-off-by: Kent Overstreet commit 5f87f3c116f67fe22ba8a9f461830480a716fe9b Author: Kent Overstreet Date: Tue Jul 20 20:14:44 2021 -0400 bcachefs: Don't downgrade in traverse() Downgrading of btree iterators is something that should only happen explicitly. Signed-off-by: Kent Overstreet commit e719fc34f00004813f98c8c3f8f3f364b1d77afc Author: Kent Overstreet Date: Fri Jul 16 12:57:27 2021 -0400 bcachefs: BSET_OFFSET() Add a field to struct bset for the sector offset within the btree node where it was written. Signed-off-by: Kent Overstreet commit 47924527e643e6160c6726669b90cad8aeb6d977 Author: Kent Overstreet Date: Sun Sep 10 23:35:02 2023 -0400 Revert "bcachefs: statfs bfree and bavail should be the same" This reverts commit 664f9847bec525d396d62d2db094ca9020289ae0. Signed-off-by: Kent Overstreet commit 9f1833cadda7bb40a77dc9fd1b85798e20d92195 Author: Kent Overstreet Date: Sat Jul 10 13:44:42 2021 -0400 bcachefs: Update btree ptrs after every write This closes a significant hole (and last known hole) in our ability to verify metadata. Previously, since btree nodes are log structured, we couldn't detect lost btree writes that weren't the first write to a given node. Additionally, this seems to have lead to some significant metadata corruption on multi device filesystems with metadata replication: since a write may have made it to one device and not another, if we read that btree node back from the replica that did have that write and started appending after that point, the other replica would have a gap in the bset entries and reading from that replica wouldn't find the rest of the bsets. But, since updates to interior btree nodes are now journalled, we can close this hole by updating pointers to btree nodes after every write with the currently written number of sectors, without negatively affecting performance. This means we will always detect lost or corrupt metadata - it also means that our btree is now a curious hybrid of COW and non COW btrees, with all the benefits of both (excluding complexity). Signed-off-by: Kent Overstreet commit f8f86c6aec1ecb21839933ff3615dcd219ef026f Author: Kent Overstreet Date: Thu Jul 15 13:42:43 2021 -0400 bcachefs: Improve btree_bad_header() error message We should always print out the full btree node ptr. Signed-off-by: Kent Overstreet commit eb7f44db8da087e571f82eb7a8b9d9336bee60f1 Author: Kent Overstreet Date: Wed Jul 14 21:25:55 2021 -0400 bcachefs: Fixes for unit tests The unit tests hadn't been updated for various recent btree changes - this patch makes them work again. Signed-off-by: Kent Overstreet commit 71f892a48239a7ec025fdd7f88d252823fe9bff4 Author: Kent Overstreet Date: Wed Jul 14 23:35:11 2021 -0400 bcachefs: Fix bch2_btree_iter_rewind() We'd hit a BUG() when rewinding at the start of the btree on btrees with snapshots. Signed-off-by: Kent Overstreet commit 914f2786b8923232eb925fe75cb7d0b0b3788d91 Author: Kent Overstreet Date: Wed Jul 14 20:28:27 2021 -0400 bcachefs: Improvements to fsck check_dirents() The fsck code handles transaction restarts in a very ad hoc way, and not always correctly. This patch makes some improvements to check_dirents(), but more work needs to be done to figure out how this kind of code should be structured. Signed-off-by: Kent Overstreet commit 5aab66353423f6398975ed9d7174f58628f6eb19 Author: Kent Overstreet Date: Wed Jul 14 15:13:27 2021 -0400 bcachefs: Tighten up btree_iter locking assertions We weren't correctly verifying that we had interior node intent locks - this patch also fixes bugs uncovered by the new assertions. Signed-off-by: Kent Overstreet commit 5468f1195dcfb9256b46484822dde31c9ec0af1e Author: Kent Overstreet Date: Wed Jul 14 00:14:45 2021 -0400 bcachefs: Fix a memory leak in the dio write path There were some error paths where we were leaking page refs - oops. Signed-off-by: Kent Overstreet commit 996fb577fdff69b1e5a72d7ca0f152ff7bb42bc8 Author: Kent Overstreet Date: Sun Jun 13 17:07:18 2021 -0400 bcachefs: Add an option for whether inodes use the key cache We probably don't ever want to flip this off in production, but it may be useful for certain kinds of testing. Signed-off-by: Kent Overstreet commit 9f6e1f7bb0e136871159a71d2bcd31c5dd8cbe81 Author: Kent Overstreet Date: Tue Jul 13 16:12:00 2021 -0400 bcachefs: Fix an allocator shutdown deadlock On fstest generic/388, we were seeing sporadic deadlocks in the emergency shutdown, where we'd get stuck shutting down the allocator because bch2_btree_update_start() -> bch2_btree_reserve_get() allocated and then deallocated some btree nodes, putting them back on the btree_reserve_cache, after the allocator shutdown code had already cleared out that cache. Signed-off-by: Kent Overstreet commit 8d3445878166ea726bc24326003ea7b9739cdc00 Author: Kent Overstreet Date: Tue Jul 13 16:03:51 2021 -0400 bcachefs: Add safe versions of varint encode/decode This adds safe versions of bch2_varint_(encode|decode) that don't read or write past the end of the buffer, or varint being encoded. Signed-off-by: Kent Overstreet commit 2e655e6de202d891f0232cfd3c56b8f8c176cf99 Author: Kent Overstreet Date: Mon Jul 12 23:52:49 2021 -0400 bcachefs: Add open_buckets to sysfs This is to help debug a rare shutdown deadlock in the allocator code - the btree code is leaking open_buckets. Signed-off-by: Kent Overstreet commit 003e738d4f0f61a8711ce41a03d8fb01a1cd7733 Author: Kent Overstreet Date: Mon Jul 12 23:17:15 2021 -0400 bcachefs: Ensure bad d_type doesn't oops in bch2_dirent_to_text() Signed-off-by: Kent Overstreet commit 0a70089062c63b0861217d9ffb76d3ac073d3fde Author: Kent Overstreet Date: Sun Jul 11 16:41:14 2021 -0400 bcachefs: Kick off btree node writes from write completions This is a performance improvement by removing the need to wait for the in flight btree write to complete before kicking one off, which is going to be needed to avoid a performance regression with the upcoming patch to update btree ptrs after every btree write. Signed-off-by: Kent Overstreet commit 2680325b7803c336bb675addfe38c06c44e54273 Author: Kent Overstreet Date: Sun Jul 11 13:54:07 2021 -0400 bcachefs: Mask out unknown compat features when going read-write Compat features should be cleared if the filesystem was touched by a version that doesn't support them. Signed-off-by: Kent Overstreet commit 19d5432445fd0898231063518c375f7551d7c3d2 Author: Kent Overstreet Date: Sat Jul 10 23:03:15 2021 -0400 bcachefs: Really don't hold btree locks while btree IOs are in flight This is something we've attempted to stick to for quite some time, as it helps guarantee filesystem latency - but there's a few remaining paths that this patch fixes. This is also necessary for an upcoming patch to update btree pointers after every btree write - since the btree write completion path will now be doing btree operations. Signed-off-by: Kent Overstreet commit e3a67bdb6e3ab6a6850c546a3772998fe5242069 Author: Kent Overstreet Date: Sat Jul 10 23:22:06 2021 -0400 bcachefs: Regularize argument passing of btree_trans btree_trans should always be passed when we have one - iter->trans is disfavoured. This mainly updates old code in btree_update_interior.c, some of which predates btree_trans. Signed-off-by: Kent Overstreet commit d38494c462b457d1d4b551b0a84425f5d1d19606 Author: Dan Robertson Date: Wed Jul 7 22:31:36 2021 -0400 bcachefs: docs: add docs for bch2_trans_reset Add basic kernel docs for bch2_trans_reset and bch2_trans_begin. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit f0412b6e44bba6dc6f36feab560c4d325f9f021e Author: Dan Robertson Date: Thu Jul 8 18:15:38 2021 -0400 bcachefs: set disk state should check new_state A new device state that is not a valid state should return -EINVAL in the disk set state ioctl. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit b00fde8fb1e7271a4c07ed89249a115ccea96cc3 Author: Kent Overstreet Date: Mon Jul 5 22:16:02 2021 -0400 bcachefs: BTREE_UPDATE_INTERNAL_SNAPSHOT_NODE Add a new flag to control assertions about updating to internal snapshot nodes, that normally should not be written to - to be used in an upcoming patch. Also do some renaming - trigger_flags is now update_flags. Signed-off-by: Kent Overstreet commit d5bee8ca5a118f352dc81f2452ac41dcaf5100c5 Author: Kent Overstreet Date: Mon Jul 5 22:18:07 2021 -0400 bcachefs: bch2_d_types[] Add readable names for d_type, and use it in dirent_to_text(). Signed-off-by: Kent Overstreet commit c21affdd06661c8eb73c71fc54cdb8ec921b968f Author: Kent Overstreet Date: Mon Jul 5 22:08:28 2021 -0400 bcachefs: Fix bch2_btree_iter_peek_slot() assertion This assertion is checking that what the iterator points to is consistent with iter->real_pos, and since it's an internal btree ordering property it should be using bpos_cmp. Signed-off-by: Kent Overstreet commit 618b1c0e20ac7bccebba0346ab1e1403fadd6aa0 Author: Kent Overstreet Date: Mon Jul 5 22:02:07 2021 -0400 bcachefs: Split out SPOS_MAX Internal btree code really wants a POS_MAX with all fields ~0; external code more likely wants the snapshot field to be 0, because when we're passing it to bch2_trans_get_iter() it's used for the snapshot we're operating in, which should be 0 for most btrees that don't use snapshots. Signed-off-by: Kent Overstreet commit 41e633826a1418f3b492d9137d395289e6e67d15 Author: jpsollie Date: Thu Jun 17 13:42:09 2021 +0200 bcachefs: add bcachefs xxhash support xxhash is a much faster algorithm compared to crc32. could be used to speed up checksum calculation. xxhash 64-bit only, as it is much faster on 64-bit CPUs compared to xxh32. Signed-off-by: jpsollie Signed-off-by: Kent Overstreet commit 80ff5d18ee975f201c8913be066ebedf887003f9 Author: jpsollie Date: Thu Jun 17 11:29:59 2021 +0200 bcachefs: Prepare checksums for more advanced algorithms Perform abstraction of hash calculation for advanced checksum algorithms. Algorithms like xxhash do not store their state as a u64 int. Signed-off-by: jpsollie Signed-off-by: Kent Overstreet commit a515d0a50c6e8bb9b8ce58d6e396b4c5eeea6905 Author: Tobias Geerinckx-Rice Date: Sun Jul 4 21:35:32 2021 +0200 bcachefs: Enforce SYS_CAP_ADMIN within ioctls bch2_fs_ioctl() didn't distinguish between unsupported ioctls and those which the current user is unauthorised to perform. That kept the code simple but meant that, for example, an unprivileged TIOCGWINSZ ioctl on a bcachefs file would return -EPERM instead of the expected -ENOTTY. The same call made by a privileged user would correctly return -ENOTTY. Fix this discrepancy by moving the check for CAP_SYS_ADMIN into each privileged ioctl function. Signed-off-by: Tobias Geerinckx-Rice Signed-off-by: Kent Overstreet commit 508b1f71396486648e3d42d1814e7f148fbb7751 Author: Kent Overstreet Date: Sat Jul 3 23:57:09 2021 -0400 bcachefs: Fix bch2_btree_iter_peek_prev() In !BTREE_ITER_IS_EXTENTS mode, we shouldn't be looking at k->size, i.e. we shouldn't use bkey_start_pos(). Signed-off-by: Kent Overstreet commit 31029f2f70e6abc833ceefb0f32adf4e7bf42235 Author: Dan Robertson Date: Wed Jun 23 21:52:41 2021 -0400 bcachefs: Fix bch2_acl_chmod() cleanup on error Avoid calling kfree on the returned error pointer if bch2_acl_from_disk fails. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit e8e9607f3c1bb927002b7582b68d36c7eb3e92e2 Author: Dan Robertson Date: Wed Jun 23 19:25:00 2021 -0400 bcachefs: statfs bfree and bavail should be the same The value of f_bfree and f_bavail should be the same. The value of f_bfree is not currently scaled by the availability factor. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit fdc6b08451167bfc1ae260b252ad2bf2f9735f50 Author: Kent Overstreet Date: Thu Jun 24 13:19:25 2021 -0400 bcachefs: Fix shift-by-64 in bch2_bkey_format_validate() We need to ensure that packed formats can't represent fields larger than the unpacked format, which is a bit tricky since the calculations can also overflow a u64. This patch fixes a shift and simplifies the overall calculations. Signed-off-by: Kent Overstreet commit 78d66ab1ca541ba95a9ad89780466398b348c230 Author: Dan Robertson Date: Sun Jun 27 20:54:34 2021 -0400 bcachefs: fix truncate without a size change Do not attempt to shortcut a truncate when the given new size is the same as the current size. There may be blocks allocated to the file that extend beyond the i_size. The ctime and mtime should not be updated in this case. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit 6f152b0f375450b72724b6eb2ec00f7669fc910e Author: Dan Robertson Date: Fri Jul 2 21:22:06 2021 -0400 bcachefs: fix ifdef for x86_64 asm The implementation of prefetch_four_cachelines should use ifdef CONFIG_X86_64 to conditionally compile x86_64 asm. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit 32abe2e38f5da39a79561b8e42f22062171c798d Author: Dan Robertson Date: Tue Jun 29 18:52:13 2021 -0400 bcachefs: ensure iter->should_be_locked is set Ensure that iter->should_be_locked is set to true before we call bch2_trans_update in __bch2_dev_usrdata_drop. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit 729608a606fdef3dc97762081442d7b4a40d16a4 Author: Christopher James Halse Rogers Date: Fri Jun 25 11:45:19 2021 +1000 bcachefs: Fix unused variable warning when !BCACHEFS_DEBUG Signed-off-by: Christopher James Halse Rogers Signed-off-by: Kent Overstreet commit 077ed08ec7edbcf0bfcadfa01260a5b0cb4ed4db Author: Kent Overstreet Date: Wed Jun 30 15:44:11 2021 -0400 bcachefs: Use memalloc_nofs_save() in bch2_read_endio() This solves a problematic memory allocation in bch2_bio_uncompress() -> vmap(). Signed-off-by: Kent Overstreet commit 50ad5d097977dc5c688e7a1a6dc2e74c37da5adf Author: Kent Overstreet Date: Tue Jun 22 21:51:17 2021 -0400 bcachefs: Fix btree_node_read_all_replicas() error handling We weren't checking bch2_btree_node_read_done() for errors, oops. Signed-off-by: Kent Overstreet commit d976a84e3b486b04314dcf5183af3123549cda95 Author: Kent Overstreet Date: Tue Jun 22 20:44:54 2021 -0400 bcachefs: Don't loop into topology repair Signed-off-by: Kent Overstreet commit 0806151913dff8547aae3713c1f793eb5d702b96 Author: Kent Overstreet Date: Mon Jun 21 16:28:43 2021 -0400 bcachefs: Don't ratelimit certain fsck errors It's unhelpful if we see "Halting mark and sweep to start topology repair" but we don't see the error that triggered it. Signed-off-by: Kent Overstreet commit 33a1f84b76b94a64cc8244b176567257170c6695 Author: Dan Robertson Date: Wed Jun 16 23:21:23 2021 -0400 bcachefs: ensure iter->should_be_locked is set Ensure that iter->should_be_locked value is set to true before we call bch2_trans_update in ec_stripe_update_ptrs. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit 109a4277124ca1a0ff670b519315c4f381c83ad3 Author: Kent Overstreet Date: Thu Jun 10 23:34:02 2021 -0400 bcachefs: Don't disable preemption unnecessarily Small improvements to some percpu utility code. Signed-off-by: Kent Overstreet commit 297d89343dd9be32878a747c53d3477c986a01b6 Author: Kent Overstreet Date: Thu Jun 10 21:44:27 2021 -0400 bcachefs: Extensive triggers cleanups - We no longer mark subsets of extents, they're marked like regular keys now - which means we can drop the offset & sectors arguments to trigger functions - Drop other arguments that are no longer needed anymore in various places - fs_usage - Drop the logic for handling extents in bch2_mark_update() that isn't needed anymore, to match bch2_trans_mark_update() - Better logic for hanlding the BTREE_ITER_CACHED_NOFILL case, where we don't have an old key to mark Signed-off-by: Kent Overstreet commit 68a507a2e8cdc9b90599bb5d220a696abdc54838 Author: Kent Overstreet Date: Mon Jun 14 22:29:54 2021 -0400 bcachefs: fix truncate with ATTR_MODE After the v5.12 rebase, we started oopsing when truncate was passed ATTR_MODE, due to not passing mnt_userns to setattr_copy(). This refactors things so that truncate/extend finish by using bch2_setattr_nonsize(), which solves the problem. Signed-off-by: Kent Overstreet commit 8c3f6da9fc526e7ba0f6449efa1040084406e9ba Author: Kent Overstreet Date: Mon Jun 14 18:16:10 2021 -0400 bcachefs: Improve iter->should_be_locked Adding iter->should_be_locked introduced a regression where it ended up not being set on the iterator passed to bch2_btree_update_start(), which is definitely not what we want. This patch requires it to be set when calling bch2_trans_update(), and adds various fixups to make that happen. Signed-off-by: Kent Overstreet commit b89726ab86aab15ea8526fb365da6a0f5d474241 Author: Kent Overstreet Date: Mon Jun 14 16:35:03 2021 -0400 bcachefs: Kill __btree_delete_at() With trans->updates2 gone, we can now drop this helper and use bch2_btree_delete_at() instead. Signed-off-by: Kent Overstreet commit 8ee529e9c16b9c72293794f441270e954a9c6508 Author: Kent Overstreet Date: Mon Jun 14 16:32:44 2021 -0400 bcachefs: Make sure bch2_trans_mark_update uses correct iter flags Now that bch2_btree_iter_peek_with_updates() has been removed in favor of BTREE_ITER_WITH_UPDATES, we need to make sure it's not used where we don't want it. Signed-off-by: Kent Overstreet commit 2ed5cd508d0b893ded6a1ba586f7c6cd7a95cc36 Author: Kent Overstreet Date: Mon Jun 14 14:47:26 2021 -0400 bcachefs: Fix a memory leak in dio write path Commit c42bca92be928ce7dece5fc04cf68d0e37ee6718 "bio: don't copy bvec for direct IO" changed bio_iov_iter_get_pages() to point bio->bi_iovec at the incoming biovec, meaning if we already allocated one, it'll be leaked. Signed-off-by: Kent Overstreet commit 120f63e321fa9fdb1837dd64fcd50e2b144b0d6d Author: Janpieter Sollie Date: Sun Jun 13 22:01:08 2021 +0200 bcachefs: fix a possible bcachefs checksum mapping error opt-checksum enum to type-checksum enum This fixes some rare cases where the metadata checksum option specified may map to the wrong actual checksum type. Signed-off-by: Janpieter Sollie Signed-off-by: Kent Overstreet commit bb6bbf4a06c57c064a95a8b0c7a9b0746187170a Author: Kent Overstreet Date: Sat Jun 12 22:33:53 2021 -0400 bcachefs: Clear iter->should_be_locked in bch2_trans_reset Signed-off-by: Kent Overstreet commit 290448ed2e0ac1165d2dd7a37da8b1e58e69bc08 Author: Kent Overstreet Date: Thu Jun 10 23:33:27 2021 -0400 bcachefs: Don't underflow c->sectors_available This rarely used error path should've been checking for underflow - oops. Signed-off-by: Kent Overstreet commit 953ee28a3ee4672455aa13f805c81c96a08ceded Author: Kent Overstreet Date: Thu Jun 10 20:15:50 2021 -0400 bcachefs: Kill bch2_btree_iter_peek_cached() It's now been rolled into bch2_btree_iter_peek_slot() Signed-off-by: Kent Overstreet commit 45c2e33f791a6c5ebae0accdbfbfef4720701339 Author: Kent Overstreet Date: Sat Jun 12 17:20:02 2021 -0400 bcachefs: Allow shorter JSET_ENTRY_dev_usage entries If the last entry(ies) would be all zeros, there's no need to write them out - the read path already handles that. Signed-off-by: Kent Overstreet commit 044c8c9e05bc87cdc610eb320e8fdc694f3866df Author: Dan Robertson Date: Thu Jun 10 07:52:42 2021 -0400 bcachefs: mount: fix null deref with null devname - Fix null deref on mount when given a null device name. - Move the dev_name checks to return EINVAL when it is invalid. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit a49e9a0589d1828af787bacf0a1e18eca7facb88 Author: Kent Overstreet Date: Sat Jun 12 15:45:56 2021 -0400 bcachefs: Fix null ptr deref when splitting compressed extents Signed-off-by: Kent Overstreet commit 90d22a660a4ed5e1500602f15edcb91ab38a1e7c Author: Kent Overstreet Date: Thu Jun 10 23:51:09 2021 -0400 bcachefs: Fix overflow in journal_replay_entry_early If filesystem on disk was used by a version with a larger BCH_DATA_NR thas the currently running version, we don't want this to cause a buffer overrun. Signed-off-by: Kent Overstreet commit 7ed158f2949a3c142b2be9a0bc67775cb69b9df5 Author: Kent Overstreet Date: Mon Jun 7 16:50:30 2021 -0400 bcachefs: Always zero memory from bch2_trans_kmalloc() Signed-off-by: Kent Overstreet commit b058ac20916c9bfbcd5b9caa356bd95269d5c78c Author: Kent Overstreet Date: Sat May 15 15:04:08 2021 -0400 bcachefs: Merging for indirect extents Signed-off-by: Kent Overstreet commit c2177e4da332df6fb91b08b874a79051f13897bc Author: Kent Overstreet Date: Sat May 15 00:37:37 2021 -0400 bcachefs: Improved extent merging Previously, checksummed extents could only be merged when the checksum covered only the currently live data. xfstest generic/064 creates a test file, then uses finsert calls to split the extent, then collapse calls to see if they get merged. But without any reads to trigger the narrow_crcs path, each of the split extents will still have a checksum for the entire original extent. This patch improves the extent merge path so that if either of the extents we're attempting to merge has a checksum that covers the entire merged extent, we just use that checksum. Signed-off-by: Kent Overstreet commit 5db95e50e11bdd0a191a22fdbc1e68ec900aff89 Author: Kent Overstreet Date: Wed Apr 28 23:52:19 2021 -0400 bcachefs: Re-implement extent merging in transaction commit path We haven't had extent merging in quite some time. It used to be done by the btree code when sorting btree nodes, but that was eliminated as part of the work to separate extent handling from core btree code. This patch re-implements extent merging in the transaction commit path. We don't currently have the ability to merge reflink pointers, we need to do some work on the triggers code to be able to do that without ending up with incorrect refcounts. Signed-off-by: Kent Overstreet commit 81d22e5d832452ee479c64d5678c7422bc1bef5b Author: Kent Overstreet Date: Wed Apr 28 23:52:19 2021 -0400 bcachefs: Refactor extent_handle_overwrites() Prep work for extent merging Signed-off-by: Kent Overstreet commit 59ba21d99fc7a19d32fc4c2cb21509b8876d8e01 Author: Kent Overstreet Date: Wed Apr 28 23:49:30 2021 -0400 bcachefs: Clean up key merging This patch simplifies the key merging code by getting rid of partial merges - it's simpler and saner if we just don't merge extents when they'd overflow k->size. Signed-off-by: Kent Overstreet commit cd8319fdd91a600594b2edb6c6eed65dc74354c8 Author: Kent Overstreet Date: Mon Jun 7 14:54:56 2021 -0400 bcachefs: Kill trans->updates2 Now that extent handling has been lifted to bch2_trans_update(), we don't need to keep two different lists of updates. Signed-off-by: Kent Overstreet commit c1949baa51cb2794bf3be8f092f0f43a7ca0904b Author: Kent Overstreet Date: Mon Jun 7 13:39:21 2021 -0400 bcachefs: Simplify reflink trigger Now that we only mark entire extents, we can ditch the "reflink_p_frag_references" code. Signed-off-by: Kent Overstreet commit 8e6bbc4181c9eb1bc8dcb0a96522447c6b6ad76e Author: Kent Overstreet Date: Wed Jun 2 00:18:34 2021 -0400 bcachefs: Move extent_handle_overwrites() to bch2_trans_update() This lifts handling of overlapping extents out of __bch2_trans_commit() and moves it to where we first do the update - which means that BTREE_ITER_WITH_UPDATES can now work correctly in extents mode. Also, this patch reworks how extent triggers work: previously, on partial extent overwrite we would pass this information to the trigger, telling it what part of the extent was being overwritten. But, this approach has had too many subtle corner cases - now, we only mark whole extents, meaning on partial extent overwrite we unmark the old extent and mark the new extent. Signed-off-by: Kent Overstreet commit b1d87f527d7e6eb89395d4a0218b7e4e3974ff1b Author: Kent Overstreet Date: Fri Dec 30 19:15:53 2022 -0500 bcachefs: bch2_btree_iter_peek_slot() now saves initial position when searching Signed-off-by: Kent Overstreet commit 1d214eb18d6670e3b0415340df0a68b47ca6e5fc Author: Kent Overstreet Date: Fri Dec 30 19:15:53 2022 -0500 bcachefs: Kill __bch2_btree_iter_peek_slot_extents() This codepath won't just be for extents in the future, it'll also be for BTREE_ITER_FILTER_SNAPSHOTS mode. Signed-off-by: Kent Overstreet commit e750296bf5599b748360b3497bcfc7243dceb185 Author: Kent Overstreet Date: Fri Dec 30 22:41:38 2022 -0500 bcachefs: bch2_btree_iter_peek_slot() now supports BTREE_ITER_WITH_UPDATES Signed-off-by: Kent Overstreet commit 5288e66a7b732aae8a905ddba86b3b65acb6a911 Author: Kent Overstreet Date: Fri Jun 4 00:29:49 2021 -0400 bcachefs: BTREE_ITER_WITH_UPDATES This drops bch2_btree_iter_peek_with_updates() and replaces it with a new flag, BTREE_ITER_WITH_UPDATES, and also reworks bch2_btree_iter_peek_slot() to respect it too. Signed-off-by: Kent Overstreet commit 509d3e0a8dc9714ca9ac2477f188eced3bc4a205 Author: Kent Overstreet Date: Sat Mar 20 15:12:05 2021 -0400 bcachefs: Child btree iterators This adds the ability for btree iterators to own child iterators - to be used by an upcoming rework of bch2_btree_iter_peek_slot(), so we can scan forwards while maintaining our current position. Signed-off-by: Kent Overstreet commit c205321b12058afc757a5a41352b5042a27b7223 Author: Kent Overstreet Date: Thu Apr 8 22:26:53 2021 -0400 bcachefs: Drop all btree locks when submitting btree node reads As a rule we don't want to be holding btree locks while submitting IO - this will improve overall filesystem latency. Signed-off-by: Kent Overstreet commit 4351d3ecb4a2d0c7165b3b72bc4bd1c02371685d Author: Kent Overstreet Date: Mon Jun 7 13:28:50 2021 -0400 bcachefs: More topology repair code This improves the handling of overlapping btree nodes; now, we handle the case where one btree node completely overwrites another. Signed-off-by: Kent Overstreet commit 74cc1abdbf50fcdaedf4bcf9a800c575ec44e17a Author: Kent Overstreet Date: Thu Jun 10 13:21:39 2021 -0400 bcachefs: Fix a buffer overrun In make_extent_indirect(), we were allocating too small of a buffer for the new indirect extent. Signed-off-by: Kent Overstreet commit 224ec3e677ca82eb4216a0916ce7b04f401e90e7 Author: Kent Overstreet Date: Tue Jun 8 22:50:30 2021 -0400 bcachefs: Don't mark superblocks past end of usable space bcachefs-tools recently started putting a backup superblock at the end of the device. This causes a problem if the bucket size doesn't divide the device size - but we can fix it by just skipping marking that part. Signed-off-by: Kent Overstreet commit 7138f220973307d4f130eec33e4cb3f571a0f413 Author: Kent Overstreet Date: Tue Jun 8 16:29:24 2021 -0400 bcachefs: Fix a spurious debug mode assertion When we switched to using bch2_btree_bset_insert_key() for extents it turned out it started leaving invalid keys around - of type deleted but nonzero size - but this is fine (if ugly) because they're never written out. Signed-off-by: Kent Overstreet commit ca47fa236278312e1931b303416a79863f80936b Author: Brett Holman Date: Sun Jun 6 09:29:42 2021 -0600 bcachefs: Fix unitialized use of a value Signed-off-by: Brett Holman Signed-off-by: Kent Overstreet commit 59e2480ff7360b5c6ecd418aee795a7087a3e8f6 Author: Dan Robertson Date: Sat Jun 5 19:03:16 2021 -0400 bcachefs: do not compile acl mod on minimal config Do not compile the acl.o target if BCACHEFS_POSIX_ACL is not enabled. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit 66a0a49750d77926a6d4b47d7ac1f4904094fb7e Author: Kent Overstreet Date: Fri Jun 4 17:17:45 2021 -0400 bcachefs: btree_iter->should_be_locked Add a field to struct btree_iter for tracking whether it should be locked - this fixes spurious transaction restarts in bch2_trans_relock(). Signed-off-by: Kent Overstreet commit 531a0095c958d258ee0c336851acd2bdb642b967 Author: Kent Overstreet Date: Fri Jun 4 15:18:10 2021 -0400 bcachefs: Improve btree iterator tracepoints This patch adds some new tracepoints to the btree iterator code, and adds new fields to the existing tracepoints - primarily for the iterator position. Signed-off-by: Kent Overstreet commit f7beb4ca04521f26d9ac2e9bee1bfbf99c55fabb Author: Kent Overstreet Date: Wed Jun 2 23:31:42 2021 -0400 bcachefs: Preallocate transaction mem This helps avoid transaction restarts. Signed-off-by: Kent Overstreet commit bc3f8b25f3a4403d6e8c9067e6f0fc9cf23be6fe Author: Kent Overstreet Date: Wed Jun 2 00:15:07 2021 -0400 bcachefs: Check for errors from bch2_trans_update() Upcoming refactoring is going to change bch2_trans_update() to start returning transaction restarts. Signed-off-by: Kent Overstreet commit 01254036a326e0663eaeabb2eb3359c04caed2a0 Author: Kent Overstreet Date: Mon May 31 20:52:39 2021 -0400 bcachefs; Check for allocator thread shutdown We were missing a kthread_should_stop() check in the loop in bch2_invalidate_buckets(), very occasionally leading to us getting stuck while shutting down. Signed-off-by: Kent Overstreet commit d7fc453bdb012d5bc021e693896989fd5973823f Author: Kent Overstreet Date: Mon May 31 00:13:39 2021 -0400 bcachefs: Journal space calculation fix When devices have different bucket sizes, we may accumulate a journal write that doesn't fit on some of our devices - previously, we'd underflow when calculating space on that device and then everything would get weird. Signed-off-by: Kent Overstreet commit 649d9a4dfc834230b55c4ae34b60067d1d54c4d1 Author: Kent Overstreet Date: Sat Mar 20 22:14:10 2021 -0400 bcachefs: Don't fragment extents when making them indirect This fixes a "disk usage increased without a reservation" bug, when reflinking compressed extents. Also, there's no good reason for reflink to be fragmenting extents anyways. Signed-off-by: Kent Overstreet commit 890b74f03d70946e46f8169c94232fb717f46989 Author: Kent Overstreet Date: Sun May 23 02:31:33 2021 -0400 bcachefs: Fsck for reflink refcounts Signed-off-by: Kent Overstreet commit c0ebe3e48c75ab075eb1c67aef957109c67e1643 Author: Kent Overstreet Date: Sun May 23 17:04:13 2021 -0400 bcachefs: Assorted endianness fixes Found by sparse Signed-off-by: Kent Overstreet commit ee7570546e89ece9b56eaa22c94a6ec0941ec827 Author: Kent Overstreet Date: Sun Sep 10 23:33:08 2023 -0400 bcachefs: Fix a deadlock Waiting on a btree node write with btree locks held can deadlock, if the write errors: the write error path has to do do a btree update to drop the pointer to the replica that errored. The interior update path has to wait on in flight btree writes before freeing nodes on disk. Previously, this was done in bch2_btree_interior_update_will_free_node(), and could deadlock; now, we just stash a pointer to the node and do it in btree_update_nodes_written(), just prior to the transactional part of the update. Signed-off-by: Kent Overstreet commit 9f2772c45460e420de9a88980129bef135c6b76f Author: Kent Overstreet Date: Thu May 27 21:38:00 2021 -0400 bcachefs: Split out btree_error_wq We can't use btree_update_wq becuase btree updates may be waiting on btree writes to complete. Signed-off-by: Kent Overstreet commit bff796ae6539b50bb3fe595e8db7b72e3255a34d Author: Kent Overstreet Date: Fri May 28 05:06:18 2021 -0400 bcachefs: Fix pathalogical behaviour with inode sharding by cpu ID If the transactior restarts on a different CPU, it could end up needing to read in a different btree node, which makes another transaction restart more likely... Signed-off-by: Kent Overstreet commit d797ca3d8ed3b493d6558426fb4b4980ff186c37 Author: Kent Overstreet Date: Thu May 27 23:16:25 2021 -0400 bcachefs: Fix journal write error path Journal write errors were racing with the submission path - potentially causing writes to other replicas to not get submitted. Signed-off-by: Kent Overstreet commit 9eba7c8d15ce236b8033ae1f50fc1168984a507b Author: Kent Overstreet Date: Thu May 27 21:16:50 2021 -0400 bcachefs: Reflink refcount fix __bch2_trans_mark_reflink_p wasn't always correctly returning the number of sectors processed - the new logic is a bit more straightforward overall too. Signed-off-by: Kent Overstreet commit b282a74faebc9475355179aff40b98b5dbe0ae01 Author: Kent Overstreet Date: Thu May 27 20:20:20 2021 -0400 bcachefs: Add an option to control sharding new inode numbers We're seeing a bug where inode creates end up spinning in bch2_inode_create - disabling sharding will simplify what we're testing. Signed-off-by: Kent Overstreet commit 9f311f2166eb969dbe3d69ab24cd78567a30d62c Author: Kent Overstreet Date: Sat Oct 29 02:47:33 2022 -0400 bcachefs: Don't use bch_write_op->cl for delivering completions We already had op->end_io as an alternative mechanism to op->cl.parent for delivering write completions; this switches all code paths to using op->end_io. Two reasons: - op->end_io is more efficient, due to fewer atomic ops, this completes the conversion that was originally only done for the direct IO path. - We'll be restructing the write path to use a different mechanism for punting to process context, refactoring to not use op->cl will make that easier. Signed-off-by: Kent Overstreet commit af171183194f73cca9a2f44ba13907ecc9c761a9 Author: Kent Overstreet Date: Fri Oct 28 23:57:01 2022 -0400 bcachefs: Kill bch_write_op.index_update_fn This deletes bch_write_op.index_update_fn: indirect function calls have gotten considerably more expensive post spectre/meltdown, and we only have two different index_update_fns - this patch adds a flag to specify which one to use (normal vs. data move path). Signed-off-by: Kent Overstreet commit 7e94eeffe0e79a54e525ad05302eb454fb96affd Author: Kent Overstreet Date: Mon Oct 31 22:28:09 2022 -0400 bcachefs: Inline fastpath of bch2_disk_reservation_add() The fastpath now doesn't even disable preemption - instead we use a (non locked) cmpxchg. Signed-off-by: Kent Overstreet commit ddc7dd62f0971d5c46c155134c647e7d493b2045 Author: Kent Overstreet Date: Thu May 27 19:15:44 2021 -0400 bcachefs: Don't use uuid in tracepoints %pU for printing out pointers to uuids doesn't work in perf trace Signed-off-by: Kent Overstreet commit 19d2819d2d01bf46d0a12cafc532af0aab9b1cc1 Author: Kent Overstreet Date: Wed May 26 01:03:35 2021 -0400 bcachefs: Add a tracepoint for copygc waiting Signed-off-by: Kent Overstreet commit c4d4b2f01abd95af7c6dccf236e2760aef5a9b69 Author: Kent Overstreet Date: Tue May 25 18:42:05 2021 -0400 bcachefs: Add a cond_resched call to the copygc main loop We seem to have a bug where the copygc thread ends up spinning and making the system unusable - this will at least prevent it from locking up the machine, and it's a good thing to have anyways. Signed-off-by: Kent Overstreet commit 443d2760e51f3e17ddb47ddaf969ba49e6dbd06d Author: Kent Overstreet Date: Sun May 23 18:42:51 2021 -0400 bcachefs: Fix a null ptr deref bch2_btree_iter_peek() won't always return a key - whoops. Signed-off-by: Kent Overstreet commit 9dd89a05fd946869c23e12fcfb9b9643b337fd56 Author: Kent Overstreet Date: Sat May 22 21:43:20 2021 -0400 bcachefs: Fix an issue with inconsistent btree writes after unclean shutdown After unclean shutdown, btree writes may have completed on one device and not others - and this inconsistency could lead us to writing new bsets with a gap in our btree node in one of our replicas. Fortunately, this is only an issue with bsets that are newer than the most recent journal flush, and we already have a mechanism for detecting and blacklisting those. We just need to make sure to start new btree writes after the most recent _non_ blacklisted bset. Signed-off-by: Kent Overstreet commit 4495cbed568b074c8fbd9a3b761176d38a4955e3 Author: Kent Overstreet Date: Sat May 22 21:13:17 2021 -0400 bcachefs: Improve FS_IOC_GOINGDOWN ioctl We weren't interpreting the flags argument at all. Signed-off-by: Kent Overstreet commit 731bdd2eff41808ded960fbe62a83672904e1600 Author: Kent Overstreet Date: Sat May 22 17:37:25 2021 -0400 bcachefs: Add a workqueue for btree io completions Also, clean up workqueue usage - we shouldn't be using system workqueues, pretty much everything we do needs to be on our own WQ_MEM_RECLAIM workqueues. Signed-off-by: Kent Overstreet commit 2eba51a69a7aba82bd4639a71b0906be7e23ca5c Author: Brett Holman Date: Fri May 21 16:45:38 2021 -0600 bcachefs: rewrote prefetch asm in gas syntax for clang compatibility Signed-off-by: Brett Holman Signed-off-by: Kent Overstreet commit 1ce0cf5fe9300f28e834e6fa001cc5a114cd0493 Author: Kent Overstreet Date: Fri May 21 23:57:37 2021 -0400 bcachefs: Add a debug mode that always reads from every btree replica There's a new module parameter, verify_all_btree_replicas, that enables reading from every btree replica when reading in btree nodes and comparing them against each other. We've been seeing some strange btree corruption - this will hopefully aid in tracking it down and catching it more often. Signed-off-by: Kent Overstreet commit 596d3bdc1e749c63e4defc6abbe2552d035e4470 Author: Kent Overstreet Date: Fri May 21 16:06:54 2021 -0400 bcachefs: Don't repair btree nodes until after interior journal replay is done We need the btree to be in a consistent state before we can rewrite btree nodes. Signed-off-by: Kent Overstreet commit 304b7e08c72ee20f315142047ee4e133102ab911 Author: Kent Overstreet Date: Thu May 20 20:47:27 2021 -0400 bcachefs: Fix an uninitialized var this fixes a valgrind complaint Signed-off-by: Kent Overstreet commit a6336910b1c30703fe0d5078ef1c656ea1d39096 Author: Kent Overstreet Date: Thu May 20 15:49:23 2021 -0400 bcachefs: Fix for buffered writes getting -ENOSPC Buffered writes may have to increase their disk reservation at btree update time, due to compression and erasure coding being unpredictable: O_DIRECT writes should be checking for -ENOSPC, but buffered writes have already been accepted and should not. Signed-off-by: Kent Overstreet commit 16ac8c9523a2744545bb773b41433a5007deeacb Author: Kent Overstreet Date: Thu May 20 00:09:47 2021 -0400 bcachefs: Fix inode backpointers in RENAME_OVERWRITE When we delete the dirent an inode points to, we need to zero out the backpointer fields - this was missed in the RENAME_OVERWRITE case. Signed-off-by: Kent Overstreet commit e7084c9c8151b226c83258ccdccf172b74688324 Author: Kent Overstreet Date: Wed May 19 21:21:49 2021 -0400 bcachefs: Make bch2_remap_range respect O_SYNC Caught by xfstest generic/628 Signed-off-by: Kent Overstreet commit d6462f494dcf57422f36f9c4704c2c128354f6c4 Author: Kent Overstreet Date: Tue May 18 23:17:03 2021 -0400 bcachefs: Split extents if necessary in bch2_trans_update() Currently, we handle multiple overlapping extents in the same transaction commit by doing fixups in bch2_trans_update() - this patch extents that to split updates when necessary. The next patch that changes the reflink code to not fragment extents when making them indirect will require this. Signed-off-by: Kent Overstreet commit ef1b20924b0f584740094fdf7166acfb80338f0c Author: Kent Overstreet Date: Tue May 18 23:53:43 2021 -0400 bcachefs: Ratelimiting for writeback IOs Writeback throttling is a kernel config option and not always enabled. When it's not enabled we need a fallback, to avoid unbounded memory pinning and work item backlogs. Signed-off-by: Kent Overstreet commit ed34341189478344eb54588ce73f190b86da4d5e Author: Dan Robertson Date: Tue May 18 20:36:20 2021 -0400 bcachefs: statfs resports incorrect avail blocks The current implementation of bch_statfs does not scale the number of available blocks provided in f_bavail by the reserve factor. This causes an allocation of a file of this size to fail. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit c21d5377791d94fca0d990eee82111572412640c Author: Kent Overstreet Date: Mon May 17 16:43:30 2021 -0400 bcachefs: Fix for bch2_bkey_pack_pos() not initializing len/version fields This bug led to push_whiteout() generating whiteouts that failed bch2_bkey_invalid() due to nonzero length fields - oops. Signed-off-by: Kent Overstreet commit 82355e2882339067e1d6deaec68e629f63259c0d Author: Kent Overstreet Date: Mon May 17 16:10:06 2021 -0400 bcachefs: Fix a memcpy call Not supposed to pass a null ptr to memcpy (even if the size is 0). Signed-off-by: Kent Overstreet commit bbfcb4519d61cdd83d1f9741e4f8525c0ffa8a8a Author: Kent Overstreet Date: Mon May 17 00:28:50 2021 -0400 bcachefs: Fix bch2_extent_can_insert() call It was being skipped when hole punching, leading to problems when splitting compressed extents. Signed-off-by: Kent Overstreet commit 2e8f9d23cbc75a1d45506186da8c7a5c1605b622 Author: Kent Overstreet Date: Mon May 17 00:08:06 2021 -0400 bcachefs: Make sure to pass a disk reservation to bch2_extent_update() It's needed when we split an existing compressed extent - we get a null ptr deref without it. Signed-off-by: Kent Overstreet commit 2cd0563461b68b895bd683e89ad70f3975e98e85 Author: Brett Holman Date: Sun May 16 21:53:55 2021 -0600 bcachefs: made changes to support clang, fixed a couple bugs fs/bcachefs/bset.c edited prefetch macro to add clang support fs/bcachefs/btree_iter.c bugfix: initialize iter->real_pos in bch2_btree_iter_init for later use fs/bcachefs/io.c bugfix: eliminated undefined behavior (negative bitshift) fs/bcachefs/buckets.c bugfix: invert sign to handle 64bit abs() Signed-off-by: Brett Holman Signed-off-by: Kent Overstreet commit 6ebe32b94c77f80aca235e476bad321ecc355035 Author: Kent Overstreet Date: Sun May 16 23:46:08 2021 -0400 bcachefs: Fix locking in __bch2_set_nr_journal_buckets() We weren't holding mark_lock correctly - it's needed for the new_fs path. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d125615a4e22194dff9cecd12ec5a608f8c0f920 Author: Dan Robertson Date: Fri May 14 20:02:44 2021 -0400 bcachefs: properly initialize used values - Ensure the second key value in bch_hash_info is initialized to zero if the info type is of type BCH_STR_HASH_SIPHASH. - Initialize the possibly returned value in bch2_inode_create. Assuming bch2_btree_iter_peek returns bkey_s_c_null, the uninitialized value of ret could be returned to the user as an error pointer. - Fix compiler warning in initialization of bkey_s_c_stripe fs/bcachefs/buckets.c:1646:35: warning: suggest braces around initialization of subobject [-Wmissing-braces] struct bkey_s_c_stripe new_s = { NULL }; ^~~~ Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit e1036ce5810222620c98660d64ccc649652cf6c9 Author: Kent Overstreet Date: Fri May 14 21:28:37 2021 -0400 bcachefs: Repair code for multiple types of data in same bucket bch2_check_fix_ptrs() is awkward, we need to find a way to improve it. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit faf1a5f41772984d492f9805ded9a34dcdce724d Author: Dan Robertson Date: Wed May 5 07:09:43 2021 -0400 bcachefs: Fix out of bounds read in fs usage ioctl Fix a possible read out of bounds if bch2_ioctl_fs_usage is called when replica_entries_bytes is set to a value that is smaller than the size of bch_replicas_usage. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit 2b25de552f8a8d9cae5b54c83137c67e03ee1957 Author: Dan Robertson Date: Wed May 12 20:54:37 2021 -0400 bcachefs: Fix null deref in bch2_ioctl_read_super Do not attempt to cleanup the returned value of bch2_device_lookup if the returned value was an error pointer. We currently check to see if the returned value is null and run the cleanup otherwise. As a result, we attempt to run the cleanup on a error pointer. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit ec4ab9d2fc08132113dc5d45ac68af2158377122 Author: Dan Robertson Date: Wed May 12 14:07:57 2021 -0400 bcachefs: Fix possible null deref on mount Ensure that the block device pointer in a superblock handle is not null before dereferencing it in bch2_dev_to_fs. The block device pointer may be null when mounting a new bcachefs filesystem given another mounted bcachefs filesystem exists that has at least one device that is offline. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit baf056b87da88b0c9812d53f8b12072652d1c07b Author: Dan Robertson Date: Sun May 9 18:52:23 2021 -0400 bcachefs: Fix error in parsing of mount options When parsing the mount options duplicate the given options. This is required as the options are parsed twice and strsep is used in parsing. The options will be modified into a possibly invalid options set for the second round of parsing if the options are not duplicated before parsing. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit ffcf9ec78c133fb85ff13d8119ff404e11820834 Author: Stijn Tintel Date: Thu May 13 23:08:47 2021 +0300 bcachefs: avoid out-of-bounds in split_devs Calling mount with an empty source string causes an out-of-bounds error in split_devs. Check the length of the source string to avoid this. Signed-off-by: Stijn Tintel Signed-off-by: Kent Overstreet commit 909004d2f9f8d56997010eac3ae975e214ff9d0f Author: Kent Overstreet Date: Fri May 14 16:56:26 2021 -0400 bcachefs: Make sure to use BTREE_ITER_PREFETCH in fsck Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 360746bf6f7cae871a683e1718bedba6a29f10dc Author: Kent Overstreet Date: Thu Apr 29 21:44:05 2021 -0400 bcachefs: Fix bch2_btree_iter_peek_with_updates() By not re-fetching the next update we were going into an infinite loop. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 933532b8b25cd7b739f30d66a0e9fcc9e03d57ec Author: Kent Overstreet Date: Mon May 3 20:31:27 2021 -0400 bcachefs: Fix reflink trigger The trigger for reflink pointers wasn't always incrementing/decrementing the refcounts correctly - this patch fixes that logic. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3a402c8dabf11142d78d0f6174b50db6ba846c4e Author: Kent Overstreet Date: Fri May 7 20:43:43 2021 -0400 bcachefs: Fix some refcounting bugs We really need debug mode assertions that ca->ref and ca->io_ref are used correctly. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5bc38f44fa8e938044bb3b69c8881f3682fe97f6 Author: Dan Robertson Date: Fri May 7 22:29:02 2021 -0400 bcachefs: Fix oob write in __bch2_btree_node_write Fix a possible out of bounds write in __bch2_btree_node_write when the data buffer padding is cleared up to the block size. The out of bounds write is possible if the data buffers size is not a multiple of the block size. Signed-off-by: Dan Robertson Signed-off-by: Kent Overstreet commit 1784d43a88ecf0da66514f4b7f0f52b4182ef81c Author: Kent Overstreet Date: Fri May 7 23:32:26 2021 -0400 bcachefs: Fix usage of last_seq + encryption jset->last_seq is in the region that's encrypted - on journal write completion, we were using it and getting garbage. This patch shadows it to fix. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ac1019d32b31c8bca6e0e5f86b403e91a1da5786 Author: Kent Overstreet Date: Thu Apr 29 15:37:47 2021 -0400 bcachefs: Clean up bch2_btree_and_journal_walk() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e68031fb468aff9963d344d04e2de8824c83c8ae Author: Kent Overstreet Date: Thu Apr 29 16:55:26 2021 -0400 bcachefs: Mark newly allocated btree nodes as accessed This was a major oversight - this means under memory pressure we can end up reading in a btree node, then having it evicted before we get to use it. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 595c1e9bab7fd5512250d0e297e50a549af59b1f Author: Kent Overstreet Date: Wed Apr 28 22:51:42 2021 -0400 bcachefs: Fix time handling There were some overflows in the time conversion functions - fix this by converting tv_sec and tv_nsec separately. Also, set sb->time_min and sb->time_max. Fixes xfstest generic/258. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4f6dad46cb4b6db75758bc790a74d7f0f04e450b Author: Kent Overstreet Date: Thu Apr 29 00:21:54 2021 -0400 bcachefs: Add a tracepoint for when we block on journal reclaim Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2ce867df3161886cfc6baf54aa9ef53f2281cdee Author: Kent Overstreet Date: Wed Apr 28 22:12:07 2021 -0400 bcachefs: Make sure to initialize j->last_flushed If the journal reclaim thread makes it to the timeout without ever initializing j->last_flushed, we could end up sleeping for a very long time. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 050197b1c1df1cfee84523bf2183c8674e06d10f Author: Kent Overstreet Date: Wed Apr 28 19:36:12 2021 -0400 bcachefs: Ensure that fpunch updates inode timestamps Fixes xfstests generic/059 Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d4b4422345fcb4e284260bd52166e189c137e846 Author: Kent Overstreet Date: Tue Apr 27 14:03:13 2021 -0400 bcachefs: Change copygc wait amount to be min of per device waits We're seeing a filesystem get stuck when all devices but one have no more reclaimable buckets - because the copygc wait amount is curretly filesystem wide. This patch should fix that, possibly at the expensive of running too much when only one or a few devices is full and the rebalance thread needs to move data around. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit baa6502905df0acb94afbf6c93f51a1f2aa4c7ca Author: Kent Overstreet Date: Tue Apr 27 14:02:00 2021 -0400 bcachefs: Change bch2_btree_key_cache_count() to exclude dirty keys We're seeing livelocks that appear to be due to bch2_btree_key_cache_scan repeatedly scanning and blocking other tasks from using the key cache lock - we probably shouldn't be reporting objects that can't actually be freed yet. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d99af4f194d7af8aa11233707826875ef0704034 Author: Kent Overstreet Date: Thu Apr 29 22:32:44 2021 -0400 bcachefs: Call bch2_inconsistent_error() on missing stripe/indirect extent Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3dea728ce64bdd3c8c5e98cb7b8a148d52c8f0d4 Author: Kent Overstreet Date: Thu Apr 29 16:56:17 2021 -0400 bcachefs: New tracepoint for bch2_trans_get_iter() Trying to debug an issue where after traverse_all() we shouldn't have to traverse any iterators... yet we are Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d36cdb045aa7029f8495d18760da6c944ab95cb3 Author: Kent Overstreet Date: Tue Apr 27 11:12:17 2021 -0400 bcachefs: Fix __bch2_trans_get_iter() We need to also set iter->uptodate to indicate it needs to be traversed. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ceda1b9a179ffd8ece3f7d15d5b1379eb2552215 Author: Kent Overstreet Date: Sun Apr 25 16:24:03 2021 -0400 bcachefs: Evict btree nodes we're deleting There was a bug that led to duplicate btree node pointers being inserted at the wrong level. The new topology repair code can fix that, except that the btree cache code gets confused when we read in a btree node from the pointer that was at the wrong level. This patch evicts nodes that we're deleting to, which nicely solves the problem. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit fc51b041b72a7cbffc60811ff14d25207a4f7624 Author: Kent Overstreet Date: Wed Apr 21 21:08:49 2021 -0400 bcachefs: New check_nlinks algorithm for snapshots With snapshots, using a radix tree for the table of link counts won't work anymore because we also need to distinguish between inodes with different snapshot IDs. Instead, this patch builds up a sorted array of inodes that have hardlinks that we can binary search on - taking advantage of the fact that with inode backpointers, the check_nlinks() pass _only_ needs to concern itself with inodes that have hardlinks now. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e3b4b48c17a0f749f2786e756714a56316a519b3 Author: Kent Overstreet Date: Sat Apr 24 22:33:25 2021 -0400 bcachefs: Fix a null ptr deref Fix a few memory safety issues, found by asan in userspace. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit aae15aafcd43ec5346ac6c3f61c09798d26593ee Author: Kent Overstreet Date: Sat Apr 24 16:32:35 2021 -0400 bcachefs: New and improved topology repair code This splits out btree topology repair into a separate pass, and makes some improvements: - When we have to pick which of two overlapping nodes to drop keys from, we use the btree node header sequence number to preserve the newer node - the gc code has been changed so that it doesn't bail out if we're continuing/ignoring on fsck error - this way the dump tool can skip running the repair pass but still walk all reachable metadata - add a new superblock flag indicating when a filesystem is known to have btree topology issues, and the topology repair pass should be run - changing the start/end of a node might mean keys in that node have to be deleted: this patch handles that better by splitting it out into a separate function and running it explicitly in the topology repair code, previously those keys were only being dropped when the btree node was read in. Signed-off-by: Kent Overstreet commit 4932e07ea04bcc7f1649052183d1ebbab30c711c Author: Kent Overstreet Date: Sat Apr 24 18:02:59 2021 -0400 bcachefs: Fix key cache assertion Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0098376f03c1e9591beeab9815c4d756dd2d68a7 Author: Kent Overstreet Date: Fri Apr 23 19:25:27 2021 -0400 bcachefs: New helper __bch2_btree_insert_keys_interior() Consolidate common parts of bch2_btree_insert_keys_interior() and btree_split_insert_keys() - prep work for adding some new topology assertions. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit bcd25dac53344577b784bad47775f97f02c47285 Author: Kent Overstreet Date: Sat Apr 24 02:47:41 2021 -0400 bcachefs: Rewrite btree nodes with errors This patch adds self healing functionality for btree nodes - if we notice a problem when reading a btree node, we just rewrite it. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8058b532ac3bb5a0cec80056fde8a4669de2b551 Author: Kent Overstreet Date: Sat Apr 24 00:59:29 2021 -0400 bcachefs: Fix bch2_verify_keylist_sorted Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit bc2e5d5c6636f6a5794e4ed306fb008b02e6f419 Author: Kent Overstreet Date: Sat Apr 24 00:42:02 2021 -0400 bcachefs: Fix an out of bounds read bch2_varint_decode() can read up to 7 bytes past the end of the buffer, which means we need to allocate slightly larger key cache buffers. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 65c0601a329580f6a016298f7148305288b7d719 Author: Kent Overstreet Date: Sat Apr 24 00:38:16 2021 -0400 bcachefs: Use mmap() instead of vmalloc_exec() in userspace Calling mmap() directly is much better than malloc() then mprotect(), we end up with much less address space fragmentation. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 537c32f5212396751bf39b10d71af60af32dc257 Author: Kent Overstreet Date: Fri Apr 23 16:05:49 2021 -0400 bcachefs: Don't BUG_ON() btree topology error This replaces an assertion in the btree merge path with a bch2_inconsistent_error() - fsck will fix it. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1c8441bea5366ec1e4f077ab675b49a603d7cad8 Author: Kent Overstreet Date: Fri Apr 23 16:18:43 2021 -0400 bcachefs: Fix repair leading to replicas not marked bch2_check_fix_ptrs() was being called after checking if the replicas set was marked - but repair could change which replicas set needed to be marked. Oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 58686a259ed28f1ee50cc0aaa039e986aa218e0c Author: Kent Overstreet Date: Mon Apr 19 22:19:18 2021 -0400 bcachefs: Lookup/create lost+found lazily This is prep work for subvolumes - each subvolume will have its own lost+found. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit eb365fbc333519651bed300eb866f26dbc1efd05 Author: Kent Overstreet Date: Wed Apr 21 18:08:39 2021 -0400 bcachefs: Don't BUG() in update_replicas Apparently, we have a bug where in mark and sweep while accounting for a key, a replicas entry isn't found. Change the code to print out the key we couldn't mark and halt instead of a BUG_ON(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f09517fc5136ad2ea67b6f332ed2445f053ccfe6 Author: Kent Overstreet Date: Tue Apr 20 17:09:25 2021 -0400 bcachefs: Fix a deadlock on journal reclaim Flushing the btree key cache needs to use allocation reserves - journal reclaim depends on flushing the btree key cache for making forward progress, and the allocator and copygc depend on journal reclaim making forward progress. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6adaac0b95dd39da290f6006822fbf7560d2d1b5 Author: Kent Overstreet Date: Tue Apr 20 20:21:12 2021 -0400 bcachefs: Update bch2_btree_verify() bch2_btree_verify() verifies that the btree node on disk matches what we have in memory. This patch changes it to verify every replica, and also fixes it for interior btree nodes - there's a mem_ptr field which is used as a scratch space and needs to be zeroed out for comparing with what's on disk. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7b7278bbaf2a5d2e6955d763a8a30a3ba190dc10 Author: Kent Overstreet Date: Tue Apr 20 20:21:39 2021 -0400 bcachefs: Fix two btree iterator leaks Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 51c804ed2a60d995c1a358018491471e34bb76b6 Author: Kent Overstreet Date: Tue Apr 6 15:28:34 2021 -0400 bcachefs: Punt btree writes to workqueue to submit We don't want to be submitting IO with btree locks held, and btree writes usually aren't latency sensitive. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4d47b21c4dac0d27ad02add2c68be0afaa63ef98 Author: Kent Overstreet Date: Mon Apr 19 17:17:34 2021 -0400 bcachefs: Fix a use after free Turns out, we weren't waiting on in flight btree writes when freeing existing btree nodes. This lead to stray btree writes overwriting newly allocated buckets, but only started showing itself with some of the recent allocator work and another patch to move submitting of btree writes to worqueues. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8ce600d44720a86c069fafefc92167ed85cc72c7 Author: Kent Overstreet Date: Mon Apr 19 17:07:20 2021 -0400 bcachefs: Fix for btree_gc repairing interior btree ptrs Using the normal transaction commit path to insert and journal updates to interior nodes hadn't been done before this repair code was written, not surprising that there was a bug. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e95d7edfb709cb05cc128a6f4067b2ef05f6a8ac Author: Kent Overstreet Date: Mon Apr 19 00:33:05 2021 -0400 bcachefs: Preallocate trans mem in bch2_migrate_index_update() This will help avoid transaction restarts. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 89baec780f8b218f5a8bce777b13b6116e416ff6 Author: Kent Overstreet Date: Sat Apr 17 20:37:04 2021 -0400 bcachefs: Allocator refactoring This uses the kthread_wait_freezable() macro to simplify a lot of the allocator thread code, along with cleaning up bch2_invalidate_bucket2(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit fa272f33bbfc68856efa7aa0f2e33d9fe5982e17 Author: Kent Overstreet Date: Sun Apr 18 17:44:35 2021 -0400 bcachefs: Always check for invalid bkeys in trans commit path We check for this prior to metadata being written, but we're seeing some strange bugs lately, and this will help catch those closer to where they occur. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 27cc532ef2d7c3bc4687547f59fe5d4a82affab7 Author: Kent Overstreet Date: Sat Apr 17 23:18:17 2021 -0400 bcachefs: Check that keys are in the correct btrees We've started seeing bug reports of pointers to btree nodes being detected in leaf nodes. This should catch that before it's happened, and it's something we should've been checking anyways. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 04903131db3e09a6a074755071c46febc7e2449f Author: Kent Overstreet Date: Sun Apr 18 17:26:34 2021 -0400 bcachefs: Handle errors in bch2_trans_mark_update() It's not actually the case that iterators are always checked here - __bch2_trans_commit() checks for that after running triggers. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6ad060b0eb45d2eaa5411be042bd3b53900f992e Author: Kent Overstreet Date: Fri Apr 16 21:53:23 2021 -0400 bcachefs: Allocator thread doesn't need gc_lock anymore Even with runtime gc (which currently isn't supported), runtime gc no longer clears/recalculates the main set of bucket marks - it allocates and calculates another set, updating the primary at the end. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit dac1525d9c0d6e69da561dbc2becdcd32230b907 Author: Kent Overstreet Date: Fri Apr 16 21:34:00 2021 -0400 bcachefs: gc shouldn't care about owned_by_allocator The owned_by_allocator field is a purely in memory thing, even if/when we bring back GC at runtime there's no need for it to be recalculating this field. This is prep work for pulling it out of struct bucket, and eventually getting rid of the bucket array. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 694015c2b1cf114577e4526c0aa370d0ed0a10e5 Author: Kent Overstreet Date: Fri Apr 16 20:35:20 2021 -0400 bcachefs: Refactor bchfs_fallocate() to not nest btree_trans on stack Upcoming patch is going to disallow multiple btree_trans on the stack. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f02810a1a4cdcf643f6149396769e0fb38a94a78 Author: Kent Overstreet Date: Fri Apr 16 17:34:53 2021 -0400 bcachefs: Fix an unused var warning in userspace Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f24fab9cbad1838fc4356e9e8b861a19cf055c3f Author: Kent Overstreet Date: Fri Apr 16 17:26:25 2021 -0400 bcachefs: Fix some small memory leaks Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ae8bbb9fac2c74ce3132adae7b059d1cb8535039 Author: Kent Overstreet Date: Fri Apr 16 14:48:51 2021 -0400 bcachefs: Simplify fsck remove_dirent() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5e6a668b19614c44819c4b0f7691da92df973384 Author: Kent Overstreet Date: Fri Apr 16 14:29:26 2021 -0400 bcachefs: Fix transaction restarts due to upgrading of cloned iterators This fixes a regression from 52d86202fd bcachefs: Improve bch2_btree_iter_traverse_all() We want to avoid mucking with other iterators in the btree transaction in operations that are only supposed to be touching individual iterators - that patch was a cleanup to move lock ordering handling to bch2_btree_iter_traverse_all(). But it broke upgrading of cloned iterators. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 96f399d0eed9a63e706c045407675622f32f5a5d Author: Kent Overstreet Date: Fri Apr 16 12:38:14 2021 -0400 bcachefs: Fix journal reclaim loop When dirty key cache keys were separated from other journal pins, we broke the loop conditional in __bch2_journal_reclaim() - it's supposed to keep looping as long as there's work to do. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3e07a7300f0684f7c77485e65a1ae97c7ab2514f Author: Kent Overstreet Date: Thu Apr 15 18:31:58 2021 -0400 bcachefs: Fix an RCU splat Writepoints are never deallocated so the rcu_read_lock() isn't really needed, but we are doing lockless list traversal. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 633632ef1be790af24897cfcf165d936ca379b45 Author: Kent Overstreet Date: Wed Apr 14 20:23:58 2021 -0400 bcachefs: Simplify bch2_set_nr_journal_buckets() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d62ab355d7475a0da3267c8376ef436ba92f72c1 Author: Kent Overstreet Date: Wed Apr 14 20:25:33 2021 -0400 bcachefs: Fix bch2_trans_mark_dev_sb() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 73a117d2d8a0d9923648653b6400f534e0038281 Author: Kent Overstreet Date: Thu Apr 15 12:50:09 2021 -0400 bcachefs: Improve trans_restart_mem_realloced tracepoint Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 558509aa0198b9c062ff7b91bf8feb74513e0965 Author: Kent Overstreet Date: Thu Apr 15 12:36:40 2021 -0400 bcachefs: Don't downgrade iterators in bch2_trans_get_iter() This fixes a livelock with btree node splits. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2527dd91580b1eb5ff1f8df1b47817ac60395830 Author: Kent Overstreet Date: Wed Apr 14 13:26:15 2021 -0400 bcachefs: Improve bch2_btree_iter_traverse_all() By changing it to upgrade iterators to intent locks to avoid lock restarts we can simplify __bch2_btree_node_lock() quite a bit - this fixes a probable bug where it could potentially drop a lock on an unrelated error but still succeed instead of causing a transaction restart. Signed-off-by: Kent Overstreet commit 0ef107859bc868f783cbbbf055a907c702896661 Author: Kent Overstreet Date: Wed Apr 14 22:15:55 2021 -0400 bcachefs: Fix journal_reclaim_wait_done() Can't run arbitrary code inside a wait_event() conditional, due to task state being weird... Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1b9374adecea64244b0c67aa27e032feae1f1bca Author: Kent Overstreet Date: Wed Apr 14 20:22:10 2021 -0400 bcachefs: Fix bch2_gc_done() error messages Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5e427571c59c26b04f483b305cf0e63498f21601 Author: Kent Overstreet Date: Wed Apr 14 17:45:31 2021 -0400 bcachefs: Don't call bch2_btree_iter_traverse() unnecessarily If we let bch2_trans_commit() do it, it'll traverse iterators in sorted order which means we'll get fewer lock restarts. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a0c9cc1727ecf302ab0be07e93d0c023e64be8da Author: Kent Overstreet Date: Wed Apr 14 13:29:34 2021 -0400 bcachefs: Better iterator picking Avoid cloning iterators if we don't have to. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d44a6e350ed28c00e00f5d8d5882682275dc0945 Author: Kent Overstreet Date: Wed Apr 14 12:17:41 2021 -0400 bcachefs: Drop old style btree node coalescing We have foreground btree node merging now, and any future btree node merging improvements are going to be based off of that code. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4aac975b6c9100cb08da4645291a262d970c1922 Author: Kent Overstreet Date: Wed Apr 14 12:10:17 2021 -0400 bcachefs: Add a perf test for multiple updates per commit Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e949fbbba0dce7cd80f7c2e932c289d3717c9759 Author: Kent Overstreet Date: Tue Apr 13 15:10:39 2021 -0400 bcachefs: Ensure bucket gen gc completes We don't want it to block, if it can't allocate it should just continue instead of possibly deadlocking. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ac516d0e7db76bc77dea9313570b3924e0605d7b Author: Kent Overstreet Date: Tue Apr 13 15:00:40 2021 -0400 bcachefs: Add the status of bucket gen gc to sysfs Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 319c1305071c3ac813c3ea9eed15d1a0d26f983a Author: Kent Overstreet Date: Tue Apr 13 10:30:58 2021 -0400 bcachefs: Fix heap overrun in bch2_fs_usage_read() XXX squash oops Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 423300e8fe41e7613a8edba59bca85eb7517731d Author: Kent Overstreet Date: Tue Apr 13 10:26:59 2021 -0400 bcachefs: BCH_BEATURE_atomic_nlink is obsolete Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d3ff7fec9c604e2cac3d0126f6764c5c0392a271 Author: Kent Overstreet Date: Wed Apr 7 03:11:07 2021 -0400 bcachefs: Improved check_directory_structure() Now that we have inode backpointers, we can simplify checking directory structure: instead of doing a DFS from the filesystem root and then checking if we found everything, we can iterate over every inode and see if we can go up until we get to the root. This patch also has a number of fixes and simplifications for the inode backpointer checks. Also, it turns out we don't actually need the BCH_INODE_BACKPTR_UNTRUSTED flag. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 176cf4bf59014d03be6cef33cabb677d2117dbb2 Author: Kent Overstreet Date: Fri Apr 9 03:25:37 2021 -0400 bcachefs: Fix fsck to not use bch2_link_trans() bch2_link_trans() uses the btree key cache for inode updates, and fsck isn't supposed to - also, it's not really what we want for reattaching unreachable inodes anyways. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b69ac13cb39176634f1dd924dfabe2e282615d41 Author: Kent Overstreet Date: Mon Apr 12 14:00:07 2021 -0400 bcachefs: Fix bch2_trans_relock() The patch that changed bch2_trans_relock() to not look at iter->uptodate also tried to add an optimization by only having it relock btree_iter_key() iterators (iterators that are live or have been marked as keep). But, this wasn't thought through - this pops internal iterator assertions because on transaction restart, when we're traversing iterators we traverse all iterators marked as linked, and having bch2_trans_relock() skip some of those mean that it can skil the iterator that bch2_btree_iter_traverse_one() is currently traversing. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b906aaddf2144b9f4ebdb8618e8ab1af00a58644 Author: Kent Overstreet Date: Thu Apr 8 15:25:29 2021 -0400 bcachefs: Redo check_nlink fsck pass Now that we have inode backpointers the check_nlink pass only is concerned with files that have hardlinks, and can be simplified. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8a85b20cd757d9ebc784adc7d56ea378b9bf30c5 Author: Kent Overstreet Date: Tue Apr 6 20:15:26 2021 -0400 bcachefs: Inode backpointers are now required This lets us simplify fsck quite a bit, which we need for making fsck snapshot aware. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7ac2c55e4dec9af38bd9447271944296a4a38814 Author: Kent Overstreet Date: Wed Apr 7 01:55:57 2021 -0400 bcachefs: Simplify hash table checks Very early on there was a period where we were accidentally generating dirents with trailing garbage; we've since dropped support for filesystems that old and the fsck code can be dropped. Also, this patch switches to a simpler algorithm for checking hash tables. It's less efficient on hash collision - but with 64 bit keys, those are very rare. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5c16add5ad7897248ded54c34f65cb9479ca542a Author: Kent Overstreet Date: Tue Apr 6 21:41:48 2021 -0400 bcachefs: Check inodes at start of fsck This splits out checking inode nlinks from the rest of the inode checks and moves most of the inode checks to the start of fsck, so that other fsck passes can depend on it. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d7f35163e61d962132539e38be89330834a8455b Author: Kent Overstreet Date: Fri Apr 9 16:52:30 2021 -0400 bcachefs: Fix BTREE_ITER_NOT_EXTENTS bch2_btree_iter_peek() wasn't properly checking for BTREE_ITER_IS_EXTENTS when updating iter->pos. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0e96452eef51f32417d2abdb1806474083da5979 Author: Kent Overstreet Date: Fri Apr 9 15:10:24 2021 -0400 bcachefs: Fix bch2_gc_btree_gens() Since we're using a NOT_EXTENTS iterator, we shouldn't be setting the iter pos to the start of the extent. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6ae0d16d29707ac952cdb8c2ccb0628f074e0e69 Author: Kent Overstreet Date: Thu Apr 8 16:15:03 2021 -0400 bcachefs: Make sure to kick journal reclaim when we're waiting on it Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b1bd955ba5693f18a091a5cfe3a21ab3bee74edf Author: Kent Overstreet Date: Wed Apr 7 21:04:04 2021 -0400 bcachefs: Don't wait for ALLOC_SCAN_BATCH buckets in allocator It used to be necessary for the allocator thread to batch up invalidating buckets when possible - but since we added the btree key cache that hasn't been a concern, and now it's causing the allocator thread to livelock when the filesystem is nearly full. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3a14d58e7b330f3526509917bb6a38b55a1feef5 Author: Kent Overstreet Date: Tue Apr 6 21:19:25 2021 -0400 bcachefs: Drop bch2_fsck_inode_nlink() We've had BCH_FEATURE_atomic_nlink for quite some time, we can drop this now. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b6d4f474e4e785a9090992b0f301e57870f73711 Author: Kent Overstreet Date: Tue Apr 6 20:11:28 2021 -0400 bcachefs: Move some dirent checks to bch2_dirent_invalid() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2177147b39098e6f08b3d8d45bbcf7dedd7ebdad Author: Kent Overstreet Date: Tue Apr 6 15:33:19 2021 -0400 bcachefs: Improve bset compaction The previous patch that fixed btree nodes being written too aggressively now meant that we weren't sorting btree node bsets optimally - this patch fixes that. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 241e26369e1267be376490152ee2c52021b4321a Author: Kent Overstreet Date: Wed Mar 31 21:44:55 2021 -0400 bcachefs: Don't flush btree writes more aggressively because of btree key cache We need to flush the btree key cache when it's too dirty, because otherwise the shrinker won't be able to reclaim memory - this is done by journal reclaim. But journal reclaim also kicks btree node writes: this meant that btree node writes were getting kicked much too often just because we needed to flush btree key cache keys. This patch splits journal pins into two different lists, and teaches journal reclaim to not flush btree node writes when it only needs to flush key cache keys. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9d8022db1ccfff6aaf1de6158c2a26b667c70a15 Author: Kent Overstreet Date: Tue Apr 6 14:00:56 2021 -0400 bcachefs: Eliminate more PAGE_SIZE uses In userspace, we don't really have a well defined PAGE_SIZE and shouln't be relying on it. This is some more incremental work to remove references to it. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a0857785001777ff659248e45a2e1688fb43499d Author: Kent Overstreet Date: Tue Apr 6 13:43:31 2021 -0400 bcachefs: Increase BSET_CACHELINE to 256 bytes Linear searches have gotten cheaper relative to binary searches on modern hardware, due to better branch prediction behaviour. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f72b1fd710870547f566d7d02563833eda43e67d Author: Kent Overstreet Date: Mon Apr 5 01:23:55 2021 -0400 bcachefs: Fix a startup race Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ecc1420944c73205225ed6fe4c1781c09759dd10 Author: Kent Overstreet Date: Sun Apr 4 22:38:07 2021 -0400 bcachefs: Fix an uninitialized variable Fortunately it was just used in an error message Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3ce8b463e3e044cc6765c096e2b755416e6f7e84 Author: Kent Overstreet Date: Sat Apr 3 21:54:14 2021 -0400 bcachefs: kill bset_tree->max_key Since we now ensure a btree node's max key fits in its packed format, this isn't needed for the reasons it used to be - and, it was being used inconsistently. Also reorder struct btree a bit for performance, and kill some dead code. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 671cc8a51b019b49a8538aceaaa5e770c1694c1b Author: Kent Overstreet Date: Sat Apr 3 21:31:02 2021 -0400 bcachefs: Eliminate memory barrier from fast path of journal_preres_put() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 08e337618f67abb9be1ff4b022a14e8721c5def2 Author: Kent Overstreet Date: Sat Apr 3 21:09:13 2021 -0400 bcachefs: Drop some memset() calls gcc is emitting rep stos here, which is silly (and slow) for an 8 byte memset. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 35d5aff263629caf98305d12c02d8b64d6981625 Author: Kent Overstreet Date: Sat Apr 3 20:29:05 2021 -0400 bcachefs: Kill bch2_fs_usage_scratch_get() This is an important cleanup, eliminating an unnecessary copy in the transaction commit path. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9c2e624290f24c69c835bc82b1abe349810e338f Author: Kent Overstreet Date: Sat Apr 3 19:41:09 2021 -0400 bcachefs: Fix livelock calling bch2_mark_bkey_replicas() The bug was that we were trying to find a replicas entry that wasn't sorted - but, we can also simplify the code by not using bch2_mark_bkey_replicas and instead ensuring the list of replicas entries exists directly. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2940295c97f49ffe0b2f564dea394094581073e7 Author: Kent Overstreet Date: Sat Apr 3 16:24:13 2021 -0400 bcachefs: Be more careful about JOURNAL_RES_GET_RESERVED JOURNAL_RES_GET_RESERVED should only be used for updatse that need to be done to free up space in the journal. In particular, when we're flushing keys from the key cache, if we're flushing them out of order we shouldn't be using it, since we're using up our remaining space in the journal without dropping a pin that will let us make forward progress. With this patch, BTREE_INSERT_JOURNAL_RECLAIM without BTREE_INSERT_JOURNAL_RESERVED may return -EAGAIN - we can't wait on journal reclaim if we're already in journal reclaim. This means we need to propagate these errors up to journal reclaim, indicating that flushing a journal pin should be retried in the future. This is prep work for a patch to change the way journal reclaim works, to split out flushing key cache keys because the btree key cache is too dirty from journal reclaim because we need space in the journal. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6167f7c8ff5ce564423fe8b416b5f95d1712859b Author: Kent Overstreet Date: Sat Apr 3 19:27:05 2021 -0400 bcachefs: Fix journal deadlock After we get a journal reservation, we need to use it - if we erorr out of a transaction commit, we'll be eating into space in the journal and if our transaction needs to make forward progress in order to reclaim space in the journal, we'll deadlock. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b753d4b338df70df1ee75db21a216385bb88b90b Author: Kent Overstreet Date: Sat Apr 3 18:37:09 2021 -0400 bcachefs: Fix this_cpu_ptr() usage Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2d587674bad9cf83db0cc43185eb7e2d913cf41f Author: Kent Overstreet Date: Fri Apr 2 21:29:05 2021 -0400 bcachefs: Increase commality between BTREE_ITER_NODES and BTREE_ITER_KEYS Eventually BTREE_ITER_NODES should be going away. This patch is to fix a transaction iterator overflow in the btree node merge path because BTREE_ITER_NODES iterators couldn't be reused. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2fa81d0b5bfdcd9c90725474ab9443f13152dfd8 Author: Kent Overstreet Date: Wed Mar 31 16:10:21 2021 -0400 bcachefs: Fix BTREE_FOREGROUND_MERGE_HYSTERESIS We were multiplying instead of dividing - oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5c1d808ad8b80618186227e33f46b7cc5fac5461 Author: Kent Overstreet Date: Wed Mar 31 16:43:50 2021 -0400 bcachefs: Drop trans->nounlock Since we're no longer doing btree node merging post commit, we can now delete a bunch of code. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b182ff609f2519998a6b4ad853a2fc1d3f0f0af5 Author: Kent Overstreet Date: Mon Mar 29 01:13:31 2021 -0400 bcachefs: Move btree node merging to before transaction commit Currently, BTREE_INSERT_NOUNLOCK makes it hard to ensure btree node merging happens reliably - since btree node merging happens after transaction commit, we can't drop btree locks and block when starting the btree update. This patch moves it to before transaction commit - and failure to do a merge that we wanted to do just restarts the transaction. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ecab6be7e5c3e19d25a4ad9d5d97c83e3ac67507 Author: Kent Overstreet Date: Wed Mar 31 16:16:39 2021 -0400 bcachefs: bch2_foreground_maybe_merge() now correctly reports lock restarts This means that btree node splits don't have to automatically trigger a transaction restart. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 54ca47e114c0cccc075a722f528de2b50b149b49 Author: Kent Overstreet Date: Mon Mar 29 01:13:31 2021 -0400 bcachefs: Kill bch2_btree_node_get_sibling() This patch reworks the btree node merge path to use a second btree iterator to get the sibling node - which means bch2_btree_iter_get_sibling() can be deleted. Also, it uses bch2_btree_iter_traverse_all() if necessary - which means it should be more reliable. We don't currently even try to make it work when trans->nounlock is set - after a BTREE_INSERT_NOUNLOCK transaction commit, hopefully this will be a worthwhile tradeoff. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1259cc31b23221feae5e49cc02eaf7cfb7df9f54 Author: Kent Overstreet Date: Wed Mar 31 15:39:16 2021 -0400 bcachefs: Change where merging of interior btree nodes is trigger from Previously, we were doing btree node merging from bch2_btree_insert_node() - but this is called from the split path, when we're in the middle of creating new nodes and deleting new nodes and the iterators are in a weird state. Also, this means we're starting a new btree_update while in the middle of an existing one, and that's asking for deadlocks. Much simpler and saner to trigger btree node merging _after_ the whole btree node split path is finished. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e264b2f62a8fdf571e9ca9a741719a9b567573f5 Author: Kent Overstreet Date: Wed Mar 31 15:21:37 2021 -0400 bcachefs: Improve bch2_btree_update_start() bch2_btree_update_start() is now responsible for taking gc_lock and upgrading the iterator to lock parent nodes - greatly simplifying error handling and all of the callers. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ba5f03d362a8c7a32fd63c54cd3aeea0c9f3d7cc Author: Kent Overstreet Date: Wed Mar 31 21:07:37 2021 -0400 bcachefs: Add a sysfs var for average btree write size Useful number for performance tuning. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d5a43661a1e9d9448e9e508470deec973c3d6644 Author: Kent Overstreet Date: Tue Mar 30 20:35:46 2021 -0400 bcachefs: Improve bch2_trans_relock() We're getting away from relying on iter->uptodate - this changes bch2_trans_relock() to more directly specify which iterators should be relocked. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit acb3b26e767a809baee5cbbf869166c45ee3bca2 Author: Kent Overstreet Date: Wed Mar 31 14:42:36 2021 -0400 bcachefs: Move btree lock debugging to slowpath fn Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 24db24c749913f71cd90355528bad522cf197f62 Author: Kent Overstreet Date: Wed Mar 31 17:52:52 2021 -0400 bcachefs: Don't make foreground writes wait behind journal reclaim too long Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 65bcd6579df322d0c6216a534c65ee41eda2b801 Author: Kent Overstreet Date: Sun Mar 28 20:56:25 2021 -0400 buckets.c fixups XXX squash Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5f65d74d791d9bc07de05d4fa4ed5bb075e07873 Author: Kent Overstreet Date: Mon Mar 29 00:19:05 2021 -0400 bcachefs: Add repair code for out of order keys in a btree node. This just drops the offending key - in the bug report where this was seen, it was clearly a single bit memory error, and fsck will fix the missing key. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a84b6c50f18e197070e35a04252fcc5c0abf2904 Author: Kent Overstreet Date: Sun Mar 28 21:20:22 2021 -0400 bcachefs: Free iterator in bch2_btree_delete_range_trans() This is specifically to speed up bch2_inode_rm(), so that we're not traversing iterators we're done with. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c5f51cdd5f1c0368c73637bea045d6d20c6f87c2 Author: Kent Overstreet Date: Sun Mar 28 20:57:59 2021 -0400 bcachefs: Have journal reclaim thread flush more aggressively This adds a new watermark for the journal reclaim when flushing btree key cache entries - it should try and stay ahead of where foreground threads doing transaction commits will enter direct journal reclaim. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 883d9701f1589461ae9c9214303a8c175ffb79c5 Author: Kent Overstreet Date: Tue Mar 16 18:08:10 2021 -0400 bcachefs: Don't use bch2_inode_find_by_inum() in move.c Since move.c isn't aware of what subvolume we're in, we can't use the standard inode lookup code - fortunately, we're just using it for reading IO options. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e6ae27272491afec1994c31eee4744f19ce3b3f4 Author: Kent Overstreet Date: Mon Mar 15 19:18:30 2021 -0400 bcachefs: Change inode allocation code for snapshots For snapshots, when we allocate a new inode we want to allocate an inode number that isn't in use in any other subvolume. We won't be able to use ITER_SLOTS for this, inode allocation needs to change to use BTREE_ITER_ALL_SNAPSHOTS. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ab2a29ccffd0e9fe62afb8bbd45e1709f9726942 Author: Kent Overstreet Date: Tue Mar 2 18:35:30 2021 -0500 bcachefs: Inode backpointers This patch adds two new inode fields, bi_dir and bi_dir_offset, that point back to the inode's dirent. Since we're only adding fields for a single backpointer, files that have been hardlinked won't necessarily have valid backpointers: we also add a new inode flag, BCH_INODE_BACKPTR_UNTRUSTED, that's set if an inode has ever had multiple links to it. That's ok, because we only really need this functionality for directories, which can never have multiple hardlinks - when we add subvolumes, we'll need a way to enemurate and print subvolumes, and this will let us reconstruct a path to a subvolume root given a subvolume root inode. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e751c01a8ee1ca934cc0953e2e77ad4ea3e64d5e Author: Kent Overstreet Date: Wed Mar 24 18:02:16 2021 -0400 bcachefs: Start using bpos.snapshot field This patch starts treating the bpos.snapshot field like part of the key in the btree code: * bpos_successor() and bpos_predecessor() now include the snapshot field * Keys in btrees that will be using snapshots (extents, inodes, dirents and xattrs) now always have their snapshot field set to U32_MAX The btree iterator code gets a new flag, BTREE_ITER_ALL_SNAPSHOTS, that determines whether we're iterating over keys in all snapshots or not - internally, this controlls whether bkey_(successor|predecessor) increment/decrement the snapshot field, or only the higher bits of the key. We add a new member to struct btree_iter, iter->snapshot: when BTREE_ITER_ALL_SNAPSHOTS is not set, iter->pos.snapshot should always equal iter->snapshot, which will be 0 for btrees that don't use snapshots, and alsways U32_MAX for btrees that will use snapshots (until we enable snapshot creation). This patch also introduces a new metadata version number, and compat code for reading from/writing to older versions - this isn't a forced upgrade (yet). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4cf91b0270dc16a6637db4c200c7fb745b941065 Author: Kent Overstreet Date: Thu Mar 4 16:20:16 2021 -0500 bcachefs: Split out bpos_cmp() and bkey_cmp() With snapshots, we're going to need to differentiate between comparisons that should and shouldn't include the snapshot field. bpos_cmp is now the comparison function that does include the snapshot field, used by core btree code. Upper level filesystem code generally does _not_ want to compare against the snapshot field - that code wants keys to compare as equal even when one of them is in an ancestor snapshot. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 43d002432dbb093b2155ebce7f12f79b844817f1 Author: Kent Overstreet Date: Wed Feb 3 21:51:56 2021 -0500 bcachefs: Add a mechanism for running callbacks at trans commit time Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 331194a230f5fb266a64880e905c0364aa834964 Author: Kent Overstreet Date: Wed Mar 24 23:37:33 2021 -0400 bcachefs: btree key cache locking improvements The btree key cache mutex was becoming a significant bottleneck - it was mainly used to protect the lists of dirty, clean and freed cached keys. This patch eliminates the dirty and clean lists - instead, when we need to scan for keys to drop from the cache we iterate over the rhashtable, and thus we're able to remove most uses of that lock. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2649b514b6cad329da0a4c8cafbd48c32bbc1b9d Author: Kent Overstreet Date: Sat Mar 27 21:00:26 2021 -0400 bcachefs: Simplify btree_node_iter_init_pack_failed() Since we now make sure to always generate packed bkey formats that can pack the min_key of a btree node, this path should actually never happen. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f793fd85dc598616ff903750b2a6d63425c23b2f Author: Kent Overstreet Date: Sat Mar 27 20:58:57 2021 -0400 bcachefs: Fix for bch2_trans_commit() unlocking when it's not supposed to When we pass BTREE_INSERT_NOUNLOCK bch2_trans_commit isn't supposed to unlock after a successful commit, but it was calling bch2_trans_cond_resched() - oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3bf57160c23d507a46c1a7a4a453405d21ac0d7c Author: Kent Overstreet Date: Fri Mar 26 20:29:04 2021 -0400 bcachefs: Fix packed bkey format calculation for new btree roots Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c7e04e22e000d3d9c2c0ed00cd444b3b8a26cf1a Author: Kent Overstreet Date: Fri Mar 26 20:10:59 2021 -0400 bcachefs: Fix building of aux search trees We weren't packing the min/max keys, which was a major oversight and completely disabled generating bkey_floats for adjacent nodes. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2da5d000b91e0407dedc3baa35cf7c36a0392ff2 Author: Kent Overstreet Date: Fri Mar 26 20:08:56 2021 -0400 bcachefs: Generate better bkey formats when splitting nodes On btree node split, we weren't ensuring the min_key of the new larger node packs in the new format for this node. This triggers some painful slowpaths in the bset.c aux search tree code - this patch fixes that by calculating a new format for the new node with the new min_key. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0390ea8ad8f4079c25d47e8c249a2f621aaec3c0 Author: Kent Overstreet Date: Wed Mar 24 20:22:51 2021 -0400 bcachefs: Drop bkey noops Bkey noops were introduced to deal with trimming inline data extents in place in the btree: if the u64s field of a bkey was 0, that u64 was a noop and we'd start looking for the next bkey immediately after it. But extent handling has been lifted above the btree - we no longer modify existing extents in place in the btree, and the compatibilty code for old style extent btree nodes is gone, so we can completely drop this code. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7c8b166e584c85f9920d8f82778967eeee0e1b03 Author: Kent Overstreet Date: Wed Mar 24 22:49:05 2021 -0400 bcachefs: Increase default journal size The default was 1/256th of the device and capped at 512MB, which is fairly tiny these days. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a9d79c6e8ba18665bed30702be5fb238c50e8c63 Author: Kent Overstreet Date: Tue Mar 23 23:52:27 2021 -0400 bcachefs: Use pcpu mode of six locks for interior nodes Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 08070cba4a378ca02fdb954c45cf9b8797907fe9 Author: Kent Overstreet Date: Tue Mar 23 21:22:50 2021 -0400 bcachefs: Split btree_iter_traverse and bch2_btree_iter_traverse() External (to the btree iterator code) users of bch2_btree_iter_traverse expect that on success the iterator will be pointed at iter->pos and have that position locked - but since we split iter->pos and iter->real_pos, that means it has to update iter->real_pos if necessary. Internal users don't expect it to modify iter->real_pos, so we need two separate functions. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d3e6b9a14d857382086cd4d4619f13cb92afc522 Author: Kent Overstreet Date: Sun Mar 21 22:01:12 2021 -0400 bcachefs: Improve inode deletion code It had some silly redundancies. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit fad7cfed79cc66eb2fe26b422146e1447f1cd25d Author: Kent Overstreet Date: Mon Mar 22 17:23:30 2021 -0400 bcachefs: Add an .invalid method for bch2_btree_ptr_v2 It was using the method for btree_ptr_v1, but that wasn't checking all the fields. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1fe9b1d33cd2a5e66b3d7bb64fd327d723121a6c Author: Kent Overstreet Date: Mon Mar 22 15:50:02 2021 -0400 bcachefs: Include snapshot field in bch2_bpos_to_text More prep work for snapshots. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit bcad562259f7030a1f2e5e0a4e4f6f5b53371c74 Author: Kent Overstreet Date: Sun Mar 21 21:16:52 2021 -0400 bcachefs: Update iter->real_pos lazily peek() has to update iter->real_pos - there's no need for bch2_btree_iter_set_pos() to update it as well. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 818664f50571fd04683743600e50731e70fff8f5 Author: Kent Overstreet Date: Sun Mar 21 19:43:31 2021 -0400 bcachefs: Consolidate bch2_btree_iter_peek() and peek_with_updates() Ideally we'll be getting rid of peek_with_updates(), but the callers will need to be checked. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ca58cbd4719f11610ca777c23a285bab11eece03 Author: Kent Overstreet Date: Sun Mar 21 19:32:01 2021 -0400 bcachefs: Improve iter->real_pos handling Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3b0baf6f29ffce58e96b1a85568e2aa115a114f6 Author: Kent Overstreet Date: Sun Mar 21 19:22:58 2021 -0400 bcachefs: Internal btree iterator renaming This just gives some internal helpers some better names. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 07fc72e103a6912fd1c7fe1dd8f6f29efbd07164 Author: Kent Overstreet Date: Sun Mar 21 17:01:34 2021 -0400 bcachefs: Kill btree_iter_peek_uptodate() Since we're no longer doing next() immediately followed by peek(), this optimization isn't doing anything anymore. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5cde51cd480906e2a5b3cfdc7f24369ee5a63e54 Author: Kent Overstreet Date: Sun Mar 21 17:09:55 2021 -0400 bcachefs: Iterators are now always consistent with iter->real_pos This means bch2_btree_iter_traverse_one() can be made more efficient. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 345ca825e7d7e76211a72e13501e6504d22369f9 Author: Kent Overstreet Date: Sun Mar 21 18:09:02 2021 -0400 bcachefs: Have btree_iter_next_node() use btree_iter_set_search_pos() btree node iterators need to obey the regular btree node invarionts w.r.t. iter->real_pos; once they do, bch2_btree_iter_traverse will have less that it needs to check. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e0ba3b6429a4b5995b06dc46afdf4d3530d156bb Author: Kent Overstreet Date: Sun Mar 21 16:55:25 2021 -0400 bcachefs: Replace bch2_btree_iter_next() calls with bch2_btree_iter_advance The way btree iterators work internally has been changing, particularly with the iter->real_pos changes, and bch2_btree_iter_next() is no longer hyper optimized - it's just advance followed by peek, so it's more efficient to just call advance where we're not using the return value of bch2_btree_iter_next(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit cb16bfaa86f09fae33a712510aa51a03ca370d63 Author: Kent Overstreet Date: Sun Mar 21 00:03:34 2021 -0400 bcachefs: Get disk reservation when overwriting data in old snapshot Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4cfb722ca16d89ada724c142201fc86872283a90 Author: Kent Overstreet Date: Sat Mar 20 21:04:57 2021 -0400 bcachefs: Switch extent_handle_overwrites() to one key at a time Prep work for snapshots Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4ce41957a7370e398dd1ae960e5184af8315de35 Author: Kent Overstreet Date: Sat Mar 20 22:13:30 2021 -0400 bcachefs: Optimize bch2_btree_iter_verify_level() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5c1ec980f9984983c90dd08754ad2c28fec1acf1 Author: Kent Overstreet Date: Sat Mar 20 22:05:39 2021 -0400 bcachefs: Fix iterator picking comparison was wrong Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 73590619ec1b557c2dc64825d8d22f82f79ec8db Author: Kent Overstreet Date: Sun Mar 21 16:20:40 2021 -0400 bcachefs: Don't unconditially version_upgrade in initialize This is mkfs's job. Also, clean up the handling of feature bits some. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 84cc758d6b19ae8a92389306fe3510e58a08d90c Author: Kent Overstreet Date: Sun Mar 21 16:03:23 2021 -0400 bcachefs: Validate bset version field against sb version fields The superblock version fields need to be accurate to know whether a filesystem is supported, thus we should be verifying them. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d361a26d02b97e3f3c0e1563b62a5f7c32ef2f04 Author: Kent Overstreet Date: Fri Mar 19 16:37:24 2021 -0400 bcachefs: Don't overwrite snapshot field in bch2_cut_back() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7e6dbac98205ab32a6a924199f42e6496c4149db Author: Kent Overstreet Date: Fri Mar 19 23:19:05 2021 -0400 bcachefs: Kill bkey ops->debugcheck method This code used to be used for running some assertions on alloc info at runtime, but it long predates fsck and hasn't been good for much in ages - we can delete it now. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e9895f0ab950c0f37f9bb8ad7117f2abb2590411 Author: Kent Overstreet Date: Fri Mar 19 20:40:31 2021 -0400 bcachefs: Assert that iterators aren't being double freed Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 50dc0f692a0dbe3e6a95d3f8e5c7e718bc9f021d Author: Kent Overstreet Date: Fri Mar 19 20:29:11 2021 -0400 bcachefs: Require all btree iterators to be freed We keep running into occasional bugs with btree transaction iterators overflowing - this will make those bugs more visible. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8d956c2fb8f7e91370fea1d27d16c6869b8ada78 Author: Kent Overstreet Date: Fri Mar 19 22:54:18 2021 -0400 bcachefs: btree_iter_set_dontneed() This is a bit clearer than using bch2_btree_iter_free(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit abcecb49f5f3d24ec865a6c5830f135e12f9299e Author: Kent Overstreet Date: Fri Mar 19 22:34:54 2021 -0400 bcachefs: Fsck code refactoring Change fsck code to always put btree iterators - also, make some flow control improvements to deal with lock restarts better, and refactor check_extents() to not walk extents twice for counting/checking i_sectors. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit dbb93db9721e8d94e3d1a3c2217fc6265aace811 Author: Kent Overstreet Date: Fri Mar 19 16:32:46 2021 -0400 bcachefs: Fix btree iterator leak in extent_handle_overwrites() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ba401eaac380d9598b0a346290a77e43cb4b8211 Author: Kent Overstreet Date: Fri Mar 19 16:30:01 2021 -0400 bcachefs: Don't list non journal devs in journal_debug_to_text() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2c944fa12dc731bf43532d99a2bfbe8c4b7186e5 Author: Kent Overstreet Date: Fri Mar 19 13:23:01 2021 -0400 bcachefs: Add a print statement for when we go read-write Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f2eaea2fc18cfe8ea4e98a7ff573f2886ae94098 Author: Kent Overstreet Date: Tue Mar 16 01:52:55 2021 -0400 bcachefs: Kill btree_iter_pos_changed() this is used in only one place now, so just inline it into the caller. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 57447b7acccac0b7d75846ecfdfcd5a3421de3d0 Author: Kent Overstreet Date: Mon Mar 15 21:18:50 2021 -0400 bcachefs: Fix a btree iterator leak Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 87a432f5d7ee2b2baef6d7e115ceafa18e80f3a3 Author: Kent Overstreet Date: Mon Mar 15 17:26:19 2021 -0400 bcachefs: Kill reflink option An option was added to control whether reflink support was on or off because for a long time, reflink + inline data extent support was missing - but that's since been fixed, so we can drop the option now. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5ff75ccbbc3f262158e5bf02c639539a4da93a43 Author: Kent Overstreet Date: Sun Mar 14 21:30:08 2021 -0400 bcachefs: Fix read retry path for indirect extents In the read path, for retry of indirect extents to work we need to differentiate between the location in the btree the read was for, vs. the location where we found the data. This patch adds that plumbing to bch_read_bio. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c8d94403de0534030e43efce5c2f1d6c2d79dcda Author: Kent Overstreet Date: Fri Mar 12 20:29:28 2021 -0500 bcachefs: Consolidate bch2_read_retry and bch2_read() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 07bca3bd1e5423b2d6fe8c7085af3e92b31c461f Author: Kent Overstreet Date: Tue Mar 2 18:35:30 2021 -0500 bcachefs: Kill ei_str_hash Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5f0e4ae1c73efe9e4f74492df08202a5845bd19a Author: Kent Overstreet Date: Fri Mar 12 17:52:42 2021 -0500 bcachefs: Use __bch2_trans_do() in a few more places Minor cleanup, it was being open coded. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b3b66e30445e42a94fa171fad99e0b4e4e43c1ac Author: Kent Overstreet Date: Fri Mar 12 16:55:28 2021 -0500 bcachefs: Have fsck check for stripe pointers matching stripe Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 53b3e3c0e2f14f661cd61bbc9b82dc9383f783b9 Author: Kent Overstreet Date: Mon Mar 8 17:09:13 2021 -0500 bcachefs: Fix locking in bch2_btree_iter_traverse_cached() bch2_btree_iter_traverse() is supposed to ensure we have the correct type of lock - it was downgrading if necessary, but if we entered with a read lock it wasn't upgrading to an intent lock, oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c7bb769c81cca29462b39ea4689991b9b4d786fb Author: Kent Overstreet Date: Fri Feb 19 20:44:55 2021 -0500 bcachefs: __bch2_trans_get_iter() refactoring, BTREE_ITER_NOT_EXTENTS Signed-off-by: Kent Overstreet commit a045be5a0edb0f53770e6c6465155d3952e5bbde Author: Kent Overstreet Date: Thu Mar 4 22:40:41 2021 -0500 bcachefs: Simplify bch2_btree_iter_peek_prev() Since we added iter->real_pos, btree_iter_set_pos_to_(next|prev)_leaf no longer modify iter->pos, so we don't have to save it at the start anymore. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 27ace9cc01ea0ebb4a857c8d91e303fd7ab46b19 Author: Kent Overstreet Date: Thu Mar 4 22:11:28 2021 -0500 bcachefs: Simplify for_each_btree_key() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7d6f07edc28c3c34bad7e6a92921e3fbf8c8dd4e Author: Kent Overstreet Date: Thu Mar 4 19:06:26 2021 -0500 bcachefs: Fix compat code for superblock The bkey compat code wasn't being run for btree roots in the superblock clean section - this patch fixes it to use the journal entry validate code. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 61a19ce4255abd1133d4e7cd64a6cfa40d1f37fa Author: Kent Overstreet Date: Thu Mar 4 16:26:19 2021 -0500 bcachefs: Fix bpos_diff() Previously, bpos_diff() did not handle borrows correctly. Minor thing considering how it was used, but worth fixing. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f020bfcdb058e4542a4682557e046a750dc71660 Author: Kent Overstreet Date: Thu Mar 4 15:20:22 2021 -0500 bcachefs: Use bch2_bpos_to_text() more consistently Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 18fc6ae50312a88c8a109ab0f0e68c21a2a8ab1e Author: Kent Overstreet Date: Tue Mar 2 22:45:28 2021 -0500 bcachefs: btree_iter_prev_slot() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b8f0507915319ee8032b3c5b72f65f22812b9f91 Author: Kent Overstreet Date: Wed Mar 3 12:10:49 2021 -0500 bcachefs: Delete some dead code Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1f7fdc0abd743076dac6bc91b293a4ae1bb70e61 Author: Kent Overstreet Date: Sat Feb 20 22:19:34 2021 -0500 bcachefs: btree_iter_live() New helper to clean things up a bit - also, improve iter->flags handling. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6333bd2f1334595c553278c2580c1b155e319e43 Author: Kent Overstreet Date: Sat Feb 20 20:51:57 2021 -0500 bcachefs: Improve handling of extents in bch2_trans_update() The transaction update/commit path cares about whether it's inserting extents or regular keys; extents require extra passes (handling of overlapping extents) but sometimes we want to skip all that. This clarifies things by adding a new member to btree_insert_entry specifying whether the key being inserted is an extent, instead of overloading BTREE_ITER_IS_EXTENTS. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2436cb9fada98d477bb3508a30e520ab3bfaae3e Author: Kent Overstreet Date: Sat Feb 20 19:47:58 2021 -0500 bcachefs: Use x-macros for more enums This patch standardizes all the enums that have associated string tables (probably more enums should have string tables). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 41f8b09edc25d8ea1f4cee44a9931deb3cf8b9d6 Author: Kent Overstreet Date: Sat Feb 20 19:27:37 2021 -0500 bcachefs: Rename BTREE_ID enums for consistency with other enums Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 79f88eba01b1aafdec1fbf453954f5cd00dd56c1 Author: Kent Overstreet Date: Sat Feb 20 19:09:53 2021 -0500 bcachefs: Rename KEY_TYPE_whiteout -> KEY_TYPE_hash_whiteout Snapshots are going to need a different whiteout key type. Also, switch to using BCH_BKEY_TYPES() to define the bkey value accessors. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c052cf82f3d66ad5b680003cfacf67cbe0e9b1bb Author: Kent Overstreet Date: Fri Feb 19 23:41:40 2021 -0500 bcachefs: KEY_TYPE_discard is no longer used KEY_TYPE_discard used to be used for extent whiteouts, but when handling over overlapping extents was lifted above the core btree code it became unused. This patch updates various code to reflect that. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f2785955bbdf977bbfba4d20a7dc9db4bdffc4f1 Author: Kent Overstreet Date: Sat Feb 20 00:00:23 2021 -0500 bcachefs: Kill support for !BTREE_NODE_NEW_EXTENT_OVERWRITE() bcachefs has been aggressively migrating filesystems and btree nodes to the new format for quite some time - this shouldn't affect anyone anymore, and lets us delete a _lot_ of code. Also, it frees up KEY_TYPE_discard for a new whiteout key type for snapshots. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c043a3303c11cdf53ee98db67cee11931b626e22 Author: Kent Overstreet Date: Mon Dec 27 22:11:54 2021 -0500 bcachefs: Fix bch2_btree_cache_scan() It was counting nodes on the freed list that it skips - because we want to leave a few so that btree splits don't touch the allocator - as nodes that it touched, meaning that if it was called with <= 3 nodes to reclaim, and those nodes were on the freed list, it would never do any work. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9620c3ec2fa83e18f52e99b3dd2e8451446ca17e Author: Kent Overstreet Date: Sat Apr 24 00:24:25 2021 -0400 bcachefs: Add a mempool for the replicas delta list Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e131b6aa0a316f9724e6e8ad2f9be091c07115a7 Author: Kent Overstreet Date: Sat Apr 24 00:09:06 2021 -0400 bcachefs: Add a mempool for btree_trans bump allocator This allocation is required for filesystem operations to make forward progress, thus needs a mempool. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9ae28f824e1bcc922c8f20d6b502ed0388026e3a Author: Kent Overstreet Date: Mon Jun 21 16:30:52 2021 -0400 bcachefs: Start journal reclaim thread earlier Especially in userspace, we sometime run into resource exhaustion issues with starting up threads after mark and sweep/fsck. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2ee47eec44f0613d6c51d88f8c820a5e8ed624a3 Author: Kent Overstreet Date: Sun Apr 18 18:01:49 2021 -0400 bcachefs: Fix for copygc getting stuck waiting for reserve to be filled This fixes a regression from the patch bcachefs: Fix copygc dying on startup In general only the allocator thread itself should be updating ca->allocator_state, the thread waking up the allocator setting it is an ugly hack only needed to avoid racing with the copygc threads when we're first starting up. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit bae895a5a3300c2da605dd0c841e175c4c9e5872 Author: Kent Overstreet Date: Sun Apr 18 17:54:56 2021 -0400 bcachefs: Add allocator thread state to sysfs Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 51c66fedc0ea4a16d5d45f94a619c43897018da8 Author: Kent Overstreet Date: Sat Apr 17 20:24:54 2021 -0400 bcachefs: Rip out copygc pd controller We have a separate mechanism for ratelimiting copygc now - the pd controller has only been causing problems. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5bbe4bf95bdd18500c5de52e5d38a91fbb5f6234 Author: Kent Overstreet Date: Tue Apr 13 14:45:55 2021 -0400 bcachefs: Add copygc wait to sysfs Currently debugging an issue with copygc not running when it's supposed to, and this is an obvious first step. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit cb66fc5fe4cc806d60d8884cb82b67c357b49640 Author: Kent Overstreet Date: Tue Apr 13 09:49:23 2021 -0400 bcachefs: Fix copygc threshold Awhile back the meaning of is_available_bucket() and thus also bch_dev_usage->buckets_unavailable changed to include buckets that are owned by the allocator - this was so that the stat could be persisted like other allocation information, and wouldn't have to be regenerated by walking each bucket at mount time. This broke copygc, which needs to consider buckets that are reclaimable and haven't yet been grabbed by the allocator thread and moved onta freelist. This patch fixes that by adding dev_buckets_reclaimable() for copygc and the allocator thread, and cleans up some of the callers a bit. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 006d69aa2655f1a0ca4e47666939669f27bb740f Author: Kent Overstreet Date: Fri Apr 16 18:59:54 2021 -0400 bcachefs: Don't drop ptrs to btree nodes If a ptr gen doesn't match the bucket gen, the bucket likely doesn't contain the data we want - but it's still possible the data we want might have been overwritten, and for btree node pointers we can verify whether or not the node is the one we wanted with the node's sequence number, so it's better to keep the pointer and try reading from it. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d065472c3a7966b5104cce6901f329250f629758 Author: Kent Overstreet Date: Fri Apr 16 18:02:57 2021 -0400 bcachefs: Fix a use-after-free in bch2_gc_mark_key() bch2_check_fix_ptrs() can update/reallocate k Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 41e3778636cab27ef43e6e1b1cf3d8c2952cc77a Author: Kent Overstreet Date: Fri Apr 16 16:54:11 2021 -0400 bcachefs: Bring back metadata only gc This is useful for the filesystem dump debugging tool - when we're hitting bugs we want to skip as much of the recovery process as possible, and the dump tool only needs to know where metadata lives. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 98f2197de49b8eb038909e709c79c13178022dda Author: Kent Overstreet Date: Fri Apr 9 19:04:57 2021 -0400 bcachefs: Fix bch2_write_super to obey very_degraded option Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ed8269cc1d4107985aa92ade34cd3fe71315dd6a Author: Kent Overstreet Date: Fri Apr 2 23:41:10 2021 -0400 bcachefs: Don't fail mounts due to devices that are marked as failed If a given set of replicas is entirely on failed devices, don't fail the mount: we will still fail the mount if we have some copies on non failed devices. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1b05778707d04cb367a7ca8dbeff571b6117a191 Author: Kent Overstreet Date: Mon Apr 5 00:53:42 2021 -0400 bcachefs: Add a cond_seched() to the allocator thread This is just a band-aid fix for now. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 19dd3172b0002a3a5f8ead324db03a72c0cac2a2 Author: Kent Overstreet Date: Sun Apr 4 21:57:35 2021 -0400 bcachefs: Use x-macros for compat feature bits This is to generate strings for them, so that we can print them out. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 33a391a2551beca12926c77b16404f6aab2e8f58 Author: Kent Overstreet Date: Wed Mar 24 22:11:22 2021 -0400 bcachefs: Fix some (spurious) warnings about uninitialized vars These are only complained about when building in userspace, for some reason. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 220d206232ba682002b06feb68969e462867f8f5 Author: Kent Overstreet Date: Thu Mar 11 21:46:23 2021 -0500 bcachefs: Fix an allocator startup race Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e01dacf76c0c6a5fc6963b7857773b3d58740acb Author: Kent Overstreet Date: Sat Mar 20 23:55:36 2021 -0400 bcachefs: Fix bkey format generation for 32 bit fields Having a packed format that can represent a field larger than the unpacked type breaks bkey_packed_successor() assertions - we need to fix this to start using the snapshot filed. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a4805d6672aac04784af132f0e11ac1dfb208079 Author: Kent Overstreet Date: Mon Mar 22 18:39:16 2021 -0400 bcachefs: Scan for old btree nodes if necessary on mount We dropped support for !BTREE_NODE_NEW_EXTENT_OVERWRITE but it turned out there were people who still had filesystems with btree nodes in that format in the wild. This adds a new compat feature that indicates we've scanned for and rewritten nodes in the old format, and does that scan at mount time if the option isn't set. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1889ad5a1285ba452f6a8cef3df663087611050a Author: Kent Overstreet Date: Sun Mar 14 19:01:14 2021 -0400 bcachefs: Add code to scan for/rewite old btree nodes This adds a new data job type to scan for btree nodes in the old extent format, and rewrite them. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8567415457b25b467933e47ff78dca55a55f7206 Author: Kent Overstreet Date: Wed Feb 24 01:16:49 2021 -0500 bcachefs: Dump journal state when we get stuck We had a bug reported where the journal is failing to allocate a journal write - this should help figure out what's going on. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 514852c2b58f06f1643b10264b6bc9089071b05c Author: Kent Overstreet Date: Sat Feb 20 05:05:18 2021 -0500 bcachefs: Fix a 64 bit divide on 32 bit Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit fe38b720862204595f7b56b8db98ea5074c83f82 Author: Kent Overstreet Date: Sun Mar 7 21:43:21 2021 -0500 bcachefs: Don't use inode btree key cache in fsck code We had a cache coherency bug with the btree key cache in the fsck code - this fixes fsck to be consistent about not using it. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit bcdb4b9732208fb8d3c634661a1b581437dcdd12 Author: Kent Overstreet Date: Sun Mar 7 19:04:16 2021 -0500 bcachefs: Don't call into journal reclaim when we're not supposed to This was causing a deadlock when btree_update_nodes_writtes() invokes journal reclaim because of the btree cache being too dirty. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 59a7405161425df39d33faabf9f97c101fcb75d9 Author: Kent Overstreet Date: Fri Mar 5 18:00:55 2021 -0500 bcachefs: Create allocator threads when allocating filesystem We're seeing failures to mount because of a failure to start the allocator threads, which currently happens fairly late in the mount process, after walking all metadata, and kthread_create() fails if something has tried to kill the mount process, which is probably not what we want. This patch avoids this issue by creating, but not starting, the allocator threads when we preallocate all of our other in memory data structures. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 18a7b97239b6f0bae3fa1475cb276a273e07597a Author: Kent Overstreet Date: Tue Feb 23 21:41:25 2021 -0500 bcachefs: Fix for bch2_btree_node_get_noiter() returning -ENOMEM bch2_btree_node_get_noiter() isn't used from the btree iterator code, which retries with the btree node cache cannibalize lock held on -ENOMEM, so we should do it ourself if necessary. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit dab9ef0d271648c24b867059855439ec48775fc4 Author: Kent Overstreet Date: Tue Feb 23 15:16:41 2021 -0500 bcachefs: Add error message for some allocation failures Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8042b5b715e6722fb26e40724b87f93b4b777acf Author: Kent Overstreet Date: Wed Feb 10 16:13:57 2021 -0500 bcachefs: Extents may now cross btree node boundaries When snapshots arrive, we won't necessarily be able to arbitrarily split existis - when we need to split an existing extent, we'll have to check if the extent was overwritten in child snapshots and if so emit a whiteout for the split in the child snapshot. Because extents couldn't span btree nodes previously, journal replay would sometimes have to split existing extents. That's no good anymore, but fortunately since extent handling has already been lifted above most of the btree code there's no real need for that rule anymore. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7e1a3aa9dfcb9cd8f46085df86f158a1f23085dc Author: Kent Overstreet Date: Thu Feb 11 21:57:32 2021 -0500 bcachefs: iter->real_pos We need to differentiate between the search position of a btree iterator, vs. what it actually points at (what we found). This matters for extents, where iter->pos will typically be the start of the key we found and iter->real_pos will be the end of the key we found (which soon won't necessarily be in the same btree node!) and it will also matter for snapshots. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9f631dc14325df8acfa73c76299dbefb68582ee4 Author: Kent Overstreet Date: Tue Mar 9 19:37:40 2021 -0500 bcachefs: Ensure btree iterators are traversed in bch2_trans_commit() The upcoming patch to allow extents to span btree nodes will require this... and this assertion seems to be popping, and it's not a very good assertion anyways. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0507962f634bc3bada77bce9f3cd839e48aa5fb0 Author: Kent Overstreet Date: Wed Feb 17 13:37:22 2021 -0500 bcachefs: Drop invalid stripe ptrs in fsck More repair code, now that we can repair extents during initial gc. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0ef837a0cc87d49d9f7d29bdef5a57f07ecc84d3 Author: Robbie Litchfield Date: Wed Feb 10 13:18:13 2021 +1300 bcachefs: Fix unnecessary read amplificaiton when allocating ec stripes When allocating an erasure coding stripe, bcachefs will always reuse any partial stripes before reserving a new stripe. This causes unnecessary read amplification when preparing a stripe for writing. This patch changes bcachefs to always reserve new stripes first, only relying on stripe reuse when copygc needs more time to empty buckets from existing stripes. Signed-off-by: Robbie Litchfield Signed-off-by: Kent Overstreet commit 2bb748a69596e883cf9ea28321d43f8c6a225cef Author: Kent Overstreet Date: Fri Feb 12 20:53:29 2021 -0500 bcachefs: Fsck fixes Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9d4032617605144717892f0763b617568bd15ac3 Author: Kent Overstreet Date: Thu Feb 11 14:49:36 2021 -0500 bcachefs: Fix a shift greater than type size Found by UBSAN Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5ea037d03cabc219f5b2ccd72b7a33fa036c9bfc Author: Kent Overstreet Date: Wed Feb 10 13:39:48 2021 -0500 bcachefs: Assert that we're not trying to flush journal seq in the future Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3d4955952f05d5d0583bbb1fe4ce56c022f97847 Author: Kent Overstreet Date: Sun Feb 7 21:11:49 2021 -0500 bcachefs: Fix bch2_btree_iter_peek_prev() This makes bch2_btree_iter_peek_prev() and bch2_btree_iter_prev() consistent with peek() and next(), w.r.t. iter->pos. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 434094bec03e43472c96f8c8acd8e94820d2a7e4 Author: Kent Overstreet Date: Sun Feb 7 21:28:58 2021 -0500 bcachefs: bch2_btree_iter_advance_pos() This adds a new common helper for advancing past the last key returned by peek(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 792e2c4c850c75857e822fa40660a3b4733d5b8c Author: Kent Overstreet Date: Sun Feb 7 20:16:21 2021 -0500 bcachefs: Kill bch2_btree_iter_set_pos_same_leaf() The only reason we were keeping this around was for BTREE_INSERT_NOUNLOCK semantics - if bch2_btree_iter_set_pos() advances to the next leaf node, it'll drop the lock on the node that we just inserted to. But we don't rely on BTREE_INSERT_NOUNLOCK semantics for the extents btree, just the inodes btree, and if we do need it for the extents btree in the future we can do it more cleanly by cloning the iterator - this lets us delete some special cases in the btree iterator code, which is complicated enough as it is. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2b2c1a89cef6d19fc5a0995e550a67b1701d8bed Author: Kent Overstreet Date: Sun Feb 7 18:52:13 2021 -0500 bcachefs: Simplify btree_iter_(next|prev)_leaf() There's no good reason for these functions to not be using bch2_btree_iter_set_pos(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit eaf798317aa8fe3c8417ae1414c0b0bc58748881 Author: Kent Overstreet Date: Tue Feb 9 19:54:40 2021 -0500 bcachefs: Fix for hash_redo_key() in fsck It's possible we're calling hash_redo_key() because of a duplicate key - easiest fix for that is to just not use BCH_HASH_SET_MUST_CREATE. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6a16ad951ae4cb01dbfe73e8aa63045ee07e4581 Author: Kent Overstreet Date: Tue Feb 9 19:54:04 2021 -0500 bcachefs: Add flushed_seq_ondisk to journal_debug_to_text() Also, make the wait in bch2_journal_flush_seq() interruptible, not just killable. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit fcb3431be837d06ae9af6eedde6a6509881664de Author: Kent Overstreet Date: Sat Feb 6 23:17:26 2021 -0500 bcachefs: Redo checks for sufficient devices When the replicas mechanism was added, for tracking data by which drives it's replicated on, the check for whether we have sufficient devices was never updated to make use of it. This patch finally does that. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5d428c7c6445fc483f77eef82d17a744eeed73be Author: Kent Overstreet Date: Wed Feb 3 15:31:17 2021 -0500 bcachefs: Run fsck if BCH_FEATURE_alloc_v2 isn't set We're using BCH_FEATURE_alloc_v2 to also gate journalling updates to dev usage - we don't have the code for reconstructing this from buckets anymore, so we need to run fsck if it's not set. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4b8f89afd44592d50f7309750e7835fc777dfb08 Author: Kent Overstreet Date: Wed Feb 3 13:10:55 2021 -0500 bcachefs: Fixes/improvements for journal entry reservations This fixes some arithmetic bugs in "bcachefs: Journal updates to dev usage" - additionally, it cleans things up by switching everything that goes in every journal entry to the journal_entry_res mechanism. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 91f6ad6f947c96545eb7790569b279fdeac06153 Author: Kent Overstreet Date: Tue Feb 2 17:08:54 2021 -0500 bcachefs: Include device in btree IO error messages Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 180fb49dea90dfbac591b9b201a4dfb75159f5f0 Author: Kent Overstreet Date: Thu Jan 21 21:52:06 2021 -0500 bcachefs: Journal updates to dev usage This eliminates the need to scan every bucket to regenerate dev_usage at mount time. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2abe542087d9cb1bc7bb8ac7ae262afccbdb7aa6 Author: Kent Overstreet Date: Thu Jan 21 15:28:59 2021 -0500 bcachefs: Persist 64 bit io clocks Originally, bcachefs - going back to bcache - stored, for each bucket, a 16 bit counter corresponding to how long it had been since the bucket was read from. But, this required periodically rescaling counters on every bucket to avoid wraparound. That wasn't an issue in bcache, where we'd perodically rewrite the per bucket metadata all at once, but in bcachefs we're trying to avoid having to walk every single bucket. This patch switches to persisting 64 bit io clocks, corresponding to the 64 bit bucket timestaps introduced in the previous patch with KEY_TYPE_alloc_v2. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7f4e1d5d0faff0d72e9f6708bf98488d76533846 Author: Kent Overstreet Date: Fri Jan 22 18:01:07 2021 -0500 bcachefs: KEY_TYPE_alloc_v2 This introduces a new version of KEY_TYPE_alloc, which uses the new varint encoding introduced for inodes. This means we'll eventually be able to support much larger bucket sizes (for SMR devices), and the read/write time fields are expanded to 64 bits - which will be used in the next patch to get rid of the periodic rescaling of those fields. Also, for buckets that are members of erasure coded stripes, this adds persistent fields for the index of the stripe they're members of and the stripe redundancy. This is part of work to get rid of having to scan and read into memory the alloc and stripes btrees at mount time. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 26452d1dcd4b134ecc7aeaae74f78de1c525caf3 Author: Kent Overstreet Date: Tue Feb 2 15:56:44 2021 -0500 bcachefs: Add missing call to bch2_replicas_entry_sort() This fixes a bug introduced by "bcachefs: Improve diagnostics when journal entries are missing" - devices in a replicas entry are supposed to be sorted. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a28bd48a7fc15c99222059a796b3a3c29184b899 Author: Kent Overstreet Date: Fri Jan 29 13:58:10 2021 -0500 bcachefs: Add an assertion to check for journal writes to same location Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d042b0402cff3278d9fa6056cf3d3063bf196716 Author: Kent Overstreet Date: Fri Jan 29 15:37:28 2021 -0500 bcachefs: Add an option for metadata_target Also, make journal writes obey foreground_target and metadata_target. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5fc70d3a54e4b0e7f7ad1baec564e3987cb6ee0e Author: Kent Overstreet Date: Wed Jan 27 19:08:54 2021 -0500 bcachefs: Repair bad data pointers Now that we can repair metadata during GC, we can handle bad pointers that would trigger errors being marked, when they need to just be dropped. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a0b73c1c5363f5e2cd9a7a7968a9d6579548050a Author: Kent Overstreet Date: Tue Jan 26 20:59:00 2021 -0500 bcachefs: Add (partial) support for fixing btree topology When we walk the btrees during recovery, part of that is checking that btree topology is correct: for every interior btree node, its child nodes should exactly span the range the parent node covers. Previously, we had checks for this, but not repair code. Now that we have the ability to do btree updates during initial GC, this patch adds that repair code. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5b593ee172bd536a2c9fd717de7e4a16d682ef23 Author: Kent Overstreet Date: Tue Jan 26 20:15:46 2021 -0500 bcachefs: Add support for doing btree updates prior to journal replay Some errors may need to be fixed in order for GC to successfully run - walk and mark all metadata. But we can't start the allocators and do normal btree updates until after GC has completed, and allocation information is known to be consistent, so we need a different method of doing btree updates. Fortunately, we already have code for walking the btree while overlaying keys from the journal to be replayed. This patch adds an update path that adds keys to the list of keys to be replayed by journal replay, and also fixes up iterators. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 51d2dfb82d0553c5764689d30adabbf6d0927be5 Author: Kent Overstreet Date: Tue Jan 26 20:13:54 2021 -0500 bcachefs: Add BTREE_PTR_RANGE_UPDATED This is so that when we discover btree topology issues, we can just update the pointer to a btree node and signal btree read path that the min/max keys in the node header should be updated from the node pointer. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a66f7989742a0071ea4d5d0b0674978ac8ce30ab Author: Kent Overstreet Date: Tue Jan 26 16:04:38 2021 -0500 bcachefs: Refactor checking of btree topology Still a lot of work to be done here: we can't yet repair btree topology issues, but this patch refactors things so that we have better access to what we need in the topology checks. Next up will be figuring out a way to do btree updates during gc, before journal replay is done. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e4c3f386b62d8f7e917b26089c7dea374f7c1fb6 Author: Kent Overstreet Date: Tue Jan 26 16:04:12 2021 -0500 bcachefs: Improve diagnostics when journal entries are missing There's an outstanding bug with journal entries being missing in journal replay. This patch adds code to print out where the journal entries were physically located that were around the entry(ies) being missing, which should make debugging easier. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 522c25f068bd5df5e1bc623e855262afd90e4a05 Author: Kent Overstreet Date: Tue Jan 26 21:22:19 2021 -0500 bcachefs: Fix BCH_REPLICAS_MAX check Ideally, this limit will be going away in the future. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0093a50f2759f6e58fe44bafb80146fd2ef4d6a2 Author: Kent Overstreet Date: Wed Jan 27 19:36:09 2021 -0500 bcachefs: Fix build in userspace The userspace bch_err() macro doesn't use the filesystem argument. Could also be fixed with a better macro. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4529ae09cea2c040180e991ea648588220611497 Author: Kent Overstreet Date: Mon Jan 25 14:04:31 2021 -0500 bcachefs: Fix an assertion If we're invalidating a bucket that has cached data in it, data_type won't be 0 - oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit bfcf840ddf0697f991f2591b56a9f1969accbd23 Author: Kent Overstreet Date: Fri Jan 22 17:56:34 2021 -0500 bcachefs: Mark superblocks transactionally More work towards getting rid of the in memory struct bucket: this path adds code for marking superblock and journal buckets via the btree, and uses it in the device add and journal resize paths. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9afc6652d14ac83ef9c5ce3544becad22ea50baa Author: Kent Overstreet Date: Fri Jan 22 18:19:15 2021 -0500 bcachefs: Kill bch2_invalidate_bucket() This patch is working towards eventually getting rid of the in memory struct bucket, and relying only on the btree representation. Since bch2_invalidate_bucket() was only used for incrementing gens, not invalidating cached data, no other counters were being changed as a side effect - meaning it's safe for the allocator code to increment the bucket gen directly. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 72eab8da47b211f50d0b68548e4cf070efb0c7ef Author: Kent Overstreet Date: Thu Jan 21 20:51:51 2021 -0500 bcachefs: Refactor dev usage This is to make it more amenable for serialization. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 079663d8ed81bfd74a331b819eda17d753719605 Author: Kent Overstreet Date: Thu Jan 21 21:51:42 2021 -0500 bcachefs: Kill metadata only gc This was useful before we had transactional updates to interior btree nodes - but now, it's just extra unneeded complexity. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b7cf4bd7fe689534f77455b7d60f5033b9a3bd28 Author: Kent Overstreet Date: Thu Jan 21 19:30:35 2021 -0500 bcachefs: Ensure __bch2_trans_commit() always calls bch2_trans_reset() This was leading to a very strange bug in bch2_bucket_io_time_reset(), where we'd retry without clearing out the list of updates. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit fdbb88ac019462efcdcf83927e004e74088831f4 Author: Kent Overstreet Date: Thu Jan 21 19:15:49 2021 -0500 bcachefs: Fix a faulty assertion If journal replay hasn't finished, the journal can't be empty - oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e46b85573434b4e0c9f8eee4ac21d90643a97454 Author: Kent Overstreet Date: Thu Jan 21 19:14:37 2021 -0500 bcachefs: Switch replicas.c allocations to GFP_KERNEL We're transitioning to memalloc_nofs_save/restore instead of GFP flags with the rest of the kernel, and GFP_NOIO was excessively strict and causing unnnecessary allocation failures - these allocations are done with btree locks dropped. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b4725cc1a45fa859e6ff0966f5fa988d6402e5c8 Author: Kent Overstreet Date: Thu Jan 21 14:42:23 2021 -0500 bcachefs: Fix loopback in dio mode We had a deadlock on page_lock, because buffered reads signal completion by unlocking the page, but the dio read path normally dirties the pages it's reading to with set_page_dirty_lock. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ef470b4817e6592fdb22b566380d289d7c42a17d Author: Kent Overstreet Date: Wed Jan 20 19:42:09 2021 -0500 bcachefs: Clean up bch2_extent_can_insert It was using an internal btree node iterator interface, when bch2_btree_iter_peek_slot() sufficed. We were hitting a null ptr deref that looked like it was from the iterator not being uptodate - this will also fix that. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a5cd80ea99e544b67acde573fc2a2dd68659fd40 Author: Kent Overstreet Date: Wed Jan 20 17:31:31 2021 -0500 bcachefs: Fix an assertion pop There was a race: btree node writes drop their reference on journal pins before clearing the btree_node_write_in_flight flag. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 33ccd7188e37ad5d9d662e7450610768bc8cc8a9 Author: Kent Overstreet Date: Mon Jan 18 20:20:24 2021 -0500 bcachefs: Don't allocate stripes at POS_MIN In the future, stripe index 0 will be a sentinal value. This patch doesn't disallow stripes at POS_MIN yet, leaving that for when we do the on disk format changes. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6c7585b098c519c157cca4ca1c974321f3903ad4 Author: Kent Overstreet Date: Mon Jan 18 23:26:42 2021 -0500 bcachefs: Rework allocating buckets for stripes Allocating buckets for existing stripes was busted, in part because the data structures were too contorted. This reworks new stripes so that we have an array of open buckets that matches blocks in the stripe, and it's sparse if we're reusing an existing stripe. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f9ef45ad434ba85363aab6d74fa48499f7ea6499 Author: Kent Overstreet Date: Mon Jan 18 19:59:03 2021 -0500 bcachefs: Verify transaction updates are sorted A user reported a bug that implies they might not be correctly sorted, this should help track that down. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c6e658ee9f7f7d1da410ada1c3174fe46541c454 Author: Kent Overstreet Date: Sun Jan 17 17:43:49 2021 -0500 bcachefs: Preserve stripe blockcounts on existing stripes Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6e53151b7b738fe60b9295c2ff47e6b2092718b1 Author: Kent Overstreet Date: Sun Jan 17 16:45:19 2021 -0500 bcachefs: Kill stripe->dirty This makes bch2_stripes_write() work more like bch2_alloc_write(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a39c74be8059be72fcf6c7cc2f827c38076a25db Author: Kent Overstreet Date: Sun Jan 17 16:16:37 2021 -0500 bcachefs: Fix gc updating stripes info The primary stripes radix tree can be sparse, which was causing an assertion to pop because the one use for gc isn't. Fix this by changing the algorithm to copy between the two radix trees. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2ef220cba297ef381a980572154fd17aa2a7e3de Author: Kent Overstreet Date: Sun Jan 17 15:18:11 2021 -0500 bcachefs: Fix double counting of stripe block counts by GC Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit cd9f3dfe58709c7b0793a706d0dd0292a66237d5 Author: Kent Overstreet Date: Sun Jan 17 13:19:16 2021 -0500 bcachefs: Fix integer overflow in bch2_disk_reservation_get() The sectors argument shouldn't have been a u32 - it can be up to U32_MAX (i.e. fallocate creating persistent reservations), and if replication is enabled we'll overflow when we calculate the real number of sectors to reserve. Oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 280249b9d9b9a62562ddeb5429a7d29d2f03ba1c Author: Kent Overstreet Date: Sat Jan 16 15:40:33 2021 -0500 bcachefs: Correctly order flushes and journal writes on multi device filesystems All writes prior to a journal write need to be flushed before the journal write itself happens. On single device filesystems, it suffices to mark the write with REQ_PREFLUSH|REQ_FUA, but on multi device filesystems we need to issue flushes to every device - and wait for them to complete - before issuing the journal writes. Previously, we were issuing flushes to every device, but we weren't waiting for them to complete before issuing the journal writes. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ed9d58a2b1ddbc38816571638ee114b7efb9f279 Author: Kent Overstreet Date: Thu Jan 14 16:21:22 2021 -0500 bcachefs: Run jset_validate in write path as well This is because we had a bug where we were writing out journal entries with garbage last_seq, and not catching it. Also, completely ignore jset->last_seq when JSET_NO_FLUSH is true, because of aforementioned bug, but change the write path to set last_seq to 0 when JSET_NO_FLUSH is true. Minor other cleanups and comments. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ac958006294ab462848bc69b9b5ddb1a8b99e748 Author: Kent Overstreet Date: Thu Jan 14 16:19:23 2021 -0500 bcachefs: Factor out bch2_ec_stripes_heap_start() This fixes a bug where mark and sweep gc incorrectly was clearing out the stripes heap and causing assertions to fire later - simpler to just create the stripes heap after gc has finished. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit edfbba58e3e7a94900d24d266e6365b1ab531e3b Author: Kent Overstreet Date: Mon Jan 11 16:11:02 2021 -0500 bcachefs: Add btree node prefetching to bch2_btree_and_journal_walk() bch2_btree_and_journal_walk() walks the btree overlaying keys from the journal; it was introduced so that we could read in the alloc btree prior to journal replay being done, when journalling of updates to interior btree nodes was introduced. But it didn't have btree node prefetching, which introduced a severe regression with mount times, particularly on spinning rust. This patch implements btree node prefetching for the btree + journal walk, hopefully fixing that. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2a3731e34de9365038b25d76bb6e11cf5c40ac36 Author: Kent Overstreet Date: Mon Jan 11 13:51:23 2021 -0500 bcachefs: Erasure coding fixes & refactoring - Originally bch_extent_stripe_ptr didn't contain the block index, instead we'd have to search through the stripe pointers to figure out which pointer matched. When the block field was added to bch_extent_stripe_ptr, not all of the code was updated to use it. This patch fixes that, and we also now verify that field where it makes sense. - The ec_stripe_buf_init/exit() functions have been improved, and are now used by the bch2_ec_read_extent() (recovery read) path. - get_stripe_key() is now used by bch2_ec_read_extent(). - We now have a getter and setter for checksums within a stripe, like we had previously for block sector counts, and ec_generate_checksums and ec_validate_checksums are now quite a bit smaller and cleaner. ec.c still needs a lot of work, but this patch is slowly moving things in the right direction. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b929bbef6f9284350ad3e23a77a822a5bb2fec3d Author: Kent Overstreet Date: Mon Jan 11 13:37:35 2021 -0500 bcachefs: Add cannibalize lock to btree_cache_to_text() More debugging info is always a good thing. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 032ac32c516403cd0d5ebf30e233746271a7ddcc Author: Kent Overstreet Date: Tue Apr 27 14:18:22 2021 -0400 bcachefs: Fix .splice_write Signed-off-by: Kent Overstreet commit 53ef2c5cc991a9c5aecc7b85754695df5cc5de45 Author: Kent Overstreet Date: Sun Jan 10 13:38:09 2021 -0500 bcachefs: Fix bch2_replicas_gc2 This fixes a regression introduced by "bcachefs: Refactor filesystem usage accounting". We have to include all the replicas entries that have any of the entries for different journal entries nonzero, we can't skip them if they sum to zero. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4291a3317f3724283023f35802c47083a05b938d Author: Kent Overstreet Date: Fri Jan 8 21:20:58 2021 -0500 bcachefs: bch2_alloc_write() should be writing for all devices Alloc info isn't stored on a particular device, it makes no sense to only be writing it out for rw members - this was causing fsck to not fix alloc info errors, oops. Also, make sure we write out alloc info in other repair paths. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit dcf64dfbbc3c3c46af5508afed9f46e906fcd748 Author: Kent Overstreet Date: Fri Jan 8 10:56:39 2021 -0500 bcachefs: Fix btree node split after merge operations A btree node merge operation deletes a key in the parent node; if when inserting into the parent node we split the parent node, we can end up with a whiteout in the parent node that we don't want. The existing code drops them before doing the split, because they can screw up picking the pivot, but we forgot about the unwritten writeouts area - that needs to be cleared out too. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 890e3f5bf7e8d6035179c5f4668e0d30c19e9541 Author: Kent Overstreet Date: Thu Jan 7 17:18:14 2021 -0500 bcachefs: Reserve some open buckets for btree allocations This reverts part of the change from "bcachefs: Don't use BTREE_INSERT_USE_RESERVE so much" - it turns out we still should be reserving open buckets for btree node allocations, because otherwise data bucket allocations (especially with erasure coding enabled) can use up all our open buckets and we won't be able to do the metadata update that lets us release those open bucket references. Oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit fd54c40e00dc54cf1cd1724e4184502a56b9848f Author: Kent Overstreet Date: Thu Jan 7 17:06:22 2021 -0500 bcachefs: Work around a zstd bug The zstd compression code seems to have a bug where it will write just past the end of the destination buffer - probably only when the compressed output isn't going to fit in the destination buffer, which will never happen if you're always allocating a bigger buffer than the source buffer which would explain other users not hitting it. But, we size the buffer according to how much contiguous space on disk we have, so... generally, bugs like this don't write more than a word past the end of the buffer, so an easy workaround is to subtract a fudge factor from the buffer size. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 29d90f61eb341018ab571e7f8ceb8ff39cf5353a Author: Kent Overstreet Date: Wed Jan 6 18:49:35 2021 -0500 bcachefs: Don't error out of recovery process on journal read error We don't want to fail the recovery/mount because of a single error reading from the journal - the relevant journal entry may still be found on other devices, and missing or no journal entries found is already handled later in the recovery process. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c859430b1728d59ca6e4d7e9356db82979e2fd5b Author: Kent Overstreet Date: Mon Jan 4 15:46:57 2021 -0500 bcachefs: Fix journal_buf_realloc() It used to be safe to reallocate a buf that the write path owns without holding the journal lock, but now this can trigger an assertion in journal_seq_to_buf(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 07a1006ae81580c6a1b52b80e32fa9dadea1954b Author: Kent Overstreet Date: Thu Dec 17 15:08:58 2020 -0500 bcachefs: Reduce/kill BKEY_PADDED use With various newer key types - stripe keys, inline data extents - the old approach of calculating the maximum size of the value is becoming more and more error prone. Better to switch to bkey_on_stack, which can dynamically allocate if necessary to handle any size bkey. In particular we also want to get rid of BKEY_EXTENT_VAL_U64s_MAX. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8deed5f4e547e675cf8c1de88720c23c3c3093ca Author: Kent Overstreet Date: Tue Dec 15 12:53:30 2020 -0500 bcachefs: Use separate new stripes for copygc and non-copygc Allocations for copygc have to be kept separate from everything else, so that copygc doesn't get starved. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2c40a2403e2b25aca38ba728385657dfca560a62 Author: Kent Overstreet Date: Tue Dec 15 12:38:17 2020 -0500 bcachefs: Change allocations for ec stripes to blocking We don't want writes to not get erasure coded just because the allocator temporarily wasn't keeping up. However, it's not guaranteed that these allocations will ever succeed, we can currently get stuck - especially if devices are different sizes - we still have work to do in this area. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 81d8599e192e85fa7e01d8a6e8e4095177ff46a3 Author: Kent Overstreet Date: Mon Dec 14 19:41:03 2020 -0500 bcachefs: Don't read existing stripes synchronously in write path Previously, in the stripe creation path, when reusing an existing stripe we'd read the existing stripe synchronously - ouch. Now, we allocate two stripe bufs if we're using an existing stripe, so that we can do the read asynchronously - and, we read the full stripe so that we can run recovery, if necessary. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 35a067b42dcfd884fb132128ae94f240c6511fea Author: Kent Overstreet Date: Mon Dec 14 21:59:33 2020 -0500 bcachefs: Change when we allow overwrites Originally, we'd check for -ENOSPC when getting a disk reservation whenever the new extent took up more space on disk than the old extent. Erasure coding screwed this up, because with erasure coding writes are initially replicated, and then in the background the extra replicas are dropped when the stripe is created. This means that with erasure coding enabled, writes will always take up more space on disk than the data they're overwriting - but, according to posix, overwrites aren't supposed to return ENOSPC. So, in this patch we fudge things: if the new extent has more replicas than the _effective_ replicas of the old extent, or if the old extent is compressed and the new one isn't, we check for ENOSPC when getting the disk reservation - otherwise, we don't. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3187aa8d57025f60f1b8f9e14b6fc33f5e2d2960 Author: Kent Overstreet Date: Mon Dec 21 17:17:18 2020 -0500 bcachefs: Don't use BTREE_INSERT_USE_RESERVE so much Previously, we were using BTREE_INSERT_RESERVE in a lot of places where it no longer makes sense. - we now have more open_buckets than we used to, and the reserves work better, so we shouldn't need to use BTREE_INSERT_RESERVE just because we're holding open_buckets pinned anymore. - We have the btree key cache for updates to the alloc btree, meaning we no longer need the btree reserve to ensure the allocator can make forward progress. This means that we should only need a reserve for btree updates to ensure that copygc can make forward progress. Since it's now just for copygc, we can also fold RESERVE_BTREE into RESERVE_MOVINGGC (the allocator's freelist reserve). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f0e70018d14ef94a5f680c977591ccb6cf29e9ca Author: Kent Overstreet Date: Sun Dec 20 21:42:19 2020 -0500 bcachefs: Fix iterator overflow in move path The move path was calling bch2_bucket_io_time_reset() for cached pointers (which it shouldn't have been), and then not calling bch2_trans_reset() when it got -EINTR (indicating transaction restart). Oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 07bd4c285b79e068d2e6986a4cc60703434f1eed Author: Kent Overstreet Date: Sat Dec 19 21:31:05 2020 -0500 bcachefs: Fix btree lock being incorrectly dropped __btree_trans_get_iter() was using bch2_btree_iter_upgrade, but it shouldn't have been because on failure bch2_btree_iter_upgrade may drop locks in other iterators, expecting the transaction to be restarted. But __btree_trans_get_iter can't return an error to indicate that we need to restart thet transaction - oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e323edd6d39094ce021dbb20e513b03ae6ebecbe Author: Kent Overstreet Date: Sat Dec 19 15:39:10 2020 -0500 bcachefs: Fix for spinning in journal reclaim on startup We normally avoid having too many dirty keys in the btree key cache, to ensure that we can always shrink our caches to reclaim memory if needed. But this check was causing us to go into an infinite loop on startup, in the btree insert path before journal reclaim was started. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d483dd17e2bfd6858498d39eb92abd232d7b8e97 Author: Kent Overstreet Date: Wed Dec 16 15:41:29 2020 -0500 bcachefs: Fix race between journal_seq_copy() and journal_seq_drop() In bch2_btree_interior_update_will_free_node, we copy the journal pins from outstanding writes on the btree node we're about to free. But, this can race with the writes completing, and dropping their journal pins. To guard against this, just use READ_ONCE() in bch2_journal_pin_copy(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f30dd8601262c74caf148fe834418ad7c931af66 Author: Kent Overstreet Date: Fri Oct 16 21:39:16 2020 -0400 bcachefs: Don't write bucket IO time lazily With the btree key cache code, we don't need to update the alloc btree lazily - and this will mean we can remove the bch2_alloc_write() call in the shutdown path. Future work: we really need to expend the bucket IO clocks from 16 to 64 bits, so that we don't have to rescale them. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ffb7c3d370a104d14ad0658b359cdf04ae679f04 Author: Kent Overstreet Date: Wed Dec 16 14:23:27 2020 -0500 bcachefs: Add BCH_BKEY_PTRS_MAX This now means "the maximum number of pointers within a bkey" - and bch_devs_list is updated to use it instead of BCH_REPLICAS_MAX, since stripes can contain more than BCH_REPLICAS_MAX pointers. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ded54580bdf18ba3a2b38e7910c54b1c53f007c6 Author: Kent Overstreet Date: Wed Dec 16 14:18:33 2020 -0500 bcachefs: Check for duplicate device ptrs in bch2_bkey_ptrs_invalid() This is something we clearly should be checking for, but weren't - oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1d8305c11a289a13591d4c51726803cd37d8f646 Author: Kent Overstreet Date: Sun Dec 13 16:12:04 2020 -0500 bcachefs: Add some cond_rescheds() in shutdown path Particularly on emergency shutdown we can end up having to clean up a lot of dirty cached btree keys here. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 537c49d6afadb4be54be03c9a8cb1f1ade07b104 Author: Kent Overstreet Date: Fri Dec 11 12:02:48 2020 -0500 bcachefs: Fix btree node merge -> split operations If a btree node merger is followed by a split or compact of the parent node, we could end up with the parent btree node iterator pointing to the whiteout inserted by the btree node merge operation - the fix is to ensure that interior btree node iterators always point to the first non whiteout. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5b9bf43c81e6c0fd9d4f16351d53f26e7e6d19b5 Author: Kent Overstreet Date: Thu Dec 10 13:38:54 2020 -0500 bcachefs: Always check if we need disk res in extent update path With erasure coding, we now have processes in the background that compact data, causing it to take up less space on disk than when it was written, or potentially when it was read. This means that we can't trust the page cache when it says "we have data on disk taking up x amount of space here" - there's always the potential to race with background compaction. To fix this, just check if we need to add to our disk reservation in the bch2_extent_update() path, in the transaction that will do the btree update. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 719fe7fb555ad9a53bb847bfae1cad7170cb2591 Author: Kent Overstreet Date: Thu Dec 10 13:13:56 2020 -0500 bcachefs: Update transactional triggers interface to pass old & new keys This is needed to fix a bug where we're overflowing iterators within a btree transaction, because we're updating the stripes btree (to update block counts) and the stripes btree trigger is unnecessarily updating the alloc btree - it doesn't need to update the alloc btree when the pointers within a stripe aren't changing. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 66bddc6c2b389a65708c27e7e7a9969e645ca799 Author: Kent Overstreet Date: Wed Dec 9 13:39:30 2020 -0500 bcachefs: Only try to get existing stripe once in stripe create path The stripe creation path was too state-machiney: it would always run the full state machine until it had succesfully created a new stripe. But if we tried to get and reuse an existing stripe after we'd already allocated some buckets, the buckets we'd allocated might have conflicted with the blocks in the existing stripe we need to keep - oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit cc578a36f9953c32a8ba866ee1878fcbb99a9746 Author: Kent Overstreet Date: Wed Dec 9 13:34:42 2020 -0500 bcachefs: Fix __btree_iter_next() when all iters are in use_next() when all iters are in use Also, print out more information on btree transaction iterator overflow. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d5b98fe2d764170e7a30eda8b94780aa6a0af129 Author: Kent Overstreet Date: Mon Dec 7 11:44:12 2020 -0500 bcachefs: Fix rand_delete() test When we didn't find a key to delete we were getting a null ptr deref. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a2bfc8412ad8da289b933810232cf95f7739340a Author: Kent Overstreet Date: Sun Dec 6 16:30:02 2020 -0500 bcachefs: Try to print full btree error message Metadata corruption bugs are hard to debug if we can't see exactly what went wrong - try to allocate a bigger buffer so we can print out everything we have. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b18df768ebf71196c3620d1e5f23f064c1ba1485 Author: Kent Overstreet Date: Sun Dec 6 16:29:13 2020 -0500 bcachefs: Prevent journal reclaim from spinning Without checking if we actually flushed anything, journal reclaim could still go into an infinite loop while trying ot shut down. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f51e84fe24d8d170bfbba626e76ee08b1ab7b283 Author: Kent Overstreet Date: Sat Dec 5 21:03:57 2020 -0500 bcachefs: Fix btree key cache dirty checks Had a type that meant we were triggering journal reclaim _much_ more aggressively than needed. Also, fix a potential integer overflow. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5d32c5bb076e76232e56fd44c537046abd54d32c Author: Kent Overstreet Date: Sat Dec 5 16:25:05 2020 -0500 bcachefs: Be more conservation about journal pre-reservations - Try to always keep 1/8th of the journal free, on top of pre-reservations - Move the check for whether the journal is stuck to bch2_journal_space_available, and make it only fire when there aren't any journal writes in flight (that might free up space by updating last_seq) Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit adbcada43fa79197224b5a522b1faaf222b43bcd Author: Kent Overstreet Date: Sat Nov 14 09:59:58 2020 -0500 bcachefs: Don't require flush/fua on every journal write This patch adds a flag to journal entries which, if set, indicates that they weren't done as flush/fua writes. - non flush/fua journal writes don't update last_seq (i.e. they don't free up space in the journal), thus the journal free space calculations now check whether nonflush journal writes are currently allowed (i.e. are we low on free space, or would doing a flush write free up a lot of space in the journal) - write_delay_ms, the user configurable option for when open journal entries are automatically written, is now interpreted as the max delay between flush journal writes (default 1 second). - bch2_journal_flush_seq_async is changed to ensure a flush write >= the requested sequence number has happened - journal read/replay must now ignore, and blacklist, any journal entries newer than the most recent flush entry in the journal. Also, the way the read_entire_journal option is handled has been improved; struct journal_replay now has an entry, 'ignore', for entries that were read but should not be used. - assorted refactoring and improvements related to journal read in journal_io.c and recovery.c Previously, we'd have to issue a flush/fua write every time we accumulated a full journal entry - typically the bucket size. Now we need to issue them much less frequently: when an fsync is requested, or it's been more than write_delay_ms since the last flush, or when we need to free up space in the journal. This is a significant performance improvement on many write heavy workloads. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b6df4325cd914d988e5b96016f64b879058d0bc6 Author: Kent Overstreet Date: Sat Nov 14 12:29:21 2020 -0500 bcachefs: Improve journal free space calculations Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ebb84d094141eac9ee3e22d95abc9792a1c79eca Author: Kent Overstreet Date: Fri Nov 13 18:36:33 2020 -0500 bcachefs: Increase journal pipelining This patch increases the maximum journal buffers in flight from 2 to 4 - this will be particularly helpful when in the future we stop requiring flush+fua for every journal write. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5db43418d5097b8aca5c725eb301186dee04c70a Author: Kent Overstreet Date: Thu Dec 3 16:20:18 2020 -0500 bcachefs: Don't issue btree writes that weren't journalled If we have an error in the btree interior update path that prevents us from journalling the update, we can't issue the corresponding btree node write - we didn't get a journal sequence number that would cause it to be ignored in recovery. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit afa7cb0c36bd511362bcb03c6db8af74186176bf Author: Kent Overstreet Date: Thu Dec 3 13:23:58 2020 -0500 bcachefs: Check for errors in bch2_journal_reclaim() If the journal is halted, journal reclaim won't necessarily be able to make any forward progress, and won't accomplish anything anyways - we should bail out so that we don't get stuck looping in reclaim when the caches are too dirty and we should be shutting down. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 33c74e4119a91c3ae87fc207777e34fdbb613c66 Author: Kent Overstreet Date: Thu Dec 3 14:27:20 2020 -0500 bcachefs: Flag inodes that had btree update errors On write error, the vfs inode's i_size may be inconsistent with the btree inode's i_size - flag this so we don't have spurious assertions. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0fefe8d8ef74029e9f3676ef9613ef022ae6dbd6 Author: Kent Overstreet Date: Thu Dec 3 13:57:22 2020 -0500 bcachefs: Improve some IO error messages it's useful to know whether an error was for a read or a write - this also standardizes error messages a bit more. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f299d57350b2450c522dc7780400ce811f4847ec Author: Kent Overstreet Date: Fri Nov 13 18:36:33 2020 -0500 bcachefs: Refactor filesystem usage accounting Various filesystem usage counters are kept in percpu counters, with one set per in flight journal buffer. Right now all the code that deals with it assumes that there's only two buffers/sets of counters, but the number of journal bufs is getting increased to 4 in the next patch - so refactor that code to not assume a constant. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7bfbbd88024d70947761e482c856522b43a98d87 Author: Kent Overstreet Date: Wed Dec 2 18:30:06 2020 -0500 bcachefs: Fix spurious alloc errors on forced shutdown Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b206df6e15ca85d0bb777a5548834c8685e99bc8 Author: Kent Overstreet Date: Thu Dec 3 13:09:08 2020 -0500 bcachefs: Fix some spurious gcc warnings These only come up when building in userspace, for some reason. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c5bb1690346167888d3b2834b4b11d9cfa682583 Author: Kent Overstreet Date: Wed Dec 2 15:33:12 2020 -0500 bcachefs: Fix journal_flush_seq() The error check was inverted - leading fsyncs to get stuck and hang, oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3eb26d0157781c262a85f13c20de92889f1a2a8f Author: Kent Overstreet Date: Tue Dec 1 23:11:53 2020 -0500 bcachefs: bch2_trans_get_iter() no longer returns errors Since we now always preallocate the maximum number of iterators when we initialize a btree transaction, getting an iterator never fails - we can delete a fair amount of error path code. This patch also simplifies the iterator allocation code a bit. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ec3d21a9f25d495e0b6042a25f27cc711390195b Author: Kent Overstreet Date: Tue Dec 1 12:23:55 2020 -0500 bcachefs: Add error handling to unit & perf tests This way, these tests can be used with tests that inject IO errors and shut down the filesystem. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 231db03c571ba3065a32999f4f76a5482c6557e7 Author: Kent Overstreet Date: Tue Dec 1 11:48:08 2020 -0500 bcachefs: Journal pin refactoring This deletes some duplicated code. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 34c1cd6a59bf1a72bb1b672df35f9d819c81bfde Author: Kent Overstreet Date: Tue Dec 1 11:42:23 2020 -0500 bcachefs: Fix for fsck spuriously finding duplicate extents Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2e9f3b88858e4a36657e850edc58db0e2954a141 Author: Kent Overstreet Date: Tue Dec 1 11:40:59 2020 -0500 bcachefs: Use BTREE_ITER_PREFETCH in journal+btree iter Introducing the journal+btree iter introduced a regression where we stopped using BTREE_ITER_PREFETCH - this is a performance regression on rotating disks. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 04e23a566fa9f41228408a7829b4462fb62e42c9 Author: Kent Overstreet Date: Mon Nov 30 02:08:14 2020 -0500 bcachefs: Ensure we always have a journal pin in interior update path For the new nodes an interior btree update makes reachable, updates to those nodes may be journalled after the btree update starts but before the transactional part - where we make those nodes reachable. Those updates need to be kept in the journal until after the btree update completes, hence we should always get a journal pin at the start of the interior update. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d7b04163c2e6fbfb3befc047586c4c85069e8db3 Author: Kent Overstreet Date: Mon Nov 30 02:07:38 2020 -0500 bcachefs: Change a BUG_ON() to a fatal error In the btree key cache code, failing to flush a dirty key is a serious error, but it doesn't need to be a BUG_ON(), we can stop the filesystem instead. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d0022290b81c15db3c81936cdb254663598ef35f Author: Kent Overstreet Date: Sun Nov 29 23:48:20 2020 -0500 bcachefs: Fix error in filesystem initialization The rhashtable code doesn't like when we destroy an rhashtable that was never initialized Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5731cf01567da4f354bbff4a040b53f3f86328ad Author: Kent Overstreet Date: Sun Nov 29 17:09:13 2020 -0500 bcachefs: Fix journal reclaim spinning in recovery We can't run journal reclaim until we've finished replaying updates to interior btree nodes - the check for this was in the wrong place though, leading to journal reclaim spinning before it was allowed to proceed. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 89931472c20bee93c6bcb0df7b057edda6473381 Author: Kent Overstreet Date: Sun Nov 29 16:00:47 2020 -0500 bcachefs: Fix for __readahead_batch getting partial batch We were incorrectly ignoring the return value of __readahead_batch, leading to a null ptr deref in __bch2_page_state_create(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 33b3b1dc0f685b4542a631a0ca053380613829a6 Author: Kent Overstreet Date: Fri Nov 20 19:27:57 2020 -0500 bcachefs: Optimize bch2_journal_flush_seq_async() Avoid taking the journal lock if we don't have to. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7b489207703833f705763d14a77d29edf97e5a12 Author: Kent Overstreet Date: Fri Nov 20 22:51:04 2020 -0500 bcachefs: Delete dead code The interior btree node update path has changed, this is no longer needed. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 087c201943ff4ec5150b8c3e2e5095b8add01f19 Author: Kent Overstreet Date: Fri Nov 20 21:28:55 2020 -0500 bcachefs: bch2_btree_delete_range_trans() This helps reduce stack usage by avoiding multiple btree_trans on the stack. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6584e84a978ed710ee295201647b7f05dbbc56ee Author: Kent Overstreet Date: Fri Nov 20 21:21:28 2020 -0500 bcachefs: Don't use bkey cache for inode update in fsck fsck doesn't know about the btree key cache, and non-cached iterators aren't cache coherent (yet?) Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f3020550777af9a66737334db94d96f8c3253e96 Author: Kent Overstreet Date: Fri Nov 20 16:12:39 2020 -0500 bcachefs: Fix an rcu splat bch2_bucket_alloc() requires rcu_read_lock() to be held. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b7a9bbfc1b85730ddf9905289b1a148ea1aa5ade Author: Kent Overstreet Date: Thu Nov 19 20:55:33 2020 -0500 bcachefs: Move journal reclaim to a kthread This is to make tracing easier. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d5425a3b220a8b94ae2dd3c74af001a6b1216651 Author: Kent Overstreet Date: Thu Nov 19 21:40:03 2020 -0500 bcachefs: Throttle updates when btree key cache is too dirty This is needed to ensure we don't deadlock because journal reclaim and thus memory reclaim isn't making forward progress. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9d4582ffdb286d3513ee9ebf7961b1741d8cbc0d Author: Kent Overstreet Date: Thu Nov 19 21:15:39 2020 -0500 bcachefs: Journal reclaim requires memalloc_noreclaim_save() Memory reclaim requires journal reclaim to make forward progress - it's what cleans our caches - thus, while we're in journal reclaim or holding the journal reclaim lock we can't recurse into memory reclaim. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b3c2a06b7d89eb06454f31c4b396e37fbe59374c Author: Kent Overstreet Date: Fri Nov 20 13:24:51 2020 -0500 bcachefs: Simplify transaction commit error path The transaction restart path traverses all iterators, we don't need to do it here. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8a92e545597a3eaca80f2df14eb9a783d96c8445 Author: Kent Overstreet Date: Thu Nov 19 19:54:40 2020 -0500 bcachefs: Ensure journal reclaim runs when btree key cache is too dirty Ensuring the key cache isn't too dirty is critical for ensuring that the shrinker can reclaim memory. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 125907203cc902d6fd430950f700a44124e208d4 Author: Kent Overstreet Date: Thu Nov 19 15:38:27 2020 -0500 bcachefs: Improve btree key cache shrinker The shrinker should start scanning for entries that can be freed oldest to newest - this way, we can avoid scanning a lot of entries that are too new to be freed. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4e92cbb64287fcacc05f9a4fc1f9f390d5f58574 Author: Kent Overstreet Date: Thu Nov 19 11:53:38 2020 -0500 bcachefs: More debug code improvements Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 14ba3706b3a8b5d243e0f250e54baeaecfbd8289 Author: Kent Overstreet Date: Wed Nov 18 14:09:33 2020 -0500 bcachefs: Add a kmem_cache for btree_key_cache objects We allocate a lot of these, and we're seeing sporading OOMs - this will help with tracking those down. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ed0e24c0992dffe494bdd0ea6ddf3b816c438524 Author: Kent Overstreet Date: Wed Nov 18 13:21:59 2020 -0500 bcachefs: Be more precise with journal error reporting We were incorrectly detecting a journal deadlock - the journal filling up - when only the journal pin fifo had filled up; if the journal pin fifo is full that just means we need to wait on reclaim. This plumbs through better error reporting so we can better discriminate in the journal_res_get path what's going on. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d8ebed7d24cdf3d4596ab5af471f5e7f749d7aab Author: Kent Overstreet Date: Thu Nov 19 20:13:30 2020 -0500 bcachefs: Add btree cache stats to sysfs Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e8c851b351d60b5cf9f2cd23c126fc200b8f5e6a Author: Kent Overstreet Date: Mon Nov 16 14:23:06 2020 -0500 bcachefs: Add an ioctl for resizing journal on a device Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1c74cec10cc8dbc595c6de83e2344a44d278dc11 Author: Kent Overstreet Date: Mon Nov 16 14:16:42 2020 -0500 bcachefs: Add more debug checks tracking down a bug where we see a btree node pointer in the wrong node Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e8bd002b23813f162d83a5c5c3b28832ba88f78e Author: Kent Overstreet Date: Mon Nov 16 18:21:55 2020 -0500 bcachefs: Dump journal state when the journal deadlocks Currently tracking down one of these bugs. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit dbd1e8259ad2b35aafe230fdabfa387b3b54ab64 Author: Kent Overstreet Date: Mon Nov 16 18:20:50 2020 -0500 bcachefs: Dont' use percpu btree_iter buf in userspace bcachefs-tools doesn't have a real percpu (per thread) implementation yet Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0b5c9f59401e4f339c2b716d2f9210114b7885c1 Author: Kent Overstreet Date: Sun Nov 15 20:52:55 2020 -0500 bcachefs: Set preallocated transaction mem to avoid restarts this will reduce transaction restarts, from observation of tracepoints. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3dc5fcfcf51efa7dfd6ef900b06ad1fef0820664 Author: Kent Overstreet Date: Mon Nov 16 13:06:28 2020 -0500 bcachefs: Convert tracepoints to use %ps, not %pf Symbol decoding was changed from %pf to %ps Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4d54337cdbf3baf8115bf8c1ed61bf44b3932a6d Author: Kent Overstreet Date: Mon Nov 16 12:22:30 2020 -0500 bcachefs: Fix journal entry repair code When we detect bad keys in the journal that have to be dropped, the flow control was wrong - we ended up not checking the next key in that entry. Oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 628a3ad2c2dfd8e89ac9ab9fc3682f8e2ce504d8 Author: Kent Overstreet Date: Thu Nov 12 17:19:47 2020 -0500 bcachefs: Add a shrinker for the btree key cache Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 876c7af3a6620c5698782f18bff8a3ed7e006d78 Author: Kent Overstreet Date: Sun Nov 15 16:30:22 2020 -0500 bcachefs: Take a SRCU lock in btree transactions Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d8b46004648c66dbde5d35eed8e3939987d7a833 Author: Kent Overstreet Date: Sun Nov 15 16:31:58 2020 -0500 bcachefs: Check for errors from register_shrinker() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 158eecb88ed3100bef01917913a26e9aad152417 Author: Kent Overstreet Date: Sat Nov 14 16:04:30 2020 -0500 bcachefs: Assorted journal refactoring Improved the way we track various state by adding j->err_seq, which records the first journal sequence number that encountered an error being written, and j->last_empty_seq, which records the most recent journal entry that was completely empty. Also, use the low bits of the journal sequence number to index the corresponding journal_buf. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1676a398d37bffa29824f132a29f2836282940f3 Author: Kent Overstreet Date: Sat Nov 14 13:12:50 2020 -0500 bcachefs: Delete dead journalling code Usage of the journal has gotten somewhat simpler over time - neat. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ed0d631fa50112c51f302442e3d11a1c5f4d2bb4 Author: Kent Overstreet Date: Fri Nov 13 16:19:24 2020 -0500 bcachefs: Improve journal error messages Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 61501161817b1dee17231af6a255af836c9b6853 Author: Kent Overstreet Date: Fri Nov 13 15:03:34 2020 -0500 bcachefs: Be more careful in bch2_bkey_to_text() This is used to print keys that failed bch2_bkey_invalid(), so be more careful with k->type. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1640647c04bf0963e51aaec595af026d383352d6 Author: Kent Overstreet Date: Fri Nov 13 16:51:02 2020 -0500 bcachefs: Inode delete doesn't need to flush key cache anymore Inode create checks to make sure the slot doesn't exist in the btree key cache. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6d758368f1265ca9d0b7a077caf1ca9e9859c8c8 Author: Kent Overstreet Date: Fri Nov 13 18:30:53 2020 -0500 bcachefs: Fix a btree transaction iter overflow extent_replay_key dates from before putting iterators was required - fixed. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 101d471367a4b3a9158c53d3ca0093b0bed60338 Author: Kent Overstreet Date: Fri Nov 13 14:49:57 2020 -0500 bcachefs: Fix a 64 bit divide this fixes builds on 32 bit. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 35ef6df5ca67347c606e418eb3ef71870ea97ba7 Author: Kent Overstreet Date: Fri Nov 13 14:39:43 2020 -0500 bcachefs: Improve journal entry validate code Previously, the journal entry read code was changed so that if we got a journal entry that failed validation, we'd try to use it, preferring to use a good version from another device if available. But this left a bug where if an earlier validation check (say, checksum) failed, the later checks (for last_seq) wouldn't run and we'd end up using a journal entry with a garbage last_seq field. This fixes that so that the later validation checks run and if necessary change those fields to something sensible. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit eb8e6e9ccbb4ba37c04a7cff032975b4df7d63c7 Author: Kent Overstreet Date: Wed Nov 11 12:33:12 2020 -0500 bcachefs: Deadlock prevention for ei_pagecache_lock In the dio write path, when get_user_pages() invokes the fault handler we have a recursive locking situation - we have to handle the lock ordering ourselves or we have a deadlock: this patch addresses that by checking for locking ordering violations and doing the unlock/relock dance if necessary. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6d9378f3dcd7b91effdc4ffe1da1a2e8987e9f1e Author: Kent Overstreet Date: Wed Nov 11 12:42:54 2020 -0500 bcachefs: Hack around bch2_varint_decode invalid reads bch2_varint_decode can do reads up to 7 bytes past the end ptr, for the sake of performance - these extra bytes are always masked off. This won't be a problem in practice if we make sure to burn 8 bytes in any buffer that has bkeys in it. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e648448ca562af0cb11729ce6fad0f860fa42cb4 Author: Kent Overstreet Date: Wed Nov 11 18:59:41 2020 -0500 bcachefs: Fix missing memalloc_nofs_restore() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f526d26d711a376aa3dd8dd56f55928d5a28d9b1 Author: Kent Overstreet Date: Wed Nov 11 17:47:39 2020 -0500 bcachefs: Fix btree key cache shutdown On emergency shutdown, we might still have dirty keys in the btree key cache that need to be cleaned up properly. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6a747c4683803abb01ce246ac2faf7f171cb3872 Author: Kent Overstreet Date: Mon Nov 9 13:01:52 2020 -0500 bcachefs: Add accounting for dirty btree nodes/keys This lets us improve journal reclaim, so that it now tries to make sure no more than 3/4s of the btree node cache and btree key cache are dirty - ensuring the shrinkers can free memory. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 01819cfe37e864a0e7d6f208c2e5b4635c66f974 Author: Kent Overstreet Date: Sat Nov 7 16:55:57 2020 -0500 bcachefs: Fix btree iterator leak this fixes an occasonial btree transaction iterators overflow. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9ae82fe6ace1b267005758ccfb2347a4a6aa4398 Author: Kent Overstreet Date: Sat Nov 7 16:16:52 2020 -0500 bcachefs: Inline make_bfloat() into __build_ro_aux_tree() This is a fast path - also, lift out the checks/init for min/max key. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit fe4584765d831571231de629fc139af5fc9db2d5 Author: Kent Overstreet Date: Sat Nov 7 13:03:24 2020 -0500 bcachefs: use a radix tree for inum bitmap in fsck The change to use the cpu nr for the high bits of new inode numbers means that inode numbers are very space - we see -ENOMEM during fsck without this. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a3e7226268b26f0976f64ce8b0644daae28cafff Author: Kent Overstreet Date: Thu Nov 5 23:39:33 2020 -0500 bcachefs: New varints Previous varint implementation used by the inode code was not nearly as fast as it could have been; partly because it was attempting to encode integers up to 96 bits (for timestamps) but this meant that encoding and decoding the length required a table lookup. Instead, we'll just encode timestamps greater than 64 bits as two separate varints; this will make decoding/encoding of inodes significantly faster overall. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b3d1e6cab2dfcdfef5fc35659a8f33a75ae5904e Author: Kent Overstreet Date: Sat Nov 7 12:43:48 2020 -0500 bcachefs: Fix build warning when CONFIG_BCACHEFS_DEBUG=n this function is only used by debug code, but we'd like to always build it so we know that it does build. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 811d2bcd85a82642c2cd328f6734b5c8c35e57de Author: Kent Overstreet Date: Sat Nov 7 12:31:20 2020 -0500 bcachefs: Drop typechecking from bkey_cmp_packed() This only did anything in two places, and those can just be replaced wiht bkey_cmp_left_packed()). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 73e7470b31e439c3e86bb2371b7eb1c0bc852766 Author: Kent Overstreet Date: Fri Nov 6 01:34:41 2020 -0500 bcachefs: More inlinining in the btree key cache code Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7e7ae6ca57d210dcedc4268323c9471d97194111 Author: Kent Overstreet Date: Thu Nov 5 20:49:08 2020 -0500 bcachefs: Fix spurious transaction restarts The checks for lock ordering violations weren't quite right. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1a21bf9866700f29ad552cca8bbddfd248bb751c Author: Kent Overstreet Date: Thu Nov 5 20:02:01 2020 -0500 bcachefs: Add a single slot percpu buf for btree iters Allocating our array of btree iters is a big enough allocation that it hits the buddy allocator, and we're seeing lots of lock contention. Sticking a single element buffer in front of it should help. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 00276f9f34c29c59a848e22eb491d76c268f0dad Author: Matthew Wilcox (Oracle) Date: Thu Nov 5 15:58:38 2020 +0000 bcachefs: Use attach_page_private and detach_page_private These recently added helpers simplify the code. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Kent Overstreet commit 96fee47e44939c087d1a0f9ed69555374e751843 Author: Matthew Wilcox (Oracle) Date: Thu Nov 5 15:58:37 2020 +0000 bcachefs: Remove page_state_init_for_read This is dead code; delete the function. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Kent Overstreet commit b735d73a00d5d9f5652a299146d518b7eea47b7b Author: Kent Overstreet Date: Thu Nov 5 12:16:05 2020 -0500 bcachefs: Build fixes for 32bit x86 PAGE_SIZE and size_t are not unsigned longs on 32 bit, annoying... also switch to atomic64_cmpxchg instead of cmpxchg() for journal_seq_copy, as atomic64_cmpxchg has a fallback that uses spinlocks for when it's not supported. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b5e8a6992fb1195cb58cb79461ef50f474c27608 Author: Kent Overstreet Date: Mon Nov 2 23:51:33 2020 -0500 bcachefs: Improved inode create optimization This shards new inodes into different btree nodes by using the processor ID for the high bits of the new inode number. Much faster than the previous inode create optimization - this also helps with sharding in the other btrees that index by inode number. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit df082b3a50e02bb8dfc583cea29ab94ab1a04692 Author: Kent Overstreet Date: Mon Nov 2 19:49:23 2020 -0500 bcachefs: Report inode counts via statfs Took awhile to figure out exactly what statfs wanted... Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d108efc2541590a0a086f27b1b703e59a84fafb2 Author: Kent Overstreet Date: Mon Nov 2 19:15:18 2020 -0500 bcachefs: add const annotations to bset.c perhaps a bit silly, but some debug assertions we want to add need const propagated a bit more. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ae1ede5893bd9b46f40cc9d1148321206369a9f2 Author: Kent Overstreet Date: Mon Nov 2 18:54:33 2020 -0500 bcachefs: Don't embed btree iters in btree_trans These haven't been in used since reallocing iterators has been disabled, and saves us a lot of stack if we get rid of it. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 692d4031a458092bc602840739f97c4acf155dcb Author: Kent Overstreet Date: Mon Nov 2 18:36:08 2020 -0500 bcachefs: Split out debug_check_btree_accounting This check is very expensive Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 29364f34530d30ca0f34dfe5d1ea73c8f1e77ff3 Author: Kent Overstreet Date: Mon Nov 2 18:20:44 2020 -0500 bcachefs: Drop sysfs interface to debug parameters It's not used much anymore, the module paramter interface is better. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2f33ece9b47741ba53b467b7599145ed7595a2d7 Author: Kent Overstreet Date: Mon Nov 2 17:51:38 2020 -0500 bcachefs: Minor journal reclaim improvement With the btree key cache code, journal reclaim now has a lot more work to do. It could be the case that after journal reclaim has finished one iteration there's already more work to do, so put it in a loop to check for that. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 45e4dcba79401dd17e0c32ff26f83e240c27ca5c Author: Kent Overstreet Date: Tue Oct 27 18:56:21 2020 -0400 bcachefs: Inode create optimization On workloads that do a lot of multithreaded creates all at once, lock contention on the inodes btree turns out to still be an issue. This patch adds a small buffer of inode numbers that are known to be free, so that we can avoid touching the btree on every create. Also, this changes inode creates to update via the btree key cache for the initial create. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b16fa0bae5766748bd682b0829136ca02d6ea3ba Author: Kent Overstreet Date: Fri Oct 30 17:29:38 2020 -0400 bcachefs: Improve check for when bios are physically contiguous Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit dcf141b9e13d261629806aa37e0fa7769d38b789 Author: Kent Overstreet Date: Wed Oct 28 14:18:18 2020 -0400 bcachefs: Fix spurious transaction restarts The check for whether locking a btree node would deadlock was wrong - we have to check that interior nodes are locked before descendents, but this check was wrong when consider cached vs. non cached iterators. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a301dc38efa178e900a59ce7f03c1e81123c0919 Author: Kent Overstreet Date: Wed Oct 28 14:17:46 2020 -0400 bcachefs: Improve tracing for transaction restarts We have a bug where we can get stuck with a process spinning in transaction restarts - need more information. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 527087c741dc1199fbf4a635a80bf4839a9a8288 Author: Kent Overstreet Date: Tue Oct 27 14:10:52 2020 -0400 bcachefs: Fix stack corruption A bkey_on_stack_realloc() call was in the wrong place, and broken for indirect extents Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8cad3e2f73f5c6ad39e9da5564382a2a737a201c Author: Kent Overstreet Date: Sun Sep 22 19:10:21 2019 -0400 bcachefs: Use cached iterators for inode updates This switches inode updates to use cached btree iterators - which should be a nice performance boost, since lock contention on the inodes btree can be a bottleneck on multithreaded workloads. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e7b854b1f76d34eeea6baa3a1b5eaa1f85ae6340 Author: Kent Overstreet Date: Mon Oct 26 17:03:28 2020 -0400 bcachefs: fiemap fixes - fiemap didn't know about inline extents, fixed - advancing to the next extent after we'd chased a pointer to the reflink btree was wrong, fixed Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 645d72aa366e51259296cfc02e37c802d7b78493 Author: Kent Overstreet Date: Mon Oct 26 14:45:20 2020 -0400 bcachefs: Fix btree updates when mixing cached and non cached iterators There was a bug where bch2_trans_update() would incorrectly delete a pending update where the new update did not actually overwrite the existing update, because we were incorrectly using BTREE_ITER_TYPE when sorting pending btree updates. This affects the pending patch to use cached iterators for inode updates. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit eb4609796de52a8e86eb69f5cf9eabd492242a1b Author: Kent Overstreet Date: Mon Oct 26 14:54:55 2020 -0400 bcachefs: Add mode to bch2_inode_to_text Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8be901d5d4a266e6838cdb6781084a02d2b37ace Author: Kent Overstreet Date: Sun Oct 25 01:08:28 2020 -0400 bcachefs: Always write a journal entry when stopping journal This is to fix a (harmless) bug where the read clock hand in the superblock doesn't match the journal. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 33114c2d897405ec338df979d1bf1d3319f92938 Author: Kent Overstreet Date: Sat Oct 24 21:20:16 2020 -0400 bcachefs: Drop alloc keys from journal when -o reconstruct_alloc This fixes a bug where we'd pop an assertion due to replaying a key for an interior btree node when that node no longer exists. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 801a3de6427924d87ecc7e218a99ad3245ee8290 Author: Kent Overstreet Date: Sat Oct 24 19:51:34 2020 -0400 bcachefs: Indirect inline data extents When inline data extents were added, reflink was forgotten about - we need indirect inline data extents for reflink + inline data to work correctly. This patch adds them, and a new feature bit that's flipped when they're used. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 13dcd4abcd8d4e177f4f75ea3f5c8838a8a8c3c3 Author: Kent Overstreet Date: Sat Oct 24 20:56:47 2020 -0400 bcachefs: Fix rare use after free in read path If the bkey_on_stack_reassemble() call in __bch2_read_indirect_extent() reallocates the buffer, k in bch2_read - which we pointed at the bkey_on_stack buffer - will now point to a stale buffer. Whoops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e00711d2cae7b8e178bb615c757260107b2d4872 Author: Kent Overstreet Date: Sat Oct 24 16:37:17 2020 -0400 bcachefs: Improve some error messages Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a10e677a1555e070f1a7b3c1dc3e3189d462ab9e Author: Kent Overstreet Date: Fri Oct 23 21:07:17 2020 -0400 bcachefs: Fix for passing target= opts as mount opts Some options can't be parsed until the filesystem initialized; previously, passing these options to mount or remount would cause mount to fail. This changes the mount path so that we parse the options passed in twice, and just ignore any options that can't be parsed the first time. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5b088c1dd005ec0fbddfa3664d3095caef6ae52e Author: Kent Overstreet Date: Fri Oct 23 18:40:30 2020 -0400 bcachefs: Fix bch2_mark_stripe() There's no reason not to always recalculate these fields Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b88e971e45fe61fba435c65cc2f66fb3a5136461 Author: Kent Overstreet Date: Wed Jul 22 23:11:48 2020 -0400 bcachefs: Don't drop replicas when copygcing ec data Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit af4d05c46b1ef2b2b43e9df1924e204efe205ec6 Author: Kent Overstreet Date: Thu Jul 9 18:31:51 2020 -0400 bcachefs: Account for stripe parity sectors separately Instead of trying to charge EC parity to the data within the stripe (which is subject to rounding errors), let's charge it to the stripe itself. It should also make -ENOSPC issues easier to deal with if we charge for parity blocks up front, and means we can also make more fine grained accounting available to the user. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 39283c712e6df927c7c49e8b738ca110551bb399 Author: Kent Overstreet Date: Mon Oct 19 22:36:24 2020 -0400 bcachefs: Fix for bad stripe pointers The allocator usually doesn't increment bucket gens right away on buckets that it's about to hand out (for reasons that need to be documented), instead deferring that to whatever extent update first references that bucket. But stripe pointers reference buckets without changing bucket sector counts, meaning we could end up with a pointer in a stripe with a gen newer than the bucket it points to. Fix this by adding a transactional trigger for KEY_TYPE_stripe that just writes out the keys in the alloc btree for the buckets it points to. Also - consolidate the code that checks pointer validity. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 289980195ffaa949ecd4216337a70a8e23cf8e86 Author: Kent Overstreet Date: Sat Oct 17 16:44:27 2020 -0400 bcachefs: Start/stop io clock hands in read/write paths This fixes a bug where the clock hands in the journal and superblock didn't match, because we were still incrementing the read clock hand while read-only. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8d6b6222bf168e7a0613c0baf3da30f2c7338488 Author: Kent Overstreet Date: Fri Oct 16 21:36:26 2020 -0400 bcachefs: Improvements to writing alloc info Now that we've got transactional alloc info updates (and have for awhile), we don't need to write it out on shutdown, and we don't need to write it out on startup except when GC found errors - this is a big improvement to mount/unmount performance. This patch also fixes a few bugs where we weren't writing out alloc info (on new filesystems, and new devices) and should have been. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit aa8889c07abecd7db7b2c0beb61db921fbafe04f Author: Kent Overstreet Date: Wed Dec 16 13:35:16 2020 -0500 bcachefs: Fix assertion popping in transaction commit path We can't be holding read locks on btree nodes when we go to take write locks: this would deadlock if another thread is holding an intent lock on the node we have a read lock on, and it tries to commit and upgrade to a write lock. But instead of triggering an assertion, if this happens we can just upgrade the read lock to an intent lock. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f3721e12d07ab3c3e400a1a635e999ef72780de4 Author: Kent Overstreet Date: Fri Oct 16 21:32:02 2020 -0400 bcachefs: Perf improvements for bch_alloc_read() On large filesystems reading in the alloc info takes a significant amount of time. But we don't need to be calling into the fully general bch2_mark_key() path, just open code what we need in bch2_alloc_read_fn(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9f20ed157d521c7a1af0fe01e80d9e0ee880f9f7 Author: Kent Overstreet Date: Thu Oct 15 22:50:48 2020 -0400 bcachefs: Fix copygc dying on startup The copygc threads errors out and makes the filesystem go RO if it ever tries to run and discovers it has no reserve allocated - which is a problem if it races with the allocator thread and its reserve hasn't been filled yet. The allocator thread doesn't start filling the copygc reserve until after BCH_FS_STARTED has been set, so make sure to wake up the allocator threads after setting that and before starting copygc. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6ea873d1727af15ae429882737e8848492b63595 Author: Kent Overstreet Date: Thu Oct 15 22:23:02 2020 -0400 bcachefs: Fix copygc of compressed data The check for when we need to get a disk reservation was wrong. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 97c0e19502549c0501581f9efff45022a10be2aa Author: Kent Overstreet Date: Thu Oct 15 21:48:58 2020 -0400 bcachefs: Fix another lockdep splat vfree() can allocate memory, so we need to call memalloc_nofs_save(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 505b7a4c2844d8ee0004ab905874513776bc14da Author: Kent Overstreet Date: Thu Oct 15 15:58:36 2020 -0400 bcachefs: Fix errors early in the fs init process At some point bch2_fs_alloc() was changed to always call bch2_fs_free() in the error path, which means we need c->cl to always be initialized. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 922ae9f45585500398e9a88b50d5d29a2fc721e8 Author: Kent Overstreet Date: Fri Jul 10 19:49:34 2020 -0400 bcachefs: Copy ptr->cached when migrating data Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c47c50f8564a5bacff1afaa2adc8f46ef49935b4 Author: Kent Overstreet Date: Tue Oct 13 03:58:50 2020 -0400 bcachefs: Fix gc of stale ptr gens Awhile back, gcing of stale pointers was split out from full mark-and-sweep gc - but, the bit to actually drop those stale pointers wasn't implemnted. Whoops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9ee38f62da22625d9cd8919d9bbe1e4f0e36b9c3 Author: Kent Overstreet Date: Tue Oct 13 00:06:36 2020 -0400 bcachefs: Fix off-by-one error in ptr gen check Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5d0b7f906a7e047768f86539b10df602fcbd44b8 Author: Kent Overstreet Date: Sun Oct 11 16:33:49 2020 -0400 bcachefs: Fix a lockdep splat We can't allocate memory with GFP_FS while holding the btree cache lock, and vfree() can allocate memory. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9ba2eb25f017800c3d00eac2bbc3c99451c3bae2 Author: Kent Overstreet Date: Fri Oct 9 00:09:20 2020 -0400 bcachefs: Fix __bch2_truncate_page() __bch2_truncate_page() will mark some of the blocks in a page as unallocated. But, if the page is mmapped (and writable), every block in the page needs to be marked dirty, else those blocks won't be written by __bch2_writepage(). The solution is to change those userspace mappings to RO, so that we force bch2_page_mkwrite() to be called again. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 61ce38b862c17acccd0df0004d69710d8b438e99 Author: Kent Overstreet Date: Tue Oct 6 22:18:21 2020 -0400 bcachefs: Fix journal_seq_copy() We also need to update the journal's bloom filter of inode numbers that each journal write has upudates for - in case the inode gets evicted before it gets fsynced. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d5e4dcc29cce41b4bb51bf83c54940018d57e598 Author: Kent Overstreet Date: Tue Sep 8 18:30:32 2020 -0400 bcachefs: Fix unmount path There was a long standing race in the mount/unmount code - the VFS intends for mount/unmount synchronizatino to be handled by the list of superblocks, but we were still holding devices open after tearing down our superblock in the unmount path. Signed-off-by: Kent Overstreet commit 625104ea21386361b60d20ae696b9df6111236f5 Author: Kent Overstreet Date: Sun Sep 6 22:58:28 2020 -0400 bcachefs: Don't fail mount if device has been removed Also - make sure to show the devices we actually have open in /proc Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ca73852a1341534e2bf00cfbdc853bb3b1095af8 Author: Kent Overstreet Date: Mon Aug 24 15:58:26 2020 -0400 bcachefs: Improvements to the journal read error paths - Print out more information in error messages - On checksum error, keep the journal entry but mark it bad so that we can prefer entries from other devices that don't have bad checksums Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a672fb8f5deaa577197e604ad7c6e0380f153211 Author: Kent Overstreet Date: Mon Aug 24 15:16:32 2020 -0400 bcachefs: Make sure to go rw if lazy in fsck The paths where we delete or truncate inodes don't pass commit flags for BTREE_INSERT_LAZY_RW, so just go rw if necessary in the fsck code. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7af0cec3076886d16114f4ca9794dfba3674794e Author: Kent Overstreet Date: Mon Aug 24 14:57:48 2020 -0400 bcachefs: Some project id fixes Inode options that are accessible via the xattr interface are stored with a +1 bias, so that a value of 0 means unset. We weren't handling this consistently. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ac7eef0318c34c87e7ef9d574175917de1817ae6 Author: Kent Overstreet Date: Sat Aug 15 22:41:35 2020 -0400 bcachefs: Don't report inodes to statfs We don't have a limit on the number of inodes in a filesystem, so this is apparently the right way to report that. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f9adbb7d5d19dfa9425fad844dce32853d077e58 Author: Kent Overstreet Date: Wed Aug 12 15:08:17 2020 -0400 bcachefs: Add a cond_resched() to bch2_alloc_write() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2d8c0da1a7c2601b21d3fb63b8cb4f3610cac196 Author: Kent Overstreet Date: Thu Aug 6 15:22:24 2020 -0400 bcachefs: Fix a couple null ptr derefs when no disk groups exist Normally successfully parsing a target means disk groups should exist, but we don't want a BUG() or null ptr deref if we end up with an invalid target. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 01566db2fb1fca313d75b8b849ee95bb9ec5bcd7 Author: Kent Overstreet Date: Wed Aug 12 15:00:08 2020 -0400 bcachefs: Fix disk groups not being updated when set via sysfs Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 142cbdff9b3d8e7fe8619d906f9eefd50b078f5f Author: Kent Overstreet Date: Wed Aug 12 13:49:09 2020 -0400 bcachefs: Change copygc to consider bucket fragmentation When devices have different sized buckets this is more correct. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1421bea38ace65f167a73ae3f544205766c1778c Author: Kent Overstreet Date: Wed Aug 12 13:48:02 2020 -0400 bcachefs: Don't block on allocations when only writing to specific device Since the copygc thread is now global and not per device, we're not freeing up space on any one device in bounded time - and indeed we never really were, since rebalance wasn't moving data around between devices with that objective. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9f115ce9e9b57f0e55a37b657feac5663590b85e Author: Kent Overstreet Date: Tue Aug 4 23:10:08 2020 -0400 bcachefs: Fix a bug with the journal_seq_blacklist mechanism Previously, we would start doing btree updates before writing the first journal entry; if this was after an unclean shutdown, this could cause those btree updates to not be blacklisted. Also, move some code to headers for userspace debug tools. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 00c24f53b563dafb2de8c5f642d24ac775b4479c Author: Kent Overstreet Date: Tue Aug 4 23:12:49 2020 -0400 bcachefs: Fix bch2_new_stripes_to_text() painful looking typo, fortunately difficult to hit. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 768b42a7eb91b556cfe7c467c0e7337602eb6f29 Author: Kent Overstreet Date: Mon Aug 3 13:58:36 2020 -0400 bcachefs: Don't disallow btree writes to RO devices There's an inherent race with setting devices RO when they have dirty btree nodes on them. We already check if a btree node is on an RO device before we dirty it, so this patch just allows those writes so that we don't have errors forcing the entire filesystem read only when trying to remove a device. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 79e72a90936e9d19caf0ced4113e8d7659ebb2af Author: Kent Overstreet Date: Mon Aug 3 13:37:11 2020 -0400 bcachefs: Fix maximum btree node size Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7807e143849e0f86fce6ce7d4907412915d29918 Author: Kent Overstreet Date: Sat Jul 25 17:06:11 2020 -0400 bcachefs: Convert various code to printbuf printbufs know how big the buffer is that was allocated, so we can get rid of the random PAGE_SIZEs all over the place. Signed-off-by: Kent Overstreet commit 4580baec7fbee2fdceb9b5b2b337ea3734a6d2b8 Author: Kent Overstreet Date: Sat Jul 25 15:07:37 2020 -0400 bcachefs: Remove some uses of PAGE_SIZE in the btree code For portability to userspace, we should try to avoid working in kernel pages. Signed-off-by: Kent Overstreet commit 760992aac852397d3d0e4b15fffc6ebc01d50e0d Author: Kent Overstreet Date: Sat Jul 25 15:37:14 2020 -0400 bcachefs: Ensure we wake up threads locking node when reusing it Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f8058242205d59b8969990188f5590c054f90b5b Author: Kent Overstreet Date: Sat Jul 25 14:19:37 2020 -0400 bcachefs: Fix bch2_btree_node_insert_fits() It should be checking for the recently added flag btree_node_needs_rewrite. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d3a2b5d809c1312559c1272d4a56cb31d19d3133 Author: Kent Overstreet Date: Thu Jul 23 11:31:01 2020 -0400 bcachefs: Ensure we only allocate one EC bucket per writepoint Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 33e339619f7fda8c428daa5cb8fde7d68dad2edb Author: Kent Overstreet Date: Wed Jul 22 22:40:32 2020 -0400 bcachefs: Fix a race with BCH_WRITE_SKIP_CLOSURE_PUT Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 74ed7e560b794369adf87e0d310453bc78f4b273 Author: Kent Overstreet Date: Tue Jul 21 17:12:39 2020 -0400 bcachefs: Don't let copygc buckets be stolen by other threads And assorted other copygc fixes. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3d080aa52f6c1bf10734ec4464a2204cbbd80671 Author: Kent Overstreet Date: Wed Jul 22 13:27:00 2020 -0400 bcachefs: Delete unused arguments Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4fe7efa17713e3d0eecbd106adff3d1b039cc554 Author: Kent Overstreet Date: Wed Jul 22 18:26:04 2020 -0400 bcachefs: Fix an error path We were missing a 'goto retry' and continuing on with an error pointer. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 988e98cfce26ecad20595cb52056759e798cd8de Author: Kent Overstreet Date: Fri Jul 10 16:13:52 2020 -0400 bcachefs: Refactor replicas code Awhile back the mechanism for garbage collecting unused replicas entries was significantly improved, but some cleanup was missed - this patch does that now. This is also prep work for a patch to account for erasure coded parity blocks separately - we need to consolidate the logic for checking/marking the various replicas entries from one bkey into a single function. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8f3b41ab4f39f87712ed57e0443642d7bcabd1ff Author: Kent Overstreet Date: Sat Jul 11 18:52:14 2020 -0400 bcachefs: Don't restrict copygc writes to the same device This no longer makes any sense, since copygc is now one thread per filesystem, not per device, with a single write point. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 63b214e75b1c941d3fc81da5b7fc4aa997e40873 Author: Kent Overstreet Date: Tue Jul 21 13:34:22 2020 -0400 bcachefs: Add bch2_blk_status_to_str() We define our own BLK_STS_REMOVED, so we need our own to_str helper too. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a2b5313a39dfb0c027ef3f9d79efa531e1c0a736 Author: Kent Overstreet Date: Tue Jul 21 11:51:17 2020 -0400 bcachefs: Fix a faulty assertion Now that updates to interior nodes are journalled, we shouldn't be checking topology of interior nodes until we've finished replaying updates to that node. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e8306e3b4ca2d6cb325136afe5631247466ad176 Author: Kent Overstreet Date: Mon Jul 20 13:00:15 2020 -0400 bcachefs: Wrap write path in memalloc_nofs_save() This fixes a lockdep splat where we're allocating memory with vmalloc in the compression bounce path, which doesn't always obey GFP_NOFS. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f621e1521c3ff5ea295a97d7d71cdbe84f496467 Author: Kent Overstreet Date: Mon Jul 20 15:51:05 2020 -0400 bcachefs: Add an option for rebuilding the replicas section There is a bug where we cnan end up clearing the data_has field in the superblock members section, which causes us to skip reading the journal and thus journal replay fails. This option tells the recovery path to not trust those fields. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e6d1161530bcd632ad10b6aa0ad511abb146dbcc Author: Kent Overstreet Date: Sat Jul 11 16:28:54 2020 -0400 bcachefs: Make copygc thread global Per device copygc threads don't move data to different devices and they make fragmentation works - they don't make much sense anymore. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f793bc15491c04481b3f12a10ff22a53cd126842 Author: Kent Overstreet Date: Sat Jul 11 13:23:17 2020 -0400 bcachefs: Drop extra pointers when marking data as in a stripe We ideally want the buckets used for the extra initial replicas to be reused right away. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1d2ff0a63049f03bddcc98b195213bbd37e3ab53 Author: Kent Overstreet Date: Sat Jul 11 15:35:04 2020 -0400 bcachefs: Fix extent_ptr_durability() calculation for erasure coded data Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 89fd25be70b4e3fc540d4cf591a02898470f1ef0 Author: Kent Overstreet Date: Thu Jul 9 18:28:11 2020 -0400 bcachefs: Use x-macros for data types Signed-off-by: Kent Overstreet commit 912bdf17a849990f7241e294e48629987553b94c Author: Kent Overstreet Date: Thu Jul 9 13:54:58 2020 -0400 bcachefs: Fix short buffered writes In the buffered write path, we have to check for short writes that write to the full page, where the page wasn't UpToDate; when this happens, the page is partly garbage, so we have to zero it out and revert that part of the write. This check was wrong - we reverted total from copied, but didn't revert the iov_iter, probably also leading to corrupted writes. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0ba95acc4499c84156144316dfb08d68930cc1a9 Author: Kent Overstreet Date: Tue Jun 30 14:44:19 2020 -0400 bcachefs: Allow existing stripes to be updated with new data buckets This solves internal fragmentation within stripes. We already have copygc, which evacuates buckets that are partially or mostly empty, but it's up to the ec code that manages stripes to deal with stripes that have empty buckets in them. This patch changes the path for creating new stripes to check if there's existing stripes with empty buckets - and if so, update them with new data buckets instead of creating new stripes. TODO: improve the disk space accounting so that we can only use this (more expensive path) when we have too much fragmentation in existing stripes. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f6b94a3baa956ff10a52a545a9ad60f35e88e683 Author: Kent Overstreet Date: Mon Jul 6 22:33:54 2020 -0400 bcachefs: Refactor stripe creation Prep work for the patch to update existing stripes with new data blocks. This moves allocating new stripes into ec.c, and also sets up the data structures so that we can handly only allocating some of the blocks in a stripe. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 703e2a43bf30c1d5610fa7d1a823911d96487dac Author: Kent Overstreet Date: Mon Jul 6 20:59:46 2020 -0400 bcachefs: Move stripe creation to workqueue This is mainly to solve a lock ordering issue, and also simplifies the code a bit. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ba6dd1dd493f4e621350fa963e3a95686aaf8a4d Author: Kent Overstreet Date: Mon Jul 6 20:18:13 2020 -0400 bcachefs: Improve stripe triggers/heap code Soon we'll be able to modify existing stripes - replacing empty blocks with new blocks and new p/q blocks. This patch updates the trigger code to handle pointers changing in an existing stripe; also, it significantly improves how the stripes heap works, which means we can get rid of the stripe creation/deletion lock. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e63534a20117e937b3712acaedb98f208ff6b862 Author: Kent Overstreet Date: Mon Jul 6 19:16:25 2020 -0400 bcachefs: Rework triggers interface The trigger for stripe keys is shortly going to need both the old and the new key passed to the trigger - this patch does that rework. For now, this just changes the in memory triggers, and this doesn't change how extent triggers work. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 697e45b230d5523c5c119b1e6a868632def24451 Author: Kent Overstreet Date: Mon Jul 6 17:02:37 2020 -0400 bcachefs: Kill BTREE_TRIGGER_NOOVERWRITES This is prep work for reworking the triggers machinery - we have triggers that need to know both the old and the new key. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit fff899b1d90089a3c77a20dbe48bd44a00161a6b Author: Kent Overstreet Date: Fri Jul 3 16:32:00 2020 -0400 bcachefs: Mark btree nodes as needing rewrite when not all replicas are RW This fixes a bug where recovery fails when one of the devices is read only. Also - consolidate the "must rewrite this node to insert it" behind a new btree node flag. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 306d40df7d27c99a8ec63fc730747a77959c4358 Author: Kent Overstreet Date: Thu Jul 2 13:43:58 2020 -0400 bcachefs: Use blk_status_to_str() Improved error messages are always a good thing Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 52fbb7c859788bb10dc0f1527eedf80fd11ec9ec Author: Kent Overstreet Date: Tue Jun 30 10:12:45 2020 -0400 bcachefs: Don't cap ios in dio write path at 2 MB It appears this was erronious, a different bug was responsible Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 042a1f268e82678ea202390b8a69457aafacd4a0 Author: Kent Overstreet Date: Mon Jun 29 18:22:06 2020 -0400 bcachefs: Refactor dio write code to reinit bch_write_op This fixes a bug where the BCH_WRITE_SKIP_CLOSURE_PUT was set incorrectly, causing the completion to be delivered multiple times. oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 64f2a8803ec8d3702a4b5225726f9c1dc685f43a Author: Kent Overstreet Date: Sun Jun 28 18:11:12 2020 -0400 bcachefs: Fix bch2_extent_can_insert() not being called It's supposed to check whether we're splitting a compressed extent and if so get a bigger disk reservation - hence this fixes a "disk usage increased by x without a reservaiton" bug. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c61b7e21ecfff2096cdb84d86bd18f1ceab7de72 Author: Kent Overstreet Date: Fri Jun 26 13:56:21 2020 -0400 bcachefs: Fix a null ptr deref in bch2_btree_iter_traverse_one() We use sentinal values that aren't NULL to indicate there's a btree node at a higher level; occasionally, this may result in btree_iter_up_until_good_node() stopping at one of those sentinal values. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 649a9b68ac126fc7c8735892d3f833b620c9cbde Author: Kent Overstreet Date: Thu Jun 18 21:06:42 2020 -0400 bcachefs: Track sectors of erasure coded data Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 937f503605695d2b564394afdfa59b866accd915 Author: Kent Overstreet Date: Thu Jun 18 17:16:29 2020 -0400 bcachefs: Use btree reserve when appropriate Whenever we're doing an update that has pointers, that generally means we need to do the update in order to release open bucket references - so we should be using the btree open bucket reserve. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit eff508b459fb90682c7a5c4e6d2de0b1d18217e4 Author: Kent Overstreet Date: Wed Jun 17 18:20:26 2020 -0400 bcachefs: Add a kthread_should_stop() check to allocator thread Turns out it's possible during shutdown for the allocator to get stuck spinning on bch2_invalidate_buckets() without hitting any of the other checks. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a34782a0663cc3a5d8c4e4657480fa0e6ddc8a16 Author: Kent Overstreet Date: Wed Jun 17 17:33:53 2020 -0400 bcachefs: Change bch2_dump_bset() to also print key values Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b9c3d13978120344d8b999d1c8bc4e3096d5a18f Author: Kent Overstreet Date: Wed Jun 17 17:30:38 2020 -0400 bcachefs: Fix a deadlock in the RO path Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 47a5649a0a934b3186f34d90ddfe31bb4bcf4fac Author: Kent Overstreet Date: Mon Jun 15 20:18:02 2020 -0400 bcachefs: Fix incorrect gfp check Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d211b408abbcec99531bc262a8e9973c86a6d856 Author: Kent Overstreet Date: Mon Jun 15 19:53:46 2020 -0400 bcachefs: Fix lock ordering with new btree cache code The code that checks lock ordering was recently changed to go off of the pos of the btree node, rather than the iterator, but the btree cache code didn't update to handle iterators that point to cached bkeys. Oops Also, update various debug code. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1d1867896210e0ed6d137cebea83abe01bbb8ffc Author: Kent Overstreet Date: Mon Jun 15 17:59:09 2020 -0400 bcachefs: delete a slightly faulty assertion state lock isn't held at startup Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7dd1ebfa1ec156d54238126c3ce7f0fb31ea7a45 Author: Kent Overstreet Date: Mon Jun 15 17:38:26 2020 -0400 bcachefs: Increase size of btree node reserve Also tweak the allocator to be more aggressive about keeping it full. The recent changes to make updates to interior nodes transactional (and thus generate updates to the alloc btree) all put more stress on the btree node reserves. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e27b03b35b09f9cbee9a69bd99951d7adaf02fa7 Author: Kent Overstreet Date: Mon Jun 15 16:59:36 2020 -0400 bcachefs: Give bkey_cached_key same attributes as bpos Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5d20ba48f00050d8e6498cfbbb93b2914bd97114 Author: Kent Overstreet Date: Sat Oct 5 12:54:53 2019 -0400 bcachefs: Use cached iterators for alloc btree Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2ca88e5ad9b29624ea1467ef7fcc583c928fd783 Author: Kent Overstreet Date: Thu Mar 7 19:46:10 2019 -0500 bcachefs: Btree key cache This introduces a new kind of btree iterator, cached iterators, which point to keys cached in a hash table. The cache also acts as a write cache - in the update path, we journal the update but defer updating the btree until the cached entry is flushed by journal reclaim. Cache coherency is for now up to the users to handle, which isn't ideal but should be good enough for now. These new iterators will be used for updating inodes and alloc info (the alloc and stripes btrees). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 451570a5bc5f72c4c6442631d158f0c11cb3daa8 Author: Kent Overstreet Date: Mon Jun 15 15:10:54 2020 -0400 bcachefs: Implement a new gc that only recalcs oldest gen Full mark and sweep gc doesn't (yet?) work with the new btree key cache code, but it also blocks updates to interior btree nodes for the duration and isn't really necessary in practice; we aren't currently attempting to repair errors in allocation info at runtime. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1ada160618d66bc57beacb4c35f13e9a4c269afa Author: Kent Overstreet Date: Mon Jun 15 14:58:47 2020 -0400 bcachefs: Turn c->state_lock into an rwsem Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7fffc85baf1fa176560a546a0625efc549969ce4 Author: Kent Overstreet Date: Sat Jun 13 18:43:14 2020 -0400 bcachefs: Add an internal option for reading entire journal To be used the debug tool that dumps the contents of the journal. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit bd2bb273a09b93e2a7d79d30458ab5f6f0b3757a Author: Kent Overstreet Date: Fri Jun 12 22:29:48 2020 -0400 bcachefs: Don't deadlock when btree node reuse changes lock ordering Btree node lock ordering is based on the logical key. However, 'struct btree' may be reused for a different btree node under memory pressure. This patch uses the new six lock callback to check if a btree node is no longer the node we wanted to lock before blocking. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 515282ac7d847d567dd3ba802edf34316368bb14 Author: Kent Overstreet Date: Fri Jun 12 14:58:07 2020 -0400 bcachefs: Fix a deadlock __bch2_btree_node_lock() was incorrectly using iter->pos as a proxy for btree node lock ordering, this caused an off by one error that was triggered by bch2_btree_node_get_sibling() getting the previous node. This refactors the code to compare against btree node keys directly. Signed-off-by: Kent Overstreet commit 4e8224ed8ab3c671bb96b6b98c8f8de14637440d Author: Kent Overstreet Date: Tue Jun 9 21:00:29 2020 -0400 bcachefs: Refactor btree insert path This splits out the journalling code from the btree update code; prep work for the btree key cache. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4efe71a646c5add87d4082380f1663150cd462af Author: Kent Overstreet Date: Tue Jun 9 20:54:36 2020 -0400 bcachefs: Always give out journal pre-res if we already have one This is better than skipping the journal pre-reservation if we already have one - we should still acount for the journal reservation we're going to have to get. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 374153c2a958f33805e68a20770e4f0b503be48e Author: Kent Overstreet Date: Tue Jun 9 15:44:03 2020 -0400 bcachefs: More open buckets We need a larger open bucket reserve now that the btree interior update path holds onto open bucket references; filesystems with many high through devices may need more open buckets now. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e38821f322d97ca1289bea704eed9d276f47c521 Author: Kent Overstreet Date: Tue Jun 9 17:49:24 2020 -0400 bcachefs: Don't allocate memory under the btree cache lock The btree cache lock is needed for reclaiming from the btree node cache, and memory allocation can potentially spin and sleep (for 100 ms at a time), so.. don't do that. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 966885ee409d128e2561e4c3546f4187ee173389 Author: Kent Overstreet Date: Tue Jun 9 16:25:07 2020 -0400 bcachefs: Fix a linked list bug Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6b5f9b29e65335baa6291ee2ce39d5ef6bd30c41 Author: Kent Overstreet Date: Tue Jun 9 15:46:22 2020 -0400 bcachefs: Make open bucket reserves more conservative Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 40ca39b56448ecf05e7b4b6c921968e8648f8f0b Author: Kent Overstreet Date: Tue Jun 9 15:59:03 2020 -0400 bcachefs: btree_update_nodes_written() requires alloc reserve Also, in the btree_update_start() path, if we already have a journal pre-reservation we don't want to take another - that's a deadlock. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8c9eef95cde9e2a11f7c84181dc1710e594dffb2 Author: Kent Overstreet Date: Fri Jun 5 09:01:23 2020 -0400 bcachefs: Check gfp_flags correctly in bch2_btree_cache_scan() bch2_btree_node_mem_alloc() uses memalloc_nofs_save()/GFP_NOFS, but GFP_NOFS does include __GFP_IO - oops. We used to use GFP_NOIO, but as we're a filesystem now GFP_NOFS makes more sense now and is looser. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8804ef1f28def994562801f68d271ad4f0cf1c36 Author: Kent Overstreet Date: Mon Jun 8 14:28:16 2020 -0400 bcachefs: Call bch2_btree_iter_traverse() if necessary in commit path Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 72545b5e76b05407e13f369590479ef1a5fd0f52 Author: Kent Overstreet Date: Mon Jun 8 13:26:48 2020 -0400 bcachefs: bch2_trans_downgrade() bch2_btree_iter_downgrade() was looping over all iterators in a transaction; bch2_trans_downgrade() should be doing that. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 784d8d173d7aa68a32ea04c45bc8a038e4cfbc4e Author: Kent Overstreet Date: Wed Jun 3 23:47:50 2020 -0400 bcachefs: Improve warning for copygc failing to move data This will help narrow down which code is at fault when this happens. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 255adc515aeab4bd870e548bb4154c2682871c05 Author: Kent Overstreet Date: Wed Jun 3 23:46:15 2020 -0400 bcachefs: Always increment bucket gen on bucket reuse Not doing so confuses copygc Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a27443bc7652a37db1ac99f2c77b20ac15947cc5 Author: Kent Overstreet Date: Wed Jun 3 22:11:10 2020 -0400 bcachefs: Kill old allocator startup code It's not needed anymore since we can now write to buckets before updating the alloc btree. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9ef846a7a13bc6daa3fc431acab5c13d7fb4aa84 Author: Kent Overstreet Date: Wed Jun 3 18:27:07 2020 -0400 bcachefs: Improve assorted error messages This also consolidates the various checks in bch2_mark_pointer() and bch2_trans_mark_pointer(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f96c0df4dbb0ed845bbc51f341d00bc90368c93c Author: Kent Overstreet Date: Tue Jun 2 19:41:47 2020 -0400 bcachefs: Fix a deadlock in bch2_btree_node_get_sibling() There was a bad interaction with bch2_btree_iter_set_pos_same_leaf(), which can leave a btree node locked that is just outside iter->pos, breaking the lock ordering checks in __bch2_btree_node_lock(). Ideally we should get rid of this corner case, but for now fix it locally with verbose comments. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 495aabede3ff594c5eda98cb9f4463502cb48cad Author: Kent Overstreet Date: Tue Jun 2 16:36:11 2020 -0400 bcachefs: Add debug code to print btree transactions Intented to help debug deadlocks, since we can't use lockdep to check btree node lock ordering. Signed-off-by: Kent Overstreet commit 61fc3c9610e4728c22e5be67a45d0520b1a388cf Author: Kent Overstreet Date: Wed Jun 3 16:20:22 2020 -0400 bcachefs: Set filesystem features earlier in fs init path Before we were setting features after allocating btree nodes, which meant we were using the old btree pointer format. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 36b8372b595748d37dcdcd915c176bada978fbe5 Author: Kent Overstreet Date: Tue Jun 2 16:30:54 2020 -0400 bcachefs: Add an option to disable reflink support Reflink might be buggy, so we're adding an option so users can help bisect what's going on. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 039fc4c5221f7433d8383e25a7c70b30793b4916 Author: Kent Overstreet Date: Thu May 28 16:06:13 2020 -0400 bcachefs: Fixes for going RO Now that interior btree updates are fully transactional, we don't need to write out alloc info in a loop. However, interior btree updates do put more things in the journal, so we still need a loop in the RO sequence. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit baeed3c3c028359c625fbe92bc5924edaea91ec4 Author: Kent Overstreet Date: Thu May 28 15:51:50 2020 -0400 bcachefs: Don't require alloc btree to be updated before buckets are used This is to break a circular dependency in the shutdown path. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit beb6db68a555d14b4b3a7b894d6d635774bcdafd Author: Kent Overstreet Date: Thu May 28 17:15:41 2020 -0400 bcachefs: fsck_error_lock requires GFP_NOFS this fixes a lockdep splat Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 00b8ccf7074fddb5607a26673f331ceac2ecd319 Author: Kent Overstreet Date: Mon May 25 14:57:06 2020 -0400 bcachefs: Interior btree updates are now fully transactional We now update the alloc info (bucket sector counts) atomically with journalling the update to the interior btree nodes, and we also set new btree roots atomically with the journalled part of the btree update. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c823c3390bd2f325f78bab493f84ea8a84f5ddc2 Author: Kent Overstreet Date: Mon May 25 20:35:53 2020 -0400 bcachefs: Factor out bch2_fs_btree_interior_update_init() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 96e2aa1be5eebd81ed572baf69f8cb82d56e39bd Author: Kent Overstreet Date: Mon May 25 19:29:48 2020 -0400 bcachefs: Add a mechanism for passing extra journal entries to bch2_trans_commit() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b29303966b9e07dda5f21c667909eb87849453f2 Author: Kent Overstreet Date: Sun May 24 14:06:10 2020 -0400 bcachefs: Fix reading of alloc info after unclean shutdown When updates to interior nodes started being journalled, that meant that after an unclean shutdown, until journal replay is done we can't walk the btree without overlaying the updates from the journal. The initial btree gc was changed to walk the btree overlaying keys from the journal - but bch2_alloc_read() and bch2_stripes_read() were missed. Major whoops... Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 692c3f0601bd1b04b914a40907a36e4c36dc8edd Author: Kent Overstreet Date: Wed May 27 14:10:27 2020 -0400 bcachefs: fix memalloc_nofs_restore() usage Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit aafcf9bc12f479b47f4bc1f008f4002dd1af91b8 Author: Kent Overstreet Date: Sun May 24 14:20:00 2020 -0400 bcachefs: Better error messages on bucket sector count overflows Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2340fd9d27c48072f4409ad194a8838acd789b8f Author: Kent Overstreet Date: Sun May 24 13:37:44 2020 -0400 bcachefs: Be more rigorous about marking the filesystem clean Previously, there was at least one error path where we could mark the filesystem clean when we hadn't sucessfully written out alloc info. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit dc744b51f97ce043d07ebfdd0397b323396c7683 Author: Kent Overstreet Date: Mon May 25 21:25:31 2020 -0400 bcachefs: Handle printing of null bkeys This fixes a null ptr deref. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2628cfe3d3037c20015bcc8bc59143f8b913db6c Author: Kent Overstreet Date: Mon May 25 18:47:21 2020 -0400 bcachefs: Add vmalloc fallback for decompress workspace Signed-off-by: Kent Overstreet commit e5c15444d6aca00610c5ae9b571e307c65e744e4 Author: Kent Overstreet Date: Sat May 23 11:44:12 2020 -0400 bcachefs: Print out d_type in dirent_to_text() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 22d8a33d30d7a28d0dd972f36cc48b80f585d67b Author: Yuxuan Shui Date: Fri May 22 15:50:05 2020 +0100 bcachefs: fix stack corruption When a bkey_on_stack is passed to bch_read_indirect_extent, there is no guarantee that it will be big enough to hold the bkey. And bch_read_indirect_extent is not aware of bkey_on_stack to call realloc on it. This cause a stack corruption. This commit makes bch_read_indirect_extent aware of bkey_on_stack so it can call realloc when appropriate. Tested-by: Yuxuan Shui Signed-off-by: Yuxuan Shui Signed-off-by: Kent Overstreet commit a1b0da4555c16bf274f705dc76c9b297f54bf6c8 Author: Kent Overstreet Date: Thu May 21 17:23:40 2020 -0400 bcachefs: Wrap vmap() in memalloc_nofs_save()/restore() vmalloc() and vmap() don't take GFP_NOFS - this should be pushed further up the IO path, but for now just doing the simple fix. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0d0e77f45fe806a80af76501d5422437692e158b Author: Kent Overstreet Date: Thu May 14 21:45:08 2020 -0400 bcachefs: Fix another iterator counting bug We were marking the end of where we could insert incorrectly for indirect extents. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d3baf289dce56f78700ca9dc64153263652c9a0a Author: Kent Overstreet Date: Wed May 13 17:53:33 2020 -0400 bcachefs: Fix setquota We were returning -EINTR because we were failing to retry the btree transaction. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4167b4cdba30fb8db190a3439324f413dc08a0c0 Author: Kent Overstreet Date: Wed May 13 00:15:28 2020 -0400 bcachefs: Fix a workqueue deadlock writes running out of a workqueue (via dio path) could block and prevent other writes from calling bch2_write_index() and completing. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f36dff2885ee70990e529389a08988d5c218eed0 Author: Kent Overstreet Date: Tue May 12 18:34:16 2020 -0400 bcachefs: Validate that we read the correct btree node Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a9310ab06c0b4a0c199e569dd34579b74b9142d0 Author: Kent Overstreet Date: Mon May 11 20:01:07 2020 -0400 bcachefs: Fixes for startup on very full filesystems - Always pass BTREE_INSERT_USE_RESERVE when writing alloc btree keys - Don't strand buckest on the copygc freelist until after recovery is done and we're starting copygc. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d9b59a57cc81b1a73ff094401e9d65326cf0156b Author: Kent Overstreet Date: Fri May 8 23:15:42 2020 -0400 bcachefs: Fix initialization of bounce mempools When they were converted to kvpmalloc pools they weren't converted to pass the actual size of the allocation. Oops. Also, validate the real length in the zstd decompression path. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c4dd7871ef71a7327b6b3834e2cdf6777e03eb0a Author: Kent Overstreet Date: Wed May 6 15:37:04 2020 -0400 bcachefs: Some compression improvements In __bio_map_or_bounce(), the check for if the bio is physically contiguous is improved; it's now more readable and handles multi page but contiguous bios. Also when decompressing, we were doing a redundant memcpy in the case where we were able to use vmap to map a bio contigiously. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit bc970cecd86d5a77f58e3be017fd80276e71677e Author: Kent Overstreet Date: Sat May 2 16:21:35 2020 -0400 bcachefs: Fix two more deadlocks Deadlock on shutdown: btree_update_nodes_written() unblocks btree nodes from being written; after doing so, it has to check if they were marked as needing to be written and if so kick off those writes - if that doesn't happen, we'll never release journal pins and shutdown will get stuck when flushing the journal. There was an error path where this didn't happen, because in the error path we don't actually want those btree nodes write to happen; however, we still have to kick off the write path so the journal pins get released. The btree write path checks if we're in a journal error state and doesn't do the actual write if we are. Also - there was another deadlock because btree_update_nodes_written() was taking the btree update off of the unwritten_list too soon - before getting a journal reservation, which could fail and have to be retried. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5b6d505a77f87a4e7d13430920499c6e58928f27 Author: Kent Overstreet Date: Fri May 1 19:56:31 2020 -0400 bcachefs: Fix another deadlock in btree_update_nodes_written() We also can't be blocking on btree node write locks while holding btree_interior_update_lock. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1e1a31c4b0017dd241438bfbba3186266cc0ed11 Author: Kent Overstreet Date: Wed Apr 29 12:57:04 2020 -0400 bcachefs: Add some printks for error paths Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f59b346477a4ed536583be2df077c5aa684a1df8 Author: Kent Overstreet Date: Wed Apr 29 15:28:25 2020 -0400 bcachefs: Don't issue writes that are more than 1 MB the bcachefs io path in io.c can't bounce writes larger than that. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6f2b9074d7511e23fec4e6a3e3f47184480b0a58 Author: Kent Overstreet Date: Fri Apr 24 17:57:59 2020 -0400 bcachefs: More fixes for counting extent update iterators This is unfortunately really fragile - hopefully we'll be able to think of a new approach at some point. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit bbe65614b7bffaeff5213cb782743e7de3be48d1 Author: Kent Overstreet Date: Fri Apr 24 18:25:11 2020 -0400 bcachefs: Fix a deadlock btree_node_lock_increment() was incorrectly skipping over the current iter when checking if we should increment a node we already have locked. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2c480a7102f20c22315b45fcc79d63078e51b13d Author: Kent Overstreet Date: Fri Apr 24 14:08:56 2020 -0400 bcachefs: Handle -EINTR bch2_migrate_index_update() peek_slot() shouldn't return -EINTR when there's only a single live iterator, but that's tricky to guarantee - we seem to be returning -EINTR when we shouldn't, but it's easy enough to handle in the caller. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 41697f382cffc0e396dd832d19c78e69cdd10aa3 Author: Kent Overstreet Date: Fri Apr 24 14:08:18 2020 -0400 bcachefs: Fix for the bkey compat path In the write path, we were calling bch2_bkey_ops.compat() in the wrong place. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 297604c92337cd546f41a38f53d420093f7ce963 Author: Kent Overstreet Date: Sat Apr 11 12:32:27 2020 -0400 bcachefs: Add a few tracepoints Transaction restart tracing should probably be overhaulled at some point. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f270667a7fc020f1711953ad3b0d6e6b38eba834 Author: Kent Overstreet Date: Sat Apr 11 12:31:16 2020 -0400 bcachefs: Slightly reduce btree split threshold 2/3rds performs a lot better than 3/4ths on the tested workloda, leading to significanly fewer btree node compactions. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 15a07f2eae6852dc4f3c1172601d592be0f5756f Author: Kent Overstreet Date: Sat Apr 11 12:30:30 2020 -0400 bcachefs: Improve lockdep annotation in journalling code bch2_journal_res_get() in nonblocking mode is equivalent to a trylock. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 94035eed52f58a321fa28e938898535973bec847 Author: Kent Overstreet Date: Sat Apr 11 12:29:32 2020 -0400 bcachefs: Fix a locking bug in bch2_journal_pin_copy() There was a race where the src pin would be flushed - releasing the last pin on that sequence number - before adding the new journal pin. Oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 58fb3e519a7612a01d9fc969aa4eca56b30d898e Author: Kent Overstreet Date: Tue Apr 7 17:27:12 2020 -0400 bcachefs: Fix another deadlock in the btree interior update path Can't take read locks on btree nodes while holding btree_interior_update_lock. Also, fix a bug where we were leaking journal prereservations. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1eba942d1c48a9d3dadbb04f65be7705f506e40b Author: Kent Overstreet Date: Tue Apr 7 17:31:38 2020 -0400 bcachefs: Fix a locking bug in bch2_btree_ptr_debugcheck() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e77e4efce31f3739fa85a84c5197b7cd18747a64 Author: Kent Overstreet Date: Tue Apr 7 13:49:14 2020 -0400 bcachefs: Account for ioclock slop when throttling rebalance thread This should fix an issue where the rebalance thread was spinning Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0f9dda478fb50bb7c55e4760158a6ef7cca7cb04 Author: Kent Overstreet Date: Sun Apr 5 21:49:17 2020 -0400 bcachefs: Fix a deadlock on starting an interior btree update Not legal to block on a journal prereservation with btree locks held. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1e3b1f9a229df5cd8f21e2f6306fbcf25374f42a Author: Kent Overstreet Date: Sat Apr 4 16:47:59 2020 -0400 bcachefs: Fix a debug mode assertion Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2aec5955bb7c800a4eec685dcd58976013da1275 Author: Kent Overstreet Date: Sat Apr 4 15:49:42 2020 -0400 bcachefs: Fix a debug assertion This assertion was passing the wrong btree node type when inserting into interior nodes. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8707ab0df25955f4e11bf60643e08c018a72e6fc Author: Kent Overstreet Date: Sat Apr 4 15:45:06 2020 -0400 bcachefs: Fix another error path locking bug btree_update_nodes_written() was leaking a btree node lock on failure to get a journal reservation. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 75923ba7ad56f7236ae3979577011f5220d07d50 Author: Kent Overstreet Date: Sat Apr 4 13:54:19 2020 -0400 bcachefs: Fix a null ptr deref during journal replay We were calling bch2_extent_can_insert() incorrectly; it should only be called when the extents-to-keys pass is running because that's when we could be splitting a compressed extent. Calling bch2_extent_can_insert() without passing in a disk reservation was causing a null ptr deref. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 47c46c953163909944cd8ebf7e12107635fdb604 Author: Kent Overstreet Date: Wed Apr 1 17:28:39 2020 -0400 bcachefs: Add another mssing bch2_trans_iter_put() call Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0329b1507d37c8a7f87dace9ad888cc5abb7c8a8 Author: Kent Overstreet Date: Wed Apr 1 17:14:14 2020 -0400 bcachefs: Trace where btree iterators are allocated This will help with iterator overflow bugs. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 283eda5798bc5f4f593817e057c14f02790e5bdb Author: Kent Overstreet Date: Wed Apr 1 16:07:57 2020 -0400 bcachefs: Fix fallocate FL_INSERT_RANGE This was another bug because of bch2_btree_iter_set_pos() invalidating iterators. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 59a38a384443cd3c7343d25bd4b7cc2ccf2a8aef Author: Kent Overstreet Date: Tue Mar 31 16:25:30 2020 -0400 bcachefs: Add print method for bch2_btree_ptr_v2 Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 501e1bda3e58db75eaf938fde70b03639dd6282a Author: Kent Overstreet Date: Tue Mar 31 16:23:43 2020 -0400 bcachefs: Fix journalling of interior node updates We weren't journalling updates done while splitting/compacting nodes - oops. Signed-off-by: Kent Overstreet commit b58a181d5c4a145730f202ac0375fa463c88f710 Author: Kent Overstreet Date: Mon Mar 30 18:11:13 2020 -0400 bcachefs: Fix iterating of journal keys within a btree node Extent btrees no longer have weird special behaviour for min_key. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 11f6ed36b959131a0d990253f07e5105fc4d8901 Author: Kent Overstreet Date: Mon Mar 30 17:43:21 2020 -0400 bcachefs: Fix a locking bug Dropping the wrong kind of lock can't lead to anything good... Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1d60b99999bc2abd4020b758794ced8af43394ae Author: Kent Overstreet Date: Mon Mar 30 14:29:06 2020 -0400 bcachefs: Fix inodes pass in fsck It wasn't updated for the patch that switched inodes to using the offset field of struct bkey. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e5e6aaa7979ab588868f686c8bd8997264492610 Author: Kent Overstreet Date: Mon Mar 30 14:05:05 2020 -0400 bcachefs: Fix ec_stripe_update_ptrs() bch2_btree_iter_set_pos() invalidates the key returned by peek(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d06c1a0cbce929c0bafd7f37dcb0fbf9e652abb5 Author: Kent Overstreet Date: Sun Mar 29 16:48:53 2020 -0400 bcachefs: Check btree topology at startup When initial btree gc was changed to overlay journal keys as it walks the btree, it also stopped checking btree topology. Previously, checking btree topology was a fairly complicated affair - but it's much easier now that btree_ptr_v2 has min_key in the pointer. This rewrites the old range_checks code and uses it in both runtime and initial gc. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a0e491c099a25d06759bf8e6e9bcc6fd7c4229a5 Author: Kent Overstreet Date: Mon Mar 30 12:33:30 2020 -0400 bcachefs: Don't allocate memory while holding journal reservation This fixes a lockdep splat - allocating memory can call bch2_clear_page_bits() which takes mark_lock. Signed-off-by: Kent Overstreet commit 2c31e6572ec6f3fede0d4bb54f342bafba90fe70 Author: Kent Overstreet Date: Sun Mar 29 17:01:05 2020 -0400 bcachefs: Reduce max nr of btree iters when lockdep is on This is so we don't overflow MAX_LOCK_DEPTH. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 39fb2983c5862933798cdd1b59da180bc9642910 Author: Kent Overstreet Date: Tue Jan 7 13:29:32 2020 -0500 bcachefs: Kill bkey_type_successor Previously, BTREE_ID_INODES was special - inodes were indexed by the inode field, which meant the offset field of struct bpos wasn't used, which led to special cases in e.g. the btree iterator code. Now, inodes in the inodes btree are indexed by the offset field. Also: prevously min_key was special for extents btrees, min_key for extents would equal max_key for the previous node. Now, min_key = bkey_successor() of the previous node, same as non extent btrees. This means we can completely get rid of btree_type_sucessor/predecessor. Also make some improvements to the metadata IO validate/compat code. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b72633aed07b0b870680a4de0d40fc79d2edfd03 Author: Kent Overstreet Date: Sun Mar 29 14:21:44 2020 -0400 bcachefs: Switch a BUG_ON() to a warning This has popped and thus needs to be debugged, but the assertion firing isn't necessarily fatal so switch it to a warning. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 22f776985f34334b3bbba75b71ecca711f34e3f4 Author: Kent Overstreet Date: Sun Mar 29 12:33:41 2020 -0400 bcachefs: Use kvpmalloc mempools for compression bounce This fixes an issue where mounting would fail because of memory fragmentation - previously the compression bounce buffers were using get_free_pages(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5a655f06c94f541fa9223a9b7ef2ab8a909f1fea Author: Kent Overstreet Date: Sat Mar 28 18:26:01 2020 -0400 bcachefs: Read journal when keep_journal on Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 56a40fbc4e398c00e8b667f9c30b40b7695065f3 Author: Kent Overstreet Date: Sat Mar 28 19:17:23 2020 -0400 bcachefs: Various fixes for interior update path The locking was wrong, and we could get a use after free in the error path where we weren't taking the entrie being freed off the unwritten list. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4e4758c6cbbbc31aad9ec733c6f49a7221fd7b70 Author: Kent Overstreet Date: Fri Mar 27 17:38:51 2020 -0400 bcachefs: Use memalloc_nofs_save() vmalloc allocations don't always obey GFP_NOFS - memalloc_nofs_save() is the prefered approach for the future. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f7005e0175ed14bc5e2cc60add40d5eaf9075c2c Author: Kent Overstreet Date: Wed Mar 25 16:13:00 2020 -0400 bcachefs: Improve error message in fsck Seeing the extents that were overlapping is highly useful for figuring out what went wrong. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f1d786a0dbc4483d176985ebe8f82fb7cdeec429 Author: Kent Overstreet Date: Wed Mar 25 16:12:33 2020 -0400 bcachefs: Add an option for keeping journal entries after startup This will be used by the userspace debug tools. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2f194e1697f733a2eae1d040eabe71b05c049e0b Author: Kent Overstreet Date: Wed Mar 25 17:57:29 2020 -0400 bcachefs: Fix an assertion when nothing to replay Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6357d6071fccb5ccedbe32c1e0db4443d83d28dd Author: Kent Overstreet Date: Sat Feb 8 19:06:31 2020 -0500 bcachefs: Journal updates to interior nodes Previously, the btree has always been self contained and internally consistent on disk without anything from the journal - the journal just contained pointers to the btree roots. However, this meant that btree node split or compact operations - i.e. anything that changes btree node topology and involves updates to interior nodes - would require that interior btree node to be written immediately, which means emitting a btree node write that's mostly empty (using 4k of space on disk if the filesystemm blocksize is 4k to only write perhaps ~100 bytes of new keys). More importantly, this meant most btree node writes had to be FUA, and consumer drives have a history of slow and/or buggy FUA support - other filesystes have been bit by this. This patch changes the interior btree update path to journal updates to interior nodes, after the writes for the new btree nodes have completed. Best of all, it turns out to simplify the interior node update path somewhat. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f44a6a7134371d8b1e14055a2705d0f4da4c46d6 Author: Kent Overstreet Date: Sun Mar 15 22:32:03 2020 -0400 bcachefs: Replay interior node keys This slightly modifies the journal replay code so that it can replay updates to interior nodes. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e62d65f2fbc3cb89ffd273ec0931ff32b778ef8b Author: Kent Overstreet Date: Sun Mar 15 23:29:43 2020 -0400 bcachefs: trans_commit() path can now insert to interior nodes This will be needed for the upcoming patches to journal updates to interior btree nodes. Signed-off-by: Kent Overstreet commit 47143a75e01354ee0daef6667cbe7b08bd89ed84 Author: Kent Overstreet Date: Tue Mar 24 17:00:48 2020 -0400 bcachefs: Disable extent merging Extent merging is currently broken, and will be reimplemented differently soon - right now it only happens when btree nodes are being compacted, which makes it difficult to test. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0728eed7b6ec673d2b6e0f86b6daf240a2948292 Author: Kent Overstreet Date: Sat Mar 21 14:47:00 2020 -0400 bcachefs: Fix a locking bug in fsck This works around a btree locking issue - we can't be holding read locks while taking write locks, which currently means we can't have live iterators holding read locks at commit time. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit fa4dc3987b8e75ec1bfd327bb05755d153c276d6 Author: Kent Overstreet Date: Sat Mar 21 14:08:01 2020 -0400 bcachefs: Fix count_iters_for_insert() This fixes a transaction iterator overflow. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8666a9ad6facc153d143728c8b47aae1e8111cd6 Author: Kent Overstreet Date: Wed Mar 18 13:40:28 2020 -0400 bcachefs: Fix an iterator bug We were incorrectly not restarting the transaction when re-traversing iterators. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6d61724b2ba1836e4e1f5f8755cb2278d4eae1a0 Author: Kent Overstreet Date: Wed Mar 18 11:46:46 2020 -0400 bcachefs: Shut down quicker Internal writes (i.e. copygc/rebalance operations) shouldn't be blocking on the allocator when we're going RO. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 97328a1a3c95ec90bed0221719ce1ba64544f6a8 Author: Kent Overstreet Date: Wed Mar 18 11:40:07 2020 -0400 bcachefs: BCH_FEATURE_new_extent_overwrite is now required The patch "bcachefs: Move extent overwrite handling out of core btree code" should have been flipping on this feature bit; extent btree nodes in the old format have to be rewritten before we can insert into them with the new extent update path. Not turning on this feature bit was causing us to go into an infinite loop where we keep rewriting btree nodes over and over. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5d548743bddf7353cfedde0b78cfc9330031a697 Author: Kent Overstreet Date: Mon Mar 16 17:23:37 2020 -0400 bcachefs: Clear BCH_FEATURE_extents_above_btree_updates on clean shutdown This is needed so that users can roll back to before "d9bb516b2d bcachefs: Move extent overwrite handling out of core btree code", which it appears may still be buggy. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 716254b8a1af9b687547f60b9dc8f925237654d3 Author: Kent Overstreet Date: Mon Mar 16 15:48:58 2020 -0400 bcachefs: Fix another iterator leak This updates bch2_rbio_narrow_crcs() to the current style for transactional btree code, and fixes a rare panic on iterator overflow. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 19f24758ef17f4a73c84a507e6433777c0726c3e Author: Kent Overstreet Date: Mon Mar 16 15:49:23 2020 -0400 bcachefs: Don't use peek_filter() unnecessarily Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 286d8ad040ddb9a496ac4a8551d72b827e604243 Author: Kent Overstreet Date: Mon Mar 16 14:49:52 2020 -0400 bcachefs: Fix a use after free in dio write path Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 511ed5bf7626ecbba679d7a4c19d3f26685fd431 Author: Kent Overstreet Date: Sun Mar 15 22:41:10 2020 -0400 bcachefs: Drop unused export Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e3e464ac6d09269b19cea3dc32b626db44d0e6ba Author: Kent Overstreet Date: Mon Dec 30 14:37:25 2019 -0500 bcachefs: Move extent overwrite handling out of core btree code Ever since the btree code was first written, handling of overwriting existing extents - including partially overwriting and splittin existing extents - was handled as part of the core btree insert path. The modern transaction and iterator infrastructure didn't exist then, so that was the only way for it to be done. This patch moves that outside of the core btree code to a pass that runs at transaction commit time. This is a significant simplification to the btree code and overall reduction in code size, but more importantly it gets us much closer to the core btree code being completely independent of extents and is important prep work for snapshots. This introduces a new feature bit; the old and new extent update models are incompatible when the filesystem needs journal replay. Signed-off-by: Kent Overstreet commit 57b0b3db475de6b724e4db3b827c00484cdde642 Author: Kent Overstreet Date: Thu Mar 5 18:44:59 2020 -0500 bcachefs: btree_iter_peek_with_updates() Introduce a new iterator method that provides a consistent view of the btree plus uncommitted updates. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7d6f9b6409ef8c587d7395ba6c5674cae878c886 Author: Kent Overstreet Date: Sun Mar 15 16:15:08 2020 -0400 bcachefs: Fix build when CONFIG_BCACHEFS_DEBUG=n Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2e70ce563432810b5638450cf6bee271a0f248b4 Author: Kent Overstreet Date: Tue Feb 18 16:17:55 2020 -0500 bcachefs: More btree iter invariants Ensure that iter->pos always lies between the start and end of iter->k (the last key returned). Also, bch2_btree_iter_set_pos() now invalidates the key that peek() or next() returned. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c380123988265fa02c62709c39c702f734d63a7c Author: Kent Overstreet Date: Fri Mar 13 21:41:22 2020 -0400 bcachefs: Simplify bch2_btree_iter_peek_slot() Signed-off-by: Kent Overstreet commit 2dac0eae78f4e3419320cafb3bd0de2a6a4b5dba Author: Kent Overstreet Date: Tue Feb 18 16:17:55 2020 -0500 bcachefs: Iterator debug code improvements More aggressively checking iterator invariants, and fixing the resulting bugs. Also greatly simplifying iter_next() and iter_next_slot() - they were hyper optimized before, but the optimizations were getting too brittle. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3186c80fe93fd2bae4af68b94bb63403e1180ceb Author: Kent Overstreet Date: Thu Mar 5 18:43:31 2020 -0500 bcachefs: Skip 0 size deleted extents in journal replay These are created by the new extent update path, but not used yet by the recovery code and they break the existing recovery code, so we can just skip them. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f6d0368e06be2c889a4ce1097e20606cededd775 Author: Kent Overstreet Date: Mon Mar 9 16:15:54 2020 -0400 bcachefs: Traverse iterator in journal replay This fixes a bug where we end up spinning in journal replay - in theory this shouldn't be necessary though, transaction reset should be re-traversing all iterators. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a7b46a3db0931e88f837ae741afe9770c6fede49 Author: Kent Overstreet Date: Mon Mar 9 14:19:58 2020 -0400 bcachefs: Don't log errors that are expected during shutdown Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 24e0c3f8da000a30ab9397af5f977bd4cd0422e0 Author: Kent Overstreet Date: Sat Mar 7 17:20:39 2020 -0500 bcachefs: Fix bch2_dump_bset() It's used in the write path when the bset isn't in the btree node buffer. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 27beb810235615820584e15afc31e130e90793f8 Author: Kent Overstreet Date: Sat Mar 7 13:30:55 2020 -0500 bcachefs: Fix another iterator leak Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e65fcb4362d5480b6a62be32014c8643f70a8bfc Author: Kent Overstreet Date: Thu Mar 5 17:06:15 2020 -0500 bcachefs: Fix off by one error in bch2_extent_crc_append() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7699cdd58727cdb1960e6f2ccd8aeea510a0589b Author: Kent Overstreet Date: Mon Mar 2 17:08:19 2020 -0500 bcachefs: Fix extent_sort_fix_overlapping() Recently the extent update path started emmiting 0 size whiteouts on extent overwrite, as part of transitioning to moving extent handling out of the core btree code. Unfortunately, this broke the old code path that handles overlapping extents when reading in btree nodes - it relies on sorting incomming extents by start position, but the 0 size whiteouts broke that ordering. Skipping over them before the main algorithm sees them fixes this. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e3ecf4f56811ec538ed93fe8dbeb68c81ba74cc8 Author: Kent Overstreet Date: Mon Mar 2 13:38:19 2020 -0500 bcachefs: Some btree iterator improvements Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3f58a19763d9c4c09ec27152865bc892aa53410a Author: Kent Overstreet Date: Thu Feb 27 15:03:44 2020 -0500 bcachefs: Journal pin cleanups Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 883f1a7ce05f5f723ce5b47b9d9b796b53b3692a Author: Kent Overstreet Date: Thu Feb 27 15:03:53 2020 -0500 bcachefs: Dont't del sysfs dir until after we go RO This will help for debugging hangs during unmount Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 38f0664a5f596faf7d0a247697d6f21a85133cb9 Author: Kent Overstreet Date: Wed Feb 26 22:29:52 2020 -0500 bcachefs: Fix error message on bucket sector count overflow Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f1f5f114cdd1af3ff68a0da972454d9956c26eb0 Author: Kent Overstreet Date: Wed Feb 26 20:39:06 2020 -0500 bcachefs: Improve an error message Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b807a0c8baf64a9eeae9449dcc8e82b8952db394 Author: Kent Overstreet Date: Wed Feb 26 17:34:27 2020 -0500 bcachefs: BCH_SB_FEATURES_ALL BCH_FEATURE_btree_ptr_v2 wasn't getting set on new filesystems, oops Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7f81d4cf69c857881cd5139cbe064512a60dae78 Author: Kent Overstreet Date: Wed Feb 26 17:25:13 2020 -0500 bcachefs: fix setting btree_node_accessed() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 72141e1f4fa4f389f64d4ed7c6a63689e67921ac Author: Kent Overstreet Date: Mon Feb 24 15:25:00 2020 -0500 bcachefs: Use btree_ptr_v2.mem_ptr to avoid hash table lookup Nice performance optimization Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 00aad62aaf56fe589eb79e31b73af9fed98a40c2 Author: Kent Overstreet Date: Wed Feb 26 17:11:00 2020 -0500 bcachefs: Fix incorrect initialization of btree_node_old_extent_overwrite() b->level and b->btree_id weren't set when the code was checking btree_node_is_extents() Signed-off-by: Kent Overstreet commit c18dade6589ae3cec9b457849e93358bb8780fe5 Author: Kent Overstreet Date: Wed Feb 26 15:58:36 2020 -0500 bcachefs: Issue discards when needed to allocate journal write Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 163e885a0aee99657b3819ead6c3390271ed0980 Author: Kent Overstreet Date: Wed Feb 26 15:39:46 2020 -0500 bcachefs: Kill TRANS_RESET_MEM|TRANS_RESET_ITERS All iterators should be released now with bch2_trans_iter_put(), so TRANS_RESET_ITERS shouldn't be needed anymore, and TRANS_RESET_MEM is always used. Also convert more code to __bch2_trans_do(). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ac7c51b2180e757feaaabcb84794bcc9912a4edf Author: Kent Overstreet Date: Sat Feb 8 16:39:37 2020 -0500 bcachefs: Seralize btree_update operations at btree_update_nodes_written() Prep work for journalling updates to interior nodes - enforcing ordering will greatly simplify those changes. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 548b3d209fa5c6aaa9db58a69d9f6cf4ce8978b6 Author: Kent Overstreet Date: Fri Feb 7 13:38:02 2020 -0500 bcachefs: btree_ptr_v2 Add a new btree ptr type which contains the sequence number (random 64 bit cookie, actually) for that btree node - this lets us verify that when we read in a btree node it really is the btree node we wanted. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 237e80483a6466f3c1968c2a8bb115b3e24d951b Author: Kent Overstreet Date: Tue Feb 18 17:15:32 2020 -0500 bcachefs: introduce b->hash_val This is partly prep work for introducing bch_btree_ptr_v2, but it'll also be a bit of a performance boost by moving the full key out of the hot part of struct btree. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b606c8aa568e9f4f10f1b7504f8b96628d933a0e Author: Kent Overstreet Date: Tue Feb 18 19:29:33 2020 -0500 bcachefs: Fix traversing to interior nodes NULL is used to mean "reach end of traversal" - we were only initializing the leaf node in the iterator to the right sentinal value. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a9bc0a5173bb9c30d0073ccf39b10e26d2f96ecf Author: Kent Overstreet Date: Tue Feb 18 20:02:41 2020 -0500 bcachefs: Check for bad key version number Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1f49dafcd3191de1db9b6105983696b5bc7aedad Author: Kent Overstreet Date: Thu Feb 6 20:15:15 2020 -0500 bcachefs: Fix bch2_ptr_swab for indirect extents bch2_ptr_swab was never updated when the code for generic keys with pointers was added - it assumed the entire val was only used for pointers. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c4a94ae3da7c666d5d5230897a3f6d1e9d8d8b55 Author: Kent Overstreet Date: Fri Jan 31 13:26:05 2020 -0500 bcachefs: Make BTREE_ITER_IS_EXTENTS private to iter code Prep work for changing the core btree update path to handle extents like regular keys; we need to reduce the scope of what BTREE_ITER_IS_EXTENTS means Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6a9ec8282647cde71bb34e2d78b3d3789206ffed Author: Kent Overstreet Date: Fri Jan 31 13:23:18 2020 -0500 bcachefs: __bch2_btree_iter_set_pos() This one takes an additional argument for whether we're searching for >= or > the search key. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5c4a5cd5b379567f648c0f5d0f9ec7550bc8b67e Author: Kent Overstreet Date: Fri Dec 27 20:51:35 2019 -0500 bcachefs: btree_and_journal_iter Introduce a new iterator that iterates over keys in the btree with keys from the journal overlaid on top. This factors out what the erasure coding init code was doing manually. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8b53852d0a80ec4e438205bf8eb3a5a73ee8238c Author: Kent Overstreet Date: Tue Feb 18 14:27:10 2020 -0500 bcachefs: Make sure we're releasing btree iterators This wasn't originally required, but this is the model we're moving towards. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit fdf224003354fb14e20f638e479273c4728dfc0a Author: Kent Overstreet Date: Thu Jan 30 20:26:08 2020 -0500 bcachefs: Improve an insert path optimization The insert path had an optimization to short circuit lookup table/iterator fixups when overwriting an existing key with the same size value - but it was incorrect when other key fields (size/version) were changing. This is important for the upcoming rework to have extent updates use the same insert path as regular keys. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 7d4aed1ea408f45aef8ddf5f28d8c10680b4f214 Author: Kent Overstreet Date: Wed Jan 29 13:05:04 2020 -0500 bcachefs: Fix an uninitialized field in bch_write_op Regression from "bcachefs: Track incompressible data" Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4dba7c301782de9cba75b7895a5068c0bf07a551 Author: Kent Overstreet Date: Mon Jan 27 17:47:07 2020 -0500 bcachefs: Fix an in iterator leak This should fix a transaction iterator overflow bug during fsck. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ab05de4ce4a1b806773e59b97a59bcfabba57d8d Author: Kent Overstreet Date: Fri Feb 23 16:26:10 2018 -0500 bcachefs: Track incompressible data This fixes the background_compression option: wihout some way of marking data as incompressible, rebalance will keep rewriting incompressible data over and over. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 182084e3dc5f55de12f0184ddd6243f64b6cd87b Author: Kent Overstreet Date: Mon Jan 20 19:42:38 2020 -0500 bcachefs: Refactor rebalance_pred function Before, the logic for if we should move an extent was duplicated somewhat, in both rebalance_add_key() and rebalance_pred(); this centralizes that in __rebalance_pred() This is prep work for a patch that enables marking data as incompressible. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 65d9f536fa3e8ad302798194b85d18632ed329b9 Author: Kent Overstreet Date: Thu Jan 9 18:30:05 2020 -0500 bcachefs: Improve tracepoints slightly in commit path Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6876d2ab784645291089dd6fb325d6793cfd1c22 Author: Kent Overstreet Date: Thu Jan 16 16:20:53 2020 -0500 bcachefs: Add a cond_resched() to rebalance loop Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 952070908f9f47acb9e9ebd642570dd75f672edc Author: Kent Overstreet Date: Thu Jan 16 16:14:56 2020 -0500 bcachefs: Don't modify existing key in place in sort_repack_merge() This fixes a nasty memory corruption with other threads that are still reading the btree node being compacted. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a965ef4986243bb0490d5af0ae202e81871554e1 Author: Kent Overstreet Date: Wed Jan 15 22:53:49 2020 -0500 bcachefs: Fix bch2_sort_keys() to not modify src keys Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5525f632dc123ed32f17c649a54d07794a873822 Author: Kent Overstreet Date: Wed Jan 15 15:11:22 2020 -0500 bcachefs: Change btree split threshold to be in u64s This fixes a bug with very small btree nodes where splitting would end up with one of the new nodes empty. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d98a5e39452e08d4d51c2240b0711ea86a62de6d Author: Kent Overstreet Date: Thu Jan 9 20:43:58 2020 -0500 bcachefs: Add some comments for btree iterator flags Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ae54c4539b3cf8d2c7f96b3731b4d0c171416087 Author: Kent Overstreet Date: Mon Jan 6 23:43:04 2020 -0500 bcachefs: Refactor bch2_btree_bset_insert_key() The main thing going on is to separate out the different cases deletion, overwriting, and inserting a new key. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9626aeb167144db2ba235bde5f9f1863c3ef354b Author: Kent Overstreet Date: Mon Jan 6 22:25:09 2020 -0500 bcachefs: Rework iter->pos handling - Rework some of the helper comparison functions for consistency - Currently trying to refactor all the logic that's different for extents in the btree iterator code. The main difference is that for non extents we search for a key greater than or equal to the search key, while for extents we search for a key strictly greater than the search key (iter->pos). So that logic is now handled by btree_iter_search_key(), which computes the real search key based on iter->pos and whether or not we're searching for a key >= or > iter->pos. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f2e8c69fcb63d280d1013b84973889e3aecd6603 Author: Kent Overstreet Date: Sun Jan 5 18:20:23 2020 -0500 bcachefs: Don't lose needs_whiteout in overwrite path Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a7b96ab020a76982c47616dccc2b3efaa5b755fd Author: Kent Overstreet Date: Sat Jan 4 19:04:47 2020 -0500 bcachefs: Don't call trans_iter_put() on error pointer Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 0abb250125bfb114fa1f471bc5c77f1dc72b9e4d Author: Kent Overstreet Date: Sat Jan 4 16:46:23 2020 -0500 bcachefs: Ensure iterators are valid before calling trans_mark_key() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b2ca9903cd7a3fd2193aaf123718bcbc9e9e66e9 Author: Kent Overstreet Date: Sat Jan 4 16:33:32 2020 -0500 bcachefs: Fix extent_to_replicas() This needs to match bch2_mark_extent()/bch2_trans_mark_extent() in buckets.c Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e7808eef95213678a5c4d009aef636e9037588fb Author: Kent Overstreet Date: Sat Jan 4 16:09:52 2020 -0500 bcachefs: Kill bch2_fs_bug() These have all been converted to fsck/inconsistent errors Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 31ba2cd33037e1011947b7abbfd70921c735841d Author: Kent Overstreet Date: Fri Jan 3 22:38:14 2020 -0500 bcachefs: Hacky fixes for device removal The device remove test was sporadically failing, because we hadn't finished dropping btree sector counts for the device when bch2_replicas_gc2() was called - mainly due to in flight journal writes. We don't yet have a good mechanism for flushing the counts that correspend to open journal entries yet. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 3e548da8f57ef41523f6f7fe72f812116af48ba1 Author: Kent Overstreet Date: Fri Jan 3 18:57:32 2020 -0500 bcachefs: Don't print anything when device doesn't have a label Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit d5cdf033cd371eb55f7337ac08bb4ac48135ce8b Author: Kent Overstreet Date: Fri Jan 3 18:04:19 2020 -0500 bcachefs: Fix an iterator error path On transaction restart (-EINTR), we need to traverse all iterators. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9ad26b2b568f75ee6872a3afa70fa8005994efe8 Author: Kent Overstreet Date: Fri Jan 3 16:03:10 2020 -0500 bcachefs: Make sure bch2_read_extent obeys BCH_READ_MUST_CLONE This fixes the bch2_read_retry_nodecode() path, we were resubmitting a bio without properly reinitializing it. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 24326cd12aa03ea2c6808d09d285af2cecfa4789 Author: Kent Overstreet Date: Tue Dec 31 19:37:10 2019 -0500 bcachefs: Sort & deduplicate updates in bch2_trans_update() Previously, when doing multiple update in the same transaction commit that overwrote each other, we relied on doing the updates in the same order as the bch2_trans_update() calls in order to get the correct result. But that wasn't correct for triggers; bch2_trans_mark_update() when marking overwrites would do the wrong thing because it hadn't seen the update that was being overwritten. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 2d594dfb5357ee133bd4cb04512c2dea65ec3104 Author: Kent Overstreet Date: Tue Dec 31 16:17:42 2019 -0500 bcachefs: Split out btree_trigger_flags The trigger flags really belong with individual btree_insert_entries, not the transaction commit flags - this splits out those flags and unifies them with the BCH_BUCKET_MARK flags. Todo - split out btree_trigger.c from buckets.c Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 54e86b581306295444ba149bf20106ce518b425f Author: Kent Overstreet Date: Mon Dec 30 13:08:26 2019 -0500 bcachefs: Make btree_insert_entry more private to update path This should be private to btree_update_leaf.c, and we might end up removing it. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f21539a56d9753e702d4aa8b71ac1dd6de85f570 Author: Kent Overstreet Date: Mon Dec 30 12:43:19 2019 -0500 bcachefs: Use bch2_trans_reset in bch2_trans_commit() Clean up a bit of duplicated code. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit bcd6f3e06fe4f039e1526a0ff5bc3ebbc2405e10 Author: Kent Overstreet Date: Tue Nov 26 17:26:04 2019 -0500 bcachefs: Use KEY_TYPE_deleted whitouts for extents Previously, partial overwrites of existing extents were handled implicitly by the btree code; when reading in a btree node, we'd do a mergesort of the different bsets and detect and fix partially overlapping extents during that mergesort. That approach won't work with snapshots: this changes extents to work like regular keys as far as the btree code is concerned, where a 0 size KEY_TYPE_deleted whiteout will completely overwrite an existing extent. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1c3ff72c0fa94651a226d3351d9df89d5eafd2d7 Author: Kent Overstreet Date: Sat Dec 28 20:17:06 2019 -0500 bcachefs: Convert some enums to x-macros Helps for preventing things from getting out of sync. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 27b3e52388e1e6b2babb71ec17efa029139e1511 Author: Kent Overstreet Date: Fri Dec 27 20:42:06 2019 -0500 bcachefs: Add an assertion to track down a heisenbug Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 46e4bb1c3782484bda814858c34f2cff942f1271 Author: Kent Overstreet Date: Fri Dec 27 13:44:03 2019 -0500 bcachefs: Fix a use after free op->end_io may free the op struct Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit e731d466d2ba0276badf79e4d960bd0938d0dc89 Author: Kent Overstreet Date: Thu Dec 26 14:54:43 2019 -0500 bcachefs: Don't export __bch2_fs_read_write BTREE_INSERT_LAZY_RW was added for this since this code was written; use it instead. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8b3bbe2c34759aad307ced27373405e346960f13 Author: Kent Overstreet Date: Tue Dec 24 18:03:53 2019 -0500 bcachefs: Don't reexecute triggers when retrying transaction commit This was causing a bug with transaction iterators overflowing; now, if triggers have to be reexecuted we always return -EINTR and retry from the start of the transaction. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 58e2388f9e11eb2dfb12d7d11a9a3559cd0e8945 Author: Kent Overstreet Date: Sun Dec 22 23:39:28 2019 -0500 bcachefs: Kill BTREE_INSERT_ATOMIC Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b1fd23df1deda45a408d007aa0b105569d12b907 Author: Kent Overstreet Date: Sun Dec 22 23:04:30 2019 -0500 bcachefs: Convert all bch2_trans_commit() users to BTREE_INSERT_ATOMIC BTREE_INSERT_ATOMIC should really be the default mode, and there's not that much code that doesn't need it - so this is prep work for getting rid of the flag. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a8abd3a7f63efe4a366ae5aba10b2466feba39d7 Author: Kent Overstreet Date: Fri Dec 20 16:35:24 2019 -0500 bcachefs: bch2_trans_reset() calls should be at the tops of loops It needs to be called when we get -EINTR due to e.g. lock restart - this fixes a transaction iterators overflow bug. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 780c4e43f8f8986bb8d97d654cb17edd0dfca4b4 Author: Kent Overstreet Date: Fri Dec 20 16:26:27 2019 -0500 bcachefs: Drop a faulty assertion This assertion was wrong for interior nodes (and wasn't terribly useful to begin with) Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 309c54c3f4151be97ff27b38e08de51a71ea0377 Author: Kent Overstreet Date: Fri Dec 20 16:19:46 2019 -0500 bcachefs: Redo copygc throttling The code that checked the current free space and waited if it was too big was causing issues - btree node allocations do not increment the write IO clock (perhaps they should); but more broadly the check wouldn't run copygc at all until the device was mostly full, at which point it might have to do a bunch of work. This redoes that logic so that copygc starts to run earlier, smoothly running more and more often as the device becomes closer to full. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5873efbfd9c3f53312aaa6c3024592a2a344f615 Author: Kent Overstreet Date: Thu Dec 19 15:07:51 2019 -0500 bcachefs: Make io timers less buggy Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 187c71f6ab439582c80433ef9e04f615b8c0f576 Author: Kent Overstreet Date: Wed Dec 18 17:34:36 2019 -0500 bcachefs: Fix a memory splat In __bch2_sb_field_resize, when a field's old a new size was 0, we were doing an invalid write just past the end of the superblock. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 22502ac23a2eaa3714b77d4a9242df352a9cd0c0 Author: Kent Overstreet Date: Mon Dec 16 17:53:59 2019 -0500 bcachefs: Redo filesystem usage ioctls When disk space accounting was changed to be tracked by replicas entry, the ioctl interface was never update: this patch finally does that. Aditionally, the BCH_IOCTL_USAGE ioctl is now broken out into separate ioctls for filesystem and device usage. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 184b1dc1a6bf4bc53a1c71bf14120498aad67ff5 Author: Justin Husted Date: Mon Nov 11 20:14:30 2019 -0800 bcachefs: Update directory timestamps during link Timestamp updates on the directory during a link operation were cached. This is inconsistent with other metadata operations such as rename, as well as being less efficient. Signed-off-by: Justin Husted Signed-off-by: Kent Overstreet commit c45d473df77f41a104ecf78275be49b67f6d6295 Author: Kent Overstreet Date: Wed Dec 18 13:18:33 2019 -0500 bcachefs: Fix for an assertion on filesystem error Normally the in memory i_size is always greater than or equal to i_size on disk; this doesn't hold on filesystem error. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b5a5c4c1033af72b94c1ba7a71f61e4231f27832 Author: Kent Overstreet Date: Mon Dec 16 15:37:47 2019 -0500 bcachefs: Fix a null ptr deref in btree_iter_traverse_one() When traversing nodes and we've reached the end of the btree, the current btree node will be NULL. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ae2f17d5ad02bc85a31d09c4396e177581abbb1f Author: Kent Overstreet Date: Sat Dec 14 16:20:33 2019 -0500 bcachefs: Kill btree_node_iter_large Long overdue cleanup - this converts btree_node_iter_large uses to sort_iter. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 8f82280ea3871781e638d920d6dead58717bc13a Author: Kent Overstreet Date: Sat Dec 14 15:55:29 2019 -0500 bcachefs: Use one buffer for sorting whiteouts We're not really supposed to allocate from the same mempool more than once. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c297a763e2dcf34fe94f74c633957306d28fe138 Author: Kent Overstreet Date: Fri Dec 13 13:08:37 2019 -0500 bcachefs: Refactor whiteouts compaction The whiteout compaction path - as opposed to just dropping whiteouts - is now only needed for extents, and soon will only be needed for extent btree nodes in the old format. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c9bebae65eade6529f9d3068a6da42fc56664bfe Author: Kent Overstreet Date: Fri Nov 29 14:08:51 2019 -0500 bcachefs: Whiteout changes More prep work for snapshots: extents will soon be using KEY_TYPE_deleted for whiteouts, with 0 size. But we wen't be able to keep these whiteouts with the rest of the extents in the btree node, due to sorting invariants breaking. We can deal with this by immediately moving the new whiteouts to the unwritten whiteouts area - this just means those whiteouts won't be sorted, so we need new code to sort them prior to merging them with the rest of the keys to be written. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 183797e31d43ce2fbfc596ff3f4d034f1ba144d0 Author: Kent Overstreet Date: Wed Nov 20 16:22:49 2019 -0500 bcachefs: Always emit new extents on partial overwrite This is prep work for snapshots: the algorithm in bch2_extent_sort_fix_overlapping() will break when we have multiple overlapping extents in unrelated snapshots - but, we'll be able to make extents work like regular keys and use bch2_key_sort_fix_overlapping() for extent btree nodes if we make a couple changes - the main one being to always emit new extents when we partially overwrite an existing (written) extent. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c201e2d97615e7dc6f2f99dcdb8bf8d64657b761 Author: Kent Overstreet Date: Tue Nov 26 17:18:23 2019 -0500 bcachefs: Fix bch2_verify_insert_pos() We were calling __btree_node_key_to_offset() on a key that wasn't in the btree node. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 07358a82bb36ff77d6a1e2e0e7fc9920b96a64d4 Author: Kent Overstreet Date: Fri Nov 29 13:48:09 2019 -0500 bcachefs: Put inline data behind a mount option for now Inline data extents + reflink is still broken Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ba239c954e840875a912230439f28b4e4fbea8ff Author: Kent Overstreet Date: Fri Nov 29 13:47:42 2019 -0500 bcachefs: bch2_check_set_feature() New helper function for setting incompatible feature bits Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 9ba68f6cdc79b0eab707bf8b50f418da05b6ff5e Author: Kent Overstreet Date: Tue Nov 26 17:09:32 2019 -0500 bcachefs: Switch to macro for bkey_ops Older versions of gcc refuse to compile it the other way Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 5934a0caf2b5dc25a17ee652a95f25c86fffbcd6 Author: Kent Overstreet Date: Wed Nov 20 14:51:30 2019 -0500 bcachefs: bkey_on_stack_reassemble() Small helper function. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit bd7e82ee2ad45540797d3e36dba24f9824e431ed Author: Kent Overstreet Date: Wed Nov 20 16:16:57 2019 -0500 bcachefs: kill ca->freelist_lock All uses were supposed to be switched over to c->freelist_lock Signed-off-by: Kent Overstreet commit 4de774952b12963a2970c77eeb6ebbd48c1d20a4 Author: Kent Overstreet Date: Sat Nov 16 16:25:58 2019 -0500 bcachefs: Reorganize extents.c Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4be1a412ea34923370cd6163232d7928ae9a0e4a Author: Kent Overstreet Date: Sat Nov 9 16:43:16 2019 -0500 bcachefs: Inline data extents This implements extents that have their data inline, in the value, instead of the bkey value being pointers to the data - and the read and write paths are updated to read from these new extent types and write them out, when the write size is small enough. Signed-off-by: Kent Overstreet commit 08c07fea7b437f0a841f85cc9b670b60dacd85cf Author: Kent Overstreet Date: Fri Nov 15 15:52:28 2019 -0500 bcachefs: Split out extent_update.c Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 085ab69357e091613625f1505d667b6a5a3ec881 Author: Kent Overstreet Date: Sat Nov 9 19:02:48 2019 -0500 bcachefs: Rework of cut_front & cut_back This changes bch2_cut_front and bch2_cut_back so that they're able to shorten the size of the value, and it also changes the extent update path to update the accounting in the btree node when this happens. When the size of the value is shortened, they zero out the space that's no longer used, so it's interpreted as noops (as implemented in the last patch). Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ad44bdc351faeacb9b7294f1689ac76babf379ad Author: Kent Overstreet Date: Sat Nov 9 23:50:52 2019 -0500 bcachefs: bkey noops For upcoming inline data extents, we're going to need to be able to shorten the value of existing bkeys in the btree - and to make that work we're going to be able to need to pad out the space the value previously took up with something. This patch changes the various code that iterates over bkeys to handle k->u64s == 0 as meaning "skip the next 8 bytes". Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit aef90ce085123c3d0c3f110b4c50b77d007b2d5d Author: Kent Overstreet Date: Fri Nov 15 20:40:15 2019 -0500 bcachefs: kill bch2_extent_has_device() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 35189e09ab46785746df7007ed2a57ee78b56191 Author: Kent Overstreet Date: Sat Nov 9 16:01:15 2019 -0500 bcachefs: bkey_on_stack This implements code for storing small bkeys on the stack and allocating out of a mempool if they're too big. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 03c8c747a0f2ee5f2b45ad692d51f6e2bdce21cb Author: Kent Overstreet Date: Wed Nov 13 19:46:11 2019 -0500 bcachefs: Make memcpy_to_bio() param const Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 50fe5bd69c6d4a0cba58ee5dc8b9c72c1abc1d60 Author: Kent Overstreet Date: Wed Nov 13 19:45:48 2019 -0500 bcachefs: Use wbc_to_write_flags() Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c32bd3ad1fe595bb96c3c781f29c7002f73450a2 Author: Kent Overstreet Date: Mon Nov 11 13:42:10 2019 -0500 bcachefs: Fix erorr path in bch2_write() The error path in bch2_write wasn't updated when the end_io callback was added to bch_write_op. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b627c7d8f46ca74e78f6df63e8e2f15af124d1f7 Author: Justin Husted Date: Sat Nov 9 19:15:40 2019 -0800 bcachefs: Set lost+found mode to 0700 For security and conformance with other filesystems, the lost+found directory should not be world or group accessible. Signed-off-by: Justin Husted Signed-off-by: Kent Overstreet commit 0897705163b5c7eb9ecacad53c252adbbf72454a Author: Kent Overstreet Date: Sat Nov 9 14:58:09 2019 -0500 bcachefs: Be slightly less tricky with union usage This is to fix a valgrind complaint - the code was correct, but too tricky for valgrind to know that. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f7f21ed382ea84f2dd4c448c7d937242a4dbbf97 Author: Kent Overstreet Date: Fri Nov 8 15:09:36 2019 -0500 bcachefs: Remove some BKEY_PADDED uses Prep work for extents with inline data Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b904a7991802d2fba1f8c59e6f0790021342c0ff Author: Kent Overstreet Date: Wed Nov 6 19:40:09 2019 -0500 bcachefs: Go back to 16 bit mantissa bkey floats The previous optimizations means using 32 bit mantissas are now a net loss - having bkey_float be only 4 bytes is good for prefetching. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 58404bb2362d8198c8b6618669ff949f84743ff6 Author: Kent Overstreet Date: Wed Oct 23 14:56:20 2019 -0400 bcachefs: Fall back to slowpath on exact comparison This is basically equivalent to the original strategy of falling back to checking against the original key when the original key and previous key didn't differ in the required bits - except, now we only fall back when the search key doesn't differ in the required bits, which ends up being a bit faster. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 1bdb67e8cb42c156954dfe2bfb1fa6ca5eee3633 Author: Kent Overstreet Date: Wed Nov 6 16:37:29 2019 -0500 bcachefs: kill BFLOAT_FAILED_PREV The assumption underlying BFLOAT_FAILED_PREV was wrong; the comparison we're doing in bset_search_tree() doesn't have to tell the pivot apart from the previous key, it just has to tell if search is definitely greater than or equal to the pivot. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 70438dc3f0a2125ddaaa6ace99fc43d060b1c2e8 Author: Kent Overstreet Date: Thu Nov 7 15:04:13 2019 -0500 bcachefs: bch2_read_extent() microoptimizations Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c45376866aa1db911dfae2703ff919519757e780 Author: Kent Overstreet Date: Thu Nov 7 15:14:10 2019 -0500 bcachefs: Pipeline binary searches and linear searches This makes prefetching for the linear search at the end of the lookup much more effective, and is a couple percent speedup. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit fab4f8c6538810e31d7d853333143621091f5dd0 Author: Kent Overstreet Date: Thu Nov 7 15:03:09 2019 -0500 bcachefs: Make __bch2_bkey_cmp_packed() smaller We can probably get rid of the version that dispatches based on type checking too. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 6baf2730ccaf0bbbe87f10fb34692441942b59ba Author: Kent Overstreet Date: Thu Nov 7 15:00:08 2019 -0500 bcachefs: Inline fast path of bch2_increment_clock() Shaving more cycles. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f58c22e76febdfeff9c92fe7f3355bd1eea6645b Author: Kent Overstreet Date: Mon Nov 4 15:56:04 2019 -0500 bcachefs: Avoid calling bch2_btree_iter_relock() in bch2_btree_iter_traverse() Signed-off-by: Kent Overstreet commit e2ee3eaab72a059b29f079290b5773509df9524f Author: Kent Overstreet Date: Wed Nov 6 15:32:11 2019 -0500 bcachefs: Add an option for fsck error ratelimiting Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit ef496cd268f45351820c3d268d01bd46c8b80b04 Author: Kent Overstreet Date: Sat Oct 26 14:58:36 2019 -0400 bcachefs: Don't BUG_ON() sector count overflow Return an error instead (still work in progress...) Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 677fc0562a237f6cfc1551e37673707096905ca7 Author: Kent Overstreet Date: Mon Nov 4 22:22:13 2019 -0500 bcachefs: Some reflink fixes len might fit into a loff_t when aligned_len does not - make sure we use a u64 for aligned_len. Also, we weren't always extending the inode correctly. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 4a1d8d3efcdedd0911941f236b2e3a6347f518c3 Author: Kent Overstreet Date: Wed Nov 6 14:29:30 2019 -0500 bcachefs: Fix setting of attributes mask in getattr Discovered by xfstests generic/553 Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit a023127a28d4b8d651d3ccb41dd7da2ba534390a Author: Kent Overstreet Date: Wed Nov 2 16:45:28 2022 -0400 bcachefs: Eliminate function calls in DIO fastpaths We can assume that usually buffered and O_DIRECT IO won't be mixed, and the calls to flush the page cache won't be needed. Signed-off-by: Kent Overstreet commit 54847d253ab3a4980ed8322a618a9521a2d6cd45 Author: Kent Overstreet Date: Mon Nov 4 14:11:53 2019 -0500 bcachefs: DIO write path only needs to shoot down pagecache once, not twice Signed-off-by: Kent Overstreet commit 1b783a690dd51a64f58091d060468f7c32f13f20 Author: Kent Overstreet Date: Fri Oct 18 18:24:26 2019 -0400 bcachefs: Add pagecache_add lock to buffered IO path, fault path Signed-off-by: Kent Overstreet commit 6d01598ecd151b22feff9d8bc7f0611adacc5f28 Author: Justin Husted Date: Sun Nov 3 21:50:32 2019 -0800 bcachefs: Fix uninitialized field in hash_check_init() The chain_end field was not initialized before use in hash_set_chain_start. Signed-off-by: Justin Husted Signed-off-by: Kent Overstreet commit 7edcfbfefe5c18ea5df6bfdaca405003a0a87c51 Author: Kent Overstreet Date: Fri Nov 1 21:35:25 2019 -0400 bcachefs: Don't hold inode lock longer than necessary in dio write path In theory we should be able to do (non appending/extending) dio writes without taking the inode lock at all - but this gets us most of the way there. Signed-off-by: Kent Overstreet commit f8f30863382c0d905196ea7606c14524d1f21fd0 Author: Kent Overstreet Date: Fri Nov 1 21:16:51 2019 -0400 bcachefs: Avoid atomics in write fast path This adds some horrible hacks, but the atomic ops for closures were getting to be a pretty expensive part of the write path. We don't want to rip out closures entirely from the write path, because they're used for e.g. waiting on the allocator, or waiting on the journal flush, and that stuff would get really ugly without closures. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit f7f63211a4e7ecc4c56e3bc1062a4f9711dfd0aa Author: Kent Overstreet Date: Tue Oct 29 03:57:58 2019 -0400 bcachefs: Don't use extent_ptr_decoded_append() in write path (fixup patch) bch2_extent_ptr_decoded_append() is more general than we need here; we know we're initializing a new extent so e.g. we're going to need the crc entry. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 887c2a4ee5480d725d39a0d611a426040287188f Author: Kent Overstreet Date: Wed Oct 2 09:56:39 2019 -0400 bcachefs: bch2_btree_iter_fix_key_modified() This is considerably cheaper than bch2_btree_node_iter_fix(), for cases where the key was only modified and key ordering isn't changing. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit b7ba66c8450a58649393b47bc8975926b1e80814 Author: Kent Overstreet Date: Mon Oct 28 19:35:13 2019 -0400 bcachefs: Inline more of bch2_trans_commit hot path The main optimization here is that if we let bch2_replicas_delta_list_apply() fail, we can completely skip calling bch2_bkey_replicas_marked_locked(). And assorted other small optimizations. Signed-off-by: Kent Overstreet commit ff929515cc52ed693ff2116be3af9f32122e9b54 Author: Kent Overstreet Date: Mon Oct 28 19:33:59 2019 -0400 bcachefs: Trust btree alloc info at runtime This lets us avoid a cache miss in the write path. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit c4e065c23c4ad464be2fb1c4dfa70090cc3d0c66 Author: Kent Overstreet Date: Wed Oct 23 19:50:01 2019 -0400 bcachefs: More bset.c microoptimization Improve a few paper cuts that've shown up during profiling. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet commit 928c839cc949f7cb0b7cf09e1151e22681a4c338 Author: Justin Husted Date: Fri Oct 11 17:56:27 2019 -0700 bcachefs: Initialize btree_node flags field in bch2_btree_root_alloc. Valgrind data indicated that the flags field was only partially initialized when written to disk. Signed-off-by: Justin Husted Signed-off-by: Kent Overstreet commit 43cfbad6e431568d14e5d1407203c39a140f0148 Author: Justin Husted Date: Fri Oct 11 17:05:11 2019 -0700 bcachefs: Further padding fixes in bch2_journal_super_entries_add_common() The previous patch 128cb1a to fix uninitialized data was incorrect and did not initialize the padding space correctly. Furthermore, several other cases in this function do not initialize their padding space correctly. Move initialization into some helper functions in a more robust way. Signed-off-by: Justin Husted Signed-off-by: Kent Overstreet commit e3728b50034504e5e64604d72896973374cb1fa5 Author: Justin Husted Date: Fri Oct 11 17:20:30 2019 -0700 bcachefs: Initialize padding space after alloc bkey Packed bkeys are padded up to 64 bit alignment, but the alloc bkey type was not clearing the pad bytes after the last data byte. This left the key possibly containing some random garbage at the end. This problem was found using valgrind. This patch also changes a path with the inode bkey to clear in the same way. Signed-off-by: Justin Husted Signed-off-by: Kent Overstreet commit e219965586b0e18a12e12fdf37f26eb74bb17bcd Author: Kent Overstreet Date: Fri Oct 25 19:06:26 2019 -0400 bcachefs: Add missing error checking in bch2_find_by_inum_trans() Signed-off-by: Kent Overstreet commit 406d6d5a0733f3eacbcd4c33905bf63c5b2f4c07 Author: Kent Overstreet Date: Fri Oct 25 18:54:58 2019 -0400 bcachefs: Fix an error path race On IO error, bch2_writepages_io_done() will set the page state to indicate nothing's already reserved (since the write didn't happen, we don't know what's already reserved). This can race with the buffered IO path, in between getting a disk reservation and calling bch2_set_page_dirty(). Signed-off-by: Kent Overstreet commit 92384391c8d04642bb2be1e0c34f744675f50abc Author: Kent Overstreet Date: Thu Oct 24 14:22:29 2019 -0400 bcachefs: Don't reuse bio in retry path We can't reuse bios without reinitializing them, and in the retry path it's safer to just make sure we don't reuse them at all. Signed-off-by: Kent Overstreet commit b8098f36dd98566790bae019815583363eb877c9 Author: Kent Overstreet Date: Tue Oct 22 17:35:35 2019 -0400 bcachefs: Don't use rep movsq for small memcopies Signed-off-by: Kent Overstreet commit 7f9473d17151408ae0d5fbdbd6089df2f214c2e0 Author: Kent Overstreet Date: Mon Oct 21 21:15:08 2019 -0400 bcachefs: Avoid calling iter_prev() in extent update path Signed-off-by: Kent Overstreet commit 2e050d96b0c410646b313d711e57b6968732c37c Author: Kent Overstreet Date: Mon Oct 21 21:27:10 2019 -0400 bcachefs: kill bch2_extent_merge_inline() Signed-off-by: Kent Overstreet commit cdd775e6d7fee5dbfb17671d1427c0ca630b7f64 Author: Kent Overstreet Date: Mon Oct 21 19:38:08 2019 -0400 bcachefs: Don't use FUA unnecessarily Signed-off-by: Kent Overstreet commit 2a9101a9898920a04e77f70f7bbee84d2c76c527 Author: Kent Overstreet Date: Sat Oct 19 19:03:23 2019 -0400 bcachefs: Refactor bch2_trans_commit() path Signed-off-by: Kent Overstreet commit 8f1965391cc421ad4e50b4dfe5e06aae661f8870 Author: Kent Overstreet Date: Sun Oct 20 00:24:51 2019 -0400 bcachefs: Make btree_node_type_needs_gc() cheaper Signed-off-by: Kent Overstreet commit 77d63522f04897b025b6172074ededf5eab07b6a Author: Kent Overstreet Date: Sat Oct 19 22:22:29 2019 -0400 bcachefs: Make replicas_delta_list smaller Signed-off-by: Kent Overstreet commit fbc519ab2e3e8cfb7d9a660fa319d9c44bdd937e Author: Kent Overstreet Date: Mon Oct 21 19:58:06 2019 -0400 bcachefs: Don't submit bio in write path under lock Signed-off-by: Kent Overstreet commit 2d78737d9686faa363dde0b8fdef224ae29cff55 Author: Kent Overstreet Date: Mon Oct 21 20:40:53 2019 -0400 bcachefs: Drop bch_write_op->io_wq This is dead code Signed-off-by: Kent Overstreet commit a94407434b7a3b577a7605f0bd999d98acad6d23 Author: Kent Overstreet Date: Sun Oct 20 00:22:03 2019 -0400 bcachefs: Limit bios in writepages path to 256M This works around a bug where bio_full() doesn't check for bio->bi_iter.bi_size overflowing - and, we don't really want to build bios that are that big anyways. Signed-off-by: Kent Overstreet commit 71603f1ffe03d2409d591e4647377a415376a6b9 Author: Kent Overstreet Date: Wed Oct 16 13:48:12 2019 -0400 bcachefs: Fix an iterator counting bug The iterator counting assumed we're doing an obvious optimization when only updating the refcount on indirect extents - but we're not doing it yet. Signed-off-by: Kent Overstreet commit ae93a628956c8eab915baa83be11d2a0300eebca Author: Kent Overstreet Date: Sat Oct 12 16:44:44 2019 -0400 bcachefs: Fix flushing held btree writes when there's a fs error Previously, we'd go into an infinite loop. Signed-off-by: Kent Overstreet commit f38fe2dc5dbde967c96ce579f974a406a049b122 Author: Kent Overstreet Date: Sat Oct 12 14:44:09 2019 -0400 bcachefs: Fix iterator counting for reflink pointers (again) Signed-off-by: Kent Overstreet commit 538abcb8a1dfcd8473a90d931b8603e4a03812ca Author: Kent Overstreet Date: Sat Oct 12 14:13:45 2019 -0400 bcachefs: Fix a debug assertion Signed-off-by: Kent Overstreet commit 821a99b7ba6802d43f980a8312cd25694b7ea076 Author: Kent Overstreet Date: Fri Oct 11 15:14:36 2019 -0400 bcachefs: Switch to .iterate_shared for readdir We definitely don't need an exclusive inode lock for readdir. Signed-off-by: Kent Overstreet commit 05240ba6b897995d4d4086f7f4accc7858ee0a40 Author: Kent Overstreet Date: Fri Oct 11 15:03:32 2019 -0400 bcachefs: Fix creation of lost+found Signed-off-by: Kent Overstreet commit ea3532cbf7fdbb9fa4e45114532d55d1fc3ac7c2 Author: Kent Overstreet Date: Fri Oct 11 14:45:22 2019 -0400 bcachefs: Fix a subtle race in the btree split path We have to free the old (in memory) btree node _before_ unlocking the new nodes - else, some other thread with a read lock on the old node could see stale data after another thread has already updated the new node. Signed-off-by: Kent Overstreet commit 9a3df993e15e0d44974d6ac7c5749c7028aa9e3c Author: Kent Overstreet Date: Wed Oct 9 12:50:39 2019 -0400 bcachefs: Kill bchfs_extent_update() The generic IO path now handles inode updates for i_size and i_sectors - this means we can drop a fair amount of code from fs-io.c. Signed-off-by: Kent Overstreet commit 2e87eae1fb7a61e72d98af9c0ef8cbaad1a6d497 Author: Kent Overstreet Date: Thu Oct 10 12:47:22 2019 -0400 bcachefs: Convert bch2_fpunch to bch2_extent_update() As before - we're moving non Linux specific code out of fs-io.c. Signed-off-by: Kent Overstreet commit 2925fc49b3303ee7733cf9f6cba6a59a5b8a5e4b Author: Kent Overstreet Date: Wed Oct 9 12:11:00 2019 -0400 bcachefs: Split out bchfs_extent_update() The next few patches are going to be more moving the logic around i_size/i_sectors updates to io.c, and better separating the Linux VFS specific code from core bcachefs code, to better support the fuse port. Signed-off-by: Kent Overstreet commit e0541a9346951c94dce4d65d88541a329adf0b76 Author: Kent Overstreet Date: Wed Oct 9 11:12:48 2019 -0400 bcachefs: Kill some dependencies on ei_inode Moving bch2_extent_update() to io.c will be greatly simplified if we no longer have to keep ei_inode.bi_size/bi_sectors up to date. Signed-off-by: Kent Overstreet commit daf3fe502a4c20be99579097cc351e91d27fc789 Author: Kent Overstreet Date: Wed Oct 9 09:44:36 2019 -0400 bcachefs: Check if extending inode differently In bch2_extent_update(), we have to update the inode if i_size is changing (the file is being extend) or if i_sectors is changing, but we want to avoid touching the inode if it's not necessary. Change sum_sector_overwrites() to also check if there's already data above where we're writing to - this means we're definitely not extending the file. Signed-off-by: Kent Overstreet commit 14989d547ee308033e080792239e640e076a4460 Author: Kent Overstreet Date: Wed Oct 9 10:25:32 2019 -0400 bcachefs: Fix bch2_btree_iter_next() after peek_slot() this deserves a unit test Signed-off-by: Kent Overstreet commit 495fa1a2ec78a94bc1857531925b212edb670d2c Author: Kent Overstreet Date: Wed Oct 9 09:23:30 2019 -0400 bcachefs: Refactor bch2_readdir() a bit The tweaks to ctx->pos handling are also to help the fuse port Signed-off-by: Kent Overstreet commit 3826ee0b17557e85813378be5a5a695baf607c1c Author: Kent Overstreet Date: Wed Oct 9 09:19:06 2019 -0400 bcachefs: Add a lock to bch_page_state We can't use the page lock to protect it, because on writeback IO error we need to access the page state before calling end_page_writeback() and the page lock semantics are completely insane so that deadlocks. Signed-off-by: Kent Overstreet commit 43de7376f36c236255b7daf88e8286720426568b Author: Kent Overstreet Date: Mon Oct 7 15:57:47 2019 -0400 bcachefs: Fix erasure coding disk space accounting Disk space accounting for erasure coding + compression was completely broken - we need to calculate the parity sectors delta the same way we calculate disk_sectors, by calculating the old and new usage and subtracting to get the difference. Signed-off-by: Kent Overstreet commit 9ec211b0ff4019407d029c49099f24dfedbc4db1 Author: Kent Overstreet Date: Tue Oct 8 22:56:33 2019 -0400 bcachefs: Fix ec_stripes_read() The bkey_s_c returned by btree_iter_(peek|next) points into the btree iter type, so advancing the iterator and then using the one previously returned is a bug... Signed-off-by: Kent Overstreet commit 37954a275fce612f60406bc79f5bc0b07b4b6558 Author: Kent Overstreet Date: Tue Oct 8 18:45:29 2019 -0400 bcachefs: Limit pointers to being in only one stripe This make the disk accounting code saner, and it's not clear why we'd ever want the same data to be in multiple stripes simultaneously. Signed-off-by: Kent Overstreet commit 9ef6068c4dce124235b335847570ae8f2bf2911d Author: Kent Overstreet Date: Mon Oct 7 16:22:35 2019 -0400 bcachefs: Fix bch2_extent_ptr_durability() We were looking up the wrong entry in the stripes radix tree. Signed-off-by: Kent Overstreet commit 332c6e5370717fe28776b7427806043c22a81f69 Author: Kent Overstreet Date: Tue Oct 8 21:33:56 2019 -0400 bcachefs: Fix bch2_mark_extent() If an extent only contained cached or erasure coded pointers, there won't be any devices in the normal dirty replicas list or an entry to update. Signed-off-by: Kent Overstreet commit bf974f92039778d338e265278cb7aeaabf82ec2d Author: Justin Husted Date: Tue Oct 8 19:17:06 2019 -0700 bcachefs: Initialize journal pad data in bch_replica_entry objects. Running the filesystem under valgrind exposed some garbage data being written to disk in bch2_journal_super_entries_add_common(), in the portion which encodes bch_replica_entry objects. Signed-off-by: Justin Husted Signed-off-by: Kent Overstreet commit f7c0fcdd396ff4bd3175000eb3911f75edbc85c5 Author: Justin Husted Date: Tue Oct 8 19:16:28 2019 -0700 bcachefs: Fix uninitialized data in bch2_gc_btree() Running the filesystem under valgrind exposed a path where the max_stale variable in bch2_gc_btree() might not be initialized before use in a rare case when there are no btree nodes in a transaction. Signed-off-by: Justin Husted Signed-off-by: Kent Overstreet commit a40d97a771387362dd272608ed2df0a1fd39343e Author: Kent Overstreet Date: Mon Oct 7 15:09:30 2019 -0400 bcachefs: Fix incorrect use of bch2_extent_atomic_end() bch2_extent_atomic_end counts the number of iterators requried for marking overwrites - but journal replay never marks overwrites, so that part was incorrect. And counting iterators for the key being inserted should be unnecessary because we did that prior to the key being inserted before it was first journalled. This should fix an iterator overflow bug - the iterators for walking overwrites were totally unneeded. Signed-off-by: Kent Overstreet commit 63fbf458cb7d7df6b58f982df7496f79ee9e6863 Author: Kent Overstreet Date: Fri Oct 4 20:40:47 2019 -0400 bcachefs: Can't be holding read locks while taking write locks Signed-off-by: Kent Overstreet commit 0741d378216054145c9fd2c316924e1d403c8266 Author: Kent Overstreet Date: Fri Oct 4 19:14:43 2019 -0400 bcachefs: Don't allocate memory under mark_lock Signed-off-by: Kent Overstreet commit 137b0ed907f1c0a5036288fa340685f55fb37754 Author: Kent Overstreet Date: Fri Oct 4 17:07:20 2019 -0400 bcachefs: bch2_extent_atomic_end() now traverses iter This fixes a bug in io.c bch2_write_index_default() - it was missing the traverse call, but bch2_extent_atomic_end returns an error now and can just call it itself. Signed-off-by: Kent Overstreet commit 9638574229e3ae0175a46a63431149746c777b3a Author: Kent Overstreet Date: Wed Oct 2 18:35:36 2019 -0400 bcachefs: Factor out fs-common.c This refactoring makes the code easier to understand by separating the bcachefs btree transactional code from the linux VFS code - but more importantly, it's also to share code with the fuse port. Signed-off-by: Kent Overstreet commit 73501ab82c44b1249916ded8dcb883f7705b1549 Author: Kent Overstreet Date: Fri Oct 4 15:58:43 2019 -0400 bcachefs: Don't use sha256 for siphash str hash key With the refactoring that's coming to add fuse support, we want bch2_hash_info_init() to be cheaper so we don't have to rely on anything cached besides the inode in the btree. Signed-off-by: Kent Overstreet commit bd09d268978e1206d81a169039cf86f639817854 Author: Kent Overstreet Date: Fri Oct 4 14:39:38 2019 -0400 bcachefs: Only look up inode io opts in extents btree We currently don't have a way to propagate inode io opts to indirect extents. This is a problem... Signed-off-by: Kent Overstreet commit d65a8551c822030e1214bcffbcb181d4878414b5 Author: Kent Overstreet Date: Fri Oct 4 14:38:41 2019 -0400 bcachefs: Fix deref of error pointer Signed-off-by: Kent Overstreet commit 58677a1d40df8fe3375e9badd7387cf1a2946a3a Author: Kent Overstreet Date: Tue Oct 1 16:51:57 2019 -0400 bcachefs: bch2_inode_peek()/bch2_inode_write() Signed-off-by: Kent Overstreet commit 618b9e575b40c862a62764043c961646f3ebc6dc Author: Kent Overstreet Date: Wed Oct 2 09:14:32 2019 -0400 bcachefs: Fix undefined behaviour roundup_pow_of_two(0) is undefined Signed-off-by: Kent Overstreet commit ab9ff73322aad5cf6ea774047e47ef724077399b Author: Kent Overstreet Date: Wed Oct 2 00:29:37 2019 -0400 bcachefs: Fix an error path It's possible to get -EIO in __btree_iter_traverse_all() after looping, with orig_iter NULL. Signed-off-by: Kent Overstreet commit 8de819f83446dcdedae572ccc7449e3fa90b2c20 Author: Kent Overstreet Date: Tue Oct 1 18:51:10 2019 -0400 bcachefs: Fix __bch2_buffered_write() returning -ENOMEM When grab_cache_page_write_begin() fails but we did pin some pages, we shouldn't return -ENOMEM, we should do a partial write. Signed-off-by: Kent Overstreet commit 6988e85be525b874745824622bae4209c265dc5a Author: Kent Overstreet Date: Wed Sep 25 23:11:41 2019 -0400 bcachefs: Trust inode in btree over bch_inode_info This is the start of some refactoring work to make less code depend on the linux VFS - here the inode cache - to make e.g. the fuse port easier. Signed-off-by: Kent Overstreet commit 21ad9ddee8d1ffc1e12ab7e6b2ec18f0897fe567 Author: Kent Overstreet Date: Tue Oct 1 16:29:17 2019 -0400 bcachefs: Fix counting iterators for reflink pointers Signed-off-by: Kent Overstreet commit 64bc00115335450c4178fea04c5b664cf73a9729 Author: Kent Overstreet Date: Thu Sep 26 22:21:39 2019 -0400 bcachefs: Rework btree iterator lifetimes The btree_trans struct needs to memoize/cache btree iterators, so that on transaction restart we don't have to completely redo btree lookups, and so that we can do them all at once in the correct order when the transaction had to restart to avoid a deadlock. This switches the btree iterator lookups to work based on iterator position, instead of trying to match them up based on the stack trace. Signed-off-by: Kent Overstreet commit a7199432c3cbcd42141cfd5c047bf8828c2390d8 Author: Kent Overstreet Date: Sun Sep 22 18:49:16 2019 -0400 bcachefs: Kill deferred btree updates Will be replaced by cached btree iterators Signed-off-by: Kent Overstreet commit 877dfb348d90abc3d7464ee37240f21d9bdff630 Author: Kent Overstreet Date: Thu Sep 26 19:09:08 2019 -0400 bcachefs: Fix for partial buffered writes Signed-off-by: Kent Overstreet commit bbd8d2038b129437a6744190d8ca00c2597ee8fc Author: Kent Overstreet Date: Sun Sep 22 19:35:12 2019 -0400 bcachefs: BTREE_ITER_SLOTS isn't a type of btree iter Signed-off-by: Kent Overstreet commit ef9f95ba41b7685fc27ca73753bbfa4467555b79 Author: Kent Overstreet Date: Wed Sep 25 15:57:56 2019 -0400 bcachefs: Improve error handling for for_each_btree_key_continue() Change it to match for_each_btree_key() Signed-off-by: Kent Overstreet commit b43a0f60a61e8e0adea6b1b9adc9a97600fc2f00 Author: Kent Overstreet Date: Wed Sep 25 16:19:52 2019 -0400 bcachefs: Cleanup i_nlink handling Signed-off-by: Kent Overstreet commit d55460bb099592ccec816afb5e662896ec5fffaa Author: Kent Overstreet Date: Wed Sep 25 15:26:14 2019 -0400 bcachefs: Trivial cleanup Signed-off-by: Kent Overstreet commit fb472ac52811e8a50e035807b94e1c29ec1f3395 Author: Kent Overstreet Date: Tue Sep 24 13:33:11 2019 -0400 bcachefs: Convert a BUG_ON() to a warning We shouldn't ever be writing past i_size - but, apparently there's still a bug to track down. Signed-off-by: Kent Overstreet commit fe9cdf61cc7cb791c40d076503d8910fc0727310 Author: Kent Overstreet Date: Sun Sep 22 17:48:25 2019 -0400 bcachefs: Count iterators for reflink_p overwrites correctly In order to avoid trying to allocate too many btree iterators, bch2_extent_atomic_end() needs to count how many iterators are going to be needed for insertions and overwrites - but we weren't counting the iterators for deleting a reflink_v when the refcount goes to 0. Signed-off-by: Kent Overstreet commit fb975d14b7737c4381e539677b2e2b99ca9f8d62 Author: Kent Overstreet Date: Sat Sep 21 16:30:15 2019 -0400 bcachefs: Drop unnecessary rcu_read_lock() Signed-off-by: Kent Overstreet commit fdfab313b65080bc938b79998e61af7399e2ba58 Author: Kent Overstreet Date: Sat Sep 21 15:29:34 2019 -0400 bcachefs: Update path microoptimizations Signed-off-by: Kent Overstreet commit 0a426c323927d647f6c31d063ee2f1abbe53db80 Author: Kent Overstreet Date: Sun Sep 22 15:02:05 2019 -0400 bcachefs: Handle bio_iov_iter_get_pages() returning unaligned bio If the user buffer isn't aligned to the filesystem block size, on a large enough IO - where it won't fit into a single bio - bio_iov_iter_get_pages() won't necessarily return a bio with the proper alignment. Signed-off-by: Kent Overstreet commit ec350b90d73b7b8ead9f377c58efe04b12f6ba6e Author: Kent Overstreet Date: Fri Sep 20 16:17:46 2019 -0400 bcachefs: Drop unused arg to bch2_open_buckets_stop_dev() Signed-off-by: Kent Overstreet commit eab32c8e4e8a3addcea0884acdb5bbe4cdb66c5a Author: Kent Overstreet Date: Fri Sep 20 14:28:35 2019 -0400 bcachefs: Fix validation of replicas entries When an extent is erasure coded, we need to record a replicas entry to indicate that data is present on the devices that extent has pointers to - but nr_required should be 0, because it's erasure coded. Signed-off-by: Kent Overstreet commit 5f786787adf57c7597925a9df9897238cb3bc60e Author: Kent Overstreet Date: Sat Sep 7 18:04:23 2019 -0400 bcachefs: Add support for FALLOC_FL_INSERT_RANGE Somewhat tricky and ugly, because iterating over extents backwards is a pain. Signed-off-by: Kent Overstreet commit ccf5a1095892633bdb4bd1ac6f7f60aa9c4f327b Author: Kent Overstreet Date: Sat Sep 7 17:17:21 2019 -0400 bcachefs: bch2_btree_iter_peek_prev() Last of the basic operations for iterating forwards and backwards over the btree: we now have - peek(), returns key >= iter->pos - next(), returns key > iter->pos - peek_prev(), returns key <= iter->pos - prev(), returns key < iter->pos Signed-off-by: Kent Overstreet commit 6cc3535dcbb8bca4df496b9beac8f4c664958fce Author: Kent Overstreet Date: Thu Sep 19 18:05:04 2019 -0400 bcachefs: Don't write past eof When converting from PAGE_SIZE to block_size, the .mkwrite path was missed Signed-off-by: Kent Overstreet commit 9c37b63207e4257cf5a14a412c6b586ae47680be Author: Kent Overstreet Date: Thu Sep 19 16:20:38 2019 -0400 bcachefs: Check for extents past eof correctly bcachefs used to work mostly in terms of PAGE_SIZE, not block size at the vfs level - but that has since been fixed. Signed-off-by: Kent Overstreet commit 059e4134d26a3ada46dc29a849c8cfa5e0b7fd42 Author: Kent Overstreet Date: Thu Sep 19 16:07:41 2019 -0400 bcachefs: Debug assertion improvements Call bch2_btree_iter_verify from bch2_btree_node_iter_fix(); also verify in btree_iter_peek_uptodate() that iter->k matches what's in the btree. Signed-off-by: Kent Overstreet commit 554d219ebb3420d21b395e1ca018ed74524b5480 Author: Kent Overstreet Date: Thu Sep 19 16:01:32 2019 -0400 bcachefs: Add missing bch2_btree_node_iter_fix() call Any time we're modifying what's in the btree, iterators potentially have to be updated - this one was exposed by the reflink code. Signed-off-by: Kent Overstreet commit 4d13e818f5c00ae064aefba8349383cc2d79bf6d Author: Kent Overstreet Date: Wed Sep 18 19:33:12 2019 -0400 bcachefs: Avoid deadlocking on the allocator The allocator needs to make sure there's buckets available on the RESERVE_NONE freelist if at all possible - otherwise foreground IO will get stuck. Signed-off-by: Kent Overstreet commit f4b613410ccf9e3129d1466c23b28c23a77dd69a Author: Kent Overstreet Date: Sat Sep 7 19:19:57 2019 -0400 bcachefs: More btree iter improvements Signed-off-by: Kent Overstreet commit 3745efd618b24d15443f9d1bf75744bea9c3a73f Author: Kent Overstreet Date: Fri Sep 13 14:50:02 2019 -0400 bcachefs: Improve btree_iter_pos_in_node() Signed-off-by: Kent Overstreet commit a9d1f9101832fa1f495ab4b5b083d60eef55bd55 Author: Kent Overstreet Date: Sat Sep 14 10:47:14 2019 -0400 bcachefs: Debug code improvements .key_debugcheck no longer needs to take a pointer to the btree node Also, try to make sure wherever we're inserting or modifying keys in the btree. Signed-off-by: Kent Overstreet commit 4cac0bf2c25d9056c4cc24c27948774fa2591c5a Author: Kent Overstreet Date: Sat Sep 14 10:45:46 2019 -0400 bcachefs: Add missing bch2_btree_node_iter_fix() calls With multiple iterators, if another iterator points to the key being modified, we need to call bch2_btree_node_iter_fix() to re-unpack the key into the iter->k Signed-off-by: Kent Overstreet commit 9b02d1c49a261d711b8d9587afa55cdf3cad97f9 Author: Kent Overstreet Date: Sun Sep 8 14:00:12 2019 -0400 bcachefs: Optimize calls to bch2_btree_iter_traverse() Signed-off-by: Kent Overstreet commit 5a8a52d6107328d49b1fb9850ed53607cf41e583 Author: Kent Overstreet Date: Fri Sep 13 14:43:34 2019 -0400 bcachefs: Fix a typo _iter, not iter Signed-off-by: Kent Overstreet commit 63095894686cb4e16ad6a8329e95681cee63d615 Author: Kent Overstreet Date: Mon Jul 22 13:37:02 2019 -0400 bcachefs: Improved bch2_fcollapse() Move extents instead of copying them - this way, we can iterate over only live extents, not the entire keyspace. Also, this means we can mostly skip running triggers. Signed-off-by: Kent Overstreet commit c0fc30dad5820b9e7d27355ec8a507f61d27a299 Author: Kent Overstreet Date: Sat Sep 7 19:17:40 2019 -0400 bcachefs: __bch2_btree_node_iter_fix() improvements Being more rigorous about noting when the key the iterator currently poins to has changed - which should also give us a nice performance improvement due to not having to check if we have to skip other bsets backwards as much. Signed-off-by: Kent Overstreet commit 36e9d69854752bdad5c5b63f72e6c4901512c9a2 Author: Kent Overstreet Date: Sat Sep 7 14:16:00 2019 -0400 bcachefs: Do updates in order they were queued up in Signed-off-by: Kent Overstreet commit f9c5519336731174cc79ef23543909f9f4e11f64 Author: Kent Overstreet Date: Sat Sep 7 18:03:56 2019 -0400 bcachefs: Drop trans arg to bch2_extent_atomic_end() Just for consistency Signed-off-by: Kent Overstreet commit 8d84260ec1b11c20a7f01797b34fcbc12b33fd70 Author: Kent Overstreet Date: Sat Sep 7 16:13:20 2019 -0400 bcachefs: data move path should not be trying to move reflink_p keys This was spotted when the move_extent() path tried to allocate a bio for a reflink_p extent, but adding pages to the bio failed because we overflowed bi_max_vecs. Oops. Signed-off-by: Kent Overstreet commit b50dd7920d1cd7b37016929faa175578de12dd27 Author: Kent Overstreet Date: Sat Sep 7 13:16:41 2019 -0400 bcachefs: Fix a null ptr deref rbio->c wasn't being initialized in the move path Signed-off-by: Kent Overstreet commit 89b0511826c1bde65f57a2e051ee9fcb274bff69 Author: Kent Overstreet Date: Sat Sep 7 12:42:27 2019 -0400 bcachefs: Flush fsck errors when looping in btree gc Signed-off-by: Kent Overstreet commit 5055b50939843c027e1cf4602316035d9f21f032 Author: Kent Overstreet Date: Sat Sep 7 12:39:59 2019 -0400 bcachefs: Rebalance now adds replicas if needed Signed-off-by: Kent Overstreet commit 4430ea7046fcb2112c5888705a6a674d53d9db03 Author: Kent Overstreet Date: Thu Sep 5 13:37:50 2019 -0400 bcachefs: Kill BTREE_INSERT_NOMARK_INSERT Was dead code Signed-off-by: Kent Overstreet commit 78854fca28e4e789c99a812acda2ac04c20d2dac Author: Kent Overstreet Date: Thu Aug 29 13:29:31 2019 -0400 bcachefs: Fix BTREE_INSERT_NOMARK_OVERWRITES bch2_mark_update() was correct, but bch2_trans_mark_update() wasn't respecting BTREE_INSERT_NOMARK_OVERWRITES - key marking/triggers really need to be cleaned up. Signed-off-by: Kent Overstreet commit 06ab329c150f9eebc68cdb156a9591084b16ec55 Author: Kent Overstreet Date: Thu Aug 29 11:34:01 2019 -0400 bcachefs: Improve pointer marking checks and error messages Importantly, we don't want to use bch2_fs_inconsistent_on() for errors that fsck can repair, becuase that will just put us in RO mode and prevent fsck from actually fixing stuff. Probably want to get rid of it in the future. Signed-off-by: Kent Overstreet commit ad7e137ebc3dcadbaa37d2f464728c915e039e1d Author: Kent Overstreet Date: Wed Aug 28 13:20:31 2019 -0400 bcachefs: Switch reconstruct_alloc to a mount option Right now this is the only way of repairing bucket gens in the future Signed-off-by: Kent Overstreet commit 05cf02b5a10ae9b60aad4b1fe4049eb4e7603b4f Author: Kent Overstreet Date: Wed Aug 28 12:41:45 2019 -0400 bcachefs: Fix fiemap (again) when iterating over reflink pointers, we use the key we just emitted to set the iterator position - which means we have to be setting the key's inode field as well Signed-off-by: Kent Overstreet commit 9940a791ea24876d09116ac503045fb3390aebd2 Author: Kent Overstreet Date: Wed Aug 28 12:11:39 2019 -0400 bcachefs: Fix error message on bucket overflow Signed-off-by: Kent Overstreet commit 06f6c3ec0b5368ddd83a8314cf89ee221ec47263 Author: Kent Overstreet Date: Wed Aug 28 12:05:17 2019 -0400 bcachefs: Reflink pointers also have to be remarked if split in journal replay Signed-off-by: Kent Overstreet commit df5d4dae0b667f93616d6e47da09ad916dcb7102 Author: Kent Overstreet Date: Thu Aug 22 13:20:38 2019 -0400 bcachefs: Fixes for replicas tracking The continue statement in bch2_trans_mark_extent() was wrong - by bailing out early, we'd be constructing the wrong replicas list to update. Also, the assertion in update_replicas() was wrong - due to rounding with compressed extents, it is possible for sectors to be 0 sometimes. Also, change extent_to_replicas() in replicas.c to match the replicas list we construct in buckets.c. Signed-off-by: Kent Overstreet commit 6671a7089fdcdd8f25f6b4729fdc066f7c42edfd Author: Kent Overstreet Date: Tue Aug 27 17:45:42 2019 -0400 bcachefs: Refactor bch2_alloc_write() Major simplification - gets rid of the need for marking buckets as dirty, instead we write buckets if the in memory mark is different from what's in the btree. Signed-off-by: Kent Overstreet commit 67163cded330c1d952ae440b21752f4b609585fd Author: Kent Overstreet Date: Tue Aug 27 17:34:03 2019 -0400 bcachefs: Trust in memory bucket mark This fixes a bug in the journal replay -> extent_replay_key -> split_compressed path, when we do an update that changes alloc info but the alloc info in the btree isn't up to date yet. Signed-off-by: Kent Overstreet commit 7d5224fcdc057a42fcd2d19bbc4d9f1c4808a83b Author: Kent Overstreet Date: Thu Aug 22 16:12:28 2019 -0400 bcachefs: Optimize fiemap Reflink caused fiemap performance to regress badly - this gets us back to where we were. Signed-off-by: Kent Overstreet commit 4e1510c3e9a053edc1fdfe56fc96009919ceebd8 Author: Kent Overstreet Date: Thu Aug 22 17:09:16 2019 -0400 bcachefs: Add a hint for allocating new stripes This way we aren't doing a full linear scan every time we create a new stripe. Signed-off-by: Kent Overstreet commit 3fb5ebcdd4b0599ba8d20a322d322f3a1aaea381 Author: Kent Overstreet Date: Thu Aug 22 16:07:37 2019 -0400 bcachefs: Inline some fast paths Signed-off-by: Kent Overstreet commit 416f6852523d8599713b756b2d2027d2e9f90b3f Author: Kent Overstreet Date: Thu Aug 22 16:30:55 2019 -0400 bcachefs: Don't flush journal from bch2_vfs_write_inode() It's only updating timestamps, so this doubly doesn't make sense. fsync will flush the journal, if necessary. Signed-off-by: Kent Overstreet commit d9b022fee69e7f1eea45317c882c65582481a263 Author: Kent Overstreet Date: Thu Aug 22 16:34:59 2019 -0400 bcachefs: Fix a spurious gcc warning *i is used as an output parameter, but gcc isn't noticing that. Oh well. Signed-off-by: Kent Overstreet commit 16e671037a4ca9d695134151d9bc58069d24b094 Author: Kent Overstreet Date: Thu Aug 22 16:41:50 2019 -0400 bcachefs: Handle ec_buf not being page aligned when allocating bio Signed-off-by: Kent Overstreet commit 21629f536808c7a0e7791a2711944b03d820749f Author: Kent Overstreet Date: Thu Aug 22 16:23:10 2019 -0400 bcachefs: Update more code for KEY_TYPE_reflink_v Signed-off-by: Kent Overstreet commit e14f4ab4fee5377f65e7d3bad646c1418782ead0 Author: Kent Overstreet Date: Thu Aug 22 11:17:04 2019 -0400 bcachefs: Re-enable bkey_debugcheck() in the extent update path Also, move other update path checks to where they actually check all the updates (after triggers have run) Signed-off-by: Kent Overstreet commit 4b0a66d508d7bfcd2dd2513d4f41a0f3a20f64d5 Author: Kent Overstreet Date: Wed Aug 21 20:16:42 2019 -0400 bcachefs: Check alignment in write path Also - fix alignment in bch2_set_page_dirty() Signed-off-by: Kent Overstreet commit 41fcd6215093b0c40fb4072e04a2b34f09eb4235 Author: Kent Overstreet Date: Wed Aug 21 23:52:10 2019 -0400 bcachefs: Fix faulty assertion Signed-off-by: Kent Overstreet commit f698a957979bfff266a65a2080a224cca7ccc962 Author: Kent Overstreet Date: Wed Aug 21 18:55:07 2019 -0400 bcachefs: Fix bch2_bkey_narrow_crcs() We have to reinitialize ptrs whenever we do something that changes them. Regression from when the code was converted to be generic across all keys with pointers. Signed-off-by: Kent Overstreet commit e42951b0aa50bb67b29da1af1099013c1aeb1d9d Author: Kent Overstreet Date: Wed Aug 21 18:35:15 2019 -0400 bcachefs: Fix bch2_sort_repack_merge() bch2_bkey_normalize() modifies the value, and we were modifying the original value in the src btree node - but, we're called without a write lock held on the src node. Oops... Signed-off-by: Kent Overstreet commit 76426098e419c1732efc3f88166f3f3592c215c9 Author: Kent Overstreet Date: Fri Aug 16 09:59:56 2019 -0400 bcachefs: Reflink Signed-off-by: Kent Overstreet commit 3c7f3b7aeb73f2155aec9d00567b70ef55ede465 Author: Kent Overstreet Date: Fri Aug 16 09:58:07 2019 -0400 bcachefs: Refactor bch2_extent_trim_atomic() for reflink Signed-off-by: Kent Overstreet commit 63069bb6bf03ac7a55c53886a1380899df3a176d Author: Kent Overstreet Date: Tue Aug 20 17:46:22 2019 -0400 bcachefs: Move node iterator fixup to extent_bset_insert() Signed-off-by: Kent Overstreet commit 23bbd2bb8f2cbe2679b404f730cbfd6bf42bd878 Author: Kent Overstreet Date: Tue Aug 20 17:43:47 2019 -0400 bcachefs: Fix bch2_btree_node_iter_fix() bch2_btree_node_iter_prev_all() depends on an invariant that wasn't being maintained for extent leaf nodes - specifically, the node iterator may not have advanced past any keys that compare after the key the node iterator points to. Signed-off-by: Kent Overstreet commit e67ab0450cca7dc1673e4cd00eecf9d896b15889 Author: Kent Overstreet Date: Mon Aug 19 13:43:01 2019 -0400 bcachefs: Fix bch2_btree_node_iter_prev_filter() bch2_btree_node_iter_prev_filter() tried to be smart about iterating backwards when skipping over whiteouts/discards - but unfortunately, doing so can leave the node iterator in an inconsistent state; the sane solution is to just always iterate backwards one key at a time. But we compact btree nodes when more than a quarter of the keys are whiteouts/discards, so the optimization wasn't buying us that much anyways. Signed-off-by: Kent Overstreet commit 9df279407a2daaf8e6586be483632fe9aaca6ef3 Author: Kent Overstreet Date: Sat Aug 17 15:54:48 2019 -0400 bcachefs: Fix __bch2_btree_iter_peek_slot_extents() Signed-off-by: Kent Overstreet commit 63f1a59847522b5218d1116c12afd9c9ce6c6645 Author: Kent Overstreet Date: Sat Aug 17 15:17:09 2019 -0400 bcachefs: Improved debug checks Signed-off-by: Kent Overstreet commit 2cbe5cfe2719c7ffe7a7dd90565be26f7a2adcbb Author: Kent Overstreet Date: Fri Aug 9 13:01:10 2019 -0400 bcachefs: Rework calling convention for marking overwrites Signed-off-by: Kent Overstreet commit b3fce09cd33271d8dcdd3b18527d106558e30728 Author: Kent Overstreet Date: Tue Aug 13 03:16:52 2019 -0400 bcachefs: Mark space as unallocated on write failure Signed-off-by: Kent Overstreet commit 1904a65a315d78e6357aed36d3e7e9a5c2563370 Author: Kent Overstreet Date: Mon Aug 12 14:35:34 2019 -0400 bcachefs: Ensure bch2_trans_get_iter() returns iters with correct locks Signed-off-by: Kent Overstreet commit c8b18c37b2e52a3743be9d235c7f6136fa7940b9 Author: Kent Overstreet Date: Fri Aug 9 17:12:37 2019 -0400 bcachefs: fix for_each_btree_key() Signed-off-by: Kent Overstreet commit e3d3a9d91a850445e33037d8fabd3930fd9aa208 Author: Kent Overstreet Date: Wed Aug 7 12:07:13 2019 -0400 bcachefs: trans_get_key() now works correctly for extents More prep work for reflink: for extents, we're not looking for an exact mach on pos, rather that the pos is within the range of the key the iterator points to. Signed-off-by: Kent Overstreet commit 5b6d40e2b670efc2feff4da9dd065053f5be31a7 Author: Kent Overstreet Date: Sat Jun 29 17:59:21 2019 -0400 bcachefs: Export correct blocksize to vfs Signed-off-by: Kent Overstreet commit a99b1caf473461d9269b693286533cc1b7c50d46 Author: Kent Overstreet Date: Tue Aug 6 11:19:58 2019 -0400 bcachefs: Truncate/fpunch now works on block boundaries, not page Signed-off-by: Kent Overstreet commit 2ba5d38b50964bc25075318a2a6fb4a886d492b6 Author: Kent Overstreet Date: Tue Jul 30 14:18:29 2019 -0400 bcachefs: Count reserved extents as holes Signed-off-by: Kent Overstreet commit 543ef2ebcd90686d999f18b0a874690b7976b239 Author: Kent Overstreet Date: Tue Jul 30 13:49:17 2019 -0400 bcachefs: Handle partial pages in seek data/hole Signed-off-by: Kent Overstreet commit d1542e0362de069f677dfb0e9336438afb8fae74 Author: Kent Overstreet Date: Mon Jul 29 13:38:38 2019 -0400 bcachefs: Change buffered write path to write to partial pages Signed-off-by: Kent Overstreet commit 7f5e31e1a4c8821b346c9b2cc108ffbdd87778a7 Author: Kent Overstreet Date: Mon Jul 29 12:24:36 2019 -0400 bcachefs: Change __bch2_writepage() to not write to holes Signed-off-by: Kent Overstreet commit e10d309471c54dbcb0dfc2c780672c07d4805495 Author: Kent Overstreet Date: Tue Jul 30 12:46:53 2019 -0400 bcachefs: Fix bch2_seek_data() Signed-off-by: Kent Overstreet commit 99aaf57000b4091d2471ed30387d96e15f2fc38b Author: Kent Overstreet Date: Thu Jul 25 13:52:14 2019 -0400 bcachefs: Refactor various code to not be extent specific With reflink, various code now has to handle both KEY_TYPE_extent or KEY_TYPE_reflink_v - so, convert it to be generic across all keys with pointers. Signed-off-by: Kent Overstreet commit b1c9358a25eb0ed94c5bfc18ba5f9b00d51d8863 Author: Kent Overstreet Date: Thu Jul 18 17:21:21 2019 -0400 bcachefs: Refactor __bch2_cut_front() Minor cleanup - prep work for new key types for reflink Signed-off-by: Kent Overstreet commit b17657d0cf321af98fcb9d52748ca4d201284702 Author: Kent Overstreet Date: Thu Jul 18 17:11:35 2019 -0400 bcachefs: Dont't call bch2_trans_begin_updates() in bch2_extent_update() Prep work for reflink - for reflink, we're going to be using bch2_extent_update() with other updates in the same transaction. Signed-off-by: Kent Overstreet commit 8627f674bc98d6eeb91f885ca1259d29a0e7aa34 Author: Kent Overstreet Date: Thu Jul 18 17:32:20 2019 -0400 bcachefs: Don't unlink iters on unsuccessful commit Where unlink_on_commit is used, on unsuccessfull commit we're likely retrying the whole update and were going to be using the same iterators again. The management of multiple iterators needs to be gone over a fair bit more at some point... Signed-off-by: Kent Overstreet commit a9058a223fd2168d96195df3b918e395be8869e3 Author: Kent Overstreet Date: Tue Jul 23 18:56:28 2019 -0400 bcachefs: add missing bch2_trans_begin() call for_each_btree_key() calls bch2_trans_get_iter() - we have to reset the transaction state before getting the iterator again, in the retry path Signed-off-by: Kent Overstreet commit 06ed855862853dcdd365a12f7cf182961bec61de Author: Kent Overstreet Date: Tue Jul 9 12:56:43 2019 -0400 bcachefs: Add offset_into_extent param to bch2_read_extent() With reflink, we'll no longer be able to calculate the offset of the data we want into the extent we're reading from from the extent pos and the iter pos - we'll have to pass it in separately. Signed-off-by: Kent Overstreet commit a4461c8a7fc33aa663b0b1b2b7144d5890b6887f Author: Kent Overstreet Date: Tue Jul 16 12:23:04 2019 -0400 bcachefs: Print out name of bkey type Signed-off-by: Kent Overstreet commit 0c04f5eb0d49c92e5223dd98bb8e2577b9ce6f49 Author: Kent Overstreet Date: Tue Jul 16 12:06:34 2019 -0400 bcachefs: Don't overflow trans with iters from triggers Signed-off-by: Kent Overstreet commit 8d591d5da42d10de6dda7c87e5f4b1447f67bb86 Author: Kent Overstreet Date: Sat Jul 13 12:59:02 2019 -0400 bcachefs: Convert some assertions to fsck errors Actual repair code will come later, but this is a start Signed-off-by: Kent Overstreet commit e222d206f298dc2c689d8f8787c929451d4f909b Author: Kent Overstreet Date: Fri Jul 12 17:08:32 2019 -0400 bcachefs: Fix ec_stripes_read() Change it to not mark keys that will be overwritten by keys in the journal - this fixes a bug where we pop an assertion in bucket_set_stripe() because of a stale pointer - because the stripe that has the stale pointer has been deleted. This code could be factored out and used elsewhere, at some point. Signed-off-by: Kent Overstreet commit f516c87272c98186f12768e9589664ce7a910bf4 Author: Kent Overstreet Date: Thu Jul 11 12:45:59 2019 -0400 bcachefs: Fix stripe_idx_to_delete() There was a null ptr deref when there wasn't a stripes heap allocated Signed-off-by: Kent Overstreet commit 97fd13ad769c24260ce0e05f05a51df132b980bd Author: Kent Overstreet Date: Wed Jul 10 16:04:58 2019 -0400 bcachefs: Don't try to delete stripes when RO We weren't checking for errors when trying to delet stripes, which meant ec_stripe_delete_work() would spin trying to delete the same stripe over and over. Signed-off-by: Kent Overstreet commit f57a6a5d41d66c527f8683b5cc6a069fe59e1fdf Author: Kent Overstreet Date: Tue Jul 2 21:41:35 2019 -0400 bcachefs: Track dirtyness at sector level, not page Signed-off-by: Kent Overstreet commit adfcfaf0686a7b96416e6074127dc8580af28154 Author: Kent Overstreet Date: Tue Jul 2 17:25:05 2019 -0400 bcachefs: Kill page_state_cmpxchg Signed-off-by: Kent Overstreet commit e1036a2a718f2cbd082568c881f677cf5fd9f442 Author: Kent Overstreet Date: Tue Jul 2 14:59:15 2019 -0400 bcachefs: Always touch page state with page locked This will mean we don't have to use cmpxchg for modifying page state, which will simplify a fair amount of code Signed-off-by: Kent Overstreet commit a6f4d5bb249cf6ac44d1a83c72584402b7e5f6ed Author: Kent Overstreet Date: Tue Jul 9 11:16:33 2019 -0400 bcachefs: Fix moving compressed data bio_uncompress_inplace() used to potentially need to extend the bio to be big enough for the uncompressed data, which has become problematic with multipage bvecs - but, the move extent path actually already allocated the bios to be big enough for the uncompressed data. The promote path needed to be fixed, though. Signed-off-by: Kent Overstreet commit 0fd7263e2e55d43317e85e9f7a4e67de9fa0ec90 Author: Kent Overstreet Date: Thu Jul 4 03:48:25 2019 -0400 bcachefs: kill bio_for_each_contig_segment() With multipage bvecs it's not needed anymore Signed-off-by: Kent Overstreet commit 885678f68dd1bf9638087ae8b22051b464f5ec05 Author: Kent Overstreet Date: Wed Jul 3 19:27:42 2019 -0400 bcachefs: Kill direct access to bi_io_vec Switch to always using bio_add_page(), which merges contiguous pages now that we have multipage bvecs. Signed-off-by: Kent Overstreet commit 738540f7fcdd619fe3adb8a27116f0f4371bf711 Author: Kent Overstreet Date: Wed Jul 3 19:36:39 2019 -0400 bcachefs: kill bch2_crc64_update Signed-off-by: Kent Overstreet commit d74dfe02881bdf8df99a320857f38540315989cd Author: Kent Overstreet Date: Tue Jul 2 14:12:48 2019 -0400 bcachefs: Fix for building with old gcc Signed-off-by: Kent Overstreet commit 168f4c5fb375131bd0f5996b549c5e13cc2c2bb5 Author: Kent Overstreet Date: Mon Jun 24 18:24:38 2019 -0400 bcachefs: Improve bch2_lock_inodes() Can now be used for the two different types of locks we have so far Signed-off-by: Kent Overstreet commit e812cf38c558f4d3a6bef8a077478a6632811f0b Author: Kent Overstreet Date: Sat Jun 29 18:03:40 2019 -0400 bcachefs: Check for key size > offset Signed-off-by: Kent Overstreet commit 91052b9de806c4dd1ac0447ba7928e49b107eec7 Author: Kent Overstreet Date: Mon Jun 24 17:58:40 2019 -0400 bcachefs: Refactor trans_(get|update)_key these are still pretty ugly... Signed-off-by: Kent Overstreet commit 88767d65d84257f9b5dfed1aa89404f1b6ddf142 Author: Kent Overstreet Date: Mon Jun 24 17:50:52 2019 -0400 bcachefs: Update path now handles triggers that generate more triggers Signed-off-by: Kent Overstreet commit 44da9767bb32467ac660ce6bacf75162f5abf9a1 Author: Kent Overstreet Date: Mon Jun 24 17:55:15 2019 -0400 bcachefs: add inode_generation_to_text method Signed-off-by: Kent Overstreet commit 2ded276b7e20084842225b47100f3391e00f540f Author: Kent Overstreet Date: Mon Jun 24 18:11:35 2019 -0400 bcachefs: Fix array overrun with unknown btree roots Signed-off-by: Kent Overstreet commit f707e3d8f41e77aff94941168ab30da2314a5984 Author: Kent Overstreet Date: Tue Jun 18 19:37:39 2019 -0400 bcachefs: fix kasan splat Signed-off-by: Kent Overstreet commit 09bf409b4689d0297da2cc5c95106ef89fa7cfb7 Author: Kent Overstreet Date: Thu Jun 27 11:37:46 2019 -0400 bcachefs: Delete a spurious assertion bch_write_op->written used to be a u16, but it's not so the assertion isn't needed anymore - and 5.1 can send larger bios. Signed-off-by: Kent Overstreet commit 2a488aaac1d4a7f5b48bce687adf430d24e0beb5 Author: Kent Overstreet Date: Thu Jun 13 11:01:14 2019 -0400 bcachefs: fix __bch2_xattr_bcachefs_get() We were returning -ERANGE when the size of the buffer passed in was exactly the size of the xattr val Signed-off-by: Kent Overstreet commit e0dfc08bc2f509de9fda0371b46988247f711a12 Author: Kent Overstreet Date: Tue Jun 11 21:03:23 2019 -0400 bcachefs: use memalloc_nofs_save() for vmalloc allocation Signed-off-by: Kent Overstreet commit 3e669816904d45d48ef2183a2ad675c24d9c941a Author: Kent Overstreet Date: Mon Jun 10 11:31:07 2019 -0400 bcachefs: Fix promoting to cache devices (durability = 0) Signed-off-by: Kent Overstreet commit 66b095b008ea6526c660fbecfacbd970416f971e Author: Kent Overstreet Date: Sun Jun 9 20:32:54 2019 -0400 bcachefs: Don't allow bkey vals that are too big in extents btree Make sure we don't overflow BKEY_PADDED keys Signed-off-by: Kent Overstreet commit 9146b8ee03fb8a716e6a88d68b8e9074594966bb Author: Kent Overstreet Date: Sun Jun 9 16:56:29 2019 -0400 bcachefs: Reduce BKEY_PADDED usage Signed-off-by: Kent Overstreet commit 436c656d468fe04cd8e313a4a55151aa946de102 Author: Kent Overstreet Date: Sun Jun 9 16:56:16 2019 -0400 bcachefs: bkey_merge() now takes bkey_s Signed-off-by: Kent Overstreet commit 1ae973345626fcd9cdb81fe856cabf7808a33140 Author: Kent Overstreet Date: Wed May 29 20:06:06 2019 -0400 bcachefs: Don't overflow stack in bch2_extent_merge_inline() Signed-off-by: Kent Overstreet commit 5884fddfe732183aa2be4d11444543dfae6e044b Author: Kent Overstreet Date: Fri May 24 14:45:33 2019 -0400 bcachefs: Fix starting copygc when already started We can sometimes call bch2_dev_read_write() when the device is already RW (in error paths). Signed-off-by: Kent Overstreet commit 37dd783474d07f8aa210ecf5cc82fd900417eb8b Author: Kent Overstreet Date: Fri May 24 14:33:16 2019 -0400 bcachefs: Fix an error path in bch2_btree_iter_traverse() Signed-off-by: Kent Overstreet commit 6e738539cd8fedb3657b97feec07bebffe20d8b0 Author: Kent Overstreet Date: Fri May 24 11:56:20 2019 -0400 bcachefs: Improve key marking interface Signed-off-by: Kent Overstreet commit 572ad769f59519fad80ed7241c44d7330bc379b4 Author: Kent Overstreet Date: Fri May 24 11:56:01 2019 -0400 bcachefs: Fix cached sectors not being updated on invalidate Signed-off-by: Kent Overstreet commit 4ee202e2b70fc8f6a7abd8fc3b3a8024c437fe24 Author: Kent Overstreet Date: Tue May 21 15:49:56 2019 -0400 bcachefs: better BTREE_INSERT_NO_CLEAR_REPLICAS Signed-off-by: Kent Overstreet commit cdeeb75ea9e329b6e02e7956f741de7c9ddfbb3b Author: Kent Overstreet Date: Tue May 21 13:42:02 2019 -0400 bcachefs: fix a mount error path Signed-off-by: Kent Overstreet commit a62c78a794c2cf6ed08a1a7b25887a1935e87835 Author: Kent Overstreet Date: Tue May 21 10:14:54 2019 -0400 bcachefs: fix bch2_extent_merge() Signed-off-by: Kent Overstreet commit 3838be78410cfe52a067b8e88dfcff922084e627 Author: Kent Overstreet Date: Wed May 15 15:47:43 2019 -0400 bcachefs: Don't use a fixed size buffer for fs_usage_deltas Signed-off-by: Kent Overstreet commit 61011ea237852ef7d29b7d6b3608a6538560fc76 Author: Kent Overstreet Date: Wed May 15 12:37:11 2019 -0400 bcachefs: Rip out old hacky transaction restart tracing Signed-off-by: Kent Overstreet commit 20bceecb3159bbe06a26fc6747457d9de02ec227 Author: Kent Overstreet Date: Wed May 15 10:54:43 2019 -0400 bcachefs: More work to avoid transaction restarts Signed-off-by: Kent Overstreet commit 7d825866604b34ba02b4c286c6fd6d232fd06cd0 Author: Kent Overstreet Date: Wed May 15 10:08:55 2019 -0400 bcachefs: Avoid spurious transaction restarts Signed-off-by: Kent Overstreet commit 0e6dd8fba04499c1f1a20dab2d463b12b03b2770 Author: Kent Overstreet Date: Wed May 15 09:53:27 2019 -0400 bcachefs: Ensure bch2_btree_iter_next() always advances Signed-off-by: Kent Overstreet commit 87c3beb4a589312f2c150129309a48b5518385e7 Author: Kent Overstreet Date: Wed May 15 09:49:46 2019 -0400 bcachefs: Fix a bug with spinning on the journal Transactional triggers meant that when we failed to get a journal reservation, then bailed out into the error path to block on a journal reservation, the second blocking call into the journal code was asking for less space, which is not what we want. Signed-off-by: Kent Overstreet commit 58fbf80834c9fc624a269047a07e94a188350f20 Author: Kent Overstreet Date: Wed May 15 09:47:40 2019 -0400 bcachefs: Delete duplicate code Also rename for consistency Signed-off-by: Kent Overstreet commit 6fb076e60d65e574756cd1a4262c1c05b750ec21 Author: Kent Overstreet Date: Tue May 14 14:37:11 2019 -0400 bcachefs: Fix spurious inconsistency in recovery Signed-off-by: Kent Overstreet commit ed8413fdab6567985995051869ad211fb8f15d5f Author: Kent Overstreet Date: Tue May 14 14:08:23 2019 -0400 bcachefs: improved btree locking tracepoints Signed-off-by: Kent Overstreet commit 17758a6c2367f8613490883d541c767c361194a2 Author: Kent Overstreet Date: Sat May 11 17:36:31 2019 -0400 bcachefs: bch2_btree_delete_at_range() Signed-off-by: Kent Overstreet commit 42c7d748e4983be1b7fdf3ff58920eab92c8833d Author: Kent Overstreet Date: Mon May 13 00:30:02 2019 -0400 bcachefs: stripe creation fixes Signed-off-by: Kent Overstreet commit 6009b4e5086783619172900e4090781491664517 Author: Kent Overstreet Date: Sun May 12 22:23:30 2019 -0400 bcachefs: Merge extents with checksums Signed-off-by: Kent Overstreet commit 60755344c6b18753c93b353f147c2e23b8b18de1 Author: Kent Overstreet Date: Fri May 10 17:15:30 2019 -0400 bcachefs: kill BTREE_ITER_NOUNLOCK Signed-off-by: Kent Overstreet commit b03b81dfd268938c6ed3b0ec79b4983523efb303 Author: Kent Overstreet Date: Fri May 10 17:09:42 2019 -0400 bcachefs: Don't pass around may_drop_locks Signed-off-by: Kent Overstreet commit b7607ce98f286ed3d7181875f4b1f4a02663395c Author: Kent Overstreet Date: Fri May 10 16:09:17 2019 -0400 bcachefs: Kill remaining bch2_btree_iter_unlock() uses Signed-off-by: Kent Overstreet commit 7cfac5f5064331b99928000907e9b4d646cdfc71 Author: Kent Overstreet Date: Wed May 8 17:56:05 2019 -0400 bcachefs: Fix for the stripes mark path and gc Signed-off-by: Kent Overstreet commit ae0ff7b8b0ccf0643ea4d3968faabb2d5ee98c1c Author: Kent Overstreet Date: Tue Apr 30 17:15:39 2019 -0400 bcachefs: Redo replicas gc mechanism Signed-off-by: Kent Overstreet commit 9516950c0690b6a8bef4cc1c7ae269da996973d8 Author: Kent Overstreet Date: Mon Apr 22 17:47:49 2019 -0400 bcachefs: Fix return code from bch2_fs_start() Signed-off-by: Kent Overstreet commit 44e63bcaaaa2100677d1d95c3a0ebe370493f2f9 Author: Kent Overstreet Date: Wed Apr 17 20:16:43 2019 -0400 bcachefs: Don't run fsck by default at mount time Signed-off-by: Kent Overstreet commit 619f5bee86b558e0dad91c3759b90652cd5f55d2 Author: Kent Overstreet Date: Wed Apr 17 18:21:19 2019 -0400 bcachefs: some improvements to startup messages and options Signed-off-by: Kent Overstreet commit 460651ee86b2d2e0cf1a70a15a07031213e27181 Author: Kent Overstreet Date: Wed Apr 17 18:14:46 2019 -0400 bcachefs: Various improvements to bch2_alloc_write() Signed-off-by: Kent Overstreet commit 932aa837453ada12342d89ea5e063993a928d4c8 Author: Kent Overstreet Date: Mon Mar 11 14:59:58 2019 -0400 bcachefs: bch2_trans_mark_update() Signed-off-by: Kent Overstreet commit c43a6ef9a0747ef1094ff14e173513070ed91600 Author: Kent Overstreet Date: Sat Jun 6 12:28:01 2020 -0400 bcachefs: btree_bkey_cached_common This is prep work for the btree key cache: btree iterators will point to either struct btree, or a new struct bkey_cached. Signed-off-by: Kent Overstreet commit 5e82a9a1f4f82e273530b90d107638a5969d1de0 Author: Kent Overstreet Date: Sun Feb 10 19:34:47 2019 -0500 bcachefs: Write out fs usage consistently Signed-off-by: Kent Overstreet commit fca1223ccfac2a461d7d3e29fb09a1b2142bdd7f Author: Kent Overstreet Date: Thu Dec 3 14:17:33 2020 -0500 bcachefs: Avoid write lock on mark_lock mark_lock is a frequently taken lock, and there's also potential for deadlocks since currently bch2_clear_page_bits which is called from memory reclaim has to take it to drop disk reservations. The disk reservation get path takes it when it recalculates the number of sectors known to be available, but it's not really needed for consistency. We just want to make sure we only have one thread updating the sectors_available count, which we can do with a dedicated mutex. Signed-off-by: Kent Overstreet commit 33eb63e5753ad6229d4027340153817b92840760 Author: Kent Overstreet Date: Tue May 14 13:25:25 2019 -0400 bcachefs: Fix a bug with multiple iterators being traversed If upgrade fails on one iterator, but it was copied from another iterator and will be freed before transaction restart, then the original iterator will get traversed first, so we need to make required btree nodes on the original iterator will be traversed too. Signed-off-by: Kent Overstreet commit 1fe93f88c36dcceee9f92055d0a1febbd90338d3 Author: Kent Overstreet Date: Wed May 15 12:24:39 2019 -0400 bcachefs: fix bch2_rbio_narrow_crcs() Signed-off-by: Kent Overstreet commit 1f7d45beb71f460b9ea138788340926c1b3a4c4d Author: Kent Overstreet Date: Fri May 10 11:58:00 2019 -0400 bcachefs: Fix journal shutdown path Signed-off-by: Kent Overstreet commit 75812e70d9341e7a1a55f6f2a0e367186c859623 Author: Kent Overstreet Date: Wed Apr 17 20:34:24 2019 -0400 bcachefs: Fix fsync error reporting Signed-off-by: Kent Overstreet commit 3811aa6d4d3efbcf26dbe47bf73a78b17e8e71a4 Author: Kent Overstreet Date: Sat May 11 17:32:07 2019 -0400 bcachefs: bch2_bkey_ptrs_invalid() Signed-off-by: Kent Overstreet commit ab5c63f5dd3dcdb7943056c6e31ee62325010dc3 Author: Kent Overstreet Date: Sat May 11 17:29:20 2019 -0400 bcachefs: Don't hardcode BTREE_ID_EXTENTS Signed-off-by: Kent Overstreet commit a7451c42926c894956fee3b455619c3e0387219f Author: Kent Overstreet Date: Mon Apr 29 15:16:18 2019 -0400 bcachefs: fix bch2_flags_to_text() Signed-off-by: Kent Overstreet commit ba5c65576b9d46a05ce2c709c88886f11432a204 Author: Kent Overstreet Date: Tue Apr 23 00:10:08 2019 -0400 bcachefs: Add actual tracepoints for transaction restarts Signed-off-by: Kent Overstreet commit 69eb5390afd287e73f781c26526796b45a77f9d1 Author: Kent Overstreet Date: Wed Apr 17 20:10:43 2019 -0400 bcachefs: copy correct journal_seq to dir in create Signed-off-by: Kent Overstreet commit 94f651e2c7e2808e82673b46776f951a67da4a2d Author: Kent Overstreet Date: Wed Apr 17 15:49:28 2019 -0400 bcachefs: Return errors from for_each_btree_key() Signed-off-by: Kent Overstreet commit 201a4d4cbed532c73d83ea9ea8166f40e9faa1e1 Author: Kent Overstreet Date: Wed Apr 17 15:49:45 2019 -0400 bcachefs: fix triggers for stripes btree Signed-off-by: Kent Overstreet commit ea4160234487ac7baefb919747691a21d2face4a Author: Kent Overstreet Date: Tue Apr 16 16:03:31 2019 -0400 bcachefs: use same timesource as current_time() Signed-off-by: Kent Overstreet commit f80b4e64a4d79e78053a0e2ed4607f6af9dd2c89 Author: Kent Overstreet Date: Tue Apr 16 15:13:16 2019 -0400 bcachefs: Fix hang while shutting down If the allocator thread exited before bch2_dev_allocator_stop() was called (because of an error), bch2_dev_allocator_quiesce() could hang. Signed-off-by: Kent Overstreet commit 53beb841623bcdb1fe619efe5f2c34ca3af08c78 Author: Kent Overstreet Date: Tue Apr 16 14:42:05 2019 -0400 bcachefs: lockdep fix when going rw from bch2_alloc_write() Signed-off-by: Kent Overstreet commit c6dd04f8f5644d92361bb2d6e47fa9b4d5af6d79 Author: Kent Overstreet Date: Mon Apr 15 14:58:00 2019 -0400 bcachefs: Mark overwrites from journal replay in initial gc Signed-off-by: Kent Overstreet commit d07343561e263fcbbdb8042f35ca29a602190e18 Author: Kent Overstreet Date: Thu Apr 11 22:39:39 2019 -0400 bcachefs: Deduplicate keys in the journal before replay Signed-off-by: Kent Overstreet commit 644d180b055fa47be7e6ca8b684f45e2350dfafd Author: Kent Overstreet Date: Thu Apr 11 22:39:39 2019 -0400 bcachefs: Journal replay refactoring Signed-off-by: Kent Overstreet commit 3ea2b1e12898154d6fae49b22a3509521ba49d38 Author: Kent Overstreet Date: Fri Apr 12 04:54:12 2019 -0400 bcachefs: cmp_int() Signed-off-by: Kent Overstreet commit a0e0bda117d80b107c137e4c6cd0fb9814bd5214 Author: Kent Overstreet Date: Sat Apr 6 15:12:21 2019 -0400 bcachefs: Pass flags arg to bch2_alloc_write() Signed-off-by: Kent Overstreet commit d1170ce53c5b332caf647f658c6f2a483c3608a7 Author: Kent Overstreet Date: Sat Apr 6 14:32:06 2019 -0400 bcachefs: allocate sb_read_scratch with __get_free_page kmalloc allocations aren't guranteed alignment for io Signed-off-by: Kent Overstreet commit 478259b749d442baaccbe18b02a7352ca1e012ae Author: Kent Overstreet Date: Fri Apr 5 00:20:02 2019 -0400 bcachefs: delete duplicated code Signed-off-by: Kent Overstreet commit 330581f16f3041e7cd4e4d8c3b7a569d663a8035 Author: Kent Overstreet Date: Fri Apr 5 00:18:52 2019 -0400 bcachefs: disallow ever going rw if nochanges or noreplay Signed-off-by: Kent Overstreet commit 4881fdb7566dcc52aaf05f9b8f044a5ecfeff81b Author: Kent Overstreet Date: Thu Apr 4 23:01:54 2019 -0400 bcachefs: initial gc no longer needs to touch every node Signed-off-by: Kent Overstreet commit 1dd7f9d98de0740b42f1ac3f0b1d8af9c76801de Author: Kent Overstreet Date: Thu Apr 4 21:53:12 2019 -0400 bcachefs: Rewrite journal_seq_blacklist machinery Now, we store blacklisted journal sequence numbers in the superblock, not the journal: this helps to greatly simplify the code, and more importantly it's now implemented in a way that doesn't require all btree nodes to be visited before starting the journal - instead, we unconditionally blacklist the next 4 journal sequence numbers after an unclean shutdown. Signed-off-by: Kent Overstreet commit ece254b258980cfd5a0fa11adce8e178c8d34181 Author: Kent Overstreet Date: Thu Apr 4 21:28:16 2019 -0400 bcachefs: don't lose errors from iterators that have been freed Signed-off-by: Kent Overstreet commit 2a039f1ee4077050c57c51f0463335d262740430 Author: Kent Overstreet Date: Wed Apr 3 17:11:15 2019 -0400 bcachefs: free trans->mem on commit Signed-off-by: Kent Overstreet commit a1d58243f943f5933e65e18e504333ac9eccb679 Author: Kent Overstreet Date: Fri Mar 29 22:22:45 2019 -0400 bcachefs: add ability to run gc on metadata only Signed-off-by: Kent Overstreet commit cccf4e6df36ffb4752b4c83efd0723281e629693 Author: Kent Overstreet Date: Thu Mar 28 03:13:27 2019 -0400 bcachefs: Convert gc errors to fsck errors Signed-off-by: Kent Overstreet commit ac7f0d77c24a20998c150b58caff321a4bbcc828 Author: Kent Overstreet Date: Wed Apr 3 20:38:37 2019 -0400 bcachefs: ratelimit copygc warning Signed-off-by: Kent Overstreet commit dcf77129749fea4f6608d310161be1650dc2a4dc Author: Kent Overstreet Date: Sun Mar 31 19:23:34 2019 -0400 bcachefs: minor fsck fix Signed-off-by: Kent Overstreet commit 6bd1305735bc4346e0ca6cc0ff27517e8bab8f0d Author: Kent Overstreet Date: Sun Mar 31 17:37:30 2019 -0400 bcachefs: Fsck locking improvements Signed-off-by: Kent Overstreet commit 36e916e13b694e18d2928d0bda54fb5805051129 Author: Kent Overstreet Date: Fri Mar 29 19:49:17 2019 -0400 bcachefs: Caller now responsible for calling mark_key for gc Signed-off-by: Kent Overstreet commit 7b512638e03a1d302f27997c011cc10a9906f04e Author: Kent Overstreet Date: Fri Mar 29 19:13:54 2019 -0400 bcachefs: Refactor bch2_fs_recovery() Signed-off-by: Kent Overstreet commit 4c1c1e395373a8b47dee91a78f708176794d04f5 Author: Kent Overstreet Date: Sun Mar 31 18:40:01 2019 -0400 bcachefs: fix bch2_trans_unlock() Signed-off-by: Kent Overstreet commit a2b6b0729e8b4d06d1cf1baf1a7976b54c872aeb Author: Kent Overstreet Date: Fri Mar 29 14:42:34 2019 -0400 bcachefs: add missing bch2_btree_iter_node_drop() call Signed-off-by: Kent Overstreet commit 58a46dc5a2d4073f48a9110a9c343bc2d68a6e88 Author: Kent Overstreet Date: Fri Mar 29 14:29:47 2019 -0400 bcachefs: allow journal reply on ro mount Signed-off-by: Kent Overstreet commit 9d455b24be5239df23757042703419de9351e461 Author: Kent Overstreet Date: Fri Mar 29 14:34:10 2019 -0400 bcachefs: make sure to use BTREE_INSERT_LAZY_RW in fsck Signed-off-by: Kent Overstreet commit 0bc166ff564f9e2b0bfc7a0c1a92472a600f901d Author: Kent Overstreet Date: Thu Mar 28 09:34:55 2019 -0400 bcachefs: Track whether filesystem has errors in superblock Signed-off-by: Kent Overstreet commit a6d90385e6915429a891408824b8c72219a139f2 Author: Kent Overstreet Date: Sat Dec 24 22:45:11 2022 -0500 bcachefs: (invalidate|release)_folio fixes Signed-off-by: Kent Overstreet commit 3a0e06db71f65ae0e7a98a1db170339d40abacdc Author: Kent Overstreet Date: Sat Dec 24 22:44:56 2022 -0500 bcachefs: Assorted preemption fixes Signed-off-by: Kent Overstreet commit d5f70c1f2750f0917025ea6b1ee0591cd65a6097 Author: Kent Overstreet Date: Thu Mar 28 03:40:39 2019 -0400 bcachefs: Write out alloc info more carefully In flight btree updates could update alloc info until they're flushed - so we have to try writing again after they've been flushed. Signed-off-by: Kent Overstreet commit ccaa61c9f6a9db28f2e0b480927f6f2c97ff72af Author: Kent Overstreet Date: Thu Mar 28 04:49:05 2019 -0400 bcachefs: fix initial gc Buckets weren't being marked as dirty Signed-off-by: Kent Overstreet commit 6543f5620d81cfa7b52d00c7ade0f037beb7a71e Author: Kent Overstreet Date: Thu Mar 28 03:28:59 2019 -0400 bcachefs: Handle fsck errors at runtime better Signed-off-by: Kent Overstreet commit 05b3d5ac1f4ea75defa4e133ca23a953b4a80c23 Author: Kent Overstreet Date: Thu Mar 28 03:08:40 2019 -0400 bcachefs: simplify gc locking a bit Signed-off-by: Kent Overstreet commit f13f5a8c836f55c6b7b0a58cb26245282f67527c Author: Kent Overstreet Date: Thu Mar 28 01:51:47 2019 -0400 bcachefs: move some checks to expensive_debug_checks Signed-off-by: Kent Overstreet commit 76a0537bf1286f56266fb899014505cba1e332f4 Author: Kent Overstreet Date: Thu Mar 28 00:34:25 2019 -0400 bcachefs: Sort updates in bch2_trans_update() Signed-off-by: Kent Overstreet commit 4afe700060799d0ccf42c9881f3ebfab96953fd8 Author: Kent Overstreet Date: Thu Mar 28 00:32:38 2019 -0400 bcachefs: Unlink not-touched iters on successful transaction commit Signed-off-by: Kent Overstreet commit bf7b87a4a92fac3e97228ce94c35d4f78c85417e Author: Kent Overstreet Date: Thu Mar 28 00:07:24 2019 -0400 bcachefs: traverse all iterators on transaction restart Signed-off-by: Kent Overstreet commit e1120a4c8dd4c8839265a052d03d5604c30166b5 Author: Kent Overstreet Date: Wed Mar 27 23:14:38 2019 -0400 bcachefs: Add iter->idx Signed-off-by: Kent Overstreet commit ecc892e40b52213ceb9eee8dfb972d32911e7509 Author: Kent Overstreet Date: Wed Mar 27 22:46:52 2019 -0400 bcachefs: Kill btree_iter->next Signed-off-by: Kent Overstreet commit e542029eebffbc2c696e3df8d7efe448cbb5e54e Author: Kent Overstreet Date: Wed Mar 27 22:54:42 2019 -0400 bcachefs: Change btree_iter_traverse_error() to not use iter->next Signed-off-by: Kent Overstreet commit 0f2383677172176691bbc760c5af4d87f67f78fc Author: Kent Overstreet Date: Wed Mar 27 22:03:30 2019 -0400 bcachefs: trans_for_each_iter() Signed-off-by: Kent Overstreet commit 7c26ecae326aee84bb53cfb163108a20fb3094d1 Author: Kent Overstreet Date: Mon Mar 25 22:43:26 2019 -0400 bcachefs: Better bch2_trans_copy_iter() Signed-off-by: Kent Overstreet commit 9e5e5b9e7175ddd66f8c212ce1d460a9e7db3fe7 Author: Kent Overstreet Date: Mon Mar 25 17:06:42 2019 -0400 bcachefs: Btree iterators now always have a btree_trans Signed-off-by: Kent Overstreet commit 424eb881300467a21a108d04c9dd08a6f8c007dc Author: Kent Overstreet Date: Mon Mar 25 15:10:15 2019 -0400 bcachefs: Only get btree iters from btree transactions Signed-off-by: Kent Overstreet commit 5df4be3f62c9bde73db801504b3db2693b28328c Author: Kent Overstreet Date: Mon Mar 25 15:34:48 2019 -0400 bcachefs: Btree iter improvements Signed-off-by: Kent Overstreet commit 03e183cb5d429a3bb53816d70da7c19f0745909e Author: Kent Overstreet Date: Thu Mar 21 23:13:46 2019 -0400 bcachefs: Verify fs hasn't been modified before going rw Signed-off-by: Kent Overstreet commit 134915f3d38d830374603b84a9fe2e280f4814ed Author: Kent Overstreet Date: Thu Mar 21 22:19:57 2019 -0400 bcachefs: Go rw lazily Signed-off-by: Kent Overstreet commit 65e7ab8f2aa7d45190f1e90b1332c71ef83587a6 Author: Kent Overstreet Date: Fri Mar 22 04:32:29 2019 -0400 bcachefs: Fix a deadlock Signed-off-by: Kent Overstreet commit 11e6f19a30f65b854ba2fd3e142b3247150efe0d Author: Kent Overstreet Date: Thu Mar 21 21:12:01 2019 -0400 bcachefs: Rework error handling in btree update path Signed-off-by: Kent Overstreet commit 8b2b9d11b9d0aea6401546780e84adcf51e27ba4 Author: Kent Overstreet Date: Thu Mar 21 19:12:52 2019 -0400 bcachefs: Fix error handling in gc Signed-off-by: Kent Overstreet commit 6122ab639c8e3d6afe9a3c8e3e49173cd2a064a3 Author: Kent Overstreet Date: Thu Mar 21 19:03:57 2019 -0400 bcachefs: More debug params for testing of recovery paths Signed-off-by: Kent Overstreet commit 05235e99281533a70abee7f86181d3963f317913 Author: Kent Overstreet Date: Thu Mar 21 19:02:48 2019 -0400 bcachefs: Run gc if failed to read alloc btree Signed-off-by: Kent Overstreet commit 082f0801e0c96a4dbea67998b63c29c18da2419f Author: Kent Overstreet Date: Thu Mar 21 17:04:50 2019 -0400 bcachefs: Fix error handling in bch2_fs_recovery() Signed-off-by: Kent Overstreet commit dc3b63dc33e1b651441275f15ea4a21c9078d583 Author: Kent Overstreet Date: Thu Mar 21 16:28:57 2019 -0400 bcachefs: Add time stats for btree updates Signed-off-by: Kent Overstreet commit 1a470560c9ab8d6dd13363d5a6bae38d2c3d5261 Author: Kent Overstreet Date: Mon Mar 18 16:18:39 2019 -0400 bcachefs: BTREE_INSERT_ATOMIC must be used for extents now Signed-off-by: Kent Overstreet commit 49a67206e4e481a097a3586fbd88ce0deb646307 Author: Kent Overstreet Date: Mon Mar 18 13:42:10 2019 -0400 bcachefs: Add more time stats for being blocked on allocator Signed-off-by: Kent Overstreet commit 7c648fe8991a267886b262e8988546ec87ad926e Author: Kent Overstreet Date: Sun Mar 17 16:49:59 2019 -0400 bcachefs: Fix a deadlock Signed-off-by: Kent Overstreet commit 4d8100daa9bb6c243cd39be0956005a76eec36ee Author: Kent Overstreet Date: Fri Mar 15 18:20:46 2019 -0400 bcachefs: Allocate fs_usage in do_btree_insert_at() Signed-off-by: Kent Overstreet commit 9623ab27ab27e211e66aa1dd9a5ec90307160c8b Author: Kent Overstreet Date: Fri Mar 15 17:11:58 2019 -0400 bcachefs: Btree update path cleanup Signed-off-by: Kent Overstreet commit 0dc17247f1964a1884de5b57cb9c712534ba1011 Author: Kent Overstreet Date: Wed Mar 13 22:44:04 2019 -0400 bcachefs: kill struct btree_insert Signed-off-by: Kent Overstreet commit 0564b16782b39d6f59e06f427f32826db69e75a2 Author: Kent Overstreet Date: Wed Mar 13 20:49:16 2019 -0400 bcachefs: convert bch2_btree_insert_at() usage to bch2_trans_commit() Signed-off-by: Kent Overstreet commit 94d290e40c255ea854ec1050dbf9a8b60340a749 Author: Kent Overstreet Date: Mon Mar 11 16:25:42 2019 -0400 bcachefs: drop btree_insert->did_work Signed-off-by: Kent Overstreet commit 9a12b1b0978837f19a5ccc2312aeae535d8289a4 Author: Kent Overstreet Date: Sat Mar 16 14:27:40 2019 -0400 bcachefs: Refactor extent insert path Signed-off-by: Kent Overstreet commit c93cead058779ec6911047d7084c43e3da3e7eaf Author: Kent Overstreet Date: Sat Mar 16 14:27:40 2019 -0400 bcachefs: Always use bch2_extent_trim_atomic() Signed-off-by: Kent Overstreet commit db8a5f0a6abd1981caf4b87cc65e5a998851f9c6 Author: Kent Overstreet Date: Fri Mar 15 19:34:16 2019 -0400 bcachefs: fix bch2_mark_bkey_replicas() call Signed-off-by: Kent Overstreet commit 18c9883e1cddb6a8c3f593b0c2c921bb0179fa50 Author: Kent Overstreet Date: Wed Mar 13 16:56:48 2019 -0400 bcachefs: fix bch2_invalidate_one_bucket2() during journal replay Signed-off-by: Kent Overstreet commit 61f321fc8bcb844ff0b2520ba71753cb5a511a9a Author: Kent Overstreet Date: Wed Mar 13 13:31:02 2019 -0400 bcachefs: Make deferred inode updates a mount option Journal reclaim may still need performance tuning Signed-off-by: Kent Overstreet commit 3aea434272884b8dc77c57624a6d3fec55ade898 Author: Kent Overstreet Date: Sat Mar 9 14:53:03 2019 -0500 bcachefs: Fix for shutting down before fs started marking it clean Signed-off-by: Kent Overstreet commit 844045581e52955525fcc487d59fb3981a412f35 Author: Kent Overstreet Date: Fri Mar 8 17:20:33 2019 -0500 bcachefs: Fix for when compressed extent is split during journal replay Signed-off-by: Kent Overstreet commit a8e00bd48a839aa9ee134c9966872523cd8075e6 Author: Kent Overstreet Date: Thu Mar 7 23:13:39 2019 -0500 bcachefs: increase BTREE_ITER_MAX Signed-off-by: Kent Overstreet commit db6447b383e5299e864826a3adc29b5eca04f4c5 Author: Kent Overstreet Date: Thu Mar 7 23:14:35 2019 -0500 bcachefs: fix a faulty assertion Signed-off-by: Kent Overstreet commit 812af308de34f5bc3fc0d30a00f826ad159a724f Author: Kent Overstreet Date: Thu Mar 7 19:45:57 2019 -0500 bcachefs: assertion to catch outstanding bug Signed-off-by: Kent Overstreet commit b5d056358d1da10738500a272a4e7967d55e9341 Author: Kent Overstreet Date: Thu Mar 7 17:19:04 2019 -0500 bcachefs: minor journal reclaim fixes Signed-off-by: Kent Overstreet commit 59928c12206ce8f478113403562947e21a47883a Author: Kent Overstreet Date: Thu Mar 7 16:33:56 2019 -0500 bcachefs: Don't BUG_ON() on bucket sector count overflow Signed-off-by: Kent Overstreet commit 446c562c2c60ec074c841725c410ee5106405956 Author: Kent Overstreet Date: Mon Mar 4 17:54:28 2019 -0500 bcachefs: Remove direct use of bch2_btree_iter_link() Signed-off-by: Kent Overstreet commit 5154704b29e58a5fd9acd601b831d99298a76a6c Author: Kent Overstreet Date: Fri Jul 20 22:27:07 2018 -0400 bcachefs: Use deferred btree updates for inode updates Signed-off-by: Kent Overstreet commit 3e5d6c59bec6f989e103e364d6a044a8a77e3a13 Author: Kent Overstreet Date: Tue Feb 19 17:56:21 2019 -0500 bcachefs: Use journal preres for deferred btree updates Signed-off-by: Kent Overstreet commit 68ef94a63caf214ee238434bf0d4c7a6a32c33a2 Author: Kent Overstreet Date: Tue Feb 19 13:41:36 2019 -0500 bcachefs: Add a pre-reserve mechanism for the journal Signed-off-by: Kent Overstreet commit 9ace606e93e9c6dff919ca8f35d461e8462590b7 Author: Kent Overstreet Date: Thu Feb 28 14:22:52 2019 -0500 bcachefs: Don't block on reclaim_lock from journal_res_get When we're doing btree updates from journal flush, this becomes a locking inversion Signed-off-by: Kent Overstreet commit 03d5eaed8624fdc7918478bffd05d67e773ac7d0 Author: Kent Overstreet Date: Sun Mar 3 16:50:40 2019 -0500 bcachefs: bch2_journal_space_available improvements Signed-off-by: Kent Overstreet commit 2384db8f32a2df9e71cd3003d213b48f64cbde1e Author: Kent Overstreet Date: Sun Mar 3 18:39:07 2019 -0500 bcachefs: Separate discards from rest of journal reclaim Signed-off-by: Kent Overstreet commit 0ce2dbbe9915af85b2ebafe6dfeca6813ba5e13c Author: Kent Overstreet Date: Sun Mar 3 15:15:55 2019 -0500 bcachefs: ja->discard_idx, ja->dirty_idx Signed-off-by: Kent Overstreet commit fcbf3e509648a94129ae23a6101f5295a3fdced0 Author: Kent Overstreet Date: Fri Mar 1 17:21:44 2019 -0500 bcachefs: Allocator startup fixes/refactoring Signed-off-by: Kent Overstreet commit dc9aa17841e83b6d6ca5abe295545ca0764e1580 Author: Kent Overstreet Date: Fri Mar 1 15:51:57 2019 -0500 bcachefs: Drop a faulty assertion the assertion was meant to check that bch2_journal_reclaim_fast() was always being called, but since the atomic dec can happen outside of j->lock the assertion itself can race Signed-off-by: Kent Overstreet commit 1633e492ce07e26af58b11dd26039bf7c0080c96 Author: Kent Overstreet Date: Thu Feb 28 22:33:06 2019 -0500 bcachefs: improved flush_held_btree_writes() Signed-off-by: Kent Overstreet commit 6409c6a0aea95c78e353141f1855c11fcff0950c Author: Kent Overstreet Date: Thu Feb 28 22:32:09 2019 -0500 bcachefs: use correct wq for journal reclaim Signed-off-by: Kent Overstreet commit e5a66496a0751c1a7ea692ef5874c4cfad85969b Author: Kent Overstreet Date: Thu Feb 21 13:33:21 2019 -0500 bcachefs: Journal reclaim refactoring Signed-off-by: Kent Overstreet commit 2d3b581039614a20b064856b8fd899a733a4a1f8 Author: Kent Overstreet Date: Tue Feb 26 14:28:08 2019 -0500 bcachefs: Better journal debug Signed-off-by: Kent Overstreet commit c8cc5b3e3fa154446eae9aa461aeb97bc5a07c09 Author: Kent Overstreet Date: Tue Feb 26 17:13:46 2019 -0500 bcachefs: Don't get journal reservation until after we know insert will succeed Checking if we can do the insert after getting the journal reservation means potentially wasting space in the journal, which will break the new pre reservation mechanism Signed-off-by: Kent Overstreet commit 8db2acde2fca80954b4db12977182aa44b1e85fe Author: Kent Overstreet Date: Wed Feb 27 19:14:23 2019 -0500 bcachefs: fix integer underflow in journal code Signed-off-by: Kent Overstreet commit 28062d320bded23eb7d24633e6ab11ea3c03487b Author: Kent Overstreet Date: Wed Feb 20 17:57:06 2019 -0500 bcachefs: Fix gc handling of bucket gens Signed-off-by: Kent Overstreet commit 86a225c42d44ba966504801c6d953745184ea9cf Author: Kent Overstreet Date: Wed Feb 20 16:00:03 2019 -0500 bcachefs: fix a deadlock on startup Signed-off-by: Kent Overstreet commit 3c5fa33a55ac2a1539c89635c07eee9fc3823bac Author: Kent Overstreet Date: Wed Feb 20 14:18:44 2019 -0500 bcachefs: force str_hash code to be inlined the btree trans iterator stuff relies on a dirty horrible hack that uses a short backtrace to generate tokens, and gcc uninlining these functions breaks that hack. ugh. Signed-off-by: Kent Overstreet commit d16b4a77a5c64fca52ff637c22668b679b47ef22 Author: Kent Overstreet Date: Mon Feb 18 17:39:42 2019 -0500 bcachefs: Assorted journal refactoring Signed-off-by: Kent Overstreet commit ecf37a4a80ec029d640b9c18f87880d4ec4a726f Author: Kent Overstreet Date: Thu Feb 14 20:39:17 2019 -0500 bcachefs: fs_usage_u64s() Signed-off-by: Kent Overstreet commit 768ac63924775d9fe2e76fbb254704d5ee3bcb85 Author: Kent Overstreet Date: Thu Feb 14 18:38:52 2019 -0500 bcachefs: Add a mechanism for blocking the journal Signed-off-by: Kent Overstreet commit 8fe826f90aad4ea314d0acdf7425a9bf2324e17f Author: Kent Overstreet Date: Wed Feb 13 14:46:32 2019 -0500 bcachefs: Convert bucket invalidation to key marking path Signed-off-by: Kent Overstreet commit 73c27c60956ed55d165d41658745dead49d689c4 Author: Kent Overstreet Date: Thu Feb 14 15:42:41 2019 -0500 bcachefs: fixes for cached data accounting Signed-off-by: Kent Overstreet commit 8c96cfccf045efff12d8287a41f2b8f4ef3094c2 Author: Kent Overstreet Date: Wed Feb 13 15:17:23 2019 -0500 bcachefs: fix more locking bugs Signed-off-by: Kent Overstreet commit 8777210b92c661a50fb8147574cb0a366566ae07 Author: Kent Overstreet Date: Tue Feb 12 15:03:47 2019 -0500 bcachefs: refactor key marking code a bit Signed-off-by: Kent Overstreet commit 2ecc6171a3267fe24d7ee28059631a630344c310 Author: Kent Overstreet Date: Tue Feb 12 14:58:55 2019 -0500 bcachefs: Fix double counting when gc is running Signed-off-by: Kent Overstreet commit 39fbc5a49f3377d21980cdc34c5fb55332bff3b9 Author: Kent Overstreet Date: Mon Feb 11 22:08:09 2019 -0500 bcachefs: gc lock no longer needed for disk reservations Signed-off-by: Kent Overstreet commit 76f4c7b0c33d86bfa3973655ea6ed6182039ca99 Author: Kent Overstreet Date: Mon Feb 11 19:27:33 2019 -0500 bcachefs: Fix oldest_gen handling Signed-off-by: Kent Overstreet commit 053dbb377dd2874942a1ca8517d454f35916a782 Author: Kent Overstreet Date: Mon Feb 11 19:04:40 2019 -0500 bcachefs: Fix a locking bug Signed-off-by: Kent Overstreet commit 66393392533048b7e45a202f349974d16c4c9ea3 Author: Kent Overstreet Date: Mon Feb 11 15:33:14 2019 -0500 bcachefs: Fix a lockdep splat Signed-off-by: Kent Overstreet commit f7e76361c4c77941ffe0b4bb25db04642714a283 Author: Kent Overstreet Date: Sun Feb 10 19:16:55 2019 -0500 bcachefs: no need to run gc when initializing new fs Signed-off-by: Kent Overstreet commit 6d033aa404e71710de217d63999fade2f2b0491f Author: Kent Overstreet Date: Sat Feb 9 19:45:36 2019 -0500 bcachefs: Don't need to walk inodes on clean shutdown Signed-off-by: Kent Overstreet commit 1df42b571535ed3fd8d9d94f674c626746dc0275 Author: Kent Overstreet Date: Wed Feb 6 11:56:51 2019 -0500 bcachefs: don't do initial gc if have alloc info feature Signed-off-by: Kent Overstreet commit 3577df5f7f25f6669c4b53e76cf159d550a0fd83 Author: Kent Overstreet Date: Sat Feb 9 19:20:57 2019 -0500 bcachefs: serialize persistent_reserved Signed-off-by: Kent Overstreet commit 3e0745e28363c1675a05775425312c049d5857b3 Author: Kent Overstreet Date: Thu Jan 24 20:25:40 2019 -0500 bcachefs: initialize fs usage summary in recovery Signed-off-by: Kent Overstreet commit 42b72e0ba226fa15dda0fb9e9f1646a1ae5d03fd Author: Kent Overstreet Date: Thu Jan 24 19:09:49 2019 -0500 bcachefs: journal_replay_early() Signed-off-by: Kent Overstreet commit 3ccc5c50f29fb6934fb71e12983f1f2beabe29b9 Author: Kent Overstreet Date: Thu Jan 24 17:54:51 2019 -0500 bcachefs: Write out fs usage Signed-off-by: Kent Overstreet commit 2c5af169f72c1018e83b79ac82ffe387534910e8 Author: Kent Overstreet Date: Thu Jan 24 17:12:00 2019 -0500 bcachefs: reserve space in journal for fs usage entries Signed-off-by: Kent Overstreet commit 24547d097a520312cf9d727d3af8da1b0c985f98 Author: Kent Overstreet Date: Sat Feb 9 18:24:20 2019 -0500 bcachefs: fix bch2_sb_field_resize() Signed-off-by: Kent Overstreet commit 94cd106f8db3e454fa900acc1ffcbc5dcc0eddd8 Author: Kent Overstreet Date: Sat Feb 9 16:50:53 2019 -0500 bcachefs: delete a debug printk Signed-off-by: Kent Overstreet commit 736affa8bb3eeff49014dff9fd728f7ba3ffa550 Author: Kent Overstreet Date: Fri Feb 8 14:43:53 2019 -0500 bcachefs: fix for unmount hang Signed-off-by: Kent Overstreet commit b935a8a67ab744d20002aefd7f8053381b38532f Author: Kent Overstreet Date: Sat Feb 9 16:15:29 2019 -0500 bcachefs: Fix a bug when shutting down before allocator started Signed-off-by: Kent Overstreet commit 4c97e04aa8818da266a690543aca28e2e7c26820 Author: Kent Overstreet Date: Wed Feb 6 11:42:13 2019 -0500 bcachefs: percpu utility code Signed-off-by: Kent Overstreet commit fe112812ae41bfed0aa61cdfbe8233e4122e5cb8 Author: Kent Overstreet Date: Thu Jan 24 18:32:13 2019 -0500 bcachefs: sysfs trigger for bch2_alloc_write Signed-off-by: Kent Overstreet commit eac3ca0f49737ba3120ccaa990877b2a05bc88cc Author: Kent Overstreet Date: Thu Jan 24 16:50:48 2019 -0500 bcachefs: New journal_entry_res mechanism Signed-off-by: Kent Overstreet commit 6e1b07183a32583cbe4d781ea0e14e0b06bc44af Author: Kent Overstreet Date: Thu Jan 24 19:50:00 2019 -0500 bcachefs: improve alloc_debug Signed-off-by: Kent Overstreet commit bdba6c29ffc9041257eeeb5916bc3ae6f8828a0d Author: Kent Overstreet Date: Thu Jan 24 20:00:57 2019 -0500 bcachefs: fix inode counting Signed-off-by: Kent Overstreet commit 61c8d7c8eb0e0169e04df64fab45c575aaad0739 Author: Kent Overstreet Date: Sun Nov 25 20:53:51 2018 -0500 bcachefs: Persist stripe blocks_used Signed-off-by: Kent Overstreet commit ed1646ca7412151dbdd81f4e4d05437cc99e9c8c Author: Kent Overstreet Date: Tue Jan 22 13:46:14 2019 -0500 bcachefs: Improve c version of __bkey_cmp_bits Signed-off-by: Kent Overstreet commit 430735cd1a0304195a080f8ee239016444a02715 Author: Kent Overstreet Date: Mon Nov 19 01:31:41 2018 -0500 bcachefs: Persist alloc info on clean shutdown - Does not persist alloc info for stripes yet - Also does not yet include filesystem block/sector counts yet, from struct fs_usage - Not made use of just yet Signed-off-by: Kent Overstreet commit 5e5d9bdbb89c51603653360ecfbfa90c0bceb108 Author: Kent Overstreet Date: Tue Jan 22 20:04:06 2019 -0500 bcachefs: Fix fifo overflow in allocator startup Signed-off-by: Kent Overstreet commit 7ef2a73a5881323d53453cc3be7261fe1a49af1d Author: Kent Overstreet Date: Mon Jan 21 15:32:13 2019 -0500 bcachefs: Fix check for if extent update is allocating Signed-off-by: Kent Overstreet commit dbaee468461bfa82e6453ca0e009e9661cc570da Author: Kent Overstreet Date: Sun Jan 20 21:16:25 2019 -0500 bcachefs: fix error message in device remove path Signed-off-by: Kent Overstreet commit 919dbbd18b590bc3235b96e498a67cc66e4fbb1f Author: Kent Overstreet Date: Sat Jan 19 18:12:24 2019 -0500 bcachefs: dio arithmetic improvements Signed-off-by: Kent Overstreet commit b030f691da68835e46a50f221c36b59898c91bf6 Author: Kent Overstreet Date: Sat Jan 19 13:13:29 2019 -0500 bcachefs: Fix some reserve calculations Signed-off-by: Kent Overstreet commit 0519b72dd24754c560b6ac47b0224aaf462978c8 Author: Kent Overstreet Date: Sat Jan 19 12:20:00 2019 -0500 bcachefs: Add a workqueue for journal reclaim journal reclaim writes btree nodes, which can end up waiting for in flight btree writes to complete, and btree write completions run out of workqueues - so we can't run out of the same workqueue or we risk deadlock Signed-off-by: Kent Overstreet commit b0cbf659a5349ec73c5745bdf1975d5915f89071 Author: Kent Overstreet Date: Fri Jan 18 18:58:51 2019 -0500 bcachefs: Fix an allocator error path Signed-off-by: Kent Overstreet commit 000de45996c4b0f9a7b4f2830c11ed584f473257 Author: Kent Overstreet Date: Mon Jan 14 00:38:47 2019 -0500 bcachefs: fixes for getting stuck flushing journal pins Signed-off-by: Kent Overstreet commit ed4840308c9bd3f70e395bd6e37a410a96dcd883 Author: Kent Overstreet Date: Sun Jan 13 21:36:14 2019 -0500 bcachefs: Fix a dio bug Signed-off-by: Kent Overstreet commit d0cc3defba58889e38eaa0c275d4728b4ac3b8c2 Author: Kent Overstreet Date: Sun Jan 13 16:02:22 2019 -0500 bcachefs: More allocator startup improvements Signed-off-by: Kent Overstreet commit b8adb833652909221efde19b1813627382b5bf51 Author: Kent Overstreet Date: Fri Jan 11 23:23:27 2019 -0500 bcachefs: correctly initialize bch_extent_ptr Signed-off-by: Kent Overstreet commit 04c2c34f00e1dacae2d329764b912e4a560efbb7 Author: Kent Overstreet Date: Fri Jan 11 05:11:07 2019 -0500 bcachefs: use crc64 from lib/ Signed-off-by: Kent Overstreet commit 23f80d2b3bf7898579c841786c49842789f32ff5 Author: Kent Overstreet Date: Mon Dec 17 08:44:56 2018 -0500 bcachefs: Factor out acc_u64s() Signed-off-by: Kent Overstreet commit e47c017144fe302dfba09ba9f6629ed5dca6d77f Author: Kent Overstreet Date: Mon Dec 17 08:29:44 2018 -0500 bcachefs: Minor replicas.c refactoring Signed-off-by: Kent Overstreet commit e19e57f8a1e5ebe1fe78dc0dff5120b4752ee8b1 Author: Kent Overstreet Date: Wed Dec 19 16:01:38 2018 -0500 bcachefs: fix new reinherit_attrs ioctl Signed-off-by: Kent Overstreet commit 0b847a19d96b66baeb651317d5e22f8bd4368975 Author: Kent Overstreet Date: Wed Dec 19 12:58:56 2018 -0500 bcachefs: Lots of option handling improvements Add helptext to option definitions - so we can unify the option handling with the format command Signed-off-by: Kent Overstreet commit 2fab25cdd70be6868936639dfb03eaa9fa0245c0 Author: Kent Overstreet Date: Wed Dec 19 08:43:01 2018 -0500 bcachefs: more project quota fixes Signed-off-by: Kent Overstreet commit 69d46f903120d4aab0e0ad239191245d839224cc Author: Kent Overstreet Date: Tue Dec 18 14:43:00 2018 -0500 bcachefs: fix an rcu usage bug Signed-off-by: Kent Overstreet commit a36d3685bbc3a5193f0c284233386d56136363c7 Author: Kent Overstreet Date: Tue Dec 18 10:15:35 2018 -0500 bcachefs: fix ja->cur_idx use while reading journal Signed-off-by: Kent Overstreet commit d3bb629d04ec4ec49556fe3d974e0744a0dd0084 Author: Kent Overstreet Date: Tue Dec 18 08:41:58 2018 -0500 bcachefs: fix device remove error path Signed-off-by: Kent Overstreet commit 19b505a93434500469d9e2726967f28685f777a3 Author: Kent Overstreet Date: Mon Dec 17 09:24:49 2018 -0500 bcachefs: Fix duplicate ioctl nr Signed-off-by: Kent Overstreet commit 8095708fce72a911e20799078639e95c1a008176 Author: Kent Overstreet Date: Mon Dec 17 06:11:14 2018 -0500 bcachefs: bch2_ioc_reinherit_attrs() Signed-off-by: Kent Overstreet commit 96012e143e699db1a7644e4c5903b63bdde33772 Author: Kent Overstreet Date: Mon Dec 17 05:31:49 2018 -0500 bcachefs: rename keeps inheritable inode opts consistent Signed-off-by: Kent Overstreet commit 4d269918ed502cba80ddad998bdb087a633c63ab Author: Kent Overstreet Date: Mon Dec 17 05:31:09 2018 -0500 bcachefs: add bcachefs_effective xattrs Allows seeing xattrs that were inherited, not explicitly set Signed-off-by: Kent Overstreet commit 721d4ad8eb55bf66ef55b31438b6c8361acf283f Author: Kent Overstreet Date: Thu Dec 13 08:32:11 2018 -0500 bcachefs: Add flags to indicate if inode opts were inherited or explicitly set Signed-off-by: Kent Overstreet commit 0f5254aa98befa5187cc4d02584ab0f19d18ff68 Author: Kent Overstreet Date: Mon Dec 17 05:43:00 2018 -0500 bcachefs: bch2_fs_quota_transfer improve quota transfer locking & make ei_qid usage more consistent Signed-off-by: Kent Overstreet commit d42dd4ad6d7e15a7742ed008d1be3c37247547c9 Author: Kent Overstreet Date: Thu Dec 13 08:24:21 2018 -0500 bcachefs: merge BCH_INODE_FIELDS_INHERIT/BCH_INODE_OPTS Signed-off-by: Kent Overstreet commit a3e70fb287ee62ee14512a69e9a3e1870a057e11 Author: Kent Overstreet Date: Thu Dec 13 06:01:30 2018 -0500 bcachefs: use x-macros more consistently Signed-off-by: Kent Overstreet commit 7121643e4fe20cbf916bf7ff032873dfbc19ee8e Author: Kent Overstreet Date: Wed Dec 12 06:23:25 2018 -0500 bcachefs: Fix for building in userspace Signed-off-by: Kent Overstreet commit f9ccc30824a6b9f44b975c8ce952938eff5920f3 Author: Tim Schlueter Date: Sun Dec 9 13:20:52 2018 -0800 bcachefs: Fix bkey_method compilation on gcc 7.3.0 Signed-off-by: Tim Schlueter Signed-off-by: Kent Overstreet commit 06b7345cc282ec383942afb3b5b8d42bd9eec1b8 Author: Kent Overstreet Date: Sat Dec 1 11:32:12 2018 -0500 bcachefs: Include summarized counts in fs_usage Signed-off-by: Kent Overstreet commit 5663a4152138fdf23a300934128d77a1bf784237 Author: Kent Overstreet Date: Tue Nov 27 08:23:22 2018 -0500 bcachefs: refactor bch_fs_usage Signed-off-by: Kent Overstreet commit 73e6ab95640a7d370b7af481e8ed44be7c76b898 Author: Kent Overstreet Date: Sat Dec 1 10:32:48 2018 -0500 bcachefs: Switch replicas to mark_lock Prep work for upcoming disk accounting changes Signed-off-by: Kent Overstreet commit 56e0e7c79f492df2a5ad207a0ba16f13511b6416 Author: Kent Overstreet Date: Thu Dec 6 12:01:29 2018 -0500 bcachefs: fix an incorrect bkey_debugcheck() call Signed-off-by: Kent Overstreet commit 45dbb73e407fe2e9f2819daf4f74e36e9e998a59 Author: Kent Overstreet Date: Thu Dec 6 10:24:22 2018 -0500 bcachefs: improve extent debugcheck fn Signed-off-by: Kent Overstreet commit 641ab736437a3f9881467c0005b0d677194fff63 Author: Kent Overstreet Date: Thu Dec 6 11:52:58 2018 -0500 bcachefs: improve/clarify ptr_disk_sectors() Signed-off-by: Kent Overstreet commit 57cb2142ed1aadf2bf737f732bc74e5649dbcb15 Author: Kent Overstreet Date: Thu Dec 6 09:58:03 2018 -0500 bcachefs: Fix for running in degraded mode Signed-off-by: Kent Overstreet commit db636adb2e74fd54489f00667722e09a75702aaa Author: Kent Overstreet Date: Wed Dec 5 12:30:02 2018 -0500 bcachefs: Compression fixes regressions from switching disk space accounting to be in compressed sectors Signed-off-by: Kent Overstreet commit 56338d3dc3abb9ddece01ddc7cc892102dda2842 Author: Kent Overstreet Date: Wed Dec 5 12:28:35 2018 -0500 bcachefs: propagate BCH_WRITE_CACHED Signed-off-by: Kent Overstreet commit 9166b41db1ded0ed284ae40fbe5ec5b83191cc65 Author: Kent Overstreet Date: Mon Nov 26 00:13:33 2018 -0500 bcachefs: s/usage_lock/mark_lock better describes what it's for, and we're going to call a new lock usage_lock Signed-off-by: Kent Overstreet commit 76640280ac45e2d56f5bf7c519b10653b9361fcd Author: Kent Overstreet Date: Sat Nov 24 19:01:45 2018 -0500 bcachefs: New blockcount field for bch_stripe Signed-off-by: Kent Overstreet commit 8eb7f3ee46f23207d3e0ae6428b780a0708c53c1 Author: Kent Overstreet Date: Mon Nov 19 01:16:07 2018 -0500 bcachefs: move dirty into bucket_mark Signed-off-by: Kent Overstreet commit 90541a741d74373b8cca2bcd56c469927d093064 Author: Kent Overstreet Date: Sat Jul 21 23:36:11 2018 -0400 bcachefs: Add new alloc fields prep work for persistent alloc info Signed-off-by: Kent Overstreet commit 3636ed489ac05e61d59be29b8e69111ef781d528 Author: Kent Overstreet Date: Tue Jul 17 13:50:15 2018 -0400 bcachefs: Deferred btree updates Will be used in the future for inode updates, which will be very helpful for multithreaded workloads that have to update the inode with every extent update (appends, or updates that change i_sectors) Also will be used eventually for fully persistent alloc info However - we still need a mechanism for reserving space in the journal prior to getting a journal reservation, so it's not technically safe to make use of this just yet, we could deadlock with the journal full (although not likely to be an issue in practice) Signed-off-by: Kent Overstreet commit eb8632657f79ee29941f4013b81cdd4aaeeca1a8 Author: Kent Overstreet Date: Sat Nov 24 18:27:16 2018 -0500 bcachefs: drop bogus percpu_ref_tryget caller should already be guarding against rw, and checking here breaks when caller needs to finish updates for going RO Signed-off-by: Kent Overstreet commit f0cfb963ec0370b021bb21c899b5fdcd020014cf Author: Kent Overstreet Date: Thu Nov 29 02:14:31 2018 -0500 bcachefs: Track nr_inodes with the key marking machinery Signed-off-by: Kent Overstreet commit 26609b619fa2301eb7eb5855a7005d99f8a07a73 Author: Kent Overstreet Date: Thu Nov 1 15:10:01 2018 -0400 bcachefs: Make bkey types globally unique this lets us get rid of a lot of extra switch statements - in a lot of places we dispatch on the btree node type, and then the key type, so this is a nice cleanup across a lot of code. Also improve the on disk format versioning stuff. Signed-off-by: Kent Overstreet commit 01a0108f0139a2f6dbace54dd5d592d2d76415c1 Author: Kent Overstreet Date: Thu Nov 29 03:24:06 2018 -0500 bcachefs: Fix a btree iter usage error previously, if the code traversed to the next btree node, that could return an error (due to lock restarts) - which was not being checked for. fix is to rework it so it never iterates past the current leaf node, and pops an assertion if it ever sees an error. Signed-off-by: Kent Overstreet commit 5b8a9227f8a4acd9652d6d89a608fbf4c39c6f44 Author: Kent Overstreet Date: Tue Nov 27 18:30:56 2018 -0500 bcachefs: Split out bkey_sort.c Signed-off-by: Kent Overstreet commit 9d11058a789a86eb580d2b0684604a1a5d795fe3 Author: Kent Overstreet Date: Tue Nov 27 10:06:18 2018 -0500 bcachefs: fix waiting on an open journal entry Signed-off-by: Kent Overstreet commit d034c09b268398df2a395ca2308f6791a4745e7b Author: Kent Overstreet Date: Tue Nov 27 08:14:51 2018 -0500 bcachefs: return errors correctly from gc Signed-off-by: Kent Overstreet commit eeb83e25bb07ff1d00297c541c03e35c8c3c762c Author: Kent Overstreet Date: Thu Nov 22 22:50:35 2018 -0500 bcachefs: Hold usage_lock over mark_key and fs_usage_apply Fixes an inconsistency at the end of gc Signed-off-by: Kent Overstreet commit dfe9bfb32e380df67d25cd5afb887b3466230e03 Author: Kent Overstreet Date: Sat Nov 24 17:09:44 2018 -0500 bcachefs: Stripes now properly subject to gc gc now verifies the contents of the stripes radix tree, important for persistent alloc info Signed-off-by: Kent Overstreet commit ad7ae8d63fa82e5d713e73a1a6a4ca9728f84898 Author: Kent Overstreet Date: Fri Nov 23 05:19:25 2018 -0500 bcachefs: Btree locking fix, refactoring Hit an assertion, probably spurious, indicating an iterator was unlocked when it shouldn't have been (spurious because it wasn't locked at all when the caller called btree_insert_at()). Add a flag, BTREE_ITER_NOUNLOCK, and tighten up the assertions Signed-off-by: Kent Overstreet commit de5bb710f93fb87aef8303336a49d09323286822 Author: Kent Overstreet Date: Fri Nov 23 02:06:18 2018 -0500 bcachefs: shim for userspace raid library Signed-off-by: Kent Overstreet commit 4e65431c855e959700cc9456f305fcfd94ee6241 Author: Kent Overstreet Date: Fri Nov 23 02:50:33 2018 -0500 Revert "bcachefs: start erasure coding after journal replay" This reverts commit 36f389604294dfc953e6f5624ceb683818d32f28. Signed-off-by: Kent Overstreet commit e88973373aaabebba6e59ff0ff74333eacd7bffb Author: Kent Overstreet Date: Thu Nov 22 23:05:13 2018 -0500 bcachefs: Allow for new alloc fields Signed-off-by: Kent Overstreet commit 9ca53b55f7415783c6cc8b751c99f2af6cc0a932 Author: Kent Overstreet Date: Mon Jul 23 05:32:01 2018 -0400 bcachefs: gc now operates on second set of bucket marks This means we can now use gc to verify the allocation information - important for testing persistant alloc info Signed-off-by: Kent Overstreet commit e647369168e02a06ff5ee229cc14ad72b2f5ddfd Author: Kent Overstreet Date: Wed Nov 21 07:16:28 2018 -0500 bcachefs: fix mempool double initialization Signed-off-by: Kent Overstreet commit 8812600c2953bf7e394ad11d44c7d71fbdd719cc Author: Kent Overstreet Date: Wed Nov 21 02:59:07 2018 -0500 bcachefs: fix btree iterator bug when using depth > 0 Signed-off-by: Kent Overstreet commit 61274e9d45547e741cfafc80fb78a81275c8394a Author: Kent Overstreet Date: Sun Nov 18 23:20:21 2018 -0500 bcachefs: Allocator startup improvements Signed-off-by: Kent Overstreet commit a9ec3454011f218e583832d93244057257c7dfe2 Author: Kent Overstreet Date: Sun Nov 18 18:32:16 2018 -0500 bcachefs: Journal refactoring Signed-off-by: Kent Overstreet commit f1a79365a7416c5046f88d0db025e1d84c32b252 Author: Kent Overstreet Date: Sun Nov 18 21:35:59 2018 -0500 bcachefs: Don't block on journal reservation with btree locks held Fixes a deadlock between the allocator thread, when it first starts up, and journal replay Signed-off-by: Kent Overstreet commit 129550c4d08fcc518c7cbe747657ed18470f712a Author: Kent Overstreet Date: Sun Nov 18 20:42:02 2018 -0500 bcachefs: start erasure coding after journal replay Signed-off-by: Kent Overstreet commit f81b648d1f8f285d1471bed0d47bb4316044b864 Author: Kent Overstreet Date: Wed Nov 14 21:53:40 2018 -0500 bcachefs: Clean up, possixly fix page disk reservation accounting Signed-off-by: Kent Overstreet commit b1ba2359fb86b2f87b55d7d8cc9847b826242b33 Author: Kent Overstreet Date: Wed Nov 14 21:53:25 2018 -0500 bcachefs: Fix an error path Signed-off-by: Kent Overstreet commit 283cca30a8ae878e6f78cfbd73886fd78c1b13f8 Author: Kent Overstreet Date: Tue Nov 13 22:10:27 2018 -0500 bcachefs: fix typo when picking read method Signed-off-by: Kent Overstreet commit cd575ddf57af004913ff5a994aa5f3203216fa68 Author: Kent Overstreet Date: Thu Nov 1 15:13:19 2018 -0400 bcachefs: Erasure coding Signed-off-by: Kent Overstreet commit 91f8b5677b5d831cff34b25ef03322ae49e03256 Author: Kent Overstreet Date: Mon Nov 12 17:26:36 2018 -0500 bcachefs: More btree gc refactorings more prep work for erasure coding Signed-off-by: Kent Overstreet commit 1d25849c2c2d552b09494b984da915be4a703a18 Author: Kent Overstreet Date: Wed Nov 7 17:48:32 2018 -0500 bcachefs: Centralize marking of replicas in btree update path Signed-off-by: Kent Overstreet commit b35b1925832e6384fcb64c347a70ee205f6e89ea Author: Kent Overstreet Date: Mon Nov 5 02:31:48 2018 -0500 bcachefs: Move key marking out of extents.c Signed-off-by: Kent Overstreet commit af9d3bc203c9ecb66f5ca344090b61722d9b755a Author: Kent Overstreet Date: Tue Oct 30 14:32:47 2018 -0400 bcachefs: stripe support for replicas tracking Signed-off-by: Kent Overstreet commit c258f28ebab6be176f20173aac725092b39cbd2c Author: Kent Overstreet Date: Mon Nov 12 18:30:55 2018 -0500 bcachefs: Check for unsupported features Signed-off-by: Kent Overstreet commit 319f9ac38eaba628d69b6ddbf402b35487315fc1 Author: Kent Overstreet Date: Fri Nov 9 01:24:07 2018 -0500 bcachefs: revamp to_text methods Signed-off-by: Kent Overstreet commit 75369d4ec3d2dfc52af18a2d20cd0af14c935ac9 Author: Kent Overstreet Date: Fri Nov 9 01:42:49 2018 -0500 bcachefs: delete some dead code Signed-off-by: Kent Overstreet commit 82ebd49cd6c68a5af44ada2487e00da606423404 Author: Kent Overstreet Date: Fri Nov 9 00:55:20 2018 -0500 bcachefs: fix a replicas bug Signed-off-by: Kent Overstreet commit a420eea6890d709b7b9b33222d4fecc7a7ad9bd4 Author: Tim Schlueter Date: Sun Nov 4 20:14:46 2018 -0800 bcachefs: Set the last mount time using the realtime clock This way the last mount time is actually meaningful instead of just being various times from 1970 (which happens with the monotonic clock). Also, roundup_pow_of_two() is undefined when passed in 0, so check before calling it. Signed-off-by: Tim Schlueter Signed-off-by: Kent Overstreet commit 4628529f152782933865257796000f1f6702a9ee Author: Kent Overstreet Date: Sun Nov 4 23:10:09 2018 -0500 bcachefs: Disk usage in compressed sectors, not uncompressed Signed-off-by: Kent Overstreet commit 8b335baef22768deb7140e45f32f37ea51a1faf4 Author: Kent Overstreet Date: Sun Nov 4 22:09:51 2018 -0500 bcachefs: Assorted fixes for running on very small devices It's now possible to create and use a filesystem on a 512k device with 4k buckets (though at that size we still waste almost half to internal reserves) Signed-off-by: Kent Overstreet commit b092dadd55fb242a480f81c421303a9e53302156 Author: Kent Overstreet Date: Sun Nov 4 21:55:35 2018 -0500 bcachefs: Scale down number of writepoints when low on space this means we don't have to reserve space for them when calculating filesystem capacity Signed-off-by: Kent Overstreet commit 72644db153e6d3fc146d2c805dcba5b5d676cd99 Author: Kent Overstreet Date: Sat Nov 3 22:00:50 2018 -0400 bcachefs: Fix an assertion when rebuilding replicas Signed-off-by: Kent Overstreet commit 02f1a96c135a7c99518261bf8d244091416c30c6 Author: Kent Overstreet Date: Sat Nov 3 21:52:52 2018 -0400 bcachefs: Rename nofsck opt to fsck Signed-off-by: Kent Overstreet commit 6bdbfa87a832c0d3766e1b680729fede21eca7dc Author: Kent Overstreet Date: Sat Nov 3 21:51:31 2018 -0400 bcachefs: Fix journal replay when replicas sb section missing Signed-off-by: Kent Overstreet commit 636ad1d391b9e0f22107ace04e6dbc07d8875739 Author: Kent Overstreet Date: Sat Nov 3 20:19:04 2018 -0400 bcachefs: fix bounds checks in bch2_bio_map() Signed-off-by: Kent Overstreet commit ac10a9611d8794c849092a777a5febc4f69788ae Author: Kent Overstreet Date: Sat Nov 3 20:04:54 2018 -0400 bcachefs: Some fixes for building in userspace userspace allocators don't align allocations as nicely as kernel allocators, which meant that in some cases we weren't allocating big enough bvec arrays - just make the calculations more rigorous and explicit to fix it. Signed-off-by: Kent Overstreet commit b564513cf990d2d30305ac63a72a013fc197e7da Author: Kent Overstreet Date: Thu Nov 1 16:02:02 2018 -0400 bcachefs: fix bch2_bkey_print_bfloat was popping an assertion in the eytzinger code Signed-off-by: Kent Overstreet commit 5bd95a371856ef3ade9cb417a6151499672c8a90 Author: Kent Overstreet Date: Thu Nov 1 15:28:45 2018 -0400 bcachefs: new avoid mechanism for io retries Signed-off-by: Kent Overstreet commit 47799326bcdccd44f34845fd81814c1d3689a0a0 Author: Kent Overstreet Date: Thu Nov 1 15:21:48 2018 -0400 bcachefs: more key marking refactoring prep work for erasure coding Signed-off-by: Kent Overstreet commit 103e212785561df4ee3f29024868d8e3468f1f40 Author: Kent Overstreet Date: Tue Oct 30 14:32:21 2018 -0400 bcachefs: replicas: prep work for stripes Signed-off-by: Kent Overstreet commit 7a920560d727701c4397a5448085f99bf9f060d5 Author: Kent Overstreet Date: Tue Oct 30 14:14:19 2018 -0400 bcachefs: kill struct bch_replicas_cpu_entry Signed-off-by: Kent Overstreet commit 198d67006b6015724a840e8586a484c6590fc975 Author: Kent Overstreet Date: Sun Oct 21 16:32:51 2018 -0400 bcachefs: add functionality for heaps to update backpointers Signed-off-by: Kent Overstreet commit 2252aa271c1761589ae584ca738233c7d89c083c Author: Kent Overstreet Date: Sun Oct 21 10:56:11 2018 -0400 bcachefs: btree gc refactoring prep work for erasure coding Signed-off-by: Kent Overstreet commit abce30b79b6f9661c4a84f8f8ee20c26165b6f71 Author: Kent Overstreet Date: Sun Sep 30 18:39:20 2018 -0400 bcachefs: BCH_EXTENT_ENTRY_TYPES() Signed-off-by: Kent Overstreet commit 71c9e0ba427ae0572693c133e33dad30efaf3aba Author: Kent Overstreet Date: Thu Sep 27 21:08:39 2018 -0400 bcachefs: bch2_extent_ptr_decoded_append() This new helper for the move path avoids creating a new CRC entry when we already have one that matches the pointer being added. Signed-off-by: Kent Overstreet commit a2753581f6c5c05ea93978f8217a29115450ac58 Author: Kent Overstreet Date: Sun Sep 30 18:28:23 2018 -0400 bcachefs: bch2_extent_drop_ptrs() Signed-off-by: Kent Overstreet commit 1742237ba1db942b84a697509543fc5a9a25fcfa Author: Kent Overstreet Date: Thu Sep 27 21:08:39 2018 -0400 bcachefs: extent_for_each_ptr_decode() Signed-off-by: Kent Overstreet commit 642d66d1bbf930ae3b2f4a099cc1359b6489a3d5 Author: Kent Overstreet Date: Tue Oct 2 16:40:12 2018 -0400 bcachefs: kill bch_extent_crc_type Signed-off-by: Kent Overstreet commit 4cb13156665d73963fc608af0429d29fa77072c5 Author: Kent Overstreet Date: Tue Oct 2 11:03:39 2018 -0400 bcachefs: extent_ptr_decoded Signed-off-by: Kent Overstreet commit deb3318b0ea4b288431f09f8dbcf5de90a14b27b Author: Kent Overstreet Date: Fri Oct 12 14:57:57 2018 -0400 bcachefs: fix missing include Signed-off-by: Kent Overstreet commit 6278a46da3b39dee17d067a9634c3c68051e916e Author: Kent Overstreet Date: Fri Oct 12 14:53:25 2018 -0400 bcachefs: fix a spurious gcc warning Signed-off-by: Kent Overstreet commit ef337c54c6d18d4c6ce0aef8f4f327d4cf42ae08 Author: Kent Overstreet Date: Sat Oct 6 04:12:42 2018 -0400 bcachefs: Allocation code refactoring bch2_alloc_sectors_start() was a nightmare to work with - it's got some tricky stuff to do, since it wants to use the buckets the writepoint already has, unless they're not in the target it wants to write to, unless it can't allocate from any other devices in which case it will use those buckets if it has to - et cetera. This restructures the code to start with a new empty list of open buckets we're going to use for the new allocation, pulling buckets from the write point's list as we decide that we really are going to use them - making the code somewhat more functional and drastically easier to understand. Also fixes a bug where we could end up waiting on c->freelist_wait (because allocating from one device failed) but return success from bch2_bucket_alloc(), because allocating from a different device succeeded. Signed-off-by: Kent Overstreet commit 7b3f84ea7d3f9bcbb7f0f1264a4c228a27a32703 Author: Kent Overstreet Date: Sat Oct 6 00:46:55 2018 -0400 bcachefs: Split out alloc_background.c Signed-off-by: Kent Overstreet commit f43cc5be6e08bd3e0425cc848a7c2a4d3c1974f3 Author: Kent Overstreet Date: Mon Oct 1 00:33:42 2018 -0400 bcachefs: Fix failure to suspend Signed-off-by: Kent Overstreet commit c2fcff5973c93af7ffa87ad28eca2fddd2be83c5 Author: Kent Overstreet Date: Tue Sep 25 23:27:57 2018 -0400 bcachefs: Fix suspend when moving data faster than ratelimit Signed-off-by: Kent Overstreet commit d06182cadb5bbd9ab7fa3d3e59608bb573bffbee Author: Kent Overstreet Date: Fri Sep 21 17:37:13 2018 -0400 bcachefs: fix bch2_acl_chmod() Signed-off-by: Kent Overstreet commit 34b8e552764d6f759072b8452831c6f72a28111c Author: Kent Overstreet Date: Sat Sep 15 17:57:22 2018 -0400 bcachefs: Fix a deadlock Signed-off-by: Kent Overstreet commit cf0517af15e1ef43a0ece3e3dcbfc94a19e89bac Author: Kent Overstreet Date: Thu Sep 6 17:09:07 2018 -0400 bcachefs: fix a divide Signed-off-by: Kent Overstreet commit bc230209d36eec7f226e183dc2935857dc080464 Author: Kent Overstreet Date: Tue Aug 28 18:54:42 2018 -0400 bcachefs: make fsck spew less Signed-off-by: Kent Overstreet commit 741daa5be5c8d9cccaaac9759eb99893f1beb09b Author: Kent Overstreet Date: Tue Aug 21 19:42:00 2018 -0400 bcachefs: Dirent repair code There was a bug for awhile in previous kernels where we weren't computing dirent name lengths correctly and we weren't zeroing out padding at the end of dirents (due to struct bch_dirent changing size by adding __attribute__((aligned)), and not updating other code to use offsetof). This patch fixes dirents with junk at the end, by going off of the dirent's hash. Signed-off-by: Kent Overstreet commit cbdf24cef19be489f6885cecb4887fe407cebdfc Author: Kent Overstreet Date: Tue Aug 21 17:38:41 2018 -0400 bcachefs: Fix a btree iter bug when iter pos == POS_MAX Signed-off-by: Kent Overstreet commit a00fd8c535d91c59913756582ed9a4bfbb3c8a95 Author: Kent Overstreet Date: Tue Aug 21 16:30:14 2018 -0400 bcachefs: Comparison function cleanups Signed-off-by: Kent Overstreet commit f84306a5700fba38050ad14ab46ed86aea321aba Author: Kent Overstreet Date: Tue Aug 21 15:19:33 2018 -0400 bcachefs: Prioritize fragmentation in bucket allocator Signed-off-by: Kent Overstreet commit 216c9facfd7568f6b91d43784994830b235abd91 Author: Kent Overstreet Date: Sat Aug 11 19:12:05 2018 -0400 bcachefs: Pass around bset_tree less Signed-off-by: Kent Overstreet commit fc3268c13c1925df9bdc427ffe9bd5466f672b83 Author: Kent Overstreet Date: Wed Aug 8 19:53:30 2018 -0400 bcachefs: kill extent_insert_hook Signed-off-by: Kent Overstreet commit 190fa7af39a41867f98166661422f0cf84812358 Author: Kent Overstreet Date: Sun Aug 5 17:48:00 2018 -0400 bcachefs: kill i_sectors_hook Signed-off-by: Kent Overstreet commit 8ef231bd5174935686903888a73559503c3a2a64 Author: Kent Overstreet Date: Sat Aug 11 17:26:11 2018 -0400 bcachefs: convert fcollapse to bch2_extent_update() Signed-off-by: Kent Overstreet commit 5f461e01b830a6730765d4a19ab0865749733289 Author: Kent Overstreet Date: Wed Aug 8 21:11:43 2018 -0400 bcachefs: convert fpunch to bch2_extent_update() Signed-off-by: Kent Overstreet commit 54e2264e17941c3b21b1240d719cd2a3b330bec1 Author: Kent Overstreet Date: Wed Aug 8 21:09:31 2018 -0400 bcachefs: convert truncate to bch2_extent_update() Signed-off-by: Kent Overstreet commit 08af47dfc26e244160a9ff85e8181234190abf98 Author: Kent Overstreet Date: Wed Aug 8 18:42:04 2018 -0400 bcachefs: convert bchfs_write_index_update() to bch2_extent_update() Signed-off-by: Kent Overstreet commit e2d9912c6f25301923783e7e785870f821d31c40 Author: Kent Overstreet Date: Sun Aug 5 17:46:41 2018 -0400 bcachefs: bch2_extent_trim_atomic() Prep work for extents insert hook removal Signed-off-by: Kent Overstreet commit 581edb634140fe3da0bc3c8430116e735ebff897 Author: Kent Overstreet Date: Wed Aug 8 21:22:46 2018 -0400 bcachefs: mempoolify btree_trans Signed-off-by: Kent Overstreet commit cc1add4a80935e020b0aaf358b4341314abc7ef4 Author: Kent Overstreet Date: Sun Aug 5 15:21:52 2018 -0400 bcachefs: BTREE_INSERT_JOURNAL_RES_FULL is no longer possible Signed-off-by: Kent Overstreet commit df8a42393e038574a84d256720b2ba9745af0ad5 Author: Kent Overstreet Date: Sun Aug 5 15:28:29 2018 -0400 bcachefs: extent_squash() can no longer fail Signed-off-by: Kent Overstreet commit e4ccb251312003a9feed402e1958d0fef24987f1 Author: Kent Overstreet Date: Sun Aug 5 14:41:29 2018 -0400 bcachefs: make struct btree_iter a bit smaller Signed-off-by: Kent Overstreet commit 271a3d3a4b30dcd9fd274a923fb382f5f113d279 Author: Kent Overstreet Date: Thu Jul 21 19:05:06 2016 -0800 bcachefs: lift ordering restriction on 0 size extents This lifts the restriction that 0 size extents must not overlap with other extents, which means we can now sort extents and non extents the same way, and will let us simplify a bunch of other stuff as well. Signed-off-by: Kent Overstreet commit 0fdf18047fd38e7b5cc6adba3a81704c88333e1c Author: Kent Overstreet Date: Wed Aug 1 23:03:41 2018 -0400 bcachefs: extent unit tests Signed-off-by: Kent Overstreet commit 1fe08f31b2af8ca93e7ee211ac2799d2ef2aae24 Author: Kent Overstreet Date: Sun Aug 5 22:23:44 2018 -0400 bcachefs: bkey_written() also cleanups of btree node offsets Signed-off-by: Kent Overstreet commit 617391baa50c5bd8f239115bf4a7b45e1ee1bcaf Author: Kent Overstreet Date: Sun Aug 5 22:34:03 2018 -0400 bcachefs: improved rw_aux_tree_bsearch() shouldn't be any reason for an actual binary search here Signed-off-by: Kent Overstreet commit b0004d8dfac514f8591b8a45dc470becf3356150 Author: Kent Overstreet Date: Fri Aug 3 19:41:44 2018 -0400 bcachefs: Factor out btree_key_can_insert() working on getting rid of all the reasons bch2_insert_fixup_extent() can fail/stop partway, which is needed for other refactorings. One of the reasons we could have to bail out is if we're splitting a compressed extent we might need to add to our disk reservation - but we can check that before actually starting the insert. Signed-off-by: Kent Overstreet commit a50ed7c8e83e52dbfd54a47b5e123f85f5cd91f1 Author: Kent Overstreet Date: Tue Jul 24 14:55:05 2018 -0400 bcachefs: BCH_SB_RESERVE_BYTES Add an option, gc_reserve_bytes, to set the copygc reserve as a size instead of a percent Signed-off-by: Kent Overstreet commit a9bec5208b4379c87fa8361f813cb71b5581540e Author: Kent Overstreet Date: Wed Aug 1 14:26:55 2018 -0400 bcachefs: Better calculation of copygc threshold Signed-off-by: Kent Overstreet commit 6eac2c2e2440280ca551d4936807a8a130970469 Author: Kent Overstreet Date: Tue Jul 24 16:42:49 2018 -0400 bcachefs: Change how replicated data is accounted Due to compression, the different replicas of a replicated extent don't necessarily have to take up the same amount of space - so replicated data sector counts shouldn't be stored divided by the number of replicas. Signed-off-by: Kent Overstreet commit 5b650fd11a00271b9d4c033d1d0780826e050137 Author: Kent Overstreet Date: Tue Jul 24 14:54:39 2018 -0400 bcachefs: Account for internal fragmentation better Signed-off-by: Kent Overstreet commit 09f3297ac90aae99d8f7e776c8df5dd0d32c1ba9 Author: Kent Overstreet Date: Tue Jul 24 13:33:07 2018 -0400 bcachefs: kill s_alloc, use bch_data_type Signed-off-by: Kent Overstreet commit a7c7a3092eb2a0313b535d05fb98817ef1efed0c Author: Kent Overstreet Date: Tue Jul 24 12:59:13 2018 -0400 bcachefs: bch2_mark_key() now takes bch_data_type Signed-off-by: Kent Overstreet commit 647d7b60b193967f113a47fcfd20102c4498f109 Author: Kent Overstreet Date: Tue Jul 24 16:42:27 2018 -0400 bcachefs: Fix an assertion in the btree node merge path Signed-off-by: Kent Overstreet commit 94c1f4adec42c03c8fb1b7dc41f2fc07481a5395 Author: Kent Overstreet Date: Tue Jul 24 19:45:22 2018 -0400 bcachefs: Fix locking in allocator thread gc lock must be held while invalidating buckets - fixes "1f7a95698e bcachefs: Invalidate buckets when writing to alloc btree" Signed-off-by: Kent Overstreet commit 277c981c634f3e64dd99523aabfd9ed5e6c5be55 Author: Kent Overstreet Date: Mon Jul 23 09:13:07 2018 -0400 bcachefs: fix bch2_val_to_text() was returning wrong value Signed-off-by: Kent Overstreet commit bb1b3658aa7259bdacf7500abdeb8fdff61a51ba Author: Kent Overstreet Date: Mon Jul 23 07:53:29 2018 -0400 bcachefs: minor fsync fix Signed-off-by: Kent Overstreet commit 9c859dc91b5a85bab4dcb72087528c6cfd7207b4 Author: Kent Overstreet Date: Mon Jul 23 07:52:00 2018 -0400 bcachefs: Assorted journal refactoring Also improve error reporting - only return an error from bch2_journal_flush_seq() if we had an error writing that entry (i.e. not if there was an error with a newer entry). Signed-off-by: Kent Overstreet commit 60476b14b4c4e7a733047374aa135fb16c6ab340 Author: Kent Overstreet Date: Mon Jul 23 07:38:06 2018 -0400 bcachefs: fix last_seq_ondisk Signed-off-by: Kent Overstreet commit 658971f2769a8c9beaa09dd52218b5b2d17ca497 Author: Kent Overstreet Date: Mon Jul 23 05:48:53 2018 -0400 bcachefs: fix mtime/ctime update on truncate Signed-off-by: Kent Overstreet commit 73ab6f356db737d9997c830730ab927bbdf6b678 Author: Kent Overstreet Date: Mon Jul 23 05:48:35 2018 -0400 bcachefs: fix fsync after create Signed-off-by: Kent Overstreet commit 3142e7ef4b39f03c1e1aac90c2ac8f07f55ffa64 Author: Kent Overstreet Date: Mon Jul 23 05:28:40 2018 -0400 bcachefs: fix nbuckets usage on device resize Signed-off-by: Kent Overstreet commit b29e197aafd95fc5cd50f0fd85c6275e3aa319a6 Author: Kent Overstreet Date: Sun Jul 22 10:43:01 2018 -0400 bcachefs: Invalidate buckets when writing to alloc btree Prep work for persistent alloc information. Refactoring also lets us make free_inc much smaller, which means a lot fewer buckets stranded on freelists. Signed-off-by: Kent Overstreet commit b2be7c8b731262c5342e9f068b490d61e540ad0d Author: Kent Overstreet Date: Sun Jul 22 06:10:52 2018 -0400 bcachefs: kill bucket mark sector count saturation Signed-off-by: Kent Overstreet commit c6923995296e5f06a47aa36e684ef0eccd17adea Author: Kent Overstreet Date: Sat Jul 21 22:57:20 2018 -0400 bcachefs: don't call bch2_bucket_seq_cleanup from journal_buf_switch journal_buf_switch is called from the foreground when getting a journal reservation and thus is somewhat latency sensitive; bch2_bucket_seq_cleanup has to run infrequently but is a bit expensive when it does run. Call it from the journal write path instead, and punt the journal write to worqueue context. Signed-off-by: Kent Overstreet commit 8bb4dff72d07f4f46e5627870a9614c4cee5a1bb Author: Kent Overstreet Date: Sun Jul 22 13:04:00 2018 -0400 bcachefs: Fix an assertion Signed-off-by: Kent Overstreet commit d96b3ffe3884d8402ca64d1a1ae880460339ec63 Author: Kent Overstreet Date: Sun Jul 22 13:15:51 2018 -0400 bcachefs: fix rename + fsync Signed-off-by: Kent Overstreet commit 19ee5f2ac4b34658b417073f4edc27ade11a01ae Author: Kent Overstreet Date: Fri Jul 20 22:23:42 2018 -0400 bcachefs: Use ei_update_lock consistently This is prep work for using deferred btree updates for inode updates - the way inodes are done now we're relying on btree locking for ei_inode and ei_update_lock could probably be removed, but it'll actually be needed when we switch to deferred updates. Signed-off-by: Kent Overstreet commit fc88796d1ce84181bbf4fb3618305a417454b806 Author: Kent Overstreet Date: Tue Jul 17 15:28:11 2018 -0400 bcachefs: bch2_trans_update() now takes struct btree_insert_entry Signed-off-by: Kent Overstreet commit 2ea9004864b918be34e742e38fb08d868600d020 Author: Kent Overstreet Date: Tue Jul 17 14:12:42 2018 -0400 bcachefs: Fix mtime/ctime updates Also make inode flags consistent with how the rest of the inode is updated Signed-off-by: Kent Overstreet commit 4e1ec2cc0d82f1d4344e7b5a53229c9ccde8437d Author: Kent Overstreet Date: Tue Jul 17 14:03:47 2018 -0400 bcachefs: Simplify bch2_write_inode_trans, fix lockdep splat ei_update_lock isn't currently needed for write inode (but it will be needed again when deferred btree updates are used for inode updates) Signed-off-by: Kent Overstreet commit af1c6871814eb3088bcd3c2afd2fc4b7d4e4df97 Author: Kent Overstreet Date: Sat Jul 21 03:56:57 2018 -0400 bcachefs: add bch_verbose() statements for shutdown Signed-off-by: Kent Overstreet commit 4077991c8536595b50b52bab739ef1e9ac6a72cf Author: Kent Overstreet Date: Tue Jul 17 12:19:14 2018 -0400 bcachefs: Fix a use after free in the journal code Signed-off-by: Kent Overstreet commit 97446a242a56f9350be7b8985ed933fe9118f41e Author: Kent Overstreet Date: Fri Jul 20 22:08:17 2018 -0400 bcachefs: Fix device add Signed-off-by: Kent Overstreet commit 1c7a0adf3112090c42ef93ac84aad97bf4d414d3 Author: Kent Overstreet Date: Thu Jul 12 23:30:45 2018 -0400 bcachefs: trace transaction restarts exceptionally crappy "tracing", but it's a start at documenting the places restarts can be triggered Signed-off-by: Kent Overstreet commit d69f41d6bbd7849253cd823525543bd3a1a307f1 Author: Kent Overstreet Date: Thu Jul 12 19:19:41 2018 -0400 bcachefs: Convert raw uses of bch2_btree_iter_link() to new transactions Signed-off-by: Kent Overstreet commit 88c07f739786d00c7526d598956955c8310d72d2 Author: Kent Overstreet Date: Sat Jul 14 21:06:51 2018 -0400 bcachefs: Only check inode i_nlink during full fsck Now that all filesystem operatinos that manipulate the filesystem heirachy and i_nlink are fully atomic, we can add a feature bit to indicate i_nlink doesn't need to be checked. Signed-off-by: Kent Overstreet commit 1c6fdbd8f2465ddfb73a01ec620cbf3d14044e1a Author: Kent Overstreet Date: Thu Mar 16 22:18:50 2017 -0800 bcachefs: Initial commit Initially forked from drivers/md/bcache, bcachefs is a new copy-on-write filesystem with every feature you could possibly want. Website: https://bcachefs.org Signed-off-by: Kent Overstreet commit 0d29a833b7b1800bd2759bbc064b5ada4729caf5 Author: Kent Overstreet Date: Wed Apr 26 12:27:51 2023 -0400 MAINTAINERS: Add entry for bcachefs bcachefs is a new copy-on-write filesystem; add a MAINTAINERS entry for it. Signed-off-by: Kent Overstreet commit 723d346173e748c4fdb145b84f572b871ab4011a Author: Luca Weiss Date: Tue Oct 17 10:00:23 2023 +0200 soc: qcom: pmic_glink_altmode: Print return value on error It can be useful to know with which return value for example the typec_retimer_set call failed, so include this info in the dev_err prints. Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20231017-glink-altmode-ret-v2-1-921aa7cfc381@fairphone.com Signed-off-by: Bjorn Andersson commit d79a27ea8e35a2dfc02096d2937267912bcca022 Author: Bartosz Golaszewski Date: Tue Oct 17 11:27:20 2023 +0200 firmware: qcom: scm: remove unneeded 'extern' specifiers 'extern' specifiers do nothing for function declarations. Remove them from the private qcom-scm header. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney Tested-by: Andrew Halaney # sc8280xp-lenovo-thinkpad-x13s Link: https://lore.kernel.org/r/20231017092732.19983-4-brgl@bgdev.pl Signed-off-by: Bjorn Andersson commit 3294d01f7a5ddacb796d7f7bf31eb100a8f6d0e0 Author: Bartosz Golaszewski Date: Tue Oct 17 11:27:19 2023 +0200 firmware: qcom: scm: add a missing forward declaration for struct device We reference struct device in the private scm header but we neither include linux/device.h nor forward declare it. Fix it. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andrew Halaney Tested-by: Andrew Halaney # sc8280xp-lenovo-thinkpad-x13s Link: https://lore.kernel.org/r/20231017092732.19983-3-brgl@bgdev.pl Signed-off-by: Bjorn Andersson commit bdac188ec3c71800dd8419620224ee74ef37732a Author: Bartosz Golaszewski Date: Tue Oct 17 11:27:18 2023 +0200 firmware: qcom: move Qualcomm code into its own directory We're getting more and more qcom specific .c files in drivers/firmware/ and about to get even more. Create a separate directory for Qualcomm firmware drivers and move existing sources in there. Signed-off-by: Bartosz Golaszewski Acked-by: Elliot Berman Reviewed-by: Krzysztof Kozlowski Reviewed-by: Maximilian Luz Tested-by: Andrew Halaney # sc8280xp-lenovo-thinkpad-x13s Link: https://lore.kernel.org/r/20231017092732.19983-2-brgl@bgdev.pl Signed-off-by: Bjorn Andersson commit 8126cab004bab7b9d58b156435350379d88e8539 Author: Christoph Hellwig Date: Thu Oct 12 09:58:29 2023 +0200 m68k: remove unused includes from dma.c dma.c doesn't need most of the headers it includes. Also there is no point in undefining the DEBUG symbol given that it isn't used anywhere in this small file. Signed-off-by: Christoph Hellwig Reviewed-by: Geert Uytterhoeven Reviewed-by: Greg Ungerer Acked-by: Geert Uytterhoeven Tested-by: Greg Ungerer commit 7a360df941a4bd60847208de59f1ac8b166265a2 Author: Christoph Hellwig Date: Thu Oct 12 09:52:27 2023 +0200 m68k: don't provide arch_dma_alloc for nommu/coldfire Coldfire cores configured with a data cache can't provide coherent DMA allocations at all. Instead of returning non-coherent kernel memory in this case, return NULL and fail the allocation. The only driver that used to rely on the previous behavior (fec) has been switched to use non-coherent allocations for this case recently. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Ungerer Tested-by: Greg Ungerer commit ffd32a92b33b95771f63727560fa12c75191e705 Author: Christoph Hellwig Date: Mon Nov 21 10:46:09 2022 +0100 net: fec: use dma_alloc_noncoherent for data cache enabled coldfire Coldfire platforms with data caches can't properly implement dma_alloc_coherent and currently just return noncoherent memory from dma_alloc_coherent. The fec driver than works around this with a flush of all caches in the receive path. Make this hack a little less bad by using the explicit dma_alloc_noncoherent API and documenting the hacky cache flushes so that the DMA API level hack can be removed. Also replace the check for CONFIG_M532x for said hack with a check for COLDFIRE && !COLDFIRE_COHERENT_DMA. While m532x is the only such platform with a fec module, this makes the code more consistent and easier to follow. Signed-off-by: Christoph Hellwig Reviewed-by: Greg Ungerer Tested-by: Greg Ungerer commit 9e28bf8bdf2177a88bd6648fc741bc0280e08af8 Author: Christoph Hellwig Date: Tue Oct 17 16:04:42 2023 +0200 m68k: use the coherent DMA code for coldfire without data cache Coldfire cores configured without a data cache are DMA coherent and should thus simply use the simple coherent version of dma-direct. Introduce a new COLDFIRE_COHERENT_DMA Kconfig symbol as a convenient short hand for such configurations, and a M68K_NONCOHERENT_DMA symbol for all cases where we need to build non-coherent DMA infrastructure to simplify the Kconfig and code conditionals. Not building the non-coherent DMA code slightly reduces the code size for such configurations. Numers for m5249evb_defconfig below: text data bss dec hex filename 2896158 401052 65392 3362602 334f2a vmlinux.before 2895166 400988 65392 3361546 334b0a vmlinux.after Signed-off-by: Christoph Hellwig Reviewed-by: Greg Ungerer Acked-by: Geert Uytterhoeven Tested-by: Greg Ungerer commit 63f067e33c996a6e4d9a34d138116a43105182f1 Author: Christoph Hellwig Date: Fri Oct 6 15:17:54 2023 +0200 dma-direct: warn when coherent allocations aren't supported Log a warning once when dma_alloc_coherent fails because the platform does not support coherent allocations at all. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy Reviewed-by: Greg Ungerer Tested-by: Greg Ungerer commit b1da46d70e5427a9ba5eae28bcca29a20e68a442 Author: Christoph Hellwig Date: Fri Oct 6 15:13:34 2023 +0200 dma-direct: simplify the use atomic pool logic in dma_direct_alloc The logic in dma_direct_alloc when to use the atomic pool vs remapping grew a bit unreadable. Consolidate it into a single check, and clean up the set_uncached vs remap logic a bit as well. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy Reviewed-by: Greg Ungerer Tested-by: Greg Ungerer commit 2c8ed1b960fb97c82ede5afc974329bfdb457f5f Author: Christoph Hellwig Date: Thu Oct 5 09:05:36 2023 +0200 dma-direct: add a CONFIG_ARCH_HAS_DMA_ALLOC symbol Instead of using arch_dma_alloc if none of the generic coherent allocators are used, require the architectures to explicitly opt into providing it. This will used to deal with the case of m68knommu and coldfire where we can't do any coherent allocations whatsoever, and also makes it clear that arch_dma_alloc is a last resort. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy Reviewed-by: Greg Ungerer Tested-by: Greg Ungerer commit da323d4640704001f2287f729124e1cd9d5684d0 Author: Christoph Hellwig Date: Thu Oct 5 09:06:55 2023 +0200 dma-direct: add dependencies to CONFIG_DMA_GLOBAL_POOL CONFIG_DMA_GLOBAL_POOL can't be combined with other DMA coherent allocators. Add dependencies to Kconfig to document this, and make kconfig complain about unmet dependencies if someone tries. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy Reviewed-by: Lad Prabhakar Reviewed-by: Greg Ungerer Tested-by: Greg Ungerer commit 1e7bef5f90ed69d903768d78369f251b77e5d2f5 Author: Daeho Jeong Date: Fri Oct 20 09:36:45 2023 -0700 f2fs: finish previous checkpoints before returning from remount Flush remaining checkpoint requests at the end of remount, since a new checkpoint would be triggered while remount and we need to take care of it before returning from remount, in order to avoid the below race condition. - Thread - checkpoint thread do_remount() down_write(&sb->s_umount); f2fs_remount() f2fs_disable_checkpoint(sbi) -> add checkpoints to the list block_operations() down_read_trylock(&sb->s_umount) = 0 up_write(&sb->s_umount); f2fs_quota_sync() dquot_writeback_dquots() WARN_ON_ONCE(!rwsem_is_locked(&sb->s_umount)); Signed-off-by: Daeho Jeong Signed-off-by: Jaegeuk Kim commit 5e3704030b240ab6878c32abdc2e38b6bac9dfb8 Merge: e10f4019b18d3 5d4e1bf60664b Author: David S. Miller Date: Sun Oct 22 11:41:46 2023 +0100 Merge branch 'bnxt_en-next' Michael Chan says: ==================== bnxt_en: Update for net-next The first 2 patches are fixes for the recently added hwmon changes. The next 6 patches are enhancements to support ethtool lanes and all the proper supported and advertised link modes. Before these patches, the driver was only supporting the link modes for copper media. ==================== Signed-off-by: David S. Miller commit 5d4e1bf60664b5c62deebdb5857bcbf277fa944e Author: Edwin Peer Date: Fri Oct 20 14:27:57 2023 -0700 bnxt_en: extend media types to supported and autoneg modes The current driver code does not accurately report the supported and advertised link modes. It basically always assumes the media type is copper for any particular speed. Utilize the recently added link mode mappings to accurately report fully qualified ethtool link modes for advertised and supported speeds. If the media type is known, we will report the supported link modes for that media only. If the media is not known, we will report all possible supported link modes. The user can now specify any supported link modes (including NRZ and PAM4) to advertise for autoneg. It used to only accept copper NRZ modes. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 64d20aea6e4bb04fd52e25ea0058bb5767f92c40 Author: Edwin Peer Date: Fri Oct 20 14:27:56 2023 -0700 bnxt_en: convert to linkmode_set_bit() API Barring the BNXT_FW_TO_ETHTOOL speed macros, which will be removed in the next patch, update code to use the newer API. No functional change. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 5802e30317d94e77228db960c4786c40124b61e0 Author: Michael Chan Date: Fri Oct 20 14:27:55 2023 -0700 bnxt_en: Refactor NRZ/PAM4 link speed related logic Refactor some NRZ/PAM4 link speed related logic into helper functions. The NRZ and PAM4 link parameters are stored in separate structure fields. The driver logic has to check whether it is in NRZ or PAM4 mode and then use the appropriate field. Refactor this logic into helper functions for better readability. Reviewed-by: Damodharam Ammepalli Reviewed-by: Ajit Khaparde Reviewed-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 94c89e73d377a5ce34129f8211849879bb594120 Author: Edwin Peer Date: Fri Oct 20 14:27:54 2023 -0700 bnxt_en: refactor speed independent ethtool modes A future patch in this series will change the algorithm used to determine ethtool speed and media modes. Extract the handling of the unrelated pause, autoneg modes into an independent function. Also separate FEC handling out of bnxt_fw_to_ethtool_*_spds(). No functional change. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit d6263677bb1b1cee129ad7f62f6ffa3734b34e5e Author: Edwin Peer Date: Fri Oct 20 14:27:53 2023 -0700 bnxt_en: support lane configuration via ethtool Recent kernels support changing the number of link lanes via ethtool. This is useful for determining the appropriate signal mode to use when a given link speed can be achieved using different lane configurations. Accept the ethtool lanes parameter when configuring forced speed. If there is no lanes parameter, select a default. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit ecdad2a6921417c539e2f414b8b311501dc2dff0 Author: Edwin Peer Date: Fri Oct 20 14:27:52 2023 -0700 bnxt_en: add infrastructure to lookup ethtool link mode Add infrastructure to look up the enum ethtool_link_mode_bit_indices from link information provided by the firmware. The link speed, signal mode, and media type returned by firmware will be used to look up the ethtool link mode. The immediate benefit is that once the link mode is determined, we can now use ethtool_params_from_link_mode() to fill the basic ethtool parameters including the number of lanes. Lanes will be fully supported in the next patch. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit fd78ec3fbc470d33c42a312fd22506e3f3704374 Author: Kalesh AP Date: Fri Oct 20 14:27:51 2023 -0700 bnxt_en: Fix invoking hwmon_notify_event FW sends the async event to the driver when the device temperature goes above or below the threshold values. Only notify hwmon if the temperature is increasing to the next alert level, not when it is decreasing. Cc: Guenter Roeck Reviewed-by: Kashyap Desai Reviewed-by: Somnath Kotur Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 55862094a9d0d14f607eec00b925401407d61070 Author: Kalesh AP Date: Fri Oct 20 14:27:50 2023 -0700 bnxt_en: Do not call sleeping hwmon_notify_event() from NAPI Defer hwmon_notify_event() to bnxt_sp_task() workqueue because hwmon_notify_event() can try to acquire a mutex shown in the stack trace below. Modify bnxt_event_error_report() to return true if we need to schedule bnxt_sp_task() to notify hwmon. __schedule+0x68/0x520 hwmon_notify_event+0xe8/0x114 schedule+0x60/0xe0 schedule_preempt_disabled+0x28/0x40 __mutex_lock.constprop.0+0x534/0x550 __mutex_lock_slowpath+0x18/0x20 mutex_lock+0x5c/0x70 kobject_uevent_env+0x2f4/0x3d0 kobject_uevent+0x10/0x20 hwmon_notify_event+0x94/0x114 bnxt_hwmon_notify_event+0x40/0x70 [bnxt_en] bnxt_event_error_report+0x260/0x290 [bnxt_en] bnxt_async_event_process.isra.0+0x250/0x850 [bnxt_en] bnxt_hwrm_handler.isra.0+0xc8/0x120 [bnxt_en] bnxt_poll_p5+0x150/0x350 [bnxt_en] __napi_poll+0x3c/0x210 net_rx_action+0x308/0x3b0 __do_softirq+0x120/0x3e0 Cc: Guenter Roeck Fixes: a19b4801457b ("bnxt_en: Event handler for Thermal event") Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 5d9f6f26ec6656b43bf90f12705dbe88ce77f8d5 Author: Gilbert Adikankwu Date: Sun Oct 22 00:12:31 2023 +0100 staging: vt6655: Rename variable byEIFS Remove byte Type encoding "by" from variable name and replace camelcase with snakecase. Fix checkpatch.pl error: CHECK: Avoid CamelCase: Signed-off-by: Gilbert Adikankwu Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/4428aa96453516b6706b1a834c46e3f6e70b5828.1697927812.git.gilbertadikankwu@gmail.com Signed-off-by: Greg Kroah-Hartman commit 30af3e57580d93bab1929e3b7cbed9177a8a6cef Author: Gilbert Adikankwu Date: Sun Oct 22 00:12:30 2023 +0100 staging: vt6655: Rename variable byDIFS Remove byte Type encoding "by" from variable name and replace camelcase with snakecase Fix checkpatch.pl error: CHECK: Avoid CamelCase: Signed-off-by: Gilbert Adikankwu Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/f10775da0decdbbec33d38236cdf89bcd8ab591e.1697927812.git.gilbertadikankwu@gmail.com Signed-off-by: Greg Kroah-Hartman commit d988a485f5940e119d6de4f2b17ea0a1dfc7db4f Author: Gilbert Adikankwu Date: Sun Oct 22 00:12:29 2023 +0100 staging: vt6655: Rename variable bySIFS Remove byte Type encoding "by" from variable name and replace camelcase with snakecase Fix checkpatch.pl error: CHECK: Avoid CamelCase: Signed-off-by: Gilbert Adikankwu Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/f75f308f187fa9a9e14bf25db006131e2dcda43b.1697927812.git.gilbertadikankwu@gmail.com Signed-off-by: Greg Kroah-Hartman commit e59314b68cc7ab639bfe1bf658a619b4b8b3ce4e Author: Gilbert Adikankwu Date: Sun Oct 22 00:12:28 2023 +0100 staging: vt6655: Rename variable bySlot Remove byte Type encoding "by" from variable name and replace camelcase with snakecase. Fix checkpatch.pl error: CHECK: Avoid CamelCase: Signed-off-by: Gilbert Adikankwu Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/57a1a08fba23d8da8ed1411d84f31f074f510444.1697927812.git.gilbertadikankwu@gmail.com Signed-off-by: Greg Kroah-Hartman commit 25b8c77ecdd39eb8afb4e3be001f6f7baf12acda Author: Gilbert Adikankwu Date: Sun Oct 22 00:12:27 2023 +0100 staging: vt6655: Rename variable byCWMaxMin Remove byte Type encoding "by" from variable name and replace camelcase with snakecase Fix checkpatch.pl error: CHECK: Avoid CamelCase: Signed-off-by: Gilbert Adikankwu Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/ed8ff47e7ee3a03d8c8c3cc43b4773bb1eb01f16.1697927812.git.gilbertadikankwu@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7060d3ccdd4cf042749664d2fe93f978a777e3e9 Author: Arnd Bergmann Date: Fri Oct 20 15:12:57 2023 +0200 apparmor: mark new functions static Two new functions were introduced as global functions when they are only called from inside the file that defines them and should have been static: security/apparmor/lsm.c:658:5: error: no previous prototype for 'apparmor_uring_override_creds' [-Werror=missing-prototypes] security/apparmor/lsm.c:682:5: error: no previous prototype for 'apparmor_uring_sqpoll' [-Werror=missing-prototypes] Fixes: c4371d90633b7 ("apparmor: add io_uring mediation") Signed-off-by: Arnd Bergmann Signed-off-by: John Johansen commit 9040c0d96fd66e84bb9b017b821e31f2876e949c Author: Nathan Chancellor Date: Fri Oct 20 15:17:02 2023 -0700 RDMA/bnxt_re: Fix clang -Wimplicit-fallthrough in bnxt_re_handle_cq_async_error() Clang warns (or errors with CONFIG_WERROR=y): drivers/infiniband/hw/bnxt_re/main.c:1114:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] 1114 | default: | ^ drivers/infiniband/hw/bnxt_re/main.c:1114:2: note: insert 'break;' to avoid fall-through 1114 | default: | ^ | break; 1 error generated. Clang is a little more pedantic than GCC, which does not warn when falling through to a case that is just break or return. Clang's version is more in line with the kernel's own stance in deprecated.rst, which states that all switch/case blocks must end in either break, fallthrough, continue, goto, or return. Add the missing break to silence the warning. Closes: https://github.com/ClangBuiltLinux/linux/issues/1950 Fixes: b02fd3f79ec3 ("RDMA/bnxt_re: Report async events and errors") Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20231020-bnxt_re-implicit-fallthrough-v1-1-b5c19534a6c9@kernel.org Signed-off-by: Leon Romanovsky commit 2e84dc37920012b458e9458b19fc4ed33f81bc74 Author: Saravana Kannan Date: Tue Oct 17 18:38:50 2023 -0700 driver core: Release all resources during unbind before updating device links This commit fixes a bug in commit 9ed9895370ae ("driver core: Functional dependencies tracking support") where the device link status was incorrectly updated in the driver unbind path before all the device's resources were released. Fixes: 9ed9895370ae ("driver core: Functional dependencies tracking support") Cc: stable Reported-by: Uwe Kleine-König Closes: https://lore.kernel.org/all/20231014161721.f4iqyroddkcyoefo@pengutronix.de/ Signed-off-by: Saravana Kannan Cc: Thierry Reding Cc: Yang Yingliang Cc: Andy Shevchenko Cc: Mark Brown Cc: Matti Vaittinen Cc: James Clark Acked-by: "Rafael J. Wysocki" Tested-by: Uwe Kleine-König Acked-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231018013851.3303928-1-saravanak@google.com Signed-off-by: Greg Kroah-Hartman commit 28f2d57d88a71353eb1f1952d1ac4a7816612087 Author: Maurizio Lombardi Date: Fri Oct 20 18:00:42 2023 +0200 driver core: class: remove boilerplate code Jump to err_out to avoid duplicating the code. Signed-off-by: Maurizio Lombardi Link: https://lore.kernel.org/r/20231020160042.759439-1-mlombard@redhat.com Signed-off-by: Greg Kroah-Hartman commit 421359cbdbdcaea93b83e1e6b61eb261b75b1998 Author: Andy Shevchenko Date: Wed Oct 18 17:59:48 2023 +0300 parport: Drop even more unneeded NULL or 0 assignments kzalloc() gives us a zeroed memory, no need to explicitly assing 0 or NULL or similar to the members of the data structure that has been allocated with the above mentioned API. Note, the initializstion of full_list member is not needed anymore as list_add_tail will rewrite the contents of the prev and next pointers. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231018145948.1367648-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 12280cc708f28357e7ad85bab2bcc3715e59a8f7 Author: Andy Shevchenko Date: Wed Oct 18 17:59:47 2023 +0300 parport: Clean up resources correctly when parport_register_port() fails The smatch warns about uncleaned resources in case the parport_register_port() fails: parport_register_port() warn: '&tmp->full_list' not removed from list This is indeed an issue introduced when converting code to use kasprintf(). However, the whole kasprintf() dance in this case is not needed as dev_set_name() can handle the formatted input and produces the same result. So, the solution is to delegate name forming to the dev_set_name() and make device_register() error path to deal with error handling (via put_device() call). Fixes: 8d8ae17eb0de ("parport: Use kasprintf() instead of fixed buffer formatting") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202310180809.hepZB9k6-lkp@intel.com/ Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231018145948.1367648-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 63ba2d07b4be72b94216d20561f43e1150b25d98 Author: Sanjuán García, Jorge Date: Thu Oct 19 14:15:34 2023 +0000 mcb: fix error handling for different scenarios when parsing chameleon_parse_gdd() may fail for different reasons and end up in the err tag. Make sure we at least always free the mcb_device allocated with mcb_alloc_dev(). If mcb_device_register() fails, make sure to give up the reference in the same place the device was added. Fixes: 728ac3389296 ("mcb: mcb-parse: fix error handing in chameleon_parse_gdd()") Cc: stable Reviewed-by: Jose Javier Rodriguez Barbarin Signed-off-by: Jorge Sanjuan Garcia Link: https://lore.kernel.org/r/20231019141434.57971-2-jorge.sanjuangarcia@duagon.com Signed-off-by: Greg Kroah-Hartman commit 28cbfe09ff20964d293cd7af10d2ec0782cf86cb Author: Rodríguez Barbarin, José Javier Date: Fri Oct 20 12:44:32 2023 +0000 mcb: Use the actual bus passed to init and release functions The functions mcb_bus_add_devices() and mcb_devices_unregister() take a mcb_bus as argument that is never being used. This implies that there is only one bus. Do not ignore mcb_bus parameter and get the actual bus_type from the device related to this mcb_bus. Co-developed-by: Jorge Sanjuan Garcia Signed-off-by: Jorge Sanjuan Garcia Signed-off-by: Jose Javier Rodriguez Barbarin Link: https://lore.kernel.org/r/20231020124324.54692-2-JoseJavier.Rodriguez@duagon.com Signed-off-by: Greg Kroah-Hartman commit e63771781beadbdef537f6de36f62c8e672a5b8f Author: Michael Straube Date: Sat Oct 21 14:19:47 2023 +0200 staging: rtl8192e: clean up comparisons to NULL Clean up comparisons to NULL to improve readability. Reported by checkpatch. if (x == NULL) -> if (!x) if (x != NULL) -> if (x) Signed-off-by: Michael Straube Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20231021121947.14516-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit e0e6373d653b7707bf042ecf1538884597c5d0da Author: Kathiravan Thirumoorthy Date: Thu Sep 14 12:29:57 2023 +0530 clk: qcom: apss-ipq6018: add the GPLL0 clock also as clock provider While the kernel is booting up, APSS PLL will be running at 800MHz with GPLL0 as source. Once the cpufreq driver is available, APSS PLL will be configured and select the rate based on the opp table and the source will be changed to APSS_PLL_EARLY. Without this patch, CPU Freq driver reports that CPU is running at 24MHz instead of the 800MHz. Reviewed-by: Konrad Dybcio Tested-by: Robert Marko Signed-off-by: Kathiravan Thirumoorthy Link: https://lore.kernel.org/r/20230913-gpll_cleanup-v2-7-c8ceb1a37680@quicinc.com Signed-off-by: Bjorn Andersson commit 5635ef0bd1052420bc659a00be6fd0c60cec5cb9 Author: Kathiravan Thirumoorthy Date: Thu Sep 14 12:29:55 2023 +0530 clk: qcom: ipq5332: drop the CLK_SET_RATE_PARENT flag from GPLL clocks GPLL clock rates are fixed and shouldn't be scaled based on the request from dependent clocks. Doing so will result in the unexpected behaviour. So drop the CLK_SET_RATE_PARENT flag from the GPLL clocks. Fixes: 3d89d52970fd ("clk: qcom: add Global Clock controller (GCC) driver for IPQ5332 SoC") Signed-off-by: Kathiravan Thirumoorthy Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230913-gpll_cleanup-v2-5-c8ceb1a37680@quicinc.com Signed-off-by: Bjorn Andersson commit 99a8f8764b70158a712992640a6be46a8fd79d15 Author: Kathiravan Thirumoorthy Date: Thu Sep 14 12:29:54 2023 +0530 clk: qcom: ipq9574: drop the CLK_SET_RATE_PARENT flag from GPLL clocks GPLL clock rates are fixed and shouldn't be scaled based on the request from dependent clocks. Doing so will result in the unexpected behaviour. So drop the CLK_SET_RATE_PARENT flag from the GPLL clocks. ---- Changes in V2: - No changes Fixes: d75b82cff488 ("clk: qcom: Add Global Clock Controller driver for IPQ9574") Signed-off-by: Kathiravan Thirumoorthy Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230913-gpll_cleanup-v2-4-c8ceb1a37680@quicinc.com Signed-off-by: Bjorn Andersson commit 01a5e4c6731ab6b4b74822661d296f8893fc1230 Author: Kathiravan Thirumoorthy Date: Thu Sep 14 12:29:53 2023 +0530 clk: qcom: ipq5018: drop the CLK_SET_RATE_PARENT flag from GPLL clocks GPLL clock rates are fixed and shouldn't be scaled based on the request from dependent clocks. Doing so will result in the unexpected behaviour. So drop the CLK_SET_RATE_PARENT flag from the GPLL clocks. ---- Changes in V2: - New patch Fixes: e3fdbef1bab8 ("clk: qcom: Add Global Clock controller (GCC) driver for IPQ5018") Signed-off-by: Kathiravan Thirumoorthy Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230913-gpll_cleanup-v2-3-c8ceb1a37680@quicinc.com Signed-off-by: Bjorn Andersson commit 99cd4935cb972d0aafb16838bb2aeadbcaf196ce Author: Kathiravan Thirumoorthy Date: Thu Sep 14 12:29:52 2023 +0530 clk: qcom: ipq6018: drop the CLK_SET_RATE_PARENT flag from PLL clocks GPLL, NSS crypto PLL clock rates are fixed and shouldn't be scaled based on the request from dependent clocks. Doing so will result in the unexpected behaviour. So drop the CLK_SET_RATE_PARENT flag from the PLL clocks. Cc: stable@vger.kernel.org Fixes: d9db07f088af ("clk: qcom: Add ipq6018 Global Clock Controller support") Signed-off-by: Kathiravan Thirumoorthy Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230913-gpll_cleanup-v2-2-c8ceb1a37680@quicinc.com Signed-off-by: Bjorn Andersson commit e641a070137dd959932c7c222e000d9d941167a2 Author: Kathiravan Thirumoorthy Date: Thu Sep 14 12:29:51 2023 +0530 clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks GPLL, NSS crypto PLL clock rates are fixed and shouldn't be scaled based on the request from dependent clocks. Doing so will result in the unexpected behaviour. So drop the CLK_SET_RATE_PARENT flag from the PLL clocks. Cc: stable@vger.kernel.org Fixes: b8e7e519625f ("clk: qcom: ipq8074: add remaining PLL’s") Signed-off-by: Kathiravan Thirumoorthy Link: https://lore.kernel.org/r/20230913-gpll_cleanup-v2-1-c8ceb1a37680@quicinc.com Signed-off-by: Bjorn Andersson commit 3dcf7b59393812a5fbd83f8cd8d34b94afb4c4d1 Author: Robert Marko Date: Sat Oct 21 13:55:18 2023 +0200 clk: qcom: gcc-ipq6018: add QUP6 I2C clock QUP6 I2C clock is listed in the dt bindings but it was never included in the GCC driver. So lets add support for it, it is marked as criticial as it is used by RPM to communicate to the external PMIC over I2C so this clock must not be disabled. Signed-off-by: Robert Marko Reviewed-by: Kathiravan Thirumoorthy Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231021115545.229060-1-robimarko@gmail.com Signed-off-by: Bjorn Andersson commit 80e56b86b59e74ca388c72b404aa32dde19de199 Author: Heiner Kallweit Date: Tue Oct 10 21:27:44 2023 +0200 i2c: i801: Simplify class-based client device instantiation Now that the legacy eeprom driver was removed, the only remaining i2c client driver with class SPD autodetection is jc42, and this driver supports also class HWMON. Therefore we can remove class SPD from the supported classes of the i801 adapter driver. Legacy class-based instantiation shouldn't be used in new code, so I think we can remove also the generic logic that ensures that supported classes of parent and muxed adapters don't overlap. Note: i801 parent supports just class HWMON now, and muxed childs class SPD, so the supported classes don't overlap. Signed-off-by: Heiner Kallweit Reviewed-by: Jean Delvare Acked-by: Andi Shyti Signed-off-by: Wolfram Sang commit 445094c8a9fb1ea644aa4e78ba47ccad1cf6c9f5 Author: Marek Szyprowski Date: Fri Oct 6 17:08:03 2023 +0200 i2c: exynos5: add support for atomic transfers Add support for atomic transfers using polling mode with interrupts intentionally disabled. This removes the warning introduced by commit 63b96983a5dd ("i2c: core: introduce callbacks for atomic transfers") during system reboot and power-off. Signed-off-by: Marek Szyprowski Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 29c9e85d4da2b401b430aa0989932992431745ec Author: Andi Shyti Date: Mon Jun 12 00:56:50 2023 +0200 i2c: at91-core: Use devm_clk_get_enabled() Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti Acked-by: Nicolas Ferre [wsa: rebased] Signed-off-by: Wolfram Sang commit ba63f9933dceebe17d383e4bb390ae1f3c583e15 Merge: 3e383dce513f4 3774740fb2216 Author: Wolfram Sang Date: Sat Oct 21 19:58:59 2023 +0200 Merge tag 'at24-updates-for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-mergewindow at24 updates for v6.7 - support the write-lockable pages on two more models - drop at24_get_chip_data() - use the new __counted_by() attribute in struct at24_data commit 0720219f4d34a88a9badb4de70cfad7585687d48 Author: Rob Herring Date: Fri Oct 20 11:55:45 2023 +0100 nvmem: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20231020105545.216052-7-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 716a8027efbb84291111764847d37cb0648ef69b Author: Rob Herring Date: Fri Oct 20 11:55:44 2023 +0100 dt-bindings: nvmem: u-boot,env: Add missing additionalProperties on child node schemas Just as unevaluatedProperties or additionalProperties are required at the top level of schemas, they should (and will) also be required for child node schemas. That ensures only documented properties are present for any node. Signed-off-by: Rob Herring Acked-by: Conor Dooley Acked-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20231020105545.216052-6-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit c5330723d5a0c77299a38a46e5611a584e887b87 Author: Rafał Miłecki Date: Fri Oct 20 11:55:42 2023 +0100 dt-bindings: nvmem: move deprecated cells binding to its own file Support for old NVMEM fixed cells was deprecated in favour of "fixed-layout". It's still part of the nvmem.yaml though and may be unknowingly used by new bindings added without much of analyze. To make it more difficult to accidentally support old syntax move its binding to separated file with "deprecated" in its name. Signed-off-by: Rafał Miłecki Acked-by: Neil Armstrong Reviewed-by: Rob Herring Acked-by: Heiko Stuebner Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20231020105545.216052-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 2cc3b37f5b6df8189d55d0e812d9658ce256dfec Author: Rafał Miłecki Date: Fri Oct 20 11:55:41 2023 +0100 nvmem: add explicit config option to read old syntax fixed OF cells Binding for fixed NVMEM cells defined directly as NVMEM device subnodes has been deprecated. It has been replaced by the "fixed-layout" NVMEM layout binding. New syntax is meant to be clearer and should help avoiding imprecise bindings. NVMEM subsystem already supports the new binding. It should be a good idea to limit support for old syntax to existing drivers that actually support & use it (we can't break backward compatibility!). That way we additionally encourage new bindings & drivers to ignore deprecated binding. It wasn't clear (to me) if rtc and w1 code actually uses old syntax fixed cells. I enabled them to don't risk any breakage. Signed-off-by: Rafał Miłecki [for meson-{efuse,mx-efuse}.c] Acked-by: Martin Blumenstingl [for mtk-efuse.c, nvmem/core.c, nvmem-provider.h] Reviewed-by: AngeloGioacchino Del Regno [MT8192, MT8195 Chromebooks] Tested-by: AngeloGioacchino Del Regno [for microchip-otpc.c] Reviewed-by: Claudiu Beznea [SAMA7G5-EK] Tested-by: Claudiu Beznea Acked-by: Jernej Skrabec Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20231020105545.216052-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 16724d6ea40a2c9315f5a0d81005dfa4d7a6da24 Author: Luca Weiss Date: Fri Oct 20 11:55:40 2023 +0100 nvmem: qfprom: Mark core clk as optional On some platforms like sc7280 on non-ChromeOS devices the core clock cannot be touched by Linux so we cannot provide it. Mark it as optional as accessing qfprom for reading works without it but we still prohibit writing if we cannot provide the clock. Signed-off-by: Luca Weiss Reviewed-by: Douglas Anderson Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20231020105545.216052-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 936323f8de4139c9f6ebc0d08e20f1fe200b78a8 Author: André Draszik Date: Thu Oct 19 11:06:39 2023 +0100 dt-bindings: serial: drop unsupported samsung bindings Now that no implementation exists anymore for samsung,s3c24(1[02]|40)-uart, remove those bindings from here as well. Signed-off-by: André Draszik Reviewed-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231019100639.4026283-2-andre.draszik@linaro.org Signed-off-by: Greg Kroah-Hartman commit 9cffa831f0685c60c8ca743986a24b153b440fed Author: André Draszik Date: Thu Oct 19 11:06:38 2023 +0100 tty: serial: samsung: drop earlycon support for unsupported platforms Commit 1ea35b355722 ("ARM: s3c: remove s3c24xx specific hacks") removed support here for several old platforms, but kept support for earlycon for those same platforms. As earlycon support for otherwise unsupported platforms doesn't seem to be useful, just drop it as well. Suggested-by: Krzysztof Kozlowski Signed-off-by: André Draszik Reviewed-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20231019100639.4026283-1-andre.draszik@linaro.org Signed-off-by: Greg Kroah-Hartman commit f16f577b33674de13afbd1376e0ad9ce55d121d6 Author: Cameron Williams Date: Fri Oct 20 17:03:14 2023 +0100 tty: 8250: Add note for PX-835 The PX-835 and PX-846 are variants of each other, clarify that in the comment for the card. This patch makes no functional difference. Signed-off-by: Cameron Williams Link: https://lore.kernel.org/r/DU0PR02MB78998840C2EBED91AABD4494C4DBA@DU0PR02MB7899.eurprd02.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 95d2232a6889e457eda8888e1f483eb4ac7c4a75 Author: Cameron Williams Date: Fri Oct 20 17:03:07 2023 +0100 tty: 8250: Fix IS-200 PCI ID comment Fix the PCI comment for the IS-200 card. The PCI ID for the IS-200 is 0x0d80, and the definition used (PCI_DEVICE_ID_INTASHIELD_IS200) is indeed 0x0d80, clarify that by fixing the comment as its neighbouring cards are all at 0x0020 offsets. Signed-off-by: Cameron Williams Link: https://lore.kernel.org/r/DU0PR02MB78993B6AD85F6550AF6590FBC4DBA@DU0PR02MB7899.eurprd02.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit e4876dacaca46a1b09f9b417480924ab12019a5b Author: Cameron Williams Date: Fri Oct 20 17:03:17 2023 +0100 tty: 8250: Add Brainboxes Oxford Semiconductor-based quirks Some of the later revisions of the Brainboxes PX cards are based on the Oxford Semiconductor chipset. Due to the chip's unique setup these cards need to be initialised. Previously these were tested against a reference card with the same broken baudrate on another PC, cancelling out the effect. With this patch they work and can transfer/receive find against an FTDI-based device. Add all of the cards which require this setup to the quirks table. Thanks to Maciej W. Rozycki for clarification on this chip. Fixes: ef5a03a26c87 ("tty: 8250: Add support for Brainboxes PX cards.") Cc: stable@vger.kernel.org Signed-off-by: Cameron Williams Link: https://lore.kernel.org/r/DU0PR02MB7899D222A4AB2A4E8C57108FC4DBA@DU0PR02MB7899.eurprd02.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 62d2ec2ded278c7512d91ca7bf8eb9bac46baf90 Author: Cameron Williams Date: Fri Oct 20 17:03:16 2023 +0100 tty: 8250: Add support for Intashield IX cards Add support for the IX-100, IX-200 and IX-400 serial cards. Cc: stable@vger.kernel.org Signed-off-by: Cameron Williams Link: https://lore.kernel.org/r/DU0PR02MB7899614E5837E82A03272A4BC4DBA@DU0PR02MB7899.eurprd02.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 9604884e592cd04ead024c9737c67a77f175cab9 Author: Cameron Williams Date: Fri Oct 20 17:03:15 2023 +0100 tty: 8250: Add support for additional Brainboxes PX cards Add support for some more of the Brainboxes PX (PCIe) range of serial cards, namely PX-275/PX-279, PX-475 (serial port, not LPT), PX-820, PX-803/PX-857 (additional ID). Cc: stable@vger.kernel.org Signed-off-by: Cameron Williams Link: https://lore.kernel.org/r/DU0PR02MB78996BEC353FB346FC35444BC4DBA@DU0PR02MB7899.eurprd02.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit ee61337b934c99c2611e0a945d592019b2e00c82 Author: Cameron Williams Date: Fri Oct 20 17:03:13 2023 +0100 tty: 8250: Fix up PX-803/PX-857 The PX-803/PX-857 are variants of each other, add a note. Additionally fix up the port counts for the card (2, not 1). Fixes: ef5a03a26c87 ("tty: 8250: Add support for Brainboxes PX cards.") Cc: stable@vger.kernel.org Signed-off-by: Cameron Williams Link: https://lore.kernel.org/r/DU0PR02MB789978C8ED872FB4B014E132C4DBA@DU0PR02MB7899.eurprd02.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit d0ff5b24c2f112f29dea4c38b3bac9597b1be9ba Author: Cameron Williams Date: Fri Oct 20 17:03:12 2023 +0100 tty: 8250: Fix port count of PX-257 The port count of the PX-257 Rev3 is actually 2, not 4. Fixes: ef5a03a26c87 ("tty: 8250: Add support for Brainboxes PX cards.") Cc: stable@vger.kernel.org Signed-off-by: Cameron Williams Link: https://lore.kernel.org/r/DU0PR02MB7899C804D9F04E727B5A0E8FC4DBA@DU0PR02MB7899.eurprd02.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 4d994e3cf1b541ff32dfb03fbbc60eea68f9645b Author: Cameron Williams Date: Fri Oct 20 17:03:11 2023 +0100 tty: 8250: Add support for Intashield IS-100 Add support for the Intashield IS-100 1 port serial card. Cc: stable@vger.kernel.org Signed-off-by: Cameron Williams Link: https://lore.kernel.org/r/DU0PR02MB7899A0E0CDAA505AF5A874CDC4DBA@DU0PR02MB7899.eurprd02.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 2c6fec1e1532f15350be7e14ba6b88a39d289fe4 Author: Cameron Williams Date: Fri Oct 20 17:03:10 2023 +0100 tty: 8250: Add support for Brainboxes UP cards Add support for the Brainboxes UP (powered PCI) range of cards, namely UP-189, UP-200, UP-869 and UP-880. Cc: stable@vger.kernel.org Signed-off-by: Cameron Williams Link: https://lore.kernel.org/r/DU0PR02MB7899B5B59FF3D8587E88C117C4DBA@DU0PR02MB7899.eurprd02.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit c563db486db7d245c0e2f319443417ae8e692f7f Author: Cameron Williams Date: Fri Oct 20 17:03:09 2023 +0100 tty: 8250: Add support for additional Brainboxes UC cards Add device IDs for some more Brainboxes UC cards, namely UC-235/UC-246, UC-253/UC-734, UC-302, UC-313, UC-346, UC-357, UC-607 and UC-836. Cc: stable@vger.kernel.org Signed-off-by: Cameron Williams Link: https://lore.kernel.org/r/DU0PR02MB789969998A6C3FAFCD95C85DC4DBA@DU0PR02MB7899.eurprd02.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 33092fb3af51deb80849e90a17bada44bbcde6b3 Author: Cameron Williams Date: Fri Oct 20 17:03:08 2023 +0100 tty: 8250: Remove UC-257 and UC-431 The UC-257 is a serial + LPT card, so remove it from this driver. A patch has been submitted to add it to parport_serial instead. Additionaly, the UC-431 does not use this card ID, only the UC-420 does. The 431 is a 3-port card and there is no generic 3-port configuration available, so remove reference to it from this driver. Fixes: 152d1afa834c ("tty: Add support for Brainboxes UC cards.") Cc: stable@vger.kernel.org Signed-off-by: Cameron Williams Link: https://lore.kernel.org/r/DU0PR02MB78995ADF7394C74AD4CF3357C4DBA@DU0PR02MB7899.eurprd02.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 68e6939ea9ec3d6579eadeab16060339cdeaf940 Author: Thomas Richard Date: Tue Oct 17 15:05:40 2023 +0200 serial: 8250_omap: Set the console genpd always on if no console suspend If the console suspend is disabled, the genpd of the console shall not be powered-off during suspend. Set the flag GENPD_FLAG_ALWAYS_ON to the corresponding genpd during suspend, and restore the original value during the resume. Signed-off-by: Thomas Richard Link: https://lore.kernel.org/r/20231017130540.1149721-1-thomas.richard@bootlin.com Signed-off-by: Greg Kroah-Hartman commit a30badfd7c13fc8763a9e10c5a12ba7f81515a55 Author: David Woodhouse Date: Fri Oct 20 17:15:29 2023 +0100 hvc/xen: fix console unplug On unplug of a Xen console, xencons_disconnect_backend() unconditionally calls free_irq() via unbind_from_irqhandler(), causing a warning of freeing an already-free IRQ: (qemu) device_del con1 [ 32.050919] ------------[ cut here ]------------ [ 32.050942] Trying to free already-free IRQ 33 [ 32.050990] WARNING: CPU: 0 PID: 51 at kernel/irq/manage.c:1895 __free_irq+0x1d4/0x330 It should be using evtchn_put() to tear down the event channel binding, and let the Linux IRQ side of it be handled by notifier_del_irq() through the HVC code. On which topic... xencons_disconnect_backend() should call hvc_remove() *first*, rather than tearing down the event channel and grant mapping while they are in use. And then the IRQ is guaranteed to be freed by the time it's torn down by evtchn_put(). Since evtchn_put() also closes the actual event channel, avoid calling xenbus_free_evtchn() except in the failure path where the IRQ was not successfully set up. However, calling hvc_remove() at the start of xencons_disconnect_backend() still isn't early enough. An unplug request is indicated by the backend setting its state to XenbusStateClosing, which triggers a notification to xencons_backend_changed(), which... does nothing except set its own frontend state directly to XenbusStateClosed without *actually* tearing down the HVC device or, you know, making sure it isn't actively in use. So the backend sees the guest frontend set its state to XenbusStateClosed and stops servicing the interrupt... and the guest spins for ever in the domU_write_console() function waiting for the ring to drain. Fix that one by calling hvc_remove() from xencons_backend_changed() before signalling to the backend that it's OK to proceed with the removal. Tested with 'dd if=/dev/zero of=/dev/hvc1' while telling Qemu to remove the console device. Signed-off-by: David Woodhouse Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231020161529.355083-4-dwmw2@infradead.org Signed-off-by: Greg Kroah-Hartman commit 2704c9a5593f4a47620c12dad78838ca62b52f48 Author: David Woodhouse Date: Fri Oct 20 17:15:28 2023 +0100 hvc/xen: fix error path in xen_hvc_init() to always register frontend driver The xen_hvc_init() function should always register the frontend driver, even when there's no primary console — as there may be secondary consoles. (Qemu can always add secondary consoles, but only the toolstack can add the primary because it's special.) Signed-off-by: David Woodhouse Reviewed-by: Juergen Gross Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231020161529.355083-3-dwmw2@infradead.org Signed-off-by: Greg Kroah-Hartman commit ef5dd8ec88ac11e8e353164407d55b73c988b369 Author: David Woodhouse Date: Fri Oct 20 17:15:27 2023 +0100 hvc/xen: fix event channel handling for secondary consoles The xencons_connect_backend() function allocates a local interdomain event channel with xenbus_alloc_evtchn(), then calls bind_interdomain_evtchn_to_irq_lateeoi() to bind to that port# on the *remote* domain. That doesn't work very well: (qemu) device_add xen-console,id=con1,chardev=pty0 [ 44.323872] xenconsole console-1: 2 xenbus_dev_probe on device/console/1 [ 44.323995] xenconsole: probe of console-1 failed with error -2 Fix it to use bind_evtchn_to_irq_lateeoi(), which does the right thing by just binding that *local* event channel to an irq. The backend will do the interdomain binding. This didn't affect the primary console because the setup for that is special — the toolstack allocates the guest event channel and the guest discovers it with HVMOP_get_param. Fixes: fe415186b43d ("xen/console: harden hvc_xen against event channel storms") Signed-off-by: David Woodhouse Reviewed-by: Juergen Gross Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231020161529.355083-2-dwmw2@infradead.org Signed-off-by: Greg Kroah-Hartman commit 37058fd5d2394827b07b0551e252283eadf6283a Author: Crescent CY Hsieh Date: Wed Oct 18 17:17:37 2023 +0800 tty: serial: 8250: Add support for MOXA Mini PCIe boards Add support for MOXA Mini PCIe serial boards: - CP102N: 2 ports | RS232 - CP104N: 4 ports | RS232 - CP112N: 2 ports | RS232/RS422/RS485 - CP114N: 4 ports | RS232/RS422/RS485 - CP132N: 2 ports | RS422/RS485 - CP134N: 4 ports | RS422/RS485 Signed-off-by: Crescent CY Hsieh Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/20231018091739.10125-5-crescentcy.hsieh@moxa.com Signed-off-by: Greg Kroah-Hartman commit 5c4148350769a02705e88a3bcf5f9fd997ffe6ff Author: Crescent CY Hsieh Date: Wed Oct 18 17:17:36 2023 +0800 tty: serial: 8250: Relocate macros within 8250_pci.c Move PCI_DEVICE_ID macros to the top so that these macros can be used throughout 8250_pci.c Signed-off-by: Crescent CY Hsieh Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/20231018091739.10125-4-crescentcy.hsieh@moxa.com Signed-off-by: Greg Kroah-Hartman commit 6ff3f33b4b1969e2cc32c652baf6ebbe9132cb21 Author: Crescent CY Hsieh Date: Wed Oct 18 17:17:35 2023 +0800 tty: serial: 8250: Cleanup MOXA configurations To improve clarity, clean up the MOXA configurations within serial_pci_tbl using PCI_VDEVICE(). Signed-off-by: Crescent CY Hsieh Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/20231018091739.10125-3-crescentcy.hsieh@moxa.com Signed-off-by: Greg Kroah-Hartman commit b43de9450161b73539bed7903b2fe809f3c25be4 Author: Crescent CY Hsieh Date: Wed Oct 18 17:17:34 2023 +0800 tty: serial: 8250: Modify MOXA enum name within 8250_pci.c To improve clarity, modify the MOXA enum name within pci_board_num_t. Signed-off-by: Crescent CY Hsieh Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/20231018091739.10125-2-crescentcy.hsieh@moxa.com Signed-off-by: Greg Kroah-Hartman commit 0c01b20fb50ba63c03841aa83070dc59c3b1b02f Author: Francesco Dolcini Date: Thu Oct 19 17:48:34 2023 +0200 dt-bindings: serial: rs485: Add rs485-rts-active-high Add rs485-rts-active-high property, this is a legacy property used by 8250_omap. This fixes the following make dt_binding_check warning: Documentation/devicetree/bindings/serial/8250_omap.yaml: rs485-rts-active-high: missing type definition Reported-by: Geert Uytterhoeven Closes: https://lore.kernel.org/all/CAMuHMdUkPiA=o_QLyuwsTYW7y1ksCjHAqyNSHFx2QZ-dP-HGsQ@mail.gmail.com/ Fixes: 403e97d6ab2c ("dt-bindings: serial: 8250_omap: add rs485-rts-active-high") Cc: stable Signed-off-by: Francesco Dolcini Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231019154834.41721-1-francesco@dolcini.it Signed-off-by: Greg Kroah-Hartman commit a6149f71d09d619724324fd3005f1221821cc917 Author: André Draszik Date: Thu Oct 19 11:09:01 2023 +0100 tty: serial: samsung_tty: remove dead code When support for various old platforms was removed in commit 1ea35b355722 ("ARM: s3c: remove s3c24xx specific hacks"), s3c24xx_serial_ops also became unused here because nothing sets port type TYPE_S3C24XX anymore. Remove s3c24xx_serial_ops and all the code that's unreachable now. Fixes: 1ea35b355722 ("ARM: s3c: remove s3c24xx specific hacks") Signed-off-by: André Draszik Reviewed-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20231019100901.4026680-1-andre.draszik@linaro.org Signed-off-by: Greg Kroah-Hartman commit 838eb763c3e939a8de8d4c55a17ddcce737685c1 Author: Florian Eckert Date: Thu Oct 19 13:28:07 2023 +0200 tty: whitespaces in descriptions corrected by replacing tabs with spaces Tabs were used in the function description, to make this look more uniform, the tabs were replaced by spaces where necessary. While we're at it, I also replaced the 'ndashes' with simple dashes, since only those are supported by sphinx. Reviewed-by: Jiri Slaby Signed-off-by: Florian Eckert Link: https://lore.kernel.org/r/20231019112809.881730-2-fe@dev.tdt.de Signed-off-by: Greg Kroah-Hartman commit 4bebd644971c2b5355af60f4828d464b3268e6cc Author: Max Filippov Date: Wed Oct 18 12:12:52 2023 -0700 serial/esp32_uart: use prescaler when available esp32s3 variant of the esp32 UART has limited baudrate divisor range that does not allow it to use 9600 and lower rates with 40MHz input clock. Use clock prescaler present in this UART variant to help with that. Signed-off-by: Max Filippov Link: https://lore.kernel.org/r/20231018191252.1551972-1-jcmvbkbc@gmail.com Signed-off-by: Greg Kroah-Hartman commit 22088bbb02259d813d797e2d6a4ba7ca6ff4b96c Author: Krzysztof Kozlowski Date: Mon Oct 16 20:19:09 2023 +0200 dt-bindings: serial: re-order entries to match coding convention The DT schema coding convention expressed in Documentation/devicetree/bindings/example-schema.yaml expects entries in following order: - properties, patternProperties - required - if blocks, allOf with if-blocks - additionalProperties/unevaluatedProperties Re-order few schemas to match the convention to avoid repeating review comments for new patches using existing code as template. No functional changes. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Geert Uytterhoeven Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231016181909.368429-1-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit b5f9e63278d6f32789478acf1ed41d21d92b36cf Author: Nicolin Chen Date: Tue Oct 17 11:15:52 2023 -0700 iommufd: Correct IOMMU_HWPT_ALLOC_NEST_PARENT description The IOMMU_HWPT_ALLOC_NEST_PARENT flag is used to allocate a HWPT. Though a HWPT holds a domain in the core structure, it is still quite confusing to describe it using "domain" in the uAPI kdoc. Correct it to "HWPT". Fixes: 4ff542163397 ("iommufd: Support allocating nested parent domain") Link: https://lore.kernel.org/r/20231017181552.12667-1-nicolinc@nvidia.com Signed-off-by: Nicolin Chen Signed-off-by: Jason Gunthorpe commit 00331227f42045314b3775957f2f7809fb3ac32f Author: Varadarajan Narayanan Date: Fri Oct 20 11:49:35 2023 +0530 clk: qcom: apss-ipq6018: ipq5332: add safe source switch for a53pll Stromer Plus PLL found on IPQ53xx doesn't support dynamic frequency scaling. To achieve the same, we need to park the APPS PLL source to GPLL0, re configure the PLL and then switch the source to APSS_PLL_EARLY. To support this, register a clock notifier to get the PRE_RATE and POST_RATE notification. Change the APSS PLL source to GPLL0 when PRE_RATE notification is received, then configure the PLL and then change back the source to APSS_PLL_EARLY. Additionally, not all SKUs of IPQ53xx support scaling. Hence, do the above to the SKUs that support scaling. Reviewed-by: Dmitry Baryshkov Signed-off-by: Kathiravan T Signed-off-by: Varadarajan Narayanan Link: https://lore.kernel.org/r/49422d258d67d33a2547fbb7f4f6e72d489c2301.1697781921.git.quic_varada@quicinc.com Signed-off-by: Bjorn Andersson commit 5b7a4d3d2b33398330aef69e0ff5656273483587 Author: Varadarajan Narayanan Date: Fri Oct 20 11:49:34 2023 +0530 clk: qcom: apss-ipq-pll: Fix 'l' value for ipq5332_pll_config The earlier 'l' value of 0x3e is for 1.5GHz. Not all SKUs support this frequency. Hence set it to 0x2d to get 1.1GHz which is supported in all SKUs. The frequency can still increase above this initial configuration made here when the cpufreq driver picks a different OPP. Reviewed-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Fixes: c7ef7fbb1ccf ("clk: qcom: apss-ipq-pll: add support for IPQ5332") Signed-off-by: Kathiravan T Signed-off-by: Varadarajan Narayanan Link: https://lore.kernel.org/r/00e6be6cb9cee56628123a64ade118d0a752018b.1697781921.git.quic_varada@quicinc.com Signed-off-by: Bjorn Andersson commit 267e29198436a8cb6770213471f72502c895096a Author: Varadarajan Narayanan Date: Fri Oct 20 11:49:33 2023 +0530 clk: qcom: apss-ipq-pll: Use stromer plus ops for stromer plus pll The set rate and determine rate operations are different between Stromer and Stromer Plus PLLs. Since the programming sequence is different, the PLLs dont get configured properly and random, inexplicable crash/freeze is seen. Hence, use stromer plus ops for ipq_pll_stromer_plus. Reviewed-by: Dmitry Baryshkov Acked-by: Stephen Boyd Fixes: c7ef7fbb1ccf ("clk: qcom: apss-ipq-pll: add support for IPQ5332") Signed-off-by: Kathiravan T Signed-off-by: Varadarajan Narayanan Link: https://lore.kernel.org/r/c86ecaa23dc4f39650bcf4a3bd54a617a932e4fd.1697781921.git.quic_varada@quicinc.com Signed-off-by: Bjorn Andersson commit 84da48921a97cee3dd1391659e93ee01d122b78b Author: Varadarajan Narayanan Date: Fri Oct 20 11:49:32 2023 +0530 clk: qcom: clk-alpha-pll: introduce stromer plus ops Stromer plus APSS PLL does not support dynamic frequency scaling. To switch between frequencies, we have to shut down the PLL, configure the L and ALPHA values and turn on again. So introduce the separate set of ops for Stromer Plus PLL. Reviewed-by: Dmitry Baryshkov Signed-off-by: Kathiravan T Signed-off-by: Varadarajan Narayanan Link: https://lore.kernel.org/r/2affa6c63ff0c4342230623a7d4eef02ec7c02d4.1697781921.git.quic_varada@quicinc.com Signed-off-by: Bjorn Andersson commit 6a15647d0adc686226045e8046369f34d6ab03ed Author: Varadarajan Narayanan Date: Fri Oct 20 11:49:31 2023 +0530 clk: qcom: config IPQ_APSS_6018 should depend on QCOM_SMEM The config IPQ_APSS_6018 should depend on QCOM_SMEM, to avoid the following error reported by 'kernel test robot' loongarch64-linux-ld: drivers/clk/qcom/apss-ipq6018.o: in function `apss_ipq6018_probe': >> apss-ipq6018.c:(.text+0xd0): undefined reference to `qcom_smem_get_soc_id' Fixes: 5e77b4ef1b19 ("clk: qcom: Add ipq6018 apss clock controller") Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202310181650.g8THtfsm-lkp@intel.com/ Signed-off-by: Varadarajan Narayanan Link: https://lore.kernel.org/r/f4c4d65a7cb71e807d6d472c63c7718408c8f5f0.1697781921.git.quic_varada@quicinc.com Signed-off-by: Bjorn Andersson commit a2620539ae2529916a98585c6d7311c48fb67e9f Author: Dmitry Baryshkov Date: Mon Oct 16 11:43:56 2023 +0300 clk: qcom: videocc-sm8550: switch to clk_lucid_ole_pll_configure Instead of manually specifying the RINGOSC_CAL_L and CAL_L values in the alpha_pll_config.l field, use the proper clk_lucid_ole_pll_configure() function to configure the PLL. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231016084356.1301854-2-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 21134ec8af94981b3127a691df2d73540ba4d8aa Author: Dmitry Baryshkov Date: Mon Oct 16 11:43:55 2023 +0300 clk: qcom: gpucc-sm8550: switch to clk_lucid_ole_pll_configure Instead of manually specifying the RINGOSC_CAL_L and CAL_L values in the alpha_pll_config.l field, use the proper clk_lucid_ole_pll_configure() function to configure the PLL. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231016084356.1301854-1-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit bff482ace43eebc5b4394cc9a7c7723f08413f80 Author: Rob Herring Date: Tue Oct 10 15:57:10 2023 -0500 clk: qcom: Replace of_device.h with explicit includes The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other and pull in various other headers. In preparation to fix this, adjust the includes for what is actually needed. of_device.h isn't needed, but mod_devicetable.h and platform_device.h were implicitly included by it. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231010205710.1585232-1-robh@kernel.org Signed-off-by: Bjorn Andersson commit 76ca22bd3d95cfb5113206894abbc80de6ceb1fe Author: Konrad Dybcio Date: Fri Aug 25 17:38:32 2023 +0200 clk: qcom: smd-rpm: Move CPUSS_GNoC clock to interconnect As it turns out, it's yet another interconnect bus clock. Move it there. See [1] for reference. [1] https://android.googlesource.com/kernel/msm-extra/devicetree/+/02f8c342b23c20a5cf967df649814be37a08227c%5E%21/#F0 Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230726-topic-icc_coeff-v4-10-c04b60caa467@linaro.org Signed-off-by: Bjorn Andersson commit abaf59c470a7c9c59bda8da3517ec2ff0513f5a6 Author: Uwe Kleine-König Date: Mon Sep 11 17:15:48 2023 +0200 clk: qcom: cbf-msm8996: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). qcom_msm8996_cbf_icc_remove() returned zero unconditionally. After changing this function to return void instead, the driver can be converted trivially to use .remove_new(). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230911151548.672485-1-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit e10f4019b18d347241625026d015ed27eaf6005a Author: Shinas Rasheed Date: Fri Oct 20 04:43:01 2023 -0700 octeon_ep: assert hardware structure sizes Clean up structure defines related to hardware data to be asserted to fixed sizes, as padding is not allowed by hardware. Signed-off-by: Shinas Rasheed Signed-off-by: David S. Miller commit a04224da1f3424b2c607b12a3bd1f0e302fb8231 Author: Hardik Gajjar Date: Fri Oct 20 17:33:24 2023 +0200 usb: gadget: f_ncm: Always set current gadget in ncm_bind() Previously, gadget assignment to the net device occurred exclusively during the initial binding attempt. Nevertheless, the gadget pointer could change during bind/unbind cycles due to various conditions, including the unloading/loading of the UDC device driver or the detachment/reconnection of an OTG-capable USB hub device. This patch relocates the gether_set_gadget() function out from ncm_opts->bound condition check, ensuring that the correct gadget is assigned during each bind request. The provided logs demonstrate the consistency of ncm_opts throughout the power cycle, while the gadget may change. * OTG hub connected during boot up and assignment of gadget and ncm_opts pointer [ 2.366301] usb 2-1.5: New USB device found, idVendor=2996, idProduct=0105 [ 2.366304] usb 2-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2.366306] usb 2-1.5: Product: H2H Bridge [ 2.366308] usb 2-1.5: Manufacturer: Aptiv [ 2.366309] usb 2-1.5: SerialNumber: 13FEB2021 [ 2.427989] usb 2-1.5: New USB device found, VID=2996, PID=0105 [ 2.428959] dabridge 2-1.5:1.0: dabridge 2-4 total endpoints=5, 0000000093a8d681 [ 2.429710] dabridge 2-1.5:1.0: P(0105) D(22.06.22) F(17.3.16) H(1.1) high-speed [ 2.429714] dabridge 2-1.5:1.0: Hub 2-2 P(0151) V(06.87) [ 2.429956] dabridge 2-1.5:1.0: All downstream ports in host mode [ 2.430093] gadget 000000003c414d59 ------> gadget pointer * NCM opts and associated gadget pointer during First ncm_bind [ 34.763929] NCM opts 00000000aa304ac9 [ 34.763930] NCM gadget 000000003c414d59 * OTG capable hub disconnecte or assume driver unload. [ 97.203114] usb 2-1: USB disconnect, device number 2 [ 97.203118] usb 2-1.1: USB disconnect, device number 3 [ 97.209217] usb 2-1.5: USB disconnect, device number 4 [ 97.230990] dabr_udc deleted * Reconnect the OTG hub or load driver assaign new gadget pointer. [ 111.534035] usb 2-1.1: New USB device found, idVendor=2996, idProduct=0120, bcdDevice= 6.87 [ 111.534038] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 111.534040] usb 2-1.1: Product: Vendor [ 111.534041] usb 2-1.1: Manufacturer: Aptiv [ 111.534042] usb 2-1.1: SerialNumber: Superior [ 111.535175] usb 2-1.1: New USB device found, VID=2996, PID=0120 [ 111.610995] usb 2-1.5: new high-speed USB device number 8 using xhci-hcd [ 111.630052] usb 2-1.5: New USB device found, idVendor=2996, idProduct=0105, bcdDevice=21.02 [ 111.630055] usb 2-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 111.630057] usb 2-1.5: Product: H2H Bridge [ 111.630058] usb 2-1.5: Manufacturer: Aptiv [ 111.630059] usb 2-1.5: SerialNumber: 13FEB2021 [ 111.687464] usb 2-1.5: New USB device found, VID=2996, PID=0105 [ 111.690375] dabridge 2-1.5:1.0: dabridge 2-8 total endpoints=5, 000000000d87c961 [ 111.691172] dabridge 2-1.5:1.0: P(0105) D(22.06.22) F(17.3.16) H(1.1) high-speed [ 111.691176] dabridge 2-1.5:1.0: Hub 2-6 P(0151) V(06.87) [ 111.691646] dabridge 2-1.5:1.0: All downstream ports in host mode [ 111.692298] gadget 00000000dc72f7a9 --------> new gadget ptr on connect * NCM opts and associated gadget pointer during second ncm_bind [ 113.271786] NCM opts 00000000aa304ac9 -----> same opts ptr used during first bind [ 113.271788] NCM gadget 00000000dc72f7a9 ----> however new gaget ptr, that will not set in net_device due to ncm_opts->bound = true Signed-off-by: Hardik Gajjar Link: https://lore.kernel.org/r/20231020153324.82794-1-hgajjar@de.adit-jv.com Signed-off-by: Greg Kroah-Hartman commit c9a1d9e74a43ae8f2d1718243c1de277dc0e7027 Author: Heiner Kallweit Date: Tue Oct 17 23:11:53 2023 +0200 usb: core: Remove duplicated check in usb_hub_create_port_device Simplify the code by not calling hub_is_superspeed() twice. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/b1d77cbc-faa3-4d07-94ff-f6ffb85c6964@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1a4a2df07c1f087704c24282cebe882268e38146 Author: Badhri Jagan Sridharan Date: Sun Oct 15 05:31:08 2023 +0000 usb: typec: tcpm: Add additional checks for contaminant When transitioning from SNK_DEBOUNCED to unattached, its worthwhile to check for contaminant to mitigate wakeups. ``` [81334.219571] Start toggling [81334.228220] CC1: 0 -> 0, CC2: 0 -> 0 [state TOGGLING, polarity 0, disconnected] [81334.305147] CC1: 0 -> 0, CC2: 0 -> 3 [state TOGGLING, polarity 0, connected] [81334.305162] state change TOGGLING -> SNK_ATTACH_WAIT [rev3 NONE_AMS] [81334.305187] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 170 ms [rev3 NONE_AMS] [81334.475515] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 170 ms] [81334.486480] CC1: 0 -> 0, CC2: 3 -> 0 [state SNK_DEBOUNCED, polarity 0, disconnected] [81334.486495] state change SNK_DEBOUNCED -> SNK_DEBOUNCED [rev3 NONE_AMS] [81334.486515] pending state change SNK_DEBOUNCED -> SNK_UNATTACHED @ 20 ms [rev3 NONE_AMS] [81334.506621] state change SNK_DEBOUNCED -> SNK_UNATTACHED [delayed 20 ms] [81334.506640] Start toggling [81334.516972] CC1: 0 -> 0, CC2: 0 -> 0 [state TOGGLING, polarity 0, disconnected] [81334.592759] CC1: 0 -> 0, CC2: 0 -> 3 [state TOGGLING, polarity 0, connected] [81334.592773] state change TOGGLING -> SNK_ATTACH_WAIT [rev3 NONE_AMS] [81334.592792] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 170 ms [rev3 NONE_AMS] [81334.762940] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 170 ms] [81334.773557] CC1: 0 -> 0, CC2: 3 -> 0 [state SNK_DEBOUNCED, polarity 0, disconnected] [81334.773570] state change SNK_DEBOUNCED -> SNK_DEBOUNCED [rev3 NONE_AMS] [81334.773588] pending state change SNK_DEBOUNCED -> SNK_UNATTACHED @ 20 ms [rev3 NONE_AMS] [81334.793672] state change SNK_DEBOUNCED -> SNK_UNATTACHED [delayed 20 ms] [81334.793681] Start toggling [81334.801840] CC1: 0 -> 0, CC2: 0 -> 0 [state TOGGLING, polarity 0, disconnected] [81334.878655] CC1: 0 -> 0, CC2: 0 -> 3 [state TOGGLING, polarity 0, connected] [81334.878672] state change TOGGLING -> SNK_ATTACH_WAIT [rev3 NONE_AMS] [81334.878696] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 170 ms [rev3 NONE_AMS] [81335.048968] state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED [delayed 170 ms] [81335.060684] CC1: 0 -> 0, CC2: 3 -> 0 [state SNK_DEBOUNCED, polarity 0, disconnected] [81335.060754] state change SNK_DEBOUNCED -> SNK_DEBOUNCED [rev3 NONE_AMS] [81335.060775] pending state change SNK_DEBOUNCED -> SNK_UNATTACHED @ 20 ms [rev3 NONE_AMS] [81335.080884] state change SNK_DEBOUNCED -> SNK_UNATTACHED [delayed 20 ms] [81335.080900] Start toggling ``` Cc: stable@vger.kernel.org Fixes: 599f008c257d ("usb: typec: tcpm: Add callbacks to mitigate wakeups due to contaminant") Signed-off-by: Badhri Jagan Sridharan Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231015053108.2349570-1-badhri@google.com Signed-off-by: Greg Kroah-Hartman commit a792197f50705a5855b592fde3312e1e373862e5 Author: Su Hui Date: Fri Oct 20 17:00:04 2023 +0800 net: dsa: mv88e6xxx: add an error code check in mv88e6352_tai_event_work mv88e6xxx_tai_write() can return error code (-EOPNOTSUPP ...) if failed. So check the value of 'ret' after calling mv88e6xxx_tai_write(). Signed-off-by: Su Hui Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit bbd3778da16b3d448832b843f80bcde1aff26290 Author: Sebastian Reichel Date: Fri Oct 20 16:11:42 2023 +0200 arm64: dts: rockchip: rk3588s: Add USB3 host controller RK3588 has three USB3 controllers. This adds the host-only controller, which is using the naneng-combphy shared with PCIe and SATA. The other two are dual-role and using a different PHY that is not yet supported upstream. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20231020150022.48725-4-sebastian.reichel@collabora.com Signed-off-by: Greg Kroah-Hartman commit 97789b93b792fc97ad4476b79e0f38ffa8e7e0ee Author: Sebastian Reichel Date: Fri Oct 20 16:11:41 2023 +0200 usb: dwc3: add optional PHY interface clocks On Rockchip RK3588 one of the DWC3 cores is integrated weirdly and requires two extra clocks to be enabled. Without these extra clocks hot-plugging USB devices is broken. Signed-off-by: Sebastian Reichel Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20231020150022.48725-3-sebastian.reichel@collabora.com Signed-off-by: Greg Kroah-Hartman commit 98bad5bc447ec962988a48c92f7d0f8c4dc473d2 Author: Sebastian Reichel Date: Fri Oct 20 16:11:40 2023 +0200 dt-bindings: usb: add rk3588 compatible to rockchip,dwc3 RK3588 has three DWC3 controllers. Two of them are fully functional in host, device and OTG mode including USB2 support. They are connected to dedicated PHYs, that also support USB-C's DisplayPort alternate mode. The third controller is connected to one of the combphy's shared with PCIe and SATA. It can only be used in host mode and does not support USB2. Compared to the other controllers this one needs some extra clocks. While adding the extra clocks required by RK3588, I noticed grf_clk is not available on RK3568, so I disallowed it for that platform. Signed-off-by: Sebastian Reichel Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20231020150022.48725-2-sebastian.reichel@collabora.com Signed-off-by: Greg Kroah-Hartman commit de7ecc4e0570d7956d8745faeeda26f0873b7324 Author: Piyush Mehta Date: Fri Oct 13 18:28:47 2023 +0530 usb: dwc3: xilinx: add reset-controller support Add a reset-controller for supporting Xilinx versal platforms. To reset the USB controller, get the reset ID from device-tree and using ID trigger the reset, with the assert and deassert reset controller APIs for USB controller initialization. Signed-off-by: Piyush Mehta Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20231013125847.20334-1-piyush.mehta@amd.com Signed-off-by: Greg Kroah-Hartman commit 46b6fc5380071e1e1372ed0b24a6c6743e2a9d2c Author: Uwe Kleine-König Date: Fri Oct 20 17:15:38 2023 +0200 usb: mtu3: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. The function mtu3_remove() can only return a non-zero value if ssusb->dr_mode is neiter USB_DR_MODE_PERIPHERAL nor USB_DR_MODE_HOST nor USB_DR_MODE_OTG. In this case however the probe callback doesn't succeed and so the remove callback isn't called at all. So the code branch resulting in this error path could just be dropped were it not for the compiler choking on "enumeration value 'USB_DR_MODE_UNKNOWN' not handled in switch [-Werror=switch]". So instead replace this code path by a WARN_ON and then mtu3_remove() be converted to return void trivially. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231020151537.2202675-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 8e99dc783648e5e663494434544bdc5160522de3 Author: Luca Weiss Date: Fri Oct 20 12:35:47 2023 +0200 usb: typec: add support for PTN36502 redriver Add a driver for the NXP PTN36502 Type-C USB 3.1 Gen 1 and DisplayPort v1.2 combo redriver. Reviewed-by: Heikki Krogerus Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20231020-ptn36502-v2-2-b37a337d463e@fairphone.com Signed-off-by: Greg Kroah-Hartman commit 915360a5ce96f0c8e22730b21c50dd1a1f271930 Author: Luca Weiss Date: Fri Oct 20 12:35:46 2023 +0200 dt-bindings: usb: add NXP PTN36502 Type-C redriver bindings Document bindings for this Type-C USB 3.1 Gen 1 and DisplayPort v1.2 combo redriver. The PTN36502 can also run in GPIO mode where it is configured differently, without any I2C connection, but this is not supported yet. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20231020-ptn36502-v2-1-b37a337d463e@fairphone.com Signed-off-by: Greg Kroah-Hartman commit 49537ec71d14312d89217a6257be32a97253563e Author: Uwe Kleine-König Date: Tue Oct 17 22:44:49 2023 +0200 usb: gadget: r8a66597-udc: Convert to use module_platform_driver() module_platform_driver_probe() has the advantage that the .probe() and .remove() calls can live in .init.text and .exit.text respectively and so some memory is saved. The downside is that dynamic bind and unbind are impossible. As the driver doesn't benefit from the advantages (both .probe and .remove are defined in plain .text), stop suffering from the downsides and use module_platform_driver() instead of module_platform_driver_probe(). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231017204442.1625925-14-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit b4822e2317e8ffb20351ccad544b04d04edc460a Author: Uwe Kleine-König Date: Tue Oct 17 22:44:48 2023 +0200 usb: gadget: m66592-udc: Convert to use module_platform_driver() module_platform_driver_probe() has the advantage that the .probe() and .remove() calls can live in .init.text and .exit.text respectively and so some memory is saved. The downside is that dynamic bind and unbind are impossible. As the driver doesn't benefit from the advantages (both .probe and .remove are defined in plain .text), stop suffering from the downsides and use module_platform_driver() instead of module_platform_driver_probe(). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231017204442.1625925-13-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit ff8e4630fa3c1f8775f162ceaf52ba8b656927de Author: Uwe Kleine-König Date: Tue Oct 17 22:44:47 2023 +0200 usb: gadget: lpc32xx-udc: Convert to use module_platform_driver() module_platform_driver_probe() has the advantage that the .probe() and .remove() calls can live in .init.text and .exit.text respectively and so some memory is saved. The downside is that dynamic bind and unbind are impossible. As the driver doesn't benefit from the advantages (both .probe and .remove are defined in plain .text), stop suffering from the downsides and use module_platform_driver() instead of module_platform_driver_probe(). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231017204442.1625925-12-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 017e452e582496a124de87d99c0cece106be6c3c Author: Uwe Kleine-König Date: Tue Oct 17 22:44:46 2023 +0200 usb: gadget: fusb300-udc: Convert to use module_platform_driver() module_platform_driver_probe() has the advantage that the .probe() and .remove() calls can live in .init.text and .exit.text respectively and so some memory is saved. The downside is that dynamic bind and unbind are impossible. As the driver doesn't benefit from the advantages (both .probe and .remove are defined in plain .text), stop suffering from the downsides and use module_platform_driver() instead of module_platform_driver_probe(). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231017204442.1625925-11-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 2911016a45ca3f711b179e613e58914fde44b7d0 Author: Uwe Kleine-König Date: Tue Oct 17 22:44:45 2023 +0200 usb: gadget: fsl-udc: Convert to use module_platform_driver() module_platform_driver_probe() has the advantage that the .probe() and .remove() calls can live in .init.text and .exit.text respectively and so some memory is saved. The downside is that dynamic bind and unbind are impossible. As the driver doesn't benefit from the advantages (both .probe and .remove are defined in plain .text), stop suffering from the downsides and use module_platform_driver() instead of module_platform_driver_probe(). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231017204442.1625925-10-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit f97467becb250661dcfd28a46c2ff741ead40981 Author: Uwe Kleine-König Date: Tue Oct 17 22:44:44 2023 +0200 usb: gadget: at91-udc: Convert to use module_platform_driver() module_platform_driver_probe() has the advantage that the .probe() and .remove() calls can live in .init.text and .exit.text respectively and so some memory is saved. The downside is that dynamic bind and unbind are impossible. As the driver doesn't benefit from the advantages (both .probe and .remove are defined in plain .text), stop suffering from the downsides and use module_platform_driver() instead of module_platform_driver_probe(). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231017204442.1625925-9-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit ee3d12285471f17239af467eab11f9cb08c18dc4 Author: Pedro Tammela Date: Thu Oct 19 14:29:44 2023 -0300 selftests: tc-testing: add test for 'rt' upgrade on hfsc Add a test to check if inner rt curves are upgraded to sc curves. Signed-off-by: Pedro Tammela Signed-off-by: David S. Miller commit cf36d7db25b625e03d363cf8e59114d0f1ff68aa Author: Rob Herring Date: Thu Oct 19 13:30:15 2023 -0500 usb: chipidea: Fix unused ci_hdrc_usb2_of_match warning for !CONFIG_OF Commit 14485de431b0 ("usb: Use device_get_match_data()") dropped the unconditional use of ci_hdrc_usb2_of_match resulting in this warning: drivers/usb/chipidea/ci_hdrc_usb2.c:41:34: warning: unused variable 'ci_hdrc_usb2_of_match' [-Wunused-const-variable] The fix is to drop of_match_ptr() which is not necessary because DT is always used for this driver. Fixes: 14485de431b0 ("usb: Use device_get_match_data()") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310131627.M43j234A-lkp@intel.com/ Signed-off-by: Rob Herring Acked-by: Peter Chen Link: https://lore.kernel.org/r/20231019183015.841460-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit 70f13579c2f75d869fb989f458fc9937b43c3198 Author: Tomer Maimon Date: Tue Oct 17 22:59:03 2023 +0300 usb: chipidea: Add support for NPCM Add Nuvoton NPCM BMC SoCs support to USB ChipIdea driver. NPCM SoC includes ChipIdea IP block that is used for USB device controller mode. Signed-off-by: Tomer Maimon Acked-by: Peter Chen Link: https://lore.kernel.org/r/20231017195903.1665260-4-tmaimon77@gmail.com Signed-off-by: Greg Kroah-Hartman commit ceae398f15b32ebce8db73c15f2603c3b72eca32 Author: Tomer Maimon Date: Tue Oct 17 22:59:02 2023 +0300 dt-bindings: usb: ci-hdrc-usb2: add npcm750 and npcm845 compatible Add a compatible string for Nuvoton BMC NPCM750 and Nuvoton BMC NPCM845. Signed-off-by: Tomer Maimon Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231017195903.1665260-3-tmaimon77@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2978cc1f285390c1bd4d9bfc665747adc6e4b19c Author: Tomer Maimon Date: Tue Oct 17 22:59:01 2023 +0300 usb: chipidea: add CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS flag Adding CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS flag to modify the vbus_active parameter to active in case the ChipIdea USB IP role is device-only and there is no otgsc register. Signed-off-by: Tomer Maimon Acked-by: Peter Chen Link: https://lore.kernel.org/r/20231017195903.1665260-2-tmaimon77@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4936eb7567c3e44065979e1036ba3c018dd6b9a1 Author: Jisheng Zhang Date: Wed Oct 18 23:04:48 2023 +0800 dt-bindings: usb: vialab,vl817: remove reset-gpios from required list The "reset-gpios" is optional in real case, for example reset pin is is hard wired to "high". And this fact is also reflected by the devm_gpio_get_optional() calling in driver code. Signed-off-by: Jisheng Zhang Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231018150448.1980-1-jszhang@kernel.org Signed-off-by: Greg Kroah-Hartman commit d181b34bd381b336558fc5d5100ee13063eb6bac Author: Milan Broz Date: Mon Oct 16 09:25:59 2023 +0200 usb-storage,uas: make internal quirks flags 64bit Switch internal usb-storage quirk value to 64-bit as quirks currently use all 32 bits. Signed-off-by: Milan Broz Reviewed-by: Alan Stern Link: https://lore.kernel.org/r/20231016072604.40179-3-gmazyland@gmail.com Signed-off-by: Greg Kroah-Hartman commit 35b62f6f582264ed681a7f159e9ffca08a0f5edd Author: Milan Broz Date: Mon Oct 16 09:25:58 2023 +0200 usb-storage: remove UNUSUAL_VENDOR_INTF macro This patch removes macro that was used only by commit that was reverted in commit ab4b71644a26 ("USB: storage: fix Huawei mode switching regression") Signed-off-by: Milan Broz Reviewed-by: Alan Stern Link: https://lore.kernel.org/r/20231016072604.40179-2-gmazyland@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6add6dd345cb754ce18ff992c7264cabf31e59f6 Author: Wesley Cheng Date: Thu Oct 19 13:29:24 2023 +0300 usb: host: xhci: Avoid XHCI resume delay if SSUSB device is not present There is a 120ms delay implemented for allowing the XHCI host controller to detect a U3 wakeup pulse. The intention is to wait for the device to retry the wakeup event if the USB3 PORTSC doesn't reflect the RESUME link status by the time it is checked. As per the USB3 specification: tU3WakeupRetryDelay ("Table 7-12. LTSSM State Transition Timeouts") This would allow the XHCI resume sequence to determine if the root hub needs to be also resumed. However, in case there is no device connected, or if there is only a HSUSB device connected, this delay would still affect the overall resume timing. Since this delay is solely for detecting U3 wake events (USB3 specific) then ignore this delay for the disconnected case and the HSUSB connected only case. [skip helper function, rename usb3_connected variable -Mathias ] Signed-off-by: Wesley Cheng Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-20-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a5f928db59519a15e82ecba4ae3e7cbf5a44715a Author: Sergey Shtylyov Date: Thu Oct 19 13:29:23 2023 +0300 usb: host: xhci-plat: fix possible kernel oops while resuming If this driver enables the xHC clocks while resuming from sleep, it calls clk_prepare_enable() without checking for errors and blithely goes on to read/write the xHC's registers -- which, with the xHC not being clocked, at least on ARM32 usually causes an imprecise external abort exceptions which cause kernel oops. Currently, the chips for which the driver does the clock dance on suspend/resume seem to be the Broadcom STB SoCs, based on ARM32 CPUs, as it seems... Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool. Fixes: 8bd954c56197 ("usb: host: xhci-plat: suspend and resume clocks") Signed-off-by: Sergey Shtylyov Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-19-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 6ccb83d6c4972ebe6ae49de5eba051de3638362c Author: Udipto Goswami Date: Thu Oct 19 13:29:22 2023 +0300 usb: xhci: Implement xhci_handshake_check_state() helper In some situations where xhci removal happens parallel to xhci_handshake, we encounter a scenario where the xhci_handshake can't succeed, and it polls until timeout. If xhci_handshake runs until timeout it can on some platforms result in a long wait which might lead to a watchdog timeout. Add a helper that checks xhci status during the handshake, and exits if set state is entered. Use this helper in places where xhci_handshake is called unlocked and has a long timeout. For example xhci command timeout and xhci reset. [commit message and code comment rewording -Mathias] Signed-off-by: Udipto Goswami Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-18-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 47f503cf5f799ec02e5f4b7c3b9afe145eca2aef Author: Mathias Nyman Date: Thu Oct 19 13:29:21 2023 +0300 xhci: split free interrupter into separate remove and free parts The current function that both removes and frees an interrupter isn't optimal when using several interrupters. The array of interrupters need to be protected with a lock while removing interrupters, but the default xhci spin lock can't be used while freeing the interrupters event ring segment table as dma_free_coherent() should be called with IRQs enabled. There is no need to free the interrupter under the lock, so split this code into separate unlocked free part, and a lock protected remove part. Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-17-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a5d6264b638efeca35eff72177fd28d149e0764b Author: Basavaraj Natikar Date: Thu Oct 19 13:29:20 2023 +0300 xhci: Enable RPM on controllers that support low-power states Use the low-power states of the underlying platform to enable runtime PM. If the platform doesn't support runtime D3, then enabling default RPM will result in the controller malfunctioning, as in the case of hotplug devices not being detected because of a failed interrupt generation. Cc: Mario Limonciello Signed-off-by: Basavaraj Natikar Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-16-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 4baf1218150985ee3ab0a27220456a1f027ea0ac Author: Basavaraj Natikar Date: Thu Oct 19 13:29:19 2023 +0300 xhci: Loosen RPM as default policy to cover for AMD xHC 1.1 The AMD USB host controller (1022:43f7) isn't going into PCI D3 by default without anything connected. This is because the policy that was introduced by commit a611bf473d1f ("xhci-pci: Set runtime PM as default policy on all xHC 1.2 or later devices") only covered 1.2 or later. The 1.1 specification also has the same requirement as the 1.2 specification for D3 support. So expand the runtime PM as default policy to all AMD 1.1 devices as well. Fixes: a611bf473d1f ("xhci-pci: Set runtime PM as default policy on all xHC 1.2 or later devices") Link: https://composter.com.ua/documents/xHCI_Specification_for_USB.pdf Co-developed-by: Mario Limonciello Signed-off-by: Mario Limonciello Signed-off-by: Basavaraj Natikar Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-15-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d1830364e9633573947185343d28aa1224356743 Author: Mathias Nyman Date: Thu Oct 19 13:29:18 2023 +0300 xhci: Simplify event ring dequeue pointer update for port change events Increase the event ring dequeue pointer for port change events in the same way as other event types. No need to handle it separately. This only touches the driver side tracking of event ring dequeue. Note: this does move forward the event ring dequeue increase for port change events a bit. Previously the dequeue was increased before temporarily dropping the xhci lock while kicking roothub polling. Now dequeue is increased after re-aquiring the lock. This should not matter as event ring dequeue is not touched at all by hub thread. It's only touched in xhci interrupt handler. Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-14-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 3321f84bfae010f257de77b9f9a96d9bae183cf6 Author: Mathias Nyman Date: Thu Oct 19 13:29:17 2023 +0300 xhci: simplify event ring dequeue tracking for transfer events No matter what type of event we receive we want to increase the event ring dequeue pointer one step for every event that is handled. For unknown reasons the event ring dequeue increase is done inside the transfer event handler and port event handler. As the transfer event handler got more complex and can now loop through several transfer TRBs on a transfer ring, there were additinal checks added to avoid increasing event ring dequeue more than one step. No need for elaborate checks to avoid increasing event ring dequeue in case the transfer event handler goes through a loop. Just increasing the event ring dequeue outside the transfer event handler. End goal is to increase event ring dequeue in just one place. Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-13-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 3c45a21fd5d49966fa8bb39f50ae52f6aa9ec999 Author: Lukas Wunner Date: Thu Oct 19 13:29:16 2023 +0300 xhci: Clean up xhci_{alloc,free}_erst() declarations xhci_alloc_erst() has global scope even though it's only used in xhci-mem.c. Declare it static. xhci_free_erst() was removed by commit b17a57f89f69 ("xhci: Refactor interrupter code for initial multi interrupter support."), but a declaration in xhci.h still remains. Drop it. Signed-off-by: Lukas Wunner Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-12-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit c087fada0a6180ab5b88b11c1776eef02f8d556f Author: Lukas Wunner Date: Thu Oct 19 13:29:15 2023 +0300 xhci: Clean up stale comment on ERST_SIZE macro Commit ebd88cf50729 ("xhci: Remove unused defines for ERST_SIZE and ERST_ENTRIES") removed the ERST_SIZE macro but retained a code comment explaining the quantity chosen in the macro. Remove the code comment as well. Signed-off-by: Lukas Wunner Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-11-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 08cc5616798d8be5453be16737e1e6ec939b4997 Author: Lukas Wunner Date: Thu Oct 19 13:29:14 2023 +0300 xhci: Clean up ERST_PTR_MASK inversion Mathias notes that the ERST_PTR_MASK macro is named as if it's masking the Event Ring Dequeue Pointer in the ERDP register, but in actuality it's masking the inverse. Invert the macro's value for clarity. Migrate it to the modern GENMASK_ULL() syntax to avoid u64 casts. Signed-off-by: Lukas Wunner Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-10-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 01e6e143a7fa7b82a69fd5cbd906c1686609cf90 Author: Lukas Wunner Date: Thu Oct 19 13:29:13 2023 +0300 xhci: Expose segment numbers in debugfs Ring segments have just been amended with a monotonically increasing number. To allow developers to inspect the segment numbers and ensure correctness in particular after ring expansion, expose them in each ring's "trbs" file in debugfs. Signed-off-by: Lukas Wunner Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-9-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 67ab841a177d3ea16cb2f30e517fdf0ad60afe8f Author: Lukas Wunner Date: Thu Oct 19 13:29:12 2023 +0300 xhci: Update last segment pointer after Event Ring expansion When expanding a ring at its "end", ring->last_seg needs to be updated for Event Rings as well, not just for all the other ring types. This is not a fix because ring expansion currently isn't done on the Event Ring. It's just in preparation for when it's added. Signed-off-by: Lukas Wunner Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-8-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 35899f58fe13d385b1dbc33004e5a31bf2c18b7a Author: Lukas Wunner Date: Thu Oct 19 13:29:11 2023 +0300 xhci: Adjust segment numbers after ring expansion Initial xhci_ring allocation has just been amended to assign a monotonically increasing number to each ring segment. However rings may be expanded after initial allocation. So number newly inserted segments starting from the preceding segment in the ring and renumber all segments succeeding the newly inserted ones. This is not a fix because ring expansion currently isn't done on the Event Ring and that's the only ring type using the segment number. It's just in preparation for when either Event Ring expansion is added or when other ring types start making use of the segment number. Signed-off-by: Lukas Wunner Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-7-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 28084d3fcc3c8445542917f32e382c45b5343cc2 Author: Jonathan Bell Date: Thu Oct 19 13:29:10 2023 +0300 xhci: Use more than one Event Ring segment Users have reported log spam created by "Event Ring Full" xHC event TRBs. These are caused by interrupt latency in conjunction with a very busy set of devices on the bus. The errors are benign, but throughput will suffer as the xHC will pause processing of transfers until the Event Ring is drained by the kernel. Commit dc0ffbea5729 ("usb: host: xhci: update event ring dequeue pointer on purpose") mitigated the issue by advancing the Event Ring Dequeue Pointer already after half a segment has been processed. Nevertheless, providing a larger Event Ring would be useful to cope with load peaks. Expand the number of event TRB slots available by increasing the number of Event Ring segments in the ERST. Controllers have a hardware-defined limit as to the number of ERST entries they can process, but with up to 32k it can be excessively high (sec 5.3.4). So cap the actual number at 2 (configurable through the ERST_MAX_SEGS macro), which seems like a reasonable quantity. It is supported by any xHC because the limit in the HCSPARAMS2 register is defined as a power of 2. Renesas uPD720201 and VIA VL805 controllers do not support more than 2 ERST entries. An alternative to increasing the number of Event Ring segments would be an increase of the segment size. But that requires allocating multiple contiguous pages, which may be impossible if memory is fragmented. Signed-off-by: Jonathan Bell Signed-off-by: Lukas Wunner Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-6-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 044818a6cd808b38a5d179a5fb9940417de4ba24 Author: Lukas Wunner Date: Thu Oct 19 13:29:09 2023 +0300 xhci: Set DESI bits in ERDP register correctly When using more than one Event Ring segment (ERSTSZ > 1), software shall set the DESI bits in the ERDP register to the number of the segment to which the upper ERDP bits are pointing. The xHC may use the DESI bits as a shortcut to determine whether it needs to check for an Event Ring Full condition: If it's enqueueing events in a different segment, it need not compare its internal Enqueue Pointer with the Dequeue Pointer in the upper bits of the ERDP register (sec 5.5.2.3.3). Not setting the DESI bits correctly can result in the xHC enqueueing events past the Dequeue Pointer. On Renesas uPD720201 host controllers, incorrect DESI bits cause an interrupt storm. For comparison, VIA VL805 host controllers do not exhibit such problems. Perhaps they do not take advantage of the optimization afforded by the DESI bits. To fix the issue, assign the segment number to each struct xhci_segment in xhci_segment_alloc(). When advancing the Dequeue Pointer in xhci_update_erst_dequeue(), write the segment number to the DESI bits. On driver probe, set the DESI bits to zero in xhci_set_hc_event_deq() as processing starts in segment 0. Likewise on driver teardown, clear the DESI bits to zero in xhci_free_interrupter() when clearing the upper bits of the ERDP register. Previously those functions (incorrectly) treated the DESI bits as if they're declared RsvdP. Signed-off-by: Lukas Wunner Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-5-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit e2d3ac9cd917c2b0576e4a571387464053fdc507 Author: Mathias Nyman Date: Thu Oct 19 13:29:08 2023 +0300 xhci: expand next_trb() helper to support more ring types The next_trb() helper relies on a link TRB at the end of a ring segment to know a segment ends. This works well with transfer rings that use link trbs, but not with event rings. Event rings segments are always filled by host to segment size before moving to next segment. It does not use link TRBs Check for both link trb and full segment in next_trb() helper to support event rings. Useful if several interrupters with several event rings are supported. Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 15626ba96559ed82bba1758da0ea1f260c5c55e6 Author: Mathias Nyman Date: Thu Oct 19 13:29:07 2023 +0300 xhci: Add busnumber to port tracing With several xhci controllers active at the same time its hard to keep track of ports without knowing bus number Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-3-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 992848132e4a3eec9f7c8d3d4ff4bec189abddb1 Author: Mathias Nyman Date: Thu Oct 19 13:29:06 2023 +0300 xhci: pass port structure to tracing instead of port number We want to trace other port structure members than just port number so pass entire port structure as parameter instead of just port number. Dig the port number from the port structure. Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20231019102924.2797346-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 3249888c1b8c9d9fdad9f818e7ac5d7646ff91a1 Author: Soumya Negi Date: Thu Oct 19 18:55:23 2023 -0700 staging: vme_user: Use dev_err() in vme_check_window() vme_check_window() uses printk() for logging error message. This leads to the following checkpatch warning: WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... Use dev_err() instead. Pass VME bridge device to vme_check_window() so that the error message can be logged with the bridge device context. Signed-off-by: Soumya Negi Suggested-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/221344ede933b1d9e6c31310b0f4dbb8be809c86.1697763267.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit c6054f43f782abcfc4ac887209c061a512bbab47 Author: Soumya Negi Date: Thu Oct 19 18:55:22 2023 -0700 staging: vme_user: Remove NULL-checks Don't check for empty bridge device & resource in vme_alloc_consistent() & vme_free_consistent() since they can not be NULL. Both the VME bridge device and the VME resource that are used in these functions are set at probe time. Signed-off-by: Soumya Negi Suggested-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/049bbedf458e8ac40f3dfff9c9b25dce89f5b642.1697763267.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit 08c7bee3b3863eab155222b177cecf8aeaaa1232 Author: Soumya Negi Date: Thu Oct 19 18:55:21 2023 -0700 staging: vme_user: Remove printk() in find_bridge() Don't log error message in find_bridge(). The printk() triggers a checkpatch warning: WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... It can't be replaced by dev_err() & using pr_err() is not helpful as it doesn't give much context to the user. It is better to remove it. Signed-off-by: Soumya Negi Suggested-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/028725ebbc522f73c39f5b1ec4cc2bdbdf588971.1697763267.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit d964afa772e13628fafb1c77faa58341a1d8aa91 Author: Soumya Negi Date: Thu Oct 19 18:55:20 2023 -0700 staging: vme_user: Use __func__ instead of function name Replace function names in message strings with __func__ to fix all checkpatch warnings like: WARNING: Prefer using '"%s...", __func__' to using 'vme_lm_get', this function's name, in a string Signed-off-by: Soumya Negi Acked-by: Andi Shyti Link: https://lore.kernel.org/r/db4ad6b878c4bb08fd5d15cf4a9287d7bb8c30df.1697763267.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3ad533b3fb9bd7ab0582497f67cf6b7b38bdb868 Author: Soumya Negi Date: Thu Oct 19 18:55:19 2023 -0700 staging: vme_user: Replace printk() with dev_*() vme.c uses printk() to log messages. To improve and standardize message formatting, use logging mechanisms dev_err()/dev_warn() instead. Retain the printk log levels of the messages during replacement. Issue found by checkpatch.pl Signed-off-by: Soumya Negi Acked-by: Andi Shyti Link: https://lore.kernel.org/r/a36a0b839f9c21efe1f2df6f9272ae882fd04fb8.1697763267.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit 218f1c140217cb782bd695ff0cd53a48a95ebaf6 Author: Gary Rookard Date: Fri Oct 20 21:47:59 2023 -0400 staging: rtl8192e: renamed variable HTUpdateDefaultSetting Renamed from Pascal/CamelCase to Snake case the variable HTUpdateDefaultSetting, HTUpateDefaultSetting -> ht_update_default_setting Linux kernel coding style (cleanup), checkpatch Avoid CamelCase. Driver rtl8192e compiles. Signed-off-by: Gary Rookard Link: https://lore.kernel.org/r/20231021014759.29844-1-garyrookard@fastmail.org Signed-off-by: Greg Kroah-Hartman commit 3cad0b9d0bdd3092f0b1b620e2375d8cc94c82f6 Author: Dorcas AnonoLitunya Date: Thu Oct 19 13:13:37 2023 +0300 staging: sm750fb: Remove unused return variable in program_mode_registers() Drops variable ret as it is unused in the code. This therefore modifies the return type of program_mode_registers() to void from int since the return value is being ignored in all function calls. This improves code readability and maintainability. Suggested-by: Greg Kroah-Hartman Signed-off-by: Dorcas AnonoLitunya Link: https://lore.kernel.org/r/20231019101348.22076-3-anonolitunya@gmail.com Signed-off-by: Greg Kroah-Hartman commit 45e173c0372a7bdd0eb543076e3b4c79fab38555 Author: Calvince Otieno Date: Thu Oct 19 10:28:39 2023 +0300 staging: bcm2835-audio: remove function snd_bcm2835_new_ctl() The function snd_bcm2835_new_ctl() is declared but not defined. Its definition was removed 1 year ago in the commit 143b67f19ba1 ("staging: bcm2835-audio: remove compat ALSA card") Signed-off-by: Calvince Otieno Link: https://lore.kernel.org/r/ZTDap2d5X7eXXPo2@lab-ubuntu Signed-off-by: Greg Kroah-Hartman commit 6e933215c55518b03e0f279c7ae038e387ce4470 Author: Soumya Negi Date: Tue Oct 17 21:46:07 2023 -0700 staging: gdm724x: Add blank line after declaration Fix WARNING: Missing a blank line after declarations Issue found by checkpatch.pl Signed-off-by: Soumya Negi Acked-by: Andi Shyti Link: https://lore.kernel.org/r/20231018044609.22616-1-soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit cf4381ee0bdb3c6a15d4b3e62fc4055050939772 Author: Calvince Otieno Date: Thu Oct 19 09:55:20 2023 +0300 staging: vme_user: replace strcpy with strscpy Checkpatch suggests using strscpy() instead of strcpy(). The advantages of strscpy() are that it always adds a NUL terminator and prevents read/write overflows if the source string is not properly terminated. strcpy() lacks built-in bounds checking for the destination buffer, making it susceptible to buffer overflows. These overflows can lead to various unpredictable behaviors. In this specific context, both strscpy and strcpy performs the same operation without any functional difference. The reason for this equivalence is that the driver_name string "vme_fake" is shorter than the size of the fake_bridge->name array which is defined as 16 characters (struct vme_bridge {char name[VMENAMSIZ];...}). Thus, there is no risk of buffer overflow in either case. VMENAMSIZ variable holds a constant value of 16 (#define VMENAMSIZ 16) The null-terminated "vme_fake" string (static const char driver_name[] = "vme_fake";) can be safely copied into fake_bridge->name using either strscpy or strcpy. While using strscpy() does not address any bugs, it is considered a better practice and aligns with checkpatch recommendations. Reviewed-by: Dan Carpenter Signed-off-by: Calvince Otieno Link: https://lore.kernel.org/r/ZTDS2H48JBUTiwZi@lab-ubuntu Signed-off-by: Greg Kroah-Hartman commit 017b9ef371e06f852e52b290e4e3c5b5fdf9ceba Author: Umang Jain Date: Thu Oct 19 14:31:28 2023 +0530 staging: vc04_services: bcm2835-camera: Drop MODULE_ALIAS Drop MODULE_ALIAS in favour of MODULE_DEVICE_TABLE as the module alias should be picked from there. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/20231019090128.430297-4-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 79ab0ca23abfc055f76a39839a89e03835bd06cc Author: Umang Jain Date: Thu Oct 19 14:31:27 2023 +0530 staging: vc04_services: bcm2835-audio: Drop MODULE_ALIAS Drop MODULE_ALIAS in favour of MODULE_DEVICE_TABLE as the module alias should be dropped from there. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/20231019090128.430297-3-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 1fa05877588a02fdad995385eaafea4798022cd4 Author: Umang Jain Date: Thu Oct 19 14:31:26 2023 +0530 staging: vc04_services: Support module autoloading using MODULE_DEVICE_TABLE VC04 has now a independent bus vchiq_bus to register its devices. However, the module auto-loading for bcm2835-audio and bcm2835-camera currently happens through MODULE_ALIAS() macro specified explicitly. The correct way to auto-load a module, is when the alias is picked out from MODULE_DEVICE_TABLE(). In order to get there, we need to introduce vchiq_device_id and add relevant entries in file2alias.c infrastructure so that aliases can be generated. This patch targets adding vchiq_device_id and do_vchiq_entry, in order to generate those alias using the /script/mod/file2alias.c. Going forward the MODULE_ALIAS() from bcm2835-camera and bcm2835-audio will be dropped, in favour of MODULE_DEVICE_TABLE being used there. The alias format for vchiq_bus devices will be "vchiq:". Adjust the vchiq_bus_uevent() to reflect that. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/20231019090128.430297-2-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 75fd2810b08a4854af3928121a301e50376288d2 Author: Umang Jain Date: Wed Oct 18 11:22:28 2023 +0530 staging: vc04_services: vchiq_bus: Do not kfree device As per device_register() documentation, this kfree() on error path will crash. The call to put_device() is all that is needed here to free the memory. Fixes: 027e5703de6b ("staging: vc04_services: vchiq_arm: Add new bus type and device type") Signed-off-by: Umang Jain Reviewed-by: Stefan Wahren Link: https://lore.kernel.org/r/20231018055228.825524-1-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 875be090928d19ff4ae7cbaadb54707abb3befdf Author: Benjamin Poirier Date: Fri Oct 20 08:44:57 2023 -0400 staging: qlge: Retire the driver No significant improvements have been done to this driver since commit a7c3ddf29a78 ("staging: qlge: clean up debugging code in the QL_ALL_DUMP ifdef land") in January 2021. The driver should not stay in staging forever. Since it has been abandoned by the vendor and no one has stepped up to maintain it, delete it. If some users manifest themselves, the driver will be restored to drivers/net/ as suggested in the linked message. Link: https://lore.kernel.org/netdev/20231019074237.7ef255d7@kernel.org/ Suggested-by: Jakub Kicinski Cc: Manish Chopra Cc: Coiby Xu Signed-off-by: Benjamin Poirier Acked-by: Jakub Kicinski Link: https://lore.kernel.org/r/20231020124457.312449-3-benjamin.poirier@gmail.com Signed-off-by: Greg Kroah-Hartman commit 88eddb0cce1c654090d94499b7c78085b23b7c2f Author: Benjamin Poirier Date: Fri Oct 20 08:44:56 2023 -0400 staging: qlge: Update TODO Update TODO file to reflect the changes that have been done: * multiple functions were renamed to have the "qlge_" prefix in commit f8c047be5401 ("staging: qlge: use qlge_* prefix to avoid namespace clashes with other qlogic drivers") * a redundant memset() was removed in commit 953b94009377 ("staging: qlge: Initialize devlink health dump framework") * the loop boundary in ql(ge)_alloc_rx_buffers() was updated in commit e4c911a73c89 ("staging: qlge: Remove rx_ring.type") * pci_enable_msi() was replaced in commit 4eab532dca76 ("staging: qlge/qlge_main.c: Replace depracated MSI API.") * pci_dma_* were replaced in commit e955a071b9b3 ("staging: qlge: replace deprecated apis pci_dma_*") * the while loops were rewritten in commit 41e1bf811ace ("Staging: qlge: Rewrite two while loops as simple for loops") * indentation was fixed in commit 0eb79fd1e911 ("staging: qlge: cleanup indent in qlge_main.c") I also slipped in one new TODO item, naughty me! Signed-off-by: Benjamin Poirier Acked-by: Jakub Kicinski Link: https://lore.kernel.org/r/20231020124457.312449-2-benjamin.poirier@gmail.com Signed-off-by: Greg Kroah-Hartman commit 39cd06e3f7b75b629f2987aa51ab26fb820d167b Merge: e6d0c13e9f46f 45f1b12e0366a Author: Takashi Iwai Date: Sat Oct 21 09:49:15 2023 +0200 Merge tag 'asoc-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v6.7 This is quite a large set of changes but mostly due to API cleanups and in driver specific ways rather than due to anything subsystem wide. Highlights include: - Standardisation of API prefixes on snd_soc_, removing asoc_. - GPIO API usage improvements. - Support for HDA patches. - Lots of work on SOF, including crash dump support. - Support for AMD platforms with es83xx, Awinc AT87390, many Intel platforms, many Mediatek platforms, Qualcomm SM6115, Richtek RTQ9128 and Texas Instruments TAS575x. [ the merge conflicts around SOF Intel HD-audio and CS35L41 subcodec drivers are resolved here -- tiwai ] commit 75e7d0b2d22370c83c6dcb0cedbd0cca74383b5e Author: Justin Stitt Date: Thu Oct 19 18:21:22 2023 +0000 net: wwan: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect chinfo.name to be NUL-terminated based on its use with format strings and sprintf: rpmsg/rpmsg_char.c 165: dev_err(dev, "failed to open %s\n", eptdev->chinfo.name); 368: return sprintf(buf, "%s\n", eptdev->chinfo.name); ... and with strcmp(): | static struct rpmsg_endpoint *qcom_glink_create_ept(struct rpmsg_device *rpdev, | rpmsg_rx_cb_t cb, | void *priv, | struct rpmsg_channel_info | chinfo) | ... | const char *name = chinfo.name; | ... | if (!strcmp(channel->name, name)) Since chinfo is initialized as such (just above the strscpy()): | struct rpmsg_channel_info chinfo = { | .src = rpwwan->rpdev->src, | .dst = RPMSG_ADDR_ANY, | }; ... we know other members are zero-initialized. This means no NUL-padding is required (as any NUL-byte assignments are redundant). Considering the above, a suitable replacement is `strscpy` due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231019-strncpy-drivers-net-wwan-rpmsg_wwan_ctrl-c-v2-1-ecf9b5a39430@google.com Signed-off-by: Jakub Kicinski commit a1e4c334cbc9a80578c3784f8a3e7076bb19578d Author: Su Hui Date: Thu Oct 19 16:33:52 2023 +0800 pds_core: add an error code check in pdsc_dl_info_get check the value of 'ret' after call 'devlink_info_version_stored_put'. Signed-off-by: Su Hui Reviewed-by: Shannon Nelson Link: https://lore.kernel.org/r/20231019083351.1526484-1-suhui@nfschina.com Signed-off-by: Jakub Kicinski commit 469d31745b9fb3a87424b311abb7cb530611404f Author: Rob Herring Date: Mon Oct 9 12:29:14 2023 -0500 power: reset: vexpress: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Acked-by: Sudeep Holla Link: https://lore.kernel.org/r/20231009172923.2457844-19-robh@kernel.org Signed-off-by: Sebastian Reichel commit e186bd1ac2f984f525b319924cfb0e197051ba47 Merge: afc88dfda0139 8894b43254885 Author: Sebastian Reichel Date: Sat Oct 21 00:55:43 2023 +0200 Merge power-supply fixes for 6.6 cycle Merge power-supply fixes for the 6.6 cycle, so that changes to the vexpress driver apply cleanly. Signed-off-by: Sebastian Reichel commit afc88dfda013970bb1e214b331e99adca2f98312 Author: Justin Stitt Date: Fri Oct 20 19:46:11 2023 +0000 power: supply: surface-charger: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect ac->name to be NUL-terminated based on its usage with format strings: surface_charger.c: 190: ac->psy_desc.name = ac->name; ... power_supply_core.c: 174: dev_dbg(&psy->dev, "%s: Found supply : %s\n", 175: psy->desc->name, epsy->desc->name); Moreover, NUL-padding is not required as ac is already zero-allocated before being passed to spwr_ac_init(): surface_charger.c: 240: ac = devm_kzalloc(&sdev->dev, sizeof(*ac), GFP_KERNEL); 241: if (!ac) 242: return -ENOMEM; 243: 244: spwr_ac_init(ac, sdev, p->registry, p->name); ... this means any future NUL-byte assignments (like the ones that strncpy() does) are redundant. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Let's also opt for the more idiomatic strscpy() usage of: (dest, src, sizeof(dest)) Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-surface_charger-c-v1-1-93ddbf668e10@google.com Signed-off-by: Sebastian Reichel commit 81f07d2b0c4db3b6e53d90419db915c75beb6326 Author: Justin Stitt Date: Fri Oct 20 19:39:02 2023 +0000 power: supply: surface_battery: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect bat->name to be NUL-terminated based on its usage with strcmp(): power_supply_core.c: 445: return strcmp(psy->desc->name, name) == 0; ... and also by the manual `... - 1` for the length argument of the original strncpy() invocation. Furthermore, no NUL-padding is needed as bat is zero-allocated before calling spwr_battery_init(): 826: bat = devm_kzalloc(&sdev->dev, sizeof(*bat), GFP_KERNEL); 827: if (!bat) 828: return -ENOMEM; 829: 830: spwr_battery_init(bat, sdev, p->registry, p->name); ... this means any further NUL-byte assignments (like the ones that strncpy() does) are redundant. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Let's also opt to use the more idiomatic strscpy() usage of: (dest, src, sizeof(dest)). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-surface_battery-c-v2-1-29ed16b2caf1@google.com Signed-off-by: Sebastian Reichel commit e1402bd297a3477c16eca4c1e4094372237f40a7 Author: Justin Stitt Date: Fri Oct 20 19:21:46 2023 +0000 power: supply: charger-manager: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect cm->psy_name_buf to be NUL-terminated based on its usage with format strings: 1522: cm->charger_psy_desc.name = cm->psy_name_buf; ... 1587: dev_err(&pdev->dev, "Cannot register charger-manager with name \"%s\"\n", 1587: cm->charger_psy_desc.name); Moreover, NUL-padding is not required as `cm` is already zero-allocated and thus any future NUL-byte assignments (like what strncpy() will do) are redundant: 1437: cm = devm_kzalloc(&pdev->dev, sizeof(*cm), GFP_KERNEL); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Let's also opt for the more idiomatic strscpy() usage of: strscpy(dest, src, sizeof(dest)). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-charger-manager-c-v1-1-698f73bcad2a@google.com Signed-off-by: Sebastian Reichel commit afb0379b0f6657b9f626d23c3bb00b4e8823bd2d Author: Justin Stitt Date: Fri Oct 20 19:11:07 2023 +0000 power: supply: bq25980: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect bq->model_name to be NUL-terminated based on its usage with sysfs_emit and format strings: val->strval is assigned to bq->model_name in bq25980_get_charger_property(): | val->strval = bq->model_name; ... then in power_supply_sysfs.c we use value.strval with a format string: | ret = sysfs_emit(buf, "%s\n", value.strval); we assigned value.strval via: | ret = power_supply_get_property(psy, psp, &value); ... which invokes psy->desc->get_property(): | return psy->desc->get_property(psy, psp, val); with bq25980_get_charger_property(): | static const struct power_supply_desc bq25980_power_supply_desc = { ... | .get_property = bq25980_get_charger_property, Moreover, no NUL-padding is required as bq is zero-allocated in bq25980_charger.c: | bq = devm_kzalloc(dev, sizeof(*bq), GFP_KERNEL); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Let's also opt to use the more idiomatic strscpy() usage of (dest, src, sizeof(dest)) as this more closely ties the destination buffer and the length. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Similar-to: https://lore.kernel.org/all/20231020-strncpy-drivers-power-supply-bq24190_charger-c-v1-1-e896223cb795@google.com/ Similar-to: https://lore.kernel.org/all/20231020-strncpy-drivers-power-supply-bq2515x_charger-c-v1-1-46664c6edf78@google.com/ Signed-off-by: Justin Stitt Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-bq25980_charger-c-v1-1-7b93be54537b@google.com Signed-off-by: Sebastian Reichel commit 056a75599f5e676d497bbf9b29157877f542e56b Author: Justin Stitt Date: Fri Oct 20 19:05:25 2023 +0000 power: supply: bq256xx: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect bq->model_name to be NUL-terminated based on its usage with sysfs_emit and format strings: val->strval is assigned to bq->model_name in bq256xx_get_charger_property(): | val->strval = bq->model_name; ... then in power_supply_sysfs.c we use value.strval with a format string: | ret = sysfs_emit(buf, "%s\n", value.strval); we assigned value.strval via: | ret = power_supply_get_property(psy, psp, &value); ... which invokes psy->desc->get_property(): | return psy->desc->get_property(psy, psp, val); with bq256xx_get_charger_property(): | static const struct power_supply_desc bq256xx_power_supply_desc = { ... | .get_property = bq256xx_get_charger_property, Moreover, no NUL-padding is required as bq is zero-allocated in bq256xx_charger.c: | bq = devm_kzalloc(dev, sizeof(*bq), GFP_KERNEL); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Let's also opt to use the more idiomatic strscpy() usage of (dest, src, sizeof(dest)) as this more closely ties the destination buffer and the length. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Similar-to: https://lore.kernel.org/all/20231020-strncpy-drivers-power-supply-bq24190_charger-c-v1-1-e896223cb795@google.com/ Similar-to: https://lore.kernel.org/all/20231020-strncpy-drivers-power-supply-bq2515x_charger-c-v1-1-46664c6edf78@google.com/ Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-bq256xx_charger-c-v1-1-2fad856124f9@google.com Signed-off-by: Sebastian Reichel commit e3c2af5d49bb96ad460ef6aa873975fb0f7c7f17 Author: Justin Stitt Date: Fri Oct 20 18:59:34 2023 +0000 power: supply: bq2515x: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect bq2515x->model_name to be NUL-terminated based on its usage with sysfs_emit and format strings: val->strval is assigned to bq2515x->model_name in bq2515x_mains_get_property(): | val->strval = bq2515x->model_name; ... then in power_supply_sysfs.c we use value.strval with a format string: | ret = sysfs_emit(buf, "%s\n", value.strval); we assigned value.strval via: | ret = power_supply_get_property(psy, psp, &value); ... which invokes psy->desc->get_property(): | return psy->desc->get_property(psy, psp, val); with bq2515x_mains_get_property(): | static const struct power_supply_desc bq2515x_mains_desc = { ... | .get_property = bq2515x_mains_get_property, Moreover, no NUL-padding is required as bq2515x is zero-allocated in bq2515x_charger.c: | bq2515x = devm_kzalloc(dev, sizeof(*bq2515x), GFP_KERNEL); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Let's also opt to use the more idiomatic strscpy() usage of (dest, src, sizeof(dest)) as this more closely ties the destination buffer and the length. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Similar-to: https://lore.kernel.org/all/20231020-strncpy-drivers-power-supply-bq24190_charger-c-v1-1-e896223cb795@google.com/ Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-bq2515x_charger-c-v1-1-46664c6edf78@google.com Signed-off-by: Sebastian Reichel commit b0009b8bed98bd5d59449af48781703df261c247 Author: Justin Stitt Date: Fri Oct 20 18:14:47 2023 +0000 power: supply: bq24190_charger: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect bdi->model_name to be NUL-terminated based on its usage with sysfs_emit and format strings: val->strval is assigned to bdi->model_name in bq24190_charger_get_property(): 1186 | val->strval = bdi->model_name; ... then in power_supply_sysfs.c we use value.strval with a format string: 311 | ret = sysfs_emit(buf, "%s\n", value.strval); we assigned value.strval via: 285 | ret = power_supply_get_property(psy, psp, &value); ... which invokes psy->desc->get_property(): 1210 | return psy->desc->get_property(psy, psp, val); with bq24190_charger_get_property(): 1320 | static const struct power_supply_desc bq24190_charger_desc = { ... 1325 | .get_property = bq24190_charger_get_property, Moreover, no NUL-padding is required as bdi is zero-allocated in bq24190_charger.c: 1798 | bdi = devm_kzalloc(dev, sizeof(*bdi), GFP_KERNEL); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231020-strncpy-drivers-power-supply-bq24190_charger-c-v1-1-e896223cb795@google.com Signed-off-by: Sebastian Reichel commit cf559a416f9bc061f3b96f8afc6ceae5eec9b2b0 Merge: da1055b673f3b d440ba91ca4d3 Author: Alexei Starovoitov Date: Fri Oct 20 10:12:55 2023 -0700 Merge branch 'bpf-fixes-for-per-cpu-kptr' Hou Tao says: ==================== bpf: Fixes for per-cpu kptr From: Hou Tao Hi, The patchset aims to fix the problems found in the review of per-cpu kptr patch-set [0]. Patch #1 moves pcpu_lock after the invocation of pcpu_chunk_addr_search() and it is a micro-optimization for free_percpu(). The reason includes it in the patch is that the same logic is used in newly-added API pcpu_alloc_size(). Patch #2 introduces pcpu_alloc_size() for dynamic per-cpu area. Patch #2 and #3 use pcpu_alloc_size() to check whether or not unit_size matches with the size of underlying per-cpu area and to select a matching bpf_mem_cache. Patch #4 fixes the freeing of per-cpu kptr when these kptrs are freed by map destruction. The last patch adds test cases for these problems. Please see individual patches for details. And comments are always welcome. Change Log: v3: * rebased on bpf-next * patch 2: update API document to note that pcpu_alloc_size() doesn't support statically allocated per-cpu area. (Dennis) * patch 1 & 2: add Acked-by from Dennis v2: https://lore.kernel.org/bpf/20231018113343.2446300-1-houtao@huaweicloud.com/ * add a new patch "don't acquire pcpu_lock for pcpu_chunk_addr_search()" * patch 2: change type of bit_off and end to unsigned long (Andrew) * patch 2: rename the new API as pcpu_alloc_size and follow 80-column convention (Dennis) * patch 5: move the common declaration into bpf.h (Stanislav, Alxei) v1: https://lore.kernel.org/bpf/20231007135106.3031284-1-houtao@huaweicloud.com/ [0]: https://lore.kernel.org/bpf/20230827152729.1995219-1-yonghong.song@linux.dev ==================== Link: https://lore.kernel.org/r/20231020133202.4043247-1-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit d440ba91ca4d3004709876779d40713a99e21f6a Author: Hou Tao Date: Fri Oct 20 21:32:02 2023 +0800 selftests/bpf: Add more test cases for bpf memory allocator Add the following 3 test cases for bpf memory allocator: 1) Do allocation in bpf program and free through map free 2) Do batch per-cpu allocation and per-cpu free in bpf program 3) Do per-cpu allocation in bpf program and free through map free For per-cpu allocation, because per-cpu allocation can not refill timely sometimes, so test 2) and test 3) consider it is OK for bpf_percpu_obj_new_impl() to return NULL. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20231020133202.4043247-8-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit e383a45902337356d9ccad797094a27c6b2150f9 Author: Hou Tao Date: Fri Oct 20 21:32:01 2023 +0800 bpf: Use bpf_global_percpu_ma for per-cpu kptr in __bpf_obj_drop_impl() The following warning was reported when running "./test_progs -t test_bpf_ma/percpu_free_through_map_free": ------------[ cut here ]------------ WARNING: CPU: 1 PID: 68 at kernel/bpf/memalloc.c:342 CPU: 1 PID: 68 Comm: kworker/u16:2 Not tainted 6.6.0-rc2+ #222 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) Workqueue: events_unbound bpf_map_free_deferred RIP: 0010:bpf_mem_refill+0x21c/0x2a0 ...... Call Trace: ? bpf_mem_refill+0x21c/0x2a0 irq_work_single+0x27/0x70 irq_work_run_list+0x2a/0x40 irq_work_run+0x18/0x40 __sysvec_irq_work+0x1c/0xc0 sysvec_irq_work+0x73/0x90 asm_sysvec_irq_work+0x1b/0x20 RIP: 0010:unit_free+0x50/0x80 ...... bpf_mem_free+0x46/0x60 __bpf_obj_drop_impl+0x40/0x90 bpf_obj_free_fields+0x17d/0x1a0 array_map_free+0x6b/0x170 bpf_map_free_deferred+0x54/0xa0 process_scheduled_works+0xba/0x370 worker_thread+0x16d/0x2e0 kthread+0x105/0x140 ret_from_fork+0x39/0x60 ret_from_fork_asm+0x1b/0x30 ---[ end trace 0000000000000000 ]--- The reason is simple: __bpf_obj_drop_impl() does not know the freeing field is a per-cpu pointer and it uses bpf_global_ma to free the pointer. Because bpf_global_ma is not a per-cpu allocator, so ksize() is used to select the corresponding cache. The bpf_mem_cache with 16-bytes unit_size will always be selected to do the unmatched free and it will trigger the warning in free_bulk() eventually. Because per-cpu kptr doesn't support list or rb-tree now, so fix the problem by only checking whether or not the type of kptr is per-cpu in bpf_obj_free_fields(), and using bpf_global_percpu_ma to these kptrs. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20231020133202.4043247-7-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit e581a3461de3f129cfe888a67d9f31086328271f Author: Hou Tao Date: Fri Oct 20 21:32:00 2023 +0800 bpf: Move the declaration of __bpf_obj_drop_impl() to bpf.h both syscall.c and helpers.c have the declaration of __bpf_obj_drop_impl(), so just move it to a common header file. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20231020133202.4043247-6-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 3f2189e4f77b7a3e979d143dc4ff586488c7e8a5 Author: Hou Tao Date: Fri Oct 20 21:31:59 2023 +0800 bpf: Use pcpu_alloc_size() in bpf_mem_free{_rcu}() For bpf_global_percpu_ma, the pointer passed to bpf_mem_free_rcu() is allocated by kmalloc() and its size is fixed (16-bytes on x86-64). So no matter which cache allocates the dynamic per-cpu area, on x86-64 cache[2] will always be used to free the per-cpu area. Fix the unbalance by checking whether the bpf memory allocator is per-cpu or not and use pcpu_alloc_size() instead of ksize() to find the correct cache for per-cpu free. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20231020133202.4043247-5-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit baa8fdecd87bb8751237b45e3bcb5a179e5a12ca Author: Hou Tao Date: Fri Oct 20 21:31:58 2023 +0800 bpf: Re-enable unit_size checking for global per-cpu allocator With pcpu_alloc_size() in place, check whether or not the size of the dynamic per-cpu area is matched with unit_size. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20231020133202.4043247-4-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit b460bc8302f222d346f0c15bba980eb8c36d6278 Author: Hou Tao Date: Fri Oct 20 21:31:57 2023 +0800 mm/percpu.c: introduce pcpu_alloc_size() Introduce pcpu_alloc_size() to get the size of the dynamic per-cpu area. It will be used by bpf memory allocator in the following patches. BPF memory allocator maintains per-cpu area caches for multiple area sizes and its free API only has the to-be-freed per-cpu pointer, so it needs the size of dynamic per-cpu area to select the corresponding cache when bpf program frees the dynamic per-cpu pointer. Acked-by: Dennis Zhou Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20231020133202.4043247-3-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 845e31e1101fc8533be52aff42d8f1ff48636024 Author: Jonathan Corbet Date: Fri Oct 20 14:38:49 2023 -0600 seq_buf: fix a misleading comment The comment for seq_buf_has_overflowed() says that an overflow condition is marked by len == size, but that's not what the code is testing. Make the comment match reality. Link: https://lkml.kernel.org/r/87pm19kp0m.fsf@meer.lwn.net Fixes: 8cd709ae7658a ("tracing: Have seq_buf use full buffer") Signed-off-by: Jonathan Corbet Signed-off-by: Steven Rostedt (Google) commit 5b2c54e0d0ea09f7a3b500510731878326e1117e Author: Rodrigo Siqueira Date: Mon Oct 16 08:19:18 2023 -0600 drm/amd/display: Fix stack size issue on DML2 This commit is the last part of the fix that reduces the stack size in the DML2 code. Cc: Stephen Rothwell Cc: Alex Deucher Cc: Roman Li Cc: Chaitanya Dhere Fixes: 7966f319c66d ("drm/amd/display: Introduce DML2") Tested-by: Stephen Rothwell Acked-by: Alex Deucher Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit b141fa036c901303ca5659cc22e9c08f8b097892 Author: Rodrigo Siqueira Date: Mon Oct 16 08:19:17 2023 -0600 drm/amd/display: Reduce stack size by splitting function When compiling with allmodconfig, gcc highlights the following error: drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/display_mode_core.c: In function 'dml_core_mode_support': drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/display_mode_core.c:8229:1: error: the frame size of 2736 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] 8229 | } // dml_core_mode_support | ^ cc1: all warnings being treated as errors This commit mitigates part of this problem by extracting the prefetch code to its own function. After applying this commit, the stack size reduces from 2736 to 2464, however, the stack size issue becomes part of the new function. Cc: Stephen Rothwell Cc: Alex Deucher Cc: Roman Li Cc: Chaitanya Dhere Fixes: 7966f319c66d ("drm/amd/display: Introduce DML2") Tested-by: Stephen Rothwell Acked-by: Alex Deucher Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 7ef6b2d4b7e5c0d105c688a4da1f0ac122e3aa44 Author: Alex Sierra Date: Tue Oct 17 17:08:56 2023 -0500 drm/amdkfd: remap unaligned svm ranges that have split Split SVM ranges that have been mapped into 2MB page table entries, require to be remap in case the split has happened in a non-aligned VA. [WHY]: This condition causes the 2MB page table entries be split into 4KB PTEs. Signed-off-by: Alex Sierra Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit de009982c6aa8363b2bc8800fb0a13896d264853 Author: André Almeida Date: Fri Sep 15 18:44:53 2023 +0200 drm/amdgpu: Create version number for coredumps Even if there's nothing currently parsing amdgpu's coredump files, if we eventually have such tools they will be glad to find a version field to properly read the file. Create a version number to be displayed on top of coredump file, to be incremented when the file format or content get changed. Signed-off-by: André Almeida Reviewed-by: Shashank Sharma Signed-off-by: Alex Deucher commit 69619868d39bf364721db8d9d2429420704417a3 Author: André Almeida Date: Fri Sep 15 16:44:16 2023 +0200 drm/amdgpu: Move coredump code to amdgpu_reset file Giving that we use codedump just for device resets, move it's functions and structs to a more semantic file, the amdgpu_reset.{c, h}. Signed-off-by: André Almeida Signed-off-by: Shashank Sharma Reviewed-by: Shashank Sharma Signed-off-by: Alex Deucher commit 2d6a2a28cdeade75021503f86e57e7ebce7eb74c Author: André Almeida Date: Fri Sep 15 16:38:59 2023 +0200 drm/amdgpu: Encapsulate all device reset info To better organize struct amdgpu_device, keep all reset information related fields together in a separated struct. Signed-off-by: André Almeida Signed-off-by: Shashank Sharma Reviewed-by: Shashank Sharma Signed-off-by: Alex Deucher commit 723fac64d05d7005929babbeb41dd09fb45f6f35 Author: Shiwu Zhang Date: Thu Sep 21 20:05:12 2023 +0800 drm/amdgpu: support the port num info based on the capability flag XGMI TA will set the capability flag to indicate whether the port_num info is supported or not. KGD checks the flag and accordingly picks up the right buffer format and send the right command to TA to retrieve the info. v2: simplify the code by reusing the same statement (lijo) Signed-off-by: Shiwu Zhang Acked-by: Lijo Lazar Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit e8a5ded36b4c68db4e0d4066ae2d420116715105 Author: Shiwu Zhang Date: Wed Sep 20 18:36:55 2023 +0800 drm/amdgpu: prepare the output buffer for GET_PEER_LINKS command Per the xgmi ta implementation, KGD needs to fill in node_ids in concern into the shared command output buffer rather than the command input buffer. Input buffer is not used for GET_PEER_LINKS command execution. In this way, xgmi ta can reuse the node info in the output buffer just filled in and populate the same buffer with link info directly. Signed-off-by: Shiwu Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit d9443ac4f9ea97f9eaebf2569d3fd044da4c9c98 Author: Tao Zhou Date: Tue Oct 17 19:06:24 2023 +0800 drm/amdgpu: drop status query/reset for GCEA 9.4.3 and MMEA 1.8 PMFW will be responsible for them. v2: remove query interfaces. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 626121fce415960522ed608a4e4949a347c9a8a3 Author: Shiwu Zhang Date: Wed Sep 20 17:05:41 2023 +0800 drm/amdgpu: update the xgmi ta interface header Update the header file to the v20.00.00.13 v1: rename TA_COMMAND_XGMI__GET_GET_TOPOLOGY_INFO to TA_COMMAND_XGMI__GET_TOPOLOGY_INFO And also rename struct ta_xgmi_cmd_get_peer_link_info_output to ta_xgmi_cmd_get_peer_link_info accordingly v2: add structs to support xgmi GET_EXTEND_PEER_LINK command Signed-off-by: Shiwu Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 8096df766474b54758b268afe900ba9d7ab0cc37 Author: Tao Zhou Date: Thu Oct 12 11:22:07 2023 +0800 drm/amdgpu: add set/get mca debug mode operations Record the debug mode status in RAS. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 21226f02d77b6a1efcf987df8d97b2a4f40087bd Author: Tao Zhou Date: Wed Oct 18 17:57:25 2023 +0800 drm/amdgpu: replace reset_error_count with amdgpu_ras_reset_error_count Simplify the code. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9d7a965e22e5c0abd1aa6aaa389a81de58ca5182 Author: Li Ma Date: Wed Oct 18 13:32:39 2023 +0800 drm/amdgpu: add clockgating support for NBIO v7.7.1 add clockgating support for NBIO ip 7.7.1 Signed-off-by: Li Ma Reviewed-by: Tim Huang Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit fa9dd7a285efbcf81dc0fc5a75bd9341e017c80f Author: Li Ma Date: Mon Oct 16 14:36:26 2023 +0800 drm/amdgpu: fix missing stuff in NBIO v7.11 add get_clockgating_state, update_medium_grain_light_sleep and update_medium_grain_clock_gating in nbio_v7_11_funcs v1: add missing funcs in nbio_v7_11.c v2: modify the if condition and add spport for nbio v7.11 clockgating. Signed-off-by: Li Ma Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 66d64e4e03ef5ecf330075a5f1fc449549ce374a Author: Stanley.Yang Date: Thu Oct 19 22:49:32 2023 +0800 drm/amdgpu: Enable RAS feature by default for APU Enable RAS feature by default for aqua vanjaram on apu platform. Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 49c260bef3ac9fc1bb73acf98036dac64712536d Author: Yang Wang Date: Thu Oct 19 14:59:19 2023 +0800 drm/amdgpu: fix typo for amdgpu ras error data print typo fix. Fixes: 5b1270beb380 ("drm/amdgpu: add ras_err_info to identify RAS error source") Signed-off-by: Yang Wang Reviewed-by: Candice Li Signed-off-by: Alex Deucher commit 017634a68dab9c2ebdcd51b495ef6e53b95280cd Author: Bokun Zhang Date: Mon Oct 16 12:51:00 2023 -0400 drm/amd/amdgpu/vcn: Add RB decouple feature under SRIOV - P4 - In VCN 4 SRIOV code path, add code to enable RB decouple feature Signed-off-by: Bokun Zhang Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit eb9d6256b9b072b29193a3a051b2f7e76e0fd0de Author: Bokun Zhang Date: Mon Oct 16 12:49:58 2023 -0400 drm/amd/amdgpu/vcn: Add RB decouple feature under SRIOV - P3 - Update VCN header for RB decouple feature - Add metadata struct, metadata will be placed after each RB Signed-off-by: Bokun Zhang Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit fc3136730ba3e606b1c892e041f0b8356bda5457 Author: Bokun Zhang Date: Mon Oct 16 12:49:11 2023 -0400 drm/amd/amdgpu/vcn: Add RB decouple feature under SRIOV - P2 - Add function to check if RB decouple is enabled under SRIOV Signed-off-by: Bokun Zhang Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 97b2821643f776c94ebcea79052f77e732d56f6d Author: Bokun Zhang Date: Mon Oct 16 12:48:02 2023 -0400 drm/amd/amdgpu/vcn: Add RB decouple feature under SRIOV - P1 - Update SRIOV header with RB decouple flag Signed-off-by: Bokun Zhang Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 8a65661114941788a2093193c251e44cf1d6439c Author: Stanley.Yang Date: Thu Oct 19 14:55:57 2023 +0800 drm/amdgpu: Fix delete nodes that have been relesed Fix delete nodes that it has been freed. Fixes: 5b1270beb380 ("drm/amdgpu: add ras_err_info to identify RAS error source") Signed-off-by: Stanley.Yang Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit ce43a5fa2eca33e602dc3c276ee7acfb458e74d3 Author: Stanley.Yang Date: Wed Oct 18 20:10:34 2023 +0800 drm/amdgpu: Enable mca debug mode mode when ras enabled Enable smu_v13_0_6 mca debug mode if ras is enabled. Changed from V1: enable mca debug mode if ras enabled. Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f2176d70638aaa1fa2a1c3068f0acedcb271a8aa Author: Hawking Zhang Date: Thu Sep 28 17:05:59 2023 +0800 drm/amdgpu: Add UVD_VCPU_INT_EN2 to dpg sram Add RAS sepcifc programming to dpg sram. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 089dbf6a06f1dcaeed4f8b86d619e8d28b235207 Author: Nathan Chancellor Date: Wed Oct 18 11:45:52 2023 -0700 drm/amd/display: Respect CONFIG_FRAME_WARN=0 in DML2 display_mode_code.c is unconditionally built with -Wframe-larger-than=2048, which causes warnings even when CONFIG_FRAME_WARN has been set to 0, which should show no warnings. Use the existing $(frame_warn_flag) variable, which handles this situation. This is basically commit 25f178bbd078 ("drm/amd/display: Respect CONFIG_FRAME_WARN=0 in dml Makefile") but for DML2. Fixes: 7966f319c66d ("drm/amd/display: Introduce DML2") Signed-off-by: Nathan Chancellor Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit b63eae94d28ccdb46c49803c6552876e5c907f4c Author: Jiapeng Chong Date: Thu Oct 19 11:38:26 2023 +0800 drm/amd/display: clean up some inconsistent indenting No functional modification involved. drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:2902 dm_resume() warn: inconsistent indenting. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6940 Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 30440201edb0eb20352f5dfb509d407f4015259d Author: Yang Li Date: Wed Oct 18 09:22:32 2023 +0800 drm/amd/display: Simplify bool conversion ./drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c:4802:84-89: WARNING: conversion to bool not needed here Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6901 Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 7e653e01a08c884c2a11cbedd3ab8bc939abb56d Author: Yang Li Date: Wed Oct 18 09:16:14 2023 +0800 drm/amd/display: Remove unneeded semicolon ./drivers/gpu/drm/amd/display/dc/dml2/dml2_dc_resource_mgmt.c:464:3-4: Unneeded semicolon Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6900 Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 00e6bcbd11570683bd0dd9bbce7446db436b71ab Author: Yang Li Date: Wed Oct 18 09:02:03 2023 +0800 drm/amd/display: Remove duplicated include in dce110_hwseq.c ./drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c: dce110_hwseq.h is included more than once. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6897 Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 803c2707c21df5d82473831aac74969924e028c5 Author: Yang Li Date: Thu Sep 28 09:13:51 2023 +0800 drm/amd/display: clean up some inconsistent indentings drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn35/dcn35_fpu.c:261 dcn35_update_bw_bounding_box_fpu() warn: inconsistent indenting Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 08e9ebc75b5bcfec9d226f9e16bab2ab7b25a39a Author: Bas Nieuwenhuizen Date: Tue Oct 17 16:01:35 2023 +0200 drm/amd/pm: Handle non-terminated overdrive commands. The incoming strings might not be terminated by a newline or a 0. (found while testing a program that just wrote the string itself, causing a crash) Cc: stable@vger.kernel.org Fixes: e3933f26b657 ("drm/amd/pp: Add edit/commit/show OD clock/voltage support in sysfs") Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Alex Deucher commit 9248462d7e0862883df6741ec0e1bb41c3698b22 Author: Hawking Zhang Date: Thu Sep 28 17:00:31 2023 +0800 drm/amdgpu: Enable software RAS in vcn v4_0_3 Set VCN/JPEG RAS masks to enable software RAS for VCN and JPEG. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 472c5fb29798695b589fb844f84c6bf4ff07c592 Author: Tao Zhou Date: Wed Oct 11 18:36:15 2023 +0800 drm/amdgpu: define ras_reset_error_count function Make the code architecture more simple. v2: reuse ras_reset_error_count in ras_reset_error_status. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f9caf6cdd5cc1f4006fd7b6b113658c0b0159f23 Author: Jesse Zhang Date: Thu Oct 19 14:39:48 2023 +0800 drm/amdkfd:remove unused code Function svm_range_split_by_grinity is not used, so it is removed. Signed-off-by: Jesse Zhang Suggested-by: Philip Yang Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 1958946858a62b6b5392ed075aa219d199bcae39 Author: Ma Jun Date: Thu Oct 12 09:33:45 2023 +0800 drm/amd/pm: Support for getting power1_cap_min value Support for getting power1_cap_min value on smu13 and smu11. For other Asics, we still use 0 as the default value. Signed-off-by: Ma Jun Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit afcf949cf331de791e3fbfc65c0bb82dd9df6d57 Author: Candice Li Date: Wed Oct 18 15:16:39 2023 +0800 drm/amdgpu: Log UE corrected by replay as correctable error Support replay mode where UE could be converted to CE. Signed-off-by: Candice Li Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 68a8f644575bde6b35c5fa8a3e6f024aa580e071 Author: Gustavo A. R. Silva Date: Mon Oct 9 13:52:45 2023 -0600 ima: Add __counted_by for struct modsig and use struct_size() Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). Also, relocate `hdr->raw_pkcs7_len = sig_len;` so that the __counted_by annotation has effect, and flex-array member `raw_pkcs7` can be properly bounds-checked at run-time. While there, use struct_size() helper, instead of the open-coded version, to calculate the size for the allocation of the whole flexible structure, including of course, the flexible-array member. This code was found with the help of Coccinelle, and audited and fixed manually. Signed-off-by: "Gustavo A. R. Silva" Reviewed-by: Mimi Zohar Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/ZSRaDcJNARUUWUwS@work Signed-off-by: Kees Cook commit 934bf871f0113e1e57cfa262dcbc9aad5fa0a252 Author: Oliver Upton Date: Wed Oct 18 23:32:12 2023 +0000 KVM: arm64: Load the stage-2 MMU context in kvm_vcpu_load_vhe() To date the VHE code has aggressively reloaded the stage-2 MMU context on every guest entry, despite the fact that this isn't necessary. This was probably done for consistency with the nVHE code, which needs to switch in/out the stage-2 MMU context as both the host and guest run at EL1. Hoist __load_stage2() into kvm_vcpu_load_vhe(), thus avoiding a reload on every guest entry/exit. This is likely to be beneficial to systems with one of the speculative AT errata, as there is now one fewer context synchronization event on the guest entry path. Additionally, it is possible that implementations have hitched correctness mitigations on writes to VTTBR_EL2, which are now elided on guest re-entry. Note that __tlb_switch_to_guest() is deliberately left untouched as it can be called outside the context of a running vCPU. Link: https://lore.kernel.org/r/20231018233212.2888027-6-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 27cde4c0fe28eab228d1fc9d84c68a109219887d Author: Oliver Upton Date: Wed Oct 18 23:32:11 2023 +0000 KVM: arm64: Rename helpers for VHE vCPU load/put The names for the helpers we expose to the 'generic' KVM code are a bit imprecise; we switch the EL0 + EL1 sysreg context and setup trap controls that do not need to change for every guest entry/exit. Rename + shuffle things around a bit in preparation for loading the stage-2 MMU context on vcpu_load(). Link: https://lore.kernel.org/r/20231018233212.2888027-5-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 5eba523e1e5e83d2c1a282c3c488d98b990333c2 Author: Marc Zyngier Date: Wed Oct 18 23:32:10 2023 +0000 KVM: arm64: Reload stage-2 for VMID change on VHE Naturally, a change to the VMID for an MMU implies a new value for VTTBR. Reload on VMID change in anticipation of loading stage-2 on vcpu_load() instead of every guest entry. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231018233212.2888027-4-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 4288ff7ba195f49138eec0d9c4ff8c049714e918 Author: Marc Zyngier Date: Wed Oct 18 23:32:09 2023 +0000 KVM: arm64: Restore the stage-2 context in VHE's __tlb_switch_to_host() An MMU notifier could cause us to clobber the stage-2 context loaded on a CPU when we switch to another VM's context to invalidate. This isn't an issue right now as the stage-2 context gets reloaded on every guest entry, but is disastrous when moving __load_stage2() into the vcpu_load() path. Restore the previous stage-2 context on the way out of a TLB invalidation if we installed something else. Deliberately do this after TGE=1 is synchronized to keep things safe in light of the speculative AT errata. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20231018233212.2888027-3-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 38ce26bf26666779565c2770e7ef36c02e0212d7 Author: Oliver Upton Date: Wed Oct 18 23:32:08 2023 +0000 KVM: arm64: Don't zero VTTBR in __tlb_switch_to_host() HCR_EL2.TGE=0 is sufficient to disable stage-2 translation, so there's no need to explicitly zero VTTBR_EL2. Link: https://lore.kernel.org/r/20231018233212.2888027-2-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 50cbdaf1b93a2cc89d7712feafa76cf1b2f28adc Author: Justin Stitt Date: Thu Oct 19 23:28:32 2023 +0000 PNP: replace deprecated strncpy() with memcpy() strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous interfaces. After having precisely calculated the lengths and ensuring we don't overflow the buffer, this really decays to just a memcpy. Let's not use a C string api as it makes the intention of the code confusing. It'd be nice to use strscpy() in this case (as we clearly want NUL-termination) because it'd clean up the code a bit. However, I don't quite know enough about what is going on here to justify a drop-in replacement -- too much bit magic and why (PNP_NAME_LEN - 2)? I'm afraid using strscpy() may result in copying too many or too few bytes into our dev->name buffer resulting in different behavior. At least using memcpy() we can ensure the behavior is exactly the same. Side note: NUL-padding is not required because insert_device() calls pnpbios_parse_data_stream() with a zero-allocated `dev`: 299 | static int __init insert_device(struct pnp_bios_node *node) { ... 312 | dev = pnp_alloc_dev(&pnpbios_protocol, node->handle, id); ... 316 | pnpbios_parse_data_stream(dev, node); then pnpbios_parse_data_stream() calls pnpbios_parse_compatible_ids(). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: Rafael J. Wysocki commit eda1a74655ea282fcac56af5ca18ff1394542e29 Author: Justin Stitt Date: Thu Oct 19 22:47:58 2023 +0000 PNP: ACPI: replace deprecated strncpy() with strscpy() strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We know dev->name should be NUL-terminated based on the presence of a manual NUL-byte assignment. NUL-padding is not required as dev is already zero-allocated which renders any further NUL-byte assignments redundant: dev = pnp_alloc_dev(&pnpacpi_protocol, num, pnpid); ---> dev = kzalloc(sizeof(struct pnp_dev), GFP_KERNEL); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. This simplifies the code and makes the intent/behavior more obvious. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: Rafael J. Wysocki commit 8d7af820310cb547c4cb7bdc321c161833eba57f Author: Kees Cook Date: Wed Oct 18 17:46:20 2023 -0700 MAINTAINERS: Include stackleak paths in hardening entry While most of the gcc-plugins are self-contained in the scripts/gcc-plugins directory, stackleak actually has some additional files. Add those so changes are directed to the hardening list. Suggested-by: Mark Rutland Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20231019004616.work.960-kees@kernel.org Signed-off-by: Kees Cook commit c27d08f786aca71a94b06437d983a5518ec90ee8 Author: Rafael J. Wysocki Date: Fri Oct 13 17:14:05 2023 +0200 thermal: ACPI: Include the right header file It is not necessary to include thermal_core.h into thermal_acpi.c, because none of the code in there depends on anything in the former, except for the linux/thermal.h, but it is better to include that one directly instead of including the entire thermal_core.h, so make that change. No functional impact. Fixes: 7a0e39748861 ("thermal: ACPI: Add ACPI trip point routines") Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano commit cf3986f8c01d355490d0ac6024391b989a9d1e9d Author: Nícolas F. R. A. Prado Date: Fri Sep 22 14:44:03 2023 -0400 thermal: core: Don't update trip points inside the hysteresis range When searching for the trip points that need to be set, the nearest higher trip point's temperature is used for the high trip, while the nearest lower trip point's temperature minus the hysteresis is used for the low trip. The issue with this logic is that when the current temperature is inside a trip point's hysteresis range, both high and low trips will come from the same trip point. As a consequence instability can still occur like this: * the temperature rises slightly and enters the hysteresis range of a trip point * polling happens and updates the trip points to the hysteresis range * the temperature falls slightly, exiting the hysteresis range, crossing the trip point and triggering an IRQ, the trip points are updated * repeat So even though the current hysteresis implementation prevents instability from happening due to IRQs triggering on the same temperature value, both ways, it doesn't prevent it from happening due to an IRQ on one way and polling on the other. To properly implement a hysteresis behavior, when inside the hysteresis range, don't update the trip points. This way, the previously set trip points will stay in effect, which will in a way remember the previous state (if the temperature signal came from above or below the range) and therefore have the right trip point already set. The exception is if there was no previous trip point set, in which case a previous state doesn't exist, and so it's sensible to allow the hysteresis range as trip points. The following logs show the current behavior when running on a real machine: [ 202.524658] thermal thermal_zone0: new temperature boundaries: -2147483647 < x < 40000 203.562817: thermal_temperature: thermal_zone=vpu0-thermal id=0 temp_prev=36986 temp=37979 [ 203.562845] thermal thermal_zone0: new temperature boundaries: 37000 < x < 40000 204.176059: thermal_temperature: thermal_zone=vpu0-thermal id=0 temp_prev=37979 temp=40028 [ 204.176089] thermal thermal_zone0: new temperature boundaries: 37000 < x < 100000 205.226813: thermal_temperature: thermal_zone=vpu0-thermal id=0 temp_prev=40028 temp=38652 [ 205.226842] thermal thermal_zone0: new temperature boundaries: 37000 < x < 40000 And with this patch applied: [ 184.933415] thermal thermal_zone0: new temperature boundaries: -2147483647 < x < 40000 185.981182: thermal_temperature: thermal_zone=vpu0-thermal id=0 temp_prev=36986 temp=37872 186.744685: thermal_temperature: thermal_zone=vpu0-thermal id=0 temp_prev=37872 temp=40058 [ 186.744716] thermal thermal_zone0: new temperature boundaries: 37000 < x < 100000 187.773284: thermal_temperature: thermal_zone=vpu0-thermal id=0 temp_prev=40058 temp=38698 Fixes: 060c034a9741 ("thermal: Add support for hardware-tracked trip points") Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Co-developed-by: Rafael J. Wysocki Signed-off-by: Rafael J. Wysocki commit 8c35b1f472533b0df1b8f1f1afcaf4395cdb2256 Author: Rafael J. Wysocki Date: Thu Oct 12 20:34:50 2023 +0200 thermal: core: Pass trip pointer to governor throttle callback Modify the governor .throttle() callback definition so that it takes a trip pointer instead of a trip index as its second argument, adjust the governors accordingly and update the core code invoking .throttle(). This causes the governors to become independent of the representation of the list of trips in the thermal zone structure. This change is not expected to alter the general functionality. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit fdcf70ed4e1606cd5a5a48f666583053ae4c3978 Author: Rafael J. Wysocki Date: Thu Oct 12 20:33:28 2023 +0200 thermal: gov_step_wise: Fold update_passive_instance() into its caller Fold update_passive_instance() into thermal_zone_trip_update() that is its only caller so as to make the code in question easier to follow. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano Reviewed-by: Lukasz Luba commit 94be1d27aa8d6f0a9e09517445abf468de24fab3 Author: Rafael J. Wysocki Date: Thu Oct 12 20:31:38 2023 +0200 thermal: gov_power_allocator: Use trip pointers instead of trip indices Modify the power allocator thermal governor to use trip pointers instead of trip indices everywhere except for the power_allocator_throttle() second argument that will be changed subsequently along with the definition of the .throttle() governor callback. The general functionality is not expected to be changed. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano Reviewed-by: Lukasz Luba Tested-by: Lukasz Luba commit 276f1ede95164b54f55c82d40e9df218109704d6 Author: Rafael J. Wysocki Date: Thu Oct 12 20:29:43 2023 +0200 thermal: gov_fair_share: Rearrange get_trip_level() Make get_trip_level() use for_each_trip() to iterate over trip points and make it call thermal_zone_trip_id() to obtain the integer ID of a given trip point so as to avoid relying on the knowledge of struct thermal_zone_device internals. The general functionality is not expected to be changed. This change causes the governor to use trip pointers instead of trip indices everywhere except for the fair_share_throttle() second argument that will be modified subsequently along with the definition of the governor .throttle() callback. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano commit 234ed6f5fbedf7bc84f9adc08c3e11ca8588ffd8 Author: Rafael J. Wysocki Date: Thu Oct 12 20:26:46 2023 +0200 thermal: trip: Define for_each_trip() macro Define a new macro for_each_trip() to be used by the thermal core code and thermal governors for walking trips in a given thermal zone. Modify for_each_thermal_trip() to use this macro instead of an open- coded loop over trips. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano Reviewed-by: Lukasz Luba commit 78869767f2ad3a98d2c830b718a503d8b0a94b26 Author: Rafael J. Wysocki Date: Thu Oct 12 20:25:06 2023 +0200 thermal: trip: Simplify computing trip indices A trip index can be computed right away as a difference between the value of a trip pointer pointing to the given trip object and the start of the trips[] table in the given thermal zone, so change thermal_zone_trip_id() accordingly. No intentional functional impact (except for some speedup). Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano Reviewed-by: Lukasz Luba Tested-by: Lukasz Luba commit bb3dcf0ccf3248914233417fbc2bef0aa128f7eb Author: Raag Jadav Date: Fri Oct 20 14:17:30 2023 +0530 perf: qcom: use acpi_device_uid() for fetching _UID Convert manual _UID references to use the standard ACPI helper. Signed-off-by: Raag Jadav Signed-off-by: Rafael J. Wysocki commit 5f70fd1892e7a0c94a99c1ad2d0656fc43c1712c Author: Raag Jadav Date: Fri Oct 20 14:17:27 2023 +0530 ACPI: sysfs: use acpi_device_uid() for fetching _UID Convert manual _UID references to use the standard ACPI helper. Signed-off-by: Raag Jadav Signed-off-by: Rafael J. Wysocki commit 394e6869f0185e89cb815db29bf819474df858ae Author: Hou Tao Date: Fri Oct 20 21:31:56 2023 +0800 mm/percpu.c: don't acquire pcpu_lock for pcpu_chunk_addr_search() There is no need to acquire pcpu_lock for pcpu_chunk_addr_search(): 1) both pcpu_first_chunk & pcpu_reserved_chunk must have been initialized before the invocation of free_percpu(). 2) The dynamically-created chunk must be valid before the per-cpu pointers allocated from it are freed. So acquire pcpu_lock() after the invocation of pcpu_chunk_addr_search(). Acked-by: Dennis Zhou Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20231020133202.4043247-2-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit b5bdb60faaaff11bcfc9a90372158bc56e7ff544 Author: James Morse Date: Fri Oct 20 14:59:48 2023 +0100 ACPI: scan: Use the acpi_device_is_present() helper in more places acpi_device_is_present() checks the present or functional bits from the cached copy of _STA. A few places open-code this check. Use the helper instead to improve readability. Signed-off-by: James Morse Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Signed-off-by: Russell King (Oracle) Reviewed-by: Miguel Luis Signed-off-by: Rafael J. Wysocki commit 0c696bb38f4cc0f0f90a8e06ae1eda21a9630cd0 Merge: 411957553bca6 78b7b13f07a3c Author: Jens Axboe Date: Fri Oct 20 10:37:01 2023 -0600 Merge tag 'md-next-20231020' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-6.7/block Pull MD changes from Song: "1. Handle timeout in md-cluster, by Denis Plotnikov; 2. Cleanup pers->prepare_suspend, by Yu Kuai." * tag 'md-next-20231020' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: cleanup pers->prepare_suspend() md-cluster: check for timeout while a new disk adding commit da1055b673f3baac2249571c9882ce767a0aa746 Author: Kumar Kartikeya Dwivedi Date: Fri Oct 20 14:48:39 2023 +0000 selftests/bpf: Make linked_list failure test more robust The linked list failure test 'pop_front_off' and 'pop_back_off' currently rely on matching exact instruction and register values. The purpose of the test is to ensure the offset is correctly incremented for the returned pointers from list pop helpers, which can then be used with container_of to obtain the real object. Hence, somehow obtaining the information that the offset is 48 will work for us. Make the test more robust by relying on verifier error string of bpf_spin_lock and remove dependence on fragile instruction index or register number, which can be affected by different clang versions used to build the selftests. Fixes: 300f19dcdb99 ("selftests/bpf: Add BPF linked list API tests") Reported-by: Andrii Nakryiko Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20231020144839.2734006-1-memxor@gmail.com commit d0ed46b60396cfa7e0056f55e1ce0b43c7db57b6 Author: Matthew Wilcox (Oracle) Date: Fri Oct 20 04:35:45 2023 +0100 tracing: Move readpos from seq_buf to trace_seq To make seq_buf more lightweight as a string buf, move the readpos member from seq_buf to its container, trace_seq. That puts the responsibility of maintaining the readpos entirely in the tracing code. If some future users want to package up the readpos with a seq_buf, we can define a new struct then. Link: https://lore.kernel.org/linux-trace-kernel/20231020033545.2587554-2-willy@infradead.org Cc: Kees Cook Cc: Justin Stitt Cc: Kent Overstreet Cc: Petr Mladek Cc: Andy Shevchenko Cc: Rasmus Villemoes Cc: Sergey Senozhatsky Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Acked-by: Greg Kroah-Hartman Signed-off-by: Steven Rostedt (Google) commit 64bf2f685c795e75dd855761c75a193ee5998731 Author: Jiapeng Chong Date: Thu Oct 19 11:13:53 2023 +0800 tracefs/eventfs: Modify mismatched function name No functional modification involved. fs/tracefs/event_inode.c:864: warning: expecting prototype for eventfs_remove(). Prototype was for eventfs_remove_dir() instead. Link: https://lore.kernel.org/linux-trace-kernel/20231019031353.73846-1-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6939 Signed-off-by: Jiapeng Chong Signed-off-by: Steven Rostedt (Google) commit 7c05b44e1a50d9cbfc4f731dddc436a24ddc129a Author: Mark Hasemeyer Date: Wed Oct 18 17:59:31 2023 -0600 ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection Some Jasperlake Chromebooks overwrite the system vendor DMI value to the name of the OEM that manufactured the device. This breaks Chromebook quirk detection as it expects the system vendor to be "Google". Add another quirk detection entry that looks for "Google" in the BIOS version. Cc: stable@vger.kernel.org Signed-off-by: Mark Hasemeyer Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231018235944.1860717-1-markhas@chromium.org Signed-off-by: Takashi Iwai commit 3e36528c1127b20492ffaea53930bcc3df46a718 Author: Gil Fine Date: Thu Aug 10 22:37:16 2023 +0300 thunderbolt: Configure asymmetric link if needed and bandwidth allows USB4 v2 spec defines a Gen 4 link that can operate as an asymmetric 120/40G. When the link is asymmetric, the USB4 port on one side of the link operates with three TX lanes and one RX lane, while the USB4 port on the opposite side of the link operates with three RX lanes and one TX lane. Using asymmetric link we can get much more bandwidth from one direction and that allows us to support the new Ultra High Bit Rate DisplayPort modes (that consume up to 77.37 Gb/s). Add the basic logic for changing Gen 4 links to asymmetric and back following the below rules: 1) The default threshold is 45 Gb/s (tunable by asym_threshold) 2) When DisplayPort tunnel is established, or when there is bandwidth request through bandwidth allocation mode, the links can be transitioned to asymmetric or symmetric (depending on the required bandwidth). 3) Only DisplayPort bandwidth on a link, is taken into account when deciding whether a link is transitioned to asymmetric or symmetric 4) If bandwidth on a link is >= asym_threshold transition the link to asymmetric 5) If bandwidth on a link < asym_threshold transition the link to symmetric (unless the bandwidth request is above currently allocated on a tunnel). 6) If a USB4 v2 device router with symmetric link is connected, transition all the links above it to symmetric if the bandwidth allows. Signed-off-by: Gil Fine Co-developed-by: Mika Westerberg Signed-off-by: Mika Westerberg commit 81af2952e60603d12415e1a6fd200f8073a2ad8b Author: Gil Fine Date: Thu Aug 10 22:37:15 2023 +0300 thunderbolt: Add support for asymmetric link USB4 v2 spec defines a Gen 4 link that can operate as an aggregated symmetric (80/80G) or asymmetric (120/40G). When the link is asymmetric, the USB4 port on one side of the link operates with three TX lanes and one RX lane, while the USB4 port on the opposite side of the link operates with three RX lanes and one TX lane. Add support for the asymmetric link and provide functions that can be used to transition the link to asymmetric and back. Signed-off-by: Gil Fine Co-developed-by: Mika Westerberg Signed-off-by: Mika Westerberg commit c4ff14436952c3d0dd05769d76cf48e73a253b48 Author: Mika Westerberg Date: Mon Sep 4 09:09:34 2023 +0300 thunderbolt: Introduce tb_switch_depth() This is useful helper to find out the depth of a connected router. Convert the existing users to call this helper instead of open-coding. No functional changes. Signed-off-by: Mika Westerberg commit 956c3abe72fb6a651b8cf77c28462f7e5b6a48b1 Author: Mika Westerberg Date: Sun Sep 3 08:25:39 2023 +0300 thunderbolt: Introduce tb_for_each_upstream_port_on_path() This is useful when walking over upstream lane adapters over given path. Signed-off-by: Mika Westerberg commit 2bfeca73e94567c1a117ca45d2e8a25d63e5bd2c Author: Gil Fine Date: Thu Aug 10 22:37:14 2023 +0300 thunderbolt: Introduce tb_port_path_direction_downstream() Introduce tb_port_path_direction_downstream() to check if path from source adapter to destination adapter is directed towards downstream. Convert existing users to call this helper instead of open-coding. No functional changes. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit ce91d793ab8bc55804cdac2536bc33c249e75196 Author: Mika Westerberg Date: Fri Sep 8 12:07:47 2023 +0300 thunderbolt: Set path power management packet support bit for USB4 v2 routers USB4 v2 spec allows USB4 links that are part of a pass through tunnel (such as DisplayPort and USB 3.x Gen T) to enter lower CL states, which provide better power management. For this USB4 v2 routers in their path config space of lane 0 adapter include a new bit PMPS (PM packet support) that needs to be set. Signed-off-by: Mika Westerberg commit 582e70b0d3a412d15389a3c9c07a44791b311715 Author: Gil Fine Date: Mon Jul 31 05:25:40 2023 +0300 thunderbolt: Change bandwidth reservations to comply USB4 v2 USB4 v2 Connection Manager guide (section 6.1.2.3) suggests to reserve bandwidth in a sligthly different manner. It suggests to keep minimum of 1500 Mb/s for each path that carry a bulk traffic. Here we change the bandwidth reservations to comply to the above for USB 3.x and PCIe protocols over Gen 4 link, taking weights into account (that's 1500 Mb/s for PCIe and 3000 Mb/s for USB 3.x). For Gen 3 and below we use the existing reservation. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit aa673d606078da36ebc379f041c794228ac08cb5 Author: Gil Fine Date: Mon Jul 31 05:25:39 2023 +0300 thunderbolt: Make is_gen4_link() available to the rest of the driver Rework the function to return the link generation, update the name to tb_port_get_link_generation(), and make available to the rest of the driver. This is needed in the subsequent patches. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 4d24db0c801461adeefd7e0bdc98c79c60ccefb0 Author: Mika Westerberg Date: Mon Jul 31 05:25:38 2023 +0300 thunderbolt: Use weight constants in tb_usb3_consumed_bandwidth() Instead of magic numbers use the constants we introduced in the previous commit to make the code more readable. No functional changes. Signed-off-by: Mika Westerberg commit f73edddfa2a64a185c65a33f100778169c92fc25 Author: Mika Westerberg Date: Mon Jul 31 05:25:37 2023 +0300 thunderbolt: Use constants for path weight and priority Makes it easier to follow and update. No functional changes. Signed-off-by: Mika Westerberg commit 5264a2f4bb3baf712e19f1f053caaa8d7d3afa2e Author: Dan Carpenter Date: Fri Oct 20 16:52:45 2023 +0300 tracing: Fix a NULL vs IS_ERR() bug in event_subsystem_dir() The eventfs_create_dir() function returns error pointers, it never returns NULL. Update the check to reflect that. Link: https://lore.kernel.org/linux-trace-kernel/ff641474-84e2-46a7-9d7a-62b251a1050c@moroto.mountain Cc: Masami Hiramatsu Fixes: 5790b1fb3d67 ("eventfs: Remove eventfs_file and just use eventfs_inode") Signed-off-by: Dan Carpenter Signed-off-by: Steven Rostedt (Google) commit 7e8ad67c9b5c11e990c320ed7e7563f2301672a7 Author: Steven Rostedt (Google) Date: Thu Oct 19 20:41:32 2023 -0400 eventfs: Fix failure path in eventfs_create_events_dir() The failure path of allocating ei goes to a path that dereferences ei. Add another label that skips over the ei dereferences to do the rest of the clean up. Link: https://lore.kernel.org/all/70e7bace-561c-95f-1117-706c2c220bc@inria.fr/ Link: https://lore.kernel.org/linux-trace-kernel/20231019204132.6662fef0@gandalf.local.home Cc: Masami Hiramatsu Cc: Mark Rutland Fixes: 5790b1fb3d67 ("eventfs: Remove eventfs_file and just use eventfs_inode") Reported-by: Julia Lawall Signed-off-by: Steven Rostedt (Google) commit 4c456c9ad334a940e354da1002184bc19f4493ef Author: Yiwei Lin Date: Fri Oct 20 13:56:17 2023 +0800 sched/fair: Remove unused 'curr' argument from pick_next_entity() The 'curr' argument of pick_next_entity() has become unused after the EEVDF changes. [ mingo: Updated the changelog. ] Signed-off-by: Yiwei Lin Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231020055617.42064-1-s921975628@gmail.com commit ca2b746d5f91a37f01baedff54b9315a50ee617d Author: Minjie Du Date: Mon Jul 17 17:26:48 2023 +0800 powerpc/pseries: use kfree_sensitive() in plpks_gen_password() password might contain private information, so better use kfree_sensitive to free it. In plpks_gen_password() use kfree_sensitive(). Signed-off-by: Minjie Du Signed-off-by: Michael Ellerman Link: https://msgid.link/20230717092648.9752-1-duminjie@vivo.com commit 74726fda9fe306f848088ef73ec266cae0470d5b Author: Christophe Leroy Date: Sat Oct 7 12:46:19 2023 +0200 powerpc/code-patching: Perform hwsync in __patch_instruction() in case of failure Commit c28c15b6d28a ("powerpc/code-patching: Use temporary mm for Radix MMU") added a hwsync for when __patch_instruction() fails, we results in a quite odd unbalanced logic. Instead of calling mb() when __patch_instruction() returns an error, call mb() in the __patch_instruction()'s error path directly. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/e88b154eaf2efd9ff177d472d3411dcdec8ff4f5.1696675567.git.christophe.leroy@csgroup.eu commit 89f17016a85280e1b36a6c0305e0191594cbe6ea Author: Rob Herring Date: Fri Oct 6 16:45:16 2023 -0500 powerpc/fsl_msi: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Signed-off-by: Michael Ellerman Link: https://msgid.link/20231006214516.340589-1-robh@kernel.org commit ad496f8f83960c211b00fdbd8ae4ac1e55e4f3d5 Author: Christophe Leroy Date: Wed Oct 11 08:27:03 2023 +0200 powerpc: Remove cpm_dp...() macros Since commit d3c511ac1d72 ("powerpc/cpm: Remove !CONFIG_PPC_CPM_NEW_BINDING code") cpm_dp...() macros have no added value anymore. Last user of those macros were fixed by commit 5e6cb39a256d ("net: fs_enet: Use cpm_muram_xxx() functions instead of cpm_dpxxx() macros") Remove them. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/3aaa40bf706afeab8fe9a74b8437704a4269a6a2.1697005615.git.christophe.leroy@csgroup.eu commit 2066b41a2ef83937f70a84927cbbcc969528b867 Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:23 2023 +0900 PCI: dwc: Expose dw_pcie_ep_exit() to module Since no PCIe controller drivers call this, this change is not required for now. But, Renesas R-Car Gen4 PCIe controller driver will call this and if the controller driver is built as a kernel module, the following build error happens: ERROR: modpost: "dw_pcie_ep_exit" [drivers/pci/controller/dwc/pcie-rcar-gen4-ep-drv.ko] undefined! So, expose dw_pcie_ep_exit() for it. Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-8-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Manivannan Sadhasivam Reviewed-by: Serge Semin commit 1896d17f916819b8b5d145b4feef77109e78c435 Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:22 2023 +0900 PCI: dwc: Add EDMA_UNROLL capability flag Renesas R-Car Gen4 PCIe controllers have an unexpected register value in the eDMA CTRL register. So, add a new capability flag "EDMA_UNROLL" which would force the unrolled eDMA mapping for the problematic device. Suggested-by: Serge Semin Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-7-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Manivannan Sadhasivam Reviewed-by: Serge Semin commit 7873b49b41b92edb3395bff9a528eaf89da5e41c Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:21 2023 +0900 PCI: dwc: endpoint: Add multiple PFs support for dbi2 The commit 24ede430fa49 ("PCI: designware-ep: Add multiple PFs support for DWC") added .func_conf_select() to get the configuration space of different PFs and assumed that the offsets between dbi and dbi2 would be the same. However, Renesas R-Car Gen4 PCIe controllers have different offsets of function 1: dbi (+0x1000) and dbi2 (+0x800). To get the offset for dbi2, add .get_dbi2_offset() and dw_pcie_ep_get_dbi2_offset(). Note: - .func_conf_select() should be renamed later. - dw_pcie_ep_get_dbi2_offset() will call .func_conf_select() if .get_dbi2_offset() doesn't exist for backward compatibility. - dw_pcie_writeX_{dbi/dbi2} APIs accepted the func_no argument, so that these offset calculations are contained in the API definitions itself as it should. Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-6-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Manivannan Sadhasivam commit 1a9745476caea2374e0c6ab8285c192158e52d2d Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:20 2023 +0900 PCI: tegra194: Drop PCI_EXP_LNKSTA_NLW setting dw_pcie_setup() is already setting PCI_EXP_LNKCAP_MLW to pcie->num_lanes in the PCI_EXP_LNKCAP register for programming maximum link width. Hence, remove the redundant setting here. Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-5-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Manivannan Sadhasivam Reviewed-by: Serge Semin Cc: Thierry Reding Cc: Jonathan Hunter commit 89db0793c9f2da265ecb6c1681f899d9af157f37 Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:19 2023 +0900 PCI: dwc: Add missing PCI_EXP_LNKCAP_MLW handling Update dw_pcie_link_set_max_link_width() to set PCI_EXP_LNKCAP_MLW. In accordance with the DW PCIe RC/EP HW manuals [1,2,3,...] aside with the PORT_LINK_CTRL_OFF.LINK_CAPABLE and GEN2_CTRL_OFF.NUM_OF_LANES[8:0] field there is another one which needs to be updated. It's LINK_CAPABILITIES_REG.PCIE_CAP_MAX_LINK_WIDTH. If it isn't done at the very least the maximum link-width capability CSR won't expose the actual maximum capability. [1] DesignWare Cores PCI Express Controller Databook - DWC PCIe Root Port, Version 4.60a, March 2015, p.1032 [2] DesignWare Cores PCI Express Controller Databook - DWC PCIe Root Port, Version 4.70a, March 2016, p.1065 [3] DesignWare Cores PCI Express Controller Databook - DWC PCIe Root Port, Version 4.90a, March 2016, p.1057 ... [X] DesignWare Cores PCI Express Controller Databook - DWC PCIe Endpoint, Version 5.40a, March 2019, p.1396 [X+1] DesignWare Cores PCI Express Controller Databook - DWC PCIe Root Port, Version 5.40a, March 2019, p.1266 Suggested-by: Serge Semin Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-4-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Manivannan Sadhasivam Reviewed-by: Serge Semin commit a9a1bcba90254975d4adbcca53f720318cf81c0c Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:18 2023 +0900 PCI: dwc: Add dw_pcie_link_set_max_link_width() This is a preparation before adding the Max-Link-width capability setup which would in its turn complete the max-link-width setup procedure defined by Synopsys in the HW-manual. Seeing there is a max-link-speed setup method defined in the DW PCIe core driver it would be good to have a similar function for the link width setup. That's why we need to define a dedicated function first from already implemented but incomplete link-width setting up code. Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-3-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Manivannan Sadhasivam Reviewed-by: Serge Semin commit 164f66be0c2523e65df41b755c41b7c9ff58035a Author: Yoshihiro Shimoda Date: Wed Oct 18 17:56:17 2023 +0900 PCI: Add T_PVPERL macro According to the PCIe CEM r5.0, sec 2.9.2, Power stable to PERST# inactive interval is 100 ms as minimum. Add a macro so that the PCIe controller drivers can make use of it. Link: https://lore.kernel.org/linux-pci/20231018085631.1121289-2-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Yoshihiro Shimoda Signed-off-by: Krzysztof Wilczyński Reviewed-by: Manivannan Sadhasivam Reviewed-by: Serge Semin commit 86a0348de98576c8e3826d911db815a7105eaf41 Merge: 20c6e05bd33de a41654c3ed1d7 Author: David S. Miller Date: Fri Oct 20 12:53:06 2023 +0100 Merge branch 'ice-vf-resource-tracking' Jacob Keller says: ==================== Intel Wired LAN Driver Updates 2023-10-19 (ice, igb, ixgbe) This series contains improvements to the ice driver related to VF MSI-X resource tracking, as well as other minor cleanups. Dan fixes code in igb and ixgbe where the conversion to list_for_each_entry failed to account for logic which assumed a NULL pointer after iteration. Jacob makes ice_get_pf_c827_idx static, and refactors ice_find_netlist_node based on feedback that got missed before the function merged. Michal adds a switch rule to drop all traffic received by an inactive LAG port. He also implements ops to allow individual control of MSI-X vectors for SR-IOV VFs. Przemek removes some unused fields in struct ice_flow_entry, and modifies the ice driver to cache the VF PCI device inside struct ice_vf rather than performing lookup at run time. ==================== Signed-off-by: David S. Miller commit a41654c3ed1d7d6a2f7ae485f3e3c655b428f38f Author: Dan Carpenter Date: Thu Oct 19 10:32:27 2023 -0700 ixgbe: fix end of loop test in ixgbe_set_vf_macvlan() The list iterator in a list_for_each_entry() loop can never be NULL. If the loop exits without hitting a break then the iterator points to an offset off the list head and dereferencing it is an out of bounds access. Before we transitioned to using list_for_each_entry() loops, then it was possible for "entry" to be NULL and the comments mention this. I have updated the comments to match the new code. Fixes: c1fec890458a ("ethernet/intel: Use list_for_each_entry() helper") Signed-off-by: Dan Carpenter Reviewed-by: Simon Horman Reviewed-by: Jesse Brandeburg Tested-by: Rafal Romanowski Signed-off-by: Jacob Keller Signed-off-by: David S. Miller commit 4690aea589e76e887a40195b35b6d19a838058eb Author: Dan Carpenter Date: Thu Oct 19 10:32:26 2023 -0700 igb: Fix an end of loop test When we exit a list_for_each_entry() without hitting a break statement, the list iterator isn't NULL, it just point to an offset off the list_head. In that situation, it wouldn't be too surprising for entry->free to be true and we end up corrupting memory. The way to test for these is to just set a flag. Fixes: c1fec890458a ("ethernet/intel: Use list_for_each_entry() helper") Signed-off-by: Dan Carpenter Reviewed-by: Simon Horman Reviewed-by: Jesse Brandeburg Tested-by: Rafal Romanowski Signed-off-by: Jacob Keller Signed-off-by: David S. Miller commit 640a65f801338940ed86992179558eb070db75de Author: Jacob Keller Date: Thu Oct 19 10:32:25 2023 -0700 ice: cleanup ice_find_netlist_node The ice_find_netlist_node function was introduced in commit 8a3a565ff210 ("ice: add admin commands to access cgu configuration"). Variations of this function were reviewed concurrently on both intel-wired-lan[1][2], and netdev [3][4] [1]: https://lore.kernel.org/intel-wired-lan/20230913204943.1051233-7-vadim.fedorenko@linux.dev/ [2]: https://lore.kernel.org/intel-wired-lan/20230817000058.2433236-5-jacob.e.keller@intel.com/ [3]: https://lore.kernel.org/netdev/20230918212814.435688-1-anthony.l.nguyen@intel.com/ [4]: https://lore.kernel.org/netdev/20230913204943.1051233-7-vadim.fedorenko@linux.dev/ The variant I posted had a few changes due to review feedback which were never incorporated into the DPLL series: * Replace the references to ancient and long removed ICE_SUCCESS and ICE_ERR_DOES_NOT_EXIST status codes in the function comment. * Return -ENOENT instead of -ENOTBLK, as a more common way to indicate that an entry doesn't exist. * Avoid the use of memset() and use simple static initialization for the cmd variable. * Use FIELD_PREP to assign the node_type_ctx. * Remove an unnecessary local variable to keep track of rec_node_handle, just pass the node_handle pointer directly into ice_aq_get_netlist_node. Signed-off-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Reviewed-by: Paul Menzel Reviewed-by: Przemek Kitszel Signed-off-by: David S. Miller commit 67918b6b2671f02c3f73dcbe29419eaec58b2996 Author: Jacob Keller Date: Thu Oct 19 10:32:24 2023 -0700 ice: make ice_get_pf_c827_idx static The ice_get_pf_c827_idx function is only called inside of ice_ptp_hw.c, so there is no reason to export it. Mark it static and remove the declaration from ice_ptp_hw.h Signed-off-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: David S. Miller commit 4d38cb44bd321c81da3457cfbc38501ed8cb6714 Author: Michal Swiatkowski Date: Thu Oct 19 10:32:23 2023 -0700 ice: manage VFs MSI-X using resource tracking Track MSI-X for VFs using bitmap, by setting and clearing bitmap during allocation and freeing. Try to linearize irqs usage for VFs, by freeing them and allocating once again. Do it only for VFs that aren't currently running. Signed-off-by: Michal Swiatkowski Reviewed-by: Przemek Kitszel Tested-by: Rafal Romanowski Signed-off-by: Jacob Keller Signed-off-by: David S. Miller commit 05c16687e0cc78205eaa1b7a70fc6a95f8d3a417 Author: Michal Swiatkowski Date: Thu Oct 19 10:32:22 2023 -0700 ice: set MSI-X vector count on VF Implement ops needed to set MSI-X vector count on VF. sriov_get_vf_total_msix() should return total number of MSI-X that can be used by the VFs. Return the value set by devlink resources API (pf->req_msix.vf). sriov_set_msix_vec_count() will set number of MSI-X on particular VF. Disable VF register mapping, rebuild VSI with new MSI-X and queues values and enable new VF register mapping. For best performance set number of queues equal to number of MSI-X. Signed-off-by: Michal Swiatkowski Reviewed-by: Przemek Kitszel Tested-by: Rafal Romanowski Signed-off-by: Jacob Keller Signed-off-by: David S. Miller commit ea4af9b4005dceb3165ece6ba21091bc6362efc4 Author: Michal Swiatkowski Date: Thu Oct 19 10:32:21 2023 -0700 ice: add bitmap to track VF MSI-X usage Create a bitamp to track MSI-X usage for VFs. The bitmap has the size of total MSI-X amount on device, because at init time the amount of MSI-X used by VFs isn't known. The bitmap is used in follow up patchset to provide a block of continuous block of MSI-X indexes for each created VF. Signed-off-by: Michal Swiatkowski Reviewed-by: Przemek Kitszel Tested-by: Rafal Romanowski Signed-off-by: Jacob Keller Signed-off-by: David S. Miller commit fe1c5ca2fe760d95eb609976e225111fa055e931 Author: Michal Swiatkowski Date: Thu Oct 19 10:32:20 2023 -0700 ice: implement num_msix field per VF Store the amount of MSI-X per VF instead of storing it in pf struct. It is used to calculate number of q_vectors (and queues) for VF VSI. This is necessary because with follow up changes the number of MSI-X can be different between VFs. Use it instead of using pf->vf_msix value in all cases. Signed-off-by: Michal Swiatkowski Reviewed-by: Przemek Kitszel Tested-by: Rafal Romanowski Signed-off-by: Jacob Keller Signed-off-by: David S. Miller commit 31642d2854e2b63c807ec6b6b3ea54bbdcbdc9b9 Author: Przemek Kitszel Date: Thu Oct 19 10:32:19 2023 -0700 ice: store VF's pci_dev ptr in ice_vf Extend struct ice_vf by vfdev. Calculation of vfdev falls more nicely into ice_create_vf_entries(). Caching of vfdev enables simplification of ice_restore_all_vfs_msi_state(). Reviewed-by: Jesse Brandeburg Reviewed-by: Jacob Keller Signed-off-by: Przemek Kitszel Co-developed-by: Mateusz Polchlopek Signed-off-by: Mateusz Polchlopek Tested-by: Rafal Romanowski Reviewed-by: Simon Horman Signed-off-by: Jacob Keller Signed-off-by: David S. Miller commit 9dffb97da291760a5087cb20f851eae740bd7b79 Author: Michal Swiatkowski Date: Thu Oct 19 10:32:18 2023 -0700 ice: add drop rule matching on not active lport Inactive LAG port should not receive any packets, as it can cause adding invalid FDBs (bridge offload). Add a drop rule matching on inactive lport in LAG. Reviewed-by: Simon Horman Co-developed-by: Marcin Szycik Signed-off-by: Marcin Szycik Signed-off-by: Michal Swiatkowski Tested-by: Sujai Buvaneswaran Signed-off-by: Jacob Keller Signed-off-by: David S. Miller commit 4cd7bc7144ec2c0bb27208c3bb1f153dfd44b1c7 Author: Przemek Kitszel Date: Thu Oct 19 10:32:17 2023 -0700 ice: remove unused ice_flow_entry fields Remove ::entry and ::entry_sz fields of &ice_flow_entry, as they were never set. Suggested-by: Maciej Fijalkowski Reviewed-by: Jesse Brandeburg Signed-off-by: Przemek Kitszel Reviewed-by: Leon Romanovsky Signed-off-by: Jacob Keller Signed-off-by: David S. Miller commit 20c6e05bd33deaa6fa890252d7ffc5ad54a0942c Author: Jakub Kicinski Date: Thu Oct 19 08:28:15 2023 -0700 ethtool: untangle the linkmode and ethtool headers Commit 26c5334d344d ("ethtool: Add forced speed to supported link modes maps") added a dependency between ethtool.h and linkmode.h. The dependency in the opposite direction already exists so the new code was inserted in an awkward place. The reason for ethtool.h to include linkmode.h, is that ethtool_forced_speed_maps_init() is a static inline helper. That's not really necessary. Signed-off-by: Jakub Kicinski Reviewed-by: Paul Greenwalt Reviewed-by: Russell King (Oracle) Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit b629b541702b082d161c307c9d7d9867911fc933 Author: Nicholas Piggin Date: Mon Oct 16 22:43:05 2023 +1000 powerpc/qspinlock: Rename yield_propagate_owner tunable Rename yield_propagate_owner to yield_sleepy_owner, which better describes what it does (what, not how). Signed-off-by: Nicholas Piggin Tested-by: Shrikanth Hegde Reviewed-by: "Nysal Jan K.A" Signed-off-by: Michael Ellerman Link: https://msgid.link/20231016124305.139923-7-npiggin@gmail.com commit 1e6d5f725738fff83e1c3cbdb8547142eb8820c2 Author: Nicholas Piggin Date: Mon Oct 16 22:43:04 2023 +1000 powerpc/qspinlock: Propagate sleepy if previous waiter is preempted The sleepy (aka lock-owner-is-preempted) condition is propagated down the queue by each waiter. If a waiter becomes preempted, it can no longer propagate sleepy. To allow subsequent waiters to yield to the lock owner, also check the lock owner in this case. Signed-off-by: Nicholas Piggin Tested-by: Shrikanth Hegde Reviewed-by: "Nysal Jan K.A" Signed-off-by: Michael Ellerman Link: https://msgid.link/20231016124305.139923-6-npiggin@gmail.com commit fcf77d44274b96a55cc74043561a4b3151b9ad24 Author: Nicholas Piggin Date: Mon Oct 16 22:43:03 2023 +1000 powerpc/qspinlock: don't propagate the not-sleepy state To simplify things, don't propagate the not-sleepy condition back down the queue. Instead, have the waiters clear their own node->sleepy when finding the lock owner is not preempted. Signed-off-by: Nicholas Piggin Tested-by: Shrikanth Hegde Reviewed-by: "Nysal Jan K.A" Signed-off-by: Michael Ellerman Link: https://msgid.link/20231016124305.139923-5-npiggin@gmail.com commit fd8fae50c9c6117c4e05954deab2cc515508666b Author: Nicholas Piggin Date: Mon Oct 16 22:43:02 2023 +1000 powerpc/qspinlock: propagate owner preemptedness rather than CPU number Rather than propagating the CPU number of the preempted lock owner, just propagate whether the owner was preempted. Waiters must read the lock value when yielding to it to prevent races anyway, so might as well always load the owner CPU from the lock. To further simplify the code, also don't propagate the -1 (or sleepy=false in the new scheme) down the queue. Instead, have the waiters clear it themselves when finding the lock owner is not preempted. Signed-off-by: Nicholas Piggin Tested-by: Shrikanth Hegde Reviewed-by: "Nysal Jan K.A" Signed-off-by: Michael Ellerman Link: https://msgid.link/20231016124305.139923-4-npiggin@gmail.com commit f6568647382c667912245c8d07aa26c9c6d4d0c8 Author: Nicholas Piggin Date: Mon Oct 16 22:43:01 2023 +1000 powerpc/qspinlock: stop queued waiters trying to set lock sleepy If a queued waiter notices the lock owner or the previous waiter has been preempted, it attempts to mark the lock sleepy, but it does this as a try-set operation using the original lock value it got when queueing, which will become stale as the queue progresses, and the try-set will fail. Drop this and just set the sleepy seen clock. Signed-off-by: Nicholas Piggin Tested-by: Shrikanth Hegde Reviewed-by: "Nysal Jan K.A" Signed-off-by: Michael Ellerman Link: https://msgid.link/20231016124305.139923-3-npiggin@gmail.com commit ea142e590aec55ba40c5affb4d49e68c713c63dc Author: Nicholas Piggin Date: Thu Oct 19 01:34:23 2023 +1000 powerpc/perf: Fix disabling BHRB and instruction sampling When the PMU is disabled, MMCRA is not updated to disable BHRB and instruction sampling. This can lead to those features remaining enabled, which can slow down a real or emulated CPU. Fixes: 1cade527f6e9 ("powerpc/perf: BHRB control to disable BHRB logic when not used") Cc: stable@vger.kernel.org # v5.9+ Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://msgid.link/20231018153423.298373-1-npiggin@gmail.com commit d9c00f44e5de542340cce1d09e2c990e16c0ed3a Author: Anup Patel Date: Fri Oct 20 12:38:27 2023 +0530 KVM: riscv: selftests: Add SBI DBCN extension to get-reg-list test We have a new SBI debug console (DBCN) extension supported by in-kernel KVM so let us add this extension to get-reg-list test. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit c667ad229d13c41590882a35a8c159387b4e149b Author: Anup Patel Date: Fri Jul 22 19:46:24 2022 +0530 RISC-V: KVM: Forward SBI DBCN extension to user-space The frozen SBI v2.0 specification defines the SBI debug console (DBCN) extension which replaces the legacy SBI v0.1 console functions namely sbi_console_getchar() and sbi_console_putchar(). The SBI DBCN extension needs to be emulated in the KVM user-space (i.e. QEMU-KVM or KVMTOOL) so we forward SBI DBCN calls from KVM guest to the KVM user-space which can then redirect the console input/output to wherever it wants (e.g. telnet, file, stdio, etc). The SBI debug console is simply a early console available to KVM guest for early prints and it does not intend to replace the proper console devices such as 8250, VirtIO console, etc. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit 56d8a385b60556019ecb45d6098830c9ef6a13e0 Author: Anup Patel Date: Wed Oct 11 17:52:26 2023 +0530 RISC-V: KVM: Allow some SBI extensions to be disabled by default Currently, all SBI extensions are enabled by default which is problematic for SBI extensions (such as DBCN) which are forwarded to the KVM user-space because we might have an older KVM user-space which is not aware/ready to handle newer SBI extensions. Ideally, the SBI extensions forwarded to the KVM user-space must be disabled by default. To address above, we allow certain SBI extensions to be disabled by default so that KVM user-space must explicitly enable such SBI extensions to receive forwarded calls from Guest VCPU. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit b88e87a0a1ec0aa10861d84f8321743902583443 Author: Anup Patel Date: Tue Oct 10 15:23:51 2023 +0530 RISC-V: KVM: Change the SBI specification version to v2.0 We will be implementing SBI DBCN extension for KVM RISC-V so let us change the KVM RISC-V SBI specification version to v2.0. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit dadf7886993c69c6838107573e250a3b3fda25e3 Author: Anup Patel Date: Fri Jul 22 18:54:54 2022 +0530 RISC-V: Add defines for SBI debug console extension We add SBI debug console extension related defines/enum to the asm/sbi.h header. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit 9d9c22cc444af01ce254872b729af26864c43a3a Author: Borislav Petkov (AMD) Date: Fri Oct 20 13:17:14 2023 +0200 x86/retpoline: Document some thunk handling aspects After a lot of experimenting (see thread Link points to) document for now the issues and requirements for future improvements to the thunk handling and potential issuing of a diagnostic when the default thunk hasn't been patched out. This documentation is only temporary and that close before the merge window it is only a placeholder for those future improvements. Suggested-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231010171020.462211-1-david.kaplan@amd.com commit 2d7ce49f58dc95495b3e22e45d2be7de909b2c63 Author: Josh Poimboeuf Date: Tue Oct 17 09:59:46 2023 -0700 x86/retpoline: Make sure there are no unconverted return thunks due to KCSAN Enabling CONFIG_KCSAN leads to unconverted, default return thunks to remain after patching. As David Kaplan describes in his debugging of the issue, it is caused by a couple of KCSAN-generated constructors which aren't processed by objtool: "When KCSAN is enabled, GCC generates lots of constructor functions named _sub_I_00099_0 which call __tsan_init and then return. The returns in these are generally annotated normally by objtool and fixed up at runtime. But objtool runs on vmlinux.o and vmlinux.o does not include a couple of object files that are in vmlinux, like init/version-timestamp.o and .vmlinux.export.o, both of which contain _sub_I_00099_0 functions. As a result, the returns in these functions are not annotated, and the panic occurs when we call one of them in do_ctors and it uses the default return thunk. This difference can be seen by counting the number of these functions in the object files: $ objdump -d vmlinux.o|grep -c "<_sub_I_00099_0>:" 2601 $ objdump -d vmlinux|grep -c "<_sub_I_00099_0>:" 2603 If these functions are only run during kernel boot, there is no speculation concern." Fix it by disabling KCSAN on version-timestamp.o and .vmlinux.export.o so the extra functions don't get generated. KASAN and GCOV are already disabled for those files. [ bp: Massage commit message. ] Closes: https://lore.kernel.org/lkml/20231016214810.GA3942238@dev-arch.thelio-3990X/ Reported-by: Nathan Chancellor Signed-off-by: Josh Poimboeuf Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Nick Desaulniers Acked-by: Marco Elver Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/20231017165946.v4i2d4exyqwqq3bx@treble commit b4a11b2033b7d3dfdd46592f7036a775b18cecd1 Author: Heng Guo Date: Thu Oct 19 09:20:53 2023 +0800 net: fix IPSTATS_MIB_OUTPKGS increment in OutForwDatagrams. Reproduce environment: network with 3 VM linuxs is connected as below: VM1<---->VM2(latest kernel 6.5.0-rc7)<---->VM3 VM1: eth0 ip: 192.168.122.207 MTU 1500 VM2: eth0 ip: 192.168.122.208, eth1 ip: 192.168.123.224 MTU 1500 VM3: eth0 ip: 192.168.123.240 MTU 1500 Reproduce: VM1 send 1400 bytes UDP data to VM3 using tools scapy with flags=0. scapy command: send(IP(dst="192.168.123.240",flags=0)/UDP()/str('0'*1400),count=1, inter=1.000000) Result: Before IP data is sent. ---------------------------------------------------------------------- root@qemux86-64:~# cat /proc/net/snmp Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates Ip: 1 64 11 0 3 4 0 0 4 7 0 0 0 0 0 0 0 0 0 ...... ---------------------------------------------------------------------- After IP data is sent. ---------------------------------------------------------------------- root@qemux86-64:~# cat /proc/net/snmp Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates Ip: 1 64 12 0 3 5 0 0 4 8 0 0 0 0 0 0 0 0 0 ...... ---------------------------------------------------------------------- "ForwDatagrams" increase from 4 to 5 and "OutRequests" also increase from 7 to 8. Issue description and patch: IPSTATS_MIB_OUTPKTS("OutRequests") is counted with IPSTATS_MIB_OUTOCTETS ("OutOctets") in ip_finish_output2(). According to RFC 4293, it is "OutOctets" counted with "OutTransmits" but not "OutRequests". "OutRequests" does not include any datagrams counted in "ForwDatagrams". ipSystemStatsOutOctets OBJECT-TYPE DESCRIPTION "The total number of octets in IP datagrams delivered to the lower layers for transmission. Octets from datagrams counted in ipIfStatsOutTransmits MUST be counted here. ipSystemStatsOutRequests OBJECT-TYPE DESCRIPTION "The total number of IP datagrams that local IP user- protocols (including ICMP) supplied to IP in requests for transmission. Note that this counter does not include any datagrams counted in ipSystemStatsOutForwDatagrams. So do patch to define IPSTATS_MIB_OUTPKTS to "OutTransmits" and add IPSTATS_MIB_OUTREQUESTS for "OutRequests". Add IPSTATS_MIB_OUTREQUESTS counter in __ip_local_out() for ipv4 and add IPSTATS_MIB_OUT counter in ip6_finish_output2() for ipv6. Test result with patch: Before IP data is sent. ---------------------------------------------------------------------- root@qemux86-64:~# cat /proc/net/snmp Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates OutTransmits Ip: 1 64 9 0 5 1 0 0 3 3 0 0 0 0 0 0 0 0 0 4 ...... root@qemux86-64:~# cat /proc/net/netstat ...... IpExt: InNoRoutes InTruncatedPkts InMcastPkts OutMcastPkts InBcastPkts OutBcastPkts InOctets OutOctets InMcastOctets OutMcastOctets InBcastOctets OutBcastOctets InCsumErrors InNoECTPkts InECT1Pkts InECT0Pkts InCEPkts ReasmOverlaps IpExt: 0 0 0 0 0 0 2976 1896 0 0 0 0 0 9 0 0 0 0 ---------------------------------------------------------------------- After IP data is sent. ---------------------------------------------------------------------- root@qemux86-64:~# cat /proc/net/snmp Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates OutTransmits Ip: 1 64 10 0 5 2 0 0 3 3 0 0 0 0 0 0 0 0 0 5 ...... root@qemux86-64:~# cat /proc/net/netstat ...... IpExt: InNoRoutes InTruncatedPkts InMcastPkts OutMcastPkts InBcastPkts OutBcastPkts InOctets OutOctets InMcastOctets OutMcastOctets InBcastOctets OutBcastOctets InCsumErrors InNoECTPkts InECT1Pkts InECT0Pkts InCEPkts ReasmOverlaps IpExt: 0 0 0 0 0 0 4404 3324 0 0 0 0 0 10 0 0 0 0 ---------------------------------------------------------------------- "ForwDatagrams" increase from 1 to 2 and "OutRequests" is keeping 3. "OutTransmits" increase from 4 to 5 and "OutOctets" increase 1428. Signed-off-by: Heng Guo Reviewed-by: Kun Song Reviewed-by: Filip Pudak Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 321a145137653188b8bf9a6b6fc60e8ccb184392 Author: Alexey Dobriyan Date: Sat Oct 14 19:05:28 2023 +0300 x86/callthunks: Delete unused "struct thunk_desc" It looks like it was never used. Signed-off-by: Alexey Dobriyan Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: linux-kernel@vger.kernel.org Link: https://lore.kernel.org/r/843bf596-db67-4b33-a865-2bae4a4418e5@p183 commit b587fef124f98f3ab1322dba8e37cdff660acd8c Author: David Kaplan Date: Tue Oct 10 12:10:19 2023 -0500 x86/vdso: Run objtool on vdso32-setup.o vdso32-setup.c is part of the main kernel image and should not be excluded from objtool. Objtool is necessary in part for ensuring that returns in this file are correctly patched to the appropriate return thunk at runtime. Signed-off-by: David Kaplan Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20231010171020.462211-3-david.kaplan@amd.com commit 34de4fe7d1326c5c27890df3297dffd4c7196b0e Author: Josh Poimboeuf Date: Wed Oct 11 19:47:37 2023 -0700 objtool: Fix return thunk patching in retpolines With CONFIG_RETHUNK enabled, the compiler replaces every RET with a tail call to a return thunk ('JMP __x86_return_thunk'). Objtool annotates all such return sites so they can be patched during boot by apply_returns(). The implementation of __x86_return_thunk() is just a bare RET. It's only meant to be used temporarily until apply_returns() patches all return sites with either a JMP to another return thunk or an actual RET. Removing the .text..__x86.return_thunk section would break objtool's detection of return sites in retpolines. Since retpolines and return thunks would land in the same section, the compiler no longer uses relocations for the intra-section jumps between the retpolines and the return thunk, causing objtool to overlook them. As a result, none of the retpolines' return sites would get patched. Each one stays at 'JMP __x86_return_thunk', effectively a bare RET. Fix it by teaching objtool to detect when a non-relocated jump target is a return thunk (or retpoline). [ bp: Massage the commit message now that the offending commit removing the .text..__x86.return_thunk section has been zapped. Still keep the objtool change here as it makes objtool more robust wrt handling such intra-TU jumps without relocations, should some toolchain and/or config generate them in the future. ] Reported-by: David Kaplan Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20231012024737.eg5phclogp67ik6x@treble commit 095c3ea6fd5bcb4fd3641146570bdf4ee3b57c75 Merge: c0518571545d2 510f02febb102 Author: David S. Miller Date: Fri Oct 20 11:50:46 2023 +0100 Merge branch 'ksz886x-forced-link-modes' Oleksij Rempel says: ==================== fix forced link mode for KSZ886X switches changes v3: - squash patch 1 and 2 - use genphy_config_aneg() instead of genphy_setup_forced() changes v2: - address kernel test robot warning - change comment explaining clearing of KSZ886X_CTRL_FORCE_LINK bit - s/PHY we create/PHY will create/ ==================== Signed-off-by: David S. Miller commit 510f02febb10259919a41926ab6bf9ec5c72ee48 Author: Oleksij Rempel Date: Thu Oct 19 13:14:59 2023 +0200 net: phy: micrel: Fix forced link mode for KSZ886X switches Address a link speed detection issue in KSZ886X PHY driver when in forced link mode. Previously, link partners like "ASIX AX88772B" with KSZ8873 could fall back to 10Mbit instead of configured 100Mbit. The issue arises as KSZ886X PHY continues sending Fast Link Pulses (FLPs) even with autonegotiation off, misleading link partners in autoneg mode, leading to incorrect link speed detection. Now, when autonegotiation is disabled, the driver sets the link state forcefully using KSZ886X_CTRL_FORCE_LINK bit. This action, beyond just disabling autonegotiation, makes the PHY state more reliably detected by link partners using parallel detection, thus fixing the link speed misconfiguration. With autonegotiation enabled, link state is not forced, allowing proper autonegotiation process participation. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Reviewed-by: Divya Koppera Signed-off-by: David S. Miller commit f600bb612b06adf70ccdefbd3294c71275b650c2 Author: Oleksij Rempel Date: Thu Oct 19 13:14:58 2023 +0200 net: dsa: microchip: ksz8: Enable MIIM PHY Control reg access Provide access to MIIM PHY Control register (Reg. 31) through ksz8_r_phy_ctrl() and ksz8_w_phy_ctrl() functions. Necessary for upcoming micrel.c patch to address forced link mode configuration. Closes: https://lore.kernel.org/oe-kbuild-all/202310112224.iYgvjBUy-lkp@intel.com/ Reported-by: kernel test robot Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 904e1ddd0b31dc341f6af09e1558589f50b3d04d Author: Yang Li Date: Thu Aug 10 09:05:50 2023 +0800 x86/srso: Remove unnecessary semicolon scripts/coccinelle/misc/semicolon.cocci reports: arch/x86/kernel/cpu/bugs.c:713:2-3: Unneeded semicolon Signed-off-by: Yang Li Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230810010550.25733-1-yang.lee@linux.alibaba.com commit 0bd7feb2df7ef092c6b8914acca706fb21826f80 Author: Jo Van Bulck Date: Sat Aug 19 10:09:21 2023 +0200 x86/pti: Fix kernel warnings for pti= and nopti cmdline options Parse the pti= and nopti cmdline options using early_param to fix 'Unknown kernel command line parameters "nopti", will be passed to user space' warnings in the kernel log when nopti or pti= are passed to the kernel cmdline on x86 platforms. Additionally allow the kernel to warn for malformed pti= options. Signed-off-by: Jo Van Bulck Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Sohil Mehta Link: https://lore.kernel.org/r/20230819080921.5324-2-jo.vanbulck@cs.kuleuven.be commit c0518571545d2befdd978a39c490575f3e3dd15a Merge: fd533a7ac7c2a b46c1f3f5e079 Author: David S. Miller Date: Fri Oct 20 11:47:51 2023 +0100 Merge branch 'mlxsw-lag-table-allocation' Petr Machata says: ==================== mlxsw: Move allocation of LAG table to the driver PGT is an in-HW table that maps addresses to sets of ports. Then when some HW process needs a set of ports as an argument, instead of embedding the actual set in the dynamic configuration, what gets configured is the address referencing the set. The HW then works with the appropriate PGT entry. Within the PGT is placed a LAG table. That is a contiguous block of PGT memory where each entry describes which ports are members of the corresponding LAG port. The PGT is split to two parts: one managed by the FW, and one managed by the driver. Historically, the FW part included also the LAG table, referred to as FW LAG mode. Giving the responsibility for placement of the LAG table to the driver, referred to as SW LAG mode, makes the whole system more flexible. The FW currently supports both FW and SW LAG modes. To shed complexity, the FW should in the future only support SW LAG mode. Hence this patchset, where support for placement of LAG is added to mlxsw. There are FW versions out there that do not support SW LAG mode, and on Spectrum-1 in particular, there is no plan to support it at all. mlxsw will therefore have to support both modes of operation. Another aspect is that at least on Spectrum-1, there are FW versions out there that claim to support driver-placed LAG table, but then reject or ignore configurations enabling the same. The driver thus has to have a say in whether an attempt to configure SW LAG mode should even be done. The feature is therefore expressed in terms of "does the driver prefer SW LAG mode?", and "what LAG mode the PCI module managed to configure the FW with". This is unlike current flood mode configuration, where the driver can give a strict value, and that's what gets configured. But it gives a chance to the driver to determine whether LAG mode should be enabled at all. The "does the driver prefer SW LAG mode?" bit is expressed as a boolean lag_mode_prefer_sw. The reason for this is largely another feature that will be introduced in a follow-up patchset: support for CFF flood mode. The driver currently requires that the FW be configured with what is called controlled flood mode. But on capable systems, CFF would be preferred. So there are two values in flight: the preferred flood mode, and the fallback. This could be expressed with an array of flood modes ordered by preference, but that looks like an overkill in comparison. This flag/value model is then reused for LAG mode as well, except the fallback value is absent and implied to be FW, because there are no other values to choose from. The patchset progresses as follows: - Patches #1 to #5 adjust reg.h and cmd.h with new register fields, constants and remarks. - Patches #6 and #7 add the ability to request SW LAG mode and to query the LAG mode that was actually negotiated. This is where the abovementioned lag_mode_prefer_sw flag is added. - Patches #7 to #9 generalize PGT allocations to make it possible to allocate the LAG table, which is done in patch #10. - In patch #11, toggle lag_mode_prefer_sw on Spectrum-2 and above, which makes the newly-added code live. ==================== Signed-off-by: David S. Miller commit b46c1f3f5e079d2b6cb2845715942fe75304e498 Author: Petr Machata Date: Thu Oct 19 12:27:20 2023 +0200 mlxsw: spectrum: Set SW LAG mode on Spectrum>1 On Spectrum-2, Spectrum-3 and Spectrum-4 machines, request SW responsibility for placement of the LAG table. On Spectrum-1, some FW versions claim to support lag_mode field despite quietly ignoring any settings made to that field. Thus refrain from attempting to configure lag_mode on those systems at all. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit c678972580aedd28f273afdca94da6bb193ba3e7 Author: Petr Machata Date: Thu Oct 19 12:27:19 2023 +0200 mlxsw: spectrum: Allocate LAG table when in SW LAG mode In this patch, if the LAG mode is SW, allocate the LAG table and configure SGCR to indicate where it was allocated. We use the default "DDD" (for dynamic data duplication) layout of the LAG table. In the DDD mode, the membership information for each LAG is copied in 8 PGT entries. This is done for performance reasons. The LAG table then needs to be allocated on an address aligned to 8. Deal with this by moving the LAG init ahead so that the LAG table is allocated at address 0. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 8c893abd64ae662990fb41817011d84c101a4083 Author: Petr Machata Date: Thu Oct 19 12:27:18 2023 +0200 mlxsw: spectrum_pgt: Generalize PGT allocation PGT blocks are allocated through the function mlxsw_sp_pgt_mid_alloc_range(). The interface assumes that the caller knows which piece of PGT exactly they want to get. That was fine while the FID code was the only client allocating blocks of PGT. However for SW-allocated LAG table, there will be an additional client: mlxsw_sp_lag_init(). The interface should therefore be changed to not require particular coordinates, but to take just the requested size, allocate the block wherever, and give back the PGT address. In this patch, change the interface accordingly. Initialize FID family's pgt_base from the result of the PGT allocation (note that mlxsw makes a copy of the family structure, so what gets initialized is not actually the global structure). Drop the now-unnecessary pgt_base initializations and the corresponding defines. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit f5e293f9939e6cb532efa19c0043f8b93355c88b Author: Petr Machata Date: Thu Oct 19 12:27:17 2023 +0200 mlxsw: spectrum_fid: Allocate PGT for the whole FID family in one go PGT blocks are allocated through the function mlxsw_sp_pgt_mid_alloc_range(). The interface assumes that the caller knows which piece of PGT exactly they want to get. That was fine while the FID code was the only client allocating blocks of PGT. However for SW-allocated LAG table, there will be an additional client: mlxsw_sp_lag_init(). The interface should therefore be changed to not require particular coordinates, but to take just the requested size, allocate the block wherever, and give back the PGT address. The current FID mode has one place where PGT address can be stored: the FID family's pgt_base. The allocation scheme should therefore be changed from allocating a block per FID flood table, to allocating a block per FID family. Do just that in this patch. The per-family allocation is going to be useful for another related feature as well: the CFF mode. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit daee7aaba8491e64911438696c5f3f7cb77edf5e Author: Petr Machata Date: Thu Oct 19 12:27:16 2023 +0200 mlxsw: pci: Permit toggling LAG mode Add to struct mlxsw_config_profile a field lag_mode_prefer_sw for the driver to indicate that SW LAG mode should be configured if possible. Add to the PCI module code to set lag_mode as appropriate. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit b2e9b1fe8c2e096782c10db868889c64ef8f8a53 Author: Petr Machata Date: Thu Oct 19 12:27:15 2023 +0200 mlxsw: core, pci: Add plumbing related to LAG mode lag_mode describes where the responsibility for LAG table placement lies: SW or FW. The bus module determines whether LAG is supported, can configure it if it is, and knows what (if any) configuration has been applied. Therefore add a bus callback to determine the configured LAG mode. Also add to core an API to query it. The LAG mode is for now kept at the default value of 0 for FW-managed. The code to actually toggle it will be added later. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 8eabd10cdce4fc30e4357eab1fd102530fb09275 Author: Petr Machata Date: Thu Oct 19 12:27:14 2023 +0200 mlxsw: cmd: Add QUERY_FW.lag_mode_support Add QUERY_FW.lag_mode_support, which determines whether CONFIG_PROFILE.lag_mode is available. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit eb26a59232770fc6137759965437ea55d067134b Author: Petr Machata Date: Thu Oct 19 12:27:13 2023 +0200 mlxsw: cmd: Add CONFIG_PROFILE.{set_, }lag_mode Add CONFIG_PROFILE.lag_mode, which serves for moving responsibility for placement of the LAG table from FW to SW. Whether lag_mode should be configured is determined by CONFIG_PROFILE.set_lag_mode, which also add. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit be9ed47d3fab36cf20c6efef5d1060e7652a7bf0 Author: Petr Machata Date: Thu Oct 19 12:27:12 2023 +0200 mlxsw: cmd: Fix omissions in CONFIG_PROFILE field names in comments A number of CONFIG_PROFILE fields' comments refer to a field named like cmd_mbox_config_* instead of cmd_mbox_config_profile_*. Correct these omissions. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit cf0a86e8ce606438772628c688d1fd36f84ba854 Author: Petr Machata Date: Thu Oct 19 12:27:11 2023 +0200 mlxsw: reg: Add SGCR.lag_lookup_pgt_base Add SGCR.lag_lookup_pgt_base, which is used for configuring the base address of the LAG table within the PGT table for cases when the driver is responsible for the table placement. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 66eaaa85418bf52cc0f33d5e933d59732a216a9e Author: Petr Machata Date: Thu Oct 19 12:27:10 2023 +0200 mlxsw: reg: Drop SGCR.llb SGCR, Switch General Configuration Register, has not been used since commit b0d80c013b04 ("mlxsw: Remove Mellanox SwitchX-2 ASIC support"). We will need the register again shortly, so instead of dropping it and reintroducing again, just drop the sole unused field. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 99ee56c7657f939eecc4e8ac96e0aa0cd6ea7cbd Author: Josh Poimboeuf Date: Mon Sep 4 22:05:04 2023 -0700 x86/calldepth: Rename __x86_return_skl() to call_depth_return_thunk() For consistency with the other return thunks, rename __x86_return_skl() to call_depth_return_thunk(). Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/ae44e9f9976934e3b5b47a458d523ccb15867561.1693889988.git.jpoimboe@kernel.org commit fd533a7ac7c2ab78a226121d0388d8cd8546dc52 Merge: a10f9bfe935dd 7d4caf54d2e8d Author: David S. Miller Date: Fri Oct 20 11:43:36 2023 +0100 Merge branch 'netlink-auto-integers' Jakub Kicinski says: ==================== netlink: add variable-length / auto integers Add netlink support for "common" / variable-length / auto integers which are carried at the message level as either 4B or 8B depending on the exact value. This saves space and will hopefully decrease the number of instances where we realize that we needed more bits after uAPI is set is stone. It also loosens the alignment requirements, avoiding the need for padding. This mini-series is a fuller version of the previous RFC: https://lore.kernel.org/netdev/20121204.130914.1457976839967676240.davem@davemloft.net/ No user included here. I have tested (and will use) it in the upcoming page pool API but the assumption is that it will be widely applicable. So sending without a user. ==================== Signed-off-by: David S. Miller commit 7d4caf54d2e8df2ed52240fe339adb13372c6251 Author: Jakub Kicinski Date: Wed Oct 18 14:39:21 2023 -0700 netlink: specs: add support for auto-sized scalars Support uint / sint types in specs and YNL. Signed-off-by: Jakub Kicinski Acked-by: Nicolas Dichtel Signed-off-by: David S. Miller commit 374d345d9b5e13380c66d7042f9533a6ac6d1195 Author: Jakub Kicinski Date: Wed Oct 18 14:39:20 2023 -0700 netlink: add variable-length / auto integers We currently push everyone to use padding to align 64b values in netlink. Un-padded nla_put_u64() doesn't even exist any more. The story behind this possibly start with this thread: https://lore.kernel.org/netdev/20121204.130914.1457976839967676240.davem@davemloft.net/ where DaveM was concerned about the alignment of a structure containing 64b stats. If user space tries to access such struct directly: struct some_stats *stats = nla_data(attr); printf("A: %llu", stats->a); lack of alignment may become problematic for some architectures. These days we most often put every single member in a separate attribute, meaning that the code above would use a helper like nla_get_u64(), which can deal with alignment internally. Even for arches which don't have good unaligned access - access aligned to 4B should be pretty efficient. Kernel and well known libraries deal with unaligned input already. Padded 64b is quite space-inefficient (64b + pad means at worst 16B per attr vs 32b which takes 8B). It is also more typing: if (nla_put_u64_pad(rsp, NETDEV_A_SOMETHING_SOMETHING, value, NETDEV_A_SOMETHING_PAD)) Create a new attribute type which will use 32 bits at netlink level if value is small enough (probably most of the time?), and (4B-aligned) 64 bits otherwise. Kernel API is just: if (nla_put_uint(rsp, NETDEV_A_SOMETHING_SOMETHING, value)) Calling this new type "just" sint / uint with no specific size will hopefully also make people more comfortable with using it. Currently telling people "don't use u8, you may need the bits, and netlink will round up to 4B, anyway" is the #1 comment we give to newcomers. In terms of netlink layout it looks like this: 0 4 8 12 16 32b: [nlattr][ u32 ] 64b: [ pad ][nlattr][ u64 ] uint(32) [nlattr][ u32 ] uint(64) [nlattr][ u64 ] Signed-off-by: Jakub Kicinski Acked-by: Nicolas Dichtel Signed-off-by: David S. Miller commit e1b347c5f7de2c1a112c2dd6e380241135e34be2 Author: Jakub Kicinski Date: Wed Oct 18 14:39:19 2023 -0700 tools: ynl-gen: make the mnl_type() method public uint/sint support will add more logic to mnl_type(), deduplicate it and make it more accessible. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit e8efc0800b8b5045ba8c0d1256bfbb47e92e192a Author: Josh Poimboeuf Date: Mon Sep 4 22:05:03 2023 -0700 x86/nospec: Refactor UNTRAIN_RET[_*] Factor out the UNTRAIN_RET[_*] common bits into a helper macro. Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/f06d45489778bd49623297af2a983eea09067a74.1693889988.git.jpoimboe@kernel.org commit 0a3c49178c3c3e6f29280567ccb549826dd3a3f1 Author: Josh Poimboeuf Date: Mon Sep 4 22:05:01 2023 -0700 x86/rethunk: Use SYM_CODE_START[_LOCAL]_NOALIGN macros Macros already exist for unaligned code block symbols. Use them. Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/26d461bd509cc840af24c94586561c06d39812b2.1693889988.git.jpoimboe@kernel.org commit a10f9bfe935dd49d09e1c284a73bcd322de12917 Merge: 7ce6936045ba3 0050629cd36a5 Author: David S. Miller Date: Fri Oct 20 11:34:51 2023 +0100 Merge branch 'devlink-errors-fmsg' Przemek Kitszel says: ==================== devlink: retain error in struct devlink_fmsg Extend devlink fmsg to retain error (patch 1), so drivers could omit error checks after devlink_fmsg_*() (patches 2-10), and finally enforce future uses to follow this practice by change to return void (patch 11) Note that it was compile tested only. bloat-o-meter for whole series: add/remove: 8/18 grow/shrink: 23/40 up/down: 2017/-5833 (-3816) ==================== Signed-off-by: David S. Miller commit 0050629cd36a58b568ac0aebeeca60bd2fde3d6d Author: Przemek Kitszel Date: Wed Oct 18 22:26:47 2023 +0200 devlink: convert most of devlink_fmsg_*() to return void Since struct devlink_fmsg retains error by now (see 1st patch of this series), there is no longer need to keep returning it in each call. This is a separate commit to allow per-driver conversion to stop using those return values. Reviewed-by: Jiri Pirko Signed-off-by: Przemek Kitszel Signed-off-by: David S. Miller commit 3465915e99858c7070cabde8bc04cbe2e5bb758c Author: Przemek Kitszel Date: Wed Oct 18 22:26:46 2023 +0200 staging: qlge: devlink health: use retained error fmsg API Drop unneeded error checking. devlink_fmsg_*() family of functions is now retaining errors, so there is no need to check for them after each call. Reviewed-by: Jiri Pirko Signed-off-by: Przemek Kitszel Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 18256cb2d4a02673863eb07bb8a12e1ad54d2817 Author: Przemek Kitszel Date: Wed Oct 18 22:26:45 2023 +0200 qed: devlink health: use retained error fmsg API Drop unneeded error checking. devlink_fmsg_*() family of functions is now retaining errors, so there is no need to check for them after each call. Reviewed-by: Jiri Pirko Signed-off-by: Przemek Kitszel Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit d17f98bf7cc9ed922fe4fbd22e423271c5f09dd0 Author: Przemek Kitszel Date: Wed Oct 18 22:26:44 2023 +0200 net/mlx5: devlink health: use retained error fmsg API Drop unneeded error checking. devlink_fmsg_*() family of functions is now retaining errors, so there is no need to check for them after each call. Reviewed-by: Jesse Brandeburg Reviewed-by: Jiri Pirko Signed-off-by: Przemek Kitszel Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 1d434b48495d2064d2e8be55515e28eea606372a Author: Przemek Kitszel Date: Wed Oct 18 22:26:43 2023 +0200 mlxsw: core: devlink health: use retained error fmsg API Drop unneeded error checking. devlink_fmsg_*() family of functions is now retaining errors, so there is no need to check for them after each call. Reviewed-by: Jesse Brandeburg Reviewed-by: Jiri Pirko Signed-off-by: Przemek Kitszel Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit d8cf03fca3411de8a493dae5e9fcf815a4f0977e Author: Przemek Kitszel Date: Wed Oct 18 22:26:42 2023 +0200 octeontx2-af: devlink health: use retained error fmsg API Drop unneeded error checking. devlink_fmsg_*() family of functions is now retaining errors, so there is no need to check for them after each call. Reviewed-by: Jesse Brandeburg Reviewed-by: Jiri Pirko Signed-off-by: Przemek Kitszel Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit aca7734d94808db08a2e7b4537bf82e07de85af9 Author: Przemek Kitszel Date: Wed Oct 18 22:26:41 2023 +0200 hinic: devlink health: use retained error fmsg API Drop unneeded error checking. devlink_fmsg_*() family of functions is now retaining errors, so there is no need to check for them after each call. Reviewed-by: Jesse Brandeburg Reviewed-by: Jiri Pirko Signed-off-by: Przemek Kitszel Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 074e1b4221b5e5e0a0ae19a79244a08d1c8ffefa Author: Przemek Kitszel Date: Wed Oct 18 22:26:40 2023 +0200 bnxt_en: devlink health: use retained error fmsg API Drop unneeded error checking. devlink_fmsg_*() family of functions is now retaining errors, so there is no need to check for them after each call. Reviewed-by: Jesse Brandeburg Reviewed-by: Jiri Pirko Signed-off-by: Przemek Kitszel Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 47957bb3f7836b5583d9e675db455c035ecd3121 Author: Przemek Kitszel Date: Wed Oct 18 22:26:39 2023 +0200 pds_core: devlink health: use retained error fmsg API Drop unneeded error checking. devlink_fmsg_*() family of functions is now retaining errors, so there is no need to check for them after each call. Reviewed-by: Jesse Brandeburg Reviewed-by: Jiri Pirko Reviewed-by: Shannon Nelson Signed-off-by: Przemek Kitszel Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 20f9b9d385463d114c93e58a7a2377a581af8326 Author: Przemek Kitszel Date: Wed Oct 18 22:26:38 2023 +0200 netdevsim: devlink health: use retained error fmsg API Drop unneeded error checking. devlink_fmsg_*() family of functions is now retaining errors, so there is no need to check for them after each call. Reviewed-by: Jesse Brandeburg Reviewed-by: Jiri Pirko Reviewed-by: Jakub Kicinski Signed-off-by: Przemek Kitszel Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit db80d3b2558fcc6d18fbcb1452cdf6df65cec151 Author: Przemek Kitszel Date: Wed Oct 18 22:26:37 2023 +0200 devlink: retain error in struct devlink_fmsg Retain error value in struct devlink_fmsg, to relieve drivers from checking it after each call. Note that fmsg is an in-memory builder/buffer of formatted message, so it's not the case that half baked message was sent somewhere. We could find following scheme in multiple drivers: err = devlink_fmsg_obj_nest_start(fmsg); if (err) return err; err = devlink_fmsg_string_pair_put(fmsg, "src", src); if (err) return err; err = devlink_fmsg_something(fmsg, foo, bar); if (err) return err; // and so on... err = devlink_fmsg_obj_nest_end(fmsg); With retaining error API that translates to: devlink_fmsg_obj_nest_start(fmsg); devlink_fmsg_string_pair_put(fmsg, "src", src); devlink_fmsg_something(fmsg, foo, bar); // and so on... devlink_fmsg_obj_nest_end(fmsg); What means we check error just when is time to send. Possible error scenarios are developer error (API misuse) and memory exhaustion, both cases are good candidates to choose readability over fastest possible exit. Note that this patch keeps returning errors, to allow per-driver conversion to the new API, but those are not needed at this point already. This commit itself is an illustration of benefits for the dev-user, more of it will be in separate commits of the series. Reviewed-by: Jesse Brandeburg Reviewed-by: Jiri Pirko Signed-off-by: Przemek Kitszel Signed-off-by: David S. Miller commit 34a3cae7474c6e6f4a85aad4a7b8191b8b35cdcd Author: Josh Poimboeuf Date: Mon Sep 4 22:05:00 2023 -0700 x86/srso: Disentangle rethunk-dependent options CONFIG_RETHUNK, CONFIG_CPU_UNRET_ENTRY and CONFIG_CPU_SRSO are all tangled up. De-spaghettify the code a bit. Some of the rethunk-related code has been shuffled around within the '.text..__x86.return_thunk' section, but otherwise there are no functional changes. srso_alias_untrain_ret() and srso_alias_safe_ret() ((which are very address-sensitive) haven't moved. Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/2845084ed303d8384905db3b87b77693945302b4.1693889988.git.jpoimboe@kernel.org commit 351236947a45a512c517153bbe109fe868d05e6d Author: Josh Poimboeuf Date: Mon Sep 4 22:04:59 2023 -0700 x86/srso: Move retbleed IBPB check into existing 'has_microcode' code block Simplify the code flow a bit by moving the retbleed IBPB check into the existing 'has_microcode' block. Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/0a22b86b1f6b07f9046a9ab763fc0e0d1b7a91d4.1693889988.git.jpoimboe@kernel.org commit 0a0ce0da7fe66d54e497fb4e97d101b478f57e00 Author: Josh Poimboeuf Date: Mon Sep 4 22:04:58 2023 -0700 x86/bugs: Remove default case for fully switched enums For enum switch statements which handle all possible cases, remove the default case so a compiler warning gets printed if one of the enums gets accidentally omitted from the switch statement. Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/fcf6feefab991b72e411c2aed688b18e65e06aed.1693889988.git.jpoimboe@kernel.org commit 55ca9010c4a988b48278f81ae4129deea52d2488 Author: Josh Poimboeuf Date: Mon Sep 4 22:04:57 2023 -0700 x86/srso: Remove 'pred_cmd' label SBPB is only enabled in two distinct cases: 1) when SRSO has been disabled with srso=off 2) when SRSO has been fixed (in future HW) Simplify the control flow by getting rid of the 'pred_cmd' label and moving the SBPB enablement check to the two corresponding code sites. This makes it more clear when exactly SBPB gets enabled. Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/bb20e8569cfa144def5e6f25e610804bc4974de2.1693889988.git.jpoimboe@kernel.org commit eb54be26b0d25222809b16f335fe13756ff4a206 Author: Josh Poimboeuf Date: Mon Sep 4 22:04:56 2023 -0700 x86/srso: Unexport untraining functions These functions aren't called outside of retpoline.S. Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/1ae080f95ce7266c82cba6d2adde82349b832654.1693889988.git.jpoimboe@kernel.org commit aa730cff0c26244e88066b5b461a9f5fbac13823 Author: Josh Poimboeuf Date: Mon Sep 4 22:04:55 2023 -0700 x86/srso: Improve i-cache locality for alias mitigation Move srso_alias_return_thunk() to the same section as srso_alias_safe_ret() so they can share a cache line. Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/eadaf5530b46a7ae8b936522da45ae555d2b3393.1693889988.git.jpoimboe@kernel.org commit eeb9f34df065f42f0c9195b322ba6df420c9fc92 Author: Josh Poimboeuf Date: Mon Sep 4 22:04:53 2023 -0700 x86/srso: Fix unret validation dependencies CONFIG_CPU_SRSO isn't dependent on CONFIG_CPU_UNRET_ENTRY (AMD Retbleed), so the two features are independently configurable. Fix several issues for the (presumably rare) case where CONFIG_CPU_SRSO is enabled but CONFIG_CPU_UNRET_ENTRY isn't. Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/299fb7740174d0f2335e91c58af0e9c242b4bac1.1693889988.git.jpoimboe@kernel.org commit dc6306ad5b0dda040baf1fde3cfd458e6abfc4da Author: Josh Poimboeuf Date: Mon Sep 4 22:04:52 2023 -0700 x86/srso: Fix vulnerability reporting for missing microcode The SRSO default safe-ret mitigation is reported as "mitigated" even if microcode hasn't been updated. That's wrong because userspace may still be vulnerable to SRSO attacks due to IBPB not flushing branch type predictions. Report the safe-ret + !microcode case as vulnerable. Also report the microcode-only case as vulnerable as it leaves the kernel open to attacks. Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/a8a14f97d1b0e03ec255c81637afdf4cf0ae9c99.1693889988.git.jpoimboe@kernel.org commit de9f5f7b06a5b7adbfdd8016f011120a4e928add Author: Josh Poimboeuf Date: Mon Sep 4 22:04:51 2023 -0700 x86/srso: Print mitigation for retbleed IBPB case When overriding the requested mitigation with IBPB due to retbleed=ibpb, print the mitigation in the usual format instead of a custom error message. Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/ec3af919e267773d896c240faf30bfc6a1fd6304.1693889988.git.jpoimboe@kernel.org commit 3fc7b28e831f15274a5526197b54a73a88620584 Author: Josh Poimboeuf Date: Mon Sep 4 22:04:50 2023 -0700 x86/srso: Print actual mitigation if requested mitigation isn't possible If the kernel wasn't compiled to support the requested option, print the actual option that ends up getting used. Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/7e7a12ea9d85a9f76ca16a3efb71f262dee46ab1.1693889988.git.jpoimboe@kernel.org commit 1d1142ac51307145dbb256ac3535a1d43a1c9800 Author: Josh Poimboeuf Date: Mon Sep 4 22:04:49 2023 -0700 x86/srso: Fix SBPB enablement for (possible) future fixed HW Make the SBPB check more robust against the (possible) case where future HW has SRSO fixed but doesn't have the SRSO_NO bit set. Fixes: 1b5277c0ea0b ("x86/srso: Add SRSO_NO support") Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/cee5050db750b391c9f35f5334f8ff40e66c01b9.1693889988.git.jpoimboe@kernel.org commit a1e2b8b36820d8c91275f207e77e91645b7c6836 Author: Mike Rapoport (IBM) Date: Wed Oct 18 12:42:50 2023 +0200 x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size Qi Zheng reported crashes in a production environment and provided a simplified example as a reproducer: | For example, if we use Qemu to start a two NUMA node kernel, | one of the nodes has 2M memory (less than NODE_MIN_SIZE), | and the other node has 2G, then we will encounter the | following panic: | | BUG: kernel NULL pointer dereference, address: 0000000000000000 | <...> | RIP: 0010:_raw_spin_lock_irqsave+0x22/0x40 | <...> | Call Trace: | | deactivate_slab() | bootstrap() | kmem_cache_init() | start_kernel() | secondary_startup_64_no_verify() The crashes happen because of inconsistency between the nodemask that has nodes with less than 4MB as memoryless, and the actual memory fed into the core mm. The commit: 9391a3f9c7f1 ("[PATCH] x86_64: Clear more state when ignoring empty node in SRAT parsing") ... that introduced minimal size of a NUMA node does not explain why a node size cannot be less than 4MB and what boot failures this restriction might fix. Fixes have been submitted to the core MM code to tighten up the memory topologies it accepts and to not crash on weird input: mm: page_alloc: skip memoryless nodes entirely mm: memory_hotplug: drop memoryless node from fallback lists Andrew has accepted them into the -mm tree, but there are no stable SHA1's yet. This patch drops the limitation for minimal node size on x86: - which works around the crash without the fixes to the core MM. - makes x86 topologies less weird, - removes an arbitrary and undocumented limitation on NUMA topologies. [ mingo: Improved changelog clarity. ] Reported-by: Qi Zheng Tested-by: Mario Casquero Signed-off-by: Mike Rapoport (IBM) Signed-off-by: Ingo Molnar Acked-by: David Hildenbrand Acked-by: Michal Hocko Cc: Dave Hansen Cc: Rik van Riel Link: https://lore.kernel.org/r/ZS+2qqjEO5/867br@gmail.com commit fb064e5ae1657595c090ebbc5b15787a3ef603e9 Author: Joel Fernandes (Google) Date: Fri Oct 20 01:40:27 2023 +0000 sched/nohz: Update comments about NEWILB_KICK How ILB is triggered without IPIs is cryptic. Out of mercy for future code readers, document it in code comments. The comments are derived from a discussion with Vincent in a past review. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231020014031.919742-2-joel@joelfernandes.org commit f01b0edd562ef5a05bae31fe3a296721f89af7d9 Author: Naveen N Rao Date: Wed Jun 14 14:29:26 2023 +0530 powerpc/trace: Add support for HAVE_FUNCTION_ARG_ACCESS_API When creating a kprobe on function entry through tracefs, enable arguments to be recorded to be specified using $argN syntax. Signed-off-by: Naveen N Rao Signed-off-by: Michael Ellerman Link: https://msgid.link/20230614085926.2176641-1-naveen@kernel.org commit d42f55e8ae741540d0d2ebab8ff02f68fb0c802f Author: Naveen N Rao Date: Tue May 30 15:08:21 2023 +0530 powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh Toolchains don't always default to the ELFv2 ABI. This is true with at least the kernel.org toolchains. As such, pass -mabi=elfv2 explicitly to ensure that we are testing against the correct compiler output. Signed-off-by: Naveen N Rao [mpe: Tweak comment wording] Signed-off-by: Michael Ellerman Link: https://msgid.link/20230530093821.298590-1-naveen@kernel.org commit c4a852635eddcf4130a93e687bc7b120b19fd1b7 Author: Yang Jihong Date: Fri Oct 13 07:59:45 2023 +0000 perf data: Increase RLIMIT_NOFILE limit when open too many files in perf_data__create_dir() If using parallel threads to collect data, perf record needs at least 6 fds per CPU. (one for sys_perf_event_open, four for pipe msg and ack of the pipe, see record__thread_data_open_pipes(), and one for open perf.data.XXX) For an environment with more than 100 cores, if perf record uses both `-a` and `--threads` options, it is easy to exceed the upper limit of the file descriptor number, when we run out of them try to increase the limits. Before: $ ulimit -n 1024 $ lscpu | grep 'On-line CPU(s)' On-line CPU(s) list: 0-159 $ perf record --threads -a sleep 1 Failed to create data directory: Too many open files After: $ ulimit -n 1024 $ lscpu | grep 'On-line CPU(s)' On-line CPU(s) list: 0-159 $ perf record --threads -a sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.394 MB perf.data (1576 samples) ] Signed-off-by: Yang Jihong Acked-by: Namhyung Kim Link: https://lore.kernel.org/r/20231013075945.698874-1-yangjihong1@huawei.com Signed-off-by: Namhyung Kim commit 3f8b6e5b11192dacb721d2d28ea4589917f5e822 Author: Kajol Jain Date: Mon Oct 16 20:01:10 2023 +0530 perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 platform The CPI_STALL_RATIO metric group can be used to present the high level CPI stall breakdown metrics in powerpc, which will show: - DISPATCH_STALL_CPI ( Dispatch stall cycles per insn ) - ISSUE_STALL_CPI ( Issue stall cycles per insn ) - EXECUTION_STALL_CPI ( Execution stall cycles per insn ) - COMPLETION_STALL_CPI ( Completion stall cycles per insn ) Commit cf26e043c2a9 ("perf vendor events power10: Add JSON metric events to present CPI stall cycles in powerpc)" which added the CPI_STALL_RATIO metric group, also modified the PMC value used in PM_RUN_INST_CMPL event from PMC4 to PMC5, to avoid multiplexing of events. But that got revert in recent changes. Fix this issue by changing back the PMC value used in PM_RUN_INST_CMPL to PMC5. Result with the fix: ./perf stat --metric-no-group -M CPI_STALL_RATIO Performance counter stats for 'workload': 68,745,426 PM_CMPL_STALL # 0.21 COMPLETION_STALL_CPI 7,692,827 PM_ISSUE_STALL # 0.02 ISSUE_STALL_CPI 322,638,223 PM_RUN_INST_CMPL # 0.05 DISPATCH_STALL_CPI # 0.48 EXECUTION_STALL_CPI 16,858,553 PM_DISP_STALL_CYC 153,880,133 PM_EXEC_STALL 0.089774592 seconds time elapsed "--metric-no-group" is used for forcing PM_RUN_INST_CMPL to be scheduled in all group for more accuracy. Fixes: 7d473f475b2a ("perf vendor events: Move JSON/events to appropriate files for power10 platform") Reported-by: Disha Goel Signed-off-by: Kajol Jain Reviewed-by: Athira Rajeev Tested-by: Disha Goel Cc: maddy@linux.ibm.com Link: https://lore.kernel.org/r/20231016143110.244255-1-kjain@linux.ibm.com Signed-off-by: Namhyung Kim commit 2399cde86e0f6bdbf26cadb83897f6d270921740 Merge: b4b6cc10c6c8b 7904cdf1397c9 Author: Greg Kroah-Hartman Date: Fri Oct 20 08:34:47 2023 +0200 Merge tag 'counter-updates-for-6.7a' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-next William writes: First set of Counter updates for the 6.7 cycle A minor typographical error is fixed in the description comment block for struct counter_component. * tag 'counter-updates-for-6.7a' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter: counter: chrdev: remove a typo in header file comment commit 035fdc38c1f6ddce3544d8a489548e6cc4de508a Merge: 55b728555d2e2 5855d422a6f25 Author: Dave Airlie Date: Fri Oct 20 16:20:04 2023 +1000 Merge tag 'mediatek-drm-next-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next Mediatek DRM Next for Linux 6.7 1. Add support MT8188 dsi function 2. Fix coverity issue with unintentional integer overflow 3. Add support MT8188 dp/edp function 4. Fix memory leak on ->get_edid callback audio detection and error path. 5. Add connector dynamic selection capability 6. MediaTek DDP GAMMA - 12-bit LUT support 7. mtk_dsi: Fix NO_EOT_PACKET settings/handling [airlied: add bitfield.h include] Signed-off-by: Dave Airlie From: Chun-Kuang Hu Link: https://patchwork.freedesktop.org/patch/msgid/20231018135846.5811-1-chunkuang.hu@kernel.org commit 269d79fb30f6b2419b8a67d99d8bdf58ced44d72 Author: Nick Child Date: Tue Mar 14 11:44:42 2023 -0500 powerpc/boot: Add version to install filenames Rather than replacing the versionless vmlinux and System.map files, copy to files with the version info appended. Additionally, since executing the script is a last resort option, inform the user about the missing `installkernel` command and the location of the installation. This work is adapted from `arch/s390/boot/install.sh`, and also matches the behaviour of arm, arm64 and riscv. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://msgid.link/20230314164442.124929-1-nnac123@linux.ibm.com commit 95f1a128cd728a7257d78e868f1f5a145fc43736 Author: Wang Yufen Date: Wed Dec 14 15:46:23 2022 +0800 powerpc/pseries: fix potential memory leak in init_cpu_associativity() If the vcpu_associativity alloc memory successfully but the pcpu_associativity fails to alloc memory, the vcpu_associativity memory leaks. Fixes: d62c8deeb6e6 ("powerpc/pseries: Provide vcpu dispatch statistics") Signed-off-by: Wang Yufen Reviewed-by: "Naveen N. Rao" Signed-off-by: Michael Ellerman Link: https://msgid.link/1671003983-10794-1-git-send-email-wangyufen@huawei.com commit c25ef0e5d9d7d5fb9e1679286fc7a11e70f16c70 Author: Zhang Rui Date: Fri Oct 20 14:20:47 2023 +0800 tools/power/turbostat: Handle offlined CPUs in cpu_subset It is possible that the cpu_subset contains offlined CPUs. If this happens during start, exit immediately because this is likely an operator error that is best fixed by re-invoking. If this happens at runtime, give a warning only because turbostat should do its best effort to continue running. Signed-off-by: Zhang Rui commit 0fe3752901370b83b63d4ddbce708b23c8e41ea9 Author: Zhang Rui Date: Fri Oct 6 18:35:26 2023 +0800 tools/power/turbostat: Obey allowed CPUs for system summary System summary should summarize the information for allowed CPUs instead of all the present CPUs. Introduce topology information for allowed CPUs, and use them to get system summary. Signed-off-by: Zhang Rui commit 55b728555d2e23b0f883298b4d1d1ef7e0a12f23 Merge: 3ac5fa3fb7ad2 7eeaedf79989a Author: Dave Airlie Date: Fri Oct 20 16:15:24 2023 +1000 Merge tag 'drm-intel-gt-next-2023-10-19' of git://anongit.freedesktop.org/drm/drm-intel into drm-next Driver Changes: Fixes/improvements/new stuff: - Retry gtt fault when out of fence registers (Ville Syrjälä) - Determine context valid in OA reports [perf] (Umesh Nerlige Ramappa) Future platform enablement: - GuC based TLB invalidation for Meteorlake (Jonathan Cavitt, Prathap Kumar Valsan) - Don't set PIPE_CONTROL_FLUSH_L3 [mtl] (Vinay Belgaumkar) Miscellaneous: - Clean up zero initializers [guc,pxp] (Ville Syrjälä) - Prevent potential null-ptr-deref in engine_init_common (Nirmoy Das) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/ZTFDFSbd/U7YP+hI@tursulin-desk commit 007240d59c11f87ac4f6cfc6a1d116630b6b634c Author: Sebastian Andrzej Siewior Date: Thu Mar 9 14:48:31 2023 +0100 powerpc/imc-pmu: Use the correct spinlock initializer. The macro __SPIN_LOCK_INITIALIZER() is implementation specific. Users that desire to initialize a spinlock in a struct must use __SPIN_LOCK_UNLOCKED(). Use __SPIN_LOCK_UNLOCKED() for the spinlock_t in imc_global_refc. Fixes: 76d588dddc459 ("powerpc/imc-pmu: Fix use of mutex in IRQs disabled section") Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Michael Ellerman Link: https://msgid.link/20230309134831.Nz12nqsU@linutronix.de commit 73b25505ce043b561028e5571d84dc82aa53c2b4 Author: Haren Myneni Date: Thu Oct 19 14:50:33 2023 -0700 powerpc/vas: Limit open window failure messages in log bufffer The VAS open window call prints error message and returns -EBUSY after the migration suspend event initiated and until the resume event completed on the destination system. It can cause the log buffer filled with these error messages if the user space issues continuous open window calls. Similar case even for DLPAR CPU remove event when no credits are available until the credits are freed or with the other DLPAR CPU add event. So changes in the patch to use pr_err_ratelimited() instead of pr_err() to display open window failure and not-available credits error messages. Use pr_fmt() and make the corresponding changes to have the consistencein prefix all pr_*() messages (vas-api.c). Fixes: 37e6764895ef ("powerpc/pseries/vas: Add VAS migration handler") Signed-off-by: Haren Myneni [mpe: Use "vas-api" as the prefix to match the file name.] Signed-off-by: Michael Ellerman Link: https://msgid.link/20231019215033.1335251-1-haren@linux.ibm.com commit b4b6cc10c6c8b665cea241835b0ae52d224b8657 Merge: f7572e93d5f6b 89a1d2f064d2a Author: Greg Kroah-Hartman Date: Fri Oct 20 07:54:15 2023 +0200 Merge tag 'iio-for-6.7a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: IIO: 1st set of new device support, features and cleanup for 6.7 Particularly great to see a resolver driver move out of staging via a massive set of changes. Only took 13 years :) One small patch added then reverted due to a report of test breakage (ashai-kasei,ak8975: Drop deprecated enums.) An immutable branch was used for some hid-senors changes in case there was a need to take them into the HID tree as well. New device support ----------------- adi,hmc425a - Add support for HMC540SLP3E broadband 4-bit digital attenuator. kionix,kx022a - Add support for the kx132-1211 accelerometer. Require significant driver rework to enable this including add a chip type specific structure to deal with the chip differences. - Add support for the kx132acr-lbz accelerometer (subset of the kx022a feature set). lltc,ltc2309 - New driver for this 8 channel ADC. microchip,mcp3911 - Add support for rest of mcp391x family of ADCs (there are various differences beyond simple channel count variation. Series includes some general driver cleanup. microchip,mcp3564 - New driver for MCP3461, MCP3462, MCP3464, MCP3541, MCP3562, MCP3564 and their R variants of 16/24bit ADCs. A few minor fixed followed. rohm,bu1390 - New driver for this pressure sensor. Staging graduation ------------------ adi,ad1210 (after 13 or so years :) - More or less a complete (step-wise) rewrite of this resolver driver to bring it up to date with modern IIO standards. The fault signal handling mapping to event channels was particularly complex and significant part of the changes. Features -------- iio-core - Add chromacity and color temperature channel types. adi,ad7192 - Oversampling ratio control (called fast settling in datasheet). adi,adis16475 - Add core support and then driver support for delta angle and delta velocity channels. These are intended for summation to establish angle and velocity changes over larger timescales. Fix was needed for alignment after the temperature channel. Further fix reduced set of devices for which the buffer support was applicable as seems burst reads don't cover these on all devices. hid-sensors-als - Chromacity and color temperatures support including in amd sfh. stx104 - Add support for counter subsystem to this multipurpose device. ti,twl6030 - Add missing device tree binding description. Clean up and minor fixes. ------------------------ treewide - Drop some unused declarations across IIO. - Make more use of device_get_match_data() instead of OF specific approaches. Similar cleanup to sets of drivers. - Stop platform remove callbacks returning anything by using the temporary remove_new() callback. - Use i2c_get_match_data() to cope nicely with all types of ID table entry. - Use device_get_match_data() for various platform device to cope with more types of firmware. - Convert from enum to pointer in ID tables allowing use of i2c_get_match_data(). - Fix sorting on some ID tables. - Include specific string helper headers rather than simply string_helpers.h docs - Better description of the ordering requirements etc for available_scan_masks. tools - Handle alignment of mixed sizes where the last element isn't the biggest correctly. Seems that doesn't happen often! adi,ad2s1210 - Lots of work from David Lechner on this driver including a few fixes that are going with the rework to avoid slowing that down. adi,ad4310 - Replace deprecated devm_clk_register() adi,ad74413r - Bring the channel function setting inline with the datasheet. adi,ad7192 - Change to FIELD_PREP(), FIELD_GET(). - Calculate f_order from the sinc filter and chop filter states. - Move more per chip config into data in struct ad7192_chip_info - Cleanup unused parameter in channel macros. adi,adf4350 - Make use of devm_* to simplify error handling for many of the setup calls in probe() / tear down in remove() and error paths. Some more work to be done on this one. - Use dev_err_probe() for errors in probe() callback. adi,adf4413 - Typo in function name prefix. adi,adxl345 - Add channel scale to the chip type specific structure and drop using a type field previously used for indirection. asahi,ak8985 - Fix a mismatch introduced when switching from enum->pointers in the match tables. amlogic,meson - Expand error logging during probe. invensense,mpu6050 - Support level-shifter control. Whilst no one is sure exactly what this is doing it is needed for some old boards. - Document mount-matrix dt-binding. mediatek,mt6577 - Use devm_clk_get_enabled() to replace open coded version and move everything over to being device managed. Drop now empty remove() callback. Fix follows to put the drvdata back. - Use dev_err_probe() for error reporting in probe() callback. memsic,mxc4005 - Add of_match_table. microchip,mcp4725 - Move various chip specific data from being looked up by chip ID to data in the chip type specific structure. silicon-labs,si7005 - Add of_match_table and entry in trivial-devices.yaml st,lsm6dsx - Add missing mount-matrix dt binding documentation. st,spear - Use devm_clk_get_enabled() and some other devm calls to move everything over to being device managed. Drop now empty remove() callback. - Use dev_err_probe() to better handled deferred probing and tidy up error reporting in probe() callback. st,stm32-adc - Add a bit of additional checking in probe() to protect against a NULL pointer (no known path to trigger it today). - Replace deprecated strncpy() ti,ads1015 - Allow for edge triggers. - Document interrupt in dt-bindings. * tag 'iio-for-6.7a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (201 commits) iio: Use device_get_match_data() iio: adc: MCP3564: fix warn: unsigned '__x' is never less than zero. dt-bindings: trivial-devices: add silabs,si7005 iio: si7005: Add device tree support drivers: imu: adis16475.c: Remove scan index from delta channels dt-bindings: iio: imu: st,lsm6dsx: add mount-matrix property iio: resolver: ad2s1210: remove of_match_ptr() iio: resolver: ad2s1210: remove DRV_NAME macro iio: resolver: ad2s1210: move out of staging staging: iio: resolver: ad2s1210: simplify code with guard(mutex) staging: iio: resolver: ad2s1210: clear faults after soft reset staging: iio: resolver: ad2s1210: refactor sample toggle staging: iio: resolver: ad2s1210: remove fault attribute staging: iio: resolver: ad2s1210: add label attribute support staging: iio: resolver: ad2s1210: add register/fault support summary staging: iio: resolver: ad2s1210: implement fault events iio: event: add optional event label support staging: iio: resolver: ad2s1210: rename DOS reset min/max attrs staging: iio: resolver: ad2s1210: convert DOS mismatch threshold to event attr staging: iio: resolver: ad2s1210: convert DOS overrange threshold to event attr ... commit 5069211e2f0b47e75119805e23ae6352d871e263 Author: Thomas Richter Date: Thu Oct 19 10:26:42 2023 +0200 perf trace: Use the right bpf_probe_read(_str) variant for reading user data Perf test case 111 Check open filename arg using perf trace + vfs_getname fails on s390. This is caused by a failing function bpf_probe_read() in file util/bpf_skel/augmented_raw_syscalls.bpf.c. The root cause is the lookup by address. Function bpf_probe_read() is used. This function works only for architectures with ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE. On s390 is not possible to determine from the address to which address space the address belongs to (user or kernel space). Replace bpf_probe_read() by bpf_probe_read_kernel() and bpf_probe_read_str() by bpf_probe_read_user_str() to explicity specify the address space the address refers to. Output before: # ./perf trace -eopen,openat -- touch /tmp/111 libbpf: prog 'sys_enter': BPF program load failed: Invalid argument libbpf: prog 'sys_enter': -- BEGIN PROG LOAD LOG -- reg type unsupported for arg#0 function sys_enter#75 0: R1=ctx(off=0,imm=0) R10=fp0 ; int sys_enter(struct syscall_enter_args *args) 0: (bf) r6 = r1 ; R1=ctx(off=0,imm=0) R6_w=ctx(off=0,imm=0) ; return bpf_get_current_pid_tgid(); 1: (85) call bpf_get_current_pid_tgid#14 ; R0_w=scalar() 2: (63) *(u32 *)(r10 -8) = r0 ; R0_w=scalar() R10=fp0 fp-8=????mmmm 3: (bf) r2 = r10 ; R2_w=fp0 R10=fp0 ; ..... lines deleted here ..... 23: (bf) r3 = r6 ; R3_w=ctx(off=0,imm=0) R6=ctx(off=0,imm=0) 24: (85) call bpf_probe_read#4 unknown func bpf_probe_read#4 processed 23 insns (limit 1000000) max_states_per_insn 0 \ total_states 2 peak_states 2 mark_read 2 -- END PROG LOAD LOG -- libbpf: prog 'sys_enter': failed to load: -22 libbpf: failed to load object 'augmented_raw_syscalls_bpf' libbpf: failed to load BPF skeleton 'augmented_raw_syscalls_bpf': -22 .... Output after: # ./perf test -Fv 111 111: Check open filename arg using perf trace + vfs_getname : --- start --- 1.085 ( 0.011 ms): touch/320753 openat(dfd: CWD, filename: \ "/tmp/temporary_file.SWH85", \ flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 3 ---- end ---- Check open filename arg using perf trace + vfs_getname: Ok # Test with the sleep command shows: Output before: # ./perf trace -e *sleep sleep 1.234567890 0.000 (1234.681 ms): sleep/63114 clock_nanosleep(rqtp: \ { .tv_sec: 0, .tv_nsec: 0 }, rmtp: 0x3ffe0979720) = 0 # Output after: # ./perf trace -e *sleep sleep 1.234567890 0.000 (1234.686 ms): sleep/64277 clock_nanosleep(rqtp: \ { .tv_sec: 1, .tv_nsec: 234567890 }, rmtp: 0x3fff3df9ea0) = 0 # Fixes: 14e4b9f4289a ("perf trace: Raw augmented syscalls fix libbpf 1.0+ compatibility") Signed-off-by: Thomas Richter Co-developed-by: Arnaldo Carvalho de Melo Acked-by: Ilya Leoshkevich Tested-by: Arnaldo Carvalho de Melo Cc: Ian Rogers Cc: gor@linux.ibm.com Cc: hca@linux.ibm.com Cc: sumanthk@linux.ibm.com Cc: svens@linux.ibm.com Link: https://lore.kernel.org/r/20231019082642.3286650-1-tmricht@linux.ibm.com Signed-off-by: Namhyung Kim commit a4d5bc3214ebb9f4af46613f824109ab90558cd3 Author: MD Danish Anwar Date: Fri Oct 20 10:49:37 2023 +0530 arm64: dts: ti: k3-am654-idk: Add ICSSG Ethernet ports The IDK application board has 4 Gigabit Ethernet ports. This patch adds support for the 4 Gigabit Ethernet ports which are provided by ICSSG0 and ICSSG1. The IEP0 SYNC_OUT0 pins are used for PPS out on the IDK card. Signed-off-by: MD Danish Anwar Link: https://lore.kernel.org/r/20231020051937.3709871-4-danishanwar@ti.com Signed-off-by: Vignesh Raghavendra commit b06c6d32f3fe33e10bedd00e3f4d2bf275f6cc13 Author: MD Danish Anwar Date: Fri Oct 20 10:49:36 2023 +0530 arm64: dts: ti: k3-am654-icssg2: add ICSSG2 Ethernet support ICSSG2 provides dual Gigabit Ethernet support. Add ICSSG2 ethernet node to an overlay k3-am654-icssg2.dtso Reviewed-by: Andrew Davis Signed-off-by: MD Danish Anwar Link: https://lore.kernel.org/r/20231020051937.3709871-3-danishanwar@ti.com Signed-off-by: Vignesh Raghavendra commit 209f4e89346903722769243531d175183d57bd1d Author: MD Danish Anwar Date: Fri Oct 20 10:49:35 2023 +0530 arm64: dts: ti: k3-am65-main: Add ICSSG IEP nodes The ICSSG IP on AM65x SoCs have two Industrial Ethernet Peripherals (IEPs) to manage/generate Industrial Ethernet functions such as time stamping. Each IEP sub-module is sourced from an internal clock mux that can be sourced from either of the IP instance's ICSSG_IEP_GCLK or ICSSG_ICLK. Add the IEP nodes for all the ICSSG instances. Signed-off-by: MD Danish Anwar Link: https://lore.kernel.org/r/20231020051937.3709871-2-danishanwar@ti.com Signed-off-by: Vignesh Raghavendra commit a2786e8bdd0242d7f00abf452a572de7464d177b Author: André Apitzsch Date: Mon Oct 16 19:45:53 2023 +0200 crypto: qcom-rng - Add missing dependency on hw_random This should fix the undefined reference: > /usr/bin/aarch64-alpine-linux-musl-ld: Unexpected GOT/PLT entries detected! > /usr/bin/aarch64-alpine-linux-musl-ld: Unexpected run-time procedure linkages detected! > /usr/bin/aarch64-alpine-linux-musl-ld: drivers/crypto/qcom-rng.o: in function `qcom_rng_probe': > qcom-rng.c:(.text+0x130): undefined reference to `devm_hwrng_register' Fixes: f29cd5bb64c2 ("crypto: qcom-rng - Add hw_random interface support") Signed-off-by: André Apitzsch Reviewed-by: Neil Armstrong Signed-off-by: Herbert Xu commit 7ec0a09d4e84396b8c3c799b0add4399f5fdb7a6 Author: Eric Biggers Date: Thu Oct 12 22:56:13 2023 -0700 crypto: skcipher - fix weak key check for lskciphers When an algorithm of the new "lskcipher" type is exposed through the "skcipher" API, calls to crypto_skcipher_setkey() don't pass on the CRYPTO_TFM_REQ_FORBID_WEAK_KEYS flag to the lskcipher. This causes self-test failures for ecb(des), as weak keys are not rejected anymore. Fix this. Fixes: 31865c4c4db2 ("crypto: skcipher - Add lskcipher") Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 5acab6eb592387191c1bb745ba9b815e1e076db5 Author: Longfang Liu Date: Fri Oct 13 11:49:57 2023 +0800 crypto: hisilicon/qm - fix EQ/AEQ interrupt issue During hisilicon accelerator live migration operation. In order to prevent the problem of EQ/AEQ interrupt loss. Migration driver will trigger an EQ/AEQ doorbell at the end of the migration. This operation may cause double interruption of EQ/AEQ events. To ensure that the EQ/AEQ interrupt processing function is normal. The interrupt handling functionality of EQ/AEQ needs to be updated. Used to handle repeated interrupts event. Fixes: b0eed085903e ("hisi_acc_vfio_pci: Add support for VFIO live migration") Signed-off-by: Longfang Liu Signed-off-by: Herbert Xu commit ca06ef976ea1cdae363dda508cc9c6502fd0dcd7 Author: Herbert Xu Date: Thu Oct 12 23:08:17 2023 +0800 crypto: hifn_795x - Silence gcc format-truncation false positive warnings The heuristics used by gcc triggers false positive truncation warnings in hifn_alg_alloc. The warning triggered by the strings here are clearly false positives (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95755). Add checks on snprintf calls to silence these warnings, including the one for cra_driver_name even though it does not currently trigger a gcc warning. Signed-off-by: Herbert Xu commit 87d6621c07d230d9168a021f2760062f2262e8b9 Author: Herbert Xu Date: Thu Oct 12 13:11:25 2023 +0800 crypto: lskcipher - Return EINVAL when ecb_name fails sanity checks Set the error value to -EINVAL instead of zero when the underlying name (within "ecb()") fails basic sanity checks. Fixes: 8aee5d4ebd11 ("crypto: lskcipher - Add compatibility wrapper around ECB") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202310111323.ZjK7bzjw-lkp@intel.com/ Signed-off-by: Herbert Xu commit d4f5bfe20da9fa54024a73a9c60aea45e572d786 Author: Dimitri John Ledkov Date: Tue Oct 10 22:27:55 2023 +0100 certs: Limit MODULE_SIG_KEY_TYPE_ECDSA to SHA384 or SHA512 NIST FIPS 186-5 states that it is recommended that the security strength associated with the bit length of n and the security strength of the hash function be the same, or higher upon agreement. Given NIST P384 curve is used, force using either SHA384 or SHA512. Signed-off-by: Dimitri John Ledkov Signed-off-by: Herbert Xu commit fc3225fd6f1e6ac07a8463e7751ecfa228880c71 Author: Dimitri John Ledkov Date: Tue Oct 10 22:26:33 2023 +0100 module: Do not offer sha224 for built-in module signing sha224 does not provide enough security against collision attacks relative to the default keys used for signing (RSA 4k & P-384). Also sha224 never became popular, as sha256 got widely adopter ahead of sha224 being introduced. Signed-off-by: Dimitri John Ledkov Signed-off-by: Herbert Xu commit c1d760a47163bec1ecd5c82638c8c234fcbd549e Author: Dimitri John Ledkov Date: Tue Oct 10 22:25:29 2023 +0100 crypto: mscode_parser - remove sha224 authenticode support It is possible to stand up own certificates and sign PE-COFF binaries using SHA-224. However it never became popular or needed since it has similar costs as SHA-256. Windows Authenticode infrastructure never had support for SHA-224, and all secureboot keys used fro linux vmlinuz have always been using at least SHA-256. Given the point of mscode_parser is to support interoperatiblity with typical de-facto hashes, remove support for SHA-224 to avoid posibility of creating interoperatibility issues with rhboot/shim, grub, and non-linux systems trying to sign or verify vmlinux. SHA-224 itself is not removed from the kernel, as it is truncated SHA-256. If requested I can write patches to remove SHA-224 support across all of the drivers. Signed-off-by: Dimitri John Ledkov Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit 16ab7cb5825fc3425c16ad2c6e53d827f382d7c6 Author: Dimitri John Ledkov Date: Tue Oct 10 22:22:38 2023 +0100 crypto: pkcs7 - remove sha1 support Removes support for sha1 signed kernel modules, importing sha1 signed x.509 certificates. rsa-pkcs1pad keeps sha1 padding support, which seems to be used by virtio driver. sha1 remains available as there are many drivers and subsystems using it. Note only hmac(sha1) with secret keys remains cryptographically secure. In the kernel there are filesystems, IMA, tpm/pcr that appear to be using sha1. Maybe they can all start to be slowly upgraded to something else i.e. blake3, ParallelHash, SHAKE256 as needed. Signed-off-by: Dimitri John Ledkov Signed-off-by: Herbert Xu commit c35b581e5197cced51047beeab0d3ccbfe948764 Author: John Allen Date: Tue Oct 10 20:44:32 2023 +0000 crypto: ccp - Dump SEV command buffer registers on SEV command error PSP firmware may report additional error information in the SEV command buffer registers in situations where an error occurs as the result of an SEV command. In this case, check if the command buffer registers have been modified and if so, dump the contents. Signed-off-by: John Allen Reviewed-by: Mario Limonciello Reviewed-by: Tom Lendacky Signed-off-by: Herbert Xu commit 1be7505933a5eb68f92700d8faba4633733f17d7 Author: Eric Biggers Date: Mon Oct 9 23:41:27 2023 -0700 crypto: arm64/sha512 - clean up backwards function names In the Linux kernel, a function whose name has two leading underscores is conventionally called by the same-named function without leading underscores -- not the other way around. __sha512_block_data_order() got this backwards. Fix this, albeit without changing the name in the perlasm since that is OpenSSL code. No change in behavior. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 455951b5e172bbb0eb1d54d4fd9c1cfef732e210 Author: Eric Biggers Date: Mon Oct 9 23:41:26 2023 -0700 crypto: arm64/sha256 - clean up backwards function names In the Linux kernel, a function whose name has two leading underscores is conventionally called by the same-named function without leading underscores -- not the other way around. __sha256_block_data_order() and __sha256_block_neon() got this backwards. Fix this, albeit without changing the names in the perlasm since that is OpenSSL code. No change in behavior. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 5f720a3df346548db69fe3bc0bef44a16eda4513 Author: Eric Biggers Date: Mon Oct 9 23:41:25 2023 -0700 crypto: arm64/sha512-ce - clean up backwards function names In the Linux kernel, a function whose name has two leading underscores is conventionally called by the same-named function without leading underscores -- not the other way around. __sha512_ce_transform() and __sha512_block_data_order() got this backwards. Fix this, albeit without changing "sha512_block_data_order" in the perlasm since that is OpenSSL code. No change in behavior. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit ba30d31121fe6fad34b0e7018f848b5d11b359dd Author: Eric Biggers Date: Mon Oct 9 23:41:24 2023 -0700 crypto: arm64/sha2-ce - clean up backwards function names In the Linux kernel, a function whose name has two leading underscores is conventionally called by the same-named function without leading underscores -- not the other way around. __sha2_ce_transform() and __sha256_block_data_order() got this backwards. Fix this, albeit without changing "sha256_block_data_order" in the perlasm since that is OpenSSL code. No change in behavior. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 1f9f3a5218b1e8d8dadb81ceb43a30125804203c Author: Eric Biggers Date: Mon Oct 9 23:41:23 2023 -0700 crypto: arm64/sha1-ce - clean up backwards function names In the Linux kernel, a function whose name has two leading underscores is conventionally called by the same-named function without leading underscores -- not the other way around. __sha1_ce_transform() got this backwards. Fix this. No change in behavior. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 796b06f5c9d68ce46ed91573f256de34e00ec8c5 Author: Eric Biggers Date: Mon Oct 9 22:59:46 2023 -0700 crypto: x86/nhpoly1305 - implement ->digest Implement the ->digest method to improve performance on single-page messages by reducing the number of indirect calls. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit ddefde7b2af85b1f689c44a5ffdf1198767c9c2a Author: Eric Biggers Date: Mon Oct 9 22:59:45 2023 -0700 crypto: arm64/nhpoly1305 - implement ->digest Implement the ->digest method to improve performance on single-page messages by reducing the number of indirect calls. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 5f929b4e6906cc245ddfa9b94cf6666af5062900 Author: Eric Biggers Date: Mon Oct 9 22:59:44 2023 -0700 crypto: arm/nhpoly1305 - implement ->digest Implement the ->digest method to improve performance on single-page messages by reducing the number of indirect calls. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit dadf5e56c967a095213f664135784bf770eb96ab Author: Eric Biggers Date: Mon Oct 9 22:59:43 2023 -0700 crypto: adiantum - add fast path for single-page messages When the source scatterlist is a single page, optimize the first hash step of adiantum to use crypto_shash_digest() instead of init/update/final, and use the same local kmap for both hashing the bulk part and loading the narrow part of the source data. Likewise, when the destination scatterlist is a single page, optimize the second hash step of adiantum to use crypto_shash_digest() instead of init/update/final, and use the same local kmap for both hashing the bulk part and storing the narrow part of the destination data. In some cases these optimizations improve performance significantly. Note: ideally, for optimal performance each architecture should implement the full "adiantum(xchacha12,aes)" algorithm and fully optimize the contiguous buffer case to use no indirect calls. That's not something I've gotten around to doing, though. This commit just makes a relatively small change that provides some benefit with the existing template-based approach. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 01aed663e6c421aeafc9c330bda630976b50a764 Author: Svyatoslav Pankratov Date: Mon Oct 9 13:27:19 2023 +0100 crypto: qat - fix double free during reset There is no need to free the reset_data structure if the recovery is unsuccessful and the reset is synchronous. The function adf_dev_aer_schedule_reset() handles the cleanup properly. Only asynchronous resets require such structure to be freed inside the reset worker. Fixes: d8cba25d2c68 ("crypto: qat - Intel(R) QAT driver framework") Signed-off-by: Svyatoslav Pankratov Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit fdcac2ddc759752cb4886138d89a8c06bf5086a7 Author: Eric Biggers Date: Mon Oct 9 01:19:00 2023 -0700 crypto: x86/sha256 - implement ->digest for sha256 Implement a ->digest function for sha256-ssse3, sha256-avx, sha256-avx2, and sha256-ni. This improves the performance of crypto_shash_digest() with these algorithms by reducing the number of indirect calls that are made. For now, don't bother with this for sha224, since sha224 is rarely used. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 1efcbf0eff1022f6a44f8c04691caa5f90606bac Author: Eric Biggers Date: Mon Oct 9 00:53:27 2023 -0700 crypto: arm64/sha2-ce - implement ->digest for sha256 Implement a ->digest function for sha256-ce. This improves the performance of crypto_shash_digest() with this algorithm by reducing the number of indirect calls that are made. This only adds ~112 bytes of code, mostly for the inlined init, as the finup function is tail-called. For now, don't bother with this for sha224, since sha224 is rarely used. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 2e02c25ac93463d52bd7c1010cd647c944f179e1 Author: Eric Biggers Date: Mon Oct 9 00:32:14 2023 -0700 crypto: shash - fold shash_digest_unaligned() into crypto_shash_digest() Fold shash_digest_unaligned() into its only remaining caller. Also, avoid a redundant check of CRYPTO_TFM_NEED_KEY by replacing the call to crypto_shash_init() with shash->init(desc). Finally, replace shash_update_unaligned() + shash_final_unaligned() with shash_finup_unaligned() which does exactly that. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 313a4074d78fc9b90c93c9298e9f90d86a144231 Author: Eric Biggers Date: Mon Oct 9 00:32:13 2023 -0700 crypto: shash - optimize the default digest and finup For an shash algorithm that doesn't implement ->digest, currently crypto_shash_digest() with aligned input makes 5 indirect calls: 1 to shash_digest_unaligned(), 1 to ->init, 2 to ->update ('alignmask + 1' bytes, then the rest), then 1 to ->final. This is true even if the algorithm implements ->finup. This is caused by an unnecessary fallback to code meant to handle unaligned inputs. In fact, crypto_shash_digest() already does the needed alignment check earlier. Therefore, optimize the number of indirect calls for aligned inputs to 3 when the algorithm implements ->finup. It remains at 5 when the algorithm implements neither ->finup nor ->digest. Similarly, for an shash algorithm that doesn't implement ->finup, currently crypto_shash_finup() with aligned input makes 4 indirect calls: 1 to shash_finup_unaligned(), 2 to ->update, and 1 to ->final. Optimize this to 3 calls. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit bb40d32689d73c46de39a0529d551f523f21dc9b Author: Eric Biggers Date: Sun Oct 8 19:31:16 2023 -0700 crypto: xts - use 'spawn' for underlying single-block cipher Since commit adad556efcdd ("crypto: api - Fix built-in testing dependency failures"), the following warning appears when booting an x86_64 kernel that is configured with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y and CONFIG_CRYPTO_AES_NI_INTEL=y, even when CONFIG_CRYPTO_XTS=y and CONFIG_CRYPTO_AES=y: alg: skcipher: skipping comparison tests for xts-aes-aesni because xts(ecb(aes-generic)) is unavailable This is caused by an issue in the xts template where it allocates an "aes" single-block cipher without declaring a dependency on it via the crypto_spawn mechanism. This issue was exposed by the above commit because it reversed the order that the algorithms are tested in. Specifically, when "xts(ecb(aes-generic))" is instantiated and tested during the comparison tests for "xts-aes-aesni", the "xts" template allocates an "aes" crypto_cipher for encrypting tweaks. This resolves to "aes-aesni". (Getting "aes-aesni" instead of "aes-generic" here is a bit weird, but it's apparently intended.) Due to the above-mentioned commit, the testing of "aes-aesni", and the finalization of its registration, now happens at this point instead of before. At the end of that, crypto_remove_spawns() unregisters all algorithm instances that depend on a lower-priority "aes" implementation such as "aes-generic" but that do not depend on "aes-aesni". However, because "xts" does not use the crypto_spawn mechanism for its "aes", its dependency on "aes-aesni" is not recognized by crypto_remove_spawns(). Thus, crypto_remove_spawns() unexpectedly unregisters "xts(ecb(aes-generic))". Fix this issue by making the "xts" template use the crypto_spawn mechanism for its "aes" dependency, like what other templates do. Note, this fix could be applied as far back as commit f1c131b45410 ("crypto: xts - Convert to skcipher"). However, the issue only got exposed by the much more recent changes to how the crypto API runs the self-tests, so there should be no need to backport this to very old kernels. Also, an alternative fix would be to flip the list iteration order in crypto_start_tests() to restore the original testing order. I'm thinking we should do that too, since the original order seems more natural, but it shouldn't be relied on for correctness. Fixes: adad556efcdd ("crypto: api - Fix built-in testing dependency failures") Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 9da274660289b516ee6b6ec5d42402138f336daf Author: zhenwei pi Date: Sat Oct 7 14:43:09 2023 +0800 crypto: virtio - handle config changed by work queue MST pointed out: config change callback is also handled incorrectly in this driver, it takes a mutex from interrupt context. Handle config changed by work queue instead. Cc: Gonglei (Arei) Cc: Halil Pasic Cc: Michael S. Tsirkin Signed-off-by: zhenwei pi Signed-off-by: Herbert Xu commit 3ac5fa3fb7ad29b778848ce778550912c2b77041 Merge: 27442758e9b4e 213c43676beb5 Author: Dave Airlie Date: Fri Oct 20 15:06:30 2023 +1000 Merge tag 'drm-intel-next-2023-10-19' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Add new DG2 PCI IDs (Shekhar) - Remove watchdog timers for PSR on Lunar Lake (Mika Kahola) - DSB changes for proper handling of LUT programming (Ville) - Store DSC DPCD capabilities in the connector (Imre) - Clean up zero initializers (Ville) - Remove Meteor Lake force_probe protection (RK) Signed-off-by: Dave Airlie From: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/ZTFW4g6duLtp+Wy0@intel.com commit c00504ea42c08f79985fe2b7b3f9ec5d4f3ffb23 Author: Vignesh Raghavendra Date: Thu Oct 19 17:30:58 2023 -0500 arm64: dts: ti: k3-am62p5-sk: Updates for SK EVM Update the am62p5-sk board file to enable the new IPs introduced in the SoC dtb. Signed-off-by: Bryan Brattlof Link: https://lore.kernel.org/r/20231019223055.1574125-6-bb@ti.com Signed-off-by: Vignesh Raghavendra commit b5080c7c1f7e4ceac26ad4fa73df00d366c17ae6 Author: Vignesh Raghavendra Date: Thu Oct 19 17:30:57 2023 -0500 arm64: dts: ti: k3-am62p: Add nodes for more IPs The am62px shares many of the same IP as the existing am62x family of SoCs, Introduce more nodes for hardware available on the am62p5. Signed-off-by: Bryan Brattlof Link: https://lore.kernel.org/r/20231019223055.1574125-5-bb@ti.com Signed-off-by: Vignesh Raghavendra commit ccf8a0528061b4ca5f5c0e73c8d888e7e6d8b054 Author: Zhang Rui Date: Fri Oct 6 09:59:14 2023 +0800 tools/power/turbostat: Obey allowed CPUs for primary thread/core detection Thread_id doesn't tell if a CPU is allowed or not. Detect allowed CPUs only and use the first detected thread/core as the primary thread/core of a core/package. Signed-off-by: Zhang Rui commit 74318add132365db3026e281ac06836a26cda857 Author: Zhang Rui Date: Wed Oct 4 15:13:23 2023 +0800 tools/power/turbostat: Abstract several functions When detecting the primary thread/core in a core/package, current code doesn't handle the allowed CPUs. Abstract several functions for further fix of this issue. No functional change. Signed-off-by: Zhang Rui commit 7bb3fe27ad4f62039b2ac80a2147452a608b474f Author: Zhang Rui Date: Wed Oct 4 14:25:25 2023 +0800 tools/power/turbostat: Obey allowed CPUs during startup Set turbostat CPU affinity to make sure turbostat is running on one of the allowed CPUs. Set base_cpu to the first allowed CPU so that some platform information is dumped using one of the allowed CPUs. Signed-off-by: Zhang Rui commit 4ede6d1ce7acba9cafe7df4e935b174623cd2181 Author: Zhang Rui Date: Wed Oct 4 13:52:02 2023 +0800 tools/power/turbostat: Obey allowed CPUs when accessing CPU counters for_all_cpus/for_all_cpus_2 are used for accessing the per CPU counters, and they should follow the cpu_allowed_set instead of cpu_present_set. Signed-off-by: Zhang Rui commit 71cfd1da9f0635ccd7124ad8b67b9aed596be491 Author: Zhang Rui Date: Fri Oct 6 11:01:17 2023 +0800 tools/power/turbostat: Introduce cpu_allowed_set Turbostat supports "-c" parameter which limits output to system summary plus the specified cpu-set. But some code still uses cpu_present_set to read and dump the counters. Introduce cpu_allowed_set for code that should obey the specified cpu-set. No functional change. Signed-off-by: Zhang Rui commit 9b4c8dd99fe48721410741651d426015e03a4b7a Author: Zhiguo Niu Date: Wed Oct 18 14:51:02 2023 +0800 f2fs: fix error handling of __get_node_page Use f2fs_handle_error to record inconsistent node block error and return -EFSCORRUPTED instead of -EINVAL. Signed-off-by: Zhiguo Niu Signed-off-by: Jaegeuk Kim commit f4738f56d1dc62aaba69b33702a5ab098f1b8c63 Author: Kuppuswamy Sathyanarayanan Date: Mon Sep 25 20:10:10 2023 -0700 virt: tdx-guest: Add Quote generation support using TSM_REPORTS In TDX guest, the attestation process is used to verify the TDX guest trustworthiness to other entities before provisioning secrets to the guest. The first step in the attestation process is TDREPORT generation, which involves getting the guest measurement data in the format of TDREPORT, which is further used to validate the authenticity of the TDX guest. TDREPORT by design is integrity-protected and can only be verified on the local machine. To support remote verification of the TDREPORT in a SGX-based attestation, the TDREPORT needs to be sent to the SGX Quoting Enclave (QE) to convert it to a remotely verifiable Quote. SGX QE by design can only run outside of the TDX guest (i.e. in a host process or in a normal VM) and guest can use communication channels like vsock or TCP/IP to send the TDREPORT to the QE. But for security concerns, the TDX guest may not support these communication channels. To handle such cases, TDX defines a GetQuote hypercall which can be used by the guest to request the host VMM to communicate with the SGX QE. More details about GetQuote hypercall can be found in TDX Guest-Host Communication Interface (GHCI) for Intel TDX 1.0, section titled "TDG.VP.VMCALL". Trusted Security Module (TSM) [1] exposes a common ABI for Confidential Computing Guest platforms to get the measurement data via ConfigFS. Extend the TSM framework and add support to allow an attestation agent to get the TDX Quote data (included usage example below). report=/sys/kernel/config/tsm/report/report0 mkdir $report dd if=/dev/urandom bs=64 count=1 > $report/inblob hexdump -C $report/outblob rmdir $report GetQuote TDVMCALL requires TD guest pass a 4K aligned shared buffer with TDREPORT data as input, which is further used by the VMM to copy the TD Quote result after successful Quote generation. To create the shared buffer, allocate a large enough memory and mark it shared using set_memory_decrypted() in tdx_guest_init(). This buffer will be re-used for GetQuote requests in the TDX TSM handler. Although this method reserves a fixed chunk of memory for GetQuote requests, such one time allocation can help avoid memory fragmentation related allocation failures later in the uptime of the guest. Since the Quote generation process is not time-critical or frequently used, the current version uses a polling model for Quote requests and it also does not support parallel GetQuote requests. Link: https://lore.kernel.org/lkml/169342399185.3934343.3035845348326944519.stgit@dwillia2-xfh.jf.intel.com/ [1] Signed-off-by: Kuppuswamy Sathyanarayanan Reviewed-by: Erdem Aktas Tested-by: Kuppuswamy Sathyanarayanan Tested-by: Peter Gonda Reviewed-by: Tom Lendacky Signed-off-by: Dan Williams commit f47906782c76294b3468f7584f666bc114927aa1 Author: Dan Williams Date: Tue Oct 10 20:03:19 2023 -0700 virt: sevguest: Add TSM_REPORTS support for SNP_GET_EXT_REPORT The sevguest driver was a first mover in the confidential computing space. As a first mover that afforded some leeway to build the driver without concern for common infrastructure. Now that sevguest is no longer a singleton [1] the common operation of building and transmitting attestation report blobs can / should be made common. In this model the so called "TSM-provider" implementations can share a common envelope ABI even if the contents of that envelope remain vendor-specific. When / if the industry agrees on an attestation record format, that definition can also fit in the same ABI. In the meantime the kernel's maintenance burden is reduced and collaboration on the commons is increased. Convert sevguest to use CONFIG_TSM_REPORTS to retrieve the data that the SNP_GET_EXT_REPORT ioctl produces. An example flow follows for retrieving the report blob via the TSM interface utility, assuming no nonce and VMPL==2: report=/sys/kernel/config/tsm/report/report0 mkdir $report echo 2 > $report/privlevel dd if=/dev/urandom bs=64 count=1 > $report/inblob hexdump -C $report/outblob # SNP report hexdump -C $report/auxblob # cert_table rmdir $report Given that the platform implementation is free to return empty certificate data if none is available it lets configfs-tsm be simplified as it only needs to worry about wrapping SNP_GET_EXT_REPORT, and leave SNP_GET_REPORT alone. The old ioctls can be lazily deprecated, the main motivation of this effort is to stop the proliferation of new ioctls, and to increase cross-vendor collaboration. Link: http://lore.kernel.org/r/64961c3baf8ce_142af829436@dwillia2-xfh.jf.intel.com.notmuch [1] Cc: Borislav Petkov Cc: Tom Lendacky Cc: Dionna Glaze Cc: Jeremi Piotrowski Tested-by: Kuppuswamy Sathyanarayanan Tested-by: Alexey Kardashevskiy Reviewed-by: Tom Lendacky Signed-off-by: Dan Williams commit a67d74a4b163878a3c0537033ed1b20db92ebfc5 Author: Dan Williams Date: Wed Jul 19 18:14:13 2023 -0700 mm/slab: Add __free() support for kvfree Allow for the declaration of variables that trigger kvfree() when they go out of scope. The check for NULL and call to kvfree() can be elided by the compiler in most cases, otherwise without the NULL check an unnecessary call to kvfree() may be emitted. Peter proposed a comment for this detail [1]. Link: http://lore.kernel.org/r/20230816103102.GF980931@hirez.programming.kicks-ass.net [1] Cc: Andrew Morton Cc: Peter Zijlstra Cc: Greg Kroah-Hartman Acked-by: Pankaj Gupta Acked-by: Greg Kroah-Hartman Reviewed-by: Kuppuswamy Sathyanarayanan Tested-by: Kuppuswamy Sathyanarayanan Reviewed-by: Tom Lendacky Signed-off-by: Dan Williams commit 2df2135366833c372f3a14ffcc655f9c5724d972 Author: Dan Williams Date: Tue Jul 18 17:55:50 2023 -0700 virt: sevguest: Prep for kernel internal get_ext_report() In preparation for using the configs-tsm facility to convey attestation blobs to userspace, switch to using the 'sockptr' api for copying payloads to provided buffers where 'sockptr' handles user vs kernel buffers. While configfs-tsm is meant to replace existing confidential computing ioctl() implementations for attestation report retrieval the old ioctl() path needs to stick around for a deprecation period. No behavior change intended. Cc: Borislav Petkov Cc: Tom Lendacky Cc: Dionna Glaze Reviewed-by: Kuppuswamy Sathyanarayanan Tested-by: Kuppuswamy Sathyanarayanan Reviewed-by: Tom Lendacky Signed-off-by: Dan Williams commit 70e6f7e2b98575621019aa40ac616be58ff984e0 Author: Dan Williams Date: Mon Sep 25 20:13:29 2023 -0700 configfs-tsm: Introduce a shared ABI for attestation reports One of the common operations of a TSM (Trusted Security Module) is to provide a way for a TVM (confidential computing guest execution environment) to take a measurement of its launch state, sign it and submit it to a verifying party. Upon successful attestation that verifies the integrity of the TVM additional secrets may be deployed. The concept is common across TSMs, but the implementations are unfortunately vendor specific. While the industry grapples with a common definition of this attestation format [1], Linux need not make this problem worse by defining a new ABI per TSM that wants to perform a similar operation. The current momentum has been to invent new ioctl-ABI per TSM per function which at best is an abdication of the kernel's responsibility to make common infrastructure concepts share common ABI. The proposal, targeted to conceptually work with TDX, SEV-SNP, COVE if not more, is to define a configfs interface to retrieve the TSM-specific blob. report=/sys/kernel/config/tsm/report/report0 mkdir $report dd if=binary_userdata_plus_nonce > $report/inblob hexdump $report/outblob This approach later allows for the standardization of the attestation blob format without needing to invent a new ABI. Once standardization happens the standard format can be emitted by $report/outblob and indicated by $report/provider, or a new attribute like "$report/tcg_coco_report" can emit the standard format alongside the vendor format. Review of previous iterations of this interface identified that there is a need to scale report generation for multiple container environments [2]. Configfs enables a model where each container can bind mount one or more report generation item instances. Still, within a container only a single thread can be manipulating a given configuration instance at a time. A 'generation' count is provided to detect conflicts between multiple threads racing to configure a report instance. The SEV-SNP concepts of "extended reports" and "privilege levels" are optionally enabled by selecting 'tsm_report_ext_type' at register_tsm() time. The expectation is that those concepts are generic enough that they may be adopted by other TSM implementations. In other words, configfs-tsm aims to address a superset of TSM specific functionality with a common ABI where attributes may appear, or not appear, based on the set of concepts the implementation supports. Link: http://lore.kernel.org/r/64961c3baf8ce_142af829436@dwillia2-xfh.jf.intel.com.notmuch [1] Link: http://lore.kernel.org/r/57f3a05e-8fcd-4656-beea-56bb8365ae64@linux.microsoft.com [2] Cc: Kuppuswamy Sathyanarayanan Cc: Dionna Amalie Glaze Cc: James Bottomley Cc: Peter Gonda Cc: Greg Kroah-Hartman Cc: Samuel Ortiz Acked-by: Greg Kroah-Hartman Acked-by: Thomas Gleixner Reviewed-by: Kuppuswamy Sathyanarayanan Tested-by: Kuppuswamy Sathyanarayanan Reviewed-by: Tom Lendacky Signed-off-by: Dan Williams commit ec51ffcf263016111f090b9440a3c5a8338648e8 Author: Dan Williams Date: Sat Aug 12 17:21:00 2023 -0700 virt: coco: Add a coco/Makefile and coco/Kconfig In preparation for adding another coco build target, relieve drivers/virt/Makefile of the responsibility to track new compilation unit additions to drivers/virt/coco/, and do the same for drivers/virt/Kconfig. Reviewed-by: Kuppuswamy Sathyanarayanan Tested-by: Kuppuswamy Sathyanarayanan Reviewed-by: Tom Lendacky Signed-off-by: Dan Williams commit bab8ac3c5339d7ec5312dcd836cfa8645edb954f Merge: 6bd5e167af2e9 130e0f7af9fc7 Author: Alexei Starovoitov Date: Thu Oct 19 17:02:47 2023 -0700 Merge branch 'add-open-coded-task-css_task-and-css-iters' Chuyi Zhou says: ==================== Add Open-coded task, css_task and css iters This is version 6 of task, css_task and css iters support. --- Changelog --- v5 -> v6: Patch #3: * In bpf_iter_task_next, return pos rather than goto out. (Andrii) Patch #2, #3, #4: * Add the missing __diag_ignore_all to avoid kernel build warning Patch #5, #6, #7: * Add Andrii's ack Patch #8: * In BPF prog iter_css_task_for_each, return -EPERM rather than 0, and ensure stack_mprotect() in iters.c not success. If not, it would cause the subsequent 'test_lsm' fail, since the 'is_stack' check in test_int_hook(lsm.c) would not be guaranteed. (https://github.com/kernel-patches/bpf/actions/runs/6489662214/job/17624665086?pr=5790) v4 -> v5:https://lore.kernel.org/lkml/20231007124522.34834-1-zhouchuyi@bytedance.com/ Patch 3~4: * Relax the BUILD_BUG_ON check in bpf_iter_task_new and bpf_iter_css_new to avoid netdev/build_32bit CI error. (https://netdev.bots.linux.dev/static/nipa/790929/13412333/build_32bit/stderr) Patch 8: * Initialize skel pointer to fix the LLVM-16 build CI error (https://github.com/kernel-patches/bpf/actions/runs/6462875618/job/17545170863) v3 -> v4:https://lore.kernel.org/all/20230925105552.817513-1-zhouchuyi@bytedance.com/ * Address all the comments from Andrii in patch-3 ~ patch-6 * Collect Tejun's ack * Add a extra patch to rename bpf_iter_task.c to bpf_iter_tasks.c * Seperate three BPF program files for selftests (iters_task.c iters_css_task.c iters_css.c) v2 -> v3:https://lore.kernel.org/lkml/20230912070149.969939-1-zhouchuyi@bytedance.com/ Patch 1 (cgroup: Prepare for using css_task_iter_*() in BPF) * Add tj's ack and Alexei's suggest-by. Patch 2 (bpf: Introduce css_task open-coded iterator kfuncs) * Use bpf_mem_alloc/bpf_mem_free rather than kzalloc() * Add KF_TRUSTED_ARGS for bpf_iter_css_task_new (Alexei) * Move bpf_iter_css_task's definition from uapi/linux/bpf.h to kernel/bpf/task_iter.c and we can use it from vmlinux.h * Move bpf_iter_css_task_XXX's declaration from bpf_helpers.h to bpf_experimental.h Patch 3 (Introduce task open coded iterator kfuncs) * Change th API design keep consistent with SEC("iter/task"), support iterating all threads(BPF_TASK_ITERATE_ALL) and threads of a specific task (BPF_TASK_ITERATE_THREAD).(Andrii) * Move bpf_iter_task's definition from uapi/linux/bpf.h to kernel/bpf/task_iter.c and we can use it from vmlinux.h * Move bpf_iter_task_XXX's declaration from bpf_helpers.h to bpf_experimental.h Patch 4 (Introduce css open-coded iterator kfuncs) * Change th API design keep consistent with cgroup_iters, reuse BPF_CGROUP_ITER_DESCENDANTS_PRE/BPF_CGROUP_ITER_DESCENDANTS_POST /BPF_CGROUP_ITER_ANCESTORS_UP(Andrii) * Add KF_TRUSTED_ARGS for bpf_iter_css_new * Move bpf_iter_css's definition from uapi/linux/bpf.h to kernel/bpf/task_iter.c and we can use it from vmlinux.h * Move bpf_iter_css_XXX's declaration from bpf_helpers.h to bpf_experimental.h Patch 5 (teach the verifier to enforce css_iter and task_iter in RCU CS) * Add KF flag KF_RCU_PROTECTED to maintain kfuncs which need RCU CS.(Andrii) * Consider STACK_ITER when using bpf_for_each_spilled_reg. Patch 6 (Let bpf_iter_task_new accept null task ptr) * Add this extra patch to let bpf_iter_task_new accept a 'nullable' * task pointer(Andrii) Patch 7 (selftests/bpf: Add tests for open-coded task and css iter) * Add failure testcase(Alexei) Changes from v1(https://lore.kernel.org/lkml/20230827072057.1591929-1-zhouchuyi@bytedance.com/): - Add a pre-patch to make some preparations before supporting css_task iters.(Alexei) - Add an allowlist for css_task iters(Alexei) - Let bpf progs do explicit bpf_rcu_read_lock() when using process iters and css_descendant iters.(Alexei) --------------------- In some BPF usage scenarios, it will be useful to iterate the process and css directly in the BPF program. One of the expected scenarios is customizable OOM victim selection via BPF[1]. Inspired by Dave's task_vma iter[2], this patchset adds three types of open-coded iterator kfuncs: 1. bpf_task_iters. It can be used to 1) iterate all process in the system, like for_each_forcess() in kernel. 2) iterate all threads in the system. 3) iterate all threads of a specific task 2. bpf_css_iters. It works like css_task_iter_{start, next, end} and would be used to iterating tasks/threads under a css. 3. css_iters. It works like css_next_descendant_{pre, post} to iterating all descendant css. BPF programs can use these kfuncs directly or through bpf_for_each macro. link[1]: https://lore.kernel.org/lkml/20230810081319.65668-1-zhouchuyi@bytedance.com/ link[2]: https://lore.kernel.org/all/20230810183513.684836-1-davemarchevsky@fb.com/ ==================== Link: https://lore.kernel.org/r/20231018061746.111364-1-zhouchuyi@bytedance.com Signed-off-by: Alexei Starovoitov commit 130e0f7af9fc7388b90fb016ca13ff3840c48d4a Author: Chuyi Zhou Date: Wed Oct 18 14:17:46 2023 +0800 selftests/bpf: Add tests for open-coded task and css iter This patch adds 4 subtests to demonstrate these patterns and validating correctness. subtest1: 1) We use task_iter to iterate all process in the system and search for the current process with a given pid. 2) We create some threads in current process context, and use BPF_TASK_ITER_PROC_THREADS to iterate all threads of current process. As expected, we would find all the threads of current process. 3) We create some threads and use BPF_TASK_ITER_ALL_THREADS to iterate all threads in the system. As expected, we would find all the threads which was created. subtest2: We create a cgroup and add the current task to the cgroup. In the BPF program, we would use bpf_for_each(css_task, task, css) to iterate all tasks under the cgroup. As expected, we would find the current process. subtest3: 1) We create a cgroup tree. In the BPF program, we use bpf_for_each(css, pos, root, XXX) to iterate all descendant under the root with pre and post order. As expected, we would find all descendant and the last iterating cgroup in post-order is root cgroup, the first iterating cgroup in pre-order is root cgroup. 2) We wse BPF_CGROUP_ITER_ANCESTORS_UP to traverse the cgroup tree starting from leaf and root separately, and record the height. The diff of the hights would be the total tree-high - 1. subtest4: Add some failure testcase when using css_task, task and css iters, e.g, unlock when using task-iters to iterate tasks. Signed-off-by: Chuyi Zhou Link: https://lore.kernel.org/r/20231018061746.111364-9-zhouchuyi@bytedance.com Signed-off-by: Alexei Starovoitov commit ddab78cbb52f81f7f7598482602342955b2ff8b8 Author: Chuyi Zhou Date: Wed Oct 18 14:17:45 2023 +0800 selftests/bpf: rename bpf_iter_task.c to bpf_iter_tasks.c The newly-added struct bpf_iter_task has a name collision with a selftest for the seq_file task iter's bpf skel, so the selftests/bpf/progs file is renamed in order to avoid the collision. Signed-off-by: Chuyi Zhou Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20231018061746.111364-8-zhouchuyi@bytedance.com Signed-off-by: Alexei Starovoitov commit cb3ecf7915a1d7ce5304402f4d8616d9fa5193f7 Author: Chuyi Zhou Date: Wed Oct 18 14:17:44 2023 +0800 bpf: Let bpf_iter_task_new accept null task ptr When using task_iter to iterate all threads of a specific task, we enforce that the user must pass a valid task pointer to ensure safety. However, when iterating all threads/process in the system, BPF verifier still require a valid ptr instead of "nullable" pointer, even though it's pointless, which is a kind of surprising from usability standpoint. It would be nice if we could let that kfunc accept a explicit null pointer when we are using BPF_TASK_ITER_ALL_{PROCS, THREADS} and a valid pointer when using BPF_TASK_ITER_THREAD. Given a trival kfunc: __bpf_kfunc void FN(struct TYPE_A *obj); BPF Prog would reject a nullptr for obj. The error info is: "arg#x pointer type xx xx must point to scalar, or struct with scalar" reported by get_kfunc_ptr_arg_type(). The reg->type is SCALAR_VALUE and the btf type of ref_t is not scalar or scalar_struct which leads to the rejection of get_kfunc_ptr_arg_type. This patch add "__nullable" annotation: __bpf_kfunc void FN(struct TYPE_A *obj__nullable); Here __nullable indicates obj can be optional, user can pass a explicit nullptr or a normal TYPE_A pointer. In get_kfunc_ptr_arg_type(), we will detect whether the current arg is optional and register is null, If so, return a new kfunc_ptr_arg_type KF_ARG_PTR_TO_NULL and skip to the next arg in check_kfunc_args(). Signed-off-by: Chuyi Zhou Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20231018061746.111364-7-zhouchuyi@bytedance.com Signed-off-by: Alexei Starovoitov commit dfab99df147b0d364f0c199f832ff2aedfb2265a Author: Chuyi Zhou Date: Wed Oct 18 14:17:43 2023 +0800 bpf: teach the verifier to enforce css_iter and task_iter in RCU CS css_iter and task_iter should be used in rcu section. Specifically, in sleepable progs explicit bpf_rcu_read_lock() is needed before use these iters. In normal bpf progs that have implicit rcu_read_lock(), it's OK to use them directly. This patch adds a new a KF flag KF_RCU_PROTECTED for bpf_iter_task_new and bpf_iter_css_new. It means the kfunc should be used in RCU CS. We check whether we are in rcu cs before we want to invoke this kfunc. If the rcu protection is guaranteed, we would let st->type = PTR_TO_STACK | MEM_RCU. Once user do rcu_unlock during the iteration, state MEM_RCU of regs would be cleared. is_iter_reg_valid_init() will reject if reg->type is UNTRUSTED. It is worth noting that currently, bpf_rcu_read_unlock does not clear the state of the STACK_ITER reg, since bpf_for_each_spilled_reg only considers STACK_SPILL. This patch also let bpf_for_each_spilled_reg search STACK_ITER. Signed-off-by: Chuyi Zhou Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/r/20231018061746.111364-6-zhouchuyi@bytedance.com Signed-off-by: Alexei Starovoitov commit 7251d0905e7518bcb990c8e9a3615b1bb23c78f2 Author: Chuyi Zhou Date: Wed Oct 18 14:17:42 2023 +0800 bpf: Introduce css open-coded iterator kfuncs This Patch adds kfuncs bpf_iter_css_{new,next,destroy} which allow creation and manipulation of struct bpf_iter_css in open-coded iterator style. These kfuncs actually wrapps css_next_descendant_{pre, post}. css_iter can be used to: 1) iterating a sepcific cgroup tree with pre/post/up order 2) iterating cgroup_subsystem in BPF Prog, like for_each_mem_cgroup_tree/cpuset_for_each_descendant_pre in kernel. The API design is consistent with cgroup_iter. bpf_iter_css_new accepts parameters defining iteration order and starting css. Here we also reuse BPF_CGROUP_ITER_DESCENDANTS_PRE, BPF_CGROUP_ITER_DESCENDANTS_POST, BPF_CGROUP_ITER_ANCESTORS_UP enums. Signed-off-by: Chuyi Zhou Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20231018061746.111364-5-zhouchuyi@bytedance.com Signed-off-by: Alexei Starovoitov commit c68a78ffe2cb4207f64fd0f4262818c728c67be0 Author: Chuyi Zhou Date: Wed Oct 18 14:17:41 2023 +0800 bpf: Introduce task open coded iterator kfuncs This patch adds kfuncs bpf_iter_task_{new,next,destroy} which allow creation and manipulation of struct bpf_iter_task in open-coded iterator style. BPF programs can use these kfuncs or through bpf_for_each macro to iterate all processes in the system. The API design keep consistent with SEC("iter/task"). bpf_iter_task_new() accepts a specific task and iterating type which allows: 1. iterating all process in the system (BPF_TASK_ITER_ALL_PROCS) 2. iterating all threads in the system (BPF_TASK_ITER_ALL_THREADS) 3. iterating all threads of a specific task (BPF_TASK_ITER_PROC_THREADS) Signed-off-by: Chuyi Zhou Link: https://lore.kernel.org/r/20231018061746.111364-4-zhouchuyi@bytedance.com Signed-off-by: Alexei Starovoitov commit 9c66dc94b62aef23300f05f63404afb8990920b4 Author: Chuyi Zhou Date: Wed Oct 18 14:17:40 2023 +0800 bpf: Introduce css_task open-coded iterator kfuncs This patch adds kfuncs bpf_iter_css_task_{new,next,destroy} which allow creation and manipulation of struct bpf_iter_css_task in open-coded iterator style. These kfuncs actually wrapps css_task_iter_{start,next, end}. BPF programs can use these kfuncs through bpf_for_each macro for iteration of all tasks under a css. css_task_iter_*() would try to get the global spin-lock *css_set_lock*, so the bpf side has to be careful in where it allows to use this iter. Currently we only allow it in bpf_lsm and bpf iter-s. Signed-off-by: Chuyi Zhou Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20231018061746.111364-3-zhouchuyi@bytedance.com Signed-off-by: Alexei Starovoitov commit 6da88306811b40a207c94c9da9faf07bdb20776e Author: Chuyi Zhou Date: Wed Oct 18 14:17:39 2023 +0800 cgroup: Prepare for using css_task_iter_*() in BPF This patch makes some preparations for using css_task_iter_*() in BPF Program. 1. Flags CSS_TASK_ITER_* are #define-s and it's not easy for bpf prog to use them. Convert them to enum so bpf prog can take them from vmlinux.h. 2. In the next patch we will add css_task_iter_*() in common kfuncs which is not safe. Since css_task_iter_*() does spin_unlock_irq() which might screw up irq flags depending on the context where bpf prog is running. So we should use irqsave/irqrestore here and the switching is harmless. Suggested-by: Alexei Starovoitov Signed-off-by: Chuyi Zhou Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20231018061746.111364-2-zhouchuyi@bytedance.com Signed-off-by: Alexei Starovoitov commit 4eb15b036367006ec7f0b9880993ceb6ae259ec8 Author: Andreas Kemnade Date: Sat Sep 16 12:05:14 2023 +0200 clk: twl: add clock driver for TWL6032 The TWL6032 has some clock outputs which are controlled like fixed-voltage regulators, in some drivers for these chips found in the wild, just the regulator api is abused for controlling them, so simply use something similar to the regulator functions. Due to a lack of hardware available for testing, leave out the TWL6030-specific part of those functions. Signed-off-by: Andreas Kemnade Link: https://lore.kernel.org/r/20230916100515.1650336-5-andreas@kemnade.info Signed-off-by: Stephen Boyd commit 7ce6936045ba395f97e5feb54cd023afb8db9c0b Merge: 75a384ceda93d f9bc3cbc20d08 Author: Jakub Kicinski Date: Thu Oct 19 15:54:57 2023 -0700 Merge branch 'tools-ynl-gen-support-full-range-of-min-max-checks' Jakub Kicinski says: ==================== tools: ynl-gen: support full range of min/max checks YNL code gen currently supports only very simple range checks within the range of s16. Add support for full range of u64 / s64 which is good to have, and will be even more important with uint / sint. ==================== Link: https://lore.kernel.org/r/20231018163917.2514503-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit f9bc3cbc20d08c5c7b89a91e07ba46ab8042561e Author: Jakub Kicinski Date: Wed Oct 18 09:39:17 2023 -0700 tools: ynl-gen: support limit names Support the use of symbolic names like s8-min or u32-max in checks to make writing specs less painful. Link: https://lore.kernel.org/r/20231018163917.2514503-4-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 668c1ac828fb546b81da6b36dae09d754bd0f59e Author: Jakub Kicinski Date: Wed Oct 18 09:39:16 2023 -0700 tools: ynl-gen: support full range of min/max checks for integer values Extend the support to full range of min/max checks. None of the existing YNL families required complex integer validation. The support is less than trivial, because we try to keep struct nla_policy tiny the min/max members it holds in place are s16. Meaning we can only express checks in range of s16. For larger ranges we need to define a structure and link it in the policy. Link: https://lore.kernel.org/r/20231018163917.2514503-3-kuba@kernel.org Signed-off-by: Jakub Kicinski commit ee0a4cfcbdcc6a7b2b35dba475e68187ebdafbf1 Author: Jakub Kicinski Date: Wed Oct 18 09:39:15 2023 -0700 tools: ynl-gen: track attribute use For range validation we'll need to know if any individual attribute is used on input (i.e. whether we will generate a policy for it). Track this information. Link: https://lore.kernel.org/r/20231018163917.2514503-2-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 75a384ceda93df0ec2436f0188e58f166a609c49 Author: Dan Carpenter Date: Wed Oct 18 17:20:11 2023 +0300 ptp: prevent string overflow The ida_alloc_max() function can return up to INT_MAX so this buffer is not large enough. Also use snprintf() for extra safety. Fixes: 403376ddb422 ("ptp: add debugfs interface to see applied channel masks") Signed-off-by: Dan Carpenter Reviewed-by: Przemek Kitszel Link: https://lore.kernel.org/r/d4b1a995-a0cb-4125-aa1d-5fd5044aba1d@moroto.mountain Signed-off-by: Jakub Kicinski commit 50a472bbc79ff9d5a88be8019a60e936cadf9f13 Author: Jaegeuk Kim Date: Thu Oct 19 15:51:08 2023 -0700 f2fs: do not return EFSCORRUPTED, but try to run online repair If we return the error, there's no way to recover the status as of now, since fsck does not fix the xattr boundary issue. Cc: stable@vger.kernel.org Signed-off-by: Jaegeuk Kim commit 5329aa5101f73c451bcd48deaf3f296685849d9c Author: Jiao Zhou Date: Fri Oct 20 00:46:39 2023 +0200 efivarfs: Add uid/gid mount options Allow UEFI variables to be modified by non-root processes in order to run sandboxed code. This doesn't change the behavior of mounting efivarfs unless uid/gid are specified; by default both are set to root. Signed-off-by: Jiao Zhou Acked-by: Matthew Garrett Signed-off-by: Ard Biesheuvel commit b9ec913212e6e91efa5a0a612c4a8ec4cf5da896 Author: Breno Leitao Date: Mon Oct 16 06:47:49 2023 -0700 selftests/bpf/sockopt: Add io_uring support Expand the sockopt test to use also check for io_uring {g,s}etsockopt commands operations. This patch starts by marking each test if they support io_uring support or not. Right now, io_uring cmd getsockopt() has a limitation of only accepting level == SOL_SOCKET, otherwise it returns -EOPNOTSUPP. Since there aren't any test exercising getsockopt(level == SOL_SOCKET), this patch changes two tests to use level == SOL_SOCKET, they are "getsockopt: support smaller ctx->optlen" and "getsockopt: read ctx->optlen". There is no limitation for the setsockopt() part. Later, each test runs using regular {g,s}etsockopt systemcalls, and, if liburing is supported, execute the same test (again), but calling liburing {g,s}setsockopt commands. This patch also changes the level of two tests to use SOL_SOCKET for the following two tests. This is going to help to exercise the io_uring subsystem: * getsockopt: read ctx->optlen * getsockopt: support smaller ctx->optlen Signed-off-by: Breno Leitao Link: https://lore.kernel.org/r/20231016134750.1381153-12-leitao@debian.org Acked-by: Martin KaFai Lau Signed-off-by: Jens Axboe commit 4232c6e349f3a591fd0f432e6b858d32095adce6 Author: Breno Leitao Date: Mon Oct 16 06:47:48 2023 -0700 io_uring/cmd: Introduce SOCKET_URING_OP_SETSOCKOPT Add initial support for SOCKET_URING_OP_SETSOCKOPT. This new command is similar to setsockopt. This implementation leverages the function do_sock_setsockopt(), which is shared with the setsockopt() system call path. Important to say that userspace needs to keep the pointer's memory alive until the operation is completed. I.e, the memory could not be deallocated before the CQE is returned to userspace. Signed-off-by: Breno Leitao Reviewed-by: Gabriel Krisman Bertazi Link: https://lore.kernel.org/r/20231016134750.1381153-11-leitao@debian.org Signed-off-by: Jens Axboe commit a5d2f99aff6b6f9cd6a1ab6907d8be8066114791 Author: Breno Leitao Date: Mon Oct 16 06:47:47 2023 -0700 io_uring/cmd: Introduce SOCKET_URING_OP_GETSOCKOPT Add support for getsockopt command (SOCKET_URING_OP_GETSOCKOPT), where level is SOL_SOCKET. This is leveraging the sockptr_t infrastructure, where a sockptr_t is either userspace or kernel space, and handled as such. Differently from the getsockopt(2), the optlen field is not a userspace pointers. In getsockopt(2), userspace provides optlen pointer, which is overwritten by the kernel. In this implementation, userspace passes a u32, and the new value is returned in cqe->res. I.e., optlen is not a pointer. Important to say that userspace needs to keep the pointer alive until the CQE is completed. Signed-off-by: Breno Leitao Reviewed-by: Gabriel Krisman Bertazi Link: https://lore.kernel.org/r/20231016134750.1381153-10-leitao@debian.org Signed-off-by: Jens Axboe commit d2cac3ec823798861f8f39b4aa0ec960ffa997b0 Author: Breno Leitao Date: Mon Oct 16 06:47:46 2023 -0700 io_uring/cmd: return -EOPNOTSUPP if net is disabled Protect io_uring_cmd_sock() to be called if CONFIG_NET is not set. If network is not enabled, but io_uring is, then we want to return -EOPNOTSUPP for any possible socket operation. This is helpful because io_uring_cmd_sock() can now call functions that only exits if CONFIG_NET is enabled without having #ifdef CONFIG_NET inside the function itself. Signed-off-by: Breno Leitao Link: https://lore.kernel.org/r/20231016134750.1381153-9-leitao@debian.org Signed-off-by: Jens Axboe commit ba6e0e5cb5b2c2e736e16b4aead816450a8718e6 Author: Breno Leitao Date: Mon Oct 16 06:47:45 2023 -0700 selftests/net: Extract uring helpers to be reusable Instead of defining basic io_uring functions in the test case, move them to a common directory, so, other tests can use them. This simplify the test code and reuse the common liburing infrastructure. This is basically a copy of what we have in io_uring_zerocopy_tx with some minor improvements to make checkpatch happy. A follow-up test will use the same helpers in a BPF sockopt test. Signed-off-by: Breno Leitao Link: https://lore.kernel.org/r/20231016134750.1381153-8-leitao@debian.org Signed-off-by: Jens Axboe commit 7746a6adfc81e2e0386a85117d5e8fd824da367b Author: Breno Leitao Date: Mon Oct 16 06:47:44 2023 -0700 tools headers: Grab copy of io_uring.h This file will be used by mini_uring.h and allow tests to run without the need of installing liburing to run the tests. This is needed to run io_uring tests in BPF, such as (tools/testing/selftests/bpf/prog_tests/sockopt.c). Signed-off-by: Breno Leitao Link: https://lore.kernel.org/r/20231016134750.1381153-7-leitao@debian.org Signed-off-by: Jens Axboe commit 5fea44a6e05b86bf49019fbbf2ab30098d03e0dc Author: Breno Leitao Date: Mon Oct 16 06:47:43 2023 -0700 io_uring/cmd: Pass compat mode in issue_flags Create a new flag to track if the operation is running compat mode. This basically check the context->compat and pass it to the issue_flags, so, it could be queried later in the callbacks. Signed-off-by: Breno Leitao Reviewed-by: Gabriel Krisman Bertazi Link: https://lore.kernel.org/r/20231016134750.1381153-6-leitao@debian.org Signed-off-by: Jens Axboe commit 0b05b0cd78c92371fdde6333d006f39eaf9e0860 Author: Breno Leitao Date: Mon Oct 16 06:47:42 2023 -0700 net/socket: Break down __sys_getsockopt Split __sys_getsockopt() into two functions by removing the core logic into a sub-function (do_sock_getsockopt()). This will avoid code duplication when doing the same operation in other callers, for instance. do_sock_getsockopt() will be called by io_uring getsockopt() command operation in the following patch. The same was done for the setsockopt pair. Suggested-by: Martin KaFai Lau Signed-off-by: Breno Leitao Acked-by: Jakub Kicinski Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20231016134750.1381153-5-leitao@debian.org Signed-off-by: Jens Axboe commit 207430b76a48b0b245bab08efe346148a5558df7 Author: Felix Kuehling Date: Mon Jul 17 15:28:52 2023 -0400 drm/amdgpu: Reserve fences for VM update In amdgpu_dma_buf_move_notify reserve fences for the page table updates in amdgpu_vm_clear_freed and amdgpu_vm_handle_moved. This fixes a BUG_ON in dma_resv_add_fence when using SDMA for page table updates. Signed-off-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit e6f8588733342c61948fde673a862b53c0d972bc Author: Felix Kuehling Date: Tue Oct 17 16:51:03 2023 -0400 drm/amdgpu: Fix possible null pointer dereference abo->tbo.resource may be NULL in amdgpu_vm_bo_update. Fixes: 180253782038 ("drm/ttm: stop allocating dummy resources during BO creation") Signed-off-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit b1338a8e71acaf68892b390dee0271fe7323b64d Author: Stanley.Yang Date: Tue Oct 17 21:49:09 2023 +0800 drm/amdgpu: Workaround to skip kiq ring test during ras gpu recovery This is workaround, kiq ring test failed in suspend stage when do ras recovery. Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5509e59611368da61280941e6a24cf2c9fc750e3 Author: Colin Ian King Date: Tue Oct 17 09:06:16 2023 +0100 drm/amd/display: Fix a handful of spelling mistakes in dml_print output There are a few spelling mistakes and an minor grammatical issue in some dml_print messages. Fix these. Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit 8e9a110cb22bbf8be33ad0113d5e2191ca446e30 Author: Jiapeng Chong Date: Fri Oct 13 11:21:29 2023 +0800 drm/amdkfd: clean up some inconsistent indenting No functional modification involved. drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:305 svm_range_free() warn: inconsistent indenting. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6804 Signed-off-by: Jiapeng Chong Signed-off-by: Felix Kuehling Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit bf2cc5e959951e81bc25beb0b8feb7ec8ab6e5cc Author: Stylon Wang Date: Fri Oct 13 16:10:53 2023 +0800 drm/amd/display: Remove brackets in macro to conform to coding style [Why] Many of the register macros defined ind dcn32_resource.h have extra brackets. This is not conforming to the style of those defined in other DC header files. [How] Remove these brackets in dcn32_resource.h Reviewed-by: Aurabindo Pillai Signed-off-by: Stylon Wang Signed-off-by: Alex Deucher commit e56690bb37eb202cfc31deb6b794dc8fca9b9a89 Author: Mario Limonciello Date: Fri Oct 13 14:26:04 2023 -0500 drm/amd: Read IMU FW version from scratch register during hw_init If the IMU version wasn't discovered from the header, such as when the firmware was directly loaded by PSP then there is no firmware version to show to userspace from sysfs or IOCTL. The IMU F/W stores the version in the first scratch register though, so fetch it in these cases to let the driver export. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 4916615fe96fb530517b0d46702c750c20a5601c Author: Mario Limonciello Date: Fri Oct 13 14:26:03 2023 -0500 drm/amd: Don't parse IMU ucode version if it won't be loaded When the IMU ucode is loaded by the PSP parsing the version that comes from Linux will vary. Rather than showing the wrong data to kernel interface consumers, avoid populating it in this case. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit d757dfd667aad54c6ed0b6f22a11ad5a317663de Author: Mario Limonciello Date: Fri Oct 13 14:26:02 2023 -0500 drm/amd: Move microcode init step to early_init() The intention for early init is to find any missing microcode early and fail the driver load if it's missing. Move this step to earlier in driver init to match other IP blocks. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit d8c1925ba8cde2863297728a4c8fbf8fe766757a Author: Asad Kamal Date: Mon Oct 16 22:10:34 2023 +0800 drm/amdgpu: update retry times for psp BL wait Increase retry time for PSP BL wait, to compensate for longer time to set c2pmsg 35 ready bit during mode1 with RAS Signed-off-by: Asad Kamal Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 2ceec37b0e3d470c4ef0ca0b7b71df52b99e040b Author: Mario Limonciello Date: Tue Oct 17 14:37:43 2023 -0500 drm/amd: Add missing kernel doc for prepare_suspend() prepare_suspend() is intended to be used for any IP blocks that must allocate memory during the suspend sequence. Reported-by: Stephen Rothwell Closes: https://lore.kernel.org/all/20231017143555.6a6450fc@canb.auug.org.au/ Fixes: cb11ca3233aa ("drm/amd: Add concept of running prepare_suspend() sequence for IP blocks") Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 20ace55bc0c222eff83fc4ff5d990c110817b49d Author: Alex Deucher Date: Thu Sep 21 15:43:30 2023 -0400 drm/amdgpu: update to the latest GC 11.5 headers Add some additional bitfields. Signed-off-by: Alex Deucher commit 828f8e31379b28fe7f07fb5865b8ed099d223fca Author: Kunwu.Chan Date: Tue Oct 10 14:10:39 2023 +0800 drm/amd/pm: Fix a memory leak on an error path Add missing free on an error path. Fixes: 511a95552ec8 ("drm/amd/pm: Add SMU 13.0.6 support") Reviewed-by: Yang Wang Signed-off-by: Kunwu.Chan Signed-off-by: Alex Deucher commit 28ab9a02b6cf3323c677e75045141d1d24631385 Author: Alex Deucher Date: Wed Oct 11 09:49:14 2023 -0400 drm/amdgpu/mes11: remove aggregated doorbell code It's not enabled in hardware so the code is dead. Remove it. Reviewed-by: Jack Xiao Signed-off-by: Alex Deucher commit 53dd920c1f471a5763c660a7b94fe0aaf746d357 Author: Asad Kamal Date: Thu Oct 5 15:40:42 2023 +0800 drm/amdgpu : Add hive ras recovery check If one of the devices in the hive detects a fatal error, need to send ras recovery reset message to PMFW of all devices in the hive. For that add a flag in hive to indicate that it's undergoing ras recovery Signed-off-by: Asad Kamal Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 16fb2a41e64e3133e9457c85490f6ee36c2ffaaf Author: Stylon Wang Date: Thu Oct 12 17:07:10 2023 +0800 drm/amd/display: Add missing lines of code in dc.c [Why & How] A critial part of "drm/amd/display: Fix windowed MPO video with ODM combine for DCN32" is lost during promotion to upstream. This patch addes the code back to dc.c. Signed-off-by: Stylon Wang Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 2d955a06a5db7388d177fe0d3ce638e7d7b90a16 Author: Mangesh Gadre Date: Wed Oct 11 16:33:17 2023 +0800 Revert "drm/amdgpu: Program xcp_ctl registers as needed" This reverts commit 0bdebfef3fb2b6291000765eaa9c6c8030293fce. XCP_CTL register is programmed by firmware and register access is protected. Signed-off-by: Mangesh Gadre Reviewed-by: Lijo Lazar Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit ab29ac57ad0b3ab0be7c7635e585651da9f2cd2c Author: Lang Yu Date: Thu Oct 12 17:48:40 2023 +0800 drm/amdgpu/umsch: add suspend and resume callback Add missing IP callbacks. Signed-off-by: Lang Yu Acked-by: Alex Deucher Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit e40dd9c6b75d667daea3b320617d4b80495e8afe Author: Alex Deucher Date: Thu Oct 12 15:10:53 2023 -0400 drm/amdgpu/pm: update SMU 13.0.0 PMFW version check Update the PMFW version check the the ROCm optimizations. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c2635c0ec8b47ef6c6c9cc7a69bf48d498116d44 Author: Cong Yang Date: Fri Oct 13 17:18:44 2023 +0800 arm64: defconfig: Enable ILITEK_ILI9882T panel DRM_PANEL_ILITEK_ILI9882T is being split out from DRM_PANEL_BOE_TV101WUM_NL6. Since the arm64 defconfig had the BOE panel driver enabled, let's also enable the Ilitek driver. Reviewed-by: Douglas Anderson Signed-off-by: Cong Yang Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20231013091844.804310-4-yangcong5@huaqin.corp-partner.google.com commit 5820a1932ce85ea416e7f99ee91c54cf0d2130f3 Author: Cong Yang Date: Fri Oct 13 17:18:43 2023 +0800 drm/panel: ili9882t: Avoid blurred screen from fast sleep At present, we have found that there may be a problem of blurred screen during fast sleep/resume. The direct cause of the blurred screen is that the IC does not receive 0x28/0x10. Because of the particularity of the IC, before the panel enters sleep hid must stop scanning, as i2c_hid_core_suspend before ili9882t_disable. If move the ili9882t_enter_sleep_mode function to ili9882t_unprepare, touch reset will pull low before panel entersleep, which does not meet the timing requirements.. So in order to solve this problem, the IC can handle it through the exception mechanism when it cannot receive 0x28/0x10 command. Handling exceptions requires a reset 50ms delay. Refer to vendor detailed analysis [1]. Ilitek vendor also suggested switching the page before entering sleep to avoid panel IC not receiving 0x28/0x10 command. Note: 0x28 is display off, 0x10 is sleep in. [1]: https://github.com/ILITEK-LoganLin/Document/tree/main/ILITEK_Power_Sequence Signed-off-by: Cong Yang Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20231013091844.804310-3-yangcong5@huaqin.corp-partner.google.com commit e2450d32e5fb5f89bf93e52f4ce694ad655cdc66 Author: Cong Yang Date: Fri Oct 13 17:18:42 2023 +0800 drm/panel: ili9882t: Break out as separate driver The Starry ILI9882t-based panel should never have been part of the boe tv101wum driver, it is clearly based on the Ilitek ILI9882t display controller and if you look at the custom command sequences for the panel these clearly contain the signature Ilitek page switch (0xff) commands. The hardware has nothing in common with the other panels supported by this driver. Break this out into a separate driver and config symbol instead. If the placement here is out of convenience for using similar code, we should consider creating a helper library instead. Co-developed-by: Linus Walleij Signed-off-by: Linus Walleij Reviewed-by: Linus Walleij Reviewed-by: Douglas Anderson Signed-off-by: Cong Yang Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20231013091844.804310-2-yangcong5@huaqin.corp-partner.google.com commit 041c3466f39d7073bbc7fb91c4e5d14170d5eb08 Merge: f2cab25b0eb7b ce55c22ec8b22 Author: Jakub Kicinski Date: Thu Oct 19 13:13:03 2023 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. net/mac80211/key.c 02e0e426a2fb ("wifi: mac80211: fix error path key leak") 2a8b665e6bcc ("wifi: mac80211: remove key_mtx") 7d6904bf26b9 ("Merge wireless into wireless-next") https://lore.kernel.org/all/20231012113648.46eea5ec@canb.auug.org.au/ Adjacent changes: drivers/net/ethernet/ti/Kconfig a602ee3176a8 ("net: ethernet: ti: Fix mixed module-builtin object") 98bdeae9502b ("net: cpmac: remove driver to prepare for platform removal") Signed-off-by: Jakub Kicinski commit 1406245c29454ff84919736be83e14cdaba7fec1 Author: Breno Leitao Date: Mon Oct 16 06:47:41 2023 -0700 net/socket: Break down __sys_setsockopt Split __sys_setsockopt() into two functions by removing the core logic into a sub-function (do_sock_setsockopt()). This will avoid code duplication when doing the same operation in other callers, for instance. do_sock_setsockopt() will be called by io_uring setsockopt() command operation in the following patch. Signed-off-by: Breno Leitao Reviewed-by: Willem de Bruijn Acked-by: Jakub Kicinski Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20231016134750.1381153-4-leitao@debian.org Signed-off-by: Jens Axboe commit 3f31e0d14d44ad491a81b7c1f83f32fbc300a867 Author: Breno Leitao Date: Mon Oct 16 06:47:40 2023 -0700 bpf: Add sockptr support for setsockopt The whole network stack uses sockptr, and while it doesn't move to something more modern, let's use sockptr in setsockptr BPF hooks, so, it could be used by other callers. The main motivation for this change is to use it in the io_uring {g,s}etsockopt(), which will use a userspace pointer for *optval, but, a kernel value for optlen. Link: https://lore.kernel.org/all/ZSArfLaaGcfd8LH8@gmail.com/ Signed-off-by: Breno Leitao Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20231016134750.1381153-3-leitao@debian.org Signed-off-by: Jens Axboe commit a615f67e1a426f35366b8398c11f31c148e7df48 Author: Breno Leitao Date: Mon Oct 16 06:47:39 2023 -0700 bpf: Add sockptr support for getsockopt The whole network stack uses sockptr, and while it doesn't move to something more modern, let's use sockptr in getsockptr BPF hooks, so, it could be used by other callers. The main motivation for this change is to use it in the io_uring {g,s}etsockopt(), which will use a userspace pointer for *optval, but, a kernel value for optlen. Link: https://lore.kernel.org/all/ZSArfLaaGcfd8LH8@gmail.com/ Signed-off-by: Breno Leitao Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/r/20231016134750.1381153-2-leitao@debian.org Signed-off-by: Jens Axboe commit 45f1b12e0366a750d65e92307685964488a3b6f4 Merge: 897d8e86bac76 f6b415faf6796 Author: Mark Brown Date: Thu Oct 19 21:02:18 2023 +0100 ASoC: Intel: more machine driver updates for 6.7 Merge series from Pierre-Louis Bossart : Two nice cleanups from Brent Lu and Charles Keepax, and one RaptorLake update. commit faf1dce852754a076bbd1d4bd3fc13c3e8f5d22a Author: Kent Overstreet Date: Sat Sep 9 20:56:00 2023 -0400 objtool: Add bcachefs noreturns Signed-off-by: Kent Overstreet commit 73badee4280ce30a927b82eedc919fb23ee549ae Author: Kent Overstreet Date: Tue Sep 12 01:17:22 2023 -0400 lib/generic-radix-tree.c: Add peek_prev() This patch adds genradix_peek_prev(), genradix_iter_rewind(), and genradix_for_each_reverse(), for iterating backwards over a generic radix tree. Signed-off-by: Kent Overstreet commit 9492261ff2460252cf2d8de89cdf854c7e2b28a0 Author: Kent Overstreet Date: Fri Feb 12 20:11:25 2021 -0500 lib/generic-radix-tree.c: Don't overflow in peek() When we started spreading new inode numbers throughout most of the 64 bit inode space, that triggered some corner case bugs, in particular some integer overflows related to the radix tree code. Oops. Signed-off-by: Kent Overstreet commit 0fb5d567f5739dfe7db678b299f96001eec6ee71 Author: Kent Overstreet Date: Wed Apr 26 12:27:51 2023 -0400 MAINTAINERS: Add entry for generic-radix-tree lib/generic-radix-tree.c is a simple radix tree that supports storing arbitrary types. Add a maintainers entry for it. Signed-off-by: Kent Overstreet commit b414e8ecd49867d9c83614800d405419e4f58e94 Author: Kent Overstreet Date: Sat Mar 4 22:45:27 2023 -0500 closures: Add a missing include Fixes building in userspace. Signed-off-by: Kent Overstreet commit 48b7935722b8403fec0469ba3dafc5a0af08225d Author: Kent Overstreet Date: Sat Mar 4 02:39:39 2023 -0500 closures: closure_nr_remaining() Factor out a new helper, which returns the number of events outstanding. Signed-off-by: Kent Overstreet commit ced58fc7ab9f2d4b3d8aaeb859321a61aa884f66 Author: Kent Overstreet Date: Sat Dec 9 12:42:44 2017 -0500 closures: closure_wait_event() Like wait_event() - except, because it uses closures and closure waitlists it doesn't have the restriction on modifying task state inside the condition check, like wait_event() does. Signed-off-by: Kent Overstreet Acked-by: Coly Li commit bd0d22e41ecbc5247e5f6a423636df14dbb1bef2 Author: Kent Overstreet Date: Wed Apr 26 12:27:51 2023 -0400 MAINTAINERS: Add entry for closures closures, from bcache, are async widgets with a variety of uses. bcachefs also uses them, so they're being moved to lib/; mark them as maintained. Signed-off-by: Kent Overstreet Acked-by: Coly Li Signed-off-by: Kent Overstreet commit 8c8d2d9670e813d623d8a2cbc881cb57344f4d37 Author: Kent Overstreet Date: Fri Mar 17 16:35:23 2017 -0800 bcache: move closures to lib/ Prep work for bcachefs - being a fork of bcache it also uses closures Signed-off-by: Kent Overstreet Acked-by: Coly Li Reviewed-by: Randy Dunlap commit 957e48087dfa38c976407f82e7525277d17a27ae Author: Brian Foster Date: Mon Aug 14 09:04:50 2023 -0400 locking: export contention tracepoints for bcachefs six locks The bcachefs implementation of six locks is intended to land in generic locking code in the long term, but has been pulled into the bcachefs subsystem for internal use for the time being. This code lift breaks the bcachefs module build as six locks depend a couple of the generic locking tracepoints. Export these tracepoint symbols for bcachefs. Signed-off-by: Brian Foster Signed-off-by: Kent Overstreet commit 2806a69f3fef61d7353ea8206add8ffb15064b51 Author: Sam Edwards Date: Wed Oct 11 16:58:23 2023 -0600 arm64: dts: rockchip: Add Turing RK1 SoM support The Turing RK1 is an upcoming RK3588-based SoM from Turing Machines, designed on the Jetson SO-DIMM form factor and meant to be compatible with most Jetson carrier boards (but especially the Turing Pi 2 cluster board from the same vendor). It has the typical I/O you'd expect from a Jetson board, including: - Two UARTs (UART9 for console, UART2 is auxiliary) - PCI Express (2.0 x1 + 3.0 x4) - Gigabit Ethernet - On-board eMMC - PWM fan w/ tach - USB-OTG [1] - HDMI and MIPI DSI [1] - Miscellaneous external GPIO, I²C, SPI lines [1] Beyond that, it is pretty similar to the RK3588 EVB (in terms of PMICs, RTC, etc). While this is absolutely a SoM, it is a little bit special in that it's marketed directly to users as a compute node, while most SoMs are intended to be a part/module incorporated into a larger system. Because of this, a majority of the users will be treating the RK1 less like a SoM and more like a miniature "blade server." This patch introduces a dtsi to enable most[1] of the SoM I/O, as well as a dts catered more directly to the "compute node" use case. [1] These peripherals are not addressed with this patch. Signed-off-by: Sam Edwards Link: https://lore.kernel.org/r/20231011225823.2542262-4-CFSworks@gmail.com Signed-off-by: Heiko Stuebner commit e30ecfcbe4ed3706af67dff5aa1418fba6ba2c29 Author: Sam Edwards Date: Wed Oct 11 16:58:22 2023 -0600 dt-bindings: arm: rockchip: Add Turing RK1 Add the Turing RK1, a Jetson-compatible system-on-module (SoM) powered by RK3588, from Turing Machines, Inc. Signed-off-by: Sam Edwards Acked-by: Rob Herring Link: https://lore.kernel.org/r/20231011225823.2542262-3-CFSworks@gmail.com Signed-off-by: Heiko Stuebner commit 817bacc3a648cc55a0b07a699c03ecc70309ae50 Author: Sam Edwards Date: Wed Oct 11 16:58:21 2023 -0600 dt-bindings: vendor-prefixes: add turing Add vendor prefix for Turing Machines, Inc. (https://turingpi.com) Signed-off-by: Sam Edwards Acked-by: Rob Herring Link: https://lore.kernel.org/r/20231011225823.2542262-2-CFSworks@gmail.com Signed-off-by: Heiko Stuebner commit f6b415faf6796963a56117f851378afe0ac33699 Author: Brent Lu Date: Thu Oct 19 12:34:11 2023 -0500 ASoC: Intel: sof_ssp_amp: use common module for DMIC links Use intel_board module for dmic01 and dmic16k DAI link initialization. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231019173411.166759-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c51fc25db18fe49e357455da726dd0ca98a43534 Author: Brent Lu Date: Thu Oct 19 12:34:10 2023 -0500 ASoC: Intel: sof_rt5682: use common module for DMIC links Use intel_board module for dmic01 and dmic16k DAI link initialization. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231019173411.166759-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit f56daafc94ec4c46349ced8d2b91873b98dd5482 Author: Brent Lu Date: Thu Oct 19 12:34:09 2023 -0500 ASoC: Intel: sof_nau8825: use common module for DMIC links Use intel_board module for dmic01 and dmic16k DAI link initialization. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231019173411.166759-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a1360c45a445f0824d4723136a9e993c94b77be8 Author: Brent Lu Date: Thu Oct 19 12:34:08 2023 -0500 ASoC: Intel: sof_cs42l42: use common module for DMIC links Use intel_board module for dmic01 and dmic16k DAI link initialization. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231019173411.166759-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 7fce91bab644f13e8a861ebf9c4c98a8072b6abc Author: Brent Lu Date: Thu Oct 19 12:34:07 2023 -0500 ASoC: Intel: board_helpers: support dmic link initialization Add functions for machine drivers to initialize dmic01 and dmic16k DAI links. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231019173411.166759-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5c072ca8e1b7545b280d5416ecef77e3b0891a2c Author: Terry Cheong Date: Thu Oct 19 12:34:06 2023 -0500 ASoC: Intel: sof_nau8825: add RPL support for MAX98360A amp Adding support back to RPL devices that lost audio after the RPL/ADL split. The hardware configuration is: SSP0: NAU88L25/NAU88L25YGB codec SSP1: MAX98360A amplifier Reviewed-by: Bard Liao Signed-off-by: Terry Cheong Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231019173411.166759-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 10626812b5987b3a05adf6b4f4417e7398b7047c Author: Charles Keepax Date: Thu Oct 19 12:34:05 2023 -0500 ASoC: intel: sof_sdw: Move the builtin microphones to dataport 1 cs42l43 supports 4 hardwired microphones, but only supports up to 2 microphone headsets. Only dataport 1 can support 4 channel capture, but that is currently used for the headset microphone. Switch things around such that DP1 is used for the builtin mics and DP2 is used for the headset microphones. Reviewed-by: Bard Liao Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231019173411.166759-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d74bad3b74524e4f34c97903ad170d9061bcfbd9 Author: Charles Keepax Date: Thu Oct 19 12:34:04 2023 -0500 ASoC: intel: sof_sdw_cs42l43: Create separate jacks for hp and mic It makes sense to report the microphone separately from the headphones, that way ALSA UCM can differentiate between switching the playback and the capture. For example, still using the built-in microphone path when a 3-pole headset is inserted. Reviewed-by: Bard Liao Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231019173411.166759-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a92ccd574390149d3d64488ec5fe1e9b80e5f74c Author: Charles Keepax Date: Thu Oct 19 12:34:03 2023 -0500 ASoC: intel: sof_sdw_cs42l43: Some trivial formatting clean ups No functional change, just some trivial whitespace fixups. Reviewed-by: Bard Liao Signed-off-by: Charles Keepax Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231019173411.166759-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 28809aaeabdf2c01ffe597553146527d1fba3589 Author: Charles Keepax Date: Thu Oct 19 12:34:02 2023 -0500 ASoC: intel: sof_sdw: Stop processing CODECs when enough are found When adding CODECs to a DAI link, the code should stop processing more CODECs when the expected number of CODECs are discovered. This fixes a small corner case issue introduced when support for different devices on the same SoundWire link was added. In the case of aggregated devices everything is fine, as all devices intended for the DAI link will be marked with the same group and any not intended for that DAI are skipped by the group check. However for non-aggregated devices the group check is bypassed and the current code does not stop after it has found the first device. Meaning if additional non-aggregated devices are present on the same SoundWire link they will be erroneously added into the DAI link. Fix this issue, and provide a small optimisation by ceasing to process devices once we have reached the required number of devices for the current DAI link. Fixes: 317dcdecaf7a ("ASoC: intel: sof_sdw: Allow different devices on the same link") Signed-off-by: Charles Keepax Reviewed-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231019173411.166759-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 2770d4722036d6bd24bcb78e9cd7f6e572077d03 Author: Maciej S. Szmigiero Date: Thu Oct 19 18:06:57 2023 +0200 KVM: x86: Ignore MSR_AMD64_TW_CFG access Hyper-V enabled Windows Server 2022 KVM VM cannot be started on Zen1 Ryzen since it crashes at boot with SYSTEM_THREAD_EXCEPTION_NOT_HANDLED + STATUS_PRIVILEGED_INSTRUCTION (in other words, because of an unexpected #GP in the guest kernel). This is because Windows tries to set bit 8 in MSR_AMD64_TW_CFG and can't handle receiving a #GP when doing so. Give this MSR the same treatment that commit 2e32b7190641 ("x86, kvm: Add MSR_AMD64_BU_CFG2 to the list of ignored MSRs") gave MSR_AMD64_BU_CFG2 under justification that this MSR is baremetal-relevant only. Although apparently it was then needed for Linux guests, not Windows as in this case. With this change, the aforementioned guest setup is able to finish booting successfully. This issue can be reproduced either on a Summit Ridge Ryzen (with just "-cpu host") or on a Naples EPYC (with "-cpu host,stepping=1" since EPYC is ordinarily stepping 2). Alternatively, userspace could solve the problem by using MSR filters, but forcing every userspace to define a filter isn't very friendly and doesn't add much, if any, value. The only potential hiccup is if one of these "baremetal-only" MSRs ever requires actual emulation and/or has F/M/S specific behavior. But if that happens, then KVM can still punt *that* handling to userspace since userspace MSR filters "win" over KVM's default handling. Signed-off-by: Maciej S. Szmigiero Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/1ce85d9c7c9e9632393816cf19c902e0a3f411f1.1697731406.git.maciej.szmigiero@oracle.com [sean: call out MSR filtering alternative] Signed-off-by: Sean Christopherson commit f2cab25b0eb7bd735459059e2eb8d21d2569c41d Author: Ivan Vecera Date: Wed Oct 18 14:35:55 2023 +0200 i40e: Align devlink info versions with ice driver and add docs Align devlink info versions with ice driver so change 'fw.mgmt' version to be 2-digit version [major.minor], add 'fw.mgmt.build' that reports mgmt firmware build number and use '"fw.psid.api' for NVM format version instead of incorrect '"fw.psid'. Additionally add missing i40e devlink documentation. Fixes: 5a423552e0d9 ("i40e: Add handler for devlink .info_get") Signed-off-by: Ivan Vecera Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231018123558.552453-1-ivecera@redhat.com Signed-off-by: Jakub Kicinski commit 4b316e0700b6fdf585cacef2d7cb9f7d2a5275a0 Merge: dcf02bac377e4 31f47f303c6b1 Author: Jakub Kicinski Date: Thu Oct 19 08:56:39 2023 -0700 Merge branch 'dt-bindings-net-child-node-schema-cleanups' Rob Herring says: ==================== dt-bindings: net: Child node schema cleanups This is a series of clean-ups related to ensuring that child node schemas are constrained to not allow undefined properties. Typically, that means just adding additionalProperties or unevaluatedProperties as appropriate. The DSA/switch schemas turned out to be a bit more involved, so there's some more fixes and a bit of restructuring in them. ==================== Link: https://lore.kernel.org/r/20231016-dt-net-cleanups-v1-0-a525a090b444@kernel.org Signed-off-by: Jakub Kicinski commit 31f47f303c6b15d1d6fde74e9ba108465ed58c51 Author: Rob Herring Date: Mon Oct 16 16:44:27 2023 -0500 dt-bindings: net: dsa: Drop 'ethernet-ports' node properties Constraints on 'ethernet-ports' node properties are already defined by the reference to ethernet-switch.yaml, so they can be dropped from the DSA schema. Signed-off-by: Rob Herring Acked-by: Arınç ÜNAL Reviewed-by: Vladimir Oltean Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20231016-dt-net-cleanups-v1-8-a525a090b444@kernel.org Signed-off-by: Jakub Kicinski commit 7c93392d754e53e73efffff34f119f7eaf0deb51 Author: Rob Herring Date: Mon Oct 16 16:44:26 2023 -0500 dt-bindings: net: mscc,vsc7514-switch: Simplify DSA and switch references The mscc,vsc7514-switch schema doesn't add any custom port properties, so it can just reference ethernet-switch.yaml#/$defs/base and dsa.yaml#/$defs/ethernet-ports instead of the base file and can skip defining port nodes. Signed-off-by: Rob Herring Acked-by: Arınç ÜNAL Reviewed-by: Vladimir Oltean Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20231016-dt-net-cleanups-v1-7-a525a090b444@kernel.org Signed-off-by: Jakub Kicinski commit 491ec40d67a534a374dbdb77cda294333b29c580 Author: Rob Herring Date: Mon Oct 16 16:44:25 2023 -0500 dt-bindings: net: mscc,vsc7514-switch: Clean-up example indentation The indentation for the example is completely messed up for 'ethernet-ports'. Fix it. Signed-off-by: Rob Herring Acked-by: Arınç ÜNAL Reviewed-by: Vladimir Oltean Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20231016-dt-net-cleanups-v1-6-a525a090b444@kernel.org Signed-off-by: Jakub Kicinski commit b9823df7bbad42bffa1d13e65c11c1e3ae09069c Author: Rob Herring Date: Mon Oct 16 16:44:24 2023 -0500 dt-bindings: net: ethernet-switch: Rename $defs "base" to 'ethernet-ports' The name "base" is misleading as the definition is for a complete schema definition without additional properties allowed, not a "base class". Align the same to be the same as dsa.yaml. This schema file without any json pointer path is the base schema which can be extended. There are not yet any references to $defs/base to update. Signed-off-by: Rob Herring Acked-by: Arınç ÜNAL Reviewed-by: Vladimir Oltean Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20231016-dt-net-cleanups-v1-5-a525a090b444@kernel.org Signed-off-by: Jakub Kicinski commit f0fdec925fe7adf725de238b9eea59702d0d58e0 Author: Rob Herring Date: Mon Oct 16 16:44:23 2023 -0500 dt-bindings: net: ethernet-switch: Add missing 'ethernet-ports' level The '$defs/ethernet-ports' schema is referenced by schemas defining a child node 'ethernet-ports', but this schema misses the 'ethernet-ports' node. It would work if referring schemas made a reference like this: properties: ethernet-ports: $ref: ethernet-switch.yaml#/$defs/ethernet-ports However, that would be different from how dsa.yaml works. For consistency, align the schema definition with dsa.yaml and add the missing level. Signed-off-by: Rob Herring Acked-by: Arınç ÜNAL Reviewed-by: Vladimir Oltean Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20231016-dt-net-cleanups-v1-4-a525a090b444@kernel.org Signed-off-by: Jakub Kicinski commit 51ff5150258a5af8f45c06518bfd4bba2edeceed Author: Rob Herring Date: Mon Oct 16 16:44:22 2023 -0500 dt-bindings: net: dsa/switch: Make 'ethernet-port' node addresses hex 'ethernet-port' node unit-addresses should be in hexadecimal. Some instances have it correct, but fix the ones that don't. Signed-off-by: Rob Herring Acked-by: Arınç ÜNAL Reviewed-by: Vladimir Oltean Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20231016-dt-net-cleanups-v1-3-a525a090b444@kernel.org Signed-off-by: Jakub Kicinski commit ac8fe40c3628e12123ef32098216476dccea7b6a Author: Rob Herring Date: Mon Oct 16 16:44:21 2023 -0500 dt-bindings: net: renesas: Drop ethernet-phy node schema What's connected on the MDIO bus is outside the scope of the binding for ethernet controller's MDIO bus unless it's a fixed internal device, so drop the node name and reference to ethernet-phy.yaml. Signed-off-by: Rob Herring Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20231016-dt-net-cleanups-v1-2-a525a090b444@kernel.org Signed-off-by: Jakub Kicinski commit 659fd097b0988b18323729272ce71ae625e014ba Author: Rob Herring Date: Mon Oct 16 16:44:20 2023 -0500 dt-bindings: net: Add missing (unevaluated|additional)Properties on child node schemas Just as unevaluatedProperties or additionalProperties are required at the top level of schemas, they should (and will) also be required for child node schemas. That ensures only documented properties are present for any node. Add unevaluatedProperties or additionalProperties as appropriate. Signed-off-by: Rob Herring Acked-by: Arınç ÜNAL Acked-by: Jernej Skrabec Reviewed-by: Gerhard Engleder Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20231016-dt-net-cleanups-v1-1-a525a090b444@kernel.org Signed-off-by: Jakub Kicinski commit 122ae01c5159eb1584e07907aec89e2470622baa Author: Liang Chen Date: Thu Oct 19 12:33:36 2023 +0800 KVM: x86: remove the unused assigned_dev_head from kvm_arch Legacy device assignment was dropped years ago. This field is not used anymore. Signed-off-by: Liang Chen Link: https://lore.kernel.org/r/20231019043336.8998-1-liangchen.linux@gmail.com Signed-off-by: Sean Christopherson commit 3b9a22d345ff89232227b2449a311bf3f910f5f2 Author: Anshuman Khandual Date: Mon Oct 16 08:24:36 2023 +0530 drivers: perf: arm_pmuv3: Drop some unused arguments from armv8_pmu_init() All the PMU init functions want the default sysfs attribute groups, and so these all call armv8_pmu_init_nogroups() helper, with none of them calling armv8_pmu_init() directly. When we introduced armv8_pmu_init_nogroups() in the commit e424b1798526 ("arm64: perf: Refactor PMU init callbacks") ... we thought that we might need custom attribute groups in future, but as we evidently haven't, we can remove the option. This patch folds armv8_pmu_init_nogroups() into armv8_pmu_init(), removing the ability to use custom attribute groups and simplifying the code. CC: James Clark Cc: Robin Murphy Cc: Will Deacon Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Acked-by: Mark Rutland Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/20231016025436.1368945-1-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit 58f8fc57b1d314b5402c374a8c454ac7c870574c Author: Anshuman Khandual Date: Fri Oct 13 08:13:54 2023 +0530 drivers: perf: arm_pmuv3: Read PMMIR_EL1 unconditionally Currently the PMUv3 driver only reads PMMIR_EL1 if the PMU implements FEAT_PMUv3p4 and the STALL_SLOT event, but the check for STALL_SLOT event isn't necessary and can be removed. The check for STALL_SLOT event was introduced with the read of PMMIR_EL1 in commit f5be3a61fdb5dd11 ("arm64: perf: Add support caps under sysfs") When this logic was written, the ARM ARM said: | If STALL_SLOT is not implemented, it is IMPLEMENTATION DEFINED whether | the PMMIR System registers are implemented. ... and thus the driver had to check for STALL_SLOT event to verify that PMMIR_EL1 was implemented and accesses to PMMIR_EL1 would not be UNDEFINED. Subsequently, the architecture was retrospectively tightened to require that any FEAT_PMUv3p4 implementation implements PMMIR_EL1. Since the G.b release of the ARM ARM, the wording regarding STALL_SLOT event has been removed, and the description of PMMIR_EL1 says: | This register is present only when FEAT_PMUv3p4 is implemented. Drop the unnecessary check for STALL_SLOT event when reading PMMIR_EL1. Cc: Will Deacon Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: James Clark Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/20231013024354.1289070-1-anshuman.khandual@arm.com Signed-off-by: Will Deacon commit e0f7422f54b092df7996f21da69824aea496490a Author: Omar Sandoval Date: Mon Oct 16 10:48:50 2023 -0700 xfs: don't look for end of extent further than necessary in xfs_rtallocate_extent_near() As explained in the previous commit, xfs_rtallocate_extent_near() looks for the end of a free extent when searching backwards from the target bitmap block. Since the previous commit, it searches from the last bitmap block it checked to the bitmap block containing the start of the extent. This may still be more than necessary, since the free extent may not be that long. We know the maximum size of the free extent from the realtime summary. Use that to compute how many bitmap blocks we actually need to check. Reviewed-by: Darrick J. Wong Signed-off-by: Omar Sandoval Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 85fa2c774397b98f5dc65a4ed6ab17c1a15db158 Author: Omar Sandoval Date: Mon Oct 16 10:47:04 2023 -0700 xfs: don't try redundant allocations in xfs_rtallocate_extent_near() xfs_rtallocate_extent_near() tries to find a free extent as close to a target bitmap block given by bbno as possible, which may be before or after bbno. Searching backwards has a complication: the realtime summary accounts for free space _starting_ in a bitmap block, but not straddling or ending in a bitmap block. So, when the negative search finds a free extent in the realtime summary, in order to end up closer to the target, it looks for the end of the free extent. For example, if bbno - 2 has a free extent, then it will check bbno - 1, then bbno - 2. But then if bbno - 3 has a free extent, it will check bbno - 1 again, then bbno - 2 again, and then bbno - 3. This results in a quadratic loop, which is completely pointless since the repeated checks won't find anything new. Fix it by remembering where we last checked up to and continue from there. This also obviates the need for a check of the realtime summary. Signed-off-by: Omar Sandoval Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit ec5857bf07639a03d32b8ecb346df634925f8bc2 Author: Omar Sandoval Date: Mon Oct 16 10:45:46 2023 -0700 xfs: limit maxlen based on available space in xfs_rtallocate_extent_near() xfs_rtallocate_extent_near() calls xfs_rtallocate_extent_block() with the minlen and maxlen that were passed to it. xfs_rtallocate_extent_block() then scans the bitmap block looking for a free range of size maxlen. If there is none, it has to scan the whole bitmap block before returning the largest range of at least size minlen. For a fragmented realtime device and a large allocation request, it's almost certain that this will have to search the whole bitmap block, leading to high CPU usage. However, the realtime summary tells us the maximum size available in the bitmap block. We can limit the search in xfs_rtallocate_extent_block() to that size and often stop before scanning the whole bitmap block. Signed-off-by: Omar Sandoval Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 1b5d63963f9820b1c14883ee56b387586ff72aa0 Author: Omar Sandoval Date: Mon Oct 16 10:43:42 2023 -0700 xfs: return maximum free size from xfs_rtany_summary() Instead of only returning whether there is any free space, return the maximum size, which is fast thanks to the previous commit. This will be used by two upcoming optimizations. Reviewed-by: Darrick J. Wong Signed-off-by: Omar Sandoval Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit e23aaf450de733044a74bc95528f728478b61c2a Author: Omar Sandoval Date: Mon Oct 16 10:41:55 2023 -0700 xfs: invert the realtime summary cache In commit 355e3532132b ("xfs: cache minimum realtime summary level"), I added a cache of the minimum level of the realtime summary that has any free extents. However, it turns out that the _maximum_ level is more useful for upcoming optimizations, and basically equivalent for the existing usage. So, let's change the meaning of the cache to be the maximum level + 1, or 0 if there are no free extents. For example, if the cache contains: {0, 4} then there are no free extents starting in realtime bitmap block 0, and there are no free extents larger than or equal to 2^4 blocks starting in realtime bitmap block 1. The cache is a loose upper bound, so there may or may not be free extents smaller than 2^4 blocks in realtime bitmap block 1. Signed-off-by: Omar Sandoval Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit e2cf427c91494ea0d1173a911090c39665c5fdef Author: Darrick J. Wong Date: Wed Oct 18 10:28:10 2023 -0700 xfs: simplify rt bitmap/summary block accessor functions Simplify the calling convention of these functions since the xfs_rtalloc_args structure contains the parameters we need. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 5b1d0ae9753f0654ab56c1e06155b3abf2919d71 Author: Darrick J. Wong Date: Wed Oct 18 10:19:41 2023 -0700 xfs: simplify xfs_rtbuf_get calling conventions Now that xfs_rtalloc_args holds references to the last-read bitmap and summary blocks, we don't need to pass the buffer pointer out of xfs_rtbuf_get. Callers no longer have to xfs_trans_brelse on their own, though they are required to call xfs_rtbuf_cache_relse before the xfs_rtalloc_args goes out of scope. While we're at it, create some trivial helpers so that we don't have to remember if "0" means "bitmap" and "1" means "summary". Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit e94b53ff699c2674a9ec083342a5254866210ade Author: Omar Sandoval Date: Mon Oct 16 10:13:22 2023 -0700 xfs: cache last bitmap block in realtime allocator Profiling a workload on a highly fragmented realtime device showed a ton of CPU cycles being spent in xfs_trans_read_buf() called by xfs_rtbuf_get(). Further tracing showed that much of that was repeated calls to xfs_rtbuf_get() for the same block of the realtime bitmap. These come from xfs_rtallocate_extent_block(): as it walks through ranges of free bits in the bitmap, each call to xfs_rtcheck_range() and xfs_rtfind_{forw,back}() gets the same bitmap block. If the bitmap block is very fragmented, then this is _a lot_ of buffer lookups. The realtime allocator already passes around a cache of the last used realtime summary block to avoid repeated reads (the parameters rbpp and rsb). We can do the same for the realtime bitmap. This replaces rbpp and rsb with a struct xfs_rtbuf_cache, which caches the most recently used block for both the realtime bitmap and summary. xfs_rtbuf_get() now handles the caching instead of the callers, which requires plumbing xfs_rtbuf_cache to more functions but also makes sure we don't miss anything. Signed-off-by: Omar Sandoval Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 9618efe343ead954ca5c23856ae23d0a29e7d4b9 Author: Dmitry Baryshkov Date: Thu Oct 19 17:43:11 2023 +0300 thermal/qcom/tsens: Drop ops_v0_1 Since the commit 6812d1dfbca9 ("thermal/drivers/qcom/tsens-v0_1: Fix mdm9607 slope values") the default v0.1 implementation of tsens options is unused by the driver. Drop it now to stop compiler complaining about the unused static const. If it appears there is the need for the default v0.1 ops struct, this commit can be easily reverted without further considerations. Fixes: 6812d1dfbca9 ("thermal/drivers/qcom/tsens-v0_1: Fix mdm9607 slope values") Signed-off-by: Dmitry Baryshkov Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20231019144311.1035181-1-dmitry.baryshkov@linaro.org commit 60f8f641f3db85edf20f9612f4801563119d7fd6 Author: Thomas Richter Date: Mon Aug 21 16:49:05 2023 +0200 s390/pai_crypto: dynamically allocate percpu pai crypto map data structure Struct paicrypt_map is a data structure and is statically defined for each possible CPU. Rework this and replace it by dynamically allocated data structures created when a perf_event_open() system call is invoked. It is replaced by an array of pointers to all possible CPUs and reference counting. The array of pointers is allocated when the first event is created. For each online CPU an event is installed on, a struct paicrypt_map is allocated and a pointer to struct cpu_cf_events is stored in the array: CPU 0 1 2 3 ... N +---+---+---+---+---+---+ paicrypt_root::mapptr--> | * | | | |...| | +-|-+---+---+---+---+---+ | | \|/ +--------------+ | paicrypt_map | +--------------+ With this approach the large data structure is only allocated when an event is actually installed and used. Also implement proper reference counting for allocation and removal. PAI crypto counter events can not be created when a CPU hot plug add is processed. This means a CPU hot plug add does not get the necessary PAI event to record PAI cryptography counter increments on the newly added CPU. There is no possibility to notify user space of a new CPU and the necessary event infrastructure assoiciated with the file descriptor returned by perf_event_open() system call. However system call perf_event_open() can use the newly added CPU when issued after the CPU hot plug add. Kernel CPU hot plug remove deletes the CPU and stops the PAI counters on that CPU. When the process closes the file descriptor associated with that event, the event's destroy() function removes any allocated data structures and adjusts the reference counts. Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Acked-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 4f62c6e30155c7a85ed74e52bb8c71e7b0879cb3 Author: Heiko Carstens Date: Mon Oct 16 12:17:59 2023 +0200 s390/mm: make vmemmap_free() only for CONFIG_MEMORY_HOTPLUG available Get rid of this W=1 compile warning: arch/s390/mm/vmem.c:502:6: warning: no previous prototype for ‘vmemmap_free’ [-Wmissing-prototypes] 502 | void vmemmap_free(unsigned long start, unsigned long end, | ^~~~~~~~~~~~ Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 7bc8b8eb2b1e7b06d14bacf964fa25f74a2b87e5 Author: Heiko Carstens Date: Mon Oct 16 12:10:04 2023 +0200 s390/mm: remove __GFP_HIGHMEM masking Remove unnecessary __GFP_HIGHMEM masking, which was introduced with commit 6326c26c1514 ("s390: convert various pgalloc functions to use ptdescs"). Also remove a whitespace change which was introduced with the same commit. Link: https://lore.kernel.org/all/CAOzc2px-SFSnmjcPriiB3cm1fNj3+YC8S0VSp4t1QvDR0f4E2A@mail.gmail.com Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 50b560783f7f71790bcf70e9e9855155fb0af8c1 Author: Hao Chen Date: Thu Oct 19 17:13:52 2023 +0800 drivers/perf: hisi: use cpuhp_state_remove_instance_nocalls() for hisi_hns3_pmu uninit process When tearing down a 'hisi_hns3' PMU, we mistakenly run the CPU hotplug callbacks after the device has been unregistered, leading to fireworks when we try to execute empty function callbacks within the driver: | Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 | CPU: 0 PID: 15 Comm: cpuhp/0 Tainted: G W O 5.12.0-rc4+ #1 | Hardware name: , BIOS KpxxxFPGA 1P B600 V143 04/22/2021 | pstate: 80400009 (Nzcv daif +PAN -UAO -TCO BTYPE=--) | pc : perf_pmu_migrate_context+0x98/0x38c | lr : perf_pmu_migrate_context+0x94/0x38c | | Call trace: | perf_pmu_migrate_context+0x98/0x38c | hisi_hns3_pmu_offline_cpu+0x104/0x12c [hisi_hns3_pmu] Use cpuhp_state_remove_instance_nocalls() instead of cpuhp_state_remove_instance() so that the notifiers don't execute after the PMU device has been unregistered. Fixes: 66637ab137b4 ("drivers/perf: hisi: add driver for HNS3 PMU") Signed-off-by: Hao Chen Signed-off-by: Jijie Shao Reviewed-by: Yicong Yang Link: https://lore.kernel.org/r/20231019091352.998964-1-shaojijie@huawei.com [will: Rewrote commit message] Signed-off-by: Will Deacon commit 6bd5e167af2e9d1aa79e4a1a2598abcdc8fafd59 Author: Manu Bretelle Date: Wed Oct 18 16:01:33 2023 -0700 bpftool: Wrap struct_ops dump in an array When dumping a struct_ops, 2 dictionaries are emitted. When using `name`, they were already wrapped in an array, but not when using `id`. Causing `jq` to fail at parsing the payload as it reached the comma following the first dict. This change wraps those dictionaries in an array so valid json is emitted. Before, jq fails to parse the output: ``` $ sudo bpftool struct_ops dump id 1523612 | jq . > /dev/null parse error: Expected value before ',' at line 19, column 2 ``` After, no error parsing the output: ``` sudo ./bpftool struct_ops dump id 1523612 | jq . > /dev/null ``` Signed-off-by: Manu Bretelle Signed-off-by: Daniel Borkmann Tested-by: Eduard Zingerman Acked-by: Eduard Zingerman Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20231018230133.1593152-3-chantr4@gmail.com commit 90704b4be0b0d6d0a7a9369d4b9aae6a579602c7 Author: Manu Bretelle Date: Wed Oct 18 16:01:32 2023 -0700 bpftool: Fix printing of pointer value When printing a pointer value, "%p" will either print the hexadecimal value of the pointer (e.g `0x1234`), or `(nil)` when NULL. Both of those are invalid json "integer" values and need to be wrapped in quotes. Before: ``` $ sudo bpftool struct_ops dump name ned_dummy_cca | grep next "next": (nil), $ sudo bpftool struct_ops dump name ned_dummy_cca | \ jq '.[1].bpf_struct_ops_tcp_congestion_ops.data.list.next' parse error: Invalid numeric literal at line 29, column 34 ``` After: ``` $ sudo ./bpftool struct_ops dump name ned_dummy_cca | grep next "next": "(nil)", $ sudo ./bpftool struct_ops dump name ned_dummy_cca | \ jq '.[1].bpf_struct_ops_tcp_congestion_ops.data.list.next' "(nil)" ``` Signed-off-by: Manu Bretelle Signed-off-by: Daniel Borkmann Tested-by: Eduard Zingerman Acked-by: Eduard Zingerman Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20231018230133.1593152-2-chantr4@gmail.com commit 2707977650633176e87c3709d62790263d8a6388 Merge: 79d01625c3c77 56bc311585206 Author: Arnd Bergmann Date: Thu Oct 19 16:25:09 2023 +0200 Merge tag 'ti-k3-dt-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into soc/dt TI K3 device tree updates for v6.7 New features across K3 SoCs: - Watchdog and ESM nodes for J7xx - DMA node for Camera interface (CSI) for J7xx - C7x DSP and R5F rproc support for J7xx/AM68/AM69 AM68: - USB and PCIe support AM64: - IO expander support - GPIO LED, I2C device supplies for am64-tqma64xxl-mbax4xxl - RTC IRQ pin update for am64 phycore AM62A: - TPS6593 PMIC and mcasp audio support Misc: - bootph-* tag addition for AM64 and AM62 - iw416 based bluetooth support on verdin-am62 - IO Expander addition for AM64 and AM65 boards Fixes: - Convert DMSS/NAVSS to simple-bus compatible to squelch dtbs_check warnings - Minor indentation fixes - Specify base dtb for k3-j721s2-evm-gesi.dtbo and k3-am62x-sk-hdmi-audio.dtbo - Misc fixups for AM62 Beagleplay, verdin-am62 boards * tag 'ti-k3-dt-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: (48 commits) arm64: dts: ti: k3-j712s2-mcu: Add the mcu domain watchdog instances arm64: dts: ti: k3-j721s2-main: Add the main domain watchdog instances arm64: dts: ti: k3-j784s4-mcu: Add the mcu domain watchdog instances arm64: dts: ti: k3-j784s4-main: Add the main domain watchdog instances arm64: dts: ti: k3-j7200: Add MCU domain ESM instance arm64: dts: ti: k3-j784s4: Add ESM instances arm64: dts: ti: k3-j721s2: Add ESM instances arm64: dts: ti: k3-j784s4-main: Add BCDMA instance for CSI2RX arm64: dts: ti: k3-j721s2-main: Add BCDMA instance for CSI2RX arm64: dts: ti: k3-*: Convert NAVSS to simple-bus arm64: dts: ti: k3-*: Convert DMSS to simple-bus arm64: dts: ti: Fix HDMI Audio overlay in Makefile arm64: dts: ti: k3-am62a7-sk: Enable audio on AM62A arm64: dts: ti: k3-am62a7-sk: Add support for TPS6593 PMIC arm64: dts: ti: k3-am62a7-sk: Drop i2c-1 to 100Khz arm64: dts: ti: k3-am62a7-sk: Split vcc_3v3 regulators arm64: dts: ti: k3-am62a-main: Add nodes for McASP arm64: dts: ti: k3-am64-tqma64xxl-mbax4xxl: update gpio-led configuration arm64: dts: ti: k3-am64-tqma64xxl-mbax4xxl: add chassis-type arm64: dts: ti: k3-am64-tqma64xxl-mbax4xxl: add muxing for GPIOs on pin headers ... Link: https://lore.kernel.org/r/f05c98b6-6274-4544-8fcd-0332c39244c9@ti.com Signed-off-by: Arnd Bergmann commit 5a6976b1040a2f99ab84eddbfa7cd072ac5d10fc Author: Sascha Hauer Date: Wed Oct 18 08:17:14 2023 +0200 arm64: dts: rockchip: Add DFI to rk3588s The DFI unit can be used to measure DRAM utilization using perf. Add the node to the device tree. The DFI needs a rockchip,pmu phandle to the pmu containing registers for SDRAM configuration details. This is added in this patch as well. Reviewed-by: Sebastian Reichel Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20231018061714.3553817-27-s.hauer@pengutronix.de Signed-off-by: Heiko Stuebner commit 085be8875ca8a087e3cc102893f384894962c87e Author: Sascha Hauer Date: Wed Oct 18 08:17:13 2023 +0200 arm64: dts: rockchip: Add DFI to rk356x The DFI unit can be used to measure DRAM utilization using perf. Add the node to the device tree. Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20231018061714.3553817-26-s.hauer@pengutronix.de Signed-off-by: Heiko Stuebner commit f57ef11ec63c17201b27569fbfb58801c227137d Author: Sascha Hauer Date: Wed Oct 18 08:17:12 2023 +0200 arm64: dts: rockchip: Always enable DFI on rk3399 the DFI unit can provide useful data for measuring DDR utilization and works without any configuration from the board, so enable it in the dtsi file directly. Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20231018061714.3553817-25-s.hauer@pengutronix.de Signed-off-by: Heiko Stuebner commit 897d8e86bac76d26dcd08fbd0917d9bdb280a66f Author: Marco Felsch Date: Thu Oct 19 15:18:06 2023 +0200 ASoC: tlv320aic31xx: switch to gpiod_set_value_cansleep Switch to gpiod_set_value_cansleep() to support gpiochips which can sleep like i2c gpio expanders. Signed-off-by: Marco Felsch Link: https://lore.kernel.org/r/20231019131806.381280-1-m.felsch@pengutronix.de Signed-off-by: Mark Brown commit 79a2ab154cd2c68bbcdd15b9d450275ec8534883 Merge: 64c3259b5f869 d88c433831015 Author: Mark Brown Date: Thu Oct 19 14:46:48 2023 +0100 ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: add Merge series from xiazhengqiao : To use RT5650 as the codec and the amp, add a new sound card named mt8186_rt5650. commit dcf02bac377e48a4864ed2b4e1ffef84fcb8284f Merge: a0e6323dbae6e 039550960a223 Author: Paolo Abeni Date: Thu Oct 19 15:41:38 2023 +0200 Merge branch 'net-stmmac-improve-tx-timer-logic' Christian Marangi says: ==================== net: stmmac: improve tx timer logic This series comes with the intention of restoring original performance of stmmac on some router/device that used the stmmac driver to handle gigabit traffic. More info are present in patch 3. This cover letter is to show results and improvements of the following change. The move to hr_timer for tx timer and commit 8fce33317023 ("net: stmmac: Rework coalesce timer and fix multi-queue races") caused big performance regression on these kind of device. This was observed on ipq806x that after kernel 4.19 couldn't handle gigabit speed anymore. The following series is currently applied and tested in OpenWrt SNAPSHOT and have great performance increase. (the scenario is qca8k switch + stmmac dwmac1000) Some good comparison can be found here [1]. The difference is from a swconfig scenario (where dsa tagging is not used so very low CPU impact in handling traffic) and DSA scenario where tagging is used and there is a minimal impact in the CPU. As can be notice even with DSA in place we have better perf. It was observed by other user that also SQM scenario with cake scheduler were improved in the order of 100mbps (this scenario is CPU limited and any increase of perf is caused by removing load on the CPU) Been at least 15 days that this is in use without any complain or bug reported about queue timeout. (was the case with v1 before the additional patch was added, only appear on real world tests and not on iperf tests) [1] https://forum.openwrt.org/t/netgear-r7800-exploration-ipq8065-qca9984/285/3427?u=ansuel ==================== Link: https://lore.kernel.org/r/20231018123550.27110-1-ansuelsmth@gmail.com Signed-off-by: Paolo Abeni commit 039550960a2235cfe2dfaa773df9f98f8da31a0c Author: Christian Marangi Date: Wed Oct 18 14:35:50 2023 +0200 net: stmmac: increase TX coalesce timer to 5ms Commit 8fce33317023 ("net: stmmac: Rework coalesce timer and fix multi-queue races") decreased the TX coalesce timer from 40ms to 1ms. This caused some performance regression on some target (regression was reported at least on ipq806x) in the order of 600mbps dropping from gigabit handling to only 200mbps. The problem was identified in the TX timer getting armed too much time. While this was fixed and improved in another commit, performance can be improved even further by increasing the timer delay a bit moving from 1ms to 5ms. The value is a good balance between battery saving by prevending too much interrupt to be generated and permitting good performance for internet oriented devices. Signed-off-by: Christian Marangi Signed-off-by: Paolo Abeni commit a594166387fe08e6f5a32130c400249a35b298f9 Author: Christian Marangi Date: Wed Oct 18 14:35:49 2023 +0200 net: stmmac: move TX timer arm after DMA enable Move TX timer arm call after DMA interrupt is enabled again. The TX timer arm function changed logic and now is skipped if a napi is already scheduled. By moving the TX timer arm call after DMA is enabled, we permit to correctly skip if a DMA interrupt has been fired and a napi has been scheduled again. Signed-off-by: Christian Marangi Signed-off-by: Paolo Abeni commit 2d1a42cf7f77cda54dbbee18d00b1200e7bc22aa Author: Christian Marangi Date: Wed Oct 18 14:35:48 2023 +0200 net: stmmac: improve TX timer arm logic There is currently a problem with the TX timer getting armed multiple unnecessary times causing big performance regression on some device that suffer from heavy handling of hrtimer rearm. The use of the TX timer is an old implementation that predates the napi implementation and the interrupt enable/disable handling. Due to stmmac being a very old code, the TX timer was never evaluated again with this new implementation and was kept there causing performance regression. The performance regression started to appear with kernel version 4.19 with 8fce33317023 ("net: stmmac: Rework coalesce timer and fix multi-queue races") where the timer was reduced to 1ms causing it to be armed 40 times more than before. Decreasing the timer made the problem more present and caused the regression in the other of 600-700mbps on some device (regression where this was notice is ipq806x). The problem is in the fact that handling the hrtimer on some target is expensive and recent kernel made the timer armed much more times. A solution that was proposed was reverting the hrtimer change and use mod_timer but such solution would still hide the real problem in the current implementation. To fix the regression, apply some additional logic and skip arming the timer when not needed. Arm the timer ONLY if a napi is not already scheduled. Running the timer is redundant since the same function (stmmac_tx_clean) will run in the napi TX poll. Also try to cancel any timer if a napi is scheduled to prevent redundant run of TX call. With the following new logic the original performance are restored while keeping using the hrtimer. Signed-off-by: Christian Marangi Signed-off-by: Paolo Abeni commit 7f3eb2174512fe6c9c0f062e96eccb0d3cc6d5cd Author: Christian Marangi Date: Wed Oct 18 14:35:47 2023 +0200 net: introduce napi_is_scheduled helper We currently have napi_if_scheduled_mark_missed that can be used to check if napi is scheduled but that does more thing than simply checking it and return a bool. Some driver already implement custom function to check if napi is scheduled. Drop these custom function and introduce napi_is_scheduled that simply check if napi is scheduled atomically. Update any driver and code that implement a similar check and instead use this new helper. Signed-off-by: Christian Marangi Signed-off-by: Paolo Abeni commit e6d0c13e9f46f9cf83f2f4946b0a2954599552a7 Author: Maarten Lankhorst Date: Mon Oct 9 13:54:37 2023 +0200 ALSA: hda: i915: Remove extra argument from snd_hdac_i915_init Now that all drivers have moved from modprobe loading to handling -EPROBE_DEFER, we can remove the argument again. Signed-off-by: Maarten Lankhorst Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20231009115437.99976-14-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit 3d1a0558136150448c91f9dd915dec843de8eacf Author: Maarten Lankhorst Date: Mon Oct 9 13:54:36 2023 +0200 ASoC: SOF: Intel: Move binding to display driver outside of deferred probe Now that we can use -EPROBE_DEFER, it's no longer required to spin off the snd_hdac_i915_init into a workqueue. Use the -EPROBE_DEFER mechanism instead, which must be returned in the probe function. The previously added probe_early can be used for this, and we also use the newly added remove_late for unbinding afterwards. Signed-off-by: Maarten Lankhorst Cc: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231009115437.99976-13-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit e46f13776fcadc08916e1bb494d673adaf390464 Author: Maarten Lankhorst Date: Mon Oct 9 13:54:35 2023 +0200 ASoC: Intel: Skylake: Move snd_hdac_i915_init to before probe_work. Now that we can use -EPROBE_DEFER, it's no longer required to spin off the snd_hdac_i915_init into a workqueue. It's likely the whole workqueue can be destroyed, but I don't have the means to test this. Removing the workqueue would simplify init even further, but is left as exercise for the reviewer. Signed-off-by: Maarten Lankhorst Acked-by: Mark Brown Reviewed-by: Kai Vehmanen Reviewed-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231009115437.99976-12-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit 65cbbfa4e2ca81a1888e3ee82c9b5ae01356e11d Author: Maarten Lankhorst Date: Mon Oct 9 13:54:34 2023 +0200 ALSA: hda: Intel: Move snd_hdac_i915_init to before probe_work. Now that we can use -EPROBE_DEFER, it's no longer required to spin off the snd_hdac_i915_init into a workqueue. Use the -EPROBE_DEFER mechanism instead, which must be returned in the probe function. Signed-off-by: Maarten Lankhorst Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231009115437.99976-11-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit 2dddc514b6e43245695901a4e9855e3de0902d15 Author: Maarten Lankhorst Date: Mon Oct 9 13:54:33 2023 +0200 ASoC: Intel: avs: Move snd_hdac_i915_init to before probe_work. Now that we can use -EPROBE_DEFER, it's no longer required to spin off the snd_hdac_i915_init into a workqueue. It's likely the whole workqueue can be destroyed, but I don't have the means to test this. Removing the workqueue would simplify init even further, but is left as exercise for the reviewer. Signed-off-by: Maarten Lankhorst Acked-by: Mark Brown Reviewed-by: Kai Vehmanen Reviewed-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231009115437.99976-10-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit e8e3f8694ef521cbda0d5304d86da4cc3fec13ca Author: Maarten Lankhorst Date: Mon Oct 9 13:54:32 2023 +0200 ALSA: hda: i915: Allow xe as match for i915_component_master_match Xe is a new driver for intel GPU's that shares the sound related code with i915. The modprobe mechanism is being replaced by the -EPROBE_DEFER mechanism, so we don't need to add a modprobe xe call. Adding this would have required a telepathy module to correctly guess whether to load i915 or xe. Signed-off-by: Maarten Lankhorst Reviewed-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231009115437.99976-9-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit 32f4e921fe8e39969f532abfb388cc31d18a88c5 Author: Maarten Lankhorst Date: Mon Oct 9 13:54:31 2023 +0200 ALSA: hda: i915: Add an allow_modprobe argument to snd_hdac_i915_init Xe is a new GPU driver that re-uses the display (and sound) code from i915. It's no longer possible to load i915, as the GPU can be driven by the xe driver instead. The new behavior will return -EPROBE_DEFER, and wait for a compatible driver to be loaded instead of modprobing i915. Converting all drivers at the same time is a lot of work, instead we will convert each user one by one. Signed-off-by: Maarten Lankhorst Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231009115437.99976-8-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit 2e8c90386db48e425997ca644fa40876b2058b30 Author: Maarten Lankhorst Date: Mon Oct 9 13:54:30 2023 +0200 ALSA: hda: i915: Allow override of gpu binding. Selecting CONFIG_DRM selects CONFIG_VIDEO_NOMODESET, which exports video_firmware_drivers_only(). This can be used as a first approximation on whether i915 will be available. It's safe to use as this is only built when CONFIG_SND_HDA_I915 is selected by CONFIG_I915. It's not completely fool proof, as you can boot with "nomodeset i915.modeset=1" to make i915 load regardless, or use "i915.force_probe=!*" to never load i915, but the common case of booting with nomodeset to disable all GPU drivers this will work as intended. Because of this, we add an extra module parameter, snd_hda_core.gpu_bind that can be used to signal users intent. -1 follows nomodeset, 0 disables binding, 1 forces wait/-EPROBE_DEFER on binding. Signed-off-by: Maarten Lankhorst Reviewed-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231009115437.99976-7-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit ad6413bc48f2a86847614b48a7a575f75d2521a5 Author: Maarten Lankhorst Date: Mon Oct 9 13:54:29 2023 +0200 ALSA: hda: Intel: Fix error handling in azx_probe() Add missing pci_set_drv to NULL call on error. Signed-off-by: Maarten Lankhorst Reviewed-by: Pierre-Louis Bossart Reviewed-by: Peter Ujfalusi Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20231009115437.99976-6-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit 03448e5df586c79f9c88d8cbe29014820cc2904f Author: Maarten Lankhorst Date: Mon Oct 9 13:54:28 2023 +0200 ASoC: SOF: Intel: Fix error handling in hda_init() The hda_codec_i915_init() errors are ignored in hda_init() so it can never return -EPROBE_DEFER. Fix this before we move the call to hda_init() from the deferred probe to early probe. While at it, also fix error handling when hda_dsp_ctrl_get_caps fails. Suggested-by: Kai Vehmanen Signed-off-by: Maarten Lankhorst Reviewed-by: Kai Vehmanen Reviewed-by: Peter Ujfalusi Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20231009115437.99976-5-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit f1977d5ba07178b17320e4d694e9cc1d81da9308 Author: Pierre-Louis Bossart Date: Mon Oct 9 13:54:27 2023 +0200 ASoC: SOF: Intel: hda: start splitting the probe This patch moves the initial parts of the probe to the probe_early() callback, which provides a much faster decision on whether the SOF driver shall deal with a specific platform or yield to other Intel drivers. This is a limited functionality change, the bigger change is to move the i915/Xe initialization to the probe_early(). Signed-off-by: Pierre-Louis Bossart Signed-off-by: Maarten Lankhorst Acked-by: Mark Brown Reviewed-by: Peter Ujfalusi Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20231009115437.99976-4-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit 17baaa1f950b19456618b792dbb5b3fbb12884a8 Author: Pierre-Louis Bossart Date: Mon Oct 9 13:54:26 2023 +0200 ASoC: SOF: core: Add probe_early and remove_late callbacks The existing DSP probe may be handled in a workqueue to allow for extra time, typically for the i915 request_module and HDAudio codec handling. With the upcoming changes for i915/Xe driver relying on the -EPROBE_DEFER mechanism, we need to have a first pass of the probe which cannot be pushed to a workqueue. Introduce 2 new optional callbacks. probe_early is called before the workqueue runs. remove_late may be called from the workqueue if load is unsuccesful, but will otherwise be called on module unload. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Maarten Lankhorst Acked-by: Mark Brown Reviewed-by: Peter Ujfalusi Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20231009115437.99976-3-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit f549a82aff57865c47b5abd17336b23cd9bb2d2c Author: Maarten Lankhorst Date: Mon Oct 9 13:54:25 2023 +0200 ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran. In an effort to not call sof_ops_free twice, we stopped running it when probe was aborted. Check the result of cancel_work_sync to see if this was the case. Fixes: 31bb7bd9ffee ("ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was successful") Cc: Peter Ujfalusi Acked-by: Mark Brown Reviewed-by: Peter Ujfalusi Acked-by: Peter Ujfalusi Signed-off-by: Maarten Lankhorst Link: https://lore.kernel.org/r/20231009115437.99976-2-maarten.lankhorst@linux.intel.com Signed-off-by: Takashi Iwai commit 87543ce5030a17ff5056668d7e6c433168c63bb5 Merge: 2b17b489e47a9 8e13caa2150b5 Author: Takashi Iwai Date: Thu Oct 19 14:51:07 2023 +0200 Merge branch 'for-linus' into for-next For applying HD-audio EPROBE_DEFER series cleanly. Signed-off-by: Takashi Iwai commit 6ce4a93dbb5bd93bc2bdf14da63f9360a4dcd6a1 Author: Jens Axboe Date: Thu Oct 19 06:42:29 2023 -0600 io_uring/poll: use IOU_F_TWQ_LAZY_WAKE for wakeups With poll triggered retries, each event trigger will cause a task_work item to be added for processing. If the ring is setup with IORING_SETUP_DEFER_TASKRUN and a task is waiting on multiple events to complete, any task_work addition will wake the task for processing these items. This can cause more context switches than we would like, if the application is deliberately waiting on multiple items to increase efficiency. For example, if an application has receive multishot armed for sockets and wants to wait for N to complete within M usec of time, we should not be waking up and processing these items until we have all the events we asked for. By switching the poll trigger to lazy wake, we'll process them when they are all ready, in one swoop, rather than wake multiple times only to process one and then go back to sleep. At some point we probably want to look at just making the lazy wake the default, but for now, let's just selectively enable it where it makes sense. Signed-off-by: Jens Axboe commit 3bf983e4e93ce8e6d69e9d63f52a66ec0856672e Author: Gaurav Batra Date: Mon Oct 2 22:08:02 2023 -0500 powerpc/pseries/iommu: enable_ddw incorrectly returns direct mapping for SR-IOV device When a device is initialized, the driver invokes dma_supported() twice - first for streaming mappings followed by coherent mappings. For an SR-IOV device, default window is deleted and DDW created. With vPMEM enabled, TCE mappings are dynamically created for both vPMEM and SR-IOV device. There are no direct mappings. First time when dma_supported() is called with 64 bit mask, DDW is created and marked as dynamic window. The second time dma_supported() is called, enable_ddw() finds existing window for the device and incorrectly returns it as "direct mapping". This only happens when size of DDW is big enough to map max LPAR memory. This results in streaming TCEs to not get dynamically mapped, since code incorrently assumes these are already pre-mapped. The adapter initially comes up but goes down due to EEH. Fixes: 381ceda88c4c ("powerpc/pseries/iommu: Make use of DDW for indirect mapping") Cc: stable@vger.kernel.org # v5.15+ Signed-off-by: Gaurav Batra Signed-off-by: Michael Ellerman Link: https://msgid.link/20231003030802.47914-1-gbatra@linux.vnet.ibm.com commit d5272d39995f4150062a67e6f2cef556edece740 Author: Flavio Suligoi Date: Mon Oct 16 17:05:54 2023 +0200 dt-bindings: backlight: Add brightness-levels related common properties Both files pwm-backlight.yaml and led-backlight.yaml contain properties in common with each other, regarding the brightness levels: - brightness-levels - default-brightness-level These properties can then be moved to backlight/common.yaml. Signed-off-by: Flavio Suligoi Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20231016150554.27144-1-f.suligoi@asem.it Signed-off-by: Lee Jones commit 8f0cd531ee18c70f4655112c49f3c3e329636e7f Author: Sascha Hauer Date: Wed Oct 18 08:17:10 2023 +0200 dt-bindings: devfreq: event: rockchip,dfi: Add rk3588 support This adds rockchip,rk3588-dfi to the list of compatibles. Unlike ealier SoCs the rk3588 has four interrupts (one for each channel) instead of only one, so increase the number of allowed interrupts to four. Link: https://lore.kernel.org/all/20231018061714.3553817-23-s.hauer@pengutronix.de/ Acked-by: Conor Dooley Acked-by: Chanwoo Choi Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit efce8422dd53fae6cdbd37741034ac4eb4730819 Author: Srikar Dronamraju Date: Thu Oct 19 14:44:52 2023 +0530 powerpc/paravirt: Improve vcpu_is_preempted PowerVM Hypervisor dispatches on a whole core basis. In a shared LPAR, a CPU from a core that is CEDED or preempted may have a larger latency. In such a scenario, its preferable to choose a different CPU to run. If one of the CPUs in the core is active, i.e neither CEDED nor preempted, then consider this CPU as not preempted. Also if any of the CPUs in the core has yielded but OS has not requested CEDE or CONFER, then consider this CPU to be preempted. Correct detection of preempted CPUs is important for detecting idle CPUs/cores in task scheduler. Tested-by: Aboorva Devarajan Reviewed-by: Shrikanth Hegde Signed-off-by: Srikar Dronamraju Signed-off-by: Michael Ellerman Link: https://msgid.link/20231019091452.95260-1-srikar@linux.vnet.ibm.com commit 97cfa4ae843ebfb2ba541e78ce190e2d1481cf3f Author: Sascha Hauer Date: Wed Oct 18 08:17:09 2023 +0200 dt-bindings: devfreq: event: rockchip,dfi: Add rk3568 support This adds the rockchip,rk3568-dfi compatible to the binding. Make clocks optional for this SoC as the RK3568 doesn't have a kernel controllable PCLK. Link: https://lore.kernel.org/all/20231018061714.3553817-22-s.hauer@pengutronix.de/ Reviewed-by: Conor Dooley Acked-by: Chanwoo Choi Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit 7fd696076e0f441c1a6415619c3c96afecb513aa Author: Sascha Hauer Date: Wed Oct 18 08:17:08 2023 +0200 dt-bindings: devfreq: event: convert Rockchip DFI binding to yaml Convert the Rockchip DFI binding to yaml. Link: https://lore.kernel.org/all/20231018061714.3553817-21-s.hauer@pengutronix.de/ Reviewed-by: Rob Herring Reviewed-by: Sebastian Reichel Acked-by: Chanwoo Choi Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit 481d97ba61e12f34acc59b6632de1aed7c93b824 Author: Sascha Hauer Date: Wed Oct 18 08:17:07 2023 +0200 PM / devfreq: rockchip-dfi: add support for RK3588 Add support for the RK3588 to the driver. The RK3588 has four DDR channels with a register stride of 0x4000 between the channel registers, also it has a DDRMON_CTRL register per channel. Link: https://lore.kernel.org/all/20231018061714.3553817-20-s.hauer@pengutronix.de/ Reviewed-by: Jonathan Cameron Reviewed-by: Sebastian Reichel Acked-by: Chanwoo Choi Acked-by: Heiko Stuebner Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit e08c43e6c3eb5d805b61d981f1e8286ee0dc6d1a Author: Kuan-Wei Chiu Date: Sat Oct 14 01:57:14 2023 +0800 powerpc/perf: Optimize find_alternatives_list() using binary search This patch improves the performance of event alternative lookup by replacing the previous linear search with a more efficient binary search. This change reduces the time complexity for the search process from O(n) to O(log(n)). A pre-sorted table of event values and their corresponding indices has been introduced to expedite the search process. Signed-off-by: Kuan-Wei Chiu [mpe: Call the array "presort*ed*_event_table", minor formatting] Signed-off-by: Michael Ellerman Link: https://msgid.link/20231013175714.2142775-1-visitorckw@gmail.com commit bbe7cbd07406b75ec845eb261f25373bf88b276a Author: Sascha Hauer Date: Wed Oct 18 08:17:06 2023 +0200 PM / devfreq: rockchip-dfi: account for multiple DDRMON_CTRL registers The currently supported RK3399 has a set of registers per channel, but it has only a single DDRMON_CTRL register. With upcoming RK3588 this will be different, the RK3588 has a DDRMON_CTRL register per channel. Instead of expecting a single DDRMON_CTRL register, loop over the channels and write the channel specific DDRMON_CTRL register. Break out early out of the loop when there is only a single DDRMON_CTRL register like on the RK3399. Link: https://lore.kernel.org/all/20231018061714.3553817-19-s.hauer@pengutronix.de/ Reviewed-by: Jonathan Cameron Reviewed-by: Sebastian Reichel Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit d1d0b3fe95d888f1ae82a0cf6a594fa0c3cbfa79 Author: Sascha Hauer Date: Wed Oct 18 08:17:05 2023 +0200 PM / devfreq: rockchip-dfi: make register stride SoC specific The currently supported RK3399 has a stride of 20 between the channel specific registers. Upcoming RK3588 has a different stride, so put the stride into driver data to make it configurable. While at it convert decimal 20 to hex 0x14 for consistency with RK3588 which has a register stride 0x4000 and we want to write that in hex as well. Link: https://lore.kernel.org/all/20231018061714.3553817-18-s.hauer@pengutronix.de/ Reviewed-by: Jonathan Cameron Reviewed-by: Sebastian Reichel Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit 4d586b5724d3233a73603000de7b8a035b493138 Author: Sascha Hauer Date: Thu Oct 19 08:48:19 2023 +0200 PM / devfreq: rockchip-dfi: Add perf support The DFI is a unit which is suitable for measuring DDR utilization, but so far it could only be used as an event driver for the DDR frequency scaling driver. This adds perf support to the DFI driver. Usage with the 'perf' tool can look like: perf stat -a -e rockchip_ddr/cycles/,\ rockchip_ddr/read-bytes/,\ rockchip_ddr/write-bytes/,\ rockchip_ddr/bytes/ sleep 1 Performance counter stats for 'system wide': 1582524826 rockchip_ddr/cycles/ 1802.25 MB rockchip_ddr/read-bytes/ 1793.72 MB rockchip_ddr/write-bytes/ 3595.90 MB rockchip_ddr/bytes/ 1.014369709 seconds time elapsed perf support has been tested on a RK3568 and a RK3399, the latter with dual channel DDR. Link: https://lore.kernel.org/all/20231019064819.3496740-1-s.hauer@pengutronix.de/ Reviewed-by: Sebastian Reichel Acked-by: Chanwoo Choi Acked-by: Heiko Stuebner Signed-off-by: Sascha Hauer [cw00.choi: Fix typo from 'write_acccess' to 'write_access'] Signed-off-by: Chanwoo Choi commit 0177669ee61de4dc641f9ad86a3df6f22327cf6c Author: Thomas Gleixner Date: Mon Oct 2 13:59:41 2023 +0200 x86/microcode/intel: Cleanup code further Sanitize the microcode scan loop, fixup printks and move the loading function for builtin microcode next to the place where it is used and mark it __init. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115902.389400871@linutronix.de commit 6b072022ab2e1e83b7588144ee0080f7197b71da Author: Thomas Gleixner Date: Mon Oct 2 13:59:40 2023 +0200 x86/microcode/intel: Simplify and rename generic_load_microcode() so it becomes less obfuscated and rename it because there is nothing generic about it. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115902.330295409@linutronix.de commit 2785cc00f6fa4e5ebd0927679ade6df367ac1f24 Author: Sascha Hauer Date: Wed Oct 18 08:17:03 2023 +0200 PM / devfreq: rockchip-dfi: give variable a better name struct dmc_count_channel::total counts the clock cycles of the DDR controller. Rename it accordingly to give the reader a better idea what this is about. While at it, at some documentation to struct dmc_count_channel. Link: https://lore.kernel.org/all/20231018061714.3553817-16-s.hauer@pengutronix.de/ Reviewed-by: Sebastian Reichel Acked-by: Chanwoo Choi Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit 6c73f1dbd9bf91130c2ee0b9c65afb7c3c90bf23 Author: Thomas Zimmermann Date: Tue Oct 17 10:32:08 2023 +0200 drm/ast: Move register constants to ast_reg.h Improve readability by putting all register constants into a separate header file. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231017083653.10063-13-tzimmermann@suse.de commit 8811bcbf28cc270aba8d0067bdb8f44c5cc5fad7 Author: Thomas Zimmermann Date: Tue Oct 17 10:32:07 2023 +0200 drm/ast: Rename AST_IO_MISC_PORT_READ to AST_IO_VGAMR_R Rename AST_IO_MISC_PORT_READ to AST_IO_VGAMR_R to align naming in the driver with documentation. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231017083653.10063-12-tzimmermann@suse.de commit 224bf236ca6d6d49e559565c5eba65f7acc6bbd9 Author: Thomas Zimmermann Date: Tue Oct 17 10:32:06 2023 +0200 drm/ast: Rename AST_IO_INPUT_STATUS1_READ to AST_IO_VGAIR1_R Rename AST_IO_INPUT_STATUS1_READ to AST_IO_VGAIR1_R to align naming in the driver with documentation. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231017083653.10063-11-tzimmermann@suse.de commit c79479fa215c56b4bf59add12e1a92ca6310e611 Author: Thomas Zimmermann Date: Tue Oct 17 10:32:05 2023 +0200 drm/ast: Rename AST_IO_CRTC_PORT to AST_IO_VGACRI Rename AST_IO_CRTC_PORT to AST_IO_VGACRI to align naming in the driver with documentation. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231017083653.10063-10-tzimmermann@suse.de commit 272bfa3a18c5ded5a12068fe0cf041275a00db66 Author: Thomas Zimmermann Date: Tue Oct 17 10:32:04 2023 +0200 drm/ast: Rename AST_IO_GR_PORT to AST_IO_VGAGRI Rename AST_IO_GR_PORT to AST_IO_VGAGRI to align naming in the driver with documentation. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231017083653.10063-9-tzimmermann@suse.de commit a075e1682fdeffdab80fa1cfb2f5f781f3c7c62a Author: Thomas Zimmermann Date: Tue Oct 17 10:32:03 2023 +0200 drm/ast: Rename AST_IO_DAC_DATA to AST_IO_VGAPDR Rename AST_IO_DAC_DATA to AST_IO_VGAPDR to align naming in the driver with documentation. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231017083653.10063-8-tzimmermann@suse.de commit 7b0be4b94b693bc2d32a6f27d534995735bd8c95 Author: Thomas Zimmermann Date: Tue Oct 17 10:32:02 2023 +0200 drm/ast: Rename AST_IO_DAC_INDEX_WRITE to AST_IO_VGADWR Rename AST_IO_DAC_INDEX_WRITE to AST_IO_VGADWR to align naming in the driver with documentation. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231017083653.10063-7-tzimmermann@suse.de commit 9f662e1edecdadb770e0f1cb8ec1edbc68f62a5f Author: Thomas Zimmermann Date: Tue Oct 17 10:32:01 2023 +0200 drm/ast: Rename AST_IO_DAC_INDEX_READ to AST_IO_VGADRR Rename AST_IO_DAC_INDEX_READ to AST_IO_VGADRR to align naming in the driver with documentation. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231017083653.10063-6-tzimmermann@suse.de commit 2a5481e3d35c378bf2523b307e948756f8d3e5de Author: Thomas Zimmermann Date: Tue Oct 17 10:32:00 2023 +0200 drm/ast: Rename AST_IO_SEQ_PORT to AST_IO_VGASRI Rename AST_IO_VGA_SEQ_PORT to AST_IO_VGASRI to align naming in the driver with documentation. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231017083653.10063-5-tzimmermann@suse.de commit ba51b3ed170dabc34a1356c12302d33dc25d83e7 Author: Thomas Zimmermann Date: Tue Oct 17 10:31:59 2023 +0200 drm/ast: Rename AST_IO_VGA_ENABLE_PORT to AST_IO_VGAER Rename AST_IO_VGA_ENABLE_PORT to AST_IO_VGAER to align naming in the driver with documentation. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231017083653.10063-4-tzimmermann@suse.de commit b3945edd707289191d483c930ab7961c1bd0dc0e Author: Thomas Zimmermann Date: Tue Oct 17 10:31:58 2023 +0200 drm/ast: Rename AST_IO_MISC_PORT_WRITE to AST_IO_VGAMR_W Rename AST_IO_MISC_PORT_WRITE to AST_IO_VGAMR_W to align naming in the driver with documentation. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231017083653.10063-3-tzimmermann@suse.de commit 53f410d3698fc96eb657b80e1758ba9b71d96628 Author: Thomas Zimmermann Date: Tue Oct 17 10:31:57 2023 +0200 drm/ast: Rename AST_IO_AR_PORT_WRITE to AST_IO_VGAARI_W Rename AST_IO_AR_PORT_WRITE to AST_IO_VGAARI_W to align naming in the driver with documentation. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Jocelyn Falempe Link: https://patchwork.freedesktop.org/patch/msgid/20231017083653.10063-2-tzimmermann@suse.de commit d724f4a4581b2910ce79b45bd353ee66e7cf9d7f Author: Sascha Hauer Date: Wed Oct 18 08:17:02 2023 +0200 PM / devfreq: rockchip-dfi: Prepare for multiple users When adding perf support later the DFI must be enabled when either of devfreq-event or perf is active. Prepare for that by adding a usage counter for the DFI. Also move enabling and disabling of the clock away from the devfreq-event specific functions to which the perf specific part won't have access. Link: https://lore.kernel.org/all/20231018061714.3553817-15-s.hauer@pengutronix.de/ Reviewed-by: Jonathan Cameron Reviewed-by: Sebastian Reichel Acked-by: Chanwoo Choi Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit b82932fbd870b64fd71a999f9b61fbdcf2924ee6 Author: Sascha Hauer Date: Wed Oct 18 08:17:01 2023 +0200 PM / devfreq: rockchip-dfi: Pass private data struct to internal functions The internal functions do not need the struct devfreq_event_dev *, so pass them the struct rockchip_dfi *. This is a preparation for adding perf support later which doesn't have a struct devfreq_event_dev *. Link: https://lore.kernel.org/all/20231018061714.3553817-14-s.hauer@pengutronix.de/ Reviewed-by: Jonathan Cameron Reviewed-by: Sebastian Reichel Acked-by: Chanwoo Choi Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit d8c6e337e71d3aa05414d8a06a4ff19d45c7be36 Author: Sascha Hauer Date: Wed Oct 18 08:17:00 2023 +0200 PM / devfreq: rockchip-dfi: Handle LPDDR4X In the DFI driver LPDDR4X can be handled in the same way as LPDDR4. Add the missing case. Link: https://lore.kernel.org/all/20231018061714.3553817-13-s.hauer@pengutronix.de/ Reviewed-by: Jonathan Cameron Reviewed-by: Sebastian Reichel Acked-by: Chanwoo Choi Acked-by: Heiko Stuebner Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit 038ff6f53da07971a9df636bcc9bf1344c468dd5 Author: Sascha Hauer Date: Wed Oct 18 08:16:59 2023 +0200 PM / devfreq: rockchip-dfi: Handle LPDDR2 correctly According to the downstream driver the DDRMON_CTRL_LPDDR23 bit must be set for both LPDDR2 and LPDDR3. Add the missing LPDDR2 case and while at it turn the if/else if/else into switch/case which makes it easier to read. Link: https://lore.kernel.org/all/20231018061714.3553817-12-s.hauer@pengutronix.de/ Reviewed-by: Jonathan Cameron Reviewed-by: Sebastian Reichel Acked-by: Chanwoo Choi Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit 076b0597f5b6fbec47cddedf9b39d864938a365c Author: Sascha Hauer Date: Wed Oct 18 08:16:58 2023 +0200 PM / devfreq: rockchip-dfi: Add RK3568 support This adds RK3568 support to the DFI driver. Only iniitialization differs from the currently supported RK3399. Link: https://lore.kernel.org/all/20231018061714.3553817-11-s.hauer@pengutronix.de/ Signed-off-by: Sascha Hauer Acked-by: Heiko Stuebner Signed-off-by: Chanwoo Choi commit 79d01625c3c77d823e987610cf289fcfd6f31cad Merge: a8eddbe354b49 4055758a80395 Author: Arnd Bergmann Date: Thu Oct 19 13:44:28 2023 +0200 Merge tag 'v6.6-next-dts64.3' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into soc/dt MediaTek ARM64 DTS updates for v6.7 - Add support for SMI/IOMMU/LARBs, power domains and multimedia related subsystems for the MT8365 SoC - Add support for MediaTek Genio 1200 IoT evaluation board - Add support for newer revisions of MT8192 Chromebooks - Add support for internal eDP display on MT8195 Cherry Chromebooks - Add display and display backlight support for the Helio X10 SoC and for the Sony Xperia M5 smartphone * tag 'v6.6-next-dts64.3' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: (21 commits) arm64: dts: mediatek: cherry: Configure eDP and internal display arm64: dts: mediatek: mt6795-xperia-m5: Add DSI Display and its vregs arm64: dts: mediatek: mt6795-xperia-m5: Add display backlight support arm64: dts: mediatek: mt6795: Add support for display blocks and DPI/DSI arm64: dts: mediatek: Add spherion-rev4 arm64: dts: mediatek: Add hayato-rev5-sku2 arm64: dts: mediatek: Remove asurada-audio dtsi files dt-bindings: arm64: dts: mediatek: Add rev4 of spherion dt-bindings: arm64: dts: mediatek: Add rev5-sku2 of hayato arm64: dts: mediatek: add iommu support for mt8365 SoC arm64: dts: mediatek: add larb support for mt8365 SoC arm64: dts: mediatek: add smi support for mt8365 SoC arm64: dts: mediatek: add power domain support for mt8365 SoC arm64: dts: mediatek: add apu support for mt8365 SoC arm64: dts: mediatek: add camsys support for mt8365 SoC arm64: dts: mediatek: add mmsys support for mt8365 SoC arm64: dts: mediatek: mt8183-kukui: Add PMIC regulator supplies arm64: dts: mediatek: add device-tree for Genio 1200 EVK board dt-bindings: arm64: mediatek: add mt8395-evk board dt-bindings: power: Add MT8365 power domains ... Link: https://lore.kernel.org/r/298f159c-f80d-3ba8-fde9-b11b59e5a58e@gmail.com Signed-off-by: Arnd Bergmann commit d3b0f6ab0e3374820b7ab7f755a28e7a65ebf2b4 Author: Sascha Hauer Date: Wed Oct 18 08:16:57 2023 +0200 PM / devfreq: rockchip-dfi: Clean up DDR type register defines Use the HIWORD_UPDATE() define known from other rockchip drivers to make the defines look less odd to the readers who've seen other rockchip drivers. The HIWORD registers have their functional bits in the lower 16 bits whereas the upper 16 bits contain a mask. Only the functional bits that have the corresponding mask bit set are modified during a write. Although the register writes look different, the end result should be the same, at least there's no functional change intended with this patch. Link: https://lore.kernel.org/all/20231018061714.3553817-10-s.hauer@pengutronix.de/ Signed-off-by: Sascha Hauer Reviewed-by: Sebastian Reichel Acked-by: Chanwoo Choi Signed-off-by: Chanwoo Choi commit 74002e668d0948d12eb2283891cfbd71be9d53c6 Author: Sascha Hauer Date: Wed Oct 18 08:16:56 2023 +0200 PM / devfreq: rk3399_dmc,dfi: generalize DDRTYPE defines The DDRTYPE defines are named to be RK3399 specific, but they can be used for other Rockchip SoCs as well, so replace the RK3399_PMUGRF_ prefix with ROCKCHIP_. They are defined in a SoC specific header file, so when generalizing the prefix also move the new defines to a SoC agnostic header file. While at it use GENMASK to define the DDRTYPE bitfield and give it a name including the full register name. Link: https://lore.kernel.org/all/20231018061714.3553817-9-s.hauer@pengutronix.de/ Reviewed-by: Sebastian Reichel Acked-by: Chanwoo Choi Acked-by: Heiko Stuebner Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit d88c433831015a4ad4597885cef8f048808cd94d Author: xiazhengqiao Date: Thu Oct 19 18:03:22 2023 +0800 ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: add rt5650 support To use RT5650 as the codec and the amp, add a new sound card named mt8186_rt5650. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: xiazhengqiao Link: https://lore.kernel.org/r/20231019100322.25425-3-xiazhengqiao@huaqin.corp-partner.google.com Signed-off-by: Mark Brown commit 8a79ff9e46beee03dfc2ce9cc80f7090f57d64cb Author: xiazhengqiao Date: Thu Oct 19 18:03:21 2023 +0800 ASoC: dt-bindings: mt8186-mt6366-rt1019-rt5682s: add RT5650 support Add new sound card "mt8186_rt5650". RT5650 comes with amp and earphone codec. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: xiazhengqiao Link: https://lore.kernel.org/r/20231019100322.25425-2-xiazhengqiao@huaqin.corp-partner.google.com Signed-off-by: Mark Brown commit 411957553bca681f6c6a64f419c352bb7d87c2a5 Author: Jiapeng Chong Date: Thu Oct 19 11:04:44 2023 +0800 block: ublk_drv: Remove unused function The function are defined in the ublk_drv.c file, but not called elsewhere, so delete the unused function. drivers/block/ublk_drv.c:1211:20: warning: unused function 'ublk_abort_io_cmds'. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6938 Signed-off-by: Jiapeng Chong Fixes: b4e1353f4651 ("ublk: simplify aborting request") Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20231019030444.53680-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Jens Axboe commit a0e6323dbae6e96af5d1acbc8bb592b56f96c65e Author: Michal Schmidt Date: Wed Oct 18 13:15:27 2023 +0200 iavf: delete unused iavf_mac_info fields 'san_addr' and 'mac_fcoeq' members of struct iavf_mac_info are unused. 'type' is write-only. Delete all three. The function iavf_set_mac_type that sets 'type' also checks if the PCI vendor ID is Intel. This is unnecessary. Delete the whole function. If in the future there's a need for the MAC type (or other PCI ID-dependent data), I would prefer to use .driver_data in iavf_pci_tbl[] for this purpose. Signed-off-by: Michal Schmidt Reviewed-by: Wojciech Drewek Reviewed-by: Jacob Keller Link: https://lore.kernel.org/r/20231018111527.78194-1-mschmidt@redhat.com Signed-off-by: Paolo Abeni commit 878d951c6712b655c38e78ac1ee63c35cd913b22 Author: Eric Dumazet Date: Wed Oct 18 09:00:13 2023 +0000 inet: lock the socket in ip_sock_set_tos() Christoph Paasch reported a panic in TCP stack [1] Indeed, we should not call sk_dst_reset() without holding the socket lock, as __sk_dst_get() callers do not all rely on bare RCU. [1] BUG: kernel NULL pointer dereference, address: 0000000000000000 PGD 12bad6067 P4D 12bad6067 PUD 12bad5067 PMD 0 Oops: 0000 [#1] PREEMPT SMP CPU: 1 PID: 2750 Comm: syz-executor.5 Not tainted 6.6.0-rc4-g7a5720a344e7 #49 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014 RIP: 0010:tcp_get_metrics+0x118/0x8f0 net/ipv4/tcp_metrics.c:321 Code: c7 44 24 70 02 00 8b 03 89 44 24 48 c7 44 24 4c 00 00 00 00 66 c7 44 24 58 02 00 66 ba 02 00 b1 01 89 4c 24 04 4c 89 7c 24 10 <49> 8b 0f 48 8b 89 50 05 00 00 48 89 4c 24 30 33 81 00 02 00 00 69 RSP: 0018:ffffc90000af79b8 EFLAGS: 00010293 RAX: 000000000100007f RBX: ffff88812ae8f500 RCX: ffff88812b5f8f01 RDX: 0000000000000002 RSI: ffffffff8300f080 RDI: 0000000000000002 RBP: 0000000000000002 R08: 0000000000000003 R09: ffffffff8205eca0 R10: 0000000000000002 R11: ffff88812b5f8f00 R12: ffff88812a9e0580 R13: 0000000000000000 R14: ffff88812ae8fbd2 R15: 0000000000000000 FS: 00007f70a006b640(0000) GS:ffff88813bd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000012bad7003 CR4: 0000000000170ee0 Call Trace: tcp_fastopen_cache_get+0x32/0x140 net/ipv4/tcp_metrics.c:567 tcp_fastopen_cookie_check+0x28/0x180 net/ipv4/tcp_fastopen.c:419 tcp_connect+0x9c8/0x12a0 net/ipv4/tcp_output.c:3839 tcp_v4_connect+0x645/0x6e0 net/ipv4/tcp_ipv4.c:323 __inet_stream_connect+0x120/0x590 net/ipv4/af_inet.c:676 tcp_sendmsg_fastopen+0x2d6/0x3a0 net/ipv4/tcp.c:1021 tcp_sendmsg_locked+0x1957/0x1b00 net/ipv4/tcp.c:1073 tcp_sendmsg+0x30/0x50 net/ipv4/tcp.c:1336 __sock_sendmsg+0x83/0xd0 net/socket.c:730 __sys_sendto+0x20a/0x2a0 net/socket.c:2194 __do_sys_sendto net/socket.c:2206 [inline] Fixes: e08d0b3d1723 ("inet: implement lockless IP_TOS") Reported-by: Christoph Paasch Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20231018090014.345158-1-edumazet@google.com Signed-off-by: Paolo Abeni commit 70b9a3d3c11341d596df32e31ece73507dbc936b Merge: 392c226cda945 2ddd05d1d5ed2 Author: Paolo Abeni Date: Thu Oct 19 13:01:35 2023 +0200 Merge branch 'net-stmmac-use-correct-pps-input-indexing' Johannes Zink says: ==================== net: stmmac: use correct PPS input indexing The stmmac can have 0 to 4 auxiliary snapshot in channels, which can be used for capturing external triggers with respect to the eqos PTP timer. Previously when enabling the auxiliary snapshot, an invalid request was written to the hardware register, except for the Intel variant of this driver, where the only snapshot available was hardcoded. Patch 1 of this series cleans up the debug netdev_dbg message indicating the auxiliary snapshot being {en,dis}abled. No functional changes here Patch 2 of this series writes the correct PPS input indexing to the hardware registers instead of a previously used fixed value Patch 3 of this series removes a field member from plat_stmmacnet_data that is no longer needed Patch 4 of this series prepares Patch 5 by protecting the snapshot enabled flag by the aux_ts_lock mutex Patch 5 of this series adds a temporary workaround, since at the moment the driver can handle only one single auxiliary snapshot at a time. Previously the driver silently dropped the previous configuration and enabled the new one. Now, if a snapshot is already enabled and userspace tries to enable another without previously disabling the snapshot currently enabled: issue a netdev_err and return an errorcode indicating the device is busy. This series is a "never worked, doesn't hurt anyone" touchup to the PPS capture for non-intel variants of the dwmac driver. ==================== Link: https://lore.kernel.org/r/20231010-stmmac_fix_auxiliary_event_capture-v2-0-51d5f56542d7@pengutronix.de Signed-off-by: Paolo Abeni commit 2ddd05d1d5ed2aa868df202b30b0ce7a1db5f14a Author: Johannes Zink Date: Wed Oct 18 09:09:57 2023 +0200 net: stmmac: do not silently change auxiliary snapshot capture channel Even though the hardware theoretically supports up to 4 simultaneous auxiliary snapshot capture channels, the stmmac driver does support only a single channel to be active at a time. Previously in case of a PTP_CLK_REQ_EXTTS request, previously active auxiliary snapshot capture channels were silently dropped and the new channel was activated. Instead of silently changing the state for all consumers, log an error and return -EBUSY if a channel is already in use in order to signal to userspace to disable the currently active channel before enabling another one. Signed-off-by: Johannes Zink Signed-off-by: Paolo Abeni commit 7d3077482578fcc6eef6faeef7b8174fd32b7619 Author: Johannes Zink Date: Wed Oct 18 09:09:56 2023 +0200 net: stmmac: ptp: stmmac_enable(): move change of plat->flags into mutex This is a preparation patch. The next patch will check if an external TS is active and return with an error. So we have to move the change of the plat->flags that tracks if external timestamping is enabled after that check. Prepare for this change and move the plat->flags change into the mutex and the if (on). Signed-off-by: Johannes Zink Signed-off-by: Paolo Abeni commit 1dbfe73bd648bdc3a2d8c9e5b23ae70e3333b592 Author: Johannes Zink Date: Wed Oct 18 09:09:55 2023 +0200 net: stmmac: intel: remove unnecessary field struct plat_stmmacenet_data::ext_snapshot_num Do not store bitmask for enabling AUX_SNAPSHOT0. The previous commit ("net: stmmac: fix PPS capture input index") takes care of calculating the proper bit mask from the request data's extts.index field, which is 0 if not explicitly specified otherwise. Signed-off-by: Johannes Zink Signed-off-by: Paolo Abeni commit 7e62ac24b57a3800959a47bb2099e063f7bc01f2 Author: Johannes Zink Date: Wed Oct 18 09:09:54 2023 +0200 net: stmmac: use correct PPS capture input index The stmmac supports up to 4 auxiliary snapshots that can be enabled by setting the appropriate bits in the PTP_ACR bitfield. Previously as of commit f4da56529da6 ("net: stmmac: Add support for external trigger timestamping") instead of setting the bits, a fixed value was written to this bitfield instead of passing the appropriate bitmask. Now the correct bit is set according to the ptp_clock_request.extts_index passed as a parameter to stmmac_enable(). Signed-off-by: Johannes Zink Signed-off-by: Paolo Abeni commit 3fba8234395576b5b7160e06f23e1446f92973e6 Author: Johannes Zink Date: Wed Oct 18 09:09:53 2023 +0200 net: stmmac: simplify debug message on stmmac_enable() Simplify the netdev_dbg() call in stmmac_enable() in order to reduce code duplication. No functional change. Signed-off-by: Johannes Zink Reviewed-by: Andrew Halaney Signed-off-by: Paolo Abeni commit 2770ea00081a4fbdc30c403a7bdd1680dffb4ff2 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:19 2023 +0200 fbdev/vt8623fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-47-tzimmermann@suse.de commit fb159df356d82db2ddb8658802bd1749480c0194 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:18 2023 +0200 fbdev/viafb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Cc: Florian Tobias Schandinat Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-46-tzimmermann@suse.de commit e47e199cc23ee466005ee61bda9afc736c00d9d4 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:17 2023 +0200 fbdev/vga16fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-45-tzimmermann@suse.de commit c74575424463ace02fa8a3496f0385b68a13ebf3 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:16 2023 +0200 fbdev/vermilionfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-44-tzimmermann@suse.de commit 5e5943fef29632b2a48e4110845dcc8256dcfde2 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:15 2023 +0200 fbdev/tridentfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-43-tzimmermann@suse.de commit 153fc9bbac8c3338e4b0d5037c2b8c58e8e0e13b Author: Thomas Zimmermann Date: Wed Sep 27 09:27:14 2023 +0200 fbdev/tgafb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-42-tzimmermann@suse.de commit 309ede0f945c1b6f85f0a6735c40b736d2b49f27 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:13 2023 +0200 fbdev/tdfxfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-41-tzimmermann@suse.de commit 188a8646b95a68f65906d835475b1ef66c11afc8 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:12 2023 +0200 fbdev/sunxvr500: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-40-tzimmermann@suse.de commit 6cdc804e41dde955b305d86b18327567bdaf0d26 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:11 2023 +0200 fbdev/stifb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Cc: "James E.J. Bottomley" Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-39-tzimmermann@suse.de commit 586132cf1d3871f7eb19eae4f78e58cdb52a52d8 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:10 2023 +0200 fbdev/sm712fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Cc: Sudip Mukherjee Cc: Teddy Wang Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-38-tzimmermann@suse.de commit 30543d363dc91e569d573fd4e2bb7404adbc6299 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:09 2023 +0200 fbdev/sm501fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize each instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-37-tzimmermann@suse.de commit 3fa0ee772b9a1b1dfe9c2c6a8d8187945b6cde47 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:08 2023 +0200 fbdev/sisfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-36-tzimmermann@suse.de commit cee250bce6264ee3e48b0e22585d6bdbbb0dceb9 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:07 2023 +0200 fbdev/savagefb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Cc: Antonino Daplas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-35-tzimmermann@suse.de commit 3bf4f1b3de8030d743ef692f94c004b10883e344 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:06 2023 +0200 fbdev/sa1100fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-34-tzimmermann@suse.de commit 633ca05f6c3c3be51908795290c7ecbddabf6ede Author: Thomas Zimmermann Date: Wed Sep 27 09:27:05 2023 +0200 fbdev/s3fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-33-tzimmermann@suse.de commit bf0f401f8ae344a6ebf196f77210a12b72c648f5 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:04 2023 +0200 fbdev/s1d13xxxfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. To simplify the conversion, provide a dedicated fb_ops instance for accelerated devices. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Cc: Kristoffer Ericson Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-32-tzimmermann@suse.de commit 9880753349b8056c84a9c2dbf96522192d2d725a Author: Thomas Zimmermann Date: Wed Sep 27 09:27:03 2023 +0200 fbdev/rivafb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Cc: Antonino Daplas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-31-tzimmermann@suse.de commit c6e8f889c75a28d113fad2b815d91c4c103ed054 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:02 2023 +0200 fbdev/radeon: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Cc: Benjamin Herrenschmidt Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-30-tzimmermann@suse.de commit 4232739709060703e9dd6f5d6839c37e008d389d Author: Thomas Zimmermann Date: Wed Sep 27 09:27:01 2023 +0200 fbdev/pvr2fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-29-tzimmermann@suse.de commit 5dc84f309c4a70008d6ddb3662fdc81456a4e1d1 Author: Thomas Zimmermann Date: Wed Sep 27 09:27:00 2023 +0200 fbdev/pm3fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-28-tzimmermann@suse.de commit a9b0061fb3cf4d4d82bd32192ed66492e545535b Author: Thomas Zimmermann Date: Wed Sep 27 09:26:59 2023 +0200 fbdev/pm2fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-27-tzimmermann@suse.de commit b7ba90ac14c1ce047e8e4ad308779d5fcdca9dca Author: Thomas Zimmermann Date: Wed Sep 27 09:26:58 2023 +0200 fbdev/omapfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-26-tzimmermann@suse.de commit 50182ed4eb2232bab18567dd460b02c98bcb0580 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:57 2023 +0200 fbdev/nvidiafb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Cc: Antonino Daplas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-25-tzimmermann@suse.de commit eb9d5c19dcc383479326890702edc04649c430ac Author: Thomas Zimmermann Date: Wed Sep 27 09:26:56 2023 +0200 fbdev/neofb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-24-tzimmermann@suse.de commit dc9c80b0c6ca04fa7fde6c0fab00c624f51ec396 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:55 2023 +0200 fbdev/matroxfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize each instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-23-tzimmermann@suse.de commit 68deeb025fbfb809aabfecf84331c8d872a101a3 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:54 2023 +0200 fbdev/intelfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Cc: Maik Broemme Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-22-tzimmermann@suse.de commit 80ac1058e4c0acc4303fd8bb42d5702433867359 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:53 2023 +0200 fbdev/imsttfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-21-tzimmermann@suse.de commit 7e568f77d2c96e05c68a9e141ac4a204c62f4bcd Author: Thomas Zimmermann Date: Wed Sep 27 09:26:52 2023 +0200 fbdev/i810fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Cc: Antonino Daplas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-20-tzimmermann@suse.de commit b933456c25353a935714cb63f36090808f26ba5d Author: Thomas Zimmermann Date: Wed Sep 27 09:26:51 2023 +0200 fbdev/hpfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-19-tzimmermann@suse.de commit a1a1c3fa1340cf7305bc83496baacc009d73c7e7 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:50 2023 +0200 fbdev/hitfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-18-tzimmermann@suse.de commit 2195155117a1fa828b0c7d5ab3bba02128863a79 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:49 2023 +0200 fbdev/hgafb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Cc: Ferenc Bakonyi Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-17-tzimmermann@suse.de commit e7011bf87d6dc3ac045bd3d0a73a9e520974adcf Author: Thomas Zimmermann Date: Wed Sep 27 09:26:48 2023 +0200 fbdev/gbefb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-16-tzimmermann@suse.de commit 244c2b55bf7b245d2030d3d1cba0c7d2000b75c9 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:47 2023 +0200 fbdev/ep93xx-fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-15-tzimmermann@suse.de commit a7942a325b103c80210e8577b1a27c0363df5e8f Author: Thomas Zimmermann Date: Wed Sep 27 09:26:46 2023 +0200 fbdev/dnfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-14-tzimmermann@suse.de commit d6583f5b78329274830b6e6ae4ed97f171269d25 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:45 2023 +0200 fbdev/cyber2000fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-13-tzimmermann@suse.de commit 076b705df15ebbee0fe65502551c357b8e3117db Author: Thomas Zimmermann Date: Wed Sep 27 09:26:44 2023 +0200 fbdev/controlfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-12-tzimmermann@suse.de commit d47f9775c1a6d3200d99ff8e7ea90c81af502c96 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:43 2023 +0200 fbdev/cobalt-lcd: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-11-tzimmermann@suse.de commit 0296ddfe57c3d801d2a50aca4fec2066eaa2f652 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:42 2023 +0200 fbdev/cirrusfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-10-tzimmermann@suse.de commit 93ede59ccd9455412fdbc5cc813fc86162e21165 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:41 2023 +0200 fbdev/au1100fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-9-tzimmermann@suse.de commit 94cab8f6b243981604d8f89f4ce03a58d604c936 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:40 2023 +0200 fbdev/atyfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-8-tzimmermann@suse.de commit 425562be861b46ba8dac78e3927c1cbff5fbb514 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:39 2023 +0200 fbdev/atafb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-7-tzimmermann@suse.de commit 7421a6303edc13cf3b54c465c6848bdd440e51b7 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:38 2023 +0200 fbdev/arkfb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-6-tzimmermann@suse.de commit 48c3734d416ec1c729cb9d81631ae5c325413e93 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:37 2023 +0200 fbdev/amifb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-5-tzimmermann@suse.de commit b910005c98a81cb69a7479f577005a329f08bccd Author: Thomas Zimmermann Date: Wed Sep 27 09:26:36 2023 +0200 fbdev/amba-clcd: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-4-tzimmermann@suse.de commit 5a5015aaaac50b7ac9d2f97a98dc5c7a523d972f Author: Thomas Zimmermann Date: Wed Sep 27 09:26:35 2023 +0200 fbdev/68328fb: Initialize fb_ops to fbdev I/O-memory helpers Initialize the instance of struct fb_ops with fbdev initializer macros for framebuffers in I/O address space. Set the read/write, draw and mmap callbacks to the correct implementation and avoid implicit defaults. Also select the necessary I/O helpers in Kconfig. Fbdev drivers sometimes rely on the callbacks being NULL for a default implementation to be invoked; hence requiring the I/O helpers to be built in any case. Setting all callbacks in all drivers explicitly will allow to make the I/O helpers optional. This benefits systems that do not use these functions. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-3-tzimmermann@suse.de commit d45c4b48dafb5820e5cc267ff9a6d7784d13a43c Author: Michael Ellerman Date: Thu Aug 24 16:42:10 2023 +1000 powerpc: Hide empty pt_regs at base of the stack A thread started via eg. user_mode_thread() runs in the kernel to begin with and then may later return to userspace. While it's running in the kernel it has a pt_regs at the base of its kernel stack, but that pt_regs is all zeroes. If the thread oopses in that state, it leads to an ugly stack trace with a big block of zero GPRs, as reported by Joel: Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.5.0-rc7-00004-gf7757129e3de-dirty #3 Hardware name: IBM PowerNV (emulated by qemu) POWER9 0x4e1200 opal:v7.0 PowerNV Call Trace: [c0000000036afb00] [c0000000010dd058] dump_stack_lvl+0x6c/0x9c (unreliable) [c0000000036afb30] [c00000000013c524] panic+0x178/0x424 [c0000000036afbd0] [c000000002005100] mount_root_generic+0x250/0x324 [c0000000036afca0] [c0000000020057d0] prepare_namespace+0x2d4/0x344 [c0000000036afd20] [c0000000020049c0] kernel_init_freeable+0x358/0x3ac [c0000000036afdf0] [c0000000000111b0] kernel_init+0x30/0x1a0 [c0000000036afe50] [c00000000000debc] ret_from_kernel_user_thread+0x14/0x1c --- interrupt: 0 at 0x0 NIP: 0000000000000000 LR: 0000000000000000 CTR: 0000000000000000 REGS: c0000000036afe80 TRAP: 0000 Not tainted (6.5.0-rc7-00004-gf7757129e3de-dirty) MSR: 0000000000000000 <> CR: 00000000 XER: 00000000 CFAR: 0000000000000000 IRQMASK: 0 GPR00: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR04: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR12: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR28: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 NIP [0000000000000000] 0x0 LR [0000000000000000] 0x0 --- interrupt: 0 The all-zero pt_regs looks ugly and conveys no useful information, other than its presence. So detect that case and just show the presence of the frame by printing the interrupt marker, eg: Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.5.0-rc3-00126-g18e9506562a0-dirty #301 Hardware name: IBM pSeries (emulated by qemu) POWER9 (raw) 0x4e1202 0xf000005 of:SLOF,HEAD hv:linux,kvm pSeries Call Trace: [c000000003aabb00] [c000000001143db8] dump_stack_lvl+0x6c/0x9c (unreliable) [c000000003aabb30] [c00000000014c624] panic+0x178/0x424 [c000000003aabbd0] [c0000000020050fc] mount_root_generic+0x250/0x324 [c000000003aabca0] [c0000000020057cc] prepare_namespace+0x2d4/0x344 [c000000003aabd20] [c0000000020049bc] kernel_init_freeable+0x358/0x3ac [c000000003aabdf0] [c0000000000111b0] kernel_init+0x30/0x1a0 [c000000003aabe50] [c00000000000debc] ret_from_kernel_user_thread+0x14/0x1c --- interrupt: 0 at 0x0 To avoid ever suppressing a valid pt_regs make sure the pt_regs has a zero MSR and TRAP value, and is located at the very base of the stack. Fixes: 6895dfc04741 ("powerpc: copy_thread fill in interrupt frame marker and back chain") Reported-by: Joel Stanley Reported-by: Nicholas Piggin Reviewed-by: Joel Stanley Signed-off-by: Michael Ellerman Link: https://msgid.link/20230824064210.907266-1-mpe@ellerman.id.au commit b0f0bf5eef5fac6ba30b7cac15ca4cb01f8a6ca9 Author: Thomas Gleixner Date: Mon Oct 2 13:59:39 2023 +0200 x86/microcode/intel: Simplify scan_microcode() Make it readable and comprehensible. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115902.271940980@linutronix.de commit ae76d951f6537001bdf77894d19cd4a446de337e Author: Ashok Raj Date: Tue Oct 17 23:23:33 2023 +0200 x86/microcode/intel: Rip out mixed stepping support for Intel CPUs Mixed steppings aren't supported on Intel CPUs. Only one microcode patch is required for the entire system. The caching of microcode blobs which match the family and model is therefore pointless and in fact is dysfunctional as CPU hotplug updates use only a single microcode blob, i.e. the one where *intel_ucode_patch points to. Remove the microcode cache and make it an AMD local feature. [ tglx: - save only at the end. Otherwise random microcode ends up in the pointer for early loading - free the ucode patch pointer in save_microcode_patch() only after kmemdup() has succeeded, as reported by Andrew Cooper ] Originally-by: Thomas Gleixner Signed-off-by: Ashok Raj Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211722.404362809@linutronix.de commit 392c226cda945dfc963d0a08cb231f76e551afba Author: Gan Yi Fang Date: Wed Oct 18 11:08:02 2023 +0800 net: stmmac: Remove redundant checking for rx_coalesce_usecs The datatype of rx_coalesce_usecs is u32, always larger or equal to zero. Previous checking does not include value 0, this patch removes the checking to handle the value 0. This change in behaviour making the value of 0 cause an error is not a problem because 0 is out of range of rx_coalesce_usecs. Signed-off-by: Gan Yi Fang Link: https://lore.kernel.org/r/20231018030802.741923-1-yi.fang.gan@intel.com Signed-off-by: Paolo Abeni commit 6f8605fd7d1160ab82b0fffb650180393c85c6fe Author: Dasnavis Sabiya Date: Thu Oct 19 11:10:22 2023 +0530 arm64: dts: ti: k3-am69-sk: Add DP and HDMI support AM69 starter kit features an HDMI port and an eDP port. Add assigned clocks for DSS, DT node for DisplayPort PHY, pinmux for HDMI hotplug and power down, mcu_i2c1 and dss_vout for HDMI. Also enable Serdes4 settings for DP display. Add the endpoint nodes to describe connection from: DSS => MHDP => DisplayPort connector DSS => TI TFP410 DPI-to-DVI Bridge => HDMI connector Signed-off-by: Dasnavis Sabiya [j-choudhary@ti.com: Fix dvi-bridge, dss, mhdp and serdes-refclk] Signed-off-by: Jayesh Choudhary Reviewed-by: Aradhya Bhatia Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20231019054022.175163-6-j-choudhary@ti.com Signed-off-by: Vignesh Raghavendra commit 0da6b5d6a1bedf3bce5035eaec382c857e402b03 Author: Rahul T R Date: Thu Oct 19 11:10:21 2023 +0530 arm64: dts: ti: k3-j784s4-evm: Enable DisplayPort-0 Enable display for J784S4 EVM. Add assigned clocks for DSS, DT node for DisplayPort PHY and pinmux for DP HPD. Add the clock frequency for serdes_refclk. Add the endpoint nodes to describe connection from: DSS => MHDP => DisplayPort connector. Also add the GPIO expander-4 node and pinmux for main_i2c4 which is required for controlling DP power. Set status for all required nodes for DP-0 as "okay". Signed-off-by: Rahul T R [j-choudhary@ti.com: move all the changes together to enable DP-0 in EVM] Signed-off-by: Jayesh Choudhary Reviewed-by: Aradhya Bhatia Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20231019054022.175163-5-j-choudhary@ti.com Signed-off-by: Vignesh Raghavendra commit 603669b167015356c8fdae878963ba0af0ac2634 Author: Rahul T R Date: Thu Oct 19 11:10:20 2023 +0530 arm64: dts: ti: k3-j784s4-main: Add DSS and DP-bridge node Add DSS and DP-bridge node for J784S4 SoC. DSS IP in J784S4 is same as DSS IP in J721E, so same compatible is being used. The DP is Cadence MHDP8546. Disable them by default as nodes are missing port definition and phy link configurations which are added later in platform dt file. Signed-off-by: Rahul T R [j-choudhary@ti.com: move dss & mhdp node together in main, fix dss node] Signed-off-by: Jayesh Choudhary Reviewed-by: Aradhya Bhatia Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20231019054022.175163-4-j-choudhary@ti.com Signed-off-by: Vignesh Raghavendra commit 1b27f0db6d4222f873a64f5b711d752d2e379988 Author: Siddharth Vadapalli Date: Thu Oct 19 11:10:19 2023 +0530 arm64: dts: ti: k3-j784s4-main: Add WIZ and SERDES PHY nodes J784S4 SoC has 4 Serdes instances along with their respective WIZ instances. Add device-tree nodes for them and disable them by default as the node is incomplete and phy link properties will be added in the platform dt file. Signed-off-by: Siddharth Vadapalli [j-choudhary@ti.com: fix serdes_wiz clock order & disable serdes refclk] Signed-off-by: Jayesh Choudhary Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20231019054022.175163-3-j-choudhary@ti.com Signed-off-by: Vignesh Raghavendra commit 7287d423f1388ddfdc5bd1dd6b9f6aa659ef3bbd Author: Siddharth Vadapalli Date: Thu Oct 19 11:10:18 2023 +0530 arm64: dts: ti: k3-j784s4-main: Add system controller and SERDES lane mux The system controller node manages the CTRL_MMR0 region. Add serdes_ln_ctrl node which is used for controlling the SERDES lane mux. Signed-off-by: Siddharth Vadapalli [j-choudhary@ti.com: Fix serdes_ln_ctrl node] Signed-off-by: Jayesh Choudhary Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20231019054022.175163-2-j-choudhary@ti.com Signed-off-by: Vignesh Raghavendra commit b91f2e13c972c3f2f33ecc873b0ff0ada3fa1854 Author: Jakub Kicinski Date: Tue Oct 17 18:07:58 2023 -0700 docs: networking: document multi-RSS context There seems to be no docs for the concept of multiple RSS contexts and how to configure it. I had to explain it three times recently, the last one being the charm, document it. Signed-off-by: Jakub Kicinski Reviewed-by: Simon Horman Reviewed-by: Edward Cree Link: https://lore.kernel.org/r/20231018010758.2382742-1-kuba@kernel.org Signed-off-by: Paolo Abeni commit 6654408a33e6297d8e1d2773409431d487399b95 Author: Jingbo Xu Date: Sat Oct 14 20:55:11 2023 +0800 writeback, cgroup: switch inodes with dirty timestamps to release dying cgwbs The cgwb cleanup routine will try to release the dying cgwb by switching the attached inodes. It fetches the attached inodes from wb->b_attached list, omitting the fact that inodes only with dirty timestamps reside in wb->b_dirty_time list, which is the case when lazytime is enabled. This causes enormous zombie memory cgroup when lazytime is enabled, as inodes with dirty timestamps can not be switched to a live cgwb for a long time. It is reasonable not to switch cgwb for inodes with dirty data, as otherwise it may break the bandwidth restrictions. However since the writeback of inode metadata is not accounted for, let's also switch inodes with dirty timestamps to avoid zombie memory and block cgroups when laztytime is enabled. Fixes: c22d70a162d3 ("writeback, cgroup: release dying cgwbs by switching attached inodes") Reviewed-by: Jan Kara Signed-off-by: Jingbo Xu Link: https://lore.kernel.org/r/20231014125511.102978-1-jefflexu@linux.alibaba.com Acked-by: Tejun Heo Signed-off-by: Christian Brauner commit e311ba29a552194ece6c1579fe434bdad550bfac Author: Uwe Kleine-König Date: Fri Oct 13 15:24:42 2023 +0200 chardev: Simplify usage of try_module_get() try_module_get(NULL) is true, so there is no need to check owner being NULL. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231013132441.1406200-2-u.kleine-koenig@pengutronix.de Signed-off-by: Christian Brauner commit 2bc5e5e8167f2114976f00755b9a0c7f17d6f105 Author: Christian Brauner Date: Thu Oct 12 17:36:57 2023 +0200 ovl: rely on SB_I_NOUMASK In commit f61b9bb3f838 ("fs: add a new SB_I_NOUMASK flag") we added a new SB_I_NOUMASK flag that is used by filesystems like NFS to indicate that umask stripping is never supposed to be done in the vfs independent of whether or not POSIX ACLs are supported. Overlayfs falls into the same category as it raises SB_POSIXACL unconditionally to defer umask application to the upper filesystem. Now that we have SB_I_NOUMASK use that and make SB_POSIXACL properly conditional on whether or not the kernel does have support for it. This will enable use to turn IS_POSIXACL() into nop on kernels that don't have POSIX ACL support avoding bugs from missed umask stripping. Link: https://lore.kernel.org/r/20231012-einband-uferpromenade-80541a047a1f@brauner Acked-by: Amir Goldstein Signed-off-by: Christian Brauner commit e4e8b47a34a432c3f65534d12d5c132b6639da71 Author: Max Kellermann Date: Mon Jan 15 18:30:46 2018 +0100 fs: fix umask on NFS with CONFIG_FS_POSIX_ACL=n Make IS_POSIXACL() return false if POSIX ACL support is disabled. Never skip applying the umask in namei.c and never bother to do any ACL specific checks if the filesystem falsely indicates it has ACLs enabled when the feature is completely disabled in the kernel. This fixes a problem where the umask is always ignored in the NFS client when compiled without CONFIG_FS_POSIX_ACL. This is a 4 year old regression caused by commit 013cdf1088d723 which itself was not completely wrong, but failed to consider all the side effects by misdesigned VFS code. Prior to that commit, there were two places where the umask could be applied, for example when creating a directory: 1. in the VFS layer in SYSCALL_DEFINE3(mkdirat), but only if !IS_POSIXACL() 2. again (unconditionally) in nfs3_proc_mkdir() The first one does not apply, because even without CONFIG_FS_POSIX_ACL, the NFS client sets SB_POSIXACL in nfs_fill_super(). After that commit, (2.) was replaced by: 2b. in posix_acl_create(), called by nfs3_proc_mkdir() There's one branch in posix_acl_create() which applies the umask; however, without CONFIG_FS_POSIX_ACL, posix_acl_create() is an empty dummy function which does not apply the umask. The approach chosen by this patch is to make IS_POSIXACL() always return false when POSIX ACL support is disabled, so the umask always gets applied by the VFS layer. This is consistent with the (regular) behavior of posix_acl_create(): that function returns early if IS_POSIXACL() is false, before applying the umask. Therefore, posix_acl_create() is responsible for applying the umask if there is ACL support enabled in the file system (SB_POSIXACL), and the VFS layer is responsible for all other cases (no SB_POSIXACL or no CONFIG_FS_POSIX_ACL). Signed-off-by: Max Kellermann Link: https://lore.kernel.org/r/151603744662.29035.4910161264124875658.stgit@rabbit.intern.cm-ag Signed-off-by: Christian Brauner commit def3ae83da02f87005210fa3d448c5dd37ba4105 Author: Amir Goldstein Date: Mon Oct 9 18:37:12 2023 +0300 fs: store real path instead of fake path in backing file f_path A backing file struct stores two path's, one "real" path that is referring to f_inode and one "fake" path, which should be displayed to users in /proc//maps. There is a lot more potential code that needs to know the "real" path, then code that needs to know the "fake" path. Instead of code having to request the "real" path with file_real_path(), store the "real" path in f_path and require code that needs to know the "fake" path request it with file_user_path(). Replace the file_real_path() helper with a simple const accessor f_path(). After this change, file_dentry() is not expected to observe any files with overlayfs f_path and real f_inode, so the call to ->d_real() should not be needed. Leave the ->d_real() call for now and add an assertion in ovl_d_real() to catch if we made wrong assumptions. Suggested-by: Miklos Szeredi Link: https://lore.kernel.org/r/CAJfpegtt48eXhhjDFA1ojcHPNKj3Go6joryCPtEFAKpocyBsnw@mail.gmail.com/ Signed-off-by: Amir Goldstein Link: https://lore.kernel.org/r/20231009153712.1566422-4-amir73il@gmail.com Signed-off-by: Christian Brauner commit 08582d678fcf11fc86188f0b92239d3d49667d8e Author: Amir Goldstein Date: Mon Oct 9 18:37:11 2023 +0300 fs: create helper file_user_path() for user displayed mapped file path Overlayfs uses backing files with "fake" overlayfs f_path and "real" underlying f_inode, in order to use underlying inode aops for mapped files and to display the overlayfs path in /proc//maps. In preparation for storing the overlayfs "fake" path instead of the underlying "real" path in struct backing_file, define a noop helper file_user_path() that returns f_path for now. Use the new helper in procfs and kernel logs whenever a path of a mapped file is displayed to users. Signed-off-by: Amir Goldstein Link: https://lore.kernel.org/r/20231009153712.1566422-3-amir73il@gmail.com Signed-off-by: Christian Brauner commit 83bc1d294130cc471a89ce10770daa281a93fcb0 Author: Amir Goldstein Date: Mon Oct 9 18:37:10 2023 +0300 fs: get mnt_writers count for an open backing file's real path A writeable mapped backing file can perform writes to the real inode. Therefore, the real path mount must be kept writable so long as the writable map exists. This may not be strictly needed for ovelrayfs private upper mount, but it is correct to take the mnt_writers count in the vfs helper. Signed-off-by: Amir Goldstein Link: https://lore.kernel.org/r/20231009153712.1566422-2-amir73il@gmail.com Signed-off-by: Christian Brauner commit 6c4d1c99d2ad5e12b897da482ca8305b929cb9ce Author: Mateusz Guzik Date: Wed Oct 4 13:19:16 2023 +0200 vfs: stop counting on gcc not messing with mnt_expiry_mark if not asked So happens it already was not doing it, but there is no need to "hope" as indicated in the comment. No changes in generated assembly. Signed-off-by: Mateusz Guzik Link: https://lore.kernel.org/r/20231004111916.728135-3-mjguzik@gmail.com Signed-off-by: Christian Brauner commit 95e93d17cb113a3b097774874572b69c058acab5 Author: Mateusz Guzik Date: Wed Oct 4 13:19:15 2023 +0200 vfs: predict the error in retry_estale as unlikely Signed-off-by: Mateusz Guzik Link: https://lore.kernel.org/r/20231004111916.728135-2-mjguzik@gmail.com Signed-off-by: Christian Brauner commit 6cf41fcfe099b61b4e3ea7dbe04a906f4c904822 Author: Christian Brauner Date: Thu Oct 5 19:08:35 2023 +0200 backing file: free directly Backing files as used by overlayfs are never installed into file descriptor tables and are explicitly documented as such. They aren't subject to rcu access conditions like regular files are. Their lifetime is bound to the lifetime of the overlayfs file, i.e., they're stashed in ovl_file->private_data and go away otherwise. If they're set as vma->vm_file - which is their main purpose - then they're subject to regular refcount rules and vma->vm_file can't be installed into an fdtable after having been set. All in all I don't see any need for rcu delay here. So free it directly. This all hinges on such hybrid beasts to never actually be installed into fdtables which - as mentioned before - is not allowed. So add an explicit WARN_ON_ONCE() so we catch any case where someone is suddenly trying to install one of those things into a file descriptor table so we can have a nice long chat with them. Link: https://lore.kernel.org/r/20231005-sakralbau-wappnen-f5c31755ed70@brauner Acked-by: Linus Torvalds Signed-off-by: Christian Brauner commit 7116c0af4b8414b2f19fdb366eea213cbd9d91c2 Author: Reuben Hawkins Date: Mon Oct 2 20:57:04 2023 -0500 vfs: fix readahead(2) on block devices Readahead was factored to call generic_fadvise. That refactor added an S_ISREG restriction which broke readahead on block devices. In addition to S_ISREG, this change checks S_ISBLK to fix block device readahead. There is no change in behavior with any file type besides block devices in this change. Fixes: 3d8f7615319b ("vfs: implement readahead(2) using POSIX_FADV_WILLNEED") Signed-off-by: Reuben Hawkins Link: https://lore.kernel.org/r/20231003015704.2415-1-reubenhwk@gmail.com Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner commit 50d910d27362d6809a0668f0f1cb5220bc7dc6a0 Author: Christian Brauner Date: Tue Oct 10 10:23:26 2023 +0200 io_uring: use files_lookup_fd_locked() While valid we don't need to open-code rcu dereferences if we're acquiring file_lock anyway. Suggested-by: Al Viro Link: https://lore.kernel.org/r/20231010030615.GO800259@ZenIV Signed-off-by: Christian Brauner commit 0ede61d8589cc2d93aa78230d74ac58b5b8d0244 Author: Christian Brauner Date: Fri Sep 29 08:45:59 2023 +0200 file: convert to SLAB_TYPESAFE_BY_RCU In recent discussions around some performance improvements in the file handling area we discussed switching the file cache to rely on SLAB_TYPESAFE_BY_RCU which allows us to get rid of call_rcu() based freeing for files completely. This is a pretty sensitive change overall but it might actually be worth doing. The main downside is the subtlety. The other one is that we should really wait for Jann's patch to land that enables KASAN to handle SLAB_TYPESAFE_BY_RCU UAFs. Currently it doesn't but a patch for this exists. With SLAB_TYPESAFE_BY_RCU objects may be freed and reused multiple times which requires a few changes. So it isn't sufficient anymore to just acquire a reference to the file in question under rcu using atomic_long_inc_not_zero() since the file might have already been recycled and someone else might have bumped the reference. In other words, callers might see reference count bumps from newer users. For this reason it is necessary to verify that the pointer is the same before and after the reference count increment. This pattern can be seen in get_file_rcu() and __files_get_rcu(). In addition, it isn't possible to access or check fields in struct file without first aqcuiring a reference on it. Not doing that was always very dodgy and it was only usable for non-pointer data in struct file. With SLAB_TYPESAFE_BY_RCU it is necessary that callers first acquire a reference under rcu or they must hold the files_lock of the fdtable. Failing to do either one of this is a bug. Thanks to Jann for pointing out that we need to ensure memory ordering between reallocations and pointer check by ensuring that all subsequent loads have a dependency on the second load in get_file_rcu() and providing a fixup that was folded into this patch. Cc: Jann Horn Suggested-by: Linus Torvalds Signed-off-by: Christian Brauner commit 93faf426e3cc000c95f1a5d3510b77ce99adac52 Author: Mateusz Guzik Date: Tue Sep 26 18:22:28 2023 +0200 vfs: shave work on failed file open Failed opens (mostly ENOENT) legitimately happen a lot, for example here are stats from stracing kernel build for few seconds (strace -fc make): % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ------------------ 0.76 0.076233 5 15040 3688 openat (this is tons of header files tried in different paths) In the common case of there being nothing to close (only the file object to free) there is a lot of overhead which can be avoided. This is most notably delegation of freeing to task_work, which comes with an enormous cost (see 021a160abf62 ("fs: use __fput_sync in close(2)" for an example). Benchmarked with will-it-scale with a custom testcase based on tests/open1.c, stuffed into tests/openneg.c: [snip] while (1) { int fd = open("/tmp/nonexistent", O_RDONLY); assert(fd == -1); (*iterations)++; } [/snip] Sapphire Rapids, openneg_processes -t 1 (ops/s): before: 1950013 after: 2914973 (+49%) file refcount is checked as a safety belt against buggy consumers with an atomic cmpxchg. Technically it is not necessary, but it happens to not be measurable due to several other atomics which immediately follow. Optmizing them away to make this atomic into a problem is left as an exercise for the reader. v2: - unexport fput_badopen and move to fs/internal.h - handle the refcount with cmpxchg, adjust commentary accordingly - tweak the commit message Signed-off-by: Mateusz Guzik Link: https://lore.kernel.org/r/20230926162228.68666-1-mjguzik@gmail.com Signed-off-by: Christian Brauner commit 6036c5f1317526890925576f0efcbc427a32a2ae Author: Luís Henriques Date: Thu Sep 28 16:23:41 2023 +0100 fs: simplify misleading code to remove ambiguity regarding ihold()/iput() Because 'inode' is being initialised before checking if 'dentry' is negative it looks like an extra iput() on 'inode' may happen since the ihold() is done only if the dentry is *not* negative. In reality this doesn't happen because d_is_negative() is never true if ->d_inode is NULL. This patch only makes the code easier to understand, as I was initially mislead by it. Signed-off-by: Luís Henriques Link: https://lore.kernel.org/r/20230928152341.303-1-lhenriques@suse.de Signed-off-by: Christian Brauner commit 85fadf89e5708d74c4923e9ceeca4b9df0e000bb Author: Kees Cook Date: Fri Sep 22 10:54:08 2023 -0700 watch_queue: Annotate struct watch_filter with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct watch_filter. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: David Howells Cc: Randy Dunlap Cc: Al Viro Cc: Christian Brauner Cc: Jonathan Corbet Cc: Siddh Raman Pant Cc: Mauro Carvalho Chehab Cc: Qian Cai Signed-off-by: Kees Cook Tested-by: Siddh Raman Pant Reviewed-by: "Gustavo A. R. Silva" Message-Id: <20230922175407.work.754-kees@kernel.org> Signed-off-by: Christian Brauner commit 478dbf12176700f28d836dd03ae93a6888278230 Author: Max Kellermann Date: Thu Sep 21 09:57:55 2023 +0200 fs/pipe: use spinlock in pipe_read() only if there is a watch_queue If there is no watch_queue, holding the pipe mutex is enough to prevent concurrent writes, and we can avoid the spinlock. O_NOTIFICATION_QUEUE is an exotic and rarely used feature, and of all the pipes that exist at any given time, only very few actually have a watch_queue, therefore it appears worthwile to optimize the common case. This patch does not optimize pipe_resize_ring() where the spinlocks could be avoided as well; that does not seem like a worthwile optimization because this function is not called often. Related commits: - commit 8df441294dd3 ("pipe: Check for ring full inside of the spinlock in pipe_write()") - commit b667b8673443 ("pipe: Advance tail pointer inside of wait spinlock in pipe_read()") - commit 189b0ddc2451 ("pipe: Fix missing lock in pipe_resize_ring()") Signed-off-by: Max Kellermann Message-Id: <20230921075755.1378787-4-max.kellermann@ionos.com> Reviewed-by: David Howells Signed-off-by: Christian Brauner commit dfaabf916b1ca83cfac856745db2fc9d57d9b13a Author: Max Kellermann Date: Thu Sep 21 09:57:54 2023 +0200 fs/pipe: remove unnecessary spinlock from pipe_write() This reverts commit 8df441294dd3 ("pipe: Check for ring full inside of the spinlock in pipe_write()") which was obsoleted by commit c73be61cede ("pipe: Add general notification queue support") because now pipe_write() fails early with -EXDEV if there is a watch_queue. Without a watch_queue, no notifications can be posted to the pipe and mutex protection is enough, as can be seen in splice_pipe_to_pipe() which does not use the spinlock either. Signed-off-by: Max Kellermann Message-Id: <20230921075755.1378787-3-max.kellermann@ionos.com> Reviewed-by: David Howells Signed-off-by: Christian Brauner commit b4bd6b4bac8edd61eb8f7b836969d12c0c6af165 Author: Max Kellermann Date: Thu Sep 21 09:57:53 2023 +0200 fs/pipe: move check to pipe_has_watch_queue() This declutters the code by reducing the number of #ifdefs and makes the watch_queue checks simpler. This has no runtime effect; the machine code is identical. Signed-off-by: Max Kellermann Message-Id: <20230921075755.1378787-2-max.kellermann@ionos.com> Reviewed-by: David Howells Signed-off-by: Christian Brauner commit 61105aab4edb59bf8177f005eb2923fe5c4deb3c Author: Max Kellermann Date: Thu Sep 21 09:57:52 2023 +0200 pipe: reduce padding in struct pipe_inode_info This has no effect on 64 bit because there are 10 32-bit integers surrounding the two bools, but on 32 bit architectures, this reduces the struct size by 4 bytes by merging the two bools into one word. Signed-off-by: Max Kellermann Message-Id: <20230921075755.1378787-1-max.kellermann@ionos.com> Signed-off-by: Christian Brauner commit 5aa8fd9cea2ee0d42c5d92c5eacf0a14bbc4c293 Author: Jeff Layton Date: Mon Sep 11 20:25:50 2023 -0400 fs: add a new SB_I_NOUMASK flag SB_POSIXACL must be set when a filesystem supports POSIX ACLs, but NFSv4 also sets this flag to prevent the VFS from applying the umask on newly-created files. NFSv4 doesn't support POSIX ACLs however, which causes confusion when other subsystems try to test for them. Add a new SB_I_NOUMASK flag that allows filesystems to opt-in to umask stripping without advertising support for POSIX ACLs. Set the new flag on NFSv4 instead of SB_POSIXACL. Also, move mode_strip_umask to namei.h and convert init_mknod and init_mkdir to use it. Signed-off-by: Jeff Layton Message-Id: <20230911-acl-fix-v3-1-b25315333f6c@kernel.org> Signed-off-by: Christian Brauner commit 84d2b696236c63836011f04d13d3f09ed47fa560 Author: Jianyong Wu Date: Thu Sep 7 09:10:25 2023 +0000 init/mount: print pretty name of root device when panics Given a wrong root device, current log may not give the pretty name which is useful to locate root cause. For example, there are 2 blk devs in a VM, /dev/vda which has 2 partitials /dev/vda1 and /dev/vda2 and /dev/vdb which is blank. /dev/vda2 is the right root dev. When set "root=/dev/vdb", we get error log: [ 0.635575] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(254,16) It's not straightforward to find out the root cause as there is lack of the root devive name therefore hard for people to get those info from the device number, in the example, (254,16). It is more comprehensive way to hint the root cause if pretty name is given here, like: [ 0.559887] Kernel panic - not syncing: VFS: Unable to mount root fs on "/dev/vdb" or unknown-block(254,16) Signed-off-by: Jianyong Wu Message-Id: <20230907091025.3436878-1-jianyong.wu@arm.com> Signed-off-by: Christian Brauner commit 65e4f4507e5cdcaae1f08bd5daaf5e07fa2a1c89 Merge: 0916c65aba534 35b78409e1c7f Author: Paolo Abeni Date: Thu Oct 19 10:59:42 2023 +0200 Merge branch 'rswitch-add-pm-ops' Yoshihiro Shimoda says: ==================== rswitch: Add PM ops This patch is based on the latest net-next.git / next branch. After applied this patch with the following patches, the system can enter/exit Suspend to Idle without any error: https://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git/commit/?h=next&id=aa4c0bbf820ddb9dd8105a403aa12df57b9e5129 https://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git/commit/?h=next&id=1a5361189b7acac15b9b086b2300a11b7aa84c06 ==================== Link: https://lore.kernel.org/r/20231017113402.849735-1-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Paolo Abeni commit 35b78409e1c7fff0f209f0aed7297e9fca13351d Author: Yoshihiro Shimoda Date: Tue Oct 17 20:34:02 2023 +0900 rswitch: Add PM ops Add PM ops for Suspend to Idle. When the system suspended, the Ethernet Serdes's clock will be stopped. So, this driver needs to re-initialize the Ethernet Serdes by phy_init() in renesas_eth_sw_resume(). Otherwise, timeout happened in phy_power_on(). Signed-off-by: Yoshihiro Shimoda Reviewed-by: Simon Horman Signed-off-by: Paolo Abeni commit 1bf55630694e0a87be529801ad064daed36f25f3 Author: Yoshihiro Shimoda Date: Tue Oct 17 20:34:01 2023 +0900 rswitch: Use unsigned int for port related array index Array index should not be negative, so modify the condition of rswitch_for_each_enabled_port_continue_reverse() macro, and then use unsigned int instead. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Simon Horman Signed-off-by: Paolo Abeni commit efa1d1c6c8e4f89eedef9035d1f74fe98861eb30 Author: Chris Morgan Date: Wed Oct 18 10:33:57 2023 -0500 arm64: dts: rockchip: Remove UART2 from RGB30 The Powkiddy RGB30 has no onboard UART header, so remove the reference to it in the device tree. This was left on by mistake in the initial commit. Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20231018153357.343142-4-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 793e0d8988bc0e6bf2ff5c6df7fc81ec8c53a93e Author: Chris Morgan Date: Wed Oct 18 10:33:56 2023 -0500 arm64: dts: rockchip: Update VPLL Frequency for RGB30 Set the VPLL frequency for the RGB30 to 292.5MHz to support running the 720x720 display panel at 59.97hz. Without this change, the panel runs at 59.08hz. Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20231018153357.343142-3-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 4b7d3ab445653336db9854eedad812607760c015 Author: Wolfram Sang Date: Fri Sep 22 08:15:27 2023 +0200 MIPS: AR7: remove platform After a discussion about removing VLYNQ support from the Kernel, it was concluded that its only user, the AR7 platform can go [1]. Even OpenWRT has removed support because these devices are "stuck with 3.18" [2]. [1] https://lore.kernel.org/r/3395161f-2543-46f0-83d9-b918800305e1@gmail.com [2] https://openwrt.org/docs/techref/targets/ar7 Suggested-by: Jonas Gorski Signed-off-by: Wolfram Sang Acked-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer commit 1bc6e01372883354ffcd77714d8dc24c7fa4a2ed Author: Wolfram Sang Date: Fri Sep 22 08:15:25 2023 +0200 watchdog: ar7_wdt: remove driver to prepare for platform removal AR7 is going to be removed from the Kernel, so remove its watchdog support. This allows us to remove the platform because this driver includes a platform specific header. Signed-off-by: Wolfram Sang Acked-by: Florian Fainelli Acked-by: Guenter Roeck Signed-off-by: Thomas Bogendoerfer commit 9a6c782158f703fa65c7d52e2156b7d4e7cd41f5 Author: Wolfram Sang Date: Fri Sep 22 08:15:24 2023 +0200 vlynq: remove bus driver There are no users with a vlynq_driver in the Kernel tree. Also, only the AR7 platform ever initialized a VLYNQ bus, but AR7 is going to be removed from the Kernel. OpenWRT had some out-of-tree drivers which they probably intended to upport, but AR7 devices are even there not supported anymore because they are "stuck with Kernel 3.18" [1]. This code can go. [1] https://openwrt.org/docs/techref/targets/ar7 Signed-off-by: Wolfram Sang Acked-by: Greg Kroah-Hartman Acked-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer commit f10672800876be6e60b0b11d5939fcc9ab1b7050 Author: Wolfram Sang Date: Fri Sep 22 08:15:23 2023 +0200 mtd: parsers: ar7: remove support AR7 is going to be removed from the Kernel, so remove its support for MTD. Signed-off-by: Wolfram Sang Acked-by: Florian Fainelli Acked-by: Miquel Raynal Signed-off-by: Thomas Bogendoerfer commit b7a10da0268a5d255bebe1d8697dc3f0b26fc3e2 Author: Wolfram Sang Date: Fri Sep 22 08:15:22 2023 +0200 serial: 8250: remove AR7 support AR7 is going to be removed from the Kernel, so remove its type definition from 8250 code. As with previous removals, I checked with Debian Code Search that 'PORT_AR7' is not used in userspace. Signed-off-by: Wolfram Sang Acked-by: Florian Fainelli Acked-by: Greg Kroah-Hartman Signed-off-by: Thomas Bogendoerfer commit d5f4e1f2fcd85c3c361e73fa3c8f1b8fdb55ae0a Author: Peter Lafreniere Date: Mon Sep 18 17:57:10 2023 +0000 arch: mips: remove ReiserFS from defconfig ReiserFS has been deprecated for a year and a half, yet is still built as part of a defconfig kernel. According to commit eb103a51640e ("reiserfs: Deprecate reiserfs"), the filesystem is slated to be removed in 2025. Remove it from the defconfig profiles now, as part of its deprecation process. Signed-off-by: Peter Lafreniere Signed-off-by: Thomas Bogendoerfer commit aaf1f08ac0fb435100fa459a6ee5b292f3786dff Author: Bjorn Helgaas Date: Tue Oct 10 09:34:06 2023 -0500 MIPS: lantiq: Remove unnecessary include of arch/mips/pci/fixup-lantiq.c requires nothing from , so remove the include of it. Signed-off-by: Bjorn Helgaas Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Bogendoerfer commit f2f12cf4e5f6173febc8db8c3e533141b0e667a4 Author: Bjorn Helgaas Date: Tue Oct 10 09:34:05 2023 -0500 MIPS: lantiq: Fix pcibios_plat_dev_init() "no previous prototype" warning After bbd8810d3998 ("PCI: Remove unused includes and superfluous struct declaration"), no longer includes , which provides the extern declarations for pcibios_plat_dev_init() and pcibios_map_irq() via . This results in these new warnings: arch/mips/pci/fixup-lantiq.c:13:5: warning: no previous prototype for 'pcibios_plat_dev_init' [-Wmissing-prototypes] arch/mips/pci/fixup-lantiq.c:24:5: warning: no previous prototype for 'pcibios_map_irq' [-Wmissing-prototypes] Include directly to get these declarations. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310070445.tzRBNYRC-lkp@intel.com/ Signed-off-by: Bjorn Helgaas Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Bogendoerfer commit 83767a67e7b6a0291cde5681ec7e3708f3f8f877 Author: Huacai Chen Date: Tue Oct 10 16:54:34 2023 +0800 MIPS: KVM: Fix a build warning about variable set but not used After commit 411740f5422a ("KVM: MIPS/MMU: Implement KVM_CAP_SYNC_MMU") old_pte is no longer used in kvm_mips_map_page(). So remove it to fix a build warning about variable set but not used: arch/mips/kvm/mmu.c: In function 'kvm_mips_map_page': >> arch/mips/kvm/mmu.c:701:29: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable] 701 | pte_t *ptep, entry, old_pte; | ^~~~~~~ Cc: stable@vger.kernel.org Fixes: 411740f5422a960 ("KVM: MIPS/MMU: Implement KVM_CAP_SYNC_MMU") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310070530.aARZCSfh-lkp@intel.com/ Signed-off-by: Huacai Chen Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Bogendoerfer commit 6b180f66c0dd6266eeb2f74b59ee79a9f14fe430 Author: Thomas Zimmermann Date: Wed Sep 27 09:26:34 2023 +0200 fbdev: Provide I/O-memory helpers as module Provide helpers for accessing I/O memory in a helper module. The fbdev core uses these helpers, so select the module unconditionally for fbdev. Drivers will later be able to select the module individually and the helpers will become optional. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-2-tzimmermann@suse.de commit 05ac1a198a63ad66bf5ae8b7321407c102d40ef3 Author: Ajay Singh Date: Tue Oct 17 10:43:38 2023 +0200 wifi: wilc1000: use vmm_table as array in wilc struct Enabling KASAN and running some iperf tests raises some memory issues with vmm_table: BUG: KASAN: slab-out-of-bounds in wilc_wlan_handle_txq+0x6ac/0xdb4 Write of size 4 at addr c3a61540 by task wlan0-tx/95 KASAN detects that we are writing data beyond range allocated to vmm_table. There is indeed a mismatch between the size passed to allocator in wilc_wlan_init, and the range of possible indexes used later: allocation size is missing a multiplication by sizeof(u32) Fixes: 40b717bfcefa ("wifi: wilc1000: fix DMA on stack objects") Cc: stable@vger.kernel.org Signed-off-by: Ajay Singh Signed-off-by: Alexis Lothoré Reviewed-by: Michael Walle Reviewed-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231017-wilc1000_tx_oops-v3-1-b2155f1f7bee@bootlin.com commit 2f4ae0feab8b5a60a936a3eff2b4ee78a5380e33 Author: Dmitry Antipov Date: Mon Oct 16 16:59:10 2023 +0300 wifi: rtlwifi: drop chk_switch_dmdp() from HAL interface Since there is no chip-specific code behind 'chk_switch_dmdp()', there is no need to maintain function pointer in 'struct rtl_hal_ops' and relevant common code may be simplified. Compile tested only. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231016135925.129223-3-dmantipov@yandex.ru commit 9e58030622d01a781575bbf43e2ea5c45c6c8faf Author: Dmitry Antipov Date: Mon Oct 16 16:59:09 2023 +0300 wifi: rtlwifi: drop fill_fake_txdesc() from HAL interface Since 'fill_fake_txdesc()' is actually implemented for rtl8192cu only but never used, there is no need to maintain function pointer in 'struct rtl_hal_ops' and 'rtl92cu_fill_fake_txdesc()' may be dropped. Compile tested only. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231016135925.129223-2-dmantipov@yandex.ru commit fc83ee9d587ffe8e7edd00c32d443c7b5ebbf1c5 Author: Dmitry Antipov Date: Mon Oct 16 16:59:08 2023 +0300 wifi: rtlwifi: drop pre_fill_tx_bd_desc() from HAL interface Since 'pre_fill_tx_bd_desc()' is actually used for rtl8192ee only, there is no need to maintain function pointer in 'struct rtl_hal_ops', and 'rtl92ee_pre_fill_tx_bd_desc()' may be converted to static. Compile tested only. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231016135925.129223-1-dmantipov@yandex.ru commit 388df37938da70d68a6c115c8800f62533c0afb5 Author: Cheng-Chieh Hsieh Date: Mon Oct 16 14:51:15 2023 +0800 wifi: rtw89: move software DCFO compensation setting to proper position We need this register setting only for the software DCFO(digital carrier frequency offset) compensation so we move it to the proper position to prevent the incorrect setting. Signed-off-by: Cheng-Chieh Hsieh Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231016065115.751662-6-pkshih@realtek.com commit aecc60e7d3ab3f5cf6189c204efb205b1d541b38 Author: Cheng-Chieh Hsieh Date: Mon Oct 16 14:51:14 2023 +0800 wifi: rtw89: correct the DCFO tracking flow to improve CFO compensation DCFO tracking compensate the CFO (carrier frequency offset) by digital hardware that provides fine CFO estimation. Although the avg_cfo which is a coarse information becomes zero, still we need DCFO tracking to compensate the residual CFO. However, the original flow skips the case when avg_cfo is zero, so we fix it to have expected performance. Signed-off-by: Cheng-Chieh Hsieh Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231016065115.751662-5-pkshih@realtek.com commit 5d2f3c3aaaa680e893b22584a75d9ab27b67e2cd Author: Cheng-Chieh Hsieh Date: Mon Oct 16 14:51:13 2023 +0800 wifi: rtw89: modify the register setting and the flow of CFO tracking The register address used for CFO(carrier frequency offset) tracking is different from WiFi 7 series, so we change the way to access it. And we refine the flow of CFO tracking to compatible all WiFi 7 and 6 ICs. Signed-off-by: Cheng-Chieh Hsieh Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231016065115.751662-4-pkshih@realtek.com commit 4ba17aa476e2b58f0ee73f6b6a7415dd90168d86 Author: Ping-Ke Shih Date: Mon Oct 16 14:51:12 2023 +0800 wifi: rtw89: phy: generalize valid bit of BSS color The register fields of BSS color map and valid bit are in the same register for existing chips, but coming WiFi 7 chips define another register to set valid bit, so add a field to chip_info to reuse the code. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231016065115.751662-3-pkshih@realtek.com commit 2901bbd26668ba614faf41f83dda0ce2b0ad3a16 Author: Chung-Hsuan Hung Date: Mon Oct 16 14:51:11 2023 +0800 wifi: rtw89: phy: change naming related BT coexistence functions Change naming to disambiguate the functions because their names are common and not clear about the purpose. Not change logic at all. These functions are to control baseband AGC while BT coexists with WiFi. Among these functions, ctrl_btg_bt_rx is used to control AGC related settings, which is affected by BT RX, while BT shares the same path with wifi; ctrl_nbtg_bt_tx is used to control AGC settings under non-shared path condition, which is affected by BT TX. Signed-off-by: Chung-Hsuan Hung Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231016065115.751662-2-pkshih@realtek.com commit 20907fc069976fcf972239b7b253cf7c59c08a14 Author: Chin-Yen Lee Date: Mon Oct 16 13:35:54 2023 +0800 wifi: rtw88: dump firmware debug information in abnormal state Sometimes firmware may enter strange state or infinite loop due to unknown bug, and then it will lead critical function fail, such as sending H2C command or changing power mode. In these abnormal states, we add more debug information, including hardware register status, to help further investigation. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231016053554.744180-3-pkshih@realtek.com commit 1926a27299db00239d6bdc4c3f2bd3f842277d0d Author: Chin-Yen Lee Date: Mon Oct 16 13:35:53 2023 +0800 wifi: rtw88: debug: add to check if debug mask is enabled The coming dump function for FW malfunction will add a function to dump registers to reflect status. However, if we are not debugging the mechanism, we don't print anything, so avoid reading registers by checking debug mask to reduce IO. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231016053554.744180-2-pkshih@realtek.com commit 9a66e73094add3d5f330db83982aa20591189fcc Author: Dmitry Antipov Date: Fri Oct 13 15:45:31 2023 +0300 wifi: rtlwifi: cleanup struct rtl_ps_ctl Remove set but otherwise unused 'sleep_ms', 'last_action', 'state' and 'last_slept' members of 'struct rtl_ps_ctl' (these seems to be a leftovers from some older code) and adjust 'rtl_swlps_wq_callback()' accordingly. Compile tested only. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231013124534.19714-1-dmantipov@yandex.ru commit a86a8ca798e9c3037c04011c993a92c173fba0c2 Author: Randy Dunlap Date: Thu Oct 12 15:08:55 2023 -0700 ssb: relax SSB_EMBEDDED dependencies This is a kconfig warning in a randconfig when CONFIG_PCI is not set: WARNING: unmet direct dependencies detected for SSB_EMBEDDED Depends on [n]: SSB [=y] && SSB_DRIVER_MIPS [=y] && SSB_PCICORE_HOSTMODE [=n] Selected by [y]: - BCM47XX_SSB [=y] && BCM47XX [=y] This is caused by arch/mips/bcm47xx/Kconfig's symbol BCM47XX_SSB selecting SSB_EMBEDDED when CONFIG_PCI is not set. This warning can be prevented by altering SSB_EMBEDDED to allow for PCI=n or the former SSB_PCICORE_HOSTMODE. Signed-off-by: Randy Dunlap Acked-by: Michael Büsch Cc: linux-wireless@vger.kernel.org Cc: Kalle Valo Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231012220856.23260-1-rdunlap@infradead.org commit 07f06e0e5cd99555c861e874716d9e2627655fd5 Author: Junxian Huang Date: Tue Oct 17 20:52:39 2023 +0800 RDMA/hns: Fix init failure of RoCE VF and HIP08 During device init, a struct for HW stats will be allocated. As HW stats are not supported for VF and HIP08, currently hns_roce_alloc_hw_port_stats() returns NULL in this case. However, ib-core considers the returned NULL pointer as memory allocation failure and returns ENOMEM, eventually leading to the failure of VF and HIP08 init. In the case where the driver does not support the .alloc_hw_port_stats() ops, ib-core will return EOPNOTSUPP and ignore this error code in the upper layer function. So for VF and HIP08, just don't set the HW stats ops to ib-core. Fixes: 5a87279591a1 ("RDMA/hns: Support hns HW stats") Signed-off-by: Junxian Huang Link: https://lore.kernel.org/r/20231017125239.164455-8-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit b4a797b894dc91a541ea230db6fa00cc74683bfd Author: Junxian Huang Date: Tue Oct 17 20:52:38 2023 +0800 RDMA/hns: Fix unnecessary port_num transition in HW stats allocation The num_ports capability of devices should be compared with the number of port(i.e. the input param "port_num") but not the port index(i.e. port_num - 1). Fixes: 5a87279591a1 ("RDMA/hns: Support hns HW stats") Signed-off-by: Junxian Huang Link: https://lore.kernel.org/r/20231017125239.164455-7-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit 27c5fd271d8b8730fc0bb1b6cae953ad7808a874 Author: Luoyouming Date: Tue Oct 17 20:52:37 2023 +0800 RDMA/hns: The UD mode can only be configured with DCQCN Due to hardware limitations, only DCQCN is supported for UD. Therefore, the default algorithm for UD is set to DCQCN. Fixes: f91696f2f053 ("RDMA/hns: Support congestion control type selection according to the FW") Signed-off-by: Luoyouming Signed-off-by: Junxian Huang Link: https://lore.kernel.org/r/20231017125239.164455-6-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit 5e617c18b1f34ec57ad5dce44f09de603cf6bd6c Author: Luoyouming Date: Tue Oct 17 20:52:36 2023 +0800 RDMA/hns: Add check for SL SL set by users may exceed the capability of devices. So add check for this situation. Fixes: fba429fcf9a5 ("RDMA/hns: Fix missing fields in address vector") Fixes: 70f92521584f ("RDMA/hns: Use the reserved loopback QPs to free MR before destroying MPT") Fixes: f0cb411aad23 ("RDMA/hns: Use new interface to modify QP context") Signed-off-by: Luoyouming Signed-off-by: Junxian Huang Link: https://lore.kernel.org/r/20231017125239.164455-5-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit b5f9efff101b06fd06a5e280a2b00b1335f5f476 Author: Chengchang Tang Date: Tue Oct 17 20:52:35 2023 +0800 RDMA/hns: Fix signed-unsigned mixed comparisons The ib_mtu_enum_to_int() and uverbs_attr_get_len() may returns a negative value. In this case, mixed comparisons of signed and unsigned types will throw wrong results. This patch adds judgement for this situation. Fixes: 30b707886aeb ("RDMA/hns: Support inline data in extented sge space for RC") Signed-off-by: Chengchang Tang Signed-off-by: Junxian Huang Link: https://lore.kernel.org/r/20231017125239.164455-4-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit c64e9710f9241e38a1c761ed1c1a30854784da66 Author: Chengchang Tang Date: Tue Oct 17 20:52:34 2023 +0800 RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common() ucmd in hns_roce_create_qp_common() are not initialized. But it works fine until new member sdb_addr is added to struct hns_roce_ib_create_qp. If the user-mode driver uses an old version ABI, then the value of the new member will be undefined after ib_copy_from_udata(). This patch fixes it by initialize this variable to 0. And the default value of the new member sdb_addr will be 0 which is invalid. Fixes: 0425e3e6e0c7 ("RDMA/hns: Support flush cqe for hip08 in kernel space") Signed-off-by: Chengchang Tang Signed-off-by: Junxian Huang Link: https://lore.kernel.org/r/20231017125239.164455-3-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit 9faef73ef4f6666b97e04d99734ac09251098185 Author: Chengchang Tang Date: Tue Oct 17 20:52:33 2023 +0800 RDMA/hns: Fix printing level of asynchronous events The current driver will print all asynchronous events. Some of the print levels are set improperly, e.g. SRQ limit reach and SRQ last wqe reach, which may also occur during normal operation of the software. Currently, the information of these event is printed as a warning, which causes a large amount of printing even during normal use of the application. As a result, the service performance deteriorates. This patch fixes the printing storms by modifying the print level. Fixes: b00a92c8f2ca ("RDMA/hns: Move all prints out of irq handle") Signed-off-by: Chengchang Tang Signed-off-by: Junxian Huang Link: https://lore.kernel.org/r/20231017125239.164455-2-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit 35e0964e4876c4d77ed0d6d49678f7f6270f32e2 Author: Christian Marangi Date: Fri Oct 13 19:38:52 2023 +0200 dt-bindings: opp: opp-v2-kryo-cpu: Document named opp-microvolt property Document named opp-microvolt property for opp-v2-kryo-cpu schema. This property is used to declare multiple voltage ranges selected on the different values read from efuses. The selection is done based on the speed pvs values and the named opp-microvolt property is selected by the qcom-cpufreq-nvmem driver. Signed-off-by: Christian Marangi Reviewed-by: Rob Herring Signed-off-by: Viresh Kumar commit 465d6b42f1a3b855c06da1d4d3b09907d261af69 Author: Patrisious Haddad Date: Mon Oct 9 13:43:58 2023 +0300 RDMA/core: Add support to set privileged QKEY parameter Add netlink command that enables/disables privileged QKEY by default. It is disabled by default, since according to IB spec only privileged users are allowed to use privileged QKEY. According to the IB specification rel-1.6, section 3.5.3: "QKEYs with the most significant bit set are considered controlled QKEYs, and a HCA does not allow a consumer to arbitrarily specify a controlled QKEY." Using rdma tool, $rdma system set privileged-qkey on When enabled non-privileged users would be able to use controlled QKEYs which are considered privileged. Using rdma tool, $rdma system set privileged-qkey off When disabled only privileged users would be able to use controlled QKEYs. You can also use the command below to check the parameter state: $rdma system show netns shared privileged-qkey off copy-on-fork on Signed-off-by: Patrisious Haddad Link: https://lore.kernel.org/r/90398be70a9d23d2aa9d0f9fd11d2c264c1be534.1696848201.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit b28d1ccf921a4333be14017d82066386d419e638 Author: Stanislav Kinsburskii Date: Sat Apr 15 04:17:53 2023 -0700 powerpc/io: Expect immutable pointer in virt_to_phys() prototype virt_to_phys() doesn't need the address pointer to be mutable. At the same time allowing it to be mutable leads to the following build warning for constant pointers: warning: passing argument 1 of ‘virt_to_phys’ discards ‘const’ qualifier from pointer target type Signed-off-by: Stanislav Kinsburskii Reviewed-by: Linus Walleij Signed-off-by: Michael Ellerman Link: https://msgid.link/168155747391.13678.10634415747614468991.stgit@skinsburskii.localdomain commit 6db51ff905362e6c79593dbda08f61f24b25971c Author: Yang Yingliang Date: Thu Jan 5 14:41:45 2023 +0800 macintosh/macio-adb: add missing iounmap() on error in macio_init() Add missing iounmap(), if request_irq() fails. Signed-off-by: Yang Yingliang Signed-off-by: Michael Ellerman Link: https://msgid.link/20230105064145.3879356-1-yangyingliang@huawei.com commit b574b817cc7bfcc87bbc92b4b19525442401ae5e Author: Benjamin Gray Date: Wed Oct 11 16:37:11 2023 +1100 powerpc/fadump: Annotate endianness cast with __force Sparse reports an endianness error with the else case of val = (cpu_endian ? be64_to_cpu(reg_entry->reg_val) : (u64)(reg_entry->reg_val)); This is a safe operation because the code is explicitly working with dynamic endianness, so add the __force annotation to tell Sparse to ignore it. Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20231011053711.93427-13-bgray@linux.ibm.com commit 82f635243f209a85d3deb9f64439c3ea84cd4ecb Author: Benjamin Gray Date: Wed Oct 11 16:37:10 2023 +1100 powerpc/eeh: Remove unnecessary cast Sparse reports a warning when casting to an int. There is no need to cast in the first place, so drop them. Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20231011053711.93427-12-bgray@linux.ibm.com commit 2c4ce3e65b1a543123ffcec4b021ad6ebd4e4e4e Author: Benjamin Gray Date: Wed Oct 11 16:37:09 2023 +1100 powerpc: Cast away __iomem in low level IO routines Sparse reports dereferencing an __iomem pointer. These routines are clearly low level handlers for IO memory, so force cast away the __iomem annotation to tell sparse the dereferences are safe. Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20231011053711.93427-11-bgray@linux.ibm.com commit c6519c6df0722e432f330afbc7c00d16d5be5c58 Author: Benjamin Gray Date: Wed Oct 11 16:37:08 2023 +1100 powerpc/uaccess: Cast away __user annotation after verification Sparse reports dereference of a __user pointer. copy_mc_to_user() takes a __user pointer, verifies it, then calls the generic copy routine copy_mc_generic(). As we have verified the pointer, cast out the __user annotation when passing to copy_mc_generic(). Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20231011053711.93427-10-bgray@linux.ibm.com commit 8577dd00a6ba335bc359313599d6100522a1931c Author: Benjamin Gray Date: Wed Oct 11 16:37:07 2023 +1100 powerpc/opal: Annotate out param endianness Sparse reports an endian mismatch with args to opal_int_get_xirr(). Checking the skiboot source[1] shows the function takes a __be32* (as expected), so update the function declaration to reflect this. [1]: https://github.com/open-power/skiboot/blob/80e2b1dc73/hw/xive.c#L3479 Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20231011053711.93427-9-bgray@linux.ibm.com commit b7bce570430e42229fb63f775fcbb10f38b83c71 Author: Benjamin Gray Date: Wed Oct 11 16:37:06 2023 +1100 powerpc/kvm: Force cast endianness of KVM shared regs Sparse reports endianness mismatches in the KVM shared regs getter and setter helpers. This code has dynamic endianness behind a safe interface, so a force is warranted here to tell sparse this is OK. Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20231011053711.93427-8-bgray@linux.ibm.com commit 2b4a6cc9a1a7cf6958c8b11f94e61c8e81b60b88 Author: Benjamin Gray Date: Wed Oct 11 16:37:05 2023 +1100 powerpc: Annotate endianness of various variables and functions Sparse reports several endianness warnings on variables and functions that are consistently treated as big endian. There are no multi-endianness shenanigans going on here so fix these low hanging fruit up in one patch. All changes are just type annotations; no endianness switching operations are introduced by this patch. Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20231011053711.93427-7-bgray@linux.ibm.com commit 419d5d112c2e1e78beda9c3299f71c35141d8dba Author: Benjamin Gray Date: Wed Oct 11 16:37:04 2023 +1100 powerpc: Remove extern from function implementations Sparse reports several function implementations annotated with extern. This is clearly incorrect, likely just copied from an actual extern declaration in another file. Fix the sparse warnings by removing extern. Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20231011053711.93427-6-bgray@linux.ibm.com commit ddfb7d9db843fd4fbdff81fb8a8743f865c3dd96 Author: Benjamin Gray Date: Wed Oct 11 16:37:03 2023 +1100 powerpc: Use NULL instead of 0 for null pointers Sparse reports several uses of 0 for pointer arguments and comparisons. Replace with NULL to better convey the intent. Remove entirely if a comparison to follow the kernel style of implicit boolean conversions. Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20231011053711.93427-5-bgray@linux.ibm.com commit 340a60e3725b9a229eaf03a9b3f8538f22f6ac16 Author: Benjamin Gray Date: Wed Oct 11 16:37:02 2023 +1100 powerpc: Explicitly reverse bytes when checking for byte reversal Sparse reports an invalid endian cast here. The code is written for big endian platforms, so le32_to_cpu() acts as a byte reversal. This file is checked by sparse on a little endian build though, so replace the reverse function with the dedicated swab32() function to better express the intent of the code. Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20231011053711.93427-4-bgray@linux.ibm.com commit ff7a60ab1e065257a0e467c13b519f4debcd7fcf Author: Benjamin Gray Date: Wed Oct 11 16:37:00 2023 +1100 powerpc/xive: Fix endian conversion size Sparse reports a size mismatch in the endian swap. The Opal implementation[1] passes the value as a __be64, and the receiving variable out_qsize is a u64, so the use of be32_to_cpu() appears to be an error. [1]: https://github.com/open-power/skiboot/blob/80e2b1dc73/hw/xive.c#L3854 Fixes: 88ec6b93c8e7 ("powerpc/xive: add OPAL extensions for the XIVE native exploitation support") Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20231011053711.93427-2-bgray@linux.ibm.com commit b1fba034a6793e9601d581594a781b46c255471f Author: Christophe Leroy Date: Mon Sep 25 20:31:51 2023 +0200 powerpc: Support execute-only on all powerpc Introduce PAGE_EXECONLY_X macro which provides exec-only rights. The _X may be seen as redundant with the EXECONLY but it helps keep consistency, all macros having the EXEC right have _X. And put it next to PAGE_NONE as PAGE_EXECONLY_X is somehow PAGE_NONE + EXEC just like all other SOMETHING_X are just SOMETHING + EXEC. On book3s/64 PAGE_EXECONLY becomes PAGE_READONLY_X. On book3s/64, as PAGE_EXECONLY is only valid for Radix add VM_READ flag in vm_get_page_prot() for non-Radix. And update access_error() so that a non exec fault on a VM_EXEC only mapping is always invalid, even when the underlying layer don't always generate a fault for that. For 8xx, set PAGE_EXECONLY_X as _PAGE_NA | _PAGE_EXEC. For others, only set it as just _PAGE_EXEC With that change, 8xx, e500 and 44x fully honor execute-only protection. On 40x that is a partial implementation of execute-only. The implementation won't be complete because once a TLB has been loaded via the Instruction TLB miss handler, it will be possible to read the page. But at least it can't be read unless it is executed first. On 603 MMU, TLB missed are handled by SW and there are separate DTLB and ITLB. Execute-only is therefore now supported by not loading DTLB when read access is not permitted. On hash (604) MMU it is more tricky because hash table is common to load/store and execute. Nevertheless it is still possible to check whether _PAGE_READ is set before loading hash table for a load/store access. At least it can't be read unless it is executed first. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/4283ea9cbef9ff2fbee468904800e1962bc8fc18.1695659959.git.christophe.leroy@csgroup.eu commit 163a72fa89161b57b05d848aedfbd5103fac9dd7 Author: Christophe Leroy Date: Mon Sep 25 20:31:50 2023 +0200 powerpc: Finally remove _PAGE_USER _PAGE_USER is now gone on all targets. Remove it completely. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/76ebe74fdaed4297a1d8203a61174650c1d8d278.1695659959.git.christophe.leroy@csgroup.eu commit ceaba662c06598e52cbe4b90fef6b71b7f965cf9 Author: Christophe Leroy Date: Mon Sep 25 20:31:49 2023 +0200 powerpc/ptdump: Display _PAGE_READ and _PAGE_WRITE Instead of always displaying either 'rw' or 'r ' depending on _PAGE_RW, display 'r' or ' ' for _PAGE_READ and 'w' or ' ' for _PAGE_WRITE. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/dd8201a0f8fd87ce62a7ff2edc958b604b8ec3c0.1695659959.git.christophe.leroy@csgroup.eu commit bac4cffc7c4a009cf0d16f1785a275e0a7715e8d Author: Christophe Leroy Date: Mon Sep 25 20:31:48 2023 +0200 powerpc/32s: Introduce _PAGE_READ and remove _PAGE_USER On 603 MMU, TLB missed are handled by SW and there are separated DTLB and ITLB. It is therefore possible to implement execute-only protection by not loading DTLB when read access is not permitted. To do that, _PAGE_READ flag is needed but there is no bit available for it in PTE. On the other hand the only real use of _PAGE_USER is to implement PAGE_NONE by clearing _PAGE_USER. As _PAGE_NONE can also be implemented by clearing _PAGE_READ, remove _PAGE_USER and add _PAGE_READ. Then use the virtual address to know whether user rights or kernel rights are to be used. With that change, 603 MMU now honors execute-only protection. For hash (604) MMU it is more tricky because hash table is common to load/store and execute. Nevertheless it is still possible to check whether _PAGE_READ is set before loading hash table for a load/store access. At least it can't be read unless it is executed first. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/b7702dd5a041ec59055ed2880f4952e94c087a2e.1695659959.git.christophe.leroy@csgroup.eu commit 46ebef51fd92f52ba7dca21d3c4332e4127de515 Author: Christophe Leroy Date: Mon Sep 25 20:31:47 2023 +0200 powerpc/32s: Add _PAGE_WRITE to supplement _PAGE_RW Several places, _PAGE_RW maps to write permission and don't always imply read. To make it more clear, do as book3s/64 in commit c7d54842deb1 ("powerpc/mm: Use _PAGE_READ to indicate Read access") and use _PAGE_WRITE when more relevant. For the time being _PAGE_WRITE is equivalent to _PAGE_RW but that will change when _PAGE_READ gets added in following patches. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/5798782869fe4d2698f104948dabd17657b89395.1695659959.git.christophe.leroy@csgroup.eu commit ed815bd3fe9b14a742e2ae094f7f55f70918dbbc Author: Christophe Leroy Date: Mon Sep 25 20:31:46 2023 +0200 powerpc/40x: Introduce _PAGE_READ and remove _PAGE_USER _PAGE_USER is used to select the zone. Today zone 0 is kernel and zone 1 is user. To implement _PAGE_NONE, _PAGE_USER is cleared, leading to no access for user but kernel still has access to the page so it's possible for a user application to write in that page by using a kernel function as trampoline. What is really wanted is to have user rights on pages below TASK_SIZE and no user rights on pages above TASK_SIZE. Use zones for that. There are 16 zones so lets use the 4 upper address bits to set the zone and declare zone rights based on TASK_SIZE. Then drop _PAGE_USER and reuse it as _PAGE_READ that will be checked in Data TLB miss handler. That will properly handle PAGE_NONE for both kernel and user. In addition, it partially implements execute-only right. The implementation won't be complete because once a TLB has been loaded via the Instruction TLB miss handler, it will be possible to read the page. But at least it can't be read unless it is executed first. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/2a13e3ba8a5dec43143cc1f9a91ec71ea1529f3c.1695659959.git.christophe.leroy@csgroup.eu commit 93820bfeefc4a125a6cedd1ee1a956eeb3eb2580 Author: Christophe Leroy Date: Mon Sep 25 20:31:45 2023 +0200 powerpc/44x: Introduce _PAGE_READ and remove _PAGE_USER 44x MMU has 6 page protection bits: - R, W, X for supervisor - R, W, X for user It means that it can support X without R. To do that, _PAGE_READ flag is needed but there is no bit available for it in PTE. On the other hand the only real use of _PAGE_USER is to implement PAGE_NONE by clearing _PAGE_USER. As _PAGE_NONE can also be implemented by clearing _PAGE_READ, remove _PAGE_USER and add _PAGE_READ. In order to insert bits in one go during TLB miss, move _PAGE_ACCESSED and put _PAGE_READ just after _PAGE_DIRTY so that _PAGE_DIRTY is copied into SW and _PAGE_READ into SR at once. With that change, 44x now also honors execute-only protection. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/043e17987b260b99b45094138c6cb2e89e63d499.1695659959.git.christophe.leroy@csgroup.eu commit 48cf93bb168d506a8278a6fb25c2f88c1c93ce6e Author: Christophe Leroy Date: Mon Sep 25 20:31:44 2023 +0200 powerpc/e500: Introduce _PAGE_READ and remove _PAGE_USER e500 MMU has 6 page protection bits: - R, W, X for supervisor - R, W, X for user It means that it can support X without R. To do that, _PAGE_READ flag is needed. With 32 bits PTE there is no bit available for it in PTE. On the other hand the only real use of _PAGE_USER is to implement PAGE_NONE by clearing _PAGE_USER. As _PAGE_NONE can also be implemented by clearing _PAGE_READ, remove _PAGE_USER and add _PAGE_READ. Move _PAGE_PRESENT into bit 30 so that _PAGE_READ can match SR bit. With 64 bits PTE _PAGE_USER is already the combination of SR and UR so all we need to do is to rename it _PAGE_READ. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/0849ab6bf7ae2af23f94b0457fa40d0ea3983fe4.1695659959.git.christophe.leroy@csgroup.eu commit 8e9bd41e4ce1001f5b89e4c9a69f870f39d56c12 Author: Christophe Leroy Date: Mon Sep 25 20:31:43 2023 +0200 powerpc/nohash: Replace pte_user() by pte_read() pte_user() is now only used in pte_access_permitted() to check access on vmas. User flag is cleared to make a page unreadable. So rename it pte_read() and remove pte_user() which isn't used anymore. For the time being it checks _PAGE_USER but in the near futur all plateforms will be converted to _PAGE_READ so lets support both for now. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/72cbb5be595e9ef884140def73815ed0b0b37010.1695659959.git.christophe.leroy@csgroup.eu commit d20506d4728c3b7408e84d9aececbcb78c3061ee Author: Christophe Leroy Date: Mon Sep 25 20:31:42 2023 +0200 powerpc/nohash: Add _PAGE_WRITE to supplement _PAGE_RW Several places, _PAGE_RW maps to write permission and don't always imply read. To make it more clear, do as book3s/64 in commit c7d54842deb1 ("powerpc/mm: Use _PAGE_READ to indicate Read access") and use _PAGE_WRITE when more relevant. For the time being _PAGE_WRITE is equivalent to _PAGE_RW but that will change when _PAGE_READ gets added in following patches. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/1f79b88db54d030ada776dc9845e0e88345bfc28.1695659959.git.christophe.leroy@csgroup.eu commit 58f534623c4d8800c2e5d63da9783530848e570c Author: Christophe Leroy Date: Mon Sep 25 20:31:41 2023 +0200 powerpc/64s: Use generic permission masks book3s64 need specific masks because it needs _PAGE_PRIVILEGED for PAGE_NONE. book3s64 already has _PAGE_RW and _PAGE_RWX. So add _PAGE_NA, _PAGE_RO and _PAGE_ROX and remove specific permission masks. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/d37a418de52e2c950cad6797e81663b56991366f.1695659959.git.christophe.leroy@csgroup.eu commit f9f09b93e80148fc5824afb338c318272abde529 Author: Christophe Leroy Date: Mon Sep 25 20:31:40 2023 +0200 powerpc/8xx: Use generic permission masks 8xx already has _PAGE_NA and _PAGE_RO. So add _PAGE_ROX, _PAGE_RW and _PAGE_RWX and remove specific permission masks. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/5d0b5ce43485f697313eee4326ddff97157fb219.1695659959.git.christophe.leroy@csgroup.eu commit a5a08dc90f4513d1a78582ec24b687fad01cc843 Author: Christophe Leroy Date: Mon Sep 25 20:31:39 2023 +0200 powerpc: Refactor permission masks used for __P/__S table and kernel memory flags Prepare a common version of the permission masks that will be based on _PAGE_NA, _PAGE_RO, _PAGE_ROX, _PAGE_RW, _PAGE_RWX that will be defined in platform specific headers in later patches. Put them in a new header pgtable-masks.h which will be included by platforms. And prepare a common version of flags used for mapping kernel memory that will be based on _PAGE_RO, _PAGE_ROX, _PAGE_RW, _PAGE_RWX that will be defined in platform specific headers. Put them in unless _PAGE_KERNEL_RO is already defined so that platform specific definitions can be dismantled one by one. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/d31b59efcdb38e675479563307af891aeadf6ec9.1695659959.git.christophe.leroy@csgroup.eu commit a78587473642aec302697cdaceb719a7f8791369 Author: Christophe Leroy Date: Mon Sep 25 20:31:38 2023 +0200 powerpc: Rely on address instead of pte_user() pte_user() may return 'false' when a user page is PAGE_NONE. In that case it is still a user page and needs to be handled as such. So use is_kernel_addr() instead. And remove "user" text from ptdump as ptdump only dumps kernel tables. Note: no change done for book3s/64 which still has it 'priviledge' bit. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/c778dad89fad07727c31717a9c62f45357c29ebc.1695659959.git.christophe.leroy@csgroup.eu commit 69339071bb27f0b1371cd23d6dada3f976261c20 Author: Christophe Leroy Date: Mon Sep 25 20:31:37 2023 +0200 powerpc: Remove pte_mkuser() and pte_mkpriviledged() pte_mkuser() is never used. Remove it. pte_mkpriviledged() is not used anymore. Remove it too. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/1a1dc18816456c637dc8a9c38d532f7598b60ac4.1695659959.git.christophe.leroy@csgroup.eu commit c7263f156395d1f2a2142375a75b7b040686a07a Author: Christophe Leroy Date: Mon Sep 25 20:31:36 2023 +0200 powerpc: Fail ioremap() instead of silently ignoring flags when PAGE_USER is set Calling ioremap() with _PAGE_USER (or _PAGE_PRIVILEDGE unset) is wrong. Loudly fail the call to ioremap() instead of blindly clearing the flags. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/b6dd5485ad00d2aafd2bb9b7c2c4eac3ebf2cdaf.1695659959.git.christophe.leroy@csgroup.eu commit d3c0dfcfc95796701e82719722fd997ec5256013 Author: Christophe Leroy Date: Mon Sep 25 20:31:35 2023 +0200 powerpc: Implement and use pgprot_nx() ioremap_page_range() calls pgprot_nx() vmap() and vmap_pfn() clear execute permission by calling pgprot_nx(). When pgprot_nx() is not defined it falls back to a nop. Implement it for powerpc then use it in early_ioremap_range(). Then the call to pte_exprotect() can be removed from ioremap_prot(). Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/5993a7a097e989af1c97fc4a6c011fefc67dbe6e.1695659959.git.christophe.leroy@csgroup.eu commit 4c8dd6c9872d4e89fd2b3a6fc92fd6cc9cdce347 Author: Christophe Leroy Date: Mon Sep 25 20:31:34 2023 +0200 powerpc/e500: Simplify pte_mkexec() Commit b6cb20fdc273 ("powerpc/book3e: Fix set_memory_x() and set_memory_nx()") implemented a more elaborated version of pte_mkwrite() suitable for both kernel and user pages. That was needed because set_memory_x() was using pte_mkwrite(). But since commit a4c182ecf335 ("powerpc/set_memory: Avoid spinlock recursion in change_page_attr()") pte_mkwrite() is not used anymore by set_memory_x() so pte_mkwrite() can be simplified as it is only used for user pages. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/cdc822322fe2ff4b0f5ecfde71d09d950b1c7557.1695659959.git.christophe.leroy@csgroup.eu commit 799d8836a7c4f4327833e4a5ca952a1700acdb14 Author: Christophe Leroy Date: Mon Sep 25 20:31:33 2023 +0200 powerpc/nohash: Refactor __ptep_set_access_flags() nohash/32 version of __ptep_set_access_flags() does the same as nohash/64 version, the only difference is that nohash/32 version is more complete and uses pte_update(). Make it common and remove the nohash/64 version. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/e296885df46289d3e5f4cb51efeefe593f76ef24.1695659959.git.christophe.leroy@csgroup.eu commit 2ef9f4bb9c47ed30ff3c7961744cae545c034154 Author: Christophe Leroy Date: Mon Sep 25 20:31:32 2023 +0200 powerpc/nohash: Refactor pte_clear() pte_clear() are doing the same on nohash/32 and nohash/64, Keep the static inline version of nohash/64, make it common and remove the macro version of nohash/32. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/818f7df83d7e9e18f55e274cd3c44f2871ade4dd.1695659959.git.christophe.leroy@csgroup.eu commit cc68d77febe055b6499dda5fa13bda976a12a85c Author: Christophe Leroy Date: Mon Sep 25 20:31:31 2023 +0200 powerpc/nohash: Deduplicate ptep_set_wrprotect() and ptep_get_and_clear() ptep_set_wrprotect() and ptep_get_and_clear are identical for nohash/32 and nohash/64. Make them common. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/ffe46edecdabce915e2d1a4b79a3b2ab770f2248.1695659959.git.christophe.leroy@csgroup.eu commit 8c3d9eb323bbf2b37cdc5c01ebf9604175b5970f Author: Christophe Leroy Date: Mon Sep 25 20:31:30 2023 +0200 powerpc/nohash: Refactor ptep_test_and_clear_young() Remove ptep_test_and_clear_young() macro, make __ptep_test_and_clear_young() common to nohash/32 and nohash/64 and change it to become ptep_test_and_clear_young() Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/de90679ae169104fa3c98d0a8828d7ede228fc52.1695659959.git.christophe.leroy@csgroup.eu commit 3a4288164d631b88a57119777b15099eb23c6fbf Author: Christophe Leroy Date: Mon Sep 25 20:31:29 2023 +0200 powerpc/nohash: Deduplicate pte helpers Deduplicate following helpers that are identical on nohash/32 and nohash/64: pte_mkwrite_novma() pte_mkdirty() pte_mkyoung() pte_wrprotect() pte_mkexec() pte_young() Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/485f3cbafaa948143f92692e17ca652dfed68da2.1695659959.git.christophe.leroy@csgroup.eu commit 27672be7751f25566e69bc228c8b8440a0772f8b Author: Christophe Leroy Date: Mon Sep 25 20:31:28 2023 +0200 powerpc/nohash: Deduplicate _PAGE_CHG_MASK _PAGE_CHG_MASK is identical between nohash/32 and nohash/64, deduplicate it. While at it, clean the #ifdef for PTE_RPN_MASK in nohash/32 as it is already CONFIG_PPC32. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/c1a1893dbba4afb825bfa78b262f0b0e0fc3b490.1695659959.git.christophe.leroy@csgroup.eu commit 7c929ad0b3167e980a3963e03403a761138a4350 Author: Christophe Leroy Date: Mon Sep 25 20:31:27 2023 +0200 powerpc/nohash: Refactor checking of no-change in pte_update() On nohash/64, a few callers of pte_update() check if there is really a change in order to avoid an unnecessary write. Refactor that inside pte_update(). Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/076563e611c2b51036686a8d378bfd5ef1726341.1695659959.git.christophe.leroy@csgroup.eu commit 42a2722319f0d3d5612ca8efd3ce7d7eae512291 Author: Christophe Leroy Date: Mon Sep 25 20:31:26 2023 +0200 powerpc/nohash: Refactor pte_update() pte_update() is similar. Take the nohash/32 version which works on nohash/64 and add the debug call to assert_pte_locked() which is only on nohash/64. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/e01cb630cad42f645915ce7702d23985241b71fc.1695659959.git.christophe.leroy@csgroup.eu commit 0f4027eab59261f2fb72586f18efb44be3594dd4 Author: Christophe Leroy Date: Mon Sep 25 20:31:25 2023 +0200 powerpc/nohash: Replace #ifdef CONFIG_44x by IS_ENABLED(CONFIG_44x) in pgtable.h No need of a #ifdef, use IS_ENABLED(CONFIG_44x) Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/7c7d97322a6a05a9842b1e8c4b41265916f542ca.1695659959.git.christophe.leroy@csgroup.eu commit 4c1a89d983be951a3e39d7f9c1d6987f3054e32d Author: Christophe Leroy Date: Mon Sep 25 20:31:24 2023 +0200 powerpc/nohash: Move 8xx version of pte_update() into pte-8xx.h No point in having 8xx special pte_update() in common header, move it into pte-8xx.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/17e209b1a1a43ed219e9e1f2947ec594ed4f9394.1695659959.git.christophe.leroy@csgroup.eu commit 7835006979e5415aa4c9bc0e3e7063b5c5943ed4 Author: Christophe Leroy Date: Mon Sep 25 20:31:23 2023 +0200 powerpc/nohash: Refactor declaration of {map/unmap}_kernel_page() map_kernel_page() and unmap_kernel_page() have the same prototypes on nohash/32 and nohash/64, keep only one declaration. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/7fec5f3288cf0d0eac61b1b3f48c3ea54eb80cad.1695659959.git.christophe.leroy@csgroup.eu commit 81fbb9997057b6e6e5795a08d9a8e10e9f48236f Author: Christophe Leroy Date: Mon Sep 25 20:31:22 2023 +0200 powerpc/nohash: Remove {pte/pmd}_protnone() Only book3s/64 selects ARCH_SUPPORTS_NUMA_BALANCING so CONFIG_NUMA_BALANCING can't be selected on nohash targets. Remove pte_protnone() and pmd_protnone(). Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/a50c1a19828a8eced82cbcc5c61754b667037d21.1695659959.git.christophe.leroy@csgroup.eu commit d3e01796728add53ab778298573772d44d52d19c Author: Christophe Leroy Date: Mon Sep 25 20:31:21 2023 +0200 powerpc: Untangle fixmap.h and pgtable.h and mmu.h fixmap.h need pgtable.h for [un]map_kernel_page() pgtable.h need fixmap.h for FIXADDR_TOP. Untangle the two files by moving FIXADDR_TOP into pgtable.h Also move VIRT_IMMR_BASE to fixmap.h to avoid fixmap.h in mmu.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/5eba12392a018be28ad0a02ed844767b132589e7.1695659959.git.christophe.leroy@csgroup.eu commit da9554e0fe3c7b46912a361a803b50f2655ff30f Author: Christophe Leroy Date: Mon Sep 25 20:31:20 2023 +0200 powerpc: Refactor update_mmu_cache_range() On nohash, this function voids except for E500 with hugepages. On book3s, this function is for hash MMUs only. Combine those tests and rename E500 update_mmu_cache_range() as __update_mmu_cache() which gets called by update_mmu_cache_range(). Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/b029842cb6783cbeb43d202e69a90341d65295a4.1695659959.git.christophe.leroy@csgroup.eu commit 93f81f6eea10f497e892c52998a2194b4e16c91d Author: Christophe Leroy Date: Mon Sep 25 20:31:19 2023 +0200 powerpc: Deduplicate prototypes of ptep_set_access_flags() and phys_mem_access_prot() Prototypes of ptep_set_access_flags() and phys_mem_access_prot() are identical for book3s and nohash. Deduplicate them. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/b846832cce842a2852615b7356937fb9507e436d.1695659959.git.christophe.leroy@csgroup.eu commit 3b8547ec4d35778c9f4cc261d85c0cae6c1a8ecb Author: Christophe Leroy Date: Mon Sep 25 20:31:18 2023 +0200 powerpc: Remove pte_ERROR() pte_ERROR() is used neither in powerpc code nor in common mm code. Remove it. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/bec9eb973ecc1cba091e5c9201d877a7797f3242.1695659959.git.christophe.leroy@csgroup.eu commit cc8ee288f484a2a59c01ccd4d8a417d6ed3466e3 Author: Christophe Leroy Date: Mon Sep 25 20:31:17 2023 +0200 powerpc/40x: Remove stale PTE_ATOMIC_UPDATES macro 40x TLB handlers were reworked by commit 2c74e2586bb9 ("powerpc/40x: Rework 40x PTE access and TLB miss") to not require PTE_ATOMIC_UPDATES anymore. Then commit 4e1df545e2fa ("powerpc/pgtable: Drop PTE_ATOMIC_UPDATES") removed all code related to PTE_ATOMIC_UPDATES. Remove left over PTE_ATOMIC_UPDATES macro. Fixes: 2c74e2586bb9 ("powerpc/40x: Rework 40x PTE access and TLB miss") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/f061db5857fcd748f84a6707aad01754686ce97e.1695659959.git.christophe.leroy@csgroup.eu commit 0d6e24b422a2166a9297a8286ff2e6ab9a5e8cd3 Author: Jiasheng Jiang Date: Fri Sep 1 10:46:58 2023 +0800 clk: mediatek: clk-mt2701: Add check for mtk_alloc_clk_data Add the check for the return value of mtk_alloc_clk_data() in order to avoid NULL pointer dereference. Fixes: e9862118272a ("clk: mediatek: Add MT2701 clock support") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20230901024658.23405-1-jiasheng@iscas.ac.cn Reviewed-by: Markus Schneider-Pargmann Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit 2befa515c1bb6cdd33c262b909d93d1973a219aa Author: Jiasheng Jiang Date: Tue Sep 12 17:34:07 2023 +0800 clk: mediatek: clk-mt7629: Add check for mtk_alloc_clk_data Add the check for the return value of mtk_alloc_clk_data() in order to avoid NULL pointer dereference. Fixes: 3b5e748615e7 ("clk: mediatek: add clock support for MT7629 SoC") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20230912093407.21505-5-jiasheng@iscas.ac.cn Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit 0884393c63cc9a1772f7121a6645ba7bd76feeb9 Author: Jiasheng Jiang Date: Tue Sep 12 17:34:06 2023 +0800 clk: mediatek: clk-mt7629-eth: Add check for mtk_alloc_clk_data Add the check for the return value of mtk_alloc_clk_data() in order to avoid NULL pointer dereference. Fixes: 3b5e748615e7 ("clk: mediatek: add clock support for MT7629 SoC") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20230912093407.21505-4-jiasheng@iscas.ac.cn Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit 606f6366a35a3329545e38129804d65ef26ed7d2 Author: Jiasheng Jiang Date: Tue Sep 12 17:34:05 2023 +0800 clk: mediatek: clk-mt6797: Add check for mtk_alloc_clk_data Add the check for the return value of mtk_alloc_clk_data() in order to avoid NULL pointer dereference. Fixes: 96596aa06628 ("clk: mediatek: add clk support for MT6797") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20230912093407.21505-3-jiasheng@iscas.ac.cn Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit 1f57f78fbacf630430bf954e5a84caafdfea30c0 Author: Jiasheng Jiang Date: Tue Sep 12 17:34:04 2023 +0800 clk: mediatek: clk-mt6779: Add check for mtk_alloc_clk_data Add the check for the return value of mtk_alloc_clk_data() in order to avoid NULL pointer dereference. Fixes: 710774e04861 ("clk: mediatek: Add MT6779 clock support") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20230912093407.21505-2-jiasheng@iscas.ac.cn Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit b82681042724924ae3ba0f2f2eeec217fa31e830 Author: Jiasheng Jiang Date: Tue Sep 12 17:34:03 2023 +0800 clk: mediatek: clk-mt6765: Add check for mtk_alloc_clk_data Add the check for the return value of mtk_alloc_clk_data() in order to avoid NULL pointer dereference. Fixes: 1aca9939bf72 ("clk: mediatek: Add MT6765 clock support") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20230912093407.21505-1-jiasheng@iscas.ac.cn Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd commit 0916c65aba534421a5aca8cdf3b2fdc2da257da4 Merge: 50ee052b396f8 d10d64ad01dba Author: Jakub Kicinski Date: Wed Oct 18 18:10:20 2023 -0700 Merge branch 'intel-wired-lan-driver-updates-2023-10-17' Jacob Keller says: ==================== Intel Wired LAN Driver Updates 2023-10-17 This series contains cleanups for all the Intel drivers relating to their use of format specifiers and the use of strncpy. Jesse fixes various -Wformat warnings across all the Intel networking, including various cases where a "%s" string format specifier is preferred, and using kasprintf instead of snprintf. Justin replaces all of the uses of the now deprecated strncpy with a more modern string function, primarily strscpy. ==================== Link: https://lore.kernel.org/r/20231017190411.2199743-1-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit d10d64ad01dba56cc4e8c9393b1def07598c581d Author: Justin Stitt Date: Tue Oct 17 12:04:11 2023 -0700 igc: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect netdev->name to be NUL-terminated based on its use with format strings: | if (q_vector->rx.ring && q_vector->tx.ring) | sprintf(q_vector->name, "%s-TxRx-%u", netdev->name, Furthermore, we do not need NUL-padding as netdev is already zero-allocated: | netdev = alloc_etherdev_mq(sizeof(struct igc_adapter), | IGC_MAX_TX_QUEUES); ... alloc_etherdev() -> alloc_etherdev_mq() -> alloc_etherdev_mqs() -> alloc_netdev_mqs() ... | p = kvzalloc(alloc_size, GFP_KERNEL_ACCOUNT | __GFP_RETRY_MAYFAIL); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231017190411.2199743-10-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit a6c78d5f8d5df78c2cf1ce6b0de27649b759c2e0 Author: Justin Stitt Date: Tue Oct 17 12:04:10 2023 -0700 igbvf: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect netdev->name to be NUL-terminated based on its usage with `strlen` and format strings: | if (strlen(netdev->name) < (IFNAMSIZ - 5)) { | sprintf(adapter->tx_ring->name, "%s-tx-0", netdev->name); Moreover, we do not need NUL-padding as netdev is already zero-allocated: | netdev = alloc_etherdev(sizeof(struct igbvf_adapter)); ... alloc_etherdev() -> alloc_etherdev_mq() -> alloc_etherdev_mqs() -> alloc_netdev_mqs() ... | p = kvzalloc(alloc_size, GFP_KERNEL_ACCOUNT | __GFP_RETRY_MAYFAIL); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231017190411.2199743-9-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 95e71e35e63561b5c5a5510dc7e429d95ad1dd3b Author: Justin Stitt Date: Tue Oct 17 12:04:09 2023 -0700 igb: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We see that netdev->name is expected to be NUL-terminated based on its usage with format strings: | sprintf(q_vector->name, "%s-TxRx-%u", netdev->name, | q_vector->rx.ring->queue_index); Furthermore, NUL-padding is not required as netdev is already zero-allocated: | netdev = alloc_etherdev_mq(sizeof(struct igb_adapter), | IGB_MAX_TX_QUEUES); ... alloc_etherdev_mq() -> alloc_etherdev_mqs() -> alloc_netdev_mqs() ... | p = kvzalloc(alloc_size, GFP_KERNEL_ACCOUNT | __GFP_RETRY_MAYFAIL); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231017190411.2199743-8-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit be39d0a61aedafc6e7ec401d93fc7c477779996c Author: Justin Stitt Date: Tue Oct 17 12:04:08 2023 -0700 i40e: use scnprintf over strncpy+strncat `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. Moreover, `strncat` shouldn't really be used either as per fortify-string.h: * Do not use this function. While FORTIFY_SOURCE tries to avoid * read and write overflows, this is only possible when the sizes * of @p and @q are known to the compiler. Prefer building the * string with formatting, via scnprintf() or similar. Instead, use `scnprintf` with "%s%s" format string. This code is now more readable and robust. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231017190411.2199743-7-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 48b238461b90bcfba1177674031aaaa5e8ffc207 Author: Justin Stitt Date: Tue Oct 17 12:04:07 2023 -0700 fm10k: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Other implementations of .*get_drvinfo also use strscpy so this patch brings fm10k_get_drvinfo in line as well: igb/igb_ethtool.c +851 static void igb_get_drvinfo(struct net_device *netdev, igbvf/ethtool.c 167:static void igbvf_get_drvinfo(struct net_device *netdev, i40e/i40e_ethtool.c 1999:static void i40e_get_drvinfo(struct net_device *netdev, e1000/e1000_ethtool.c 529:static void e1000_get_drvinfo(struct net_device *netdev, ixgbevf/ethtool.c 211:static void ixgbevf_get_drvinfo(struct net_device *netdev, Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231017190411.2199743-6-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 341359e034e45ac03f5019b7753d073bfed23190 Author: Justin Stitt Date: Tue Oct 17 12:04:06 2023 -0700 e1000: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We can see that netdev->name is expected to be NUL-terminated based on it's usage with format strings: | pr_info("%s NIC Link is Down\n", | netdev->name); A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. This is in line with other uses of strscpy on netdev->name: $ rg "strscpy\(netdev\->name.*pci.*" drivers/net/ethernet/intel/e1000e/netdev.c 7455: strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name)); drivers/net/ethernet/intel/ixgbe/ixgbe_main.c 10839: strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name)); Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231017190411.2199743-5-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 7677f635bf800dc0dd684713c4578ad81f7ad0c3 Author: Justin Stitt Date: Tue Oct 17 12:04:05 2023 -0700 e100: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. The "...-1" pattern makes it evident that netdev->name is expected to be NUL-terminated. Meanwhile, it seems NUL-padding is not required due to alloc_etherdev zero-allocating the buffer. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. This is in line with other uses of strscpy on netdev->name: $ rg "strscpy\(netdev\->name.*pci.*" drivers/net/ethernet/intel/e1000e/netdev.c 7455: strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name)); drivers/net/ethernet/intel/ixgbe/ixgbe_main.c 10839: strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name)); Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231017190411.2199743-4-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit d97af2440a0c56da08c51f9ee1ad4577aa38d451 Author: Jesse Brandeburg Date: Tue Oct 17 12:04:04 2023 -0700 intel: fix format warnings Get ahead of the game and fix all the -Wformat=2 noted warnings in the intel drivers directory. There are one set of i40e and iavf warnings I couldn't figure out how to fix because the driver is already using vsnprintf without an explicit "const char *" format string. Tested with both gcc-12 and clang-15. I found gcc-12 runs clean after this series but clang-15 is a little worried about the vsnprintf lines. summary of warnings: drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c:148:34: warning: format string is not a string literal [-Wformat-nonliteral] drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c:1416:24: warning: format string is not a string literal (potentially insecure) [-Wformat-security] drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c:1416:24: note: treat the string as an argument to avoid this drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c:1421:6: warning: format string is not a string literal (potentially insecure) [-Wformat-security] drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c:1421:6: note: treat the string as an argument to avoid this drivers/net/ethernet/intel/igc/igc_ethtool.c:776:24: warning: format string is not a string literal (potentially insecure) [-Wformat-security] drivers/net/ethernet/intel/igc/igc_ethtool.c:776:24: note: treat the string as an argument to avoid this drivers/net/ethernet/intel/igc/igc_ethtool.c:779:6: warning: format string is not a string literal (potentially insecure) [-Wformat-security] drivers/net/ethernet/intel/igc/igc_ethtool.c:779:6: note: treat the string as an argument to avoid this drivers/net/ethernet/intel/iavf/iavf_ethtool.c:199:34: warning: format string is not a string literal [-Wformat-nonliteral] drivers/net/ethernet/intel/igb/igb_ethtool.c:2360:6: warning: format string is not a string literal (potentially insecure) [-Wformat-security] drivers/net/ethernet/intel/igb/igb_ethtool.c:2360:6: note: treat the string as an argument to avoid this drivers/net/ethernet/intel/igb/igb_ethtool.c:2363:6: warning: format string is not a string literal (potentially insecure) [-Wformat-security] drivers/net/ethernet/intel/igb/igb_ethtool.c:2363:6: note: treat the string as an argument to avoid this drivers/net/ethernet/intel/i40e/i40e_ethtool.c:208:34: warning: format string is not a string literal [-Wformat-nonliteral] drivers/net/ethernet/intel/i40e/i40e_ethtool.c:2515:23: warning: format string is not a string literal (potentially insecure) [-Wformat-security] drivers/net/ethernet/intel/i40e/i40e_ethtool.c:2515:23: note: treat the string as an argument to avoid this drivers/net/ethernet/intel/i40e/i40e_ethtool.c:2519:23: warning: format string is not a string literal (potentially insecure) [-Wformat-security] drivers/net/ethernet/intel/i40e/i40e_ethtool.c:2519:23: note: treat the string as an argument to avoid this drivers/net/ethernet/intel/ice/ice_ethtool.c:1064:6: warning: format string is not a string literal (potentially insecure) [-Wformat-security] drivers/net/ethernet/intel/ice/ice_ethtool.c:1064:6: note: treat the string as an argument to avoid this drivers/net/ethernet/intel/ice/ice_ethtool.c:1084:6: warning: format string is not a string literal (potentially insecure) [-Wformat-security] drivers/net/ethernet/intel/ice/ice_ethtool.c:1084:6: note: treat the string as an argument to avoid this drivers/net/ethernet/intel/ice/ice_ethtool.c:1100:24: warning: format string is not a string literal (potentially insecure) [-Wformat-security] drivers/net/ethernet/intel/ice/ice_ethtool.c:1100:24: note: treat the string as an argument to avoid this Suggested-by: Alexander Lobakin Reviewed-by: Przemek Kitszel Signed-off-by: Jesse Brandeburg Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231017190411.2199743-3-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 1978d3ead82c8e39d739dd4e19b1ea7bf923dfb4 Author: Jesse Brandeburg Date: Tue Oct 17 12:04:03 2023 -0700 intel: fix string truncation warnings Fix -Wformat-truncated warnings to complete the intel directories' W=1 clean efforts. The W=1 recently got enhanced with a few new flags and this brought up some new warnings. Switch to using kasprintf() when possible so we always allocate the right length strings. summary of warnings: drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1425:60: warning: ‘%s’ directive output may be truncated writing 4 bytes into a region of size between 1 and 11 [-Wformat-truncation=] drivers/net/ethernet/intel/iavf/iavf_virtchnl.c:1425:17: note: ‘snprintf’ output between 7 and 17 bytes into a destination of size 13 drivers/net/ethernet/intel/ice/ice_ptp.c:43:27: warning: ‘%s’ directive output may be truncated writing up to 479 bytes into a region of size 64 [-Wformat-truncation=] drivers/net/ethernet/intel/ice/ice_ptp.c:42:17: note: ‘snprintf’ output between 1 and 480 bytes into a destination of size 64 drivers/net/ethernet/intel/igb/igb_main.c:3092:53: warning: ‘%d’ directive output may be truncated writing between 1 and 5 bytes into a region of size between 1 and 13 [-Wformat-truncation=] drivers/net/ethernet/intel/igb/igb_main.c:3092:34: note: directive argument in the range [0, 65535] drivers/net/ethernet/intel/igb/igb_main.c:3092:34: note: directive argument in the range [0, 65535] drivers/net/ethernet/intel/igb/igb_main.c:3090:25: note: ‘snprintf’ output between 23 and 43 bytes into a destination of size 32 Suggested-by: Alexander Lobakin Reviewed-by: Przemek Kitszel Signed-off-by: Jesse Brandeburg Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Jacob Keller Link: https://lore.kernel.org/r/20231017190411.2199743-2-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit bdcb37a5d8de3253da48b120e3f10863696fb654 Author: Arnd Bergmann Date: Tue Oct 17 16:33:58 2023 +0200 buildid: reduce header file dependencies for module The vmlinux decompressor code intentionally has only a limited set of included header files, but this started running into a build failure because of the bitmap logic needing linux/errno.h: In file included 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 arch/arm/boot/compressed/../../../../lib/lz4/lz4_decompress.c:39, from arch/arm/boot/compressed/../../../../lib/decompress_unlz4.c:10, from arch/arm/boot/compressed/decompress.c:60: include/linux/bitmap.h: In function 'bitmap_allocate_region': include/linux/bitmap.h:527:25: error: 'EBUSY' undeclared (first use in this function) 527 | return -EBUSY; | ^~~~~ include/linux/bitmap.h:527:25: note: each undeclared identifier is reported only once for each function it appears in include/linux/bitmap.h: In function 'bitmap_find_free_region': include/linux/bitmap.h:554:17: error: 'ENOMEM' undeclared (first use in this function) 554 | return -ENOMEM; | ^~~~~~ This is easily avoided by changing linux/buildid.h to no longer depend on linux/mm_types.h, a header that pulls in a huge number of indirect dependencies. Fixes: b9c957f554442 ("bitmap: move bitmap_*_region() functions to bitmap.h") Fixes: bd7525dacd7e2 ("bpf: Move stack_map_get_build_id into lib") Signed-off-by: Arnd Bergmann Signed-off-by: Yury Norov commit 50ee052b396f8c60fea6deb826f820aebff372fa Merge: 48e44287c6537 35027c790970c Author: Jakub Kicinski Date: Wed Oct 18 18:07:53 2023 -0700 Merge branch 'selftests-tc-testing-fixes-for-kselftest' Pedro Tammela says: ==================== selftests: tc-testing: fixes for kselftest While playing around with TuxSuite, we noticed a couple of things were broken for strict CI/automated builds. We had a script that didn't make into the kselftest tarball and a couple of missing Kconfig knobs in our minimal config. ==================== Link: https://lore.kernel.org/r/20231017152309.3196320-1-pctammela@mojatatu.com Signed-off-by: Jakub Kicinski commit 35027c790970c40a5093550af7c9f1c77de182b4 Author: Pedro Tammela Date: Tue Oct 17 12:23:09 2023 -0300 selftests: tc-testing: move auxiliary scripts to a dedicated folder Some taprio tests need auxiliary scripts to wait for workqueue events to process. Move them to a dedicated folder in order to package them for the kselftests tarball. Acked-by: Jamal Hadi Salim Signed-off-by: Pedro Tammela Link: https://lore.kernel.org/r/20231017152309.3196320-3-pctammela@mojatatu.com Signed-off-by: Jakub Kicinski commit f157b73d511416226f70c3cb1750eb6fdfa76a2a Author: Pedro Tammela Date: Tue Oct 17 12:23:08 2023 -0300 selftests: tc-testing: add missing Kconfig options to 'config' Make sure CI builds using just tc-testing/config can run all tdc tests. Some tests were broken because of missing knobs. Acked-by: Jamal Hadi Salim Signed-off-by: Pedro Tammela Link: https://lore.kernel.org/r/20231017152309.3196320-2-pctammela@mojatatu.com Signed-off-by: Jakub Kicinski commit bbc5080bef4a245106aa8e8d424ba8847ca7c0ca Author: Jonathan Neuschäfer Date: Sat Sep 23 15:31:27 2023 +0200 clk: npcm7xx: Fix incorrect kfree The corresponding allocation is: > npcm7xx_clk_data = kzalloc(struct_size(npcm7xx_clk_data, hws, > NPCM7XX_NUM_CLOCKS), GFP_KERNEL); ... so, kfree should be applied to npcm7xx_clk_data, not npcm7xx_clk_data->hws. Fixes: fcfd14369856 ("clk: npcm7xx: add clock controller") Signed-off-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/20230923133127.1815621-1-j.neuschaefer@gmx.net Signed-off-by: Stephen Boyd commit 48e44287c6537e736baa2e1d7be520d6ec91840a Author: Jiawen Wu Date: Tue Oct 17 18:06:35 2023 +0800 net: wangxun: remove redundant kernel log Since PBA info can be read from lspci, delete txgbe_read_pba_string() and the prints. In addition, delete the redundant MAC address printing. Signed-off-by: Jiawen Wu Reviewed-by: Simon Horman Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20231017100635.154967-1-jiawenwu@trustnetic.com Signed-off-by: Jakub Kicinski commit 0e108725f6cc5b3be9e607f89c9fbcbb236367b7 Author: Kees Cook Date: Wed Oct 18 10:53:58 2023 -0700 string: Adjust strtomem() logic to allow for smaller sources Arnd noticed we have a case where a shorter source string is being copied into a destination byte array, but this results in a strnlen() call that exceeds the size of the source. This is seen with -Wstringop-overread: In file included from ../include/linux/uuid.h:11, from ../include/linux/mod_devicetable.h:14, from ../include/linux/cpufeature.h:12, from ../arch/x86/coco/tdx/tdx.c:7: ../arch/x86/coco/tdx/tdx.c: In function 'tdx_panic.constprop': ../include/linux/string.h:284:9: error: 'strnlen' specified bound 64 exceeds source size 60 [-Werror=stringop-overread] 284 | memcpy_and_pad(dest, _dest_len, src, strnlen(src, _dest_len), pad); \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../arch/x86/coco/tdx/tdx.c:124:9: note: in expansion of macro 'strtomem_pad' 124 | strtomem_pad(message.str, msg, '\0'); | ^~~~~~~~~~~~ Use the smaller of the two buffer sizes when calling strnlen(). When src length is unknown (SIZE_MAX), it is adjusted to use dest length, which is what the original code did. Reported-by: Arnd Bergmann Fixes: dfbafa70bde2 ("string: Introduce strtomem() and strtomem_pad()") Tested-by: Arnd Bergmann Cc: Andy Shevchenko Cc: linux-hardening@vger.kernel.org Signed-off-by: Kees Cook commit 43a354a21a6a21f050b95317148661a465108cba Author: Dan Carpenter Date: Tue Oct 17 17:06:53 2023 +0300 clk: at91: remove unnecessary conditions This code checks "if (parent_hw)" is non-NULL, but then it has more checks if parent_hw is non-NULL on the lines inside the if statement. It is a bit confusing. For the else statement, keep in mind that at the start of the function we checked: if (!(parent_name || parent_hw)) return ERR_PTR(-EINVAL); That check ensures that if parent_hw is NULL that means that parent_name is non-NULL. At least one must always be non-NULL. So here again, the checks inside the if statement can be removed. In the original code, it was a bit confusing and you could easily get the impression that "init.num_parents" could be zero. When we remove the unnecessary checking it's more obvious that it's always set to 1. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/7782b4f1-deed-49dc-8207-b6ea06d7602f@moroto.mountain Reviewed-by: Claudiu Beznea Signed-off-by: Stephen Boyd commit 7af5b9eadd64c9e02a71f97c45bcdf3b64841f6b Author: Dan Carpenter Date: Mon Oct 2 10:04:36 2023 +0300 clk: ti: fix double free in of_ti_divider_clk_setup() The "div" pointer is freed in _register_divider() and again in of_ti_divider_clk_setup(). Delete the free in _register_divider() Fixes: fbbc18591585 ("clk: ti: divider: cleanup _register_divider and ti_clk_get_div_table") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/6d36eeec-6c8a-4f11-a579-aa3cd7c38749@moroto.mountain Reviewed-by: Tony Lindgren Signed-off-by: Stephen Boyd commit a5d14f8b551eb1551c10053653ee8e27f19672fa Author: Dan Carpenter Date: Thu Oct 5 17:01:57 2023 +0300 clk: keystone: pll: fix a couple NULL vs IS_ERR() checks The clk_register_divider() and clk_register_mux() functions returns error pointers on error but this code checks for NULL. Fix that. Fixes: b9e0d40c0d83 ("clk: keystone: add Keystone PLL clock driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/d9da4c97-0da9-499f-9a21-1f8e3f148dc1@moroto.mountain Signed-off-by: Stephen Boyd commit 8bb0475623c7f4d8061484c3144e83e6044a3c4a Merge: 2c6370a13f0e0 50254bfe14383 Author: Jakub Kicinski Date: Wed Oct 18 17:47:12 2023 -0700 Merge branch 'net-fec-fix-device_get_match_data-usage' Alexander Stein says: ==================== net: fec: Fix device_get_match_data usage this is v2 adressing the regression introduced by commit b0377116decd ("net: ethernet: Use device_get_match_data()"). You could also remove the (!dev_info) case for Coldfire as this platform has no quirks. But IMHO this should be kept as long as Coldfire platform data is supported. ==================== Link: https://lore.kernel.org/r/20231017063419.925266-1-alexander.stein@ew.tq-group.com Signed-off-by: Jakub Kicinski commit 50254bfe143832ab74858a231098c7aaa476de21 Author: Alexander Stein Date: Tue Oct 17 08:34:19 2023 +0200 net: fec: Remove non-Coldfire platform IDs All i.MX platforms (non-Coldfire) use DT nowadays, so their platform ID entries can be removed. Signed-off-by: Alexander Stein Reviewed-by: Simon Horman Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20231017063419.925266-3-alexander.stein@ew.tq-group.com Signed-off-by: Jakub Kicinski commit e6809dba5ec3c20ec52eaa90ff107f853fdced1f Author: Alexander Stein Date: Tue Oct 17 08:34:18 2023 +0200 net: fec: Fix device_get_match_data usage device_get_match_data() expects that of_device_id->data points to actual fec_devinfo data, not a platform_device_id entry. Fix this by adjusting OF device data pointers to their corresponding structs. enum imx_fec_type is now unused and can be removed. Fixes: b0377116decd ("net: ethernet: Use device_get_match_data()") Signed-off-by: Alexander Stein Reviewed-by: Simon Horman Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20231017063419.925266-2-alexander.stein@ew.tq-group.com Signed-off-by: Jakub Kicinski commit 2c6370a13f0e076de59a68b6c1480a6965c08952 Author: Muhammad Muzammil Date: Sat Oct 14 17:14:07 2023 +0500 drivers: net: wwan: iosm: Fixed multiple typos in multiple files iosm_ipc_chnl_cfg.h: Fixed typo iosm_ipc_imem_ops.h: Fixed typo iosm_ipc_mux.h: Fixed typo iosm_ipc_pm.h: Fixed typo iosm_ipc_port.h: Fixed typo iosm_ipc_trace.h: Fixed typo Signed-off-by: Muhammad Muzammil Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231014121407.10012-1-m.muzzammilashraf@gmail.com Signed-off-by: Jakub Kicinski commit 5437d14d94c8b0b3a960f616dfe02dc153806225 Author: Balsam CHIHI Date: Tue Oct 17 21:05:45 2023 +0200 thermal/drivers/mediatek/lvts_thermal: Update calibration data documentation Update LVTS calibration data documentation for mt8192 and mt8195. Signed-off-by: Balsam CHIHI Reviewed-by: Nícolas F. R. A. Prado [bero@baylibre.com: Fix issues pointed out by Nícolas F. R. A. Prado ] Signed-off-by: Bernhard Rosenkränzer Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20231017190545.157282-6-bero@baylibre.com commit 288732242db4980e2edbb3a21729c9fba58c3726 Author: Balsam CHIHI Date: Tue Oct 17 21:05:43 2023 +0200 thermal/drivers/mediatek/lvts_thermal: Add mt8192 support Add LVTS Driver support for MT8192. Co-developed-by: Nícolas F. R. A. Prado Signed-off-by: Nícolas F. R. A. Prado Signed-off-by: Balsam CHIHI Reviewed-by: Nícolas F. R. A. Prado [bero@baylibre.com: cosmetic changes, rebase] Signed-off-by: Bernhard Rosenkränzer Reviewed-by: Matthias Brugger Reviewed-by: Alexandre Mergnat Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20231017190545.157282-4-bero@baylibre.com commit 8137bb90600d70eda524854ce3047a5681988dd6 Author: Balsam CHIHI Date: Tue Oct 17 21:05:42 2023 +0200 thermal/drivers/mediatek/lvts_thermal: Add suspend and resume Add suspend and resume support to LVTS driver. Signed-off-by: Balsam CHIHI [bero@baylibre.com: suspend/resume in noirq phase] Co-developed-by: Bernhard Rosenkränzer Signed-off-by: Bernhard Rosenkränzer Reviewed-by: Matthias Brugger Reviewed-by: Alexandre Mergnat Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20231017190545.157282-3-bero@baylibre.com commit 0bb4937b58ab712f158588376dbac97f8e9df68e Author: Balsam CHIHI Date: Tue Oct 17 21:05:41 2023 +0200 dt-bindings: thermal: mediatek: Add LVTS thermal controller definition for mt8192 Add LVTS thermal controller definition for MT8192. Signed-off-by: Balsam CHIHI Reviewed-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Signed-off-by: Bernhard Rosenkränzer Reviewed-by: Matthias Brugger Reviewed-by: Alexandre Mergnat Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20231017190545.157282-2-bero@baylibre.com commit 619102313466eaf8a6ac188e711f5df749dac6d4 Author: Sergio Paracuellos Date: Sun Aug 27 04:39:32 2023 +0200 clk: ralink: mtmips: quiet unused variable warning When CONFIG_OF is disabled then the matching table is not referenced and the following warning appears: drivers/clk/ralink/clk-mtmips.c:821:34: warning: unused variable 'mtmips_of_match' [-Wunused-const-variable] 821 | static const struct of_device_id mtmips_of_match[] = { | ^ There are two match tables in the driver: one for the clock driver and the other for the reset driver. The only difference between them is that the clock driver uses 'data' and does not have 'ralink,rt2880-reset' compatible. Both just can be merged into a single one just by adding the compatible 'ralink,rt2880-reset' entry to 'mtmips_of_match[]', which will allow it to be used for 'mtmips_clk_driver' (which doesn't use the data) as well as for 'mtmips_clk_init()' (which doesn't need get called for 'ralink,rt2880-reset'). Doing in this way ensures that 'CONFIG_OF' is not disabled anymore so the above warning disapears. Fixes: 6f3b15586eef ("clk: ralink: add clock and reset driver for MTMIPS SoCs") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202307242310.CdOnd2py-lkp@intel.com/ Suggested-by: Arnd Bergmann Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20230827023932.501102-1-sergio.paracuellos@gmail.com Reviewed-by: Nathan Chancellor Signed-off-by: Stephen Boyd commit 663b8db7b0256b81152b2f786e45ecf12bdf265f Author: Darrick J. Wong Date: Mon Oct 16 09:51:16 2023 -0700 xfs: use accessor functions for summary info words Create get and set functions for rtsummary words so that we can redefine the ondisk format with a specific endianness. Note that this requires the definition of a distinct type for ondisk summary info words so that the compiler can perform proper typechecking. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 41f33d82cfd310e344fc9183f02cc9e0d2d27663 Author: Dave Chinner Date: Mon Oct 16 09:54:19 2023 -0700 xfs: consolidate realtime allocation arguments Consolidate the arguments passed around the rt allocator into a struct xfs_rtalloc_arg similar to how the btree allocator arguments are consolidated in a struct xfs_alloc_arg.... Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit bd85af280de66a946022775a876edf0c553e3f35 Author: Darrick J. Wong Date: Mon Oct 16 09:50:34 2023 -0700 xfs: create helpers for rtsummary block/wordcount computations Create helper functions that compute the number of blocks or words necessary to store the rt summary file. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 54a9ea73527d55ab746d5425e10f3fa748e00e70 Author: Jing Zhang Date: Wed Oct 11 19:57:40 2023 +0000 KVM: arm64: selftests: Test for setting ID register from usersapce Add tests to verify setting ID registers from userspace is handled correctly by KVM. Also add a test case to use ioctl KVM_ARM_GET_REG_WRITABLE_MASKS to get writable masks. Signed-off-by: Jing Zhang Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20231011195740.3349631-6-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 0359c946b13153bd57fac65f4f3600ba5673e3de Author: Jing Zhang Date: Wed Oct 11 19:57:39 2023 +0000 tools headers arm64: Update sysreg.h with kernel sources The users of sysreg.h (perf, KVM selftests) are now generating the necessary sysreg-defs.h; sync sysreg.h with the kernel sources and fix the KVM selftests that use macros which suffered a rename. Signed-off-by: Jing Zhang Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20231011195740.3349631-5-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 9697d84cc3b6d9bff4b1fbffc10a4bb1398af9ba Author: Oliver Upton Date: Wed Oct 11 19:57:38 2023 +0000 KVM: selftests: Generate sysreg-defs.h and add to include path Start generating sysreg-defs.h for arm64 builds in anticipation of updating sysreg.h to a version that depends on it. Reviewed-by: Mark Brown Reviewed-by: Eric Auger Tested-by: Eric Auger Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20231011195740.3349631-4-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit e2bdd172e6652c2f5554d125a5048bc9f9b0dfa3 Author: Oliver Upton Date: Wed Oct 11 19:57:37 2023 +0000 perf build: Generate arm64's sysreg-defs.h and add to include path Start generating sysreg-defs.h in anticipation of updating sysreg.h to a version that needs the generated output. Acked-by: Arnaldo Carvalho de Melo Acked-by: Namhyung Kim Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20231011195740.3349631-3-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 02e85f74668e1aa0062708b58d8aef020054e56c Author: Oliver Upton Date: Wed Oct 11 19:57:36 2023 +0000 tools: arm64: Add a Makefile for generating sysreg-defs.h Use a common Makefile for generating sysreg-defs.h, which will soon be needed by perf and KVM selftests. The naming scheme of the generated macros is not expected to change, so just refer to the canonical script/data in the kernel source rather than copying to tools. Co-developed-by: Jing Zhang Signed-off-by: Jing Zhang Reviewed-by: Mark Brown Reviewed-by: Eric Auger Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20231011195740.3349631-2-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 0e133a13370389d3894891eafe54fec2c44ad735 Author: Dave Thaler Date: Tue Oct 17 20:30:20 2023 +0000 bpf, docs: Define signed modulo as using truncated division There's different mathematical definitions (truncated, floored, rounded, etc.) and different languages have chosen different definitions [0][1]. E.g., languages/libraries that follow Knuth use a different mathematical definition than C uses. This patch specifies which definition BPF uses, as verified by Eduard [2] and others. [0] https://en.wikipedia.org/wiki/Modulo#Variants_of_the_definition [1] https://torstencurdt.com/tech/posts/modulo-of-negative-numbers/ [2] https://lore.kernel.org/bpf/57e6fefadaf3b2995bb259fa8e711c7220ce5290.camel@gmail.com/ Signed-off-by: Dave Thaler Signed-off-by: Daniel Borkmann Acked-by: David Vernet Acked-by: Eduard Zingerman Link: https://lore.kernel.org/bpf/20231017203020.1500-1-dthaler1968@googlemail.com commit 7eeaedf79989a8f131939782832e21e9218ed2a0 Author: Umesh Nerlige Ramappa Date: Wed Aug 2 13:28:54 2023 -0700 drm/i915/perf: Determine context valid in OA reports When supporting OA for TGL, it was seen that the context valid bit in the report ID was not defined, however revisiting the spec seems to have this bit defined. The bit is used to determine if a context is valid on a context switch and is essential to determine active and idle periods for a context. Re-enable the context valid bit for gen12 platforms. BSpec: 52196 (description of report_id) v2: Include BSpec reference (Ashutosh) Fixes: 00a7f0d7155c ("drm/i915/tgl: Add perf support on TGL") Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20230802202854.1224547-1-umesh.nerlige.ramappa@intel.com commit 157a3537d6bc28ceb9a11fc8cb67f2152d860146 Author: John Johansen Date: Sun Sep 10 03:35:22 2023 -0700 apparmor: Fix regression in mount mediation commit 2db154b3ea8e ("vfs: syscall: Add move_mount(2) to move mounts around") introduced a new move_mount(2) system call and a corresponding new LSM security_move_mount hook but did not implement this hook for any existing LSM. This creates a regression for AppArmor mediation of mount. This patch provides a base mapping of the move_mount syscall to the existing mount mediation. In the future we may introduce additional mediations around the new mount calls. Fixes: 2db154b3ea8e ("vfs: syscall: Add move_mount(2) to move mounts around") CC: stable@vger.kernel.org Reported-by: Andreas Steinmetz Signed-off-by: John Johansen commit ea9bae12d02819556db63348db8bd8441eb316f2 Author: John Johansen Date: Tue Oct 25 01:18:41 2022 -0700 apparmor: cache buffers on percpu list if there is lock contention commit df323337e507 ("apparmor: Use a memory pool instead per-CPU caches") changed buffer allocation to use a memory pool, however on a heavily loaded machine there can be lock contention on the global buffers lock. Add a percpu list to cache buffers on when lock contention is encountered. When allocating buffers attempt to use cached buffers first, before taking the global buffers lock. When freeing buffers try to put them back to the global list but if contention is encountered, put the buffer on the percpu list. The length of time a buffer is held on the percpu list is dynamically adjusted based on lock contention. The amount of hold time is increased and decreased linearly. v5: - simplify base patch by removing: improvements can be added later - MAX_LOCAL and must lock - contention scaling. v4: - fix percpu ->count buffer count which had been spliced across a debug patch. - introduce define for MAX_LOCAL_COUNT - rework count check and locking around it. - update commit message to reference commit that introduced the memory. v3: - limit number of buffers that can be pushed onto the percpu list. This avoids a problem on some kernels where one percpu list can inherit buffers from another cpu after a reschedule, causing more kernel memory to used than is necessary. Under normal conditions this should eventually return to normal but under pathelogical conditions the extra memory consumption may have been unbouanded v2: - dynamically adjust buffer hold time on percpu list based on lock contention. v1: - cache buffers on percpu list on lock contention Reported-by: Sergey Senozhatsky Reviewed-by: Georgia Garcia Signed-off-by: John Johansen commit c4371d90633b73cf6e86aff43ff2b5d95ad2b9eb Author: Georgia Garcia Date: Mon Mar 20 14:43:41 2023 -0300 apparmor: add io_uring mediation For now, the io_uring mediation is limited to sqpoll and override_creds. Signed-off-by: Georgia Garcia Signed-off-by: John Johansen commit fa9b63adabcfa9b724120ef3352cf6fb82b4b9a5 Author: John Johansen Date: Fri Sep 9 16:00:09 2022 -0700 apparmor: add user namespace creation mediation Unprivileged user namespace creation is often used as a first step in privilege escalation attacks. Instead of disabling it at the sysrq level, which blocks its legitimate use as for setting up a sandbox, allow control on a per domain basis. This allows an admin to quickly lock down a system while also still allowing legitimate use. Reviewed-by: Georgia Garcia Signed-off-by: John Johansen commit 2d9da9b188b8cd3b579d7ef5ba5d334be9dd38fc Author: John Johansen Date: Wed Aug 9 00:26:36 2023 -0700 apparmor: allow restricting unprivileged change_profile unprivileged unconfined can use change_profile to alter the confinement set by the mac admin. Allow restricting unprivileged unconfined by still allowing change_profile but stacking the change against unconfined. This allows unconfined to still apply system policy but allows the task to enter the new confinement. If unprivileged unconfined is required a sysctl is provided to switch to the previous behavior. Reviewed-by: Georgia Garcia Signed-off-by: John Johansen commit 1f36b190ad2dea68e3a7e84b7b2f24ce8c4063ea Author: Namhyung Kim Date: Tue Oct 10 16:42:47 2023 -0700 perf tools: Do not ignore the default vmlinux.h The recent change made it possible to generate vmlinux.h from BTF and to ignore the file. But we also have a minimal vmlinux.h that will be used by default. It should not be ignored by GIT. Fixes: b7a2d774c9c5 ("perf build: Add ability to build with a generated vmlinux.h") Reported-by: kernel test robot Reviewed-by: Ian Rogers Closes: https://lore.kernel.org/oe-kbuild-all/202310110451.rvdUZJEY-lkp@intel.com/ Cc: oe-kbuild-all@lists.linux.dev Signed-off-by: Namhyung Kim commit e105d8079f82819f4773c4853dc199e195fedf40 Author: John Johansen Date: Thu Aug 24 12:38:01 2023 -0700 apparmor: advertise disconnected.path is available While disconnected.path has been available for a while it was never properly advertised as a feature. Fix this so that userspace doesn't need special casing to handle it. Reviewed-by: Georgia Garcia Signed-off-by: John Johansen commit 98b824ff8984fd523fc264fbb13208098ab09da3 Author: John Johansen Date: Fri Apr 28 05:32:52 2023 -0700 apparmor: refcount the pdb With the move to permission tables the dfa is no longer a stand alone entity when used, needing a minimum of a permission table. However it still could be shared among different pdbs each using a different permission table. Instead of duping the permission table when sharing a pdb, add a refcount to the pdb so it can be easily shared. Reviewed-by: Georgia Garcia Signed-off-by: John Johansen commit 75c77e9e0713fddbe99a21a036aa6482402f9e34 Author: John Johansen Date: Mon Apr 17 03:27:36 2023 -0700 apparmor: provide separate audit messages for file and policy checks Improve policy load failure messages by identifying which dfa the verification check failed in. Reviewed-by: Georgia Garcia Signed-off-by: John Johansen commit 90c436a64a6e20482a9a613c47eb4af2e8a5328e Author: John Johansen Date: Mon Sep 19 20:48:48 2022 -0700 apparmor: pass cred through to audit info. The cred is needed to properly audit some messages, and will be needed in the future for uid conditional mediation. So pass it through to where the apparmor_audit_data struct gets defined. Reviewed-by: Georgia Garcia Signed-off-by: John Johansen commit d20f5a1a6e792d22199c9989ec7ab9e95c48d60c Author: John Johansen Date: Mon Sep 19 00:46:09 2022 -0700 apparmor: rename audit_data->label to audit_data->subj_label rename audit_data's label field to subj_label to better reflect its use. Also at the same time drop unneeded assignments to ->subj_label as the later call to aa_check_perms will do the assignment if needed. Reviewed-by: Georgia Garcia Signed-off-by: John Johansen commit bd7bd201ca46c211c3ab251ca9854787d1331a2f Author: John Johansen Date: Wed Sep 14 00:20:12 2022 -0700 apparmor: combine common_audit_data and apparmor_audit_data Everywhere where common_audit_data is used apparmor audit_data is also used. We can simplify the code and drop the use of the aad macro everywhere by combining the two structures. Reviewed-by: Georgia Garcia Signed-off-by: John Johansen commit 79ddd4a7c5fa8883f99a88409e5ad9812e484094 Author: John Johansen Date: Mon Mar 6 07:27:55 2023 -0800 apparmor: rename SK_CTX() to aa_sock and make it an inline fn In preparation for LSM stacking rework the macro to an inline fn Reviewed-by: Georgia Garcia Signed-off-by: John Johansen commit b5c532e90478e134b66b067c2b0487526ac4161e Author: Jiri Olsa Date: Sun Oct 8 23:22:51 2023 +0200 tools/build: Fix -s detection code in tools/scripts/Makefile.include As Dmitry described in [1] changelog the current way of detecting -s option is broken for new make. Changing the tools/build -s option detection the same way as it was fixed for root Makefile in [1]. [1] 4bf73588165b ("kbuild: Port silent mode detection to future gnu make.") Cc: Dmitry Goncharov Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Acked-by: Namhyung Kim Cc: Peter Zijlstra Cc: KP Singh Cc: Martin KaFai Lau Cc: Song Liu Cc: Yonghong Song Cc: John Fastabend Cc: Hao Luo Cc: Ian Rogers Cc: Stanislav Fomichev Cc: Daniel Borkmann Cc: Quentin Monnet Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Alexei Starovoitov Cc: Ingo Molnar Cc: Alexander Shishkin Cc: bpf@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Link: https://lore.kernel.org/r/20231008212251.236023-3-jolsa@kernel.org Signed-off-by: Namhyung Kim commit d9997f7ffb137447aa2f820c26cb1e6f5890d978 Author: Jiri Olsa Date: Sun Oct 8 23:22:50 2023 +0200 tools/build: Fix -s detection code in tools/build/Makefile.build As Dmitry described in [1] changelog the current way of detecting -s option is broken for new make. Changing the tools/build -s option detection the same way as it was fixed for root Makefile in [1]. [1] 4bf73588165b ("kbuild: Port silent mode detection to future gnu make.") Cc: Dmitry Goncharov Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Acked-by: Namhyung Kim Cc: Peter Zijlstra Cc: KP Singh Cc: Martin KaFai Lau Cc: Song Liu Cc: Yonghong Song Cc: John Fastabend Cc: Hao Luo Cc: Ian Rogers Cc: Stanislav Fomichev Cc: Daniel Borkmann Cc: Quentin Monnet Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Alexei Starovoitov Cc: Ingo Molnar Cc: Alexander Shishkin Cc: bpf@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Link: https://lore.kernel.org/r/20231008212251.236023-2-jolsa@kernel.org Signed-off-by: Namhyung Kim commit d4c720a19e9ac3a907a8bf9a11c5a3a4e3e50a34 Merge: 9330bf741fdac c8fd5a37340f9 Author: Georgi Djakov Date: Thu Oct 19 00:50:03 2023 +0300 Merge branch 'icc-platform-remove' into icc-next Convert platform drivers to use the .remove_new callback. * icc-platform-remove interconnect: qcom: Convert to platform remove callback returning void Link: https://lore.kernel.org/r/20231015135955.1537751-2-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov commit 5176140c5094b5bfd35e19a4f6ab8a10b65da380 Author: Yuanheng Zhang Date: Thu Oct 12 00:32:16 2023 +0800 ocfs2: fix a typo in a comment Fix spelling typo in comment. Link: https://lkml.kernel.org/r/20231011163216.29446-1-yuanhengzhang1214@gmail.com Signed-off-by: Yuanheng Zhang 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 commit 94a03e1d22e8dc75ddec159b2efadd4c6354503a Author: Hu Haowen <2023002089@link.tyut.edu.cn> Date: Fri Oct 13 21:28:32 2023 +0800 scripts/show_delta: add __main__ judgement before main code When doing Python programming it is a nice convention to insert the if statement `if __name__ == "__main__":` before any main code that does actual functionalities to ensure the code will be executed only as a script rather than as an imported module. Hence attach the missing judgement to show_delta. Link: https://lkml.kernel.org/r/20231013132832.165768-1-2023002089@link.tyut.edu.cn Signed-off-by: Hu Haowen <2023002089@link.tyut.edu.cn> Reviewed-by: Nick Desaulniers Reviewed-by: Miguel Ojeda Cc: Greg Kroah-Hartman Cc: Masahiro Yamada Cc: Nicolas Schier Signed-off-by: Andrew Morton commit 68279f9c9f592e75d30a9ba5154a15e0a0b42ae8 Author: Alexey Dobriyan Date: Wed Oct 11 19:55:00 2023 +0300 treewide: mark stuff as __ro_after_init __read_mostly predates __ro_after_init. Many variables which are marked __read_mostly should have been __ro_after_init from day 1. Also, mark some stuff as "const" and "__init" while I'm at it. [akpm@linux-foundation.org: revert sysctl_nr_open_min, sysctl_nr_open_max changes due to arm warning] [akpm@linux-foundation.org: coding-style cleanups] Link: https://lkml.kernel.org/r/4f6bb9c0-abba-4ee4-a7aa-89265e886817@p183 Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton commit 1b13a7030504da9d379270675166342e7039817c Author: Artem Chernyshev Date: Mon Oct 9 17:11:11 2023 +0300 fs: ocfs2: check status values Test return values before overwriting. Found by Linux Verification Center (linuxtesting.org) with SVACE. Link: https://lkml.kernel.org/r/20231009141111.149858-1-artem.chernyshev@red-soft.ru Signed-off-by: Artem Chernyshev Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton commit 6e79b375adb38219099d7e3ccc973a7808108a3e Author: Swarup Laxman Kotiaklapudi Date: Mon Oct 9 14:07:14 2023 +0300 proc: test /proc/${pid}/statm My original comment lied, output can be "0 A A B 0 0 0\n" (see comment in the code). I don't quite understand why get_mm_counter(mm, MM_FILEPAGES) + get_mm_counter(mm, MM_SHMEMPAGES) can stay positive but get_mm_counter(mm, MM_ANONPAGES) is always 0 after everything is unmapped but that's just me. [adobriyan@gmail.com: more or less rewritten] Link: https://lkml.kernel.org/r/0721ca69-7bb4-40aa-8d01-0c5f91e5f363@p183 Signed-off-by: Swarup Laxman Kotiaklapudi Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton commit 598f0ac1500d7145c696de4d38797b1dd2c651de Author: David Laight Date: Thu Oct 5 11:39:54 2023 +0000 compiler.h: move __is_constexpr() to compiler.h Prior to f747e6667ebb2 __is_constexpr() was in its only user minmax.h. That commit moved it to const.h - but that file just defines ULL(x) and UL(x) so that constants can be defined for .S and .c files. So apart from the word 'const' it wasn't really a good location. Instead move the definition to compiler.h just before the similar is_signed_type() and is_unsigned_type(). This may not be a good long-term home, but the three definitions belong together. Link: https://lkml.kernel.org/r/2a6680bbe2e84459816a113730426782@AcuMS.aculab.com Signed-off-by: David Laight Reviewed-by: Kees Cook Cc: Arnd Bergmann Cc: Bart Van Assche Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Rasmus Villemoes Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit fbd126f5a658b92c7f6af986a6d89cf5e5693268 Author: Kees Cook Date: Fri Sep 22 10:52:20 2023 -0700 gcov: annotate struct gcov_iterator with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct gcov_iterator. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Link: https://lkml.kernel.org/r/20230922175220.work.327-kees@kernel.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Peter Oberparleiter Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Signed-off-by: Andrew Morton commit 71ca5ee18708c1f9f086e20ac0a657009bcfe43a Author: Joe Perches Date: Thu Oct 5 14:35:17 2023 -0700 get_maintainer: add --keywords-in-file option There were some recent attempts [1] [2] to make the K: field less noisy and its behavior more obvious. Ultimately, a shift in the default behavior and an associated command line flag is the best choice. Currently, K: will match keywords found in both patches and files. Matching content from entire files is (while documented) not obvious behavior and is usually not wanted by maintainers. Now only patch content will be matched against unless --keywords-in-file is also provided as an argument to get_maintainer. Add the actual keyword matched to the role or rolestats as well. For instance given the diff below that removes clang: : diff --git a/drivers/hid/bpf/entrypoints/README b/drivers/hid/bpf/entrypoints/README : index 147e0d41509f..f88eb19e8ef2 100644 : --- a/drivers/hid/bpf/entrypoints/README : +++ b/drivers/hid/bpf/entrypoints/README : @@ -1,4 +1,4 @@ : WARNING: : If you change "entrypoints.bpf.c" do "make -j" in this directory to rebuild "entrypoints.skel.h". : -Make sure to have clang 10 installed. : +Make sure to have 10 installed. : See Documentation/bpf/bpf_devel_QA.rst The new role/rolestats output includes ":Keyword:\b(?i:clang|llvm)\b" $ git diff drivers/hid/bpf/entrypoints/README | .scripts/get_maintainer.pl Jiri Kosina (maintainer:HID CORE LAYER,commit_signer:1/1=100%) Benjamin Tissoires (maintainer:HID CORE LAYER,commit_signer:1/1=100%,authored:1/1=100%,added_lines:4/4=100%) Nathan Chancellor (supporter:CLANG/LLVM BUILD SUPPORT:Keyword:\b(?i:clang|llvm)\b) Nick Desaulniers (supporter:CLANG/LLVM BUILD SUPPORT:Keyword:\b(?i:clang|llvm)\b) Tom Rix (reviewer:CLANG/LLVM BUILD SUPPORT:Keyword:\b(?i:clang|llvm)\b) Greg Kroah-Hartman (commit_signer:1/1=100%) linux-input@vger.kernel.org (open list:HID CORE LAYER) linux-kernel@vger.kernel.org (open list) llvm@lists.linux.dev (open list:CLANG/LLVM BUILD SUPPORT:Keyword:\b(?i:clang|llvm)\b) Link: https://lore.kernel.org/r/20231004-get_maintainer_change_k-v1-1-ac7ced18306a@google.com Link: https://lore.kernel.org/all/20230928-get_maintainer_add_d-v2-0-8acb3f394571@google.com Link: https://lore.kernel.org/all/3dca40b677dd2fef979a5a581a2db91df2c21801.camel@perches.com Original-patch-by: Justin Stitt Link: https://lkml.kernel.org/r/01fe46f0c58aa8baf92156ae2bdccfb2bf0cb48e.camel@perches.com Signed-off-by: Joe Perches Tested-by: Justin Stitt Cc: Kees Cook Cc: Nick Desaulniers Signed-off-by: Andrew Morton commit ead5a727739fa63b94ccd281d848a503032444ee Author: Alexey Dobriyan Date: Fri Sep 29 19:31:41 2023 +0300 proc: save LOC by using while loop Use while loop instead of infinite loop with "break;". Also move some variable to the inner scope where they belong. Link: https://lkml.kernel.org/r/82c8f8e7-8ded-46ca-8857-e60b991d6205@p183 Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton commit 860a2e7fa4a186a78be904879f752858c96328ed Author: Alexey Dobriyan Date: Fri Sep 29 19:30:18 2023 +0300 proc: use initializer for clearing some buffers Save LOC by using dark magic of initialisation instead of memset(). Those buffer aren't passed to userspace directly so padding is not an issue. Link: https://lkml.kernel.org/r/3821d3a2-6e10-4629-b0d5-9519d828ab72@p183 Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton commit 867046cc7027703f60a46339ffde91a1970f2901 Author: David Laight Date: Mon Sep 18 08:19:25 2023 +0000 minmax: relax check to allow comparison between unsigned arguments and signed constants Allow (for example) min(unsigned_var, 20). The opposite min(signed_var, 20u) is still errored. Since a comparison between signed and unsigned never makes the unsigned value negative it is only necessary to adjust the __types_ok() test. Link: https://lkml.kernel.org/r/633b64e2f39e46bb8234809c5595b8c7@AcuMS.aculab.com Signed-off-by: David Laight Cc: Andy Shevchenko Cc: Christoph Hellwig Cc: Jason A. Donenfeld Cc: Linus Torvalds Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 4ead534fba42fc4fd41163297528d2aa731cd121 Author: David Laight Date: Mon Sep 18 08:18:40 2023 +0000 minmax: allow comparisons of 'int' against 'unsigned char/short' Since 'unsigned char/short' get promoted to 'signed int' it is safe to compare them against an 'int' value. Link: https://lkml.kernel.org/r/8732ef5f809c47c28a7be47c938b28d4@AcuMS.aculab.com Signed-off-by: David Laight Cc: Andy Shevchenko Cc: Christoph Hellwig Cc: Jason A. Donenfeld Cc: Linus Torvalds Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit f4b84b2ff851f01d0fac619eadef47eb41648534 Author: David Laight Date: Mon Sep 18 08:17:57 2023 +0000 minmax: fix indentation of __cmp_once() and __clamp_once() Remove the extra indentation and align continuation markers. Link: https://lkml.kernel.org/r/bed41317a05c498ea0209eafbcab45a5@AcuMS.aculab.com Signed-off-by: David Laight Cc: Andy Shevchenko Cc: Christoph Hellwig Cc: Jason A. Donenfeld Cc: Linus Torvalds Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit d03eba99f5bf7cbc6e2fdde3b6fa36954ad58e09 Author: David Laight Date: Mon Sep 18 08:17:15 2023 +0000 minmax: allow min()/max()/clamp() if the arguments have the same signedness. The type-check in min()/max() is there to stop unexpected results if a negative value gets converted to a large unsigned value. However it also rejects 'unsigned int' v 'unsigned long' compares which are common and never problematc. Replace the 'same type' check with a 'same signedness' check. The new test isn't itself a compile time error, so use static_assert() to report the error and give a meaningful error message. Due to the way builtin_choose_expr() works detecting the error in the 'non-constant' side (where static_assert() can be used) also detects errors when the arguments are constant. Link: https://lkml.kernel.org/r/fe7e6c542e094bfca655abcd323c1c98@AcuMS.aculab.com Signed-off-by: David Laight Cc: Andy Shevchenko Cc: Christoph Hellwig Cc: Jason A. Donenfeld Cc: Linus Torvalds Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 80fcac55385ccb710d33a20dc1caaef29bd5a921 Author: David Laight Date: Mon Sep 18 08:16:30 2023 +0000 minmax: add umin(a, b) and umax(a, b) Patch series "minmax: Relax type checks in min() and max()", v4. The min() (etc) functions in minmax.h require that the arguments have exactly the same types. However when the type check fails, rather than look at the types and fix the type of a variable/constant, everyone seems to jump on min_t(). In reality min_t() ought to be rare - when something unusual is being done, not normality. The orginal min() (added in 2.4.9) replaced several inline functions and included the type - so matched the implicit casting of the function call. This was renamed min_t() in 2.4.10 and the current min() added. There is no actual indication that the conversion of negatve values to large unsigned values has ever been an actual problem. A quick grep shows 5734 min() and 4597 min_t(). Having the casts on almost half of the calls shows that something is clearly wrong. If the wrong type is picked (and it is far too easy to pick the type of the result instead of the larger input) then significant bits can get discarded. Pretty much the worst example is in the derived clamp_val(), consider: unsigned char x = 200u; y = clamp_val(x, 10u, 300u); I also suspect that many of the min_t(u16, ...) are actually wrong. For example copy_data() in printk_ringbuffer.c contains: data_size = min_t(u16, buf_size, len); Here buf_size is 'unsigned int' and len 'u16', pass a 64k buffer (can you prove that doesn't happen?) and no data is returned. Apparantly it did - and has since been fixed. The only reason that most of the min_t() are 'fine' is that pretty much all the values in the kernel are between 0 and INT_MAX. Patch 1 adds umin(), this uses integer promotions to convert both arguments to 'unsigned long long'. It can be used to compare a signed type that is known to contain a non-negative value with an unsigned type. The compiler typically optimises it all away. Added first so that it can be referred to in patch 2. Patch 2 replaces the 'same type' check with a 'same signedness' one. This makes min(unsigned_int_var, sizeof()) be ok. The error message is also improved and will contain the expanded form of both arguments (useful for seeing how constants are defined). Patch 3 just fixes some whitespace. Patch 4 allows comparisons of 'unsigned char' and 'unsigned short' to signed types. The integer promotion rules convert them both to 'signed int' prior to the comparison so they can never cause a negative value be converted to a large positive one. Patch 5 (rewritted for v4) allows comparisons of unsigned values against non-negative constant integer expressions. This makes min(unsigned_int_var, 4) be ok. The only common case that is still errored is the comparison of signed values against unsigned constant integer expressions below __INT_MAX__. Typcally min(int_val, sizeof (foo)), the real fix for this is casting the constant: min(int_var, (int)sizeof (foo)). With all the patches applied pretty much all the min_t() could be replaced by min(), and most of the rest by umin(). However they all need careful inspection due to code like: sz = min_t(unsigned char, sz - 1, LIM - 1) + 1; which converts 0 to LIM. This patch (of 6): umin() and umax() can be used when min()/max() errors a signed v unsigned compare when the signed value is known to be non-negative. Unlike min_t(some_unsigned_type, a, b) umin() will never mask off high bits if an inappropriate type is selected. The '+ 0u + 0ul + 0ull' may look strange. The '+ 0u' is needed for 'signed int' on 64bit systems. The '+ 0ul' is needed for 'signed long' on 32bit systems. The '+ 0ull' is needed for 'signed long long'. Link: https://lkml.kernel.org/r/b97faef60ad24922b530241c5d7c933c@AcuMS.aculab.com Link: https://lkml.kernel.org/r/41d93ca827a248698ec64bf57e0c05a5@AcuMS.aculab.com Signed-off-by: David Laight Cc: Andy Shevchenko Cc: Christoph Hellwig Cc: Jason A. Donenfeld Cc: Linus Torvalds Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit a287116af12b33d8a03a281fce08af5acaac6ade Author: Li kunyu Date: Tue Sep 26 10:24:10 2023 +0800 kernel/signal: remove unnecessary NULL values from ucounts ucounts is assigned first, so it does not need to initialize the assignment. Link: https://lkml.kernel.org/r/20230926022410.4280-1-kunyu@nfschina.com Signed-off-by: Li kunyu Acked-by: Oleg Nesterov Signed-off-by: Andrew Morton commit a1cfa251f8d99b8a446c395a84ec9c537d3d8c45 Author: Kees Cook Date: Fri Sep 22 10:49:30 2023 -0700 ocfs2: annotate struct ocfs2_replay_map with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ocfs2_replay_map. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Link: https://lkml.kernel.org/r/20230922174925.work.293-kees@kernel.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Signed-off-by: Andrew Morton commit 9bf2850c9170b52a6ab052085feced55effa78ef Author: Christophe JAILLET Date: Sat Sep 16 17:50:11 2023 +0200 kstrtox: remove strtobool() The conversion from strtobool() to kstrtobool() is completed. So strtobool() can now be removed. Link: https://lkml.kernel.org/r/87e3cc2547df174cd5af1fadbf866be4ef9e8e45.1694878151.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Reviewed-by: Andy Shevchenko Signed-off-by: Andrew Morton commit 5097a69d676f7e562240dbe81c21b1c62aaf5950 Author: Alexey Dobriyan Date: Sat Sep 16 21:21:31 2023 +0300 extract and use FILE_LINE macro Extract nifty FILE_LINE useful for printk style debugging: printk("%s\n", FILE_LINE); It should not be used en mass probably because __FILE__ string literals can be merged while FILE_LINE's won't. But for debugging it is what the doctor ordered. Don't add leading and trailing underscores, they're painful to type. Trust me, I've tried both versions. Link: https://lkml.kernel.org/r/ebf12ac4-5a61-4b12-b8b0-1253eb371332@p183 Signed-off-by: Alexey Dobriyan Cc: Kees Cook Cc: Takashi Iwai Cc: Thomas Gleixner Signed-off-by: Andrew Morton commit 1de9992f9de0a92b6e11133aba0e2be833c11084 Author: Li zeming Date: Wed Sep 6 02:20:06 2023 +0800 KVM: x86/mmu: Remove unnecessary ‘NULL’ values from sptep Don't initialize "spte" and "sptep" in fast_page_fault() as they are both guaranteed (for all intents and purposes) to be written at the start of every loop iteration. Add a sanity check that "sptep" is non-NULL after walking the shadow page tables, as encountering a NULL root would result in "spte" not being written, i.e. would lead to uninitialized data or the previous value being consumed. Signed-off-by: Li zeming Link: https://lore.kernel.org/r/20230905182006.2964-1-zeming@nfschina.com [sean: rewrite changelog with --verbose] Signed-off-by: Sean Christopherson commit 158978945f3173b8c1a88f8c5684a629736a57ac Author: Lorenzo Stoakes Date: Thu Oct 12 18:04:30 2023 +0100 mm: perform the mapping_map_writable() check after call_mmap() In order for a F_SEAL_WRITE sealed memfd mapping to have an opportunity to clear VM_MAYWRITE, we must be able to invoke the appropriate vm_ops->mmap() handler to do so. We would otherwise fail the mapping_map_writable() check before we had the opportunity to avoid it. This patch moves this check after the call_mmap() invocation. Only memfd actively denies write access causing a potential failure here (in memfd_add_seals()), so there should be no impact on non-memfd cases. This patch makes the userland-visible change that MAP_SHARED, PROT_READ mappings of an F_SEAL_WRITE sealed memfd mapping will now succeed. There is a delicate situation with cleanup paths assuming that a writable mapping must have occurred in circumstances where it may now not have. In order to ensure we do not accidentally mark a writable file unwritable by mistake, we explicitly track whether we have a writable mapping and unmap only if we do. [lstoakes@gmail.com: do not set writable_file_mapping in inappropriate case] Link: https://lkml.kernel.org/r/c9eb4cc6-7db4-4c2b-838d-43a0b319a4f0@lucifer.local Link: https://bugzilla.kernel.org/show_bug.cgi?id=217238 Link: https://lkml.kernel.org/r/55e413d20678a1bb4c7cce889062bbb07b0df892.1697116581.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: Jan Kara Cc: Alexander Viro Cc: Andy Lutomirski Cc: Christian Brauner Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit 28464bbb2ddc199433383994bcb9600c8034afa1 Author: Lorenzo Stoakes Date: Thu Oct 12 18:04:29 2023 +0100 mm: update memfd seal write check to include F_SEAL_WRITE The seal_check_future_write() function is called by shmem_mmap() or hugetlbfs_file_mmap() to disallow any future writable mappings of an memfd sealed this way. The F_SEAL_WRITE flag is not checked here, as that is handled via the mapping->i_mmap_writable mechanism and so any attempt at a mapping would fail before this could be run. However we intend to change this, meaning this check can be performed for F_SEAL_WRITE mappings also. The logic here is equally applicable to both flags, so update this function to accommodate both and rename it accordingly. Link: https://lkml.kernel.org/r/913628168ce6cce77df7d13a63970bae06a526e0.1697116581.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: Jan Kara Cc: Alexander Viro Cc: Andy Lutomirski Cc: Christian Brauner Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit e8e17ee90eaf650c855adb0a3e5e965fd6692ff1 Author: Lorenzo Stoakes Date: Thu Oct 12 18:04:28 2023 +0100 mm: drop the assumption that VM_SHARED always implies writable Patch series "permit write-sealed memfd read-only shared mappings", v4. The man page for fcntl() describing memfd file seals states the following about F_SEAL_WRITE:- Furthermore, trying to create new shared, writable memory-mappings via mmap(2) will also fail with EPERM. With emphasis on 'writable'. In turns out in fact that currently the kernel simply disallows all new shared memory mappings for a memfd with F_SEAL_WRITE applied, rendering this documentation inaccurate. This matters because users are therefore unable to obtain a shared mapping to a memfd after write sealing altogether, which limits their usefulness. This was reported in the discussion thread [1] originating from a bug report [2]. This is a product of both using the struct address_space->i_mmap_writable atomic counter to determine whether writing may be permitted, and the kernel adjusting this counter when any VM_SHARED mapping is performed and more generally implicitly assuming VM_SHARED implies writable. It seems sensible that we should only update this mapping if VM_MAYWRITE is specified, i.e. whether it is possible that this mapping could at any point be written to. If we do so then all we need to do to permit write seals to function as documented is to clear VM_MAYWRITE when mapping read-only. It turns out this functionality already exists for F_SEAL_FUTURE_WRITE - we can therefore simply adapt this logic to do the same for F_SEAL_WRITE. We then hit a chicken and egg situation in mmap_region() where the check for VM_MAYWRITE occurs before we are able to clear this flag. To work around this, perform this check after we invoke call_mmap(), with careful consideration of error paths. Thanks to Andy Lutomirski for the suggestion! [1]:https://lore.kernel.org/all/20230324133646.16101dfa666f253c4715d965@linux-foundation.org/ [2]:https://bugzilla.kernel.org/show_bug.cgi?id=217238 This patch (of 3): There is a general assumption that VMAs with the VM_SHARED flag set are writable. If the VM_MAYWRITE flag is not set, then this is simply not the case. Update those checks which affect the struct address_space->i_mmap_writable field to explicitly test for this by introducing [vma_]is_shared_maywrite() helper functions. This remains entirely conservative, as the lack of VM_MAYWRITE guarantees that the VMA cannot be written to. Link: https://lkml.kernel.org/r/cover.1697116581.git.lstoakes@gmail.com Link: https://lkml.kernel.org/r/d978aefefa83ec42d18dfa964ad180dbcde34795.1697116581.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Suggested-by: Andy Lutomirski Reviewed-by: Jan Kara Cc: Alexander Viro Cc: Christian Brauner Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit bc17ea26a8db89f6604d1386e08cdfc78a70f4f1 Author: SeongJae Park Date: Thu Oct 12 19:22:55 2023 +0000 Docs/admin-guide/mm/damon/usage: update for tried regions update time interval The documentation says DAMOS tried regions update feature of DAMON sysfs interface is doing the update for one aggregation interval after the request is made. Since the introduction of the per-scheme apply interval, that behavior makes no much sense. Hence the implementation has changed to update the regions for each scheme for only its apply interval. Further update the document to reflect the real behavior. Link: https://lkml.kernel.org/r/20231012192256.33556-4-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 76126332c7606ba25a4ae5db37145fd526985b45 Author: SeongJae Park Date: Thu Oct 12 19:22:54 2023 +0000 mm/damon/sysfs: avoid empty scheme tried regions for large apply interval DAMON_SYSFS assumes all schemes will be applied for at least one DAMON monitoring results snapshot within one aggregation interval, or makes no sense to wait for it while DAMON is deactivated by the watermarks. That for deactivated status still makes sense, but the aggregation interval based assumption is invalid now because each scheme can has its own apply interval. For schemes having larger than the aggregation or watermarks check interval, DAMOS tried regions update request can be finished without the update. Avoid the case by explicitly checking the status of the schemes tried regions update and watermarks based DAMON deactivation. Link: https://lkml.kernel.org/r/20231012192256.33556-3-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit 4d4e41b682990b1dc5bba2bc313800340bf5c2d4 Author: SeongJae Park Date: Thu Oct 12 19:22:53 2023 +0000 mm/damon/sysfs-schemes: do not update tried regions more than one DAMON snapshot Patch series "mm/damon/sysfs-schemes: Do DAMOS tried regions update for only one apply interval". DAMOS tried regions update feature of DAMON sysfs interface is doing the update for one aggregation interval after the request is made. Since the per-scheme apply interval is supported, that behavior makes no much sense. That is, the tried regions directory will have regions from multiple DAMON monitoring results snapshots, or no region for apply intervals that much shorter than, or longer than the aggregation interval, respectively. Update the behavior to update the regions for each scheme for only its apply interval, and update the document. Since DAMOS apply interval is the aggregation by default, this change makes no visible behavioral difference to old users who don't explicitly set the apply intervals. Patches Sequence ---------------- The first two patches makes schemes of apply intervals that much shorter or longer than the aggregation interval to keep the maximum and minimum times for continuing the update. After the two patches, the update aligns with the each scheme's apply interval. Finally, the third patch updates the document to reflect the behavior. This patch (of 3): DAMON_SYSFS exposes every DAMON-found region that eligible for applying the scheme action for one aggregation interval. However, each DAMON-based operation scheme has its own apply interval. Hence, for a scheme that having its apply interval much smaller than the aggregation interval, DAMON_SYSFS will expose the scheme regions that applied to more than one DAMON monitoring results snapshots. Since the purpose of DAMON tried regions is exposing single snapshot, this makes no much sense. Track progress of each scheme's tried regions update and avoid the case. Link: https://lkml.kernel.org/r/20231012192256.33556-1-sj@kernel.org Link: https://lkml.kernel.org/r/20231012192256.33556-2-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit d8ea435f071592d82479414e97e3c70bed204666 Author: Audra Mitchell Date: Fri Oct 13 15:03:49 2023 -0400 tools/mm: update the usage output to be more organized Organize the usage options alphabetically and improve the description of some options. Also separate the more complicated cull options from the single use compare options. Link: https://lkml.kernel.org/r/20231013190350.579407-6-audra@redhat.com Signed-off-by: Audra Mitchell Acked-by: Rafael Aquini Acked-by: Vlastimil Babka Cc: Georgi Djakov Signed-off-by: Andrew Morton commit c6d5e4901e00031650132aa30aa082a47c3796e5 Author: Audra Mitchell Date: Fri Oct 13 15:03:48 2023 -0400 tools/mm: fix the default case for page_owner_sort With the additional commands and timestamps added to the tool, the default case (-t) has been broken. Now that the allocation timestamps are saved outside of the txt field, allow us to properly sort the data by number of times the record has been seen. Furthermore prevent the misuse of the commandline arguments so only one compare option can be used. Link: https://lkml.kernel.org/r/20231013190350.579407-5-audra@redhat.com Signed-off-by: Audra Mitchell Acked-by: Rafael Aquini Acked-by: Vlastimil Babka Cc: Georgi Djakov Signed-off-by: Andrew Morton commit 63a150623a2bf94c9ed503719a3423675a3aa0d3 Author: Audra Mitchell Date: Fri Oct 13 15:03:47 2023 -0400 tools/mm: filter out timestamps for correct collation With the introduction of allocation timestamps being included in page_owner output, each record becomes unique due to the timestamp nanosecond granularity. Remove the check in add_list that tries to collate each record during processing as the memcmp() is just additional overhead at this point. Also keep the allocation timestamps, but allow collation to occur without consideration of the allocation timestamp except in the case were allocation timestamps are requested by the user (the -a option). Link: https://lkml.kernel.org/r/20231013190350.579407-4-audra@redhat.com Signed-off-by: Audra Mitchell Acked-by: Rafael Aquini Acked-by: Vlastimil Babka Cc: Georgi Djakov Signed-off-by: Andrew Morton commit 0179c62839bdc49769a986e6eb1a6ca6fc7d274a Author: Audra Mitchell Date: Fri Oct 13 15:03:46 2023 -0400 tools/mm: remove references to free_ts from page_owner_sort With the removal of free timestamps from page_owner output, we no longer need to handle this case or the "unreleased" case. Remove all references to both cases. Link: https://lkml.kernel.org/r/20231013190350.579407-3-audra@redhat.com Signed-off-by: Audra Mitchell Acked-by: Rafael Aquini Reviewed-by: Vlastimil Babka Cc: Georgi Djakov Signed-off-by: Andrew Morton commit b459f0905eec31196b6e841773aabe3194e3c3fe Author: Audra Mitchell Date: Fri Oct 13 15:03:45 2023 -0400 mm/page_owner: remove free_ts from page_owner output Patch series "Fix page_owner's use of free timestamps". While page ower output is used to investigate memory utilization, typically the allocation pathway, the introduction of timestamps to the page owner records caused each record to become unique due to the granularity of the nanosecond timestamp (for example): Page allocated via order 0 ... ts 5206196026 ns, free_ts 5187156703 ns Page allocated via order 0 ... ts 5206198540 ns, free_ts 5187162702 ns Furthermore, the page_owner output only dumps the currently allocated records, so having the free timestamps is nonsensical for the typical use case. In addition, the introduction of timestamps was not properly handled in the page_owner_sort tool causing most use cases to be broken. This series is meant to remove the free timestamps from the page_owner output and fix the page_owner_sort tool so proper collation can occur. This patch (of 5): When printing page_owner data via the sysfs interface, no free pages will ever be dumped due to the series of checks in read_page_owner(): /* * Although we do have the info about past allocation of free * pages, it's not relevant for current memory usage. */ if (!test_bit(PAGE_EXT_OWNER_ALLOCATED, &page_ext->flags)) The free_ts values are still used when dump_page_owner() is called, so keeping the field for other use cases but removing them for the typical page_owner case. Link: https://lkml.kernel.org/r/20231013190350.579407-1-audra@redhat.com Link: https://lkml.kernel.org/r/20231013190350.579407-2-audra@redhat.com Fixes: 866b48526217 ("mm/page_owner: record the timestamp of all pages during free") Signed-off-by: Audra Mitchell Acked-by: Rafael Aquini Reviewed-by: Vlastimil Babka Cc: Georgi Djakov Signed-off-by: Andrew Morton commit 93bf5d4aa27d4ba528f71483ae51fbd70edb3ce8 Author: Lorenzo Stoakes Date: Wed Oct 11 18:04:31 2023 +0100 mm: abstract VMA merge and extend into vma_merge_extend() helper mremap uses vma_merge() in the case where a VMA needs to be extended. This can be significantly simplified and abstracted. This makes it far easier to understand what the actual function is doing, avoids future mistakes in use of the confusing vma_merge() function and importantly allows us to make future changes to how vma_merge() is implemented by knowing explicitly which merge cases each invocation uses. Note that in the mremap() extend case, we perform this merge only when old_len == vma->vm_end - addr. The extension_start, i.e. the start of the extended portion of the VMA is equal to addr + old_len, i.e. vma->vm_end. With this refactoring, vma_merge() is no longer required anywhere except mm/mmap.c, so mark it static. Link: https://lkml.kernel.org/r/f16cbdc2e72d37a1a097c39dc7d1fee8919a1c93.1697043508.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: Vlastimil Babka Cc: Alexander Viro Cc: Christian Brauner Cc: Liam R. Howlett Signed-off-by: Andrew Morton commit 4b5f2d20169827add8875e78a352cf956ccdd55a Author: Lorenzo Stoakes Date: Wed Oct 11 18:04:30 2023 +0100 mm: abstract merge for new VMAs into vma_merge_new_vma() Only in mmap_region() and copy_vma() do we attempt to merge VMAs which occupy entirely new regions of virtual memory. We can abstract this logic and make the intent of this invocations of it completely explicit, rather than invoking vma_merge() with an inscrutable wall of parameters. This also paves the way for a simplification of the core vma_merge() implementation, as we seek to make it entirely an implementation detail. The VMA merge call in mmap_region() occurs only for file-backed mappings, where each of the parameters previously specified as NULL are defaulted to NULL in vma_init() (called by vm_area_alloc()). This matches the previous behaviour of specifying NULL for a number of fields, however note that prior to this call we pass the VMA to the file system driver via call_mmap(), which may in theory adjust fields that we pass in to vma_merge_new_vma(). Therefore we actually resolve an oversight here by allowing for the fact that the driver may have done this. Link: https://lkml.kernel.org/r/3dc71d17e307756a54781d4a4ce7315cf8b18bea.1697043508.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: Vlastimil Babka Cc: Alexander Viro Cc: Christian Brauner Cc: Liam R. Howlett Signed-off-by: Andrew Morton commit adb20b0c785e9e8d5e4d4a07b9c3340d7de0e5dc Author: Lorenzo Stoakes Date: Wed Oct 11 18:04:29 2023 +0100 mm: make vma_merge() and split_vma() internal Now the common pattern of - attempting a merge via vma_merge() and should this fail splitting VMAs via split_vma() - has been abstracted, the former can be placed into mm/internal.h and the latter made static. In addition, the split_vma() nommu variant also need not be exported. Link: https://lkml.kernel.org/r/405f2be10e20c4e9fbcc9fe6b2dfea105f6642e0.1697043508.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: Vlastimil Babka Cc: Alexander Viro Cc: Christian Brauner Cc: Liam R. Howlett Signed-off-by: Andrew Morton commit 94d7d923395129b9248777e575c877e40007f9dc Author: Lorenzo Stoakes Date: Wed Oct 11 18:04:28 2023 +0100 mm: abstract the vma_merge()/split_vma() pattern for mprotect() et al. mprotect() and other functions which change VMA parameters over a range each employ a pattern of:- 1. Attempt to merge the range with adjacent VMAs. 2. If this fails, and the range spans a subset of the VMA, split it accordingly. This is open-coded and duplicated in each case. Also in each case most of the parameters passed to vma_merge() remain the same. Create a new function, vma_modify(), which abstracts this operation, accepting only those parameters which can be changed. To avoid the mess of invoking each function call with unnecessary parameters, create inline wrapper functions for each of the modify operations, parameterised only by what is required to perform the action. We can also significantly simplify the logic - by returning the VMA if we split (or merged VMA if we do not) we no longer need specific handling for merge/split cases in any of the call sites. Note that the userfaultfd_release() case works even though it does not split VMAs - since start is set to vma->vm_start and end is set to vma->vm_end, the split logic does not trigger. In addition, since we calculate pgoff to be equal to vma->vm_pgoff + (start - vma->vm_start) >> PAGE_SHIFT, and start - vma->vm_start will be 0 in this instance, this invocation will remain unchanged. We eliminate a VM_WARN_ON() in mprotect_fixup() as this simply asserts that vma_merge() correctly ensures that flags remain the same, something that is already checked in is_mergeable_vma() and elsewhere, and in any case is not specific to mprotect(). Link: https://lkml.kernel.org/r/0dfa9368f37199a423674bf0ee312e8ea0619044.1697043508.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: Vlastimil Babka Cc: Alexander Viro Cc: Christian Brauner Cc: Liam R. Howlett Signed-off-by: Andrew Morton commit 3657fdc2451abf135c2d20949acf57d78cc50338 Author: Lorenzo Stoakes Date: Wed Oct 11 18:04:27 2023 +0100 mm: move vma_policy() and anon_vma_name() decls to mm_types.h Patch series "Abstract vma_merge() and split_vma()", v4. The vma_merge() interface is very confusing and its implementation has led to numerous bugs as a result of that confusion. In addition there is duplication both in invocation of vma_merge(), but also in the common mprotect()-style pattern of attempting a merge, then if this fails, splitting the portion of a VMA about to have its attributes changed. This pattern has been copy/pasted around the kernel in each instance where such an operation has been required, each very slightly modified from the last to make it even harder to decipher what is going on. Simplify the whole thing by dividing the actual uses of vma_merge() and split_vma() into specific and abstracted functions and de-duplicate the vma_merge()/split_vma() pattern altogether. Doing so also opens the door to changing how vma_merge() is implemented - by knowing precisely what cases a caller is invoking rather than having a central interface where anything might happen we can untangle the brittle and confusing vma_merge() implementation into something more workable. For mprotect()-like cases we introduce vma_modify() which performs the vma_merge()/split_vma() pattern, returning a pointer to either the merged or split VMA or an ERR_PTR(err) if the splits fail. We provide a number of inline helper functions to make things even clearer:- * vma_modify_flags() - Prepare to modify the VMA's flags. * vma_modify_flags_name() - Prepare to modify the VMA's flags/anon_vma_name * vma_modify_policy() - Prepare to modify the VMA's mempolicy. * vma_modify_flags_uffd() - Prepare to modify the VMA's flags/uffd context. For cases where a new VMA is attempted to be merged with adjacent VMAs we add:- * vma_merge_new_vma() - Prepare to merge a new VMA. * vma_merge_extend() - Prepare to extend the end of a new VMA. This patch (of 5): The vma_policy() define is a helper specifically for a VMA field so it makes sense to host it in the memory management types header. The anon_vma_name(), anon_vma_name_alloc() and anon_vma_name_free() functions are a little out of place in mm_inline.h as they define external functions, and so it makes sense to locate them in mm_types.h. The purpose of these relocations is to make it possible to abstract static inline wrappers which invoke both of these helpers. Link: https://lkml.kernel.org/r/cover.1697043508.git.lstoakes@gmail.com Link: https://lkml.kernel.org/r/24bfc6c9e382fffbcb0ea8d424392c27d56cc8ca.1697043508.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: Vlastimil Babka Cc: Alexander Viro Cc: Christian Brauner Cc: Liam R. Howlett Cc: Lorenzo Stoakes Signed-off-by: Andrew Morton commit 37acade0ce8938f00d6979bd02b8043b5b7089ae Author: Matthew Wilcox (Oracle) Date: Tue Oct 10 04:58:29 2023 +0100 sched: remove wait bookmarks There are no users of wait bookmarks left, so simplify the wait code by removing them. Link: https://lkml.kernel.org/r/20231010035829.544242-2-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Ingo Molnar Cc: Benjamin Segall Cc: Bin Lai Cc: Daniel Bristot de Oliveira Cc: Dietmar Eggemann Cc: Ingo Molnar Cc: Juri Lelli Cc: Mel Gorman Cc: Peter Zijlstra Cc: Steven Rostedt (Google) Cc: Valentin Schneider Cc: Vincent Guittot Signed-off-by: Andrew Morton commit b0b598ee08f9759b70971e297cf7ddd3eaaa5245 Author: Matthew Wilcox (Oracle) Date: Tue Oct 10 04:58:28 2023 +0100 filemap: remove use of wait bookmarks The original problem of the overly long list of waiters on a locked page was solved properly by commit 9a1ea439b16b ("mm: put_and_wait_on_page_locked() while page is migrated"). In the meantime, using bookmarks for the writeback bit can cause livelocks, so we need to stop using them. Link: https://lkml.kernel.org/r/20231010035829.544242-1-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Bin Lai Cc: Benjamin Segall Cc: Daniel Bristot de Oliveira Cc: Dietmar Eggemann Cc: Ingo Molnar Cc: Juri Lelli Cc: Matthew Wilcox (Oracle) Cc: Mel Gorman Cc: Peter Zijlstra Cc: Steven Rostedt (Google) Cc: Valentin Schneider Cc: Vincent Guittot Cc: Ingo Molnar Signed-off-by: Andrew Morton commit 9b91432985851e5d55a41478bc0ecf93bf746981 Author: Lorenzo Stoakes Date: Tue Oct 10 08:25:02 2023 +0100 mm/mprotect: allow unfaulted VMAs to be unaccounted on mprotect() When mprotect() is used to make unwritable VMAs writable, they have the VM_ACCOUNT flag applied and memory accounted accordingly. If the VMA has had no pages faulted in and is then made unwritable once again, it will remain accounted for, despite not being capable of extending memory usage. Consider:- ptr = mmap(NULL, page_size * 3, PROT_READ, MAP_ANON | MAP_PRIVATE, -1, 0); mprotect(ptr + page_size, page_size, PROT_READ | PROT_WRITE); mprotect(ptr + page_size, page_size, PROT_READ); The first mprotect() splits the range into 3 VMAs and the second fails to merge the three as the middle VMA has VM_ACCOUNT set and the others do not, rendering them unmergeable. This is unnecessary, since no pages have actually been allocated and the middle VMA is not capable of utilising more memory, thereby introducing unnecessary VMA fragmentation (and accounting for more memory than is necessary). Since we cannot efficiently determine which pages map to an anonymous VMA, we have to be very conservative - determining whether any pages at all have been faulted in, by checking whether vma->anon_vma is NULL. We can see that the lack of anon_vma implies that no anonymous pages are present as evidenced by vma_needs_copy() utilising this on fork to determine whether page tables need to be copied. The only place where anon_vma is set NULL explicitly is on fork with VM_WIPEONFORK set, however since this flag is intended to cause the child process to not CoW on a given memory range, it is right to interpret this as indicating the VMA has no faulted-in anonymous memory mapped. If the VMA was forked without VM_WIPEONFORK set, then anon_vma_fork() will have ensured that a new anon_vma is assigned (and correctly related to its parent anon_vma) should any pages be CoW-mapped. The overall operation is safe against races as we hold a write lock against mm->mmap_lock. If we could efficiently look up the VMA's faulted-in pages then we would unaccount all those pages not yet faulted in. However as the original comment alludes this simply isn't currently possible, so we are conservative and account all pages or none at all. Link: https://lkml.kernel.org/r/ad5540371a16623a069f03f4db1739f33cde1fab.1696921767.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Acked-by: Vlastimil Babka Acked-by: Mike Rapoport (IBM) Cc: David Hildenbrand Cc: Liam R. Howlett Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit f04eba134e598d4a5af2eeecff0562df5042cbfc Author: Lucy Mielke Date: Fri Oct 6 22:30:51 2023 +0200 mm: add printf attribute to shrinker_debugfs_name_alloc This fixes a compiler warning when compiling an allyesconfig with W=1: mm/internal.h:1235:9: error: function might be a candidate for `gnu_printf' format attribute [-Werror=suggest-attribute=format] [akpm@linux-foundation.org: fix shrinker_alloc() as welll per Qi Zheng] Link: https://lkml.kernel.org/r/822387b7-4895-4e64-5806-0f56b5d6c447@bytedance.com Link: https://lkml.kernel.org/r/ZSBue-3kM6gI6jCr@mainframe Fixes: c42d50aefd17 ("mm: shrinker: add infrastructure for dynamically allocating shrinker") Signed-off-by: Lucy Mielke Cc: Qi Zheng Signed-off-by: Andrew Morton commit 7a81751fcdeb833acc858e59082688e3020bfe12 Author: Zach O'Keefe Date: Mon Sep 25 13:01:10 2023 -0700 mm/thp: fix "mm: thp: kill __transhuge_page_enabled()" The 6.0 commits: commit 9fec51689ff6 ("mm: thp: kill transparent_hugepage_active()") commit 7da4e2cb8b1f ("mm: thp: kill __transhuge_page_enabled()") merged "can we have THPs in this VMA?" logic that was previously done separately by fault-path, khugepaged, and smaps "THPeligible" checks. During the process, the semantics of the fault path check changed in two ways: 1) A VM_NO_KHUGEPAGED check was introduced (also added to smaps path). 2) We no longer checked if non-anonymous memory had a vm_ops->huge_fault handler that could satisfy the fault. Previously, this check had been done in create_huge_pud() and create_huge_pmd() routines, but after the changes, we never reach those routines. During the review of the above commits, it was determined that in-tree users weren't affected by the change; most notably, since the only relevant user (in terms of THP) of VM_MIXEDMAP or ->huge_fault is DAX, which is explicitly approved early in approval logic. However, this was a bad assumption to make as it assumes the only reason to support ->huge_fault was for DAX (which is not true in general). Remove the VM_NO_KHUGEPAGED check when not in collapse path and give any ->huge_fault handler a chance to handle the fault. Note that we don't validate the file mode or mapping alignment, which is consistent with the behavior before the aforementioned commits. Link: https://lkml.kernel.org/r/20230925200110.1979606-1-zokeefe@google.com Fixes: 7da4e2cb8b1f ("mm: thp: kill __transhuge_page_enabled()") Reported-by: Saurabh Singh Sengar Signed-off-by: Zach O'Keefe Cc: Yang Shi Cc: Matthew Wilcox Cc: David Hildenbrand Cc: Ryan Roberts Signed-off-by: Andrew Morton commit c0dddb7aa5f85e6150a1e3230e01d5ba286eded9 Author: Nhat Pham Date: Fri Oct 6 11:46:29 2023 -0700 selftests: add a selftest to verify hugetlb usage in memcg This patch add a new kselftest to demonstrate and verify the new hugetlb memcg accounting behavior. Link: https://lkml.kernel.org/r/20231006184629.155543-5-nphamcs@gmail.com Signed-off-by: Nhat Pham Cc: Frank van der Linden Cc: Johannes Weiner Cc: Michal Hocko Cc: Mike Kravetz Cc: Muchun Song Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Shuah Khan Cc: Tejun heo Cc: Yosry Ahmed Cc: Zefan Li Signed-off-by: Andrew Morton commit 8cba9576df601c384abd334a503c3f6e1e29eefb Author: Nhat Pham Date: Fri Oct 6 11:46:28 2023 -0700 hugetlb: memcg: account hugetlb-backed memory in memory controller Currently, hugetlb memory usage is not acounted for in the memory controller, which could lead to memory overprotection for cgroups with hugetlb-backed memory. This has been observed in our production system. For instance, here is one of our usecases: suppose there are two 32G containers. The machine is booted with hugetlb_cma=6G, and each container may or may not use up to 3 gigantic page, depending on the workload within it. The rest is anon, cache, slab, etc. We can set the hugetlb cgroup limit of each cgroup to 3G to enforce hugetlb fairness. But it is very difficult to configure memory.max to keep overall consumption, including anon, cache, slab etc. fair. What we have had to resort to is to constantly poll hugetlb usage and readjust memory.max. Similar procedure is done to other memory limits (memory.low for e.g). However, this is rather cumbersome and buggy. Furthermore, when there is a delay in memory limits correction, (for e.g when hugetlb usage changes within consecutive runs of the userspace agent), the system could be in an over/underprotected state. This patch rectifies this issue by charging the memcg when the hugetlb folio is utilized, and uncharging when the folio is freed (analogous to the hugetlb controller). Note that we do not charge when the folio is allocated to the hugetlb pool, because at this point it is not owned by any memcg. Some caveats to consider: * This feature is only available on cgroup v2. * There is no hugetlb pool management involved in the memory controller. As stated above, hugetlb folios are only charged towards the memory controller when it is used. Host overcommit management has to consider it when configuring hard limits. * Failure to charge towards the memcg results in SIGBUS. This could happen even if the hugetlb pool still has pages (but the cgroup limit is hit and reclaim attempt fails). * When this feature is enabled, hugetlb pages contribute to memory reclaim protection. low, min limits tuning must take into account hugetlb memory. * Hugetlb pages utilized while this option is not selected will not be tracked by the memory controller (even if cgroup v2 is remounted later on). Link: https://lkml.kernel.org/r/20231006184629.155543-4-nphamcs@gmail.com Signed-off-by: Nhat Pham Acked-by: Johannes Weiner Cc: Frank van der Linden Cc: Michal Hocko Cc: Mike Kravetz Cc: Muchun Song Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Shuah Khan Cc: Tejun heo Cc: Yosry Ahmed Cc: Zefan Li Signed-off-by: Andrew Morton commit 85ce2c517ade0d51b7ad95f2e88be9bbe294379a Author: Nhat Pham Date: Fri Oct 6 11:46:27 2023 -0700 memcontrol: only transfer the memcg data for migration For most migration use cases, only transfer the memcg data from the old folio to the new folio, and clear the old folio's memcg data. No charging and uncharging will be done. This shaves off some work on the migration path, and avoids the temporary double charging of a folio during its migration. The only exception is replace_page_cache_folio(), which will use the old mem_cgroup_migrate() (now renamed to mem_cgroup_replace_folio). In that context, the isolation of the old page isn't quite as thorough as with migration, so we cannot use our new implementation directly. This patch is the result of the following discussion on the new hugetlb memcg accounting behavior: https://lore.kernel.org/lkml/20231003171329.GB314430@monkey/ Link: https://lkml.kernel.org/r/20231006184629.155543-3-nphamcs@gmail.com Signed-off-by: Nhat Pham Suggested-by: Johannes Weiner Acked-by: Johannes Weiner Cc: Frank van der Linden Cc: Michal Hocko Cc: Mike Kravetz Cc: Muchun Song Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Shuah Khan Cc: Tejun heo Cc: Yosry Ahmed Cc: Zefan Li Signed-off-by: Andrew Morton commit 4b569387c0d566db288e7c3e1b484b43df797bdb Author: Nhat Pham Date: Fri Oct 6 11:46:26 2023 -0700 memcontrol: add helpers for hugetlb memcg accounting Patch series "hugetlb memcg accounting", v4. Currently, hugetlb memory usage is not acounted for in the memory controller, which could lead to memory overprotection for cgroups with hugetlb-backed memory. This has been observed in our production system. For instance, here is one of our usecases: suppose there are two 32G containers. The machine is booted with hugetlb_cma=6G, and each container may or may not use up to 3 gigantic page, depending on the workload within it. The rest is anon, cache, slab, etc. We can set the hugetlb cgroup limit of each cgroup to 3G to enforce hugetlb fairness. But it is very difficult to configure memory.max to keep overall consumption, including anon, cache, slab etcetera fair. What we have had to resort to is to constantly poll hugetlb usage and readjust memory.max. Similar procedure is done to other memory limits (memory.low for e.g). However, this is rather cumbersome and buggy. Furthermore, when there is a delay in memory limits correction, (for e.g when hugetlb usage changes within consecutive runs of the userspace agent), the system could be in an over/underprotected state. This patch series rectifies this issue by charging the memcg when the hugetlb folio is allocated, and uncharging when the folio is freed. In addition, a new selftest is added to demonstrate and verify this new behavior. This patch (of 4): This patch exposes charge committing and cancelling as parts of the memory controller interface. These functionalities are useful when the try_charge() and commit_charge() stages have to be separated by other actions in between (which can fail). One such example is the new hugetlb accounting behavior in the following patch. The patch also adds a helper function to obtain a reference to the current task's memcg. Link: https://lkml.kernel.org/r/20231006184629.155543-1-nphamcs@gmail.com Link: https://lkml.kernel.org/r/20231006184629.155543-2-nphamcs@gmail.com Signed-off-by: Nhat Pham Acked-by: Michal Hocko Acked-by: Johannes Weiner Cc: Frank van der Linden Cc: Mike Kravetz Cc: Muchun Song Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Shuah Khan Cc: Tejun heo Cc: Yosry Ahmed Cc: Zefan Li Signed-off-by: Andrew Morton commit 59838b2566f6d03099743675a2e0f425813078c6 Author: Frank van der Linden Date: Wed Oct 4 15:32:48 2023 +0000 mm, hugetlb: remove HUGETLB_CGROUP_MIN_ORDER Originally, hugetlb_cgroup was the only hugetlb user of tail page structure fields. So, the code defined and checked against HUGETLB_CGROUP_MIN_ORDER to make sure pages weren't too small to use. However, by now, tail page #2 is used to store hugetlb hwpoison and subpool information as well. In other words, without that tail page hugetlb doesn't work. Acknowledge this fact by getting rid of HUGETLB_CGROUP_MIN_ORDER and checks against it. Instead, just check for the minimum viable page order at hstate creation time. Link: https://lkml.kernel.org/r/20231004153248.3842997-1-fvdl@google.com Signed-off-by: Frank van der Linden Reviewed-by: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit 2580d554585c52a644839864ef9238af5b030ebc Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:17 2023 +0100 mm: use folio_xor_flags_has_waiters() in folio_end_writeback() Match how folio_unlock() works by combining the test for PG_waiters with the clearing of PG_writeback. This should have a small performance win, and removes the last user of folio_wake(). Link: https://lkml.kernel.org/r/20231004165317.1061855-18-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit 7d0795d098a127508f3e29ab4257c9ab598efaea Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:16 2023 +0100 mm: make __end_folio_writeback() return void Rather than check the result of test-and-clear, just check that we have the writeback bit set at the start. This wouldn't catch every case, but it's good enough (and enables the next patch). Link: https://lkml.kernel.org/r/20231004165317.1061855-17-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit 0410cd844ed0af3db3cb510d877d62c66d26e5cc Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:15 2023 +0100 mm: add folio_xor_flags_has_waiters() Optimise folio_end_read() by setting the uptodate bit at the same time we clear the unlock bit. This saves at least one memory barrier and one write-after-write hazard. Link: https://lkml.kernel.org/r/20231004165317.1061855-16-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit f12fb73b74fd23ca33e3f95fb996f295eeae1da7 Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:14 2023 +0100 mm: delete checks for xor_unlock_is_negative_byte() Architectures which don't define their own use the one in asm-generic/bitops/lock.h. Get rid of all the ifdefs around "maybe we don't have it". Link: https://lkml.kernel.org/r/20231004165317.1061855-15-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Geert Uytterhoeven Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit 12010aa89f8705c8bacddc5c2276cc80badeac56 Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:13 2023 +0100 s390: implement arch_xor_unlock_is_negative_byte Inspired by the s390 arch_test_and_clear_bit(), this will surely be more efficient than the generic one defined in filemap.c. Link: https://lkml.kernel.org/r/20231004165317.1061855-14-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit 2a667285b53c58d72f8bdb736c040f0f36bff58a Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:12 2023 +0100 riscv: implement xor_unlock_is_negative_byte Inspired by the riscv clear_bit_unlock(), this will surely be more efficient than the generic one defined in filemap.c. Link: https://lkml.kernel.org/r/20231004165317.1061855-13-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit 51a752c28bcf901618bbc25a43f84ef539f9e682 Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:11 2023 +0100 powerpc: implement arch_xor_unlock_is_negative_byte on 32-bit Simply remove the ifdef. The assembly is identical to that in the non-optimised case of test_and_clear_bits() on PPC32, and it's not clear to me how the PPC32 optimisation works, nor whether it would work for arch_xor_unlock_is_negative_byte(). If that optimisation would work, someone can implement it later, but this is more efficient than the implementation in filemap.c. Link: https://lkml.kernel.org/r/20231004165317.1061855-12-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit 8da36b26e3d8640364a9e60e0b5c3fa3f55d298b Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:10 2023 +0100 mips: implement xor_unlock_is_negative_byte Inspired by the mips test_and_change_bit(), this will surely be more efficient than the generic one defined in filemap.c Link: https://lkml.kernel.org/r/20231004165317.1061855-11-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit ea845e3173f7552aae539aeb943cd19ebe90ba38 Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:09 2023 +0100 m68k: implement xor_unlock_is_negative_byte Using EOR to clear the guaranteed-to-be-set lock bit will test the negative flag just like the x86 implementation. This should be more efficient than the generic implementation in filemap.c. It would be better if m68k had __GCC_ASM_FLAG_OUTPUTS__. Coldfire doesn't have a byte-sized EOR, so we test bit 7 after the EOR, which is a second memory access, but it's slightly better than the current C code. Link: https://lkml.kernel.org/r/20231004165317.1061855-10-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit e28ff5dc8cf6aec042741f1ea62089dca6a894ab Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:08 2023 +0100 alpha: implement xor_unlock_is_negative_byte Inspired by the alpha clear_bit() and arch_atomic_add_return(), this will surely be more efficient than the generic one defined in filemap.c. Link: https://lkml.kernel.org/r/20231004165317.1061855-9-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit 247dbcdbf790c52fc76cf8e327cd0a5778e41e66 Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:07 2023 +0100 bitops: add xor_unlock_is_negative_byte() Replace clear_bit_and_unlock_is_negative_byte() with xor_unlock_is_negative_byte(). We have a few places that like to lock a folio, set a flag and unlock it again. Allow for the possibility of combining the latter two operations for efficiency. We are guaranteed that the caller holds the lock, so it is safe to unlock it with the xor. The caller must guarantee that nobody else will set the flag without holding the lock; it is not safe to do this with the PG_dirty flag, for example. Link: https://lkml.kernel.org/r/20231004165317.1061855-8-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit 7a4847e54cc1889d109ce2a6ebed19aafc4a4af8 Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:06 2023 +0100 iomap: use folio_end_read() Combine the setting of the uptodate flag with the clearing of the locked flag. Link: https://lkml.kernel.org/r/20231004165317.1061855-7-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit 6ba924d341c24027d95352ae8802c9cd1c308559 Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:05 2023 +0100 buffer: use folio_end_read() There are two places that we can use this new helper. Link: https://lkml.kernel.org/r/20231004165317.1061855-6-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit f8174a1181220d24d6b4332216112318f5905729 Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:04 2023 +0100 ext4: use folio_end_read() folio_end_read() is the perfect fit for ext4. Link: https://lkml.kernel.org/r/20231004165317.1061855-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit 0b237047d5a72ffe06c0bdf2f4536f669dcd31c9 Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:03 2023 +0100 mm: add folio_end_read() Provide a function for filesystems to call when they have finished reading an entire folio. Link: https://lkml.kernel.org/r/20231004165317.1061855-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit f45b494e2a24d86afd79cab7c343b414c5213447 Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:02 2023 +0100 iomap: protect read_bytes_pending with the state_lock Perform one atomic operation (acquiring the spinlock) instead of two (spinlock & atomic_sub) per read completion. Link: https://lkml.kernel.org/r/20231004165317.1061855-3-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Albert Ou Cc: Alexander Gordeev Cc: Andreas Dilger Cc: Christian Borntraeger Cc: Christophe Leroy Cc: Geert Uytterhoeven Cc: Heiko Carstens Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Richard Henderson Cc: Sven Schnelle Cc: "Theodore Ts'o" Cc: Thomas Bogendoerfer Cc: Vasily Gorbik Signed-off-by: Andrew Morton commit 279d5fc3227f04ef2c6125e5c440e7952173a89a Author: Matthew Wilcox (Oracle) Date: Wed Oct 4 17:53:01 2023 +0100 iomap: hold state_lock over call to ifs_set_range_uptodate() Patch series "Add folio_end_read", v2. The core of this patchset is the new folio_end_read() call which filesystems can use when finishing a page cache read instead of separate calls to mark the folio uptodate and unlock it. As an illustration of its use, I converted ext4, iomap & mpage; more can be converted. I think that's useful by itself, but the interesting optimisation is that we can implement that with a single XOR instruction that sets the uptodate bit, clears the lock bit, tests the waiter bit and provides a write memory barrier. That removes one memory barrier and one atomic instruction from each page read, which seems worth doing. That's in patch 15. The last two patches could be a separate series, but basically we can do the same thing with the writeback flag that we do with the unlock flag; clear it and test the waiters bit at the same time. This patch (of 17): This is really preparation for the next patch, but it lets us call folio_mark_uptodate() in just one place instead of two. Link: https://lkml.kernel.org/r/20231004165317.1061855-1-willy@infradead.org Link: https://lkml.kernel.org/r/20231004165317.1061855-2-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Matthew Wilcox (Oracle) Cc: Nicholas Piggin Cc: "Theodore Ts'o" Cc: Andreas Dilger Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Thomas Bogendoerfer Cc: Michael Ellerman Cc: Christophe Leroy Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Sven Schnelle Cc: Geert Uytterhoeven Signed-off-by: Andrew Morton commit 116d57303a051bb2c7939a5026e441d8a7845db2 Author: Breno Leitao Date: Thu Oct 5 09:39:22 2023 -0700 selftests/mm: add a new test for madv and hugetlb Create a selftest that exercises the race between page faults and madvise(MADV_DONTNEED) in the same huge page. Do it by running two threads that touches the huge page and madvise(MADV_DONTNEED) at the same time. In case of a SIGBUS coming at pagefault, the test should fail, since we hit the bug. The test doesn't have a signal handler, and if it fails, it fails like the following ---------------------------------- running ./hugetlb_fault_after_madv ---------------------------------- ./run_vmtests.sh: line 186: 595563 Bus error (core dumped) "$@" [FAIL] This selftest goes together with the fix of the bug[1] itself. [1] https://lore.kernel.org/all/20231001005659.2185316-1-riel@surriel.com/#r Link: https://lkml.kernel.org/r/20231005163922.87568-3-leitao@debian.org Signed-off-by: Breno Leitao Reviewed-by: Rik van Riel Tested-by: Rik van Riel Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit c8b90731427814b1e265c3c2bc01c38406963c32 Author: Breno Leitao Date: Thu Oct 5 09:39:21 2023 -0700 selftests/mm: export get_free_hugepages() Patch series "New selftest for mm", v2. This is a simple test case that reproduces an mm problem[1], where a page fault races with madvise(), and it is not trivial to reproduce and debug. This test-case aims to avoid such race problems from happening again, impacting workloads that leverages external allocators, such as tcmalloc, jemalloc, etc. [1] https://lore.kernel.org/all/20231001005659.2185316-1-riel@surriel.com/#r This patch (of 2): get_free_hugepages() is helpful for other hugepage tests. Export it to the common file (vm_util.c) to be reused. Link: https://lkml.kernel.org/r/20231005163922.87568-1-leitao@debian.org Link: https://lkml.kernel.org/r/20231005163922.87568-2-leitao@debian.org Signed-off-by: Breno Leitao Reviewed-by: Rik van Riel Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit afb2d666d0250e707eef3c5947165b414268244b Author: Mark-PK Tsai Date: Fri Oct 6 14:02:40 2023 +0800 zsmalloc: use copy_page for full page copy Some architectures have implemented optimized copy_page for full page copying, such as arm. On my arm platform, use the copy_page helper for single page copying is about 10 percent faster than memcpy. Link: https://lkml.kernel.org/r/20231006060245.7411-1-mark-pk.tsai@mediatek.com Signed-off-by: Mark-PK Tsai Reviewed-by: Sergey Senozhatsky Cc: AngeloGioacchino Del Regno Cc: Matthias Brugger Cc: Minchan Kim Cc: YJ Chiang Signed-off-by: Andrew Morton commit bafd7e9d353ea091958d0dc702390add34b480e9 Author: Pankaj Raghav Date: Fri Oct 6 13:01:20 2023 +0200 filemap: call filemap_get_folios_tag() from filemap_get_folios() filemap_get_folios() is filemap_get_folios_tag() with XA_PRESENT as the tag that is being matched. Return filemap_get_folios_tag() with XA_PRESENT as the tag instead of duplicating the code in filemap_get_folios(). No functional changes. Link: https://lkml.kernel.org/r/20231006110120.136809-1-kernel@pankajraghav.com Signed-off-by: Pankaj Raghav Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 0dfca313a009c83e2ad44b3719dc1222df6c6db5 Author: Kemeng Shi Date: Wed Sep 27 18:35:14 2023 +0800 mm/page_alloc: remove unnecessary next_page in break_down_buddy_pages The next_page is only used to forward page in case target is in second half range. Move forward page directly to remove unnecessary next_page. Link: https://lkml.kernel.org/r/20230927103514.98281-3-shikemeng@huaweicloud.com Signed-off-by: Kemeng Shi Acked-by: Naoya Horiguchi Cc: Matthew Wilcox (Oracle) Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 27e0db3c21aaf1422980e64b77956e15b839306f Author: Kemeng Shi Date: Wed Sep 27 18:35:13 2023 +0800 mm/page_alloc: remove unnecessary check in break_down_buddy_pages Patch series "Two minor cleanups to break_down_buddy_pages", v2. Two minor cleanups to break_down_buddy_pages. This patch (of 2): 1. We always have target in range started with next_page and full free range started with current_buddy. 2. The last split range size is 1 << low and low should be >= 0, then size >= 1. So page + size != page is always true (because size > 0). As summary, current_page will not equal to target page. Link: https://lkml.kernel.org/r/20230927103514.98281-1-shikemeng@huaweicloud.com Link: https://lkml.kernel.org/r/20230927103514.98281-2-shikemeng@huaweicloud.com Signed-off-by: Kemeng Shi Acked-by: Naoya Horiguchi Cc: Matthew Wilcox (Oracle) Cc: Oscar Salvador Signed-off-by: Andrew Morton commit 9a12d103f7d2d524f5e3d4358b9a9c03e4a9f1d2 Author: Liam R. Howlett Date: Fri Sep 29 14:30:41 2023 -0400 mmap: add clarifying comment to vma_merge() code When tracing through the code in vma_merge(), it was not completely clear why the error return to a dup_anon_vma() call would not overwrite a previous attempt to the same function. This commit adds a comment specifying why it is safe. Link: https://lkml.kernel.org/r/20230929183041.2835469-4-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett Suggested-by: Jann Horn Link: https://lore.kernel.org/linux-mm/CAG48ez3iDwFPR=Ed1BfrNuyUJPMK_=StjxhUsCkL6po1s7bONg@mail.gmail.com/ Reviewed-by: Lorenzo Stoakes Acked-by: Vlastimil Babka Cc: Matthew Wilcox (Oracle) Cc: Suren Baghdasaryan Signed-off-by: Andrew Morton commit 651acf0ceb72903ff16fe31e52c1c448a0ca880c Author: Andrey Konovalov Date: Fri Oct 6 17:18:46 2023 +0200 Documentation: *san: drop "the" from article titles Drop "the" from the titles of documentation articles for KASAN, KCSAN, and KMSAN, as it is redundant. Also add SPDX-License-Identifier for kasan.rst. Link: https://lkml.kernel.org/r/1c4eb354a3a7b8ab56bf0c2fc6157c22050793ca.1696605143.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: kernel test robot Cc: Marco Elver Signed-off-by: Andrew Morton commit ff093a9632d9de9ff66dfd9db211008138520e13 Author: Andrey Konovalov Date: Fri Oct 6 17:18:45 2023 +0200 kasan: fix and update KUNIT_EXPECT_KASAN_FAIL comment Update the comment for KUNIT_EXPECT_KASAN_FAIL to describe the parameters this macro accepts. Also drop the mention of the "kasan_status" KUnit resource, as it no longer exists. Link: https://lkml.kernel.org/r/6fad6661e72c407450ae4b385c71bc4a7e1579cd.1696605143.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202308171757.7V5YUcje-lkp@intel.com/ Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Signed-off-by: Andrew Morton commit 01a5ad81637672940844052404678678a0ec8854 Author: Andrey Konovalov Date: Fri Oct 6 17:18:44 2023 +0200 kasan: use unchecked __memset internally KASAN code is supposed to use the unchecked __memset implementation when accessing its metadata. Change uses of memset to __memset in mm/kasan/. Link: https://lkml.kernel.org/r/6f621966c6f52241b5aaa7220c348be90c075371.1696605143.git.andreyknvl@google.com Fixes: 59e6e098d1c1 ("kasan: introduce kasan_complete_mode_report_info") Fixes: 3c5c3cfb9ef4 ("kasan: support backing vmalloc space with real shadow memory") Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: kernel test robot Signed-off-by: Andrew Morton commit d7196d87a1559db9ece24852e6167061b199d58d Author: Andrey Konovalov Date: Fri Oct 6 17:18:43 2023 +0200 kasan: unify printk prefixes Unify prefixes for printk messages in mm/kasan/. Link: https://lkml.kernel.org/r/35589629806cf0840e5f01ec9d8011a7bad648df.1696605143.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: kernel test robot Signed-off-by: Andrew Morton commit 416a616e5481b3757a3a6f1ccdb15a2b75c26dca Author: Andrey Konovalov Date: Fri Oct 6 17:18:42 2023 +0200 arm64, kasan: update comment in kasan_init Patch series "kasan: assorted fixes and improvements". This patch (of 5): Update the comment in kasan_init to also mention the Hardware Tag-Based KASAN mode. Link: https://lkml.kernel.org/r/cover.1696605143.git.andreyknvl@google.com Link: https://lkml.kernel.org/r/4186aefd368b019eaf27c907c4fa692a89448d66.1696605143.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Cc: kernel test robot Signed-off-by: Andrew Morton commit 6a1960b8a8773324d870fa32ba68ff3106523a95 Author: Lorenzo Stoakes Date: Tue Oct 3 00:14:54 2023 +0100 mm/gup: adapt get_user_page_vma_remote() to never return NULL get_user_pages_remote() will never return 0 except in the case of FOLL_NOWAIT being specified, which we explicitly disallow. This simplifies error handling for the caller and avoids the awkwardness of dealing with both errors and failing to pin. Failing to pin here is an error. Link: https://lkml.kernel.org/r/00319ce292d27b3aae76a0eb220ce3f528187508.1696288092.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Suggested-by: Arnd Bergmann Reviewed-by: Arnd Bergmann Acked-by: Catalin Marinas Reviewed-by: David Hildenbrand Reviewed-by: Jason Gunthorpe Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Hubbard Cc: Mark Rutland Cc: Namhyung Kim Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Richard Cochran Cc: Will Deacon Signed-off-by: Andrew Morton commit 9c4b21422507035f3e0a507a680c9b03c0bcc730 Author: Lorenzo Stoakes Date: Tue Oct 3 00:14:53 2023 +0100 mm/gup: make failure to pin an error if FOLL_NOWAIT not specified There really should be no circumstances under which a non-FOLL_NOWAIT GUP operation fails to return any pages, so make this an error and warn on it. To catch the trivial case, simply exit early if nr_pages == 0. This brings __get_user_pages_locked() in line with the behaviour of its nommu variant. Link: https://lkml.kernel.org/r/2a42d96dd1e37163f90a0019a541163dafb7e4c3.1696288092.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: Arnd Bergmann Reviewed-by: David Hildenbrand Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Catalin Marinas Cc: Ian Rogers Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Jiri Olsa Cc: John Hubbard Cc: Mark Rutland Cc: Namhyung Kim Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Richard Cochran Cc: Will Deacon Signed-off-by: Andrew Morton commit 0f20bba1688bdf3b32df0162511a67d4eda15790 Author: Lorenzo Stoakes Date: Tue Oct 3 00:14:52 2023 +0100 mm/gup: explicitly define and check internal GUP flags, disallow FOLL_TOUCH Rather than open-coding a list of internal GUP flags in is_valid_gup_args(), define which ones are internal. In addition, explicitly check to see if the user passed in FOLL_TOUCH somehow, as this appears to have been accidentally excluded. Link: https://lkml.kernel.org/r/971e013dfe20915612ea8b704e801d7aef9a66b6.1696288092.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: Arnd Bergmann Reviewed-by: David Hildenbrand Reviewed-by: Jason Gunthorpe Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Catalin Marinas Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Hubbard Cc: Mark Rutland Cc: Namhyung Kim Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Richard Cochran Cc: Will Deacon Signed-off-by: Andrew Morton commit c43cfa42541c04a3a94312e39ab81c41ba431277 Author: Lorenzo Stoakes Date: Tue Oct 3 00:14:51 2023 +0100 mm: make __access_remote_vm() static Patch series "various improvements to the GUP interface", v2. A series of fixes to simplify and improve the GUP interface with an eye to providing groundwork to future improvements:- * __access_remote_vm() and access_remote_vm() are functionally identical, so make the former static such that in future we can potentially change the external-facing implementation details of this function. * Extend is_valid_gup_args() to cover the missing FOLL_TOUCH case, and simplify things by defining INTERNAL_GUP_FLAGS to check against. * Adjust __get_user_pages_locked() to explicitly treat a failure to pin any pages as an error in all circumstances other than FOLL_NOWAIT being specified, bringing it in line with the nommu implementation of this function. * (With many thanks to Arnd who suggested this in the first instance) Update get_user_page_vma_remote() to explicitly only return a page or an error, simplifying the interface and avoiding the questionable IS_ERR_OR_NULL() pattern. This patch (of 4): access_remote_vm() passes through parameters to __access_remote_vm() directly, so remove the __access_remote_vm() function from mm.h and use access_remote_vm() in the one caller that needs it (ptrace_access_vm()). This allows future adjustments to the GUP-internal __access_remote_vm() function while keeping the access_remote_vm() function stable. Link: https://lkml.kernel.org/r/cover.1696288092.git.lstoakes@gmail.com Link: https://lkml.kernel.org/r/f7877c5039ce1c202a514a8aeeefc5cdd5e32d19.1696288092.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: Arnd Bergmann Reviewed-by: David Hildenbrand Reviewed-by: Jason Gunthorpe Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Catalin Marinas Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Hubbard Cc: Mark Rutland Cc: Namhyung Kim Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Richard Cochran Cc: Will Deacon Signed-off-by: Andrew Morton commit 8c2214fc9a470aee0c615aeb14d8c7ce98e45a08 Author: Jaewon Kim Date: Tue Oct 3 20:41:55 2023 +0900 mm: multi-gen LRU: reuse some legacy trace events As the legacy lru provides, the mglru needs some trace events for debugging. Let's reuse following legacy events for the mglru. trace_mm_vmscan_lru_isolate trace_mm_vmscan_lru_shrink_inactive Here's an example mm_vmscan_lru_isolate: classzone=2 order=0 nr_requested=4096 nr_scanned=64 nr_skipped=0 nr_taken=64 lru=inactive_file mm_vmscan_lru_shrink_inactive: nid=0 nr_scanned=64 nr_reclaimed=63 nr_dirty=0 nr_writeback=0 nr_congested=0 nr_immediate=0 nr_activate_anon=0 nr_activate_file=1 nr_ref_keep=0 nr_unmap_fail=0 priority=2 flags=RECLAIM_WB_FILE|RECLAIM_WB_ASYNC Link: https://lkml.kernel.org/r/20231003114155.21869-1-jaewon31.kim@samsung.com Signed-off-by: Jaewon Kim Acked-by: Yu Zhao Cc: Johannes Weiner Cc: Kalesh Singh Cc: SeongJae Park Cc: Steven Rostedt (Google) Cc: T.J. Mercier Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit ec47e250628903d48d9ff490c6b532df889bcaa3 Author: Gregory Price Date: Tue Oct 3 10:48:57 2023 -0400 mm/migrate: remove unused mm argument from do_move_pages_to_node This function does not actively use the mm_struct, it can be removed. Link: https://lkml.kernel.org/r/20231003144857.752952-2-gregory.price@memverge.com Signed-off-by: Gregory Price Reviewed-by: Jonathan Cameron Cc: Arnd Bergmann Cc: Gregory Price Signed-off-by: Andrew Morton commit dec078cc2181fccf8b134406b86aaacc19f7163f Author: David Hildenbrand Date: Mon Oct 2 16:29:49 2023 +0200 memory: move exclusivity detection in do_wp_page() into wp_can_reuse_anon_folio() Let's clean up do_wp_page() a bit, removing two labels and making it a easier to read. wp_can_reuse_anon_folio() now only operates on the whole folio. Move the SetPageAnonExclusive() out into do_wp_page(). No need to do this under page lock -- the page table lock is sufficient. Link: https://lkml.kernel.org/r/20231002142949.235104-4-david@redhat.com Signed-off-by: David Hildenbrand Cc: Mike Kravetz Cc: Muchun Song Cc: Suren Baghdasaryan Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 069686255c16a75b6a796e42df47f5af27b496a4 Author: David Hildenbrand Date: Mon Oct 2 16:29:48 2023 +0200 mm/rmap: convert page_move_anon_rmap() to folio_move_anon_rmap() Let's convert it to consume a folio. [akpm@linux-foundation.org: fix kerneldoc] Link: https://lkml.kernel.org/r/20231002142949.235104-3-david@redhat.com Signed-off-by: David Hildenbrand Reviewed-by: Suren Baghdasaryan Reviewed-by: Vishal Moola (Oracle) Cc: Mike Kravetz Cc: Muchun Song Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 5ca432896a4ce6d69fffc3298b24c0dd9bdb871f Author: David Hildenbrand Date: Mon Oct 2 16:29:47 2023 +0200 mm/rmap: move SetPageAnonExclusive() out of page_move_anon_rmap() Patch series "mm/rmap: convert page_move_anon_rmap() to folio_move_anon_rmap()". Convert page_move_anon_rmap() to folio_move_anon_rmap(), letting the callers handle PageAnonExclusive. I'm including cleanup patch #3 because it fits into the picture and can be done cleaner by the conversion. This patch (of 3): Let's move it into the caller: there is a difference between whether an anon folio can only be mapped by one process (e.g., into one VMA), and whether it is truly exclusive (e.g., no references -- including GUP -- from other processes). Further, for large folios the page might not actually be pointing at the head page of the folio, so it better be handled in the caller. This is a preparation for converting page_move_anon_rmap() to consume a folio. Link: https://lkml.kernel.org/r/20231002142949.235104-1-david@redhat.com Link: https://lkml.kernel.org/r/20231002142949.235104-2-david@redhat.com Signed-off-by: David Hildenbrand Reviewed-by: Suren Baghdasaryan Reviewed-by: Vishal Moola (Oracle) Cc: Mike Kravetz Cc: Muchun Song Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 4a68fef16df9d88d528094116f8bbd2dbfa62089 Author: Matthew Wilcox (Oracle) Date: Fri Oct 6 20:53:18 2023 +0100 mm: handle write faults to RO pages under the VMA lock I think this is a pretty rare occurrence, but for consistency handle faults with the VMA lock held the same way that we handle other faults with the VMA lock held. Link: https://lkml.kernel.org/r/20231006195318.4087158-7-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Suren Baghdasaryan Signed-off-by: Andrew Morton commit 12214eba1992642eee5813a9cc9f626e5b2d1815 Author: Matthew Wilcox (Oracle) Date: Fri Oct 6 20:53:17 2023 +0100 mm: handle read faults under the VMA lock Most file-backed faults are already handled through ->map_pages(), but if we need to do I/O we'll come this way. Since filemap_fault() is now safe to be called under the VMA lock, we can handle these faults under the VMA lock now. Link: https://lkml.kernel.org/r/20231006195318.4087158-6-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Suren Baghdasaryan Signed-off-by: Andrew Morton commit 4de8c93a4751e10737b6af65db42c743228c67a6 Author: Matthew Wilcox (Oracle) Date: Fri Oct 6 20:53:16 2023 +0100 mm: handle COW faults under the VMA lock If the page is not currently present in the page tables, we need to call the page fault handler to find out which page we're supposed to COW, so we need to both check that there is already an anon_vma and that the fault handler doesn't need the mmap_lock. Link: https://lkml.kernel.org/r/20231006195318.4087158-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Suren Baghdasaryan Signed-off-by: Andrew Morton commit 4ed4379881aa62588aba6442a9f362a8cf7624e6 Author: Matthew Wilcox (Oracle) Date: Fri Oct 6 20:53:15 2023 +0100 mm: handle shared faults under the VMA lock There are many implementations of ->fault and some of them depend on mmap_lock being held. All vm_ops that implement ->map_pages() end up calling filemap_fault(), which I have audited to be sure it does not rely on mmap_lock. So (for now) key off ->map_pages existing as a flag to indicate that it's safe to call ->fault while only holding the vma lock. Link: https://lkml.kernel.org/r/20231006195318.4087158-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Suren Baghdasaryan Signed-off-by: Andrew Morton commit 164b06f238b986317131e6b61b2f22aabcbc2cc0 Author: Matthew Wilcox (Oracle) Date: Fri Oct 6 20:53:14 2023 +0100 mm: call wp_page_copy() under the VMA lock It is usually safe to call wp_page_copy() under the VMA lock. The only unsafe situation is when no anon_vma has been allocated for this VMA, and we have to look at adjacent VMAs to determine if their anon_vma can be shared. Since this happens only for the first COW of a page in this VMA, the majority of calls to wp_page_copy() do not need to fall back to the mmap_sem. Add vmf_anon_prepare() as an alternative to anon_vma_prepare() which will return RETRY if we currently hold the VMA lock and need to allocate an anon_vma. This lets us drop the check in do_wp_page(). Link: https://lkml.kernel.org/r/20231006195318.4087158-3-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Suren Baghdasaryan Signed-off-by: Andrew Morton commit 5d74b2ab2c15d596c470bae6626f345d5575a9d0 Author: Matthew Wilcox (Oracle) Date: Fri Oct 6 20:53:13 2023 +0100 mm: make lock_folio_maybe_drop_mmap() VMA lock aware Patch series "Handle more faults under the VMA lock", v2. At this point, we're handling the majority of file-backed page faults under the VMA lock, using the ->map_pages entry point. This patch set attempts to expand that for the following siutations: - We have to do a read. This could be because we've hit the point in the readahead window where we need to kick off the next readahead, or because the page is simply not present in cache. - We're handling a write fault. Most applications don't do I/O by writes to shared mmaps for very good reasons, but some do, and it'd be nice to not make that slow unnecessarily. - We're doing a COW of a private mapping (both PTE already present and PTE not-present). These are two different codepaths and I handle both of them in this patch set. There is no support in this patch set for drivers to mark themselves as being VMA lock friendly; they could implement the ->map_pages vm_operation, but if they do, they would be the first. This is probably something we want to change at some point in the future, and I've marked where to make that change in the code. There is very little performance change in the benchmarks we've run; mostly because the vast majority of page faults are handled through the other paths. I still think this patch series is useful for workloads that may take these paths more often, and just for cleaning up the fault path in general (it's now clearer why we have to retry in these cases). This patch (of 6): Drop the VMA lock instead of the mmap_lock if that's the one which is held. Link: https://lkml.kernel.org/r/20231006195318.4087158-1-willy@infradead.org Link: https://lkml.kernel.org/r/20231006195318.4087158-2-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Suren Baghdasaryan Signed-off-by: Andrew Morton commit 1431996bf9088ee59f8017637ab9a7f89909ae63 Author: Hugh Dickins Date: Wed Oct 11 21:40:09 2023 -0700 percpu_counter: extend _limited_add() to negative amounts Though tmpfs does not need it, percpu_counter_limited_add() can be twice as useful if it works sensibly with negative amounts (subs) - typically decrements towards a limit of 0 or nearby: as suggested by Dave Chinner. And in the course of that reworking, skip the percpu counter sum if it is already obvious that the limit would be passed: as suggested by Tim Chen. Extend the comment above __percpu_counter_limited_add(), defining the behaviour with positive and negative amounts, allowing negative limits, but not bothering about overflow beyond S64_MAX. Link: https://lkml.kernel.org/r/8f86083b-c452-95d4-365b-f16a2e4ebcd4@google.com Signed-off-by: Hugh Dickins Cc: Axel Rasmussen Cc: Carlos Maiolino Cc: Christian Brauner Cc: Chuck Lever Cc: Darrick J. Wong Cc: Dave Chinner Cc: Jan Kara Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Tim Chen Signed-off-by: Andrew Morton commit beb9868628445306958fd7b2da1cd369a4a381cc Author: Hugh Dickins Date: Fri Sep 29 20:42:45 2023 -0700 shmem,percpu_counter: add _limited_add(fbc, limit, amount) Percpu counter's compare and add are separate functions: without locking around them (which would defeat their purpose), it has been possible to overflow the intended limit. Imagine all the other CPUs fallocating tmpfs huge pages to the limit, in between this CPU's compare and its add. I have not seen reports of that happening; but tmpfs's recent addition of dquot_alloc_block_nodirty() in between the compare and the add makes it even more likely, and I'd be uncomfortable to leave it unfixed. Introduce percpu_counter_limited_add(fbc, limit, amount) to prevent it. I believe this implementation is correct, and slightly more efficient than the combination of compare and add (taking the lock once rather than twice when nearing full - the last 128MiB of a tmpfs volume on a machine with 128 CPUs and 4KiB pages); but it does beg for a better design - when nearing full, there is no new batching, but the costly percpu counter sum across CPUs still has to be done, while locked. Follow __percpu_counter_sum()'s example, including cpu_dying_mask as well as cpu_online_mask: but shouldn't __percpu_counter_compare() and __percpu_counter_limited_add() then be adding a num_dying_cpus() to num_online_cpus(), when they calculate the maximum which could be held across CPUs? But the times when it matters would be vanishingly rare. Link: https://lkml.kernel.org/r/bb817848-2d19-bcc8-39ca-ea179af0f0b4@google.com Signed-off-by: Hugh Dickins Reviewed-by: Jan Kara Cc: Tim Chen Cc: Dave Chinner Cc: Darrick J. Wong Cc: Axel Rasmussen Cc: Carlos Maiolino Cc: Christian Brauner Cc: Chuck Lever Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 3022fd7af9604d44ec43da8a4398872989599b18 Author: Hugh Dickins Date: Fri Sep 29 20:32:40 2023 -0700 shmem: _add_to_page_cache() before shmem_inode_acct_blocks() There has been a recurring problem, that when a tmpfs volume is being filled by racing threads, some fail with ENOSPC (or consequent SIGBUS or EFAULT) even though all allocations were within the permitted size. This was a problem since early days, but magnified and complicated by the addition of huge pages. We have often worked around it by adding some slop to the tmpfs size, but it's hard to say how much is needed, and some users prefer not to do that e.g. keeping sparse files in a tightly tailored tmpfs helps to prevent accidental writing to holes. This comes from the allocation sequence: 1. check page cache for existing folio 2. check and reserve from vm_enough_memory 3. check and account from size of tmpfs 4. if huge, check page cache for overlapping folio 5. allocate physical folio, huge or small 6. check and charge from mem cgroup limit 7. add to page cache (but maybe another folio already got in). Concurrent tasks allocating at the same position could deplete the size allowance and fail. Doing vm_enough_memory and size checks before the folio allocation was intentional (to limit the load on the page allocator from this source) and still has some virtue; but memory cgroup never did that, so I think it's better reordered to favour predictable behaviour. 1. check page cache for existing folio 2. if huge, check page cache for overlapping folio 3. allocate physical folio, huge or small 4. check and charge from mem cgroup limit 5. add to page cache (but maybe another folio already got in) 6. check and reserve from vm_enough_memory 7. check and account from size of tmpfs. The folio lock held from allocation onwards ensures that the !uptodate folio cannot be used by others, and can safely be deleted from the cache if checks 6 or 7 subsequently fail (and those waiting on folio lock already check that the folio was not truncated once they get the lock); and the early addition to page cache ensures that racers find it before they try to duplicate the accounting. Seize the opportunity to tidy up shmem_get_folio_gfp()'s ENOSPC retrying, which can be combined inside the new shmem_alloc_and_add_folio(): doing 2 splits twice (once huge, once nonhuge) is not exactly equivalent to trying 5 splits (and giving up early on huge), but let's keep it simple unless more complication proves necessary. Userfaultfd is a foreign country: they do things differently there, and for good reason - to avoid mmap_lock deadlock. Leave ordering in shmem_mfill_atomic_pte() untouched for now, but I would rather like to mesh it better with shmem_get_folio_gfp() in the future. Link: https://lkml.kernel.org/r/22ddd06-d919-33b-1219-56335c1bf28e@google.com Signed-off-by: Hugh Dickins Cc: Axel Rasmussen Cc: Carlos Maiolino Cc: Christian Brauner Cc: Chuck Lever Cc: Darrick J. Wong Cc: Dave Chinner Cc: Jan Kara Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Tim Chen Signed-off-by: Andrew Morton commit 054a9f7ccd0a60607fb9bbe1e06ca671494971bf Author: Hugh Dickins Date: Fri Sep 29 20:31:27 2023 -0700 shmem: move memcg charge out of shmem_add_to_page_cache() Extract shmem's memcg charging out of shmem_add_to_page_cache(): it's misleading done there, because many calls are dealing with a swapcache page, whose memcg is nowadays always remembered while swapped out, then the charge re-levied when it's brought back into swapcache. Temporarily move it back up to the shmem_get_folio_gfp() level, where the memcg was charged before v5.8; but the next commit goes on to move it back down to a new home. In making this change, it becomes clear that shmem_swapin_folio() does not need to know the vma, just the fault mm (if any): call it fault_mm rather than charge_mm - let mem_cgroup_charge() decide whom to charge. Link: https://lkml.kernel.org/r/4b2143c5-bf32-64f0-841-81a81158dac@google.com Signed-off-by: Hugh Dickins Reviewed-by: Jan Kara Cc: Axel Rasmussen Cc: Carlos Maiolino Cc: Christian Brauner Cc: Chuck Lever Cc: Darrick J. Wong Cc: Dave Chinner Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Tim Chen Signed-off-by: Andrew Morton commit 4199f51a7eb2054d68964efbd8d39c68053a8714 Author: Hugh Dickins Date: Fri Sep 29 20:30:03 2023 -0700 shmem: shmem_acct_blocks() and shmem_inode_acct_blocks() By historical accident, shmem_acct_block() and shmem_inode_acct_block() were never pluralized when the pages argument was added, despite their complements being shmem_unacct_blocks() and shmem_inode_unacct_blocks() all along. It has been an irritation: fix their naming at last. Link: https://lkml.kernel.org/r/9124094-e4ab-8be7-ef80-9a87bdc2e4fc@google.com Signed-off-by: Hugh Dickins Reviewed-by: Jan Kara Cc: Axel Rasmussen Cc: Carlos Maiolino Cc: Christian Brauner Cc: Chuck Lever Cc: Darrick J. Wong Cc: Dave Chinner Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Tim Chen Signed-off-by: Andrew Morton commit 9be7d5b06648b808989e99c5d0bea1be47c5a384 Author: Hugh Dickins Date: Fri Sep 29 20:28:50 2023 -0700 shmem: trivial tidyups, removing extra blank lines, etc Mostly removing a few superfluous blank lines, joining short arglines, imposing some 80-column observance, correcting a couple of comments. None of it more interesting than deleting a repeated INIT_LIST_HEAD(). Link: https://lkml.kernel.org/r/b3983d28-5d3f-8649-36af-b819285d7a9e@google.com Signed-off-by: Hugh Dickins Reviewed-by: Jan Kara Cc: Axel Rasmussen Cc: Carlos Maiolino Cc: Christian Brauner Cc: Chuck Lever Cc: Darrick J. Wong Cc: Dave Chinner Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Tim Chen Signed-off-by: Andrew Morton commit f0a9ad1d4d9ba3c694bca91d8d67be9a4a33b902 Author: Hugh Dickins Date: Fri Sep 29 20:27:53 2023 -0700 shmem: factor shmem_falloc_wait() out of shmem_fault() That Trinity livelock shmem_falloc avoidance block is unlikely, and a distraction from the proper business of shmem_fault(): separate it out. (This used to help compilers save stack on the fault path too, but both gcc and clang nowadays seem to make better choices anyway.) Link: https://lkml.kernel.org/r/6fe379a4-6176-9225-9263-fe60d2633c0@google.com Signed-off-by: Hugh Dickins Reviewed-by: Jan Kara Cc: Axel Rasmussen Cc: Carlos Maiolino Cc: Christian Brauner Cc: Chuck Lever Cc: Darrick J. Wong Cc: Dave Chinner Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Tim Chen Signed-off-by: Andrew Morton commit e3e1a5067fd2f1b3f4f7c651f5b33082962d1aa1 Author: Hugh Dickins Date: Fri Sep 29 20:26:53 2023 -0700 shmem: remove vma arg from shmem_get_folio_gfp() The vma is already there in vmf->vma, so no need for a separate arg. Link: https://lkml.kernel.org/r/d9ce6f65-a2ed-48f4-4299-fdb0544875c5@google.com Signed-off-by: Hugh Dickins Reviewed-by: Jan Kara Cc: Axel Rasmussen Cc: Carlos Maiolino Cc: Christian Brauner Cc: Chuck Lever Cc: Darrick J. Wong Cc: Dave Chinner Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Tim Chen Signed-off-by: Andrew Morton commit ee615d4585cfc305bf6c218a62123c3051f8b4a3 Author: Hugh Dickins Date: Fri Sep 29 20:25:38 2023 -0700 shmem: shrink shmem_inode_info: dir_offsets in a union Patch series "shmem,tmpfs: general maintenance". Mostly just cosmetic mods in mm/shmem.c, but the last two enforcing the "size=" limit better. 8/8 goes into percpu counter territory, and could stand alone. This patch (of 8): Shave 32 bytes off (the 64-bit) shmem_inode_info. There was a 4-byte pahole after stop_eviction, better filled by fsflags. And the 24-byte dir_offsets can only be used by directories, whereas shrinklist and swaplist only by shmem_mapping() inodes (regular files or long symlinks): so put those into a union. No change in mm/shmem.c is required for this. Link: https://lkml.kernel.org/r/c7441dc6-f3bb-dd60-c670-9f5cbd9f266@google.com Link: https://lkml.kernel.org/r/86ebb4b-c571-b9e8-27f5-cb82ec50357e@google.com Signed-off-by: Hugh Dickins Reviewed-by: Chuck Lever Reviewed-by: Jan Kara Cc: Axel Rasmussen Cc: Carlos Maiolino Cc: Christian Brauner Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Darrick J. Wong Cc: Dave Chinner Cc: Tim Chen Signed-off-by: Andrew Morton commit 6facf36ee49675ea952713a7a1488e9f191e7eec Author: Lorenzo Stoakes Date: Sun Oct 1 00:10:29 2023 +0100 mm/filemap: clarify filemap_fault() comments for not uptodate case The existing comments in filemap_fault() suggest that, after either a minor fault has occurred and filemap_get_folio() found a folio in the page cache, or a major fault arose and __filemap_get_folio(FGP_CREATE...) did the job (having relied on do_sync_mmap_readahead() or filemap_read_folio() to read in the folio), the only possible reason it could not be uptodate is because of an error. This is not so, as if, for instance, the fault occurred within a VMA which had the VM_RAND_READ flag set (via madvise() with the MADV_RANDOM flag specified), this would cause even synchronous readahead to fail to read in the folio. I confirmed this by dropping page caches and faulting in memory madvise()'d this way, observing that this code path was reached on each occasion. Clarify the comments to include this case, and additionally update the comment recently added around the invalidate lock logic to make it clear the comment explicitly refers to the minor fault case. In addition, while we're here, refer to folios rather than pages. [lstoakes@gmail.com: correct identation as per Christopher's feedback] Link: https://lkml.kernel.org/r/2c7014c0-6343-4e76-8697-3f84f54350bd@lucifer.local Link: https://lkml.kernel.org/r/20230930231029.88196-1-lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 7771dcf019dde5998380c40deec0b42f5df9d9a3 Author: Liam R. Howlett Date: Fri Sep 29 16:13:59 2023 -0400 radix tree test suite: fix allocation calculation in kmem_cache_alloc_bulk() The bulk allocation is iterating through an array and storing enough memory for the entire bulk allocation instead of a single array entry. Only allocate an array element of the size set in the kmem_cache. Link: https://lkml.kernel.org/r/20230929201359.2857583-1-Liam.Howlett@oracle.com Fixes: cc86e0c2f306 ("radix tree test suite: add support for slab bulk APIs") Signed-off-by: Liam R. Howlett Reported-by: Christophe JAILLET Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 46fd75d4a3c94dfa5dfcf113881c0c704036b2b2 Author: Muhammad Usama Anjum Date: Mon Aug 21 19:15:18 2023 +0500 selftests: mm: add pagemap ioctl tests Add pagemap ioctl tests. Add several different types of tests to judge the correction of the interface. Link: https://lkml.kernel.org/r/20230821141518.870589-7-usama.anjum@collabora.com Signed-off-by: Muhammad Usama Anjum Cc: Alex Sierra Cc: Al Viro Cc: Andrei Vagin Cc: Axel Rasmussen Cc: Christian Brauner Cc: Cyrill Gorcunov Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: Gustavo A. R. Silva Cc: "Liam R. Howlett" Cc: Matthew Wilcox Cc: Michal Miroslaw Cc: Michał Mirosław Cc: Mike Rapoport (IBM) Cc: Nadav Amit Cc: Pasha Tatashin Cc: Paul Gofman Cc: Peter Xu Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Yang Shi Cc: Yun Zhou Signed-off-by: Andrew Morton commit 18825b8ae9a3d8abd869811aa2a4ea617da5a59e Author: Muhammad Usama Anjum Date: Mon Aug 21 19:15:17 2023 +0500 mm/pagemap: add documentation of PAGEMAP_SCAN IOCTL Add some explanation and method to use write-protection and written-to on memory range. Link: https://lkml.kernel.org/r/20230821141518.870589-6-usama.anjum@collabora.com Signed-off-by: Muhammad Usama Anjum Cc: Alex Sierra Cc: Al Viro Cc: Andrei Vagin Cc: Axel Rasmussen Cc: Christian Brauner Cc: Cyrill Gorcunov Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: Gustavo A. R. Silva Cc: "Liam R. Howlett" Cc: Matthew Wilcox Cc: Michal Miroslaw Cc: Michał Mirosław Cc: Mike Rapoport (IBM) Cc: Nadav Amit Cc: Pasha Tatashin Cc: Paul Gofman Cc: Peter Xu Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Yang Shi Cc: Yun Zhou Signed-off-by: Andrew Morton commit b58aa0f4fee61040bdb7557bf66822e929342ac5 Author: Muhammad Usama Anjum Date: Mon Aug 21 19:15:16 2023 +0500 tools headers UAPI: update linux/fs.h with the kernel sources New IOCTL and macros has been added in the kernel sources. Update the tools header file as well. Link: https://lkml.kernel.org/r/20230821141518.870589-5-usama.anjum@collabora.com Signed-off-by: Muhammad Usama Anjum Cc: Alex Sierra Cc: Al Viro Cc: Andrei Vagin Cc: Axel Rasmussen Cc: Christian Brauner Cc: Cyrill Gorcunov Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: Gustavo A. R. Silva Cc: "Liam R. Howlett" Cc: Matthew Wilcox Cc: Michal Miroslaw Cc: Michał Mirosław Cc: Mike Rapoport (IBM) Cc: Nadav Amit Cc: Pasha Tatashin Cc: Paul Gofman Cc: Peter Xu Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Yang Shi Cc: Yun Zhou Signed-off-by: Andrew Morton commit 12f6b01a0bcbeeab8cc9305673314adb3adf80f7 Author: Muhammad Usama Anjum Date: Mon Aug 21 19:15:15 2023 +0500 fs/proc/task_mmu: add fast paths to get/clear PAGE_IS_WRITTEN flag Adding fast code paths to handle specifically only get and/or clear operation of PAGE_IS_WRITTEN, increases its performance by 0-35%. The results of some test cases are given below: Test-case-1 t1 = (Get + WP) time t2 = WP time t1 t2 Without this patch: 140-170mcs 90-115mcs With this patch: 110mcs 80mcs Worst case diff: 35% faster 30% faster Test-case-2 t3 = atomic Get and WP t3 Without this patch: 120-140mcs With this patch: 100-110mcs Worst case diff: 21% faster Link: https://lkml.kernel.org/r/20230821141518.870589-4-usama.anjum@collabora.com Signed-off-by: Muhammad Usama Anjum Cc: Alex Sierra Cc: Al Viro Cc: Andrei Vagin Cc: Axel Rasmussen Cc: Christian Brauner Cc: Cyrill Gorcunov Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: Gustavo A. R. Silva Cc: "Liam R. Howlett" Cc: Matthew Wilcox Cc: Michal Miroslaw Cc: Michał Mirosław Cc: Mike Rapoport (IBM) Cc: Nadav Amit Cc: Pasha Tatashin Cc: Paul Gofman Cc: Peter Xu Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Yang Shi Cc: Yun Zhou Signed-off-by: Andrew Morton commit 52526ca7fdb905a768a93f8faa418e9b988fc34b Author: Muhammad Usama Anjum Date: Mon Aug 21 19:15:14 2023 +0500 fs/proc/task_mmu: implement IOCTL to get and optionally clear info about PTEs The PAGEMAP_SCAN IOCTL on the pagemap file can be used to get or optionally clear the info about page table entries. The following operations are supported in this IOCTL: - Scan the address range and get the memory ranges matching the provided criteria. This is performed when the output buffer is specified. - Write-protect the pages. The PM_SCAN_WP_MATCHING is used to write-protect the pages of interest. The PM_SCAN_CHECK_WPASYNC aborts the operation if non-Async Write Protected pages are found. The ``PM_SCAN_WP_MATCHING`` can be used with or without PM_SCAN_CHECK_WPASYNC. - Both of those operations can be combined into one atomic operation where we can get and write protect the pages as well. Following flags about pages are currently supported: - PAGE_IS_WPALLOWED - Page has async-write-protection enabled - PAGE_IS_WRITTEN - Page has been written to from the time it was write protected - PAGE_IS_FILE - Page is file backed - PAGE_IS_PRESENT - Page is present in the memory - PAGE_IS_SWAPPED - Page is in swapped - PAGE_IS_PFNZERO - Page has zero PFN - PAGE_IS_HUGE - Page is THP or Hugetlb backed This IOCTL can be extended to get information about more PTE bits. The entire address range passed by user [start, end) is scanned until either the user provided buffer is full or max_pages have been found. [akpm@linux-foundation.org: update it for "mm: hugetlb: add huge page size param to set_huge_pte_at()"] [akpm@linux-foundation.org: fix CONFIG_HUGETLB_PAGE=n warning] [arnd@arndb.de: hide unused pagemap_scan_backout_range() function] Link: https://lkml.kernel.org/r/20230927060257.2975412-1-arnd@kernel.org [sfr@canb.auug.org.au: fix "fs/proc/task_mmu: hide unused pagemap_scan_backout_range() function"] Link: https://lkml.kernel.org/r/20230928092223.0625c6bf@canb.auug.org.au Link: https://lkml.kernel.org/r/20230821141518.870589-3-usama.anjum@collabora.com Signed-off-by: Muhammad Usama Anjum Signed-off-by: Michał Mirosław Signed-off-by: Arnd Bergmann Signed-off-by: Stephen Rothwell Reviewed-by: Andrei Vagin Reviewed-by: Michał Mirosław Cc: Alex Sierra Cc: Al Viro Cc: Axel Rasmussen Cc: Christian Brauner Cc: Cyrill Gorcunov Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: Gustavo A. R. Silva Cc: "Liam R. Howlett" Cc: Matthew Wilcox Cc: Michal Miroslaw Cc: Mike Rapoport (IBM) Cc: Nadav Amit Cc: Pasha Tatashin Cc: Paul Gofman Cc: Peter Xu Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Yang Shi Cc: Yun Zhou Signed-off-by: Andrew Morton commit d61ea1cb009532dcbd77a9d44b812704cec60146 Author: Peter Xu Date: Mon Aug 21 19:15:13 2023 +0500 userfaultfd: UFFD_FEATURE_WP_ASYNC Patch series "Implement IOCTL to get and optionally clear info about PTEs", v33. *Motivation* The real motivation for adding PAGEMAP_SCAN IOCTL is to emulate Windows GetWriteWatch() and ResetWriteWatch() syscalls [1]. The GetWriteWatch() retrieves the addresses of the pages that are written to in a region of virtual memory. This syscall is used in Windows applications and games etc. This syscall is being emulated in pretty slow manner in userspace. Our purpose is to enhance the kernel such that we translate it efficiently in a better way. Currently some out of tree hack patches are being used to efficiently emulate it in some kernels. We intend to replace those with these patches. So the whole gaming on Linux can effectively get benefit from this. It means there would be tons of users of this code. CRIU use case [2] was mentioned by Andrei and Danylo: > Use cases for migrating sparse VMAs are binaries sanitized with ASAN, > MSAN or TSAN [3]. All of these sanitizers produce sparse mappings of > shadow memory [4]. Being able to migrate such binaries allows to highly > reduce the amount of work needed to identify and fix post-migration > crashes, which happen constantly. Andrei defines the following uses of this code: * it is more granular and allows us to track changed pages more effectively. The current interface can clear dirty bits for the entire process only. In addition, reading info about pages is a separate operation. It means we must freeze the process to read information about all its pages, reset dirty bits, only then we can start dumping pages. The information about pages becomes more and more outdated, while we are processing pages. The new interface solves both these downsides. First, it allows us to read pte bits and clear the soft-dirty bit atomically. It means that CRIU will not need to freeze processes to pre-dump their memory. Second, it clears soft-dirty bits for a specified region of memory. It means CRIU will have actual info about pages to the moment of dumping them. * The new interface has to be much faster because basic page filtering is happening in the kernel. With the old interface, we have to read pagemap for each page. *Implementation Evolution (Short Summary)* From the definition of GetWriteWatch(), we feel like kernel's soft-dirty feature can be used under the hood with some additions like: * reset soft-dirty flag for only a specific region of memory instead of clearing the flag for the entire process * get and clear soft-dirty flag for a specific region atomically So we decided to use ioctl on pagemap file to read or/and reset soft-dirty flag. But using soft-dirty flag, sometimes we get extra pages which weren't even written. They had become soft-dirty because of VMA merging and VM_SOFTDIRTY flag. This breaks the definition of GetWriteWatch(). We were able to by-pass this short coming by ignoring VM_SOFTDIRTY until David reported that mprotect etc messes up the soft-dirty flag while ignoring VM_SOFTDIRTY [5]. This wasn't happening until [6] got introduced. We discussed if we can revert these patches. But we could not reach to any conclusion. So at this point, I made couple of tries to solve this whole VM_SOFTDIRTY issue by correcting the soft-dirty implementation: * [7] Correct the bug fixed wrongly back in 2014. It had potential to cause regression. We left it behind. * [8] Keep a list of soft-dirty part of a VMA across splits and merges. I got the reply don't increase the size of the VMA by 8 bytes. At this point, we left soft-dirty considering it is too much delicate and userfaultfd [9] seemed like the only way forward. From there onward, we have been basing soft-dirty emulation on userfaultfd wp feature where kernel resolves the faults itself when WP_ASYNC feature is used. It was straight forward to add WP_ASYNC feature in userfautlfd. Now we get only those pages dirty or written-to which are really written in reality. (PS There is another WP_UNPOPULATED userfautfd feature is required which is needed to avoid pre-faulting memory before write-protecting [9].) All the different masks were added on the request of CRIU devs to create interface more generic and better. [1] https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-getwritewatch [2] https://lore.kernel.org/all/20221014134802.1361436-1-mdanylo@google.com [3] https://github.com/google/sanitizers [4] https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm#64-bit [5] https://lore.kernel.org/all/bfcae708-db21-04b4-0bbe-712badd03071@redhat.com [6] https://lore.kernel.org/all/20220725142048.30450-1-peterx@redhat.com/ [7] https://lore.kernel.org/all/20221122115007.2787017-1-usama.anjum@collabora.com [8] https://lore.kernel.org/all/20221220162606.1595355-1-usama.anjum@collabora.com [9] https://lore.kernel.org/all/20230306213925.617814-1-peterx@redhat.com [10] https://lore.kernel.org/all/20230125144529.1630917-1-mdanylo@google.com This patch (of 6): Add a new userfaultfd-wp feature UFFD_FEATURE_WP_ASYNC, that allows userfaultfd wr-protect faults to be resolved by the kernel directly. It can be used like a high accuracy version of soft-dirty, without vma modifications during tracking, and also with ranged support by default rather than for a whole mm when reset the protections due to existence of ioctl(UFFDIO_WRITEPROTECT). Several goals of such a dirty tracking interface: 1. All types of memory should be supported and tracable. This is nature for soft-dirty but should mention when the context is userfaultfd, because it used to only support anon/shmem/hugetlb. The problem is for a dirty tracking purpose these three types may not be enough, and it's legal to track anything e.g. any page cache writes from mmap. 2. Protections can be applied to partial of a memory range, without vma split/merge fuss. The hope is that the tracking itself should not affect any vma layout change. It also helps when reset happens because the reset will not need mmap write lock which can block the tracee. 3. Accuracy needs to be maintained. This means we need pte markers to work on any type of VMA. One could question that, the whole concept of async dirty tracking is not really close to fundamentally what userfaultfd used to be: it's not "a fault to be serviced by userspace" anymore. However, using userfaultfd-wp here as a framework is convenient for us in at least: 1. VM_UFFD_WP vma flag, which has a very good name to suite something like this, so we don't need VM_YET_ANOTHER_SOFT_DIRTY. Just use a new feature bit to identify from a sync version of uffd-wp registration. 2. PTE markers logic can be leveraged across the whole kernel to maintain the uffd-wp bit as long as an arch supports, this also applies to this case where uffd-wp bit will be a hint to dirty information and it will not go lost easily (e.g. when some page cache ptes got zapped). 3. Reuse ioctl(UFFDIO_WRITEPROTECT) interface for either starting or resetting a range of memory, while there's no counterpart in the old soft-dirty world, hence if this is wanted in a new design we'll need a new interface otherwise. We can somehow understand that commonality because uffd-wp was fundamentally a similar idea of write-protecting pages just like soft-dirty. This implementation allows WP_ASYNC to imply WP_UNPOPULATED, because so far WP_ASYNC seems to not usable if without WP_UNPOPULATE. This also gives us chance to modify impl of WP_ASYNC just in case it could be not depending on WP_UNPOPULATED anymore in the future kernels. It's also fine to imply that because both features will rely on PTE_MARKER_UFFD_WP config option, so they'll show up together (or both missing) in an UFFDIO_API probe. vma_can_userfault() now allows any VMA if the userfaultfd registration is only about async uffd-wp. So we can track dirty for all kinds of memory including generic file systems (like XFS, EXT4 or BTRFS). One trick worth mention in do_wp_page() is that we need to manually update vmf->orig_pte here because it can be used later with a pte_same() check - this path always has FAULT_FLAG_ORIG_PTE_VALID set in the flags. The major defect of this approach of dirty tracking is we need to populate the pgtables when tracking starts. Soft-dirty doesn't do it like that. It's unwanted in the case where the range of memory to track is huge and unpopulated (e.g., tracking updates on a 10G file with mmap() on top, without having any page cache installed yet). One way to improve this is to allow pte markers exist for larger than PTE level for PMD+. That will not change the interface if to implemented, so we can leave that for later. Link: https://lkml.kernel.org/r/20230821141518.870589-1-usama.anjum@collabora.com Link: https://lkml.kernel.org/r/20230821141518.870589-2-usama.anjum@collabora.com Signed-off-by: Peter Xu Co-developed-by: Muhammad Usama Anjum Signed-off-by: Muhammad Usama Anjum Cc: Alex Sierra Cc: Al Viro Cc: Andrei Vagin Cc: Axel Rasmussen Cc: Christian Brauner Cc: Cyrill Gorcunov Cc: Dan Williams Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: Gustavo A. R. Silva Cc: "Liam R. Howlett" Cc: Matthew Wilcox Cc: Michal Miroslaw Cc: Mike Rapoport (IBM) Cc: Nadav Amit Cc: Pasha Tatashin Cc: Paul Gofman Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Yang Shi Cc: Yun Zhou Cc: Michał Mirosław Signed-off-by: Andrew Morton commit 7bd5bc3ce9632aefd0eed33a19212a2e55c0f873 Author: Yosry Ahmed Date: Fri Sep 22 17:57:40 2023 +0000 mm: memcg: normalize the value passed into memcg_rstat_updated() memcg_rstat_updated() uses the value of the state update to keep track of the magnitude of pending updates, so that we only do a stats flush when it's worth the work. Most values passed into memcg_rstat_updated() are in pages, however, a few of them are actually in bytes or KBs. To put this into perspective, a 512 byte slab allocation today would look the same as allocating 512 pages. This may result in premature flushes, which means unnecessary work and latency. Normalize all the state values passed into memcg_rstat_updated() to pages. Round up non-zero sub-page to 1 page, because memcg_rstat_updated() ignores 0 page updates. Link: https://lkml.kernel.org/r/20230922175741.635002-3-yosryahmed@google.com Fixes: 5b3be698a872 ("memcg: better bounds on the memcg stats updates") Signed-off-by: Yosry Ahmed Acked-by: Johannes Weiner Cc: Michal Hocko Cc: Michal Koutný Cc: Muchun Song Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit ff841a06c844b0556b434d67cfc43f4fda56ae7b Author: Yosry Ahmed Date: Fri Sep 22 17:57:39 2023 +0000 mm: memcg: refactor page state unit helpers Patch series "mm: memcg: fix tracking of pending stats updates values", v2. While working on adjacent code [1], I realized that the values passed into memcg_rstat_updated() to keep track of the magnitude of pending updates is consistent. It is mostly in pages, but sometimes it can be in bytes or KBs. Fix that. Patch 1 reworks memcg_page_state_unit() so that we can reuse it in patch 2 to check and normalize the units of state updates. [1]https://lore.kernel.org/lkml/20230921081057.3440885-1-yosryahmed@google.com/ This patch (of 2): memcg_page_state_unit() is currently used to identify the unit of a memcg state item so that all stats in memory.stat are in bytes. However, it lies about the units of WORKINGSET_* stats. These stats actually represent pages, but we present them to userspace as a scalar number of events. In retrospect, maybe those stats should have been memcg "events" rather than memcg "state". In preparation for using memcg_page_state_unit() for other purposes that need to know the truthful units of different stat items, break it down into two helpers: - memcg_page_state_unit() retuns the actual unit of the item. - memcg_page_state_output_unit() returns the unit used for output. Use the latter instead of the former in memcg_page_state_output() and lruvec_page_state_output(). While we are at it, let's show cgroup v1 some love and add memcg_page_state_local_output() for consistency. No functional change intended. Link: https://lkml.kernel.org/r/20230922175741.635002-1-yosryahmed@google.com Link: https://lkml.kernel.org/r/20230922175741.635002-2-yosryahmed@google.com Signed-off-by: Yosry Ahmed Acked-by: Johannes Weiner Cc: Michal Hocko Cc: Michal Koutný Cc: Muchun Song Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton commit b7c67206594a56be2407ae4da54a114c90609e53 Author: Kees Cook Date: Fri Sep 22 10:53:28 2023 -0700 mm/memcg: annotate struct mem_cgroup_threshold_ary with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mem_cgroup_threshold_ary. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Link: https://lkml.kernel.org/r/20230922175327.work.985-kees@kernel.org Signed-off-by: Kees Cook Acked-by: Shakeel Butt Acked-by: Roman Gushchin Reviewed-by: Gustavo A. R. Silva Acked-by: Michal Hocko Cc: Johannes Weiner Cc: "Matthew Wilcox (Oracle)" Signed-off-by: Andrew Morton commit 30a89adf872d2e46323840964c95dc0ae3bb5843 Author: Mike Kravetz Date: Mon Oct 16 19:55:49 2023 -0700 hugetlb: check for hugetlb folio before vmemmap_restore In commit d8f5f7e445f0 ("hugetlb: set hugetlb page flag before optimizing vmemmap") checks were added to print a warning if hugetlb_vmemmap_restore was called on a non-hugetlb page. This was mostly due to ordering issues in the hugetlb page set up and tear down sequencees. One place missed was the routine dissolve_free_huge_page. Naoya Horiguchi noted: "I saw that VM_WARN_ON_ONCE() in hugetlb_vmemmap_restore is triggered when memory_failure() is called on a free hugetlb page with vmemmap optimization disabled (the warning is not triggered if vmemmap optimization is enabled). I think that we need check folio_test_hugetlb() before dissolve_free_huge_page() calls hugetlb_vmemmap_restore_folio()." Perform the check as suggested by Naoya. Link: https://lkml.kernel.org/r/20231017032140.GA3680@monkey Fixes: d8f5f7e445f0 ("hugetlb: set hugetlb page flag before optimizing vmemmap") Signed-off-by: Mike Kravetz Suggested-by: Naoya Horiguchi Tested-by: Naoya Horiguchi Cc: Anshuman Khandual Cc: Barry Song Cc: David Hildenbrand Cc: David Rientjes Cc: Joao Martins Cc: Matthew Wilcox (Oracle) Cc: Miaohe Lin Cc: Michal Hocko Cc: Muchun Song Cc: Oscar Salvador Cc: Xiongchun Duan Signed-off-by: Andrew Morton commit 5ef8f1b2b4d9bd02e4104b9255351fb9279b1b4e Merge: b0540208a59e1 fc7f04dc23db5 Author: Andrew Morton Date: Wed Oct 18 14:32:58 2023 -0700 Merge mm-hotfixes-stable into mm-stable to pick up depended-upon changes. commit a18615b1cfc04f00548c60eb9a77e0ce56e848fd Author: Bartosz Pawlowski Date: Fri Sep 8 14:36:06 2023 +0000 PCI: Disable ATS for specific Intel IPU E2000 devices Due to a hardware issue in A and B steppings of Intel IPU E2000, it expects wrong endianness in ATS invalidation message body. This problem can lead to outdated translations being returned as valid and finally cause system instability. To prevent such issues, add quirk_intel_e2000_no_ats() to disable ATS for vulnerable IPU E2000 devices. Link: https://lore.kernel.org/r/20230908143606.685930-3-bartosz.pawlowski@intel.com Signed-off-by: Bartosz Pawlowski Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko Reviewed-by: Alexander Lobakin commit f18b1137d38c091cc8c16365219f0a1d4a30b3d1 Author: Bartosz Pawlowski Date: Fri Sep 8 14:36:05 2023 +0000 PCI: Extract ATS disabling to a helper function Introduce quirk_no_ats() helper function to provide a standard way to disable ATS capability in PCI quirks. Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230908143606.685930-2-bartosz.pawlowski@intel.com Signed-off-by: Bartosz Pawlowski Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko commit 90cf94edaad911da88a111f13d6549e24d58c952 Merge: 0bb80ecc33a8f 57b55c76aaf1b Author: Stephen Boyd Date: Wed Oct 18 13:54:04 2023 -0700 Merge tag 'clk-meson-v6.7-1' of https://github.com/BayLibre/clk-meson into clk-amlogic Pull Amlogic clk driver updates from Jerome Brunet: - Add s4 main clock controller support * tag 'clk-meson-v6.7-1' of https://github.com/BayLibre/clk-meson: clk: meson: S4: add support for Amlogic S4 SoC peripheral clock controller clk: meson: S4: add support for Amlogic S4 SoC PLL clock driver dt-bindings: clock: document Amlogic S4 SoC peripherals clock controller dt-bindings: clock: document Amlogic S4 SoC PLL clock controller commit 329369caeccb1a0cb0dc5f864d6a671ed8190c11 Author: Jim Mattson Date: Wed Oct 4 20:12:37 2023 -0700 x86: KVM: Add feature flag for CPUID.80000021H:EAX[bit 1] Define an X86_FEATURE_* flag for CPUID.80000021H:EAX.[bit 1], and advertise the feature to userspace via KVM_GET_SUPPORTED_CPUID. Per AMD's "Processor Programming Reference (PPR) for AMD Family 19h Model 61h, Revision B1 Processors (56713-B1-PUB)," this CPUID bit indicates that a WRMSR to MSR_FS_BASE, MSR_GS_BASE, or MSR_KERNEL_GS_BASE is non-serializing. This is a change in previously architected behavior. Effectively, this CPUID bit is a "defeature" bit, or a reverse polarity feature bit. When this CPUID bit is clear, the feature (serialization on WRMSR to any of these three MSRs) is available. When this CPUID bit is set, the feature is not available. KVM_GET_SUPPORTED_CPUID must pass this bit through from the underlying hardware, if it is set. Leaving the bit clear claims that WRMSR to these three MSRs will be serializing in a guest running under KVM. That isn't true. Though KVM could emulate the feature by intercepting writes to the specified MSRs, it does not do so today. The guest is allowed direct read/write access to these MSRs without interception, so the innate hardware behavior is preserved under KVM. Signed-off-by: Jim Mattson Reviewed-by: Maxim Levitsky Reviewed-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231005031237.1652871-1-jmattson@google.com Signed-off-by: Sean Christopherson commit 2081a8450ef803e2e1136a80975eebc8682879b5 Author: Dongli Zhang Date: Sun Oct 1 14:36:37 2023 -0700 KVM: x86: remove always-false condition in kvmclock_sync_fn The 'kvmclock_periodic_sync' is a readonly param that cannot change after bootup. The kvm_arch_vcpu_postcreate() is not going to schedule the kvmclock_sync_work if kvmclock_periodic_sync == false. As a result, the "if (!kvmclock_periodic_sync)" can never be true if the kvmclock_sync_work = kvmclock_sync_fn() is scheduled. Link: https://lore.kernel.org/kvm/a461bf3f-c17e-9c3f-56aa-726225e8391d@oracle.com Signed-off-by: Dongli Zhang Link: https://lore.kernel.org/r/20231001213637.76686-1-dongli.zhang@oracle.com Signed-off-by: Sean Christopherson commit 5247e6dbed0041147a83137f89cd45043301de5c Author: Ilpo Järvinen Date: Wed Oct 18 10:55:26 2023 +0300 selftests/resctrl: Fix MBM test failure when MBA unavailable Commit 20d96b25cc4c ("selftests/resctrl: Fix schemata write error check") exposed a problem in feature detection logic in MBM selftest. If schemata does not support MB:x=x entries, the schemata write to initialize 100% memory bandwidth allocation in mbm_setup() will now fail with -EINVAL due to the error handling corrected by the commit 20d96b25cc4c ("selftests/resctrl: Fix schemata write error check"). That commit just uncovers the failed write, it is not wrong itself. If MB:x=x is not supported by schemata, it is safe to assume 100% memory bandwidth is always set. Therefore, the previously ignored error does not make the MBM test itself wrong. Restore the previous behavior of MBM test by checking MB support before attempting to write it into schemata which results in behavior equivalent to ignoring the write error. Fixes: 20d96b25cc4c ("selftests/resctrl: Fix schemata write error check") Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre Signed-off-by: Shuah Khan commit 34dce23f7e405ffb4eca04e83ee10c03a4cffb9b Author: Mark Brown Date: Wed Oct 18 00:01:56 2023 +0100 selftests/clone3: Report descriptive test names The clone3() selftests currently report test results in a format that does not mesh entirely well with automation. They log output for each test such as: # [1382411] Trying clone3() with flags 0 (size 0) # I am the parent (1382411). My child's pid is 1382412 # I am the child, my PID is 1382412 # [1382411] clone3() with flags says: 0 expected 0 ok 1 [1382411] Result (0) matches expectation (0) This is not ideal for automated parsers since the text after the "ok 1" is treated as the test name when comparing runs by a lot of automation (tests routinely get renumbered due to things like new tests being added based on logical groupings). The PID means that the test names will frequently vary and the rest of the name being a description of results means several tests have identical text there. Address this by refactoring things so that we have a static descriptive name for each test which we use when logging passes, failures and skips and since we now have a stable name for the test to hand log that before starting the test to address the common issue reading logs where the test name is only printed after any diagnostics. The result is: # Running test 'simple clone3()' # [1562777] Trying clone3() with flags 0 (size 0) # I am the parent (1562777). My child's pid is 1562778 # I am the child, my PID is 1562778 # [1562777] clone3() with flags says: 0 expected 0 ok 1 simple clone3() In order to handle skips a bit more neatly this is done in a moderately invasive fashion where we move from a sequence of function calls to having an array of test parameters. This hopefully also makes it a little easier to see what the tests are doing when looking at both the source and the logs. Signed-off-by: Mark Brown Signed-off-by: Shuah Khan commit ecc4185a4d15373cadab41277098e651d8dd3397 Author: zhujun2 Date: Mon Oct 16 19:08:56 2023 -0700 selftests:modify the incorrect print format when the argument type is 'unsigned int',printf '%u' in format string. Problem found during code reading. Update commit log with information on how the problem was found: Shuah Khan Signed-off-by: zhujun2 Signed-off-by: Shuah Khan commit 3f6f8a8c5e11a9b384a36df4f40f0c9a653b6975 Author: zhujun2 Date: Tue Oct 17 18:59:21 2023 -0700 selftests/efivarfs: create-read: fix a resource leak The opened file should be closed in main(), otherwise resource leak will occur that this problem was discovered by code reading Signed-off-by: zhujun2 Signed-off-by: Shuah Khan commit 11df28854bee7060508999c35afac53a0406fe7f Author: Yu Liao Date: Wed Oct 18 10:08:58 2023 +0800 selftests/ftrace: Add riscv support for kprobe arg tests This is the riscv variant of commit 9855c4626c67 ("selftests/ftrace: Add ppc support for kprobe args tests"). Signed-off-by: Yu Liao Acked-by: Masami Hiramatsu (Google) Acked-by: Steven Rostedt (Google) Signed-off-by: Shuah Khan commit 2eadb3299256087e901bed113b24e5807c2a9602 Author: Yu Liao Date: Wed Oct 18 10:08:57 2023 +0800 selftests/ftrace: add loongarch support for kprobe args char tests Add loongarch support for the recently added kprobe args tests. Signed-off-by: Yu Liao Acked-by: Masami Hiramatsu (Google) Acked-by: Steven Rostedt (Google) Signed-off-by: Shuah Khan commit 0b62f6cb07738d7211d926c39f6946b87f72e792 Author: Thomas Gleixner Date: Tue Oct 17 23:23:32 2023 +0200 x86/microcode/32: Move early loading after paging enable 32-bit loads microcode before paging is enabled. The commit which introduced that has zero justification in the changelog. The cover letter has slightly more content, but it does not give any technical justification either: "The problem in current microcode loading method is that we load a microcode way, way too late; ideally we should load it before turning paging on. This may only be practical on 32 bits since we can't get to 64-bit mode without paging on, but we should still do it as early as at all possible." Handwaving word salad with zero technical content. Someone claimed in an offlist conversation that this is required for curing the ATOM erratum AAE44/AAF40/AAG38/AAH41. That erratum requires an microcode update in order to make the usage of PSE safe. But during early boot, PSE is completely irrelevant and it is evaluated way later. Neither is it relevant for the AP on single core HT enabled CPUs as the microcode loading on the AP is not doing anything. On dual core CPUs there is a theoretical problem if a split of an executable large page between enabling paging including PSE and loading the microcode happens. But that's only theoretical, it's practically irrelevant because the affected dual core CPUs are 64bit enabled and therefore have paging and PSE enabled before loading the microcode on the second core. So why would it work on 64-bit but not on 32-bit? The erratum: "AAG38 Code Fetch May Occur to Incorrect Address After a Large Page is Split Into 4-Kbyte Pages Problem: If software clears the PS (page size) bit in a present PDE (page directory entry), that will cause linear addresses mapped through this PDE to use 4-KByte pages instead of using a large page after old TLB entries are invalidated. Due to this erratum, if a code fetch uses this PDE before the TLB entry for the large page is invalidated then it may fetch from a different physical address than specified by either the old large page translation or the new 4-KByte page translation. This erratum may also cause speculative code fetches from incorrect addresses." The practical relevance for this is exactly zero because there is no splitting of large text pages during early boot-time, i.e. between paging enable and microcode loading, and neither during CPU hotplug. IOW, this load microcode before paging enable is yet another voodoo programming solution in search of a problem. What's worse is that it causes at least two serious problems: 1) When stackprotector is enabled, the microcode loader code has the stackprotector mechanics enabled. The read from the per CPU variable __stack_chk_guard is always accessing the virtual address either directly on UP or via %fs on SMP. In physical address mode this results in an access to memory above 3GB. So this works by chance as the hardware returns the same value when there is no RAM at this physical address. When there is RAM populated above 3G then the read is by chance the same as nothing changes that memory during the very early boot stage. That's not necessarily true during runtime CPU hotplug. 2) When function tracing is enabled, the relevant microcode loader functions and the functions invoked from there will call into the tracing code and evaluate global and per CPU variables in physical address mode. What could potentially go wrong? Cure this and move the microcode loading after the early paging enable, use the new temporary initrd mapping and remove the gunk in the microcode loader which is required to handle physical address mode. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211722.348298216@linutronix.de commit fc7f04dc23db50206bee7891516ed4726c3f64cf Author: Tiezhu Yang Date: Tue Jul 11 17:13:34 2023 +0800 selftests/clone3: Fix broken test under !CONFIG_TIME_NS When execute the following command to test clone3 under !CONFIG_TIME_NS: # make headers && cd tools/testing/selftests/clone3 && make && ./clone3 we can see the following error info: # [7538] Trying clone3() with flags 0x80 (size 0) # Invalid argument - Failed to create new process # [7538] clone3() with flags says: -22 expected 0 not ok 18 [7538] Result (-22) is different than expected (0) ... # Totals: pass:18 fail:1 xfail:0 xpass:0 skip:0 error:0 This is because if CONFIG_TIME_NS is not set, but the flag CLONE_NEWTIME (0x80) is used to clone a time namespace, it will return -EINVAL in copy_time_ns(). If kernel does not support CONFIG_TIME_NS, /proc/self/ns/time will be not exist, and then we should skip clone3() test with CLONE_NEWTIME. With this patch under !CONFIG_TIME_NS: # make headers && cd tools/testing/selftests/clone3 && make && ./clone3 ... # Time namespaces are not supported ok 18 # SKIP Skipping clone3() with CLONE_NEWTIME ... # Totals: pass:18 fail:0 xfail:0 xpass:0 skip:1 error:0 Link: https://lkml.kernel.org/r/1689066814-13295-1-git-send-email-yangtiezhu@loongson.cn Fixes: 515bddf0ec41 ("selftests/clone3: test clone3 with CLONE_NEWTIME") Signed-off-by: Tiezhu Yang Suggested-by: Thomas Gleixner Cc: Christian Brauner Cc: Shuah Khan Cc: Signed-off-by: Andrew Morton commit 97e993830a1cdd86ad7d207308b9f55a00660edd Author: Darrick J. Wong Date: Mon Oct 16 09:49:01 2023 -0700 xfs: use accessor functions for bitmap words Create get and set functions for rtbitmap words so that we can redefine the ondisk format with a specific endianness. Note that this requires the definition of a distinct type for ondisk rtbitmap words so that the compiler can perform proper typechecking as we go back and forth. In the upcoming rtgroups feature, we're going to fix the problem that rtwords are written in host endian order, which means we'll need the distinct rtword/rtword_raw types. Suggested-by: Christoph Hellwig Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit b8a555dc31e5aa18d976de0bc228006e398a2e7d Author: Nathan Chancellor Date: Wed Oct 18 11:10:31 2023 -0700 eventfs: Use ERR_CAST() in eventfs_create_events_dir() When building with clang and CONFIG_RANDSTRUCT_FULL=y, there is an error due to a cast in eventfs_create_events_dir(): fs/tracefs/event_inode.c:734:10: error: casting from randomized structure pointer type 'struct dentry *' to 'struct eventfs_inode *' 734 | return (struct eventfs_inode *)dentry; | ^ 1 error generated. Use the ERR_CAST() function to resolve the error, as it was designed for this exact situation (casting an error pointer to another type). Link: https://lore.kernel.org/linux-trace-kernel/20231018-ftrace-fix-clang-randstruct-v1-1-338cb214abfb@kernel.org Closes: https://github.com/ClangBuiltLinux/linux/issues/1947 Fixes: 5790b1fb3d67 ("eventfs: Remove eventfs_file and just use eventfs_inode") Reviewed-by: Kees Cook Signed-off-by: Nathan Chancellor Signed-off-by: Steven Rostedt (Google) commit d0448fe76ac1a9ccbce574577a4c82246d17eec4 Author: Darrick J. Wong Date: Mon Oct 16 09:48:20 2023 -0700 xfs: create helpers for rtbitmap block/wordcount computations Create helper functions that compute the number of blocks or words necessary to store the rt bitmap. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 312d61021b8947446aa9ec80b78b9230e8cb3691 Author: Darrick J. Wong Date: Tue Oct 17 16:43:10 2023 -0700 xfs: create a helper to handle logging parts of rt bitmap/summary blocks Create an explicit helper function to log parts of rt bitmap and summary blocks. While we're at it, fix an off-by-one error in two of the rtbitmap logging calls that led to unnecessarily large log items but was otherwise benign. Note that the upcoming rtgroups patchset will add block headers to the rtbitmap and rtsummary files. The helpers in this and the next few patches take a less than direct route through xfs_rbmblock_wordptr and xfs_rsumblock_infoptr to avoid helper churn in that patchset. Suggested-by: Christoph Hellwig Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 9ea459e477dc09370cdd8ee13b61aefe8cd1f20a Author: Zhu Wang Date: Mon Jul 31 19:29:42 2023 +0800 libnvdimm: remove kernel-doc warnings: Remove kernel-doc warnings: drivers/nvdimm/badrange.c:271: warning: Function parameter or member 'nd_region' not described in 'nvdimm_badblocks_populate' drivers/nvdimm/badrange.c:271: warning: Function parameter or member 'range' not described in 'nvdimm_badblocks_populate' drivers/nvdimm/badrange.c:271: warning: Excess function parameter 'region' description in 'nvdimm_badblocks_populate' drivers/nvdimm/badrange.c:271: warning: Excess function parameter 'res' description in 'nvdimm_badblocks_populate' Signed-off-by: Zhu Wang Link: https://lore.kernel.org/r/20230731112942.215135-1-wangzhu9@huawei.com Tested-by: Ira Weiny Signed-off-by: Ira Weiny commit 5fde104ea8587c547732a06d9d6473f6e7e4ac1c Author: Vinay Belgaumkar Date: Tue Oct 17 12:53:09 2023 -0700 drm/i915/mtl: Don't set PIPE_CONTROL_FLUSH_L3 This bit does not cause an explicit L3 flush. We already use PIPE_CONTROL_DC_FLUSH_ENABLE for that purpose. v2: Use FLUSH_L3 only pre-MTL since spec will likely remain the same going forward. Cc: Nirmoy Das Cc: Mika Kuoppala Acked-by: Mika Kuoppala Reviewed-by: Nirmoy Das Signed-off-by: Vinay Belgaumkar Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231017195309.2476088-1-vinay.belgaumkar@intel.com commit 4c585af7180c147062c636a927a2fc2b6a7072f5 Author: Thomas Gleixner Date: Tue Oct 17 23:23:31 2023 +0200 x86/boot/32: Temporarily map initrd for microcode loading Early microcode loading on 32-bit runs in physical address mode because the initrd is not covered by the initial page tables. That results in a horrible mess all over the microcode loader code. Provide a temporary mapping for the initrd in the initial page tables by appending it to the actual initial mapping starting with a new PGD or PMD depending on the configured page table levels ([non-]PAE). The page table entries are located after _brk_end so they are not permanently using memory space. The mapping is invalidated right away in i386_start_kernel() after the early microcode loader has run. This prepares for removing the physical address mode oddities from all over the microcode loader code, which in turn allows further cleanups. Provide the map and unmap code and document the place where the microcode loader needs to be invoked with a comment. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211722.292291436@linutronix.de commit fdbd43819400e74c1c20a646969ea8f71706eb2b Author: Thomas Gleixner Date: Tue Oct 17 23:23:29 2023 +0200 x86/microcode: Provide CONFIG_MICROCODE_INITRD32 Create an aggregate config switch which covers X86_32, MICROCODE and BLK_DEV_INITRD to avoid lengthy #ifdeffery in upcoming code. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211722.236208250@linutronix.de commit 69ba866db281c768d5ecca909361ea4c4e71d57e Author: Thomas Gleixner Date: Tue Oct 17 23:23:28 2023 +0200 x86/boot/32: Restructure mk_early_pgtbl_32() Prepare it for adding a temporary initrd mapping by splitting out the actual map loop. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211722.175910753@linutronix.de commit a62f4ca106fd250e9247decd100f3905131fc1fe Author: Thomas Gleixner Date: Tue Oct 17 23:23:26 2023 +0200 x86/boot/32: De-uglify the 2/3 level paging difference in mk_early_pgtbl_32() Move the ifdeffery out of the function and use proper typedefs to make it work for both 2 and 3 level paging. No functional change. [ bp: Move mk_early_pgtbl_32() declaration into a header. ] Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211722.111059491@linutronix.de commit 78b7b13f07a3ca16c03aa8bf63f51d6780e8e9e1 Author: Yu Kuai Date: Mon Oct 16 18:02:40 2023 +0800 md: cleanup pers->prepare_suspend() pers->prepare_suspend() is not used anymore and can be removed. Reverts following three commit: - commit 431e61257d63 ("md: export md_is_rdwr() and is_md_suspended()") - commit 3e00777d5157 ("md: add a new api prepare_suspend() in md_personality") - commit 868bba54a3bc ("md/raid5: fix a deadlock in the case that reshape is interrupted") Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231016100240.540474-1-yukuai1@huaweicloud.com commit b09d0f98a434bd6b9b9e0fb63bebfcac5e1a679e Author: Ilpo Järvinen Date: Wed Oct 18 14:32:48 2023 +0300 PCI: cadence: Use FIELD_GET() Convert open-coded variants of PCI field access into FIELD_GET() to make the code easier to understand. Link: https://lore.kernel.org/r/20231018113254.17616-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit f1243fcea5a3f0a9cd15283fa4b512b2cdf14a08 Merge: 57e06f8c1f947 20bd119183047 Author: Arnd Bergmann Date: Wed Oct 18 17:45:48 2023 +0200 Merge tag 'v6.7-rockchip-drivers1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into soc/drivers Converting the io-domain driver to the new remove callback. * tag 'v6.7-rockchip-drivers1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: soc/rockchip: io-domain: Convert to platform remove callback returning void Link: https://lore.kernel.org/r/2578684.Lt9SDvczpP@phil Signed-off-by: Arnd Bergmann commit 57e06f8c1f9470932255145c40f54fd7a818a72f Merge: 09427e1975bfa c0989f7d1264b Author: Arnd Bergmann Date: Wed Oct 18 17:17:56 2023 +0200 Merge tag 'qcom-drivers-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/drivers Qualcomm driver updates for v6.7 This introduces partial support for the Qualcomm Secure Execution Environment SCM interface, and uses this to implement EFI variable access on the Windows On Snapdragon devices (for now). The 32/64-bit calling convention detector of the SCM interface is updated to not choose 64-bit convention when Linux is 32-bit. The "extern" specifier is dropped from the interface include file. The LLCC driver gains support for carrying configuration for multiple different system/DDR configurations for a given platform, and selecting between them. Support for Q[DR]U1000 is added to the driver. All exported symbols are transitioned to EXPORT_SYMBOL_GPL(). The platform_drivers in the Qualcomm SoC are transitioned to the void-returning remove_new implementation. The rmtfs memory driver gains support for leaving guard pages around the used area, to avoid issues if the allocation happens to be placed adjacent to another protected memory region. The socinfo driver gains knowledge about IPQ8174, QCM6490, SM7150P and various PMICs used together with SM8550. * tag 'qcom-drivers-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (44 commits) soc: qcom: socinfo: Convert to platform remove callback returning void soc: qcom: smsm: Convert to platform remove callback returning void soc: qcom: smp2p: Convert to platform remove callback returning void soc: qcom: smem: Convert to platform remove callback returning void soc: qcom: rmtfs_mem: Convert to platform remove callback returning void soc: qcom: qcom_stats: Convert to platform remove callback returning void soc: qcom: qcom_gsbi: Convert to platform remove callback returning void soc: qcom: qcom_aoss: Convert to platform remove callback returning void soc: qcom: pmic_glink: Convert to platform remove callback returning void soc: qcom: ocmem: Convert to platform remove callback returning void soc: qcom: llcc-qcom: Convert to platform remove callback returning void soc: qcom: icc-bwmon: Convert to platform remove callback returning void firmware: qcom_scm: use 64-bit calling convention only when client is 64-bit soc: qcom: llcc: Handle a second device without data corruption soc: qcom: Switch to EXPORT_SYMBOL_GPL() soc: qcom: smem: Annotate struct qcom_smem with __counted_by soc: qcom: rmtfs: Support discarding guard pages dt-bindings: reserved-memory: rmtfs: Allow guard pages dt-bindings: firmware: qcom,scm: document IPQ5018 compatible firmware: qcom_scm: disable SDI if required ... Link: https://lore.kernel.org/r/20231015204014.855672-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit e2049d8569d94446eb581f792178c1ac4eddb58b Author: wuqiang.matt Date: Tue Oct 17 21:56:54 2023 +0800 MAINTAINERS: objpool added objpool, a scalable and lockless ring-array based object pool, was introduced to replace the original freelist (a LIFO queue based on singly linked list) to improve kretprobe scalability. Link: https://lore.kernel.org/all/20231017135654.82270-6-wuqiang.matt@bytedance.com/ Signed-off-by: wuqiang.matt Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit f46e8939de80bf029787111bf488ee86355b111c Author: wuqiang.matt Date: Tue Oct 17 21:56:53 2023 +0800 kprobes: freelist.h removed This patch will remove freelist.h from kernel source tree, since the only use cases (kretprobe and rethook) are converted to objpool. Link: https://lore.kernel.org/all/20231017135654.82270-5-wuqiang.matt@bytedance.com/ Signed-off-by: wuqiang.matt Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit 4bbd9345565933823f38a419df65661f12adbe5e Author: wuqiang.matt Date: Tue Oct 17 21:56:52 2023 +0800 kprobes: kretprobe scalability improvement kretprobe is using freelist to manage return-instances, but freelist, as LIFO queue based on singly linked list, scales badly and reduces the overall throughput of kretprobed routines, especially for high contention scenarios. Here's a typical throughput test of sys_prctl (counts in 10 seconds, measured with perf stat -a -I 10000 -e syscalls:sys_enter_prctl): OS: Debian 10 X86_64, Linux 6.5rc7 with freelist HW: XEON 8336C x 2, 64 cores/128 threads, DDR4 3200MT/s 1T 2T 4T 8T 16T 24T 24150045 29317964 15446741 12494489 18287272 17708768 32T 48T 64T 72T 96T 128T 16200682 13737658 11645677 11269858 10470118 9931051 This patch introduces objpool to replace freelist. objpool is a high performance queue, which can bring near-linear scalability to kretprobed routines. Tests of kretprobe throughput show the biggest ratio as 159x of original freelist. Here's the result: 1T 2T 4T 8T 16T native: 41186213 82336866 164250978 328662645 658810299 freelist: 24150045 29317964 15446741 12494489 18287272 objpool: 23926730 48010314 96125218 191782984 385091769 32T 48T 64T 96T 128T native: 1330338351 1969957941 2512291791 2615754135 2671040914 freelist: 16200682 13737658 11645677 10470118 9931051 objpool: 764481096 1147149781 1456220214 1502109662 1579015050 Testings on 96-core ARM64 output similarly, but with the biggest ratio up to 448x: OS: Debian 10 AARCH64, Linux 6.5rc7 HW: Kunpeng-920 96 cores/2 sockets/4 NUMA nodes, DDR4 2933 MT/s 1T 2T 4T 8T 16T native: . 30066096 63569843 126194076 257447289 505800181 freelist: 16152090 11064397 11124068 7215768 5663013 objpool: 13997541 28032100 55726624 110099926 221498787 24T 32T 48T 64T 96T native: 763305277 1015925192 1521075123 2033009392 3021013752 freelist: 5015810 4602893 3766792 3382478 2945292 objpool: 328192025 439439564 668534502 887401381 1319972072 Link: https://lore.kernel.org/all/20231017135654.82270-4-wuqiang.matt@bytedance.com/ Signed-off-by: wuqiang.matt Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit f93b8a5705c6886a4c5ec6d142730927d891b6f7 Author: Dmitry Baryshkov Date: Wed Oct 11 13:32:45 2023 +0300 arm64: defconfig: enable DisplayPort altmode support Enable the DisplayPort altmode, it is required to get DisplayPort output to work on devices like Qualcomm Robotics RB5 platform. Signed-off-by: Dmitry Baryshkov Reviewd-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20231011103245.96638-2-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 323c7ec86446e8364cf338f40297194cc7a159fa Author: Dmitry Baryshkov Date: Wed Oct 11 13:32:44 2023 +0300 arm64: defconfig: enable CONFIG_TYPEC_QCOM_PMIC Enable Qualcomm PMIC TCPM driver, it is used to handle Type-C ports on devices like Qualcomm Robotics RB5 platform. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20231011103245.96638-1-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit a8eddbe354b491608e614344c05cdcf019b34fd2 Merge: 70ea4e97902d1 c96b13d7c0e49 Author: Arnd Bergmann Date: Wed Oct 18 16:56:35 2023 +0200 Merge tag 'v6.7-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into soc/dt Someone resurrected a rk3128 board and provided actual SMP support for it. Of course firmware for that SoC does not come with TF-A so it's the old-style SMP the older arm32 Rockchip SoCs use. And additionally the rv1126 got pwm support. * tag 'v6.7-rockchip-dts32-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: dts: rockchip: Switch to operating-points-v2 for RK3128's CPU ARM: dts: rockchip: Enable SMP bring-up for RK3128 ARM: dts: rockchip: Add CPU resets for RK3128 ARM: dts: rockchip: Add SRAM node for RK3128 ARM: dts: rockchip: Enable pwm fan for edgeble-neu2 ARM: dts: rockchip: Add pwm11 node to rv1126 ARM: dts: rockchip: Add pwm11m0 pins to rv1126 ARM: dts: rockchip: Add pwm2 node to rv1126 ARM: dts: rockchip: Add pwm2m0 pins to rv1126 dt-bindings: pwm: rockchip: Document rv1126-pwm Link: https://lore.kernel.org/r/2167992.Mh6RI2rZIc@phil Signed-off-by: Arnd Bergmann commit 70ea4e97902d1f406f70b54fb4e50b177af86403 Merge: 79384a0475351 1e9ac3e8a6a9d Author: Arnd Bergmann Date: Wed Oct 18 16:53:33 2023 +0200 Merge tag 'v6.7-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into soc/dt Work mostly focussed on the still new rk3588 Soc with some new boards the Orange Pi 5 and Orange Pi 5 Plus as well as the QuartzPro64 from Pine64. It also gained two new peripherals, the SFC (serial-flash-controller) as well as support for it's AV1 video decoder. And of course existing rk3588 boards got support added for various peripherals (PCIe, usb, sardadc, leds, etc). And in non-rk3588 news, rk3566-based gaming devices seem to be en-vogue, and the Powkiddy RGB30 also moved in. * tag 'v6.7-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: (27 commits) arm64: dts: rockchip: add support for Powkiddy RGB30 dt-bindings: arm64: rockchip: add Powkiddy RGB30 arm64: dts: rockchip: add status LED to rock-5b arm64: dts: rockchip: add ADC buttons to rk3588-evb1 arm64: dts: rockchip: Add AV1 decoder node to rk3588s arm64: dts: rockchip: Add missing sdmmc2 SDR rates to rock-3a arm64: dts: rockchip: Enable UART6 on rock-5b arm64: dts: rockchip: Remove duplicate regulator vcc3v3_wf from rock-5b arm64: dts: rockchip: Add QuartzPro64 SBC device tree dt-bindings: arm: rockchip: Add Pine64 QuarzPro64 arm64: dts: rockchip: Add board device tree for rk3588-orangepi-5-plus dt-bindings: arm: rockchip: Add Orange Pi 5 Plus arm64: dts: rockchip: Add UART9 M0 pin definitions to rk3588s arm64: dts: rockchip: Add I2S2 M0 pin definitions to rk3588s arm64: dts: rockchip: Add Orange Pi 5 arm64: dts: rockchip: Add sfc node to rk3588s dt-bindings: arm: rockchip: Add Orange Pi 5 board arm64: dts: rockchip: Add NanoPC T6 PCIe e-key support arm64: dts: rockchip: Add sdio node to rock-5b arm64: dts: rockchip: add PCIe3 bus to rk3588-evb1 ... Link: https://lore.kernel.org/r/1870252.CQOukoFCf9@phil Signed-off-by: Arnd Bergmann commit 64c3259b5f86963c5214e63cfadedaa2278ba0ed Author: David Rau Date: Wed Oct 18 14:44:44 2023 +0800 ASoC: da7213: Add new kcontrol for tonegen Add new kcontrol for tone generator Signed-off-by: David Rau Link: https://lore.kernel.org/r/20231018064444.23186-1-David.Rau.opensource@dm.renesas.com Signed-off-by: Mark Brown commit e485c7a1939d9b1e6ed2a728e15009b44074f131 Merge: d3b614d993781 a590ed62269a0 Author: Ilpo Järvinen Date: Wed Oct 18 17:07:11 2023 +0300 Merge remote-tracking branch 'intel-speed-select/intel-sst' into review-ilpo Summary of changes: - CPU 0 hotplug support is deprecated in the upstream kernel. This causes failures during level change for several customers. So, add a silent workaround to use Cgroup v2, without user option. - Increase number of CPUs in a single request - Fix turbo mode enable/disable issue - Error handling for invalid input options commit 79384a0475351b9dacd875b4faa8662ced88e632 Merge: 7115816b609a4 81b5948cf1a7a Author: Arnd Bergmann Date: Wed Oct 18 16:03:47 2023 +0200 Merge tag 'riscv-dt-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into soc/dt RISC-V Devicetrees for v6.7 StarFive: Things are a bit slower for StarFive this window, there's only the addition of audio related DT nodes to speak of here. Generic: The SiFive, StarFive and Microchip devicetrees have had my replacement ISA extension detection properties added. Unfortunately, the old "riscv,isa" property never defined exactly what the extensions it contained meant, and people were want to fill it in incorrectly (and call upstream kernel devs idiots for not doing the same). The new properties have explicit definitions and hopefully will stand up better to some of the variation from RVI. Sophgo: Two new SoCs, one is probably the first of several with up/down tuned variants, that have a pair of T-Head c906 cores and appear aimed at the IP camera, smart etc markets. They are intended to run in AMP mode, with an RTOS on the less powerful core. The other is far more interesting to kernel developers however, the 64-core SG2042, with more recent c920 cores from T-Head at 2 GHz. For both, support is at a very basic stage - some of the same developers are working on them as other T-Head powered SoCs, but hopefully things will move beyond a basic console boot. The goal is for Chen Wang to take over maintaining the Sophgo support once they have some more experience with the process. Signed-off-by: Conor Dooley * tag 'riscv-dt-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux: (22 commits) riscv: dts: starfive: convert isa detection to new properties riscv: dts: sifive: convert isa detection to new properties riscv: dts: microchip: convert isa detection to new properties riscv: dts: sophgo: add Milk-V Duo board device tree riscv: dts: sophgo: add initial CV1800B SoC device tree dt-bindings: riscv: Add Milk-V Duo board compatibles dt-bindings: timer: Add SOPHGO CV1800B clint dt-bindings: interrupt-controller: Add SOPHGO CV1800B plic riscv: defconfig: enable SOPHGO SoC riscv: dts: sophgo: add Milk-V Pioneer board device tree riscv: dts: add initial Sophgo SG2042 SoC device tree dt-bindings: interrupt-controller: Add Sophgo sg2042 CLINT mswi dt-bindings: timer: Add Sophgo sg2042 CLINT timer dt-bindings: interrupt-controller: Add Sophgo SG2042 PLIC dt-bindings: riscv: Add T-HEAD C920 compatibles dt-bindings: riscv: add sophgo sg2042 bindings dt-bindings: vendor-prefixes: add milkv/sophgo riscv: Add SOPHGO SOC family Kconfig support riscv: dts: starfive: add assigned-clock* to limit frquency riscv: dts: starfive: Add JH7110 PWM-DAC support ... Link: https://lore.kernel.org/r/20231016-filing-payroll-7aca51b8f1a3@spud Signed-off-by: Arnd Bergmann commit 92f90d3b0d5e384f218c8068138ed1b3afa025af Author: wuqiang.matt Date: Tue Oct 17 21:56:51 2023 +0800 lib: objpool test module added The test_objpool module (test_objpool) will run several testcases for objpool stress and performance evaluation. Each testcase will have all available cpu cores involved to create a situation of high parallel and high contention. As of now there are 5 groups and 5 * 2 testcases in total: 1) group 1: synchronous mode objpool is managed synchronously, that is, all objects are to be reclaimed before objpool finalization and the objpool owner makes sure of it. All threads on different cores run in the same pace 2) group 2: synchronous mode + hrtimer this case have 2 customers: normal threads and hrtimer softirqs 3) group 3: synchronous + overrun mode This test group is mainly for performance evaluation of missing cases when pre-allocated objects are less than the requested 4) group 4: asynchronous mode This case is just an emulation of kretprobe, with refcount used to control the objpool lifecycle 5) group 5: asynchronous mode with hrtimer hrtimer softirq is introduced to stress async objpool operations Link: https://lore.kernel.org/all/20231017135654.82270-3-wuqiang.matt@bytedance.com/ Signed-off-by: wuqiang.matt Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit b4edb8d2d4647a71a246d91fe34ff25c2c5f3481 Author: wuqiang.matt Date: Tue Oct 17 21:56:50 2023 +0800 lib: objpool added: ring-array based lockless MPMC objpool is a scalable implementation of high performance queue for object allocation and reclamation, such as kretprobe instances. With leveraging percpu ring-array to mitigate hot spots of memory contention, it delivers near-linear scalability for high parallel scenarios. The objpool is best suited for the following cases: 1) Memory allocation or reclamation are prohibited or too expensive 2) Consumers are of different priorities, such as irqs and threads Limitations: 1) Maximum objects (capacity) is fixed after objpool creation 2) All pre-allocated objects are managed in percpu ring array, which consumes more memory than linked lists Link: https://lore.kernel.org/all/20231017135654.82270-2-wuqiang.matt@bytedance.com/ Signed-off-by: wuqiang.matt Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit 7115816b609a491e767d8ee63ed2727048f51b5f Author: Rob Herring Date: Thu Sep 28 14:08:45 2023 -0500 arm/arm64: dts: Removed undocumented and unused "pl022,hierarchy" property The "pl022,hierarchy" is not documented, all instances use are 0 and isn't handled in the kernel driver, so let's just remove it. Signed-off-by: Rob Herring Acked-by: Viresh Kumar Acked-by: Tom Lendacky Link: https://lore.kernel.org/r/20230928190859.1072420-1-robh@kernel.org Signed-off-by: Arnd Bergmann commit f46ada004d8cf9e02aa72311b1380e1ba472fede Merge: 646fe2e4b3904 435d422624b74 Author: Arnd Bergmann Date: Wed Oct 18 15:33:30 2023 +0200 Merge tag 'renesas-arm-soc-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/arm Renesas ARM SoC updates for v6.7 - Reserve boot area when SMP is enabled to prevent conflicts with FLASH, - Miscellaneous fixes and improvements. * tag 'renesas-arm-soc-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: ARM: shmobile: sh73a0: Reserve boot area when SMP is enabled ARM: shmobile: r8a7779: Reserve boot area when SMP is enabled ARM: shmobile: rcar-gen2: Reserve boot area when SMP is enabled ARM: shmobile: rcar-gen2: Remove unneeded once handling Link: https://lore.kernel.org/r/cover.1695985421.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 5855d422a6f250f3518f43b49092c8e87a5e42be Author: AngeloGioacchino Del Regno Date: Tue May 23 12:42:34 2023 +0200 drm: mediatek: mtk_dsi: Fix NO_EOT_PACKET settings/handling Due to the initial confusion about MIPI_DSI_MODE_EOT_PACKET, properly renamed to MIPI_DSI_MODE_NO_EOT_PACKET, reflecting its actual meaning, both the DSI_TXRX_CON register setting for bit (HSTX_)DIS_EOT and the later calculation for horizontal sync-active (HSA), back (HBP) and front (HFP) porches got incorrect due to the logic being inverted. This means that a number of settings were wrong because....: - DSI_TXRX_CON register setting: bit (HSTX_)DIS_EOT should be set in order to disable the End of Transmission packet; - Horizontal Sync and Back/Front porches: The delta used to calculate all of HSA, HBP and HFP should account for the additional EOT packet. Before this change... - Bit (HSTX_)DIS_EOT was being set when EOT packet was enabled; - For HSA/HBP/HFP delta... all three were wrong, as words were added when EOT disabled, instead of when EOT packet enabled! Invert the logic around flag MIPI_DSI_MODE_NO_EOT_PACKET in the MediaTek DSI driver to fix the aforementioned issues. Fixes: 8b2b99fd7931 ("drm/mediatek: dsi: Fine tune the line time caused by EOTp") Fixes: c87d1c4b5b9a ("drm/mediatek: dsi: Use symbolized register definition") Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Tested-by: Michael Walle Link: https://patchwork.kernel.org/project/dri-devel/patch/20230523104234.7849-1-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 12cd44023651666bd44baa36a5c999698890debb Author: Jeff Layton Date: Fri Sep 29 09:05:52 2023 -0400 fs: rename inode i_atime and i_mtime fields Rename these two fields to discourage direct access (and to help ensure that we mop up any leftover direct accesses). Signed-off-by: Jeff Layton Signed-off-by: Christian Brauner commit d32cdb32b73c4f720f15a966da84635fa2dddedb Author: Jeff Layton Date: Wed Oct 4 14:53:11 2023 -0400 security: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Acked-by: Paul Moore Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-84-jlayton@kernel.org Signed-off-by: Christian Brauner commit 26d1283179533847a840da7ab5b2e3773c1a9f99 Author: Jeff Layton Date: Wed Oct 4 14:53:10 2023 -0400 selinux: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Acked-by: Paul Moore Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-83-jlayton@kernel.org Signed-off-by: Christian Brauner commit 7563c93494b74772d4220a73895eb8a91ffda6cb Author: Jeff Layton Date: Wed Oct 4 14:53:09 2023 -0400 apparmor: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-82-jlayton@kernel.org Signed-off-by: Christian Brauner commit 5feb4b4ac4ac16d1b4d7af0857533d9b501d6999 Author: Jeff Layton Date: Wed Oct 4 14:53:08 2023 -0400 sunrpc: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-81-jlayton@kernel.org Signed-off-by: Christian Brauner commit cf2766bb7c25baf38b1cda3360bc531ad79c33e7 Author: Jeff Layton Date: Wed Oct 4 14:53:07 2023 -0400 mm: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-80-jlayton@kernel.org Signed-off-by: Christian Brauner commit 1bc628a756d93a7bed2f80914b15821bb9a4369c Author: Jeff Layton Date: Wed Oct 4 14:53:06 2023 -0400 bpf: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-79-jlayton@kernel.org Signed-off-by: Christian Brauner commit d162a3cf6ee1a64417e11693c1410d79878c9917 Author: Jeff Layton Date: Wed Oct 4 14:53:05 2023 -0400 ipc: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-78-jlayton@kernel.org Signed-off-by: Christian Brauner commit 1f693269cbb4cd9cd1044299c14b2464590a5f28 Author: Jeff Layton Date: Wed Oct 4 14:53:04 2023 -0400 linux: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-77-jlayton@kernel.org Signed-off-by: Christian Brauner commit 8df379a340e765af10c33de90fd954d6d7dcd8a2 Author: Jeff Layton Date: Wed Oct 4 14:53:03 2023 -0400 zonefs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-76-jlayton@kernel.org Signed-off-by: Christian Brauner commit 75d1e312bbbd175fa27ffdd4c4fe9e8cc7d047ec Author: Jeff Layton Date: Wed Oct 4 14:53:02 2023 -0400 xfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-75-jlayton@kernel.org Signed-off-by: Christian Brauner commit 9caef040aa0e03efd4a94792a741d7c87f926a47 Author: Jeff Layton Date: Wed Oct 4 14:53:01 2023 -0400 vboxsf: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-74-jlayton@kernel.org Signed-off-by: Christian Brauner commit d936d3820658bc2728804482c7a3d07ea5da2a3d Author: Jeff Layton Date: Wed Oct 4 14:53:00 2023 -0400 ufs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-73-jlayton@kernel.org Signed-off-by: Christian Brauner commit f972fed75496457e8b6495fbe47e8ccdedc820af Author: Jeff Layton Date: Wed Oct 4 14:52:59 2023 -0400 udf: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-72-jlayton@kernel.org Signed-off-by: Christian Brauner commit e4cfef337cd081ff0ca0e4a3c55286789e007a11 Author: Jeff Layton Date: Wed Oct 4 14:52:58 2023 -0400 ubifs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-71-jlayton@kernel.org Signed-off-by: Christian Brauner commit 079cf91e0eb1a2bb5891a4e17c690ebf7e935969 Author: Jeff Layton Date: Wed Oct 4 14:52:57 2023 -0400 tracefs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-70-jlayton@kernel.org Signed-off-by: Christian Brauner commit ae3d362acffc5c901f8579352f1ddbb5797fc06a Author: Jeff Layton Date: Wed Oct 4 14:52:56 2023 -0400 sysv: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-69-jlayton@kernel.org Signed-off-by: Christian Brauner commit a1f13ed8c74893ed31d41c5bca156a623b0e9a86 Author: Jeff Layton Date: Wed Oct 4 14:52:55 2023 -0400 squashfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-68-jlayton@kernel.org Signed-off-by: Christian Brauner commit 769cfc919e35c70a5110b0843fb330746363acb8 Author: Jeff Layton Date: Wed Oct 4 14:52:54 2023 -0400 server: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-67-jlayton@kernel.org Signed-off-by: Christian Brauner commit 8f22ce7088835444418f0775efb455d10b825596 Author: Jeff Layton Date: Wed Oct 4 14:52:53 2023 -0400 client: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-66-jlayton@kernel.org Signed-off-by: Christian Brauner commit f26c93d38ca3fcb858ecfc1d322e7620e4b05022 Author: Jeff Layton Date: Wed Oct 4 14:52:52 2023 -0400 romfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-65-jlayton@kernel.org Signed-off-by: Christian Brauner commit 5e8b820be8203f24773d653e5379448408e82121 Author: Jeff Layton Date: Wed Oct 4 14:52:51 2023 -0400 reiserfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-64-jlayton@kernel.org Signed-off-by: Christian Brauner commit 6d0c1b68e587e38ecb375ea6ff58a965cbe20ac4 Author: Jeff Layton Date: Wed Oct 4 14:52:50 2023 -0400 ramfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-63-jlayton@kernel.org Signed-off-by: Christian Brauner commit c2c08f3f666f811c87e377985a87e8c940d424c3 Author: Jeff Layton Date: Wed Oct 4 14:52:49 2023 -0400 qnx6: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-62-jlayton@kernel.org Signed-off-by: Christian Brauner commit 55a756549ef6479781bc050cd26d19599fb78427 Author: Jeff Layton Date: Wed Oct 4 14:52:48 2023 -0400 qnx4: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-61-jlayton@kernel.org Signed-off-by: Christian Brauner commit 1b3c527f55ab1343d30144e7d81b91f93ee3f156 Author: Jeff Layton Date: Wed Oct 4 14:52:47 2023 -0400 pstore: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-60-jlayton@kernel.org Acked-by: Kees Cook Signed-off-by: Christian Brauner commit 200d942170a8e7b94d7cdc871f9a067917bc3f4a Author: Jeff Layton Date: Wed Oct 4 14:52:46 2023 -0400 proc: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-59-jlayton@kernel.org Signed-off-by: Christian Brauner commit 4ddbd0f1fe8c9edd2be5465d681834e9ab2f4dd9 Author: Jeff Layton Date: Wed Oct 4 14:52:45 2023 -0400 overlayfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-58-jlayton@kernel.org Signed-off-by: Christian Brauner commit 702ed7f1c9140b4c1869b696fbbd71fe880289c2 Author: Jeff Layton Date: Wed Oct 4 14:52:44 2023 -0400 orangefs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-57-jlayton@kernel.org Signed-off-by: Christian Brauner commit 76daf9b16b55662280e69a783e6023c875432843 Author: Jeff Layton Date: Wed Oct 4 14:52:43 2023 -0400 openpromfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-56-jlayton@kernel.org Signed-off-by: Christian Brauner commit b91826ce75c1f7fca2abadf392d99691e79f4869 Author: Jeff Layton Date: Wed Oct 4 14:52:42 2023 -0400 omfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-55-jlayton@kernel.org Signed-off-by: Christian Brauner commit fd6acbbc4d1edb218ade7ac0ab1839f9e4fcd094 Author: Jeff Layton Date: Wed Oct 4 14:52:41 2023 -0400 ocfs2: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-54-jlayton@kernel.org Signed-off-by: Christian Brauner commit 2be861fab2d9e8740f97d954520a32b743145971 Author: Jeff Layton Date: Wed Oct 4 14:52:40 2023 -0400 ntfs3: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-53-jlayton@kernel.org Signed-off-by: Christian Brauner commit 56c0d99b846adeded1ce8fabf782d86a8a0b6eb7 Author: Jeff Layton Date: Wed Oct 4 14:52:39 2023 -0400 ntfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-52-jlayton@kernel.org Signed-off-by: Christian Brauner commit b3e1cc3935ffe46b758d3b459664311894b5fec7 Author: Jeff Layton Date: Wed Oct 4 14:52:38 2023 -0400 nilfs2: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-51-jlayton@kernel.org Signed-off-by: Christian Brauner commit 11fec9b9fb04fd1b3330a3b91ab9dcfa81ad5ad3 Author: Jeff Layton Date: Wed Oct 4 14:52:37 2023 -0400 nfsd: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-50-jlayton@kernel.org Signed-off-by: Christian Brauner commit 41d581a9faefe9121e1f52da5bdbf83476e9497e Author: Jeff Layton Date: Wed Oct 4 14:52:36 2023 -0400 nfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-49-jlayton@kernel.org Signed-off-by: Christian Brauner commit 06475f4b13a958d9faad79f788ddd4284abf0e43 Author: Jeff Layton Date: Wed Oct 4 14:52:35 2023 -0400 minix: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-48-jlayton@kernel.org Signed-off-by: Christian Brauner commit 2a45ac155937af24cc5677bb5e53190bcbc023bb Author: Jeff Layton Date: Wed Oct 4 14:52:34 2023 -0400 kernfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-47-jlayton@kernel.org Signed-off-by: Christian Brauner commit dc34d1330c2c08e4b7f0ecf9db5862a8da0f56e0 Author: Jeff Layton Date: Wed Oct 4 14:52:33 2023 -0400 jfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Acked-by: Dave Kleikamp Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-46-jlayton@kernel.org Signed-off-by: Christian Brauner commit 95af66c4979b08cc8d0982168c1a56a74f5c7b48 Author: Jeff Layton Date: Wed Oct 4 14:52:32 2023 -0400 jffs2: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-45-jlayton@kernel.org Signed-off-by: Christian Brauner commit 5a4bff92372ef86add9534180b7743b55d1fe393 Author: Jeff Layton Date: Wed Oct 4 14:52:31 2023 -0400 isofs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-44-jlayton@kernel.org Signed-off-by: Christian Brauner commit cfd87e76901fde31983860c6a377128173ee8b49 Author: Jeff Layton Date: Wed Oct 4 14:52:30 2023 -0400 hugetlbfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-43-jlayton@kernel.org Signed-off-by: Christian Brauner commit 83c1d74c1334c75bf5035931d7dfcaca1d4eb90c Author: Jeff Layton Date: Wed Oct 4 14:52:29 2023 -0400 hpfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-42-jlayton@kernel.org Signed-off-by: Christian Brauner commit c461ba5d5baaa1c84b447efb969ab97a59e8a0f5 Author: Jeff Layton Date: Wed Oct 4 14:52:28 2023 -0400 hostfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-41-jlayton@kernel.org Signed-off-by: Christian Brauner commit a0491073937033a021dbc4bc2a5469eb0a46a235 Author: Jeff Layton Date: Wed Oct 4 14:52:27 2023 -0400 hfsplus: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-40-jlayton@kernel.org Signed-off-by: Christian Brauner commit b5c6b1ea0ce8e318a6486ca484a0d667fbb320be Author: Jeff Layton Date: Wed Oct 4 14:52:26 2023 -0400 hfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-39-jlayton@kernel.org Signed-off-by: Christian Brauner commit 580f721b6f5ad5adc07a836335beda2961c0f700 Author: Jeff Layton Date: Wed Oct 4 14:52:25 2023 -0400 gfs2: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-38-jlayton@kernel.org Signed-off-by: Christian Brauner commit 3c0d5df2d03d797e66f6eef08859930a01d5d6ad Author: Jeff Layton Date: Wed Oct 4 14:52:24 2023 -0400 fuse: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-37-jlayton@kernel.org Signed-off-by: Christian Brauner commit 5ec1b39e694e5ba077ba4a0f9275b358e7586329 Author: Jeff Layton Date: Wed Oct 4 14:52:23 2023 -0400 freevxfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-36-jlayton@kernel.org Signed-off-by: Christian Brauner commit daaf2bf039c28c01222124d90d8351e4546a5b0b Author: Jeff Layton Date: Wed Oct 4 14:52:22 2023 -0400 fat: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-35-jlayton@kernel.org Tested-by: Klara Modin Signed-off-by: Christian Brauner commit 4b47b0fa4b15e0de916e7dd93cd787fdab208ff2 Author: Muhammad Muzammil Date: Fri Oct 13 10:31:18 2023 +0500 powerpc/bpf: Fixed 'instead' typo in bpf_jit_build_body() Fixed 'instead' typo. Signed-off-by: Muhammad Muzammil Signed-off-by: Michael Ellerman Link: https://msgid.link/20231013053118.11221-1-m.muzzammilashraf@gmail.com commit 1c7b4bc375c2a235e3dcb53c46111883df838e42 Merge: c7e0d9bb9154c f9bc9bbe8afdf Author: Michael Ellerman Date: Wed Oct 18 22:18:24 2023 +1100 Merge branch fixes into next Merge our fixes branch to bring in commits that are prerequisities for further development or would cause conflicts. commit 11cc6426ad407a6f64d7567124dcf5f91d6993fb Author: Jeff Layton Date: Wed Oct 4 14:52:21 2023 -0400 f2fs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-34-jlayton@kernel.org Signed-off-by: Christian Brauner commit b898ab233611f7903d88c0b10f8145e1c15d3642 Author: Jeff Layton Date: Wed Oct 4 14:52:20 2023 -0400 ext4: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-33-jlayton@kernel.org Signed-off-by: Christian Brauner commit 5cdc59fce617a2e6739bc0af91df193f540dbfba Author: Jeff Layton Date: Wed Oct 4 14:52:19 2023 -0400 ext2: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-32-jlayton@kernel.org Signed-off-by: Christian Brauner commit 4c72a36edd54f59353cee00b31db46d196dfbd58 Author: Jeff Layton Date: Wed Oct 4 14:52:18 2023 -0400 exfat: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-31-jlayton@kernel.org Signed-off-by: Christian Brauner commit 594370f7e80fc1ba97e733b0518bf56f2f030be2 Author: Jeff Layton Date: Wed Oct 4 14:52:17 2023 -0400 erofs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-30-jlayton@kernel.org Signed-off-by: Christian Brauner commit 89ddde88b7eca3fcaebc64a4135cdd0b3a1ad384 Author: Jeff Layton Date: Wed Oct 4 14:52:16 2023 -0400 efs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-29-jlayton@kernel.org Signed-off-by: Christian Brauner commit da06c204ff347dd75342eeeb618480b51b3874db Author: Jeff Layton Date: Wed Oct 4 14:52:15 2023 -0400 efivarfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-28-jlayton@kernel.org Signed-off-by: Christian Brauner commit 69d9116d0a0d996360cb7eda7be0c32da6518b23 Author: Jeff Layton Date: Wed Oct 4 14:52:14 2023 -0400 devpts: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-27-jlayton@kernel.org Signed-off-by: Christian Brauner commit d21b3c321f1620de2c51143cf048719aee979037 Author: Jeff Layton Date: Wed Oct 4 14:52:13 2023 -0400 debugfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-26-jlayton@kernel.org Signed-off-by: Christian Brauner commit 86184320d6390398250ac211bea4876b4c5b901f Author: Jeff Layton Date: Wed Oct 4 14:52:12 2023 -0400 cramfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-25-jlayton@kernel.org Signed-off-by: Christian Brauner commit 9e4e269ff31905fd6e31d86133def1ccef73257b Author: Jeff Layton Date: Wed Oct 4 14:52:11 2023 -0400 configfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-24-jlayton@kernel.org Signed-off-by: Christian Brauner commit 581a4d0030011367dec1defff3361d982674c294 Author: Jeff Layton Date: Wed Oct 4 14:52:10 2023 -0400 coda: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-23-jlayton@kernel.org Signed-off-by: Christian Brauner commit c453bdb535341b573755a0359eb391dc8cf42546 Author: Jeff Layton Date: Wed Oct 4 14:52:09 2023 -0400 ceph: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-22-jlayton@kernel.org Signed-off-by: Christian Brauner commit b1c38a1338c90597c7af66985a9e31152ae8cfd3 Author: Jeff Layton Date: Wed Oct 4 14:52:08 2023 -0400 btrfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-21-jlayton@kernel.org Signed-off-by: Christian Brauner commit ce17a80c388cd1fcd2b6c1212440abd4d3a923e0 Author: Jeff Layton Date: Wed Oct 4 14:52:07 2023 -0400 bfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-20-jlayton@kernel.org Signed-off-by: Christian Brauner commit 3aa4155c1e471852bdf4d75e428254a56c805b93 Author: Jeff Layton Date: Wed Oct 4 14:52:06 2023 -0400 befs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-19-jlayton@kernel.org Signed-off-by: Christian Brauner commit 2c11fd980a43f9f1eb3c2869a8acf7cdca157bed Author: Jeff Layton Date: Wed Oct 4 14:52:04 2023 -0400 autofs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-17-jlayton@kernel.org Signed-off-by: Christian Brauner commit 562ce1f7547c083ee44b26796d771361a8b2ead6 Author: Jeff Layton Date: Wed Oct 4 14:52:03 2023 -0400 afs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-16-jlayton@kernel.org Signed-off-by: Christian Brauner commit ea7719af1b48fad4f4151cb1753f83646cef6bb9 Author: Jeff Layton Date: Wed Oct 4 14:52:02 2023 -0400 affs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-15-jlayton@kernel.org Signed-off-by: Christian Brauner commit ca9649e9bdf520ded6a215d1294976dabd863a76 Author: Jeff Layton Date: Wed Oct 4 14:52:01 2023 -0400 adfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-14-jlayton@kernel.org Signed-off-by: Christian Brauner commit d0242a3a615dd1bbad5c547f3ac052f170b3555a Author: Jeff Layton Date: Wed Oct 4 14:52:00 2023 -0400 9p: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-13-jlayton@kernel.org Signed-off-by: Christian Brauner commit 2b450e92465ccd01eaffb7b7a5b24a511f9680f4 Author: Jeff Layton Date: Wed Oct 4 14:51:59 2023 -0400 usb: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-12-jlayton@kernel.org Signed-off-by: Christian Brauner commit 69f73ca33d6bd453e82656daa2bc8ca4cb0c97dd Author: Jeff Layton Date: Wed Oct 4 14:51:58 2023 -0400 legacy: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-11-jlayton@kernel.org Signed-off-by: Christian Brauner commit 9a0518de2b24fb22852ccad0ddd6c67d5c8820d2 Author: Jeff Layton Date: Wed Oct 4 14:51:57 2023 -0400 function: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-10-jlayton@kernel.org Signed-off-by: Christian Brauner commit ee088ed761b0dc5258693d86710c8857fefda683 Author: Jeff Layton Date: Wed Oct 4 14:51:56 2023 -0400 tty: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-9-jlayton@kernel.org Signed-off-by: Christian Brauner commit d524e9d6ec1e292bfe88735eb0b6f32b1940ac68 Author: Jeff Layton Date: Wed Oct 4 14:51:55 2023 -0400 x86: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-8-jlayton@kernel.org Signed-off-by: Christian Brauner commit 5776aa6bec2be00a82a5fc7258c2339af7fa6877 Author: Jeff Layton Date: Wed Oct 4 14:51:54 2023 -0400 misc: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-7-jlayton@kernel.org Signed-off-by: Christian Brauner commit 4a2ef475464cd823ec8edc6b33b5c1b40f46cb1a Author: Jeff Layton Date: Wed Oct 4 14:51:53 2023 -0400 ibmasm: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-6-jlayton@kernel.org Signed-off-by: Christian Brauner commit 7e6481cebde6649d63b41398c8200c0d4c4762ea Author: Jeff Layton Date: Wed Oct 4 14:51:52 2023 -0400 qib: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-5-jlayton@kernel.org Signed-off-by: Christian Brauner commit 19f926a688f99a42578e06a6dd14582c625d9445 Author: Jeff Layton Date: Wed Oct 4 14:51:51 2023 -0400 char: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-4-jlayton@kernel.org Signed-off-by: Christian Brauner commit 5463704f7850cd931c9e737f12a21928d0581b60 Author: Jeff Layton Date: Wed Oct 4 14:51:50 2023 -0400 android: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-3-jlayton@kernel.org Signed-off-by: Christian Brauner commit 9304a99eff43d2eff3b20c8bf9eb7a57dca14bb9 Author: Jeff Layton Date: Wed Oct 4 14:51:49 2023 -0400 hypfs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-2-jlayton@kernel.org Signed-off-by: Christian Brauner commit 4c46a0a1164132917527adce5082d18d8339a9cd Author: Jeff Layton Date: Wed Oct 4 14:51:48 2023 -0400 spufs: convert to new timestamp accessors Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185347.80880-1-jlayton@kernel.org Signed-off-by: Christian Brauner commit 16a9496523a473866a0b794ee6d6c5b74fe67d40 Author: Jeff Layton Date: Wed Oct 4 14:52:38 2023 -0400 fs: convert core infrastructure to new timestamp accessors Convert the core vfs code to use the new timestamp accessor functions. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185239.80830-2-jlayton@kernel.org Signed-off-by: Christian Brauner commit 077c212f0344ae4198b2b51af128a94b614ccdf4 Author: Jeff Layton Date: Wed Oct 4 14:52:37 2023 -0400 fs: new accessor methods for atime and mtime Recently, we converted the ctime accesses in the kernel to use new accessor functions. Linus recently pointed out though that if we add accessors for the atime and mtime, then that would allow us to seamlessly change how these timestamps are stored in the inode. Add new accessor functions for the atime and mtime that mirror the accessors for the ctime. Signed-off-by: Jeff Layton Link: https://lore.kernel.org/r/20231004185239.80830-1-jlayton@kernel.org Signed-off-by: Christian Brauner commit f1cdb599ce0ef909343d6c8e7d372defbaa382b9 Author: Nirmoy Das Date: Wed Oct 11 14:25:47 2023 +0200 drm/i915: Prevent potential null-ptr-deref in engine_init_common If measure_breadcrumb_dw() returns an error and bce isn't created, this commit ensures that intel_engine_destroy_pinned_context() is not called with a NULL bce. v2: Fix the subject s/UAF/null-ptr-deref(Jani) Fixes: b35274993680 ("drm/i915: Create a kernel context for GGTT updates") Cc: Oak Zeng Cc: Andi Shyti Cc: Jani Nikula Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231011122547.7085-1-nirmoy.das@intel.com commit c8fd5a37340f9dfb02f7c340d7b602bd2f7ec449 Author: Uwe Kleine-König Date: Sun Oct 15 15:59:56 2023 +0200 interconnect: qcom: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Several drivers use qcom_icc_rpmh_remove() as remove callback which returns zero unconditionally. Make it return void and use .remove_new in the drivers. There is no change in behaviour. Signed-off-by: Uwe Kleine-König Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231015135955.1537751-2-u.kleine-koenig@pengutronix.de Signed-off-by: Georgi Djakov commit c4eee56e14fe001e1cff54f0b438a5e2d0dd7454 Author: Phil Sutter Date: Tue Oct 17 11:39:06 2023 +0200 net: skb_find_text: Ignore patterns extending past 'to' Assume that caller's 'to' offset really represents an upper boundary for the pattern search, so patterns extending past this offset are to be rejected. The old behaviour also was kind of inconsistent when it comes to fragmentation (or otherwise non-linear skbs): If the pattern started in between 'to' and 'from' offsets but extended to the next fragment, it was not found if 'to' offset was still within the current fragment. Test the new behaviour in a kselftest using iptables' string match. Suggested-by: Pablo Neira Ayuso Fixes: f72b948dcbb8 ("[NET]: skb_find_text ignores to argument") Signed-off-by: Phil Sutter Reviewed-by: Florian Westphal Reviewed-by: Pablo Neira Ayuso Signed-off-by: David S. Miller commit 37fb1c81d210a5185c1f5399a0801719bba7f7c9 Merge: 810799a06641f 256001672153a Author: David S. Miller Date: Wed Oct 18 11:05:21 2023 +0100 Merge tag 'nf-next-23-10-18' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Florian Westphal says: ==================== netfilter next pull request 2023-10-18 This series contains initial netfilter skb drop_reason support, from myself. First few patches fix up a few spots to make sure we won't trip when followup patches embed error numbers in the upper bits (we already do this in some places). Then, nftables and bridge netfilter get converted to call kfree_skb_reason directly to let tooling pinpoint exact location of packet drops, rather than the existing NF_DROP catchall in nf_hook_slow(). I would like to eventually convert all netfilter modules, but as some callers cannot deal with NF_STOLEN (notably act_ct), more preparation work is needed for this. Last patch gets rid of an ugly 'de-const' cast in nftables. ==================== Signed-off-by: David S. Miller commit 50dcc2e0d62e3c4a54f39673c4dc3dcde7c74d52 Author: Ard Biesheuvel Date: Tue Oct 17 15:25:13 2023 +0200 x86/boot: efistub: Assign global boot_params variable Now that the x86 EFI stub calls into some APIs exposed by the decompressor (e.g., kaslr_get_random_long()), it is necessary to ensure that the global boot_params variable is set correctly before doing so. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Cc: linux-kernel@vger.kernel.org commit d55d5bc5d937743aa8ebb7ca3af25111053b5d8c Author: Ard Biesheuvel Date: Tue Oct 17 15:25:12 2023 +0200 x86/boot: Rename conflicting 'boot_params' pointer to 'boot_params_ptr' The x86 decompressor is built and linked as a separate executable, but it shares components with the kernel proper, which are either #include'd as C files, or linked into the decompresor as a static library (e.g, the EFI stub) Both the kernel itself and the decompressor define a global symbol 'boot_params' to refer to the boot_params struct, but in the former case, it refers to the struct directly, whereas in the decompressor, it refers to a global pointer variable referring to the struct boot_params passed by the bootloader or constructed from scratch. This ambiguity is unfortunate, and makes it impossible to assign this decompressor variable from the x86 EFI stub, given that declaring it as extern results in a clash. So rename the decompressor version (whose scope is limited) to boot_params_ptr. [ mingo: Renamed 'boot_params_p' to 'boot_params_ptr' for clarity ] Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Cc: linux-kernel@vger.kernel.org commit 851354cbd12bb9500909733c3d4054306f61df87 Author: Andre Przywara Date: Mon Oct 16 16:31:27 2023 +0100 clocksource/drivers/arm_arch_timer: limit XGene-1 workaround The AppliedMicro XGene-1 CPU has an erratum where the timer condition would only consider TVAL, not CVAL. We currently apply a workaround when seeing the PartNum field of MIDR_EL1 being 0x000, under the assumption that this would match only the XGene-1 CPU model. However even the Ampere eMAG (aka XGene-3) uses that same part number, and only differs in the "Variant" and "Revision" fields: XGene-1's MIDR is 0x500f0000, our eMAG reports 0x503f0002. Experiments show the latter doesn't show the faulty behaviour. Increase the specificity of the check to only consider partnum 0x000 and variant 0x00, to exclude the Ampere eMAG. Fixes: 012f18850452 ("clocksource/drivers/arm_arch_timer: Work around broken CVAL implementations") Reported-by: Ross Burton Signed-off-by: Andre Przywara Acked-by: Marc Zyngier Reviewed-by: Oliver Upton Link: https://lore.kernel.org/r/20231016153127.116101-1-andre.przywara@arm.com Signed-off-by: Catalin Marinas commit 0899a6278a86b32e0b9d55f68f265519306a5be0 Author: Gavin Shan Date: Tue Oct 17 10:50:36 2023 +1000 arm64: Remove system_uses_lse_atomics() There are two variants of system_uses_lse_atomics(), depending on CONFIG_ARM64_LSE_ATOMICS. The function isn't called anywhere when CONFIG_ARM64_LSE_ATOMICS is disabled. It can be directly replaced by alternative_has_cap_likely(ARM64_HAS_LSE_ATOMICS) when the kernel option is enabled. No need to keep system_uses_lse_atomics() and just remove it. Signed-off-by: Gavin Shan Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20231017005036.334067-1-gshan@redhat.com Signed-off-by: Catalin Marinas commit dba2ff4922b3cf573c25c3886e869258a6076030 Author: Catalin Marinas Date: Tue Oct 17 11:57:55 2023 +0100 arm64: Mark the 'addr' argument to set_ptes() and __set_pte_at() as unused This argument is not used by the arm64 implementation. Mark it as __always_unused and also remove the unnecessary 'addr' increment in set_ptes(). Signed-off-by: Catalin Marinas Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310140531.BQQwt3NQ-lkp@intel.com/ Cc: Will Deacon Tested-by: Ryan Roberts Link: https://lore.kernel.org/r/ZS6EvMiJ0QF5INkv@arm.com commit 48016737a9af47328dd321df4dd3479ed5e2041d Author: Jai Luthra Date: Tue Oct 17 13:07:24 2023 +0530 media: platform: cadence: select MIPI_DPHY dependency The driver uses MIPI DPHY helper routines from the PHY core. Make sure we select the relevant config for compilation. Fixes: a91d06f46bf7 ("media: cadence: csi2rx: Configure DPHY using link freq") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310170258.UzSN4RUB-lkp@intel.com/ Signed-off-by: Jai Luthra [Sakari Ailus: Also select GENERIC_PHY.] Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 99b6d9685c33ee38f9fea00e3ea9191da93133c9 Author: Jai Luthra Date: Fri Oct 13 14:27:56 2023 +0530 media: MAINTAINERS: Fix path for J721E CSI2RX bindings Fix the path of the devicetree bindings. The path was changed during review but MAINTAINERS file was not updated. Fixes: b4a3d877dc92 ("media: ti: Add CSI2RX support for J721E") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310130411.c66pTXjG-lkp@intel.com/ Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 265f3ed077036f053981f5eea0b5b43e7c5b39ff Author: Frederic Weisbecker Date: Sun Sep 24 17:07:02 2023 +0200 workqueue: Provide one lock class key per work_on_cpu() callsite All callers of work_on_cpu() share the same lock class key for all the functions queued. As a result the workqueue related locking scenario for a function A may be spuriously accounted as an inversion against the locking scenario of function B such as in the following model: long A(void *arg) { mutex_lock(&mutex); mutex_unlock(&mutex); } long B(void *arg) { } void launchA(void) { work_on_cpu(0, A, NULL); } void launchB(void) { mutex_lock(&mutex); work_on_cpu(1, B, NULL); mutex_unlock(&mutex); } launchA and launchB running concurrently have no chance to deadlock. However the above can be reported by lockdep as a possible locking inversion because the works containing A() and B() are treated as belonging to the same locking class. The following shows an existing example of such a spurious lockdep splat: ====================================================== WARNING: possible circular locking dependency detected 6.6.0-rc1-00065-g934ebd6e5359 #35409 Not tainted ------------------------------------------------------ kworker/0:1/9 is trying to acquire lock: ffffffff9bc72f30 (cpu_hotplug_lock){++++}-{0:0}, at: _cpu_down+0x57/0x2b0 but task is already holding lock: ffff9e3bc0057e60 ((work_completion)(&wfc.work)){+.+.}-{0:0}, at: process_scheduled_works+0x216/0x500 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 ((work_completion)(&wfc.work)){+.+.}-{0:0}: __flush_work+0x83/0x4e0 work_on_cpu+0x97/0xc0 rcu_nocb_cpu_offload+0x62/0xb0 rcu_nocb_toggle+0xd0/0x1d0 kthread+0xe6/0x120 ret_from_fork+0x2f/0x40 ret_from_fork_asm+0x1b/0x30 -> #1 (rcu_state.barrier_mutex){+.+.}-{3:3}: __mutex_lock+0x81/0xc80 rcu_nocb_cpu_deoffload+0x38/0xb0 rcu_nocb_toggle+0x144/0x1d0 kthread+0xe6/0x120 ret_from_fork+0x2f/0x40 ret_from_fork_asm+0x1b/0x30 -> #0 (cpu_hotplug_lock){++++}-{0:0}: __lock_acquire+0x1538/0x2500 lock_acquire+0xbf/0x2a0 percpu_down_write+0x31/0x200 _cpu_down+0x57/0x2b0 __cpu_down_maps_locked+0x10/0x20 work_for_cpu_fn+0x15/0x20 process_scheduled_works+0x2a7/0x500 worker_thread+0x173/0x330 kthread+0xe6/0x120 ret_from_fork+0x2f/0x40 ret_from_fork_asm+0x1b/0x30 other info that might help us debug this: Chain exists of: cpu_hotplug_lock --> rcu_state.barrier_mutex --> (work_completion)(&wfc.work) Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((work_completion)(&wfc.work)); lock(rcu_state.barrier_mutex); lock((work_completion)(&wfc.work)); lock(cpu_hotplug_lock); *** DEADLOCK *** 2 locks held by kworker/0:1/9: #0: ffff900481068b38 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0x212/0x500 #1: ffff9e3bc0057e60 ((work_completion)(&wfc.work)){+.+.}-{0:0}, at: process_scheduled_works+0x216/0x500 stack backtrace: CPU: 0 PID: 9 Comm: kworker/0:1 Not tainted 6.6.0-rc1-00065-g934ebd6e5359 #35409 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 Workqueue: events work_for_cpu_fn Call Trace: rcu-torture: rcu_torture_read_exit: Start of episode dump_stack_lvl+0x4a/0x80 check_noncircular+0x132/0x150 __lock_acquire+0x1538/0x2500 lock_acquire+0xbf/0x2a0 ? _cpu_down+0x57/0x2b0 percpu_down_write+0x31/0x200 ? _cpu_down+0x57/0x2b0 _cpu_down+0x57/0x2b0 __cpu_down_maps_locked+0x10/0x20 work_for_cpu_fn+0x15/0x20 process_scheduled_works+0x2a7/0x500 worker_thread+0x173/0x330 ? __pfx_worker_thread+0x10/0x10 kthread+0xe6/0x120 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x2f/0x40 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1b/0x30 Signed-off-by: Frederic Weisbecker Signed-off-by: Tejun Heo commit 63dcf38eb57dcd19f9cadab12f7f9690f353b86d Author: Sascha Hauer Date: Wed Oct 18 08:16:55 2023 +0200 PM / devfreq: rockchip-dfi: introduce channel mask Different Rockchip SoC variants have a different number of channels. Introduce a channel mask to make the number of channels configurable from SoC initialization code. Link: https://lore.kernel.org/all/20231018061714.3553817-8-s.hauer@pengutronix.de/ Reviewed-by: Sebastian Reichel Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit 9991166494f11569ce22ba1ba32dba789cf8b4ac Author: Sascha Hauer Date: Wed Oct 18 08:16:54 2023 +0200 PM / devfreq: rockchip-dfi: Use free running counter The DDR_MON counters are free running counters. These are resetted to 0 when starting them over like currently done when reading the current counter values. Resetting the counters becomes a problem with perf support we want to add later, because perf needs counters that are not modified elsewhere. This patch removes resetting the counters and keeps them running instead. That means we no longer use the absolute counter values but instead compare them with the counter values we read last time. Not stopping the counters also has the impact that they are running while we are reading them. We cannot read multiple timers atomically, so the values do not exactly fit together. The effect should be negligible though as the time between two measurements is some orders of magnitude bigger than the time we need to read multiple registers. Link: https://lore.kernel.org/all/20231018061714.3553817-7-s.hauer@pengutronix.de/ Reviewed-by: Sebastian Reichel Acked-by: Chanwoo Choi Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit 1e2dd572d2b773b5b8882aae66e5f0328d562aa9 Author: Thomas Gleixner Date: Tue Oct 17 23:23:25 2023 +0200 x86/boot: Use __pa_nodebug() in mk_early_pgtbl_32() Use the existing macro instead of undefining and redefining __pa(). No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231017211722.051625827@linutronix.de commit 242db7589460ca94e28c51ffbddd621756f97e11 Author: Thomas Gleixner Date: Mon Oct 2 13:59:36 2023 +0200 x86/boot/32: Disable stackprotector and tracing for mk_early_pgtbl_32() Stackprotector cannot work before paging is enabled. The read from the per CPU variable __stack_chk_guard is always accessing the virtual address either directly on UP or via FS on SMP. In physical address mode this results in an access to memory above 3GB. So this works by chance as the hardware returns the same value when there is no RAM at this physical address. When there is RAM populated above 3G then the read is by chance the same as nothing changes that memory during the very early boot stage. Stop relying on pure luck and disable the stack protector for the only C function which is called during early boot before paging is enabled. Remove function tracing from the whole source file as there is no way to trace this at all, but in case of CONFIG_DYNAMIC_FTRACE=n mk_early_pgtbl_32() would access global function tracer variables in physical address mode which again might work by chance. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20231002115902.156063939@linutronix.de commit a41796b5537dd90eed0e8a6341dec97f4507f5ed Author: Waiman Long Date: Tue Oct 17 13:13:41 2023 -0400 docs/cgroup: Add the list of threaded controllers to cgroup-v2.rst The cgroup-v2 file mentions the concept of threaded controllers which can be used in a threaded cgroup. However, it doesn't mention clearly which controllers are threaded leading to some confusion about what controller can be used requiring some experimentation. Clear this up by explicitly listing the controllers that can be used currently in a threaded cgroup. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 810799a06641fae275516b40a2b83ec9141cf212 Merge: a0a8602247430 982b0192db455 Author: David S. Miller Date: Wed Oct 18 09:36:36 2023 +0100 Merge branch 'ethtool-forced-speed' Paul Greenwalt says: ==================== ethtool: Add link mode maps for forced speeds The following patch set was initially a part of [1]. As the purpose of the original series was to add the support of the new hardware to the intel ice driver, the refactoring of advertised link modes mapping was extracted to a new set. The patch set adds a common mechanism for mapping Ethtool forced speeds with Ethtool supported link modes, which can be used in drivers code. [1] https://lore.kernel.org/netdev/20230823180633.2450617-1-pawel.chmielewski@intel.com Changelog: v4->v5: Separated ethtool and qede changes into two patches, fixed indentation, and moved ethtool_forced_speed_maps_init() from ioctl.c to ethtool.h v3->v4: Moved the macro for setting fields into the common header file v2->v3: Fixed whitespaces, added missing line at end of file v1->v2: Fixed formatting, typo, moved declaration of iterator to loop line. ==================== Signed-off-by: David S. Miller commit 982b0192db455d288fc1deb06632f529c35daa15 Author: Pawel Chmielewski Date: Sun Oct 15 19:43:04 2023 -0400 ice: Refactor finding advertised link speed Refactor ice_get_link_ksettings to using forced speed to link modes mapping. Suggested-by : Alexander Lobakin Reviewed-by: Jacob Keller Reviewed-by: Przemek Kitszel Signed-off-by: Pawel Chmielewski Signed-off-by: Paul Greenwalt Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit a5b65cd2a317527155321da40dc8520d2a1f4812 Author: Paul Greenwalt Date: Sun Oct 15 19:43:03 2023 -0400 qede: Refactor qede_forced_speed_maps_init() Refactor qede_forced_speed_maps_init() to use commen implementation ethtool_forced_speed_maps_init(). The qede driver was compile tested only. Reviewed-by: Jacob Keller Reviewed-by: Przemek Kitszel Signed-off-by: Pawel Chmielewski Signed-off-by: Paul Greenwalt Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 26c5334d344db7a9bffa1f5ce87d9045b5e90383 Author: Paul Greenwalt Date: Sun Oct 15 19:43:02 2023 -0400 ethtool: Add forced speed to supported link modes maps The need to map Ethtool forced speeds to Ethtool supported link modes is common among drivers. To support this, add a common structure for forced speed maps and a function to init them. This is solution was originally introduced in commit 1d4e4ecccb11 ("qede: populate supported link modes maps on module init") for qede driver. ethtool_forced_speed_maps_init() should be called during driver init with an array of struct ethtool_forced_speed_map to populate the mapping. Definitions for maps themselves are left in the driver code, as the sets of supported link modes may vary between the devices. Suggested-by: Andrew Lunn Reviewed-by: Jacob Keller Reviewed-by: Przemek Kitszel Signed-off-by: Pawel Chmielewski Signed-off-by: Paul Greenwalt Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 2e66190e0d87a7266c89728565e0681b22e68f30 Author: Karthikeyan Periyasamy Date: Sat Oct 14 08:56:50 2023 +0530 wifi: ath11k: rename the sc naming convention to ab In PCI, thermal and HAL interface layer module, the identifier sc is used to represent an instance of ath11k_base structure. However, within ath11k, the convention is to use "ab" to represent an SoC "base" struct. So change the all instances of sc to ab. Compile tested only. Signed-off-by: Karthikeyan Periyasamy Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231014032650.32605-3-quic_periyasa@quicinc.com commit 265c038ac9c27001883ee039b65228196083cb40 Author: Karthikeyan Periyasamy Date: Sat Oct 14 08:56:49 2023 +0530 wifi: ath11k: rename the wmi_sc naming convention to wmi_ab In WMI layer module, the identifier wmi_sc is used to represent an instance of ath11k_wmi_base structure. However, within ath11k, the convention is to use "ab" to represent an SoC "base" struct. So change the all instances of wmi_sc to wmi_ab. Compile tested only. Signed-off-by: Karthikeyan Periyasamy Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231014032650.32605-2-quic_periyasa@quicinc.com commit 40990961d9836efd1a404432e5d5bf6fbc78c138 Author: Justin Stitt Date: Fri Oct 13 21:19:02 2023 +0000 wifi: ath6kl: replace deprecated strncpy with memcpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous interfaces. The affected code's purpose is to truncate strings that are too long with "..." like: foobar -> fo... The lengths have been carefully calculated and as such this has decayed to a simple byte copy from one buffer to another -- let's use memcpy(). Note: build-tested only. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231013-strncpy-drivers-net-wireless-ath-ath6kl-init-c-v1-1-d69c599b49a9@google.com commit 1b7ef2d94ff4cb0b1186a224a97349864820c606 Author: Jiapeng Chong Date: Wed Oct 18 14:27:59 2023 +0800 sched/fair: Remove duplicate #include ./kernel/sched/fair.c: linux/sched/cond_resched.h is included more than once. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231018062759.44375-1-jiapeng.chong@linux.alibaba.com Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6907 commit 24709752bfe8bc0147c9379a6ec8fe8d75874066 Author: Justin Stitt Date: Fri Oct 13 20:53:33 2023 +0000 wifi: ath5k: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect led->name to be NUL-terminated based on the presence of a manual NUL-byte assignment. This NUL-byte assignment was added in Commit daf9669bea30aa22 ("ath5k: ensure led name is null terminated"). If strscpy() had existed and had been used back when this code was written then potential bugs and the need to manually NUL-terminate could have been avoided. Since we now have the technology, let's use it :) Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. If NUL-padding is required let's opt for strscpy_pad(). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231013-strncpy-drivers-net-wireless-ath-ath5k-led-c-v1-1-3acb0b5a21f2@google.com commit 2180f7ac0abeee63cc608b1c084764b67832596c Author: Jeff Johnson Date: Fri Oct 13 07:24:09 2023 -0700 wifi: ath12k: Remove ath12k_base::bd_api Currently struct ath12k_base defines the member bd_api. However, this member is only accessed within ath12k_core_fetch_bdf(). Since the scope is local just to that one function, remove it from ath12k_base and instead just use a local stack variable. No functional changes, compile tested only. Signed-off-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231013-ath11k_bd_api-v1-2-3fefe4629706@quicinc.com commit b4f70ac0fa88363d2f2494c6079f5c38ff58caed Author: Jeff Johnson Date: Fri Oct 13 07:24:08 2023 -0700 wifi: ath11k: Remove ath11k_base::bd_api Currently struct ath11k_base defines the member bd_api. However, this member is only accessed within ath11k_core_fetch_bdf(). Since the scope is local just to that one function, remove it from ath11k_base and instead just use a local stack variable. No functional changes, compile tested only. Signed-off-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231013-ath11k_bd_api-v1-1-3fefe4629706@quicinc.com commit 3e9942fbdf4d0dd80c1b76e81bcebeac0c056259 Author: Ramya Gnanasekar Date: Fri Oct 13 12:30:06 2023 +0530 wifi: ath12k: Enable Mesh support for QCN9274 Currently QCN9274 supports only AP and station interface modes. Add interface type mesh to ath12k_hw_params for QCN9274 to provide support for mesh mode as well. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-02903-QCAHKSWPL_SILICONZ-1 Signed-off-by: Ramya Gnanasekar Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231013070007.25597-2-quic_rgnanase@quicinc.com commit 6b819f89c482b0ab1b9eb913860ca53d70537832 Author: Ramya Gnanasekar Date: Fri Oct 13 12:30:07 2023 +0530 wifi: ath12k: register EHT mesh capabilities The capabilities for the EHT mesh are generated from the capabilities reported by the firmware. But the firmware only reports the overall capabilities and not the one which are specific for mesh. Capabilities which requires infrastructure setup with a main STA(AP) controlling operations are not needed for mesh and hence remove these capabilities from the list. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-02903-QCAHKSWPL_SILICONZ-1 Signed-off-by: Ramya Gnanasekar Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231013070007.25597-3-quic_rgnanase@quicinc.com commit 9d2c23d21aa4517e48e5d6d0dfb9f99f1aa07636 Author: Rob Herring Date: Thu Oct 12 19:16:38 2023 +0300 wifi: ath11k: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231009172923.2457844-11-robh@kernel.org commit 256001672153af5786c6ca148114693d7d76d836 Author: Florian Westphal Date: Fri Oct 13 14:18:14 2023 +0200 netfilter: nf_tables: de-constify set commit ops function argument The set backend using this already has to work around this via ugly cast, don't spread this pattern. Signed-off-by: Florian Westphal commit cf8b7c1a5be7ef2850c46a17fea5f867f71922ff Author: Florian Westphal Date: Wed Oct 11 09:59:39 2023 +0200 netfilter: bridge: convert br_netfilter to NF_DROP_REASON errno is 0 because these hooks are called from prerouting and forward. There is no socket that the errno would ever be propagated to. Other netfilter modules (e.g. nf_nat, conntrack, ...) can be converted in a similar way. Signed-off-by: Florian Westphal commit e0d4593140b01b8da513a0c88c26da28b4906413 Author: Florian Westphal Date: Wed Oct 11 09:59:38 2023 +0200 netfilter: make nftables drops visible in net dropmonitor net_dropmonitor blames core.c:nf_hook_slow. Add NF_DROP_REASON() helper and use it in nft_do_chain(). The helper releases the skb, so exact drop location becomes available. Calling code will observe the NF_STOLEN verdict instead. Adjust nf_hook_slow so we can embed an erro value wih NF_STOLEN verdicts, just like we do for NF_DROP. After this, drop in nftables can be pinpointed to a drop due to a rule or the chain policy. Signed-off-by: Florian Westphal commit 35c038b0a4be197679deefaf96998241cb7efc88 Author: Florian Westphal Date: Wed Oct 11 09:59:37 2023 +0200 netfilter: nf_nat: mask out non-verdict bits when checking return value Same as previous change: we need to mask out the non-verdict bits, as upcoming patches may embed an errno value in NF_STOLEN verdicts too. NF_DROP could already do this, but not all called functions do this. Checks that only test ret vs NF_ACCEPT are fine, the 'errno parts' are always 0 for those. Signed-off-by: Florian Westphal commit 6291b3a67ad55102f163f6a636bc540e460f892d Author: Florian Westphal Date: Wed Oct 11 09:59:36 2023 +0200 netfilter: conntrack: convert nf_conntrack_update to netfilter verdicts This function calls helpers that can return nf-verdicts, but then those get converted to -1/0 as thats what the caller expects. Theoretically NF_DROP could have an errno number set in the upper 24 bits of the return value. Or any of those helpers could return NF_STOLEN, which would result in use-after-free. This is fine as-is, the called functions don't do this yet. But its better to avoid possible future problems if the upcoming patchset to add NF_DROP_REASON() support gains further users, so remove the 0/-1 translation from the picture and pass the verdicts down to the caller. Signed-off-by: Florian Westphal commit 4d26ab0086aab2d77c54e54020e47737dc6ed165 Author: Florian Westphal Date: Wed Oct 11 09:59:35 2023 +0200 netfilter: nf_tables: mask out non-verdict bits when checking return value nftables trace infra must mask out the non-verdict bit parts of the return value, else followup changes that 'return errno << 8 | NF_STOLEN' will cause breakage. Signed-off-by: Florian Westphal commit e15e5027106f3f6009d2fb46b3a1bb3d9e6a1b77 Author: Florian Westphal Date: Wed Oct 11 09:59:34 2023 +0200 netfilter: xt_mangle: only check verdict part of return value These checks assume that the caller only returns NF_DROP without any errno embedded in the upper bits. This is fine right now, but followup patches will start to propagate such errors to allow kfree_skb_drop_reason() in the called functions, those would then indicate 'errno << 8 | NF_STOLEN'. To not break things we have to mask those parts out. Signed-off-by: Florian Westphal commit a0a86022474304e012aad5d41943fdd31a036284 Merge: ee2a35fedbc94 5d77371e8c85a Author: David S. Miller Date: Wed Oct 18 09:23:02 2023 +0100 Merge branch 'devlink-deadlock' Jiri Pirko says: ==================== devlink: fix a deadlock when taking devlink instance lock while holding RTNL lock devlink_port_fill() may be called sometimes with RTNL lock held. When putting the nested port function devlink instance attrs, current code takes nested devlink instance lock. In that case lock ordering is wrong. Patch #1 is a dependency of patch #2. Patch #2 converts the peernet2id_alloc() call to rely in RCU so it could called without devlink instance lock. Patch #3 takes device reference for devlink instance making sure that device does not disappear before devlink_release() is called. Patch #4 benefits from the preparations done in patches #2 and #3 and removes the problematic nested devlink lock aquisition. Patched #5-#7 improve documentation to reflect this issue so it is avoided in the future. ==================== Signed-off-by: David S. Miller commit 5d77371e8c85abbe0f9fab7dacf3bc2c3214ada5 Author: Jiri Pirko Date: Fri Oct 13 14:10:29 2023 +0200 devlink: document devlink_rel_nested_in_notify() function Add a documentation for devlink_rel_nested_in_notify() describing the devlink instance locking consequences. Signed-off-by: Jiri Pirko Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit bb11cf9b2c4a21f6d1533ffd28feb0ef1fd659bb Author: Jiri Pirko Date: Fri Oct 13 14:10:28 2023 +0200 Documentation: devlink: add a note about RTNL lock into locking section Add a note describing the locking order of taking RTNL lock with devlink instance lock. Signed-off-by: Jiri Pirko Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit b6f23b319aadae50a03b06c3067bc7e4a659e43b Author: Jiri Pirko Date: Fri Oct 13 14:10:27 2023 +0200 Documentation: devlink: add nested instance section Add a part talking about nested devlink instances describing the helpers and locking ordering. Signed-off-by: Jiri Pirko Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit b5f4e371336a62a48f6ae51abb8366e968a8f88f Author: Jiri Pirko Date: Fri Oct 13 14:10:26 2023 +0200 devlink: don't take instance lock for nested handle put Lockdep reports following issue: WARNING: possible circular locking dependency detected ------------------------------------------------------ devlink/8191 is trying to acquire lock: ffff88813f32c250 (&devlink->lock_key#14){+.+.}-{3:3}, at: devlink_rel_devlink_handle_put+0x11e/0x2d0 but task is already holding lock: ffffffff8511eca8 (rtnl_mutex){+.+.}-{3:3}, at: unregister_netdev+0xe/0x20 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (rtnl_mutex){+.+.}-{3:3}: lock_acquire+0x1c3/0x500 __mutex_lock+0x14c/0x1b20 register_netdevice_notifier_net+0x13/0x30 mlx5_lag_add_mdev+0x51c/0xa00 [mlx5_core] mlx5_load+0x222/0xc70 [mlx5_core] mlx5_init_one_devl_locked+0x4a0/0x1310 [mlx5_core] mlx5_init_one+0x3b/0x60 [mlx5_core] probe_one+0x786/0xd00 [mlx5_core] local_pci_probe+0xd7/0x180 pci_device_probe+0x231/0x720 really_probe+0x1e4/0xb60 __driver_probe_device+0x261/0x470 driver_probe_device+0x49/0x130 __driver_attach+0x215/0x4c0 bus_for_each_dev+0xf0/0x170 bus_add_driver+0x21d/0x590 driver_register+0x133/0x460 vdpa_match_remove+0x89/0xc0 [vdpa] do_one_initcall+0xc4/0x360 do_init_module+0x22d/0x760 load_module+0x51d7/0x6750 init_module_from_file+0xd2/0x130 idempotent_init_module+0x326/0x5a0 __x64_sys_finit_module+0xc1/0x130 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 -> #2 (mlx5_intf_mutex){+.+.}-{3:3}: lock_acquire+0x1c3/0x500 __mutex_lock+0x14c/0x1b20 mlx5_register_device+0x3e/0xd0 [mlx5_core] mlx5_init_one_devl_locked+0x8fa/0x1310 [mlx5_core] mlx5_devlink_reload_up+0x147/0x170 [mlx5_core] devlink_reload+0x203/0x380 devlink_nl_cmd_reload+0xb84/0x10e0 genl_family_rcv_msg_doit+0x1cc/0x2a0 genl_rcv_msg+0x3c9/0x670 netlink_rcv_skb+0x12c/0x360 genl_rcv+0x24/0x40 netlink_unicast+0x435/0x6f0 netlink_sendmsg+0x7a0/0xc70 sock_sendmsg+0xc5/0x190 __sys_sendto+0x1c8/0x290 __x64_sys_sendto+0xdc/0x1b0 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 -> #1 (&dev->lock_key#8){+.+.}-{3:3}: lock_acquire+0x1c3/0x500 __mutex_lock+0x14c/0x1b20 mlx5_init_one_devl_locked+0x45/0x1310 [mlx5_core] mlx5_devlink_reload_up+0x147/0x170 [mlx5_core] devlink_reload+0x203/0x380 devlink_nl_cmd_reload+0xb84/0x10e0 genl_family_rcv_msg_doit+0x1cc/0x2a0 genl_rcv_msg+0x3c9/0x670 netlink_rcv_skb+0x12c/0x360 genl_rcv+0x24/0x40 netlink_unicast+0x435/0x6f0 netlink_sendmsg+0x7a0/0xc70 sock_sendmsg+0xc5/0x190 __sys_sendto+0x1c8/0x290 __x64_sys_sendto+0xdc/0x1b0 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 -> #0 (&devlink->lock_key#14){+.+.}-{3:3}: check_prev_add+0x1af/0x2300 __lock_acquire+0x31d7/0x4eb0 lock_acquire+0x1c3/0x500 __mutex_lock+0x14c/0x1b20 devlink_rel_devlink_handle_put+0x11e/0x2d0 devlink_nl_port_fill+0xddf/0x1b00 devlink_port_notify+0xb5/0x220 __devlink_port_type_set+0x151/0x510 devlink_port_netdevice_event+0x17c/0x220 notifier_call_chain+0x97/0x240 unregister_netdevice_many_notify+0x876/0x1790 unregister_netdevice_queue+0x274/0x350 unregister_netdev+0x18/0x20 mlx5e_vport_rep_unload+0xc5/0x1c0 [mlx5_core] __esw_offloads_unload_rep+0xd8/0x130 [mlx5_core] mlx5_esw_offloads_rep_unload+0x52/0x70 [mlx5_core] mlx5_esw_offloads_unload_rep+0x85/0xc0 [mlx5_core] mlx5_eswitch_unload_sf_vport+0x41/0x90 [mlx5_core] mlx5_devlink_sf_port_del+0x120/0x280 [mlx5_core] genl_family_rcv_msg_doit+0x1cc/0x2a0 genl_rcv_msg+0x3c9/0x670 netlink_rcv_skb+0x12c/0x360 genl_rcv+0x24/0x40 netlink_unicast+0x435/0x6f0 netlink_sendmsg+0x7a0/0xc70 sock_sendmsg+0xc5/0x190 __sys_sendto+0x1c8/0x290 __x64_sys_sendto+0xdc/0x1b0 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 other info that might help us debug this: Chain exists of: &devlink->lock_key#14 --> mlx5_intf_mutex --> rtnl_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(rtnl_mutex); lock(mlx5_intf_mutex); lock(rtnl_mutex); lock(&devlink->lock_key#14); Problem is taking the devlink instance lock of nested instance when RTNL is already held. To fix this, don't take the devlink instance lock when putting nested handle. Instead, rely on the preparations done by previous two patches to be able to access device pointer and obtain netns id without devlink instance lock held. Fixes: c137743bce02 ("devlink: introduce object and nested devlink relationship infra") Signed-off-by: Jiri Pirko Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit a380687200e0f7f0e00d745796fd8b8ea4bcb746 Author: Jiri Pirko Date: Fri Oct 13 14:10:25 2023 +0200 devlink: take device reference for devlink object In preparation to allow to access device pointer without devlink instance lock held, make sure the device pointer is usable until devlink_release() is called. Fixes: c137743bce02 ("devlink: introduce object and nested devlink relationship infra") Signed-off-by: Jiri Pirko Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit c503bc7df602257e9d03851654a347649a33f3c3 Author: Jiri Pirko Date: Fri Oct 13 14:10:24 2023 +0200 devlink: call peernet2id_alloc() with net pointer under RCU read lock peernet2id_alloc() allows to be called lockless with peer net pointer obtained in RCU critical section and makes sure to return ns ID if net namespaces is not being removed concurrently. Benefit from read_pnet_rcu() helper addition, use it to obtain net pointer under RCU read lock and pass it to peernet2id_alloc() to get ns ID. Fixes: c137743bce02 ("devlink: introduce object and nested devlink relationship infra") Signed-off-by: Jiri Pirko Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 2034d90ae41ae93e30d492ebcf1f06f97a9cfba6 Author: Jiri Pirko Date: Fri Oct 13 14:10:23 2023 +0200 net: treat possible_net_t net pointer as an RCU one and add read_pnet_rcu() Make the net pointer stored in possible_net_t structure annotated as an RCU pointer. Change the access helpers to treat it as such. Introduce read_pnet_rcu() helper to allow caller to dereference the net pointer under RCU read lock. Signed-off-by: Jiri Pirko Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 1b6272894f2dfc25374add1dcfa37efc88384ff8 Author: Ricardo B. Marliere Date: Thu Oct 12 07:54:21 2023 -0300 docs: kbuild: add INSTALL_DTBS_PATH The documentation for kbuild and makefiles is missing an explanation of a variable important for some architectures. Signed-off-by: Ricardo B. Marliere Signed-off-by: Masahiro Yamada commit 7aef8f76d1f944288eafda1a9eb285fa18383121 Author: Masahiro Yamada Date: Mon Oct 9 21:42:07 2023 +0900 UML: remove unused cmd_vdso_install You cannot run this code because arch/um/Makefile does not define the vdso_install target. It appears that this code was blindly copied from another architecture. Remove the dead code. Signed-off-by: Masahiro Yamada Acked-by: Richard Weinberger commit 737d303623bcb212a6b7cded06bafc923c906173 Author: Masahiro Yamada Date: Mon Oct 9 21:42:06 2023 +0900 csky: remove unused cmd_vdso_install You cannot run this code because arch/csky/Makefile does not define the vdso_install target. It appears that this code was blindly copied from another architecture. Remove the dead code. Signed-off-by: Masahiro Yamada Acked-by: Guo Ren commit 77f9f57164561d0acbb9d6b2ca78280925f52aaa Author: Masahiro Yamada Date: Sun Oct 8 02:04:48 2023 +0900 modpost: factor out the common boilerplate of section_rel(a) The first few lines of section_rel() and section_rela() are the same. They both retrieve the index of the section to which the relocaton applies, and skip known-good sections. This common code should be moved to check_sec_ref(). Avoid ugly casts when computing 'start' and 'stop', and also make the Elf_Rel and Elf_Rela pointers const. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 29ae5c02ed743c62e3c0619013b2bcd280bc562d Author: Masahiro Yamada Date: Sun Oct 8 02:04:47 2023 +0900 modpost: refactor check_sec_ref() We can replace &elf->sechdrs[i] with &sechdrs[i] to slightly shorten the code because we already have the local variable 'sechdrs'. However, defining 'sechdr' instead shortens the code further. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit bd78c9d714208fb5d989bd8ad007ff0e2bcfb2a9 Author: Masahiro Yamada Date: Sun Oct 8 02:04:46 2023 +0900 modpost: define TO_NATIVE() using bswap_* functions The current TO_NATIVE() has some limitations: 1) You cannot cast the argument. 2) You cannot pass a variable marked as 'const'. 3) Passing an array is a bug, but it is not detected. Impelement TO_NATIVE() using bswap_*() functions. These are GNU extensions. If we face portability issues, we can port the code from include/uapi/linux/swab.h. With this change, get_rel_type_and_sym() can be simplified by casting the arguments directly. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit ac96a15a0f0c8812a3aaa587b871cd5527f6d736 Author: Masahiro Yamada Date: Sun Oct 8 02:04:45 2023 +0900 modpost: fix ishtp MODULE_DEVICE_TABLE built on big-endian host When MODULE_DEVICE_TABLE(ishtp, ) is built on a host with a different endianness from the target architecture, it results in an incorrect MODULE_ALIAS(). For example, see a case where drivers/platform/x86/intel/ishtp_eclite.c is built as a module for x86. If you build it on a little-endian host, you will get the correct MODULE_ALIAS: $ grep MODULE_ALIAS drivers/platform/x86/intel/ishtp_eclite.mod.c MODULE_ALIAS("ishtp:{6A19CC4B-D760-4DE3-B14D-F25EBD0FBCD9}"); However, if you build it on a big-endian host, you will get a wrong MODULE_ALIAS: $ grep MODULE_ALIAS drivers/platform/x86/intel/ishtp_eclite.mod.c MODULE_ALIAS("ishtp:{BD0FBCD9-F25E-B14D-4DE3-D7606A19CC4B}"); This issue has been unnoticed because the x86 kernel is most likely built natively on an x86 host. The guid field must not be reversed because guid_t is an array of __u8. Fixes: fa443bc3c1e4 ("HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE()") Signed-off-by: Masahiro Yamada Reviewed-by: Thomas Weißschuh Tested-by: Srinivas Pandruvada Acked-by: Srinivas Pandruvada commit 7f54e00e5842663c2cea501bbbdfa572c94348a3 Author: Masahiro Yamada Date: Sun Oct 8 02:04:44 2023 +0900 modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host When MODULE_DEVICE_TABLE(tee, ) is built on a host with a different endianness from the target architecture, it results in an incorrect MODULE_ALIAS(). For example, see a case where drivers/char/hw_random/optee-rng.c is built as a module for ARM little-endian. If you build it on a little-endian host, you will get the correct MODULE_ALIAS: $ grep MODULE_ALIAS drivers/char/hw_random/optee-rng.mod.c MODULE_ALIAS("tee:ab7a617c-b8e7-4d8f-8301-d09b61036b64*"); However, if you build it on a big-endian host, you will get a wrong MODULE_ALIAS: $ grep MODULE_ALIAS drivers/char/hw_random/optee-rng.mod.c MODULE_ALIAS("tee:646b0361-9bd0-0183-8f4d-e7b87c617aab*"); The same problem also occurs when you enable CONFIG_CPU_BIG_ENDIAN, and build it on a little-endian host. This issue has been unnoticed because the ARM kernel is configured for little-endian by default, and most likely built on a little-endian host (cross-build on x86 or native-build on ARM). The uuid field must not be reversed because uuid_t is an array of __u8. Fixes: 0fc1db9d1059 ("tee: add bus driver framework for TEE based devices") Signed-off-by: Masahiro Yamada Reviewed-by: Sumit Garg commit a55d4aee76ca72e198a657cb471d2a3b37983072 Author: Masahiro Yamada Date: Sun Oct 1 21:38:22 2023 +0900 kbuild: make binrpm-pkg always produce kernel-devel package The generation of the kernel-devel package is disabled for binrpm-pkg presumably because it was quite big (>= 200MB) and took a long time to package. Commit fe66b5d2ae72 ("kbuild: refactor kernel-devel RPM package and linux-headers Deb package") reduced the package size to 12MB, and now it is quick to build. It won't hurt to have binrpm-pkg generate it by default. If you want to skip the kernel-devel package generation, you can pass RPMOPTS='--without devel': $ make binrpm-pkg RPMOPTS='--without devel' Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor commit bb6a88885fde24835afdaa1c5bb976a1bf5c5d71 Author: Larysa Zaremba Date: Tue Oct 17 18:27:57 2023 +0200 selftests/bpf: Add options and frags to xdp_hw_metadata This is a follow-up to the commit 9b2b86332a9b ("bpf: Allow to use kfunc XDP hints and frags together"). The are some possible implementations problems that may arise when providing metadata specifically for multi-buffer packets, therefore there must be a possibility to test such option separately. Add an option to use multi-buffer AF_XDP xdp_hw_metadata and mark used XDP program as capable to use frags. As for now, xdp_hw_metadata accepts no options, so add simple option parsing logic and a help message. For quick reference, also add an ingress packet generation command to the help message. The command comes from [0]. Example of output for multi-buffer packet: xsk_ring_cons__peek: 1 0xead018: rx_desc[15]->addr=10000000000f000 addr=f100 comp_addr=f000 rx_hash: 0x5789FCBB with RSS type:0x29 rx_timestamp: 1696856851535324697 (sec:1696856851.5353) XDP RX-time: 1696856843158256391 (sec:1696856843.1583) delta sec:-8.3771 (-8377068.306 usec) AF_XDP time: 1696856843158413078 (sec:1696856843.1584) delta sec:0.0002 (156.687 usec) 0xead018: complete idx=23 addr=f000 xsk_ring_cons__peek: 1 0xead018: rx_desc[16]->addr=100000000008000 addr=8100 comp_addr=8000 0xead018: complete idx=24 addr=8000 xsk_ring_cons__peek: 1 0xead018: rx_desc[17]->addr=100000000009000 addr=9100 comp_addr=9000 EoP 0xead018: complete idx=25 addr=9000 Metadata is printed for the first packet only. [0] https://lore.kernel.org/all/20230119221536.3349901-18-sdf@google.com/ Signed-off-by: Larysa Zaremba Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20231017162800.24080-1-larysa.zaremba@intel.com commit f7572e93d5f6bc4f659d2a9b603574cd126482d8 Author: Andy Shevchenko Date: Mon Oct 16 16:31:35 2023 +0300 parport: Drop unneeded NULL or 0 assignments kzalloc() gives us a zeroed memory, no need to explicitly assing 0 or NULL or similar to the members of the data structure that has been allocated with the above mentioned API. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231016133135.1203643-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit b8cb855d1b2ee6669e46c54a132024bd1dd0dcbb Author: Andy Shevchenko Date: Mon Oct 16 16:31:34 2023 +0300 parport: Use list_for_each() helper Convert hard to read custom code to list_for_each(). No functional changes intended. Note, we may not use list_for_each_entry() as at the end of the list the iterator will point to an invalid entry and may not be dereferenced. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231016133135.1203643-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 8d8ae17eb0de1fcdff6e7ddee3b641a16eefe8f6 Author: Andy Shevchenko Date: Mon Oct 16 16:31:33 2023 +0300 parport: Use kasprintf() instead of fixed buffer formatting Improve readability and maintainability by replacing a hardcoded string allocation and formatting by the use of the kasprintf() helper. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231016133135.1203643-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit c1426d392aebc51da4944d950d89e483e43f6f14 Author: Thomas Weißschuh Date: Wed Oct 11 09:18:27 2023 +0200 misc/pvpanic: deduplicate common code pvpanic-mmio.c and pvpanic-pci.c share a lot of code. Refactor it into pvpanic.c where it doesn't have to be kept in sync manually and where the core logic can be understood more easily. No functional change. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20231011-pvpanic-cleanup-v2-1-4b21d56f779f@weissschuh.net Signed-off-by: Greg Kroah-Hartman commit 67237183219351e53e0cf2486ad9ea00db99cd5a Author: Rob Herring Date: Fri Oct 6 16:42:28 2023 -0500 char: xilinx_hwicap: Modernize driver probe Rework Xilinx hwicap driver probe to use current best practices using devres APIs, device_get_match_data(), and typed firmware property accessors. There's no longer any non-DT probing, so CONFIG_OF ifdefs can be dropped. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006214228.337064-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit 066eaa69b05b92efd25bc2fe9964d68122c6aa2b Author: Greg Kroah-Hartman Date: Fri Oct 6 16:00:14 2023 +0200 tee: make tee_class constant Now that the driver core allows for struct class to be in read-only memory, we should make all 'class' structures declared at build time placing them into read-only memory, instead of having to be dynamically allocated at runtime. Cc: Jens Wiklander Reviewed-by: Sumit Garg Link: https://lore.kernel.org/r/2023100613-lustiness-affiliate-7dcb@gregkh Signed-off-by: Greg Kroah-Hartman commit 35479e2e490992e5bc976d1394f1e1274903af15 Author: Lukas Bulwahn Date: Thu Oct 12 06:28:34 2023 +0200 eeprom: remove doc and MAINTAINERS section after driver was removed Commit 0113a99b8a75 ("eeprom: Remove deprecated legacy eeprom driver") already removes the eeprom driver's code. Remove also the eeprom driver's documentation and MAINTAINERS section. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20231012042834.6663-1-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman commit 34a674e99acd6ec4b541cd4c630e126ba1a4c22f Author: Vitaly Lubart Date: Sun Oct 15 11:05:40 2023 +0300 mei: me: emit error only if reset was unexpected GSC devices perform legal firmware initiated resets due to state transition that may appear as unexpected to the driver. Lower the log level for those devices to debug level and save the firmware status registers. When the device comes out of the reset it is possible to check whether the resets was due to a firmware error or an exception and only than produce a warning. Signed-off-by: Vitaly Lubart Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20231015080540.95922-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit 3b54a111bb7e558e4a40e483ded7c123fe94382c Author: Randy Dunlap Date: Wed Oct 11 19:48:45 2023 -0700 misc: mei: main.c: fix kernel-doc warnings Fix kernel-doc warnings in main.c: main.c:465: warning: contents before sections main.c:590: warning: missing initial short description on line: * mei_ioctl_client_notify_request - Signed-off-by: Randy Dunlap Cc: Tomas Winkler Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20231012024845.29169-8-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit 980dcc7e43bddedb755a41a375817ee5de80222f Author: Randy Dunlap Date: Wed Oct 11 19:48:44 2023 -0700 misc: mei: interrupt.c: fix kernel-doc warnings Fix kernel-doc warnings in interrupt.c: interrupt.c:631: warning: contents before sections Signed-off-by: Randy Dunlap Cc: Tomas Winkler Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20231012024845.29169-7-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit de735e7fda11a27eb2eed81daf2a17548efb63f7 Author: Randy Dunlap Date: Wed Oct 11 19:48:43 2023 -0700 misc: mei: hw-me.c: fix kernel-doc warnings Fix kernel-doc warnings in hw-me.c: hw-me.c:1391: warning: contents before sections hw-me.c:1475: warning: contents before sections hw-me.c:1501: warning: contents before sections hw-me.c:1525: warning: contents before sections Signed-off-by: Randy Dunlap Cc: Tomas Winkler Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20231012024845.29169-6-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit fbe3599ee65de93cac243862df777775e23dbd83 Author: Randy Dunlap Date: Wed Oct 11 19:48:42 2023 -0700 misc: mei: hbm.c: fix kernel-doc warnings Fix kernel-doc warnings in hbm.c: hbm.c:98: warning: No description found for return value of 'mei_hbm_write_message' Signed-off-by: Randy Dunlap Cc: Tomas Winkler Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20231012024845.29169-5-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit 4efa1e2a05d6b4340c4ca39ad0664f0e160e5d8d Author: Randy Dunlap Date: Wed Oct 11 19:48:41 2023 -0700 misc: mei: dma-ring.c: fix kernel-doc warnings Fix kernel-doc warnings in dma-ring.c: dma-ring.c:130: warning: No description found for return value of 'mei_dma_copy_from' dma-ring.c:150: warning: No description found for return value of 'mei_dma_copy_to' Signed-off-by: Randy Dunlap Cc: Tomas Winkler Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20231012024845.29169-4-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit daa0c28d3bdeeca0be3d617feac379c4a979a5f7 Author: Randy Dunlap Date: Wed Oct 11 19:48:40 2023 -0700 misc: mei: client.c: fix kernel-doc warnings Fix kernel-doc warnings in client.c: client.c:53: warning: contents before sections client.c:68: warning: contents before sections client.c:334: warning: contents before sections client.c:349: warning: contents before sections client.c:364: warning: contents before sections Signed-off-by: Randy Dunlap Cc: Tomas Winkler Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20231012024845.29169-3-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit 5d33dc7df2ba14e963c094f0d0ab7a20ad4a5310 Author: Randy Dunlap Date: Wed Oct 11 19:48:39 2023 -0700 misc: mei: hw.h: fix kernel-doc warnings Fix kernel-doc warnings in hw.h: hw.h:809: warning: missing initial short description on line: * struct hbm_client_dma_unmap_request hw.h:812: warning: contents before sections hw.h:825: warning: missing initial short description on line: * struct hbm_client_dma_response hw.h:828: warning: contents before sections Signed-off-by: Randy Dunlap Cc: Tomas Winkler Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20231012024845.29169-2-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit ae4cb6bd5039a659d71632dbc2e176bf9227e294 Author: Tomas Winkler Date: Wed Oct 11 10:43:01 2023 +0300 mei: docs: fix spelling errors Fix spelling errors in the mei code base. Signed-off-by: Tomas Winkler Reviewed-by: Randy Dunlap Link: https://lore.kernel.org/r/20231011074301.223879-4-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit d37b59c716a972834a614b093910fa345a469ee2 Author: Tomas Winkler Date: Wed Oct 11 10:43:00 2023 +0300 mei: docs: add missing entries to kdoc in struct mei_cfg_idx Document all entries in struct mei_cfg_idx. Signed-off-by: Tomas Winkler Reviewed-by: Randy Dunlap Link: https://lore.kernel.org/r/20231011074301.223879-3-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit 64459c626b5a08aa8e8fdaa128a218215df93675 Author: Tomas Winkler Date: Wed Oct 11 10:42:59 2023 +0300 mei: docs: use correct structures name in kdoc Fix misalignment between structures names and their kdoc in hw.h Signed-off-by: Tomas Winkler Reviewed-by: Randy Dunlap Link: https://lore.kernel.org/r/20231011074301.223879-2-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit fb99e79ee62aaa07d9e77cb3a15c5f1ae2790e6a Author: Alan Previn Date: Wed Oct 11 14:01:57 2023 +0300 mei: update mei-pxp's component interface with timeouts In debugging platform or firmware related MEI-PXP connection issues, having a timeout when clients (such as i915) calling into mei-pxp's send/receive functions have proven useful as opposed to blocking forever until the kernel triggers a watchdog panic (when platform issues are experienced). Update the mei-pxp component interface send and receive functions to take in timeouts. Signed-off-by: Alan Previn Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20231011110157.247552-5-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit dab79a2235e5a1d6aadfeb601c84f31b5cb97141 Author: Alexander Usyskin Date: Wed Oct 11 14:01:56 2023 +0300 mei: pxp: re-enable client on errors Disable and enable mei-pxp client on errors to clean the internal state. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20231011110157.247552-4-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit ee5cb39348e69a61a865801970ba8fdc399335de Author: Alexander Usyskin Date: Wed Oct 11 14:01:55 2023 +0300 mei: pxp: recover from recv fail under memory pressure Under memory pressure recv fails due to kmalloc failure, and if drivers(pxp) retry send/receive, send blocks indefinitely. Send without recv leaves the channel in a bad state. Retry send attempt after small timeout and reset the channel if the retry failed on kmalloc failure too. Signed-off-by: Alexander Usyskin Signed-off-by: Alan Previn Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20231011110157.247552-3-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit cf439721f66719c6aa73b5ea23320c2f8cba100f Author: Alexander Usyskin Date: Wed Oct 11 14:01:54 2023 +0300 mei: bus: add send and recv api with timeout Add variation of the send and recv functions on bus that define timeout. Caller can use such functions in flow that can stuck to bail out and not to put down the whole system. Signed-off-by: Alexander Usyskin Signed-off-by: Alan Previn Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20231011110157.247552-2-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit 2d23e7d6bacb779c4a740dbd5e18978fb075d15e Author: Javier Martinez Canillas Date: Sat Oct 14 09:15:08 2023 +0200 dt-bindings: display: Add SSD132x OLED controllers Add a Device Tree binding schema for the OLED panels based on the Solomon SSD132x family of controllers. Signed-off-by: Javier Martinez Canillas Reviewed-by: Rob Herring Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20231014071520.1342189-7-javierm@redhat.com commit 7618b8659438c42baabb5678b2519abde4b4352a Author: Javier Martinez Canillas Date: Sat Oct 14 09:15:07 2023 +0200 dt-bindings: display: Split common Solomon properties in their own schema There are DT properties that can be shared across different Solomon OLED Display Controller families. Split them into a separate common schema to avoid these properties to be duplicated in different DT bindings schemas. Suggested-by: Rob Herring Signed-off-by: Javier Martinez Canillas Reviewed-by: Rob Herring Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20231014071520.1342189-6-javierm@redhat.com commit fdd591e00a9c9d64a5f1d74779b72218c22bf15d Author: Javier Martinez Canillas Date: Sat Oct 14 09:15:06 2023 +0200 drm/ssd130x: Add support for the SSD132x OLED controller family The Solomon SSD132x controllers (such as the SSD1322, SSD1325 and SSD1327) are used by 16 grayscale dot matrix OLED panels, extend the driver to also support this chip family. Instead adding an indirection level to allow the same modesetting pipeline to be used by both controller families, add another pipeline for SSD132x. This leads to some code duplication but it makes the driver easier to read and reason about. Once other controller families are added (e.g: SSD133x), some common code can be factored out in driver helpers to be shared by the different families. But that can be done later once these patterns emerge. Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20231014071520.1342189-5-javierm@redhat.com commit 9081d21a5a6b575551bfd6281981537140b55338 Author: Javier Martinez Canillas Date: Sat Oct 14 09:15:05 2023 +0200 drm/ssd130x: Rename commands that are shared across chip families There are some commands that are shared between the SSD130x and SSD132x controller families, define these as a common SSD13XX set of commands. Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20231014071520.1342189-4-javierm@redhat.com commit e6663dd42a79a8d0440530ce91dd8667fe41ff03 Author: Javier Martinez Canillas Date: Sat Oct 14 09:15:04 2023 +0200 drm/ssd130x: Add a controller family id to the device info data To allow the driver to have a per Solomon display controller modesetting pipeline and support aother controller families besides SSD130x. Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20231014071520.1342189-3-javierm@redhat.com commit ec5dceb8180f0cb110dc7029d55d6a83d0583015 Author: Javier Martinez Canillas Date: Sat Oct 14 09:15:03 2023 +0200 drm/ssd130x: Replace .page_height field in device info with a constant This deemed useful to avoid hardcoding a page height and allow to support other Solomon controller families, but dividing the screen in pages seems to be something that is specific to the SSD130x chip family. For example, SSD132x chip family divides the screen in segments (columns) and common outputs (rows), so the concept of screen pages does not exist for the SSD132x family. Let's drop this field from the device info struct and just use a constant SSD130X_PAGE_HEIGHT macro to define the page height. While being there, replace hardcoded 8 values in places where it is used as the page height. Signed-off-by: Javier Martinez Canillas Reviewed-by: Geert Uytterhoeven Acked-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20231014071520.1342189-2-javierm@redhat.com commit 4055758a80395cb6d40fa26361e39bcc6f924651 Merge: 73a2a3193b928 a1571f1f333c2 Author: Matthias Brugger Date: Wed Oct 18 09:52:47 2023 +0200 Merge remote-tracking branch 'ulfh/genpd_dt' into v6.6-next/dts64.3 commit dc850faa28ee0ac18e5e192526cdfa1da0b9d951 Author: Bartosz Golaszewski Date: Fri Oct 13 09:23:40 2023 +0200 hte: tegra194: don't access struct gpio_chip Using struct gpio_chip is not safe as it will disappear if the underlying driver is unbound for any reason. Switch to using reference counted struct gpio_device and its dedicated accessors. Signed-off-by: Bartosz Golaszewski Tested-by: Dipen Patel Reviewed-by: Linus Walleij [andy: used gpio_device_find_by_fwnode()] Reviewed-by: Dipen Patel Link: https://lore.kernel.org/r/20231010151709.4104747-3-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko commit 73a2a3193b928d82afc2eed8c1d84ad747142db1 Author: AngeloGioacchino Del Regno Date: Wed Aug 16 15:04:16 2023 -0400 arm64: dts: mediatek: cherry: Configure eDP and internal display Add the required nodes to enable the DisplayPort interface, connected to the Embedded DisplayPort port, where we have an internal display. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Chen-Yu Tsai Tested-by: Chen-Yu Tsai Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230816190427.2137768-1-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 72754e81f0c8426b8e3fa26785afed0e270064ce Author: AngeloGioacchino Del Regno Date: Fri Jul 21 10:28:22 2023 +0200 arm64: dts: mediatek: mt6795-xperia-m5: Add DSI Display and its vregs Add support for the DSI display found on the Sony Xperia M5, including the necessary regulators configuration for it. Reviewed-by: Alexandre Mergnat Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230721082822.680010-4-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 35f2d3f891824260db55665d2b65b013ce7617a6 Author: AngeloGioacchino Del Regno Date: Fri Jul 21 10:28:21 2023 +0200 arm64: dts: mediatek: mt6795-xperia-m5: Add display backlight support Add the relevant nodes for display backlight on Sony Xperia M5: this needs both the SoC PWM IP and MT6332 PMIC LED strings. Reviewed-by: Alexandre Mergnat Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230721082822.680010-3-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit bdfae71e5237028d7b91d3d2f8b303922820e9bc Author: AngeloGioacchino Del Regno Date: Fri Jul 21 10:28:20 2023 +0200 arm64: dts: mediatek: mt6795: Add support for display blocks and DPI/DSI Introduce all nodes for all of the display blocks in the MediaTek Helio X10 MT6795 SoC, including the DSI PHY and DSI/DPI interfaces: those are left disabled as usage is board specific. Reviewed-by: Alexandre Mergnat Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230721082822.680010-2-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit a69e042f6bce046d04a1cdac09474a43fdb1720c Author: Nícolas F. R. A. Prado Date: Fri Jul 21 16:16:58 2023 -0400 arm64: dts: mediatek: Add spherion-rev4 Add a devicetree for rev4 of Spherion. It uses the rt5682s audio codec instead of the rt5682 used in the previous revision. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230721201705.387426-6-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 9f8e4a644af3033bacfd361a922f7d3495b9eda7 Author: Nícolas F. R. A. Prado Date: Fri Jul 21 16:16:57 2023 -0400 arm64: dts: mediatek: Add hayato-rev5-sku2 Add a devicetree for rev5-sku2 of Hayato. It uses the rt5682s audio codec instead of the rt5682 used in the previous revision. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230721201705.387426-5-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 7f0118459b9979d36ff2e0bcf27e5c6149611137 Author: Nícolas F. R. A. Prado Date: Fri Jul 21 16:16:56 2023 -0400 arm64: dts: mediatek: Remove asurada-audio dtsi files There aren't enough users of the common asurada-audio dtsi files to justify having them. It is simpler to just have the audio nodes directly on the board files. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230721201705.387426-4-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 3993c86f50508736fc8a1da4d73e474267066bc2 Author: Nícolas F. R. A. Prado Date: Fri Jul 21 16:16:55 2023 -0400 dt-bindings: arm64: dts: mediatek: Add rev4 of spherion Add binding for newer version of Google Spherion (Acer Chromebook 514): rev4. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230721201705.387426-3-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit f78dbaab806f8586e97be7192d0267a209ebab59 Author: Nícolas F. R. A. Prado Date: Fri Jul 21 16:16:54 2023 -0400 dt-bindings: arm64: dts: mediatek: Add rev5-sku2 of hayato Add binding for newer version of Google Hayato: rev5-sku2. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230721201705.387426-2-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 9b5d64654ea8f51fe1e8e29ca1777b620be8fb7c Author: Alexandre Mergnat Date: Mon Sep 25 20:17:41 2023 +0200 arm64: dts: mediatek: add iommu support for mt8365 SoC Add iommu support in the SoC DTS using the 4 local arbiters (LARBs) Reviewed-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Alexandre Mergnat Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230207-iommu-support-v6-7-24453c8625b3@baylibre.com Signed-off-by: Matthias Brugger commit d6b2df359be64a5ca6affa8dbd79acc6a4b79390 Author: Alexandre Mergnat Date: Mon Sep 25 20:17:40 2023 +0200 arm64: dts: mediatek: add larb support for mt8365 SoC Local arbiter (LARB) is a component of Smart Multimedia Interface (SMI), used to help the memory management (IOMMU). This patch add 4 LARBs and 2 clocks for the larb1 and larb3 support. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Alexandre Mergnat Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230207-iommu-support-v6-6-24453c8625b3@baylibre.com Signed-off-by: Matthias Brugger commit 2bb2410e70e378ec709c8baeb9105b4478902f42 Author: Alexandre Mergnat Date: Mon Sep 25 20:17:39 2023 +0200 arm64: dts: mediatek: add smi support for mt8365 SoC Smart Multimedia Interface (SMI) local arbiter does the arbitration for memory requests from multi-media engines. Add SMI in the MT8365 DTS will allow to add local ARBiter (LARB), use by IOMMU. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Alexandre Mergnat Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230207-iommu-support-v6-5-24453c8625b3@baylibre.com Signed-off-by: Matthias Brugger commit c70ca9a2d09ae11063cbc166fe7718ed88cefa72 Author: Alexandre Mergnat Date: Mon Sep 25 20:17:38 2023 +0200 arm64: dts: mediatek: add power domain support for mt8365 SoC The following power domain are added to the SoC dts: - MM (MultiMedia) - CONN (Connectivity) - MFG (MFlexGraphics) - Audio - Cam (Camera) - DSP (Digital Signal Processor) - Vdec (Video decoder) - Venc (Video encoder) - APU (AI Processor Unit) Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Alexandre Mergnat Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230207-iommu-support-v6-4-24453c8625b3@baylibre.com Signed-off-by: Matthias Brugger commit b9b9f1e2bf83a10427d09eb8e594d8cb535e31a0 Author: Alexandre Mergnat Date: Mon Sep 25 20:17:37 2023 +0200 arm64: dts: mediatek: add apu support for mt8365 SoC AI Processor Unit System (APUSYS) is a highly efficient computing unit system which is most suitable for AI/CV algorithms. It includes one programmable AI processor (Cadence VP6) for both AI and CV algorithms, and an eDMA engine for data movement between external DRAM and VP6 internal memory. For more detail, ask Mediatek for the MT8365 IoT application processor functional specification. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Alexandre Mergnat Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230207-iommu-support-v6-3-24453c8625b3@baylibre.com Signed-off-by: Matthias Brugger commit 1fc9f965fbb251cd74dbc5cb29ec664f5e6a992c Author: Alexandre Mergnat Date: Mon Sep 25 20:17:36 2023 +0200 arm64: dts: mediatek: add camsys support for mt8365 SoC Camera System (CamSys) incorporates an enhanced feature based image signal processor to connect a variety of image sensor components. This processor consists of timing generated unit (TG), lens/sensor compensation unit and image process unit. For more detail, ask Mediatek for the MT8365 IoT application processor functional specification. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Alexandre Mergnat Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230207-iommu-support-v6-2-24453c8625b3@baylibre.com Signed-off-by: Matthias Brugger commit 0dc923ea2b96efffbcf62111c1d6a60907d595f1 Author: Alexandre Mergnat Date: Mon Sep 25 20:17:35 2023 +0200 arm64: dts: mediatek: add mmsys support for mt8365 SoC Multimedia subsystem (MMsys) contains multimedia controller, Multimedia Data Path v2.0 (MDP 2.0) and Display (DISP). The multimedia controller includes bus fabric control, Smart Memory Interface (SMI) control, memory access second-level arbiter, and multimedia configuration. It plays the key role in handling different handshakings between infra subsystem, video subsystem, image subsystem and G3D subsystem. For more detail, ask Mediatek for the MT8365 IoT application processor functional specification. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Alexandre Mergnat Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230207-iommu-support-v6-1-24453c8625b3@baylibre.com Signed-off-by: Matthias Brugger commit 2a99858c172e5a391572492fdfac02180ab3b772 Author: Chen-Yu Tsai Date: Thu Sep 28 16:55:35 2023 +0800 arm64: dts: mediatek: mt8183-kukui: Add PMIC regulator supplies The PMIC regulator node is missing regulator supplies. Now that the binding supports them, add all the power rail supplies. Most of them are fed from a system-wide semi-regulated power rail. A couple LDOs are fed from the PMIC's own buck regulator outputs. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230928085537.3246669-13-wenst@chromium.org Signed-off-by: Matthias Brugger commit f2b543a191b613efef00f360036f7a9009bc0e25 Author: Macpaul Lin Date: Thu Sep 14 13:51:45 2023 +0800 arm64: dts: mediatek: add device-tree for Genio 1200 EVK board Add basic device-tree for the Genio 1200-EVK board. This board is made by MediaTek and has a MT8395 SoC (MT8195 family), associated with the MT6359 and MT6360 PMICs, and the MT7921 connectivity chip. The IOs available on that board are: * 1 USB Type-C connector with DP aux mode support * 2 USB Type-A connector with a USB hub * 1 micro-USB port for gadget or OTG support * 1 full size HDMI RX and 1 full size HDMI TX connector * 1 micro SD slot * 40 pins header * SPI interface header * 1 M.2 slot * 1 audio jack * 1 micro-USB port for serial debug * 2 connectors for DSI displays, 1 of the DSI panel is installed * 3 connectors for CSI cameras * 1 connector for a eDP panel * 1 MMC storage * 1 Touch Panel (installed DSI display) * 1 M.2 slot for 5G dongle This commit adds basic support in order to be able to boot. Signed-off-by: Ben Lok Signed-off-by: Macpaul Lin Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230914055145.16801-2-macpaul.lin@mediatek.com Signed-off-by: Matthias Brugger commit 4a94bdc5bc389ed0a2ce84beafdd80284030bd28 Author: Macpaul Lin Date: Thu Sep 14 13:51:44 2023 +0800 dt-bindings: arm64: mediatek: add mt8395-evk board 1. Add compatible for MT8395. 2. Add bindings for the MediaTek mt8395-evk board, also known as the "Genio 1200-EVK". The MT8195 and MT8395 belong to the same SoC family, with only minor differences in their physical characteristics. They utilize unique efuse values for differentiation. The booting process and configurations are managed by boot loaders, firmware, and TF-A. Consequently, the part numbers and procurement channels vary. Signed-off-by: Macpaul Lin Reviewed-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230914055145.16801-1-macpaul.lin@mediatek.com Signed-off-by: Matthias Brugger commit 4a48fa417abc5b86da393c93ab63a9160076a248 Author: Raymond Hackley Date: Tue Oct 17 10:18:14 2023 +0000 ARM: dts: samsung: exynos4412-midas: use Linux event codes for input keys Use event codes with linux-event-codes.h included for input keys on midas. Signed-off-by: Raymond Hackley Link: https://lore.kernel.org/r/20231017101647.62770-1-raymondhackley@protonmail.com [krzysztof: drop header include, because it is already provided by dt-bindings/input/input.h] Signed-off-by: Krzysztof Kozlowski commit 25e20eedc1d63dcdf6f781588e8dbc37cd0aad16 Author: Raymond Hackley Date: Tue Oct 17 10:18:04 2023 +0000 ARM: dts: samsung: exynos4412-midas: fix key-ok event code Input event code 139 stands for KEY_MENU, instead of KEY_OK as node name key-ok inplies. Fix it with correct event code 0x160. Signed-off-by: Raymond Hackley Link: https://lore.kernel.org/r/20231017101636.62755-1-raymondhackley@protonmail.com [krzysztof: use KEY_OK constant instead of raw value] Signed-off-by: Krzysztof Kozlowski commit 27442758e9b4e083bef3f164a1739475c01f3202 Merge: 08057253366d9 cd90511557fdf Author: Dave Airlie Date: Wed Oct 18 16:08:07 2023 +1000 Merge tag 'amd-drm-next-6.7-2023-10-13' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-6.7-2023-10-13: amdgpu: - DC replay fixes - Misc code cleanups and spelling fixes - Documentation updates - RAS EEPROM Updates - FRU EEPROM Updates - IP discovery updates - SR-IOV fixes - RAS updates - DC PQ fixes - SMU 13.0.6 updates - GC 11.5 Support - NBIO 7.11 Support - GMC 11 Updates - Reset fixes - SMU 11.5 Updates - SMU 13.0 OD support - Use flexible arrays for bo list handling - W=1 Fixes - SubVP fixes - DPIA fixes - DCN 3.5 Support - Devcoredump fixes - VPE 6.1 support - VCN 4.0 Updates - S/G display fixes - DML fixes - DML2 Support - MST fixes - VRR fixes - Enable seamless boot in more cases - Enable content type property for HDMI - OLED fixes - Rework and clean up GPUVM TLB flushing - DC ODM fixes - DP 2.x fixes - AGP aperture fixes - SDMA firmware loading cleanups - Cyan Skillfish GPU clock counter fix - GC 11 GART fix - Cache GPU fault info for userspace queries - DC cursor check fixes - eDP fixes - DC FP handling fixes - Variable sized array fixes - SMU 13.0.x fixes - IB start and size alignment fixes for VCN - SMU 14 Support - Suspend and resume sequence rework - vkms fix amdkfd: - GC 11 fixes - GC 10 fixes - Doorbell fixes - CWSR fixes - SVM fixes - Clean up GC info enumeration - Rework memory limit handling - Coherent memory handling fixes - Use partial migrations in GPU faults - TLB flush fixes - DMA unmap fixes - GC 9.4.3 fixes - SQ interrupt fix - GTT mapping fix - GC 11.5 Support radeon: - Misc code cleanups - W=1 Fixes - Fix possible buffer overflow - Fix possible NULL pointer dereference UAPI: - Add EXT_COHERENT memory allocation flags. These allow for system scope atomics. Proposed userspace: https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/pull/88 - Add support for new VPE engine. This is a memory to memory copy engine with advanced scaling, CSC, and color management features Proposed mesa MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25713 - Add INFO IOCTL interface to query GPU faults Proposed Mesa MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238 Proposed libdrm MR: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/298 Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20231013175758.1735031-1-alexander.deucher@amd.com commit 6823a8383420263bc061865027836755615a275f Author: Mamta Shukla Date: Tue Oct 17 10:47:11 2023 +0300 mtd: spi-nor: micron-st: use SFDP table for mt25qu512a Parse SFDP table to get size and functions of mt25qu512a. BFPT wrongly advertises 16bit SR support and made the locking fail. Add a post BFPT fixup hook to clear the 16bit SR support. cat /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/jedec_id 20bb20104400 cat /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/manufacturer st cat /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/partname mt25qu512a xxd -p /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/sfdp 53464450060101ff00060110300000ff84000102800000ffffffffffffff ffffffffffffffffffffffffffffffffffffe520fbffffffff1f29eb276b 273b27bbffffffffffff27bbffff29eb0c2010d80f520000244a99008b8e 03e1ac0127387a757a75fbbdd55c4a0f82ff81bd3d36ffffffffffffffff ffffffffffffffffffe7ffff21dcffff md5sum /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/sfdp 610efba1647e00ac6db18beb11e84c04 /sys/bus/spi/devices/spi-PRP0001:00/spi-nor/sfdp Signed-off-by: Mamta Shukla Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20231017074711.12167-2-tudor.ambarus@linaro.org Signed-off-by: Tudor Ambarus commit a2a3e5430e7beaabb58107ebb9deb7ee5dbce3fa Author: Mamta Shukla Date: Tue Oct 17 10:47:10 2023 +0300 mtd: spi-nor: micron-st: enable lock/unlock for mt25qu512a mt25qu512a supports locking/unlocking through the SR BP bits. Enable locking support. Tested with mtd-utils- flash_lock/flash_unlock on MT25QU512ABB8E12. Signed-off-by: Mamta Shukla Link: https://lore.kernel.org/r/20231017074711.12167-1-tudor.ambarus@linaro.org Signed-off-by: Tudor Ambarus commit 213c43676beb5f5a63cb27a0c8e8e71035b08445 Author: Radhakrishna Sripada Date: Sun Oct 8 18:48:24 2023 +0200 drm/i915/mtl: Remove the 'force_probe' requirement for Meteor Lake Meteor Lake has demonstrated consistent stability for some time. All user-space API modifications tide to its core platform functions are operational. The necessary firmware components are set up and comprehensive testing has been condused over a period. Given the recent faborable CI results, as well, we believe it's time to eliminate the 'force_probe' prerequisite and activate the platform by default. Signed-off-by: Aditya Chauhan Signed-off-by: Andrzej Hajda Signed-off-by: Chris Wilson Signed-off-by: Janusz Krzysztofik Signed-off-by: Jonathan Cavitt Signed-off-by: Nirmoy Das Signed-off-by: Radhakrishna Sripada Signed-off-by: Andi Shyti Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Acked-by: Lee Shawn C Tested-by: Lee Shawn C Tested-by: Karthik B S Link: https://patchwork.freedesktop.org/patch/msgid/20231008164824.919262-1-andi.shyti@linux.intel.com commit 2d6e2b10a773240c636a229e1822e359a166cc20 Author: Jonathan Cavitt Date: Tue Oct 17 11:08:06 2023 -0700 drm/i915: Enable GuC TLB invalidations for MTL Enable GuC TLB invalidations for MTL. Though more platforms than just MTL support GuC TLB invalidations, MTL is presently the only platform that requires it for any purpose, so only enable it there for now to minimize cross-platform impact. Signed-off-by: Jonathan Cavitt Reviewed-by: Andi Shyti Acked-by: Tvrtko Ursulin Reviewed-by: Nirmoy Das Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231017180806.3054290-8-jonathan.cavitt@intel.com commit dbe65a3796706c85511421612890cce6ac3183e5 Author: Jonathan Cavitt Date: Tue Oct 17 11:08:05 2023 -0700 drm/i915/gt: Increase sleep in gt_tlb selftest sanitycheck For the gt_tlb live selftest, when operating on the GSC engine, increase the timeout from 10 ms to 200 ms because the GSC engine is a bit slower than the rest. Signed-off-by: Jonathan Cavitt Reviewed-by: Andi Shyti Acked-by: Tvrtko Ursulin Reviewed-by: Nirmoy Das Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231017180806.3054290-7-jonathan.cavitt@intel.com commit 55ac6ea7ff7d9b53c415f81993d2e7651f824227 Author: Jonathan Cavitt Date: Tue Oct 17 11:08:04 2023 -0700 drm/i915: No TLB invalidation on wedged GT It is not an error for GuC TLB invalidations to fail when the GT is wedged or disabled, so do not process a wait failure as one in guc_send_invalidate_tlb. Signed-off-by: Fei Yang Signed-off-by: Jonathan Cavitt CC: John Harrison Reviewed-by: Andi Shyti Acked-by: Tvrtko Ursulin Acked-by: Nirmoy Das Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231017180806.3054290-6-jonathan.cavitt@intel.com commit 2202eca003ec4a490a255c649ca54d21b04e16f4 Author: Jonathan Cavitt Date: Tue Oct 17 11:08:03 2023 -0700 drm/i915: No TLB invalidation on suspended GT In case of GT is suspended, don't allow submission of new TLB invalidation request and cancel all pending requests. The TLB entries will be invalidated either during GuC reload or on system resume. Signed-off-by: Fei Yang Signed-off-by: Jonathan Cavitt CC: John Harrison Reviewed-by: Andi Shyti Acked-by: Tvrtko Ursulin Acked-by: Nirmoy Das Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231017180806.3054290-5-jonathan.cavitt@intel.com commit af58ee227662d8421eb15cace9c65c2022653c01 Author: Prathap Kumar Valsan Date: Tue Oct 17 11:08:02 2023 -0700 drm/i915: Define and use GuC and CTB TLB invalidation routines The GuC firmware had defined the interface for Translation Look-Aside Buffer (TLB) invalidation. We should use this interface when invalidating the engine and GuC TLBs. Add additional functionality to intel_gt_invalidate_tlb, invalidating the GuC TLBs and falling back to GT invalidation when the GuC is disabled. The invalidation is done by sending a request directly to the GuC tlb_lookup that invalidates the table. The invalidation is submitted as a wait request and is performed in the CT event handler. This means we cannot perform this TLB invalidation path if the CT is not enabled. If the request isn't fulfilled in two seconds, this would constitute an error in the invalidation as that would constitute either a lost request or a severe GuC overload. With this new invalidation routine, we can perform GuC-based GGTT invalidations. GuC-based GGTT invalidation is incompatible with MMIO invalidation so we should not perform MMIO invalidation when GuC-based GGTT invalidation is expected. The additional complexity incurred in this patch will be necessary for range-based tlb invalidations, which will be platformed in the future. Signed-off-by: Prathap Kumar Valsan Signed-off-by: Bruce Chang Signed-off-by: Chris Wilson Signed-off-by: Umesh Nerlige Ramappa Signed-off-by: Jonathan Cavitt Signed-off-by: Aravind Iddamsetty Signed-off-by: Fei Yang CC: Andi Shyti Reviewed-by: Andi Shyti Acked-by: Tvrtko Ursulin Acked-by: Nirmoy Das Reviewed-by: John Harrison Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231017180806.3054290-4-jonathan.cavitt@intel.com commit ff0dac080a8555eb3e95573c5ccaec4ac3ca63de Author: Jonathan Cavitt Date: Tue Oct 17 11:08:01 2023 -0700 drm/i915/guc: Add CT size delay helper As of now, there is no mechanism for tracking a given request's progress through the queue. Instead, add a helper that returns an estimated maximum time the queue should take to drain if completely full. Suggested-by: John Harrison Signed-off-by: Jonathan Cavitt Reviewed-by: Andi Shyti Acked-by: Tvrtko Ursulin Reviewed-by: Nirmoy Das Reviewed-by: John Harrison Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231017180806.3054290-3-jonathan.cavitt@intel.com commit 29e668337514e1af723232d3ae2b6c5ebc5d0738 Author: Jonathan Cavitt Date: Tue Oct 17 11:08:00 2023 -0700 drm/i915: Add GuC TLB Invalidation device info flags Add device info flags for if GuC TLB Invalidation is enabled. Signed-off-by: Jonathan Cavitt Reviewed-by: Andi Shyti Acked-by: Tvrtko Ursulin Reviewed-by: Nirmoy Das Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231017180806.3054290-2-jonathan.cavitt@intel.com commit ee2a35fedbc942e6eeb9e351a53acb1fe6b101c5 Merge: d4b14c1da5bf2 627aa13921c31 Author: Jakub Kicinski Date: Tue Oct 17 18:27:26 2023 -0700 Merge tag 'mlx5-updates-2023-10-10' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2023-10-10 1) Adham Faris, Increase max supported channels number to 256 2) Leon Romanovsky, Allow IPsec soft/hard limits in bytes 3) Shay Drory, Replace global mlx5_intf_lock with HCA devcom component lock 4) Wei Zhang, Optimize SF creation flow During SF creation, HCA state gets changed from INVALID to IN_USE step by step. Accordingly, FW sends vhca event to driver to inform about this state change asynchronously. Each vhca event is critical because all related SW/FW operations are triggered by it. Currently there is only a single mlx5 general event handler which not only handles vhca event but many other events. This incurs huge bottleneck because all events are forced to be handled in serial manner. Moreover, all SFs share same table_lock which inevitably impacts each other when they are created in parallel. This series will solve this issue by: 1. A dedicated vhca event handler is introduced to eliminate the mutual impact with other mlx5 events. 2. Max FW threads work queues are employed in the vhca event handler to fully utilize FW capability. 3. Redesign SF active work logic to completely remove table_lock. With above optimization, SF creation time is reduced by 25%, i.e. from 80s to 60s when creating 100 SFs. Patches summary: Patch 1 - implement dedicated vhca event handler with max FW cmd threads of work queues. Patch 2 - remove table_lock by redesigning SF active work logic. * tag 'mlx5-updates-2023-10-10' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: Allow IPsec soft/hard limits in bytes net/mlx5e: Increase max supported channels number to 256 net/mlx5e: Preparations for supporting larger number of channels net/mlx5e: Refactor mlx5e_rss_init() and mlx5e_rss_free() API's net/mlx5e: Refactor mlx5e_rss_set_rxfh() and mlx5e_rss_get_rxfh() net/mlx5e: Refactor rx_res_init() and rx_res_free() APIs net/mlx5e: Use PTR_ERR_OR_ZERO() to simplify code net/mlx5: Use PTR_ERR_OR_ZERO() to simplify code net/mlx5: fix config name in Kconfig parameter documentation net/mlx5: Remove unused declaration net/mlx5: Replace global mlx5_intf_lock with HCA devcom component lock net/mlx5: Refactor LAG peer device lookout bus logic to mlx5 devcom net/mlx5: Avoid false positive lockdep warning by adding lock_class_key net/mlx5: Redesign SF active work to remove table_lock net/mlx5: Parallelize vhca event handling ==================== Link: https://lore.kernel.org/r/20231014171908.290428-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit d1f9b39da4a5347150246871325190018cda8cb3 Author: Ilpo Järvinen Date: Tue Sep 19 15:56:46 2023 +0300 PCI: Use FIELD_GET() to extract Link Width Use FIELD_GET() to extract PCIe Negotiated and Maximum Link Width fields instead of custom masking and shifting. Link: https://lore.kernel.org/r/20230919125648.1920-7-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen [bhelgaas: drop duplicate include of ] Signed-off-by: Bjorn Helgaas Reviewed-by: Jonathan Cameron commit d4b14c1da5bf2714b4e5c43ca593f17dacabb36c Author: Justin Stitt Date: Mon Oct 16 18:42:42 2023 +0000 hamradio: replace deprecated strncpy with strscpy_pad strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect both hi.data.modename and hi.data.drivername to be NUL-terminated based on its usage with sprintf: | sprintf(hi.data.modename, "%sclk,%smodem,fclk=%d,bps=%d%s", | bc->cfg.intclk ? "int" : "ext", | bc->cfg.extmodem ? "ext" : "int", bc->cfg.fclk, bc->cfg.bps, | bc->cfg.loopback ? ",loopback" : ""); Note that this data is copied out to userspace with: | if (copy_to_user(data, &hi, sizeof(hi))) ... however, the data was also copied FROM the user here: | if (copy_from_user(&hi, data, sizeof(hi))) Considering the above, a suitable replacement is strscpy_pad() as it guarantees NUL-termination on the destination buffer while also NUL-padding (which is good+wanted behavior when copying data to userspace). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231016-strncpy-drivers-net-hamradio-baycom_epp-c-v2-1-39f72a72de30@google.com Signed-off-by: Jakub Kicinski commit 5294df643ba6bfee5c70208f0318acd404c2e27d Author: Jakub Kicinski Date: Mon Oct 16 14:45:40 2023 -0700 docs: netlink: clean up after deprecating version Jiri moved version to legacy specs in commit 0f07415ebb78 ("netlink: specs: don't allow version to be specified for genetlink"). Update the documentation. Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/20231016214540.1822392-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 9fea94d3a8cadd83f5de22eae953bd9e951d5215 Author: Jakub Kicinski Date: Mon Oct 16 14:39:37 2023 -0700 tools: ynl: fix converting flags to names after recent cleanup I recently cleaned up specs to not specify enum-as-flags when target enum is already defined as flags. YNL Python library did not convert flags, unfortunately, so this caused breakage for Stan and Willem. Note that the nlspec.py abstraction already hides the differences between flags and enums (value vs user_value), so the changes are pretty trivial. Fixes: 0629f22ec130 ("ynl: netdev: drop unnecessary enum-as-flags") Reported-and-tested-by: Willem de Bruijn Reported-and-tested-by: Stanislav Fomichev Link: https://lore.kernel.org/all/ZS10NtQgd_BJZ3RU@google.com/ Link: https://lore.kernel.org/r/20231016213937.1820386-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 9fe1450f6d3ce67d963c195d3fb8510d9c673bdd Merge: 73b24e7ce8f1f 743f6397623ed Author: Jakub Kicinski Date: Tue Oct 17 17:51:53 2023 -0700 Merge branch 'net-remove-last-of-the-phylink-validate-methods-and-clean-up' Russell King says: ==================== net: remove last of the phylink validate methods and clean up This four patch series removes the last of the phylink MAC .validate methods which can be found in the Freescale fman driver. fman has a requirement that half duplex may not be supported in RGMII mode, which is currently handled in its .validate method. In order to keep this functionality when removing the .validate method, we need to replace that with equivalent functionality, for which I propose the optional .mac_get_caps method in the first patch. The advantage of this approach over the .validate callback is that MAC drivers only have to deal with the MAC_* capabilities, and don't need to call back into phylink functions to do the masking of the ethtool linkmodes etc - which then becomes internal to phylink. This can be seen in the fourth patch where we make a load of these methods static. ==================== Link: https://lore.kernel.org/r/ZS1Z5DDfHyjMryYu@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 743f6397623edc708eda76ecc20e70032166e573 Author: Russell King (Oracle) Date: Mon Oct 16 16:43:08 2023 +0100 net: phylink: remove a bunch of unused validation methods Remove exports for phylink_caps_to_linkmodes(), phylink_get_capabilities(), phylink_validate_mask_caps() and phylink_generic_validate(). Also, as phylink_generic_validate() is no longer called, we can remove its implementation as well. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qsPkK-009wip-W9@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit da5f6b80ad6417f7cf50d273c1c0ecb885e511e8 Author: Russell King (Oracle) Date: Mon Oct 16 16:43:03 2023 +0100 net: phylink: remove .validate() method The MAC .validate() method is no longer used, so remove it from the phylink_mac_ops structure, and remove the callsite in phylink_validate_mac_and_pcs(). Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qsPkF-009wij-QM@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 2141297d4257f93ce214a2019d240cb602106973 Author: Russell King (Oracle) Date: Mon Oct 16 16:42:58 2023 +0100 net: fman: convert to .mac_get_caps() Convert fman to use the .mac_get_caps() method rather than the .validate() method. Signed-off-by: Russell King (Oracle) Reviewed-by: Sean Anderson Link: https://lore.kernel.org/r/E1qsPkA-009wid-Kv@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit b6f9774719e5601b32f47021b40fee446b356490 Author: Russell King (Oracle) Date: Mon Oct 16 16:42:53 2023 +0100 net: phylink: provide mac_get_caps() method Provide a new method, mac_get_caps() to get the MAC capabilities for the specified interface mode. This is for MACs which have special requirements, such as not supporting half-duplex in certain interface modes, and will replace the validate() method. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1qsPk5-009wiX-G5@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 73b24e7ce8f1f47e2b73c9b6724188898f4ca6fd Author: Jakub Kicinski Date: Mon Oct 16 10:16:40 2023 -0700 eth: bnxt: fix backward compatibility with older devices Recent FW interface update bumped the size of struct hwrm_func_cfg_input above 128B which is the max some devices support. Probe on Stratus (BCM957452) with FW 20.8.3.11 fails with: bnxt_en ...: Unable to reserve tx rings bnxt_en ...: 2nd rings reservation failed. bnxt_en ...: Not enough rings available. Once probe is fixed other errors pop up: bnxt_en ...: Failed to set async event completion ring. This is because __hwrm_send() rejects requests larger than bp->hwrm_max_ext_req_len with -E2BIG. Since the driver doesn't actually access any of the new fields, yet, trim the length. It should be safe. Similar workaround exists for backing_store_cfg_input. Although that one mins() to a constant of 256, not 128 we'll effectively use here. Michael explains: "the backing store cfg command is supported by relatively newer firmware that will accept 256 bytes at least." To make debugging easier in the future add a warning for oversized requests. Fixes: 754fbf604ff6 ("bnxt_en: Update firmware interface to 1.10.2.171") Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/20231016171640.1481493-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 097b4b7b64ef67a4703b89fd4064480b61557fd5 Author: Darrick J. Wong Date: Mon Oct 16 09:47:34 2023 -0700 xfs: convert rt summary macros to helpers Convert the realtime summary file macros to helper functions so that we can improve type checking. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit a9948626849c2c65dfd201b5e9d855e62937de61 Author: Darrick J. Wong Date: Mon Oct 16 09:46:53 2023 -0700 xfs: convert open-coded xfs_rtword_t pointer accesses to helper There are a bunch of places where we use open-coded logic to find a pointer to an xfs_rtword_t within a rt bitmap buffer. Convert all that to helper functions for better type safety. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit add3cddaea509071d01bf1d34df0d05db1a93a07 Author: Darrick J. Wong Date: Mon Oct 16 09:46:08 2023 -0700 xfs: remove XFS_BLOCKWSIZE and XFS_BLOCKWMASK macros Remove these trivial macros since they're not even part of the ondisk format. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 99e79b677b9a4542260c6244982d0b5d12354983 Merge: 56a7bb12c78ff 6f84090333bbf Author: Jakub Kicinski Date: Tue Oct 17 17:39:03 2023 -0700 Merge branch 'bridge-add-a-limit-on-learned-fdb-entries' Johannes Nixdorf says: ==================== bridge: Add a limit on learned FDB entries Introduce a limit on the amount of learned FDB entries on a bridge, configured by netlink with a build time default on bridge creation in the kernel config. For backwards compatibility the kernel config default is disabling the limit (0). Without any limit a malicious actor may OOM a kernel by spamming packets with changing MAC addresses on their bridge port, so allow the bridge creator to limit the number of entries. Currently the manual entries are identified by the bridge flags BR_FDB_LOCAL or BR_FDB_ADDED_BY_USER, atomically bundled under the new flag BR_FDB_DYNAMIC_LEARNED. This means the limit also applies to entries created with BR_FDB_ADDED_BY_EXT_LEARN but none of BR_FDB_LOCAL or BR_FDB_ADDED_BY_USER, e.g. ones added by SWITCHDEV_FDB_ADD_TO_BRIDGE. Link to the corresponding iproute2 changes: https://lore.kernel.org/r/20230919-fdb_limit-v4-1-b4d2dc4df30f@avm.de v4: https://lore.kernel.org/r/20230919-fdb_limit-v4-0-39f0293807b8@avm.de/ v3: https://lore.kernel.org/r/20230905-fdb_limit-v3-0-7597cd500a82@avm.de/ v2: https://lore.kernel.org/netdev/20230619071444.14625-1-jnixdorf-oss@avm.de/ v1: https://lore.kernel.org/netdev/20230515085046.4457-1-jnixdorf-oss@avm.de/ ==================== Link: https://lore.kernel.org/r/20231016-fdb_limit-v5-0-32cddff87758@avm.de Signed-off-by: Jakub Kicinski commit 6f84090333bbff3473235a13eb99c308a53e3725 Author: Johannes Nixdorf Date: Mon Oct 16 15:27:24 2023 +0200 selftests: forwarding: bridge_fdb_learning_limit: Add a new selftest Add a suite covering the fdb_n_learned and fdb_max_learned bridge features, touching all special cases in accounting at least once. Acked-by: Nikolay Aleksandrov Signed-off-by: Johannes Nixdorf Link: https://lore.kernel.org/r/20231016-fdb_limit-v5-5-32cddff87758@avm.de Signed-off-by: Jakub Kicinski commit 19297c3ab23c4b2fe4abd13a992b7d7d10b07258 Author: Johannes Nixdorf Date: Mon Oct 16 15:27:23 2023 +0200 net: bridge: Set strict_start_type for br_policy Set any new attributes added to br_policy to be parsed strictly, to prevent userspace from passing garbage. Signed-off-by: Johannes Nixdorf Acked-by: Nikolay Aleksandrov Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20231016-fdb_limit-v5-4-32cddff87758@avm.de Signed-off-by: Jakub Kicinski commit ddd1ad68826d8ff61a2e47733959570aa4d39a16 Author: Johannes Nixdorf Date: Mon Oct 16 15:27:22 2023 +0200 net: bridge: Add netlink knobs for number / max learned FDB entries The previous patch added accounting and a limit for the number of dynamically learned FDB entries per bridge. However it did not provide means to actually configure those bounds or read back the count. This patch does that. Two new netlink attributes are added for the accounting and limit of dynamically learned FDB entries: - IFLA_BR_FDB_N_LEARNED (RO) for the number of entries accounted for a single bridge. - IFLA_BR_FDB_MAX_LEARNED (RW) for the configured limit of entries for the bridge. The new attributes are used like this: # ip link add name br up type bridge fdb_max_learned 256 # ip link add name v1 up master br type veth peer v2 # ip link set up dev v2 # mausezahn -a rand -c 1024 v2 0.01 seconds (90877 packets per second # bridge fdb | grep -v permanent | wc -l 256 # ip -d link show dev br 13: br: mtu 1500 [...] [...] fdb_n_learned 256 fdb_max_learned 256 Signed-off-by: Johannes Nixdorf Acked-by: Nikolay Aleksandrov Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20231016-fdb_limit-v5-3-32cddff87758@avm.de Signed-off-by: Jakub Kicinski commit bdb4dfda3b41649c41cc2222857c9207fc47a950 Author: Johannes Nixdorf Date: Mon Oct 16 15:27:21 2023 +0200 net: bridge: Track and limit dynamically learned FDB entries A malicious actor behind one bridge port may spam the kernel with packets with a random source MAC address, each of which will create an FDB entry, each of which is a dynamic allocation in the kernel. There are roughly 2^48 different MAC addresses, further limited by the rhashtable they are stored in to 2^31. Each entry is of the type struct net_bridge_fdb_entry, which is currently 128 bytes big. This means the maximum amount of memory allocated for FDB entries is 2^31 * 128B = 256GiB, which is too much for most computers. Mitigate this by maintaining a per bridge count of those automatically generated entries in fdb_n_learned, and a limit in fdb_max_learned. If the limit is hit new entries are not learned anymore. For backwards compatibility the default setting of 0 disables the limit. User-added entries by netlink or from bridge or bridge port addresses are never blocked and do not count towards that limit. Introduce a new fdb entry flag BR_FDB_DYNAMIC_LEARNED to keep track of whether an FDB entry is included in the count. The flag is enabled for dynamically learned entries, and disabled for all other entries. This should be equivalent to BR_FDB_ADDED_BY_USER and BR_FDB_LOCAL being unset, but contrary to the two flags it can be toggled atomically. Atomicity is required here, as there are multiple callers that modify the flags, but are not under a common lock (br_fdb_update is the exception for br->hash_lock, br_fdb_external_learn_add for RTNL). Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: Johannes Nixdorf Link: https://lore.kernel.org/r/20231016-fdb_limit-v5-2-32cddff87758@avm.de Signed-off-by: Jakub Kicinski commit cbf51acbc5d50341290c79c97bda8cf46f5c4f22 Author: Johannes Nixdorf Date: Mon Oct 16 15:27:20 2023 +0200 net: bridge: Set BR_FDB_ADDED_BY_USER early in fdb_add_entry In preparation of the following fdb limit for dynamically learned entries, allow fdb_create to detect that the entry was added by the user. This way it can skip applying the limit in this case. Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: Johannes Nixdorf Link: https://lore.kernel.org/r/20231016-fdb_limit-v5-1-32cddff87758@avm.de Signed-off-by: Jakub Kicinski commit 56a7bb12c78ffa1b02e154b1d779ed2a1555fa3c Merge: 7713ec844756a b650981501bf0 Author: Jakub Kicinski Date: Tue Oct 17 16:52:53 2023 -0700 Merge tag 'wireless-next-2023-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Kalle Valo says: ==================== wireless-next patches for v6.7 The second pull request for v6.7, with only driver changes this time. We have now support for mt7925 PCIe and USB variants, few new features and of course some fixes. Major changes: mt76 - mt7925 support ath12k - read board data variant name from SMBIOS wfx - Remain-On-Channel (ROC) support * tag 'wireless-next-2023-10-16' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (109 commits) wifi: rtw89: mac: do bf_monitor only if WiFi 6 chips wifi: rtw89: mac: set bf_assoc capabilities according to chip gen wifi: rtw89: mac: set bfee_ctrl() according to chip gen wifi: rtw89: mac: add registers of MU-EDCA parameters for WiFi 7 chips wifi: rtw89: mac: generalize register of MU-EDCA switch according to chip gen wifi: rtw89: mac: update RTS threshold according to chip gen wifi: rtlwifi: simplify TX command fill callbacks wifi: hostap: remove unused ioctl function wifi: atmel: remove unused ioctl function wifi: rtw89: coex: add annotation __counted_by() to struct rtw89_btc_btf_set_mon_reg wifi: rtw89: coex: add annotation __counted_by() for struct rtw89_btc_btf_set_slot_table wifi: rtw89: add EHT radiotap in monitor mode wifi: rtw89: show EHT rate in debugfs wifi: rtw89: parse TX EHT rate selected by firmware from RA C2H report wifi: rtw89: Add EHT rate mask as parameters of RA H2C command wifi: rtw89: parse EHT information from RX descriptor and PPDU status packet wifi: radiotap: add bandwidth definition of EHT U-SIG wifi: rtlwifi: use convenient list_count_nodes() wifi: p54: Annotate struct p54_cal_database with __counted_by wifi: brcmfmac: fweh: Add __counted_by for struct brcmf_fweh_queue_item and use struct_size() ... ==================== Link: https://lore.kernel.org/r/20231016143822.880D8C433C8@smtp.kernel.org Signed-off-by: Jakub Kicinski commit d6800af51c76b6dae20e6023bbdc9b3da3ab5121 Author: Nicolas Saenz Julienne Date: Tue Oct 17 15:51:02 2023 +0000 KVM: x86: hyper-v: Don't auto-enable stimer on write from user-space Don't apply the stimer's counter side effects when modifying its value from user-space, as this may trigger spurious interrupts. For example: - The stimer is configured in auto-enable mode. - The stimer's count is set and the timer enabled. - The stimer expires, an interrupt is injected. - The VM is live migrated. - The stimer config and count are deserialized, auto-enable is ON, the stimer is re-enabled. - The stimer expires right away, and injects an unwarranted interrupt. Cc: stable@vger.kernel.org Fixes: 1f4b34f825e8 ("kvm/x86: Hyper-V SynIC timers") Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Vitaly Kuznetsov Link: https://lore.kernel.org/r/20231017155101.40677-1-nsaenz@amazon.com Signed-off-by: Sean Christopherson commit 5a989bbead4cc9cd67c3911226ad857d293643d8 Author: Mingwei Zhang Date: Tue Oct 17 23:26:10 2023 +0000 KVM: x86: Update the variable naming in kvm_x86_ops.sched_in() Update the variable with name 'kvm' in kvm_x86_ops.sched_in() to 'vcpu' to avoid confusions. Variable naming in KVM has a clear convention that 'kvm' refers to pointer of type 'struct kvm *', while 'vcpu' refers to pointer of type 'struct kvm_vcpu *'. Fix this 9-year old naming issue for fun. Signed-off-by: Mingwei Zhang Link: https://lore.kernel.org/r/20231017232610.4008690-1-mizhang@google.com Signed-off-by: Sean Christopherson commit ef5a83b7e597038d1c734ddb4bc00638082c2bf1 Author: Darrick J. Wong Date: Mon Oct 16 09:40:11 2023 -0700 xfs: use shifting and masking when converting rt extents, if possible Avoid the costs of integer division (32-bit and 64-bit) if the realtime extent size is a power of two. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 90d98a6ada1da0f8797ff3f5adafd175dd8c0a81 Author: Darrick J. Wong Date: Mon Oct 16 09:44:13 2023 -0700 xfs: convert the rtbitmap block and bit macros to static inline functions Replace these macros with typechecked helper functions. Eventually we're going to add more logic to the helpers and it'll be easier if we don't have to macro it up. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 5f57f7309d9ab9d24d50c5707472b1ed8af4eabc Author: Darrick J. Wong Date: Mon Oct 16 09:38:28 2023 -0700 xfs: create rt extent rounding helpers for realtime extent blocks Create a pair of functions to round rtblock numbers up or down to the nearest rt extent. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 055641248f649b52620a5fe8774bea253690e057 Author: Darrick J. Wong Date: Mon Oct 16 09:37:47 2023 -0700 xfs: convert do_div calls to xfs_rtb_to_rtx helper calls Convert these calls to use the helpers, and clean up all these places where the same variable can have different units depending on where it is in the function. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 2d5f216b77e33f9b503bd42998271da35d4b7055 Author: Darrick J. Wong Date: Mon Oct 16 09:32:45 2023 -0700 xfs: convert rt extent numbers to xfs_rtxnum_t Further disambiguate the xfs_rtblock_t uses by creating a new type, xfs_rtxnum_t, to store the position of an extent within the realtime section, in units of rtextents. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 5dc3a80d46a450481df7f7e9fe673ba3eb4514c3 Author: Darrick J. Wong Date: Mon Oct 16 09:37:07 2023 -0700 xfs: create helpers to convert rt block numbers to rt extent numbers Create helpers to do unit conversions of rt block numbers to rt extent numbers. There are three variations -- one to compute the rt extent number from an rt block number; one to compute the offset of an rt block within an rt extent; and one to extract both. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 3d2b6d034f0feb7741b313f978a2fe45e917e1be Author: Darrick J. Wong Date: Mon Oct 16 09:31:22 2023 -0700 xfs: rename xfs_verify_rtext to xfs_verify_rtbext This helper function validates that a range of *blocks* in the realtime section is completely contained within the realtime section. It does /not/ validate ranges of *rtextents*. Rename the function to avoid suggesting that it does, and change the type of the @len parameter since xfs_rtblock_t is a position unit, not a length unit. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 2c2b981b737a519907429f62148bbd9e40e01132 Author: Darrick J. Wong Date: Mon Oct 16 09:35:23 2023 -0700 xfs: create a helper to convert extlen to rtextlen Create a helper to compute the realtime extent (xfs_rtxlen_t) from an extent length (xfs_extlen_t) value. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit f29c3e745dc253bf9d9d06ddc36af1a534ba1dd0 Author: Darrick J. Wong Date: Mon Oct 16 09:31:12 2023 -0700 xfs: convert rt bitmap extent lengths to xfs_rtbxlen_t XFS uses xfs_rtblock_t for many different uses, which makes it much more difficult to perform a unit analysis on the codebase. One of these (ab)uses is when we need to store the length of a free space extent as stored in the realtime bitmap. Because there can be up to 2^64 realtime extents in a filesystem, we need a new type that is larger than xfs_rtxlen_t for callers that are querying the bitmap directly. This means scrub and growfs. Create this type as "xfs_rtbxlen_t" and use it to store 64-bit rtx lengths. 'b' stands for 'bitmap' or 'big'; reader's choice. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 68db60bf01c131c09bbe35adf43bd957a4c124bc Author: Darrick J. Wong Date: Mon Oct 16 09:34:39 2023 -0700 xfs: create a helper to compute leftovers of realtime extents Create a helper to compute the misalignment between a file extent (xfs_extlen_t) and a realtime extent. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 03f4de332e2e79db36ed2156fb2350480f142bec Author: Darrick J. Wong Date: Mon Oct 16 09:31:11 2023 -0700 xfs: convert rt bitmap/summary block numbers to xfs_fileoff_t We should use xfs_fileoff_t to store the file block offset of any location within the realtime bitmap or summary files. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit fa5a387230861116c2434c20d29fc4b3fd077d24 Author: Darrick J. Wong Date: Mon Oct 16 09:32:54 2023 -0700 xfs: create a helper to convert rtextents to rtblocks Create a helper to convert a realtime extent to a realtime block. Later on we'll change the helper to use bit shifts when possible. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit a684c538bc14410565e8939393089670fa1e19dd Author: Darrick J. Wong Date: Mon Oct 16 09:31:11 2023 -0700 xfs: convert xfs_extlen_t to xfs_rtxlen_t in the rt allocator In most of the filesystem, we use xfs_extlen_t to store the length of a file (or AG) space mapping in units of fs blocks. Unfortunately, the realtime allocator also uses it to store the length of a rt space mapping in units of rt extents. This is confusing, since one rt extent can consist of many fs blocks. Separate the two by introducing a new type (xfs_rtxlen_t) to store the length of a space mapping (in units of realtime extents) that would be found in a file. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 13928113fc5b5e79c91796290a99ed991ac0efe2 Author: Darrick J. Wong Date: Mon Oct 16 09:21:47 2023 -0700 xfs: move the xfs_rtbitmap.c declarations to xfs_rtbitmap.h Move all the declarations for functionality in xfs_rtbitmap.c into a separate xfs_rtbitmap.h header file. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit f6a2dae2a1f52ea23f649c02615d073beba4cc35 Author: Darrick J. Wong Date: Mon Oct 16 09:21:38 2023 -0700 xfs: make sure maxlen is still congruent with prod when rounding down In commit 2a6ca4baed62, we tried to fix an overflow problem in the realtime allocator that was caused by an overly large maxlen value causing xfs_rtcheck_range to run off the end of the realtime bitmap. Unfortunately, there is a subtle bug here -- maxlen (and minlen) both have to be aligned with @prod, but @prod can be larger than 1 if the user has set an extent size hint on the file, and that extent size hint is larger than the realtime extent size. If the rt free space extents are not aligned to this file's extszhint because other files without extent size hints allocated space (or the number of rt extents is similarly not aligned), then it's possible that maxlen after clamping to sb_rextents will no longer be aligned to prod. The allocation will succeed just fine, but we still trip the assertion. Fix the problem by reducing maxlen by any misalignment with prod. While we're at it, split the assertions into two so that we can tell which value had the bad alignment. Fixes: 2a6ca4baed62 ("xfs: make sure the rt allocator doesn't run off the end") Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit ddd98076d5c075c8a6c49d9e6e8ee12844137f23 Author: Darrick J. Wong Date: Mon Oct 16 09:21:37 2023 -0700 xfs: fix units conversion error in xfs_bmap_del_extent_delay The unit conversions in this function do not make sense. First we convert a block count to bytes, then divide that bytes value by rextsize, which is in blocks, to get an rt extent count. You can't divide bytes by blocks to get a (possibly multiblock) extent value. Fortunately nobody uses delalloc on the rt volume so this hasn't mattered. Fixes: fa5c836ca8eb5 ("xfs: refactor xfs_bunmapi_cow") Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit c2988eb5cff75c02bc57e02c323154aa08f55b78 Author: Darrick J. Wong Date: Mon Oct 16 09:21:21 2023 -0700 xfs: rt stubs should return negative errnos when rt disabled When realtime support is not compiled into the kernel, these functions should return negative errnos, not positive errnos. While we're at it, fix a broken macro declaration. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit b73494fa9a304ab95b59f07845e8d7d36e4d23e0 Author: Darrick J. Wong Date: Mon Oct 16 09:21:05 2023 -0700 xfs: prevent rt growfs when quota is enabled Quotas aren't (yet) supported with realtime, so we shouldn't allow userspace to set up a realtime section when quotas are enabled, even if they attached one via mount options. IOWS, you shouldn't be able to do: # mkfs.xfs -f /dev/sda # mount /dev/sda /mnt -o rtdev=/dev/sdb,usrquota # xfs_growfs -r /mnt Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 0e533cba38011457b51f13b3b5afd33c693bfcca Author: Rob Herring Date: Mon Oct 16 10:55:54 2023 -0500 dt-bindings: ata: tegra: Disallow undefined properties Device specific bindings should not allow undefined properties. This is accomplished in json-schema with 'additionalProperties: false'. Signed-off-by: Rob Herring Acked-by: Conor Dooley Signed-off-by: Damien Le Moal commit a590ed62269a049a72484ce617fe2f34e2da66cf Author: Srinivas Pandruvada Date: Fri Oct 13 11:15:41 2023 -0700 tools/power/x86/intel-speed-select: v1.18 release This version addresses issues with: - When CPU 0 hotplug is not possible, try cgroup v2 isolation without any user input - Fix turbo mode enable/disable swapped - Sanitize command line integer and hex arguments - Add more error messages - Increase CPU count in one request Signed-off-by: Srinivas Pandruvada commit 2e9064faccd1a5b9de8c6f4b23d9f4948901cbe9 Author: Paolo Bonzini Date: Mon Oct 16 18:48:58 2023 -0400 x86/microcode/amd: Fix snprintf() format string warning in W=1 build Building with GCC 11.x results in the following warning: arch/x86/kernel/cpu/microcode/amd.c: In function ‘find_blobs_in_containers’: arch/x86/kernel/cpu/microcode/amd.c:504:58: error: ‘h.bin’ directive output may be truncated writing 5 bytes into a region of size between 1 and 7 [-Werror=format-truncation=] arch/x86/kernel/cpu/microcode/amd.c:503:17: note: ‘snprintf’ output between 35 and 41 bytes into a destination of size 36 The issue is that GCC does not know that the family can only be a byte (it ultimately comes from CPUID). Suggest the right size to the compiler by marking the argument as char-size ("hh"). While at it, instead of using the slightly more obscure precision specifier use the width with zero padding (over 23000 occurrences in kernel sources, vs 500 for the idiom using the precision). Reported-by: kernel test robot Signed-off-by: Paolo Bonzini Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Closes: https://lore.kernel.org/oe-kbuild-all/202308252255.2HPJ6x5Q-lkp@intel.com/ Link: https://lore.kernel.org/r/20231016224858.2829248-1-pbonzini@redhat.com commit 5bc8f147dc2fe7a2e01b162e72cfb510f5908475 Merge: ec8cf230ceccf 32445526d836f Author: Jens Axboe Date: Tue Oct 17 15:20:14 2023 -0600 Merge tag 'nvme-6.7-2023-10-17' of git://git.infradead.org/nvme into for-6.7/block Pull NVMe updates from Keith: "nvme updates for Linux 6.7 - nvme-auth updates (Mark) - nvme-tcp tls (Hannes) - nvme-fc annotaions (Kees)" * tag 'nvme-6.7-2023-10-17' of git://git.infradead.org/nvme: (24 commits) nvme-auth: allow mixing of secret and hash lengths nvme-auth: use transformed key size to create resp nvme-auth: alloc nvme_dhchap_key as single buffer nvmet-tcp: use 'spin_lock_bh' for state_lock() nvme: rework NVME_AUTH Kconfig selection nvmet-tcp: peek icreq before starting TLS nvmet-tcp: control messages for recvmsg() nvmet-tcp: enable TLS handshake upcall nvmet: Set 'TREQ' to 'required' when TLS is enabled nvmet-tcp: allocate socket file nvmet-tcp: make nvmet_tcp_alloc_queue() a void function nvmet: make TCP sectype settable via configfs nvme-fabrics: parse options 'keyring' and 'tls_key' nvme-tcp: improve icreq/icresp logging nvme-tcp: control message handling for recvmsg() nvme-tcp: enable TLS handshake upcall nvme-tcp: allocate socket file security/keys: export key_lookup() nvme-keyring: implement nvme_tls_psk_default() nvme-tcp: add definitions for TLS cipher suites ... commit 40fa0489a29428bc8bfbfaec3085b92c009272e6 Merge: 0c74ef26c50a5 a23bfeda86239 Author: Arnd Bergmann Date: Tue Oct 17 23:19:59 2023 +0200 Merge tag 'amlogic-defconfig-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into soc/defconfig Amlogic defconfig changes for v6.7: - add various drivers for Amlogic based boards - KEYBOARD_GPIO_POLLED=m used to support buttons on pre-G12A boards - KHADAS_MCU_FAN_THERMAL=m & MFD_KHADAS_MCU=m to control FAN over the MCU on Khadas VIM boards - MEDIA_CEC_SUPPORT=y & CEC_MESON_G12A_AO=m to enable the CEC bus - RTC_DRV_PCF8563=m to enable support for RTC on most SBC boards - VIDEO_MESON_VDEC=m to enable HW Video Decoder - MESON_DDR_PMU=m to enable DDR PMU perf driver on G12A & SM1 SoCs * tag 'amlogic-defconfig-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: arm64: defconfig: add various drivers for Amlogic based boards Link: https://lore.kernel.org/r/2e08bd06-09e0-4352-8207-bc3b5d26fba4@linaro.org Signed-off-by: Arnd Bergmann commit 0c74ef26c50a53d26a92f512bdd26ab64da72d26 Merge: 8788f221b1780 438fb575463fc Author: Arnd Bergmann Date: Tue Oct 17 23:18:52 2023 +0200 Merge tag 'samsung-defconfig-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/defconfig Samsung defconfig changes for v6.7 Enable several drivers for boards with Samsung Exynos ARM SoCs in exynos_defconfig and multi_v7_defconfig: display PHYs, AHCI DWC, TM2 touchkey (used on ARM and ARM64 Exynos-based boards), Samsung camera sensors and Intersil 29018 light sensor. Enable also IIO in s5pv210_defconfig used by MAX17040 fuel gauge driver. * tag 'samsung-defconfig-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: exynos_defconfig: add driver for ISL29018 ARM: multi_v7_defconfig: add drivers for S5C73M3 & S5K6A3 camera sensors ARM: multi_v7_defconfig: add tm2-touchkey driver ARM: exynos_defconfig: replace SATA_AHCI_PLATFORM with AHCI_DWC driver ARM: multi_v7_defconfig: add AHCI_DWC driver ARM: multi_v7_defconfig: make Exynos related PHYs modules ARM: s5pv210_defconfig: enable IIO required by MAX17040 Link: https://lore.kernel.org/r/20231016072911.27148-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 8788f221b1780046e531426580d37e52223afd08 Merge: d9195144e7ff3 f1538805cf9da Author: Arnd Bergmann Date: Tue Oct 17 23:17:57 2023 +0200 Merge tag 'aspeed-6.7-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc into soc/defconfig ASPEED defconfig updates for 6.7 * Enable SMPro and FSI drivers, the BMC to host interfaces for Ampere and IBM's server processors * Enable IPMI SSIF, the smbus transport for IPMI * Disable FIRMWARE_MEMMAP, an x86 only thing * tag 'aspeed-6.7-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc: ARM: config: aspeed: Remove FIRMWARE_MEMMAP ARM: config: aspeed_g5: Enable SSIF BMC driver ARM: config: aspeed: Add Ampere SMPro drivers ARM: config: aspeed: Add new FSI drivers Link: https://lore.kernel.org/r/CACPK8XezpL-4bx0S-9t999_qde5Hik9BnuUZHcnmDHTd0KWBLA@mail.gmail.com Signed-off-by: Arnd Bergmann commit d9195144e7ff3126c4851efb774a049357aaea9a Merge: 9b9a5546b336b b46d856cb9b3b Author: Arnd Bergmann Date: Tue Oct 17 23:17:09 2023 +0200 Merge tag 'qcom-arm64-defconfig-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/defconfig Qualcomm ARM64 defconfig updates for v6.7 This enables the NB7VPQ904M SuperSpeed redriver driver, used in SM8550, the LPASS pinctrl driver for SM6115 and SM8350 and the M31 USB phy driver found in IPQ5332. * tag 'qcom-arm64-defconfig-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: defconfig: Enable M31 USB phy driver arm64: defconfig: enable Qualcomm SM6115 LPASS pinctrl arm64: defconfig: enable Qualcomm SM8350 LPASS pinctrl arm64: defconfig: enable NB7VPQ904M driver as module Link: https://lore.kernel.org/r/20231015201812.855218-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit 9b9a5546b336bcd8086ac6e09a6975e29b4fdf2d Merge: ec91108949dc0 f5f1783784193 Author: Arnd Bergmann Date: Tue Oct 17 23:16:12 2023 +0200 Merge tag 'imx-defconfig-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/defconfig i.MX defconfig changes for 6.7: - Enable Samsung DSIM DRM bridge driver and USB mass storage support in arm64 defconfig * tag 'imx-defconfig-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: defconfig: Enable Samsung DSIM driver arm64: defconfig: Enable CONFIG_USB_MASS_STORAGE Link: https://lore.kernel.org/r/20231015132300.2268016-4-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit ec91108949dc06022b4b3fcac177313f088206dd Merge: 22bf97fc236b9 09cfdb5a97b53 Author: Arnd Bergmann Date: Tue Oct 17 23:15:34 2023 +0200 Merge tag 'renesas-arm-defconfig-for-v6.7-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/defconfig Renesas ARM defconfig updates for v6.7 (take two) - Enable support for the Renesas RZ/G3S (R9A08G045) SoC in the arm64 defconfig. * tag 'renesas-arm-defconfig-for-v6.7-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: arm64: defconfig: Enable RZ/G3S (R9A08G045) SoC Link: https://lore.kernel.org/r/cover.1697200119.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 22bf97fc236b987f24c5800c9b185b172caa8f14 Merge: 8d21670105fe1 d2efde5cc970c Author: Arnd Bergmann Date: Tue Oct 17 23:14:19 2023 +0200 Merge tag 'renesas-arm-defconfig-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/defconfig Renesas ARM defconfig updates for v6.7 - Refresh shmobile_defconfig for v6.6-rc3. * tag 'renesas-arm-defconfig-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: ARM: shmobile: defconfig: Refresh for v6.6-rc3 Link: https://lore.kernel.org/r/cover.1695985420.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 32445526d836f827ea7e74ef933610b531d239df Author: Mark O'Donovan Date: Tue Oct 17 17:09:19 2023 +0000 nvme-auth: allow mixing of secret and hash lengths We can now use any of the secret transformation hashes with a secret, regardless of the secret size. e.g. a 32 byte key with the SHA-512(64 byte) hash. The example secret from the spec should now be permitted with any of the following: DHHC-1:00:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n: DHHC-1:01:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n: DHHC-1:02:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n: DHHC-1:03:ia6zGodOr4SEG0Zzaw398rpY0wqipUWj4jWjUh4HWUz6aQ2n: Note: Secrets are still restricted to 32,48 or 64 bits. Co-developed-by: Akash Appaiah Signed-off-by: Akash Appaiah Signed-off-by: Mark O'Donovan Reviewed-by: Hannes Reinecke Signed-off-by: Keith Busch commit f047daed179a451657d1e66b5fe4030a593a000c Author: Mark O'Donovan Date: Tue Oct 17 17:09:18 2023 +0000 nvme-auth: use transformed key size to create resp This does not change current behaviour as the driver currently verifies that the secret size is the same size as the length of the transformation hash. Co-developed-by: Akash Appaiah Signed-off-by: Akash Appaiah Signed-off-by: Mark O'Donovan Reviewed-by: Hannes Reinecke Signed-off-by: Keith Busch commit 3ebed3749f1767927229d568eea29daaf9f272d5 Author: Mark O'Donovan Date: Tue Oct 17 17:09:17 2023 +0000 nvme-auth: alloc nvme_dhchap_key as single buffer Co-developed-by: Akash Appaiah Signed-off-by: Akash Appaiah Signed-off-by: Mark O'Donovan Reviewed-by: Hannes Reinecke Signed-off-by: Keith Busch commit bbacf79201a1664f174e341f4bc0205b25b309d7 Author: Hannes Reinecke Date: Thu Oct 12 14:59:54 2023 +0200 nvmet-tcp: use 'spin_lock_bh' for state_lock() nvmet_tcp_schedule_release_queue() is called from socket state change callbacks, which may be called from an softirq context. So use 'spin_lock_bh' to avoid a spin lock warning. Signed-off-by: Hannes Reinecke Signed-off-by: Keith Busch commit 3d30bfcbdc268b41a7d9253a9cb3082281223b19 Author: David Matlack Date: Mon Oct 16 15:12:28 2023 -0700 KVM: x86/mmu: Stop kicking vCPUs to sync the dirty log when PML is disabled Stop kicking vCPUs in kvm_arch_sync_dirty_log() when PML is disabled. Kicking vCPUs when PML is disabled serves no purpose and could negatively impact guest performance. This restores KVM's behavior to prior to 5.12 commit a018eba53870 ("KVM: x86: Move MMU's PML logic to common code"), which replaced a static_call_cond(kvm_x86_flush_log_dirty) with unconditional calls to kvm_vcpu_kick(). Fixes: a018eba53870 ("KVM: x86: Move MMU's PML logic to common code") Signed-off-by: David Matlack Link: https://lore.kernel.org/r/20231016221228.1348318-1-dmatlack@google.com Signed-off-by: Sean Christopherson commit 692225015c82d3eece55a07d16cd24c4dc63a6a5 Author: Rob Herring Date: Tue Oct 17 15:33:51 2023 -0500 spi: stm32: Explicitly include correct DT includes The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it was merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Acked-by: Alain Volmat Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231017203352.2698326-1-robh@kernel.org Signed-off-by: Mark Brown commit 8f7e17d847edf6bc02d0813b123b9d78ba504098 Author: Rob Herring Date: Tue Oct 17 15:34:41 2023 -0500 regulator: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231017203442.2699322-1-robh@kernel.org Signed-off-by: Mark Brown commit 46537a8676d6555141c4b98ec1bf5f3eea971128 Author: Rob Herring Date: Tue Oct 17 15:34:28 2023 -0500 regulator: da9121: Use i2c_get_match_data() Use preferred i2c_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231017203429.2699039-1-robh@kernel.org Signed-off-by: Mark Brown commit a8b4962fbd004d7d4fcbf01ce7dc27fcef406199 Author: Rob Herring Date: Tue Oct 17 15:35:06 2023 -0500 regulator: Drop unnecessary of_match_device() calls If probe is reached, we've already matched the device and in the case of DT matching, the struct device_node pointer will be set. Therefore, there is no need to call of_match_device() in probe. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231017203507.2699826-1-robh@kernel.org Signed-off-by: Mark Brown commit 47b8fb4aef95343668a20c217c5378ce9841e0fb Author: Rob Herring Date: Mon Oct 16 10:55:27 2023 -0500 dt-bindings: usb: ti,tps6598x: Disallow undefined properties Device specific bindings should not allow undefined properties. This is accomplished in json-schema with 'additionalProperties: false'. With this, the 'connector' child node needs to be defined to prevent warnings. Acked-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20231016155527.2973385-1-robh@kernel.org Signed-off-by: Rob Herring commit 24516309e330cd592c04d0467313d885584af4e8 Author: Daniel Borkmann Date: Tue Oct 17 10:17:28 2023 +0200 selftests/bpf: Add additional mprog query test coverage Add several new test cases which assert corner cases on the mprog query mechanism, for example, around passing in a too small or a larger array than the current count. ./test_progs -t tc_opts #252 tc_opts_after:OK #253 tc_opts_append:OK #254 tc_opts_basic:OK #255 tc_opts_before:OK #256 tc_opts_chain_classic:OK #257 tc_opts_chain_mixed:OK #258 tc_opts_delete_empty:OK #259 tc_opts_demixed:OK #260 tc_opts_detach:OK #261 tc_opts_detach_after:OK #262 tc_opts_detach_before:OK #263 tc_opts_dev_cleanup:OK #264 tc_opts_invalid:OK #265 tc_opts_max:OK #266 tc_opts_mixed:OK #267 tc_opts_prepend:OK #268 tc_opts_query:OK #269 tc_opts_query_attach:OK #270 tc_opts_replace:OK #271 tc_opts_revision:OK Summary: 20/0 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Daniel Borkmann Signed-off-by: Andrii Nakryiko Reviewed-by: Alan Maguire Link: https://lore.kernel.org/bpf/20231017081728.24769-1-daniel@iogearbox.net commit 41efa431244f6498833ff8ee8dde28c4924c5479 Author: Reinette Chatre Date: Tue Oct 17 10:56:38 2023 -0700 PCI/MSI: Provide stubs for IMS functions The IMS related functions (pci_create_ims_domain(), pci_ims_alloc_irq(), and pci_ims_free_irq()) are not declared when CONFIG_PCI_MSI is disabled. Provide definitions of these functions for use when callers are compiled with CONFIG_PCI_MSI disabled. Fixes: 0194425af0c8 ("PCI/MSI: Provide IMS (Interrupt Message Store) support") Fixes: c9e5bea27383 ("PCI/MSI: Provide pci_ims_alloc/free_irq()") Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/14ff656899a3757453f8584c1109d7a9b98fa258.1697564731.git.reinette.chatre@intel.com commit 38685e2a0476127db766f81b1c06019ddc4c9ffa Author: Ran Xiaokai Date: Tue Oct 17 17:09:53 2023 +0800 cpu/hotplug: Don't offline the last non-isolated CPU If a system has isolated CPUs via the "isolcpus=" command line parameter, then an attempt to offline the last housekeeping CPU will result in a WARN_ON() when rebuilding the scheduler domains and a subsequent panic due to and unhandled empty CPU mas in partition_sched_domains_locked(). cpuset_hotplug_workfn() rebuild_sched_domains_locked() ndoms = generate_sched_domains(&doms, &attr); cpumask_and(doms[0], top_cpuset.effective_cpus, housekeeping_cpumask(HK_FLAG_DOMAIN)); Thus results in an empty CPU mask which triggers the warning and then the subsequent crash: WARNING: CPU: 4 PID: 80 at kernel/sched/topology.c:2366 build_sched_domains+0x120c/0x1408 Call trace: build_sched_domains+0x120c/0x1408 partition_sched_domains_locked+0x234/0x880 rebuild_sched_domains_locked+0x37c/0x798 rebuild_sched_domains+0x30/0x58 cpuset_hotplug_workfn+0x2a8/0x930 Unable to handle kernel paging request at virtual address fffe80027ab37080 partition_sched_domains_locked+0x318/0x880 rebuild_sched_domains_locked+0x37c/0x798 Aside of the resulting crash, it does not make any sense to offline the last last housekeeping CPU. Prevent this by masking out the non-housekeeping CPUs when selecting a target CPU for initiating the CPU unplug operation via the work queue. Suggested-by: Thomas Gleixner Signed-off-by: Ran Xiaokai Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/202310171709530660462@zte.com.cn commit 9a13ee457a6e7a850ac1d145b0731b1d729b8f42 Author: Changbin Du Date: Tue Oct 17 09:55:24 2023 +0800 perf: script: fix missing ',' for fields option A comma is missed at the end of line. Signed-off-by: Changbin Du Link: https://lore.kernel.org/r/20231017015524.797065-1-changbin.du@huawei.com Signed-off-by: Namhyung Kim commit a20fca2c5db19a09260827e526f37397ba698ce0 Author: Athira Rajeev Date: Fri Oct 13 13:00:21 2023 +0530 perf tests: Fix shellcheck warning in stat_all_metricgroups Running shellcheck on stat_all_metricgroups.sh reports below warning: In ./tests/shell/stat_all_metricgroups.sh line 7: function ParanoidAndNotRoot() ^-- SC2112: 'function' keyword is non-standard. Delete it. As per the format, "function" is a non-standard keyword that can be used to declare functions. Fix this by removing the "function" keyword from ParanoidAndNotRoot function Signed-off-by: Athira Rajeev Acked-by: Namhyung Kim Cc: kjain@linux.ibm.com Cc: maddy@linux.ibm.com Cc: disgoel@linux.vnet.ibm.com Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20231013073021.99794-4-atrajeev@linux.vnet.ibm.com Signed-off-by: Namhyung Kim commit eff65ee26ed73f3ca635bac13c386a4538a608d8 Author: Athira Rajeev Date: Fri Oct 13 13:00:20 2023 +0530 perf tests: Fix shellcheck warning in record_sideband.sh Running shellcheck on record_sideband.sh throws below warning: In tests/shell/record_sideband.sh line 25: if ! perf record -o ${perfdata} -BN --no-bpf-event -C $1 true 2>&1 >/dev/null ^--^ SC2069: To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify). This shows shellcheck warning SC2069 where the redirection order needs to be fixed. Use "cmd > /dev/null 2>&1" to fix the redirection of perf record output Fixes: 23b97c7ee963 ("perf test: Add test case for record sideband events") Signed-off-by: Athira Rajeev Reviewed-by: Kajol Jain Acked-by: Namhyung Kim Cc: disgoel@linux.vnet.ibm.com Link: https://lore.kernel.org/r/20231013073021.99794-3-atrajeev@linux.vnet.ibm.com Signed-off-by: Namhyung Kim commit 47f5693c4ce9b2bf2364303a531423e43278d3b6 Author: Athira Rajeev Date: Fri Oct 13 13:00:19 2023 +0530 perf tests: Ignore shellcheck warning in lock_contention Running shellcheck on lock_contention.sh generates below warning In tests/shell/lock_contention.sh line 36: if [ `nproc` -lt 4 ]; then ^-----^ SC2046: Quote this to prevent word splitting. Here since nproc will generate a single word output and there is no possibility of word splitting, this warning can be ignored. Use exception for this with "disable" option in shellcheck. This warning is observed after commit: "commit 29441ab3a30a ("perf test lock_contention.sh: Skip test if not enough CPUs")" Fixes: 29441ab3a30a ("perf test lock_contention.sh: Skip test if not enough CPUs") Signed-off-by: Athira Rajeev Reviewed-by: Kajol Jain Acked-by: Namhyung Kim Cc: maddy@linux.ibm.com Cc: disgoel@linux.vnet.ibm.com Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20231013073021.99794-2-atrajeev@linux.vnet.ibm.com Signed-off-by: Namhyung Kim commit f6a66ff98ac1cfbfb83ec2445f5652ae065a1bf0 Author: Athira Rajeev Date: Mon Oct 9 10:30:52 2023 +0530 tools/perf/arch/powerpc: Fix the CPU ID const char* value by adding 0x prefix Simple expression parser test fails in powerpc as below: 4: Simple expression parser test child forked, pid 170385 Using CPUID 004e2102 division by zero syntax error syntax error FAILED tests/expr.c:65 parse test failed test child finished with -1 Simple expression parser: FAILED! This is observed after commit: 'commit 9d5da30e4ae9 ("perf jevents: Add a new expression builtin strcmp_cpuid_str()")' With this commit, a new expression builtin strcmp_cpuid_str got added. This function takes an 'ID' type value, which is a string. So expression parse for strcmp_cpuid_str expects const char * as cpuid value type. In case of powerpc, CPU IDs are numbers. Hence it doesn't get interpreted correctly by bison parser. Example in case of power9, cpuid string returns as: 004e2102 cpuid of string type is expected in two cases: 1. char *get_cpuid_str(struct perf_pmu *pmu __maybe_unused); Testcase "tests/expr.c" uses "perf_pmu__getcpuid" which calls get_cpuid_str to get the cpuid string. 2. cpuid field in :struct pmu_events_map struct pmu_events_map { const char *arch; const char *cpuid; Here cpuid field is used in "perf_pmu__find_events_table" function as "strcmp_cpuid_str(map->cpuid, cpuid)". The value for cpuid field is picked from mapfile.csv. Fix the mapfile.csv and get_cpuid_str function to prefix cpuid with 0x so that it gets correctly interpreted by the bison parser Signed-off-by: Athira Rajeev Tested-by: Disha Goel Cc: kjain@linux.ibm.com Cc: maddy@linux.ibm.com Cc: disgoel@linux.vnet.ibm.com Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20231009050052.64935-1-atrajeev@linux.vnet.ibm.com Signed-off-by: Namhyung Kim commit 78efa7b411450a534e9d326cdf5578f681c73988 Author: Leo Yan Date: Sat Oct 14 15:41:59 2023 +0800 perf cs-etm: Respect timestamp option When users pass the option '--timestamp' or '-T' in the record command, all events will set the PERF_SAMPLE_TIME bit in the attribution. In this case, the AUX event will record the kernel timestamp, but it doesn't mean Arm CoreSight enables timestamp packets in its hardware tracing. If the option '--timestamp' or '-T' is set, this patch always enables Arm CoreSight timestamp, as a result, the bit 28 in event's config is to be set. Before: # perf record -e cs_etm// --per-thread --timestamp -- ls # perf script --header-only ... # event : name = cs_etm//, , id = { 69 }, type = 12, size = 136, config = 0, { sample_period, sample_freq } = 1, sample_type = IP|TID|TIME|CPU|IDENTIFIER, read_format = ID|LOST, disabled = 1, enable_on_exec = 1, sample_id_all = 1, exclude_guest = 1 ... After: # perf record -e cs_etm// --per-thread --timestamp -- ls # perf script --header-only ... # event : name = cs_etm//, , id = { 49 }, type = 12, size = 136, config = 0x10000000, { sample_period, sample_freq } = 1, sample_type = IP|TID|TIME|CPU|IDENTIFIER, read_format = ID|LOST, disabled = 1, enable_on_exec = 1, sample_id_all = 1, exclude_guest = 1 ... Signed-off-by: Leo Yan Reviewed-by: James Clark Acked-by: Suzuki K Poulose Cc: Will Deacon Cc: Mike Leach Cc: Alexander Shishkin Cc: John Garry Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20231014074159.1667880-3-leo.yan@linaro.org Signed-off-by: Namhyung Kim commit f8ccc2d5cc6516b019bcf8e361ae2a380cb36019 Author: Leo Yan Date: Sat Oct 14 15:41:58 2023 +0800 perf cs-etm: Validate timestamp tracing in per-thread mode So far, it's impossible to validate timestamp trace in Arm CoreSight when the perf is in the per-thread mode. E.g. for the command: perf record -e cs_etm/timestamp/ --per-thread -- ls The command enables config 'timestamp' for 'cs_etm' event in the per-thread mode. In this case, the function cs_etm_validate_config() directly bails out and skips validation. Given profiled process can be scheduled on any CPUs in the per-thread mode, this patch validates timestamp tracing for all CPUs when detect the CPU map is empty. Signed-off-by: Leo Yan Reviewed-by: James Clark Acked-by: Suzuki K Poulose Cc: Will Deacon Cc: Mike Leach Cc: John Garry Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20231014074159.1667880-2-leo.yan@linaro.org Signed-off-by: Namhyung Kim commit 0197da7affab502cd6e25da616ad038b169a7a77 Author: Ian Rogers Date: Thu Oct 12 10:56:45 2023 -0700 perf pmu: Lazily compute default config The default config is computed during creation of the PMU and may do things like scanning sysfs, when the PMU may just be used as part of scanning. Change default_config to perf_event_attr_init_default, a callback that is used when a default config needs initializing. This avoids holding onto the memory for a perf_event_attr and copying. On a tigerlake laptop running the pmu-scan benchmark: Before: Running 'internals/pmu-scan' benchmark: Computing performance of sysfs PMU event scan for 100 times Average core PMU scanning took: 28.780 usec (+- 0.503 usec) Average PMU scanning took: 283.480 usec (+- 18.471 usec) Number of openat syscalls: 30,227 After: Running 'internals/pmu-scan' benchmark: Computing performance of sysfs PMU event scan for 100 times Average core PMU scanning took: 27.880 usec (+- 0.169 usec) Average PMU scanning took: 245.260 usec (+- 15.758 usec) Number of openat syscalls: 28,914 Over 3 runs it is a nearly 12% reduction in execution time and a 4.3% of openat calls. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Cc: Ravi Bangoria Cc: James Clark Cc: Suzuki K Poulose Cc: Yang Jihong Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Jing Zhang Cc: Kajol Jain Cc: Thomas Richter Cc: Kan Liang Cc: John Garry Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20231012175645.1849503-8-irogers@google.com Signed-off-by: Namhyung Kim commit f20c15d13f017d4b46523990a0f3ba42025391a6 Author: Ian Rogers Date: Thu Oct 12 10:56:44 2023 -0700 perf pmu-events: Remember the perf_events_map for a PMU strcmp_cpuid_str performs regular expression comparisons and so per CPUID linear searches over the perf_events_map are expensive. Add a helper function called map_for_pmu that does the search but also caches the map specific to a PMU. As the PMU may differ, also cache the CPUID string so that PMUs with the same CPUID string don't require the linear search and regular expression comparisons. This speeds loading PMUs as the search is done once per PMU to find the appropriate tables. Signed-off-by: Ian Rogers Tested-by: Yang Jihong Cc: Ravi Bangoria Cc: James Clark Cc: Suzuki K Poulose Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Jing Zhang Cc: Kajol Jain Cc: Thomas Richter Cc: Kan Liang Cc: John Garry Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20231012175645.1849503-7-irogers@google.com Signed-off-by: Namhyung Kim commit 63883cb063846e9d0574038bb702a3a62a1ec046 Author: Ian Rogers Date: Thu Oct 12 10:56:43 2023 -0700 perf pmu: Const-ify perf_pmu__config_terms Add const to related APIs, this is so they can be used to default initialize a perf_event_attr from a const pmu. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Cc: Ravi Bangoria Cc: James Clark Cc: Suzuki K Poulose Cc: Yang Jihong Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Jing Zhang Cc: Kajol Jain Cc: Thomas Richter Cc: Kan Liang Cc: John Garry Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20231012175645.1849503-6-irogers@google.com Signed-off-by: Namhyung Kim commit 3a42f4c796ce45a6b1d14975401deb2c457ae79d Author: Ian Rogers Date: Thu Oct 12 10:56:42 2023 -0700 perf pmu: Const-ify file APIs File APIs don't alter the struct pmu so allow const ones to be passed. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Cc: Ravi Bangoria Cc: James Clark Cc: Suzuki K Poulose Cc: Yang Jihong Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Jing Zhang Cc: Kajol Jain Cc: Thomas Richter Cc: Kan Liang Cc: John Garry Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20231012175645.1849503-5-irogers@google.com Signed-off-by: Namhyung Kim commit 672bd21390d38dfccbe52b9537555985d65446aa Author: Ian Rogers Date: Thu Oct 12 10:56:41 2023 -0700 perf arm-spe: Move PMU initialization from default config code Avoid setting PMU values in arm_spe_pmu_default_config, move to perf_pmu__arch_init. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Tested-by: Leo Yan Cc: Ravi Bangoria Cc: James Clark Cc: Suzuki K Poulose Cc: Yang Jihong Cc: Will Deacon Cc: Mike Leach Cc: Jing Zhang Cc: Kajol Jain Cc: Thomas Richter Cc: Alexander Shishkin Cc: Kan Liang Cc: John Garry Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20231012175645.1849503-4-irogers@google.com Signed-off-by: Namhyung Kim commit 461e3e636a26518d3dd9c0ae3aff32894ec00b26 Author: Ian Rogers Date: Thu Oct 12 10:56:40 2023 -0700 perf intel-pt: Move PMU initialization from default config code Avoid setting PMU values in intel_pt_pmu_default_config, move to perf_pmu__arch_init. Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter Cc: Ravi Bangoria Cc: James Clark Cc: Suzuki K Poulose Cc: Yang Jihong Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Jing Zhang Cc: Kajol Jain Cc: Thomas Richter Cc: Kan Liang Cc: John Garry Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20231012175645.1849503-3-irogers@google.com Signed-off-by: Namhyung Kim commit aa61360155ac69003dc5c177f03a7f177a435286 Author: Ian Rogers Date: Thu Oct 12 10:56:39 2023 -0700 perf pmu: Rename perf_pmu__get_default_config to perf_pmu__arch_init Assign default_config as part of the init. perf_pmu__get_default_config was doing more than just getting the default config and so this is intended to better align with the code. Signed-off-by: Ian Rogers Cc: Ravi Bangoria Cc: James Clark Cc: Suzuki K Poulose Cc: Yang Jihong Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Jing Zhang Cc: Kajol Jain Cc: Thomas Richter Cc: Alexander Shishkin Cc: Kan Liang Cc: John Garry Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20231012175645.1849503-2-irogers@google.com Signed-off-by: Namhyung Kim commit 661ce78105d739f3297de8a2384f4e48a2a16043 Author: Adrian Hunter Date: Thu Oct 5 22:04:51 2023 +0300 perf intel-pt: Prefer get_unaligned_le64 to memcpy_le64 Use get_unaligned_le64() instead of memcpy_le64(..., 8) because it produces simpler code. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20231005190451.175568-6-adrian.hunter@intel.com Signed-off-by: Namhyung Kim commit 3b4fa67fc666eb88ae4c0ffdfbe338bec989fbee Author: Adrian Hunter Date: Thu Oct 5 22:04:50 2023 +0300 perf intel-pt: Use get_unaligned_le16() etc Avoid unaligned access by using get_unaligned_le16(), get_unaligned_le32() and get_unaligned_le64(). Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20231005190451.175568-5-adrian.hunter@intel.com Signed-off-by: Namhyung Kim commit f058fa5b07556abed26e5ae9d8e8ad13f79e1fa2 Author: Adrian Hunter Date: Thu Oct 5 22:04:49 2023 +0300 perf intel-pt: Use existing definitions of le16_to_cpu() etc Use definitions from tools/include/linux/kernel.h Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20231005190451.175568-4-adrian.hunter@intel.com Signed-off-by: Namhyung Kim commit 1d2dbce9bb9243ca18cacff5ada9dc00fc1e74b7 Author: Adrian Hunter Date: Thu Oct 5 22:04:48 2023 +0300 perf intel-pt: Simplify intel_pt_get_vmcs() Simplify and remove unnecessary constant expressions. Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20231005190451.175568-3-adrian.hunter@intel.com Signed-off-by: Namhyung Kim commit a940daa52167e9db8ecce82213813b735a9d9f23 Merge: 32e4fa37fa667 58720809f5277 Author: Thomas Gleixner Date: Tue Oct 17 21:40:46 2023 +0200 Merge branch 'linus' into smp/core Pull in upstream to get the fixes so depending changes can be applied. commit a91c9872546514438796fa53a7591b934ccbbcaa Author: Adrian Hunter Date: Thu Oct 5 22:04:47 2023 +0300 perf tools: Add get_unaligned_leNN() Add get_unaligned_le16(), get_unaligned_le32 and get_unaligned_le64, same as include/asm-generic/unaligned.h. And add include/asm-generic/unaligned.h to check-headers.sh bringing tools/include/asm-generic/unaligned.h up to date so that the kernel and tools versions match. Use diagnostic pragmas to ignore -Wpacked used by perf build. Signed-off-by: Adrian Hunter Reviewed-by: Ian Rogers Link: https://lore.kernel.org/r/20231005190451.175568-2-adrian.hunter@intel.com Link: https://lore.kernel.org/r/20231010142234.20061-1-adrian.hunter@intel.com [ squashed check-header.sh addition ] Signed-off-by: Namhyung Kim commit 3bc0f20a8c59daa79aee2da119564f668f458afd Author: Srinivas Pandruvada Date: Tue Oct 3 14:46:30 2023 -0700 tools/power/x86/intel-speed-select: Use cgroup isolate for CPU 0 From kernel version 6.5, CPU 0 hotplug capability is deprecated. If some SST profile doesn't have CPU 0, then it is no longer possible to offline CPU 0. This means that user space threads will still run on CPU 0. To workaround this issue, use cgroup v2 isolation feature. Whenever there /sys/devices/system/cpu/cpu0/online file is absent or open fails, isolate CPU 0 via CPU cgroup v2 isolation. Also add a command line option to force even if the /sys/devices/system/cpu/cpu0/online is present. The previous commit "01bcb56f059e ("tools/power/x86/intel-speed-select: Prevent CPU 0 offline") was just warning about this issue based on the kernel version 6.5 and above. With this new approach, instead of warning take action to mitigate the issue. Signed-off-by: Srinivas Pandruvada commit bc5370cca03ba9d1634fecd85e0cf99a0a3c0483 Author: Srinivas Pandruvada Date: Fri Oct 13 11:20:56 2023 -0700 tools/power/x86/intel-speed-select: Increase max CPUs in one request With the increase in the CPU count, this count needs to be updated. Increase max CPU count to 512. Signed-off-by: Srinivas Pandruvada commit da4c1b9e8f22d0567e308428e588e1f9e004ce74 Author: Srinivas Pandruvada Date: Thu Sep 7 17:07:19 2023 -0700 tools/power/x86/intel-speed-select: Display error for core-power support When core-power is getting enabled, if the feaure is not supported, display error. Signed-off-by: Srinivas Pandruvada commit 2fe8d2d7911fb4e380c3dcb5655e1a62bb14f75e Author: Srinivas Pandruvada Date: Thu Sep 7 17:12:55 2023 -0700 tools/power/x86/intel-speed-select: No TRL for non compute domains Don't call to set or get TRL for domains in which there are no CPUs. Signed-off-by: Srinivas Pandruvada commit 7b00d1018c8c8ed55aa1393b2ca234400eb6ca86 Author: Srinivas Pandruvada Date: Thu Sep 7 17:09:52 2023 -0700 tools/power/x86/intel-speed-select: turbo-mode enable disable swapped The command for turbo-mode enable and disable is swapped. Fix that. Previously turbo-mode enable was actually disabling and disable was enabling. Signed-off-by: Srinivas Pandruvada commit 3076db34b5ba87bb7a3335d16415befdea056d57 Author: Srinivas Pandruvada Date: Thu Sep 7 17:01:55 2023 -0700 tools/power/x86/intel-speed-select: Update help for TRL TRL (turbo ratio limit) argument is passed in hex string. Clarify that in the help. Signed-off-by: Srinivas Pandruvada commit 61f3d868b3d6f5e23a6d25597133d76d2186eddd Author: Srinivas Pandruvada Date: Thu Sep 7 15:46:39 2023 -0700 tools/power/x86/intel-speed-select: Sanitize integer arguments If the command takes some integer arguments, make sure the command contains only digits. Same for Hex arguments. Otherwise return error. Signed-off-by: Srinivas Pandruvada commit eb559fa633e43b7e076c7006255b6b5da8b4d1fb Author: Luca Ceresoli Date: Wed Oct 11 12:47:38 2023 +0200 dt-bindings: display: remove backlight node from panel examples The examples for these panel drivers have a backlight node in addition to the actual panel node. However the exact backlight is outside the scope of this binding and should be dropped from the example. Link: https://lore.kernel.org/linux-devicetree/20230724143152.GA3430423-robh@kernel.org/ Suggested-by: Rob Herring Signed-off-by: Luca Ceresoli Acked-by: David Lechner Link: https://lore.kernel.org/r/20231011-dt-panel-example-no-backlight-v1-1-b81618d32752@bootlin.com Signed-off-by: Rob Herring commit ca5a75df36dd54fd7ca470a74581ef1d27edaaab Author: Andy Shevchenko Date: Fri Oct 6 17:57:31 2023 +0300 amba: bus: balance firmware node reference counting Currently the ACPI code doesn't bump the reference count of the firmware node, while OF counter part does. Not that it's a problem right now, since ACPI doesn't really use the reference counting for firmware nodes, it still makes sense to make code robust against any changes done there. For this, - switch ACPI case to use device_set_node() to be unified with OF - move reference counting to amba_device_add() - switch to use firmware nodes instead of OF ones In the result we will have reference counting done in the same module for all callers independently on the nature of firmware node behind. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231006145732.3419115-1-andriy.shevchenko@linux.intel.com Signed-off-by: Rob Herring commit 780967feb626c6f4efa1e4b3532f1be83884cd76 Author: Christoph Niedermaier Date: Mon Oct 16 17:04:15 2023 +0200 dt-bindings: Add Marantec vendor prefix Add vendor prefix for Marantec electronics GmbH. Signed-off-by: Christoph Niedermaier Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231016150415.3196-1-cniedermaier@dh-electronics.com Signed-off-by: Rob Herring commit 9a4bf1f0be01582806e85322d18bf5c9f21d0b40 Author: Colin Ian King Date: Tue Oct 17 18:04:36 2023 +0100 ASoC: tas2781: make const read-only array magic_number static Don't populate the const read-only array magic_number on the stack, instead make it static const. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20231017170436.176615-1-colin.i.king@gmail.com Signed-off-by: Mark Brown commit 26951ec8623e915823985e86d2c428213f110659 Author: Peng Hao Date: Fri Oct 13 19:30:20 2023 +0800 KVM: x86: Use octal for file permission Convert all module params to octal permissions to improve code readability and to make checkpatch happy: WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. Signed-off-by: Peng Hao Link: https://lore.kernel.org/r/20231013113020.77523-1-flyingpeng@tencent.com Signed-off-by: Sean Christopherson commit 931d8c0087ac49ea9707995b12ca0630cf51aa53 Merge: 5f19ca4e014f2 d79eed22ba97c Author: Greg Kroah-Hartman Date: Tue Oct 17 18:57:41 2023 +0200 Merge tag 'fpga-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga into char-misc-next Xu writes: FPGA Manager changes for 6.7-rc1 - Rob's change uses device_get_match_data/spi_get_device_match_data() to get the driver match data for several drivers. - Nava's change sets 44-bit DMA mask for versal fpga. All patches have been reviewed on the mailing list, and have been in the last linux-next releases (as part of our for-next branch). Signed-off-by: Xu Yilun * tag 'fpga-for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga: fpga: versal: Add support for 44-bit DMA operations fpga: altera-ps-spi: Use spi_get_device_match_data() fpga: Use device_get_match_data() commit 6aa8d50a98c4668560dbfde6892aabdd534789bb Author: Ville Syrjälä Date: Thu Oct 12 15:24:41 2023 +0300 drm/i915/pxp: Clean up zero initializers Just use a simple {} to zero initialize arrays/structs instead of the hodgepodge of stuff we are using currently. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231012122442.15718-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit d3110f0758d87f336aeeab209525c0678cdd8b46 Author: Ville Syrjälä Date: Thu Oct 12 15:24:39 2023 +0300 drm/i915/guc: Clean up zero initializers Just use a simple {} to zero initialize arrays/structs instead of the hodgepodge of stuff we are using currently. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231012122442.15718-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 44cb03f19b38c11cfc5bf76ea6d6885da210ded2 Author: Yafang Shao Date: Sat Oct 7 13:59:45 2023 +0000 selftests/bpf: Add selftest for bpf_task_under_cgroup() in sleepable prog The result is as follows: $ tools/testing/selftests/bpf/test_progs --name=task_under_cgroup #237 task_under_cgroup:OK Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED Without the previous patch, there will be RCU warnings in dmesg when CONFIG_PROVE_RCU is enabled. While with the previous patch, there will be no warnings. Signed-off-by: Yafang Shao Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/20231007135945.4306-2-laoar.shao@gmail.com commit 29a7e00ffadddd8d68eff311de1bf12ae10687bb Author: Yafang Shao Date: Sat Oct 7 13:59:44 2023 +0000 bpf: Fix missed rcu read lock in bpf_task_under_cgroup() When employed within a sleepable program not under RCU protection, the use of 'bpf_task_under_cgroup()' may trigger a warning in the kernel log, particularly when CONFIG_PROVE_RCU is enabled: [ 1259.662357] WARNING: suspicious RCU usage [ 1259.662358] 6.5.0+ #33 Not tainted [ 1259.662360] ----------------------------- [ 1259.662361] include/linux/cgroup.h:423 suspicious rcu_dereference_check() usage! Other info that might help to debug this: [ 1259.662366] rcu_scheduler_active = 2, debug_locks = 1 [ 1259.662368] 1 lock held by trace/72954: [ 1259.662369] #0: ffffffffb5e3eda0 (rcu_read_lock_trace){....}-{0:0}, at: __bpf_prog_enter_sleepable+0x0/0xb0 Stack backtrace: [ 1259.662385] CPU: 50 PID: 72954 Comm: trace Kdump: loaded Not tainted 6.5.0+ #33 [ 1259.662391] Call Trace: [ 1259.662393] [ 1259.662395] dump_stack_lvl+0x6e/0x90 [ 1259.662401] dump_stack+0x10/0x20 [ 1259.662404] lockdep_rcu_suspicious+0x163/0x1b0 [ 1259.662412] task_css_set.part.0+0x23/0x30 [ 1259.662417] bpf_task_under_cgroup+0xe7/0xf0 [ 1259.662422] bpf_prog_7fffba481a3bcf88_lsm_run+0x5c/0x93 [ 1259.662431] bpf_trampoline_6442505574+0x60/0x1000 [ 1259.662439] bpf_lsm_bpf+0x5/0x20 [ 1259.662443] ? security_bpf+0x32/0x50 [ 1259.662452] __sys_bpf+0xe6/0xdd0 [ 1259.662463] __x64_sys_bpf+0x1a/0x30 [ 1259.662467] do_syscall_64+0x38/0x90 [ 1259.662472] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 1259.662479] RIP: 0033:0x7f487baf8e29 [...] [ 1259.662504] This issue can be reproduced by executing a straightforward program, as demonstrated below: SEC("lsm.s/bpf") int BPF_PROG(lsm_run, int cmd, union bpf_attr *attr, unsigned int size) { struct cgroup *cgrp = NULL; struct task_struct *task; int ret = 0; if (cmd != BPF_LINK_CREATE) return 0; // The cgroup2 should be mounted first cgrp = bpf_cgroup_from_id(1); if (!cgrp) goto out; task = bpf_get_current_task_btf(); if (bpf_task_under_cgroup(task, cgrp)) ret = -1; bpf_cgroup_release(cgrp); out: return ret; } After running the program, if you subsequently execute another BPF program, you will encounter the warning. It's worth noting that task_under_cgroup_hierarchy() is also utilized by bpf_current_task_under_cgroup(). However, bpf_current_task_under_cgroup() doesn't exhibit this issue because it cannot be used in sleepable BPF programs. Fixes: b5ad4cdc46c7 ("bpf: Add bpf_task_under_cgroup() kfunc") Signed-off-by: Yafang Shao Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Cc: Feng Zhou Cc: KP Singh Link: https://lore.kernel.org/bpf/20231007135945.4306-1-laoar.shao@gmail.com commit 6c664484337b37fa0cf6e958f4019623e30d40f7 Author: Darrick J. Wong Date: Mon Oct 16 09:16:22 2023 -0700 xfs: hoist freeing of rt data fork extent mappings Currently, xfs_bmap_del_extent_real contains a bunch of code to convert the physical extent of a data fork mapping for a realtime file into rt extents and pass that to the rt extent freeing function. Since the details of this aren't needed when CONFIG_XFS_REALTIME=n, move it to xfs_rtbitmap.c to reduce code size when realtime isn't enabled. This will (one day) enable realtime EFIs to reuse the same unit-converting call with less code duplication. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 9488062805943c2d63350d3ef9e4dc093799789a Author: Darrick J. Wong Date: Mon Oct 16 09:16:06 2023 -0700 xfs: bump max fsgeom struct version The latest version of the fs geometry structure is v5. Bump this constant so that xfs_db and mkfs calls to libxfs_fs_geometry will fill out all the fields. IOWs, this commit is a no-op for the kernel, but will be useful for userspace reporting in later changes. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit ec8cf230ceccfcc2bd29990c2902be168a92dee4 Author: Greg Joyce Date: Wed Oct 4 15:19:57 2023 -0500 powerpc/pseries: PLPKS SED Opal keystore support Define operations for SED Opal to read/write keys from POWER LPAR Platform KeyStore(PLPKS). This allows non-volatile storage of SED Opal keys. Signed-off-by: Greg Joyce Reviewed-by: Jonathan Derrick Link: https://lore.kernel.org/r/20231004201957.1451669-4-gjoyce@linux.vnet.ibm.com Signed-off-by: Jens Axboe commit 5dd339722f5f612f349b068e8da6d6710fd0e460 Author: Greg Joyce Date: Wed Oct 4 15:19:56 2023 -0500 block: sed-opal: keystore access for SED Opal keys Allow for permanent SED authentication keys by reading/writing to the SED Opal non-volatile keystore. Signed-off-by: Greg Joyce Reviewed-by: Jonathan Derrick Link: https://lore.kernel.org/r/20231004201957.1451669-3-gjoyce@linux.vnet.ibm.com Signed-off-by: Jens Axboe commit 96ff37ceb203426b1bcebbae42399686110b0130 Author: Greg Joyce Date: Wed Oct 4 15:19:55 2023 -0500 block:sed-opal: SED Opal keystore Add read and write functions that allow SED Opal keys to stored in a permanent keystore. Signed-off-by: Greg Joyce Reviewed-by: Jonathan Derrick Link: https://lore.kernel.org/r/20231004201957.1451669-2-gjoyce@linux.vnet.ibm.com Signed-off-by: Jens Axboe commit 0059bc9a29e02853dbbaa0f6d0635a687c8b9835 Author: Arnd Bergmann Date: Tue Oct 17 11:39:47 2023 +0200 console: fix up ARM screen_info reference Separating the VGA console screen_info from the EFI one unfortunately caused a build failure for footbridge that I had never caught with randconfig builds: arch/arm/kernel/setup.c:932:27: error: static declaration of 'vgacon_screen_info' follows non-static declaration 932 | static struct screen_info vgacon_screen_info = { | ^~~~~~~~~~~~~~~~~~ In file included from arch/arm/kernel/setup.c:44: arch/arm/include/asm/setup.h:40:27: note: previous declaration of 'vgacon_screen_info' with type 'struct screen_info' 40 | extern struct screen_info vgacon_screen_info; | ^~~~~~~~~~~~~~~~~~ arm-linux-gnueabi-ld: drivers/video/console/dummycon.o: in function `dummycon_init': dummycon.c:(.text+0xe4): undefined reference to `screen_info' Make sure the variable is global to avoid the conflict with the extern declaration, and make it work in dummycon.c Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231017093947.3627976-2-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit b8466fe82b79215b9ae28623a87c9a937ebd4f80 Author: Arnd Bergmann Date: Tue Oct 17 11:39:46 2023 +0200 efi: move screen_info into efi init code After the vga console no longer relies on global screen_info, there are only two remaining use cases: - on the x86 architecture, it is used for multiple boot methods (bzImage, EFI, Xen, kexec) to commucate the initial VGA or framebuffer settings to a number of device drivers. - on other architectures, it is only used as part of the EFI stub, and only for the three sysfb framebuffers (simpledrm, simplefb, efifb). Remove the duplicate data structure definitions by moving it into the efi-init.c file that sets it up initially for the EFI case, leaving x86 as an exception that retains its own definition for non-EFI boots. The added #ifdefs here are optional, I added them to further limit the reach of screen_info to configurations that have at least one of the users enabled. Reviewed-by: Ard Biesheuvel Reviewed-by: Javier Martinez Canillas Acked-by: Helge Deller Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231017093947.3627976-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit b4e1353f465147e38b2cd5086d0c20b77dfc61ec Author: Ming Lei Date: Mon Oct 9 17:33:22 2023 +0800 ublk: simplify aborting request Now ublk_abort_queue() is run exclusively with ublk_queue_rq() and the ubq_daemon task, so simplify aborting request: - set UBLK_IO_FLAG_ABORTED in ublk_abort_queue() just for aborting this request - abort request in ublk_queue_rq() if ubq->canceling is set Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20231009093324.957829-8-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 216c8f5ef0f209a3797292c487bdaa6991ab4b92 Author: Ming Lei Date: Mon Oct 9 17:33:21 2023 +0800 ublk: replace monitor with cancelable uring_cmd Monitor work actually introduces one extra context for handling abort, this way is easy to cause race, and also introduce extra delay when handling aborting. Now we start to support cancelable uring_cmd, so use it instead: 1) this cancel callback is either run from the uring cmd submission task context or called after the io_uring context is exit, so the callback is run exclusively with ublk_ch_uring_cmd() and __ublk_rq_task_work(). 2) the previous patch freezes request queue when calling ublk_abort_queue(), which is now completely exclusive with ublk_queue_rq() and ublk_ch_uring_cmd()/__ublk_rq_task_work(). 3) in timeout handler, if all IOs are in-flight, then all uring commands are completed, uring command canceling can't help us to provide forward progress any more, so call ublk_abort_requests() in timeout handler. This way simplifies aborting queue, and is helpful for adding new feature, such as, relax the limit of using single task for handling one queue. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20231009093324.957829-7-ming.lei@redhat.com Signed-off-by: Jens Axboe commit bd23f6c2c2d00518e2f27f2d25cef795de9bee56 Author: Ming Lei Date: Mon Oct 9 17:33:20 2023 +0800 ublk: quiesce request queue when aborting queue So far aborting queue ends request when the ubq daemon is exiting, and it can be run concurrently with ublk_queue_rq(), this way is fragile and we depend on the tricky usage of UBLK_IO_FLAG_ABORTED for avoiding such race. Quiesce queue when aborting queue, and the two code paths can be run completely exclusively, then it becomes easier to add new ublk feature, such as relaxing single same task limit for each queue. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20231009093324.957829-6-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 28dde8c062b640a26dc0bdbd341ace59ec96f7a3 Author: Ming Lei Date: Mon Oct 9 17:33:19 2023 +0800 ublk: rename mm_lock as lock Rename mm_lock field of ublk_device as lock, so that this lock can be reused for protecting access of ub->ub_disk, which will be used for simplifying ublk_abort_queue() by quiesce queue in next patch. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20231009093324.957829-5-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 85248d670b71d9edda9459ee14fdc85c8e9632c0 Author: Ming Lei Date: Mon Oct 9 17:33:18 2023 +0800 ublk: move ublk_cancel_dev() out of ub->mutex ublk_cancel_dev() just calls ublk_cancel_queue() to cancel all pending io commands after ublk request queue is idle. The only protection is just the read & write of ubq->nr_io_ready and avoid duplicated command cancel, so add one per-queue lock with cancel flag for providing this protection, meantime move ublk_cancel_dev() out of ub->mutex. Then we needn't to call io_uring_cmd_complete_in_task() to cancel pending command. And the same cancel logic will be re-used for cancelable uring command. This patch basically reverts commit ac5902f84bb5 ("ublk: fix AB-BA lockdep warning"). Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20231009093324.957829-4-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 3421c7f68bba52281bbb38bc76c18dc03cb689e4 Author: Ming Lei Date: Mon Oct 9 17:33:17 2023 +0800 ublk: make sure io cmd handled in submitter task context In well-done ublk server implementation, ublk io command won't be linked into any link chain. Meantime they are always handled in no-wait style, so basically io cmd is always handled in submitter task context. However, the server may set IOSQE_ASYNC, or io command is linked to one chain mistakenly, then we may still run into io-wq context and ctx->uring_lock isn't held. So in case of IO_URING_F_UNLOCKED, schedule this command by io_uring_cmd_complete_in_task to force running it in submitter task. Then ublk_ch_uring_cmd_local() is guaranteed to run with context uring_lock held, and we needn't to worry about sync among submission code path any more. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20231009093324.957829-3-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 8ed90e370f9b5442a2766b357b92e36bbf6ba82d Author: Ming Lei Date: Mon Oct 9 17:33:16 2023 +0800 ublk: don't get ublk device reference in ublk_abort_queue() ublk_abort_queue() is called in ublk_daemon_monitor_work(), in which it is guaranteed that the device is live because monitor work is canceled when removing device, so no need to get the device reference. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20231009093324.957829-2-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 6eba24aeb5e2fc582dd83021795befc1adaede20 Author: Mike Christie Date: Thu Oct 12 10:06:00 2023 -0500 ublk: Make ublks_max configurable We are converting tcmu applications to ublk, but have systems with up to 1k devices. This patch allows us to configure the ublks_max from userspace with the ublks_max modparam. Signed-off-by: Mike Christie Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20231012150600.6198-3-michael.christie@oracle.com Signed-off-by: Jens Axboe commit 56974c07f2c77d302fc311b0c6b95f45be76a3ae Author: Mike Christie Date: Thu Oct 12 10:05:59 2023 -0500 ublk: Limit dev_id/ub_number values The dev_id/ub_number is used for the ublk dev's char device's minor number so it has to fit into MINORMASK. This patch adds checks to prevent userspace from passing a number that's too large and limits what can be allocated by the ublk_index_idr for the case where userspace has the kernel allocate the dev_id/ub_number. Signed-off-by: Mike Christie Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20231012150600.6198-2-michael.christie@oracle.com Signed-off-by: Jens Axboe commit d451fdd0fe8323bf970b735cf276d4e11ae8cdcc Merge: ae3059cf95f3b b3a4dbc89d402 Author: Jens Axboe Date: Tue Oct 17 08:26:38 2023 -0600 Merge branch 'for-6.7/io_uring' into for-6.7/block Merge in io_uring fixes, as the ublk simplifying cancelations and aborts depend on the two patches from Ming adding cancelation support for uring_cmd. * for-6.7/io_uring: io_uring/kbuf: Use slab for struct io_buffer objects io_uring/kbuf: Allow the full buffer id space for provided buffers io_uring/kbuf: Fix check of BID wrapping in provided buffers io_uring/rsrc: cleanup io_pin_pages() io_uring: cancelable uring_cmd io_uring: retain top 8bits of uring_cmd flags for kernel internal use io_uring: add IORING_OP_WAITID support exit: add internal include file with helpers exit: add kernel_waitid_prepare() helper exit: move core of do_wait() into helper exit: abstract out should_wake helper for child_wait_callback() io_uring/rw: add support for IORING_OP_READ_MULTISHOT io_uring/rw: mark readv/writev as vectored in the opcode definition io_uring/rw: split io_read() into a helper commit 5fe030e38974d6f8e078c23a503fd6ce23412667 Author: Calvince Otieno Date: Tue Oct 17 13:12:56 2023 +0300 staging: wlan-ng: remove function prism2sta_ev_txexc The function prism2sta_ev_txexc() is called by the function hfa384x_usbin_txcompl() to print the transmit exception event - a debug information using netdev_dbg(). The debugging utility function can be called directly by hfa384x_usbin_txcompl(). Signed-off-by: Calvince Otieno Link: https://lore.kernel.org/r/ZS5eKFCfu7sGOCHL@lab-ubuntu Signed-off-by: Greg Kroah-Hartman commit 97fe6d0ae79b98e0445a27fca9a1436490c3fea6 Author: Calvince Otieno Date: Tue Oct 17 12:18:02 2023 +0300 staging: wlan-ng: use netdev_dbg over pr_debug This patch replaces the usage of pr_debug() with netdev_dbg(). The change is made to enhance context-aware debugging, improve code clarity, and maintain compatibility with established network debugging practices. There were no functional code changes. Signed-off-by: Calvince Otieno Link: https://lore.kernel.org/r/ZS5RSsaNvOvshNj6@lab-ubuntu Signed-off-by: Greg Kroah-Hartman commit c7b59371fe56fd98255f87a3e9383c80cb92377e Author: Michal Wilczynski Date: Wed Oct 11 11:33:32 2023 +0300 ACPI: AC: Rename ACPI device from device to adev Since transformation from ACPI driver to platform driver there are two devices on which the driver operates - ACPI device and platform device. For the sake of reader this calls for the distinction in their naming, to avoid confusion. Rename device to adev, as corresponding platform device is called pdev. Signed-off-by: Michal Wilczynski Signed-off-by: Rafael J. Wysocki commit 3e721e8c7b54217ab9849f431d5569f3e7145633 Author: Nandha Kumar Singaram Date: Mon Oct 16 19:35:44 2023 -0700 staging: greybus: Modify lines end with a '(' Adhere to linux coding style. Reported by checkpatch.pl: CHECK: Lines should not end with a '(' Signed-off-by: Nandha Kumar Singaram Link: https://lore.kernel.org/r/20231017023544.GA6684@ubuntu Signed-off-by: Greg Kroah-Hartman commit def3d547940c400d3d21c55e076e3b1498e43f94 Author: Gilbert Adikankwu Date: Mon Oct 16 23:58:57 2023 +0100 staging: vt6655: Rename variable byBBPreEDRSSI Remove byte Type encoding "by" from variable name and replace camelcase with snakecase. Mute checkpatch error: CHECK: Avoid CamelCase: Signed-off-by: Gilbert Adikankwu Link: https://lore.kernel.org/r/d525f5837bb343001447646fe17746370256694f.1697495598.git.gilbertadikankwu@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3095350411974b33a0649bfa910f12c140a61ecf Author: Gilbert Adikankwu Date: Mon Oct 16 23:58:56 2023 +0100 staging: vt6655: Rename variable byCurPwr Remove byte Type encoding "by" from variable name and replace camelcase with snakecase Mute checkpatch.pl error: CHECK: Avoid CamelCase: Signed-off-by: Gilbert Adikankwu Link: https://lore.kernel.org/r/4c24962988ac990ae21c95e4a1754cfabfd2db8d.1697495598.git.gilbertadikankwu@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0c93013ca928b4ec1096b6237fe6502947f42f35 Author: Gilbert Adikankwu Date: Mon Oct 16 23:58:55 2023 +0100 staging: vt6655: Rename variable byCurrentCh Remove byte Type encoding "by" from variable name and replace camelcase with snakecase. Mute checkpatch.pl error: CHECK: Avoid CamelCase: Signed-off-by: Gilbert Adikankwu Link: https://lore.kernel.org/r/cd4c073d0e67e2ce6ed9f38a7add9bbd2fe760ce.1697495598.git.gilbertadikankwu@gmail.com Signed-off-by: Greg Kroah-Hartman commit e9a2aba071ff73fa3c78b36bb8bd583ccd9d2e6d Author: Gilbert Adikankwu Date: Mon Oct 16 23:58:54 2023 +0100 staging: vt6655: Rename variable bUpdateBBVGA Remove bool Type encoding "b" from variable name and replace camelcase with snakecase. Mute checkpatch.pl error: CHECK: Avoid CamelCase: Signed-off-by: Gilbert Adikankwu Link: https://lore.kernel.org/r/9bd935c464671db2654c654964812cc48f4603d3.1697495598.git.gilbertadikankwu@gmail.com Signed-off-by: Greg Kroah-Hartman commit 260e7623d948301e6d99e43c215cf80da899b1ea Author: Dorcas AnonoLitunya Date: Mon Oct 16 23:14:12 2023 +0300 Staging: sm750fb: Rename ddk750_setModeTiming Rename function ddk750_setModeTiming to ddk750_set_mode_timing. This patch affects three files as the function is imported to other external files. This follows snakecase naming convention and ensures a consistent naming style throughout the file. Issue found by checkpatch. Mutes the following checkpatch error: CHECK:Avoid CamelCase: Signed-off-by: Dorcas AnonoLitunya Link: https://lore.kernel.org/r/20231016201434.7880-6-anonolitunya@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3632219898e79a54d3690864180f09ad4fbf9d44 Author: Dorcas AnonoLitunya Date: Mon Oct 16 23:14:11 2023 +0300 Staging: sm750fb: Rename programModeRegisters Rename function programModeRegisters to program_mode_registers. This follows snakecase naming convention and ensures a consistent naming style throughout the file. Issue found by checkpatch. Mutes the following checkpatch error: CHECK: Avoid CamelCase: Signed-off-by: Dorcas AnonoLitunya Link: https://lore.kernel.org/r/20231016201434.7880-5-anonolitunya@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7826b6338b144c99fcaa5c283eead3c6b320be1d Author: Dorcas AnonoLitunya Date: Mon Oct 16 23:14:10 2023 +0300 Staging: sm750fb: Rename dispControl Rename variable dispControl to disp_control. This follows snakecase naming convention and ensures a consistent naming style throughout the file. Issue found by checkpatch. Mutes the following checkpatch error: CHECK: Avoid CamelCase: Signed-off-by: Dorcas AnonoLitunya Link: https://lore.kernel.org/r/20231016201434.7880-4-anonolitunya@gmail.com Signed-off-by: Greg Kroah-Hartman commit 474adce40776b2de1641c4e6d9237559dfa3f842 Author: Dorcas AnonoLitunya Date: Mon Oct 16 23:14:09 2023 +0300 Staging: sm750fb: Rename pModeParam Rename variable pModeParam to mode_param. This follows snakecase naming convention and ensures a consistent naming style throughout the file. Issue found by checkpatch. Mutes the following checkpatch error: CHECK: Avoid CamelCase: Signed-off-by: Dorcas AnonoLitunya Link: https://lore.kernel.org/r/20231016201434.7880-3-anonolitunya@gmail.com Signed-off-by: Greg Kroah-Hartman commit fd79614e394c4a1e678bf39f2036b36ceade12ca Author: Dorcas AnonoLitunya Date: Mon Oct 16 23:14:08 2023 +0300 Staging: sm750fb: Rename displayControlAdjust_SM750E Rename function displayControlAdjust_SM750E to display_control_adjust_SM750E. This follows snakecase naming convention and ensures a consistent naming style throughout the file. Issue found by checkpatch. Mutes the following error: CHECK:Avoid CamelCase: Signed-off-by: Dorcas AnonoLitunya Link: https://lore.kernel.org/r/20231016201434.7880-2-anonolitunya@gmail.com Signed-off-by: Greg Kroah-Hartman commit a2fc3e8215313c8e4e42d4b2062830aaf1ef49c0 Author: Greg Kroah-Hartman Date: Tue Oct 17 10:13:10 2023 +0200 staging: rtl8192u: remove entry from Makefile In commit 697455ce4110 ("staging: rtl8192u: Remove broken driver"), the driver was removed, along with the Kconfig entry, but the Makefile line in drivers/staging/Makefile was not updated, so things like 'make clean' fail to work properly as they will decend into all subdirectories to try to clean things up. Resolve this by removing the entry in the main staging Makefile. Reported-by: Thorsten Leemhuis Cc: Philipp Hortmann Cc: Arnd Bergmann Fixes: 697455ce4110 ("staging: rtl8192u: Remove broken driver") Tested-by: Thorsten Leemhuis Link: https://lore.kernel.org/r/2023101709-amuck-upward-46f1@gregkh Signed-off-by: Greg Kroah-Hartman commit 9a675ba55a96a45a9fb69e6a5c43f80c6682e541 Author: Sebastian Andrzej Siewior Date: Mon Oct 16 14:57:38 2023 +0200 net, bpf: Add a warning if NAPI cb missed xdp_do_flush(). A few drivers were missing a xdp_do_flush() invocation after XDP_REDIRECT. Add three helper functions each for one of the per-CPU lists. Return true if the per-CPU list is non-empty and flush the list. Add xdp_do_check_flushed() which invokes each helper functions and creates a warning if one of the functions had a non-empty list. Hide everything behind CONFIG_DEBUG_NET. Suggested-by: Jesper Dangaard Brouer Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Daniel Borkmann Reviewed-by: Toke Høiland-Jørgensen Acked-by: Jakub Kicinski Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20231016125738.Yt79p1uF@linutronix.de commit d2a285d65bfde3218fd0c3b88794d0135ced680b Author: Hou Wenlong Date: Tue Oct 17 15:08:06 2023 +0800 x86/head/64: Move the __head definition to Move the __head section definition to a header to widen its use. An upcoming patch will mark the code as __head in mem_encrypt_identity.c too. Signed-off-by: Hou Wenlong Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/0583f57977be184689c373fe540cbd7d85ca2047.1697525407.git.houwenlong.hwl@antgroup.com commit 4cee14bcb14881aae81d60f106a335c68553ac1f Author: Babu Moger Date: Mon Oct 16 19:23:08 2023 -0500 x86/resctrl: Display RMID of resource group In x86, hardware uses RMID to identify a monitoring group. When a user creates a monitor group these details are not visible. These details can help resctrl debugging. Add RMID(mon_hw_id) to the monitor groups display in the resctrl interface. Users can see these details when resctrl is mounted with "-o debug" option. Add RFTYPE_MON_BASE that complements existing RFTYPE_CTRL_BASE and represents files belonging to monitoring groups. Other architectures do not use "RMID". Use the name mon_hw_id to refer to "RMID" in an effort to keep the naming generic. For example: $cat /sys/fs/resctrl/mon_groups/mon_grp1/mon_hw_id 3 Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Peter Newman Reviewed-by: Tan Shaopeng Reviewed-by: Fenghua Yu Reviewed-by: Reinette Chatre Reviewed-by: Ilpo Järvinen Tested-by: Peter Newman Tested-by: Tan Shaopeng Link: https://lore.kernel.org/r/20231017002308.134480-10-babu.moger@amd.com commit 918f211b5e4e709e91acf856967a850569c96b71 Author: Babu Moger Date: Mon Oct 16 19:23:07 2023 -0500 x86/resctrl: Add support for the files of MON groups only Files unique to monitoring groups have the RFTYPE_MON flag. When a new monitoring group is created the resctrl files with flags RFTYPE_BASE (files common to all resource groups) and RFTYPE_MON (files unique to monitoring groups) are created to support interacting with the new monitoring group. A resource group can support both monitoring and control, also termed a CTRL_MON resource group. CTRL_MON groups should get both monitoring and control resctrl files but that is not the case. Only the RFTYPE_BASE and RFTYPE_CTRL files are created for CTRL_MON groups. Ensure that files with the RFTYPE_MON flag are created for CTRL_MON groups. Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Peter Newman Reviewed-by: Tan Shaopeng Reviewed-by: Fenghua Yu Reviewed-by: Ilpo Järvinen Reviewed-by: Reinette Chatre Tested-by: Peter Newman Tested-by: Tan Shaopeng Link: https://lore.kernel.org/r/20231017002308.134480-9-babu.moger@amd.com commit ca8dad225e237493f19b1c5d4a8531f13a9b078f Author: Babu Moger Date: Mon Oct 16 19:23:06 2023 -0500 x86/resctrl: Display CLOSID for resource group In x86, hardware uses CLOSID to identify a control group. When a user creates a control group this information is not visible to the user. It can help resctrl debugging. Add CLOSID(ctrl_hw_id) to the control groups display in the resctrl interface. Users can see this detail when resctrl is mounted with the "-o debug" option. Other architectures do not use "CLOSID". Use the names ctrl_hw_id to refer to "CLOSID" in an effort to keep the naming generic. For example: $cat /sys/fs/resctrl/ctrl_grp1/ctrl_hw_id 1 Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Peter Newman Reviewed-by: Tan Shaopeng Reviewed-by: Fenghua Yu Reviewed-by: Reinette Chatre Reviewed-by: Ilpo Järvinen Tested-by: Peter Newman Tested-by: Tan Shaopeng Link: https://lore.kernel.org/r/20231017002308.134480-8-babu.moger@amd.com commit 70227e1574e47a759422beec78675f1c19e56e25 Author: Vijendar Mukunda Date: Tue Oct 17 12:49:36 2023 +0530 ASoC: amd: ps: enable wake capability for acp pci driver Enable wake capability for acp pci driver for Pink Sardine platform. Signed-off-by: Vijendar Mukunda Link: https://lore.kernel.org/r/20231017071939.953343-1-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown commit 086357275fc7635c5a2856c667b3d2f7604403fa Author: Rob Herring Date: Mon Oct 16 10:55:47 2023 -0500 ASoC: dt-bindings: tas5805m: Disallow undefined properties Device specific bindings should not allow undefined properties. This is accomplished in json-schema with 'additionalProperties: false'. Examples should be last in the schema, so move additionalProperties up while we're here. Signed-off-by: Rob Herring Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231016155547.2973853-1-robh@kernel.org Signed-off-by: Mark Brown commit 55089e1fb2d8b637bd9471539c4a7759261d6433 Author: Ulf Hansson Date: Thu Oct 12 17:36:07 2023 +0200 pmdomain: qcom: rpmhpd: Drop the ->opp_to_performance_state() callback Since commit 7c41cdcd3bbe ("OPP: Simplify the over-designed pstate <-> level dance"), there is no longer any need for genpd providers to assign the ->opp_to_performance_state(), hence let's drop it. Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org Signed-off-by: Ulf Hansson Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231012153607.101465-1-ulf.hansson@linaro.org commit 40d7f4d2e6de7b2bb6a2fe4cedf824ee670fec6b Author: Ulf Hansson Date: Thu Oct 12 17:35:58 2023 +0200 pmdomain: qcom: rpmpd: Drop the ->opp_to_performance_state() callback Since commit 7c41cdcd3bbe ("OPP: Simplify the over-designed pstate <-> level dance"), there is no longer any need for genpd providers to assign the ->opp_to_performance_state(), hence let's drop it. Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org Signed-off-by: Ulf Hansson Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231012153558.101445-1-ulf.hansson@linaro.org commit 016b4e5e286282a98902bfc8ac9273da89d07a6f Author: Ulf Hansson Date: Thu Oct 12 17:35:50 2023 +0200 pmdomain: qcom: cpr: Drop the ->opp_to_performance_state() callback Since commit 7c41cdcd3bbe ("OPP: Simplify the over-designed pstate <-> level dance"), there is no longer any need for genpd providers to assign the ->opp_to_performance_state(), hence let's drop it. Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org Signed-off-by: Ulf Hansson Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231012153550.101425-1-ulf.hansson@linaro.org commit 7713ec844756a9883ba9a91381369256275de4fb Author: Christophe JAILLET Date: Sat Oct 14 08:34:53 2023 +0200 net: openvswitch: Annotate struct mask_array with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). Signed-off-by: Christophe JAILLET Reviewed-by: Kees Cook Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/ca5c8049f58bb933f231afd0816e30a5aaa0eddd.1697264974.git.christophe.jaillet@wanadoo.fr Signed-off-by: Paolo Abeni commit df3bf90fef281c630ef06a3d03efb9fe56c8a0fb Author: Christophe JAILLET Date: Sat Oct 14 08:34:52 2023 +0200 net: openvswitch: Use struct_size() Use struct_size() instead of hand writing it. This is less verbose and more robust. Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/e5122b4ff878cbf3ed72653a395ad5c4da04dc1e.1697264974.git.christophe.jaillet@wanadoo.fr Signed-off-by: Paolo Abeni commit 1f33cdef8ca174661fb0d82d0f74fd0589dc9e46 Author: Rob Herring Date: Mon Oct 9 12:29:09 2023 -0500 drivers/perf: xgene: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() and acpi_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20231009172923.2457844-14-robh@kernel.org Signed-off-by: Will Deacon commit 32269e09b137ade1e5cb5c8a7d67db1ba9b1e4fe Author: Marek Szyprowski Date: Thu Oct 12 12:35:43 2023 +0200 perf/amlogic: add missing MODULE_DEVICE_TABLE Add missing MODULE_DEVICE_TABLE macro to let this driver to be automatically loaded as module. Signed-off-by: Marek Szyprowski Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20231012103543.3381326-1-m.szyprowski@samsung.com Signed-off-by: Will Deacon commit 184fdf9fc7ae6ae7155768faa48fc609d1a24b7e Author: Cuda-Chen Date: Tue Oct 17 13:37:03 2023 +0800 locking/seqlock: Fix grammar in comment The "neither writes before and after ..." for the description of do_write_seqcount_end() should be "neither writes before nor after". Signed-off-by: Cuda-Chen Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231017053703.11312-1-clh960524@gmail.com commit cb07d71f01017b7c2885ed629da9b973cb56b1d2 Author: Babu Moger Date: Mon Oct 16 19:23:05 2023 -0500 x86/resctrl: Introduce "-o debug" mount option Add "-o debug" option to mount resctrl filesystem in debug mode. When in debug mode resctrl displays files that have the new RFTYPE_DEBUG flag to help resctrl debugging. Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Peter Newman Reviewed-by: Tan Shaopeng Reviewed-by: Fenghua Yu Reviewed-by: Reinette Chatre Reviewed-by: Ilpo Järvinen Tested-by: Peter Newman Tested-by: Tan Shaopeng Link: https://lore.kernel.org/r/20231017002308.134480-7-babu.moger@amd.com commit d27567a0eb54be457b25e240593fdbd1c35c8618 Author: Babu Moger Date: Mon Oct 16 19:23:04 2023 -0500 x86/resctrl: Move default group file creation to mount The default resource group and its files are created during kernel init time. Upcoming changes will make some resctrl files optional based on a mount parameter. If optional files are to be added to the default group based on the mount option, then each new file needs to be created separately and call kernfs_activate() again. Create all files of the default resource group during resctrl mount, destroyed during unmount, to avoid scattering resctrl file addition across two separate code flows. Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Peter Newman Reviewed-by: Tan Shaopeng Reviewed-by: Fenghua Yu Reviewed-by: Reinette Chatre Reviewed-by: Ilpo Järvinen Tested-by: Peter Newman Tested-by: Tan Shaopeng Link: https://lore.kernel.org/r/20231017002308.134480-6-babu.moger@amd.com commit df5f3a1dd8a6d3ddb1f07a10817f735194717422 Author: Babu Moger Date: Mon Oct 16 19:23:03 2023 -0500 x86/resctrl: Unwind properly from rdt_enable_ctx() rdt_enable_ctx() enables the features provided during resctrl mount. Additions to rdt_enable_ctx() are required to also modify error paths of rdt_enable_ctx() callers to ensure correct unwinding if errors are encountered after calling rdt_enable_ctx(). This is error prone. Introduce rdt_disable_ctx() to refactor the error unwinding of rdt_enable_ctx() to simplify future additions. This also simplifies cleanup in rdt_kill_sb(). Suggested-by: Reinette Chatre Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Peter Newman Reviewed-by: Tan Shaopeng Reviewed-by: Fenghua Yu Reviewed-by: Reinette Chatre Reviewed-by: Ilpo Järvinen Tested-by: Peter Newman Tested-by: Tan Shaopeng Link: https://lore.kernel.org/r/20231017002308.134480-5-babu.moger@amd.com commit 53c6b86cd084c777175b66012d33b519c81d7b0b Merge: 1b2d3b45c1941 c8755b29b58ec Author: Paolo Abeni Date: Tue Oct 17 12:47:17 2023 +0200 Merge branch 'i3c-mctp-net-driver' Matt Johnston says: ==================== I3C MCTP net driver This series adds an I3C transport for the kernel's MCTP network protocol. MCTP is a communication protocol between system components (BMCs, drives, NICs etc), with higher level protocols such as NVMe-MI or PLDM built on top of it (in userspace). It runs over various transports such as I2C, PCIe, or I3C. The mctp-i3c driver follows a similar approach to the kernel's existing mctp-i2c driver, creating a "mctpi3cX" network interface for each numbered I3C bus. Busses opt in to support by adding a "mctp-controller" property to the devicetree: &i3c0 { mctp-controller; } The driver will bind to MCTP class devices (DCR 0xCC) that are on a supported I3C bus. Each bus is represented by a `struct mctp_i3c_bus` that keeps state for the network device. An individual I3C device (struct mctp_i3c_device) performs operations using the "parent" mctp_i3c_bus object. The I3C notify/enumeration patch is needed so that the mctp-i3c driver can handle creating/removing mctp_i3c_bus objects as required. The mctp-i3c driver is using the Provisioned ID as an identifier for target I3C devices (the neighbour address), as that will be more stable than the I3C dynamic address. The driver internally translates that to a dynamic address for bus operations. The driver has been tested using an AST2600 platform. A remote endpoint has been tested against QEMU, as well as using the target mode support in Aspeed's vendor tree. I3C maintainers have acked merging this through net-next tree. ==================== Link: https://lore.kernel.org/r/20231013040628.354323-1-matt@codeconstruct.com.au Signed-off-by: Paolo Abeni commit c8755b29b58ec65be17bcb8c40763d2dcb1f1db5 Author: Matt Johnston Date: Fri Oct 13 12:06:25 2023 +0800 mctp i3c: MCTP I3C driver Provides MCTP network transport over an I3C bus, as specified in DMTF DSP0233. Each I3C bus (with "mctp-controller" devicetree property) gets an "mctpi3cX" net device created. I3C devices are reachable as remote endpoints through that net device. Link layer addressing uses the I3C PID as a fixed hardware address for neighbour table entries. The driver matches I3C devices that have the MIPI assigned DCR 0xCC for MCTP. Signed-off-by: Matt Johnston Reviewed-by: Simon Horman Signed-off-by: Paolo Abeni commit 0ac6486e5cbd1af682d3b52fcd3615247e13cb57 Author: Jeremy Kerr Date: Fri Oct 13 12:06:24 2023 +0800 i3c: Add support for bus enumeration & notification This allows other drivers to be notified when new i3c busses are attached, referring to a whole i3c bus as opposed to individual devices. Signed-off-by: Jeremy Kerr Signed-off-by: Matt Johnston Acked-by: Alexandre Belloni Signed-off-by: Paolo Abeni commit ee71d6d5f18b55cbba20c84cce13519f7bb509e6 Author: Matt Johnston Date: Fri Oct 13 12:06:23 2023 +0800 dt-bindings: i3c: Add mctp-controller property This property is used to describe a I3C bus with attached MCTP I3C target devices. Signed-off-by: Matt Johnston Reviewed-by: Krzysztof Kozlowski Acked-by: Alexandre Belloni Signed-off-by: Paolo Abeni commit 1b2d3b45c1941453703d70f46b70ab8985303b5d Author: Florian Westphal Date: Thu Oct 12 14:02:37 2023 +0200 net: gso_test: release each segment individually consume_skb() doesn't walk the segment list, so segments other than the first are leaked. Move this skb_consume call into the loop. Cc: Willem de Bruijn Fixes: b3098d32ed6e ("net: add skb_segment kunit test") Signed-off-by: Florian Westphal Reviewed-by: Willem de Bruijn Signed-off-by: David S. Miller commit d41592435cde9a658a1bd3b3fdfeb8db7b330d78 Author: Babu Moger Date: Mon Oct 16 19:23:02 2023 -0500 x86/resctrl: Rename rftype flags for consistency resctrl associates rftype flags with its files so that files can be chosen based on the resource, whether it is info or base, and if it is control or monitor type file. These flags use the RF_ as well as RFTYPE_ prefixes. Change the prefix to RFTYPE_ for all these flags to be consistent. Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Peter Newman Reviewed-by: Tan Shaopeng Reviewed-by: Fenghua Yu Reviewed-by: Reinette Chatre Reviewed-by: Ilpo Järvinen Tested-by: Peter Newman Tested-by: Tan Shaopeng Link: https://lore.kernel.org/r/20231017002308.134480-4-babu.moger@amd.com commit 6846dc1a31d1894a7acf52d8442fe73b34091022 Author: Babu Moger Date: Tue Oct 3 18:54:22 2023 -0500 x86/resctrl: Simplify rftype flag definitions The rftype flags are bitmaps used for adding files under the resctrl filesystem. Some of these bitmap defines have one extra level of indirection which is not necessary. Drop the RF_* defines and simplify the macros. [ bp: Massage commit message. ] Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Peter Newman Reviewed-by: Tan Shaopeng Reviewed-by: Fenghua Yu Reviewed-by: Reinette Chatre Reviewed-by: Ilpo Järvinen Tested-by: Peter Newman Tested-by: Tan Shaopeng Link: https://lore.kernel.org/r/20231017002308.134480-3-babu.moger@amd.com commit 3ba9fdfaa550936837b50b73d6c27ac401fde875 Author: Rob Herring Date: Fri Oct 6 17:46:13 2023 -0500 pmdomain: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006224614.444488-1-robh@kernel.org Signed-off-by: Ulf Hansson commit e8fa18de717dd9feaa21778a611c60328d377324 Merge: bc0d59d757ed5 767881c470b31 Author: Ulf Hansson Date: Tue Oct 17 11:44:16 2023 +0200 pmdomain: Merge branch fixes into next Merge the pmdomain fixes for v6.6-rc[n] into the next branch, to allow them to get tested together with the new pmdomain changes that are targeted for v6.7. Signed-off-by: Ulf Hansson commit 137df1189d128a6b5dee2f653e054b40ef36b94c Author: Andrii Nakryiko Date: Mon Oct 16 11:28:40 2023 -0700 libbpf: Don't assume SHT_GNU_verdef presence for SHT_GNU_versym section Fix too eager assumption that SHT_GNU_verdef ELF section is going to be present whenever binary has SHT_GNU_versym section. It seems like either SHT_GNU_verdef or SHT_GNU_verneed can be used, so failing on missing SHT_GNU_verdef actually breaks use cases in production. One specific reported issue, which was used to manually test this fix, was trying to attach to `readline` function in BASH binary. Fixes: bb7fa09399b9 ("libbpf: Support symbol versioning for uprobe") Reported-by: Liam Wisehart Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Tested-by: Manu Bretelle Reviewed-by: Fangrui Song Acked-by: Hengqi Chen Link: https://lore.kernel.org/bpf/20231016182840.4033346-1-andrii@kernel.org commit bc0d59d757ed528a5219de74fa4adbf75236f4cc Author: Julia Lawall Date: Thu Sep 7 11:55:14 2023 +0200 pmdomain: ti: add missing of_node_put for_each_node_with_property performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. This was done using the Coccinelle semantic patch iterators/for_each_child.cocci Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20230907095521.14053-5-Julia.Lawall@inria.fr Signed-off-by: Ulf Hansson commit c5b5831f3c168a1bf1172159c4956e721a0064cf Author: Fabien Parent Date: Mon Sep 18 11:37:52 2023 +0200 pmdomain: mediatek: Add support for MT8365 Add the needed board data to support MT8365 SoC. Signed-off-by: Fabien Parent Signed-off-by: Markus Schneider-Pargmann Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Tested-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230918093751.1188668-9-msp@baylibre.com Signed-off-by: Ulf Hansson commit d2567a84520d10b8418cc3b53454e4b6aadaf728 Author: Alexandre Bailon Date: Mon Sep 18 11:37:51 2023 +0200 pmdomain: mediatek: Add support for MTK_SCPD_STRICT_BUS_PROTECTION cap This adds support for MTK_SCPD_STRICT_BUS_PROTECTION capability. It is a strict bus protection policy that requires the bus protection to be disabled before accessing the bus. This is required by the mt8365, for the MM power domain. Signed-off-by: Alexandre Bailon Signed-off-by: Fabien Parent Signed-off-by: Markus Schneider-Pargmann Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Tested-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230918093751.1188668-8-msp@baylibre.com Signed-off-by: Ulf Hansson commit ecaf11aaee98d3f79f195b73c5efc7065ef00072 Author: Alexandre Bailon Date: Mon Sep 18 11:37:50 2023 +0200 pmdomain: mediatek: Add support for WAY_EN operations This updates the power domain to support WAY_EN operations. WAY_EN operations on mt8365 are using a different component to check for the acknowledgment, namely the infracfg-nao component. Also to enable a way it the bit needs to be cleared while disabling a way needs a bit to be set. To support these two operations two flags are added, BUS_PROT_INVERTED and BUS_PROT_STA_COMPONENT_INFRA_NAO. Additionally another regmap is created if the INFRA_NAO capability is set. This operation is required by the mt8365 for the MM power domain. Signed-off-by: Alexandre Bailon Signed-off-by: Fabien Parent Signed-off-by: Markus Schneider-Pargmann Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Tested-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230918093751.1188668-7-msp@baylibre.com Signed-off-by: Ulf Hansson commit 151bd6c55f73df589d88e84a948edf0f0b4e9bc0 Author: Markus Schneider-Pargmann Date: Mon Sep 18 11:37:49 2023 +0200 pmdomain: mediatek: Unify configuration for infracfg and smi Use flags to distinguish between infracfg and smi subsystem for a bus protection configuration. It simplifies enabling/disabling and prepares the driver for the use of another regmap for mt8365. Signed-off-by: Markus Schneider-Pargmann Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Tested-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230918093751.1188668-6-msp@baylibre.com Signed-off-by: Ulf Hansson commit 2ec81379eaf0feb2fe6d48c2789e66ca4191c5ba Author: Markus Schneider-Pargmann Date: Mon Sep 18 11:37:48 2023 +0200 pmdomain: mediatek: Create bus protection operation functions Separate the register access used for bus protection enable/disable into their own functions. These will be used later for WAY_EN support. Signed-off-by: Markus Schneider-Pargmann Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Tested-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230918093751.1188668-5-msp@baylibre.com Signed-off-by: Ulf Hansson commit ae442ba85a6657f284cdc166ba107af3a762e668 Author: Markus Schneider-Pargmann Date: Mon Sep 18 11:37:47 2023 +0200 pmdomain: mediatek: Split bus_prot_mask bus_prot_mask is used for all operations, set clear and acknowledge. In preparation of m8365 power domain support split this one mask into two, one mask for set and clear, another one for acknowledge. Signed-off-by: Markus Schneider-Pargmann Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Tested-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230918093751.1188668-4-msp@baylibre.com Signed-off-by: Ulf Hansson commit c6bee73207684bf6dac2855de8faa508c3c5026d Author: Markus Schneider-Pargmann Date: Mon Sep 18 11:37:46 2023 +0200 pmdomain: mediatek: Move bools to a flags field To simplify the macros, use a flags field for simple bools. This is in preparation for more flags. Signed-off-by: Markus Schneider-Pargmann Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Tested-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230918093751.1188668-3-msp@baylibre.com Signed-off-by: Ulf Hansson commit f4e769243d59be92bb9c4e1b754c1e1c984c6afb Merge: 916e15b73bdd3 a1571f1f333c2 Author: Ulf Hansson Date: Tue Oct 17 11:39:37 2023 +0200 pmdomain: Merge branch genpd_dt into next Merge the immutable branch genpd_dt into next, to allow the DT bindings to be tested together with new pmdomain changes that are targeted for v6.7. Signed-off-by: Ulf Hansson commit a1571f1f333c2fced076f0d54ed771d1838d827f Author: Fabien Parent Date: Mon Sep 18 11:37:45 2023 +0200 dt-bindings: power: Add MT8365 power domains Add power domains dt-bindings for MT8365. Signed-off-by: Fabien Parent Signed-off-by: Markus Schneider-Pargmann Acked-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Alexandre Mergnat Tested-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20230918093751.1188668-2-msp@baylibre.com Signed-off-by: Ulf Hansson commit fe2a20ea0b0953189e57740debc7dcc789d1ea55 Author: Babu Moger Date: Mon Oct 16 19:23:00 2023 -0500 x86/resctrl: Add multiple tasks to the resctrl group at once The resctrl task assignment for monitor or control group needs to be done one at a time. For example: $mount -t resctrl resctrl /sys/fs/resctrl/ $mkdir /sys/fs/resctrl/ctrl_grp1 $echo 123 > /sys/fs/resctrl/ctrl_grp1/tasks $echo 456 > /sys/fs/resctrl/ctrl_grp1/tasks $echo 789 > /sys/fs/resctrl/ctrl_grp1/tasks This is not user-friendly when dealing with hundreds of tasks. Support multiple task assignment in one command with tasks ids separated by commas. For example: $echo 123,456,789 > /sys/fs/resctrl/ctrl_grp1/tasks Signed-off-by: Babu Moger Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Peter Newman Reviewed-by: Tan Shaopeng Reviewed-by: Fenghua Yu Reviewed-by: Reinette Chatre Reviewed-by: Ilpo Järvinen Tested-by: Peter Newman Tested-by: Tan Shaopeng Link: https://lore.kernel.org/r/20231017002308.134480-2-babu.moger@amd.com commit 5055fadfa7e16f2427d5b3c40b2bf563ddfdab22 Author: Markus Schneider-Pargmann Date: Mon Sep 18 12:07:06 2023 +0200 thermal/drivers/mediatek: Fix probe for THERMAL_V2 Fix the probe function to call mtk_thermal_release_periodic_ts for everything != MTK_THERMAL_V1. This was accidentally changed from V1 to V2 in the original patch. Reported-by: Frank Wunderlich Closes: https://lore.kernel.org/lkml/B0B3775B-B8D1-4284-814F-4F41EC22F532@public-files.de/ Reported-by: Daniel Lezcano Closes: https://lore.kernel.org/lkml/07a569b9-e691-64ea-dd65-3b49842af33d@linaro.org/ Fixes: 33140e668b10 ("thermal/drivers/mediatek: Control buffer enablement tweaks") Signed-off-by: Markus Schneider-Pargmann Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230918100706.1229239-1-msp@baylibre.com commit f7749a549b4f4db0c02e6b3d3800ea400dd76c12 Author: Thomas Hellström Date: Tue Oct 10 16:27:24 2023 +0200 drm/gpuvm: Dual-licence the drm_gpuvm code GPL-2.0 OR MIT Dual-licence in order to make it possible for other non-GPL os'es to re-implement the code. The use of EXPORT_SYMBOL_GPL() is intentionally left untouched to prevent use of drm_gpuvm as a proxy for non-GPL drivers to access GPL-only kernel symbols. Much of the ideas and algorithms used in the drm_gpuvm code is already present in one way or another in MIT-licensed code. Cc: Danilo Krummrich Cc: airlied@gmail.com Cc: daniel@ffwll.ch Cc: linux-kernel@vger.kernel.org Signed-off-by: Thomas Hellström Acked-by: Danilo Krummrich Reviewed-by: Francois Dugast Link: https://patchwork.freedesktop.org/patch/msgid/20231010142725.8920-1-thomas.hellstrom@linux.intel.com commit 6c29e29e4d7f29348a9e051ad5bdb833c5a1bbb6 Author: Dan Carpenter Date: Thu Oct 12 12:41:12 2023 +0300 PM / devfreq: mediatek: unlock on error in mtk_ccifreq_target() Call mutex_unlock(&drv->reg_lock) before returning the error code. Link: https://lore.kernel.org/all/1bada9b2-d276-4123-bfdf-03d165569543@moroto.mountain/ Fixes: d2805601988f ("PM / devfreq: mediatek: protect oop in critical session") Signed-off-by: Dan Carpenter Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Chanwoo Choi commit b3edc3463d64bc469162138a6bec6913fbeef931 Author: Stanley Chang Date: Mon Oct 16 13:35:04 2023 +0800 extcon: realtek: add the error handler for nvmem_cell_read There are following smatch warning: drivers/extcon/extcon-rtk-type-c.c:905 __updated_type_c_parameter_by_efuse() error: 'buf' dereferencing possible ERR_PTR() The nvmem_cell_read may fail to read. So, driver must handle failure cases. Link: https://lore.kernel.org/all/20231016053510.28881-1-stanley_chang@realtek.com/ Fixes: 8a590d7371f0 ("extcon: add Realtek DHC RTD SoC Type-C driver") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/a469dd51-f5d5-4e8f-ba36-6c7cea046fb8@moroto.mountain/ Signed-off-by: Stanley Chang Signed-off-by: Chanwoo Choi commit 6f2eeef4a0aa9791bbba9d353641a6e067bb86c1 Author: Thomas Hellström Date: Thu Oct 12 15:25:52 2023 +0200 Documentation/gpu: Add a VM_BIND async document Add a motivation for and description of asynchronous VM_BIND operation v2: - Fix typos (Nirmoy Das) - Improve the description of a memory fence (Oak Zeng) - Add a reference to the document in the Xe RFC. - Add pointers to sample uAPI suggestions v3: - Address review comments (Danilo Krummrich) - Formatting fixes v4: - Address typos (Francois Dugast) - Explain why in-fences are not allowed for VM_BIND operations for long- running workloads (Matthew Brost) v5: - More typo- and style fixing - Further clarify the implications of disallowing in-fences for VM_BIND operations for long-running workloads (Matthew Brost) v6: - Point out that a gpu_vm is a virtual GPU Address space. (Danilo Krummrich) - For an explanation of dma-fences point to the dma-fence documentation. (Paulo Zanoni) - Clarify that VM_BIND errors are reported synchronously. (Paulo Zanoni) - Use an rst doc reference when pointing to the async vm_bind document from the xe merge plan. - Add the VM_BIND documentation to the drm documentation table-of-content, using an intermediate "Misc DRM driver uAPI- and feature implementation guidelines" v7: - Update the error handling documentation to remove the VM error state. v8: - Clarify error handling and difference in operation support between async VM_BIND and sync VM_BIND. (Paulo Zanoni) - Update the sample uAPI with a self-contained example. (Paulo Zanoni) Cc: Paulo R Zanoni Signed-off-by: Thomas Hellström Acked-by: Nirmoy Das Reviewed-by: Danilo Krummrich Reviewed-by: Matthew Brost Reviewed-by: Rodrigo Vivi Reviewed-by: Paulo Zanoni Link: https://patchwork.freedesktop.org/patch/msgid/20231012132552.20196-1-thomas.hellstrom@linux.intel.com commit 1e3c8526918403a4cebbd67bcd18443bf68df939 Author: Tony Lindgren Date: Thu Oct 12 09:42:57 2023 +0300 printk: Constify name for add_preferred_console() While adding a preferred console handling for serial_core for serial port hardware based device addressing, Jiri suggested we constify name for add_preferred_console(). The name gets copied anyways. This allows serial core to add a preferred console using serial drv->dev_name without copying it. Note that constifying options causes changes all over the place because of struct console for match(). Suggested-by: Jiri Slaby Reviewed-by: Petr Mladek Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20231012064300.50221-2-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 545a4f89cad5bd349522d17558b3a4208648e20e Author: Tony Lindgren Date: Thu Oct 12 09:42:56 2023 +0300 printk: Check valid console index for preferred console Let's check for valid console index values for preferred console to avoid bogus console index numbers from kernel command line. Let's also return an error for negative index numbers for the preferred console. Unlike for device drivers, a negative index is not valid for the preferred console. Let's also constify idx while at it. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20231012064300.50221-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit a07b50d80ab621f4f18d429068a43cffec26691f Author: Arnd Bergmann Date: Mon Oct 9 23:18:44 2023 +0200 hyperv: avoid dependency on screen_info The two hyperv framebuffer drivers (hyperv_fb or hyperv_drm_drv) access the global screen_info in order to take over from the sysfb framebuffer, which in turn could be handled by simplefb, simpledrm or efifb. Similarly, the vmbus_drv code marks the original EFI framebuffer as reserved, but this is not required if there is no sysfb. As a preparation for making screen_info itself more local to the sysfb helper code, add a compile-time conditional in all three files that relate to hyperv fb and just skip this code if there is no sysfb that needs to be unregistered. Reviewed-by: Javier Martinez Canillas Acked-by: Helge Deller Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231009211845.3136536-9-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit b858a97bf0533eb94c6fd8a307df74a3e59a6bd2 Author: Arnd Bergmann Date: Mon Oct 9 23:18:43 2023 +0200 vga16fb: drop powerpc support I noticed that commit 0db5b61e0dc07 ("fbdev/vga16fb: Create EGA/VGA devices in sysfb code") broke vga16fb on non-x86 platforms, because the sysfb code never creates a vga-framebuffer device when screen_info.orig_video_isVGA is set to '1' instead of VIDEO_TYPE_VGAC. However, it turns out that the only architecture that has allowed building vga16fb in the past 20 years is powerpc, and this only worked on two 32-bit platforms and never on 64-bit powerpc. The last machine that actually used this was removed in linux-3.10, so this is all dead code and can be removed. The big-endian support in vga16fb.c could also be removed, but I'd just leave this in place. Fixes: 933ee7119fb14 ("powerpc: remove PReP platform") Reviewed-by: Javier Martinez Canillas Acked-by: Helge Deller Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231009211845.3136536-8-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 555624c0d10bf09c62c45a86a47e752013f86fb5 Author: Arnd Bergmann Date: Mon Oct 9 23:18:42 2023 +0200 vgacon: clean up global screen_info instances To prepare for completely separating the VGA console screen_info from the one used in EFI/sysfb, rename the vgacon instances and make them local as much as possible. ia64 and arm both have confurations with vgacon and efi, but the contents never overlaps because ia64 has no EFI framebuffer, and arm only has vga console on legacy platforms without EFI. Renaming these is required before the EFI screen_info can be moved into drivers/firmware. The ia64 vga console is actually registered in two places from setup_arch(), but one of them is wrong, so drop the one in pcdp.c and fix the one in setup.c to use the correct conditional. x86 has to keep them together, as the boot protocol is used to switch between VGA text console and framebuffer through the screen_info data. Acked-by: Javier Martinez Canillas Acked-by: Khalid Aziz Acked-by: Helge Deller Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231009211845.3136536-7-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit acfc788233263fee9413434d39d4201a8de592ba Author: Arnd Bergmann Date: Mon Oct 9 23:18:41 2023 +0200 vgacon: remove screen_info dependency The vga console driver is fairly self-contained, and only used by architectures that explicitly initialize the screen_info settings. Chance every instance that picks the vga console by setting conswitchp to call a function instead, and pass a reference to the screen_info there. Reviewed-by: Javier Martinez Canillas Acked-by: Khalid Azzi Acked-by: Helge Deller Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231009211845.3136536-6-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit fd90410e9d74f3ff2361c7bd44c67f712fc5f588 Author: Arnd Bergmann Date: Mon Oct 9 23:18:40 2023 +0200 vgacon, arch/*: remove unused screen_info definitions A number of architectures either kept the screen_info definition for historical purposes as it used to be required by the generic VT code, or they copied it from another architecture in order to build the VGA console driver in an allmodconfig build. The mips definition is used by some platforms, but the initialization on jazz is not needed. Now that vgacon no longer builds on these architectures, remove the stale definitions and initializations. Reviewed-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Reviewed-by: Philippe Mathieu-Daudé Acked-by: Dinh Nguyen Acked-by: Max Filippov Acked-by: Palmer Dabbelt Acked-by: Guo Ren Acked-by: Helge Deller Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231009211845.3136536-5-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 4293b09251490fe493c3fc5e0d3de7168fe70039 Author: Arnd Bergmann Date: Mon Oct 9 23:18:39 2023 +0200 dummycon: limit Arm console size hack to footbridge The dummycon default console size used to be determined by architecture, but now this is a Kconfig setting on everything except ARM. Tracing this back in the historic git trees, this was used to match the size of VGA console or VGA framebuffer on early machines, but nowadays that code is no longer used, except probably on the old footbridge/netwinder since that is the only one that supports vgacon. On machines with a framebuffer, booting with DT so far results in always using the hardcoded 80x30 size in dummycon, while on ATAGS the setting can come from a bootloader specific override. Both seem to be worse choices than the Kconfig setting, since the actual text size for fbcon also depends on the selected font. Make this work the same way as everywhere else and use the normal Kconfig setting, except for the footbridge with vgacon, which keeps using the traditional code. If vgacon is disabled, footbridge can also ignore the setting. This means the screen_info only has to be provided when either vgacon or EFI are enabled now. To limit the amount of surprises on Arm, change the Kconfig default to the previously used 80x30 setting instead of the usual 80x25. Reviewed-by: Thomas Zimmermann Tested-by: Linus Walleij Reviewed-by: Javier Martinez Canillas Acked-by: Helge Deller Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231009211845.3136536-4-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 8a736ddfc861b2a217c935c2f461a8004add8247 Author: Arnd Bergmann Date: Mon Oct 9 23:18:38 2023 +0200 vgacon: rework screen_info #ifdef checks On non-x86 architectures, the screen_info variable is generally only used for the VGA console where supported, and in some cases the EFI framebuffer or vga16fb. Now that we have a definite list of which architectures actually use it for what, use consistent #ifdef checks so the global variable is only defined when it is actually used on those architectures. Loongarch and riscv have no support for vgacon or vga16fb, but they support EFI firmware, so only that needs to be checked, and the initialization can be removed because that is handled by EFI. IA64 has both vgacon and EFI, though EFI apparently never uses a framebuffer here. Reviewed-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Reviewed-by: Khalid Aziz Acked-by: Helge Deller Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20231009211845.3136536-3-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit e9e3300b6e77165c74d9b2edba5596f2463af2e4 Author: Arnd Bergmann Date: Mon Oct 9 23:18:37 2023 +0200 vgacon: rework Kconfig dependencies The list of dependencies here is phrased as an opt-out, but this is missing a lot of architectures that don't actually support VGA consoles, and some of the entries are stale: - powerpc used to support VGA consoles in the old arch/ppc codebase, but the merged arch/powerpc never did - arm lists footbridge, integrator and netwinder, but netwinder is actually part of footbridge, and integrator does not appear to have an actual VGA hardware, or list it in its ATAG or DT. - mips has a few platforms (malta, sibyte, and sni) that initialize screen_info, on everything else the console is selected but cannot actually work. - csky, hexgagon, loongarch, nios2, riscv and xtensa are not listed in the opt-out table and declare a screen_info to allow building vga_con, but this cannot work because the console is never selected. Replace this with an opt-in table that lists only the platforms that remain. This is effectively x86, plus a couple of historic workstation and server machines that reused parts of the x86 system architecture. Reviewed-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Reviewed-by: Khalid Aziz Acked-by: Helge Deller Signed-off-by: Arnd Bergmann Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20231009211845.3136536-2-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 2a1d728f20edeee7f26dc307ed9df4e0d23947ab Author: Pavel Krasavin Date: Sat Oct 14 11:39:26 2023 +0000 tty: serial: meson: fix hard LOCKUP on crtscts mode There might be hard lockup if we set crtscts mode on port without RTS/CTS configured: # stty -F /dev/ttyAML6 crtscts; echo 1 > /dev/ttyAML6; echo 2 > /dev/ttyAML6 [ 95.890386] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: [ 95.890857] rcu: 3-...0: (201 ticks this GP) idle=e33c/1/0x4000000000000000 softirq=5844/5846 fqs=4984 [ 95.900212] rcu: (detected by 2, t=21016 jiffies, g=7753, q=296 ncpus=4) [ 95.906972] Task dump for CPU 3: [ 95.910178] task:bash state:R running task stack:0 pid:205 ppid:1 flags:0x00000202 [ 95.920059] Call trace: [ 95.922485] __switch_to+0xe4/0x168 [ 95.925951] 0xffffff8003477508 [ 95.974379] watchdog: Watchdog detected hard LOCKUP on cpu 3 [ 95.974424] Modules linked in: 88x2cs(O) rtc_meson_vrtc Possible solution would be to not allow to setup crtscts on such port. Tested on S905X3 based board. Fixes: ff7693d079e5 ("ARM: meson: serial: add MesonX SoC on-chip uart driver") Cc: stable@vger.kernel.org Signed-off-by: Pavel Krasavin Reviewed-by: Neil Armstrong Reviewed-by: Dmitry Rokosov v6: stable tag added v5: https://lore.kernel.org/lkml/OF43DA36FF.2BD3BB21-ON00258A47.005A8125-00258A47.005A9513@gdc.ru/ added missed Reviewed-by tags, Fixes tag added according to Dmitry and Neil notes v4: https://lore.kernel.org/lkml/OF55521400.7512350F-ON00258A47.003F7254-00258A47.0040E15C@gdc.ru/ More correct patch subject according to Jiri's note v3: https://lore.kernel.org/lkml/OF6CF5FFA0.CCFD0E8E-ON00258A46.00549EDF-00258A46.0054BB62@gdc.ru/ "From:" line added to the mail v2: https://lore.kernel.org/lkml/OF950BEF72.7F425944-ON00258A46.00488A76-00258A46.00497D44@gdc.ru/ braces for single statement removed according to Dmitry's note v1: https://lore.kernel.org/lkml/OF28B2B8C9.5BC0CD28-ON00258A46.0037688F-00258A46.0039155B@gdc.ru/ Link: https://lore.kernel.org/r/OF66360032.51C36182-ON00258A48.003F656B-00258A48.0040092C@gdc.ru Signed-off-by: Greg Kroah-Hartman commit 08057253366d916a73e62bafb913d9b659228cc1 Merge: 614351f41e8c5 4db74c0fdeb81 Author: Dave Airlie Date: Tue Oct 17 18:07:53 2023 +1000 Merge tag 'drm-habanalabs-next-2023-10-10' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux into drm-next This tag contains habanalabs driver changes for v6.7. The notable changes are: - uAPI changes: - Expose tsc clock sampling to better sync clock information in profiler. - Enhance engine error reporting in the info ioctl. - Block access to the eventfd operations through the control device. - Disable the option of the user to register multiple times with the same offset for timestamp dump by the driver. If a user wants to use the same offset in the timestamp buffer for different interrupt, it needs to first de-register the offset. - When exporting dma-buf (for p2p), force the user to specify size/offset in multiples of PAGE_SIZE. This is instead of the driver doing the rounding to PAGE_SIZE, which has caused the driver to map more memory than was intended by the user. - New features and improvements: - Complete the move of the driver to the accel subsystem by removing the custom habanalabs class and major and registering to accel subsystem. - Move the firmware interface files to include/linux/habanalabs. This is a pre-requisite for upstreaming the NIC drivers of Gaudi (as they need to include those files). - Perform device hard-reset upon PCIe AXI drain event to prevent the failure from cascading to different IP blocks in the SoC. In secured environments, this is done automatically by the firmware. - Print device name when it is removed for better debuggability. - Add support for trace of dma map sgtable operations. - Optimize handling of user interrupts by splitting the interrupts to two lists. One list for fast handling and second list for handling with timestamp recording, which is slower. - Prevent double device hard-reset due to 2 adjacent H/W events. - Set device status 'malfunction' while in rmmod. - Firmware related fixes: - Extend preboot timeout because preboot loading might take longer than expected in certain cases. - Add a protection mechanism for the Event Queue. In case it is full, the firmware will be able to notify about it through a dedicated interrupt. - Perform device hard-reset in case scrubbing of memory has failed. - Bug fixes and code cleanups: - Small fixes of dma-buf handling in Gaudi2, such as handling an offset != 0, using the correct exported size, creation of sg table. - Fix spmu mask creation. - Fix bug in wait for cs completion for decoder workloads. - Cleanup Greco name from documentation. - Fix bug in recording timestamp during cs completion interrupt handling. - Fix CoreSight ETF configuration and flush logic. - Fix small bug in hpriv_list handling (the list that contains the private data per process that opens our device). Signed-off-by: Dave Airlie # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCgAdFiEE7TEboABC71LctBLFZR1NuKta54AFAmUlHoQACgkQZR1NuKta # 54DsXQf8CW+W4iWJf5UDTj/E/giu9rVRrsUsU0hhCcXbecIxRsLObYXtulENu5/u # VuEAo/tAvo0LUKi8pdIv6ernDKaxZ1+fimlfXMCzllAA/ts3yp1NgunprsIsx3tv # YgcJ2GNR8UlVZ1qYuZl+4dOTyD0yfRMROUXBe7wqKnUXOEepOiLBxq6W15tZiJnx # L+V0yGkNk6pAoADIXLW9EgEXiN/bJZCXGPWp06i/Nz7cHIHJGoV59wAqftqllCtk # 8ZMkLByjlQKPhc5AgWBtKE8EGVip3sm7b/Q2Gq0ZXdZiebyVJ+AjuuDOdtq1UCIw # Rcp2576E7rByIBu3RAFlrioWhuR5Zw== # =2ien # -----END PGP SIGNATURE----- # gpg: Signature made Tue 10 Oct 2023 19:51:00 AEST # gpg: using RSA key ED311BA00042EF52DCB412C5651D4DB8AB5AE780 # gpg: Can't check signature: No public key From: Oded Gabbay Link: https://patchwork.freedesktop.org/patch/msgid/ZSUfiX4J7v4Wn0cU@ogabbay-vm-u22.habana-labs.com commit d3b614d993781afca1832bd2cbc39da64306d0ba Author: Edson Juliano Drosdeck Date: Mon Oct 16 15:29:10 2023 -0300 platform/x86: acer-wmi: Remove void function return Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: void function return statements are not generally useful Signed-off-by: Edson Juliano Drosdeck Link: https://lore.kernel.org/r/20231016182910.3344-1-edson.drosdeck@gmail.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 5ea4911359a534ffe95e7158b4d1c7ccb2f73b17 Author: Viresh Kumar Date: Fri Oct 13 09:12:19 2023 +0530 OPP: No need to defer probe from _opp_attach_genpd() When the new interface for attaching genpd's via the OPP core was added, it was possible for required_opp_count to be zero, but not anymore. Remove the unused check. Signed-off-by: Viresh Kumar Reviewed-by: Ulf Hansson commit 48b5aaec596d9a2a22c97a1e2aa56103e0c72d38 Author: Viresh Kumar Date: Thu Oct 12 11:50:59 2023 +0530 OPP: Remove genpd_virt_dev_lock All the config operations for OPP tables share common code paths now and none of the other ones have such protection in place. Either all should have it or none. The understanding here is that user won't clear the OPP configs while still using them and so such a case won't happen. We can always come back and use a wider lock for all resource types if required. Also fix the error on failing to allocate memory. Signed-off-by: Viresh Kumar Reviewed-by: Ulf Hansson commit c2bebf98045f05b3ff596e060c8777b5356e4826 Author: Viresh Kumar Date: Fri Oct 13 11:04:38 2023 +0530 OPP: Reorder code in _opp_set_required_opps_genpd() Reorder code in _opp_set_required_opps_genpd() to reduce duplicate code. Signed-off-by: Viresh Kumar Reviewed-by: Ulf Hansson commit 15baf55481de700f8c4494cddb80ec4f4575548b Author: Eric Biggers Date: Sat Oct 14 23:10:55 2023 -0700 fscrypt: track master key presence separately from secret Master keys can be in one of three states: present, incompletely removed, and absent (as per FSCRYPT_KEY_STATUS_* used in the UAPI). Currently, the way that "present" is distinguished from "incompletely removed" internally is by whether ->mk_secret exists or not. With extent-based encryption, it will be necessary to allow per-extent keys to be derived while the master key is incompletely removed, so that I/O on open files will reliably continue working after removal of the key has been initiated. (We could allow I/O to sometimes fail in that case, but that seems problematic for reasons such as writes getting silently thrown away and diverging from the existing fscrypt semantics.) Therefore, when the filesystem is using extent-based encryption, ->mk_secret can't be wiped when the key becomes incompletely removed. As a prerequisite for doing that, this patch makes the "present" state be tracked using a new field, ->mk_present. No behavior is changed yet. The basic idea here is borrowed from Josef Bacik's patch "fscrypt: use a flag to indicate that the master key is being evicted" (https://lore.kernel.org/r/e86c16dddc049ff065f877d793ad773e4c6bfad9.1696970227.git.josef@toxicpanda.com). I reimplemented it using a "present" bool instead of an "evicted" flag, fixed a couple bugs, and tried to update everything to be consistent. Note: I considered adding a ->mk_status field instead, holding one of FSCRYPT_KEY_STATUS_*. At first that seemed nice, but it ended up being more complex (despite simplifying FS_IOC_GET_ENCRYPTION_KEY_STATUS), since it would have introduced redundancy and had weird locking rules. Reviewed-by: Neal Gompa Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20231015061055.62673-1-ebiggers@kernel.org Signed-off-by: Eric Biggers commit a3c2dd96487f1dd734c9443a3472c8dafa689813 Merge: 90de47f020db0 99c9991f4e5d7 Author: Jakub Kicinski Date: Mon Oct 16 21:05:32 2023 -0700 Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2023-10-16 We've added 90 non-merge commits during the last 25 day(s) which contain a total of 120 files changed, 3519 insertions(+), 895 deletions(-). The main changes are: 1) Add missed stats for kprobes to retrieve the number of missed kprobe executions and subsequent executions of BPF programs, from Jiri Olsa. 2) Add cgroup BPF sockaddr hooks for unix sockets. The use case is for systemd to reimplement the LogNamespace feature which allows running multiple instances of systemd-journald to process the logs of different services, from Daan De Meyer. 3) Implement BPF CPUv4 support for s390x BPF JIT, from Ilya Leoshkevich. 4) Improve BPF verifier log output for scalar registers to better disambiguate their internal state wrt defaults vs min/max values matching, from Andrii Nakryiko. 5) Extend the BPF fib lookup helpers for IPv4/IPv6 to support retrieving the source IP address with a new BPF_FIB_LOOKUP_SRC flag, from Martynas Pumputis. 6) Add support for open-coded task_vma iterator to help with symbolization for BPF-collected user stacks, from Dave Marchevsky. 7) Add libbpf getters for accessing individual BPF ring buffers which is useful for polling them individually, for example, from Martin Kelly. 8) Extend AF_XDP selftests to validate the SHARED_UMEM feature, from Tushar Vyavahare. 9) Improve BPF selftests cross-building support for riscv arch, from Björn Töpel. 10) Add the ability to pin a BPF timer to the same calling CPU, from David Vernet. 11) Fix libbpf's bpf_tracing.h macros for riscv to use the generic implementation of PT_REGS_SYSCALL_REGS() to access syscall arguments, from Alexandre Ghiti. 12) Extend libbpf to support symbol versioning for uprobes, from Hengqi Chen. 13) Fix bpftool's skeleton code generation to guarantee that ELF data is 8 byte aligned, from Ian Rogers. 14) Inherit system-wide cpu_mitigations_off() setting for Spectre v1/v4 security mitigations in BPF verifier, from Yafang Shao. 15) Annotate struct bpf_stack_map with __counted_by attribute to prepare BPF side for upcoming __counted_by compiler support, from Kees Cook. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (90 commits) bpf: Ensure proper register state printing for cond jumps bpf: Disambiguate SCALAR register state output in verifier logs selftests/bpf: Make align selftests more robust selftests/bpf: Improve missed_kprobe_recursion test robustness selftests/bpf: Improve percpu_alloc test robustness selftests/bpf: Add tests for open-coded task_vma iter bpf: Introduce task_vma open-coded iterator kfuncs selftests/bpf: Rename bpf_iter_task_vma.c to bpf_iter_task_vmas.c bpf: Don't explicitly emit BTF for struct btf_iter_num bpf: Change syscall_nr type to int in struct syscall_tp_t net/bpf: Avoid unused "sin_addr_len" warning when CONFIG_CGROUP_BPF is not set bpf: Avoid unnecessary audit log for CPU security mitigations selftests/bpf: Add tests for cgroup unix socket address hooks selftests/bpf: Make sure mount directory exists documentation/bpf: Document cgroup unix socket address hooks bpftool: Add support for cgroup unix socket address hooks libbpf: Add support for cgroup unix socket address hooks bpf: Implement cgroup sockaddr hooks for unix sockets bpf: Add bpf_sock_addr_set_sun_path() to allow writing unix sockaddr from bpf bpf: Propagate modified uaddrlen from cgroup sockaddr programs ... ==================== Link: https://lore.kernel.org/r/20231016204803.30153-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 614351f41e8c557068f1898eef5bacbca3b20911 Merge: 7971debdfd37f 039adf3947252 Author: Dave Airlie Date: Tue Oct 17 13:46:21 2023 +1000 Merge tag 'drm-intel-gt-next-2023-10-12' of git://anongit.freedesktop.org/drm/drm-intel into drm-next Driver Changes: Fixes/improvements/new stuff: - Register engines early to avoid type confusion (Mathias Krause) - Suppress 'ignoring reset notification' message [guc] (John Harrison) - Update 'recommended' version to 70.12.1 for DG2/ADL-S/ADL-P/MTL [guc] (John Harrison) - Enable WA 14018913170 [guc, dg2] (Daniele Ceraolo Spurio) Future platform enablement: - Clean steer semaphore on resume (Nirmoy Das) - Skip MCR ops for ring fault register [mtl] (Nirmoy Das) - Make i915_gem_shrinker multi-gt aware [gem] (Jonathan Cavitt) - Enable GGTT updates with binder in MTL (Nirmoy Das, Chris Wilson) - Invalidate the TLBs on each GT (Chris Wilson) Miscellaneous: - Clarify type evolution of uabi_node/uabi_engines (Mathias Krause) - Annotate struct ct_incoming_msg with __counted_by [guc] (Kees Cook) - More use of GT specific print helpers [gt] (John Harrison) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/ZSfKotZVdypU6NaX@tursulin-desk commit 90de47f020db086f7929e09f64efd0cf627d6869 Author: Yunsheng Lin Date: Fri Oct 13 14:48:21 2023 +0800 page_pool: fragment API support for 32-bit arch with 64-bit DMA Currently page_pool_alloc_frag() is not supported in 32-bit arch with 64-bit DMA because of the overlap issue between pp_frag_count and dma_addr_upper in 'struct page' for those arches, which seems to be quite common, see [1], which means driver may need to handle it when using fragment API. It is assumed that the combination of the above arch with an address space >16TB does not exist, as all those arches have 64b equivalent, it seems logical to use the 64b version for a system with a large address space. It is also assumed that dma address is page aligned when we are dma mapping a page aligned buffer, see [2]. That means we're storing 12 bits of 0 at the lower end for a dma address, we can reuse those bits for the above arches to support 32b+12b, which is 16TB of memory. If we make a wrong assumption, a warning is emitted so that user can report to us. 1. https://lore.kernel.org/all/20211117075652.58299-1-linyunsheng@huawei.com/ 2. https://lore.kernel.org/all/20230818145145.4b357c89@kernel.org/ Tested-by: Alexander Lobakin Signed-off-by: Yunsheng Lin CC: Lorenzo Bianconi CC: Alexander Duyck CC: Liang Chen CC: Guillaume Tucker CC: Matthew Wilcox CC: Linux-MM Link: https://lore.kernel.org/r/20231013064827.61135-2-linyunsheng@huawei.com Signed-off-by: Jakub Kicinski commit 2bbeb8d12404cf0603f513fc33269ef9abfbb396 Author: Douglas Gilbert Date: Sun Oct 15 01:06:50 2023 -0400 scsi: core: Handle depopulation and restoration in progress The default handling of the NOT READY sense key is to wait for the device to become ready. The "wait" is assumed to be relatively short. However there is a sub-class of NOT READY that have the "... in progress" phrase in their additional sense code and these can take much longer. Following on from commit 505aa4b6a883 ("scsi: sd: Defer spinning up drive while SANITIZE is in progress") we now have element depopulation and restoration that can take a long time. For example, over 24 hours for a 20 TB, 7200 rpm hard disk to depopulate 1 of its 20 elements. Add handling of ASC/ASCQ: 0x4,0x24 (depopulation in progress) and ASC/ASCQ: 0x4,0x25 (depopulation restoration in progress) to sd.c . The scsi_lib.c has incomplete handling of these two messages, so complete it. Signed-off-by: Douglas Gilbert Link: https://lore.kernel.org/r/20231015050650.131145-1-dgilbert@interlog.com Signed-off-by: Martin K. Petersen commit 72208ebe181e38678dce753354233acf0cc5422b Author: Manivannan Sadhasivam Date: Thu Oct 12 22:51:27 2023 +0530 scsi: ufs: core: Add support for parsing OPP OPP framework can be used to scale the clocks along with other entities such as regulators, performance state etc... So let's add support for parsing OPP from devicetree. OPP support in devicetree is added through the "operating-points-v2" property which accepts the OPP table defining clock frequency, regulator voltage, power domain performance state etc... Since the UFS controller requires multiple clocks to be controlled for proper working, devm_pm_opp_set_config() has been used which supports scaling multiple clocks through custom ufshcd_opp_config_clks() callback. It should be noted that the OPP support is not compatible with the old "freq-table-hz" property. So only one can be used at a time even though the UFS core supports both. Co-developed-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20231012172129.65172-4-manivannan.sadhasivam@linaro.org Signed-off-by: Martin K. Petersen commit 930bd77ebe3dc23b18aa49e55e6a515d5663d67a Author: Manivannan Sadhasivam Date: Thu Oct 12 22:51:26 2023 +0530 scsi: ufs: core: Add OPP support for scaling clocks and regulators UFS core is only scaling the clocks during devfreq scaling and initialization. But for an optimum power saving, regulators should also be scaled along with the clocks. So let's use the OPP framework which supports scaling clocks, regulators, and performance state using OPP table defined in devicetree. For accomodating the OPP support, the existing APIs (ufshcd_scale_clks, ufshcd_is_devfreq_scaling_required and ufshcd_devfreq_scale) are modified to accept "freq" as an argument which in turn used by the OPP helpers. The OPP support is added along with the old freq-table based clock scaling so that the existing platforms work as expected. Co-developed-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20231012172129.65172-3-manivannan.sadhasivam@linaro.org Signed-off-by: Martin K. Petersen commit e820de1d115fa52c792c78937e11661bd9165465 Author: Krzysztof Kozlowski Date: Thu Oct 12 22:51:25 2023 +0530 scsi: ufs: dt-bindings: common: Add OPP table Except scaling UFS and bus clocks, it's necessary to scale also the voltages of regulators or power domain performance state levels. Adding Operating Performance Points table allows to adjust power domain performance state, depending on the UFS clock speed. OPPv2 deprecates previous property limited to clock scaling: freq-table-hz. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20231012172129.65172-2-manivannan.sadhasivam@linaro.org Signed-off-by: Martin K. Petersen commit 058676b513f6608819ead505ac4f4a59836a6287 Merge: af46076d6640a 573c2d066eb95 Author: Martin K. Petersen Date: Mon Oct 16 20:51:40 2023 -0400 Merge patch series "scsi: scsi_debug: Add error injection for single device" Wenchao Hao says: The original error injection mechanism was based on scsi_host which could not inject fault for a single SCSI device. This patchset provides the ability to inject errors for a single SCSI device. Now we support inject timeout errors, queuecommand errors, and hostbyte, driverbyte, statusbyte, and sense data for specific SCSI Command. Two new error injection is defined to make abort command or reset LUN failed. Besides error injection for single device, this patchset add a new interface to make reset target failed for each scsi_target. The first two patch add a debugfs interface to add and inquiry single device's error injection info; the third patch defined how to remove an injection which has been added. The following 5 patches use the injection info and generate the related error type. The last two just add a new interface to make reset target failed and control scsi_device's allow_restart flag. Link: https://lore.kernel.org/r/20231010092051.608007-1-haowenchao2@huawei.com Signed-off-by: Martin K. Petersen commit 573c2d066eb950dd9bd6e8735d3a859bbc21b3cc Author: Wenchao Hao Date: Tue Oct 10 17:20:51 2023 +0800 scsi: scsi_debug: Add param to control sdev's allow_restart Add new module param "allow_restart" to control scsi_device's allow_restart flag. This flag determines if EH is triggered after a command completes with sense_key 0x6, ASC 0x4 and ASCQ 0x2. EH would be triggered if allow_restart=1 in this condition. The new param can be used with the error injection capability to test how commands completing with sense_key 0x6, ASC 0x4 and ASCQ 0x2 are handled. Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231010092051.608007-11-haowenchao2@huawei.com Tested-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit f084fe52c640775de51056670f568ec7104b922a Author: Wenchao Hao Date: Tue Oct 10 17:20:50 2023 +0800 scsi: scsi_debug: Add debugfs interface to fail target reset The interface is found at /sys/kernel/debug/scsi_debug/target/fail_reset where identifies the target to inject errors on. It's a simple bool type interface which would make this target's reset fail if set to 'Y'. Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231010092051.608007-10-haowenchao2@huawei.com Signed-off-by: Martin K. Petersen commit 0267811625e13a7743eeb6072b57509bf909f484 Author: Wenchao Hao Date: Tue Oct 10 17:20:49 2023 +0800 scsi: scsi_debug: Add new error injection type: Reset LUN failed Add error injection type 4 to make scsi_debug_device_reset() return FAILED. Fail abort command format: +--------+------+-------------------------------------------------------+ | Column | Type | Description | +--------+------+-------------------------------------------------------+ | 1 | u8 | Error type, fixed to 0x4 | +--------+------+-------------------------------------------------------+ | 2 | s32 | Error count | | | | 0: this rule will be ignored | | | | positive: the rule will always take effect | | | | negative: the rule takes effect n times where -n is | | | | the value given. Ignored after n times | +--------+------+-------------------------------------------------------+ | 3 | x8 | SCSI command opcode, 0xff for all commands | +--------+------+-------------------------------------------------------+ Examples: error=/sys/kernel/debug/scsi_debug/0:0:0:1/error echo "4 -10 0x12" > ${error} will make the device return FAILED when trying to reset LUN with inquiry command 10 times. error=/sys/kernel/debug/scsi_debug/0:0:0:1/error echo "4 -10 0xff" > ${error} will make the device return FAILED when trying to reset LUN 10 times. Usually we do not care about what command it is when trying to perform reset LUN, so 0xff could be applied. Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231010092051.608007-9-haowenchao2@huawei.com Tested-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit 5551ce928805ba790db0fa0a895e207d5d05717d Author: Wenchao Hao Date: Tue Oct 10 17:20:48 2023 +0800 scsi: scsi_debug: Add new error injection type: Abort Failed Add error injection type 3 to make scsi_debug_abort() return FAILED. Fail abort command format: +--------+------+-------------------------------------------------------+ | Column | Type | Description | +--------+------+-------------------------------------------------------+ | 1 | u8 | Error type, fixed to 0x3 | +--------+------+-------------------------------------------------------+ | 2 | s32 | Error count | | | | 0: this rule will be ignored | | | | positive: the rule will always take effect | | | | negative: the rule takes effect n times where -n is | | | | the value given. Ignored after n times | +--------+------+-------------------------------------------------------+ | 3 | x8 | SCSI command opcode, 0xff for all commands | +--------+------+-------------------------------------------------------+ Examples: error=/sys/kernel/debug/scsi_debug/0:0:0:1/error echo "3 -10 0x12" > ${error} will make the device return FAILED when aborting inquiry command 10 times. Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231010092051.608007-8-haowenchao2@huawei.com Tested-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit 33592274321eab2e35e2fdf01857c722431fcf8f Author: Wenchao Hao Date: Tue Oct 10 17:20:47 2023 +0800 scsi: scsi_debug: Set command result and sense data if error is injected If a fail command error is injected, set the command's status and sense data then finish this SCSI command. Set SCSI command's status and sense data format: +--------+------+-------------------------------------------------------+ | Column | Type | Description | +--------+------+-------------------------------------------------------+ | 1 | u8 | Error type, fixed to 0x2 | +--------+------+-------------------------------------------------------+ | 2 | s32 | Error Count | | | | 0: the rule will be ignored | | | | positive: the rule will always take effect | | | | negative: the rule takes effect n times where -n is | | | | the value given. Ignored after n times | +--------+------+-------------------------------------------------------+ | 3 | x8 | SCSI command opcode, 0xff for all commands | +--------+------+-------------------------------------------------------+ | 4 | x8 | Host byte in scsi_cmd::status | | | | [scsi_cmd::status has 32 bits holding these 3 bytes] | +--------+------+-------------------------------------------------------+ | 5 | x8 | Driver byte in scsi_cmd::status | +--------+------+-------------------------------------------------------+ | 6 | x8 | SCSI Status byte in scsi_cmd::status | +--------+------+-------------------------------------------------------+ | 7 | x8 | SCSI Sense Key in scsi_cmnd | +--------+------+-------------------------------------------------------+ | 8 | x8 | SCSI ASC in scsi_cmnd | +--------+------+-------------------------------------------------------+ | 9 | x8 | SCSI ASCQ in scsi_cmnd | +--------+------+-------------------------------------------------------+ Examples: error=/sys/kernel/debug/scsi_debug/0:0:0:1/error echo "2 -10 0x88 0 0 0x2 0x3 0x11 0x0" >${error} will make device's read command return with media error with additional sense of "Unrecovered read error" (UNC): Acked-by: Douglas Gilbert Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231010092051.608007-7-haowenchao2@huawei.com Signed-off-by: Martin K. Petersen commit 33bccf55c20b66dfca6644c8dc9b396cec82e85c Author: Wenchao Hao Date: Tue Oct 10 17:20:46 2023 +0800 scsi: scsi_debug: Return failed value if error is injected If a fail queuecommand error is injected, return the failed value defined in the rule from queuecommand. Make queuecommand return format: +--------+------+-------------------------------------------------------+ | Column | Type | Description | +--------+------+-------------------------------------------------------+ | 1 | u8 | Error type, fixed to 0x1 | +--------+------+-------------------------------------------------------+ | 2 | s32 | Error count | | | | 0: this rule will be ignored | | | | positive: the rule will always take effect | | | | negative: the rule takes effect n times where -n is | | | | the value given. Ignored after n times | +--------+------+-------------------------------------------------------+ | 3 | x8 | SCSI command opcode, 0xff for all commands | +--------+------+-------------------------------------------------------+ | 4 | x32 | The queuecommand() return value we want | +--------+------+-------------------------------------------------------+ Examples: error=/sys/kernel/debug/scsi_debug/0:0:0:1/error echo "1 1 0x12 0x1055" > ${error} will make each INQUIRY command sent to that device return 0x1055 (SCSI_MLQUEUE_HOST_BUSY). Acked-by: Douglas Gilbert Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231010092051.608007-6-haowenchao2@huawei.com Signed-off-by: Martin K. Petersen commit 32be8b6e22eb76a08c66414593ef02d5eb151be7 Author: Wenchao Hao Date: Tue Oct 10 17:20:45 2023 +0800 scsi: scsi_debug: Time out command if the error is injected If a timeout error is injected, return 0 from scsi_debug_queuecommand to make the command time out. Time out SCSI command format: +--------+------+-------------------------------------------------------+ | Column | Type | Description | +--------+------+-------------------------------------------------------+ | 1 | u8 | Error type, fixed to 0x0 | +--------+------+-------------------------------------------------------+ | 2 | s32 | Error count | | | | 0: this rule will be ignored | | | | positive: the rule will always take effect | | | | negative: the rule takes effect n times where -n is | | | | the value given. Ignored after n times | +--------+------+-------------------------------------------------------+ | 3 | x8 | SCSI command opcode, 0xff for all commands | +--------+------+-------------------------------------------------------+ Examples: error=/sys/kernel/debug/scsi_debug/0:0:0:1/error echo "0 -10 0x12" > ${error} will make the device's inquiry command time out 10 times. echo "0 1 0x12" > ${error} will make the device's inquiry time out each time it is invoked on this device. Acked-by: Douglas Gilbert Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231010092051.608007-5-haowenchao2@huawei.com Signed-off-by: Martin K. Petersen commit 962d77cd4c852e6a34ffd44fc5f32ba678e02633 Author: Wenchao Hao Date: Tue Oct 10 17:20:44 2023 +0800 scsi: scsi_debug: Define grammar to remove added error injection The grammar to remove error injection is a line with fixed 3 columns separated by spaces. First column is fixed to "-". It tells this is a removal operation. Second column is the error code to match. Third column is the scsi command to match. For example the following command would remove timeout injection of inquiry command: echo "- 0 0x12" > /sys/kernel/debug/scsi_debug/0:0:0:1/error Acked-by: Douglas Gilbert Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231010092051.608007-4-haowenchao2@huawei.com Signed-off-by: Martin K. Petersen commit a9996d722b1197b625acfa350dd2849e35ad6092 Author: Wenchao Hao Date: Tue Oct 10 17:20:43 2023 +0800 scsi: scsi_debug: Add interface to manage error injection for a single device This new facility uses the debugfs pseudo file system which is typically mounted under the /sys/kernel/debug directory and requires root permissions to access. The interface file is found at /sys/kernel/debug/scsi_debug//error where identifies the device (logical unit (LU)) to inject errors on. For the following description the ${error} environment variable is assumed to be set to/sys/kernel/debug/scsi_debug/1:0:0:0/error where 1:0:0:0 is a pseudo device (LU) owned by the scsi_debug driver. Rules are written to ${error} in the normal sysfs fashion (e.g. 'echo "0 -2 0x12" > ${error}'). More than one rule can be active on a device at a time and inactive rules (i.e. those whose error count is 0) remain in the rule listing. The existing rules can be read with 'cat ${error}' with oneline output for each rule. The interface format is line-by-line, each line is an error injection rule. Each rule contains integers separated by spaces, the first three columns correspond to "Error code", "Error count" and "SCSI command", other columns depend on Error code. General rule format: +--------+------+-------------------------------------------------------+ | Column | Type | Description | +--------+------+-------------------------------------------------------+ | 1 | u8 | Error code | | | | 0: timeout SCSI command | | | | 1: fail queuecommand, make queuecommand return | | | | given value | | | | 2: fail command, finish command with SCSI status, | | | | sense key and ASC/ASCQ values | | | | 3: make abort commands for specific command fail | | | | 4: make reset lun for specific command fail | +--------+------+-------------------------------------------------------+ | 2 | s32 | Error count | | | | 0: this rule will be ignored | | | | positive: the rule will always take effect | | | | negative: the rule takes effect n times where -n is | | | | the value given. Ignored after n times | +--------+------+-------------------------------------------------------+ | 3 | x8 | SCSI command opcode, 0xff for all commands | +--------+------+-------------------------------------------------------+ | ... | xxx | Error type specific fields | +--------+------+-------------------------------------------------------+ Notes: - When multiple error inject rules are added for the same SCSI command, the one with smaller error code will take effect (and the others will be ignored). - If the same error (i.e. same Error code and SCSI command) is added, the older one will be overwritten.. - Currently, the basic types are (u8/u16/u32/u64/s8/s16/s32/s64) and the hexadecimal types (x8/x16/x32/x64). - Where a hexadecimal value is expected (e.g. Column 3: SCSI command opcode) the "0x" prefix is optional on the value (e.g. the INQUIRY opcode can be given as '0x12' or '12'). - When the Error count is negative, reading ${error} will show that value incrementing, stopping when it gets to 0. Acked-by: Douglas Gilbert Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231010092051.608007-3-haowenchao2@huawei.com Signed-off-by: Martin K. Petersen commit 6e2d15f59b1cc6ed613b94e0969335a7868f04ca Author: Wenchao Hao Date: Tue Oct 10 17:20:42 2023 +0800 scsi: scsi_debug: Create scsi_debug directory in the debugfs filesystem Create directory scsi_debug in the root of the debugfs filesystem. Prepare to add interface for manage error injection. Acked-by: Douglas Gilbert Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231010092051.608007-2-haowenchao2@huawei.com Signed-off-by: Martin K. Petersen commit e411a8e3bb2d12a59d5fb3590863cb6a16f27b7a Author: Jacob Keller Date: Fri Oct 13 11:54:50 2023 -0700 net: stub tcp_gro_complete if CONFIG_INET=n A few networking drivers including bnx2x, bnxt, qede, and idpf call tcp_gro_complete as part of offloading TCP GRO. The function is only defined if CONFIG_INET is true, since its TCP specific and is meaningless if the kernel lacks IP networking support. The combination of trying to use the complex network drivers with CONFIG_NET but not CONFIG_INET is rather unlikely in practice: most use cases are going to need IP networking. The tcp_gro_complete function just sets some data in the socket buffer for use in processing the TCP packet in the event that the GRO was offloaded to the device. If the kernel lacks TCP support, such setup will simply go unused. The bnx2x, bnxt, and qede drivers wrap their TCP offload support in CONFIG_INET checks and skip handling on such kernels. The idpf driver did not check CONFIG_INET and thus fails to link if the kernel is configured with CONFIG_NET=y, CONFIG_IDPF=(m|y), and CONFIG_INET=n. While checking CONFIG_INET does allow the driver to bypass significantly more instructions in the event that we know TCP networking isn't supported, the configuration is unlikely to be used widely. Rather than require driver authors to care about this, stub the tcp_gro_complete function when CONFIG_INET=n. This allows drivers to be left as-is. It does mean the idpf driver will perform slightly more work than strictly necessary when CONFIG_INET=n, since it will still execute some of the skb setup in idpf_rx_rsc. However, that work would be performed in the case where CONFIG_INET=y anyways. I did not change the existing drivers, since they appear to wrap a significant portion of code when CONFIG_INET=n. There is little benefit in trashing these drivers just to unwrap and remove the CONFIG_INET check. Using a stub for tcp_gro_complete is still beneficial, as it means future drivers no longer need to worry about this case of CONFIG_NET=y and CONFIG_INET=n, which should reduce noise from buildbots that check such a configuration. Signed-off-by: Jacob Keller Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Link: https://lore.kernel.org/r/20231013185502.1473541-1-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski commit 97ddc25a368c7a6d18f5b3f93b4365c8f5e11ab0 Author: Muhammad Muzammil Date: Fri Oct 13 09:23:04 2023 +0500 drivers: net: wwan: wwan_core.c: resolved spelling mistake resolved typing mistake from devce to device Signed-off-by: Muhammad Muzammil Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231013042304.7881-1-m.muzzammilashraf@gmail.com Signed-off-by: Jakub Kicinski commit c60991f8e187eb73dbea2375c08ccba8f544bd49 Author: Liansen Zhai Date: Thu Oct 12 17:03:30 2023 +0800 cgroup, netclassid: on modifying netclassid in cgroup, only consider the main process. When modifying netclassid, the command("echo 0x100001 > net_cls.classid") will take more time on many threads of one process, because the process create many fds. for example, one process exists 28000 fds and 60000 threads, echo command will task 45 seconds. Now, we only consider the main process when exec "iterate_fd", and the time is about 52 milliseconds. Signed-off-by: Liansen Zhai Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231012090330.29636-1-zhailiansen@kuaishou.com Signed-off-by: Jakub Kicinski commit 1cfce8261d9cb21303899aa04de1abb25834d3d0 Author: Justin Stitt Date: Thu Oct 12 22:33:34 2023 +0000 net: usb: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. Other implementations of .*get_drvinfo use strscpy so this patch brings sr_get_drvinfo() in line as well: igb/igb_ethtool.c +851 static void igb_get_drvinfo(struct net_device *netdev, igbvf/ethtool.c 167:static void igbvf_get_drvinfo(struct net_device *netdev, i40e/i40e_ethtool.c 1999:static void i40e_get_drvinfo(struct net_device *netdev, e1000/e1000_ethtool.c 529:static void e1000_get_drvinfo(struct net_device *netdev, ixgbevf/ethtool.c 211:static void ixgbevf_get_drvinfo(struct net_device *netdev, ... Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20231012-strncpy-drivers-net-usb-sr9800-c-v1-1-5540832c8ec2@google.com Signed-off-by: Jakub Kicinski commit 2242f22ae509f018af3e60787d8773a9481ec9f6 Author: Justin Stitt Date: Thu Oct 12 22:30:54 2023 +0000 lan78xx: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. Other implementations of .*get_drvinfo use strscpy so this patch brings lan78xx_get_drvinfo() in line as well: igb/igb_ethtool.c +851 static void igb_get_drvinfo(struct net_device *netdev, igbvf/ethtool.c 167:static void igbvf_get_drvinfo(struct net_device *netdev, i40e/i40e_ethtool.c 1999:static void i40e_get_drvinfo(struct net_device *netdev, e1000/e1000_ethtool.c 529:static void e1000_get_drvinfo(struct net_device *netdev, ixgbevf/ethtool.c 211:static void ixgbevf_get_drvinfo(struct net_device *netdev, Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20231012-strncpy-drivers-net-usb-lan78xx-c-v1-1-99d513061dfc@google.com Signed-off-by: Jakub Kicinski commit 4ddc1f1f7339e0a03bbf235a6670d497bbb22fb3 Author: Justin Stitt Date: Thu Oct 12 22:27:52 2023 +0000 net: phy: smsc: replace deprecated strncpy with ethtool_sprintf strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of this dedicated helper function. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231012-strncpy-drivers-net-phy-smsc-c-v1-1-00528f7524b3@google.com Signed-off-by: Jakub Kicinski commit 6cb42f91aa6dfd10fd847c469caebe63b35141ff Author: Yury Norov Date: Sun Sep 24 19:38:17 2023 -0700 bitmap: move bitmap_*_region() functions to bitmap.h Now that bitmap_*_region() functions are implemented as thin wrappers around others, it's worth to move them to the header, as it opens room for compile-time optimizations. CC: Andy Shevchenko CC: Rasmus Villemoes CC: Greg Kroah-Hartman Signed-off-by: Yury Norov commit eb7fa2eb9689b050b84333d62bbf79f803bbf1ef Author: Justin Stitt Date: Thu Oct 12 21:05:40 2023 +0000 net: netcp: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Other implementations of .*get_drvinfo also use strscpy so this patch brings keystone_get_drvinfo() in line as well: igb/igb_ethtool.c +851 static void igb_get_drvinfo(struct net_device *netdev, igbvf/ethtool.c 167:static void igbvf_get_drvinfo(struct net_device *netdev, i40e/i40e_ethtool.c 1999:static void i40e_get_drvinfo(struct net_device *netdev, e1000/e1000_ethtool.c 529:static void e1000_get_drvinfo(struct net_device *netdev, ixgbevf/ethtool.c 211:static void ixgbevf_get_drvinfo(struct net_device *netdev, Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20231012-strncpy-drivers-net-ethernet-ti-netcp_ethss-c-v1-1-93142e620864@google.com Signed-off-by: Jakub Kicinski commit 94b3f0b5af2c7af69e3d6e0cdd9b0ea535f22186 Author: Rik van Riel Date: Mon Aug 21 16:04:09 2023 -0400 smp,csd: Throw an error if a CSD lock is stuck for too long The CSD lock seems to get stuck in 2 "modes". When it gets stuck temporarily, it usually gets released in a few seconds, and sometimes up to one or two minutes. If the CSD lock stays stuck for more than several minutes, it never seems to get unstuck, and gradually more and more things in the system end up also getting stuck. In the latter case, we should just give up, so the system can dump out a little more information about what went wrong, and, with panic_on_oops and a kdump kernel loaded, dump a whole bunch more information about what might have gone wrong. In addition, there is an smp.panic_on_ipistall kernel boot parameter that by default retains the old behavior, but when set enables the panic after the CSD lock has been stuck for more than the specified number of milliseconds, as in 300,000 for five minutes. [ paulmck: Apply Imran Khan feedback. ] [ paulmck: Apply Leonardo Bras feedback. ] Link: https://lore.kernel.org/lkml/bc7cc8b0-f587-4451-8bcd-0daae627bcc7@paulmck-laptop/ Signed-off-by: Rik van Riel Signed-off-by: Paul E. McKenney Reviewed-by: Imran Khan Reviewed-by: Leonardo Bras Cc: Peter Zijlstra Cc: Valentin Schneider Cc: Juergen Gross Cc: Jonathan Corbet Cc: Randy Dunlap commit b0540208a59e11ab55c9b857bf521d8846e515bf Author: Stefan Roesch Date: Mon Sep 25 21:09:39 2023 -0700 mm/ksm: document pages_skipped sysfs knob This adds documentation for the new metric pages_skipped. Link: https://lkml.kernel.org/r/20230926040939.516161-5-shr@devkernel.io Signed-off-by: Stefan Roesch Reviewed-by: David Hildenbrand Cc: Johannes Weiner Cc: Rik van Riel Signed-off-by: Andrew Morton commit 75d7dd4138edd54f3b539698cb4c78a8494d305c Author: Stefan Roesch Date: Mon Sep 25 21:09:38 2023 -0700 mm/ksm: document smart scan mode This adds documentation for the smart scan mode of KSM. [akpm@linux-foundation.org: fix typo] [akpm@linux-foundation.org: document that smart_scan defaults to on] Link: https://lkml.kernel.org/r/20230926040939.516161-4-shr@devkernel.io Signed-off-by: Stefan Roesch Reviewed-by: David Hildenbrand Cc: Johannes Weiner Cc: Rik van Riel Signed-off-by: Andrew Morton commit e5a68991268906a6989f1bf273580c2218662ad6 Author: Stefan Roesch Date: Mon Sep 25 21:09:37 2023 -0700 mm/ksm: add pages_skipped metric This change adds the "pages skipped" metric. To be able to evaluate how successful smart page scanning is, the pages skipped metric can be compared to the pages scanned metric. The pages skipped metric is a cumulative counter. The counter is stored under /sys/kernel/mm/ksm/pages_skipped. Link: https://lkml.kernel.org/r/20230926040939.516161-3-shr@devkernel.io Signed-off-by: Stefan Roesch Reviewed-by: David Hildenbrand Cc: Johannes Weiner Cc: Rik van Riel Signed-off-by: Andrew Morton commit 5e924ff54d088828794d9f1a4d5bf17808f7270e Author: Stefan Roesch Date: Mon Sep 25 21:09:36 2023 -0700 mm/ksm: add "smart" page scanning mode Patch series "Smart scanning mode for KSM", v3. This patch series adds "smart scanning" for KSM. What is smart scanning? ======================= KSM evaluates all the candidate pages for each scan. It does not use historic information from previous scans. This has the effect that candidate pages that couldn't be used for KSM de-duplication continue to be evaluated for each scan. The idea of "smart scanning" is to keep historic information. With the historic information we can temporarily skip the candidate page for one or several scans. Details: ======== "Smart scanning" is to keep two small counters to store if the page has been used for KSM. One counter stores how often we already tried to use the page for KSM and the other counter stores how often we skip a page. How often we skip the candidate page depends how often a page failed KSM de-duplication. The code skips a maximum of 8 times. During testing this has shown to be a good compromise for different workloads. New sysfs knob: =============== Smart scanning is not enabled by default. With /sys/kernel/mm/ksm/smart_scan smart scanning can be enabled. Monitoring: =========== To monitor how effective smart scanning is a new sysfs knob has been introduced. /sys/kernel/mm/pages_skipped report how many pages have been skipped by smart scanning. Results: ======== - Various workloads have shown a 20% - 25% reduction in page scans For the instagram workload for instance, the number of pages scanned has been reduced from over 20M pages per scan to less than 15M pages. - Less pages scans also resulted in an overall higher de-duplication rate as some shorter lived pages could be de-duplicated additionally - Less pages scanned allows to reduce the pages_to_scan parameter and this resulted in a 25% reduction in terms of CPU. - The improvements have been observed for workloads that enable KSM with madvise as well as prctl This patch (of 4): This change adds a "smart" page scanning mode for KSM. So far all the candidate pages are continuously scanned to find candidates for de-duplication. There are a considerably number of pages that cannot be de-duplicated. This is costly in terms of CPU. By using smart scanning considerable CPU savings can be achieved. This change takes the history of scanning pages into account and skips the page scanning of certain pages for a while if de-deduplication for this page has not been successful in the past. To do this it introduces two new fields in the ksm_rmap_item structure: age and remaining_skips. age, is the KSM age and remaining_skips determines how often scanning of this page is skipped. The age field is incremented each time the page is scanned and the page cannot be de- duplicated. age updated is capped at U8_MAX. How often a page is skipped is dependent how often de-duplication has been tried so far and the number of skips is currently limited to 8. This value has shown to be effective with different workloads. The feature is currently disable by default and can be enabled with the new smart_scan knob. The feature has shown to be very effective: upt to 25% of the page scans can be eliminated; the pages_to_scan rate can be reduced by 40 - 50% and a similar de-duplication rate can be maintained. [akpm@linux-foundation.org: make ksm_smart_scan default true, for testing] Link: https://lkml.kernel.org/r/20230926040939.516161-1-shr@devkernel.io Link: https://lkml.kernel.org/r/20230926040939.516161-2-shr@devkernel.io Signed-off-by: Stefan Roesch Reviewed-by: David Hildenbrand Cc: Johannes Weiner Cc: Rik van Riel Cc: Stefan Roesch Signed-off-by: Andrew Morton commit 6bc2cfdf82d56863b7cf5e86e37a662b2ae5d47e Author: Huang Ying Date: Tue Sep 26 14:06:28 2023 +0800 dax, kmem: calculate abstract distance with general interface Previously, a fixed abstract distance MEMTIER_DEFAULT_DAX_ADISTANCE is used for slow memory type in kmem driver. This limits the usage of kmem driver, for example, it cannot be used for HBM (high bandwidth memory). So, we use the general abstract distance calculation mechanism in kmem drivers to get more accurate abstract distance on systems with proper support. The original MEMTIER_DEFAULT_DAX_ADISTANCE is used as fallback only. Now, multiple memory types may be managed by kmem. These memory types are put into the "kmem_memory_types" list and protected by kmem_memory_type_lock. Link: https://lkml.kernel.org/r/20230926060628.265989-5-ying.huang@intel.com Signed-off-by: "Huang, Ying" Tested-by: Bharata B Rao Reviewed-by: Dave Jiang Reviewed-by: Alistair Popple Cc: Aneesh Kumar K.V Cc: Wei Xu Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Yang Shi Cc: Rafael J Wysocki Signed-off-by: Andrew Morton commit 3718c02dbd4c88d47b5af003acdb3d1112604ea3 Author: Huang Ying Date: Tue Sep 26 14:06:27 2023 +0800 acpi, hmat: calculate abstract distance with HMAT A memory tiering abstract distance calculation algorithm based on ACPI HMAT is implemented. The basic idea is as follows. The performance attributes of system default DRAM nodes are recorded as the base line. Whose abstract distance is MEMTIER_ADISTANCE_DRAM. Then, the ratio of the abstract distance of a memory node (target) to MEMTIER_ADISTANCE_DRAM is scaled based on the ratio of the performance attributes of the node to that of the default DRAM nodes. The functions to record the read/write latency/bandwidth of the default DRAM nodes and calculate abstract distance according to read/write latency/bandwidth ratio will be used by CXL CDAT (Coherent Device Attribute Table) and other memory device drivers. So, they are put in memory-tiers.c. Link: https://lkml.kernel.org/r/20230926060628.265989-4-ying.huang@intel.com Signed-off-by: "Huang, Ying" Tested-by: Bharata B Rao Reviewed-by: Dave Jiang Reviewed-by: Alistair Popple Cc: Aneesh Kumar K.V Cc: Wei Xu Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Yang Shi Cc: Rafael J Wysocki Signed-off-by: Andrew Morton commit d0376aac59a166cd7bd9d1a9768e31e71002631b Author: Huang Ying Date: Tue Sep 26 14:06:26 2023 +0800 acpi, hmat: refactor hmat_register_target_initiators() Previously, in hmat_register_target_initiators(), the performance attributes are calculated and the corresponding sysfs links and files are created too. Which is called during memory onlining. But now, to calculate the abstract distance of a memory target before memory onlining, we need to calculate the performance attributes for a memory target without creating sysfs links and files. To do that, hmat_register_target_initiators() is refactored to make it possible to calculate performance attributes separately. Link: https://lkml.kernel.org/r/20230926060628.265989-3-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Alistair Popple Tested-by: Alistair Popple Tested-by: Bharata B Rao Reviewed-by: Dave Jiang Cc: Aneesh Kumar K.V Cc: Wei Xu Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Yang Shi Cc: Rafael J Wysocki Signed-off-by: Andrew Morton commit 07a8bdd4120ced3490ef9adf51b8086af0aaa8e7 Author: Huang Ying Date: Tue Sep 26 14:06:25 2023 +0800 memory tiering: add abstract distance calculation algorithms management Patch series "memory tiering: calculate abstract distance based on ACPI HMAT", v4. We have the explicit memory tiers framework to manage systems with multiple types of memory, e.g., DRAM in DIMM slots and CXL memory devices. Where, same kind of memory devices will be grouped into memory types, then put into memory tiers. To describe the performance of a memory type, abstract distance is defined. Which is in direct proportion to the memory latency and inversely proportional to the memory bandwidth. To keep the code as simple as possible, fixed abstract distance is used in dax/kmem to describe slow memory such as Optane DCPMM. To support more memory types, in this series, we added the abstract distance calculation algorithm management mechanism, provided a algorithm implementation based on ACPI HMAT, and used the general abstract distance calculation interface in dax/kmem driver. So, dax/kmem can support HBM (high bandwidth memory) in addition to the original Optane DCPMM. This patch (of 4): The abstract distance may be calculated by various drivers, such as ACPI HMAT, CXL CDAT, etc. While it may be used by various code which hot-add memory node, such as dax/kmem etc. To decouple the algorithm users and the providers, the abstract distance calculation algorithms management mechanism is implemented in this patch. It provides interface for the providers to register the implementation, and interface for the users. Multiple algorithm implementations can cooperate via calculating abstract distance for different memory nodes. The preference of algorithm implementations can be specified via priority (notifier_block.priority). Link: https://lkml.kernel.org/r/20230926060628.265989-1-ying.huang@intel.com Link: https://lkml.kernel.org/r/20230926060628.265989-2-ying.huang@intel.com Signed-off-by: "Huang, Ying" Tested-by: Bharata B Rao Reviewed-by: Alistair Popple Reviewed-by: Dave Jiang Cc: Aneesh Kumar K.V Cc: Wei Xu Cc: Dan Williams Cc: Dave Hansen Cc: Davidlohr Bueso Cc: Johannes Weiner Cc: Jonathan Cameron Cc: Michal Hocko Cc: Yang Shi Cc: Rafael J Wysocki Signed-off-by: Andrew Morton commit a48bf7b4757cd8de3497c2878536f46a8d2da65c Author: Sidhartha Kumar Date: Tue Sep 26 10:44:33 2023 -0700 mm/hugetlb: replace page_ref_freeze() with folio_ref_freeze() in hugetlb_folio_init_vmemmap() No functional difference, folio_ref_freeze() is currently a wrapper for page_ref_freeze(). Link: https://lkml.kernel.org/r/20230926174433.81241-1-sidhartha.kumar@oracle.com Signed-off-by: Sidhartha Kumar Reviewed-by: Muchun Song Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Usama Arif Signed-off-by: Andrew Morton commit a08c7193e4f18dc8508f2d07d0de2c5b94cb39a3 Author: Sidhartha Kumar Date: Tue Sep 26 12:20:17 2023 -0700 mm/filemap: remove hugetlb special casing in filemap.c Remove special cased hugetlb handling code within the page cache by changing the granularity of ->index to the base page size rather than the huge page size. The motivation of this patch is to reduce complexity within the filemap code while also increasing performance by removing branches that are evaluated on every page cache lookup. To support the change in index, new wrappers for hugetlb page cache interactions are added. These wrappers perform the conversion to a linear index which is now expected by the page cache for huge pages. ========================= PERFORMANCE ====================================== Perf was used to check the performance differences after the patch. Overall the performance is similar to mainline with a very small larger overhead that occurs in __filemap_add_folio() and hugetlb_add_to_page_cache(). This is because of the larger overhead that occurs in xa_load() and xa_store() as the xarray is now using more entries to store hugetlb folios in the page cache. Timing aarch64 2MB Page Size 6.5-rc3 + this patch: [root@sidhakum-ol9-1 hugepages]# time fallocate -l 700GB test.txt real 1m49.568s user 0m0.000s sys 1m49.461s 6.5-rc3: [root]# time fallocate -l 700GB test.txt real 1m47.495s user 0m0.000s sys 1m47.370s 1GB Page Size 6.5-rc3 + this patch: [root@sidhakum-ol9-1 hugepages1G]# time fallocate -l 700GB test.txt real 1m47.024s user 0m0.000s sys 1m46.921s 6.5-rc3: [root@sidhakum-ol9-1 hugepages1G]# time fallocate -l 700GB test.txt real 1m44.551s user 0m0.000s sys 1m44.438s x86 2MB Page Size 6.5-rc3 + this patch: [root@sidhakum-ol9-2 hugepages]# time fallocate -l 100GB test.txt real 0m22.383s user 0m0.000s sys 0m22.255s 6.5-rc3: [opc@sidhakum-ol9-2 hugepages]$ time sudo fallocate -l 100GB /dev/hugepages/test.txt real 0m22.735s user 0m0.038s sys 0m22.567s 1GB Page Size 6.5-rc3 + this patch: [root@sidhakum-ol9-2 hugepages1GB]# time fallocate -l 100GB test.txt real 0m25.786s user 0m0.001s sys 0m25.589s 6.5-rc3: [root@sidhakum-ol9-2 hugepages1G]# time fallocate -l 100GB test.txt real 0m33.454s user 0m0.001s sys 0m33.193s aarch64: workload - fallocate a 700GB file backed by huge pages 6.5-rc3 + this patch: 2MB Page Size: --100.00%--__arm64_sys_fallocate ksys_fallocate vfs_fallocate hugetlbfs_fallocate | |--95.04%--__pi_clear_page | |--3.57%--clear_huge_page | | | |--2.63%--rcu_all_qs | | | --0.91%--__cond_resched | --0.67%--__cond_resched 0.17% 0.00% 0 fallocate [kernel.vmlinux] [k] hugetlb_add_to_page_cache 0.14% 0.10% 11 fallocate [kernel.vmlinux] [k] __filemap_add_folio 6.5-rc3 2MB Page Size: --100.00%--__arm64_sys_fallocate ksys_fallocate vfs_fallocate hugetlbfs_fallocate | |--94.91%--__pi_clear_page | |--4.11%--clear_huge_page | | | |--3.00%--rcu_all_qs | | | --1.10%--__cond_resched | --0.59%--__cond_resched 0.08% 0.01% 1 fallocate [kernel.kallsyms] [k] hugetlb_add_to_page_cache 0.05% 0.03% 3 fallocate [kernel.kallsyms] [k] __filemap_add_folio x86 workload - fallocate a 100GB file backed by huge pages 6.5-rc3 + this patch: 2MB Page Size: hugetlbfs_fallocate | --99.57%--clear_huge_page | --98.47%--clear_page_erms | --0.53%--asm_sysvec_apic_timer_interrupt 0.04% 0.04% 1 fallocate [kernel.kallsyms] [k] xa_load 0.04% 0.00% 0 fallocate [kernel.kallsyms] [k] hugetlb_add_to_page_cache 0.04% 0.00% 0 fallocate [kernel.kallsyms] [k] __filemap_add_folio 0.04% 0.00% 0 fallocate [kernel.kallsyms] [k] xas_store 6.5-rc3 2MB Page Size: --99.93%--__x64_sys_fallocate vfs_fallocate hugetlbfs_fallocate | --99.38%--clear_huge_page | |--98.40%--clear_page_erms | --0.59%--__cond_resched 0.03% 0.03% 1 fallocate [kernel.kallsyms] [k] __filemap_add_folio ========================= TESTING ====================================== This patch passes libhugetlbfs tests and LTP hugetlb tests ********** TEST SUMMARY * 2M * 32-bit 64-bit * Total testcases: 110 113 * Skipped: 0 0 * PASS: 107 113 * FAIL: 0 0 * Killed by signal: 3 0 * Bad configuration: 0 0 * Expected FAIL: 0 0 * Unexpected PASS: 0 0 * Test not present: 0 0 * Strange test result: 0 0 ********** Done executing testcases. LTP Version: 20220527-178-g2761a81c4 page migration was also tested using Mike Kravetz's test program.[8] [dan.carpenter@linaro.org: fix an NULL vs IS_ERR() bug] Link: https://lkml.kernel.org/r/1772c296-1417-486f-8eef-171af2192681@moroto.mountain Link: https://lkml.kernel.org/r/20230926192017.98183-1-sidhartha.kumar@oracle.com Signed-off-by: Sidhartha Kumar Signed-off-by: Dan Carpenter Reported-and-tested-by: syzbot+c225dea486da4d5592bd@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=c225dea486da4d5592bd Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit 0374af1da077573b2bea8ff70258d3537c5a1e79 Author: Stefan Roesch Date: Fri Sep 22 14:11:41 2023 -0700 mm/ksm: test case for prctl fork/exec workflow This adds a new test case to the ksm functional tests to make sure that the KSM setting is inherited by the child process when doing a fork/exec. Link: https://lkml.kernel.org/r/20230922211141.320789-3-shr@devkernel.io Signed-off-by: Stefan Roesch Reviewed-by: David Hildenbrand Cc: Carl Klemm Cc: Johannes Weiner Cc: Rik van Riel Signed-off-by: Andrew Morton commit 3c6f33b7273a7e2f2b2497b62c8400bd957b2fbe Author: Stefan Roesch Date: Fri Sep 22 14:11:40 2023 -0700 mm/ksm: support fork/exec for prctl Patch series "mm/ksm: add fork-exec support for prctl", v4. A process can enable KSM with the prctl system call. When the process is forked the KSM flag is inherited by the child process. However if the process is executing an exec system call directly after the fork, the KSM setting is cleared. This patch series addresses this problem. 1) Change the mask in coredump.h for execing a new process 2) Add a new test case in ksm_functional_tests This patch (of 2): Today we have two ways to enable KSM: 1) madvise system call This allows to enable KSM for a memory region for a long time. 2) prctl system call This is a recent addition to enable KSM for the complete process. In addition when a process is forked, the KSM setting is inherited. This change only affects the second case. One of the use cases for (2) was to support the ability to enable KSM for cgroups. This allows systemd to enable KSM for the seed process. By enabling it in the seed process all child processes inherit the setting. This works correctly when the process is forked. However it doesn't support fork/exec workflow. From the previous cover letter: .... Use case 3: With the madvise call sharing opportunities are only enabled for the current process: it is a workload-local decision. A considerable number of sharing opportunities may exist across multiple workloads or jobs (if they are part of the same security domain). Only a higler level entity like a job scheduler or container can know for certain if its running one or more instances of a job. That job scheduler however doesn't have the necessary internal workload knowledge to make targeted madvise calls. .... In addition it can also be a bit surprising that fork keeps the KSM setting and fork/exec does not. Link: https://lkml.kernel.org/r/20230922211141.320789-1-shr@devkernel.io Link: https://lkml.kernel.org/r/20230922211141.320789-2-shr@devkernel.io Signed-off-by: Stefan Roesch Fixes: d7597f59d1d3 ("mm: add new api to enable ksm per process") Reviewed-by: David Hildenbrand Reported-by: Carl Klemm Tested-by: Carl Klemm Cc: Johannes Weiner Cc: Rik van Riel Signed-off-by: Andrew Morton commit 987ffa5a3858bee448dc791cf6f596790aea52a8 Author: Huan Yang Date: Wed Sep 20 09:57:27 2023 +0800 mm/damon/core: remove unnecessary si_meminfo invoke. si_meminfo() will read and assign more info not just free/ram pages. For just DAMOS_WMARK_FREE_MEM_RATE use, only get free and ram pages is ok to save cpu. Link: https://lkml.kernel.org/r/20230920015727.4482-1-link@vivo.com Signed-off-by: Huan Yang Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton commit 8c9ae56dc73b5ae48a14000b96292bd4f2aeb710 Author: Kefeng Wang Date: Thu Sep 21 15:44:17 2023 +0800 sched/numa, mm: make numa migrate functions to take a folio The cpupid (or access time) is stored in the head page for THP, so it is safely to make should_numa_migrate_memory() and numa_hint_fault_latency() to take a folio. This is in preparation for large folio numa balancing. Link: https://lkml.kernel.org/r/20230921074417.24004-7-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Zi Yan Signed-off-by: Andrew Morton commit 75c70128a67311070115b90d826a229d4bbbb2b5 Author: Kefeng Wang Date: Thu Sep 21 15:44:16 2023 +0800 mm: mempolicy: make mpol_misplaced() to take a folio In preparation for large folio numa balancing, make mpol_misplaced() to take a folio, no functional change intended. Link: https://lkml.kernel.org/r/20230921074417.24004-6-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Zi Yan Signed-off-by: Andrew Morton commit cda6d93672ac5dd8af778a3f3e6082e12233b65b Author: Kefeng Wang Date: Thu Sep 21 15:44:15 2023 +0800 mm: memory: make numa_migrate_prep() to take a folio In preparation for large folio numa balancing, make numa_migrate_prep() to take a folio, no functional change intended. Link: https://lkml.kernel.org/r/20230921074417.24004-5-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Zi Yan Signed-off-by: Andrew Morton commit 6695cf68b15c215d33b8add64c33e01e3cbe236c Author: Kefeng Wang Date: Thu Sep 21 15:44:14 2023 +0800 mm: memory: use a folio in do_numa_page() Numa balancing only try to migrate non-compound page in do_numa_page(), use a folio in it to save several compound_head calls, note we use folio_estimated_sharers(), it is enough to check the folio sharers since only normal page is handled, if large folio numa balancing is supported, a precise folio sharers check would be used, no functional change intended. Link: https://lkml.kernel.org/r/20230921074417.24004-4-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Zi Yan Signed-off-by: Andrew Morton commit 667ffc31aa95e7023707924b08415523208bce9d Author: Kefeng Wang Date: Thu Sep 21 15:44:13 2023 +0800 mm: huge_memory: use a folio in do_huge_pmd_numa_page() Use a folio in do_huge_pmd_numa_page(), reduce three page_folio() calls to one, no functional change intended. Link: https://lkml.kernel.org/r/20230921074417.24004-3-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Zi Yan Signed-off-by: Andrew Morton commit 65610453459f9048678a0daef89d592e412ec00a Author: Kefeng Wang Date: Thu Sep 21 15:44:12 2023 +0800 mm: memory: add vm_normal_folio_pmd() Patch series "mm: convert numa balancing functions to use a folio", v2. do_numa_pages() only handles non-compound pages, and only PMD-mapped THPs are handled in do_huge_pmd_numa_page(). But a large, PTE-mapped folio will be supported so let's convert more numa balancing functions to use/take a folio in preparation for that, no functional change intended for now. This patch (of 6): The new vm_normal_folio_pmd() wrapper is similar to vm_normal_folio(), which allow them to completely replace the struct page variables with struct folio variables. Link: https://lkml.kernel.org/r/20230921074417.24004-1-wangkefeng.wang@huawei.com Link: https://lkml.kernel.org/r/20230921074417.24004-2-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Zi Yan Signed-off-by: Andrew Morton commit 562b1fdf061bff9394ccd884456ed1173c224fdc Author: Haiyang Zhang Date: Wed Oct 11 13:30:44 2023 -0700 tcp: Set pingpong threshold via sysctl TCP pingpong threshold is 1 by default. But some applications, like SQL DB may prefer a higher pingpong threshold to activate delayed acks in quick ack mode for better performance. The pingpong threshold and related code were changed to 3 in the year 2019 in: commit 4a41f453bedf ("tcp: change pingpong threshold to 3") And reverted to 1 in the year 2022 in: commit 4d8f24eeedc5 ("Revert "tcp: change pingpong threshold to 3"") There is no single value that fits all applications. Add net.ipv4.tcp_pingpong_thresh sysctl tunable, so it can be tuned for optimal performance based on the application needs. Signed-off-by: Haiyang Zhang Reviewed-by: Simon Horman Reviewed-by: Eric Dumazet Acked-by: Neal Cardwell Reviewed-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/1697056244-21888-1-git-send-email-haiyangz@microsoft.com Signed-off-by: Jakub Kicinski commit 09427e1975bfa83554739bf27aa251c25420da88 Merge: 15c46d85f0214 22dedf8f45708 Author: Arnd Bergmann Date: Mon Oct 16 23:02:21 2023 +0200 Merge tag 'riscv-soc-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into soc/drivers RISC-V SoC drivers for v6.7 Minor changes here only. There's the treewide remove callback work from Uwe, some of my own gradual conversion of SOC_ Kconfig options and a selection of the ARM AMBA protocol required for the crypto driver on StarFive JH7110 SoCs. The latter was supposed to be in v6.6, but I forgot to send a PR. Signed-off-by: Conor Dooley * tag 'riscv-soc-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux: soc/microchip: mpfs-sys-controller: Convert to platform remove callback returning void soc: sifive: replace SOC_FOO with ARCH_FOO riscv: Kconfig: Add select ARM_AMBA to SOC_STARFIVE Link: https://lore.kernel.org/r/20231016-predator-affiliate-e8affd3a7be9@spud Signed-off-by: Arnd Bergmann commit 15c46d85f0214b3705bc0a28ef8408a5de47f07f Merge: e855cbf28b6d4 5d59b6a49bb8f Author: Arnd Bergmann Date: Mon Oct 16 23:01:31 2023 +0200 Merge tag 'amlogic-drivers-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into soc/drivers Amlogic drivers changes for v6.7: - correct meson_sm_* API retval handling - Use device_get_match_data() in meson SM * tag 'amlogic-drivers-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: firmware: meson: Use device_get_match_data() drivers: meson: sm: correct meson_sm_* API retval handling Link: https://lore.kernel.org/r/00ef6ab3-59c1-484a-9d70-50f16e4cc584@linaro.org Signed-off-by: Arnd Bergmann commit e855cbf28b6d46ac87dab630b1e56fd4a8fe9845 Merge: 1780d27c7a54c 09de3691daab1 Author: Arnd Bergmann Date: Mon Oct 16 23:00:46 2023 +0200 Merge tag 'memory-controller-drv-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into soc/drivers Memory controller drivers for v6.7 1. Atmel: Use __counted_by annotation. 2. Tegra: Add Tegra234 clients for RCE and VI. 3. Cleanup: - Use device_get_match_data() to simplify the code, - Make "additionalProperties: true" explicit in Devicetree bindings. * tag 'memory-controller-drv-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: Use device_get_match_data() memory: tegra: Add Tegra234 clients for RCE and VI dt-bindings: memory-controllers: Make "additionalProperties: true" explicit memory: atmel-ebi: Annotate struct atmel_ebi_dev with __counted_by Link: https://lore.kernel.org/r/20231016074013.28286-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 1780d27c7a54c1550e86528101fe36b2c3ed893a Merge: 78aee16af9c83 0af9e89106c35 Author: Arnd Bergmann Date: Mon Oct 16 23:00:16 2023 +0200 Merge tag 'aspeed-6.7-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc into soc/drivers ASPEED soc updates for 6.7 * Move all drivers to .remove_new callback * tag 'aspeed-6.7-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc: soc/aspeed: Convert to platform remove callback returning void Link: https://lore.kernel.org/r/CACPK8XcTx9bd7DkguFOZ4qCxk8MJWm-yeNMLGDCnO+wv7dwa1g@mail.gmail.com Signed-off-by: Arnd Bergmann commit 78aee16af9c83f17d13752433650d11d4f959312 Merge: 9e6e423a3665b f344675a34383 Author: Arnd Bergmann Date: Mon Oct 16 22:59:21 2023 +0200 Merge tag 'tegra-for-6.7-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers memory: tegra: Changes for v6.7-rc1 Contains a fix for a long timeout that can make it seems like the system is hanging during early resume. * tag 'tegra-for-6.7-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: memory: tegra: Set BPMP msg flags to reset IPC channels Link: https://lore.kernel.org/r/20231013153723.1729109-4-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 1e9ac3e8a6a9d4da9efbad2d8e95cc1140e0e23f Author: Chris Morgan Date: Fri Oct 13 13:39:18 2023 -0500 arm64: dts: rockchip: add support for Powkiddy RGB30 The Powkiddy RGB30 is a portable game device based on the Rockchip RK3566 SoC. It has GPIO buttons on the face and sides for input, stereo speakers, a 720x720 4 inch DSI display, a USB-C host port and a USB-C peripheral port, dual SD card slots, WiFi, Bluetooth, and 1GB of RAM. Working/Tested: - SDMMC - UART (for debugging) - Buttons - Charging/battery/PMIC - Speaker/Headphones - USB - WiFi - Bluetooth - Display (at 59.04hz) Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20231013183918.225666-6-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 64d0de4f65c2951ccdc7a7aebe8a7e3455946f5f Author: Chris Morgan Date: Fri Oct 13 13:39:17 2023 -0500 dt-bindings: arm64: rockchip: add Powkiddy RGB30 The Powkiddy RGB30 is a portable handheld console from Powkiddy which uses the Rockchip RK3566 SoC. Signed-off-by: Chris Morgan Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231013183918.225666-5-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit 9e6e423a3665b82ad2c7b83a51eccc903982f737 Merge: 024d4292e4265 ea608a01d4ee6 Author: Arnd Bergmann Date: Mon Oct 16 22:58:21 2023 +0200 Merge tag 'tegra-for-6.7-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers firmware: tegra: Changes for v6.7-rc1 Contains a typofix and a new mechanism to help fix an issue that can seemingly hang the system during early resume. * tag 'tegra-for-6.7-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: firmware: tegra: Add suspend hook and reset BPMP IPC early on resume firmware: tegra: Fix a typo Link: https://lore.kernel.org/r/20231013153723.1729109-2-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 024d4292e4265eebceafacf7601ef0449f11b4d2 Merge: d3cd3b55014f2 cda263907a6f8 Author: Arnd Bergmann Date: Mon Oct 16 22:57:21 2023 +0200 Merge tag 'tegra-for-6.7-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers soc/tegra: Changes for v6.7-rc1 This contains a few minor cleanups for PMC and CBB. * tag 'tegra-for-6.7-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: pmc: Drop the ->opp_to_performance_state() callback soc/tegra: cbb: tegra194-cbb: Convert to platform remove callback returning void Link: https://lore.kernel.org/r/20231013153723.1729109-1-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit d3cd3b55014f28d5006c258d5a1c083c2cd79bd2 Merge: d1debb7b322c4 bcefd1bf63b1e Author: Arnd Bergmann Date: Mon Oct 16 22:55:39 2023 +0200 Merge tag 'ffa-updates-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers Arm FF-A updates for v6.7 The main addition is the initial support for the notifications and memory transaction descriptor changes added in FF-A v1.1 specification. The notification mechanism enables a requester/sender endpoint to notify a service provider/receiver endpoint about an event with non-blocking semantics. A notification is akin to the doorbell between two endpoints in a communication protocol that is based upon the doorbell/mailbox mechanism. The framework is responsible for the delivery of the notification from the ender to the receiver without blocking the sender. The receiver endpoint relies on the OS scheduler for allocation of CPU cycles to handle a notification. OS is referred as the receiver’s scheduler in the context of notifications. The framework is responsible for informing the receiver’s scheduler that the receiver must be run since it has a pending notification. The series also includes support for the new format of memory transaction descriptors introduced in v1.1 specification. Apart from the main additions, it includes minor fixes to re-enable FF-A drivers usage of 32bit mode of messaging and kernel warning due to the missing assignment of IDR allocation ID to the FFA device. It also adds emitting 'modalias' to the base attribute of FF-A devices. * tag 'ffa-updates-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_ffa: Upgrade the driver version to v1.1 firmware: arm_ffa: Update memory descriptor to support v1.1 format firmware: arm_ffa: Switch to using ffa_mem_desc_offset() accessor KVM: arm64: FFA: Remove access of endpoint memory access descriptor array firmware: arm_ffa: Simplify the computation of transmit and fragment length firmware: arm_ffa: Add notification handling mechanism firmware: arm_ffa: Add interface to send a notification to a given partition firmware: arm_ffa: Add interfaces to request notification callbacks firmware: arm_ffa: Add schedule receiver callback mechanism firmware: arm_ffa: Initial support for scheduler receiver interrupt firmware: arm_ffa: Implement the NOTIFICATION_INFO_GET interface firmware: arm_ffa: Implement the FFA_NOTIFICATION_GET interface firmware: arm_ffa: Implement the FFA_NOTIFICATION_SET interface firmware: arm_ffa: Implement the FFA_RUN interface firmware: arm_ffa: Implement the notification bind and unbind interface firmware: arm_ffa: Implement notification bitmap create and destroy interfaces firmware: arm_ffa: Update the FF-A command list with v1.1 additions firmware: arm_ffa: Emit modalias for FF-A devices firmware: arm_ffa: Allow the FF-A drivers to use 32bit mode of messaging firmware: arm_ffa: Assign the missing IDR allocation ID to the FFA device Link: https://lore.kernel.org/r/20231010124354.1620064-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit d1debb7b322c4f290875925ba0d058c884d4244a Merge: 765e4aa6be024 da405477e7670 Author: Arnd Bergmann Date: Mon Oct 16 22:54:08 2023 +0200 Merge tag 'scmi-updates-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers Arm SCMI updates for v6.7 Main additions this time include: 1. SCMI v3.2 clock configuration support: This helps to retrieve the enabled state of a clock as well as allow to set OEM specific clock configurations. 2. Support for generic performance scaling(DVFS): The current SCMI DVFS support is limited to the CPUs in the kernel. This extension enables it to used for all kind of devices and not only for the CPUs. It updates the SCMI cpufreq to utilize the power domain bindings. It also adds a more generic SCMI performance domain based on the genpd framework that as be used for all the non-CPU devices. 3. Extend the generic performance scaling(DVFS) support for firmware driver OPPs: Consumer drivers for devices that are attached to the SCMI performance domain can't make use of the current OPP library to scale performance as the OPPs are firmware driven and often obtained from the firmware rather than the device tree. These changes extend the generic OPP and genpd PM domain frameworks to identify and utilise these firmware driven OPPs. 4. SCMI v3.2 clock parent support: This enables the support for discovering and changing parent clocks and extending the SCMI clk driver to use the same. 5. Qualcom SMC/HVC transport support: The Qualcomm virtual platforms require capability id in the hypervisor call to identify which doorbell to assert when supporting multiple SMC/HVC based SCMI transport channels. Extra parameter is added to support the same and the same is obtained at the fixed address in the shared memory which is initialised by the firmware. 6. Move the existing SCMI power domain driver under drivers/pmdomain Apart from the above main changes, it also include couple of minor fixes and cosmetic reworks. * tag 'scmi-updates-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: (37 commits) firmware: arm_scmi: Add qcom smc/hvc transport support dt-bindings: arm: Add new compatible for smc/hvc transport for SCMI firmware: arm_scmi: Convert u32 to unsigned long to align with arm_smccc_1_1_invoke() clk: scmi: Add support for clock {set,get}_parent firmware: arm_scmi: Add support for clock parents clk: scmi: Free scmi_clk allocated when the clocks with invalid info are skipped firmware: arm_scpi: Use device_get_match_data() firmware: arm_scmi: Add generic OPP support to the SCMI performance domain firmware: arm_scmi: Specify the performance level when adding an OPP firmware: arm_scmi: Simplify error path in scmi_dvfs_device_opps_add() OPP: Extend support for the opp-level beyond required-opps OPP: Switch to use dev_pm_domain_set_performance_state() OPP: Extend dev_pm_opp_data with a level OPP: Add dev_pm_opp_add_dynamic() to allow more flexibility PM: domains: Implement the ->set_performance_state() callback for genpd PM: domains: Introduce dev_pm_domain_set_performance_state() firmware: arm_scmi: Rename scmi_{msg_,}clock_config_{get,set}_{2,21} firmware: arm_scmi: Do not use !! on boolean when setting msg->flags firmware: arm_scmi: Move power-domain driver to the pmdomain dir pmdomain: arm: Add the SCMI performance domain ... Link: https://lore.kernel.org/r/20231010124347.1620040-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 765e4aa6be024496e2f599cd977701996cc629a8 Merge: 0aefb041c5dd4 cb289ce6e2ce4 Author: Arnd Bergmann Date: Mon Oct 16 22:53:30 2023 +0200 Merge tag 'vexpress-update-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers Arm Vexpress updates for v6.7 Just a single update to use __counted_by annotation in config bus driver in preparation to the upcoming versions of the toolchains(GCC and Clang) with __counted_by attribute. * tag 'vexpress-update-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: bus: vexpress-config: Annotate struct vexpress_syscfg_func with __counted_by Link: https://lore.kernel.org/r/20231010124339.1620012-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 0aefb041c5dd4a2e594d9e2a17e4e87a6711d5bd Merge: 8c15065cddb95 fa095fe0ab358 Author: Arnd Bergmann Date: Mon Oct 16 22:52:45 2023 +0200 Merge tag 'v6.6-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into soc/drivers MediaTek drivers updates for v6.7 - Added support for Smart Voltage Scaling (SVS) on the MT8188 SoC * tag 'v6.6-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: soc: mediatek: svs: Add support for voltage bins soc: mediatek: svs: Add support for MT8188 SoC dt-bindings: soc: mediatek: add mt8188 svs dt-bindings Link: https://lore.kernel.org/r/d25ccd90-277a-fd05-8605-f7d1d129d4fa@gmail.com Signed-off-by: Arnd Bergmann commit 8c15065cddb95cb83b358f16f7f320c9dc73e925 Merge: 4d8220323f608 61ad21ec51977 Author: Arnd Bergmann Date: Mon Oct 16 22:51:48 2023 +0200 Merge tag 'renesas-drivers-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/drivers Renesas driver updates for v6.7 - Identify the new RZ/G3S SoC, - Miscellaneous fixes and improvements. * tag 'renesas-drivers-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: Kconfig: Remove blank line before ARCH_R9A07G043 help text soc: renesas: renesas-soc: Remove blank lines soc: renesas: Identify RZ/G3S SoC Link: https://lore.kernel.org/r/cover.1695985423.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 4d8220323f608584b42dc648c501ace0769fda62 Merge: 55fa358ca89f2 e77e6e3e909d3 Author: Arnd Bergmann Date: Mon Oct 16 22:51:23 2023 +0200 Merge tag 'platform-remove-void-soc-for-6.7-rc' of https://git.pengutronix.de/git/ukl/linux into soc/drivers Convert drivers/soc to struct platform_driver::remove_new() This PR contains the patches I sent in the series available at https://lore.kernel.org/all/20230925095532.1984344-1-u.kleine-koenig@pengutronix.de that were not yet picked up in next as of next-20231013. It converts all drivers below drivers/soc to let their remove callback return void. See commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") for the rationale. Signed-off-by: Arnd Bergmann commit 55fa358ca89f2e0b6fe0a4fa2472a7448e59021a Author: Uwe Kleine-König Date: Mon Oct 16 09:29:11 2023 +0200 soc: samsung: exynos-chipid: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230925095532.1984344-32-u.kleine-koenig@pengutronix.de Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231016072911.27148-2-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 636a989eb4d022e1756009592445aedaaf7424d8 Author: Chris Morgan Date: Fri Oct 13 13:39:16 2023 -0500 drm/panel: st7703: Add Powkiddy RGB30 Panel Support The Powkiddy RGB30 4 inch panel is a 4 inch 720x720 DSI panel used in the Powkiddy RGB30 handheld gaming device. Add support for it. Signed-off-by: Chris Morgan Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231013183918.225666-4-macroalpha82@gmail.com commit daee0320a13724e5a584726b693eee87bbd96172 Author: Chris Morgan Date: Fri Oct 13 13:39:15 2023 -0500 dt-bindings: panel: Add Powkiddy RGB30 panel compatible The Powkiddy RGB30 panel is a 4 inch 720x720 MIPI-DSI LCD panel. It appears to be based on the ST7703 LCD controller (this is assumed from the init sequence similarity between this and other displays). Powkiddy would not share the part number or name for the display from the bill of materials and there were no obvious external markings, so name the panel for the device (Powkiddy RGB30). Signed-off-by: Chris Morgan Acked-by: Krzysztof Kozlowski Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231013183918.225666-3-macroalpha82@gmail.com commit 00e395c8edf7fb6fa0830125d91c2b4bc381eefd Author: Chris Morgan Date: Fri Oct 13 13:39:14 2023 -0500 dt-bindings: vendor-prefixes: document Powkiddy Document Powkiddy (https://powkiddy.com/). Signed-off-by: Chris Morgan Acked-by: Krzysztof Kozlowski Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231013183918.225666-2-macroalpha82@gmail.com commit 593bcf6889de542aec1aeab7de6db25a1ff37408 Merge: 30d75d3c6fe7c 8d751da9f1d79 Author: Linus Walleij Date: Mon Oct 16 22:00:13 2023 +0200 Merge tag 'intel-pinctrl-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into devel intel-pinctrl for v6.7-1 * Merge "Drop runtime PM support for Baytrail and Lynxpoint pinctrl" (Raag) * Small improvements here and there in the Intel pin control drivers (Raag) * Switch to RAII for locking in the Intel core and Cherry View drivers * Enable non-ACPI enumeration in the Intel Denverton driver * Use MODULE_DEVICE_TABLE() instead of MODULE_ALIAS() in a couple of drivers * Introduce array_size.h and use in in the Intel pin control drivers The following is an automated git shortlog grouped by driver: baytrail: - Replace kernel.h by what is actually being used - drop runtime PM support - fix debounce disable case broxton: - Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE() cherryview: - reduce scope of PIN_CONFIG_BIAS_HIGH_IMPEDANCE case - Convert to platform remove callback returning void - Simplify code with cleanup helpers - Avoid duplicated I/O - Replace kernel.h by what is actually being used denverton: - Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE() - Enable platform device in the absence of ACPI enumeration intel: - fetch community only when we need it - refine intel_config_set_pull() function - Replace kernel.h by what is actually being used - Simplify code with cleanup helpers lynxpoint: - Replace kernel.h by what is actually being used - drop runtime PM support merrifield: - Replace kernel.h by what is actually being used moorefield: - Replace kernel.h by what is actually being used Signed-off-by: Linus Walleij commit 7952cbbda301f7d297c6ac761f9dfafb90205358 Author: Sebastian Reichel Date: Thu Oct 5 15:40:37 2023 +0200 arm64: dts: rockchip: add status LED to rock-5b Describe the Rock 5B status LED in its device tree. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20231005134037.33231-1-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit afa933c208e5ea9ddf8adb460e273b2b1aba85e5 Author: Sebastian Reichel Date: Thu Oct 5 15:43:57 2023 +0200 arm64: dts: rockchip: add ADC buttons to rk3588-evb1 The Rockchip EVB1 has a couple of buttons connected via an ADC line. Let's add them to its devicetree. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20231005134357.37171-1-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit a5e80e18f268ea7c7a36bc4159de0deb3b5a2171 Author: Zhiguo Niu Date: Mon Oct 16 19:27:31 2023 +0800 f2fs: fix error path of __f2fs_build_free_nids If NAT is corrupted, let scan_nat_page() return EFSCORRUPTED, so that, caller can set SBI_NEED_FSCK flag into checkpoint for later repair by fsck. Also, this patch introduces a new fscorrupted error flag, and in above scenario, it will persist the error flag into superblock synchronously to avoid it has no luck to trigger a checkpoint to record SBI_NEED_FSCK Signed-off-by: Zhiguo Niu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 37768434b7a7d00ac5a08b2c1d31aa7aaa0846a0 Author: KaiLong Wang Date: Fri Oct 13 14:45:42 2023 +0800 f2fs: Clean up errors in segment.h Fix the following errors reported by checkpatch: ERROR: spaces required around that ':' (ctx:VxW) Signed-off-by: KaiLong Wang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 9f792ab8e33de727993bbd84ece892e72de18c85 Author: Daeho Jeong Date: Tue Oct 10 12:36:28 2023 -0700 f2fs: clean up zones when not successfully unmounted We can't trust write pointers when the previous mount was not successfully unmounted. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit dd6dc0c4c1265129c229e26917bf4de1d97ff91f Author: Benjamin Gaignard Date: Fri Oct 6 08:53:34 2023 +0200 arm64: dts: rockchip: Add AV1 decoder node to rk3588s Add node for AV1 video decoder. Signed-off-by: Benjamin Gaignard Reviewed-by: Sebastian Reichel Link: https://lore.kernel.org/r/20231006065334.8117-1-benjamin.gaignard@collabora.com Signed-off-by: Heiko Stuebner commit 0597d85859e48c4366862a6252479698590ae39c Author: Tamás Szűcs Date: Wed Oct 11 19:14:56 2023 +0000 arm64: dts: rockchip: Add missing sdmmc2 SDR rates to rock-3a Add missing UHS-I SDR rates to sdmmc2. Add explicit alias as mmc2 while at it. It would be good to have matching timings enabled in case slower SDIO devices are encountered. Signed-off-by: Tamás Szűcs Link: https://lore.kernel.org/r/20231011191448.58936-1-tszucs@protonmail.ch Signed-off-by: Heiko Stuebner commit a6169ab369236f15c79b45037074a2567d30b037 Author: Tamás Szűcs Date: Fri Oct 13 23:51:53 2023 +0200 arm64: dts: rockchip: Enable UART6 on rock-5b Enable UART lines on Radxa ROCK 5 Model B M.2 Key E. Signed-off-by: Tamás Szűcs Link: https://lore.kernel.org/r/20231013215208.81345-1-szucst@iit.uni-miskolc.hu Signed-off-by: Heiko Stuebner commit 0996e6742399e56b547319c4b8061af79be071b2 Author: Swapnil Sapkal Date: Thu Oct 12 09:32:25 2023 +0000 selftests/amd-pstate: Added option to provide perf binary path In selftests/amd-pstate, distro `perf` is used to capture `perf stat` while running microbenchmarks. Distro `perf` is not working with upstream kernel. Fix this by providing an option to give the perf binary path. Reviewed-by: Mario Limonciello Signed-off-by: Swapnil Sapkal Signed-off-by: Shuah Khan commit 27aabb2c4390561538ca76a5bd418d95037f28d5 Author: Swapnil Sapkal Date: Thu Oct 12 09:32:24 2023 +0000 selftests/amd-pstate: Fix broken paths to run workloads in amd-pstate-ut In selftests/amd-pstate, tbench and gitsource microbenchmarks are used to compare the performance with different governors. In current implementation the relative path to run `amd_pstate_tracer.py` is broken. Fix this by using absolute paths. Signed-off-by: Swapnil Sapkal Reviewed-by: Mario Limonciello Signed-off-by: Shuah Khan commit 5f19ca4e014f2bd4088b78f31426f0ba3b8e6a3c Merge: d712d205210c4 58720809f5277 Author: Greg Kroah-Hartman Date: Mon Oct 16 20:46:20 2023 +0200 Merge 6.6-rc6 into char-misc-next We need the char/misc fixes in here as well, to build on for other changes. Signed-off-by: Greg Kroah-Hartman commit ba21d6367cc2cca8f25fff3bc94b1b8df55fc261 Author: Gustavo A. R. Silva Date: Mon Oct 9 15:30:17 2023 -0600 soc: qcom: apr: Add __counted_by for struct apr_rx_buf and use struct_size() Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). While there, use struct_size() helper, instead of the open-coded version, to calculate the size for the allocation of the whole flexible structure, including of course, the flexible-array member. This code was found with the help of Coccinelle, and audited and fixed manually. Signed-off-by: "Gustavo A. R. Silva" Reviewed-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/ZSRw6RNi3Crhd32H@work Signed-off-by: Bjorn Andersson commit f86955f2b1ff9fbc7ae4f6595112b2f896885366 Author: Dmitry Baryshkov Date: Wed Oct 11 01:52:29 2023 +0300 soc: qcom: pmic_glink: fix connector type to be DisplayPort As it was pointed out by Simon Ser, the DRM_MODE_CONNECTOR_USB connector is reserved for the GUD devices. Other drivers (i915, amdgpu) use DRM_MODE_CONNECTOR_DisplayPort even if the DP stream is handled by the USB-C altmode. While we are still working on implementing the proper way to let userspace know that the DP is wrapped into USB-C, change connector type to be DRM_MODE_CONNECTOR_DisplayPort. Fixes: 080b4e24852b ("soc: qcom: pmic_glink: Introduce altmode support") Cc: Simon Ser Signed-off-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong Acked-by: Simon Ser Link: https://lore.kernel.org/r/20231010225229.77027-1-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit b0c9a045e8c7d4791ef8bafae2c29fe00e835067 Author: Max Filippov Date: Tue Oct 10 01:59:26 2023 -0700 drivers/tty/serial: add ESP32S3 ACM gadget driver Add driver for the ACM gadget controller of the Espressif ESP32S3 SoC. Hardware specification is available at the following URL: https://www.espressif.com/sites/default/files/documentation/esp32-s3_technical_reference_manual_en.pdf (Chapter 33 USB Serial/JTAG Controller) Signed-off-by: Max Filippov Link: https://lore.kernel.org/r/20231010085926.1021667-6-jcmvbkbc@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7f399b0d1ac06ce8b626a0708988a310c0bd04a6 Author: Max Filippov Date: Tue Oct 10 01:59:25 2023 -0700 dt-bindings: serial: document esp32s3-acm Add documentation for the ESP32S3 USB CDC-ACM gadget controller. Signed-off-by: Max Filippov Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20231010085926.1021667-5-jcmvbkbc@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8cc89a229aac8183ffd4c385de0b6b9543175eff Author: Max Filippov Date: Tue Oct 10 01:59:24 2023 -0700 drivers/tty/serial: add driver for the ESP32 UART Add driver for the UART controllers of the Espressif ESP32 and ESP32S3 SoCs. Hardware specification is available at the following URLs: https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf (Chapter 13 UART Controller) https://www.espressif.com/sites/default/files/documentation/esp32-s3_technical_reference_manual_en.pdf (Chapter 26 UART Controller) Signed-off-by: Max Filippov Link: https://lore.kernel.org/r/20231010085926.1021667-4-jcmvbkbc@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9950802016da666c465d0fe9f11989aa80a5bc18 Author: Max Filippov Date: Tue Oct 10 01:59:23 2023 -0700 dt-bindings: serial: document esp32-uart Add documentation for the ESP32xx UART controllers. Signed-off-by: Max Filippov Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20231010085926.1021667-3-jcmvbkbc@gmail.com Signed-off-by: Greg Kroah-Hartman commit 23bf72faaebdf2cb199c0ef8cf96467b10904b35 Author: Max Filippov Date: Tue Oct 10 01:59:22 2023 -0700 serial: core: tidy invalid baudrate handling in uart_get_baud_rate uart_get_baud_rate has input parameters 'min' and 'max' limiting the range of acceptable baud rates from the caller's perspective. If neither current or old termios structures have acceptable baud rate setting and 9600 is not in the min/max range either the function returns 0 and issues a warning. However for a UART that does not support speed of 9600 baud this is expected behavior. Clarify that 0 can be (and always could be) returned from the uart_get_baud_rate. Don't issue a warning in that case. Signed-off-by: Max Filippov Link: https://lore.kernel.org/r/20231010085926.1021667-2-jcmvbkbc@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1ed59c5e17936c8f3a0fb7b4217af0b73298d2d7 Author: Julien Malik Date: Sat Jun 24 23:03:23 2023 +0200 serial: xilinx_uartps: unset STOPBRK when setting STARTBRK Zynq UG585 states, in chapter B.33, for XUARTPS_CR_STARTBRK: It can only be set if STPBRK (Stop transmitter break) is not high This fixes tcsendbreak, which otherwise does not actually break. Signed-Off-By: Julien Malik Link: https://lore.kernel.org/r/20230624210323.88455-1-julien.malik@unseenlabs.fr Signed-off-by: Greg Kroah-Hartman commit cee8e0cc9308ab55d4c3bd8eae5f6b4b65898e59 Author: Hugo Villeneuve Date: Wed Oct 11 09:03:17 2023 -0400 serial: max310x: remove trailing whitespaces Fix coding style. No functional changes. Signed-off-by: Hugo Villeneuve Link: https://lore.kernel.org/r/20231011130317.3562401-1-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman commit 2b97f5b56b01f90abe5587033ea6d262509aab97 Author: Hugo Villeneuve Date: Fri Oct 13 10:19:24 2023 -0400 dt-bindings: serial: sc16is7xx: move 'allOf' block after 'required' The 'allOf' block should go after the 'required' block according to DT bindings best practices. Signed-off-by: Hugo Villeneuve Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231013141925.3427158-2-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman commit 0b1691772131b68cacd798aefd5f601e48c02a74 Author: Hugo Villeneuve Date: Thu Oct 12 11:26:47 2023 -0400 dt-bindings: serial: max310x: convert to YAML Convert binding from text format to YAML. Additions to original text binding: - add rs485 reference. Signed-off-by: Hugo Villeneuve Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231012152647.2607455-1-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman commit 5220d8b04a840fa09434072c866d032b163419e3 Author: Fabio Estevam Date: Mon Oct 16 10:11:41 2023 -0300 dt-bindings: usb: gpio-sbu-mux: Make 'mode-switch' not required On a i.MX8QXP MEK board that has an NXP CBDTU02043 mux, there is no mode-switch support, only orientation switch. Make the 'mode-switch' property a non-required one. Signed-off-by: Fabio Estevam Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231016131141.680517-1-festevam@gmail.com Signed-off-by: Greg Kroah-Hartman commit 11110783f5ea866318831a56353c6f1c3fc0d8ed Author: Heikki Krogerus Date: Wed Oct 11 13:58:25 2023 +0300 usb: Inform the USB Type-C class about enumerated devices The Type-C port drivers can make PM related decisions based on is the device USB3 or USB2. Suggested-by: Benson Leung Tested-by: Benson Leung Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231011105825.320062-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 59de2a56d127890cc610f3896d5fc31887c54ac2 Author: Heikki Krogerus Date: Wed Oct 11 13:58:24 2023 +0300 usb: typec: Link enumerated USB devices with Type-C partner Adding functions that USB hub code can use to inform the Type-C class about connected USB devices. Once taken into use, it will allow the Type-C port drivers to power off components that are not needed, for example if USB2 device is enumerated, everything that is only relevant for USB3 (retimers, etc.), can be powered off. This will also create a symlink "typec" for the USB devices pointing to the USB Type-C partner device. Suggested-by: Benson Leung Tested-by: Benson Leung Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231011105825.320062-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 17d6b82d2d6d467149874b883cdba844844b996d Author: Hongren Zheng Date: Sat Oct 14 15:46:04 2023 +0800 usb/usbip: fix wrong data added to platform device .data of platform_device_info will be copied into .platform_data of struct device via platform_device_add_data. However, vhcis[i] contains a spinlock, is dynamically allocated and used by other code, so it is not meant to be copied. The workaround was to use void *vhci as an agent, but it was removed in the commit suggested below. This patch adds back the workaround and changes the way of using platform_data accordingly. Reported-by: syzbot+e0dbc33630a092ccf033@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/00000000000029242706077f3145@google.com/ Reported-by: syzbot+6867a9777f4b8dc4e256@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/0000000000007634c1060793197c@google.com/ Fixes: b8aaf639b403 ("usbip: Use platform_device_register_full()") Tested-by: syzbot+6867a9777f4b8dc4e256@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/0000000000007ac87d0607979b6b@google.com/ Signed-off-by: Hongren Zheng Reviewed-by: Andy Shevchenko Acked-by: Shuah Khan Link: https://lore.kernel.org/r/ZSpHPCaQ5DDA9Ysl@Sun Signed-off-by: Greg Kroah-Hartman commit 3425cec42c3ce0f65fe74e412756b567b152e61d Author: Ryan Roberts Date: Thu Oct 5 15:07:30 2023 +0100 arm64/mm: Hoist synchronization out of set_ptes() loop set_ptes() sets a physically contiguous block of memory (which all belongs to the same folio) to a contiguous block of ptes. The arm64 implementation of this previously just looped, operating on each individual pte. But the __sync_icache_dcache() and mte_sync_tags() operations can both be hoisted out of the loop so that they are performed once for the contiguous set of pages (which may be less than the whole folio). This should result in minor performance gains. __sync_icache_dcache() already acts on the whole folio, and sets a flag in the folio so that it skips duplicate calls. But by hoisting the call, all the pte testing is done only once. mte_sync_tags() operates on each individual page with its own loop. But by passing the number of pages explicitly, we can rely solely on its loop and do the checks only once. This approach also makes it robust for the future, rather than assuming if a head page of a compound page is being mapped, then the whole compound page is being mapped, instead we explicitly know how many pages are being mapped. The old assumption may not continue to hold once the "anonymous large folios" feature is merged. Signed-off-by: Ryan Roberts Reviewed-by: Steven Price Link: https://lore.kernel.org/r/20231005140730.2191134-1-ryan.roberts@arm.com Signed-off-by: Catalin Marinas commit 3d8a18697ad834436d088d65cc66165947cfe600 Author: Nathan Chancellor Date: Thu Oct 12 10:04:01 2023 -0700 remoteproc: st: Fix sometimes uninitialized ret in st_rproc_probe() Clang warns (or errors with CONFIG_WERROR=y): drivers/remoteproc/st_remoteproc.c:357:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] 357 | if (!ddata->config) | ^~~~~~~~~~~~~~ drivers/remoteproc/st_remoteproc.c:442:9: note: uninitialized use occurs here 442 | return ret; | ^~~ drivers/remoteproc/st_remoteproc.c:357:2: note: remove the 'if' if its condition is always false 357 | if (!ddata->config) | ^~~~~~~~~~~~~~~~~~~ 358 | goto free_rproc; | ~~~~~~~~~~~~~~~ drivers/remoteproc/st_remoteproc.c:348:9: note: initialize the variable 'ret' to silence this warning 348 | int ret, i; | ^ | = 0 1 error generated. Set ret to -ENODEV, which seems to be a standard return code when device_get_match_data() returns NULL. Closes: https://github.com/ClangBuiltLinux/linux/issues/1944 Fixes: 5c77ebcd05ac ("remoteproc: st: Use device_get_match_data()") Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20231012-st_remoteproc-fix-sometimes-uninit-v1-1-f64d0f2d5b37@kernel.org Signed-off-by: Mathieu Poirier commit 39d08b91646d83e87f7cbcd846b3ef33b1a53b79 Author: Daniel Borkmann Date: Mon Oct 9 11:26:55 2023 +0200 net, sched: Add tcf_set_drop_reason for {__,}tcf_classify Add an initial user for the newly added tcf_set_drop_reason() helper to set the drop reason for internal errors leading to TC_ACT_SHOT inside {__,}tcf_classify(). Right now this only adds a very basic SKB_DROP_REASON_TC_ERROR as a generic fallback indicator to mark drop locations. Where needed, such locations can be converted to more specific codes, for example, when hitting the reclassification limit, etc. Signed-off-by: Daniel Borkmann Cc: Jamal Hadi Salim Cc: Victor Nogueira Link: https://lore.kernel.org/r/20231009092655.22025-2-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 54a59aed395ce0f4177b5212e5746a6462de3ad9 Author: Daniel Borkmann Date: Mon Oct 9 11:26:54 2023 +0200 net, sched: Make tc-related drop reason more flexible Currently, the kfree_skb_reason() in sch_handle_{ingress,egress}() can only express a basic SKB_DROP_REASON_TC_INGRESS or SKB_DROP_REASON_TC_EGRESS reason. Victor kicked-off an initial proposal to make this more flexible by disambiguating verdict from return code by moving the verdict into struct tcf_result and letting tcf_classify() return a negative error. If hit, then two new drop reasons were added in the proposal, that is SKB_DROP_REASON_TC_INGRESS_ERROR as well as SKB_DROP_REASON_TC_EGRESS_ERROR. Further analysis of the actual error codes would have required to attach to tcf_classify via kprobe/kretprobe to more deeply debug skb and the returned error. In order to make the kfree_skb_reason() in sch_handle_{ingress,egress}() more extensible, it can be addressed in a more straight forward way, that is: Instead of placing the verdict into struct tcf_result, we can just put the drop reason in there, which does not require changes throughout various classful schedulers given the existing verdict logic can stay as is. Then, SKB_DROP_REASON_TC_ERROR{,_*} can be added to the enum skb_drop_reason to disambiguate between an error or an intentional drop. New drop reason error codes can be added successively to the tc code base. For internal error locations which have not yet been annotated with a SKB_DROP_REASON_TC_ERROR{,_*}, the fallback is SKB_DROP_REASON_TC_INGRESS and SKB_DROP_REASON_TC_EGRESS, respectively. Generic errors could be marked with a SKB_DROP_REASON_TC_ERROR code until they are converted to more specific ones if it is found that they would be useful for troubleshooting. While drop reasons have infrastructure for subsystem specific error codes which are currently used by mac80211 and ovs, Jakub mentioned that it is preferred for tc to use the enum skb_drop_reason core codes given it is a better fit and currently the tooling support is better, too. With regards to the latter: [...] I think Alastair (bpftrace) is working on auto-prettifying enums when bpftrace outputs maps. So we can do something like: $ bpftrace -e 'tracepoint:skb:kfree_skb { @[args->reason] = count(); }' Attaching 1 probe... ^C @[SKB_DROP_REASON_TC_INGRESS]: 2 @[SKB_CONSUMED]: 34 ^^^^^^^^^^^^ names!! Auto-magically. [...] Add a small helper tcf_set_drop_reason() which can be used to set the drop reason into the tcf_result. Signed-off-by: Daniel Borkmann Cc: Jamal Hadi Salim Cc: Victor Nogueira Link: https://lore.kernel.org/netdev/20231006063233.74345d36@kernel.org Reviewed-by: Jakub Kicinski Link: https://lore.kernel.org/r/20231009092655.22025-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 3fd2ca5be07f6a43211591a45b43df9e7b6eba00 Author: Chuck Lever Date: Fri Oct 13 08:22:24 2023 -0400 svcrdma: Fix tracepoint printk format Other tracepoints use "cq.id=" rather than "cq_id=". Let's make it more reliable to grep for the CQ restracker ID. Reviewed-by: Benjamin Coddington Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 197115ebf358cb440c73e868b2a0a5ef728decc6 Author: Chuck Lever Date: Tue Oct 10 13:23:41 2023 -0400 svcrdma: Drop connection after an RDMA Read error When an RPC Call message cannot be pulled from the client, that is a message loss, by definition. Close the connection to trigger the client to resend. Cc: Reviewed-by: Tom Talpey Signed-off-by: Chuck Lever commit 2ffda63c98f4eb2fdca49a93017bed1ad3ae00e7 Author: Sicong Huang Date: Thu Oct 12 16:34:58 2023 +0800 NFSD: clean up alloc_init_deleg() Modify the conditional statement for null pointer check in the function 'alloc_init_deleg' to make this function more robust and clear. Otherwise, this function may have potential pointer dereference problem in the future, when modifying or expanding the nfs4_delegation structure. Signed-off-by: Sicong Huang Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 6939ace1f22681fface7841cdbf34d3204cc94b5 Author: Chuck Lever Date: Sun Oct 1 13:25:16 2023 -0400 NFSD: Fix frame size warning in svc_export_parse() fs/nfsd/export.c: In function 'svc_export_parse': fs/nfsd/export.c:737:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=] 737 | } On my systems, svc_export_parse() has a stack frame of over 800 bytes, not 1040, but nonetheless, it could do with some reduction. When a struct svc_export is on the stack, it's a temporary structure used as an argument, and not visible as an actual exported FS. No need to reserve space for export_stats in such cases. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310012359.YEw5IrK6-lkp@intel.com/ Cc: Amir Goldstein Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 5ec39944f874e1ecc09f624a70dfaa8ac3bf9d08 Author: Chuck Lever Date: Sun Oct 1 13:25:09 2023 -0400 NFSD: Rewrite synopsis of nfsd_percpu_counters_init() In function ‘export_stats_init’, inlined from ‘svc_export_alloc’ at fs/nfsd/export.c:866:6: fs/nfsd/export.c:337:16: warning: ‘nfsd_percpu_counters_init’ accessing 40 bytes in a region of size 0 [-Wstringop-overflow=] 337 | return nfsd_percpu_counters_init(&stats->counter, EXP_STATS_COUNTERS_NUM); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/nfsd/export.c:337:16: note: referencing argument 1 of type ‘struct percpu_counter[0]’ fs/nfsd/stats.h: In function ‘svc_export_alloc’: fs/nfsd/stats.h:40:5: note: in a call to function ‘nfsd_percpu_counters_init’ 40 | int nfsd_percpu_counters_init(struct percpu_counter counters[], int num); | ^~~~~~~~~~~~~~~~~~~~~~~~~ Cc: Amir Goldstein Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit afb8aae519bcdbcc9d9d8d07e249fe4131381e8c Author: KaiLong Wang Date: Thu Sep 28 10:51:55 2023 +0800 nfsd: Clean up errors in nfs3proc.c Fix the following errors reported by checkpatch: ERROR: need consistent spacing around '+' (ctx:WxV) ERROR: spaces required around that '?' (ctx:VxW) Signed-off-by: KaiLong Wang Signed-off-by: Chuck Lever commit 03a0497f83c25292e11c934ee1a2f769f14b4f3c Author: KaiLong Wang Date: Thu Sep 28 10:43:04 2023 +0800 nfsd: Clean up errors in nfs4state.c Fix the following errors reported by checkpatch: ERROR: spaces required around that '=' (ctx:VxW) ERROR: space required after that ',' (ctx:VxO) ERROR: space required before that '~' (ctx:OxV) Signed-off-by: KaiLong Wang Signed-off-by: Chuck Lever commit 0e5559ebe7f48d7957587e441abdaa331133d503 Author: KaiLong Wang Date: Thu Sep 28 10:35:16 2023 +0800 NFSD: Clean up errors in stats.c Fix the following errors reported by checkpatch: ERROR: space required after that ',' (ctx:VxV) Signed-off-by: KaiLong Wang Signed-off-by: Chuck Lever commit bf32075256e9dd9c6b736859e2c5813981339908 Author: NeilBrown Date: Mon Sep 25 12:06:44 2023 +1000 NFSD: simplify error paths in nfsd_svc() The error paths in nfsd_svc() are needlessly complex and can result in a final call to svc_put() without nfsd_last_thread() being called. This results in the listening sockets not being closed properly. The per-netns setup provided by nfsd_startup_new() and removed by nfsd_shutdown_net() is needed precisely when there are running threads. So we don't need nfsd_up_before. We don't need to know if it *was* up. We only need to know if any threads are left. If none are, then we must call nfsd_shutdown_net(). But we don't need to do that explicitly as nfsd_last_thread() does that for us. So simply call nfsd_last_thread() before the last svc_put() if there are no running threads. That will always do the right thing. Also discard: pr_info("nfsd: last server has exited, flushing export cache\n"); It may not be true if an attempt to start the first server failed, and it isn't particularly helpful and it simply reports normal behaviour. Signed-off-by: NeilBrown Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 1f121e2de4857258ac9ecf6d1844f2d581612395 Author: Chuck Lever Date: Mon Oct 9 14:30:29 2023 -0400 NFSD: Clean up nfsd4_encode_seek() Use modern XDR encoder utilities. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit b609ad60b7adcb0594fa2278f1d8ffecc4fd07d4 Author: Chuck Lever Date: Mon Oct 9 14:30:23 2023 -0400 NFSD: Clean up nfsd4_encode_offset_status() Use modern XDR encoder utilities. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 21d316a767ac2ebc9de281cd2ec5f3c22827dd8e Author: Chuck Lever Date: Mon Oct 9 14:30:16 2023 -0400 NFSD: Clean up nfsd4_encode_copy_notify() Replace open-coded encoding logic with the use of conventional XDR utility functions. Note that if we replace the cpn_sec and cpn_nsec fields with a single struct timespec64 field, the encoder can use nfsd4_encode_nfstime4(), as that is the data type specified by the XDR spec. NFS4ERR_INVAL seems inappropriate if the encoder doesn't support encoding the response. Instead use NFS4ERR_SERVERFAULT, since this condition is a software bug on the server. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 02e0297f160aa1ba9835fed3c97845c9450c2dc3 Author: Chuck Lever Date: Mon Oct 9 14:30:09 2023 -0400 NFSD: Clean up nfsd4_encode_copy() Restructure this function using conventional XDR utility functions and so it aligns better with the XDR in the specification. I've also moved nfsd4_encode_copy() closer to the data type encoders that only it uses. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 08b4436afb5034be9054b33035c5bb3ff5eec0ea Author: Chuck Lever Date: Mon Oct 9 14:30:03 2023 -0400 NFSD: Clean up nfsd4_encode_test_stateid() Use conventional XDR utilities. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit abef972cf58255749ec0fbd6b581f533401c8473 Author: Chuck Lever Date: Mon Oct 9 14:29:56 2023 -0400 NFSD: Clean up nfsd4_encode_exchange_id() Restructure nfsd4_encode_exchange_id() so that it will be more straightforward to add support for SSV one day. Also, adopt the use of the conventional XDR utility functions. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 91c7a9057cfb5a8fda2831e98a6d147817b71744 Author: Chuck Lever Date: Mon Oct 9 14:29:49 2023 -0400 NFSD: Clean up nfsd4_do_encode_secinfo() Refactor nfsd4_encode_secinfo() so it is more clear what XDR data item is being encoded by which piece of code. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit d38e570f1915f45708f72129055ea2fb6ad686b3 Author: Chuck Lever Date: Mon Oct 9 14:29:43 2023 -0400 NFSD: Clean up nfsd4_encode_access() Convert nfsd4_encode_access() to use modern XDR utility functions. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 25c307acc8203fc8b20bcb3f5029b149ce754bbf Author: Chuck Lever Date: Wed Oct 4 09:42:10 2023 -0400 NFSD: Clean up nfsd4_encode_readdir() Untangle nfsd4_encode_readdir() so it is more clear what XDR data item is being encoded by which piece of code. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit a1aee9aa35765ad18dfbcf42a05563da33038bbe Author: Chuck Lever Date: Wed Oct 4 09:42:03 2023 -0400 NFSD: Clean up nfsd4_encode_entry4() Reshape nfsd4_encode_entry4() to be more like the legacy dirent encoders, which were recently rewritten to use xdr_stream. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 3fc5048cb39f24e6b7c465cd59fb8d454d401a4c Author: Chuck Lever Date: Wed Oct 4 09:41:57 2023 -0400 NFSD: Add an nfsd4_encode_nfs_cookie4() helper De-duplicate the entry4 cookie encoder, similar to the arrangement for the NFSv2 and NFSv3 directory entry encoders. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit a0d042f823fd78eec9e762edd70db1cfa4e3df27 Author: Chuck Lever Date: Wed Oct 4 09:41:51 2023 -0400 NFSD: Clean up nfsd4_encode_rdattr_error() No need for specialized code here, as this function is invoked only rarely. Convert it to encode to xdr_stream using conventional XDR helpers. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit a0f3c835159896d2395392436c8994c0b6d948ef Author: Chuck Lever Date: Wed Oct 4 09:41:44 2023 -0400 NFSD: Rename nfsd4_encode_dirent() Rename nfsd4_encode_dirent() to match the naming convention already used in the NFSv2 and NFSv3 readdir paths. The new name reflects the name of the spec-defined XDR data type for an NFSv4 directory entry. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 6621b88b4b2189a0dd601cd036e27a829868df31 Author: Chuck Lever Date: Mon Oct 2 10:51:37 2023 -0400 NFSD: Clean up nfsd4_encode_sequence() De-duplicate open-coded encoding of the sessionid, and convert the rest of the function to use conventional XDR utility functions. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit b0c1b1ba142601c24333d5d38461396f11dae478 Author: Chuck Lever Date: Mon Oct 2 10:51:30 2023 -0400 NFSD: Restructure nfsd4_encode_create_session() Convert nfsd4_encode_create_session() to use the conventional XDR encoding utilities. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 150990f49dd1781dbee7b6305cf978a47f646811 Author: Chuck Lever Date: Mon Oct 2 10:51:24 2023 -0400 NFSD: Add nfsd4_encode_channel_attr4() De-duplicate the encoding of the fore channel and backchannel attributes. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 65baa60953192a587f2495a98fde9c5e1802a225 Author: Chuck Lever Date: Mon Oct 2 10:51:17 2023 -0400 NFSD: Add a utility function for encoding sessionid4 objects There is more than one NFSv4 operation that needs to encode a sessionid4, so extract that data type into a separate helper. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 841735b3fdfe518f21c80ca3ae48a1edfc957525 Author: Chuck Lever Date: Fri Sep 29 09:59:31 2023 -0400 NFSD: Clean up nfsd4_encode_open() Finish cleaning up nfsd4_encode_open(). Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 802e191353e496f7ad5b00954b4643a1b8d726b5 Author: Chuck Lever Date: Fri Sep 29 09:59:24 2023 -0400 NFSD: Add nfsd4_encode_open_delegation4() To better align our implementation with the XDR specification, refactor the part of nfsd4_encode_open() that encodes delegation metadata. As part of that refactor, remove an unnecessary BUG() call site and a comment that appears to be stale. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 6dd43c6d5112ffde72fdef782e0970cd27041e79 Author: Chuck Lever Date: Fri Sep 29 09:59:18 2023 -0400 NFSD: Add nfsd4_encode_open_none_delegation4() To better align our implementation with the XDR specification, refactor the part of nfsd4_encode_open() that encodes the open_none_delegation4 type. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 32efa67435dcd745d689ba373d5259aa61d05eb7 Author: Chuck Lever Date: Fri Sep 29 09:59:12 2023 -0400 NFSD: Add nfsd4_encode_open_write_delegation4() Make it easier to adjust the XDR encoder to handle new features related to write delegations. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit e4ad7ce775eee3b1271b9ef0dc1dbdc47cf6a00c Author: Chuck Lever Date: Fri Sep 29 09:59:05 2023 -0400 NFSD: Add nfsd4_encode_open_read_delegation4() Refactor nfsd4_encode_open() so the open_read_delegation4 type is encoded in a separate function. This makes it more straightforward to later add support for returning an nfsace4 in OPEN responses that offer a delegation. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit c564178290ee068efb87d81654fc03aa01464a0c Author: Chuck Lever Date: Fri Sep 29 09:58:59 2023 -0400 NFSD: Refactor nfsd4_encode_lock_denied() Use the modern XDR utility functions. The LOCK and LOCKT encoder functions need to return nfserr_denied when a lock is denied, but nfsd4_encode_lock4denied() should return a status code that is consistent with other XDR encoders. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit c4a29c52506519eeb447800d88a22a6f7bce976c Author: Chuck Lever Date: Fri Sep 29 09:58:53 2023 -0400 NFSD: Add nfsd4_encode_lock_owner4() To improve readability and better align the LOCK encoders with the XDR specification, add an explicit encoder named for the lock_owner4 type. In particular, to avoid code duplication, use nfsd4_encode_clientid4() to encode the clientid in the lock owner rather than open-coding it. It looks to me like nfs4_set_lock_denied() already clears the clientid if it won't return an owner (cf: the nevermind: label). The code in the XDR encoder appears to be redundant and can safely be removed. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 92d82e995ee221578a729998d11d0fa7fbb3e41c Author: Chuck Lever Date: Thu Oct 12 13:46:39 2023 -0400 NFSD: Remove a layering violation when encoding lock_denied An XDR encoder is responsible for marshaling results, not releasing memory that was allocated by the upper layer. We have .op_release for that purpose. Move the release of the ld_owner.data string to op_release functions for LOCK and LOCKT. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 4bbe42e8724bc5a65f6129a4e49fa4b11f617226 Author: Chuck Lever Date: Mon Sep 25 09:28:23 2023 -0400 NFSD: Clean up nfsd4_encode_getdeviceinfo() Adopt the conventional XDR utility functions. Also, restructure to make the function align more closely with the spec -- there doesn't seem to be a performance need for speciality code, so prioritize readability. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 82e93bab50625deef545bc5291fd2749e9aabcd6 Author: Chuck Lever Date: Mon Sep 25 09:28:17 2023 -0400 NFSD: Make @gdev parameter of ->encode_getdeviceinfo a const pointer This enables callers to be passed const pointer parameters. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 85dbc978b33be6f5e2e06e34b5219d730d5f9aa4 Author: Chuck Lever Date: Mon Sep 25 09:28:10 2023 -0400 NFSD: Clean up nfsd4_encode_layoutreturn() Adopt the use of conventional XDR utility functions. Restructure the encoder to better align with the XDR definition of the result. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit cc313f80d0591aa5076761ce1854e3ef144084ec Author: Chuck Lever Date: Mon Sep 25 09:28:04 2023 -0400 NFSD: Clean up nfsd4_encode_layoutcommit() Adopt the use of conventional XDR utility functions. Restructure the encoder to better align with the XDR definition of the result. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 69f5f0194a7f0f6bb22676a75dc81357a6d22698 Author: Chuck Lever Date: Mon Sep 25 09:27:58 2023 -0400 NFSD: Clean up nfsd4_encode_layoutget() De-duplicate the open-coded stateid4 encoder. Adopt the use of the conventional current XDR encoding helpers. Refactor the encoder to align with the XDR specification. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 73debe47df8e7535e3ca86a050cfd988133fea77 Author: Chuck Lever Date: Mon Sep 25 09:27:51 2023 -0400 NFSD: Make @lgp parameter of ->encode_layoutget a const pointer This enables callers to be passed const pointer parameters. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 40bb2baaa8edecfc21a3c176e4af1a3445157677 Author: Chuck Lever Date: Mon Sep 25 09:27:45 2023 -0400 NFSD: Clean up nfsd4_encode_stateid() Update the encoder function name to match the type name, as is the convention with other such encoder utility functions, and with nfsd4_decode_stateid4(). Make the @stateid argument a const so that callers of nfsd4_encode_stateid4() in the future can be passed const pointers to structures. Since the compiler is allowed to add padding to structs, use the wire (spec-defined) size when reserving buffer space. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 76bebcc7640eaac7213ab6ef97b3376733c69123 Author: Chuck Lever Date: Mon Sep 25 09:27:38 2023 -0400 NFSD: Add nfsd4_encode_count4() This is a synonym for nfsd4_encode_uint32_t() that matches the name of the XDR type. It will get at least one more use in a subsequent patch. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit ae1131d45bf9e110a0f95e9ada64a59693ccf21e Author: Chuck Lever Date: Mon Sep 18 10:02:18 2023 -0400 NFSD: Rename nfsd4_encode_fattr() For better alignment with the specification, NFSD's encoder function name should match the name of the XDR data type. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit fce7913b13d0270bcf926f986b7ef329e2e56eec Author: Chuck Lever Date: Mon Sep 18 10:02:12 2023 -0400 NFSD: Use a bitmask loop to encode FATTR4 results The fattr4 encoder is now structured like the COMPOUND op encoder: one function for each individual attribute, called by bit number. Benefits include: - The individual attributes are now guaranteed to be encoded in bitmask order into the send buffer - There can be no unwanted side effects between attribute encoders - The code now clearly documents which attributes are /not/ implemented on this server Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit be46e695fb95c8acfb342f3182595aaad45301d5 Author: Chuck Lever Date: Mon Sep 18 10:02:06 2023 -0400 NFSD: Copy FATTR4 bit number definitions from RFCs I'd like to convert nfsd4_encode_fattr() to rotate through the attrmask using for_each_bit() instead of explicitly testing the bitmask for each bit value. This means I need the bit numbers, as defined in the specs, instead of our internal bitmask constants. As a clean up, use the new spec-derived values to define the WORD# bitmask constants. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit b3dbf4e4a2018e21503bc8326ceee5eb90f2966e Author: Chuck Lever Date: Mon Sep 18 10:01:59 2023 -0400 NFSD: Add nfsd4_encode_fattr4_xattr_support() Refactor the encoder for FATTR4_XATTR_SUPPORT into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit f59388a579c6a395de8f7372b267d3abecd8d6bf Author: Chuck Lever Date: Mon Sep 18 10:01:53 2023 -0400 NFSD: Add nfsd4_encode_fattr4_sec_label() Refactor the encoder for FATTR4_SEC_LABEL into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 345c3877d27d6f69d7236fd0f92d2201bd6bb335 Author: Chuck Lever Date: Mon Sep 18 10:01:47 2023 -0400 NFSD: Add nfsd4_encode_fattr4_suppattr_exclcreat() Refactor the encoder for FATTR4_SUPPATTR_EXCLCREAT into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 4c5847313b137ed7241e532d7f281c36a71055b0 Author: Chuck Lever Date: Mon Sep 18 10:01:40 2023 -0400 NFSD: Add nfsd4_encode_fattr4_layout_blksize() Refactor the encoder for FATTR4_LAYOUT_BLKSIZE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 4c15878e66db7eaba1968c4fb94a8cbd7c24c819 Author: Chuck Lever Date: Mon Sep 18 10:01:34 2023 -0400 NFSD: Add nfsd4_encode_fattr4_layout_types() Refactor the encoder for FATTR4_LAYOUT_TYPES into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit e7a5b1b2ad8515ed6a093307318ebfd3bde6a54f Author: Chuck Lever Date: Mon Sep 18 10:01:28 2023 -0400 NFSD: Add nfsd4_encode_fattr4_fs_layout_types() Refactor the encoder for FATTR4_FS_LAYOUT_TYPES into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 1b9097e36688a5624a8db7db575030e25dcd075c Author: Chuck Lever Date: Mon Sep 18 10:01:21 2023 -0400 NFSD: Add nfsd4_encode_fattr4_mounted_on_fileid() Refactor the encoder for FATTR4_MOUNTED_ON_FILEID into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit d18286112de367ac19a6f1003299d6db013ca05b Author: Chuck Lever Date: Mon Sep 18 10:01:15 2023 -0400 NFSD: Add nfsd4_encode_fattr4_time_modify() Refactor the encoder for FATTR4_TIME_MODIFY into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 673720bc84bc9513a0488b7a3633a7c38a526ee5 Author: Chuck Lever Date: Mon Sep 18 10:01:09 2023 -0400 NFSD: Add nfsd4_encode_fattr4_time_metadata() Refactor the encoder for FATTR4_TIME_METADATA into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 993474e8a60f01010f19ac008078c78ef25a84e7 Author: Chuck Lever Date: Mon Sep 18 10:01:02 2023 -0400 NFSD: Add nfsd4_encode_fattr4_time_delta() Refactor the encoder for FATTR4_TIME_DELTA into a helper. In a subsequent patch, this helper will be called from a bitmask loop. fattr4_time_delta is specified as an nfstime4, so de-duplicate this encoder. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 2e38722d4af86225d8ec524618036a03f0c98cc6 Author: Chuck Lever Date: Mon Sep 18 10:00:56 2023 -0400 NFSD: Add nfsd4_encode_fattr4_time_create() Refactor the encoder for FATTR4_TIME_CREATE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit eed4d1adbbd268be2a5e75be770b58097d668982 Author: Chuck Lever Date: Mon Sep 18 10:00:50 2023 -0400 NFSD: Add nfsd4_encode_fattr4_time_access() Refactor the encoder for FATTR4_TIME_ACCESS into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 6d37ac3adb310dabe78e5ff0289f4bfeceda2114 Author: Chuck Lever Date: Mon Sep 18 10:00:43 2023 -0400 NFSD: Add nfsd4_encode_fattr4_space_used() Refactor the encoder for FATTR4_SPACE_USED into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit d0cde979e912706ab331b9d2ad31f311a9f35f80 Author: Chuck Lever Date: Mon Sep 18 10:00:37 2023 -0400 NFSD: Add nfsd4_encode_fattr4_space_total() Refactor the encoder for FATTR4_SPACE_TOTAL into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 74ebc697053244874bf78a5fe471bdddc150d8af Author: Chuck Lever Date: Mon Sep 18 10:00:30 2023 -0400 NFSD: Add nfsd4_encode_fattr4_space_free() Refactor the encoder for FATTR4_SPACE_FREE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 83afa091795fffaa6d6322b87dc7d33d445cc1b2 Author: Chuck Lever Date: Mon Sep 18 10:00:24 2023 -0400 NFSD: Add nfsd4_encode_fattr4_space_avail() Refactor the encoder for FATTR4_SPACE_AVAIL into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit a460cda28e9b3709794932a0158d7ded57a32136 Author: Chuck Lever Date: Mon Sep 18 10:00:18 2023 -0400 NFSD: Add nfsd4_encode_fattr4_rawdev() Refactor the encoder for FATTR4_RAWDEV into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 62f31e56d51a10e5c8867d64c83a3679bc71184b Author: Chuck Lever Date: Mon Sep 18 10:00:11 2023 -0400 NFSD: Add nfsd4_encode_fattr4_owner_group() Refactor the encoder for FATTR4_OWNER_GROUP into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit fa51a5201bb90a4cf291b5ad5f6ee1af8be5548c Author: Chuck Lever Date: Mon Sep 18 10:00:05 2023 -0400 NFSD: Add nfsd4_encode_fattr4_owner() Refactor the encoder for FATTR4_OWNER into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 9f329fea25188def0a42bacd27894c877bb599c8 Author: Chuck Lever Date: Mon Sep 18 09:59:59 2023 -0400 NFSD: Add nfsd4_encode_fattr4_numlinks() Refactor the encoder for FATTR4_NUMLINKS into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit f4cf5042011223fcfec863ddd55e5cb6c4b50827 Author: Chuck Lever Date: Mon Sep 18 09:59:52 2023 -0400 NFSD: Add nfsd4_encode_fattr4_mode() Refactor the encoder for FATTR4_MODE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 951378dc9698a34e28c6badccdf9e95f2d3cf5d1 Author: Chuck Lever Date: Mon Sep 18 09:59:46 2023 -0400 NFSD: Add nfsd4_encode_fattr4_maxwrite() Refactor the encoder for FATTR4_MAXWRITE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit c17195c3972b42745460f09b9778e8d9061762a4 Author: Chuck Lever Date: Mon Sep 18 09:59:39 2023 -0400 NFSD: Add nfsd4_encode_fattr4_maxread() Refactor the encoder for FATTR4_MAXREAD into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 9c1adaccd1657c3153454635890c5d49b3eabfc6 Author: Chuck Lever Date: Mon Sep 18 09:59:33 2023 -0400 NFSD: Add nfsd4_encode_fattr4_maxname() Refactor the encoder for FATTR4_MAXNAME into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit b066aa5ca3c8c5df9194cde8a07e896a96218426 Author: Chuck Lever Date: Mon Sep 18 09:59:27 2023 -0400 NFSD: Add nfsd4_encode_fattr4_maxlink() Refactor the encoder for FATTR4_MAXLINK into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 7c605dccc551130975021a9b603b1766bf36d00e Author: Chuck Lever Date: Mon Sep 18 09:59:20 2023 -0400 NFSD: Add nfsd4_encode_fattr4_maxfilesize() Refactor the encoder for FATTR4_MAXFILESIZE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit a1469a370472fb77a1a5c3545e9c2d7fee8775c3 Author: Chuck Lever Date: Mon Sep 18 09:59:14 2023 -0400 NFSD: Add nfsd4_encode_fattr4_fs_locations() Refactor the encoder for FATTR4_FS_LOCATIONS into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit b56b75266300d5d4042678b6d65953ae94ec1486 Author: Chuck Lever Date: Mon Sep 18 09:59:08 2023 -0400 NFSD: Add nfsd4_encode_fattr4_files_total() Refactor the encoder for FATTR4_FILES_TOTAL into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 74361e2b5d252ffda6d366548167ec1e8be4358f Author: Chuck Lever Date: Mon Sep 18 09:59:01 2023 -0400 NFSD: Add nfsd4_encode_fattr4_files_free() Refactor the encoder for FATTR4_FILES_FREE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit b0c3a5f8c8caf05196560a7edbc69e10f3497817 Author: Chuck Lever Date: Mon Sep 18 09:58:55 2023 -0400 NFSD: Add nfsd4_encode_fattr4_files_avail() Refactor the encoder for FATTR4_FILES_AVAIL into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit eb7ece81d5fcd3d2bc54a33040967f24e7c5b317 Author: Chuck Lever Date: Mon Sep 18 09:58:49 2023 -0400 NFSD: Add nfsd4_encode_fattr4_fileid() Refactor the encoder for FATTR4_FILEID into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 3283bf64ef2d9c98399e37e64a5b8d9c57c80dfe Author: Chuck Lever Date: Mon Sep 18 09:58:42 2023 -0400 NFSD: Add nfsd4_encode_fattr4_filehandle() Refactor the encoder for FATTR4_FILEHANDLE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. We can de-duplicate the other filehandle encoder (in GETFH) using our new helper. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 07455dc45d973beb898277a71a2131610ebd1756 Author: Chuck Lever Date: Mon Sep 18 09:58:36 2023 -0400 NFSD: Add nfsd4_encode_fattr4_acl() Refactor the encoder for FATTR4_ACL into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 0207ee08182f5232e6e289f73909f18fa0c1575b Author: Chuck Lever Date: Mon Sep 18 09:58:30 2023 -0400 NFSD: Add nfsd4_encode_nfsace4() Refactor the ACE encoding helper so that it can eventually be reused for encoding OPEN results that contain delegation ACEs. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 6515b7d71de72850143bdd996b032dbdffda0848 Author: Chuck Lever Date: Mon Sep 18 09:58:23 2023 -0400 NFSD: Add nfsd4_encode_fattr4_aclsupport() Refactor the encoder for FATTR4_ACLSUPPORT into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 782448e1ec3ef1bd6f7a7ee29ca1fe11a14d9d5f Author: Chuck Lever Date: Mon Sep 18 09:58:17 2023 -0400 NFSD: Add nfsd4_encode_fattr4_rdattr_error() Refactor the encoder for FATTR4_RDATTR_ERROR into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 1252b283aae2b131f6d38fdff8792dfe9d4a536e Author: Chuck Lever Date: Mon Sep 18 09:58:10 2023 -0400 NFSD: Add nfsd4_encode_fattr4_lease_time() Refactor the encoder for FATTR4_LEASE_TIME into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit b6b6259590c5f6d1b2480285d4d5bc8e907caf8f Author: Chuck Lever Date: Mon Sep 18 09:58:04 2023 -0400 NFSD: Add nfsd4_encode_fattr4_fsid() Refactor the encoder for FATTR4_FSID into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit d0b28aadfd8d0836a9d9f6f9665925897e5223cb Author: Chuck Lever Date: Mon Sep 18 09:57:58 2023 -0400 NFSD: Add nfsd4_encode_fattr4_size() Refactor the encoder for FATTR4_SIZE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 263453d9bb46ad42f03a0f86aafe580f1b0e9291 Author: Chuck Lever Date: Mon Sep 18 09:57:51 2023 -0400 NFSD: Add nfsd4_encode_fattr4_change() Refactor the encoder for FATTR4_CHANGE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. The code is restructured a bit to use the modern xdr_stream flow, and the encoded cinfo value is made const so that callers of the encoders can be passed a const cinfo. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 36ed7e64947756baa69cfad323898b342bf71a02 Author: Chuck Lever Date: Mon Sep 18 09:57:45 2023 -0400 NFSD: Add nfsd4_encode_fattr4_fh_expire_type() Refactor the encoder for FATTR4_FH_EXPIRE_TYPE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit b06cf3754523682ff92fbc0f7702c32a024a4819 Author: Chuck Lever Date: Mon Sep 18 09:57:39 2023 -0400 NFSD: Add nfsd4_encode_fattr4_type() Refactor the encoder for FATTR4_TYPE into a helper. In a subsequent patch, this helper will be called from a bitmask loop. In addition, restructure the code so that byte-swapping is done on constant values rather than at run time. Run-time swapping can be costly on some platforms, and "type" is a frequently-requested attribute. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit c9090e273300cd30dff05ce870a4c18f476a2f32 Author: Chuck Lever Date: Mon Sep 18 09:57:32 2023 -0400 NFSD: Add nfsd4_encode_fattr4_supported_attrs() Refactor the encoder for FATTR4_SUPPORTED_ATTRS into a helper. In a subsequent patch, this helper will be called from a bitmask loop. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 8c4422881f73d77a259352e0e93b7bdaf172768a Author: Chuck Lever Date: Mon Sep 18 09:57:26 2023 -0400 NFSD: Add nfsd4_encode_fattr4__false() Add an encoding helper that encodes a single boolean "false" value. Attributes that always return "false" can use this helper. In a subsequent patch, this helper will be called from a bitmask loop, so it is given a standardized synopsis. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit c88cb4727a77220ba2bc8f09aa01ec2aeb0be033 Author: Chuck Lever Date: Mon Sep 18 09:57:19 2023 -0400 NFSD: Add nfsd4_encode_fattr4__true() Add an encoding helper that encodes a single boolean "true" value. Attributes that always return "true" can use this helper. In a subsequent patch, this helper will be called from a bitmask loop, so it is given a standardized synopsis. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 83ab8678ad0c6f27594c716cafe59c8bbd5e49ef Author: Chuck Lever Date: Mon Sep 18 09:57:13 2023 -0400 NFSD: Add struct nfsd4_fattr_args I'm about to split nfsd4_encode_fattr() into a number of smaller functions. Instead of passing a large number of arguments to each of the smaller functions, create a struct that can gather the common argument variables into something with a convenient handle on it. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit c3dcb45bcd071ae86821bfff428cd3b1ac38e6f0 Author: Chuck Lever Date: Mon Sep 18 09:57:07 2023 -0400 NFSD: Clean up nfsd4_encode_setattr() De-duplicate the encoding of bitmap4 results in nfsd4_encode_setattr(). Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit e64301f51b2ab4808180a3fb0731d4ed66836312 Author: Chuck Lever Date: Mon Sep 18 09:57:00 2023 -0400 NFSD: Rename nfsd4_encode_bitmap() For alignment with the specification, the name of NFSD's encoder function should match the name of the XDR type. I've also replaced a few "naked integers" with symbolic constants that better reflect the usage of these values. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 6cc58291408bea96787d06ca3f5074fdfb3152ca Author: Chuck Lever Date: Mon Sep 18 09:56:54 2023 -0400 NFSD: Add simple u32, u64, and bool encoders The generic XDR encoders return a length or a negative errno. NFSv4 encoders want to know simply whether the encode ran out of stream buffer space. The return values for server-side encoding are either nfs_ok or nfserr_resource. So far I've found it adds a lot of duplicate code to try to use the generic XDR encoder utilities when encoding the simple data types in the NFSv4 operation encoders. Add a set of NFSv4-specific utilities that handle the basic XDR data types. These are added in xdr4.h so they might eventually be used by the callback server and pNFS driver encoders too. Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 789ce196a31dd13276076762204bee87df893e53 Author: Chuck Lever Date: Tue Sep 19 11:35:15 2023 -0400 SUNRPC: Remove BUG_ON call sites There is no need to take down the whole system for these assertions. I'd rather not attempt a heroic save here, as some bug has occurred that has left the transport data structures in an unknown state. Just warn and then leak the left-over resources. Acked-by: Christian Brauner Reviewed-by: NeilBrown Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 2929ba9b460c13625cb47ed4e2de134f966bdf17 Author: Kinglong Mee Date: Mon Sep 18 14:59:06 2023 +0800 nfs: fix the typo of rfc number about xattr in NFSv4 Signed-off-by: Kinglong Mee Signed-off-by: Chuck Lever commit f14122b2c2acdf5b7ee63c1543ecf9e554e1be1e Author: Chuck Lever Date: Thu Oct 5 08:41:20 2023 -0400 tools: ynl: Add source files for nfsd netlink protocol Signed-off-by: Chuck Lever commit bd9d6a3efa9709e653aafbeb859289feccb8e70c Author: Lorenzo Bianconi Date: Mon Sep 11 14:49:46 2023 +0200 NFSD: add rpc_status netlink support Introduce rpc_status netlink support for NFSD in order to dump pending RPC requests debugging information from userspace. Closes: https://bugzilla.linux-nfs.org/show_bug.cgi?id=366 Tested-by: Jeff Layton Signed-off-by: Lorenzo Bianconi Signed-off-by: Chuck Lever commit 13727f85b49babcc40db805118e665605cd040dc Author: Lorenzo Bianconi Date: Mon Sep 11 14:49:44 2023 +0200 NFSD: introduce netlink stubs Generate stubs and uAPI for nfsd netlink protocol. For the moment, the new protocol has one operation: rpc_status. The generated header and source files are created by running: tools/net/ynl/ynl-regen.sh Tested-by: Jeff Layton Signed-off-by: Lorenzo Bianconi Acked-by: Jeff Layton Signed-off-by: Chuck Lever commit 6c41d9a9bd0298002805758216a9c44e38a8500d Author: Dai Ngo Date: Wed Sep 13 16:38:21 2023 -0700 NFSD: handle GETATTR conflict with write delegation If the GETATTR request on a file that has write delegation in effect and the request attributes include the change info and size attribute then the request is handled as below: Server sends CB_GETATTR to client to get the latest change info and file size. If these values are the same as the server's cached values then the GETATTR proceeds as normal. If either the change info or file size is different from the server's cached values, or the file was already marked as modified, then: . update time_modify and time_metadata into file's metadata with current time . encode GETATTR as normal except the file size is encoded with the value returned from CB_GETATTR . mark the file as modified If the CB_GETATTR fails for any reasons, the delegation is recalled and NFS4ERR_DELAY is returned for the GETATTR. Signed-off-by: Dai Ngo Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 738401a9bd1ac34ccd5723d69640a4adbb1a4bc0 Author: Dai Ngo Date: Wed Sep 13 16:38:20 2023 -0700 NFSD: add support for CB_GETATTR callback Includes: . CB_GETATTR proc for nfs4_cb_procedures[] . XDR encoding and decoding function for CB_GETATTR request/reply . add nfs4_cb_fattr to nfs4_delegation for sending CB_GETATTR and store file attributes from client's reply. Signed-off-by: Dai Ngo Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 15d39883ee7dfc023d8a24f5d4b58100e1d04ad9 Author: NeilBrown Date: Mon Sep 11 10:40:22 2023 -0400 SUNRPC: change the back-channel queue to lwq This removes the need to store and update back-links in the list. It also remove the need for the _bh version of spin_lock(). Signed-off-by: NeilBrown Cc: Trond Myklebust Cc: Anna Schumaker Signed-off-by: Chuck Lever commit 580a25756a9f639180b29a508f3bdd24c50a936a Author: NeilBrown Date: Mon Sep 11 10:40:15 2023 -0400 SUNRPC: discard sp_lock sp_lock is now only used to protect sp_all_threads. This isn't needed as sp_all_threads is only manipulated through svc_set_num_threads(), which is already serialized. Read-acccess only requires rcu_read_lock(). So no more locking is needed. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 2e8fc923fe476db8cab9b6458027eccb22f3b6e6 Author: NeilBrown Date: Mon Sep 11 10:40:09 2023 -0400 SUNRPC: change sp_nrthreads to atomic_t Using an atomic_t avoids the need to take a spinlock (which can soon be removed). Choosing a thread to kill needs to be careful as we cannot set the "die now" bit atomically with the test on the count. Instead we temporarily increase the count. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 9a0e6accc0a8c3adf72f1b43be8019961b68663a Author: NeilBrown Date: Mon Sep 11 10:40:02 2023 -0400 SUNRPC: use lwq for sp_sockets - renamed to sp_xprts lwq avoids using back pointers in lists, and uses less locking. This introduces a new spinlock, but the other one will be removed in a future patch. For svc_clean_up_xprts(), we now dequeue the entire queue, walk it to remove and process the xprts that need cleaning up, then re-enqueue the remaining queue. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 5b80147e0c70181654e8e54eae99f69b2bf891b1 Author: NeilBrown Date: Mon Sep 11 10:39:56 2023 -0400 SUNRPC: only have one thread waking up at a time Currently if several items of work become available in quick succession, that number of threads (if available) will be woken. By the time some of them wake up another thread that was already cache-warm might have come along and completed the work. Anecdotal evidence suggests as many as 15% of wakes find nothing to do once they get to the point of looking. This patch changes svc_pool_wake_idle_thread() to wake the first thread on the queue but NOT remove it. Subsequent calls will wake the same thread. Once that thread starts it will dequeue itself and after dequeueing some work to do, it will wake the next thread if there is more work ready. This results in a more orderly increase in the number of busy threads. As a bonus, this allows us to reduce locking around the idle queue. svc_pool_wake_idle_thread() no longer needs to take a lock (beyond rcu_read_lock()) as it doesn't manipulate the queue, it just looks at the first item. The thread itself can avoid locking by using the new llist_del_first_this() interface. This will safely remove the thread itself if it is the head. If it isn't the head, it will do nothing. If multiple threads call this concurrently only one will succeed. The others will do nothing, so no corruption can result. If a thread wakes up and finds that it cannot dequeue itself that means either - that it wasn't woken because it was the head of the queue. Maybe the freezer woke it. In that case it can go back to sleep (after trying to freeze of course). - some other thread found there was nothing to do very recently, and placed itself on the head of the queue in front of this thread. It must check again after placing itself there, so it can be deemed to be responsible for any pending work, and this thread can go back to sleep until woken. No code ever tests for busy threads any more. Only each thread itself cares if it is busy. So svc_thread_busy() is no longer needed. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit d7926ee8b78e554de7b7c6ce7b94e7ff7485ecd5 Author: NeilBrown Date: Mon Sep 11 10:39:50 2023 -0400 SUNRPC: rename some functions from rqst_ to svc_thread_ Functions which directly manipulate a 'struct rqst', such as svc_rqst_alloc() or svc_rqst_release_pages(), can reasonably have "rqst" in there name. However functions that act on the running thread, such as XX_should_sleep() or XX_wait_for_work() should seem more natural with a "svc_thread_" prefix. So make those changes. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit de9e82c355f2ae73c04aec84f73fc2657cf7dfdd Author: NeilBrown Date: Mon Sep 11 10:39:43 2023 -0400 lib: add light-weight queuing mechanism. lwq is a FIFO single-linked queue that only requires a spinlock for dequeueing, which happens in process context. Enqueueing is atomic with no spinlock and can happen in any context. This is particularly useful when work items are queued from BH or IRQ context, and when they are handled one at a time by dedicated threads. Avoiding any locking when enqueueing means there is no need to disable BH or interrupts, which is generally best avoided (particularly when there are any RT tasks on the machine). This solution is superior to using "list_head" links because we need half as many pointers in the data structures, and because list_head lists would need locking to add items to the queue. This solution is superior to a bespoke solution as all locking and container_of casting is integrated, so the interface is simple. Despite the similar name, this solution meets a distinctly different need to kfifo. kfifo provides a fixed sized circular buffer to which data can be added at one end and removed at the other, and does not provide any locking. lwq does not have any size limit and works with data structures (objects?) rather than data (bytes). A unit test for basic functionality, which runs at boot time, is included. Signed-off-by: NeilBrown Cc: Andrew Morton Cc: "Liam R. Howlett" Cc: Kees Cook Cc: Greg Kroah-Hartman Cc: David Gow Cc: linux-kernel@vger.kernel.org Message-Id: <20230911111333.4d1a872330e924a00acb905b@linux-foundation.org> Signed-off-by: Chuck Lever commit 8a3e5975ed11dd16d81dc501b514ab01986db94e Author: NeilBrown Date: Mon Sep 11 10:39:37 2023 -0400 llist: add llist_del_first_this() llist_del_first_this() deletes a specific entry from an llist, providing it is at the head of the list. Multiple threads can call this concurrently providing they each offer a different entry. This can be uses for a set of worker threads which are on the llist when they are idle. The head can always be woken, and when it is woken it can remove itself, and possibly wake the next if there is an excess of work to do. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 9bd4161c591710f152a8cd3ed85ea928c61e26ca Author: NeilBrown Date: Mon Sep 11 10:39:30 2023 -0400 SUNRPC: change service idle list to be an llist With an llist we don't need to take a lock to add a thread to the list, though we still need a lock to remove it. That will go in the next patch. Unlike double-linked lists, a thread cannot reliably remove itself from the list. Only the first thread can be removed, and that can change asynchronously. So some care is needed. We already check if there is pending work to do, so we are unlikely to add ourselves to the idle list and then want to remove ourselves again. If we DO find something needs to be done after adding ourselves to the list, we simply wake up the first thread on the list. If that was us, we successfully removed ourselves and can continue. If it was some other thread, they will do the work that needs to be done. We can safely sleep until woken. We also remove the test on freezing() from rqst_should_sleep(). Instead we set TASK_FREEZABLE before scheduling. This makes is safe to schedule() when a freeze is pending. As we now loop waiting to be removed from the idle queue, this is a cleaner way to handle freezing. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit d6b3358a2813bb14791259a2227d9af1e7019ca0 Author: NeilBrown Date: Mon Sep 11 10:39:24 2023 -0400 llist: add interface to check if a node is on a list. With list.h lists, it is easy to test if a node is on a list, providing it was initialised and that it is removed with list_del_init(). This patch provides similar functionality for llist.h lists. init_llist_node() marks a node as being not-on-any-list be setting the ->next pointer to the node itself. llist_on_list() tests if the node is on any list. llist_del_first_init() remove the first element from a llist, and marks it as being off-list. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 2b65a226840c0e86db0e7926856a0a017b3390f2 Author: NeilBrown Date: Mon Sep 11 10:39:17 2023 -0400 SUNRPC: discard SP_CONGESTED We can tell if a pool is congested by checking if the idle list is empty. We don't need a separate flag. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 5ff817b23534dd3942f881ab01dd5050505517aa Author: NeilBrown Date: Mon Sep 11 10:39:11 2023 -0400 SUNRPC: add list of idle threads Rather than searching a list of threads to find an idle one, having a list of idle threads allows an idle thread to be found immediately. This adds some spin_lock calls which is not ideal, but as the hold-time is tiny it is still faster than searching a list. A future patch will remove them using llist.h. This involves some subtlety and so is left to a separate patch. This removes the need for the RQ_BUSY flag. The rqst is "busy" precisely when it is not on the "idle" list. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit fa341560ca7458f4396d5a0771cb5f2358d8535d Author: NeilBrown Date: Mon Sep 11 10:39:04 2023 -0400 SUNRPC: change how svc threads are asked to exit. svc threads are currently stopped using kthread_stop(). This requires identifying a specific thread. However we don't care which thread stops, just as long as one does. So instead, set a flag in the svc_pool to say that a thread needs to die, and have each thread check this flag instead of calling kthread_should_stop(). The first thread to find and clear this flag then moves towards exiting. This removes an explicit dependency on sp_all_threads which will make a future patch simpler. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit f4578ba11c4a211d45877babe56c84d922301576 Author: NeilBrown Date: Wed Oct 11 09:31:22 2023 +1100 lockd: hold a reference to nlmsvc_serv while stopping the thread. Both nfsd and nfsv4-callback take a temporary reference to the svc_serv while calling svc_set_num_threads() to stop the last thread. lockd does not. This extra reference prevents the scv_serv from being freed when the last thread drops its reference count. This is not currently needed for lockd as the svc_serv is not accessed after the last thread is told to exit. However a future patch will require svc_exit_thread() to access the svc_serv after the svc_put() so it will need the code that calls svc_set_num_threads() to keep a reference and keep the svc_serv active. So copy the pattern from nfsd and nfsv4-cb to lockd, and take a reference around svc_set_num_threads(.., 0) Reviewed-by: Jeff Layton Tested-by: Jeff Layton Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 063ab935a48b3a2854f433957adbb2bde396ed22 Author: NeilBrown Date: Mon Sep 11 10:38:58 2023 -0400 SUNRPC: integrate back-channel processing with svc_recv() Using svc_recv() for (NFSv4.1) back-channel handling means we have just one mechanism for waking threads. Also change kthread_freezable_should_stop() in nfs4_callback_svc() to kthread_should_stop() as used elsewhere. kthread_freezable_should_stop() effectively adds a try_to_freeze() call, and svc_recv() already contains that at an appropriate place. Signed-off-by: NeilBrown Cc: Trond Myklebust Cc: Anna Schumaker Signed-off-by: Chuck Lever commit 6ed8cdf967f7e9fc96cd1c129719ef99db2f9afc Author: Chuck Lever Date: Mon Sep 11 10:38:51 2023 -0400 SUNRPC: Clean up bc_svc_process() The test robot complained that, in some build configurations, the @error variable in bc_svc_process's only caller is set but never used. This happens because dprintk() is the only consumer of that value. - Remove the dprintk() call sites in favor of the svc_process tracepoint - The @error variable and the return value of bc_svc_process() are now unused, so get rid of them. - The @serv parameter is set to rqstp->rq_serv by the only caller, and bc_svc_process() then uses it only to set rqstp->rq_serv. It can be removed. - Rename bc_svc_process() according to the convention that globally-visible RPC server functions have names that begin with "svc_"; and because it is globally-visible, give it a proper kdoc comment. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202308121314.HA8Rq2XG-lkp@intel.com/ Signed-off-by: Chuck Lever commit 7b31f4daebad296e3164602b8303c265ec4ac7dc Author: NeilBrown Date: Mon Sep 11 10:38:45 2023 -0400 SUNRPC: rename and refactor svc_get_next_xprt() svc_get_next_xprt() does a lot more than just get an xprt. It also decides if it needs to sleep, depending not only on the availability of xprts but also on the need to exit or handle external work. So rename it to svc_rqst_wait_for_work() and only do the testing and waiting. Move all the waiting-related code out of svc_recv() into the new svc_rqst_wait_for_work(). Move the dequeueing code out of svc_get_next_xprt() into svc_recv(). Previously svc_xprt_dequeue() would be called twice, once before waiting and possibly once after. Now instead rqst_should_sleep() is called twice. Once to decide if waiting is needed, and once to check against after setting the task state do see if we might have missed a wakeup. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit e3274026e2ec69eec6ab51bc499e14bb548548d0 Author: NeilBrown Date: Mon Sep 11 10:38:39 2023 -0400 SUNRPC: move all of xprt handling into svc_xprt_handle() svc_xprt_handle() does lots of things itself, but leaves some to the caller - svc_recv(). This isn't elegant. Move that code out of svc_recv() into svc_xprt_handle() Move the calls to svc_xprt_release() from svc_send() and svc_drop() (the two possible final steps in svc_process()) and from svc_recv() (in the case where svc_process() wasn't called) into svc_xprt_handle(). Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit e70da17633ee9457cae39e4f5f2fc5efafb7a99b Author: Alexander Aring Date: Tue Sep 12 17:53:21 2023 -0400 lockd: add doc to enable EXPORT_OP_ASYNC_LOCK This patch adds a note to enable EXPORT_OP_ASYNC_LOCK for asynchronous lock request handling. Reviewed-by: Jeff Layton Signed-off-by: Alexander Aring Signed-off-by: Chuck Lever commit afb13302aa664170684c76b0c12ece37b4e91d12 Author: Alexander Aring Date: Tue Sep 12 17:53:20 2023 -0400 lockd: fix race in async lock request handling This patch fixes a race in async lock request handling between adding the relevant struct nlm_block to nlm_blocked list after the request was sent by vfs_lock_file() and nlmsvc_grant_deferred() does a lookup of the nlm_block in the nlm_blocked list. It could be that the async request is completed before the nlm_block was added to the list. This would end in a -ENOENT and a kernel log message of "lockd: grant for unknown block". To solve this issue we add the nlm_block before the vfs_lock_file() call to be sure it has been added when a possible nlmsvc_grant_deferred() is called. If the vfs_lock_file() results in an case when it wouldn't be added to nlm_blocked list, the nlm_block struct will be removed from this list again. Reviewed-by: Jeff Layton Signed-off-by: Alexander Aring Signed-off-by: Chuck Lever commit b743612c0aaa49a781f1f0c760e35d7298b5c5b4 Author: Alexander Aring Date: Tue Sep 12 17:53:19 2023 -0400 lockd: don't call vfs_lock_file() for pending requests This patch returns nlm_lck_blocked in nlmsvc_lock() when an asynchronous lock request is pending. During testing I ran into the case with the side-effects that lockd is waiting for only one lm_grant() callback because it's already part of the nlm_blocked list. If another asynchronous for the same nlm_block is triggered two lm_grant() callbacks will occur but lockd was only waiting for one. To avoid any change of existing users this handling will only being made when export_op_support_safe_async_lock() returns true. Reviewed-by: Jeff Layton Signed-off-by: Alexander Aring Signed-off-by: Chuck Lever commit 2dd10de8e6bcbacf85ad758b904543c294820c63 Author: Alexander Aring Date: Tue Sep 12 17:53:18 2023 -0400 lockd: introduce safe async lock op This patch reverts mostly commit 40595cdc93ed ("nfs: block notification on fs with its own ->lock") and introduces an EXPORT_OP_ASYNC_LOCK export flag to signal that the "own ->lock" implementation supports async lock requests. The only main user is DLM that is used by GFS2 and OCFS2 filesystem. Those implement their own lock() implementation and return FILE_LOCK_DEFERRED as return value. Since commit 40595cdc93ed ("nfs: block notification on fs with its own ->lock") the DLM implementation were never updated. This patch should prepare for DLM to set the EXPORT_OP_ASYNC_LOCK export flag and update the DLM plock implementation regarding to it. Acked-by: Jeff Layton Signed-off-by: Alexander Aring Signed-off-by: Chuck Lever commit 1b2021bdeeca12364ad0fa7aac9ddba5cae964f3 Author: Trond Myklebust Date: Mon Sep 11 14:43:57 2023 -0400 nfsd: Don't reset the write verifier on a commit EAGAIN If fsync() is returning EAGAIN, then we can assume that the filesystem being exported is something like NFS with the 'softerr' mount option enabled, and that it is just asking us to replay the fsync() operation at a later date. If we see an ESTALE, then ditto: the file is gone, so there is no danger of losing the error. For those cases, do not reset the write verifier. A write verifier change has a global effect, causing retransmission by all clients of all uncommitted unstable writes for all files, so it is worth mitigating where possible. Link: https://lore.kernel.org/linux-nfs/20230911184357.11739-1-trond.myklebust@hammerspace.com/ Signed-off-by: Trond Myklebust Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit d59b3515ab021e010fdc58a8f445ea62dd2f7f4c Author: Trond Myklebust Date: Mon Sep 11 14:30:27 2023 -0400 nfsd: Handle EOPENSTALE correctly in the filecache The nfsd_open code handles EOPENSTALE correctly, by retrying the call to fh_verify() and __nfsd_open(). However the filecache just drops the error on the floor, and immediately returns nfserr_stale to the caller. This patch ensures that we propagate the EOPENSTALE code back to nfsd_file_do_acquire, and that we handle it correctly. Fixes: 65294c1f2c5e ("nfsd: add a new struct file caching facility to nfsd") Signed-off-by: Trond Myklebust Reviewed-by: Jeff Layton Message-Id: <20230911183027.11372-1-trond.myklebust@hammerspace.com> Signed-off-by: Chuck Lever commit 5896a8705461052bfc2dcd7cf5909eaf3cecaa92 Author: Dai Ngo Date: Thu Aug 31 12:35:47 2023 -0700 NFSD: add trace points to track server copy progress Add trace points on destination server to track inter and intra server copy operations. Signed-off-by: Dai Ngo Tested-by: Chen Hanxiao Signed-off-by: Chuck Lever commit 15d1975b7279693d6f09398e0e2e31aca2310275 Author: Dai Ngo Date: Wed Aug 30 16:46:58 2023 -0700 NFSD: initialize copy->cp_clp early in nfsd4_copy for use by trace point Prepare for adding server copy trace points. Signed-off-by: Dai Ngo Tested-by: Chen Hanxiao Signed-off-by: Chuck Lever commit b08d26dac1a1075c874f40ee02ec8ddc39e20146 Author: Dmitry Baryshkov Date: Thu Oct 12 04:20:13 2023 +0300 drm/msm/a7xx: actually use a7xx state registers Make a6xx_get_registers() use a7xx registers instead of a6xx ones if the detected Adreno is from the A7xx family. Fixes: e997ae5f45ca ("drm/msm/a6xx: Mostly implement A7xx gpu_state") Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/562233/ Signed-off-by: Rob Clark commit 69c5bcfa84f2c6fa1a87b43220fcc09e3ec081c6 Author: Neil Armstrong Date: Thu Oct 12 11:01:31 2023 +0200 drm/msm/dpu: enable writeback on SM8550 Enable WB2 hardware block, enabling writeback support on this platform. Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong Patchwork: https://patchwork.freedesktop.org/patch/562328/ Signed-off-by: Rob Clark commit 05b0fdfc3ca275ac6ce4ea62eefbcf16aef98c8c Author: Neil Armstrong Date: Thu Oct 12 11:01:30 2023 +0200 drm/msm/dpu: sm8550: remove unused VIG and DMA clock controls entries The SM8550 has the SSPP clk_ctrl in the SSPP registers, remove the duplicate clock controls from the MDP top. Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong Patchwork: https://patchwork.freedesktop.org/patch/562330/ Signed-off-by: Rob Clark commit 346faacfcdca57c5e559619af68780bf39611956 Author: Neil Armstrong Date: Thu Oct 12 11:01:29 2023 +0200 drm/msm/dpu: move setup_force_clk_ctrl handling into plane and wb Now SSPP and WB can have setup_force_clk_ctrl() ops, it's simpler to call them from the plane and wb code and call into the mdp ops if not present. Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong Patchwork: https://patchwork.freedesktop.org/patch/562325/ Signed-off-by: Rob Clark commit 87e968672753191a71d4ec9b7585685a21768345 Author: Neil Armstrong Date: Thu Oct 12 11:01:28 2023 +0200 drm/msm/dpu: add setup_clk_force_ctrl() op to sspp & wb Starting from SM8550, the SSPP & WB clock controls are moved the SSPP and WB register range, as it's called "VBIF_CLK_SPLIT" downstream. Implement setup_clk_force_ctrl() only starting from major version 9 which corresponds to SM8550 MDSS. Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong Patchwork: https://patchwork.freedesktop.org/patch/562322/ Signed-off-by: Rob Clark commit 76191dc11ee8654f637aae2a083386f7278594d6 Author: Neil Armstrong Date: Thu Oct 12 11:01:27 2023 +0200 drm/msm/dpu: create a dpu_hw_clk_force_ctrl() helper Add an helper to setup the force clock control as it will be used in multiple HW files. Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong Patchwork: https://patchwork.freedesktop.org/patch/562323/ Signed-off-by: Rob Clark commit 3aeb0d3694e16b5066db82aa1152884f2e6aace0 Author: Neha Malcom Francis Date: Mon Oct 16 15:46:07 2023 +0530 soc: ti: k3-socinfo: Avoid overriding return value Avoid overriding the return value and make sure the right error code is reflected. If the part is none of the identified list present in k3_soc_ids[], return -ENODEV. Signed-off-by: Neha Malcom Francis Link: https://lore.kernel.org/r/20231016101608.993921-3-n-francis@ti.com Signed-off-by: Nishanth Menon commit 8dec342ead710dace27dc82096144bf7a1011827 Author: Neha Malcom Francis Date: Mon Oct 16 15:46:06 2023 +0530 soc: ti: k3-socinfo: Fix typo in bitfield documentation Fix documentation that indicates wrong bit. Signed-off-by: Neha Malcom Francis Link: https://lore.kernel.org/r/20231016101608.993921-2-n-francis@ti.com Signed-off-by: Nishanth Menon commit 28ec6c558e9f758ec93e8e964b6daeaf642c64c1 Author: Ville Syrjälä Date: Thu Oct 12 15:24:40 2023 +0300 drm/i915/pci: Clean up zero initializers Just use a simple {} to zero initialize arrays/structs instead of the hodgepodge of stuff we are using currently. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231012122442.15718-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit cc01b0ff18947223fdbe723275e47805965a7790 Author: Ville Syrjälä Date: Thu Oct 12 15:24:38 2023 +0300 drm/i915/hdcp: Clean up zero initializers Just use a simple {} to zero initialize arrays/structs instead of the hodgepodge of stuff we are using currently. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231012122442.15718-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit eebc1525bacbd4faa46a99c37329414fb17cfa51 Author: Ville Syrjälä Date: Thu Oct 12 15:24:37 2023 +0300 drm/i915/display: Clean up zero initializers Just use a simple {} to zero initialize arrays/structs instead of the hodgepodge of stuff we are using currently. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231012122442.15718-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 507fa3c27965a18116d7ee1682ff39bc3b6aa1d5 Author: Calvince Otieno Date: Mon Oct 16 12:20:37 2023 +0300 staging: wlan-ng: replace pr_debug() with netdev_dbg() This patch replaces the usage of pr_debug() with netdev_dbg(). The change is made to enhance context-aware debugging, improve code clarity, and maintain compatibility with established network debugging practices. There were no functional code changes. Signed-off-by: Calvince Otieno Link: https://lore.kernel.org/r/ZS0AZahhusLoN4b/@lab-ubuntu Signed-off-by: Greg Kroah-Hartman commit 22d99db4108742731b966850b2aa54a760db96b3 Author: Calvince Otieno Date: Mon Oct 16 09:39:33 2023 +0300 staging: wlan-ng: replace strncpy() with strscpy() Checkpatch suggests the use of strscpy() instead of strncpy(). The advantages are that it always adds a NUL terminator and it prevents a read overflow if the src string is not properly terminated. One potential disadvantage is that it doesn't zero pad the string like strncpy() does. In this code, strscpy() and strncpy() are equivalent and it does not affect runtime behavior. The string is zeroed on the line before using memset(). The resulting string was always NUL terminated and PRISM2_USB_FWFILE is string literal "prism2_ru.fw" so it's NUL terminated. However, even though using strscpy() does not fix any bugs, it's still nicer and makes checkpatch happy. Signed-off-by: Calvince Otieno Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/ZSzapU+eKWvHVwxi@lab-ubuntu Signed-off-by: Greg Kroah-Hartman commit 32d7def275aa39358ff6b417ff045cc4ea30919b Author: Calvince Otieno Date: Mon Oct 16 10:43:00 2023 +0300 staging: wlan-ng: remove undefined function The function p80211wext_get_wireless_stats() is declared in the code but has neither been defined nor referenced. It's definition was removed 13 years ago in the commit cb3126e60ffc ("Staging: wlan-ng: Switch from wext to cfg80211") Signed-off-by: Calvince Otieno Link: https://lore.kernel.org/r/ZSzphFeckE7dM5g/@lab-ubuntu Signed-off-by: Greg Kroah-Hartman commit 48fb9529adeb657a138a1fe1f6720c1ad9989335 Author: Calvince Otieno Date: Mon Oct 16 08:27:23 2023 +0300 staging: wlan-ng: remove unnecessary helper function The function prism2sta_inf_handover() is called by the parent function prism2sta_ev_info() to print a literal debug information string using pr_debug(). The debugging utility function can be called directly within prism2sta_ev_info(). Furthermore, to make the debugging more module-specific, the netdev_dbg() function is preferred over the generic pr_debug() utility function. Signed-off-by: Calvince Otieno Link: https://lore.kernel.org/r/ZSzJuwlEKPBj9kLN@lab-ubuntu Signed-off-by: Greg Kroah-Hartman commit e057ea021d55e93704e6ecda9886dd36cf005580 Author: Calvince Otieno Date: Sun Oct 15 23:02:19 2023 +0300 staging: wlan-ng: remove unused function prototypes These functions are declared but not defined or used anywhere. Their definitions were removed 15 years ago. prism2mgmt_set_grpaddr() was removed in the commit 1e7201836c57 ("Staging: wlan-ng: Delete a pile of unused mibs. And fix WEXT SET_TXPOWER.") It's signature was changed in the commit 5a2214e2e02f ("staging: wlang-ng: avoid new typedef: hfa384x_t") prism2mgmt_get_grpaddr() and prism2mgmt_get_grpaddr_index() were removed in the commit cbec30c4c00c ("Staging: wlan-ng: Delete a large pile of now-unused code.") Signed-off-by: Calvince Otieno Link: https://lore.kernel.org/r/ZSxFS8EnFr998PqS@lab-ubuntu Signed-off-by: Greg Kroah-Hartman commit 7f403caabe811b88ab0de3811ff3f4782c415761 Author: Ville Syrjälä Date: Thu Oct 12 16:28:01 2023 +0300 drm/i915: Retry gtt fault when out of fence registers If we can't find a free fence register to handle a fault in the GMADR range just return VM_FAULT_NOPAGE without populating the PTE so that userspace will retry the access and trigger another fault. Eventually we should find a free fence and the fault will get properly handled. A further improvement idea might be to reserve a fence (or one per CPU?) for the express purpose of handling faults without having to retry. But that would require some additional work. Looks like this may have gotten broken originally by commit 39965b376601 ("drm/i915: don't trash the gtt when running out of fences") as that changed the errno to -EDEADLK which wasn't handle by the gtt fault code either. But later in commit 2feeb52859fc ("drm/i915/gt: Fix -EDEADLK handling regression") I changed it again to -ENOBUFS as -EDEADLK was now getting used for the ww mutex dance. So this fix only makes sense after that last commit. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9479 Fixes: 2feeb52859fc ("drm/i915/gt: Fix -EDEADLK handling regression") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231012132801.16292-1-ville.syrjala@linux.intel.com Reviewed-by: Andi Shyti commit 7904cdf1397c9391178ce53a7ebfa099c6bc4a59 Author: Fabrice Gasnier Date: Tue Aug 29 15:40:23 2023 +0200 counter: chrdev: remove a typo in header file comment Replace COUNTER_COUNT_SCOPE that doesn't exist by the defined COUNTER_SCOPE_COUNT. Signed-off-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20230829134029.2402868-3-fabrice.gasnier@foss.st.com Signed-off-by: William Breathitt Gray commit d0d27ef87e1ca974ed93ed4f7d3c123cbd392ba6 Merge: 1034cc423f1b4 58720809f5277 Author: Greg Kroah-Hartman Date: Mon Oct 16 17:36:12 2023 +0200 Merge 6.6-rc6 into usb-next We need the USB and Thunderbolt fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 3f86604154ccb3597e11d334d99ae45452418b12 Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:36 2023 +0200 drm/mediatek: aal: Compress of_device_id entries and add sentinel Compress the entry for mediatek,mt8173-disp-aal, as it fits in one line, and fix the style; while at it, also add the usual sentinel comment to the last entry. This commit brings no functional changes. Reviewed-by: CK Hu Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-17-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit a33a56ad0844176b0aa84a8aca1efec20b888766 Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:35 2023 +0200 drm/mediatek: gamma: Add kerneldoc for struct mtk_disp_gamma The mtk_disp_gamma structure was completely undocumented: add some kerneldoc documentation to it. Reviewed-by: CK Hu Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-16-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 2b6c3197b267e97d640cca78a036efda19e398a5 Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:34 2023 +0200 drm/mediatek: aal: Add kerneldoc for struct mtk_disp_aal The kerneldoc for struct mtk_disp_aal is missing: write one and document this structure. Reviewed-by: CK Hu Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-15-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 692e1a08ae3f4ca772e4841a4caedbb4a5075445 Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:33 2023 +0200 drm/mediatek: gamma: Program gamma LUT type for descending or rising All of the SoCs that don't have dithering control in the gamma IP have got a GAMMA_LUT_TYPE bit that tells to the IP if the LUT is "descending" (bit set) or "rising" (bit cleared): make sure to set it correctly after programming the LUT. Reviewed-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat Reviewed-by: CK Hu Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-14-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 50c01a942b287451ed7bec290ac09e07b91c6253 Author: Rob Herring Date: Mon Oct 9 16:13:43 2023 -0500 soc: ti: knav_qmss_queue: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231009211356.3242037-13-robh@kernel.org Signed-off-by: Nishanth Menon commit 05e5f732850632f24310b677d16787136733f5d4 Author: Rob Herring Date: Fri Oct 6 17:46:38 2023 -0500 firmware: ti_sci: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006224638.445168-1-robh@kernel.org Signed-off-by: Nishanth Menon commit 921e902b2cb5e05fef370c853bfda0dbd240778d Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:32 2023 +0200 drm/mediatek: gamma: Make sure relay mode is disabled Disable relay mode at the end of LUT programming to make sure that the processed image goes through in both DISP_GAMMA and DISP_AAL for gamma setting. Reviewed-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat Reviewed-by: CK Hu Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-13-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 6841f6f9c699660452bdd30f5ee3a3708972ebd3 Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:31 2023 +0200 drm/mediatek: gamma: Add support for MT8195 Now that this driver supports 12-bit LUTs, we can add support for the DISP_GAMMA found on the MT8195 SoC: add its driver data and compatible. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-12-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit af0e042e162a5899f11996abc17d648a2c82f7cd Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:30 2023 +0200 drm/mediatek: gamma: Add support for 12-bit LUT New SoCs, like MT8195, not only may support bigger lookup tables, but have got a different register layout to support bigger precision: support specifying the number of `lut_bits` for each SoC and use it in mtk_gamma_set_common() to perform the right calculations and add support for 12-bit gamma lookup tables. While at it, also reorder the variables in mtk_gamma_set_common() and rename `lut_base` to `lut0_base` to improve readability. Reviewed-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-11-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 4708b01a49171ad6d88499bd9c437629ec4a92d1 Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:29 2023 +0200 drm/mediatek: gamma: Support multi-bank gamma LUT Newer Gamma IP have got multiple LUT banks: support specifying the size of the LUT banks and handle bank-switching before programming the LUT in mtk_gamma_set_common() in preparation for adding support for MT8195 and newer SoCs. Suggested-by: Jason-JH.Lin [Angelo: Refactored original commit] Reviewed-by: Alexandre Mergnat Reviewed-by: CK Hu Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-10-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit a6b39cd248f3321dbf066f95f95a9841f891229e Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:28 2023 +0200 drm/mediatek: De-commonize disp_aal/disp_gamma gamma_set functions In preparation for adding a 12-bits gamma support for the DISP_GAMMA IP, remove the mtk_gamma_set_common() function and move the relevant bits in mtk_gamma_set() for DISP_GAMMA and mtk_aal_gamma_set() for DISP_AAL: since the latter has no more support for gamma manipulation (being moved to a different IP) in newer revisions, those functions are about to diverge and it makes no sense to keep a common one (with all the complications of passing common data and making exclusions for device driver data) for just a few bits. This commit brings no functional changes. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Nícolas F. R. A. Prado Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-9-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit a8ecbc54165fca767e75a82372a7be3810c667cf Author: Hans de Goede Date: Sat Oct 14 22:53:11 2023 +0200 spi: Export acpi_spi_find_controller_by_adev() Export acpi_spi_find_controller_by_adev() so that ACPI glue code which wants to dynamically create a spi_device using acpi_spi_device_alloc() or spi_new_device() on a controller, to which the code does not already have a reference, can find the controller. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231014205314.59333-2-hdegoede@redhat.com Signed-off-by: Mark Brown commit 36e5da13779309793aae2bb7dab39415dfce11ed Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:27 2023 +0200 drm/mediatek: aal: Use bitfield macros Make the code more robust and improve readability by using bitfield macros instead of open coding bit operations. Reviewed-by: CK Hu Reviewed-by: Nícolas F. R. A. Prado Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-8-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 6e46998c13f1235929091edeeb577585f3e00e10 Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:26 2023 +0200 drm/mediatek: gamma: Use bitfield macros Make the code more robust and improve readability by using bitfield macros instead of open coding bit operations. Reviewed-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-7-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 0d4caaaf61ce0556843e2fa9d41ec65962b51c14 Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:25 2023 +0200 drm/mediatek: gamma: Enable the Gamma LUT table only after programming Move the write to DISP_GAMMA_CFG to enable the Gamma LUT to after programming the actual table to avoid potential visual glitches during table modification. Note: GAMMA should get enabled in between vblanks, but this requires many efforts in order to make this happen, as that requires migrating all of the writes to make use of CMDQ instead of cpu writes and that's not trivial. For this reason, this patch only moves the LUT enable. The CMDQ rework will come at a later time. Reviewed-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat Reviewed-by: CK Hu Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-6-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit cfb67623ce281e045ec11e3eddb1b68b879b53a1 Author: Romain Perier Date: Wed Sep 13 17:16:05 2023 +0200 dt-bindings: rtc: Add Mstar SSD202D RTC Add YAML bindings for Mstar SSD202D RTC. Signed-off-by: Romain Perier Link: https://lore.kernel.org/r/20230913151606.69494-3-romain.perier@gmail.com Signed-off-by: Alexandre Belloni commit ebf6255868e6141c737cacb8d62b0b347f344877 Author: Romain Perier Date: Wed Sep 13 17:16:04 2023 +0200 rtc: Add support for the SSD202D RTC Newer SigmaStar SSD202D SoCs contain a Real Time Clock, capable of running while the system is sleeping (battery powered), this is not the case with the other RTC on older SoCs. This adds basic support for this RTC block. Signed-off-by: Romain Perier Co-developed-by: Daniel Palmer Signed-off-by: Daniel Palmer Link: https://lore.kernel.org/r/20230913151606.69494-2-romain.perier@gmail.com Signed-off-by: Alexandre Belloni commit 85045a9e445ac2400af7c37e169f58dc6f400d4c Merge: 93a83b76b88f5 e4d09de3919bb Author: Mark Brown Date: Mon Oct 16 15:41:55 2023 +0100 ASoC: SOF: misc updates for 6.7 Merge series from Pierre-Louis Bossart : New PCI ID, one fix for a delayed IRQ thread causing issues, one update for debug and one follow-up cleanup for the .remove callback. commit 93a83b76b88f588b614cb14d8419b4a1de087b61 Merge: 2e1a4596dcecd 078d3a4b120f8 Author: Mark Brown Date: Mon Oct 16 15:41:47 2023 +0100 ASoC: codecs: rt715*: update misleading error log Merge series from Pierre-Louis Bossart : Improve two errors logs which report bad information. commit 2e1a4596dcecda57b32a3fe94059ae72f5f0cac1 Merge: 4f88c72b2479c 3e1756f461edc Author: Mark Brown Date: Mon Oct 16 15:41:40 2023 +0100 ASoC: Intel: boards: updates for 6.7 Merge series from Pierre-Louis Bossart : A couple of new boards, one DMI quirk fix and a nice cleanup from Brent Lu to make all HDMI stuff common across drivers. commit b9986846189cea87a9d93052cfab462c9e74f447 Author: Konrad Dybcio Date: Sat Oct 14 01:07:46 2023 +0200 drm/msm/a6xx: Fix up QMP handling The commit referenced in the Fixes tag had a couple problems (as pointed out by Dan): - qmp_put was never called, resulting in refcnt leaks - failling to acquire the QMP mailbox on A7xx would not undo the probe function properly - the qmp_put call present in the code was unreachable Fix all of these issues. Reported-by: Dan Carpenter Fixes: 88a0997f2f94 ("drm/msm/a6xx: Send ACD state to QMP at GMU resume") Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/562761/ Signed-off-by: Rob Clark commit 5e05be78264594634860087953649487f486ffcc Author: Dmitry Baryshkov Date: Thu Oct 12 04:29:09 2023 +0300 drm/msm/dsi: free TX buffer in unbind If the drm/msm init code gets an error during output modeset initialisation, the kernel will report an error regarding DRM memory manager not being clean during shutdown. This is because msm_dsi_modeset_init() allocates a piece of GEM memory for the TX buffer, but destruction of the buffer happens only at msm_dsi_host_destroy(), which is called during DSI driver's remove() time, much later than the DRM MM shutdown. To solve this issue, move the TX buffer destruction to dsi_unbind(), so that the buffer is destructed at the correct time. Note, we also have to store a reference to the address space, because priv->kms->aspace is cleared before components are unbound. Reported-by: Bjorn Andersson Fixes: 8f59ee9a570c ("drm/msm/dsi: Adjust probe order") Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/562238/ Signed-off-by: Rob Clark commit 69b321b2c3df4f7e51a9de587e41f324b0b717b0 Author: Dmitry Baryshkov Date: Thu Oct 12 04:29:08 2023 +0300 drm/msm/dsi: use msm_gem_kernel_put to free TX buffer Use exiting function to free the allocated GEM object instead of open-coding it. This has a bonus of internally calling msm_gem_put_vaddr() to compensate for msm_gem_get_vaddr() in msm_get_kernel_new(). Fixes: 1e29dff00400 ("drm/msm: Add a common function to free kernel buffer objects") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/562239/ Signed-off-by: Rob Clark commit 0e70ecbb2b65720a892604a58c36cdb2a6269003 Merge: 0a84cbfb7fedf 1aeb02d3f2c5a Author: Arnd Bergmann Date: Mon Oct 16 16:13:19 2023 +0200 Merge tag 'stm32-dt-for-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 into soc/dt STM32 DT for v6.7, round 1 Highlights: ---------- - MCU: - Add SDIO sleep pins for F7 boards. - MPU: - STM32MP13: - Add HASH and RNG support. - STMP32MP15: - OCTAVO: - Fix regulators (LDO1/2/6 and 3v3_hdmi) by removing "always-on" property on OSD32 common file. - Add new OS32MP1-RED board. It embeds a STM32157C SoC, 512 MB of DDR3, CAN-FD, HDMI, USB-C OTG. - STM32MP25: - Add and enable SDCARD support. - Add and enable ARM watchdog support and set it to 32 seconds. * tag 'stm32-dt-for-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32: ARM: dts: stm32: add SDIO pinctrl sleep support on stm32f7 boards ARM: dts: stm32: add stm32f7 SDIO sleep pins ARM: dts: stm32: add RNG node for STM32MP13x platforms ARM: dts: stm32: omit unused pinctrl groups from stm32mp15 dtb files ARM: dts: stm32: stm32f7-pinctrl: don't use multiple blank lines ARM: dts: stm32: add HASH on stm32mp131 arm64: dts: st: enable secure arm-wdt watchdog on stm32mp257f-ev1 arm64: dts: st: add arm-wdt node for watchdog support on stm32mp251 arm64: dts: st: add SD-card support on STM32MP257F-EV1 board arm64: dts: st: add sdmmc1 pins for stm32mp25 arm64: dts: st: add sdmmc1 node in stm32mp251 SoC file ARM: dts: stm32: Add Octavo OSD32MP1-RED board dt-bindings: arm: stm32: add extra SiP compatible for oct,stm32mp157c-osd32-red ARM: dts: stm32: osd32: fix ldo6 not required to be always-on ARM: dts: stm32: lxa-tac: remove v3v3_hdmi override ARM: dts: stm32: osd32: fix ldo2 not required to be always-on ARM: dts: stm32: osd32: fix ldo1 not required to be always-on ARM: dts: stm32: Add alternate pinmux for can pins ARM: dts: stm32: Add alternate pinmux for ldtc pins ARM: dts: stm32: Add alternate pinmux for i2s pins Link: https://lore.kernel.org/r/8a6b3ca9-f10d-825e-e371-8aeff3289a25@foss.st.com Signed-off-by: Arnd Bergmann commit 0a84cbfb7fedf39843e12953c61a51bc8ab38673 Merge: 94d310e178583 f2d2200e47e94 Author: Arnd Bergmann Date: Mon Oct 16 16:10:57 2023 +0200 Merge tag 'amlogic-arm64-dt-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into soc/dt Amlogic ARM64 DT changes for v6.7: - Add audio DT nodes for p200/p201/u200 - Add a bunch of peripherals for Amlogic-T7 (watchdog, power domain, pinctrl) - Add a bunch or peripherals for Amlogic-A1 (clk, usb, efuse, spi, uarts, emmc, ADC, rng, i2c) - Add NAND node on Amlogic AXG - Again a bunch of DT fixups for DT bindings check - New boards: - Amlogic AD402 reference board based on A113L SoC - Libre Computer Cottonwood boards * tag 'amlogic-arm64-dt-for-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: (38 commits) arm64: dts: amlogic: a1: support all i2c masters and their muxes arm64: dts: amlogic: add libretech cottonwood support dt-bindings: arm: amlogic: add libretech cottonwood support arm64: dts: meson-a1-ad402: set SPIFC pins arm64: dts: meson: a1: Add SPIFC mux pins arm64: dts: meson-s4: add hwrng node arm64: dts: meson: g12: name spdifout consistently arm64: dts: Add pinctrl node for Amlogic T7 SoCs arm64: dts: meson: u200: add onboard devices arm64: dts: meson: u200: use TDM C for HDMI arm64: dts: meson: u200: add spdifout b routes arm64: dts: meson: u200: add missing audio clock controller arm64: dts: meson: u200: fix spdif output pin arm64: dts: amlogic: t7: add power domain controller node dt-bindings: power: add Amlogic T7 power domains arm64: dts: meson-g12: Fix compatible for amlogic,g12a-tdmin arm64: dts: meson-g12: Fix clock order for amlogic,axg-tdm-iface devices arm64: dts: amlogic: meson-axg: Meson NAND node dt-bindings: arm: amlogic: add Amlogic AD402 bindings arm64: dts: introduce Amlogic AD402 reference board based on A113L SoC ... Link: https://lore.kernel.org/r/b3e1bf66-9182-4d48-88ef-7efc20466e7c@linaro.org Signed-off-by: Arnd Bergmann commit ada1682d60ac6017037305166d02eb0cd5ee50fa Author: Bartosz Golaszewski Date: Wed Oct 4 20:57:32 2023 +0200 firmware: qcom: qseecom: add missing include guards The qseecom header does not contain ifdef guards against multiple inclusion. Add them. Fixes: 00b1248606ba ("firmware: qcom_scm: Add support for Qualcomm Secure Execution Environment SCM interface") Signed-off-by: Bartosz Golaszewski Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20231004185732.98621-1-brgl@bgdev.pl Signed-off-by: Bjorn Andersson commit 94d310e1785834f438542a1d4f232c139084d9ff Merge: 6fd3e8682b0f1 d024ca2792b17 Author: Arnd Bergmann Date: Mon Oct 16 16:07:26 2023 +0200 Merge tag 'aspeed-6.7-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc into soc/dt ASPEED device tree updates for 6.7 - New machine: * Facebook's Minevra, as Chassis Management Controller using the AST2600 - Updates to Ampere's Mt Mitchell and Mt Jade systems, and IBM's Bonnell * tag 'aspeed-6.7-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc: ARM: dts: aspeed: mtmitchell: Add I2C NVMe alias port ARM: dts: aspeed: mtmitchell: Remove redundant ADC configurations ARM: dts: aspeed: mtmitchell: Add inlet temperature sensor ARM: dts: aspeed: mtjade: Add the gpio-hog ARM: dts: aspeed: mtjade, mtmitchell: Add new gpio-line-names ARM: dts: aspeed: mtjade, mtmitchell: Update gpio-line-names ARM: dts: aspeed: Minerva: Add Facebook Minerva CMC board dt-bindings: arm: aspeed: document board compatibles ARM: dts: aspeed: bonnell: Add reserved memory for TPM event log Link: https://lore.kernel.org/r/CACPK8XebMAQvgQTRH+KoaTFg7CzRkS79Fz3Kn8p4mbaezWGkUQ@mail.gmail.com Signed-off-by: Arnd Bergmann commit 266dcae34d8f44c3bbab00e227f8b14517682bb7 Author: Nicolin Chen Date: Sun Oct 15 00:46:48 2023 -0700 iommufd/selftest: Rework TEST_LENGTH to test min_size explicitly TEST_LENGTH passing ".size = sizeof(struct _struct) - 1" expects -EINVAL from "if (ucmd.user_size < op->min_size)" check in iommufd_fops_ioctl(). This has been working when min_size is exactly the size of the structure. However, if the size of the structure becomes larger than min_size, i.e. the passing size above is larger than min_size, that min_size sanity no longer works. Since the first test in TEST_LENGTH() was to test that min_size sanity routine, rework it to support a min_size calculation, rather than using the full size of the structure. Link: https://lore.kernel.org/r/20231015074648.24185-1-nicolinc@nvidia.com Signed-off-by: Nicolin Chen Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 02c8d561dbbf4258c3314ddb85fe609990b61316 Author: Imre Deak Date: Wed Oct 11 20:16:06 2023 +0300 drm/i915/dp: Remove unused DSC caps from intel_dp The previous patches converted all users of the DSC DPCD caps to look these up from the connector, so remove the version stored in intel_dp. A follow-up patchset will read out the MST connector specific capabilities in intel_dp_add_mst_connector() -> intel_dp_mst_read_decompression_port_dsc_caps(). v2: - Rebased on intel_edp_get_dsc_sink_cap() addition in the patchset. v3: - Rebased on read-out fix for eDP in the patchset. Reviewed-by: Stanislav Lisovskiy (v1) Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231011171606.2540078-3-imre.deak@intel.com commit d19daffc89fe50f1a3ab3007e006d0f97544a27c Author: Imre Deak Date: Fri Oct 6 16:37:26 2023 +0300 drm/i915/dp_mst: Use connector DSC DPCD in intel_dp_mst_mode_valid_ctx() Use the connector's DSC DPCD capabilities in intel_dp_mst_mode_valid_ctx(). Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-19-imre.deak@intel.com commit 2bd3d20ffa4e297923160bbccda50bf7685eba57 Author: Imre Deak Date: Fri Oct 6 16:37:25 2023 +0300 drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_compute_config() Use the connector's DSC DPCD capabilities in intel_dp_dsc_compute_config(). Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-18-imre.deak@intel.com commit 031c19b52c20f2b3a8fb7bbff21b276d46e70c4f Author: Imre Deak Date: Fri Oct 6 16:37:24 2023 +0300 drm/i915/dp: Use connector DSC DPCD in intel_dp_mode_valid() Use the connector's DSC DPCD capabilities in intel_dp_mode_valid(). Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-17-imre.deak@intel.com commit 7bca1b801e48176283c5658e9092ea170fd7320e Author: Imre Deak Date: Fri Oct 6 16:37:23 2023 +0300 drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_get_slice_count() Use the connector's DSC DPCD capabilities in intel_dp_dsc_get_slice_count(). Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-16-imre.deak@intel.com commit 926b726c3d61153bf8e1702d4cc0a37606fd3017 Author: Imre Deak Date: Fri Oct 6 16:37:22 2023 +0300 drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_supports_format() Use the connector's DSC DPCD capabilities in intel_dp_dsc_supports_format(). Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-15-imre.deak@intel.com commit 2c4907c2e604d4eecd302c791ca9bddb6b31279c Author: Imre Deak Date: Fri Oct 6 16:37:21 2023 +0300 drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_compute_params() Use the connector's DSC DPCD capabilities in intel_dp_dsc_compute_params(). Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-14-imre.deak@intel.com commit 11a33d6b265faf898ae591a535b65fe9ca0eb532 Author: Imre Deak Date: Fri Oct 6 16:37:20 2023 +0300 drm/i915/dp: Pass only the required DSC DPCD to intel_dp_sink_dsc_version_minor() intel_dp_sink_dsc_version_minor() only requires the DSC DPCD, so pass only this to the function. Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-13-imre.deak@intel.com commit 6a60a8fa7c3af598885a554d1966ec0723ed39a6 Author: Imre Deak Date: Fri Oct 6 16:37:19 2023 +0300 drm/i915/dp: Pass only the required i915 to intel_dp_source_dsc_version_minor() intel_dp_source_dsc_version_minor() only requires the i915 pointer, so pass only this to the function. Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-12-imre.deak@intel.com commit cc81951d9a2078a252ce8667d3b47ef8aa6934d0 Author: Imre Deak Date: Fri Oct 6 16:37:18 2023 +0300 drm/i915/dp: Pass connector DSC DPCD to drm_dp_dsc_sink_supported_input_bpcs() Use the connector's DSC DPCD capabilities in drm_dp_dsc_sink_supported_input_bpcs(). Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-11-imre.deak@intel.com commit bb414c941bf07e127615bf3e775733c7e8d5a0b1 Author: Imre Deak Date: Fri Oct 6 16:37:17 2023 +0300 drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_max_sink_compressed_bppx16() Use the connector's DSC DPCD capabilities in intel_dp_dsc_max_sink_compressed_bppx16(). Reviewed-by: Stanislav Lisovskiy Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-10-imre.deak@intel.com commit 0d8665e068186b78028df67120fb99471c006ddb Author: Imre Deak Date: Fri Oct 6 16:37:16 2023 +0300 drm/i915/dp: Use connector DSC DPCD in intel_dp_supports_dsc() Use the connector's DSC DPCD capabilities in intel_dp_supports_dsc(). Reviewed-by: Stanislav Lisovskiy Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-9-imre.deak@intel.com commit 987c945ab2eef9529b56bda4ff6f0def98cd0238 Author: Imre Deak Date: Fri Oct 6 16:37:15 2023 +0300 drm/i915/dp: Use connector DSC DPCD in intel_dp_supports_fec() Use the connector's DSC DPCD capabilities in intel_dp_supports_fec(). Reviewed-by: Stanislav Lisovskiy Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-8-imre.deak@intel.com commit f52bbfe2ac657c3bd82fdbdcdffc2c8054358b37 Author: Imre Deak Date: Fri Oct 6 16:37:14 2023 +0300 drm/i915/dp: Use connector DSC DPCD in intel_dp_dsc_compute_max_bpp() Use the connector's DSC DPCD capabilities in intel_dp_dsc_compute_max_bpp() instead of the version stored in the encoder. Reviewed-by: Stanislav Lisovskiy Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-7-imre.deak@intel.com commit 102c8013b6536d93506d85d6664968e51556102c Author: Imre Deak Date: Fri Oct 6 16:37:13 2023 +0300 drm/i915/dp: Use connector DSC DPCD in i915_dsc_fec_support_show() Use the connector's DSC DPCD capabilities in i915_dsc_fec_support_show() instead of the version stored in the encoder. Atm the two are identical, but a follow-up patch will store the (MST) connector specific version in the connector. Reviewed-by: Stanislav Lisovskiy Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-6-imre.deak@intel.com commit 829d8a19437cdbaec19836835025833ebab232a2 Author: Imre Deak Date: Fri Oct 6 16:37:12 2023 +0300 drm/i915/dp: Use i915/intel connector local variables in i915_dsc_fec_support_show() Cache the i915 specific device and connector pointers in i915_dsc_fec_support_show(). v2: - s/Cahce/Cache typo in commit log. (Stan) Reviewed-by: Stanislav Lisovskiy Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231006133727.1822579-5-imre.deak@intel.com commit 808b43fa7e56e94563b86af2703ba88ee156e3c2 Author: Imre Deak Date: Tue Oct 10 14:25:03 2023 +0300 drm/i915/dp_mst: Set connector DSC capabilities and decompression AUX Similarly to eDP and SST-DP connectors read out the DSC capabilities for MST connectors as well. Atm these will match the root port's DSC caps and only used after a follow-up change enables the decompression for each stream separately (vs. the current way of enabling it only globally in the first branch device downstream of the root port). Reviewed-by: Stanislav Lisovskiy Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231010112504.2156789-3-imre.deak@intel.com commit 7389829f212d30d9588b969ff4a7b4d0005720a1 Author: Imre Deak Date: Wed Oct 11 20:16:05 2023 +0300 drm/i915/dp: Store DSC DPCD capabilities in the connector In an MST topology the DSC capabilities are specific to each connector, retrieved either from the sink if it decompresses the stream, or from a branch device between the source and the sink in case this branch device does the decompression. Accordingly each connector needs to cache its own DSC DPCD and FEC capabilities, along with the AUX device through which the decompression can be enabled. This patch prepares for that by storing the capabilities and the DSC AUX device in the connector, for now these just matching the version stored in intel_dp. The follow-up patches will convert all users to look up these in the connector instead of intel_dp, after which the intel_dp copies are removed. v2: - Rebased on intel_edp_get_dsc_sink_cap() addition in previous patch. v3: - Rebased on read-out fix for eDP in previous patch. Reviewed-by: Stanislav Lisovskiy (v1) Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231011171606.2540078-2-imre.deak@intel.com commit 90780a633cec2c904adbd9027f003d7eea89254b Author: Imre Deak Date: Wed Oct 11 20:16:04 2023 +0300 drm/i915/dp: Sanitize DPCD revision check in intel_dp_get_dsc_sink_cap() Check only the eDP or the DP specific DPCD revision depending on the sink type. Pass the corresponding revision to the function, which allows getting the DSC caps of a branch device (in an MST topology, which has its own DPCD and so DPCD revision). While at it use DP_DPCD_REV_14 instead of open coding it and for clarity add a separate function to read out the DSC capability on eDP. v2: - Use DP_DPCD_REV_14 instead of open coding it. (Stan) - Check EDP_DCPD_REV/DPCD_REV in a clearer way. (Ville) v3: - Fix the read-out for eDP in intel_dp_detect(). Cc: Ville Syrjälä Reviewed-by: Stanislav Lisovskiy (v1) Reviewed-by: Ville Syrjälä (v2) Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20231011171606.2540078-1-imre.deak@intel.com commit 6fd3e8682b0f1eb46518812353b84afdb8ce29ef Merge: 68f1d4198cd28 2138c32af1974 Author: Arnd Bergmann Date: Mon Oct 16 15:49:31 2023 +0200 Merge tag 'qcom-dts-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/dt Qualcomm ARM DeviceTree updates for v6.7 RPM master stats is introduced for MSM8226 and MSM8974. The PCIe PHY of SDX55 is transitioned to the new binding. The hall sensor on the Samsung Galaxy Tab 4 is inverted. A number of fixes reported from DeviceTree validation are fixed. * tag 'qcom-dts-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: ARM: dts: qcom: ipq8064: move keys and leds out of soc node ARM: dts: qcom: mdm9615: populate vsdcc fixed regulator ARM: dts: qcom: apq8060: drop incorrect regulator-type ARM: dts: qcom: apq8064: drop incorrect regulator-type ARM: dts: qcom: sdx65: fix SDHCI clocks order ARM: dts: qcom: apq8064: drop label property from DSI ARM: qcom: msm8974: Add rpm-master-stats node ARM: qcom: msm8226: Add rpm-master-stats node ARM: dts: qcom: apq8026-samsung-matisse-wifi: Fix inverted hall sensor ARM: dts: qcom: drop incorrect cell-index from SPMI ARM: dts: qcom-sdx55: switch PCIe QMP PHY to new style of bindings Link: https://lore.kernel.org/r/20231015204558.855987-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit 1bae0cfe4a171ccc5f731426296e45beafa096b8 Author: Yazen Ghannam Date: Tue Jun 13 09:11:42 2023 -0500 x86/mce: Cleanup mce_usable_address() Move Intel-specific checks into a helper function. Explicitly use "bool" for return type. No functional change intended. Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230613141142.36801-4-yazen.ghannam@amd.com commit 48da1ad8ba95ecd35d76355594c629f3ef2a954a Author: Yazen Ghannam Date: Tue Jun 13 09:11:41 2023 -0500 x86/mce: Define amd_mce_usable_address() Currently, all valid MCA_ADDR values are assumed to be usable on AMD systems. However, this is not correct in most cases. Notifiers expecting usable addresses may then operate on inappropriate values. Define a helper function to do AMD-specific checks for a usable memory address. List out all known cases. [ bp: Tone down the capitalized words. ] Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230613141142.36801-3-yazen.ghannam@amd.com commit 68f1d4198cd2860539dc84dd2159f6cb5e88dd94 Merge: 1b42ff0c869a4 33e9032a1875b Author: Arnd Bergmann Date: Mon Oct 16 15:29:48 2023 +0200 Merge tag 'qcom-arm64-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/dt Qualcomm ARM64 DeviceTree updates for v6.7 The SM7125 platform is introduced, with support for Xiaomi Redmi Note 9 Pro. Support for Fairphone 5, on QCM6490, and BQ Aquaris M5, on MSM8939, are introduced. With the various QMP PHY bindings having been refactored, SC7180, SC7280, SDM845, SM8150, and SM8250 are transitioned to the new USB/DP combo PHY binding. IPQ6018, IPQ8074 MSM8998, SC7280, SC8180X, SDM845, SM8150, SM8250, and SM8450 are transitioned to the new PCIe PHY binding, and SC8180X is transitioned to the new UFS phy binding. The UFS power supply situation is clarified, and a range of boards across MSM8996, MSM8998, SM4250, SM6115, SM6125, SM8350, SM8450, and SM8550 receives corrections for this. On IPQ5018 watchdog support is introduced, and the SCM driver has SDI (debug image) enabled - so that it can be disabled. On IPQ5332 USB is enabled. The hwspinlock identifier is corrected across IPQ5332, IPQ6018, IPQ8074 and IPQ9574. The reserved-memory ranges for the remoteprocs on MSM8916 boards are refactored, to reduce the amount of duplicated boilerplate definitions. A number of nodes are transitioned to be disabled by default, to facilitate new boards. Samsung Galaxy Tab A 8.0 and Samsung Galaxy Tab A 9.7 gains display support, and the latter capacitive keys. Samsung Galaxy J5 gains accelerometer support. The Dragonboard 410c gains missing ADC7533 regulator definition, and an overlay forcing the board to operate in host mode, for automation purposes. On MSM8976, the outgoing IPC bits for modem and wcss are corrected, and reserved-memory regions are updated. Incorrect reserved-memory regions are also corrected for MSM8992 and MSM8994 devices. The QRB2210 RB1 board gets debug UART moved per hardware update. regulator voltage ranges are corrected, remoteprocs are enabled, USB SuperSpeed PHY is enabled, and GPIO LEDs are introduced for Bluetooth, WiFi and a user LED. Interrupts are described for the SGMII PHYs on SA8775P Ride platform, and the inline crypto engine is introduced for UFS. On SC7180 the audio DSP remoteproc is introduced. Additional SKUs of the Lazor boards are added.The RT5682 audio codec part is reorganized to be easier to maintain. On Trogdor devices, the touchscreen and display panels are linked to improve the power cycling behavior across the two. On SC7280 the cpuidle states are rewritten to support OS-initiated PCSI mode. LMH interrupts are added, to receive feedback when throttling occurs. The embedded usb debugger (EUD) description and the dummy usb-c-connector node is removed, as this is not correctly described. The USB3 pipe clock input of the global clock controller is properly described. Modem remoteproc is introduced on SDM630, and the SDM670 PDC mapping is corrected. On the SDM845 MTP PCIe support is introduced. The volumn down and reset buttons are defined. Remoteproc firmware names and the WiFI configuration is corrected. On Sony Xperia XZ2, XZ2 Compact, and XZ3 GPIO lines names are provided for TLMM and PMICs. The camera regulators are also added. Display hardware blocks are added to SM6125, and enabled on Sony Xperia 10 II. The ref clock is wired up to PCIe PHY on SM8150. On SM8250/QRB5165, and the RB5 board, the DisplayPort controller and the TCPM is introduced, with all the plumbing to get USB role and orientation switching, as well as DisplayPort altmode to work. Interconnects and power-domains are also described for the QUPs on this platform. Previously ignored PMICs are described for the SM8350 Hardware Development Kit (HDK), and PMR735a regulators are introduced. The pinctrl state for uart18 is corrected. On SM8450 HDK audio routes are corrected, to enable the analog microphones on the board. The addition of the PRNG is reverted, in favor of an upcoming additon of a true RNG. Constants are replaced with QCOM_SCM_VMID_* defines on a variety of boards. The SM8550 QRD board gets Bluetooth support, and the camera clock controller is described. Additionally, a number of fixes are introduced in a variety of platforms and boards, to align with Devicetree bindings. * tag 'qcom-arm64-for-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (148 commits) arm64: dts: qcom: apq8016-sbc: Add missing ADV7533 regulators ARM: dts: qcom: sdx65-mtp: Specify PM7250B SID to use arm64: dts: qcom: apq8016-sbc: Add overlay for usb host mode arm64: dts: qcom: qcm6490: Add device-tree for Fairphone 5 dt-bindings: arm: qcom: Add QCM6490 Fairphone 5 arm64: dts: qcom: pm8350c: Add flash led node arm64: dts: qcom: pm7250b: make SID configurable arm64: dts: qcom: sc7280: Mark some nodes as 'reserved' arm64: dts: qcom: msm8939: Fix iommu local address range arm64: dts: qcom: ipq5018: indicate that SDI should be disabled arm64: dts: qcom: msm8976: Fix ipc bit shifts arm64: dts: qcom: msm8976: Split lpass region arm64: dts: qcom: pm8150l: Add wled node arm64: dts: qcom: sa8775p: enable the inline crypto engine arm64: dts: qcom: msm8916/39: Fix venus memory size arm64: dts: qcom: msm8916/39: Move mpss_mem size to boards arm64: dts: qcom: msm8916/39: Disable unneeded firmware reservations arm64: dts: qcom: msm8939: Reserve firmware memory dynamically arm64: dts: qcom: msm8916: Reserve MBA memory dynamically arm64: dts: qcom: msm8916: Reserve firmware memory dynamically ... Link: https://lore.kernel.org/r/20231015191107.854658-1-andersson@kernel.org Signed-off-by: Arnd Bergmann commit 2c269f42d0f382743ab230308b836ffe5ae9b2ae Author: Marek Marczykowski-Górecki Date: Mon Oct 16 15:13:25 2023 +0200 xen-pciback: Consider INTx disabled when MSI/MSI-X is enabled Linux enables MSI-X before disabling INTx, but keeps MSI-X masked until the table is filled. Then it disables INTx just before clearing MASKALL bit. Currently this approach is rejected by xen-pciback. According to the PCIe spec, device cannot use INTx when MSI/MSI-X is enabled (in other words: enabling MSI/MSI-X implicitly disables INTx). Change the logic to consider INTx disabled if MSI/MSI-X is enabled. This applies to three places: - checking currently enabled interrupts type, - transition to MSI/MSI-X - where INTx would be implicitly disabled, - clearing INTx disable bit - which can be allowed even if MSI/MSI-X is enabled, as device should consider INTx disabled anyway in that case Fixes: 5e29500eba2a ("xen-pciback: Allow setting PCI_MSIX_FLAGS_MASKALL too") Signed-off-by: Marek Marczykowski-Górecki Acked-by: Juergen Gross Link: https://lore.kernel.org/r/20231016131348.1734721-1-marmarek@invisiblethingslab.com Signed-off-by: Juergen Gross commit f0d7db7b33243d2aeeff14dbdde4ccc0687ef257 Author: Viresh Kumar Date: Mon Oct 16 12:41:27 2023 +0530 xen: privcmd: Add support for ioeventfd Virtio guests send VIRTIO_MMIO_QUEUE_NOTIFY notification when they need to notify the backend of an update to the status of the virtqueue. The backend or another entity, polls the MMIO address for updates to know when the notification is sent. It works well if the backend does this polling by itself. But as we move towards generic backend implementations, we end up implementing this in a separate user-space program. Generally, the Virtio backends are implemented to work with the Eventfd based mechanism. In order to make such backends work with Xen, another software layer needs to do the polling and send an event via eventfd to the backend once the notification from guest is received. This results in an extra context switch. This is not a new problem in Linux though. It is present with other hypervisors like KVM, etc. as well. The generic solution implemented in the kernel for them is to provide an IOCTL call to pass the address to poll and eventfd, which lets the kernel take care of polling and raise an event on the eventfd, instead of handling this in user space (which involves an extra context switch). This patch adds similar support for xen. Inspired by existing implementations for KVM, etc.. This also copies ioreq.h header file (only struct ioreq and related macros) from Xen's source tree (Top commit 5d84f07fe6bf ("xen/pci: drop remaining uses of bool_t")). Signed-off-by: Viresh Kumar Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/b20d83efba6453037d0c099912813c79c81f7714.1697439990.git.viresh.kumar@linaro.org Signed-off-by: Juergen Gross commit 9e90e58c11b74c2bddac4b2702cf79d36b981278 Author: Viresh Kumar Date: Mon Oct 16 12:41:26 2023 +0530 xen: evtchn: Allow shared registration of IRQ handers Currently the handling of events is supported either in the kernel or userspace, but not both. In order to support fast delivery of interrupts from the guest to the backend, we need to handle the Queue notify part of Virtio protocol in kernel and the rest in userspace. Update the interrupt handler registration flag to IRQF_SHARED for event channels, which would allow multiple entities to bind their interrupt handler for the same event channel port. Also increment the reference count of irq_info when multiple entities try to bind event channel to irqchip, so the unbinding happens only after all the users are gone. Signed-off-by: Viresh Kumar Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/99b1edfd3147c6b5d22a5139dab5861e767dc34a.1697439990.git.viresh.kumar@linaro.org Signed-off-by: Juergen Gross commit 767e33ca47dd8ace7769e0b0c19d7b0c38b2f72d Author: Viresh Kumar Date: Mon Oct 16 12:41:25 2023 +0530 xen: irqfd: Use _IOW instead of the internal _IOC() macro _IOC() an internal helper that we should not use in driver code. In particular, we got the data direction wrong here, which breaks a number of tools, as having "_IOC_NONE" should never be paired with a nonzero size. Use _IOW() instead. Fixes: f8941e6c4c71 ("xen: privcmd: Add support for irqfd") Reported-by: Arnd Bergmann Closes: https://lore.kernel.org/all/268a2031-63b8-4c7d-b1e5-8ab83ca80b4a@app.fastmail.com/ Signed-off-by: Viresh Kumar Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/599ca6f1b9dd2f0e6247ea37bee3ea6827404b6d.1697439990.git.viresh.kumar@linaro.org Signed-off-by: Juergen Gross commit 8dd765a5d769c521d73931850d1c8708fbc490cb Author: Viresh Kumar Date: Mon Oct 16 12:41:24 2023 +0530 xen: Make struct privcmd_irqfd's layout architecture independent Using indirect pointers in an ioctl command argument means that the layout is architecture specific, in particular we can't use the same one from 32-bit compat tasks. The general recommendation is to have __u64 members and use u64_to_user_ptr() to access it from the kernel if we are unable to avoid the pointers altogether. Fixes: f8941e6c4c71 ("xen: privcmd: Add support for irqfd") Reported-by: Arnd Bergmann Closes: https://lore.kernel.org/all/268a2031-63b8-4c7d-b1e5-8ab83ca80b4a@app.fastmail.com/ Signed-off-by: Viresh Kumar Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/a4ef0d4a68fc858b34a81fd3f9877d9b6898eb77.1697439990.git.viresh.kumar@linaro.org Signed-off-by: Juergen Gross commit d3a2b6b48f726b5a06f7ce9b8aab84f3cfe6b0fb Author: Gustavo A. R. Silva Date: Mon Oct 9 12:55:30 2023 -0600 xen/xenbus: Add __counted_by for struct read_buffer and use struct_size() Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). While there, use struct_size() helper, instead of the open-coded version, to calculate the size for the allocation of the whole flexible structure, including of course, the flexible-array member. This code was found with the help of Coccinelle, and audited and fixed manually. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Reviewed-by: Jason Andryuk Link: https://lore.kernel.org/r/ZSRMosLuJJS5Y/io@work Signed-off-by: Juergen Gross commit 44961b81a9e9059b5c0443643915386db7035227 Author: Juergen Gross Date: Tue Aug 22 11:11:38 2023 +0200 xenbus: fix error exit in xenbus_init() In case an error occurs in xenbus_init(), xen_store_domain_type should be set to XS_UNKNOWN. Fix one instance where this action is missing. Fixes: 5b3353949e89 ("xen: add support for initializing xenstore later as HVM domain") Reported-by: kernel test robot Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/202304200845.w7m4kXZr-lkp@intel.com/ Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Tyshchenko Link: https://lore.kernel.org/r/20230822091138.4765-1-jgross@suse.com Signed-off-by: Juergen Gross commit e8d4006dc24e66105444715d6d5daa244aa2bdec Author: Mark Rutland Date: Mon Oct 16 11:25:01 2023 +0100 arm64: Remove cpus_have_const_cap() There are no longer any users of cpus_have_const_cap(), and therefore it can be removed. Remove cpus_have_const_cap(). At the same time, remove __cpus_have_const_cap(), as this is a trivial wrapper of alternative_has_cap_unlikely(), which can be used directly instead. The comment for __system_matches_cap() is updated to no longer refer to cpus_have_const_cap(). As we have a number of ways to check the cpucaps, the specific suggestions are removed. Signed-off-by: Mark Rutland Cc: Kristina Martsenko Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 47759eca76d1807923fffec6421ba8014432c191 Author: Mark Rutland Date: Mon Oct 16 11:25:00 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_REPEAT_TLBI In arch_tlbbatch_should_defer() we use cpus_have_const_cap() to check for ARM64_WORKAROUND_REPEAT_TLBI, but this is not necessary and alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The cpus_have_const_cap() check in arch_tlbbatch_should_defer() is an optimization to avoid some redundant work when the ARM64_WORKAROUND_REPEAT_TLBI cpucap is detected and forces the immediate use of TLBI + DSB ISH. In the window between detecting the ARM64_WORKAROUND_REPEAT_TLBI cpucap and patching alternatives this is not a big concern and there's no need to optimize this window at the expsense of subsequent usage at runtime. This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. The ARM64_WORKAROUND_REPEAT_TLBI cpucap is added to cpucap_is_possible() so that code can be elided entirely when this is not possible without requiring ifdeffery or IS_ENABLED() checks at each usage. Signed-off-by: Mark Rutland Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 0d48058ef8294a95907e647db018cefb522af98a Author: Mark Rutland Date: Mon Oct 16 11:24:59 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_NVIDIA_CARMEL_CNP In has_useable_cnp() we use cpus_have_const_cap() to check for ARM64_WORKAROUND_NVIDIA_CARMEL_CNP, but this is not necessary and cpus_have_cap() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. We use has_useable_cnp() to determine whether we have the system-wide ARM64_HAS_CNP cpucap. Due to the structure of the cpufeature code, we call has_useable_cnp() in two distinct cases: 1) When finalizing system capabilities, setup_system_capabilities() will call has_useable_cnp() with SCOPE_SYSTEM to determine whether all CPUs have the feature. This is called after we've detected any local cpucaps including ARM64_WORKAROUND_NVIDIA_CARMEL_CNP, but prior to patching alternatives. If the ARM64_WORKAROUND_NVIDIA_CARMEL_CNP was detected, we will not detect ARM64_HAS_CNP. 2) After finalizing system capabilties, verify_local_cpu_capabilities() will call has_useable_cnp() with SCOPE_LOCAL_CPU to verify that CPUs have CNP if we previously detected it. Note that if ARM64_WORKAROUND_NVIDIA_CARMEL_CNP was detected, we will not have detected ARM64_HAS_CNP. For case 1 we must check the system_cpucaps bitmap as this occurs prior to patching the alternatives. For case 2 we'll only call has_useable_cnp() once per subsequent onlining of a CPU, and as this isn't a fast path it's not necessary to optimize for this case. This patch replaces the use of cpus_have_const_cap() with cpus_have_cap(), which will only generate the bitmap test and avoid generating an alternative sequence, resulting in slightly simpler annd smaller code being generated. The ARM64_WORKAROUND_NVIDIA_CARMEL_CNP cpucap is added to cpucap_is_possible() so that code can be elided entirely when this is not possible. Signed-off-by: Mark Rutland Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit a98a5eac4d69e639e2a3edbac9fce89de4ec39ee Author: Mark Rutland Date: Mon Oct 16 11:24:58 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_CAVIUM_23154 In gic_read_iar() we use cpus_have_const_cap() to check for ARM64_WORKAROUND_CAVIUM_23154 but this is not necessary and alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The ARM64_WORKAROUND_CAVIUM_23154 cpucap is detected and patched early on the boot CPU before the GICv3 driver is initialized and hence before gic_read_iar() is ever called. Thus it is not necessary to use cpus_have_const_cap(), and alternative_has_cap() is equivalent. In addition, arm64's gic_read_iar() lives in irq-gic-v3.c purely for historical reasons. It was originally added prior to 32-bit arm support in commit: 6d4e11c5e2e8cd54 ("irqchip/gicv3: Workaround for Cavium ThunderX erratum 23154") When support for 32-bit arm was added, 32-bit arm's gic_read_iar() implementation was placed in , but the arm64 version was kept within irq-gic-v3.c as it depended on a static key local to irq-gic-v3.c and it was easier to add ifdeffery, which is what we did in commit: 7936e914f7b0827c ("irqchip/gic-v3: Refactor the arm64 specific parts") Subsequently the static key was replaced with a cpucap in commit: a4023f682739439b ("arm64: Add hypervisor safe helper for checking constant capabilities") Since that commit there has been no need to keep arm64's gic_read_iar() in irq-gic-v3.c. This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. For consistency, move the arm64-specific gic_read_iar() implementation over to arm64's . The ARM64_WORKAROUND_CAVIUM_23154 cpucap is added to cpucap_is_possible() so that code can be elided entirely when this is not possible. Signed-off-by: Mark Rutland Cc: Marc Zyngier Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 412cb3801dfac4703032f438fa538e850cc14b6d Author: Mark Rutland Date: Mon Oct 16 11:24:57 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_2645198 We use cpus_have_const_cap() to check for ARM64_WORKAROUND_2645198 but this is not necessary and alternative_has_cap() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The ARM64_WORKAROUND_2645198 cpucap is detected and patched before any userspace translation table exist, and the workaround is only necessary when manipulating usrspace translation tables which are in use. Thus it is not necessary to use cpus_have_const_cap(), and alternative_has_cap() is equivalent. This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. The ARM64_WORKAROUND_2645198 cpucap is added to cpucap_is_possible() so that code can be elided entirely when this is not possible, and redundant IS_ENABLED() checks are removed. Signed-off-by: Mark Rutland Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 48b57d9199f471b4366bbc834890be8249525534 Author: Mark Rutland Date: Mon Oct 16 11:24:56 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_1742098 In elf_hwcap_fixup() we use cpus_have_const_cap() to check for ARM64_WORKAROUND_1742098, but this is not necessary and cpus_have_cap() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The ARM64_WORKAROUND_1742098 cpucap is detected and patched before elf_hwcap_fixup() can run, and hence it is not necessary to use cpus_have_const_cap(). We run cpus_have_const_cap() at most twice: once after finalizing system cpucaps, and potentially once more after detecting mismatched CPUs which support AArch32 at EL0. Due to this, it's not necessary to optimize for many calls to elf_hwcap_fixup(), and it's fine to use cpus_have_cap(). This patch replaces the use of cpus_have_const_cap() with cpus_have_cap(), which will only generate the bitmap test and avoid generating an alternative sequence, resulting in slightly simpler annd smaller code being generated. For consistenct with other cpucaps, the ARM64_WORKAROUND_1742098 cpucap is added to cpucap_is_possible() so that code can be elided when this is not possible. However, as we only define compat_elf_hwcap2 when CONFIG_COMPAT=y, some ifdeffery is still required within user_feature_fixup() to avoid build errors when CONFIG_COMPAT=n. Signed-off-by: Mark Rutland Cc: James Morse Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit d1e40f822290d3116f83acc06606d181cccf5bb2 Author: Mark Rutland Date: Mon Oct 16 11:24:55 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_1542419 We use cpus_have_const_cap() to check for ARM64_WORKAROUND_1542419 but this is not necessary and cpus_have_final_cap() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The ARM64_WORKAROUND_1542419 cpucap is detected and patched before any userspace code can run, and the both __do_compat_cache_op() and ctr_read_handler() are only reachable from exceptions taken from userspace. Thus it is not necessary for either to use cpus_have_const_cap(), and cpus_have_final_cap() is equivalent. This patch replaces the use of cpus_have_const_cap() with cpus_have_final_cap(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. Using cpus_have_final_cap() clearly documents that we do not expect this code to run before cpucaps are finalized, and will make it easier to spot issues if code is changed in future to allow these functions to be reached earlier. Signed-off-by: Mark Rutland Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 0a285dfe875d5206da10c3d00564727f9482a9dd Author: Mark Rutland Date: Mon Oct 16 11:24:54 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_WORKAROUND_843419 In count_plts() and is_forbidden_offset_for_adrp() we use cpus_have_const_cap() to check for ARM64_WORKAROUND_843419, but this is not necessary and cpus_have_final_cap() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. It's not possible to load a module in the window between detecting the ARM64_WORKAROUND_843419 cpucap and patching alternatives. The module VA range limits are initialized much later in module_init_limits() which is a subsys_initcall, and module loading cannot happen before this. Hence it's not necessary for count_plts() or is_forbidden_offset_for_adrp() to use cpus_have_const_cap(). This patch replaces the use of cpus_have_const_cap() with cpus_have_final_cap() which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. Using cpus_have_final_cap() clearly documents that we do not expect this code to run before cpucaps are finalized, and will make it easier to spot issues if code is changed in future to allow modules to be loaded earlier. The ARM64_WORKAROUND_843419 cpucap is added to cpucap_is_possible() so that code can be elided entirely when this is not possible, and redundant IS_ENABLED() checks are removed. Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit c2ef5f1e159285a0f7944e8838698f81cb709f15 Author: Mark Rutland Date: Mon Oct 16 11:24:53 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_UNMAP_KERNEL_AT_EL0 In arm64_kernel_unmapped_at_el0() we use cpus_have_const_cap() to check for ARM64_UNMAP_KERNEL_AT_EL0, but this is only necessary so that arm64_get_bp_hardening_vector() and this_cpu_set_vectors() can run prior to alternatives being patched. Otherwise this is not necessary and alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The ARM64_UNMAP_KERNEL_AT_EL0 cpucap is a system-wide feature that is detected and patched before any translation tables are created for userspace. In the window between detecting the ARM64_UNMAP_KERNEL_AT_EL0 cpucap and patching alternatives, most users of arm64_kernel_unmapped_at_el0() do not need to know that the cpucap has been detected: * As KVM is initialized after cpucaps are finalized, no usaef of arm64_kernel_unmapped_at_el0() in the KVM code is reachable during this window. * The arm64_mm_context_get() function in arch/arm64/mm/context.c is only called after the SMMU driver is brought up after alternatives have been patched. Thus this can safely use cpus_have_final_cap() or alternative_has_cap_*(). Similarly the asids_update_limit() function is called after alternatives have been patched as an arch_initcall, and this can safely use cpus_have_final_cap() or alternative_has_cap_*(). Similarly we do not expect an ASID rollover to occur between cpucaps being detected and patching alternatives. Thus set_reserved_asid_bits() can safely use cpus_have_final_cap() or alternative_has_cap_*(). * The __tlbi_user() and __tlbi_user_level() macros are not used during this window, and only need to invalidate additional entries once userspace translation tables have been active on a CPU. Thus these can safely use alternative_has_cap_*(). * The xen_kernel_unmapped_at_usr() function is not used during this window as it is only used in a late_initcall. Thus this can safely use cpus_have_final_cap() or alternative_has_cap_*(). * The arm64_get_meltdown_state() function is not used during this window. It only used by arm64_get_meltdown_state() and KVM code, both of which are only used after cpucaps have been finalized. Thus this can safely use cpus_have_final_cap() or alternative_has_cap_*(). * The tls_thread_switch() uses arm64_kernel_unmapped_at_el0() as an optimization to avoid zeroing tpidrro_el0 when KPTI is enabled and this will be trampled by the KPTI trampoline. It doesn't matter if this continues to zero the register during the window between detecting the cpucap and patching alternatives, so this can safely use alternative_has_cap_*(). * The sdei_arch_get_entry_point() and do_sdei_event() functions aren't reachable at this time as the SDEI driver is registered later by acpi_init() -> acpi_ghes_init() -> sdei_init(), where acpi_init is a subsys_initcall. Thus these can safely use cpus_have_final_cap() or alternative_has_cap_*(). * The uses under drivers/ aren't reachable at this time as the drivers are registered later: - TRBE is registered via module_init() - SMMUv3 is registred via module_driver() - SPE is registred via module_init() * The arm64_get_bp_hardening_vector() and this_cpu_set_vectors() functions need to run on boot CPUs prior to patching alternatives. As these are only called during the onlining of a CPU, it's fine to perform a system_cpucaps bitmap test using cpus_have_cap(). This patch modifies this_cpu_set_vectors() to use cpus_have_cap(), and replaced all other use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. The ARM64_UNMAP_KERNEL_AT_EL0 cpucap is added to cpucap_is_possible() so that code can be elided entirely when this is not possible. Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: James Morse Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit a76521d160284a1edcb866e6fc6727d9f10ccb68 Author: Mark Rutland Date: Mon Oct 16 11:24:52 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_{SVE,SME,SME2,FA64} In system_supports_{sve,sme,sme2,fa64}() we use cpus_have_const_cap() to check for the relevant cpucaps, but this is only necessary so that sve_setup() and sme_setup() can run prior to alternatives being patched, and otherwise alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. All of system_supports_{sve,sme,sme2,fa64}() will return false prior to system cpucaps being detected. In the window between system cpucaps being detected and patching alternatives, we need system_supports_sve() and system_supports_sme() to run to initialize SVE and SME properties, but all other users of system_supports_{sve,sme,sme2,fa64}() don't depend on the relevant cpucap becoming true until alternatives are patched: * No KVM code runs until after alternatives are patched, and so this can safely use cpus_have_final_cap() or alternative_has_cap_*(). * The cpuid_cpu_online() callback in arch/arm64/kernel/cpuinfo.c is registered later from cpuinfo_regs_init() as a device_initcall, and so this can safely use cpus_have_final_cap() or alternative_has_cap_*(). * The entry, signal, and ptrace code isn't reachable until userspace has run, and so this can safely use cpus_have_final_cap() or alternative_has_cap_*(). * Currently perf_reg_validate() will un-reserve the PERF_REG_ARM64_VG pseudo-register before alternatives are patched, and before sve_setup() has run. If a sampling event is created early enough, this would allow perf_ext_reg_value() to sample (the as-yet uninitialized) thread_struct::vl[] prior to alternatives being patched. It would be preferable to defer this until alternatives are patched, and this can safely use alternative_has_cap_*(). * The context-switch code will run during this window as part of stop_machine() used during alternatives_patch_all(), and potentially for other work if other kernel threads are created early. No threads require the use of SVE/SME/SME2/FA64 prior to alternatives being patched, and it would be preferable for the related context-switch logic to take effect after alternatives are patched so that ths is guaranteed to see a consistent system-wide state (e.g. anything initialized by sve_setup() and sme_setup(). This can safely ues alternative_has_cap_*(). This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. The sve_setup() and sme_setup() functions are modified to use cpus_have_cap() directly so that they can observe the cpucaps being set prior to alternatives being patched. Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit af64543977d66e13e487870780c18ef48187c493 Author: Mark Rutland Date: Mon Oct 16 11:24:51 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_SPECTRE_V2 In arm64_apply_bp_hardening() we use cpus_have_const_cap() to check for ARM64_SPECTRE_V2 , but this is not necessary and alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The cpus_have_const_cap() check in arm64_apply_bp_hardening() is intended to avoid the overhead of looking up and invoking a per-cpu function pointer when no branch predictor hardening is required. The arm64_apply_bp_hardening() function itself is called in two distinct flows: 1) When handling certain exceptions taken from EL0, where the PC could be a TTBR1 address and hence might have trained a branch predictor. As cpucaps are detected and alternatives are patched long before it is possible to execute userspace, it is not necessary to use cpus_have_const_cap() for these cases, and cpus_have_final_cap() or alternative_has_cap() would be preferable. 2) When switching between tasks in check_and_switch_context(). This can be called before cpucaps are detected and alternatives are patched, but this is long before the kernel mounts filesystems or accepts any input. At this stage the kernel hasn't loaded any secrets and there is no potential for hostile branch predictor training. Once cpucaps have been finalized and alternatives have been patched, switching tasks will invalidate any prior predictions. Hence it is not necessary to use cpus_have_const_cap() for this case. This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. Signed-off-by: Mark Rutland Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit bc75d0c0f376fef3548691a73f1311c6cc1041e6 Author: Mark Rutland Date: Mon Oct 16 11:24:50 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_SSBS In ssbs_thread_switch() we use cpus_have_const_cap() to check for ARM64_SSBS, but this is not necessary and alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The cpus_have_const_cap() check in ssbs_thread_switch() is an optimization to avoid the overhead of spectre_v4_enable_task_mitigation() where all CPUs implement SSBS and naturally preserve the SSBS bit in SPSR_ELx. In the window between detecting the ARM64_SSBS system-wide and patching alternative branches it is benign to continue to call spectre_v4_enable_task_mitigation(). This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. Signed-off-by: Mark Rutland Cc: Marc Zyngier Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 94324bcbc9d3b77fa29519f27852463a6385828a Author: Mark Rutland Date: Mon Oct 16 11:24:49 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_MTE In system_supports_mte() we use cpus_have_const_cap() to check for ARM64_MTE, but this is not necessary and cpus_have_final_boot_cap() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The ARM64_MTE cpucap is a boot cpu feature which is detected and patched early on the boot CPU under smp_prepare_boot_cpu(). In the window between detecting the ARM64_MTE cpucap and patching alternatives, nothing depends on the ARM64_MTE cpucap: * The kasan_hw_tags_enabled() helper depends upon the kasan_flag_enabled static key, which is initialized later in kasan_init_hw_tags() after alternatives have been applied. * No KVM code is called during this window, and KVM is not initialized until after system cpucaps have been detected and patched. KVM code can safely use cpus_have_final_cap() or alternative_has_cap_*(). * We don't context-switch prior to patching boot alternatives, and thus mte_thread_switch() is not reachable during this window. Thus, we can safely use cpus_have_final_boot_cap() or alternative_has_cap_*() in the context-switch code. * IRQ and FIQ are masked during this window, and we can only take SError and Debug exceptions. SError exceptions are fatal at this point in time, and we do not expect to take Debug exceptions, thus: - It's fine to lave TCO set for exceptions taken during this window, and mte_disable_tco_entry() doesn't need to do anything. - We don't need to detect and report asynchronous tag cehck faults during this window, and neither mte_check_tfsr_entry() nor mte_check_tfsr_exit() need to do anything. Since we want to report any SErrors taken during thiw window, these cannot safely use cpus_have_final_boot_cap() or cpus_have_final_cap(), but these can safely use alternative_has_cap_*(). * The __set_pte_at() function is not used during this window. It is possible for this to be used on kernel mappings prior to boot cpucaps being finalized, so this cannot safely use cpus_have_final_boot_cap() or cpus_have_final_cap(), but this can safely use alternative_has_cap_*(). * No userspace translation tables have been created yet, and swap has not been initialized yet. Thus swapping is not possible and none of the following are called: - arch_thp_swp_supported() - arch_prepare_to_swap() - arch_swap_invalidate_page() - arch_swap_invalidate_area() - arch_swap_restore() These can safely use system_has_final_cap() or alternative_has_cap_*(). * The elfcore functions are only reachable after userspace is brought up, which happens after system cpucaps have been detected and patched. Thus the elfcore code can safely use cpus_have_final_cap() or alternative_has_cap_*(). * Hibernation is only possible after userspace is brought up, which happens after system cpucaps have been detected and patched. Thus the hibernate code can safely use cpus_have_final_cap() or alternative_has_cap_*(). * The set_tagged_addr_ctrl() function is only reachable after userspace is brought up, which happens after system cpucaps have been detected and patched. Thus this can safely use cpus_have_final_cap() or alternative_has_cap_*(). * The copy_user_highpage() and copy_highpage() functions are not used during this window, and can safely use alternative_has_cap_*(). This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. Signed-off-by: Mark Rutland Cc: Peter Collingbourne Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit b54b52576443eece09d0e6cb80198dc17f6b96a5 Author: Mark Rutland Date: Mon Oct 16 11:24:48 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_HAS_TLB_RANGE We use cpus_have_const_cap() to check for ARM64_HAS_TLB_RANGE, but this is not necessary and alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. In the window between detecting the ARM64_HAS_TLB_RANGE cpucap and patching alternative branches, we do not perform any TLB invalidation, and even if we were to perform TLB invalidation here it would not be functionally necessary to optimize this by using range invalidation. Hence there's no need to use cpus_have_const_cap(), and alternative_has_cap_unlikely() is sufficient. This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. Signed-off-by: Mark Rutland Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 4c73056e3277f803ccdb7769e55fe7153edb07cc Author: Mark Rutland Date: Mon Oct 16 11:24:47 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_HAS_WFXT In __delay() we use cpus_have_const_cap() to check for ARM64_HAS_WFXT, but this is not necessary and alternative_has_cap() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The cpus_have_const_cap() check in __delay() is an optimization to use WFIT and WFET in preference to busy-polling the counter and/or using regular WFE and relying upon the architected timer event stream. It is not necessary to apply this optimization in the window between detecting the ARM64_HAS_WFXT cpucap and patching alternatives. This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. Signed-off-by: Mark Rutland Cc: Marc Zyngier Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 1963d9660d99bdd1bd3666afc6c670d84bff0efb Author: Mark Rutland Date: Mon Oct 16 11:24:46 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_HAS_RNG In __cpu_has_rng() we use cpus_have_const_cap() to check for ARM64_HAS_RNG, but this is not necessary and alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. In the window between detecting the ARM64_HAS_RNG cpucap and patching alternative branches, nothing which calls __cpu_has_rng() can run, and hence it's not necessary to use cpus_have_const_cap(). This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Cc: Ard Biesheuvel Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 4e00f1d9b7ff6b681fbd048fe5389089ae65bc11 Author: Mark Rutland Date: Mon Oct 16 11:24:45 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_HAS_EPAN We use cpus_have_const_cap() to check for ARM64_HAS_EPAN but this is not necessary and alternative_has_cap() or cpus_have_cap() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The ARM64_HAS_EPAN cpucap is used to affect two things: 1) The permision bits used for userspace executable mappings, which are chosen by adjust_protection_map(), which is an arch_initcall. This is called after the ARM64_HAS_EPAN cpucap has been detected and alternatives have been patched, and before any userspace translation tables exist. 2) The handling of faults taken from (user or kernel) accesses to userspace executable mappings in do_page_fault(). Userspace translation tables are created after adjust_protection_map() is called, and hence after the ARM64_HAS_EPAN cpucap has been detected and alternatives have been patched. Neither of these run until after ARM64_HAS_EPAN cpucap has been detected and alternatives have been patched, and hence there's no need to use cpus_have_const_cap(). Since adjust_protection_map() is only executed once at boot time it would be best for it to use cpus_have_cap(), and since do_page_fault() is executed frequently it would be best for it to use alternatives_have_cap_unlikely(). This patch replaces the uses of cpus_have_const_cap() with cpus_have_cap() and alternative_has_cap_unlikely(), which will avoid generating redundant code, and should be better for all subsequent calls at runtime. The ARM64_HAS_EPAN cpucap is added to cpucap_is_possible() so that code can be elided entirely when this is not possible. Signed-off-by: Mark Rutland Cc: James Morse Cc: Vladimir Murzin Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 53d62e995d9eaed16390d38b40eaed4286a1282c Author: Mark Rutland Date: Mon Oct 16 11:24:44 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_HAS_PAN In system_uses_hw_pan() we use cpus_have_const_cap() to check for ARM64_HAS_PAN, but this is only necessary so that the system_uses_ttbr0_pan() check in setup_cpu_features() can run prior to alternatives being patched, and otherwise this is not necessary and alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The ARM64_HAS_PAN cpucap is used by system_uses_hw_pan() and system_uses_ttbr0_pan() depending on whether CONFIG_ARM64_SW_TTBR0_PAN is selected, and: * We only use system_uses_hw_pan() directly in __sdei_handler(), which isn't reachable until after alternatives have been patched, and for this it is safe to use alternative_has_cap_*(). * We use system_uses_ttbr0_pan() in a few places: - In check_and_switch_context() and cpu_uninstall_idmap(), which will defer installing a translation table into TTBR0 when the ARM64_HAS_PAN cpucap is not detected. Prior to patching alternatives, all CPUs will be using init_mm with the reserved ttbr0 translation tables install in TTBR0, so these can safely use alternative_has_cap_*(). - In update_saved_ttbr0(), which will only save the active TTBR0 into a per-thread variable when the ARM64_HAS_PAN cpucap is not detected. Prior to patching alternatives, all CPUs will be using init_mm with the reserved ttbr0 translation tables install in TTBR0, so these can safely use alternative_has_cap_*(). - In efi_set_pgd(), which will handle check_and_switch_context() deferring the installation of TTBR0 when TTBR0 PAN is detected. The EFI runtime services are not initialized until after alternatives have been patched, and so this can safely use alternative_has_cap_*() or cpus_have_final_cap(). - In uaccess_ttbr0_disable() and uaccess_ttbr0_enable(), where we'll avoid installing/uninstalling a translation table in TTBR0 when ARM64_HAS_PAN is detected. Prior to patching alternatives we will not perform any uaccess and will not call uaccess_ttbr0_disable() or uaccess_ttbr0_enable(), and so these can safely use alternative_has_cap_*() or cpus_have_final_cap(). - In is_el1_permission_fault() where we will consider a translation fault on a TTBR0 address to be a permission fault when ARM64_HAS_PAN is not detected *and* we have set the PAN bit in the SPSR (which tells us that in the interrupted context, TTBR0 pointed at the reserved zero ttbr). In the window between detecting system cpucaps and patching alternatives we should not perform any accesses to TTBR0 addresses, and no userspace translation tables exist until after patching alternatives. Thus it is safe for this to use alternative_has_cap*(). This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. So that the check for TTBR0 PAN in setup_cpu_features() can run prior to alternatives being patched, the call to system_uses_ttbr0_pan() is replaced with an explicit check of the ARM64_HAS_PAN bit in the system_cpucaps bitmap. Signed-off-by: Mark Rutland Cc: James Morse Cc: Marc Zyngier Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 20af807d806d13f4ab7795943587cf41257c649a Author: Mark Rutland Date: Mon Oct 16 11:24:43 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_HAS_GIC_PRIO_MASKING In system_uses_irq_prio_masking() we use cpus_have_const_cap() to check for ARM64_HAS_GIC_PRIO_MASKING, but this is not necessary and alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. When CONFIG_ARM64_PSEUDO_NMI=y the ARM64_HAS_GIC_PRIO_MASKING cpucap is a strict boot cpu feature which is detected and patched early on the boot cpu, which both happen in smp_prepare_boot_cpu(). In the window between the ARM64_HAS_GIC_PRIO_MASKING cpucap is detected and alternatives are patched we don't run any code that depends upon the ARM64_HAS_GIC_PRIO_MASKING cpucap: * We leave DAIF.IF set until after boot alternatives are patched, and interrupts are unmasked later in init_IRQ(), so we cannot reach IRQ/FIQ entry code and will not use irqs_priority_unmasked(). * We don't call any code which uses arm_cpuidle_save_irq_context() and arm_cpuidle_restore_irq_context() during this window. * We don't call start_thread_common() during this window. * The local_irq_*() code in depends solely on an alternative branch since commit: a5f61cc636f48bdf ("arm64: irqflags: use alternative branches for pseudo-NMI logic") ... and hence will use the default (DAIF-only) masking behaviour until alternatives are patched. * Secondary CPUs are brought up later after alternatives are patched, and alternatives are patched on the boot CPU immediately prior to calling init_gic_priority_masking(), so we'll correctly initialize interrupt masking regardless. This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. As this makes system_uses_irq_prio_masking() equivalent to __irqflags_uses_pmr(), the latter is removed and replaced with the former for consistency. Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: Mark Brown Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 25693f1771552ad6a2f38c7749a5b7516bbddd1d Author: Mark Rutland Date: Mon Oct 16 11:24:42 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_HAS_DIT In __cpu_suspend_exit() we use cpus_have_const_cap() to check for ARM64_HAS_DIT but this is not necessary and cpus_have_final_cap() of alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The ARM64_HAS_DIT cpucap is detected and patched (along with all other cpucaps) before __cpu_suspend_exit() can run. We'll only use __cpu_suspend_exit() as part of PSCI cpuidle or hibernation, and both of these are intialized after system cpucaps are detected and patched: the PSCI cpuidle driver is registered with a device_initcall, hibernation restoration occurs in a late_initcall, and hibarnation saving is driven by usrspace. Therefore it is not necessary to use cpus_have_const_cap(), and using alternative_has_cap_*() or cpus_have_final_cap() is sufficient. This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. To clearly document the ordering relationship between suspend/resume and alternatives patching, an explicit check for system_capabilities_finalized() is added to cpu_suspend() along with a comment block, which will make it easier to spot issues if code is changed in future to allow these functions to be reached earlier. Signed-off-by: Mark Rutland Cc: James Morse Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 54c8818aa283040956a3e85368bb9d9abad1bf7a Author: Mark Rutland Date: Mon Oct 16 11:24:41 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_HAS_CNP In system_supports_cnp() we use cpus_have_const_cap() to check for ARM64_HAS_CNP, but this is only necessary so that the cpu_enable_cnp() callback can run prior to alternatives being patched, and otherwise this is not necessary and alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The cpu_enable_cnp() callback is run immediately after the ARM64_HAS_CNP cpucap is detected system-wide under setup_system_capabilities(), prior to alternatives being patched. During this window cpu_enable_cnp() uses cpu_replace_ttbr1() to set the CNP bit for the swapper_pg_dir in TTBR1. No other users of the ARM64_HAS_CNP cpucap need the up-to-date value during this window: * As KVM isn't initialized yet, kvm_get_vttbr() isn't reachable. * As cpuidle isn't initialized yet, __cpu_suspend_exit() isn't reachable. * At this point all CPUs are using the swapper_pg_dir with a reserved ASID in TTBR1, and the idmap_pg_dir in TTBR0, so neither check_and_switch_context() nor cpu_do_switch_mm() need to do anything special. This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. To allow cpu_enable_cnp() to function prior to alternatives being patched, cpu_replace_ttbr1() is split into cpu_replace_ttbr1() and cpu_enable_swapper_cnp(), with the former only used for early TTBR1 replacement, and the latter used by both cpu_enable_cnp() and __cpu_suspend_exit(). Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: Suzuki K Poulose Cc: Vladimir Murzin Cc: Will Deacon Signed-off-by: Catalin Marinas commit 6766a8ef18a7796e728774e390c0e8526abb6d6d Author: Mark Rutland Date: Mon Oct 16 11:24:40 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_HAS_CACHE_DIC In icache_inval_all_pou() we use cpus_have_const_cap() to check for ARM64_HAS_CACHE_DIC, but this is not necessary and alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The cpus_have_const_cap() check in icache_inval_all_pou() is an optimization to skip a redundant (but benign) IC IALLUIS + DSB ISH sequence when all CPUs in the system have DIC. In the window between detecting the ARM64_HAS_CACHE_DIC cpucap and patching alternative branches there is only a single potential call to icache_inval_all_pou() (in the alternatives patching itself), which there's no need to optimize for at the expense of other callers. This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. This also aligns better with the way we patch the assembly cache maintenance sequences in arch/arm64/mm/cache.S. Signed-off-by: Mark Rutland Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit bbbb65770bf44d3eaec5b7784028756b58ea08db Author: Mark Rutland Date: Mon Oct 16 11:24:39 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_HAS_BTI In system_supports_bti() we use cpus_have_const_cap() to check for ARM64_HAS_BTI, but this is not necessary and alternative_has_cap_*() or cpus_have_final_*cap() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. When CONFIG_ARM64_BTI_KERNEL=y, the ARM64_HAS_BTI cpucap is a strict boot cpu feature which is detected and patched early on the boot cpu. All uses guarded by CONFIG_ARM64_BTI_KERNEL happen after the boot CPU has detected ARM64_HAS_BTI and patched boot alternatives, and hence can safely use alternative_has_cap_*() or cpus_have_final_boot_cap(). Regardless of CONFIG_ARM64_BTI_KERNEL, all other uses of ARM64_HAS_BTI happen after system capabilities have been finalized and alternatives have been patched. Hence these can safely use alternative_has_cap_*) or cpus_have_final_cap(). This patch splits system_supports_bti() into system_supports_bti() and system_supports_bti_kernel(), with the former handling where the cpucap affects userspace functionality, and ther latter handling where the cpucap affects kernel functionality. The use of cpus_have_const_cap() is replaced by cpus_have_final_cap() in cpus_have_const_cap, and cpus_have_final_boot_cap() in system_supports_bti_kernel(). This will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. The use of cpus_have_final_cap() and cpus_have_final_boot_cap() will make it easier to spot if code is chaanged such that these run before the ARM64_HAS_BTI cpucap is guaranteed to have been finalized. Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Cc: Ard Biesheuvel Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit d70bac1d22f0a215047a1f6b9c8c7af858d975fc Author: Mark Rutland Date: Mon Oct 16 11:24:38 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_HAS_ARMv8_4_TTL In __tlbi_level() we use cpus_have_const_cap() to check for ARM64_HAS_ARMv8_4_TTL, but this is not necessary and alternative_has_cap_*() would be preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. In the window between detecting the ARM64_HAS_ARMv8_4_TTL cpucap and patching alternative branches, we do not perform any TLB invalidation, and even if we were to perform TLB invalidation here it would not be functionally necessary to optimize this by using the TTL hint. Hence there's no need to use cpus_have_const_cap(), and alternative_has_cap_unlikely() is sufficient. This patch replaces the use of cpus_have_const_cap() with alternative_has_cap_unlikely(), which will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. Signed-off-by: Mark Rutland Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 7f0387cf76b1d026a5f0e0386a05c4cdac3a99af Author: Mark Rutland Date: Mon Oct 16 11:24:37 2023 +0100 arm64: Avoid cpus_have_const_cap() for ARM64_HAS_{ADDRESS,GENERIC}_AUTH In system_supports_address_auth() and system_supports_generic_auth() we use cpus_have_const_cap to check for ARM64_HAS_ADDRESS_AUTH and ARM64_HAS_GENERIC_AUTH respectively, but this is not necessary and alternative_has_cap_*() would bre preferable. For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. The ARM64_HAS_ADDRESS_AUTH cpucap is a boot cpu feature which is detected and patched early on the boot CPU before any pointer authentication keys are enabled via their respective SCTLR_ELx.EN* bits. Nothing which uses system_supports_address_auth() is called before the boot alternatives are patched. Thus it is safe for system_supports_address_auth() to use cpus_have_final_boot_cap() to check for ARM64_HAS_ADDRESS_AUTH. The ARM64_HAS_GENERIC_AUTH cpucap is a system feature which is detected on all CPUs, then finalized and patched under setup_system_capabilities(). We use system_supports_generic_auth() in a few places: * The pac_generic_keys_get() and pac_generic_keys_set() functions are only reachable from system calls once userspace is up and running. As cpucaps are finalzied long before userspace runs, these can safely use alternative_has_cap_*() or cpus_have_final_cap(). * The ptrauth_prctl_reset_keys() function is only reachable from system calls once userspace is up and running. As cpucaps are finalized long before userspace runs, this can safely use alternative_has_cap_*() or cpus_have_final_cap(). * The ptrauth_keys_install_user() function is used during context-switch. This is called prior to alternatives being applied, and so cannot use cpus_have_final_cap(), but as this only needs to switch the APGA key for userspace tasks, it's safe to use alternative_has_cap_*(). * The ptrauth_keys_init_user() function is used to initialize userspace keys, and is only reachable after system cpucaps have been finalized and patched. Thus this can safely use alternative_has_cap_*() or cpus_have_final_cap(). * The system_has_full_ptr_auth() helper function is only used by KVM code, which is only reachable after system cpucaps have been finalized and patched. Thus this can safely use alternative_has_cap_*() or cpus_have_final_cap(). This patch modifies system_supports_address_auth() to use cpus_have_final_boot_cap() to check ARM64_HAS_ADDRESS_AUTH, and modifies system_supports_generic_auth() to use alternative_has_cap_unlikely() to check ARM64_HAS_GENERIC_AUTH. In either case this will avoid generating code to test the system_cpucaps bitmap and should be better for all subsequent calls at runtime. The use of cpus_have_final_boot_cap() will make it easier to spot if code is chaanged such that these run before the relevant cpucap is guaranteed to have been finalized. Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 34f66c4c4d5518c11bfb7d10defff8f814c9f28a Author: Mark Rutland Date: Mon Oct 16 11:24:36 2023 +0100 arm64: Use a positive cpucap for FP/SIMD Currently we have a negative cpucap which describes the *absence* of FP/SIMD rather than *presence* of FP/SIMD. This largely works, but is somewhat awkward relative to other cpucaps that describe the presence of a feature, and it would be nicer to have a cpucap which describes the presence of FP/SIMD: * This will allow the cpucap to be treated as a standard ARM64_CPUCAP_SYSTEM_FEATURE, which can be detected with the standard has_cpuid_feature() function and ARM64_CPUID_FIELDS() description. * This ensures that the cpucap will only transition from not-present to present, reducing the risk of unintentional and/or unsafe usage of FP/SIMD before cpucaps are finalized. * This will allow using arm64_cpu_capabilities::cpu_enable() to enable the use of FP/SIMD later, with FP/SIMD being disabled at boot time otherwise. This will ensure that any unintentional and/or unsafe usage of FP/SIMD prior to this is trapped, and will ensure that FP/SIMD is never unintentionally enabled for userspace in mismatched big.LITTLE systems. This patch replaces the negative ARM64_HAS_NO_FPSIMD cpucap with a positive ARM64_HAS_FPSIMD cpucap, making changes as described above. Note that as FP/SIMD will now be trapped when not supported system-wide, do_fpsimd_acc() must handle these traps in the same way as for SVE and SME. The commentary in fpsimd_restore_current_state() is updated to describe the new scheme. No users of system_supports_fpsimd() need to know that FP/SIMD is available prior to alternatives being patched, so this is updated to use alternative_has_cap_likely() to check for the ARM64_HAS_FPSIMD cpucap, without generating code to test the system_cpucaps bitmap. Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 14567ba42c5747f50584eb463ac8029f2a30e0d1 Author: Mark Rutland Date: Mon Oct 16 11:24:35 2023 +0100 arm64: Rename SVE/SME cpu_enable functions The arm64_cpu_capabilities::cpu_enable() callbacks for SVE, SME, SME2, and FA64 are named with an unusual "${feature}_kernel_enable" pattern rather than the much more common "cpu_enable_${feature}". Now that we only use these as cpu_enable() callbacks, it would be nice to have them match the usual scheme. This patch renames the cpu_enable() callbacks to match this scheme. At the same time, the comment above cpu_enable_sve() is removed for consistency with the other cpu_enable() callbacks. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 907722917002ed06b8f75e119b83842d5f63b15e Author: Mark Rutland Date: Mon Oct 16 11:24:34 2023 +0100 arm64: Use build-time assertions for cpucap ordering Both sme2_kernel_enable() and fa64_kernel_enable() need to run after sme_kernel_enable(). This happens to be true today as ARM64_SME has a lower index than either ARM64_SME2 or ARM64_SME_FA64, and both functions have a comment to this effect. It would be nicer to have a build-time assertion like we for for can_use_gic_priorities() and has_gic_prio_relaxed_sync(), as that way it will be harder to miss any potential breakage. This patch replaces the comments with build-time assertions. Signed-off-by: Mark Rutland Cc: Mark Brown Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit bc9bbb78801af1bd155cda6a30ecaa720ef2bab7 Author: Mark Rutland Date: Mon Oct 16 11:24:33 2023 +0100 arm64: Explicitly save/restore CPACR when probing SVE and SME When a CPUs onlined we first probe for supported features and propetites, and then we subsequently enable features that have been detected. This is a little problematic for SVE and SME, as some properties (e.g. vector lengths) cannot be probed while they are disabled. Due to this, the code probing for SVE properties has to enable SVE for EL1 prior to proving, and the code probing for SME properties has to enable SME for EL1 prior to probing. We never disable SVE or SME for EL1 after probing. It would be a little nicer to transiently enable SVE and SME during probing, leaving them both disabled unless explicitly enabled, as this would make it much easier to catch unintentional usage (e.g. when they are not present system-wide). This patch reworks the SVE and SME feature probing code to only transiently enable support at EL1, disabling after probing is complete. Signed-off-by: Mark Rutland Cc: Suzuki K Poulose Cc: Will Deacon Reviewed-by: Mark Brown Signed-off-by: Catalin Marinas commit 1b42ff0c869a4d52a68f6a145e81a991f16c71fe Merge: 2de3561113f12 2651723668870 Author: Arnd Bergmann Date: Mon Oct 16 15:06:53 2023 +0200 Merge tag 'imx-dt64-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/dt i.MX arm64 device tree changes for 6.7 - New board support: TQ-Systems LS1043A/LS1046A and LS1088 based boards, VAR-SOM-MX6 SoM, SolidRun LX2162A SoM & Clearfog, and phyGATE-Tauri i.MX 8M Mini board. - A set of changes from Adam Ford adding audio related devices for i.MX8M SoCs, migrating sound card to simple-audio-card for imx8mm-beacon board, and adding DMIC support i.MX8M Beacon boards. - A series from Alexander Stein to add LVDS overlay support for i.MX8M based MBA8Mx boards. - A couple of changes from Cem Tenruh to add gpio-line-names for i.MX8MP based phycore boards. - A bunch of dt-schema check fixes from Fabio Estevam. - A few changes from Frank Li to add edma devices and enable UART support for i.MX93 and i.MX8 SoCs and related boards. - A series from Marek Vasut to improve various aspects of i.MX8MP based DHCOM boards support. - A series from Teresa Remmet to enable Flexcan, USB and RS232/RS485 support for imx8mp-phyboard-pollux board. - A number of changes from Tim Harvey to add imx219 overlay and TPM device support for Gateworks boards. - Other small and random changes. * tag 'imx-dt64-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (101 commits) arm64: dts: imx8mp: Drop i.MX8MP DHCOM rev.100 PHY address workaround from PDK3 DT arm64: dts: imx8mp: Update i.MX8MP DHCOM SoM DT to production rev.200 arm64: dts: imx8mp: Add UART1 and RTC wake up source on DH i.MX8M Plus DHCOM SoM arm64: dts: imx8mp: Switch WiFI enable signal to mmc-pwrseq-simple on i.MX8MP DHCOM SoM arm64: dts: imx8mp: Fix property indent on DH i.MX8M Plus DHCOM PDK3 arm64: dts: imx8mp: Describe VDD_ARM run and standby voltage for DH i.MX8M Plus DHCOM SoM arm64: dts: imx8mp: Describe VDD_ARM run and standby voltage for Data Modul i.MX8M Plus eDM SBC arm64: dts: imx8mp-beacon: Add DMIC support arm64: dts: imx8mn-beacon: Add DMIC support arm64: dts: imx8mm-beacon: Add DMIC support arm64: dts: imx8mm-beacon: Migrate sound card to simple-audio-card arm64: dts: imx8mn-evk: Remove codec clocks/clock-names arm64: dts: imx8mp-beacon: Configure 100MHz PCIe Ref Clk arm64: dts: imx8mn: Add sound-dai-cells to micfil node arm64: dts: imx8mm: Add sound-dai-cells to micfil node arm64: dts: freescale: add initial device tree for TQMLS1088A arm64: dts: freescale: add initial device tree for TQMLS1043A/TQMLS1046A arm64: dts: ls1043a: remove second dspi node arm64: dts: freescale: Add support for LX2162 SoM & Clearfog Board arm64: dts: lx2160a: describe the SerDes block #2 ... Link: https://lore.kernel.org/r/20231015132300.2268016-3-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit dc00748adcf03d754bf43035c668bc5b20fb6597 Author: Andy Yan Date: Fri Oct 13 20:20:51 2023 +0800 drm/rockchip: remove NR_LAYERS macro on vop2 There are 8 layers on rk3588, so a fix defined macro is not appropriate. Signed-off-by: Andy Yan Reviewed-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231013122051.1594164-1-andyshrk@163.com commit ac1c11c23fc51c1ba51a3ed586df40ffe6b1de35 Author: Andy Yan Date: Fri Oct 13 20:20:36 2023 +0800 drm/rockchip: remove unused struct in vop2 These structs are undefined and un used. Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver") Signed-off-by: Andy Yan Reviewed-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231013122036.1594090-1-andyshrk@163.com commit 6471da5ee311d53ef46eebcb7725bc94266cc0cf Author: Dan Carpenter Date: Wed Oct 11 11:01:48 2023 +0300 drm/rockchip: Fix type promotion bug in rockchip_gem_iommu_map() The "ret" variable is declared as ssize_t and it can hold negative error codes but the "rk_obj->base.size" variable is type size_t. This means that when we compare them, they are both type promoted to size_t and the negative error code becomes a high unsigned value and is treated as success. Add a cast to fix this. Fixes: 38f993b7c59e ("drm/rockchip: Do not use DMA mapping API if attached to IOMMU domain") Signed-off-by: Dan Carpenter Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/2bfa28b5-145d-4b9e-a18a-98819dd686ce@moroto.mountain commit 2de3561113f12337d778dae0425e577b25b7db37 Merge: 6a4347fd674fa 46da7fda11ae0 Author: Arnd Bergmann Date: Mon Oct 16 15:04:57 2023 +0200 Merge tag 'imx-dt-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/dt i.MX ARM device tree changes for 6.7: - New board support: Variscite VAR-SOM-MX6 SoM and Custom board. - A bunch of dt-schema check fixes from Fabio Estevam. - A couple of MBA6ULX changes from Alexander Stein that marks gpio-buttons as wakeup-source and improves gpio-keys button node names. - Add ATM0700D4 panel support for sk-imx53 board. - Correct regulator node name for imx6qdl-nitrogen6 board. - A couple of Gateworks i.MX6QDL board update: adding MDIO nodes and populating Ethernet MAC address. * tag 'imx-dt-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (31 commits) ARM: dts: imx7d-pico-pi: Disable USDHC1 ARM: dts: imx28: Fix dcp compatible ARM: dts: imx7s: Remove #power-domain-cells from gpcv2 ARM: dts: imx25: Remove clock-names from the watchdog ARM: dts: imx25: Fix sram node ARM: dts: imx25: Fix dryice node ARM: dts: imx6qdl-gw5904: add dt props for populating eth MAC addrs ARM: dts: vfxxx: Write dmas in a single line ARM: dts: imx27-phytec: Use eeprom as the node name ARM: dts: imx51: Remove invalid sahara compatible ARM: dts: imx53: Adjust the ecspi compatible ARM: dts: imx7ulp: Fix usbphy1 compatible ARM: dts: imx6q-pistachio: Use a valid value for fsl,tx-d-cal ARM: dts: imx6q-b650v3: Fix fsl,tx-cal-45-dn-ohms ARM: dts: imx28-tx28: Move phy_type to USB node ARM: dts: mxs: Switch to #pwm-cells = <3> ARM: dts: imx6q: Add Variscite MX6 Custom board support ARM: dts: imx6qdl: Add Variscite VAR-SOM-MX6 SoM support ARM: dts: mxs: Fix duart clock-names ARM: dts: imx6ull/7d-colibri: Fix compatible ... Link: https://lore.kernel.org/r/20231015132300.2268016-2-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 495a91d0998367f4f079593f491bdfe8ef06838e Author: Yazen Ghannam Date: Tue Jun 13 09:11:40 2023 -0500 x86/MCE/AMD: Split amd_mce_is_memory_error() Define helper functions for legacy and SMCA systems in order to reuse individual checks in later changes. Describe what each function is checking for, and correct the XEC bitmask for SMCA. No functional change intended. [ bp: Use "else in amd_mce_is_memory_error() to make the conditional balanced, for readability. ] Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Shuai Xue Link: https://lore.kernel.org/r/20230613141142.36801-2-yazen.ghannam@amd.com commit 70fea30195168fd84e7076720c984f0ac1af5b09 Author: Nico Boehr Date: Mon Oct 9 11:32:53 2023 +0200 KVM: s390: add tracepoint in gmap notifier The gmap notifier is called for changes in table entries with the notifier bit set. To diagnose performance issues, it can be useful to see what causes certain changes in the gmap. Hence, add a tracepoint in the gmap notifier. Signed-off-by: Nico Boehr Acked-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Acked-by: Janosch Frank Signed-off-by: Janosch Frank Link: https://lore.kernel.org/r/20231009093304.2555344-3-nrb@linux.ibm.com Message-Id: <20231009093304.2555344-3-nrb@linux.ibm.com> commit c3235e2dd6956448a562d6b1112205eeebc8ab43 Author: Nico Boehr Date: Mon Oct 9 11:32:52 2023 +0200 KVM: s390: add stat counter for shadow gmap events The shadow gmap tracks memory of nested guests (guest-3). In certain scenarios, the shadow gmap needs to be rebuilt, which is a costly operation since it involves a SIE exit into guest-1 for every entry in the respective shadow level. Add kvm stat counters when new shadow structures are created at various levels. Also add a counter gmap_shadow_create when a completely fresh shadow gmap is created as well as a counter gmap_shadow_reuse when an existing gmap is being reused. Note that when several levels are shadowed at once, counters on all affected levels will be increased. Also note that not all page table levels need to be present and a ASCE can directly point to e.g. a segment table. In this case, a new segment table will always be equivalent to a new shadow gmap and hence will be counted as gmap_shadow_create and not as gmap_shadow_segment. Signed-off-by: Nico Boehr Reviewed-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Reviewed-by: Janosch Frank Signed-off-by: Janosch Frank Link: https://lore.kernel.org/r/20231009093304.2555344-2-nrb@linux.ibm.com Message-Id: <20231009093304.2555344-2-nrb@linux.ibm.com> commit 03191fb3db3d2585725bcffe0356d12fcfd27c4c Author: Geert Uytterhoeven Date: Wed Oct 11 09:16:33 2023 +0200 m68k: lib: Include for __muldi3() When building with W=1: arch/m68k/lib/muldi3.c:82:1: warning: no previous prototype for ‘__muldi3’ [-Wmissing-prototypes] 82 | __muldi3 (DItype u, DItype v) | ^~~~~~~~ Fix this by including . Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/160c1fd14b4798f576d9649334b1d2c77db5cb07.1697008341.git.geert@linux-m68k.org commit 9faf1f1a55ee9363e3b7c5d9bba546c8d2c7fccc Author: Geert Uytterhoeven Date: Fri Oct 6 16:41:14 2023 +0200 m68k: fpsp040: Fix indentation by 5 spaces Indentation should use TABs, not spaces. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/5ab108be356a5d2a6e6d72bc418ccf1c1938e8fe.1696602993.git.geert@linux-m68k.org commit 0a29dfea0e9769fc996c85a259c1b14e7c2e19b4 Author: Geert Uytterhoeven Date: Fri Oct 6 16:41:13 2023 +0200 m68k: Fix indentation by 2 or 5 spaces in Indentation should use TABs, not spaces. Fix whitespace in reindented code while at it. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/2819709eee2be69c93497d4e97413bd0e05a9268.1696602993.git.geert@linux-m68k.org commit ab579eaec22757b6cd83379964451ac77a89c256 Author: Geert Uytterhoeven Date: Fri Oct 6 16:41:12 2023 +0200 m68k: kernel: Fix indentation by 7 spaces in traps.c Indentation should use TABs, not spaces. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/d1b38c9d389c1135f7856cf5f90852c2f1584c50.1696602993.git.geert@linux-m68k.org commit 50802d84cb030e94f85082166ab9dead4d8b5258 Author: Geert Uytterhoeven Date: Fri Oct 6 16:41:11 2023 +0200 m68k: sun3: Fix indentation by 5 or 7 spaces Indentation should use TABs, not spaces. Fix whitespace in reindented code while at it. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/167216dfe9795056b7a69415695772887aca6d80.1696602993.git.geert@linux-m68k.org commit 88514531230010f0f4802bc133ef8c6f98488ed4 Author: Geert Uytterhoeven Date: Fri Oct 6 16:41:10 2023 +0200 m68k: Fix indentation by 7 spaces in Indentation should use TABs, not spaces. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/41ca6ab21459164a52f5f468c32ef09aee7ba3d3.1696602993.git.geert@linux-m68k.org commit 6a4347fd674fa7a54465a79a3a6aeee2233dc2b3 Merge: e084a305aa7f4 3a9dd87084faa Author: Arnd Bergmann Date: Mon Oct 16 14:22:46 2023 +0200 Merge tag 'imx-bindings-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into soc/dt i.MX dt-bindings for 6.7: - Compatibles for new boards: TQ-Systems LS1043A/LS1046A and LS1088 based boards, VAR-SOM-MX6 SoM, SolidRun LX2162A SoM & Clearfog, and phyGATE-Tauri-L board. - Add missing i.MX23 based board compatibles. * tag 'imx-bindings-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: dt-bindings: arm: fsl: Add TQ-Systems LS1088 based boards dt-bindings: arm: fsl: Add TQ-Systems LS1043A/LS1046A based boards dt-bindings: arm: Add SolidRun LX2162A SoM & Clearfog Board dt-bindings: arm: fsl: add phyGATE-Tauri-L board dt-bindings: arm: fsl: Document the missing imx23 boards dt-bindings: arm: fsl: Add VAR-SOM-MX6 SoM with Custom Board Link: https://lore.kernel.org/r/20231015132300.2268016-1-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit d8569fba13850bbf46a172fcee63df2130cf4ecc Author: Mark Rutland Date: Mon Oct 16 11:24:32 2023 +0100 arm64: kvm: Use cpus_have_final_cap() explicitly Much of the arm64 KVM code uses cpus_have_const_cap() to check for cpucaps, but this is unnecessary and it would be preferable to use cpus_have_final_cap(). For historical reasons, cpus_have_const_cap() is more complicated than it needs to be. Before cpucaps are finalized, it will perform a bitmap test of the system_cpucaps bitmap, and once cpucaps are finalized it will use an alternative branch. This used to be necessary to handle some race conditions in the window between cpucap detection and the subsequent patching of alternatives and static branches, where different branches could be out-of-sync with one another (or w.r.t. alternative sequences). Now that we use alternative branches instead of static branches, these are all patched atomically w.r.t. one another, and there are only a handful of cases that need special care in the window between cpucap detection and alternative patching. Due to the above, it would be nice to remove cpus_have_const_cap(), and migrate callers over to alternative_has_cap_*(), cpus_have_final_cap(), or cpus_have_cap() depending on when their requirements. This will remove redundant instructions and improve code generation, and will make it easier to determine how each callsite will behave before, during, and after alternative patching. KVM is initialized after cpucaps have been finalized and alternatives have been patched. Since commit: d86de40decaa14e6 ("arm64: cpufeature: upgrade hyp caps to final") ... use of cpus_have_const_cap() in hyp code is automatically converted to use cpus_have_final_cap(): | static __always_inline bool cpus_have_const_cap(int num) | { | if (is_hyp_code()) | return cpus_have_final_cap(num); | else if (system_capabilities_finalized()) | return __cpus_have_const_cap(num); | else | return cpus_have_cap(num); | } Thus, converting hyp code to use cpus_have_final_cap() directly will not result in any functional change. Non-hyp KVM code is also not executed until cpucaps have been finalized, and it would be preferable to extent the same treatment to this code and use cpus_have_final_cap() directly. This patch converts instances of cpus_have_const_cap() in KVM-only code over to cpus_have_final_cap(). As all of this code runs after cpucaps have been finalized, there should be no functional change as a result of this patch, but the redundant instructions generated by cpus_have_const_cap() will be removed from the non-hyp KVM code. Signed-off-by: Mark Rutland Reviewed-by: Marc Zyngier Cc: Oliver Upton Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 42c5a3b04bf672292b2da7b51745728609a29691 Author: Mark Rutland Date: Mon Oct 16 11:24:31 2023 +0100 arm64: Split kpti_install_ng_mappings() The arm64_cpu_capabilities::cpu_enable callbacks are intended for cpu-local feature enablement (e.g. poking system registers). These get called for each online CPU when boot/system cpucaps get finalized and enabled, and get called whenever a CPU is subsequently onlined. For KPTI with the ARM64_UNMAP_KERNEL_AT_EL0 cpucap, we use the kpti_install_ng_mappings() function as the cpu_enable callback. This does a mixture of cpu-local configuration (setting VBAR_EL1 to the appropriate trampoline vectors) and some global configuration (rewriting the swapper page tables to sue non-glboal mappings) that must happen at most once. This patch splits kpti_install_ng_mappings() into a cpu-local cpu_enable_kpti() initialization function and a system-wide kpti_install_ng_mappings() function. The cpu_enable_kpti() function is responsible for selecting the necessary cpu-local vectors each time a CPU is onlined, and the kpti_install_ng_mappings() function performs the one-time rewrite of the translation tables too use non-global mappings. Splitting the two makes the code a bit easier to follow and also allows the page table rewriting code to be marked as __init such that it can be freed after use. Signed-off-by: Mark Rutland Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 7f632d331d4706cdbfcaa217b98e1df9b5b5719b Author: Mark Rutland Date: Mon Oct 16 11:24:30 2023 +0100 arm64: Fixup user features at boot time For ARM64_WORKAROUND_2658417, we use a cpu_enable() callback to hide the ID_AA64ISAR1_EL1.BF16 ID register field. This is a little awkward as CPUs may attempt to apply the workaround concurrently, requiring that we protect the bulk of the callback with a raw_spinlock, and requiring some pointless work every time a CPU is subsequently hotplugged in. This patch makes this a little simpler by handling the masking once at boot time. A new user_feature_fixup() function is called at the start of setup_user_features() to mask the feature, matching the style of elf_hwcap_fixup(). The ARM64_WORKAROUND_2658417 cpucap is added to cpucap_is_possible() so that code can be elided entirely when this is not possible. Note that the ARM64_WORKAROUND_2658417 capability is matched with ERRATA_MIDR_RANGE(), which implicitly gives the capability a ARM64_CPUCAP_LOCAL_CPU_ERRATUM type, which forbids the late onlining of a CPU with the erratum if the erratum was not present at boot time. Therefore this patch doesn't change the behaviour for late onlining. Signed-off-by: Mark Rutland Cc: James Morse Cc: Mark Brown Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 075f48c924be9e34816bb808eb66ba9105e75e5b Author: Mark Rutland Date: Mon Oct 16 11:24:29 2023 +0100 arm64: Rework setup_cpu_features() Currently setup_cpu_features() handles a mixture of one-time kernel feature setup (e.g. cpucaps) and one-time user feature setup (e.g. ELF hwcaps). Subsequent patches will rework other one-time setup and expand the logic currently in setup_cpu_features(), and in preparation for this it would be helpful to split the kernel and user setup into separate functions. This patch splits setup_user_features() out of setup_cpu_features(), with a few additional cleanups of note: * setup_cpu_features() is renamed to setup_system_features() to make it clear that it handles system-wide feature setup rather than cpu-local feature setup. * setup_system_capabilities() is folded into setup_system_features(). * Presence of TTBR0 pan is logged immediately after update_cpu_capabilities(), so that this is guaranteed to appear alongside all the other detected system cpucaps. * The 'cwg' variable is removed as its value is only consumed once and it's simpler to use cache_type_cwg() directly without assigning its return value to a variable. * The call to setup_user_features() is moved after alternatives are patched, which will allow user feature setup code to depend on alternative branches and allow for simplifications in subsequent patches. Signed-off-by: Mark Rutland Reviewed-by: Suzuki K Poulose Cc: Marc Zyngier Cc: Mark Brown Cc: Will Deacon Signed-off-by: Catalin Marinas commit 7bf46aa1c9cbd85e173a9ab8cbf6d7092c388947 Author: Mark Rutland Date: Mon Oct 16 11:24:28 2023 +0100 arm64: Add cpus_have_final_boot_cap() The cpus_have_final_cap() function can be used to test a cpucap while also verifying that we do not consume the cpucap until system capabilities have been finalized. It would be helpful if we could do likewise for boot cpucaps. This patch adds a new cpus_have_final_boot_cap() helper which can be used to test a cpucap while also verifying that boot capabilities have been finalized. Users will be added in subsequent patches. Signed-off-by: Mark Rutland Cc: Mark Brown Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit de66cb37ab6488d78d4b415504ad1fcd0910bae5 Author: Mark Rutland Date: Mon Oct 16 11:24:27 2023 +0100 arm64: Add cpucap_is_possible() Many cpucaps can only be set when certain CONFIG_* options are selected, and we need to check the CONFIG_* option before the cap in order to avoid generating redundant code. Due to this, we have a growing number of helpers in of the form: | static __always_inline bool system_supports_foo(void) | { | return IS_ENABLED(CONFIG_ARM64_FOO) && | cpus_have_const_cap(ARM64_HAS_FOO); | } This is unfortunate as it forces us to use cpus_have_const_cap() unnecessarily, resulting in redundant code being generated by the compiler. In the vast majority of cases, we only require that feature checks indicate the presence of a feature after cpucaps have been finalized, and so it would be sufficient to use alternative_has_cap_*(). However some code needs to handle a feature before alternatives have been patched, and must test the system_cpucaps bitmap via cpus_have_const_cap(). In other cases we'd like to check for unintentional usage of a cpucap before alternatives are patched, and so it would be preferable to use cpus_have_final_cap(). Placing the IS_ENABLED() checks in each callsite is tedious and error-prone, and the same applies for writing wrappers for each comination of cpucap and alternative_has_cap_*() / cpus_have_cap() / cpus_have_final_cap(). It would be nicer if we could centralize the knowledge of which cpucaps are possible, and have alternative_has_cap_*(), cpus_have_cap(), and cpus_have_final_cap() handle this automatically. This patch adds a new cpucap_is_possible() function which will be responsible for checking the CONFIG_* option, and updates the low-level cpucap checks to use this. The existing CONFIG_* checks in are moved over to cpucap_is_possible(), but the (now trival) wrapper functions are retained for now. There should be no functional change as a result of this patch alone. Signed-off-by: Mark Rutland Cc: Marc Zyngier Cc: Mark Brown Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 484de08518e43aa14f0d5719a99b19625ac12228 Author: Mark Rutland Date: Mon Oct 16 11:24:26 2023 +0100 arm64: Factor out cpucap definitions For clarity it would be nice to factor cpucap manipulation out of , and the obvious place would be , but this will clash somewhat with . Rename to , matching what we do for , and introduce a new which includes the generated header. Subsequent patches will fill out . There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Marc Zyngier Cc: Mark Brown Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 20f3b8eafe0ba5d3c69d5011a9b07739e9645132 Author: Mark Rutland Date: Mon Oct 16 11:24:25 2023 +0100 arm64/arm: xen: enlighten: Fix KPTI checks When KPTI is in use, we cannot register a runstate region as XEN requires that this is always a valid VA, which we cannot guarantee. Due to this, xen_starting_cpu() must avoid registering each CPU's runstate region, and xen_guest_init() must avoid setting up features that depend upon it. We tried to ensure that in commit: f88af7229f6f22ce (" xen/arm: do not setup the runstate info page if kpti is enabled") ... where we added checks for xen_kernel_unmapped_at_usr(), which wraps arm64_kernel_unmapped_at_el0() on arm64 and is always false on 32-bit arm. Unfortunately, as xen_guest_init() is an early_initcall, this happens before secondary CPUs are booted and arm64 has finalized the ARM64_UNMAP_KERNEL_AT_EL0 cpucap which backs arm64_kernel_unmapped_at_el0(), and so this can subsequently be set as secondary CPUs are onlined. On a big.LITTLE system where the boot CPU does not require KPTI but some secondary CPUs do, this will result in xen_guest_init() intializing features that depend on the runstate region, and xen_starting_cpu() registering the runstate region on some CPUs before KPTI is subsequent enabled, resulting the the problems the aforementioned commit tried to avoid. Handle this more robsutly by deferring the initialization of the runstate region until secondary CPUs have been initialized and the ARM64_UNMAP_KERNEL_AT_EL0 cpucap has been finalized. The per-cpu work is moved into a new hotplug starting function which is registered later when we're certain that KPTI will not be used. Fixes: f88af7229f6f ("xen/arm: do not setup the runstate info page if kpti is enabled") Signed-off-by: Mark Rutland Cc: Bertrand Marquis Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 166b76a073be8e1ffdc2c4db60f3abbbc974a3a3 Author: Mark Rutland Date: Mon Oct 16 11:24:24 2023 +0100 clocksource/drivers/arm_arch_timer: Initialize evtstrm after finalizing cpucaps We attempt to initialize each CPU's arch_timer event stream in arch_timer_evtstrm_enable(), which we call from the arch_timer_starting_cpu() cpu hotplug callback which is registered early in boot. As this is registered before we initialize the system cpucaps, the test for ARM64_HAS_ECV will always be false for CPUs present at boot time, and will only be taken into account for CPUs onlined late (including those which are hotplugged out and in again). Due to this, CPUs present and boot time may not use the intended divider and scale factor to generate the event stream, and may differ from other CPUs. Correct this by only initializing the event stream after cpucaps have been finalized, registering a separate CPU hotplug callback for the event stream configuration. Since the caps must be finalized by this point, use cpus_have_final_cap() to verify this. Signed-off-by: Mark Rutland Acked-by: Marc Zyngier Acked-by: Thomas Gleixner Cc: Daniel Lezcano Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Catalin Marinas commit 4f88c72b2479cca4a0d4de89b4cbb6f1b37ee96d Author: Gustavo A. R. Silva Date: Mon Oct 9 15:24:23 2023 -0600 ASoC: sigmadsp: Add __counted_by for struct sigmadsp_data and use struct_size() Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). While there, use struct_size() and size_sub() helpers, instead of the open-coded version, to calculate the size for the allocation of the whole flexible structure, including of course, the flexible-array member. This code was found with the help of Coccinelle, and audited and fixed manually. Signed-off-by: "Gustavo A. R. Silva" Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/ZSRvh1j2MVVhuOUv@work Signed-off-by: Mark Brown commit c3aa5cb264a38ae9bbcce32abca4c155af0456df Author: Han Xu Date: Tue Oct 10 15:15:24 2023 -0500 spi: nxp-fspi: use the correct ioremap function AHB memory as MMIO should be mapped with ioremap rather than ioremap_wc, which should have been used initially just to handle unaligned access as a workaround. Fixes: d166a73503ef ("spi: fspi: dynamically alloc AHB memory") Signed-off-by: Han Xu Link: https://lore.kernel.org/r/20231010201524.2021340-1-han.xu@nxp.com Signed-off-by: Mark Brown commit 99c9991f4e5d77328187187d0c921a3b62bfa998 Merge: 0e10fd4b7a6dd 1a8a315f008a5 Author: Daniel Borkmann Date: Mon Oct 16 13:49:18 2023 +0200 Merge branch 'bpf-log-improvements' Andrii Nakryiko says: ==================== This patch set fixes ambiguity in BPF verifier log output of SCALAR register in the parts that emit umin/umax, smin/smax, etc ranges. See patch #4 for details. Also, patch #5 fixes an issue with verifier log missing instruction context (state) output for conditionals that trigger precision marking. See details in the patch. First two patches are just improvements to two selftests that are very flaky locally when run in parallel mode. Patch #3 changes 'align' selftest to be less strict about exact verifier log output (which patch #4 changes, breaking lots of align tests as written). Now test does more of a register substate checks, mostly around expected var_off() values. This 'align' selftests is one of the more brittle ones and requires constant adjustment when verifier log output changes, without really catching any new issues. So hopefully these changes can minimize future support efforts for this specific set of tests. ==================== Signed-off-by: Daniel Borkmann commit 1a8a315f008a58f54fecb012b928aa6a494435b3 Author: Andrii Nakryiko Date: Wed Oct 11 15:37:28 2023 -0700 bpf: Ensure proper register state printing for cond jumps Verifier emits relevant register state involved in any given instruction next to it after `;` to the right, if possible. Or, worst case, on the separate line repeating instruction index. E.g., a nice and simple case would be: 2: (d5) if r0 s<= 0x0 goto pc+1 ; R0_w=0 But if there is some intervening extra output (e.g., precision backtracking log) involved, we are supposed to see the state after the precision backtrack log: 4: (75) if r0 s>= 0x0 goto pc+1 mark_precise: frame0: last_idx 4 first_idx 0 subseq_idx -1 mark_precise: frame0: regs=r0 stack= before 2: (d5) if r0 s<= 0x0 goto pc+1 mark_precise: frame0: regs=r0 stack= before 1: (b7) r0 = 0 6: R0_w=0 First off, note that in `6: R0_w=0` instruction index corresponds to the next instruction, not to the conditional jump instruction itself, which is wrong and we'll get to that. But besides that, the above is a happy case that does work today. Yet, if it so happens that precision backtracking had to traverse some of the parent states, this `6: R0_w=0` state output would be missing. This is due to a quirk of print_verifier_state() routine, which performs mark_verifier_state_clean(env) at the end. This marks all registers as "non-scratched", which means that subsequent logic to print *relevant* registers (that is, "scratched ones") fails and doesn't see anything relevant to print and skips the output altogether. print_verifier_state() is used both to print instruction context, but also to print an **entire** verifier state indiscriminately, e.g., during precision backtracking (and in a few other situations, like during entering or exiting subprogram). Which means if we have to print entire parent state before getting to printing instruction context state, instruction context is marked as clean and is omitted. Long story short, this is definitely not intentional. So we fix this behavior in this patch by teaching print_verifier_state() to clear scratch state only if it was used to print instruction state, not the parent/callback state. This is determined by print_all option, so if it's not set, we don't clear scratch state. This fixes missing instruction state for these cases. As for the mismatched instruction index, we fix that by making sure we call print_insn_state() early inside check_cond_jmp_op() before we adjusted insn_idx based on jump branch taken logic. And with that we get desired correct information: 9: (16) if w4 == 0x1 goto pc+9 mark_precise: frame0: last_idx 9 first_idx 9 subseq_idx -1 mark_precise: frame0: parent state regs=r4 stack=: R2_w=1944 R4_rw=P1 R10=fp0 mark_precise: frame0: last_idx 8 first_idx 0 subseq_idx 9 mark_precise: frame0: regs=r4 stack= before 8: (66) if w4 s> 0x3 goto pc+5 mark_precise: frame0: regs=r4 stack= before 7: (b7) r4 = 1 9: R4=1 Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Eduard Zingerman Link: https://lore.kernel.org/bpf/20231011223728.3188086-6-andrii@kernel.org commit 72f8a1de4a7ecb23393a920dface58d5a96f42d8 Author: Andrii Nakryiko Date: Wed Oct 11 15:37:27 2023 -0700 bpf: Disambiguate SCALAR register state output in verifier logs Currently the way that verifier prints SCALAR_VALUE register state (and PTR_TO_PACKET, which can have var_off and ranges info as well) is very ambiguous. In the name of brevity we are trying to eliminate "unnecessary" output of umin/umax, smin/smax, u32_min/u32_max, and s32_min/s32_max values, if possible. Current rules are that if any of those have their default value (which for mins is the minimal value of its respective types: 0, S32_MIN, or S64_MIN, while for maxs it's U32_MAX, S32_MAX, S64_MAX, or U64_MAX) *OR* if there is another min/max value that as matching value. E.g., if smin=100 and umin=100, we'll emit only umin=10, omitting smin altogether. This approach has a few problems, being both ambiguous and sort-of incorrect in some cases. Ambiguity is due to missing value could be either default value or value of umin/umax or smin/smax. This is especially confusing when we mix signed and unsigned ranges. Quite often, umin=0 and smin=0, and so we'll have only `umin=0` leaving anyone reading verifier log to guess whether smin is actually 0 or it's actually -9223372036854775808 (S64_MIN). And often times it's important to know, especially when debugging tricky issues. "Sort-of incorrectness" comes from mixing negative and positive values. E.g., if umin is some large positive number, it can be equal to smin which is, interpreted as signed value, is actually some negative value. Currently, that smin will be omitted and only umin will be emitted with a large positive value, giving an impression that smin is also positive. Anyway, ambiguity is the biggest issue making it impossible to have an exact understanding of register state, preventing any sort of automated testing of verifier state based on verifier log. This patch is attempting to rectify the situation by removing ambiguity, while minimizing the verboseness of register state output. The rules are straightforward: - if some of the values are missing, then it definitely has a default value. I.e., `umin=0` means that umin is zero, but smin is actually S64_MIN; - all the various boundaries that happen to have the same value are emitted in one equality separated sequence. E.g., if umin and smin are both 100, we'll emit `smin=umin=100`, making this explicit; - we do not mix negative and positive values together, and even if they happen to have the same bit-level value, they will be emitted separately with proper sign. I.e., if both umax and smax happen to be 0xffffffffffffffff, we'll emit them both separately as `smax=-1,umax=18446744073709551615`; - in the name of a bit more uniformity and consistency, {u32,s32}_{min,max} are renamed to {s,u}{min,max}32, which seems to improve readability. The above means that in case of all 4 ranges being, say, [50, 100] range, we'd previously see hugely ambiguous: R1=scalar(umin=50,umax=100) Now, we'll be more explicit: R1=scalar(smin=umin=smin32=umin32=50,smax=umax=smax32=umax32=100) This is slightly more verbose, but distinct from the case when we don't know anything about signed boundaries and 32-bit boundaries, which under new rules will match the old case: R1=scalar(umin=50,umax=100) Also, in the name of simplicity of implementation and consistency, order for {s,u}32_{min,max} are emitted *before* var_off. Previously they were emitted afterwards, for unclear reasons. This patch also includes a few fixes to selftests that expect exact register state to accommodate slight changes to verifier format. You can see that the changes are pretty minimal in common cases. Note, the special case when SCALAR_VALUE register is a known constant isn't changed, we'll emit constant value once, interpreted as signed value. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Eduard Zingerman Link: https://lore.kernel.org/bpf/20231011223728.3188086-5-andrii@kernel.org commit cde785142885e1fc62a9ae92e7aae90285ed3d79 Author: Andrii Nakryiko Date: Wed Oct 11 15:37:26 2023 -0700 selftests/bpf: Make align selftests more robust Align subtest is very specific and finicky about expected verifier log output and format. This is often completely unnecessary as in a bunch of situations test actually cares about var_off part of register state. But given how exact it is right now, any tiny verifier log changes can lead to align tests failures, requiring constant adjustment. This patch tries to make this a bit more robust by making logic first search for specified register and then allowing to match only portion of register state, not everything exactly. This will come handly with follow up changes to SCALAR register output disambiguation. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Eduard Zingerman Link: https://lore.kernel.org/bpf/20231011223728.3188086-4-andrii@kernel.org commit 08a7078feacf419305d86d36b974c48347f3abb0 Author: Andrii Nakryiko Date: Wed Oct 11 15:37:25 2023 -0700 selftests/bpf: Improve missed_kprobe_recursion test robustness Given missed_kprobe_recursion is non-serial and uses common testing kfuncs to count number of recursion misses it's possible that some other parallel test can trigger extraneous recursion misses. So we can't expect exactly 1 miss. Relax conditions and expect at least one. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Jiri Olsa Acked-by: John Fastabend Acked-by: Eduard Zingerman Link: https://lore.kernel.org/bpf/20231011223728.3188086-3-andrii@kernel.org commit 2d78928c9cf7bee08c3e2344e6e1755412855448 Author: Andrii Nakryiko Date: Wed Oct 11 15:37:24 2023 -0700 selftests/bpf: Improve percpu_alloc test robustness Make these non-serial tests filter BPF programs by intended PID of a test runner process. This makes it isolated from other parallel tests that might interfere accidentally. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Eduard Zingerman Link: https://lore.kernel.org/bpf/20231011223728.3188086-2-andrii@kernel.org commit 7b3d8df549390e797f883efa16224fa0dfe35e55 Author: Fan Yu Date: Mon Oct 16 19:20:39 2023 +0800 sched/psi: Update poll => rtpoll in relevant comments The PSI trigger code is now making a distinction between privileged and unprivileged triggers, after the following commit: 65457b74aa94 ("sched/psi: Rename existing poll members in preparation") But some comments have not been modified along with the code, so they need to be updated. This will help readers better understand the code. Signed-off-by: Fan Yu Signed-off-by: Ingo Molnar Cc: Johannes Weiner Cc: Suren Baghdasaryan Cc: Peter Ziljstra Link: https://lore.kernel.org/r/202310161920399921184@zte.com.cn commit 7f6874eddd81cb2ed784642a7a4321671e158ffe Author: Hou Wenlong Date: Wed Jul 12 11:30:06 2023 +0800 x86/head/64: Add missing __head annotation to startup_64_load_idt() This function is currently only used in the head code and is only called from startup_64_setup_env(). Although it would be inlined by the compiler, it would be better to mark it as __head too in case it doesn't. Signed-off-by: Hou Wenlong Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/efcc5b5e18af880e415d884e072bf651c1fa7c34.1689130310.git.houwenlong.hwl@antgroup.com commit dc6283009016acd5a8c6a6c073506d82bbc55529 Author: Hou Wenlong Date: Wed Jul 12 11:30:05 2023 +0800 x86/head/64: Mark 'startup_gdt[]' and 'startup_gdt_descr' as __initdata As 'startup_gdt[]' and 'startup_gdt_descr' are only used in booting, mark them as __initdata to allow them to be freed after boot. Signed-off-by: Hou Wenlong Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/c85903a7cfad37d14a7e5a4df9fc7119a3669fb3.1689130310.git.houwenlong.hwl@antgroup.com commit dcc134510eefaec6dda4fe71ab824f0300ed9f9f Author: Peter Zijlstra Date: Mon Oct 16 13:12:54 2023 +0200 alpha: Fix up new futex syscall numbers As per Arnd, Alpha syscalls since time64 are offset by 120, retain this offset. Fixes: 9f6c532f59b2 ("futex: Add sys_futex_wake()") Reported-by: Arnd Bergmann Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/cb4bb8e2-7dfe-4ca4-aa70-060f7b2f8f95@app.fastmail.com commit 4ea2b6d3128ea4d502c4015df0dc16b7d1070954 Author: Pierre-Louis Bossart Date: Fri Oct 13 09:08:33 2023 +0800 soundwire: dmi-quirks: update HP Omen match New platforms have a slightly different DMI product name, remove trailing characters/digits to handle all cases Closes: https://github.com/thesofproject/linux/issues/4611 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20231013010833.114271-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit ff435da4cc8b6137be9f0b6b4a9af095590d4b8c Author: Pierre-Louis Bossart Date: Fri Oct 13 09:08:12 2023 +0800 soundwire: bus: improve error handling for clock stop prepare/deprepare The same logic is used for clock stop prepare and deprepare, and having different logs for the two steps helps identify problems. In addition, when the "NotFinished" bit remains set, the error handling is not quite right: a) for the clock stop prepare, the error is handled at the caller level, and the error is ignored: there's no good reason to prevent the pm_runtime suspend from happening. Throwing an error that is later ignored is confusing. b) for the clock stop deprepare, the error is ignored in bus.c and a dev_warn() log shown. Throwing an error is also alarming users for no good reason. For both cases, demoting the error to dev_dbg() makes more sense. Link: https://github.com/thesofproject/linux/issues/4619 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Richard Fitzgerald Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20231013010812.114216-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul commit 03f25d53b145bc2f7ccc82fc04e4482ed734f524 Author: Alain Volmat Date: Mon Oct 9 10:24:50 2023 +0200 dmaengine: stm32-mdma: correct desc prep when channel running In case of the prep descriptor while the channel is already running, the CCR register value stored into the channel could already have its EN bit set. This would lead to a bad transfer since, at start transfer time, enabling the channel while other registers aren't yet properly set. To avoid this, ensure to mask the CCR_EN bit when storing the ccr value into the mdma channel structure. Fixes: a4ffb13c8946 ("dmaengine: Add STM32 MDMA driver") Signed-off-by: Alain Volmat Signed-off-by: Amelie Delaunay Cc: stable@vger.kernel.org Tested-by: Alain Volmat Link: https://lore.kernel.org/r/20231009082450.452877-1-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit 495e18b16e3dd8218eaec6a8a55334fb55245d59 Author: Sergey Khimich Date: Tue Oct 10 13:14:50 2023 +0300 dmaengine: dw-axi-dmac: Add support DMAX_NUM_CHANNELS > 16 Added support for DMA controller with more than 16 channels. Signed-off-by: Sergey Khimich Link: https://lore.kernel.org/r/20231010101450.2949126-2-serghox@gmail.com Signed-off-by: Vinod Koul commit 19ba9ead8a88ab02f3b00d5a6cab7853f03445e7 Author: Vasily Gorbik Date: Thu Oct 12 11:39:29 2023 +0200 s390/vmem: remove unused variable Fix the follow warning reported by sparse: arch/s390/boot/vmem.c:170:15: warning: unused variable ‘entry’ [-Wunused-variable] 170 | pte_t entry; | ^~~~~ Reviewed-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 802ba53eefc592a6a82231f74e19bafe3256f172 Author: Heiko Carstens Date: Fri Oct 6 15:42:42 2023 +0200 s390: add support for DCACHE_WORD_ACCESS Implement load_unaligned_zeropad() and enable DCACHE_WORD_ACCESS to speed up string operations in fs/dcache.c and fs/namei.c. Reviewed-by: Sven Schnelle Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 76292d7243f809486ec26dd6cd3436dbcb9e5319 Author: Heiko Carstens Date: Fri Oct 6 15:42:41 2023 +0200 s390: provide word-at-a-time implementation Provide an s390 specific word-at-a-time implementation. Compared to the generic variant the generated code for has_zero() is slightly better. However find_zero() is much simpler since it reuses the result of __fls() aka flogr() and now comes without any conditional branches, while the generic variant has three of them. Reviewed-by: Sven Schnelle Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 88b2c332fcecbcf71a5d69a214a8805cf916fbf8 Author: Heiko Carstens Date: Fri Oct 6 15:42:40 2023 +0200 s390/extable: reduce number of extable macros Get rid of __EX_TABLE() macro, rename __EX_TABLE_UA() to __EX_TABLE() and convert users of old __EX_TABLE() macro so they pass more parameters to the changed __EX_TABLE() semantics. Reviewed-by: Sven Schnelle Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit ecfe7f53286748bca0ef1646a45f428b915b0916 Author: Alexander Gordeev Date: Sun Oct 1 10:01:31 2023 +0200 s390/crash: fix virtual vs physical address confusion Fix virtual vs physical address confusion (which currently are the same). Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 4ff1261354d33caf7b2aa1f47db00deef27863ad Author: Alexander Gordeev Date: Sun Oct 1 10:09:34 2023 +0200 s390/crash: remove unused parameter Funciton loads_init() does not use loads_offset parameter. Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 8d6be876bbd7c09190b025ccc478260f5a40c216 Author: Harald Freudenberger Date: Tue Sep 12 09:02:07 2023 +0200 s390/ap: show APFS value on error reply 0x8B With Secure Execution the error reply RX 0x8B now carries an APFS value indicating why the request has been filtered by a lower layer of the firmware. So display this value as a warning line in the s390 debug feature trace. Signed-off-by: Harald Freudenberger Reviewed-by: Holger Dengler Signed-off-by: Vasily Gorbik commit a19a161482b1739c2207861d086403389dc1bd47 Author: Harald Freudenberger Date: Tue Sep 12 10:08:51 2023 +0200 s390/zcrypt: introduce new internal AP queue se_bound attribute This patch introduces a new AP queue internal attribute se_bound which reflects the bound state of an APQN within a Secure Execution environment. With introduction of Secure Execution guests now an AP firmware queue needs to be bound to the guest before usage. This patch introduces a new internal attribute reflecting this bound state and some glue code to handle this new field during lifetime of an AP queue device. Together with that now the zcrypt scheduler considers the state of the AP queues when a message is about to be distributed among the existing queues. There is a new function ap_queue_usable() which returns true only when all conditions for using this AP queue device are fulfilled. In details this means: the AP queue needs to be configured, not checkstopped and within an SE environment it needs to be bound. So the new function gives and indication if the AP queue device is ready to serve requests or not. Signed-off-by: Harald Freudenberger Reviewed-by: Holger Dengler Signed-off-by: Vasily Gorbik commit 32d1d9204f8db3360be55e65bd182a1a68f93308 Author: Harald Freudenberger Date: Tue Sep 12 09:54:25 2023 +0200 s390/ap: re-init AP queues on config on On a state toggle from config off to config on and on the state toggle from checkstop to not checkstop the queue's internal states was set but the state machine was not nudged. This did not care as on the first enqueue of a request the state machine kick ran. However, within an Secure Execution guest a queue is only chosen by the scheduler when it has been bound. But to bind a queue, it needs to run through the initial states (reset, enable interrupts, ...). So this is like a chicken-and-egg problem and the result was in fact that a queue was unusable after a config off/on toggle. With some slight rework of the handling of these states now the new function _ap_queue_init_state() is called which is the core of the ap_queue_init_state() function but without locking handling. This has the benefit that it can be called on all the places where a (re-)init of the AP queue's state machine is needed. Fixes: 2d72eaf036d2 ("s390/ap: implement SE AP bind, unbind and associate") Signed-off-by: Harald Freudenberger Reviewed-by: Holger Dengler Signed-off-by: Vasily Gorbik commit 96104046d13585ad5d2cd8803dbb7c49b0cda3e7 Author: Viresh Kumar Date: Thu Oct 12 15:11:30 2023 +0530 OPP: Add _link_required_opps() to avoid code duplication Factor out _link_required_opps() to remove duplicate code. No functional change. Signed-off-by: Viresh Kumar Reviewed-by: Ulf Hansson commit 8e6db129eb56960202642800ffd273d68411acff Author: Viresh Kumar Date: Thu Oct 12 14:39:26 2023 +0530 OPP: Fix formatting of if/else block Add {} to both if else blocks or none. Signed-off-by: Viresh Kumar Reviewed-by: Ulf Hansson commit 1399ebacbf590dfbac4fbba181dd1595b2fa10ba Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:56 2023 +0200 drm: renesas: shmobile: Add DT support Add DT support, by: 1. Creating a panel bridge from DT, and attaching it to the encoder, 2. Replacing the custom connector with a bridge connector, 3. Obtaining clock configuration based on the compatible value. Note that for now the driver uses a fixed clock configuration selecting the bus clock, as the current code to select other clock inputs needs changes to support any other SoCs than SH7724. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/6185ab76aa300fa402e4f6610b2109665f2d8a1c.1694767209.git.geert+renesas@glider.be commit b2b2f7ba8f793d52d5401bce52e541a5f38a6b43 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:55 2023 +0200 drm: renesas: shmobile: Atomic conversion part 3 Complete the conversion to atomic mode setting by converting the connector, and setting the DRIVER_ATOMIC flag. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/042f9ff076c4b1c87235c74c8b76c9d161e126ec.1694767209.git.geert+renesas@glider.be commit 7c2d79f06e072434cba9f87ce77cad689de0cb4a Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:54 2023 +0200 drm: renesas: shmobile: Remove internal CRTC state tracking Now the suspend/resume methods no longer need to look at internal driver state, the dpms and started fields in the shmob_drm_crtc structure can be removed, as well as the shmob_drm_crtc_dpms() wrapper. After this, shmob_drm_crtc_atomic_{en,dis}able() became just wrappers around shmob_drm_crtc_st{art,op}(), so inline the latter. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/905b9ca72f43d40438c8cb1199cde140eb123204.1694767209.git.geert+renesas@glider.be commit cc2c9546682942a1a6c81e46c1a5151a5d9deaae Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:53 2023 +0200 drm: renesas: shmobile: Use suspend/resume helpers Replace the custom suspend/resume handling by calls into drm_mode_config_helper_{suspend,resume}(). Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/a52147ca6033e0a59675f37f0326c7404fc5919c.1694767209.git.geert+renesas@glider.be commit e3c8898b3861751edcad1023edaabae719fe1f83 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:52 2023 +0200 drm: renesas: shmobile: Atomic conversion part 2 Implement atomic mode setting for the CRTC, using the existing dpms callback. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/ca2a00200ef5ac899a6131087d0a30de1c806119.1694767209.git.geert+renesas@glider.be commit 4afa041043c21e0af93efb1a344e84edb1326fa9 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:51 2023 +0200 drm: renesas: shmobile: Atomic conversion part 1 Implement atomic mode setting for both the primary and overlay planes. This involves: - Moving the primary plane handling code from CRTC mode setting to plane handling shared by primary and overlay planes, - Adding basic CRTC and mode config atomic mode setting ops, which don't do much yet. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/a6b698a1c8c1eaf631c2f928f5888ab5fe7aa4c3.1694767209.git.geert+renesas@glider.be commit 22a4414594e84f8315717150ca7738f228eed56f Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:50 2023 +0200 drm: renesas: shmobile: Cleanup encoder Most unused callbacks can be NULL pointers these days. Drop a bunch of empty encoder callbacks. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/04f186573e1df90ecc051272f3d1cbe564c3469b.1694767209.git.geert+renesas@glider.be commit fbe544ffc094dfba8a0a4f1985879010d609521e Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:49 2023 +0200 drm: renesas: shmobile: Shutdown the display on remove When the device is unbound from the driver, the display may be active. Make sure it gets shut down. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/ddf2736459d59d0e961f240e77da7b0a28caae15.1694767209.git.geert+renesas@glider.be commit c285aac128edadd42ba165df2aa28f22dbaeb602 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:48 2023 +0200 drm: renesas: shmobile: Turn vblank on/off when enabling/disabling CRTC The DRM core vblank handling mechanism requires drivers to forcefully turn vblank reporting off when disabling the CRTC, and to restore the vblank reporting status when enabling the CRTC. Implement this using the drm_crtc_vblank_{on,off}() helpers. Note that drm_crtc_vblank_off() must be called at startup to synchronize the state of the vblank core code with the hardware, which is initially disabled. This is performed at CRTC creation time, requiring vertical blank initialization to be moved before creating CRTCs. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/e5833e5706b7792bfca8e6e56fc154a7c3e0574f.1694767209.git.geert+renesas@glider.be commit b1ce7fe4c4368886db5b838ee53a253e60b5abbf Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:47 2023 +0200 drm: renesas: shmobile: Wait for page flip when turning CRTC off Turning a CRTC off will prevent a queued page flip from ever completing, potentially confusing userspace. Wait for queued page flips to complete before turning the CRTC off to avoid this. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/c97d5859c43fa36043c61de28d67688ebe345092.1694767209.git.geert+renesas@glider.be commit a87e3159d488a125838eb6b8694549afca5e03be Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:46 2023 +0200 drm: renesas: shmobile: Move shmob_drm_crtc_finish_page_flip() Move the shmob_drm_crtc_finish_page_flip() function up, to avoid having to move it during the modification in the next change. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/4c87bb31403d142f8f146176cb859a10a28a3601.1694767209.git.geert+renesas@glider.be commit 03f716f61e5560fee2c9c40db2a1ae318053c03d Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:45 2023 +0200 drm: renesas: shmobile: Use drm_crtc_handle_vblank() Replace the call to the legacy drm_handle_vblank() function with a call to the new drm_crtc_handle_vblank() helper. Reviewed-by: Laurent Pinchart Reviewed-by: Sui Jingfeng Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/bef278cc9b7536505f41faaa2f13184d9354fa7e.1694767209.git.geert+renesas@glider.be commit a83d383e1ffb32b170b7ddd6aa6861d6125e6c79 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:44 2023 +0200 drm: renesas: shmobile: Rename shmob_drm_plane.plane Rename the "plane" member of the shmob_drm_plane subclass structure to "base", to improve readability. Reviewed-by: Laurent Pinchart Reviewed-by: Sui Jingfeng Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/73809d0a94f9075dd868cf567790d10f8ae61603.1694767209.git.geert+renesas@glider.be commit 9d7bd3b12e6a88cf163c0b414c285a995c634d7c Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:43 2023 +0200 drm: renesas: shmobile: Rename shmob_drm_connector.connector Rename the "connector" member of the shmob_drm_connector subclass structure to "base", to improve readability. Reviewed-by: Laurent Pinchart Reviewed-by: Sui Jingfeng Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/2382c4c796b53b5d2b24f99b85954ce632f21b90.1694767209.git.geert+renesas@glider.be commit 51955324847c59f5332154026f533910948b5d17 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:42 2023 +0200 drm: renesas: shmobile: Rename shmob_drm_crtc.crtc Rename the "crtc" member of the shmob_drm_crtc subclass structure to "base", to improve readability. Reviewed-by: Laurent Pinchart Reviewed-by: Sui Jingfeng Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/b42a32082d25bde6db7a57d8dc0d9f45820f6716.1694767209.git.geert+renesas@glider.be commit c228823426ae509f4907712fe9bc3edea434a515 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:41 2023 +0200 drm: renesas: shmobile: Unify plane allocation Unify primary and overlay plane allocation: - Enhance shmob_drm_plane_create() so it can be used to create the primary plane, too, - Move overlay plane creation next to primary plane creation. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/adbc5febc0099fd1910f32a7af1c8e0f570f74b4.1694767209.git.geert+renesas@glider.be commit adceac2cf1929272ddced1352ecd04272890efc5 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:40 2023 +0200 drm: renesas: shmobile: Move interface handling to connector setup Move legacy interface handling to the connector setup code. Set up bus_flags and bus_formats in display_info according to the bus format and panel information from platform data, to make it more similar with DT-based connector/bridge/panel setup. This will allow us to use the same LCD interface setup code for both legacy and DT-based systems. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/912f615eb87c847804a268200ab57c63453c65d4.1694767209.git.geert+renesas@glider.be commit fa32c6bc92813a76419d1c306e35394cae5028eb Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:39 2023 +0200 drm: renesas: shmobile: Use media bus formats in platform data Replace the custom shmob_drm_interface enumeration values with standard media bus formats. This simplifies driver handling of bus formats and prepares for DT support. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/0a15e5100ca30d14953c93550eb1d4c2e18de939.1694767209.git.geert+renesas@glider.be commit 6a6ab0c7162b4b10ce74347e282e1bc81103a48f Author: Laurent Pinchart Date: Fri Sep 15 10:53:38 2023 +0200 drm: renesas: shmobile: Use struct videomode in platform data Replace the drm_mode_modeinfo field with videomode that includes more signal polarity flags. This simplifies driver handling of panel modes and prepares for DT support. Signed-off-by: Laurent Pinchart [geert: Simplify] Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/4312e56de424d94399c6105e7159317eae86c9d5.1694767209.git.geert+renesas@glider.be commit c2e938ee9ae238f62424fc908cef97d96a1fee53 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:37 2023 +0200 drm: renesas: shmobile: Replace .dev_private with container_of() Now that drm_device is embedded in shmob_drm_device, we can use a container_of()-based helper to get the shmob_drm_device pointer from the drm_device, instead of using the deprecated drm_device.dev_private field. While at it, restore reverse Xmas tree ordering of local variable declarations. Reviewed-by: Laurent Pinchart Reviewed-by: Sui Jingfeng Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/8ef4be8bffe75efc7f4b66f3732ec357f7d43e0f.1694767209.git.geert+renesas@glider.be commit 02e6c5b76f0eb6d85cebb7603c342809c3c6b14a Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:36 2023 +0200 drm: renesas: shmobile: Convert container helpers to static inline functions Replace to conversion helper macros using container_of() by static inline functions, to improve type-safety. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/7d1f1aa4b832499f9e527353ce0ad6d84ff9a74a.1694767209.git.geert+renesas@glider.be commit 5417750d5ee645eb4169e1e8dc467b0b7b7329fa Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:35 2023 +0200 drm: renesas: shmobile: Embed drm_device in shmob_drm_device Embedding drm_device in shmob_drm_device allows us to use the DRM managed API to allocate both structures in one go, simplifying error handling. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/abbf95021191824f44cc8c52e4afbde93d44363a.1694767209.git.geert+renesas@glider.be commit 3d77d2ac7d9d5218a1f3df49e5bf8bd5c4f35b5a Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:34 2023 +0200 drm: renesas: shmobile: Use drmm_universal_plane_alloc() According to the comments for drm_universal_plane_init(), the plane structure should not be allocated with devm_kzalloc(). Fix lifetime issues by using drmm_universal_plane_alloc() instead. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/65ebf0513e2836227a9636e922f51c668bd69720.1694767209.git.geert+renesas@glider.be commit 33505f7718186fbe74604c7217143a0845eaeb5f Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:33 2023 +0200 drm: renesas: shmobile: Remove custom plane destroy callback There is no need to call drm_plane_force_disable() from the plane's .destroy() callback, as the plane should have been disabled already before. See also commit 3c858a33858baa8c ("drm/plane_helper: don't disable plane in destroy function") for the generic plane helper case. After removing this call, shmob_drm_plane_destroy() becomes a simple wrapper around shmob_drm_plane_destroy(), hence replace it by the latter. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/8d7a3f250612085fdf4e06d377843e8f874b22d9.1694767209.git.geert+renesas@glider.be commit 901500a8ba5c8cf04f8ddc71d6d5c0b02a2c5cf1 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:32 2023 +0200 drm: renesas: shmobile: Convert to use devm_request_irq() Convert to managed IRQ handling, to simplify cleanup. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/8d870bdc59dd5e2754542388a03095ea09c96297.1694767209.git.geert+renesas@glider.be commit 95478b0828752d5b91fe5a94f44d5713e4980599 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:31 2023 +0200 drm: renesas: shmobile: Improve error handling Prepare for DT conversion, where panel probe can be deferred, by streamlining error propagation and handling: - Use dev_err_probe() to avoid printing error messages in case of probe deferral, - Propagate errors where needed. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/6dfac76e5b1c7dda3f96801ce83845a4235e2ccd.1694767209.git.geert+renesas@glider.be commit 04ed052f3ab4b3c4c3e8451522ffaa84479bf0fb Author: Laurent Pinchart Date: Fri Sep 15 10:53:30 2023 +0200 drm: renesas: shmobile: Remove support for SYS panels SYS panels are not used, and have no defined DT bindings. Remove their support to avoid impeding DT support. It can always be added back later. Signed-off-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/4ccca2a5ac05c73ea9fd6e44b8bc443fd9d14e0d.1694767209.git.geert+renesas@glider.be commit e2eb7e6ee5667f0b5b622020906446e3acbdd4b3 Author: Laurent Pinchart Date: Fri Sep 15 10:53:29 2023 +0200 drm: renesas: shmobile: Rename input clocks Prepare for DT bindings by using more appropriate names for the input clocks. Note that all LDDCKR_ICKSEL_* definitions but the one for the bus clock are valid only for SH7724, so the clock selection code needs to be updated when extending clock support to other SoCs. Signed-off-by: Laurent Pinchart [geert: Add note] Reviewed-by: Sui Jingfeng Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/d4b4d2164541ae055d10064103db3c2d6540e846.1694767209.git.geert+renesas@glider.be commit 76b1405832ac067c16997fb7ede7b2e2517aa441 Author: Laurent Pinchart Date: Fri Sep 15 10:53:28 2023 +0200 drm: renesas: shmobile: Don't set display info width and height twice The display info width_mm and height_mm fields are set at init time and never overwritten, don't set them a second time when getting modes. Signed-off-by: Laurent Pinchart Reviewed-by: Sui Jingfeng Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/edd49fcb92af83d81df655b3db1685e8ed14380a.1694767209.git.geert+renesas@glider.be commit 0da28d5fc808dfcfbc910870b4b0277c1a7ccb6c Author: Laurent Pinchart Date: Fri Sep 15 10:53:27 2023 +0200 drm: renesas: shmobile: Remove backlight support Backlight support should be implemented by panels, not by the LCDC driver. As the feature is currently unused anyway, remove it. Signed-off-by: Laurent Pinchart [geert: Cleanups] Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/69707650245bc2193d072f24723d4d5482ea590b.1694767209.git.geert+renesas@glider.be commit 7802ca6b234b622da35fa4843943be7a0e8facf1 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:26 2023 +0200 drm: renesas: shmobile: Improve shmob_drm_format_info table Improve the table containing hardware information related to the supported plane formats: 1. Move (part of) the overlay format register settings from multiple switch() statements spread across the code into the table, like is already done for the primary plane register settings, 2. Remove the .yuv field, as that information can easily be extracted from the register settings using a new helper macro, 3. Shrink and move the .bpp field to reduce table size. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/b41f755e80ffe5fb4adbb2d8f96f2073de5c33bc.1694767209.git.geert+renesas@glider.be commit 02e6e3c2fa26ad1e9b458b07c8fd0e56d46607bd Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:25 2023 +0200 drm: renesas: shmobile: Add missing YCbCr formats The primary plane supports various YCbCr formats, and the CRTC code already knows how to handle them. Enable support for the missing formats by adding them to the table of supported modes. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/e5a5d5ab2083280be5fcdc428e8b8ca198b4448d.1694767209.git.geert+renesas@glider.be commit 480b5571f33151e9b4a4dfddfbde7eff14fbe27d Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:24 2023 +0200 drm: renesas: shmobile: Use %p4cc to print fourcc code Replace the last printing of an hexadecimal fourcc format code by a pretty-printed format name, using the "%p4cc" format specifier. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/aaa9d474535f3cd800da5a9ef27023dc7960e690.1694767209.git.geert+renesas@glider.be commit 887042d635005b5127b04a73d2c9d0c79cf380b1 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:23 2023 +0200 drm: renesas: shmobile: Restore indentation of shmob_drm_setup_clocks() Commit 56550d94cbaeaa19 ("Drivers: gpu: remove __dev* attributes.") forgot to realign the continuation of the parameter section of shmob_drm_setup_clocks(). Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/b1c5c9b33b74fef1f4250847398a98f93c4dc1be.1694767209.git.geert+renesas@glider.be commit 616f73c9d3255342a037c5204ce381a4d7aa274a Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:22 2023 +0200 drm: renesas: shmobile: Add support for Runtime PM The SH-Mobile LCD Controller is part of a PM Domain on all relevant SoCs (clock domain on all, power domain on some). Hence it may not be sufficient to manage the LCDC module clock explicitly (e.g. if the selected clock source differs from SHMOB_DRM_CLK_BUS). Fix this by using Runtime PM for all clock handling. Add an explicit dependency on CONFIG_PM, which should already be met on all affected platforms. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/e7359a64963bd9a4f1531c2beae850774ce140bc.1694767209.git.geert+renesas@glider.be commit b25064ef997bf30ad8c6abe5fbd6e3ddae75d17b Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:21 2023 +0200 drm: renesas: shmobile: Correct encoder/connector types The first encoder output on the SH-Mobile LCD Controller is a DPI parallel bus. However, at the time of introduction of the driver, no encoder or connector types were defined yet for the DPI parallel bus, hence the driver used the ones for LVDS instead. Adjust the types accordingly. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/db500dd8356955d3471a1ccd68d90db9f9750ef9.1694767209.git.geert+renesas@glider.be commit 1396c2693aed3fb3240aa54dde61085958bbab97 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:20 2023 +0200 drm: renesas: shmobile: Fix ARGB32 overlay format typo When configuring a CHn Source Image Format Register (LDBBSIFR), one should use the corresponding LDBBSIFR_RPKF_* definition for overlay planes, not the DDFR_PKF_* definition for the primary plane. Fortunately both definitions resolve to the same value, so this bug did not cause any harm. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/34f8d51539c048e264699ca869ad9d7a952cd69f.1694767209.git.geert+renesas@glider.be commit 28675d45a3810c7302979b9803b18814d357c650 Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:19 2023 +0200 drm: renesas: shmobile: Fix overlay plane disable Merely writing zero to the CHn Source Image Format Register is not sufficient to disable a plane, as the programmed register value is not propagated immediately to the current side. This can be seen when using the -P option of modetest: the extra plane is displayed correctly, but does not disappear after exit. Fix this by doing the full update dance using the Blend Control Register, like is done when enabling the plane. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/54e2556e18b5524ce153a7ac79faf2c7b0a55260.1694767209.git.geert+renesas@glider.be commit c68ab8b5ea53aa0895f7ec5b72c87e0f7097761e Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:18 2023 +0200 media: uapi: Add MEDIA_BUS_FMT_RGB666_2X9_BE format Add the RGB666 9:9 format MEDIA_BUS_FMT_RGB666_2X9_BE, which is supported by the SH-Mobile LCD Controller. Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/8b421cc391ac511c07cb1e243c1ba18bb95f7f98.1694767209.git.geert+renesas@glider.be commit 613676ec42d59784670f70b4e09db23531d3e29a Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:17 2023 +0200 dt-bindings: display: Add Renesas SH-Mobile LCDC bindings Add device tree bindings for the LCD Controller (LCDC) found in Renesas SuperH SH-Mobile and ARM SH/R-Mobile SOCs. Based on a plain text prototype by Laurent Pinchart. Reviewed-by: Rob Herring Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/6d0a053502abd6555e9a6cbe055e1bdc3329999d.1694767208.git.geert+renesas@glider.be commit 406a849926f3e4c1fcedfdc6623a33bc4f13adbe Author: Geert Uytterhoeven Date: Fri Sep 15 10:53:16 2023 +0200 MAINTAINER: Create entry for Renesas SH-Mobile DRM drivers Split off DRM drivers for Renesas SH-Mobile into its own entry, and add Geert Uytterhoeven as a maintainer. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/7cbcec72214886b67afa8d724a9245661d8cd675.1694767208.git.geert+renesas@glider.be commit 15fe53be46eaf4f6339cd433972ecc90513e3076 Author: Dmitry Baryshkov Date: Thu Oct 12 01:00:02 2023 +0300 drm/bridge: lt9611uxc: fix the race in the error path If DSI host attachment fails, the LT9611UXC driver will remove the bridge without ensuring that there is no outstanding HPD work being done. In rare cases this can result in the warnings regarding the mutex being incorrect. Fix this by forcebly freing IRQ and flushing the work. DEBUG_LOCKS_WARN_ON(lock->magic != lock) WARNING: CPU: 0 PID: 10 at kernel/locking/mutex.c:582 __mutex_lock+0x468/0x77c Modules linked in: CPU: 0 PID: 10 Comm: kworker/0:1 Tainted: G U 6.6.0-rc5-next-20231011-gd81f81c2b682-dirty #1206 Hardware name: Qualcomm Technologies, Inc. Robotics RB5 (DT) Workqueue: events lt9611uxc_hpd_work pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __mutex_lock+0x468/0x77c lr : __mutex_lock+0x468/0x77c sp : ffff8000800a3c70 x29: ffff8000800a3c70 x28: 0000000000000000 x27: ffffd595fe333000 x26: ffff7c2f0002c005 x25: ffffd595ff1b3000 x24: ffffd595fccda5a0 x23: 0000000000000000 x22: 0000000000000002 x21: ffff7c2f056d91c8 x20: 0000000000000000 x19: ffff7c2f056d91c8 x18: fffffffffffe8db0 x17: 000000040044ffff x16: 005000f2b5503510 x15: 0000000000000000 x14: 000000000006efb8 x13: 0000000000000000 x12: 0000000000000037 x11: 0000000000000001 x10: 0000000000001470 x9 : ffff8000800a3ae0 x8 : ffff7c2f0027f8d0 x7 : ffff7c2f0027e400 x6 : ffffd595fc702b54 x5 : 0000000000000000 x4 : ffff8000800a0000 x3 : 0000000000000000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff7c2f0027e400 Call trace: __mutex_lock+0x468/0x77c mutex_lock_nested+0x24/0x30 drm_bridge_hpd_notify+0x2c/0x5c lt9611uxc_hpd_work+0x6c/0x80 process_one_work+0x1ec/0x51c worker_thread+0x1ec/0x3e4 kthread+0x120/0x124 ret_from_fork+0x10/0x20 irq event stamp: 15799 hardirqs last enabled at (15799): [] finish_task_switch.isra.0+0xa8/0x278 hardirqs last disabled at (15798): [] __schedule+0x7b8/0xbd8 softirqs last enabled at (15794): [] __do_softirq+0x498/0x4e0 softirqs last disabled at (15771): [] ____do_softirq+0x10/0x1c Fixes: bc6fa8676ebb ("drm/bridge/lontium-lt9611uxc: move HPD notification out of IRQ handler") Signed-off-by: Dmitry Baryshkov Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20231011220002.382422-1-dmitry.baryshkov@linaro.org commit 744940f1921c8feb90e3c4bcc1e153fdd6e10fe2 Author: Sandipan Das Date: Mon Oct 16 11:37:43 2023 +0530 perf/x86/amd/uncore: Pass through error code for initialization failures, instead of -ENODEV Pass through the appropriate error code when the registration of hotplug callbacks fail during initialization, instead of returning a blanket -ENODEV. [ mingo: Updated the changelog. ] Reported-by: Dan Carpenter Signed-off-by: Sandipan Das Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231016060743.332051-1-sandipan.das@amd.com commit 30d75d3c6fe7cba7f1641e89d2b65de657932a19 Merge: b4e10c3190504 8aec97decfd0f Author: Linus Walleij Date: Mon Oct 16 11:41:53 2023 +0200 Merge tag 'samsung-pinctrl-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung into devel Samsung pinctrl drivers changes for v6.7 Few cleanups, improvements (use __counted_by annotation) and finally switch to dynamic allocation of GPIO numberspace. Signed-off-by: Linus Walleij commit 29060633411a02f6f2dd9d5245919385d69d81f0 Author: Binbin Wu Date: Mon Oct 16 14:24:46 2023 +0800 selftests/x86/lam: Zero out buffer for readlink() Zero out the buffer for readlink() since readlink() does not append a terminating null byte to the buffer. Also change the buffer length passed to readlink() to 'PATH_MAX - 1' to ensure the resulting string is always null terminated. Fixes: 833c12ce0f430 ("selftests/x86/lam: Add inherit test cases for linear-address masking") Signed-off-by: Binbin Wu Signed-off-by: Ingo Molnar Reviewed-by: Kirill A. Shutemov Link: https://lore.kernel.org/r/20231016062446.695-1-binbin.wu@linux.intel.com commit ce62f8ea7e3f8a8e788c3b5ea0195f1224575b66 Author: Liu Ying Date: Mon Aug 21 11:40:08 2023 +0800 drm/bridge: imx: Add i.MX93 MIPI DSI support Freescale i.MX93 SoC embeds a Synopsys Designware MIPI DSI host controller and a Synopsys Designware MIPI DPHY. Some configurations and extensions to them are controlled by i.MX93 media blk-ctrl. Add a DRM bridge for i.MX93 MIPI DSI by using existing DW MIPI DSI bridge helpers and implementing i.MX93 MIPI DSI specific extensions. Signed-off-by: Liu Ying Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230821034008.3876938-10-victor.liu@nxp.com commit db95a55ccec749719ffe61a76c9a1d0a173c207c Author: Liu Ying Date: Mon Aug 21 11:40:07 2023 +0800 dt-bindings: display: bridge: Document Freescale i.MX93 MIPI DSI Freescale i.MX93 SoC embeds a Synopsys Designware MIPI DSI host controller and a Synopsys Designware MIPI DPHY. Some configurations and extensions to them are controlled by i.MX93 media blk-ctrl. Signed-off-by: Liu Ying Reviewed-by: Rob Herring Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230821034008.3876938-9-victor.liu@nxp.com commit 743bf594a3b1903a93f21f2060e3cdc5514e066c Author: Liu Ying Date: Mon Aug 21 11:40:06 2023 +0800 drm/bridge: synopsys: dw-mipi-dsi: Disable HSTX and LPRX timeout check According to Synopsys DW MIPI DSI host databook, HSTX and LPRX timeout contention detections are measured in TO_CLK_DIVISION cycles. However, the current driver programs magic values to TO_CLK_DIVISION, HSTX_TO_CNT and LPRX_TO_CNT register fields, which makes timeout error event wrongly happen for some video modes, at least for the typical 1920x1080p@60 video mode read from a HDMI monitor driven by ADV7535 DSI to HDMI bridge. While at it, the current driver doesn't enable interrupt to handle or complain about the error status, so true error just happens silently except for display distortions by visual check. Disable the timeout check by setting those timeout register fields to zero for now until someone comes along with better computations for the timeout values. Although the databook doesn't mention what happens when they are set to zero, it turns out the false error doesn't happen for the 1920x1080p@60 video mode at least. Signed-off-by: Liu Ying Reviewed-by: Neil Armstrong Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230821034008.3876938-8-victor.liu@nxp.com commit d22e9a6df2db6a5b0ab7ff9123831e05c3e77899 Author: Liu Ying Date: Mon Aug 21 11:40:05 2023 +0800 drm/bridge: synopsys: dw-mipi-dsi: Set minimum lane byte clock cycles for HSA and HBP According to Synopsys support channel, each region of HSA, HBP and HFP must have minimum number of 10 bytes where constant 4 bytes are for HSS or HSE and 6 bytes are for blanking packet(header + CRC). Hence, the below table comes in. +------------+----------+-------+ | data lanes | min lbcc | bytes | +------------+----------+-------+ | 1 | 10 | 1*10 | +------------+----------+-------+ | 2 | 5 | 2*5 | +------------+----------+-------+ | 3 | 4 | 3*4 | +------------+----------+-------+ | 4 | 3 | 4*3 | +------------+----------+-------+ Implement the minimum lbcc numbers to make sure that the values programmed into DSI_VID_HSA_TIME and DSI_VID_HBP_TIME registers meet the minimum number requirement. For DSI_VID_HLINE_TIME register, it seems that the value programmed should be based on mode->htotal as-is, instead of sum up HSA, HBP, HFP and HDISPLAY. This helps the case where Raydium RM67191 DSI panel is connected, since it's video timing for hsync length is only 2 pixels and without this patch the programmed value for DSI_VID_HSA_TIME is only 2 with 4 data lanes. Signed-off-by: Liu Ying Reviewed-by: Neil Armstrong Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230821034008.3876938-7-victor.liu@nxp.com commit ac87d23694f44af44a98d21dd77016f2756b6b1b Author: Liu Ying Date: Mon Aug 21 11:40:04 2023 +0800 drm/bridge: synopsys: dw-mipi-dsi: Use pixel clock rate to calculate lbcc To get better accuration, use pixel clock rate to calculate lbcc instead of lane_mbps since the pixel clock rate is in KHz while lane_mbps is in MHz. Without this, distorted image can be seen on a HDMI monitor connected with i.MX93 11x11 EVK through ADV7535 DSI to HDMI bridge in 1920x1080p@60 video mode. Signed-off-by: Liu Ying Reviewed-by: Neil Armstrong Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230821034008.3876938-6-victor.liu@nxp.com commit 5a67ec8c64ec88b5c34060b347ccec4a31af3369 Author: Liu Ying Date: Mon Aug 21 11:40:03 2023 +0800 drm/bridge: synopsys: dw-mipi-dsi: Add mode fixup support Vendor drivers may need to fixup mode due to pixel clock tree limitation, so introduce the ->mode_fixup() callcack to struct dw_mipi_dsi_plat_data and call it at atomic check stage if available. Signed-off-by: Liu Ying Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230821034008.3876938-5-victor.liu@nxp.com commit d5116fb29dc09bd4b9d9175f4f571e6eac539c93 Author: Liu Ying Date: Mon Aug 21 11:40:02 2023 +0800 drm/bridge: synopsys: dw-mipi-dsi: Force input bus flags The DATAEN_ACTIVE_LOW bit in DSI_DPI_CFG_POL register is set to zero, so set the DRM_BUS_FLAG_DE_HIGH flag in input_bus_cfg.flags. It appears that the DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE flag also makes sense, so set it in input_bus_cfg.flags too. With this patch, the flags set by drm_atomic_bridge_propagate_bus_flags() are overridden (see comment in that function) in case any downstream bridges propagates invalid flags to this bridge. A real problematic case is to connect a RM67191 MIPI DSI panel whose driver sets DRM_BUS_FLAG_DE_LOW and DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE bus flags. Signed-off-by: Liu Ying Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230821034008.3876938-4-victor.liu@nxp.com commit 0de852d4c23a39d3ebff73d0c0c1b488eac6c5a8 Author: Liu Ying Date: Mon Aug 21 11:40:01 2023 +0800 drm/bridge: synopsys: dw-mipi-dsi: Add input bus format negotiation support Introduce ->get_input_bus_fmts() callback to struct dw_mipi_dsi_plat_data so that vendor drivers can implement specific methods to get input bus formats for Synopsys DW MIPI DSI. While at it, implement a generic callback for ->atomic_get_input_bus_fmts(), where we try to get the input bus formats through pdata->get_input_bus_fmts() first. If it's unavailable, fall back to the only format - MEDIA_BUS_FMT_FIXED, which matches the default behavior if ->atomic_get_input_bus_fmts() is not implemented as ->atomic_get_input_bus_fmts()'s kerneldoc indicates. Signed-off-by: Liu Ying Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230821034008.3876938-3-victor.liu@nxp.com commit ec20c510ee2d2a7f0d0a00e4bfd55c28e500d3b7 Author: Liu Ying Date: Mon Aug 21 11:40:00 2023 +0800 drm/bridge: synopsys: dw-mipi-dsi: Add dw_mipi_dsi_get_bridge() helper Add dw_mipi_dsi_get_bridge() helper so that it can be used by vendor drivers which implement vendor specific extensions to Synopsys DW MIPI DSI. Signed-off-by: Liu Ying Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230821034008.3876938-2-victor.liu@nxp.com commit 6dc597401cf56af6dd9e12d74664aee3121f1216 Author: Andy Shevchenko Date: Thu Jun 15 19:42:10 2023 +0300 mtd: rawnand: Remove unused of_gpio.h inclusion The of_gpio.h is not and shouldn't be used in the drivers. Remove it. Signed-off-by: Andy Shevchenko Acked-by: Martin Blumenstingl Signed-off-by: Miquel Raynal commit d656610ea702f243ac8534637cbbe06b24418b4b Author: Bruce Suen Date: Thu Oct 12 06:24:12 2023 -0400 mtd: spinand: Add support for XTX XT26xxxDxxxxx Add Support XTX Technology XT26G01DXXXXX, XT26G11DXXXXX, XT26Q01DXXXXX, XT26G02DXXXXX, XT26G12DXXXXX, XT26Q02DXXXXX, XT26G04DXXXXX, and XT26Q04DXXXXX SPI NAND. These are 3V/1.8V 1G/2G/4Gbit serial SLC NAND flash device with on-die ECC(8bit strength per 512bytes). Datasheet Links: - http://www.xtxtech.com/download/?AId=458 - http://www.xtxtech.com/download/?AId=495 Signed-off-by: Bruce Suen Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20231012102412.10581-1-bruce_suen@163.com commit 6a804fb72de56d6a99b799f565ae45f2cec7cd55 Author: Sridharan S N Date: Thu Oct 12 12:11:34 2023 +0530 mtd: spinand: winbond: add support for serial NAND flash Add support for W25N01JW, W25N02JWZEIF, W25N512GW, W25N02KWZEIR and W25N01GWZEIG. W25N02KWZEIR has 8b/512b on-die ECC capability and other four has 4b/512b on-die ECC capability. Signed-off-by: Sridharan S N Signed-off-by: Md Sadre Alam Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20231012064134.4068621-1-quic_sridsn@quicinc.com commit 4c1f363777ac8fa7c54a408868b6f88c9795ef59 Author: Kees Cook Date: Fri Oct 6 13:17:34 2023 -0700 mtd: rawnand: cadence: Annotate struct cdns_nand_chip with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct cdns_nand_chip. Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: "Gustavo A. R. Silva" Cc: Martin Blumenstingl Cc: Nicolas Ferre Cc: Roger Quadros Cc: Thierry Reding Cc: Yang Yingliang Cc: "Uwe Kleine-König" Cc: Valentin Korenblit Cc: ye xingchen Cc: linux-mtd@lists.infradead.org Cc: linux-hardening@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20231006201734.work.060-kees@kernel.org commit 13241a5ee367dfa929268a0ac484323a37ea7290 Author: Kees Cook Date: Fri Oct 6 13:17:28 2023 -0700 mtd: rawnand: Annotate struct mtk_nfc_nand_chip with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mtk_nfc_nand_chip. Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: Matthias Brugger Cc: AngeloGioacchino Del Regno Cc: "Gustavo A. R. Silva" Cc: Heiko Stuebner Cc: Martin Blumenstingl Cc: Thierry Reding Cc: Roger Quadros Cc: "Uwe Kleine-König" Cc: Cai Huoqing Cc: Chuanhong Guo Cc: Rob Herring Cc: Li Zetao Cc: linux-mtd@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Cc: linux-hardening@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20231006201728.work.750-kees@kernel.org commit f447318fb1d156b4b6da79266724c7ee347d1b59 Author: Martin Kurbanov Date: Mon Oct 2 17:04:58 2023 +0300 mtd: spinand: add support for FORESEE F35SQA002G Add support for FORESEE F35SQA002G SPI NAND. Datasheet: https://www.longsys.com/uploads/LM-00006FORESEEF35SQA002GDatasheet_1650183701.pdf Signed-off-by: Martin Kurbanov Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20231002140458.147605-1-mmkurbanov@salutedevices.com commit 1cfa2f76afb1fdedfbcbd83973a233e60c3e7add Author: Christophe JAILLET Date: Sun Oct 1 09:44:04 2023 +0200 mtd: rawnand: rockchip: Use struct_size() Use struct_size() instead of hand writing it. This is less verbose and more robust. While at it, prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). Also remove a useless comment about the position of a flex-array in a structure. Signed-off-by: Christophe JAILLET Reviewed-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Acked-by: Heiko Stuebner Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/481721c2c7fe570b4027dbe231d523961c953d5a.1696146232.git.christophe.jaillet@wanadoo.fr commit f693b6485e251ddf849d862cf6406a4dfc0143b3 Author: Amit Kumar Mahapatra Date: Wed Sep 27 11:26:21 2023 +0530 mtd: rawnand: arasan: Include ECC syndrome along with in-band data while checking for ECC failure Following an ECC failure condition upon page reads, we shall distinguish between a real ECC failure and an empty page. This is handled with a call to nand_check_erased_ecc_chunk() which looks at the data and counts the number of bits which are not 'ones'. If we get less zeros than the ECC strength, we assume the page was erased and we are in the presence of natural bitflips. Otherwise, if we are above, we assume some data was written and the ECC engine could not recover it all, so we report an ECC failure. In order for this logic to be as close as the reality as we can (this is already a simplified condition but we can hardly be more precise), we should check all the data that is covered by the ECC step not only the in-band data, so we should also include the ECC syndrome in the check. Fixes: 88ffef1b65cf ("mtd: rawnand: arasan: Support the hardware BCH ECC engine") Signed-off-by: Amit Kumar Mahapatra Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230927055621.2906454-1-amit.kumar-mahapatra@amd.com commit 6135e730f81d7fdb8864f9f8e102bcb8c8351552 Author: Rob Herring Date: Mon Oct 9 12:28:56 2023 -0500 mtd: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20231009172923.2457844-1-robh@kernel.org commit e12c4703cec0f07bae2f7cd1538ba9354e92b754 Author: Biju Das Date: Wed Aug 30 15:23:58 2023 +0100 drm: adv7511: Add hpd_override_enable variable to struct adv7511_chip_info As per spec, it is allowed to pulse the HPD signal to indicate that the EDID information has changed. Some monitors do this when they wake up from standby or are enabled. When the HPD goes low the adv7511 is reset and the outputs are disabled which might cause the monitor to go to standby again. To avoid this we ignore the HPD pin for the first few seconds after enabling the output. On the other hand, adv7535 require to enable HPD Override bit for proper HPD. Add hpd_override_enable variable to struct adv7511_chip_info to handle this scenario. Signed-off-by: Biju Das Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230830142358.275459-9-biju.das.jz@bp.renesas.com commit 7618aa3ab38e1130268cca6aab408cd4fefeba0c Author: Biju Das Date: Wed Aug 30 15:23:57 2023 +0100 drm: adv7511: Add link_config variable to struct adv7511_chip_info The ADV7511 needs link configuration whereas ADV75{33,35} does not need it. Add a variable link_config to struct adv7511_chip_info to handle this difference. Signed-off-by: Biju Das Reviewed-by: Laurent Pinchart Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230830142358.275459-8-biju.das.jz@bp.renesas.com commit c75551214858384d5128cd874a0b346e0a624b56 Author: Biju Das Date: Wed Aug 30 15:23:56 2023 +0100 drm: adv7511: Add has_dsi variable to struct adv7511_chip_info The ADV7533 and ADV7535 have DSI support. Add a variable has_dsi to struct adv7511_chip_info for handling configuration related to DSI. Signed-off-by: Biju Das Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230830142358.275459-7-biju.das.jz@bp.renesas.com commit 8d6cf571901148d0af549f4a7ae8c5b4a0f3e996 Author: Biju Das Date: Wed Aug 30 15:23:55 2023 +0100 drm: adv7511: Add reg_cec_offset variable to struct adv7511_chip_info The ADV7533 and ADV7535 have an offset(0x70) for the CEC register map compared to ADV7511. Add the reg_cec_offset variable to struct adv7511_chip_info to handle this difference and drop the reg_cec_offset variable from struct adv7511. This will avoid assigning reg_cec_offset based on chip type and also testing for multiple chip types by calling adv7533_patch_cec_registers(). Signed-off-by: Biju Das Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230830142358.275459-6-biju.das.jz@bp.renesas.com commit 9ac196fb9a173dd13bf6e0cf4a7edb66fc0a3797 Author: Biju Das Date: Wed Aug 30 15:23:54 2023 +0100 drm: adv7511: Add supply_names and num_supplies variables to struct adv7511_chip_info The ADV7511 has 5 power supplies compared to 7 that of ADV75{33,35}. Add supply_names and num_supplies variables to struct adv7511_chip_info to handle this difference. Signed-off-by: Biju Das Reviewed-by: Laurent Pinchart Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230830142358.275459-5-biju.das.jz@bp.renesas.com commit 399562fc02d8e782f62cfc3791269d29e0b78085 Author: Biju Das Date: Wed Aug 30 15:23:53 2023 +0100 drm: adv7511: Add max_lane_freq_khz variable to struct adv7511_chip_info The ADV7533 supports a maximum lane clock of 800MHz whereas it is 891MHz for ADV7535. Add max_lane_freq_khz variable to struct adv7511_chip_info to handle this difference. While at it, drop the unused local variable max_lane_freq. Signed-off-by: Biju Das Reviewed-by: Laurent Pinchart Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230830142358.275459-4-biju.das.jz@bp.renesas.com commit 11ae4e406dd9ab799da6f5951c3a6f8ec6b1e321 Author: Biju Das Date: Wed Aug 30 15:23:52 2023 +0100 drm: adv7511: Add max_mode_clock_khz variable to struct adv7511_chip_info The ADV7533 supports a maximum pixel clock of 80MHz whereas it is 148.5MHz for ADV7535. Add max_mode_clock_khz variable to struct adv7511_chip_info to handle this difference. Signed-off-by: Biju Das Reviewed-by: Adam Ford Tested-by: Adam Ford #imx8mm-beacon Reviewed-by: Laurent Pinchart Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230830142358.275459-3-biju.das.jz@bp.renesas.com commit 19e77c7aef5754e680ac77013538e2a3c0c173e4 Author: Biju Das Date: Wed Aug 30 15:23:51 2023 +0100 drm: adv7511: Add struct adv7511_chip_info and use i2c_get_match_data() Add struct adv7511_chip_info to handle hw differences between various chips rather checking against the 'type' variable in various places. Replace 'adv->type'->'info->type' by moving variable 'type' from struct adv7511 to struct adv7511_chip_info and add adv7511_chip_info as device data for both OF and ID tables instead of the device type. Simplify the probe() by replacing of_device_get_match_data() and ID lookup for retrieving match data with i2c_get_match_data(). Signed-off-by: Biju Das Tested-by: Fabio Estevam Reviewed-by: Adam Ford Reviewed-by: Laurent Pinchart Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230830142358.275459-2-biju.das.jz@bp.renesas.com commit dccce1d7c04051bc25d3abbe7716d0ae7af9c28a Author: Gerhard Engleder Date: Wed Oct 11 20:21:54 2023 +0200 tsnep: Inline small fragments within TX descriptor The tsnep network controller is able to extend the descriptor directly with data to be transmitted. In this case no TX data DMA address is necessary. Instead of the TX data DMA address the TX data buffer is placed at the end of the descriptor. The descriptor is read with a 64 bytes DMA read by the tsnep network controller. If the sum of descriptor data and TX data is less than or equal to 64 bytes, then no additional DMA read is necessary to read the TX data. Therefore, it makes sense to inline small fragments up to this limit within the descriptor ring. Inlined fragments need to be copied to the descriptor ring. On the other hand DMA mapping is not necessary. At most 40 bytes are copied, so copying should be faster than DMA mapping. For A53 1.2 GHz copying takes <100ns and DMA mapping takes >200ns. So inlining small fragments should result in lower CPU load. Performance improvement is small. Thus, comparision of CPU load with and without inlining of small fragments did not show any significant difference. With this optimization less DMA reads will be done, which decreases the load of the interconnect. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit d8118b945f03dbfcda72c273fa9b0548f73c8ce9 Merge: 3c4fe89878feb 6f19b2c136d98 Author: David S. Miller Date: Mon Oct 16 09:57:52 2023 +0100 Merge branch 'udp-tunnel-route-lookups' Beniamino Galvani says: ==================== net: consolidate IPv4 route lookup for UDP tunnels At the moment different UDP tunnels rely on different functions for IPv4 route lookup, and those functions all implement the same logic. Only bareudp uses the generic ip_route_output_tunnel(), while geneve and vxlan basically duplicate it slightly differently. This series first extends the generic lookup function so that it is suitable for all UDP tunnel implementations. Then, bareudp, geneve and vxlan are adapted to use them. This results in code with less duplication and hopefully better maintainability. After this series is merged, IPv6 will be converted in a similar way. Changelog: v2 - fix compilation with IPv6 disabled ==================== Signed-off-by: David S. Miller commit 6f19b2c136d98a84d79030b53e23d405edfdc783 Author: Beniamino Galvani Date: Mon Oct 16 09:15:26 2023 +0200 vxlan: use generic function for tunnel IPv4 route lookup The route lookup can be done now via generic function udp_tunnel_dst_lookup() to replace the custom implementations in vxlan_get_route(). Note that this patch only touches IPv4, while IPv6 still uses vxlan6_get_route(). After IPv6 route lookup gets converted as well, vxlan_xmit_one() can be simplified by removing local variables that will be passed via "struct ip_tunnel_key", such as remote_ip, local_ip, flow_flags, label. Suggested-by: Guillaume Nault Signed-off-by: Beniamino Galvani Signed-off-by: David S. Miller commit daa2ba7ed1d13740c1fb56533990f510ed973612 Author: Beniamino Galvani Date: Mon Oct 16 09:15:25 2023 +0200 geneve: use generic function for tunnel IPv4 route lookup The route lookup can be done now via generic function udp_tunnel_dst_lookup() to replace the custom implementation in geneve_get_v4_rt(). Suggested-by: Guillaume Nault Signed-off-by: Beniamino Galvani Signed-off-by: David S. Miller commit 60a77d11cd5d6501562ff4a297491f65a43c07db Author: Beniamino Galvani Date: Mon Oct 16 09:15:24 2023 +0200 geneve: add dsfield helper function Add a helper function to compute the tos/dsfield. In this way, we can factor out some duplicate code. Also, the helper will be called from more places in the next commit. Suggested-by: Guillaume Nault Signed-off-by: Beniamino Galvani Signed-off-by: David S. Miller commit 3ae983a603a49e6c80763f747a170b7e987531f3 Author: Beniamino Galvani Date: Mon Oct 16 09:15:23 2023 +0200 ipv4: use tunnel flow flags for tunnel route lookups Commit 451ef36bd229 ("ip_tunnels: Add new flow flags field to ip_tunnel_key") added a new field to struct ip_tunnel_key to control route lookups. Currently the flag is used by vxlan and geneve tunnels; use it also in udp_tunnel_dst_lookup() so that it affects all tunnel types relying on this function. Signed-off-by: Beniamino Galvani Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 72fc68c6356b663a8763f02d9b0ec773d59a4949 Author: Beniamino Galvani Date: Mon Oct 16 09:15:22 2023 +0200 ipv4: add new arguments to udp_tunnel_dst_lookup() We want to make the function more generic so that it can be used by other UDP tunnel implementations such as geneve and vxlan. To do that, add the following arguments: - source and destination UDP port; - ifindex of the output interface, needed by vxlan; - the tos, because in some cases it is not taken from struct ip_tunnel_info (for example, when it's inherited from the inner packet); - the dst cache, because not all tunnel types (e.g. vxlan) want to use the one from struct ip_tunnel_info. With these parameters, the function no longer needs the full struct ip_tunnel_info as argument and we can pass only the relevant part of it (struct ip_tunnel_key). Suggested-by: Guillaume Nault Signed-off-by: Beniamino Galvani Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 78f3655adcb52412275f282267ee771421731632 Author: Beniamino Galvani Date: Mon Oct 16 09:15:21 2023 +0200 ipv4: remove "proto" argument from udp_tunnel_dst_lookup() The function is now UDP-specific, the protocol is always IPPROTO_UDP. Suggested-by: Guillaume Nault Signed-off-by: Beniamino Galvani Reviewed-by: David Ahern Signed-off-by: David S. Miller commit bf3fcbf7e7a08015d3b169bad6281b29d45c272d Author: Beniamino Galvani Date: Mon Oct 16 09:15:20 2023 +0200 ipv4: rename and move ip_route_output_tunnel() At the moment ip_route_output_tunnel() is used only by bareudp. Ideally, other UDP tunnel implementations should use it, but to do so the function needs to accept new parameters that are specific for UDP tunnels, such as the ports. Prepare for these changes by renaming the function to udp_tunnel_dst_lookup() and move it to file net/ipv4/udp_tunnel_core.c. Suggested-by: Guillaume Nault Signed-off-by: Beniamino Galvani Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 3ee355dbc78d3dcb7f17a8b3c8eaaa38c54499b7 Author: Uwe Kleine-König Date: Sun Oct 8 22:01:43 2023 +0200 mtd: spi-nor: nxp-spifi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-21-u.kleine-koenig@pengutronix.de commit ac2bc659822e844d21361623c5964c5cddd01c60 Author: Uwe Kleine-König Date: Sun Oct 8 22:01:42 2023 +0200 mtd: spi-nor: hisi-sfc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-20-u.kleine-koenig@pengutronix.de commit e0748d6737e318ce390ca6e79abf7bf65c1de535 Author: Uwe Kleine-König Date: Sun Oct 8 22:01:40 2023 +0200 mtd: maps: sun_uflash: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-18-u.kleine-koenig@pengutronix.de commit 553cc00f3e31a4f4fc24869f420bb3f9a5d079ba Author: Uwe Kleine-König Date: Sun Oct 8 22:01:39 2023 +0200 mtd: maps: sa1100-flash: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-17-u.kleine-koenig@pengutronix.de commit a105291c90a5838b75c524a5c922b0431cd8d4f7 Author: Uwe Kleine-König Date: Sun Oct 8 22:01:38 2023 +0200 mtd: maps: pxa2xx-flash: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-16-u.kleine-koenig@pengutronix.de commit 677edf775512ef05f9dcba2f9245f50b250d68d8 Author: Uwe Kleine-König Date: Sun Oct 8 22:01:37 2023 +0200 mtd: maps: plat-ram: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-15-u.kleine-koenig@pengutronix.de commit b1dbe19b358ca9c36f370137ea6d15e6ae6cfd9e Author: Uwe Kleine-König Date: Sun Oct 8 22:01:36 2023 +0200 mtd: maps: physmap-core: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-14-u.kleine-koenig@pengutronix.de commit 5882bf98089f3a9ecbee5a57ae0aec6f54797855 Author: Uwe Kleine-König Date: Sun Oct 8 22:01:35 2023 +0200 mtd: maps: lantiq-flash: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-13-u.kleine-koenig@pengutronix.de commit 54600e40241395bd470fc02063f8f4d11155c12b Author: Uwe Kleine-König Date: Sun Oct 8 22:01:34 2023 +0200 mtd: lpddr2_nvm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-12-u.kleine-koenig@pengutronix.de commit baaa90c1c923ff2412fae0162eb66d036fd3be6b Author: Uwe Kleine-König Date: Sun Oct 8 22:01:33 2023 +0200 mtd: hyperbus: rpc-if: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-11-u.kleine-koenig@pengutronix.de commit 59bd56760df17506bc2f828f19b40a2243edd0d0 Author: Uwe Kleine-König Date: Sun Oct 8 22:01:32 2023 +0200 mtd: hyperbus: hbmc-am654: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-10-u.kleine-koenig@pengutronix.de commit 326563fdd37d9a5f26958122eb5f00d58daa7dd5 Author: Uwe Kleine-König Date: Sun Oct 8 22:01:31 2023 +0200 mtd: st_spi_fsm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-9-u.kleine-koenig@pengutronix.de commit 3401446fa40d621d067e3bbf9c8805325c9a21a6 Author: Uwe Kleine-König Date: Sun Oct 8 22:01:30 2023 +0200 mtd: spear_smi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-8-u.kleine-koenig@pengutronix.de commit 56b877dc5fd7503958d84b5341bc6f8704e5b41a Author: Uwe Kleine-König Date: Sun Oct 8 22:01:29 2023 +0200 mtd: powernv_flash: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-7-u.kleine-koenig@pengutronix.de commit 09a8b9ccffe7ff80cdd04930e0d2b45d34a19f74 Author: Uwe Kleine-König Date: Sun Oct 8 22:01:28 2023 +0200 mtd: phram: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-6-u.kleine-koenig@pengutronix.de commit eb0cec77d534413a800ec20944a2b1e37cfecdcf Author: Uwe Kleine-König Date: Sun Oct 8 22:01:27 2023 +0200 mtd: docg3: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-5-u.kleine-koenig@pengutronix.de commit 0e0672a5b83a7d53182733a604d67214d93256f9 Author: Uwe Kleine-König Date: Sun Oct 8 22:01:26 2023 +0200 mtd: bcm47xxsflash: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Acked-by: Tudor Ambarus Link: https://lore.kernel.org/linux-mtd/20231008200143.196369-4-u.kleine-koenig@pengutronix.de commit 5c2f7727d437cd42033d13ebc8b3d74b9fe65712 Author: Rafał Miłecki Date: Wed Sep 27 22:26:57 2023 +0200 mtd: mtdpart: check for subpartitions parsing result parse_mtd_partitions() may return an error so it should be checked and optionally passed up Signed-off-by: Rafał Miłecki Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230927202657.27169-1-zajec5@gmail.com commit 8baba8d52ff5081e8c3c383132af269ba8e2f458 Author: Simon Glass Date: Wed Sep 27 12:05:43 2023 -0600 dt-bindings: mtd: fixed-partitions: Add compression property Sometimes the contents of a partition are compressed. Add a property to express this and define the algorithm used. Signed-off-by: Simon Glass Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230927180545.3522628-1-sjg@chromium.org commit 0339f62a9a778bb7cd4f764cd4640cc89155177e Author: ZhaoLong Wang Date: Tue Sep 26 14:57:33 2023 +0800 mtd: Add WARN_ON_ONCE() to mtd_read() to check the return value If the driver cannot read all the requested data, -EBADMSG or -EUCLEAN should never be returned. Add a WARN_ON_ONCE() to help driver developers detect this error. Signed-off-by: ZhaoLong Wang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230926065733.3240322-1-wangzhaolong1@huawei.com commit e084a305aa7f42b5c065bd0def1eed63ccdfd1c1 Merge: 37d01395d9c80 cf98fe6b579e5 Author: Arnd Bergmann Date: Mon Oct 16 10:22:11 2023 +0200 Merge tag 'riscv-dt-for-v6.6-final' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into soc/dt RISC-V Devicetrees for v6.6-final A single fix for the Starfive VisionFive 2 platform so that chip select for SPI matches the vendor documentation. Signed-off-by: Conor Dooley * tag 'riscv-dt-for-v6.6-final' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux: riscv: dts: starfive: visionfive 2: correct spi's ss pin riscv: dts: starfive: visionfive 2: Fix uart0 pins sort order riscv: dts: starfive: visionfive 2: Enable usb0 riscv: dts: starfive: fix NOR flash reserved-data partition size Link: https://lore.kernel.org/r/20231015-outmatch-tragedy-228f91d396b5@spud Signed-off-by: Arnd Bergmann commit 3c4fe89878feb57bea6ad9f14997298fddf8dc10 Author: zhujun2 Date: Sun Oct 15 23:30:39 2023 -0700 selftests: net: remove unused variables These variables are never referenced in the code, just remove them Signed-off-by: zhujun2 Signed-off-by: David S. Miller commit fe2017ba24f318e5feef487b7552e40a3de2d50a Merge: dd976a97d15b4 58720809f5277 Author: Greg Kroah-Hartman Date: Mon Oct 16 10:18:49 2023 +0200 Merge 6.6-rc6 into tty-next We need the tty/serial fixes in here as well for testing, and this resolves merge conflicts in: drivers/tty/serial/serial_core.c as reported in linux-next Reported-by: Stephen Rothwell Signed-off-by: Greg Kroah-Hartman commit 101c6032031f4dba72b91e6c766e958a5e429622 Author: Christian Marangi Date: Thu Oct 12 11:14:29 2023 +0200 net: cxgb3: simplify logic for rspq_check_napi Simplify logic for rspq_check_napi. Drop redundant and wrong napi_is_scheduled call as it's not race free and directly use the output of napi_schedule to understand if a napi is pending or not. rspq_check_napi main logic is to check if is_new_response is true and check if a napi is not scheduled. The result of this function is then used to detect if we are missing some interrupt and act on top of this... With this knowing, we can rework and simplify the logic and make it less problematic with testing an internal bit for napi. Suggested-by: Eric Dumazet Signed-off-by: Christian Marangi Signed-off-by: David S. Miller commit cedc811c76778bdef91d405717acee0de54d8db5 Author: Vasant Hegde Date: Mon Oct 16 05:13:05 2023 +0000 iommu/amd: Remove DMA_FQ type from domain allocation path .. as drivers won't see DMA_FQ any more. See commit a4fdd9762272 ("iommu: Use flush queue capability") for details. Suggested-by: Robin Murphy Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20231016051305.13091-1-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 058b4d9de86b3f77cd23fbd43a0f5ee4ea8e0aeb Author: Dan Carpenter Date: Wed Oct 11 11:01:21 2023 +0300 iommu: change iommu_map_sgtable to return signed values The iommu_map_sgtable() function returns ssize_t and negative error codes but it's declared as size_t instead. I think that static checkers would have complained if this caused a bug, but even though it doesn't cause a bug, it's definitely worth fixing. Signed-off-by: Dan Carpenter Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/06672b96-23fd-424c-8880-1626e7bf119c@moroto.mountain Signed-off-by: Joerg Roedel commit 9e13ec61de2a51195b122a79461431d8cb99d7b5 Author: Gustavo A. R. Silva Date: Mon Oct 9 12:24:27 2023 -0600 iommu/virtio: Add __counted_by for struct viommu_request and use struct_size() Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). While there, use struct_size() helper, instead of the open-coded version, to calculate the size for the allocation of the whole flexible structure, including of course, the flexible-array member. This code was found with the help of Coccinelle, and audited and fixed manually. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Jean-Philippe Brucker Reviewed-by: Justin Stitt Link: https://lore.kernel.org/r/ZSRFW0yDlDo8+at3@work Signed-off-by: Joerg Roedel commit 2b437e80456654df3980706384065d444f4bb54d Author: Jingqi Liu Date: Mon Oct 16 11:28:30 2023 +0800 iommu/vt-d: debugfs: Support dumping a specified page table The original debugfs only dumps all page tables without pasid. With pasid supported, the page table with pasid also needs to be dumped. This patch supports dumping a specified page table in legacy mode or scalable mode with or without a specified pasid. For legacy mode, according to bus number and DEVFN, traverse the root table and context table to get the pointer of page table in the context table entry, then dump the specified page table. For scalable mode, according to bus number, DEVFN and pasid, traverse the root table, context table, pasid directory and pasid table to get the pointer of page table in the pasid table entry, then dump the specified page table.. Examples are as follows: 1) Dump the page table of device "0000:00:1f.0" that only supports legacy mode. $ sudo cat /sys/kernel/debug/iommu/intel/0000:00:1f.0/domain_translation_struct 2) Dump the page table of device "0000:00:0a.0" with PASID "1" that supports scalable mode. $ sudo cat /sys/kernel/debug/iommu/intel/0000:00:0a.0/1/domain_translation_struct Suggested-by: Kevin Tian Signed-off-by: Jingqi Liu Link: https://lore.kernel.org/r/20231013135811.73953-4-Jingqi.liu@intel.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit d87731f609318a27e9aa3d01cf97798599d32839 Author: Jingqi Liu Date: Mon Oct 16 11:28:29 2023 +0800 iommu/vt-d: debugfs: Create/remove debugfs file per {device, pasid} Add a debugfs directory per pair of {device, pasid} if the mappings of its page table are created and destroyed by the iommu_map/unmap() interfaces. i.e. /sys/kernel/debug/iommu/intel//. Create a debugfs file in the directory for users to dump the page table corresponding to {device, pasid}. e.g. /sys/kernel/debug/iommu/intel/0000:00:02.0/1/domain_translation_struct. For the default domain without pasid, it creates a debugfs file in the debugfs device directory for users to dump its page table. e.g. /sys/kernel/debug/iommu/intel/0000:00:02.0/domain_translation_struct. When setting a domain to a PASID of device, create a debugfs file in the pasid debugfs directory for users to dump the page table of the specified pasid. Remove the debugfs device directory of the device when releasing a device. e.g. /sys/kernel/debug/iommu/intel/0000:00:01.0 Signed-off-by: Jingqi Liu Link: https://lore.kernel.org/r/20231013135811.73953-3-Jingqi.liu@intel.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit e8aa45f8cc2c3afe2a3608ea7220bbdb516bef07 Author: Jingqi Liu Date: Mon Oct 16 11:28:28 2023 +0800 iommu/vt-d: debugfs: Dump entry pointing to huge page For the page table entry pointing to a huge page, the data below the level of the huge page is meaningless and does not need to be dumped. Signed-off-by: Jingqi Liu Link: https://lore.kernel.org/r/20231013135811.73953-2-Jingqi.liu@intel.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit c61c255e114c52682546447ed44d3470b5708134 Author: Jiapeng Chong Date: Mon Oct 16 11:28:27 2023 +0800 iommu/vt-d: Remove unused function The function are defined in the pasid.c file, but not called elsewhere, so delete the unused function. drivers/iommu/intel/pasid.c:342:20: warning: unused function 'pasid_set_wpe'. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6185 Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20230818091603.64800-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit aa5cabc4ce8e6b45d170d162dc54b1bac1767c47 Merge: 6465e260f4879 548650921e617 Author: Joerg Roedel Date: Mon Oct 16 09:33:07 2023 +0200 Merge tag 'arm-smmu-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into arm/smmu Arm SMMU updates for 6.7 - Device-tree binding update: * Add qcom,sm7150-smmu-v2 for Adreno on SM7150 SoC - SMMUv2: * Support for Qualcomm SDM670 (MDSS) and SM7150 SoCs - SMMUv3: * Large refactoring of the context descriptor code to move the CD table into the master, paving the way for '->set_dev_pasid()' support on non-SVA domains * Minor cleanups to the SVA code commit c1939c2f76d7971b0a02cad0d1d1e9d44ac37cfc Author: Uwe Kleine-König Date: Sat Oct 14 23:16:57 2023 +0200 dmaengine: xilinx: xilinx_dma: Fix kernel doc about xilinx_dma_remove() Since commit cc99582d46b4 ("dmaengine: xilinx: xilinx_dma: Convert to platform remove callback returning void") xilinx_dma_remove() doesn't return zero any more. As the function has no return value any more, just drop the statement about the return value. Reported-by: Radhey Shyam Pandey Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231014211656.1512016-2-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 3774740fb22162d2c50e79629c4b3e11022ed7d9 Author: Alexander Stein Date: Fri Oct 13 08:30:08 2023 +0200 eeprom: at24: add ST M24C64-D Additional Write lockable page support The ST M24C64-D behaves as a regular M24C64, except for the -D variant which uses up another I2C address for Additional Write lockable page. This page is 32 Bytes long and can contain additional data. Add entry for it, so users can describe that page in DT. Note that users still have to describe the main M24C64 area separately as that is on separate I2C address from this page. Signed-off-by: Alexander Stein Reviewed-by: Marek Vasut Signed-off-by: Bartosz Golaszewski commit 0997ff1fc14369110a5bbfa93592f28e3b1d3a1f Author: Alexander Stein Date: Fri Oct 13 08:30:07 2023 +0200 dt-bindings: at24: add ST M24C64-D Additional Write lockable page The ST M24C64-D behaves as a regular M24C64, except for the -D variant which uses up another I2C address for Additional Write lockable page. This page is 32 Bytes long and can contain additional data. Document compatible string for it, so users can describe that page in DT. Note that users still have to describe the main M24C64 area separately as that is on separate I2C address from this page. Signed-off-by: Alexander Stein Reviewed-by: Marek Vasut Acked-by: Conor Dooley Signed-off-by: Bartosz Golaszewski commit 7971debdfd37f4a744d7d34fbddd19eb360b11a7 Merge: d32ce5ab7b52e a6028afef98a6 Author: Dave Airlie Date: Mon Oct 16 16:44:43 2023 +1000 Merge tag 'drm-intel-next-2023-10-12' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 feature pull #2 for v6.7: Features and functionality: - Preparation for i915 display code reuse in upcoming Xe driver (Jani) - Drop the fastboot module parameter and use the platform defaults (Arun) - Enable new LNL FBC features (Vinod) - Add LNL display feature capability reads (Vinod) Refactoring and cleanups: - Locally enable W=1 warnings by default in i915 (Jani) - Move HDCP GSC message code to a separate file (Suraj) - GVT include cleanups (Jani) - Move more display init under display/ (Jani) - DPLL ID refactoring (Ville) - Better abstraction of GT0 (Jani) - Move VGA decode function to GMCH code (Uma) - Use local64_try_cmpxchg() to optimize PMU event read (Uros Bizjak) - Clean up FBC checks (Ville) - Constify and unify state checker calling conventions (Ville) - Add display step name helper (Chaitanya) Documentation: - Update CCS and GSC CS documentation (Rodrigo) - Fix a number of documentation typos (Randy Dunlap) Fixes: - VLV DSI fixes and quirks (Hans) - Fix crtc state memory leaks (Suraj) - Increase LSPCON mode settle timeout (Niko Tsirakis) - Stop clobbering old crtc state during state check (Ville) - Fix VLV color state readout (Ville) - Fix cx0 PHY pipe reset to allow S0iX (Khaled) - Ensure DP MST pbn_div is up-to-date after sink reconnect (Imre) - Drop an unnecessary NULL check to fix static analyzer warning (Suraj) - Use an explicit rather than implicit include for frontbuffer tracking (Jouni) Merges: - Backmerge drm-next to fix a conflict (Jani) Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87r0m00xew.fsf@intel.com commit 2516fde1fa00cf92e0932182c4b315df3de41806 Author: Vinicius Costa Gomes Date: Thu Aug 31 16:22:24 2023 -0700 apparmor: Optimize retrieving current task secid When running will-it-scale[1] open2_process testcase, in a system with a large number of cores, a bottleneck in retrieving the current task secid was detected: 27.73% ima_file_check;do_open (inlined);path_openat;do_filp_open;do_sys_openat2;__x64_sys_openat;do_syscall_x64 (inlined);do_syscall_64;entry_SYSCALL_64_after_hwframe (inlined);__libc_open64 (inlined) 27.72% 0.01% [kernel.vmlinux] [k] security_current_getsecid_subj - - 27.71% security_current_getsecid_subj;ima_file_check;do_open (inlined);path_openat;do_filp_open;do_sys_openat2;__x64_sys_openat;do_syscall_x64 (inlined);do_syscall_64;entry_SYSCALL_64_after_hwframe (inlined);__libc_open64 (inlined) 27.71% 27.68% [kernel.vmlinux] [k] apparmor_current_getsecid_subj - - 19.94% __refcount_add (inlined);__refcount_inc (inlined);refcount_inc (inlined);kref_get (inlined);aa_get_label (inlined);aa_get_label (inlined);aa_get_current_label (inlined);apparmor_current_getsecid_subj;security_current_getsecid_subj;ima_file_check;do_open (inlined);path_openat;do_filp_open;do_sys_openat2;__x64_sys_openat;do_syscall_x64 (inlined);do_syscall_64;entry_SYSCALL_64_after_hwframe (inlined);__libc_open64 (inlined) 7.72% __refcount_sub_and_test (inlined);__refcount_dec_and_test (inlined);refcount_dec_and_test (inlined);kref_put (inlined);aa_put_label (inlined);aa_put_label (inlined);apparmor_current_getsecid_subj;security_current_getsecid_subj;ima_file_check;do_open (inlined);path_openat;do_filp_open;do_sys_openat2;__x64_sys_openat;do_syscall_x64 (inlined);do_syscall_64;entry_SYSCALL_64_after_hwframe (inlined);__libc_open64 (inlined) A large amount of time was spent in the refcount. The most common case is that the current task label is available, and no need to take references for that one. That is exactly what the critical section helpers do, make use of them. New perf output: 39.12% vfs_open;path_openat;do_filp_open;do_sys_openat2;__x64_sys_openat;do_syscall_64;entry_SYSCALL_64_after_hwframe;__libc_open64 (inlined) 39.07% 0.13% [kernel.vmlinux] [k] do_dentry_open - - 39.05% do_dentry_open;vfs_open;path_openat;do_filp_open;do_sys_openat2;__x64_sys_openat;do_syscall_64;entry_SYSCALL_64_after_hwframe;__libc_open64 (inlined) 38.71% 0.01% [kernel.vmlinux] [k] security_file_open - - 38.70% security_file_open;do_dentry_open;vfs_open;path_openat;do_filp_open;do_sys_openat2;__x64_sys_openat;do_syscall_64;entry_SYSCALL_64_after_hwframe;__libc_open64 (inlined) 38.65% 38.60% [kernel.vmlinux] [k] apparmor_file_open - - 38.65% apparmor_file_open;security_file_open;do_dentry_open;vfs_open;path_openat;do_filp_open;do_sys_openat2;__x64_sys_openat;do_syscall_64;entry_SYSCALL_64_after_hwframe;__libc_open64 (inlined) The result is a throughput improvement of around 20% across the board on the open2 testcase. On more realistic workloads the impact should be much less. [1] https://github.com/antonblanchard/will-it-scale Signed-off-by: Vinicius Costa Gomes Signed-off-by: John Johansen commit fee5304a9c820bd12bd40b1f2591f8e2be0ccbcf Author: Xiu Jianfeng Date: Thu Aug 10 20:10:56 2023 +0000 apparmor: remove unused functions in policy_ns.c/.h These functions are not used now, remove them. Signed-off-by: Xiu Jianfeng Signed-off-by: John Johansen commit 5ebb39eb90376fbf098df04be8b58f235a14ce5a Author: Xiu Jianfeng Date: Wed Aug 9 10:02:44 2023 +0000 apparmor: remove unneeded #ifdef in decompress_zstd() The whole function is guarded by CONFIG_SECURITY_APPARMOR_EXPORT_BINARY, so the #ifdef here is redundant, remove it. Signed-off-by: Xiu Jianfeng Signed-off-by: John Johansen commit e2f57bf827697964ccacef5f69decc050f7d9e24 Author: Alexandre Belloni Date: Mon Oct 16 06:18:16 2023 +0200 rtc: at91rm9200: annotate at91_rtc_remove with __exit again Having the driver as a builtin after dropping the __exit annotation results in: >> drivers/rtc/rtc-at91rm9200.c:561:13: warning: 'at91_rtc_remove' defined but not used [-Wunused-function] 561 | static void at91_rtc_remove(struct platform_device *pdev) | ^~~~~~~~~~~~~~~ Reported-by: Stephen Rothwell Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310160705.vlElNOGb-lkp@intel.com/ Link: https://lore.kernel.org/r/20231016041816.246426-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit dce13a235a356363faf9385ba34681d9fc689f1a Author: Rohit Agarwal Date: Fri Jun 9 17:20:37 2023 +0530 dt-bindings: cpufreq: cpufreq-qcom-hw: Add SDX75 compatible Add compatible for EPSS CPUFREQ-HW on SDX75. Signed-off-by: Rohit Agarwal Acked-by: Krzysztof Kozlowski Acked-by: Manivannan Sadhasivam Signed-off-by: Viresh Kumar commit d79eed22ba97c3031b2ef86f8b7ed0be2da5667d Author: Nava kishore Manne Date: Tue Oct 3 12:44:09 2023 +0530 fpga: versal: Add support for 44-bit DMA operations The existing implementation support only 32-bit DMA operation. So, it fails to load the bitstream for the high DDR designs(Beyond 4GB). To fix this issue update the DMA mask handling logic to support 44-bit DMA operations. Signed-off-by: Nava kishore Manne Reviewed-by: Radhey Shyam Pandey Acked-by: Xu Yilun Link: https://lore.kernel.org/r/20231003071409.4165149-1-nava.kishore.manne@amd.com Signed-off-by: Xu Yilun commit 3b08f52c256189b7c0d5cf1a031fa464ec20393b Author: Rob Herring Date: Fri Oct 6 17:46:24 2023 -0500 fpga: altera-ps-spi: Use spi_get_device_match_data() Use preferred spi_get_device_match_data() instead of of_match_device() and spi_get_device_id() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Also drop of_match_ptr for of_ef_match, which is not necessary because DT is always used for this driver. Signed-off-by: Rob Herring Acked-by: Xu Yilun Link: https://lore.kernel.org/r/20231006224624.444857-1-robh@kernel.org [yilun.xu@intel.com: drop of_match_ptr for of_ef_match] Signed-off-by: Xu Yilun commit d32ce5ab7b52e372c40bf792b53853934000a33f Merge: 389af786f92ec c395c83aafbb9 Author: Dave Airlie Date: Mon Oct 16 10:40:31 2023 +1000 Merge tag 'drm-misc-next-2023-10-12' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v6.7-rc1: Contains the previous pull request drm-misc-next-2023-10-06 + following: Cross-subsystem Changes: - Rename fb_pgprot to pgprot_framebuffer and remove file argument/ - Update iosys-map documentation typos. Core Changes: - Assorted fixes to drm/panel. - Add HPD state to drm_connector_oob_hotplug_event(), and implement oob hotplug events in bridge connector. - Replace drm_framebuffer_plane_width/height with calls to drm_format_info_plane_width/height. Driver Changes: - Clock and debug fixes for bridge/samsung-dsim. - More btree -> maple tree conversions. - Assorted bugfixes in rockchip, panel-tpo-tpg110, - Add LTK050H3148W-CTA6 panel support. - Assorted small fixes in host1x, tegra, simpledrm. - Suspend fixes for host1x. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/3812345e-b086-4d72-8504-f58d84e8feab@linux.intel.com commit c18119dee1919ce60565efd85f63707ceae38420 Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:24 2023 +0200 drm/mediatek: gamma: Improve and simplify HW LUT calculation Use drm_color_lut_extract() to avoid open-coding the bits reduction calculations for each color channel and use a struct drm_color_lut to temporarily store the information instead of an array of u32. Also, slightly improve the precision of the HW LUT calculation in the LUT DIFF case by performing the subtractions on the 16-bits values and doing the 10 bits conversion later. Reviewed-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat Reviewed-by: CK Hu Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-5-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit d243907bb42f6652d88f9f3023d1028a34971465 Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:23 2023 +0200 drm/mediatek: gamma: Support SoC specific LUT size Newer SoCs support a bigger Gamma LUT table: wire up a callback to retrieve the correct LUT size for each different Gamma IP. Co-developed-by: Jason-JH.Lin Signed-off-by: Jason-JH.Lin [Angelo: Rewritten commit message/description + porting] Reviewed-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat Reviewed-by: CK Hu Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-4-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit aa5fb24f971dd4b27a4e16fe7c054d052e0f8030 Author: AngeloGioacchino Del Regno Date: Thu Oct 12 11:57:22 2023 +0200 drm/mediatek: gamma: Reduce indentation in mtk_gamma_set_common() Invert the check for state->gamma_lut and move it at the beginning of the function to reduce indentation: this prepares the code for keeping readability on later additions. This commit brings no functional changes. Reviewed-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat Reviewed-by: CK Hu Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-3-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 1c5a880a2a4c2e24163f06b9dd76e18d8217f5c1 Author: Jason-JH.Lin Date: Thu Oct 12 11:57:21 2023 +0200 drm/mediatek: gamma: Adjust mtk_drm_gamma_set_common parameters Adjust the parameters in mtk_drm_gamma_set_common() - add (struct device *dev) to get lut_diff from gamma's driver data - remove (bool lut_diff) and use false as default value in the function Signed-off-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat Reviewed-by: CK Hu Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20231012095736.100784-2-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu commit 2da4c5e24e86313fc09596ae775123b41055fd54 Author: Damien Le Moal Date: Thu Oct 12 15:56:34 2023 +0900 ata: libata-core: Improve ata_dev_power_set_active() Improve the function ata_dev_power_set_active() by having it do nothing for a disk that is already in the active power state. To do that, introduce the function ata_dev_power_is_active() to test the current power state of the disk and return true if the disk is in the PM0: active or PM1: idle state (0xff value for the count field of the CHECK POWER MODE command output). To preserve the existing behavior, if the CHECK POWER MODE command issued in ata_dev_power_is_active() fails, the drive is assumed to be in standby mode and false is returned. With this change, issuing the VERIFY command to access the disk media to spin it up becomes unnecessary most of the time during system resume as the port reset done by libata-eh on resume often result in the drive to spin-up (this behavior is not clearly defined by the ACS specifications and may thus vary between disk models). Signed-off-by: Damien Le Moal Tested-by: Geert Uytterhoeven Reviewed-by: Niklas Cassel commit 5368084c39369f31ef026565b676791b5b38e6a5 Author: Thierry Reding Date: Fri Oct 13 17:51:04 2023 +0200 thermal/drivers/max77620: Remove duplicate error message The thermal_of_zone_register() function already prints an error message when appropriate, so remove the extra one from the MAX77620 thermal driver. This fixes a spurious error message when no thermal zone was defined for the MAX77620 in device tree. Reported-by: Nicolas Chauvet Signed-off-by: Thierry Reding Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20231013155104.1781197-1-thierry.reding@gmail.com commit e9cdce582390ade0429f76c2251d7bc65ec52f10 Author: Alexander Stein Date: Thu Oct 12 10:00:33 2023 +0200 dt-bindings: timer: add imx7d compatible Currently the dtbs_check for imx6ul generates warnings like this: ['fsl,imx7d-gpt', 'fsl,imx6sx-gpt'] is too long The driver has no special handling for fsl,imx7d-gpt, so fsl,imx6sx-gpt is used. Therefore make imx7d GPT compatible to the imx6sx one to fix the warning. Signed-off-by: Alexander Stein Acked-by: Conor Dooley Reviewed-by: Rob Herring Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20231012080033.2715241-4-alexander.stein@ew.tq-group.com commit 438a15b16f6140b521371468d2bf31f45ca96767 Author: Alexander Stein Date: Thu Oct 12 10:00:32 2023 +0200 dt-bindings: net: microchip: Allow nvmem-cell usage MAC address can be provided by a nvmem-cell, thus allow referencing a source for the address. Fixes the warning: arch/arm/boot/dts/nxp/imx/imx6q-mba6a.dtb: ethernet@1: 'nvmem-cell-names', 'nvmem-cells' do not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/net/microchip,lan95xx.yaml Signed-off-by: Alexander Stein Acked-by: Conor Dooley Reviewed-by: Rob Herring Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20231012080033.2715241-3-alexander.stein@ew.tq-group.com commit 98bcee251e608345c272fd89bccd948071fc0bf5 Author: Alexander Stein Date: Thu Oct 12 10:00:31 2023 +0200 dt-bindings: imx-thermal: Add #thermal-sensor-cells property This property is defined in thermal-sensor.yaml. Reference this file and constraint '#thermal-sensor-cells' to 0 for imx-thermal. Fixes the warning: arch/arm/boot/dts/nxp/imx/imx6q-mba6a.dtb: tempmon: '#thermal-sensor-cells' does not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/thermal/imx-thermal.yaml Signed-off-by: Alexander Stein Acked-by: Conor Dooley Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20231012080033.2715241-2-alexander.stein@ew.tq-group.com commit 50ab53095326d4aa56a5a7e5f2ebc1568b4924a8 Author: Priyansh Jain Date: Tue Sep 26 14:29:47 2023 +0530 dt-bindings: thermal: tsens: Add sa8775p compatible Add compatibility string for the thermal sensors on sa8775p platform. Signed-off-by: Priyansh Jain Acked-by: Krzysztof Kozlowski Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230926085948.23046-2-quic_priyjain@quicinc.com commit 2ffa39c83b39f555d9a61daec3ed1cc79c4ba7ef Author: Minjie Du Date: Thu Sep 21 17:10:50 2023 +0800 thermal/drivers/mediatek/lvts_thermal: Fix error check in lvts_debugfs_init() debugfs_create_dir() function returns an error value embedded in the pointer (PTR_ERR). Evaluate the return value using IS_ERR rather than checking for NULL. Signed-off-by: Minjie Du Reviewed-by: Alexandre Mergnat Reviewed-by: Chen-Yu Tsai Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230921091057.3812-1-duminjie@vivo.com commit de84da588f35423c5c2e6a46f2bc8a07f8eaf793 Author: Kuan-Wei Chiu Date: Wed Sep 27 01:37:36 2023 +0800 tools/thermal: Remove unused 'mds' and 'nrhandler' variables In the previous code, the 'mds' and 'nrhandler' variables were not utilized in the codebase. Additionally, there was a potential NULL pointer dereference and memory leak due to improper handling of memory reallocation failure. This patch removes the unused 'mds' and 'nrhandler' variables along with the associated code, addressing the unused variable issue, NULL pointer dereference issue and the memory leak issue. Signed-off-by: Kuan-Wei Chiu Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230926173736.1142420-1-visitorckw@gmail.com commit ebd1dea94b2e9b60ca8630c7de7602bae08d401d Author: Fabio Estevam Date: Tue Sep 26 09:29:54 2023 -0300 dt-bindings: thermal: fsl,scu-thermal: Document imx8dl imx8dxl also contains the SCU thermal block. Add an entry for 'fsl,imx8dxl-sc-thermal'. Cc: Rafael J. Wysocki Cc: Daniel Lezcano Cc: Amit Kucheria Signed-off-by: Fabio Estevam Acked-by: Conor Dooley Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230926122957.341094-5-festevam@gmail.com commit f84f6e0f4588650e22543376d3333d65d578ff73 Author: Bragatheswaran Manickavel Date: Sun Sep 17 14:04:43 2023 +0530 thermal/drivers/imx8mm_thermal: Fix function pointer declaration by adding identifier name Added identifier names to respective definitions for fix warnings reported by checkpatch.pl WARNING: function definition argument 'void *' should also have an identifier name WARNING: function definition argument 'int *' should also have an identifier name Signed-off-by: Bragatheswaran Manickavel Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230917083443.3220-1-bragathemanick0908@gmail.com commit 6644c6291eec478874c9c4591282746da893bca5 Author: Rob Herring Date: Tue Sep 26 11:44:52 2023 -0500 dt-bindings: thermal: nvidia,tegra124-soctherm: Add missing unevaluatedProperties on child node schemas Just as unevaluatedProperties or additionalProperties are required at the top level of schemas, they should (and will) also be required for child node schemas. That ensures only documented properties are present for any node. Add unevaluatedProperties as needed, and then add any missing properties flagged by the addition. Signed-off-by: Rob Herring Acked-by: Conor Dooley Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230926164500.101593-1-robh@kernel.org commit 585e92e6a79f2de0e9356ee399891a5fa3c0fbbf Author: Frank Wunderlich Date: Fri Sep 22 07:50:20 2023 +0200 thermal/drivers/mediatek/lvts_thermal: Add mt7988 support Add Support for Mediatek Filogic 880/MT7988 LVTS. Signed-off-by: Frank Wunderlich Tested-by: Daniel Golle Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230922055020.6436-5-linux@fw-web.de commit 6725a29321e48b1dece66fc1ba7b458f0c1d6d77 Author: Frank Wunderlich Date: Fri Sep 22 07:50:19 2023 +0200 thermal/drivers/mediatek/lvts_thermal: Make coeff configurable The upcoming mt7988 has different temperature coefficients so we cannot use constants in the functions lvts_golden_temp_init, lvts_golden_temp_init and lvts_raw_to_temp anymore. Add a field in the lvts_ctrl pointing to the lvts_data which now contains the soc-specific temperature coefficents. To make the code better readable, rename static int coeff_b to golden_temp_offset, COEFF_A to temp_factor and COEFF_B to temp_offset. Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno Tested-by: Daniel Golle Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230922055020.6436-4-linux@fw-web.de commit be2cc09bd5b46f13629d4fcdeac7ad1b18bb1a0b Author: Frank Wunderlich Date: Fri Sep 22 07:50:18 2023 +0200 dt-bindings: thermal: mediatek: Add LVTS thermal sensors for mt7988 Add sensor constants for MT7988. Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno Acked-by: Conor Dooley Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230922055020.6436-3-linux@fw-web.de commit d8b877d60d77a5989061ebed7d6a84850f89d23b Author: Frank Wunderlich Date: Fri Sep 22 07:50:17 2023 +0200 dt-bindings: thermal: mediatek: Add mt7988 lvts compatible Add compatible string for mt7988 lvts application processor. Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230922055020.6436-2-linux@fw-web.de commit c28ca80ba3b531a79402d61046aef83272f86b08 Author: Nikita Shubin Date: Fri Sep 15 11:10:54 2023 +0300 clocksource: ep93xx: Add driver for Cirrus Logic EP93xx Rewrite EP93xx timer driver located in arch/arm/mach-ep93xx/timer-ep93xx.c trying to do everything the device tree way: - Make every IO-access relative to a base address and dynamic so we can do a dynamic ioremap and get going. - Find register range and interrupt from the device tree. Reviewed-by: Linus Walleij Tested-by: Alexander Sverdlin Signed-off-by: Nikita Shubin Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230915-ep93xx-v4-12-a1d779dcec10@maquefel.me commit 81824f7c8fb0485a5007bf0e60718afdecdef60c Author: Nikita Shubin Date: Fri Sep 15 11:10:53 2023 +0300 dt-bindings: timers: Add Cirrus EP93xx Add device tree bindings for the Cirrus Logic EP93xx timer block used in these SoCs. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Nikita Shubin Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230915-ep93xx-v4-11-a1d779dcec10@maquefel.me commit dc71c03b0a2937545d2c6ff89d2275890a309618 Author: Marek Vasut Date: Thu Sep 21 21:26:04 2023 +0200 dt-bindings: rtc: microcrystal,rv3032: Document wakeup-source property The RV3032 can be used as a wake-up source, document the 'wakeup-source' property as allowed property. Signed-off-by: Marek Vasut Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230921192604.70944-1-marex@denx.de Signed-off-by: Alexandre Belloni commit 539cbe1b81f44e13103795e41f2e000fdc170859 Author: Fabio Estevam Date: Tue Sep 5 19:08:26 2023 -0300 dt-bindings: rtc: pcf8523: Convert to YAML Convert the PCF8523 bindings from text format to YAML. The YAML format is preferred as it allows validation. Signed-off-by: Fabio Estevam Reviewed-by: Sam Ravnborg Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230905220826.79901-1-festevam@gmail.com Signed-off-by: Alexandre Belloni commit cf3cce410adeee6fe4aa74a1b629135acce958d4 Author: Javier Carrasco Date: Wed Sep 6 15:34:06 2023 +0200 dt-bindings: rtc: mcp795: move to trivial-rtc The current mcp795 bindings in text format do not support validation and are missing the optional interrupt property that is currently supported. Adding the missing property makes the bindings identical to the existing trivial-rtc bindings. Add maxim,mcp795 to the trivial-rtc bindings and delete current .txt bindings Signed-off-by: Javier Carrasco Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230906-topic-rtc_mcp795_yaml-v3-1-5262f1b39920@gmail.com Signed-off-by: Alexandre Belloni commit 1d70f9fe5f1c8fbd5d838223b8aec27c69a7e609 Author: Nikita Shubin Date: Fri Sep 15 11:10:56 2023 +0300 rtc: ep93xx: add DT support for Cirrus EP93xx Add OF ID match table. Reviewed-by: Andy Shevchenko Signed-off-by: Nikita Shubin Link: https://lore.kernel.org/r/20230915-ep93xx-v4-14-a1d779dcec10@maquefel.me Signed-off-by: Alexandre Belloni commit 207bddd97881913bcb8bef84737c0971e712fbee Author: Nikita Shubin Date: Fri Sep 15 11:10:55 2023 +0300 dt-bindings: rtc: Add Cirrus EP93xx Add device tree bindings for the Cirrus Logic EP93xx RTC block used in these SoCs. Signed-off-by: Nikita Shubin Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230915-ep93xx-v4-13-a1d779dcec10@maquefel.me Signed-off-by: Alexandre Belloni commit fdaf4c5acf268bfcc455d8c2ab775cd54317c788 Author: Javier Carrasco Date: Thu Sep 14 11:07:59 2023 +0200 dt-bindings: rtc: pcf2123: convert to YAML Convert the existing txt binding to the preferred YAML format. The pcf2123 node may contain SPI settings such as spi-cs-high and spi-max-frequency, which keeps it from being added to the trivial-rtc binding with its current definition. Add a reference to spi-peripheral-props.yaml to account for that. The "interrupts" property was missing in the binding although it is already supported. Add the missing property in the new binding. Signed-off-by: Javier Carrasco Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230907-topic-pcf2123_yaml-v2-1-ea87a8e12190@gmail.com Signed-off-by: Alexandre Belloni commit f5f4c982f7c8a8cffb2663078a40ecd7d82b534d Author: Maxim Korotkov Date: Fri Oct 6 12:04:44 2023 +0300 rtc: efi: fixed typo in efi_procfs() After the first check of the value of the "eft" variable it does not change, it is obvious that a copy-paste error was made here and the value of variable "alm" should be checked here. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 501385f2a783 ("rtc: efi: add efi_procfs in efi_rtc_ops") Signed-off-by: Maxim Korotkov Link: https://lore.kernel.org/r/20231006090444.306729-1-korotkov.maxim.s@gmail.com Signed-off-by: Alexandre Belloni commit 3c8bdc20a44fd0126e331e0623e7daf00d186135 Author: Rob Herring Date: Mon Oct 9 16:13:42 2023 -0500 rtc: omap: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231009211356.3242037-12-robh@kernel.org Signed-off-by: Alexandre Belloni commit 2be36c09b6b07306be33519e1aa70d2e2a2161bb Author: Javier Carrasco Date: Fri Oct 13 16:34:21 2023 +0200 rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call The current implementation passes PIN_IO_INTA_OUT (2) as a mask and PIN_IO_INTAPM (GENMASK(1, 0)) as a value. Swap the variables to assign mask and value the right way. This error was first introduced with the alarm support. For better or worse it worked as expected because 0x02 was applied as a mask to 0x03, resulting 0x02 anyway. This will of course not work for any other value. Fixes: e5aac267a10a ("rtc: pcf85363: add alarm support") Signed-off-by: Javier Carrasco Link: https://lore.kernel.org/r/20231013-topic-pcf85363_regmap_update_bits-v1-1-c454f016f71f@gmail.com Signed-off-by: Alexandre Belloni commit 8c767e9c1ef40c9fa73276df801251cef895b569 Author: Linus Walleij Date: Tue Oct 10 21:42:12 2023 +0200 rtc: rtc7301: Support byte-addressed IO The old RTC7301 driver in OpenWrt used byte access, but the current mainline Linux driver uses 32bit word access. Make this configurable using device properties using the standard property "reg-io-width" in e.g. device tree. This is needed for the USRobotics USR8200 which has the chip connected using byte accesses. Debugging and testing by Howard Harte. Signed-off-by: Linus Walleij Reviewed-by: Akinobu Mita Link: https://lore.kernel.org/r/20231010-rtc-7301-regwidth-v3-2-ade586b62794@linaro.org Signed-off-by: Alexandre Belloni commit 5ded578a18c9515c2c0e1cd148ca42133bbcf055 Author: Linus Walleij Date: Tue Oct 10 21:42:11 2023 +0200 rtc: rtc7301: Rewrite bindings in schema This rewrites the Epson RTC7301 bindings to use YAML schema, and adds a property for "reg-io-width" as used in several other bindings to account for different register strides. The USRobotics USR8200 uses the byte IO width. Reviewed-by: Rob Herring Signed-off-by: Linus Walleij Reviewed-by: Akinobu Mita Link: https://lore.kernel.org/r/20231010-rtc-7301-regwidth-v3-1-ade586b62794@linaro.org Signed-off-by: Alexandre Belloni commit a7135d10754760f0c038497b44c2c2f2b0fb5651 Author: Matthew Maurer Date: Thu Sep 28 20:14:20 2023 +0000 rust: Use grep -Ev rather than relying on GNU grep While GNU grep supports '\|' when in basic regular expression mode, not all grep implementations do (notably toybox grep, used to build the Android kernel, does not). Switching to grep -Ev enables extended regular expressions which includes support for the '|' operator. Signed-off-by: Matthew Maurer Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Trevor Gross Reviewed-by: Alice Ryhl Tested-by: Alice Ryhl Link: https://lore.kernel.org/r/20230928201421.2296518-1-mmaurer@google.com [ Reworded for typo. ] Signed-off-by: Miguel Ojeda commit 45f97e6385cad6d0e48a27ddcd08793bb4d35851 Author: Matthew Maurer Date: Thu Sep 28 20:49:25 2023 +0000 rust: Use awk instead of recent xargs `awk` is already required by the kernel build, and the `xargs` feature used in current Rust detection is not present in all `xargs` (notably, toybox based xargs, used in the Android kernel build). Signed-off-by: Matthew Maurer Reviewed-by: Alice Ryhl Tested-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Link: https://lore.kernel.org/r/20230928205045.2375899-1-mmaurer@google.com Signed-off-by: Miguel Ojeda commit e08ff622c91af997cb89bc47e90a1a383e938bd0 Author: Miguel Ojeda Date: Thu Oct 5 23:05:55 2023 +0200 rust: upgrade to Rust 1.73.0 This is the next upgrade to the Rust toolchain, from 1.72.1 to 1.73.0 (i.e. the latest) [1]. See the upgrade policy [2] and the comments on the first upgrade in commit 3ed03f4da06e ("rust: upgrade to Rust 1.68.2"). # Unstable features No unstable features (that we use) were stabilized. Therefore, the only unstable feature allowed to be used outside the `kernel` crate is still `new_uninit`, though other code to be upstreamed may increase the list. Please see [3] for details. # Required changes For the upgrade, the following changes are required: - Allow `internal_features` for `feature(compiler_builtins)` since now Rust warns about using internal compiler and standard library features (similar to how it also warns about incomplete ones) [4]. - A cleanup for a documentation link thanks to a new `rustdoc` lint. See previous commits for details. - A need to make an intra-doc link to a macro explicit, due to a change in behavior in `rustdoc`. See previous commits for details. # `alloc` upgrade and reviewing The vast majority of changes are due to our `alloc` fork being upgraded at once. There are two kinds of changes to be aware of: the ones coming from upstream, which we should follow as closely as possible, and the updates needed in our added fallible APIs to keep them matching the newer infallible APIs coming from upstream. Instead of taking a look at the diff of this patch, an alternative approach is reviewing a diff of the changes between upstream `alloc` and the kernel's. This allows to easily inspect the kernel additions only, especially to check if the fallible methods we already have still match the infallible ones in the new version coming from upstream. Another approach is reviewing the changes introduced in the additions in the kernel fork between the two versions. This is useful to spot potentially unintended changes to our additions. To apply these approaches, one may follow steps similar to the following to generate a pair of patches that show the differences between upstream Rust and the kernel (for the subset of `alloc` we use) before and after applying this patch: # Get the difference with respect to the old version. git -C rust checkout $(linux/scripts/min-tool-version.sh rustc) git -C linux ls-tree -r --name-only HEAD -- rust/alloc | cut -d/ -f3- | grep -Fv README.md | xargs -IPATH cp rust/library/alloc/src/PATH linux/rust/alloc/PATH git -C linux diff --patch-with-stat --summary -R > old.patch git -C linux restore rust/alloc # Apply this patch. git -C linux am rust-upgrade.patch # Get the difference with respect to the new version. git -C rust checkout $(linux/scripts/min-tool-version.sh rustc) git -C linux ls-tree -r --name-only HEAD -- rust/alloc | cut -d/ -f3- | grep -Fv README.md | xargs -IPATH cp rust/library/alloc/src/PATH linux/rust/alloc/PATH git -C linux diff --patch-with-stat --summary -R > new.patch git -C linux restore rust/alloc Now one may check the `new.patch` to take a look at the additions (first approach) or at the difference between those two patches (second approach). For the latter, a side-by-side tool is recommended. Link: https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1730-2023-10-05 [1] Link: https://rust-for-linux.com/rust-version-policy [2] Link: https://github.com/Rust-for-Linux/linux/issues/2 [3] Link: https://github.com/rust-lang/compiler-team/issues/596 [4] Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Vincenzo Palazzo Reviewed-by: Alice Ryhl Link: https://lore.kernel.org/r/20231005210556.466856-4-ojeda@kernel.org Signed-off-by: Miguel Ojeda commit a53d8cdd5a0aec75ae32badc2d8995c59ea6e3f0 Author: Miguel Ojeda Date: Thu Oct 5 23:05:54 2023 +0200 rust: print: use explicit link in documentation The future `rustdoc` in the Rust 1.73.0 upgrade requires an explicit link for `pr_info!`: error: unresolved link to `pr_info` --> rust/kernel/print.rs:395:63 | 395 | /// Use only when continuing a previous `pr_*!` macro (e.g. [`pr_info!`]). | ^^^^^^^^ no item named `pr_info` in scope | = note: `macro_rules` named `pr_info` exists in this crate, but it is not in scope at this link's location = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings` Thus do so to avoid a broken link while upgrading. Reviewed-by: Alice Ryhl Reviewed-by: Vincenzo Palazzo Reviewed-by: Finn Behrens Reviewed-by: Martin Rodriguez Reboredo Link: https://lore.kernel.org/r/20231005210556.466856-3-ojeda@kernel.org Signed-off-by: Miguel Ojeda commit c61bcc278b1924da13fd52edbd46b08a518c11ef Author: Miguel Ojeda Date: Thu Oct 5 23:05:53 2023 +0200 rust: task: remove redundant explicit link Starting with Rust 1.73.0, `rustdoc` detects redundant explicit links with its new lint `redundant_explicit_links` [1]: error: redundant explicit link target --> rust/kernel/task.rs:85:21 | 85 | /// [`current`](crate::current) macro because it is safe. | --------- ^^^^^^^^^^^^^^ explicit target is redundant | | | because label contains path that resolves to same destination | = note: when a link's destination is not specified, the label is used to resolve intra-doc links = note: `-D rustdoc::redundant-explicit-links` implied by `-D warnings` help: remove explicit link target | 85 | /// [`current`] macro because it is safe. In order to avoid the warning in the compiler upgrade commit, make it an intra-doc link as the tool suggests. Link: https://github.com/rust-lang/rust/pull/113167 [1] Reviewed-by: Finn Behrens Reviewed-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Vincenzo Palazzo Link: https://lore.kernel.org/r/20231005210556.466856-2-ojeda@kernel.org Signed-off-by: Miguel Ojeda commit c49bba011b51e44d45bbc279ef8f42d46f4b0700 Merge: 99620ea03327c 26285e689c6cd Author: David S. Miller Date: Sun Oct 15 20:07:53 2023 +0100 Merge branch 'ptp-multiple-readers' Xabier Marquiegui says: ==================== ptp: Support for multiple filtered timestamp event queue readers On systems with multiple timestamp event channels, there can be scenarios where multiple userspace readers want to access the timestamping data for various purposes. One such example is wanting to use a pps out for time synchronization, and wanting to timestamp external events with the synchronized time base simultaneously. Timestmp event consumers on the other hand, are often interested in a subset of the available timestamp channels. linuxptp ts2phc, for example, is not happy if more than one timestamping channel is active on the device it is reading from. Linked lists are introduced to support multiple timestamp event queue consumers, and timestamp event channel filters through IOCTLs, as well as a debugfs interface to do some simple verifications. Xabier Marquiegui (6): posix-clock: introduce posix_clock_context concept ptp: Replace timestamp event queue with linked list ptp: support multiple timestamp event readers ptp: support event queue reader channel masks ptp: add debugfs interface to see applied channel masks ptp: add testptp mask test drivers/ptp/ptp_chardev.c | 129 ++++++++++++++++---- drivers/ptp/ptp_clock.c | 45 ++++++- drivers/ptp/ptp_private.h | 28 +++-- drivers/ptp/ptp_sysfs.c | 13 +- include/linux/posix-clock.h | 35 ++++-- include/uapi/linux/ptp_clock.h | 2 + kernel/time/posix-clock.c | 36 ++++-- tools/testing/selftests/ptp/ptpchmaskfmt.sh | 14 +++ tools/testing/selftests/ptp/testptp.c | 19 ++- 9 files changed, 261 insertions(+), 60 deletions(-) create mode 100644 tools/testing/selftests/ptp/ptpchmaskfmt.sh --- v6: - correct commit message - correct coding style v5: https://lore.kernel.org/netdev/cover.1696804243.git.reibax@gmail.com/ - fix spelling on commit message - fix memory leak on ptp_open v4: https://lore.kernel.org/netdev/cover.1696511486.git.reibax@gmail.com/ - split modifications in different patches for improved organization - rename posix_clock_user to posix_clock_context - remove unnecessary flush_users clock operation - remove unnecessary tests - simpler queue clean procedure - fix/clean comment lines - simplified release procedures - filter modifications exclusive to currently open instance for simplicity and security - expand mask to 2048 channels - make more secure and simple: mask is only applied to the testptp instance. Use debugfs to verify effects. v3: https://lore.kernel.org/netdev/20230928133544.3642650-1-reibax@gmail.com/ - add this patchset overview file - fix use of safe and non safe linked lists for loops - introduce new posix_clock private_data and ida object ids for better dicrimination of timestamp consumers - safer resource release procedures - filter application by object id, aided by process id - friendlier testptp implementation of event queue channel filters v2: https://lore.kernel.org/netdev/20230912220217.2008895-1-reibax@gmail.com/ - fix ptp_poll() return value - Style changes to comform to checkpatch strict suggestions - more coherent ptp_read error exit routines - fix testptp compilation error: unknown type name 'pid_t' - rename mask variable for easier code traceability - more detailed commit message with two examples v1: https://lore.kernel.org/netdev/20230906104754.1324412-2-reibax@gmail.com/ ==================== Signed-off-by: Xabier Marquiegui Suggested-by: Richard Cochran Suggested-by: Vinicius Costa Gomes Signed-off-by: David S. Miller commit 26285e689c6cd2cf3849568c83b2ebe53f467143 Author: Xabier Marquiegui Date: Thu Oct 12 00:39:58 2023 +0200 ptp: add testptp mask test Add option to test timestamp event queue mask manipulation in testptp. Option -F allows the user to specify a single channel that will be applied on the mask filter via IOCTL. The test program will maintain the file open until user input is received. This allows checking the effect of the IOCTL in debugfs. eg: Console 1: ``` Channel 12 exclusively enabled. Check on debugfs. Press any key to continue ``` Console 2: ``` 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 ``` Signed-off-by: Xabier Marquiegui Suggested-by: Richard Cochran Suggested-by: Vinicius Costa Gomes Signed-off-by: David S. Miller commit 403376ddb4221be9db5326ae334773807df71ffe Author: Xabier Marquiegui Date: Thu Oct 12 00:39:57 2023 +0200 ptp: add debugfs interface to see applied channel masks Use debugfs to be able to view channel mask applied to every timestamp event queue. Every time the device is opened, a new entry is created in `$DEBUGFS_MOUNTPOINT/ptpN/$INSTANCE_ADDRESS/mask`. The mask value can be viewed grouped in 32bit decimal values using cat, or converted to hexadecimal with the included `ptpchmaskfmt.sh` script. 32 bit values are listed from least significant to most significant. Signed-off-by: Xabier Marquiegui Suggested-by: Vinicius Costa Gomes Signed-off-by: David S. Miller commit c5a445b1e9347b14752b01f1a304bd7a2f260acc Author: Xabier Marquiegui Date: Thu Oct 12 00:39:56 2023 +0200 ptp: support event queue reader channel masks On systems with multiple timestamp event channels, some readers might want to receive only a subset of those channels. Add the necessary modifications to support timestamp event channel filtering, including two IOCTL operations: - Clear all channels - Enable one channel The mask modification operations will be applied exclusively on the event queue assigned to the file descriptor used on the IOCTL operation, so the typical procedure to have a reader receiving only a subset of the enabled channels would be: - Open device file - ioctl: clear all channels - ioctl: enable one channel - start reading Calling the enable one channel ioctl more than once will result in multiple enabled channels. Signed-off-by: Xabier Marquiegui Suggested-by: Richard Cochran Suggested-by: Vinicius Costa Gomes Signed-off-by: David S. Miller commit 8f5de6fb245326704f37d91780b9a10253a8a100 Author: Xabier Marquiegui Date: Thu Oct 12 00:39:55 2023 +0200 ptp: support multiple timestamp event readers Use linked lists to create one event queue per open file. This enables simultaneous readers for timestamp event queues. Signed-off-by: Xabier Marquiegui Suggested-by: Richard Cochran Signed-off-by: David S. Miller commit d26ab5a35ad9920940a9e07665130d501b2ae1a3 Author: Xabier Marquiegui Date: Thu Oct 12 00:39:54 2023 +0200 ptp: Replace timestamp event queue with linked list Introduce linked lists to access the timestamp event queue. Signed-off-by: Xabier Marquiegui Suggested-by: Richard Cochran Signed-off-by: David S. Miller commit 60c6946675fc06dd2fd2b7a4b6fd1c1f046f1056 Author: Xabier Marquiegui Date: Thu Oct 12 00:39:53 2023 +0200 posix-clock: introduce posix_clock_context concept Add the necessary structure to support custom private-data per posix-clock user. The previous implementation of posix-clock assumed all file open instances need access to the same clock structure on private_data. The need for individual data structures per file open instance has been identified when developing support for multiple timestamp event queue users for ptp_clock. Signed-off-by: Xabier Marquiegui Suggested-by: Richard Cochran Suggested-by: Vinicius Costa Gomes Signed-off-by: David S. Miller commit 8afe816b0c9944a11adb12628e3b700a08a55d52 Author: AngeloGioacchino Del Regno Date: Wed Oct 11 13:03:09 2023 +0200 mailbox: mtk-cmdq-mailbox: Implement Runtime PM with autosuspend MediaTek found an issue with display HW registers configuration, and located the reason in the CMDQ Mailbox driver; reporting the original comment with the analysis of this problem by Jason-JH Lin: GCE should config HW in every vblanking duration. The stream done event is the start signal of vblanking. If stream done event is sent between GCE clk_disable and clk_enable. After GCE clk_enable the stream done event may not appear immediately and have about 3us delay. Normal case: clk_disable -> get EventA -> clk_enable -> clear EventA -> wait EventB -> get EventB -> config HW Abnormal case: clk_disable -> get EventA -> clk_enable -> EventA delay appear -> clear EventA fail -> wait EventB but get EventA -> config HW This abnormal case may configure display HW in the vactive or non-vblanking duration. From his analysis we get that the GCE may finish its event processing after some amount of time (and not immediately after sending commands to it); since the GCE is used for more than just display, and it gets used frequently, solve this issue by implementing Runtime PM handlers with autosuspend: this allows us to overcome to the remote processor delay issues and reduce the clock enable()/disable() calls, while also still managing to save some power, which is something that we wouldn't be able to do if we just enable the GCE clocks at probe. Speaking of which: if Runtime PM is not available there will obviously be no way to get this power saving action so, in this case, the clocks will be enabled at probe() time, kept enabled for the entire driver's life and disabled at remove(). Reported-by: Jason-JH.Lin Signed-off-by: AngeloGioacchino Del Regno Tested-by: Jason-JH.Lin Signed-off-by: Jassi Brar commit 5cb5d0c964d15c14471dfbf6e66587edb5346206 Author: Rob Herring Date: Fri Oct 6 17:44:06 2023 -0500 mailbox: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Signed-off-by: Jassi Brar commit 81186dc1610155fc96740a81aa4f0a8b3cbb7dfb Author: Tanmay Shah Date: Fri Oct 6 21:27:01 2023 -0700 dt-bindings: zynqmp: add destination mailbox compatible Current dt-bindings does not contain compatible property for child mailbox node. Child mailbox nodes are used to represent destination (remote) IPI agents. The compatible property for all destination mailboxes must be required to identify the node. This addition of new required property does not break ABI as current driver does not use this compatible property but, new features in driver should use this property. Signed-off-by: Tanmay Shah Acked-by: Rob Herring Signed-off-by: Jassi Brar commit 3f7cc9af9556a16cd60a63ca6a7fd1786ee0c3af Author: Kathiravan Thirumoorthy Date: Thu Sep 14 12:29:56 2023 +0530 dt-bindings: mailbox: qcom: add one more clock provider for IPQ mailbox Mailbox controller present in the IPQ SoCs takes the GPLL0 clock also as an input. Document the same. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Kathiravan Thirumoorthy Signed-off-by: Jassi Brar commit 5bfe4067d35030c4816de29930c42ba51e9ece6c Author: Peng Fan Date: Sun Sep 17 20:43:51 2023 +0800 mailbox: imx: support channel type tx doorbell v2 The Message Unit(MU) General Purpose Control registers are used for TX doorbell, but there is no hardware ACK support. The current TX doorbell channel is using tasklet to emulate hardware ACK support to kick the TX tick from controller driver side. The new added TX doorbell channel V2 not using tasklet to emulate the hardware ACK support. The behavior for the channel is just writing the GCR register, and no else. This will be used for SCMI mailbox. Signed-off-by: Peng Fan Signed-off-by: Jassi Brar commit 5dc1ec71a9f7e7edb9b6ea2254fcbb1c48626c51 Author: Peng Fan Date: Sun Sep 17 20:43:50 2023 +0800 dt-bindings: mailbox: fsl,mu: add new tx doorbell channel Add new tx doorbell channel for i.MX95 SCMI mailbox usage. Signed-off-by: Peng Fan Acked-by: Krzysztof Kozlowski Signed-off-by: Jassi Brar commit dd712d3d45807db9fcae28a522deee85c1f2fde6 Author: Douglas Anderson Date: Tue Aug 22 13:19:46 2023 -0700 kgdb: Flush console before entering kgdb on panic When entering kdb/kgdb on a kernel panic, it was be observed that the console isn't flushed before the `kdb` prompt came up. Specifically, when using the buddy lockup detector on arm64 and running: echo HARDLOCKUP > /sys/kernel/debug/provoke-crash/DIRECT I could see: [ 26.161099] lkdtm: Performing direct entry HARDLOCKUP [ 32.499881] watchdog: Watchdog detected hard LOCKUP on cpu 6 [ 32.552865] Sending NMI from CPU 5 to CPUs 6: [ 32.557359] NMI backtrace for cpu 6 ... [backtrace for cpu 6] ... [ 32.558353] NMI backtrace for cpu 5 ... [backtrace for cpu 5] ... [ 32.867471] Sending NMI from CPU 5 to CPUs 0-4,7: [ 32.872321] NMI backtrace forP cpuANC: Hard LOCKUP Entering kdb (current=..., pid 0) on processor 5 due to Keyboard Entry [5]kdb> As you can see, backtraces for the other CPUs start printing and get interleaved with the kdb PANIC print. Let's replicate the commands to flush the console in the kdb panic entry point to avoid this. Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20230822131945.1.I5b460ae8f954e4c4f628a373d6e74713c06dd26f@changeid Signed-off-by: Daniel Thompson commit b25c17e5c2497d13857772d411142daa20c70e59 Author: Nandha Kumar Singaram Date: Sun Oct 15 06:35:58 2023 -0700 staging: qlge: Replace the occurrences of (1< Link: https://lore.kernel.org/r/20231015133558.GA5489@ubuntu Signed-off-by: Greg Kroah-Hartman commit 4aa8371e4a9b9d77372e8535144da8c5d99aac7d Author: Soumya Negi Date: Fri Oct 13 16:47:16 2023 -0700 staging: vme_user: Add spaces around '<<' operator Add spaces around all instances of << in the header vme_tsi148.h to conform with Linux coding style. Issue found by checkpatch.pl Signed-off-by: Soumya Negi Link: https://lore.kernel.org/r/f84f353dedc28f99e42d2419b379ace41d0cb218.1697240381.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2170f5bffb12868ba3f2dc5dbf79cd87f9ac6fa6 Author: Soumya Negi Date: Fri Oct 13 16:47:15 2023 -0700 staging: vme_user: Add spaces around '*' Add space around * operator to adhere to Linux coding style. Issue found by checkpatch.pl Signed-off-by: Soumya Negi Link: https://lore.kernel.org/r/81181dcc1ffa648f32cbe3c4ec8731e66349e450.1697240381.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2a7f242e88d1fb4bcebe92e38f57a4cbacf40f7c Author: Soumya Negi Date: Fri Oct 13 16:47:14 2023 -0700 staging: vme_user: Fix unbalanced {} in if-else blocks Add missing braces so that {} are balanced in all arms of if-else statements as per Linux coding style. Issue found by checkpatch.pl Signed-off-by: Soumya Negi Link: https://lore.kernel.org/r/b0fad6de7405a105235b3b595e0bb2c51be7dcf0.1697240381.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4d8cc30a9b49781089c082cd858a1c0fc882f480 Author: Soumya Negi Date: Fri Oct 13 16:47:13 2023 -0700 staging: vme_user: Correct spelling mistakes in comments Fix misspelled words in vme.c. Issue found by checkpatch.pl Signed-off-by: Soumya Negi Link: https://lore.kernel.org/r/f41caa8e7c987fdc010942838117fece8151affe.1697240381.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit e385ed2a4dd90c1da7819a324abd3bb6b48b0233 Author: Pavan Bobba Date: Mon Oct 9 00:31:50 2023 +0530 staging: vt6655: Type encoding info dropped from variable name "byBBVGANew" variable name "byBBVGANew" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/abb105b822090a82ef081b2e28705bf14b8ce058.1696791459.git.opensource206@gmail.com Signed-off-by: Greg Kroah-Hartman commit f5640b0c1b95339b1dcfb1ed512dae82329287c6 Author: Pavan Bobba Date: Mon Oct 9 00:31:49 2023 +0530 staging: vt6655: Type encoding info dropped from variable name "byBBVGACurrent" variable name "byBBVGACurrent" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/f0dfd4d2460f858540d465dd8bcfc920c219e94d.1696791459.git.opensource206@gmail.com Signed-off-by: Greg Kroah-Hartman commit 11b896e65f4bff7e412b3abca366ea0bdadc8834 Author: Pavan Bobba Date: Mon Oct 9 00:31:48 2023 +0530 staging: vt6655: Type encoding info dropped from array name "abyBBVGA" array name "abyBBVGA" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/13a233dff4d6daf728f75ab18b38ec9d0703764b.1696791459.git.opensource206@gmail.com Signed-off-by: Greg Kroah-Hartman commit cf65511eeeade56f81714153bc5dcd5ab15f164b Author: Tree Davies Date: Fri Oct 13 21:44:35 2023 -0700 Staging: rtl8192e: Rename variable pTS Rename variable pTS to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20231014044435.11947-5-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 3a22549f1ac250e5a38d916b457ac2849168606d Author: Tree Davies Date: Fri Oct 13 21:44:34 2023 -0700 Staging: rtl8192e: Rename variable ReasonCode Rename variable ReasonCode to reason_code to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20231014044435.11947-4-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 72f471e177ae239554037c3bf69d0c6c7e84b5e9 Author: Tree Davies Date: Fri Oct 13 21:44:33 2023 -0700 Staging: rtl8192e: Rename variable TSInfo Rename variable TSInfo to ts_info to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20231014044435.11947-3-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit ab79cedb6b5e2d735fe6dd83b0e19a73f11e074b Author: Tree Davies Date: Fri Oct 13 21:44:32 2023 -0700 Staging: rtl8192e: Rename variable pBa Rename variable pBa to ba to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20231014044435.11947-2-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit f81186254e6bebb3930fe6888af973d6e525686a Author: Philipp Hortmann Date: Fri Oct 13 16:44:23 2023 +0200 staging: rtl8192e: Remove unused enums dm_dig_sta and dm_dig_alg Remove unused enums dm_dig_sta and dm_dig_alg. Remove unused entries of enum dm_dig_connect. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/0aab74bcda5f582a5fe44a4c1405940d0c8261ad.1697127817.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 628c3d853b3c605c20c6ed1108f775f48a27d30b Author: Philipp Hortmann Date: Fri Oct 13 16:44:17 2023 +0200 staging: rtl8192e: Remove unused variable dig_state Remove variable dig_state as it is unused. Remove unused variable dig_highpwr_state as well. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/7bacd7e152a2d044527924d57efdbbaae0f4c9e8.1697127817.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8e6bbbdaa7b04a08fbd6795a5dca112afd2fc0a7 Author: Philipp Hortmann Date: Fri Oct 13 16:44:11 2023 +0200 staging: rtl8192e: Remove unchanged variable dig_algorithm_switch Remove variable dig_algorithm_switch as its value is set to 0 at initialization. The equations result accordingly. Remove dead code. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/a76d8b86f2591446a071b4f614adf628b0fe5c93.1697127817.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit fda7398845873b09f08c3ee3125c861e819c9721 Author: Philipp Hortmann Date: Fri Oct 13 16:44:05 2023 +0200 staging: rtl8192e: Remove _rtl92e_dm_ctrl_initgain_byrssi_false_alarm() Remove function _rtl92e_dm_ctrl_initgain_byrssi_false_alarm() as it is unused. Remove in above function called function _rtl92e_dm_ctrl_initgain_byrssi_highpwr() as well. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/80a5a0b67d9d225a58c96781c33e2216c0ea1c6e.1697127817.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 29f9b2e9399cd5bee5f44bcad5c006fbaf40349f Author: Philipp Hortmann Date: Fri Oct 13 16:43:56 2023 +0200 staging: rtl8192e: Remove unchanged variable dig_algorithm Remove variable dig_algorithm as its value is set to DIG_ALGO_BY_RSSI at initialization. No further writes to dig_algorithm are done. The equations result accordingly. Remove dead code. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/66f7275aa46e68577cc4c20582ffbd16de13f470.1697127817.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3b1ce526f1110d969cbdbbf2b2f3b3e88c64a6c6 Author: Philipp Hortmann Date: Fri Oct 13 16:43:46 2023 +0200 staging: rtl8192e: Remove unchanged variable dig_enable_flag Remove variable dig_enable_flag as its value is set to 1 at initialization. No further writes to dig_enable_flag are done. The equations result accordingly. Remove dead code. Signed-off-by: Philipp Hortmann Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/24a9245840093c5a14124f9fc896433c7d85d18c.1697127817.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 84b52696b99edbc63a855b5a44d9e7f02e11fde5 Author: Soumya Negi Date: Thu Oct 12 16:29:06 2023 -0700 staging: rts5208: Remove macros scsi_lock(), scsi_unlock() The scsi_lock() and scsi_unlock() macros protect the sm_state and the single queue element srb for write access in the driver. As suggested, these names are very generic. Remove the macros from header file and call spin_lock_irq() & spin_unlock_irq() directly instead. Suggested-by: Dan Carpenter Suggested-by: Julia Lawall Signed-off-by: Soumya Negi Link: https://lore.kernel.org/r/75a5990190cf7a5d20d1c27237b90b583e68ced8.1697152251.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5b91f876f9e31c106177ee9341412d64e51f5ebf Author: Soumya Negi Date: Thu Oct 12 16:29:05 2023 -0700 staging: rts5208: Refactor macros to static inline functions Driver rts5208 uses macros to read/write data & to perform generic PCI functions. Rewrite these macros as static inline functions in the header file. Suggested-by: Dan Carpenter Suggested-by: Julia Lawall Signed-off-by: Soumya Negi Link: https://lore.kernel.org/r/c7431fe4d7f72138d8dc86269794f87c30d21a38.1697152251.git.soumya.negi97@gmail.com Signed-off-by: Greg Kroah-Hartman commit 697455ce411075c37729fbdd1dff4052cf770800 Author: Philipp Hortmann Date: Sat Oct 14 23:10:51 2023 +0200 staging: rtl8192u: Remove broken driver Tests on rtl8192u hardware have shown that this driver is broken since 2016. Remove broken driver. Find fix for two bugs in second link. Link: https://lore.kernel.org/lkml/db98d9ac-7650-4a72-8eb9-4def1f17ea0d@app.fastmail.com/ Link: https://lore.kernel.org/lkml/cover.1697089416.git.philipp.g.hortmann@gmail.com/ Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/20231014211051.GA29518@matrix-ESPRIMO-P710 Signed-off-by: Greg Kroah-Hartman commit a7e79e2b6fa06dd9acc3ee4a22641164a744e194 Author: Gustavo A. R. Silva Date: Mon Oct 9 15:52:59 2023 -0600 staging: greybus: Add __counted_by for struct apr_rx_buf and use struct_size() Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). While there, use struct_size() helper, instead of the open-coded version, to calculate the size for the allocation of the whole flexible structure, including of course, the flexible-array member. This code was found with the help of Coccinelle, and audited and fixed manually. Signed-off-by: "Gustavo A. R. Silva" Reviewed-by: Kees Cook Reviewed-by: Alex Elder Link: https://lore.kernel.org/r/ZSR2O6zGyT/VX6ve@work Signed-off-by: Greg Kroah-Hartman commit 99620ea03327c5e73407f48a6994578f71951a87 Merge: cc30c6346b9e7 20f6677234d81 Author: David S. Miller Date: Sun Oct 15 16:08:25 2023 +0100 Merge branch 'dpll-phase-offset-phase-adjust' Arkadiusz Kubalewski says: ==================== dpll: add phase-offset and phase-adjust Improve monitoring and control over dpll devices. Allow user to receive measurement of phase difference between signals on pin and dpll (phase-offset). Allow user to receive and control adjustable value of pin's signal phase (phase-adjust). v4->v5: - rebase series on top of net-next/main, fix conflict - remove redundant attribute type definition in subset definition v3->v4: - do not increase do version of uAPI header as it is not needed (v3 did not have this change) - fix spelling around commit messages, argument descriptions and docs - add missing extack errors on failure set callbacks for pin phase adjust and frequency - remove ice check if value is already set, now redundant as checked in the dpll subsystem v2->v3: - do not increase do version of uAPI header as it is not needed v1->v2: - improve handling for error case of requesting the phase adjust set - align handling for error case of frequency set request with the approach introduced for phase adjust ==================== Signed-off-by: David S. Miller commit 20f6677234d8105e55beca355135e94bb10fbf74 Author: Arkadiusz Kubalewski Date: Wed Oct 11 12:12:36 2023 +0200 dpll: netlink/core: change pin frequency set behavior Align the approach of pin frequency set behavior with the approach introduced with pin phase adjust set. Fail the request if any of devices did not registered the callback ops. If callback op on any pin's registered device fails, return error and rollback the value to previous one. Signed-off-by: Arkadiusz Kubalewski Signed-off-by: David S. Miller commit 90e1c90750d773fc991833f317b439236e13fc25 Author: Arkadiusz Kubalewski Date: Wed Oct 11 12:12:35 2023 +0200 ice: dpll: implement phase related callbacks Implement new callback ops related to measurement and adjustment of signal phase for pin-dpll in ice driver. Signed-off-by: Arkadiusz Kubalewski Signed-off-by: David S. Miller commit d7fbc0b7e846e9e0e70ae766d274b8720fbab412 Author: Arkadiusz Kubalewski Date: Wed Oct 11 12:12:34 2023 +0200 dpll: netlink/core: add support for pin-dpll signal phase offset/adjust Add callback ops for pin-dpll phase measurement. Add callback for pin signal phase adjustment. Add min and max phase adjustment values to pin proprties. Invoke callbacks in dpll_netlink.c when filling the pin details to provide user with phase related attribute values. Signed-off-by: Arkadiusz Kubalewski Signed-off-by: David S. Miller commit c3c6ab95c397134bf5948f18743b3ba8008e7c47 Author: Arkadiusz Kubalewski Date: Wed Oct 11 12:12:33 2023 +0200 dpll: spec: add support for pin-dpll signal phase offset/adjust Add attributes for providing the user with: - measurement of signals phase offset between pin and dpll - ability to adjust the phase of pin signal Signed-off-by: Arkadiusz Kubalewski Signed-off-by: David S. Miller commit 27ed30d1f861315719bd8c2b2e81576d71750331 Author: Arkadiusz Kubalewski Date: Wed Oct 11 12:12:32 2023 +0200 dpll: docs: add support for pin signal phase offset/adjust Add documentation on: - measurement of phase of signal between pin and dpll - adjustment of pin signal phase Signed-off-by: Arkadiusz Kubalewski Signed-off-by: David S. Miller commit cc30c6346b9e790676aacdfbb792aa16486f6396 Merge: b22f21f7a5414 3e02480d5e386 Author: David S. Miller Date: Sun Oct 15 14:33:42 2023 +0100 Merge branch 'i40e-devlink' Ivan Vecera says: ==================== i40e: Add basic devlink support The series adds initial support for devlink to i40e driver. Patch-set overview: Patch 1: Adds initial devlink support (devlink and port registration) Patch 2: Refactors and split i40e_nvm_version_str() Patch 3: Adds support for 'devlink dev info' Patch 4: Refactors existing helper function to read PBA ID Patch 5: Adds 'board.id' to 'devlink dev info' using PBA ID ==================== Signed-off-by: David S. Miller commit 3e02480d5e3863775e738db9c7888e9b3ebc28dc Author: Ivan Vecera Date: Fri Oct 13 19:07:55 2023 +0200 i40e: Add PBA as board id info to devlink .info_get Expose stored PBA ID string as unique board identifier via devlink's .info_get command. Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit df19ea696644bea14dc2b804066a6b91aa4aaf43 Author: Ivan Vecera Date: Fri Oct 13 19:07:54 2023 +0200 i40e: Refactor and rename i40e_read_pba_string() Function i40e_read_pba_string() is currently unused but will be used by subsequent patch to provide board ID via devlink device info. The function reads PBA block from NVM so it cannot be called during adapter reset and as we would like to provide PBA ID via devlink info it is better to read the PBA ID during i40e_probe() and cache it in i40e_hw structure to avoid a waiting for potential adapter reset in devlink info callback. So... - Remove pba_num and pba_num_size arguments from the function, allocate resource managed buffer to store PBA ID string and save resulting pointer to i40e_hw->pba_id field - Make the function void as the PBA ID can be missing and in this case (or in case of NVM reading failure) the i40e_hw->pba_id will be NULL - Rename the function to i40e_get_pba_string() to align with other functions like i40e_get_oem_version() i40e_get_port_mac_addr()... - Call this function on init during i40e_probe() Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit 5a423552e0d9bb882f22cb0bf85f520ca2692706 Author: Ivan Vecera Date: Fri Oct 13 19:07:53 2023 +0200 i40e: Add handler for devlink .info_get Provide devlink .info_get callback to allow the driver to report detailed version information. The following info is reported: "serial_number" -> The PCI DSN of the adapter "fw.mgmt" -> The version of the firmware "fw.mgmt.api" -> The API version of interface exposed over the AdminQ "fw.psid" -> The version of the NVM image "fw.bundle_id" -> Unique identifier for the combined flash image "fw.undi" -> The combo image version With this, 'devlink dev info' provides at least the same amount information as is reported by ETHTOOL_GDRVINFO: $ ethtool -i enp2s0f0 | egrep '(driver|firmware)' driver: i40e firmware-version: 9.30 0x8000e5f3 1.3429.0 $ devlink dev info pci/0000:02:00.0 pci/0000:02:00.0: driver i40e serial_number c0-de-b7-ff-ff-ef-ec-3c versions: running: fw.mgmt 9.130.73618 fw.mgmt.api 1.15 fw.psid 9.30 fw.bundle_id 0x8000e5f3 fw.undi 1.3429.0 Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit 7aabde397683263fd8aa146f97cc0846372e0719 Author: Ivan Vecera Date: Fri Oct 13 19:07:52 2023 +0200 i40e: Split and refactor i40e_nvm_version_str() The function formats NVM version string according adapter's EETrackID value. If this value OEM specific (0xffffffff) then the reported version is with format: ".." and in other case ". .." These versions are reported in the subsequent patch in this series that implements devlink .info_get but separately. So split the function into separate ones, refactor it to use them and remove ugly static string buffer. Additionally convert NVM/OEM version mask macros to use GENMASK and use FIELD_GET/FIELD_PREP for them in i40e_nvm_version_str() and i40e_get_oem_version(). This makes code more readable and allows us to remove related shift macros. Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit 9e479d64dc58f11792f638ea2e8eff3304edaabf Author: Ivan Vecera Date: Fri Oct 13 19:07:51 2023 +0200 i40e: Add initial devlink support Add an initial support for devlink interface to i40e driver. Similarly to ice driver the implementation doe not enable devlink to manage device-wide configuration and devlink instance is created for each physical function of PCIe device. Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit b22f21f7a541419d454c5b7c254a9bd02bdd5d58 Author: Pavan Chebbi Date: Fri Oct 13 06:59:19 2023 -0700 tg3: Improve PTP TX timestamping logic When we are trying to timestamp a TX packet, there may be occasions when the TX timestamp register is still not updated with the latest timestamp even if the timestamp packet descriptor is marked as complete. This usually happens in cases where the system is under stress or flow control is affecting the transmit side. We will solve this problem by saving the snapshot of the timestamp register when we are posting the TX descriptor. At this time, the register contains previously timestamped packet's value and valid timestamp of the current packet must be different than this. Upon completion of the current descriptor, we will check if the timestamp register is updated or not before timestamping the skb. If not updated, we will schedule the ptp worker to fetch the updated time later and timestamp the skb. Also now we restrict number of outstanding PTP TX packet requests to 1. Reported-by: Simon White Link: https://lore.kernel.org/netdev/CACKFLikGdN9XPtWk-fdrzxdcD=+bv-GHBvfVfSpJzHY7hrW39g@mail.gmail.com/ Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan Reviewed-by: Andy Gospodarek Reviewed-by: Kalesh AP Signed-off-by: David S. Miller commit 6e55b1cbf05dca4651692be6c59acb7b20186653 Author: Jakub Kicinski Date: Tue Oct 10 19:42:24 2023 -0700 docs: try to encourage (netdev?) reviewers Add a section to netdev maintainer doc encouraging reviewers to chime in on the mailing list. The questions about "when is it okay to share feedback" keep coming up (most recently at netconf) and the answer is "pretty much always". Extend the section of 7.AdvancedTopics.rst which deals with reviews a little bit to add stuff we had been recommending locally. Signed-off-by: Jakub Kicinski Reviewed-by: Florian Fainelli Reviewed-by: Martin Habets Signed-off-by: David S. Miller commit 4d825faf3e97e412e562c2b145d7422d97c8d5f7 Merge: 4b714fd1a05b2 0c7fe3b3720ed Author: David S. Miller Date: Sun Oct 15 14:25:03 2023 +0100 Merge branch 'sfc-conntrack-offload' Edward Cree says: ==================== sfc: support conntrack NAT offload The EF100 MAE supports performing NAT (and NPT) on packets which match in the conntrack table. This series adds that capability to the driver. ==================== Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 0c7fe3b3720ed59219ba3d8079eddc719cb36b35 Author: Edward Cree Date: Tue Oct 10 22:52:00 2023 +0100 sfc: support offloading ct(nat) action in RHS rules If an IP address and/or L4 port for NAPT is available from a CT match, the MAE will perform the edits; if no CT lookup has been performed for this packet, the CT lookup did not return a match, or the matched CT entry did not include NAPT, the action will have no effect. Reviewed-by: Pieter Jansen van Vuuren Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 38f9a08a3e6a6ad6393c60f82a50bdd0c23478b0 Author: Edward Cree Date: Tue Oct 10 22:51:59 2023 +0100 sfc: parse mangle actions (NAT) in conntrack entries The MAE can edit either address, L4 port, or both, for either source or destination. These can't be mixed; i.e. it can edit source addr and source port, but not (say) source addr and dest port. Reviewed-by: Pieter Jansen van Vuuren Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 0ddd30471a5dd78ff762ffb9eeae1d573283243a Author: Frank Oltmanns Date: Mon Feb 13 13:32:38 2023 +0100 drm/panel: st7703: Fix timings when entering/exiting sleep Fix flickering of the pinephone's XDB599 panel that happens after resume. Extend the delay after issuing the command to exit sleep mode from 60 to 120 msec as per the controller's specification. Introduce a 120 msec delay after issuing the command to enter sleep mode. This is needed in order for the controller to reliably finalize the sleep in sequence before switching of power supply. In contrast to the JH057N panel, the XBD599 panel does not require a 20 msec delay after initialization and exiting sleep mode. Therefore, move the delay into the already existing device specific initialization function. The XDB599 does not require a 20 msec delay between the SETBGP and SETVCOM commands. Therefore, remove the delay from the device specific initialization function. Signed-off-by: Frank Oltmanns Cc: Ondrej Jirman Reported-by: Samuel Holland Reviewed-by: Guido Günther Tested-by: Guido Günther Signed-off-by: Guido Günther Link: https://patchwork.freedesktop.org/patch/msgid/20230213123238.76889-2-frank@oltmanns.dev commit d12d635bb03c7cb4830acb641eb176ee9ff2aa89 Author: Ondrej Jirman Date: Sat Feb 11 18:17:48 2023 +0100 drm/panel: st7703: Pick different reset sequence Switching to a different reset sequence, enabling IOVCC before enabling VCC. There also needs to be a delay after enabling the supplies and before deasserting the reset. The datasheet specifies 1ms after the supplies reach the required voltage. Use 10-20ms to also give the power supplies some time to reach the required voltage, too. This fixes intermittent panel initialization failures and screen corruption during resume from sleep on panel xingbangda,xbd599 (e.g. used in PinePhone). Signed-off-by: Ondrej Jirman Signed-off-by: Frank Oltmanns Reported-by: Samuel Holland Reviewed-by: Guido Günther Tested-by: Guido Günther Signed-off-by: Guido Günther Link: https://patchwork.freedesktop.org/patch/msgid/20230211171748.36692-2-frank@oltmanns.dev commit 4b714fd1a05b26665badf19e484878eb80f0417a Merge: 85605fb694f08 8d211285c6d48 Author: David S. Miller Date: Sun Oct 15 13:19:43 2023 +0100 Merge branch 'vsock-virtio-vhost-zerocopy' Arseniy Krasnov says: ==================== vsock/virtio/vhost: MSG_ZEROCOPY preparations this patchset is first of three parts of another big patchset for MSG_ZEROCOPY flag support: https://lore.kernel.org/netdev/20230701063947.3422088-1-AVKrasnov@sberdevices.ru/ During review of this series, Stefano Garzarella suggested to split it for three parts to simplify review and merging: 1) virtio and vhost updates (for fragged skbs) <--- this patchset 2) AF_VSOCK updates (allows to enable MSG_ZEROCOPY mode and read tx completions) and update for Documentation/. 3) Updates for tests and utils. This series enables handling of fragged skbs in virtio and vhost parts. Newly logic won't be triggered, because SO_ZEROCOPY options is still impossible to enable at this moment (next bunch of patches from big set above will enable it). I've included changelog to some patches anyway, because there were some comments during review of last big patchset from the link above. Head for this patchset is: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=f2fa1c812c91e99d0317d1fc7d845e1e05f39716 Link to v1: https://lore.kernel.org/netdev/20230717210051.856388-1-AVKrasnov@sberdevices.ru/ Link to v2: https://lore.kernel.org/netdev/20230718180237.3248179-1-AVKrasnov@sberdevices.ru/ Link to v3: https://lore.kernel.org/netdev/20230720214245.457298-1-AVKrasnov@sberdevices.ru/ Link to v4: https://lore.kernel.org/netdev/20230727222627.1895355-1-AVKrasnov@sberdevices.ru/ Link to v5: https://lore.kernel.org/netdev/20230730085905.3420811-1-AVKrasnov@sberdevices.ru/ Link to v6: https://lore.kernel.org/netdev/20230814212720.3679058-1-AVKrasnov@sberdevices.ru/ Link to v7: https://lore.kernel.org/netdev/20230827085436.941183-1-avkrasnov@salutedevices.com/ Link to v8: https://lore.kernel.org/netdev/20230911202234.1932024-1-avkrasnov@salutedevices.com/ Changelog: v3 -> v4: * Patchset rebased and tested on new HEAD of net-next (see hash above). v4 -> v5: * See per-patch changelog after ---. v5 -> v6: * Patchset rebased and tested on new HEAD of net-next (see hash above). * See per-patch changelog after ---. v6 -> v7: * Patchset rebased and tested on new HEAD of net-next (see hash above). * See per-patch changelog after ---. v7 -> v8: * Patchset rebased and tested on new HEAD of net-next (see hash above). * See per-patch changelog after ---. v8 -> v9: * Patchset rebased and tested on new HEAD of net-next (see hash above). * See per-patch changelog after ---. ==================== Signed-off-by: David S. Miller commit 8d211285c6d48baca4934c54b1965d4e75ce35e2 Author: Arseniy Krasnov Date: Tue Oct 10 22:15:24 2023 +0300 test/vsock: io_uring rx/tx tests This adds set of tests which use io_uring for rx/tx. This test suite is implemented as separated util like 'vsock_test' and has the same set of input arguments as 'vsock_test'. These tests only cover cases of data transmission (no connect/bind/accept etc). Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit e846d679ad131c71c190123f3b6176c108567c85 Author: Arseniy Krasnov Date: Tue Oct 10 22:15:23 2023 +0300 test/vsock: MSG_ZEROCOPY support for vsock_perf To use this option pass '--zerocopy' parameter: ./vsock_perf --zerocopy --sender ... With this option MSG_ZEROCOPY flag will be passed to the 'send()' call. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit bc36442ef3b776ee6d5148a4e175c367af057ce1 Author: Arseniy Krasnov Date: Tue Oct 10 22:15:22 2023 +0300 test/vsock: MSG_ZEROCOPY flag tests This adds three tests for MSG_ZEROCOPY feature: 1) SOCK_STREAM tx with different buffers. 2) SOCK_SEQPACKET tx with different buffers. 3) SOCK_STREAM test to read empty error queue of the socket. Patch also works as preparation for the next patches for tools in this patchset: vsock_perf and vsock_uring_test: 1) Adds several new functions to util.c - they will be also used by vsock_uring_test. 2) Adds two new functions for MSG_ZEROCOPY handling to a new source file - such source will be shared between vsock_test, vsock_perf and vsock_uring_test, thus avoiding code copy-pasting. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit bac2cac12c266755fa4b933d88e70bc18580b80f Author: Arseniy Krasnov Date: Tue Oct 10 22:15:21 2023 +0300 docs: net: description of MSG_ZEROCOPY for AF_VSOCK This adds description of MSG_ZEROCOPY flag support for AF_VSOCK type of socket. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit e0718bd82e27d85086ada18e7f04847ee84b710a Author: Arseniy Krasnov Date: Tue Oct 10 22:15:20 2023 +0300 vsock: enable setting SO_ZEROCOPY For AF_VSOCK, zerocopy tx mode depends on transport, so this option must be set in AF_VSOCK implementation where transport is accessible (if transport is not set during setting SO_ZEROCOPY: for example socket is not connected, then SO_ZEROCOPY will be enabled, but once transport will be assigned, support of this type of transmission will be checked). To handle SO_ZEROCOPY, AF_VSOCK implementation uses SOCK_CUSTOM_SOCKOPT bit, thus handling SOL_SOCKET option operations, but all of them except SO_ZEROCOPY will be forwarded to the generic handler by calling 'sock_setsockopt()'. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit cfdca3904687d851436076080779c271bc31eb20 Author: Arseniy Krasnov Date: Tue Oct 10 22:15:19 2023 +0300 vsock/loopback: support MSG_ZEROCOPY for transport Add 'msgzerocopy_allow()' callback for loopback transport. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit e2fcc326b4986b6f557acb244b5be218cc10951e Author: Arseniy Krasnov Date: Tue Oct 10 22:15:18 2023 +0300 vsock/virtio: support MSG_ZEROCOPY for transport Add 'msgzerocopy_allow()' callback for virtio transport. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit 3719c48d9a2082773c38564dea3fa7b30a69a479 Author: Arseniy Krasnov Date: Tue Oct 10 22:15:17 2023 +0300 vhost/vsock: support MSG_ZEROCOPY for transport Add 'msgzerocopy_allow()' callback for vhost transport. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit dcc55d7bb23016e7ae335c8558e1937d7a551b35 Author: Arseniy Krasnov Date: Tue Oct 10 22:15:16 2023 +0300 vsock: enable SOCK_SUPPORT_ZC bit This bit is used by io_uring in case of zerocopy tx mode. io_uring code checks, that socket has this feature. This patch sets it in two places: 1) For socket in 'connect()' call. 2) For new socket which is returned by 'accept()' call. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit 5fbfc7d243343917793ae95a6011f03b5aac4735 Author: Arseniy Krasnov Date: Tue Oct 10 22:15:15 2023 +0300 vsock: check for MSG_ZEROCOPY support on send This feature totally depends on transport, so if transport doesn't support it, return error. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit 49dbe25adac42d3e06f65d1420946bec65896222 Author: Arseniy Krasnov Date: Tue Oct 10 22:15:14 2023 +0300 vsock: read from socket's error queue This adds handling of MSG_ERRQUEUE input flag in receive call. This flag is used to read socket's error queue instead of data queue. Possible scenario of error queue usage is receiving completions for transmission with MSG_ZEROCOPY flag. This patch also adds new defines: 'SOL_VSOCK' and 'VSOCK_RECVERR'. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit 0064cfb44084ba98927d8e72340ab78e5887462b Author: Arseniy Krasnov Date: Tue Oct 10 22:15:13 2023 +0300 vsock: set EPOLLERR on non-empty error queue If socket's error queue is not empty, EPOLLERR must be set. Otherwise, reader of error queue won't detect data in it using EPOLLERR bit. Currently for AF_VSOCK this is actual only with MSG_ZEROCOPY, as this feature is the only user of an error queue of the socket. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller commit 81b5948cf1a7ad49ba72fa0674710bd3f44deb9e Author: Conor Dooley Date: Mon Oct 9 10:37:47 2023 +0100 riscv: dts: starfive: convert isa detection to new properties Convert the jh7100 and jh7110 devicetrees to use the new properties "riscv,isa-base" & "riscv,isa-extensions". For compatibility with other projects, "riscv,isa" remains. Signed-off-by: Conor Dooley commit a54f42722e494c86ad0eeba198a662d68aeabb15 Author: Conor Dooley Date: Mon Oct 9 10:37:46 2023 +0100 riscv: dts: sifive: convert isa detection to new properties Convert the fu540 and fu740 devicetrees to use the new properties "riscv,isa-base" & "riscv,isa-extensions". For compatibility with other projects, "riscv,isa" remains. Reviewed-by: Samuel Holland Signed-off-by: Conor Dooley commit 561add0da6d3d07c9bccb0832fb6ed5619167d26 Author: Conor Dooley Date: Mon Oct 9 10:37:45 2023 +0100 riscv: dts: microchip: convert isa detection to new properties Convert the PolarFire SoC devicetrees to use the new properties "riscv,isa-base" & "riscv,isa-extensions". For compatibility with other projects, "riscv,isa" remains. Signed-off-by: Conor Dooley commit 45cfa8864cd3ae228ddb17bf2316a0ab3284f70d Author: Chandramohan Akula Date: Wed Oct 11 11:31:37 2023 -0700 RDMA/bnxt_re: Do not report SRQ error in srq notification In the SRQ notification handler, do not report the SRQ_ERROR in the default event case, as there was no error. Signed-off-by: Chandramohan Akula Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1697049097-31992-4-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit b02fd3f79ec32642bdcc8117a090f21338d50e89 Author: Chandramohan Akula Date: Wed Oct 11 11:31:36 2023 -0700 RDMA/bnxt_re: Report async events and errors Report QP, SRQ and CQ async events and errors. Signed-off-by: Chandramohan Akula Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1697049097-31992-3-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit d60a779673defca3116e8d106eda6a19fa371dbf Author: Chandramohan Akula Date: Wed Oct 11 11:31:35 2023 -0700 RDMA/bnxt_re: Update HW interface headers Updating the HW structures for the affiliated event and error reporting. Newly added interface structures will be used in the followup patch. Signed-off-by: Chandramohan Akula Signed-off-by: Selvin Xavier Link: https://lore.kernel.org/r/1697049097-31992-2-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Leon Romanovsky commit c1336bb4aa5e809a622a87d74311275514086596 Author: Patrisious Haddad Date: Mon Oct 9 13:41:20 2023 +0300 IB/mlx5: Fix rdma counter binding for RAW QP Previously when we had a RAW QP, we bound a counter to it when it moved to INIT state, using the counter context inside RQC. But when we try to modify that counter later in RTS state we used modify QP which tries to change the counter inside QPC instead of RQC. Now we correctly modify the counter set_id inside of RQC instead of QPC for the RAW QP. Fixes: d14133dd4161 ("IB/mlx5: Support set qp counter") Signed-off-by: Patrisious Haddad Reviewed-by: Mark Zhang Link: https://lore.kernel.org/r/2e5ab6713784a8fe997d19c508187a0dfecf2dfc.1696847964.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit 1d4836527d4168d648010909637fb6cfe45d3fac Author: Yury Norov Date: Sun Sep 24 19:38:16 2023 -0700 bitmap: drop _reg_op() function Now that all _reg_op() users are switched to alternative functions, _reg_op() machinery is not needed anymore. CC: Andy Shevchenko CC: Rasmus Villemoes Signed-off-by: Yury Norov commit 9276819a68b52cf2577f77985041faf527cf477c Author: Yury Norov Date: Sun Sep 24 19:38:15 2023 -0700 bitmap: replace _reg_op(REG_OP_ISFREE) with find_next_bit() _reg_op(REG_OP_ISFREE) can be trivially replaced with find_next_bit(). Doing that opens room for potential small_const_nbits() optimization. CC: Andy Shevchenko CC: Rasmus Villemoes Signed-off-by: Yury Norov commit add00c76ee4dafbc35b170bea144358fd62daebb Author: Yury Norov Date: Sun Sep 24 19:38:14 2023 -0700 bitmap: replace _reg_op(REG_OP_RELEASE) with bitmap_clear() _reg_op(REG_OP_RELEASE) duplicates bitmap_clear(). CC: Andy Shevchenko CC: Rasmus Villemoes Signed-off-by: Yury Norov commit eae5acbd7572f2874cd2f04dd540870dca256826 Author: Yury Norov Date: Sun Sep 24 19:38:13 2023 -0700 bitmap: replace _reg_op(REG_OP_ALLOC) with bitmap_set() _reg_op(REG_OP_ALLOC) duplicates bitmap_set(). CC: Andy Shevchenko CC: Rasmus Villemoes Signed-off-by: Yury Norov commit b085f969ed3df1916b9d9029225f2472df33cc17 Author: Yury Norov Date: Sun Sep 24 19:38:12 2023 -0700 bitmap: fix opencoded bitmap_allocate_region() bitmap_find_region() opencodes bitmap_allocate_region(). CC: Andy Shevchenko CC: Rasmus Villemoes Signed-off-by: Yury Norov commit 6d5d3a0c33e0b3cab91e2d229f94b51d80d91fe3 Author: Yury Norov Date: Sun Sep 24 19:38:11 2023 -0700 bitmap: add test for bitmap_*_region() functions Test basic functionality of bitmap_{allocate,release,find_free}_region() functions. CC: Rasmus Villemoes Reviewed-by: Andy Shevchenko Signed-off-by: Yury Norov commit 82bf9bdfbce9cfa73ccd86642542159119e0419f Author: Yury Norov Date: Sun Sep 24 19:38:10 2023 -0700 bitmap: align __reg_op() wrappers with modern coding style Fix comments so that scripts/kernel-doc doesn't warn, and fix for-loop stype in bitmap_find_free_region(). CC: Rasmus Villemoes Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Yury Norov commit aae06fc1b5a2e4b52f8504a1f12f9b8b98e80641 Author: Yury Norov Date: Sat Oct 7 16:35:10 2023 -0700 lib/bitmap: split-out string-related operations to a separate files lib/bitmap.c and corresponding include/linux/bitmap.h are intended to hold functions related to operations on bitmaps, like bitmap_shift or bitmap_set. Historically, some string-related operations like bitmap_parse are also reside in lib/bitmap.c. Now that the subsystem evolves, string-related bitmap operations became a significant part of the file. Because they are quite different from the other bitmap functions by nature, it's worth to split them to a separate source/header files. CC: Andrew Morton CC: Andy Shevchenko CC: Rasmus Villemoes Signed-off-by: Yury Norov commit 7733aa893847f021c674d0d30b723d892109369d Author: Andy Shevchenko Date: Thu Aug 17 19:20:54 2023 +0300 bitmap: Remove dead code, i.e. bitmap_copy_le() Besides the fact it's not used anywhere it should be implemented differently, i.e. via helpers from linux/byteorder/generic.h. Yet the helpers themselves need to be introduced first. Also note, the function lacks of the test cases, they must be provided. Hence, drop the current dead code for good. Signed-off-by: Andy Shevchenko Signed-off-by: Yury Norov commit 8ed13a762ca0661e4df16ce5eba929e73f4bd8f6 Author: Jonathan Neuschäfer Date: Mon Aug 14 19:37:08 2023 +0200 bitmap: Fix a typo ("identify map") A map in which each element is mapped to itself is called an "identity map". Signed-off-by: Jonathan Neuschäfer Reviewed-by: Andy Shevchenko Signed-off-by: Yury Norov commit 57f728d59f005dffdbb52a03531e480a71599bc5 Author: Randy Dunlap Date: Mon Jul 31 22:08:17 2023 -0700 cpumask: kernel-doc cleanups and additions Clean up some punctutation and abbreviations. Add kernel-doc notation for one function and function return value for 39 functions. cpumask.h: Fix some punctuation (plural vs. possessive). Fix some abbreviations (ie. -> i.e., id -> ID). Fix 35 warnings like this: include/linux/cpumask.h:161: warning: No description found for return value of 'cpumask_first' cpumask.c: Add Return: value for 4 functions. Add kernel-doc for cpumask_any_distribute(). Signed-off-by: Randy Dunlap Reviewed-by: Andy Shevchenko Signed-off-by: Yury Norov commit e77e6e3e909d33361c58af848a96e1f7f71ba7e4 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:08 2023 +0200 soc/pxa: ssp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/r/20230925095532.1984344-18-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König commit 630cc5e1e6b37df7725142b4fed872dea9a9a36b Author: Uwe Kleine-König Date: Mon Sep 25 11:55:06 2023 +0200 soc/mediatek: mtk-mmsys: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230925095532.1984344-16-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König commit a129ac3555c0dca6f04ae404dc0f0790656587fb Author: Uwe Kleine-König Date: Mon Sep 25 11:55:05 2023 +0200 soc/mediatek: mtk-devapc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230925095532.1984344-15-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König commit db758b73f83fad5a12463fd41942fd1b4fc3080d Author: Uwe Kleine-König Date: Mon Sep 25 11:55:04 2023 +0200 soc/loongson: loongson2_guts: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/r/20230925095532.1984344-14-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König commit 95589c0349829c9f4de823075e727af8f2016ebf Author: Uwe Kleine-König Date: Mon Sep 25 11:55:03 2023 +0200 soc/litex: litex_soc_ctrl: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Acked-by: Gabriel Somlo Link: https://lore.kernel.org/r/20230925095532.1984344-13-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König commit 48544eee87a5df20f469fbcd44776235db3bb0b8 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:02 2023 +0200 soc/ixp4xx: ixp4xx-qmgr: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/r/20230925095532.1984344-12-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König commit a25e745c752a0aa197296c0a6405255f19813b4b Author: Uwe Kleine-König Date: Mon Sep 25 11:55:01 2023 +0200 soc/ixp4xx: ixp4xx-npe: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/r/20230925095532.1984344-11-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König commit 3f40c999de39626f67aa36858801ec2906740125 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:00 2023 +0200 soc/hisilicon: kunpeng_hccs: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/r/20230925095532.1984344-10-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König commit 9a9b332db032ea17537ba6f5d6e6ddd3c0268d66 Author: Uwe Kleine-König Date: Mon Sep 25 11:54:59 2023 +0200 soc/fujitsu: a64fx-diag: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/r/20230925095532.1984344-9-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König commit ea32155a0383c937d5b057b3093a3a4c4ace7360 Author: Uwe Kleine-König Date: Mon Sep 25 11:54:58 2023 +0200 soc/fsl: cpm: tsa: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Acked-by: Herve Codina Link: https://lore.kernel.org/r/20230925095532.1984344-8-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König commit 14914a115e807aa2f8025e451133627a64120ac3 Author: Uwe Kleine-König Date: Mon Sep 25 11:54:57 2023 +0200 soc/fsl: cpm: qmc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Acked-by: Herve Codina Link: https://lore.kernel.org/r/20230925095532.1984344-7-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König commit e5f98e9f6a42b1055c83dd1e0f92320b28f3ebad Author: Uwe Kleine-König Date: Mon Sep 25 11:54:56 2023 +0200 soc/fsl: dpaa2-console: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/r/20230925095532.1984344-6-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König commit f741bcadfe52e424985926d4d1c1e3941bf8403e Author: Kees Cook Date: Fri Sep 22 10:52:57 2023 -0700 PCI: hv: Annotate struct hv_dr_state with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct hv_dr_state. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Link: https://lore.kernel.org/linux-pci/20230922175257.work.900-kees@kernel.org Signed-off-by: Kees Cook Signed-off-by: Krzysztof Wilczyński Reviewed-by: "Gustavo A. R. Silva" Acked-by: Wei Liu Cc: Bjorn Helgaas Cc: Dexuan Cui Cc: Haiyang Zhang Cc: "K. Y. Srinivasan" Cc: Krzysztof Wilczyński Cc: Lorenzo Pieralisi Cc: Rob Herring Cc: Wei Liu Cc: linux-hyperv@vger.kernel.org Cc: linux-pci@vger.kernel.org commit 9f4f3dfad8cf08208fbb78b1b9cbf957c12618b9 Author: Manivannan Sadhasivam Date: Tue Oct 10 21:29:14 2023 +0530 PCI: qcom: Enable ASPM for platforms supporting 1.9.0 ops ASPM is supported by Qcom host controllers/bridges on most of the recent platforms and so the devices tested so far. But for enabling ASPM by default (without using Kconfig, kernel command-line or sysfs), BIOS has to enable ASPM on both host bridge and downstream devices during boot. Unfortunately, none of the BIOS available on Qcom platforms enables ASPM. Due to this, the platforms making use of Qcom SoCs draw high power during runtime. To fix this power draw issue, users have to enable ASPM using Kconfig, kernel command-line, sysfs or the BIOS has to start enabling ASPM. The latter may happen in the future, but that won't address the issue on current platforms. Also, asking users to enable a feature to get the power management right would provide an unpleasant out-of-the-box experience. So the apt solution is to enable ASPM in the controller driver itself. And this is being accomplished by calling pci_enable_link_state() in the newly introduced host_post_init() callback for all the devices connected to the bus. This function enables all supported link low power states for both host bridge and the downstream devices. Due to limited testing, ASPM is only enabled for platforms making use of ops_1_9_0 callbacks. [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/20231010155914.9516-3-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Krzysztof Wilczyński commit a78794562fcb2659c976388b1285eddda97e9954 Author: Manivannan Sadhasivam Date: Tue Oct 10 21:29:13 2023 +0530 PCI: dwc: Add host_post_init() callback This callback can be used by the platform drivers to do configuration once all the devices are scanned. Like changing LNKCTL of all downstream devices to enable ASPM etc... Link: https://lore.kernel.org/linux-pci/20231010155914.9516-2-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Krzysztof Wilczyński commit 85e9eb3e7727e98cbf7b9bf475677f2a64be06b8 Author: Manivannan Sadhasivam Date: Wed Oct 4 22:14:30 2023 +0530 PCI: tegra194: Use Mbps_to_icc() macro for setting icc speed PCIe speed returned by the PCIE_SPEED2MBS_ENC() macro is in Mbps. So instead of converting it to MBps explicitly and using the MBps_to_icc() macro, let's use the Mbps_to_icc() macro to pass the value directly. Link: https://lore.kernel.org/linux-pci/20231004164430.39662-3-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Krzysztof Wilczyński Reviewed-by: Konrad Dybcio Cc: Vidya Sagar commit dc2f2a9d1cf2c505efbb8b7e782a7f22e635f4bf Author: Manivannan Sadhasivam Date: Wed Oct 4 22:14:29 2023 +0530 PCI: qcom-ep: Use PCIE_SPEED2MBS_ENC() macro for encoding link speed Instead of hardcoding the link speed in MBps, use existing PCIE_SPEED2MBS_ENC() macro that does the encoding of the link speed for us. Also, let's Wrap it with QCOM_PCIE_LINK_SPEED_TO_BW() macro to do the conversion to ICC speed. This eliminates the need for a switch case in qcom_pcie_icc_update() and also works for future Gen speeds without any code modifications. Suggested-by: Bjorn Helgaas Link: https://lore.kernel.org/linux-pci/20231004164430.39662-2-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Krzysztof Wilczyński Reviewed-by: Konrad Dybcio commit 8da2e9af0bb5217361f4ddde0d9b820b45c185e8 Author: Manivannan Sadhasivam Date: Wed Oct 4 22:14:28 2023 +0530 PCI: qcom: Use PCIE_SPEED2MBS_ENC() macro for encoding link speed Instead of hardcoding the link speed in MBps, use existing PCIE_SPEED2MBS_ENC() macro that does the encoding of the link speed for us. Also, let's Wrap it with QCOM_PCIE_LINK_SPEED_TO_BW() macro to do the conversion to ICC speed. This eliminates the need for a switch case in qcom_pcie_icc_update() and also works for future Gen speeds without any code modifications. Suggested-by: Bjorn Helgaas Link: https://lore.kernel.org/linux-pci/20231004164430.39662-1-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam Signed-off-by: Krzysztof Wilczyński Reviewed-by: Konrad Dybcio commit 627aa13921c316ac5385237c673ee54612530d94 Author: Leon Romanovsky Date: Thu Oct 12 12:27:50 2023 -0700 net/mlx5e: Allow IPsec soft/hard limits in bytes Actually the mlx5 code already has needed support to allow users to configure soft/hard limits in bytes. It is possible due to the situation with TX path, where CX7 devices are missing hardware implementation to send events to the software, see commit b2f7b01d36a9 ("net/mlx5e: Simulate missing IPsec TX limits hardware functionality"). That software workaround is not limited to TX and works for bytes too. So relax the validation logic to not block soft/hard limits in bytes. Reviewed-by: Patrisious Haddad Signed-off-by: Leon Romanovsky Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit 6dd6eaf43e8d22f61c7a5cee3c9fb46118c97175 Author: Adham Faris Date: Thu Oct 12 12:27:49 2023 -0700 net/mlx5e: Increase max supported channels number to 256 Increase max supported channels number to 256 (it is not extended further due to testing disabilities). Signed-off-by: Adham Faris Reviewed-by: Tariq Toukan Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit 74a8dadac17e2bce4ae2a092dda3bf1003dc30e7 Author: Adham Faris Date: Thu Oct 12 12:27:48 2023 -0700 net/mlx5e: Preparations for supporting larger number of channels Data center server CPUs number keeps getting larger with time. Currently, our driver limits the number of channels to 128. Maximum channels number is enforced and bounded by hardcoded defines (en.h/MLX5E_MAX_NUM_CHANNELS) even though the device and machine (CPUs num) can allow more. Refactor current implementation in order to handle further channels. The maximum supported channels number will be increased in the followup patch. Introduce RQT size calculation/allocation scheme below: 1) Preserve current RQT size of 256 for channels number up to 128 (the old limit). 2) For greater channels number, RQT size is calculated by multiplying the channels number by 2 and rounding up the result to the nearest power of 2. If the calculated RQT size exceeds the maximum supported size by the NIC, fallback to this maximum RQT size (1 << log_max_rqt_size). Since RQT size is no more static, allocate and free the indirection table SW shadow dynamically. Signed-off-by: Adham Faris Reviewed-by: Tariq Toukan Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit 0d806cf9c007469e38594322bc39f25da8c5f7d7 Author: Adham Faris Date: Thu Oct 12 12:27:47 2023 -0700 net/mlx5e: Refactor mlx5e_rss_init() and mlx5e_rss_free() API's Introduce code refactoring below: 1) Introduce single API for creating and destroying rss object, mlx5e_rss_create() and mlx5e_rss_destroy() respectively. 2) mlx5e_rss_create() constructs and initializes RSS object depends on a function new param enum mlx5e_rss_create_type. Callers (like rx_res.c) will no longer need to allocate RSS object via mlx5e_rss_alloc() and initialize it immediately via mlx5e_rss_init_no_tirs() or mlx5e_rss_init(), this will be done by a single call to mlx5e_rss_create(). Hence, mlx5e_rss_alloc() and mlx5e_rss_init_no_tirs() have been removed from rss.h file and became static functions. Signed-off-by: Adham Faris Reviewed-by: Tariq Toukan Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit cae8e6dea279230387d00ccb8c682e6a80ea1989 Author: Adham Faris Date: Thu Oct 12 12:27:46 2023 -0700 net/mlx5e: Refactor mlx5e_rss_set_rxfh() and mlx5e_rss_get_rxfh() Initialize indirect table array with memcpy rather than for loop. This change has made for two reasons: 1) To be consistent with the indirect table array init in mlx5e_rss_set_rxfh(). 2) In general, prefer to use memcpy for array initializing rather than for loop. Signed-off-by: Adham Faris Reviewed-by: Tariq Toukan Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit d90ea84375b86051e3e648dc9a8fc99919da6b42 Author: Adham Faris Date: Thu Oct 12 12:27:45 2023 -0700 net/mlx5e: Refactor rx_res_init() and rx_res_free() APIs Refactor mlx5e_rx_res_init() and mlx5e_rx_res_free() by wrapping mlx5e_rx_res_alloc() and mlx5e_rx_res_destroy() API's respectively. Signed-off-by: Adham Faris Reviewed-by: Tariq Toukan Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit 5a37b2882418f086951e657dd1ed26e8842f84cd Author: Yu Liao Date: Thu Oct 12 12:27:44 2023 -0700 net/mlx5e: Use PTR_ERR_OR_ZERO() to simplify code Use the standard error pointer macro to shorten the code and simplify. Signed-off-by: Yu Liao Reviewed-by: Leon Romanovsky Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit 68e81110fbcfc0c9a655b4629b19fd21b6b16c47 Author: Jinjie Ruan Date: Thu Oct 12 12:27:43 2023 -0700 net/mlx5: Use PTR_ERR_OR_ZERO() to simplify code Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to simplify code. Signed-off-by: Jinjie Ruan Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit 58cd34772a30d5cbe9fec7d199772149946a4032 Author: Lukas Bulwahn Date: Thu Oct 12 12:27:42 2023 -0700 net/mlx5: fix config name in Kconfig parameter documentation Commit a12ba19269d7 ("net/mlx5: Update Kconfig parameter documentation") adds documentation on Kconfig options for the mlx5 driver. It refers to the config MLX5_EN_MACSEC for MACSec offloading, but the config is actually called MLX5_MACSEC. Fix the reference to the right config name in the documentation. Signed-off-by: Lukas Bulwahn Signed-off-by: Saeed Mahameed commit 0d2d6bc7e74fee586f587d33484b797bb78f334c Author: Yue Haibing Date: Thu Oct 12 12:27:41 2023 -0700 net/mlx5: Remove unused declaration Commit 2ac9cfe78223 ("net/mlx5e: IPSec, Add Innova IPSec offload TX data path") declared mlx5e_ipsec_inverse_table_init() but never implemented it. Commit f52f2faee581 ("net/mlx5e: Introduce flow steering API") declared mlx5e_fs_set_tc() but never implemented it. Commit f2f3df550139 ("net/mlx5: EQ, Privatize eq_table and friends") declared mlx5_eq_comp_cpumask() but never implemented it. Commit cac1eb2cf2e3 ("net/mlx5: Lag, properly lock eswitch if needed") removed mlx5_lag_update() but not its declaration. Commit 35ba005d820b ("net/mlx5: DR, Set flex parser for TNL_MPLS dynamically") removed mlx5dr_ste_build_tnl_mpls() but not its declaration. Commit e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") declared but never implemented mlx5_alloc_cmd_mailbox_chain() and mlx5_free_cmd_mailbox_chain(). Commit 0cf53c124756 ("net/mlx5: FWPage, Use async events chain") removed mlx5_core_req_pages_handler() but not its declaration. Commit 938fe83c8dcb ("net/mlx5_core: New device capabilities handling") removed mlx5_query_odp_caps() but not its declaration. Commit f6a8a19bb11b ("RDMA/netdev: Hoist alloc_netdev_mqs out of the driver") removed mlx5_rdma_netdev_alloc() but not its declaration. Signed-off-by: Yue Haibing Reviewed-by: Leon Romanovsky Reviewed-by: Simon Horman Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit b430c1b4f63be51dde175a1dd3addba65ca24e2b Author: Shay Drory Date: Thu Oct 12 12:27:40 2023 -0700 net/mlx5: Replace global mlx5_intf_lock with HCA devcom component lock mlx5_intf_lock is used to sync between LAG changes and its slaves mlx5 core dev aux devices changes, which means every time mlx5 core dev add/remove aux devices, mlx5 is taking this global lock, even if LAG functionality isn't supported over the core dev. This cause a bottleneck when probing VFs/SFs in parallel. Hence, replace mlx5_intf_lock with HCA devcom component lock, or no lock if LAG functionality isn't supported. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit e534552c92a44690e48593f9567fe689545ded73 Author: Shay Drory Date: Thu Oct 12 12:27:39 2023 -0700 net/mlx5: Refactor LAG peer device lookout bus logic to mlx5 devcom LAG peer device lookout bus logic required the usage of global lock, mlx5_intf_mutex. As part of the effort to remove this global lock, refactor LAG peer device lookout to use mlx5 devcom layer. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit 89d351c2241a1ec7415d9667eb5fa4af00c373ae Author: Shay Drory Date: Thu Oct 12 12:27:38 2023 -0700 net/mlx5: Avoid false positive lockdep warning by adding lock_class_key Downstream patch will add devcom component which will be locked in many places. This can lead to a false positive "possible circular locking dependency" warning by lockdep, on flows which lock more than one mlx5 devcom component, such as probing ETH aux device. Hence, add a lock_class_key per mlx5 device. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit 15fa898aebe5b5fdff393bde8c81ba8b6e7427bf Author: Wei Zhang Date: Thu Oct 12 12:27:37 2023 -0700 net/mlx5: Redesign SF active work to remove table_lock active_work is a work that iterates over all possible SF devices which their SF port representors are located on different function, and in case SF is in active state, probes it. Currently, the active_work in active_wq is synced with mlx5_vhca_events_work via table_lock and this lock causing a bottleneck in performance. To remove table_lock, redesign active_wq logic so that it now pushes active_work per SF to mlx5_vhca_events_workqueues. Since the latter workqueues are ordered, active_work and mlx5_vhca_events_work with same index will be pushed into same workqueue, thus it completely eliminates the need for a lock. Signed-off-by: Wei Zhang Signed-off-by: Shay Drory Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit 3f7f31fff2510272334f3d0374c432bdaa4f1536 Author: Wei Zhang Date: Thu Oct 12 12:27:36 2023 -0700 net/mlx5: Parallelize vhca event handling At present, mlx5 driver have a general purpose event handler which not only handles vhca event but also many other events. This incurs a huge bottleneck because the event handler is implemented by single threaded workqueue and all events are forced to be handled in serial manner even though application tries to create multiple SFs simultaneously. Introduce a dedicated vhca event handler which manages SFs parallel creation. Signed-off-by: Wei Zhang Reviewed-by: Moshe Shemesh Reviewed-by: Shay Drory Reviewed-by: Jacob Keller Signed-off-by: Saeed Mahameed commit 89a1d2f064d2ae77a9cd6a8c7ac42b3c1647efa5 Author: Rob Herring Date: Fri Oct 6 17:44:39 2023 -0500 iio: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006224440.442864-1-robh@kernel.org Signed-off-by: Jonathan Cameron commit 349c1b49ffafd9f0e49153599efd5cd251ba60b1 Author: Marius Cristea Date: Fri Oct 13 16:23:33 2023 +0300 iio: adc: MCP3564: fix warn: unsigned '__x' is never less than zero. The patch 33ec3e5fc1ea: "iio: adc: adding support for MCP3564 ADC" leads to the following Smatch static checker warning: smatch warnings: drivers/iio/adc/mcp3564.c:1105 mcp3564_fill_scale_tbls() warn: unsigned '__x' is never less than zero. vim +/__x +1105 drivers/iio/adc/mcp3564.c 1094 1095 static void mcp3564_fill_scale_tbls(struct mcp3564_state *adc) 1096 { ..... 1103 for (i = 0; i < MCP3564_MAX_PGA; i++) { 1104 ref = adc->vref_mv; > 1105 tmp1 = shift_right((u64)ref * NANO, pow); 1106 div_u64_rem(tmp1, NANO, &tmp0); 1107 ..... 1113 } Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309280738.NWjVfVt4-lkp@intel.com/ Fixes: 33ec3e5fc1ea (iio: adc: adding support for MCP3564 ADC) Signed-off-by: Marius Cristea Link: https://lore.kernel.org/r/20231013132333.10582-1-marius.cristea@microchip.com Signed-off-by: Jonathan Cameron commit e16247acaeb9cae49ca92133ac18a1bfc4c40060 Author: Javier Carrasco Date: Thu Oct 12 22:07:08 2023 +0200 dt-bindings: trivial-devices: add silabs,si7005 This simple I2C humidity sensor does not have any additional properties and can be added to the trivial-devices binding. Signed-off-by: Javier Carrasco Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231012-topic-si7005_devicetree-v1-2-6c8a6fa7b3ec@gmail.com Signed-off-by: Jonathan Cameron commit b1a078a8b0dbfcac8b61618282295124e30a9dce Author: Javier Carrasco Date: Thu Oct 12 22:07:07 2023 +0200 iio: si7005: Add device tree support This device supports ACPI detection but lacks of the device tree counterpart. Add device tree support. Signed-off-by: Javier Carrasco Link: https://lore.kernel.org/r/20231012-topic-si7005_devicetree-v1-1-6c8a6fa7b3ec@gmail.com Signed-off-by: Jonathan Cameron commit ba251b20152c3bc6edaa05413090ca5b5f8deb7f Author: Ramona Gradinariu Date: Thu Oct 12 15:24:56 2023 +0300 drivers: imu: adis16475.c: Remove scan index from delta channels Some devices do not support delta angle and delta velocity burst readings, which means there should be no buffer support for these types of channels. A new list of channels is created which contains the delta channels structures with the scan index equal to -1 to allow for raw register readings, without buffer support. This list of channels is assigned to the devices which do not support delta angle and delta velocity burst readings. Fixes: 8f6bc87d67c0 ("iio: imu: adis16475.c: Add delta angle and delta velocity channels") Signed-off-by: Ramona Gradinariu Reviewed-by: Nuno Sa Link: https://lore.kernel.org/r/20231012122456.765709-2-ramona.gradinariu@analog.com Signed-off-by: Jonathan Cameron commit e9d8add6e72b1642bcf895601146c713d068775a Author: Martin Kepplinger Date: Thu Oct 12 14:20:41 2023 +0000 dt-bindings: iio: imu: st,lsm6dsx: add mount-matrix property Add the mount-matrix optional property to the binding since it's supported and very useful when using the chip on a board. Signed-off-by: Martin Kepplinger Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231012142041.253332-1-martink@posteo.de Signed-off-by: Jonathan Cameron commit 73006239ef2313f1986f86af86f8b06150a807e9 Author: David Lechner Date: Thu Oct 12 11:18:13 2023 -0500 iio: resolver: ad2s1210: remove of_match_ptr() To be consistent with the rest of iio, remove of_match_ptr(). It does not do anything useful here. Suggested-by: Jonathan Cameron Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231012-ad2s1210-mainline-v1-2-b2ee31c0e9dd@baylibre.com Signed-off-by: Jonathan Cameron commit 0f7fa242b355ed102deb49f8b85e0d0f0d323717 Author: David Lechner Date: Thu Oct 12 11:18:12 2023 -0500 iio: resolver: ad2s1210: remove DRV_NAME macro The DRV_NAME macro is only used in one place in the ad2s1210 driver and is not really needed so let's remove it. Suggested-by: Jonathan Cameron Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231012-ad2s1210-mainline-v1-1-b2ee31c0e9dd@baylibre.com Signed-off-by: Jonathan Cameron commit 80bac83a739d36d227aa5c54f6ed417f13c086dd Author: Matthew Maurer Date: Thu Oct 5 21:39:58 2023 +0000 rust: Respect HOSTCC when linking for host Currently, rustc defaults to invoking `cc`, even if `HOSTCC` is defined, resulting in build failures in hermetic environments where `cc` does not exist. This includes both hostprogs and proc-macros. Since we are setting the linker to `HOSTCC`, we set the linker flavor to `gcc` explicitly. The linker-flavor selects both which linker to search for if the linker is unset, and which kind of linker flags to pass. Without this flag, `rustc` would attempt to determine which flags to pass based on the name of the binary passed as `HOSTCC`. `gcc` is the name of the linker-flavor used by `rustc` for all C compilers, including both `gcc` and `clang`. Signed-off-by: Matthew Maurer Reviewed-by: Martin Rodriguez Reboredo Tested-by: Alice Ryhl Reviewed-by: Nick Desaulniers Acked-by: Miguel Ojeda Signed-off-by: Masahiro Yamada commit 886ee55eabac0d46faf8bc0b22207ca2740847ba Author: Ingo Molnar Date: Fri Oct 13 10:15:46 2023 +0200 locking/seqlock: Propagate 'const' pointers within read-only methods, remove forced type casts Currently __seqprop_ptr() is an inline function that must chose to either use 'const' or non-const seqcount related pointers - but this results in the undesirable loss of 'const' propagation, via a forced type cast. The easiest solution would be to turn the pointer wrappers into macros that pass through whatever type is passed to them - but the clever maze of seqlock API instantiation macros relies on the GCC CPP '##' macro extension, which isn't recursive, so inline functions must be used here. So create two wrapper variants instead: 'ptr' and 'const_ptr', and pick the right one for the codepaths that are const: read_seqcount_begin() and read_seqcount_retry(). This cleans up type handling and allows the removal of all type forcing. No change in functionality. Signed-off-by: Ingo Molnar Reviewed-by: Oleg Nesterov Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Waiman Long Cc: Will Deacon Cc: Thomas Gleixner Cc: Paul E. McKenney commit b650981501bf00bc84f09cf3b3e0b6190cfed794 Author: Zong-Zhe Yang Date: Thu Oct 12 10:14:55 2023 +0800 wifi: rtw89: mac: do bf_monitor only if WiFi 6 chips Beamforming monitor is used to adjust registers to fine tune performance and power save, and currently only existing WiFi 6 chips need it. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231012021455.19816-7-pkshih@realtek.com commit 31b7cd195af7070b91bdb24bab69f86e3888db5a Author: Zong-Zhe Yang Date: Thu Oct 12 10:14:54 2023 +0800 wifi: rtw89: mac: set bf_assoc capabilities according to chip gen When associated peer has beamformer capability, we should enable beamformee, set CSI parameter, and configure rate to send CSI packets. Since registers of WiFi 7 chips are very different from existing chips, separate configuration functions. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231012021455.19816-6-pkshih@realtek.com commit 5fa1c5d416d586ce17b49a727eae9877ed895b06 Author: Zong-Zhe Yang Date: Thu Oct 12 10:14:53 2023 +0800 wifi: rtw89: mac: set bfee_ctrl() according to chip gen When associated peer has beamformer capability, enable hardware beamformee function, and then hardware can run sounding protocol itself. Oppositely, disable this function when disassociated. Define different registers for WiFi 6 and 7 generations respectively. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231012021455.19816-5-pkshih@realtek.com commit 79c55327cf2491fb233cee27e29a116f22e68519 Author: Ping-Ke Shih Date: Thu Oct 12 10:14:52 2023 +0800 wifi: rtw89: mac: add registers of MU-EDCA parameters for WiFi 7 chips According to chip generation, set MU-EDCA parameters from mac80211 when connected. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231012021455.19816-4-pkshih@realtek.com commit 7f69cd4253c3211081e34949890bfc84ee041328 Author: Zong-Zhe Yang Date: Thu Oct 12 10:14:51 2023 +0800 wifi: rtw89: mac: generalize register of MU-EDCA switch according to chip gen When connected with 802.11ax AP, MU-EDCA parameters are given, so enable this hardware function by registers according to chip generation. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231012021455.19816-3-pkshih@realtek.com commit fbd1829d2960b02b4ac7372458fd9dcd8d19e7a5 Author: Zong-Zhe Yang Date: Thu Oct 12 10:14:50 2023 +0800 wifi: rtw89: mac: update RTS threshold according to chip gen When TX size or time of packet over RTS threshold set by this register, hardware will use RTS protection automatically. Since WiFi 6 and 7 chips have different register address for this, separate the address according to chip gen. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231012021455.19816-2-pkshih@realtek.com commit 461908825205e1d08f605ffaa09b7f8bf13c1d5c Author: Dmitry Antipov Date: Wed Oct 11 18:44:37 2023 +0300 wifi: rtlwifi: simplify TX command fill callbacks Since 'rtlpriv->cfg->ops->fill_tx_cmddesc()' is always called with 'firstseg' and 'lastseg' set to 1 (and the latter is never actually used), all of the relevant chip-specific routines may be simplified. Compile tested only. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231011154442.52457-2-dmantipov@yandex.ru commit f35ccb65bd1857dec893e0a7496eec81d897916d Author: Arnd Bergmann Date: Wed Oct 11 16:02:24 2023 +0200 wifi: hostap: remove unused ioctl function The ioctl handler has no actual callers in the kernel and is useless. All the functionality should be reachable through the regualar interfaces. Acked-by: Kalle Valo Signed-off-by: Arnd Bergmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231011140225.253106-9-arnd@kernel.org commit 166ab7ca3418948a7fc5be06e460b7c2beb1fa13 Author: Arnd Bergmann Date: Wed Oct 11 16:02:23 2023 +0200 wifi: atmel: remove unused ioctl function This function has no callers, and for the past 20 years, the request_firmware interface has been in place instead of the custom firmware loader. Acked-by: Kalle Valo Signed-off-by: Arnd Bergmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231011140225.253106-8-arnd@kernel.org commit 5b90073defd1a52aa8120403d79f6e0fc10c87ee Author: Weili Qian Date: Sun Oct 8 20:36:17 2023 +0800 crypto: hisilicon/qm - alloc buffer to set and get xqc If the temporarily applied memory is used to set or get the xqc information, the driver releases the memory immediately after the hardware mailbox operation time exceeds the driver waiting time. However, the hardware does not cancel the operation, so the hardware may write data to released memory. Therefore, when the driver is bound to a device, the driver reserves memory for the xqc configuration. The subsequent xqc configuration uses the reserved memory to prevent hardware from accessing the released memory. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 6cd256694afe2a0a94f62418fea95279de2b7ada Author: Rob Herring Date: Fri Oct 13 20:09:33 2023 -0700 Input: tegra-kbc - use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20231006224432.442709-1-robh@kernel.org Signed-off-by: Dmitry Torokhov commit 787650cc335201a0489905c5504a9179470ebc51 Author: Kees Cook Date: Fri Oct 13 20:04:12 2023 -0700 Input: Annotate struct ff_device with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ff_device. Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20231006201739.work.350-kees@kernel.org Signed-off-by: Dmitry Torokhov commit 85605fb694f084ba017c93c150e668882445ce73 Author: Lukas Bulwahn Date: Thu Oct 12 08:34:43 2023 +0200 appletalk: remove special handling code for ipddp After commit 1dab47139e61 ("appletalk: remove ipddp driver") removes the config IPDDP, there is some minor code clean-up possible in the appletalk network layer. Remove some code in appletalk layer after the ipddp driver is gone. Signed-off-by: Lukas Bulwahn Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231012063443.22368-1-lukas.bulwahn@gmail.com Signed-off-by: Jakub Kicinski commit a02527363abb33eae49b35955886b7f41d2bcf0f Author: Justin Stitt Date: Thu Oct 12 18:35:41 2023 +0000 qed: replace uses of strncpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. This patch eliminates three uses of strncpy(): Firstly, `dest` is expected to be NUL-terminated which is evident by the manual setting of a NUL-byte at size - 1. For this use specifically, strscpy() is a viable replacement due to the fact that it guarantees NUL-termination on the destination buffer. The next two cases should simply be memcpy() as the size of the src string is always 3 and the destination string just wants the first 3 bytes changed. To be clear, there are no buffer overread bugs in the current code as the sizes and offsets are carefully managed such that buffers are NUL-terminated. However, with these changes, the code is now more robust and less ambiguous (and hopefully easier to read). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231012-strncpy-drivers-net-ethernet-qlogic-qed-qed_debug-c-v2-1-16d2c0162b80@google.com Signed-off-by: Jakub Kicinski commit 621735f590643e3048ca2060c285b80551660601 Author: Heiner Kallweit Date: Thu Oct 12 08:51:13 2023 +0200 r8169: fix rare issue with broken rx after link-down on RTL8125 In very rare cases (I've seen two reports so far about different RTL8125 chip versions) it seems the MAC locks up when link goes down and requires a software reset to get revived. Realtek doesn't publish hw errata information, therefore the root cause is unknown. Realtek vendor drivers do a full hw re-initialization on each link-up event, the slimmed-down variant here was reported to fix the issue for the reporting user. It's not fully clear which parts of the NIC are reset as part of the software reset, therefore I can't rule out side effects. Fixes: f1bce4ad2f1c ("r8169: add support for RTL8125") Reported-by: Martin Kjær Jørgensen Link: https://lore.kernel.org/netdev/97ec2232-3257-316c-c3e7-a08192ce16a6@gmail.com/T/ Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/9edde757-9c3b-4730-be3b-0ef3a374ff71@gmail.com Signed-off-by: Jakub Kicinski commit 1efddc064e1802ceb995c8f51b3a9135af79f7cd Merge: 220dd227ca3ae 7eeb84d89f2e5 Author: Jakub Kicinski Date: Fri Oct 13 17:26:39 2023 -0700 Merge branch 'net-netconsole-configfs-entries-for-boot-target' Breno Leitao says: ==================== net: netconsole: configfs entries for boot target There is a limitation in netconsole, where it is impossible to disable or modify the target created from the command line parameter. (netconsole=...). "netconsole" cmdline parameter sets the remote IP, and if the remote IP changes, the machine needs to be rebooted (with the new remote IP set in the command line parameter). This allows the user to modify a target without the need to restart the machine. This functionality sits on top of the dynamic target reconfiguration that is already implemented in netconsole. The way to modify a boot time target is creating special named configfs directories, that will be associated with the targets coming from `netconsole=...`. Example: Let's suppose you have two netconsole targets defined at boot time:: netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc;4444@10.0.0.1/eth1,9353@10.0.0.3/12:34:56:78:9a:bc You can modify these targets in runtime by creating the following targets:: $ mkdir cmdline1 $ cat cmdline1/remote_ip 10.0.0.3 $ echo 0 > cmdline1/enabled $ echo 10.0.0.4 > cmdline1/remote_ip $ echo 1 > cmdline1/enabled ==================== Link: https://lore.kernel.org/r/20231012111401.333798-1-leitao@debian.org Signed-off-by: Jakub Kicinski commit 7eeb84d89f2e561ac5b97e0142c029908ddf00d5 Author: Breno Leitao Date: Thu Oct 12 04:14:01 2023 -0700 Documentation: netconsole: add support for cmdline targets With the previous patches, there is no more limitation at modifying the targets created at boot time (or module load time). Document the way on how to create the configfs directories to be able to modify these netconsole targets. The design discussion about this topic could be found at: https://lore.kernel.org/all/ZRWRal5bW93px4km@gmail.com/ Signed-off-by: Breno Leitao Link: https://lore.kernel.org/r/20231012111401.333798-5-leitao@debian.org Signed-off-by: Jakub Kicinski commit 5fbd6cdbe304b4154f63e3f8abf7c9c644ccb62c Author: Breno Leitao Date: Thu Oct 12 04:14:00 2023 -0700 netconsole: Attach cmdline target to dynamic target Enable the attachment of a dynamic target to the target created during boot time. The boot-time targets are named as "cmdline\d", where "\d" is a number starting at 0. If the user creates a dynamic target named "cmdline0", it will attach to the first target created at boot time (as defined in the `netconsole=...` command line argument). `cmdline1` will attach to the second target and so forth. If there is no netconsole target created at boot time, then, the target name could be reused. Relevant design discussion: https://lore.kernel.org/all/ZRWRal5bW93px4km@gmail.com/ Suggested-by: Joel Becker Signed-off-by: Breno Leitao Link: https://lore.kernel.org/r/20231012111401.333798-4-leitao@debian.org Signed-off-by: Jakub Kicinski commit 131eeb45b96107b19f9f231d6e81348b471b2ed0 Author: Breno Leitao Date: Thu Oct 12 04:13:59 2023 -0700 netconsole: Initialize configfs_item for default targets For netconsole targets allocated during the boot time (passing netconsole=... argument), netconsole_target->item is not initialized. That is not a problem because it is not used inside configfs. An upcoming patch will be using it, thus, initialize the targets with the name 'cmdline' plus a counter starting from 0. This name will match entries in the configfs later. Suggested-by: Joel Becker Signed-off-by: Breno Leitao Link: https://lore.kernel.org/r/20231012111401.333798-3-leitao@debian.org Signed-off-by: Jakub Kicinski commit 28856ab2c0b5b6e87b9a9739a0b59b6ff83689bd Author: Breno Leitao Date: Thu Oct 12 04:13:58 2023 -0700 netconsole: move init/cleanup functions lower Move alloc_param_target() and its counterpart (free_param_target()) to the bottom of the file. These functions are called mostly at initialization/cleanup of the module, and they should be just above the callers, at the bottom of the file. From a practical perspective, having alloc_param_target() at the bottom of the file will avoid forward declaration later (in the following patch). Nothing changed other than the functions location. Suggested-by: Jakub Kicinski Signed-off-by: Breno Leitao Link: https://lore.kernel.org/r/20231012111401.333798-2-leitao@debian.org Signed-off-by: Jakub Kicinski commit 220dd227ca3aec6ab65fcdfd4549ce12fe326249 Author: Justin Stitt Date: Thu Oct 12 20:38:19 2023 +0000 sfc: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. `desc` is expected to be NUL-terminated as evident by the manual NUL-byte assignment. Moreover, NUL-padding does not seem to be necessary. The only caller of efx_mcdi_nvram_metadata() is efx_devlink_info_nvram_partition() which provides a NULL for `desc`: | rc = efx_mcdi_nvram_metadata(efx, partition_type, NULL, version, NULL, 0); Due to this, I am not sure this code is even reached but we should still favor something other than strncpy. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Acked-by: Edward Cree Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231012-strncpy-drivers-net-ethernet-sfc-mcdi-c-v1-1-478c8de1039d@google.com Signed-off-by: Jakub Kicinski commit c3983d5e99b2f11839451fc264a7321163e9e893 Author: Justin Stitt Date: Thu Oct 12 22:25:12 2023 +0000 net: phy: tja11xx: replace deprecated strncpy with ethtool_sprintf strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of this dedicated helper function. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231012-strncpy-drivers-net-phy-nxp-tja11xx-c-v1-1-5ad6c9dff5c4@google.com Signed-off-by: Jakub Kicinski commit ad0ebd8b445763a9e0f130822c1527ce0d67bd3a Author: Justin Stitt Date: Wed Oct 11 21:53:44 2023 +0000 ionic: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. NUL-padding is not needed due to `ident` being memset'd to 0 just before the copy. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Shannon Nelson Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231011-strncpy-drivers-net-ethernet-pensando-ionic-ionic_main-c-v1-1-23c62a16ff58@google.com Signed-off-by: Jakub Kicinski commit e343023e03d2bdadf6551298863c09b4cba5963d Author: Justin Stitt Date: Wed Oct 11 21:37:18 2023 +0000 net: sparx5: replace deprecated strncpy with ethtool_sprintf strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy() in favor of this more robust and easier to understand interface. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231011-strncpy-drivers-net-ethernet-microchip-sparx5-sparx5_ethtool-c-v1-1-410953d07f42@google.com Signed-off-by: Jakub Kicinski commit 88fca39b660b97651fbf5ba18074b7999fab98a7 Author: Justin Stitt Date: Wed Oct 11 21:04:37 2023 +0000 net/mlx4_core: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect `dst` to be NUL-terminated based on its use with format strings: | mlx4_dbg(dev, "Reporting Driver Version to FW: %s\n", dst); Moreover, NUL-padding is not required. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Reviewed-by: Saeed Mahameed Link: https://lore.kernel.org/r/20231011-strncpy-drivers-net-ethernet-mellanox-mlx4-fw-c-v1-1-4d7b5d34c933@google.com Signed-off-by: Jakub Kicinski commit d273e99b5623bba5a9b63c18ee5ef597c2fdabc1 Author: Justin Stitt Date: Wed Oct 11 21:48:39 2023 +0000 nfp: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect res->name to be NUL-terminated based on its usage with format strings: | dev_err(cpp->dev.parent, "Dangling area: %d:%d:%d:0x%0llx-0x%0llx%s%s\n", | NFP_CPP_ID_TARGET_of(res->cpp_id), | NFP_CPP_ID_ACTION_of(res->cpp_id), | NFP_CPP_ID_TOKEN_of(res->cpp_id), | res->start, res->end, | res->name ? " " : "", | res->name ? res->name : ""); ... and with strcmp() | if (!strcmp(res->name, NFP_RESOURCE_TBL_NAME)) { Moreover, NUL-padding is not required as `res` is already zero-allocated: | res = kzalloc(sizeof(*res), GFP_KERNEL); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Let's also opt to use the more idiomatic strscpy() usage of (dest, src, sizeof(dest)) rather than (dest, src, SOME_LEN). Typically the pattern of 1) allocate memory for string, 2) copy string into freshly-allocated memory is a candidate for kmemdup_nul() but in this case we are allocating the entirety of the `res` struct and that should stay as is. As mentioned above, simple 1:1 replacement of strncpy -> strscpy :) Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Acked-by: Louis Peens Link: https://lore.kernel.org/r/20231011-strncpy-drivers-net-ethernet-netronome-nfp-nfpcore-nfp_resource-c-v1-1-7d1c984f0eba@google.com Signed-off-by: Jakub Kicinski commit 958a140d7a0afcac3c0bb0d3b262a8608f7bba16 Author: Ido Schimmel Date: Wed Oct 11 16:39:12 2023 +0200 mlxsw: pci: Allocate skbs using GFP_KERNEL during initialization The driver allocates skbs during initialization and during Rx processing. Take advantage of the fact that the former happens in process context and allocate the skbs using GFP_KERNEL to decrease the probability of allocation failure. Tested with CONFIG_DEBUG_ATOMIC_SLEEP=y. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko Link: https://lore.kernel.org/r/dfa6ed0926e045fe7c14f0894cc0c37fee81bf9d.1697034729.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski commit 5ee0a3bd150918512f28c55073b0d782f674320c Author: Subbaraya Sundeep Date: Wed Oct 11 17:45:51 2023 +0530 octeontx2-af: Enable hardware timestamping for VFs Currently for VFs, mailbox returns ENODEV error when hardware timestamping enable is requested. This patch fixes this issue. Modified this patch to return EPERM error for the PF/VFs which are not attached to CGX/RPM. Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Sai Krishna Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231011121551.1205211-1-saikrishnag@marvell.com Signed-off-by: Jakub Kicinski commit c47ed22c544336632448025c53b8687fdd95b558 Merge: e3bbab4754dec 0a2714d5e2d3b Author: Jakub Kicinski Date: Fri Oct 13 16:56:10 2023 -0700 Merge branch 'wangxun-ethtool-stats' Jiawen Wu says: ==================== Wangxun ethtool stats Support to show ethtool stats for txgbe/ngbe. ==================== Link: https://lore.kernel.org/r/20231011091906.70486-1-jiawenwu@trustnetic.com Signed-off-by: Jakub Kicinski commit 0a2714d5e2d3bf57f42d2ee58a04416a42f84f89 Author: Jiawen Wu Date: Wed Oct 11 17:19:06 2023 +0800 net: ngbe: add ethtool stats support Support to show ethtool statistics. Signed-off-by: Jiawen Wu Link: https://lore.kernel.org/r/20231011091906.70486-4-jiawenwu@trustnetic.com Signed-off-by: Jakub Kicinski commit 9224ade6539096585d35378fe2817b10b2bd7dc5 Author: Jiawen Wu Date: Wed Oct 11 17:19:05 2023 +0800 net: txgbe: add ethtool stats support Support to show ethtool statistics. Signed-off-by: Jiawen Wu Link: https://lore.kernel.org/r/20231011091906.70486-3-jiawenwu@trustnetic.com Signed-off-by: Jakub Kicinski commit 46b92e10d631b6a2c06d151929e87f1d39d72b8a Author: Jiawen Wu Date: Wed Oct 11 17:19:04 2023 +0800 net: libwx: support hardware statistics Implement update and clear Rx/Tx statistics. Signed-off-by: Jiawen Wu Link: https://lore.kernel.org/r/20231011091906.70486-2-jiawenwu@trustnetic.com Signed-off-by: Jakub Kicinski commit e3bbab4754dec801cefdd1b55920aff1bffac09d Author: Justin Stitt Date: Tue Oct 10 22:32:35 2023 +0000 net: dsa: vsc73xx: replace deprecated strncpy with ethtool_sprintf `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of this more robust and easier to understand interface. This change could result in misaligned strings when if(cnt) fails. To combat this, use ternary to place empty string in buffer and properly increment pointer to next string slot. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231010-strncpy-drivers-net-dsa-vitesse-vsc73xx-core-c-v2-1-ba4416a9ff23@google.com Signed-off-by: Jakub Kicinski commit 0e10fd4b7a6dd03cf6d1da293d5d50082917f0e0 Merge: ba8ea72388a19 e0e1a7a5fc377 Author: Andrii Nakryiko Date: Fri Oct 13 15:48:59 2023 -0700 Merge branch 'Open-coded task_vma iter' Dave Marchevsky says: ==================== At Meta we have a profiling daemon which periodically collects information on many hosts. This collection usually involves grabbing stacks (user and kernel) using perf_event BPF progs and later symbolicating them. For user stacks we try to use BPF_F_USER_BUILD_ID and rely on remote symbolication, but BPF_F_USER_BUILD_ID doesn't always succeed. In those cases we must fall back to digging around in /proc/PID/maps to map virtual address to (binary, offset). The /proc/PID/maps digging does not occur synchronously with stack collection, so the process might already be gone, in which case it won't have /proc/PID/maps and we will fail to symbolicate. This 'exited process problem' doesn't occur very often as most of the prod services we care to profile are long-lived daemons, but there are enough usecases to warrant a workaround: a BPF program which can be optionally loaded at data collection time and essentially walks /proc/PID/maps. Currently this is done by walking the vma list: struct vm_area_struct* mmap = BPF_CORE_READ(mm, mmap); mmap_next = BPF_CORE_READ(rmap, vm_next); /* in a loop */ Since commit 763ecb035029 ("mm: remove the vma linked list") there's no longer a vma linked list to walk. Walking the vma maple tree is not as simple as hopping struct vm_area_struct->vm_next. Luckily, commit f39af05949a4 ("mm: add VMA iterator"), another commit in that series, added struct vma_iterator and for_each_vma macro for easy vma iteration. If similar functionality was exposed to BPF programs, it would be perfect for our usecase. This series adds such functionality, specifically a BPF equivalent of for_each_vma using the open-coded iterator style. Notes: * This approach was chosen after discussion on a previous series [0] which attempted to solve the same problem by adding a BPF_F_VMA_NEXT flag to bpf_find_vma. * Unlike the task_vma bpf_iter, the open-coded iterator kfuncs here do not drop the vma read lock between iterations. See Alexei's response in [0]. * The [vsyscall] page isn't really part of task->mm's vmas, but /proc/PID/maps returns information about it anyways. The vma iter added here does not do the same. See comment on selftest in patch 3. * bpf_iter_task_vma allocates a _data struct which contains - among other things - struct vma_iterator, using BPF allocator and keeps a pointer to the bpf_iter_task_vma_data. This is done in order to prevent changes to struct ma_state - which is wrapped by struct vma_iterator - from necessitating changes to uapi struct bpf_iter_task_vma. Changelog: v6 -> v7: https://lore.kernel.org/bpf/20231010185944.3888849-1-davemarchevsky@fb.com/ Patch numbers correspond to their position in v6 Patch 2 ("selftests/bpf: Rename bpf_iter_task_vma.c to bpf_iter_task_vmas.c") * Add Andrii ack Patch 3 ("bpf: Introduce task_vma open-coded iterator kfuncs") * Add Andrii ack * Add missing __diag_ignore_all for -Wmissing-prototypes (Song) Patch 4 ("selftests/bpf: Add tests for open-coded task_vma iter") * Remove two unnecessary header includes (Andrii) * Remove extraneous !vmas_seen check (Andrii) New Patch ("bpf: Add BPF_KFUNC_{START,END}_defs macros") * After talking to Andrii, this is an attempt to clean up __diag_ignore_all spam everywhere kfuncs are defined. If nontrivial changes are needed, let's apply the other 4 and I'll respin as a standalone patch. v5 -> v6: https://lore.kernel.org/bpf/20231010175637.3405682-1-davemarchevsky@fb.com/ Patch 4 ("selftests/bpf: Add tests for open-coded task_vma iter") * Remove extraneous blank line. I did this manually to the .patch file for v5, which caused BPF CI to complain about failing to apply the series v4 -> v5: https://lore.kernel.org/bpf/20231002195341.2940874-1-davemarchevsky@fb.com/ Patch numbers correspond to their position in v4 New Patch ("selftests/bpf: Rename bpf_iter_task_vma.c to bpf_iter_task_vmas.c") * Patch 2's renaming of this selftest, and associated changes in the userspace runner, are split out into this separate commit (Andrii) Patch 2 ("bpf: Introduce task_vma open-coded iterator kfuncs") * Remove bpf_iter_task_vma kfuncs from libbpf's bpf_helpers.h, they'll be added to selftests' bpf_experimental.h in selftests patch below (Andrii) * Split bpf_iter_task_vma.c renaming into separate commit (Andrii) Patch 3 ("selftests/bpf: Add tests for open-coded task_vma iter") * Add bpf_iter_task_vma kfuncs to bpf_experimental.h (Andrii) * Remove '?' from prog SEC, open_and_load the skel in one operation (Andrii) * Ensure that fclose() always happens in test runner (Andrii) * Use global var w/ 1000 (vm_start, vm_end) structs instead of two MAP_TYPE_ARRAY's w/ 1k u64s each (Andrii) v3 -> v4: https://lore.kernel.org/bpf/20230822050558.2937659-1-davemarchevsky@fb.com/ Patch 1 ("bpf: Don't explicitly emit BTF for struct btf_iter_num") * Add Andrii ack Patch 2 ("bpf: Introduce task_vma open-coded iterator kfuncs") * Mark bpf_iter_task_vma_new args KF_RCU and remove now-unnecessary !task check (Yonghong) * Although KF_RCU is a function-level flag, in reality it only applies to the task_struct *task parameter, as the other two params are a scalar int and a specially-handled KF_ARG_PTR_TO_ITER * Remove struct bpf_iter_task_vma definition from uapi headers, define in kernel/bpf/task_iter.c instead (Andrii) Patch 3 ("selftests/bpf: Add tests for open-coded task_vma iter") * Use a local var when looping over vmas to track map idx. Update vmas_seen global after done iterating. Don't start iterating or update vmas_seen if vmas_seen global is nonzero. (Andrii) * Move getpgid() call to correct spot - above skel detach. (Andrii) v2 -> v3: https://lore.kernel.org/bpf/20230821173415.1970776-1-davemarchevsky@fb.com/ Patch 1 ("bpf: Don't explicitly emit BTF for struct btf_iter_num") * Add Yonghong ack Patch 2 ("bpf: Introduce task_vma open-coded iterator kfuncs") * UAPI bpf header and tools/ version should match * Add bpf_iter_task_vma_kern_data which bpf_iter_task_vma_kern points to, bpf_mem_alloc/free it instead of just vma_iterator. (Alexei) * Inner data ptr == NULL implies initialization failed v1 -> v2: https://lore.kernel.org/bpf/20230810183513.684836-1-davemarchevsky@fb.com/ * Patch 1 * Now removes the unnecessary BTF_TYPE_EMIT instead of changing the type (Yonghong) * Patch 2 * Don't do unnecessary BTF_TYPE_EMIT (Yonghong) * Bump task refcount to prevent ->mm reuse (Yonghong) * Keep a pointer to vma_iterator in bpf_iter_task_vma, alloc/free via BPF mem allocator (Yonghong, Stanislav) * Patch 3 [0]: https://lore.kernel.org/bpf/20230801145414.418145-1-davemarchevsky@fb.com/ ==================== Signed-off-by: Andrii Nakryiko commit e0e1a7a5fc377d54bd792c6368a375d41fc316ef Author: Dave Marchevsky Date: Fri Oct 13 13:44:25 2023 -0700 selftests/bpf: Add tests for open-coded task_vma iter The open-coded task_vma iter added earlier in this series allows for natural iteration over a task's vmas using existing open-coded iter infrastructure, specifically bpf_for_each. This patch adds a test demonstrating this pattern and validating correctness. The vma->vm_start and vma->vm_end addresses of the first 1000 vmas are recorded and compared to /proc/PID/maps output. As expected, both see the same vmas and addresses - with the exception of the [vsyscall] vma - which is explained in a comment in the prog_tests program. Signed-off-by: Dave Marchevsky Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20231013204426.1074286-5-davemarchevsky@fb.com commit 4ac4546821584736798aaa9e97da9f6eaf689ea3 Author: Dave Marchevsky Date: Fri Oct 13 13:44:24 2023 -0700 bpf: Introduce task_vma open-coded iterator kfuncs This patch adds kfuncs bpf_iter_task_vma_{new,next,destroy} which allow creation and manipulation of struct bpf_iter_task_vma in open-coded iterator style. BPF programs can use these kfuncs directly or through bpf_for_each macro for natural-looking iteration of all task vmas. The implementation borrows heavily from bpf_find_vma helper's locking - differing only in that it holds the mmap_read lock for all iterations while the helper only executes its provided callback on a maximum of 1 vma. Aside from locking, struct vma_iterator and vma_next do all the heavy lifting. A pointer to an inner data struct, struct bpf_iter_task_vma_data, is the only field in struct bpf_iter_task_vma. This is because the inner data struct contains a struct vma_iterator (not ptr), whose size is likely to change under us. If bpf_iter_task_vma_kern contained vma_iterator directly such a change would require change in opaque bpf_iter_task_vma struct's size. So better to allocate vma_iterator using BPF allocator, and since that alloc must already succeed, might as well allocate all iter fields, thereby freezing struct bpf_iter_task_vma size. Signed-off-by: Dave Marchevsky Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20231013204426.1074286-4-davemarchevsky@fb.com commit 45b38941c81f16bb2e9b0115f03e164a3576ea8b Author: Dave Marchevsky Date: Fri Oct 13 13:44:23 2023 -0700 selftests/bpf: Rename bpf_iter_task_vma.c to bpf_iter_task_vmas.c Further patches in this series will add a struct bpf_iter_task_vma, which will result in a name collision with the selftest prog renamed in this patch. Rename the selftest to avoid the collision. Signed-off-by: Dave Marchevsky Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20231013204426.1074286-3-davemarchevsky@fb.com commit f10ca5da5bd71e5cefed7995e75a7c873ce3816e Author: Dave Marchevsky Date: Fri Oct 13 13:44:22 2023 -0700 bpf: Don't explicitly emit BTF for struct btf_iter_num Commit 6018e1f407cc ("bpf: implement numbers iterator") added the BTF_TYPE_EMIT line that this patch is modifying. The struct btf_iter_num doesn't exist, so only a forward declaration is emitted in BTF: FWD 'btf_iter_num' fwd_kind=struct That commit was probably hoping to ensure that struct bpf_iter_num is emitted in vmlinux BTF. A previous version of this patch changed the line to emit the correct type, but Yonghong confirmed that it would definitely be emitted regardless in [0], so this patch simply removes the line. This isn't marked "Fixes" because the extraneous btf_iter_num FWD wasn't causing any issues that I noticed, aside from mild confusion when I looked through the code. [0]: https://lore.kernel.org/bpf/25d08207-43e6-36a8-5e0f-47a913d4cda5@linux.dev/ Signed-off-by: Dave Marchevsky Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20231013204426.1074286-2-davemarchevsky@fb.com commit 84aefafe6b294041b7fa0757414c4a29c1bdeea2 Author: Randy Dunlap Date: Sat Sep 30 15:14:26 2023 -0700 clk: linux/clk-provider.h: fix kernel-doc warnings and typos Fix spelling of "Structure". Fix multiple kernel-doc warnings: clk-provider.h:269: warning: Function parameter or member 'recalc_rate' not described in 'clk_ops' clk-provider.h:468: warning: Function parameter or member 'parent_data' not described in 'clk_hw_register_fixed_rate_with_accuracy_parent_data' clk-provider.h:468: warning: Excess function parameter 'parent_name' description in 'clk_hw_register_fixed_rate_with_accuracy_parent_data' clk-provider.h:482: warning: Function parameter or member 'parent_data' not described in 'clk_hw_register_fixed_rate_parent_accuracy' clk-provider.h:482: warning: Excess function parameter 'parent_name' description in 'clk_hw_register_fixed_rate_parent_accuracy' clk-provider.h:687: warning: Function parameter or member 'flags' not described in 'clk_divider' clk-provider.h:1164: warning: Function parameter or member 'flags' not described in 'clk_fractional_divider' clk-provider.h:1164: warning: Function parameter or member 'approximation' not described in 'clk_fractional_divider' clk-provider.h:1213: warning: Function parameter or member 'flags' not described in 'clk_multiplier' Fixes: 9fba738a53dd ("clk: add duty cycle support") Fixes: b2476490ef11 ("clk: introduce the common clock framework") Fixes: 2d34f09e79c9 ("clk: fixed-rate: Add support for specifying parents via DT/pointers") Fixes: f5290d8e4f0c ("clk: asm9260: use parent index to link the reference clock") Fixes: 9d9f78ed9af0 ("clk: basic clock hardware types") Fixes: e2d0e90fae82 ("clk: new basic clk type for fractional divider") Fixes: f2e0a53271a4 ("clk: Add a basic multiplier clock") Signed-off-by: Randy Dunlap Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Link: https://lore.kernel.org/r/20230930221428.18463-1-rdunlap@infradead.org Signed-off-by: Stephen Boyd commit c3f187461f090edffcb556d89a2726a522d69ae9 Merge: 2952134365295 4bce4bedbe6da Author: Stephen Boyd Date: Fri Oct 13 15:04:19 2023 -0700 Merge tag 'renesas-clk-for-v6.7-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas Pulll more Renesas clk driver updates from Geert Uytterhoeven: - Add support for the RZ/G3S (R9A08G045) SoC - Miscellaneous fixes and improvements * tag 'renesas-clk-for-v6.7-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: r9a08g045: Add clock and reset support for SDHI1 and SDHI2 clk: renesas: rzg2l: Use %x format specifier to print CLK_ON_R() clk: renesas: Add minimal boot support for RZ/G3S SoC clk: renesas: rzg2l: Add divider clock for RZ/G3S clk: renesas: rzg2l: Refactor SD mux driver clk: renesas: rzg2l: Remove CPG_SDHI_DSEL from generic header clk: renesas: rzg2l: Add struct clk_hw_data clk: renesas: rzg2l: Add support for RZ/G3S PLL clk: renesas: rzg2l: Remove critical area clk: renesas: rzg2l: Fix computation formula clk: renesas: rzg2l: Trust value returned by hardware clk: renesas: rzg2l: Lock around writes to mux register clk: renesas: rzg2l: Wait for status bit of SD mux before continuing clk: renesas: rcar-gen3: Extend SDnH divider table dt-bindings: clock: renesas,rzg2l-cpg: Document RZ/G3S SoC commit af46076d6640a5404ed65e1160df810fed54e7ac Merge: 949189a567f2b 8a9a690b5ad50 Author: Martin K. Petersen Date: Fri Oct 13 17:00:47 2023 -0400 Merge patch series "lpfc: Update lpfc to revision 14.2.0.15" Justin Tee says: Update lpfc to revision 14.2.0.15 This patch set contains error handling fixes, ELS bug fixes, and logging improvements. The patches were cut against Martin's 6.7/scsi-queue tree. Link: https://lore.kernel.org/r/20231009161812.97232-1-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 508934b5d15ab79fd5895cc2a6063bc9d95f6a55 Author: Maciej Wieczor-Retman Date: Tue Oct 10 09:56:12 2023 +0200 selftests/resctrl: Move run_benchmark() to a more fitting file resctrlfs.c contains mostly functions that interact in some way with resctrl FS entries while functions inside resctrl_val.c deal with measurements and benchmarking. run_benchmark() is located in resctrlfs.c even though it's purpose is not interacting with the resctrl FS but to execute cache checking logic. Move run_benchmark() to resctrl_val.c just before resctrl_val() that makes use of run_benchmark(). Make run_benchmark() static since it's not used between multiple files anymore. Remove return comment from kernel-doc since the function is type void. Signed-off-by: Maciej Wieczor-Retman Reviewed-by: Ilpo Järvinen Reviewed-by: Reinette Chatre Signed-off-by: Shuah Khan commit 20d96b25cc4c45823fbec5406ae5ae45da6a892e Author: Maciej Wieczor-Retman Date: Tue Oct 10 09:56:11 2023 +0200 selftests/resctrl: Fix schemata write error check Writing bitmasks to the schemata can fail when the bitmask doesn't adhere to constraints defined by what a particular CPU supports. Some example of constraints are max length or having contiguous bits. The driver should properly return errors when any rule concerning bitmask format is broken. Resctrl FS returns error codes from fprintf() only when fclose() is called. Current error checking scheme allows invalid bitmasks to be written into schemata file and the selftest doesn't notice because the fclose() error code isn't checked. Substitute fopen(), flose() and fprintf() with open(), close() and write() to avoid error code buffering between fprintf() and fclose(). Remove newline character from the schema string after writing it to the schemata file so it prints correctly before function return. Pass the string generated with strerror() to the "reason" buffer so the error message is more verbose. Extend "reason" buffer so it can hold longer messages. Signed-off-by: Maciej Wieczor-Retman Reviewed-by: Ilpo Järvinen Reviewed-by: Reinette Chatre Signed-off-by: Shuah Khan commit 8a9a690b5ad50aba9456f4853dca18ff4974cb55 Author: Justin Tee Date: Mon Oct 9 09:18:12 2023 -0700 scsi: lpfc: Update lpfc version to 14.2.0.15 Update lpfc version to 14.2.0.15. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20231009161812.97232-7-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 41c831bbb0f277ecadbcc79f61a42d3a6bbe0dc4 Author: Justin Tee Date: Mon Oct 9 09:18:11 2023 -0700 scsi: lpfc: Introduce LOG_NODE_VERBOSE messaging flag The preexisting LOG_NODE message flag frequently spams a subset of the same log messages during normal FC driver operations. When analyzing driver logs, this sometimes leads to difficulty in troubleshooting. Because LOG_IP log message flag is unused, convert it to a new LOG_NODE_VERBOSE flag. The LOG_NODE_VERBOSE shall specifically be used for diagnosing issues that require precise ndlp tracking detail. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20231009161812.97232-6-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit a3c3c0a806f1bb7d89f139d8225092faad0cf04a Author: Justin Tee Date: Mon Oct 9 09:18:10 2023 -0700 scsi: lpfc: Validate ELS LS_ACC completion payload A WCQE success completion status does not guarantee valid LS_ACC receipt for ELS commands. So, introduce a small helper routine that validates ELS LS_ACC frames in ELS cmpl routines. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20231009161812.97232-5-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 12e896c74280d9d8da87327f08cf0e878d24ae5c Author: Justin Tee Date: Mon Oct 9 09:18:09 2023 -0700 scsi: lpfc: Reject received PRLIs with only initiator fcn role for NPIV ports Currently, NPIV ports send PRLI_ACC to all received unsolicited PRLI requests. For an NPIV port, there is no point to PRLI_ACC if the received PRLI request has the initiator function bit set and the target function bit unset. Modify the lpfc_rcv_prli_support_check() routine to send a PRLI_RJT in such cases. NPIV ports are expected to send PRLI_ACC only if the Target function bit is set. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20231009161812.97232-4-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit d472a76603d8a04246dda05c4918281dfb61ed60 Author: Justin Tee Date: Mon Oct 9 09:18:08 2023 -0700 scsi: lpfc: Treat IOERR_SLI_DOWN I/O completion status the same as pci offline During receipt of a hardware error attention ACQE, IOERR_SLI_DOWN status is set by the driver for all outstanding I/Os. In such hardware error attention cases, we can treat the situation exactly the same as pci_channel_offline. Thus, add IOERR_SLI_DOWN status to the same category as pci_channel_offline handling in lpfc_nvme_io_cmd_cmpl. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20231009161812.97232-3-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit 0506814609fb424cba10b193f90f01c69fa9bfa0 Author: Justin Tee Date: Mon Oct 9 09:18:07 2023 -0700 scsi: lpfc: Remove unnecessary zero return code assignment in lpfc_sli4_hba_setup In order to enter the !rc if statement block in question, rc had to have been zero to begin with. Thus, the rc = 0 assignment is unnecessary and can be removed. Signed-off-by: Justin Tee Link: https://lore.kernel.org/r/20231009161812.97232-2-justintee8345@gmail.com Signed-off-by: Martin K. Petersen commit ef43c30858754d99373a63dff33280a9969b49bc Author: Ilpo Järvinen Date: Mon Oct 2 12:48:13 2023 +0300 selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests The initial value of 5% chosen for the maximum allowed percentage difference between resctrl mbm value and IMC mbm value in commit 06bd03a57f8c ("selftests/resctrl: Fix MBA/MBM results reporting format") was "randomly chosen value" (as admitted by the changelog). When running tests in our lab across a large number platforms, 5% difference upper bound for success seems a bit on the low side for the MBA and MBM tests. Some platforms produce outliers that are slightly above that, typically 6-7%, which leads MBA/MBM test frequently failing. Replace the "randomly chosen value" with a success bound that is based on those measurements across large number of platforms by relaxing the MBA/MBM success bound to 8%. The relaxed bound removes the failures due the frequent outliers. Fixed commit description style error during merge: Shuah Khan Fixes: 06bd03a57f8c ("selftests/resctrl: Fix MBA/MBM results reporting format") Signed-off-by: Ilpo Järvinen Tested-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: Shaopeng Tan Cc: Signed-off-by: Shuah Khan commit 06035f019422ba17e85c11e70d6d8bdbe9fa1afd Author: Ilpo Järvinen Date: Mon Oct 2 12:48:12 2023 +0300 selftests/resctrl: Fix feature checks The MBA and CMT tests expect support of other features to be able to run. When platform only supports MBA but not MBM, MBA test will fail with: Failed to open total bw file: No such file or directory When platform only supports CMT but not CAT, CMT test will fail with: Failed to open bit mask file '/sys/fs/resctrl/info/L3/cbm_mask': No such file or directory It leads to the test reporting test fail (even if no test was run at all). Extend feature checks to cover these two conditions to show these tests were skipped rather than failed. Fixes: ee0415681eb6 ("selftests/resctrl: Use resctrl/info for feature detection") Signed-off-by: Ilpo Järvinen Tested-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: Shaopeng Tan Cc: # selftests/resctrl: Refactor feature check to use resource and feature name Signed-off-by: Shuah Khan commit d56e5da0e0f557a206bace16bbbdad00a5800e34 Author: Ilpo Järvinen Date: Mon Oct 2 12:48:11 2023 +0300 selftests/resctrl: Refactor feature check to use resource and feature name Feature check in validate_resctrl_feature_request() takes in the test name string and maps that to what to check per test. Pass resource and feature names to validate_resctrl_feature_request() directly rather than deriving them from the test name inside the function which makes the feature check easier to extend for new test cases. Use !! in the return statement to make the boolean conversion more obvious even if it is not strictly necessary from correctness point of view (to avoid it looking like the function is returning a freed pointer). Signed-off-by: Ilpo Järvinen Tested-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: Shaopeng Tan Cc: # selftests/resctrl: Remove duplicate feature check from CMT test Cc: # selftests/resctrl: Move _GNU_SOURCE define into Makefile Signed-off-by: Shuah Khan commit 3a1e4a91aa454a1c589a9824d54179fdbfccde45 Author: Ilpo Järvinen Date: Mon Oct 2 12:48:10 2023 +0300 selftests/resctrl: Move _GNU_SOURCE define into Makefile _GNU_SOURCE is defined in resctrl.h. Defining _GNU_SOURCE has a large impact on what gets defined when including headers either before or after it. This can result in compile failures if .c file decides to include a standard header file before resctrl.h. It is safer to define _GNU_SOURCE in Makefile so it is always defined regardless of in which order includes are done. Signed-off-by: Ilpo Järvinen Tested-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: Shaopeng Tan Cc: Signed-off-by: Shuah Khan commit 030b48fb2cf045dead8ee2c5ead560930044c029 Author: Ilpo Järvinen Date: Mon Oct 2 12:48:09 2023 +0300 selftests/resctrl: Remove duplicate feature check from CMT test The test runner run_cmt_test() in resctrl_tests.c checks for CMT feature and does not run cmt_resctrl_val() if CMT is not supported. Then cmt_resctrl_val() also check is CMT is supported. Remove the duplicated feature check for CMT from cmt_resctrl_val(). Signed-off-by: Ilpo Järvinen Tested-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: Shaopeng Tan Cc: Signed-off-by: Shuah Khan commit 3aff5146445582454c35900f3c0c972987cdd595 Author: Ilpo Järvinen Date: Mon Oct 2 12:48:08 2023 +0300 selftests/resctrl: Extend signal handler coverage to unmount on receiving signal Unmounting resctrl FS has been moved into the per test functions in resctrl_tests.c by commit caddc0fbe495 ("selftests/resctrl: Move resctrl FS mount/umount to higher level"). In case a signal (SIGINT, SIGTERM, or SIGHUP) is received, the running selftest is aborted by ctrlc_handler() which then unmounts resctrl fs before exiting. The current section between signal_handler_register() and signal_handler_unregister(), however, does not cover the entire duration when resctrl FS is mounted. Move signal_handler_register() and signal_handler_unregister() calls from per test files into resctrl_tests.c to properly unmount resctrl fs. In order to not add signal_handler_register()/unregister() n times, create helpers test_prepare() and test_cleanup(). Do not call ksft_exit_fail_msg() in test_prepare() but only in the per test function to keep the control flow cleaner without adding calls to exit() deep into the call chain. Adjust child process kill() call in ctrlc_handler() to only be invoked if the child was already forked. Fixes: caddc0fbe495 ("selftests/resctrl: Move resctrl FS mount/umount to higher level") Signed-off-by: Ilpo Järvinen Tested-by: Shaopeng Tan Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Cc: Signed-off-by: Shuah Khan commit beb7f471847663559bd0fe60af1d70e05a1d7c6c Author: Ilpo Järvinen Date: Mon Oct 2 12:48:07 2023 +0300 selftests/resctrl: Fix uninitialized .sa_flags signal_handler_unregister() calls sigaction() with uninitializing sa_flags in the struct sigaction. Make sure sa_flags is always initialized in signal_handler_unregister() by initializing the struct sigaction when declaring it. Also add the initialization to signal_handler_register() even if there are no know bugs in there because correctness is then obvious from the code itself. Fixes: 73c55fa5ab55 ("selftests/resctrl: Commonize the signal handler register/unregister for all tests") Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen Cc: Reviewed-by: Reinette Chatre Signed-off-by: Shuah Khan commit 949189a567f2b1b47aba494f08215ca9dfd6a9a5 Merge: bd7f0ef293e62 be6f21817e0b1 Author: Martin K. Petersen Date: Fri Oct 13 16:52:47 2023 -0400 Merge patch series "megaraid_sas: Driver version update to 07.727.03.00-rc1" Chandrakanth patil says: This set of patches includes critical fixes, and updates to the maintainer list. Link: https://lore.kernel.org/r/20231003110021.168862-1-chandrakanth.patil@broadcom.com Signed-off-by: Martin K. Petersen commit be6f21817e0b1f413d33c58901e829bb26aff065 Author: Chandrakanth patil Date: Tue Oct 3 16:30:21 2023 +0530 scsi: megaraid_sas: Revision of Maintainer List Given my active involvement in megaraid_sas development, I am including myself in the maintainers list. Signed-off-by: Chandrakanth patil Link: https://lore.kernel.org/r/20231003110021.168862-5-chandrakanth.patil@broadcom.com Signed-off-by: Martin K. Petersen commit 0938f9fa4208a41a7358eac344fc56b9fd8398dc Author: Chandrakanth patil Date: Tue Oct 3 16:30:20 2023 +0530 scsi: megaraid_sas: Driver version update to 07.727.03.00-rc1 Driver version update. Signed-off-by: Chandrakanth patil Link: https://lore.kernel.org/r/20231003110021.168862-4-chandrakanth.patil@broadcom.com Signed-off-by: Martin K. Petersen commit 2d83fb023c90d4db3ada82f12951cb0c69be9cbc Author: Chandrakanth patil Date: Tue Oct 3 16:30:19 2023 +0530 scsi: megaraid_sas: Log message when controller reset is requested but not issued The driver now includes the print message 'IO is completed, no reset is required' when a reset is requested but not issued. This message is displayed only when pending SCSI IO is completed before issuing the reset. Signed-off-by: Chandrakanth patil Signed-off-by: Sumit Saxena Link: https://lore.kernel.org/r/20231003110021.168862-3-chandrakanth.patil@broadcom.com Signed-off-by: Martin K. Petersen commit 8e3ed9e786511ad800c33605ed904b9de49323cf Author: Chandrakanth patil Date: Tue Oct 3 16:30:18 2023 +0530 scsi: megaraid_sas: Increase register read retry rount from 3 to 30 for selected registers In BMC environments with concurrent access to multiple registers, certain registers occasionally yield a value of 0 even after 3 retries due to hardware errata. As a fix, we have extended the retry count from 3 to 30. The same errata applies to the mpt3sas driver, and a similar patch has been accepted. Please find more details in the mpt3sas patch reference link. Link: https://lore.kernel.org/r/20230829090020.5417-2-ranjan.kumar@broadcom.com Fixes: 272652fcbf1a ("scsi: megaraid_sas: add retry logic in megasas_readl") Cc: stable@vger.kernel.org Signed-off-by: Chandrakanth patil Signed-off-by: Sumit Saxena Link: https://lore.kernel.org/r/20231003110021.168862-2-chandrakanth.patil@broadcom.com Signed-off-by: Martin K. Petersen commit 37d01395d9c809a17c2fc79681a35cbfb704a8f3 Merge: d4f23fdfff30d c3f7c14856ebb Author: Arnd Bergmann Date: Fri Oct 13 22:51:29 2023 +0200 Merge tag 'sunxi-dt-for-6.7-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into soc/dt - Added V3s nodes for PWM pinctrl, EHCI and OHCI - RISC-V DT cleanups - Added new ISA property and PMU node to Allwinner D1 - Added interconnect to R40 video codec node - New boards: Anbernic RG-Nano, BigTreeTech Pi, BigTreeTech CB1 SOM * tag 'sunxi-dt-for-6.7-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: riscv: dts: allwinner: convert isa detection to new properties ARM: dts: sun8i-r40: Add interconnect to video-codec ARM: dts: sunxi: add support for Anbernic RG-Nano dt-bindings: arm: sunxi: add Anbernic RG-Nano ARM: dts: sun8i: v3s: add EHCI and OHCI to v3s dts arm: dts: sun8i: V3s: Add pinctrl for pwm riscv: dts: allwinner: d1: Add PMU event node arm64: dts: allwinner: h616: Add BigTreeTech Pi support arm64: dts: allwinner: h616: Add BigTreeTech CB1 SoM & boards support dt-bindings: arm: sunxi: Add BigTreeTech boards dt-bindings: vendor-prefixes: Add BigTreeTech arm64: dts: allwinner: h616: Add SID controller node dt-bindings: nvmem: SID: Add binding for H616 SID controller riscv: dts: allwinner: remove address-cells from intc node riscv: dts: use capital "OR" for multiple licenses in SPDX Link: https://lore.kernel.org/r/20231013194203.GA2155816@jernej-laptop Signed-off-by: Arnd Bergmann commit d4f23fdfff30d39e7f55e20d34874d57a1a81fc1 Merge: afec904ad758a c0b80988eb78d Author: Arnd Bergmann Date: Fri Oct 13 22:50:32 2023 +0200 Merge tag 'tegra-for-6.7-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/dt arm64: tegra: Device tree changes for v6.7-rc1 This contains some fixes for Tegra234 boards as well as some cleanups that will help with json-schema validation. For older devices, there's now support for display on Smaug (a.k.a. Pixel C) and the IOMMU for host1x is enabled on Tegra132, which should help with large memory allocations for display and multimedia. * tag 'tegra-for-6.7-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: arm64: tegra: Use correct interrupts for Tegra234 TKE arm64: tegra: Add power-sensors for Tegra234 boards arm64: tegra: Mark Tegra234 SPI as compatible with Tegra114 arm64: tegra: Add dmas and dma-names for Tegra234 UARTE arm64: tegra: Use correct format for clocks property arm64: tegra: Remove duplicate nodes on Jetson Orin NX arm64: tegra: Add missing current-speed for SBSA UART arm64: tegra: Add display panel node on Smaug arm64: tegra: Add backlight node on Smaug arm64: tegra: Add DSI/CSI regulator on Smaug arm64: tegra: Enable IOMMU for host1x on Tegra132 arm64: tegra: Fix P3767 QSPI speed arm64: tegra: Fix P3767 card detect polarity Link: https://lore.kernel.org/r/20231013153723.1729109-6-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit afec904ad758a1af2fcb32cde21a2fdfdc0fa295 Merge: 7f50d3f361f9d 3c2508d3ce576 Author: Arnd Bergmann Date: Fri Oct 13 22:49:49 2023 +0200 Merge tag 'tegra-for-6.7-arm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/dt ARM: tegra: Device tree changes for v6.7-rc1 Contains a small fix that drops an unnecessary unit-address. * tag 'tegra-for-6.7-arm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: tegra: Drop unit-address from parallel RGB output port Link: https://lore.kernel.org/r/20231013153723.1729109-5-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 7f50d3f361f9dd78050ae272787a400716ac28be Merge: 64b5812550b81 0434281722b51 Author: Arnd Bergmann Date: Fri Oct 13 22:48:53 2023 +0200 Merge tag 'tegra-for-6.7-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/dt dt-bindings: Changes for v6.7-rc1 This contains some rework of the Tegra PMC device tree bindings that will help with validating device trees with json-schema. * tag 'tegra-for-6.7-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: dt-bindings: arm: tegra: pmc: Relicense and move into soc/tegra directory dt-bindings: arm: tegra: pmc: Reformat example dt-bindings: arm: tegra: pmc: Restructure pad configuration node schema dt-bindings: arm: tegra: pmc: Increase maximum number of clocks per powergate dt-bindings: arm: tegra: pmc: Move additionalProperties dt-bindings: arm: tegra: pmc: Remove useless boilerplate descriptions dt-bindings: arm: tegra: pmc: Improve property descriptions Link: https://lore.kernel.org/r/20231013153723.1729109-3-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 64b5812550b81cc87e8f129bd368125e2b6c0f4d Merge: 469a58f1728b8 a09c3e105a208 Author: Arnd Bergmann Date: Fri Oct 13 22:46:42 2023 +0200 Merge tag 'renesas-dts-for-v6.7-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/dt Renesas DTS updates for v6.7 (take two) - Improve audio clock accuracy on the RZ/{G2L,G2LC,V2L} SMARC EVK development boards, - Add FLASH support for the Renesas Bock-W development board, - Add L2 cache and non-coherent DMA support on the RZ/Five SoC and the RZ/Five SMARC development board, - Add initial support for the RZ/G3S SoC and the RZ/G3S SMARC SoM and SMARC Carrier-II EVK development boards, - Add initial support for the R8A779F4 variant of the R-Car S4-8 SoC and the R-Car S4 Starter Kit development board, - Apply DT overlays to base DTBs to improve validation and usability. * tag 'renesas-dts-for-v6.7-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: (25 commits) arm64: dts: renesas: Apply overlays to base dtbs arm64: dts: renesas: rzg3s-smarc-som: Spelling s/device-type/device_type/ arm64: dts: renesas: r9a08g045: Add missing cache-level for L3 cache arm64: dts: renesas: r9a08g045: Add nodes for SDHI1 and SDHI2 arm64: dts: renesas: ebisu: Document Ebisu-4D support arm64: dts: renesas: Add R-Car S4 Starter Kit support arm64: dts: renesas: Add Renesas R8A779F4 SoC support arm64: dts: renesas: Add initial device tree for RZ/G3S SMARC EVK board arm64: dts: renesas: Add initial device tree for RZ SMARC Carrier-II Board arm64: dts: renesas: Add initial support for RZ/G3S SMARC SoM arm64: dts: renesas: Add initial DTSI for RZ/G3S SoC riscv: dts: renesas: rzfive-smarc: Enable the blocks which were explicitly disabled riscv: dts: renesas: r9a07g043f: Add dma-noncoherent property riscv: dts: renesas: r9a07g043f: Add L2 cache node ARM: dts: renesas: bockw: Add FLASH node arm64: dts: renesas: rz-smarc: Use versa3 clk for audio mclk dt-bindings: clock: renesas,rzg2l-cpg: Document RZ/G3S SoC clk: tegra: fix error return case for recalc_rate clk: si521xx: Fix regmap write accessor clk: si521xx: Use REGCACHE_FLAT instead of NONE ... Link: https://lore.kernel.org/r/cover.1697200123.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 469a58f1728b8d1df9f608df5a6963d4c947fc97 Merge: 4ec57f57bf752 c0a2c7619666a Author: Arnd Bergmann Date: Fri Oct 13 22:44:56 2023 +0200 Merge tag 'renesas-dt-bindings-for-v6.7-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/dt Renesas DT binding updates for v6.7 (take two) - Document support for the Renesas RZ/G3S SMARC SoM and SMARC Carrier-II EVK development boards, - Document support for the Renesas R-Car S4 Starter Kit. * tag 'renesas-dt-bindings-for-v6.7-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: dt-bindings: soc: renesas: Document R-Car S4 Starter Kit dt-bindings: soc: renesas: Document SMARC Carrier-II EVK dt-bindings: soc: renesas: Document RZ/G3S SMARC SoM Link: https://lore.kernel.org/r/cover.1697200121.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 4ec57f57bf752243498ef674f4baa6a0a82946cd Merge: 46579e69c27b2 b2e847012cbc5 Author: Arnd Bergmann Date: Fri Oct 13 22:44:11 2023 +0200 Merge tag 'sti-dt-for-v6.7-round1' of git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti into soc/dt STi DT for v6.7, round 1 : stih418-b2264: leds and serial fixes stih407: drop max-duty-cycle property stih415/416: remove boards from yaml stih407/410/418: add boards to yaml * tag 'sti-dt-for-v6.7-round1' of git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti: dt-bindings: arm: sti: add STi boards and remove stih415/stih416 dt-bindings: soc: sti: add STi platform syscon ARM: dts: st: correct led level in stih418-b2264.dts ARM: dts: st: move leds out of soc in stih418-b2264.dts ARM: dts: st: correct serial alias in stih418-b2264.dts ARM: dts: st: stih407: drop max-duty-cycle Link: https://lore.kernel.org/r/e6b975f2-9936-465a-8253-6fcead974006@foss.st.com Signed-off-by: Arnd Bergmann commit 46579e69c27b2f60461b6771637b91727af9989b Merge: 62d3bfa50c518 ea1c1e67e631b Author: Arnd Bergmann Date: Fri Oct 13 22:43:09 2023 +0200 Merge tag 'omap-for-v6.7/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into soc/dt Devicetree changes for omaps for v6.7 merge window Two non-urgent devicetree fixes for am371-evm led pinmux and a node name warning fix for omap4-epson-embt2ws, and updates for connected devices for various devices: - Device updates and enabling of pru support for am335x-pocketbeagle - Few more devices such as leds and iio for omap4-epson-embt2ws - Ethernet and led updates for am3517-evm - Modem sleep pins configuration for motorola-mapphone * tag 'omap-for-v6.7/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: omap4-embt2ws: Fix pinctrl single node name warning ARM: dts: motorola-mapphone: Add mdm6600 sleep pins ARM: dts: am3517: Configure ethernet alias ARM: dts: am3517-evm: Enable Ethernet PHY Interrupt ARM: dts: am3517-evm: Fix LED3/4 pinmux ARM: dts: omap3-gta04: Drop superfluous omap36xx compatible ARM: dts: omap: omap4-embt2ws: Add IMU at control unit ARM: dts: omap: omap4-embt2ws: Let IMU driver handle Magnetometer internally ARM: dts: am335x-pocketbeagle: add missing GPIO mux ARM: dts: am335x-pocketbeagle: enable pru ARM: dts: am335x-pocketbeagle: remove dependency cycle ARM: dts: am335x-pocketbeagle: update LED information ARM: dts: omap4: embt2ws: add LED Link: https://lore.kernel.org/r/pull-1697010475-119828@atomide.com Signed-off-by: Arnd Bergmann commit 62d3bfa50c518c6008d02bb7f3a1caa1b04471a7 Merge: dcbd30f887d47 3cec9514911c4 Author: Arnd Bergmann Date: Fri Oct 13 22:42:04 2023 +0200 Merge tag 'at91-dt-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into soc/dt Microchip AT91 device tree updates for 6.7 It contains: - the new Microchip SAMA5D29 Curiosity board - a typo fix in TDES node name for SAMA5D4 dtsi - enablement of RTT as RTC for SAM9X60 Curiosity board * tag 'at91-dt-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: at91: sam9x60_curiosity: Add mandatory dt property for RTT ARM: dts: at91: sama5d29_curiosity: Add device tree for sama5d29_curiosity board dt-bindings: ARM: at91: Document Microchip SAMA5D29 Curiosity ARM: dts: at91/trivial: fix typo in crypto DT naming Link: https://lore.kernel.org/r/20231010045955.1259843-1-claudiu.beznea@tuxon.dev Signed-off-by: Arnd Bergmann commit dcbd30f887d4738e13a31a3a85362b0634c38578 Merge: f358d6a5e6aef d3c849020b6a5 Author: Arnd Bergmann Date: Fri Oct 13 22:41:10 2023 +0200 Merge tag 'ixp4xx-for-soc-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into soc/dt Some IXP4xx updates for the v6.7 kernel cycle: - Provide proper bindings including missing vendor prefixes for the device trees in use and one more new vendor. - Add a device tree for USRobotics USR8200 which has two active users. - Augment the "reset" GPIO buttons to send KEY_RESTART as appropriate. - Enable write on the NSLU2 flash so we get a writeable rootfs on this device. * tag 'ixp4xx-for-soc-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: dts: ixp4xx: Use right restart keycode ARM: dts: ixp4xx-nslu2: Enable write on flash ARM: dts: ixp4xx: Add USRobotics USR8200 device tree ARM: dts: Use only the Linksys compatible for now dt-bindings: arm: List more IXP4xx devices dt-bindings: Add vendor prefixes Link: https://lore.kernel.org/r/CACRpkdZZ6W8uic97S9=Aa+S+s0-0k50TDw1e00u6gFcQfAVDdw@mail.gmail.com Signed-off-by: Arnd Bergmann commit bd7f0ef293e62b4a6b09771c5a7fdbb9b675069c Merge: 1caddfc5816e4 f7d7129c6c241 Author: Martin K. Petersen Date: Fri Oct 13 16:38:26 2023 -0400 Merge patch series "scsi: sshdr and retry fixes" Mike Christie says: The following patches were made over Linus tree (Martin's 6.7 branch was missing some changes to sd.c). They only contain the sshdr and rdac retry fixes from the "Allow scsi_execute users to control retries" patchset. The patches in this set are reviewed and tested but the changes to how we do retries will take a little longer and require more testing, so I broke up the series to make them easier to review. Link: https://lore.kernel.org/r/20231004210013.5601-1-michael.christie@oracle.com Signed-off-by: Martin K. Petersen commit f7d7129c6c24168b9be7709b0b37767b5f743cf3 Author: Mike Christie Date: Wed Oct 4 16:00:13 2023 -0500 scsi: sr: Fix sshdr use in sr_get_events If scsi_execute_cmd returns < 0, it doesn't initialize the sshdr, so we shouldn't access the sshdr. If it returns 0, then the cmd executed successfully, so there is no need to check the sshdr. This has us access the sshdr when we get a return value > 0. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20231004210013.5601-13-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: John Garry Reviewed-by: Martin Wilck Signed-off-by: Martin K. Petersen commit c8b7ef36da0372d52e55cd1b7f1ac2b285eb2680 Author: Mike Christie Date: Wed Oct 4 16:00:12 2023 -0500 scsi: sd: Fix sshdr use in cache_type_store If scsi_execute_cmd returns < 0, it doesn't initialize the sshdr, so we shouldn't access the sshdr. If it returns 0, then the cmd executed successfully, so there is no need to check the sshdr. This has us access the sshdr when we get a return value > 0. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20231004210013.5601-12-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: John Garry Reviewed-by: Martin Wilck Signed-off-by: Martin K. Petersen commit 8f0017694c54e4a9b576b12562894e1c8047342f Author: Mike Christie Date: Wed Oct 4 16:00:11 2023 -0500 scsi: Fix sshdr use in scsi_cdl_enable If scsi_execute_cmd returns < 0, it doesn't initialize the sshdr, so we shouldn't access the sshdr. If it returns 0, then the cmd executed successfully, so there is no need to check the sshdr. This has us access the sshdr when we get a return value > 0. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20231004210013.5601-11-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: John Garry Reviewed-by: Martin Wilck Signed-off-by: Martin K. Petersen commit f43158eefd655d34e38b0cc35b959149ddf02485 Author: Mike Christie Date: Wed Oct 4 16:00:10 2023 -0500 scsi: Fix sshdr use in scsi_test_unit_ready If scsi_execute_cmd returns < 0, it doesn't initialize the sshdr, so we shouldn't access the sshdr. If it returns 0, then the cmd executed successfully, so there is no need to check the sshdr. This has us access the sshdr when we get a return value > 0. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20231004210013.5601-10-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: John Garry Reviewed-by: Martin Wilck Signed-off-by: Martin K. Petersen commit add2c24d32a38402dfec3c1465f332ab8a769890 Author: Mike Christie Date: Wed Oct 4 16:00:09 2023 -0500 scsi: sd: Fix scsi_mode_sense caller's sshdr use The sshdr passed into scsi_execute_cmd is only initialized if scsi_execute_cmd returns >= 0, and scsi_mode_sense will convert all non good statuses like check conditions to -EIO. This has scsi_mode_sense callers that were possibly accessing an uninitialized sshdrs to only access it if we got -EIO. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20231004210013.5601-9-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Martin Wilck Signed-off-by: Martin K. Petersen commit 0b149cee836aa53989ea089af1cb9d90d7c6ac9e Author: Mike Christie Date: Wed Oct 4 16:00:07 2023 -0500 scsi: spi: Fix sshdr use If scsi_execute_cmd returns < 0, it doesn't initialize the sshdr, so we shouldn't access the sshdr. If it returns 0, then the cmd executed successfully, so there is no need to check the sshdr. This has us access the sshdr when we get a return value > 0. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20231004210013.5601-7-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: John Garry Reviewed-by: Martin Wilck Signed-off-by: Martin K. Petersen commit 87e145a29363700a3007fb3ae20edd951ad14693 Author: Mike Christie Date: Wed Oct 4 16:00:06 2023 -0500 scsi: rdac: Fix sshdr use If scsi_execute_cmd returns < 0, it doesn't initialize the sshdr, so we shouldn't access the sshdr. If it returns 0, then the cmd executed successfully, so there is no need to check the sshdr. This has us access the sshdr when we get a return value > 0. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20231004210013.5601-6-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 2274bd5e3a2cd4c79a34f19f0d29f1478f9ca0e2 Author: Mike Christie Date: Wed Oct 4 16:00:05 2023 -0500 scsi: rdac: Fix send_mode_select retry handling If send_mode_select retries scsi_execute_cmd it will leave err set to SCSI_DH_RETRY/SCSI_DH_IMM_RETRY. If on the retry, the command is successful, then SCSI_DH_RETRY/SCSI_DH_IMM_RETRY will be returned to the scsi_dh activation caller. On the retry, we will then detect the previous MODE SELECT had worked, and so we will return success. This patch has us return the correct return value, so we can avoid the extra scsi_dh activation call and to avoid failures if the caller had hit its activation retry limit and does not end up retrying. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20231004210013.5601-5-michael.christie@oracle.com Reviewed-by: Martin Wilck Signed-off-by: Martin K. Petersen commit 5759a5650d4545231f7a18ae849fd1653dd16c56 Author: Mike Christie Date: Wed Oct 4 16:00:04 2023 -0500 scsi: hp_sw: Fix sshdr use If scsi_execute_cmd returns < 0, it doesn't initialize the sshdr, so we shouldn't access the sshdr. If it returns 0, then the cmd executed successfully, so there is no need to check the sshdr. This has us access the sshdr when we get a return value > 0. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20231004210013.5601-4-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: John Garry Reviewed-by: Martin Wilck Signed-off-by: Martin K. Petersen commit b4d0c33a32c3c59217ec449de3892b1a6d68cbc1 Author: Mike Christie Date: Wed Oct 4 16:00:03 2023 -0500 scsi: sd: Fix sshdr use in sd_spinup_disk If scsi_execute_cmd returns < 0, it doesn't initialize the sshdr, so we shouldn't access the sshdr. If it returns 0, then the cmd executed successfully, so there is no need to check the sshdr. This has us access the sshdr when we get a return value > 0. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20231004210013.5601-3-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: John Garry Reviewed-by: Bart Van Assche Reviewed-by: Martin Wilck Signed-off-by: Martin K. Petersen commit bd593bd2c1e639ba3d42080911f30c1d86875fcc Author: Mike Christie Date: Wed Oct 4 16:00:02 2023 -0500 scsi: sd: Fix sshdr use in read_capacity_16 If scsi_execute_cmd returns < 0, it doesn't initialize the sshdr, so we shouldn't access the sshdr. If it returns 0, then the cmd executed successfully, so there is no need to check the sshdr. This has us access the sshdr when we get a return value > 0. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20231004210013.5601-2-michael.christie@oracle.com Reviewed-by: Christoph Hellwig Reviewed-by: John Garry Reviewed-by: Bart Van Assche Reviewed-by: Martin Wilck Signed-off-by: Martin K. Petersen commit f358d6a5e6aefdd6ca3e1914f67854f82ad4daeb Merge: 89ca0ec59f11a ef399736c3ba7 Author: Arnd Bergmann Date: Fri Oct 13 22:29:07 2023 +0200 Merge tag 'samsung-dt-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/dt Samsung DTS ARM changes for v6.7 1. Switch all sound cards to generic audio-routing property, supported since previous release for Samsung drivers. The old samsung,audio-routing property is deprecated. 2. Correct Exynos4210 thermal by using polling. Apparently interrupts in Thermal Monitoring Unit are broken. * tag 'samsung-dt-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: samsung: exynos4210: enable polling ARM: dts: samsung: s5pv210-galaxys: switch sound card to audio-routing ARM: dts: samsung: s5pv210-fascinate4g: switch sound card to audio-routing ARM: dts: samsung: exynos5422-odroid: switch sound card to audio-routing ARM: dts: samsung: exynos4412-odroid: switch sound card to audio-routing ARM: dts: samsung: exynos4412-n710x: switch sound card to audio-routing ARM: dts: samsung: exynos4412-galaxy-s3: switch sound card to audio-routing ARM: dts: samsung: exynos4212-tab3: switch sound card to audio-routing Link: https://lore.kernel.org/r/20231006093943.106002-2-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit f23c7925e98a1f0d9e3ee93a856dfe3d1288a3f0 Author: Ilpo Järvinen Date: Mon Sep 4 12:53:39 2023 +0300 selftests/resctrl: Cleanup benchmark argument parsing Benchmark argument is handled by custom argument parsing code which is more complicated than it needs to be. Process benchmark argument within the normal getopt() handling and drop unnecessary ben_ind and has_ben variables. When -b is given, terminate the argument processing as -b consumes all remaining arguments. Signed-off-by: Ilpo Järvinen Tested-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: Shaopeng Tan Reviewed-by: "Wieczor-Retman, Maciej" Signed-off-by: Shuah Khan commit 149ff729538aabaa85c44dc58a45fb99798e5e7e Author: Ilpo Järvinen Date: Mon Sep 4 12:53:38 2023 +0300 selftests/resctrl: Remove ben_count variable ben_count is only used to write the terminator for the list. It is enough to use i from the loop so no need for another variable. Remove ben_count variable as it is not needed. Signed-off-by: Ilpo Järvinen Tested-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: Shaopeng Tan Reviewed-by: "Wieczor-Retman, Maciej" Signed-off-by: Shuah Khan commit e33cb5702a9f287d829b0e9e6abe57f6a4aba6d2 Author: Ilpo Järvinen Date: Mon Sep 4 12:53:37 2023 +0300 selftests/resctrl: Make benchmark command const and build it with pointers Benchmark command is used in multiple tests so it should not be mutated by the tests but CMT test alters span argument. Due to the order of tests (CMT test runs last), mutating the span argument in CMT test does not trigger any real problems currently. Mark benchmark_cmd strings as const and setup the benchmark command using pointers. Because the benchmark command becomes const, the input arguments can be used directly. Besides being simpler, using the input arguments directly also removes the internal size restriction. CMT test has to create a copy of the benchmark command before altering the benchmark command. Signed-off-by: Ilpo Järvinen Tested-by: Shaopeng Tan Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: "Wieczor-Retman, Maciej" Signed-off-by: Shuah Khan commit 47809eb70cdc81221e03baafe8c1768801a9184e Author: Ilpo Järvinen Date: Mon Sep 4 12:53:36 2023 +0300 selftests/resctrl: Reorder resctrl FS prep code and benchmark_cmd init Benchmark command is initialized before resctrl FS check and preparation code that can call ksft_exit_skip(). There is no strong reason why the resctrl FS support check and unmounting it (if already mounted), has to be done after the benchmark command initialization. Move benchmark command initialization such that it is done not until right before the tests commence. This simplifies rollback handling when benchmark command initialization starts to use dynamic allocation (in a change following this). Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre Reviewed-by: "Wieczor-Retman, Maciej" Signed-off-by: Shuah Khan commit b1a901e078c4ee4a6fe13021c4577ef5f3155251 Author: Ilpo Järvinen Date: Mon Sep 4 12:53:35 2023 +0300 selftests/resctrl: Simplify span lifetime struct resctrl_val_param contains span member. resctrl_val(), however, never uses it because the value of span is embedded into the default benchmark command and parsed from it by run_benchmark(). Remove span from resctrl_val_param. Provide DEFAULT_SPAN for the code that needs it. CMT and CAT tests communicate span that is different from the DEFAULT_SPAN between their internal functions which is converted into passing it directly as a parameter. Signed-off-by: Ilpo Järvinen Tested-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: Shaopeng Tan Reviewed-by: "Wieczor-Retman, Maciej" Signed-off-by: Shuah Khan commit 47e36f16c7846bf3627ff68525e02555c53dc99e Author: Ilpo Järvinen Date: Mon Sep 4 12:53:34 2023 +0300 selftests/resctrl: Remove bw_report and bm_type from main() bw_report is always set to "reads" and bm_type is set to "fill_buf" but is never used. Set bw_report directly to "reads" in MBA/MBM test and remove bm_type. Signed-off-by: Ilpo Järvinen Tested-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: Shaopeng Tan Reviewed-by: "Wieczor-Retman, Maciej" Signed-off-by: Shuah Khan commit 5eb6360eeeb661c7589bc344c1c51e9dfcb63451 Author: Ilpo Järvinen Date: Mon Sep 4 12:53:33 2023 +0300 selftests/resctrl: Correct benchmark command help Benchmark command must be the last argument because it consumes all the remaining arguments but help misleadingly shows it as the first argument. The benchmark command is also shown in quotes but it does not match with the code. Correct -b argument place in the help message and remove the quotes. Tweak also how the options are presented by using ... notation. Signed-off-by: Ilpo Järvinen Tested-by: Shaopeng Tan Reviewed-by: Shaopeng Tan Reviewed-by: Reinette Chatre Reviewed-by: "Wieczor-Retman, Maciej" Signed-off-by: Shuah Khan commit 4a28c7665c2a1ac0400864eabb0c641e135f61aa Author: Ilpo Järvinen Date: Mon Sep 4 12:53:32 2023 +0300 selftests/resctrl: Ensure the benchmark commands fits to its array Benchmark command is copied into an array in the stack. The array is BENCHMARK_ARGS items long but the command line could try to provide a longer command. Argument size is also fixed by BENCHMARK_ARG_SIZE (63 bytes of space after fitting the terminating \0 character) and user could have inputted argument longer than that. Return error in case the benchmark command does not fit to the space allocated for it. Fixes: ecdbb911f22d ("selftests/resctrl: Add MBM test") Signed-off-by: Ilpo Järvinen Tested-by: Shaopeng Tan Reviewed-by: Shaopeng Tan Reviewed-by: "Wieczor-Retman, Maciej" Reviewed-by: Reinette Chatre Signed-off-by: Shuah Khan commit 27c734f4402243f478348108d8a2ebd6e3e5e8a3 Author: Maciej Wieczor-Retman Date: Fri Oct 13 13:36:32 2023 +0200 selftests/resctrl: Fix wrong format specifier Compiling resctrl selftest after adding a __printf() attribute to ksft_print_msg() exposes -Wformat warning in show_cache_info(). The format specifier used expects a variable of type int but a long unsigned int variable is passed instead. Change the format specifier to match the passed variable. Signed-off-by: Maciej Wieczor-Retman Reviewed-by: Ilpo Järvinen Reviewed-by: Reinette Chatre Signed-off-by: Shuah Khan commit d3772e7badd2cd3813e2efba0034f6e39aecc97f Author: Maciej Wieczor-Retman Date: Fri Oct 13 13:36:31 2023 +0200 selftests/mm: Substitute attribute with a macro Compiling mm selftest after adding a __printf() attribute to ksft_print_msg() exposes -Wformat warning in remap_region(). Fix the wrong format specifier causing the warning. The mm selftest uses the printf attribute in its full form. Since the header file that uses it also includes kselftests.h it can use the macro defined there. Use __printf() included with kselftests.h instead of the full attribute. Signed-off-by: Maciej Wieczor-Retman Signed-off-by: Shuah Khan commit 07bd3c38809216e2c32bd479fd489143e72deb1f Author: Maciej Wieczor-Retman Date: Fri Oct 13 13:36:30 2023 +0200 selftests/kvm: Replace attribute with macro The __printf() macro is used in many tools in the linux kernel to validate the format specifiers in functions that use printf. The kvm selftest uses it without putting it in a macro definition while it also imports the kselftests.h header where the macro attribute is defined. Use __printf() from kselftests.h instead of the full attribute. Signed-off-by: Maciej Wieczor-Retman Signed-off-by: Shuah Khan commit a8cfb036115cf840978dd9c384a5cf30899e14b2 Author: Maciej Wieczor-Retman Date: Fri Oct 13 13:36:29 2023 +0200 selftests/sigaltstack: Fix wrong format specifier Compiling sigaltstack selftest after adding a __printf() attribute to ksft_print_msg() exposes -Wformat warning in main(). The format specifier inside ksft_print_msg() expects a long unsigned int but the passed variable is of unsigned int type. Fix the format specifier so it matches the passed variable. Signed-off-by: Maciej Wieczor-Retman Reviewed-by: Ilpo Järvinen Signed-off-by: Shuah Khan commit 4d7f4e8158b62f63031510cdc24acc520956c091 Author: Maciej Wieczor-Retman Date: Fri Oct 13 13:36:28 2023 +0200 selftests/pidfd: Fix ksft print formats Compiling pidfd selftest after adding a __printf() attribute to ksft_print_msg() and ksft_test_result_pass() exposes -Wformat warnings in error_report(), test_pidfd_poll_exec_thread(), child_poll_exec_test(), test_pidfd_poll_leader_exit_thread(), child_poll_leader_exit_test(). The ksft_test_result_pass() in error_report() expects a string but doesn't provide any argument after the format string. All the other calls to ksft_print_msg() in the functions mentioned above have format strings that don't match with other passed arguments. Fix format specifiers so they match the passed variables. Add a missing variable to ksft_test_result_pass() inside error_report() so it matches other cases in the switch statement. Fixes: 2def297ec7fb ("pidfd: add tests for NSpid info in fdinfo") Signed-off-by: Maciej Wieczor-Retman Signed-off-by: Shuah Khan commit 287d29827ffc97e6978fa030b7412330a93dd38a Author: Maciej Wieczor-Retman Date: Fri Oct 13 13:36:27 2023 +0200 selftests/openat2: Fix wrong format specifier Compiling openat2 selftest after adding a __printf() attribute to ksft_print_msg() exposes a -Wformat warning in test_openat2_flags(). The wrong format specifier is used for printing test.how->flags variable. Change the format specifier to %llX so it matches the printed variable. Signed-off-by: Maciej Wieczor-Retman Reviewed-by: Ilpo Järvinen Signed-off-by: Shuah Khan commit 3aa779a9d141f65adbe519653b6aee7188c49e27 Author: Maciej Wieczor-Retman Date: Fri Oct 13 13:36:26 2023 +0200 selftests/cachestat: Fix print_cachestat format Compiling cachestat selftest after adding a __printf() attribute to ksft_print_msg() exposes a -Wformat warning in print_cachestat(). The format specifier in printf() call expects long int variables and received long long int. Change format specifiers to long long int so they match passed variables. Signed-off-by: Maciej Wieczor-Retman Acked-by: Nhat Pham Signed-off-by: Shuah Khan commit e33a02ed6a4fbadfa7813831f1f52874c991d324 Author: Maciej Wieczor-Retman Date: Fri Oct 13 13:36:25 2023 +0200 selftests: Add printf attribute to kselftest prints Kselftest header defines multiple variadic functions that use printf along with other logic. There is no format checking for the variadic functions that use printing inside kselftest.h. Because of this the compiler won't be able to catch instances of mismatched printf formats and debugging tests might be more difficult. Add the common __printf() attribute macro to kselftest.h. Add __printf() attribute to every function using formatted printing with variadic arguments. Adding the attribute and compiling all selftests exposes a number of -Wformat warnings which were previously unnoticed due to a lack of format specifiers checking by the compiler. Signed-off-by: Maciej Wieczor-Retman Reviewed-by: Ilpo Järvinen Reviewed-by: Reinette Chatre Signed-off-by: Shuah Khan commit 1caddfc5816e4bf55cf7962775e6ed509ddfdf9b Merge: 9f4c887fe64e2 6dbc829d101d9 Author: Martin K. Petersen Date: Fri Oct 13 15:56:37 2023 -0400 Merge patch series "scsi: target: Allow userspace to config cmd submission" Mike Christie says: The following patches were made over Linus's tree but apply over Martin's branches. They allow userspace to configure how fabric drivers submit cmds to backend drivers. Right now loop and vhost use a worker thread, and the other drivers submit from the contexts they receive/process the cmd from. For multiple LUN cases where the target can queue more cmds than the backend can handle then deferring to a worker thread is safest because the backend driver can block when doing things like waiting for a free request/tag. Deferring also helps when the target has to handle transport level requests from the recv context. For cases where the backend devices can queue everything the target sends, then there is no need to defer to a workqueue and you can see a perf boost of up to 26% for small IO workloads. For a nvme device and vhost-scsi I can see with 4K IOs: fio jobs 1 2 4 8 10 -------------------------------------------------- workqueue submit 94K 190K 394K 770K 890K direct submit 128K 252K 488K 950K - Link: https://lore.kernel.org/r/1b1f7a5c-0988-45f9-b103-dfed2c0405b1@oracle.com Signed-off-by: Martin K. Petersen commit 6dbc829d101d9edb41081de01968792a009c9a78 Author: Mike Christie Date: Wed Sep 27 21:09:07 2023 -0500 scsi: target: Export fabric driver direct submit settings This exports the fabric driver's direct submit settings, so users know what the driver supports. It will be helpful when they are exporting a device through different targets and one doesn't support direct submission. The new files allow the fabric to report what submission types they default to and if they support direct submission: default_submit_type: 1 - TARGET_DIRECT_SUBMIT - If the user has not requested a specific value then the fabric requests direct submission. 2 - TARGET_QUEUE_SUBMIT - If the user has not requested a specific value then the fabric requests queued submission. Note that these fabric values are based on what the fabric driver currently defaults to for compat with exiting setups. direct_submit_supported: 0 - The fabric does not support direct submission. 1 - The fabric supports direct submission. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230928020907.5730-8-michael.christie@oracle.com Signed-off-by: Martin K. Petersen commit e344c00e7ccd8c86e284999921fe0a6e623fffc8 Author: Mike Christie Date: Wed Sep 27 21:09:06 2023 -0500 scsi: target: core: Unexport target_queue_submission() target_queue_submission() is not called by drivers anymore so unexport it. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230928020907.5730-7-michael.christie@oracle.com Signed-off-by: Martin K. Petersen commit e2f4ea40138e16d1dfd768f2dead8f3f75a85673 Author: Mike Christie Date: Wed Sep 27 21:09:05 2023 -0500 scsi: target: Allow userspace to request direct submissions This allows userspace to request the fabric drivers do direct submissions if they support it. With the new device file, submit_type, users can write 0 - 2 to control how commands are submitted to the backend: 0 - TARGET_FABRIC_DEFAULT_SUBMIT - LIO will use the fabric's default submission type. This is the default for compat. 1 - TARGET_DIRECT_SUBMIT - LIO will submit the cmd to the backend from the calling context if the fabric the cmd was received on supports it, else it will use the fabric's default type. 2 - TARGET_QUEUE_SUBMIT - LIO will queue the cmd to the LIO submission workqueue which will pass it to the backend. When using an NVMe drive and vhost-scsi with direct submission we see around a 20% improvement in 4K I/Os: fio jobs 1 2 4 8 10 -------------------------------------------------- defer 94K 190K 394K 770K 890K direct 128K 252K 488K 950K - And when using the queueing mode, we now no longer see issues like where the iSCSI tx thread is blocked in the block layer waiting on a tag so it can't respond to a nop or perform I/Os for other LUs. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230928020907.5730-6-michael.christie@oracle.com Signed-off-by: Martin K. Petersen commit 428926796e7f3b2eb57b1d4886334d2f5abb35fa Author: Mike Christie Date: Wed Sep 27 21:09:04 2023 -0500 scsi: target: core: Kill transport_handle_cdb_direct() Move the code from transport_handle_cdb_direct() to target_submit() and have iSCSI call target_submit(). Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230928020907.5730-5-michael.christie@oracle.com Signed-off-by: Martin K. Petersen commit 5c48a4ea32806f3d74731f7304f5fbf2035ab985 Author: Mike Christie Date: Wed Sep 27 21:09:03 2023 -0500 scsi: target: core: Move buffer clearing hack Move the hack to clear some buffers to transport_handle_cdb_direct() so we can eventually merge transport_handle_cdb_direct() and target_submit(). This also fixes up the comment so it's clear it was only for udev and reflects that the referenced function does not exist and we now allow more than 1 page for control CDBs. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230928020907.5730-4-michael.christie@oracle.com Signed-off-by: Martin K. Petersen commit ee48345e1ccaaa7a9f0a8b34c694a68286ac78fa Author: Mike Christie Date: Wed Sep 27 21:09:02 2023 -0500 scsi: target: core: Move core_alua_check_nonop_delay() call Move core_alua_check_nonop_delay() to transport_handle_cdb_direct() so the iSCSI target driver doesn't have to call as many core functions directly. We will eventually merge transport_handle_cdb_direct and target_submit so iSCSI and the other drivers call a common function. It will also be helpful as preparation for future changes which allow the iSCSI target to defer command submission to the LIO submission workqueue, because we will have a common submission function for that which will be based on transport_handle_cdb_direct()/target_submit(). Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230928020907.5730-3-michael.christie@oracle.com Signed-off-by: Martin K. Petersen commit 194605d45dcb511983caca699d81855693b25fe0 Author: Mike Christie Date: Wed Sep 27 21:09:01 2023 -0500 scsi: target: Have drivers report if they support direct submissions In some cases, like with multiple LUN targets or where the target has to respond to transport level requests from the receiving context it can be better to defer cmd submission to a helper thread. If the backend driver blocks on something like request/tag allocation it can block the entire target submission path and other LUs and transport IO on that session. In other cases like single LUN targets with storage that can support all the commands that the target can queue, then it's best to submit the cmd to the backend from the target's cmd receiving context. Subsequent commits will allow the user to config what they prefer, but drivers like loop can't directly submit because they can be called from a context that can't sleep. And, drivers like vhost-scsi can support direct submission, but need to keep their default behavior of deferring execution to avoid possible regressions where the backend can block. Make the drivers tell LIO core if they support direct submissions and their current default, so we can prevent users from misconfiguring the system and initialize devices correctly. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230928020907.5730-2-michael.christie@oracle.com Signed-off-by: Martin K. Petersen commit 40ddd6df93a359e5494424de5f8d730ffe7ac99a Author: Mike Christie Date: Wed Sep 27 21:09:00 2023 -0500 scsi: target: iscs: Make write_pending_must_be_called a bit field Subsequent commits add more on/off type of settings to the target_core_fabric_ops struct so this makes write_pending_must_be_called a bit field instead of a bool to better organize the settings. Signed-off-by: Mike Christie Link: https://lore.kernel.org/r/20230928020907.5730-1-michael.christie@oracle.com Signed-off-by: Martin K. Petersen commit ba8ea72388a192c10f1ee5f5a4a32332e7cced76 Author: Artem Savkov Date: Fri Oct 13 07:42:19 2023 +0200 bpf: Change syscall_nr type to int in struct syscall_tp_t linux-rt-devel tree contains a patch (b1773eac3f29c ("sched: Add support for lazy preemption")) that adds an extra member to struct trace_entry. This causes the offset of args field in struct trace_event_raw_sys_enter be different from the one in struct syscall_trace_enter: struct trace_event_raw_sys_enter { struct trace_entry ent; /* 0 12 */ /* XXX last struct has 3 bytes of padding */ /* XXX 4 bytes hole, try to pack */ long int id; /* 16 8 */ long unsigned int args[6]; /* 24 48 */ /* --- cacheline 1 boundary (64 bytes) was 8 bytes ago --- */ char __data[]; /* 72 0 */ /* size: 72, cachelines: 2, members: 4 */ /* sum members: 68, holes: 1, sum holes: 4 */ /* paddings: 1, sum paddings: 3 */ /* last cacheline: 8 bytes */ }; struct syscall_trace_enter { struct trace_entry ent; /* 0 12 */ /* XXX last struct has 3 bytes of padding */ int nr; /* 12 4 */ long unsigned int args[]; /* 16 0 */ /* size: 16, cachelines: 1, members: 3 */ /* paddings: 1, sum paddings: 3 */ /* last cacheline: 16 bytes */ }; This, in turn, causes perf_event_set_bpf_prog() fail while running bpf test_profiler testcase because max_ctx_offset is calculated based on the former struct, while off on the latter: 10488 if (is_tracepoint || is_syscall_tp) { 10489 int off = trace_event_get_offsets(event->tp_event); 10490 10491 if (prog->aux->max_ctx_offset > off) 10492 return -EACCES; 10493 } What bpf program is actually getting is a pointer to struct syscall_tp_t, defined in kernel/trace/trace_syscalls.c. This patch fixes the problem by aligning struct syscall_tp_t with struct syscall_trace_(enter|exit) and changing the tests to use these structs to dereference context. Signed-off-by: Artem Savkov Signed-off-by: Andrii Nakryiko Acked-by: Steven Rostedt (Google) Link: https://lore.kernel.org/bpf/20231013054219.172920-1-asavkov@redhat.com commit 9c1292eca243821249fa99f40175b0660d9329e3 Author: Martin KaFai Lau Date: Fri Oct 13 11:57:02 2023 -0700 net/bpf: Avoid unused "sin_addr_len" warning when CONFIG_CGROUP_BPF is not set It was reported that there is a compiler warning on the unused variable "sin_addr_len" in af_inet.c when CONFIG_CGROUP_BPF is not set. This patch is to address it similar to the ipv6 counterpart in inet6_getname(). It is to "return sin_addr_len;" instead of "return sizeof(*sin);". Fixes: fefba7d1ae19 ("bpf: Propagate modified uaddrlen from cgroup sockaddr programs") Reported-by: Stephen Rothwell Signed-off-by: Martin KaFai Lau Signed-off-by: Andrii Nakryiko Reviewed-by: Kuniyuki Iwashima Link: https://lore.kernel.org/bpf/20231013185702.3993710-1-martin.lau@linux.dev Closes: https://lore.kernel.org/bpf/20231013114007.2fb09691@canb.auug.org.au/ commit 236334aeec0f93217cf9235f2004e61a0a1a5985 Author: Yafang Shao Date: Fri Oct 13 08:39:16 2023 +0000 bpf: Avoid unnecessary audit log for CPU security mitigations Check cpu_mitigations_off() first to avoid calling capable() if it is off. This can avoid unnecessary audit log. Fixes: bc5bc309db45 ("bpf: Inherit system settings for CPU security mitigations") Suggested-by: Andrii Nakryiko Signed-off-by: Yafang Shao Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/CAEf4Bza6UVUWqcWQ-66weZ-nMDr+TFU3Mtq=dumZFD-pSqU7Ow@mail.gmail.com/ Link: https://lore.kernel.org/bpf/20231013083916.4199-1-laoar.shao@gmail.com commit c3f7c14856ebbeb8e9e19439b9f5ec66f88744b9 Author: Conor Dooley Date: Mon Oct 9 10:37:49 2023 +0100 riscv: dts: allwinner: convert isa detection to new properties Convert the D1 devicetrees to use the new properties "riscv,isa-base" & "riscv,isa-extensions". For compatibility with other projects, "riscv,isa" remains. Acked-by: Jernej Skrabec Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20231009-moonlight-gray-92debdc89f30@wendy Signed-off-by: Jernej Skrabec commit 9f4c887fe64e27413509979b5be3fb2630d813ba Merge: 78882c7657bb2 82b2fb52d6ecc Author: Martin K. Petersen Date: Fri Oct 13 14:25:20 2023 -0400 Merge patch series "scsi: EH rework prep patches, part 1" Hannes Reinecke says: Hi all, (taking up an old thread:) here's the first batch of patches for my EH rework. It modifies the reset callbacks for SCSI drivers such that the final conversion to drop the 'struct scsi_cmnd' argument and use the entity in question (host, bus, target, device) as the argument to the SCSI EH callbacks becomes possible. The first part covers drivers which just requires minor tweaks. Link: https://lore.kernel.org/r/20231002154328.43718-1-hare@suse.de Signed-off-by: Martin K. Petersen commit 82b2fb52d6ecc3c902b46b3f9bb4325ab3f6d50d Author: Hannes Reinecke Date: Mon Oct 2 17:43:28 2023 +0200 scsi: mpi3mr: Split off bus_reset function from host_reset SCSI EH host reset is the final callback in the escalation chain; once we reach this we need to reset the controller. As such it defeats the purpose to skip controller reset if no I/Os are pending and the RAID device is to be reset; especially after kexec there might be stale commands pending in firmware for which we have no reference whatsoever. So this patch splits off the check for pending I/O into a 'bus_reset' function, and leaves the actual controller reset to the host reset. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-19-hare@suse.de Cc: Kashyap Desai Cc: Sathya Prakash Veerichetty Cc: Sumit Saxena Cc: Sreekanth Reddy Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit c2a14ab3b9b38d9408a0388a0c65dce546169907 Author: Hannes Reinecke Date: Mon Oct 2 17:43:27 2023 +0200 scsi: pmcraid: Select device in pmcraid_eh_target_reset_handler() The reset code requires a device to be selected, but we shouldn't rely on the command to provide a device for us. So select the first device on the target when sending down a target reset. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-18-hare@suse.de Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 09df4697223aa167a47e3745394ab55c6ffc85d2 Author: Hannes Reinecke Date: Mon Oct 2 17:43:26 2023 +0200 scsi: pmcraid: Select device in pmcraid_eh_bus_reset_handler() The reset code requires a device to be selected, but we shouldn't rely on the command to provide a device for us. So select the first device on the bus when sending down a bus reset. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-17-hare@suse.de Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit bffebc1993a0e82d8b6003750369f6876592de11 Author: Hannes Reinecke Date: Mon Oct 2 17:43:25 2023 +0200 scsi: qla1280: Separate out host reset function from qla1280_error_action() There's not much in common between host reset and all other error handlers, so use a separate function here. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-16-hare@suse.de Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit c7c559d2b39a64d1c2c45321d92f32171e7694f3 Author: Hannes Reinecke Date: Mon Oct 2 17:43:24 2023 +0200 scsi: sym53c8xx_2: Rework reset handling Split off the combined abort and device reset handling into distinct functions. And rename the current device reset handler into a target reset handler, seeing that it really is a target reset. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-15-hare@suse.de Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 4980ae18c37beec9c55905014864cfe134698b68 Author: Hannes Reinecke Date: Mon Oct 2 17:43:23 2023 +0200 scsi: sym53c8xx_2: Split off bus reset from host reset The current handler does both, bus reset and host reset. So split them off into two distinct functions. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-14-hare@suse.de Cc: Matthew Wilcox Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit c8102e421e7a395260648e953e90b47fefc67f2d Author: Hannes Reinecke Date: Mon Oct 2 17:43:22 2023 +0200 scsi: ips: Do not try to abort command from host reset The code for aborting an outstanding command is a copy of the functionality from command abort. As we already have called this function once we reach host reset there's no point in trying to do so again. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-13-hare@suse.de Cc: Adaptec OEM Raid Solutions Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 5bcd3bfbda0240c136ed68da78a042172ed0ed7f Author: Hannes Reinecke Date: Mon Oct 2 17:43:21 2023 +0200 scsi: megaraid: Pass in NULL scb for host reset When calling a host reset we shouldn't rely on the command triggering the reset, so allow megaraid_abort_and_reset() to be called with a NULL scb. And drop the pointless 'bus_reset' and 'target_reset' handlers, which just call the same function as host_reset. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-12-hare@suse.de Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 397ff21a962d8a5ac607abe21533e89a2387a713 Author: Hannes Reinecke Date: Mon Oct 2 17:43:20 2023 +0200 scsi: ibmvfc: Open-code reset loop for target reset For target reset we need a device to send the target reset to, so open-code the loop in target reset to send the target reset TMF to the correct device. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-11-hare@suse.de Cc: Tyrel Datwyler Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit c67e63800446f9c72e362fe6f5e0c623fbe2e394 Author: Hannes Reinecke Date: Mon Oct 2 17:43:19 2023 +0200 scsi: aic79xx: Do not reference SCSI command when resetting device When sending a device reset we should not take a reference to the SCSI command. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-10-hare@suse.de Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 9cc9ef28199d9f964cc42e8a0978216bd9c2ba83 Author: Hannes Reinecke Date: Mon Oct 2 17:43:18 2023 +0200 scsi: aic79xx: Make BUILD_SCSIID() a function Convert BUILD_SCSIID() into a function and add a scsi_device argument. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-9-hare@suse.de Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 10f5aa018f94bf33d4e6b8d3a28eb376457e61ea Author: Hannes Reinecke Date: Mon Oct 2 17:43:17 2023 +0200 scsi: aic7xxx: Do not reference SCSI command when resetting device When sending a device reset we should not take a reference to the SCSI command. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-8-hare@suse.de Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 958230bcdda20a5b19615517dbb3b63e839c4fd2 Author: Hannes Reinecke Date: Mon Oct 2 17:43:16 2023 +0200 scsi: aic7xxx: Make BUILD_SCSIID() a function Convert BUILD_SCSIID() into a function and add a scsi_device argument. Reported-by: kernel test robot Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-7-hare@suse.de Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 6a137a967bc7da58f8e304c96af1df947f13e52c Author: Hannes Reinecke Date: Mon Oct 2 17:43:15 2023 +0200 scsi: bnx2fc: Do not rely on a SCSI command for LUN or target reset When a LUN or target reset is issued, we should not rely on a SCSI command to be present; we'll have to reset the entire device or target anyway. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-6-hare@suse.de Cc: Saurav Kashyap Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit ade4fb94578a9e7b5fdf5edfcf065ed731149afb Author: Hannes Reinecke Date: Mon Oct 2 17:43:14 2023 +0200 scsi: qedf: Use FC rport as argument for qedf_initiate_tmf() When sending a TMF we're only concerned with the rport and the LUN ID, so use struct fc_rport as argument for qedf_initiate_tmf(). Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-5-hare@suse.de Cc: Saurav Kashyap Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 17865dc2eccca0177433eb52c06befdc82b6a286 Author: Hannes Reinecke Date: Mon Oct 2 17:43:13 2023 +0200 scsi: message: fusion: Open-code mptfc_block_error_handler() for bus reset When calling bus_reset we have potentially several ports to be reset, so this patch open-codes the existing mptfc_block_error_handler() to wait for all ports attached to this bus. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-4-hare@suse.de Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit e6629081fb125d6a40b430450099735b35309a82 Author: Hannes Reinecke Date: Mon Oct 2 17:43:12 2023 +0200 scsi: message: fusion: Correct definitions for mptscsih_dev_reset() mptscsih_dev_reset() is _not_ a device reset, but rather a target reset. Nevertheless it's being used for either purpose. This patch adds a correct implementation for mptscsih_dev_reset(), and renames the original function to mptscsih_target_reset(). Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-3-hare@suse.de Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit d9987d4b9671541273014adefec137c1fc832168 Author: Hannes Reinecke Date: Mon Oct 2 17:43:11 2023 +0200 scsi: message: fusion: Simplify mptfc_block_error_handler() Instead of passing in a function to mptfc_block_error_handler() we can as well return a status and call the function afterwards. Signed-off-by: Hannes Reinecke Link: https://lore.kernel.org/r/20231002154328.43718-2-hare@suse.de Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 78882c7657bb276bab028d92f99fc185b25a2fc1 Author: Nathan Chancellor Date: Tue Oct 10 13:32:37 2023 -0700 scsi: ibmvfc: Use 'unsigned int' for single-bit bitfields in 'struct ibmvfc_host' Clang warns (or errors with CONFIG_WERROR=y) several times along the lines of: drivers/scsi/ibmvscsi/ibmvfc.c:650:17: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion] 650 | vhost->reinit = 1; | ^ ~ A single-bit signed integer bitfield only has possible values of -1 and 0, not 0 and 1 like an unsigned one would. No context appears to check the actual value of these bitfields, just whether or not it is zero. However, it is easy enough to change the type of the fields to 'unsigned int', which keeps the same size in memory and resolves the warning. Fixes: 5144905884e2 ("scsi: ibmvfc: Use a bitfield for boolean flags") Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20231010-ibmvfc-fix-bitfields-type-v1-1-37e95b5a60e5@kernel.org Reviewed-by: Nick Desaulniers Signed-off-by: Martin K. Petersen commit 4df105f0ce9f6f30cda4e99f577150d23f0c9c5f Author: Wenchao Hao Date: Wed Oct 11 21:03:50 2023 +0800 scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup() fc_lport_ptp_setup() did not check the return value of fc_rport_create() which can return NULL and would cause a NULL pointer dereference. Address this issue by checking return value of fc_rport_create() and log error message on fc_rport_create() failed. Signed-off-by: Wenchao Hao Link: https://lore.kernel.org/r/20231011130350.819571-1-haowenchao2@huawei.com Reviewed-by: Simon Horman Signed-off-by: Martin K. Petersen commit f42706a8f0cb57db3990a7f53be8bcc2a2be9b27 Author: Muhammad Muzammil Date: Fri Oct 13 10:51:21 2023 +0500 scsi: cxgbi: Fix 'generated' typo Fix 'generated' typo. Signed-off-by: Muhammad Muzammil Link: https://lore.kernel.org/r/20231013055121.12310-1-m.muzzammilashraf@gmail.com Signed-off-by: Martin K. Petersen commit 72e301956dbb31bd679eff66fbe3da32d2dc2af5 Author: Joey Gouly Date: Tue Oct 3 13:45:44 2023 +0100 kselftest/arm64: add FEAT_LSE128 to hwcap test Add test of a 128-bit atomic instruction for FEAT_LSE128. Signed-off-by: Joey Gouly Cc: Will Deacon Link: https://lore.kernel.org/r/20231003124544.858804-3-joey.gouly@arm.com [catalin.marinas@arm.com: reordered lse128_sigill() alphabetically] Signed-off-by: Catalin Marinas commit 94d0657f9f0d311489606589133ebf49e28104d8 Author: Joey Gouly Date: Tue Oct 3 13:45:43 2023 +0100 arm64: add FEAT_LSE128 HWCAP Add HWCAP for FEAT_LSE128 (128-bit Atomic instructions). Signed-off-by: Joey Gouly Cc: Will Deacon Link: https://lore.kernel.org/r/20231003124544.858804-2-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 80652cc0c0485da593c1639a6355dcdab95364e6 Author: Joey Gouly Date: Tue Sep 19 17:27:57 2023 +0100 selftests/arm64: add HWCAP2_LRCPC3 test Add a test for the newly added HWCAP2_LRCPC3. Signed-off-by: Joey Gouly Cc: Will Deacon Link: https://lore.kernel.org/r/20230919162757.2707023-3-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 338a835f40a849cd89b993e342bd9fbd5684825c Author: Joey Gouly Date: Tue Sep 19 17:27:56 2023 +0100 arm64: add FEAT_LRCPC3 HWCAP FEAT_LRCPC3 adds more instructions to support the Release Consistency model. Add a HWCAP so that userspace can make decisions about instructions it can use. Signed-off-by: Joey Gouly Cc: Will Deacon Link: https://lore.kernel.org/r/20230919162757.2707023-2-joey.gouly@arm.com [catalin.marinas@arm.com: change the HWCAP number] Signed-off-by: Catalin Marinas commit 5829046825ac89fffc60f2670bc564fda2c0155a Author: Michal Wilczynski Date: Wed Oct 11 11:33:31 2023 +0300 ACPI: AC: Replace acpi_driver with platform_driver The AC driver uses struct acpi_driver to register itself while it would be more logically consistent to use struct platform_driver for this purpose, because the corresponding platform device is present and the role of struct acpi_device is to amend the other bus types. ACPI devices are not meant to be used as proper representation of hardware entities, but to collect information on those hardware entities provided by the platform firmware. Use struct platform_driver for registering the AC driver. Suggested-by: Rafael J. Wysocki Signed-off-by: Michal Wilczynski [ rjw: Changelog edits, acpi_ac_notify() modifications fixup ] Signed-off-by: Rafael J. Wysocki commit 616990c92e40e4721beb66c2f855915fc1f32aba Author: Michal Wilczynski Date: Wed Oct 11 11:33:30 2023 +0300 ACPI: AC: Use string_choices API instead of ternary operator Use modern string_choices API instead of manually determining the output using ternary operator. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Michal Wilczynski Signed-off-by: Rafael J. Wysocki commit bc4c9757e324334b84e3ecd52d752cbce54208ab Author: Michal Wilczynski Date: Wed Oct 11 11:33:29 2023 +0300 ACPI: AC: Remove redundant checks Remove unnecessary checks against NULL for pointers that can't be NULL when the checks are done. Signed-off-by: Michal Wilczynski [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 61ebaa041f83677fa3ecd35e4c87e4332c16b4e9 Author: Jernej Skrabec Date: Mon Sep 11 19:14:07 2023 +0200 ARM: dts: sun8i-r40: Add interconnect to video-codec Video codec needs interconnect, so driver knows that it needs to adjust DMA addresses. Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20230911171407.1572030-1-jernej.skrabec@gmail.com Signed-off-by: Jernej Skrabec commit b50d9c27a31ed617e2e39787d134f8207d70e5af Author: Peter Wang Date: Thu Aug 31 21:08:26 2023 +0800 scsi: ufs: core: Fix abnormal scale up after scale down When no active_reqs, devfreq_monitor (thread A) will suspend clock scaling. But it may have racing with clk_scaling.suspend_work (thread B) and actually not suspend clock scaling (requeue after suspend). Next time after polling_ms, devfreq_monitor read clk_scaling.window_start_t = 0 then scale up clock abnormal. Below is racing step: devfreq->work (Thread A) devfreq_monitor update_devfreq ..... ufshcd_devfreq_target queue_work(hba->clk_scaling.workq, 1 &hba->clk_scaling.suspend_work) ..... 5 queue_delayed_work(devfreq_wq, &devfreq->work, msecs_to_jiffies(devfreq->profile->polling_ms)); 2 hba->clk_scaling.suspend_work (Thread B) ufshcd_clk_scaling_suspend_work __ufshcd_suspend_clkscaling devfreq_suspend_device(hba->devfreq); 3 cancel_delayed_work_sync(&devfreq->work); 4 hba->clk_scaling.window_start_t = 0; ..... Signed-off-by: Peter Wang Link: https://lore.kernel.org/r/20230831130826.5592-4-peter.wang@mediatek.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 6fd53da45bbc834b9cfdf707d2f7ebe666667943 Author: Peter Wang Date: Thu Aug 31 21:08:25 2023 +0800 scsi: ufs: core: Fix abnormal scale up after last cmd finish When ufshcd_clk_scaling_suspend_work (thread A) running and new command coming, ufshcd_clk_scaling_start_busy (thread B) may get host_lock after thread A first time release host_lock. Then thread A second time get host_lock will set clk_scaling.window_start_t = 0 which scale up clock abnormal next polling_ms time. Also inlines another __ufshcd_suspend_clkscaling calls. Below is racing step: 1 hba->clk_scaling.suspend_work (Thread A) ufshcd_clk_scaling_suspend_work 2 spin_lock_irqsave(hba->host->host_lock, irq_flags); 3 hba->clk_scaling.is_suspended = true; 4 spin_unlock_irqrestore(hba->host->host_lock, irq_flags); __ufshcd_suspend_clkscaling 7 spin_lock_irqsave(hba->host->host_lock, flags); 8 hba->clk_scaling.window_start_t = 0; 9 spin_unlock_irqrestore(hba->host->host_lock, flags); ufshcd_send_command (Thread B) ufshcd_clk_scaling_start_busy 5 spin_lock_irqsave(hba->host->host_lock, flags); .... 6 spin_unlock_irqrestore(hba->host->host_lock, flags); Signed-off-by: Peter Wang Link: https://lore.kernel.org/r/20230831130826.5592-3-peter.wang@mediatek.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 1d969731b87f122108c50a64acfdbaa63486296e Author: Peter Wang Date: Thu Aug 31 21:08:24 2023 +0800 scsi: ufs: core: Only suspend clock scaling if scaling down If clock scale up and suspend clock scaling, ufs will keep high performance/power mode but no read/write requests on going. It is logic wrong and have power concern. Signed-off-by: Peter Wang Link: https://lore.kernel.org/r/20230831130826.5592-2-peter.wang@mediatek.com Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit cf8b49fbd0418168b55c807b7fb62d7031026183 Author: Heng Guo Date: Wed Oct 11 09:51:37 2023 +0800 net: fix IPSTATS_MIB_OUTFORWDATAGRAMS increment after fragment check Reproduce environment: network with 3 VM linuxs is connected as below: VM1<---->VM2(latest kernel 6.5.0-rc7)<---->VM3 VM1: eth0 ip: 192.168.122.207 MTU 1800 VM2: eth0 ip: 192.168.122.208, eth1 ip: 192.168.123.224 MTU 1500 VM3: eth0 ip: 192.168.123.240 MTU 1800 Reproduce: VM1 send 1600 bytes UDP data to VM3 using tools scapy with flags='DF'. scapy command: send(IP(dst="192.168.123.240",flags='DF')/UDP()/str('0'*1600),count=1, inter=1.000000) Result: Before IP data is sent. ---------------------------------------------------------------------- root@qemux86-64:~# cat /proc/net/snmp Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqdss Ip: 1 64 6 0 2 2 0 0 2 4 0 0 0 0 0 0 0 0 0 ...... root@qemux86-64:~# ---------------------------------------------------------------------- After IP data is sent. ---------------------------------------------------------------------- root@qemux86-64:~# cat /proc/net/snmp Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqdss Ip: 1 64 7 0 2 2 0 0 2 5 0 0 0 0 0 0 0 1 0 ...... root@qemux86-64:~# ---------------------------------------------------------------------- ForwDatagrams is always keeping 2 without increment. Issue description and patch: ip_exceeds_mtu() in ip_forward() drops this IP datagram because skb len (1600 sending by scapy) is over MTU(1500 in VM2) if "DF" is set. According to RFC 4293 "3.2.3. IP Statistics Tables", +-------+------>------+----->-----+----->-----+ | InForwDatagrams (6) | OutForwDatagrams (6) | | V +->-+ OutFragReqds | InNoRoutes | | (packets) / (local packet (3) | | | IF is that of the address | +--> OutFragFails | and may not be the receiving IF) | | (packets) the IPSTATS_MIB_OUTFORWDATAGRAMS should be counted before fragment check. The existing implementation, instead, would incease the counter after fragment check: ip_exceeds_mtu() in ipv4 and ip6_pkt_too_big() in ipv6. So do patch to move IPSTATS_MIB_OUTFORWDATAGRAMS counter to ip_forward() for ipv4 and ip6_forward() for ipv6. Test result with patch: Before IP data is sent. ---------------------------------------------------------------------- root@qemux86-64:~# cat /proc/net/snmp Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqdss Ip: 1 64 6 0 2 2 0 0 2 4 0 0 0 0 0 0 0 0 0 ...... root@qemux86-64:~# ---------------------------------------------------------------------- After IP data is sent. ---------------------------------------------------------------------- root@qemux86-64:~# cat /proc/net/snmp Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqdss Ip: 1 64 7 0 2 3 0 0 2 5 0 0 0 0 0 0 0 1 0 ...... root@qemux86-64:~# ---------------------------------------------------------------------- ForwDatagrams is updated from 2 to 3. Reviewed-by: Filip Pudak Signed-off-by: Heng Guo Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20231011015137.27262-1-heng.guo@windriver.com Signed-off-by: Jakub Kicinski commit 1bc60524ca1a3d350e91de083c7331de1ee22c39 Merge: 35715ac13a778 82f9378c443c2 Author: Jakub Kicinski Date: Fri Oct 13 09:35:34 2023 -0700 Merge branch 'mlx5-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux Leon Romanovsky says: ==================== This PR is collected from https://lore.kernel.org/all/cover.1695296682.git.leon@kernel.org This series from Patrisious extends mlx5 to support IPsec packet offload in multiport devices (MPV, see [1] for more details). These devices have single flow steering logic and two netdev interfaces, which require extra logic to manage IPsec configurations as they performed on netdevs. [1] https://lore.kernel.org/linux-rdma/20180104152544.28919-1-leon@kernel.org/ * 'mlx5-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux: net/mlx5: Handle IPsec steering upon master unbind/bind net/mlx5: Configure IPsec steering for ingress RoCEv2 MPV traffic net/mlx5: Configure IPsec steering for egress RoCEv2 MPV traffic net/mlx5: Add create alias flow table function to ipsec roce net/mlx5: Implement alias object allow and create functions net/mlx5: Add alias flow table bits net/mlx5: Store devcom pointer inside IPsec RoCE net/mlx5: Register mlx5e priv to devcom in MPV mode RDMA/mlx5: Send events from IB driver about device affiliation state net/mlx5: Introduce ifc bits for migration in a chunk mode ==================== Link: https://lore.kernel.org/r/20231002083832.19746-1-leon@kernel.org Signed-off-by: Jakub Kicinski commit a48e2cc92835fa1d9b373b804b2173c779387b8e Author: Thomas Zimmermann Date: Mon Oct 9 16:06:35 2023 +0200 drm/ssd130x: Fix atomic_check for disabled planes The plane's atomic_check returns -EINVAL if the CRTC has not been set. This is the case for disabled planes, for which atomic_check should return 0. For disabled planes, it also omits the mandatory call to drm_atomic_helper_check_plane_state(). Replace the test with the boiler-plate code that first invokes drm_atomic_helper_check_plane_state() and then tests for the plane to be visible. Return early for non-visible planes. Signed-off-by: Thomas Zimmermann Fixes: d51f9fbd98b6 ("drm/ssd130x: Store the HW buffer in the driver-private CRTC state") Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Cc: Geert Uytterhoeven Cc: Javier Martinez Canillas Cc: Maxime Ripard Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20231009141018.11291-7-tzimmermann@suse.de commit a779ed754e52d582b8c0e17959df063108bd0656 Author: Dave Kleikamp Date: Thu Oct 5 09:16:14 2023 -0500 jfs: define xtree root and page independently In order to make array bounds checking sane, provide a separate definition of the in-inode xtree root and the external xtree page. Signed-off-by: Dave Kleikamp Tested-by: Manas Ghandat commit cd90511557fdfb394bb4ac4c3b539b007383914c Author: Ma Ke Date: Fri Oct 13 09:53:43 2023 +0800 drm/amdgpu/vkms: fix a possible null pointer dereference In amdgpu_vkms_conn_get_modes(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid null pointer dereference. Signed-off-by: Ma Ke Signed-off-by: Alex Deucher commit 49c775b783cb7de88461ca6c1385bd8c3e8b9b92 Author: Li Ma Date: Wed Oct 11 22:51:50 2023 +0800 drm/amd/swsmu: update smu v14_0_0 header files and metrics table Update driver if, pmfw and ppsmc header files. Add new gpu_metrics_v3_0 for metrics table updated in driver if and reserve legacy metrics table to maintain backward compatibility. --- v1: Update header files and add gpu_metrics_v3_0. v2: Update smu_types.h, smu headers and drop smu_cmn_get_smc_version in smu v14_0_0. Signed-off-by: Li Ma Reviewed-by: Yifan Zhang Reviewed-by: Kenneth Feng Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 3bba4bc6a0ebf424648476290750a49dc8032730 Author: Yang Wang Date: Wed Sep 27 11:31:16 2023 +0800 drm/amdgpu: add RAS error info support for umc_v12_0 add RAS error info support for umc_v12_0. Signed-off-by: Yang Wang Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 8736d17a7f98be9de7b08eb94f08578576b6b043 Author: Yang Wang Date: Wed Sep 27 12:21:12 2023 +0800 drm/amdgpu: add RAS error info support for mmhub_v1_8 add RAS error info support for mmhub_v1_8. Signed-off-by: Yang Wang Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 156c2814c294abb274143ccc17b44c1fdb56572a Author: Yang Wang Date: Wed Sep 27 12:02:28 2023 +0800 drm/amdgpu: add RAS error info support for gfx_v9_4_3 add RAS error info support for gfx_v9_4_3. Signed-off-by: Yang Wang Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit dd401cd29a887a1f7f46a52d6275c5d0daeb9cf3 Author: Yang Wang Date: Wed Sep 27 11:39:30 2023 +0800 drm/amdgpu: add RAS error info support for sdma_v4_4_2. add RAS error info support for sdma_v4_4_2. Signed-off-by: Yang Wang Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5b1270beb3801d328b43577a8bb1152d435bb146 Author: Yang Wang Date: Mon Sep 25 19:30:26 2023 +0800 drm/amdgpu: add ras_err_info to identify RAS error source introduced "ras_err_info" to better identify a RAS ERROR source. NOTE: For legacy chips, keep the original RAS error print format. v1: RAS errors may come from different dies during a RAS error query, therefore, need a new data structure to identify the source of RAS ERROR. v2: - use new data structure 'amdgpu_smuio_mcm_config_info' instead of ras_err_id (in v1 patch) - refine ras error dump function name - refine ras error dump log format Signed-off-by: Yang Wang Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6a1c31c7a88d8fd32e10a875b76922e5d175428f Author: Yifan Zhang Date: Thu Oct 12 15:27:39 2023 +0800 drm/amdgpu: flush the correct vmid tlb for specific pasid flush the correct vmid tlb for specific pasid on gmc 11. Fixes: 041a5743883d ("drm/amdgpu: fix and cleanup gmc_v11_0_flush_gpu_tlb_pasid") Signed-off-by: Yifan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 1a00cfab3772227d64a72a8e47df617dcdb2ba30 Author: Yang Wang Date: Wed Oct 11 14:09:20 2023 +0800 drm/amdgpu: make err_data structure built-in for ras_manager (No effect outside the ras_mgr data structure) Since a new member was added to the ras_err_data data structure, it becomes unreasonable for the ras_mgr instance to contain this data, because ras mgr only uses the 2 member information of ue_count/ce_count in err_data. This patch changes the code err_data into built-in structure members, making the code directly compatible. Signed-off-by: Yang Wang Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e341631f4a3129538cc398305649d54e6c0937d4 Author: Jesse Zhang Date: Fri Oct 13 09:28:44 2023 +0800 drm/amdgpu: disable GFXOFF and PG during compute for GFX9 Temporary workaround to fix issues observed in some compute applications when GFXOFF is enabled on GFX9. Signed-off-by: Jesse Zhang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit ef2354c70f542745fd7337e03f1c7c2643523daa Author: Lang Yu Date: Wed Oct 11 17:08:34 2023 +0800 drm/amdgpu/umsch: fix missing stuff during rebase These are missed during rebase. Signed-off-by: Lang Yu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit fb5b73acf7940d4537458254b8f64bf2b0d438d7 Author: Lang Yu Date: Thu Oct 12 12:27:01 2023 +0800 drm/amdgpu/umsch: correct IP version format FW uses IP_VERSION_MAJ_MIN_REV format. Signed-off-by: Lang Yu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 1c1f14a472b83420a5f707a946a75e800ec2b8ad Author: Lang Yu Date: Wed Oct 11 13:03:46 2023 +0800 drm/amdgpu: don't use legacy invalidation on MMHUB v3.3 Legacy invalidation is not supported. This is missed during rebase. Signed-off-by: Lang Yu Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 4661482b9c25eb8c6c02f83600b49c7b3ab659ef Author: Lang Yu Date: Thu Oct 12 14:30:40 2023 +0800 drm/amdgpu: correct NBIO v7.11 programing Use v7.7 before, switch to v7.11 now. Fix incorrect programing. Signed-off-by: Lang Yu Acked-by: Alex Deucher Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 2c1fe3c480f9e1deefd50d4b18be4a046011ee1f Author: Ma Ke Date: Wed Oct 11 09:21:43 2023 +0800 drm/radeon: fix a possible null pointer dereference In radeon_tv_get_modes(), the return value of drm_cvt_mode() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_cvt_mode(). Add a check to avoid null point dereference. Signed-off-by: Ma Ke Signed-off-by: Alex Deucher commit ffa88b0019c20d0bacda7cd1463af86ec744d52e Author: Xiaogang Chen Date: Thu Oct 12 15:48:06 2023 -0500 drm/amdgpu: Correctly use bo_va->ref_count in compute VMs This is needed to correctly handle BOs imported into compute VM from gfx. Both kfd and gfx should use same bo_va and set bo_va->ref_count correctly when map the Bos into same VM, otherwise we may trigger kernel general protection when iterate mappings over bo_va's valids or invalids list. Signed-off-by: Felix Kuehling Signed-off-by: Xiaogang Chen Acked-by: Christian König Reviewed-by: Ramesh Errabolu Tested-by: Xiaogang Chen Signed-off-by: Alex Deucher commit f20f3b0d6caf12cd9845e6552bf7da49060f515a Author: Lijo Lazar Date: Wed Oct 11 19:57:38 2023 +0530 drm/amd/pm: Add P2S tables for SMU v13.0.6 Add P2S table load support on SMU v13.0.6 ASICs. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 79daf69246217e29eece144ed744acafc55fa6d5 Author: Lijo Lazar Date: Wed Oct 11 19:56:21 2023 +0530 drm/amdgpu: Add support to load P2S tables Add support to load P2S tables through PSP. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit cd21cb1fcbd892e47f574f9721e067855b7a838a Author: Lijo Lazar Date: Wed Oct 11 19:43:56 2023 +0530 drm/amdgpu: Update PSP interface header Adds FW id for P2S table. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit a8558fce7ad0c60be5f652ad76adef9a387465bb Author: Lijo Lazar Date: Thu Oct 12 13:03:22 2023 +0530 drm/amdgpu: Avoid FRU EEPROM access on APU FRU EEPROM access is not valid for APU devices. Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit f74f19c4407f4ebd2a98a1d23eb75c7c4b05f272 Author: Lin.Cao Date: Tue Oct 10 16:58:31 2023 +0800 drm/amdgpu: save VCN instances init info before jpeg init JPEG init header will overwirte vcn init header info which will loss some debug information Signed-off-by: Lin.Cao Reviewed-by: Jingwen Chen Signed-off-by: Alex Deucher commit 029f9f8ae5e72a8bb22af3829121b97dcd624793 Author: Alex Hung Date: Wed Oct 11 13:24:00 2023 -0600 Revert "drm/amd/display: Skip entire amdgpu_dm build if !CONFIG_DRM_AMD_DC" This reverts commit 1b097bcd224e76807b66ef32cee76a3e87271a2b. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 0c9ae5cfefb06ed0f9d8d8ef140f8baa946c3ac4 Author: Alex Hung Date: Wed Oct 11 13:23:07 2023 -0600 Revert "drm/amd/display: Create one virtual connector in DC" This reverts commit 554340133e4f596fc40fd75a58f9cf18b6b8dbbc. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 7d3dc50e241d8d198e7f1ed9ae8195121fe8fc82 Author: Alex Hung Date: Wed Oct 11 13:23:05 2023 -0600 Revert "drm/amd/display: Disable virtual links" This reverts commit b22c336268e477e3e8fc21e7d6b18fa8c4cd1f9a. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 3dcb66171583cdec72b21496947cf18df9ed9740 Author: Alex Hung Date: Wed Oct 11 13:21:50 2023 -0600 Revert "drm/amd/display: Initialize writeback connector" This reverts commit a2830b9e852f4007f7ee53f2c5765ab07ddb55e2. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 7f5504021e9a1e9fb7eb20505eac1167ad3aef50 Author: Alex Hung Date: Wed Oct 11 13:21:49 2023 -0600 Revert "drm/amd/display: Skip writeback connector when we get amdgpu_dm_connector" This reverts commit 30a24318cc8f4947c6567c78997c8deb546e7a0b. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit e4c4139bd2fe7fe976b9ddffa2c3caee4765a4fc Author: Alex Hung Date: Wed Oct 11 13:21:48 2023 -0600 Revert "drm/amd/display: Return drm_connector from find_first_crtc_matching_connector" This reverts commit ca2b37a1c249d05f21eeb7522489036efbc6c7f8. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit e4bd165fd5bf7163e8f85d10852d2184f9ec8d59 Author: Alex Hung Date: Wed Oct 11 13:21:47 2023 -0600 Revert "drm/amd/display: Use drm_connector in create_stream_for_sink" This reverts commit 5d91801870ba0ba23d90885edf0821634ecd405d. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 710d9caec70c73b24c1c039a72d9011eb0fe4d0d Author: Yifan Zhang Date: Tue Oct 10 21:43:40 2023 +0800 drm/amd/pm: drop most smu_cmn_get_smc_version in smu smu_check_fw_version is called in smu hw init, thus smu if version and version are garenteed to be stored in smu context. No need to call smu_cmn_get_smc_version again after system boot up. Signed-off-by: Yifan Zhang Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit ce6eb957ff4cc43374344c9113a6ea94d28e7149 Author: Ma Jun Date: Wed Sep 13 16:54:58 2023 +0800 drm/amd/pm: Add reset option for fan_ctrl on smu 13.0.7 Add reset option for fan_ctrl interfaces on the smu v13.0.7 User can use command "echo r > interface_name" to reset the interface to boot value Signed-off-by: Ma Jun Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 1007bc36ecb15e1745533bd0c4c1050c65337bf7 Author: Ma Jun Date: Wed Sep 13 14:25:38 2023 +0800 drm/amd/pm: Add reset option for fan_ctrl interfaces Add reset option for fan_ctrl interfaces. For example: User can use the "echo r > acoustic_limit_rpm_threshold" command to reset acoustic_limit_rpm_threshold to boot value Signed-off-by: Ma Jun Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit c66705c5a87eebe6fb73bdb3098a0a01661e8a2c Author: Alex Hung Date: Wed Oct 11 13:18:48 2023 -0600 Revert "drm/amd/display: Create amdgpu_dm_wb_connector" This reverts commit a5f9523c9ca352d6454e81ff9e9a4419f457210a. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 6ec0e23f1823fd6c359e1d7ed949907b64d42633 Author: Alex Hung Date: Wed Oct 11 13:18:47 2023 -0600 Revert "drm/amd/display: Create fake sink and stream for writeback connector" This reverts commit 01aaeb8c23301194ee063d89c06eae41599698af. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 98a80bb3dd9d132944a0e47503fa81c4614b7cd4 Author: Alex Hung Date: Wed Oct 11 13:18:46 2023 -0600 Revert "drm/amd/display: Hande writeback request from userspace" This reverts commit cd1a4bc22821eea9a98f1beddd1a8d789989a720. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 79c8153035a08f0c6dfff247627d7cf8fcf8f588 Author: Alex Hung Date: Wed Oct 11 13:18:45 2023 -0600 Revert "drm/amd/display: Add writeback enable/disable in dc" This reverts commit c6d3c7b6309726fbe93cf595d6de326fb8295a64. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 4e807eb05dff41d500822f81744ec5f9c0591aa5 Author: Rob Herring Date: Fri Oct 6 17:46:33 2023 -0500 fpga: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Also drop of_match_ptr for xlnx_pr_decoupler_of_match, which is not necessary because DT is always used for this driver. Signed-off-by: Rob Herring Acked-by: Xu Yilun Link: https://lore.kernel.org/r/20231006224633.445035-1-robh@kernel.org [yilun.xu@intel.com: merge the fix 20231012192149.1546368-1-robh@kernel.org] Link: https://lore.kernel.org/r/20231012192149.1546368-1-robh@kernel.org Signed-off-by: Xu Yilun commit c1929159f727bbe3bf5e3e7b07030181b5ee36b7 Author: Alex Hung Date: Wed Oct 11 13:18:44 2023 -0600 Revert "drm/amd/display: Fix writeback_info never got updated" This reverts commit 8a307777c36e15f38c9f23778babcd368144c7d8. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 8f4bdbc8e99db6ec9cb0520748e49a2f2d7d1727 Author: Alex Hung Date: Wed Oct 11 13:18:38 2023 -0600 Revert "drm/amd/display: Validate hw_points_num before using it" This reverts commit 58c3b3341cea4f75dc8c003b89f8a6dd8ec55e50. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit e3c88c44e09f0ecf77ab99250df2fb34cab6c2ca Author: Alex Hung Date: Wed Oct 11 13:18:36 2023 -0600 Revert "drm/amd/display: Fix writeback_info is not removed" This reverts commit 5b89d2ccc8466e0445a4994cb288fc009b565de5. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 65033574ade97afccba074d837fd269903a83a9a Author: Catalin Marinas Date: Thu Oct 5 16:40:30 2023 +0100 arm64: swiotlb: Reduce the default size if no ZONE_DMA bouncing needed With CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC enabled, the arm64 kernel still allocates the default SWIOTLB buffer (64MB) even if ZONE_DMA is disabled or all the RAM fits into this zone. However, this potentially wastes a non-negligible amount of memory on platforms with little RAM. Reduce the SWIOTLB size to 1MB per 1GB of RAM if only needed for kmalloc() buffer bouncing. Signed-off-by: Catalin Marinas Suggested-by: Ross Burton Cc: Ross Burton Cc: Will Deacon Reviewed-by: Robin Murphy commit 731a20cb89e6ea1bd2d74bb5f615ddd3cadc52f3 Author: Alex Hung Date: Wed Oct 11 13:18:34 2023 -0600 Revert "drm/amd/display: Add writeback enable field (wb_enabled)" This reverts commit f6893fcb10c7b24526454e465f6ec2563ef044cc. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 6d2959df6575e286dd0dfa5465bbdde4890864ac Author: Alex Hung Date: Wed Oct 11 13:18:33 2023 -0600 Revert "drm/amd/display: Setup for mmhubbub3_warmup_mcif with big buffer" This reverts commit 428542d9177286c01ef7a3dbd026eb00567e06b1. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 00ce1036567d169678217bcc5127c2b5c05d165e Author: Alex Hung Date: Wed Oct 11 13:18:31 2023 -0600 Revert "drm/amd/display: Add new set_fc_enable to struct dwbc_funcs" This reverts commit b79a00a4d4f8fc827ca0fc19e259913a81252f6b. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 7086af68fab9a8c21a52134bac8cc5fc4aa49651 Author: Alex Hung Date: Wed Oct 11 13:18:24 2023 -0600 Revert "drm/amd/display: Disable DWB frame capture to emulate oneshot" This reverts commit 77a66faaccc0455fe30e326e9a997aec8d0abed4. [WHY & HOW] The writeback series cause a regression in thunderbolt display. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 60e034f28600399705d79d4629dddcc301076e54 Author: Alex Hung Date: Tue Oct 10 16:39:32 2023 -0600 drm/amd/display: Revert "drm/amd/display: Use drm_connector in create_validate_stream_for_sink" This reverts commit c4c182b5488e8d4a48be3327aab14d778cdfe5e7. After this was commit PCON and USB4 issues were observed. A new fix will be submitted instead. Signed-off-by: Alex Hung Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 625e5f3851b78ddcf1bbcfb74ea39edcdaf07d3d Author: Asad Kamal Date: Mon Oct 2 14:41:00 2023 +0800 drm/amdgpu: Expose ras version & schema info Expose ras table version & schema info to sysfs v2: Updated schema to get poison support info from ras context, removed asic specific checks Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit d4a02673b3f06502ed6fa61bb6d9afeb31b668a2 Author: Lijo Lazar Date: Tue Oct 10 12:49:25 2023 +0530 drm/amdgpu: Read PSPv13 OS version from register PSP OS updates the version information in register. On APUs with PSPv13, PSP OS will already be loaded with SBIOS. Hence use the version register instead of using information in driver binary header. Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 84ccdccce89ea610bb39d88d3f7c00212c455a35 Author: Bob Zhou Date: Tue Oct 10 11:02:44 2023 +0800 drm/amd/display: add missing NULL check for DML2 Recently, the driver introduce DML2 for future ASIC support. But, some ASIC's hubbub pointer is null before calling. It cause the below null pointer issue, so add null check to fix it. BUG: kernel NULL pointer dereference, address: 0000000000000000 RIP: 0010:dc_create_resource_pool+0xc1/0x2c0 [amdgpu] Call Trace: ? show_regs.cold+0x1a/0x1f ? __die_body+0x20/0x70 ? __die+0x2b/0x37 ? page_fault_oops+0x136/0x2c0 ? do_user_addr_fault+0x303/0x660 ? exc_page_fault+0x77/0x170 ? asm_exc_page_fault+0x27/0x30 ? dc_create_resource_pool+0xc1/0x2c0 [amdgpu] ? dc_create_resource_pool+0x243/0x2c0 [amdgpu] dc_create+0x23f/0x6b0 [amdgpu] ? dmi_matches+0xa3/0x200 amdgpu_dm_init+0x2bd/0x22a0 [amdgpu] Fixes: 7966f319c66d ("drm/amd/display: Introduce DML2") Signed-off-by: Bob Zhou Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit faeddb6eab220c2cafa58e6de9e4a6fcd9a36d19 Author: Lang Yu Date: Mon Oct 2 00:10:42 2023 +0800 drm/amdgpu/umsch: enable doorbell for umsch Program vcn_doorbell_range with vcn_ring0_1. Signed-off-by: Lang Yu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 10406abe036b97a9c3549779a41c93ca488a0b7b Author: Mario Limonciello Date: Fri Oct 6 13:50:26 2023 -0500 drm/amd/display: make dc_set_power_state() return type `void` again As dc_set_power_state() no longer allocates memory, it's not necessary to have return types and check return code as it can't fail anymore. Change it back to `void`. Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 06ad7e16425619a4a77154c2e85bededb3e04a4f Author: Mario Limonciello Date: Fri Oct 6 13:50:25 2023 -0500 drm/amd/display: Destroy DC context while keeping DML and DML2 If there is memory pressure at suspend time then dynamically allocating a large structure as part of DC suspend code will fail. Instead re-use the same structures and clear all members except those that should be maintained. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362 Acked-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit f7fbf79fb5682db0865754765f10584245d291e8 Author: Mario Limonciello Date: Fri Oct 6 13:50:24 2023 -0500 drm/amd/display: Catch errors from drm_atomic_helper_suspend() drm_atomic_helper_suspend() can return PTR_ERR(), in which case the error gets stored into `dm->cached_state`. This can cause failures during resume. Catch the error during suspend and fail the suspend instead. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362 Acked-by: Christian König Acked-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit db9988906535aad9ab64f7e78ab7d52c0d0d2781 Author: Mario Limonciello Date: Fri Oct 6 13:50:22 2023 -0500 drm/amd: Split up UVD suspend into prepare and suspend steps amdgpu_uvd_suspend() allocates memory and copies objects into that allocated memory. This fails under memory pressure. Instead move majority of this code into a prepare step when swap can still be allocated. Reviewed-by: Christian König Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit cb11ca3233aa3303dc11dca25977d2e7f24be00f Author: Mario Limonciello Date: Fri Oct 6 13:50:21 2023 -0500 drm/amd: Add concept of running prepare_suspend() sequence for IP blocks If any IP blocks allocate memory during their hw_fini() sequence this can cause the suspend to fail under memory pressure. Introduce a new phase that IP blocks can use to allocate memory before suspend starts so that it can potentially be evicted into swap instead. Reviewed-by: Christian König Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 5095d5418193eb2748c7d8553c7150b8f1c44696 Author: Mario Limonciello Date: Fri Oct 6 13:50:20 2023 -0500 drm/amd: Evict resources during PM ops prepare() callback Linux PM core has a prepare() callback run before suspend. If the system is under high memory pressure, the resources may need to be evicted into swap instead. If the storage backing for swap is offlined during the suspend() step then such a call may fail. So move this step into prepare() to move evict majority of resources and update all non-pmops callers to call the same callback. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362 Reviewed-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 31715a86206a445f52e3ce989706f8edb65c59df Author: Li Ma Date: Wed Aug 2 16:39:51 2023 +0800 drm/amdgpu: enable GFX IP v11.5.0 CG and PG support Add CG support for GFX/MC/HDP/ATHUB/IH/BIF. Add PG support for GFX. Signed-off-by: Li Ma Signed-off-by: Alex Deucher commit e4deccc1d1ac5d733b6512780aa390fab8acd3f0 Author: Lang Yu Date: Fri Jun 2 08:39:36 2023 +0800 drm/amdgpu: add support to power up/down UMSCH by SMU Power up/down UMSCH by SMU. Signed-off-by: Lang Yu Acked-by: Leo Liu Acked-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 56d3de7da67a363efdc885c083f88258fb9b20d3 Author: Lang Yu Date: Fri Jun 2 08:36:28 2023 +0800 drm/amdgpu: add power up/down UMSCH ppt callback Add ppt callback to power up/down UMSCH. v2: squash in updates (Alex) Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit d60fbf2d254acc9bc610713bed2bc9e47831fc15 Author: Lang Yu Date: Wed May 17 14:55:46 2023 +0800 drm/amdgpu: add support to powerup VPE by SMU Powerup VPE by SMU. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit ad3e54ab9e38f220b55a1a1299e21a9fd93f2948 Author: Li Ma Date: Fri Apr 28 14:08:14 2023 +0800 drm/amdgpu/discovery: add SMU 14 support add smu 14 into the IP discovery list. Signed-off-by: Li Ma Signed-off-by: Alex Deucher commit fe6cd9152464ed086fbeb45b6118ca386ee7aca2 Author: Kenneth Feng Date: Wed Apr 26 14:02:25 2023 +0800 drm/amd/swsmu: add smu14 ip support Add initial swSMU support for smu 14 series ASIC. v2: squash in build fixes and updates (Li Ma) fix warnings (Alex) v3: squash in updates (Alex) v4: squash in updates (Alex) v5: squash in avg/current power updates (Alex) Signed-off-by: Li Ma Signed-off-by: Kenneth Feng Signed-off-by: Likun Gao Signed-off-by: Alex Deucher commit cd6d69dd9be2b0e586accf82943e9f5b5c592c96 Author: Li Ma Date: Fri Apr 28 13:52:04 2023 +0800 drm/amd/swsmu: add smu v14_0_0 pmfw if file Add initial smu v14_0_0 pmfw if file v2: squash in updates (Alex) Signed-off-by: Li Ma Signed-off-by: Alex Deucher commit 7fc712f67ebe0ec3f431c39d63043e2d7b064489 Author: Li Ma Date: Fri Apr 28 13:22:06 2023 +0800 drm/amd/swsmu: add smu v14_0_0 ppsmc file Add initial smu v14_0_0 ppsmc file v2: squash in updates (Alex) v3: squash in updates (Alex) Signed-off-by: Li Ma Signed-off-by: Alex Deucher commit ee26087f91f027ba7c4905c3801c0368da5aea5f Author: Li Ma Date: Fri Apr 28 15:33:12 2023 +0800 drm/amdgpu/swsmu: add smu v14_0_0 driver if file Add initial smu v14_0_0 driver if file v2: squash in updates (Alex) v3: update interface (Alex) Signed-off-by: Li Ma Signed-off-by: Alex Deucher commit 4acf679f86c640e638eaee11255d4bb92b38b831 Author: Lang Yu Date: Sat Sep 30 14:39:26 2023 +0800 drm/amdgpu/umsch: power on/off UMSCH by DLDO VCN 4.0.5 uses DLDO. Signed-off-by: Lang Yu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 617b472431ad42d437fe3ad94efc0b61397252ec Author: Lang Yu Date: Sat Oct 7 12:43:13 2023 +0800 drm/amdgpu/umsch: fix psp frontdoor loading These changes are missed in rebase. Signed-off-by: Lang Yu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 558fcb7d1157a902c5ca880289e78d121fc3a484 Author: Lijo Lazar Date: Fri Oct 6 10:27:20 2023 +0530 drm/amdgpu: Increase IP discovery region size IP discovery region has increased to > 8K on some SOCs.Maximum reserve size is upto 12K, but not used. For now increase to 10K. Signed-off-by: Lijo Lazar Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 915414d09640bd2270b7e8f9fd3eaacc366c91b2 Author: Asad Kamal Date: Wed Sep 27 21:08:13 2023 +0800 drm/amd/pm: Use gpu_metrics_v1_4 for SMUv13.0.6 Use gpu_metrics_v1_4 for SMUv13.0.6 to fill gpu metric info v3: Removed filling gpu metric instantaneous pcie bw Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 011d99ee71d9aefc7ddd395d3337674c03ae2748 Author: Asad Kamal Date: Wed Sep 27 21:05:37 2023 +0800 drm/amd/pm: Add gpu_metrics_v1_4 Add new gpu_metrics_v1_4 to acquire XGMI data transfer, pcie bandwidth & Clock lock status v2: Add pcie error counter to gpu metric table v1_4 Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 79b049064afcd34b822ab4bda6be404fe5a09c6f Author: Asad Kamal Date: Wed Oct 4 14:04:57 2023 +0800 drm/amd/pm: Update metric table for smu v13_0_6 Update pmfw metric table to include xgmi transfer data and pci instantaneous bandwidth for smu v13_0_6 v2: Updated metric table version v3: Removed inst pcie bw with alignment to metrics table version 8 Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit b053117e86e58c57dface95ead11286e682ef477 Author: Lin.Cao Date: Sun Oct 8 17:36:40 2023 +0800 drm/amdgpu: Return -EINVAL when MMSCH init status incorrect Return -EINVAL when MMSCH init fail which can be handle by function amdgpu_device_reset_sriov correctly. Signed-off-by: Lin.Cao Reviewed-by: Jingwen Chen Signed-off-by: Alex Deucher commit de7f3c4ece914e191d2d80156b599731a3b655ff Author: Tim Huang Date: Mon Oct 9 16:23:27 2023 +0800 drm/amd/pm: wait for completion of the EnableGfxImu command Wait for completion of sending the EnableGfxImu message when using the PSP FW loading. Signed-off-by: Tim Huang Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 9a37f65c4e450c4fed5dd5afd6b9f1c8493a3abc Author: Lang Yu Date: Sat Oct 7 10:13:49 2023 +0800 drm/amdgpu/vpe: fix insert_nop ops Avoid infinite loop when count is 0. This is missed in rebase. Signed-off-by: Lang Yu Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 54967d5683b24767c58789af19cf7083e560aa56 Author: Srinivasan Shanmugam Date: Mon Oct 9 20:23:32 2023 +0530 drm/amdgpu: Address member 'gart_placement' not described in 'amdgpu_gmc_gart_location' Fixes the below: drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c:274: warning: Function parameter or member 'gart_placement' not described in 'amdgpu_gmc_gart_location' Cc: Christian König Cc: Alex Deucher Cc: "Pan, Xinhui" Signed-off-by: Srinivasan Shanmugam Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 84aa39ab1e6528278c8ffc2c1ff9de1e2c39ee8e Author: Lang Yu Date: Sat Oct 7 10:10:50 2023 +0800 drm/amdgpu/vpe: align with mcbp changes MCBP is decided by adev->gfx.mcbp now. This is missed in rebase. Signed-off-by: Lang Yu Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 99ea82f424cf719b7c56de52cc61aa6c38fc2770 Author: Lang Yu Date: Fri Oct 6 20:24:45 2023 +0800 drm/amdgpu/vpe: remove IB end boundary requirement Remove IB end boundary requirement, VPE has no such limitions, use existing amdgpu_ring_generic_pad_ib() instead. This is missed in rebase. Signed-off-by: Lang Yu Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 757920585d58fd83480866bdfc9c145cb083644b Author: Jay Cornwall Date: Wed Oct 4 10:53:26 2023 -0500 drm/amdgpu: Improve MES responsiveness during oversubscription When MES is oversubscribed it may not frequently check for new command submissions from driver if the scheduling load is high. Response latency as high as 5 seconds has been observed. Enable a flag which adds a check for new commands between scheduling quantums. Signed-off-by: Jay Cornwall Cc: Alexandru Tudor Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher commit e755d439c1b7f579dfb7a36e6c2d14d426e14b3a Author: Ian Ray Date: Thu Sep 21 13:47:51 2023 +0300 MAINTAINERS: Update entry for megachips-stdpxxxx-ge-b850v3-fw Replace Martin, who has left GE. Signed-off-by: Ian Ray Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230921104751.56544-2-ian.ray@ge.com commit e0eb7db49764306a969183e0ed16659b24be89c1 Author: Ian Ray Date: Thu Sep 21 13:47:50 2023 +0300 drm/bridge: megachips-stdpxxxx-ge-b850v3-fw: switch to drm_do_get_edid() Migrate away from custom EDID parsing and validity checks. Note: This is a follow-up to the original RFC by Jani [1]. The first submission in this series should have been marked v2. [1] https://patchwork.freedesktop.org/patch/msgid/20230901102400.552254-1-jani.nikula@intel.com Co-developed-by: Jani Nikula Signed-off-by: Jani Nikula Signed-off-by: Ian Ray Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230921104751.56544-1-ian.ray@ge.com commit b4e10c31905045214575b8d903d2c25ef5b6f996 Merge: c341ac65bf2bf 583d807320556 Author: Linus Walleij Date: Fri Oct 13 15:32:09 2023 +0200 Merge tag 'renesas-pinctrl-for-v6.7-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v6.7 (take two) - Add pin groups for the Local Bus State Controller (LBSC) on R-Car M1A, - Add support for the RZ/G3S (R9A08G045) SoC, - Miscellaneous fixes and improvements. Signed-off-by: Linus Walleij commit 34d8311f4a1c464ae0ce4470f2e3932c1a40d83e Author: Ville Syrjälä Date: Mon Oct 9 16:22:03 2023 +0300 drm/i915/dsb: Re-instate DSB for LUT updates With all the known issues sorted out we can start to use DSB to load the LUTs. Reviewed-by: Uma Shankar Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231009132204.15098-3-ville.syrjala@linux.intel.com commit 631b117ea8c3b7d4ec21ece69be6c465e79330fa Author: Ville Syrjälä Date: Mon Oct 9 16:22:02 2023 +0300 drm/i915/dsb: Correct DSB command buffer cache coherency settings The display engine does not snoop the caches so we should mark the DSB command buffer as I915_CACHE_NONE. i915_gem_object_create_internal() always gives us I915_CACHE_LLC on LLC platforms. And to make things 100% correct we should also clflush at the end, if necessary. Note that currently this is a non-issue as we always write the command buffer through a WC mapping, so a cache flush is not actually needed. But we might actually want to consider a WB mapping since we also end up reading from the command buffer (in the indexed reg write handling). Either that or we should do something else to avoid those reads (might actually be even more sensible on DGFX since we end up reading over PCIe). But we should measure the overhead first... Anyways, no real harm in adding the belts and suspenders here so that the code will work correctly regardless of how we map the buffer. If we do get a WC mapping (as we request) i915_gem_object_flush_map() will be a nop. Well, apart form a wmb() which may just flush the WC buffer a bit earlier than would otherwise happen (at the latest the mmio accesses would trigger the WC flush). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231009132204.15098-2-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit bcdcae63274047dea5acf27432bbceb8191d012e Author: Ville Syrjälä Date: Mon Oct 9 16:22:01 2023 +0300 drm/i915/dsb: Allocate command buffer from local memory Using system memory for the DSB command buffer doesn't appear to work. On DG2 it seems like the hardware internally replaces the actual memory reads with zeroes, and so we end up executing a bunch of NOOPs instead of whatever commands we put in the buffer. To determine that I measured the time it takes to execute the instructions, and the results are always more or less consistent with executing a buffer full of NOOPs from local memory. Another theory I considered was some kind of cache coherency issue. Looks like i915_gem_object_pin_map_unlocked() will in fact give you a WB mapping for system memory on DGFX regardless of what mapping mode was requested (WC in case of the DSB code). But clflush did not change the behaviour at all, so that theory seems moot. On DG1 it looks like the hardware might actually be fetching data from system memory as the logs indicate that we just get underruns. But that is equally bad, so doesn't look like we can really use system memory on DG1 either. Thus always allocate the DSB command buffer from local memory on discrete GPUs. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231009132204.15098-1-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit c0b80988eb78d6423249ab530bfbc6b238790a26 Author: Thierry Reding Date: Thu Oct 12 14:43:11 2023 +0200 arm64: tegra: Use correct interrupts for Tegra234 TKE The shared interrupts 0-9 of the TKE are mapped to interrupts 0-9, but shared interrupts 10-15 are mapped to 256-261. Correct the mapping for the final 6 interrupts. This prevents the TKE from requesting the RTC interrupt (along with several GTE and watchdog interrupts). Reported-by: Shubhi Garg Fixes: 28d860ed02c2 ("arm64: tegra: Enable native timers on Tegra234") Reviewed-by: Jon Hunter Signed-off-by: Thierry Reding commit 9152ed09309de1a876680e6309c8eccb509b44b0 Author: Jon Hunter Date: Fri Sep 29 11:36:50 2023 +0100 arm64: tegra: Add power-sensors for Tegra234 boards Populate the ina219 and ina3221 power-sensors for the various Tegra234 boards. These sensors are located on the Tegra234 module boards and the configuration of some sensors is common across the different Tegra234 modules. Therefore, add any common sensor configurations to appropriate device tree source file so it can be re-used across modules. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit f344675a34383ae26a8230f4b1cd99cbd0defebd Author: Thierry Reding Date: Mon Oct 9 15:35:57 2023 +0530 memory: tegra: Set BPMP msg flags to reset IPC channels Set the 'TEGRA_BPMP_MESSAGE_RESET' bit in newly added 'flags' field of 'struct tegra_bpmp_message' to request for the reset of BPMP IPC channels. This is used along with the 'suspended' check in BPMP driver for handling early bandwidth requests due to the hotplug of CPU's during system resume before the driver gets resumed. Fixes: f41e1442ac5b ("cpufreq: tegra194: add OPP support and set bandwidth") Co-developed-by: Sumit Gupta Signed-off-by: Sumit Gupta Acked-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 364b40c6dd2de76a60157f5054921f8d9b594b0f Merge: 0bb80ecc33a8f ea608a01d4ee6 Author: Thierry Reding Date: Fri Oct 13 14:22:29 2023 +0200 Merge branch 'for-6.7/firmware' into for-6.7/memory commit ea608a01d4ee66f8b51070e623f9adb8684c0dd4 Author: Sumit Gupta Date: Mon Oct 9 15:35:56 2023 +0530 firmware: tegra: Add suspend hook and reset BPMP IPC early on resume Add suspend hook and a 'suspended' field in the 'struct tegra_bpmp' to mark if BPMP is suspended. Also, add a 'flags' field in the 'struct tegra_bpmp_message' whose 'TEGRA_BPMP_MESSAGE_RESET' bit can be set from the Tegra MC driver to signal that the reset of BPMP IPC channels is required before sending MRQ to the BPMP FW. Together both the fields allow us to handle any requests that might be sent too soon as they can cause hang during system resume. One case where we see BPMP requests being sent before the BPMP driver has resumed is the memory bandwidth requests which are triggered by onlining the CPUs during system resume. The CPUs are onlined before the BPMP has resumed and we need to reset the BPMP IPC channels to handle these requests. The additional check for 'flags' is done to avoid any un-intended BPMP IPC reset if the tegra_bpmp_transfer*() API gets called during suspend sequence after the BPMP driver is suspended. Fixes: f41e1442ac5b ("cpufreq: tegra194: add OPP support and set bandwidth") Co-developed-by: Thierry Reding Signed-off-by: Sumit Gupta Acked-by: Thierry Reding Signed-off-by: Thierry Reding commit 8a77f38bcd28d3c22ab7dd8eff3f299d43c00411 Author: Frederic Weisbecker Date: Wed Oct 4 01:29:00 2023 +0200 srcu: Only accelerate on enqueue time Acceleration in SRCU happens on enqueue time for each new callback. This operation is expected not to fail and therefore any similar attempt from other places shouldn't find any remaining callbacks to accelerate. Moreover accelerations performed beyond enqueue time are error prone because rcu_seq_snap() then may return the snapshot for a new grace period that is not going to be started. Remove these dangerous and needless accelerations and introduce instead assertions reporting leaking unaccelerated callbacks beyond enqueue time. Co-developed-by: Yong He Signed-off-by: Yong He Co-developed-by: Joel Fernandes (Google) Signed-off-by: Joel Fernandes (Google) Co-developed-by: Neeraj upadhyay Signed-off-by: Neeraj upadhyay Reviewed-by: Like Xu Signed-off-by: Frederic Weisbecker commit cda263907a6f88c75fb97cf7adecffaafb6237ec Author: Ulf Hansson Date: Thu Oct 12 17:35:36 2023 +0200 soc/tegra: pmc: Drop the ->opp_to_performance_state() callback Since commit 7c41cdcd3bbe ("OPP: Simplify the over-designed pstate <-> level dance"), there is no longer any need for genpd providers to assign the ->opp_to_performance_state(), hence let's drop it. Cc: Thierry Reding Cc: Jonathan Hunter Cc: linux-tegra@vger.kernel.org Signed-off-by: Ulf Hansson Signed-off-by: Thierry Reding commit 1a09a27153f91cd7676b2d4ca574577572a8c999 Author: Brian Gerst Date: Wed Oct 11 18:43:51 2023 -0400 x86/entry/32: Clean up syscall fast exit tests Merge compat and native code and clarify comments. No change in functionality expected. Signed-off-by: Brian Gerst Signed-off-by: Ingo Molnar Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Josh Poimboeuf Cc: Uros Bizjak Link: https://lore.kernel.org/r/20231011224351.130935-4-brgerst@gmail.com commit 58978b44df7276f7c75a2c6aad6c201421cd4daa Author: Brian Gerst Date: Wed Oct 11 18:43:50 2023 -0400 x86/entry/64: Use TASK_SIZE_MAX for canonical RIP test Using shifts to determine if an address is canonical is difficult for the compiler to optimize when the virtual address width is variable (LA57 feature) without using inline assembly. Instead, compare RIP against TASK_SIZE_MAX. The only user executable address outside of that range is the deprecated vsyscall page, which can fall back to using IRET. Signed-off-by: Brian Gerst Signed-off-by: Ingo Molnar Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Josh Poimboeuf Cc: Uros Bizjak Link: https://lore.kernel.org/r/20231011224351.130935-3-brgerst@gmail.com commit ca282b486a570a0bfda5c1a4595ace7fa14243bf Author: Brian Gerst Date: Wed Oct 11 18:43:49 2023 -0400 x86/entry/64: Convert SYSRET validation tests to C No change in functionality expected. Signed-off-by: Brian Gerst Signed-off-by: Ingo Molnar Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Josh Poimboeuf Cc: Uros Bizjak Link: https://lore.kernel.org/r/20231011224351.130935-2-brgerst@gmail.com commit 6d3bc4c02d59996d1d3180d8ed409a9d7d5900e0 Author: Ronald Wahl Date: Sat Oct 7 18:17:13 2023 +0200 clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware On SAM9 hardware two cascaded 16 bit timers are used to form a 32 bit high resolution timer that is used as scheduler clock when the kernel has been configured that way (CONFIG_ATMEL_CLOCKSOURCE_TCB). The driver initially triggers a reset-to-zero of the two timers but this reset is only performed on the next rising clock. For the first timer this is ok - it will be in the next 60ns (16MHz clock). For the chained second timer this will only happen after the first timer overflows, i.e. after 2^16 clocks (~4ms with a 16MHz clock). So with other words the scheduler clock resets to 0 after the first 2^16 clock cycles. It looks like that the scheduler does not like this and behaves wrongly over its lifetime, e.g. some tasks are scheduled with a long delay. Why that is and if there are additional requirements for this behaviour has not been further analysed. There is a simple fix for resetting the second timer as well when the first timer is reset and this is to set the ATMEL_TC_ASWTRG_SET bit in the Channel Mode register (CMR) of the first timer. This will also rise the TIOA line (clock input of the second timer) when a software trigger respective SYNC is issued. Signed-off-by: Ronald Wahl Acked-by: Alexandre Belloni Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20231007161803.31342-1-rwahl@gmx.de commit 548650921e617c7909c7f3229067e58ad3cb8088 Merge: 37ed36448fcd7 c53cdc02915a3 Author: Will Deacon Date: Fri Oct 13 11:43:12 2023 +0100 Merge branch 'for-joerg/arm-smmu/bindings' into for-joerg/arm-smmu/updates Update to the Arm SMMU device-tree bindings. * for-joerg/arm-smmu/bindings: dt-bindings: arm-smmu: Add SM7150 GPU SMMUv2 commit 8405ec8e3c02df8b3720874c3e2169fef4553868 Author: Stephan Müller Date: Sat Oct 7 09:10:43 2023 +0200 crypto: jitter - reuse allocated entropy collector In case a health test error occurs during runtime, the power-up health tests are rerun to verify that the noise source is still good and that the reported health test error was an outlier. For performing this power-up health test, the already existing entropy collector instance is used instead of allocating a new one. This change has the following implications: * The noise that is collected as part of the newly run health tests is inserted into the entropy collector and thus stirs the existing data present in there further. Thus, the entropy collected during the health test is not wasted. This is also allowed by SP800-90B. * The power-on health test is not affected by the state of the entropy collector, because it resets the APT / RCT state. The remainder of the state is unrelated to the health test as it is only applied to newly obtained time stamps. This change also fixes a bug report about an allocation while in an atomic lock (the lock is taken in jent_kcapi_random, jent_read_entropy is called and this can call jent_entropy_init). Fixes: 04597c8dd6c4 ("jitter - add RCT/APT support for different OSRs") Reported-by: Dan Carpenter Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 30bf5bd05ecebb531689b87d5ba4fd02b991403b Author: Rob Herring Date: Fri Oct 6 16:43:40 2023 -0500 hwrng: n2 - Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Signed-off-by: Herbert Xu commit 4dc44aec28c8ecc6744d02c8d7d68bf0a8d59891 Author: Rob Herring Date: Fri Oct 6 16:39:17 2023 -0500 crypto: aspeed-hace - Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Andrew Jeffery Reviewed-by: Neal Liu Signed-off-by: Herbert Xu commit d807f0240c713bdd7c81a7e212f2feb0b5cd6725 Author: Lucas Segarra Fernandez Date: Wed Oct 4 12:36:42 2023 +0200 crypto: qat - add cnv_errors debugfs file The Compress and Verify (CnV) feature check and ensures data integrity in the compression operation. The implementation of CnV keeps a record of the CnV errors that have occurred since the driver was loaded. Expose CnV error stats by providing the "cnv_errors" file under debugfs. This includes the number of errors detected up to now and the type of the last error. The error count is provided on a per Acceleration Engine basis and it is reset every time the driver is loaded. Signed-off-by: Lucas Segarra Fernandez Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit e079231676e05d6c88fba4585db1ac399a790b63 Author: Lucas Segarra Fernandez Date: Wed Oct 4 12:09:20 2023 +0200 crypto: qat - add pm_status debugfs file QAT devices implement a mechanism that allows them to go autonomously to a low power state depending on the load. Expose power management info by providing the "pm_status" file under debugfs. This includes PM state, PM event log, PM event counters, PM HW CSRs, per-resource type constrain counters and per-domain power gating status specific to the QAT device. This information is retrieved from (1) the FW by means of ICP_QAT_FW_PM_INFO command, (2) CSRs and (3) counters collected by the device driver. In addition, add logic to keep track and report power management event interrupts and acks/nacks sent to FW to allow/prevent state transitions. Signed-off-by: Lucas Segarra Fernandez Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 756762decc604a5ac5c041f23dd447c5e691f459 Author: Lucas Segarra Fernandez Date: Wed Oct 4 12:09:19 2023 +0200 crypto: qat - refactor included headers Include kernel.h for GENMASK(), kstrtobool() and types. Add forward declaration for struct adf_accel_dev. Remove unneeded include. This change doesn't introduce any function change. Signed-off-by: Lucas Segarra Fernandez Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit f29cd5bb64c258f29b4c49452532481f50eb43ca Author: Om Prakash Singh Date: Tue Oct 3 09:10:21 2023 +0200 crypto: qcom-rng - Add hw_random interface support Add hw_random interface support in qcom-rng driver as new IP block in Qualcomm SoC has inbuilt NIST SP800 90B compliant entropic source to generate true random number. Keeping current rng_alg interface as well for random number generation using Kernel Crypto API. Signed-off-by: Om Prakash Singh Reviewed-by: Bjorn Andersson Signed-off-by: Neil Armstrong Acked-by: Om Prakash Singh Signed-off-by: Herbert Xu commit f4d571b31b83127c2263fdf46eebf86f4d9991a2 Author: Uwe Kleine-König Date: Mon Oct 2 10:05:29 2023 +0200 rtc: sh: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231002080529.2535610-13-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni commit e288cfe8f25f547a5359a72940e55b3e9a173bb1 Author: Uwe Kleine-König Date: Mon Oct 2 10:05:28 2023 +0200 rtc: pxa: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231002080529.2535610-12-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni commit ede66fb37f12737f96b2c1cbccae9c5ccf7be074 Author: Uwe Kleine-König Date: Mon Oct 2 10:05:27 2023 +0200 rtc: mv: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231002080529.2535610-11-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni commit 482ca730a4fc5fe766fb7d86c46c75b171d6efdf Author: Uwe Kleine-König Date: Mon Oct 2 10:05:26 2023 +0200 rtc: imxdi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231002080529.2535610-10-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni commit 48bc8830fbed98dff905fdbcaa424d59bb312043 Author: Uwe Kleine-König Date: Mon Oct 2 10:05:25 2023 +0200 rtc: at91rm9200: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231002080529.2535610-9-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni commit 94a2da3e6b681a970b248927bfb5d7d519bd3924 Author: Uwe Kleine-König Date: Mon Oct 2 10:05:24 2023 +0200 rtc: pcap: Drop no-op remove function A remove callback that just returns 0 is equivalent to no callback at all as can be seen in platform_remove(). So simplify accordingly. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231002080529.2535610-8-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni commit 141626dbc2e69150fbd5bf241eba85790d7e95ab Author: Uwe Kleine-König Date: Mon Oct 2 10:05:23 2023 +0200 rtc: sh: Mark driver struct with __refdata to prevent section mismatch warning As described in the added code comment, a reference to .exit.text is ok for drivers registered via module_platform_driver_probe(). Make this explicit to prevent a section mismatch warning. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231002080529.2535610-7-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni commit 47712bc29401240cce89e631e04ba83891c976ee Author: Uwe Kleine-König Date: Mon Oct 2 10:05:22 2023 +0200 rtc: pxa: Mark driver struct with __refdata to prevent section mismatch warning As described in the added code comment, a reference to .exit.text is ok for drivers registered via module_platform_driver_probe(). Make this explicit to prevent a section mismatch warning. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231002080529.2535610-6-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni commit 5621f28b0122861231057e3f452573a6e8d6a4c1 Author: Uwe Kleine-König Date: Mon Oct 2 10:05:21 2023 +0200 rtc: mv: Mark driver struct with __refdata to prevent section mismatch warning As described in the added code comment, a reference to .exit.text is ok for drivers registered via module_platform_driver_probe(). Make this explicit to prevent a section mismatch warning. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231002080529.2535610-5-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni commit e6d44306e4fb476835fa7b818f0440c707b12844 Author: Uwe Kleine-König Date: Mon Oct 2 10:05:20 2023 +0200 rtc: imxdi: Mark driver struct with __refdata to prevent section mismatch warning As described in the added code comment, a reference to .exit.text is ok for drivers registered via module_platform_driver_probe(). Make this explicit to prevent a section mismatch warning. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231002080529.2535610-4-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni commit 5dbde0727a515df85b1773a1f6dd301194c763f4 Author: Uwe Kleine-König Date: Mon Oct 2 10:05:19 2023 +0200 rtc: at91rm9200: Mark driver struct with __refdata to prevent section mismatch warning As described in the added code comment, a reference to .exit.text is ok for drivers registered via module_platform_driver_probe(). Make this explicit to prevent a section mismatch warning. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231002080529.2535610-3-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni commit 2e2ad6393b430b643e607d49190e0b2628d5f035 Author: Uwe Kleine-König Date: Mon Oct 2 10:05:18 2023 +0200 rtc: imxdi: Soften dependencies for improved compile coverage The driver compiles fine on x86_64, so soften the dependencies to ARCH_MXC || COMPILE_TEST. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231002080529.2535610-2-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni commit a4d7e9ec21a22c7e9c0270202ab317bad596fd52 Author: Neil Armstrong Date: Tue Oct 3 09:10:20 2023 +0200 dt-bindings: crypto: qcom,prng: document SM8550 Document SM8550 compatible for the True Random Number Generator. Reviewed-by: Om Prakash Singh Reviewed-by: Krzysztof Kozlowski Signed-off-by: Neil Armstrong Signed-off-by: Herbert Xu commit 63b299a18694b89d6c814e0d86230d09542bed4c Author: Neil Armstrong Date: Tue Oct 3 09:10:19 2023 +0200 dt-bindings: crypto: qcom,prng: document that RNG on SM8450 is a TRNG It has been reported at [1] the RNG HW on SM8450 is in fact a True Random Number Generator and no more Pseudo, document this by adding a new qcom,trng and the corresponding SoC specific sm8450 compatible. [1] https://lore.kernel.org/all/20230818161720.3644424-1-quic_omprsing@quicinc.com/ Suggested-by: Om Prakash Singh Suggested-by: Konrad Dybcio Reviewed-by: Om Prakash Singh Signed-off-by: Neil Armstrong Reviewed-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit 2c98594373c01739c2a2b3f056b8f2f850c26dc7 Author: Herbert Xu Date: Tue Oct 3 11:43:33 2023 +0800 crypto: skcipher - Remove obsolete skcipher_alg helpers As skcipher spawn users can no longer assume the spawn is of type struct skcipher_alg, these helpers are no longer used. Remove them. Signed-off-by: Herbert Xu commit bf028cfe8a505b5330be7df628ac19ffad48f932 Author: Herbert Xu Date: Tue Oct 3 11:43:32 2023 +0800 crypto: xts - Only access common skcipher fields on spawn As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu commit 1ec0a8aba573a6918e65dd99a3e19af1025d1408 Author: Herbert Xu Date: Tue Oct 3 11:43:31 2023 +0800 crypto: lrw - Only access common skcipher fields on spawn As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu commit c4c6bb6e7905993126b8d00c641fa9037a198a9a Author: Herbert Xu Date: Tue Oct 3 11:43:30 2023 +0800 crypto: hctr2 - Only access common skcipher fields on spawn As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu commit 712c22aa59672b7f5abdb81d8c585040e9e071f9 Author: Herbert Xu Date: Tue Oct 3 11:43:29 2023 +0800 crypto: gcm - Only access common skcipher fields on spawn As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu commit 7202e65b1eeeb54e0ec634c63d102b8cf670ea3b Author: Herbert Xu Date: Tue Oct 3 11:43:28 2023 +0800 crypto: cts - Only access common skcipher fields on spawn As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu commit 36b6fbefc06cbfe7b5f17c32445ecaf082c24449 Author: Herbert Xu Date: Tue Oct 3 11:43:27 2023 +0800 crypto: ctr - Only access common skcipher fields on spawn As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu commit c9e4b76ff4a706afc30a7c10c89cc075df487485 Author: Herbert Xu Date: Tue Oct 3 11:43:26 2023 +0800 crypto: chacha20poly1305 - Only access common skcipher fields on spawn As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu commit 60fa9a39aeddff38704faa82c7c44a29123887e3 Author: Herbert Xu Date: Tue Oct 3 11:43:25 2023 +0800 crypto: ccm - Only access common skcipher fields on spawn As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu commit 24a285cea82961824d9709025dea69dbc84e01a0 Author: Herbert Xu Date: Tue Oct 3 11:43:24 2023 +0800 crypto: authencesn - Only access common skcipher fields on spawn As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu commit cae3304330b52091e132544b307d59cc873649ad Author: Herbert Xu Date: Tue Oct 3 11:43:23 2023 +0800 crypto: authenc - Only access common skcipher fields on spawn As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu commit 3c45b5780400185de9e53e9432591c140ca59b4c Author: Herbert Xu Date: Tue Oct 3 11:43:22 2023 +0800 crypto: adiantum - Only access common skcipher fields on spawn As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu commit 7d6899a5ec66d702923ef1ab1433747e69087ba7 Author: Herbert Xu Date: Tue Oct 3 11:43:21 2023 +0800 crypto: cryptd - Only access common skcipher fields on spawn As skcipher spawns may be of the type lskcipher, only the common fields may be accessed. This was already the case but use the correct helpers to make this more obvious. Signed-off-by: Herbert Xu commit 4822ed7e8524cd59c39e5ad27ae944f528164a0f Author: Herbert Xu Date: Tue Oct 3 11:43:20 2023 +0800 crypto: essiv - Handle lskcipher spawns Add code to handle an underlying lskcihper object when grabbing an skcipher spawn. Fixes: 31865c4c4db2 ("crypto: skcipher - Add lskcipher") Signed-off-by: Herbert Xu commit ab6223dc3e1b0a842d663abbed400c43ebee07fc Author: Herbert Xu Date: Tue Oct 3 11:43:19 2023 +0800 crypto: skcipher - Add crypto_spawn_skcipher_alg_common As skcipher spawns can be of two different types (skcipher vs. lskcipher), only the common fields can be accessed. Add a helper to return the common algorithm object. Signed-off-by: Herbert Xu commit 9a91792db10126fa291e22680d6cf5683d845a15 Author: Herbert Xu Date: Tue Oct 3 11:43:18 2023 +0800 crypto: arc4 - Convert from skcipher to lskcipher Replace skcipher implementation with lskcipher. Signed-off-by: Herbert Xu commit 845346841b77af84c88f1b709c63c14a58a64dc4 Author: Herbert Xu Date: Tue Oct 3 11:31:55 2023 +0800 crypto: skcipher - Add dependency on ecb As lskcipher requires the ecb wrapper for the transition add an explicit dependency on it so that it is always present. This can be removed once all simple ciphers have been converted to lskcipher. Reported-by: Nathan Chancellor Fixes: 705b52fef3c7 ("crypto: cbc - Convert from skcipher to lskcipher") Signed-off-by: Herbert Xu Tested-by: Nathan Chancellor Signed-off-by: Herbert Xu commit 4999999ed7e099fcc2476c8b3a245c4c2c9026c0 Author: Giovanni Cabiddu Date: Mon Oct 2 09:51:09 2023 +0100 crypto: qat - add namespace to driver Create CRYPTO_QAT namespace for symbols exported by the qat_common module and import those in the QAT drivers. It will reduce the global namespace crowdedness and potential misuse or the API. This does not introduce any functional change. Suggested-by: Andy Shevchenko Signed-off-by: Giovanni Cabiddu Reviewed-by: Lucas Segarra Fernandez Reviewed-by: Andy Shevchenko Signed-off-by: Herbert Xu commit 92fe9bb77b0c9fade150350fdb0629a662f0923f Author: Ingo Molnar Date: Fri Oct 13 12:14:27 2023 +0200 x86/apic, x86/hyperv: Use u32 in hv_snp_boot_ap() too The data type for APIC IDs was standardized to 'u32' in the following recent commit: db4a4086a223 ("x86/apic: Use u32 for wakeup_secondary_cpu[_64]()") Which changed the function arguments type signature of the apic->wakeup_secondary_cpu() APIC driver function. Propagate this to hv_snp_boot_ap() as well, which also addresses a 'assignment from incompatible pointer type' build warning that triggers under the -Werror=incompatible-pointer-types GCC warning. Fixes: db4a4086a223 ("x86/apic: Use u32 for wakeup_secondary_cpu[_64]()") Signed-off-by: Ingo Molnar Acked-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230814085113.233274223@linutronix.de commit 35715ac13a7781c8e7a28436477e9f359d9fda91 Merge: 895359b8c1e74 9f0c8245516bc Author: David S. Miller Date: Fri Oct 13 11:26:11 2023 +0100 Merge branch 'tls-cleanups' Sabrina Dubroca says: ==================== net: tls: various code cleanups and improvements This series contains multiple cleanups and simplifications for the config code of both TLS_SW and TLS_HW. It also modifies the chcr_ktls driver to use driver_state like all other drivers, so that we can then make driver_state fixed size instead of a flex array always allocated to that same fixed size. As reported by Gustavo A. R. Silva, the way chcr_ktls misuses driver_state irritates GCC [1]. Patches 1 and 2 are follow-ups to my previous cipher_desc series. [1] https://lore.kernel.org/netdev/ZRvzdlvlbX4+eIln@work/ ==================== Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 9f0c8245516bc30cff770c3a69a6baaf8eef8810 Author: Sabrina Dubroca Date: Mon Oct 9 22:50:54 2023 +0200 tls: use fixed size for tls_offload_context_{tx,rx}.driver_state driver_state is a flex array, but is always allocated by the tls core to a fixed size (TLS_DRIVER_STATE_SIZE_{TX,RX}). Simplify the code by making that size explicit so that sizeof(struct tls_offload_context_{tx,rx}) works. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 0700aa3a7503a552d9d2df525711e4700982ee31 Author: Sabrina Dubroca Date: Mon Oct 9 22:50:53 2023 +0200 chcr_ktls: use tls_offload_context_tx and driver_state like other drivers chcr_ktls uses the space reserved in driver_state by tls_set_device_offload, but makes up into own wrapper around tls_offload_context_tx instead of accessing driver_state via the __tls_driver_ctx helper. In this driver, driver_state is only used to store a pointer to a larger context struct allocated by the driver. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 1cf7fbcee60af932f815af5fc0ca5e7e8544ef82 Author: Sabrina Dubroca Date: Mon Oct 9 22:50:52 2023 +0200 tls: validate crypto_info in a separate helper Simplify do_tls_setsockopt_conf a bit. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 4f4866991847738a216bb5920b3d3902cee13fd0 Author: Sabrina Dubroca Date: Mon Oct 9 22:50:51 2023 +0200 tls: remove tls_context argument from tls_set_device_offload It's not really needed since we end up refetching it as tls_ctx. We can also remove the NULL check, since we have already dereferenced ctx in do_tls_setsockopt_conf. While at it, fix up the reverse xmas tree ordering. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit b6a30ec9239a1fa1a622608176bb78646a539608 Author: Sabrina Dubroca Date: Mon Oct 9 22:50:50 2023 +0200 tls: remove tls_context argument from tls_set_sw_offload It's not really needed since we end up refetching it as tls_ctx. We can also remove the NULL check, since we have already dereferenced ctx in do_tls_setsockopt_conf. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 0137407999879f992b9b9a7d0949168d3d010130 Author: Sabrina Dubroca Date: Mon Oct 9 22:50:49 2023 +0200 tls: add a helper to allocate/initialize offload_ctx_tx Simplify tls_set_device_offload a bit. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 1a074f7618e8b82a7cebf45df6e005d2284446ce Author: Sabrina Dubroca Date: Mon Oct 9 22:50:48 2023 +0200 tls: also use init_prot_info in tls_set_device_offload Most values are shared. Nonce size turns out to be equal to IV size for all offloadable ciphers. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit a9937816edde95575fb777703b82f85b1d6cd5b1 Author: Sabrina Dubroca Date: Mon Oct 9 22:50:47 2023 +0200 tls: move tls_prot_info initialization out of tls_set_sw_offload Simplify tls_set_sw_offload, and allow reuse for the tls_device code. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 615580cbc99af0da2d1c7226fab43a3d5003eb97 Author: Sabrina Dubroca Date: Mon Oct 9 22:50:46 2023 +0200 tls: extract context alloc/initialization out of tls_set_sw_offload Simplify tls_set_sw_offload a bit. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 1c1cb3110d7ed2897e65d9a352a8fb709723e057 Author: Sabrina Dubroca Date: Mon Oct 9 22:50:45 2023 +0200 tls: store iv directly within cipher_context TLS_MAX_IV_SIZE + TLS_MAX_SALT_SIZE is 20B, we don't get much benefit in cipher_context's size and can simplify the init code a bit. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit bee6b7b30706e7693d91cb28c8ff3cb69e094f65 Author: Sabrina Dubroca Date: Mon Oct 9 22:50:44 2023 +0200 tls: rename MAX_IV_SIZE to TLS_MAX_IV_SIZE It's defined in include/net/tls.h, avoid using an overly generic name. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 6d5029e54700b2427581513c533232b02ce05043 Author: Sabrina Dubroca Date: Mon Oct 9 22:50:43 2023 +0200 tls: store rec_seq directly within cipher_context TLS_MAX_REC_SEQ_SIZE is 8B, we don't get anything by using kmalloc. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 8f1d532b4a49e196696b0aa150962d7ce96985e4 Author: Sabrina Dubroca Date: Mon Oct 9 22:50:42 2023 +0200 tls: drop unnecessary cipher_type checks in tls offload We should never reach tls_device_reencrypt, tls_enc_record, or tls_enc_skb with a cipher_type that can't be offloaded. Replace those checks with a DEBUG_NET_WARN_ON_ONCE, and use cipher_desc instead of hard-coding offloadable cipher types. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit 3bab3ee0f95ebd2a897ac3205b4fdee50c3b5f96 Author: Sabrina Dubroca Date: Mon Oct 9 22:50:41 2023 +0200 tls: get salt using crypto_info_salt in tls_enc_skb I skipped this conversion in my previous series. Signed-off-by: Sabrina Dubroca Signed-off-by: David S. Miller commit f881feb180fd0563809b62faa3f7da234e81d42b Author: Lad Prabhakar Date: Wed Oct 11 20:53:24 2023 +0100 irqchip/renesas-rzg2l: Enhance driver to support interrupt affinity setting Add support to set the affinity of the IRQC interrupt by implementing the irq_set_affinity callback via the parent interrupt chip. Signed-off-by: Lad Prabhakar Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20231011195324.66807-1-prabhakar.mahadev-lad.rj@bp.renesas.com commit 021a8ca2ba23c01487a98ad23b68ac062e14cf32 Author: Keguang Zhang Date: Mon Sep 25 20:17:34 2023 +0800 genirq/generic-chip: Fix the irq_chip name for /proc/interrupts irq_init_generic_chip() only sets the name for the first chip type, which leads to empty names for other chip types. Eventually, these names will be shown as "-" /proc/interrupts. Set the name for all chip types by default. Signed-off-by: Keguang Zhang Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230925121734.93017-1-keguang.zhang@gmail.com commit 03c866cab420e2e3381ca817be664e714107e39b Author: Duje Mihanović Date: Wed Oct 4 16:34:43 2023 +0200 dt-bindings: phy: Convert PXA1928 USB/HSIC PHY to DT schema Convert the binding for the Marvell PXA1928 USB and HSIC PHYs from TXT to DT schema. Signed-off-by: Duje Mihanović Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231004-pxa1928-usb-yaml-v3-1-150c9ef3ab9d@skole.hr Signed-off-by: Vinod Koul commit 895359b8c1e74e4b9190f9ac56b280cfd1edeea5 Author: Johannes Zink Date: Tue Oct 10 19:24:15 2023 +0200 net: stmmac: fix typo in comment This is just a trivial fix for a typo in a comment, no functional changes. Signed-off-by: Johannes Zink Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit dd69a6379a07f21ab1c41360925ef29ebe992a62 Author: Rob Herring Date: Mon Oct 9 12:29:11 2023 -0500 phy: Drop unnecessary of_match_device() calls If probe is reached, we've already matched the device and in the case of DT matching, the struct device_node pointer will be set. Therefore, there is no need to call of_match_device() in probe. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231009172923.2457844-16-robh@kernel.org Signed-off-by: Vinod Koul commit 8b6fba3e79eb67411d2a0a70955e41abc7007210 Author: Rob Herring Date: Mon Oct 9 12:29:12 2023 -0500 phy: rockchip-inno-usb2: Drop unnecessary DT includes Neither of_address.h or of_platform.h are used in the driver, so drop them. Signed-off-by: Rob Herring Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20231009172923.2457844-17-robh@kernel.org Signed-off-by: Vinod Koul commit 21bf6fc47a1e45031ba8a7084343b7cfd09ed1d3 Author: Rob Herring Date: Mon Oct 9 12:29:10 2023 -0500 phy: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20231009172923.2457844-15-robh@kernel.org Signed-off-by: Vinod Koul commit 7e909370a5cd44b4c16df500fb40762f48aae966 Author: Rob Herring Date: Tue Oct 10 15:57:00 2023 -0500 phy: realtek: Replace of_device.h with explicit includes The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other and pull in various other headers. In preparation to fix this, adjust the includes for what is actually needed. of_device.h isn't needed, but platform_device.h was implicitly included by it. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231010205701.1585026-1-robh@kernel.org Signed-off-by: Vinod Koul commit 1a5361189b7acac15b9b086b2300a11b7aa84c06 Author: Yoshihiro Shimoda Date: Wed Oct 11 17:18:17 2023 +0900 phy: renesas: r8a779f0-ether-serdes: Add .exit() ops Add r8a779f0_eth_serdes_exit() to clear the initialized flag for re-initializing this PHY if needed. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20231011081817.257113-3-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Vinod Koul commit aa4c0bbf820ddb9dd8105a403aa12df57b9e5129 Author: Yoshihiro Shimoda Date: Wed Oct 11 17:18:16 2023 +0900 phy: renesas: r8a779f0-ether-serdes: Reset in .init() Reset this PHY in .init() instead of probe() for re-initializing this PHY after probed correctly. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20231011081817.257113-2-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Vinod Koul commit b5ec2824d74e71f16a0243446933542584acd440 Author: Dmitry Baryshkov Date: Thu Sep 28 13:54:45 2023 +0300 phy: qcom-qmp-combo: use v6 registers in v6 regs layout Make sure that we use only v6 registers in qmp_v6_usb3phy_regs_layout. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230928105445.1210861-4-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit 5077b136fd594d0c9e7df0a749bda75ba6114e3c Author: Dmitry Baryshkov Date: Thu Sep 28 13:54:44 2023 +0300 phy: qcom-qmp-usb: move PCS v6 register to the proper header The commit 39bbf82d8c2b ("phy: qcom-qmp: pcs-usb: Add v6 register offsets") incorrectly added plain PCS registers to the PCS_USB header. Move them to a proper location. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230928105445.1210861-3-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit 579483ecd81987fc30a8b13650323a17cb1c14e3 Author: Dmitry Baryshkov Date: Thu Sep 28 13:54:43 2023 +0300 phy: qcom-qmp-combo: fix the prefix for the PCS_USB v6 registers For all other generations, we have been using just the QPHY prefix for the PCS registers. Remove the _USB part of the QPHY_USB prefix. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230928105445.1210861-2-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit 9e34abc7abfac781df909891c8d53781f607105d Author: Christophe JAILLET Date: Sun Sep 3 12:11:06 2023 +0200 phy: sun4i-usb: update array size With gcc 12.3.0, when this file is built, we get errors such as: drivers/phy/allwinner/phy-sun4i-usb.c: In function ‘sun4i_usb_phy_probe’: drivers/phy/allwinner/phy-sun4i-usb.c:790:52: error: ‘_vbus’ directive output may be truncated writing 5 bytes into a region of size between 2 and 12 [-Werror=format-truncation=] 790 | snprintf(name, sizeof(name), "usb%d_vbus", i); | ^~~~~ drivers/phy/allwinner/phy-sun4i-usb.c:790:17: note: ‘snprintf’ output between 10 and 20 bytes into a destination of size 16 790 | snprintf(name, sizeof(name), "usb%d_vbus", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Because of the possible value of 'i', this can't be an issue in real world application, but in order to have "make W=1" work correctly, give more space for 'name'. Signed-off-by: Christophe JAILLET Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/0bc81612171baaa6d5dff58c8e009debc03e1ba8.1693735840.git.christophe.jaillet@wanadoo.fr [vkoul: updated patch title] Signed-off-by: Vinod Koul commit 9bcf8761190fe87808bcd2aef96c8378088731fc Merge: 56156a76e765d 089667aaaa6aa Author: Vinod Koul Date: Fri Oct 13 15:29:08 2023 +0530 Merge branch 'fixes' into next Merge fixes into next as qmp phy patches on list depend on it commit 6151ff9c75210c0f9d3d9ddcd3de6325de12c2a0 Author: Jiri Pirko Date: Tue Oct 10 16:44:00 2023 +0200 selftests: netdevsim: use suitable existing dummy file for flash test The file name used in flash test was "dummy" because at the time test was written, drivers were responsible for file request and as netdevsim didn't do that, name was unused. However, the file load request is now done in devlink code and therefore the file has to exist. Use first random file from /lib/firmware for this purpose. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 94e27fbeca27d8c772fc2bc807730aaee5886055 Author: Marek Szyprowski Date: Thu Oct 12 12:35:25 2023 +0200 media: cec: meson: always include meson sub-directory in Makefile 'meson' directory contains two separate drivers, so it should be added to Makefile compilation hierarchy unconditionally, because otherwise the meson-ao-cec-g12a won't be compiled if meson-ao-cec is not selected. Signed-off-by: Marek Szyprowski Fixes: 4be5e8648b0c ("media: move CEC platform drivers to a separate directory") Signed-off-by: Hans Verkuil commit 554df753a684ffef5be83aa8cbb35adaf6240bf3 Author: Ma Ke Date: Thu Oct 12 15:45:19 2023 +0800 media: videobuf2: Fix IS_ERR checking in vb2_dc_put_userptr() In order to avoid error pointers from frame_vector_pages(), we could use IS_ERR() to check the return value to fix this. This checking operation could make sure that vector contains pages. Signed-off-by: Ma Ke Acked-by: Tomasz Figa Signed-off-by: Hans Verkuil commit 2a76e7679b594ea3e1b3b7fb6c3d67158114020d Author: Moudy Ho Date: Wed Oct 11 11:00:37 2023 +0800 media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config() Fix the build warnings that were detected by the linux-media build scripts tool: drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c: In function 'mdp_path_config.isra': drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c: warning: 'ctx' may be used uninitialized [-Wmaybe-uninitialized] | out = CFG_COMP(MT8195, ctx->param, outputs[0]); | ~~~^~~~~~~ drivers/media/platform/mediatek/mdp3/mtk-img-ipi.h: note: in definition of macro 'CFG_COMP' | (IS_ERR_OR_NULL(comp) ? 0 : _CFG_COMP(plat, comp, mem)) | ^~~~ drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c: note: 'ctx' was declared here | struct mdp_comp_ctx *ctx; | Fixes: 61890ccaefaf ("media: platform: mtk-mdp3: add MediaTek MDP3 driver") Signed-off-by: Moudy Ho Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil commit 56c0ac05a31a0bf525fddc300ea997356ad8146f Author: Yunfei Dong Date: Tue Oct 10 20:20:10 2023 +0800 media: mediatek: vcodec: using encoder device to alloc/free encoder memory Need to use encoder device to allocate/free encoder memory when calling mtk_vcodec_mem_alloc/mtk_vcodec_mem_free, or leading to below crash log when test encoder with decoder device. pc : dma_alloc_attrs+0x44/0xf4 lr : mtk_vcodec_mem_alloc+0x50/0xa4 [mtk_vcodec_common] sp : ffffffc0209f3990 x29: ffffffc0209f39a0 x28: ffffff8024102a18 x27: 0000000000000000 x26: 0000000000000000 x25: ffffffc00c06e2d8 x24: 0000000000000001 x23: 0000000000000cc0 x22: 0000000000000010 x21: 0000000000000800 x20: ffffff8024102a18 x19: 0000000000000000 x18: 0000000000000000 x17: 0000000000000009 x16: ffffffe389736a98 x15: 0000000000000078 x14: ffffffe389704434 x13: 0000000000000007 x12: ffffffe38a2b2560 x11: 0000000000000800 x10: 0000000000000004 x9 : ffffffe331f07484 x8 : 5400e9aef2395000 x7 : 0000000000000000 x6 : 000000000000003f x5 : 0000000000000001 x4 : 0000000000000000 x3 : 0000000000000cc0 x2 : ffffff8024102a18 x1 : 0000000000000800 x0 : 0000000000000010 Call trace: dma_alloc_attrs+0x44/0xf4 mtk_vcodec_mem_alloc+0x50/0xa4 [mtk_vcodec_common 2819d3d601f3cd06c1f2213ac1b9995134441421] h264_enc_set_param+0x27c/0x378 [mtk_vcodec_enc 772cc3d26c254e8cf54079451ef8d930d2eb4404] venc_if_set_param+0x4c/0x7c [mtk_vcodec_enc 772cc3d26c254e8cf54079451ef8d930d2eb4404] vb2ops_venc_start_streaming+0x1bc/0x328 [mtk_vcodec_enc 772cc3d26c254e8cf54079451ef8d930d2eb4404] vb2_start_streaming+0x64/0x12c vb2_core_streamon+0x114/0x158 vb2_streamon+0x38/0x60 v4l2_m2m_streamon+0x48/0x88 v4l2_m2m_ioctl_streamon+0x20/0x2c v4l_streamon+0x2c/0x38 __video_do_ioctl+0x2c4/0x3dc video_usercopy+0x404/0x934 video_ioctl2+0x20/0x2c v4l2_ioctl+0x54/0x64 v4l2_compat_ioctl32+0x90/0xa34 __arm64_compat_sys_ioctl+0x128/0x13c invoke_syscall+0x4c/0x108 el0_svc_common+0x98/0x104 do_el0_svc_compat+0x28/0x34 el0_svc_compat+0x2c/0x74 el0t_32_sync_handler+0xa8/0xcc el0t_32_sync+0x194/0x198 Code: aa0003f6 aa0203f4 aa0103f5 f900 'Fixes: 01abf5fbb081c ("media: mediatek: vcodec: separate struct 'mtk_vcodec_ctx'")' Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil commit b833b178498dafa2156cfb6f4d3ce4581c21f1e5 Author: Ming Qian Date: Mon Oct 9 14:16:57 2023 +0800 media: imx-jpeg: notify source chagne event when the first picture parsed After gstreamer rework the dynamic resolution change handling, gstreamer stop doing capture buffer allocation based on guesses and wait for the source change event when available. It requires driver always notify source change event in the initialization, even if the size parsed is equal to the size set on capture queue. otherwise, the pipeline will be stalled. Currently driver may not notify source change event if the parsed format and size are equal to those previously established, but it may stall the gstreamer pipeline. The link of gstreamer patch is https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437 Fixes: b4e1fb8643da ("media: imx-jpeg: Support dynamic resolution change") Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil commit 63c5f1d8a8e571b2878405fa4b8e811cd0bb7f1a Author: Jinjie Ruan Date: Sat Oct 7 20:14:47 2023 +0800 media: cx231xx: Use EP5_BUF_SIZE macro As Andrzej suggested, use EP5_BUF_SIZE macro to replace the other three places of 4096 in cx231xx with EP5_BUF_SIZE. Signed-off-by: Jinjie Ruan Suggested-by: Andrzej Pietrasiewicz Signed-off-by: Hans Verkuil commit 8cd08e365153481065eeec684ed00949bc980aff Author: Jinjie Ruan Date: Sat Oct 7 19:38:32 2023 +0800 media: siano: Drop unnecessary error check for debugfs_create_dir/file() Both debugfs_create_dir() and debugfs_create_file() return ERR_PTR and never return NULL. As Hans suggested, this patch removes the error checking for both debugfs_create_dir() and debugfs_create_file() in smsdvb_debugfs_create(). This is because the DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes. The debugfs APIs have a IS_ERR() judge in start_creating() which can handle it gracefully. So these checks are unnecessary. And as Hans pointed out, it's much better to first allocate debug_data before calling debugfs_create_dir, which need not to clean anything up in that case. Fixes: 503efe5cfc9f ("[media] siano: split debugfs code into a separate file") Signed-off-by: Jinjie Ruan Suggested-by: Hans Verkuil Signed-off-by: Hans Verkuil commit 19e2e01f30b5d2b448b5db097130486ea95af36f Author: Irui Wang Date: Sat Oct 7 19:33:47 2023 +0800 media: mediatek: vcodec: Handle invalid encoder vsi Handle invalid encoder vsi in vpu_enc_init to ensure the encoder vsi is valid for future use. Fixes: 1972e32431ed ("media: mediatek: vcodec: Fix possible invalid memory access for encoder") Signed-off-by: Irui Wang Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil commit 32ec99f872aba071a070f61fcab2f3a068b50652 Author: Jinjie Ruan Date: Sat Oct 7 16:43:39 2023 +0800 media: aspeed: Drop unnecessary error check for debugfs_create_file() debugfs_create_file() return ERR_PTR and never return NULL. When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Fixes: 52fed10ad756 ("media: aspeed: add debugfs") Signed-off-by: Jinjie Ruan Suggested-by: Hans Verkuil Reviewed-by: Eddie James Signed-off-by: Hans Verkuil commit faaed02abfa941f33a87dc6eacbd015af9ab3cfa Author: Hans Verkuil Date: Fri Oct 6 15:58:48 2023 +0200 Documentation: media: buffer.rst: fix V4L2_BUF_FLAG_PREPARED The list of ioctls that set or clear this flag was garbled in the generator output. Put in the proper text. Signed-off-by: Hans Verkuil commit 73e0538b4973df256962fda3aa0d89e6d0f79cd9 Author: Hans Verkuil Date: Fri Oct 6 15:45:48 2023 +0200 Documentation: media: gen-errors.rst: fix confusing ENOTTY description The text is very, very old and predates /dev/mediaX devices, so the reference to "media device" is today very confusing. It also says that the ioctl is not supported by the driver, but a driver may have multiple device nodes, some support a given ioctl, and some don't. Simplify the description: ENOTTY means that the ioctl is not supported by the file descriptor. Reported-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil commit 900c06e9732859ff1be26dbb913b3c158ed15eb4 Author: Benjamin Gaignard Date: Thu Oct 5 18:11:07 2023 +0200 dt-bindings: media: rockchip: Add resets property into decoder node RK3588 AV1 decoder hardware block have resets lines and driver code already support it. Update yaml file to be aligned with this feature. Signed-off-by: Benjamin Gaignard Acked-by: Krzysztof Kozlowski Signed-off-by: Hans Verkuil commit 39377f84fb98561b86b645f0b7c33512eba7afaf Author: Benjamin Gaignard Date: Thu Oct 5 16:51:16 2023 +0200 media: verisilicon: Fixes clock list for rk3588 av1 decoder Mainlined RK3588 clock driver manage by itself the dependency between aclk/hclk and their root clocks (aclk_vdpu_root/hclk_vdpu_root). RK3588 av1 video decoder do not have to take care of it anymore so remove them from the list and be compliant with yaml bindings description. Fixes: 003afda97c65 ("media: verisilicon: Enable AV1 decoder on rk3588") Signed-off-by: Benjamin Gaignard Signed-off-by: Hans Verkuil commit feec1b29d7a81be3c1a0a0865eed67d05d4089c9 Author: Ma Ke Date: Tue Oct 3 17:13:15 2023 +0800 media: videobuf2: Fix IS_ERR checking in vb2_vmalloc_put_userptr() In order to avoid error pointers from frame_vector_pages(), we could use IS_ERR() to check the return value to fix this. This checking operation could make sure that vector contains pages. Signed-off-by: Ma Ke Acked-by: Tomasz Figa Signed-off-by: Hans Verkuil [hverkuil: add space between ){] Signed-off-by: Hans Verkuil commit be521bf7bfad4e4bd4c3e1d2853aeb563a1e51d6 Author: Hans Verkuil Date: Fri Oct 13 09:43:55 2023 +0200 media: pci: cx18: if cx == NULL, then don't use it. If the cx NULL pointer check is true, then it reports an error with CX18_ERR, but that uses cx. Replace it with pr_err. Reported by smatch: drivers/media/pci/cx18/cx18-mailbox.c:834 cx18_vapi() error: we previously assumed 'cx' could be null (see line 833) Signed-off-by: Hans Verkuil commit 65b8c8cb2bf5f5676b5f0628a455c2982aa09683 Author: Hans Verkuil Date: Fri Oct 6 12:08:50 2023 +0200 media: pci: mgb4: fix potential spectre vulnerability Fix smatch warnings: drivers/media/pci/mgb4/mgb4_sysfs_out.c:118 video_source_store() warn: potential spectre issue 'mgbdev->vin' [r] (local cap) drivers/media/pci/mgb4/mgb4_sysfs_out.c:122 video_source_store() warn: possible spectre second half. 'loopin_new' Signed-off-by: Hans Verkuil Reviewed-by: Martin Tůma Signed-off-by: Hans Verkuil commit ada092e80c1031208df7366c7d3798d1e7d1904a Author: Hans Verkuil Date: Fri Oct 6 12:08:46 2023 +0200 media: nxp: imx-jpeg: use goto instead of return For consistency use goto instead of return. This fixes a smatch warning: drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c:2792 mxc_jpeg_probe() warn: missing unwind goto? Signed-off-by: Hans Verkuil commit f31b2cb85f0ee165d78e1c43f6d69f82cc3b2145 Author: Hans Verkuil Date: Fri Oct 6 12:08:45 2023 +0200 media: dvb-usb-v2: af9035: fix missing unlock Instead of returning an error, goto the mutex unlock at the end of the function. Fixes smatch warning: drivers/media/usb/dvb-usb-v2/af9035.c:467 af9035_i2c_master_xfer() warn: inconsistent returns '&d->i2c_mutex'. Locked on : 326,387 Unlocked on: 465,467 Signed-off-by: Hans Verkuil Fixes: 7bf744f2de0a ("media: dvb-usb-v2: af9035: Fix null-ptr-deref in af9035_i2c_master_xfer") Signed-off-by: Hans Verkuil commit 0b38d2ec2282f39ecb82b6cdc9af42f817e77551 Author: Luca Fancellu Date: Tue Oct 10 15:26:30 2023 +0100 xen-netback: add software timestamp capabilities Add software timestamp capabilities to the xen-netback driver by advertising it on the struct ethtool_ops and calling skb_tx_timestamp before passing the buffer to the queue. Signed-off-by: Luca Fancellu Signed-off-by: David S. Miller commit 431acee069232e8d713d0b9d7e02127ecbecddd6 Author: Justin Stitt Date: Mon Oct 9 23:19:57 2023 +0000 ibmvnic: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. NUL-padding is not required as the buffer is already memset to 0: | memset(adapter->fw_version, 0, 32); Note that another usage of strscpy exists on the same buffer: | strscpy((char *)adapter->fw_version, "N/A", sizeof(adapter->fw_version)); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: David S. Miller commit 659ce55fddd2555a75f6ec39fa26c2d10e854263 Author: Justin Stitt Date: Mon Oct 9 23:05:41 2023 +0000 net: fec: replace deprecated strncpy with ethtool_sprintf `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of this more robust and easier to understand interface. Also, while we're here, let's change memcpy() over to ethtool_sprintf() for consistency. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit a243ecc323b99f1042262319c1d77f1c52f0e307 Author: Rob Herring Date: Mon Oct 9 12:29:04 2023 -0500 net: mdio: xgene: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() and acpi_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Signed-off-by: David S. Miller commit 2dd3071892202ccaec3c59afc65c5b88357e73c9 Author: Gustavo A. R. Silva Date: Mon Oct 9 15:46:18 2023 -0600 net: wwan: t7xx: Add __counted_by for struct t7xx_fsm_event and use struct_size() Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). While there, use struct_size() helper, instead of the open-coded version, to calculate the size for the allocation of the whole flexible structure, including of course, the flexible-array member. This code was found with the help of Coccinelle, and audited and fixed manually. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: David S. Miller commit 13266ad9e52e2e51b0f068b0251a1d5c2badae5c Author: Rob Herring Date: Mon Oct 9 12:29:00 2023 -0500 net: ethernet: wiznet: Use spi_get_device_match_data() Use preferred spi_get_device_match_data() instead of of_match_device() and spi_get_device_id() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Signed-off-by: David S. Miller commit b0377116decdeecb8c6a928d59cd4bea00a4af6e Author: Rob Herring Date: Mon Oct 9 12:28:58 2023 -0500 net: ethernet: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Signed-off-by: David S. Miller commit a2cd15c2411624a7a97bad60d98d7e0a1e5002a6 Author: Mika Kahola Date: Tue Oct 10 12:52:33 2023 +0300 drm/i915/lnl: Remove watchdog timers for PSR Watchdog timers for Lunarlake HW were removed for PSR/PSR2 The patch removes the use of these timers from the driver code. BSpec: 69895 v2: Reword commit message (Ville) Drop HPD mask from LNL (Ville) Revise masking logic (Jouni) v3: Revise commit message (Ville) Revert HPD mask removal as irrelevant for this patch (Ville) Signed-off-by: Mika Kahola Reviewed-by: Jouni Högander Signed-off-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20231010095233.590613-1-mika.kahola@intel.com commit 4d177f4996659fee4a32d30035d2acb19a5ac5de Author: Ben Wolsieffer Date: Mon Oct 9 10:59:04 2023 -0400 net: stmmac: dwmac-stm32: refactor clock config Currently, clock configuration is spread throughout the driver and partially duplicated for the STM32MP1 and STM32 MCU variants. This makes it difficult to keep track of which clocks need to be enabled or disabled in various scenarios. This patch adds symmetric stm32_dwmac_clk_enable/disable() functions that handle all clock configuration, including quirks required while suspending or resuming. syscfg_clk and clk_eth_ck are not present on STM32 MCUs, but it is fine to try to configure them anyway since NULL clocks are ignored. Signed-off-by: Ben Wolsieffer Signed-off-by: David S. Miller commit 7497b0af21573bbfa78eb40d7cefe663c4c2477b Merge: 0e6bb5b7f4c8e f826f2a2ee1ed Author: David S. Miller Date: Fri Oct 13 10:00:32 2023 +0100 Merge branch 'vxlan-fdb-flushing' Amit Cohen says: ==================== Extend VXLAN driver to support FDB flushing The merge commit 92716869375b ("Merge branch 'br-flush-filtering'") added support for FDB flushing in bridge driver. Extend VXLAN driver to support FDB flushing also. Add support for filtering by fields which are relevant for VXLAN FDBs: * Source VNI * Nexthop ID * 'router' flag * Destination VNI * Destination Port * Destination IP Without this set, flush for VXLAN device fails: $ bridge fdb flush dev vx10 RTNETLINK answers: Operation not supported With this set, such flush works with the relevant arguments, for example: $ bridge fdb flush dev vx10 vni 5000 dst 193.2.2.1 < flush all vx10 entries with VNI 5000 and destination IP 193.2.2.1> Some preparations are required, handle them before adding flushing support in VXLAN driver. See more details in commit messages. Patch set overview: Patch #1 prepares flush policy to be used by VXLAN driver Patches #2-#3 are preparations in VXLAN driver Patch #4 adds an initial support for flushing in VXLAN driver Patches #5-#9 add support for filtering by several attributes Patch #10 adds a test for FDB flush with VXLAN Patch #11 extends the test to check FDB flush with bridge ==================== Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit f826f2a2ee1ed648c59b792f93bb4466bfe367a1 Author: Amit Cohen Date: Mon Oct 9 13:06:18 2023 +0300 selftests: fdb_flush: Add test cases for FDB flush with bridge device Extend the test to check flushing with bridge device, test flush by device and by VID. Add test case for flushing with "self" and "master" and attributes that are supported only in one driver, this is unrecommended configuration, check it to verify that user gets an error. Signed-off-by: Amit Cohen Signed-off-by: David S. Miller commit 96eece6933304b09af6849a66f123a00c5a53313 Author: Amit Cohen Date: Mon Oct 9 13:06:17 2023 +0300 selftests: Add test cases for FDB flush with VXLAN device Test all the supported arguments for FDB flush. The test checks configuration, not traffic. Note that the flag 'offloaded' is not checked as it is not relevant when there is no hardware. Signed-off-by: Amit Cohen Signed-off-by: David S. Miller commit 2dcd22023cabc1b15b36af3c10924fcfee79b341 Author: Amit Cohen Date: Mon Oct 9 13:06:16 2023 +0300 vxlan: vxlan_core: Support FDB flushing by destination IP Add support for flush VXLAN FDB entries by destination IP. FDB entry is stored as {MAC, SRC_VNI} + remote. The destination IP is an attribute of the remote. For multicast entries, the VXLAN driver stores a linked list of remotes for a given key. In user space, each remote is represented as a separate entry, so when flush is sent with filter of 'destination IP', flush only the match remotes. In case that there are no additional remotes, destroy the entry. For example, the following are stored as one entry with several remotes: $ bridge fdb show dev vx10 00:00:00:00:00:00 dst 192.1.1.3 self permanent 00:00:00:00:00:00 dst 192.1.1.1 self permanent 00:00:00:00:00:00 dst 192.1.1.2 self permanent 00:00:00:00:00:00 dst 192.1.1.1 vni 1000 self permanent When user flush by destination IP x, only the relevant remotes will be flushed: $ bridge fdb flush dev vx10 dst 192.1.1.1 $ bridge fdb show dev vx10 00:00:00:00:00:00 dst 192.1.1.3 self permanent 00:00:00:00:00:00 dst 192.1.1.2 self permanent Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit ac0db4ddd0cbc2635eb263e487eef2fcae10087c Author: Amit Cohen Date: Mon Oct 9 13:06:15 2023 +0300 vxlan: vxlan_core: Support FDB flushing by destination port Add support for flush VXLAN FDB entries by destination port. FDB entry is stored as {MAC, SRC_VNI} + remote. The destination port is an attribute of the remote. For multicast entries, the VXLAN driver stores a linked list of remotes for a given key. In user space, each remote is represented as a separate entry, so when flush is sent with filter of 'destination port', flush only the match remotes. In case that there are no additional remotes, destroy the entry. For example, the following are stored as one entry with several remotes: $ bridge fdb show dev vx10 00:00:00:00:00:00 dst 192.1.1.1 port 1111 vni 2000 self permanent 00:00:00:00:00:00 dst 192.1.1.1 port 1111 vni 3000 self permanent 00:00:00:00:00:00 dst 192.1.1.1 port 2222 vni 2000 self permanent 00:00:00:00:00:00 dst 192.1.1.1 vni 3000 self permanent When user flush by port x, only the relevant remotes will be flushed: $ bridge fdb flush dev vx10 port 1111 $ bridge fdb show dev vx10 00:00:00:00:00:00 dst 192.1.1.1 port 2222 vni 2000 self permanent 00:00:00:00:00:00 dst 192.1.1.1 vni 3000 self permanent Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit c499fccb71cb85902b5c5b9ce9c9ae6683e54a8f Author: Amit Cohen Date: Mon Oct 9 13:06:14 2023 +0300 vxlan: vxlan_core: Support FDB flushing by destination VNI Add support for flush VXLAN FDB entries by destination VNI. FDB entry is stored as {MAC, SRC_VNI} + remote. The destination VNI is an attribute of the remote. For multicast entries, the VXLAN driver stores a linked list of remotes for a given key. In user space, each remote is represented as a separate entry, so when flush is sent with filter of 'destination VNI', flush only the match remotes. In case that there are no additional remotes, destroy the entry. For example, the following are stored as one entry with several remotes: $ bridge fdb show dev vx10 00:00:00:00:00:00 dst 192.1.1.1 vni 3000 self permanent 00:00:00:00:00:00 dst 192.1.1.1 vni 4000 self permanent 00:00:00:00:00:00 dst 192.1.1.1 vni 2000 self permanent 00:00:00:00:00:00 dst 192.1.1.2 vni 2000 self permanent When user flush by VNI x, only the relevant remotes will be flushed: $ bridge fdb flush dev vx10 vni 2000 $ bridge fdb show dev vx10 00:00:00:00:00:00 dst 192.1.1.1 vni 3000 self permanent 00:00:00:00:00:00 dst 192.1.1.1 vni 4000 self permanent Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 36c111233b561b8337997b2b4b4eff0c43a77fc0 Author: Amit Cohen Date: Mon Oct 9 13:06:13 2023 +0300 vxlan: vxlan_core: Support FDB flushing by nexthop ID Add support for flush VXLAN FDB entries by nexthop ID. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit a0f89d5e68b6b8d688517c993222ef626c6cc041 Author: Amit Cohen Date: Mon Oct 9 13:06:12 2023 +0300 vxlan: vxlan_core: Support FDB flushing by source VNI Add support for flush VXLAN FDB entries by source VNI. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit d324eb9cec8497cf710697be16cf9ac74666c4c9 Author: Amit Cohen Date: Mon Oct 9 13:06:11 2023 +0300 vxlan: vxlan_core: Add support for FDB flush The merge commit 92716869375b ("Merge branch 'br-flush-filtering'") added support for FDB flushing in bridge driver only, the VXLAN driver does not support such flushing. Extend VXLAN driver to support FDB flushing. In this commit, add support for flushing with state and flags, which are the fields that supported in the bridge driver. Note that bridge driver supports 'NTF_USE' flag, but there is no point to support this flag for flushing as it is ignored when flags are stored. 'NTF_STICKY' is not relevant for VXLAN driver. 'NTF_ROUTER' is not supported in bridge driver for flush as it is not relevant for bridge, add it for VXLAN. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 77b613efcc81a66665370f2fd6c7538747db7130 Author: Amit Cohen Date: Mon Oct 9 13:06:10 2023 +0300 vxlan: vxlan_core: Do not skip default entry in vxlan_flush() by default Currently, the function vxlan_flush() does not flush the default FDB entry (an entry with all_zeros_mac and default VNI), as it is deleted at vxlan_uninit(). When this function will be used for flushing FDB entries from user space, it will have to flush also the default entry in case that other parameters match (e.g., VNI, flags). Extend 'struct vxlan_fdb_flush_desc' to include an indication whether the default entry should be flushed or not. The default value (false) indicates to flush it, adjust all the existing callers to set '.ignore_default_entry' to true, so the current behavior will not be changed. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit bfe36bf7811c3171e546a956377ea16e89ecf838 Author: Amit Cohen Date: Mon Oct 9 13:06:09 2023 +0300 vxlan: vxlan_core: Make vxlan_flush() more generic for future use The function vxlan_flush() gets a boolean called 'do_all' and in case that it is false, it does not flush entries with state 'NUD_PERMANENT' or 'NUD_NOARP'. The following patches will add support for FDB flush with parameters from user space. Make the function more generic, so it can be used later. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 38985e8c278b82e6d4d62d4acd57c761cc23ce63 Author: Amit Cohen Date: Mon Oct 9 13:06:08 2023 +0300 net: Handle bulk delete policy in bridge driver The merge commit 92716869375b ("Merge branch 'br-flush-filtering'") added support for FDB flushing in bridge driver. The following patches will extend VXLAN driver to support FDB flushing as well. The netlink message for bulk delete is shared between the drivers. With the existing implementation, there is no way to prevent user from flushing with attributes that are not supported per driver. For example, when VNI will be added, user will not get an error for flush FDB entries in bridge with VNI, although this attribute is not relevant for bridge. As preparation for support of FDB flush in VXLAN driver, move the policy to be handled in bridge driver, later a new policy for VXLAN will be added in VXLAN driver. Do not pass 'vid' as part of ndo_fdb_del_bulk(), as this field is relevant only for bridge. Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 119a508c4dc956c859854f40a504c577598b68a8 Author: Florian Fainelli Date: Wed Oct 11 10:07:17 2023 -0700 pwm: bcm2835: Add support for suspend/resume Similar to other drivers, we need to make sure that the clock is disabled during suspend and re-enabled during resume. Reported-by: Angus Clark Signed-off-by: Florian Fainelli Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit aacbd65436690244648333cf492f557d162e9f09 Author: Florian Fainelli Date: Thu Oct 5 09:47:27 2023 -0700 pwm: brcmstb: Checked clk_prepare_enable() return value Check the clk_prepare_enable() return value and propagate it. Suggested-by: Uwe Kleine-König Signed-off-by: Florian Fainelli Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit e9bc4411548aaa738905d37851a0146c16b3bb21 Author: Florian Fainelli Date: Wed Oct 4 10:54:14 2023 -0700 pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume The suspend/resume functions currently utilize clk_disable()/clk_enable() respectively which may be no-ops with certain clock providers such as SCMI. Fix this to use clk_disable_unprepare() and clk_prepare_enable() respectively as we should. Fixes: 3a9f5957020f ("pwm: Add Broadcom BCM7038 PWM controller support") Signed-off-by: Florian Fainelli Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 87e51b76c9db8c29cde573af0faf5a3e13e23960 Author: Rob Herring Date: Mon Oct 9 12:29:17 2023 -0500 pwm: pxa: Explicitly include correct DT includes The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 896c450960f5b11f81eaa5822db0801b03be3e68 Author: Uwe Kleine-König Date: Fri Sep 29 18:19:18 2023 +0200 pwm: cros-ec: Simplify using devm_pwmchip_add() and dev_err_probe() Using devm_pwmchip_add() allows to drop pwmchip_remove() from the remove function which makes this function empty. Then there is no user of drvdata left and platform_set_drvdata() can be dropped, too. Further simplify and improve error returning using dev_err_probe(). Link: https://lore.kernel.org/r/20230929161918.2410424-12-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 9608405bdaa5876041d2a1dd388009f89643a2ea Author: Uwe Kleine-König Date: Fri Sep 29 18:19:17 2023 +0200 pwm: samsung: Consistently use the same name for driver data The driver uses mostly "chip" to name samsung_pwm_chip pointers: $ git grep -Pho 'samsung_pwm_chip \*[a-zA-Z0-9_]+(*nla:[a-zA-Z0-9_(])' v6.5-rc1 -- drivers/pwm/pwm-samsung.c | sort | uniq -c 10 samsung_pwm_chip *chip 6 samsung_pwm_chip *our_chip 1 samsung_pwm_chip *pwm However "chip" is supposed to be used for struct pwm_chip pointers and "pwm" for struct pwm_device pointers. So consistently use "our_chip". Link: https://lore.kernel.org/r/20230929161918.2410424-11-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit dfbf937916308641e925a23aa12dd7c38ceddd99 Author: Uwe Kleine-König Date: Fri Sep 29 18:19:16 2023 +0200 pwm: vt8500: Simplify using devm functions With devm_clk_get_prepared() the call to clk_unprepare() can be dropped from the error path and the remove callback. With devm_pwmchip_add() pwmchip_remove() can be dropped. Then the remove callback is empty and can go away, too. With vt8500_pwm_remove() the last user of platform_get_drvdata() is gone and so platform_set_drvdata() can be dropped, too. Also use dev_err_probe() for simplified (and improved) error reporting. Link: https://lore.kernel.org/r/20230929161918.2410424-10-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 21c0e1aaf7ef0ac3c67e4e1ab68c080adb2a186b Author: Uwe Kleine-König Date: Fri Sep 29 18:19:15 2023 +0200 pwm: sprd: Simplify using devm_pwmchip_add() and dev_err_probe() Using devm_pwmchip_add() allows to drop pwmchip_remove() from the remove function which makes this function empty. Then there is no user of drvdata left and platform_set_drvdata() can be dropped, too. Further simplify and improve error returning using dev_err_probe(). Link: https://lore.kernel.org/r/20230929161918.2410424-9-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit d8a2f6f26a079f3d0a34b6146e332797218cb5de Author: Uwe Kleine-König Date: Fri Sep 29 18:19:14 2023 +0200 pwm: sprd: Provide a helper to cast a chip to driver data Similar to most other PWM drivers provide a static inline function to calculate driver data from a given pwmchip. Link: https://lore.kernel.org/r/20230929161918.2410424-8-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 4f9ab6902b8e74452426686a453e01787846d028 Author: Uwe Kleine-König Date: Fri Sep 29 18:19:13 2023 +0200 pwm: spear: Simplify using devm functions With devm_clk_get_prepared() the call to clk_unprepare() can be dropped from the error path and the remove callback. With devm_pwmchip_add() pwmchip_remove() can be dropped. Then the remove callback is empty and can go away, too. With spear_pwm_remove() the last user of platform_get_drvdata() is gone and so platform_set_drvdata() can be dropped, too. Also use dev_err_probe() for simplified (and improved) error reporting. Link: https://lore.kernel.org/r/20230929161918.2410424-7-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 05c9b6f8e53446c6f7e9ff52e181b4f30459f452 Author: Uwe Kleine-König Date: Fri Sep 29 18:19:12 2023 +0200 pwm: mtk-disp: Simplify using devm_pwmchip_add() With devm_pwmchip_add() pwmchip_remove() can be dropped from the remove callback. Then the remove callback is empty and can go away, too. With mtk_disp_pwm_remove() the last user of platform_get_drvdata() is gone and so platform_set_drvdata() can be dropped, too. Also use dev_err_probe() for simplified (and improved) error reporting. Link: https://lore.kernel.org/r/20230929161918.2410424-6-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 92fcd5b682e410cd136d6ad4c26884487a35a7cd Author: Uwe Kleine-König Date: Fri Sep 29 18:19:11 2023 +0200 pwm: imx-tpm: Simplify using devm functions With devm_clk_get_enabled() the call to clk_disable_unprepare() can be dropped from the error path and the remove callback. With devm_pwmchip_add() pwmchip_remove() can be dropped. Then the remove callback is empty and can go away, too. Also use dev_err_probe() for simplified (and improved) error reporting. Link: https://lore.kernel.org/r/20230929161918.2410424-5-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 5af615f8ace2b027c582ea62c55b46d71e5287ad Author: Uwe Kleine-König Date: Fri Sep 29 18:19:10 2023 +0200 pwm: brcmstb: Simplify using devm functions With devm_clk_get_enabled() the call to clk_disable_unprepare() can be dropped from the error path and the remove callback. With devm_pwmchip_add() pwmchip_remove() can be dropped. Then the remove callback is empty and can go away, too. Also use dev_err_probe() for simplified (and improved) error reporting. Link: https://lore.kernel.org/r/20230929161918.2410424-4-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 2ce7b7f6704c9a8040fb12eb2b682986d9129e68 Author: Uwe Kleine-König Date: Fri Sep 29 18:19:09 2023 +0200 pwm: bcm2835: Simplify using devm functions With devm_clk_get_enabled() the call to clk_disable_unprepare() can be dropped from the error path and the remove callback. With devm_pwmchip_add() pwmchip_remove() can be dropped. Then the remove callback is empty and can go away, too. With bcm2835_pwm_remove() the only user of platform_get_drvdata() is gone and so platform_set_drvdata() can be dropped from .probe(), too. Also use dev_err_probe() for simplified (and improved) error reporting. Link: https://lore.kernel.org/r/20230929161918.2410424-3-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit b498c14efd4241d79999b9bb943e963eb982450c Author: Uwe Kleine-König Date: Fri Sep 29 18:19:08 2023 +0200 pwm: bcm-iproc: Simplify using devm functions With devm_clk_get_enabled() the call to clk_disable_unprepare() can be dropped from the error path and the remove callback. With devm_pwmchip_add() pwmchip_remove() can be dropped. Then the remove callback is empty and can go away, too. Also use dev_err_probe() for simplified (and improved) error reporting. Link: https://lore.kernel.org/r/20230929161918.2410424-2-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 8151b37b418310c83f133a9ea8ec2a654fb30d20 Author: Uwe Kleine-König Date: Mon Sep 11 17:44:54 2023 +0200 pwm: Adapt sysfs API documentation to reality Most low-level PWM drivers support duty_cycle == period, and so does the sysfs API. Also polarity can be changed for enabled PWMs since commit 39100ceea79f ("pwm: Switch to the atomic API"). Reported-by: Jens Gehrlein Link: https://lore.kernel.org/r/20230911154454.675057-1-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 4aff152d14c14f60dba7dad4ed0014d6e7c0cd0a Author: Ben Dooks Date: Thu Sep 7 17:12:39 2023 +0100 pwm: dwc: add PWM bit unset in get_state call If we are not in PWM mode, then the output is technically a 50% output based on a single timer instead of the high-low based on the two counters. Add a check for the PWM mode in dwc_pwm_get_state() and if DWC_TIM_CTRL_PWM is not set, then return a 50% cycle. This may only be an issue on initialisation, as the rest of the code currently assumes we're always going to have the extended PWM mode using two counters. Signed-off-by: Ben Dooks Reviewed-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230907161242.67190-4-ben.dooks@codethink.co.uk Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 81432e2e5132e681874f500220c21dc3fdfda42b Author: Ben Dooks Date: Thu Sep 7 17:12:38 2023 +0100 pwm: dwc: make timer clock configurable Add a configurable clock base rate for the pwm as when being built for non-PCI the block may be sourced from an internal clock. Signed-off-by: Ben Dooks Reviewed-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230907161242.67190-3-ben.dooks@codethink.co.uk Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 721ee188488381f0c2d4e04fbc2200963fda23b7 Author: Ben Dooks Date: Thu Sep 7 17:12:37 2023 +0100 pwm: dwc: split pci out of core driver Moving towards adding non-pci support for the driver, move the pci parts out of the core into their own module. This is partly due to the module_driver() code only being allowed once in a module and also to avoid a number of #ifdef if we build a single file in a system without pci support. Signed-off-by: Ben Dooks Acked-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230907161242.67190-2-ben.dooks@codethink.co.uk Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 6dbf23f5cfff789ee7c75a79709f06bcb3c6fc20 Author: Uwe Kleine-König Date: Tue Jul 18 19:55:45 2023 +0200 pwm: berlin: Simplify using devm functions With devm_clk_get_enabled() the call to clk_disable_unprepare() can be dropped from the error path and the remove callback. With devm_pwmchip_add() pwmchip_remove() can be dropped. Then the remove callback is empty and can go away, too. Link: https://lore.kernel.org/r/20230718175545.3946935-1-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit a6e5654e0b8b53e2d0e316bc7cecb81dd8371f18 Author: Uwe Kleine-König Date: Wed Jul 5 10:06:50 2023 +0200 pwm: Drop pwm_[sg]et_chip_data() The semantic of chip_data is a bit surprising as it's cleared when pwm_put() is called. Also there is a big overlap with the standard driver data. All drivers were adapted to not make use of chip_data any more, so it can go away. Link: https://lore.kernel.org/r/20230705080650.2353391-9-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 82adc1b2688b02a6b556720d9954a16a4129567f Author: Uwe Kleine-König Date: Wed Jul 5 10:06:49 2023 +0200 pwm: cros-ec: Put per-channel data into driver data Instead of an allocation of a single u16 per channel, allocate them all in a single chunk which greatly reduces memory fragmentation and also the overhead to track the allocated memory. Also put the channel data in driver data where it's cheaper to determine the address (no function call involved, just a trivial pointer addition). This also allows to get rid of the request and free callbacks. The only cost is that the channel data is allocated early, and even for unused channels. Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20230705080650.2353391-8-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 2d6812b41e0d832919d72c72ebddf361df53ba1b Author: Uwe Kleine-König Date: Wed Jul 5 10:06:48 2023 +0200 pwm: sti: Reduce number of allocations and drop usage of chip_data Instead of using one allocation per capture channel, use a single one. Also store it in driver data instead of chip data. This has several advantages: - driver data isn't cleared when pwm_put() is called - Reduces memory fragmentation Also register the pwm chip only after the per capture channel data is initialized as the capture callback relies on this initialization and it might be called even before pwmchip_add() returns. It would be still better to have struct sti_pwm_compat_data and the per-channel data struct sti_cpt_ddata in a single memory chunk, but that's not easily possible because the number of capture channels isn't known yet when the driver data struct is allocated. Fixes: e926b12c611c ("pwm: Clear chip_data in pwm_put()") Reported-by: George Stark Fixes: c97267ae831d ("pwm: sti: Add PWM capture callback") Link: https://lore.kernel.org/r/20230705080650.2353391-7-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit ec63391a0d402cafa5f4dfd11e05cd325ae7e2f5 Author: Uwe Kleine-König Date: Wed Jul 5 10:06:47 2023 +0200 pwm: renesas: Drop usage of pwm_[gs]et_chip_data() Instead of distributing the driver's bookkeeping over 5 (i.e. TPU_CHANNEL_MAX + 1) separately allocated memory chunks, put all together in struct tpu_device. This reduces the number of memory allocations and so fragmentation and maybe even the number of cache misses. Also &tpu->tpd[pwm->hwpwm] is cheaper to evaluate than pwm_get_chip_data(pwm) as the former is just an addition in machine code while the latter involves a function call. Link: https://lore.kernel.org/r/20230705080650.2353391-6-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 06cc4767750337ad162a0a7bcfd6f6eff6e0fe92 Author: Uwe Kleine-König Date: Wed Jul 5 10:06:46 2023 +0200 pwm: lp3943: Drop usage of pwm_[gs]et_chip_data() Instead of distributing the driver's bookkeeping over 3 (i.e. LP3943_NUM_PWMS + 1) separately allocated memory chunks, put all together in struct lp3943_pwm. This reduces the number of memory allocations and so fragmentation and maybe even the number of cache misses. Also &lp3943_pwm->pwm_map[pwm->hwpwm] is cheaper to evaluate than pwm_get_chip_data(pwm) as the former is just an addition in machine code while the latter involves a function call. Link: https://lore.kernel.org/r/20230705080650.2353391-5-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 89c8de78cea3119dab28830fb5dcc663ede587c8 Author: Uwe Kleine-König Date: Wed Jul 5 10:06:45 2023 +0200 pwm: jz4740: Put per-channel clk into driver data Stop using chip_data which is about to go away. Instead track the per-channel clk in struct jz4740_pwm_chip. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paul Cercueil Link: https://lore.kernel.org/r/20230705080650.2353391-4-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit e3fe982b2e4e968126a61c14df6c6a50fd7db2a7 Author: Uwe Kleine-König Date: Wed Jul 5 10:06:44 2023 +0200 pwm: samsung: Put per-channel data into driver data Instead of allocating extra data in .request() provide the needed memory in struct samsung_pwm_chip. This reduces the number of allocations. Even though now all 5 channel structs are allocated this is probably outweighed by the reduced overhead to track up to 6 smaller allocations. Link: https://lore.kernel.org/r/20230705080650.2353391-3-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 1b2af7bb7523a86d0ab1f1a5e8d65063d08c7856 Author: Uwe Kleine-König Date: Wed Jul 5 10:06:43 2023 +0200 pwm: berlin: Put per-channel config into driver data Instead of allocating extra data in .request() provide the needed memory in struct berlin_pwm_chip. This reduces the number of allocations. A side effect is that on suspend and resume the state for all four channels is always saved and restored. This is easier (and probably quicker) than looking up the matching pwm_device and checking its PWMF_REQUESTED bit. Link: https://lore.kernel.org/r/20230705080650.2353391-2-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 91a69d38cf97b195fef1a10ea53cf429aa134497 Author: Uwe Kleine-König Date: Fri Aug 4 16:27:07 2023 +0200 pwm: crc: Allow compilation as module and with COMPILE_TEST The driver compiles just fine as a module. The parent driver's Kconfig symbol already depends on X86 || COMPILE_TEST, so X86 can just be dropped from the dependencies allowing compilation on other platforms than x86. Link: https://lore.kernel.org/r/20230804142707.412137-3-u.kleine-koenig@pengutronix.de Reviewed-by: Linus Walleij Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 384461abcab6602abc06c2dfb8fb99beeeaa12b0 Author: Uwe Kleine-König Date: Fri Aug 4 16:27:06 2023 +0200 pwm: Manage owner assignment implicitly for drivers Instead of requiring each driver to care for assigning the owner member of struct pwm_ops, handle that implicitly using a macro. Note that the owner member has to be moved to struct pwm_chip, as the ops structure usually lives in read-only memory and so cannot be modified. The upside is that new low level drivers cannot forget the assignment and save one line each. The pwm-crc driver didn't assign .owner, that's not a problem in practice though as the driver cannot be compiled as a module. Acked-by: Andy Shevchenko # Intel LPSS Reviewed-by: Florian Fainelli # pwm-{bcm,brcm}*.c Acked-by: Jernej Skrabec # sun4i Acked-by: Andi Shyti Acked-by: Nobuhiro Iwamatsu # pwm-visconti Acked-by: Heiko Stuebner # pwm-rockchip Acked-by: Michael Walle # pwm-sl28cpld Acked-by: Neil Armstrong # pwm-meson Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230804142707.412137-2-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 7a3663c2e41f38daf876b23504f1396317f98fee Author: Uwe Kleine-König Date: Tue Aug 8 08:26:08 2023 +0200 pwm: jz4740: Consistently name driver data "jz" Most but not all pointers to driver data are already called "jz": $ git grep 'struct jz4740_pwm_chip \*' v6.5-rc1 -- drivers/pwm/pwm-jz4740.c v6.5-rc1:drivers/pwm/pwm-jz4740.c:static inline struct jz4740_pwm_chip *to_jz4740(struct pwm_chip *chip) v6.5-rc1:drivers/pwm/pwm-jz4740.c:static bool jz4740_pwm_can_use_chn(struct jz4740_pwm_chip *jz, v6.5-rc1:drivers/pwm/pwm-jz4740.c: struct jz4740_pwm_chip *jz = to_jz4740(chip); v6.5-rc1:drivers/pwm/pwm-jz4740.c: struct jz4740_pwm_chip *jz = to_jz4740(chip); v6.5-rc1:drivers/pwm/pwm-jz4740.c: struct jz4740_pwm_chip *jz = to_jz4740(chip); v6.5-rc1:drivers/pwm/pwm-jz4740.c: struct jz4740_pwm_chip *jz4740 = to_jz4740(pwm->chip); v6.5-rc1:drivers/pwm/pwm-jz4740.c: struct jz4740_pwm_chip *jz4740; Adapt the two variables called "jz4740" to use the same name for consistency. Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20230808062608.897710-1-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 1b8a955dd338dfbf39831d4687c25263e885a9cb Author: Mathieu Desnoyers Date: Thu Oct 12 08:58:24 2023 -0400 sched: Make PELT acronym definition searchable The PELT acronym definition can be found right at the top of kernel/sched/pelt.c (of course), but it cannot be found through use of grep -r PELT kernel/sched/ Add the acronym "(PELT)" after "Per Entity Load Tracking" at the top of the source file. Signed-off-by: Mathieu Desnoyers Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20231012125824.1260774-1-mathieu.desnoyers@efficios.com commit f0498d2a54e7966ce23cd7c7ff42c64fa0059b07 Author: Peter Zijlstra Date: Tue Oct 10 20:57:39 2023 +0200 sched: Fix stop_one_cpu_nowait() vs hotplug Kuyo reported sporadic failures on a sched_setaffinity() vs CPU hotplug stress-test -- notably affine_move_task() remains stuck in wait_for_completion(), leading to a hung-task detector warning. Specifically, it was reported that stop_one_cpu_nowait(.fn = migration_cpu_stop) returns false -- this stopper is responsible for the matching complete(). The race scenario is: CPU0 CPU1 // doing _cpu_down() __set_cpus_allowed_ptr() task_rq_lock(); takedown_cpu() stop_machine_cpuslocked(take_cpu_down..) ack_state() MULTI_STOP_RUN take_cpu_down() __cpu_disable(); stop_machine_park(); stopper->enabled = false; /> /> stop_one_cpu_nowait(.fn = migration_cpu_stop); if (stopper->enabled) // false!!! That is, by doing stop_one_cpu_nowait() after dropping rq-lock, the stopper thread gets a chance to preempt and allows the cpu-down for the target CPU to complete. OTOH, since stop_one_cpu_nowait() / cpu_stop_queue_work() needs to issue a wakeup, it must not be ran under the scheduler locks. Solve this apparent contradiction by keeping preemption disabled over the unlock + queue_stopper combination: preempt_disable(); task_rq_unlock(...); if (!stop_pending) stop_one_cpu_nowait(...) preempt_enable(); This respects the lock ordering contraints while still avoiding the above race. That is, if we find the CPU is online under rq-lock, the targeted stop_one_cpu_nowait() must succeed. Apply this pattern to all similar stop_one_cpu_nowait() invocations. Fixes: 6d337eab041d ("sched: Fix migrate_disable() vs set_cpus_allowed_ptr()") Reported-by: "Kuyo Chang (張建文)" Signed-off-by: Peter Zijlstra (Intel) Tested-by: "Kuyo Chang (張建文)" Link: https://lkml.kernel.org/r/20231010200442.GA16515@noisy.programming.kicks-ass.net commit 0c2924079f5a83ed715630680e338b3685a0bf7d Author: Haifeng Xu Date: Tue Sep 26 11:57:22 2023 +0000 sched/psi: Bail out early from irq time accounting We could bail out early when psi was disabled. Signed-off-by: Haifeng Xu Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Chengming Zhou Link: https://lore.kernel.org/r/20230926115722.467833-1-haifeng.xu@shopee.com commit a23bfeda86239d29f18a149a7e658cc3d4e5ef8a Author: Marek Szyprowski Date: Thu Oct 12 12:36:00 2023 +0200 arm64: defconfig: add various drivers for Amlogic based boards Enable drivers for the hardware blocks present on the Amlogic Meson SoC based boards: Khadas VIM3 and Hardkernel Odroid N2 to increase testing coverage. Signed-off-by: Marek Szyprowski Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20231012103600.3381340-1-m.szyprowski@samsung.com Signed-off-by: Neil Armstrong commit 583d8073205566468abf3a34000fccdd1d19c9cc Author: Uwe Kleine-König Date: Mon Oct 9 10:38:55 2023 +0200 pinctrl: renesas: rzn1: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20231009083856.222030-20-u.kleine-koenig@pengutronix.de Signed-off-by: Geert Uytterhoeven commit c6a088e5a03b37a1ee646986b4ef44121715b46e Author: Claudiu Beznea Date: Fri Sep 29 08:39:08 2023 +0300 pinctrl: renesas: rzg2l: Add RZ/G3S support Add basic support for RZ/G3S to be able to boot from SD card, have a running console port, and use GPIOs. RZ/G3S has 82 general-purpose IO ports. Support for the remaining pin functions (e.g. Ethernet, XSPI) will be added along with controller-specific support. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-22-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 60e4dc192ce2ebabcdd7c3487387a802110dc1a5 Author: Claudiu Beznea Date: Fri Sep 29 08:39:07 2023 +0300 dt-bindings: pinctrl: renesas: Document RZ/G3S SoC Add documentation for the pin controller found on the Renesas RZ/G3S (R9A08G045) SoC. Compared to RZ/G2{L,UL}, RZ/G3S has 82 general-purpose IOs, no slew rate and output impedance support, and more values for drive strength which needs to be expressed in microamp. Signed-off-by: Claudiu Beznea Reviewed-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-21-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit ae5b425faf1074a757fad093085f6be654b7db99 Author: Claudiu Beznea Date: Fri Sep 29 08:39:05 2023 +0300 pinctrl: renesas: rzg2l: Add support for different DS values on different groups RZ/G3S supports different drive strength values for different power sources and pin groups (A, B, C). On each group there could be up to 4 drive strength values per power source. Available power sources are 1v8, 2v5, 3v3. Drive strength values are more fine tuned than what was previously available on the driver thus the necessity of having micro-amp support. As drive strength and power source values are linked together the hardware setup for these was moved at the end of rzg2l_pinctrl_pinconf_set() to ensure proper validation of the new values. The drive strength values are expected to be initialized though the SoC-specific hardware configuration data structure. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-19-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit cca38201b492305dd1fbd3d28df398b5595f4836 Author: Claudiu Beznea Date: Fri Sep 29 08:39:04 2023 +0300 pinctrl: renesas: rzg2l: Move DS and OI to SoC-specific configuration Move drive strength and output impedance values to the SoC-specific configuration data structure (struct rzg2l_hwcfg). This allows extending the drive strength support for RZ/G3S. Along with this the DS values were converted to uA for simple integration with RZ/G3S support. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-18-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 35a3610e5a2407913dd6505de06975ba5056af9e Author: Claudiu Beznea Date: Fri Sep 29 08:39:03 2023 +0300 pinctrl: renesas: rzg2l: Adapt function number for RZ/G3S On RZ/G3S PFC register allow setting 8 functions for individual ports (function1 to function8). For function1 the register need to be configured with 0, for function8 the register need to be configured with 7. We cannot use zero based addressing when requesting functions from different code places as the documentation (RZG3S_pinfunction_List_r1.0.xlsx) states explicitly that function0 is GPIO. Add a new member to struct rzg2l_hwcfg that will keep the offset that needs to be substracted before applying a value to a PFC register. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-17-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 1f89aa906fac1d569ecf8f427b1edca6e26fa472 Author: Claudiu Beznea Date: Fri Sep 29 08:39:02 2023 +0300 pinctrl: renesas: rzg2l: Adapt for different SD/PWPR register offsets SD, PWPR power registers have different offsets b/w RZ/G2L and RZ/G3S. Add a per SoC configuration data structure that is initialized with the proper register offsets for individual SoCs. The rzg2l_hwcfg structure will be extended further in later commits. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-16-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 77e18969da3a5a0ed5f7c3b80869c0acf25377ab Author: Claudiu Beznea Date: Fri Sep 29 08:39:01 2023 +0300 pinctrl: renesas: rzg2l: Index all registers based on port offset To get the address that needs to be read/written for specific port functionalities, the P(), PM(), PMC(), PFC(), PIN(), IOLH() IEN(), ISEL() macros are used. Some of these macros receive as argument the hardware port identifier, some the hardware port offset address (e.g. ISEL() received port identifier, IOLH() received port offset address). This makes it hard to extend the current driver for SoCs where port identifiers are not contiguous in the memory map of the pin controller. This is the case for the RZ/G3S pin controller where ports are mapped as follows: port offset port identifier ----------- --------------- 0x20 P0 0x21 P5 0x22 P6 0x23 P11 0x24 P12 0x25 P13 0x26 P14 0x27 P15 0x28 P16 0x29 P17 0x2a P18 0x30 P1 0x31 P2 0x32 P3 0x33 P4 0x34 P7 0x35 P8 0x36 P8 0x37 P10 To make this achievable, change all the above macros used to get the address of a port register for a specific port functionality based on the port hardware address. Summarized, all the above macros will get as argument the port offset address listed in the above table. With this RZG2L_SINGLE_PIN_GET_PORT_OFFSET(), RZG2L_PIN_ID_TO_PORT_OFFSET() and RZG2L_GPIO_PORT_GET_INDEX() were replaced by RZG2L_PIN_CFG_TO_PORT_OFFSET(); RZG2L_SINGLE_PIN_GET_CFGS() and RZG2L_GPIO_PORT_GET_CFGS() were replaced by RZG2L_PIN_CFG_TO_CAPS(). Also rzg2l_pinctrl_set_pfc_mode() does not need the port argument anymore. Also rzg2l_gpio_direction_input() and rzg2l_gpio_direction_output() do not need to translate port and bit locally as this can be done by rzg2l_gpio_set_direction(). To use the same naming for port, bit/pin, and register offset, replace the port_offset variable names in different places by variables named off. There is no longer a need to initialize cfg and bit in different code places. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Reviewed-by: Lad Prabhakar Tested-by: Lad Prabhakar Link: https://lore.kernel.org/r/20230929053915.1530607-15-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit c944d9dea75e453d18bc8c100022e990c2eac3cb Author: Lad Prabhakar Date: Mon Sep 25 16:45:48 2023 +0100 pinctrl: renesas: rzg2l: Add validation of GPIO pin in rzg2l_gpio_request() Validate the GPIO pin request in the rzg2l_gpio_request() callback using the rzg2l_validate_gpio_pin() function. This stops any accidental usage of GPIO pins which are not supported by the SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Tested-by: Claudiu Beznea Link: https://lore.kernel.org/r/20230925154548.27048-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 84ba5131693335f4ffa277227157a31e98168425 Author: Geert Uytterhoeven Date: Fri Sep 15 11:04:45 2023 +0200 pinctrl: renesas: r8a7778: Add LBSC pins, groups, and functions Add pins, groups, and functions for the Local Bus State Controller (LBSC) on the Renesas R-Car M1A (R8A7778) SoC. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/347b9f7627871b45aec04a3351d50219d4d260fe.1694768311.git.geert+renesas@glider.be commit 7543365739a4ff61d40ad53ab68c17d2e7dfb0c9 Author: Dan Carpenter Date: Fri Oct 13 10:18:12 2023 +0300 perf/x86/amd/uncore: Fix uninitialized return value in amd_uncore_init() Some of the error paths in this function return don't initialize the error code. Return -ENODEV by default. Fixes: d6389d3ccc13 ("perf/x86/amd/uncore: Refactor uncore management") Signed-off-by: Dan Carpenter Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/cec62eba-c4b8-4cb7-9671-58894dd4b974@moroto.mountain commit 8c85a102fc4e5c0c942c10677fa43f7a19baa92f Author: Bartosz Golaszewski Date: Tue Sep 5 20:52:55 2023 +0200 gpiolib: provide gpio_device_get_base() Let's start adding getters for the opaque struct gpio_device. Start with a function allowing to retrieve the base GPIO number. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit b2e847012cbc5476b0fa93351f74ea623e43e9c8 Author: Alain Volmat Date: Mon Feb 13 19:56:31 2023 +0100 dt-bindings: arm: sti: add STi boards and remove stih415/stih416 Add bindings for STi platform boards and remove stih415/stih416 Signed-off-by: Alain Volmat Reviewed-by: Krzysztof Kozlowski Signed-off-by: Patrice Chotard commit 02091cbe9cc4f18167208eec1d6de636cc731817 Author: Alain Volmat Date: Mon Feb 13 19:56:30 2023 +0100 dt-bindings: soc: sti: add STi platform syscon Add DT schema of STi platform syscon Signed-off-by: Alain Volmat Reviewed-by: Krzysztof Kozlowski Signed-off-by: Patrice Chotard commit 8434eed701a7237fa1e8dbd49e5d7a973c0d6b14 Author: Alain Volmat Date: Sun Jul 2 16:19:35 2023 +0000 ARM: dts: st: correct led level in stih418-b2264.dts The state of the green led on the stih418-b2264 is currently inverted. Correct this by fixing the GPIO active state. Signed-off-by: Alain Volmat Acked-by: Patrice Chotard Signed-off-by: Patrice Chotard commit e34a63cf5f0c372f7b12fd56d313669700389a1a Author: Alain Volmat Date: Sun Jul 2 16:19:34 2023 +0000 ARM: dts: st: move leds out of soc in stih418-b2264.dts Move the leds node out of the soc section and correct the following warning: Warning (simple_bus_reg): /soc/leds: missing or empty reg/ranges property Signed-off-by: Alain Volmat Acked-by: Patrice Chotard Signed-off-by: Patrice Chotard commit 7c46058ec1167fec9a3710113337942132540db8 Author: Alain Volmat Date: Sun Jul 2 16:19:33 2023 +0000 ARM: dts: st: correct serial alias in stih418-b2264.dts Aliases should only contain lowercase, digits or - hence correct the alias for the serial from ttyAS0 into serial0 as already done for the other boards. Signed-off-by: Alain Volmat Acked-by: Patrice Chotard Signed-off-by: Patrice Chotard commit f1b85838e8c11c8663fa5c6c1824cca1ff84db6d Author: Krzysztof Kozlowski Date: Sun Jul 30 19:49:54 2023 +0200 ARM: dts: st: stih407: drop max-duty-cycle "max-duty-cycle" property was removed in the commit f747a1fe7848 ("regulator: pwm-regulator: Remove obsoleted property"): stih418-b2199.dtb: pwm-regulator: Unevaluated properties are not allowed ('max-duty-cycle' was unexpected) Signed-off-by: Krzysztof Kozlowski Acked-by: Patrice Chotard Signed-off-by: Patrice Chotard commit 9acdf6209f226846cc1e354a6b3da3c927898926 Author: Bartosz Golaszewski Date: Wed Oct 11 15:02:04 2023 +0200 i2c: mux: gpio: don't fiddle with GPIOLIB internals Use the relevant API functions to retrieve the address of the underlying struct device instead of accessing GPIOLIB private structures manually. Signed-off-by: Bartosz Golaszewski Acked-by: Peter Rosin Acked-by: Wolfram Sang Acked-by: Linus Walleij commit 370232d096e3fe188e4596f77bc6560636bd40c1 Author: Bartosz Golaszewski Date: Wed Oct 11 15:02:03 2023 +0200 gpiolib: provide gpiod_to_gpio_device() Accessing struct gpio_chip backing a GPIO device is only allowed for the actual providers of that chip. Similarly to how we introduced gpio_device_find() in order to replace the abused gpiochip_find(), let's introduce a counterpart to gpiod_to_chip() that returns a reference to the GPIO device owning the descriptor. This is done in order to later remove gpiod_to_chip() entirely. Signed-off-by: Bartosz Golaszewski Reviewed-by: Peter Rosin Acked-by: Linus Walleij commit 1559d14977b694570f010854b8192e6de034bc27 Author: Bartosz Golaszewski Date: Wed Oct 11 15:02:02 2023 +0200 gpiolib: provide gpio_device_to_device() There are users in the kernel who need to retrieve the address of the struct device backing the GPIO device. Currently they needlessly poke in the internals of GPIOLIB. Add a dedicated getter function. Signed-off-by: Bartosz Golaszewski Reviewed-by: Peter Rosin Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit 4f3b436eea7d7242ca5c528fca1d2d15bc242190 Author: Devyn Liu Date: Thu Oct 12 18:54:11 2023 +0800 gpio: hisi: Fix format specifier The hisi_gpio->line is unsigned int so the format specifier should have been %u not %d. Signed-off-by: Devyn Liu Signed-off-by: Bartosz Golaszewski commit 274baf695b08d34230253a792fcb3d6790040ab6 Author: Gil Fine Date: Thu Aug 10 23:18:23 2023 +0300 thunderbolt: Add DP IN added last in the head of the list of DP resources If DP IN on device router exist, position it at the beginning of the DP resources list, so that it is used before DP IN on host router. This way external GPU will be prioritized when pairing DP IN and DP OUT for DisplayPort tunnel setup. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 8648c6465c025c488e2855c209c0dea1a1a15184 Author: Gil Fine Date: Tue Aug 22 18:01:12 2023 +0300 thunderbolt: Create multiple DisplayPort tunnels if there are more DP IN/OUT pairs Currently we only create one DisplayPort tunnel even if there would be more DP IN/OUT pairs available. Specifically this happens when a router is unplugged and we check if a new DisplayPort tunnel can be created. To cover this create tunnels as long as we find suitable DP IN/OUT pairs. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit d80d926c5b6bcbcf7639b55caa38f3df7d978d0d Author: Gil Fine Date: Wed Sep 20 12:13:11 2023 +0300 thunderbolt: Log NVM version of routers and retimers This is useful when debugging possible issues. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 34c5def565b4deda6faf807cd1362c0ef3c1ac8e Author: Mika Westerberg Date: Wed Sep 20 08:44:22 2023 +0300 thunderbolt: Use tb_tunnel_xxx() log macros in tb.c Now that the macros are available we can use them in tb.c. This makes the log output more consistent. Signed-off-by: Mika Westerberg commit d27bd2c37d4666bce25ec4d9ac8c6b169992f0f0 Author: Mika Westerberg Date: Tue Sep 19 15:00:44 2023 +0300 thunderbolt: Expose tb_tunnel_xxx() log macros to the rest of the driver In order to allow more consistent logging of tunnel related information make these logging macros available to the rest of the driver. Signed-off-by: Mika Westerberg commit fe8a0293c922ee8bc1ff0cf9048075afb264004a Author: Mika Westerberg Date: Tue Sep 19 15:03:58 2023 +0300 thunderbolt: Use tb_tunnel_dbg() where possible to make logging more consistent This makes it easier to find out the tunnel in question. Also drop a couple of lines that generate duplicate information. Signed-off-by: Mika Westerberg commit 6ed0b900d89944b47362addeb3002f22d359f4b5 Author: Gil Fine Date: Thu Aug 10 23:18:22 2023 +0300 thunderbolt: Fix typo of HPD bit for Hot Plug Detect Fix typo of HPD bit stands for Hot Plug Detect. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 7cbabed16464ad980c8d80b601559b36e1bc0b0c Author: Mika Westerberg Date: Mon Jul 31 05:25:36 2023 +0300 thunderbolt: Fix typo in enum tb_link_width kernel-doc Typo trasmitters -> transmitters. Signed-off-by: Mika Westerberg Signed-off-by: Gil Fine commit 6b8ac54f31f985d3abb0b4212187838dd8ea4227 Author: Gil Fine Date: Thu Aug 24 15:19:41 2023 +0300 thunderbolt: Fix debug log when DisplayPort adapter not available for pairing Fix debug log when looking for a DisplayPort adapter pair of DP IN and DP OUT. In case of no DP adapter available, log the type of the DP adapter that is not available. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 9e4f5b2af24297552017dd3d4db2379779701b6f Author: Mika Westerberg Date: Fri Sep 1 11:32:17 2023 +0300 thunderbolt: Check for unplugged router in tb_switch_clx_disable() There is no point disabling CL states if the router is unplugged so in that case return early. Signed-off-by: Mika Westerberg commit 35c9ab4fd636aaa5a652bc5f41bc8f1cb34b93e6 Author: Mika Westerberg Date: Wed Aug 30 14:45:02 2023 +0300 thunderbolt: Make tb_switch_clx_is_supported() static This function is not used outside of clx.c so make it static. No functional changes. Signed-off-by: Mika Westerberg commit 92b8f7a1b1f95fce5dee1a64902cab9f55576748 Author: Mika Westerberg Date: Thu Aug 31 14:15:26 2023 +0300 thunderbolt: Get rid of usb4_usb3_port_actual_link_rate() It turns out there is no need to use the actual link rate when reclaiming bandwidth for USB 3.x. The reason is that we use consumed bandwidth which is coming from xHCI when releasing bandwidth (for example for DisplayPort tunneling) and this can be anything between 1000 Mb/s to maximum, so when reclaiming we can just bump it up back to maximum instead of actual link rate (which is always <= maximum). This allows us to get rid of couple of unnecessary lines of code. Signed-off-by: Mika Westerberg commit 7b304040c8db5fb829fd55342224161a754040c1 Author: Mika Westerberg Date: Mon Sep 18 11:04:42 2023 +0300 thunderbolt: dma_test: Use enum tb_link_width Since we have it, use it in the DMA test driver as well. Signed-off-by: Mika Westerberg commit 0af9e89106c359e531791c3dc2422a16bd40d17f Author: Uwe Kleine-König Date: Mon Sep 25 11:54:52 2023 +0200 soc/aspeed: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20230925095532.1984344-2-u.kleine-koenig@pengutronix.de Link: https://lore.kernel.org/r/20230925095532.1984344-3-u.kleine-koenig@pengutronix.de Link: https://lore.kernel.org/r/20230925095532.1984344-4-u.kleine-koenig@pengutronix.de Link: https://lore.kernel.org/r/20230925095532.1984344-5-u.kleine-koenig@pengutronix.de Signed-off-by: Joel Stanley commit d024ca2792b17577c48f0cf23d648cea6f1a0b9a Author: Chanh Nguyen Date: Thu Oct 5 10:55:25 2023 +0700 ARM: dts: aspeed: mtmitchell: Add I2C NVMe alias port Adds the I2C alias ports to each NVMe drive via the backplane card. Besides that, it also adds the eeprom and temperature sensor on the backplane card. Signed-off-by: Chanh Nguyen Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20231005035525.19036-8-chanh@os.amperecomputing.com Signed-off-by: Joel Stanley commit 8098d06af171ce8aa67a95698452dacd8c1dfe26 Author: Chanh Nguyen Date: Thu Oct 5 10:55:24 2023 +0700 ARM: dts: aspeed: mtmitchell: Remove redundant ADC configurations Mt.Mitchell DVT and later hardware do not use adc1. It only uses adc0 with channels 0, 1 and 2. This commit removes redundant ADC configurations. Signed-off-by: Chanh Nguyen Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20231005035525.19036-7-chanh@os.amperecomputing.com Signed-off-by: Joel Stanley commit e998856086a41dc4a76c35aae33a6ac6e455061b Author: Chanh Nguyen Date: Thu Oct 5 10:55:23 2023 +0700 ARM: dts: aspeed: mtmitchell: Add inlet temperature sensor Add the inlet temperature at address 0x48, which is connected via BMC I2C8. Signed-off-by: Chanh Nguyen Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20231005035525.19036-6-chanh@os.amperecomputing.com Signed-off-by: Joel Stanley commit 1edcc7251f8b12eff3c4aff6d6c7fdf650ec7918 Author: Chanh Nguyen Date: Thu Oct 5 10:55:21 2023 +0700 ARM: dts: aspeed: mtjade: Add the gpio-hog Add the GPIOR5 as a gpio-hog with output high so that can power the OCP card once the BMC booting. Add the GPIOAC5 as a gpio-hog with output high to notice the BMC state. Signed-off-by: Chanh Nguyen Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20231005035525.19036-4-chanh@os.amperecomputing.com Signed-off-by: Joel Stanley commit e71d1a92550a44e0dc29c2fb4c254e4959183719 Author: Chanh Nguyen Date: Thu Oct 5 10:55:20 2023 +0700 ARM: dts: aspeed: mtjade, mtmitchell: Add new gpio-line-names Add new gpio-line-names from the Mt.Jade and Mt.Mitchell HW schematic. Mt.Jade GPIOB5: presence-cpu0 GPIOF0: ps0-pgood GPIOF1: ps1-pgood GPIOG2: host0-shd-ack-n GPIOH0: uart1-mode1 GPIOH1: uart2-mode1 GPIOH2: uart3-mode1 GPIOH3: uart4-mode1 GPIOH7: i2c6-reset-n GPIOH3: host0-reboot-ack-n GPIOM4: s0-i2c9-alert-n GPIOM5: s1-i2c9-alert-n GPIOQ6: led-identify GPIOS0: s0-vr-hot-n GPIOS1: s1-vr-hot-n GPIOS5: vr-pmbus-sel-n GPIOY3: bmc-vga-en-n GPIOZ3: s0-rtc-lock GPIOAC2: spi0-program-sel GPIOAC3: spi0-backup-sel Mt.Mitchell: GPIOC3: bmc-debug-mode GPIOE1: eth-phy-int-n GPIOH0: jtag-program-sel GPIOH1: fpga-program-b GPIOW3: s1-pcp-pgood Signed-off-by: Chanh Nguyen Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20231005035525.19036-3-chanh@os.amperecomputing.com Signed-off-by: Joel Stanley commit 081404fe01e2866d991c1bca11c64ca4904295a6 Author: Chanh Nguyen Date: Thu Oct 5 10:55:19 2023 +0700 ARM: dts: aspeed: mtjade, mtmitchell: Update gpio-line-names Update GPIO line-name to follow naming convention specified at github.com/openbmc/docs/blob/master/designs/device-tree-gpio-naming.md Signed-off-by: Chanh Nguyen Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20231005035525.19036-2-chanh@os.amperecomputing.com Signed-off-by: Joel Stanley commit fe93af86526b93de6f11ca3c201525dbd961fb8f Author: Yang Chen Date: Thu Sep 14 20:56:48 2023 +0800 ARM: dts: aspeed: Minerva: Add Facebook Minerva CMC board Add linux device tree entry related to the Minerva Chassis Management Controller (CMC) specific devices connected to the Aspeed SoC (AST2600). Signed-off-by: Yang Chen Link: https://lore.kernel.org/r/20230914125648.3966519-3-yangchen.openbmc@gmail.com Signed-off-by: Joel Stanley commit 079ecd68c20649599bef9011d056f087046f137b Author: Yang Chen Date: Thu Sep 14 20:56:47 2023 +0800 dt-bindings: arm: aspeed: document board compatibles Document the new compatibles used on the Facebook Minerva Chassis Management Controller (CMC). Signed-off-by: Yang Chen Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230914125648.3966519-2-yangchen.openbmc@gmail.com Signed-off-by: Joel Stanley commit f1538805cf9da7a1be38c78690a0d3809e330acd Author: Joel Stanley Date: Thu Oct 6 18:56:52 2022 +1030 ARM: config: aspeed: Remove FIRMWARE_MEMMAP It's an x86 thing. Signed-off-by: Joel Stanley commit a0530d3b845b1ddc13b9555d35d974d09db58701 Author: Joel Stanley Date: Thu Oct 6 19:00:29 2022 +1030 ARM: config: aspeed_g5: Enable SSIF BMC driver Signed-off-by: Joel Stanley commit 3c9aebd394af1a50f4d05a9a856c37e492e43925 Author: Joel Stanley Date: Thu Nov 17 13:37:49 2022 +1030 ARM: config: aspeed: Add Ampere SMPro drivers Used by Ampere Altra BMCs. Signed-off-by: Joel Stanley commit 21486de85ba43764e4bdbdc571c8dac81879dd77 Author: Joel Stanley Date: Wed Aug 9 15:45:24 2023 +0930 ARM: config: aspeed: Add new FSI drivers The I2C Responder SCOM driver and IBM I2C Responder virtual FSI master are used by BMCs in P10 machines. Signed-off-by: Joel Stanley commit 54d7211da7cd8fbd286532b25f4f0b688fcf94a3 Author: Damien Le Moal Date: Thu Oct 12 15:53:16 2023 +0900 ata: libata-eh: Spinup disk on resume after revalidation Move the call to ata_dev_power_set_active() to transition a disk in standby power mode to the active power mode from ata_eh_revalidate_and_attach() before doing revalidation to the end of ata_eh_recover(), after the link speed for the device is reconfigured (if that was necessary). This is safer as this ensure that the VERIFY command executed to spinup the disk is executed with the drive properly reconfigured first. Signed-off-by: Damien Le Moal Reviewed-by: Niklas Cassel Tested-by: Geert Uytterhoeven commit b3c3a197baf23ca445ba74e3c7c40cfacfedd9fb Author: Rob Herring Date: Mon Oct 9 12:29:15 2023 -0500 power: supply: cpcap: Drop non-DT driver matching Only DT based probing is used for the Motorola CPCAP charger driver, so drop the !CONFIG_OF parts and redundant of_match_device() call. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231009172923.2457844-20-robh@kernel.org Signed-off-by: Sebastian Reichel commit 3c693ac29e3fb4e1d88652e633a9dc16e1dd76e4 Author: Peter Robinson Date: Mon Oct 9 14:58:18 2023 +0100 power: reset: brcmstb: Depend on actual SoC dependencies Depend on the explicit SoC defines rather than generic architectures like most of the rest of the HW drivers do. This makes the drivers only available for the HW and for compile testing. Signed-off-by: Peter Robinson Cc: Sebastian Reichel Cc: linux-pm@vger.kernel.org Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20231009135833.17880-3-pbrobinson@gmail.com Signed-off-by: Sebastian Reichel commit d03d2a8cdefe86f04cfb53934a708620e7dfbfcb Author: Stefan Eichenberger Date: Fri Oct 6 10:04:28 2023 -0300 power: reset: gpio-poweroff: make sys handler priority configurable Add a priority property equal to gpio-restart to allow increasing the priority of the gpio-poweroff handler. Signed-off-by: Stefan Eichenberger Signed-off-by: Francesco Dolcini Link: https://lore.kernel.org/r/20231006130428.11259-5-francesco@dolcini.it Signed-off-by: Sebastian Reichel commit 4ee17bd30788496a279ceaabc7ecaaf39f61cfc4 Author: Stefan Eichenberger Date: Fri Oct 6 10:04:27 2023 -0300 dt-bindings: power: reset: gpio-poweroff: Add priority property Add the priority property to the gpio-poweroff bindings description. Signed-off-by: Stefan Eichenberger Signed-off-by: Francesco Dolcini Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231006130428.11259-4-francesco@dolcini.it Signed-off-by: Sebastian Reichel commit b16d9f49735f3d26e23f0ba4a2cf21668fc6b66b Author: Stefan Eichenberger Date: Fri Oct 6 10:04:26 2023 -0300 power: reset: gpio-poweroff: use sys-off handler API Use the new sys-off handler API for gpio-poweroff. This allows us to have more than one poweroff handler and prioritise them. Signed-off-by: Stefan Eichenberger Signed-off-by: Francesco Dolcini Link: https://lore.kernel.org/r/20231006130428.11259-3-francesco@dolcini.it Signed-off-by: Sebastian Reichel commit 13b4c6964665cadb9b06c085029710c43a0c662e Author: Stefan Eichenberger Date: Fri Oct 6 10:04:25 2023 -0300 power: reset: gpio-poweroff: use a struct to store the module variables Use a struct to store the module variables. This is required to later move to notifier_blocks where we can have several instances. Signed-off-by: Stefan Eichenberger Signed-off-by: Francesco Dolcini Link: https://lore.kernel.org/r/20231006130428.11259-2-francesco@dolcini.it Signed-off-by: Sebastian Reichel commit 0e6bb5b7f4c8e6665e76bdafce37ad4a8daf83c5 Merge: 2f0968a030f2a e8c127b057666 Author: Jakub Kicinski Date: Thu Oct 12 16:17:46 2023 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. No conflicts. Adjacent changes: kernel/bpf/verifier.c 829955981c55 ("bpf: Fix verifier log for async callback return values") a923819fb2c5 ("bpf: Treat first argument as return value for bpf_throw") Signed-off-by: Jakub Kicinski commit 2790e2a33aa9e0710354aaabce8ae1a92925348f Author: Frank Oltmanns Date: Sat Jun 17 15:10:41 2023 +0200 clk: fractional-divider: tests: Add test suite for edge cases In light of the recent discovery that the fractional divisor approximation does not utilize the full available range for clocks that are flagged CLK_FRAC_DIVIDER_ZERO_BASED [1], implement tests for the edge cases of this clock type. Signed-off-by: Frank Oltmanns Link: https://lore.kernel.org/lkml/20230529133433.56215-1-frank@oltmanns.dev [1] Link: https://lore.kernel.org/r/20230617131041.18313-3-frank@oltmanns.dev [sboyd@kernel.org: Rename suite and tests slightly, drop unused includes, store parent rate to compare instead of repeating equation] Signed-off-by: Stephen Boyd commit 2e9abc6ec108370ad341f98d0e05e02e4e165b5a Author: Frank Oltmanns Date: Sat Jun 17 15:10:40 2023 +0200 clk: fractional-divider: Improve approximation when zero based and export Consider the CLK_FRAC_DIVIDER_ZERO_BASED flag when finding the best approximation for m and n. By doing so, increase the range of valid values for the numerator and denominator by 1. Furthermore, export the approximation function so that users of this function can be compiled as modules. Cc: A.s. Dong Signed-off-by: Frank Oltmanns Link: https://lore.kernel.org/r/20230617131041.18313-2-frank@oltmanns.dev Signed-off-by: Stephen Boyd commit eb53c01873cab75d0bf42e6d685dc5ef3b68d884 Author: David Teigland Date: Thu Oct 12 15:25:37 2023 -0500 MAINTAINERS: Update dlm maintainer and web page Signed-off-by: David Teigland commit a470cb2a06e4cc6b8a5011b0c8da18705429120b Author: Alexander Aring Date: Tue Oct 10 18:04:48 2023 -0400 dlm: slow down filling up processing queue If there is a burst of message the receive worker will filling up the processing queue but where are too slow to process dlm messages. This patch will slow down the receiver worker to keep the buffer on the socket layer to tell the sender to backoff. This is done by a threshold to get the next buffers from the socket after all messages were processed done by a flush_workqueue(). This however only occurs when we have a message burst when we e.g. create 1 million locks. If we put more and more new messages to process in the processqueue we will soon run out of memory. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 6212e4528b248a4bc9b4fe68e029a84689c67461 Author: Alexander Aring Date: Tue Oct 10 18:04:47 2023 -0400 dlm: fix no ack after final message In case of an final DLM message we can't should not send an ack out after the final message. This patch moves the ack message before the messages will be transmitted. If it's the final message and the receiving node turns into DLM_CLOSED state another ack messages will being received and turning the receiving node into DLM_ESTABLISHED again. Fixes: 1696c75f1864 ("fs: dlm: add send ack threshold and append acks to msgs") Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit e759eb3e27e5b624930548f1c0eda90da6e26ee9 Author: Alexander Aring Date: Tue Oct 10 18:04:46 2023 -0400 dlm: be sure we reset all nodes at forced shutdown In case we running in a force shutdown in either midcomms or lowcomms implementation we will make sure we reset all per midcomms node information. Fixes: 63e711b08160 ("fs: dlm: create midcomms nodes when configure") Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 2776635edc7fcd62e03cb2efb93c31f685887460 Author: Alexander Aring Date: Tue Oct 10 18:04:45 2023 -0400 dlm: fix remove member after close call The idea of commit 63e711b08160 ("fs: dlm: create midcomms nodes when configure") is to set the midcomms node lifetime when a node joins or leaves the cluster. Currently we can hit the following warning: [10844.611495] ------------[ cut here ]------------ [10844.615913] WARNING: CPU: 4 PID: 84304 at fs/dlm/midcomms.c:1263 dlm_midcomms_remove_member+0x13f/0x180 [dlm] or running in a state where we hit a midcomms node usage count in a negative value: [ 260.830782] node 2 users dec count -1 The first warning happens when the a specific node does not exists and it was probably removed but dlm_midcomms_close() which is called when a node leaves the cluster. The second kernel log message is probably in a case when dlm_midcomms_addr() is called when a joined the cluster but due fencing a node leaved the cluster without getting removed from the lockspace. If the node joins the cluster and it was removed from the cluster due fencing the first call is to remove the node from lockspaces triggered by the user space. In both cases if the node wasn't found or the user count is zero, we should ignore any additional midcomms handling of dlm_midcomms_remove_member(). Fixes: 63e711b08160 ("fs: dlm: create midcomms nodes when configure") Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit fe9b619e6e94acf0b068fb1a8f658f5a96b8fad7 Author: Alexander Aring Date: Tue Oct 10 18:04:44 2023 -0400 dlm: fix creating multiple node structures This patch will lookup existing nodes instead of always creating them when dlm_midcomms_addr() is called. The idea is here to create midcomms nodes when user space getting informed that nodes joins the cluster. This is the case when dlm_midcomms_addr() is called, however it can be called multiple times by user space to add several address configurations to one node e.g. when using SCTP. Those multiple times need to be filtered out and we doing that by looking up if the node exists before. Due configfs entry it is safe that this function gets only called once at a time. Fixes: 63e711b08160 ("fs: dlm: create midcomms nodes when configure") Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit bc15bec1f8833c2cc166c7713eb89a84e2ecf8a2 Author: Christophe JAILLET Date: Tue Oct 10 18:04:43 2023 -0400 fs: dlm: Remove some useless memset() There is no need to clear the buffer used to build the file name. snprintf() already guarantees that it is NULL terminated and such a (useless) precaution was not done for the first string (i.e ls_debug_rsb_dentry) So, save a few LoC. Signed-off-by: Christophe JAILLET Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit b859e01054354033f480d9df41b0ebc2c7537379 Author: Christophe JAILLET Date: Tue Oct 10 18:04:42 2023 -0400 fs: dlm: Fix the size of a buffer in dlm_create_debug_file() 8 is not the maximum size of the suffix used when creating debugfs files. Let the compiler compute the correct size, and only give a hint about the longest possible string that is used. When building with W=1, this fixes the following warnings: fs/dlm/debug_fs.c: In function ‘dlm_create_debug_file’: fs/dlm/debug_fs.c:1020:58: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] 1020 | snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_waiters", ls->ls_name); | ^ fs/dlm/debug_fs.c:1020:9: note: ‘snprintf’ output between 9 and 73 bytes into a destination of size 72 1020 | snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_waiters", ls->ls_name); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fs/dlm/debug_fs.c:1031:50: error: ‘_queued_asts’ directive output may be truncated writing 12 bytes into a region of size between 8 and 72 [-Werror=format-truncation=] 1031 | snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_queued_asts", ls->ls_name); | ^~~~~~~~~~~~ fs/dlm/debug_fs.c:1031:9: note: ‘snprintf’ output between 13 and 77 bytes into a destination of size 72 1031 | snprintf(name, DLM_LOCKSPACE_LEN + 8, "%s_queued_asts", ls->ls_name); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 541adb0d4d10b ("fs: dlm: debugfs for queued callbacks") Signed-off-by: Christophe JAILLET Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 19b3102c0b5350621e7492281f2be0f071fb7e31 Author: Christophe JAILLET Date: Tue Oct 10 18:04:41 2023 -0400 fs: dlm: Simplify buffer size computation in dlm_create_debug_file() Use sizeof(name) instead of the equivalent, but hard coded, DLM_LOCKSPACE_LEN + 8. This is less verbose and more future proof. Signed-off-by: Christophe JAILLET Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 23e4a49943624dd83199989c852565a3ff760fa7 Author: Sam Protsenko Date: Sat Oct 7 22:36:33 2023 -0500 arm64: dts: exynos: Add reserved memory for pstore on E850-96 Reserve a 2 MiB memory region to record kmsg dumps, console, ftrace and userspace messages. The implemented memory split allows capturing and reading corresponding ring buffers: * dmesg: 6 dumps, 128 KiB each * console: 128 KiB * ftrace: 128 KiB for each of 8 CPUs (1 MiB total) * userspace messages: 128 KiB Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20231008033633.21304-1-semen.protsenko@linaro.org [krzysztof: move the node to alphabetically sorted position] Signed-off-by: Krzysztof Kozlowski commit fbfe616ad40c06d68b83b657a94cd2e709dda37b Author: Hui Wang Date: Sat Oct 7 12:01:17 2023 +0800 ASoC: fsl-asoc-card: Add comment for mclk in the codec_priv Otherwise a warning will be detected as below: warning: Function parameter or member 'mclk' not described in 'codec_priv' Fixes: 1075df4bdeb3 ("ASoC: fsl-asoc-card: add nau8822 support") Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20231007040117.22446-1-hui.wang@canonical.com Signed-off-by: Mark Brown commit 078d3a4b120f82d57778466de62929bb8824b664 Author: Bard Liao Date: Thu Oct 12 15:13:15 2023 -0400 ASoC: rt715: reorder the argument in error log "Failed to set private value: ffffffea <= 6100000 24832" is confusing. It should be "Failed to set private value: 6100000 <= 24832 -22" Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012191315.145411-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit cf77250a679556f39bc3247a68bd75ca399f59d6 Author: Bard Liao Date: Thu Oct 12 15:13:14 2023 -0400 ASoC: rt715-sdca: reorder the argument in error log "Failed to set private value: ffffffea <= 6100000 24832" is confusing. It should be "Failed to set private value: 6100000 <= 24832 -22" Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012191315.145411-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit e4d09de3919bb0ed5327acb238e849f3287f2706 Author: Pierre-Louis Bossart Date: Thu Oct 12 15:18:50 2023 -0400 ASoC: SOF: make .remove callback return void We don't use the returned value and return 0 anyways, let's follow the example of platform drivers and simplify the definitions. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20231012191850.147140-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a2d952ba90de2197a27e1443b783265a91760507 Author: Peter Ujfalusi Date: Thu Oct 12 15:18:49 2023 -0400 ASoC: SOF: ipc4: Dump the notification payload Now that we have notifications with payload (kcontrol change notifications), it is time to add the payload dump on the rx path as well. Reviewed-by: Seppo Ingalsuo Reviewed-by: Ranjani Sridharan Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012191850.147140-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 576a0b71b5b479008dacb3047a346625040f5ac6 Author: Peter Ujfalusi Date: Thu Oct 12 15:18:48 2023 -0400 ASoC: SOF: Intel: hda-dsp: Make sure that no irq handler is pending before suspend In the existing IPC support, the reply to each IPC message is handled in an IRQ thread. The assumption is that the IRQ thread is scheduled without significant delays. On an experimental (iow, buggy) kernel, the IRQ thread dealing with the reply to the last IPC message before powering-down the DSP can be delayed by several seconds. The IRQ thread will proceed with register accesses after the DSP is powered-down which results in a kernel crash. While the bug which causes the delay is not in the audio stack, we must handle such cases with defensive programming to avoid such crashes. Call synchronize_irq() before proceeding to power down the DSP to make sure that no irq thread is pending execution. Closes: https://github.com/thesofproject/linux/issues/4608 Reviewed-by: Guennadi Liakhovetski Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012191850.147140-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3851831f529ec3d7b2c7708b2579bfc00d43733c Author: Arun T Date: Thu Oct 12 15:18:47 2023 -0400 ASoC: SOF: Intel: pci-mtl: use ARL specific firmware definitions Split out firmware definitions for Intel Arrow Lake platforms. Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Signed-off-by: Arun T Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012191850.147140-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3e1756f461edc995fc6f137b4f16d78a6d515385 Author: Brent Lu Date: Thu Oct 12 15:08:26 2023 -0400 ASoC: Intel: sof_ssp_amp: use common module for HDMI link Use intel_board module for Intel HDMI DAI link initialization. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-24-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 89cadbd8d8628a372aa8ffaf45b629b630111563 Author: Brent Lu Date: Thu Oct 12 15:08:25 2023 -0400 ASoC: Intel: sof_rt5682: use common module for HDMI link Use intel_board module for Intel HDMI DAI link initialization. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-23-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 498a4da506a286d9b75e07d375bd928c806d3416 Author: Brent Lu Date: Thu Oct 12 15:08:24 2023 -0400 ASoC: Intel: sof_nau8825: use common module for HDMI link Use intel_board module for Intel HDMI DAI link initialization. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-22-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c9314526ffe8daf70853e406ff96265baf9295a2 Author: Brent Lu Date: Thu Oct 12 15:08:23 2023 -0400 ASoC: Intel: sof_cs42l42: use common module for HDMI link Use intel_board module for Intel HDMI DAI link initialization. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-21-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 7368ae921b1c717bc1a208182995a3804da9f337 Author: Brent Lu Date: Thu Oct 12 15:08:22 2023 -0400 ASoC: Intel: board_helpers: new module for common functions Create a new module to host common functions for machine drivers. This patch supports Intel HDMI DAI link initialization. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-20-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit edb3fea37f37218010002a5b42daf1a6402f8d90 Author: Brent Lu Date: Thu Oct 12 15:08:21 2023 -0400 ASoC: Intel: sof_ssp_amp: use sof_hdmi_private to init HDMI Use sof_hdmi_private structure instead of a link list of sof_hdmi_pcm structure for HDMI dai link initialization since hdac-hdmi support is removed. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-19-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5cfe9ed22e4bb87d9d63383b12a3df025a54387d Author: Brent Lu Date: Thu Oct 12 15:08:20 2023 -0400 ASoC: Intel: sof_sdw: use sof_hdmi_private to init HDMI Use sof_hdmi_private structure instead of a link list of sof_hdmi_pcm structure for HDMI dai link initialization since hdac-hdmi support is removed. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-18-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d8fc817632c8bfb40ddb623d8e52fcc13eca78e4 Author: Brent Lu Date: Thu Oct 12 15:08:19 2023 -0400 ASoC: Intel: sof_rt5682: use sof_hdmi_private to init HDMI Use sof_hdmi_private structure instead of a link list of sof_hdmi_pcm structure for HDMI dai link initialization since hdac-hdmi support is removed. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-17-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 44267e97d0d8899deb8f0db1924b3461f88a2029 Author: Brent Lu Date: Thu Oct 12 15:08:18 2023 -0400 ASoC: Intel: sof_nau8825: use sof_hdmi_private to init HDMI Use sof_hdmi_private structure instead of a link list of sof_hdmi_pcm structure for HDMI dai link initialization since hdac-hdmi support is removed. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-16-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit fa76fcad1d7fa43725814abba503b02871eefd5a Author: Brent Lu Date: Thu Oct 12 15:08:17 2023 -0400 ASoC: Intel: sof_da7219: use sof_hdmi_private to init HDMI Use sof_hdmi_private structure instead of a link list of sof_hdmi_pcm structure for HDMI dai link initialization since hdac-hdmi support is removed. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-15-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9b61ac56dd0546d67babfa3babe134cb26895ab6 Author: Brent Lu Date: Thu Oct 12 15:08:16 2023 -0400 ASoC: Intel: sof_cs42l42: use sof_hdmi_private to init HDMI Use sof_hdmi_private structure instead of a link list of sof_hdmi_pcm structure for HDMI dai link initialization since hdac-hdmi support is removed. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3ceb66edd6911b251f2406fa2044daa8d9f00d73 Author: Brent Lu Date: Thu Oct 12 15:08:15 2023 -0400 ASoC: Intel: sof_hdmi: add common header for HDMI Add a common header for Intel HDMI dai link (idisp) initialization. Declare the sof_hdmi_private structure in machine driver private data and use it to initialize dai link. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 64b9f311865c72fa1b692db1500c8c07db9347b7 Author: Brent Lu Date: Thu Oct 12 15:08:14 2023 -0400 ASoC: Intel: sof_ssp_amp: remove hdac-hdmi support Remove hdac-hdmi support code since we are now using snd-hda-codec-hdmi codec driver for hdmi. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3de206a431deec55190e8bd434cff8cb9d2cfc31 Author: Brent Lu Date: Thu Oct 12 15:08:13 2023 -0400 ASoC: Intel: sof_rt5682: remove hdac-hdmi support Remove hdac-hdmi support code since we are now using snd-hda-codec-hdmi codec driver for hdmi. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3f95969ec478ffd0c40544b1611e82271926377a Author: Brent Lu Date: Thu Oct 12 15:08:12 2023 -0400 ASoC: Intel: sof_nau8825: remove hdac-hdmi support Remove hdac-hdmi support code since we are now using snd-hda-codec-hdmi codec driver for hdmi. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b6019b583066e5237f7e0fd11e63bb9896596dde Author: Brent Lu Date: Thu Oct 12 15:08:11 2023 -0400 ASoC: Intel: sof_da7219: remove hdac-hdmi support Remove hdac-hdmi support code since we are now using snd-hda-codec-hdmi codec driver for hdmi. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 8e7377d66e6885c9256f82cb0c1f009d91e6efb8 Author: Brent Lu Date: Thu Oct 12 15:08:10 2023 -0400 ASoC: Intel: sof_cs42l42: remove hdac-hdmi support Remove hdac-hdmi support code since we are now using snd-hda-codec-hdmi codec driver for hdmi. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 5124d08d0ea49c7f4dda989827d0959e58a22150 Author: Bard Liao Date: Thu Oct 12 15:08:09 2023 -0400 ASoC: Intel: sof_sdw_rt712_sdca: construct cards->components by name_prefix sof_sdw_rt712_sdca is used by rt712 and rt713. Using different cards->components string allow UCM distinguish the two codecs. Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit e5bc0a508881eed7a328dd4dd3efad733d90912c Author: Balamurugan C Date: Thu Oct 12 15:08:08 2023 -0400 ASoC: Intel: MTL: Add entry for HDMI-In capture support to non-I2S codec boards. Adding HDMI-In capture support for the MTL products which doesn't have onboard I2S codec. But need to support HDMI-In capture via I2S and audio playback through HDMI/DP monitor. Reviewed-by: Bard Liao Signed-off-by: Balamurugan C Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b6d6e5abf64562985fdbbdbdfe8088cde634d834 Author: Bard Liao Date: Thu Oct 12 15:08:07 2023 -0400 ASoC: Intel: sof_sdw_rt_sdca_jack_common: add rt713 support Adding rt713 support to sof_sdw_rt_sdca_jack_common.c. Fixes: fbaaf80d8cf6 ("ASoC: Intel: sof_sdw: add rt713 support") Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit e70ca580e9c8d59bc8cf70cb15546da5aecff3a0 Author: Bard Liao Date: Thu Oct 12 15:08:06 2023 -0400 ASoC: Intel: soc-acpi-intel-mtl-match: add rt713 rt1316 config Adding rt713 jack + rt1316 amp + rt1713 dmic configuration support. Reviewed-by: Rander Wang Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 43e354dada62c0425db900f327a6e11babefcf5c Author: Bard Liao Date: Thu Oct 12 15:08:05 2023 -0400 ASoC: Intel: soc-acpi-intel-rpl-match: add rt711-l0-rt1316-l12 support Another configuration that doesn't support DMIC. Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20231012190826.142619-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a5172ef251f03eb18bed9e3f9a5c093679f29e1b Author: Pierre-Louis Bossart Date: Thu Oct 12 15:08:04 2023 -0400 ASoC: Intel: sof_sdw: update HP Omen match New platforms have a slightly different DMI product name, remove trailing characters/digits to handle all cases. Closes: https://github.com/thesofproject/linux/issues/4611 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20231012190826.142619-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b8c60e8fc6f755c2cdf7164931afdbfa670c6646 Author: Thomas Weißschuh Date: Thu Oct 12 00:42:04 2023 +0200 selftests/nolibc: add tests for multi-object linkage While uncommon, nolibc executables can be linked together from multiple compilation units. Add some tests to make sure everything works in that case. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/lkml/20231012-nolibc-linkage-test-v1-1-315e682768b4@weissschuh.net/ Acked-by: Willy Tarreau commit 17362f3d0bd38fd5d152a370c110b0630ac4dc65 Author: Thomas Weißschuh Date: Sun Oct 8 14:34:01 2023 +0200 selftests/nolibc: use qemu-system-ppc64 for ppc64le qemu-system-ppc64 can handle both big and little endian kernels. While some setups, like Debian, provide a symlink to execute qemu-system-ppc64 as qemu-system-ppc64le, others, like ArchLinux, do not. So always use qemu-system-ppc64 directly. Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/lkml/20231008-nolibc-qemu-ppc64-v1-1-29e2326e0420@weissschuh.net/ Acked-by: Willy Tarreau commit 63aa531716268f22f0a60fbb65c005494dcde387 Author: Thomas Weißschuh Date: Thu Oct 5 18:17:29 2023 +0200 tools/nolibc: add support for constructors and destructors With the startup code moved to C, implementing support for constructors and deconstructors is fairly easy to implement. Examples for code size impact: text data bss dec hex filename 21837 104 88 22029 560d nolibc-test.before 22135 120 88 22343 5747 nolibc-test.after 21970 104 88 22162 5692 nolibc-test.after-only-crt.h-changes The sections are defined by [0]. [0] https://refspecs.linuxfoundation.org/elf/gabi4+/ch5.dynamic.html Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau Link: https://lore.kernel.org/lkml/20231007-nolibc-constructors-v2-1-ef84693efbc1@weissschuh.net/ commit eddfc3c74214a7e6f4a3e56ad0cf5dab5d23f287 Author: Thomas Weißschuh Date: Sat Oct 7 12:18:55 2023 +0200 tools/nolibc: drop test for getauxval(AT_PAGESZ) Other testcases are already testing the same functionality: * auxv_AT_UID tests getauxval() in general. * test_getpagesize() tests pagesize() which directly calls getauxval(AT_PAGESZ). Link: https://lore.kernel.org/r/20231007-nolibc-auxval-pagesz-v1-1-af00804edead@weissschuh.net Signed-off-by: Thomas Weißschuh commit eaa8c9a8b4027e4f780ebd2f6d0e91812467f312 Author: Thomas Weißschuh Date: Sun Sep 17 17:36:19 2023 +0200 tools/nolibc: automatically detect necessity to use pselect6 We can automatically detect if pselect6 is needed or not from the kernel headers. This removes the need to manually specify it. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau Link: https://lore.kernel.org/r/20230917-nolibc-syscall-nr-v2-4-03863d509b9a@weissschuh.net commit e7b28f2516a6aec54e2aa1485e4806e8d8431815 Author: Thomas Weißschuh Date: Sun Sep 17 17:36:18 2023 +0200 tools/nolibc: don't define new syscall number All symbols created by nolibc are also visible to user code. Syscall constants are expected to come from the kernel headers and should not be made up by nolibc. Refactor the logic to avoid defining syscall numbers. Also the new code is easier to understand. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau Link: https://lore.kernel.org/r/20230917-nolibc-syscall-nr-v2-3-03863d509b9a@weissschuh.net commit 535b70c143dcca0e236c35cc32fac17a18697764 Author: Thomas Weißschuh Date: Sun Sep 17 17:36:17 2023 +0200 tools/nolibc: avoid unused parameter warnings for ENOSYS fallbacks The ENOSYS fallback code does not use its functions parameters. This can lead to compiler warnings about unused parameters. Explicitly avoid these warnings. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau Link: https://lore.kernel.org/r/20230917-nolibc-syscall-nr-v2-2-03863d509b9a@weissschuh.net commit 9531548675300e313b4e852d90095449c2368fbe Author: Thomas Weißschuh Date: Sun Sep 17 17:36:16 2023 +0200 selftests/nolibc: allow building i386 with multiarch compiler When building with a multiarch-capable compiler, like those provided by common distributions the -m32 argument is required to build 32bit code. Wrap it in cc-option in case the compiler is not multiarch-capable. Signed-off-by: Thomas Weißschuh Acked-by: Willy Tarreau Link: https://lore.kernel.org/r/20230917-nolibc-syscall-nr-v2-1-03863d509b9a@weissschuh.net commit 45839d09910e94254e35b08d1a71cc1206767217 Author: Thomas Weißschuh Date: Sun Sep 17 17:21:38 2023 +0200 selftests/nolibc: don't embed initramfs into kernel image When the initramfs is embedded into the kernel each rebuild of it will trigger a full kernel relink and all the expensive postprocessing steps. Currently nolibc-test and therefore the initramfs are always rebuild, even without source changes, leading to lots of slow kernel relinks. Instead of linking the initramfs into the kernel assemble it manually and pass it explicitly to qemu. This avoids all of the kernel relinks. Signed-off-by: Thomas Weißschuh Reviewed-by: Nicolas Schier Link: https://lore.kernel.org/r/20230917-nolibc-initramfs-v2-1-f0f293a8b198@weissschuh.net commit 4ed03f639e7abe9dd75c9775ee026be33ce1de82 Author: Thomas Weißschuh Date: Sun Sep 10 21:16:42 2023 +0200 selftests/nolibc: libc-test: avoid -Wstringop-overflow warnings Newer versions of glibc annotate the poll() function with __attribute__(access) which triggers a compiler warning inside the testcase poll_fault. Avoid this by using a plain NULL which is enough for the testcase. To avoid potential future warnings also adapt the other EFAULT testcases, except select_fault as NULL is a valid value for its argument. nolibc-test.c: In function ‘run_syscall’: nolibc-test.c:338:62: warning: ‘poll’ writing 8 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=] 338 | do { if (!(cond)) result(llen, SKIPPED); else ret += expect_syserr2(expr, expret, experr1, experr2, llen); } while (0) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nolibc-test.c:341:9: note: in expansion of macro ‘EXPECT_SYSER2’ 341 | EXPECT_SYSER2(cond, expr, expret, experr, 0) | ^~~~~~~~~~~~~ nolibc-test.c:905:47: note: in expansion of macro ‘EXPECT_SYSER’ 905 | CASE_TEST(poll_fault); EXPECT_SYSER(1, poll((void *)1, 1, 0), -1, EFAULT); break; | ^~~~~~~~~~~~ cc1: note: destination object is likely at address zero In file included from /usr/include/poll.h:1, from nolibc-test.c:33: /usr/include/sys/poll.h:54:12: note: in a call to function ‘poll’ declared with attribute ‘access (write_only, 1, 2)’ 54 | extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout) | ^~~~ Signed-off-by: Thomas Weißschuh commit bc61614de044fe298b5f8ba0876bb6f3294c2644 Author: Ammar Faizi Date: Sat Sep 2 20:35:05 2023 +0700 tools/nolibc: string: Remove the `_nolibc_memcpy_up()` function This function is only called by memcpy(), there is no real reason to have this wrapper. Delete this function and move the code to memcpy() directly. Signed-off-by: Ammar Faizi Reviewed-by: Alviro Iskandar Setiawan Signed-off-by: Willy Tarreau Signed-off-by: Thomas Weißschuh commit 5dfc79b20e467f59878c86e9203c5c291d496b45 Author: Ammar Faizi Date: Sat Sep 2 20:35:04 2023 +0700 tools/nolibc: string: Remove the `_nolibc_memcpy_down()` function This nolibc internal function is not used. Delete it. It was probably supposed to handle memmove(), but today the memmove() has its own implementation. Signed-off-by: Ammar Faizi Reviewed-by: Alviro Iskandar Setiawan Signed-off-by: Willy Tarreau Signed-off-by: Thomas Weißschuh commit 12108aa8c1a13bdf4024f1e2e94a6121ac644d2c Author: Ammar Faizi Date: Sat Sep 2 20:35:03 2023 +0700 tools/nolibc: x86-64: Use `rep stosb` for `memset()` Simplify memset() on the x86-64 arch. The x86-64 arch has a 'rep stosb' instruction, which can perform memset() using only a single instruction, given: %al = value (just like the second argument of memset()) %rdi = destination %rcx = length Before this patch: ``` 00000000000010c9 : 10c9: 48 89 f8 mov %rdi,%rax 10cc: 48 85 d2 test %rdx,%rdx 10cf: 74 0e je 10df 10d1: 31 c9 xor %ecx,%ecx 10d3: 40 88 34 08 mov %sil,(%rax,%rcx,1) 10d7: 48 ff c1 inc %rcx 10da: 48 39 ca cmp %rcx,%rdx 10dd: 75 f4 jne 10d3 10df: c3 ret ``` After this patch: ``` 0000000000001511 : 1511: 96 xchg %eax,%esi 1512: 48 89 d1 mov %rdx,%rcx 1515: 57 push %rdi 1516: f3 aa rep stos %al,%es:(%rdi) 1518: 58 pop %rax 1519: c3 ret ``` v2: - Use pushq %rdi / popq %rax (Alviro). - Use xchg %eax, %esi (Willy). Link: https://lore.kernel.org/lkml/ZO9e6h2jjVIMpBJP@1wt.eu Suggested-by: Alviro Iskandar Setiawan Suggested-by: Willy Tarreau Signed-off-by: Ammar Faizi Reviewed-by: Alviro Iskandar Setiawan Signed-off-by: Willy Tarreau Signed-off-by: Thomas Weißschuh commit 553845eebd6003314bde2f40c1721275bfd2bfcd Author: Ammar Faizi Date: Sat Sep 2 20:35:02 2023 +0700 tools/nolibc: x86-64: Use `rep movsb` for `memcpy()` and `memmove()` Simplify memcpy() and memmove() on the x86-64 arch. The x86-64 arch has a 'rep movsb' instruction, which can perform memcpy() using only a single instruction, given: %rdi = destination %rsi = source %rcx = length Additionally, it can also handle the overlapping case by setting DF=1 (backward copy), which can be used as the memmove() implementation. Before this patch: ``` 00000000000010ab : 10ab: 48 89 f8 mov %rdi,%rax 10ae: 31 c9 xor %ecx,%ecx 10b0: 48 39 f7 cmp %rsi,%rdi 10b3: 48 83 d1 ff adc $0xffffffffffffffff,%rcx 10b7: 48 85 d2 test %rdx,%rdx 10ba: 74 25 je 10e1 10bc: 48 83 c9 01 or $0x1,%rcx 10c0: 48 39 f0 cmp %rsi,%rax 10c3: 48 c7 c7 ff ff ff ff mov $0xffffffffffffffff,%rdi 10ca: 48 0f 43 fa cmovae %rdx,%rdi 10ce: 48 01 cf add %rcx,%rdi 10d1: 44 8a 04 3e mov (%rsi,%rdi,1),%r8b 10d5: 44 88 04 38 mov %r8b,(%rax,%rdi,1) 10d9: 48 01 cf add %rcx,%rdi 10dc: 48 ff ca dec %rdx 10df: 75 f0 jne 10d1 10e1: c3 ret 00000000000010e2 : 10e2: 48 89 f8 mov %rdi,%rax 10e5: 48 85 d2 test %rdx,%rdx 10e8: 74 12 je 10fc 10ea: 31 c9 xor %ecx,%ecx 10ec: 40 8a 3c 0e mov (%rsi,%rcx,1),%dil 10f0: 40 88 3c 08 mov %dil,(%rax,%rcx,1) 10f4: 48 ff c1 inc %rcx 10f7: 48 39 ca cmp %rcx,%rdx 10fa: 75 f0 jne 10ec 10fc: c3 ret ``` After this patch: ``` // memmove is an alias for memcpy 000000000040133b : 40133b: 48 89 d1 mov %rdx,%rcx 40133e: 48 89 f8 mov %rdi,%rax 401341: 48 89 fa mov %rdi,%rdx 401344: 48 29 f2 sub %rsi,%rdx 401347: 48 39 ca cmp %rcx,%rdx 40134a: 72 03 jb 40134f 40134c: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) 40134e: c3 ret 40134f: 48 8d 7c 0f ff lea -0x1(%rdi,%rcx,1),%rdi 401354: 48 8d 74 0e ff lea -0x1(%rsi,%rcx,1),%rsi 401359: fd std 40135a: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) 40135c: fc cld 40135d: c3 ret ``` v3: - Make memmove as an alias for memcpy (Willy). - Make the forward copy the likely case (Alviro). v2: - Fix the broken memmove implementation (David). Link: https://lore.kernel.org/lkml/20230902062237.GA23141@1wt.eu Link: https://lore.kernel.org/lkml/5a821292d96a4dbc84c96ccdc6b5b666@AcuMS.aculab.com Suggested-by: David Laight Signed-off-by: Ammar Faizi Signed-off-by: Willy Tarreau Signed-off-by: Thomas Weißschuh commit 265fbb4be0688a56c29cc39552b16001efae35b4 Author: Thomas Weißschuh Date: Wed Aug 30 17:07:13 2023 +0200 selftests/nolibc: use -nostdinc for nolibc-test Avoid any accidental reliance on system includes. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau commit b56a9492d058ac93252e4373f8c87c69df6912ff Author: Thomas Weißschuh Date: Wed Aug 30 17:07:12 2023 +0200 tools/nolibc: add stdarg.h header This allows nolic to work with `-nostdinc` avoiding any reliance on system headers. The implementation has been lifted from musl libc 1.2.4. There is already an implementation of stdarg.h in include/linux/stdarg.h but that is GPL licensed and therefore not suitable for nolibc. The used compiler builtins have been validated to be at least available since GCC 4.1.2 and clang 3.0.0. Signed-off-by: Thomas Weißschuh Signed-off-by: Willy Tarreau commit d4d27e5a1a88f433a4fabf748e00d626be48cd75 Author: Srinivas Pandruvada Date: Mon Oct 9 12:05:38 2023 -0700 selftests/thermel/intel: Add test to read power floor status Some SoCs have firmware support to notify, if the system can't lower power limit to a value requested from user space via RAPL constraints. This test program waits for notification of power floor and prints. This program can be used to test this feature and also allows other user space programs to use as a reference. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit 0e509253924b5eed886029a3b49dcef9f6001c49 Author: Srinivas Pandruvada Date: Mon Oct 9 12:05:37 2023 -0700 thermal: int340x: processor_thermal: Enable power floor support Enable power floor feature support for Meteor Lake processors. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit 8cd5ad18ddc3caab734c376eda5214f01eeb932c Author: Srinivas Pandruvada Date: Mon Oct 9 12:05:36 2023 -0700 thermal: int340x: processor_thermal: Handle power floor interrupts On thermal device interrupt, if the interrupt is generated for passing power floor status, call the callback to pass notification to the user space. First call proc_thermal_check_power_floor_intr() to check interrupt, if this callback returns true, wake the IRQ thread to call proc_thermal_power_floor_intr_callback() to notify user space. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit b473d6a9d68f5bc27c7e35f5c98172d5f2206039 Author: Srinivas Pandruvada Date: Mon Oct 9 12:05:35 2023 -0700 thermal: int340x: processor_thermal: Support power floor notifications When the hardware reduces the power to the minimum possible, the power floor is notified via an interrupt. This can happen when user space requests a power limit via powercap RAPL interface, which forces the system to enter to the lowest power. This power floor indication can be used as a hint to resort to other methods of reducing power than via RAPL power limit. Before power floor status can be read or the firmware can trigger notifications regarding it, it needs to be configured via a mailbox command. The actual power floor status is read via bit 39 of MMIO offset 0x5B18 of the processor thermal PCI device. To show the current power floor status and get notification on a sysfs attribute, add 2 new attributes to /sys/bus/pci/devices/0000\:00\:04.0/power_limits/ power_floor_enable : This attribute is present when power floor notifications are supported. This attribute allows to enable/disable power floor notifications. power_floor_status : This attribute is present when power floor notifications are supported. When enabled via power_floor_enable, this attribute shows the current power floor status. The power floor implementation provides interfaces which are called from the sysfs callbacks to enable/disable and read power floor status. It also provides two additional interfaces to check if the current processor thermal device interrupt is for power floor status and to send notifications to user space. Signed-off-by: Srinivas Pandruvada [ rjw: Changelog and documentation changes edits ] Signed-off-by: Rafael J. Wysocki commit 6ebc25d8b053a208786295bab58abbb66b39c318 Author: Srinivas Pandruvada Date: Mon Oct 9 12:05:34 2023 -0700 thermal: int340x: processor_thermal: Set feature mask before proc_thermal_add The function proc_thermal_add() adds sysfs entries for power limits. The feature mask of available features is not present at that time, so it cannot be used by proc_thermal_add() to selectively create sysfs attributes. The feature mask is set by proc_thermal_mmio_add(), so modify the code to call it before proc_thermal_add() so as to allow the latter to use the feature mask. There is no functional impact with this change. Signed-off-by: Srinivas Pandruvada [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit 088f16f35257becaed1c3deececda6080bc77ee3 Author: Srinivas Pandruvada Date: Mon Oct 9 12:05:33 2023 -0700 thermal: int340x: processor_thermal: Common function to clear SOC interrupt The SOC interrupt status register contains multiple interrupt sources (workload hint interrupt and power floor interrupt). It is not possible to clear individual interrupt source with read-modify-write, as it may clear the new interrupt from the firmware after a read operation. It is also not possible to set the interrupt status bit to 1 for the other interrupt source, which is not part of clearing. Hence, create a common function, to clear all status bits at once. Call this function after processing all interrupt sources. Signed-off-by: Srinivas Pandruvada [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit 24e4c26202801f31392a04965b539e70223d9026 Author: Srinivas Pandruvada Date: Mon Oct 9 12:05:32 2023 -0700 thermal: int340x: processor_thermal: Move interrupt status MMIO offset to common header Move define SOC_WT_RES_INT_STATUS_OFFSET to processor_thermal_device.h. This way it can be reused in other modules. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit ac8b60be078abebc3ab8836f3f0ecac6980e0b4f Author: Lucy Mielke Date: Thu Oct 12 12:44:32 2023 +0200 locking/lockdep: Fix string sizing bug that triggers a format-truncation compiler-warning On an allyesconfig, with "treat warnings as errors" unset, GCC emits these warnings: kernel/locking/lockdep_proc.c:438:32: Warning: Format specifier '%lld' may be truncated when writing 1 to 17 bytes into a region of size 15 [-Wformat-truncation=] kernel/locking/lockdep_proc.c:438:31: Note: Format directive argument is in the range [-9223372036854775, 9223372036854775] kernel/locking/lockdep_proc.c:438:9: Note: 'snprintf' has output between 5 and 22 bytes into a target of size 15 In seq_time(), the longest s64 is "-9223372036854775808"-ish, which converted to the fixed-point float format is "-9223372036854775.80": 21 bytes, plus termination is another byte: 22. Therefore, a larger buffer size of 22 is needed here - not 15. The code was safe due to the snprintf(). Fix it. Signed-off-by: Lucy Mielke Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/ZSfOEHRkZAWaQr3U@fedora.fritz.box commit a09c3e105a208580b9d9c868bac630c9263ff564 Author: Rob Herring Date: Tue Oct 10 15:44:19 2023 +0200 arm64: dts: renesas: Apply overlays to base dtbs DT overlays in tree need to be applied to a base DTB to validate they apply, to run schema checks on them, and to catch any errors at compile time. Signed-off-by: Rob Herring [geert: Add missing base/overlay combinations] Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/44e5c1781b012a38d07a8d2fc68b26b33c3558b6.1696945404.git.geert+renesas@glider.be commit aca0f89bad145c4f1c4d4d60a957de1e4f4522a4 Author: Claudiu Beznea Date: Tue Oct 10 16:27:01 2023 +0300 arm64: dts: renesas: rzg3s-smarc-som: Spelling s/device-type/device_type/ Fix the following DTBS check warnings: arch/arm64/boot/dts/renesas/r9a08g045s33-smarc.dt: /: memory@48000000: 'device-type' does not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/memory.yaml# arch/arm64/boot/dts/renesas/r9a08g045s33-smarc.dtb: /: memory@48000000: 'device_type' is a required property from schema $id: http://devicetree.org/schemas/memory.yaml# Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20231010132701.1658737-7-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit e6115c6f7a0ce3388cc60b69a284facf78b5dbfd Author: Oleg Nesterov Date: Thu Oct 12 16:32:27 2023 +0200 locking/seqlock: Change __seqprop() to return the function pointer This simplifies the macro and makes it easy to add the new seqprop's with 2 or more args. Plus this way we do not lose the type info, the (void*) type cast is no longer needed. And the latter reveals the problem: a lot of seqcount_t helpers pass the "const seqcount_t *s" argument to __seqprop_ptr(seqcount_t *s) but (before this patch) "(void *)(s)" masked the problem. So this patch changes __seqprop_ptr() and __seqprop_##lockname##_ptr() to accept the "const LOCKNAME *s" argument. This is not nice either, they need to drop the constness on return because these helpers are used by both the readers and writers, but at least it is clear what's going on. Signed-off-by: Oleg Nesterov Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Waiman Long Cc: Will Deacon Cc: Thomas Gleixner Cc: Linus Torvalds Cc: Paul E. McKenney Link: https://lore.kernel.org/r/20231012143227.GA16143@redhat.com commit f995443f01b4dbcce723539b99050ce69b319e58 Author: Oleg Nesterov Date: Thu Oct 12 16:31:58 2023 +0200 locking/seqlock: Simplify SEQCOUNT_LOCKNAME() 1. Kill the "lockmember" argument. It is always s->lock plus __seqprop_##lockname##_sequence() already uses s->lock and ignores "lockmember". 2. Kill the "lock_acquire" argument. __seqprop_##lockname##_sequence() can use the same "lockbase" prefix for _lock and _unlock. Apart from line numbers, gcc -E outputs the same code. Signed-off-by: Oleg Nesterov Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Waiman Long Cc: Will Deacon Cc: Thomas Gleixner Cc: Linus Torvalds Cc: Paul E. McKenney Link: https://lore.kernel.org/r/20231012143158.GA16133@redhat.com commit deedec0a152a3d7fa5b04ef9431aeb71802835b5 Author: Borislav Petkov Date: Thu Oct 12 20:01:59 2023 +0200 x86/cpu: Fix the AMD Fam 17h, Fam 19h, Zen2 and Zen4 MSR enumerations The comments introduced in in the merge conflict fixup in: 8f4156d58713 ("Merge branch 'x86/urgent' into perf/core, to resolve conflict") ... aren't right: AMD naming schemes are more complex than implied, family 0x17 is Zen1 and 2, family 0x19 is spread around Zen 3 and 4. So there's indeed four separate MSR namespaces for: MSR_F17H_ MSR_F19H_ MSR_ZEN2_ MSR_ZEN4_ ... and the namespaces cannot be merged. Fix it up. No change in functionality. Signed-off-by: Borislav Petkov (AMD) Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Link: https://lore.kernel.org/r/D99589F4-BC5D-430B-87B2-72C20370CF57@exactcode.com commit d3bff6277087c77a12ae6458d6da44d725f6fbaf Merge: c99626092efca eea6c26207255 Author: Rafael J. Wysocki Date: Thu Oct 12 20:08:28 2023 +0200 Merge branch 'thermal-misc' Merge thermal control changes related to switching over platform drivers to using void remove callbacks. * thermal-misc: (31 commits) thermal: amlogic: Convert to platform remove callback returning void thermal: uniphier: Convert to platform remove callback returning void thermal: ti-bandgap: Convert to platform remove callback returning void thermal: tegra-bpmp: Convert to platform remove callback returning void thermal: soctherm: Convert to platform remove callback returning void thermal: stm: Convert to platform remove callback returning void thermal: sprd: Convert to platform remove callback returning void thermal: spear: Convert to platform remove callback returning void thermal: exynos_tmu: Convert to platform remove callback returning void thermal: rzg2l: Convert to platform remove callback returning void thermal: rockchip: Convert to platform remove callback returning void thermal: rcar: Convert to platform remove callback returning void thermal: rcar_gen3: Convert to platform remove callback returning void thermal: tsens: Convert to platform remove callback returning void thermal: lvts: Convert to platform remove callback returning void thermal: kirkwood: Convert to platform remove callback returning void thermal: k3_j72xx_bandgap: Convert to platform remove callback returning void thermal: k3_bandgap: Convert to platform remove callback returning void thermal: int3406: Convert to platform remove callback returning void thermal: int3403: Convert to platform remove callback returning void ... commit 4bce4bedbe6daa54cf701184601f913a0c00bb1c Author: Claudiu Beznea Date: Tue Oct 10 16:26:57 2023 +0300 clk: renesas: r9a08g045: Add clock and reset support for SDHI1 and SDHI2 Add clock and reset support for the SDHI1 and SDHI2 blocks on the RZ/G3S (R9A08G045) SoC. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20231010132701.1658737-3-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit fd627207aaa782c1fd4224076b56a03a1059f516 Author: Claudiu Beznea Date: Tue Oct 10 16:26:56 2023 +0300 clk: renesas: rzg2l: Use %x format specifier to print CLK_ON_R() Use the %x format specifier to print CLK_ON_R(). This makes debugging easier as the value printed will be hexadecimal like in the hardware manual. Along with it add "0x" in front of the printed value. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20231010132701.1658737-2-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 1d071ea156aaa5942564282d69866596b6de95c9 Author: Claudiu Beznea Date: Tue Oct 10 16:27:01 2023 +0300 arm64: dts: renesas: r9a08g045: Add missing cache-level for L3 cache Fix the following DTBS check warnings: arch/arm64/boot/dts/renesas/r9a08g045s33-smarc.dtb: cache-controller-0: 'cache-level' is a required property from schema $id: http://devicetree.org/schemas/cache.yaml# arch/arm64/boot/dts/renesas/r9a08g045s33-smarc.dtb: cache-controller-0: 'cache-level' is a required property from schema $id: http://devicetree.org/schemas/cache.yaml# arch/arm64/boot/dts/renesas/r9a08g045s33-smarc.dtb: cache-controller-0: Unevaluated properties are not allowed ('cache-size', 'cache-unified' were unexpected) from schema $id: http://devicetree.org/schemas/cache.yaml# Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20231010132701.1658737-7-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 6a35583085a70bbf37e8f905e098a1dae5711165 Author: Claudiu Beznea Date: Tue Oct 10 16:26:58 2023 +0300 arm64: dts: renesas: r9a08g045: Add nodes for SDHI1 and SDHI2 Add DT nodes for SDHI1 and SDHI2 available on RZ/G3S (R9A08G045). Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20231010132701.1658737-4-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit d0c908d2978e0ef3c1ac1357c1c58224a153f8d4 Author: Shekhar Chauhan Date: Wed Oct 11 13:30:39 2023 +0530 drm/i915: Add new DG2 PCI IDs Add recently added PCI IDs for DG2 BSpec: 44477 Signed-off-by: Shekhar Chauhan Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20231011080039.2781048-1-shekhar.chauhan@intel.com commit 37ed36448fcd73be197c87ce291d96eeb4d55c00 Author: Michael Shavit Date: Tue Sep 5 19:49:13 2023 +0800 iommu/arm-smmu-v3-sva: Remove bond refcount Always allocate a new arm_smmu_bond in __arm_smmu_sva_bind and remove the bond refcount since arm_smmu_bond can never be shared across calls to __arm_smmu_sva_bind. The iommu framework will not allocate multiple SVA domains for the same (device/mm) pair, nor will it call set_dev_pasid for a device if a domain is already attached on the given pasid. There's also a one-to-one mapping between MM and PASID. __arm_smmu_sva_bind is therefore never called with the same (device/mm) pair, and so there's no reason to try and normalize allocations of the arm_smmu_bond struct for a (device/mm) pair across set_dev_pasid. Signed-off-by: Michael Shavit Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230905194849.v1.2.Id3ab7cf665bcead097654937233a645722a4cce3@changeid Signed-off-by: Will Deacon commit d912aed14fe412038379b1a90d1ae5a02307e830 Author: Michael Shavit Date: Tue Sep 5 19:49:12 2023 +0800 iommu/arm-smmu-v3-sva: Remove unused iommu_sva handle The __arm_smmu_sva_bind function returned an unused iommu_sva handle that can be removed. Signed-off-by: Michael Shavit Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230905194849.v1.1.Ib483f67c9e2ad90ea2254b4b5ac696e4b68aa638@changeid Signed-off-by: Will Deacon commit ae3059cf95f3bf11695d48b77f00568e87329aae Merge: a31281acc4a4e 9164e4a5af9c5 Author: Jens Axboe Date: Thu Oct 12 11:35:58 2023 -0600 Merge tag 'md-next-20231012' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-6.7/block Pull MD changes from Song: "1. Rewrite mddev_suspend(), by Yu Kuai; 2. Simplify md_seq_ops, by Yu Kuai; 3. Reduce unnecessary locking array_state_store(), by Mariusz Tkaczyk." * tag 'md-next-20231012' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: (23 commits) md: rename __mddev_suspend/resume() back to mddev_suspend/resume() md: remove old apis to suspend the array md: suspend array in md_start_sync() if array need reconfiguration md/raid5: replace suspend with quiesce() callback md/md-linear: cleanup linear_add() md: cleanup mddev_create/destroy_serial_pool() md: use new apis to suspend array before mddev_create/destroy_serial_pool md: use new apis to suspend array for ioctls involed array reconfiguration md: use new apis to suspend array for adding/removing rdev from state_store() md: use new apis to suspend array for sysfs apis md/raid5: use new apis to suspend array md/raid5-cache: use new apis to suspend array md/md-bitmap: use new apis to suspend array for location_store() md/dm-raid: use new apis to suspend array md: add new helpers to suspend/resume and lock/unlock array md: add new helpers to suspend/resume array md: replace is_md_suspended() with 'mddev->suspended' in md_check_recovery() md/raid5-cache: use READ_ONCE/WRITE_ONCE for 'conf->log' md: use READ_ONCE/WRITE_ONCE for 'suspend_lo' and 'suspend_hi' md/raid1: don't split discard io for write behind ... commit f06cc667f79909e9175460b167c277b7c64d3df0 Author: Peter Zijlstra Date: Mon Oct 9 23:04:25 2023 +0200 perf: Optimize perf_cgroup_switch() Namhyung reported that bd2756811766 ("perf: Rewrite core context handling") regresses context switch overhead when perf-cgroup is in use together with 'slow' PMUs like uncore. Specifically, perf_cgroup_switch()'s perf_ctx_disable() / ctx_sched_out() etc.. all iterate the full list of active PMUs for that CPU, even if they don't have cgroup events. Previously there was cgrp_cpuctx_list which linked the relevant PMUs together, but that got lost in the rework. Instead of re-instruducing a similar list, let the perf_event_pmu_context iteration skip those that do not have cgroup events. This avoids growing multiple versions of the perf_event_pmu_context iteration. Measured performance (on a slightly different patch): Before) $ taskset -c 0 ./perf bench sched pipe -l 10000 -G AAA,BBB # Running 'sched/pipe' benchmark: # Executed 10000 pipe operations between two processes Total time: 0.901 [sec] 90.128700 usecs/op 11095 ops/sec After) $ taskset -c 0 ./perf bench sched pipe -l 10000 -G AAA,BBB # Running 'sched/pipe' benchmark: # Executed 10000 pipe operations between two processes Total time: 0.065 [sec] 6.560100 usecs/op 152436 ops/sec Fixes: bd2756811766 ("perf: Rewrite core context handling") Reported-by: Namhyung Kim Debugged-by: Namhyung Kim Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20231009210425.GC6307@noisy.programming.kicks-ass.net commit a16afcc58a8c5ebc65c852faf001f8f61f05e4ef Author: Besar Wicaksono Date: Tue Oct 10 18:48:03 2023 -0500 perf cs-etm: Fix incorrect or missing decoder for raw trace The decoder creation for raw trace uses metadata from the first CPU. On per-cpu mode, this metadata is incorrectly used for every decoder. On per-process/per-thread traces, the first CPU is CPU0. If CPU0 trace is not enabled, its metadata will be marked unused and the decoder is not created. Perf report dump skips the decoding part because the decoder is missing. To fix this, use metadata of the CPU associated with sample object. Signed-off-by: Besar Wicaksono Reviewed-by: James Clark Cc: suzuki.poulose@arm.com Cc: mike.leach@linaro.org Cc: jonathanh@nvidia.com Cc: rwiley@nvidia.com Cc: treding@nvidia.com Cc: vsethi@nvidia.com Cc: ywan@nvidia.com Cc: linux-arm-kernel@lists.infradead.org Cc: coresight@lists.linaro.org Cc: linux-tegra@vger.kernel.org Link: https://lore.kernel.org/r/20231010234803.5419-1-bwicaksono@nvidia.com Signed-off-by: Namhyung Kim commit b84b3f47921568a8172bec77d0370268e9fc62a2 Author: Ian Rogers Date: Mon Oct 9 11:39:20 2023 -0700 perf bpf_counter: Fix a few memory leaks Memory leaks were detected by clang-tidy. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-20-irogers@google.com Signed-off-by: Namhyung Kim commit 105254501770c8952e50c71618fca6a8b63890f1 Author: Ian Rogers Date: Mon Oct 9 11:39:19 2023 -0700 perf header: Fix various error path memory leaks Memory leaks were detected by clang-tidy. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-19-irogers@google.com Signed-off-by: Namhyung Kim commit 97fe038374bdf43fd025ac0e7aebf8bfbdd6d54f Author: Ian Rogers Date: Mon Oct 9 11:39:18 2023 -0700 perf trace-event-info: Avoid passing NULL value to closedir If opendir failed then closedir was passed NULL which is erroneous. Caught by clang-tidy. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-18-irogers@google.com Signed-off-by: Namhyung Kim commit c4b5140c6eac2f757d9706c6c783b60554c48cb7 Author: Ian Rogers Date: Mon Oct 9 11:39:17 2023 -0700 tools api: Avoid potential double free io__getline will free the line on error but it doesn't clear the out argument. This may lead to the line being freed twice, like in tools/perf/util/srcline.c as detected by clang-tidy. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-17-irogers@google.com Signed-off-by: Namhyung Kim commit 7875c72c8b0566590c888a2420d7e8fc12f67154 Author: Ian Rogers Date: Mon Oct 9 11:39:16 2023 -0700 perf parse-events: Fix unlikely memory leak when cloning terms Add missing free on an error path as detected by clang-tidy. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-16-irogers@google.com Signed-off-by: Namhyung Kim commit 1370406d35b45457aae295a6cfce9fae2bbd785e Author: Ian Rogers Date: Mon Oct 9 11:39:15 2023 -0700 perf lock: Fix a memory leak on an error path If a memory allocation fails then the strdup-ed string needs freeing. Detected by clang-tidy. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-15-irogers@google.com Signed-off-by: Namhyung Kim commit 63d471979e49148e59eae0b33a57c12d535e20c6 Author: Ian Rogers Date: Mon Oct 9 11:39:14 2023 -0700 perf svghelper: Avoid memory leak On success path the sib_core and sib_thr values weren't being freed. Detected by clang-tidy. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-14-irogers@google.com Signed-off-by: Namhyung Kim commit ef1aec6000a7364a6c1ef0a6f9cbf8b98b685255 Author: Ian Rogers Date: Mon Oct 9 11:39:13 2023 -0700 perf hists browser: Avoid potential NULL dereference On other code paths browser->he_selection is NULL checked, add a missing case reported by clang-tidy. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-13-irogers@google.com Signed-off-by: Namhyung Kim commit 51e9ea99f9bfe6a9c283d041dbc2c1c0be9c3a0f Author: Ian Rogers Date: Mon Oct 9 11:39:12 2023 -0700 perf hists browser: Reorder variables to reduce padding Address clang-tidy warning: ``` tools/perf/ui/browsers/hists.c:2416:8: warning: Excessive padding in 'struct popup_action' (8 padding bytes, where 0 is optimal). Optimal fields order: time, thread, evsel, fn, ms, socket, rstype, ``` Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-12-irogers@google.com Signed-off-by: Namhyung Kim commit 52a5ad12f2147506899ee83e680ea2a1d763adeb Author: Ian Rogers Date: Mon Oct 9 11:39:11 2023 -0700 perf dlfilter: Be defensive against potential NULL dereference In the unlikely case of having a symbol without a mapping, avoid a NULL dereference that clang-tidy warns about. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-11-irogers@google.com Signed-off-by: Namhyung Kim commit 85f73c377b2ac9988a204b119aebb33ca5c60083 Author: Ian Rogers Date: Mon Oct 9 11:39:10 2023 -0700 perf mem-events: Avoid uninitialized read pmu should be initialized to NULL before perf_pmus__scan loop. Fix and shrink the scope of pmu at the same time. Issue detected by clang-tidy. Fixes: 5752c20f3787 ("perf mem: Scan all PMUs instead of just core ones") Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-10-irogers@google.com Signed-off-by: Namhyung Kim commit b3aa09ee78defd3d2e5f7debb5279f8a92b69749 Author: Ian Rogers Date: Mon Oct 9 11:39:09 2023 -0700 perf jitdump: Avoid memory leak jit_repipe_unwinding_info is called in a loop by jit_process_dump, avoid leaking unwinding_data by free-ing before overwriting. Error detected by clang-tidy. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-9-irogers@google.com Signed-off-by: Namhyung Kim commit e2372136700d460276ca7ff07da523e8f61b69c7 Author: Ian Rogers Date: Mon Oct 9 11:39:08 2023 -0700 perf env: Remove unnecessary NULL tests clang-tidy was warning: ``` util/env.c:334:23: warning: Access to field 'nr_pmu_mappings' results in a dereference of a null pointer (loaded from variable 'env') [clang-analyzer-core.NullDereference] env->nr_pmu_mappings = pmu_num; ``` As functions are called potentially when !env was true. This condition could never be true as it would produce a segv, so remove the unnecessary NULL tests and silence clang-tidy. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-8-irogers@google.com Signed-off-by: Namhyung Kim commit 319d459898ce507dba58c28c17610314d16b7beb Author: Ian Rogers Date: Mon Oct 9 11:39:07 2023 -0700 perf buildid-cache: Fix use of uninitialized value The buildid filename is first determined and then from this the buildid read. If getting the filename fails then the buildid will be used for a later memcmp uninitialized. Detected by clang-tidy. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-7-irogers@google.com Signed-off-by: Namhyung Kim commit da0c884b0756fc97a1c15f4cdb81e0a8490a6d7e Author: Ian Rogers Date: Mon Oct 9 11:39:06 2023 -0700 perf bench uprobe: Fix potential use of memory after free Found by clang-tidy: ``` bench/uprobe.c:98:3: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc] bench_uprobe_bpf__destroy(skel); ``` Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: Nick Desaulniers Cc: Yang Jihong Cc: Huacai Chen Cc: Nathan Chancellor Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Tom Rix Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-6-irogers@google.com Signed-off-by: Namhyung Kim commit b24520ffa9695c7249bdd181cf10bc0a3e365019 Author: Ian Rogers Date: Mon Oct 9 11:39:04 2023 -0700 run-clang-tools: Add pass through checks and and header-filter arguments Add a -checks argument to allow the checks passed to the clang-tool to be set on the command line. Add a pass through -header-filter option. Don't run analysis on non-C or CPP files. Signed-off-by: Ian Rogers Reviewed-by: Nick Desaulniers Cc: Ravi Bangoria Cc: Mark Rutland Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Huacai Chen Cc: Jiri Olsa Cc: Nathan Chancellor Cc: Alexander Shishkin Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Ingo Molnar Cc: Tom Rix Cc: bpf@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-4-irogers@google.com Signed-off-by: Namhyung Kim commit 9e56d3be4bfd2ec6433a7c44195bd1e687b8ed2e Author: Ian Rogers Date: Mon Oct 9 11:39:03 2023 -0700 gen_compile_commands: Sort output compile commands by file name Make the output more stable and deterministic. Signed-off-by: Ian Rogers Reviewed-by: Nick Desaulniers Cc: Ravi Bangoria Cc: Mark Rutland Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Huacai Chen Cc: Jiri Olsa Cc: Nathan Chancellor Cc: Alexander Shishkin Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Ingo Molnar Cc: Tom Rix Cc: bpf@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-3-irogers@google.com Signed-off-by: Namhyung Kim commit 52c15e7e792857c42b4a926e45228e981c5a5f13 Author: Ian Rogers Date: Mon Oct 9 11:39:02 2023 -0700 gen_compile_commands: Allow the line prefix to still be cmd_ Builds in tools still use the cmd_ prefix in .cmd files, so don't require the saved part. Name the groups in the line pattern match so that changing the regular expression is more robust and works with the addition of a new match group. Signed-off-by: Ian Rogers Reviewed-by: Nick Desaulniers Cc: Ravi Bangoria Cc: Mark Rutland Cc: Yang Jihong Cc: Peter Zijlstra Cc: Adrian Hunter Cc: Arnaldo Carvalho de Melo Cc: Huacai Chen Cc: Jiri Olsa Cc: Nathan Chancellor Cc: Alexander Shishkin Cc: Kan Liang Cc: llvm@lists.linux.dev Cc: Ming Wang Cc: Ingo Molnar Cc: Tom Rix Cc: bpf@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org Link: https://lore.kernel.org/r/20231009183920.200859-2-irogers@google.com Signed-off-by: Namhyung Kim commit b20576fd7fe39554b212095c3c0d7a3dff512515 Author: Ian Rogers Date: Wed Sep 27 17:44:31 2023 -0700 perf parse-events: Fix for term values that are raw events Raw events can be strings like 'r0xead' but the 0x is optional so they can also be 'read'. On IcelakeX uncore_imc_free_running has an event called 'read' which may be programmed as: ``` $ perf stat -e 'uncore_imc_free_running/event=read/' -a sleep 1 ``` However, the PE_RAW type isn't allowed on the right of a term, even though in this case we just want to interpret it as a string. This leads to the following error on IcelakeX: ``` $ perf stat -e 'uncore_imc_free_running/event=read/' -a sleep 1 event syntax error: '..nning/event=read/' \___ 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 ``` Fix this by allowing raw types on the right of terms and treat them as strings, just as is already done for PE_LEGACY_CACHE. Make this consistent by just entirely removing name_or_legacy and always using name_or_raw that covers all three cases. Fixes: 6fd1e5191591 ("perf parse-events: Support PMUs for legacy cache events") Signed-off-by: Ian Rogers Cc: James Clark Cc: Kan Liang Link: https://lore.kernel.org/r/20230928004431.1926969-1-irogers@google.com Signed-off-by: Namhyung Kim commit c1783ddfb62420c44cdf4672dad2046f056c624b Author: Arnaldo Carvalho de Melo Date: Thu Oct 5 10:46:26 2023 -0300 perf build: Add missing comment about NO_LIBTRACEEVENT=1 By default perf will fail the build if the development files for libtraceevent are not available. To build perf without libtraceevent support, disabling several features such as 'perf trace', one needs to add NO_LIBTRACEVENT=1 to the make command line. Add the missing comments about that to the tools/perf/Makefile.perf file, just like all the other such command line toggles. Fixes: 378ef0f5d9d7f465 ("perf build: Use libtraceevent from the system") Signed-off-by: Arnaldo Carvalho de Melo Reviewed-by: Ian Rogers Link: https://lore.kernel.org/r/ZR6+MhXtLnv6ow6E@kernel.org Signed-off-by: Namhyung Kim commit 29a2fd7c72b3bd8b67bcee363f8068275a4ef351 Author: Arnaldo Carvalho de Melo Date: Thu Oct 5 10:29:38 2023 -0300 perf symbols: Add 'intel_idle_ibrs' to the list of idle symbols This is a longstanding to do list entry: we need a way to see that a sample took place while in idle state, as the current way to do it is to infer that by the name of the functions that in such state have more samples, IOW: a hack. Maybe we can do flip a bit in samples that take place inside the enter/exit idle section in do_idle()? But till then, add one more :-\ Signed-off-by: Arnaldo Carvalho de Melo Acked-by: Namhyung Kim Cc: Frederic Weisbecker Link: https://lore.kernel.org/r/ZR66Qgbcltt+zG7F@kernel.org Signed-off-by: Namhyung Kim commit 03ff4c6b3e41b3530c6c88cc91a7af599322eb89 Author: Ian Rogers Date: Thu Sep 7 14:05:33 2023 -0700 perf parse-events: Avoid erange from hex numbers We specify that a "num_hex" comprises 1 or more digits, however, that allows strtoull to fail with ERANGE. Limit the number of hex digits to being between 1 and 16. Before: ``` $ perf stat -e 'cpu/rE7574c47490475745/' true perf: util/parse-events.c:215: fix_raw: Assertion `errno == 0' failed. Aborted (core dumped) ``` After: ``` $ perf stat -e 'cpu/rE7574c47490475745/' true event syntax error: 'cpu/rE7574c47490475745/' \___ Bad event or PMU Unable to find PMU or event on a PMU of 'cpu' Initial error: event syntax error: 'cpu/rE7574c47490475745/' \___ unknown term 'rE7574c47490475745' for pmu 'cpu' valid terms: event,pc,edge,offcore_rsp,ldlat,inv,umask,frontend,cmask,config,config1,config2,config3,name,period,percore,metric-id Run 'perf list' for a list of valid events Usage: perf stat [] [] -e, --event event selector. use 'perf list' to list available events ``` Issue found through fuzz testing. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Link: https://lore.kernel.org/r/20230907210533.3712979-1-irogers@google.com Signed-off-by: Namhyung Kim commit 47c09498666056d131b0e507eb65ecf854b10085 Merge: 41cb1126bed15 5e07eb3ab981c Author: Mark Brown Date: Thu Oct 12 17:51:49 2023 +0100 Harden SSP boards and add TDM support Merge series from Amadeusz Sławiński : In quite a few places in code there are checks for number of SSPs present on system, to reduce maintenance burden introduce helper functions allowing to get SSP and TDM from machine board configuration. Current mechanism replaces "%d" present in some routes and widget names with SSP number. However there are also configurations which make use of of TDM number, in which case expected behavior would be to have string in form of SSP:TDM - see implementation of avs_i2s_platform_register() in sound/soc/intel/avs/pcm.c. Implement custom function, which parses string and make use of it when parsing topology. While at it make sure that we generate dynamic names only if there is no multiple SSPs or TDMs defined. Migrate all boards to handle TDM if requested. commit a19d48f7c5d57c0f0405a7d4334d1d38fe9d3c1c Author: Jiasheng Jiang Date: Fri Jun 23 10:27:06 2023 +0800 pstore/platform: Add check for kstrdup Add check for the return value of kstrdup() and return the error if it fails in order to avoid NULL pointer dereference. Fixes: 563ca40ddf40 ("pstore/platform: Switch pstore_info::name to const") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20230623022706.32125-1-jiasheng@iscas.ac.cn Signed-off-by: Kees Cook commit 091ac92dc79e35ba208b022936dc9f13e0bbad7c Author: Andy Shevchenko Date: Wed Oct 11 23:26:38 2023 +0300 hte: tegra194: Switch to LATE_SIMPLE_DEV_PM_OPS() SET_LATE_SYSTEM_SLEEP_PM_OPS is deprecated, replace it with LATE_SYSTEM_SLEEP_PM_OPS() and use pm_sleep_ptr() for setting the driver's pm routines. We can now remove the __maybe_unused qualifier in the suspend and resume functions. Tested-by: Dipen Patel Reviewed-by: Dipen Patel Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20231010151709.4104747-5-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Dipen Patel commit 0b40f91d43f72d52fb2a3f04c018d703e0477cc3 Author: Andy Shevchenko Date: Wed Oct 11 23:26:37 2023 +0300 hte: tegra194: Remove redundant dev_err() There is no need to call the dev_err() function directly to print a custom message when handling an error from platform_get_irq() function as it is going to display an appropriate error message in case of a failure. Reviewed-by: Dipen Patel Tested-by: Dipen Patel Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20231010151709.4104747-4-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Dipen Patel commit 1bbe254e4336c0944dd4fb6f0b8c9665b81de50f Author: Denis Plotnikov Date: Mon Sep 25 15:59:40 2023 +0300 md-cluster: check for timeout while a new disk adding A new disk adding may end up with timeout and a new disk won't be added. Add returning the error in that case. Found by Linux Verification Center (linuxtesting.org) with SVACE Signed-off-by: Denis Plotnikov Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230925125940.1542506-1-den-plotnikov@yandex-team.ru commit faed498d0db78adc1eee6bab3a8480bcb7e17e6e Author: Lukas Bulwahn Date: Thu Oct 12 06:50:40 2023 +0200 hardening: x86: drop reference to removed config AMD_IOMMU_V2 Commit 5a0b11a180a9 ("iommu/amd: Remove iommu_v2 module") removes the config AMD_IOMMU_V2. Remove the reference to this config in the x86 architecture-specific hardening config fragment as well. Signed-off-by: Lukas Bulwahn Reviewed-by: Vasant Hegde Link: https://lore.kernel.org/r/20231012045040.22088-1-lukas.bulwahn@gmail.com Signed-off-by: Kees Cook commit 10c65f97b424fcee439463f933140df2a0022f98 Author: Jeff Johnson Date: Mon Oct 9 09:39:42 2023 -0700 wifi: ath11k: Introduce and use ath11k_sta_to_arsta() Currently, the logic to return an ath11k_sta pointer, given a ieee80211_sta pointer, uses typecasting throughout the driver. In general, conversion functions are preferable to typecasting since using a conversion function allows the compiler to validate the types of both the input and output parameters. ath11k already defines a conversion function ath11k_vif_to_arvif() for a similar conversion. So introduce ath11k_sta_to_arsta() for this use case, and convert all of the existing typecasting to use this function. No functional changes, compile tested only. Signed-off-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231009-ath11k_sta_to_arsta-v1-1-1563e3a307e8@quicinc.com commit 475918e9c4ebda495f507d4b9612999d31512748 Author: Michael Shavit Date: Fri Sep 15 21:17:40 2023 +0800 iommu/arm-smmu-v3: Rename cdcfg to cd_table cdcfg is a confusing name, especially given other variables with the cfg suffix in this driver. cd_table more clearly describes what is being operated on. Tested-by: Nicolin Chen Reviewed-by: Jason Gunthorpe Reviewed-by: Nicolin Chen Signed-off-by: Michael Shavit Link: https://lore.kernel.org/r/20230915211705.v8.9.I5ee79793b444ddb933e8bc1eb7b77e728d7f8350@changeid Signed-off-by: Will Deacon commit 6032f58498b70f80103f467de4213f2ffbc2b062 Author: Michael Shavit Date: Fri Sep 15 21:17:39 2023 +0800 iommu/arm-smmu-v3: Update comment about STE liveness Update the comment to reflect the fact that the STE is not always installed. arm_smmu_domain_finalise_s1 intentionnaly calls arm_smmu_write_ctx_desc while the STE is not installed. Reviewed-by: Nicolin Chen Reviewed-by: Jason Gunthorpe Signed-off-by: Michael Shavit Tested-by: Nicolin Chen Link: https://lore.kernel.org/r/20230915211705.v8.8.I7a8beb615e2520ad395d96df94b9ab9708ee0d9c@changeid Signed-off-by: Will Deacon commit 5e14313df2c8f81e22e62b4cd068ef3ee30914c8 Author: Michael Shavit Date: Fri Sep 15 21:17:38 2023 +0800 iommu/arm-smmu-v3: Cleanup arm_smmu_domain_finalise Remove unused master parameter now that the CD table is allocated elsewhere. Reviewed-by: Nicolin Chen Reviewed-by: Jason Gunthorpe Signed-off-by: Michael Shavit Tested-by: Nicolin Chen Link: https://lore.kernel.org/r/20230915211705.v8.7.Iff18df41564b9df82bf40b3ec7af26b87f08ef6e@changeid Signed-off-by: Will Deacon commit 10e4968cd511e3125cf62574aee950c4012c161a Author: Michael Shavit Date: Fri Sep 15 21:17:37 2023 +0800 iommu/arm-smmu-v3: Move CD table to arm_smmu_master With this change, each master will now own its own CD table instead of sharing one with other masters attached to the same domain. Attaching a stage 1 domain installs CD entries into the master's CD table. SVA writes its CD entries into each master's CD table if the domain is shared across masters. Also add the device to the devices list before writing the CD to the table so that SVA will know that the CD needs to be re-written to this device's CD table as well if it decides to update the CD's ASID concurrently with this function. Tested-by: Nicolin Chen Reviewed-by: Jason Gunthorpe Signed-off-by: Michael Shavit Link: https://lore.kernel.org/r/20230915211705.v8.6.Ice063dcf87d1b777a72e008d9e3406d2bcf6d876@changeid Signed-off-by: Will Deacon commit 24503148c545f08c10de73cc3a3779f1ee7a8fa0 Author: Michael Shavit Date: Fri Sep 15 21:17:36 2023 +0800 iommu/arm-smmu-v3: Refactor write_ctx_desc Update arm_smmu_write_ctx_desc and downstream functions to operate on a master instead of an smmu domain. We expect arm_smmu_write_ctx_desc() to only be called to write a CD entry into a CD table owned by the master. Under the hood, arm_smmu_write_ctx_desc still fetches the CD table from the domain that is attached to the master, but a subsequent commit will move that table's ownership to the master. Note that this change isn't a nop refactor since SVA will call arm_smmu_write_ctx_desc in a loop for every master the domain is attached to despite the fact that they all share the same CD table. This loop may look weird but becomes necessary when the CD table becomes per-master in a subsequent commit. Reviewed-by: Jason Gunthorpe Reviewed-by: Nicolin Chen Signed-off-by: Michael Shavit Tested-by: Nicolin Chen Link: https://lore.kernel.org/r/20230915211705.v8.5.I219054a6cf538df5bb22f4ada2d9933155d6058c@changeid Signed-off-by: Will Deacon commit 1228cc509fc6bf7b10f0c5e202086979e4bbd43a Author: Michael Shavit Date: Fri Sep 15 21:17:35 2023 +0800 iommu/arm-smmu-v3: move stall_enabled to the cd table A domain can be attached to multiple masters with different master->stall_enabled values. The stall bit of a CD entry should follow master->stall_enabled and has an inverse relationship with the STE.S1STALLD bit. The stall_enabled bit does not depend on any property of the domain, so move it out of the arm_smmu_domain struct. Move it to the CD table struct so that it can fully describe how CD entries should be written to it. Reviewed-by: Jason Gunthorpe Reviewed-by: Nicolin Chen Signed-off-by: Michael Shavit Tested-by: Nicolin Chen Link: https://lore.kernel.org/r/20230915211705.v8.4.I5aa89c849228794a64146cfe86df21fb71629384@changeid Signed-off-by: Will Deacon commit e3aad74c51a7012233ebe249c8ed86bb01c4a3f0 Author: Michael Shavit Date: Fri Sep 15 21:17:34 2023 +0800 iommu/arm-smmu-v3: Encapsulate ctx_desc_cfg init in alloc_cd_tables This is slighlty cleaner: arm_smmu_ctx_desc_cfg is initialized in a single function instead of having pieces set ahead-of time by its caller. Reviewed-by: Jason Gunthorpe Reviewed-by: Nicolin Chen Signed-off-by: Michael Shavit Tested-by: Nicolin Chen Link: https://lore.kernel.org/r/20230915211705.v8.3.I875254464d044a8ce8b3a2ad6beb655a4a006456@changeid Signed-off-by: Will Deacon commit 1f8588834016ad9d07880b0055d6583dc4014099 Author: Michael Shavit Date: Fri Sep 15 21:17:33 2023 +0800 iommu/arm-smmu-v3: Replace s1_cfg with cdtab_cfg Remove struct arm_smmu_s1_cfg. This is really just a CD table with a bit of extra information. Move other attributes of the CD table that were held there into the existing CD table structure, struct arm_smmu_ctx_desc_cfg, and replace all usages of arm_smmu_s1_cfg with arm_smmu_ctx_desc_cfg. For clarity, use the name "cd_table" for the variables pointing to arm_smmu_ctx_desc_cfg in the new code instead of cdcfg. A later patch will make this fully consistent. Reviewed-by: Jason Gunthorpe Reviewed-by: Nicolin Chen Signed-off-by: Michael Shavit Tested-by: Nicolin Chen Link: https://lore.kernel.org/r/20230915211705.v8.2.I1ef1ed19d7786c8176a0d05820c869e650c8d68f@changeid Signed-off-by: Will Deacon commit 987a878e09c6c22b9c1a517900bd94d5ed0cc459 Author: Michael Shavit Date: Fri Sep 15 21:17:32 2023 +0800 iommu/arm-smmu-v3: Move ctx_desc out of s1_cfg arm_smmu_s1_cfg (and by extension arm_smmu_domain) owns both a CD table and the CD inserted into that table's non-pasid CD entry. This limits arm_smmu_domain's ability to represent non-pasid domains, where multiple domains need to be inserted into a common CD table. Rather than describing an STE entry (which may have multiple domains installed into it with PASID), a domain should describe a single CD entry instead. This is precisely the role of arm_smmu_ctx_desc. A subsequent commit will also move the CD table outside of arm_smmu_domain. Reviewed-by: Jason Gunthorpe Reviewed-by: Nicolin Chen Signed-off-by: Michael Shavit Tested-by: Nicolin Chen Link: https://lore.kernel.org/r/20230915211705.v8.1.I67ab103c18d882aedc8a08985af1fba70bca084e@changeid Signed-off-by: Will Deacon commit 480d230bef0ecd06e72ae3a84117142e38e77503 Author: Jeff Johnson Date: Mon Oct 9 09:36:54 2023 -0700 wifi: ath11k: Remove unused struct ath11k_htc_frame struct ath11k_htc_frame is unused, and since it illogically contains two consecutive flexible arrays, it could never be used, so remove it. No functional changes, compile tested only. Signed-off-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231009-ath11k_htc_frame-v1-1-81d405b7a195@quicinc.com commit c42c2b8224c40f91f5f4984cc721d33ab10c7d43 Author: Wen Gong Date: Tue Oct 10 10:27:21 2023 +0300 wifi: ath12k: fix invalid m3 buffer address This is to fix m3 buffer reuse issue as m3_mem->size isn't set to zero in the free function, which leads invalid m3 downloading to firmware and firmware crashing. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230721055305.20420-4-quic_wgong@quicinc.com commit 92448f8718baf8a8a940c210f04d0787a52e7507 Author: Wen Gong Date: Tue Oct 10 10:27:21 2023 +0300 wifi: ath12k: add ath12k_qmi_free_resource() for recovery ath12k_qmi_free_target_mem_chunk() and ath12k_qmi_m3_free() is static in qmi.c, they are needed for recovery, export them in a new function Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230721055305.20420-3-quic_wgong@quicinc.com commit ae3ed72020de04dbdda5206757917117ff3a605f Author: Wen Gong Date: Tue Oct 10 10:27:20 2023 +0300 wifi: ath12k: configure RDDM size to MHI for device recovery RDDM is Ram Dump Debug Module which is used to debug issues when the firmware encounters an error. The rddm_size is needed by the firmware while MHI goes to the RDDM state. Provide the size to MHI subsystem so that the firmware restart works when the firmware crashes. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230721055305.20420-2-quic_wgong@quicinc.com commit 29ea0d40910391e95c49917a180214a9f4cea9fa Author: Aditya Kumar Singh Date: Tue Oct 10 10:27:19 2023 +0300 wifi: ath12k: add parsing of phy bitmap for reg rules Certain regulatory domains could put restrictions on phy mode operation. For example, in a few countries HE/EHT Operation is not allowed. For such countries, firmware indicates this via phy bitmap in each reg rule. Currently, there is no logic to parse this info and then pass it on to the cfg80211/regulatory. Add parsing of this phy bitmap from the regulatory channel change event and then accordingly map it to cfg80211/regulatory flags and pass it on to it. While at it, correct typo in debug print: s/dsf/dfs. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004092818.25130-1-quic_adisi@quicinc.com commit 534c2dd8099a9cc4bad8ea8b3c7fa1f730e10d5d Author: Aditya Kumar Singh Date: Tue Oct 10 10:27:19 2023 +0300 wifi: ath11k: add parsing of phy bitmap for reg rules Certain regulatory domains could put restrictions on phy mode operation. For example, in a few countries HE Operation is not allowed. For such countries, firmware indicates this via phy bitmap in each reg rule. Currently, there is no logic to parse this info and then pass it on to the cfg80211/regulatory. Add parsing of this phy bitmap from the regulatory channel change event and then accordingly map it to cfg80211/regulatory flags and pass it on to it. While at it, correct typo in debug print s/dsf/dfs. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004092655.25020-1-quic_adisi@quicinc.com commit a47111663491ff2829df0626493ce81b48dd880a Author: Kalle Valo Date: Tue Oct 10 09:22:50 2023 +0300 wifi: ath11k: ath11k_debugfs_register(): fix format-truncation warning In v6.6-rc4 with GCC 13.2 I see a new warning: drivers/net/wireless/ath/ath11k/debugfs.c: In function 'ath11k_debugfs_register': drivers/net/wireless/ath/ath11k/debugfs.c:1597:51: error: '%d' directive output may be truncated writing between 1 and 3 bytes into a region of size 2 [-Werror=format-truncation=] drivers/net/wireless/ath/ath11k/debugfs.c:1597:48: note: directive argument in the range [0, 255] drivers/net/wireless/ath/ath11k/debugfs.c:1597:9: note: 'snprintf' output between 5 and 7 bytes into a destination of size 5 Increase the size of pdev_name to 10 bytes to make sure there's enough room for the string. Also change the format to '%u' as ar->pdev_idx is u8. Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231010062250.2580951-1-kvalo@kernel.org commit a640d888953cd18e8542283653c20160b601d69d Author: Thomas Weißschuh Date: Thu Oct 12 16:30:38 2023 +0200 const_structs.checkpatch: add xattr_handler Now that the vfs can handle "const struct xattr_handler" make sure that new usages of the struct already enter the tree as const. Link: https://lore.kernel.org/lkml/20230930050033.41174-1-wedsonaf@gmail.com/ Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20231012-vfs-xattr_const-v1-1-6c21e82d4d5e@weissschuh.net Signed-off-by: Christian Brauner commit d680063482885c15d68e958212c3d6ad40a510dd Author: Hannes Reinecke Date: Thu Oct 12 14:22:48 2023 +0200 nvme: rework NVME_AUTH Kconfig selection Having a single Kconfig symbol NVME_AUTH conflates the selection of the authentication functions from nvme/common and nvme/host, causing kbuild robot to complain when building the nvme target only. So introduce a Kconfig symbol NVME_HOST_AUTH for the nvme host bits and use NVME_AUTH for the common functions only. And move the CRYPTO selection into nvme/common to make it easier to read. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310120733.TlPOVeJm-lkp@intel.com/ Signed-off-by: Hannes Reinecke Signed-off-by: Keith Busch commit c6e8f898f56fae2cb5bc4396bec480f23cd8b066 Author: David Sterba Date: Fri Sep 29 21:18:44 2023 +0200 btrfs: open code timespec64 in struct btrfs_inode The type of timespec64::tv_nsec is 'unsigned long', while we have only u32 for on-disk and in-memory. This wastes a few bytes in btrfs_inode. Add separate members for sec and nsec with the corresponding type width. This creates a 4 byte hole in btrfs_inode which can be utilized in the future. Signed-off-by: David Sterba commit cc687c2ef43db15d5ad9a57d93c1b348726feb97 Author: Filipe Manana Date: Mon Oct 9 13:01:43 2023 +0100 btrfs: remove redundant log root tree index assignment during log sync During log syncing, when we start updating the log root tree we compute an index value, stored in variable 'index2', once we lock the log root tree's mutex. This value depends on the log root's log_transid. And shortly after we compute again the same value for 'index2' - the value is exactly the same since we haven't released the mutex and therefore the log_transid of the log root is the same as before. This second 'index2' computation became pointless after commit a93e01682e28 ("btrfs: remove no longer needed use of log_writers for the log root tree"). So remove it. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit a666ce9babf2e3ade3809163ccc81d5805bb503b Author: Colin Ian King Date: Fri Aug 18 14:55:25 2023 +0100 btrfs: remove redundant initialization of variable dirty in btrfs_update_time() The variable dirty is initialized with a value that is never read, it is being re-assigned later on. Remove the redundant initialization. Cleans up clang scan build warning: fs/btrfs/inode.c:5965:7: warning: Value stored to 'dirty' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Reviewed-by: David Sterba Signed-off-by: David Sterba commit f3623740068e548b7c6fdb42171c118189d0e03f Author: Anand Jain Date: Wed Oct 4 23:00:27 2023 +0800 btrfs: sysfs: show temp_fsid feature This adds sysfs objects to indicate temp_fsid feature support and its status. /sys/fs/btrfs/features/temp_fsid /sys/fs/btrfs//temp_fsid For example: Consider two cloned and mounted devices. $ blkid /dev/sdc[1-2] /dev/sdc1: UUID="509ad44b-ad2a-4a8a-bc8d-fe69db7220d5" .. /dev/sdc2: UUID="509ad44b-ad2a-4a8a-bc8d-fe69db7220d5" .. One gets actual fsid, and the other gets the temp_fsid when mounted. $ btrfs filesystem show -m Label: none uuid: 509ad44b-ad2a-4a8a-bc8d-fe69db7220d5 Total devices 1 FS bytes used 54.14MiB devid 1 size 300.00MiB used 144.00MiB path /dev/sdc1 Label: none uuid: 33bad74e-c91b-43a5-aef8-b3cab97ae63a Total devices 1 FS bytes used 54.14MiB devid 1 size 300.00MiB used 144.00MiB path /dev/sdc2 Their sysfs as below. $ cat /sys/fs/btrfs/features/temp_fsid 0 $ cat /sys/fs/btrfs/509ad44b-ad2a-4a8a-bc8d-fe69db7220d5/temp_fsid 0 $ cat /sys/fs/btrfs/33bad74e-c91b-43a5-aef8-b3cab97ae63a/temp_fsid 1 Signed-off-by: Anand Jain Signed-off-by: David Sterba commit ac6ea6a914ed477902ceed64e988a493b52c6c71 Author: Anand Jain Date: Wed Oct 4 23:00:26 2023 +0800 btrfs: disable the device add feature for temp-fsid The device addition operation will transform the cloned temp-fsid mounted device into a multi-device filesystem. Therefore, it is marked as unsupported. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit c47b02c1bddf7c4d56e01bccc99e73ae5309fe07 Author: Anand Jain Date: Wed Oct 4 23:00:25 2023 +0800 btrfs: disable the seed feature for temp-fsid A seed device is an integral component of the sprout device, which functions as a multi-device filesystem. Therefore, temp-fsid feature is not supported. Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 000331bb0350366219887d14ae8a921ae9e72269 Author: Anand Jain Date: Wed Oct 4 23:00:24 2023 +0800 btrfs: update comment for temp-fsid, fsid, and metadata_uuid Update the comment to explain the relationship between temp_fsid, fsid, and metadata_uuid. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3cf63ddf29f94cfedae12a6ebebeaedbfc5d5de1 Author: Filipe Manana Date: Thu Oct 5 12:11:09 2023 +0100 btrfs: remove pointless empty log context list check when syncing log When syncing the log, if we get an error when updating the log root, we check first if the log root tree context is in a log context list, and if so it deletes from the log root tree context from the list. This check however is pointless because at this moment the context is always in a list, he have just added it to a context list. The check became pointless after commit a93e01682e28 ("btrfs: remove no longer needed use of log_writers for the log root tree"). So remove this now pointless empty list check. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 68539bd0e73b457f88a9d00cabb6533ec8582dc9 Author: Filipe Manana Date: Wed Oct 4 11:38:53 2023 +0100 btrfs: update comment for struct btrfs_inode::lock Update the comment for the lock named "lock" in struct btrfs_inode because it does not mention that the fields "delalloc_bytes", "defrag_bytes", "csum_bytes", "outstanding_extents" and "disk_i_size" are also protected by that lock. Also add a comment on top of each field protected by this lock to mention that the lock protects them. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5ca1949b79f3b02215f1c075bf178fceeadda352 Author: Filipe Manana Date: Wed Oct 4 11:38:52 2023 +0100 btrfs: remove pointless barrier from btrfs_sync_file() The memory barrier (smp_mb()) at btrfs_sync_file() is completely redundant now that fs_info->last_trans_committed is read using READ_ONCE(), with the helper btrfs_get_last_trans_committed(), and written using WRITE_ONCE() with the helper btrfs_set_last_trans_committed(). This barrier was introduced in 2011, by commit a4abeea41adf ("Btrfs: kill trans_mutex"), but even back then it was not correct since the writer side (in btrfs_commit_transaction()), did not issue a pairing memory barrier after it updated fs_info->last_trans_committed. So remove this barrier. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0124855ff18b9bdfe6aec87f7b29d3fdc6f575db Author: Filipe Manana Date: Wed Oct 4 11:38:51 2023 +0100 btrfs: add and use helpers for reading and writing last_trans_committed Currently the last_trans_committed field of struct btrfs_fs_info is modified and read without any locking or other protection. For example early in the fsync path, skip_inode_logging() is called which reads fs_info->last_trans_committed, but at the same time we can have a transaction commit completing and updating that field. In the case of an fsync this is harmless and any data race should be rare and at most cause an unnecessary logging of an inode. To avoid data race warnings from tools like KCSAN and other issues such as load and store tearing (amongst others, see [1]), create helpers to access the last_trans_committed field of struct btrfs_fs_info using READ_ONCE() and WRITE_ONCE(), and use these helpers everywhere. [1] https://lwn.net/Articles/793253/ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4a4f8fe2b0230c22aba40c9f8ea7b9c6fcfc8417 Author: Filipe Manana Date: Wed Oct 4 11:38:50 2023 +0100 btrfs: add and use helpers for reading and writing fs_info->generation Currently the generation field of struct btrfs_fs_info is always modified while holding fs_info->trans_lock locked. Most readers will access this field without taking that lock but while holding a transaction handle, which is safe to do due to the transaction life cycle. However there are other readers that are neither holding the lock nor holding a transaction handle open: 1) When reading an inode from disk, at btrfs_read_locked_inode(); 2) When reading the generation to expose it to sysfs, at btrfs_generation_show(); 3) Early in the fsync path, at skip_inode_logging(); 4) When creating a hole at btrfs_cont_expand(), during write paths, truncate and reflinking; 5) In the fs_info ioctl (btrfs_ioctl_fs_info()); 6) While mounting the filesystem, in the open_ctree() path. In these cases it's safe to directly read fs_info->generation as no one can concurrently start a transaction and update fs_info->generation. In case of the fsync path, races here should be harmless, and in the worst case they may cause a fsync to log an inode when it's not really needed, so nothing bad from a functional perspective. In the other cases it's not so clear if functional problems may arise, though in case 1 rare things like a load/store tearing [1] may cause the BTRFS_INODE_NEEDS_FULL_SYNC flag not being set on an inode and therefore result in incorrect logging later on in case a fsync call is made. To avoid data race warnings from tools like KCSAN and other issues such as load and store tearing (amongst others, see [1]), create helpers to access the generation field of struct btrfs_fs_info using READ_ONCE() and WRITE_ONCE(), and use these helpers where needed. [1] https://lwn.net/Articles/793253/ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6008859b6c6ea0991f530b125132174893903e3b Author: Filipe Manana Date: Wed Oct 4 11:38:49 2023 +0100 btrfs: add and use helpers for reading and writing log_transid Currently the log_transid field of a root is always modified while holding the root's log_mutex locked. Most readers of a root's log_transid are also holding the root's log_mutex locked, however there is one exception which is btrfs_set_inode_last_trans() where we don't take the lock to avoid blocking several operations if log syncing is happening in parallel. Any races here should be harmless, and in the worst case they may cause a fsync to log an inode when it's not really needed, so nothing bad from a functional perspective. To avoid data race warnings from tools like KCSAN and other issues such as load and store tearing (amongst others, see [1]), create helpers to access the log_transid field of a root using READ_ONCE() and WRITE_ONCE(), and use these helpers where needed. [1] https://lwn.net/Articles/793253/ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit f9850787969953552266da579d0f1fbf2c2e1c10 Author: Filipe Manana Date: Wed Oct 4 11:38:48 2023 +0100 btrfs: add and use helpers for reading and writing last_log_commit Currently, the last_log_commit of a root can be accessed concurrently without any lock protection. Readers can be calling btrfs_inode_in_log() early in a fsync call, which reads a root's last_log_commit, while a writer can change the last_log_commit while a log tree if being synced, at btrfs_sync_log(). Any races here should be harmless, and in the worst case they may cause a fsync to log an inode when it's not really needed, so nothing bad from a functional perspective. To avoid data race warnings from tools like KCSAN and other issues such as load and store tearing (amongst others, see [1]), create helpers to access the last_log_commit field of a root using READ_ONCE() and WRITE_ONCE(), and use these helpers everywhere. [1] https://lwn.net/Articles/793253/ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit a5b8a5f9f8355d27a4f8d0afa93427f16d2f3c1e Author: Anand Jain Date: Thu Sep 28 09:09:47 2023 +0800 btrfs: support cloned-device mount capability Guilherme's previous work [1] aimed at the mounting of cloned devices using a superblock flag SINGLE_DEV during mkfs. [1] https://lore.kernel.org/linux-btrfs/20230831001544.3379273-1-gpiccoli@igalia.com/ Building upon this work, here is in memory only approach. As it mounts we determine if the same fsid is already mounted if then we generate a random temp fsid which shall be used the mount, in memory only not written to the disk. We distinguish devices by devt. Example: $ fallocate -l 300m ./disk1.img $ mkfs.btrfs -f ./disk1.img $ cp ./disk1.img ./disk2.img $ cp ./disk1.img ./disk3.img $ mount -o loop ./disk1.img /btrfs $ mount -o ./disk2.img /btrfs1 $ mount -o ./disk3.img /btrfs2 $ btrfs fi show -m Label: none uuid: 4a212b48-1bec-46a5-938a-783c8c1f0b02 Total devices 1 FS bytes used 144.00KiB devid 1 size 300.00MiB used 88.00MiB path /dev/loop0 Label: none uuid: adabf2fe-5515-4ad0-95b4-7b1609218c16 Total devices 1 FS bytes used 144.00KiB devid 1 size 300.00MiB used 88.00MiB path /dev/loop1 Label: none uuid: 1d77d0df-7d92-439e-adbd-20b9b86fdedb Total devices 1 FS bytes used 144.00KiB devid 1 size 300.00MiB used 88.00MiB path /dev/loop2 Co-developed-by: Guilherme G. Piccoli Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 69d427f34ca0970c2280cccd64e24aa62ff7904a Author: Anand Jain Date: Thu Sep 28 09:09:46 2023 +0800 btrfs: add helper function find_fsid_by_disk In preparation for adding support to mount multiple single-disk btrfs filesystems with the same FSID, wrap find_fsid() into find_fsid_by_disk(). Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 9ef17228e1096e7e75bdde752ae1f0e9a5bcc8ab Author: Filipe Manana Date: Thu Sep 28 11:12:50 2023 +0100 btrfs: stop reserving excessive space for block group item insertions Space for block group item insertions, necessary after allocating a new block group, is reserved in the delayed refs block reserve. Currently we do this by incrementing the transaction handle's delayed_ref_updates counter and then calling btrfs_update_delayed_refs_rsv(), which will increase the size of the delayed refs block reserve by an amount that corresponds to the same amount we use for delayed refs, given by btrfs_calc_delayed_ref_bytes(). That is an excessive amount because it corresponds to the amount of space needed to insert one item in a btree (btrfs_calc_insert_metadata_size()) times 2 when the free space tree feature is enabled. All we need is an amount as given by btrfs_calc_insert_metadata_size(), since we only need to insert a block group item in the extent tree (or block group tree if this feature is enabled). By using btrfs_calc_insert_metadata_size() we will need to reserve 2 times less space when using the free space tree, putting less pressure on space reservation. So use helpers to reserve and release space for block group item insertions that use btrfs_calc_insert_metadata_size() for calculation of the space. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit f66e0209bd914465c277c259472aa974cad94e3f Author: Filipe Manana Date: Thu Sep 28 11:12:49 2023 +0100 btrfs: stop reserving excessive space for block group item updates Space for block group item updates, necessary after allocating or deallocating an extent from a block group, is reserved in the delayed refs block reserve. Currently we do this by incrementing the transaction handle's delayed_ref_updates counter and then calling btrfs_update_delayed_refs_rsv(), which will increase the size of the delayed refs block reserve by an amount that corresponds to the same amount we use for delayed refs, given by btrfs_calc_delayed_ref_bytes(). That is an excessive amount because it corresponds to the amount of space needed to insert one item in a btree (btrfs_calc_insert_metadata_size()) times 2 when the free space tree feature is enabled. All we need is an amount as given by btrfs_calc_metadata_size(), since we only need to update an existing block group item in the extent tree (or block group tree if this feature is enabled). By using btrfs_calc_metadata_size() we will need to reserve 4 times less space when using the free space tree and 2 times less space when not using it, putting less pressure on space reservation. So use helpers to reserve and release space for block group item updates that use btrfs_calc_metadata_size() for calculation of the space. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 398fb9131f31bd25aa187613c9942f4232e952b7 Author: David Sterba Date: Wed Sep 27 21:04:32 2023 +0200 btrfs: reorder btrfs_inode to fill gaps Previous commit created a hole in struct btrfs_inode, we can move outstanding_extents there. This reduces size by 8 bytes from 1120 to 1112 on a release config. Signed-off-by: David Sterba commit 54c65371464e6e676494473dd258d7c337146a35 Author: David Sterba Date: Wed Sep 27 14:22:39 2023 +0200 btrfs: open code btrfs_ordered_inode_tree in btrfs_inode The structure btrfs_ordered_inode_tree is used only in one place, in btrfs_inode. The structure itself has a 4 byte hole which is wasted space. Move the btrfs_ordered_inode_tree members to btrfs_inode with a common prefix 'ordered_tree_' where the hole can be utilized and shrink inode size. Signed-off-by: David Sterba commit cb6cbab79055ca207ad88bc54226b48ececdcef0 Author: Josef Bacik Date: Wed Sep 27 13:47:01 2023 -0400 btrfs: adjust overcommit logic when very close to full A user reported some unpleasant behavior with very small file systems. The reproducer is this $ mkfs.btrfs -f -m single -b 8g /dev/vdb $ mount /dev/vdb /mnt/test $ dd if=/dev/zero of=/mnt/test/testfile bs=512M count=20 This will result in usage that looks like this Overall: Device size: 8.00GiB Device allocated: 8.00GiB Device unallocated: 1.00MiB Device missing: 0.00B Device slack: 2.00GiB Used: 5.47GiB Free (estimated): 2.52GiB (min: 2.52GiB) Free (statfs, df): 0.00B Data ratio: 1.00 Metadata ratio: 1.00 Global reserve: 5.50MiB (used: 0.00B) Multiple profiles: no Data,single: Size:7.99GiB, Used:5.46GiB (68.41%) /dev/vdb 7.99GiB Metadata,single: Size:8.00MiB, Used:5.77MiB (72.07%) /dev/vdb 8.00MiB System,single: Size:4.00MiB, Used:16.00KiB (0.39%) /dev/vdb 4.00MiB Unallocated: /dev/vdb 1.00MiB As you can see we've gotten ourselves quite full with metadata, with all of the disk being allocated for data. On smaller file systems there's not a lot of time before we get full, so our overcommit behavior bites us here. Generally speaking data reservations result in chunk allocations as we assume reservation == actual use for data. This means at any point we could end up with a chunk allocation for data, and if we're very close to full we could do this before we have a chance to figure out that we need another metadata chunk. Address this by adjusting the overcommit logic. Simply put we need to take away 1 chunk from the available chunk space in case of a data reservation. This will allow us to stop overcommitting before we potentially lose this space to a data allocation. With this fix in place we properly allocate a metadata chunk before we're completely full, allowing for enough slack space in metadata. Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 6f2d3c01960a68bfdfae14a8dc54dd7904ab61ed Author: Josef Bacik Date: Wed Sep 27 13:47:00 2023 -0400 btrfs: increase ->free_chunk_space in btrfs_grow_device My overcommit patch exposed a bug with btrfs/177 [1]. The problem here is that when we grow the device we're not adding to ->free_chunk_space, so subsequent allocations can cause ->free_chunk_space to wrap, which causes problems in can_overcommit because we add this to ->total_bytes, which causes the counter to wrap and gives us an unexpected ENOSPC. Fix this by properly updating ->free_chunk_space with the new available space in btrfs_grow_device. [1] First version of the fix: https://lore.kernel.org/linux-btrfs/b97e47ce0ce1d41d221878de7d6090b90aa7a597.1695065233.git.josef@toxicpanda.com/ Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit e9fd2c05239ae423af45f99e2964ad086f800e33 Author: Josef Bacik Date: Wed Sep 27 13:46:59 2023 -0400 btrfs: fix ->free_chunk_space math in btrfs_shrink_device There are two bugs in how we adjust ->free_chunk_space in btrfs_shrink_device. First we're removing the entire diff between new_size and old_size from ->free_chunk_space. This only works if we're reducing the free area, which we could potentially not be. So adjust the math to only subtract the diff in the free space from ->free_chunk_space. Additionally in the error case we're unconditionally adding the diff back into ->free_chunk_space, which we need to only do if this device is writeable. Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit efba1454493df546dcee603c4b77db3a230ac054 Author: Filipe Manana Date: Fri Sep 22 11:39:09 2023 +0100 btrfs: make sure we cache next state in find_first_extent_bit() Currently, at find_first_extent_bit(), when we are given a cached extent state that happens to have its end offset match the desired range start, we find the next extent state using that cached state, with next_state() calls, and then return it. We then try to cache that next state by calling cache_state_if_flags(), but that will not cache the state because we haven't reset *cached_state to NULL, so we end up with the cached_state unchanged, and if the caller is iterating over extent states in the io tree, its next call to find_first_extent_bit() will not use the current cached state as its end offset does not match the minimum start range offset, therefore the cached state is reset and we have to search the rbtree to find the next suitable extent state record. So fix this by resetting the cached state to NULL (and dropping our ref on it) when we have a suitable cached state and we found a next state by using next_state() starting from the cached state. This makes use cases of calling find_first_extent_bit() to go over all ranges in the io tree to do a single rbtree full search, only on the first call, and the next calls will just do next_state() (rb_next() wrapper) calls, which is more efficient. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0f8ac74d41c01700dbd1240bc4de9700fb281753 Author: Filipe Manana Date: Fri Sep 22 11:39:08 2023 +0100 btrfs: use extent_io_tree_release() to empty dirty log pages When freeing a log tree, during a transaction commit, we clear its dirty log pages io tree by calling clear_extent_bits() using a range from 0 to (u64)-1. This will iterate the io tree's rbtree and call rb_erase() on each node before freeing it, which will often trigger rebalance operations on the rbtree. A better alternative it to use extent_io_tree_release(), which will not do deletions and trigger rebalances. So use extent_io_tree_release() instead of clear_extent_bits(). Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 63ffc1f7c492df977353a0d2adf01d41069aad68 Author: Filipe Manana Date: Fri Sep 22 11:39:07 2023 +0100 btrfs: make tree iteration in extent_io_tree_release() more efficient Currently extent_io_tree_release() is a loop that keeps getting the first node in the io tree, using rb_first() which is a loop that gets to the leftmost node of the rbtree, and then for each node it calls rb_erase(), which often requires rebalancing the rbtree. We can make this more efficient by using rbtree_postorder_for_each_entry_safe() to free each node without having to delete it from the rbtree and without looping to get the first node. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit df2a8e70c3c397d4780027be3151d3c3ae9d47a6 Author: Filipe Manana Date: Fri Sep 22 11:39:06 2023 +0100 btrfs: collapse wait_on_state() to its caller wait_extent_bit() The wait_on_state() function is very short and has a single caller, which is wait_extent_bit(), so remove the function and put its code into the caller. Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 28967c762220d22ca26f4a5acacb69b9fbb9748b Author: Filipe Manana Date: Fri Sep 22 11:39:05 2023 +0100 btrfs: remove redundant memory barrier from extent_io_tree_release() The memory barrier at extent_io_tree_release() is redundant. Holding spin_lock here is not enough to drop the barrier completely. We only change the waitqueue of an extent state record while holding the tree lock - see wait_on_state(). The update to waitqueue state will not become stale because there will be an spin_unlock/spin_lock sequence between the change and waiting, this implies a full memory barrier. So remove the explicit smp_mb() barrier. Signed-off-by: Filipe Manana Reviewed-by: David Sterba [ reword reasoning ] Signed-off-by: David Sterba commit a1c20d15ee1e2cdcb54134174f0dab3b2fbcf4e4 Author: Filipe Manana Date: Fri Sep 22 11:39:04 2023 +0100 btrfs: make wait_extent_bit() static The function wait_extent_bit() is not used outside extent-io-tree.c so make it static. Furthermore the function doesn't have the 'btrfs_' prefix. Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit bea22a58c9f39ef426ff76b570d93111882152ec Author: Filipe Manana Date: Fri Sep 22 11:39:03 2023 +0100 btrfs: update stale comment at extent_io_tree_release() There's this comment at extent_io_tree_release() that mentions io btrees, but this function is no longer used only for io btrees. Originally it was added as a static function named clear_btree_io_tree() at transaction.c, in commit 663dfbb07774 ("Btrfs: deal with convert_extent_bit errors to avoid fs corruption"), as it was used only for cleaning one of the io trees that track dirty extent buffers, the dirty_log_pages io tree of a a root and the dirty_pages io tree of a transaction. Later it was renamed and exported and now it's used to cleanup other io trees such as the allocation state io tree of a device or the csums range io tree of a log root. So remove that comment and replace it with one at the top of the function that is more complete, mentioning what the function does and that it's expected to be called only when a task is sure no one else will need to use the tree anymore, as well as there should be no locked ranges in the tree and therefore no waiters on its extent state records. Also add an assertion to check that there are no locked extent state records in the tree. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit c91ea4bfa6dda549295ea7c15dfc990094d1fcd3 Author: Filipe Manana Date: Fri Sep 22 11:39:02 2023 +0100 btrfs: make extent state merges more efficient during insertions When inserting a new extent state record into an io tree that happens to be mergeable, we currently do the following: 1) Insert the extent state record in the io tree's rbtree. This requires going down the tree to find where to insert it, and during the insertion we often need to balance the rbtree; 2) We then check if the previous node is mergeable, so we call rb_prev() to find it, which requires some looping to find the previous node; 3) If the previous node is mergeable, we adjust our node to include the range of the previous node and then delete the previous node from the rbtree, which again may need to balance the rbtree; 4) Then we check if the next node is mergeable with the node we inserted, so we call rb_next(), which requires some looping too. If the next node is indeed mergeable, we expand the range of our node to include the next node's range and then delete the next node from the rbtree, which again may need to balance the tree. So these are quite of lot of iterations and looping over the rbtree, and some of the operations may need to rebalance the rb tree. This can be made a bit more efficient by: 1) When iterating the rbtree, once we find a node that is mergeable with the node we want to insert, we can just adjust that node's range with the range of the node to insert - this avoids continuing iterating over the tree and deleting a node from the rbtree; 2) If we expand the range of a mergeable node, then we find the next or the previous node, depending on other we merged a range to the right or to the left of the node we are currently at during the iteration. This merging is as before, we find the next or previous node with rb_next() or rb_prev() and if that other node is mergeable with the current one, we adjust the range of the current node and remove the other node from the rbtree; 3) Whenever we need to insert the new extent state record it's because we don't have any extent state record in the rbtree which can be merged, so we can remove the call to merge_state() after the insertion, saving rb_next() and rb_prev() calls, which require some looping. So update the insertion function insert_state() to have this behaviour. Running dbench for 120 seconds and capturing the execution times of set_extent_bit() at pin_down_extent(), resulted in the following data (time values are in nanoseconds): Before this change: Count: 2278299 Range: 0.000 - 4003728.000; Mean: 713.436; Median: 612.000; Stddev: 3606.952 Percentiles: 90th: 1187.000; 95th: 1350.000; 99th: 1724.000 0.000 - 7.534: 5 | 7.534 - 35.418: 36 | 35.418 - 154.403: 273 | 154.403 - 662.138: 1244016 ##################################################### 662.138 - 2828.745: 1031335 ############################################ 2828.745 - 12074.102: 1395 | 12074.102 - 51525.930: 806 | 51525.930 - 219874.955: 162 | 219874.955 - 938254.688: 22 | 938254.688 - 4003728.000: 3 | After this change: Count: 2275862 Range: 0.000 - 1605175.000; Mean: 678.903; Median: 590.000; Stddev: 2149.785 Percentiles: 90th: 1105.000; 95th: 1245.000; 99th: 1590.000 0.000 - 10.219: 10 | 10.219 - 40.957: 36 | 40.957 - 155.907: 262 | 155.907 - 585.789: 1127214 #################################################### 585.789 - 2193.431: 1145134 ##################################################### 2193.431 - 8205.578: 1648 | 8205.578 - 30689.378: 1039 | 30689.378 - 114772.699: 362 | 114772.699 - 429221.537: 52 | 429221.537 - 1605175.000: 10 | Maximum duration (range), average duration, percentiles and standard deviation are all better. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 893fe2439994666d94dbe19f5fd59cec17c8f0a8 Author: David Sterba Date: Fri Aug 14 11:35:16 2020 +0200 btrfs: change test_range_bit to scan the whole range The semantics of test_range_bit() with filled == 0 is now in it's own helper so test_range_bit will check the whole range unconditionally. The detection logic is flipped and assumes success by default and catches exceptions. Signed-off-by: David Sterba commit 99be1a66e1fe6c62fbd7c1b0c50ea38c33ffdd5a Author: David Sterba Date: Tue Sep 12 01:09:23 2023 +0200 btrfs: add specific helper for range bit test exists The existing helper test_range_bit works in two ways, checks if the whole range contains all the bits, or stop on the first occurrence. By adding a specific helper for the latter case, the inner loop can be simplified and contains fewer conditionals, making it a bit faster. There's no caller that uses the cached state pointer so this reduces the argument count further. Signed-off-by: David Sterba commit 6422b4cd959d4b796146c4b7746c26eb17783579 Author: Filipe Manana Date: Wed Sep 27 12:09:28 2023 +0100 btrfs: move btrfs_realloc_node() from ctree.c into defrag.c btrfs_realloc_node() is only used by the defrag code. Nowadays we have a defrag.c file, so move it, and its helper close_blocks(), into defrag.c. During the move also do a few minor cosmetic changes: 1) Change the return value of close_blocks() from int to bool; 2) Use SZ_32K instead of 32768 at close_blocks(); 3) Make some variables const in btrfs_realloc_node(), 'blocksize' and 'end_slot'; 4) Get rid of 'parent_nritems' variable, in both places where it was used it could be replaced by calling btrfs_header_nritems(parent); 5) Change the type of a couple variables from int to bool; 6) Rename variable 'err' to 'ret', as that's the most common name we use to track the return value of a function; 7) Move some variables from the top scope to the scope of the for loop where they are used. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 79d25df0d73797fa5a116a2ee7f63f573974e7f5 Author: Filipe Manana Date: Wed Sep 27 12:09:27 2023 +0100 btrfs: export comp_keys() from ctree.c as btrfs_comp_keys() Export comp_keys() out of ctree.c, as btrfs_comp_keys(), so that in a later patch we can move out defrag specific code from ctree.c into defrag.c. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 95f93bc4cbcac6121a5ee85cd5019ee8e7447e0b Author: Filipe Manana Date: Wed Sep 27 12:09:26 2023 +0100 btrfs: rename and export __btrfs_cow_block() Rename and export __btrfs_cow_block() as btrfs_force_cow_block(). This is to allow to move defrag specific code out of ctree.c and into defrag.c in one of the next patches. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit b8bf4e4d6ae9bbd485321e81b76cfaf07bf5bedd Author: Filipe Manana Date: Wed Sep 27 12:09:25 2023 +0100 btrfs: use round_down() to align block offset at btrfs_cow_block() At btrfs_cow_block() we can use round_down() to align the extent buffer's logical offset to the start offset of a metadata block group, instead of the less easy to read set of bitwise operations (two plus one subtraction). So replace the bitwise operations with a round_down() call. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7bff16e3ffd92ff9021938c5d0b2e9faf1c0e7e2 Author: Filipe Manana Date: Wed Sep 27 12:09:24 2023 +0100 btrfs: remove noinline attribute from btrfs_cow_block() It's pointless to have the noiline attribute for btrfs_cow_block(), as the function is exported and widely used. So remove it. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5966930dfd7741cfa6a41cd182c7cf4dfc1a4c95 Author: Anand Jain Date: Thu Sep 21 05:51:14 2023 +0800 btrfs: remove incomplete metadata_uuid conversion fixup logic Previous commit ("btrfs: reject devices with CHANGING_FSID_V2") has stopped the assembly of devices with the CHANGING_FSID_V2 flag in the kernel. Such devices can be scanned but will not be registered and can't be mounted without a manual fix by btrfstune. Remove the related logic and now unused code. The original motivation was to allow an interrupted partial conversion fix itself on next mount, in case the system has to be rebooted. This is a convenience but brings a lot of complexity the device scanning and handling the partial states. It's hard to estimate if this was ever needed in practice, expecting the typical use case like a manual conversion of an unmounted filesystem where the user can verify the success and rerun it eventually. Signed-off-by: Anand Jain Reviewed-by: David Sterba [ add historical context ] Signed-off-by: David Sterba commit 197a9ecee68aa7706dea47b6dff8d2edbfb214f0 Author: Anand Jain Date: Thu Sep 21 05:51:13 2023 +0800 btrfs: reject devices with CHANGING_FSID_V2 The BTRFS_SUPER_FLAG_CHANGING_FSID_V2 flag indicates a transient state where the device in the userspace btrfstune -m|-M operation failed to complete changing the fsid. This flag makes the kernel to automatically determine the other partner devices to which a given device can be associated, based on the fsid, metadata_uuid and generation values. btrfstune -m|M feature is especially useful in virtual cloud setups, where compute instances (disk images) are quickly copied, fsid changed, and launched. Given numerous disk images with the same metadata_uuid but different fsid, there's no clear way a device can be correctly assembled with the proper partners when the CHANGING_FSID_V2 flag is set. So, the disk could be assembled incorrectly, as in the example below: Before this patch: Consider the following two filesystems: /dev/loop[2-3] are raw copies of /dev/loop[0-1] and the btrsftune -m operation fails. In this scenario, as the /dev/loop0's fsid change is interrupted, and the CHANGING_FSID_V2 flag is set as shown below. $ p="device|devid|^metadata_uuid|^fsid|^incom|^generation|^flags" $ btrfs inspect dump-super /dev/loop0 | egrep '$p' superblock: bytenr=65536, device=/dev/loop0 flags 0x1000000001 fsid 7d4b4b93-2b27-4432-b4e4-4be1fbccbd45 metadata_uuid bb040a9f-233a-4de2-ad84-49aa5a28059b generation 9 num_devices 2 incompat_flags 0x741 dev_item.devid 1 $ btrfs inspect dump-super /dev/loop1 | egrep '$p' superblock: bytenr=65536, device=/dev/loop1 flags 0x1 fsid 11d2af4d-1b71-45a9-83f6-f2100766939d metadata_uuid bb040a9f-233a-4de2-ad84-49aa5a28059b generation 10 num_devices 2 incompat_flags 0x741 dev_item.devid 2 $ btrfs inspect dump-super /dev/loop2 | egrep '$p' superblock: bytenr=65536, device=/dev/loop2 flags 0x1 fsid 7d4b4b93-2b27-4432-b4e4-4be1fbccbd45 metadata_uuid bb040a9f-233a-4de2-ad84-49aa5a28059b generation 8 num_devices 2 incompat_flags 0x741 dev_item.devid 1 $ btrfs inspect dump-super /dev/loop3 | egrep '$p' superblock: bytenr=65536, device=/dev/loop3 flags 0x1 fsid 7d4b4b93-2b27-4432-b4e4-4be1fbccbd45 metadata_uuid bb040a9f-233a-4de2-ad84-49aa5a28059b generation 8 num_devices 2 incompat_flags 0x741 dev_item.devid 2 It is normal that some devices aren't instantly discovered during system boot or iSCSI discovery. The controlled scan below demonstrates this. $ btrfs device scan --forget $ btrfs device scan /dev/loop0 Scanning for btrfs filesystems on '/dev/loop0' $ mount /dev/loop3 /btrfs $ btrfs filesystem show -m Label: none uuid: 7d4b4b93-2b27-4432-b4e4-4be1fbccbd45 Total devices 2 FS bytes used 144.00KiB devid 1 size 300.00MiB used 48.00MiB path /dev/loop0 devid 2 size 300.00MiB used 40.00MiB path /dev/loop3 /dev/loop0 and /dev/loop3 are incorrectly partnered. This kernel patch removes functions and code connected to the CHANGING_FSID_V2 flag. With this patch, now devices with the CHANGING_FSID_V2 flag are rejected. And its partner will fail to mount with the extra -o degraded option. The check is removed from open_ctree(), devices are rejected during scanning which in turn fails the mount. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit ab7c8bbf3a088730e58da224bcad512f1dd9ca74 Author: David Sterba Date: Fri Sep 22 13:07:29 2023 +0200 btrfs: relocation: constify parameters where possible Lots of the functions in relocation.c don't change pointer parameters but lack the annotations. Add them and reformat according to current coding style if needed. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 32f2abca380fedc60f7a8d3288e4c9586672e207 Author: David Sterba Date: Fri Sep 22 13:07:25 2023 +0200 btrfs: relocation: return bool from btrfs_should_ignore_reloc_root btrfs_should_ignore_reloc_root() is a predicate so it should return bool. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit c71d3c698cb53f9deff82ac71ba576c571fe8c8f Author: David Sterba Date: Fri Sep 22 13:07:23 2023 +0200 btrfs: switch btrfs_backref_cache::is_reloc to bool The btrfs_backref_cache::is_reloc is an indicator variable and should use a bool type. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 733fa44de3bc936103f3a15fbdad6c545da8f248 Author: David Sterba Date: Fri Sep 22 13:07:20 2023 +0200 btrfs: relocation: open code mapping_tree_init There's only one user of mapping_tree_init, we don't need a helper for the simple initialization. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit d23d42e39b03f3fb5fd06e8c8a38447beae8e217 Author: David Sterba Date: Fri Sep 22 13:07:18 2023 +0200 btrfs: relocation: switch bitfields to bool in reloc_control Use bool types for the indicators instead of bitfields. The structure size slightly grows but the new types are placed within the padding. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 8daf07cf2b7919e7c2cf6249b19ff9bb88f95c9d Author: David Sterba Date: Fri Sep 22 13:07:16 2023 +0200 btrfs: relocation: use enum for stages Add an enum type for data relocation stages. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit a3bb700f43a1c5800bd5fc35cf6182f8ecadf58f Author: David Sterba Date: Fri Sep 22 13:07:14 2023 +0200 btrfs: relocation: use more natural types for tree_block bitfields We don't need to use bitfields for tree_block::level and tree_block::key_ready, there's enough padding in the structure for proper types. Reviewed-by: Johannes Thumshirn Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 1723270f0c29cc27dbe9e554a3f35abd2e4eb945 Author: Filipe Manana Date: Fri Sep 22 11:37:56 2023 +0100 btrfs: move btrfs_defrag_root() to defrag.{c,h} The btrfs_defrag_root() function does not really belong in the transaction.{c,h} module and as we have a defrag.{c,h} nowadays, move it to there instead. This also allows to stop exporting btrfs_defrag_leaves(), so we can make it static. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba [ rename info to fs_info for consistency ] Signed-off-by: David Sterba commit 8befc61cbba2d4567122d400542da8900a352971 Author: Filipe Manana Date: Fri Sep 22 11:37:26 2023 +0100 btrfs: remove redundant root argument from fixup_inode_link_count() The root argument for fixup_inode_link_count() always matches the root of the given inode, so remove the root argument and get it from the inode argument. This also applies to the helpers count_inode_extrefs() and count_inode_refs() used by fixup_inode_link_count() - they don't need the root argument, as it always matches the root of the inode passed to them. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0a325e620e1a0e266c083a06343497b376705a9d Author: Filipe Manana Date: Fri Sep 22 11:37:25 2023 +0100 btrfs: remove redundant root argument from maybe_insert_hole() The root argument for maybe_insert_hole() always matches the root of the given inode, so remove the root argument and get it from the inode argument. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 04bd8e941035cebcd7980363cc9291dd7da02128 Author: Filipe Manana Date: Fri Sep 22 11:37:24 2023 +0100 btrfs: remove redundant root argument from btrfs_delayed_update_inode() The root argument for btrfs_delayed_update_inode() always matches the root of the given inode, so remove the root argument and get it from the inode argument. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 07a274a8862dba86a270ced2a4c5ff3f7a01b66a Author: Filipe Manana Date: Fri Sep 22 11:37:23 2023 +0100 btrfs: remove redundant root argument from btrfs_update_inode_item() The root argument for btrfs_update_inode_item() always matches the root of the given inode, so remove the root argument and get it from the inode argument. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8b9d032225be93f80ebdd7ba933846acd1bd9f16 Author: Filipe Manana Date: Fri Sep 22 11:37:22 2023 +0100 btrfs: remove redundant root argument from btrfs_update_inode() The root argument for btrfs_update_inode() always matches the root of the given inode, so remove the root argument and get it from the inode argument. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0a5d0dc55fcb15da016fa28d27bf50ca7f17ec11 Author: Filipe Manana Date: Fri Sep 22 11:37:21 2023 +0100 btrfs: remove redundant root argument from btrfs_update_inode_fallback() The root argument for btrfs_update_inode_fallback() always matches the root of the given inode, so remove the root argument and get it from the inode argument. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit cddaaacca9339d2f13599a822dc2f68be71d2e0d Author: Filipe Manana Date: Fri Sep 22 11:37:20 2023 +0100 btrfs: remove noinline from btrfs_update_inode() The noinline attribute of btrfs_update_inode() is pointless as the function is exported and widely used, so remove it. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2199cb0f5e04dc2fbbaf8e337ee097149aad3556 Author: Filipe Manana Date: Fri Sep 22 11:37:19 2023 +0100 btrfs: simplify error check condition at btrfs_dirty_inode() The following condition at btrfs_dirty_inode() is redundant: if (ret && (ret == -ENOSPC || ret == -EDQUOT)) The first check for a non-zero 'ret' value is pointless, we can simplify this to simply: if (ret == -ENOSPC || ret == -EDQUOT) Not only this makes it easier to read, it also slightly reduces the text size of the btrfs kernel module: $ size fs/btrfs/btrfs.ko.before text data bss dec hex filename 1641400 168265 16864 1826529 1bdee1 fs/btrfs/btrfs.ko.before $ size fs/btrfs/btrfs.ko.after text data bss dec hex filename 1641224 168181 16864 1826269 1bdddd fs/btrfs/btrfs.ko.after Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit e076145115c0b5df838ced18294a3d7d92d66ef7 Author: Boris Burkov Date: Thu Jul 20 12:05:28 2023 -0700 btrfs: qgroup: only set QUOTA_ENABLED when done reading qgroups In open_ctree, we set BTRFS_FS_QUOTA_ENABLED as soon as we see a quota_root, as opposed to after we are done setting up the qgroup structures. In the quota_enable path, we wait until after the structures are set up. Likewise, in disable, we clear the bit before tearing down the structures. I feel that this organization is less surprising for the open_ctree path. I don't believe this fixes any actual bug, but avoids potential confusion when using btrfs_qgroup_mode in an intermediate state where we are enabled but haven't yet setup the qgroup status flags. It also avoids any risk of calling a qgroup function and attempting to use the qgroup rbtrees before they exist/are setup. This all occurs before we do rw setup, so I believe it should be mostly a no-op. Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 2672a051e3847401b80ed4e89c7af5be6b3f1be0 Author: Boris Burkov Date: Wed Jun 28 14:00:09 2023 -0700 btrfs: track data relocation with simple quota Relocation data allocations are quite tricky for simple quotas. The basic data relocation sequence is (ignoring details that aren't relevant to this fix): - create a fake relocation data fs root - create a fake relocation inode in that root - for each data extent: - preallocate a data extent on behalf of the fake inode - copy over the data - for each extent - swap the refs so that the original file extent now refers to the new extent item - drop the fake root, dropping its refs on the old extents, which lets us delete them. Done naively, this results in storing an extent item in the extent tree whose owner_ref points at the relocation data root and a no-op squota recording, since the reloc root is not a legit fstree. So far, that's OK. The problem comes when you do the swap, and leave an extent item owned by this bogus root as the real permanent extents of the file. If the file then drops that ref, we free it and no-op account that against the fake relocation root. Essentially, this means that relocation is simple quota "extent laundering", since we re-own the extents into a fake root. Simple quotas very intentionally doesn't have a mechanism for transferring ownership of extents, as that is exactly the complicated thing we are trying to avoid with the new design. Further, it cannot be correctly done in this case, since at the time you create the new "real" refs, there is no way to know which was the original owner before relocation unless we track it. Therefore, it makes more sense to trick the preallocation to handle relocation as a special case and note the proper owner ref from the beginning. That way, we never write out an extent item without the correct owner ref that it will eventually have. This could be done by wiring a special root parameter all the way through the allocation code path, but to avoid that special case touching all the code, take advantage of the serial nature of relocation to store the src root on the relocation root object. Then when we finish the prealloc, if it happens to be this case, prepare the delayed ref appropriately. We must also add logic to handle relocating adjacent extents with different owning roots. Those cannot be preallocated together in a cluster as it would lose the separate ownership information. This is obviously a smelly bit of code, but I think it is the best solution to the problem, given the relocation implementation. Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 60ea105a0f9fd359a5d0f1a8a2fead7cfe0528d1 Author: Boris Burkov Date: Wed Jun 21 17:37:23 2023 -0700 btrfs: qgroup: track metadata relocation COW with simple quota Relocation COWs metadata blocks in two cases for the reloc root: - copying the subvolume root item when creating the reloc root - copying a btree node when there is a COW during relocation In both cases, the resulting btree node hits an abnormal code path with respect to the owner field in its btrfs_header. It first creates the root item for the new objectid, which populates the reloc root id, and it at this point that delayed refs are created. Later, it fully copies the old node into the new node (including the original owner field) which overwrites it. This results in a simple quotas mismatch where we run the delayed ref for the reloc root which has no simple quota effect (reloc root is not an fstree) but when we ultimately delete the node, the owner is the real original fstree and we do free the space. To work around this without tampering with the behavior of relocation, add a parameter to btrfs_add_tree_block that lets the relocation code path specify a different owning root than the "operating" root (in this case, owning root is the real root and the operating root is the reloc root). These can naturally be plumbed into delayed refs that have the same concept. Note that this is a double count in some sense, but a relatively natural one, as there are really two extents, and the old one will be deleted soon. This is consistent with how data relocation extents are accounted by simple quotas. Reviewed-by: Josef Bacik Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit bd7c1ea3a302aba727a1ced9937ec84c6407724e Author: Boris Burkov Date: Tue Mar 28 15:45:20 2023 -0700 btrfs: qgroup: check generation when recording simple quota delta Simple quotas count extents only from the moment the feature is enabled. Therefore, if we do something like: 1. create subvol S 2. write F in S 3. enable quotas 4. remove F 5. write G in S then after 3. and 4. we would expect the simple quota usage of S to be 0 (putting aside some metadata extents that might be written) and after 5., it should be the size of G plus metadata. Therefore, we need to be able to determine whether a particular quota delta we are processing predates simple quota enablement. To do this, store the transaction id when quotas were enabled. In fs_info for immediate use and in the quota status item to make it recoverable on mount. When we see a delta, check if the generation of the extent item is less than that of quota enablement. If so, we should ignore the delta from this extent. Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 5343cd9364ea26c9f4f78896a87ed1b5b5e652d9 Author: Boris Burkov Date: Tue Mar 28 13:55:25 2023 -0700 btrfs: qgroup: simple quota auto hierarchy for nested subvolumes Consider the following sequence: - enable quotas - create subvol S id 256 at dir outer/ - create a qgroup 1/100 - add 0/256 (S's auto qgroup) to 1/100 - create subvol T id 257 at dir outer/inner/ With full qgroups, there is no relationship between 0/257 and either of 0/256 or 1/100. There is an inherit feature that the creator of inner/ can use to specify it ought to be in 1/100. Simple quotas are targeted at container isolation, where such automatic inheritance for not necessarily trusted/controlled nested subvol creation would be quite helpful. Therefore, add a new default behavior for simple quotas: when you create a nested subvol, automatically inherit as parents any parents of the qgroup of the subvol the new inode is going in. In our example, 257/0 would also be under 1/100, allowing easy control of a total quota over an arbitrary hierarchy of subvolumes. I think this _might_ be a generally useful behavior, so it could be interesting to put it behind a new inheritance flag that simple quotas always use while traditional quotas let the user specify, but this is a minimally intrusive change to start. Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit cecbb533b5fcec4ff77e786b7f94457f6cacd9e7 Author: Boris Burkov Date: Wed Jun 28 11:00:15 2023 -0700 btrfs: record simple quota deltas in delayed refs At the moment that we run delayed refs, we make the final ref-count based decision on creating/removing extent (and metadata) items. Therefore, it is exactly the spot to hook up simple quotas. There are a few important subtleties to the fields we must collect to accurately track simple quotas, particularly when removing an extent. When removing a data extent, the ref could be in any tree (due to reflink, for example) and so we need to recover the owning root id from the owner ref item. When removing a metadata extent, we know the owning root from the owner field in the header when we create the delayed ref, so we can recover it from there. We must also be careful to handle reservations properly to not leaked reserved space. The happy path is freeing the reservation when the simple quota delta runs on a data extent. If that doesn't happen, due to refs canceling out or some error, the ref head already has the must_insert_reserved machinery to handle this, so we piggy back on that and use it to clean up the reserved data. Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 8d2990914073e167cbf0f66e724b4b617f0f4dff Author: Boris Burkov Date: Wed Jun 28 10:45:29 2023 -0700 btrfs: add helper for inline owner ref lookup Inline ref parsing is a bit tricky and relies on a decent amount of implicit information, so I think it is beneficial to have a helper function for reading the owner ref, if only to "document" the format, along with the write path. The main subtlety of note which I was missing by open-coding this was that it is important to check whether or not inline refs are present *at all*. i.e., if we are writing out a new extent under squotas, we will always use a big enough item for the inline ref and have it. However, it is possible that some random item predating squotas will not have any inline refs. In that case, trying to read the "type" field of the first inline ref will just be reading garbage in the form of whatever is in the next item. This will be used by the extent free-ing path, which looks up data extent owners as well as a relocation path which needs to grab the owner before relocating an extent. Signed-off-by: Boris Burkov Reviewed-by: Josef Bacik Signed-off-by: David Sterba commit d9a620f77e33f2b0e9a5f131f3ee3c66d3285c57 Author: Boris Burkov Date: Mon Jan 30 14:45:55 2023 -0800 btrfs: new inline ref storing owning subvol of data extents In order to implement simple quota groups, we need to be able to associate a data extent with the subvolume that created it. Once you account for reflink, this information cannot be recovered without explicitly storing it. Options for storing it are: - a new key/item - a new extent inline ref item The former is backwards compatible, but wastes space, the latter is incompat, but is efficient in space and reuses the existing inline ref machinery, while only abusing it a tiny amount -- specifically, the new item is not a ref, per-se. Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit cf79ac47932b377d0cfe6b61f4472cdc17eac042 Author: Boris Burkov Date: Wed Jun 28 14:03:35 2023 -0700 btrfs: track original extent owner in head_ref Simple quotas requires tracking the original creating root of any given extent. This gets complicated when multiple subvolumes create overlapping/contradictory refs in the same transaction. For example, due to modifying or deleting an extent while also snapshotting it. To resolve this in a general way, take advantage of the fact that we are essentially already tracking this for handling releasing reservations. The head ref coalesces the various refs and uses must_insert_reserved to check if it needs to create an extent/free reservation. Store the ref that set must_insert_reserved as the owning ref on the head ref. Note that this can result in writing an extent for the very first time with an owner different from its only ref, but it will look the same as if you first created it with the original owning ref, then added the other ref, then removed the owning ref. Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 457cb1ddf5e8d895e9c551cad6b84bafae41f32c Author: Boris Burkov Date: Tue Mar 28 16:04:02 2023 -0700 btrfs: track owning root in btrfs_ref While data extents require us to store additional inline refs to track the original owner on free, this information is available implicitly for metadata. It is found in the owner field of the header of the tree block. Even if other trees refer to this block and the original ref goes away, we will not rewrite that header field, so it will reliably give the original owner. In addition, there is a relocation case where a new data extent needs to have an owning root separate from the referring root wired through delayed refs. To use it for recording simple quota deltas, we need to wire this root id through from when we create the delayed ref until we fully process it. Store it in the generic btrfs_ref struct of the delayed ref. Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 610647d7efd1ab06e9cd7ed6f0abe84b16385da7 Author: Boris Burkov Date: Wed Jun 28 14:32:58 2023 -0700 btrfs: rename tree_ref and data_ref owning_root commit 113479d5b8eb ("btrfs: rename root fields in delayed refs structs") changed these from ref_root to owning_root. However, there are many circumstances where that name is not really accurate and the root on the ref struct _is_ the referring root. In general, these are not the owning root, though it does happen in some ref merging cases involving overwrites during snapshots and similar. Simple quotas cares quite a bit about tracking the original owner of an extent through delayed refs, so rename these back to free up the name for the real owning root (which will live on the generic btrfs_ref and the head ref) Reviewed-by: Josef Bacik Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 1e0e9d5771c33d2c17a7f2a0e2a419aca91bb1a0 Author: Boris Burkov Date: Tue Mar 28 13:43:47 2023 -0700 btrfs: add helper for recording simple quota deltas Rather than re-computing shared/exclusive ownership based on backrefs and walking roots for implicit backrefs, simple quotas does an increment when creating an extent and a decrement when deleting it. Add the API for the extent item code to use to track those events. Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 6ed05643ddb166c0fddabac8ee092659006214a9 Author: Boris Burkov Date: Wed Jun 28 11:00:05 2023 -0700 btrfs: create qgroup earlier in snapshot creation Pull creating the qgroup earlier in the snapshot. This allows simple quotas qgroups to see all the metadata writes related to the snapshot being created and to be born with the root node accounted. Note this has an impact on transaction commit where the qgroup creation can do a lot of work, allocate memory and take locks. The change is done for correctness, potential performance issues will be fixed in the future. Signed-off-by: Boris Burkov [ add note ] Signed-off-by: David Sterba commit af0e2aab3b70b7844232bbce2a619ec70e049df4 Author: Boris Burkov Date: Wed Jun 28 10:06:45 2023 -0700 btrfs: qgroup: flush reservations during quota disable The following sequence: enable simple quotas do some writes reserve space create ordered_extent release rsv (store rsv_bytes in OE, mark QGROUP_RESERVED bits) disable quotas enable simple quotas set qgroup rsv to 0 on all subvolumes ordered_extent finishes create delayed ref with rsv_bytes from before run delayed ref record_simple_quota_delta free rsv_bytes (0 -> -rsv_delta) results in us reliably underflowing the subvolume's qgroup rsv counter, because disabling/re-enabling quotas toggles reservation counters down to 0, but does not remove other file system state which represents successful acquisition of qgroup rsv space. Specifically metadata rsv counters on the root object and rsv_bytes on ordered_extent objects that have released their reservation as well as the corresponding QGROUP_RESERVED extent bits. Normal qgroups gets away with this, I believe because it forces more work to happen on transaction commit, but I am not certain it is totally safe from the ordered_extent/leaked extent bit variant. Simple quotas hits this reliably. The intent of the fix is to make disable take the time to clear that external to qgroups state as well: after flipping off the quota bit on fs_info, flush delalloc and ordered extents, clearing the extent bits along the way. This makes it so there are no ordered extents or meta prealloc hanging around from the first enablement period during the second. Reviewed-by: Josef Bacik Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit a744986ac4dbe42496410780800fbbc00afaa910 Author: Boris Burkov Date: Thu Jul 13 13:39:19 2023 -0700 btrfs: sysfs: add simple_quota incompat feature entry Add an entry in the features directory for the new incompat flag Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 0182764a21b2923d4c238fed9a54db82b65d33b6 Author: Boris Burkov Date: Thu Apr 27 10:58:20 2023 -0700 btrfs: sysfs: expose quota mode via sysfs Add a new sysfs file /sys/fs/btrfs//qgroups/mode which prints out the mode qgroups is running in. The possible modes are qgroup, and squota. If quotas are not enabled, then the qgroups directory will not exist, so don't handle that mode. Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 182940f4f4dbd932776414744c8de64333957725 Author: Boris Burkov Date: Tue May 16 16:35:45 2023 -0700 btrfs: qgroup: add new quota mode for simple quotas Add a new quota mode called "simple quotas". It can be enabled by the existing quota enable ioctl via a new command, and sets an incompat bit, as the implementation of simple quotas will make backwards incompatible changes to the disk format of the extent tree. Signed-off-by: Boris Burkov Signed-off-by: David Sterba commit 6b0cd63bc75c22b49b6b1ef3d39b5850241340c0 Author: Boris Burkov Date: Tue May 16 16:33:55 2023 -0700 btrfs: qgroup: introduce quota mode In preparation for introducing simple quotas, change from a binary setting for quotas to an enum based mode. Initially, the possible modes are disabled/full. Full quotas is normal btrfs qgroups. Reviewed-by: Josef Bacik Signed-off-by: Boris Burkov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 078b8b90b8ffec54f7dc1e8ef6c1078d1e7d3dae Author: David Sterba Date: Tue Sep 19 18:49:23 2023 +0200 btrfs: merge ordered work callbacks in btrfs_work into one There are two callbacks defined in btrfs_work but only two actually make use of them, otherwise there are NULLs. We can get rid of the freeing callback making it a special case of the normal work. This reduces the size of btrfs_work by 8 bytes, final layout: struct btrfs_work { btrfs_func_t func; /* 0 8 */ btrfs_ordered_func_t ordered_func; /* 8 8 */ struct work_struct normal_work; /* 16 32 */ struct list_head ordered_list; /* 48 16 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct btrfs_workqueue * wq; /* 64 8 */ long unsigned int flags; /* 72 8 */ /* size: 80, cachelines: 2, members: 6 */ /* last cacheline: 16 bytes */ }; This in turn reduces size of other structures (on a release config): - async_chunk 160 -> 152 - async_submit_bio 152 -> 144 - btrfs_async_delayed_work 104 -> 96 - btrfs_caching_control 176 -> 168 - btrfs_delalloc_work 144 -> 136 - btrfs_fs_info 3608 -> 3600 - btrfs_ordered_extent 440 -> 424 - btrfs_writepage_fixup 104 -> 96 Signed-off-by: David Sterba commit e9b9b911e03c82afce7bb9e2f73c92202c95b62a Author: Johannes Thumshirn Date: Thu Sep 14 09:07:06 2023 -0700 btrfs: add raid stripe tree to features enabled with debug config Until the raid stripe tree code is well enough tested and feature complete, "hide" it behind CONFIG_BTRFS_DEBUG so only people who want to use it are actually using it. The scrub support may still fail some tests (btrfs/060 and up) and will be fixed, RAID5/6 is not supported. Reviewed-by: Josef Bacik Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit e0b4077fcc4e132fa729a54183d0af58da6d1d39 Author: Johannes Thumshirn Date: Mon Sep 18 07:14:33 2023 -0700 btrfs: tree-checker: add support for raid stripe tree Add a tree checker support for RAID stripe tree items, verify: - alignment - presence of the incompat bit - supported encoding Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit b5e2c2ff67d2c88ee2b3f4f22ef4426cfb35ec06 Author: Johannes Thumshirn Date: Thu Sep 14 09:07:05 2023 -0700 btrfs: tracepoints: add events for raid stripe tree Add trace events for raid-stripe-tree operations. Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9f9918a8017b7925da2fad16b4ccf6a14630f03e Author: Johannes Thumshirn Date: Thu Sep 14 09:07:04 2023 -0700 btrfs: sysfs: announce presence of raid-stripe-tree If a filesystem with a raid-stripe-tree is mounted, show the RST feature in sysfs, currently still under the CONFIG_BTRFS_DEBUG option. Reviewed-by: Josef Bacik Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit edde81f1abf2977ac63939fb92afcb82c42f6ca4 Author: Johannes Thumshirn Date: Thu Sep 14 09:07:03 2023 -0700 btrfs: add raid stripe tree pretty printer Decode raid-stripe-tree entries on btrfs_print_tree(). Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 568220fa96572e7bb48cfe8f2d04ab44e0dfe08e Author: Johannes Thumshirn Date: Thu Sep 14 09:07:02 2023 -0700 btrfs: zoned: support RAID0/1/10 on top of raid stripe tree When we have a raid-stripe-tree, we can do RAID0/1/10 on zoned devices for data block groups. For metadata block groups, we don't actually need anything special, as all metadata I/O is protected by the btrfs_zoned_meta_io_lock() already. Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9acaa64187f9b4cbb75622883c96ea1a893d5431 Author: Johannes Thumshirn Date: Thu Sep 14 09:07:01 2023 -0700 btrfs: scrub: implement raid stripe tree support A filesystem that uses the raid stripe tree for logical to physical address translation can't use the regular scrub path, that reads all stripes and then checks if a sector is unused afterwards. When using the raid stripe tree, this will result in lookup errors, as the stripe tree doesn't know the requested logical addresses. In case we're scrubbing a filesystem which uses the RAID stripe tree for multi-device logical to physical address translation, perform an extra block mapping step to get the real on-disk stripe length from the stripe tree when scrubbing the sectors. This prevents a double completion of the btrfs_bio caused by splitting the underlying bio and ultimately a use-after-free. Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba commit 10e27980f2ff66ba0c6da55f33b4814d5bc86573 Author: Johannes Thumshirn Date: Thu Sep 14 09:07:00 2023 -0700 btrfs: lookup physical address from stripe extent Lookup the physical address from the raid stripe tree when a read on an RAID volume formatted with the raid stripe tree was attempted. Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba commit ca41504efda646d9c4b00c37be52f5ba07cebebf Author: Johannes Thumshirn Date: Thu Sep 14 09:06:59 2023 -0700 btrfs: delete stripe extent on extent deletion As each stripe extent is tied to an extent item, delete the stripe extent once the corresponding extent item is deleted. Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 02c372e1f016e5113217597ab37b399c4e407477 Author: Johannes Thumshirn Date: Thu Sep 14 09:06:58 2023 -0700 btrfs: add support for inserting raid stripe extents Add support for inserting stripe extents into the raid stripe tree on completion of every write that needs an extra logical-to-physical translation when using RAID. Inserting the stripe extents happens after the data I/O has completed, this is done to a) support zone-append and b) rule out the possibility of a RAID-write-hole. Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 515020900d447796bc2f0f57064663617a11b65d Author: Johannes Thumshirn Date: Thu Sep 14 09:06:57 2023 -0700 btrfs: read raid stripe tree from disk If we find the raid-stripe-tree on mount, read it from disk. This is a backward incompatible feature. The rescue=ignorebadroots mount option will skip this tree. Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit ee1293308e01d359688243d665138f35a6f1f9b8 Author: Johannes Thumshirn Date: Thu Sep 14 09:06:56 2023 -0700 btrfs: add raid stripe tree definitions Add definitions for the raid stripe tree. This tree will hold information about the on-disk layout of the stripes in a RAID set. Each stripe extent has a 1:1 relationship with an on-disk extent item and is doing the logical to per-drive physical address translation for the extent item in question. Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6d3a61945b0088106a9cba9023094a5712df0092 Author: Qu Wenruo Date: Thu Aug 24 14:33:36 2023 +0800 btrfs: warn on tree blocks which are not nodesize aligned A long time ago, we had some metadata chunks which started at sector boundary but not aligned to nodesize boundary. This led to some older filesystems which can have tree blocks only aligned to sectorsize, but not nodesize. Later 'btrfs check' gained the ability to detect and warn about such tree blocks, and kernel fixed the chunk allocation behavior, nowadays those tree blocks should be pretty rare. But in the future, if we want to migrate metadata to folio, we cannot have such tree blocks, as filemap_add_folio() requires the page index to be aligned with the folio number of pages. Such unaligned tree blocks can lead to VM_BUG_ON(). So this patch adds extra warning for those unaligned tree blocks, as a preparation for the future folio migration. Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 11aeb97b45ad2e0040cbb2a589bc403152526345 Author: Josef Bacik Date: Mon Sep 18 14:15:33 2023 -0400 btrfs: don't arbitrarily slow down delalloc if we're committing We have a random schedule_timeout() if the current transaction is committing, which seems to be a holdover from the original delalloc reservation code. Remove this, we have the proper flushing stuff, we shouldn't be hoping for random timing things to make everything work. This just induces latency for no reason. CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit c967c19ea6d5a7c79da53394694b1c38a7e1712f Author: Filipe Manana Date: Fri Sep 15 16:03:57 2023 +0100 btrfs: remove useless comment from btrfs_pin_extent_for_log_replay() The comment on top of btrfs_pin_extent_for_log_replay() mentioning that the function must be called within a transaction is pointless as of commit 9fce5704542c ("btrfs: Make btrfs_pin_extent_for_log_replay take transaction handle"), since the function now takes a transaction handle as its first argument. So remove the comment because it's completely useless now. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit df423ee23bcf3228ed5f4aaacc2b108cecaf0c26 Author: Filipe Manana Date: Fri Sep 15 16:02:56 2023 +0100 btrfs: remove stale comment from btrfs_free_extent() A comment at btrfs_free_extent() mentions the call to btrfs_pin_extent() unlocks the pinned mutex, however that mutex is long gone, it was removed in 2009 by commit 04018de5d41e ("Btrfs: kill the pinned_mutex"). So just delete the comment. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 87463f7e0250d471fac41e7c9c45ae21d83b5f85 Author: Christoph Hellwig Date: Mon Jun 5 10:51:08 2023 +0200 btrfs: zoned: factor out DUP bg handling from btrfs_load_block_group_zone_info Split the code handling a type DUP block group from btrfs_load_block_group_zone_info to make the code more readable. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9e0e3e74dc6928a0956f4e27e24d473c65887e96 Author: Christoph Hellwig Date: Mon Jun 5 10:51:07 2023 +0200 btrfs: zoned: factor out single bg handling from btrfs_load_block_group_zone_info Split the code handling a type single block group from btrfs_load_block_group_zone_info to make the code more readable. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 09a46725cc84165af452d978a3532d6b97a28796 Author: Christoph Hellwig Date: Mon Jun 5 10:51:06 2023 +0200 btrfs: zoned: factor out per-zone logic from btrfs_load_block_group_zone_info Split out a helper for the body of the per-zone loop in btrfs_load_block_group_zone_info to make the function easier to read and modify. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 15c12fcc50a1b12a747f8b6ec05cdb18c537a4d1 Author: Christoph Hellwig Date: Mon Jun 5 10:51:05 2023 +0200 btrfs: zoned: introduce a zone_info struct in btrfs_load_block_group_zone_info Add a new zone_info structure to hold per-zone information in btrfs_load_block_group_zone_info and prepare for breaking out helpers from it. Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4d20c1def946f1faa57334c4b99d3cb0ccd18944 Author: Filipe Manana Date: Wed Sep 13 12:23:18 2023 +0100 btrfs: remove pointless loop from btrfs_update_block_group() When an extent is allocated or freed, we call btrfs_update_block_group() to update its block group and space info. An extent always belongs to a single block group, it can never span multiple block groups, so the loop we have at btrfs_update_block_group() is pointless, as it always has a single iteration. The loop was added in the very early days, 2007, when the block group code was added in commit 9078a3e1e4e4 ("Btrfs: start of block group code"), but even back then it seemed pointless. So remove the loop and assert the block group containing the start offset of the extent also contains the whole extent. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 4ebe8d478879c84a9e0c4f655cd8652fdbe239ac Author: Filipe Manana Date: Tue Sep 12 13:04:31 2023 +0100 btrfs: mark transaction id check as unlikely at btrfs_mark_buffer_dirty() At btrfs_mark_buffer_dirty(), having a transaction id mismatch is never expected to happen and it usually means there's a bug or some memory corruption due to a bitflip for example. So mark the condition as unlikely to optimize code generation as well as to make it obvious for human readers that it is a very unexpected condition. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 20cbe4603518ed328b173246d936d6ac62ec2fcc Author: Filipe Manana Date: Tue Sep 12 13:04:30 2023 +0100 btrfs: use btrfs_crit at btrfs_mark_buffer_dirty() There's no need to use WARN() at btrfs_mark_buffer_dirty() to print an error message, as we have the fs_info pointer we can use btrfs_crit() which prints device information and makes the message have a more uniform format. As we are already aborting the transaction we already have a stack trace printed as well. So replace the use of WARN() with btrfs_crit(). Also slightly reword the message to use 'logical' instead of 'block' as it's what is used in other error/warning messages. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 50564b651d01c19ce732819c5b3c3fd60707188e Author: Filipe Manana Date: Tue Sep 12 13:04:29 2023 +0100 btrfs: abort transaction on generation mismatch when marking eb as dirty When marking an extent buffer as dirty, at btrfs_mark_buffer_dirty(), we check if its generation matches the running transaction and if not we just print a warning. Such mismatch is an indicator that something really went wrong and only printing a warning message (and stack trace) is not enough to prevent a corruption. Allowing a transaction to commit with such an extent buffer will trigger an error if we ever try to read it from disk due to a generation mismatch with its parent generation. So abort the current transaction with -EUCLEAN if we notice a generation mismatch. For this we need to pass a transaction handle to btrfs_mark_buffer_dirty() which is always available except in test code, in which case we can pass NULL since it operates on dummy extent buffers and all test roots have a single node/leaf (root node at level 0). Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit bc27d6f0aa0e4de184b617aceeaf25818cc646de Author: Anand Jain Date: Sat Sep 9 00:31:55 2023 +0800 btrfs: scan but don't register device on single device filesystem After the commit 5f58d783fd78 ("btrfs: free device in btrfs_close_devices for a single device filesystem") we unregister the device from the kernel memory upon unmounting for a single device. So, device registration that was performed before mounting if any is no longer in the kernel memory. However, in fact, note that device registration is unnecessary for a single-device btrfs filesystem unless it's a seed device. So for commands like 'btrfs device scan' or 'btrfs device ready' with a non-seed single-device btrfs filesystem, they can return success just after superblock verification and without the actual device scan. When 'device scan --forget' is called on such device no error is returned. The seed device must remain in the kernel memory to allow the sprout device to mount without the need to specify the seed device explicitly. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit ed164802e89589db64ef8829813a5ae92153722c Author: David Sterba Date: Fri Sep 8 21:05:47 2023 +0200 btrfs: rename errno identifiers to error We sync the kernel files to userspace and the 'errno' symbol is defined by standard library, which does not matter in kernel but the parameters or local variables could clash. Rename them all. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 28270e25c69a2c76ea1ed0922095bffb9b9a4f98 Author: Filipe Manana Date: Fri Sep 8 18:20:38 2023 +0100 btrfs: always reserve space for delayed refs when starting transaction When starting a transaction (or joining an existing one with btrfs_start_transaction()), we reserve space for the number of items we want to insert in a btree, but we don't do it for the delayed refs we will generate while using the transaction to modify (COW) extent buffers in a btree or allocate new extent buffers. Basically how it works: 1) When we start a transaction we reserve space for the number of items the caller wants to be inserted/modified/deleted in a btree. This space goes to the transaction block reserve; 2) If the delayed refs block reserve is not full, its size is greater than the amount of its reserved space, and the flush method is BTRFS_RESERVE_FLUSH_ALL, then we attempt to reserve more space for it corresponding to the number of items the caller wants to insert/modify/delete in a btree; 3) The size of the delayed refs block reserve is increased when a task creates delayed refs after COWing an extent buffer, allocating a new one or deleting (freeing) an extent buffer. This happens after the the task started or joined a transaction, whenever it calls btrfs_update_delayed_refs_rsv(); 4) The delayed refs block reserve is then refilled by anyone calling btrfs_delayed_refs_rsv_refill(), either during unlink/truncate operations or when someone else calls btrfs_start_transaction() with a 0 number of items and flush method BTRFS_RESERVE_FLUSH_ALL; 5) As a task COWs or allocates extent buffers, it consumes space from the transaction block reserve. When the task releases its transaction handle (btrfs_end_transaction()) or it attempts to commit the transaction, it releases any remaining space in the transaction block reserve that it did not use, as not all space may have been used (due to pessimistic space calculation) by calling btrfs_block_rsv_release() which will try to add that unused space to the delayed refs block reserve (if its current size is greater than its reserved space). That transferred space may not be enough to completely fulfill the delayed refs block reserve. Plus we have some tasks that will attempt do modify as many leaves as they can before getting -ENOSPC (and then reserving more space and retrying), such as hole punching and extent cloning which call btrfs_replace_file_extents(). Such tasks can generate therefore a high number of delayed refs, for both metadata and data (we can't know in advance how many file extent items we will find in a range and therefore how many delayed refs for dropping references on data extents we will generate); 6) If a transaction starts its commit before the delayed refs block reserve is refilled, for example by the transaction kthread or by someone who called btrfs_join_transaction() before starting the commit, then when running delayed references if we don't have enough reserved space in the delayed refs block reserve, we will consume space from the global block reserve. Now this doesn't make a lot of sense because: 1) We should reserve space for delayed references when starting the transaction, since we have no guarantees the delayed refs block reserve will be refilled; 2) If no refill happens then we will consume from the global block reserve when running delayed refs during the transaction commit; 3) If we have a bunch of tasks calling btrfs_start_transaction() with a number of items greater than zero and at the time the delayed refs reserve is full, then we don't reserve any space at btrfs_start_transaction() for the delayed refs that will be generated by a task, and we can therefore end up using a lot of space from the global reserve when running the delayed refs during a transaction commit; 4) There are also other operations that result in bumping the size of the delayed refs reserve, such as creating and deleting block groups, as well as the need to update a block group item because we allocated or freed an extent from the respective block group; 5) If we have a significant gap between the delayed refs reserve's size and its reserved space, two very bad things may happen: 1) The reserved space of the global reserve may not be enough and we fail the transaction commit with -ENOSPC when running delayed refs; 2) If the available space in the global reserve is enough it may result in nearly exhausting it. If the fs has no more unallocated device space for allocating a new block group and all the available space in existing metadata block groups is not far from the global reserve's size before we started the transaction commit, we may end up in a situation where after the transaction commit we have too little available metadata space, and any future transaction commit will fail with -ENOSPC, because although we were able to reserve space to start the transaction, we were not able to commit it, as running delayed refs generates some more delayed refs (to update the extent tree for example) - this includes not even being able to commit a transaction that was started with the goal of unlinking a file, removing an empty data block group or doing reclaim/balance, so there's no way to release metadata space. In the worst case the next time we mount the filesystem we may also fail with -ENOSPC due to failure to commit a transaction to cleanup orphan inodes. This later case was reported and hit by someone running a SLE (SUSE Linux Enterprise) distribution for example - where the fs had no more unallocated space that could be used to allocate a new metadata block group, and the available metadata space was about 1.5M, not enough to commit a transaction to cleanup an orphan inode (or do relocation of data block groups that were far from being full). So improve on this situation by always reserving space for delayed refs when calling start_transaction(), and if the flush method is BTRFS_RESERVE_FLUSH_ALL, also try to refill the delayed refs block reserve if it's not full. The space reserved for the delayed refs is added to a local block reserve that is part of the transaction handle, and when a task updates the delayed refs block reserve size, after creating a delayed ref, the space is transferred from that local reserve to the global delayed refs reserve (fs_info->delayed_refs_rsv). In case the local reserve does not have enough space, which may happen for tasks that generate a variable and potentially large number of delayed refs (such as the hole punching and extent cloning cases mentioned before), we transfer any available space and then rely on the current behaviour of hoping some other task refills the delayed refs reserve or fallback to the global block reserve. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit adb86dbe426f9a54843d70092819deca220a224d Author: Filipe Manana Date: Fri Sep 8 18:20:37 2023 +0100 btrfs: stop doing excessive space reservation for csum deletion Currently when reserving space for deleting the csum items for a data extent, when adding or updating a delayed ref head, we determine how many leaves of csum items we can have and then pass that number to the helper btrfs_calc_delayed_ref_bytes(). This helper is used for calculating space for all tree modifications we need when running delayed references, however the amount of space it computes is excessive for deleting csum items because: 1) It uses btrfs_calc_insert_metadata_size() which is excessive because we only need to delete csum items from the csum tree, we don't need to insert any items, so btrfs_calc_metadata_size() is all we need (as it computes space needed to delete an item); 2) If the free space tree is enabled, it doubles the amount of space, which is pointless for csum deletion since we don't need to touch the free space tree or any other tree other than the csum tree. So improve on this by tracking how many csum deletions we have and using a new helper to calculate space for csum deletions (just a wrapper around btrfs_calc_metadata_size() with a comment). This reduces the amount of space we need to reserve for csum deletions by a factor of 4, and it helps reduce the number of times we have to block space reservations and have the reclaim task enter the space flushing algorithm (flush delayed items, flush delayed refs, etc) in order to satisfy tickets. For example this results in a total time decrease when unlinking (or truncating) files with many extents, as we end up having to block on space metadata reservations less often. Example test: $ cat test.sh #!/bin/bash DEV=/dev/nullb0 MNT=/mnt/test umount $DEV &> /dev/null mkfs.btrfs -f $DEV # Use compression to quickly create files with a lot of extents # (each with a size of 128K). mount -o compress=lzo $DEV $MNT # 100G gives at least 983040 extents with a size of 128K. xfs_io -f -c "pwrite -S 0xab -b 1M 0 120G" $MNT/foobar # Flush all delalloc and clear all metadata from memory. umount $MNT mount -o compress=lzo $DEV $MNT start=$(date +%s%N) rm -f $MNT/foobar end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "rm took $dur milliseconds" umount $MNT Before this change rm took: 7504 milliseconds After this change rm took: 6574 milliseconds (-12.4%) Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit b6ea3e6ab569d9ed7472e8df4cbf5f78fe49f277 Author: Filipe Manana Date: Fri Sep 8 18:20:36 2023 +0100 btrfs: remove pointless initialization at btrfs_delayed_refs_rsv_release() There's no point in initializing to 0 the local variable 'released' as we don't use it before the next assignment to it. So remove the initialization. This may help avoid some warnings with clang tools such as the one reported/fixed by commit 966de47ff0c9 ("btrfs: remove redundant initialization of variables in log_new_ancestors"). Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3ee56a58ad8921cb43c49d56347a8e270871844c Author: Filipe Manana Date: Fri Sep 8 18:20:35 2023 +0100 btrfs: reserve space for delayed refs on a per ref basis Currently when reserving space for delayed refs we do it on a per ref head basis. This is generally enough because most back refs for an extent end up being inlined in the extent item - with the default leaf size of 16K we can have at most 33 inline back refs (this is calculated by the macro BTRFS_MAX_EXTENT_ITEM_SIZE()). The amount of bytes reserved for each ref head is given by btrfs_calc_delayed_ref_bytes(), which basically corresponds to a single path for insertion into the extent tree plus another path for insertion into the free space tree if it's enabled. However if we have reached the limit of inline refs or we have a mix of inline and non-inline refs, then we will need to insert a non-inline ref and update the existing extent item to update the total number of references for the extent. This implies we need reserved space for two insertion paths in the extent tree, but we only reserved for one path. The extent item and the non-inline ref item may be located in different leaves, or even if they are located in the same leaf, after updating the extent item and before inserting the non-inline ref item, the extent buffers in the btree path may have been written (due to memory pressure for e.g.), in which case we need to COW the entire path again. In this case since we have not reserved enough space for the delayed refs block reserve, we will use the global block reserve. If we are in a situation where the fs has no more unallocated space enough to allocate a new metadata block group and available space in the existing metadata block groups is close to the maximum size of the global block reserve (512M), we may end up consuming too much of the free metadata space to the point where we can't commit any future transaction because it will fail, with -ENOSPC, during its commit when trying to allocate an extent for some COW operation (running delayed refs generated by running delayed refs or COWing the root tree's root node at commit_cowonly_roots() for example). Such dramatic scenario can happen if we have many delayed refs that require the insertion of non-inline ref items, due to too many reflinks or snapshots. We also have situations where we use the global block reserve because we could not in advance know that we will need space to update some trees (block group creation for example), so this all adds up to increase the chances of exhausting the global block reserve and making any future transaction commit to fail with -ENOSPC and turn the fs into RO mode, or fail the mount operation in case the mount needs to start and commit a transaction, such as when we have orphans to cleanup for example - such case was reported and hit by someone running a SLE (SUSE Linux Enterprise) distribution for example - where the fs had no more unallocated space that could be used to allocate a new metadata block group, and the available metadata space was about 1.5M, not enough to commit a transaction to cleanup an orphan inode (or do relocation of data block groups that were far from being full). So reserve space for delayed refs by individual refs and not by ref heads, as we may need to COW multiple extent tree paths due to non-inline ref items. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 8a526c44daeeb14df0f6e3147a58b4b996968830 Author: Filipe Manana Date: Fri Sep 8 18:20:34 2023 +0100 btrfs: allow to run delayed refs by bytes to be released instead of count When running delayed references, through btrfs_run_delayed_refs(), we can specify how many to run, run all existing delayed references and keep running delayed references while we can find any. This is controlled with the value of the 'count' argument, where a value of 0 means to run all delayed references that exist by the time btrfs_run_delayed_refs() is called, (unsigned long)-1 means to keep running delayed references while we are able find any, and any other value to run that exact number of delayed references. Typically a specific value other than 0 or -1 is used when flushing space to try to release a certain amount of bytes for a ticket. In this case we just simply calculate how many delayed reference heads correspond to a specific amount of bytes, with calc_delayed_refs_nr(). However that only takes into account the space reserved for the reference heads themselves, and does not account for the space reserved for deleting checksums from the csum tree (see add_delayed_ref_head() and update_existing_head_ref()) in case we are going to delete a data extent. This means we may end up running more delayed references than necessary in case we process delayed references for deleting a data extent. So change the logic of btrfs_run_delayed_refs() to take a bytes argument to specify how many bytes of delayed references to run/release, using the special values of 0 to mean all existing delayed references and U64_MAX (or (u64)-1) to keep running delayed references while we can find any. This prevents running more delayed references than necessary, when we have delayed references for deleting data extents, but also makes the upcoming changes/patches simpler and it's preparatory work for them. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit da8848ac6a1b3a3b3a2bd412f943e3e23b5e05fe Author: Filipe Manana Date: Fri Sep 8 18:20:33 2023 +0100 btrfs: simplify check for extent item overrun at lookup_inline_extent_backref() At lookup_inline_extent_backref() we can simplify the check for an overrun of the extent item by making the while loop's condition to be "ptr < end" and then check after the loop if an overrun happened ("ptr > end"). This reduces indentation and makes the loop condition more clear. So move the check out of the loop and change the loop condition accordingly, while also adding the 'unlikely' tag to the check since it's not supposed to be triggered. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit eba444f1c0ecaf4a1992fb40a2c9e7a8cb3fdd5d Author: Filipe Manana Date: Fri Sep 8 18:20:32 2023 +0100 btrfs: return -EUCLEAN if extent item is missing when searching inline backref At lookup_inline_extent_backref() when trying to insert an inline backref, if we don't find the extent item we log an error and then return -EIO. This error code is confusing because there was actually no IO error, and this means we have some corruption, either caused by a bug or something like a memory bitflip for example. So change the error code from -EIO to -EUCLEAN. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit cc925b9646b4d91dd2536bf7c5ec0dee103fd341 Author: Filipe Manana Date: Fri Sep 8 18:20:31 2023 +0100 btrfs: use a single variable for return value at lookup_inline_extent_backref() At lookup_inline_extent_backref(), instead of using a 'ret' and an 'err' variable for tracking the return value, use a single one ('ret'). This simplifies the code, makes it comply with most of the existing code and it's less prone for logic errors as time has proven over and over in the btrfs code. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 20fb05a6d10ea3ef517bda59a195234a416555c9 Author: Filipe Manana Date: Fri Sep 8 18:20:30 2023 +0100 btrfs: use a single variable for return value at run_delayed_extent_op() Instead of using a 'ret' and an 'err' variable at run_delayed_extent_op() for tracking the return value, use a single one ('ret'). This simplifies the code, makes it comply with most of the existing code and it's less prone for logic errors as time has proven over and over in the btrfs code. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit e721043a988c524e4771c43246d2f7a1996bb020 Author: Filipe Manana Date: Fri Sep 8 18:20:28 2023 +0100 btrfs: remove pointless 'ref_root' variable from run_delayed_data_ref() The 'ref_root' variable, at run_delayed_data_ref(), is not really needed as we can always use ref->root directly, plus its initialization to 0 is completely pointless as we assign it ref->root before its first use. So just drop that variable and use ref->root directly. This may help avoid some warnings with clang tools such as the one reported/fixed by commit 966de47ff0c9 ("btrfs: remove redundant initialization of variables in log_new_ancestors"). Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7cce0d690d4e4e3278bd4cf3fd3a168ae62a1419 Author: Filipe Manana Date: Fri Sep 8 18:20:27 2023 +0100 btrfs: initialize key where it's used when running delayed data ref At run_delayed_data_ref() we are always initializing a key but the key is only needed and used if we are inserting a new extent. So move the declaration and initialization of the key to 'if' branch where it's used. Also rename the key from 'ins' to 'key', as it's a more clear name. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1df6b3c06089dd020e31f134adb124de6e315e6a Author: Filipe Manana Date: Fri Sep 8 18:20:26 2023 +0100 btrfs: remove refs_to_drop argument from __btrfs_free_extent() Currently the 'refs_to_drop' argument of __btrfs_free_extent() always matches the value of node->ref_mod, so remove the argument and use node->ref_mod at __btrfs_free_extent(). Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 88b2d08879b0f4e251d38cd3d77332da52d9cf44 Author: Filipe Manana Date: Fri Sep 8 18:20:25 2023 +0100 btrfs: remove refs_to_add argument from __btrfs_inc_extent_ref() Currently the 'refs_to_add' argument of __btrfs_inc_extent_ref() always matches the value of node->ref_mod, so remove the argument and use node->ref_mod at __btrfs_inc_extent_ref(). Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit abff279eb3ce29f345f3ba5a88730230bb929876 Author: Filipe Manana Date: Fri Sep 8 18:20:22 2023 +0100 btrfs: remove the refcount warning/check at btrfs_put_delayed_ref() At btrfs_put_delayed_ref(), it's pointless to have a WARN_ON() to check if the refcount of the delayed ref is zero. Such check is already done by the refcount_t module and refcount_dec_and_test(), which loudly complains if we try to decrement a reference count that is currently 0. The WARN_ON() dates back to the time when used a regular atomic_t type for the reference counter, before we switched to the refcount_t type. The main goal of the refcount_t type/module is precisely to catch such types of bugs and loudly complain if they happen. This also reduces a bit the module's text size. Before this change: $ size fs/btrfs/btrfs.ko text data bss dec hex filename 1612483 167145 16864 1796492 1b698c fs/btrfs/btrfs.ko After this change: $ size fs/btrfs/btrfs.ko text data bss dec hex filename 1612371 167073 16864 1796308 1b68d4 fs/btrfs/btrfs.ko Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3cbb9f516033602c8368c5ddbf3bae38715517c0 Author: Filipe Manana Date: Fri Sep 8 18:20:21 2023 +0100 btrfs: remove unnecessary logic when running new delayed references When running delayed references, at btrfs_run_delayed_refs(), we have this logic to run any new delayed references that might have been added just after we ran all delayed references. This logic grabs the first delayed reference, then locks it to wait for any contention on it before running all new delayed references. This however is pointless and not necessary because at __btrfs_run_delayed_refs() when we start running delayed references, we pick the first reference with btrfs_obtain_ref_head() and then we will lock it (with btrfs_delayed_ref_lock()). So remove the duplicate and unnecessary logic at btrfs_run_delayed_refs(). Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 03551d651e9d8ff5b310f9038581b2b030daeb87 Author: Filipe Manana Date: Fri Sep 8 18:20:20 2023 +0100 btrfs: pass a space_info argument to btrfs_reserve_metadata_bytes() We are passing a block reserve argument to btrfs_reserve_metadata_bytes() which is not really used, all we need is to pass the space_info associated to the block reserve, we don't change the block reserve at all. Not only it's pointless to pass the block reserve, it's also confusing as one might think that the reserved bytes will end up being added to the passed block reserve, when that's not the case. The pattern for reserving space and adding it to a block reserve is to first reserve space with btrfs_reserve_metadata_bytes() and if that succeeds, then add the space to a block reserve by calling btrfs_block_rsv_add_bytes(). Also the reverse of btrfs_reserve_metadata_bytes(), which is btrfs_space_info_free_bytes_may_use(), takes a space_info argument and not a block reserve, so one more reason to pass a space_info and not a block reserve to btrfs_reserve_metadata_bytes(). So change btrfs_reserve_metadata_bytes() and its callers to pass a space_info argument instead of a block reserve argument. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 9fb2acc2fe07f15b6cfe94a4bf910d3dfcd6e127 Author: Qu Wenruo Date: Sun Sep 17 19:36:21 2023 +0930 btrfs: remove the need_raid_map parameter from btrfs_map_block() The parameter @need_raid_map is mostly a legacy from the old days where we don't yet have a solid definition on the @mirror_num, and only check-integrity was using that parameter, while all other call sites just pass 1 for that parameter. Now since we have removed check-integrity functionality, we can also remove the @need_raid_map parameter. This change will also remove the ability to read P/Q stripe directly when passing 0 as @need_raid_map. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 732fab95abe2510560c8158e0d2e94460d38b2f4 Author: Qu Wenruo Date: Fri Sep 8 14:42:17 2023 +0800 btrfs: check-integrity: remove CONFIG_BTRFS_FS_CHECK_INTEGRITY option Since all check-integrity entry points have been removed, let's also remove the config and all related code relying on that. And since we have removed the mount option for check-integrity, we also need to re-number all the BTRFS_MOUNT_* enums. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit fb2a836da4513cb2e0d9bb8548f3f095a814dda5 Author: Qu Wenruo Date: Fri Sep 8 14:42:16 2023 +0800 btrfs: check-integrity: remove btrfsic_unmount() function The function btrfsic_mount() is part of the deprecated check-integrity functionality. Now let's remove the main entry point of check-integrity, and thankfully most of the check-integrity code is self-contained inside check-integrity.c, we can safely remove the function without huge changes to btrfs code base. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit af32d3632e7d2031f6581fe6297d39cdb6255893 Author: Qu Wenruo Date: Fri Sep 8 14:42:15 2023 +0800 btrfs: check-integrity: remove btrfsic_mount() function The function btrfsic_mount() is part of the deprecated check-integrity functionality. Now let's remove the main entry point of check-integrity, and thankfully most of the check-integrity code is self-contained inside check-integrity.c, we can safely remove the function without huge changes to btrfs code base. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 51cf580c23627de4eaf3d96b8ea7275770bacf6d Author: Qu Wenruo Date: Fri Sep 8 14:42:14 2023 +0800 btrfs: check-integrity: remove btrfsic_check_bio() function The function btrfsic_check_bio() is part of the deprecated check-integrity functionality. Now let's remove the main entry point of check-integrity, and thankfully most of the check-integrity code is self-contained inside check-integrity.c, we can safely remove the function without huge changes to btrfs code base. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 150cce2d9fbe0acb48da737f8ea443d8b0847b72 Author: David Sterba Date: Fri Sep 8 01:09:42 2023 +0200 btrfs: move extent_buffer::lock_owner to debug section The lock_owner is used for a rare corruption case and we haven't seen any reports in years. Move it to the debugging section of eb. To close the holes also move log_index so the final layout looks like: struct extent_buffer { u64 start; /* 0 8 */ long unsigned int len; /* 8 8 */ long unsigned int bflags; /* 16 8 */ struct btrfs_fs_info * fs_info; /* 24 8 */ spinlock_t refs_lock; /* 32 4 */ atomic_t refs; /* 36 4 */ int read_mirror; /* 40 4 */ s8 log_index; /* 44 1 */ /* XXX 3 bytes hole, try to pack */ struct callback_head callback_head __attribute__((__aligned__(8))); /* 48 16 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct rw_semaphore lock; /* 64 40 */ struct page * pages[16]; /* 104 128 */ /* size: 232, cachelines: 4, members: 11 */ /* sum members: 229, holes: 1, sum holes: 3 */ /* forced alignments: 1, forced holes: 1, sum forced holes: 3 */ /* last cacheline: 40 bytes */ } __attribute__((__aligned__(8))); This saves 8 bytes in total and still keeps the lock on a separate cacheline. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 321f4992c127458e51009b5160567b72e3442ff3 Author: David Sterba Date: Fri Sep 8 01:09:40 2023 +0200 btrfs: reduce size of struct btrfs_ref We can reduce two members' size that in turn reduce size of struct btrfs_ref from 64 to 56 bytes. As the structure is often used as a local variable several functions reduce their stack usage. - make enum btrfs_ref_type packed, there are only 4 values - switch action and its values to a packed enum Final structure layout: struct btrfs_ref { enum btrfs_ref_type type; /* 0 1 */ enum btrfs_delayed_ref_action action; /* 1 1 */ bool skip_qgroup; /* 2 1 */ /* XXX 5 bytes hole, try to pack */ u64 bytenr; /* 8 8 */ u64 len; /* 16 8 */ u64 parent; /* 24 8 */ union { struct btrfs_data_ref data_ref; /* 32 24 */ struct btrfs_tree_ref tree_ref; /* 32 16 */ }; /* 32 24 */ /* size: 56, cachelines: 1, members: 7 */ /* sum members: 51, holes: 1, sum holes: 5 */ /* last cacheline: 56 bytes */ }; Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit e41570d379b1dd6fe477a31b3b05191b6580f183 Author: David Sterba Date: Fri Sep 8 01:09:38 2023 +0200 btrfs: reduce size and reorder compression members in struct btrfs_inode Currently the compression type values are bounded and fit to an u8, we can pack the btrfs_inode a bit by reordering them to the space created by the location key. This reduces size from 1112 to 1104. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 105c8c42141b7b1ed119cbb93a2930a05f5e681a Author: David Sterba Date: Fri Sep 8 01:09:35 2023 +0200 btrfs: reduce size of prelim_ref::level The values of level are bounded and fit into a byte so let's use it for the structure to reduce size from 88 to 80 bytes on a release build, which increases number of objects in the default 8K slab from 93 to 102. struct prelim_ref { struct rb_node rbnode __attribute__((__aligned__(8))); /* 0 24 */ u64 root_id; /* 24 8 */ struct btrfs_key key_for_search; /* 32 17 */ u8 level; /* 49 1 */ /* XXX 2 bytes hole, try to pack */ int count; /* 52 4 */ struct extent_inode_elem * inode_list; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ u64 parent; /* 64 8 */ u64 wanted_disk_byte; /* 72 8 */ /* size: 80, cachelines: 2, members: 8 */ /* sum members: 78, holes: 1, sum holes: 2 */ /* forced alignments: 1 */ /* last cacheline: 16 bytes */ } __attribute__((__aligned__(8))); Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 02cd00fa78453a71d6c71d641e1a83a0ef9e375f Author: David Sterba Date: Fri Sep 8 01:09:33 2023 +0200 btrfs: reduce arguments of helpers space accounting root item There are two helpers to increase used bytes of root items that add or subtract one node size, we don't need to pass the argument for that. Rename the function so it matches the root item member that gets changed. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 007dec8c7edd22cdca3968d0000b318a245e43b7 Author: David Sterba Date: Fri Sep 8 01:09:31 2023 +0200 btrfs: reduce parameters of btrfs_pin_extent_for_log_replay Both callers of btrfs_pin_extent_for_log_replay expand the parameters to extent buffer members. We can simply pass the extent buffer instead. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit f863c50277c57cdbd6b0d1bbddb2b19a25016151 Author: David Sterba Date: Fri Sep 8 01:09:29 2023 +0200 btrfs: reduce parameters of btrfs_pin_reserved_extent There is only one caller of btrfs_pin_reserved_extent that expands the parameters to extent buffer members. We can simply pass the extent buffer instead. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 203f6a8772fc631a946525decb5df6d98da3730d Author: David Sterba Date: Fri Sep 8 01:09:27 2023 +0200 btrfs: drop __must_check annotations Drop all __must_check annotations because they're used in random functions and not consistently. All errors should be handled. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 9580503bcb6e1169c72f2cceb80af4c65d17b1da Author: David Sterba Date: Fri Sep 8 01:09:25 2023 +0200 btrfs: reformat remaining kdoc style comments Function name in the comment does not bring much value to code not exposed as API and we don't stick to the kdoc format anymore. Update formatting of parameter descriptions. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 33b6b2519127eda18fdab6e2f98855cfb855a452 Author: David Sterba Date: Fri Sep 8 01:09:22 2023 +0200 btrfs: move functions comments from qgroup.h to qgroup.c We keep the comments next to the implementation, there were some left to move. Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit cb6eb4757e1ea7867bcfe4b8a8b6199cc803b8c2 Author: Anand Jain Date: Thu Sep 7 00:16:41 2023 +0800 btrfs: comment about fsid and metadata_uuid relationship Add a comment explaining the relationship between fsid and metadata_uuid in the on-disk superblock and the in-memory struct btrfs_fs_devices. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1246873114cf6e4cfbd9530ba70911f6c802510d Author: Jiapeng Chong Date: Wed Sep 13 17:43:27 2023 +0800 btrfs: qgroup: remove unused helpers for ulist aux data These functions are defined in the qgroup.c file, but not called anymore since commit "btrfs: qgroup: use qgroup_iterator_nested to in qgroup_update_refcnt()" so we can delete them. fs/btrfs/qgroup.c:149:19: warning: unused function 'qgroup_to_aux'. fs/btrfs/qgroup.c:154:36: warning: unused function 'unode_aux_to_qgroup'. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6566 Reviewed-by: Johannes Thumshirn Signed-off-by: Jiapeng Chong Reviewed-by: David Sterba Signed-off-by: David Sterba commit 79ace7b807281ed4c9c4a847ef9bce71a4f5fa97 Author: Qu Wenruo Date: Fri Sep 1 10:11:16 2023 +0800 btrfs: qgroup: prealloc btrfs_qgroup_list for __add_relation_rb() Currently we go GFP_ATOMIC allocation for qgroup relation add, this includes the following 3 call sites: - btrfs_read_qgroup_config() This is not really needed, as at that time we're still in single thread mode, and no spin lock is held. - btrfs_add_qgroup_relation() This one is holding a spinlock, but we're ensured to add at most one relation, thus we can easily do a preallocation and use the preallocated memory to avoid GFP_ATOMIC. - btrfs_qgroup_inherit() This is a little more tricky, as we may have as many relationships as inherit::num_qgroups. Thus we have to properly allocate an array then preallocate all the memory. This patch would remove the GFP_ATOMIC allocation for above involved call sites, by doing preallocation before holding the spinlock, and let __add_relation_rb() to handle the freeing of the structure. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8d54518b5e52e5b351cb5893f83990093699e415 Author: Qu Wenruo Date: Tue Aug 29 19:48:57 2023 +0800 btrfs: qgroup: pre-allocate btrfs_qgroup to reduce GFP_ATOMIC usage Qgroup is the heaviest user of GFP_ATOMIC, but one call site does not really need GFP_ATOMIC, that is add_qgroup_rb(). That function only searches the rbtree to find if we already have such entry. If not, then it would try to allocate memory for it. This means we can afford to pre-allocate such structure unconditionally, then free the memory if it's not needed. Considering this function is not a hot path, only utilized by the following functions: - btrfs_qgroup_inherit() For "btrfs subvolume snapshot -i" option. - btrfs_read_qgroup_config() At mount time, and we're ensured there would be no existing rb tree entry for each qgroup. - btrfs_create_qgroup() Thus we're completely safe to pre-allocate the extra memory for btrfs_qgroup structure, and reduce unnecessary GFP_ATOMIC usage. Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit dce28769a33a95425b007f00842d6e12ffa28f83 Author: Qu Wenruo Date: Sat Sep 2 08:13:57 2023 +0800 btrfs: qgroup: use qgroup_iterator_nested to in qgroup_update_refcnt() The ulist @qgroups is utilized to record all involved qgroups from both old and new roots inside btrfs_qgroup_account_extent(). Due to the fact that qgroup_update_refcnt() itself is already utilizing qgroup_iterator, here we have to introduce another list_head, btrfs_qgroup::nested_iterator, allowing nested iteration. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit a4a81383fbf8c4e17ea6bbc7f005be98f5ece61b Author: Qu Wenruo Date: Sat Sep 2 08:13:56 2023 +0800 btrfs: qgroup: use qgroup_iterator to replace tmp ulist in qgroup_update_refcnt() For function qgroup_update_refcnt(), we use @tmp list to iterate all the involved qgroups of a subvolume. It's a perfect match for qgroup_iterator facility, as that @tmp ulist has a very limited lifespan (just inside the while() loop). By migrating to qgroup_iterator, we can get rid of the GFP_ATOMIC memory allocation and no error handling is needed. Reviewed-by: Boris Burkov Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit a0bdc04b073233b2fbd3c3ab039e74c617566d6c Author: Qu Wenruo Date: Sat Sep 2 08:13:55 2023 +0800 btrfs: qgroup: use qgroup_iterator in __qgroup_excl_accounting() With the new qgroup_iterator_add() and qgroup_iterator_clean(), we can get rid of the ulist and its GFP_ATOMIC memory allocation. Furthermore we can merge the code handling the initial and parent qgroups into one loop, and drop the @tmp ulist parameter for involved call sites. Reviewed-by: Boris Burkov Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0913445082496c2b29668ee26521401b273838b8 Author: Qu Wenruo Date: Sat Sep 2 08:13:54 2023 +0800 btrfs: qgroup: use qgroup_iterator in qgroup_convert_meta() With the new qgroup_iterator_add() and qgroup_iterator_clean(), we can get rid of the ulist and its GFP_ATOMIC memory allocation. Reviewed-by: Boris Burkov Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 25152cb7a88789f56f95fc672d3c2d9eb8aea3df Author: Qu Wenruo Date: Sat Sep 2 08:13:53 2023 +0800 btrfs: qgroup: use qgroup_iterator in btrfs_qgroup_free_refroot() With the new qgroup_iterator_add() and qgroup_iterator_clean(), we can get rid of the ulist and its GFP_ATOMIC memory allocation. Reviewed-by: Boris Burkov Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 686c4a5a42635e0d2889e3eb461c554fd0b616b4 Author: Qu Wenruo Date: Sat Sep 2 08:13:52 2023 +0800 btrfs: qgroup: iterate qgroups without memory allocation for qgroup_reserve() Qgroup heavily relies on ulist to go through all the involved qgroups, but since we're using ulist inside fs_info->qgroup_lock spinlock, this means we're doing a lot of GFP_ATOMIC allocations. This patch reduces the GFP_ATOMIC usage for qgroup_reserve() by eliminating the memory allocation completely. This is done by moving the needed memory to btrfs_qgroup::iterator list_head, so that we can put all the involved qgroup into a on-stack list, thus eliminating the need to allocate memory while holding spinlock. The only cost is the slightly higher memory usage, but considering the reduce GFP_ATOMIC during a hot path, it should still be acceptable. Function qgroup_reserve() is the perfect start point for this conversion. Reviewed-by: Boris Burkov Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2a3a1dd99e043b64c0f61cb3960040fd697d87bf Author: Josef Bacik Date: Fri Aug 25 16:19:30 2023 -0400 btrfs: remove extraneous includes from ctree.h We don't need any of these includes in the ctree.h header file for the header file itself, remove them to clean up ctree.h a little bit. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit c60a28806c00e02181868528bc49d175e335d8e0 Author: Josef Bacik Date: Fri Aug 25 16:19:29 2023 -0400 btrfs: include linux/security.h in super.c We use some of the security related code in here, include it in super.c so we can remove the include from ctree.h. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5335f4376cdc3b19e2b36bf31ad6664092f0e356 Author: Josef Bacik Date: Fri Aug 25 16:19:28 2023 -0400 btrfs: include trace header in where necessary If we no longer include the tracepoints from ctree.h we fail to compile because we have the dependency in some of the header files and source files. Add the include where we have these dependencies to allow us to remove the include from ctree.h. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 82cc2ade2a9a911cb040d3e752154ef9a16ba6c6 Author: Josef Bacik Date: Fri Aug 25 16:19:27 2023 -0400 btrfs: add btrfs_delayed_ref_head declaration to extent-tree.h extent-tree.h uses btrfs_delayed_ref_head in a function argument but doesn't pull it's declaration from anywhere, add it to the top of the header. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 04cc63d12c788e75e2d1a3850b8425724a7fe739 Author: Josef Bacik Date: Fri Aug 25 16:19:26 2023 -0400 btrfs: add fscrypt related dependencies to respective headers These headers have struct fscrypt_str as function arguments, so add struct fscrypt_str to the theader, and include linux/fscrypt.h in btrfs_inode.h as it also needs the definition of struct fscrypt_name for the new inode args. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3ecb43cb64597f1c645efe8e4d1caff3557e98c4 Author: Josef Bacik Date: Fri Aug 25 16:19:25 2023 -0400 btrfs: include linux/iomap.h in file.c We use the iomap code in file.c, include it so we have our dependencies. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit f005d997c4defa35d092aa3da11c44432a266a9a Author: Josef Bacik Date: Fri Aug 25 16:19:23 2023 -0400 btrfs: include asm/unaligned.h in accessors.h We use the unaligned helpers directly in accessors.h, add the include here. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1b9e6a15bcc9abd5e6d641a29b82aad5d8e801d8 Author: Josef Bacik Date: Fri Aug 25 16:19:22 2023 -0400 btrfs: move btrfs_name_hash to dir-item.h This is related to the name hashing for dir items, move it into dir-item.h. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 98e4f060c4f565a3b62e8cdfe6b89f59167312b6 Author: Josef Bacik Date: Fri Aug 25 16:19:21 2023 -0400 btrfs: move btrfs_extref_hash into inode-item.h Ideally this would be un-inlined, but that is a cleanup for later. For now move this into inode-item.h, which is where the extref code lives. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 03e86348965a5fa13593db8682132033d663f7ee Author: Josef Bacik Date: Fri Aug 25 16:19:20 2023 -0400 btrfs: remove btrfs_crc32c wrapper This simply sends the same arguments into crc32c(), and is just used in a few places. Remove this wrapper and directly call crc32c() in these instances. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 102f2640a346e84cb5c2d19805a9dd38a776013c Author: Josef Bacik Date: Fri Aug 25 16:19:19 2023 -0400 btrfs: move btrfs_crc32c_final into free-space-cache.c This is the only place this helper is used, take it out of ctree.h and move it into free-space-cache.c. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1c94674b25cfb2c51b73ff156ca5e08e0f9f398e Author: Qu Wenruo Date: Tue Aug 29 15:14:25 2023 +0800 btrfs: do not require EXTENT_NOWAIT for btrfs_redirty_list_add() The flag EXTENT_NOWAIT is a special flag to notify extent-io-tree code that this operation should not sleep for the extent state preallocation. However for btrfs_redirty_list_add(), all callers are able to sleep: - clean_log_buffer() Just 2 lines before, we call btrfs_pin_reserved_extent(), which calls pin_down_extent(), and that function does not require EXTENT_NOWAIT. Thus we're safe to call it without EXTENT_NOWAIT. - btrfs_free_tree_block() This function have several call sites which trigger tree read, e.g. walk_up_proc(), thus we're safe to call it without EXTENT_NOWAIT. Thus there is no need to require EXTENT_NOWAIT flag. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit f7361d8c3fc3df524bd17517f37adb619c5f99bb Author: Anand Jain Date: Wed Aug 23 22:52:13 2023 +0800 btrfs: sipmlify uuid parameters of alloc_fs_devices() Among all the callers, only the device_list_add() function uses the second argument of alloc_fs_devices(). It passes metadata_uuid when available, otherwise, it passes NULL. And in turn, alloc_fs_devices() is designed to copy either metadata_uuid or fsid into fs_devices::metadata_uuid. So remove the second argument in alloc_fs_devices(), and always copy the fsid. In the caller device_list_add() function, we will overwrite it with metadata_uuid when it is available. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 01fc062bd0e6e0e06d09c7ce22dc51007dd1afa5 Author: Filipe Manana Date: Mon Aug 28 08:38:36 2023 +0100 btrfs: update comment for reservation of metadata space for delayed items The second comment at btrfs_delayed_item_reserve_metadata() refers to a field named "index_items_size" of a delayed inode, however that field does not exists - it existed in a previous patch version, but then it split into the fields "curr_index_batch_size" and "index_item_leaves" in the final patch version that was picked. So update the comment. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3f720b21ec5af466e50e99dc517af267b67d248c Author: Shyam Sundar S K Date: Tue Oct 10 20:20:03 2023 +0530 platform/x86/amd/pmc: Add dump_custom_stb module parameter There have been instances when the default size (1M) of the STB is not sufficient to get the complete traces of the failure. In such scenarios we can use a module_param to enable full trace that shall contain more debugging data. This is not a regular case and hence not enabling this capability by default. With this change, there will be two cases on how the driver fetches the stb data: 1) A special case (proposed now) - which is required only for certain platforms. Here, a new module param will be supplied to the driver that will have a special PMFW supporting enhanced dram sizes for getting the stb data. Without the special PMFW support, just setting the module param will not help to get the enhanced stb data. To adapt to this change, we will have a new amd_pmc_stb_handle_efr() to handle enhanced firmware reporting mechanism. Note that, since num_samples based r/w pointer offset calculation is not required for enhanced firmware reporting we will have this mailbox command sent only in case of regular STB cases. 2) Current code branch which fetches the stb data based on the parameters like the num_samples, fsize and the r/w pointer. Reviewed-by: Ilpo Järvinen Reviewed-by: Hans de Goede Co-developed-by: Harsh Jain Signed-off-by: Harsh Jain Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20231010145003.139932-3-Shyam-sundar.S-k@amd.com [ij: Renamed flex_arr -> stb_data_arr] Signed-off-by: Ilpo Järvinen commit 30febae71c6182e0762dc7744737012b4f8e6a6d Author: Herbert Xu Date: Wed Aug 30 17:57:06 2023 +0800 crypto: testmgr - Remove zlib-deflate Remove zlib-deflate test vectors as it no longer exists in the kernel. Signed-off-by: Herbert Xu Reviewed-by: Ard Biesheuvel commit 62a465c25e99b9a98259a6b7f5bb759f5296d501 Author: Herbert Xu Date: Wed Aug 30 17:56:25 2023 +0800 crypto: deflate - Remove zlib-deflate Remove the implementation of zlib-deflate because it is completely unused in the kernel. Signed-off-by: Herbert Xu Reviewed-by: Ard Biesheuvel commit e9dd20e0e5f62d01d9404db2cf9824d1faebcf71 Author: Herbert Xu Date: Wed Aug 30 17:55:02 2023 +0800 crypto: qat - Remove zlib-deflate Remove the implementation of zlib-deflate because it is completely unused in the kernel. Signed-off-by: Herbert Xu Reviewed-by: Ard Biesheuvel commit b136225746a9793bdff9c78b215eac4f64bf21f2 Author: Shyam Sundar S K Date: Tue Oct 10 20:20:02 2023 +0530 platform/x86/amd/pmc: Handle overflow cases where the num_samples range is higher In amd_pmc_stb_debugfs_open_v2(), the stb buffer is created based on the num_samples and the read/write pointer offset. This holds good when the num_samples reported by PMFW is less than S2D_TELEMETRY_BYTES_MAX; where the stb buffer gets filled from 0th position until S2D_TELEMETRY_BYTES_MAX - 1 based on the read/write pointer offset. But when the num_samples exceeds the S2D_TELEMETRY_BYTES_MAX, the current code does not handle it well as it does not account for the cases where the stb buffer has to filled up as a circular buffer. Handle this scenario into two cases, where first memcpy will have the samples from location: (num_samples % S2D_TELEMETRY_BYTES_MAX) - (S2D_TELEMETRY_BYTES_MAX - 1) and next memcpy will have the newest ones i.e. 0 - (num_samples % S2D_TELEMETRY_BYTES_MAX - 1) Suggested-by: Hans de Goede Reviewed-by: Hans de Goede Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20231010145003.139932-2-Shyam-sundar.S-k@amd.com [ij: renamed flex_arr -> stb_data_arr] Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 09de3691daab15ae125cbf32f9f72fc90eada49d Author: Rob Herring Date: Fri Oct 6 17:44:01 2023 -0500 memory: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20231006224402.442078-1-robh@kernel.org Signed-off-by: Krzysztof Kozlowski commit d9f421da6b9287000f8253628d54cf89b0c14da5 Author: Shyam Sundar S K Date: Tue Oct 10 20:20:01 2023 +0530 platform/x86/amd/pmc: Use flex array when calling amd_pmc_stb_debugfs_open_v2() Currently in amd_pmc_stb_debugfs_open_v2() the buffer size is assumed to be fixed and a second call to amd_pmc_stb_debugfs_open_v2() may race with a process holding open another fd. This could change "fsize" to a bigger size causing an out of bounds read. Instead create a struct with a flexarray to solve this. Suggested-by: Hans de Goede Reviewed-by: Hans de Goede Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20231010145003.139932-1-Shyam-sundar.S-k@amd.com [ij: renamed flex_arr -> stb_data_arr] Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 5a026767275ef0ba6d7aba37629d9ec638aabb7d Author: Andy Shevchenko Date: Tue Oct 10 16:40:19 2023 +0300 platform/x86: asus-wireless: Replace open coded acpi_match_acpi_device() Replace open coded acpi_match_acpi_device() in asus_wireless_add(). Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231010134019.3892062-1-andriy.shevchenko@linux.intel.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 2f0968a030f2a5dd4897a0151c8395bf5babe5b0 Author: Florian Westphal Date: Thu Oct 12 14:08:56 2023 +0200 net: gso_test: fix build with gcc-12 and earlier gcc 12 errors out with: net/core/gso_test.c:58:48: error: initializer element is not constant 58 | .segs = (const unsigned int[]) { gso_size }, This version isn't old (2022), so switch to preprocessor-bsaed constant instead of 'static const int'. Cc: Willem de Bruijn Reported-by: Tasmiya Nalatwad Closes: https://lore.kernel.org/netdev/79fbe35c-4dd1-4f27-acb2-7a60794bc348@linux.vnet.ibm.com/ Fixes: 1b4fa28a8b07 ("net: parametrize skb_segment unit test to expand coverage") Signed-off-by: Florian Westphal Reviewed-by: Willem de Bruijn Link: https://lore.kernel.org/r/20231012120901.10765-1-fw@strlen.de Signed-off-by: Paolo Abeni commit 39789590cff4043d81774d03777dabf7ba263176 Author: Andy Shevchenko Date: Tue Oct 10 16:39:36 2023 +0300 platform/x86: xo15-ebook: Replace open coded acpi_match_acpi_device() Replace open coded acpi_match_acpi_device() in ebook_switch_add(). Note, while it is a bit longer it is more robust in case more IDs will be added. Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231010133936.3891996-1-andriy.shevchenko@linux.intel.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 48173b0003c5dc556e262e1b57c25efc36db1c6a Author: Suma Hegde Date: Tue Oct 10 12:03:10 2023 +0000 platform/x86/amd/hsmp: improve the error log 1. Change print message during platform init to a more meaningful clear message. 2. Return the error code returned by hsmp_test() itself, rather then returning a common EOPNOTSUPP error. Signed-off-by: Suma Hegde Reviewed-by: Naveen Krishna Chatradhi Link: https://lore.kernel.org/r/20231010120310.3464066-3-suma.hegde@amd.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 9def28f3b8634e4f1fa92a77ccb65fbd2d03af34 Author: Jon Hunter Date: Thu Oct 12 11:49:09 2023 +0100 memory: tegra: Add Tegra234 clients for RCE and VI Add the Tegra234 memory client entries for the Real-time Camera Engine (RCE) and Video Input (VI) devices. Signed-off-by: Jon Hunter Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20231012104909.48518-1-jonathanh@nvidia.com Signed-off-by: Krzysztof Kozlowski commit 5150542b8ec5fb561be080ed0ef3bab8598154c3 Author: Suma Hegde Date: Tue Oct 10 12:03:09 2023 +0000 platform/x86/amd/hsmp: add support for metrics tbl AMD MI300 MCM provides GET_METRICS_TABLE message to retrieve all the system management information from SMU. The metrics table is made available as hexadecimal sysfs binary file under per socket sysfs directory created at /sys/devices/platform/amd_hsmp/socket%d/metrics_bin Metrics table definitions will be documented as part of Public PPR. The same is defined in the amd_hsmp.h header. Signed-off-by: Suma Hegde Reviewed-by: Naveen Krishna Chatradhi Link: https://lore.kernel.org/r/20231010120310.3464066-2-suma.hegde@amd.com [ij: lseek -> lseek(), dram -> DRAM in dev_err()] [ij: added period to terminate a documentation sentence] Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 04317b129e4eb5c6f4a58bb899b2019c1545320b Author: Shihong Wang Date: Mon Oct 9 10:09:46 2023 +0200 nfp: add support CHACHA20-POLY1305 offload for ipsec Add the configuration of CHACHA20-POLY1305 to the driver and send the message to hardware so that the NIC supports the algorithm. Signed-off-by: Shihong Wang Signed-off-by: Louis Peens Link: https://lore.kernel.org/r/20231009080946.7655-2-louis.peens@corigine.com Signed-off-by: Paolo Abeni commit 01d2adcfe0f1bc0f08d822a04b2c354c106d4d2f Author: Suma Hegde Date: Tue Oct 10 12:03:08 2023 +0000 platform/x86/amd/hsmp: create plat specific struct Having a separate platform device structure helps in future, to contain platform specific variables and other data. Also, define macros for dev nodes Signed-off-by: Suma Hegde Reviewed-by: Naveen Krishna Chatradhi Link: https://lore.kernel.org/r/20231010120310.3464066-1-suma.hegde@amd.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 56bc311585206a8955de793301d4f84fb4ad2ee6 Author: Keerthy Date: Sun Oct 8 10:16:57 2023 +0530 arm64: dts: ti: k3-j712s2-mcu: Add the mcu domain watchdog instances There are totally 2 instances of watchdog module in MCU domain. These instances are coupled with the MCU domain R5F instances. Reserving them as they are not used by A72. Signed-off-by: Keerthy Link: https://lore.kernel.org/r/20231008044657.25788-8-j-keerthy@ti.com Signed-off-by: Vignesh Raghavendra commit eb4c9909dc49f742bdbb9e5d411a4ac1df1cb6d6 Author: Keerthy Date: Sun Oct 8 10:16:56 2023 +0530 arm64: dts: ti: k3-j721s2-main: Add the main domain watchdog instances There are totally 9 instances of watchdog module. One each for the 2 A72 cores, one each for the 2 C7x cores, 1 for the GPU, 1 each for the 4 R5F cores in the main domain. Keeping only the A72 instances enabled and reserving the rest by default as they will be used by their respective firmware. Signed-off-by: Keerthy Link: https://lore.kernel.org/r/20231008044657.25788-7-j-keerthy@ti.com Signed-off-by: Vignesh Raghavendra commit 9ac8006abcda58c0fd866f967b1a6a05aa3c6b48 Author: Keerthy Date: Sun Oct 8 10:16:55 2023 +0530 arm64: dts: ti: k3-j784s4-mcu: Add the mcu domain watchdog instances There are totally 2 instances of watchdog module in MCU domain. These instances are coupled with the MCU domain R5F instances. Disabling them as they are not used by Linux. Signed-off-by: Keerthy Link: https://lore.kernel.org/r/20231008044657.25788-6-j-keerthy@ti.com Signed-off-by: Vignesh Raghavendra commit caae599de8c6cc7405dcfd3bcd66a467eee23d2b Author: Keerthy Date: Sun Oct 8 10:16:54 2023 +0530 arm64: dts: ti: k3-j784s4-main: Add the main domain watchdog instances There are totally 19 instances of watchdog module. One each for the 8 A72 cores, one each for the 4 C7x cores, 1 for the GPU, 1 each for the 6 R5F cores in the main domain. The non-A72 instances are coupled with the R5Fs, C7x & GPU instances. Keeping them as reserved as they are not used by A72. Signed-off-by: Keerthy Link: https://lore.kernel.org/r/20231008044657.25788-5-j-keerthy@ti.com Signed-off-by: Vignesh Raghavendra commit 81be795bb3eac1a8cdbd5adb862044c12dc2b744 Author: Keerthy Date: Sun Oct 8 10:16:53 2023 +0530 arm64: dts: ti: k3-j7200: Add MCU domain ESM instance Patch adds the ESM instance for MCU domain of J7200. Signed-off-by: Keerthy Link: https://lore.kernel.org/r/20231008044657.25788-4-j-keerthy@ti.com Signed-off-by: Vignesh Raghavendra commit 1c4cc4ca5aff237544c502e6e5ffbe13f4c372fa Author: Keerthy Date: Sun Oct 8 10:16:52 2023 +0530 arm64: dts: ti: k3-j784s4: Add ESM instances Patch adds the ESM instances for J784s4. It has 3 instances. One in the main domain and two in the mcu-wakeup domain. Signed-off-by: Keerthy Link: https://lore.kernel.org/r/20231008044657.25788-3-j-keerthy@ti.com Signed-off-by: Vignesh Raghavendra commit dbf02264de7ab28933c152a2e5751f7ce9cd8c3d Author: Keerthy Date: Sun Oct 8 10:16:51 2023 +0530 arm64: dts: ti: k3-j721s2: Add ESM instances Patch adds the ESM instances for J721s2. It has 3 instances. One in the main domain and two in the mcu-wakeup domain. Signed-off-by: Keerthy Link: https://lore.kernel.org/r/20231008044657.25788-2-j-keerthy@ti.com Signed-off-by: Vignesh Raghavendra commit 62d0c458f828949dd01bfe41daf3bed73ab9e288 Author: Andrew Jones Date: Wed Sep 20 16:37:14 2023 +0200 KVM: riscv: selftests: get-reg-list print_reg should never fail When outputting the "new" register list we want to print all of the new registers, decoding as much as possible of each of them. Also, we don't want to assert while listing registers with '--list'. We output "/* UNKNOWN */" after each new register (which we were already doing for some), which should be enough. Signed-off-by: Andrew Jones Reviewed-by: Haibo Xu Signed-off-by: Anup Patel commit 2b3f2b78ec93bdb1cfd8574158719d54263d50d6 Author: Anup Patel Date: Fri Sep 15 22:32:40 2023 +0530 KVM: riscv: selftests: Add condops extensions to get-reg-list test We have a new conditional operations related ISA extensions so let us add these extensions to get-reg-list test. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit e1a8db0c9a0e7125c8e142c9eed7041ea37031d3 Author: Anup Patel Date: Fri Sep 15 21:52:12 2023 +0530 KVM: riscv: selftests: Add smstateen registers to get-reg-list test We have a new smstateen registers as separate sub-type of CSR ONE_REG interface so let us add these registers to get-reg-list test. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit 4d554e0226e6568c7b0b75418e7a24fefedbcefb Author: Anup Patel Date: Fri Sep 15 21:25:27 2023 +0530 KVM: riscv: selftests: Add senvcfg register to get-reg-list test We have a new senvcfg register in the general CSR ONE_REG interface so let us add it to get-reg-list test. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit df68f4d8cb496ea31fa42cf2620366571c05376b Author: Anup Patel Date: Fri Sep 15 17:51:10 2023 +0530 RISC-V: KVM: Allow Zicond extension for Guest/VM We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zicond extension for Guest/VM. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit 6a53a5fbc8f494e69922e13491f7077ce010ec28 Author: Andrew Jones Date: Thu Aug 17 18:23:46 2023 +0200 KVM: selftests: Add array order helpers to riscv get-reg-list Add a couple macros to use when filling arrays in order to ensure the elements are placed in the right order, regardless of the order we prefer to read them. And immediately apply the new macro to resorting the ISA extension lists alphabetically. Signed-off-by: Andrew Jones Reviewed-by: Haibo Xu Signed-off-by: Anup Patel commit 26c7d6d8a5a2ce9705e89d10683f3d41ed68de5c Author: Andrew Jones Date: Thu Aug 17 18:23:45 2023 +0200 MAINTAINERS: RISC-V: KVM: Add another kselftests path With the introduction of the get-reg-list test for riscv, another directory has been added that should be tracked by riscv kvm maintainers. Signed-off-by: Andrew Jones Reviewed-by: Haibo Xu Signed-off-by: Anup Patel commit c04913f2b54ee86be34d1a1e9df7b7876b12b8c0 Author: Mayuresh Chitale Date: Wed Sep 13 22:09:05 2023 +0530 RISCV: KVM: Add sstateen0 to ONE_REG Add support for sstateen0 CSR to the ONE_REG interface to allow its access from user space. Signed-off-by: Mayuresh Chitale Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit 81f0f314fec92a69d6c4951b9d9db21d37419669 Author: Mayuresh Chitale Date: Wed Sep 13 22:09:04 2023 +0530 RISCV: KVM: Add sstateen0 context save/restore Define sstateen0 and add sstateen0 save/restore for guest VCPUs. Signed-off-by: Mayuresh Chitale Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit db3c01c7a3081c6a6a50570e48bdbea509ba30e4 Author: Mayuresh Chitale Date: Wed Sep 13 22:09:03 2023 +0530 RISCV: KVM: Add senvcfg context save/restore Add senvcfg context save/restore for guest VCPUs and also add it to the ONE_REG interface to allow its access from user space. Signed-off-by: Mayuresh Chitale Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit d21b5d342fc12eb0a0f812864aa58aa9bb2c0599 Author: Mayuresh Chitale Date: Wed Sep 13 22:09:02 2023 +0530 RISC-V: KVM: Enable Smstateen accesses Configure hstateen0 register so that the AIA state and envcfg are accessible to the vcpus. This includes registers such as siselect, sireg, siph, sieh and all the IMISC registers. Signed-off-by: Mayuresh Chitale Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit fe0bab701e3b71a1d2db123c05b4f5c33098cc96 Author: Mayuresh Chitale Date: Wed Sep 13 22:09:01 2023 +0530 RISC-V: KVM: Add kvm_vcpu_config Add a placeholder for all registers such as henvcfg, hstateen etc which have 'static' configurations depending on extensions supported by the guest. The values are derived once and are then subsequently written to the corresponding CSRs while switching to the vcpu. Signed-off-by: Mayuresh Chitale Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit 00c6f39c8247b0a5ddca4586d43aec1af7cbccb6 Author: Anup Patel Date: Mon Sep 25 14:46:25 2023 +0530 dt-bindings: riscv: Add Zicond extension entry Add an entry for the Zicond extension to the riscv,isa-extensions property. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Signed-off-by: Anup Patel commit 662a601aa355c6917ed2bc1c4e316a4c0ee206ed Author: Anup Patel Date: Fri Sep 15 14:09:44 2023 +0530 RISC-V: Detect Zicond from ISA string The RISC-V integer conditional (Zicond) operation extension defines standard conditional arithmetic and conditional-select/move operations which are inspired from the XVentanaCondOps extension. In fact, QEMU RISC-V also has support for emulating Zicond extension. Let us detect Zicond extension from ISA string available through DT or ACPI. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Acked-by: Palmer Dabbelt Signed-off-by: Anup Patel commit a4f5f39849f39f62f5d4e88cbb600f95f927003d Author: Mayuresh Chitale Date: Wed Sep 13 22:09:00 2023 +0530 dt-bindings: riscv: Add smstateen entry Add an entry for the Smstateen extension to the riscv,isa-extensions property. Signed-off-by: Mayuresh Chitale Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley Signed-off-by: Anup Patel commit 9dbaf381008dfa2fad6225633004f7adb1bac252 Author: Mayuresh Chitale Date: Wed Sep 13 22:08:59 2023 +0530 RISC-V: Detect Smstateen extension Extend the ISA string parsing to detect the Smstateen extension. If the extension is enabled then access to certain 'state' such as AIA CSRs in VS mode is controlled by *stateen0 registers. Signed-off-by: Mayuresh Chitale Reviewed-by: Andrew Jones Signed-off-by: Anup Patel commit 70c613602b55d7011ccc4883ab5c0095db307db7 Author: Danila Tikhonov Date: Wed Sep 13 21:45:25 2023 +0300 iommu/arm-smmu-qcom: Add SM7150 SMMUv2 SM7150 uses a qcom,smmu-v2-style SMMU just for Adreno and friends. Add a compatible for it. Signed-off-by: Danila Tikhonov Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230913184526.20016-3-danila@jiaxyga.com Signed-off-by: Will Deacon commit c53cdc02915a380b69c9db9e59e86b3a98415a3d Author: Danila Tikhonov Date: Wed Sep 13 21:45:24 2023 +0300 dt-bindings: arm-smmu: Add SM7150 GPU SMMUv2 SM7150 has a qcom,smmu-v2-style SMMU just for Adreno and friends. Document it. Signed-off-by: Danila Tikhonov Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230913184526.20016-2-danila@jiaxyga.com Signed-off-by: Will Deacon commit 270a1470408e44619a55be1079254bf2ba0567fb Author: Richard Acayan Date: Mon Sep 25 19:42:48 2023 -0400 iommu/arm-smmu-qcom: Add SDM670 MDSS compatible Add the compatible for the MDSS client on the Snapdragon 670 so it can be properly configured by the IOMMU driver. Otherwise, there is an unhandled context fault. Signed-off-by: Richard Acayan Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230925234246.900351-3-mailingradian@gmail.com Signed-off-by: Will Deacon commit 618071ae0f7e8c1aeb9b1b1e9ee876bcc3f045fc Author: Ping-Ke Shih Date: Wed Oct 11 14:37:25 2023 +0800 wifi: rtw89: coex: add annotation __counted_by() to struct rtw89_btc_btf_set_mon_reg Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). Use struct_size() and flex_array_size() helpers to calculate proper sizes for allocation and memcpy(). Don't change logic at all, and result is identical as before. Cc: Kees Cook Signed-off-by: Ping-Ke Shih Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231011063725.25276-2-pkshih@realtek.com commit 07202dc12b5373a9488a81a1a256582eec701aaf Author: Ping-Ke Shih Date: Wed Oct 11 14:37:24 2023 +0800 wifi: rtw89: coex: add annotation __counted_by() for struct rtw89_btc_btf_set_slot_table Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). Use struct_size() and flex_array_size() helpers to calculate proper sizes for allocation and memcpy(). Don't change logic at all, and result is identical as before. Cc: Kees Cook Signed-off-by: Ping-Ke Shih Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231011063725.25276-1-pkshih@realtek.com commit f1f74dffdfb74e3c70ffc7d9b434e39d6d01a31d Author: Ping-Ke Shih Date: Wed Oct 11 19:52:56 2023 +0800 wifi: rtw89: add EHT radiotap in monitor mode Add IEEE80211_RADIOTAP_EHT and IEEE80211_RADIOTAP_EHT_USIG radiotap to fill basic EHT NSS, MCS, GI and bandwidth. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231011115256.6121-7-pkshih@realtek.com commit e25ef743866c28f8e70a3c409ba9254279b90bbe Author: Ping-Ke Shih Date: Wed Oct 11 19:52:55 2023 +0800 wifi: rtw89: show EHT rate in debugfs Since we have TX rate from RA report of C2H event and RX rate from RX descriptor, show them in debugfs like TX rate [1]: EHT 2SS MCS-7 GI:3.2 BW:80 (hw_rate=0x427) RX rate [1]: EHT 2SS MCS-7 GI:3.2 BW:80 (hw_rate=0x427) Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231011115256.6121-6-pkshih@realtek.com commit f456701201e2045da2db5fdf1f66e2565ee821d7 Author: Ping-Ke Shih Date: Wed Oct 11 19:52:54 2023 +0800 wifi: rtw89: parse TX EHT rate selected by firmware from RA C2H report RA (rate adaptive) C2H report is to reflect current TX rate firmware is using. Parse C2H event encoded in EHT mode, and then user space and debugfs can use the information to know TX rate. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231011115256.6121-5-pkshih@realtek.com commit 1f3cd090b4b2b51db4f5d1fc4d29cf0f3ce602d1 Author: Ping-Ke Shih Date: Wed Oct 11 19:52:53 2023 +0800 wifi: rtw89: Add EHT rate mask as parameters of RA H2C command Set EHT rate mask to RA (rate adaptive) H2C command according to handshake result. The EHT rate mask format looks like 44 28 12 4 0 +----------------+----------------+--------+----+ | EHT 2SS rate | EHT 1SS rate | OFDM | CCK| +----------------+----------------+--------+----+ Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231011115256.6121-4-pkshih@realtek.com commit 786a93c9b2327543c7b039fb732d9d6cc02382f6 Author: Ping-Ke Shih Date: Wed Oct 11 19:52:52 2023 +0800 wifi: rtw89: parse EHT information from RX descriptor and PPDU status packet There are two kinds of RX packets -- normal and its PPDU status packet. Both have RX descriptor containing some information such as rate, GI and bandwidth, and we use these information to find the relationship between two kinds of packets. Then, we can get more information like RSSI and EVM from PPDU status packet. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231011115256.6121-3-pkshih@realtek.com commit 61b546b1f3e24007bc39e31e332466725e7df470 Author: Ping-Ke Shih Date: Wed Oct 11 19:52:51 2023 +0800 wifi: radiotap: add bandwidth definition of EHT U-SIG Define EHT U-SIG bandwidth used by radiotap according to Table 36-28 "U-SIG field of an EHT MU PPDU" in 802.11be (D3.0). Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231011115256.6121-2-pkshih@realtek.com commit 0c27d27258ffaa2a1080a69e9740f8d0cde41bcd Author: Dmitry Antipov Date: Wed Oct 11 07:52:01 2023 +0300 wifi: rtlwifi: use convenient list_count_nodes() Simplify 'rtl92ee_dm_common_info_self_update()', 'rtl8723be_dm_common_info_self_update()', and 'rtl8821ae_dm_common_info_self_update()' by using 'list_count_nodes()'. Compile tested only. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231011045227.7989-1-dmantipov@yandex.ru commit d9756ce618f33ab0d2bf2983b49c32e2017c8b7b Author: Kees Cook Date: Mon Oct 9 09:10:35 2023 -0700 wifi: p54: Annotate struct p54_cal_database with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). Add __counted_by for struct p54_cal_database. Cc: Christian Lamparter Cc: Kalle Valo Cc: "Gustavo A. R. Silva" Cc: linux-wireless@vger.kernel.org Cc: linux-hardening@vger.kernel.org Suggested-by: Jason Andryuk Signed-off-by: Kees Cook Reviewed-by: Jason Andryuk Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231009161028.it.544-kees@kernel.org commit 41cb1126bed152f7679417834ad7ea39f2252dfb Author: Nathan Chancellor Date: Wed Oct 11 13:21:51 2023 -0700 ASoC: tegra: Fix -Wuninitialized in tegra210_amx_platform_probe() Clang warns (or errors with CONFIG_WERROR=y): sound/soc/tegra/tegra210_amx.c:553:10: error: variable 'soc_data' is uninitialized when used here [-Werror,-Wuninitialized] 553 | soc_data->regmap_conf); | ^~~~~~~~ A refactoring removed the initialization of this variable but its use was not updated. Use the soc_data value in the amx variable to resolve the warning and remove the soc_data variable, as it is now entirely unused. Closes: https://github.com/ClangBuiltLinux/linux/issues/1943 Fixes: 9958d85968ed ("ASoC: Use device_get_match_data()") Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20231011-asoc-tegra-fix-uninit-soc_data-v1-1-0ef0ab44cf48@kernel.org Signed-off-by: Mark Brown commit 5e07eb3ab981c5752c0e5ac324fbd166a12003ee Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:14 2023 +0200 ASoC: Intel: avs: ssm4567: Validate machine board configuration Allow for board to be used with TDMs. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-17-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 797611b5ce62f12a2c0812c0e4e3a2fb6ee9fb47 Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:13 2023 +0200 ASoC: Intel: avs: rt5663: Validate machine board configuration Allow for board to be used with TDMs. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-16-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit cc7ea744970176134d48cc6e004ebe7c9a0bb3da Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:12 2023 +0200 ASoC: Intel: avs: rt286: Validate machine board configuration Allow for board to be used with TDMs. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-15-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 70c101917aa1efa52a89dae5d5deee2a0c74de07 Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:11 2023 +0200 ASoC: Intel: avs: nau8825: Validate machine board configuration Allow for board to be used with TDMs. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-14-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit ef91ae9e682c85e57861234db7d5ad9d071b889b Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:10 2023 +0200 ASoC: Intel: avs: max98927: Validate machine board configuration Allow for board to be used with TDMs. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-13-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit a1ec836b17f7dea35f6b4b3a7c2ad4306da804c9 Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:09 2023 +0200 ASoC: Intel: avs: max98373: Validate machine board configuration Allow for board to be used with TDMs. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-12-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 8d5fed3312ebaa83338cf42746b29a01b9d3d13e Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:08 2023 +0200 ASoC: Intel: avs: es8336: Validate machine board configuration Allow for board to be used with TDMs. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-11-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit fc332ea1176d72502e81a3e9d4ea3bce05e77398 Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:07 2023 +0200 ASoC: Intel: avs: da7219: Validate machine board configuration Allow for board to be used with TDMs. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-10-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 060c0fd1afaec1d553fdd123ddd47368bd4b3a81 Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:06 2023 +0200 ASoC: Intel: avs: rt298: Validate machine board configuration Allow for board to be used with TDMs. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-9-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 863e3f18d08bae9ffc70306e251f75bdee5e0674 Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:05 2023 +0200 ASoC: Intel: avs: max98357a: Validate machine board configuration Allow for board to be used with TDMs. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-8-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 2172c5b90d80aedc7cbe571e353ae45040e03a3b Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:04 2023 +0200 ASoC: Intel: avs: rt5682: Validate machine board configuration Allow for board to be used with TDMs. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-7-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit b124d7cc6f3c08e5ae084e446e6ceff6c881c087 Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:03 2023 +0200 ASoC: Intel: avs: rt274: Validate machine board configuration Allow for board to be used with TDMs. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-6-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit d3decc196afdce9456442e2bdc9033fd5d2d00b3 Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:02 2023 +0200 ASoC: Intel: avs: i2s_test: Validate machine board configuration I2S test board can be used in any SSP and TDM configuration. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-5-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit e6d50e474e45862096932edc31932fbbd5e8f1c7 Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:01 2023 +0200 ASoC: Intel: avs: Improve topology parsing of dynamic strings Current mechanism replaces "%d" present in some routes and widget names with SSP number. However there are also configurations which make use of TDM number, in which case expected behavior would be to have string in form of SSP:TDM - see implementation of avs_i2s_platform_register() in sound/soc/intel/avs/pcm.c. Implement custom function, which parses string and make use of it when parsing topology. While at it make sure that we generate dynamic names only if there is no multiple SSPs or TDMs defined. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-4-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 7a6debe0478596ac892ecf3cc336aacf09a9e4d8 Author: Amadeusz Sławiński Date: Thu Oct 12 10:35:00 2023 +0200 ASoC: Intel: avs: Introduce helper functions for SSP and TDM handling In quite a few places in code there are checks for number of SSPs present on system, to reduce maintenance burden introduce helper functions allowing to get SSP and TDM from machine board configuration. Additionally in boards we use SSP and TDM to generate quite a few strings, it could be done like: if (tdms) dl->name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d:%d-Codec", ssp_port, tdm_slot); else dl->name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-Codec", ssp_port); but quite quickly code ends up with spaghetti of similar if elses. Instead introduce macro which can be used to generate correct string, allowing to minimize code to something like: dl->name = devm_kasprintf(dev, GFP_KERNEL, AVS_STRING_FMT("SSP", "-Codec", ssp_port, tdm_slot)); Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-3-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 393648ce731b087f5a685044c9e41afb815421f7 Author: Amadeusz Sławiński Date: Thu Oct 12 10:34:59 2023 +0200 ASoC: Intel: avs: Only create SSP%d snd_soc_dai_driver when requested When using TDM configuration some other device may be using SSP%d, so don't create snd_soc_dai_driver configuration for it unless requested by TDM configuration. While at it adjust tdf8532 board to explicitly describe TDM configuration. Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231012083514.492626-2-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 0abe7f61c28d62ee0530c31589e6ea209aa82cbd Author: Ilkka Koskinen Date: Thu Oct 12 00:41:03 2023 -0700 docs/perf: Add ampere_cspmu to toctree to fix a build warning Add ampere_cspmu to toctree in order to address the following warning produced when building documents: Documentation/admin-guide/perf/ampere_cspmu.rst: WARNING: document isn't included in any toctree Reported-by: Stephen Rothwell Closes: https://lore.kernel.org/all/20231011172250.5a6498e5@canb.auug.org.au/ Fixes: 53a810ad3c5c ("perf: arm_cspmu: ampere_cspmu: Add support for Ampere SoC PMU") Signed-off-by: Ilkka Koskinen Link: https://lore.kernel.org/r/20231012074103.3772114-1-ilkka@os.amperecomputing.com Signed-off-by: Will Deacon commit 89ca0ec59f11aa6e3871866d932503b3e3370385 Merge: 78857f7fe37a2 f28dde395937e Author: Arnd Bergmann Date: Thu Oct 12 12:57:06 2023 +0200 Merge tag 'samsung-dt64-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into soc/dt Samsung DTS ARM64 changes for v6.7 1. Exynos850: Add support for USB 2.0 (host and device) and enable it on E850-96 board. 2. Exynos5433: Switch sound card to generic audio-routing property, supported since previous release for Samsung drivers. The old samsung,audio-routing property is deprecated. 3. Few cleanups. * tag 'samsung-dt64-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: arm64: dts: exynos: remove unused TMU alias arm64: dts: exynos: Use pinctrl macros for exynos5433-tm2 arm64: dts: exynos: exynos5433-tm2: switch sound card to audio-routing arm64: dts: exynos: Enable USB support on E850-96 board arm64: dts: exynos: Enable USB in Exynos850 Link: https://lore.kernel.org/r/20231006093943.106002-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 78857f7fe37a2c1364945d26c78eafb60d8f3b69 Merge: 9e3fdca114eb1 73f20a373811b Author: Arnd Bergmann Date: Thu Oct 12 12:56:19 2023 +0200 Merge tag 'dt-cleanup-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt into soc/dt Minor improvements in ARM DTS for v6.7 Few cleanups and improvements: split joined reg entries for Ethernet in omap3-devkit8000, add missing spaces before '{' (MediaTek, Nuvoton) and cleanup whitespace around '=' (MediaTek). * tag 'dt-cleanup-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt: ARM: dts: nuvoton: add missing space before { ARM: dts: mediatek: minor whitespace cleanup around '=' ARM: dts: mediatek: add missing space before { ARM: dts: omap3-devkit8000: correct ethernet reg addresses (split) Link: https://lore.kernel.org/r/20231006092823.94839-2-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit a18f17248944fb068283c4bf819758fb0c9c987b Author: Jacek Lawrynowicz Date: Fri Sep 1 11:49:54 2023 +0200 accel/ivpu: Add ivpu_bo_vaddr() and ivpu_bo_size() Use: - ivpu_bo_vaddr(bo) instead of bo->kvaddr - ivpu_bo_size(bo) instead of bo->base.size This is a preparation for switch to a drm_gem_shmem_object as a base for ivpu_bo, where: - bo->kvaddr becomes bo->base.vaddr - bo->base.size becomes bo->base.base.size Using ivpu_bo_vaddr() and ivpu_bo_size() increases the readability of the code. Signed-off-by: Jacek Lawrynowicz Reviewed-by: Stanislaw Gruszka Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-9-stanislaw.gruszka@linux.intel.com commit 9e3fdca114eb1f89dcbc588bdbefb3c46d20dc04 Merge: 161e7cc4b15e5 12ca3ca8cf06d Author: Arnd Bergmann Date: Thu Oct 12 12:53:31 2023 +0200 Merge tag 'dt64-cleanup-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt into soc/dt Minor improvements in ARM64 DTS for v6.7 Few cleanups and improvements: use lowercase hex for unit addresses (Bitmain), add missing spaces before '{' (APM, MediaTek) and cleanup whitespace around '=' (MediaTek, Marvell). * tag 'dt64-cleanup-6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-dt: arm64: dts: marvell: minor whitespace cleanup around '=' arm64: dts: mediatek: minor whitespace cleanup around '=' arm64: dts: mediatek: add missing space before { arm64: dts: apm: add missing space before { arm64: dts: bitmain: lowercase unit addresses Link: https://lore.kernel.org/r/20231006092823.94839-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit a6028afef98a6e3f059a014452914eb01035d530 Author: Hans de Goede Date: Wed Sep 20 21:56:13 2023 +0200 drm/i915/dsi: Add some debug logging to mipi_exec_i2c (v2) Add some debug logging to mipi_exec_i2c, to make debugging various issues seen with it easier. Changes in v2: - Drop unnecessary __func__ drm_dbg_kms() argument Signed-off-by: Hans de Goede Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230920195613.304091-5-hdegoede@redhat.com commit f6f4a0862bde6c2a15654da624dc8509bf66d87e Author: Hans de Goede Date: Wed Sep 20 21:56:12 2023 +0200 drm/i915/vlv_dsi: Add DMI quirk for backlight control issues on Lenovo Yoga Tab 3 (v2) On the Lenovo Yoga Tab 3 Pro YT3-X90F there are 2 issues with the backlight on/off MIPI sequences: 1. The backlight on sequence has an I2C MIPI sequence element which uses bus 0, but there is a bogus I2cSerialBus resource under the GPU in the DSDT which causes i2c_acpi_find_adapter() to pick the wrong bus. 2. There is no backlight off sequence, causing the backlight to stay on. Add a DMI quirk fixing both issues. v2: - Add Closes tag to gitlab issue with drm.debug=0xe, VBT info Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9380 Signed-off-by: Hans de Goede Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230920195613.304091-4-hdegoede@redhat.com commit 2cac4ed99f9e798df8a4c34a8399adf3c587ccba Author: Hans de Goede Date: Wed Sep 20 21:56:11 2023 +0200 drm/i915/vlv_dsi: Add DMI quirk for wrong I2C bus and panel size on Lenovo Yoga Tablet 2 series (v3) On the Lenovo Yoga Tablet 2 830 / 1050 there are 2 problems: 1. The I2C MIPI sequence elements reference bus 3. ACPI has I2C1 - I2C7 which under Linux become bus 0 - 6. And the MIPI sequence reference to bus 3 is indented for I2C3 which is bus 2 under Linux. This leads to errors like these: [ 178.244049] i2c_designware 80860F41:03: controller timed out [ 178.245703] i915 0000:00:02.0: [drm] *ERROR* Failed to xfer payload of size (1) to reg (169) There are 3 timeouts when the panel is on, delaying waking up the screen on a key press by 3 seconds. Note mipi_exec_i2c() cannot just subtract 1 from the bus given in the I2C MIPI sequence element. Since on other devices the I2C bus-numbers used in the MIPI sequences do actually start at 0. 2. width_/height_mm contain a bogus 192mm x 120mm size. This is especially a problem on the 8" 830 version which uses a 10:16 portrait screen where as the bogus size is 16:10. Add a DMI quirk to override the I2C bus and the panel size with the correct values. Note both the 10" 1050 models as well as the 8" 830 models use the same mainboard and thus the same DMI strings. The 10" 1050 uses a 1920x1200 landscape screen, where as the 8" 830 uses a 1200x1920 portrait screen, so the quirk handling uses the display resolution to detect the model. v2: - Also override i2c_bus_num to fix mipi_exec_i2c() timeouts v3: - Add Closes tag to gitlab issue with drm.debug=0xe, VBT info Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9379 Reviewed-by: Javier Martinez Canillas Signed-off-by: Hans de Goede Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230920195613.304091-3-hdegoede@redhat.com commit b07eb15d0bb982771973512fbfc6287824cf4da3 Author: Hans de Goede Date: Wed Sep 20 21:56:10 2023 +0200 drm/i915/vlv_dsi: Add DMI quirk for wrong panel modeline in BIOS on Asus TF103C (v3) Vtotal is wrong in the BIOS supplied modeline for the DSI panel on the Asus TF103C leading to the last line of the display being shown as the first line. Original: "1280x800": 60 67700 1280 1312 1328 1376 800 808 812 820 0x8 0xa Fixed: "1280x800": 60 67700 1280 1312 1328 1376 800 808 812 816 0x8 0xa The factory installed Android has a hardcoded modeline in its kernel, causing it to not suffer from this BIOS bug; and the Android boot-splash which uses the EFI FB which does have this bug has the last line all black causing the bug to not be visible. This commit introduces a generic DMI based quirk mechanism to vlv_dsi for doing various fixups, and uses this to correct the modeline. v2: - s/mode_fixup/dmi_quirk/ to make the new DMI quirk mechanism more generic - Add a comment with the old and new modelines to the patch and commit msg v3: - Add Closes tag to gitlab issue with drm.debug=0xe, VBT info Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9381 Reviewed-by: Javier Martinez Canillas Signed-off-by: Hans de Goede Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230920195613.304091-2-hdegoede@redhat.com commit 161e7cc4b15e5da7e881351c0c757b97c146b843 Merge: b898a92e94a6e d70be079c3cf3 Author: Arnd Bergmann Date: Thu Oct 12 12:37:31 2023 +0200 Merge tag 'renesas-dts-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/dt Renesas DTS updates for v6.7 - Add PCIe Host and Endpoint support for the R-Car S4-8 SoC and the Renesas Spider development board, - Add FLASH support for the Renesas Genmai and RSK+RZA1 development boards, - Add multi Component sound support for Renesas ULCB development boards equipped with the Shimafuji Kingfisher extension, - Miscellaneous fixes and improvements. * tag 'renesas-dts-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: arm64: dts: renesas: ulcb/kf: Use multi Component sound ARM: dts: renesas: rskrza1: Add FLASH nodes ARM: dts: renesas: genmai: Add FLASH nodes ARM: dts: renesas: wheat: Move Ethernet node to LBSC ARM: dts: renesas: blanche: Move Ethernet node to LBSC ARM: dts: renesas: marzen: Move Ethernet node to LBSC ARM: dts: renesas: r8a7792: Add LBSC node ARM: dts: renesas: r8a7779: Add LBSC node ARM: dts: renesas: r7s72100: Add BSC node ARM: dts: renesas: Remove unused LBSC nodes from board DTS arm64: dts: renesas: r8a779f0: spider: Enable PCIe Host ch0 arm64: dts: renesas: r8a779f0: Add PCIe Host and Endpoint nodes ARM: dts: renesas: gr-peach: Remove unneeded probe-type property ARM: dts: renesas: ape6evm: Drop bogus "mtd-rom" compatible value ARM: dts: renesas: blanche: Fix typo in GP_11_2 pin name arm64: dts: renesas: Handle ADG bit for sound clk_i Link: https://lore.kernel.org/r/cover.1695985427.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit b898a92e94a6e2c095881497c73fb18fe979c3dd Merge: 1dca98e70c105 111287aa60004 Author: Arnd Bergmann Date: Thu Oct 12 12:35:52 2023 +0200 Merge tag 'renesas-dt-bindings-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/dt Renesas DT binding updates for v6.7 - Document support for the new RZ/G3S (R9A08G045) SoC variants. * tag 'renesas-dt-bindings-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: dt-bindings: soc: renesas: renesas,rzg2l-sysc: Document RZ/G3S SoC dt-bindings: soc: renesas: Document Renesas RZ/G3S SoC variants Link: https://lore.kernel.org/r/cover.1695985425.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 2651723668870357ab2786985004235a74fdccad Author: Marek Vasut Date: Thu Sep 21 21:29:33 2023 +0200 arm64: dts: imx8mp: Drop i.MX8MP DHCOM rev.100 PHY address workaround from PDK3 DT In case the i.MX8MP DHCOM rev.100 has been populated on the PDK3 carrier board, the on-SoM PHY PHYAD1 signal has been pulled high by the carrier board and changed the PHY MDIO address from 5 to 7. This has been fixed on production rev.200 SoM by additional buffer on the SoM PHYAD/LED signals, remove the workaround. Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit 320371562fae19b513668974fc58ffff91673435 Author: Marek Vasut Date: Thu Sep 21 21:29:32 2023 +0200 arm64: dts: imx8mp: Update i.MX8MP DHCOM SoM DT to production rev.200 The current imx8mp-dhcom-som.dtsi describes prototype rev.100 SoM, update the DT to describe production rev.200 SoM which brings the following changes: - Fast SoC GPIOs exposed on the SoM edge connector - Slow GPIOs like component resets moved to I2C GPIO expander - ADC upgraded from TLA2024 to ADS1015 with conversion interrupt - EEPROM size increased from 256 B to 4 kiB Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit 686e25dd2b7087ac2f790620b72c6c277922d56c Author: Marek Vasut Date: Thu Aug 31 20:20:20 2023 +0200 arm64: dts: imx8mp: Add UART1 and RTC wake up source on DH i.MX8M Plus DHCOM SoM Turn Console UART1 and dedicated RTC into wake up sources, to make it possible to wake on UART and RTC alarm. Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit dfd948b99846bcce72929d2312199535ed55868e Author: Marek Vasut Date: Thu Aug 31 20:20:19 2023 +0200 arm64: dts: imx8mp: Switch WiFI enable signal to mmc-pwrseq-simple on i.MX8MP DHCOM SoM The reset-gpio is connected to WL_REG_EN signal of the WiFi MAC, the mmc-pwrseq-simple driver is better suited to operate this signal as it is tied to the slot instead of the MAC, and it can enable the MAC before the brcmfmac driver binds to it. Make use of the MMC power sequencer. Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit b7d6532c5211034cc201cb7d0161d09c200aa1b1 Author: Marek Vasut Date: Thu Aug 31 20:20:18 2023 +0200 arm64: dts: imx8mp: Fix property indent on DH i.MX8M Plus DHCOM PDK3 Fix indent to use tab indent. No functional change. Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit e306d386cc0602d8adf6ef44e8213a0c72833c34 Author: Marek Vasut Date: Thu Aug 31 20:20:17 2023 +0200 arm64: dts: imx8mp: Describe VDD_ARM run and standby voltage for DH i.MX8M Plus DHCOM SoM Describe VDD_ARM (BUCK2) run and standby voltage in DT. Signed-off-by: Marek Vasut Reviewed-by: Marco Felsch Signed-off-by: Shawn Guo commit 4a0f36cd9998c3993d552687b2b292513b27e8de Author: Marek Vasut Date: Thu Aug 31 20:18:50 2023 +0200 arm64: dts: imx8mp: Describe VDD_ARM run and standby voltage for Data Modul i.MX8M Plus eDM SBC Describe VDD_ARM (BUCK2) run and standby voltage in DT. Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit 40da4737717b252fd01d92ff38d3b95a491167cc Author: Uwe Kleine-König Date: Mon Oct 9 11:32:23 2023 +0200 backlight: pwm_bl: Disable PWM on shutdown, suspend and remove Since commit 00e7e698bff1 ("backlight: pwm_bl: Configure pwm only once per backlight toggle") calling pwm_backlight_power_off() doesn't disable the PWM any more. However this is necessary to suspend because PWM drivers usually refuse to suspend if they are still enabled. Also adapt shutdown and remove callbacks to disable the PWM for similar reasons. Fixes: 00e7e698bff1 ("backlight: pwm_bl: Configure pwm only once per backlight toggle") Reported-by: Aisheng Dong Tested-by: Aisheng Dong Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Link: https://lore.kernel.org/r/20231009093223.227286-1-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones commit 4791146e9055dd4c21a1a725514512167b8ee75b Author: Marek Vasut Date: Tue Oct 10 21:09:26 2023 +0200 eeprom: at24: add ST M24C32-D Additional Write lockable page support The ST M24C32-D behaves as a regular M24C32, except for the -D variant which uses up another I2C address for Additional Write lockable page. This page is 32 Bytes long and can contain additional data. Add entry for it, so users can describe that page in DT. Note that users still have to describe the main M24C32 area separately as that is on separate I2C address from this page. Signed-off-by: Marek Vasut Signed-off-by: Bartosz Golaszewski commit c761068f484c8edceb4bf972ceeb6cb4343199b0 Author: Marek Vasut Date: Tue Oct 10 21:09:25 2023 +0200 dt-bindings: at24: add ST M24C32-D Additional Write lockable page The ST M24C32-D behaves as a regular M24C32, except for the -D variant which uses up another I2C address for Additional Write lockable page. This page is 32 Bytes long and can contain additional data. Document compatible string for it, so users can describe that page in DT. Note that users still have to describe the main M24C32 area separately as that is on separate I2C address from this page. Signed-off-by: Marek Vasut Acked-by: Conor Dooley Signed-off-by: Bartosz Golaszewski commit c395c83aafbb9cdbe4230f044d5b8eaf9080c0c5 Author: Thierry Reding Date: Wed Oct 11 16:32:30 2023 +0200 drm/simpledrm: Fix power domain device link validity check We need to check if a link is non-NULL before trying to delete it. Fixes: 61df9ca23107 ("drm/simpledrm: Add support for multiple "power-domains"") Signed-off-by: Thierry Reding Signed-off-by: Thomas Zimmermann Reviewed-by: Thomas Zimmermann Cc: Janne Grunau Cc: Eric Curtin Cc: Neal Gompa Cc: Sven Peter Cc: Javier Martinez Canillas Cc: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20231011143230.1107731-1-thierry.reding@gmail.com commit 668706b10c9b8181a53bd8881a77bb81b328ab33 Author: Andy Shevchenko Date: Wed Oct 11 23:26:35 2023 +0300 gpiolib: provide gpio_device_find_by_fwnode() One of the ways of looking up GPIO devices is using their fwnode. Provide a helper for that to avoid every user implementing their own matching function. Reviewed-by: Dipen Patel Tested-by: Dipen Patel Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20231010151709.4104747-2-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 291e45eeeb901b1d22b74ac5ea48cab3c407c705 Author: David Lechner Date: Tue Oct 10 16:12:36 2023 -0500 iio: resolver: ad2s1210: move out of staging This moves the ad2s1210 resolver driver out of staging. The driver has been fixed up and is ready to graduate. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231010-ad2s1210-mainline-v5-4-35a0f6ffa04a@baylibre.com Signed-off-by: Jonathan Cameron commit 51b74c09ac8c5862007fc2bf0d465529d06dd446 Author: Hans Verkuil Date: Fri Oct 6 12:08:47 2023 +0200 media: qcom: venus: fix incorrect return value 'pd' can be NULL, and in that case it shouldn't be passed to PTR_ERR. Fixes a smatch warning: drivers/media/platform/qcom/venus/pm_helpers.c:873 vcodec_domains_get() warn: passing zero to 'PTR_ERR' Signed-off-by: Hans Verkuil Reviewed-by: Bryan O'Donoghue commit b925fb423d3c9aa5cf24bd5e4953649fcf271245 Author: Hans Verkuil Date: Fri Oct 6 12:08:43 2023 +0200 media: i2c: adp1653: don't reuse the same node pointer The child device_node pointer was used for two different children. This confused smatch, causing this warning: drivers/media/i2c/adp1653.c:444 adp1653_of_init() warn: missing unwind goto? Use two different pointers, one for each child node, and add separate goto labels for each node as well. This also improves error logging since it will now state for which node the property was missing. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus [hverkuil: fix typo: childs -> children] commit 169dc2adafecc19ecf53a101398edd7f3ff03529 Author: David Lechner Date: Tue Oct 10 16:12:35 2023 -0500 staging: iio: resolver: ad2s1210: simplify code with guard(mutex) We can simplify the code and get rid of most of the gotos by using guard(mutex) from cleanup.h. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231010-ad2s1210-mainline-v5-3-35a0f6ffa04a@baylibre.com Signed-off-by: Jonathan Cameron commit 4efa877ac942d63c335820bf52d262e76901bea9 Author: David Lechner Date: Tue Oct 10 16:12:34 2023 -0500 staging: iio: resolver: ad2s1210: clear faults after soft reset When a software reset is performed on the AD2S1210 to make the selected excitation frequency take effect, it always triggers faults on the input signals because the output signal is interrupted momentarily. So we need to clear the faults after the software reset to avoid triggering fault events the next time a sample is read. The datasheet specifies a time t[track] in Table 27 that specifies the settle time in milliseconds after a reset depending on the selected resolution. This is used in the driver to add an appropriate delay. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231010-ad2s1210-mainline-v5-2-35a0f6ffa04a@baylibre.com Signed-off-by: Jonathan Cameron commit b9f29205c0182a2059b4dfa2883db5ef423574d4 Author: Randy Dunlap Date: Sat Sep 30 15:14:27 2023 -0700 iosys-map: fix kernel-doc typos Correct spelling of "beginning". Signed-off-by: Randy Dunlap Cc: Thomas Zimmermann Cc: dri-devel@lists.freedesktop.org Reviewed-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230930221428.18463-2-rdunlap@infradead.org commit 27ffa2216acfab3527064ec13666f35d70f76045 Author: David Lechner Date: Tue Oct 10 16:12:33 2023 -0500 staging: iio: resolver: ad2s1210: refactor sample toggle This refactors the sample line toggle in the ad2s1210 resolver driver to a separate function. The sample has some timing requirements, so this ensures that it is always done the same way, both in the existing call sites and any future usage. Previously, the sample line was kept on for the duration of the read, but this is not necessary. Data is latched in on the rising edge and after the specified delay the state of the sample line does not matter. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231010-ad2s1210-mainline-v5-1-35a0f6ffa04a@baylibre.com Signed-off-by: Jonathan Cameron commit 451921e7bbc74fd87bfc9b413e4d57cc498fcca8 Author: Carlos Eduardo Gallo Filho Date: Tue Sep 26 11:15:19 2023 -0300 drm: Replace drm_framebuffer plane size functions with its equivalents The functions drm_framebuffer_plane_{width,height} and fb_plane_{width,height} do exactly the same job of its equivalents drm_format_info_plane_{width,height} from drm_fourcc. The only reason to have these functions on drm_framebuffer would be if they would added a abstraction layer to call it just passing a drm_framebuffer pointer and the desired plane index, which is not the case, where these functions actually implements just part of it. In the actual implementation, every call to both drm_framebuffer_plane_{width,height} and fb_plane_{width,height} should pass some drm_framebuffer attribute, which is the same as calling the drm_format_info_plane_{width,height} functions. The drm_format_info_pane_{width,height} functions are much more consistent in both its implementation and its location on code. The kind of calculation that they do is intrinsically derivated from the drm_format_info struct and has not to do with drm_framebuffer, except by the potential motivation described above, which is still not a good justification to have drm_framebuffer functions to calculate it. So, replace each drm_framebuffer_plane_{width,height} and fb_plane_{width,height} call to drm_format_info_plane_{width,height} and remove them. Signed-off-by: Carlos Eduardo Gallo Filho Reviewed-by: André Almeida Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230926141519.9315-3-gcarlos@disroot.org commit f2f455981a34ce8ca88a41458c09494b387d344f Author: Carlos Eduardo Gallo Filho Date: Tue Sep 26 11:15:18 2023 -0300 drm: Remove plane hsub/vsub alignment requirement for core helpers The drm_format_info_plane_{height,width} functions was implemented using regular division for the plane size calculation, which cause issues [1][2] when used on contexts where the dimensions are misaligned with relation to the subsampling factors. So, replace the regular division by the DIV_ROUND_UP macro. This allows these functions to be used in more drivers, making further work to bring more core presence on them possible. [1] http://patchwork.freedesktop.org/patch/msgid/20170321181218.10042-3-ville.syrjala@linux.intel.com [2] https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-2-imre.deak@intel.com Signed-off-by: Carlos Eduardo Gallo Filho Reviewed-by: André Almeida Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230926141519.9315-2-gcarlos@disroot.org commit d13fabf08d7cf4439d8f2f477458c7c353aebe87 Author: Laurent Pinchart Date: Sat Sep 23 22:49:06 2023 +0300 media: rkisp1: resizer: Fix resizer disable check when starting stream The resizer is used to scale the image, but also to change the subsampling of YUV formats. Both the luma and chroma dimensions need to be taken into account to decide whether or not to enable the resizer. The current implementation disables the resizer if the chroma vertical size isn't changed, which would be the case when scaling up by a factor of 2 vertically while at the same time converting from YUV 4:2:2 to 4:2:0. Fix it by checking the luma sizes too. While at it, reflow and clarify comments in the function. Signed-off-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit e09b03627643e1f40bfaacf29be0de7df1c8c05d Author: Laurent Pinchart Date: Mon Sep 25 03:20:08 2023 +0300 media: rkisp1: resizer: Improve debug message when configuring resizer The debug messages that show the resizer configuration are only printed if the driver enables the resizer. This prevents checking the resizer configuration when the driver believes it should be disabled. Fix it by moving the dev_dbg() statements earlier. Also, combine the two debug prints into a single one to gather all the information in one place, which makes reading the log easier. While at it, use %u instead of %d to print unsigned values. Signed-off-by: Laurent Pinchart Reviewed-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 1126d89f8f54a13e7c5cbee24c414603ee794f10 Author: Laurent Pinchart Date: Sat Sep 23 22:49:06 2023 +0300 media: rkisp1: resizer: Drop unneeded local variable The sink_y local variable in rkisp1_rsz_config() stores a copy of the sink_crop crop rectangle. Drop it, and rename sink_crop to sink_y. Signed-off-by: Laurent Pinchart Reviewed-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 603fbdc1122565dd5bb3fc0b3f574afe5ac49cd9 Author: Laurent Pinchart Date: Sat Sep 23 22:49:06 2023 +0300 media: rkisp1: resizer: Use v4l2_area instead of v4l2_rect to store size The rkisp1_rsz_config() and rkisp1_rsz_config_regs() functions use a v4l2_rect to pass frame sizes, leaving the top and left members unused and uninitialized. Use v4l2_area instead. Signed-off-by: Laurent Pinchart Reviewed-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 1a6ae627af1477e7dbc081c21102bb5d8889adb1 Author: Laurent Pinchart Date: Sat Sep 23 22:49:06 2023 +0300 media: rkisp1: resizer: Constify argument and local variables Pointers to v4l2_mbus_framefmt and v4l2_rect instances don't need to be modified when configuring the resizer. Make them const. Signed-off-by: Laurent Pinchart Reviewed-by: Sakari Ailus Signed-off-by: Hans Verkuil commit f4bc9c79a55a40608a405700a574303e4b90b310 Author: Laurent Pinchart Date: Thu Apr 27 11:43:17 2023 +0300 media: rkisp1: Program RKISP1_CIF_MI_SP_Y_PIC_SIZE register The self path has a Y_PIC_SIZE register that needs to be programmed to the total number of pixels, including the stride. This isn't done by the driver, fix it. While at it, reorder the register write order to sort them by address. Signed-off-by: Laurent Pinchart Reviewed-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 7bf62fa39bf5c89d92962dce0022ef59ec52a2a0 Author: Laurent Pinchart Date: Sat Sep 23 20:23:43 2023 +0300 media: rkisp1: Remove dual crop control register from config structure The dual crop register is the same for both the MP and SP channels. Drop it from the rkisp1_rsz_config structure and use the RKISP1_CIF_DUAL_CROP_CTRL macro directly in the code. Signed-off-by: Laurent Pinchart Reviewed-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 5964c90a04291e1fb94d65b5641b526316e48830 Author: Laurent Pinchart Date: Thu Apr 27 11:43:17 2023 +0300 media: rkisp1: Fix line stride calculation The line stride is expressed in the hardware as a number of pixels for the first plane. The bytesperline must thus be a multiple of the first plane's bpp value. Enforce this constraint. Signed-off-by: Laurent Pinchart Reviewed-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 1f3ba4b8d4bb54cdbe46a372081bdcbc6632c602 Author: Laurent Pinchart Date: Mon Mar 13 20:51:51 2023 +0200 media: rkisp1: Constify rkisp1_v12_params_ops The rkisp1_v12_params_ops global variable doesn't need to be modified. Make it const. Signed-off-by: Laurent Pinchart Reviewed-by: Sakari Ailus Signed-off-by: Hans Verkuil commit cde4e5157af3fdb3d8131bc39309e6dae6a7555a Author: Laurent Pinchart Date: Sat Sep 23 23:36:03 2023 +0300 media: rkisp1: Convert hex constants to lowercase Hex constants in the media subsystem are typically in lowercase. The rkisp1 driver mostly follows that convention already, except in the register definitions. Convert all hex constants to lowercase for consistency. Signed-off-by: Laurent Pinchart Reviewed-by: Sakari Ailus Signed-off-by: Hans Verkuil commit c7e26218820786d23d999ec9b33c812d07f98199 Author: Laurent Pinchart Date: Thu Jan 26 03:10:01 2023 +0200 media: rkisp1: csi: Use V4L2 subdev active state Use the V4L2 subdev active state API to store the active format and crop rectangle. This simplifies the driver not only by dropping the state stored in the rkisp1_csi structure, but also by replacing the ops_lock with the state lock. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 2cce0a369dbdb59d806f9c0c3599ff74a864c0f4 Author: Laurent Pinchart Date: Thu Jan 26 03:10:01 2023 +0200 media: rkisp1: isp: Use V4L2 subdev active state Use the V4L2 subdev active state API to store the active format and crop rectangle. This simplifies the driver not only by dropping the state stored in the rkisp1_isp structure, but also by replacing the ops_lock with the state lock. The rkisp1_isp.sink_fmt field needs to be kept, as it is accessed from the stats interrupt handler. To simplify the rkisp1_isp_set_sink_fmt() implementation, the field is now set when starting the ISP, instead of when setting the format. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 88f870f6ecc410b4de6d75c1e1b82c3ad38a3a39 Author: Laurent Pinchart Date: Thu Jan 26 03:10:01 2023 +0200 media: rkisp1: resizer: Use V4L2 subdev active state Use the V4L2 subdev active state API to store the active format and crop rectangle. This simplifies the driver not only by dropping the state stored in the rkisp1_resizer structure, but also by replacing the ops_lock with the state lock. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Sakari Ailus Signed-off-by: Hans Verkuil commit fa6df857fe7237f0cd97cab7355499dc1fd029e9 Author: Laurent Pinchart Date: Wed Feb 8 12:00:02 2023 +0200 media: MAINTAINERS: Add co-maintainer for the rkisp1 driver As I'm actively working on the rkisp1 driver, I would like to volunteer as a co-maintainer, mostly to make sure I get CC on patches. Signed-off-by: Laurent Pinchart Acked-by: Hans Verkuil Reviewed-by: Sakari Ailus Signed-off-by: Hans Verkuil commit f577cd57bfaa889cf0718e30e92c08c7f78c9d85 Author: Peter Zijlstra Date: Wed Jul 12 16:10:56 2023 +0200 sched/topology: Rename 'DIE' domain to 'PKG' While reworking the x86 topology code Thomas tripped over creating a 'DIE' domain for the package mask. :-) Since these names are CONFIG_SCHED_DEBUG=y only, rename them to make the name less ambiguous. [ Shrikanth Hegde: rename on s390 as well. ] [ Valentin Schneider: also rename it in the comments. ] [ mingo: port to recent kernels & find all remaining occurances. ] Reported-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Acked-by: Valentin Schneider Acked-by: Mel Gorman Acked-by: Heiko Carstens Acked-by: Gautham R. Shenoy Acked-by: Vincent Guittot Link: https://lore.kernel.org/r/20230712141056.GI3100107@hirez.programming.kicks-ass.net commit 8b2e41833bd649086e32ac4c3a412d7ec80e8202 Author: Vaishnav Achath Date: Tue Oct 10 16:47:23 2023 +0530 arm64: dts: ti: k3-j784s4-main: Add BCDMA instance for CSI2RX J784S4 has a dedicated BCDMA controller for the Camera Serial Interface. Events from the BCDMA controller instance are routed through the main UDMA interrupt aggregator as unmapped events. Add the node for the DMA controller and keep it disabled by default. See J784S4 Technical Reference Manual (SPRUJ52) for further details: http://www.ti.com/lit/zip/spruj52 Signed-off-by: Vaishnav Achath Reviewed-by: Jayesh Choudhary Link: https://lore.kernel.org/r/20231010111723.17524-3-vaishnav.a@ti.com Signed-off-by: Vignesh Raghavendra commit 10c6c4db6283053e8ec20eef19eb77d4aeffed1a Author: Vaishnav Achath Date: Tue Oct 10 16:47:22 2023 +0530 arm64: dts: ti: k3-j721s2-main: Add BCDMA instance for CSI2RX J721S2 has a dedicated BCDMA controller for the Camera Serial Interface. Events from the BCDMA controller instance are routed through the main UDMA interrupt aggregator as unmapped events. Add the node for the DMA controller and keep it disabled by default. See J721S2 Technical Reference Manual (SPRUJ28) for further details: http://www.ti.com/lit/pdf/spruj28 Signed-off-by: Vaishnav Achath Reviewed-by: Jayesh Choudhary Link: https://lore.kernel.org/r/20231010111723.17524-2-vaishnav.a@ti.com Signed-off-by: Vignesh Raghavendra commit 6507bfa7e0cde01c5feecdbc163b392021d15cbb Author: Vignesh Raghavendra Date: Thu Oct 5 20:43:02 2023 +0530 arm64: dts: ti: k3-*: Convert NAVSS to simple-bus "simple-mfd" as standalone compatible is frowned upon, so model main and MCU NAVSS (Navigator SubSystem) nodes as simple-bus as there is really no need for these nodes to be MFD. Link: https://lore.kernel.org/r/20231005151302.1290363-3-vigneshr@ti.com Signed-off-by: Vignesh Raghavendra commit 6ff2e5bb81895247f0414ff6b129c8e025b99a17 Author: Vignesh Raghavendra Date: Thu Oct 5 20:43:01 2023 +0530 arm64: dts: ti: k3-*: Convert DMSS to simple-bus "simple-mfd" as standalone compatible is frowned upon, so model DMSS (Data Movement Subsystem) node as simple-bus as there is really no need for these nodes to be MFD. Link: https://lore.kernel.org/r/20231005151302.1290363-2-vigneshr@ti.com Signed-off-by: Vignesh Raghavendra commit 827804d6d7608cb797e689eabe6e200fa9fb58e6 Author: Sakari Ailus Date: Mon Oct 9 14:54:57 2023 +0300 media: ccs: Fix a (harmless) lockdep warning The v4l2_subdev_init_finalize() is a macro that creates an unique lockdep key and name. As the CCS driver initialises all three of its sub-devices using the same call site, this creates a lockdep warning. Address it. Fixes: d8bca3ed1d70 ("media: ccs: Use sub-device active state") Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 256b7767c97d94c8df46e1bf5bdb89a7f7dcac99 Author: Sakari Ailus Date: Mon Oct 9 09:40:11 2023 +0300 media: ccs: Rework initialising sub-device state Initialise sub-device state in init_cfg callback using ccs_propagate() to the extent it covers of the initialisation. This fixes a bug where the driver configuration was incorrectly initialised. Fixes: d8bca3ed1d70 ("media: ccs: Use sub-device active state") Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit ab75641ffd3a6a69ad5552a4cba2a20ff67e0904 Author: Laurent Pinchart Date: Tue Oct 3 22:20:43 2023 +0300 media: i2c: mt9m114: Fix missing error unwind in probe() Two paths in the probe function return directly instead of jumping to error handling. Fix them. Fixes: 24d756e914fc ("media: i2c: Add driver for onsemi MT9M114 camera sensor") Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit e2e73ed46c395777868b36c879c6cd213b45f123 Author: Jacopo Mondi Date: Fri Oct 6 14:41:01 2023 +0200 media: dt-bindings: sony,imx415: Allow props from video-interface-devices All the properties described by video-interface-devices.yaml are allowed for the image sensor, make them accepted by changing "additionalProperties: false" to "unevaluatedProperties: false" at the schema top-level. Because all properties are now accepted, there is no need to explicitly allow them in the schema. Signed-off-by: Jacopo Mondi Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit af91ed3587b84629d862b144bccfdf2295f8075a Author: Jacopo Mondi Date: Fri Oct 6 14:41:00 2023 +0200 media: dt-bindings: sony,imx214: Allow props from video-interface-devices All the properties described by video-interface-devices.yaml are allowed for the image sensor, make them accepted by changing "additionalProperties: false" to "unevaluatedProperties: false" at the schema top-level. Signed-off-by: Jacopo Mondi Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit d175296a2df34fc2acebc5511a5fac8c977bda15 Author: Jacopo Mondi Date: Fri Oct 6 14:40:59 2023 +0200 media: dt-bindings: ovti,ov5640: Allow props from video-interface-devices There is no reason to restrict the allowed rotation degrees to 0 and 180, as the sensor can be mounted with any rotation. Also, as all the properties described by video-interface-devices.yaml are allowed for the image sensor, make them accepted by changing "additionalProperties: false" to "unevaluatedProperties: false" at the schema top-level. Signed-off-by: Jacopo Mondi Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit d16928772eec540b61e98f25c0dd7b57404070d1 Author: Jacopo Mondi Date: Fri Oct 6 14:40:58 2023 +0200 media: dt-bindings: ovti,ov4689: Allow props from video-interface-devices All the properties described by video-interface-devices.yaml are allowed for the image sensor, make them accepted by changing "additionalProperties: false" to "unevaluatedProperties: false" at the schema top-level. Signed-off-by: Jacopo Mondi Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit d85ce91477779973cad8c57d652381e724afd671 Author: Jacopo Mondi Date: Fri Oct 6 14:40:57 2023 +0200 media: dt-bindings: ovti,ov02a10: Allow props from video-interface-devices There is no reason to restrict the allowed rotation degrees to 0 and 180, as the sensor can be mounted with any rotation. Also, as all the properties described by video-interface-devices.yaml are allowed for the image sensor, make them accepted by changing "additionalProperties: false" to "unevaluatedProperties: false" at the schema top-level. Signed-off-by: Jacopo Mondi Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 3b34d7fbb7272f6a34e1340c9563129d6235ced3 Author: Jacopo Mondi Date: Fri Oct 6 14:40:56 2023 +0200 media: dt-bindings: hynix,hi846: Add video-interface-devices properties Allow properties from video-interface-devices.yaml for the SK Hynix Hi-846 sensor. All properties specified in video-interface-devices.yaml schema are valid, so make them accepted by changing "additionalProperties: false" to "unevaluatedProperties: false" at the schema top-level. Add two properties from video-interface-devices.yaml to the example to validate the new schema. Signed-off-by: Jacopo Mondi Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit b4a3d877dc92963a4db16ddb71df3d333c0d40bd Author: Jai Luthra Date: Mon Oct 9 18:39:39 2023 +0530 media: ti: Add CSI2RX support for J721E TI's J721E uses the Cadence CSI2RX and DPHY peripherals to facilitate capture over a CSI-2 bus. The Cadence CSI2RX IP acts as a bridge between the TI specific parts and the CSI-2 protocol parts. TI then has a wrapper on top of this bridge called the SHIM layer. It takes in data from stream 0, repacks it, and sends it to memory over PSI-L DMA. This driver acts as the "front end" to V4L2 client applications. It implements the required ioctls and buffer operations, passes the necessary calls on to the bridge, programs the SHIM layer, and performs DMA via the dmaengine API to finally return the data to a buffer supplied by the application. Co-developed-by: Pratyush Yadav Signed-off-by: Pratyush Yadav Co-developed-by: Vaishnav Achath Signed-off-by: Vaishnav Achath Tested-by: Vaishnav Achath Tested-by: Julien Massot Reviewed-by: Tomi Valkeinen Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit ca5b901c1896c5232fb3dd637279980670e8e6b9 Author: Pratyush Yadav Date: Mon Oct 9 18:39:38 2023 +0530 media: dt-bindings: Add TI J721E CSI2RX TI's J721E uses the Cadence CSI2RX and DPHY peripherals to facilitate capture over a CSI-2 bus. The TI CSI2RX platform driver glues all the parts together. Signed-off-by: Pratyush Yadav Tested-by: Julien Massot Reviewed-by: Laurent Pinchart Reviewed-by: Rob Herring Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit b0f46ad6ed4af5eca481fad18825baafa0453a49 Author: Pratyush Yadav Date: Mon Oct 9 18:39:37 2023 +0530 media: cadence: csi2rx: Add link validation Add media link validation to make sure incorrectly configured pipelines are caught. Signed-off-by: Pratyush Yadav Tested-by: Julien Massot Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Reviewed-by: Maxime Ripard Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit c6ed7a39f177ef56f12a3427817566d2bbabcf03 Author: Pratyush Yadav Date: Mon Oct 9 18:39:36 2023 +0530 media: cadence: csi2rx: Populate subdev devnode The devnode can be used by media-ctl and other userspace tools to perform configurations on the subdev. Without it, media-ctl returns ENOENT when setting format on the sensor subdev. Signed-off-by: Pratyush Yadav Tested-by: Julien Massot Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Reviewed-by: Maxime Ripard Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 1dd592748a80417ffc0f64eefe75a4e567d67f03 Author: Pratyush Yadav Date: Mon Oct 9 18:39:35 2023 +0530 media: cadence: csi2rx: Fix stream data configuration Firstly, there is no VC_EN bit present in the STREAM_DATA_CFG register. Bit 31 is part of the VL_SELECT field. Remove it completely. Secondly, it makes little sense to enable ith virtual channel for ith stream. Sure, there might be a use-case that demands it. But there might also be a use case that demands all streams to use the 0th virtual channel. Prefer this case over the former because it is less arbitrary and also makes it very clear what the limitations of the current driver is instead of giving a false impression that multiple virtual channels are supported. Signed-off-by: Pratyush Yadav Tested-by: Julien Massot Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Reviewed-by: Maxime Ripard Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit a64175fabfbdfe32e33024c5c5ecaf6646125fd6 Author: Pratyush Yadav Date: Mon Oct 9 18:39:34 2023 +0530 media: cadence: csi2rx: Set the STOP bit when stopping a stream The stream stop procedure says that the STOP bit should be set when the stream is to be stopped, and then the ready bit in stream status register polled to make sure the STOP operation is finished. Signed-off-by: Pratyush Yadav Tested-by: Julien Massot Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Reviewed-by: Maxime Ripard Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 6f28a427a913370300bf116ad900c17bf3dbbf1c Author: Pratyush Yadav Date: Mon Oct 9 18:39:33 2023 +0530 media: cadence: csi2rx: Soft reset the streams before starting capture This resets the stream state machines and FIFOs, giving them a clean slate. On J721E if the streams are not reset before starting the capture, the captured frame gets wrapped around vertically on every run after the first. Signed-off-by: Pratyush Yadav Tested-by: Julien Massot Reviewed-by: Laurent Pinchart Reviewed-by: Maxime Ripard Reviewed-by: Tomi Valkeinen Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit a91d06f46bf725f97d2bf344294c54bc57686889 Author: Pratyush Yadav Date: Mon Oct 9 18:39:32 2023 +0530 media: cadence: csi2rx: Configure DPHY using link freq Some platforms like TI's J721E can have the CSI2RX paired with an external DPHY. Use the generic PHY framework to configure the DPHY with the correct link frequency. Signed-off-by: Pratyush Yadav Tested-by: Julien Massot Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Reviewed-by: Maxime Ripard Co-developed-by: Jai Luthra Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit dbca7b3c412b86e2684542467f2565b52e2f0cb3 Author: Pratyush Yadav Date: Mon Oct 9 18:39:31 2023 +0530 media: cadence: csi2rx: Add get_fmt and set_fmt pad ops The format is needed to calculate the link speed for the external DPHY configuration. It is not right to query the format from the source subdev. Add get_fmt and set_fmt pad operations so that the format can be configured and correct bpp be selected. Initialize and use the v4l2 subdev active state to keep track of the active formats. Also propagate the new format from the sink pad to all the source pads. Signed-off-by: Pratyush Yadav Tested-by: Julien Massot Reviewed-by: Maxime Ripard Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Co-developed-by: Jai Luthra Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit aee5b415c95aa913aa9222bbe13c817c7e67ec85 Author: Pratyush Yadav Date: Mon Oct 9 18:39:30 2023 +0530 media: cadence: csi2rx: Cleanup media entity properly Call media_entity_cleanup() in probe error path and remove to make sure the media entity is cleaned up properly. Suggested-by: Laurent Pinchart Signed-off-by: Pratyush Yadav Tested-by: Julien Massot Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Reviewed-by: Maxime Ripard Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit b2701715301a49b53d05c7d43f3fedc3b8743bfc Author: Pratyush Yadav Date: Mon Oct 9 18:39:29 2023 +0530 media: cadence: csi2rx: Unregister v4l2 async notifier The notifier is added to the global notifier list when registered. When the module is removed, the struct csi2rx_priv in which the notifier is embedded, is destroyed. As a result the notifier list has a reference to a notifier that no longer exists. This causes invalid memory accesses when the list is iterated over. Similar for when the probe fails. Unregister and clean up the notifier to avoid this. Fixes: 1fc3b37f34f6 ("media: v4l: cadence: Add Cadence MIPI-CSI2 RX driver") Signed-off-by: Pratyush Yadav Tested-by: Julien Massot Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Reviewed-by: Maxime Ripard Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit cdb175144aad4983395607d986a482bdb02a9174 Author: Jai Luthra Date: Mon Oct 9 18:39:28 2023 +0530 media: dt-bindings: cadence-csi2rx: Add TI compatible string Add a SoC-specific compatible string for TI's integration of this IP in J7 and AM62 line of SoCs. Tested-by: Julien Massot Reviewed-by: Maxime Ripard Reviewed-by: Laurent Pinchart Acked-by: Krzysztof Kozlowski Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit c49f2a696272303ce3dd3684c984b025ca6dad82 Author: Pratyush Yadav Date: Mon Oct 9 18:39:27 2023 +0530 media: dt-bindings: Make sure items in data-lanes are unique The data-lanes property maps the logical lane numbers to the physical lane numbers. The position of an entry is the logical lane number and its value is the physical lane number. Since one physical lane can only map to one logical lane, no number in the list should repeat. Add the uniqueItems constraint on the property to enforce this. Signed-off-by: Pratyush Yadav Tested-by: Julien Massot Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Reviewed-by: Maxime Ripard Acked-by: Rob Herring Signed-off-by: Jai Luthra Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 0b1e6f6a9f73eb4a16a5aadd15bac42ddcb51f88 Author: Umang Jain Date: Mon Oct 9 19:56:48 2023 +0530 media: Documentation: ccs: Fix spelling mistake Correct the wrong spelling of 'exposes' in the binner section. Signed-off-by: Umang Jain Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 06affa7a002677942340a6127a8808ad5b5deafc Author: Ricardo B. Marliere Date: Sat Oct 7 17:05:42 2023 -0300 staging: media: ipu3: remove ftrace-like logging This patch fixes the following checkpatch.pl warnings in ipu3.c: WARNING: Unnecessary ftrace-like logging - prefer using ftrace + dev_dbg(dev, "enter %s\n", __func__); WARNING: Unnecessary ftrace-like logging - prefer using ftrace + dev_dbg(dev, "leave %s\n", __func__); WARNING: Unnecessary ftrace-like logging - prefer using ftrace + dev_dbg(dev, "enter %s\n", __func__); WARNING: Unnecessary ftrace-like logging - prefer using ftrace + dev_dbg(dev, "leave %s\n", __func__); Fixes: 7fc7af649ca7 ("media: staging/intel-ipu3: Add imgu top level pci device driver") Signed-off-by: Ricardo B. Marliere Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 052ddf7b86d2d9443bce77ef5b5b1ef61a3b79fc Author: Thomas Zimmermann Date: Fri Sep 22 10:04:56 2023 +0200 fbdev: Replace fb_pgprotect() with pgprot_framebuffer() Rename the fbdev mmap helper fb_pgprotect() to pgprot_framebuffer(). The helper sets VMA page-access flags for framebuffers in device I/O memory. Also clean up the helper's parameters and return value. Instead of the VMA instance, pass the individial parameters separately: existing page-access flags, the VMAs start and end addresses and the offset in the underlying device memory rsp file. Return the new page-access flags. These changes align pgprot_framebuffer() with other pgprot_() functions. v4: * fix commit message (Christophe) v3: * rename fb_pgprotect() to pgprot_framebuffer() (Arnd) Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann Acked-by: Geert Uytterhoeven # m68k Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230922080636.26762-3-tzimmermann@suse.de commit c205a67d28766ffaae3d02cdffc9c86d52ed6c2e Author: Thomas Zimmermann Date: Fri Sep 22 10:04:55 2023 +0200 fbdev: Avoid file argument in fb_pgprotect() Only PowerPC's fb_pgprotect() needs the file argument, although the implementation in either phys_mem_access_prot() or pci_phys_mem_access_prot() does not use it. Pass NULL to the internal helper in preparation of further updates. A later patch will remove the file parameter from fb_pgprotect(). While at it, replace the shift operation with PHYS_PFN(). v5: * state function names in commit description (Javier) Suggested-by: Christophe Leroy Signed-off-by: Thomas Zimmermann Reviewed-by: Arnd Bergmann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230922080636.26762-2-tzimmermann@suse.de commit 58883680a8416661b48a800e5530e2efcea64a4a Author: Arun R Murthy Date: Tue Sep 26 14:41:57 2023 +0530 drm/i915: Remove the module parameter 'fastboot' By default fastboot is enabled on all Display 9+ platforms and disabled on older platforms. Its not necessary to retain this as a module parameter. Signed-off-by: Arun R Murthy Acked-by: Jani Nikula Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20230926091157.635438-1-arun.r.murthy@intel.com commit f9010eb938beb9a58c640b50d2fe65e4187c1fde Author: Jai Luthra Date: Tue Oct 3 14:41:35 2023 +0530 arm64: defconfig: Enable TPS6593 PMIC for SK-AM62A SK-AM62A-LP uses TPS6593x PMIC (interfaced over I2C) to power the SoC and various other peripherals on the board [1]. Specifically, the audio codec (TLV320AIC3106) on the board relies on the PMIC for the DVDD (1.8V) supply. [1]: https://www.ti.com/lit/zip/sprr459 Reviewed-by: Devarsh Thakkar Signed-off-by: Jai Luthra Link: https://lore.kernel.org/r/20231003-mcasp_am62a-v3-6-2b631ff319ca@ti.com Signed-off-by: Vignesh Raghavendra commit f44075ecafb726830e63d33fbca29413149eeeb8 Author: Paul E. McKenney Date: Wed Oct 11 11:40:16 2023 -0700 x86/nmi: Fix out-of-order NMI nesting checks & false positive warning The ->idt_seq and ->recv_jiffies variables added by: 1a3ea611fc10 ("x86/nmi: Accumulate NMI-progress evidence in exc_nmi()") ... place the exit-time check of the bottom bit of ->idt_seq after the this_cpu_dec_return() that re-enables NMI nesting. This can result in the following sequence of events on a given CPU in kernels built with CONFIG_NMI_CHECK_CPU=y: o An NMI arrives, and ->idt_seq is incremented to an odd number. In addition, nmi_state is set to NMI_EXECUTING==1. o The NMI is processed. o The this_cpu_dec_return(nmi_state) zeroes nmi_state and returns NMI_EXECUTING==1, thus opting out of the "goto nmi_restart". o Another NMI arrives and ->idt_seq is incremented to an even number, triggering the warning. But all is just fine, at least assuming we don't get so many closely spaced NMIs that the stack overflows or some such. Experience on the fleet indicates that the MTBF of this false positive is about 70 years. Or, for those who are not quite that patient, the MTBF appears to be about one per week per 4,000 systems. Fix this false-positive warning by moving the "nmi_restart" label before the initial ->idt_seq increment/check and moving the this_cpu_dec_return() to follow the final ->idt_seq increment/check. This way, all nested NMIs that get past the NMI_NOT_RUNNING check get a clean ->idt_seq slate. And if they don't get past that check, they will set nmi_state to NMI_LATCHED, which will cause the this_cpu_dec_return(nmi_state) to restart. Fixes: 1a3ea611fc10 ("x86/nmi: Accumulate NMI-progress evidence in exc_nmi()") Reported-by: Chris Mason Signed-off-by: Paul E. McKenney Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: Andy Lutomirski Cc: "H. Peter Anvin" Link: https://lore.kernel.org/r/0cbff831-6e3d-431c-9830-ee65ee7787ff@paulmck-laptop commit 441ccc351256533b6381e86a5648dbfe04b74286 Author: Lu Yao Date: Thu Oct 12 11:26:59 2023 +0800 x86/msi: Fix compile error caused by CONFIG_GENERIC_MSI_IRQ=y && !CONFIG_X86_LOCAL_APIC When compiling the x86 kernel, if X86_LOCAL_APIC is not enabled but GENERIC_MSI_IRQ is selected in '.config', the following compilation error will occur: include/linux/gpio/driver.h:38:19: error: field 'msiinfo' has incomplete type kernel/irq/msi.c:752:5: error: invalid use of incomplete typedef 'msi_alloc_info_t' {aka 'struct irq_alloc_info'} kernel/irq/msi.c:740:1: error: control reaches end of non-void function This is because file such as 'kernel/irq/msi.c' only depends on 'GENERIC_MSI_IRQ', and uses 'struct msi_alloc_info_t'. However, this struct depends on 'X86_LOCAL_APIC'. When enable 'GENERIC_MSI_IRQ' or 'X86_LOCAL_APIC' will select 'IRQ_DOMAIN_HIERARCHY', so exposing this struct using 'IRQ_DOMAIN_HIERARCHY' rather than 'X86_LOCAL_APIC'. Under the above conditions, if 'HPET_TIMER' is selected, the following compilation error will occur: arch/x86/kernel/hpet.c:550:13: error: ‘x86_vector_domain’ undeclared arch/x86/kernel/hpet.c:600:9: error: implicit declaration of function ‘init_irq_alloc_info’ This is because 'x86_vector_domain' is defined in 'kernel/apic/vector.c' which is compiled only when 'X86_LOCAL_APIC' is enabled. Besides, function 'msi_domain_set_affinity' is defined in 'include/linux/msi.h' which depends on 'GENERIC_MSI_IRQ'. So use 'X86_LOCAL_APIC' and 'GENERIC_MSI_IRQ' to expose these code. Reported-by: kernel test robot Signed-off-by: Lu Yao Signed-off-by: Ingo Molnar Acked-by: Randy Dunlap Tested-by: Randy Dunlap Cc: Thomas Gleixner Link: https://lore.kernel.org/r/20231012032659.323251-1-yaolu@kylinos.cn commit 0f5b11442e2f6b86436caabba6cb97265bb381c2 Author: Suraj Kandpal Date: Mon Oct 9 15:25:37 2023 +0530 drm/i915/hdcp: Move common message filling function to its own file Create a new file intel_hdcp_gsc_message that contain functions which fill the hdcp messages we send to gsc cs this refactor will help us reuse code for Xe later on --v2 -add the missed file for proper build --v3 -use forward declarations instead of #includes [Jani] --v4 -move linux/err.h to intel_hdcp_gsc_message.c from intel_hdcp_gsc_message.h [Jani] --v5 -move linux include on top of drm includes [Uma] Signed-off-by: Suraj Kandpal Reviewed-by: Uma Shankar Acked-by: Jani Nikula Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20231009095537.653619-3-suraj.kandpal@intel.com commit 99f106ad5063444361139f9bd727e61383b2b93c Author: Suraj Kandpal Date: Mon Oct 9 15:25:36 2023 +0530 drm/i915/hdcp: Move checks for gsc health status Move checks for gsc components required for HDCP 2.2 to work into intel_hdcp_gsc.c. This will also help with XE refactor on HDCP's side. Signed-off-by: Suraj Kandpal Reviewed-by: Uma Shankar Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20231009095537.653619-2-suraj.kandpal@intel.com commit 21135104a67ec0434fd0479fd663020d19ec68cd Author: Florian Fainelli Date: Wed Oct 11 09:46:54 2023 -0700 cpufreq: ARM_BRCMSTB_AVS_CPUFREQ cannot be used with ARM_SCMI_CPUFREQ The brcmstb-avs-cpufreq driver is considered a legacy driver and since 2018, ARCH_BRCMSTB systems have been using scmi-cpufreq. As a matter of fact, when SCMI is in use, brcmstb-avs-cpufreq is unusable since the SCMI firmware takes over, this can result in various problems, including external synchronous aborts. Express those constraints such that the driver is not enabled by default when SCMI CPU frequency scaling is in use. Signed-off-by: Florian Fainelli Signed-off-by: Viresh Kumar commit 304d9a0299f2afb54a699a9dcae7ed2f7fb20623 Author: Bryan Brattlof Date: Tue Oct 10 12:55:27 2023 -0500 cpufreq: ti-cpufreq: Add opp support for am62p5 SoCs The am62p5 is a variation of the am625 and the am62a7 SoC families. Add the am62p5 to the list using the same cpufreq data as the rest of the am62x extended family. Signed-off-by: Bryan Brattlof Reviewed-by: Dhruva Gole Signed-off-by: Viresh Kumar commit 8b8eb859b5a71e0eaf7422c366d936ac57e5e76e Author: Bryan Brattlof Date: Tue Oct 10 12:55:26 2023 -0500 cpufreq: dt-platdev: add am62p5 to blocklist The am62p5 family of SoCs is a variation of the am625 and am62a7 SoC family. Add this device along with the devices which will use the operating-points-v2 property. Signed-off-by: Bryan Brattlof Reviewed-by: Dhruva Gole Signed-off-by: Viresh Kumar commit 78a50b6a41665efeabeec5edbae245d8be93278c Author: Tiwei Bie Date: Tue Oct 10 19:39:15 2023 +0800 erofs: fix inode metadata space layout description in documentation Xattrs, extents, data inline are _placed after_, not _followed by_ the corresponding inode. This patch fixes it. Signed-off-by: Tiwei Bie Reviewed-by: Gao Xiang Reviewed-by: Jingbo Xu Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20231010113915.436591-1-tiwei.btw@antgroup.com Signed-off-by: Gao Xiang commit 21b2e2624d2ec69b831cd2edd202ca30ac6beae1 Merge: d1fea38f01acb 94ecde833be57 Author: Jakub Kicinski Date: Wed Oct 11 17:37:57 2023 -0700 Merge tag 'nf-next-23-10-10' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Florian Westphal says: ==================== netfilter updates for next First 5 patches, from Phil Sutter, clean up nftables dumpers to use the context buffer in the netlink_callback structure rather than a kmalloc'd buffer. Patch 6, from myself, zaps dead code and replaces the helper function with a small inlined helper. Patch 7, also from myself, removes another pr_debug and replaces it with the existing nf_log-based debug helpers. Last patch, from George Guo, gets nft_table comments back in sync with the structure members. * tag 'nf-next-23-10-10' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next: netfilter: cleanup struct nft_table netfilter: conntrack: prefer tcp_error_log to pr_debug netfilter: conntrack: simplify nf_conntrack_alter_reply netfilter: nf_tables: Don't allocate nft_rule_dump_ctx netfilter: nf_tables: Carry s_idx in nft_rule_dump_ctx netfilter: nf_tables: Carry reset flag in nft_rule_dump_ctx netfilter: nf_tables: Drop pointless memset when dumping rules netfilter: nf_tables: Always allocate nft_rule_dump_ctx ==================== Link: https://lore.kernel.org/r/20231010145343.12551-1-fw@strlen.de Signed-off-by: Jakub Kicinski commit 6f560c0f2aa00a3627c748aa0b194b81e99db5d7 Author: Chao Yu Date: Tue Oct 10 09:34:59 2023 +0800 f2fs: let f2fs_precache_extents() traverses in file range Rather than in range of [0, max_file_blocks()), since data after EOF is alwasy zero, it's unnecessary to preload mapping info of the data. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d1fea38f01acbd6bc6d0f919ecb56d5f57ccaa12 Author: Christian Marangi Date: Mon Oct 9 15:37:54 2023 +0200 netdev: use napi_schedule bool instead of napi_schedule_prep/__napi_schedule Replace if condition of napi_schedule_prep/__napi_schedule and use bool from napi_schedule directly where possible. Signed-off-by: Christian Marangi Link: https://lore.kernel.org/r/20231009133754.9834-5-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski commit be176234d0a845c075736490f34268b6a952c18f Author: Christian Marangi Date: Mon Oct 9 15:37:53 2023 +0200 net: tc35815: rework network interface interrupt logic Rework network interface logic. Before this change, the code flow was: 1. Disable interrupt 2. Try to schedule a NAPI 3. Check if it was possible (NAPI is not already scheduled) 4. emit BUG() if we receive interrupt while a NAPI is scheduled If some application busy poll or set gro_flush_timeout low enough, it's possible to reach the BUG() condition. Given that the condition may happen and it wouldn't be a bug, rework the logic to permit such case and prevent stall with interrupt never enabled again. Disable the interrupt only if the NAPI can be scheduled (aka it's not already scheduled) and drop the printk and BUG() call. With these change, in the event of a NAPI already scheduled, the interrupt is simply ignored with nothing done. Suggested-by: Eric Dumazet Signed-off-by: Christian Marangi Link: https://lore.kernel.org/r/20231009133754.9834-4-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski commit 73382e919f3d938554dadd01d95760f90d1c25c1 Author: Christian Marangi Date: Mon Oct 9 15:37:52 2023 +0200 netdev: replace napi_reschedule with napi_schedule Now that napi_schedule return a bool, we can drop napi_reschedule that does the same exact function. The function comes from a very old commit bfe13f54f502 ("ibm_emac: Convert to use napi_struct independent of struct net_device") and the purpose is actually deprecated in favour of different logic. Convert every user of napi_reschedule to napi_schedule. Signed-off-by: Christian Marangi Acked-by: Jeff Johnson # ath10k Acked-by: Nick Child # ibm Acked-by: Marc Kleine-Budde # for can/dev/rx-offload.c Reviewed-by: Eric Dumazet Acked-by: Tariq Toukan Link: https://lore.kernel.org/r/20231009133754.9834-3-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski commit 0a779003213b589d7b3eef72f69e19a30f603ebc Author: Christian Marangi Date: Mon Oct 9 15:37:51 2023 +0200 netdev: make napi_schedule return bool on NAPI successful schedule Change napi_schedule to return a bool on NAPI successful schedule. This might be useful for some driver to do additional steps after a NAPI has been scheduled. Suggested-by: Eric Dumazet Signed-off-by: Christian Marangi Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20231009133754.9834-2-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski commit ef724517b5962c03b984844b2a1128698e199363 Author: Christian Marangi Date: Mon Oct 9 15:37:50 2023 +0200 netdev: replace simple napi_schedule_prep/__napi_schedule to napi_schedule Replace drivers that still use napi_schedule_prep/__napi_schedule with napi_schedule helper as it does the same exact check and call. Signed-off-by: Christian Marangi Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20231009133754.9834-1-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski commit d2dc885b8c9ddb6fc374d93a87f8f2d1b97d2caf Merge: 1ef09e1281a1a 82ab6b505e819 Author: Martin KaFai Lau Date: Wed Oct 11 13:24:20 2023 -0700 Merge branch 'Add cgroup sockaddr hooks for unix sockets' Daan De Meyer says: ==================== Changes since v10: * Removed extra check from bpf_sock_addr_set_sun_path() again in favor of calling unix_validate_addr() everywhere in af_unix.c before calling the hooks. Changes since v9: * Renamed bpf_sock_addr_set_unix_addr() to bpf_sock_addr_set_sun_path() and rennamed arguments to match the new name. * Added an extra check to bpf_sock_addr_set_sun_path() to disallow changing the address of an unnamed unix socket. * Removed unnecessary NULL check on uaddrlen in __cgroup_bpf_run_filter_sock_addr(). Changes since v8: * Added missing test programs to last patch Changes since v7: * Fixed formatting nit in comment * Renamed from cgroup/connectun to cgroup/connect_unix (and similar for all other hooks) Changes since v6: * Actually removed bpf_bind() helper for AF_UNIX hooks. * Fixed merge conflict * Updated comment to mention uaddrlen is read-only for AF_INET[6] * Removed unnecessary forward declaration of struct sock_addr_test * Removed unused BPF_CGROUP_RUN_PROG_UNIX_CONNECT() * Fixed formatting nit reported by checkpatch * Added more information to commit message about recvmsg() on connected socket Changes since v5: * Fixed kernel version in bpftool documentation (6.3 => 6.7). * Added connection mode socket recvmsg() test. * Removed bpf_bind() helper for AF_UNIX hooks. * Added missing getpeernameun and getsocknameun BPF test programs. * Added note for bind() test being unused currently. Changes since v4: * Dropped support for intercepting bind() as when using bind() with unix sockets and a pathname sockaddr, bind() will create an inode in the filesystem that needs to be cleaned up. If the address is rewritten, users might try to clean up the wrong file and leak the actual socket file in the filesystem. * Changed bpf_sock_addr_set_unix_addr() to use BTF_KFUNC_HOOK_CGROUP_SKB instead of BTF_KFUNC_HOOK_COMMON. * Removed unix socket related changes from BPF_CGROUP_PRE_CONNECT_ENABLED() as unix sockets do not support pre-connect. * Added tests for getpeernameun and getsocknameun hooks. * We now disallow an empty sockaddr in bpf_sock_addr_set_unix_addr() similar to unix_validate_addr(). * Removed unnecessary cgroup_bpf_enabled() checks * Removed unnecessary error checks Changes since v3: * Renamed bpf_sock_addr_set_addr() to bpf_sock_addr_set_unix_addr() and made it only operate on AF_UNIX sockaddrs. This is because for the other families, users usually want to configure more than just the address so a generic interface will not fit the bill here. e.g. for AF_INET and AF_INET6, users would generally also want to be able to configure the port which the current interface doesn't support. So we expose an AF_UNIX specific function instead. * Made the tests in the new sock addr tests more generic (similar to test_sock_addr.c), this should make it easier to migrate the other sock addr tests in the future. * Removed the new kfunc hook and attached to BTF_KFUNC_HOOK_COMMON instead * Set uaddrlen to 0 when the family is AF_UNSPEC * Pass in the addrlen to the hook from IPv6 code * Fixed mount directory mkdir() to ignore EEXIST Changes since v2: * Configuring the sock addr is now done via a new kfunc bpf_sock_addr_set() * The addrlen is exposed as u32 in bpf_sock_addr_kern * Selftests are updated to use the new kfunc * Selftests are now added as a new sock_addr test in prog_tests/ * Added BTF_KFUNC_HOOK_SOCK_ADDR for BPF_PROG_TYPE_CGROUP_SOCK_ADDR * __cgroup_bpf_run_filter_sock_addr() now returns the modified addrlen Changes since v1: * Split into multiple patches instead of one single patch * Added unix support for all socket address hooks instead of only connect() * Switched approach to expose the socket address length to the bpf hook instead of recalculating the socket address length in kernelspace to properly support abstract unix socket addresses * Modified socket address hook tests to calculate the socket address length once and pass it around everywhere instead of recalculating the actual unix socket address length on demand. * Added some missing section name tests for getpeername()/getsockname() This patch series extends the cgroup sockaddr hooks to include support for unix sockets. To add support for unix sockets, struct bpf_sock_addr_kern is extended to expose the socket address length to the bpf program. Along with that, a new kfunc bpf_sock_addr_set_unix_addr() is added to safely allow modifying an AF_UNIX sockaddr from bpf programs. I intend to use these new hooks in systemd to reimplement the LogNamespace= feature, which allows running multiple instances of systemd-journald to process the logs of different services. systemd-journald also processes syslog messages, so currently, using log namespaces means all services running in the same log namespace have to live in the same private mount namespace so that systemd can mount the journal namespace's associated syslog socket over /dev/log to properly direct syslog messages from all services running in that log namespace to the correct systemd-journald instance. We want to relax this requirement so that processes running in disjoint mount namespaces can still run in the same log namespace. To achieve this, we can use these new hooks to rewrite the socket address of any connect(), sendto(), ... syscalls to /dev/log to the socket address of the journal namespace's syslog socket instead, which will transparently do the redirection without requiring use of a mount namespace and mounting over /dev/log. Aside from the above usecase, these hooks can more generally be used to transparently redirect unix sockets to different addresses as required by services. ==================== Signed-off-by: Martin KaFai Lau commit 82ab6b505e8199cc4537f00025a7391973c3847e Author: Daan De Meyer Date: Wed Oct 11 20:51:11 2023 +0200 selftests/bpf: Add tests for cgroup unix socket address hooks These selftests are written in prog_tests style instead of adding them to the existing test_sock_addr tests. Migrating the existing sock addr tests to prog_tests style is left for future work. This commit adds support for testing bind() sockaddr hooks, even though there's no unix socket sockaddr hook for bind(). We leave this code intact for when the INET and INET6 tests are migrated in the future which do support intercepting bind(). Signed-off-by: Daan De Meyer Link: https://lore.kernel.org/r/20231011185113.140426-10-daan.j.demeyer@gmail.com Signed-off-by: Martin KaFai Lau commit af2752ed450e71fc0bd596d0b4b9b805a64ae2c1 Author: Daan De Meyer Date: Wed Oct 11 20:51:10 2023 +0200 selftests/bpf: Make sure mount directory exists The mount directory for the selftests cgroup tree might not exist so let's make sure it does exist by creating it ourselves if it doesn't exist. Signed-off-by: Daan De Meyer Link: https://lore.kernel.org/r/20231011185113.140426-9-daan.j.demeyer@gmail.com Signed-off-by: Martin KaFai Lau commit 3243fef6a4c0db2dbb01ee3cf30bd787e65b8d56 Author: Daan De Meyer Date: Wed Oct 11 20:51:09 2023 +0200 documentation/bpf: Document cgroup unix socket address hooks Update the documentation to mention the new cgroup unix sockaddr hooks. Signed-off-by: Daan De Meyer Link: https://lore.kernel.org/r/20231011185113.140426-8-daan.j.demeyer@gmail.com Signed-off-by: Martin KaFai Lau commit 8b3cba987e6d9464bb533d957de923f891b57bf8 Author: Daan De Meyer Date: Wed Oct 11 20:51:08 2023 +0200 bpftool: Add support for cgroup unix socket address hooks Add the necessary plumbing to hook up the new cgroup unix sockaddr hooks into bpftool. Signed-off-by: Daan De Meyer Acked-by: Quentin Monnet Link: https://lore.kernel.org/r/20231011185113.140426-7-daan.j.demeyer@gmail.com Signed-off-by: Martin KaFai Lau commit bf90438c78df885c17a3474276ed39abb4a7c026 Author: Daan De Meyer Date: Wed Oct 11 20:51:07 2023 +0200 libbpf: Add support for cgroup unix socket address hooks Add the necessary plumbing to hook up the new cgroup unix sockaddr hooks into libbpf. Signed-off-by: Daan De Meyer Link: https://lore.kernel.org/r/20231011185113.140426-6-daan.j.demeyer@gmail.com Signed-off-by: Martin KaFai Lau commit 859051dd165ec6cc915f0f2114699021144fd249 Author: Daan De Meyer Date: Wed Oct 11 20:51:06 2023 +0200 bpf: Implement cgroup sockaddr hooks for unix sockets These hooks allows intercepting connect(), getsockname(), getpeername(), sendmsg() and recvmsg() for unix sockets. The unix socket hooks get write access to the address length because the address length is not fixed when dealing with unix sockets and needs to be modified when a unix socket address is modified by the hook. Because abstract socket unix addresses start with a NUL byte, we cannot recalculate the socket address in kernelspace after running the hook by calculating the length of the unix socket path using strlen(). These hooks can be used when users want to multiplex syscall to a single unix socket to multiple different processes behind the scenes by redirecting the connect() and other syscalls to process specific sockets. We do not implement support for intercepting bind() because when using bind() with unix sockets with a pathname address, this creates an inode in the filesystem which must be cleaned up. If we rewrite the address, the user might try to clean up the wrong file, leaking the socket in the filesystem where it is never cleaned up. Until we figure out a solution for this (and a use case for intercepting bind()), we opt to not allow rewriting the sockaddr in bind() calls. We also implement recvmsg() support for connected streams so that after a connect() that is modified by a sockaddr hook, any corresponding recmvsg() on the connected socket can also be modified to make the connected program think it is connected to the "intended" remote. Reviewed-by: Kuniyuki Iwashima Signed-off-by: Daan De Meyer Link: https://lore.kernel.org/r/20231011185113.140426-5-daan.j.demeyer@gmail.com Signed-off-by: Martin KaFai Lau commit 460c81da66f2258e504a547ea0e4facf5ed90903 Author: Justin Stitt Date: Mon Oct 9 17:45:33 2023 +0000 bna: replace deprecated strncpy with strscpy_pad `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. bfa_ioc_get_adapter_manufacturer() simply copies a string literal into `manufacturer`. Another implementation of bfa_ioc_get_adapter_manufacturer() from drivers/scsi/bfa/bfa_ioc.c uses memset + strscpy: | void | bfa_ioc_get_adapter_manufacturer(struct bfa_ioc_s *ioc, char *manufacturer) | { | memset((void *)manufacturer, 0, BFA_ADAPTER_MFG_NAME_LEN); | strscpy(manufacturer, BFA_MFG_NAME, BFA_ADAPTER_MFG_NAME_LEN); | } Let's use `strscpy_pad` to eliminate some redundant work while still NUL-terminating and NUL-padding the destination buffer. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231009-strncpy-drivers-net-ethernet-brocade-bna-bfa_ioc-c-v2-1-78e0f47985d3@google.com Signed-off-by: Jakub Kicinski commit ed9417206de7d306d6f79340fbe4849d3bdfae4e Author: Justin Stitt Date: Mon Oct 9 18:24:20 2023 +0000 net: dsa: lantiq_gswip: replace deprecated strncpy with ethtool_sprintf `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of this more robust and easier to understand interface. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20231009-strncpy-drivers-net-dsa-lantiq_gswip-c-v1-1-d55a986a14cc@google.com Signed-off-by: Jakub Kicinski commit ac49b992578d366bde19cfb9316d07784e255d2c Author: Justin Stitt Date: Mon Oct 9 18:29:19 2023 +0000 net: dsa: mt7530: replace deprecated strncpy with ethtool_sprintf `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of this more robust and easier to understand interface. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Acked-by: Daniel Golle Reviewed-by: Florian Fainelli Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231009-strncpy-drivers-net-dsa-mt7530-c-v1-1-ec6677a6436a@google.com Signed-off-by: Jakub Kicinski commit fda9e465a9d92f59cae40d0c2a2450797db6ec66 Author: Justin Stitt Date: Tue Oct 10 21:24:42 2023 +0000 net: mvpp2: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect `irqname` to be NUL-terminated based on its use with of_irq_get_byname() -> of_property_match_string() wherein it is used with a format string and a `strcmp`: | pr_debug("comparing %s with %s\n", string, p); | if (strcmp(string, p) == 0) | return i; /* Found it; return index */ NUL-padding is not required as is evident by other assignments to `irqname` which do not NUL-pad: | if (port->flags & MVPP2_F_DT_COMPAT) | snprintf(irqname, sizeof(irqname), "tx-cpu%d", i); | else | snprintf(irqname, sizeof(irqname), "hif%d", i); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231010-strncpy-drivers-net-ethernet-marvell-mvpp2-mvpp2_main-c-v1-1-51be96ad0324@google.com Signed-off-by: Jakub Kicinski commit 473f8f2d1bfe1103f20140fdc80cad406b4d68c0 Author: Justin Stitt Date: Tue Oct 10 21:38:11 2023 +0000 octeontx2-af: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We can see that linfo->lmac_type is expected to be NUL-terminated based on the `... - 1`'s present in the current code. Presumably making room for a NUL-byte at the end of the buffer. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Let's also prefer the more idiomatic strscpy usage of (dest, src, sizeof(dest)) rather than (dest, src, SOME_LEN). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231010-strncpy-drivers-net-ethernet-marvell-octeontx2-af-cgx-c-v1-1-a443e18f9de8@google.com Signed-off-by: Jakub Kicinski commit d3b4075b173f033387b614297bb4d998cf22c8bd Author: Dmitry Baryshkov Date: Thu Oct 12 00:47:05 2023 +0300 drm/msm/dp: use correct lifetime device for devm_drm_bridge_add The lifetime of the created drm_bridge is attached to the drm_device rather than the DP's platform_device. Use correct lifetime for devm_drm_bridge_add() call. Fixes: 61a72d5efce5 ("drm/msm/dp: switch to devm_drm_bridge_add()") Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/562203/ Link: https://lore.kernel.org/r/20231011214705.375738-4-dmitry.baryshkov@linaro.org commit eedf9af581b65dea53fb04d44ad081d10274d21f Author: Dmitry Baryshkov Date: Thu Oct 12 00:47:04 2023 +0300 drm/msm/hdmi: use correct lifetime device for devm_drm_bridge_add The lifetime of the created drm_bridge is attached to the drm_device rather than the HDMI's platform_device. Use correct lifetime for devm_drm_bridge_add() call. Fixes: 719093a67c7f ("drm/msm/hdmi: switch to devm_drm_bridge_add()") Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/562201/ Link: https://lore.kernel.org/r/20231011214705.375738-3-dmitry.baryshkov@linaro.org commit bf3f01d326ce8c61a670c0db12ffebc83f00c215 Author: Dmitry Baryshkov Date: Thu Oct 12 00:47:03 2023 +0300 drm/msm/dsi: use correct lifetime device for devm_drm_bridge_add The lifetime of the created drm_bridge is attached to the drm_device rather than the DSI's platform_device. Use correct lifetime for devm_drm_bridge_add() call. Fixes: 5f403fd7d5c2 ("drm/msm/dsi: switch to devm_drm_bridge_add()") Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/562200/ Link: https://lore.kernel.org/r/20231011214705.375738-2-dmitry.baryshkov@linaro.org commit 53e380d21441909b12b6e0782b77187ae4b971c4 Author: Daan De Meyer Date: Wed Oct 11 20:51:05 2023 +0200 bpf: Add bpf_sock_addr_set_sun_path() to allow writing unix sockaddr from bpf As prep for adding unix socket support to the cgroup sockaddr hooks, let's add a kfunc bpf_sock_addr_set_sun_path() that allows modifying a unix sockaddr from bpf. While this is already possible for AF_INET and AF_INET6, we'll need this kfunc when we add unix socket support since modifying the address for those requires modifying both the address and the sockaddr length. Signed-off-by: Daan De Meyer Link: https://lore.kernel.org/r/20231011185113.140426-4-daan.j.demeyer@gmail.com Signed-off-by: Martin KaFai Lau commit f949cb759051b24aa6cacda73964327608c08a89 Author: Hu Haowen Date: Wed Oct 11 13:12:12 2023 +0800 docs/zh_TW: update contents for zh_TW The content of zh_TW was too outdated comparing to the original files. Consequently carry out improvements in order to both keep track of sources and fix several grammatical mistakes in traditional Chinese. This is a thorough rewrite of the previous patch: https://lore.kernel.org/linux-doc/20230807120006.6361-1-src.res.211@gmail.com/ in order to get rid of text damage and merging errors, created based on linux-next (date: Oct. 9, 2023). Signed-off-by: Hu Haowen Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20231011051212.17580-1-src.res.211@gmail.com commit 0002c377e862140ad65b67b8b9dbf086d4578f95 Author: Tamás Szűcs Date: Wed Oct 11 18:18:05 2023 +0000 arm64: dts: rockchip: Remove duplicate regulator vcc3v3_wf from rock-5b Regulator for VCC3V3_WF has been added as vcc3v3_pcie2x1l0 first. Clean this up. Fixes: 1c9a53ff7ece ("arm64: dts: rockchip: Add sdio node to rock-5b") Signed-off-by: Tamás Szűcs Link: https://lore.kernel.org/r/20231011181757.58047-1-tszucs@protonmail.ch Signed-off-by: Heiko Stuebner commit 8152d3d070a9ca4f48020d11925718f1707db4f1 Author: Ondrej Jirman Date: Wed Oct 11 23:58:45 2023 +0200 arm64: dts: rockchip: Add QuartzPro64 SBC device tree QuartzPro64 dev board features: - RK3588 SoC - 16 GiB LPDDR4 RAM - 2x RK806 PMIC - RTC chip - eMMC, uSD card interface - 2x GMAC (one is PCIe connected) - SATA port - 2x USB 2.0 host only ports - 1x usb 3.0 host only port - 1x Type-C port (USB 3.0 + Alt-DP), TCPM support - 1x PCIe 3.0 4x slot - Audio codec (ES8388) + power amps - WiFi/Bluetooth - Power and work LEDs - 4 adc ladder buttons, 1 power button, 1 maskrom button Signed-off-by: Ondrej Jirman Link: https://lore.kernel.org/r/20231011215856.2082241-3-megi@xff.cz Signed-off-by: Heiko Stuebner commit a6fa0d4a704d7af51a5d02f76c73046cf957c1b5 Author: Ondrej Jirman Date: Wed Oct 11 23:58:44 2023 +0200 dt-bindings: arm: rockchip: Add Pine64 QuarzPro64 Add devicetree binding documentation for Pine64 QuartzPro64 SBC. Signed-off-by: Ondrej Jirman Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231011215856.2082241-2-megi@xff.cz Signed-off-by: Heiko Stuebner commit fefba7d1ae198dcbf8b3b432de46a4e29f8dbd8c Author: Daan De Meyer Date: Wed Oct 11 20:51:04 2023 +0200 bpf: Propagate modified uaddrlen from cgroup sockaddr programs As prep for adding unix socket support to the cgroup sockaddr hooks, let's propagate the sockaddr length back to the caller after running a bpf cgroup sockaddr hook program. While not important for AF_INET or AF_INET6, the sockaddr length is important when working with AF_UNIX sockaddrs as the size of the sockaddr cannot be determined just from the address family or the sockaddr's contents. __cgroup_bpf_run_filter_sock_addr() is modified to take the uaddrlen as an input/output argument. After running the program, the modified sockaddr length is stored in the uaddrlen pointer. Signed-off-by: Daan De Meyer Link: https://lore.kernel.org/r/20231011185113.140426-3-daan.j.demeyer@gmail.com Signed-off-by: Martin KaFai Lau commit 65002eea1677f1e31c197d70b65a2012cf0ea5e7 Author: Suraj Kandpal Date: Wed Oct 11 00:01:01 2023 +0530 drm/i915/display: Use correct method to free crtc_state Even though there is no leaking of resource here lets just use the correct method to free crtc_state Signed-off-by: Suraj Kandpal Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231010183101.704439-3-suraj.kandpal@intel.com commit 146f278975972bf0e241b6ae90591c5afa1435e4 Author: Suraj Kandpal Date: Wed Oct 11 00:01:00 2023 +0530 drm/i915/display: Use intel_crtc_destroy_state instead kfree intel_encoder_current_mode() seems to leak some resource because it uses kfree instead of intel_crtc_destroy_state let us fix that. Signed-off-by: Suraj Kandpal Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231010183101.704439-2-suraj.kandpal@intel.com commit 3657680f38cd7df413d665f2b2f38e9a78130d8b Author: Yang Yang Date: Tue Oct 10 16:45:43 2023 +0800 sched/psi: Delete the 'update_total' function parameter from update_triggers() The 'update_total' parameter of update_triggers() is always true after the previous commit: 80cc1d1d5ee3 ("sched/psi: Avoid updating PSI triggers and ->rtpoll_total when there are no state changes") If the 'changed_states & group->rtpoll_states' condition is true, 'new_stall' in update_triggers() will be true, and then 'update_total' should also be true. So update_total is redundant - remove it. [ mingo: Changelog updates ] Signed-off-by: Yang Yang Signed-off-by: Ingo Molnar Cc: Johannes Weiner Cc: Suren Baghdasaryan Cc: Peter Ziljstra Link: https://lore.kernel.org/r/202310101645437859599@zte.com.cn commit 80cc1d1d5ee35701daf11725ce06d8a240588973 Author: Yang Yang Date: Tue Oct 10 16:41:07 2023 +0800 sched/psi: Avoid updating PSI triggers and ->rtpoll_total when there are no state changes When psimon wakes up and there are no state changes for ->rtpoll_states, it's unnecessary to update triggers and ->rtpoll_total because the pressures being monitored by the user have not changed. This will help to slightly reduce unnecessary computations of PSI. [ mingo: Changelog updates ] Signed-off-by: Yang Yang Signed-off-by: Ingo Molnar Cc: Johannes Weiner Cc: Suren Baghdasaryan Cc: Peter Ziljstra Link: https://lore.kernel.org/r/202310101641075436843@zte.com.cn commit d3f785d74b3d066b17da57d25290b41471b4ebeb Author: Uwe Kleine-König Date: Mon Sep 25 11:55:23 2023 +0200 soc/tegra: cbb: tegra194-cbb: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit bde3ce7257ca68120f0d8db96b3df5bc14f8245d Author: Deming Wang Date: Tue Sep 12 08:10:30 2023 -0400 firmware: tegra: Fix a typo successfully, not 'succesfully' Signed-off-by: Deming Wang Signed-off-by: Thierry Reding commit 8f4156d58713b058e9aeebb28ffbe5f45ae57b47 Merge: 25e56847821f7 f454b18e07f51 Author: Ingo Molnar Date: Wed Oct 11 22:48:46 2023 +0200 Merge branch 'x86/urgent' into perf/core, to resolve conflict Resolve an MSR enumeration conflict. Conflicts: arch/x86/include/asm/msr-index.h Signed-off-by: Ingo Molnar commit 3f257bc63c0dcf50135971727e10e54f938d7fd7 Author: Thierry Reding Date: Tue Oct 10 17:26:14 2023 +0200 drm/tegra: gem: Do not return NULL in tegra_bo_mmap() It's confusing for a function to return NULL and ERR_PTR()-encoded error codes on failure. Make sure we only ever return the latter since that's what callers already expect. Reported-by: Sui Jingfeng Reviewed-by: Sui Jingfeng Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/ZSVuVcqdGfGtQIQj@orome.fritz.box commit 3868ff006b572cf501a3327832d36c64a9eca86a Author: Mikko Perttunen Date: Fri Sep 1 14:59:10 2023 +0300 drm/tegra: Zero-initialize iosys_map UBSAN reports an invalid load for bool, as the iosys_map is read later without being initialized. Zero-initialize it to avoid this. Reported-by: Ashish Mhetre Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20230901115910.701518-2-cyndis@kapsi.fi commit e889a311f74f4ae8bd40755a2c58d02e1c684fef Author: Johnny Liu Date: Fri Sep 1 14:59:09 2023 +0300 gpu: host1x: Correct allocated size for contexts Original implementation over allocates the memory size for the contexts list. The size of memory for the contexts list is based on the number of iommu groups specified in the device tree. Fixes: 8aa5bcb61612 ("gpu: host1x: Add context device management code") Signed-off-by: Johnny Liu Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20230901115910.701518-1-cyndis@kapsi.fi commit f017f1e9cb3458a86f586a171e284e2ec46286db Author: Mikko Perttunen Date: Fri Sep 1 14:40:07 2023 +0300 gpu: host1x: Syncpoint interrupt sharding Support sharded syncpoint interrupts on Tegra234+. This feature allows specifying one of eight interrupt lines for each syncpoint to lower processing latency of syncpoint threshold interrupts. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20230901114008.672433-1-cyndis@kapsi.fi commit b7c00cdf6df58b1d48d31d57f9431a200b0d0c88 Author: Mikko Perttunen Date: Fri Sep 1 14:15:09 2023 +0300 gpu: host1x: Enable system suspend callbacks With the previous CDMA stop fix, executing runtime PM ops around system suspend now makes channel submissions work after system suspend, so do that. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20230901111510.663401-3-cyndis@kapsi.fi commit 87fafcd53df8ca5b6695a71aa17f2e7aff464ecc Author: Mikko Perttunen Date: Fri Sep 1 14:15:08 2023 +0300 gpu: host1x: Stop CDMA before suspending Before going into suspend, wait all CDMA to go idle and stop it. This will ensure no channel is still active while we enter suspend, and ensures the driver doesn't think that CDMA is still active when coming back from suspend (as HW state has been reset). Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20230901111510.663401-2-cyndis@kapsi.fi commit 9764723de613d93b72e95923d25d589f539f07e9 Author: Mikko Perttunen Date: Fri Sep 1 14:15:07 2023 +0300 gpu: host1x: Add locking in channel allocation Add locking around channel allocation to avoid race conditions. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20230901111510.663401-1-cyndis@kapsi.fi commit f170bed50f9bbc4b03673f40c91f84d4d0258409 Author: Lee Jones Date: Thu Aug 24 08:37:00 2023 +0100 drm/tegra: hub: Increase buffer size to ensure all possible values can be stored When converting from int to string, we must allow for up to 10-chars (2147483647). Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/tegra/hub.c: In function ‘tegra_display_hub_probe’: drivers/gpu/drm/tegra/hub.c:1106:47: warning: ‘%u’ directive output may be truncated writing between 1 and 10 bytes into a region of size 4 [-Wformat-truncation=] drivers/gpu/drm/tegra/hub.c:1106:42: note: directive argument in the range [0, 4294967294] drivers/gpu/drm/tegra/hub.c:1106:17: note: ‘snprintf’ output between 6 and 15 bytes into a destination of size 8 Signed-off-by: Lee Jones Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20230824073710.2677348-16-lee@kernel.org commit 753c977b1536f6997380f6acb01c3b70dd7ca41a Author: Yue Haibing Date: Wed Aug 9 11:02:26 2023 +0800 drm/tegra: Remove two unused function declarations Commit 776dc3840367 ("drm/tegra: Move subdevice infrastructure to host1x") removed the implementation but not the declaration. Signed-off-by: Yue Haibing Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20230809030226.3412-1-yuehaibing@huawei.com commit 195dd40c49ff6ee13300cb024d0e870e598621f3 Author: Sui Jingfeng Date: Mon Jun 26 22:33:31 2023 +0800 drm/tegra: Remove surplus else after return else is not generally useful after return Signed-off-by: Sui Jingfeng Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20230626143331.640454-2-suijingfeng@loongson.cn commit 2250c7ead8ad95185249d24cf169e4f2b07dcc1a Author: Jani Nikula Date: Wed Oct 11 10:29:04 2023 +0300 drm/i915: enable W=1 warnings by default We enable a bunch more compiler warnings than the kernel defaults. However, they've drifted to become a unique set of warnings, and have increasingly fallen behind from the W=1 set. Align with the W=1 warnings from scripts/Makefile.extrawarn for clarity, by copy-pasting them with s/KBUILD_CFLAGS/subdir-ccflags-y/ to make it easier to compare in the future. Some of the -Wextra warnings do need to be disabled, just like in Makefile.extrawarn, but take care to not disable them for W=2 or W=3 builds, depending on the warning. v2: Add back some -Wextra warning disables (Nathan) Cc: Arnd Bergmann Cc: Nick Desaulniers Cc: Nathan Chancellor Cc: Masahiro Yamada Reviewed-by: Nathan Chancellor Reviewed-by: Masahiro Yamada [Final s/KBUILD_CFLAGS/subdir-ccflags-y/ fix while applying] Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/69a812273091b6535ddc7f9346289d71bb30f43d.1697009258.git.jani.nikula@intel.com commit 8d751da9f1d790f1d5e4b109eb0ad4a366d5efc8 Author: Raag Jadav Date: Wed Oct 11 12:12:18 2023 +0530 pinctrl: intel: fetch community only when we need it We check community features only in case PIN_CONFIG_BIAS_PULL_DOWN while setting/getting pad termination. No need to fetch the community otherwise. Signed-off-by: Raag Jadav Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 6fe13aa7c8696bae97b251b4c050cbb93d3065d3 Author: Raag Jadav Date: Wed Oct 11 12:15:33 2023 +0530 pinctrl: cherryview: reduce scope of PIN_CONFIG_BIAS_HIGH_IMPEDANCE case We have a couple of pinconfig cases inside the braces which are meant for PIN_CONFIG_BIAS_HIGH_IMPEDANCE case. Although it is valid C, it makes the code less readable and prone to misinterpretation. Limit the braces to PIN_CONFIG_BIAS_HIGH_IMPEDANCE case to avoid this. Signed-off-by: Raag Jadav Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit e0ba7366a699817d435aa500b107e42c9adafcca Author: Uwe Kleine-König Date: Mon Oct 9 10:38:41 2023 +0200 pinctrl: cherryview: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 7e1defac4b158cecb4628266f4d89732b4bd9179 Author: Jani Nikula Date: Wed Oct 11 10:29:03 2023 +0300 drm/i915: drop -Wall and related disables from cflags as redundant The kernel top level Makefile, and recently scripts/Makefile.extrawarn, have included -Wall, and the disables -Wno-format-security and $(call cc-disable-warning,frame-address,) for a very long time. They're redundant in our local subdir-ccflags-y and can be dropped. Cc: Arnd Bergmann Cc: Nick Desaulniers Cc: Nathan Chancellor Cc: Masahiro Yamada Reviewed-by: Nathan Chancellor Acked-by: Nick Desaulniers Reviewed-by: Masahiro Yamada Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/5ab754ddc2e342c75deb8476275984918e573beb.1697009258.git.jani.nikula@intel.com commit cb7fb0aa3cd80c6bf13abd1d4a75b0640c2e7eaf Author: Jakub Kicinski Date: Tue Oct 10 13:27:14 2023 -0700 tools: ynl: use ynl-gen -o instead of stdout in Makefile Jiri added more careful handling of output of the code generator to avoid wiping out existing files in commit f65f305ae008 ("tools: ynl-gen: use temporary file for rendering") Make use of the -o option in the Makefiles, it is already used by ynl-regen.sh. Link: https://lore.kernel.org/r/20231010202714.4045168-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 4a07f063d20c46524f00976f4537de72d9f31c4e Author: Khaled Almahallawy Date: Wed Oct 4 17:13:10 2023 -0700 drm/i915/cx0: Only clear/set the Pipe Reset bit of the PHY Lanes Owned Currently, with MFD/pin assignment D, the driver clears the pipe reset bit of lane 1 which is not owned by display. This causes the display to block S0iX. By not clearing this bit for lane 1 and keeping whatever default, S0ix started to work. This is already what the driver does at the end of the phy lane reset sequence (Step#8) Bspec: 65451 Fixes: 619a06dba6fa ("drm/i915/mtl: Reset only one lane in case of MFD") Cc: Mika Kahola Cc: Gustavo Sousa Signed-off-by: Khaled Almahallawy Reviewed-by: Gustavo Sousa Signed-off-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20231005001310.154396-1-khaled.almahallawy@intel.com commit 0f07415ebb78e700393237b9148487a2fe27fb04 Author: Jiri Pirko Date: Tue Oct 10 09:48:10 2023 +0200 netlink: specs: don't allow version to be specified for genetlink There is no good reason to specify the version for new protocols. Forbid it in genetlink schema. If the future proves me wrong, this restriction could be easily lifted. Move the version definition in between legacy properties in genetlink-legacy. Suggested-by: Jakub Kicinski Signed-off-by: Jiri Pirko Link: https://lore.kernel.org/r/20231010074810.191177-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 9b47243cc290c63d560369efdc5a85d8a6e4bf44 Merge: bbb63db3b0ecb 8a45c4f9e1590 Author: Jakub Kicinski Date: Wed Oct 11 13:24:56 2023 -0700 Merge branch 'add-vf-fault-detect-support-for-hns3-ethernet-driver' Jijie Shao says: ==================== add vf fault detect support for HNS3 ethernet driver ==================== Link: https://lore.kernel.org/r/20231007031215.1067758-1-shaojijie@huawei.com Signed-off-by: Jakub Kicinski commit 8a45c4f9e15902e5c52d5c42cda6239bc473c7c8 Author: Jie Wang Date: Sat Oct 7 11:12:15 2023 +0800 net: hns3: add vf fault detect support Currently hns3 driver supports vf fault detect feature. Several ras caused by VF resources don't need to do PF function reset for recovery. The driver only needs to reset the specified VF. So this patch adds process in ras module. New process will get detailed information about ras and do the most correct measures based on these accurate information. Signed-off-by: Jie Wang Signed-off-by: Jijie Shao Link: https://lore.kernel.org/r/20231007031215.1067758-3-shaojijie@huawei.com Signed-off-by: Jakub Kicinski commit f1bc63aa6e114c526a3aed44f9f3a6e23c044d54 Author: Jie Wang Date: Sat Oct 7 11:12:14 2023 +0800 net: hns3: add hns3 vf fault detect cap bit support Currently hns3 driver is designed to support VF fault detect feature in new hardwares. For code compatibility, vf fault detect cap bit is added to the driver. Signed-off-by: Jie Wang Signed-off-by: Jijie Shao Link: https://lore.kernel.org/r/20231007031215.1067758-2-shaojijie@huawei.com Signed-off-by: Jakub Kicinski commit feba7b634ef0d003184d6988d96c34ab3c50de59 Author: Daan De Meyer Date: Wed Oct 11 20:51:03 2023 +0200 selftests/bpf: Add missing section name tests for getpeername/getsockname These were missed when these hooks were first added so add them now instead to make sure every sockaddr hook has a matching section name test. Signed-off-by: Daan De Meyer Link: https://lore.kernel.org/r/20231011185113.140426-2-daan.j.demeyer@gmail.com Signed-off-by: Martin KaFai Lau commit aaa5fa35743ab9f0726568611a85e3e15349b9bf Author: Fenghua Yu Date: Tue Oct 10 12:42:39 2023 +0200 Documentation/x86: Document resctrl's new sparse_masks The documentation mentions that non-contiguous bit masks are not supported in Intel Cache Allocation Technology (CAT). Update the documentation on how to determine if sparse bit masks are allowed in L2 and L3 CAT. Signed-off-by: Fenghua Yu Signed-off-by: Maciej Wieczor-Retman Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Ilpo Järvinen Reviewed-by: Peter Newman Reviewed-by: Reinette Chatre Reviewed-by: Babu Moger Tested-by: Peter Newman Link: https://lore.kernel.org/r/3e9610997164f648e15c5c2e90d4944ce36504fe.1696934091.git.maciej.wieczor-retman@intel.com commit 4dba8f10b8fef9c5b0f9ed83dd1af91a1795ead1 Author: Fenghua Yu Date: Tue Oct 10 12:42:38 2023 +0200 x86/resctrl: Add sparse_masks file in info Add the interface in resctrl FS to show if sparse cache allocation bit masks are supported on the platform. Reading the file returns either a "1" if non-contiguous 1s are supported and "0" otherwise. The file path is /sys/fs/resctrl/info/{resource}/sparse_masks, where {resource} can be either "L2" or "L3". Signed-off-by: Fenghua Yu Signed-off-by: Maciej Wieczor-Retman Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Ilpo Järvinen Reviewed-by: Peter Newman Reviewed-by: Reinette Chatre Reviewed-by: Babu Moger Tested-by: Peter Newman Link: https://lore.kernel.org/r/7300535160beba41fd8aa073749ec1ee29b4621f.1696934091.git.maciej.wieczor-retman@intel.com commit 0e3cd31f6e9074886dea5a999bfcc563d144e7de Author: Maciej Wieczor-Retman Date: Tue Oct 10 12:42:37 2023 +0200 x86/resctrl: Enable non-contiguous CBMs in Intel CAT The setting for non-contiguous 1s support in Intel CAT is hardcoded to false. On these systems, writing non-contiguous 1s into the schemata file will fail before resctrl passes the value to the hardware. In Intel CAT CPUID.0x10.1:ECX[3] and CPUID.0x10.2:ECX[3] stopped being reserved and now carry information about non-contiguous 1s value support for L3 and L2 cache respectively. The CAT capacity bitmask (CBM) supports a non-contiguous 1s value if the bit is set. The exception are Haswell systems where non-contiguous 1s value support needs to stay disabled since they can't make use of CPUID for Cache allocation. Originally-by: Fenghua Yu Signed-off-by: Maciej Wieczor-Retman Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Ilpo Järvinen Reviewed-by: Peter Newman Reviewed-by: Reinette Chatre Reviewed-by: Babu Moger Tested-by: Peter Newman Link: https://lore.kernel.org/r/1849b487256fe4de40b30f88450cba3d9abc9171.1696934091.git.maciej.wieczor-retman@intel.com commit ccee9a2a8c002516d4252952df836abeaddfa39c Author: Joel Granados Date: Mon Oct 2 10:55:32 2023 +0200 intel drm: Remove now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from oa_table Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit a90d3c46c03ac3df0cf09361b22ee4b2b6b19da6 Author: Joel Granados Date: Mon Oct 2 10:55:31 2023 +0200 Drivers: hv: Remove now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from hv_ctl_table Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit dd6291c506490c195620b394dc96763675e7e5f4 Author: Joel Granados Date: Mon Oct 2 10:55:30 2023 +0200 raid: Remove now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from raid_table Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit febce0693e3a8209f442b4abbdba71c918c7edc7 Author: Joel Granados Date: Mon Oct 2 10:55:29 2023 +0200 fw loader: Remove the now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from firmware_config_table Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit 3af80b24a305117115d0450475bc2ed562b0de5b Author: Joel Granados Date: Mon Oct 2 10:55:28 2023 +0200 sgi-xp: Remove the now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from xpc_sys_xpc_hb and xpc_sys_xpc Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit bd7ac73cbbecb16d090f902a903be8189cf7a5a0 Author: Joel Granados Date: Mon Oct 2 10:55:27 2023 +0200 vrf: Remove the now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from vrf_table Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit ed1aa959b50854bddd7252d404aa6fdbcfa60b99 Author: Joel Granados Date: Mon Oct 2 10:55:26 2023 +0200 char-misc: Remove the now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from impi_table and random_table Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit 6d07cc269bd4c23aea49c99bd1b9bef34b27199e Author: Joel Granados Date: Mon Oct 2 10:55:25 2023 +0200 infiniband: Remove the now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from iwcm_ctl_table and ucma_ctl_table Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit 3c2461facf38f7601631005ce71e207d86bfa87e Author: Joel Granados Date: Mon Oct 2 10:55:24 2023 +0200 macintosh: Remove the now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from mac_hid_files Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit 0829381e481ab2760086cc88090f70e761e4fcc2 Author: Joel Granados Date: Mon Oct 2 10:55:23 2023 +0200 parport: Remove the now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove the unneeded ctl_tables that were used to register intermediate parport directories; only the path is needed at this point. From parport_device_sysctl_table we removed: devices_root_dir, port_dir, parport_dir and dev_dir. From parport_default_sysctl_table we removed: default_dir, parport_dir and dev_dir. Reduce the size by one of the ctl_table arrays that were not removed Assign different sizes to the vars array in parport_sysctl_table depending on CONFIG_PARPORT_1284; this is necessary now that the sysctl register function uses ARRAY_SIZE to calculate the elements within. Remove the sentinel element from parport_sysctl_template, parport_device_sysctl_table and parport_default_sysctl_table. Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit b52b716bd3c2aab070c1bb4c4f4393401d3b3599 Author: Joel Granados Date: Mon Oct 2 10:55:22 2023 +0200 scsi: Remove now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from scsi_table and sg_sysctls. Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit 06a743af5a756e6345c120badc109307c35c8a66 Author: Joel Granados Date: Mon Oct 2 10:55:21 2023 +0200 tty: Remove now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from tty_table Signed-off-by: Joel Granados Reviewed-by: Jiri Slaby Signed-off-by: Luis Chamberlain commit a5b2aeeac19c81756cca61aa19c381ed216dadb4 Author: Joel Granados Date: Mon Oct 2 10:55:20 2023 +0200 xen: Remove now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from balloon_table Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit 23b69088db836470b0e8847f3bc65165f2bdfbdc Author: Joel Granados Date: Mon Oct 2 10:55:19 2023 +0200 hpet: Remove now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove the last empty element from hpet_table. Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit 39c6eed1f61594f737160e498d29673edbd9eefd Author: Maciej Wieczor-Retman Date: Tue Oct 10 12:42:36 2023 +0200 x86/resctrl: Rename arch_has_sparse_bitmaps Rename arch_has_sparse_bitmaps to arch_has_sparse_bitmasks to ensure consistent terminology throughout resctrl. Suggested-by: Reinette Chatre Signed-off-by: Maciej Wieczor-Retman Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Ilpo Järvinen Reviewed-by: Peter Newman Reviewed-by: Reinette Chatre Reviewed-by: Babu Moger Tested-by: Peter Newman Link: https://lore.kernel.org/r/e330fcdae873ef1a831e707025a4b70fa346666e.1696934091.git.maciej.wieczor-retman@intel.com commit 5c77ebcd05acf3789949c8a387df72381d949ca2 Author: Rob Herring Date: Mon Oct 9 16:13:40 2023 -0500 remoteproc: st: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Patrice Chotard Link: https://lore.kernel.org/r/20231009211356.3242037-10-robh@kernel.org Signed-off-by: Mathieu Poirier commit 70525e5d82f62407d8436aa2a6c3385829ab5a3e Author: Hannes Reinecke Date: Thu Aug 24 16:39:25 2023 +0200 nvmet-tcp: peek icreq before starting TLS Incoming connection might be either 'normal' NVMe-TCP connections starting with icreq or TLS handshakes. To ensure that 'normal' connections can still be handled we need to peek the first packet and only start TLS handshake if it's not an icreq. With that we can lift the restriction to always set TREQ to 'required' when TLS1.3 is enabled. Signed-off-by: Hannes Reinecke Signed-off-by: Keith Busch commit a1c5dd8355b172b44a4ff8248fb487006236a918 Author: Hannes Reinecke Date: Thu Aug 24 16:39:24 2023 +0200 nvmet-tcp: control messages for recvmsg() kTLS requires control messages for recvmsg() to relay any out-of-band TLS messages (eg TLS alerts) to the caller. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 675b453e024154dd547921c6e6d5b58747ba7e0e Author: Hannes Reinecke Date: Thu Aug 24 16:39:23 2023 +0200 nvmet-tcp: enable TLS handshake upcall TLS handshake is handled in userspace with the netlink tls handshake protocol. The patch adds a function to start the TLS handshake upcall for any incoming network connections if the TCP TSAS sectype is set to 'tls1.3'. A config option NVME_TARGET_TCP_TLS selects whether the TLS handshake upcall should be compiled in. The patch also adds reference counting to struct nvmet_tcp_queue to ensure the queue is always valid when the the TLS handshake completes. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit eb398812bd046e86a332229d8a17525a05351b20 Author: Hannes Reinecke Date: Thu Aug 24 16:39:22 2023 +0200 nvmet: Set 'TREQ' to 'required' when TLS is enabled The current implementation does not support secure concatenation, so 'TREQ' is always set to 'required' when TLS is enabled. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 79a4f186ad37423996e7835e9d3d6055ff1a181d Author: Hannes Reinecke Date: Thu Aug 24 16:39:21 2023 +0200 nvmet-tcp: allocate socket file For the TLS upcall we need to allocate a socket file such that the userspace daemon is able to use the socket. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 4f8cce2d32a3011bff8c8a4bbc69bca5a7bdd030 Author: Hannes Reinecke Date: Thu Aug 24 16:39:20 2023 +0200 nvmet-tcp: make nvmet_tcp_alloc_queue() a void function The return value from nvmet_tcp_alloc_queue() are just used to figure out if sock_release() need to be called. So this patch moves sock_release() into nvmet_tcp_alloc_queue() and make it a void function. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Reviewed-by: Nitesh Shetty Signed-off-by: Keith Busch commit 3f123494db725d899fdf990d894648bcc33cf7a3 Author: Hannes Reinecke Date: Thu Aug 24 16:39:19 2023 +0200 nvmet: make TCP sectype settable via configfs Add a new configfs attribute 'addr_tsas' to make the TCP sectype settable via configfs. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit adf22c520b5ec45a6f05a19ed26d61fe463b6626 Author: Hannes Reinecke Date: Thu Aug 24 16:39:18 2023 +0200 nvme-fabrics: parse options 'keyring' and 'tls_key' Parse the fabrics options 'keyring' and 'tls_key' and store the referenced keys in the options structure. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit e4f4aabb6f66177410e573bdf821f29f9746765f Author: Hannes Reinecke Date: Thu Aug 24 16:39:17 2023 +0200 nvme-tcp: improve icreq/icresp logging When icreq/icresp fails we should be printing out a warning to inform the user that the connection could not be established; without it there won't be anything in the kernel message log, just an error code returned to nvme-cli. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 2837966ab2a8117b002ee9c02fa62a01db787844 Author: Hannes Reinecke Date: Thu Aug 24 16:39:16 2023 +0200 nvme-tcp: control message handling for recvmsg() kTLS is sending TLS ALERT messages as control messages for recvmsg(). As we can't do anything sensible with it just abort the connection and let the userspace agent to a re-negotiation. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit be8e82caa685997b524dc7e4932853fd2fbe6199 Author: Hannes Reinecke Date: Thu Aug 24 16:39:15 2023 +0200 nvme-tcp: enable TLS handshake upcall Add a fabrics option 'tls' and start the TLS handshake upcall with the default PSK. When TLS is started the PSK key serial number is displayed in the sysfs attribute 'tls_key' Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit e40d4eb84089eae14a3396ba8b0db7b1f24ef2f8 Author: Hannes Reinecke Date: Thu Aug 24 16:39:14 2023 +0200 nvme-tcp: allocate socket file When using the TLS upcall we need to allocate a socket file such that the userspace daemon is able to use the socket. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 037c34318a479294cdb98dc8018edd5d191b68c0 Author: Hannes Reinecke Date: Thu Aug 24 16:39:13 2023 +0200 security/keys: export key_lookup() For in-kernel consumers one cannot readily assign a user (eg when running from a workqueue), so the normal key search permissions cannot be applied. This patch exports the 'key_lookup()' function for a simple lookup of keys without checking for permissions. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Acked-by: David Howells Signed-off-by: Keith Busch commit 501cc6f4aca8dc0958c4d9716f0233ba7cff4830 Author: Hannes Reinecke Date: Thu Aug 24 16:39:12 2023 +0200 nvme-keyring: implement nvme_tls_psk_default() Implement a function to select the preferred PSK for TLS. A 'retained' PSK should be preferred over a 'generated' PSK, and SHA-384 should be preferred to SHA-256. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit a86062aac34d100a3117c0fff91ee1892ebfb460 Author: Hannes Reinecke Date: Thu Aug 24 16:39:11 2023 +0200 nvme-tcp: add definitions for TLS cipher suites Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 646f45b23218c7a97a84259d8eeb22dad5711fc8 Author: Hannes Reinecke Date: Thu Aug 24 16:39:10 2023 +0200 nvme: add TCP TSAS definitions Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 3bac969b16b7bc304ba56d030847920fc7073a91 Author: Hannes Reinecke Date: Thu Aug 24 16:39:09 2023 +0200 nvme-keyring: define a 'psk' keytype Define a 'psk' keytype to hold the NVMe TLS PSKs. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit 9d77eb52778499a97cab662aa96de4e2e4fa72d3 Author: Hannes Reinecke Date: Thu Aug 24 16:39:08 2023 +0200 nvme-keyring: register '.nvme' keyring Register a '.nvme' keyring to hold keys for TLS and DH-HMAC-CHAP and add a new config option NVME_KEYRING. We need a separate keyring for NVMe as the configuration is done via individual commands (eg for configfs), and the usual per-session or per-process keyrings can't be used. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Keith Busch commit db7673e6d5783a8664840b9218f58b5b836603ce Author: Jinjie Ruan Date: Fri Sep 1 15:09:29 2023 +0800 Watchdog: marvell_gti_wdt: Remove redundant dev_err_probe() for platform_get_irq() Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"), there is no need to call the dev_err_probe() function directly to print a custom message when handling an error from platform_get_irq() function as it is going to display an appropriate error message in case of a failure. Fixes: ef9e7fe2c890 ("Watchdog: Add marvell GTI watchdog driver") Signed-off-by: Jinjie Ruan Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230901070929.1317982-1-ruanjinjie@huawei.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 15f0f6d2ee05392ce05244a1aadc8b564099672d Author: Srinivas Neeli Date: Wed Aug 30 15:58:25 2023 +0530 watchdog: of_xilinx_wdt: Remove unnecessary clock disable call in the remove path There is a mismatch in axi clock enable and disable calls. The axi clock is enabled and disabled by the probe function, then it is again disabled in the remove path. So observed the call trace while removing the module. Use the clk_enable() and devm_clk_get_prepared() functions instead of devm_clk_get_enable() to avoid an extra clock disable call from the remove path. Call trace: clk_core_disable+0xb0/0xc0 clk_disable+0x30/0x4c clk_disable_unprepare+0x18/0x30 devm_clk_release+0x24/0x40 devres_release_all+0xc8/0x190 device_unbind_cleanup+0x18/0x6c device_release_driver_internal+0x20c/0x250 device_release_driver+0x18/0x24 bus_remove_device+0x124/0x130 device_del+0x174/0x440 Fixes: b6bc41645547 ("watchdog: of_xilinx_wdt: Add support for reading freq via CCF") Signed-off-by: Srinivas Neeli Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230901070929.1317982-1-ruanjinjie@huawei.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 3e383dce513f426b7d79c0e6f8afe5d22a581f58 Author: Wolfram Sang Date: Wed Oct 11 18:43:58 2023 +0200 Revert "dt-bindings: i2c: qcom-cci: Document sc8280xp compatible" This reverts commit ae2a1f0f2cb52e15cf45508f499fcbfd6637bc56. An updated series was sent. And this patch was not needed anymore because another compatible entry was reused. Signed-off-by: Wolfram Sang commit c850ecfc8914d3e0aa2899bc2e718bed1f1b50b0 Author: Marek Szyprowski Date: Fri Oct 6 16:41:17 2023 +0200 i2c: brcmstb: Add support for atomic transfers Add support for atomic transfers using polling mode with interrupts intentionally disabled to get rid of the warning introduced by commit 63b96983a5dd ("i2c: core: introduce callbacks for atomic transfers") during system reboot and power-off. Signed-off-by: Marek Szyprowski Reviewed-by: Florian Fainelli Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit bdb970186d156eb596f8f16f6e8467cdd5d57a70 Author: Jinjie Ruan Date: Thu Aug 24 21:55:14 2023 +0800 watchdog: sunplus: Use the devm_clk_get_enabled() helper function The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code and avoids the need of a dedicated function used with devm_add_action_or_reset(). Signed-off-by: Jinjie Ruan Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230824135514.2661364-4-ruanjinjie@huawei.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit c51a6977bd9560d7ef2ed35353b328f076e8a591 Author: Jinjie Ruan Date: Thu Aug 24 21:55:13 2023 +0800 watchdog: ath79_wdt: Use the devm_clk_get_enabled() helper function The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code. Signed-off-by: Jinjie Ruan Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230824135514.2661364-3-ruanjinjie@huawei.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 3cbb42827d0d2bb509e765df6d4d2b483f870bd8 Author: Jinjie Ruan Date: Thu Aug 24 21:55:12 2023 +0800 watchdog: at91sam9_wdt: Use the devm_clk_get_enabled() helper function The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code. Signed-off-by: Jinjie Ruan Reviewed-by: Claudiu Beznea Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230824135514.2661364-2-ruanjinjie@huawei.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit f6d7f050e258e3c71e310f5167c4d65bbefaeb31 Author: Andy Shevchenko Date: Tue Oct 10 19:31:00 2023 +0300 spi: Don't use flexible array in struct spi_message definition The struct spi_message can be embedded into another structures. With that the flexible array might be problematic as sparse complains about it, although there is no real issue in the code because when the message is embedded it doesn't use flexible array member. That memeber is a private to spi_message_alloc() API, so move it to that API in a form of an inherited data type. Reported-by: Marc Kleine-Budde Fixes: 75e308ffc4f0 ("spi: Use struct_size() helper")) Closes: https://lore.kernel.org/r/20231009-onshore-underage-c58415adfd92-mkl@pengutronix.de Signed-off-by: Andy Shevchenko Reviewed-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20231010163100.89734-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit dd6cad2dcb581b2b15997b6e8d50de64644c3011 Author: Greg Kroah-Hartman Date: Fri Oct 6 16:02:12 2023 +0200 testing: nvdimm: make struct class structures constant Now that the driver core allows for struct class to be in read-only memory, we should make all 'class' structures declared at build time placing them into read-only memory, instead of having to be dynamically allocated at runtime. Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Signed-off-by: Greg Kroah-Hartman Tested-by: Ira Weiny Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/2023100611-platinum-galleria-ceb3@gregkh Signed-off-by: Ira Weiny commit a26b452e836e39223915adc41867441f3f0b372b Merge: c99626092efca 108ffd12be24b Author: Rafael J. Wysocki Date: Wed Oct 11 17:56:51 2023 +0200 Merge branch 'acpi-thermal' The ACPI thermal driver changes include some thermal core modifications that are depended on by subsequent thermal core changes, so merge them. * acpi-thermal: (26 commits) thermal: trip: Drop lockdep assertion from thermal_zone_trip_id() thermal: trip: Remove lockdep assertion from for_each_thermal_trip() thermal: core: Drop thermal_zone_device_exec() ACPI: thermal: Use thermal_zone_for_each_trip() for updating trips ACPI: thermal: Combine passive and active trip update functions ACPI: thermal: Move get_active_temp() ACPI: thermal: Fix up function header formatting in two places ACPI: thermal: Drop list of device ACPI handles from struct acpi_thermal ACPI: thermal: Rename structure fields holding temperature in deci-Kelvin ACPI: thermal: Drop critical_valid and hot_valid trip flags ACPI: thermal: Do not use trip indices for cooling device binding ACPI: thermal: Mark uninitialized active trips as invalid ACPI: thermal: Merge trip initialization functions ACPI: thermal: Collapse trip devices update function wrappers ACPI: thermal: Collapse trip devices update functions ACPI: thermal: Add device list to struct acpi_thermal_trip ACPI: thermal: Fix a small leak in acpi_thermal_add() ACPI: thermal: Drop valid flag from struct acpi_thermal_trip ACPI: thermal: Drop redundant trip point flags ACPI: thermal: Untangle initialization and updates of active trips ... commit 21ca59b365c091d583f36ac753eaa8baf947be6f Author: Christian Brauner Date: Thu Oct 28 12:31:14 2021 +0200 binfmt_misc: enable sandboxed mounts Enable unprivileged sandboxes to create their own binfmt_misc mounts. This is based on Laurent's work in [1] but has been significantly reworked to fix various issues we identified in earlier versions. While binfmt_misc can currently only be mounted in the initial user namespace, binary types registered in this binfmt_misc instance are available to all sandboxes (Either by having them installed in the sandbox or by registering the binary type with the F flag causing the interpreter to be opened right away). So binfmt_misc binary types are already delegated to sandboxes implicitly. However, while a sandbox has access to all registered binary types in binfmt_misc a sandbox cannot currently register its own binary types in binfmt_misc. This has prevented various use-cases some of which were already outlined in [1] but we have a range of issues associated with this (cf. [3]-[5] below which are just a small sample). Extend binfmt_misc to be mountable in non-initial user namespaces. Similar to other filesystem such as nfsd, mqueue, and sunrpc we use keyed superblock management. The key determines whether we need to create a new superblock or can reuse an already existing one. We use the user namespace of the mount as key. This means a new binfmt_misc superblock is created once per user namespace creation. Subsequent mounts of binfmt_misc in the same user namespace will mount the same binfmt_misc instance. We explicitly do not create a new binfmt_misc superblock on every binfmt_misc mount as the semantics for load_misc_binary() line up with the keying model. This also allows us to retrieve the relevant binfmt_misc instance based on the caller's user namespace which can be done in a simple (bounded to 32 levels) loop. Similar to the current binfmt_misc semantics allowing access to the binary types in the initial binfmt_misc instance we do allow sandboxes access to their parent's binfmt_misc mounts if they do not have created a separate binfmt_misc instance. Overall, this will unblock the use-cases mentioned below and in general will also allow to support and harden execution of another architecture's binaries in tight sandboxes. For instance, using the unshare binary it possible to start a chroot of another architecture and configure the binfmt_misc interpreter without being root to run the binaries in this chroot and without requiring the host to modify its binary type handlers. Henning had already posted a few experiments in the cover letter at [1]. But here's an additional example where an unprivileged container registers qemu-user-static binary handlers for various binary types in its separate binfmt_misc mount and is then seamlessly able to start containers with a different architecture without affecting the host: root [lxc monitor] /var/snap/lxd/common/lxd/containers f1 1000000 \_ /sbin/init 1000000 \_ /lib/systemd/systemd-journald 1000000 \_ /lib/systemd/systemd-udevd 1000100 \_ /lib/systemd/systemd-networkd 1000101 \_ /lib/systemd/systemd-resolved 1000000 \_ /usr/sbin/cron -f 1000103 \_ /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only 1000000 \_ /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers 1000104 \_ /usr/sbin/rsyslogd -n -iNONE 1000000 \_ /lib/systemd/systemd-logind 1000000 \_ /sbin/agetty -o -p -- \u --noclear --keep-baud console 115200,38400,9600 vt220 1000107 \_ dnsmasq --conf-file=/dev/null -u lxc-dnsmasq --strict-order --bind-interfaces --pid-file=/run/lxc/dnsmasq.pid --liste 1000000 \_ [lxc monitor] /var/lib/lxc f1-s390x 1100000 \_ /usr/bin/qemu-s390x-static /sbin/init 1100000 \_ /usr/bin/qemu-s390x-static /lib/systemd/systemd-journald 1100000 \_ /usr/bin/qemu-s390x-static /usr/sbin/cron -f 1100103 \_ /usr/bin/qemu-s390x-static /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-ac 1100000 \_ /usr/bin/qemu-s390x-static /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers 1100104 \_ /usr/bin/qemu-s390x-static /usr/sbin/rsyslogd -n -iNONE 1100000 \_ /usr/bin/qemu-s390x-static /lib/systemd/systemd-logind 1100000 \_ /usr/bin/qemu-s390x-static /sbin/agetty -o -p -- \u --noclear --keep-baud console 115200,38400,9600 vt220 1100000 \_ /usr/bin/qemu-s390x-static /sbin/agetty -o -p -- \u --noclear --keep-baud pts/0 115200,38400,9600 vt220 1100000 \_ /usr/bin/qemu-s390x-static /sbin/agetty -o -p -- \u --noclear --keep-baud pts/1 115200,38400,9600 vt220 1100000 \_ /usr/bin/qemu-s390x-static /sbin/agetty -o -p -- \u --noclear --keep-baud pts/2 115200,38400,9600 vt220 1100000 \_ /usr/bin/qemu-s390x-static /sbin/agetty -o -p -- \u --noclear --keep-baud pts/3 115200,38400,9600 vt220 1100000 \_ /usr/bin/qemu-s390x-static /lib/systemd/systemd-udevd [1]: https://lore.kernel.org/all/20191216091220.465626-1-laurent@vivier.eu [2]: https://discuss.linuxcontainers.org/t/binfmt-misc-permission-denied [3]: https://discuss.linuxcontainers.org/t/lxd-binfmt-support-for-qemu-static-interpreters [4]: https://discuss.linuxcontainers.org/t/3-1-0-binfmt-support-service-in-unprivileged-guest-requires-write-access-on-hosts-proc-sys-fs-binfmt-misc [5]: https://discuss.linuxcontainers.org/t/qemu-user-static-not-working-4-11 Link: https://lore.kernel.org/r/20191216091220.465626-2-laurent@vivier.eu (origin) Link: https://lore.kernel.org/r/20211028103114.2849140-2-brauner@kernel.org (v1) Cc: Sargun Dhillon Cc: Serge Hallyn Cc: Jann Horn Cc: Henning Schild Cc: Andrei Vagin Cc: Al Viro Cc: Laurent Vivier Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Laurent Vivier Signed-off-by: Christian Brauner Signed-off-by: Christian Brauner Signed-off-by: Kees Cook --- /* v2 */ - Serge Hallyn : - Use GFP_KERNEL_ACCOUNT for userspace triggered allocations when a new binary type handler is registered. - Christian Brauner : - Switch authorship to me. I refused to do that earlier even though Laurent said I should do so because I think it's genuinely bad form. But by now I have changed so many things that it'd be unfair to blame Laurent for any potential bugs in here. - Add more comments that explain what's going on. - Rename functions while changing them to better reflect what they are doing to make the code easier to understand. - In the first version when a specific binary type handler was removed either through a write to the entry's file or all binary type handlers were removed by a write to the binfmt_misc mount's status file all cleanup work happened during inode eviction. That includes removal of the relevant entries from entry list. While that works fine I disliked that model after thinking about it for a bit. Because it means that there was a window were someone has already removed a or all binary handlers but they could still be safely reached from load_misc_binary() when it has managed to take the read_lock() on the entries list while inode eviction was already happening. Again, that perfectly benign but it's cleaner to remove the binary handler from the list immediately meaning that ones the write to then entry's file or the binfmt_misc status file returns the binary type cannot be executed anymore. That gives stronger guarantees to the user. commit 1c5976ef0f7ad76319df748ccb99a4c7ba2ba464 Author: Christian Brauner Date: Thu Oct 28 12:31:13 2021 +0200 binfmt_misc: cleanup on filesystem umount Currently, registering a new binary type pins the binfmt_misc filesystem. Specifically, this means that as long as there is at least one binary type registered the binfmt_misc filesystem survives all umounts, i.e. the superblock is not destroyed. Meaning that a umount followed by another mount will end up with the same superblock and the same binary type handlers. This is a behavior we tend to discourage for any new filesystems (apart from a few special filesystems such as e.g. configfs or debugfs). A umount operation without the filesystem being pinned - by e.g. someone holding a file descriptor to an open file - should usually result in the destruction of the superblock and all associated resources. This makes introspection easier and leads to clearly defined, simple and clean semantics. An administrator can rely on the fact that a umount will guarantee a clean slate making it possible to reinitialize a filesystem. Right now all binary types would need to be explicitly deleted before that can happen. This allows us to remove the heavy-handed calls to simple_pin_fs() and simple_release_fs() when creating and deleting binary types. This in turn allows us to replace the current brittle pinning mechanism abusing dget() which has caused a range of bugs judging from prior fixes in [2] and [3]. The additional dget() in load_misc_binary() pins the dentry but only does so for the sake to prevent ->evict_inode() from freeing the node when a user removes the binary type and kill_node() is run. Which would mean ->interpreter and ->interp_file would be freed causing a UAF. This isn't really nicely documented nor is it very clean because it relies on simple_pin_fs() pinning the filesystem as long as at least one binary type exists. Otherwise it would cause load_misc_binary() to hold on to a dentry belonging to a superblock that has been shutdown. Replace that implicit pinning with a clean and simple per-node refcount and get rid of the ugly dget() pinning. A similar mechanism exists for e.g. binderfs (cf. [4]). All the cleanup work can now be done in ->evict_inode(). In a follow-up patch we will make it possible to use binfmt_misc in sandboxes. We will use the cleaner semantics where a umount for the filesystem will cause the superblock and all resources to be deallocated. In preparation for this apply the same semantics to the initial binfmt_misc mount. Note, that this is a user-visible change and as such a uapi change but one that we can reasonably risk. We've discussed this in earlier versions of this patchset (cf. [1]). The main user and provider of binfmt_misc is systemd. Systemd provides binfmt_misc via autofs since it is configurable as a kernel module and is used by a few exotic packages and users. As such a binfmt_misc mount is triggered when /proc/sys/fs/binfmt_misc is accessed and is only provided on demand. Other autofs on demand filesystems include EFI ESP which systemd umounts if the mountpoint stays idle for a certain amount of time. This doesn't apply to the binfmt_misc autofs mount which isn't touched once it is mounted meaning this change can't accidently wipe binary type handlers without someone having explicitly unmounted binfmt_misc. After speaking to systemd folks they don't expect this change to affect them. In line with our general policy, if we see a regression for systemd or other users with this change we will switch back to the old behavior for the initial binfmt_misc mount and have binary types pin the filesystem again. But while we touch this code let's take the chance and let's improve on the status quo. [1]: https://lore.kernel.org/r/20191216091220.465626-2-laurent@vivier.eu [2]: commit 43a4f2619038 ("exec: binfmt_misc: fix race between load_misc_binary() and kill_node()" [3]: commit 83f918274e4b ("exec: binfmt_misc: shift filp_close(interp_file) from kill_node() to bm_evict_inode()") [4]: commit f0fe2c0f050d ("binder: prevent UAF for binderfs devices II") Link: https://lore.kernel.org/r/20211028103114.2849140-1-brauner@kernel.org (v1) Cc: Sargun Dhillon Cc: Serge Hallyn Cc: Jann Horn Cc: Henning Schild Cc: Andrei Vagin Cc: Al Viro Cc: Laurent Vivier Cc: linux-fsdevel@vger.kernel.org Acked-by: Serge Hallyn Signed-off-by: Christian Brauner Signed-off-by: Christian Brauner Signed-off-by: Kees Cook --- /* v2 */ - Christian Brauner : - Add more comments that explain what's going on. - Rename functions while changing them to better reflect what they are doing to make the code easier to understand. - In the first version when a specific binary type handler was removed either through a write to the entry's file or all binary type handlers were removed by a write to the binfmt_misc mount's status file all cleanup work happened during inode eviction. That includes removal of the relevant entries from entry list. While that works fine I disliked that model after thinking about it for a bit. Because it means that there was a window were someone has already removed a or all binary handlers but they could still be safely reached from load_misc_binary() when it has managed to take the read_lock() on the entries list while inode eviction was already happening. Again, that perfectly benign but it's cleaner to remove the binary handler from the list immediately meaning that ones the write to then entry's file or the binfmt_misc status file returns the binary type cannot be executed anymore. That gives stronger guarantees to the user. commit 108ffd12be24ba1d74b3314df8db32a0a6d55ba5 Author: Rafael J. Wysocki Date: Wed Oct 11 17:45:42 2023 +0200 thermal: trip: Drop lockdep assertion from thermal_zone_trip_id() The lockdep assertion in thermal_zone_trip_id() triggers when the trip point sysfs attribute of a thermal instance is read, because there is no thermal zone locking in that code path. This is not verly useful, though, because there is no mechanism by which the location of the trips[] table in a thermal zone or its size can change after binding cooling devices to the trips in that thermal zone and before those cooling devices are unbound from them. Thus it is not in fact necessary to hold the thermal zone lock when thermal_zone_trip_id() is called from trip_point_show() and so the lockdep asserion in the former is invalid. Accordingly, drop that lockdep assertion. Fixes: 2c7b4bfadef0 ("thermal: core: Store trip pointer in struct thermal_instance") Signed-off-by: Rafael J. Wysocki commit 73aa842baf877cc8c8da819f4ea927307dd8b6e4 Author: David Lechner Date: Thu Oct 5 19:50:33 2023 -0500 staging: iio: resolver: ad2s1210: remove fault attribute Faults have been converted to events and we are now polling the fault register each time we read a sample, so we no longer need the fault attribute. This attribute was not suitable for promotion out of staging anyway since it was returning multiple values in a single attribute. The fault clearing feature should not be needed unless we need to support the fault output pins on the chip which is not currently supported. So we can add this feature back in if we need it later. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-16-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit 40efeec7600949c2f6319c11d8a7f294a1c5e590 Author: David Lechner Date: Thu Oct 5 19:50:32 2023 -0500 staging: iio: resolver: ad2s1210: add label attribute support The ad2s1210 resolver driver has quite a few channels, mostly for internal signals for event support. This makes it difficult to know which channel is which. This patch adds a label attribute to the channels to make it easier to identify them. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-15-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit 1638b6d4f7c9515a6c26b2401ab3624fcef20916 Author: David Lechner Date: Thu Oct 5 19:50:31 2023 -0500 staging: iio: resolver: ad2s1210: add register/fault support summary The ad2s1210 driver shoe-horns the register and fault support into IIO events. The mapping between the registers/faults and the events is not obvious. To save users from having to read the entire driver to figure out how to use it, add a summary of the register/fault support to the top of the file. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-14-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit a5101e91e94d4f12e402fb4e8b46caa0213ea03a Author: David Lechner Date: Thu Oct 5 19:50:30 2023 -0500 staging: iio: resolver: ad2s1210: implement fault events When reading the position and velocity on the AD2S1210, there is also a 3rd byte following the two data bytes that contains the fault flag bits. This patch adds support for reading this byte and generating events when faults occur. The faults are mapped to various channels and event type in order to have a unique event for each fault. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-13-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit 5987279373446e97206a7078b2229446ba871ea0 Author: David Lechner Date: Thu Oct 5 19:50:29 2023 -0500 iio: event: add optional event label support This adds a new optional field to struct iio_info to allow drivers to specify a label for the event. This is useful for cases where there are many events or the event attribute name is not descriptive enough or where an event doesn't have any other attributes. The implementation is based on the existing label support for channels. So either all events of a device have a label attribute or none do. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-12-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit 86a333c59806bc170156209e9a52c6393d00c652 Author: David Lechner Date: Thu Oct 5 19:50:28 2023 -0500 staging: iio: resolver: ad2s1210: rename DOS reset min/max attrs The AD2S1210 has a programmable threshold for the degradation of signal (DOS) mismatch fault. This fault is triggered when the difference in amplitude between the sine and cosine inputs exceeds the threshold. The DOS reset min/max registers on the chip provide initial values for internal tracking of the min/max of the monitor signal after the fault register is cleared. This patch converts the custom device DOS reset min/max threshold attributes custom event attributes on the monitor signal channel. The attributes now use millivolts instead of the raw register value in accordance with the IIO ABI. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-11-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit e025cb2c684827ffde62f99dd7c911540136b347 Author: David Lechner Date: Thu Oct 5 19:50:27 2023 -0500 staging: iio: resolver: ad2s1210: convert DOS mismatch threshold to event attr The AD2S1210 has a programmable threshold for the degradation of signal (DOS) mismatch fault. This fault is triggered when the difference in voltage between the sine and cosine inputs exceeds the threshold. In other words, when the magnitude of sine and cosine inputs are equal, the AC component of the monitor signal is zero and when the magnitudes of the sine and cosine inputs are not equal, the AC component of the monitor signal is the difference between the sine and cosine inputs. So the fault occurs when the magnitude of the AC component of the monitor signal exceeds the DOS mismatch threshold voltage. This patch converts the custom device DOS mismatch threshold attribute to an event magnitude attribute on the monitor signal channel. The attribute now uses millivolts instead of the raw register value in accordance with the IIO ABI. Emitting the event will be implemented in a later patch. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-10-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit 6c5cc2b4a01e8e10d38bad17720ec55ae60a5299 Author: David Lechner Date: Thu Oct 5 19:50:26 2023 -0500 staging: iio: resolver: ad2s1210: convert DOS overrange threshold to event attr The AD2S1210 has a programmable threshold for the degradation of signal (DOS) overrange fault. This fault is triggered when either the sine or cosine input rises above the threshold voltage. This patch converts the custom device DOS overrange threshold attribute to an event rising edge threshold attribute on the monitor signal channel. The attribute now uses millivolts instead of the raw register value in accordance with the IIO ABI. Emitting the event will be implemented in a later patch. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-9-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit af8b284f23a600a86bb51a591d27e85d5f861b93 Author: David Lechner Date: Thu Oct 5 19:50:25 2023 -0500 staging: iio: resolver: ad2s1210: convert LOS threshold to event attr The AD2S1210 has a programmable threshold for the loss of signal (LOS) fault. This fault is triggered when either the sine or cosine input falls below the threshold voltage. This patch converts the custom device LOS threshold attribute to an event falling edge threshold attribute on a new monitor signal channel. The monitor signal is an internal signal that combines the amplitudes of the sine and cosine inputs as well as the current angle and position output. This signal is used to detect faults in the input signals. The attribute now uses millivolts instead of the raw register value in accordance with the IIO ABI. Emitting the event will be implemented in a later patch. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-8-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit 235e4b988046d29097523703bb5e5e3ba77259ca Author: David Lechner Date: Thu Oct 5 19:50:24 2023 -0500 staging: iio: resolver: ad2s1210: convert LOT threshold attrs to event attrs The AD2S1210 monitors the internal error signal (difference between estimated angle and measured angle) to determine a loss of position tracking (LOT) condition. When the error value exceeds a threshold, a fault is triggered. This threshold is user-configurable. This patch converts the custom lot_high_thrd and lot_low_thrd attributes in the ad2s1210 driver to standard event attributes. This will allow tooling to be able to expose these in a generic way. Since the low threshold determines the hysteresis, it requires some special handling to expose the difference between the high and low register values as the hysteresis instead of exposing the low register value directly. The attributes also return the values in radians now as required by the ABI. Actually emitting the fault event will be done in a later patch. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-7-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit 128b9389db0ed66ab0a108a1b439cabf2537032f Author: David Lechner Date: Thu Oct 5 19:50:23 2023 -0500 staging: iio: resolver: ad2s1210: add triggered buffer support This adds support for triggered buffers to the AD2S1210 resolver driver. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-6-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit b3335cd557fb886cd58ac6f9d0b283bbab120411 Author: David Lechner Date: Thu Oct 5 19:50:22 2023 -0500 staging: iio: resolver: ad2s1210: add phase lock range support The AD2S1210 chip has a phase lock range feature that allows selecting the allowable phase difference between the excitation output and the sine and cosine inputs. This can be set to either 44 degrees (default) or 360 degrees. This patch adds a new phase channel with a phase0_mag_rising event that can be used to configure the phase lock range. Actually emitting the event will be added in a subsequent patch. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-5-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit 3e7d173aef28d05a8db2941d78498f67746b27bc Author: David Lechner Date: Thu Oct 5 19:50:21 2023 -0500 staging: iio: resolver: ad2s1210: convert resolution to devicetree property Selecting the resolution was implemented as the `bits` sysfs attribute. However, the selection of the resolution depends on how the hardware is wired and the specific application, so this is rather a job for devicetree to describe. A new devicetree property `assigned-resolution-bits` to specify the resolution required for each chip is added and the `bits` sysfs attribute is removed. Since the resolution is now supplied by a devicetree property, the resolution-gpios are now optional and we can allow for the case where the resolution pins on the AD2S1210 are hard-wired instead of requiring them to be connected to gpios. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-4-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit 7dde2719fb3892ad69da4b1c5790bac5ea958a09 Author: David Lechner Date: Thu Oct 5 19:50:20 2023 -0500 staging: iio: resolver: ad2s1210: convert fexcit to channel attribute The ad2s1210 driver has a device-specific attribute `fexcit` for setting the frequency of the excitation output. This converts it to a channel in order to use standard IIO ABI. The excitation frequency is an analog output that generates a sine wave. Only the frequency is configurable. According to the datasheet, the specified range of the excitation frequency is from 2 kHz to 20 kHz and can be set in increments of 250 Hz. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-3-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit bae023765199bef243b49c0f8860a3290a5c9f6d Author: David Lechner Date: Thu Oct 5 19:50:19 2023 -0500 staging: iio: resolver: ad2s1210: implement hysteresis as channel attr The AD2S1210 resolver has a hysteresis feature that can be used to prevent flicker in the LSB of the position register. This can be either enabled or disabled. Disabling hysteresis is useful for increasing precision by oversampling. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-2-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit d97d11c70f25726fc21b2b2f1a26e16ac96a8ccf Author: David Lechner Date: Thu Oct 5 19:50:18 2023 -0500 staging: iio: resolver: ad2s1210: do not use fault register for dummy read When reading registers on the AD2S1210 chip, we have to supply a "dummy" address for the second SPI tx byte so that we don't accidentally write to a register. This register will be read and the value discarded on the next regmap read or write call. Reading the fault register has a side-effect of clearing the faults so we should not use this register for the dummy read. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20231005-ad2s1210-mainline-v4-1-ec00746840fc@baylibre.com Signed-off-by: Jonathan Cameron commit 6eb14ffa1873d756b9141837720ff70f07d849f1 Author: AngeloGioacchino Del Regno Date: Tue Oct 10 14:19:40 2023 +0200 iio: adc: mt6577_auxadc: Fix kernel panic on suspend Commit a2d518fbe376 ("iio: adc: mt6577_auxadc: Simplify with device managed function") simplified the driver with devm hooks, but wrongly states that the platform_set_drvdata(), platform_get_drvdata() are unused after the simplification: the driver data is infact used in .suspend() and .resume() PM callbacks, currently producing a kernel panic. Reintroduce the call to platform_set_drvdata() in the probe function Fixes: a2d518fbe376 ("iio: adc: mt6577_auxadc: Simplify with device managed function") Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Markus Schneider-Pargmann Reviewed-by: Alexandre Mergnat Link: https://lore.kernel.org/r/20231010121940.159696-1-angelogioacchino.delregno@collabora.com Signed-off-by: Jonathan Cameron commit db7fe1f610b39b398076f6c3fcb33378c4cb58ef Author: Alisa-Dariana Roman Date: Tue Oct 10 15:49:26 2023 +0300 iio: adc: ad7192: Add fast settling support Add fast settling mode support for AD7193. Add two new device specific attributes: oversampling_ratio and oversampling_ratio_available. For AD7193 the user can set the average factor by writing to oversampling_ratio. The possible values are exposed when reading oversampling_ratio_available. Signed-off-by: Alisa-Dariana Roman Link: https://lore.kernel.org/r/20231010124927.143343-4-alisadariana@gmail.com Signed-off-by: Jonathan Cameron commit 15f3b48799f7ebcc49b22211f0fcb58a16874474 Author: Alisa-Dariana Roman Date: Tue Oct 10 15:49:25 2023 +0300 iio: adc: ad7192: Remove unused member Remove extend_name from channel macro since it is not used anywhere. Signed-off-by: Alisa-Dariana Roman Link: https://lore.kernel.org/r/20231010124927.143343-3-alisadariana@gmail.com Signed-off-by: Jonathan Cameron commit 564cfb28409a265f272f0e7c73ce211827b36204 Author: Alisa-Dariana Roman Date: Tue Oct 10 15:49:24 2023 +0300 iio: adc: ad7192: Organize chip info Move all chip specific data into chip_info structure. Signed-off-by: Alisa-Dariana Roman Link: https://lore.kernel.org/r/20231010124927.143343-2-alisadariana@gmail.com Signed-off-by: Jonathan Cameron commit fca63709310267d942fa4991e65636ab42d51ed3 Author: Jonathan Cameron Date: Tue Oct 10 09:46:00 2023 +0100 Revert "dt-bindings: iio: magnetometer: asahi-kasei,ak8975: Drop deprecated enums" Reverted as Rob Herring is tracking undocumented compatibles and as per discussion in the thread, we can not remove this deprecated compatibles from the driver without potential/likely regressions. So keep it around as it's not that painful anyway. This reverts commit 711fb79a1ea8e79dc600f25d9f8c1ac25870b4de. Signed-off-by: Jonathan Cameron commit 4d7c16d08d248952c116f2eb9b7b5abc43a19688 Author: Luca Ceresoli Date: Wed Oct 4 18:39:28 2023 +0200 iio: accel: mxc4005: allow module autoloading via OF compatible Add OF device table with compatible strings to allow automatic module loading. Signed-off-by: Luca Ceresoli Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231004-mxc4005-device-tree-support-v1-2-e7c0faea72e4@bootlin.com Signed-off-by: Jonathan Cameron commit c8a489f820179fb12251e262b50303c29de991ac Author: Sean Young Date: Fri Oct 6 22:31:52 2023 +0100 media: lirc: drop trailing space from scancode transmit When transmitting, infrared drivers expect an odd number of samples; iow without a trailing space. No problems have been observed so far, so this is just belt and braces. Fixes: 9b6192589be7 ("media: lirc: implement scancode sending") Cc: stable@vger.kernel.org Signed-off-by: Sean Young Signed-off-by: Hans Verkuil commit 4f7efc71891462ab7606da7039f480d7c1584a13 Author: Sean Young Date: Fri Oct 6 12:54:25 2023 +0100 media: sharp: fix sharp encoding The Sharp protocol[1] encoding has incorrect timings for bit space. [1] https://www.sbprojects.net/knowledge/ir/sharp.php Fixes: d35afc5fe097 ("[media] rc: ir-sharp-decoder: Add encode capability") Cc: stable@vger.kernel.org Reported-by: Joe Ferner Closes: https://sourceforge.net/p/lirc/mailman/message/38604507/ Signed-off-by: Sean Young Signed-off-by: Hans Verkuil commit 545668480f7b89918f2406c36f9ae8813ac26887 Author: Hans Verkuil Date: Fri Oct 6 12:08:44 2023 +0200 staging: media: atomisp: improve unwinding This fixes two smatch warnings: drivers/staging/media/atomisp/pci/atomisp_cmd.c:2779 atomisp_cp_dvs_6axis_config() warn: missing unwind goto? drivers/staging/media/atomisp/pci/atomisp_cmd.c:2878 atomisp_cp_morph_table() warn: missing unwind goto? Signed-off-by: Hans Verkuil CC: Hans de Goede Reviewed-by: Hans de Goede commit f06acbe3398c4141939c6362301220d2fdfba805 Author: Hans Verkuil Date: Fri Oct 6 12:08:48 2023 +0200 media: i2c: tc358746: check fmt validity Check if the format was really found. Fixes smatch warning: drivers/media/i2c/tc358746.c:790 tc358746_set_fmt() error: 'fmt' dereferencing possible ERR_PTR() Signed-off-by: Hans Verkuil CC: Sakari Ailus Reviewed-by: Sakari Ailus commit 6ccfe1e3971283fb5da0fef8c202f9998a5540fb Author: Hans Verkuil Date: Fri Oct 6 12:08:42 2023 +0200 staging: media: atomisp: drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Also fixes a smatch warning: drivers/staging/media/atomisp/i2c/atomisp-gc0310.c:446 gc0310_s_stream() warn: missing error code 'ret' Signed-off-by: Hans Verkuil CC: Hans de Goede Reviewed-by: Hans de Goede commit c99626092efca3061b387043d4a7399bf75fbdd5 Author: Dan Carpenter Date: Sat Oct 7 11:59:39 2023 +0300 thermal: core: prevent potential string overflow The dev->id value comes from ida_alloc() so it's a number between zero and INT_MAX. If it's too high then these sprintf()s will overflow. Fixes: 203d3d4aa482 ("the generic thermal sysfs driver") Signed-off-by: Dan Carpenter Signed-off-by: Rafael J. Wysocki commit e17ea8a1b1707f11df900adbd0764880aea2b1e1 Author: Lukasz Luba Date: Fri Oct 6 14:54:34 2023 +0100 thermal: Add myself as thermal reviewer in MAINTAINERS Become designated reviewer and help thermal subsystem in development process. Signed-off-by: Lukasz Luba Signed-off-by: Rafael J. Wysocki commit b0e82ae3bf41fd45cca5ed4ef492d8af339f87be Author: Rafael J. Wysocki Date: Sat Oct 7 13:36:27 2023 +0200 thermal: Remove Amit Kucheria from MAINTAINERS Amit Kucheria has not been participating in kernel development in any way or form for quite some time, so it is not useful to list him as a designated reviewer for the thermal subsystem or as the thermal zone DT binding maintainer. Remove him from the THERMAL entry in MAINTAINERS and list Daniel Lezcano as the new thermal zone DT binding maintainer. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano Acked-by: Krzysztof Kozlowski Acked-by: Amit Kucheria commit cefe8ce559b5ff301f59b44f97c5c313ec30c643 Author: Dan Carpenter Date: Thu Sep 28 10:06:11 2023 +0300 locktorture: Check the correct variable for allocation failure There is a typo so this checks the wrong variable. "chains" plural vs "chain" singular. We already know that "chains" is non-zero. Fixes: 7f993623e9eb ("locktorture: Add call_rcu_chains module parameter") Signed-off-by: Dan Carpenter Reviewed-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 29fda1ad2a64a62e1c51d61207396e2de1c67362 Author: Petr Mladek Date: Fri Oct 6 10:21:51 2023 +0200 printk: Reduce pr_flush() pooling time pr_flush() does not guarantee that all messages would really get flushed to the console. The best it could do is to wait with a given timeout.[*] The current interval 100ms for checking the progress might seem too long in some situations. For example, such delays are not appreciated during suspend and resume especially when the consoles have been flushed "long" time before the check. On the other hand, the sleeping wait might be useful in other situations. Especially, it would allow flushing the messages using printk kthreads on the same CPU[*]. Use msleep(1) as a compromise. Also measure the time using jiffies. msleep() does not guarantee precise wakeup after the given delay. It might be much longer, especially for times < 20s. See Documentation/timers/timers-howto.rst for more details. Note that msecs_to_jiffies() already translates a negative value into an infinite timeout. [*] console_unlock() does not guarantee flushing the consoles since the commit dbdda842fe96f893 ("printk: Add console owner and waiter logic to load balance console writes"). It would be possible to guarantee it another way. For example, the spinning might be enabled only when the console_lock has been taken via console_trylock(). But the load balancing is helpful. And more importantly, the flush with a timeout has been added as a preparation step for introducing printk kthreads. Signed-off-by: Petr Mladek Reviewed-by: John Ogness Link: https://lore.kernel.org/r/20231006082151.6969-3-pmladek@suse.com commit 91939636cac4585e5c99a15c8b9023e0dcabb4e5 Author: Benjamin Tissoires Date: Thu Oct 5 17:55:34 2023 +0200 selftests/hid: force using our compiled libbpf headers Turns out that we were relying on the globally installed headers, not the ones we freshly compiled. Add a manual include in CFLAGS to sort this out. Tested-by: Nick Desaulniers # Build Tested-by: Justin Stitt Link: https://lore.kernel.org/r/20230825-wip-selftests-v3-3-639963c54109@kernel.org Signed-off-by: Benjamin Tissoires commit 89d024a7ba02b6b969f89ac057442b5d3bcb4272 Author: Benjamin Tissoires Date: Thu Oct 5 17:55:33 2023 +0200 selftests/hid: do not manually call headers_install "make headers" is a requirement before calling make on the selftests dir, so we should not have to manually install those headers Acked-by: Shuah Khan Tested-by: Nick Desaulniers # Build Tested-by: Justin Stitt Link: https://lore.kernel.org/r/20230825-wip-selftests-v3-2-639963c54109@kernel.org Signed-off-by: Benjamin Tissoires commit ae7487d112cf9f310d32f27d5956f53d9f143fea Author: Benjamin Tissoires Date: Thu Oct 5 17:55:32 2023 +0200 selftests/hid: ensure we can compile the tests on kernels pre-6.3 For the hid-bpf tests to compile, we need to have the definition of struct hid_bpf_ctx. This definition is an internal one from the kernel and it is supposed to be defined in the generated vmlinux.h. This vmlinux.h header is generated based on the currently running kernel or if the kernel was already compiled in the tree. If you just compile the selftests without compiling the kernel beforehand and you are running on a 6.2 kernel, you'll end up with a vmlinux.h without the hid_bpf_ctx definition. Use the clever trick from tools/testing/selftests/bpf/progs/bpf_iter.h to force the definition of that symbol in case we don't find it in the BTF and also add __attribute__((preserve_access_index)) to further support CO-RE functionality for these tests. Signed-off-by: Justin Stitt Tested-by: Nick Desaulniers # Build Tested-by: Justin Stitt Link: https://lore.kernel.org/r/20230825-wip-selftests-v3-1-639963c54109@kernel.org Signed-off-by: Benjamin Tissoires commit 906cdb2b5fa12f00cf929b2c19010cf3e4421966 Author: Jani Nikula Date: Tue Sep 26 15:19:04 2023 +0300 drm/i915/gvt: move structs intel_gvt_irq_info and intel_gvt_irq_map to interrupt.c Structs intel_gvt_irq_info and intel_gvt_irq_map are not used outside of interrupt.c. Hide them, and reduce includes. Signed-off-by: Jani Nikula Reviewed-by: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20230926121904.499888-4-jani.nikula@intel.com commit 21c828a0c766af4b37b7d50ae1ff9509d6d9dd15 Author: Jani Nikula Date: Tue Sep 26 15:19:03 2023 +0300 drm/i915/gvt: move struct engine_mmio to mmio_context.c struct engine_mmio is not used outside of mmio_context.c. Hide it, and reduce includes. Signed-off-by: Jani Nikula Reviewed-by: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20230926121904.499888-3-jani.nikula@intel.com commit 80cf8f18c634c392c7f2503381f648481128a2bd Author: Jani Nikula Date: Tue Sep 26 15:19:02 2023 +0300 drm/i915/gvt: don't include gvt.h from intel_gvt_mmio_table.h intel_gvt_mmio_table.c has no need to include the massive gvt.h. Simplify. Signed-off-by: Jani Nikula Reviewed-by: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20230926121904.499888-2-jani.nikula@intel.com commit 9e92a6d1ba56fad5f5a9876af43b5888034a5e5e Author: Jani Nikula Date: Tue Sep 26 15:19:01 2023 +0300 drm/i915/gvt: remove unused to_gvt() and reduce includes gvt.h has no need to include i915_drv.h once the unused to_gvt() has been removed. Signed-off-by: Jani Nikula Reviewed-by: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20230926121904.499888-1-jani.nikula@intel.com commit 2b8b2948c6cbb3de3db5587b0777bb5740662790 Author: Vinod Govindapillai Date: Sun Oct 1 14:31:55 2023 +0300 drm/i915/xe2lpd: update the scaler feature capability Update the number of scalers per pipe based on the display capabilities reported. v1: define the field values instead of the magic number (JaniN) Bspec: 71161 Signed-off-by: Vinod Govindapillai Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20231001113155.80659-4-vinod.govindapillai@intel.com Signed-off-by: Jouni Högander commit 6d181a288e64f606e501f6f04f382edfbe4b1cd8 Author: Vinod Govindapillai Date: Sun Oct 1 14:31:54 2023 +0300 drm/i915/xe2lpd: update the dsc feature capability Update the global dsc flag based on the display capabilities reported. v1: define the field values instead of the magic number (JaniN) Bspec: 71161 Signed-off-by: Vinod Govindapillai Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20231001113155.80659-3-vinod.govindapillai@intel.com Signed-off-by: Jouni Högander commit 9a3acd8c77cdfbed6debf38c1abeea06d9113173 Author: Vinod Govindapillai Date: Sun Oct 1 14:31:53 2023 +0300 drm/i915/xe2lpd: display capability register definitions Register definitions to track the reported scalable display feature configurations Bspec: 71161 Signed-off-by: Vinod Govindapillai Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20231001113155.80659-2-vinod.govindapillai@intel.com Signed-off-by: Jouni Högander commit ff5f9ae9812c7988049e0ce3c532493994e4b1f5 Author: Dmitry Baryshkov Date: Mon Oct 9 20:40:48 2023 +0300 drm/bridge_connector: implement oob_hotplug_event Implement the oob_hotplug_event() callback. Translate it to the HPD notification sent to the HPD bridge in the chain. Reviewed-by: Janne Grunau Link: https://lore.kernel.org/r/20231009174048.2695981-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Link: https://patchwork.freedesktop.org/patch/msgid/20231009174048.2695981-4-dmitry.baryshkov@linaro.org commit 6ec2cf814210fc2df0a59beac895775b6a04d74d Author: Dmitry Baryshkov Date: Mon Oct 9 20:40:47 2023 +0300 drm/bridge_connector: stop filtering events in drm_bridge_connector_hpd_cb() In some cases the bridge drivers would like to receive hotplug events even in the case new status is equal to the old status. In the DP case this is used to deliver "attention" messages to the DP host. Stop filtering the events in the drm_bridge_connector_hpd_cb() and let drivers decide whether they would like to receive the event or not. Reviewed-by: Janne Grunau Link: https://lore.kernel.org/r/20231009174048.2695981-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Link: https://patchwork.freedesktop.org/patch/msgid/20231009174048.2695981-3-dmitry.baryshkov@linaro.org commit fc93835bb0d7e2c3e0a664a66d40da3c9f6ed053 Author: Bjorn Andersson Date: Mon Oct 9 20:40:46 2023 +0300 drm: Add HPD state to drm_connector_oob_hotplug_event() In some implementations, such as the Qualcomm platforms, the display driver has no way to query the current HPD state and as such it's impossible to distinguish between disconnect and attention events. Add a parameter to drm_connector_oob_hotplug_event() to pass the HPD state. Also push the test for unchanged state in the displayport altmode driver into the i915 driver, to allow other drivers to act upon each update. Signed-off-by: Bjorn Andersson Reviewed-by: Hans de Goede Acked-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231009174048.2695981-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Link: https://patchwork.freedesktop.org/patch/msgid/20231009174048.2695981-2-dmitry.baryshkov@linaro.org commit d7f546c751e8c873302331af6a203ee61f894e9d Author: Sunil V L Date: Wed Sep 27 22:30:15 2023 +0530 clocksource/timer-riscv: ACPI: Add timer_cannot_wakeup_cpu The timer capability to wakeup the cpu irrespective of its idle state is provided by the flag in RHCT. Update the timer code to set this flag. Signed-off-by: Sunil V L Reviewed-by: Conor Dooley Reviewed-by: Andrew Jones Reviewed-by: Samuel Holland Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230927170015.295232-5-sunilvl@ventanamicro.com commit fd73c011a123a66d88998f356c920d33d87524cf Author: Yang Li Date: Thu Aug 31 12:14:14 2023 +0800 clocksource/drivers/sun5i: Remove surplus dev_err() when using platform_get_irq() 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. ./drivers/clocksource/timer-sun5i.c:260:2-9: line 260 is redundant because platform_get_irq() already prints an error Signed-off-by: Yang Li Acked-by: Jernej Skrabec Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230831041414.66434-1-yang.lee@linux.alibaba.com commit 55ce2c37cfb969b7d8bf4a1a5c7956ffada0cae8 Author: Chaitanya Kumar Borah Date: Tue Oct 3 12:22:11 2023 +0530 drm/i915: Add wrapper for getting display step Add a wrapper around intel_step_name that takes in driver data as an argument. This wrapper will help maintain compatibility with the proposed xe driver. Signed-off-by: Chaitanya Kumar Borah Signed-off-by: Animesh Manna Reviewed-by: Uma Shankar Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20231003065211.1052385-1-chaitanya.kumar.borah@intel.com commit bbb63db3b0ecb200b33bf172ffb93ef0e4472cee Merge: 5247dbf16cee4 4688ecb1385f9 Author: David S. Miller Date: Wed Oct 11 10:39:01 2023 +0100 Merge branch 'skb_segment-testing' Willem de Bruijn says: ==================== add skb_segment kunit coverage As discussed at netconf last week. Some kernel code is exercised in many different ways. skb_segment is a prime example. This ~350 line function has 49 different patches in git blame with 28 different authors. When making a change, e.g., to fix a bug in one specific use case, it is hard to establish through analysis alone that the change does not break the many other paths through the code. It is impractical to exercise all code paths through regression testing from userspace. Add the minimal infrastructure needed to add KUnit tests to networking, and add code coverage for this function. Patch 1 adds the infra and the first simple test case: a linear skb Patch 2 adds variants with frags[] Patch 3 adds variants with frag_list skbs ==================== Signed-off-by: David S. Miller commit 4688ecb1385f95d3a687286304710723260ad125 Author: Willem de Bruijn Date: Mon Oct 9 10:41:53 2023 -0400 net: expand skb_segment unit test with frag_list coverage Expand the test with these variants that use skb frag_list: - GSO_TEST_FRAG_LIST: frag_skb length is gso_size - GSO_TEST_FRAG_LIST_PURE: same, data exclusively in frag skbs - GSO_TEST_FRAG_LIST_NON_UNIFORM: frag_skb length may vary - GSO_TEST_GSO_BY_FRAGS: frag_skb length defines gso_size, i.e., segs may have varying sizes. Signed-off-by: Willem de Bruijn Reviewed-by: Florian Westphal Signed-off-by: David S. Miller commit 1b4fa28a8b07eb331aeb7fbfc806c0d2e3dc3627 Author: Willem de Bruijn Date: Mon Oct 9 10:41:52 2023 -0400 net: parametrize skb_segment unit test to expand coverage Expand the test with variants - GSO_TEST_NO_GSO: payload size less than or equal to gso_size - GSO_TEST_FRAGS: payload in both linear and page frags - GSO_TEST_FRAGS_PURE: payload exclusively in page frags - GSO_TEST_GSO_PARTIAL: produce one gso segment of multiple of gso_size, plus optionally one non-gso trailer segment Define a test struct that encodes the input gso skb and output segs. Input in terms of linear and fragment lengths. Output as length of each segment. Signed-off-by: Willem de Bruijn Reviewed-by: Florian Westphal Signed-off-by: David S. Miller commit b3098d32ed6e6f4c03a95f14426143f1b0af620f Author: Willem de Bruijn Date: Mon Oct 9 10:41:51 2023 -0400 net: add skb_segment kunit test Add unit testing for skb segment. This function is exercised by many different code paths, such as GSO_PARTIAL or GSO_BY_FRAGS, linear (with or without head_frag), frags or frag_list skbs, etc. It is infeasible to manually run tests that cover all code paths when making changes. The long and complex function also makes it hard to establish through analysis alone that a patch has no unintended side-effects. Add code coverage through kunit regression testing. Introduce kunit infrastructure for tests under net/core, and add this first test. This first skb_segment test exercises a simple case: a linear skb. Follow-on patches will parametrize the test and add more variants. Tested: Built and ran the test with make ARCH=um mrproper ./tools/testing/kunit/kunit.py run \ --kconfig_add CONFIG_NET=y \ --kconfig_add CONFIG_DEBUG_KERNEL=y \ --kconfig_add CONFIG_DEBUG_INFO=y \ --kconfig_add=CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y \ net_core_gso Signed-off-by: Willem de Bruijn Reviewed-by: Florian Westphal Signed-off-by: David S. Miller commit 1034cc423f1b4a7a9a56d310ca980fcd2753e11d Author: Wentong Wu Date: Mon Oct 9 14:33:25 2023 +0800 gpio: update Intel LJCA USB GPIO driver This driver communicate with LJCA GPIO module with specific protocol through interfaces exported by LJCA USB driver. Update the driver according to LJCA USB driver's changes. Signed-off-by: Wentong Wu Reviewed-by: Sakari Ailus Acked-by: Linus Walleij Acked-by: Bartosz Golaszewski Tested-by: Hans de Goede Link: https://lore.kernel.org/r/1696833205-16716-5-git-send-email-wentong.wu@intel.com Signed-off-by: Greg Kroah-Hartman commit caee8e38da67a8991a60f1f67e6820a0063278c4 Author: Wentong Wu Date: Mon Oct 9 14:33:24 2023 +0800 spi: Add support for Intel LJCA USB SPI driver Implements the SPI function of Intel USB-I2C/GPIO/SPI adapter device named "La Jolla Cove Adapter" (LJCA). It communicate with LJCA SPI module with specific protocol through interfaces exported by LJCA USB driver. Signed-off-by: Wentong Wu Reviewed-by: Sakari Ailus Reviewed-by: Andi Shyti Tested-by: Hans de Goede Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/1696833205-16716-4-git-send-email-wentong.wu@intel.com Signed-off-by: Greg Kroah-Hartman commit bfd3824c88081f9b2101d68376f14779ce26691f Author: Wentong Wu Date: Mon Oct 9 14:33:23 2023 +0800 i2c: Add support for Intel LJCA USB I2C driver Implements the I2C function of Intel USB-I2C/GPIO/SPI adapter device named "La Jolla Cove Adapter" (LJCA). It communicate with LJCA I2C module with specific protocol through interfaces exported by LJCA USB driver. Signed-off-by: Wentong Wu Reviewed-by: Sakari Ailus Reviewed-by: Andi Shyti Tested-by: Hans de Goede Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/1696833205-16716-3-git-send-email-wentong.wu@intel.com Signed-off-by: Greg Kroah-Hartman commit acd6199f195d6de814ac4090ce0864a613b1580e Author: Wentong Wu Date: Mon Oct 9 14:33:22 2023 +0800 usb: Add support for Intel LJCA device Implements the USB part of Intel USB-I2C/GPIO/SPI adapter device named "La Jolla Cove Adapter" (LJCA). The communication between the various LJCA module drivers and the hardware will be muxed/demuxed by this driver. Three modules ( I2C, GPIO, and SPI) are supported currently. Each sub-module of LJCA device is identified by type field within the LJCA message header. The sub-modules of LJCA can use ljca_transfer() to issue a transfer between host and hardware. And ljca_register_event_cb is exported to LJCA sub-module drivers for hardware event subscription. The minimum code in ASL that covers this board is Scope (\_SB.PCI0.DWC3.RHUB.HS01) { Device (GPIO) { Name (_ADR, Zero) Name (_STA, 0x0F) } Device (I2C) { Name (_ADR, One) Name (_STA, 0x0F) } Device (SPI) { Name (_ADR, 0x02) Name (_STA, 0x0F) } } Signed-off-by: Wentong Wu Reviewed-by: Sakari Ailus Reviewed-by: Andi Shyti Tested-by: Hans de Goede Reviewed-by: Oliver Neukum Link: https://lore.kernel.org/r/1696833205-16716-2-git-send-email-wentong.wu@intel.com Signed-off-by: Greg Kroah-Hartman commit 62d19b35808816dc2bdf5031e5401230f6a915ba Author: Gustavo A. R. Silva Date: Mon Oct 9 15:42:04 2023 -0600 wifi: brcmfmac: fweh: Add __counted_by for struct brcmf_fweh_queue_item and use struct_size() Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). Also, relocate `event->datalen = datalen;` to before calling `memcpy(event->data, data, datalen);`, so that the __counted_by annotation has effect, and flex-array member `data` can be properly bounds-checked at run-time. While there, use struct_size() helper, instead of the open-coded version, to calculate the size for the allocation of the whole flexible structure, including of course, the flexible-array member. This code was found with the help of Coccinelle, and audited and fixed manually. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Acked-by: Arend van Spriel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/ZSRzrIe0345eymk2@work commit 5cf47dc14158f979ee9485fc15e004c0d6952ea7 Author: Gustavo A. R. Silva Date: Mon Oct 9 13:41:18 2023 -0600 wifi: hostap: Add __counted_by for struct prism2_download_data and use struct_size() Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). While there, use struct_size() helper, instead of the open-coded version, to calculate the size for the allocation of the whole flexible structure, including of course, the flexible-array member. This code was found with the help of Coccinelle, and audited and fixed manually. Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/ZSRXXvWMMkm7qqRW@work commit de8dd096949820ce5656d41ce409a67603e79327 Author: Jinjie Ruan Date: Sun Oct 8 10:58:52 2023 +0800 wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb() Both usb_kill_urb() and usb_free_urb() do the NULL check itself, so there is no need to duplicate it prior to calling. Fixes: a82dfd33d123 ("wifi: rtw88: Add common USB chip support") Signed-off-by: Jinjie Ruan Acked-by: Sascha Hauer Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231008025852.1239450-1-ruanjinjie@huawei.com commit 5247dbf16cee4e83eb89e4d3b87bd5e79c5d1655 Author: Yajun Deng Date: Mon Oct 9 19:16:33 2023 +0800 net/core: Introduce netdev_core_stats_inc() Although there is a kfree_skb_reason() helper function that can be used to find the reason why this skb is dropped, but most callers didn't increase one of rx_dropped, tx_dropped, rx_nohandler and rx_otherhost_dropped. For the users, people are more concerned about why the dropped in ip is increasing. Introduce netdev_core_stats_inc() for trace the caller of dev_core_stats_*_inc(). Also, add __code to netdev_core_stats_alloc(), as it's called with small probability. And add noinline make sure netdev_core_stats_inc was never inlined. Signed-off-by: Yajun Deng Suggested-by: Alexander Lobakin Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 0c2d3ff8c4f350da8238b7d453694fe73e9720d6 Merge: 9bae5b0550221 63b9f7a19ff15 Author: David S. Miller Date: Wed Oct 11 10:06:05 2023 +0100 Merge branch 'dsa-validate-remove' Russell King says: ==================== net: dsa: remove validate method These three patches remove DSA's phylink .validate method which becomes unnecessary once the last two drivers provide phylink capabilities, which this patch set adds. Both of these are best guesses. ==================== Signed-off-by: David S. Miller commit 63b9f7a19ff154778cef85cf9a28f31c4a77e847 Author: Russell King (Oracle) Date: Mon Oct 9 11:39:55 2023 +0100 net: dsa: remove dsa_port_phylink_validate() As all drivers now provide phylink capabilities (including MAC), the if() condition in dsa_port_phylink_validate() will always be true. We will always use the generic validator, which phylink will call itself if the .validate method isn't populated. Thus, there is now no need to implement the .validate method, so this implementation can be removed. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit db2c6d5fc4bddd15a98cc7964cec0af7a51160c0 Author: Russell King (Oracle) Date: Mon Oct 9 11:39:50 2023 +0100 net: dsa: dsa_loop: add phylink capabilities Add phylink capabilities for dsa_loop, which I believe being a software construct means that it supports essentially all interface types and all speeds. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit a026809c261b7240a243ae1c2a7dccec3c316761 Author: Russell King (Oracle) Date: Mon Oct 9 11:39:45 2023 +0100 net: dsa: vsc73xx: add phylink capabilities Add phylink capabilities for vsc73xx. Although this switch driver does populates the .adjust_link method, dsa_slave_phy_setup() will still be used to create phylink instances for the LAN ports, although phylink won't be used for shared links. There are two different classes of switch - 5+1 and 8 port. The 5+1 port switches uses port indicies 0-4 for the user interfaces and 6 for the CPU port. The 8 port is confusing - some comments in the driver imply that port index 7 is used, but the driver actually still uses 6, so that is what we go with. Also, there appear to be no DTs in the kernel tree that are using the 8 port variety. It also looks like port 5 is always skipped. The switch supports 10M, 100M and 1G speeds. It is not clear whether all these speeds are supported on the CPU interface. It also looks like symmetric pause is supported, whether asymmetric pause is as well is unclear. However, it looks like the pause configuration is entirely static, and doesn't depend on negotiation results. So, let's do the best effort we can based on the information found in the driver when creating vsc73xx_phylink_get_caps(). Signed-off-by: Russell King (Oracle) Reviewed-by: Linus Walleij Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 0e7ad4bba2965f777b5fd618734642eb5a19ddcc Author: Rob Herring Date: Fri Oct 6 16:44:42 2023 -0500 ata: imx: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Niklas Cassel Signed-off-by: Damien Le Moal commit 0ecbef3125510002f521e950a38d95f49e772f00 Author: Rob Herring Date: Fri Oct 6 16:44:33 2023 -0500 ata: xgene: Use of_device_get_match_data() Use preferred of_device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Niklas Cassel Signed-off-by: Damien Le Moal commit 2267d5a146c8fe7fcad812aed93b44d4ae148789 Author: Ma Ke Date: Tue Oct 10 20:29:16 2023 +0800 ata: sata_mv: aspeed: fix value check in mv_platform_probe() In mv_platform_probe(), check the return value of clk_prepare_enable() and return the error code if clk_prepare_enable() returns an unexpected value. Signed-off-by: Ma Ke Reviewed-by: Niklas Cassel Signed-off-by: Damien Le Moal commit 9bae5b05502210f7fb5ac24874ec2e0747401b6b Author: Sonia Sharma Date: Mon Oct 9 01:00:16 2023 -0700 hv_netvsc: fix netvsc_send_completion to avoid multiple message length checks The switch statement in netvsc_send_completion() is incorrectly validating the length of incoming network packets by falling through to the next case. Avoid the fallthrough. Instead break after a case match and then process the complete() call. The current code has not caused any known failures. But nonetheless, the code should be corrected as a different ordering of the switch cases might cause a length check to fail when it should not. Signed-off-by: Sonia Sharma Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit d6f274b7c8ac52abc81e898b62c3ff63fbeb11b8 Author: Alexander Shishkin Date: Tue Oct 10 17:52:20 2023 +0300 x86/sev: Drop unneeded #include Commit: 20f07a044a76 ("x86/sev: Move common memory encryption code to mem_encrypt.c") ... forgot to remove the include of virtio_config.h from mem_encrypt_amd.c when it moved the related code to mem_encrypt.c (from where this include subsequently got removed by a later commit). Remove it now. Signed-off-by: Alexander Shishkin Signed-off-by: Ingo Molnar Reviewed-by: Tom Lendacky Link: https://lore.kernel.org/r/20231010145220.3960055-3-alexander.shishkin@linux.intel.com commit 6e74b125155dc8c747d76fb45d8e6d20e9e4fb4d Author: Alexander Shishkin Date: Tue Oct 10 17:52:19 2023 +0300 x86/sev: Move sev_setup_arch() to mem_encrypt.c Since commit: 4d96f9109109b ("x86/sev: Replace occurrences of sev_active() with cc_platform_has()") ... the SWIOTLB bounce buffer size adjustment and restricted virtio memory setting also inadvertently apply to TDX: the code is using cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT) as a gatekeeping condition, which is also true for TDX, and this is also what we want. To reflect this, move the corresponding code to generic mem_encrypt.c. No functional changes intended. Signed-off-by: Alexander Shishkin Signed-off-by: Ingo Molnar Reviewed-by: Tom Lendacky Link: https://lore.kernel.org/r/20231010145220.3960055-2-alexander.shishkin@linux.intel.com commit 12590d4d0e331d3cb9e6b3494515cd61c8a6624e Author: Ivaylo Dimitrov Date: Tue Oct 3 08:50:20 2023 +0300 drivers/clocksource/timer-ti-dm: Don't call clk_get_rate() in stop function clk_get_rate() might sleep, and that prevents dm-timer based PWM from being used from atomic context. Fix that by getting fclk rate in probe() and using a notifier in case rate changes. Fixes: af04aa856e93 ("ARM: OMAP: Move dmtimer driver out of plat-omap to drivers under clocksource") Signed-off-by: Ivaylo Dimitrov Reviewed-by: Tony Lindgren Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/1696312220-11550-1-git-send-email-ivo.g.dimitrov.75@gmail.com commit 8051a993ce222a5158bccc6ac22ace9253dd71cb Author: Jacky Bai Date: Mon Oct 9 16:39:22 2023 +0800 clocksource/drivers/timer-imx-gpt: Fix potential memory leak Fix coverity Issue CID 250382: Resource leak (RESOURCE_LEAK). Add kfree when error return. Signed-off-by: Jacky Bai Reviewed-by: Peng Fan Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20231009083922.1942971-1-ping.bai@nxp.com commit 57390019b68b83f96eb98f490367b9df1f2d77cb Merge: e5f9d543419c7 389af786f92ec Author: Thomas Zimmermann Date: Wed Oct 11 09:50:59 2023 +0200 Merge drm/drm-next into drm-misc-next Updating drm-misc-next to the state of Linux v6.6-rc2. Signed-off-by: Thomas Zimmermann commit f05fd4ce99635975caa3e6a0eeb02118637f72a3 Author: Maciej Wieczor-Retman Date: Wed Oct 11 08:48:42 2023 +0200 x86/resctrl: Fix remaining kernel-doc warnings The kernel test robot reported kernel-doc warnings here: arch/x86/kernel/cpu/resctrl/rdtgroup.c:915: warning: Function parameter or member 'of' not described in 'rdt_bit_usage_show' arch/x86/kernel/cpu/resctrl/rdtgroup.c:915: warning: Function parameter or member 'seq' not described in 'rdt_bit_usage_show' arch/x86/kernel/cpu/resctrl/rdtgroup.c:915: warning: Function parameter or member 'v' not described in 'rdt_bit_usage_show' arch/x86/kernel/cpu/resctrl/rdtgroup.c:1144: warning: Function parameter or member 'type' not described in '__rdtgroup_cbm_overlaps' arch/x86/kernel/cpu/resctrl/rdtgroup.c:1224: warning: Function parameter or member 'rdtgrp' not described in 'rdtgroup_mode_test_exclusive' arch/x86/kernel/cpu/resctrl/rdtgroup.c:1261: warning: Function parameter or member 'of' not described in 'rdtgroup_mode_write' arch/x86/kernel/cpu/resctrl/rdtgroup.c:1261: warning: Function parameter or member 'buf' not described in 'rdtgroup_mode_write' arch/x86/kernel/cpu/resctrl/rdtgroup.c:1261: warning: Function parameter or member 'nbytes' not described in 'rdtgroup_mode_write' arch/x86/kernel/cpu/resctrl/rdtgroup.c:1261: warning: Function parameter or member 'off' not described in 'rdtgroup_mode_write' arch/x86/kernel/cpu/resctrl/rdtgroup.c:1370: warning: Function parameter or member 'of' not described in 'rdtgroup_size_show' arch/x86/kernel/cpu/resctrl/rdtgroup.c:1370: warning: Function parameter or member 's' not described in 'rdtgroup_size_show' arch/x86/kernel/cpu/resctrl/rdtgroup.c:1370: warning: Function parameter or member 'v' not described in 'rdtgroup_size_show' The first two functions are missing an argument description while the other three are file callbacks and don't require a kernel-doc comment. Closes: https://lore.kernel.org/oe-kbuild-all/202310070434.mD8eRNAz-lkp@intel.com/ Reported-by: kernel test robot Signed-off-by: Maciej Wieczor-Retman Signed-off-by: Ingo Molnar Cc: Peter Newman Cc: Borislav Petkov Cc: Reinette Chatre Link: https://lore.kernel.org/r/20231011064843.246592-1-maciej.wieczor-retman@intel.com commit 078a5babf2bc92eba04b8f9162e5fea7afc2749e Author: Biju Das Date: Thu Jul 27 09:18:46 2023 +0100 dt-bindings: timer: renesas,rz-mtu3: Document RZ/{G2UL,Five} SoCs Add MTU3a binding documentation for Renesas RZ/{G2UL,Five} SoCs. MTU3a block is identical to one found on RZ/G2L, so no driver changes are required. The fallback compatible string "renesas,rz-mtu3" will be used on RZ/{G2UL,Five}. Signed-off-by: Biju Das Acked-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230727081848.100834-4-biju.das.jz@bp.renesas.com commit b121e7881b8975cf8dc24d9bd71a5af81ed8a6b1 Author: Biju Das Date: Thu Jul 27 09:18:45 2023 +0100 dt-bindings: timer: renesas,rz-mtu3: Improve documentation Fix the documentation issues pointed by Pavel while backporting it to 6.1.y-cip. - Replace '32- bit'->'32-bit' - Consistently remove '.' at the end of line for the specifications - Replace ' (excluding MTU8)'-> '(excluding MTU8)' Reported-by: Pavel Machek Closes: https://lore.kernel.org/all/ZH79%2FUjgYg+0Ruiu@duo.ucw.cz Signed-off-by: Biju Das Acked-by: Conor Dooley Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230727081848.100834-3-biju.das.jz@bp.renesas.com commit b7a8f1f7a8a25e09aaefebb6251a77f44cda638b Author: Biju Das Date: Thu Jul 27 09:18:44 2023 +0100 dt-bindings: timer: renesas,rz-mtu3: Fix overflow/underflow interrupt names As per R01UH0914EJ0130 Rev.1.30 HW manual the MTU3 overflow/underflow interrupt names starts with 'tci' instead of 'tgi'. Fix this documentation issue by replacing below overflow/underflow interrupt names: - tgiv0->tciv0 - tgiv1->tciv1 - tgiu1->tciu1 - tgiv2->tciv2 - tgiu2->tciu2 - tgiv3->tciv3 - tgiv4->tciv4 - tgiv6->tciv6 - tgiv7->tciv7 - tgiv8->tciv8 - tgiu8->tciu8 Fixes: 0a9d6b54297e ("dt-bindings: timer: Document RZ/G2L MTU3a bindings") Cc: stable@kernel.org Signed-off-by: Biju Das Acked-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20230727081848.100834-2-biju.das.jz@bp.renesas.com commit 0e594c1f5d0f0f916f7512cac92ef3ba8c4ace1c Merge: e5f061d5e340f c4e33cf2611b2 Author: David S. Miller Date: Wed Oct 11 07:13:51 2023 +0100 Merge branch 'virtio-net-interrupt-moderation' Heng Qi says: ==================== virtio-net: Fix and update interrupt moderation The setting of virtio coalescing parameters involves all-queues and per queue, so we must be careful to synchronize the two. Regarding napi_tx switching, this patch set is not only compatible with the previous way of using tx-frames to switch napi_tx, but also improves the user experience when setting interrupt parameters. This patch set has been tested and was part of the previous netdim patch set[1] and is now being split to be rolled out in steps. [1] https://lore.kernel.org/all/20230811065512.22190-1-hengqi@linux.alibaba.com/ --- v2->v3: 1. Fix a tiny comment. v1->v2: 1. Fix some minor comments and add ack tags. ==================== Signed-off-by: David S. Miller commit c4e33cf2611b2f73098f7413176d428d1fb62304 Author: Heng Qi Date: Sun Oct 8 14:27:44 2023 +0800 virtio-net: a tiny comment update Update a comment because virtio-net now supports both VIRTIO_NET_F_NOTF_COAL and VIRTIO_NET_F_VQ_NOTF_COAL. Signed-off-by: Heng Qi Acked-by: Jason Wang Signed-off-by: David S. Miller commit f61fe5f081cf40de08d0a4c89659baf23c900f0c Author: Heng Qi Date: Sun Oct 8 14:27:43 2023 +0800 virtio-net: fix the vq coalescing setting for vq resize According to the definition of virtqueue coalescing spec[1]: Upon disabling and re-enabling a transmit virtqueue, the device MUST set the coalescing parameters of the virtqueue to those configured through the VIRTIO_NET_CTRL_NOTF_COAL_TX_SET command, or, if the driver did not set any TX coalescing parameters, to 0. Upon disabling and re-enabling a receive virtqueue, the device MUST set the coalescing parameters of the virtqueue to those configured through the VIRTIO_NET_CTRL_NOTF_COAL_RX_SET command, or, if the driver did not set any RX coalescing parameters, to 0. We need to add this setting for vq resize (ethtool -G) where vq_reset happens. [1] https://lists.oasis-open.org/archives/virtio-dev/202303/msg00415.html Fixes: 394bd87764b6 ("virtio_net: support per queue interrupt coalesce command") Cc: Gavin Li Signed-off-by: Heng Qi Acked-by: Jason Wang Signed-off-by: David S. Miller commit bfb2b3609162135625bf96acf5118051cd0d082e Author: Heng Qi Date: Sun Oct 8 14:27:42 2023 +0800 virtio-net: fix per queue coalescing parameter setting When the user sets a non-zero coalescing parameter to 0 for a specific virtqueue, it does not work as expected, so let's fix this. Fixes: 394bd87764b6 ("virtio_net: support per queue interrupt coalesce command") Reported-by: Xiaoming Zhao Cc: Gavin Li Signed-off-by: Heng Qi Acked-by: Jason Wang Signed-off-by: David S. Miller commit e9420838ab4ffb82850095549e94dcee3f7fe0cb Author: Heng Qi Date: Sun Oct 8 14:27:41 2023 +0800 virtio-net: consistently save parameters for per-queue When using .set_coalesce interface to set all queue coalescing parameters, we need to update both per-queue and global save values. Fixes: 394bd87764b6 ("virtio_net: support per queue interrupt coalesce command") Cc: Gavin Li Signed-off-by: Heng Qi Acked-by: Jason Wang Signed-off-by: David S. Miller commit 134674c1877be5e35e35802517c67a9ecce21153 Author: Heng Qi Date: Sun Oct 8 14:27:40 2023 +0800 virtio-net: fix mismatch of getting tx-frames Since virtio-net allows switching napi_tx for per txq, we have to get the specific txq's result now. Fixes: 394bd87764b6 ("virtio_net: support per queue interrupt coalesce command") Cc: Gavin Li Signed-off-by: Heng Qi Acked-by: Jason Wang Signed-off-by: David S. Miller commit 3014a0d54820d25c3dc66657bcc19013f2338760 Author: Heng Qi Date: Sun Oct 8 14:27:39 2023 +0800 virtio-net: initially change the value of tx-frames Background: 1. Commit 0c465be183c7 ("virtio_net: ethtool tx napi configuration") uses tx-frames to toggle napi_tx (0 off and 1 on) if notification coalescing is not supported. 2. Commit 31c03aef9bc2 ("virtio_net: enable napi_tx by default") enables napi_tx for all txqs by default. Status: When virtio-net supports notification coalescing, after initialization, tx-frames is 0 and napi_tx is true. Problem: When the user only wants to set rx coalescing params using ethtool -C eth0 rx-usecs 10, or ethtool -Q eth0 queue_mask 0x1 -C rx-usecs 10, these cmds will carry tx-frames as 0, causing the napi_tx switching condition is satisfied. Then the user gets: netlink error: Device or resource busy. The same happens when trying to set rx-frames, adaptive_rx, adaptive_tx... How to fix: When notification coalescing feature is negotiated, initially make the value of tx-frames to be consistent with napi_tx. For compatibility with the past, it is still supported to use tx-frames to toggle napi_tx. Reported-by: Xiaoming Zhao Signed-off-by: Heng Qi Acked-by: Jason Wang Signed-off-by: David S. Miller commit e5f061d5e340fefc663cacfe8f42f149d55bdb53 Author: Justin Stitt Date: Mon Oct 9 22:43:59 2023 +0000 net: dsa: realtek: rtl8365mb: replace deprecated strncpy with ethtool_sprintf `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of this more robust and easier to understand interface. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Florian Fainelli Reviewed-by: Alvin Šipraga Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20231009-strncpy-drivers-net-dsa-realtek-rtl8365mb-c-v1-1-0537fe9fb08c@google.com Signed-off-by: Jakub Kicinski commit db10cb9b574675402bfd8fe1a31aafdd45b002df Author: Dan Williams Date: Tue Oct 10 12:53:33 2023 -0700 virt: sevguest: Fix passing a stack buffer as a scatterlist target CONFIG_DEBUG_SG highlights that get_{report,ext_report,derived_key)()} are passing stack buffers as the @req_buf argument to handle_guest_request(), generating a Call Trace of the following form: WARNING: CPU: 0 PID: 1175 at include/linux/scatterlist.h:187 enc_dec_message+0x518/0x5b0 [sev_guest] [..] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 RIP: 0010:enc_dec_message+0x518/0x5b0 [sev_guest] Call Trace: [..] handle_guest_request+0x135/0x520 [sev_guest] get_ext_report+0x1ec/0x3e0 [sev_guest] snp_guest_ioctl+0x157/0x200 [sev_guest] Note that the above Call Trace was with the DEBUG_SG BUG_ON()s converted to WARN_ON()s. This is benign as long as there are no hardware crypto accelerators loaded for the aead cipher, and no subsequent dma_map_sg() is performed on the scatterlist. However, sev-guest can not assume the presence of an aead accelerator nor can it assume that CONFIG_DEBUG_SG is disabled. Resolve this bug by allocating virt_addr_valid() memory, similar to the other buffers am @snp_dev instance carries, to marshal requests from user buffers to kernel buffers. Reported-by: Peter Gonda Closes: http://lore.kernel.org/r/CAMkAt6r2VPPMZ__SQfJse8qWsUyYW3AgYbOUVM0S_Vtk=KvkxQ@mail.gmail.com Fixes: fce96cf04430 ("virt: Add SEV-SNP guest driver") Cc: Borislav Petkov Cc: Tom Lendacky Cc: Dionna Glaze Cc: Jeremi Piotrowski Tested-by: Kuppuswamy Sathyanarayanan Reviewed-by: Tom Lendacky Signed-off-by: Dan Williams commit b0e4a14f5ba125be14a557ff3ac890ad0aacfc26 Author: Justin Stitt Date: Mon Oct 9 22:47:37 2023 +0000 net: dsa: realtek: replace deprecated strncpy with ethtool_sprintf `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of this more robust and easier to understand interface. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Florian Fainelli Reviewed-by: Linus Walleij Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20231009-strncpy-drivers-net-dsa-realtek-rtl8366-core-c-v1-1-74e1b5190778@google.com Signed-off-by: Jakub Kicinski commit 382bb32d3865ebe34e8b11e3117a8b3a3debddd3 Author: Justin Stitt Date: Mon Oct 9 18:34:45 2023 +0000 net: dsa: qca8k: replace deprecated strncpy with ethtool_sprintf `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. ethtool_sprintf() is designed specifically for get_strings() usage. Let's replace strncpy in favor of this more robust and easier to understand interface. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20231009-strncpy-drivers-net-dsa-qca-qca8k-common-c-v1-1-34c8040e0f32@google.com Signed-off-by: Jakub Kicinski commit 9164e4a5af9c5587f8fdddeee30c615d21676e92 Merge: 9e55a22fce138 2b16a52549d51 Author: Song Liu Date: Tue Oct 10 19:23:32 2023 -0700 Merge branch 'md-suspend-rewrite' into md-next From Yu Kuai, written by Song Liu Recent tests with raid10 revealed many issues with the following scenarios: - add or remove disks to the array - issue io to the array At first, we fixed each problem independently respect that io can concurrent with array reconfiguration. However, with more issues reported continuously, I am hoping to fix these problems thoroughly. Refer to how block layer protect io with queue reconfiguration (for example, change elevator): blk_mq_freeze_queue -> wait for all io to be done, and prevent new io to be dispatched // reconfiguration blk_mq_unfreeze_queue I think we can do something similar to synchronize io with array reconfiguration. Current synchronization works as the following. For the reconfiguration operation: 1. Hold 'reconfig_mutex'; 2. Check that rdev can be added/removed, one condition is that there is no IO (for example, check nr_pending). 3. Do the actual operations to add/remove a rdev, one procedure is set/clear a pointer to rdev. 4. Check if there is still no IO on this rdev, if not, revert the change. IO path uses rcu_read_lock/unlock() to access rdev. - rcu is used wrongly; - There are lots of places involved that old rdev can be read, however, many places doesn't handle old value correctly; - Between step 3 and 4, if new io is dispatched, NULL will be read for the rdev, and data will be lost if step 4 failed. The new synchronization is similar to blk_mq_freeze_queue(). To add or remove disk: 1. Suspend the array, that is, stop new IO from being dispatched and wait for inflight IO to finish. 2. Add or remove rdevs to array; 3. Resume the array; IO path doesn't need to change for now, and all rcu implementation can be removed. Then main work is divided into 3 steps: First, first make sure new apis to suspend the array is general: - make sure suspend array will wait for io to be done(Done by [1]); - make sure suspend array can be called for all personalities(Done by [2]); - make sure suspend array can be called at any time(Done by [3]); - make sure suspend array doesn't rely on 'reconfig_mutex'(PATCH 3-5); Second replace old apis with new apis(PATCH 6-16). Specifically, the synchronization is changed from: lock reconfig_mutex suspend array make changes resume array unlock reconfig_mutex to: suspend array lock reconfig_mutex make changes unlock reconfig_mutex resume array Finally, for the remain path that involved reconfiguration, suspend the array first(PATCH 11,12, [4] and PATCH 17): Preparatory work: [1] https://lore.kernel.org/all/20230621165110.1498313-1-yukuai1@huaweicloud.com/ [2] https://lore.kernel.org/all/20230628012931.88911-2-yukuai1@huaweicloud.com/ [3] https://lore.kernel.org/all/20230825030956.1527023-1-yukuai1@huaweicloud.com/ [4] https://lore.kernel.org/all/20230825031622.1530464-1-yukuai1@huaweicloud.com/ * md-suspend-rewrite: md: rename __mddev_suspend/resume() back to mddev_suspend/resume() md: remove old apis to suspend the array md: suspend array in md_start_sync() if array need reconfiguration md/raid5: replace suspend with quiesce() callback md/md-linear: cleanup linear_add() md: cleanup mddev_create/destroy_serial_pool() md: use new apis to suspend array before mddev_create/destroy_serial_pool md: use new apis to suspend array for ioctls involed array reconfiguration md: use new apis to suspend array for adding/removing rdev from state_store() md: use new apis to suspend array for sysfs apis md/raid5: use new apis to suspend array md/raid5-cache: use new apis to suspend array md/md-bitmap: use new apis to suspend array for location_store() md/dm-raid: use new apis to suspend array md: add new helpers to suspend/resume and lock/unlock array md: add new helpers to suspend/resume array md: replace is_md_suspended() with 'mddev->suspended' in md_check_recovery() md/raid5-cache: use READ_ONCE/WRITE_ONCE for 'conf->log' md: use READ_ONCE/WRITE_ONCE for 'suspend_lo' and 'suspend_hi' commit 2b16a52549d51937a98d82b07b4d83dce6c43683 Author: Yu Kuai Date: Tue Oct 10 23:19:58 2023 +0800 md: rename __mddev_suspend/resume() back to mddev_suspend/resume() Now that the old apis are removed, __mddev_suspend/resume() can be renamed to their original names. This is done by: sed -i "s/__mddev_suspend/mddev_suspend/g" *.[ch] sed -i "s/__mddev_resume/mddev_resume/g" *.[ch] Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-20-yukuai1@huaweicloud.com commit 4717c02875221d43d73ffed07f960d881bc00fc8 Author: Yu Kuai Date: Tue Oct 10 23:19:57 2023 +0800 md: remove old apis to suspend the array Now that mddev_suspend() and mddev_resume() is not used anywhere, remove them, and remove 'MD_ALLOW_SB_UPDATE' and 'MD_UPDATING_SB' as well. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-19-yukuai1@huaweicloud.com commit bc08041b32abe6c9824f78735bac22018eabfc06 Author: Yu Kuai Date: Tue Oct 10 23:19:56 2023 +0800 md: suspend array in md_start_sync() if array need reconfiguration So that io won't concurrent with array reconfiguration, and it's safe to suspend the array directly because normal io won't rely on md_start_sync(). Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-18-yukuai1@huaweicloud.com commit b42cd7b3a20db692a8d24c2c756ad5008729976b Author: Yu Kuai Date: Tue Oct 10 23:19:55 2023 +0800 md/raid5: replace suspend with quiesce() callback raid5 is the only personality to suspend array in check_reshape() and start_reshape() callback, suspend and quiesce() callback can both wait for all normal io to be done, and prevent new io to be dispatched, the difference is that suspend is implemented in common layer, and quiesce() callback is implemented in raid5. In order to cleanup all the usage of mddev_suspend(), the new apis __mddev_suspend() need to be called before 'reconfig_mutex' is held, and it's not good to affect all the personalities in common layer just for raid5. Hence replace suspend with quiesce() callaback, prepare to reomove all the users of mddev_suspend(). Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-17-yukuai1@huaweicloud.com commit 1978c742f3e7ef359b83cb712f8559fcd32032d0 Author: Yu Kuai Date: Tue Oct 10 23:19:54 2023 +0800 md/md-linear: cleanup linear_add() Now that caller already suspend the array, there is no need to suspend array in liner_add(). Note that mddev_suspend/resume() is not used anymore. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-16-yukuai1@huaweicloud.com commit b4128c00a653dfd08fbe3d26fcf4c8b4970a69ba Author: Yu Kuai Date: Tue Oct 10 23:19:53 2023 +0800 md: cleanup mddev_create/destroy_serial_pool() Now that except for stopping the array, all the callers already suspend the array, there is no need to suspend anymore, hence remove the second parameter. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-15-yukuai1@huaweicloud.com commit 58226942ad3d1423785f815ede5bcc832574f2ea Author: Yu Kuai Date: Tue Oct 10 23:19:52 2023 +0800 md: use new apis to suspend array before mddev_create/destroy_serial_pool mddev_create/destroy_serial_pool() will be called from several places where mddev_suspend() will be called later. Prepare to remove the mddev_suspend() from mddev_create/destroy_serial_pool(). Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-14-yukuai1@huaweicloud.com commit 1b0a2d950ee2a54aa04fb31ead32144be0bbf690 Author: Yu Kuai Date: Tue Oct 10 23:19:51 2023 +0800 md: use new apis to suspend array for ioctls involed array reconfiguration 'reconfig_mutex' will be grabbed before these ioctls, suspend array before holding the lock, so that io won't concurrent with array reconfiguration through ioctls. This is not hot path, so performance is not concerned. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-13-yukuai1@huaweicloud.com commit cfa078c8b80d0daf8f2fd4a2ab8e26fa8c33bca1 Author: Yu Kuai Date: Tue Oct 10 23:19:50 2023 +0800 md: use new apis to suspend array for adding/removing rdev from state_store() User can write 'remove' and 're-add' to trigger array reconfiguration through sysfs, suspend array in this case so that io won't concurrent with array reconfiguration. And now that all the caller of add_bound_rdev() alread suspend the array, remove mddev_suspend/resume() from add_bound_rdev() as well. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-12-yukuai1@huaweicloud.com commit 205669f37770772c1ae8c2dac1eba6da521a8b77 Author: Yu Kuai Date: Tue Oct 10 23:19:49 2023 +0800 md: use new apis to suspend array for sysfs apis Convert to use new apis in following sysfs apis: - level_store - suspend_lo_store - suspend_hi_store - serialize_policy_store These are not hot path, so performance is not concerned. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-11-yukuai1@huaweicloud.com commit e28ca92fbb5c6ed8fac5db65e02947bf020c5b60 Author: Yu Kuai Date: Tue Oct 10 23:19:48 2023 +0800 md/raid5: use new apis to suspend array Convert to use new apis, the old apis will be removed eventually. These are not hot path, so performance is not concerned. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-10-yukuai1@huaweicloud.com commit 1b172e0b11c00e89c5df72c2761b3d4d279fbb4d Author: Yu Kuai Date: Tue Oct 10 23:19:47 2023 +0800 md/raid5-cache: use new apis to suspend array Convert to use new apis, the old apis will be removed eventually. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-9-yukuai1@huaweicloud.com commit 3cddf86a57a58441eb019d21acea147f043dc13c Author: Yu Kuai Date: Tue Oct 10 23:19:46 2023 +0800 md/md-bitmap: use new apis to suspend array for location_store() Convert to use new apis, the old apis will be removed eventually. This is not hot path, so performance is not concerned. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-8-yukuai1@huaweicloud.com commit 4eb3327aa28f3a737c2d3f7e35e83575f1d52283 Author: Yu Kuai Date: Tue Oct 10 23:19:45 2023 +0800 md/dm-raid: use new apis to suspend array Convert to use new apis, the old apis will be removed eventually. These are not hot path, so performance is not concerned. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-7-yukuai1@huaweicloud.com commit f45461e24febab5c2ba8f331e9eb109bb59cbdc1 Author: Yu Kuai Date: Tue Oct 10 23:19:44 2023 +0800 md: add new helpers to suspend/resume and lock/unlock array The new helpers suspend the array first and then lock the array, Prepare to refactor from: mddev_lock/lock_nointr mddev_suspend ... mddev_resuem mddev_lock With: mddev_suspend_and_lock/lock_nointr ... mddev_unlock_and_resume After all the use cases is refactored, mddev_suspend/resume() will be removed. And mddev_suspend_and_lock() will also replace mddev_lock() for the case that the array will be reconfigured, in order to synchronize with io to prevent problems in many corner cases. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-6-yukuai1@huaweicloud.com commit 714d20150ed85811193ae07a494d91f9927c590f Author: Yu Kuai Date: Tue Oct 10 23:19:43 2023 +0800 md: add new helpers to suspend/resume array Advantages for new apis: - reconfig_mutex is not required; - the weird logical that suspend array hold 'reconfig_mutex' for mddev_check_recovery() to update superblock is not needed; - the specail handling, 'pers->prepare_suspend', for raid456 is not needed; - It's safe to be called at any time once mddev is allocated, and it's designed to be used from slow path where array configuration is changed; - the new helpers is designed to be called before mddev_lock(), hence it support to be interrupted by user as well. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-5-yukuai1@huaweicloud.com commit 2e82248b70f48a98f3720cdaa8ea7a4e7f8bd760 Author: Yu Kuai Date: Tue Oct 10 23:19:42 2023 +0800 md: replace is_md_suspended() with 'mddev->suspended' in md_check_recovery() Prepare to cleanup pers->prepare_suspend(), which is used to fix a deadlock in raid456 by returning error for io that is waiting for reshape to make progress in mddev_suspend(). This change will allow reshape to make progress while waiting for io to be done in mddev_suspend() in following patches. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-4-yukuai1@huaweicloud.com commit 06a4d0d8c642b5ea654e832b74dca12965356da0 Author: Yu Kuai Date: Tue Oct 10 23:19:41 2023 +0800 md/raid5-cache: use READ_ONCE/WRITE_ONCE for 'conf->log' 'conf->log' is set with 'reconfig_mutex' grabbed, however, readers are not procted, hence protect it with READ_ONCE/WRITE_ONCE to prevent reading abnormal values. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-3-yukuai1@huaweicloud.com commit 617787f1386da5e851dad68926a31522134d352b Author: Yu Kuai Date: Tue Oct 10 23:19:40 2023 +0800 md: use READ_ONCE/WRITE_ONCE for 'suspend_lo' and 'suspend_hi' Protect 'suspend_lo' and 'suspend_hi' with READ_ONCE/WRITE_ONCE to prevent reading abnormal values. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231010151958.145896-2-yukuai1@huaweicloud.com commit 1dab47139e6118a420acec8426a860ea4b40c379 Author: Arnd Bergmann Date: Mon Oct 9 16:10:28 2023 +0200 appletalk: remove ipddp driver After the cops driver is removed, ipddp is now the only CONFIG_DEV_APPLETALK but as far as I can tell, this also has no users and can be removed, making appletalk support purely based on ethertalk, using ethernet hardware. Link: https://lore.kernel.org/netdev/e490dd0c-a65d-4acf-89c6-c06cb48ec880@app.fastmail.com/ Link: https://lore.kernel.org/netdev/9cac4fbd-9557-b0b8-54fa-93f0290a6fb8@schmorgal.com/ Cc: Doug Brown Signed-off-by: Arnd Bergmann Acked-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20231009141139.1766345-1-arnd@kernel.org Signed-off-by: Jakub Kicinski commit c9f65a3f2d92e0de336177d0151dabaf3ed004e5 Author: Yan Zhao Date: Fri Jul 14 14:53:26 2023 +0800 KVM: VMX: drop IPAT in memtype when CD=1 for KVM_X86_QUIRK_CD_NW_CLEARED For KVM_X86_QUIRK_CD_NW_CLEARED is on, remove the IPAT (ignore PAT) bit in EPT memory types when cache is disabled and non-coherent DMA are present. To correctly emulate CR0.CD=1, UC + IPAT are required as memtype in EPT. However, as with commit fb279950ba02 ("KVM: vmx: obey KVM_QUIRK_CD_NW_CLEARED"), WB + IPAT are now returned to workaround a BIOS issue that guest MTRRs are enabled too late. Without this workaround, a super slow guest boot-up is expected during the pre-guest-MTRR-enabled period due to UC as the effective memory type for all guest memory. Absent emulating CR0.CD=1 with UC, it makes no sense to set IPAT when KVM is honoring the guest memtype. Removing the IPAT bit in this patch allows effective memory type to honor PAT values as well, as WB is the weakest memtype. It means if a guest explicitly claims UC as the memtype in PAT, the effective memory is UC instead of previous WB. If, for some unknown reason, a guest meets a slow boot-up issue with the removal of IPAT, it's desired to fix the blamed PAT in the guest. Returning guest MTRR type as if CR0.CD=0 is also not preferred because KVMs ABI for the quirk also requires KVM to force WB memtype regardless of guest MTRRs to workaround the slow guest boot-up issue. In the future, honoring guest PAT will also allow KVM to more precisely zap SPTEs when the effective memtype changes. E.g. by not forcing WB when CR0.CD=1, instead of zapping SPTEs when guest MTRRs change, KVM can skip MTRR-induced zaps if CR0.CD=1 and zap SPTEs for non-WB MTRR ranges when CR0.CD is toggled (WB MTRR SPTEs can be kept because they're WB regardless of CR0.CD). The change of removing IPAT has been verified with normal boot-up time on old OVMF of commit c9e5618f84b0cb54a9ac2d7604f7b7e7859b45a7 as well, dated back to Apr 14 2015. Suggested-by: Sean Christopherson Signed-off-by: Yan Zhao Link: https://lore.kernel.org/r/20230714065326.20557-1-yan.y.zhao@intel.com [sean: massage changelog to apply patch without full series] Signed-off-by: Sean Christopherson commit 362ff6dca5416e20646badf09394b9a8bfc000db Author: Yan Zhao Date: Fri Jul 14 14:52:23 2023 +0800 KVM: x86/mmu: Zap KVM TDP when noncoherent DMA assignment starts/stops Zap KVM TDP when noncoherent DMA assignment starts (noncoherent dma count transitions from 0 to 1) or stops (noncoherent dma count transitions from 1 to 0). Before the zap, test if guest MTRR is to be honored after the assignment starts or was honored before the assignment stops. When there's no noncoherent DMA device, EPT memory type is ((MTRR_TYPE_WRBACK << VMX_EPT_MT_EPTE_SHIFT) | VMX_EPT_IPAT_BIT) When there're noncoherent DMA devices, EPT memory type needs to honor guest CR0.CD and MTRR settings. So, if noncoherent DMA count transitions between 0 and 1, EPT leaf entries need to be zapped to clear stale memory type. This issue might be hidden when the device is statically assigned with VFIO adding/removing MMIO regions of the noncoherent DMA devices for several times during guest boot, and current KVM MMU will call kvm_mmu_zap_all_fast() on the memslot removal. But if the device is hot-plugged, or if the guest has mmio_always_on for the device, the MMIO regions of it may only be added for once, then there's no path to do the EPT entries zapping to clear stale memory type. Therefore do the EPT zapping when noncoherent assignment starts/stops to ensure stale entries cleaned away. Signed-off-by: Yan Zhao Link: https://lore.kernel.org/r/20230714065223.20432-1-yan.y.zhao@intel.com [sean: fix misspelled words in comment and changelog] Signed-off-by: Sean Christopherson commit 039adf3947252693f7c882607dac2dc67e7f7ab2 Author: John Harrison Date: Mon Oct 9 11:38:02 2023 -0700 drm/i915: More use of GT specific print helpers Update a bunch of GT related print messages in non-GT files to use the GT specific helpers. Signed-off-by: John Harrison Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231009183802.673882-3-John.C.Harrison@Intel.com commit e96aef0793894d4d87d31c896f34f0939311d2b2 Author: John Harrison Date: Mon Oct 9 11:38:01 2023 -0700 drm/i915/gt: More use of GT specific print helpers A bunch of print messages got missed in the update to using sub-system specific helpers. So update those. Signed-off-by: John Harrison Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231009183802.673882-2-John.C.Harrison@Intel.com commit 8f06eef7b80cebd410a5e13e740f7e00b3c22e3d Author: Joel Granados Date: Mon Oct 2 13:30:42 2023 +0200 c-sky: Remove now superfluous sentinel element from ctl_talbe array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from alignment_tbl ctl_table array. This removal is safe because register_sysctl_init implicitly uses ARRAY_SIZE() in addition to checking for the sentinel. Acked-by: Guo Ren Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit ea9738dbc6da12b0d8cfc3515c4762a5e4fc6d8c Author: Joel Granados Date: Mon Oct 2 13:30:41 2023 +0200 powerpc: Remove now superfluous sentinel element from ctl_table arrays This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel from powersave_nap_ctl_table and nmi_wd_lpm_factor_ctl_table. This removal is safe because register_sysctl implicitly uses ARRAY_SIZE() in addition to checking for the sentinel. Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit f6ca506f4237136d6cc876f487730d2e595b837f Author: Joel Granados Date: Mon Oct 2 13:30:40 2023 +0200 riscv: Remove now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel element from riscv_v_default_vstate_table. This removal is safe because register_sysctl implicitly uses ARRAY_SIZE() in addition to checking for the sentinel. Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit ecd5d66383d99ab132e3715c9e9867a5aba95e1b Author: Joel Granados Date: Mon Oct 2 13:30:39 2023 +0200 x86/vdso: Remove now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel element from abi_table2. This removal is safe because register_sysctl implicitly uses ARRAY_SIZE() in addition to checking for the sentinel. Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit 83e291d3f5964a6f7a4871db543a2ed31d1b8d07 Author: Joel Granados Date: Mon Oct 2 13:30:38 2023 +0200 arch/x86: Remove now superfluous sentinel elem from ctl_table arrays This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel element from sld_sysctl and itmt_kern_table. This removal is safe because register_sysctl_init and register_sysctl implicitly use the array size in addition to checking for the sentinel. Reviewed-by: Ingo Molnar Acked-by: Dave Hansen # for x86 Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit de8a660b03a35c76b91a03421057833d29973877 Author: Joel Granados Date: Mon Oct 2 13:30:37 2023 +0200 arm: Remove now superfluous sentinel elem from ctl_table arrays This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Removed the sentinel as well as the explicit size from ctl_isa_vars. The size is redundant as the initialization sets it. Changed insn_emulation->sysctl from a 2 element array of struct ctl_table to a simple struct. This has no consequence for the sysctl registration as it is forwarded as a pointer. Removed sentinel from sve_defatul_vl_table, sme_default_vl_table, tagged_addr_sysctl_table and armv8_pmu_sysctl_table. This removal is safe because register_sysctl_sz and register_sysctl use the array size in addition to checking for the sentinel. Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit fdd9da76e2dec07de294f040bec3787f296c7c5d Author: Joel Granados Date: Mon Oct 2 13:30:36 2023 +0200 S390: Remove now superfluous sentinel elem from ctl_table arrays This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove the sentinel element from appldata_table, s390dbf_table, topology_ctl_table, cmm_table and page_table_sysctl. Reduced the memory allocation in appldata_register_ops by 1 effectively removing the sentinel from ops->ctl_table. This removal is safe because register_sysctl_sz and register_sysctl use the array size in addition to checking for the sentinel. Tested-by: Alexander Gordeev Acked-by: Heiko Carstens Signed-off-by: Joel Granados Signed-off-by: Luis Chamberlain commit b19fdb16fb2167c6bc9ee8fbc0c1d2d4fd3e2eb8 Author: Colin Ian King Date: Tue Oct 10 16:57:44 2023 +0100 sched/headers: Remove comment referring to rq::cpu_load, since this has been removed There is a comment that refers to cpu_load, however, this cpu_load was removed with: 55627e3cd22c ("sched/core: Remove rq->cpu_load[]") ... back in 2019. The comment does not make sense with respect to this removed array, so remove the comment. Signed-off-by: Colin Ian King Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231010155744.1381065-1-colin.i.king@gmail.com commit f169c62ff7cd1acf8bac8ae17bfeafa307d9e6fa Author: Mel Gorman Date: Tue Oct 10 09:31:43 2023 +0100 sched/numa: Complete scanning of inactive VMAs when there is no alternative VMAs are skipped if there is no recent fault activity but this represents a chicken-and-egg problem as there may be no fault activity if the PTEs are never updated to trap NUMA hints. There is an indirect reliance on scanning to be forced early in the lifetime of a task but this may fail to detect changes in phase behaviour. Force inactive VMAs to be scanned when all other eligible VMAs have been updated within the same scan sequence. Test results in general look good with some changes in performance, both negative and positive, depending on whether the additional scanning and faulting was beneficial or not to the workload. The autonuma benchmark workload NUMA01_THREADLOCAL was picked for closer examination. The workload creates two processes with numerous threads and thread-local storage that is zero-filled in a loop. It exercises the corner case where unrelated threads may skip VMAs that are thread-local to another thread and still has some VMAs that inactive while the workload executes. The VMA skipping activity frequency with and without the patch: 6.6.0-rc2-sched-numabtrace-v1 ============================= 649 reason=scan_delay 9,094 reason=unsuitable 48,915 reason=shared_ro 143,919 reason=inaccessible 193,050 reason=pid_inactive 6.6.0-rc2-sched-numabselective-v1 ============================= 146 reason=seq_completed 622 reason=ignore_pid_inactive 624 reason=scan_delay 6,570 reason=unsuitable 16,101 reason=shared_ro 27,608 reason=inaccessible 41,939 reason=pid_inactive Note that with the patch applied, the PID activity is ignored (ignore_pid_inactive) to ensure a VMA with some activity is completely scanned. In addition, a small number of VMAs are scanned when no other eligible VMA is available during a single scan window (seq_completed). The number of times a VMA is skipped due to no PID activity from the scanning task (pid_inactive) drops dramatically. It is expected that this will increase the number of PTEs updated for NUMA hinting faults as well as hinting faults but these represent PTEs that would otherwise have been missed. The tradeoff is scan+fault overhead versus improving locality due to migration. On a 2-socket Cascade Lake test machine, the time to complete the workload is as follows; 6.6.0-rc2 6.6.0-rc2 sched-numabtrace-v1 sched-numabselective-v1 Min elsp-NUMA01_THREADLOCAL 174.22 ( 0.00%) 117.64 ( 32.48%) Amean elsp-NUMA01_THREADLOCAL 175.68 ( 0.00%) 123.34 * 29.79%* Stddev elsp-NUMA01_THREADLOCAL 1.20 ( 0.00%) 4.06 (-238.20%) CoeffVar elsp-NUMA01_THREADLOCAL 0.68 ( 0.00%) 3.29 (-381.70%) Max elsp-NUMA01_THREADLOCAL 177.18 ( 0.00%) 128.03 ( 27.74%) The time to complete the workload is reduced by almost 30%: 6.6.0-rc2 6.6.0-rc2 sched-numabtrace-v1 sched-numabselective-v1 / Duration User 91201.80 63506.64 Duration System 2015.53 1819.78 Duration Elapsed 1234.77 868.37 In this specific case, system CPU time was not increased but it's not universally true. From vmstat, the NUMA scanning and fault activity is as follows; 6.6.0-rc2 6.6.0-rc2 sched-numabtrace-v1 sched-numabselective-v1 Ops NUMA base-page range updates 64272.00 26374386.00 Ops NUMA PTE updates 36624.00 55538.00 Ops NUMA PMD updates 54.00 51404.00 Ops NUMA hint faults 15504.00 75786.00 Ops NUMA hint local faults % 14860.00 56763.00 Ops NUMA hint local percent 95.85 74.90 Ops NUMA pages migrated 1629.00 6469222.00 Both the number of PTE updates and hint faults is dramatically increased. While this is superficially unfortunate, it represents ranges that were simply skipped without the patch. As a result of the scanning and hinting faults, many more pages were also migrated but as the time to completion is reduced, the overhead is offset by the gain. Signed-off-by: Mel Gorman Signed-off-by: Ingo Molnar Tested-by: Raghavendra K T Link: https://lore.kernel.org/r/20231010083143.19593-7-mgorman@techsingularity.net commit b7a5b537c55c088d891ae554103d1b281abef781 Author: Mel Gorman Date: Tue Oct 10 09:31:42 2023 +0100 sched/numa: Complete scanning of partial VMAs regardless of PID activity NUMA Balancing skips VMAs when the current task has not trapped a NUMA fault within the VMA. If the VMA is skipped then mm->numa_scan_offset advances and a task that is trapping faults within the VMA may never fully update PTEs within the VMA. Force tasks to update PTEs for partially scanned PTEs. The VMA will be tagged for NUMA hints by some task but this removes some of the benefit of tracking PID activity within a VMA. A follow-on patch will mitigate this problem. The test cases and machines evaluated did not trigger the corner case so the performance results are neutral with only small changes within the noise from normal test-to-test variance. However, the next patch makes the corner case easier to trigger. Signed-off-by: Mel Gorman Signed-off-by: Ingo Molnar Tested-by: Raghavendra K T Link: https://lore.kernel.org/r/20231010083143.19593-6-mgorman@techsingularity.net commit 875760900b44fb33753dc1c53d0c03acb3336447 Author: Ilpo Järvinen Date: Mon Sep 11 15:53:54 2023 +0300 scsi: ipr: Do PCI error checks on own line Instead of "if" conditions with line splits, use the usual error handling pattern with a separate variable to improve readability. No functional changes intended. Link: https://lore.kernel.org/r/20230911125354.25501-7-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas Reviewed-by: "Martin K. Petersen" commit 910ed628e511b8533e40b7e9119040c160848a57 Author: Ilpo Järvinen Date: Mon Sep 11 15:53:53 2023 +0300 PCI: xgene: Do PCI error check on own line & keep return value Instead of an "if" condition with a line split, use the usual error handling pattern with a separate variable to improve readability. pci_generic_config_read32() already returns either PCIBIOS_SUCCESSFUL or PCIBIOS_DEVICE_NOT_FOUND so it is enough to simply return its return value when ret != PCIBIOS_SUCCESSFUL. No functional changes intended. Link: https://lore.kernel.org/r/20230911125354.25501-6-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit d15f18053e5cc5576af9e7eef0b2a91169b6326d Author: Ilpo Järvinen Date: Mon Sep 11 15:53:52 2023 +0300 PCI: Do error check on own line to split long "if" conditions Placing PCI error code check inside "if" condition usually results in need to split lines. Combined with additional conditions the "if" condition becomes messy. Convert to the usual error handling pattern with an additional variable to improve code readability. In addition, reverse the logic in pci_find_vsec_capability() to get rid of &&. No functional changes intended. Link: https://lore.kernel.org/r/20230911125354.25501-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen [bhelgaas: PCI_POSSIBLE_ERROR()] Signed-off-by: Bjorn Helgaas commit c28742447ca9879b52fbaf022ad844f0ffcd749c Author: Ilpo Järvinen Date: Mon Sep 11 15:53:51 2023 +0300 atm: iphase: Do PCI error checks on own line In get_esi() PCI errors are checked inside line-split "if" conditions (in addition to the file not following the coding style). To make the code in get_esi() more readable, fix the coding style and use the usual error handling pattern with a separate variable. In addition, initialization of 'error' variable at declaration is not needed. No functional changes intended. Link: https://lore.kernel.org/r/20230911125354.25501-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit a1165c5edf57fa3238e938b0513395f624d7565b Author: Ilpo Järvinen Date: Mon Sep 11 15:53:50 2023 +0300 sh: pci: Do PCI error check on own line Instead of an "if" condition with a line split, use the usual error handling pattern with a separate variable to improve readability. No functional changes intended. Link: https://lore.kernel.org/r/20230911125354.25501-3-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen [bhelgaas: u16 vid, PCI_POSSIBLE_ERROR()] Signed-off-by: Bjorn Helgaas Acked-by: John Paul Adrian Glaubitz commit 7d52f538cef8d56b179eace7c796d9edb3094dad Author: Ilpo Järvinen Date: Mon Sep 11 15:53:49 2023 +0300 alpha: Streamline convoluted PCI error handling miata_map_irq() handles PCI device and read config related errors in a conditional block that is more complex than necessary. Streamline the code flow and error handling. No functional changes intended. Link: https://lore.kernel.org/r/20230911125354.25501-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit 1096f9fa2be18a1340d1299b4c4329af211076e7 Author: Kees Cook Date: Fri Sep 22 10:52:07 2023 -0700 regulator: da9063: Annotate struct da9063_regulators with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct da9063_regulators. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Support Opensource Cc: Liam Girdwood Cc: Mark Brown Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175207.work.576-kees@kernel.org Signed-off-by: Mark Brown commit 59825951707eccf92782e109c04772d34fc07eb6 Author: Kees Cook Date: Fri Sep 22 10:50:50 2023 -0700 ASoC: apple: mca: Annotate struct mca_data with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mca_data. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Martin Povišer Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: asahi@lists.linux.dev Cc: alsa-devel@alsa-project.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175050.work.819-kees@kernel.org Signed-off-by: Mark Brown commit 3be31e95f3db18794139dcbdac1f370ee677f6ac Author: Ilpo Järvinen Date: Fri Sep 15 18:57:52 2023 +0300 PCI/ASPM: Convert printk() to pr_*() and add include Convert printk(KERN_INFO ...) to pr_info() and add the correct include for it. Link: https://lore.kernel.org/r/20230915155752.84640-8-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit 3c4f460480b0696e3cd0b019ba7915c57923961c Author: Ilpo Järvinen Date: Fri Sep 15 18:57:51 2023 +0300 PCI/ASPM: Remove unnecessary includes aspm.c does not use anything from delay.h nor jiffies.h so remove the includes. Link: https://lore.kernel.org/r/20230915155752.84640-7-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit 4ea9c414422ddd2b4aafa5d5ed6f61e1e0e85422 Author: Ilpo Järvinen Date: Fri Sep 15 18:57:50 2023 +0300 PCI/ASPM: Use FIELD_MAX() instead of literals Convert 0x3ff literals in encode_l12_threshold() to FIELD_MAX(PCI_L1SS_CTL1_LTR_L12_TH_VALUE) that explains the purpose of the literal. Link: https://lore.kernel.org/r/20230915155752.84640-6-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit e13b72b819245027f960ce7a3735c4fe24fab024 Author: Ilpo Järvinen Date: Fri Sep 15 18:57:49 2023 +0300 PCI/ASPM: Use time constants Use defined constants to convert between time units. Link: https://lore.kernel.org/r/20230915155752.84640-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit 69bb38b77486b114b56b1174d74bb97d66045697 Author: Ilpo Järvinen Date: Fri Sep 15 18:57:48 2023 +0300 PCI/ASPM: Return U32_MAX instead of bit magic construct Instead of returning a bit obscure -1U, make code's intent of returning the maximum representable value more obvious by returning U32_MAX. Link: https://lore.kernel.org/r/20230915155752.84640-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit 52d92516cb2e04a9b1b8837079a561ca672c1d5e Author: Ilpo Järvinen Date: Fri Sep 15 18:57:47 2023 +0300 PCI/ASPM: Use FIELD_GET/PREP() to access PCIe capability fields Replace open-coded variants to access PCIe capability registers fields with FIELD_GET/PREP(). Link: https://lore.kernel.org/r/20230915155752.84640-3-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit 1a11074be2e94736d12e49a9a562b0a54e8a423d Author: Ilpo Järvinen Date: Fri Sep 15 18:57:46 2023 +0300 PCI: Add PCI_L1SS_CTL2 fields Add L1 PM Substates Control 2 Register fields (PCI_L1SS_CTL2_*). Link: https://lore.kernel.org/r/20230915155752.84640-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit 87cd3d48191e533cd9c224f2da1d78b3513daf47 Merge: d7c9ae8d5d1be e47749f1796d1 Author: Arnaldo Carvalho de Melo Date: Tue Oct 10 17:36:36 2023 -0300 Merge tag 'perf-tools-fixes-for-v6.6-1-2023-09-25' into perf-tools-next To pick up the 'perf bench sched-seccomp-notify' changes to allow us to continue build testing perf-tools-next with the set of distro containers, where some older ones don't have a recent enough seccomp.h UAPI header that contains defines needed by this new 'perf bench' workload. Signed-off-by: Arnaldo Carvalho de Melo commit 408599ec561ad5862cda4f107626009f6fa97a74 Author: Ilpo Järvinen Date: Tue Sep 19 15:56:45 2023 +0300 PCI: mvebu: Use FIELD_PREP() with Link Width mvebu_pcie_setup_hw() setups the Maximum Link Width field in the Link Capabilities registers using an open-coded variant of FIELD_PREP() with a literal in shift. Improve readability by using FIELD_PREP(PCI_EXP_LNKCAP_MLW, ...). Link: https://lore.kernel.org/r/20230919125648.1920-6-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas Reviewed-by: Jonathan Cameron commit 759574abd78e3b47ec45bbd31a64e8832cf73f97 Author: Ilpo Järvinen Date: Tue Sep 19 15:56:44 2023 +0300 PCI: tegra194: Use FIELD_GET()/FIELD_PREP() with Link Width fields Use FIELD_GET() to extract PCIe Negotiated Link Width field instead of custom masking and shifting. Similarly, change custom code that misleadingly used PCI_EXP_LNKSTA_NLW_SHIFT to prepare value for PCI_EXP_LNKCAP write to use FIELD_PREP() with correct field define (PCI_EXP_LNKCAP_MLW). Link: https://lore.kernel.org/r/20230919125648.1920-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas Reviewed-by: Jonathan Cameron commit 1fae02e7eb99fa8feba18ce444d8ce3546e6010e Author: Thomas Weißschuh Date: Tue Oct 3 08:30:03 2023 +0200 docs: submitting-patches: encourage direct notifications to commenters Commenters may not receive new versions of patches via the lists. Without a directed notification to them they might miss those new versions. This is frustrating for the patch developers as they don't receive their earned Reviewed-by. It is also frustrating for the commenters, as they might think their review got ignored or they have to dig up new versions from the archive manually. So encourage patch submitters to make sure that all commenters get notified also when no Reviewed-by was issued yet. Signed-off-by: Thomas Weißschuh Reviewed-by: Christoph Hellwig Acked-by: Alexander Dahl Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20231003-docs-cc-reviewer-v2-1-f93fb946e21e@weissschuh.net commit f1477dbfa5623a2738dbee77f4453f4d2519a103 Author: Vegard Nossum Date: Thu Aug 24 09:23:25 2023 +0000 docs: add backporting and conflict resolution document This is a new document based on my 2022 blog post: https://blogs.oracle.com/linux/post/backporting-patches-using-git Although this is aimed at stable contributors and distro maintainers, it does also contain useful tips and tricks for anybody who needs to resolve merge conflicts. By adding this to the kernel as documentation we can more easily point to it e.g. from stable emails about failed backports, as well as allow the community to modify it over time if necessary. I've added this under process/ since it also has process/applying-patches.rst. Another interesting document is maintainer/rebasing-and-merging.rst which maybe should eventually refer to this one, but I'm leaving that as a future cleanup. Thanks to Harshit Mogalapalli for helping with the original blog post as well as this updated document and Bagas Sanjaya for providing thoughtful feedback. v2: fixed heading style, link style, placeholder style, other comments Link: https://lore.kernel.org/linux-doc/20230303162553.17212-1-vegard.nossum@oracle.com/ Cc: Harshit Mogalapalli Cc: Bagas Sanjaya Cc: Greg Kroah-Hartman Cc: Stephen Rothwell Cc: "Jason A. Donenfeld" Cc: Konstantin Ryabitsev Signed-off-by: Vegard Nossum Rule: stable@vger.kernel.org'or'commit Link: https://lore.kernel.org/stable/20230824092325.1464227-1-vegard.nossum%40oracle.com Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230824092325.1464227-1-vegard.nossum@oracle.com commit 8c56f9ef25a33e51f09a448d25cf863b61c9658d Author: Jarkko Nikula Date: Mon Oct 2 11:28:04 2023 +0300 i2c: i801: Add support for Intel Birch Stream SoC Add SMBus PCI ID on Intel Birch Stream SoC. Signed-off-by: Jarkko Nikula Reviewed-by: Andi Shyti Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit ae2a1f0f2cb52e15cf45508f499fcbfd6637bc56 Author: Bryan O'Donoghue Date: Fri Oct 6 13:01:55 2023 +0100 dt-bindings: i2c: qcom-cci: Document sc8280xp compatible Add sc8280xp compatible consistent with recent CAMSS CCI interfaces. Signed-off-by: Bryan O'Donoghue Reviewed-by: Krzysztof Kozlowski [wsa: rebased] Signed-off-by: Wolfram Sang commit 8cafbf26646a6f7b2e60a2b7e42fdb72825bba63 Author: Rob Herring Date: Fri Oct 6 17:44:46 2023 -0500 i2c: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit 6c5add1c61a95716459157f80d8ad89157867dfa Merge: de6772ee87288 ed843ae947f83 Author: Jonathan Corbet Date: Tue Oct 10 13:38:31 2023 -0600 Merge branch 'riscv-move' into docs-mw commit ed843ae947f83b1d0758d8eec2e8690e3d716d6e Author: Costa Shulyupin Date: Sat Sep 30 21:52:00 2023 +0300 docs: move riscv under arch and fix all in-tree references. Architecture-specific documentation is being moved into Documentation/arch/ as a way of cleaning up the top-level documentation directory and making the docs hierarchy more closely match the source hierarchy. Signed-off-by: Costa Shulyupin Reviewed-by: Conor Dooley Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230930185354.3034118-1-costa.shul@redhat.com commit de6772ee8728872f92776fce6e21444fd70ea0ec Author: Costa Shulyupin Date: Wed Sep 27 19:43:18 2023 +0300 docs: update link to powerpc/vmemmap_dedup.rst after move of powerpc/ to arch/ Signed-off-by: Costa Shulyupin Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230927164319.2686237-1-costa.shul@redhat.com commit 2087f270bebb78adc5059fd040e2691cd7f9bb5c Author: Amos Wenger Date: Fri Oct 6 13:26:36 2023 +0200 mm/memory-hotplug: fix typo in documentation I'm 90% sure memory hotunplugging doesn't involve a "fist" phase Signed-off-by: Amos Wenger Reviewed-by: David Hildenbrand Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20231006112636.97128-1-amos@bearcove.net commit 17e02586ed18501c11115b8dea9055a5973f45a4 Author: Costa Shulyupin Date: Sat Aug 26 19:56:08 2023 +0300 docs: move powerpc under arch and fix all in-tree references. Architecture-specific documentation is being moved into Documentation/arch/ as a way of cleaning up the top-level documentation directory and making the docs hierarchy more closely match the source hierarchy. Signed-off-by: Costa Shulyupin Acked-by: Michael Ellerman Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230826165737.2101199-1-costa.shul@redhat.com commit 5ccba71f928f4abd87cbea680e27e2cedd3293b0 Author: Andy Shevchenko Date: Fri Oct 6 18:06:34 2023 +0300 PCI: Update the devres documentation regarding to pcim_*() There were many changes to PCI core in scope of managed resources APIs. Update documentation to list the current state of affairs. Signed-off-by: Andy Shevchenko Acked-by: Bjorn Helgaas Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20231006150634.3444251-1-andriy.shevchenko@linux.intel.com commit d17ff438a0366f9dcd764ea94c54837873f30724 Author: Vratislav Bendel Date: Mon Aug 29 14:46:38 2022 +0200 docs: mm: fix vm overcommit documentation for OVERCOMMIT_GUESS Commit 8c7829b04c52 "mm: fix false-positive OVERCOMMIT_GUESS failures" changed the behavior of the default OVERCOMMIT_GUESS setting. Reflect the change also in the Documentation, namely files: Documentation/admin-guide/sysctl/vm.rst Documentation/mm/overcommit-accounting.rst Reported-by: Jozef Bacik Signed-off-by: Vratislav Bendel Acked-by: Mike Rapoport Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20220829124638.63748-1-vbendel@redhat.com commit a3c12cf3a69150adb4a8fd199e4c78d4a9e65509 Author: Takahiro Itazuri Date: Fri Sep 1 09:29:59 2023 +0100 docs/hw-vuln: Update desc of best effort mode Moves the description of the best effort mitigation mode to the table of the possible values in the mds and tsx_async_abort docs, and adds the same one to the mmio_stale_data doc. Signed-off-by: Takahiro Itazuri Reviewed-by: Pawan Gupta Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230901082959.28310-1-itazur@amazon.com commit c9ad95adc096f25004d4192258863806a68a9bc8 Author: Min-Hua Chen Date: Sat Sep 2 13:25:12 2023 +0800 docs: sparse: add sparse.rst to toctree Add sparst.rst to toctree, so it can be part of the docs build. Cc: Randy Dunlap Cc: Jonathan Corbet Suggested-by: Jonathan Corbet Signed-off-by: Min-Hua Chen Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230902052512.12184-4-minhuadotchen@gmail.com commit 006b84bcbe8dc0977fb788c458072be27801f4b7 Author: Min-Hua Chen Date: Sat Sep 2 13:25:11 2023 +0800 docs: sparse: convert sparse.txt to RST Follow Randy's advice [1] to move Documentation/translations/zh_TW/dev-tools/sparse.txt to Documentation/translations/zh_TW/dev-tools/sparse.rst [1] https://lore.kernel.org/lkml/bfab7c5b-e4d3-d8d9-afab-f43c0cdf26cf@infradead.org/ Suggested-by: Jonathan Corbet Suggested-by: Randy Dunlap Acked-by: Randy Dunlap Signed-off-by: Min-Hua Chen [jc: fixed htmldocs warning] Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230902052512.12184-3-minhuadotchen@gmail.com commit 253f68f413a87a4e2bd93e61b00410e5e1b7b774 Author: Min-Hua Chen Date: Sat Sep 2 13:25:10 2023 +0800 docs: sparse: move TW sparse.txt to TW dev-tools Follow Randy's advice [1] to move Documentation/translations/zh_TW/sparse.txt to Documentation/translations/zh_TW/dev-tools/sparse.txt [1] https://lore.kernel.org/lkml/bfab7c5b-e4d3-d8d9-afab-f43c0cdf26cf@infradead.org/ Cc: Randy Dunlap Suggested-by: Randy Dunlap Reviewed-by: Randy Dunlap Signed-off-by: Min-Hua Chen Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230902052512.12184-2-minhuadotchen@gmail.com commit ff0712ea71f173f4cc9a1d33a498cb0d05debdb3 Author: Matthew Wilcox (Oracle) Date: Thu Aug 24 20:36:44 2023 +0100 fork: Fix kernel-doc Fix the various warnings from kernel-doc in kernel/fork.c Signed-off-by: "Matthew Wilcox (Oracle)" Reviewed-by: Christian Brauner Acked-by: Randy Dunlap Tested-by: Randy Dunlap Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230824193644.3029141-1-willy@infradead.org commit 4d83d5cdfa1251bea0b88b15f8ad676a83275c11 Author: Fabio M. De Francesco Date: Fri Aug 18 13:19:34 2023 +0200 Documentation/page_tables: Add info about MMU/TLB and Page Faults Extend page_tables.rst by adding a section about the role of MMU and TLB in translating between virtual addresses and physical page frames. Furthermore explain the concept behind Page Faults and how the Linux kernel handles TLB misses. Finally briefly explain how and why to disable the page faults handler. Cc: Andrew Morton Cc: Ira Weiny Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Linus Walleij Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Randy Dunlap Reviewed-by: Linus Walleij Signed-off-by: "Fabio M. De Francesco" Acked-by: "Mike Rapoport (IBM)" Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230818112726.6156-1-fmdefrancesco@gmail.com commit f00c19c67a49f683e6a3aa19f546c37cf9344508 Author: Oliver Faso Date: Sun Sep 10 00:08:06 2023 -0400 docs/sphinx: Explicitly convert Sphinx paths to str Sphinx 7.2+ is switching to using pathlib.Path instead of str to represent paths. This fixes the current deprecation warnings and eventual breakage. This conversion will be a no-op when using older Sphinx versions. Signed-off-by: Oliver Faso Tested-by: Akira Yokosawa Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230910040811.53046-1-erer1243@gmail.com commit 3240c37567cccc5f3b08d96bf7ecd3b287da9ec0 Author: Uwe Kleine-König Date: Mon Sep 11 17:44:54 2023 +0200 pwm: Adapt sysfs API documentation to reality Most low-level PWM drivers support duty_cycle == period, and so does the sysfs API. Also polarity can be changed for enabled PWMs since commit 39100ceea79f ("pwm: Switch to the atomic API"). Reported-by: Jens Gehrlein Signed-off-by: Uwe Kleine-König Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230911154454.675057-1-u.kleine-koenig@pengutronix.de commit 02f9998754b05d417b0ebe6334d0ce5b84a31f44 Author: Mark Brown Date: Wed Sep 13 15:56:27 2023 +0100 docs: submitting-patches: Suggest a longer expected time for responses While some subsystems do typically have very fast turnaround times on review this is far from standard over the kernel and is likely to set unrealistic expectations for submitters. Tell submitters to expect 2-3 weeks instead, this will cover more of the kernel. Signed-off-by: Mark Brown Reviewed-by: Javier Martinez Canillas Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230913-submitting-patches-delay-v1-1-a2d48c5ca205@kernel.org commit 0f75d486b9eee143220ecd187139b8b894b3383c Author: Luca Weiss Date: Mon Oct 2 08:55:30 2023 +0200 dt-bindings: i2c: qcom-cci: Document SC7280 compatible Document the compatible for the CCI block found on SC7280 SoC. Reviewed-by: Bryan O'Donoghue Signed-off-by: Luca Weiss Acked-by: Conor Dooley Reviewed-by: Krzysztof Kozlowski Signed-off-by: Wolfram Sang commit 85c477011dd3f601ed050a859e74fe82d414a123 Author: Suraj Kandpal Date: Tue Oct 10 11:02:09 2023 +0530 drm/i915/display: Free crtc_state in verify_crtc_state Free hw_crtc_state in verify_crtc_state after we are done using this or else it's just a resource leak. Fixes: 2745bdda2095 ("drm/i915: Stop clobbering old crtc state during state check") Signed-off-by: Suraj Kandpal Reviewed-by: Ville Syrjälä Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231010053208.691260-1-suraj.kandpal@intel.com commit 52fee5c9158000db607d734383fd862969782de5 Author: Uwe Kleine-König Date: Mon Oct 9 17:59:45 2023 +0200 ASoC: SOF: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). The SOF platform drivers all use either sof_of_remove() or sof_acpi_remove() which both return zero unconditionally. Change these functions to return void and the drivers to use .remove_new(). There is no semantical change. Signed-off-by: Uwe Kleine-König Reviewed-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231009155945.285537-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 53a810ad3c5cde674cac71e629e6d10bfc9d838c Author: Ilkka Koskinen Date: Wed Sep 13 16:39:41 2023 -0700 perf: arm_cspmu: ampere_cspmu: Add support for Ampere SoC PMU Ampere SoC PMU follows CoreSight PMU architecture. It uses implementation specific registers to filter events rather than PMEVFILTnR registers. Signed-off-by: Ilkka Koskinen Link: https://lore.kernel.org/r/20230913233941.9814-5-ilkka@os.amperecomputing.com [will: Include linux/io.h in ampere_cspmu.c for writel()] Signed-off-by: Will Deacon commit 8bf914570650ec5858e18554d70d2838cef01de1 Author: Vinod Koul Date: Tue Oct 10 12:27:29 2023 +0530 dmaengine: mmp_tdma: drop unused variable 'of_id' Recent change a67ba97dfb30 ("dmaengine: Use device_get_match_data()") cleaned up device tree data calls but left an unused variable, so drop that Reported-by: Stephen Rothwell Fixes: a67ba97dfb30 ("dmaengine: Use device_get_match_data()") Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20231010065729.29385-1-vkoul@kernel.org Signed-off-by: Vinod Koul commit 7994db905c0fd692cf04c527585f08a91b560144 Author: Uwe Kleine-König Date: Sun Oct 1 19:02:54 2023 +0200 PCI: keystone: Don't discard .probe() callback The __init annotation makes the ks_pcie_probe() function disappear after booting completes. However a device can also be bound later. In that case, we try to call ks_pcie_probe(), but the backing memory is likely already overwritten. The right thing to do is do always have the probe callback available. Note that the (wrong) __refdata annotation prevented this issue to be noticed by modpost. Fixes: 0c4ffcfe1fbc ("PCI: keystone: Add TI Keystone PCIe driver") Link: https://lore.kernel.org/r/20231001170254.2506508-5-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit 200bddbb3f5202bbce96444fdc416305de14f547 Author: Uwe Kleine-König Date: Sun Oct 1 19:02:53 2023 +0200 PCI: keystone: Don't discard .remove() callback With CONFIG_PCIE_KEYSTONE=y and ks_pcie_remove() marked with __exit, the function is discarded from the driver. In this case a bound device can still get unbound, e.g via sysfs. Then no cleanup code is run resulting in resource leaks or worse. The right thing to do is do always have the remove callback available. Note that this driver cannot be compiled as a module, so ks_pcie_remove() was always discarded before this change and modpost couldn't warn about this issue. Furthermore the __ref annotation also prevents a warning. Fixes: 0c4ffcfe1fbc ("PCI: keystone: Add TI Keystone PCIe driver") Link: https://lore.kernel.org/r/20231001170254.2506508-4-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit 3064ef2e88c1629c1e67a77d7bc20020b35846f2 Author: Uwe Kleine-König Date: Sun Oct 1 19:02:52 2023 +0200 PCI: kirin: Don't discard .remove() callback With CONFIG_PCIE_KIRIN=y and kirin_pcie_remove() marked with __exit, the function is discarded from the driver. In this case a bound device can still get unbound, e.g via sysfs. Then no cleanup code is run resulting in resource leaks or worse. The right thing to do is do always have the remove callback available. This fixes the following warning by modpost: drivers/pci/controller/dwc/pcie-kirin: section mismatch in reference: kirin_pcie_driver+0x8 (section: .data) -> kirin_pcie_remove (section: .exit.text) (with ARCH=x86_64 W=1 allmodconfig). Fixes: 000f60db784b ("PCI: kirin: Add support for a PHY layer") Link: https://lore.kernel.org/r/20231001170254.2506508-3-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit 83a939f0fdc208ff3639dd3d42ac9b3c35607fd2 Author: Uwe Kleine-König Date: Sun Oct 1 19:02:51 2023 +0200 PCI: exynos: Don't discard .remove() callback With CONFIG_PCI_EXYNOS=y and exynos_pcie_remove() marked with __exit, the function is discarded from the driver. In this case a bound device can still get unbound, e.g via sysfs. Then no cleanup code is run resulting in resource leaks or worse. The right thing to do is do always have the remove callback available. This fixes the following warning by modpost: WARNING: modpost: drivers/pci/controller/dwc/pci-exynos: section mismatch in reference: exynos_pcie_driver+0x8 (section: .data) -> exynos_pcie_remove (section: .exit.text) (with ARCH=x86_64 W=1 allmodconfig). Fixes: 340cba6092c2 ("pci: Add PCIe driver for Samsung Exynos") Link: https://lore.kernel.org/r/20231001170254.2506508-2-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Bjorn Helgaas Reviewed-by: Alim Akhtar Cc: stable@vger.kernel.org commit e5f9d543419c78ac58f3b3557bc5a76b20ff600b Author: Klaus Goger Date: Mon Jan 31 17:47:22 2022 +0100 drm/panel: ltk050h3146w: add support for Leadtek LTK050H3148W-CTA6 variant The LTK050H3148W-CTA6 is a 5.0" 720x1280 DSI display, whose driving controller is a Himax HX8394-F, slightly different from LTK050H3146W by its init sequence, mode details and mode flags. Cc: Quentin Schulz Signed-off-by: Klaus Goger Signed-off-by: Quentin Schulz Reviewed-by: Paul Kocialkowski Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220131164723.714836-2-quentin.schulz@theobroma-systems.com commit 29d8e38c36cb662331a833699c359ec1af1edbec Author: Quentin Schulz Date: Mon Jan 31 17:47:23 2022 +0100 dt-bindings: ltk050h3146w: add compatible for LTK050H3148W-CTA6 variant The LTK050H3148W-CTA6 is a 5.0" 720x1280 DSI display, whose driving controller is a Himax HX8394-F, slightly different from LTK050H3146W by its init sequence, mode details and mode flags. Cc: Quentin Schulz Signed-off-by: Quentin Schulz Reviewed-by: Paul Kocialkowski Acked-by: Rob Herring Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220131164723.714836-3-quentin.schulz@theobroma-systems.com commit 99403d747ae8c7b3bfb5cd14c8908930ec6801c6 Author: Quentin Schulz Date: Mon Jan 31 17:47:21 2022 +0100 drm/panel: ltk050h3146w: add mipi_dsi_device.mode_flags to of_match_data To prepare for a new display to be supported by this driver which has a slightly different set of DSI mode related flags, let's move the currently hardcoded mode flags to the .data field of of_device_id structure. Cc: Quentin Schulz Signed-off-by: Quentin Schulz Reviewed-by: Paul Kocialkowski Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220131164723.714836-1-quentin.schulz@theobroma-systems.com commit c97d1b20d3835178bcd0e3a86c20ce4e36b6d80c Author: Yi Liu Date: Thu Sep 28 00:15:28 2023 -0700 iommu/vt-d: Add domain_alloc_user op Add the domain_alloc_user() op implementation. It supports allocating domains to be used as parent under nested translation. Unlike other drivers VT-D uses only a single page table format so it only needs to check if the HW can support nesting. Link: https://lore.kernel.org/r/20230928071528.26258-7-yi.l.liu@intel.com Signed-off-by: Yi Liu Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 408663619fcfc89c087df65b362c91bf0a0be617 Author: Yi Liu Date: Thu Sep 28 00:15:27 2023 -0700 iommufd/selftest: Add domain_alloc_user() support in iommu mock Add mock_domain_alloc_user() and a new test case for IOMMU_HWPT_ALLOC_NEST_PARENT. Link: https://lore.kernel.org/r/20230928071528.26258-6-yi.l.liu@intel.com Co-developed-by: Nicolin Chen Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 4ff542163397073f86eda484318d61980ff1031d Author: Yi Liu Date: Thu Sep 28 00:15:26 2023 -0700 iommufd: Support allocating nested parent domain Extend IOMMU_HWPT_ALLOC to allocate domains to be used as parent (stage-2) in nested translation. Add IOMMU_HWPT_ALLOC_NEST_PARENT to the uAPI. Link: https://lore.kernel.org/r/20230928071528.26258-5-yi.l.liu@intel.com Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Reviewed-by: Lu Baolu Signed-off-by: Jason Gunthorpe commit 89d63875d80ea127280c60dd4cd101af1d9b6557 Author: Yi Liu Date: Thu Sep 28 00:15:25 2023 -0700 iommufd: Flow user flags for domain allocation to domain_alloc_user() Extends iommufd_hw_pagetable_alloc() to accept user flags, the uAPI will provide the flags. Link: https://lore.kernel.org/r/20230928071528.26258-4-yi.l.liu@intel.com Reviewed-by: Kevin Tian Signed-off-by: Yi Liu Reviewed-by: Lu Baolu Signed-off-by: Jason Gunthorpe commit 7975b722087fa23ff3ad1ff4998b8572a7e17e84 Author: Yi Liu Date: Thu Sep 28 00:15:24 2023 -0700 iommufd: Use the domain_alloc_user() op for domain allocation Make IOMMUFD use iommu_domain_alloc_user() by default for iommu_domain creation. IOMMUFD needs to support iommu_domain allocation with parameters from userspace in nested support, and a driver is expected to implement everything under this op. If the iommu driver doesn't provide domain_alloc_user callback then IOMMUFD falls back to use iommu_domain_alloc() with an UNMANAGED type if possible. Link: https://lore.kernel.org/r/20230928071528.26258-3-yi.l.liu@intel.com Suggested-by: Jason Gunthorpe Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Co-developed-by: Nicolin Chen Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu Signed-off-by: Jason Gunthorpe commit 909f4abd1097769d024c3a9c2e59c2fbe5d2d0c0 Author: Yi Liu Date: Thu Sep 28 00:15:23 2023 -0700 iommu: Add new iommu op to create domains owned by userspace Introduce a new iommu_domain op to create domains owned by userspace, e.g. through IOMMUFD. These domains have a few different properties compares to kernel owned domains: - They may be PAGING domains, but created with special parameters. For instance aperture size changes/number of levels, different IOPTE formats, or other things necessary to make a vIOMMU work - We have to track all the memory allocations with GFP_KERNEL_ACCOUNT to make the cgroup sandbox stronger - Device-specialty domains, such as NESTED domains can be created by IOMMUFD. The new op clearly says the domain is being created by IOMMUFD, that the domain is intended for userspace use, and it provides a way to pass user flags or a driver specific uAPI structure to customize the created domain to exactly what the vIOMMU userspace driver requires. iommu drivers that cannot support VFIO/IOMMUFD should not support this op. This includes any driver that cannot provide a fully functional PAGING domain. This new op for now is only supposed to be used by IOMMUFD, hence no wrapper for it. IOMMUFD would call the callback directly. As for domain free, IOMMUFD would use iommu_domain_free(). Link: https://lore.kernel.org/r/20230928071528.26258-2-yi.l.liu@intel.com Suggested-by: Jason Gunthorpe Signed-off-by: Lu Baolu Co-developed-by: Nicolin Chen Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit 8097dbd4b631b1f4cfe3def909f828b071d99ad7 Merge: 9aaa25df9b02b a4f7ef6db7419 Author: Mark Brown Date: Tue Oct 10 17:23:42 2023 +0100 spi: Add RZ/V2M CSI target support Merge series from Fabrizio Castro : The CSI IP found inside the Renesas RZ/V2M SoC supports both SPI host and target. This series extends the CSI dt-bindings and driver to add SPI target support. commit 163284402c42e9094b6aa8e4f69e43da1031efc6 Merge: 3c716e7f8acd0 1e50ac48d20c6 Author: Mark Brown Date: Tue Oct 10 17:23:26 2023 +0100 ASoC: mediatek: mt8188-mt6359: add rt5682s support Merge series from xiazhengqiao : To use RT5682S as the codec and MAX98390 as the amp, add a new sound card named mt8188_rt5682s. commit 3c716e7f8acd039864b17f63d8506862b8c63f82 Merge: 4a221b2e3340f 99d426c6dd2d6 Author: Mark Brown Date: Tue Oct 10 17:07:17 2023 +0100 ASoC: Merge fixes for consistent cs42l43 schema We have adjacent changes for the cs42l43 DT schema, merge the fixes branch up so that there's a single thing for people to base future changes on. commit 3c2508d3ce5764d1daea0a580cf11f35bd4f2801 Author: Maxim Schwalm Date: Mon Aug 7 17:35:11 2023 +0300 ARM: tegra: Drop unit-address from parallel RGB output port Fix the following W=1 build warning: "Warning (unit_address_vs_reg): /host1x@50000000/dc@54200000/rgb/port@0: node has a unit name, but no reg or ranges property" Signed-off-by: Maxim Schwalm Signed-off-by: Svyatoslav Ryhel Signed-off-by: Thierry Reding commit 81ef01bc5934f46204a199cd0e37d3fb2b10f342 Author: Guanhua Gao Date: Tue Sep 26 10:04:45 2023 -0400 PCI: layerscape-ep: Set 64-bit DMA mask Set DMA mask and coherent DMA mask to enable 64-bit addressing. Link: https://lore.kernel.org/r/20230926140445.3855365-1-Frank.Li@nxp.com Signed-off-by: Guanhua Gao Signed-off-by: Hou Zhiqiang Signed-off-by: Frank Li Signed-off-by: Lorenzo Pieralisi Reviewed-by: Christoph Hellwig Acked-by: Manivannan Sadhasivam Acked-by: Roy Zang commit 0434281722b5192f4c5f60ff891f98f95057a793 Author: Thierry Reding Date: Wed Jul 26 18:27:44 2023 +0200 dt-bindings: arm: tegra: pmc: Relicense and move into soc/tegra directory Dual-license this binding for consistency with other Tegra bindings and move it into the soc/tegra directory. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit bc41c461a098224b3ed064a34d8aa7b500064bb7 Author: Thierry Reding Date: Wed Jul 26 18:27:43 2023 +0200 dt-bindings: arm: tegra: pmc: Reformat example Reformat the example using 4 spaces for indentation. Acked-by: Rob Herring Signed-off-by: Thierry Reding commit b361a6f473f082f5c13c78d51b33ee0bc2422dc9 Author: Thierry Reding Date: Wed Jul 26 18:27:42 2023 +0200 dt-bindings: arm: tegra: pmc: Restructure pad configuration node schema The pad configuration node schema in its current form can accidentally match other properties as well. Restructure the schema to better match how the device trees are using these. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit fd8d26ad0849519f692edc43faea8e2540c28052 Author: Thierry Reding Date: Wed Jul 26 18:27:41 2023 +0200 dt-bindings: arm: tegra: pmc: Increase maximum number of clocks per powergate Some powergate definitions need more than 8 clocks, so bump the number up to 10, which is the current maximum in any known device tree file. Acked-by: Rob Herring Signed-off-by: Thierry Reding commit 54a195162eb6cf4dac451623dd4e19ecad9a21ea Author: Thierry Reding Date: Wed Jul 26 18:27:40 2023 +0200 dt-bindings: arm: tegra: pmc: Move additionalProperties For indented subschemas it can be difficult to understand which block an additionalProperties property belongs to. Moving it closer to the beginning of a block is a good way to clarify this. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit d330a6872686960878ae46db4728b97d7b42d1a6 Author: Thierry Reding Date: Wed Jul 26 18:27:39 2023 +0200 dt-bindings: arm: tegra: pmc: Remove useless boilerplate descriptions The descriptions for the clocks and resets properties are no longer useful in the context of json-schema, so drop them. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit bbcab224f9eb366ea9592c89b1b5ec9f6e9a027a Author: Thierry Reding Date: Wed Jul 26 18:27:38 2023 +0200 dt-bindings: arm: tegra: pmc: Improve property descriptions Reformat the description of various properties to make them more consistent with existing ones. Make use of json-schema's ability to provide a description for individual list items to make improve the documentation further. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit 5023dfa6d5e0f833a21d93a7acbf300511855e75 Author: Thierry Reding Date: Thu Aug 17 16:14:07 2023 +0200 arm64: tegra: Mark Tegra234 SPI as compatible with Tegra114 According to the bindings, both Tegra210 and Tegra114 compatible strings need to be specified since the version of this hardware block found in Tegra210 is backwards-compatible. Signed-off-by: Thierry Reding commit ea314b01f7d9cec17d01ecbdfca3f2fd2530415f Author: Thierry Reding Date: Thu Aug 17 16:14:06 2023 +0200 arm64: tegra: Add dmas and dma-names for Tegra234 UARTE Commit 940acdac99b2 ("arm64: tegra: Add UARTE device tree node on Tegra234") added the device tree node for the UARTE on Tegra234 but didn't include the "dmas" and "dma-names" properties required for this device when it's used in high-speed mode. Signed-off-by: Thierry Reding commit 036f15c24888cb823e3cb47e7bdffd827387518e Author: Thierry Reding Date: Thu Aug 17 16:14:05 2023 +0200 arm64: tegra: Use correct format for clocks property phandle and clock specifier pairs should be enclosed in angular brackets. Signed-off-by: Thierry Reding commit 4bf7fa33d10b99b4cc9ac15693128ef2ced7142c Author: Thierry Reding Date: Thu Aug 17 16:14:04 2023 +0200 arm64: tegra: Remove duplicate nodes on Jetson Orin NX The SBSA UART and TCU as well as the TCU alias and the stdout-path are configured via the P3768 carrier board DTS include, so the can be removed from the system DTS file. Signed-off-by: Thierry Reding commit f7a9a7d9e924fe103f935511a16b9701623b90dc Author: Thierry Reding Date: Thu Aug 17 16:14:03 2023 +0200 arm64: tegra: Add missing current-speed for SBSA UART The SBSA UART device tree bindings require a current-speed property that specifies the baud rate configured by the firmware. Add it on Jetson AGX Orin and Jetson Orin Nano/NX. Signed-off-by: Thierry Reding commit ed80bb23508abe10a5e071dda46ac48ff05e27f9 Author: Diogo Ivo Date: Mon Aug 7 14:33:05 2023 +0100 arm64: tegra: Add display panel node on Smaug The Google Pixel C has a JDI LPM102A188A display panel, so add a DT node for it. Signed-off-by: Diogo Ivo Signed-off-by: Thierry Reding commit a64bec31558be1baab63bbd5fe77de7c6b7c5a8c Author: Diogo Ivo Date: Mon Aug 7 14:33:04 2023 +0100 arm64: tegra: Add backlight node on Smaug The Google Pixel C has a TI LP8557 backlight controller, so add a DT node for it. Signed-off-by: Diogo Ivo Signed-off-by: Thierry Reding commit 6a4908de6a21d860dbe0c6860903e994fdd6ff7b Author: Diogo Ivo Date: Mon Aug 7 14:33:03 2023 +0100 arm64: tegra: Add DSI/CSI regulator on Smaug Add the node for the DSI/CSI regulator in the Pixel C. Signed-off-by: Diogo Ivo Signed-off-by: Thierry Reding commit 0cb028a2a412b7925c387b202cf562e78183425a Author: Rayyan Ansari Date: Thu Aug 10 22:45:41 2023 +0100 arm64: tegra: Enable IOMMU for host1x on Tegra132 Add the iommu property to the host1x node to register it with its swgroup. Signed-off-by: Rayyan Ansari Signed-off-by: Thierry Reding commit 57ea99ba176913c325fc8324a24a1b5e8a6cf520 Author: Brad Griffis Date: Mon Jun 26 18:09:20 2023 +0000 arm64: tegra: Fix P3767 QSPI speed The QSPI device used on Jetson Orin NX and Nano modules (p3767) is the same as Jetson AGX Orin (p3701) and should have a maximum speed of 102 MHz. Fixes: 13b0aca303e9 ("arm64: tegra: Support Jetson Orin NX") Signed-off-by: Brad Griffis Signed-off-by: Thierry Reding commit c6b7a1d11d0fa6333078141251908f48042016e1 Author: Brad Griffis Date: Mon Jun 26 18:09:19 2023 +0000 arm64: tegra: Fix P3767 card detect polarity The SD card detect pin is active-low on all Orin Nano and NX SKUs that have an SD card slot. Fixes: 13b0aca303e9 ("arm64: tegra: Support Jetson Orin NX") Signed-off-by: Brad Griffis Signed-off-by: Thierry Reding commit 44d8c4d516d951ac29a5f2cab7788002d6a77211 Author: Dmitry Baryshkov Date: Tue Oct 10 08:49:20 2023 +0300 drm/msm: fix fault injection support Readd the header that was erroneously dropped during KMS code refactoring. Fixes: 506efcba3129 ("drm/msm: carve out KMS code from msm_drv.c") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310100836.6E6zjEcE-lkp@intel.com/ Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561739/ Signed-off-by: Rob Clark commit 94ecde833be5779f8086c3a094dfa51e1dbce75f Author: George Guo Date: Mon Oct 9 10:55:48 2023 +0800 netfilter: cleanup struct nft_table Add comments for nlpid, family, udlen and udata in struct nft_table, and afinfo is no longer a member of struct nft_table, so remove the comment for it. Signed-off-by: George Guo Signed-off-by: Florian Westphal commit 6ac9c51eebe8209f58fd71f51c856184136b8613 Author: Florian Westphal Date: Fri Oct 6 11:28:47 2023 +0200 netfilter: conntrack: prefer tcp_error_log to pr_debug pr_debug doesn't provide any information other than that a packet did not match existing state but also was found to not create a new connection. Replaces this with tcp_error_log, which will also dump packets' content so one can see if this is a stray FIN or RST. Signed-off-by: Florian Westphal commit 8a23f4ab92f9b7f258ca28cce2e34b80f56ab9d1 Author: Florian Westphal Date: Fri Oct 6 11:27:29 2023 +0200 netfilter: conntrack: simplify nf_conntrack_alter_reply nf_conntrack_alter_reply doesn't do helper reassignment anymore. Remove the comments that make this claim. Furthermore, remove dead code from the function and place ot in nf_conntrack.h. Signed-off-by: Florian Westphal commit 99ab9f84b85ec3eec099278bff61269ad0b078ce Author: Phil Sutter Date: Fri Sep 29 21:19:22 2023 +0200 netfilter: nf_tables: Don't allocate nft_rule_dump_ctx Since struct netlink_callback::args is not used by rule dumpers anymore, use it to hold nft_rule_dump_ctx. Add a build-time check to make sure it won't ever exceed the available space. Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal commit 8194d599bc01bc6e89b14af436803cf90d0a8650 Author: Phil Sutter Date: Fri Sep 29 21:19:21 2023 +0200 netfilter: nf_tables: Carry s_idx in nft_rule_dump_ctx In order to move the context into struct netlink_callback's scratch area, the latter must be unused first. Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal commit 405c8fd62d612dd0e1d5ca59903449616453a56d Author: Phil Sutter Date: Fri Sep 29 21:19:20 2023 +0200 netfilter: nf_tables: Carry reset flag in nft_rule_dump_ctx This relieves the dump callback from having to check nlmsg_type upon each call and instead performs the check once in .start callback. Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal commit 30fa41a0f6df4c85790cc6499ddc4a926a113bfa Author: Phil Sutter Date: Fri Sep 29 21:19:19 2023 +0200 netfilter: nf_tables: Drop pointless memset when dumping rules None of the dump callbacks uses netlink_callback::args beyond the first element, no need to zero the data. Fixes: 96518518cc41 ("netfilter: add nftables") Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal commit 4a8e65b0c348e42107c64381e692e282900be361 Author: Frederic Weisbecker Date: Wed Oct 4 01:28:59 2023 +0200 srcu: Fix callbacks acceleration mishandling SRCU callbacks acceleration might fail if the preceding callbacks advance also fails. This can happen when the following steps are met: 1) The RCU_WAIT_TAIL segment has callbacks (say for gp_num 8) and the RCU_NEXT_READY_TAIL also has callbacks (say for gp_num 12). 2) The grace period for RCU_WAIT_TAIL is observed as started but not yet completed so rcu_seq_current() returns 4 + SRCU_STATE_SCAN1 = 5. 3) This value is passed to rcu_segcblist_advance() which can't move any segment forward and fails. 4) srcu_gp_start_if_needed() still proceeds with callback acceleration. But then the call to rcu_seq_snap() observes the grace period for the RCU_WAIT_TAIL segment (gp_num 8) as completed and the subsequent one for the RCU_NEXT_READY_TAIL segment as started (ie: 8 + SRCU_STATE_SCAN1 = 9) so it returns a snapshot of the next grace period, which is 16. 5) The value of 16 is passed to rcu_segcblist_accelerate() but the freshly enqueued callback in RCU_NEXT_TAIL can't move to RCU_NEXT_READY_TAIL which already has callbacks for a previous grace period (gp_num = 12). So acceleration fails. 6) Note in all these steps, srcu_invoke_callbacks() hadn't had a chance to run srcu_invoke_callbacks(). Then some very bad outcome may happen if the following happens: 7) Some other CPU races and starts the grace period number 16 before the CPU handling previous steps had a chance. Therefore srcu_gp_start() isn't called on the latter sdp to fix the acceleration leak from previous steps with a new pair of call to advance/accelerate. 8) The grace period 16 completes and srcu_invoke_callbacks() is finally called. All the callbacks from previous grace periods (8 and 12) are correctly advanced and executed but callbacks in RCU_NEXT_READY_TAIL still remain. Then rcu_segcblist_accelerate() is called with a snaphot of 20. 9) Since nothing started the grace period number 20, callbacks stay unhandled. This has been reported in real load: [3144162.608392] INFO: task kworker/136:12:252684 blocked for more than 122 seconds. [3144162.615986] Tainted: G O K 5.4.203-1-tlinux4-0011.1 #1 [3144162.623053] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [3144162.631162] kworker/136:12 D 0 252684 2 0x90004000 [3144162.631189] Workqueue: kvm-irqfd-cleanup irqfd_shutdown [kvm] [3144162.631192] Call Trace: [3144162.631202] __schedule+0x2ee/0x660 [3144162.631206] schedule+0x33/0xa0 [3144162.631209] schedule_timeout+0x1c4/0x340 [3144162.631214] ? update_load_avg+0x82/0x660 [3144162.631217] ? raw_spin_rq_lock_nested+0x1f/0x30 [3144162.631218] wait_for_completion+0x119/0x180 [3144162.631220] ? wake_up_q+0x80/0x80 [3144162.631224] __synchronize_srcu.part.19+0x81/0xb0 [3144162.631226] ? __bpf_trace_rcu_utilization+0x10/0x10 [3144162.631227] synchronize_srcu+0x5f/0xc0 [3144162.631236] irqfd_shutdown+0x3c/0xb0 [kvm] [3144162.631239] ? __schedule+0x2f6/0x660 [3144162.631243] process_one_work+0x19a/0x3a0 [3144162.631244] worker_thread+0x37/0x3a0 [3144162.631247] kthread+0x117/0x140 [3144162.631247] ? process_one_work+0x3a0/0x3a0 [3144162.631248] ? __kthread_cancel_work+0x40/0x40 [3144162.631250] ret_from_fork+0x1f/0x30 Fix this with taking the snapshot for acceleration _before_ the read of the current grace period number. The only side effect of this solution is that callbacks advancing happen then _after_ the full barrier in rcu_seq_snap(). This is not a problem because that barrier only cares about: 1) Ordering accesses of the update side before call_srcu() so they don't bleed. 2) See all the accesses prior to the grace period of the current gp_num The only things callbacks advancing need to be ordered against are carried by snp locking. Reported-by: Yong He Co-developed-by:: Yong He Signed-off-by: Yong He Co-developed-by: Joel Fernandes (Google) Signed-off-by: Joel Fernandes (Google) Co-developed-by: Neeraj upadhyay Signed-off-by: Neeraj upadhyay Link: http://lore.kernel.org/CANZk6aR+CqZaqmMWrC2eRRPY12qAZnDZLwLnHZbNi=xXMB401g@mail.gmail.com Fixes: da915ad5cf25 ("srcu: Parallelize callback handling") Signed-off-by: Frederic Weisbecker commit afed2b54c5403393986c3b3555152dfd4ab7998a Author: Phil Sutter Date: Fri Sep 29 21:19:18 2023 +0200 netfilter: nf_tables: Always allocate nft_rule_dump_ctx It will move into struct netlink_callback's scratch area later, just put nf_tables_dump_rules_start in shape to reduce churn later. Suggested-by: Pablo Neira Ayuso Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal commit a2b8fa785358f699e9736718f430cddf596cd79e Author: Rob Herring Date: Fri Oct 6 17:43:43 2023 -0500 mmc: jz4740: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Paul Cercueil Link: https://lore.kernel.org/r/20231006224343.441720-1-robh@kernel.org Signed-off-by: Ulf Hansson commit 0ebebb21c48408bfa96a6fb18aa1a5bb543e2312 Author: Tomer Maimon Date: Mon Oct 2 23:06:10 2023 +0300 mmc: sdhci-npcm: Add NPCM SDHCI driver Add Nuvoton NPCM BMC sdhci-pltfm controller driver. Signed-off-by: Tomer Maimon Acked-by: Adrian Hunter Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231002200610.129799-3-tmaimon77@gmail.com Signed-off-by: Ulf Hansson commit 4436673a4fe1e83520589f4f05235a510f82f637 Author: Tomer Maimon Date: Mon Oct 2 23:06:09 2023 +0300 dt-bindings: mmc: npcm,sdhci: Document NPCM SDHCI controller Add binding for Nuvoton NPCM SDHCI controller. Signed-off-by: Tomer Maimon Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20231002200610.129799-2-tmaimon77@gmail.com Signed-off-by: Ulf Hansson commit c341ac65bf2bf297a6e4db61c34c00971876fad6 Author: Uwe Kleine-König Date: Mon Oct 9 18:25:10 2023 +0200 pinctrl: sprd-sc9860: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). To convert the sprd-sc9860 driver, make sprd_pinctrl_remove() return void (instead of zero) and use .remove_new as callback. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009162510.335208-4-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 22ee670a8ad3ec7cd9d872d4512fe8797130e191 Author: Uwe Kleine-König Date: Mon Oct 9 18:25:09 2023 +0200 pinctrl: qcom/msm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). To convert all those qcom pinctrl drivers, make msm_pinctrl_remove() return void (instead of zero) and use .remove_new in all drivers. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009162510.335208-3-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 776d54c137a38f99701fa5cc65d947244dda1b78 Author: Uwe Kleine-König Date: Mon Oct 9 18:25:08 2023 +0200 pinctrl: qcom/lpi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). To convert all those qcom pinctrl drivers, make msm_pinctrl_remove() return void (instead of zero) and use .remove_new in all drivers. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009162510.335208-2-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 4261ff59f4be26fb4a553c6e916852221fae4477 Author: Andy Shevchenko Date: Fri Oct 6 13:58:03 2023 +0300 mmc: sdhci-pltfm: Make driver OF independent Since we have device_is_compatible() API, drop OF dependency in the driver. Signed-off-by: Andy Shevchenko Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20231006105803.3374241-2-andriy.shevchenko@linux.intel.com Signed-off-by: Ulf Hansson commit 34457e4e0c15ad5bcd8eb4e8a728e750bb020288 Author: Andy Shevchenko Date: Fri Oct 6 13:58:02 2023 +0300 mmc: sdhci-pltfm: Drop unnecessary error messages in sdhci_pltfm_init() The devm_platform_ioremap_resource() and platform_get_irq() print the error messages themselves and our "failed" one brings no value and just noise. Refactor code to avoid those noisy error messages. Signed-off-by: Andy Shevchenko Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20231006105803.3374241-1-andriy.shevchenko@linux.intel.com Signed-off-by: Ulf Hansson commit a30c6251859cf93700c2294b65706046bac29e55 Author: Andy Shevchenko Date: Mon Oct 2 16:51:03 2023 +0300 mmc: sdhci-pci: Switch to use acpi_evaluate_dsm_typed() The acpi_evaluate_dsm_typed() provides a way to check the type of the object evaluated by _DSM call. Use it instead of open coded variant. Signed-off-by: Andy Shevchenko Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20231002135103.2602847-1-andriy.shevchenko@linux.intel.com Signed-off-by: Ulf Hansson commit 93650550dff9d1a3b88c553f8adb81dc89778977 Author: Uwe Kleine-König Date: Mon Oct 9 10:38:56 2023 +0200 pinctrl: ti: ti-iodelay: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-21-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit a80252efb5d539b292433189f282f80aabaa53b1 Author: Uwe Kleine-König Date: Mon Oct 9 10:38:54 2023 +0200 pinctrl: qcom: ssbi-mpp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-19-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit a37b06133aa426f83d8f6497785dd93b30a5bc5e Author: Uwe Kleine-König Date: Mon Oct 9 10:38:53 2023 +0200 pinctrl: qcom: ssbi-gpio: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-18-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit ab06ab84065facb985b340871b3bde957298c156 Author: Uwe Kleine-König Date: Mon Oct 9 10:38:52 2023 +0200 pinctrl: qcom: spmi-mpp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-17-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 348e1488ba5cd55f5f7d96e5ab3672b44dc1adb0 Author: Uwe Kleine-König Date: Mon Oct 9 10:38:51 2023 +0200 pinctrl: qcom: spmi-gpio: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-16-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 14a16555e7f72ae764fda4ae912a2574eb95883b Author: Uwe Kleine-König Date: Mon Oct 9 10:38:50 2023 +0200 pinctrl: tb10x: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-15-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 86bc4c7f9e12b7fdc0b7e33e25faafe19ef2389b Author: Uwe Kleine-König Date: Mon Oct 9 10:38:49 2023 +0200 pinctrl: stmfx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-14-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit a6992a0d313564ba7ec003b5f3ddabeb2c043ea6 Author: Uwe Kleine-König Date: Mon Oct 9 10:38:48 2023 +0200 pinctrl: single: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-13-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 9725877765f8ce8b60a688d8a11d55b585020ded Author: Uwe Kleine-König Date: Mon Oct 9 10:38:47 2023 +0200 pinctrl: rockchip: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20231009083856.222030-12-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit f0c39588005314105d759de487b64883341b7bd8 Author: Uwe Kleine-König Date: Mon Oct 9 10:38:46 2023 +0200 pinctrl: as3722: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-11-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit b340412a8756ba421f9a7a1e10415ac449e78c22 Author: Uwe Kleine-König Date: Mon Oct 9 10:38:45 2023 +0200 pinctrl: artpec6: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jesper Nilsson Link: https://lore.kernel.org/r/20231009083856.222030-10-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 23a35fd90cc568b3a4f412c9f12c5951b99ebb67 Author: Uwe Kleine-König Date: Mon Oct 9 10:38:44 2023 +0200 pinctrl: amd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-9-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit a304b56f42dcd3662117e7dc45c676d13e0dbd75 Author: Uwe Kleine-König Date: Mon Oct 9 10:38:43 2023 +0200 pinctrl: nomadik: abx500: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-8-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 9eb95648f1441555a0b15325703f57e0ff9400a4 Author: Uwe Kleine-König Date: Mon Oct 9 10:38:40 2023 +0200 pinctrl: cirrus: madera-core: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20231009083856.222030-5-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 88b3f108502bc45e6ebd005702add46759f3f45a Author: Uwe Kleine-König Date: Mon Oct 9 10:38:39 2023 +0200 pinctrl: ti: ti-iodelay: Drop if block with always false condition ti_iodelay_remove() is only called after ti_iodelay_probe() completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so platform_get_drvdata() won't return NULL. Simplify by removing the if block with the always false condition. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-4-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 71e670266780e66207b9b4ea6a20f335039bf975 Author: Uwe Kleine-König Date: Mon Oct 9 10:38:38 2023 +0200 pinctrl: single: Drop if block with always false condition pcs_remove() is only called after pcs_probe() completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so platform_get_drvdata() won't return NULL. Simplify by removing the if block with the always false condition. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-3-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 35df4b75bd57e0699d0a1ff696880dcbd7e565f2 Author: Uwe Kleine-König Date: Mon Oct 9 10:38:37 2023 +0200 pinctrl: stmfx: Improve error message in .remove()'s error path The driver core has no handling for errors returned by the .remove() callback. The only action on error is a dev_warn() with generic error message that the returned value is returned. Replace it by a more specific and useful message. Then returning zero is the right thing to do, the only effect is to suppress the core's warning. This prepares the driver for the conversion to .remove_new(). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20231009083856.222030-2-u.kleine-koenig@pengutronix.de Signed-off-by: Linus Walleij commit 46da7fda11ae0f237df75144248fcdf561c48634 Author: Fabio Estevam Date: Sat Oct 7 14:18:05 2023 -0300 ARM: dts: imx7d-pico-pi: Disable USDHC1 The imx7d-pico-pi board does not have an SD card slot connected to the USDHC1 port. Only eMMC and Wifi SDIO ports are used. Disable the USDHC1 node. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit c62ca4358ba2d2167af8bf61501da3e1635ab672 Author: Fabio Estevam Date: Sun Oct 1 23:00:23 2023 -0300 ARM: dts: imx28: Fix dcp compatible Per fsl-dcp.yaml, passing "fsl,imx28-dcp", "fsl,imx23-dcp" is not valid. Change it to pass only "fsl,imx28-dcp" to fix the following schema warning: crypto@80028000: compatible: 'oneOf' conditional failed, one must be fixed: ['fsl,imx28-dcp', 'fsl,imx23-dcp'] is too long 'fsl,imx28-dcp' is not one of ['fsl,imx6sl-dcp', 'fsl,imx6ull-dcp'] 'fsl,imx28-dcp' was expected Signed-off-by: Fabio Estevam Reviewed-by: Stefan Wahren Signed-off-by: Shawn Guo commit 10c48e20633d5428fbd75d53ce45fdcc7b26c21c Author: Fabio Estevam Date: Sat Sep 30 09:42:21 2023 -0300 ARM: dts: imx7s: Remove #power-domain-cells from gpcv2 Per fsl,imx-gpcv2.yaml, '#power-domain-cells' is not a valid property for the top-level gpcv2 node. It is only valid for its children nodes. Remove it to fix the following schema warning: gpc@303a0000: '#power-domain-cells' does not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/power/fsl,imx-gpcv2.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 2b5513f9ecd96e6e42f68cac325a84c357722096 Author: Fabio Estevam Date: Thu Sep 28 23:01:42 2023 -0300 ARM: dts: imx25: Remove clock-names from the watchdog Per fsl-imx-wdt, 'clock-names' is not a valid property. Remove it to fix the following schema warning: watchdog@53fdc000: Unevaluated properties are not allowed ('clock-names' was unexpected) from schema $id: http://devicetree.org/schemas/watchdog/fsl-imx-wdt.yaml Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 65cdbcfefb755d88cfdc54cfa320120630f5d527 Author: Fabio Estevam Date: Wed Sep 27 17:33:18 2023 -0300 ARM: dts: imx25: Fix sram node Per sram.yaml, address-cells, size-cells and ranges are mandatory. Pass them to fix the following schema warnings: sram@78000000: '#address-cells' is a required property from schema $id: http://devicetree.org/schemas/sram/sram.yaml# sram@78000000: '#size-cells' is a required property from schema $id: http://devicetree.org/schemas/sram/sram.yaml# sram@78000000: 'ranges' is a required property from schema $id: http://devicetree.org/schemas/sram/sram.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 37abd3b2c7ce404541850938f3577605c4e5cb13 Author: Fabio Estevam Date: Wed Sep 27 17:24:00 2023 -0300 ARM: dts: imx25: Fix dryice node Per imxdi-rtc.yaml, there is only one valid compatible entry and clock-names is not a valid property. Change it to fix the following schema warnings: dryice@53ffc000: compatible: ['fsl,imx25-dryice', 'fsl,imx25-rtc'] is too long from schema $id: http://devicetree.org/schemas/rtc/imxdi-rtc.yaml# dryice@53ffc000: 'clock-names' does not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/rtc/imxdi-rtc.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 6774b7fa28112cd6226025cd5fbd21484f78f765 Author: Tim Harvey Date: Tue Sep 26 12:41:10 2023 -0700 ARM: dts: imx6qdl-gw5904: add dt props for populating eth MAC addrs Add device-tree props to allow boot firmware to populate MAC addresses. Signed-off-by: Tim Harvey Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit a7ee832b3b9654a494a5a28fcf1f56d8915bad4e Author: Fabio Estevam Date: Tue Sep 26 11:40:04 2023 -0300 ARM: dts: vfxxx: Write dmas in a single line There is no need to split dmas in two lines. Make it more readable by writing it in a single line. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 48525fd1ea1cfa059a580e77b10ea8790914efa2 Author: Thomas Gleixner Date: Mon Aug 14 10:18:47 2023 +0200 x86/cpu: Provide debug interface Provide debug files which dump the topology related information of cpuinfo_x86. This is useful to validate the upcoming conversion of the topology evaluation for correctness or bug compatibility. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085113.353191313@linutronix.de commit 90781f0c4c41a41043e39d9acbc66cc3644769ba Author: Thomas Gleixner Date: Mon Aug 14 10:18:46 2023 +0200 x86/cpu/topology: Cure the abuse of cpuinfo for persisting logical ids Per CPU cpuinfo is used to persist the logical package and die IDs. That's really not the right place simply because cpuinfo is subject to be reinitialized when a CPU goes through an offline/online cycle. This works by chance today, but that's far from correct and neither obvious nor documented. Add a per cpu datastructure which persists those logical IDs, which allows to cleanup the CPUID evaluation code. This is a temporary workaround until the larger topology management is in place, which makes all of this logical management mechanics obsolete. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085113.292947071@linutronix.de commit db4a4086a223bd5cbfa5a66701c493124d808d55 Author: Thomas Gleixner Date: Mon Aug 14 10:18:45 2023 +0200 x86/apic: Use u32 for wakeup_secondary_cpu[_64]() APIC IDs are used with random data types u16, u32, int, unsigned int, unsigned long. Make it all consistently use u32 because that reflects the hardware register width. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Reviewed-by: Arjan van de Ven Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085113.233274223@linutronix.de commit 59f7928cd46316371bee71b0cb34e133567e5b35 Author: Thomas Gleixner Date: Mon Aug 14 10:18:44 2023 +0200 x86/apic: Use u32 for [gs]et_apic_id() APIC IDs are used with random data types u16, u32, int, unsigned int, unsigned long. Make it all consistently use u32 because that reflects the hardware register width. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085113.172569282@linutronix.de commit 01ccf9bbd25fa32baa6ed8ae16700cf2e4487cf5 Author: Thomas Gleixner Date: Mon Aug 14 10:18:43 2023 +0200 x86/apic: Use u32 for phys_pkg_id() APIC IDs are used with random data types u16, u32, int, unsigned int, unsigned long. Make it all consistently use u32 because that reflects the hardware register width even if that callback going to be removed soonish. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Reviewed-by: Arjan van de Ven Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085113.113097126@linutronix.de commit 8aa2a4178dc535591ac0c17de45b14fe7f6a05c7 Author: Thomas Gleixner Date: Mon Aug 14 10:18:42 2023 +0200 x86/apic: Use u32 for cpu_present_to_apicid() APIC IDs are used with random data types u16, u32, int, unsigned int, unsigned long. Make it all consistently use u32 because that reflects the hardware register width and fixup a few related usage sites for consistency sake. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Reviewed-by: Arjan van de Ven Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085113.054064391@linutronix.de commit 5d376b8fb165eca33ea166ee43a637c8e912abd4 Author: Thomas Gleixner Date: Mon Aug 14 10:18:41 2023 +0200 x86/apic: Use u32 for check_apicid_used() APIC IDs are used with random data types u16, u32, int, unsigned int, unsigned long. Make it all consistently use u32 because that reflects the hardware register width and move the default implementation to local.h as there are no users outside the apic directory. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Reviewed-by: Arjan van de Ven Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.981956102@linutronix.de commit 4705243d237ab6abd8696e9672ad3fb36587c6f6 Author: Thomas Gleixner Date: Mon Aug 14 10:18:40 2023 +0200 x86/apic: Use u32 for APIC IDs in global data APIC IDs are used with random data types u16, u32, int, unsigned int, unsigned long. Make it all consistently use u32 because that reflects the hardware register width and fixup the most obvious usage sites of that. The APIC callbacks will be addressed separately. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Reviewed-by: Arjan van de Ven Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.922905727@linutronix.de commit 9ff4275bc8fd7bd5ac4677e2724397f8db3209bf Author: Thomas Gleixner Date: Mon Aug 14 10:18:39 2023 +0200 x86/apic: Use BAD_APICID consistently APIC ID checks compare with BAD_APICID all over the place, but some initializers and some code which fiddles with global data structure use -1[U] instead. That simply cannot work at all. Fix it up and use BAD_APICID consistently all over the place. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.862835121@linutronix.de commit 6e29032340b60f7aa7475c8234b17273e4424007 Author: Thomas Gleixner Date: Mon Aug 14 10:18:38 2023 +0200 x86/cpu: Move cpu_l[l2]c_id into topology info The topology IDs which identify the LLC and L2 domains clearly belong to the per CPU topology information. Move them into cpuinfo_x86::cpuinfo_topo and get rid of the extra per CPU data and the related exports. This also paves the way to do proper topology evaluation during early boot because it removes the only per CPU dependency for that. No functional change. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Reviewed-by: Arjan van de Ven Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.803864641@linutronix.de commit 22dc9631625352426cd665f4e3f8fe0d793b2bf5 Author: Thomas Gleixner Date: Mon Aug 14 10:18:37 2023 +0200 x86/cpu: Move logical package and die IDs into topology info Yet another topology related data pair. Rename logical_proc_id to logical_pkg_id so it fits the common naming conventions. No functional change. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.745139505@linutronix.de commit 594957d723a0674ca15bfefb755b3403624b8239 Author: Thomas Gleixner Date: Mon Aug 14 10:18:36 2023 +0200 x86/cpu: Remove pointless evaluation of x86_coreid_bits cpuinfo_x86::x86_coreid_bits is only used by the AMD numa topology code. No point in evaluating it on non AMD systems. No functional change. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Reviewed-by: Arjan van de Ven Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.687588373@linutronix.de commit e3c0c5d52ad34ab2c97f93ca4a0c2e9ca2fdc06b Author: Thomas Gleixner Date: Mon Aug 14 10:18:35 2023 +0200 x86/cpu: Move cu_id into topology info No functional change. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.628405546@linutronix.de commit e95256335d45cc965cd12c423535002974313340 Author: Thomas Gleixner Date: Mon Aug 14 10:18:34 2023 +0200 x86/cpu: Move cpu_core_id into topology info Rename it to core_id and stick it to the other ID fields. No functional change. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.566519388@linutronix.de commit 94f0b3978ea87c180b7e989e54faedd0a097f7ea Author: Thomas Gleixner Date: Mon Aug 14 10:18:33 2023 +0200 hwmon: (fam15h_power) Use topology_core_id() Use the provided topology helper function instead of fiddling in cpu_data. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Guenter Roeck Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.506988471@linutronix.de commit 09253672b5d9f911b96651400a02ad6666b7ae2c Author: Thomas Gleixner Date: Mon Aug 14 10:18:32 2023 +0200 scsi: lpfc: Use topology_core_id() Use the provided topology helper. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.446856860@linutronix.de commit 8a169ed40fcf6e0e7a2d900c7ab4408649488f40 Author: Thomas Gleixner Date: Mon Aug 14 10:18:31 2023 +0200 x86/cpu: Move cpu_die_id into topology info Move the next member. No functional change. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.388185134@linutronix.de commit 02fb601d27a7abf60d52b21bdf5b100a8d63da3f Author: Thomas Gleixner Date: Mon Aug 14 10:18:30 2023 +0200 x86/cpu: Move phys_proc_id into topology info Rename it to pkg_id which is the terminology used in the kernel. No functional change. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.329006989@linutronix.de commit b9655e702dc5d856e5e05ae414b71708ca98b30c Author: Thomas Gleixner Date: Mon Aug 14 10:18:29 2023 +0200 x86/cpu: Encapsulate topology information in cpuinfo_x86 The topology related information is randomly scattered across cpuinfo_x86. Create a new structure cpuinfo_topo and move in a first step initial_apicid and apicid into it. Aside of being better readable this is in preparation for replacing the horribly fragile CPU topology evaluation code further down the road. Consolidate APIC ID fields to u32 as that represents the hardware type. No functional change. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.269787744@linutronix.de commit 965e05ff8af98c44f9937366715c512000373164 Author: Thomas Gleixner Date: Mon Aug 14 10:18:28 2023 +0200 x86/apic: Fake primary thread mask for XEN/PV The SMT control mechanism got added as speculation attack vector mitigation. The implemented logic relies on the primary thread mask to be set up properly. This turns out to be an issue with XEN/PV guests because their CPU hotplug mechanics do not enumerate APICs and therefore the mask is never correctly populated. This went unnoticed so far because by chance XEN/PV ends up with smp_num_siblings == 2. So cpu_smt_control stays at its default value CPU_SMT_ENABLED and the primary thread mask is never evaluated in the context of CPU hotplug. This stopped "working" with the upcoming overhaul of the topology evaluation which legitimately provides a fake topology for XEN/PV. That sets smp_num_siblings to 1, which causes the core CPU hot-plug core to refuse to bring up the APs. This happens because cpu_smt_control is set to CPU_SMT_NOT_SUPPORTED which causes cpu_bootable() to evaluate the unpopulated primary thread mask with the conclusion that all non-boot CPUs are not valid to be plugged. The core code has already been made more robust against this kind of fail, but the primary thread mask really wants to be populated to avoid other issues all over the place. Just fake the mask by pretending that all XEN/PV vCPUs are primary threads, which is consistent because all of XEN/PVs topology is fake or non-existent. Fixes: 6a4d2657e048 ("x86/smp: Provide topology_is_primary_thread()") Fixes: f54d4434c281 ("x86/apic: Provide cpu_primary_thread mask") Reported-by: Juergen Gross Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.210011520@linutronix.de commit d91bdd96b55cc3ce98d883a60f133713821b80a6 Author: Thomas Gleixner Date: Mon Aug 14 10:18:27 2023 +0200 cpu/SMT: Make SMT control more robust against enumeration failures The SMT control mechanism got added as speculation attack vector mitigation. The implemented logic relies on the primary thread mask to be set up properly. This turns out to be an issue with XEN/PV guests because their CPU hotplug mechanics do not enumerate APICs and therefore the mask is never correctly populated. This went unnoticed so far because by chance XEN/PV ends up with smp_num_siblings == 2. So smt_hotplug_control stays at its default value CPU_SMT_ENABLED and the primary thread mask is never evaluated in the context of CPU hotplug. This stopped "working" with the upcoming overhaul of the topology evaluation which legitimately provides a fake topology for XEN/PV. That sets smp_num_siblings to 1, which causes the core CPU hot-plug core to refuse to bring up the APs. This happens because smt_hotplug_control is set to CPU_SMT_NOT_SUPPORTED which causes cpu_smt_allowed() to evaluate the unpopulated primary thread mask with the conclusion that all non-boot CPUs are not valid to be plugged. Make cpu_smt_allowed() more robust and take CPU_SMT_NOT_SUPPORTED and CPU_SMT_NOT_IMPLEMENTED into account. Rename it to cpu_bootable() while at it as that makes it more clear what the function is about. The primary mask issue on x86 XEN/PV needs to be addressed separately as there are users outside of the CPU hotplug code too. Fixes: 05736e4ac13c ("cpu/hotplug: Provide knobs to control SMT") Reported-by: Juergen Gross Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Peter Zijlstra (Intel) Tested-by: Zhang Rui Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230814085112.149440843@linutronix.de commit ee545b94d39a00c93dc98b1dbcbcf731d2eadeb4 Author: Pu Wen Date: Mon Aug 14 10:18:26 2023 +0200 x86/cpu/hygon: Fix the CPU topology evaluation for real Hygon processors with a model ID > 3 have CPUID leaf 0xB correctly populated and don't need the fixed package ID shift workaround. The fixup is also incorrect when running in a guest. Fixes: e0ceeae708ce ("x86/CPU/hygon: Fix phys_proc_id calculation logic for multi-die processors") Signed-off-by: Pu Wen Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Cc: Link: https://lore.kernel.org/r/tencent_594804A808BD93A4EBF50A994F228E3A7F07@qq.com Link: https://lore.kernel.org/r/20230814085112.089607918@linutronix.de commit 1758cd2e95d31b308f29ae3828ae92c8b8d20466 Author: Alexey Dobriyan Date: Tue Oct 10 14:44:35 2023 +0300 fanotify: delete useless parenthesis in FANOTIFY_INLINE_FH macro Parenthesis around identifier name in declaration are useless. This is just "put every macro argument inside parenthesis" practice. Now "size" must be constant expression, but using comma expression in constant expression is useless too, therefore [] will guard "size" expression just as well as (). Also g++ is somewhat upset about these: fs/notify/fanotify/fanotify.h:278:28: warning: unnecessary parentheses in declaration of ‘object_fh’ [-Wparentheses] 278 | struct fanotify_fh (name); Signed-off-by: Alexey Dobriyan Signed-off-by: Jan Kara Message-Id: <633c251a-b548-4428-9e91-1cf8147d8c55@p183> commit 9aaa25df9b02bfe5579cbc9b4cc1177c662ec33f Author: Bartosz Golaszewski Date: Wed Oct 4 20:39:06 2023 +0200 spi: bcm2835: add a sentinel at the end of the lookup array GPIOLIB expects the array of lookup entries to be terminated with an empty member. We need to increase the size of the variable length array in the lookup table by 1. Fixes: 21f252cd29f0 ("spi: bcm2835: reduce the abuse of the GPIO API") Reported-by: Hans de Goede Closes: https://lore.kernel.org/lkml/29764d46-8d3d-9794-bbde-d7928a91cbb5@redhat.com/ Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231004183906.97845-1-brgl@bgdev.pl Signed-off-by: Mark Brown commit b1191940909a482d4d82f5b2e449e04829c0d739 Author: Martin Kaiser Date: Fri Oct 6 10:22:48 2023 +0200 dt-bindings: pinctrl: st,stm32: fix phandle-array warning make CHECK_DTBS=y st/stm32f469-disco.dtb brings up a warning about a missing argument: stm32f469-disco.dtb: pinctrl@40020000: st,syscfg:0: [21, 8] is too short The description of the third entry indicates that this entry is optional. The code in stm32_pctrl_dt_setup_irq parses st,syscfg and treats the third entry as optional. It defaults to 0xf if not present in the devicetree. Update the schema to require at least two entries, use the same syntax as the description of renesas,ipmmu-main in Documentation/devicetree/bindings/iommu/renesas,ipmmu-vmsa.yaml. Signed-off-by: Martin Kaiser Acked-by: Rob Herring Link: https://lore.kernel.org/r/20231006082247.3830719-1-martin@kaiser.cx Signed-off-by: Linus Walleij commit 10f94f9cad2c94236c0288e547f324d21c01262a Author: Andy Shevchenko Date: Tue Oct 3 15:06:48 2023 +0300 pinctrl: core: Remove unneeded {} around one line conditional body The one line conditional body doesn't require {} surrounding it. Remove unneeded {}. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231003120648.2838047-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit d875d6ccd36f5eed25829d483b12df6ed826f9b5 Author: Zev Weiss Date: Wed Oct 4 20:08:50 2023 -0700 pinctrl: aspeed: Allow changing SPI mode from hardware strap defaults Some platforms unfortunately have their SPI mode selection bits strapped incorrectly (such as being configured for passthrough mode when master mode is in fact the only useful configuration for it) and thus require correction in software. Add the SPI mode bits to the GPIO passthrough bits as the exceptions to the read-only rule for the hardware strap register so that the pinctrl subsystem can be used for such corrections. Signed-off-by: Zev Weiss Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20231005030849.11352-2-zev@bewilderbeest.net Signed-off-by: Linus Walleij commit 295d3c441226d004d1ed59c4fcf62d5dba18d9e1 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:33 2023 -0300 net: move sockfs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to sockfs_xattr_handlers at runtime. Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Richard Cochran Cc: netdev@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-30-wedsonaf@gmail.com Acked-by: Jakub Kicinski Signed-off-by: Christian Brauner commit 2f5028604f08fa9fe40c07295843d6917d9d0a94 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:32 2023 -0300 shmem: move shmem_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to shmem_xattr_handlers at runtime. Cc: Hugh Dickins Cc: Andrew Morton Cc: linux-mm@kvack.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-29-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit 3d649a4a832ecfa48bf1f62972c1ddf0030785d3 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:31 2023 -0300 overlayfs: move xattr tables to .rodata This makes it harder for accidental or malicious changes to ovl_trusted_xattr_handlers or ovl_user_xattr_handlers at runtime. Cc: Miklos Szeredi Cc: Amir Goldstein Cc: linux-unionfs@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-28-wedsonaf@gmail.com Acked-by: Amir Goldstein Signed-off-by: Christian Brauner commit 375aa21d36ee8ea19a370da9d38fedcb50ec34d3 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:30 2023 -0300 xfs: move xfs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to xfs_xattr_handlers at runtime. Cc: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-27-wedsonaf@gmail.com Reviewed-by: "Darrick J. Wong" Signed-off-by: Christian Brauner commit c25308c326dbc304e6f77df0f8f5989a7825203d Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:29 2023 -0300 ubifs: move ubifs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to ubifs_xattr_handlers at runtime. Cc: Richard Weinberger Cc: linux-mtd@lists.infradead.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-26-wedsonaf@gmail.com Reviewed-by: Zhihao Cheng Signed-off-by: Christian Brauner commit c08a831c74f040ac332c31ad15254cc7462438bc Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:28 2023 -0300 squashfs: move squashfs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to squashfs_xattr_handlers at runtime. Cc: Phillip Lougher Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-25-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit 149f455798a6fef6f5a88d43f930636b86dd9a74 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:27 2023 -0300 smb: move cifs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to cifs_xattr_handlers at runtime. Cc: Steve French Cc: Paulo Alcantara Cc: Ronnie Sahlberg Cc: Shyam Prasad N Cc: Tom Talpey Cc: linux-cifs@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-24-wedsonaf@gmail.com Reviewed-by: Steve French Signed-off-by: Christian Brauner commit 29a69055e2e11040437f89e0355979d3d6e77149 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:26 2023 -0300 reiserfs: move reiserfs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to reiserfs_xattr_handlers at runtime. Cc: reiserfs-devel@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-23-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit ff369d7b98426abf7bccb0722253f5d4490f3c17 Author: Vincent Whitchurch Date: Fri Sep 29 09:45:09 2023 +0200 mmc: debugfs: Allow host caps to be modified During board verification, there is a need to test the various supported eMMC/SD speed modes. However, since the framework chooses the best mode supported by the card and the host controller's caps, this currently necessitates changing the devicetree for every iteration. Allow the various speed mode host capabilities to be modified via debugfs in order to allow easier hardware verification. The values to be written are the raw MMC_CAP* values from include/linux/mmc/host.h. This is rather low-level, and these defines are not guaranteed to be stable, but it is perhaps good enough for the intended use case. MMC_CAP_AGGRESSIVE_PM can also be set, in order to be able to re-initialize the card without having to physically remove and re-insert it. /sys/kernel/debug/mmc0# grep timing ios timing spec: 9 (mmc HS200) // Turn on MMC_CAP_AGGRESSIVE_PM and re-trigger runtime suspend /sys/kernel/debug/mmc0# echo $(($(cat caps) | (1 << 7))) > caps /sys/kernel/debug/mmc0# echo on > /sys/bus/mmc/devices/mmc0\:0001/power/control /sys/kernel/debug/mmc0# echo auto > /sys/bus/mmc/devices/mmc0\:0001/power/control // MMC_CAP2_HS200_1_8V_SDR /sys/kernel/debug/mmc0# echo $(($(cat caps2) & ~(1 << 5))) > caps2 /sys/kernel/debug/mmc0# echo on > /sys/bus/mmc/devices/mmc0\:0001/power/control /sys/kernel/debug/mmc0# grep timing ios timing spec: 8 (mmc DDR52) Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20230929-mmc-caps-v2-2-11a4c2d94f15@axis.com Signed-off-by: Ulf Hansson commit 6fff35f0335300af81c96326061f3cf3866ba6b8 Author: Vincent Whitchurch Date: Fri Sep 29 09:45:08 2023 +0200 mmc: core: Always reselect card type We want to allow host caps to be changed dynamically via debugfs, so for these to have an effect, ensure that the card type reselection is always applied even if the card is old. Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20230929-mmc-caps-v2-1-11a4c2d94f15@axis.com Signed-off-by: Ulf Hansson commit 54a33423f29b3a018cfcd831863c9b063c35d70f Author: Fabio Estevam Date: Thu Sep 28 10:43:21 2023 -0300 pinctrl: mxs: Remove undocumented 'fsl,mxs-gpio' property The 'fsl,mxs-gpio' property is not documented in gpio-mxs.yaml, but the imx23 and imx28 dtsi describe the gpios as: compatible = "fsl,imx28-gpio", "fsl,mxs-gpio"; This gives schema warnings like: imx28-cfa10037.dtb: pinctrl@80018000: gpio@0:compatible: ['fsl,imx28-gpio', 'fsl,mxs-gpio'] is too long from schema $id: http://devicetree.org/schemas/gpio/gpio-mxs.yaml# "fsl,mxs-gpio" is only used inside pinctrl-mxs, but can be removed if the compatible check is done against fsl,imx23-gpio and fsl,imx28-gpio. Introduce is_mxs_gpio() and remove the need for "fsl,mxs-gpio". Tested on a imx28-evk. Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20230928134321.438547-1-festevam@gmail.com Signed-off-by: Linus Walleij commit 2e44555b05c0c04cf199348fbec5640f69deef8c Author: Biju Das Date: Sun Oct 1 16:01:13 2023 +0100 pinctrl: mcp23s08: Simplify probe()/mcp23s08_spi_regmap_init() Add struct mcp23s08_info and simplify probe()/mcp23s08_spi_regmap_init() by replacing match data 'type' with 'struct mcp23s08_info'. While at it, replace 'dev_err()'->'dev_err_probe()' and drop printing 'type' in error path for i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231001150113.7752-4-biju.das.jz@bp.renesas.com Signed-off-by: Linus Walleij commit b03f7aa802b6b89165b4ad340129ef2cbac231a4 Author: Biju Das Date: Sun Oct 1 16:01:12 2023 +0100 pinctrl: mcp23s08_spi: Simplify probe() Simpilfy probe() by replacing device_get_match_data() and ID lookup for retrieving match data by spi_get_device_match_data(). While at it, replace data type of variable type from 'int'->'unsigned int' and declare variables following a reverse christmas tree order. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231001150113.7752-3-biju.das.jz@bp.renesas.com Signed-off-by: Linus Walleij commit 880d3fcbe5b54920df7a5c8878ca6785938df62a Author: Biju Das Date: Sun Oct 1 16:01:11 2023 +0100 pinctrl: mcp23s08_i2c: Extend match support for OF tables The driver has OF match table, still it uses ID lookup table for retrieving match data. Currently the driver is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using of_device_match_data() if the devices are registered via OF. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231001150113.7752-2-biju.das.jz@bp.renesas.com Signed-off-by: Linus Walleij commit 4a221b2e3340f4a3c2b414c46c846a26c6caf820 Author: Kuninori Morimoto Date: Mon Oct 9 23:39:43 2023 +0000 ASoC: fsl: mpc5200_dma.c: Fix warning of Function parameter or member not described This patch fixes the warnings of "Function parameter or member 'xxx' not described". >> sound/soc/fsl/mpc5200_dma.c:116: warning: Function parameter or member 'component' not described in 'psc_dma_trigger' sound/soc/fsl/mpc5200_dma.c:116: warning: Function parameter or member 'substream' not described in 'psc_dma_trigger' sound/soc/fsl/mpc5200_dma.c:116: warning: Function parameter or member 'cmd' not described in 'psc_dma_trigger' Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310061914.jJuekdHs-lkp@intel.com/ Signed-off-by: Kuninori Morimoto Fixes: 6d1048bc1152 ("ASoC: fsl: mpc5200_dma: remove snd_pcm_ops") Link: https://lore.kernel.org/r/87il7fcqm8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 1e50ac48d20c6563656587b9137820b4d9f31d07 Author: xiazhengqiao Date: Tue Oct 10 10:37:38 2023 +0800 ASoC: mediatek: mt8188-mt6359: add rt5682s support To use RT5682S as the codec and MAX98390 as the amp, add a new sound card named mt8188_rt5682s. Signed-off-by: xiazhengqiao Reviewed-by: Trevor Wu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231010023738.8241-3-xiazhengqiao@huaqin.corp-partner.google.com Signed-off-by: Mark Brown commit 748d508e5b4cb537ed91e7bc5a664c526b6c64f6 Author: xiazhengqiao Date: Tue Oct 10 10:37:37 2023 +0800 ASoC: dt-bindings: mediatek,mt8188-mt6359: add RT5682S support Add compatible string "mediatek,mt8188-rt5682s" to support new board with rt5682s codec. Signed-off-by: xiazhengqiao Acked-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231010023738.8241-2-xiazhengqiao@huaqin.corp-partner.google.com Signed-off-by: Mark Brown commit 44ac5e91580b9c88212bd0336214ac204e6e9fe7 Author: Ben Wolsieffer Date: Thu Sep 28 09:56:44 2023 -0400 mmc: mmci: use peripheral flow control for STM32 The STM32 SDMMC peripheral (at least for the STM32F429, STM32F469 and STM32F746, which are all the currently supported devices using periphid 0x00880180) requires DMA to be performed in peripheral flow controller mode. From the STM32F74/5 reference manual, section 35.3.2: "SDMMC host allows only to use the DMA in peripheral flow controller mode. DMA stream used to serve SDMMC must be configured in peripheral flow controller mode" This patch adds a variant option to control peripheral flow control and enables it for the STM32 variant. Signed-off-by: Ben Wolsieffer Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230928135644.1489691-1-ben.wolsieffer@hefring.com Signed-off-by: Ulf Hansson commit 9330bf741fdac78c398a866f979fd29fea435a88 Merge: bd35cbd721220 4d8784d84e175 Author: Georgi Djakov Date: Tue Oct 10 14:11:07 2023 +0300 Merge branch 'icc-misc' into icc-next * icc-misc interconnect: imx: Replace custom implementation of COUNT_ARGS() interconnect: msm8974: Replace custom implementation of COUNT_ARGS() interconnect: qcom: osm-l3: Replace custom implementation of COUNT_ARGS() interconnect: fix error handling in qnoc_probe() interconnect: imx: Replace inclusion of kernel.h in the header dt-bindings: interconnect: qcom,rpmh: do not require reg on SDX65 MC virt Signed-off-by: Georgi Djakov commit 4d8784d84e17529f0f0774d3a946fd07057cd9a4 Author: Krzysztof Kozlowski Date: Sun Aug 27 13:40:26 2023 +0200 dt-bindings: interconnect: qcom,rpmh: do not require reg on SDX65 MC virt The MC virt interconnect in SDX65 DTSI does not have reg. Similarly in the downstream DTS, thus assume this is an interconnect without own dedicated IO address space. This fixes dtbs_check warnings like: qcom-sdx65-mtp.dtb: interconnect-mc-virt: 'reg' is a required property Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230827114026.47806-1-krzysztof.kozlowski@linaro.org Signed-off-by: Georgi Djakov commit 6548ecdfc16327aafeaa1f1d97f63c79995a56cb Author: Andy Shevchenko Date: Wed Sep 20 18:36:45 2023 +0300 interconnect: imx: Replace inclusion of kernel.h in the header The kernel.h is not used here directly, replace it with proper set of headers. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230920153645.2068193-1-andriy.shevchenko@linux.intel.com Signed-off-by: Georgi Djakov commit 273f74a2e7d15a5c216a4a26b84b1563c7092c9d Author: Yang Yingliang Date: Thu Aug 3 21:05:21 2023 +0800 interconnect: fix error handling in qnoc_probe() Add missing clk_disable_unprepare() and clk_bulk_disable_unprepare() in the error path in qnoc_probe(). And when qcom_icc_qos_set() fails, it needs remove nodes and disable clks. Fixes: 2e2113c8a64f ("interconnect: qcom: rpm: Handle interface clocks") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230803130521.959487-1-yangyingliang@huawei.com Signed-off-by: Georgi Djakov commit c7e0d9bb9154c6e6b2ac8746faba27b53393f25e Author: Christophe Leroy Date: Fri Sep 22 14:33:13 2023 +0200 powerpc: Only define __parse_fpscr() when required Clang 17 reports: arch/powerpc/kernel/traps.c:1167:19: error: unused function '__parse_fpscr' [-Werror,-Wunused-function] __parse_fpscr() is called from two sites. First call is guarded by #ifdef CONFIG_PPC_FPU_REGS Second call is guarded by CONFIG_MATH_EMULATION which selects CONFIG_PPC_FPU_REGS. So only define __parse_fpscr() when CONFIG_PPC_FPU_REGS is defined. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309210327.WkqSd5Bq-lkp@intel.com/ Fixes: b6254ced4da6 ("powerpc/signal: Don't manage floating point regs when no FPU") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://msgid.link/5de2998c57f3983563b27b39228ea9a7229d4110.1695385984.git.christophe.leroy@csgroup.eu commit f0107b864f004bc6fa19bf6d5074b4a366f3e16a Author: Rob Herring Date: Fri Oct 6 16:44:21 2023 -0500 atm: fore200e: Drop unnecessary of_match_device() It is not necessary to call of_match_device() in probe. If we made it to probe, then we've already successfully matched. Signed-off-by: Rob Herring Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231006214421.339445-1-robh@kernel.org Signed-off-by: Paolo Abeni commit 000677f9d6ee750fe926c2f0487956e68e333e8f Merge: 59fe651753fb8 392ce2abb0cef Author: Paolo Abeni Date: Tue Oct 10 12:15:52 2023 +0200 Merge branch 'mlxsw-fix-wformat-truncation-warnings' Petr Machata says: ==================== mlxsw: Fix -Wformat-truncation warnings Ido Schimmel writes: Commit 6d4ab2e97dcf ("extrawarn: enable format and stringop overflow warnings in W=1") enabled format warnings as part of W=1 builds, resulting in two new warnings in mlxsw. Fix both and target at net-next as the warnings are not indicative of actual bugs. ==================== Link: https://lore.kernel.org/r/cover.1696600763.git.petrm@nvidia.com Signed-off-by: Paolo Abeni commit 392ce2abb0cef182f026324b208d1856e58ecac8 Author: Ido Schimmel Date: Fri Oct 6 16:43:17 2023 +0200 mlxsw: spectrum_ethtool: Fix -Wformat-truncation warning Ethtool stats strings cannot be longer than 32 characters ('ETH_GSTRING_LEN'), including the terminating null byte. The format string '%.29s_%.1d' can exceed this limitation if the per-TC counter name exceeds 28 characters. Together with the underscore, the two digits of the TC (bounded at 16) and the terminating null byte, more than 32 characters will be used. Fix this by bounding the counter name at 28 characters which suppresses the following build warning [1]. This does not affect ethtool output since the longest counter name does not exceed this limitation. [1] drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c: In function ‘mlxsw_sp_port_get_strings’: drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c:622:58: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] 622 | snprintf(*p, ETH_GSTRING_LEN, "%.29s_%.1d", | ^ In function ‘mlxsw_sp_port_get_tc_strings’, inlined from ‘mlxsw_sp_port_get_strings’ at drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c:677:4: drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c:622:17: note: ‘snprintf’ output between 3 and 33 bytes into a destination of size 32 622 | snprintf(*p, ETH_GSTRING_LEN, "%.29s_%.1d", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 623 | mlxsw_sp_port_hw_tc_stats[i].str, tc); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c: In function ‘mlxsw_sp_port_get_strings’: drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c:622:58: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] 622 | snprintf(*p, ETH_GSTRING_LEN, "%.29s_%.1d", | ^ In function ‘mlxsw_sp_port_get_tc_strings’, inlined from ‘mlxsw_sp_port_get_strings’ at drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c:677:4: drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c:622:17: note: ‘snprintf’ output between 3 and 33 bytes into a destination of size 32 622 | snprintf(*p, ETH_GSTRING_LEN, "%.29s_%.1d", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 623 | mlxsw_sp_port_hw_tc_stats[i].str, tc); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata Reviewed-by: Simon Horman Tested-by: Simon Horman # build-tested Signed-off-by: Paolo Abeni commit 83b2d81b691ce0efdd4087c510d33087c2474da1 Author: Ido Schimmel Date: Fri Oct 6 16:43:16 2023 +0200 mlxsw: core_thermal: Fix -Wformat-truncation warning The name of a thermal zone device cannot be longer than 19 characters ('THERMAL_NAME_LENGTH - 1'). The format string 'mlxsw-lc%d-gearbox%d' can exceed this limitation if the maximum number of line cards and the maximum number of gearboxes on each line card cannot be represented using a single digit. This is not the case with current systems nor future ones. Therefore, increase the size of the result buffer beyond 'THERMAL_NAME_LENGTH' and suppress the following build warning [1]. If this limitation is ever exceeded, we will know about it since the thermal core validates the thermal device's name during registration. [1] drivers/net/ethernet/mellanox/mlxsw/core_thermal.c: In function ‘mlxsw_thermal_gearboxes_init.constprop’: drivers/net/ethernet/mellanox/mlxsw/core_thermal.c:543:71: error: ‘%d’ directive output may be truncated writing between 1 and 3 bytes into a region of size between 1 and 3 [-Werror=format-truncation=] 543 | snprintf(tz_name, sizeof(tz_name), "mlxsw-lc%d-gearbox%d", | ^~ In function ‘mlxsw_thermal_gearbox_tz_init’, inlined from ‘mlxsw_thermal_gearboxes_init.constprop’ at drivers/net/ethernet/mellanox/mlxsw/core_thermal.c:611:9: drivers/net/ethernet/mellanox/mlxsw/core_thermal.c:543:52: note: directive argument in the range [1, 255] 543 | snprintf(tz_name, sizeof(tz_name), "mlxsw-lc%d-gearbox%d", | ^~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mellanox/mlxsw/core_thermal.c:543:17: note: ‘snprintf’ output between 19 and 23 bytes into a destination of size 20 543 | snprintf(tz_name, sizeof(tz_name), "mlxsw-lc%d-gearbox%d", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 544 | gearbox_tz->slot_index, gearbox_tz->module + 1); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: Petr Machata Reviewed-by: Simon Horman Tested-by: Simon Horman # build-tested Signed-off-by: Paolo Abeni commit 57ec42b9a1b7e4db4a1c2aa4fcc4eefe6d31bcb8 Author: Matt Johnston Date: Tue Oct 3 15:53:39 2023 +0800 i3c: Fix typo "Provisional ID" to "Provisioned ID" The MIPI I3C spec refers to a Provisioned ID, since it is (sometimes) provisioned at device manufacturing. Signed-off-by: Matt Johnston Acked-by: Rob Herring Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/r/20231003075339.197099-1-matt@codeconstruct.com.au Signed-off-by: Alexandre Belloni commit 577a3c5af1fe87b65931ea94d5515266da301f56 Author: Andy Shevchenko Date: Wed Sep 20 18:49:27 2023 +0300 interconnect: qcom: osm-l3: Replace custom implementation of COUNT_ARGS() Replace custom and non-portable implementation of COUNT_ARGS(). Fixes: 5bc9900addaf ("interconnect: qcom: Add OSM L3 interconnect provider support") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230920154927.2090732-1-andriy.shevchenko@linux.intel.com Signed-off-by: Georgi Djakov commit e753741421965e5033c5bf6264fc8370ad01a400 Author: Andy Shevchenko Date: Wed Sep 20 18:41:31 2023 +0300 interconnect: msm8974: Replace custom implementation of COUNT_ARGS() Replace custom and non-portable implementation of COUNT_ARGS(). Fixes: 4e60a9568dc6 ("interconnect: qcom: add msm8974 driver") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230920154131.2071112-1-andriy.shevchenko@linux.intel.com Signed-off-by: Georgi Djakov commit 80f5fef01beeda54ec9c1f9049d331e480be80e8 Author: Andy Shevchenko Date: Wed Sep 20 18:34:32 2023 +0300 interconnect: imx: Replace custom implementation of COUNT_ARGS() Replace custom and non-portable implementation of COUNT_ARGS(). Fixes: f0d8048525d7 ("interconnect: Add imx core driver") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230920153432.2067664-1-andriy.shevchenko@linux.intel.com Signed-off-by: Georgi Djakov commit bd35cbd7212200c1b1ed38d5fb5b43a8c9692153 Merge: 9ee5214138cbf 3642b4e5cbfe4 Author: Georgi Djakov Date: Tue Oct 10 12:33:10 2023 +0300 Merge branch 'icc-sdx75' into icc-next Add interconnect driver support for SDX75 platform. * icc-sdx75 dt-bindings: interconnect: Add compatibles for SDX75 interconnect: qcom: Add SDX75 interconnect provider driver Link: https://lore.kernel.org/r/1694614256-24109-1-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Georgi Djakov anter a commit message to explain why this merge is necessary, commit 9ee5214138cbfc89c6d0583c5517bf149f6cd842 Merge: 300e0fb064ff5 df1b8356a80ab Author: Georgi Djakov Date: Tue Oct 10 10:19:05 2023 +0300 Merge branch 'icc-acv-enable-mask' into icc-next In the downstream kernel, ACV enable_mask has not been mentioned explicitly, rather being handled by a sneaky if-condition [1], [2]. Add it to all RPMh platforms to actually enable that BCM. [1] https://git.codelinaro.org/clo/la/kernel/msm-4.19/-/blob/LA.UM.10.2.1.c25/drivers/soc/qcom/msm_bus/msm_bus_arb_rpmh.c#L556-567 [2] https://git.codelinaro.org/clo/la/kernel/msm-4.19/-/blob/LA.UM.10.2.1.c25/drivers/soc/qcom/msm_bus/msm_bus_arb_rpmh.c#L475-495 * icc-acv-enable-mask interconnect: qcom: qdu1000: Set ACV enable_mask interconnect: qcom: sc7180: Set ACV enable_mask interconnect: qcom: sc7280: Set ACV enable_mask interconnect: qcom: sc8180x: Set ACV enable_mask interconnect: qcom: sc8280xp: Set ACV enable_mask interconnect: qcom: sdm670: Set ACV enable_mask interconnect: qcom: sdm845: Set ACV enable_mask interconnect: qcom: sm6350: Set ACV enable_mask interconnect: qcom: sm8150: Set ACV enable_mask interconnect: qcom: sm8250: Set ACV enable_mask interconnect: qcom: sm8350: Set ACV enable_mask Link: https://lore.kernel.org/r/20230811-topic-acv-v2-0-765ad70e539a@linaro.org Signed-off-by: Georgi Djakov commit 3642b4e5cbfe480892858f0209c6fd0a3172a103 Author: Rohit Agarwal Date: Wed Sep 13 19:40:56 2023 +0530 interconnect: qcom: Add SDX75 interconnect provider driver Add driver for the Qualcomm interconnect buses found in SDX75. Signed-off-by: Rohit Agarwal Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/1694614256-24109-3-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Georgi Djakov commit 956329ec7c5eba430211b48cca1b0372b4a4d702 Author: Rohit Agarwal Date: Wed Sep 13 19:40:55 2023 +0530 dt-bindings: interconnect: Add compatibles for SDX75 Add dt-bindings compatibles and interconnect IDs for Qualcomm SDX75 platform. Signed-off-by: Rohit Agarwal Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1694614256-24109-2-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Georgi Djakov commit 59fe651753fb897ebe0ac91c19cf503e7a551632 Author: Oleksij Rempel Date: Fri Oct 6 13:58:22 2023 +0200 net: dsa: microchip: Fix uninitialized var in ksz9477_acl_move_entries() Address an issue in ksz9477_acl_move_entries() where, in the scenario (src_idx == dst_idx), ksz9477_validate_and_get_src_count() returns 0, leading to usage of uninitialized src_count and dst_count variables, which causes undesired behavior as it attempts to move ACL entries around. Fixes: 002841be134e ("net: dsa: microchip: Add partial ACL support for ksz9477 switches") Reported-by: Dan Carpenter Suggested-by: Vladimir Oltean Signed-off-by: Oleksij Rempel Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20231006115822.144152-1-o.rempel@pengutronix.de Signed-off-by: Paolo Abeni commit 2e2675db1906ac04809f5399bf1f5e30d56a6f3e Author: Raghavendra K T Date: Tue Oct 10 09:31:41 2023 +0100 sched/numa: Move up the access pid reset logic Recent NUMA hinting faulting activity is reset approximately every VMA_PID_RESET_PERIOD milliseconds. However, if the current task has not accessed a VMA then the reset check is missed and the reset is potentially deferred forever. Check if the PID activity information should be reset before checking if the current task recently trapped a NUMA hinting fault. [ mgorman@techsingularity.net: Rewrite changelog ] Suggested-by: Mel Gorman Signed-off-by: Raghavendra K T Signed-off-by: Mel Gorman Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231010083143.19593-5-mgorman@techsingularity.net commit ed2da8b725b932b1e2b2f4835bb664d47ed03031 Author: Mel Gorman Date: Tue Oct 10 09:31:40 2023 +0100 sched/numa: Trace decisions related to skipping VMAs NUMA balancing skips or scans VMAs for a variety of reasons. In preparation for completing scans of VMAs regardless of PID access, trace the reasons why a VMA was skipped. In a later patch, the tracing will be used to track if a VMA was forcibly scanned. Signed-off-by: Mel Gorman Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231010083143.19593-4-mgorman@techsingularity.net commit f3a6c97940fbd25d6c84c2d5642338fc99a9b35b Author: Mel Gorman Date: Tue Oct 10 09:31:39 2023 +0100 sched/numa: Rename vma_numab_state::access_pids[] => ::pids_active[], ::next_pid_reset => ::pids_active_reset The access_pids[] field name is somewhat ambiguous as no PIDs are accessed. Similarly, it's not clear that next_pid_reset is related to access_pids[]. Rename the fields to more accurately reflect their purpose. [ mingo: Rename in the comments too. ] Signed-off-by: Mel Gorman Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231010083143.19593-3-mgorman@techsingularity.net commit 9ae5c00ea2e600a8b823f9b95606dd244f3096bf Author: Mel Gorman Date: Tue Oct 10 09:31:38 2023 +0100 sched/numa: Document vma_numab_state fields Document the intended usage of the fields. [ mingo: Reformatted to take less vertical space & tidied it up. ] Signed-off-by: Mel Gorman Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231010083143.19593-2-mgorman@techsingularity.net commit f22def5970c423ea7f87d5247bd0ef91416b0658 Author: Ma Ke Date: Mon Oct 9 17:04:46 2023 +0800 drm/panel/panel-tpo-tpg110: fix a possible null pointer dereference In tpg110_get_modes(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Signed-off-by: Ma Ke Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20231009090446.4043798-1-make_ruc2021@163.com Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231009090446.4043798-1-make_ruc2021@163.com commit 924e5814d1f84e6fa5cb19c6eceb69f066225229 Author: Ma Ke Date: Sat Oct 7 11:31:05 2023 +0800 drm/panel: fix a possible null pointer dereference In versatile_panel_get_modes(), the return value of drm_mode_duplicate() is assigned to mode, which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Add a check to avoid npd. Signed-off-by: Ma Ke Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20231007033105.3997998-1-make_ruc2021@163.com Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231007033105.3997998-1-make_ruc2021@163.com commit 4fbf8b136ded943f8661cf48270482ad1f5ce7bd Author: Uros Bizjak Date: Tue May 9 17:02:55 2023 +0200 locking/atomics: Use atomic_try_cmpxchg_release() to micro-optimize rcuref_put_slowpath() Use atomic_try_cmpxchg() instead of atomic_cmpxchg(*ptr, old, new) == old in rcuref_put_slowpath(). On x86 the CMPXCHG instruction returns success in the ZF flag, so this change saves a compare after CMPXCHG. Additionaly, the compiler reorders some code blocks to follow likely/unlikely annotations in the atomic_try_cmpxchg() macro, improving the code from: 9a: f0 0f b1 0b lock cmpxchg %ecx,(%rbx) 9e: 83 f8 ff cmp $0xffffffff,%eax a1: 74 04 je a7 a3: 31 c0 xor %eax,%eax to: 9a: f0 0f b1 0b lock cmpxchg %ecx,(%rbx) 9e: 75 4c jne ec a0: b0 01 mov $0x1,%al No functional change intended. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Paul E. McKenney Link: https://lore.kernel.org/r/20230509150255.3691-1-ubizjak@gmail.com commit c41a38ef3bf78a86f94c3f67a19368a98c10ee2c Merge: 8cea95b0bd793 939463016b7a8 Author: Paolo Abeni Date: Tue Oct 10 10:03:04 2023 +0200 Merge branch 'tcp-save-flowlabel-and-use-for-receiver-repathing' David Morley says: ==================== tcp: save flowlabel and use for receiver repathing This patch series stores the last received ipv6 flowlabel. This last received flowlabel is then used to help decide whether a packet is likely an RTO retransmit or the result of a TLP. This new information is used to better inform the flowlabel change decision for data receivers. ==================== Link: https://lore.kernel.org/r/20231006011841.3558307-1-morleyd.kernel@gmail.com Signed-off-by: Paolo Abeni commit 939463016b7a869d8b407cfcda4d6545de399698 Author: David Morley Date: Fri Oct 6 01:18:41 2023 +0000 tcp: change data receiver flowlabel after one dup This commit changes the data receiver repath behavior to occur after receiving a single duplicate. This can help recover ACK connectivity quicker if a TLP was sent along a nonworking path. For instance, consider the case where we have an initially nonworking forward path and reverse path and subsequently switch to only working forward paths. Before this patch we would have the following behavior. +---------+--------+--------+----------+----------+----------+ | Event | For FL | Rev FL | FP Works | RP Works | Data Del | +---------+--------+--------+----------+----------+----------+ | Initial | A | 1 | N | N | 0 | +---------+--------+--------+----------+----------+----------+ | TLP | A | 1 | N | N | 0 | +---------+--------+--------+----------+----------+----------+ | RTO 1 | B | 1 | Y | N | 1 | +---------+--------+--------+----------+----------+----------+ | RTO 2 | C | 1 | Y | N | 2 | +---------+--------+--------+----------+----------+----------+ | RTO 3 | D | 2 | Y | Y | 3 | +---------+--------+--------+----------+----------+----------+ This patch gets rid of at least RTO 3, avoiding additional unnecessary repaths of a working forward path to a (potentially) nonworking one. In addition, this commit changes the behavior to avoid repathing upon rx of duplicate data if the local endpoint is in CA_Loss (in which case the RTOs will already be changing the outgoing flowlabel). Signed-off-by: David Morley Signed-off-by: Neal Cardwell Signed-off-by: Yuchung Cheng Tested-by: David Morley Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit 95b9a87c6a6b708cccda1f9b7baf9920b80cdabf Author: David Morley Date: Fri Oct 6 01:18:40 2023 +0000 tcp: record last received ipv6 flowlabel In order to better estimate whether a data packet has been retransmitted or is the result of a TLP, we save the last received ipv6 flowlabel. To make space for this field we resize the "ato" field in inet_connection_sock as the current value of TCP_DELACK_MAX can be fully contained in 8 bits and add a compile_time_assert ensuring this field is the required size. v2: addressed kernel bot feedback about dccp_delack_timer() v3: addressed build error introduced by commit bbf80d713fe7 ("tcp: derive delack_max from rto_min") Signed-off-by: David Morley Signed-off-by: Neal Cardwell Signed-off-by: Yuchung Cheng Tested-by: David Morley Reviewed-by: Eric Dumazet Signed-off-by: Paolo Abeni commit efedce336d71e238fbbada0f54b2bff9bf0509e9 Merge: e377240a8eb06 7a0207094f1b1 Author: Steffen Klassert Date: Tue Oct 10 09:47:41 2023 +0200 Merge branch 'xfrm: policy: replace session decode with flow dissector' Florian Westphal says: ============ Remove the ipv4+ipv6 session decode functions and use generic flow dissector to populate the flowi for the policy lookup. Changes since v2: - first patch broke CONFIG_XFRM=n builds Changes since v1: - Can't use skb_flow_dissect(), we might see skbs that have neither skb->sk nor skb->dev set. Flow dissector WARN()s in this case, it tries to check for a bpf program assigned in that net namespace. Add a preparation patch to pass down 'struct net' in xfrm_decode_session so its available for use in patch 3. Changes since RFC: - Drop mobility header support. I don't think that anyone uses this. MOBIKE doesn't appear to need this either. - Drop fl6->flowlabel assignment, original code leaves it as 0. There is no reason for this change other than to remove code. ============ Signed-off-by: Steffen Klassert commit 2bc823c920fa8fee5db562f1b15ad1f9869c9cb3 Author: Ville Syrjälä Date: Mon Oct 9 17:58:28 2023 +0300 drm/i915: Fix VLV color state readout VLV was missed when the color.get_config() hook was added. Remedy that. Not really sure what the final plan here was since a bunch of color related readout was left in intel_display.c anyway, but that's for anothr day to figure out... Cc: Jani Nikula Fixes: 9af09dfcdfa1 ("drm/i915/color: move pre-SKL gamma and CSC enable read to intel_color") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231009145828.12960-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit de60a3ebe410670ffdbbc95faa25a820da44ab11 Author: Claudiu Beznea Date: Fri Oct 6 13:39:59 2023 +0300 clk: renesas: Add minimal boot support for RZ/G3S SoC Add minimal clock and reset support for the RZ/G3S SoC to be able to boot Linux from SD Card/eMMC. This includes necessary core clocks for booting and GIC, SCIF, GPIO, and SD0 module clocks and resets. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20231006103959.197485-5-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a96aed0636d49f39e4c9eb85ef7c8630e12e3421 Merge: 62b1feac48586 e372aee8c2495 Author: Geert Uytterhoeven Date: Tue Oct 10 09:27:38 2023 +0200 Merge tag 'renesas-r9a08g045-dt-binding-defs-tag' into renesas-clk-for-v6.7 Renesas RZ/G3S DT Binding Definitions Clock definitions for the Renesas RZ/G3S (R9A08G045) SoC, shared by driver and DT source files. commit 62b1feac485866494f111e3a6aa4a9ae03a7a2b9 Author: Claudiu Beznea Date: Fri Oct 6 13:39:58 2023 +0300 clk: renesas: rzg2l: Add divider clock for RZ/G3S Add a divider clock driver for RZ/G3S. This will be used on RZ/G3S for the SDHI, SPI, OCTA, I, I2, I3, P0, P1, P2, and P3 core clocks. The divider has some limitation for SDHI, OCTA and SPI clocks: - SDHI div cannot be 1 if parent rate is 800MHz, - OCTA, SPI div cannot be 1 if parent rate is 400MHz. To handle these limitations, a notifier is registered from platform specific clock driver, which makes sure proper actions are taken before the clock rate is changed, when needed. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20231006103959.197485-4-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 13556aef0bdc0e98df7b6bf2e10d706c59dce6f4 Author: Jeff Johnson Date: Mon Oct 9 10:13:54 2023 +0300 wifi: ath12k: Consistently use ath12k_vif_to_arvif() Helper function ath12k_vif_to_arvif() exists to retrieve a struct ath12k_vif from a struct ieee80211_vif. However, in multiple places this logic is open-coded with inline typecasting. Since the typecasting prevents the compiler from type-checking the source and destination, update the driver to consistently use the helper function. No functional changes, compile tested only. Signed-off-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004-ath12k_vif_to_arvif-v1-1-3f38f6882d33@quicinc.com commit e149353e6562f3e3246f75dfc4cca6a0cc5b4efc Author: Aloka Dixit Date: Mon Oct 9 10:13:54 2023 +0300 wifi: ath11k: call ath11k_mac_fils_discovery() without condition Mac80211 does not set flags BSS_CHANGED_FILS_DISCOVERY and BSS_CHANGED_UNSOL_BCAST_PROBE_RESP if there are no updates to FILS discovery and unsolicited broadcast probe response transmission configurations respectively. This results in the transmissions getting stopped during BSS change operations which do not include these attributes. Remove the checks for the flags and always send the existing configuration to firmware. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004044915.6817-1-quic_alokad@quicinc.com commit 258242dac92450dfbdcefca0005af1e9df30018f Author: Dmitry Antipov Date: Mon Oct 9 10:13:53 2023 +0300 wifi: ath12k: remove redundant memset() in ath12k_hal_reo_qdesc_setup() Since 'ath12k_dp_rx_peer_tid_setup()' is the only place where 'struct hal_rx_reo_queue' object is allocated with 'kzalloc()', call to 'memset()' in 'ath12k_hal_reo_qdesc_setup()' may be dropped. Compile tested only. Signed-off-by: Dmitry Antipov Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231002182856.131254-1-dmantipov@yandex.ru commit df1b8356a80ab47a7623e08facf36fe434ea9722 Author: Konrad Dybcio Date: Sat Aug 12 01:20:54 2023 +0200 interconnect: qcom: sm8350: Set ACV enable_mask ACV expects an enable_mask corresponding to the APPS RSC, fill it in. Fixes: d26a56674497 ("interconnect: qcom: Add SM8350 interconnect provider driver") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230811-topic-acv-v2-11-765ad70e539a@linaro.org Signed-off-by: Georgi Djakov commit 9434c6896123141ac1f8f18b3d1751abbecdd03f Author: Konrad Dybcio Date: Sat Aug 12 01:20:53 2023 +0200 interconnect: qcom: sm8250: Set ACV enable_mask ACV expects an enable_mask corresponding to the APPS RSC, fill it in. Fixes: 6df5b349491e ("interconnect: qcom: Add SM8250 interconnect provider driver") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230811-topic-acv-v2-10-765ad70e539a@linaro.org Signed-off-by: Georgi Djakov commit 7ed42176406e5a2c9a5767d0d75690c7d1588027 Author: Konrad Dybcio Date: Sat Aug 12 01:20:52 2023 +0200 interconnect: qcom: sm8150: Set ACV enable_mask ACV expects an enable_mask corresponding to the APPS RSC, fill it in. Fixes: a09b817c8bad ("interconnect: qcom: Add SM8150 interconnect provider driver") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230811-topic-acv-v2-9-765ad70e539a@linaro.org Signed-off-by: Georgi Djakov commit fe7a3abf4111992af3de51d22383a8e8a0affe1e Author: Konrad Dybcio Date: Sat Aug 12 01:20:51 2023 +0200 interconnect: qcom: sm6350: Set ACV enable_mask ACV expects an enable_mask corresponding to the APPS RSC, fill it in. Fixes: 6a6eff73a954 ("interconnect: qcom: Add SM6350 driver support") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230811-topic-acv-v2-8-765ad70e539a@linaro.org Signed-off-by: Georgi Djakov commit f8fe97a9fd2098de0570387029065eef657d50ee Author: Konrad Dybcio Date: Sat Aug 12 01:20:50 2023 +0200 interconnect: qcom: sdm845: Set ACV enable_mask ACV expects an enable_mask corresponding to the APPS RSC, fill it in. Fixes: b5d2f741077a ("interconnect: qcom: Add sdm845 interconnect provider driver") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230811-topic-acv-v2-7-765ad70e539a@linaro.org Signed-off-by: Georgi Djakov commit 7b85ea8b9300be5c2818e1f61a274ff2c4c063ee Author: Konrad Dybcio Date: Sat Aug 12 01:20:49 2023 +0200 interconnect: qcom: sdm670: Set ACV enable_mask ACV expects an enable_mask corresponding to the APPS RSC, fill it in. Fixes: 7e438e18874e ("interconnect: qcom: add sdm670 interconnects") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230811-topic-acv-v2-6-765ad70e539a@linaro.org Signed-off-by: Georgi Djakov commit 688ffb3dcf85fc4b7ea82af842493013747a9e2c Author: Konrad Dybcio Date: Sat Aug 12 01:20:48 2023 +0200 interconnect: qcom: sc8280xp: Set ACV enable_mask ACV expects an enable_mask corresponding to the APPS RSC, fill it in. Fixes: f29dabda7917 ("interconnect: qcom: Add SC8280XP interconnect provider") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230811-topic-acv-v2-5-765ad70e539a@linaro.org Signed-off-by: Georgi Djakov commit 0fcaaed3ff4b99e5b688b799f48989f1e4bb8a8b Author: Konrad Dybcio Date: Sat Aug 12 01:20:47 2023 +0200 interconnect: qcom: sc8180x: Set ACV enable_mask ACV expects an enable_mask corresponding to the APPS RSC, fill it in. Fixes: 9c8c6bac1ae8 ("interconnect: qcom: Add SC8180x providers") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230811-topic-acv-v2-4-765ad70e539a@linaro.org Signed-off-by: Georgi Djakov commit 437b8e7fcd5df792cb8b8095e9f6eccefec6c099 Author: Konrad Dybcio Date: Sat Aug 12 01:20:46 2023 +0200 interconnect: qcom: sc7280: Set ACV enable_mask ACV expects an enable_mask corresponding to the APPS RSC, fill it in. Fixes: 46bdcac533cc ("interconnect: qcom: Add SC7280 interconnect provider driver") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230811-topic-acv-v2-3-765ad70e539a@linaro.org Signed-off-by: Georgi Djakov commit 1ad83c4792722fe134c1352591420702ff7b9091 Author: Konrad Dybcio Date: Sat Aug 12 01:20:45 2023 +0200 interconnect: qcom: sc7180: Set ACV enable_mask ACV expects an enable_mask corresponding to the APPS RSC, fill it in. Fixes: 2d1f95ab9feb ("interconnect: qcom: Add SC7180 interconnect provider driver") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230811-topic-acv-v2-2-765ad70e539a@linaro.org Signed-off-by: Georgi Djakov commit 8517824f0e94d52ab82742106314f0b8875e03c4 Author: Konrad Dybcio Date: Sat Aug 12 01:20:44 2023 +0200 interconnect: qcom: qdu1000: Set ACV enable_mask ACV expects an enable_mask corresponding to the APPS RSC, fill it in. Fixes: 1f51339f7dd0 ("interconnect: qcom: Add QDU1000/QRU1000 interconnect driver") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230811-topic-acv-v2-1-765ad70e539a@linaro.org Signed-off-by: Georgi Djakov commit 16b86e5c03c5b3ef35bf5126b35384faa97428f0 Author: Claudiu Beznea Date: Fri Oct 6 13:39:57 2023 +0300 clk: renesas: rzg2l: Refactor SD mux driver Refactor SD MUX driver to be able to reuse the same code on RZ/G3S. RZ/G2{L,UL} has a limitation with regards to switching the clock source for SD MUX (MUX clock source has to be switched to 266MHz before switching b/w 533MHz and 400MHz). Rework the handling of this limitation to use a clock notifier that is registered according to platform based initialization data, so the SD MUX code can be reused on RZ/G3S. As RZ/G2{L,UL} and RZ/G3S use different bits in different registers to check if the clock switching has been done, this configuration (register offset, register bits and bitfield width) is now passed through struct cpg_core_clk::sconf (status configuration) from platform specific initialization code. Along with struct cpg_core_clk::sconf the mux table indices are also passed from platform specific initialization code. Also, mux flags are now passed to DEF_SD_MUX() as they will be used later by RZ/G3S. CPG_WEN_BIT macro has been introduced to select properly the WEN bit of various registers. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20231006103959.197485-3-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit efa33cd89c8acc510ed0e4dbf98fc1cf3220b9dc Author: Abdel Alkuor Date: Tue Oct 3 11:58:42 2023 -0400 USB: typec: tps6598x: Add status trace for tps25750 tps25750 status register is a subset of tps6598x status register, hence a trace for tps25750 status register is added. Signed-off-by: Abdel Alkuor Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231003155842.57313-10-alkuor@gmail.com Signed-off-by: Greg Kroah-Hartman commit e5d4a413f1368098256aa6c2e5e28855c55e6096 Author: Abdel Alkuor Date: Tue Oct 3 11:58:41 2023 -0400 USB: typec: tps6598x: Add power status trace for tps25750 tps25750 power status register is a subset of tps6598x power status register. Signed-off-by: Abdel Alkuor Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231003155842.57313-9-alkuor@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0aaa6d16183d5a3f24e2c64354473b90bc61b22f Author: Abdel Alkuor Date: Tue Oct 3 11:58:40 2023 -0400 USB: typec: tps6598x: Add trace for tps25750 irq tps25750 event1 register doesn't have all bits in tps6598x event registers, only show the events that are masked Signed-off-by: Abdel Alkuor Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231003155842.57313-8-alkuor@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7e7a3c815d2217011b47b52961ab14cd0f6d8497 Author: Abdel Alkuor Date: Tue Oct 3 11:58:39 2023 -0400 USB: typec: tps6598x: Add TPS25750 support TPS25750 controller requires a binary to be loaded with a configuration binary by an EEPROM or a host. Appling a patch bundling using a host is implemented based on the flow diagram pg.62 in TPS25750 host interface manual. https://www.ti.com/lit/ug/slvuc05a/slvuc05a.pdf The flow diagram can be summarized as following: - Start the patch loading sequence with patch bundle information by executing PBMs - Write the whole patch at once - When writing the patch fails, execute PBMe which instructs the PD controller to end the patching process - After writing the patch successfully, execute PBMc which verifies the patch integrity and applies the patch internally - Wait for the device to switch into APP mode (normal operation) The execuation flow diagram polls the events register and then polls the corresponding register related to the event as well before advancing to the next state. Polling the events register is a redundant step, in this implementation only the corresponding register related to the event is polled. Adding tps25750 support, the followings are being taken care of: - Implement applying patch flow. - When an EEPROM is present, tps25750 loads the binary configuration from EEPROM. Hence, all we need to do is wait for the device to switch to APP mode. - Dead battery flag is cleared after switching tps25750 to APP mode so the PD controller becomes fully functional. - Add port registration as tps25750 doesn't have system configuration register to get dr/pr of the current applied binary configuration. Get data role from the device node and power role from PD status register. - tps25750 event registers structure is different than tps6598x's, tps25750 has 11 bytes of events which are read at once where tps6598x has two event registers of 8 bytes each which are read separately. Likewise MASK event registers. Also, not all events are supported in both devices. Create a new handler to accommodate tps25750 interrupt. - Enable sleep mode so the device enters sleep state when idling. - When the current mode is PTCH, enable tps25750 by loading a configuration patch that switches the device into APP mode. - Add resume and suspend pm for tps25750. Signed-off-by: Abdel Alkuor Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231003155842.57313-7-alkuor@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5bd4853da049924aed5a54fb3250f4438194cb17 Author: Abdel Alkuor Date: Tue Oct 3 11:58:38 2023 -0400 USB: typec: tps6598x: Add device data to of_device_id Part of tps6598x refactoring, we need to move the following functions to device data as tps25750 has different implementation than tps6598x and cd321x: - interrupt handler - port registration - power status trace - status trace Signed-off-by: Abdel Alkuor Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231003155842.57313-6-alkuor@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8f999ce60ea3d47886b042ef1f22bb184b6e9c59 Author: Abdel Alkuor Date: Tue Oct 3 11:58:37 2023 -0400 USB: typec: tps6598x: Refactor tps6598x port registration tps6598x and cd321x use TPS_REG_SYSTEM_CONF to get dr/pr roles where other similar devices don't have this register such as tps25750. Move tps6598x port registration to its own function Signed-off-by: Abdel Alkuor Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231003155842.57313-5-alkuor@gmail.com Signed-off-by: Greg Kroah-Hartman commit c5e95ec39d6424633074fd0397723c002e9e85ac Author: Abdel Alkuor Date: Tue Oct 3 11:58:36 2023 -0400 USB: typec: tps6598x: Add patch mode to tps6598x TPS25750 has a patch mode indicating the device requires a configuration to get the device into operational mode Signed-off-by: Abdel Alkuor Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231003155842.57313-4-alkuor@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6ab6ad09e70795cda79d24b5119e735344133dbd Author: Abdel Alkuor Date: Tue Oct 3 11:58:35 2023 -0400 USB: typec: tsp6598x: Add cmd timeout and response delay Some commands in tps25750 take longer than 1 second to complete, and some responses need some delay before the result becomes available. Signed-off-by: Abdel Alkuor Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231003155842.57313-3-alkuor@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6060d554e89162e6d8c87e9322e26d0fe1f0dd47 Author: Abdel Alkuor Date: Tue Oct 3 11:58:34 2023 -0400 dt-bindings: usb: tps6598x: Add tps25750 TPS25750 is USB TypeC PD controller which is a subset of TPS6598x. Signed-off-by: Abdel Alkuor Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231003155842.57313-2-alkuor@gmail.com Signed-off-by: Greg Kroah-Hartman commit 14485de431b0a860d3a117fe518ce9ede8c76732 Author: Rob Herring Date: Mon Oct 9 16:13:46 2023 -0500 usb: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231009211356.3242037-16-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit c19473d28235a54e92821e927cb55690ad7c5279 Author: Rob Herring Date: Mon Oct 9 16:13:47 2023 -0500 usb: musb: Add missing of.h include The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. Add of.h which is implicitly included by of_platform.h. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231009211356.3242037-17-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit dd976a97d15b47656991e185a94ef42a0fa5cfd4 Author: Muhammad Usama Anjum Date: Mon Oct 9 21:20:20 2023 +0500 tty/sysrq: replace smp_processor_id() with get_cpu() The smp_processor_id() shouldn't be called from preemptible code. Instead use get_cpu() and put_cpu() which disables preemption in addition to getting the processor id. Enable preemption back after calling schedule_work() to make sure that the work gets scheduled on all cores other than the current core. We want to avoid a scenario where current core's stack trace is printed multiple times and one core's stack trace isn't printed because of scheduling of current task. This fixes the following bug: [ 119.143590] sysrq: Show backtrace of all active CPUs [ 119.143902] BUG: using smp_processor_id() in preemptible [00000000] code: bash/873 [ 119.144586] caller is debug_smp_processor_id+0x20/0x30 [ 119.144827] CPU: 6 PID: 873 Comm: bash Not tainted 5.10.124-dirty #3 [ 119.144861] Hardware name: QEMU QEMU Virtual Machine, BIOS 2023.05-1 07/22/2023 [ 119.145053] Call trace: [ 119.145093] dump_backtrace+0x0/0x1a0 [ 119.145122] show_stack+0x18/0x70 [ 119.145141] dump_stack+0xc4/0x11c [ 119.145159] check_preemption_disabled+0x100/0x110 [ 119.145175] debug_smp_processor_id+0x20/0x30 [ 119.145195] sysrq_handle_showallcpus+0x20/0xc0 [ 119.145211] __handle_sysrq+0x8c/0x1a0 [ 119.145227] write_sysrq_trigger+0x94/0x12c [ 119.145247] proc_reg_write+0xa8/0xe4 [ 119.145266] vfs_write+0xec/0x280 [ 119.145282] ksys_write+0x6c/0x100 [ 119.145298] __arm64_sys_write+0x20/0x30 [ 119.145315] el0_svc_common.constprop.0+0x78/0x1e4 [ 119.145332] do_el0_svc+0x24/0x8c [ 119.145348] el0_svc+0x10/0x20 [ 119.145364] el0_sync_handler+0x134/0x140 [ 119.145381] el0_sync+0x180/0x1c0 Cc: jirislaby@kernel.org Cc: stable@vger.kernel.org Fixes: 47cab6a722d4 ("debug lockups: Improve lockup detection, fix generic arch fallback") Signed-off-by: Muhammad Usama Anjum Link: https://lore.kernel.org/r/20231009162021.3607632-1-usama.anjum@collabora.com Signed-off-by: Greg Kroah-Hartman commit c7c5be58620a3b1e5fbaf4daea59f2eb6f8fe034 Author: Max Filippov Date: Sat Oct 7 17:18:04 2023 -0700 serial: add PORT_GENERIC definition Current pattern in the linux kernel is that every new serial driver adds one or more new PORT_ definitions because uart_ops::config_port() callback documentation prescribes setting port->type according to the type of port found, or to PORT_UNKNOWN if no port was detected. When the specific type of the port is not important to the userspace there's no need for a unique PORT_ value, but so far there's no suitable identifier for that case. Provide generic port type identifier other than PORT_UNKNOWN for ports which type is not important to userspace. Suggested-by: Arnd Bergmann Suggested-by: Greg Kroah-Hartman Signed-off-by: Max Filippov Suggested-by: Jiri Slaby Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/20231008001804.889727-1-jcmvbkbc@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3047b5b53c36c2cb7874d3823320ffff6a8bf6b3 Author: Lucas Tanure Date: Mon Oct 9 13:11:51 2023 +0100 tty: serial: meson: Add a earlycon for the S4 SoC The new Amlogic S4 SoC does not have a always-on uart, so add OF_EARLYCON_DECLARE for it. Amlogic T7 will use this as fallback. Signed-off-by: Lucas Tanure Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20231009121151.4509-1-tanure@linux.com Signed-off-by: Greg Kroah-Hartman commit 1fa259cd68e0800e44292d1acf979ea4ea418f49 Author: Dmitry Baryshkov Date: Mon Oct 2 21:59:35 2023 +0300 dt-bindings: opp: opp-v2-kryo-cpu: support Qualcomm Krait SoCs Exted the opp-v2-kryo-cpu.yaml to support defining OPP tables for the previous generation of Qualcomm CPUs, 32-bit Krait-based platforms. It makes no sense to use 'operating-points-v2-kryo-cpu' compatibility node for the Krait cores. Add support for the Krait-specific 'operating-points-v2-krait-cpu' compatibility string and the relevant opp-microvolt subclasses properties. The listed opp-supported-hw values are applicable only to msm8996 / msm8996pro platforms. Remove the enum as other platforms will use other bit values. It makes little sense to list all possible values for all the platforms here. Acked-by: Rob Herring Signed-off-by: Dmitry Baryshkov Signed-off-by: Viresh Kumar commit c12f0d0ffade589599a43b0d0f0965579ca80f76 Author: Sumit Gupta Date: Mon Oct 9 13:54:23 2023 +0530 cpufreq: tegra194: remove redundant AND with cpu_online_mask Remove redundant 'AND' with cpu_online_mask as the policy->cpus always contains only the currently online CPUs. Suggested-by: Viresh Kumar Link: https://lore.kernel.org/lkml/20231003050019.a6mcchw2o2z2wkrh@vireshk-i7/ Signed-off-by: Sumit Gupta [ Viresh: Fix rebase conflict ] Signed-off-by: Viresh Kumar commit a60a556788752a5696960ed11409a552b79e68e8 Author: Sumit Gupta Date: Wed Oct 4 19:35:37 2023 +0530 cpufreq: tegra194: use refclk delta based loop instead of udelay Use reference clock count based loop instead of "udelay()" for sampling of counters to improve the accuracy of re-generated CPU frequency. "udelay()" internally calls "WFE" which stops the counters and results in bigger delta between the last set freq and the re-generated value from counters. The counter sampling window used in loop is the minimum number of reference clock cycles which is known to give a stable value of CPU frequency. The change also helps to reduce the sampling window from "500us" to "<50us". Suggested-by: Antti Miettinen Signed-off-by: Sumit Gupta Signed-off-by: Viresh Kumar commit 6b121b4cf7e1f598beecf592d6184126b46eca46 Author: Sumit Gupta Date: Wed Oct 4 19:35:36 2023 +0530 cpufreq: tegra194: save CPU data to avoid repeated SMP calls Currently, we make SMP call on every frequency set request to get the physical 'CPU ID' and 'CLUSTER ID' for the target CPU. This change optimizes the repeated calls by storing the physical IDs and the per core frequency register offset for all CPUs during boot. Later this info is used directly when required to set the frequency or read it from ACTMON counters. Signed-off-by: Sumit Gupta Signed-off-by: Viresh Kumar commit 9e952929dfe22aa1566d930f363213e1ccfe004d Author: Mark Brown Date: Fri Sep 29 16:26:08 2023 +0200 clk: versaclock7: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-clk-maple-versaclk-v1-4-24dd5b3d8689@kernel.org Signed-off-by: Stephen Boyd commit 2902ba682ae1b59687b5ae8794202a4649e62954 Author: Mark Brown Date: Fri Sep 29 16:26:07 2023 +0200 clk: versaclock5: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-clk-maple-versaclk-v1-3-24dd5b3d8689@kernel.org Signed-off-by: Stephen Boyd commit 4b58a0144b1b041818f89851eea87606a3cd80a1 Author: Mark Brown Date: Fri Sep 29 16:26:06 2023 +0200 clk: versaclock3: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-clk-maple-versaclk-v1-2-24dd5b3d8689@kernel.org Signed-off-by: Stephen Boyd commit df43983922c2307ff0b796913e0ca614f8f51705 Author: Mark Brown Date: Fri Sep 29 16:26:05 2023 +0200 clk: versaclock3: Remove redundant _is_writeable() The versaclock3 driver provides an _is_writeable() function which returns true for all registers. This is the default assumption for regmaps so we can remove the function for a very minor improvement in performance and code size. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-clk-maple-versaclk-v1-1-24dd5b3d8689@kernel.org Signed-off-by: Stephen Boyd commit ebb7a1919f44303abe7623ce2ead4fb948d48fd2 Author: Mark Brown Date: Fri Sep 29 14:22:03 2023 +0200 clk: si570: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-clk-maple-si-v1-5-e26cfcaf27bd@kernel.org Signed-off-by: Stephen Boyd commit 8df090919db2d566233757879adf4ee09de7e818 Author: Mark Brown Date: Fri Sep 29 14:22:02 2023 +0200 clk: si544: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-clk-maple-si-v1-4-e26cfcaf27bd@kernel.org Signed-off-by: Stephen Boyd commit 41d2288629b9a627c4b55f05c6c6998b1e62726d Author: Mark Brown Date: Fri Sep 29 14:22:01 2023 +0200 clk: si5351: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-clk-maple-si-v1-3-e26cfcaf27bd@kernel.org Signed-off-by: Stephen Boyd commit e2ec8f6631739b9319239f5be6354758ad04fb09 Author: Mark Brown Date: Fri Sep 29 14:22:00 2023 +0200 clk: si5341: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-clk-maple-si-v1-2-e26cfcaf27bd@kernel.org Signed-off-by: Stephen Boyd commit 29171344a1cdbf2b897cbbef78649fd0e90f6d67 Author: Mark Brown Date: Fri Sep 29 14:21:59 2023 +0200 clk: si514: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-clk-maple-si-v1-1-e26cfcaf27bd@kernel.org Signed-off-by: Stephen Boyd commit 6fc469ab7fe50e03abef0550482613d736bd1e9b Author: Mark Brown Date: Fri Sep 29 14:03:43 2023 +0200 clk: cdce925: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230929-clk-rbtree-cdce925-v1-1-a36b459002f7@kernel.org Signed-off-by: Stephen Boyd commit 831187c6946f29ba8309d386d5ca466eec8b9f79 Author: Stephen Boyd Date: Tue Sep 12 10:55:31 2023 -0700 clk: Parameterize clk_leaf_mux_set_rate_parent Transform the existing clk_leaf_mux_set_rate_parent test into a parameterized test that calls the various determine rate APIs that exist for clk providers. This ensures that whatever determine rate API is used by a clk provider will return the correct parent in the best_parent_hw pointer of the clk_rate_request because clk_rate_requests are forwarded properly. Cc: Guenter Roeck Cc: Maxime Ripard Link: https://lore.kernel.org/r/20230912175534.2427862-3-sboyd@kernel.org Acked-by: Maxime Ripard Signed-off-by: Stephen Boyd commit 096b256c9a786b42199fcb63ef5d9f65c312a3f6 Author: Stephen Boyd Date: Tue Sep 12 10:55:30 2023 -0700 clk: Drive clk_leaf_mux_set_rate_parent test from clk_ops Running this kunit test with lockdep enabled leads to warning splats about calling clk provider APIs without the clk_prepare lock held. I proposed adding a wrapper around these APIs to grab the prepare lock so we can call them from anywhere, and Maxime implemented that approach[1], but it didn't look great. That's because we had to make more kunit testing APIs just to call code from a place that isn't a clk provider when the prepare lock isn't held. Instead of doing that, let's implement a determine_rate clk_op for a new leaf clk that is the child of the existing leaf clk. We can call __clk_determine_rate() on the existing leaf clk from there, and stash away the clk_rate_request struct to check once the clk_op returns. Drive that clk_op by calling clk_round_rate() to keep things similar to how it was before (i.e. nothing actually changes rate, just the new rate is determined). This silences the warning by driving the test from a clk_op where we know the prepare lock is held. While looking at this in more detail, it was determined that the code we intended to test in commit 262ca38f4b6e ("clk: Stop forwarding clk_rate_requests to the parent") wasn't actually tested. The call to __clk_determine_rate() wasn't actually getting to the newly introduced code under the CLK_SET_RATE_PARENT if condition in clk_core_round_rate_nolock() because the parent clk (the mux) could round rates. We introduce a new leaf and make sure the parent of that clk has no clk_ops so that we can be certain that the CLK_SET_RATE_PARENT condition in clk_core_round_rate_nolock() is evaluated. Reported-by: Guenter Roeck Closes: https://lore.kernel.org/linux-clk/2b594e50-2bbf-4a2d-88e6-49fc39f3957a@roeck-us.net/ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202301310919.b9d56ee3-yujie.liu@intel.com Cc: Maxime Ripard Link: https://lore.kernel.org/r/20230721-clk-fix-kunit-lockdep-v1-0-32cdba4c8fc1@kernel.org [1] Fixes: 262ca38f4b6e ("clk: Stop forwarding clk_rate_requests to the parent") Link: https://lore.kernel.org/r/20230912175534.2427862-2-sboyd@kernel.org Acked-by: Maxime Ripard Signed-off-by: Stephen Boyd commit b4383609a00984513fe5673c80905c7fae139537 Author: Adam Ford Date: Sun Oct 8 09:02:38 2023 -0500 arm64: dts: imx8mp-beacon: Add DMIC support The baseboard has a connector for a pulse density microphone. This is connected via the micfil interface and uses the DMIC audio codec with the simple-audio-card. Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 2b49b88927d4f97d9abe3958a5dd52c2f47a3014 Author: Adam Ford Date: Sun Oct 8 09:02:37 2023 -0500 arm64: dts: imx8mn-beacon: Add DMIC support The baseboard has a connector for a pulse density microphone. This is connected via the micfil interface and uses the DMIC audio codec with the simple-audio-card. Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit a9c8d7f77c26d07dc443c6d4a75f2543c56423de Author: Adam Ford Date: Sun Oct 8 09:02:36 2023 -0500 arm64: dts: imx8mm-beacon: Add DMIC support The baseboard has a connector for a pulse density microphone. This is connected via the micfil interface and uses the DMIC audio codec with the simple-audio-card. Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 189399a4ca82cc9bb4eb1d269970715fe4dad132 Author: Adam Ford Date: Sun Oct 8 09:02:35 2023 -0500 arm64: dts: imx8mm-beacon: Migrate sound card to simple-audio-card Instead of using a custom glue layer connecting the wm8962 CODEC to the SAI3 sound-dai, migrate the sound card to simple-audio-card. This also brings this board in line with the imx8mn-beacon and imx8mp-beacon. Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 5c24548607a7bacf1a8aee45b5d65faa5018c1ff Author: Fabio Estevam Date: Fri Oct 6 17:43:38 2023 -0300 arm64: dts: imx8mn-evk: Remove codec clocks/clock-names Per wlf,wm8524.yaml, 'clocks' and 'clock-names' are not valid properties. Remove them to fix the following schema warning: audio-codec: Unevaluated properties are not allowed ('clock-names', 'clocks' were unexpected) from schema $id: http://devicetree.org/schemas/sound/wlf,wm8524.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 63c46b51c7995d8aeb4b44493633f4ce1dcf62bc Author: Adam Ford Date: Wed Oct 4 18:51:47 2023 -0500 arm64: dts: imx8mp-beacon: Configure 100MHz PCIe Ref Clk There is a I2C controlled 100MHz Reference clock used by the PCIe controller. Configure this clock's DIF1 output to be used by the PCIe. Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit db1925454a2e7cadcac8756442ca7c3198332336 Author: Adam Ford Date: Wed Oct 4 18:01:59 2023 -0500 arm64: dts: imx8mn: Add sound-dai-cells to micfil node Per the DT bindings, the micfil node should have a sound-dai-cells entry. Fixes: cca69ef6eba5 ("arm64: dts: imx8mn: Add support for micfil") Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 0e6cc2b8bb7d67733f4a47720787eff1ce2666f2 Author: Adam Ford Date: Wed Oct 4 18:01:58 2023 -0500 arm64: dts: imx8mm: Add sound-dai-cells to micfil node Per the DT bindings, the micfil node should have a sound-dai-cells entry. Fixes: 3bd0788c43d9 ("arm64: dts: imx8mm: Add support for micfil") Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 690aae3b3adc4e62ae1a9af5dd1f95d1cb23bda5 Author: Gregor Herburger Date: Mon Oct 2 10:43:54 2023 +0200 arm64: dts: freescale: add initial device tree for TQMLS1088A This adds support for TQMLS1088A SOM on MBLS10xxA baseboard. Signed-off-by: Gregor Herburger Signed-off-by: Shawn Guo commit 981e850f46e2fb9658e692da65143fc088ac3445 Author: Gregor Herburger Date: Mon Oct 2 10:43:52 2023 +0200 arm64: dts: freescale: add initial device tree for TQMLS1043A/TQMLS1046A This adds support for the TQMLS1043A and TQMLS1046A SOM and the MBLS10xxA baseboard. TQMLS1043A and TQMLS1046A share a common layout and can be used on the MBLS10xxA. Signed-off-by: Gregor Herburger Signed-off-by: Shawn Guo commit f9d6a6e68e7262b8163041745d976e83faefc603 Author: Gregor Herburger Date: Mon Oct 2 10:43:50 2023 +0200 arm64: dts: ls1043a: remove second dspi node According to the documentation the ls1043a has only one spi controller. So remove the second one. Signed-off-by: Gregor Herburger Signed-off-by: Shawn Guo commit 5093b190f9ce9f5d32f11973e674616f8bf6b73f Author: Josua Mayer Date: Sun Oct 1 12:32:59 2023 +0200 arm64: dts: freescale: Add support for LX2162 SoM & Clearfog Board Add support for the SolidRun LX2162A System on Module (SoM), and the Clearfog evaluation board. The SoM has few software-controllable features: - AR8035 Ethernet PHY - eMMC - SPI Flash - fan controller - various eeproms The Clearfog evaluation board provides: - microSD connector - USB-A - 2x 10Gbps SFP+ - 2x 25Gbps SFP+ with a retimer - 8x 2.5Gbps RJ45 - 2x mPCI (assembly option / disables 2xRJ45) The 8x RJ45 ports are connected with an 8-port PHY: Marvell 88E2580 supporting up to 5Gbps, while SoC and magnetics are limited to 2.5Gbps. However 2500 speed is untested due to documentation and drivier limitations. To avoid confusion the phy nodes have been explicitly limited to 1000 for now. The PCI nodes are disabled, but explicitly added to mark that this board can have pci. It is expected that the bootloader will patch the status property "okay" and disable 2x RJ45 ports, according to active serdes configuration. Signed-off-by: Josua Mayer Signed-off-by: Shawn Guo commit 2f2900176b444156740f13241f71a0a4dca0fba6 Author: Josua Mayer Date: Sun Oct 1 12:32:56 2023 +0200 arm64: dts: lx2160a: describe the SerDes block #2 Add description for the LX2160A second SerDes block. It is functionally identical to the first one already added in commit 3cbe93a1f540 ("arch: arm64: dts: lx2160a: describe the SerDes block #1"). The SerDes driver currently updates the registers of all 8 lanes by default during probe. Because currently this driver only supports configuration of network protocols, this can lead to problems with certain configurations. Set status property to "disabled" by default so that existing boards are not impacted. Signed-off-by: Josua Mayer Signed-off-by: Shawn Guo commit c1d0782b5fc305196c6b096eb38f56db22ef7df2 Author: Peng Fan Date: Sun Oct 1 16:27:58 2023 +0800 arm64: dts: imx93: update gpio node Per binding doc, i.MX93 GPIO supports two interrupts and one register base, compatible with i.MX8ULP. The current fsl,imx7ulp-gpio compatible could work for i.MX93 in gpio-vf610.c driver, it is based on the base address are splited into two with offset added in device tree node. Now following hardware design, using one register base in device tree node. This may break users who use compatible fsl,imx7ulp-gpio to enable i.MX93 GPIO. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit ac7bcf48ddbae7a22fcb7ffbb8f7333bf92d880f Author: Peng Fan Date: Sun Oct 1 16:27:57 2023 +0800 arm64: dts: imx8ulp: update gpio node The i.MX8ULP GPIO supports two interrupts and one register base, the current fsl,imx7ulp-gpio compatible could work for i.MX8ULP in gpio-vf610.c driver, it is based on the base address are splited into two with offset added in device tree node. Now following hardware design, using one register base in device tree node. This may break users who use compatible fsl,imx7ulp-gpio to enable i.MX8ULP GPIO. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit d403e1dc7bd57e785a9c7c385dc02adf93d8f5be Author: Fabio Estevam Date: Fri Sep 29 10:25:41 2023 -0300 arm64: dts: imx8mq-librem5: Fix tps65132 compatible The valid compatible string for the tps65132 regulator is "ti,tps65132". Change it. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 0ce9a2c121e3ab354cf66aeecd3ed0758f3c5067 Author: Fabio Estevam Date: Fri Sep 29 10:11:23 2023 -0300 arm64: dts: imx8mp-debix-model-a: Remove USB hub reset-gpios The SAI2_TXC pin is left unconnected per the imx8mp-debix-model-a schematics: https://debix.io/Uploads/Temp/file/20230331/DEBIX%20Model%20A%20Schematics.pdf Also, the RTS5411E USB hub chip does not have a reset pin. Remove this pin description to properly describe the hardware. This also fixes the following schema warning: hub@1: 'reset-gpios' does not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/usb/realtek,rts5411.yaml# Fixes: 0253e1cb6300 ("arm64: dts: imx8mp-debix: add USB host support") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit d57ba7ac6db22c16d0f60014995a6053d37842b9 Author: Fabio Estevam Date: Fri Sep 29 09:40:32 2023 -0300 arm64: dts: imx8-apalis-v1.1: Fix Ethernet PHY reset-names Per ethernet-phy.yaml, the expected value for the 'reset-names' property is "phy". Change it accordingly to fix the following schema warning: imx8qm-apalis-ixora-v1.1.dtb: ethernet-phy@7: reset-names:0: 'phy' was expected from schema $id: http://devicetree.org/schemas/net/ethernet-phy.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 82e13c3948d8ac555c0dafa188c9e111bedc9400 Author: Fabio Estevam Date: Fri Sep 29 09:30:29 2023 -0300 arm64: dts: imx8mm-venice-gw790: Remove phy-mode from switch node Per microchip,ksz.yaml, phy-mode is not a valid property in the top-level switch node. phy-mode = "rgmii-id" is already passed in the CPU port switch (port@5). Remove it from the top-level switch node to fix the following schema warning: switch@5f: Unevaluated properties are not allowed ('phy-mode' was unexpected) from schema $id: http://devicetree.org/schemas/net/dsa/microchip,ksz.yaml Signed-off-by: Fabio Estevam Acked-by: Tim Harvey Signed-off-by: Shawn Guo commit 2b3ab9d81ab477d0480ba0efee293e3818edbe7a Author: Tim Harvey Date: Thu Sep 28 13:13:54 2023 -0700 arm64: dts: imx8mp-venice-gw73xx: add TPM device Add the TPM device found on the GW73xx revision F PCB. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 4f2a348aa365478c930095ba0694e74c0e5e0c7f Author: Tim Harvey Date: Thu Sep 28 13:13:28 2023 -0700 arm64: dts: imx8mm-venice-gw73xx: add TPM device Add the TPM device found on the GW73xx revision F PCB. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit cfbd0a329b3f0c9fc20fcdcb70379bae9c954a50 Author: Fabio Estevam Date: Wed Sep 27 23:34:53 2023 -0300 arm64: dts: imx8mp-verdin: Remove invalid property from eqos Per nxp,dwmac-imx.yaml, it is not valid to pass 'phy-supply'. The reg_module_eth1phy regulator is marked with 'regulator-always-on', so it is safe to remove it from the eqos node. Remove it to fix the following schema warning: imx8mp-verdin-nonwifi-dahlia.dtb: ethernet@30bf0000: Unevaluated properties are not allowed ('phy-supply' was unexpected) from schema $id: http://devicetree.org/schemas/net/nxp,dwmac-imx.yaml# Signed-off-by: Fabio Estevam Tested-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 1d33cd614d89b0ec024d25ec45acf4632211b5a7 Author: Fabio Estevam Date: Tue Sep 26 11:27:36 2023 -0300 arm64: dts: imx8qm-ss-img: Fix jpegenc compatible entry The first compatible entry for the jpegenc should be 'nxp,imx8qm-jpgenc'. Change it accordingly to fix the following schema warning: imx8qm-apalis-eval.dtb: jpegenc@58450000: compatible: 'oneOf' conditional failed, one must be fixed: 'nxp,imx8qm-jpgdec' is not one of ['nxp,imx8qxp-jpgdec', 'nxp,imx8qxp-jpgenc'] 'nxp,imx8qm-jpgenc' was expected 'nxp,imx8qxp-jpgdec' was expected Fixes: 5bb279171afc ("arm64: dts: imx8: Add jpeg encoder/decoder nodes") Signed-off-by: Fabio Estevam Reviewed-by: Mirela Rabulea Reviewed-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 295213436529502d679e521217b778ca11b5c2b1 Merge: 0bb80ecc33a8f 87882525e5dda Author: Stephen Boyd Date: Mon Oct 9 20:04:37 2023 -0700 Merge tag 'renesas-clk-for-v6.7-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: - Miscellaneous fixes and improvements * tag 'renesas-clk-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: r8a7795: Constify r8a7795_*_clks clk: renesas: r9a06g032: Name anonymous structs clk: renesas: r9a06g032: Fix kerneldoc warning clk: renesas: rzg2l: Use u32 for flag and mux_flags clk: renesas: rzg2l: Use FIELD_GET() for PLL register fields clk: renesas: rzg2l: Simplify the logic in rzg2l_mod_clock_endisable() clk: renesas: rzg2l: Use core->name for clock name clk: renesas: r9a06g032: Use for_each_compatible_node() commit a725990557e7d19b74aa6612ece312ae32acb692 Author: Fabio Estevam Date: Tue Sep 26 11:18:54 2023 -0300 arm64: dts: imx93: Fix the dmas entries order Per fsl-lpuart.yaml, the dmas and dma-names entries should be 'rx' followed by 'tx'. Change the order to fix the following schema warning: imx93-11x11-evk.dtb: serial@44380000: dma-names:0: 'rx' was expected from schema $id: http://devicetree.org/schemas/serial/fsl-lpuart.yaml# imx93-11x11-evk.dtb: serial@44380000: dma-names:1: 'tx' was expected from schema $id: http://devicetree.org/schemas/serial/fsl-lpuart.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 9d785adb1dc48d7865f4155c970e1c8e73bb0f33 Author: Fabio Estevam Date: Tue Sep 26 09:44:16 2023 -0300 arm64: dts: imx8mm-venice-gw790: Pass GSC address/size-cells Per gateworks-gsc.yaml, #address-cells and #size-cells are mandatory properties. Pass them to fix the following schema warning: imx8mm-venice-gw7903.dtb: gsc@20: '#address-cells' is a required property from schema $id: http://devicetree.org/schemas/mfd/gateworks-gsc.yaml# imx8mm-venice-gw7903.dtb: gsc@20: '#size-cells' is a required property from schema $id: http://devicetree.org/schemas/mfd/gateworks-gsc.yaml# Signed-off-by: Fabio Estevam Acked-by: Tim Harvey Signed-off-by: Shawn Guo commit 33a859b894cd6fc25319a7c1bc1b5b7b334d7dee Author: Fabio Estevam Date: Tue Sep 26 09:29:57 2023 -0300 arm64: dts: imx8dxl: Pass fsl,imx8dxl-sc-wdt Pass 'fsl,imx8dxl-sc-wdt' to fix the following schema warning: system-controller: watchdog:compatible:0: 'fsl,imx8qxp-sc-wdt' was expected from schema $id: http://devicetree.org/schemas/firmware/fsl,scu.yaml# system-controller: watchdog:compatible: ['fsl,imx-sc-wdt'] is too short from schema $id: http://devicetree.org/schemas/firmware/fsl,scu.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 68a8c8d96b8b6c4490ca806c8a1efd1aa2e8447c Author: Fabio Estevam Date: Tue Sep 26 09:29:55 2023 -0300 arm64: dts: imx8dxl: Pass fsl,imx8dxl-sc-thermal Pass 'fsl,imx8dxl-sc-thermal' to fix the following schema warning: system-controller: thermal-sensor:compatible:0: 'fsl,imx8qxp-sc-thermal' was expected from schema $id: http://devicetree.org/schemas/firmware/fsl,scu.yaml# system-controller: thermal-sensor:compatible: ['fsl,imx-sc-thermal'] is too short from schema $id: http://devicetree.org/schemas/firmware/fsl,scu.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 70eb14afc7b71587f377becba8f916cfb92a4a0e Author: Fabio Estevam Date: Tue Sep 26 09:29:53 2023 -0300 arm64: dts: imx8dxl: Remove wakeup-irq wakeup-irq is not documented, and not used anywhere. Remove it. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 0a1a63d7bbae8d30080993c4c8d851ec2ddd5cd1 Author: Fabio Estevam Date: Tue Sep 26 09:29:52 2023 -0300 arm64: dts: imx8dxl: Pass fsl,imx8dl-scu-pd Pass 'fsl,imx8dl-scu-pd' to fix the following schema warning: system-controller: power-controller:compatible:0: 'fsl,scu-pd' is not one of ['fsl,imx8qm-scu-pd', 'fsl,imx8qxp-scu-pd'] from schema $id: http://devicetree.org/schemas/firmware/fsl,scu.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 5f0a55f6f2e34b2db03b387eae8ff03da72b755b Author: Frank Li Date: Mon Sep 25 16:49:13 2023 -0400 arm64: dts: imx8qm-mek: enable 8qm lpuart2 and lpuart3 Enable uart2 and uart3 for imx8qm-mek board. Signed-off-by: Frank Li Signed-off-by: Shawn Guo commit f4f9f6bf433828a1fe4b8365922916d505fdb61d Author: Frank Li Date: Mon Sep 25 16:49:12 2023 -0400 arm64: dts: imx8qxp-mek: enable 8qxp lpuart2 and lpuart3 Enable uart2 and uart3 for imx8qxp-mek board. Signed-off-by: Frank Li Signed-off-by: Shawn Guo commit e0d5a28be0789af6b36cd9620d895a158eb0c3dd Author: Frank Li Date: Mon Sep 25 16:49:11 2023 -0400 arm64: dts: imx8: update lpuart[0..3] irq number Original irq number combined UART irq and DMA irq. These doesn't match uart driver and dma engine's expection. Update to the irq numbers, which just uart can trigger. Signed-off-by: Frank Li Signed-off-by: Shawn Guo commit 232f80f0daa6bea2feb15be2028a9345f7e17b79 Author: Frank Li Date: Mon Sep 25 16:49:10 2023 -0400 arm64: dts: imx8qm: Update edma channel for uart[0..3] imx8qm have difference dma channel number for uart[0..3]. Signed-off-by: Frank Li Signed-off-by: Shawn Guo commit eee3cad9b2b764cb8bf4f4ce1b663bf0ad08632e Author: Frank Li Date: Mon Sep 25 16:49:09 2023 -0400 arm64: dts: imx8: add edma for uart[0..3] Add dma support uart[0..3]. Signed-off-by: Frank Li Signed-off-by: Shawn Guo commit e4d7a330fb7a0634ce9211e3c76594a86967e0d0 Author: Frank Li Date: Mon Sep 25 16:49:08 2023 -0400 arm64: dts: imx8: add edma[0..3] edma is missed, add them. Signed-off-by: Frank Li Signed-off-by: Shawn Guo commit b39d5016456871a88f5cd141914a5043591b46f3 Author: Laurentiu Tudor Date: Mon Sep 25 18:10:15 2023 +0300 arm64: dts: ls208xa: use a pseudo-bus to constrain usb dma size Wrap the usb controllers in an intermediate simple-bus and use it to constrain the dma address size of these usb controllers to the 40b that they generate toward the interconnect. This is required because the SoC uses 48b address sizes and this mismatch would lead to smmu context faults [1] because the usb generates 40b addresses while the smmu page tables are populated with 48b wide addresses. [1] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1 xhci-hcd xhci-hcd.0.auto: hcc params 0x0220f66d hci version 0x100 quirks 0x0000000002000010 xhci-hcd xhci-hcd.0.auto: irq 108, io mem 0x03100000 xhci-hcd xhci-hcd.0.auto: xHCI Host Controller xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2 xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed arm-smmu 5000000.iommu: Unhandled context fault: fsr=0x402, iova=0xffffffb000, fsynr=0x0, cbfrsynra=0xc01, cb=3 Signed-off-by: Laurentiu Tudor Signed-off-by: Shawn Guo commit 2738a857449004b120e968e914c1f60b28a6fd9f Author: Yannic Moog Date: Mon Sep 25 09:25:19 2023 +0200 arm64: dts: freescale: add phyGATE-Tauri i.MX 8M Mini Support phyGATE-Tauri uses a phyCORE-i.MX8MM SoM. Add device tree for the board. Signed-off-by: Yannic Moog Signed-off-by: Shawn Guo commit c9a4d308ca462afc67b4fba5032b118f09667dc1 Merge: 109ff9ed0f3c3 f09752eaf0e8f Author: Shawn Guo Date: Tue Oct 10 10:51:36 2023 +0800 Merge tag 'imx-fixes-6.6' into imx/dt64 i.MX fixes for 6.6: - A couple of i.MX8MP device tree changes from Adam Ford to fix clock configuration regressions caused by 16c984524862 ("arm64: dts: imx8mp: don't initialize audio clocks from CCM node"). - Fix pmic-irq-hog GPIO line in imx93-tqma9352 device tree. - Fix a mmemory leak with error handling path of imx_dsp_setup_channels() in imx-dsp driver. - Fix HDMI node in imx8mm-evk device tree. - Add missing clock enable functionality for imx8mm_soc_uid() function in soc-imx8m driver. - Add missing imx8mm-prt8mm.dtb build target. commit 8cea95b0bd7930367f11e2abceda6e096dd18943 Author: Jakub Kicinski Date: Fri Oct 6 06:50:32 2023 -0700 tools: ynl-gen: handle do ops with no input attrs The code supports dumps with no input attributes currently thru a combination of special-casing and luck. Clean up the handling of ops with no inputs. Create empty Structs, and skip printing of empty types. This makes dos with no inputs work. Tested-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/20231006135032.3328523-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit a4cd2f311a9a51a727db0a5cc535bb223b0e8453 Merge: c042353955954 7049fd5df78cf Author: Jakub Kicinski Date: Mon Oct 9 19:44:58 2023 -0700 Merge branch 'tools-ynl-gen-lift-type-requirement-for-attribute-subsets' Jiri Pirko says: ==================== tools: ynl-gen: lift type requirement for attribute subsets Remove the requirement from schema files to specify the "type" for attribute subsets and adjust existing schema files. ==================== Link: https://lore.kernel.org/r/20231006114436.1725425-1-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit 7049fd5df78cf0e7463d8e8bb41db60b6762df6c Author: Jiri Pirko Date: Fri Oct 6 13:44:36 2023 +0200 netlink: specs: remove redundant type keys from attributes in subsets No longer needed to define type for subset attributes. Remove those. Signed-off-by: Jiri Pirko Reviewed-by: Jakub Kicinski Link: https://lore.kernel.org/r/20231006114436.1725425-3-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit e18f3dc2beaa5055e27334cd2d8b492bc3e9b3a4 Author: Jiri Pirko Date: Fri Oct 6 13:44:35 2023 +0200 tools: ynl-gen: lift type requirement for attribute subsets In case an attribute is used in a subset, the type has to be currently specified. As the attribute is already defined in the original set, this is a redundant information in yaml file, moreover, may lead to inconsistencies. Example: attribute-sets: ... name: pin enum-name: dpll_a_pin attributes: ... - name: parent-id type: u32 ... - name: pin-parent-device subset-of: pin attributes: - name: parent-id type: u32 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Remove the requirement from schema files to specify the "type" for attribute subsets. Signed-off-by: Jiri Pirko Reviewed-by: Jakub Kicinski Link: https://lore.kernel.org/r/20231006114436.1725425-2-jiri@resnulli.us Signed-off-by: Jakub Kicinski commit c0423539559547d49cb62e76574599593829dcf8 Author: Justin Stitt Date: Thu Oct 5 22:52:34 2023 +0000 cavium/liquidio: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect `app_name` to be NUL-terminated: dev_info(&oct->pci_dev->dev, "Running %s (%llu Hz)\n", app_name, CVM_CAST64(cs->corefreq)); ... and it seems NUL-padding is not required, let's opt for strscpy(). For `oct->boardinfo.name/serial_number` let's opt for strscpy() as well since it is expected to be NUL-terminated and does not require NUL-padding as `oct` is zero-initialized in octeon_device.c +707: | buf = vzalloc(size); | if (!buf) | return NULL; | | oct = (struct octeon_device *)buf; Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231005-strncpy-drivers-net-ethernet-cavium-liquidio-octeon_device-c-v1-1-9a207cef9438@google.com Signed-off-by: Jakub Kicinski commit a16724289af0da1f922e41fd09f229f0beec10f9 Author: Justin Stitt Date: Thu Oct 5 21:55:06 2023 +0000 liquidio: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. NUL-padding is not required as rep_cfg is memset to 0: | memset(&rep_cfg, 0, sizeof(rep_cfg)); A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231005-strncpy-drivers-net-ethernet-cavium-liquidio-lio_vf_rep-c-v1-1-92123a747780@google.com Signed-off-by: Jakub Kicinski commit 092b0be650325b3db490b48182ae23dba0b5755c Author: Justin Stitt Date: Thu Oct 5 21:41:01 2023 +0000 net: liquidio: replace deprecated strncpy with strscpy_pad `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We know `fw_type` must be NUL-terminated based on use here: | static bool fw_type_is_auto(void) | { | return strncmp(fw_type, LIO_FW_NAME_TYPE_AUTO, | sizeof(LIO_FW_NAME_TYPE_AUTO)) == 0; | } ...and here | module_param_string(fw_type, fw_type, sizeof(fw_type), 0444); Let's opt to NUL-pad the destination buffer as well so that we maintain the same exact behavior that `strncpy` provided here. A suitable replacement is `strscpy_pad` due to the fact that it guarantees both NUL-termination and NUL-padding on the destination buffer. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231005-strncpy-drivers-net-ethernet-cavium-liquidio-lio_main-c-v1-1-663e3f1d8f99@google.com Signed-off-by: Jakub Kicinski commit 52cdbea1a54aba106e6c616c0500a12a965ecbbe Author: Justin Stitt Date: Thu Oct 5 21:33:19 2023 +0000 liquidio: replace deprecated strncpy/strcpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. NUL-padding is not required as drvinfo is memset to 0: | memset(drvinfo, 0, sizeof(struct ethtool_drvinfo)); A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231005-strncpy-drivers-net-ethernet-cavium-liquidio-lio_ethtool-c-v1-1-ab565ab4d197@google.com Signed-off-by: Jakub Kicinski commit 0aba524728f0d893829f6909c40608390a1912c1 Author: Justin Stitt Date: Thu Oct 5 20:51:40 2023 +0000 bcm63xx_enet: replace deprecated strncpy with strscpy strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. A suitable replacement is strscpy() [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. bcm_enet_get_drvinfo() already uses strscpy(), let's match it's implementation: | static void bcm_enet_get_drvinfo(struct net_device *netdev, | struct ethtool_drvinfo *drvinfo) | { | strscpy(drvinfo->driver, bcm_enet_driver_name, sizeof(drvinfo->driver)); | strscpy(drvinfo->bus_info, "bcm63xx", sizeof(drvinfo->bus_info)); | } Note that now bcm_enet_get_drvinfo() and bcm_enetsw_get_drvinfo() do the exact same thing. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231005-strncpy-drivers-net-ethernet-broadcom-bcm63xx_enet-c-v1-1-6823b3c3c443@google.com Signed-off-by: Jakub Kicinski commit 3a9dd87084faa6b60ab30a48bc27f849f490d5b3 Author: Gregor Herburger Date: Mon Oct 2 10:43:53 2023 +0200 dt-bindings: arm: fsl: Add TQ-Systems LS1088 based boards TQMLS1088a uses a common board layout with TQMLS1043A/TQMLS1046A. MBLS10XXA is a starterkit baseboard usable for these SOMs. Acked-by: Conor Dooley Signed-off-by: Gregor Herburger Signed-off-by: Shawn Guo commit 94230b8b4f46437f9bee39cc862f715630055490 Author: Gregor Herburger Date: Mon Oct 2 10:43:51 2023 +0200 dt-bindings: arm: fsl: Add TQ-Systems LS1043A/LS1046A based boards TQMLS1043A and TQMLS1046A use the LS1043A LS1046A SOC on a common layout. MBLS10XXA is a starterkit baseboard usable for both SOMs. Acked-by: Conor Dooley Signed-off-by: Gregor Herburger Signed-off-by: Shawn Guo commit b6f2e063017b92491976a40c32a0e4b3c13e7d2f Author: Dan Carpenter Date: Mon Oct 2 10:03:35 2023 +0300 scsi: ufs: qcom: Remove unnecessary check The "attr" pointer points to an offset into the "host" struct so it can't be NULL. Delete the if statement and pull the code in a tab. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/fe3b8fcd-64a7-4887-bddd-32239a88a6a3@moroto.mountain Signed-off-by: Martin K. Petersen commit fcf3fb7bd50c08e1bef8de0d36e62e53b58ceb8a Author: Andy Shevchenko Date: Mon Oct 2 16:51:25 2023 +0300 scsi: ufs: ufs-pci: Switch to use acpi_evaluate_dsm_typed() The acpi_evaluate_dsm_typed() provides a way to check the type of the object evaluated by _DSM call. Use it instead of open coded variant. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231002135125.2602895-1-andriy.shevchenko@linux.intel.com Reviewed-by: Avri Altman Signed-off-by: Martin K. Petersen commit bc8e03e9f9ae2be94d3c188d4a3251f7b9e1aebc Author: Josua Mayer Date: Sun Oct 1 12:32:58 2023 +0200 dt-bindings: arm: Add SolidRun LX2162A SoM & Clearfog Board SolidRun now have 2 product lines around NXP Layerscape SoC: - LX2160A COM Express 7 - LX2162A System on Module LX2162 is a smaller package and reduced feature set to LX2160A; LX2162 SoM is also a smaller form factor and reduced feature set to CEX. Since both product lines are physically incompatible, the existing group "SolidRun LX2160A based Boards" has been renamed to include "CEX" in its name, meaning products based on LX2160A COM Express Module, following this pattern: "solidrun,", "solidrun,lx2160a-cex", "fsl,lx2160a" Add DT compatible for both SolidRun LX2162A SoM, and LX2162 Clearfog boards to a new group based on LX2162A SoM, following this pattern: "solidrun,", "solidrun,lx2162a-som", "fsl,lx2160a" Signed-off-by: Josua Mayer Reviewed-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit e66413faa5b55800ad42a570aad674aed634c5e6 Author: Peter Wang Date: Wed Oct 4 14:24:54 2023 +0800 scsi: ufs: core: Remove dev cmd clock scaling busy If a dev command times out, clk_scaling.active_reqs is not decreased which causes abnormal clock scaling. It is complicated to handle different dev command timeout cases in both legacy mode and MCQ mode. Besides, dev cmds are rarely used and the busy time is short. Remove clock scaling busy window for dev cmds like we do for UIC or TM cmds which don't update busy window either. Signed-off-by: Peter Wang Link: https://lore.kernel.org/r/20231004062454.29165-1-peter.wang@mediatek.com Reviewed-by: Stanley Chu Signed-off-by: Martin K. Petersen commit 45e833f0e5bb1985721d4a52380db47c5dad2d49 Author: Justin Stitt Date: Tue Oct 3 22:15:45 2023 +0000 scsi: message: fusion: Replace deprecated strncpy() with strscpy() strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. The only caller of mptsas_exp_repmanufacture_info() is mptsas_probe_one_phy() which can allocate rphy in either sas_end_device_alloc() or sas_expander_alloc(). Both of which zero-allocate: | rdev = kzalloc(sizeof(*rdev), GFP_KERNEL); ... this is supplied to mptsas_exp_repmanufacture_info() as edev meaning that no future NUL-padding of edev members is needed. Considering the above, a suitable replacement is strscpy() [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Also use the more idiomatic strscpy() pattern of (dest, src, sizeof(dest)). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Cc: Kees Cook Signed-off-by: Justin Stitt Link: https://lore.kernel.org/r/20231003-strncpy-drivers-message-fusion-mptsas-c-v2-1-5ce07e60bd21@google.com Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit 4280a0a70170f60df83ddb46eaee7bbbe88622d9 Author: Justin Stitt Date: Wed Sep 27 04:06:09 2023 +0000 scsi: message: fusion: Replace deprecated strncpy() with strscpy_pad() strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. Since all these structs are copied out to userspace let's keep them NUL-padded by using strscpy_pad() which guarantees NUL-termination of the destination buffer while also providing the NUL-padding behavior that strncpy() has. Let's also opt to use the more idiomatic strscpy() usage of: 'dest, src, sizeof(dest)' in cases where the compiler can determine the size of the destination buffer. Do this for all cases of strscpy...() in this file. To be abundantly sure we don't leak stack data out to user space let's also change a strscpy() to strscpy_pad(). This strscpy() was introduced in commit dbe37c71d124 ("scsi: message: fusion: Replace all non-returning strlcpy() with strscpy()") Note that since we are creating these structs with a copy_from_user() and modifying fields and then copying back out to the user it is probably OK not to explicitly NUL-pad everything as any data leak is probably just data from the user themselves. If this is too eager, let's opt for strscpy() which is still in the spirit of removing deprecated strncpy() usage treewide. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Cc: Kees Cook Signed-off-by: Justin Stitt Link: https://lore.kernel.org/r/20230927-strncpy-drivers-message-fusion-mptctl-c-v1-1-bb2eddc1743c@google.com Reviewed-by: Kees Cook Signed-off-by: Martin K. Petersen commit 971237b900c38f50e7865289a2aecb77dc7f09f3 Author: Peter Wang Date: Wed Sep 27 11:35:57 2023 +0800 scsi: ufs: core: WLUN send SSU timeout recovery When runtime PM send SSU times out, the SCSI core invokes eh_host_reset_handler, in this case ufshcd_eh_host_reset_handler(), which is then stuck waiting for flush_work(&hba->eh_work). However, ufshcd_err_handler hangs in wait RPM resume. Do link recovery only in this case. The following IO hang stack dump was observed: kworker/4:0 D __switch_to+0x180/0x344 __schedule+0x5ec/0xa14 schedule+0x78/0xe0 schedule_timeout+0xb0/0x15c io_schedule_timeout+0x48/0x70 do_wait_for_common+0x108/0x19c wait_for_completion_io_timeout+0x50/0x78 blk_execute_rq+0x1b8/0x218 scsi_execute_cmd+0x148/0x238 ufshcd_set_dev_pwr_mode+0xe8/0x244 __ufshcd_wl_resume+0x1e0/0x45c ufshcd_wl_runtime_resume+0x3c/0x174 scsi_runtime_resume+0x7c/0xc8 __rpm_callback+0xa0/0x410 rpm_resume+0x43c/0x67c __rpm_callback+0x1f0/0x410 rpm_resume+0x460/0x67c pm_runtime_work+0xa4/0xac process_one_work+0x208/0x598 worker_thread+0x228/0x438 kthread+0x104/0x1d4 ret_from_fork+0x10/0x20 scsi_eh_0 D __switch_to+0x180/0x344 __schedule+0x5ec/0xa14 schedule+0x78/0xe0 schedule_timeout+0x44/0x15c do_wait_for_common+0x108/0x19c wait_for_completion+0x48/0x64 __flush_work+0x260/0x2d0 flush_work+0x10/0x20 ufshcd_eh_host_reset_handler+0x88/0xcc scsi_try_host_reset+0x48/0xe0 scsi_eh_ready_devs+0x934/0xa40 scsi_error_handler+0x168/0x374 kthread+0x104/0x1d4 ret_from_fork+0x10/0x20 kworker/u16:5 D __switch_to+0x180/0x344 __schedule+0x5ec/0xa14 schedule+0x78/0xe0 rpm_resume+0x114/0x67c __pm_runtime_resume+0x70/0xb4 ufshcd_err_handler+0x1a0/0xe68 process_one_work+0x208/0x598 worker_thread+0x228/0x438 kthread+0x104/0x1d4 ret_from_fork+0x10/0x20 Signed-off-by: Peter Wang Link: https://lore.kernel.org/r/20230927033557.13801-1-peter.wang@mediatek.com Reviewed-by: Bart Van Assche Reviewed-by: Stanley Chu Signed-off-by: Martin K. Petersen commit dc718994abff37652c613578687bb6f49a293fe4 Merge: 5ef104b749e8a 02e2d8f4c2f4c Author: Martin K. Petersen Date: Mon Oct 9 21:08:34 2023 -0400 Merge patch series "ibmvfc: fixes and generic prep work for NVMeoF support" Tyrel Datwyler says: This series includes a couple minor fixes, generalization of some code that is not protocol specific, and a reworking of the way event pool buffers are accounted for by the driver. This is a precursor to a series to follow that introduces support for NVMeoF protocol with ibmvfc. Link: https://lore.kernel.org/r/20230921225435.3537728-1-tyreld@linux.ibm.com Signed-off-by: Martin K. Petersen commit bf328e22e47242695445a33da6887ba2ef9aec19 Author: Like Xu Date: Sun Oct 8 10:53:35 2023 +0800 KVM: x86: Don't sync user-written TSC against startup values The legacy API for setting the TSC is fundamentally broken, and only allows userspace to set a TSC "now", without any way to account for time lost between the calculation of the value, and the kernel eventually handling the ioctl. To work around this, KVM has a hack which, if a TSC is set with a value which is within a second's worth of the last TSC "written" to any vCPU in the VM, assumes that userspace actually intended the two TSC values to be in sync and adjusts the newly-written TSC value accordingly. Thus, when a VMM restores a guest after suspend or migration using the legacy API, the TSCs aren't necessarily *right*, but at least they're in sync. This trick falls down when restoring a guest which genuinely has been running for less time than the 1 second of imprecision KVM allows for in in the legacy API. On *creation*, the first vCPU starts its TSC counting from zero, and the subsequent vCPUs synchronize to that. But then when the VMM tries to restore a vCPU's intended TSC, because the VM has been alive for less than 1 second and KVM's default TSC value for new vCPU's is '0', the intended TSC is within a second of the last "written" TSC and KVM incorrectly adjusts the intended TSC in an attempt to synchronize. But further hacks can be piled onto KVM's existing hackish ABI, and declare that the *first* value written by *userspace* (on any vCPU) should not be subject to this "correction", i.e. KVM can assume that the first write from userspace is not an attempt to sync up with TSC values that only come from the kernel's default vCPU creation. To that end: Add a flag, kvm->arch.user_set_tsc, protected by kvm->arch.tsc_write_lock, to record that a TSC for at least one vCPU in the VM *has* been set by userspace, and make the 1-second slop hack only trigger if user_set_tsc is already set. Note that userspace can explicitly request a *synchronization* of the TSC by writing zero. For the purpose of user_set_tsc, an explicit synchronization counts as "setting" the TSC, i.e. if userspace then subsequently writes an explicit non-zero value which happens to be within 1 second of the previous value, the new value will be "corrected". This behavior is deliberate, as treating explicit synchronization as "setting" the TSC preserves KVM's existing behaviour inasmuch as possible (KVM always applied the 1-second "correction" regardless of whether the write came from userspace vs. the kernel). Reported-by: Yong He Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217423 Suggested-by: Oliver Upton Original-by: Oliver Upton Original-by: Sean Christopherson Signed-off-by: Like Xu Tested-by: Yong He Reviewed-by: Maxim Levitsky Link: https://lore.kernel.org/r/20231008025335.7419-1-likexu@tencent.com Signed-off-by: Sean Christopherson commit 236d225e1ee72a28aa7c2b1e39894e4390bbf51c Author: Ondrej Jirman Date: Sun Oct 8 15:05:02 2023 +0200 arm64: dts: rockchip: Add board device tree for rk3588-orangepi-5-plus Orange Pi 5 Plus is RK3588 based SBC featuring: - 2x 2.5G ethernet ports – onboard NIC hooked to PCIe 2.0 interface - 2x USB 2.0 host ports - 2x USB 3.0 host ports (exposed over USB 3.0 hub) - Type-C port featuring USB 2.0/3.0 and Alt-DP mode - PCIe 2.0/USB 2.0/I2S/I2C/UART on E.KEY socket - RTC - ES8388 on-board sound codec – jack in/out, onboard mic, speaker amplifier - SPI NOR flash - RGB LED (R is always on) - IR receiver - PCIe 3.0 on the bottom for NVMe, etc. - 40pin GPIO header (with gpio, I2C, SPI, PWM, UART) - Power, recovery and Mask ROM buttons - 2x HDMI out, 1x HDMI in - Slots/connectors for eMMC, uSD card, fan, MIPI CSI/DSI Signed-off-by: Ondrej Jirman Link: https://lore.kernel.org/r/20231008130515.1155664-5-megi@xff.cz Signed-off-by: Heiko Stuebner commit 0936188b7f2f6d3328f737a03cef7381f688a6cc Author: Ondrej Jirman Date: Sun Oct 8 15:05:01 2023 +0200 dt-bindings: arm: rockchip: Add Orange Pi 5 Plus Add devicetree binding documentation for Orange Pi 5 Plus SBC made by Xunlong. Signed-off-by: Ondrej Jirman Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231008130515.1155664-4-megi@xff.cz Signed-off-by: Heiko Stuebner commit 3d77a3e51b0faed820a8db985dce5af1cc4eae32 Author: Ondrej Jirman Date: Sun Oct 8 15:05:00 2023 +0200 arm64: dts: rockchip: Add UART9 M0 pin definitions to rk3588s This is used on Orange Pi 5 Plus. Signed-off-by: Ondrej Jirman Link: https://lore.kernel.org/r/20231008130515.1155664-3-megi@xff.cz Signed-off-by: Heiko Stuebner commit bf012368bb0ab69167d49715789fac34dfcd457e Author: Ondrej Jirman Date: Sun Oct 8 15:04:59 2023 +0200 arm64: dts: rockchip: Add I2S2 M0 pin definitions to rk3588s This is used on Orange Pi 5 Plus. Signed-off-by: Ondrej Jirman Link: https://lore.kernel.org/r/20231008130515.1155664-2-megi@xff.cz Signed-off-by: Heiko Stuebner commit b6bc755d806eac3fbddb7ea278fc7d2eb57dba4a Author: Muhammed Efe Cetin Date: Mon Oct 9 22:27:27 2023 +0300 arm64: dts: rockchip: Add Orange Pi 5 Add initial support for OPi5 that includes support for USB2, PCIe2, Sata, Sdmmc, SPI Flash, PMIC. Signed-off-by: Muhammed Efe Cetin Reviewed-by: Ondřej Jirman Link: https://lore.kernel.org/r/4212da199c9c532b60d380bf1dfa83490e16bc13.1696878787.git.efectn@6tel.net Signed-off-by: Heiko Stuebner commit 3eaf2abd11aa7f3b2fb04d60c64b2c756fe030eb Author: Muhammed Efe Cetin Date: Mon Oct 9 22:27:26 2023 +0300 arm64: dts: rockchip: Add sfc node to rk3588s Add SFC (SPI Flash) to RK3588S SOC. Reviewed-by: Dhruva Gole Signed-off-by: Muhammed Efe Cetin Link: https://lore.kernel.org/r/d36a64edfaede92ce2e158b0d9dc4f5998e019e3.1696878787.git.efectn@6tel.net Signed-off-by: Heiko Stuebner commit ce9d927720d642e20296988b6c1c0f877209be8d Author: Muhammed Efe Cetin Date: Mon Oct 9 22:27:25 2023 +0300 dt-bindings: arm: rockchip: Add Orange Pi 5 board Add Orange Pi 5 SBC from Xunlong. Signed-off-by: Muhammed Efe Cetin Reviewed-by: Dhruva Gole Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/89e92c8df546a0b926ba7481aa83c1945e81e8a4.1696878787.git.efectn@6tel.net Signed-off-by: Heiko Stuebner commit ca1e2a83394abcd1ee091b4e048a180aa58c96e6 Author: Daniele Ceraolo Spurio Date: Thu Oct 5 18:35:53 2023 -0700 drm/i915/guc: Enable WA 14018913170 The GuC handles the WA, the KMD just needs to set the flag to enable it on the appropriate platforms. Signed-off-by: John Harrison Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: Vinay Belgaumkar Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231006013553.1339418-1-John.C.Harrison@Intel.com commit 9e55a22fce1384837c213274d1a3b93be16ed9d7 Author: Yu Kuai Date: Sat Oct 7 19:21:05 2023 +0800 md/raid1: don't split discard io for write behind Currently, discad io is treated the same as normal write io, and for write behind case, io size is limited to: BIO_MAX_VECS * (PAGE_SIZE >> 9) For 0.5KB sector size and 4KB PAGE_SIZE, this is just 1MB. For consequence, if 'WriteMostly' is set to one of the underlying disks, then diskcard io will be splited into 1MB and it will take a long time for the diskcard to finish. Fix this problem by disable write behind for discard io. Reported-by: Roman Mamedov Closes: https://lore.kernel.org/all/6a1165f7-c792-c054-b8f0-1ad4f7b8ae01@ultracoder.org/ Reported-and-tested-by: Kirill Kirilenko Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20231007112105.407449-1-yukuai1@huaweicloud.com commit 1ef09e1281a1add0a86ecd594f748d7fb8bfd78e Merge: 1be84ca53ca04 b0f7a8ca11795 Author: Martin KaFai Lau Date: Mon Oct 9 15:35:00 2023 -0700 Merge branch 'bpf: Fix src IP addr related limitation in bpf_*_fib_lookup()' Martynas Pumputis says: ==================== The patchset fixes the limitation of bpf_*_fib_lookup() helper, which prevents it from being used in BPF dataplanes with network interfaces which have more than one IP addr. See the first patch for more details. Thanks! * v2->v3: Address Martin KaFai Lau's feedback * v1->v2: Use IPv6 stubs to fix compilation when CONFIG_IPV6=m. ==================== Signed-off-by: Martin KaFai Lau commit b0f7a8ca11795541f09060ccf583a341a9c94d5f Author: Martynas Pumputis Date: Sat Oct 7 10:14:15 2023 +0200 selftests/bpf: Add BPF_FIB_LOOKUP_SRC tests This patch extends the existing fib_lookup test suite by adding two test cases (for each IP family): * Test source IP selection from the egressing netdev. * Test source IP selection when an IP route has a preferred src IP addr. Signed-off-by: Martynas Pumputis Link: https://lore.kernel.org/r/20231007081415.33502-3-m@lambda.lt Signed-off-by: Martin KaFai Lau commit dab4e1f06cabb6834de14264394ccab197007302 Author: Martynas Pumputis Date: Sat Oct 7 10:14:14 2023 +0200 bpf: Derive source IP addr via bpf_*_fib_lookup() Extend the bpf_fib_lookup() helper by making it to return the source IPv4/IPv6 address if the BPF_FIB_LOOKUP_SRC flag is set. For example, the following snippet can be used to derive the desired source IP address: struct bpf_fib_lookup p = { .ipv4_dst = ip4->daddr }; ret = bpf_skb_fib_lookup(skb, p, sizeof(p), BPF_FIB_LOOKUP_SRC | BPF_FIB_LOOKUP_SKIP_NEIGH); if (ret != BPF_FIB_LKUP_RET_SUCCESS) return TC_ACT_SHOT; /* the p.ipv4_src now contains the source address */ The inability to derive the proper source address may cause malfunctions in BPF-based dataplanes for hosts containing netdevs with more than one routable IP address or for multi-homed hosts. For example, Cilium implements packet masquerading in BPF. If an egressing netdev to which the Cilium's BPF prog is attached has multiple IP addresses, then only one [hardcoded] IP address can be used for masquerading. This breaks connectivity if any other IP address should have been selected instead, for example, when a public and private addresses are attached to the same egress interface. The change was tested with Cilium [1]. Nikolay Aleksandrov helped to figure out the IPv6 addr selection. [1]: https://github.com/cilium/cilium/pull/28283 Signed-off-by: Martynas Pumputis Link: https://lore.kernel.org/r/20231007081415.33502-2-m@lambda.lt Signed-off-by: Martin KaFai Lau commit a7ec043e601d1dca69ac827f51dbe1dbaa1e89aa Merge: f0d82f073d79c 9958d85968ed2 Author: Mark Brown Date: Mon Oct 9 20:49:16 2023 +0100 ASoC: DT matching and header cleanups Merge series from Rob Herring : This is a series is part of ongoing clean-ups related to device matching and DT related implicit includes. Essentially of_device.h has a bunch of implicit includes and generally isn't needed any nore except for of_match_device(). As we also generally want to get rid of of_match_device() as well, I've done that so we're not updating the includes twice. commit bd885fcf28da7da6a2244d30cd45630303c781ed Author: Alex Williamson Date: Mon Oct 2 16:43:25 2023 -0600 vfio: Fix smatch errors in vfio_combine_iova_ranges() smatch reports: vfio_combine_iova_ranges() error: uninitialized symbol 'last'. vfio_combine_iova_ranges() error: potentially dereferencing uninitialized 'comb_end'. vfio_combine_iova_ranges() error: potentially dereferencing uninitialized 'comb_start'. These errors are only reachable via invalid input, in the case of @last when we receive an empty rb-tree or for @comb_{start,end} if the rb-tree is empty or otherwise fails to produce a second node that reduces the gap. Add tests with warnings for these cases. Reported-by: Cong Liu Link: https://lore.kernel.org/all/20230920095532.88135-1-liucong2@kylinos.cn Reviewed-by: Jason Gunthorpe Reviewed-by: Brett Creeley Link: https://lore.kernel.org/r/20231002224325.3150842-1-alex.williamson@redhat.com Signed-off-by: Alex Williamson commit 300e0fb064ff563149a818a64c9317ef081cddc2 Merge: 0481107a443e2 1ecbcc0d5be44 Author: Georgi Djakov Date: Tue Oct 10 00:41:05 2023 +0300 Merge branch 'icc-rpm-dt-bindings' into icc-next The recent necessary overhaul [1] of how we represent SMD ICC and RPM bus clocks changed the way they're connected. The bindings however were not updated to reflect that. This series tries to address that, while also making the relevant bindings less convoluted. Now, instead of referencing RPM SMD bus clocks via clocks=<>, they're handled internally within the interconnect framework (via direct RPM calls from there). We still need to allow some "interface" clocks, which are necessary to access some registers and not managed for us. [1] https://lore.kernel.org/linux-arm-msm/20230526-topic-smd_icc-v7-0-09c78c175546@linaro.org/ * icc-rpm-dt-bindings dt-bindings: interconnect: qcom: Introduce qcom,rpm-common dt-bindings: interconnect: qcom: qcm2290: Remove RPM bus clocks dt-bindings: interconnect: qcom: Fix and separate out SDM660 dt-bindings: interconnect: qcom: Fix and separate out MSM8996 dt-bindings: interconnect: qcom: Fix and separate out MSM8939 dt-bindings: interconnect: qcom: rpm: Clean up the file dt-bindings: interconnect: qcom: rpm: Clean up the example Link: https://lore.kernel.org/r/20230721-topic-icc_bindings-v2-0-e33d5acbf3bd@linaro.org Signed-off-by: Georgi Djakov commit 1ecbcc0d5be444415c139d2c8d84dd9bf94845cb Author: Konrad Dybcio Date: Mon Jul 24 16:06:33 2023 +0200 dt-bindings: interconnect: qcom: rpm: Clean up the example One example is enough, remove the others and fix up the indentation while at it. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230721-topic-icc_bindings-v2-7-e33d5acbf3bd@linaro.org Signed-off-by: Georgi Djakov commit df786235af03eeb09e5dc139ad8dcbba6346e357 Author: Konrad Dybcio Date: Mon Jul 24 16:06:32 2023 +0200 dt-bindings: interconnect: qcom: rpm: Clean up the file Following the recent cleanups and untanglements, remove abusive direct references to RPM bus clocks, include the rpm-common YAML and update Georgi's email. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230721-topic-icc_bindings-v2-6-e33d5acbf3bd@linaro.org Signed-off-by: Georgi Djakov commit 462baaf4c6281550b0d57131f95d51e6949889ec Author: Konrad Dybcio Date: Mon Jul 24 16:06:31 2023 +0200 dt-bindings: interconnect: qcom: Fix and separate out MSM8939 Separate out MSM8939 icc bindings from the common file and fix the clocks description by removing the wrong internal RPM bus clock representation that we've been carrying for years. This was the final one, so also retire the shared file. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230721-topic-icc_bindings-v2-5-e33d5acbf3bd@linaro.org Signed-off-by: Georgi Djakov commit d03374a61b0fce165ec51529652ec55ed0ac305c Author: Konrad Dybcio Date: Mon Jul 24 16:06:30 2023 +0200 dt-bindings: interconnect: qcom: Fix and separate out MSM8996 Separate out MSM8996 icc bindings from the common file and fix the clocks description by removing the wrong internal RPM bus clock representation that we've been carrying for years. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230721-topic-icc_bindings-v2-4-e33d5acbf3bd@linaro.org Signed-off-by: Georgi Djakov commit c19bcc762796a128beafffa77558f9c1fdc50398 Author: Konrad Dybcio Date: Mon Jul 24 16:06:29 2023 +0200 dt-bindings: interconnect: qcom: Fix and separate out SDM660 Separate out SDM660 icc bindings from the common file and fix the clocks description by removing the wrong internal RPM bus clock representation that we've been carrying for years. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230721-topic-icc_bindings-v2-3-e33d5acbf3bd@linaro.org Signed-off-by: Georgi Djakov commit 5d4268b31ef060a18ce0e7af7e8f7ccf815456ff Author: Konrad Dybcio Date: Mon Jul 24 16:06:28 2023 +0200 dt-bindings: interconnect: qcom: qcm2290: Remove RPM bus clocks After the recent reshuffling, bus clocks are no longer exposed as RPM clocks. Remove the old description. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230721-topic-icc_bindings-v2-2-e33d5acbf3bd@linaro.org Signed-off-by: Georgi Djakov commit 400e531bcdf1dc702c9d560f57cea3b9547030fc Author: Konrad Dybcio Date: Mon Jul 24 16:06:27 2023 +0200 dt-bindings: interconnect: qcom: Introduce qcom,rpm-common The current RPM interconnect bindings are messy. Start cleaning them up with a common include. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230721-topic-icc_bindings-v2-1-e33d5acbf3bd@linaro.org Signed-off-by: Georgi Djakov commit 9a3768191d95a9cc9a74f67ae971764def45acb4 Author: Yan Zhao Date: Fri Jul 14 14:51:56 2023 +0800 KVM: x86/mmu: Zap SPTEs on MTRR update iff guest MTRRs are honored When guest MTRRs are updated, zap SPTEs and do zap range calcluation if and only if KVM's MMU is honoring guest MTRRs, which is the only time that KVM incorporates the guest's MTRR type into the final memtype. Suggested-by: Chao Gao Suggested-by: Sean Christopherson Cc: Kai Huang Signed-off-by: Yan Zhao Link: https://lore.kernel.org/r/20230714065156.20375-1-yan.y.zhao@intel.com [sean: rephrase shortlog] Signed-off-by: Sean Christopherson commit 7a18c7c2b69a2e47e95e2a381f9b01b9aae36747 Author: Yan Zhao Date: Fri Jul 14 14:51:22 2023 +0800 KVM: x86/mmu: Zap SPTEs when CR0.CD is toggled iff guest MTRRs are honored Zap SPTEs when CR0.CD is toggled if and only if KVM's MMU is honoring guest MTRRs, which is the only time that KVM incorporates the guest's CR0.CD into the final memtype. Suggested-by: Chao Gao Signed-off-by: Yan Zhao Link: https://lore.kernel.org/r/20230714065122.20315-1-yan.y.zhao@intel.com [sean: rephrase shortlog] Signed-off-by: Sean Christopherson commit 1affe455d66de4e1743514afdeb99cb598a25aa2 Author: Yan Zhao Date: Fri Jul 14 14:50:06 2023 +0800 KVM: x86/mmu: Add helpers to return if KVM honors guest MTRRs Add helpers to check if KVM honors guest MTRRs instead of open coding the logic in kvm_tdp_page_fault(). Future fixes and cleanups will also need to determine if KVM should honor guest MTRRs, e.g. for CR0.CD toggling and and non-coherent DMA transitions. Provide an inner helper, __kvm_mmu_honors_guest_mtrrs(), so that KVM can check if guest MTRRs were honored when stopping non-coherent DMA. Note, there is no need to explicitly check that TDP is enabled, KVM clears shadow_memtype_mask when TDP is disabled, i.e. it's non-zero if and only if EPT is enabled. Suggested-by: Sean Christopherson Signed-off-by: Yan Zhao Link: https://lore.kernel.org/r/20230714065006.20201-1-yan.y.zhao@intel.com Link: https://lore.kernel.org/r/20230714065043.20258-1-yan.y.zhao@intel.com [sean: squash into a one patch, drop explicit TDP check massage changelog] Signed-off-by: Sean Christopherson commit 0481107a443e22bb47f94d711c509a2fd70ae23d Merge: 0bb80ecc33a8f 1255f23c219a7 Author: Georgi Djakov Date: Tue Oct 10 00:15:03 2023 +0300 Merge branch 'icc-qcom-coefficients' into icc-next Certain platforms require that some buses (or individual nodes) make some additional changes to the clock rate formula, throwing in some magic, Qualcomm-defined coefficients, to account for "inefficiencies". Add the framework for it and utilize it on a couple SoCs. * icc-qcom-coefficients interconnect: qcom: icc-rpm: Add AB/IB calculations coefficients interconnect: qcom: icc-rpm: Separate out clock rate calulcations interconnect: qcom: icc-rpm: Let nodes drive their own bus clock interconnect: qcom: icc-rpm: Check for node-specific rate coefficients interconnect: qcom: qcm2290: Hook up MAS_APPS_PROC's bus clock interconnecga qcom: qcm2290: Set AB coefficients interconnecgg acom: qcm2290: Update EBI channel configuration interconnect: qcom: sdm660: Set AB/IB coefficients interconnect: qcom: msm8996: Set AB/IB coefficients Link: https://lore.kernel.org/r/20230726-topic-icc_coeff-v4-0-c04b60caa467@linaro.org Signed-off-by: Georgi Djakov commit da405477e7670782241234ea6b4309f3224ecb63 Author: Nikunj Kela Date: Mon Oct 9 12:14:37 2023 -0700 firmware: arm_scmi: Add qcom smc/hvc transport support This change adds the support for SCMI message exchange on Qualcomm virtual platforms. The hypervisor associates an object-id also known as capability-id with each smc/hvc doorbell object. The capability-id is used to identify the doorbell from the VM's capability namespace, similar to a file-descriptor. The hypervisor, in addition to the function-id, expects the capability-id to be passed in x1 register when SMC/HVC call is invoked. The capability-id is allocated by the hypervisor on bootup and is stored in the shmem region by the firmware before starting Linux. Signed-off-by: Nikunj Kela Reviewed-by: Brian Masney Link: https://lore.kernel.org/r/20231009191437.27926-3-quic_nkela@quicinc.com Signed-off-by: Sudeep Holla commit 6979f88f5a8e6ab1cdbfeb842abb7ce9daecbb8d Author: Nikunj Kela Date: Mon Oct 9 12:14:36 2023 -0700 dt-bindings: arm: Add new compatible for smc/hvc transport for SCMI Introduce compatible "qcom,scmi-smc" for SCMI smc/hvc transport channel for Qualcomm virtual platforms. This compatible mandates populating an additional parameter 'capability-id' from the last 8 bytes of the shmem channel. Signed-off-by: Nikunj Kela Reviewed-by: Brian Masney Link: https://lore.kernel.org/r/20231009191437.27926-2-quic_nkela@quicinc.com Signed-off-by: Sudeep Holla commit 1f17395124a53a8edbb6c51e37b98b49a3523b9b Author: Sudeep Holla Date: Mon Oct 9 16:20:49 2023 +0100 firmware: arm_scmi: Convert u32 to unsigned long to align with arm_smccc_1_1_invoke() All the parameters to arm_smccc_1_1_invoke() are unsigned long which aligns well on both 32-bit and 64-bit Arm based platforms. Let us store all the members in the structure scmi_smc used as the parameters to the arm_smccc_1_1_invoke() call as unsigned long. Cc: Cristian Marussi Reviewed-by: Cristian Marussi Link: https://lore.kernel.org/r/20231009152049.1428872-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit 219223eca4d8b39486107c62a52c9667016aa3b9 Author: Icenowy Zheng Date: Sun Oct 8 14:46:49 2023 +0800 drm/amdgpu: fix SI failure due to doorbells allocation SI hardware does not have doorbells at all, however currently the code will try to do the allocation and thus fail, makes SI AMDGPU not usable. Fix this failure by skipping doorbells allocation when doorbells count is zero. Fixes: 54c30d2a8def ("drm/amdgpu: create kernel doorbell pages") Reviewed-by: Shashank Sharma Signed-off-by: Icenowy Zheng Signed-off-by: Alex Deucher commit ce862c49957d119782c1b74fccee92bf1ddc1d71 Author: Aaron Liu Date: Thu May 25 16:08:55 2023 +0800 drm/amdgpu/discovery: enable DCN 3.5.0 support Enable DCN 3.5.0 support. Signed-off-by: Aaron Liu Signed-off-by: Alex Deucher commit 367a0af43373d4f791cc8b466a659ecf5aa52377 Author: Arvind Yadav Date: Mon Oct 9 22:43:16 2023 +0530 drm/amdkfd: get doorbell's absolute offset based on the db_size Here, Adding db_size in byte to find the doorbell's absolute offset for both 32-bit and 64-bit doorbell sizes. So that doorbell offset will be aligned based on the doorbell size. v2: - Addressed the review comment from Felix. v3: - Adding doorbell_size as parameter to get db absolute offset. v4: Squash the two patches into one. Cc: Christian Koenig Cc: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Shashank Sharma Signed-off-by: Arvind Yadav Signed-off-by: Alex Deucher commit 31220ee9dc5a3e25d38d29d3816b6e79d8c39abc Author: Christian König Date: Fri Oct 6 14:04:04 2023 +0200 drm/amdgpu: add missing NULL check bo->tbo.resource can easily be NULL here. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2902 Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher CC: stable@vger.kernel.org commit dcc71a7e1e230c25748b49c1148cc470cc4d72cf Author: Aric Cyr Date: Sun Oct 1 20:40:08 2023 -0400 drm/amd/display: 3.2.255 This version brings along following fixes: - Refactor DPG test pattern logic for ODM cases - Refactor HWSS into component folder - Revert "drm/amd/display: Add a check for idle power optimization" - Revert "drm/amd/display: remove duplicated edp relink to fastboot - Update cursor limits based on SW cursor fallback limits - Update stream mask - Update pmfw_driver_if new structure - Modify SMU message logs - Don't set dpms_off for seamless boot Known issue: DWB (Writeback functionality) is broken. Fix will be available in DC 3.2.256 Acked-by: Tom Chung Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b22c336268e477e3e8fc21e7d6b18fa8c4cd1f9a Author: Stylon Wang Date: Thu Oct 5 20:25:10 2023 +0800 drm/amd/display: Disable virtual links [Why] This could work around the issue with DP tunneling producing a NULL pointer dereference. [How] Disable the virtual links. Reviewed-by: Tom Chung Acked-by: Tom Chung Signed-off-by: Stylon Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9af4377fd5d04e7e9e2477d13dbea32849de04e7 Author: George Shen Date: Fri Sep 22 14:38:31 2023 -0400 drm/amd/display: Disable SubVP if test pattern is enabled [Why] Enabling DPG causes HUBP to stay in blank constantly. If DPG is enabled while an MCLK switch is taking place with SubVP, it will cause the MCLK to never complete. This is because SubVP MCLK switch relies a HUBP VLine interrupt, which will never occur when HUBP is constantly in blank. [How] Disable SubVP when test pattern is enabled. Reviewed-by: Alvin Lee Reviewed-by: Nevenko Stupar Acked-by: Tom Chung Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 051d90070d4c811d7413756cc42a59f2c28e0d0f Author: George Shen Date: Fri Sep 22 14:26:39 2023 -0400 drm/amd/display: Refactor DPG test pattern logic for ODM cases [Why] Current DPG test pattern logic does not account for ODM configuration changes after test pattern has already been programmed. For example, if ODM2:1 is enabled after test pattern is already being output, the second pipe is not programmed to output test pattern, causing half the screen to be black. [How] Move DPG test pattern parameter calculations into separate function. Whenever ODM pipe configuration changes, re-calculate DPG test pattern parameters and program DPG if test pattern is currently enabled. Reviewed-by: Wenjing Liu Acked-by: Tom Chung Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ef013f6fcd8affaae4a5bf4b51cb6244c8a2ed3f Author: Daniel Miess Date: Fri Sep 29 13:04:33 2023 -0400 drm/amd/display: Don't set dpms_off for seamless boot [Why] eDPs fail to light up with seamless boot enabled [How] When seamless boot is enabled don't configure dpms_off in disable_vbios_mode_if_required. Reviewed-by: Charlene Liu Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Tom Chung Signed-off-by: Daniel Miess Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e53524cdcc02d089e757b668da031ba06ff665c3 Author: Mounika Adhuri Date: Fri Sep 22 18:23:28 2023 +0530 drm/amd/display: Refactor HWSS into component folder [why] Rename hw_sequencer to hwseq. Move all hwseq files to unique folder hwss. [how] creating hwss repo in dc, and moved the dcnxx_hwseq.c and .h files into corresponding new folders inside the hwss and cleared the linkage errors by adding relative paths in the Makefile.template. Reviewed-by: Martin Leung Acked-by: Tom Chung Signed-off-by: Mounika Adhuri Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d0a767f7b8e2cb9302f36afe6a4e535bc234b667 Author: Sung Joon Kim Date: Thu Sep 28 11:20:13 2023 -0400 drm/amd/display: Revert "drm/amd/display: Add a check for idle power optimization" Revert commit 434cf7af492f ("drm/amd/display: Add a check for idle power optimization") Because it cause Freesync and S4 regression Reviewed-by: Aric Cyr Acked-by: Tom Chung Signed-off-by: Sung Joon Kim Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 061863e5dbce4ca2fd66949c7466dee4e49cb8da Author: Yifan Zhang Date: Thu Sep 28 14:02:02 2023 +0800 drm/amdgpu: add hub->ctx_distance in setup_vmid_config add hub->ctx_distance when read CONTEXT1_CNTL, align w/ write back operation. v2: fix coding style errors reported by checkpatch.pl (Christian) Signed-off-by: Yifan Zhang Acked-by: Christian König Reviewed-by: Lang Yu Signed-off-by: Alex Deucher commit 79df45dc4bfb13d9bd3a75338b9d9dab948be3d6 Author: Nicholas Kazlauskas Date: Wed Sep 27 15:06:41 2023 -0400 drm/amd/display: Don't use fsleep for PSR exit waits [Why] These functions can be called from high IRQ levels and the OS will hang if it tries to use a usleep_highres or a msleep. [How] Replace the fsleep with a udelay. Reviewed-by: Aric Cyr Acked-by: Tom Chung Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ddd5298c63e45c51cff2cbea156d428329e8e607 Author: Alvin Lee Date: Wed Sep 27 18:39:31 2023 -0400 drm/amd/display: Update cursor limits based on SW cursor fallback limits [Why&How] For determining the cursor size limit, use the same checks that are used for determining SW cursor fallback instead of only using SubVP Reviewed-by: Aric Cyr Acked-by: Tom Chung Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c7c19779251861290ae18ea242ae1f0049df529f Author: Muhammad Ahmed Date: Tue Sep 26 15:46:21 2023 -0400 drm/amd/display: Update dml ssb from pmfw clock table [why] Need to use real clock table [How] Update the clock table Reviewed-by: Charlene Liu Acked-by: Tom Chung Signed-off-by: Muhammad Ahmed Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 72f7d6d32947fa6858aacbcbff4a320cf907be73 Author: Duncan Ma Date: Wed Sep 27 15:17:27 2023 -0400 drm/amd/display: Update stream mask [Why] Whenever stream changes because of new pipe arrangements such as ODM. The new stream mask is not reflected in DMCUB. The mismatch in stream mask is blocking ips entry in some scenarios. [How] Whenever stream arrangement changes, update stream mask and notify DMCUB. Reviewed-by: Charlene Liu Acked-by: Tom Chung Signed-off-by: Duncan Ma Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6fe01ed4a4b12d7b3d328b4a423fab3f634445c0 Author: Aric Cyr Date: Tue Sep 26 16:15:37 2023 -0400 drm/amd/display: Revert "drm/amd/display: remove duplicated edp relink to fastboot" Revert commit 984abb5384b0 ("drm/amd/display: remove duplicated edp relink to fastboot") Because it cause 4k EDP not light up on boot Reviewed-by: Tom Chung Cc: Mario Limonciello Cc: Alex Deucher Acked-by: Tom Chung Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3557db425dd9e6d806617326bf71d1c8da2a707f Author: Max Tseng Date: Fri Sep 22 16:50:53 2023 +0800 drm/amd/display: Modify Vmin default value Fine tune the Vmin clock value Reviewed-by: Robin Chen Acked-by: Tom Chung Signed-off-by: Max Tseng Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 776ecb46ff2a6763038fe744f5be5bac08b36003 Author: Charlene Liu Date: Tue Sep 26 15:32:59 2023 -0400 drm/amd/display: Update pmfw_driver_if new structure [why] pmfw header file updated, need align with data structure. [How] Update the data structure. Reviewed-by: Sung joon Kim Acked-by: Tom Chung Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 43693e859b328db6017e51e93b4da36fe64d6e47 Author: Muhammad Ansari Date: Mon Sep 25 12:00:31 2023 -0400 drm/amd/display: VSIF v3 set Max Refresh Rate [WHY] FreeSync spec requires PB8 and PB12 to be set to nominal refresh rate regardless of fixed rate or variable [HOW] Removed the condition that checks and overwrites max refresh rate and set PB8/PB12 to be set to max refresh rate always Reviewed-by: Anthony Koo Acked-by: Tom Chung Signed-off-by: Muhammad Ansari Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4ea7151f6b60817ba28bd339e37687aeb44cc200 Author: Sung Joon Kim Date: Tue Sep 19 17:04:59 2023 -0400 drm/amd/display: Modify SMU message logs [why] It's important to make sure SMU messages are logged by default to improve debugging for power optimization use cases. [how] Change logs to warnings when SMU message returns non-success id. Reviewed-by: Charlene Liu Acked-by: Tom Chung Signed-off-by: Sung Joon Kim Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 80285ae1ec8717b597b20de38866c29d84d321a1 Author: Stanley.Yang Date: Wed Sep 27 16:22:29 2023 +0800 drm/amdgpu: Fix potential null pointer derefernce The amdgpu_ras_get_context may return NULL if device not support ras feature, so add check before using. Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 098c13079c6fdd44f10586b69132c392ebf87450 Author: Yifan Zhang Date: Wed Sep 27 12:56:15 2023 +0800 drm/amd/display: enable S/G display for for recent APUs by default With S/G display becomes stable, enable S/G display for recent APUs by default rather than white list. v2: explicitly disable sg on pre-CZ chips (Alex) v3: add parens for every clause (Alex) Co-authored-by: Alex Deucher Signed-off-by: Yifan Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b3e73b5a8f8ae3f585abd756416b089f82578ef2 Author: Lijo Lazar Date: Wed Oct 4 18:46:06 2023 +0530 Documentation/amdgpu: Add FRU attribute details Add documentation for the newly added manufacturer and fru_id attributes in sysfs. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ac6b1f275f17ba9873ec677979ba240d9d952413 Author: Lijo Lazar Date: Wed Oct 4 18:32:02 2023 +0530 drm/amdgpu: Add more FRU field information Add support to read Manufacturer Name and FRU File Id fields. Also add sysfs device attributes for external usage. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 8a2b51392ac4a5ecc310c6dddd6cb70c71f0ddeb Author: Lijo Lazar Date: Wed Oct 4 16:00:47 2023 +0530 drm/amdgpu: Refactor FRU product information Keep FRU related information together in a separate structure. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit be2e8aca0602296fef90330c5564ac1967e641eb Author: Yang Wang Date: Thu Sep 21 15:25:43 2023 +0800 drm/amdgpu: enable FRU device for SMU v13.0.6 v1: enable GFX v9.4.3 FRU device to query board information. v2: use MP1 version to identify different asic Signed-off-by: Yang Wang Reviewed-by: Lijo Lazar Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 6cb8e3ee3a0883d9519a140ad820929574284d5d Author: Boyuan Zhang Date: Thu Oct 5 22:09:08 2023 -0400 drm/amdgpu: update ib start and size alignment Update IB starting address alignment and size alignment with correct values for decode and encode IPs. Decode IB starting address alignment: 256 bytes Decode IB size alignment: 64 bytes Encode IB starting address alignment: 256 bytes Encode IB size alignment: 4 bytes Also bump amdgpu driver version for this update. Signed-off-by: Boyuan Zhang Reviewed-by: Christian König Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 647cf5151986ce981d55bba198612667eacf8a8b Author: Gabe Teeger Date: Thu Sep 28 17:00:35 2023 -0400 drm/amd/display: add check in validate_only in dml2 [what] does_configuration_meet_sw_policies check was not done in the validate_only portion of dml2, so some unsupported modes were passing bw validation, only to fail the same check later in validate_and_build. now we add the check to validate_only. Also add line in dcn35_resource to ensure that value set for enable_windowed_mpo_odm gets passed to dml. [why] Immediate black screen during video playback at 4k144hz. The debugger showed that we were failing validation in dml on every updateplanes(). Reviewed-by: Wenjing Liu Acked-by: Qingqing Zhuo Signed-off-by: Qingqing Zhuo Signed-off-by: Gabe Teeger Signed-off-by: Alex Deucher commit cbe069f5e60f6c64944d65a2676fec23769bd189 Author: Daniel Miess Date: Wed Sep 27 15:21:53 2023 -0400 drm/amd/display: Port replay vblank logic to DML2 Update DML2 with replay vblank logic found in DML1. Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Daniel Miess Signed-off-by: Qingqing Zhuo Signed-off-by: Alex Deucher commit ba85d293a30e358abe9740ac0c945211066e4273 Author: Saaem Rizvi Date: Mon Sep 25 00:45:25 2023 -0400 drm/amd/display: Modify Pipe Selection for Policy for ODM [Why] There are certain cases during a transition to ODM that might cause corruption on the display. This occurs when we choose certain pipes in a particular state. [How] We now will store the pipe indexes of the any pipes that might be problematic to switch to during an ODM transition, and only use them as a last resort. Reviewed-by: Dmytro Laktyushkin Acked-by: Qingqing Zhuo Signed-off-by: Qingqing Zhuo Signed-off-by: Saaem Rizvi Signed-off-by: Alex Deucher commit 0e56de91edd0b81e2c8df98413e68bed4ef13706 Author: Charlene Liu Date: Tue Aug 29 21:08:38 2023 -0400 drm/amd/display: correct dml2 input and dlg_refclk dc->dml2_options.use_native_pstate_optimization flag will make driver use dcn32 legacy_svp_drr related tuning. Set this to false fixed the stutter underflow issue also based on HW suggest disable ODM by default and let DML choose it. Reviewed-by: Zhan Liu Acked-by: Qingqing Zhuo Signed-off-by: Qingqing Zhuo Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit 969fe903ee2ea8e6a7781608ca2ee72d9b748c00 Author: Sung Joon Kim Date: Thu Aug 17 12:21:55 2023 -0400 drm/amd/display: Fix Chroma Surface height/width initialization [why] Surface height/width for Chroma has another variable that it should be intialized to, chroma_size. Fixing this will help pass DML2.0 validation for YCbCr420 tests, DCHB006.109,129, DCHB014.011,012. [how] Assign SurfaceHeight/WidthC to chroma_size.height/width Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Sung Joon Kim Signed-off-by: Alex Deucher commit 9158920cc87f4352b93ee52862e21c14a9cc953c Author: Taimur Hassan Date: Wed Aug 16 17:13:10 2023 -0400 drm/amd/display: Move stereo timing check to helper Rework dml2_map_dc_pipes to keep the logic clean. Reviewed-by: Chaitanya Dhere Acked-by: Qingqing Zhuo Signed-off-by: Qingqing Zhuo Signed-off-by: Taimur Hassan Signed-off-by: Alex Deucher commit 21eeb0511496c15aada81755bc4a4b4c87767941 Author: Taimur Hassan Date: Tue Jul 25 17:10:37 2023 -0400 drm/amd/display: Split pipe for stereo timings [Why & How] DML2 did not carry over DML1 logic that splits pipe for stero timings. Pipe splitting is needed in this case to pass stereo tests. Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Qingqing Zhuo Signed-off-by: Taimur Hassan Signed-off-by: Alex Deucher commit 1d93c4db4e0fc82e9f975af213fd8dd00dd6ecc8 Author: Sung Joon Kim Date: Wed Aug 9 16:39:53 2023 -0400 drm/amd/display: Use fixed DET Buffer Size [why] Regression from DML1.0 where we use differen DET buffer sizes for each pipe. From the spec, we need to use DET buffer size of 384 kb for each pipe [how] Ensure to use 384 kb DET buffer sizes for each available pipe. Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Sung Joon Kim Signed-off-by: Alex Deucher commit e47d7ca7574a12e3711807724fcd5dacc2ed9b8f Author: Sung Joon Kim Date: Wed Aug 9 16:09:28 2023 -0400 drm/amd/display: Handle multiple streams sourcing same surface [why] There are cases where more than 1 stream can be mapped to the same surface. DML2.0 does not seem to handle these cases. [how] Make sure to account for the stream id when deriving the plane id. By doing this, each plane id will be unique based on the stream id. Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Sung Joon Kim Signed-off-by: Qingqing Zhuo Signed-off-by: Alex Deucher commit eb918cbba105394ce182853f751236c790975ba7 Author: Charlene Liu Date: Mon Jul 31 20:01:11 2023 -0400 drm/amd/display: Add z8_marks in dml Add z8 watermarks to struct for later ASIC use. Reviewed-by: Alvin Lee Acked-by: Qingqing Zhuo Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit 115009d11ccf513f2fe01fd7c33a54157e3c31f4 Author: Qingqing Zhuo Date: Thu Aug 3 00:43:25 2023 -0400 drm/amd/display: Add DCN35 DML2 support Enable DML2 for DCN35. Changes since V1: - Remove hard coded values Acked-by: Harry Wentland Signed-off-by: Alex Deucher Signed-off-by: Roman Li Signed-off-by: Qingqing Zhuo Signed-off-by: Alex Deucher commit 7966f319c66d9468623c6a6a017ecbc0dd79be75 Author: Qingqing Zhuo Date: Fri Jul 28 17:55:30 2023 -0400 drm/amd/display: Introduce DML2 DC is transitioning from DML to DML2, and this commit introduces all the required changes for some of the already available ASICs and adds the required code infra to support new ASICs under DML2. DML2 is also a generated code that provides better mode verification and programming models for software/hardware, and it enables a better way to create validation tools. This version is more like a middle step to the complete transition to the DML2 version. Changes since V1: - Alex: Fix typos Changes since V2: - Update DC includes Changes since V3: - Fix 32 bit compilation issues on x86 Changes since V4: - Avoid compilation of DML2 on some not supported 32-bit architecture - Update commit message Co-developed-by: Rodrigo Siqueira Signed-off-by: Rodrigo Siqueira Co-developed-by: Roman Li Signed-off-by: Roman Li Signed-off-by: Qingqing Zhuo Signed-off-by: Alex Deucher commit 6e2c4941ce0cbe54a7bab8e18c5070e7dc5986f5 Author: Rodrigo Siqueira Date: Mon Oct 2 19:44:55 2023 -0600 drm/amd/display: Move dml code under CONFIG_DRM_AMD_DC_FP guard For some reason, the dml code is not guarded under CONFIG_DRM_AMD_DC_FP in the Makefile. This commit moves the dml code under the DC_FP guard. Reviewed-by: Qingqing Zhuo Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit a2719f91a17057f741b962f6ea4d337a374f6eb7 Author: Rodrigo Siqueira Date: Tue Oct 3 08:14:49 2023 -0600 drm/amd/display: Move bw_fixed from DML folder bw_fixed does not need any FPU operation, and it is used on DCE and DCN. For this reason, this commit moves bw_fixed to the basic folder outside DML. Reviewed-by: Qingqing Zhuo Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 13f9173af8da2d774f5a4fe532a347c538831f04 Author: Rodrigo Siqueira Date: Tue Oct 3 08:05:56 2023 -0600 drm/amd/display: Move custom_float from DML folder The custom_float file does not have any FPU operation, so it should be inside DML. This commit moves the file to the basic folder. Reviewed-by: Qingqing Zhuo Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit d310d18bfca90bca56672a7ad08b63a0d7c621d5 Author: Rodrigo Siqueira Date: Tue Oct 3 08:24:28 2023 -0600 drm/amd/display: Move dce_calcs from DML folder dce_calcs does not have FPU operations, and it is required for DCE and DCN. Remove this file from the DML folder and add it to the basic folder visible for DCE and DCN. Reviewed-by: Qingqing Zhuo Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit f8cd72728bdcf72d01305c8245b039f0ca9ea088 Author: Alex Deucher Date: Fri Aug 11 10:54:52 2023 +0800 drm/amdgpu: Enable SMU 13.0.0 optimizations when ROCm is active (v2) When ROCm is active enable additional SMU 13.0.0 optimizations. This reuses the unused powersave profile on PMFW. v2: move to the swsmu code since we need both bits active in the workload mask. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 2091ac690301fd7b4f64b08f16c251fbb0d95042 Author: Sebastian Andrzej Siewior Date: Thu Sep 21 16:15:16 2023 +0200 drm/amd/display: Move the memory allocation out of dcn20_validate_bandwidth_fp(). dcn20_validate_bandwidth_fp() is invoked while FPU access has been enabled. FPU access requires disabling preemption even on PREEMPT_RT. It is not possible to allocate memory with disabled preemption even with GFP_ATOMIC on PREEMPT_RT. Move the memory allocation before FPU access is enabled. To preserve previous "clean" state of "pipes" add a memset() before the second invocation of dcn20_validate_bandwidth_internal() where the variable is used. Acked-by: Harry Wentland Reviewed-by: Rodrigo Siqueira Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 941e8036a450bc7ae8517ceb6dbd9135046f4ad8 Author: Sebastian Andrzej Siewior Date: Thu Sep 21 16:15:15 2023 +0200 drm/amd/display: Move the memory allocation out of dcn21_validate_bandwidth_fp(). dcn21_validate_bandwidth_fp() is invoked while FPU access has been enabled. FPU access requires disabling preemption even on PREEMPT_RT. It is not possible to allocate memory with disabled preemption even with GFP_ATOMIC on PREEMPT_RT. Move the memory allocation before FPU access is enabled. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217928 Acked-by: Harry Wentland Reviewed-by: Rodrigo Siqueira Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 80364500c02367cd0901c2d6e0d5d1e3e3e42abc Author: Sebastian Andrzej Siewior Date: Thu Sep 21 16:15:14 2023 +0200 drm/amd/display: Add a warning if the FPU is used outside from task context. Add a warning if the FPU is used from any context other than task context. This is only precaution since the code is not able to be used from softirq while the API allows it on x86 for instance. Acked-by: Harry Wentland Reviewed-by: Rodrigo Siqueira Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 0f0e59075b5c22f1e871fbd508d6e4f495048356 Author: Mario Limonciello Date: Wed Oct 4 15:46:44 2023 -0500 drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga For pptable structs that use flexible array sizes, use flexible arrays. Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2036742 Signed-off-by: Mario Limonciello Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit c63079c61177ba1b17fa05c6875699a36924fe39 Author: Mario Limonciello Date: Wed Oct 4 15:22:53 2023 -0500 drm/radeon: Fix UBSAN array-index-out-of-bounds for Radeon HD 5430 For pptable structs that use flexible array sizes, use flexible arrays. Suggested-by: Felix Held Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2894 Signed-off-by: Mario Limonciello Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 760efbca74a405dc439a013a5efaa9fadc95a8c3 Author: Mario Limonciello Date: Wed Oct 4 15:22:52 2023 -0500 drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7 For pptable structs that use flexible array sizes, use flexible arrays. Suggested-by: Felix Held Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2874 Signed-off-by: Mario Limonciello Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit d3c849020b6a5c7d8cb975844d26b3223f57047e Author: Linus Walleij Date: Fri Sep 8 12:49:49 2023 +0200 ARM: dts: ixp4xx: Use right restart keycode The "reset" key on a few IXP4xx routers were sending KEY_ESC but what we want to send is KEY_RESTART which will make OpenWrt and similar userspace do a controlled reboot. Link: https://lore.kernel.org/r/20230908-ixp4xx-dts-v1-2-98d36264ed6d@linaro.org Signed-off-by: Linus Walleij commit 2ffdee77f0bf5b5de9e7919a4155031ae3346af8 Author: Linus Walleij Date: Fri Sep 8 12:49:48 2023 +0200 ARM: dts: ixp4xx-nslu2: Enable write on flash To upgrade the firmware and similar, the flash needs write access. Link: https://lore.kernel.org/r/20230908-ixp4xx-dts-v1-1-98d36264ed6d@linaro.org Signed-off-by: Linus Walleij commit f71d371ae5b2e487b2a81ee6d39b82832038c74a Author: Linus Walleij Date: Sat Oct 7 14:32:40 2023 +0200 ARM: dts: ixp4xx: Add USRobotics USR8200 device tree This is a USRobotics NAS/Firewall/router that has been supported by OpenWrt in the past. It had dedicated users so let's get it properly supported. Some debugging and fixing was provided by Howard Harte. Link: https://lore.kernel.org/r/20231007-ixp4xx-usr8200-v1-1-aded3d6ff6f1@linaro.org Signed-off-by: Linus Walleij commit 5b1d4d99d18ce2931a0aa1166e6e2bb838ced834 Author: Linus Walleij Date: Sat Oct 7 14:15:13 2023 +0200 ARM: dts: Use only the Linksys compatible for now The Gemtek users can just use the Linksys device tree, triplet compatible is overdoing it. Link: https://lore.kernel.org/r/20231007-ixp4xx-usr8200-v3-3-ec46edd1ff0e@linaro.org Signed-off-by: Linus Walleij commit 54b11e2bd1b8c0fa1cd81bf9b0711fc2bf817de0 Author: Linus Walleij Date: Sat Oct 7 14:15:12 2023 +0200 dt-bindings: arm: List more IXP4xx devices The ixp4xx bindings are lacking some of the devices we have out there in the wild, so let's add them. Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231007-ixp4xx-usr8200-v3-2-ec46edd1ff0e@linaro.org Signed-off-by: Linus Walleij commit 714ff69c331c005c9cd05d69d3c6fe9da20ef687 Author: Linus Walleij Date: Sat Oct 7 14:15:11 2023 +0200 dt-bindings: Add vendor prefixes These vendor prefixes are used by some routers supported by e.g. OpenWrt. - ADI Engineering is a US telecom equipment company. - Arcom Controllers is a US manufacturer of repeaters. - Freecom Gmbh is a german telecom equipment company. - Gemtek Technology is a Taiwan telecom company. - Gateway Communications was a telecommunication company, now acquired by HKT Limited/PCCW. - Goramo Gorecki is a privately owned Polish telecom company. - U.S. Robotics Corporation, known through their brand name USRobotics is generally referred to as "USR" so use this prefix for the company's device tree bindings. Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231007-ixp4xx-usr8200-v3-1-ec46edd1ff0e@linaro.org Signed-off-by: Linus Walleij commit 2531f374f922e77ba51f24d1aa6fa11c7f4c36b8 Author: Marcos Paulo de Souza Date: Mon Oct 9 12:09:29 2023 -0300 Documentation: kselftests: Remove references to bpf tests Currently the bpf selftests are skipped by default, so is someone would like to run the tests one would need to run: $ make TARGETS=bpf SKIP_TARGETS="" kselftest To overwrite the SKIP_TARGETS that defines bpf by default. Also, following the BPF instructions[1], to run the bpf selftests one would need to enter in the tools/testing/selftests/bpf/ directory, and then run make, which is not the standard way to run selftests per it's documentation. For the reasons above stop mentioning bpf in the kselftests as examples of how to run a test suite. [1]: Documentation/bpf/bpf_devel_QA.rst Signed-off-by: Marcos Paulo de Souza Signed-off-by: Shuah Khan commit e0bb80c62cfd0c289c841d35e412e633299530e3 Author: Kristina Martsenko Date: Fri Sep 22 12:25:08 2023 +0100 KVM: arm64: Expose MOPS instructions to guests Expose the Armv8.8 FEAT_MOPS feature to guests in the ID register and allow the MOPS instructions to be run in a guest. Only expose MOPS if the whole system supports it. Note, it is expected that guests do not use these instructions on MMIO, similarly to other instructions where ESR_EL2.ISV==0 such as LDP/STP. Signed-off-by: Kristina Martsenko Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20230922112508.1774352-3-kristina.martsenko@arm.com Signed-off-by: Oliver Upton commit 2de451a329cf662beeba71f63c7f83ee24ca6642 Author: Kristina Martsenko Date: Fri Sep 22 12:25:07 2023 +0100 KVM: arm64: Add handler for MOPS exceptions An Armv8.8 FEAT_MOPS main or epilogue instruction will take an exception if executed on a CPU with a different MOPS implementation option (A or B) than the CPU where the preceding prologue instruction ran. In this case the OS exception handler is expected to reset the registers and restart execution from the prologue instruction. A KVM guest may use the instructions at EL1 at times when the guest is not able to handle the exception, expecting that the instructions will only run on one CPU (e.g. when running UEFI boot services in the guest). As KVM may reschedule the guest between different types of CPUs at any time (on an asymmetric system), it needs to also handle the resulting exception itself in case the guest is not able to. A similar situation will also occur in the future when live migrating a guest from one type of CPU to another. Add handling for the MOPS exception to KVM. The handling can be shared with the EL0 exception handler, as the logic and register layouts are the same. The exception can be handled right after exiting a guest, which avoids the cost of returning to the host exit handler. Similarly to the EL0 exception handler, in case the main or epilogue instruction is being single stepped, it makes sense to finish the step before executing the prologue instruction, so advance the single step state machine. Signed-off-by: Kristina Martsenko Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20230922112508.1774352-2-kristina.martsenko@arm.com Signed-off-by: Oliver Upton commit 253a1d33e5cfdf62525f5d6ed2bf03acbadd1582 Author: Yang Li Date: Fri Apr 21 16:13:03 2023 +0800 drm/rockchip: dsi: Use devm_platform_get_and_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yang Li Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20230421081303.122452-1-yang.lee@linux.alibaba.com commit 63a06c9fe30bf84d1ab6f07d0e408bd1d4ccaf85 Author: Zhu Wang Date: Mon Jul 31 20:53:04 2023 +0800 drm/rockchip: remove redundant of_match_ptr The driver depends on CONFIG_OF, so it is not necessary to use of_match_ptr here. Even for drivers that do not depend on CONFIG_OF, it's almost always better to leave out the of_match_ptr(), since the only thing it can possibly do is to save a few bytes of .text if a driver can be used both with and without it. Hence we remove of_match_ptr. Signed-off-by: Zhu Wang Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20230731125304.87059-1-wangzhu9@huawei.com commit 591455325a79dbe3be429006f8156f727b2a52dd Author: Jim Mattson Date: Fri Sep 29 16:02:46 2023 -0700 KVM: selftests: Test behavior of HWCR, a.k.a. MSR_K7_HWCR Verify the following behavior holds true for writes and reads of HWCR from host userspace: * Attempts to set bits 3, 6, or 8 are ignored * Bits 18 and 24 are the only bits that can be set * Any bit that can be set can also be cleared Signed-off-by: Jim Mattson Link: https://lore.kernel.org/r/20230929230246.1954854-4-jmattson@google.com Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson commit 8b0e00fba93449ecdda2c641e90c9b1f25f46669 Author: Jim Mattson Date: Fri Sep 29 16:02:45 2023 -0700 KVM: x86: Virtualize HWCR.TscFreqSel[bit 24] On certain CPUs, Linux guests expect HWCR.TscFreqSel[bit 24] to be set. If it isn't set, they complain: [Firmware Bug]: TSC doesn't count with P0 frequency! Allow userspace (and the guest) to set this bit in the virtual HWCR to eliminate the above complaint. Allow the guest to write the bit even though its is R/O on *some* CPUs. Like many bits in HWRC, TscFreqSel is not architectural at all. On Family 10h[1], it was R/W and powered on as 0. In Family 15h, one of the "changes relative to Family 10H Revision D processors[2] was: • MSRC001_0015 [Hardware Configuration (HWCR)]: • Dropped TscFreqSel; TSC can no longer be selected to run at NB P0-state. Despite the "Dropped" above, that same document later describes HWCR[bit 24] as follows: TscFreqSel: TSC frequency select. Read-only. Reset: 1. 1=The TSC increments at the P0 frequency If the guest clears the bit, the worst case scenario is the guest will be no worse off than it is today, e.g. the whining may return after a guest clears the bit and kexec()'s into a new kernel. [1] https://www.amd.com/content/dam/amd/en/documents/archived-tech-docs/programmer-references/31116.pdf [2] https://www.amd.com/content/dam/amd/en/documents/archived-tech-docs/programmer-references/42301_15h_Mod_00h-0Fh_BKDG.pdf, Signed-off-by: Jim Mattson Link: https://lore.kernel.org/r/20230929230246.1954854-3-jmattson@google.com [sean: elaborate on why the bit is writable by the guest] Signed-off-by: Sean Christopherson commit 598a790fc20f06e5582c939a4c5864ff1105c477 Author: Jim Mattson Date: Fri Sep 29 16:02:44 2023 -0700 KVM: x86: Allow HWCR.McStatusWrEn to be cleared once set When HWCR is set to 0, store 0 in vcpu->arch.msr_hwcr. Fixes: 191c8137a939 ("x86/kvm: Implement HWCR support") Signed-off-by: Jim Mattson Link: https://lore.kernel.org/r/20230929230246.1954854-2-jmattson@google.com Signed-off-by: Sean Christopherson commit 44b968d0d0868b7a9b7a5c64464ada464ff4d532 Author: Christophe JAILLET Date: Sat Sep 2 19:34:31 2023 +0200 drm/rockchip: cdn-dp: Fix some error handling paths in cdn_dp_probe() cdn_dp_audio_codec_init() can fail. So add some error handling. If component_add() fails, the previous cdn_dp_audio_codec_init() call should be undone, as already done in the remove function. Fixes: 88582f564692 ("drm/rockchip: cdn-dp: Don't unregister audio dev when unbinding") Signed-off-by: Christophe JAILLET Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/8494a41602fadb7439630921a9779640698f2f9f.1693676045.git.christophe.jaillet@wanadoo.fr commit 3d59c22bbb8d03f3f14e6d0845d44c146fb48f35 Author: Mark Brown Date: Sun Oct 1 01:42:50 2023 +0200 drm/rockchip: vop2: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231001-drm-rockchip-maple-v1-1-ca396ab75be7@kernel.org commit eb23cffdd7f085149799e5eda12a9aff792cc34d Author: Michael Tretter Date: Mon Oct 9 12:37:53 2023 +0200 drm/rockchip: vop2: Demote message in mod_supported to drm_dbg_kms Checking if a modifier is supported by a plane is normal behavior. It is normal that a plane may not support certain modifiers. Failing the check doesn't justify an error message in the kernel log and may mislead users. Demote the error message to drm_dbg_kms to only print the message if the respective debug messages are enabled. This is similar to the behavior in rockchip_drm_vop.c. Signed-off-by: Michael Tretter Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20231009103753.830458-1-m.tretter@pengutronix.de commit f0d82f073d79cecbbaffff425c41db4c16b395f6 Merge: fee44f43b235b 3b5d22bdf33c4 Author: Mark Brown Date: Mon Oct 9 19:51:57 2023 +0100 Convert Mediatek ASoC codecs to use GPIO descriptors Merge series from Linus Walleij : Convert over the Mediatek codecs to use GPIO descriptors. One few-liner affects gpiolib-of.h, I don't think there will be conflicts so I suggest that all of this can be merged through ASoC after review. commit 506efcba31296e9cbc4f8f148eec1e4b29039931 Author: Dmitry Baryshkov Date: Mon Oct 9 21:10:40 2023 +0300 drm/msm: carve out KMS code from msm_drv.c The msm_drv.c contains generic code intermixed with KMS handling code. Move all KMS-related code to a separate msm_kms.c file, cleaning up init code while doing this move. This also prevents msm driver from registering modesetting / atomic interfaces in the headless case. Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561648/ Signed-off-by: Rob Clark commit 112cd2f9614d55f5806bf9bf55e3a9052511c894 Author: Peter Robinson Date: Mon Oct 9 14:58:19 2023 +0100 bus: brcmstb_gisb: Depend on SoC specifics over generic arm Depend on the explicit SoC defines rather than generic architectures like most of the rest of the HW drivers do. Signed-off-by: Peter Robinson Link: https://lore.kernel.org/r/20231009135833.17880-4-pbrobinson@gmail.com Signed-off-by: Florian Fainelli commit 089d08d7c3a36c56da6f23c8022f8f47aeab06a5 Author: Peter Robinson Date: Mon Oct 9 14:58:17 2023 +0100 soc: bcm: brcmstb: depend on ARCH_BRCMSTB over arm arches The SOC_BRCMSTB is better depending on ARCH_BRCMSTB as it's defined for both arm and aarch64 but is more specific to the actual SoC's dependencies, it'll still get compile tested. Signed-off-by: Peter Robinson Link: https://lore.kernel.org/r/20231009135833.17880-2-pbrobinson@gmail.com Signed-off-by: Florian Fainelli commit a21ecc5262835604d280a36c8b2224f8e1f0199f Author: Kieran Bingham Date: Mon Sep 25 16:18:11 2023 +0100 firmware: raspberrypi: Fix devm_rpi_firmware_get documentation The function documentation for devm_rpi_firmware_get() was missing a description for the dev parameter. Provide it and clear the warning produced here. Fixes: f663204c9a1f ("firmware: raspberrypi: Introduce devm_rpi_firmware_get()") Signed-off-by: Kieran Bingham Link: https://lore.kernel.org/r/20230925151812.142480-1-kieran.bingham+renesas@ideasonboard.com Signed-off-by: Florian Fainelli commit 7d4d6ef70846a33b65a7e9753e4d052e2464b2be Author: Dmitry Baryshkov Date: Mon Oct 9 21:10:39 2023 +0300 drm/msm: make fb debugfs file available only in KMS case Don't register the 'fb' debugfs file, if there is no KMS (and so no framebuffers). Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561650/ Signed-off-by: Rob Clark commit ae13219e47d314b3bf7496b97983c22485e3627a Author: Dmitry Baryshkov Date: Mon Oct 9 21:10:38 2023 +0300 drm/msm: only register 'kms' debug file if KMS is used There is little point in having the empty debugfs file which always returns -ENODEV. Change this file to be created only if KMS is actually used. Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561656/ Signed-off-by: Rob Clark commit eedba1b3a7b4ed4040a9a21e5ce5ae268fc627c8 Author: Dmitry Baryshkov Date: Mon Oct 9 21:10:37 2023 +0300 drm/msm: switch to drmm_mode_config_init() Switch to drmm_mode_config_init() instead of drm_mode_config_init(). Drop drm_mode_config_cleanup() calls. Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561654/ Signed-off-by: Rob Clark commit 937154e49b1055dd92951672ed15341026bcd42d Author: Dmitry Baryshkov Date: Mon Oct 9 21:10:36 2023 +0300 drm/msm: rename msm_drv_shutdown() to msm_kms_shutdown() The msm_drv_shutdown function should only be used in the KMS case. Rename it accordingly. Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561652/ Signed-off-by: Rob Clark commit 283add3e640581acec1e94acfbd398f499764711 Author: Dmitry Baryshkov Date: Mon Oct 9 21:10:35 2023 +0300 drm/msm: remove shutdown callback from msm_platform_driver The msm_drv_shutdown only makes sense for the KMS-enabled devices, while msm_platform_driver is only used in the headless case. Remove the shutdown callback from the driver structure. Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561644/ Signed-off-by: Rob Clark commit d069ef292a3b6a3a2f455fcb31029f205534e226 Author: Dmitry Baryshkov Date: Mon Oct 9 21:10:34 2023 +0300 drm/msm: rename msm_pm_prepare/complete to note the KMS nature Rename the msm_pm_prepare() and msm_pm_complete() to msm_kms_pm_prepare() and msm_kms_pm_complete() consequently. Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561646/ Signed-off-by: Rob Clark commit 7414b35d664830b2e25c393f86fa7d534ec28466 Author: Dmitry Baryshkov Date: Mon Oct 9 21:10:33 2023 +0300 drm/msm: drop pm ops from the headless msm driver The msm_pm_prepare()/msm_pm_complete() only make sense for the KMS-enabled devices, they have priv->kms guards inside. Drop global msm_pm_ops, which were used only by the headless msm device. Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561643/ Signed-off-by: Rob Clark commit 4d1a1e4686bd47831bf5d1ebec482c525df265a1 Author: Dmitry Baryshkov Date: Mon Oct 9 21:10:32 2023 +0300 drm/msm: remove msm_drm_private::bridges field As all output devices have switched to devm_drm_bridge_add(), we can drop the bridges array from struct msm_drm_private. Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561641/ Signed-off-by: Rob Clark commit 61a72d5efce525b957d16a43bcab14c44592e46e Author: Dmitry Baryshkov Date: Mon Oct 9 21:10:31 2023 +0300 drm/msm/dp: switch to devm_drm_bridge_add() Make MSM DP driver use devm_drm_bridge_add() instead of plain drm_bridge_add(). As the driver doesn't require any additional cleanup, stop adding created bridge to the priv->bridges array. Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561639/ Signed-off-by: Rob Clark commit b8ec1e7f73210cec0cab4168a2e5aebd4560b812 Author: Dmitry Baryshkov Date: Mon Oct 9 21:10:30 2023 +0300 drm/msm/dp: move pdev from struct dp_display_private to struct msm_dp The dp_drm needs accessing the DP's platform device. Move pdev to the public structure. Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561642/ Signed-off-by: Rob Clark commit 719093a67c7f82c997b0d0eb55ed5deaa88bec7b Author: Dmitry Baryshkov Date: Mon Oct 9 21:10:29 2023 +0300 drm/msm/hdmi: switch to devm_drm_bridge_add() Make MSM HDMI driver use devm_drm_bridge_add() instead of plain drm_bridge_add(). As the driver doesn't require any additional cleanup, stop adding created bridge to the priv->bridges array. Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561635/ Signed-off-by: Rob Clark commit 5f403fd7d5c2a33be51b7f4cd4d0219e314d90f1 Author: Dmitry Baryshkov Date: Mon Oct 9 21:10:28 2023 +0300 drm/msm/dsi: switch to devm_drm_bridge_add() Make MSM DSI driver use devm_drm_bridge_add() instead of plain drm_bridge_add(). As the driver doesn't require any additional cleanup, stop adding created bridge to the priv->bridges array. Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561636/ Signed-off-by: Rob Clark commit cf009d4ec38cb3acc09b4248674c67abe916ceb5 Author: Dan Williams Date: Wed Oct 4 16:50:09 2023 -0700 tools/testing/cxl: Add 'sanitize notifier' support Allow for cxl_test regression of the sanitize notifier. Reuse the core setup infrastructure, and trigger notifications upon any sanitize submission with a programmable notification delay. Cc: Davidlohr Bueso Reviewed-by: Ira Weiny Reviewed-by: Dave Jiang Signed-off-by: Dan Williams commit 501b3d9fb036d58e88da434bc6473cec5f75644c Author: Dan Williams Date: Wed Oct 4 16:56:34 2023 -0700 tools/testing/cxl: Make cxl_memdev_state available to other command emulation Move @mds out of the event specific 'struct mock_event_store' and into the base 'struct cxl_mockmem_data' directly. This is in preparation for enabling cxl_test to exercise the notifier flow for 'sanitize' operation completion. Reviewed-by: Ira Weiny Reviewed-by: Dave Jiang Signed-off-by: Dan Williams commit 88d3917f82ed4215a2154432c26de1480a61b209 Author: Dan Williams Date: Thu Sep 28 18:02:07 2023 -0700 cxl/mem: Fix shutdown order Ira reports that removing cxl_mock_mem causes a crash with the following trace: BUG: kernel NULL pointer dereference, address: 0000000000000044 [..] RIP: 0010:cxl_region_decode_reset+0x7f/0x180 [cxl_core] [..] Call Trace: cxl_region_detach+0xe8/0x210 [cxl_core] cxl_decoder_kill_region+0x27/0x40 [cxl_core] cxld_unregister+0x29/0x40 [cxl_core] devres_release_all+0xb8/0x110 device_unbind_cleanup+0xe/0x70 device_release_driver_internal+0x1d2/0x210 bus_remove_device+0xd7/0x150 device_del+0x155/0x3e0 device_unregister+0x13/0x60 devm_release_action+0x4d/0x90 ? __pfx_unregister_port+0x10/0x10 [cxl_core] delete_endpoint+0x121/0x130 [cxl_core] devres_release_all+0xb8/0x110 device_unbind_cleanup+0xe/0x70 device_release_driver_internal+0x1d2/0x210 bus_remove_device+0xd7/0x150 device_del+0x155/0x3e0 ? lock_release+0x142/0x290 cdev_device_del+0x15/0x50 cxl_memdev_unregister+0x54/0x70 [cxl_core] This crash is due to the clearing out the cxl_memdev's driver context (@cxlds) before the subsystem is done with it. This is ultimately due to the region(s), that this memdev is a member, being torn down and expecting to be able to de-reference @cxlds, like here: static int cxl_region_decode_reset(struct cxl_region *cxlr, int count) ... if (cxlds->rcd) goto endpoint_reset; ... Fix it by keeping the driver context valid until memdev-device unregistration, and subsequently the entire stack of related dependencies, unwinds. Fixes: 9cc238c7a526 ("cxl/pci: Introduce cdevm_file_operations") Reported-by: Ira Weiny Reviewed-by: Davidlohr Bueso Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Reviewed-by: Ira Weiny Tested-by: Ira Weiny Signed-off-by: Dan Williams commit 1f50db2f3e1ea4e2100be22ff0784c66b7e6b4b0 Author: Dmitry Baryshkov Date: Mon Oct 9 20:48:40 2023 +0300 drm/msm/mdp5: move resource allocation to the _probe function To let the probe function bail early if any of the resources is unavailable, move resource allocattion from kms_init directly to the probe callback. Reviewed-by: Abhinav Kumar Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561630/ Signed-off-by: Rob Clark commit 3c74682637e63afc81f2daee89adf18d97cda25a Author: Dmitry Baryshkov Date: Mon Oct 9 20:48:39 2023 +0300 drm/msm/mdp4: move resource allocation to the _probe function To let the probe function bail early if any of the resources is unavailable, move resource allocattion from kms_init directly to the probe callback. While we are at it, replace irq_of_parse_and_map() with platform_get_irq(). Reviewed-by: Abhinav Kumar Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561628/ Signed-off-by: Rob Clark commit c53a1aeee40564ccfe11b662390367a0d86a2354 Author: Dmitry Baryshkov Date: Mon Oct 9 20:48:38 2023 +0300 drm/msm/dpu: move resource allocation to the _probe function To let the probe function bail early if any of the resources is unavailable, move resource allocattion from kms_init directly to the probe callback. While we are at it, replace irq_of_parse_and_map() with platform_get_irq(). This also drops devm_iounmap() calls. It is too early to have them _dpu_kms_hw_destroy() (or it will break if for some reason DPU device is rebound into the composite device) and it doesn't make sense to have them in dpu_dev_remove (as everything will be torn down by the devres anyway after the device is unbound from the driver). Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561629/ Signed-off-by: Rob Clark commit a2ab5d5bb6b1dedef7b6c2711a7a53cbf9f508f4 Author: Dmitry Baryshkov Date: Mon Oct 9 20:48:37 2023 +0300 drm/msm: allow passing struct msm_kms to msm_drv_probe() In preparation of moving resource allocation to the probe time, allow MSM KMS drivers to pass struct msm_kms pointer via msm_drv_probe(). Reviewed-by: Rob Clark Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/561627/ Signed-off-by: Rob Clark commit 1d5245715853f50d9e17489e4d6ef4aa50c60484 Author: Konrad Dybcio Date: Tue Sep 26 20:24:38 2023 +0200 drm/msm/adreno: Add A635 speedbin 0xac (A643) Downstream calls this the "speedbin 1", but that number is already occupied. Use index two. Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/559607/ Signed-off-by: Rob Clark commit 3e7042ba87da35a16fddefe86823deaee6fbcd7c Author: Konrad Dybcio Date: Tue Sep 26 20:24:37 2023 +0200 drm/msm/adreno: Add ZAP firmware name to A635 Some (many?) devices with A635 expect a ZAP shader to be loaded. Set the file name to allow for that. Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/559605/ Signed-off-by: Rob Clark commit 75cb60d4f5f762b12643b67cbefefcf05ecfd7eb Author: Konrad Dybcio Date: Tue Sep 26 20:24:36 2023 +0200 drm/msm/a6xx: Fix unknown speedbin case When opp-supported-hw is present under an OPP node, but no form of opp_set_supported_hw() has been called, that OPP is ignored by the API and marked as unsupported. Before Commit c928a05e4415 ("drm/msm/adreno: Move speedbin mapping to device table"), an unknown speedbin would result in marking all OPPs as available, but it's better to avoid potentially overclocking the silicon - the GMU will simply refuse to power up the chip. Currently, the Adreno speedbin code does just that (AND returns an invalid error, (int)UINT_MAX). Fix that by defaulting to speedbin 0 (which is conveniently always bound to fuseval == 0). Fixes: c928a05e4415 ("drm/msm/adreno: Move speedbin mapping to device table") Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/559604/ Signed-off-by: Rob Clark commit beb3542320479cd59a08273be0b19dfea0b36042 Author: Konrad Dybcio Date: Fri Aug 25 23:11:19 2023 +0200 drm/msm/adreno: Fix SM6375 GPU ID SM6375 comes with a patchlevel=1. Fix the chipid up to reflect that. Fixes: 90b593ce1c9e ("drm/msm/adreno: Switch to chip-id for identifying GPU") Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/554527/ Signed-off-by: Rob Clark commit b77532803d11f2b03efab2ebfd8c0061cd7f8b30 Author: Konrad Dybcio Date: Mon Sep 25 16:50:39 2023 +0200 drm/msm/a6xx: Poll for GBIF unhalt status in hw_init Some GPUs - particularly A7xx ones - are really really stubborn and sometimes take a longer-than-expected time to finish unhalting GBIF. Note that this is not caused by the request a few lines above. Poll for the unhalt ack to make sure we're not trying to write bits to an essentially dead GPU that can't receive data on its end of the bus. Failing to do this will result in inexplicable GMU timeouts or worse. This is a rather ugly hack which introduces a whole lot of latency. Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/559292/ Signed-off-by: Rob Clark commit 1f8c29e800661d522e3a6487c5435de28e44fd29 Author: Konrad Dybcio Date: Mon Sep 25 16:50:38 2023 +0200 drm/msm/a6xx: Add A740 support A740 builds upon the A730 IP, shuffling some values and registers around. More differences will appear when things like BCL are implemented. adreno_is_a740_family is added in preparation for more A7xx GPUs, the logic checks will be valid resulting in smaller diffs. Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/559291/ Signed-off-by: Rob Clark commit 9588d2f860a446d1bd40f7cd8836f826fecf81fd Author: Konrad Dybcio Date: Mon Sep 25 16:50:37 2023 +0200 drm/msm/a6xx: Add A730 support Add support for Adreno 730, also known as GEN7_0_x, found on SM8450. Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/559290/ Signed-off-by: Rob Clark commit e997ae5f45caf7df08a421b1d1edac7a47d06890 Author: Konrad Dybcio Date: Mon Sep 25 16:50:36 2023 +0200 drm/msm/a6xx: Mostly implement A7xx gpu_state Provide the necessary alternations to mostly support state dumping on A7xx. Newer GPUs will probably require more changes here. Crashdumper and debugbus remain untested. Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/559289/ Signed-off-by: Rob Clark commit 88a0997f2f949f1f7076adeb5d4fa4d684cca5bf Author: Konrad Dybcio Date: Mon Sep 25 16:50:35 2023 +0200 drm/msm/a6xx: Send ACD state to QMP at GMU resume The QMP mailbox expects to be notified of the ACD (Adaptive Clock Distribution) state. Get a handle to the mailbox at probe time and poke it at GMU resume. Since we don't fully support ACD yet, hardcode the message to "val: 0" (state = disabled). Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/559287/ Signed-off-by: Rob Clark commit af66706accdf5afef45204afc87037f876e0665c Author: Konrad Dybcio Date: Mon Sep 25 16:50:34 2023 +0200 drm/msm/a6xx: Add skeleton A7xx support A7xx GPUs are - from kernel's POV anyway - basically another generation of A6xx. They build upon the A650/A660_family advancements, skipping some writes (presumably more values are preset correctly on reset), adding some new ones and changing others. One notable difference is the introduction of a second shadow, called BV. To handle this with the current code, allocate it right after the current RPTR shadow. BV handling and .submit are mostly based on Jonathan Marek's work. All A7xx GPUs are assumed to have a GMU. A702 is not an A7xx-class GPU, it's a weird forked A610. Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/559285/ Signed-off-by: Rob Clark commit 23eeae60b0fa9fb1af7623b42a55a719a4ec4597 Author: Konrad Dybcio Date: Mon Sep 25 16:50:33 2023 +0200 drm/msm/a6xx: Add missing regs for A7XX Add some missing definitions required for A7 support. This may be substituted with a mesa header sync. Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/559282/ Signed-off-by: Rob Clark commit 103f3d24cb27630d9faa42fc12e008ebd10ff405 Author: Konrad Dybcio Date: Mon Sep 25 16:50:32 2023 +0200 dt-bindings: display/msm/gpu: Allow A7xx SKUs Allow A7xx SKUs, such as the A730 GPU found on SM8450 and friends. They use GMU for all things DVFS, just like most A6xx GPUs. Reviewed-by: Krzysztof Kozlowski Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/559281/ Signed-off-by: Rob Clark commit 97a0cc9753ad4825732eca9c2dcc327f6504c841 Author: Konrad Dybcio Date: Mon Sep 25 16:50:31 2023 +0200 dt-bindings: display/msm/gmu: Allow passing QMP handle When booting the GMU, the QMP mailbox should be pinged about some tunables (e.g. adaptive clock distribution state). To achieve that, a reference to it is necessary. Allow it and require it with A730. Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Acked-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/559279/ Signed-off-by: Rob Clark commit 0247d99d09b7e6f5ccabecbdd7dd671b3168c913 Author: Konrad Dybcio Date: Mon Sep 25 16:50:30 2023 +0200 dt-bindings: display/msm/gmu: Add Adreno 7[34]0 GMU The GMU on the A7xx series is pretty much the same as on the A6xx parts. It's now "smarter", needs a bit less register writes and controls more things (like inter-frame power collapse) mostly internally (instead of us having to write to G[PM]U_[CG]X registers from APPS) The only difference worth mentioning is the now-required DEMET clock, which is strictly required for things like asserting reset lines, not turning it on results in GMU not being fully functional (all OOB requests would fail and HFI would hang after the first submitted OOB). Describe the A730 and A740 GMU. Reviewed-by: Krzysztof Kozlowski Tested-by: Neil Armstrong # on SM8550-QRD Tested-by: Dmitry Baryshkov # sm8450 Signed-off-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/559278/ Signed-off-by: Rob Clark commit e0d4e8acb3789c5a8651061fbab62ca24a45c063 Author: Su Hui Date: Sun Oct 8 14:39:30 2023 +0800 f2fs: avoid format-overflow warning With gcc and W=1 option, there's a warning like this: fs/f2fs/compress.c: In function ‘f2fs_init_page_array_cache’: fs/f2fs/compress.c:1984:47: error: ‘%u’ directive writing between 1 and 7 bytes into a region of size between 5 and 8 [-Werror=format-overflow=] 1984 | sprintf(slab_name, "f2fs_page_array_entry-%u:%u", MAJOR(dev), MINOR(dev)); | ^~ String "f2fs_page_array_entry-%u:%u" can up to 35. The first "%u" can up to 4 and the second "%u" can up to 7, so total size is "24 + 4 + 7 = 35". slab_name's size should be 35 rather than 32. Cc: stable@vger.kernel.org Signed-off-by: Su Hui Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 1ce3a95701a54657bc88040aaccfabfb883c8221 Merge: af571133f7ae0 27df2ed3b1450 Author: Conor Dooley Date: Mon Oct 9 18:53:33 2023 +0100 Merge initial Sophgo patches into riscv-dt-for-next Two series, from Chen and Jisheng, to add support for some of Sophgo's offerings - albeit on vastly different ends of the spectrum. The sg2042 is a "developer motherboard" with a 64 core SoC. The cv1800 series are aimed for use in IP cameras, as far as I can tell, and have one core for running Linux on. I expect that Chen Wang will take over maintenance of these SoCs once they have got more used to the process etc, and in the meantime I will apply the patches and send them to the soc maintainers. At least, that was what they requested I do :) Signed-off-by: Conor Dooley commit 8b07c1fb0f1ad139373c8253f2fad8bc43fab07d Author: Chao Yu Date: Sat Oct 7 15:45:52 2023 +0800 f2fs: fix to initialize map.m_pblk in f2fs_precache_extents() Otherwise, it may print random physical block address in tracepoint of f2fs_map_blocks() as below: f2fs_map_blocks: dev = (253,16), ino = 2297, file offset = 0, start blkaddr = 0xa356c421, len = 0x0, flags = 0 Fixes: c4020b2da4c9 ("f2fs: support F2FS_IOC_PRECACHE_EXTENTS") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit fee44f43b235b8290629bcf077dc6ca13d06c753 Merge: 72151ad0cba8a 329b017ccdf80 Author: Mark Brown Date: Mon Oct 9 18:40:19 2023 +0100 Convert Rockchip ASoC drivers to GPIO descriptors Merge series from Linus Walleij : The Rockchip drivers are pretty straight-forward to convert over to using GPIO descriptors. commit 27a6c5c50c4bb0c56296f01a3142db796bb01da1 Author: Kamalesh Babulal Date: Fri Oct 6 17:20:32 2023 +0530 cgroup: use legacy_name for cgroup v1 disable info cgroup v1 or v2 or both controller names can be passed as arguments to the 'cgroup_no_v1' kernel parameter, though most of the controller's names are the same for both cgroup versions. This can be confusing when both versions are used interchangeably, i.e., passing cgroup_no_v1=io $ sudo dmesg |grep cgroup ... cgroup: Disabling io control group subsystem in v1 mounts cgroup: Disabled controller 'blkio' Make it consistent across the pr_info()'s, by using ss->legacy_name, as the subsystem name, while printing the cgroup v1 controller disabling information in cgroup_init(). Signed-off-by: Kamalesh Babulal Signed-off-by: Tejun Heo commit 1566bf4b13daa66e3de6fdbc77ee3995df5a9064 Author: Joel Fernandes (Google) Date: Fri Aug 4 16:27:45 2023 +0000 docs: memory-barriers: Add note on compiler transformation and address deps The compiler has the ability to cause misordering by destroying address-dependency barriers if comparison operations are used. Add a note about this to memory-barriers.txt in the beginning of both the historical address-dependency sections and point to rcu-dereference.rst for more information. Signed-off-by: Joel Fernandes (Google) Cc: Alan Stern Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Nicholas Piggin Cc: David Howells Cc: Jade Alglave Cc: Luc Maranget Cc: Akira Yokosawa Cc: Daniel Lustig Cc: Joel Fernandes Cc: Jonathan Corbet Reviewed-by: Andrea Parri Signed-off-by: Paul E. McKenney commit 33eaede07ad20eda75f11b538faa320b4be90a48 Author: Randy Dunlap Date: Sun Oct 8 14:49:40 2023 -0700 drm/i915/uapi: fix doc typos Correct typo of "its". Add commas for clarity. Capitalize L3. Signed-off-by: Randy Dunlap Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: intel-gfx@lists.freedesktop.org Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: Ville Syrjälä Cc: dri-devel@lists.freedesktop.org Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20231008214942.28439-1-rdunlap@infradead.org commit 1be84ca53ca0421c781f9ec007cd8bccbb58f763 Author: Ian Rogers Date: Fri Oct 6 21:44:39 2023 -0700 bpftool: Align bpf_load_and_run_opts insns and data A C string lacks alignment so use aligned arrays to avoid potential alignment problems. Switch to using sizeof (less 1 for the \0 terminator) rather than a hardcode size constant. Signed-off-by: Ian Rogers Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20231007044439.25171-2-irogers@google.com commit 23671f4dfd10b48b4a2fee4768886f0d8ec55b7e Author: Ian Rogers Date: Fri Oct 6 21:44:38 2023 -0700 bpftool: Align output skeleton ELF code libbpf accesses the ELF data requiring at least 8 byte alignment, however, the data is generated into a C string that doesn't guarantee alignment. Fix this by assigning to an aligned char array. Use sizeof on the array, less one for the \0 terminator, rather than generating a constant. Fixes: a6cc6b34b93e ("bpftool: Provide a helper method for accessing skeleton's embedded ELF data") Signed-off-by: Ian Rogers Signed-off-by: Andrii Nakryiko Reviewed-by: Alan Maguire Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20231007044439.25171-1-irogers@google.com commit 8badbaffbe490d76a54026e8988168d9493ad141 Author: Adrián Larumbe Date: Thu Oct 5 15:12:35 2023 +0100 Documentation/gpu: fix Panfrost documentation build warnings Fix issues revealed by `make htmldocs` after adding Panfrost DRM documentation file. Signed-off-by: Adrián Larumbe Fixes: f11b0417eec2 ("drm/panfrost: Add fdinfo support GPU load metrics") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310030917.Txzlpoeq-lkp@intel.com Reviewed-by: Steven Price Signed-off-by: Boris Brezillon Link: https://patchwork.freedesktop.org/patch/msgid/20231005141239.132783-1-adrian.larumbe@collabora.com commit ad0a2e4c2f20510d7e3f2bc110cf74f8578547f0 Author: Uros Bizjak Date: Mon Jul 10 21:01:27 2023 +0200 locking/atomic, xen: Use sync_try_cmpxchg() instead of sync_cmpxchg() Use sync_try_cmpxchg() instead of sync_cmpxchg(*ptr, old, new) == old in clear_masked_cond(), clear_linked() and gnttab_end_foreign_access_ref_v1(). x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg), improving the cmpxchg loop in gnttab_end_foreign_access_ref_v1() from: 174: eb 0e jmp 184 <...> 176: 89 d0 mov %edx,%eax 178: f0 66 0f b1 31 lock cmpxchg %si,(%rcx) 17d: 66 39 c2 cmp %ax,%dx 180: 74 11 je 193 <...> 182: 89 c2 mov %eax,%edx 184: 89 d6 mov %edx,%esi 186: 66 83 e6 18 and $0x18,%si 18a: 74 ea je 176 <...> to: 614: 89 c1 mov %eax,%ecx 616: 66 83 e1 18 and $0x18,%cx 61a: 75 11 jne 62d <...> 61c: f0 66 0f b1 0a lock cmpxchg %cx,(%rdx) 621: 75 f1 jne 614 <...> No functional change intended. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Acked-by: Juergen Gross Cc: Peter Zijlstra Cc: Stefano Stabellini Cc: Oleksandr Tyshchenko Cc: Linus Torvalds Cc: linux-kernel@vger.kernel.org commit 636d6a8b850a2bb8462b5f743c9db9aa4d735cda Author: Uros Bizjak Date: Mon Sep 25 16:55:48 2023 +0200 locking/atomic/x86: Introduce arch_sync_try_cmpxchg() Introduce the arch_sync_try_cmpxchg() macro to improve code using sync_try_cmpxchg() locking primitive. The new definitions use existing __raw_try_cmpxchg() macros, but use its own "lock; " prefix. The new macros improve assembly of the cmpxchg loop in evtchn_fifo_unmask() from drivers/xen/events/events_fifo.c from: 57a: 85 c0 test %eax,%eax 57c: 78 52 js 5d0 <...> 57e: 89 c1 mov %eax,%ecx 580: 25 ff ff ff af and $0xafffffff,%eax 585: c7 04 24 00 00 00 00 movl $0x0,(%rsp) 58c: 81 e1 ff ff ff ef and $0xefffffff,%ecx 592: 89 4c 24 04 mov %ecx,0x4(%rsp) 596: 89 44 24 08 mov %eax,0x8(%rsp) 59a: 8b 74 24 08 mov 0x8(%rsp),%esi 59e: 8b 44 24 04 mov 0x4(%rsp),%eax 5a2: f0 0f b1 32 lock cmpxchg %esi,(%rdx) 5a6: 89 04 24 mov %eax,(%rsp) 5a9: 8b 04 24 mov (%rsp),%eax 5ac: 39 c1 cmp %eax,%ecx 5ae: 74 07 je 5b7 <...> 5b0: a9 00 00 00 40 test $0x40000000,%eax 5b5: 75 c3 jne 57a <...> <...> to: 578: a9 00 00 00 40 test $0x40000000,%eax 57d: 74 2b je 5aa <...> 57f: 85 c0 test %eax,%eax 581: 78 40 js 5c3 <...> 583: 89 c1 mov %eax,%ecx 585: 25 ff ff ff af and $0xafffffff,%eax 58a: 81 e1 ff ff ff ef and $0xefffffff,%ecx 590: 89 4c 24 04 mov %ecx,0x4(%rsp) 594: 89 44 24 08 mov %eax,0x8(%rsp) 598: 8b 4c 24 08 mov 0x8(%rsp),%ecx 59c: 8b 44 24 04 mov 0x4(%rsp),%eax 5a0: f0 0f b1 0a lock cmpxchg %ecx,(%rdx) 5a4: 89 44 24 04 mov %eax,0x4(%rsp) 5a8: 75 30 jne 5da <...> <...> 5da: 8b 44 24 04 mov 0x4(%rsp),%eax 5de: eb 98 jmp 578 <...> The new code removes move instructions from 585: 5a6: and 5a9: and the compare from 5ac:. Additionally, the compiler assumes that cmpxchg success is more probable and optimizes code flow accordingly. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Linus Torvalds Cc: linux-kernel@vger.kernel.org commit e01cc1e8c2ad73cebb980878ede5584e0f2688f7 Author: Uros Bizjak Date: Mon Sep 25 16:50:23 2023 +0200 locking/atomic: Add generic support for sync_try_cmpxchg() and its fallback Provide the generic sync_try_cmpxchg() function from the raw_ prefixed version, also adding explicit instrumentation. The patch amends existing scripts to generate sync_try_cmpxchg() locking primitive and its raw_sync_try_cmpxchg() fallback, while leaving existing macros from the try_cmpxchg() family unchanged. The target can define its own arch_sync_try_cmpxchg() to override the generic version of raw_sync_try_cmpxchg(). This allows the target to generate more optimal assembly than the generic version. Additionally, the patch renames two scripts to better reflect whet they really do. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland Cc: Linus Torvalds Cc: linux-kernel@vger.kernel.org commit fdb8b7a1af31d69ee1c8ddc02926cb409eaaecc3 Merge: 0cff993e08a75 94f6f0550c625 Author: Ingo Molnar Date: Mon Oct 9 18:09:23 2023 +0200 Merge tag 'v6.6-rc5' into locking/core, to pick up fixes Signed-off-by: Ingo Molnar commit f843249cb6a151bfe7b955dfb93ff29663c258fb Author: Julia Lawall Date: Thu Sep 28 12:43:34 2023 +0200 tracing/eprobe: drop unneeded breaks Drop break after return. Link: https://lore.kernel.org/all/20230928104334.41215-1-Julia.Lawall@inria.fr/ Signed-off-by: Julia Lawall Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit a110d17240671f4417a2a676be48bda03fe64866 Author: Atul Kumar Pant Date: Thu Aug 17 22:38:19 2023 +0530 samples: kprobes: Fixes a typo Fixes typo in a function name. Link: https://lore.kernel.org/all/20230817170819.77857-1-atulpant.linux@gmail.com/ Signed-off-by: Atul Kumar Pant Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit f2273f4e19e29f7d0be6a2393f18369cd1b496c8 Author: Ingo Molnar Date: Mon Oct 9 17:31:26 2023 +0200 sched/topology: Move the declaration of 'schedutil_gov' to kernel/sched/sched.h Move it out of the .c file into the shared scheduler-internal header file, to gain type-checking. Signed-off-by: Ingo Molnar Cc: Shrikanth Hegde Cc: Valentin Schneider Link: https://lore.kernel.org/r/20231009060037.170765-3-sshegde@linux.vnet.ibm.com commit 8f833c82cdab7b4049bcfe88311d35fa5f24e422 Author: Shrikanth Hegde Date: Mon Oct 9 11:30:37 2023 +0530 sched/topology: Change behaviour of the 'sched_energy_aware' sysctl, based on the platform The 'sched_energy_aware' sysctl is available for the admin to disable/enable energy aware scheduling(EAS). EAS is enabled only if few conditions are met by the platform. They are, asymmetric CPU capacity, no SMT, schedutil CPUfreq governor, frequency invariant load tracking etc. A platform may boot without EAS capability, but could gain such capability at runtime. For example, changing/registering the cpufreq governor to schedutil. At present, though platform doesn't support EAS, this sysctl returns 1 and it ends up calling build_perf_domains on write to 1 and NOP when writing to 0. That is confusing and un-necessary. Desired behavior would be to have this sysctl to enable/disable the EAS on supported platform. On non-supported platform write to the sysctl would return not supported error and read of the sysctl would return empty. So sched_energy_aware returns empty - EAS is not possible at this moment This will include EAS capable platforms which have at least one EAS condition false during startup, e.g. not using the schedutil cpufreq governor sched_energy_aware returns 0 - EAS is supported but disabled by admin. sched_energy_aware returns 1 - EAS is supported and enabled. User can find out the reason why EAS is not possible by checking info messages. sched_is_eas_possible returns true if the platform can do EAS at this moment. Signed-off-by: Shrikanth Hegde Signed-off-by: Ingo Molnar Tested-by: Pierre Gondois Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20231009060037.170765-3-sshegde@linux.vnet.ibm.com commit 0d7ae06860753bb30b3731302b994da071120d00 Author: David Vernet Date: Wed Oct 4 11:23:39 2023 -0500 selftests/bpf: Test pinning bpf timer to a core Now that we support pinning a BPF timer to the current core, we should test it with some selftests. This patch adds two new testcases to the timer suite, which verifies that a BPF timer both with and without BPF_F_TIMER_ABS, can be pinned to the calling core with BPF_F_TIMER_CPU_PIN. Signed-off-by: David Vernet Signed-off-by: Daniel Borkmann Acked-by: Song Liu Acked-by: Hou Tao Link: https://lore.kernel.org/bpf/20231004162339.200702-3-void@manifault.com commit d6247ecb6c1e17d7a33317090627f5bfe563cbb2 Author: David Vernet Date: Wed Oct 4 11:23:38 2023 -0500 bpf: Add ability to pin bpf timer to calling CPU BPF supports creating high resolution timers using bpf_timer_* helper functions. Currently, only the BPF_F_TIMER_ABS flag is supported, which specifies that the timeout should be interpreted as absolute time. It would also be useful to be able to pin that timer to a core. For example, if you wanted to make a subset of cores run without timer interrupts, and only have the timer be invoked on a single core. This patch adds support for this with a new BPF_F_TIMER_CPU_PIN flag. When specified, the HRTIMER_MODE_PINNED flag is passed to hrtimer_start(). A subsequent patch will update selftests to validate. Signed-off-by: David Vernet Signed-off-by: Daniel Borkmann Acked-by: Song Liu Acked-by: Hou Tao Link: https://lore.kernel.org/bpf/20231004162339.200702-2-void@manifault.com commit 2e9440ac07169790df74dcab412a945c2bfb78f2 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:25 2023 -0300 orangefs: move orangefs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to orangefs_xattr_handlers at runtime. Cc: Mike Marshall Cc: Martin Brandenburg Cc: devel@lists.orangefs.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-22-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit 2cba9af99b3f88c8afe457770452d9907d7c5f8c Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:24 2023 -0300 ocfs2: move ocfs2_xattr_handlers and ocfs2_xattr_handler_map to .rodata This makes it harder for accidental or malicious changes to ocfs2_xattr_handlers or ocfs2_xattr_handler_map at runtime. Cc: Mark Fasheh Cc: Joel Becker Cc: Joseph Qi Cc: ocfs2-devel@lists.linux.dev Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-21-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit 5bf1dd9441da8f02ce2082c246327f927836b8ff Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:23 2023 -0300 ntfs3: move ntfs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to ntfs_xattr_handlers at runtime. Cc: Konstantin Komarov Cc: ntfs3@lists.linux.dev Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-20-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit f496647e3b09945f54bdbe78a998130cf736b4fc Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:22 2023 -0300 nfs: move nfs4_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to nfs4_xattr_handlers at runtime. Cc: Trond Myklebust Cc: Anna Schumaker Cc: linux-nfs@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-19-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit ffb2e06508279ced466d60164105da3f5c1b14be Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:21 2023 -0300 kernfs: move kernfs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to kernfs_xattr_handlers at runtime. Cc: Greg Kroah-Hartman Cc: Tejun Heo Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-18-wedsonaf@gmail.com Acked-by: Greg Kroah-Hartman Signed-off-by: Christian Brauner commit ea780283e2c04517ff2e9cdebd0257108aa7f72d Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:20 2023 -0300 jfs: move jfs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to jfs_xattr_handlers at runtime. Cc: Dave Kleikamp Cc: jfs-discussion@lists.sourceforge.net Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-17-wedsonaf@gmail.com Reviewed-by: Dave Kleikamp Signed-off-by: Christian Brauner commit 13a75c3abcbed217e2edaf8c760e603b3f994a04 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:19 2023 -0300 jffs2: move jffs2_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to jffs2_xattr_handlers at runtime. Cc: David Woodhouse Cc: Richard Weinberger Cc: linux-mtd@lists.infradead.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-16-wedsonaf@gmail.com Reviewed-by: Zhihao Cheng Signed-off-by: Christian Brauner commit 2c323f2c565078557d09768a4ee654ea3f139285 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:18 2023 -0300 hfsplus: move hfsplus_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to hfsplus_xattr_handlers at runtime. Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-15-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit e27a45b6507083f50781a2c94c5f6618a3b916d5 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:17 2023 -0300 hfs: move hfs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to hfs_xattr_handlers at runtime. Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-14-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit 89491fafa81c7c4e6aeb8f1a21903bc65b77515e Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:16 2023 -0300 gfs2: move gfs2_xattr_handlers_max to .rodata This makes it harder for accidental or malicious changes to gfs2_xattr_handlers_max at runtime. Cc: Bob Peterson Cc: Andreas Gruenbacher Cc: cluster-devel@redhat.com Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-13-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit 34271edb18787d0b7d0f14c505468378de7efb4d Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:15 2023 -0300 fuse: move fuse_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to fuse_xattr_handlers at runtime. Cc: Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-12-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit a1c0752c33d25db28a9846ce82866a7f486f83e0 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:14 2023 -0300 f2fs: move f2fs_xattr_handlers and f2fs_xattr_handler_map to .rodata This makes it harder for accidental or malicious changes to f2fs_xattr_handlers or f2fs_xattr_handler_map at runtime. Cc: Jaegeuk Kim Cc: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-11-wedsonaf@gmail.com Reviewed-by: Chao Yu Signed-off-by: Christian Brauner commit ce78a1ec1c3b58992112c80ccb0831b91b7b313a Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:13 2023 -0300 ext2: move ext2_xattr_handlers and ext2_xattr_handler_map to .rodata This makes it harder for accidental or malicious changes to ext2_xattr_handlers or ext2_xattr_handler_map at runtime. Cc: Jan Kara Cc: linux-ext4@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-10-wedsonaf@gmail.com Acked-by: Jan Kara Signed-off-by: Christian Brauner commit 3591f40e223c66d4a3f152390b6db56421011854 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:12 2023 -0300 erofs: move erofs_xattr_handlers and xattr_handler_map to .rodata This makes it harder for accidental or malicious changes to erofs_xattr_handlers or xattr_handler_map at runtime. Cc: Gao Xiang Cc: Chao Yu Cc: Yue Hu Cc: Jeffle Xu Cc: linux-erofs@lists.ozlabs.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-9-wedsonaf@gmail.com Acked-by: Gao Xiang Signed-off-by: Christian Brauner commit f354ed9810661334fe53196e83b08d8e8680f72f Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:11 2023 -0300 ecryptfs: move ecryptfs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to ecryptfs_xattr_handlers at runtime. Cc: Tyler Hicks Cc: ecryptfs@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-8-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit 10f9fbe9f25a81fb103a98fb2ee5f77afbfdfacc Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:10 2023 -0300 ceph: move ceph_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to ceph_xattr_handlers at runtime. Cc: Xiubo Li Cc: Ilya Dryomov Cc: Jeff Layton Cc: ceph-devel@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-7-wedsonaf@gmail.com Acked-by: Ilya Dryomov Signed-off-by: Christian Brauner commit 8a25b4189896411136fcce5f271673f6239725ba Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:09 2023 -0300 btrfs: move btrfs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to btrfs_xattr_handlers at runtime. Cc: Chris Mason Cc: Josef Bacik Cc: David Sterba Cc: linux-btrfs@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-6-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit f710c2e4813559e84fb2deb9f36ff43f0ebdf94e Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:08 2023 -0300 afs: move afs_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to afs_xattr_handlers at runtime. Cc: David Howells Cc: Marc Dionne Cc: linux-afs@lists.infradead.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-5-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit b6079dc9cb5182518b8f14fa350d5c501cba80d3 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:07 2023 -0300 9p: move xattr-related structs to .rodata This makes it harder for accidental or malicious changes to v9fs_xattr_user_handler, v9fs_xattr_trusted_handler, v9fs_xattr_security_handler, or v9fs_xattr_handlers at runtime. Cc: Eric Van Hensbergen Cc: Latchesar Ionkov Cc: Dominique Martinet Cc: Christian Schoenebeck Cc: v9fs@lists.linux.dev Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-4-wedsonaf@gmail.com Acked-by: Dominique Martinet Reviewed-by: Christian Schoenebeck Signed-off-by: Christian Brauner commit e60ac12833400296433c450d346f539d662ab4b0 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:06 2023 -0300 ext4: move ext4_xattr_handlers to .rodata This makes it harder for accidental or malicious changes to ext4_xattr_handlers at runtime. Cc: Theodore Ts'o Cc: Andreas Dilger Cc: linux-ext4@vger.kernel.org Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-3-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit e346fb6d774abf1d9a87d39b1e3eef0b7397d154 Author: Wedson Almeida Filho Date: Sat Sep 30 02:00:05 2023 -0300 xattr: make the xattr array itself const As it is currently declared, the xattr_handler structs are const but the array containing their pointers is not. This patch makes it so that fs modules can place them in .rodata, which makes it harder for accidental/malicious modifications at runtime. Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20230930050033.41174-2-wedsonaf@gmail.com Signed-off-by: Christian Brauner commit 25e56847821f7375bdee7dae1027c7917d07ce4b Author: Sandipan Das Date: Thu Oct 5 10:53:15 2023 +0530 perf/x86/amd/uncore: Add memory controller support Unified Memory Controller (UMC) events were introduced with Zen 4 as a part of the Performance Monitoring Version 2 (PerfMonV2) enhancements. An event is specified using the EventSelect bits and the RdWrMask bits can be used for additional filtering of read and write requests. As of now, a maximum of 12 channels of DDR5 are available on each socket and each channel is controlled by a dedicated UMC. Each UMC, in turn, has its own set of performance monitoring counters. Since the MSR address space for the UMC PERF_CTL and PERF_CTR registers are reused across sockets, uncore groups are created on the basis of socket IDs. Hence, group exclusivity is mandatory while opening events so that events for an UMC can only be opened on CPUs which are on the same socket as the corresponding memory channel. For each socket, the total number of available UMC counters and active memory channels are determined from CPUID leaf 0x80000022 EBX and ECX respectively. Usually, on Zen 4, each UMC has four counters. MSR assignments are determined on the basis of active UMCs. E.g. if UMCs 1, 4 and 9 are active for a given socket, then * UMC 1 gets MSRs 0xc0010800 to 0xc0010807 as PERF_CTLs and PERF_CTRs * UMC 4 gets MSRs 0xc0010808 to 0xc001080f as PERF_CTLs and PERF_CTRs * UMC 9 gets MSRs 0xc0010810 to 0xc0010817 as PERF_CTLs and PERF_CTRs If there are sockets without any online CPUs when the amd_uncore driver is loaded, UMCs for such sockets will not be discoverable since the mechanism relies on executing the CPUID instruction on an online CPU from the socket. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/b25f391205c22733493abec1ed850b71784edc5f.1696425185.git.sandipan.das@amd.com commit 83a43c622123e714b0317a57176b336187f5deb3 Author: Sandipan Das Date: Thu Oct 5 10:53:14 2023 +0530 perf/x86/amd/uncore: Add group exclusivity In some cases, it may be necessary to restrict opening PMU events to a subset of CPUs. E.g. Unified Memory Controller (UMC) PMUs are specific to each active memory channel and the MSR address space for the PERF_CTL and PERF_CTR registers is reused on each socket. Thus, opening events for a specific UMC PMU should be restricted to CPUs belonging to the same socket as that of the UMC. The "cpumask" of the PMU should also reflect this accordingly. Uncore PMUs which require this can use the new group attribute in struct amd_uncore_pmu to set a valid group ID during the scan() phase. Later, during init(), an uncore context for a CPU will be unavailable if the group ID does not match. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/937d6d71010a48ea4e069f4904b3116a5f99ecdf.1696425185.git.sandipan.das@amd.com commit 7ef0343855dc23a979a53b3143540f93f3e5bef8 Author: Sandipan Das Date: Thu Oct 5 10:53:13 2023 +0530 perf/x86/amd/uncore: Use rdmsr if rdpmc is unavailable Not all uncore PMUs may support the use of the RDPMC instruction for reading counters. In such cases, read the count from the corresponding PERF_CTR register using the RDMSR instruction. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/e9d994e32a3fcb39fa59fcf43ab4260d11aba097.1696425185.git.sandipan.das@amd.com commit 07888daa056e809de0b6b234116b575c11f9f99d Author: Sandipan Das Date: Thu Oct 5 10:53:12 2023 +0530 perf/x86/amd/uncore: Move discovery and registration Uncore PMUs have traditionally been registered in the module init path. This is fine for the existing DF and L3 PMUs since the CPUID information does not vary across CPUs but not for the memory controller (UMC) PMUs since information like active memory channels can vary for each socket depending on how the DIMMs have been physically populated. To overcome this, the discovery of PMU information using CPUID is moved to the startup of UNCORE_STARTING. This cannot be done in the startup of UNCORE_PREP since the hotplug callback does not run on the CPU that is being brought online. Previously, the startup of UNCORE_PREP was used for allocating uncore contexts following which, the startup of UNCORE_STARTING was used to find and reuse an existing sibling context, if possible. Any unused contexts were added to a list for reclaimation later during the startup of UNCORE_ONLINE. Since all required CPUID info is now available only after the startup of UNCORE_STARTING has completed, context allocation has been moved to the startup of UNCORE_ONLINE. Before allocating contexts, the first CPU that comes online has to take up the additional responsibility of registering the PMUs. This is a one-time process though. Since sibling discovery now happens prior to deciding whether a new context is required, there is no longer a need to track and free up unused contexts. The teardown of UNCORE_ONLINE and UNCORE_PREP functionally remain the same. Overall, the flow of control described above is achieved using the following handlers for managing uncore PMUs. It is mandatory to define them for each type of uncore PMU. * scan() runs during startup of UNCORE_STARTING and collects PMU info using CPUID. * init() runs during startup of UNCORE_ONLINE, registers PMUs and sets up uncore contexts. * move() runs during teardown of UNCORE_ONLINE and migrates uncore contexts to a shared sibling, if possible. * free() runs during teardown of UNCORE_PREP and frees up uncore contexts. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/e6c447e48872fcab8452e0dd81b1c9cb09f39eb4.1696425185.git.sandipan.das@amd.com commit d6389d3ccc136a4229a8d497899c64f80fd3c5b3 Author: Sandipan Das Date: Thu Oct 5 10:53:11 2023 +0530 perf/x86/amd/uncore: Refactor uncore management Since struct amd_uncore is used to manage per-cpu contexts, rename it to amd_uncore_ctx in order to better reflect its purpose. Add a new struct amd_uncore_pmu to encapsulate all attributes which are shared by per-cpu contexts for a corresponding PMU. These include the number of counters, active mask, MSR and RDPMC base addresses, etc. Since the struct pmu is now embedded, the corresponding amd_uncore_pmu for a given event can be found by simply using container_of(). Finally, move all PMU-specific code to separate functions. While the original event management functions continue to provide the base functionality, all PMU-specific quirks and customizations are applied in separate functions. The motivation is to simplify the management of uncore PMUs. Signed-off-by: Sandipan Das Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/24b38c49a5dae65d8c96e5d75a2b96ae97aaa651.1696425185.git.sandipan.das@amd.com commit 1765bb61bb18a7b81f68806de6e8b8f5000f65bf Author: Tero Kristo Date: Wed Sep 13 15:59:56 2023 +0300 perf/core: Allow reading package events from perf_event_read_local Per-package perf events are typically registered with a single CPU only, however they can be read across all the CPUs within the package. Currently perf_event_read maps the event CPU according to the topology information to avoid an unnecessary SMP call, however perf_event_read_local deals with hard values and rejects a read with a failure if the CPU is not the one exactly registered. Allow similar mapping within the perf_event_read_local if the perf event in question can support this. This allows users like BPF code to read the package perf events properly across different CPUs within a package. Signed-off-by: Tero Kristo Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230913125956.3652667-1-tero.kristo@linux.intel.com commit 05276d4831fe023b6674a72bd6b8c5b39796e690 Author: Tero Kristo Date: Tue Sep 12 15:44:31 2023 +0300 perf/x86/cstate: Allow reading the package statistics from local CPU The MSR registers for reading the package residency counters are available on every CPU of the package. To avoid doing unnecessary SMP calls to read the values for these from the various CPUs inside a package, allow reading them from any CPU of the package. Suggested-by: Kan Liang Signed-off-by: Tero Kristo Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230912124432.3616761-2-tero.kristo@linux.intel.com commit 3b5d22bdf33c4e44016fdcfc8904a0b0bf218e75 Author: Linus Walleij Date: Fri Oct 6 15:46:31 2023 +0200 ASoC: mt8192-afe-gpio: Drop unused include This driver includes the legacy GPIO header but is not using any symbols from it. AFE has a custom GPIO implementation that is not using the kernel GPIO framework. Signed-off-by: Linus Walleij Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231006-descriptors-asoc-mediatek-v1-8-07fe79f337f5@linaro.org Signed-off-by: Mark Brown commit 73e1f8a05bd8289ab5154c703a0592729267e979 Author: Linus Walleij Date: Fri Oct 6 15:46:30 2023 +0200 ASoC: mt8186-mt6366-rt1019-rt5682s: Drop unused include This driver includes the legacy GPIO header but is not using any symbols from it. AFE has a custom GPIO implementation that is not using the kernel GPIO framework, so it need not include it either. Signed-off-by: Linus Walleij Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231006-descriptors-asoc-mediatek-v1-7-07fe79f337f5@linaro.org Signed-off-by: Mark Brown commit 6dffd1f38ad76660e7fff8e269889284e892603d Author: Linus Walleij Date: Fri Oct 6 15:46:29 2023 +0200 ASoC: mt8173-rt5650: Drop unused includes This driver includes the legacy GPIO header and but does not use any symbols from either of them so drop the includes. Signed-off-by: Linus Walleij Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231006-descriptors-asoc-mediatek-v1-6-07fe79f337f5@linaro.org Signed-off-by: Mark Brown commit cb1c18e8a7337c7f3ee461b613a52a45c3f723d5 Author: Linus Walleij Date: Fri Oct 6 15:46:28 2023 +0200 ASoC: mt8173-rt5650-rt5676: Drop unused includes This driver includes the legacy GPIO header and but does not use any symbols from either of them so drop the includes. Signed-off-by: Linus Walleij Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231006-descriptors-asoc-mediatek-v1-5-07fe79f337f5@linaro.org Signed-off-by: Mark Brown commit 94a7f618211652235f3e4b88aca477391078dba6 Author: Linus Walleij Date: Fri Oct 6 15:46:27 2023 +0200 ASoC: mt8173-rt5650-rt5514: Drop unused includes This driver includes the legacy GPIO header and but does not use any symbols from either of them so drop the includes. Signed-off-by: Linus Walleij Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231006-descriptors-asoc-mediatek-v1-4-07fe79f337f5@linaro.org Signed-off-by: Mark Brown commit b1306c3b6140f0c299f727edc9bb90ec79700614 Author: Linus Walleij Date: Fri Oct 6 15:46:26 2023 +0200 ASoC: mt8173-max98090: Drop unused include This driver includes the legacy GPIO header but is not using any symbols from it. Drop the include. Signed-off-by: Linus Walleij Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231006-descriptors-asoc-mediatek-v1-3-07fe79f337f5@linaro.org Signed-off-by: Mark Brown commit 654a23724072f37c0d07b31395e1d9f45f5563ab Author: Linus Walleij Date: Fri Oct 6 15:46:25 2023 +0200 ASoC: mediatek: mt2701-cs42448: Convert to GPIO descriptors The driver is pretty straight-forward to convert to use GPIO descriptors, however a separate patch is needed to accept the DT GPIO resources ending with "-gpio1" and "-gpio2" instead of the standard "-gpio" or "-gpios" name convention. Signed-off-by: Linus Walleij Reviewed-by: Bartosz Golaszewski Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231006-descriptors-asoc-mediatek-v1-2-07fe79f337f5@linaro.org Signed-off-by: Mark Brown commit 9e189e80dcb68528dea9e061d9704993f98cb84f Author: Linus Walleij Date: Fri Oct 6 15:46:24 2023 +0200 gpiolib: of: Add quirk for mt2701-cs42448 ASoC sound These gpio names are due to old DT bindings not following the "-gpio"/"-gpios" conventions. Handle it using a quirk so the driver can just look up the GPIOs. Signed-off-by: Linus Walleij Acked-by: Bartosz Golaszewski Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20231006-descriptors-asoc-mediatek-v1-1-07fe79f337f5@linaro.org Signed-off-by: Mark Brown commit 6350a5627619042c3bb562e431d6829097e8424f Author: Fabio Estevam Date: Mon Sep 25 10:33:31 2023 -0300 ARM: dts: imx27-phytec: Use eeprom as the node name Node names should be generic, so use 'eeprom' to fix the following schema warnings: at24@52: $nodename:0: 'at24@52' does not match '^eeprom@[0-9a-f]{1,2}$' from schema $id: http://devicetree.org/schemas/eeprom/at24.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 2902c6f2d3d55aff080f0a0a3ea8b6df638f4602 Author: Fabio Estevam Date: Mon Sep 25 10:22:20 2023 -0300 ARM: dts: imx51: Remove invalid sahara compatible Per fsl-imx-sahara.yaml, there should not be a 'fsl,imx51-sahara' compatible. Remove it to fix the following schema warning: imx51-apf51.dtb: crypto@83ff8000: compatible: ['fsl,imx53-sahara', 'fsl,imx51-sahara'] is too long from schema $id: http://devicetree.org/schemas/crypto/fsl-imx-sahara.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 9eb4b32161d439df1477162182241352d646c969 Author: Yannic Moog Date: Mon Sep 25 09:25:18 2023 +0200 dt-bindings: arm: fsl: add phyGATE-Tauri-L board Add dt compatible for the phyGATE-Tauri-L board. It uses the phyCORE-i.MX8MM SoM Acked-by: Conor Dooley Signed-off-by: Yannic Moog Signed-off-by: Shawn Guo commit 8abba08944663add37111dd6bc4f2916fd6d9085 Author: Nikita Kravets Date: Fri Oct 6 20:53:57 2023 +0300 platform/x86: msi-ec: Add more EC configs This patch adds configurations for new EC firmware from the downstream version of the driver. Cc: Aakash Singh Cc: Jose Angel Pastrana Signed-off-by: Nikita Kravets Link: https://lore.kernel.org/r/20231006175352.1753017-9-teackot@gmail.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 8ceea12d183cf29f28072dede218a04eda2a789c Author: Guenter Roeck Date: Fri Sep 15 08:22:38 2023 -0700 alarmtimer: Use maximum alarm time for suspend Some userspace applications use timerfd_create() to request wakeups after a long period of time. For example, a backup application may request a wakeup once per week. This is perfectly fine as long as the system does not try to suspend. However, if the system tries to suspend and the system's RTC does not support the required alarm timeout, the suspend operation will fail with an error such as rtc_cmos 00:01: Alarms can be up to one day in the future PM: dpm_run_callback(): platform_pm_suspend+0x0/0x4a returns -22 alarmtimer alarmtimer.4.auto: platform_pm_suspend+0x0/0x4a returned -22 after 117 usecs PM: Device alarmtimer.4.auto failed to suspend: error -22 This results in a refusal to suspend the system, causing substantial battery drain on affected systems. To fix the problem, use the maximum alarm time offset as reported by RTC drivers to set the maximum alarm time. While this may result in early wakeups from suspend, it is still much better than not suspending at all. Standardize system behavior if the requested alarm timeout is larger than the alarm timeout supported by the rtc chip. Currently, in this situation, the RTC driver will do one of the following: - It may return an error. - It may limit the alarm timeout to the maximum supported by the rtc chip. - It may mask the timeout by the maximum alarm timeout supported by the RTC chip (i.e. a requested timeout of 1 day + 1 minute may result in a 1 minute timeout). With this in place, if the RTC driver reports the maximum alarm timeout supported by the RTC chip, the system will always limit the alarm timeout to the maximum supported by the RTC chip. Signed-off-by: Guenter Roeck Signed-off-by: Thomas Gleixner Acked-by: John Stultz Link: https://lore.kernel.org/r/20230915152238.1144706-3-linux@roeck-us.net commit a0fddaa0b5a587cc8d185f8802fe7e48493c43ed Author: Guenter Roeck Date: Fri Sep 15 08:22:37 2023 -0700 rtc: Add API function to return alarm time bound by hardware limit Add rtc_bound_alarmtime() to return the requested alarm timeout bound by the maxmum alarm timeout that is supported by a given RTC. Signed-off-by: Guenter Roeck Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230915152238.1144706-2-linux@roeck-us.net commit ffc843fc9c7a407474c5ebcd5dce63bcbfc0f7c0 Merge: b21f18ef964b2 7bf770f74e850 Author: Rafael J. Wysocki Date: Mon Oct 9 15:02:59 2023 +0200 Merge back earlier system-wide PM changes for v6.7. commit e03dc9fa0663bc303383170e961561462ff00c93 Author: Yang Yang Date: Mon Oct 9 20:24:28 2023 +0800 sched/psi: Change update_triggers() to a 'void' function Update_triggers() always returns now + group->rtpoll_min_period, and the return value is only used by psi_rtpoll_work(), so change update_triggers() to a void function, let group->rtpoll_next_update = now + group->rtpoll_min_period directly. This will avoid unnecessary function return value passing & simplifies the function. [ mingo: Updated changelog ] Suggested-by: Suren Baghdasaryan Signed-off-by: Yang Yang Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/202310092024289721617@zte.com.cn commit 74975b4f2836e3cc10eeb6c38a6da54311e1de5b Author: Bartosz Golaszewski Date: Tue Sep 26 16:59:43 2023 +0200 gpio: acpi: remove acpi_get_and_request_gpiod() With no more users, we can remove acpi_get_and_request_gpiod(). Signed-off-by: Bartosz Golaszewski Reviewed-by: From: Andy Shevchenko Reviewed-by: Mika Westerberg commit 4819033c1806dac7a2c47a5a4728f6e41d5e3f67 Merge: 03a975cbcfcd0 5ccf9873ab2bc Author: Bartosz Golaszewski Date: Mon Oct 9 14:43:34 2023 +0200 Merge tag 'platform-drivers-x86-ib-int3472-v6.7' of https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 into gpio/for-next Immutable branch between pdx86 int3472 branch and GPIO due for the v6.7 merge window. platform-drivers-x86-ib-int3472-v6.7: v6.6-rc1 + platform-drivers-x86-int3472 for merging into the GPIO subsystem for v6.7. commit 8a6b446d8a13673bfcf44fbd09d737ae4ccf0bfd Author: Vijaya Krishna Nivarthi Date: Fri Oct 6 23:12:50 2023 +0530 spi: spi-geni-qcom: Rename the label unmap_if_dma The code at unmap_if_dma label doesn't contain unmapping dma anymore but has only fsm reset. Rename it to reset_if_dma accordingly. No functional change. Signed-off-by: Vijaya Krishna Nivarthi Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/1696614170-18969-1-git-send-email-quic_vnivarth@quicinc.com Signed-off-by: Mark Brown commit a4f7ef6db74197898c48236ad01f8e0eccc1e52b Author: Fabrizio Castro Date: Wed Sep 27 17:25:08 2023 +0100 spi: rzv2m-csi: Add target mode support The CSI IP found inside the Renesas RZ/V2M SoC supports both SPI host and SPI target roles. When working in target mode, the CSI IP has the option of using its Slave Selection (SS) pin to enable TX and RX operations. Since the SPI target cannot control the clock, when working as target it's best not to stop operations during a transfer, as by doing so the IP will not send or receive data, regardless of clock and active level on pin SS. A side effect from not stopping operations is that the RX FIFO needs to be flushed, word by word, when RX data needs to be discarded. Finally, when in target mode timings are tighter, as missing a deadline translates to errors being thrown, resulting in aborting the transfer. In order to speed things up, we can avoid waiting for the TX FIFO to be empty, we can just wait for the RX FIFO to contain at least the number of words that we expect. Add target support to the currently existing CSI driver. Signed-off-by: Fabrizio Castro Link: https://lore.kernel.org/r/20230927162508.328736-3-fabrizio.castro.jz@renesas.com Signed-off-by: Mark Brown commit 4056d88866e5941ebd15fb2523119f0ddc5186da Author: Fabrizio Castro Date: Wed Sep 27 17:25:07 2023 +0100 spi: renesas,rzv2m-csi: Add CSI (SPI) target related property The CSI IP found inside the Renesas RZ/V2M SoC can also work in SPI target mode. When working in target mode, the IP will make use of the SS (Slave Selection) pin, with "low" as default active level. The active level of SS can be changed to "high" upon setting property "spi-cs-high" to true. By default, the SS will be used in target mode, unless property "renesas,csi-no-ss" is set to true, in which case data will be shifted in and out purely based on clock activity, and the logic level of the SS pin will be completely ignored. Signed-off-by: Fabrizio Castro Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230927162508.328736-2-fabrizio.castro.jz@renesas.com Signed-off-by: Mark Brown commit 907f2a48359b836ff22e55eeb4a440fb9af86c10 Author: Kees Cook Date: Fri Sep 22 10:53:31 2023 -0700 regulator: da9062: Annotate struct da9062_regulators with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct da9062_regulators. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Support Opensource Cc: Liam Girdwood Cc: Mark Brown Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175330.work.066-kees@kernel.org Signed-off-by: Mark Brown commit 72151ad0cba8a07df90130ff62c979520d71f23b Author: Krzysztof Kozlowski Date: Tue Oct 3 17:54:22 2023 +0200 ASoC: codecs: wsa-macro: fix uninitialized stack variables with name prefix Driver compares widget name in wsa_macro_spk_boost_event() widget event callback, however it does not handle component's name prefix. This leads to using uninitialized stack variables as registers and register values. Handle gracefully such case. Fixes: 2c4066e5d428 ("ASoC: codecs: lpass-wsa-macro: add dapm widgets and route") Cc: stable@vger.kernel.org Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231003155422.801160-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 528a4a0bb010489abc3bb298c85c8ffb7ebe7735 Author: Krzysztof Kozlowski Date: Thu Oct 5 09:52:50 2023 +0200 ASoC: qcom: reduce number of binding headers includes Move the includes of binding headers from Qualcomm SoC sound drivers headers to unit files actually using these bindings. This reduces the amount of work for C preprocessor and makes usage of bindings easier to follow. No impact expected on the final binaries. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231005075250.88159-2-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit 0f729a285b4ef7d0cd2497c22233c42037486a7e Author: Krzysztof Kozlowski Date: Thu Oct 5 09:52:49 2023 +0200 ASoC: qcom: explicitly include binding headers when used Few units use qcom,lpass.h binding headers but they rely on them being included through a different header. Make the usage explicit which allows easier to find the users of a header. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231005075250.88159-1-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown commit d65d4a2c3867a04ee4ae9c99747a6398b58e269b Author: Pierre-Louis Bossart Date: Fri Oct 6 11:40:41 2023 +0300 ASoC: SOF: sof-client: fix build when only IPC4 is selected When IPC3 is not selected, sof-client.c still makes a hard-coded reference to an IPC3-specific function: ERROR: modpost: "sof_ipc3_do_rx_work" [sound/soc/sof/snd-sof.ko] undefined! Fix by making the code conditional. Closes: https://github.com/thesofproject/linux/issues/4581 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Curtis Malainey Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20231006084041.18100-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 329b017ccdf80cdcc3550f6caecbf2bc80a67432 Author: Linus Walleij Date: Fri Sep 29 00:12:57 2023 +0200 ASoC: rockchip: Drop includes from Rockchip RT5645 The Rockchip RT5645 ASoC driver includes two legacy GPIO headers but doesn't use symbols from any of them. Delete the includes. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230929-descriptors-asoc-rockchip-v2-4-2d2c0e043aab@linaro.org Signed-off-by: Mark Brown commit 7214141067922836b48157e8266335096a0ea4ea Author: Linus Walleij Date: Fri Sep 29 00:12:56 2023 +0200 ASoC: rockchip: Drop includes from Rockchip MAX98090 The Rockchip MAX98090 ASoC driver includes two legacy GPIO headers but doesn't use symbols from any of them. Delete the includes. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230929-descriptors-asoc-rockchip-v2-3-2d2c0e043aab@linaro.org Signed-off-by: Mark Brown commit 3116dc2e16542d56bd173e90ce1893bed697a830 Author: Linus Walleij Date: Fri Sep 29 00:12:55 2023 +0200 ASoC: rockchip: Drop includes from RK3399 The RK3399 ASoC driver includes two legacy GPIO headers but doesn't use symbols from any of them. Delete the includes. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230929-descriptors-asoc-rockchip-v2-2-2d2c0e043aab@linaro.org Signed-off-by: Mark Brown commit 15b26d8165b39a07f038fb4d2b67a04c50463eb9 Author: Linus Walleij Date: Fri Sep 29 00:12:54 2023 +0200 ASoC: rockchip: Convert RK3288 HDMI to GPIO descriptors This converts the Rockchip RK3288 HDMI driver to use GPIO descriptors: - Look up the HP EN GPIO as an optional descriptor and handle it directly, the gpiod API is NULL-tolerant so no special guards are needed. - Let the Jack detection core obtain and handle the HP detection GPIO, just pass the right name and gpiod_dev and it will do the job. Make sure to check that the GPIO property is there first, so it becomes optional. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230929-descriptors-asoc-rockchip-v2-1-2d2c0e043aab@linaro.org Signed-off-by: Mark Brown commit 9958d85968ed2df4b704105fd2a9c3669eb9cd97 Author: Rob Herring Date: Fri Oct 6 15:09:14 2023 -0500 ASoC: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-5-13a4f0f7fee6@kernel.org Signed-off-by: Mark Brown commit ec5236c2e6ec1ce62237a2e9345dd2ffc4fc6d56 Author: Rob Herring Date: Fri Oct 6 15:09:13 2023 -0500 ASoC: qcom/lpass: Constify struct lpass_variant 'struct lpass_variant' is used for driver match data which is supposed to be constant. It's not modified anywhere, so it's just a matter of adding 'const' everywhere. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-4-13a4f0f7fee6@kernel.org Signed-off-by: Mark Brown commit fe26425518862020449cb2c9709e62cc76a56de2 Author: Rob Herring Date: Fri Oct 6 15:09:12 2023 -0500 ASoC: da7218: Use i2c_get_match_data() Use preferred i2c_get_match_data() instead of of_match_device() and i2c_match_id() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Avoid using 0 for enum da7218_dev_id so that no match data can be distinguished. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-3-13a4f0f7fee6@kernel.org Signed-off-by: Mark Brown commit 56c075b2d31c626370481a62d334a0575f751522 Author: Rob Herring Date: Fri Oct 6 15:09:11 2023 -0500 ASoC: Drop unnecessary of_match_device() calls If probe is reached, we've already matched the device and in the case of DT matching, the struct device_node pointer will be set. Therefore, there is no need to call of_match_device() in probe. Acked-by: Charles Keepax Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-2-13a4f0f7fee6@kernel.org Signed-off-by: Mark Brown commit 340d79a14d6ab5066ba40651764db20bd151aea7 Author: Rob Herring Date: Fri Oct 6 15:09:10 2023 -0500 ASoC: Explicitly include correct DT includes The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it was merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Acked-by: Jernej Skrabec Reviewed-by: AngeloGioacchino Del Regno Acked-by: Charles Keepax Reviewed-by: Claudiu Beznea # for at91 Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-1-13a4f0f7fee6@kernel.org Signed-off-by: Mark Brown commit 1255f23c219a74f2577c9ca5521abeb36db35d3b Author: Konrad Dybcio Date: Fri Aug 25 17:38:31 2023 +0200 interconnect: qcom: msm8996: Set AB/IB coefficients Some buses and nodes need additional manual adjustments atop the usual calculations. Fill in the missing coefficients. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230726-topic-icc_coeff-v4-9-c04b60caa467@linaro.org Signed-off-by: Georgi Djakov commit a4a9251760185af9ca7ff1592a05a0eabfe0cd00 Author: Konrad Dybcio Date: Fri Aug 25 17:38:30 2023 +0200 interconnect: qcom: sdm660: Set AB/IB coefficients Some buses and nodes need additional manual adjustments atop the usual calculations. Fill in the missing coefficients. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230726-topic-icc_coeff-v4-8-c04b60caa467@linaro.org Signed-off-by: Georgi Djakov commit 550064a85ba564cfb508a995f45e39a6ad0e26ed Author: Konrad Dybcio Date: Fri Aug 25 17:38:29 2023 +0200 interconnect: qcom: qcm2290: Update EBI channel configuration QCM2290 can support two memory configurations: single-channel, 32-bit wide LPDDR3 @ up to 933MHz (bus clock) or dual-channel, 16-bit wide LPDDR4X @ up to 1804 MHz. The interconnect driver in its current form seems to gravitate towards the first one, however there are no LPDDR3- equipped boards upstream and we still don't have a great way to discern the DDR generations on the kernel side. To make DDR scaling possible on the only currently-supported 2290 board, stick with the LPDDR4X config by default. The side effect on any potential LPDDR3 board would be that the requested bus clock rate is too high (but still capped to the firmware-configured FMAX). Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230726-topic-icc_coeff-v4-7-c04b60caa467@linaro.org Signed-off-by: Georgi Djakov commit 8657ed471196f4dc8e7917453a39363e0014840c Author: Konrad Dybcio Date: Fri Aug 25 17:38:28 2023 +0200 interconnect: qcom: qcm2290: Set AB coefficients Some buses need additional manual adjustments atop the usual calculations. Fill in the missing coefficients. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230726-topic-icc_coeff-v4-6-c04b60caa467@linaro.org Signed-off-by: Georgi Djakov commit fa35757ae0a5a88bd1b7df8578ee9dac9d147c64 Author: Konrad Dybcio Date: Fri Aug 25 17:38:27 2023 +0200 interconnect: qcom: qcm2290: Hook up MAS_APPS_PROC's bus clock This single node has its own clock which seems to be responsible for transactions between CPUSS (CPU + some stuff) and the GNOC. See [1] for reference. Define it and hook it up. [1] https://android.googlesource.com/kernel/msm-extra/devicetree/+/02f8c342b23c20a5cf967df649814be37a08227c%5E%21/#F0 Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230726-topic-icc_coeff-v4-5-c04b60caa467@linaro.org Signed-off-by: Georgi Djakov commit ba3f826639782587b70a684dae79d39f6d3c433e Author: Konrad Dybcio Date: Fri Aug 25 17:38:26 2023 +0200 interconnect: qcom: icc-rpm: Check for node-specific rate coefficients Some nodes may have different coefficients than the general values for bus they're attached to. Check for that and use them if present. See [1], [2] for reference. [1] https://github.com/sonyxperiadev/kernel/commit/7456d9779af9ad6bb9c7ee6f33d5c5a8d3648e24 [2] https://github.com/artem/android_kernel_sony_msm8996/commit/bf7a8985dcaf0eab5bc2562d2d6775e7e29c0f30 Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230726-topic-icc_coeff-v4-4-c04b60caa467@linaro.org Signed-off-by: Georgi Djakov commit 919791d82d3b878094e9edc39b0d9a4eafcc0860 Author: Konrad Dybcio Date: Fri Aug 25 17:38:25 2023 +0200 interconnect: qcom: icc-rpm: Let nodes drive their own bus clock If this hardware couldn't get messier, some nodes are supposed to drive their own bus clock.. Presumably to connect to some intermediate interface between the node itself and the bus it's (supposed to be) connected to. Expand the node struct with the necessary data and hook up the allocations & calculations. Note that the node-specific AB/IB coefficients contribute (by design) to both the node-level and the bus-level aggregation. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230726-topic-icc_coeff-v4-3-c04b60caa467@linaro.org Signed-off-by: Georgi Djakov commit db8fc1002c53bc17a3ca6fad2c524de42b77c146 Author: Konrad Dybcio Date: Fri Aug 25 17:38:24 2023 +0200 interconnect: qcom: icc-rpm: Separate out clock rate calulcations In preparation for also setting per-node clock rates, separate out the logic that computes it. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230726-topic-icc_coeff-v4-2-c04b60caa467@linaro.org Signed-off-by: Georgi Djakov commit dd014803f260b337daaabcde259daf70d5b26b5e Author: Konrad Dybcio Date: Fri Aug 25 17:38:23 2023 +0200 interconnect: qcom: icc-rpm: Add AB/IB calculations coefficients Presumably due to the hardware being so complex, some nodes (or busses) have different (usually higher) requirements for bandwidth than what the usual calculations would suggest. Looking at the available downstream files, it seems like AB values are adjusted per-bus and IB values are adjusted per-node. With that in mind, introduce percentage-based coefficient struct members and use them in the calculations. One thing to note is that the IB coefficient is inverse (100/ib_percent) which feels a bit backwards, but it's necessary for precision.. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230726-topic-icc_coeff-v4-1-c04b60caa467@linaro.org Signed-off-by: Georgi Djakov commit 1aeb02d3f2c5a7a9f132ea748877012a48036d90 Author: Ben Wolsieffer Date: Mon Oct 2 13:13:39 2023 -0400 ARM: dts: stm32: add SDIO pinctrl sleep support on stm32f7 boards Use the new analog mode SDIO pin definitions on the STM32F7 boards. Signed-off-by: Ben Wolsieffer Signed-off-by: Alexandre Torgue commit 8fa7f119cc2a0b1f38f2ebed225969ffa217581e Author: Ben Wolsieffer Date: Mon Oct 2 13:13:38 2023 -0400 ARM: dts: stm32: add stm32f7 SDIO sleep pins Add SDIO sleep pin definitions that place the pins in analog mode to save power. Signed-off-by: Ben Wolsieffer Signed-off-by: Alexandre Torgue commit 3e78f7712115e352a8af5db8d91f8febddf41595 Author: Kees Cook Date: Fri Oct 6 13:17:45 2023 -0700 drm/i915/guc: Annotate struct ct_incoming_msg with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ct_incoming_msg. Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: David Airlie Cc: Daniel Vetter Cc: "Gustavo A. R. Silva" Cc: John Harrison Cc: Matthew Brost Cc: Michal Wajdeczko Cc: Matt Roper Cc: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: linux-hardening@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231006201744.work.135-kees@kernel.org commit efd00dc04f0310622e54534b71c522f2ca7db07e Author: Gatien Chevallier Date: Thu Sep 21 10:03:01 2023 +0200 ARM: dts: stm32: add RNG node for STM32MP13x platforms The RNG on STM32MP13 offers upgrades like customization of its configuration and the conditional reset. The hardware RNG should be managed in the secure world for but it is supported on Linux. Therefore, is it not default enabled. Signed-off-by: Gatien Chevallier Signed-off-by: Alexandre Torgue commit ff54dc31fbee363f3bbae85b99b1390dc02ce062 Author: Nikita Kravets Date: Fri Oct 6 20:53:55 2023 +0300 platform/x86: msi-ec: rename fn_super_swap This patch renames fn_super_swap to fn_win_swap for consistency with the downstream version of the driver. Renaming the field to fn_super_swap in the downstream driver would require modifying several branches that are yet to be merged into the main branch, so I decided to do it here instead. Cc: Aakash Singh Cc: Jose Angel Pastrana Signed-off-by: Nikita Kravets Link: https://lore.kernel.org/r/20231006175352.1753017-7-teackot@gmail.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 5b77261c5510f1e6f4d359e97dd3e39ee7259c3d Author: Pierre Gondois Date: Mon Oct 9 11:30:36 2023 +0530 sched/topology: Remove the EM_MAX_COMPLEXITY limit The Energy Aware Scheduler (EAS) estimates the energy consumption of placing a task on different CPUs. The goal is to minimize this energy consumption. Estimating the energy of different task placements is increasingly complex with the size of the platform. To avoid having a slow wake-up path, EAS is only enabled if this complexity is low enough. The current complexity limit was set in: b68a4c0dba3b1 ("sched/topology: Disable EAS on inappropriate platforms") ... based on the first implementation of EAS, which was re-computing the power of the whole platform for each task placement scenario, see: 390031e4c309 ("sched/fair: Introduce an energy estimation helper function") ... but the complexity of EAS was reduced in: eb92692b2544d ("sched/fair: Speed-up energy-aware wake-ups") ... and find_energy_efficient_cpu() (feec) algorithm was updated in: 3e8c6c9aac42 ("sched/fair: Remove task_util from effective utilization in feec()") find_energy_efficient_cpu() (feec) is now doing: feec() \_ for_each_pd(pd) [0] // get max_spare_cap_cpu and compute_prev_delta \_ for_each_cpu(pd) [1] \_ eenv_pd_busy_time(pd) [2] \_ for_each_cpu(pd) // compute_energy(pd) without the task \_ eenv_pd_max_util(pd, -1) [3.0] \_ for_each_cpu(pd) \_ em_cpu_energy(pd, -1) \_ for_each_ps(pd) // compute_energy(pd) with the task on prev_cpu \_ eenv_pd_max_util(pd, prev_cpu) [3.1] \_ for_each_cpu(pd) \_ em_cpu_energy(pd, prev_cpu) \_ for_each_ps(pd) // compute_energy(pd) with the task on max_spare_cap_cpu \_ eenv_pd_max_util(pd, max_spare_cap_cpu) [3.2] \_ for_each_cpu(pd) \_ em_cpu_energy(pd, max_spare_cap_cpu) \_ for_each_ps(pd) [3.1] happens only once since prev_cpu is unique. With the same definitions for nr_pd, nr_cpus and nr_ps, the complexity is of: nr_pd * (2 * [nr_cpus in pd] + 2 * ([nr_cpus in pd] + [nr_ps in pd])) + ([nr_cpus in pd] + [nr_ps in pd]) [0] * ( [1] + [2] + [3.0] + [3.2] ) + [3.1] = nr_pd * (4 * [nr_cpus in pd] + 2 * [nr_ps in pd]) + [nr_cpus in prev pd] + nr_ps The complexity limit was set to 2048 in: b68a4c0dba3b1 ("sched/topology: Disable EAS on inappropriate platforms") ... to make "EAS usable up to 16 CPUs with per-CPU DVFS and less than 8 performance states each". For the same platform, the complexity would actually be of: 16 * (4 + 2 * 7) + 1 + 7 = 296 Since the EAS complexity was greatly reduced since the limit was introduced, bigger platforms can handle EAS. For instance, a platform with 112 CPUs with 7 performance states each would not reach it: 112 * (4 + 2 * 7) + 1 + 7 = 2024 To reflect this improvement in the underlying EAS code, remove the EAS complexity check. Note that a limit on the number of CPUs still holds against EM_MAX_NUM_CPUS to avoid overflows during the energy estimation. [ mingo: Updates to the changelog. ] Signed-off-by: Pierre Gondois Signed-off-by: Ingo Molnar Reviewed-by: Lukasz Luba Reviewed-by: Dietmar Eggemann Link: https://lore.kernel.org/r/20231009060037.170765-2-sshegde@linux.vnet.ibm.com commit 7bc263840bc3377186cb06b003ac287bb2f18ce2 Author: Vincent Guittot Date: Mon Oct 9 12:36:16 2023 +0200 sched/topology: Consolidate and clean up access to a CPU's max compute capacity Remove the rq::cpu_capacity_orig field and use arch_scale_cpu_capacity() instead. The scheduler uses 3 methods to get access to a CPU's max compute capacity: - arch_scale_cpu_capacity(cpu) which is the default way to get a CPU's capacity. - cpu_capacity_orig field which is periodically updated with arch_scale_cpu_capacity(). - capacity_orig_of(cpu) which encapsulates rq->cpu_capacity_orig. There is no real need to save the value returned by arch_scale_cpu_capacity() in struct rq. arch_scale_cpu_capacity() returns: - either a per_cpu variable. - or a const value for systems which have only one capacity. Remove rq::cpu_capacity_orig and use arch_scale_cpu_capacity() everywhere. No functional changes. Some performance tests on Arm64: - small SMP device (hikey): no noticeable changes - HMP device (RB5): hackbench shows minor improvement (1-2%) - large smp (thx2): hackbench and tbench shows minor improvement (1%) Signed-off-by: Vincent Guittot Signed-off-by: Ingo Molnar Reviewed-by: Dietmar Eggemann Link: https://lore.kernel.org/r/20231009103621.374412-2-vincent.guittot@linaro.org commit 089768dfeb3ab294f9ab6a1f2462001f0f879fbb Author: Yajun Deng Date: Sun Oct 8 10:15:38 2023 +0800 sched/rt: Change the type of 'sysctl_sched_rt_period' from 'unsigned int' to 'int' Doing this matches the natural type of 'int' based calculus in sched_rt_handler(), and also enables the adding in of a correct upper bounds check on the sysctl interface. [ mingo: Rewrote the changelog. ] Signed-off-by: Yajun Deng Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231008021538.3063250-1-yajun.deng@linux.dev commit 8aec97decfd0f444a69a765b2f00d64b42752824 Author: Mateusz Majewski Date: Fri Oct 6 14:55:57 2023 +0200 pinctrl: samsung: do not offset pinctrl numberspaces Past versions of this driver have manually calculated base values for both the pinctrl numberspace and the global GPIO numberspace, giving both the same values. This was necessary for the global GPIO numberspace, since its values need to be unique system-wide. However, it was not necessary for the pinctrl numberspace, since its values only need to be unique for a single instance of the pinctrl device. It was just convenient to use the same values for both spaces. Right now those calculations are only used for the pinctrl numberspace, since GPIO numberspace bases are selected by the GPIO subsystem. Therefore, those calculations are unnecessary. Signed-off-by: Mateusz Majewski Reviewed-by: Sam Protsenko Tested-by: Sam Protsenko Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20231006125557.212681-5-m.majewski2@samsung.com Signed-off-by: Krzysztof Kozlowski commit deb79167e1dadc0ac0a9e3aa67130e60c5d011ef Author: Mateusz Majewski Date: Fri Oct 6 14:55:56 2023 +0200 pinctrl: samsung: choose GPIO numberspace base dynamically Selecting it statically is deprecated and results in a warning while booting the system: gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation. Signed-off-by: Mateusz Majewski Reviewed-by: Sam Protsenko Tested-by: Sam Protsenko Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20231006125557.212681-4-m.majewski2@samsung.com Signed-off-by: Krzysztof Kozlowski commit bf128c1f0fe1fd4801fb84660c324095990c533a Author: Mateusz Majewski Date: Fri Oct 6 14:55:55 2023 +0200 pinctrl: samsung: use add_pin_ranges method to add pinctrl ranges This is preferable since we can read the base in the global GPIO numberspace from the chip instead of needing to select it ourselves. Past versions could not do this, since they needed to add all the ranges before enabling the pinctrl subsystem, which was done before registering the GPIO chip. However, right now we enable the pinctrl subsystem after registering the chip and so this became possible. Signed-off-by: Mateusz Majewski Reviewed-by: Sam Protsenko Tested-by: Sam Protsenko Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20231006125557.212681-3-m.majewski2@samsung.com Signed-off-by: Krzysztof Kozlowski commit 2aca5c591ef4ecc4bcb9be3c9a9360d3d5238866 Author: Mateusz Majewski Date: Fri Oct 6 14:55:54 2023 +0200 pinctrl: samsung: defer pinctrl_enable dev_pinctrl_register function immediately enables the pinctrl subsystem, which is unpreferable in general, since drivers might be unable to handle calls immediately. Hence devm_pinctrl_register_and_init, which does not call pinctrl_enable, is preferred. In case of our driver using the old function does not seem to be problematic for now, but will become an issue when we postpone parts of pinctrl initialization in a future commit, and it is a good idea to move off a deprecated-ish function anyway. Signed-off-by: Mateusz Majewski Reviewed-by: Sam Protsenko Tested-by: Sam Protsenko Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20231006125557.212681-2-m.majewski2@samsung.com Signed-off-by: Krzysztof Kozlowski commit 38cd5b6a875adc877681faf8e3ad47fdbd6eceb5 Author: Lucy Mielke Date: Mon Oct 9 08:54:54 2023 +0200 perf/x86/intel/pt: Fix kernel-doc comments Some parameters or return codes were either wrong or missing, update them. Signed-off-by: Lucy Mielke Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/ZSOjQW3e2nJR4bAo@fedora.fritz.box commit f4bb5705114530cd775a5a649b666755b3efe7aa Author: Ingo Molnar Date: Fri Oct 6 12:25:18 2023 +0200 sched/nohz: Remove unnecessarily complex error handling pattern from find_new_ilb() find_new_ilb() returns nr_cpu_ids on failure - which is the usual cpumask bitops return pattern, but is weird & unnecessary in this context: not only is it a global variable, it it is a +1 out of bounds CPU index and also has different signedness ... Its only user, kick_ilb(), then checks the return against nr_cpu_ids to decide to return. There's no other use. So instead of this, use a standard -1 return on failure to find an idle CPU, as the argument is signed already. Signed-off-by: Ingo Molnar Reviewed-by: Joel Fernandes (Google) Link: https://lore.kernel.org/r/20231006102518.2452758-4-mingo@kernel.org commit b6dd6984832a2868f78879fce30d6965ae899d02 Author: Ingo Molnar Date: Fri Oct 6 12:25:17 2023 +0200 sched/nohz: Use consistent variable names in find_new_ilb() and kick_ilb() Use 'ilb_cpu' consistently in both functions. Signed-off-by: Ingo Molnar Reviewed-by: Joel Fernandes (Google) Link: https://lore.kernel.org/r/20231006102518.2452758-3-mingo@kernel.org commit 7ef7145a2b26b172ac6885c4cf3272a38bc0979a Author: Ingo Molnar Date: Fri Oct 6 12:25:16 2023 +0200 sched/nohz: Update idle load-balancing (ILB) comments - Fix incorrect/misleading comments, - clarify some others, - fix typos & grammar, - and use more consistent style throughout. Signed-off-by: Ingo Molnar Reviewed-by: Joel Fernandes (Google) Link: https://lore.kernel.org/r/20231006102518.2452758-2-mingo@kernel.org commit 4db74c0fdeb8138f6438d42a015c5dcdb2e6874c Author: Oded Gabbay Date: Thu Sep 28 16:12:30 2023 +0300 accel/habanalabs/gaudi2: fix spmu mask creation event_types_num received from the user can be 0. In that case, the event_mask should be 0. In addition, to create a correct mask we need to match the number of event types to the bit location such that bit 0 represents a single event type, bit 1 represents 2 types and so on. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit 0426e03126fba3e3e8c549504283f7213d31831f Author: Tomer Tayar Date: Tue Sep 19 10:32:23 2023 +0300 accel/habanalabs/gaudi2: perform hard-reset upon PCIe AXI drain event Non-completed transactions from PCIe towards the device are handled by the AXI drain mechanism. This handling is in the PCIe level, but the transactions are still there in the device consuming some queues entries, and therefore the device must be reset. Modify to perform hard-reset upon PCIe AXI drain events. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 84190b92cc1fd6cdbcb90b65dedeb32fb49336e7 Author: farah kassabri Date: Wed Sep 20 12:22:02 2023 +0300 accel/habanalabs: fix bug in decoder wait for cs completion The decoder interrupts are handled in the interrupt context same as all user interrupts. In such case, the wait list should be protected by spin_lock_irqsave in order to avoid deadlock that might happen with the user submission flow. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 2ba0236f5ba554425d7d229c71236843d7b06ee7 Author: Dafna Hirschfeld Date: Tue Aug 22 16:48:14 2023 +0300 accel/habanalabs: remove wrong doc for init_phys_pg_pack_from_userptr The function does not pin the pages so remove that from the inline doc. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit c1805bf36a2786db7a745ef62cbfffa2015a0476 Author: Arnd Bergmann Date: Wed Sep 27 09:21:53 2023 +0200 accel/habanalabs: add missing debugfs function stubs Two function stubs were removed in an earlier commit but are now needed again: drivers/accel/habanalabs/common/device.c: In function 'hl_device_init': drivers/accel/habanalabs/common/device.c:2231:14: error: implicit declaration of function 'hl_debugfs_device_init'; did you mean 'drm_debugfs_dev_init'? [-Werror=implicit-function-declaration] 2231 | rc = hl_debugfs_device_init(hdev); drivers/accel/habanalabs/common/device.c:2367:9: error: implicit declaration of function 'hl_debugfs_device_fini'; did you mean 'hl_debugfs_remove_file'? [-Werror=implicit-function-declaration] 2367 | hl_debugfs_device_fini(hdev); | ^~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Arnd Bergmann Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 1630d14f8db0f2e41a5e1cd9cc90b41e899d26df Author: Oded Gabbay Date: Thu Sep 21 16:43:36 2023 +0300 accel/habanalabs: minor cosmetic update to habanalabs.h - Update copyright years - Align fields in struct hl_userptr - Fix comments Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit 4355f2c32274ed918f00c9dbecb070f419b1d3cf Author: Oded Gabbay Date: Thu Sep 21 16:36:33 2023 +0300 accel/habanalabs/gaudi: remove define used for simulator We don't support simulator in upstream. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit 87c60e23f26bac0a9d6dbcd020ffce483997990c Author: Oded Gabbay Date: Thu Sep 21 16:34:28 2023 +0300 accel/habanalabs: remove leftover code This code was added as part of a bigger feature which was never upstreamed, so remove this code. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit 6fc69ca84af7cb78fca05d4b44b55098237d8d9e Author: Oded Gabbay Date: Thu Sep 21 15:25:26 2023 +0300 accel/habanalabs: print device name when it is removed Notifies the user which device was removed. It is important in a server with multiple devices. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit e5873f6b914918797219ca7515afd4bbfa5b8ec4 Author: Oded Gabbay Date: Thu Sep 21 15:10:36 2023 +0300 accel/habanalabs: remove unused field flags in struct wait_interrupt_data is not used anywhere so remove it. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit b5305d23aae50d725622ae058466d4603621d6d9 Author: Oded Gabbay Date: Thu Sep 21 15:06:58 2023 +0300 accel/habanalabs/gaudi: remove unused structure definition struct gaudi_nic_status is not used anywhere in the code. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit 26f5b6c364382803e4c29743bf8e9fd0de161190 Author: Oded Gabbay Date: Thu Sep 21 14:54:01 2023 +0300 accel/habanalabs: change Greco to Gaudi2 Greco was not upstreamed so no point of mentioning it here. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit a43557dcd429a310e0011737fe12bb8ebf90fcc5 Author: Oded Gabbay Date: Thu Sep 21 14:52:39 2023 +0300 accel/habanalabs: minor cosmetics update to trace file - Update copyright years - Add missing newline at end of file Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit 7f1cd6fdd5872160da05098a84a94dee5e709e54 Author: Oded Gabbay Date: Thu Sep 21 14:52:01 2023 +0300 accel/habanalabs: minor cosmetics update to cpucp_if.h - Update copyright years - Align comments Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit ff92d010526749ecdcfc2e01bd2f2c8411405f53 Author: Ohad Sharabi Date: Sun Aug 27 15:12:52 2023 +0300 accel/habanalabs: trace dma map sgtable Traces the DMA [un]map_sgtable using the new traces we added. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 309ed969032c99e14ffabbc29ecf51e659e0ee4b Author: Ohad Sharabi Date: Sun Aug 27 10:54:06 2023 +0300 accel/habanalabs: add traces for dma mappings In order to get a full picture of DMA mappings (e.g. to track DMAR errors), DMA mappings APIs should be covered. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d7aa294805a865a9b3e71e38b46e48df41170554 Author: Oded Gabbay Date: Tue Sep 19 13:26:02 2023 +0300 accel/habanalabs: remove unused asic functions asic_dma_{un}map_single() asic-specific functions are no longer called from the common code, so delete these functions. In addition, delete the gaudi2 implementation as they are also not called. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit de8773fdc500cfeb78064e5b50540b1fbf10448e Author: Ariel Suller Date: Mon Sep 11 17:43:07 2023 +0300 accel/habanalabs: update boot status print FW shutdown preparation status was added to spec. Signed-off-by: Ariel Suller Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 674f77798e432509e60919e2909fe6c72f5f2267 Author: Dafna Hirschfeld Date: Thu Sep 7 07:44:23 2023 +0300 accel/habanalabs: extend preboot timeout when preboot might take longer There are cases such when FW runs MBIST, that preboot is expected to take longer than the usual. In such cases the firmware reports status SECURITY_READY/IN_PREBOOT and we extend the timeout waiting for it. This is currently implemented for Gaudi2 only. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 9dca13141332e69fd657873194e77a1960fc9ab2 Author: Dafna Hirschfeld Date: Thu Sep 7 14:43:01 2023 +0300 accel/habanalabs: add fw status SHUTDOWN_PREP update hl_boot_if.h from specs to include CPU_BOOT_STATUS_FW_SHUTDOWN_PREP Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 3824be1f4d4282190e82a9d5113f4079cb0796e9 Author: Tomer Tayar Date: Mon Aug 21 02:50:54 2023 +0300 accel/habanalabs: add debug prints to dump content of SG table for dma-buf Add debug prints to dump the content of the SG table which is prepared when the dma-buf map op is called. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d16945f60274d5826a1c7c6581dc5878247a5951 Author: Tomer Tayar Date: Sun Aug 20 15:33:43 2023 +0300 accel/habanalabs: add missing offset handling for dma-buf On devices with virtual device memory (Gaudi2 onwards), user can provide an offset within an allocated device memory from which he wants to export a dma-buf object. The offset value is verified by driver, but it is not taken into consideration when the importer driver maps the dma-buf and the SG table it prepared. Add the missing offset handling. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 878ebc14db049ae85225756b187fec81df8108b3 Author: Tomer Tayar Date: Sun Aug 20 14:17:06 2023 +0300 accel/habanalabs: set hl_dmabuf_priv.device_address only when needed The device_address member of 'struct hl_dmabuf_priv' is used only when virtual device memory is not supported and dma-buf is exported from address. Set the value of this field only when it is relevant, and add "phys" to its name so it would be clearer that it can't be a device virtual address. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit bb644f61970ad44147c9466b0cb99a028de02138 Author: Tomer Tayar Date: Thu Aug 17 21:47:49 2023 +0300 accel/habanalabs: fix SG table creation for dma-buf mapping In some cases the calculated number of required entries for the dma-buf SG table is wrong. For example, if the page size is larger than both the dma max segment size of the importer device and from the exported side, or if the exported size is part of a phys_pg_pack that is composed of several pages. In these cases, redundant entries will be added to the SG table. Modify the method that the number of entries is calculated, and the way they are prepared. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ba24b5ec7847d4126fc37cabd4cef3579d9ca806 Author: farah kassabri Date: Wed Jul 19 16:56:53 2023 +0300 accel/habanalabs: split user interrupts pending list Currently driver maintain one list for both pending user interrupts which seeks to wait till CQ reaches it's target value and also the ones that seeks to get timestamp records when the CQ reaches it's target value. This causes delay in handling the waiters which gets higher priority than the timestamp records. In order to solve this, let's split the list into two, one for each case and each one is protected by it's own spinlock. Waiters will be handled within the interrupt context first, then the timestamp records will be set. Freeing the timestamp related memory will be handled in a workqueue. Signed-off-by: farah kassabri Reviewed-by: Tomer Tayar Signed-off-by: Oded Gabbay commit 1157b5d6b3b069394e37cd3b1d32c39eb833e546 Author: farah kassabri Date: Thu Mar 2 11:09:24 2023 +0200 accel/habanalabs: optimize timestamp registration handler Currently we use dynamic allocation inside the irq handler in order to allocate free node to be used for the free jobs. This operation is expensive, especially when we deal with large burst of events records that get released at the same time. The alternative is to have pre allocated pool of free nodes and just fetch nodes from this pool at irq handling time instead of allocating them. In case the pool becomes full, then the driver will fallback to dynamic allocations. As part of the optimization also update the unregister flow upon re-using a timestamp record, by making the operation much simpler and quicker. We already have the record in the registration flow and now we just seek to re-use with different interrupt. Therefore, no need to look for buffer according to the user handle. Signed-off-by: farah kassabri Reviewed-by: Tomer Tayar Signed-off-by: Oded Gabbay commit 0165994c215f321e2d055368f89b424756e340eb Author: farah kassabri Date: Thu Aug 24 15:45:21 2023 +0300 accel/habanalabs: fix bug in timestamp interrupt handling There is a potential race between user thread seeking to re-use a timestamp record with new interrupt id, while this record is still in the middle of interrupt handling and it is about to be freed. Imagine the driver set the record in_use to 0 and only then fill the free_node information. This might lead to unpleasant scenario where the new registration thread detects the record as free to use, and change the cq buff address. That will cause the free_node to get the wrong buffer address to put refcount to. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d89d329a2bb39e0e0ad37d7a40302d0fa7e8851a Author: Tomer Tayar Date: Mon Aug 14 18:01:21 2023 +0300 accel/habanalabs: tiny refactor of hl_map_dmabuf() alloc_sgt_from_device_pages() includes relatively many parameters, and in a subsequent change another offset parameter is going to be added. Using structure fields directly when calling this function, and in hl_map_dmabuf() it is done twice, makes it a little bit difficult to understand the meaning of the parameters. To make it clearer, assign the required values into local variables with explicit names, and use the variables when calling the function. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 0b75cb5b240fddf181c284d415ee77ef61b418d6 Author: Tomer Tayar Date: Wed Aug 9 16:14:49 2023 +0300 accel/habanalabs: export dma-buf only if size/offset multiples of PAGE_SIZE It is currently allowed for a user to export dma-buf with size and offset that are not multiples of PAGE_SIZE. The exported memory is mapped for the importer device, and there it will be rounded to PAGE_SIZE, leading to actually exporting more than the user intended to. To make the user be aware of it, accept only size and offset which are multiple of PAGE_SIZE. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit efbca048c64bb00562c3e980dfc6ca47fff4fa0e Author: Tomer Tayar Date: Fri Aug 4 17:42:13 2023 +0300 accel/habanalabs: use exported size from dma_buf and not from phys_pg_pack The 'exported_size' member in 'struct hl_vm_phys_pg_pack' is used to keep the exported dma-buf size, to be later used when the buffer is mapped. However it is possible that the same phys_pg_pack will be exported more than once, and independently of when the mapping takes place. Remove this member from the phys_pg_pack structure, and simply use the size in the dma-buf object as the exported size when mapping. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit dfdbc55a9c8c5ab00ae2d5963ac1199fdc9da2d3 Author: Tomer Tayar Date: Fri Aug 4 17:12:58 2023 +0300 accel/habanalabs: always pass exported size to alloc_sgt_from_device_pages() For Gaudi1 the exported dma-buf is always composed of a single page, and therefore the exported size is equal to this page's size. When calling alloc_sgt_from_device_pages(), we pass 0 as the exported size and internally calculate it as "number of pages * page size". This makes alloc_sgt_from_device_pages() less clear, because the exported size parameter is not understood as a restriction on the pages' size. Modify to always pass the exported size explicitly. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 051868d93cfd342b4ff8e6297b93a6a43dbe81b3 Author: farah kassabri Date: Sun Aug 27 19:01:20 2023 +0300 accel/habanalabs: prevent sending heartbeat before events are enabled After the heartbeat mechanism is now expanded to be used also for EQ health check, we shouldn't send heartbeat messages to FW before driver allow events to be received from FW. Because if the driver will send two heartbeats before it enables events to be received from FW, then the EQ health check will fail and reset the device. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 764bfd138f359423b299b7bf3fcbabb56b981ef5 Author: farah kassabri Date: Wed Aug 23 12:36:25 2023 +0300 accel/habanalabs/gaudi2: add eq health check using irq This is the second patch for applying the eq health check mechanism which will add support for the interrupt flow for gaudi2 asic. More info about the interrupt mechanism: set a dedicated msix for the eq error interrupt, and add interrupt handler for it. when FW detects some issue with EQ like EQ_FULL, it'll raise that interrupt and driver should reset the device. Driver will inform the FW which msix index to use through the already existing handshake mechanism which will send msix info message to fw. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 7c4130e6ddd709be2033a6635c91d445cb2baea5 Author: farah kassabri Date: Tue Aug 8 12:56:47 2023 +0300 accel/habanalabs/gaudi2: handle eq health heartbeat check Add mechanism for fw eq health check. this will be done using two flows: using the heartbeat mechanism and raising a dedicated interrupt to indicate an eq failure like EQ full. This patch will add implementation for the eq heartbeat for gaudi2 asic. More info about the heartbeat mechanism: Expand the heartbeat mechanism to monitor a new event that will be sent from FW upon receiving heartbeat message. that way driver can know that the eq is working or not. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 72bff371b2e26a0088d4cb1b44aee20c77e423ba Author: Moti Haimovski Date: Tue Aug 22 15:10:55 2023 +0300 accel/habanalabs/gaudi2: print power-mode changes Print to kernel log any device power mode changes events reported by the FW. Signed-off-by: Moti Haimovski Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 0648c4d0806fe167fe699299573100507ae99502 Author: Hen Alon Date: Wed Aug 9 17:29:41 2023 +0300 accel/habanalabs: add tsc clock sampling to clock sync info Add tsc clock to clock sync info, to enable using this clock for sampling and sync it with device time. Signed-off-by: Hen Alon Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit e0f452802bdaaf45dcb24080053f2b3a9c7c464a Author: Dafna Hirschfeld Date: Sun Jun 25 15:51:42 2023 +0300 accel/habanalabs: fix inline doc typos Fix two typos Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ab574f6a81dd7f4371e573e66fbd6f236ca0fd38 Author: Dafna Hirschfeld Date: Sun Jun 25 14:11:05 2023 +0300 accel/habanalabs: disable events ioctls on control device Because it is not used and also, for graceful reset to work those ioctls should run on the compute device. Signed-off-by: Dafna Hirschfeld Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 2b76129c5ae710423cfb55806803341af6a403a7 Author: David Meriin Date: Mon Jul 24 23:30:44 2023 +0300 accel/habanalabs: move cpucp interface to linux/habanalabs The CPUCP interface is moved to a shared folder outside of accel as a pre-requisite to upstream the NIC drivers that will also include this file. Signed-off-by: David Meriin Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d261b0ab131e2511b70f7bc4a3737d3b90ca6e87 Author: Ofir Bitton Date: Tue Jul 25 21:11:56 2023 +0300 accel/habanalabs/gaudi2: include block id in ECC error reporting During ECC event handling, Memory wrapper id was mistakenly printed as block id. Fix the print and in addition fetch the actual block-id from firmware. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 10d260f655c1af1b5a5e7d0cea001e3d0461aeaa Author: Benjamin Dotan Date: Wed Jul 26 07:58:03 2023 +0300 accel/habanalabs: improve etf configuration coresight ETF blocks have different size. As a result, sync packets need to be aligned based on fifo size. Signed-off-by: Benjamin Dotan Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 571bfeb48ac24564658e58c0a3a5318904846aae Author: Justin Stitt Date: Wed Aug 23 00:23:08 2023 +0000 accel/habanalabs: refactor deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on its destination buffer argument which is _not_ the case for `strncpy`! There is likely no bug happening in this case since HL_STR_MAX is strictly larger than all source strings. Nonetheless, prefer a safer and more robust interface. It should also be noted that `strscpy` will not pad like `strncpy`. If this NUL-padding behavior is _required_ we should use `strscpy_pad` instead of `strscpy`. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Stanislaw Gruszka Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 90f3de616259cbb5666f00f8daf5420cd7d71d18 Author: Christophe JAILLET Date: Mon Sep 4 21:18:36 2023 +0200 accel/habanalabs/gaudi2: Fix incorrect string length computation in gaudi2_psoc_razwi_get_engines() snprintf() returns the "number of characters which *would* be generated for the given input", not the size *really* generated. In order to avoid too large values for 'str_size' (and potential negative values for "PSOC_RAZWI_ENG_STR_SIZE - str_size") use scnprintf() instead of snprintf(). Fixes: c0e6df916050 ("accel/habanalabs: fix address decode RAZWI handling") Signed-off-by: Christophe JAILLET Reviewed-by: Stanislaw Gruszka Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit a45d5cf09d49ed46c1cf1150ed5a891878a161f3 Author: Justin Stitt Date: Fri Aug 25 22:09:51 2023 +0000 accel/habanalabs: refactor deprecated strncpy to strscpy_pad `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We see that `prop->cpucp_info.card_name` is supposed to be NUL-terminated based on its usage within `__hwmon_device_register()` (wherein it's called "name"): | if (name && (!strlen(name) || strpbrk(name, "-* \t\n"))) | dev_warn(dev, | "hwmon: '%s' is not a valid name attribute, please fix\n", | name); A suitable replacement is `strscpy_pad` [2] due to the fact that it guarantees both NUL-termination and NUL-padding on its destination buffer. NUL-padding on `prop->cpucp_info.card_name` is not strictly necessary as `hdev->prop` is explicitly zero-initialized but should be used regardless as it gets copied out to userspace directly -- as per Kees' suggestion. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Suggested-by: Kees Cook Reviewed-by: Kees Cook Signed-off-by: Oded Gabbay commit 428f6882a6f9fc0521eb2dca5293436d5a041ff3 Author: Benjamin Dotan Date: Thu Jul 20 13:03:43 2023 +0300 accel/habanalabs: fix ETR/ETF flush logic When config_etr or config_etf are called we need to validate the parameters that are passed into them to make sure the requested operation is valid. Signed-off-by: Benjamin Dotan Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit cf1ed52d12097b743da17dfa34db01f2c18537a5 Author: Benjamin Dotan Date: Thu Jul 20 15:32:07 2023 +0300 accel/habanalabs/gaudi2 : remove psoc_arc access Because firmware is blocking PSOC_ARC_DBG, we need to disable access to this block. Signed-off-by: Benjamin Dotan Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 01ab1629ad7024ce974015e206555955921b16bc Author: Igor Grinberg Date: Tue Jul 4 15:38:40 2023 +0300 accel/habanalabs/gaudi2: prepare to remove cpu_rst_status The soft reset has transitioned to CPUCP packet instead of plain register write and is about to be removed from the struct cpu_dyn_regs. As a preparation for removing the cpu_rst_status field from struct cpu_dyn_regs, switch to use the plain macro - this keeps the backward compatibility. Signed-off-by: Igor Grinberg Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 57963ff8adfee6f2a777bc44c372a390af535300 Author: Tomer Tayar Date: Mon Apr 17 17:05:34 2023 +0300 accel/habanalabs: Move ioctls to the device specific ioctls range To use drm_ioctl(), move the ioctls to the device specific ioctls range at [DRM_COMMAND_BASE, DRM_COMMAND_END). Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 38ed55bc58f72d4180f74fd901e71b16d68641b9 Author: Tomer Tayar Date: Thu Mar 23 14:58:34 2023 +0200 accel/habanalabs: update debugfs-driver-habanalabs with the accel path Replace "/sys/kernel/debug/habanalabs/hl/..." with "/sys/kernel/debug/accel//...". Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 13312360ef3a7834080ac3b96ed049abfcbf3d4b Author: Tomer Tayar Date: Thu Mar 23 14:50:00 2023 +0200 accel/habanalabs: update sysfs-driver-habanalabs with the accel path Replace "/sys/class/habanalabs/hl/..." with "/sys/class/accel/accel/device/...". Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit fe77368c0f3e017ec2567b1f3767c1aa5482919e Author: Tomer Tayar Date: Sun Feb 19 11:58:46 2023 +0200 accel/habanalabs: register compute device as an accel device Register the compute device as an accel device, and remove the creation of the habanalabs compute char device. The IOCTLs in this patch are still handled by the current driver handler. Moving to DRM IOCTL handling requires moving the IOCTLs numbers to a specific range, so it will be handled in subsequent patches. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit a8ab1a81ccc2c68a4fa3d0631ce17529e208c8c2 Author: Ofir Bitton Date: Tue May 23 10:42:19 2023 +0300 accel/habanalabs: add info ioctl for engine error reports User gets notification for every engine error report, but he still lacks the exact engine information. Hence, we allow user to query for the exact engine reported an error. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 10926f60051332a754084d45862afc4e83e597e1 Author: Tomer Tayar Date: Tue Jun 13 17:29:14 2023 +0300 accel/habanalabs: set default device release watchdog T/O as 30 sec After being notified about certain errors, user is expected to finish his post-errors actions and to release the device within some timeout, after which is deice is being reset. The default timeout value is 5 sec, which in some case is not enough for a user application to collect debug data. Increase the default value to 30 sec. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 88872790923e2d80edf29a00b4e440f1473fa8f5 Author: Dani Liberman Date: Tue Jun 20 12:09:17 2023 +0300 accel/habanalabs: handle f/w reserved dram space request It is possible for FW to request reserved space in dram. If the device supports this option, it will retrieve the size from the f/w and will reserve it. Currently we add the common code infrastructure to support it. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit fa46c7bb501b8b649ba17e4a048243b85ba1b1b0 Author: Oded Gabbay Date: Tue Jul 11 10:28:18 2023 +0300 accel/habanalabs/gaudi2: fix missing check of kernel ctx If we are initializing the kernel context when we have a Gaudi2 device, we don't need to do any late initializing of that context with specific Gaudi2 code. Reviewed-by: Ofir Bitton Signed-off-by: Oded Gabbay commit 15c0bb162353296cd2f897d2fa39d2593fb631b3 Author: Igor Grinberg Date: Tue Jul 4 15:38:40 2023 +0300 accel/habanalabs/gaudi2: prepare to remove soft_rst_irq The soft reset has transitioned to CPUCP packet instead of plain register write and is about to be removed from the struct cpu_dyn_regs. As a preparation for removing the gic_host_soft_rst_irq field from struct cpu_dyn_regs, switch to use the plain macro - this keeps the backward compatibility. Signed-off-by: Igor Grinberg Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 1e3a78270b4ec1c8c177eb310c08128d52137a69 Author: Ofir Bitton Date: Wed Jun 28 14:40:46 2023 +0300 accel/habanalabs/gaudi2: unsecure tpc count registers As TPC kernels now must use those registers we unsecure them. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 5a8487ac54019cd597334292f36be4248a97e816 Author: Tomer Tayar Date: Thu Jun 15 15:30:39 2023 +0300 accel/habanalabs/gaudi2: un-secure register for engine cores interrupt The F/W dynamically allocates one of the PSOC scratchpad registers for the engine cores, so they can raise events towards the F/W. To allow the engine cores to access this register, this register must be non-secured. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit b03dc2b621fad55b09126d0e7919b85fdf84a153 Author: Juerg Haefliger Date: Fri Jun 16 14:16:37 2023 +0200 accel/habanalabs/gaudi: Add MODULE_FIRMWARE macros The module loads firmware so add MODULE_FIRMWARE macros to provide that information via modinfo. Signed-off-by: Juerg Haefliger Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit e11a7d2ca5cd36b3d1db4d0ccce30c54a29e1ed9 Author: Ivan Orlov Date: Tue Jun 20 20:25:29 2023 +0200 accel: make accel_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the accel_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: dri-devel@lists.freedesktop.org Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Signed-off-by: Greg Kroah-Hartman Reviewed-by: Tomer Tayar Signed-off-by: Oded Gabbay commit d33c3d0541339fb16e241283f9c1ef369b4a7093 Author: Ofir Bitton Date: Mon Jun 12 14:51:15 2023 +0300 accel/habanalabs: dump temperature threshold boot error Add dump of an error reported from f/w during boot time. This error indicates a failure with setting temperature threshold. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 37d72439a4b17dda2adc2de98bcb98932fd6ceb2 Author: Oded Gabbay Date: Mon Jun 12 14:24:05 2023 +0300 accel/habanalabs: reset device if scrubbing failed If scrubbing memory after user released device has failed it means the device is in a bad state and should be reset. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit 89803af5355b04f4e2583d5c7170aa3676f9c1b7 Author: Oded Gabbay Date: Mon Jun 12 14:22:07 2023 +0300 accel/habanalabs: remove pdev check on idle check Our simulator supports idle check so no need anymore to check if pdev exists. Signed-off-by: Oded Gabbay Reviewed-by: Ofir Bitton commit 2da9f8d8059331db9d26a5e794a417be547c4236 Author: farah kassabri Date: Mon Jun 12 13:58:11 2023 +0300 accel/habanalabs: fix wait_for_interrupt abortion flow When the driver needs to abort waiters for interrupts, for cases such as critical events that occur and driver need to do hard reset, in such scenario the driver will complete the fence to wake up the waiting thread, and will set the fence error indication. The return value of the completion API will be greater than 0 since it will return the timeout, but as this indicates successful completion, the driver should mark it as aborted. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit eaa43a06b765542ee36f38bdd92b04bdc8645964 Author: farah kassabri Date: Mon Jun 12 13:47:49 2023 +0300 accel/habanalabs: Allow single timestamp registration request at a time Protect against concurrency of user requesting to register a timestamp offset (where the driver fills the timestamp when the command submission has finished executing) to a specific user interrupt ID. The protection is basically to allow only one timestamp registration request to be handled at a time. This is needed because the user can decide to re-use a timestamp offset (register an already registered offset, to a different interrupt ID). This means the request will cause the timestamp node to move from one interrupt list to another interrupt list. In such scenario, without proper protection, we could end up adding the same node twice to the interrupts wait lists. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 964b1f675dac62763feaa6cec188be9f92aa9e57 Author: Koby Elbaz Date: Tue Jun 6 14:44:57 2023 +0300 accel/habanalabs: rename fd_list to hpriv_list Every time an FD is returned to the user, the driver adds a corresponding private structure to the list. Yet, it's still a list of private structures rather than of FDs. Remove, as well, an unnecessary comment. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 942f18c56d2106115bcf344cc7b0f762c6fc55c2 Author: Koby Elbaz Date: Tue Jun 6 11:57:51 2023 +0300 accel/habanalabs: call put_pid after hpriv list is updated Because we might still be using related resources, decrementing PID's reference count should be done at later stages of the device release. A good place is right after the representing private structure is removed from LKD's list. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 2b541cf91373b1bc1634a82b668022d50c05603c Author: Koby Elbaz Date: Mon Jun 5 11:11:05 2023 +0300 accel/habanalabs: print return code when process termination fails As part of driver teardown, we attempt to kill all user processes. It shouldn't fail, but if it does we want to print the error code that the kapi returned to us. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit bffd2f16ae374decdeb5bc714b1aa2e0c23f3708 Author: farah kassabri Date: Sun Jun 4 11:19:19 2023 +0300 accel/habanalabs: fix standalone preboot descriptor request The preboot used to statically allocate memory for the comms descriptor on the device memory when driver requested the descriptor information. Now preboot moved to dynamic memory allocation where it wants to check the size the driver expects vs. what the f/w expects. Note there are no backward compatibility issues as older f/w versions simply ignore this value. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 43d8acce607c90a44653c80f3bf211f31abc0416 Author: Dani Liberman Date: Wed Mar 29 20:21:56 2023 +0300 accel/habanalabs: handle arc farm razwi Implement razwi handling for arc farm and add it to arc farm sei event handler. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit f17182d03680044649d6e124a4580a33c65990e2 Author: Ofir Bitton Date: Wed May 31 12:40:41 2023 +0300 accel/habanalabs: stop fetching MME SBTE error cause Because in this case we have only a single possible cause, we can safely stop fetching the cause from firmware. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit e4a97d6b62599cc6c4bd37674de378b2a86225c3 Author: Koby Elbaz Date: Mon May 29 11:41:04 2023 +0300 accel/habanalabs: set device status 'malfunction' while in rmmod hl_device_status() returns the status of an acquired device. If a device is going down (following an rmmod cmd), it should be marked as an unusable/malfunctioning device, and hence should not be acquired. However, since this was not the case so far (i.e., a device going down would inaccurately return 'in reset' status allowing the user to acquire the device) it introduced a bug where as part of a reset flow, the driver could not kill processes that have not run yet, and since those processes aren't blocked from reacquiring a device, we get eventually a new flow of a driver attempting to kill all processes in a list that can't be ever really empty. Signed-off-by: Koby Elbaz Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit e7b2902a330eba354024581edead0002521bcedf Author: Tomer Tayar Date: Mon May 22 11:20:48 2023 +0300 accel/habanalabs: print task name upon creation of a user context It is useful for debug to know which user process have acquired the device. Add this info to the relevant debug print, in addition to the already printed user context's ASID. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 7dccb064a7ab54068b5a92466361dcd0db069c73 Author: Tomer Tayar Date: Tue May 16 11:10:52 2023 +0300 accel/habanalabs: print task name and request code upon ioctl failure When an ioctl fails, it is useful to know what is the task command name and the full ioctl request code, in addition to the task pid and the ioctl number. Add the additional information to the relevant debug error prints. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit c6a4f256aee17e18dbc14039d746e0450e4b199b Author: Ofir Bitton Date: Mon May 15 13:56:25 2023 +0300 accel/habanalabs: notify user about undefined opcode event In order for user to be aware of undefined opcode events, we must store all relevant information and notify user about the failure. The user will fetch the stored info via info ioctl. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit a35c99760146137bbcfafe82ed5dc9c7a00b640a Author: Tomer Tayar Date: Wed May 10 18:18:05 2023 +0300 accel/habanalabs: update pending reset flags with new reset requests If hl_device_cond_reset() is called while a reset is already pending but hasn't started, the reset request will be dropped. If the flags of the new request are more severe, e.g. a hard reset while the pending reset is a compute reset, the eventual reset won't be suitable for the device status. To prevent such cases, update the pending reset flags with the new requests flags before the requests are dropped. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 5d89ce6f8c2775b926b63c14529c5970429ea935 Author: Tomer Tayar Date: Tue May 9 13:51:59 2023 +0300 accel/habanalabs: prevent immediate hard reset due to 2 adjacent H/W events When a H/W event is received while a user is registered to events, no immediate hard reset will happen, and instead the user will be notified and will have some time to handle it and eventually release the device, after which the reset will be done. If a user, as part of the handling and as part of the cleanup steps towards releasing the device, unregisters from receiving those events, and at that time an adjacent H/W event is received, it will be assumed that the user is not registered to events and thus an immediate hard reset is required. To prevent such an unwanted immediate reset, modify the driver to perform it if the user is not registered to events AND we don't already have a pending reset for a previous H/W event. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit cee030ef1c5018deb38a6f5a8a9bf405e55624aa Author: Rob Herring Date: Mon Sep 25 16:24:25 2023 -0500 dt-bindings: display: msm: Make "additionalProperties: true" explicit Make it explicit that child nodes have additional properties and the child node schema is not complete. The complete schemas are applied separately based the compatible strings. Signed-off-by: Rob Herring Acked-by: Conor Dooley Patchwork: https://patchwork.freedesktop.org/patch/559387/ Link: https://lore.kernel.org/r/20230925212434.1972368-2-robh@kernel.org Signed-off-by: Dmitry Baryshkov commit b3eb5bd3ddcc953127d11f3b831b1913d9286431 Author: Rob Herring Date: Mon Sep 25 16:24:24 2023 -0500 dt-bindings: display: msm: Add missing unevaluatedProperties on child node schemas Just as unevaluatedProperties or additionalProperties are required at the top level of schemas, they should (and will) also be required for child node schemas. That ensures only documented properties are present for any node. Signed-off-by: Rob Herring Acked-by: Conor Dooley Patchwork: https://patchwork.freedesktop.org/patch/559385/ Link: https://lore.kernel.org/r/20230925212434.1972368-1-robh@kernel.org Signed-off-by: Dmitry Baryshkov commit bfcc3d8f94f4cb7b97cd666367ffc729342d30c0 Author: Dmitry Baryshkov Date: Mon Sep 4 01:24:32 2023 +0300 drm/msm/dp: support setting the DP subconnector type Read the downstream port info and set the subconnector type accordingly. Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/555531/ Link: https://lore.kernel.org/r/20230903222432.2894093-1-dmitry.baryshkov@linaro.org commit 6398e4d4ca0ad41feed529aa95c96a12d78f6124 Author: Stephen Boyd Date: Wed Sep 6 11:12:26 2023 -0700 drm/msm/dp: Remove error message when downstream port not connected Plugging in an Apple dongle without the HDMI cable attached prints out an error message in the kernel logs when nothing is actually wrong. no downstream ports connected This is because the downstream port for the HDMI connector is not connected, so the Apple dongle reports that as a zero sink count device. Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/556068/ Link: https://lore.kernel.org/r/20230906181226.2198441-3-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov commit cc2e49235d87bf21055743b448f47193421f3ac0 Author: Stephen Boyd Date: Wed Sep 6 11:12:25 2023 -0700 drm/msm/dp: Inline dp_display_is_sink_count_zero() This function is basically a one-liner when you ignore the debug logging. Just inline the function and drop the log to simplify the code. Suggested-by: Dmitry Baryshkov Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/556066/ Link: https://lore.kernel.org/r/20230906181226.2198441-2-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov commit edc8230af6661189b1f40dccf0a75d9e6062569b Author: Dmitry Baryshkov Date: Mon Sep 4 05:04:54 2023 +0300 drm/msm/dpu: move INTF tearing checks to dpu_encoder_phys_cmd_init As the INTF is fixed at the encoder creation time, we can move the check whether INTF supports tearchck to dpu_encoder_phys_cmd_init(). This function can return an error if INTF doesn't have required feature. Performing this check in dpu_encoder_phys_cmd_tearcheck_config() is less useful, as this function returns void. Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/555553/ Link: https://lore.kernel.org/r/20230904020454.2945667-9-dmitry.baryshkov@linaro.org commit cae719b21d0d25c0fe8781e548035fc80204a280 Author: Dmitry Baryshkov Date: Mon Sep 4 05:04:53 2023 +0300 drm/msm/dpu: drop useless check from dpu_encoder_phys_cmd_te_rd_ptr_irq() The dpu_encoder_phys_cmd_te_rd_ptr_irq() function uses neither hw_intf nor hw_pp data, so we can drop the corresponding check. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/555544/ Link: https://lore.kernel.org/r/20230904020454.2945667-8-dmitry.baryshkov@linaro.org commit e48954ef48395630b1cfccc8889fc6c28f6ba0b0 Author: Dmitry Baryshkov Date: Mon Sep 4 05:04:52 2023 +0300 drm/msm/dpu: drop DPU_INTF_TE feature flag Replace the only user of the DPU_INTF_TE feature flag with the direct DPU version comparison. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/555540/ Link: https://lore.kernel.org/r/20230904020454.2945667-7-dmitry.baryshkov@linaro.org commit 89db07e5f71ef911fb6a32b5948f83f24666918e Author: Dmitry Baryshkov Date: Mon Sep 4 05:04:51 2023 +0300 drm/msm/dpu: enable INTF TE operations only when supported by HW The DPU_INTF_TE bit is set for all INTF blocks on DPU >= 5.0, however only INTF_1 and INTF_2 actually support tearing control (both are INTF_DSI). Rather than trying to limit the DPU_INTF_TE feature bit to those two INTF instances, check for the major && INTF type. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/555547/ Link: https://lore.kernel.org/r/20230904020454.2945667-6-dmitry.baryshkov@linaro.org commit 019de78f0184bebef703500c88ee3e68851d2b8c Author: Dmitry Baryshkov Date: Mon Sep 4 05:04:50 2023 +0300 drm/msm/dpu: inline _setup_intf_ops() Inline the _setup_intf_ops() function, it makes it easier to handle different conditions involving INTF configuration. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/555551/ Link: https://lore.kernel.org/r/20230904020454.2945667-5-dmitry.baryshkov@linaro.org commit e5b1ec8036311d1136ec55d43823bde8c0c2591a Author: Dmitry Baryshkov Date: Mon Sep 4 05:04:49 2023 +0300 drm/msm/dpu: drop the DPU_PINGPONG_TE flag The DPU_PINGPONG_TE flag became unused, we can drop it now. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/555542/ Link: https://lore.kernel.org/r/20230904020454.2945667-4-dmitry.baryshkov@linaro.org commit 48d67e42bbe646cac9df2a91e4693af9c92e2baf Author: Dmitry Baryshkov Date: Mon Sep 4 05:04:48 2023 +0300 drm/msm/dpu: enable PINGPONG TE operations only when supported by HW The DPU_PINGPONG_TE bit is set for all PINGPONG blocks on DPU < 5.0. Rather than checking for the flag, check for the presense of the corresponding interrupt line. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/555541/ Link: https://lore.kernel.org/r/20230904020454.2945667-3-dmitry.baryshkov@linaro.org commit 8277a6208229b4acacfd12816e8c67a8dbb653fa Author: Dmitry Baryshkov Date: Mon Sep 4 05:04:47 2023 +0300 drm/msm/dpu: inline _setup_pingpong_ops() Inline the _setup_pingpong_ops() function, it makes it easier to handle different conditions involving PINGPONG configuration. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/555545/ Link: https://lore.kernel.org/r/20230904020454.2945667-2-dmitry.baryshkov@linaro.org commit a251c9d8e30833b260101edb9383b176ee2b7cb1 Author: Jani Nikula Date: Fri Sep 1 17:20:34 2023 +0300 drm/msm/dp: skip validity check for DP CTS EDID checksum The DP CTS test for EDID last block checksum expects the checksum for the last block, invalid or not. Skip the validity check. For the most part (*), the EDIDs returned by drm_get_edid() will be valid anyway, and there's the CTS workaround to get the checksum for completely invalid EDIDs. See commit 7948fe12d47a ("drm/msm/dp: return correct edid checksum after corrupted edid checksum read"). This lets us remove one user of drm_edid_block_valid() with hopes the function can be removed altogether in the future. (*) drm_get_edid() ignores checksum errors on CTA extensions. Cc: Abhinav Kumar Cc: Dmitry Baryshkov Cc: Kuogee Hsieh Cc: Marijn Suijten Cc: Rob Clark Cc: Sean Paul Cc: Stephen Boyd Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Jani Nikula Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar Reviewed-by: Kuogee Hsieh Patchwork: https://patchwork.freedesktop.org/patch/555361/ Link: https://lore.kernel.org/r/20230901142034.580802-1-jani.nikula@intel.com Signed-off-by: Dmitry Baryshkov commit b4b527a1c274c8c3c82da1254259f283c577df36 Author: Stephen Boyd Date: Tue Aug 29 11:47:32 2023 -0700 drm/msm/dp: Remove dp_display_is_ds_bridge() This function is simply drm_dp_is_branch() so use that instead of open-coding it. Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/554989/ Link: https://lore.kernel.org/r/20230829184735.2841739-8-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov commit c0977e0dd8a4f5f5ecd46e12b1022cd08568eefd Author: Stephen Boyd Date: Tue Aug 29 11:47:31 2023 -0700 drm/msm/dp: Inline dp_link_parse_sink_count() The function dp_link_parse_sink_count() is really just drm_dp_read_sink_count(). It debug prints out the bit for content protection (DP_SINK_CP_READY), but that is not useful beyond debug because 'link->dp_link.sink_count' is overwritten to only contain the sink_count in this same function. Just use drm_dp_read_sink_count() in the one place this function is called to simplify. Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/554987/ Link: https://lore.kernel.org/r/20230829184735.2841739-7-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov commit 634e9da255fca11afd1894a8b6b352d81ebe7ae4 Author: Stephen Boyd Date: Tue Aug 29 11:47:30 2023 -0700 drm/msm/dp: Simplify with drm_dp_{max_link_rate, max_lane_count}() These are open-coded versions of common functions. Replace them with the common code to improve readability. Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/554990/ Link: https://lore.kernel.org/r/20230829184735.2841739-6-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov commit de77a7333025527d10e87a27c8a1c9ee96de8d24 Author: Stephen Boyd Date: Tue Aug 29 11:47:29 2023 -0700 drm/msm/dp: Remove aux_cfg_update_done and related code The member 'aux_cfg_update_done' is always false. This is dead code that never runs. Remove it. Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/554985/ Link: https://lore.kernel.org/r/20230829184735.2841739-5-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov commit 7bfd3259b1fc43b970b8a0761302a9140b71d815 Author: Stephen Boyd Date: Tue Aug 29 11:47:28 2023 -0700 drm/msm/dp: Remove dead code related to downstream cap info We read the downstream port count and capability info but never use it anywhere. Remove 'ds_port_cnt' and 'ds_cap_info' and any associated code from this driver. Fold the check for 'dfp_present' into a call to drm_dp_is_branch() at the one place it is used to get rid of any member storage related to downstream ports. Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/554984/ Link: https://lore.kernel.org/r/20230829184735.2841739-4-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov commit b7ba5db9c863a9981202862673bf6b13f2765021 Author: Stephen Boyd Date: Tue Aug 29 11:47:27 2023 -0700 drm/msm/dp: Use drm_dp_read_sink_count() helper Use the common function drm_dp_read_sink_count() instead of open-coding it. This shrinks the kernel text a tiny bit. Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/554983/ Link: https://lore.kernel.org/r/20230829184735.2841739-3-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov commit 744077f94e431214c10a2802a189a26ed57dd264 Author: Stephen Boyd Date: Tue Aug 29 11:47:26 2023 -0700 drm/msm/dp: Replace open-coded drm_dp_read_dpcd_caps() This function duplicates the common function drm_dp_read_dpcd_caps(). The array of DPCD registers filled in is one size larger than the function takes, but from what I can tell that extra byte was never used. Resize the array and use the common function to reduce the code here. Cc: Vinod Polimera Cc: Kuogee Hsieh Signed-off-by: Stephen Boyd Tested-by: Kuogee Hsieh Reviewed-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/554981/ Link: https://lore.kernel.org/r/20230829184735.2841739-2-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov commit efcbd6f9cdeba0b3fff1c9ceab7ea1cf6e3c5ab4 Author: Jessica Zhang Date: Tue Aug 22 10:42:07 2023 -0700 drm/msm/dsi: Enable widebus for DSI DSI 6G v2.5.x+ supports a data-bus widen mode that allows DSI to send 48 bits of compressed data instead of 24. Enable this mode whenever DSC is enabled for supported chipsets. Signed-off-by: Jessica Zhang Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/553762/ Link: https://lore.kernel.org/r/20230822-add-widebus-support-v4-4-9dc86083d6ea@quicinc.com Signed-off-by: Dmitry Baryshkov commit a5268fc161d465389761d43d30c6fca2ce3d8e0a Author: Jessica Zhang Date: Tue Aug 22 10:42:06 2023 -0700 drm/msm/dsi: Add DATABUS_WIDEN MDP_CTRL2 bit Add a DATABUS_WIDEN bit to the MDP_CTRL2 register to allow DSI to enable databus widen mode. Reviewed-by: Dmitry Baryshkov Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/553757/ Link: https://lore.kernel.org/r/20230822-add-widebus-support-v4-3-9dc86083d6ea@quicinc.com Signed-off-by: Dmitry Baryshkov commit 97f038db2168a69a56bb660936f0079be89387dc Author: Jessica Zhang Date: Tue Aug 22 10:42:05 2023 -0700 drm/msm/dpu: Enable widebus for DSI INTF DPU supports a data-bus widen mode for DSI INTF. Enable this mode for all supported chipsets if widebus is enabled for DSI. Signed-off-by: Jessica Zhang Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/553756/ Link: https://lore.kernel.org/r/20230822-add-widebus-support-v4-2-9dc86083d6ea@quicinc.com Signed-off-by: Dmitry Baryshkov commit 14be80ae940c7fe5d593c4a05d0bd6d93f1eaaf9 Author: Jessica Zhang Date: Tue Aug 22 10:42:04 2023 -0700 drm/msm/dpu: Move setting of dpu_enc::wide_bus_en to atomic enable() Move the setting of dpu_enc::wide_bus_en to dpu_encoder_virt_atomic_enable() so that it mirrors how dpu_enc::dsc is being set. Since wide bus for DSI is related to DSC, having it mirror how DSC is set in DPU will also make it easier to accommodate for the possibility of DSC for DSI being set during runtime in the future. Reviewed-by: Dmitry Baryshkov Signed-off-by: Jessica Zhang Patchwork: https://patchwork.freedesktop.org/patch/553759/ Link: https://lore.kernel.org/r/20230822-add-widebus-support-v4-1-9dc86083d6ea@quicinc.com Signed-off-by: Dmitry Baryshkov commit 7d8830bb6029830fc48a9f3cfc6ea573740beb2a Author: Ruan Jinjie Date: Wed Aug 9 11:44:41 2023 +0800 drm/msm: Remove unnecessary NULL values The NULL initialization of the pointers assigned by kzalloc() first is not necessary, because if the kzalloc() failed, the pointers will be assigned NULL, otherwise it works as usual. so remove it. Signed-off-by: Ruan Jinjie Reviewed-by: Abhinav Kumar Patchwork: https://patchwork.freedesktop.org/patch/551872/ Link: https://lore.kernel.org/r/20230809034445.434902-4-ruanjinjie@huawei.com Signed-off-by: Dmitry Baryshkov commit 5a9d50150c2cd2dcc72729c14a0035b234c0a4cc Author: Dmitry Baryshkov Date: Wed Aug 2 13:04:26 2023 +0300 drm/msm/dpu: shift IRQ indices by 1 In order to simplify IRQ declarations, shift IRQ indices by 1. This makes 0 the 'no IRQ' value. Thanks to this change, we do no longer have to explicitly set the 'no interrupt' fields in catalog structures. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/550938/ Link: https://lore.kernel.org/r/20230802100426.4184892-9-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 1cd3ea3e4b124120dbdff3faf00a71c8fc6f6402 Author: Johannes Zink Date: Fri Sep 29 14:33:33 2023 +0200 drm/panel-simple: allow LVDS format override Some panels support multiple LVDS data mapping formats, which can be used e.g. run displays on jeida-18 format when only 3 LVDS lanes are available. Add parsing of an optional data-mapping devicetree property, which also touches up the bits per color to match the bus format. Signed-off-by: Johannes Zink Link: https://lore.kernel.org/r/20230523-simplepanel_support_nondefault_datamapping-v5-3-0d7928edafab@pengutronix.de Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230523-simplepanel_support_nondefault_datamapping-v5-3-0d7928edafab@pengutronix.de commit 66b66c97f4074c38b1c53c49625ebdd9a33ba56d Author: Johannes Zink Date: Fri Sep 29 14:33:32 2023 +0200 dt-bindings: display: simple: support non-default data-mapping Some Displays support more than just a single default LVDS data mapping, which can be used to run displays on only 3 LVDS lanes in the jeida-18 data-mapping mode. Add an optional data-mapping property to allow overriding the default data mapping. As it does not generally apply to any display and bus, use it selectively on the innolux,g101ice-l01, which supports changing the data mapping via a strapping pin. Reviewed-by: Conor Dooley Signed-off-by: Johannes Zink Link: https://lore.kernel.org/r/20230523-simplepanel_support_nondefault_datamapping-v5-2-0d7928edafab@pengutronix.de Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230523-simplepanel_support_nondefault_datamapping-v5-2-0d7928edafab@pengutronix.de commit 5437d667a0cae87d34c321ce1819ea78011efdc1 Author: Johannes Zink Date: Fri Sep 29 14:33:31 2023 +0200 dt-bindings: display: move LVDS data-mapping definition to separate file As the LVDS data-mapping property is required in multiple bindings: move it to separate file and include instead of duplicating it. Reviewed-by: Conor Dooley Reviewed-by: Laurent Pinchart Signed-off-by: Johannes Zink Link: https://lore.kernel.org/r/20230523-simplepanel_support_nondefault_datamapping-v5-1-0d7928edafab@pengutronix.de Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230523-simplepanel_support_nondefault_datamapping-v5-1-0d7928edafab@pengutronix.de commit 6acb691824933535219dfd94d9d97c922f5593d2 Author: Michael Tretter Date: Fri Oct 6 17:07:07 2023 +0200 drm/bridge: samsung-dsim: calculate porches in Hz Calculating the byte_clk in kHz is imprecise for a hs_clock of 55687500 Hz, which may be used with a pixel clock of 74.25 MHz with mode 1920x1080-30. Fix the calculation by using HZ instead of kHZ. This requires to change the type to u64 to prevent overflows of the integer type. Reviewed-by: Adam Ford #imx8mm-beacon Tested-by: Adam Ford #imx8mm-beacon Tested-by: Frieder Schrempf # Kontron BL i.MX8MM + Waveshare 10.1inch HDMI LCD (E) Reviewed-by: Marco Felsch Signed-off-by: Michael Tretter Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20230818-samsung-dsim-v2-5-846603df0e0a@pengutronix.de Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230818-samsung-dsim-v2-5-846603df0e0a@pengutronix.de commit 198e54282ae560958e64328fe8f72893661b9e8b Author: Michael Tretter Date: Fri Oct 6 17:07:06 2023 +0200 drm/bridge: samsung-dsim: adjust porches by rounding up Rounding the porches up instead of down fixes the samsung-dsim at some more resolutions and refresh rates: The following resolutions are working with rounded-up porches, but don't work when the porches are rounded down: 1920x1080-59.94 1920x1080-30.00 1920x1080-29.97 1920x1080-25.00 1680x1050-59.88 1280x1024-75.02 1200x960-59.99 1280x720-50.00 1024x768-75.03 1024x768-60.00 640x480-60.00 640x480-59.94 Reviewed-by: Adam Ford #imx8mm-beacon Tested-by: Adam Ford #imx8mm-beacon Tested-by: Frieder Schrempf # Kontron BL i.MX8MM + Waveshare 10.1inch HDMI LCD (E) Reviewed-by: Marco Felsch Signed-off-by: Michael Tretter Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20230818-samsung-dsim-v2-4-846603df0e0a@pengutronix.de Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230818-samsung-dsim-v2-4-846603df0e0a@pengutronix.de commit 846307185f0ffbbe6b34d53b97c31c0fc392cff0 Author: Michael Tretter Date: Fri Oct 6 17:07:05 2023 +0200 drm/bridge: samsung-dsim: update PLL reference clock The PLL requires a clock frequency in a certain platform-dependent range after the pre-divider. The reference clock for the PLL may change due to changes to it's parent clock. Thus, the frequency may be out of range or unsuited for generating the high speed clock for MIPI DSI. Try to keep the pre-devider small, and set the reference clock close to the upper limit before recalculating the PLL configuration. Use a divider with a power of two for the reference clock as this seems to work best in my tests. Reviewed-by: Marco Felsch Tested-by: Frieder Schrempf # Kontron BL i.MX8MM + Waveshare 10.1inch HDMI LCD (E) Signed-off-by: Michael Tretter Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20230818-samsung-dsim-v2-3-846603df0e0a@pengutronix.de Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230818-samsung-dsim-v2-3-846603df0e0a@pengutronix.de commit eb26c6ab2a11e6c595ee88ce30c7de9578d957aa Author: Michael Tretter Date: Fri Oct 6 17:07:04 2023 +0200 drm/bridge: samsung-dsim: reread ref clock before configuring PLL The PLL reference clock may change at runtime when its parent clock changes. For example, this may happen on the i.MX8M Nano if the reference clock is a child of the Video PLL. If the pixel clock changes, this may propagate to the Video PLL and as a side effect change the reference clock. Thus, reading the clock rate during probe is not sufficient to correctly configure the PLL for the expected hs clock. Read the actual rate of the reference clock before calculating the PLL configuration parameters. Note that the "samsung,pll-clock-frequency" is always preferred and PLL reference clock is only read from the clock tree if that device tree property is not set. Reviewed-by: Inki Dae Acked-by: Inki Dae Tested-by: Frieder Schrempf # Kontron BL i.MX8MM + Waveshare 10.1inch HDMI LCD (E) Reviewed-by: Marco Felsch Signed-off-by: Michael Tretter Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20230818-samsung-dsim-v2-2-846603df0e0a@pengutronix.de Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230818-samsung-dsim-v2-2-846603df0e0a@pengutronix.de commit 3683182a7254f728778452814abe2437a12502c3 Author: Marco Felsch Date: Fri Oct 6 17:07:03 2023 +0200 drm/bridge: samsung-dsim: add more mipi-dsi device debug information Since the MIPI configuration can be changed on demand it is very useful to print more MIPI settings during the MIPI device attach step. Signed-off-by: Marco Felsch Reviewed-by: Adam Ford #imx8mm-beacon Tested-by: Adam Ford #imx8mm-beacon Reviewed-by: Inki Dae Acked-by: Inki Dae Tested-by: Frieder Schrempf # Kontron BL i.MX8MM + Waveshare 10.1inch HDMI LCD (E) Reviewed-by: Marco Felsch Signed-off-by: Michael Tretter Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20230818-samsung-dsim-v2-1-846603df0e0a@pengutronix.de Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230818-samsung-dsim-v2-1-846603df0e0a@pengutronix.de commit f2d2200e47e942e4df16f0fe8a30aa1d91e4831a Author: Dmitry Rokosov Date: Fri Oct 6 14:41:45 2023 +0300 arm64: dts: amlogic: a1: support all i2c masters and their muxes A1 SoC family has four i2c masters: i2c0 (I2CM_A), i2c1 (I2CM_B), i2c2 (I2CM_C) and i2c3 (I2CM_D). Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20231006114145.18718-1-ddrokosov@salutedevices.com Signed-off-by: Neil Armstrong commit 5d59b6a49bb8f6841acf53affc0c4720fe7450e5 Author: Rob Herring Date: Fri Oct 6 17:46:44 2023 -0500 firmware: meson: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20231006224644.445295-1-robh@kernel.org Signed-off-by: Neil Armstrong commit b5f0e20f444cd150121e0ce912ebd3f2dabd12bc Author: David Howells Date: Mon Sep 25 13:03:09 2023 +0100 iov_iter, net: Move hash_and_copy_to_iter() to net/ Move hash_and_copy_to_iter() to be with its only caller in networking code. Signed-off-by: David Howells Link: https://lore.kernel.org/r/20230925120309.1731676-13-dhowells@redhat.com cc: Alexander Viro cc: Jens Axboe cc: Christoph Hellwig cc: Christian Brauner cc: Matthew Wilcox cc: Linus Torvalds cc: David Laight cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org cc: netdev@vger.kernel.org Signed-off-by: Christian Brauner commit 7c6f353e8a73cbb8919a20e0912021a9f9d24170 Author: David Howells Date: Mon Sep 25 13:03:08 2023 +0100 iov_iter, net: Merge csum_and_copy_from_iter{,_full}() together Move csum_and_copy_from_iter_full() out of line and then merge csum_and_copy_from_iter() into its only caller. Signed-off-by: David Howells Link: https://lore.kernel.org/r/20230925120309.1731676-12-dhowells@redhat.com cc: Alexander Viro cc: Jens Axboe cc: Christoph Hellwig cc: Christian Brauner cc: Matthew Wilcox cc: Linus Torvalds cc: David Laight cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org cc: netdev@vger.kernel.org Signed-off-by: Christian Brauner commit dc32bff195b45e8571c442954beee259e9500dac Author: David Howells Date: Mon Sep 25 13:03:07 2023 +0100 iov_iter, net: Fold in csum_and_memcpy() Fold csum_and_memcpy() in to its callers. Signed-off-by: David Howells Link: https://lore.kernel.org/r/20230925120309.1731676-11-dhowells@redhat.com cc: Alexander Viro cc: Jens Axboe cc: Christoph Hellwig cc: Christian Brauner cc: Matthew Wilcox cc: Linus Torvalds cc: David Laight cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org cc: netdev@vger.kernel.org Signed-off-by: Christian Brauner commit 6d0d419914286a1b255530812a38d992c6c4e608 Author: David Howells Date: Mon Sep 25 13:03:06 2023 +0100 iov_iter, net: Move csum_and_copy_to/from_iter() to net/ Move csum_and_copy_to/from_iter() to net code now that the iteration framework can be #included. Signed-off-by: David Howells Link: https://lore.kernel.org/r/20230925120309.1731676-10-dhowells@redhat.com cc: Alexander Viro cc: Jens Axboe cc: Christoph Hellwig cc: Christian Brauner cc: Matthew Wilcox cc: Linus Torvalds cc: David Laight cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org cc: netdev@vger.kernel.org Signed-off-by: Christian Brauner commit c9eec08bac96898573c236af9cb0ccee765684fc Author: David Howells Date: Mon Sep 25 13:03:05 2023 +0100 iov_iter: Don't deal with iter->copy_mc in memcpy_from_iter_mc() iter->copy_mc is only used with a bvec iterator and only by dump_emit_page() in fs/coredump.c so rather than handle this in memcpy_from_iter_mc() where it is checked repeatedly by _copy_from_iter() and copy_page_from_iter_atomic(), Signed-off-by: David Howells Link: https://lore.kernel.org/r/20230925120309.1731676-9-dhowells@redhat.com cc: Alexander Viro cc: Jens Axboe cc: Christoph Hellwig cc: Christian Brauner cc: Matthew Wilcox cc: Linus Torvalds cc: David Laight cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: Christian Brauner commit 03a975cbcfcd0b3da32a0d55da7d20e7bfdd1827 Author: Rob Herring Date: Fri Oct 6 17:45:07 2023 -0500 gpio: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Signed-off-by: Bartosz Golaszewski commit 06ab64a0d836ac430c5f94669710a78aa43942cb Author: Philipp Stanner Date: Wed Sep 20 14:36:13 2023 +0200 drm: vmwgfx_surface.c: copy user-array safely Currently, there is no overflow-check with memdup_user(). Use the new function memdup_array_user() instead of memdup_user() for duplicating the user-space array safely. Suggested-by: David Airlie Signed-off-by: Philipp Stanner Reviewed-by: Kees Cook Reviewed-by: Zack Rusin Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230920123612.16914-7-pstanner@redhat.com commit f37d63e219c39199a59b8b8a211412ff27192830 Author: Philipp Stanner Date: Wed Sep 20 14:36:12 2023 +0200 drm_lease.c: copy user-array safely Currently, there is no overflow-check with memdup_user(). Use the new function memdup_array_user() instead of memdup_user() for duplicating the user-space array safely. Suggested-by: David Airlie Signed-off-by: Philipp Stanner Reviewed-by: Kees Cook Reviewed-by: Zack Rusin Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230920123612.16914-6-pstanner@redhat.com commit ca0776571d3163bd03b3e8c9e3da936abfaecbf6 Author: Philipp Stanner Date: Wed Sep 20 14:36:11 2023 +0200 kernel: watch_queue: copy user-array safely Currently, there is no overflow-check with memdup_user(). Use the new function memdup_array_user() instead of memdup_user() for duplicating the user-space array safely. Suggested-by: David Airlie Signed-off-by: Philipp Stanner Reviewed-by: Kees Cook Reviewed-by: Zack Rusin Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230920123612.16914-5-pstanner@redhat.com commit 569c8d82f95eb5993c84fb61a649a9c4ddd208b3 Author: Philipp Stanner Date: Wed Sep 20 14:36:10 2023 +0200 kernel: kexec: copy user-array safely Currently, there is no overflow-check with memdup_user(). Use the new function memdup_array_user() instead of memdup_user() for duplicating the user-space array safely. Suggested-by: David Airlie Signed-off-by: Philipp Stanner Acked-by: Baoquan He Reviewed-by: Kees Cook Reviewed-by: Zack Rusin Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230920123612.16914-4-pstanner@redhat.com commit 313ebe47d75558511aa1237b6e35c663b5c0ec6f Author: Philipp Stanner Date: Wed Sep 20 14:36:09 2023 +0200 string.h: add array-wrappers for (v)memdup_user() Currently, user array duplications are sometimes done without an overflow check. Sometimes the checks are done manually; sometimes the array size is calculated with array_size() and sometimes by calculating n * size directly in code. Introduce wrappers for arrays for memdup_user() and vmemdup_user() to provide a standardized and safe way for duplicating user arrays. This is both for new code as well as replacing usage of (v)memdup_user() in existing code that uses, e.g., n * size to calculate array sizes. Suggested-by: David Airlie Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko Reviewed-by: Kees Cook Reviewed-by: Zack Rusin Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230920123612.16914-3-pstanner@redhat.com commit 71ffa1bcd7a0b8331c32a81ce90290daaf17fce2 Author: Dmitry Antipov Date: Wed Oct 4 12:24:15 2023 +0300 wifi: rtlwifi: use unsigned long for bt_coexist_8723 timestamp Since 'bt_inq_page_start_time' of 'struct bt_coexist_8723' is in jiffies, prefer 'unsigned long' over 'u32' to avoid possible truncation in 'rtl8723e_dm_bt_inq_page_monitor()' and adjust related code. Found with clang's -Wshorten-64-to-32, compile tested only. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004092418.73337-1-dmantipov@yandex.ru commit 14a5b11532e850e7a748cbb4c74ac5c5abf18211 Author: Zong-Zhe Yang Date: Wed Oct 4 16:50:51 2023 +0800 wifi: rtw88: 8821c: tweak CCK TX filter setting for SRRC regulation Since new criterion released by SRRC (State Radio Regulatory Commission, China) is stricter, we have adjusted TX power limit tables for it. But, due to RTL8821C HW characteristic, we still need to use specific parameter in CCK TX filter when set channel to avoid violations in some corner cases. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004085051.205683-6-pkshih@realtek.com commit 02f697ab2213391fdec92ff51847a00e60fe91c9 Author: Zong-Zhe Yang Date: Wed Oct 4 16:50:50 2023 +0800 wifi: rtw88: regd: update regulatory map to R64-R42 Sync Realtek Regulatory R42 and Realtek Channel Plan R64. Start to configure with Realtek regd CHILE, CN, UK, QATAR, UKRAINE. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004085051.205683-5-pkshih@realtek.com commit 9c2651f6a9ba0634b59aa43b0648c7cdd68de34e Author: Zong-Zhe Yang Date: Wed Oct 4 16:50:49 2023 +0800 wifi: rtw88: 8822c: update TX power limit to V70 Update TX power limit to parameter package V70 * tweak values of CN for its new regulation * configure values for QATAR, UK Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004085051.205683-4-pkshih@realtek.com commit 5995ec73ef2cc051b4b8d15fe06dd9a7cf3a75e3 Author: Zong-Zhe Yang Date: Wed Oct 4 16:50:48 2023 +0800 wifi: rtw88: 8821c: update TX power limit to V67 Update TX power limit to parameter package V67 * configure values for MEXICO, CN, QATAR, UK Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004085051.205683-3-pkshih@realtek.com commit 0c1784cbe62fe4a0dc14b7d36f78a26a647b003b Author: Zong-Zhe Yang Date: Wed Oct 4 16:50:47 2023 +0800 wifi: rtw88: regd: configure QATAR and UK In newer Realtek parameter package, Realtek regd can configure QATAR and UK individually. So, driver extends the regd enum. Besides, driver configure alternative of them which will be referenced when parameter package of a chip doesn't consider QATAR and UK individually. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004085051.205683-2-pkshih@realtek.com commit ea2274ab0b18549dbf0e755e41d8c5e8b5232dc3 Author: Felipe Negrelli Wolter Date: Wed Oct 4 14:30:39 2023 +0200 wifi: wfx: fix case where rates are out of order When frames are sent over the air, the device always applies the data rates in descending order. The driver assumed Minstrel also provided rate in descending order. However, in some cases, Minstrel can a choose a fallback rate greater than the primary rate. In this case, the two rates was inverted, the device try highest rate first and we get many retries. Since the device always applies rates in descending order, the workaround is to drop the rate when it higher than its predecessor in the rate list. Thus [ 4, 5, 3 ] becomes [ 4, 3 ]. This patch has been tested in isolated room with a series of attenuators. Here are the Minstrel statistics with 80dBm of attenuation: Without the fix: best ____________rate__________ ____statistics___ _____last____ ______sum-of________ mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts] HT20 LGI 1 S MCS0 0 1477 5.6 5.2 82.7 3 0 0 3 4 HT20 LGI 1 MCS1 1 738 10.6 0.0 0.0 0 0 0 0 1 HT20 LGI 1 D MCS2 2 492 14.9 13.5 81.5 5 0 0 5 9 HT20 LGI 1 C MCS3 3 369 18.8 17.6 84.3 5 0 0 76 96 HT20 LGI 1 A P MCS4 4 246 25.4 22.4 79.5 5 0 0 11268 14026 HT20 LGI 1 B S MCS5 5 185 30.7 19.7 57.7 5 8 9 3918 9793 HT20 LGI 1 MCS6 6 164 33.0 0.0 0.0 5 0 0 6 102 HT20 LGI 1 MCS7 7 148 35.1 0.0 0.0 0 0 0 0 44 With the fix: best ____________rate__________ ____statistics___ _____last____ ______sum-of________ mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob)] [retry|suc|att] [#success | #attempts] HT20 LGI 1 S MCS0 0 1477 5.6 1.8 28.6 1 0 0 1 5 HT20 LGI 1 DP MCS1 1 738 10.6 9.7 82.6 4 0 0 14 34 HT20 LGI 1 MCS2 2 492 14.9 9.2 55.4 5 0 0 52 77 HT20 LGI 1 B S MCS3 3 369 18.8 15.6 74.9 5 1 1 417 554 HT20 LGI 1 A MCS4 4 246 25.4 16.7 59.2 5 1 1 13812 17951 HT20 LGI 1 C S MCS5 5 185 30.7 14.0 41.0 5 1 5 57 640 HT20 LGI 1 MCS6 6 164 33.0 0.0 0.0 0 0 1 0 48 HT20 LGI 1 S MCS7 7 148 35.1 0.0 0.0 0 0 0 0 36 We can notice the device try now to send with lower rates (and high success rates). At the end, we measured 20-25% better throughput with this patch. Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames") Tested-by: Olivier Souloumiac Tested-by: Alexandr Suslenko Reported-by: Alexandr Suslenko Co-developed-by: Jérôme Pouiller Signed-off-by: Jérôme Pouiller Signed-off-by: Felipe Negrelli Wolter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004123039.157112-1-jerome.pouiller@silabs.com commit fc627dad3f01c98e4bd424195140b2dccf204e54 Author: Jérôme Pouiller Date: Wed Oct 4 19:28:43 2023 +0200 wifi: wfx: implement wfx_remain_on_channel() With some conditions, the device is able to send/receive frames during scan operation. So, it is possible to use it implement the "remain on channel" feature. We just ask for a passive scan (without sending any probe request) on one channel. This architecture allows to leverage some interesting features: - if the device is AP, the device switches channel just after the next beacon and the beacons are stopped during the off-channel interval. - if the device is connected, it advertises it is asleep before to switch channel (so the AP should stop to try to send data) Signed-off-by: Jérôme Pouiller Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004172843.195332-9-jerome.pouiller@silabs.com commit f7385a20249ea63b521554bf4bd06b3401c19a55 Author: Jérôme Pouiller Date: Wed Oct 4 19:28:42 2023 +0200 wifi: wfx: allow to send frames during ROC Until now, all the traffic was blocked during scan operation. However, scan operation is going to be used to implement Remain On Channel (ROC). In this case, special frames (marked with IEEE80211_TX_CTL_TX_OFFCHAN) must be sent during the operation. These frames need to be sent on the virtual interface #2. Until now, this interface was only used by the device for internal purpose. But since API 3.9, it can be used to send data during scan operation (we hijack the scan process to implement ROC). Thus, we need to change a bit the way we match the frames with the interface. Fortunately, the frames received during the scan are marked with the correct interface number. So there is no change to do on this part. Signed-off-by: Jérôme Pouiller Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004172843.195332-8-jerome.pouiller@silabs.com commit 04106ec5bb025f275d0e18553c253adf12a0cc8a Author: Jérôme Pouiller Date: Wed Oct 4 19:28:41 2023 +0200 wifi: wfx: scan_lock is global to the device Currently, one scan_lock is associated to each vif. However, concurrent scan on vifs is explicitly prohibited by the device. Currently, scan_lock is associated with a vif but it is always locked with conf_mutex (there is a case where conf_mutex is not associated to scan_lock but scan_lock is tested on all interfaces). So concurrent scan on vifs cannot happen. So, this patch relocate scan_lock to the device and simplify the code. Signed-off-by: Jérôme Pouiller Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004172843.195332-7-jerome.pouiller@silabs.com commit f091bcb62dc6d38ba7c024f083b78e3907a4f079 Author: Jérôme Pouiller Date: Wed Oct 4 19:28:40 2023 +0200 wifi: wfx: simplify exclusion between scan and Rx filters The device ignore the rx filters during the scan operation. wfx_configure_filter() acquires scan_lock to reflect this restriction. However, it is not really necessary since mac80211 don't try to configure Rx filters during scan. However, the things are changing. The scan operation is going to be used to implement remain-on-channel. In this case, wfx_configure_filter() can be called during the scan. Currently, this scenario generate a delay that end with a timeout in the upper layers. For the final user, some scenario of the EasyConnect specification end with a failure. So, avoid acquiring the scan_lock and just return. Signed-off-by: Jérôme Pouiller Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004172843.195332-6-jerome.pouiller@silabs.com commit fc5cb24fd50e440cb5bb9ac024dc00765fb226db Author: Jérôme Pouiller Date: Wed Oct 4 19:28:39 2023 +0200 wifi: wfx: introduce hif_scan_uniq() Like hof_scan(), hif_scan_uniq() invoke HIF_SCAN. However, it only allows to probe one channel and disable probe requests. It works very well to implement Remain-On-Channel. Signed-off-by: Jérôme Pouiller Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004172843.195332-5-jerome.pouiller@silabs.com commit cf0cc05c8c231c075385cd906460543b03d76167 Author: Jérôme Pouiller Date: Wed Oct 4 19:28:38 2023 +0200 wifi: wfx: move wfx_skb_*() out of the header file There is no real reasons to keep these function in the header file. Signed-off-by: Jérôme Pouiller Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004172843.195332-4-jerome.pouiller@silabs.com commit 94c104d518306626b254d927ccf46253fb4b084c Author: Jérôme Pouiller Date: Wed Oct 4 19:28:37 2023 +0200 wifi: wfx: relocate wfx_rate_mask_to_hw() wfx_rate_mask_to_hw() is only used in hif_tx.c. So relocate it into hif_tx.c and mark it static. Signed-off-by: Jérôme Pouiller Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004172843.195332-3-jerome.pouiller@silabs.com commit 8b27aed225cadaee6a8a263ae621d7adbe3b12d0 Author: Jérôme Pouiller Date: Wed Oct 4 19:28:36 2023 +0200 wifi: wfx: fix power_save setting when AP is stopped The WF200 allow to start two network interfaces (one AP, one station) on two different channels. Since magic does not exist, it only works if the station interface enables power save. Thus, the driver detects this case and enforce power save as necessary. This patch fixes the case where the AP interface is stopped and it is no more necessary to enforce power saving on the station interface. Signed-off-by: Jérôme Pouiller Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231004172843.195332-2-jerome.pouiller@silabs.com commit 8a58cd577f019dee00bdb0ffa52e38aab44154e4 Author: Peng Fan Date: Sat Oct 7 20:55:50 2023 +0800 gpio: vf610: update comment for i.MX8ULP and i.MX93 legacy compatibles i.MX8ULP and i.MX93 legacy compatible strings use dual regs, while new compatible strings use one reg. The "support old compatible strings" is not clear to reflect the fact, so update it. Suggested-by: Marco Felsch Signed-off-by: Peng Fan Signed-off-by: Bartosz Golaszewski commit 164f1842d993e75925a68461722bf8130cbbe1b0 Merge: 089482a06b74a 453a62a3ee65a Author: Kalle Valo Date: Mon Oct 9 09:45:08 2023 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v6.7. Major changes: ath12k * read board data variant name from SMBIOS commit 089482a06b74a40d45773b1871182e8f04be026b Merge: 48533eca606ef bd94d501c0c99 Author: Kalle Valo Date: Mon Oct 9 09:35:41 2023 +0300 Merge tag 'mt76-for-kvalo-2023-09-30' of https://github.com/nbd168/wireless mt76 patches for 6.7 * mt7603/mt7628 stability improvements * fixes * new driver for mt7925 commit 2b17b489e47a956c8e93c8f1bcabb0343c851d90 Author: Geoffrey D. Bennett Date: Sat Oct 7 22:03:04 2023 +1030 ALSA: scarlett2: Add Focusrite Clarett 2Pre and 4Pre USB support It has been confirmed that all devices in the Focusrite Clarett USB series work the same as the devices in the Clarett+ series. Add the missing PIDs to enable support for the Clarett 2Pre and 4Pre USB. Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/ZSFB8EVTG1PK1eq/@m.b4.vu Signed-off-by: Takashi Iwai commit 9f895354cc3cf4fbff21c922a5721691ed40589d Author: Frank Li Date: Wed Oct 4 10:32:28 2023 -0400 MAINTAINERS: Add entries for NXP(Freescale) eDMA drivers Add the MAINTAINERS entries for NXP(Freescale) eDMA drivers Acked-by: Randy Dunlap Signed-off-by: Frank Li Link: https://lore.kernel.org/r/20231004143228.839288-1-Frank.Li@nxp.com Signed-off-by: Vinod Koul commit 381fdb73d1e2a48244de7260550e453d1003bb8e Author: Kees Cook Date: Fri Oct 6 21:09:28 2023 -0700 randstruct: Fix gcc-plugin performance mode to stay in group The performance mode of the gcc-plugin randstruct was shuffling struct members outside of the cache-line groups. Limit the range to the specified group indexes. Cc: linux-hardening@vger.kernel.org Cc: stable@vger.kernel.org Reported-by: Lukas Loidolt Closes: https://lore.kernel.org/all/f3ca77f0-e414-4065-83a5-ae4c4d25545d@student.tuwien.ac.at Fixes: 313dd1b62921 ("gcc-plugins: Add the randstruct plugin") Signed-off-by: Kees Cook commit c5225cd073c65a6d7e8e311ec0114792a671982a Author: Kees Cook Date: Fri Sep 22 10:53:51 2023 -0700 mailbox: zynqmp: Annotate struct zynqmp_ipi_pdata with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct zynqmp_ipi_pdata. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Jassi Brar Cc: Michal Simek Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: Justin Stitt Reviewed-by: "Gustavo A. R. Silva" Acked-by: Michal Simek Link: https://lore.kernel.org/r/20230922175351.work.018-kees@kernel.org Signed-off-by: Kees Cook commit 86748637bff4d1fd1c4fb3c7e5aedf0baca44a93 Author: Kees Cook Date: Fri Sep 22 10:53:41 2023 -0700 drivers: thermal: tsens: Annotate struct tsens_priv with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct tsens_priv. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Andy Gross Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: Amit Kucheria Cc: Thara Gopinath Cc: "Rafael J. Wysocki" Cc: Daniel Lezcano Cc: Zhang Rui Cc: linux-arm-msm@vger.kernel.org Cc: linux-pm@vger.kernel.org Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175341.work.919-kees@kernel.org Signed-off-by: Kees Cook commit 0f768682452867588d640b1bc1a5afdd1b59c584 Author: Kees Cook Date: Fri Sep 22 10:51:32 2023 -0700 irqchip/imx-intmux: Annotate struct intmux_data with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct intmux_data. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Thomas Gleixner Cc: Marc Zyngier Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175131.work.718-kees@kernel.org Signed-off-by: Kees Cook commit a48e1f656b3c9b8192b6ca6fc92ef4daa30535fb Author: Kees Cook Date: Fri Sep 22 10:51:21 2023 -0700 KVM: Annotate struct kvm_irq_routing_table with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct kvm_irq_routing_table. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Paolo Bonzini Cc: kvm@vger.kernel.org Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175121.work.660-kees@kernel.org Signed-off-by: Kees Cook commit 51a71ab21f61ceb104aad2c9d29cd7e445adf1c5 Author: Kees Cook Date: Fri Sep 22 10:51:02 2023 -0700 virt: acrn: Annotate struct vm_memory_region_batch with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct vm_memory_region_batch. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Fei Li Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175102.work.020-kees@kernel.org Signed-off-by: Kees Cook commit 4a530cb932af31b0c919a109bc107dd186653381 Author: Kees Cook Date: Fri Sep 22 10:50:53 2023 -0700 hwmon: Annotate struct gsc_hwmon_platform_data with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct gsc_hwmon_platform_data. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Tim Harvey Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175053.work.564-kees@kernel.org Signed-off-by: Kees Cook commit 5ac388db27c443dadfbb0b8b23fa7ccf429d901a Author: Sindhu Devale Date: Wed Oct 4 10:13:06 2023 -0500 RDMA/irdma: Add support to re-register a memory region Add support for reregister MR verb API by doing a de-register followed by a register MR with the new attributes. Reuse resources like iwmr handle and HW stag where possible. Signed-off-by: Sindhu Devale Signed-off-by: Shiraz Saleem Link: https://lore.kernel.org/r/20231004151306.228-1-shiraz.saleem@intel.com Signed-off-by: Leon Romanovsky commit cd8c732ce1a561d62e22a9d8cf5e4737d66b7d5e Author: Miquel Raynal Date: Thu Oct 5 18:02:37 2023 +0200 dmaengine: xilinx: xdma: Support cyclic transfers In order to use this dmaengine with sound devices, let's add cyclic transfers support. Most of the code is reused from the existing scatter-gather implementation, only the final linking between descriptors, the control fields (to trigger interrupts more often) and the interrupt handling are really different. This controller supports up to 32 adjacent descriptors, we assume this is way more than enough for the purpose of cyclic transfers and limit to 32 the number of cycled descriptors. This way, we simplify a lot the overall handling of the descriptors. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20231005160237.2804238-4-miquel.raynal@bootlin.com Signed-off-by: Vinod Koul commit 0db2b6717c5ed1471a639f3af2f650eb9010c732 Author: Miquel Raynal Date: Thu Oct 5 18:02:36 2023 +0200 dmaengine: xilinx: xdma: Prepare the introduction of cyclic transfers In order to reduce and clarify the diff when introducing cyclic transfers support, let's first prepare the driver a bit. There is no functional change. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20231005160237.2804238-3-miquel.raynal@bootlin.com Signed-off-by: Vinod Koul commit c48de45d4cefc5a2f0d0e4101c39884326ac704c Author: Rob Herring Date: Fri Oct 6 16:38:35 2023 -0500 dmaengine: Drop unnecessary of_match_device() calls If probe is reached, we've already matched the device and in the case of DT matching, the struct device_node pointer will be set. Therefore, there is no need to call of_match_device() in probe. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006213835.332848-1-robh@kernel.org Signed-off-by: Vinod Koul commit a67ba97dfb30486deb4661f770b954387acc898d Author: Rob Herring Date: Fri Oct 6 16:38:43 2023 -0500 dmaengine: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006213844.333027-1-robh@kernel.org Signed-off-by: Vinod Koul commit 0481291f0ccbc5147635cf0eb108f9fe5a05ee7d Author: Christophe JAILLET Date: Sat Oct 7 13:13:10 2023 +0200 dmaengine: pxa_dma: Annotate struct pxad_desc_sw with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). To do so, the code needs a little shuffling related to how hw_desc is used and nb_desc incremented. The one by one increment is needed for the error handling path, calling pxad_free_desc(), to work correctly. So, add a new intermediate variable, desc, to store the result of the dma_pool_alloc() call. Signed-off-by: Christophe JAILLET Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/1c9ef22826f449a3756bb13a83494e9fe3e0be8b.1696676782.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit 83c761f568733277ce1f7eb9dc9e890649c29a8c Author: Christophe JAILLET Date: Sat Oct 7 13:13:09 2023 +0200 dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() If pxad_alloc_desc() fails on the first dma_pool_alloc() call, then sw_desc->nb_desc is zero. In such a case pxad_free_desc() is called and it will BUG_ON(). Remove this erroneous BUG_ON(). It is also useless, because if "sw_desc->nb_desc == 0", then, on the first iteration of the for loop, i is -1 and the loop will not be executed. (both i and sw_desc->nb_desc are 'int') Fixes: a57e16cf0333 ("dmaengine: pxa: add pxa dmaengine driver") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/c8fc5563c9593c914fde41f0f7d1489a21b45a9a.1696676782.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit 3e7807d5a7d770c59837026e9967fe99ad043174 Author: Josef Bacik Date: Wed Oct 4 22:55:32 2023 -0400 fscrypt: rename fscrypt_info => fscrypt_inode_info We are going to track per-extent information, so it'll be necessary to distinguish between inode infos and extent infos. Rename fscrypt_info to fscrypt_inode_info, adjusting any lines that now exceed 80 characters. Signed-off-by: Josef Bacik [ebiggers: rebased onto fscrypt tree, renamed fscrypt_get_info(), adjusted two comments, and fixed some lines over 80 characters] Link: https://lore.kernel.org/r/20231005025757.33521-1-ebiggers@kernel.org Reviewed-by: Neal Gompa Signed-off-by: Eric Biggers commit e50fa1a5ac52e2a2ec09b8028bdb1c4bf9166cbc Author: Rob Herring Date: Fri Oct 6 16:38:54 2023 -0500 PM / devfreq: exynos-ppmu: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Link: https://lore.kernel.org/all/20231006213854.333261-1-robh@kernel.org/ Signed-off-by: Rob Herring Signed-off-by: Chanwoo Choi commit 419827409834f4e6602456ae23d4557d541adcbf Author: Sascha Hauer Date: Tue Jul 4 11:32:21 2023 +0200 PM / devfreq: rockchip-dfi: dfi store raw values in counter struct When adding perf support to the DFI driver the perf part will need the raw counter values, so move the fixed * 4 factor to rockchip_dfi_get_event(). Link: https://lore.kernel.org/lkml/20230704093242.583575-6-s.hauer@pengutronix.de/ Reviewed-by: Jonathan Cameron Reviewed-by: Sebastian Reichel Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit 559dc2876c0c46850dfed5c2a810d17b259e4bd9 Author: Sascha Hauer Date: Tue Jul 4 11:32:20 2023 +0200 PM / devfreq: rockchip-dfi: Add SoC specific init function Move the RK3399 specifics to a SoC specific init function to make the way free for supporting other SoCs later. Link: https://lore.kernel.org/lkml/20230704093242.583575-5-s.hauer@pengutronix.de/ Reviewed-by: Sebastian Reichel Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit 9325b3ec923ee42799879cb4d4c5aaffa49e7829 Author: Sascha Hauer Date: Tue Jul 4 11:32:19 2023 +0200 PM / devfreq: rockchip-dfi: use consistent name for private data struct The variable name for the private data struct is 'info' in some functions and 'data' in others. Both names do not give a clue what type the variable has, so consistently use 'dfi'. Link: https://lore.kernel.org/lkml/20230704093242.583575-4-s.hauer@pengutronix.de/ Reviewed-by: Heiko Stuebner Reviewed-by: Jonathan Cameron Reviewed-by: Sebastian Reichel Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit bbf479005436d5e33eea25e077bb724358fe8848 Author: Sascha Hauer Date: Tue Jul 4 11:32:18 2023 +0200 PM / devfreq: rockchip-dfi: Embed desc into private data struct No need for an extra allocation, just embed the struct devfreq_event_desc into the private data struct. Link: https://lore.kernel.org/lkml/20230704093242.583575-3-s.hauer@pengutronix.de/ Reviewed-by: Heiko Stuebner Reviewed-by: Jonathan Cameron Reviewed-by: Sebastian Reichel Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit 1e0731c05c985deb68a97fa44c1adcd3305dda90 Author: Sascha Hauer Date: Tue Jul 4 11:32:17 2023 +0200 PM / devfreq: rockchip-dfi: Make pmu regmap mandatory As a matter of fact the regmap_pmu already is mandatory because it is used unconditionally in the driver. Bail out gracefully in probe() rather than crashing later. Link: https://lore.kernel.org/lkml/20230704093242.583575-2-s.hauer@pengutronix.de/ Fixes: b9d1262bca0af ("PM / devfreq: event: support rockchip dfi controller") Reviewed-by: Sebastian Reichel Signed-off-by: Sascha Hauer Signed-off-by: Chanwoo Choi commit 8b3bd6ffbc6475a7dc92c6d6021d49b555301c01 Author: Manivannan Sadhasivam Date: Tue Oct 3 16:42:28 2023 +0530 PM / devfreq: Switch to dev_pm_opp_find_freq_{ceil/floor}_indexed() APIs Some devfreq consumers like UFS driver need to work with multiple clocks through the OPP framework. For this reason, OPP framework exposes the _indexed() APIs for finding the floor/ceil of the supplied frequency of the indexed clock. So let's use them in the devfreq driver. Currently, the clock index of 0 is used which works fine for multiple as well as single clock. Link: https://lore.kernel.org/all/20231003111232.42663-3-manivannan.sadhasivam@linaro.org/ Acked-by: Chanwoo Choi Signed-off-by: Manivannan Sadhasivam Signed-off-by: Chanwoo Choi commit d2805601988fb0b41247c95dcb4b8b8455921978 Author: Mark Tseng Date: Fri Aug 18 10:17:41 2023 +0800 PM / devfreq: mediatek: protect oop in critical session mtk_ccifreq_opp_notifier is reenter function when policy0 / policy6 change freq, so mutex_lock should protect all OPP event. Link: https://lore.kernel.org/lkml/20230818021741.6173-1-chun-jen.tseng@mediatek.com/T/ Signed-off-by: Mark Tseng Signed-off-by: Chanwoo Choi commit 6be6ece92050fed3229a3ffdd93d2604b9bc66dd Author: Dmitry Baryshkov Date: Wed Aug 2 13:04:25 2023 +0300 drm/msm/dpu: stop using raw IRQ indices in the kernel traces In preparation to reworking IRQ indcies, stop using raw indices in kernel traces. Instead use a pair of register index and bit. This corresponds closer to the values in HW catalog. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/550935/ Link: https://lore.kernel.org/r/20230802100426.4184892-8-dmitry.baryshkov@linaro.org commit 6893199183f836e1ff452082f0f9d068364b2f17 Author: Dmitry Baryshkov Date: Wed Aug 2 13:04:24 2023 +0300 drm/msm/dpu: stop using raw IRQ indices in the kernel output In preparation to reworking IRQ indcies, stop using raw IRQ indices in kernel output (both printk and debugfs). Instead use a pair of register index and bit. This corresponds closer to the values in HW catalog. Signed-off-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Patchwork: https://patchwork.freedesktop.org/patch/550933/ Link: https://lore.kernel.org/r/20230802100426.4184892-7-dmitry.baryshkov@linaro.org commit 56acb1b620e263d3fed8f11f71bf2ab7ce1cae5b Author: Dmitry Baryshkov Date: Wed Aug 2 13:04:23 2023 +0300 drm/msm/dpu: make the irq table size static The size of the irq table is static, it has MDP_INTR_MAX * 32 interrupt entries. Provide the fixed length and drop struct_size() statement. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/550927/ Link: https://lore.kernel.org/r/20230802100426.4184892-6-dmitry.baryshkov@linaro.org commit ea4842ed62f3556cf0a90f19d911ee03a4d0c844 Author: Dmitry Baryshkov Date: Wed Aug 2 13:04:22 2023 +0300 drm/msm/dpu: add helper to get IRQ-related data In preparation to reworking IRQ indices, move irq_tbl access to a separate helper. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/550931/ Link: https://lore.kernel.org/r/20230802100426.4184892-5-dmitry.baryshkov@linaro.org commit a65264833690d1280b901e3fe8e2825a44b3502c Author: Dmitry Baryshkov Date: Wed Aug 2 13:04:21 2023 +0300 drm/msm/dpu: extract dpu_core_irq_is_valid() helper In preparation to reworking IRQ indices, move irq_idx validation to a separate helper. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/550929/ Link: https://lore.kernel.org/r/20230802100426.4184892-4-dmitry.baryshkov@linaro.org commit e75e45c25b66ae9a78fa2476df0bf99ad80f33f9 Author: Dmitry Baryshkov Date: Wed Aug 2 13:04:20 2023 +0300 drm/msm/dpu: remove irq_idx argument from IRQ callbacks There is no point in passing the IRQ index to IRQ callbacks, no function uses that. Drop it at last. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/550925/ Link: https://lore.kernel.org/r/20230802100426.4184892-3-dmitry.baryshkov@linaro.org commit bcefd1bf63b1ec9bb08067021cf47f0fad96f395 Author: Sudeep Holla Date: Thu Oct 5 15:45:10 2023 +0100 firmware: arm_ffa: Upgrade the driver version to v1.1 With quite a few v1.1 features supported, we can bump the driver version to v1.1 now. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-17-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit 113580530ee7dc61e668b641d657920734533b9f Author: Sudeep Holla Date: Thu Oct 5 15:45:09 2023 +0100 firmware: arm_ffa: Update memory descriptor to support v1.1 format Update memory transaction descriptor structure to accommodate couple of new entries in v1.1 which were previously marked reserved and MBZ(must be zero). It also removes the flexible array member ep_mem_access in the memory transaction descriptor structure as it need not be at fixed offset. Also update ffa_mem_desc_offset() accessor to handle both old and new formats of memory transaction descriptors. The updated ffa_mem_region structure aligns with new format in v1.1 and hence the driver/user must take care not to use members beyond and including ep_mem_offset when using the old format. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-16-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit e4607b84c6819bb59c48063ed41eee1fc7f736a0 Author: Sudeep Holla Date: Thu Oct 5 15:45:08 2023 +0100 firmware: arm_ffa: Switch to using ffa_mem_desc_offset() accessor In preparation to add support to the new memory transaction descriptor, the ep_mem_access member needs to be removed and hence even the macro COMPOSITE_OFFSET(). Let us switch to using the new ffa_mem_desc_offset() accessor in ffa_setup_and_transmit(). This will enable adding the support for new format transparently without any changes here again. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-15-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit 76cf932c95b9e7c07b065b5c71e56957e2826ae2 Author: Sudeep Holla Date: Thu Oct 5 15:45:07 2023 +0100 KVM: arm64: FFA: Remove access of endpoint memory access descriptor array FF-A v1.1 removes the fixed location of endpoint memory access descriptor array within the memory transaction descriptor structure. In preparation to remove the ep_mem_access member from the ffa_mem_region structure, provide the accessor to fetch the offset and use the same in FF-A proxy implementation. The accessor take the FF-A version as the argument from which the memory access descriptor format can be determined. v1.0 uses the old format while v1.1 onwards use the new format specified in the v1.1 specification. Cc: Oliver Upton Cc: Will Deacon Cc: Quentin Perret Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-14-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit 65a8a3dd3b95f0310da76f529f86287fefed6a28 Author: Peng Fan Date: Wed Oct 4 07:42:24 2023 +0800 clk: scmi: Add support for clock {set,get}_parent SCMI v3.2 adds set/get parent clock commands, so update the SCMI clock driver to support them. Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20231004-scmi-clock-v3-v5-2-1b8a1435673e@nxp.com Signed-off-by: Sudeep Holla commit 77bbfe607b1d306c88bf96fed00c030f6bf462f1 Author: Peng Fan Date: Wed Oct 4 07:42:23 2023 +0800 firmware: arm_scmi: Add support for clock parents SCMI v3.2 spec introduces CLOCK_POSSIBLE_PARENTS_GET, CLOCK_PARENT_SET and CLOCK_PARENT_GET. Add support for these to enable clock parents and use them in the clock driver. Reviewed-by: Cristian Marussi Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20231004-scmi-clock-v3-v5-1-1b8a1435673e@nxp.com Signed-off-by: Sudeep Holla commit 3537a75e73f3420614a358d0c8b390ea483cc87d Author: Sudeep Holla Date: Wed Oct 4 20:36:00 2023 +0100 clk: scmi: Free scmi_clk allocated when the clocks with invalid info are skipped Add the missing devm_kfree() when we skip the clocks with invalid or missing information from the firmware. Cc: Cristian Marussi Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Fixes: 6d6a1d82eaef ("clk: add support for clocks provided by SCMI") Link: https://lore.kernel.org/r/20231004193600.66232-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit 908af696c513bdd028fb16499f12febc0dc48acd Author: Rob Herring Date: Fri Oct 6 17:46:50 2023 -0500 firmware: arm_scpi: Use device_get_match_data() Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231006224650.445424-1-robh@kernel.org Signed-off-by: Sudeep Holla commit 19537e125cc7cf2da43a606f5bcebbe0c9aea4cc Author: Florian Fainelli Date: Thu Oct 5 11:17:47 2023 -0700 net: bcmgenet: Remove custom ndo_poll_controller() The driver gained a .ndo_poll_controller() at a time where the TX cleaning process was always done from NAPI which makes this unnecessary. See commit ac3d9dd034e5 ("netpoll: make ndo_poll_controller() optional") for more background. Signed-off-by: Florian Fainelli Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 4e1e21117e7e1275477ba80e634c769a511249bd Author: Kees Cook Date: Fri Oct 6 13:17:07 2023 -0700 pinctrl: samsung: Annotate struct exynos_muxed_weint_data with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct exynos_muxed_weint_data. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. Cc: Tomasz Figa Cc: Krzysztof Kozlowski Cc: Sylwester Nawrocki Cc: Alim Akhtar Cc: Linus Walleij Cc: "Gustavo A. R. Silva" Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-gpio@vger.kernel.org Cc: linux-hardening@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20231006201707.work.405-kees@kernel.org Signed-off-by: Krzysztof Kozlowski commit a56d5551e1993ca84dd0c69df5a3d8223d13fb5f Author: Kees Cook Date: Fri Oct 6 13:17:54 2023 -0700 perf/x86/rapl: Annotate 'struct rapl_pmus' with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS=y (for array indexing) and CONFIG_FORTIFY_SOURCE=y (for strcpy/memcpy-family functions). Found with Coccinelle: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Add __counted_by for 'struct rapl_pmus'. No change in functionality intended. Signed-off-by: Kees Cook Signed-off-by: Ingo Molnar Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20231006201754.work.473-kees@kernel.org commit f49449fbc21e7e9550a5203902d69c8ae7dfd918 Author: Hardik Gajjar Date: Fri Oct 6 17:56:46 2023 +0200 usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach This patch replaces the usage of netif_stop_queue with netif_device_detach in the u_ether driver. The netif_device_detach function not only stops all tx queues by calling netif_tx_stop_all_queues but also marks the device as removed by clearing the __LINK_STATE_PRESENT bit. This change helps notify user space about the disconnection of the device more effectively, compared to netif_stop_queue, which only stops a single transmit queue. Signed-off-by: Hardik Gajjar Link: https://lore.kernel.org/r/20231006155646.12938-1-hgajjar@de.adit-jv.com Signed-off-by: Greg Kroah-Hartman commit 0f5aa1b01263b8b621bc4f031a1f2983ef8517b7 Author: Dan Carpenter Date: Thu Oct 5 17:01:05 2023 +0300 usb: usbtest: fix a type promotion bug The "len" here is sometimes negative error codes from usb_get_descriptor(), so we don't want to type promote them to unsigned long. This bug pre-dates the invention of git. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/506f7935-2cba-41d9-ab5d-ddb6ad6320bd@moroto.mountain Signed-off-by: Greg Kroah-Hartman commit b8aaf639b403f01d132c9ac1e906c45debfb0218 Author: Andy Shevchenko Date: Fri Oct 6 19:43:12 2023 +0300 usbip: Use platform_device_register_full() The code to create the child platform device is essentially the same as what platform_device_register_full() does, so change over to use that same function to reduce duplication. Signed-off-by: Andy Shevchenko Acked-by: Shuah Khan Link: https://lore.kernel.org/r/20231006164312.3528524-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 97475763484245916735a1aa9a3310a01d46b008 Author: Jonas Blixt Date: Thu Jun 15 11:28:10 2023 +0200 USB: usbip: fix stub_dev hub disconnect If a hub is disconnected that has device(s) that's attached to the usbip layer the disconnect function might fail because it tries to release the port on an already disconnected hub. Fixes: 6080cd0e9239 ("staging: usbip: claim ports used by shared devices") Signed-off-by: Jonas Blixt Acked-by: Shuah Khan Link: https://lore.kernel.org/r/20230615092810.1215490-1-jonas.blixt@actia.se Signed-off-by: Greg Kroah-Hartman commit 53412dc2905401207f264dc30890f6b9e41524a6 Author: Jason-JH.Lin Date: Wed Aug 9 20:57:22 2023 +0800 drm/mediatek: Fix iommu fault during crtc enabling The difference between drm_atomic_helper_commit_tail() and drm_atomic_helper_commit_tail_rpm() is drm_atomic_helper_commit_tail() will commit plane first and then enable crtc, drm_atomic_helper_commit_tail_rpm() will enable crtc first and then commit plane. Before mediatek-drm enables crtc, the power and clk required by OVL have not been turned on, so the commit plane cannot be committed before crtc is enabled. That means OVL layer should not be enabled before crtc is enabled. Therefore, the atomic_commit_tail of mediatek-drm is hooked with drm_atomic_helper_commit_tail_rpm(). Another reason is that the plane_state of drm_atomic_state is not synchronized with the plane_state stored in mtk_crtc during crtc enablng, so just set all planes to disabled. Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230809125722.24112-3-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 3ec71e05ae6e7f46512e568ed81c92be589003dd Author: Jason-JH.Lin Date: Wed Aug 9 20:57:21 2023 +0800 drm/mediatek: Fix iommu fault by swapping FBs after updating plane state According to the comment in drm_atomic_helper_async_commit(), we should make sure FBs have been swapped, so that cleanups in the new_state performs a cleanup in the old FB. So we should move swapping FBs after calling mtk_plane_update_new_state(), to avoid using the old FB which could be freed. Fixes: 1a64a7aff8da ("drm/mediatek: Fix cursor plane no update") Signed-off-by: Jason-JH.Lin Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu Reviewed-by: Alexandre Mergnat Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230809125722.24112-2-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 26fdd23ff861d5436f70f67a09161b06d2c306e2 Author: Jason-JH.Lin Date: Wed Oct 4 10:40:11 2023 +0800 drm/mediatek: Support dynamic selection of MT8188 VDOSYS0 Move DDP_COMPONENT_DP_INTF0 from mt8188_mtk_ddp_main array to a connector routes array called mt8188_mtk_ddp_main_routes and add DDP_COMPONENT_DSI0 to mt8188_mtk_ddp_main_routes to support dynamic selection capability for mt8188. Signed-off-by: Jason-JH.Lin Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Nathan Lu Reviewed-by: Matthias Brugger Reviewed-by: Fei Shao Tested-by: Fei Shao Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-8-jason-jh.lin@mediatek.com/ Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-10-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 00d035228f8c57277d497340bf5bb0d1df2caa1e Author: Jason-JH.Lin Date: Wed Oct 4 10:40:12 2023 +0800 drm/mediatek: dsi: Support dynamic connector selection Add implementation of mtk_dsi_encoder_index to mtk_ddp_comp_func to make mtk_dsi support dynamic connector selection. Signed-off-by: Jason-JH.Lin Reviewed-by: CK Hu Reviewed-by: Fei Shao Reviewed-by: AngeloGioacchino Del Regno Tested-by: Fei Shao Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-9-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit f6ec9da1e7ac1c52c6496b0ffb140622be858734 Author: Jason-JH.Lin Date: Wed Oct 4 10:40:10 2023 +0800 drm/mediatek: dpi: Support dynamic connector selection Add implementation of mtk_dpi_encoder_index to mtk_ddp_comp_func to make mtk_dpi support dynamic connector selection. Signed-off-by: Jason-JH.Lin Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-7-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 01389b324c97ff8f04e9c33b9ee246084f9f6dd2 Author: Jason-JH.Lin Date: Wed Oct 4 10:40:09 2023 +0800 drm/mediatek: Add connector dynamic selection capability Add dynamic select available connector flow in mtk_drm_crtc_create() and mtk_drm_crtc_atomic_enable(). In mtk_drm_crtc_create(), if there is a connector routes array in drm driver data, all components definded in the connector routes array will be checked and their encoder_index will be set. In mtk_drm_crtc_atomic_enable(), crtc will check its encoder_index to identify which componet in the connector routes array should append. Signed-off-by: Jason-JH.Lin Signed-off-by: Nancy Lin Signed-off-by: Nathan Lu Tested-by: Fei Shao Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-6-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit a260f5624dfc6ec3eb7b5349f51d34c687c07b5c Author: Jason-JH.Lin Date: Wed Oct 4 10:40:08 2023 +0800 drm/mediatek: Add encoder_index interface for mtk_ddp_comp_funcs To support dynamic connector selection function, each ddp_comp need to get their encoder_index to identify which connector should be selected. Add encoder_index interface for mtk_ddp_comp_funcs to get the encoder identifier by drm_encoder_index(). Then drm driver will call mtk_ddp_comp_encoder_index_set() to store the encoder_index to each ddp_comp in connector routes. Signed-off-by: Jason-JH.Lin Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-5-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit ebba0960993045787ca00bb0932d83dad98c2e26 Author: Jason-JH.Lin Date: Wed Oct 4 10:40:07 2023 +0800 drm/mediatek: Fix using wrong drm private data to bind mediatek-drm According to mtk_drm_kms_init(), the all_drm_private array in each drm private data stores all drm private data in display path order. In mtk_drm_get_all_drm_priv(), each element in all_drm_priv should have one display path private data, such as: all_drm_priv[CRTC_MAIN] should only have main_path data all_drm_priv[CRTC_EXT] should only have ext_path data all_drm_priv[CRTC_THIRD] should only have third_path data So we need to add the length checking for each display path before assigning their drm private data into all_drm_priv array. Then the all_drm_private array in each drm private data needs to be assigned in their display path order. Fixes: 1ef7ed48356c ("drm/mediatek: Modify mediatek-drm for mt8195 multi mmsys support") Signed-off-by: Jason-JH.Lin Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu Tested-by: Fei Shao Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-4-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 26c35d1d1646e593e3a82748b19d33b164871ae8 Author: Jason-JH.Lin Date: Wed Oct 4 10:40:06 2023 +0800 drm/mediatek: Add crtc path enum for all_drm_priv array Add mtk_drm_crtc_path enum for each display path. Instead of using array index of all_drm_priv in mtk_drm_kms_init(), mtk_drm_crtc_path enum can make code more readable. Signed-off-by: Jason-JH.Lin Reviewed-by: Fei Shao Reviewed-by: CK Hu Reviewed-by: AngeloGioacchino Del Regno Tested-by: Fei Shao Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-3-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit ff64e4c31d969cdba20a41969edb3def15f3aaa0 Author: Jason-JH.Lin Date: Wed Oct 4 10:40:05 2023 +0800 drm/mediatek: Add mmsys_dev_num to mt8188 vdosys0 driver data Add missing mmsys_dev_num to mt8188 vdosys0 driver data. Fixes: 54b48080278a ("drm/mediatek: Add mediatek-drm of vdosys0 support for mt8188") Signed-off-by: Jason-JH.Lin Reviewed-by: CK Hu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Fei Shao Tested-by: Fei Shao Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-2-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 1621a8edc226137e62e245eb5763d3ff91a9d02a Author: John Harrison Date: Fri Oct 6 07:58:01 2023 -0700 drm/i915/guc: Update 'recommended' version to 70.12.1 for DG2/ADL-S/ADL-P/MTL The latest GuC has new features and new workarounds that we wish to enable. So let the universe know that it is useful to update their firmware. Signed-off-by: John Harrison Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231006145801.161868-1-John.C.Harrison@Intel.com commit 36b2d7dd5a8ac95c8c1e69bdc93c4a6e2dc28a23 Author: Kees Cook Date: Fri Oct 6 13:17:49 2023 -0700 driver core: platform: Annotate struct irq_affinity_devres with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct irq_affinity_devres. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: "Gustavo A. R. Silva" Cc: linux-hardening@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20231006201749.work.432-kees@kernel.org Signed-off-by: Greg Kroah-Hartman commit 27df2ed3b145080b3c9c21420e797cc35099b154 Author: Jisheng Zhang Date: Fri Oct 6 20:14:49 2023 +0800 riscv: dts: sophgo: add Milk-V Duo board device tree Milk-V Duo[1] board is an embedded development platform based on the CV1800B chip. Add minimal device tree files for the development board. Support basic uart drivers, so supports booting to a basic shell. Link: https://milkv.io/duo [1] Signed-off-by: Jisheng Zhang Acked-by: Chen Wang Signed-off-by: Conor Dooley commit c3dffa879ccad5f0b08deedc2c428f4f7ae7f8e6 Author: Jisheng Zhang Date: Fri Oct 6 20:14:48 2023 +0800 riscv: dts: sophgo: add initial CV1800B SoC device tree Add initial device tree for the CV1800B RISC-V SoC by SOPHGO. Signed-off-by: Jisheng Zhang Acked-by: Chen Wang Signed-off-by: Conor Dooley commit 32ecb28b8e60f75e45790fd9948470a911b0ef7d Author: Jisheng Zhang Date: Fri Oct 6 20:14:47 2023 +0800 dt-bindings: riscv: Add Milk-V Duo board compatibles Document the compatible strings for the Milk-V Duo board[1] which uses the SOPHGO CV1800B SoC[2]. Link: https://milkv.io/duo [1] Link: https://en.sophgo.com/product/introduce/cv180xB.html [2] Signed-off-by: Jisheng Zhang Acked-by: Conor Dooley Acked-by: Chen Wang Signed-off-by: Conor Dooley commit 332ba4f78a6d8e823517377f4917bc248e6a3042 Author: Jisheng Zhang Date: Fri Oct 6 20:14:46 2023 +0800 dt-bindings: timer: Add SOPHGO CV1800B clint Add compatible string for the SOPHGO CV1800B clint. Signed-off-by: Jisheng Zhang Acked-by: Conor Dooley Signed-off-by: Conor Dooley commit 975f0a640ceb41581c4974ed6f368c39478a3bd3 Author: Jisheng Zhang Date: Fri Oct 6 20:14:45 2023 +0800 dt-bindings: interrupt-controller: Add SOPHGO CV1800B plic Add compatible string for SOPHGO CV1800B plic. Signed-off-by: Jisheng Zhang Acked-by: Conor Dooley Signed-off-by: Conor Dooley commit b44444027ce7714f309e96b804b7fb088a40d708 Author: Rafael J. Wysocki Date: Sat Oct 7 13:29:22 2023 +0200 thermal: trip: Remove lockdep assertion from for_each_thermal_trip() The lockdep assertion in for_each_thermal_trip() was added to possibly catch incorrect usage of that function without the thermal zone lock. However, it turns out that the ACPI thermal driver has a legitimate reason to call for_each_thermal_trip() without locking. Namely, it is called by acpi_thermal_bind_unbind_cdev() in the thermal zone registration and unregistration paths. That function cannot acquire the thermal zone lock by itself, because it calls functions that acquire it, thermal_bind_cdev_to_trip() or thermal_unbind_cdev_from_trip(). However, it is invoked when the ACPI notify handler for the thermal zone in question has not been registered yet (in the registration path) or after that handler has been unregistered (in the unregistration path). Therefore, when for_each_thermal_trip() is called by acpi_thermal_bind_unbind_cdev(), thermal trip changes induced by the platform firmware cannot take place and so the thermal zone's trips[] table is effectively immutable. Hence, it is valid to call for_each_thermal_trip() from acpi_thermal_bind_unbind_cdev() without locking and the lockdep assertion in the former is in fact incorrect, so remove it. Fixes: d5ea889246b1 ("ACPI: thermal: Do not use trip indices for cooling device binding") Signed-off-by: Rafael J. Wysocki commit c32ab7bd6191d64998dced3ba567b8737d217861 Author: Chen Wang Date: Wed Oct 4 23:44:46 2023 +0800 riscv: defconfig: enable SOPHGO SoC Enable SOPHGO SoC config in defconfig to allow the default upstream kernel to boot on Milk-V Pioneer board. Acked-by: Chao Wei Acked-by: Conor Dooley Reviewed-by: Guo Ren Signed-off-by: Chen Wang [conor: fix the ordering] Signed-off-by: Conor Dooley commit 9439a0e8b6bb83e46e8d30d2cf00558ffd1ee41e Author: Chen Wang Date: Wed Oct 4 23:44:25 2023 +0800 riscv: dts: sophgo: add Milk-V Pioneer board device tree Milk-V Pioneer [1] is a developer motherboard based on SG2042 in a standard mATX form factor. Currently only support booting into console with only uart enabled, other features will be added soon later. Link: https://milkv.io/pioneer [1] Reviewed-by: Guo Ren Acked-by: Chao Wei Signed-off-by: Chen Wang Signed-off-by: Conor Dooley commit 967a94a92aaaaf2d85179e1b7c7b1f0fd6bff7ac Author: Chen Wang Date: Sat Oct 7 15:57:10 2023 +0800 riscv: dts: add initial Sophgo SG2042 SoC device tree Milk-V Pioneer motherboard is powered by SG2042. SG2042 is server grade chip with high performance, low power consumption and high data throughput. Key features: - 64 RISC-V cpu cores - 4 cores per cluster, 16 clusters on chip - More info is available at [1]. Currently only support booting into console with only uart, other features will be added soon later. Link: https://en.sophgo.com/product/introduce/sg2042.html [1] Reviewed-by: Guo Ren Acked-by: Chao Wei Co-developed-by: Xiaoguang Xing Signed-off-by: Xiaoguang Xing Co-developed-by: Inochi Amaoto Signed-off-by: Inochi Amaoto Signed-off-by: Chen Wang Signed-off-by: Conor Dooley commit bc87127a45928de5fdf0ec39d7a86e1edd0e179e Author: Yajun Deng Date: Thu Jul 20 16:05:16 2023 +0800 sched/debug: Print 'tgid' in sched_show_task() Multiple blocked tasks are printed when the system hangs. They may have the same parent pid, but belong to different task groups. Printing tgid lets users better know whether these tasks are from the same task group or not. Signed-off-by: Yajun Deng Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230720080516.1515297-1-yajun.deng@linux.dev commit aa1567a7e6440b8c3af4b0d8a8219d8fc5028c5f Author: Waiman Long Date: Thu Jul 27 14:46:00 2023 -0400 intel_idle: Add ibrs_off module parameter to force-disable IBRS Commit bf5835bcdb96 ("intel_idle: Disable IBRS during long idle") disables IBRS when the cstate is 6 or lower. However, there are some use cases where a customer may want to use max_cstate=1 to lower latency. Such use cases will suffer from the performance degradation caused by the enabling of IBRS in the sibling idle thread. Add a "ibrs_off" module parameter to force disable IBRS and the CPUIDLE_FLAG_IRQ_ENABLE flag if set. In the case of a Skylake server with max_cstate=1, this new ibrs_off option will likely increase the IRQ response latency as IRQ will now be disabled. When running SPECjbb2015 with cstates set to C1 on a Skylake system. First test when the kernel is booted with: "intel_idle.ibrs_off": max-jOPS = 117828, critical-jOPS = 66047 Then retest when the kernel is booted without the "intel_idle.ibrs_off" added: max-jOPS = 116408, critical-jOPS = 58958 That means booting with "intel_idle.ibrs_off" improves performance by: max-jOPS: +1.2%, which could be considered noise range. critical-jOPS: +12%, which is definitely a solid improvement. The admin-guide/pm/intel_idle.rst file is updated to add a description about the new "ibrs_off" module parameter. Signed-off-by: Waiman Long Signed-off-by: Ingo Molnar Acked-by: Rafael J. Wysocki Cc: Linus Torvalds Link: https://lore.kernel.org/r/20230727184600.26768-5-longman@redhat.com commit 7506203089dceb1d9e1f35d37ad2e46d44798a6d Author: Waiman Long Date: Thu Jul 27 14:45:59 2023 -0400 intel_idle: Use __update_spec_ctrl() in intel_idle_ibrs() When intel_idle_ibrs() is called, it modifies the SPEC_CTRL MSR to 0 in order disable IBRS. However, the new MSR value isn't reflected in x86_spec_ctrl_current which is at odd with the other code that keep track of its state in that percpu variable. Use the new __update_spec_ctrl() to have the x86_spec_ctrl_current percpu value properly updated. Since spec-ctrl.h includes both msr.h and nospec-branch.h, we can remove those from the include file list. Signed-off-by: Waiman Long Signed-off-by: Ingo Molnar Acked-by: Rafael J. Wysocki Cc: Linus Torvalds Link: https://lore.kernel.org/r/20230727184600.26768-4-longman@redhat.com commit 2743fe89d4d41616ffbe1e7e96e443ae7a4b1cc6 Author: Waiman Long Date: Thu Jul 27 14:45:58 2023 -0400 x86/idle: Disable IBRS when CPU is offline to improve single-threaded performance Commit bf5835bcdb96 ("intel_idle: Disable IBRS during long idle") disables IBRS when the CPU enters long idle. However, when a CPU becomes offline, the IBRS bit is still set when X86_FEATURE_KERNEL_IBRS is enabled. That will impact the performance of a sibling CPU. Mitigate this performance impact by clearing all the mitigation bits in SPEC_CTRL MSR when offline. When the CPU is online again, it will be re-initialized and so restoring the SPEC_CTRL value isn't needed. Add a comment to say that native_play_dead() is a __noreturn function, but it can't be marked as such to avoid confusion about the missing MSR restoration code. When DPDK is running on an isolated CPU thread processing network packets in user space while its sibling thread is idle. The performance of the busy DPDK thread with IBRS on and off in the sibling idle thread are: IBRS on IBRS off ------- -------- packets/second: 7.8M 10.4M avg tsc cycles/packet: 282.26 209.86 This is a 25% performance degradation. The test system is a Intel Xeon 4114 CPU @ 2.20GHz. [ mingo: Extended the changelog with performance data from the 0/4 mail. ] Signed-off-by: Waiman Long Signed-off-by: Ingo Molnar Acked-by: Rafael J. Wysocki Cc: Linus Torvalds Link: https://lore.kernel.org/r/20230727184600.26768-3-longman@redhat.com commit e3e3bab1844d448a239cd57ebf618839e26b4157 Author: Waiman Long Date: Thu Jul 27 14:45:57 2023 -0400 x86/speculation: Add __update_spec_ctrl() helper Add a new __update_spec_ctrl() helper which is a variant of update_spec_ctrl() that can be used in a noinstr function. Suggested-by: Peter Zijlstra Signed-off-by: Waiman Long Signed-off-by: Ingo Molnar Acked-by: Rafael J. Wysocki Cc: Linus Torvalds Link: https://lore.kernel.org/r/20230727184600.26768-2-longman@redhat.com commit ea41bb514fe286bf50498b3c6d7f7a5dc2b6c5e0 Author: Ingo Molnar Date: Wed Oct 4 11:33:36 2023 +0200 sched/core: Update stale comment in try_to_wake_up() The following commit: 9b3c4ab3045e ("sched,rcu: Rework try_invoke_on_locked_down_task()") ... renamed try_invoke_on_locked_down_task() to task_call_func(), but forgot to update the comment in try_to_wake_up(). But it turns out that the smp_rmb() doesn't live in task_call_func() either, it was moved to __task_needs_rq_lock() in: 91dabf33ae5d ("sched: Fix race in task_call_func()") Fix that now. Also fix the s/smb/smp typo while at it. Reported-by: Zhang Qiao Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230731085759.11443-1-zhangqiao22@huawei.com commit 8db30574db25fa20cdcfa03e374edc3f8b8dc301 Merge: d4d6596b43868 9e0bc36ab07c5 Author: Ingo Molnar Date: Sat Oct 7 11:32:24 2023 +0200 Merge branch 'sched/urgent' into sched/core, to pick up fixes and refresh the branch Signed-off-by: Ingo Molnar commit cfb5e0cece70b36bacbe8f888c096e6370a9c6ba Author: Alexey Dobriyan Date: Thu Oct 5 19:34:21 2023 +0300 serial: initialize retinfo in uart_get_info() If this check ever triggers static int uart_get_info(struct tty_port *port, struct serial_struct *retinfo) { uport = uart_port_check(state); if (!uport) goto out; then all those sysfs users will print stack contents to userspace. Signed-off-by: Alexey Dobriyan Link: https://lore.kernel.org/r/967b9ef1-fb36-48bf-9e6a-1b99af24c052@p183 Signed-off-by: Greg Kroah-Hartman commit 1f34e3defb5c0a038945795d2e01bbe9d9c05a64 Author: Andy Shevchenko Date: Thu Oct 5 15:45:50 2023 +0300 serial: 8250_bcm7271: Use devm_clk_get_optional_enabled() Use devm_clk_get_optional_enabled() to simplify the code. Signed-off-by: Andy Shevchenko Reviewed-by: Andi Shyti Link: https://lore.kernel.org/r/20231005124550.3607234-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 8e3c825288c6a091e3e80edcebe746b927dd1f73 Author: Claudiu Beznea Date: Fri Oct 6 13:39:56 2023 +0300 dt-bindings: serial: renesas,scif: document r9a08g045 support Document support for the Serial Communication Interface with FIFO (SCIF) available in the Renesas RZ/G3S (R9A08G045) SoC. SCIF interface in Renesas RZ/G3S is similar to the one available in RZ/G2L. Signed-off-by: Claudiu Beznea Acked-by: Rob Herring Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20231006103959.197485-2-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 9e8368a332fd4ffd71ab7232bffa512eada75128 Author: Krzysztof Kozlowski Date: Thu Oct 5 11:32:47 2023 +0200 dt-bindings: serial: allow naming of Bluetooth with GPS children Some devices attached over UART combine Bluetooth and GNSS/GPS receiver, so allow "bluetooth-gnss" naming of children nodes. Link: https://lore.kernel.org/all/20231004070309.2408745-1-andreas@kemnade.info/ Suggested-by: Andreas Kemnade Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20231005093247.128166-2-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 42851dfd4dbe38e34724a00063a9fad5cfc48dcd Author: Krzysztof Kozlowski Date: Thu Oct 5 11:32:46 2023 +0200 dt-bindings: serial: fix regex pattern for matching serial node children The regular expression pattern for matching serial node children should accept only nodes starting and ending with the set of words: bluetooth, gnss, gps or mcu. Add missing brackets to enforce such matching. Fixes: 0c559bc8abfb ("dt-bindings: serial: restrict possible child node names") Reported-by: Andreas Kemnade Closes: https://lore.kernel.org/all/20231004170021.36b32465@aktux/ Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20231005093247.128166-1-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman commit 5a1cc96352b29e83c70714235ed6cbed0dcf5b8b Author: Greg Kroah-Hartman Date: Thu Oct 5 15:33:48 2023 +0200 tty: vc_screen: make vc_class constant Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Cc: Jiri Slaby Link: https://lore.kernel.org/r/2023100549-sixth-anger-ac34@gregkh Signed-off-by: Greg Kroah-Hartman commit 3abe1144ed548cded0595163e6f39e3c7d635c56 Author: Greg Kroah-Hartman Date: Thu Oct 5 15:33:47 2023 +0200 tty: vt: make vtconsole_class constant Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Cc: Jiri Slaby Link: https://lore.kernel.org/r/2023100546-humbly-prologue-e58c@gregkh Signed-off-by: Greg Kroah-Hartman commit 25d367506a284bb0404b7d53b0b20c9bfb33f926 Author: Philipp Hortmann Date: Fri Oct 6 21:05:39 2023 +0200 staging: rtl8192e: Remove unused file rtllib_debug.h Remove #define DRV_NAME "rtllib_92e" as it is already set. Remove enum RTL_DEBUG as it is unused. Remove #include as it is unused. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/b7b61bd068e8090b954e3c025bc724d9e85fc568.1696548527.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 00c02ae6746d5bc7a3ce2f972d2e195a3e8873e8 Author: Philipp Hortmann Date: Fri Oct 6 21:05:33 2023 +0200 staging: rtl8192e: Remove unused variable rt_global_debug_component Remove unused variable rt_global_debug_component. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/082272e20dc0659e7700f7756a6bf1a8b71c411e.1696548527.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 26e703c677e981f3e363ef327a94f7a4f4790013 Author: Philipp Hortmann Date: Fri Oct 6 21:05:27 2023 +0200 staging: rtl8192e: Remove function _rtl92e_wx_set_debug() Remove function _rtl92e_wx_set_debug() as this functionality is not commonly used and the tool to access it is deprecated. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/887ca5f66bad5105eeba449a9bd3e40be4b835ce.1696548527.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit f4840e34387ddc25a42968535c5105fa59661fae Author: Philipp Hortmann Date: Fri Oct 6 21:05:22 2023 +0200 staging: rtl8192e: Remove unchanged variable active_scan Remove variable active_scan as its value is set to 1 at initialization. No further writes to active_scan are done. The equation results accordingly. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/eea9f6cb1feeb8aa5beb546034562f55a03da449.1696548527.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit c5b5d02f9b146bf60e4c4666812bbe19861b1249 Author: Philipp Hortmann Date: Fri Oct 6 21:05:14 2023 +0200 staging: rtl8192e: Remove function _rtl92e_wx_set_scan_type() Remove function _rtl92e_wx_set_scan_type() as this functionality is not commonly used and the tool to access it is deprecated. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/8a0ce95447dbd736e3aeec5f7aa0e997f916b7d8.1696548527.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 22448f0131f01b3a6cba46b06dee3387fd164b13 Author: Philipp Hortmann Date: Fri Oct 6 21:05:07 2023 +0200 staging: rtl8192e: Remove constant variable ps_force Remove constant variable ps_force as its value is always 0. The equation results accordingly. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/ecebc90415c202e4e465bfb5b10c54be8b42e684.1696548527.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 771287642e4bb3fac826b588ba7b8f0073b7b56f Author: Philipp Hortmann Date: Fri Oct 6 21:05:00 2023 +0200 staging: rtl8192e: Remove function _rtl92e_wx_adapter_power_status() Remove function _rtl92e_wx_adapter_power_status() as this functionality is not commonly used and the tool to access it is deprecated. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/2fc8f18019c760125ae7c52c765271d2877c52bd.1696548527.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 02584b2aea67a06707f1a4fe40d119082a47af87 Author: Philipp Hortmann Date: Fri Oct 6 21:04:54 2023 +0200 staging: rtl8192e: Remove constant variable reg_max_lps_awake_intvl Remove constant variable reg_max_lps_awake_intvl as this value is just written to MaxPeriod. Function _rtl92e_init_priv_constant() is then empty and can be removed as well. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/d5b2ccc0f10c28f960552dd2b2c5ec83aa62041f.1696548527.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit a84ff259bfc10e473a2b1b2dc6f2aadfb498dbed Author: Philipp Hortmann Date: Fri Oct 6 21:04:46 2023 +0200 staging: rtl8192e: Remove function _rtl92e_wx_set_lps_awake_interval() Remove function _rtl92e_wx_set_lps_awake_interval() as this functionality is not commonly used and the tool to access it is deprecated. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/f0bce7933d3d3761ddc42ba64a4ce46827bd3304.1696548527.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9938fdea87f6ca9588d2499ed32a360abedc0786 Author: Philipp Hortmann Date: Fri Oct 6 21:04:38 2023 +0200 staging: rtl8192e: Remove function _rtl92e_wx_set_force_lps() Remove function _rtl92e_wx_set_force_lps() as this functionality is not commonly used and the tool to access it is deprecated. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/833ccd9d1eee1a350f7801d86116e465b3713327.1696548527.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 31e2d4cde1424e8068c2c675805c251365c0f522 Author: Ricardo Lopes Date: Fri Oct 6 17:12:24 2023 +0100 staging: qlge: Replace strncpy with strscpy Reported by checkpatch: WARNING: Prefer strscpy, strscpy_pad, or __nonstring over strncpy Signed-off-by: Ricardo Lopes Link: https://lore.kernel.org/r/20231006161240.28048-1-ricardoapl.dev@gmail.com Signed-off-by: Greg Kroah-Hartman commit a1766a4fd83befa0b34d932d532e7ebb7fab1fa7 Author: Takashi Iwai Date: Fri Sep 22 14:38:07 2023 +0200 media: imon: fix access to invalid resource for the second interface imon driver probes two USB interfaces, and at the probe of the second interface, the driver assumes blindly that the first interface got bound with the same imon driver. It's usually true, but it's still possible that the first interface is bound with another driver via a malformed descriptor. Then it may lead to a memory corruption, as spotted by syzkaller; imon driver accesses the data from drvdata as struct imon_context object although it's a completely different one that was assigned by another driver. This patch adds a sanity check -- whether the first interface is really bound with the imon driver or not -- for avoiding the problem above at the probe time. Reported-by: syzbot+59875ffef5cb9c9b29e9@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/000000000000a838aa0603cc74d6@google.com/ Tested-by: Ricardo B. Marliere Link: https://lore.kernel.org/r/20230922005152.163640-1-ricardo@marliere.net Signed-off-by: Takashi Iwai Signed-off-by: Sean Young Signed-off-by: Hans Verkuil commit 462e108bac18419f17c6a34eb348b600a614aa4f Author: Hans Verkuil Date: Tue Sep 26 11:58:42 2023 +0200 media: rc: keymaps: add missing MODULE_DESCRIPTION to keymaps When building the modules 'modpost' warns about missing MODULE_DESCRIPTION. Since almost none of the rc keymap modules have this, it produces a lot of warnings. As a first step to fixing all media modules, add this line to all keymaps. The description should be a human-readable string describing the remote or the remote controller that the keymap can be used with. Note that keymaps/rc-cec.c is actually compiled into the rc-core, so that is the sole keymap source that didn't need this. Signed-off-by: Hans Verkuil Signed-off-by: Sean Young commit dc887661be33dd88e97bd0baaa899a9bd6d7eb8b Author: Sakari Ailus Date: Wed Sep 27 14:22:52 2023 +0300 media: Documentation: Split camera sensor documentation Split camera sensor documentation into user and kernel portions. This should make it easier for the user space developers to find the relevant documentation. Also add a list of exemplary drivers and add imx219 driver to it, besides those that were already mentioned. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil commit 2d21fef54800bd6641f85a6821427260439c9539 Author: Sakari Ailus Date: Tue Sep 12 11:36:51 2023 +0300 media: Add MIPI CSI-2 generic long packet type definition Add a definition for MIPI CSI-2 generic long packet types. The generic long packet types are numbered from 1 to 4. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit deb866f9e3a45ae058b21765feeffae6aea6a193 Author: Sakari Ailus Date: Tue Apr 25 12:30:45 2023 +0300 media: mc: Check pad flag validity Check the validity of pad flags on entity init. Exactly one of the flags must be set. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 4c812e33b0de26bc61e2ab5b3c4dd3e4d3c6cd51 Author: Sakari Ailus Date: Tue Sep 12 14:55:24 2023 +0300 media: v4l: subdev: Print debug information on frame descriptor Print debug level information on returned frame descriptors. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 76c0b99d614127ceadcd3563dee4983c20627e09 Author: Sakari Ailus Date: Fri Sep 15 14:23:28 2023 +0300 media: v4l: subdev: Clear frame descriptor before get_frame_desc Clear frame descriptor before calling transmitter's get_frame_desc() op. Also remove the corresponding memset() calls from drivers. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Signed-off-by: Hans Verkuil commit 07d81b507df5622db40104c64dace3387bbe23b9 Author: Sakari Ailus Date: Fri Sep 8 12:56:16 2023 +0300 media: ov2740: Return -EPROBE_DEFER if no endpoint is found With ipu bridge, endpoints may only be created when ipu bridge has initialised. This may happen after the sensor driver has first probed. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 289c25923ecdde90050a0cb3904f9295ca68b425 Author: Sakari Ailus Date: Thu Sep 7 15:10:03 2023 +0300 media: ov2740: Use sub-device active state Use sub-device active state. Rely on control handler lock to serialise access to the active state. Also clean up locking on s_stream handler. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 1cfe77a541a5044a061afd4f7935f504cc4d4c48 Author: Sakari Ailus Date: Fri Sep 8 11:52:12 2023 +0300 media: ov2740: Enable runtime PM before registering the async subdev Enable runtime PM before registering the async subdev as the driver UAPI may become accessible immediately after the registration. Runtime PM needs to be enabled by that time. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 8a695a29d68e8f6e7334ae4fdcffd7e687a48d2f Author: Sakari Ailus Date: Fri Sep 29 11:32:46 2023 +0300 media: ccs: Drop re-entrant s_stream support The s_stream is called to enable and to disable streaming on a sub-device. The caller may only call it to change the state, enabling streaming is not allowed when it is already disabled, and similarly for disabling streaming. Remove the check from the CCS driver. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 2428e585b1e79efc1ecc3eaf64ad777e1272b792 Author: Sakari Ailus Date: Fri Sep 29 12:00:42 2023 +0300 media: ccs: Partially revert "media: i2c: Use pm_runtime_resume_and_get()" ccs_pm_get_init() depends on the return values > 0 of pm_runtime_get_sync(), thus it can't use pm_runtime_resume_and_get(). There's even a comment in the driver on this, a few lines above the code. Fixes: aa0adb399d09 ("media: i2c: Use pm_runtime_resume_and_get()") Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit d8bca3ed1d70652e68b07799171d471026b7b3e2 Author: Sakari Ailus Date: Thu Aug 24 10:31:10 2023 +0300 media: ccs: Use sub-device active state Make use of sub-device active state. In most cases the effect on need for acquiring the mutex is non-existent as access to the driver's core data structure still needs to be serialised. This still removes a lot of code as the code paths for active and try state are the same in many cases. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit f00a1572b65a444082fb72488ae3b7ce73065696 Author: Sakari Ailus Date: Mon Oct 2 13:29:22 2023 +0300 media: ccs: Obtain media bus formats before initialising up sub-devices The available mbus codes will soon be needed earlier, at the time sub-devices are initialisaed. This is due to calling init_cfg() op via the v4l2_subdev_init_finalize(). Move ccs_get_mbus_formats() before ccs_init_subdev() calls. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 77ab9dc8d926bf5a0ce1f6dde14c0bb29c473426 Author: Sakari Ailus Date: Mon Oct 2 10:25:37 2023 +0300 media: ccs: Move media_entity_pads_init to init from register The media entity will soon need to be initialised before the sub-device init finalisation that allocates memory for sub-device state. Do that now. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit ac84b72242ce745ccf79df1504a53afd079e5b45 Author: Sakari Ailus Date: Mon Oct 2 10:19:15 2023 +0300 media: ccs: Rename ccs_create_subdev as ccs_init_subdev The ccs_create_subdev() function initialises a sub-device in the CCS driver, including CCS specific needs. Rename it as ccs_init_subdev() as it better reflects what the function does. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 3935665586783dffaafb8308f561b12800245af5 Author: Sakari Ailus Date: Wed Aug 9 16:12:38 2023 +0300 media: ccs: Switch to init_cfg Use init_cfg() instead of manually setting up defaults in file handle open. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit f055e53ebcfc042e6a26acc27acac25ef9c0188e Author: Sakari Ailus Date: Wed Aug 23 11:44:37 2023 +0300 media: ccs: Correct error handling in ccs_register_subdev ccs_register_subdev() did not clean up the media entity in error case, do that now. Also switch to goto based error handling. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 724ff68e968b19d786870d333f9952bdd6b119cb Author: Sakari Ailus Date: Mon Sep 4 15:57:37 2023 +0300 media: ccs: Correctly initialise try compose rectangle Initialise the try sink compose rectangle size to the sink compose rectangle for binner and scaler sub-devices. This was missed due to the faulty condition that lead to the compose rectangles to be initialised for the pixel array sub-device where it is not relevant. Fixes: ccfc97bdb5ae ("[media] smiapp: Add driver") Cc: stable@vger.kernel.org Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 441b5c63d71ec9ec5453328f7e83384ecc1dddd9 Author: Sakari Ailus Date: Thu Aug 24 15:18:18 2023 +0300 media: ccs: Fix driver quirk struct documentation Fix documentation for struct ccs_quirk, a device specific struct for managing deviations from the standard. The flags field was drifted away from where it should have been. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 580139fa0c3025e39d55f9472bafbd8f0f662d7b Author: Sakari Ailus Date: Wed Aug 2 15:11:50 2023 +0300 media: Documentation: Align numbered list, make it a proper ReST Align lines for numbered list so that Sphinx produces an uniform output for all list entries. Also indent paragraphs of such list entries for consistency. Also use ReST numbered list syntax for the entries. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit ef202378ccdd23a7af99607d6ecb857212793824 Author: Laurent Pinchart Date: Sun Sep 24 18:33:09 2023 +0300 media: i2c: imx219: Move variables to inner scope The exposure_max, exposure_def and hblank variables are only used in an inner scope in the imx219_set_pad_format() function. Move them to that scope to keep them closer to their usage and improve readability. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit bf313f998f7445dda5969bbd57321721b754e760 Author: Laurent Pinchart Date: Sun Sep 24 18:33:08 2023 +0300 media: i2c: imx219: Name all subdev state variables 'state' Subdev state variables are named with a mix of 'state' and 'sd_state' through the driver. To improve consistency, name them all 'state'. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 0af46fbc333d1a52c72823d935590410357bab47 Author: Laurent Pinchart Date: Sun Sep 24 18:33:07 2023 +0300 media: i2c: imx219: Calculate crop rectangle dynamically Calculate the crop rectangle size and location dynamically when setting the format, instead of storing it in the imx219_mode structure. This removes duplicated information from the mode, to guarantee consistency. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 186aa9d472897bc5113eeb69c7ff6ed57c2263ee Author: Laurent Pinchart Date: Sun Sep 24 18:33:06 2023 +0300 media: i2c: imx219: Separate horizontal and vertical binning The IMX219 has distinct binning registers for the horizontal and vertical directions. Calculate their value and write them separately. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit eef9c161d029ed08bff2bdbf8bcc4ae9e731be3f Author: Laurent Pinchart Date: Sun Sep 24 18:33:05 2023 +0300 media: i2c: imx219: Implement .init_cfg() using .set_fmt() Instead of duplicating the logical implemented in the .set_fmt() operation in .init_cfg(), call .set_fmt() directly. This centralizes the format and crop rectangle calculations in a single place. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit d83b40ef9c078d0173dbdb8587ee220a185b5f80 Author: Laurent Pinchart Date: Sun Sep 24 18:33:04 2023 +0300 media: i2c: imx219: Remove unneeded goto Simplify the imx219_set_stream() by removing an unneeded goto statement, and its corresponding error label. The natural flow of the function is correct. While at it, drop a useless comment. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit d03dfb7d4c5fae0d3f297536063e00ea2c1129d5 Author: Laurent Pinchart Date: Sun Sep 24 18:33:03 2023 +0300 media: i2c: imx219: Group functions by purpose Move functions around to group them by purpose, in order to improve readability. No functional change is intended. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 5ebbdd7aab3321e60a8be23aac1fee4f16644021 Author: Laurent Pinchart Date: Sun Sep 24 18:33:02 2023 +0300 media: i2c: imx219: Drop IMX219_VTS_* macros The IMX219_VTS_* macros define default VTS values for the modes supported by the driver. They are used in a single place, and hinder readability compared to using the value directly as a decimal number. Drop them. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit e3e5d172d5fce9151bc101427554a158d4759856 Author: Laurent Pinchart Date: Sun Sep 24 18:33:01 2023 +0300 media: i2c: imx219: Don't store the current mode in the imx219 structure The mode field of the imx219 structure is only used in imx219_init_controls(), after the probe function sets it to point to the default mode. Use the default mode directly when initializing controls, and drop the mode field from the imx219 structure. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit aa86ac42eec4dd7e987c12390a0a487187e2d9ae Author: Laurent Pinchart Date: Sun Sep 24 18:33:00 2023 +0300 media: i2c: imx219: Access height from active format in imx219_set_ctrl Use the active format height instead of the mode height in imx219_set_ctrl(). This prepares for dropping the mode field from the imx219 structure. The state is retrieved using v4l2_subdev_get_locked_active_state() as the subdev active state and the control handler share the same lock. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit c59d77be1b8349757660216e20db8cac75e6c967 Author: Laurent Pinchart Date: Sun Sep 24 18:32:59 2023 +0300 media: i2c: imx219: Infer binning settings from format and crop Compare the format and crop rectangle dimensions to infer binning settings, instead of storing the binning mode in the imx219_mode structure. This removes duplicate information from the mode. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 00eb22782bb15b04dddc8471bbcee68b7613ba0f Author: Laurent Pinchart Date: Sun Sep 24 18:32:58 2023 +0300 media: i2c: imx219: Use active crop rectangle to configure registers Configure the crop-related registers from the values stored in the active crop rectangle instead of the mode structure. This removes usage of the mode from the imx219_set_framefmt(). No functional change is intended. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 2ae504a561dbb31e5fb0a21f242f07e8c91cce61 Author: Laurent Pinchart Date: Sun Sep 24 18:32:57 2023 +0300 media: i2c: imx219: Initialize ycbcr_enc While the ycbcr_enc field doesn't apply to raw formats, leaving it uninitialized makes the driver behave in a less deterministic way. Fix it by picking the default value for the colorspace. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit cff09e76bf7940e2a82d003d80ca89824005008d Author: Laurent Pinchart Date: Sun Sep 24 18:32:56 2023 +0300 media: i2c: imx219: Merge format and binning setting functions The imx219_set_binning() function sets registers based on the bpp value, which is computed in imx219_set_framefmt(). As both functions are called from the same place consecutively, and set registers based on the selected mode, merge them together to simplify the code. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 8921687278d4d5d5c936ea1c106f1a8f4c04f7fd Author: Laurent Pinchart Date: Sun Sep 24 18:32:55 2023 +0300 media: i2c: imx219: Set mode registers programmatically Replace the per-mode register arrays with code that sets the same register values using the mode definitions. This avoids duplicating information in two different places. The error check for invalid formats in imx219_set_framefmt() is dropped as the format is guaranteed to be valid. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 55c3ec033b7e3353d1bed7ab96de8e9abc02fe3a Author: Laurent Pinchart Date: Sun Sep 24 18:32:54 2023 +0300 media: i2c: imx219: Fix test pattern window for 640x480 mode The 640x480 mode specifies incorrect values for the TP_WINDOW_WIDTH and TP_WINDOW_HEIGHT registers, which likely got copied from the 1640x1232 mode. They should be identical to the X_OUTPUT_SIZE and Y_OUTPUT_SIZE registers as for all the other modes, to avoid cropping the test pattern. Fix them. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit ec80c606cca5f7a676febde10d63f5532f57e8e7 Author: Laurent Pinchart Date: Sun Sep 24 18:32:53 2023 +0300 media: i2c: imx219: Drop IMX219_REG_CSI_LANE_MODE from common regs array The IMX219_REG_CSI_LANE_MODE is configured twice, once with a hardcoded value in the imx219_common_regs registers array, and once with the value appropriate for the system in imx219_configure_lanes(). The latter is enough, drop the former. Fixes: ceddfd4493b3 ("media: i2c: imx219: Support four-lane operation") Suggested-by: Dave Stevenson Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 1c9083565a4698ff072f1209e9450ff6c305e2cc Author: Laurent Pinchart Date: Sun Sep 24 18:32:52 2023 +0300 media: i2c: imx219: Replace register addresses with macros Define macros for all the known registers used in the register arrays, and use them to replace the numerical addresses. This improves readability. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 3e40c8db9ec55adcc844de63f2d1120f9a173e6a Author: Laurent Pinchart Date: Sun Sep 24 18:32:51 2023 +0300 media: i2c: imx219: Drop unused macros Drop a handful of macros that are not used and don't provide any value. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 852798cc8a45362ea7667c754b8ca0575a680a45 Author: Laurent Pinchart Date: Sun Sep 24 18:32:50 2023 +0300 media: i2c: imx219: Convert to CCI register access helpers Use the new common CCI register access helpers to replace the private register access helpers in the imx219 driver. This simplifies the driver by reducing the amount of code. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 24d756e914fc3418bad7897b0657aefa9ef848e8 Author: Laurent Pinchart Date: Wed Sep 20 20:11:54 2023 +0300 media: i2c: Add driver for onsemi MT9M114 camera sensor The MT9M114 is a CMOS camera sensor that combines a 1296x976 pixel array with a 10-bit dynamic range together with an internal ISP. The driver exposes two subdevs, one for the pixel array and one for the ISP (named IFP for Image Flow Processor). Major supported features are - Full configuration of analog crop and binning in the pixel array - Full configuration of scaling in the ISP - Automatic exposure and white balance - Manual exposure and analog gain - Horizontal and vertical flip Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit e00d0d9e74fe2b1dccea3b8ee1c9593dba8f6117 Author: Laurent Pinchart Date: Wed Sep 20 20:11:53 2023 +0300 media: dt-bindings: media: i2c: Add MT9M114 camera sensor binding Add device tree binding for the onsemi MT9M114 CMOS camera sensor. Signed-off-by: Laurent Pinchart Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 206d8a9b36d32877db1952bb4afd357ba4a9cb88 Author: Bingbu Cao Date: Mon Sep 18 10:58:12 2023 +0800 media: i2c/hi556: add a new mode 1296x722 settings Add a new mode - 16:9 resolution 1296x722 for hi556. Signed-off-by: Bingbu Cao Signed-off-by: Qingwu Zhang Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 17c74cb89706654713bfa817820b2b981771c104 Author: Sakari Ailus Date: Tue Sep 19 14:09:57 2023 +0300 media: imx334: Orphan the driver The current maintainers won't be looking after this driver anymore. Mark it orphan. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 5b0e91fd477d0fbfac6989cbf26071c28f21bfe4 Author: Sakari Ailus Date: Tue Sep 19 14:09:32 2023 +0300 media: imx335: Orphan the driver The current maintainers won't be looking after this driver anymore. Mark it orphan. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 59ac78dcd17ccfe362229d5538ac9c1d00456e15 Author: Sakari Ailus Date: Tue Sep 19 14:06:06 2023 +0300 media: imx412: Orphan the driver The current maintainers won't be looking after this driver anymore. Mark it orphan. Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 0308483f6674d5d4e31deb8892d393b0aecd1ed3 Author: Sakari Ailus Date: Tue Sep 19 14:04:47 2023 +0300 media: ov9282: Assign maintenance to Dave The current maintainers won't be looking after this driver anymore. Dave offered to take over the driver, assign maintenance to him. Signed-off-by: Sakari Ailus Acked-by: Dave Stevenson Signed-off-by: Hans Verkuil commit cd5c11d5aacdb7eda2acc6ee57d442b48f300858 Author: Ken Lin Date: Thu Oct 5 09:38:41 2023 +0800 media: platform: cros-ec: Add Taranza to the match table Taranza has two HDMI ports which support CEC: Port D is EC port 0 Port B is EC port 1 Signed-off-by: Ken Lin Signed-off-by: Hans Verkuil commit 678e8d804149038e2356aabba9d4c9cf7a19418a Author: Ken Lin Date: Thu Oct 5 09:38:40 2023 +0800 media: platform: cros-ec: Rename conns array for the match table Rename conns array to port_**_conns, ** is the ports which support cec. ex: dibbi_conns support Port D and B will be renamed to port_db_conns. Make it much cleaner and readable. Signed-off-by: Ken Lin Signed-off-by: Hans Verkuil commit 4b910840f9f3f5e04c98cbca5b0229d0575a407e Author: Wolfram Sang Date: Fri Sep 22 10:04:20 2023 +0200 media: dvb-frontends: drop check because i2c_unregister_device() is NULL safe No need to check the argument of i2c_unregister_device() because the function itself does it. Signed-off-by: Wolfram Sang Reviewed-by: Kieran Bingham Reviewed-by: Geert Uytterhoeven Signed-off-by: Hans Verkuil commit b622e46690eb34a738bb295308f83c253b78afe0 Author: Wolfram Sang Date: Fri Sep 22 10:04:19 2023 +0200 media: i2c: drop check because i2c_unregister_device() is NULL safe No need to check the argument of i2c_unregister_device() because the function itself does it. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 36fe515c1a3cd5eac148e8a591a82108d92d5522 Author: Jernej Skrabec Date: Mon Sep 11 20:46:12 2023 +0200 media: cedrus: Fix clock/reset sequence According to H6 user manual, resets should always be de-asserted before clocks are enabled. This is also consistent with vendor driver. Fixes: d5aecd289bab ("media: cedrus: Implement runtime PM") Signed-off-by: Jernej Skrabec Acked-by: Paul Kocialkowski Signed-off-by: Hans Verkuil commit 85b901e6003b54f1377f63e9444466972c0707a7 Author: Ross Zwisler Date: Tue Aug 29 14:46:01 2023 -0600 media: visl: use canonical ftrace path The canonical location for the tracefs filesystem is at /sys/kernel/tracing. But, from Documentation/trace/ftrace.rst: Before 4.1, all ftrace tracing control files were within the debugfs file system, which is typically located at /sys/kernel/debug/tracing. For backward compatibility, when mounting the debugfs file system, the tracefs file system will be automatically mounted at: /sys/kernel/debug/tracing Update the visl decoder driver documentation to use this tracefs path. Signed-off-by: Ross Zwisler Reviewed-by: Masami Hiramatsu (Google) Reviewed-by: Steven Rostedt (Google) Signed-off-by: Hans Verkuil commit 1fd6eb12642e0c32692924ff359c07de4b781d78 Author: Jiasheng Jiang Date: Mon Jun 19 16:12:02 2023 +0800 media: vidtv: mux: Add check and kfree for kstrdup Add check for the return value of kstrdup() and return the error if it fails in order to avoid NULL pointer dereference. Moreover, use kfree() in the later error handling in order to avoid memory leak. Fixes: c2f78f0cb294 ("media: vidtv: psi: add a Network Information Table (NIT)") Signed-off-by: Jiasheng Jiang Signed-off-by: Hans Verkuil commit 76a2c5df6ca8bd8ada45e953b8c72b746f42918d Author: Jiasheng Jiang Date: Mon Jun 19 16:12:01 2023 +0800 media: vidtv: psi: Add check for kstrdup Add check for the return value of kstrdup() and return the error if it fails in order to avoid NULL pointer dereference. Fixes: 7a7899f6f58e ("media: vidtv: psi: Implement an Event Information Table (EIT)") Fixes: c2f78f0cb294 ("media: vidtv: psi: add a Network Information Table (NIT)") Fixes: f90cf6079bf6 ("media: vidtv: add a bridge driver") Signed-off-by: Jiasheng Jiang Signed-off-by: Hans Verkuil commit 5f9fcbf92da901495f2f8b09d2f6df5c2ca83dc5 Author: Dan Carpenter Date: Wed Sep 27 15:39:43 2023 +0300 media: nuvoton: npcm-video: Fix IS_ERR() vs NULL bug The of_parse_phandle() function returns NULL on error. It never returns error pointers. Update the check accordingly. Fixes: 70721089985c ("media: nuvoton: Add driver for NPCM video capture and encoding engine") Signed-off-by: Dan Carpenter Signed-off-by: Hans Verkuil commit 04d19e65137e3cd4a5004e624c85c762933d115c Author: Chengfeng Ye Date: Tue Sep 26 10:53:30 2023 +0000 media: s5p-mfc: Fix potential deadlock on condlock As &dev->condlock is acquired under irq context along the following call chain from s5p_mfc_irq(), other acquisition of the same lock inside process context or softirq context should disable irq avoid double lock. enc_post_frame_start() seems to be one such function that execute under process context or softirq context. enc_post_frame_start() --> clear_work_bit() --> spin_loc(&dev->condlock) --> s5p_mfc_irq() --> s5p_mfc_handle_frame() --> clear_work_bit() --> spin_lock(&dev->condlock) This flaw was found by an experimental static analysis tool I am developing for irq-related deadlock. To prevent the potential deadlock, the patch change clear_work_bit() inside enc_post_frame_start() to clear_work_bit_irqsave(). Signed-off-by: Chengfeng Ye Acked-by: Marek Szyprowski Signed-off-by: Hans Verkuil commit 3568cb6556695af163e930a75b1ed8f6dfa848ba Author: Irui Wang Date: Mon Sep 25 12:02:00 2023 +0800 media: mediatek: vcodec: add encoder power management helper functions Remove PM functions at start/stop streaming, add PM helper functions to get PM before encoding frame start and put PM after encoding frame done. Meanwhile, remove unnecessary clock operations. Signed-off-by: Irui Wang Signed-off-by: Hans Verkuil commit 06a185a861daa80e894419b932c78fa90dd837ac Author: Biju Das Date: Sat Sep 23 17:36:41 2023 +0100 media: tvp541x: Sort header files Sort header files alphabetically. Suggested-by: Jacopo Mondi Signed-off-by: Biju Das Signed-off-by: Hans Verkuil commit 2fa264283d207ab4213e2b88259db1e7ce5d5d1d Author: Biju Das Date: Sat Sep 23 17:36:40 2023 +0100 media: tvp541x: Drop CONFIG_OF ifdeffery Drop of_match_ptr() from tvp514x_driver and get rid of ugly CONFIG_OF if check. This slightly increases the size of tvp514x_driver on non-OF system and shouldn't be an issue. Add mod_devicetable.h include. It also allows, in case if needed, to enumerate this device via ACPI with PRP0001 magic. Signed-off-by: Biju Das Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil commit 0b135b89212f6e02ba8b5938973a5d3dcf0e548b Author: Biju Das Date: Sat Sep 23 17:36:39 2023 +0100 media: tvp541x: Extend match support for OF tables The driver has an OF match table, still, it uses an ID lookup table for retrieving match data. Currently, the driver is working on the assumption that an I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using i2c_get_match_data() if the devices are registered via OF/ID. Unify the OF/ID table by using tvp514x_reg as match data for both these tables and replace the ID lookup table for the match data by i2c_get_match_data() and simplifly probe(). While at it, remove the trailing comma in the terminator entry for the OF table making code robust against (theoretical) misrebases or other similar things where the new entry goes _after_ the termination without the compiler noticing. Signed-off-by: Biju Das Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil commit 54b6b605b9a00f5d93b48734122fa87ae345981e Author: Kees Cook Date: Fri Sep 22 10:49:52 2023 -0700 media: v4l2-event: Annotate struct v4l2_subscribed_event with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct v4l2_subscribed_event. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: lijian Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Hans Verkuil commit d425557814ab039012294aa6fd7dc0dd7f3ac4e3 Author: Kees Cook Date: Fri Sep 22 10:49:36 2023 -0700 media: allegro: Annotate struct mcu_msg_push_buffers_internal with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mcu_msg_push_buffers_internal. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Michael Tretter Cc: Pengutronix Kernel Team Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Hans Verkuil commit 61334819aca018c3416ee6c330a08a49c1524fc3 Author: Katya Orlova Date: Fri Sep 22 14:55:06 2023 +0300 media: s3c-camif: Avoid inappropriate kfree() s3c_camif_register_video_node() works with video_device structure stored as a field of camif_vp, so it should not be kfreed. But there is video_device_release() on error path that do it. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: babde1c243b2 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface") Signed-off-by: Katya Orlova Signed-off-by: Hans Verkuil commit f301fedbeecfdce91cb898d6fa5e62f269801fee Author: Ilpo Järvinen Date: Wed Sep 13 15:27:40 2023 +0300 media: cobalt: Use FIELD_GET() to extract Link Width Use FIELD_GET() to extract PCIe Negotiated and Maximum Link Width fields instead of custom masking and shifting. Signed-off-by: Ilpo Järvinen Reviewed-by: Jonathan Cameron Signed-off-by: Hans Verkuil commit 56a8c694c524d146a2d0b06aaff84544be9f5fa9 Author: Biju Das Date: Sun Sep 10 16:22:00 2023 +0100 media: i2c: adv7180: Drop CONFIG_OF ifdeffery Drop of_match_ptr() from adv7180_driver and get rid of ugly CONFIG_OF if check. This slightly increases the size of adv7180_driver on non-OF system and shouldn't be an issue. Add mod_devicetable.h include. It also allows, in case if needed, to enumerate this device via ACPI with PRP0001 magic. Signed-off-by: Biju Das Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil commit a142f7bb8908902120480ce3dbd799a9c63c84a2 Author: Biju Das Date: Sun Sep 10 16:21:59 2023 +0100 media: i2c: adv7180: Extend match support for OF tables The driver has an OF match table, still, it uses an ID lookup table for retrieving match data. Currently, the driver is working on the assumption that an I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using i2c_get_match_data() if the devices are registered via OF/ID. Unify the OF/ID table by using struct adv7180_chip_info as match data for both these tables and replace the ID lookup table for the match data by i2c_get_match_data(). While at it, remove the trailing comma in the terminator entry for the OF table making code robust against (theoretical) misrebases or other similar things where the new entry goes _after_ the termination without the compiler noticing. Signed-off-by: Biju Das Reviewed-by: Jacopo Mondi Signed-off-by: Hans Verkuil commit 0aeccc63f3bc4cfd49dc4893da1409402ee6b295 Author: Fei Shao Date: Fri Sep 8 21:28:04 2023 +0800 media: mtk-jpegenc: Fix bug in JPEG encode quality selection The driver uses the upper-bound approach to decide the target JPEG encode quality, but there's a logic bug that if the desired quality is higher than what the driver can support, the driver falls back to using the worst quality. Fix the bug by assuming using the best quality in the beginning, and with trivial refactor to avoid long lines. Fixes: 45f13a57d813 ("media: platform: Add jpeg enc feature") Signed-off-by: Fei Shao Reviewed-by: Chen-Yu Tsai Signed-off-by: Hans Verkuil commit c3cad51c66bbed05e126b796592ff91033bd9e4e Author: Julia Lawall Date: Thu Sep 7 11:55:21 2023 +0200 media: platform: mtk-mdp3: add missing of_node_put for_each_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. This was done using the Coccinelle semantic patch iterators/for_each_child.cocci Signed-off-by: Julia Lawall Signed-off-by: Hans Verkuil commit cab0c4e94c49641563fa929af0cd6ffb62154acd Author: Hans Verkuil Date: Thu Sep 7 10:54:31 2023 +0200 media: Documentation: dv-timings.rst: explain basic approach Explain how the DV Timings API and the V4L2_EVENT_SOURCE_CHANGE event work together to handle video source changes. Signed-off-by: Hans Verkuil commit 6496617b2b06d7004a5cbd53d48f19567d6b018c Author: Ming Qian Date: Thu Sep 7 09:51:00 2023 +0800 media: amphion: handle firmware debug message decoder firmware may notify host some debug message, it can help analyze the state of the firmware in case of error Fixes: 9f599f351e86 ("media: amphion: add vpu core driver") Signed-off-by: Ming Qian Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil commit f910d3ba78a2677c23508f225eb047d89eb4b2b6 Author: Bryan O'Donoghue Date: Thu Sep 28 01:58:25 2023 +0100 media: qcom: camss: Comment CSID dt_id field Digging into the documentation we find that the DT_ID bitfield is used to map the six bit DT to a two bit ID code. This value is concatenated to the VC bitfield to create a CID value. DT_ID is the two least significant bits of CID and VC the most significant bits. Originally we set dt_id = vc * 4 in and then subsequently set dt_id = vc. commit 3c4ed72a16bc ("media: camss: sm8250: Virtual channels for CSID") silently fixed the multiplication by four which would give a better value for the generated CID without mentioning what was being done or why. Next up I haplessly changed the value back to "dt_id = vc * 4" since there didn't appear to be any logic behind it. Hans asked what the change was for and I honestly couldn't remember the provenance of it, so I dug in. Link: https://lore.kernel.org/linux-arm-msm/edd4bf9b-0e1b-883c-1a4d-50f4102c3924@xs4all.nl/ Add a comment so the next hapless programmer doesn't make this same mistake. Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit 5c07f30bed52ed85673b634f77467e404645785d Author: Bryan O'Donoghue Date: Mon Sep 25 16:47:06 2023 +0100 media: qcom: camss: Propagate vfe_reset error up the callstack A previous patch I had removed the returns from vfe_disable() since we didn't trap any meaningful errors. Konrad pointed out vfe_reset() could return an error, which is true. Trap the vfe_reset() error code and throw it up the callstack. Suggested-by: Konrad Dybcio Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit 90cc4555730bfd0fc6af5c8a5a81d80bfce4cff7 Author: Bryan O'Donoghue Date: Mon Sep 25 16:47:05 2023 +0100 media: qcom: camss: Move vfe_disable into a common routine where applicable We can move vfe_disable() into a common routine in the core VFE file provided we make wm_stop() a VFE specific callback. The callback is required to capture the case where VFE 17x currently isn't VC enabled where as VFE 480 is. Suggested-by: Laurent Pinchart Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit 2ce0bd411b826dca852f7452d267c5f924c5f3f7 Author: Bryan O'Donoghue Date: Mon Sep 25 16:47:04 2023 +0100 media: qcom: camss: Support RDI3 for VFE 17x Some VFEs have four RDIs apiece. Right now the ISR code has a hard-coded value which tops-out at RDI2 meaning only three RDIs can be utilised in practice. Extend out the various routines in camss-vfe-17x.c to support the higher RDI count. Signed-off-by: Bryan O'Donoghue Acked-by: Konrad Dybcio Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 35a62432af1ee9041fde0e1afe1d019ca82516cc Author: Bryan O'Donoghue Date: Mon Sep 25 16:47:03 2023 +0100 media: qcom: camss: Fix support for setting CSIPHY clock name csiphyX Several of our upstream and soon-to-be upstream SoC CAMSS dtsi declare csiphyX as opposed to the older clock name csiX_phy. Right now the CAMSS code will fail to set the csiphyX clock even if we have declared it in our list of clocks. For sdm845 and sm8250 we appear to "get away" with this error, however on sc8280xp we don't. The right approach here is to set the clock when it is declared. If a SoC doesn't require or a SoC driver implementer doesn't think we need, then the clock ought to simply be omitted from the clock list. Include csiphyX in the set of permissible strings which will subsequently lead to the csiphyX clock being set during csiphy_set_clock_rates() phase. sdm845 and sm8250 will work with the code as-is so I've omitted this from a suggested Fixes list. Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit 0727615fb975f69c23a9e71cd0a982be67bfe159 Author: Bryan O'Donoghue Date: Mon Sep 25 16:47:02 2023 +0100 media: qcom: camss: Functionally decompose CSIPHY clock lookups The csiphyX_timer and csiX_phy values need not be hard-coded. We can functionally decompose the string matching inside of a loop. Static string values are brittle, difficult to extend and not required anyway since the camss->res->csiphy_num value informs us of the number of CSIPHYs and hence the set of potential clocks for a given CSIPHY. In simple terms if we have five CSIPHYs we can have no more and no less than five csiphy_timer clocks. Similarly csi_phy core clocks have a 1:1 relationship with the PHY they clock. Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit bcd2adfef23aee34d74e0b0a299e3268182cf27f Author: Bryan O'Donoghue Date: Mon Sep 25 16:47:01 2023 +0100 media: qcom: camss: Allow clocks vfeN vfe_liteN or vfe_lite The number of Video Front End - VFE or Image Front End - IFE supported with new SoCs can vary both for the full and lite cases. For example sdm845 has one vfe_lite and two vfe interfaces with the vfe clock called simply "vfe_lite" with no integer postfix. sc8280xp has four vfe and four vfe lite blocks. At the moment we declare vfe_lite0 and vfe_lite1 for sm8250 but never set those clocks because we don't match the strings. We need to support the following clock name formats - vfeN - vfe_liteN - vfe_lite with N being any reasonably sized integer. There are two sites in this code which need to do the same thing, constructing and matching strings with the pattern above, so encapsulate the logic in one function. Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit 2de3a6546aeee6807b4315107a0131081fd0205e Author: Bryan O'Donoghue Date: Mon Sep 25 16:47:00 2023 +0100 media: qcom: camss: Untangle if/else spaghetti in camss We have a very convoluted if/else legacy here which needs to be rationalised to make it more sustainable. Adding in another Soc or two will make some of these if statements into increasingly large multi-clause behemoths. Introduce switches in the obvious places to despaghetiify. Signed-off-by: Bryan O'Donoghue Acked-by: Konrad Dybcio Signed-off-by: Hans Verkuil commit b2c2715e5aaf959d8f86a8aceccd537ebbdb19f6 Author: Bryan O'Donoghue Date: Mon Sep 25 16:46:59 2023 +0100 media: qcom: camss: Remove special case for VFE get/put From sdm845 onwards we need to ensure the VFE is powered on prior to switching on the CSID. Currently the code tests for sdm845, sm8250 and then does get/set. This is not extensible and it turns out is not necessary either since vfe_get and vfe_set reference count. Remove the over-conservative SoC version check. Signed-off-by: Bryan O'Donoghue Suggested-by: Laurent Pinchart Tested-by: Bryan O'Donoghue # rb3 # db410c Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 7c1340e4c2964d1839c0f9c2e0a4397ab4278b84 Author: Bryan O'Donoghue Date: Mon Sep 25 16:46:58 2023 +0100 media: qcom: camss: Assign the correct number of RDIs per VFE Each Video Front End - VFE - has a variable number of Raw Data Interfaces - RDIs associated with it. The CAMSS code started from a naive implementation where a fixed define was used as a control in a for(){} loop iterating through RDIs. That model scales badly. An attempt was made with VFE_LINE_NUM_GEN2 and VFE_LINE_NUM_GEN1 to differentiate between SoCs but, the problem with that is "gen1" and "gen2" have no meaning in the silicon. There is no fixed constraint in the silicon between VFE and RDI, it is entirely up to the SoC designers how many VFEs are populated and how many RDIs to associate with each VFE. As an example sdm845 has VFE version 175 and sm8250 VFE version 480. sdm845 has 2 VFEs with 4 RDIs and 1 VFE Lite with 4 RDIs. sm8250 has 2 VFEs with 3 RDIs and 2 VFE Lite with 4 RDIs. Clearly then we need a more granular model to capture the necessary data. The defines have gone away to be replaced with per-SoC data but, we haven't populated the parameter data with the real values. Let's call those values out now msm8916: 1 x VFE 3 x RDI per VFE (not 4) msm8996: 2 x VFE 3 x RDI per VFE (not 4) sdm660: 2 x VFE 3 x RDI per VFE (not 4) sdm845: 2 x VFE 4 x RDI per VFE (not 3) 1 x VFE Lite 4 x RDI per VFE Lite (not 3) sm8250: 2 x VFE 3 x RDI per VFE (not 4) 2 x VFE Lite 4 x RDI per VFE Lite This more complex and correct mapping was not possible prior to passing values via driver data. Now that we have that change in place we can correctly map VFEs to RDIs for each VFE. Signed-off-by: Bryan O'Donoghue Acked-by: Konrad Dybcio Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit c23c7998161595b19ee1162da09609c31b5b4393 Author: Bryan O'Donoghue Date: Mon Sep 25 16:46:57 2023 +0100 media: qcom: camss: Pass CAMSS subdev callbacks via resource ops pointer It is possible to pass all of the CAMSS subdevice internal operations pointers from the controlling resources structure with an additional pointer added to the resources structure. This allows for the removal of most of the probe-time control structures. Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit 91719b27926a2e382dba8cb161cb244aebddad71 Author: Bryan O'Donoghue Date: Mon Sep 25 16:46:56 2023 +0100 media: qcom: camss: Pass line_num from compat resources line_num indicates the number of RDI - raw data interface channels which are associated with a given IFE/VFE - image/video front end. On several SoCs the RDI number is not static for each VFE - for example on sm8250 VFE Lite has four RDIs where regular VFE has three. Assigning line_num statically in the subdev_init() phase initialises each VFE to the lower number, meaning in practical terms that we are lobbing off one RDI on some VFEs. Interrupt handling uses static for (i = RDI0; i < RDI2; i++) {} in some of our VFE blocks but this can't work for situations where we have a mixture of VFE @ 3 RDI and VFE-lite @ 4 RDI blocks. First step to remediate is to pass line_num from a compat string controlled data-structure and do so on a per-VFE basis. Later patches will assign the correct number of RDI blocks per VFE. Signed-off-by: Bryan O'Donoghue Reviewed-by: Konrad Dybcio Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 5900b051959ebf56eb5c6687d8cafb48fc34b973 Author: Bryan O'Donoghue Date: Mon Sep 25 16:46:55 2023 +0100 media: qcom: camss: Pass remainder of variables as resources The following variables are being assigned statically based on compatible strings in the probe path. * enum camss_version version; * unsigned int csiphy_num; * unsigned int csid_num; * unsigned int vfe_num; * unsigned int vfe_lite_num; * unsigned int vfe_total_num; Migrate those variables to resource parameters passed in on platform probe arguments. The one caveat is for VFE it has been necessary to intoduce a new variable vfe_total_num to capture the aggregate value of vfe_num + vfe_lite_num. All the rest of the changes are rote camss->variable to camss->res->variable with the parameter tables now populating the listed variables. Signed-off-by: Bryan O'Donoghue Acked-by: Konrad Dybcio Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 9e0c2597779921c03f6265c1ce45b0121004e301 Author: Bryan O'Donoghue Date: Mon Sep 25 16:46:54 2023 +0100 media: qcom: camss: Pass icc bandwidth table as a platform parameter Pass the bandwidth table as a platform parameter not if/else derived pointer to the static table. Signed-off-by: Bryan O'Donoghue Acked-by: Konrad Dybcio Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit de98fe8d1c508c9b1ceb7189a9a84e57ba849578 Author: Bryan O'Donoghue Date: Mon Sep 25 16:46:53 2023 +0100 media: qcom: camss: Start to move to module compat matched resources There is a lot of unnecessary if/elsing in this code that arguably should never have made it upstream when adding a second let alone subsequent SoC. I'm guilty of not fixing the mess myself when adding in the sm8250. Before adding in any new SoCs or resources lets take the time to cleanup the resource passing. First step is to pass the generic struct camss_resources as a parameter per the compatible list. Subsequent patches will address the other somewhat disparate strutures which we are also doing if/else on and assigning statically. Squashed down a commit to drop useless NULL assignment for ispif resources. Signed-off-by: Bryan O'Donoghue Acked-by: Konrad Dybcio Signed-off-by: Hans Verkuil commit 1643b787a2367089148d5577f1bc8db619dc91a1 Author: Bryan O'Donoghue Date: Mon Sep 25 16:46:52 2023 +0100 media: qcom: camss: Rename camss struct resources to camss_subdev_resources Rename non-specific struct resources {} to struct camss_subdev_resources {} Each logical block in CAMSS has a number of regulators, clocks and resets associated with it. We represent these blocks as v4l subdevices. The name "struct camss_subdev_resources" is a more descriptive and accurate name. Suggested-by: Laurent Pinchart Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit 7b5c2ad524f5d4d16fb9fb7ec2ea81bd4d2a6fcb Author: Bryan O'Donoghue Date: Mon Sep 25 16:46:51 2023 +0100 media: qcom: camss: Amalgamate struct resource with struct resource_ispif There is no good reason to differentiate the two resource structures here. As part of a general tidyup of the declaration and passing of resources within in the CAMSS driver it will be advantageous to have one unified resource structure. The two structures are very similar anyway thus leading more credence still to the argument there should be only one. Signed-off-by: Bryan O'Donoghue Acked-by: Konrad Dybcio Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit bd7e2477d737ab78276f9a7369a5d71ca8dd4446 Author: Martin Tůma Date: Mon Sep 25 16:36:05 2023 +0200 media: Documentation: Added Digiteq Automotive MGB4 driver documentation The "admin-guide" documentation for the Digiteq Automotive MGB4 driver. Signed-off-by: Martin Tůma Signed-off-by: Hans Verkuil commit 0ab13674a9bd10514486cf1670d71dbd8afec421 Author: Martin Tůma Date: Mon Sep 25 16:36:04 2023 +0200 media: pci: mgb4: Added Digiteq Automotive MGB4 driver Digiteq Automotive MGB4 is a modular frame grabber PCIe card for automotive video interfaces. As for now, two modules - FPD-Link and GMSL - are available and supported by the driver. The card has two inputs and two outputs (FPD-Link only). In addition to the video interfaces it also provides a trigger signal interface and a MTD interface for FPGA firmware upload. Signed-off-by: Martin Tůma Signed-off-by: Hans Verkuil commit ea1c1e67e631be14f6e6bc9a6e96219c47f31ed4 Author: Tony Lindgren Date: Sat Oct 7 10:32:46 2023 +0300 ARM: dts: omap4-embt2ws: Fix pinctrl single node name warning Looks like one pinctrl single binding warning sneaked in while we were implementing the yaml binding. Let's fix the 'pinmux-wl12xx-gpio' does not match any of the regexes warning by adding -pins suffix. Signed-off-by: Tony Lindgren commit a36f8ac61b043d387e6f71d4f537971f603e8a5a Author: Tony Lindgren Date: Mon Sep 11 06:58:28 2023 +0300 ARM: dts: motorola-mapphone: Add mdm6600 sleep pins The sleep pins never got added earlier probably because the driver was not behaving correctly with the sleep pins. We need the sleep pins to prevent the modem from waking up on it's own if the reset pin glitches in deeper SoC idle states. Cc: Ivaylo Dimitrov Cc: Merlijn Wajer Cc: Pavel Machek Reviewed-by: Sebastian Reichel Message-ID: <20230911035828.36984-1-tony@atomide.com> Signed-off-by: Tony Lindgren commit ba05a7886f057f3b8d199704f8ec3590ff1c5a8c Author: Adam Ford Date: Wed Sep 6 04:51:43 2023 -0500 ARM: dts: am3517: Configure ethernet alias The AM3517 has one ethernet controller called davinci_emac. Configuring the alias allows the MAC address to be passed from the bootloader to Linux. Signed-off-by: Adam Ford Message-ID: <20230906095143.99806-2-aford173@gmail.com> Signed-off-by: Tony Lindgren commit 03eb6d5e6d8e3ac8ab9a868f5d435568cbca6562 Author: Adam Ford Date: Wed Oct 4 19:04:02 2023 -0500 ARM: dts: am3517-evm: Enable Ethernet PHY Interrupt The Ethernet PHY interrupt pin is routed to GPIO_58. Create a PHY node to configure this GPIO for the interrupt to avoid polling. Signed-off-by: Adam Ford Message-ID: <20231005000402.50879-2-aford173@gmail.com> Signed-off-by: Tony Lindgren commit 2ab6b437c65233f06bdd2988fd5913baeca5f159 Author: Adam Ford Date: Wed Oct 4 19:04:01 2023 -0500 ARM: dts: am3517-evm: Fix LED3/4 pinmux The pinmux for LED3 and LED4 are incorrectly attached to the omap3_pmx_core when they should be connected to the omap3_pmx_wkup pin mux. This was likely masked by the fact that the bootloader used to do all the pinmuxing. Fixes: 0dbf99542caf ("ARM: dts: am3517-evm: Add User LEDs and Pushbutton") Signed-off-by: Adam Ford Message-ID: <20231005000402.50879-1-aford173@gmail.com> Signed-off-by: Tony Lindgren commit aff781536c64fcaaefd303f9cdfbf29804319c8a Author: Andreas Kemnade Date: Wed Oct 4 08:53:23 2023 +0200 ARM: dts: omap3-gta04: Drop superfluous omap36xx compatible Drop omap36xx compatible as done in other omap3630 devices. This has apparently fallen through the lattice. Signed-off-by: Andreas Kemnade Message-ID: <20231004065323.2408615-1-andreas@kemnade.info> Signed-off-by: Tony Lindgren commit cc284742c2f3aed75c77bab35f4a2eecdd0469e9 Author: Andreas Kemnade Date: Wed Sep 27 19:32:45 2023 +0200 ARM: dts: omap: omap4-embt2ws: Add IMU at control unit Add also the level-shifter flag to avoid probe failure in magnetometer probe. Signed-off-by: Andreas Kemnade Message-ID: <20230927173245.2151083-4-andreas@kemnade.info> Signed-off-by: Tony Lindgren commit 3385375be6f22fae409eec80284be4f9eabf752a Author: Suraj Kandpal Date: Fri Oct 6 12:58:31 2023 +0530 drm/i915/ddi: Remove redundant intel_connector NULL check Remove redundant intel_connector NULL check. Having it here just creates further confusion and also the variable already gets dereferenced before the aforementioned NULL check Signed-off-by: Suraj Kandpal Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231006072830.581487-1-suraj.kandpal@intel.com commit 717c7c894d4b885e879790f14afbe630802d77d7 Author: Paul E. McKenney Date: Thu Oct 5 10:17:46 2023 -0700 fs/proc: Add boot loader arguments as comment to /proc/bootconfig In kernels built with CONFIG_BOOT_CONFIG_FORCE=y, /proc/cmdline will show all kernel boot parameters, both those supplied by the boot loader and those embedded in the kernel image. This works well for those who just want to see all of the kernel boot parameters, but is not helpful to those who need to see only those parameters supplied by the boot loader. This is especially important when these parameters are presented to the boot loader by automation that might gather them from diverse sources. It is also useful when booting the next kernel via kexec(), in which case it is necessary to supply only those kernel command-line arguments from the boot loader, and most definitely not those that were embedded into the current kernel. Therefore, add comments to /proc/bootconfig of the form: # Parameters from bootloader: # root=UUID=ac0f0548-a69d-43ca-a06b-7db01bcbd5ad ro quiet ... The second added line shows only those kernel boot parameters supplied by the boot loader. Link: https://lore.kernel.org/all/20231005171747.541123-2-paulmck@kernel.org/ Link: https://lore.kernel.org/all/CAHk-=wjpVAW3iRq_bfKnVfs0ZtASh_aT67bQBG11b4W6niYVUw@mail.gmail.com/ Link: https://lore.kernel.org/all/20230731233130.424913-1-paulmck@kernel.org/ Co-developed-by: Masami Hiramatsu Signed-off-by: Paul E. McKenney Cc: Linus Torvalds Cc: Stephen Rothwell Cc: Arnd Bergmann Cc: Nick Desaulniers Cc: Alexey Dobriyan Cc: Andrew Morton Cc: Kees Cook Cc: Cc: Acked-by: Masami Hiramatsu (Google) Signed-off-by: Masami Hiramatsu (Google) commit 1c20c65ea03293bcb08765d320ae32a27b56224b Author: Paul E. McKenney Date: Thu Oct 5 10:17:45 2023 -0700 doc: Update /proc/cmdline documentation to include boot config Update the /proc/cmdline documentation to explicitly state that this file provides kernel boot parameters obtained via boot config from the kernel image as well as those supplied by the boot loader. Link: https://lore.kernel.org/all/20231005171747.541123-1-paulmck@kernel.org/ Signed-off-by: Paul E. McKenney Acked-by: Masami Hiramatsu (Google) Reviewed-by: Randy Dunlap Cc: Jonathan Corbet Cc: Andrew Morton Cc: Stephen Rothwell Cc: Arnd Bergmann Signed-off-by: Masami Hiramatsu (Google) commit f1020c687153609f246f3314db5b74821025c185 Author: Muhammad Usama Anjum Date: Fri Oct 6 15:07:38 2023 +0500 selftests: firmware: remove duplicate unneeded defines These duplicate defines should automatically be picked up from kernel headers. Signed-off-by: Muhammad Usama Anjum Signed-off-by: Shuah Khan commit ec54424923cf943b51dd5bf75fcbe27b0ca2c6ef Author: Muhammad Usama Anjum Date: Fri Oct 6 15:07:37 2023 +0500 selftests: core: remove duplicate defines Remove duplicate defines which are already defined in kernel headers and re-definition isn't required. Signed-off-by: Muhammad Usama Anjum Signed-off-by: Shuah Khan commit 44eebacd6b8f633eb3a38a6db093658636b844e8 Author: Muhammad Usama Anjum Date: Fri Oct 6 15:07:36 2023 +0500 selftests: clone3: remove duplicate defines Remove duplicate defines which are already included in kernel headers. MAX_PID_NS_LEVEL macro is used inside kernel only. It isn't exposed to userspace. So it is never defined in test application. Remove #ifndef in this case. Signed-off-by: Muhammad Usama Anjum Signed-off-by: Shuah Khan commit dfc033059bb6aa7d219fc25d113b3886131b0a6c Author: Muhammad Usama Anjum Date: Fri Oct 6 15:07:35 2023 +0500 selftests: capabilities: remove duplicate unneeded defines These duplicate defines should automatically be picked up from kernel headers. Use KHDR_INCLUDES to add kernel header files. Signed-off-by: Muhammad Usama Anjum Signed-off-by: Shuah Khan commit 48533eca606efcf63ef4080ded5618e0b17ee3d7 Author: Eric Dumazet Date: Thu Oct 5 11:45:04 2023 +0000 net: sock_dequeue_err_skb() optimization Exit early if the list is empty. Some applications using TCP zerocopy are calling recvmsg( ... MSG_ERRQUEUE) and hit this case quite often, probably because busy polling only deals with sk_receive_queue. Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20231005114504.642589-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit f1445032173d4a49eb8b4a0808db499966897d9a Author: Mikulas Patocka Date: Mon Sep 18 17:33:29 2023 +0200 dm: shortcut the calls to linear_map and stripe_map Shortcut the calls to linear_map and stripe_map, so that they don't suffer the overhead of retpolines used for indirect calls. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit a1fb841f9d189d257814562dacb3d65667f2a9c3 Merge: 3abbd0699b678 7d6904bf26b96 Author: Jakub Kicinski Date: Fri Oct 6 16:07:28 2023 -0700 Merge tag 'wireless-next-2023-10-06' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Kalle Valo says: ==================== wireless-next patches for v6.7 The first pull request for v6.7, with both stack and driver changes. We have a big change how locking is handled in cfg80211 and mac80211 which removes several locks and hopefully simplifies the locking overall. In drivers rtw89 got MCC support and smaller features to other active drivers but nothing out of ordinary. Major changes: cfg80211 - remove wdev mutex, use the wiphy mutex instead - annotate iftype_data pointer with sparse - first kunit tests, for element defrag - remove unused scan_width support mac80211 - major locking rework, remove several locks like sta_mtx, key_mtx etc. and use the wiphy mutex instead - remove unused shifted rate support - support antenna control in frame injection (requires driver support) - convert RX_DROP_UNUSABLE to more detailed reason codes rtw89 - TDMA-based multi-channel concurrency (MCC) support iwlwifi - support set_antenna() operation - support frame injection antenna control ath12k - WCN7850: enable 320 MHz channels in 6 GHz band - WCN7850: hardware rfkill support - WCN7850: enable IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS to make scan faster ath11k - add chip id board name while searching board-2.bin * tag 'wireless-next-2023-10-06' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (272 commits) wifi: rtlwifi: remove unreachable code in rtl92d_dm_check_edca_turbo() wifi: rtw89: debug: txpwr table supports Wi-Fi 7 chips wifi: rtw89: debug: show txpwr table according to chip gen wifi: rtw89: phy: set TX power RU limit according to chip gen wifi: rtw89: phy: set TX power limit according to chip gen wifi: rtw89: phy: set TX power offset according to chip gen wifi: rtw89: phy: set TX power by rate according to chip gen wifi: rtw89: mac: get TX power control register according to chip gen wifi: rtlwifi: use unsigned long for rtl_bssid_entry timestamp wifi: rtlwifi: fix EDCA limit set by BT coexistence wifi: rt2x00: fix MT7620 low RSSI issue wifi: rtw89: refine bandwidth 160MHz uplink OFDMA performance wifi: rtw89: refine uplink trigger based control mechanism wifi: rtw89: 8851b: update TX power tables to R34 wifi: rtw89: 8852b: update TX power tables to R35 wifi: rtw89: 8852c: update TX power tables to R67 wifi: rtw89: regd: configure Thailand in regulation type wifi: mac80211: add back SPDX identifier wifi: mac80211: fix ieee80211_drop_unencrypted_mgmt return type/value wifi: rtlwifi: cleanup few rtlxxxx_set_hw_reg() routines ... ==================== Link: https://lore.kernel.org/r/87jzrz6bvw.fsf@kernel.org Signed-off-by: Jakub Kicinski commit 3abbd0699b678fc48e0100704338cff9180fe4bb Author: Giulio Benetti Date: Thu Oct 5 20:29:15 2023 +0200 net: phy: broadcom: add support for BCM5221 phy This patch adds the BCM5221 PHY support by reusing brcm_fet_*() callbacks and adding quirks for BCM5221 when needed. Cc: Jim Reinhart Cc: James Autry Cc: Matthew Maron Signed-off-by: Giulio Benetti Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20231005182915.153815-1-giulio.benetti@benettiengineering.com Signed-off-by: Jakub Kicinski commit e075838734a89e0f6dfb50a1e5716ba53f6d70a3 Merge: 9814ec70fccb7 190c3ad68f389 Author: Jakub Kicinski Date: Fri Oct 6 15:59:26 2023 -0700 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== i40e: House-keeping and clean-up Ivan Vecera says: The series makes some house-keeping tasks on i40e driver: Patch 1: Removes unnecessary back pointer from i40e_hw Patch 2: Moves I40E_MASK macro to i40e_register.h where is used Patch 3: Refactors I40E_MDIO_CLAUSE* to use the common macro Patch 4: Add header dependencies to Patch 5: Simplifies memory alloction functions Patch 6: Moves mem alloc structures to i40e_alloc.h Patch 7: Splits i40e_osdep.h to i40e_debug.h and i40e_io.h Patch 8: Removes circular header deps, fixes and cleans headers Patch 9: Moves DDP specific macros and structs to i40e_ddp.c * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: i40e: Move DDP specific macros and structures to i40e_ddp.c i40e: Remove circular header dependencies and fix headers i40e: Split i40e_osdep.h i40e: Move memory allocation structures to i40e_alloc.h i40e: Simplify memory allocation functions virtchnl: Add header dependencies i40e: Refactor I40E_MDIO_CLAUSE* macros i40e: Move I40E_MASK macro to i40e_register.h i40e: Remove back pointer from i40e_hw structure ==================== Link: https://lore.kernel.org/r/20231005162850.3218594-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 9814ec70fccb78f737cfad25e6e386313ee40233 Author: Justin Stitt Date: Thu Oct 5 01:29:45 2023 +0000 net: atheros: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect netdev->name to be NUL-terminated based on its use with format strings and dev_info(): | dev_info(&adapter->pdev->dev, | "%s link is up %d Mbps %s\n", | netdev->name, adapter->link_speed, | adapter->link_duplex == FULL_DUPLEX ? | "full duplex" : "half duplex"); Furthermore, NUL-padding is not required as netdev is already zero-initialized through alloc_etherdev(). Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231005-strncpy-drivers-net-ethernet-atheros-atlx-atl2-c-v1-1-493f113ebfc7@google.com Signed-off-by: Jakub Kicinski commit 9c9e3ab20f35b2903a4fd3619229e6df7c7986b3 Author: Justin Stitt Date: Thu Oct 5 01:06:26 2023 +0000 net: ax88796c: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. It should be noted that there doesn't currently exist a bug here as DRV_NAME is a small string literal which means no overread bugs are present. Also to note, other ethernet drivers are using strscpy in a similar pattern: | dec/tulip/tulip_core.c | 861: strscpy(info->driver, DRV_NAME, sizeof(info->driver)); | | 8390/ax88796.c | 582: strscpy(info->driver, DRV_NAME, sizeof(info->driver)); | | dec/tulip/dmfe.c | 1077: strscpy(info->driver, DRV_NAME, sizeof(info->driver)); | | 8390/etherh.c | 558: strscpy(info->driver, DRV_NAME, sizeof(info->driver)); Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Reviewed-by: Lukasz Stelmach Link: https://lore.kernel.org/r/20231005-strncpy-drivers-net-ethernet-asix-ax88796c_ioctl-c-v1-1-6fafdc38b170@google.com Signed-off-by: Jakub Kicinski commit 4f08c25702399a53129c5152c5598a3ab6360e1d Author: Linus Walleij Date: Thu Oct 5 00:43:53 2023 +0200 net: ixp4xx_eth: Support changing the MTU As we don't specify the MTU in the driver, the framework will fall back to 1500 bytes and this doesn't work very well when we try to attach a DSA switch: eth1: mtu greater than device maximum ixp4xx_eth c800a000.ethernet eth1: error -22 setting MTU to 1504 to include DSA overhead After locating an out-of-tree patch in OpenWrt I found suitable code to set the MTU on the interface and ported it and updated it. Now the MTU gets set properly. Reviewed-by: Jacob Keller Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20231005-ixp4xx-eth-mtu-v4-1-08c66ed0bc69@linaro.org Signed-off-by: Jakub Kicinski commit 0ff85cb9ce6631d7615fbfc0f816696c71556843 Author: Harini Katakam Date: Thu Oct 5 18:40:39 2023 +0530 MAINTAINERS: Update LL TEMAC entry to Orphan Since there's no alternate driver, change this entry from obsolete to orphan. Signed-off-by: Harini Katakam Link: https://lore.kernel.org/r/20231005131039.25881-1-harini.katakam@amd.com Signed-off-by: Jakub Kicinski commit e794b089cd6e65b9ed2b82e8dc21ea3aa49a3db2 Merge: 1a4890878241d bf176313c62ec Author: Jakub Kicinski Date: Fri Oct 6 15:42:12 2023 -0700 Merge tag 'linux-can-next-for-6.7-20231005' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2023-10-05 The first patch is by Miquel Raynal and fixes a comment in the sja1000 driver. Vincent Mailhol contributes 2 patches that fix W=1 compiler warnings in the etas_es58x driver. Jiapeng Chong's patch removes an unneeded NULL pointer check before dev_put() in the CAN raw protocol. A patch by Justin Stittreplaces a strncpy() by strscpy() in the peak_pci sja1000 driver. The next 5 patches are by me and fix the can_restart() handler and replace BUG_ON()s in the CAN dev helpers with proper error handling. The last 27 patches are also by me and target the at91_can driver. First a new helper function is introduced, the at91_can driver is cleaned up and updated to use the rx-offload helper. * tag 'linux-can-next-for-6.7-20231005' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next: (37 commits) can: at91_can: switch to rx-offload implementation can: at91_can: at91_alloc_can_err_skb() introduce new function can: at91_can: at91_irq_err_line(): send error counters with state change can: at91_can: at91_irq_err_line(): make use of can_change_state() and can_bus_off() can: at91_can: at91_irq_err_line(): take reg_sr into account for bus off can: at91_can: at91_irq_err_line(): make use of can_state_get_by_berr_counter() can: at91_can: at91_irq_err(): rename to at91_irq_err_line() can: at91_can: at91_irq_err_frame(): move next to at91_irq_err() can: at91_can: at91_irq_err_frame(): call directly from IRQ handler can: at91_can: at91_poll_err(): increase stats even if no quota left or OOM can: at91_can: at91_poll_err(): fold in at91_poll_err_frame() can: at91_can: add CAN transceiver support can: at91_can: at91_open(): forward request_irq()'s return value in case or an error can: at91_can: at91_chip_start(): don't disable IRQs twice can: at91_can: at91_set_bittiming(): demote register output to debug level can: at91_can: rename struct at91_priv::{tx_next,tx_echo} to {tx_head,tx_tail} can: at91_can: at91_setup_mailboxes(): update comments can: at91_can: add more register definitions can: at91_can: MCR Register: convert to FIELD_PREP() can: at91_can: MSR Register: convert to FIELD_PREP() ... ==================== Link: https://lore.kernel.org/r/20231005195812.549776-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit 94cfada2a9cadec8e5302294fb1a144addfe6649 Author: Sui Jingfeng Date: Wed Aug 30 19:15:32 2023 +0800 drm/qxl: Use pci_is_vga() to identify VGA devices Use pci_is_vga() to identify VGA devices instead of a private is_vga() function. This means qxl will use the VGA arbiter for old PCI_CLASS_NOT_DEFINED_VGA (0x0001) devices as well as the PCI_CLASS_DISPLAY_VGA (0x0300) devices it recognized previously. This probably doesn't make a difference because qxl_pci_driver doesn't claim PCI_CLASS_NOT_DEFINED_VGA devices by default, so it's mainly a code simplification. Link: https://lore.kernel.org/r/20230830111532.444535-6-sui.jingfeng@linux.dev Signed-off-by: Sui Jingfeng [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas Cc: Dave Airlie Cc: Gerd Hoffmann Cc: David Airlie Cc: Daniel Vetter commit 76432cf63e2f56df23bf72c1ef9e1b3ef87a05d7 Author: Sui Jingfeng Date: Wed Aug 30 19:15:31 2023 +0800 drm/virtio: Use pci_is_vga() to identify VGA devices Use pci_is_vga() to identify VGA devices instead of open-coding the class test. This means virtio_gpu_pci_quirk() will apply to old PCI_CLASS_NOT_DEFINED_VGA (0x0001) devices as well as the PCI_CLASS_DISPLAY_VGA (0x0300) devices it did previously. Link: https://lore.kernel.org/r/20230830111532.444535-5-sui.jingfeng@linux.dev Signed-off-by: Sui Jingfeng [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas Cc: David Airlie Cc: Gerd Hoffmann Cc: Gurchetan Singh Cc: Chia-I Wu Cc: Daniel Vetter commit cdd3cecb521520ff316eea5ee36608b63a8df9f9 Author: Sui Jingfeng Date: Wed Aug 30 19:15:30 2023 +0800 PCI/sysfs: Enable 'boot_vga' attribute via pci_is_vga() Enable the 'boot_vga' sysfs attribute via pci_is_vga(). This exposes 'boot_vga' for old PCI_CLASS_NOT_DEFINED_VGA (0x0001) devices as well as for the PCI_CLASS_DISPLAY_VGA (0x0300) devices where it was previously exposed. Link: https://lore.kernel.org/r/20230830111532.444535-4-sui.jingfeng@linux.dev Signed-off-by: Sui Jingfeng [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas Cc: "Maciej W. Rozycki" commit 300bac9389e09274049fee5d367ae2b296bc8a10 Author: Sui Jingfeng Date: Fri Oct 6 16:48:38 2023 -0500 PCI/VGA: Select VGA devices earlier Select VGA devices in vga_arb_device_init() and pci_notify() instead of in vga_arbiter_add_pci_device(). This is a trivial optimization for adding devices. It's a bigger optimization for the removal case because pci_notify() won't call vga_arbiter_del_pci_device() for non-VGA devices, so it won't have to search the vga_list for them. https://lore.kernel.org/r/20230830111532.444535-3-sui.jingfeng@linux.dev Signed-off-by: Sui Jingfeng [bhelgaas: commit log, split from functional change] Signed-off-by: Bjorn Helgaas commit 655e6fe178960c50bfbb0bfe3c4a12c82b1ad918 Author: Sui Jingfeng Date: Wed Aug 30 19:15:29 2023 +0800 PCI/VGA: Use pci_is_vga() to identify VGA devices Use pci_is_vga() to identify VGA devices, so the arbiter will handle old PCI_CLASS_NOT_DEFINED_VGA (0x0001) devices as well as the PCI_CLASS_DISPLAY_VGA (0x0300) devices it previously handled. Link: https://lore.kernel.org/r/20230830111532.444535-3-sui.jingfeng@linux.dev Signed-off-by: Sui Jingfeng [bhelgaas: commit log, split functional change from optimization] Signed-off-by: Bjorn Helgaas Cc: "Maciej W. Rozycki" commit 7e845ecb2fbfa1bf800e703df29ee2e06592c2a0 Author: Sui Jingfeng Date: Wed Aug 30 19:15:28 2023 +0800 PCI: Add pci_is_vga() helper The PCI Code and ID Assignment spec, r1.15, secs 1.4 and 1.1, define VGA Base Class and Sub-Classes: 03 00 PCI_CLASS_DISPLAY_VGA VGA-compatible or 8514-compatible 00 01 PCI_CLASS_NOT_DEFINED_VGA VGA-compatible (before Class Code) Add a pci_is_vga() helper to return true if a device is in either category. These VGA devices use the hardwired legacy VGA resources ([mem 0xa0000-0xbffff], [io 0x3b0-0x3bb], [io 0x3c0-0x3df] and aliases), so they require special handling if more than one is present in the system. Link: https://lore.kernel.org/r/20230830111532.444535-2-sui.jingfeng@linux.dev Signed-off-by: Sui Jingfeng [bhelgaas: commit log, drop !pdev test] Signed-off-by: Bjorn Helgaas Cc: "Maciej W. Rozycki" commit 84cb9cbd911a3e06c1ff31572706ba0ee3499b19 Author: Kees Cook Date: Fri Oct 6 13:17:00 2023 -0700 bpf: Annotate struct bpf_stack_map with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle [1], add __counted_by for struct bpf_stack_map. Signed-off-by: Kees Cook Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Link: https://lore.kernel.org/bpf/20231006201657.work.531-kees@kernel.org commit d98388cef5315d0235fdcad26600102f54966927 Author: Minjie Du Date: Thu Sep 21 16:15:35 2023 +0800 mm/filemap: increase usage of folio_next_index() helper Simplify code pattern of 'folio->index + folio_nr_pages(folio)' by using the existing helper folio_next_index() in filemap_map_pages(). Link: https://lkml.kernel.org/r/20230921081535.3398-1-duminjie@vivo.com Signed-off-by: Minjie Du Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Yin Fengwei Signed-off-by: Andrew Morton commit 2dc539ac4d2f556105ea7e2a37d23379a79a47eb Author: Florent Revest Date: Mon Aug 28 17:08:58 2023 +0200 kselftest: vm: add tests for no-inherit memory-deny-write-execute Add some tests to cover the new PR_MDWE_NO_INHERIT flag of the PR_SET_MDWE prctl. Check that: - it can't be set without PR_SET_MDWE - MDWE flags can't be unset - when set, PR_SET_MDWE doesn't propagate to children Link: https://lkml.kernel.org/r/20230828150858.393570-7-revest@chromium.org Signed-off-by: Florent Revest Acked-by: Catalin Marinas Reviewed-by: Kees Cook Cc: Alexey Izbyshev Cc: Anshuman Khandual Cc: Ayush Jain Cc: David Hildenbrand Cc: Greg Thelen Cc: Joey Gouly Cc: KP Singh Cc: Mark Brown Cc: Michal Hocko Cc: Peter Xu Cc: Ryan Roberts Cc: Szabolcs Nagy Cc: Topi Miettinen Signed-off-by: Andrew Morton commit 24e41bf8a6b424c76c5902fb999e9eca61bdf83d Author: Florent Revest Date: Mon Aug 28 17:08:57 2023 +0200 mm: add a NO_INHERIT flag to the PR_SET_MDWE prctl This extends the current PR_SET_MDWE prctl arg with a bit to indicate that the process doesn't want MDWE protection to propagate to children. To implement this no-inherit mode, the tag in current->mm->flags must be absent from MMF_INIT_MASK. This means that the encoding for "MDWE but without inherit" is different in the prctl than in the mm flags. This leads to a bit of bit-mangling in the prctl implementation. Link: https://lkml.kernel.org/r/20230828150858.393570-6-revest@chromium.org Signed-off-by: Florent Revest Reviewed-by: Kees Cook Reviewed-by: Catalin Marinas Cc: Alexey Izbyshev Cc: Anshuman Khandual Cc: Ayush Jain Cc: David Hildenbrand Cc: Greg Thelen Cc: Joey Gouly Cc: KP Singh Cc: Mark Brown Cc: Michal Hocko Cc: Peter Xu Cc: Ryan Roberts Cc: Szabolcs Nagy Cc: Topi Miettinen Signed-off-by: Andrew Morton commit 0da668333fb07805c2836d5d50e26eda915b24a1 Author: Florent Revest Date: Mon Aug 28 17:08:56 2023 +0200 mm: make PR_MDWE_REFUSE_EXEC_GAIN an unsigned long Defining a prctl flag as an int is a footgun because on a 64 bit machine and with a variadic implementation of prctl (like in musl and glibc), when used directly as a prctl argument, it can get casted to long with garbage upper bits which would result in unexpected behaviors. This patch changes the constant to an unsigned long to eliminate that possibilities. This does not break UAPI. I think that a stable backport would be "nice to have": to reduce the chances that users build binaries that could end up with garbage bits in their MDWE prctl arguments. We are not aware of anyone having yet encountered this corner case with MDWE prctls but a backport would reduce the likelihood it happens, since this sort of issues has happened with other prctls. But If this is perceived as a backporting burden, I suppose we could also live without a stable backport. Link: https://lkml.kernel.org/r/20230828150858.393570-5-revest@chromium.org Fixes: b507808ebce2 ("mm: implement memory-deny-write-execute as a prctl") Signed-off-by: Florent Revest Suggested-by: Alexey Izbyshev Reviewed-by: David Hildenbrand Reviewed-by: Kees Cook Acked-by: Catalin Marinas Cc: Anshuman Khandual Cc: Ayush Jain Cc: Greg Thelen Cc: Joey Gouly Cc: KP Singh Cc: Mark Brown Cc: Michal Hocko Cc: Peter Xu Cc: Ryan Roberts Cc: Szabolcs Nagy Cc: Topi Miettinen Cc: Signed-off-by: Andrew Morton commit c93d05a729f9646a38aaf53781b447c99cfd86fb Author: Florent Revest Date: Mon Aug 28 17:08:55 2023 +0200 kselftest: vm: check errnos in mdwe_test Invalid prctls return a negative code and set errno. It's good practice to check that errno is set as expected. Link: https://lkml.kernel.org/r/20230828150858.393570-4-revest@chromium.org Signed-off-by: Florent Revest Reviewed-by: Kees Cook Acked-by: Catalin Marinas Cc: Alexey Izbyshev Cc: Anshuman Khandual Cc: Ayush Jain Cc: David Hildenbrand Cc: Greg Thelen Cc: Joey Gouly Cc: KP Singh Cc: Mark Brown Cc: Michal Hocko Cc: Peter Xu Cc: Ryan Roberts Cc: Szabolcs Nagy Cc: Topi Miettinen Signed-off-by: Andrew Morton commit a27e2e2d465e4ed73371974040689ac3e78fe3ee Author: Florent Revest Date: Mon Aug 28 17:08:54 2023 +0200 kselftest: vm: fix mdwe's mmap_FIXED test case I checked with the original author, the mmap_FIXED test case wasn't properly tested and fails. Currently, it maps two consecutive (non overlapping) pages and expects the second mapping to be denied by MDWE but these two pages have nothing to do with each other so MDWE is actually out of the picture here. What the test actually intended to do was to remap a virtual address using MAP_FIXED. However, this operation unmaps the existing mapping and creates a new one so the va is backed by a new page and MDWE is again out of the picture, all remappings should succeed. This patch keeps the test case to make it clear that this situation is expected to work: MDWE shouldn't block a MAP_FIXED replacement. Link: https://lkml.kernel.org/r/20230828150858.393570-3-revest@chromium.org Fixes: 4cf1fe34fd18 ("kselftest: vm: add tests for memory-deny-write-execute") Signed-off-by: Florent Revest Reviewed-by: David Hildenbrand Reviewed-by: Kees Cook Reviewed-by: Catalin Marinas Reviewed-by: Ryan Roberts Tested-by: Ryan Roberts Tested-by: Ayush Jain Cc: Alexey Izbyshev Cc: Anshuman Khandual Cc: Greg Thelen Cc: Joey Gouly Cc: KP Singh Cc: Mark Brown Cc: Michal Hocko Cc: Peter Xu Cc: Szabolcs Nagy Cc: Topi Miettinen Signed-off-by: Andrew Morton commit 29d68b219ff858e11b6bc1477fa7af58db6895c9 Author: Florent Revest Date: Mon Aug 28 17:08:53 2023 +0200 kselftest: vm: fix tabs/spaces inconsistency in the mdwe test Patch series "MDWE without inheritance", v4. Joey recently introduced a Memory-Deny-Write-Executable (MDWE) prctl which tags current with a flag that prevents pages that were previously not executable from becoming executable. This tag always gets inherited by children tasks. (it's in MMF_INIT_MASK) At Google, we've been using a somewhat similar downstream patch for a few years now. To make the adoption of this feature easier, we've had it support a mode in which the W^X flag does not propagate to children. For example, this is handy if a C process which wants W^X protection suspects it could start children processes that would use a JIT. I'd like to align our features with the upstream prctl. This series proposes a new NO_INHERIT flag to the MDWE prctl to make this kind of adoption easier. It sets a different flag in current that is not in MMF_INIT_MASK and which does not propagate. As part of looking into MDWE, I also fixed a couple of things in the MDWE test. The background for this was discussed in these threads: v1: https://lore.kernel.org/all/66900d0ad42797a55259061f757beece@ispras.ru/ v2: https://lore.kernel.org/all/d7e3749c-a718-df94-92af-1cb0fecab772@redhat.com/ This patch (of 6): Fix tabs/spaces inconsistency in the mdwe test. Link: https://lkml.kernel.org/r/20230828150858.393570-1-revest@chromium.org Link: https://lkml.kernel.org/r/20230828150858.393570-2-revest@chromium.org Signed-off-by: Florent Revest Reviewed-by: David Hildenbrand Reviewed-by: Kees Cook Acked-by: Catalin Marinas Cc: Alexey Izbyshev Cc: Anshuman Khandual Cc: Ayush Jain Cc: Greg Thelen Cc: Joey Gouly Cc: KP Singh Cc: Mark Brown Cc: Michal Hocko Cc: Peter Xu Cc: Szabolcs Nagy Cc: Topi Miettinen Cc: Ryan Roberts Signed-off-by: Andrew Morton commit 76a0fb4fd5c940fe4977f2fbdb08167fa16e32f6 Author: liwenyu Date: Wed Sep 20 17:38:49 2023 +0800 delayacct: add memory reclaim delay in get_page_from_freelist The current memory reclaim delay statistics only count the direct memory reclaim of the task in do_try_to_free_pages(). In systems with NUMA open, some tasks occasionally experience slower response times, but the total count of reclaim does not increase, using ftrace can show that node_reclaim has occurred. The memory reclaim occurring in get_page_from_freelist() is also due to heavy memory load. To get the impact of tasks in memory reclaim, this patch adds the statistics of the memory reclaim delay statistics for __node_reclaim(). Link: https://lkml.kernel.org/r/181C946095F0252B+7cc60eca-1abf-4502-aad3-ffd8ef89d910@ex.bilibili.com Signed-off-by: Wen Yu Li Cc: Balbir Singh Cc: Signed-off-by: Andrew Morton commit 7ced098fcfe596feab3cea4f40128b0119c7bf1a Author: Jann Horn Date: Mon Sep 18 22:18:32 2023 +0200 mm: document mmu_notifier_invalidate_range_start_nonblock() Document what mmu_notifier_invalidate_range_start_nonblock() is for. Also add a __must_check annotation to signal that callers must bail out if a notifier vetoes the operation. Link: https://lkml.kernel.org/r/20230918201832.265108-1-jannh@google.com Signed-off-by: Jann Horn Reviewed-by: Jason Gunthorpe Reviewed-by: Alistair Popple Signed-off-by: Andrew Morton commit 840ea53a8dec3aa5773f7957d4eaafdf925c664a Author: Liu Shixin Date: Fri Sep 15 18:58:45 2023 +0800 memcg: remove unused do_memsw_account in memcg1_stat_format Since commit b25806dcd3d5("mm: memcontrol: deprecate swapaccounting=0 mode") do_memsw_account() is synonymous with !cgroup_subsys_on_dfl(memory_cgrp_subsys), It always equals true in memcg1_stat_format(). Remove the unused code. Link: https://lkml.kernel.org/r/20230915105845.3199656-3-liushixin2@huawei.com Signed-off-by: Liu Shixin Suggested-by: Michal Koutný Reviewed-by: Yosry Ahmed Acked-by: Tejun heo Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Kefeng Wang Cc: Michal Hocko Cc: Muchun Song Cc: Roman Gushchin Cc: Shakeel Butt Cc: Zefan Li Signed-off-by: Andrew Morton commit 72a14e821cba73f74aca4bc5f768d77dece8bdb2 Author: Liu Shixin Date: Fri Sep 15 18:58:44 2023 +0800 memcg: expose swapcache stat for memcg v1 Patch series "Expose swapcache stat for memcg v1", v2. Since commit b6038942480e ("mm: memcg: add swapcache stat for memcg v2") adds swapcache stat for the cgroup v2, it seems there is no reason to hide it in memcg v1. Conversely, with swapcached it is more accurate to evaluate the available memory for memcg. Link: https://lkml.kernel.org/r/20230915105845.3199656-1-liushixin2@huawei.com Link: https://lkml.kernel.org/r/20230915105845.3199656-2-liushixin2@huawei.com Signed-off-by: Liu Shixin Suggested-by: Yosry Ahmed Acked-by: Tejun Heo Cc: Johannes Weiner Cc: Jonathan Corbet Cc: Kefeng Wang Cc: Michal Hocko Cc: Michal Koutný Cc: Zefan Li Cc: Roman Gushchin Cc: Johannes Weiner Cc: Shakeel Butt Cc: Muchun Song Signed-off-by: Andrew Morton commit 55d2a0bd5eadaade850efa9d3a7ffbb0aeb67198 Author: Baolin Wang Date: Mon Sep 18 14:31:42 2023 +0800 mm: add statistics for PUD level pagetable Recently, we found that cross-die access to pagetable pages on ARM64 machines can cause performance fluctuations in our business. Currently, there are no PMU events available to track this situation on our ARM64 machines, so accurate pagetable accounting can help to analyze this issue, but now the PUD level pagetable accounting is missed. So introduce pagetable_pud_ctor/dtor() to help to get accurate PUD pagetable accounting, as well as converting the architectures which use generic PUD pagetable allocation to add corresponding PUD pagetable accounting. Moreover this patch will mark the PUD level pagetable with PG_table flag, which will help to do sanity validation in unpoison_memory(). On my testing machine, I can see more pagetables statistics after the patch with page-types tool: Before patch: flags page-count MB symbolic-flags long-symbolic-flags 0x0000000004000000 27326 106 __________________________g_________________ pgtable After patch: 0x0000000004000000 27541 107 __________________________g_________________ pgtable Link: https://lkml.kernel.org/r/876c71c03a7e69c17722a690e3225a4f7b172fb2.1695017383.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Acked-by: Mike Rapoport (IBM) Acked-by: Vishal Moola (Oracle) Cc: Andy Lutomirski Cc: Aneesh Kumar K.V Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Catalin Marinas Cc: Dave Hansen Cc: Huacai Chen Cc: Ingo Molnar Cc: Matthew Wilcox (Oracle) Cc: Nicholas Piggin Cc: Peter Zijlstra Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton commit 51a23b1be92046f0cc52384d30cf060700f1a54e Author: Li Zhijian Date: Wed Aug 2 17:28:56 2023 +0800 acpi,mm: fix typo sibiling -> sibling First found this typo as reviewing memory tier code. Fix it by sed like: $ sed -i 's/sibiling/sibling/g' $(git grep -l sibiling) so the acpi one will be corrected as well. Link: https://lkml.kernel.org/r/20230802092856.819328-1-lizhijian@cn.fujitsu.com Signed-off-by: Li Zhijian Cc: Aneesh Kumar K.V Cc: Huang, Ying Cc: Len Brown Cc: "Rafael J. Wysocki" Signed-off-by: Andrew Morton commit ae2b1c380ef1ce716c38630849e68265b8fdce8c Author: Ville Syrjälä Date: Wed Oct 4 18:56:07 2023 +0300 drm/i915: s/dev_priv/i915/ in the state checker Switch the state checker over to using the new 'i915' variable name insteda of the old 'dev_priv'. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-13-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 3ce6ac8c5eaa03a1116976264172087ce77fccf3 Author: Ville Syrjälä Date: Wed Oct 4 18:56:06 2023 +0300 drm/i915: s/pipe_config/crtc_state/ in the state checker Switch over to the modern variable naming in the state checker. Ie. rename the pipe_config stuff to crtc_state. Also make it clear which is the "software state" (ie. what the current state should be) vs. "hardware state" (ie. what the currnet state really is). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-12-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 4627bef6265d8bf22814f17e941a402f04b121f3 Author: Ville Syrjälä Date: Wed Oct 4 18:56:05 2023 +0300 drm/i915: Simplify the state checker calling convetions We're passing in a totally random mismash of things into the state checker. Clean it up to pass in the minimum needed. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-11-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit a4e71126ac3b0fab91f9d2702322a617837f04f3 Author: Ville Syrjälä Date: Wed Oct 4 18:56:04 2023 +0300 drm/i915: Constify remainder of the state checker Mark the remaining crtc states used by the state checker as const. There is no reason to ever mutate them here. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-10-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 335aa752cf114a0a3f0db4ad903ab92fcee132d0 Author: Ville Syrjälä Date: Wed Oct 4 18:56:03 2023 +0300 drm/i915: Simplify snps/c10x DPLL state checker calling convetion Passing in the atomic state + crtc state is a bit weird. The latter can be just the crtc (which is the normal calling convention used in a lot of other places). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-9-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit c788479a7c5b9a6f9859a058b6420c601764c4e5 Author: Ville Syrjälä Date: Wed Oct 4 18:56:02 2023 +0300 drm/i915: Constify the snps/c10x PLL state checkers State checkers should never modify the crtc states, so make them const. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-8-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 8f0994d47e89711e654df4e31eabb8881079880a Author: Ville Syrjälä Date: Thu Oct 5 15:27:13 2023 +0300 drm/i915: Simplify watermark state checker calling convention There is never any reason to pass in both the crtc and its state as one can always dig out the crtc from its state. But for more consistency across the whole state checker let's just pass the overall atomic state+crtc here as well. v2: Also pass state+crtc here (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231005122713.3531-1-ville.syrjala@linux.intel.com commit 487a2db8bc4eb79c53c9ff8fca65a7fc8350df6c Author: Ville Syrjälä Date: Wed Oct 4 18:56:00 2023 +0300 drm/i915: Constify watermark state checker The skl+ wm state checker has no reason to modify the crtc state, so make it const. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 0aa5369fdb9ee5910a369c321b1c519d49592678 Author: Linus Walleij Date: Fri Oct 6 23:04:19 2023 +0200 pinctrl: realtek: Fix some NULL dereference warnings Just inspecting the code doesn't convince me that this is a real issue, but the tools complain that it is so I will just handle it. Cc: Tzuyi Chang Link: https://lore.kernel.org/oe-kbuild-all/202309270234.aJGlDE0P-lkp@intel.com/ Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20231006-fix-realtek-warnings-v1-2-09af253312ba@linaro.org commit d48f8a6f4a204d679819d6147e9933695f3bee32 Author: Linus Walleij Date: Fri Oct 6 23:04:18 2023 +0200 pinctrl: realtek: Tag unused pins as __maybe_unused These pin definitions are helpful to have when working with the driver in the future, so they are in a sense a bit like documentation. They could be commented out as well, but why. This should fix these build warnings: drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning: 'rtd1315e_boot_sel_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning: 'rtd1315e_reset_n_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning: 'rtd1315e_scan_switch_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning: 'rtd1315e_testmode_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning: 'rtd1315e_wd_rset_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning: 'rtd1319d_boot_sel_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning: 'rtd1319d_reset_n_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning: 'rtd1319d_scan_switch_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning: 'rtd1319d_testmode_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning: 'rtd1319d_wd_rset_pins' defined but not used [-Wunused-const-variable=] Cc: Tzuyi Chang Link: https://lore.kernel.org/oe-kbuild-all/202309270313.mBEc9o1A-lkp@intel.com/ Link: https://lore.kernel.org/oe-kbuild-all/202309270448.7Aen3Sgx-lkp@intel.com/ Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20231006-fix-realtek-warnings-v1-1-09af253312ba@linaro.org commit 8c58f51ff3c9f2bba5d2d0d01f5561f579e4f485 Author: Dan Carpenter Date: Thu Oct 5 17:01:25 2023 +0300 pinctrl: realtek: Fix error handling in probe() There are several issues in the probe function: 1) of_iomap() return NULL on error but the code checks for error pointers. 2) pinctrl_register() is the reverse. It returns error pointers but the code checks for NULL. 3) The error paths need to call iounmap(data->base) before returning to avoid a resource leak. Fixes: e99ce78030db ("pinctrl: realtek: Add common pinctrl driver for Realtek DHC RTD SoCs") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/590b337a-13ce-4391-a09d-d2b06fbc912d@moroto.mountain Signed-off-by: Linus Walleij commit 4d6e198a3ae38c477543abe771679f377bfa72ec Author: Ville Syrjälä Date: Wed Oct 4 18:55:59 2023 +0300 drm/i915: Simplify DPLL state checker calling convention Make life simpler by just passing in the atomic state + crtc instead of plumbing in all kinds of crtc states. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit cfc7109bf6d1f51548308beb52326035304313cb Author: Ville Syrjälä Date: Wed Oct 4 18:55:58 2023 +0300 drm/i915: Constify the crtc states in the DPLL checker The DPLL state checker should not be modifying the crtc states, so make the const. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 2745bdda20952fa9ef0a1af415de89fb4f5dd2bd Author: Ville Syrjälä Date: Wed Oct 4 18:55:57 2023 +0300 drm/i915: Stop clobbering old crtc state during state check The state checker overwrites the old crtc state with the current hardware state. While that does save a kmalloc() it seems rather dubious as there might still be something that we need in the old crtc state. Stop doing that and just allocate a temporary state for the state checker. Should the extra malloc during the commit phase turn out too annoying we could of course preallocate one for each crtc, but let's proceed with the straightforward approch for now. And while at it let's mark the new crtc state as const to make sure the state checker doesn't mess it up. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 12e03c805806829e823a1154d43cdfef68cb12c3 Author: Ville Syrjälä Date: Wed Oct 4 18:55:56 2023 +0300 drm/i915/psr: Unify PSR pre/post plane update hooks intel_psr_pre_plane_update() operates on a per-crtc level, whereas intel_psr_post_plane_update() operates on the whole atomic commit, for no real reason that I can see. Adjust intel_psr_post_plane_update() to match the intel_psr_pre_plane_update() approach. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit f82060480095a909291adc90d5579f50b6ec0627 Author: Andy Shevchenko Date: Mon Jul 24 16:43:01 2023 +0300 asm-generic: Fix spelling of architecture Fix spelling of "architecture" in the Kbuild file. Signed-off-by: Andy Shevchenko Acked-by: Randy Dunlap Signed-off-by: Arnd Bergmann commit 2fd0ebad27bcd4c8fc61c61a98d4283c47054bcf Author: Sohil Mehta Date: Thu Sep 14 18:58:03 2023 +0000 arch: Reserve map_shadow_stack() syscall number for all architectures commit c35559f94ebc ("x86/shstk: Introduce map_shadow_stack syscall") recently added support for map_shadow_stack() but it is limited to x86 only for now. There is a possibility that other architectures (namely, arm64 and RISC-V), that are implementing equivalent support for shadow stacks, might need to add support for it. Independent of that, reserving arch-specific syscall numbers in the syscall tables of all architectures is good practice and would help avoid future conflicts. map_shadow_stack() is marked as a conditional syscall in sys_ni.c. Adding it to the syscall tables of other architectures is harmless and would return ENOSYS when exercised. Note, map_shadow_stack() was assigned #453 during the merge process since #452 was taken by fchmodat2(). For Powerpc, map it to sys_ni_syscall() as is the norm for Powerpc syscall tables. For Alpha, map_shadow_stack() takes up #563 as Alpha still diverges from the common syscall numbering system in the other architectures. Link: https://lore.kernel.org/lkml/20230515212255.GA562920@debug.ba.rivosinc.com/ Link: https://lore.kernel.org/lkml/b402b80b-a7c6-4ef0-b977-c0f5f582b78a@sirena.org.uk/ Signed-off-by: Sohil Mehta Reviewed-by: Rick Edgecombe Reviewed-by: Arnd Bergmann Acked-by: Michael Ellerman (powerpc) Acked-by: Catalin Marinas Acked-by: Geert Uytterhoeven Signed-off-by: Arnd Bergmann commit cfa36f889f232eb32e15b4ea6a688a5c5a9d19e9 Author: Kees Cook Date: Fri Sep 22 10:52:00 2023 -0700 sparc: Annotate struct cpuinfo_tree with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct cpuinfo_tree. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: "David S. Miller" Cc: sparclinux@vger.kernel.org Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175159.work.357-kees@kernel.org Signed-off-by: Kees Cook commit e7a1b32e43b194bbf930281ae7f5149c420cd122 Author: Pierre Gondois Date: Thu Oct 5 15:41:20 2023 +0200 cpufreq: Rebuild sched-domains when removing cpufreq driver The Energy Aware Scheduler (EAS) relies on the schedutil governor. When moving to/from the schedutil governor, sched domains must be rebuilt to allow re-evaluating the enablement conditions of EAS. This is done through sched_cpufreq_governor_change(). Having a cpufreq governor assumes a cpufreq driver is running. Inserting/removing a cpufreq driver should trigger a re-evaluation of EAS enablement conditions, avoiding to see EAS enabled when removing a running cpufreq driver. Rebuild the sched domains in schedutil's sugov_init()/sugov_exit(), allowing to check EAS's enablement condition whenever schedutil governor is initialized/exited from. Move relevant code up in schedutil.c to avoid a split and conditional function declaration. Rename sched_cpufreq_governor_change() to sugov_eas_rebuild_sd(). Signed-off-by: Pierre Gondois Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 9ef0ad49cc860c0860026c01abea68878c6d72f7 Author: Liao Chang Date: Tue Sep 12 06:10:57 2023 +0000 cpufreq: userspace: Move is_managed indicator into per-policy structure The userspace governor uses the 'cpu' field of cpufreq_policy structure to track if it is allowed to set the speed of the policy. However, there is a window where the 'cpu' field is equal to the value of nr_cpus_id when all affected CPUs of policy are offline, which is an illegal value to get the per-CPU variable. To avoid this issue, modify the governor to use a per-policy indicator to track if the policy is managed. Signed-off-by: Liao Chang Acked-by: Viresh Kumar [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit 285189c57391360701af348cd57ca0ba8cbf7ff6 Author: Liao Chang Date: Tue Sep 12 06:10:56 2023 +0000 cpufreq: userspace: Use fine-grained mutex in userspace governor The userspace governor currently uses a big global mutex to avoid the race condition on the governor_data field of cpufreq_policy structure. This leads to a low concurrency if multiple userspace applications are trying to set the speed of different policies at the same time. Introduce a per-policy mutex to allow the updating of different policies to be performed concurrently, improving overall concurrency. Signed-off-by: Liao Chang Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 842c34a2668f68ebe15d0fc9dc19d33733bb428d Author: Liao Chang Date: Tue Sep 12 06:09:42 2023 +0000 cpufreq: conservative: Simplify the condition of storing 'down_threshold' The governor currently checks if the input new down_threshold is less than 100 before storing it, but the up_threshold field of dbs_data structure is also limited to be less than 100, so this check is unnecessary and remove it. Signed-off-by: Liao Chang Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 16a03c71bba012b4cc31f34e00007c34ef5a58df Author: Liao Chang Date: Fri Sep 8 03:16:04 2023 +0000 cpufreq: schedutil: Merge initialization code of sg_cpu in single loop The initialization code of the per-cpu sg_cpu struct is currently split into two for-loop blocks. This can be simplified by merging the two blocks into a single loop. This will make the code more maintainable. Signed-off-by: Liao Chang Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit aa2e505c80ba604077f8eca633f542bdb24217a2 Merge: 8a749fd1a8720 a46e42c097982 Author: Rafael J. Wysocki Date: Fri Oct 6 21:32:08 2023 +0200 Merge tag 'acpi-pcc-updates-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux Merge ACPI PCC changes for v6.7 from Sudeep Holla: "ACPI: PCC: Mailbox and generic updates for v6.7 Main updates include: 1. Addition of support for Type 4 PCC subspace that enables platform notification handling (Huisong Li). 2. Support for the shared interrupt amongst multiple PCC subspaces/ channels (Huisong Li). 3. Consolidation of PCC shared memory region command and status bitfields definitions that were duplicated and scattered across multiple PCC client drivers (Sudeep Holla)." * tag 'acpi-pcc-updates-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: soc: kunpeng_hccs: Migrate to use generic PCC shmem related macros hwmon: (xgene) Migrate to use generic PCC shmem related macros i2c: xgene-slimpro: Migrate to use generic PCC shmem related macros ACPI: PCC: Add PCC shared memory region command and status bitfields mailbox: pcc: Support shared interrupt for multiple subspaces mailbox: pcc: Add support for platform notification handling commit 43b0294abaceec20943c4ae222a0839b353a055f Author: Liu Song Date: Wed Jul 20 15:22:03 2022 +0800 PCI: Replace unnecessary UTF-8 in Kconfig The CONFIG_PCI_P2PDMA Kconfig help text contains a Cyrillic small "Dze" (ѕ). When menuconfig renders it, it looks like "Enable ~U drivers" instead of "Enables drivers". Replace it by a plain "s" so the help text is displayed correctly by menuconfig. Uwe Kleine-König later posted the same patch at https://lore.kernel.org/r/20231006150209.87666-1-u.kleine-koenig@pengutronix.de Link: https://lore.kernel.org/r/1658301723-111283-1-git-send-email-liusong@linux.alibaba.com Tested-by: Randy Dunlap Signed-off-by: Liu Song [bhelgaas: commit log, add Uwe's report] Signed-off-by: Bjorn Helgaas Acked-by: Randy Dunlap commit fdd11c14c33b949a4d59fab159fb2da834073914 Author: Geliang Tang Date: Fri Oct 6 18:32:16 2023 +0800 selftests/bpf: Add pairs_redir_to_connected helper Extract duplicate code from these four functions unix_redir_to_connected() udp_redir_to_connected() inet_unix_redir_to_connected() unix_inet_redir_to_connected() to generate a new helper pairs_redir_to_connected(). Create the different socketpairs in these four functions, then pass the socketpairs info to the new common helper to do the connections. Signed-off-by: Geliang Tang Link: https://lore.kernel.org/r/54bb28dcf764e7d4227ab160883931d2173f4f3d.1696588133.git.geliang.tang@suse.com Signed-off-by: Martin KaFai Lau commit 0af3aace5b91b0e46b33f4e5eb137bea5730fa76 Author: Andrii Nakryiko Date: Fri Oct 6 10:57:44 2023 -0700 selftests/bpf: Don't truncate #test/subtest field We currently expect up to a three-digit number of tests and subtests, so: #999/999: some_test/some_subtest: ... Is the largest test/subtest we can see. If we happen to cross into 1000s, current logic will just truncate everything after 7th character. This patch fixes this truncate and allows to go way higher (up to 31 characters in total). We still nicely align test numbers: #60/66 core_reloc_btfgen/type_based___incompat:OK #60/67 core_reloc_btfgen/type_based___fn_wrong_args:OK #60/68 core_reloc_btfgen/type_id:OK #60/69 core_reloc_btfgen/type_id___missing_targets:OK #60/70 core_reloc_btfgen/enumval:OK Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20231006175744.3136675-3-andrii@kernel.org commit 46475cc0dded2cd832a906fae4f91fd0ab73904b Author: Andrii Nakryiko Date: Fri Oct 6 10:57:43 2023 -0700 selftests/bpf: Support building selftests in optimized -O2 mode Add support for building selftests with -O2 level of optimization, which allows more compiler warnings detection (like lots of potentially uninitialized usage), but also is useful to have a faster-running test for some CPU-intensive tests. One can build optimized versions of libbpf and selftests by running: $ make RELEASE=1 There is a measurable speed up of about 10 seconds for me locally, though it's mostly capped by non-parallelized serial tests. User CPU time goes down by total 40 seconds, from 1m10s to 0m28s. Unoptimized build (-O0) ======================= Summary: 430/3544 PASSED, 25 SKIPPED, 4 FAILED real 1m59.937s user 1m10.877s sys 3m14.880s Optimized build (-O2) ===================== Summary: 425/3543 PASSED, 25 SKIPPED, 9 FAILED real 1m50.540s user 0m28.406s sys 3m13.198s Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Reviewed-by: Alan Maguire Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20231006175744.3136675-2-andrii@kernel.org commit 925a01577ea5a70416731c00e42b74c97f41cb6a Author: Andrii Nakryiko Date: Fri Oct 6 10:57:42 2023 -0700 selftests/bpf: Fix compiler warnings reported in -O2 mode Fix a bunch of potentially unitialized variable usage warnings that are reported by GCC in -O2 mode. Also silence overzealous stringop-truncation class of warnings. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20231006175744.3136675-1-andrii@kernel.org commit bc5bc309db45a7ab218ce8259ba9bc7659be61ca Author: Yafang Shao Date: Thu Oct 5 08:41:23 2023 +0000 bpf: Inherit system settings for CPU security mitigations Currently, there exists a system-wide setting related to CPU security mitigations, denoted as 'mitigations='. When set to 'mitigations=off', it deactivates all optional CPU mitigations. Therefore, if we implement a system-wide 'mitigations=off' setting, it should inherently bypass Spectre v1 and Spectre v4 in the BPF subsystem. Please note that there is also a more specific 'nospectre_v1' setting on x86 and ppc architectures, though it is not currently exported. For the time being, let's disregard more fine-grained options. This idea emerged during our discussion about potential Spectre v1 attacks with Luis [0]. [0] https://lore.kernel.org/bpf/b4fc15f7-b204-767e-ebb9-fdb4233961fb@iogearbox.net Signed-off-by: Yafang Shao Signed-off-by: Daniel Borkmann Acked-by: Stanislav Fomichev Acked-by: Song Liu Acked-by: KP Singh Cc: Luis Gerhorst Link: https://lore.kernel.org/bpf/20231005084123.1338-1-laoar.shao@gmail.com commit 9ee4318c157b9802589b746cc340bae3142d984c Author: Kirill A. Shutemov Date: Fri Oct 6 17:45:49 2023 +0300 x86/tdx: Mark TSC reliable In x86 virtualization environments, including TDX, RDTSC instruction is handled without causing a VM exit, resulting in minimal overhead and jitters. On the other hand, other clock sources (such as HPET, ACPI timer, APIC, etc.) necessitate VM exits to implement, resulting in more fluctuating measurements compared to TSC. Thus, those clock sources are not effective for calibrating TSC. As a foundation, the host TSC is guaranteed to be invariant on any system which enumerates TDX support. TDX guests and the TDX module build on that foundation by enforcing: - Virtual TSC is monotonously incrementing for any single VCPU; - Virtual TSC values are consistent among all the TD’s VCPUs at the level supported by the CPU: + VMM is required to set the same TSC_ADJUST; + VMM must not modify from initial value of TSC_ADJUST before SEAMCALL; - The frequency is determined by TD configuration: + Virtual TSC frequency is specified by VMM on TDH.MNG.INIT; + Virtual TSC starts counting from 0 at TDH.MNG.INIT; The result is that a reliable TSC is a TDX architectural guarantee. Use the TSC as the only reliable clock source in TD guests, bypassing unstable calibration. This is similar to what the kernel already does in some VMWare and HyperV environments. [ dhansen: changelog tweaks ] Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Kuppuswamy Sathyanarayanan Reviewed-by: Erdem Aktas Reviewed-by: Isaku Yamahata Acked-by: Kai Huang Link: https://lore.kernel.org/all/20231006144549.2633-1-kirill.shutemov%40linux.intel.com commit 470508f63ad2483b1ae82ed67cd504ad408b2a35 Author: Rafael J. Wysocki Date: Fri Oct 6 17:32:51 2023 +0200 ACPI: bus: Add context argument to acpi_dev_install_notify_handler() Add void *context arrgument to the list of arguments of acpi_dev_install_notify_handler() and modify it to pass that argument as context to acpi_install_notify_handler() instead of its first argument which is problematic in general (for example, if platform drivers used it, they would rather get struct platform_device pointers or pointers to their private data from the context arguments of their notify handlers). Make all of the current callers of acpi_dev_install_notify_handler() take this change into account so as to avoid altering the general functionality. Co-developed-by: Michal Wilczynski Signed-off-by: Michal Wilczynski Signed-off-by: Rafael J. Wysocki commit 5f3c10ac34ec2dc199e5bcc3ff856b42cf0e12df Author: Rafael J. Wysocki Date: Fri Oct 6 17:29:53 2023 +0200 ACPI: docs: enumeration: Clarify ACPI bus concepts In some cases, ACPI drivers are implemented as a way to manage devices enumerated with the help of the platform firmware through ACPI. This might be confusing, since the preferred way to implement a driver for a device that cannot be enumerated natively, is a platform driver, as stated in the documentation. Clarify relationships between ACPI device objects, platform devices and ACPI Namespace entries. Suggested-by: Elena Reshetova Co-developed-by: Michal Wilczynski Signed-off-by: Michal Wilczynski Signed-off-by: Rafael J. Wysocki commit 378f2b618fedc9e2f57755438e8f080fde3ccc90 Merge: a41357adbf03d 8634c1114b940 Author: Ilpo Järvinen Date: Fri Oct 6 17:51:21 2023 +0300 Merge branch 'pdx86/platform-drivers-x86-mellanox-init' into review-ilpo commit df22568ad8ed317db95acc11e1c08bae7a0fba5d Author: Greg Kroah-Hartman Date: Fri Oct 6 15:58:40 2023 +0200 spi: spidev: make spidev_class constant Now that the driver core allows for struct class to be in read-only memory, we should make all 'class' structures declared at build time placing them into read-only memory, instead of having to be dynamically allocated at runtime. Cc: Mark Brown Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/2023100639-celtic-herbs-66be@gregkh Signed-off-by: Mark Brown commit a702d4f016788f83ed02666930992d792e9a80cc Author: Jerome Brunet Date: Fri Oct 6 12:35:00 2023 +0200 arm64: dts: amlogic: add libretech cottonwood support Add support for the Libretech cottonwood board family. These 2 boards are based on the same PCB, with an RPi B form factor. The "Alta" board uses an a311d while the "Solitude" variant uses an s905d3. Co-developed-by: Da Xue Signed-off-by: Da Xue Signed-off-by: Jerome Brunet Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20231006103500.2015183-3-jbrunet@baylibre.com [narmstrong: squashed blue/green led inversion fix] Signed-off-by: Neil Armstrong commit 8634c1114b94049b48805b412b28160cb25a3198 Author: Vadim Pasternak Date: Thu Oct 5 07:56:15 2023 +0000 platform: mellanox: Fix misspelling error in routine name Change mlxplat_i2c_main_complition_notify() to mlxplat_i2c_main_completion_notify(). Signed-off-by: Vadim Pasternak Link: https://lore.kernel.org/r/20231005075616.42777-3-vadimp@nvidia.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit b26bcdd5f03e0b9fdd5dd8567b620538c5058c54 Author: Vadim Pasternak Date: Thu Oct 5 07:56:16 2023 +0000 platform: mellanox: Rename some init()/exit() functions for consistent naming Currently some names of init()/exit() pairing function are not consistent. Rename pair mlxplat_pre_init()/mlxplat_post_exit() to respectively mlxplat_logicdev_init()/mlxplat_logicdev_exit(). Rename pair mlxplat_post_init()/mlxplat_pre_exit() to respectively mlxplat_platdevs_init()/mlxplat_platdevs_exit(). Signed-off-by: Vadim Pasternak Link: https://lore.kernel.org/r/20231005075616.42777-4-vadimp@nvidia.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 85a6af284d1c720d78683b550bb5d32bc84e3cfc Merge: e22ece0f653dc 4df7d6a61f2c0 Author: Mark Brown Date: Fri Oct 6 15:39:19 2023 +0100 ASoC: SOF: ipc4: Take priority into cosideration when Merge series from Peter Ujfalusi : Add pipeline priority support for IPC4: Add support for parsing pipeline priorities from the topology. This will be used to break the tie between pipelines to set the trigger order when multiple pipelines are triggered simultaneously. commit c9b21ef0d0a87695d7bfeee9a04b89760b49ccf5 Author: Sudeep Holla Date: Thu Oct 5 15:45:06 2023 +0100 firmware: arm_ffa: Simplify the computation of transmit and fragment length The computation of endpoint memory access descriptor's composite memory region descriptor offset is using COMPOSITE_CONSTITUENTS_OFFSET which is unnecessary complicated. Composite memory region descriptor always follow the endpoint memory access descriptor array and hence it is computed accordingly. COMPOSITE_CONSTITUENTS_OFFSET is useless and wrong for any input other than endpoint memory access descriptor count. Let us drop the usage of COMPOSITE_CONSTITUENTS_OFFSET to simplify the computation of total transmit and fragment length in the memory transactions. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-13-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit 1b6bf41b7a65cf2ce4485f740a2764529635153c Author: Sudeep Holla Date: Thu Oct 5 15:45:05 2023 +0100 firmware: arm_ffa: Add notification handling mechanism With all the necessary plumbing in place, let us add handling the notifications as part of schedule receiver interrupt handler. In order to do so, we need to just register scheduling callback on behalf of the driver partition. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-12-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit e5adb3b20e39dbf18651322a9bc24eb55050188f Author: Sudeep Holla Date: Thu Oct 5 15:45:04 2023 +0100 firmware: arm_ffa: Add interface to send a notification to a given partition The framework provides an interface to the sender endpoint to specify the notification to signal to the receiver endpoint. A sender signals a notification by requesting its partition manager to set the corresponding bit in the notifications bitmap of the receiver. Expose the ability to send a notification to another partition. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-11-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit e0573444edbf4ee7e3c191d3d08a4ccbd26628be Author: Sudeep Holla Date: Thu Oct 5 15:45:03 2023 +0100 firmware: arm_ffa: Add interfaces to request notification callbacks Add interface to the FFA driver to allow for client drivers to request and relinquish a notification as well as provide a callback for the notification. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-10-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit 0184450b8b1e7734110472616c4758839e1aff96 Author: Sudeep Holla Date: Thu Oct 5 15:45:02 2023 +0100 firmware: arm_ffa: Add schedule receiver callback mechanism Enable client drivers to register a callback function that will be called when one or more notifications are pending for a target partition as part of schedule receiver interrupt handling. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-9-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit 897e9e60c0168ae46f168290548ea24bbbc4005e Author: Sudeep Holla Date: Thu Oct 5 15:45:01 2023 +0100 firmware: arm_ffa: Initial support for scheduler receiver interrupt The Framework uses the schedule receiver interrupt to inform the receiver’s scheduler that the receiver must be run to handle a pending notification. A receiver’s scheduler can obtain the description of the schedule receiver interrupt by invoking the FFA_FEATURES interface. The delivery of the physical schedule receiver interrupt from the secure state to the non-secure state depends upon the state of the interrupt controller as configured by the hypervisor. The schedule seceiver interrupt is assumed to be a SGI. The Arm GIC specification defines 16 SGIs. It recommends that they are equally divided between the non-secure and secure states. OS like Linux kernel in the non-secure state typically do not have SGIs to spare. The usage of SGIs in the secure state is however limited. It is more likely that software in the Secure world does not use all the SGIs allocated to it. It is recommended that the secure world software donates an unused SGI to the normal world for use as the schedule receiver interrupt. This implies that secure world software must configure the SGI in the GIC as a non-secure interrupt before presenting it to the normal world. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-8-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit 3522be48d82b58821442f666eca8b4e547255810 Author: Sudeep Holla Date: Thu Oct 5 15:45:00 2023 +0100 firmware: arm_ffa: Implement the NOTIFICATION_INFO_GET interface The receiver’s scheduler uses the FFA_NOTIFICATION_INFO_GET interface to retrieve the list of endpoints that have pending notifications and must be run. A notification could be signaled by a sender in the secure world to a VM. The Hypervisor needs to determine which VM and vCPU (in case a per-vCPU notification is signaled) has a pending notification in this scenario. It must obtain this information through an invocation of the FFA_NOTIFICATION_INFO_GET. Add the implementation of the NOTIFICATION_INFO_GET interface and prepare to use this to handle the schedule receiver interrupt. Implementation of handling notifications will be added later. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-7-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit faa19623e3e1c8a69b1878132187a171d7a51f98 Author: Sudeep Holla Date: Thu Oct 5 15:44:59 2023 +0100 firmware: arm_ffa: Implement the FFA_NOTIFICATION_GET interface The framework provides an interface to the receiver to determine the identity of the notification. A receiver endpoint must use the FFA_NOTIFICATION_GET interface to retrieve its pending notifications and handle them. Add the support for FFA_NOTIFICATION_GET to allow the caller(receiver) to fetch its pending notifications from other partitions in the system. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-6-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit 47561777d69400356aa5b3d4e14411eb9e5784ea Author: Sudeep Holla Date: Thu Oct 5 15:44:58 2023 +0100 firmware: arm_ffa: Implement the FFA_NOTIFICATION_SET interface The framework provides an interface to the sender to specify the notification to signal to the receiver. A sender signals a notification by requesting its partition manager to set the corresponding bit in the notifications bitmap of the receiver invoking FFA_NOTIFICATION_SET. Implement the FFA_NOTIFICATION_SET to enable the caller(sender) to send the notifications for any other partitions in the system. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-5-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit fe2ddb6b42358ad25a6aed30512fb284522335f3 Author: Sudeep Holla Date: Thu Oct 5 15:44:57 2023 +0100 firmware: arm_ffa: Implement the FFA_RUN interface FFA_RUN is used by a scheduler to allocate CPU cycles to a target endpoint execution context specified in the target information parameter. If the endpoint execution context is in the waiting/blocked state, it transitions to the running state. Expose the ability to call FFA_RUN in order to give any partition in the system cpu cycles to perform IMPDEF functionality. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-4-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit 933db703e8ce3e30bb9f282afe73f7316338036b Author: Sudeep Holla Date: Thu Oct 5 15:44:56 2023 +0100 firmware: arm_ffa: Implement the notification bind and unbind interface A receiver endpoint must bind a notification to any sender endpoint before the latter can signal the notification to the former. The receiver assigns one or more doorbells to a specific sender. Only the sender can ring these doorbells. A receiver uses the FFA_NOTIFICATION_BIND interface to bind one or more notifications to the sender. A receiver un-binds a notification from a sender endpoint to stop the notification from being signaled. It uses the FFA_NOTIFICATION_UNBIND interface to do this. Allow the FF-A driver to be able to bind and unbind a given notification ID to a specific partition ID. This will be used to register and unregister notification callbacks from the FF-A client drivers. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-3-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit 192e88cfea8ce2d85ab70fa1c8d768042e00b7f1 Author: Sudeep Holla Date: Thu Oct 5 15:44:55 2023 +0100 firmware: arm_ffa: Implement notification bitmap create and destroy interfaces On systems without a hypervisor the responsibility of requesting the creation of the notification bitmaps in the SPM falls to the FF-A driver. We use FFA features to determine if the ABI is supported, if it is not we can assume there is a hypervisor present and will take care of ensure the relevant notifications bitmaps are created on this partitions behalf. An endpoint’s notification bitmaps needs to be setup before it configures its notifications and before other endpoints and partition managers can start signaling these notifications. Add interface to create and destroy the notification bitmaps and use the same to do the necessary setup during the initialisation and cleanup during the module exit. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-2-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit 1609626c32c4538439f6333d0b6c912af9f13b77 Author: Sudeep Holla Date: Thu Oct 5 15:44:54 2023 +0100 firmware: arm_ffa: Update the FF-A command list with v1.1 additions Arm Firmware Framework for A-profile(FFA) v1.1 introduces notifications and indirect messaging based upon notifications support and extends some of the memory interfaces. Let us add all the newly supported FF-A function IDs in the spec. Also update to the error values and associated handling. Link: https://lore.kernel.org/r/20231005-ffa_v1-1_notif-v4-1-cddd3237809c@arm.com Signed-off-by: Sudeep Holla commit 22779149e93d956e9d266f545b26e548bf5b132d Author: Sudeep Holla Date: Thu Oct 5 18:56:40 2023 +0100 firmware: arm_ffa: Emit modalias for FF-A devices In order to enable libkmod lookups for FF-A device objects to their corresponding module, add 'modalias' to the base attribute of FF-A devices. Tested-by: Abdellatif El Khlifi Link: https://lore.kernel.org/r/20231005175640.379631-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit 2d698e8b4fd22374dac0a2d5150ab24d57a222ab Author: Sudeep Holla Date: Thu Oct 5 15:28:23 2023 +0100 firmware: arm_ffa: Allow the FF-A drivers to use 32bit mode of messaging An FF-A ABI could support both the SMC32 and SMC64 conventions. A callee that runs in the AArch64 execution state and implements such an ABI must implement both SMC32 and SMC64 conventions of the ABI. So the FF-A drivers will need the option to choose the mode irrespective of FF-A version and the partition execution mode flag in the partition information. Let us remove the check on the FF-A version for allowing the selection of 32bit mode of messaging. The driver will continue to set the 32-bit mode if the partition execution mode flag specified that the partition supports only 32-bit execution. Fixes: 106b11b1ccd5 ("firmware: arm_ffa: Set up 32bit execution mode flag using partiion property") Link: https://lore.kernel.org/r/20231005142823.278121-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit 7d0bc6360f17ea323ab25939a34857123d7d87e5 Author: Sudeep Holla Date: Tue Oct 3 09:59:32 2023 +0100 firmware: arm_ffa: Assign the missing IDR allocation ID to the FFA device Commit 19b8766459c4 ("firmware: arm_ffa: Fix FFA device names for logical partitions") added an ID to the FFA device using ida_alloc() and append the same to "arm-ffa" to make up a unique device name. However it missed to stash the id value in ffa_dev to help freeing the ID later when the device is destroyed. Due to the missing/unassigned ID in FFA device, we get the following warning when the FF-A device is unregistered. | ida_free called for id=0 which is not allocated. | WARNING: CPU: 7 PID: 1 at lib/idr.c:525 ida_free+0x114/0x164 | CPU: 7 PID: 1 Comm: swapper/0 Not tainted 6.6.0-rc4 #209 | pstate: 61400009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) | pc : ida_free+0x114/0x164 | lr : ida_free+0x114/0x164 | Call trace: | ida_free+0x114/0x164 | ffa_release_device+0x24/0x3c | device_release+0x34/0x8c | kobject_put+0x94/0xf8 | put_device+0x18/0x24 | klist_devices_put+0x14/0x20 | klist_next+0xc8/0x114 | bus_for_each_dev+0xd8/0x144 | arm_ffa_bus_exit+0x30/0x54 | ffa_init+0x68/0x330 | do_one_initcall+0xdc/0x250 | do_initcall_level+0x8c/0xac | do_initcalls+0x54/0x94 | do_basic_setup+0x1c/0x28 | kernel_init_freeable+0x104/0x170 | kernel_init+0x20/0x1a0 | ret_from_fork+0x10/0x20 Fix the same by actually assigning the ID in the FFA device this time for real. Fixes: 19b8766459c4 ("firmware: arm_ffa: Fix FFA device names for logical partitions") Link: https://lore.kernel.org/r/20231003085932.3553985-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit e22ece0f653dcb3db2efa3a0f2e092dfec90e5b7 Merge: 4b226f15421d1 634ed138d80b1 Author: Mark Brown Date: Fri Oct 6 15:32:31 2023 +0100 ASoC: cs35l56: Update hibernate/wake sequences and Merge series from Richard Fitzgerald : Update the hibernate and wake command sequences to meet the latest datasheet specification and enable hibernation for I2C and SPI control interfaces. Richard Fitzgerald (1): ASoC: cs35l56: Enable low-power hibernation mode on SPI Simon Trimmer (3): ASoC: cs35l56: Change hibernate sequence to use allow auto hibernate ASoC: cs35l56: Wake transactions need to be issued twice ASoC: cs35l56: Enable low-power hibernation mode on i2c include/sound/cs35l56.h | 1 + sound/soc/codecs/cs35l56-i2c.c | 1 + sound/soc/codecs/cs35l56-shared.c | 66 +++++++++++++++++++------------ sound/soc/codecs/cs35l56-spi.c | 1 + 4 files changed, 43 insertions(+), 26 deletions(-) -- 2.30.2 commit 7d08f21f8c6307cb05cabb8d86e90ff6ccba57e9 Author: Mario Limonciello Date: Wed Oct 4 09:49:59 2023 -0500 x86/PCI: Avoid PME from D3hot/D3cold for AMD Rembrandt and Phoenix USB4 Iain reports that USB devices can't be used to wake a Lenovo Z13 from suspend. This occurs because on some AMD platforms, even though the Root Ports advertise PME_Support for D3hot and D3cold, wakeup events from devices on a USB4 controller don't result in wakeup interrupts from the Root Port when amd-pmc has put the platform in a hardware sleep state. If amd-pmc will be involved in the suspend, remove D3hot and D3cold from the PME_Support mask of Root Ports above USB4 controllers so we avoid those states if we need wakeups. Restore D3 support at resume so that it can be used by runtime suspend. This affects both AMD Rembrandt and Phoenix SoCs. "pm_suspend_target_state == PM_SUSPEND_ON" means we're doing runtime suspend, and amd-pmc will not be involved. In that case PMEs work as advertised in D3hot/D3cold, so we don't need to do anything. Note that amd-pmc is technically optional, and there's no need for this quirk if it's not present, but we assume it's always present because power consumption is so high without it. Fixes: 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend") Link: https://lore.kernel.org/r/20231004144959.158840-1-mario.limonciello@amd.com Reported-by: Iain Lane Closes: https://forums.lenovo.com/t5/Ubuntu/Z13-can-t-resume-from-suspend-with-external-USB-keyboard/m-p/5217121 Signed-off-by: Mario Limonciello [bhelgaas: commit log, move to arch/x86/pci/fixup.c, add #includes] Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit 7d6904bf26b96ef087514cb7a8c50b62a4911c99 Merge: 9418edf8ff01e 22061bfc57fe0 Author: Johannes Berg Date: Thu Oct 5 22:57:34 2023 +0200 Merge wireless into wireless-next Resolve several conflicts, mostly between changes/fixes in wireless and the locking rework in wireless-next. One of the conflicts actually shows a bug in wireless that we'll want to fix separately. Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo commit a8ca9fc9134c1a43e6d4db7ff59496bbd7075def Author: Jason Gunthorpe Date: Thu Oct 5 10:35:11 2023 -0300 powerpc/iommu: Do not do platform domain attach atctions after probe POWER throws a splat at boot, it looks like the DMA ops were probably changed while a driver was attached. Something is still weird about how power sequences its bootup. Previously this was hidden since the core iommu code did nothing during probe, now it calls spapr_tce_platform_iommu_attach_dev(). Make spapr_tce_platform_iommu_attach_dev() do nothing on the probe time call like it did before. WARNING: CPU: 0 PID: 8 at arch/powerpc/kernel/iommu.c:407 __iommu_free+0x1e4/0x1f0 Modules linked in: sd_mod t10_pi crc64_rocksoft crc64 sg ibmvfc mlx5_core(+) scsi_transport_fc ibmveth mlxfw psample dm_multipath dm_mirror dm_region_hash dm_log dm_mod fuse CPU: 0 PID: 8 Comm: kworker/0:0 Not tainted 6.6.0-rc3-next-20230929-auto #1 Hardware name: IBM,9080-HEX POWER10 (raw) 0x800200 0xf000006 of:IBM,FW1030.30 (NH1030_062) hv:phyp pSeries Workqueue: events work_for_cpu_fn NIP: c00000000005f6d4 LR: c00000000005f6d0 CTR: 00000000005ca81c REGS: c000000003a27890 TRAP: 0700 Not tainted (6.6.0-rc3-next-20230929-auto) MSR: 800000000282b033 CR: 48000824 XER: 00000008 CFAR: c00000000020f738 IRQMASK: 0 GPR00: c00000000005f6d0 c000000003a27b30 c000000001481800 000000000000017 GPR04: 00000000ffff7fff c000000003a27950 c000000003a27948 0000000000000027 GPR08: c000000c18c07c10 0000000000000001 0000000000000027 c000000002ac8a08 GPR12: 0000000000000000 c000000002ff0000 c00000000019cc88 c000000003042300 GPR16: 0000000000000000 0000000000000000 0000000000000000 c000000003071ab0 GPR20: c00000000349f80d c000000003215440 c000000003215480 61c8864680b583eb GPR24: 0000000000000000 000000007fffffff 0800000020000000 0000000000000010 GPR28: 0000000000020000 0000800000020000 c00000000c5dc800 c00000000c5dc880 NIP [c00000000005f6d4] __iommu_free+0x1e4/0x1f0 LR [c00000000005f6d0] __iommu_free+0x1e0/0x1f0 Call Trace: [c000000003a27b30] [c00000000005f6d0] __iommu_free+0x1e0/0x1f0 (unreliable) [c000000003a27bc0] [c00000000005f848] iommu_free+0x28/0x70 [c000000003a27bf0] [c000000000061518] iommu_free_coherent+0x68/0xa0 [c000000003a27c20] [c00000000005e8d4] dma_iommu_free_coherent+0x24/0x40 [c000000003a27c40] [c00000000024698c] dma_free_attrs+0x10c/0x140 [c000000003a27c90] [c008000000dcb8d4] mlx5_cmd_cleanup+0x5c/0x90 [mlx5_core] [c000000003a27cc0] [c008000000dc45a0] mlx5_mdev_uninit+0xc8/0x100 [mlx5_core] [c000000003a27d00] [c008000000dc4ac4] probe_one+0x3ec/0x530 [mlx5_core] [c000000003a27d90] [c0000000008c5edc] local_pci_probe+0x6c/0x110 [c000000003a27e10] [c000000000189c98] work_for_cpu_fn+0x38/0x60 [c000000003a27e40] [c00000000018d1d0] process_scheduled_works+0x230/0x4f0 [c000000003a27f10] [c00000000018ff14] worker_thread+0x1e4/0x500 [c000000003a27f90] [c00000000019cdb8] kthread+0x138/0x140 [c000000003a27fe0] [c00000000000df98] start_kernel_thread+0x14/0x18 Code: 481b004d 60000000 e89e0028 3c62ffe0 3863dd20 481b0039 60000000 e89e0038 3c62ffe0 3863dd38 481b0025 60000000 <0fe00000> 4bffff20 60000000 3c4c0142 ---[ end trace 0000000000000000 ]--- iommu_free: invalid entry entry = 0x8000000203d0 dma_addr = 0x8000000203d0000 Table = 0xc00000000c5dc800 bus# = 0x1 size = 0x20000 startOff = 0x800000000000 index = 0x70200016 Fixes: 2ad56efa80db ("powerpc/iommu: Setup a default domain and remove set_platform_dma_ops") Reported-by: Tasmiya Nalatwad Link: https://lore.kernel.org/r/d06cee81-c47f-9d62-dfc6-4c77b60058db@linux.vnet.ibm.com Tested-by: Tasmiya Nalatwad Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/0-v1-2b52423411b9+164fc-iommu_ppc_defdomain_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 189116d5ad54eee2bab82c5f12e837912fc0b4c4 Author: Vasant Hegde Date: Fri Oct 6 09:57:06 2023 +0000 Revert "iommu: Fix false ownership failure on AMD systems with PASID activated" This reverts commit 2380f1e8195ef612deea1dc7a3d611c5d2b9b56a. Previous patch removed AMD iommu_v2 module. Hence its safe to revert this workaround. Suggested-by: Jason Gunthorpe Cc: Robin Murphy Cc: Takashi Iwai Cc: Jason Gunthorpe Cc: Joerg Roedel Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20231006095706.5694-6-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 45d08d85e6f64d3f1002ce2eb5c967e2aa4bcd39 Author: Vasant Hegde Date: Fri Oct 6 09:57:05 2023 +0000 iommu/amd: Remove unused EXPORT_SYMBOLS Drop EXPORT_SYMBOLS for the functions that are not used by any modules. Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Tested-by: Alex Deucher Link: https://lore.kernel.org/r/20231006095706.5694-5-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 37b282fa04dd7b9bfa7c290fe07ef1730444debb Author: Vasant Hegde Date: Fri Oct 6 09:57:04 2023 +0000 iommu/amd: Remove amd_iommu_device_info() No one is using this function. Hence remove it. Also move PCI device feature detection flags to amd_iommu_types.h as its only used inside AMD IOMMU driver. Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Tested-by: Alex Deucher Link: https://lore.kernel.org/r/20231006095706.5694-4-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit d55b0d2e075ad32d560cdd35a2016973fda52ed6 Author: Vasant Hegde Date: Fri Oct 6 09:57:03 2023 +0000 iommu/amd: Remove PPR support Remove PPR handler and notifier related functions as its not used anymore. Note that we are retaining PPR interrupt handler support as it will be re-used when we introduce IOPF support. Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Tested-by: Alex Deucher Link: https://lore.kernel.org/r/20231006095706.5694-3-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 5a0b11a180a9b82b4437a4be1cf73530053f139b Author: Vasant Hegde Date: Fri Oct 6 09:57:02 2023 +0000 iommu/amd: Remove iommu_v2 module AMD GPU driver which was the only in-kernel user of iommu_v2 module removed dependency on iommu_v2 module. Also we are working on adding SVA support in AMD IOMMU driver. Device drivers are expected to use common SVA framework to enable device PASID/PRI features. Removing iommu_v2 module and then adding SVA simplifies the development. Hence remove iommu_v2 module. Cc: Alex Deucher Cc: Joerg Roedel Cc: Felix Kuehling Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Tested-by: Alex Deucher Link: https://lore.kernel.org/r/20231006095706.5694-2-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 942e02e150721413b43068a8073819ad2b7d6314 Author: Inochi Amaoto Date: Wed Oct 4 23:43:47 2023 +0800 dt-bindings: interrupt-controller: Add Sophgo sg2042 CLINT mswi The clint of Sophgo's sg2042 is based off IP designed by T-HEAD, and implements the not yet frozen ACLINT spec. This spec seems to be abandoned, and will not be frozen in the predictable future. Frozen specs required by the RISC-V maintainers before merging content relating to those extensions, therefore a generic compatible is not appropriate. Instead, add new vendor specific compatible strings to identify mswi of sg2042 clint. Signed-off-by: Inochi Amaoto Signed-off-by: Chen Wang [conor: re-wrote commit message to drop irrelevant sifive,clint discussion] Signed-off-by: Conor Dooley commit 388fd6a87f7fc41d75720bd8d0b84bd3f2f49f7a Author: Greg Kroah-Hartman Date: Thu Oct 5 15:58:36 2023 +0200 staging: greybus: fw-management: make fw_mgmt_class constant Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Cc: Alex Elder Cc: greybus-dev@lists.linaro.org Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/2023100534-catty-moodiness-099e@gregkh Signed-off-by: Greg Kroah-Hartman commit f7704755723813e1be87518899282c9801e9fd3a Author: Greg Kroah-Hartman Date: Thu Oct 5 15:58:35 2023 +0200 staging: greybus: authentication: make cap_class constant Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Cc: Alex Elder Cc: greybus-dev@lists.linaro.org Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/2023100534-showoff-alright-6c95@gregkh Signed-off-by: Greg Kroah-Hartman commit a0b1e9796420352138bb6fafbf9ea28e58f53261 Author: Greg Kroah-Hartman Date: Thu Oct 5 15:58:34 2023 +0200 staging: greybus: raw: make raw_class constant Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Cc: Alex Elder Cc: greybus-dev@lists.linaro.org Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/2023100533-broadband-hunk-9e91@gregkh Signed-off-by: Greg Kroah-Hartman commit f267da65bb6b2c33cfd9f8533def17f1db1d4fdf Author: Greg Kroah-Hartman Date: Thu Oct 5 15:55:13 2023 +0200 staging: pi433: make pi433_class constant Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Link: https://lore.kernel.org/r/2023100512-sweat-abruptly-2445@gregkh Signed-off-by: Greg Kroah-Hartman commit 0c99ee4e8f4bdfc9347de2e161d7efcdacce853b Author: Greg Kroah-Hartman Date: Thu Oct 5 15:45:24 2023 +0200 staging: vme_user: make vme_user_sysfs_class constant Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Link: https://lore.kernel.org/r/2023100523-throwback-oak-a164@gregkh Signed-off-by: Greg Kroah-Hartman commit 9565794b1b01011b51d485b662fb6e544628fd63 Author: Greg Kroah-Hartman Date: Thu Oct 5 15:43:53 2023 +0200 staging: fieldbus: make controller_class constant Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Cc: Sven Van Asbroeck Link: https://lore.kernel.org/r/2023100552-entrench-dingbat-093a@gregkh Signed-off-by: Greg Kroah-Hartman commit 4734449f73115c33733b136e225657107c03faf5 Author: Inochi Amaoto Date: Wed Oct 4 23:43:28 2023 +0800 dt-bindings: timer: Add Sophgo sg2042 CLINT timer The clint of Sophgo's sg2042 is based off IP designed by T-HEAD, but Sophgo changes this IP layout to fit its cpu design and is incompatible with the standard sifive clint. The timer and ipi device are on the different address, and can not be handled by the sifive,clint dt-bindings. If we use the same compatible string for mswi and timer of the sg2042 clint like sifive,clint, the DT may be like this: mswi: interrupt-controller@94000000 { compatible = "sophgo,sg2042-clint", "thead,c900-clint"; interrupts-extended = <&cpu1intc 3>; reg = <0x94000000 0x00010000>; }; timer: timer@ac000000 { compatible = "sophgo,sg2042-clint", "thead,c900-clint"; interrupts-extended = <&cpu1intc 7>; reg = <0xac000000 0x00010000>; }; Since the address of mswi and timer are different, it is hard to merge them directly. So we need two DT nodes to handle both devices. If we use this DT for SBI, it will parse the mswi device in the timer initialization as the compatible string is the same, so will mswi. As they are different devices, this incorrect initialization will cause the system unusable. There is a more robust ACLINT spec. can handle this situation, but the spec. seems to be abandoned and will not be frozen in the predictable future. So it is not the time to add ACLINT spec in the kernel bindings. Instead, using vendor bindings is more acceptable. Add new vendor specific compatible strings to identify timer of sg2042 clint. Signed-off-by: Inochi Amaoto Signed-off-by: Chen Wang Signed-off-by: Conor Dooley commit d975794dddd2ec44f142302c7fd3b86eebec0bee Author: Chen Wang Date: Wed Oct 4 23:42:41 2023 +0800 dt-bindings: interrupt-controller: Add Sophgo SG2042 PLIC Add compatible string for SOPHGO SG2042 plic. Acked-by: Chao Wei Reviewed-by: Guo Ren Acked-by: Conor Dooley Signed-off-by: Chen Wang Signed-off-by: Conor Dooley commit b965d9a965943e5c07bdda0734aaeecca9ab86b3 Author: Chen Wang Date: Wed Oct 4 23:42:23 2023 +0800 dt-bindings: riscv: Add T-HEAD C920 compatibles The C920 is RISC-V CPU cores from T-HEAD Semiconductor. Notably, the C920 core is used in the SOPHGO's SG2042 SoC. Acked-by: Chao Wei Reviewed-by: Guo Ren Reviewed-by: Conor Dooley Signed-off-by: Chen Wang Signed-off-by: Conor Dooley commit 1589534b1951c1e38694355324b9364098d79146 Author: Chen Wang Date: Wed Oct 4 23:42:03 2023 +0800 dt-bindings: riscv: add sophgo sg2042 bindings Add DT binding documentation for the SOPHGO's SG2042 Soc [1] and the Milk-V Pioneer board [2]. Link: https://en.sophgo.com/product/introduce/sg2042.html [1] Link: https://milkv.io/pioneer [2] Acked-by: Chao Wei Reviewed-by: Guo Ren Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chen Wang Signed-off-by: Conor Dooley commit 07f9b764062904f0c0fd6e54e58535f34ac3ac6f Author: Chen Wang Date: Wed Oct 4 23:40:32 2023 +0800 dt-bindings: vendor-prefixes: add milkv/sophgo Add new vendor strings to dt bindings. These new vendor strings are used by - SOPHGO's SG2042 SoC [1] - Milk-V Pioneer board [2], which uses SG2042 chip. Link: https://en.sophgo.com/product/introduce/sg2042.html [1] Link: https://milkv.io/pioneer [2] Reviewed-by: Guo Ren Reviewed-by: Conor Dooley Acked-by: Chao Wei Signed-off-by: Chen Wang Signed-off-by: Conor Dooley commit d0366abc9de5ba41225a71d37036206149319223 Author: Chen Wang Date: Wed Oct 4 23:38:39 2023 +0800 riscv: Add SOPHGO SOC family Kconfig support The first SoC in the SOPHGO series is SG2042, which contains 64 RISC-V cores. Reviewed-by: Guo Ren Reviewed-by: Conor Dooley Acked-by: Chao Wei Signed-off-by: Chen Wang Signed-off-by: Conor Dooley commit a41357adbf03d3e51d3f3853f06a2a8dd756765e Merge: 06d65b2bc532f 5ccf9873ab2bc Author: Ilpo Järvinen Date: Fri Oct 6 15:58:30 2023 +0300 Merge branch 'pdx86/platform-drivers-x86-int3472' into review-ilpo commit 5eb4ff884f72654cd2622528ecfda0fd35c637c5 Author: Cezary Rojewski Date: Fri Oct 6 12:28:57 2023 +0200 ALSA: hda: Add code_loading parameter to stream setup AudioDSP firmware is the one who kicks SDxFIFOS calculation when a stream is decoupled mode. During firmware bring up procedure, there is no firmware running and the code-loading stream is always a decoupled one. So, there is none to trigger the calculation and we end up with false-positive timeout (-110) messages. Signed-off-by: Cezary Rojewski Acked-by: Mark Brown Link: https://lore.kernel.org/r/20231006102857.749143-4-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 956b610c4974c99a55c95542c4fca6025dee579f Author: Cezary Rojewski Date: Fri Oct 6 12:28:56 2023 +0200 ALSA: hda: Fix stream fifo_size initialization SDxFIFOS register indicates the fifo size directly. There is no need to modify the value after reading the register. Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20231006102857.749143-3-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit f93dc90c2e8ed664985e366aa6459ac83cdab236 Author: Cezary Rojewski Date: Fri Oct 6 12:28:55 2023 +0200 ALSA: hda: Fix possible null-ptr-deref when assigning a stream While AudioDSP drivers assign streams exclusively of HOST or LINK type, nothing blocks a user to attempt to assign a COUPLED stream. As supplied substream instance may be a stub, what is the case when code-loading, such scenario ends with null-ptr-deref. Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20231006102857.749143-2-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 438fb575463fc490e6200e5e28d02159492a97f8 Author: Marek Szyprowski Date: Fri Oct 6 13:06:31 2023 +0200 ARM: exynos_defconfig: add driver for ISL29018 Intersil 29018 light and proximity sensor is built into Exynos based Peach-Pit/Pi Chromebooks, so enable driver for it to increase testing coverage. Signed-off-by: Marek Szyprowski Link: https://lore.kernel.org/r/20231006110631.3204334-1-m.szyprowski@samsung.com Signed-off-by: Krzysztof Kozlowski commit 669216528852c99d32be9e894120d25b48b71a52 Author: Marek Szyprowski Date: Fri Oct 6 13:21:06 2023 +0200 ARM: multi_v7_defconfig: add drivers for S5C73M3 & S5K6A3 camera sensors Samsung S5C73M3 8Mp camera ISP and S5K6A3 RAW sensors are available on Exynos4412-based Midas family boards, so enable the driver for them to increase testing coverage. Signed-off-by: Marek Szyprowski Link: https://lore.kernel.org/r/20231006112106.3205618-1-m.szyprowski@samsung.com Signed-off-by: Krzysztof Kozlowski commit da886ba844791d11c9d1526fddf8607eb0198243 Author: Marek Szyprowski Date: Fri Oct 6 12:04:34 2023 +0200 extcon: max77843: add device-tree compatible string Add the needed device-tree compatible string to the MAX77843 extcon driver, so it can be automatically loaded when compiled as a kernel module and given device-tree contains separate 'muic' node under the main MAX77843 PMIC node. Link: https://lore.kernel.org/all/20231006100434.2908243-2-m.szyprowski@samsung.com/ Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi commit 36d301f3da0a7a1fb626a3265aa677127efa9854 Author: Marek Szyprowski Date: Fri Oct 6 12:04:33 2023 +0200 extcon: max77693: add device-tree compatible string Commit 57f706bf7307 ("ARM: dts: samsung: exynos4412-midas: add USB connector and USB OTG") added a 'muic' node to the MAX77693 PMIC definition in various device-tree files. Since that commit, the newly created MFD cell gained its own of_node and compatible string. This changed its modalias, what in turn broke automated loading of the driver module, because the new modalias is based on the of_node compatible string, not the platform device name. Fix this by adding the needed device-tree compatible string. Link: https://lore.kernel.org/all/20231006100434.2908243-1-m.szyprowski@samsung.com/ Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi commit 7eb73b8abdae401ac70fd7d463df118a4a2404a9 Author: Jerome Brunet Date: Fri Oct 6 12:34:59 2023 +0200 dt-bindings: arm: amlogic: add libretech cottonwood support Add compatibles for the Libretech cottonwood board family Co-developed-by: Da Xue Signed-off-by: Da Xue Signed-off-by: Jerome Brunet Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231006103500.2015183-2-jbrunet@baylibre.com Signed-off-by: Neil Armstrong commit ef31b8ce313eaf891bf705d5db754e549351816f Author: Douglas Anderson Date: Mon Oct 2 09:45:30 2023 -0700 arm64: smp: Don't directly call arch_smp_send_reschedule() for wakeup In commit 2b2d0a7a96ab ("arm64: smp: Remove dedicated wakeup IPI") we started using a scheduler IPI to avoid a dedicated reschedule. When we did this, we used arch_smp_send_reschedule() directly rather than calling smp_send_reschedule(). The only difference is that calling arch_smp_send_reschedule() directly avoids tracing. Presumably we _don't_ want to avoid tracing here, so switch to smp_send_reschedule(). Fixes: 2b2d0a7a96ab ("arm64: smp: Remove dedicated wakeup IPI") Signed-off-by: Douglas Anderson Acked-by: Mark Rutland Signed-off-by: Catalin Marinas commit a07a594152173a3dd3bdd12fc7d73dbba54cdbca Author: Mark Rutland Date: Mon Oct 2 18:00:36 2023 +0100 arm64: smp: avoid NMI IPIs with broken MediaTek FW Some MediaTek devices have broken firmware which corrupts some GICR registers behind the back of the OS, and pseudo-NMIs cannot be used on these devices. For more details see commit: 44bd78dd2b8897f5 ("irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware issues") We did not take this problem into account in commit: 331a1b3a836c0f38 ("arm64: smp: Add arch support for backtrace using pseudo-NMI") Since that commit arm64's SMP code will try to setup some IPIs as pseudo-NMIs, even on systems with broken FW. The GICv3 code will (rightly) reject attempts to request interrupts as pseudo-NMIs, resulting in boot-time failures. Avoid the problem by taking the broken FW into account when deciding to request IPIs as pseudo-NMIs. The GICv3 driver maintains a static_key named "supports_pseudo_nmis" which is false on systems with broken FW, and we can consult this within ipi_should_be_nmi(). Fixes: 331a1b3a836c ("arm64: smp: Add arch support for backtrace using pseudo-NMI") Reported-by: Chen-Yu Tsai Closes: https://issuetracker.google.com/issues/197061987#comment68 Signed-off-by: Mark Rutland Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Reviewed-by: Marc Zyngier Tested-by: Chen-Yu Tsai Signed-off-by: Catalin Marinas commit 881fe6ed21e8c7e60095aabc274c4f2bfdc87c5e Author: Geert Uytterhoeven Date: Fri Oct 6 13:29:45 2023 +0200 spi: mpc52xx-psc: Make mpc52xx_psc_spi_transfer_one_message() static With W=1: drivers/spi/spi-mpc52xx-psc.c:178:5: warning: no previous prototype for ‘mpc52xx_psc_spi_transfer_one_message’ [-Wmissing-prototypes] 178 | int mpc52xx_psc_spi_transfer_one_message(struct spi_controller *ctlr, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mpc52xx_psc_spi_transfer_one_message() is only used inside the file that defines it. Hence fix this by making it static. Fixes: 145cfc3840e5931a ("spi: mpc52xx-psc: Switch to using core message queue") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310061815.7Rtyi4hs-lkp@intel.com/ Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20231006112945.1491265-1-geert+renesas@glider.be Signed-off-by: Mark Brown commit 4b226f15421d160cc07ff497179547f5590ce758 Author: Kees Cook Date: Wed Oct 4 19:56:21 2023 -0700 MAINTAINERS: Include sof headers under ASoC Add missing sof header files for ASoC. Suggested-by: Mark Brown Link: https://lore.kernel.org/lkml/f258a7e6-0728-4f55-a71a-6e99113ce7e5@sirena.org.uk Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20231005025618.work.355-kees@kernel.org Signed-off-by: Mark Brown commit 634ed138d80b1cc8a903edb226458ea203c44abd Author: Richard Fitzgerald Date: Fri Oct 6 12:10:39 2023 +0100 ASoC: cs35l56: Enable low-power hibernation mode on SPI Hibernation can be enabled on SPI-connected devices now that the hibernate and wake sequences have been updated to work with wake-on-MOSI. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20231006111039.101914-5-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 79b101947a829a1c4c3eca4b6365093d2b534cf4 Author: Simon Trimmer Date: Fri Oct 6 12:10:38 2023 +0100 ASoC: cs35l56: Enable low-power hibernation mode on i2c This can now be re-enabled as the sequence to reliably wake the device has been implemented in the shared code. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20231006111039.101914-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 3df761bdbc8bc1bb679b5a4d4e068728d930a552 Author: Simon Trimmer Date: Fri Oct 6 12:10:37 2023 +0100 ASoC: cs35l56: Wake transactions need to be issued twice As the dummy wake is a toggling signal (either I2C or SPI activity) it is not guaranteed to meet the minimum asserted hold time for a wake signal. In this case the wake must guarantee rising edges separated by at least the minimum hold time. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20231006111039.101914-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit a47cf4dac7dcc43ef25d009ca0ad28fc86ba0eef Author: Simon Trimmer Date: Fri Oct 6 12:10:36 2023 +0100 ASoC: cs35l56: Change hibernate sequence to use allow auto hibernate If the hardware uses SPI_MOSI, I2C_SCL or I2C_SDA as the wake source the bus activity of sending HIBERNATE_NOW will wake up the amps that were already put into hibernate. ALLOW_AUTO_HIBERNATE tells the firmware to hibernate itself after a timeout of a few seconds, giving the driver instances time to send this before any amps have gone into hibernate. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20231006111039.101914-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 4df7d6a61f2c0e0920f4f4caa02e41797974a487 Author: Rander Wang Date: Fri Oct 6 11:44:54 2023 +0300 ASoC: SOF: IPC4: sort pipeline based on priority The pipeline priority is set in topology and driver should sort pipeline based on priority for trigger order. Reviewed-by: Péter Ujfalusi Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20231006084454.19170-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit ae67b6371d0432e3fe25993189e89f814ec1e4d0 Author: Rander Wang Date: Fri Oct 6 11:44:53 2023 +0300 ASoC: SOF: IPC4: get pipeline priority from topology Driver set pipeline priority according to priority setting in topology. Reviewed-by: Péter Ujfalusi Signed-off-by: Rander Wang Signed-off-by: Pierre-Louis Bossart Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20231006084454.19170-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 1a4890878241dae30da081b03b77056d6b1df882 Author: Sascha Hauer Date: Wed Oct 4 10:40:26 2023 +0200 net: phy: dp83867: Add support for hardware blinking LEDs This implements the led_hw_* hooks to support hardware blinking LEDs on the DP83867 phy. The driver supports all LED modes that have a corresponding TRIGGER_NETDEV_* define. Error and collision do not have a TRIGGER_NETDEV_* define, so these modes are currently not supported. Reviewed-by: Andrew Lunn Tested-by: Alexander Stein #TQMa8MxML/MBa8Mx Signed-off-by: Sascha Hauer Signed-off-by: David S. Miller commit 99474727d5d5b56f6d417ae6010d93407bbaaebb Author: Kees Cook Date: Tue Oct 3 16:18:33 2023 -0700 flow_offload: Annotate struct flow_action_entry with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct flow_action_entry. Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: netdev@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit d59b099c667f1fe2801a2f4b9a22a66b54c37c76 Author: Andy Shevchenko Date: Fri Oct 6 12:40:33 2023 +0300 pinctrl: cherryview: Simplify code with cleanup helpers Use macros defined in linux/cleanup.h to automate resource lifetime control in the driver. Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit b3783e5efde4201b2cc7a2fee41791b413137f4c Author: Kees Cook Date: Tue Oct 3 16:17:41 2023 -0700 net/packet: Annotate struct packet_fanout with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct packet_fanout. Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Willem de Bruijn Cc: Anqi Shen Cc: netdev@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit d3386552155c6e9128e49fff86d7acfe4b13f949 Author: Andy Shevchenko Date: Fri Oct 6 12:40:32 2023 +0300 pinctrl: cherryview: Avoid duplicated I/O In some cases we already read the value from the register followed by a reading of it again for other purposes, but the both reads are under the lock and bits we are insterested in are not going to change (they are not volatile from HW perspective). Hence, no need to read the same register twice. Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 71ce60d375f5be15ef6db19aa63ebd2d72f1457c Author: Jakub Kicinski Date: Tue Oct 3 15:57:35 2023 -0700 tools: ynl-gen: use uapi header name for the header guard Chuck points out that we should use the uapi-header property when generating the guard. Otherwise we may generate the same guard as another file in the tree. Tested-by: Chuck Lever Signed-off-by: Jakub Kicinski Reviewed-by: Przemek Kitszel Signed-off-by: David S. Miller commit 5ccf9873ab2bcb7c480bc2ccea55ec235d9db175 Author: Hans de Goede Date: Wed Oct 4 18:23:16 2023 +0200 platform/x86: int3472: Switch to devm_get_gpiod() Switch to devm_get_gpiod() for discrete GPIOs for clks / regulators / LEDs and let devm do the cleanup for us. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Reviewed-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20231004162317.163488-5-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 53c5f7f6e7930ff057cefe4960f5bbf29023e5a9 Author: Hans de Goede Date: Wed Oct 4 18:23:15 2023 +0200 platform/x86: int3472: Stop using gpiod_toggle_active_low() Use the new skl_int3472_gpiod_get_from_temp_lookup() helper to get a gpio to pass to register_gpio_clock(), skl_int3472_register_regulator() and skl_int3472_register_pled(). This removes all use of the deprecated gpiod_toggle_active_low() and acpi_get_and_request_gpiod() functions. Suggested-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Reviewed-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20231004162317.163488-4-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 5cad12851b16ae6bda685d4fc44eff2b1e273c4e Author: Bartosz Golaszewski Date: Wed Oct 4 18:23:14 2023 +0200 platform/x86: int3472: Add new skl_int3472_gpiod_get_from_temp_lookup() helper Add a new skl_int3472_gpiod_get_from_temp_lookup() helper. This is a preparation patch for removing usage of the deprecated gpiod_toggle_active_low() and acpi_get_and_request_gpiod() functions. [hdegoede@redhat.com] use the new skl_int3472_fill_gpiod_lookup() helper Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Co-developed-by: Hans de Goede Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20231004162317.163488-3-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 23516fba866c49397594832d407459f30fe3ed60 Author: Hans de Goede Date: Wed Oct 4 18:23:13 2023 +0200 platform/x86: int3472: Add new skl_int3472_fill_gpiod_lookup() helper Add a new skl_int3472_fill_gpiod_lookup() helper. This is a preparation patch for removing usage of the deprecated gpiod_toggle_active_low() and acpi_get_and_request_gpiod() functions. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Reviewed-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20231004162317.163488-2-hdegoede@redhat.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 06d65b2bc532fc9af1c55aa7a18cfd237ce46588 Author: Jithu Joseph Date: Thu Oct 5 12:51:37 2023 -0700 platform/x86/intel/ifs: ARRAY BIST for Sierra Forest Array BIST MSR addresses, bit definition and semantics are different for Sierra Forest. Branch into a separate Array BIST flow on Sierra Forest when user invokes Array Test. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Tested-by: Pengfei Xu Link: https://lore.kernel.org/r/20231005195137.3117166-10-jithu.joseph@intel.com [ij: ARRAY_GEN_* -> ARRAY_GEN* for consistency] Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit f739d7555212a945361a54659cdea937219dd8c5 Merge: ddb23e3457242 c01e24936d16f Author: David S. Miller Date: Fri Oct 6 11:08:07 2023 +0100 Merge branch 'mlxsw-ACL-region' Petr Machata says: ==================== mlxsw: Control the order of blocks in ACL region Amit Cohen writes: For 12 key blocks in the A-TCAM, rules are split into two records, which constitute two lookups. The two records are linked using a "large entry key ID". Due to a Spectrum-4 hardware issue, KVD entries that correspond to key blocks 0 to 5 of 12 key blocks will be placed in the same KVD pipe if they only differ in their "large entry key ID", as it is ignored. This results in a reduced scale, we can insert less than 20k filters and get an error: $ tc -b flower.batch RTNETLINK answers: Input/output error We have an error talking to the kernel To reduce the probability of this issue, we can place key blocks with high entropy in blocks 0 to 5. The idea is to place blocks that are often changed in blocks 0 to 5, for example, key blocks that match on IPv4 addresses or the LSBs of IPv6 addresses. Such placement will reduce the probability of these blocks to be same. Mark several blocks with 'high_entropy' flag and place them in blocks 0 to 5. Note that the list of the blocks is just a suggestion, I will verify it with architects. Currently, there is a one loop that chooses which blocks should be used for a given list of elements and fills the blocks - when a block is chosen, it fills it in the region. To be able to control the order of the blocks, separate between searching blocks and filling them. Several pre-changes are required. Patch set overview: Patch #1 marks several blocks with 'high_entropy' flag. Patches #2-#4 prepare the code for filling blocks at the end of the search. Patch #5 changes the loop to just choose the blocks and fill the blocks at the end. ==================== Signed-off-by: David S. Miller commit c01e24936d16fcdac20849e2a71f52a631a995c5 Author: Amit Cohen Date: Tue Oct 3 13:25:30 2023 +0200 mlxsw: core_acl_flex_keys: Fill blocks with high entropy first The previous patches prepared the code to allow separating between choosing blocks and filling blocks. Do not add blocks as part of the loop that chooses them. When all the required blocks are set in the bitmap 'chosen_blocks_bm', start filling blocks. Iterate over the bitmap twice - first add only blocks that are marked with 'high_entropy' flag. Then, fill the rest of the blocks. The idea is to place key blocks with high entropy in blocks 0 to 5. See more details in previous patches. Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 900f4285bbc2661e330036ee0fae046c7b79036b Author: Amit Cohen Date: Tue Oct 3 13:25:29 2023 +0200 mlxsw: core_acl_flex_keys: Save chosen elements in all blocks per search Currently, mlxsw_afk_picker() chooses which blocks will be used for a given list of elements, and fills the blocks during the searching - when a key block is found with most hits, it adds it and removes the elements from the count of hits. This should be changed as we want to be able to choose which blocks will be placed in blocks 0 to 5. To separate between choosing blocks and filling blocks, several pre-changes are required. Currently, the indication of whether all elements were found in the chosen blocks is by the structure 'key_info->elusage'. This structure is updated when block is filled as part of mlxsw_afk_picker_key_info_add(). A following patch will call this function only after choosing all the blocks. Add a bitmap called 'elusage_chosen' to store which elements were chosen in the chosen blocks. Change the condition in the loop to check elements that were chosen, not elements that were already filled in the blocks. Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 545535fd30dc8eaac96c09d774e8ba57bb247267 Author: Amit Cohen Date: Tue Oct 3 13:25:28 2023 +0200 mlxsw: core_acl_flex_keys: Save chosen elements per block Currently, mlxsw_afk_picker() chooses which blocks will be used for a given list of elements, and fills the blocks during the searching - when a key block is found with most hits, it adds it and removes the elements from the count of hits. This should be changed as we want to be able to choose which blocks will be placed in blocks 0 to 5. To separate between choosing blocks and filling blocks, several pre-changes are required. During the search, the structure 'mlxsw_afk_picker' is used per block, it contains how many elements from the required list appear in the block. When a block is chosen and filled, this bitmap of elements is cleaned. To be able to fill the blocks at the end, add a bitmap called 'chosen_element' as part of picker. When a block is chosen, copy the 'element' bitmap to it. Use the new bitmap as part of mlxsw_afk_picker_key_info_add(). So later, when filling the block will be done at the end of the searching, we will use the copied bitmap that contains the elements that should be used in the block. Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 0a67b7a0ec36bda6ce2898016415b36d3b85dca8 Author: Amit Cohen Date: Tue Oct 3 13:25:27 2023 +0200 mlxsw: core_acl_flex_keys: Add a bitmap to save which blocks are chosen Currently, mlxsw_afk_picker() chooses which blocks will be used for a given list of elements, and fills the blocks during the searching - when a key block is found with most hits, it adds it and removes the elements from the count of hits. This should be changed as we want to be able to choose which blocks will be placed in blocks 0 to 5. To separate between choosing blocks and filling blocks, several pre-changes are required. The indexes of the chosen blocks should be saved, so then the relevant blocks will be filled at the end of search. Allocate a bitmap for chosen blocks, when a block is found with most hits, set the relevant bit in the bitmap. This bitmap will be used in a following patch. Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit cad6431b867507779c41b00baaf18382467ef0a0 Author: Amit Cohen Date: Tue Oct 3 13:25:26 2023 +0200 mlxsw: Mark high entropy key blocks For 12 key blocks in the A-TCAM, rules are split into two records, which constitute two lookups. The two records are linked using a "large entry key ID". Due to a Spectrum-4 hardware issue, KVD entries that correspond to key blocks 0 to 5 of 12 key blocks A-TCAM entries will be placed in the same KVD pipe if they only differ in their "large entry key ID", as it is ignored. This results in a reduced scale. To reduce the probability of this issue, we can place key blocks with high entropy in blocks 0 to 5. The idea is to place blocks that are changed often in blocks 0 to 5, for example, key blocks that match on IPv4 addresses or the LSBs of IPv6 addresses. Such placement will reduce the probability of these blocks to be same. Mark several blocks with 'high_entropy' flag, so later we will take into account this flag and place them in blocks 0 to 5. Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit ddb23e345724245c46301c3dbc5b86bea180d37b Merge: 2a92fccdaca83 e447056147eff Author: David S. Miller Date: Fri Oct 6 11:05:45 2023 +0100 Merge branch 'sfc-conntrack-offloads' Edward Cree says: ==================== sfc: conntrack offload for tunnels This series adds support for offloading TC flower rules which require both connection tracking and tunnel decapsulation. Depending on the match keys required, the left-hand-side rule may go in either the Outer Rule table or the Action Rule table. ==================== Signed-off-by: David S. Miller commit e447056147effae1f77854986b5782bb22d77f62 Author: Edward Cree Date: Mon Oct 2 16:44:44 2023 +0100 sfc: support TC rules which require OR-AR-CT-AR flow When a foreign LHS rule (TC rule from a tunnel netdev which requests conntrack lookup) matches on inner headers or enc_key_id, these matches cannot be performed by the Outer Rule table, as the keys are only available after the tunnel type has been identified (by the OR lookup) and the rest of the headers parsed accordingly. Offload such rules with an Action Rule, using the LOOKUP_CONTROL section of the AR response to specify the conntrack and/or recirculation actions, combined with an Outer Rule which performs only the usual Encap Match duties. This processing flow, as it requires two AR lookups per packet, is less performant than OR-CT-AR, so only use it where necessary. Reviewed-by: Pieter Jansen van Vuuren Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit f96622fd3a74426db935bff11e00dac33480748f Author: Edward Cree Date: Mon Oct 2 16:44:43 2023 +0100 sfc: ensure an extack msg from efx_tc_flower_replace_foreign EOPNOTSUPPs There were a few places where no extack error message was set, or the extack was not forwarded to callees, potentially resulting in a return of -EOPNOTSUPP with no additional information. Make sure to populate the error message in these cases. In practice this does us no good as TC indirect block callbacks don't come with an extack to fill in; but maybe they will someday and when debugging it's possible to provide a fake extack and emit its message to the console. Reviewed-by: Pieter Jansen van Vuuren Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit 937a0feab42ea76ae2dc6a8b1921ca167b8f9baa Author: Edward Cree Date: Mon Oct 2 16:44:42 2023 +0100 sfc: offload foreign RHS rules without an encap match Normally, if a TC filter on a tunnel netdev does not match on any encap fields, we decline to offload it, as it cannot meet our requirement for a tuple for the encap match. However, if the rule has a nonzero chain_index, then for a packet to reach the rule, it must already have matched a LHS rule which will have included an encap match and determined the tunnel type, so in that case we can offload the right-hand-side rule. Reviewed-by: Pieter Jansen van Vuuren Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit ec1dc6c88ce4f4fb541244f22c42e8cd69037d98 Author: Edward Cree Date: Mon Oct 2 16:44:41 2023 +0100 sfc: support TC left-hand-side rules on foreign netdevs Allow a tunnel netdevice (such as a vxlan) to offload conntrack lookups, in much the same way as efx netdevs. To ensure this rule does not overlap with other tunnel rules on the same sip,dip,dport tuple, register a pseudo encap match of a new type (EFX_TC_EM_PSEUDO_OR), which unlike PSEUDO_MASK may only be referenced once (because an actual Outer Rule in hardware exists, although its fw_id is not recorded in the encap match entry). Reviewed-by: Pieter Jansen van Vuuren Signed-off-by: Edward Cree Signed-off-by: David S. Miller commit b9aa9e4c8b4e52b6f2f5986b27e97f4b6163f0bf Author: Jithu Joseph Date: Thu Oct 5 12:51:36 2023 -0700 platform/x86/intel/ifs: Add new error code Make driver aware of a newly added error code so that it can provide a more appropriate error message. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Reviewed-by: Ilpo Järvinen Tested-by: Pengfei Xu Link: https://lore.kernel.org/r/20231005195137.3117166-9-jithu.joseph@intel.com Signed-off-by: Ilpo Järvinen commit e6483a0b59026ded36a6f5eba1425a6b0965984a Author: Jithu Joseph Date: Thu Oct 5 12:51:35 2023 -0700 platform/x86/intel/ifs: Add new CPU support Add Granite Rapids(GNR) and Sierra Forest(SRF) cpuids to x86 match table so that IFS driver can be loaded for those. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Reviewed-by: Ilpo Järvinen Tested-by: Pengfei Xu Link: https://lore.kernel.org/r/20231005195137.3117166-8-jithu.joseph@intel.com Signed-off-by: Ilpo Järvinen commit 60d2e1b37d530d6b1f8b7773cebaf8bbc1536b28 Author: Jithu Joseph Date: Thu Oct 5 12:51:34 2023 -0700 platform/x86/intel/ifs: Metadata validation for start_chunk Add an additional check to validate IFS image metadata field prior to loading the test image. If start_chunk is not a multiple of chunks_per_stride error out. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Tested-by: Pengfei Xu Link: https://lore.kernel.org/r/20231005195137.3117166-7-jithu.joseph@intel.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 25a76dbb36dd58ad4df7f6a4dc43061a10b0d817 Author: Jithu Joseph Date: Thu Oct 5 12:51:33 2023 -0700 platform/x86/intel/ifs: Validate image size Perform additional validation prior to loading IFS image. Error out if the size of the file being loaded doesn't match the size specified in the header. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Reviewed-by: Ilpo Järvinen Tested-by: Pengfei Xu Link: https://lore.kernel.org/r/20231005195137.3117166-6-jithu.joseph@intel.com Signed-off-by: Ilpo Järvinen commit 72b96ee29ed6f7670bbb180ba694816e33d361d1 Author: Jithu Joseph Date: Thu Oct 5 12:51:32 2023 -0700 platform/x86/intel/ifs: Gen2 Scan test support Width of chunk related bitfields is ACTIVATE_SCAN and SCAN_STATUS MSRs are different in newer IFS generation compared to gen0. Make changes to scan test flow such that MSRs are populated appropriately based on the generation supported by hardware. Account for the 8/16 bit MSR bitfield width differences between gen0 and newer generations for the scan test trace event too. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Reviewed-by: Ilpo Järvinen Tested-by: Pengfei Xu Link: https://lore.kernel.org/r/20231005195137.3117166-5-jithu.joseph@intel.com Signed-off-by: Ilpo Järvinen commit 07f47c01b3bc2a42c4d4da35831edab10aa60449 Author: Jithu Joseph Date: Thu Oct 5 12:51:31 2023 -0700 platform/x86/intel/ifs: Gen2 scan image loading Scan image loading flow for newer IFS generations are slightly different from that of current generation. In newer schemes, loading need not be done once for each socket as was done in gen0. Also the width of NUM_CHUNKS bitfield in SCAN_HASHES_STATUS MSR has increased from 8 -> 16 bits. Similarly there are width differences for CHUNK_AUTHENTICATION_STATUS too. Further the parameter to AUTHENTICATE_AND_COPY_CHUNK is passed differently in newer generations. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Reviewed-by: Ilpo Järvinen Tested-by: Pengfei Xu Link: https://lore.kernel.org/r/20231005195137.3117166-4-jithu.joseph@intel.com Signed-off-by: Ilpo Järvinen commit a138ac2656d1329c3994a227769b7ba3926818a7 Author: Jithu Joseph Date: Thu Oct 5 12:51:30 2023 -0700 platform/x86/intel/ifs: Refactor image loading code IFS image loading flow is slightly different for newer IFS generations. In preparation for adding support for newer IFS generations, refactor portions of existing image loading code for reuse. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Reviewed-by: Ilpo Järvinen Tested-by: Pengfei Xu Link: https://lore.kernel.org/r/20231005195137.3117166-3-jithu.joseph@intel.com Signed-off-by: Ilpo Järvinen commit 97a5e801b3045c1e800f76bc0fb544972538089d Author: Jithu Joseph Date: Thu Oct 5 12:51:29 2023 -0700 platform/x86/intel/ifs: Store IFS generation number IFS generation number is reported via MSR_INTEGRITY_CAPS. As IFS support gets added to newer CPUs, some differences are expected during IFS image loading and test flows. Define MSR bitmasks to extract and store the generation in driver data, so that driver can modify its MSR interaction appropriately. Signed-off-by: Jithu Joseph Reviewed-by: Tony Luck Reviewed-by: Ilpo Järvinen Tested-by: Pengfei Xu Link: https://lore.kernel.org/r/20231005195137.3117166-2-jithu.joseph@intel.com Signed-off-by: Ilpo Järvinen commit cdb1013808bed0c0c392b44ed4eed6c7743028c3 Author: Shyam Sundar S K Date: Sun Sep 10 19:50:33 2023 +0530 platform/x86/amd/pmc: Add PMFW command id to support S2D force flush Recent PMFW have the capability that can force flush the FIFO contents to DRAM on sending a command id via the mailbox. Add this support to the driver. Co-developed-by: Sanket Goswami Signed-off-by: Sanket Goswami Signed-off-by: Shyam Sundar S K Link: https://lore.kernel.org/r/20230910142034.2967110-1-Shyam-sundar.S-k@amd.com [ij: Corrected whitespace in dev_dbg_once()] Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 2a92fccdaca837f65990139207981014970f996c Author: Kees Cook Date: Tue Oct 3 18:44:49 2023 -0700 nexthop: Annotate struct nh_group with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct nh_group. Cc: David Ahern Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: netdev@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: David Ahern Signed-off-by: David S. Miller commit cf9ecad9772554a5b78c4f31b098ed680bc5251e Author: Kees Cook Date: Tue Oct 3 16:21:47 2023 -0700 nexthop: Annotate struct nh_notifier_grp_info with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct nh_notifier_grp_info. Cc: David Ahern Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Cc: netdev@vger.kernel.org Cc: llvm@lists.linux.dev Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: David Ahern Reviewed-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit eaede99c3aeb38613c40a150f676f772faf2b42b Author: Kees Cook Date: Tue Oct 3 16:21:02 2023 -0700 netlink: Annotate struct netlink_policy_dump_state with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct netlink_policy_dump_state. Additionally update the size of the usage array length before accessing it. This requires remembering the old size for the memset() and later assignments. Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Johannes Berg Cc: netdev@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 178e9bf9b57d7671e94d39848a8ed090fe9ee431 Author: Kees Cook Date: Tue Oct 3 16:18:51 2023 -0700 nfp: nsp: Annotate struct nfp_eth_table with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct nfp_eth_table. Cc: Simon Horman Cc: Jakub Kicinski Cc: "David S. Miller" Cc: Eric Dumazet Cc: Paolo Abeni Cc: Yinjun Zhang Cc: Leon Romanovsky Cc: Yu Xiao Cc: Sixiang Chen Cc: oss-drivers@corigine.com Cc: netdev@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Acked-by: Louis Peens Signed-off-by: David S. Miller commit 69c570ebc3964534c19dc4438d3b96f55d489fc3 Author: Aradhya Bhatia Date: Tue Oct 3 14:52:59 2023 +0530 arm64: dts: ti: Fix HDMI Audio overlay in Makefile Apply HDMI audio overlay to AM625 and AM62-LP SK-EVMs DT binaries, instead of leaving it in a floating state. Fixes: b50ccab9e07c ("arm64: dts: ti: am62x-sk: Add overlay for HDMI audio") Reported-by: Rob Herring Signed-off-by: Aradhya Bhatia Link: https://lore.kernel.org/r/20231003092259.28103-1-a-bhatia1@ti.com Signed-off-by: Vignesh Raghavendra commit fdfc374af5dc345fbb9686921fa60176c1c41da0 Author: Rob Herring Date: Tue Oct 3 11:32:02 2023 -0500 ALSA: aoa: Replace asm/prom.h with explicit includes asm/prom.h should not be included directly as it no longer contains anything drivers need. Drivers should include of.h and/or other headers which were getting implicitly included. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20231003163209.770750-1-robh@kernel.org Signed-off-by: Takashi Iwai commit e299a9fd433fe13702724f7f9b2f0f49f5345126 Author: Ivan Orlov Date: Wed Sep 27 12:35:55 2023 +0100 ALSA: aloop: Add control element for getting the access mode Add new control element 'PCM Slave Access Mode' which shows the access mode (interleaved/non-interleaved) for the PCM playing device. Add corresponding control change notification calls. Signed-off-by: Ivan Orlov Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230927113555.14877-2-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai commit 462494565c27ea15d5deebd3605cb826c95ac98f Author: Ivan Orlov Date: Wed Sep 27 12:35:54 2023 +0100 ALSA: aloop: Add support for the non-interleaved access mode The current version of the loopback driver supports interleaved access mode only. This patch introduces support for the non-interleaved access mode. When in the interleaved mode, the 'copy_play_buf' function copies data from the playback to the capture buffer using one memcpy call. This call copies samples for multiple, interleaved channels. In the non-interleaved mode we have multiple channel buffers, so we have to perform multiple memcpy calls to copy samples channel after channel. Add new function called 'copy_play_buf_part_n', which copies a part of each channel buffer from playback to capture. Modify the 'copy_play_buf' to use the corresponding memory copy function(just memcpy / copy_play_buf_part_n) depending on the access mode. Signed-off-by: Ivan Orlov Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230927113555.14877-1-ivan.orlov0322@gmail.com Signed-off-by: Takashi Iwai commit 8eb2194e3ffaa38ed306921d880547f3884d8e43 Author: Thomas Perl Date: Wed Sep 27 07:17:32 2023 +0000 ALSA: intel8x0m: fix name of SIS7013 sound chip in comment While grep'ing for SIS7012, I noticed that there is only one reference to it in sound/pci/intel8x0m.c, while most of its code lives in sound/pci/intel8x0.c. This probably was a simple copy'n'paste mistake, as the sound/pci/intel8x0m.c driver implements support for SIS7013 (see DEVICE_SIS), and the two devices seem to share the same behavior / registers. Signed-off-by: Thomas Perl Link: https://lore.kernel.org/r/5E4B5CA1-1109-4C82-A581-838ACF19A15D@thp.io Signed-off-by: Takashi Iwai commit b61a3acada0031e7a4922d1340b4296ab95c260b Author: Geoffrey D. Bennett Date: Wed Sep 27 01:11:30 2023 +0930 ALSA: scarlett2: Add Focusrite Clarett+ 2Pre and 4Pre support The Focusrite Clarett+ series uses the same protocol as the Scarlett Gen 2 and Gen 3 series. This patch adds support for the Clarett+ 2Pre and Clarett+ 4Pre similarly to the existing 8Pre support by adding appropriate entries to the scarlett2 driver. The Clarett 2Pre USB and 4Pre USB presumably use the same protocol as well, so support for them can easily be added if someone can test. Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/ZRL7qjC3tYQllT3H@m.b4.vu Signed-off-by: Takashi Iwai commit 17dc03e6fdf320bf3179c863bbe314ae7f35c02e Author: Cezary Rojewski Date: Tue Sep 26 10:06:23 2023 +0200 ASoC: Intel: Skylake: Use helper to setup HOST stream snd_hdac_ext_host_stream_setup() abstracts the procedure details away. Simplify the code by using it. Acked-by: Mark Brown Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20230926080623.43927-5-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 25f85afdd37e5ea1d2b385a88cf4533378656724 Author: Cezary Rojewski Date: Tue Sep 26 10:06:22 2023 +0200 ASoC: Intel: avs: Use helper to setup HOST stream snd_hdac_ext_host_stream_setup() abstracts the procedure details away. Simplify the code by using it. Acked-by: Mark Brown Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20230926080623.43927-4-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 88320b74ef95b678e2e1d091c5220589facab185 Author: Cezary Rojewski Date: Tue Sep 26 10:06:21 2023 +0200 ALSA: hda: Introduce HOST stream setup mechanism HDAudio stream setup procedure differs between revisions of the controller device. Currently the differences are handled directly within AudioDSP platform drivers with if-statements. Implement a more generic approach and expose a function that a platform driver may use to ensure the correct procedure is followed each time. Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20230926080623.43927-3-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 2ee2c75c589acff83e987abfa74b6d81d237d92f Author: Cezary Rojewski Date: Tue Sep 26 10:06:20 2023 +0200 ALSA: hda: Poll SDxFIFOS after programming SDxFMT Software shall read SDxFIFOS calculated by the hardware and notify if invalid value is programmed before continuing the stream preparation. Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20230926080623.43927-2-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 162844744fa51edbe0d0857c493e37af336af666 Author: Conor Dooley Date: Mon Sep 18 11:23:27 2023 +0100 pwm: microchip-core: Convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIRE As part of converting RISC-V SOC_FOO symbols to ARCH_FOO to match the use of such symbols on other architectures, convert the Microchip FPGA PWM driver to use the new symbol. Signed-off-by: Conor Dooley Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 42b9116ce12579692ec18ad9446ea5ad832ea0ef Author: Fabio Estevam Date: Fri Sep 22 09:42:28 2023 -0300 dt-bindings: pwm: mxs: Document the clocks property The 'clocks' property is mandatory for the PWM to operate. Document it. Signed-off-by: Fabio Estevam Reviewed-by: Uwe Kleine-König Acked-by: Conor Dooley Signed-off-by: Thierry Reding commit c3c653422a265a3b5dfdf8567eebd5116311c36d Author: Fabio Estevam Date: Fri Sep 22 09:42:27 2023 -0300 dt-bindings: pwm: mxs: Document fsl,imx28-pwm imx28 uses the same PWM block that is found on imx23. Add an entry for fsl,imx28-pwm. Signed-off-by: Fabio Estevam Acked-by: Uwe Kleine-König Acked-by: Rob Herring Signed-off-by: Thierry Reding commit 0a81b0eb81ca94f2be9712b85c2d1c32542a17b2 Author: Ulf Hansson Date: Mon Sep 25 15:17:15 2023 +0200 firmware: arm_scmi: Add generic OPP support to the SCMI performance domain To allow a consumer driver to use the OPP library to scale the performance for its device, let's dynamically add the OPP table when the device gets attached to its SCMI performance domain. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20230925131715.138411-10-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit 5a6a104193520dc3b66ad2c7d823e00b50734ab6 Author: Ulf Hansson Date: Mon Sep 25 15:17:14 2023 +0200 firmware: arm_scmi: Specify the performance level when adding an OPP To enable the performance level to be used for OPPs, let's convert into using the dev_pm_opp_add_dynamic() API when creating them. This will be particularly useful for the SCMI performance domain, as shown through subsequent changes. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20230925131715.138411-9-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit 033ca4de129646e9969a6838b44cca0fac38e219 Author: Ulf Hansson Date: Mon Sep 25 15:17:13 2023 +0200 firmware: arm_scmi: Simplify error path in scmi_dvfs_device_opps_add() Let's simplify the code in scmi_dvfs_device_opps_add() by using dev_pm_opp_remove_all_dynamic() in the error path. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20230925131715.138411-8-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit 0a30c0e9ca293a6680b1a124684cf80c142b1fa0 Merge: 8b6022be4c6e3 0025ff64ffcf6 Author: Sudeep Holla Date: Fri Oct 6 09:40:10 2023 +0100 Merge branch 'opp/pm-domain-scmi' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm into for-next/scmi/updates This is the merge of immutable point in PM OPP tree shared with SCMI so that the SCMI changes based on these OPP changes can be merged via the SCMI tree. * 'opp/pm-domain-scmi' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: OPP: Extend support for the opp-level beyond required-opps OPP: Switch to use dev_pm_domain_set_performance_state() OPP: Extend dev_pm_opp_data with a level OPP: Add dev_pm_opp_add_dynamic() to allow more flexibility PM: domains: Implement the ->set_performance_state() callback for genpd PM: domains: Introduce dev_pm_domain_set_performance_state() commit 7818f0bcc195e7c49eaaa031f0c26c59978469f6 Author: Ruan Jinjie Date: Thu Aug 10 15:42:58 2023 +0800 pwm: omap-dmtimer: Remove redundant of_match_ptr() The driver depends on CONFIG_OF, it is not necessary to use of_match_ptr() here. Signed-off-by: Ruan Jinjie Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 2992e07038aa38e1e156a833d6274bf330642722 Author: Ruan Jinjie Date: Thu Aug 10 15:42:57 2023 +0800 pwm: atmel: Remove redundant of_match_ptr() The driver depends on CONFIG_OF, it is not necessary to use of_match_ptr() here. Signed-off-by: Ruan Jinjie Reviewed-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 3013c7f7780de32b950762f3a8904ef0da44ed63 Author: Andy Shevchenko Date: Thu Oct 5 16:59:45 2023 +0300 pinctrl: denverton: Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE() As Krzysztof pointed out the better is to use MODULE_DEVICE_TABLE() as it will be consistent with the content of the real ID table of the platform devices. Suggested-by: Krzysztof Kozlowski Reviewed-by: Krzysztof Kozlowski Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit a9d7dfaaa8e6185ca0ee9991d66b1ea36a22265e Author: Andy Shevchenko Date: Thu Oct 5 16:39:49 2023 +0300 pinctrl: broxton: Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE() As Krzysztof pointed out the better is to use MODULE_DEVICE_TABLE() as it will be consistent with the content of the real ID table of the platform devices. Suggested-by: Krzysztof Kozlowski Acked-by: Mika Westerberg Reviewed-by: Krzysztof Kozlowski Signed-off-by: Andy Shevchenko commit 4d0f332a6fb65aac2fa98e61bbed4ac9dfcf0a01 Author: Tiezhu Yang Date: Tue Sep 19 19:05:01 2023 +0800 MIPS: Remove dead code in relocate_new_kernel There are two adjacent "b" instructions, the second one is unreachable, it is dead code, just remove it. Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 70f8cd94f2bc7da7577f7751d03e568006accb97 Author: Arınç ÜNAL Date: Mon Sep 18 10:59:15 2023 +0300 mips: dts: ralink: mt7621: rename to GnuBee GB-PC1 and GnuBee GB-PC2 Rename GB-PC1 to GnuBee GB-PC1, and GB-PC2 to GnuBee GB-PC2 to include brand and model name. Signed-off-by: Arınç ÜNAL Acked-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit b44ae980e9d026c41101d97cf96c0eb09d490b35 Author: Arınç ÜNAL Date: Sun Sep 17 13:37:53 2023 +0300 mips: dts: ralink: mt7621: define each reset as an item Each item of the resets property should define a reset. Split the item with two resets on the ethernet node into two separate items. Sort the items of the clocks property to the same line as a trivial change. Signed-off-by: Arınç ÜNAL Acked-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 04318868abaa82f7c6e9e0ce323aa5460b7fc9da Author: Geert Uytterhoeven Date: Wed Aug 30 17:11:55 2023 +0200 mips: dts: ingenic: Remove unneeded probe-type properties The "probe-type" property was only needed when used with the (long obsolete) "direct-mapped" compatible value. Signed-off-by: Geert Uytterhoeven Signed-off-by: Thomas Bogendoerfer commit 595b2c5917d89f5aeeecb4c74e29c0ecfabdc7e9 Author: Keguang Zhang Date: Wed Aug 30 21:35:05 2023 +0800 MIPS: loongson32: Remove dma.h and nand.h Since commit 7b3415f581c7 ("MIPS: Loongson32: Remove unused platform devices"), struct plat_ls1x_dma and plat_ls1x_nand are unused. Then, dma.h and nand.h are useless. Therefore, remove these useless header files. Signed-off-by: Keguang Zhang Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Bogendoerfer commit 48ceb35e72683dce009f2b47f6579b0a1f9d9768 Author: Geert Uytterhoeven Date: Fri Sep 29 11:01:34 2023 +0200 m68k: defconfig: Update virt_defconfig for v6.6-rc3 - Enable CONFIG_DRM_FBDEV_EMULATION and CONFIG_FB_DEVICE (no longer auto-enabled since commit bb6c4507fe825f1b ("drm: fix up fbdev Kconfig defaults")), - Drop CONFIG_FRAMEBUFFER_CONSOLE=y (auto-enabled since commit bb6c4507fe825f1b ("drm: fix up fbdev Kconfig defaults")). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/6f30b86b83b972e9902b62295f397a20512d5507.1695977960.git.geert@linux-m68k.org commit 7e02d701b90eb6b83e8fbcf232711ee67b0cb216 Author: Geert Uytterhoeven Date: Mon Sep 11 16:30:19 2023 +0200 m68k: defconfig: Update defconfigs for v6.6-rc1 - Enable modular build of the new device model tests, - Enable modular build of the glob self-test on configs that didn't have it yet (visible since commit b67abaad4d25b5d9 ("kunit: Allow kunit test modules to use test filtering")), - Replace CONFIG_FB=y by CONFIG_FRAMEBUFFER_CONSOLE=y on the virt platform (the former is no longer needed since commit 55bffc8170bb5813 ("fbdev: Split frame buffer support in FB and FB_CORE symbols")), the latter is no longer auto-enabled since commit a5ae331edb02b664 ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION")). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/43ef623c9053862d93fbc746689d4897b35597ef.1694442486.git.geert@linux-m68k.org commit c7db3832ff19a9a1116c1b3d435c9db165a2f2f8 Author: Arnd Bergmann Date: Mon Sep 25 17:53:20 2023 +0200 m68k: io: Mark mmio read addresses as const Passing constant __iomem tokens into the readl() family of helpers or any of the others causes a warning on m68k: include/asm-generic/io.h: In function 'ioread8_rep': arch/m68k/include/asm/io_mm.h:375:44: warning: passing argument 1 of 'raw_insb' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 375 | #define readsb(port, buf, nr) raw_insb((port), (u8 Add a 'const' modifier to the pointers to shut up the warnings here. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309251926.bPl23AhG-lkp@intel.com/ Signed-off-by: Arnd Bergmann Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230925155328.443664-1-arnd@kernel.org [geert: Fix missed rom_in_{8,be16,le16}()] Signed-off-by: Geert Uytterhoeven commit b038c6abf96843b6c45f2ebf69ad0bb1055d5d39 Author: Geert Uytterhoeven Date: Mon Sep 18 12:14:43 2023 +0200 m68k: Replace GPL 2.0+ README.legal boilerplate with SPDX Upstream Linux never had a "README.legal" file, but it was present in early source releases of Linux/m68k. It contained a simple copyright notice and a link to a version of the "COPYING" file that predated the addition of the "only valid GPL version is v2" clause. Get rid of the references to non-existent files by replacing the boilerplate with SPDX license identifiers. Signed-off-by: Geert Uytterhoeven Acked-by: Greg Ungerer Link: https://lore.kernel.org/r/23430c233728ab02ec0af8e714994398d383137a.1695031668.git.geert@linux-m68k.org commit 72e70a0e7ac7c422843eb8bbf192e820e9ccd24d Author: Geert Uytterhoeven Date: Mon Sep 18 12:07:25 2023 +0200 m68k: sun3: Change led_pattern[] to unsigned char The values stored in led_pattern[] are only used for passing to sun3_leds(), which takes an "unsigned char". Change the type of led_pattern[] accordingly, to reduce kernel size. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/794c5d543dbdae8336a13ef2459adafaaadb7d86.1695031620.git.geert@linux-m68k.org commit ec177486cb278cddb6f03553e0a60d31df3932b6 Author: Rolf Eike Beer Date: Sun Sep 17 11:18:20 2023 +0200 m68k: Add missing types to asm/irq.h As reported in commit f8b648bf6628 ("net: sunhme: move asm includes to below linux includes") when including this header before the needed headers the compilation will fail because of missing types: arch/m68k/include/asm/irq.h:66:20: warning: ‘struct pt_regs’ declared inside parameter list will not be visible outside of this definition or declaration 66 | struct pt_regs *)); | ^~~~~~~ arch/m68k/include/asm/irq.h:78:11: error: expected ‘;’ before ‘void’ 78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs); | ^~~~~ | ; arch/m68k/include/asm/irq.h:78:40: warning: ‘struct pt_regs’ declared inside parameter list will not be visible outside of this definition or declaration 78 | asmlinkage void do_IRQ(int irq, struct pt_regs *regs); | ^~~~~~~ arch/m68k/include/asm/irq.h:79:8: error: unknown type name ‘atomic_t’ 79 | extern atomic_t irq_err_count; | ^~~~~~~~ Signed-off-by: Rolf Eike Beer Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/5971770.lOV4Wx5bFT@eto.sf-tec.de Signed-off-by: Geert Uytterhoeven commit c50b1fc110019a7b4aa08b2092a25e2e6c30f27c Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:42 2023 +0200 m68k: sun3/3x: Add and use "sun3.h" When building with W=1: arch/m68k/sun3/idprom.c:86:6: warning: no previous prototype for ‘sun3_get_model’ [-Wmissing-prototypes] 86 | void sun3_get_model(char *model) | ^~~~~~~~~~~~~~ arch/m68k/sun3/config.c:53:24: warning: no previous prototype for ‘sun3_init’ [-Wmissing-prototypes] 53 | asmlinkage void __init sun3_init(void) | ^~~~~~~~~ arch/m68k/sun3/mmu_emu.c:117:6: warning: no previous prototype for ‘print_pte_vaddr’ [-Wmissing-prototypes] 117 | void print_pte_vaddr (unsigned long vaddr) | ^~~~~~~~~~~~~~~ arch/m68k/sun3/mmu_emu.c:126:13: warning: no previous prototype for ‘mmu_emu_init’ [-Wmissing-prototypes] 126 | void __init mmu_emu_init(unsigned long bootmem_end) | ^~~~~~~~~~~~ arch/m68k/sun3/mmu_emu.c:353:5: warning: no previous prototype for ‘mmu_emu_handle_fault’ [-Wmissing-prototypes] 353 | int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault) | ^~~~~~~~~~~~~~~~~~~~ arch/m68k/sun3/leds.c:6:6: warning: no previous prototype for ‘sun3_leds’ [-Wmissing-prototypes] 6 | void sun3_leds(unsigned char byte) | ^~~~~~~~~ arch/m68k/sun3/intersil.c:27:5: warning: no previous prototype for ‘sun3_hwclk’ [-Wmissing-prototypes] 27 | int sun3_hwclk(int set, struct rtc_time *t) | ^~~~~~~~~~ arch/m68k/sun3x/config.c:30:6: warning: no previous prototype for ‘sun3_leds’ [-Wmissing-prototypes] 30 | void sun3_leds(unsigned char byte) | ^~~~~~~~~ Fix this by introducing a new header file "sun3.h" for holding the prototypes of functions implemented in arch/m68k/sun3/ and arch/m68k/sun3x/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/87856ef9ef8955f459fb691faca921c0a688bc80.1694613528.git.geert@linux-m68k.org commit f9b34638c07e5cdb2c40151e4f9fb87c2dc62e9c Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:41 2023 +0200 m68k: sun3x: Make dvma_print() static There was never a user of dvma_print() outside arch/m68k/sun3x/dvma.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/0a038ac68ee553b1928a975dc0ae1c16803a0ac0.1694613528.git.geert@linux-m68k.org commit 6548f013fafd70e7903f737ddc705a048312de65 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:40 2023 +0200 m68k: sun3x: Make sun3x_halt() static When building with W=1: arch/m68k/sun3x/prom.c:33:6: warning: no previous prototype for ‘sun3x_halt’ [-Wmissing-prototypes] 33 | void sun3x_halt(void) | ^~~~~~~~~~ Fix this by making sun3x_halt() static. The function body was moved to arch/m68k/sun3x/prom.c in v2.4.5.2. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/0ba2883aaff2e4fc5e570bfee87c58e483668b26.1694613528.git.geert@linux-m68k.org commit 1dbda52ef93e49b29c965f21ca615f7280ee0b7f Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:39 2023 +0200 m68k: sun3x: Do not mark dvma_map_iommu() inline dvma_map_iommu() is called from the common Sun3/3x DVMA management code, but never from inside arch/m68k/sun3x/dvma.c. Hence it does not make sense to mark it inline. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/0884fd1f5d6775535bf20b13cc74283df4955e49.1694613528.git.geert@linux-m68k.org commit 873f7a1781ab0cea8ddb4d0b8789d7c936552ccd Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:38 2023 +0200 m68k: sun3x: Fix signature of sun3_leds() The sun3_leds() implementation for Sun3 in arch/m68k/sun3/leds.c, and the prototype in arch/m68k/sun3/sun3ints.c take an "unsigned char", not an "int". Align the dummy implementation for Sun3x with the Sun3 variant and the common caller. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/5214afb67eac58b8adae5710aea0980c2644ff24.1694613528.git.geert@linux-m68k.org commit 88be4a461e6488af6f2bc5a305e0427f969eb274 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:37 2023 +0200 m68k: sun3: Make sun3_platform_init() static When building with W=1: arch/m68k/sun3/config.c:201:12: warning: no previous prototype for ‘sun3_platform_init’ [-Wmissing-prototypes] 202 | int __init sun3_platform_init(void) | ^~~~~~~~~~~~~~~~~~ Fix this by making sun3_platform_init() static. There was never a user outside arch/m68k/sun3/config.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/f35e6376d01b11f21f677cb980093e8410d2c33b.1694613528.git.geert@linux-m68k.org commit dc52d2db892c4aa4469a01c43ccef2c8343c527c Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:36 2023 +0200 m68k: sun3: Make print_pte() static When building with W=1: arch/m68k/sun3/mmu_emu.c:70:6: warning: no previous prototype for ‘print_pte’ [-Wmissing-prototypes] 70 | void print_pte (pte_t pte) | ^~~~~~~~~ Fix this by making print_pte() static. There was never a user outside arch/m68k/sun3/mmu_emu.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/a56c70e85584efb3681cb7e94aff167299dfa5e4.1694613528.git.geert@linux-m68k.org commit dc40c4297760be1b0be1a4a1e6bc74f269f1ab8b Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:35 2023 +0200 m68k: sun3: Annotate prom_printf() with __printf() When building with W=1: arch/m68k/sun3/prom/printf.c: In function ‘prom_printf’: arch/m68k/sun3/prom/printf.c:35:9: warning: function ‘prom_printf’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] 35 | vsprintf(ppbuf, fmt, args); | ^~~~~~~~ Fix this by annotating prom_printf() with __printf(1, 2). Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/61017c012617e6f633ac9f9a3c2659ae38e1f2fb.1694613528.git.geert@linux-m68k.org commit 66ed28ea096c91834a18ecce26eb56a27473ce57 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:34 2023 +0200 m68k: sun3: Remove unused vsprintf() return value in prom_printf() When building with W=1: arch/m68k/sun3/prom/printf.c: In function ‘prom_printf’: arch/m68k/sun3/prom/printf.c:28:13: warning: variable ‘i’ set but not used [-Wunused-but-set-variable] 28 | int i; | ^ As the return value of vsprintf() is unused, and serves no practical purpose here, fix this by removing the variable. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/94a1e61b1651ff05f4a59655d9b8c1ac5338f60c.1694613528.git.geert@linux-m68k.org commit f9d49824c08eae0a77d720aeecc6dcb07dd65771 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:33 2023 +0200 m68k: sun3: Remove unused start_page in sun3_bootmem_alloc() When building with W=1: arch/m68k/sun3/config.c: In function ‘sun3_bootmem_alloc’: arch/m68k/sun3/config.c:110:23: warning: variable ‘start_page’ set but not used [-Wunused-but-set-variable] 112 | unsigned long start_page; | ^~~~~~~~~~ Fix this by removing the variable and the assignment, now the last user is gone. Fixes: 1008a11590b966b4 ("m68k: switch to MEMBLOCK + NO_BOOTMEM") Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/361c4562350c8739f6c0da34f7c416b2678fae7c.1694613528.git.geert@linux-m68k.org commit 2fde1934ae67bfbf5712a32929b40ca7716f00ae Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:32 2023 +0200 m68k: sun3: Remove unused orig_baddr in free_baddr() When building with W=1: arch/m68k/sun3/sun3dvma.c: In function ‘free_baddr’: arch/m68k/sun3/sun3dvma.c:208:23: warning: variable ‘orig_baddr’ set but not used [-Wunused-but-set-variable] 196 | unsigned long orig_baddr; | ^~~~~~~~~~ Fix this by removing the unused variable and assignment, which were futile since their introduction in v2.4.5.2. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/c705b6186241dfe9a5bdcb71720b8697fa5c801f.1694613528.git.geert@linux-m68k.org commit a4286641894d8f3be1110044ff5e0eab3673d8ae Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:31 2023 +0200 m68k: sun3: Add missing asmlinkage to sun3_init() sun3_init() is called from assembly code, so it should be marked asmlinkage for documentation purposes. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/9a174020de2c55e108be9bd25fcdec3e48d655c4.1694613528.git.geert@linux-m68k.org commit bdc1656c08c6aaf68163a111871c07d6f4923c64 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:30 2023 +0200 m68k: sun3: Fix signature of sun3_get_model() The mach_get_model() callback takes a "char *", not an "unsigned char *". Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/c635afb4542ab54c3dbd4fa2fbed07a2665a2f4e.1694613528.git.geert@linux-m68k.org commit 2e195ea7e95b5360f5e4d9c6a89dbcc4eaf70d36 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:29 2023 +0200 m68k: sun3: Fix context restore in flush_tlb_range() When building with W=1: In file included from arch/m68k/kernel/traps.c:42: arch/m68k/include/asm/tlbflush.h: In function ‘flush_tlb_range’: arch/m68k/include/asm/tlbflush.h:191:28: warning: variable ‘oldctx’ set but not used [-Wunused-but-set-variable] 191 | unsigned char seg, oldctx; | ^~~~~~ Indeed, the old context is saved, but never restored. Fix this by adding the missing call to sun3_put_context(). Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/ea859b7850e061e0f7fb3fca64d9f8e6d1c0d2ad.1694613528.git.geert@linux-m68k.org commit 4ebe8459cd09c1cd826398e054d055254a50e106 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:28 2023 +0200 m68k: sun3: Improve Sun3/3x DVMA abstraction in When building with W=1: arch/m68k/sun3/dvma.c:65:13: warning: no previous prototype for ‘sun3_dvma_init’ [-Wmissing-prototypes] 65 | void __init sun3_dvma_init(void) | ^~~~~~~~~~~~~~ arch/m68k/sun3x/dvma.c:178:6: warning: no previous prototype for ‘dvma_unmap_iommu’ [-Wmissing-prototypes] 179 | void dvma_unmap_iommu(unsigned long baddr, int len) | ^~~~~~~~~~~~~~~~ Fix this by moving the declarations for sun3_dvma_init() and dvma_unmap_iommu() to . Avoid #ifdefs in callers by providing dummy static inline functions. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/ec93ed1b28b75674ae9a0b42de083a9bb140f0b3.1694613528.git.geert@linux-m68k.org commit 2926da2bea4400932bf7ec13e67b0f92c4e5215e Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:27 2023 +0200 m68k: sun3/3x: Include for config_sun3*() When building with W=1: arch/m68k/sun3/config.c:123:13: warning: no previous prototype for ‘config_sun3’ [-Wmissing-prototypes] 126 | void __init config_sun3(void) | ^~~~~~~~~~~ arch/m68k/sun3x/config.c:42:13: warning: no previous prototype for ‘config_sun3x’ [-Wmissing-prototypes] 42 | void __init config_sun3x(void) | ^~~~~~~~~~~~ Fix this by including Fixes: 91d7b75a5888c182 ("m68k: Add asm/config.h") Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/b9178e864d6c5e06c177d53bc4cce6d689f94d78.1694613528.git.geert@linux-m68k.org commit bbe6980c332eeb3de171268709539820b3b117e1 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:26 2023 +0200 m68k: q40: Add and use "q40.h" When building with W=1: arch/m68k/q40/q40ints.c:84:13: warning: no previous prototype for ‘q40_init_IRQ’ [-Wmissing-prototypes] 84 | void __init q40_init_IRQ(void) | ^~~~~~~~~~~~ arch/m68k/q40/q40ints.c:112:6: warning: no previous prototype for ‘q40_mksound’ [-Wmissing-prototypes] 112 | void q40_mksound(unsigned int hz, unsigned int ticks) | ^~~~~~~~~~~ arch/m68k/q40/q40ints.c:152:6: warning: no previous prototype for ‘q40_sched_init’ [-Wmissing-prototypes] 152 | void q40_sched_init (void) | ^~~~~~~~~~~~~~ Fix this by introducing a new header file "q40.h" for holding the prototypes of functions implemented in arch/m68k/q40/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/7f983ce079b176e1e1ac2a7d0c35b36197c5fa6b.1694613528.git.geert@linux-m68k.org commit dcec33c1fc4ab63983d93ffb0d82b68fc5775b88 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:25 2023 +0200 m68k: mvme16x: Add and use "mvme16x.h" When building with W=1: arch/m68k/mvme16x/config.c:208:6: warning: no previous prototype for ‘mvme16x_cons_write’ [-Wmissing-prototypes] 208 | void mvme16x_cons_write(struct console *co, const char *str, unsigned count) | ^~~~~~~~~~~~~~~~~~ Fix this by introducing a new header file "mvme16x.h" for holding the prototypes of functions implemented in arch/m68k/mvme16x/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/6200cc3b26fad215c4524748af04692e38c5ecd2.1694613528.git.geert@linux-m68k.org commit 0c2a527e28ee8290a60a7105fc4c302922944bfe Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:24 2023 +0200 m68k: mvme16x: Remove unused sink in mvme16x_cons_write() When building with W=1: arch/m68k/mvme16x/config.c: In function ‘mvme16x_cons_write’: arch/m68k/mvme16x/config.c:211:25: warning: variable ‘sink’ set but not used [-Wunused-but-set-variable] 211 | volatile u_char sink; | ^~~~ Fix this by removing the unused variable and assignment. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/22c4d1978f811d7f4495eeb269ce06304717627a.1694613528.git.geert@linux-m68k.org commit 7f5514b4ed70719a50b0a7c6ad7f4ce6d0f28efe Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:23 2023 +0200 m68k: mvme147: Make mvme147_init_IRQ() static When building with W=1: arch/m68k/mvme147/config.c:76:13: warning: no previous prototype for ‘mvme147_init_IRQ’ [-Wmissing-prototypes] 76 | void __init mvme147_init_IRQ(void) | ^~~~~~~~~~~~~~~~ Fix this by making mvme147_init_IRQ() static. The function body was moved to arch/m68k/mvme147/config.c in v2.6.18. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/853e29ca81761032c3af132fffbd583b667234a6.1694613528.git.geert@linux-m68k.org commit c43278f073c920a18af9721fb620c05f6826ff13 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:22 2023 +0200 m68k: mac: Add and use "mac.h" When building with W=1: arch/m68k/mac/iop.c:235:13: warning: no previous prototype for ‘iop_init’ [-Wmissing-prototypes] 235 | void __init iop_init(void) | ^~~~~~~~ arch/m68k/mac/via.c:112:13: warning: no previous prototype for ‘via_init’ [-Wmissing-prototypes] 111 | void __init via_init(void) | ^~~~~~~~ arch/m68k/mac/via.c:623:13: warning: no previous prototype for ‘via_init_clock’ [-Wmissing-prototypes] 593 | void __init via_init_clock(void) | ^~~~~~~~~~~~~~ arch/m68k/mac/oss.c:37:13: warning: no previous prototype for ‘oss_init’ [-Wmissing-prototypes] 37 | void __init oss_init(void) | ^~~~~~~~ arch/m68k/mac/psc.c:76:13: warning: no previous prototype for ‘psc_init’ [-Wmissing-prototypes] 76 | void __init psc_init(void) | ^~~~~~~~ arch/m68k/mac/baboon.c:25:13: warning: no previous prototype for ‘baboon_init’ [-Wmissing-prototypes] 25 | void __init baboon_init(void) | ^~~~~~~~~~~ arch/m68k/mac/macboing.c:155:6: warning: no previous prototype for ‘mac_mksound’ [-Wmissing-prototypes] 155 | void mac_mksound( unsigned int freq, unsigned int length ) | ^~~~~~~~~~~ arch/m68k/mac/misc.c:608:5: warning: no previous prototype for ‘mac_hwclk’ [-Wmissing-prototypes] 608 | int mac_hwclk(int op, struct rtc_time *t) | ^~~~~~~~~ Fix this by introducing a new header file "mac.h" for holding the prototypes of functions implemented in arch/m68k/mac/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/d1fe0014a9e472a305333de4fa17f335c93d73af.1694613528.git.geert@linux-m68k.org commit a53652fa78dd8db22aa1420899903f96b2b84f11 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:21 2023 +0200 m68k: mac: Make mac_platform_init() static When building with W=1: arch/m68k/mac/config.c:961:12: warning: no previous prototype for ‘mac_platform_init’ [-Wmissing-prototypes] 961 | int __init mac_platform_init(void) | ^~~~~~~~~~~~~~~~~ Fix this by making mac_platform_init() static. There was never a user outside arch/m68k/mac/config.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/f5f069f94c369b7de223bb5e1a21837807fde982.1694613528.git.geert@linux-m68k.org commit 4dae1950b494e5d75aaadc882a9276055d769887 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:20 2023 +0200 m68k: mac: Remove unused yday in unmktime() When building with W=1: arch/m68k/mac/misc.c: In function ‘unmktime’: arch/m68k/mac/misc.c:557:33: warning: variable ‘yday’ set but not used [-Wunused-but-set-variable] 557 | int days, rem, y, wday, yday; | ^~~~ Fix this by removing the unused variable and assignment. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/b25c42eac8beb0862f1b2041e817cb421ec66b4e.1694613528.git.geert@linux-m68k.org commit f5d1d6d25845e901a6c347ce841b73f9f257f4a9 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:19 2023 +0200 m68k: mac: Remove unused sine_data[] When building with W=1: arch/m68k/mac/macboing.c:29:26: warning: ‘sine_data’ defined but not used [-Wunused-const-variable=] 29 | static const signed char sine_data[] = { | ^~~~~~~~~ The predefined sine table was superseded by a table calculated at run-time in v2.2.0. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/75dbc0a141490daf9febfb8cb4a43ae87fbe3352.1694613528.git.geert@linux-m68k.org commit 5a368e9c0294a89ed803e9820a0b4bf9df915dc6 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:18 2023 +0200 m68k: hp300: Include "time.h" for hp300_sched_init() When building with W=1: arch/m68k/hp300/time.c:101:13: warning: no previous prototype for ‘hp300_sched_init’ [-Wmissing-prototypes] 101 | void __init hp300_sched_init(void) | ^~~~~~~~~~~~~~~~ Fix this by including "time.h". Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/630ee35241dc753a30b69adedc2ffa8fc6d551dd.1694613528.git.geert@linux-m68k.org commit 18fe6bf505da8acf2e7b578bb23ea2d89fe9dbf2 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:17 2023 +0200 m68k: bvme6000: Make bvme6000_abort_int() static When building with W=1: arch/m68k/bvme6000/config.c:133:13: warning: no previous prototype for ‘bvme6000_abort_int’ [-Wmissing-prototypes] 133 | irqreturn_t bvme6000_abort_int (int irq, void *dev_id) | ^~~~~~~~~~~~~~~~~~ Fix this by making bvme6000_abort_int() static. There was never a user outside arch/m68k/bvme6000/config.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/4da40748e1d7d56b73840a1d7ab1cb9c9a59cef2.1694613528.git.geert@linux-m68k.org commit 676ca3c3fd9a8e341f9749fa3fecb82e1862a666 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:16 2023 +0200 m68k: apollo: Add and use "apollo.h" When building with W=1: arch/m68k/apollo/dn_ints.c:43:13: warning: no previous prototype for ‘dn_init_IRQ’ [-Wmissing-prototypes] 43 | void __init dn_init_IRQ(void) | ^~~~~~~~~~~ Fix this by introducing a new header file "apollo.h" for holding the prototypes of functions implemented in arch/m68k/apollo/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/d78eceb83b8dd1931be1789204898060664e23f6.1694613528.git.geert@linux-m68k.org commit 7509c04afe930573c8f4ab6abda3743c2c184d66 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:15 2023 +0200 m68k: apollo: Replace set but not used variable by READ_ONCE() When building with W=1: arch/m68k/apollo/config.c: In function ‘dn_timer_int’: arch/m68k/apollo/config.c:171:32: warning: variable ‘x’ set but not used [-Wunused-but-set-variable] 149 | volatile unsigned char x; | ^ Fix this by using READ_ONCE(), and removing the variable. As READ_ONCE() casts to volatile internally, remove the existing cast. Deduplicate the remaining casts by introducing an intermediary. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/d0299797d6bf747eca2da998c6c6256485a9f52e.1694613528.git.geert@linux-m68k.org commit 55775fe94d7ff260a9f63b2e376bab71afebf6ec Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:14 2023 +0200 m68k: apollo: Make local reset, serial, and irq functions static When building with W=1: arch/m68k/apollo/config.c:132:6: warning: no previous prototype for ‘dn_serial_print’ [-Wmissing-prototypes] 110 | void dn_serial_print (const char *str) | ^~~~~~~~~~~~~~~ arch/m68k/apollo/dn_ints.c:8:14: warning: no previous prototype for ‘apollo_irq_startup’ [-Wmissing-prototypes] 8 | unsigned int apollo_irq_startup(struct irq_data *data) | ^~~~~~~~~~~~~~~~~~ arch/m68k/apollo/dn_ints.c:19:6: warning: no previous prototype for ‘apollo_irq_shutdown’ [-Wmissing-prototypes] 19 | void apollo_irq_shutdown(struct irq_data *data) | ^~~~~~~~~~~~~~~~~~~ arch/m68k/apollo/dn_ints.c:29:6: warning: no previous prototype for ‘apollo_irq_eoi’ [-Wmissing-prototypes] 29 | void apollo_irq_eoi(struct irq_data *data) | ^~~~~~~~~~~~~~ Fix this by making all local functions static. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/d2b3a6785d3e80069fea85921c72cf0b7afb8493.1694613528.git.geert@linux-m68k.org commit 93c12e3096759e34482b8e20f17fc9a6a1caa901 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:13 2023 +0200 m68k: apollo: Remove unused debug console functions When building with W=1: arch/m68k/apollo/config.c:111:5: warning: no previous prototype for ‘dn_serial_console_wait_key’ [-Wmissing-prototypes] 111 | int dn_serial_console_wait_key(struct console *co) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~ arch/m68k/apollo/config.c:118:6: warning: no previous prototype for ‘dn_serial_console_write’ [-Wmissing-prototypes] 118 | void dn_serial_console_write (struct console *co, const char *str,unsigned int count) | ^~~~~~~~~~~~~~~~~~~~~~~ arch/m68k/apollo/config.c:238:6: warning: no previous prototype for ‘dn_dummy_waitbut’ [-Wmissing-prototypes] 240 | void dn_dummy_waitbut(void) { | ^~~~~~~~~~~~~~~~ Fix this by removing these unused functions. The last user of dn_serial_console_write() was removed in v2.3.41. The other functions never had any users. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/5da9036914a5c84c20b6af55f1801f0c734a96bb.1694613528.git.geert@linux-m68k.org commit 56422360992905e3a9b27a8c54cd16ad27954d2c Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:12 2023 +0200 m68k: atari: Add and use "atari.h" When building with W=1: arch/m68k/atari/time.c:59:1: warning: no previous prototype for ‘atari_sched_init’ [-Wmissing-prototypes] 59 | atari_sched_init(void) | ^~~~~~~~~~~~~~~~ arch/m68k/atari/time.c:140:5: warning: no previous prototype for ‘atari_mste_hwclk’ [-Wmissing-prototypes] 140 | int atari_mste_hwclk( int op, struct rtc_time *t ) | ^~~~~~~~~~~~~~~~ arch/m68k/atari/time.c:199:5: warning: no previous prototype for ‘atari_tt_hwclk’ [-Wmissing-prototypes] 199 | int atari_tt_hwclk( int op, struct rtc_time *t ) | ^~~~~~~~~~~~~~ arch/m68k/atari/ataints.c:267:13: warning: no previous prototype for ‘atari_init_IRQ’ [-Wmissing-prototypes] 267 | void __init atari_init_IRQ(void) | ^~~~~~~~~~~~~~ arch/m68k/atari/atasound.c:36:6: warning: no previous prototype for ‘atari_microwire_cmd’ [-Wmissing-prototypes] 36 | void atari_microwire_cmd (int cmd) | ^~~~~~~~~~~~~~~~~~~ arch/m68k/atari/atasound.c:53:6: warning: no previous prototype for ‘atari_mksound’ [-Wmissing-prototypes] 53 | void atari_mksound (unsigned int hz, unsigned int ticks) | ^~~~~~~~~~~~~ Fix this by introducing a new header file "atari.h" for holding the prototypes of functions implemented in arch/m68k/atari/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/336e4a478ccbfd7e3e91cdbd27636947587a23a6.1694613528.git.geert@linux-m68k.org commit 839ff3451a11226e7ffaf833bb726ad24b05f86e Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:11 2023 +0200 m68k: atari: Make atari_stram_map_pages() static When building with W=1: arch/m68k/atari/stram.c:118:12: warning: no previous prototype for ‘atari_stram_map_pages’ [-Wmissing-prototypes] 118 | int __init atari_stram_map_pages(void) | ^~~~~~~~~~~~~~~~~~~~~ Fix this by making atari_stram_map_pages() static. There was never a user outside arch/m68k/atari/stram.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/fa86b6d7e54d96ac52f574ed00f96e339f46990f.1694613528.git.geert@linux-m68k.org commit 7849b9122e97e32903a9a341c345af7f1fe9ea8e Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:10 2023 +0200 m68k: atari: Make atari_platform_init() static When building with W=1: arch/m68k/atari/config.c:883:12: warning: no previous prototype for ‘atari_platform_init’ [-Wmissing-prototypes] 883 | int __init atari_platform_init(void) | ^~~~~~~~~~~~~~~~~~~ Fix this by making atari_platform_init() static. There was never a user outside arch/m68k/atari/config.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/417b46ec1945212c0b1fcc8b0f4074bae9a8b0b4.1694613528.git.geert@linux-m68k.org commit e9f72cff896e202fcccf79509cb2c63bb3bfbe65 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:09 2023 +0200 m68k: atari: Make ikbd_reset() static When building with W=1: arch/m68k/atari/atakeyb.c:335:6: warning: no previous prototype for ‘ikbd_reset’ [-Wmissing-prototypes] 335 | void ikbd_reset(void) | ^~~~~~~~~~ Fix this by making ikbd_reset() static. There was never a user outside arch/m68k/atari/atakey.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/6babf691fff55f913808ad845e66f60ab00063b2.1694613528.git.geert@linux-m68k.org commit 4ad69503d8d261b7ccb8c01a681fe3b155db297a Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:08 2023 +0200 m68k: atari: Document data parameter of stdma_try_lock() When building with W=1: arch/m68k/atari/stdma.c:69: warning: Function parameter or member 'data' not described in 'stdma_try_lock' Fix this by documenting the data parameter. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/a69dd3ab0a224e40ce5ce7b30981e2d7a0285a83.1694613528.git.geert@linux-m68k.org commit 090c65639adda433f896e439dfdaaf819e45353f Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:07 2023 +0200 m68k: amiga: Add and use "amiga.h" When building with W=1: arch/m68k/amiga/amisound.c:48:13: warning: no previous prototype for ‘amiga_init_sound’ [-Wmissing-prototypes] 48 | void __init amiga_init_sound(void) | ^~~~~~~~~~~~~~~~ arch/m68k/amiga/amisound.c:71:6: warning: no previous prototype for ‘amiga_mksound’ [-Wmissing-prototypes] 71 | void amiga_mksound( unsigned int hz, unsigned int ticks ) | ^~~~~~~~~~~~~ Fix this by introducing a new header file "amiga.h" for holding the prototypes of functions implemented in arch/m68k/amiga/. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/7e9395e1de1c9a34d16ea40a522057f05bbee400.1694613528.git.geert@linux-m68k.org commit ac0b5591321330d65001f15f8672ac12b612d7a9 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:06 2023 +0200 m68k: amiga: pcmcia: Replace set but not used variable by READ_ONCE() When building with W=1: arch/m68k/amiga/pcmcia.c: In function ‘pcmcia_reset’: arch/m68k/amiga/pcmcia.c:29:23: warning: variable ‘b’ set but not used [-Wunused-but-set-variable] 29 | unsigned char b; | ^ Fix this by using READ_ONCE(), and removing the variable. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/1436fa6b329c2212aaf020055afbb97e64b6f039.1694613528.git.geert@linux-m68k.org commit 45dacf07fb1c308df3e95154f427f6ae49b56705 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:05 2023 +0200 m68k: emu: Mark version[] __maybe_unused When building with W=1: arch/m68k/emu/nfeth.c:42:19: warning: ‘version’ defined but not used [-Wunused-const-variable=] 42 | static const char version[] = | ^~~~~~~ Fix this while obeying the wishes of the original copyright holders by marking version[] with __maybe_unused. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/051731639b4c8e296ec4017595051885cc551c23.1694613528.git.geert@linux-m68k.org commit 6156086e554cd9837b81e77a06451b811da2216e Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:04 2023 +0200 m68k: emu: Remove unused vsnprintf() return value in nfprint() When building with W=1: arch/m68k/emu/natfeat.c: In function ‘nfprint’: arch/m68k/emu/natfeat.c:59:13: warning: variable ‘n’ set but not used [-Wunused-but-set-variable] 59 | int n; | ^ As the return value of vsnprintf() is unused, and serves no practical purpose here, fix this by removing the variable. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/a8b6b17ff352cc560d1848a92d171bb0f44ccb27.1694613528.git.geert@linux-m68k.org commit 217614e937ce4ce7e7ee112fd11fc791beeef2a7 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:03 2023 +0200 m68k: mm: Add and use "fault.h" When building with W=1: arch/m68k/mm/fault.c:22:5: warning: no previous prototype for ‘send_fault_sig’ [-Wmissing-prototypes] 22 | int send_fault_sig(struct pt_regs *regs) | ^~~~~~~~~~~~~~ arch/m68k/mm/fault.c:68:5: warning: no previous prototype for ‘do_page_fault’ [-Wmissing-prototypes] 68 | int do_page_fault(struct pt_regs *regs, unsigned long address, | ^~~~~~~~~~~~~ Fix this by introducing a new header file "fault.h" for holding the prototypes of functions implemented in arch/m68k/mm/fault.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/ef004b8cfe4aac892aa0fb7714c2ed81a02a9b89.1694613528.git.geert@linux-m68k.org commit 87d7186e61854262b2d56c7639fd8aeec6122bd2 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:02 2023 +0200 m68k: mm: Move paging_init() to common When building with W=1: arch/m68k/mm/motorola.c:414:13: warning: no previous prototype for ‘paging_init’ [-Wmissing-prototypes] 414 | void __init paging_init(void) | ^~~~~~~~~~~ arch/m68k/mm/sun3mmu.c:36:13: warning: no previous prototype for ‘paging_init’ [-Wmissing-prototypes] 36 | void __init paging_init(void) | ^~~~~~~~~~~ Fix this by consolidating the multiple prototypes into the common . Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/1b03fde54f205e972e19959b8e335022205d538c.1694613528.git.geert@linux-m68k.org commit 2c0bb8cb99317a59d913dd3be5fd97bf8009be76 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:01 2023 +0200 m68k: mm: Include for hwreg_() When building with W=1: arch/m68k/mm/hwtest.c:29:5: warning: no previous prototype for ‘hwreg_present’ [-Wmissing-prototypes] 29 | int hwreg_present(volatile void *regp) | ^~~~~~~~~~~~~ arch/m68k/mm/hwtest.c:62:5: warning: no previous prototype for ‘hwreg_write’ [-Wmissing-prototypes] 62 | int hwreg_write(volatile void *regp, unsigned short val) | ^~~~~~~~~~~ Fix this by including . Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/fbd87d8e8d1e8cbe7d56941a8a1d7d82b53010d0.1694613528.git.geert@linux-m68k.org commit 53cab6a2b348fceffc6c20323ca84eff3bab53d3 Author: Geert Uytterhoeven Date: Wed Sep 13 16:08:00 2023 +0200 m68k: kernel: Add and use "vectors.h" When building with W=1: arch/m68k/kernel/vectors.c:52:13: warning: no previous prototype for ‘base_trap_init’ [-Wmissing-prototypes] 52 | void __init base_trap_init(void) | ^~~~~~~~~~~~~~ Fix this by introducing a new header file "vectors.h" for holding the prototypes of functions implemented in arch/m68k/kernel/vectors.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/bd0a2f65bc1681dc45e2b24951bd89f9ddbe2eef.1694613528.git.geert@linux-m68k.org commit 90829e82127d8d98abb1cdebeb7ef675d4e90521 Author: Geert Uytterhoeven Date: Wed Sep 13 16:07:59 2023 +0200 m68k: kernel: Add and use "traps.h" When building with W=1: arch/m68k/kernel/traps.c:754:17: warning: no previous prototype for ‘buserr_c’ [-Wmissing-prototypes] 754 | asmlinkage void buserr_c(struct frame *fp) | ^~~~~~~~ arch/m68k/kernel/traps.c:1140:17: warning: no previous prototype for ‘set_esp0’ [-Wmissing-prototypes] 1140 | asmlinkage void set_esp0(unsigned long ssp) | ^~~~~~~~ arch/m68k/kernel/traps.c:1155:17: warning: no previous prototype for ‘fpemu_signal’ [-Wmissing-prototypes] 1155 | asmlinkage void fpemu_signal(int signal, int code, void *addr) | ^~~~~~~~~~~~ arch/m68k/kernel/traps.c:1149:17: warning: no previous prototype for ‘fpsp040_die’ [-Wmissing-prototypes] 1149 | asmlinkage void fpsp040_die(void) | ^~~~~~~~~~~ Fix this by introducing a new header file "traps.h" for holding the prototypes of functions implemented in arch/m68k/kernel/traps.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/652cbbb1c9e339980a86068ebdd0a69362324af8.1694613528.git.geert@linux-m68k.org commit dbe93977e523ff70ff66da824513d203207e394a Author: Geert Uytterhoeven Date: Wed Sep 13 16:07:58 2023 +0200 m68k: kernel: Add and use "signal.h" When building with W=1: arch/m68k/kernel/signal.c:756:18: warning: no previous prototype for ‘do_sigreturn’ [-Wmissing-prototypes] 756 | asmlinkage void *do_sigreturn(struct pt_regs *regs, struct switch_stack *sw) | ^~~~~~~~~~~~ arch/m68k/kernel/signal.c:783:18: warning: no previous prototype for ‘do_rt_sigreturn’ [-Wmissing-prototypes] 783 | asmlinkage void *do_rt_sigreturn(struct pt_regs *regs, struct switch_stack *sw) | ^~~~~~~~~~~~~~~ arch/m68k/kernel/signal.c:1112:17: warning: no previous prototype for ‘do_notify_resume’ [-Wmissing-prototypes] 1112 | asmlinkage void do_notify_resume(struct pt_regs *regs) | ^~~~~~~~~~~~~~~~ Fix this by introducing a new header file "signal.h" for holding the prototypes of functions implemented in arch/m68k/kernel/signal.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/25cecda80698829cec18721a9d0f058cc69df0cc.1694613528.git.geert@linux-m68k.org commit 7afc185016087b5181500f0394bec1feb8bdade0 Author: Geert Uytterhoeven Date: Wed Sep 13 16:07:57 2023 +0200 m68k: kernel: Add and use "ptrace.h" When building with W=1: arch/m68k/kernel/ptrace.c:275:16: warning: no previous prototype for ‘syscall_trace_enter’ [-Wmissing-prototypes] 275 | asmlinkage int syscall_trace_enter(void) | ^~~~~~~~~~~~~~~~~~~ arch/m68k/kernel/ptrace.c:288:17: warning: no previous prototype for ‘syscall_trace_leave’ [-Wmissing-prototypes] 288 | asmlinkage void syscall_trace_leave(void) | ^~~~~~~~~~~~~~~~~~~ Fix this by introducing a new header file "ptrace.h" for holding the prototypes of functions implemented in arch/m68k/kernel/ptrace.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/b4b3577b2149ebd65c3b3c7acccebc0e7e596f9d.1694613528.git.geert@linux-m68k.org commit ab8151fc5e68f6208ee24fddbeb7daf5f6fe347d Author: Geert Uytterhoeven Date: Wed Sep 13 16:07:56 2023 +0200 m68k: kernel: Add and use "process.h" When building with W=1: arch/m68k/kernel/process.c:115:16: warning: no previous prototype for ‘m68k_clone’ [-Wmissing-prototypes] 115 | asmlinkage int m68k_clone(struct pt_regs *regs) | ^~~~~~~~~~ arch/m68k/kernel/process.c:136:16: warning: no previous prototype for ‘m68k_clone3’ [-Wmissing-prototypes] 136 | asmlinkage int m68k_clone3(struct pt_regs *regs) | ^~~~~~~~~~~ Fix this by introducing a new header file "process.h" for holding the prototypes of functions implemented in arch/m68k/kernel/process.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/5e50257d8fcae3eb202ce5f439dc29c09cb6c44f.1694613528.git.geert@linux-m68k.org commit ef69fb4dce17c1e19bef7ba1b34fa37115171fee Author: Geert Uytterhoeven Date: Wed Sep 13 16:07:55 2023 +0200 m68k: kernel: Add and use "ints.h" When building with W=1: arch/m68k/kernel/ints.c:165:17: warning: no previous prototype for ‘handle_badint’ [-Wmissing-prototypes] 165 | asmlinkage void handle_badint(struct pt_regs *regs) | ^~~~~~~~~~~~~ Fix this by introducing a new header file "ints.h" for holding the prototypes of functions implemented in arch/m68k/kernel/ints.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/dc65d01ca4c7de94ce814e5b5e1f726fff97566b.1694613528.git.geert@linux-m68k.org commit 0891c4740c22e8408bece7ff266791a523061041 Author: Geert Uytterhoeven Date: Wed Sep 13 16:07:54 2023 +0200 m68k: kernel: Add and use When building with W=1: arch/m68k/kernel/sys_m68k.c:40:17: warning: no previous prototype for ‘sys_mmap2’ [-Wmissing-prototypes] 40 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | ^~~~~~~~~ arch/m68k/kernel/sys_m68k.c:378:1: warning: no previous prototype for ‘sys_cacheflush’ [-Wmissing-prototypes] 378 | sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len) | ^~~~~~~~~~~~~~ arch/m68k/kernel/sys_m68k.c:463:1: warning: no previous prototype for ‘sys_atomic_cmpxchg_32’ [-Wmissing-prototypes] 463 | sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5, | ^~~~~~~~~~~~~~~~~~~~~ arch/m68k/kernel/sys_m68k.c:564:16: warning: no previous prototype for ‘sys_getpagesize’ [-Wmissing-prototypes] 564 | asmlinkage int sys_getpagesize(void) | ^~~~~~~~~~~~~~~ arch/m68k/kernel/sys_m68k.c:569:26: warning: no previous prototype for ‘sys_get_thread_area’ [-Wmissing-prototypes] 569 | asmlinkage unsigned long sys_get_thread_area(void) | ^~~~~~~~~~~~~~~~~~~ arch/m68k/kernel/sys_m68k.c:574:16: warning: no previous prototype for ‘sys_set_thread_area’ [-Wmissing-prototypes] 574 | asmlinkage int sys_set_thread_area(unsigned long tp) | ^~~~~~~~~~~~~~~~~~~ arch/m68k/kernel/sys_m68k.c:580:16: warning: no previous prototype for ‘sys_atomic_barrier’ [-Wmissing-prototypes] 580 | asmlinkage int sys_atomic_barrier(void) | ^~~~~~~~~~~~~~~~~~ Fix this by introducing a new header file for holding the prototypes for m68k-specific syscalls, and including the generic ones. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/80b721eeb499562cd5d49887b0eee10dd172c88d.1694613528.git.geert@linux-m68k.org commit e036678a4b8f2bcb362a2ca8adfd6a428321a38e Author: Geert Uytterhoeven Date: Wed Sep 13 16:07:53 2023 +0200 m68k: kernel: Make bad_super_trap() static When building with W=1: arch/m68k/kernel/traps.c:968:6: warning: no previous prototype for ‘bad_super_trap’ [-Wmissing-prototypes] 968 | void bad_super_trap (struct frame *fp) | ^~~~~~~~~~~~~~ Fix this by making bad_super_trap() static. There was never a user outside arch/m68k/kernel/traps.c. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/1e0b67a355d7e1bcb40811eced41d3080e8f4d20.1694613528.git.geert@linux-m68k.org commit e34b4acdf6488fbcdf890e72ecf925650c944503 Author: Geert Uytterhoeven Date: Wed Sep 13 16:07:52 2023 +0200 m68k: kernel: Include for trap_init() When building with W=1: arch/m68k/kernel/vectors.c:74:13: warning: no previous prototype for ‘trap_init’ [-Wmissing-prototypes] 74 | void __init trap_init (void) | ^~~~~~~~~ Fix this by including . Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/42e7055fab50deda1f7cd648982e90b7ab28fdc3.1694613528.git.geert@linux-m68k.org commit 7b9f6ca7d43665d8f05174e724e77bc183401613 Author: Geert Uytterhoeven Date: Wed Sep 13 16:07:51 2023 +0200 m68k: kernel: Add missing asmlinkage to do_notify_resume() do_notify_resume() is called from assembly code, so it should be marked asmlinkage for documentation purposes. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/e24d63ec4332316e859125caa8d07c0589603cfd.1694613528.git.geert@linux-m68k.org commit a0938a8e2fb3de5f7d570f3f283e79d4a23b6fe5 Author: Greg Ungerer Date: Wed Sep 13 17:13:50 2023 +1000 m68k: Use kernel's generic libgcc functions The arch/m68k/lib versions of the libgcc functions: ashldi3, ashrdi3 and lshrdi3 were taken directly from an older version of gcc. We can use the kernel's own generic lib versions of these - they are virtually identical. Switch to those and remove the m68k local ones. Signed-off-by: Greg Ungerer Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230913071350.1939818-1-gerg@kernel.org Signed-off-by: Geert Uytterhoeven commit b149353da471ddfc5d6e698784cf22bc55bff68b Author: Azeem Shaikh Date: Wed Aug 30 18:54:28 2023 +0000 m68k: emu: Replace strlcpy() with strscpy() strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). Direct replacement is safe here since return value of -errno is used to check for truncation instead of sizeof(dest). [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230830185428.4109426-1-azeemshaikh38@gmail.com Signed-off-by: Geert Uytterhoeven commit 1fee121f8f2ade1ef2937f1b7d7b08775086fba9 Author: Geert Uytterhoeven Date: Thu Aug 17 16:44:53 2023 +0200 m68k: math-emu: Add missing prototypes When building with W=1: arch/m68k/math-emu/fp_arith.c:301:16: warning: no previous prototype for ‘fp_fsglmul’ [-Wmissing-prototypes] 301 | struct fp_ext *fp_fsglmul(struct fp_ext *dest, struct fp_ext *src) | ^~~~~~~~~~ arch/m68k/math-emu/fp_arith.c:357:16: warning: no previous prototype for ‘fp_fsgldiv’ [-Wmissing-prototypes] 357 | struct fp_ext *fp_fsgldiv(struct fp_ext *dest, struct fp_ext *src) | ^~~~~~~~~~ CC arch/m68k/math-emu/fp_log.o ... Fix this by adding the missing prototypes to header files. Reported-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230810141947.1236730-17-arnd@kernel.org/ Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/96c039640d76973ea762d79018de0bc75bbdc1dc.1692283195.git.geert@linux-m68k.org commit 648c37ec0299fca3a0062f7b2f374cc5d1e2f109 Author: Geert Uytterhoeven Date: Thu Aug 17 16:44:52 2023 +0200 m68k: math-emu: Reformat function and variable headers Make the code shorter and easier to read. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/11506b9225e281f2453a83a02ac4793d0e58b609.1692283195.git.geert@linux-m68k.org commit 11dd57cc15fd4f42b797357017a1119a49449f97 Author: Geert Uytterhoeven Date: Thu Aug 17 16:44:51 2023 +0200 m68k: math-emu: Replace external declarations by header inclusion Replace the (incorrect) external declarations by an inclusion of the appropriate header file. Semantically, the "src" parameters of the various fp_*() functions are constant. However, they cannot actually be const as most of these functions perform a normalization step first. As the fp_one constant passed to fp_add() is already normalized, it is safe to cast away its constness when making the function call. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/163bc2f64b5a3dd7b96a12aaca6733b408ddc880.1692283195.git.geert@linux-m68k.org commit 7e67c75d405b5a3b66ce0af267320ed60e319dd0 Author: Geert Uytterhoeven Date: Thu Aug 17 16:44:50 2023 +0200 m68k: math-emu: Make multi_arith.h self-contained Add the missing #include "fp_emu.h". Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/2efd6610e97dd1621e7d28bf87cb79173285545d.1692283195.git.geert@linux-m68k.org commit 8893eb3de0ec14367466e29cfd8d962d1e615b75 Author: Geert Uytterhoeven Date: Thu Aug 17 16:44:49 2023 +0200 m68k: math-emu: Sanitize include guards Some include guards start with an underscore, others don't. Some comments do not match the actual include guard. Make them uniform, adhering to the "FP__H" format. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/8c84c8bf06c0c1e463c47f071891e2e83d5abdd2.1692283195.git.geert@linux-m68k.org commit 54b76dc9707a12b063bcb4a5d68bdaad2dc28514 Author: Geert Uytterhoeven Date: Thu Aug 17 16:44:48 2023 +0200 m68k: math-emu: Fix incorrect file reference in fp_log.c The file comment header refers to the wrong file. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/faf2244c3c80a4d70da5a18dd2a170a15b3ebd88.1692283195.git.geert@linux-m68k.org commit 184ff4f721638e37a5a5907bf98962b6d9318ef6 Author: Nathan Chancellor Date: Thu Oct 5 10:25:27 2023 -0700 OPP: Fix -Wunsequenced in _of_add_opp_table_v1() Clang warns (or errors with CONFIG_WERROR=y): drivers/opp/of.c:1081:28: error: multiple unsequenced modifications to 'val' [-Werror,-Wunsequenced] 1081 | .freq = be32_to_cpup(val++) * 1000, | ^ 1082 | .u_volt = be32_to_cpup(val++), | ~~ 1 error generated. There is no sequence point in a designated initializer. Move back to separate variables for the creation of the values, so that there are sequence points between each evaluation and increment of val. Fixes: 75bbc92c09d8 ("OPP: Add dev_pm_opp_add_dynamic() to allow more flexibility") Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Viresh Kumar commit 339818380868e34ff2c482db05031bf47a67d609 Author: Dan Williams Date: Wed Oct 4 18:35:01 2023 -0700 cxl/memdev: Fix sanitize vs decoder setup locking The sanitize operation is destructive and the expectation is that the device is unmapped while in progress. The current implementation does a lockless check for decoders being active, but then does nothing to prevent decoders from racing to be committed. Introduce state tracking to resolve this race. This incidentally cleans up unpriveleged userspace from triggering mmio read cycles by spinning on reading the 'security/state' attribute. Which at a minimum is a waste since the kernel state machine can cache the completion result. Lastly cxl_mem_sanitize() was mistakenly marked EXPORT_SYMBOL() in the original implementation, but an export was never required. Fixes: 0c36b6ad436a ("cxl/mbox: Add sanitization handling machinery") Cc: Davidlohr Bueso Reviewed-by: Jonathan Cameron Reviewed-by: Davidlohr Bueso Reviewed-by: Dave Jiang Signed-off-by: Dan Williams commit 5f2da19714465739da2449253b13ac06cb353a26 Author: Dan Williams Date: Wed Oct 4 16:49:36 2023 -0700 cxl/pci: Fix sanitize notifier setup Fix a race condition between the mailbox-background command interrupt firing and the security-state sysfs attribute being removed. The race is difficult to see due to the awkward placement of the sanitize-notifier setup code and the multiple places the teardown calls are made, cxl_memdev_security_init() and cxl_memdev_security_shutdown(). Unify setup in one place, cxl_sanitize_setup_notifier(). Arrange for the paired cxl_sanitize_teardown_notifier() to safely quiet the notifier and let the cxl_memdev + irq be unregistered later in the flow. Note: The special wrinkle of the sanitize notifier is that it interacts with interrupts, which are enabled early in the flow, and it interacts with memdev sysfs which is not initialized until late in the flow. Hence why this setup routine takes an @cxlmd argument, and not just @mds. This fix is also needed as a preparation fix for a memdev unregistration crash. Reported-by: Jonathan Cameron Closes: http://lore.kernel.org/r/20230929100316.00004546@Huawei.com Cc: Dave Jiang Cc: Davidlohr Bueso Fixes: 0c36b6ad436a ("cxl/mbox: Add sanitization handling machinery") Reviewed-by: Dave Jiang Reviewed-by: Ira Weiny Reviewed-by: Davidlohr Bueso Reviewed-by: Jonathan Cameron Signed-off-by: Dan Williams commit f29a824b0b6710328a78b018de3c2cfa9db65876 Author: Dan Williams Date: Wed Oct 4 16:04:49 2023 -0700 cxl/pci: Clarify devm host for memdev relative setup It is all too easy to get confused about @dev usage in the CXL driver stack. Before adding a new cxl_pci_probe() setup operation that has a devm lifetime dependent on @cxlds->dev binding, but also references @cxlmd->dev, and prints messages, rework the devm_cxl_add_memdev() and cxl_memdev_setup_fw_upload() function signatures to make this distinction explicit. I.e. pass in the devm context as an @host argument rather than infer it from other objects. This is in preparation for adding a devm_cxl_sanitize_setup_notifier(). Note the whitespace fixup near the change of the devm_cxl_add_memdev() signature. That uncaught typo originated in the patch that added cxl_memdev_security_init(). Reviewed-by: Jonathan Cameron Reviewed-by: Ira Weiny Reviewed-by: Dave Jiang Signed-off-by: Dan Williams commit 2627c995c15dc375f4b5a591d782a14b1c0e3e7d Author: Dan Williams Date: Wed Oct 4 16:24:39 2023 -0700 cxl/pci: Remove inconsistent usage of dev_err_probe() If dev_err_probe() is to be used it should at least be used consistently within the same function. It is also worth questioning whether every potential -ENOMEM needs an explicit error message. Remove the cxl_setup_fw_upload() error prints for what are rare / hardware-independent failures. Reviewed-by: Jonathan Cameron Reviewed-by: Ira Weiny Reviewed-by: Davidlohr Bueso Reviewed-by: Dave Jiang Signed-off-by: Dan Williams commit 08b8a8c05423174e3ef4fb0bd514de20088cf5ac Author: Dan Williams Date: Tue Oct 3 20:12:12 2023 -0700 cxl/pci: Remove hardirq handler for cxl_request_irq() Now that all callers of cxl_request_irq() are using threaded irqs, drop the hardirq handler option. Reviewed-by: Jonathan Cameron Reviewed-by: Ira Weiny Reviewed-by: Davidlohr Bueso Reviewed-by: Dave Jiang Signed-off-by: Dan Williams commit 0025ff64ffcf6bd6ece5484e7818401f77bf115f Author: Ulf Hansson Date: Mon Sep 25 15:17:12 2023 +0200 OPP: Extend support for the opp-level beyond required-opps At this point the level (performance state) for an OPP is currently limited to be requested for a device that is attached to a PM domain. Moreover, the device needs to have the so called required-opps assigned to it, which are based upon OPP tables being described in DT. To extend the support beyond required-opps and DT, let's enable the level to be set for all OPPs. More precisely, if the requested OPP has a valid level let's try to request it through the device's optional PM domain, via calling dev_pm_domain_set_performance_state(). Signed-off-by: Ulf Hansson [ Viresh: Handle NULL opp in _set_opp_level() ] Signed-off-by: Viresh Kumar commit 693bb8a4d1a762058c5dbf42fb95a567931f706e Author: Bjorn Andersson Date: Wed Sep 20 16:03:57 2023 -0700 dt-bindings: opp: opp-v2-kryo-cpu: Allow opp-peak-kBps Many of the users of operating-points-v2-kryo-cpu scales interconnect bandwidth based on the selected opp. Extend the binding to allow the opp-peak-kBps property, inherited from opp-v2-base.yaml, to be used to specify the requested bandwidth. Signed-off-by: Bjorn Andersson Acked-by: Rob Herring Signed-off-by: Viresh Kumar commit 892c60c6b48dfada25b8cc7aad907b93c4dbff93 Author: Ulf Hansson Date: Mon Sep 25 15:17:11 2023 +0200 OPP: Switch to use dev_pm_domain_set_performance_state() To support performance scaling for any kinds of PM domains, let's move away from using the genpd specific API, dev_pm_genpd_set_performance_state(), to the common dev_pm_domain_set_performance_state(). No intended functional impact at this point. Signed-off-by: Ulf Hansson Signed-off-by: Viresh Kumar commit 3aa872546783b146d821bbce6b1507aa33b77fc9 Author: Viresh Kumar Date: Wed Sep 27 16:28:16 2023 +0530 OPP: debugfs: Fix warning with W=1 builds We currently get the following warning: debugfs.c: In function ‘opp_debug_create_one’: debugfs.c:63:42: warning: ‘%.1d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=] snprintf(name, sizeof(name), "icc-path-%.1d", i); ^~~~ debugfs.c:63:32: note: directive argument in the range [0, 2147483647] snprintf(name, sizeof(name), "icc-path-%.1d", i); ^~~~~~~~~~~~~~~ debugfs.c:63:3: note: ‘snprintf’ output between 11 and 20 bytes into a destination of size 11 snprintf(name, sizeof(name), "icc-path-%.1d", i); Fix it by increasing size of the `name` array. Signed-off-by: Viresh Kumar commit 3166383da081461244918aeed7ad028ef11b17cc Author: Ulf Hansson Date: Mon Sep 25 15:17:10 2023 +0200 OPP: Extend dev_pm_opp_data with a level Let's extend the dev_pm_opp_data with a level variable, to allow users to specify a corresponding level (performance state) for a dynamically added OPP. Signed-off-by: Ulf Hansson Signed-off-by: Viresh Kumar commit cca14de56986905013a83df4e512358b9c6a54a8 Author: Viresh Kumar Date: Wed Sep 27 16:28:37 2023 +0530 OPP: Remove doc style comments for internal routines These were previously exposed outside of the OPP core and needed doc style commenting. They aren't public now and don't need the same. This fixes warnings generated for builds with `W=1`: core.c:2105: warning: Function parameter or member 'opp_table' not described in '_opp_set_supported_hw' core.c:2105: warning: Excess function parameter 'dev' description in '_opp_set_supported_hw' core.c:2148: warning: Function parameter or member 'opp_table' not described in '_opp_set_prop_name' core.c:2148: warning: Excess function parameter 'dev' description in '_opp_set_prop_name' core.c:2189: warning: Function parameter or member 'opp_table' not described in '_opp_set_regulators' core.c:2189: warning: Excess function parameter 'count' description in '_opp_set_regulators' core.c:2293: warning: Function parameter or member 'opp_table' not described in '_opp_set_clknames' core.c:2293: warning: Function parameter or member 'config_clks' not described in '_opp_set_clknames' core.c:2391: warning: Function parameter or member 'opp_table' not described in '_opp_set_config_regulators_helper' core.c:2455: warning: Function parameter or member 'opp_table' not described in '_opp_attach_genpd' core.c:2682: warning: Function parameter or member 'token' not described in 'dev_pm_opp_clear_config' core.c:2682: warning: Excess function parameter 'opp_table' description in 'dev_pm_opp_clear_config' Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309091558.x3JJrxFI-lkp@intel.com/ Signed-off-by: Viresh Kumar commit a0242c81bb759ef03184be8eddcc7d5bdf36cc16 Author: Krishna chaitanya chundru Date: Thu Sep 7 11:30:31 2023 +0530 OPP: Add dev_pm_opp_find_level_floor() Add dev_pm_opp_find_level_floor(), as is done for frequency and bandwidth. Signed-off-by: Krishna chaitanya chundru [ Viresh: Updated commit log and rearranged code ] Signed-off-by: Viresh Kumar commit 248a38d5cc3f3505e6cfbbc0514435c9f1ba00af Author: Ulf Hansson Date: Mon Sep 25 15:17:09 2023 +0200 OPP: Add dev_pm_opp_add_dynamic() to allow more flexibility The dev_pm_opp_add() API is limited to add dynamic OPPs with a frequency and a voltage level. To enable more flexibility, let's add a new API, dev_pm_opp_add_dynamic() that's takes a struct dev_pm_opp_data* instead of a list of in-parameters. Signed-off-by: Ulf Hansson Signed-off-by: Viresh Kumar commit 401e09201a01183f1cc8533aa956cb837bf6d3da Author: Ulf Hansson Date: Mon Sep 25 15:17:08 2023 +0200 PM: domains: Implement the ->set_performance_state() callback for genpd To enable generic support for performance scaling for PM domains, let's implement the ->set_performance_state() callback for genpd. Beyond this change, users of the corresponding genpd specific API, dev_pm_genpd_set_performance_state() are encouraged to switch to the common dev_pm_domain_set_performance_state() API. Signed-off-by: Ulf Hansson Acked-by: Rafael J. Wysocki Signed-off-by: Viresh Kumar commit 3fbc5c3b8522d655cf91d32c158261060fdc02fe Author: Ulf Hansson Date: Mon Sep 25 15:17:07 2023 +0200 PM: domains: Introduce dev_pm_domain_set_performance_state() The generic PM domain is currently the only PM domain variant that supports performance scaling. To allow performance scaling to be supported through a common interface, let's add an optional callback ->set_performance_state(), in the struct dev_pm_domain. Moreover, let's add a function, dev_pm_domain_set_performance_state(), that may be called by consumers to request a new performance state for a device through its PM domain. Note that, in most cases it's preferred that a consumer use the OPP library to request a new performance state for its device. Although, this requires some additional changes to be supported, which are being implemented from subsequent changes. Signed-off-by: Ulf Hansson Acked-by: Rafael J. Wysocki Signed-off-by: Viresh Kumar commit c1698c73f4aaef2fd406da1c0a92e1c8f7b7780c Author: Uwe Kleine-König Date: Tue Sep 19 12:39:39 2023 +0200 drm: exynos: dsi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). samsung_dsim_remove() returned 0 unconditionally. Make it return void instead to convert the two related platform drivers to use .remove_new(). Signed-off-by: Uwe Kleine-König Reviewed-by: Inki Dae Acked-by: Inki Dae Link: https://lore.kernel.org/r/20230919103939.1367659-1-u.kleine-koenig@pengutronix.de Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230919103939.1367659-1-u.kleine-koenig@pengutronix.de commit b50944fe2234a175ace253ed05dfae10caa49566 Author: Igor Prusov Date: Thu Oct 5 22:55:43 2023 +0300 arm64: dts: meson-a1-ad402: set SPIFC pins SPIFC uses muxed GPIO pins, so they should be properly configured. Signed-off-by: Igor Prusov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20231005195543.380273-3-ivprusov@salutedevices.com Signed-off-by: Neil Armstrong commit 4985d0b308eeec44d2563d7c9d4884bc382d01de Author: Igor Prusov Date: Thu Oct 5 22:55:42 2023 +0300 arm64: dts: meson: a1: Add SPIFC mux pins SPI Flash Controller uses multi-function pins, so add missing mux definition. Signed-off-by: Igor Prusov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20231005195543.380273-2-ivprusov@salutedevices.com Signed-off-by: Neil Armstrong commit 7a0207094f1b14b2a690594e9b3587dddff0be5d Author: Florian Westphal Date: Wed Oct 4 18:09:53 2023 +0200 xfrm: policy: replace session decode with flow dissector xfrm needs to populate ipv4/v6 flow struct for route lookup. In the past there were several bugs in this code: 1. callers that forget to reload header pointers after xfrm_decode_session() (it may pull headers). 2. bugs in decoding where accesses past skb->data occurred. Meanwhile network core gained a packet dissector as well. This switches xfrm to the flow dissector. Changes since RFC: Drop ipv6 mobiliy header support, AFAIU noone uses this. Drop extraction of flowlabel, replaced code doesn't set it either. Reviewed-by: Simon Horman Link: https://lore.kernel.org/netdev/20230908120628.26164-3-fw@strlen.de/ Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert commit 45f87dd6b309b29541224e8212591abb6d294406 Author: Florian Westphal Date: Wed Oct 4 18:09:52 2023 +0200 xfrm: move mark and oif flowi decode into common code flowi4_oif/flowi6_oif and mark are aliased to flowi_common field, i.e. all can be used interchangeably. Instead of duplicating place this in common code. No functional changes intended. Reviewed-by: Simon Horman Signed-off-by: Florian Westphal Signed-off-by: Steffen Klassert commit 2b1dc6285c3f6e6fcc9e25bf8cd0ca66f2443697 Author: Florian Westphal Date: Wed Oct 4 18:09:51 2023 +0200 xfrm: pass struct net to xfrm_decode_session wrappers Preparation patch, extra arg is not used. No functional changes intended. This is needed to replace the xfrm session decode functions with the flow dissector. skb_flow_dissect() cannot be used as-is, because it attempts to deduce the 'struct net' to use for bpf program fetch from skb->sk or skb->dev, but xfrm code path can see skbs that have neither sk or dev filled in. So either flow dissector needs to try harder, e.g. by also trying skb->dst->dev, or we have to pass the struct net explicitly. Passing the struct net doesn't look too bad to me, most places already have it available or can derive it from the output device. Reported-by: kernel test robot Link: https://lore.kernel.org/netdev/202309271628.27fd2187-oliver.sang@intel.com/ Signed-off-by: Florian Westphal Reviewed-by: Simon Horman Signed-off-by: Steffen Klassert commit e377240a8eb06fb3ea1e77d3e252d79bbfa5d490 Merge: 1d495f1c896cf 221ddb723d909 Author: Steffen Klassert Date: Fri Oct 6 07:40:02 2023 +0200 Merge branch 'xfrm: Support GRO decapsulation for ESP in UDP encapsulation' Antony Antony says: ============ I have added how to enable this feature, and more description to the second patch. Here is copy of that. xfrm: Support GRO for IPv4i & IPv6 ESP in UDP encapsulation This patchset enables the GRO codepath for ESP in UDP encapsulated packets. Decapsulation happens at L2 and saves a full round through the stack for each packet. This is also needed to support HW offload for ESP in UDP encapsulation. Enabling this would imporove performance for ESP in UDP datapath, i.e IPsec with NAT in between. Our initial tests show 20% improvement. By default GRP for ESP-in-UDP is disabled for UDP sockets. To enable this feature for an ESP socket, the following two options need to be set: 1. enable ESP-in-UDP: (this is already set by an IKE daemon). int type = UDP_ENCAP_ESPINUDP; setsockopt(fd, SOL_UDP, UDP_ENCAP, &type, sizeof(type)); 2. To enable GRO for ESP in UDP socket: type = true; setsockopt(fd, SOL_UDP, UDP_GRO, &type, sizeof(type)); Enabling ESP-in-UDP has the side effect of preventing the Linux stack from seeing ESP packets at the L3 (when ESP OFFLOAD is disabled), as packets are immediately decapsulated from UDP and decrypted. This change may affect nftable rules that match on ESP packets at L3. Also tcpdump won't see the ESP packet. Developers/admins are advised to review and adapt any nftable rules accordingly before enabling this feature to prevent potential rule breakage. Also tcpdump will not see from ESP packets from a ESP in UDP flow when this is enabled. Initial, a quick test showed performance difference of about 20% impromvent on the receiver, when using iperf, tcp flow, over ESP in UDP. ============ Signed-off-by: Steffen Klassert commit 9c8c3fa3a52bc55696ccc4dfcb8a49f969b5fb0e Author: Akihiko Odaki Date: Thu Oct 5 16:21:36 2023 +0900 bpf: Fix the comment for bpf_restore_data_end() The comment used to say: > Restore data saved by bpf_compute_data_pointers(). But bpf_compute_data_pointers() does not save the data; bpf_compute_and_save_data_end() does. Signed-off-by: Akihiko Odaki Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20231005072137.29870-1-akihiko.odaki@daynix.com Signed-off-by: Martin KaFai Lau commit 221ddb723d90907019838b89b9e9bccb11461381 Author: Steffen Klassert Date: Wed Oct 4 15:05:44 2023 +0200 xfrm: Support GRO for IPv6 ESP in UDP encapsulation This patch enables the GRO codepath for IPv6 ESP in UDP encapsulated packets. Decapsulation happens at L2 and saves a full round through the stack for each packet. This is also needed to support HW offload for ESP in UDP encapsulation. Signed-off-by: Steffen Klassert Co-developed-by: Antony Antony Signed-off-by: Antony Antony Reviewed-by: Eyal Birger commit 172bf009c18d3ba4b841408f864a5322989ab6c0 Author: Steffen Klassert Date: Wed Oct 4 15:05:27 2023 +0200 xfrm: Support GRO for IPv4 ESP in UDP encapsulation This patch enables the GRO codepath for IPv4 ESP in UDP encapsulated packets. Decapsulation happens at L2 and saves a full round through the stack for each packet. This is also needed to support HW offload for ESP in UDP encapsulation. Enabling this would imporove performance for ESP in UDP datapath, i.e IPsec with NAT in between. By default GRP for ESP-in-UDP is disabled for UDP sockets. To enable this feature for an ESP socket, the following two options need to be set: 1. enable ESP-in-UDP: (this is already set by an IKE daemon). int type = UDP_ENCAP_ESPINUDP; setsockopt(fd, SOL_UDP, UDP_ENCAP, &type, sizeof(type)); 2. To enable GRO for ESP in UDP socket: type = true; setsockopt(fd, SOL_UDP, UDP_GRO, &type, sizeof(type)); Enabling ESP-in-UDP has the side effect of preventing the Linux stack from seeing ESP packets at the L3 (when ESP OFFLOAD is disabled), as packets are immediately decapsulated from UDP and decrypted. This change may affect nftable rules that match on ESP packets at L3. Also tcpdump won't see the ESP packet. Developers/admins are advised to review and adapt any nftable rules accordingly before enabling this feature to prevent potential rule breakage. Also tcpdump will not see from ESP packets from a ESP in UDP flow, when this is enabled. Signed-off-by: Steffen Klassert Co-developed-by: Antony Antony Signed-off-by: Antony Antony Reviewed-by: Eyal Birger commit b439475a0dba2b50fb39a6356069969780e45fd4 Author: Steffen Klassert Date: Wed Oct 4 15:05:10 2023 +0200 xfrm: Use the XFRM_GRO to indicate a GRO call on input This is needed to support GRO for ESP in UDP encapsulation. Signed-off-by: Steffen Klassert Co-developed-by: Antony Antony Signed-off-by: Antony Antony Reviewed-by: Eyal Birger commit d549854bc58f05af9ab660b3461383eea623ff89 Author: Geliang Tang Date: Thu Oct 5 15:21:51 2023 +0800 selftests/bpf: Enable CONFIG_VSOCKETS in config CONFIG_VSOCKETS is required by BPF selftests, otherwise we get errors like this: ./test_progs:socket_loopback_reuseport:386: socket: Address family not supported by protocol socket_loopback_reuseport:FAIL:386 ./test_progs:vsock_unix_redir_connectible:1496: vsock_socketpair_connectible() failed vsock_unix_redir_connectible:FAIL:1496 So this patch enables it in tools/testing/selftests/bpf/config. Signed-off-by: Geliang Tang Link: https://lore.kernel.org/r/472e73d285db2ea59aca9bbb95eb5d4048327588.1696490003.git.geliang.tang@suse.com Signed-off-by: Martin KaFai Lau commit 5d6d6a7d7e66a98bb3432478d226c68c219aaba3 Author: David Woodhouse Date: Thu Oct 5 10:16:10 2023 +0100 KVM: x86: Refine calculation of guest wall clock to use a single TSC read When populating the guest's PV wall clock information, KVM currently does a simple 'kvm_get_real_ns() - get_kvmclock_ns(kvm)'. This is an antipattern which should be avoided; when working with the relationship between two clocks, it's never correct to obtain one of them "now" and then the other at a slightly different "now" after an unspecified period of preemption (which might not even be under the control of the kernel, if this is an L1 hosting an L2 guest under nested virtualization). Add a kvm_get_wall_clock_epoch() function to return the guest wall clock epoch in nanoseconds using the same method as __get_kvmclock() — by using kvm_get_walltime_and_clockread() to calculate both the wall clock and KVM clock time from a *single* TSC reading. The condition using get_cpu_tsc_khz() is equivalent to the version in __get_kvmclock() which separately checks for the CONSTANT_TSC feature or the per-CPU cpu_tsc_khz. Which is what get_cpu_tsc_khz() does anyway. Signed-off-by: David Woodhouse Link: https://lore.kernel.org/r/bfc6d3d7cfb88c47481eabbf5a30a264c58c7789.camel@infradead.org Signed-off-by: Sean Christopherson commit 28b95ee868072f1cd029245bf96cf02844322f37 Author: Kemeng Shi Date: Fri Sep 29 00:04:07 2023 +0800 ext4: run mballoc test with different layouts setting Use KUNIT_CASE_PARAM to run mballoc test with different layouts setting. Signed-off-by: Kemeng Shi Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/20230928160407.142069-13-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 7c9fa399a369546c0e0375ea4b354d642a8fe501 Author: Kemeng Shi Date: Fri Sep 29 00:04:06 2023 +0800 ext4: add first unit test for ext4_mb_new_blocks_simple in mballoc Here are prepared work: 1. Include mballoc-test.c to mballoc.c to be able test static function in mballoc.c. 2. Implement static stub to avoid read IO to disk. 3. Construct fake super_block. Only partial members are set, more members will be set when more functions are tested. Then unit test for ext4_mb_new_blocks_simple is added. Signed-off-by: Kemeng Shi Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/20230928160407.142069-12-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit bdefd689b7ff0eadc3b29dc6c66556617bd1ed42 Author: Kemeng Shi Date: Fri Sep 29 00:04:05 2023 +0800 ext4: add some kunit stub for mballoc kunit test Multiblocks allocation will read and write block bitmap and group descriptor which reside on disk. Add kunit stub to function ext4_get_group_desc, ext4_read_block_bitmap_nowait, ext4_wait_block_bitmap and ext4_mb_mark_context to avoid real IO to disk. Signed-off-by: Kemeng Shi Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/20230928160407.142069-11-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 5c657db46d9ebc63e57be1408f1986c9b23368e1 Author: Kemeng Shi Date: Fri Sep 29 00:04:04 2023 +0800 ext4: call ext4_mb_mark_context in ext4_group_add_blocks() Call ext4_mb_mark_context in ext4_group_add_blocks() to remove repeat code. Signed-off-by: Kemeng Shi Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/20230928160407.142069-10-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 03c7fc39a677cdeae076d8b9ecc10920dd13f6a8 Author: Kemeng Shi Date: Fri Sep 29 00:04:03 2023 +0800 ext4: Separate block bitmap and buddy bitmap freeing in ext4_group_add_blocks() This patch separates block bitmap and buddy bitmap freeing in order to update block bitmap with ext4_mb_mark_context in following patch. The reason why this can be sperated is explained in previous submit. Put the explanation here to simplify the code archeology to ext4_group_add_blocks(): Separated freeing is safe with concurrent allocation as long as: 1. Firstly allocate block in buddy bitmap, and then in block bitmap. 2. Firstly free block in block bitmap, and then buddy bitmap. Then freed block will only be available to allocation when both buddy bitmap and block bitmap are updated by freeing. Allocation obeys rule 1 already, just do sperated freeing with rule 2. Separated freeing has no race with generate_buddy as: Once ext4_mb_load_buddy_gfp is executed successfully, the update-to-date buddy page can be found in sbi->s_buddy_cache and no more buddy initialization of the buddy page will be executed concurrently until buddy page is unloaded. As we always do free in "load buddy, free, unload buddy" sequence, separated freeing has no race with generate_buddy. Signed-off-by: Kemeng Shi Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/20230928160407.142069-9-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 38b8f70cd28c6ad21192d82f271b9e32bdcb8600 Author: Kemeng Shi Date: Fri Sep 29 00:04:02 2023 +0800 ext4: call ext4_mb_mark_context in ext4_mb_clear_bb Call ext4_mb_mark_context in ext4_mb_clear_bb to remove repeat code. Signed-off-by: Kemeng Shi Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/20230928160407.142069-8-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 33e728c67db6b7e72fc8d09f7a38f72302b8a98d Author: Kemeng Shi Date: Fri Sep 29 00:04:01 2023 +0800 ext4: Separate block bitmap and buddy bitmap freeing in ext4_mb_clear_bb() This patch separates block bitmap and buddy bitmap freeing in order to update block bitmap with ext4_mb_mark_context in following patch. Separated freeing is safe with concurrent allocation as long as: 1. Firstly allocate block in buddy bitmap, and then in block bitmap. 2. Firstly free block in block bitmap, and then buddy bitmap. Then freed block will only be available to allocation when both buddy bitmap and block bitmap are updated by freeing. Allocation obeys rule 1 already, just do sperated freeing with rule 2. Separated freeing has no race with generate_buddy as: Once ext4_mb_load_buddy_gfp is executed successfully, the update-to-date buddy page can be found in sbi->s_buddy_cache and no more buddy initialization of the buddy page will be executed concurrently until buddy page is unloaded. As we always do free in "load buddy, free, unload buddy" sequence, separated freeing has no race with generate_buddy. Signed-off-by: Kemeng Shi Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/20230928160407.142069-7-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 2f94711b098bc55285ac74aba2f2b83fd72b555f Author: Kemeng Shi Date: Fri Sep 29 00:04:00 2023 +0800 ext4: call ext4_mb_mark_context in ext4_mb_mark_diskspace_used Call ext4_mb_mark_context in ext4_mb_mark_diskspace_used to: 1. Remove repeat code to normally update bitmap and group descriptor on disk. 2. Now that we have a common API for marking blocks inuse/free in block bitmap, use that instead of open coding it in function ext4_mb_mark_diskspace_used(). The current code was not updating checksum and other counters. ext4_mb_mark_context() should fix these consistency problems. Signed-off-by: Kemeng Shi Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/20230928160407.142069-6-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit c431d3867e0a8258d1948408eb8297cdd2400e67 Author: Kemeng Shi Date: Fri Sep 29 00:03:59 2023 +0800 ext4: extend ext4_mb_mark_context to support allocation under journal Previously, ext4_mb_mark_context is only called under fast commit replay path, so there is no valid handle when we update block bitmap and group descriptor. This patch try to extend ext4_mb_mark_context to be used by code under journal. There are several improvement: 1. Add "handle_t *handle" to struct ext4_mark_context to journal block bitmap and group descriptor update inside ext4_mb_mark_context (the added journal code is based on ext4_mb_mark_diskspace_used where ext4_mb_mark_context is going to be used.) 2. Adds a flag argument to ext4_mb_mark_context() which controls a. EXT4_MB_BITMAP_MARKED_CHECK - whether block bitmap checking is needed. b. EXT4_MB_SYNC_UPDATE - whether dirty buffers (bitmap and group descriptor) needs sync. Signed-off-by: Kemeng Shi Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/20230928160407.142069-5-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 26d0f87b9fff37f9d4a04aa49f40b0d24502d2b1 Author: Kemeng Shi Date: Fri Sep 29 00:03:58 2023 +0800 ext4: call ext4_mb_mark_context in ext4_free_blocks_simple call ext4_mb_mark_context in ext4_free_blocks_simple to: 1. remove repeat code 2. pair update of free_clusters in ext4_mb_new_blocks_simple. 3. add missing ext4_lock_group/ext4_unlock_group protection. Signed-off-by: Kemeng Shi Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/20230928160407.142069-4-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit f9e2d95a45321857bd0397aa07ae30cc20f0988f Author: Kemeng Shi Date: Fri Sep 29 00:03:57 2023 +0800 ext4: factor out codes to update block bitmap and group descriptor on disk from ext4_mb_mark_bb There are several reasons to add a general function ext4_mb_mark_context to update block bitmap and group descriptor on disk: 1. pair behavior of alloc/free bits. For example, ext4_mb_new_blocks_simple will update free_clusters in struct flex_groups in ext4_mb_mark_bb while ext4_free_blocks_simple forgets this. 2. remove repeat code to read from disk, update and write back to disk. 3. reduce future unit test mocks to catch real IO to update structure on disk. Signed-off-by: Kemeng Shi Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/20230928160407.142069-3-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit d2f7cf40ea89b486fb7a25f5ab9a5d3ce26fb4bb Author: Kemeng Shi Date: Fri Sep 29 00:03:56 2023 +0800 ext4: make state in ext4_mb_mark_bb to be bool As state could only be either 0 or 1, just make it bool. Signed-off-by: Kemeng Shi Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/20230928160407.142069-2-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 61187fce8600e8ef90e601be84f9d0f3222c1206 Author: Zhihao Cheng Date: Tue Sep 19 09:25:25 2023 +0800 jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev JBD2 makes sure journal data is fallen on fs device by sync_blockdev(), however, other process could intercept the EIO information from bdev's mapping, which leads journal recovering successful even EIO occurs during data written back to fs device. We found this problem in our product, iscsi + multipath is chosen for block device of ext4. Unstable network may trigger kpartx to rescan partitions in device mapper layer. Detailed process is shown as following: mount kpartx irq jbd2_journal_recover do_one_pass memcpy(nbh->b_data, obh->b_data) // copy data to fs dev from journal mark_buffer_dirty // mark bh dirty vfs_read generic_file_read_iter // dio filemap_write_and_wait_range __filemap_fdatawrite_range do_writepages block_write_full_folio submit_bh_wbc >> EIO occurs in disk << end_buffer_async_write mark_buffer_write_io_error mapping_set_error set_bit(AS_EIO, &mapping->flags) // set! filemap_check_errors test_and_clear_bit(AS_EIO, &mapping->flags) // clear! err2 = sync_blockdev filemap_write_and_wait filemap_check_errors test_and_clear_bit(AS_EIO, &mapping->flags) // false err2 = 0 Filesystem is mounted successfully even data from journal is failed written into disk, and ext4/ocfs2 could become corrupted. Fix it by comparing the wb_err state in fs block device before recovering and after recovering. A reproducer can be found in the kernel bugzilla referenced below. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217888 Cc: stable@vger.kernel.org Signed-off-by: Zhihao Cheng Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230919012525.1783108-1-chengzhihao1@huawei.com Signed-off-by: Theodore Ts'o commit 484fd6c1de13b336806a967908a927cc0356e312 Author: Max Kellermann Date: Tue Sep 19 10:18:23 2023 +0200 ext4: apply umask if ACL support is disabled The function ext4_init_acl() calls posix_acl_create() which is responsible for applying the umask. But without CONFIG_EXT4_FS_POSIX_ACL, ext4_init_acl() is an empty inline function, and nobody applies the umask. This fixes a bug which causes the umask to be ignored with O_TMPFILE on ext4: https://github.com/MusicPlayerDaemon/MPD/issues/558 https://bugs.gentoo.org/show_bug.cgi?id=686142#c3 https://bugzilla.kernel.org/show_bug.cgi?id=203625 Reviewed-by: "J. Bruce Fields" Cc: stable@vger.kernel.org Signed-off-by: Max Kellermann Link: https://lore.kernel.org/r/20230919081824.1096619-1-max.kellermann@ionos.com Signed-off-by: Theodore Ts'o commit 2cd8bdb5efc1e0d5b11a4b7ba6b922fd2736a87f Author: Ojaswin Mujoo Date: Mon Sep 18 16:15:50 2023 +0530 ext4: mark buffer new if it is unwritten to avoid stale data exposure ** Short Version ** In ext4 with dioread_nolock, we could have a scenario where the bh returned by get_blocks (ext4_get_block_unwritten()) in __block_write_begin_int() has UNWRITTEN and MAPPED flag set. Since such a bh does not have NEW flag set we never zero out the range of bh that is not under write, causing whatever stale data is present in the folio at that time to be written out to disk. To fix this mark the buffer as new, in case it is unwritten, in ext4_get_block_unwritten(). ** Long Version ** The issue mentioned above was resulting in two different bugs: 1. On block size < page size case in ext4, generic/269 was reliably failing with dioread_nolock. The state of the write was as follows: * The write was extending i_size. * The last block of the file was fallocated and had an unwritten extent * We were near ENOSPC and hence we were switching to non-delayed alloc allocation. In this case, the back trace that triggers the bug is as follows: ext4_da_write_begin() /* switch to nodelalloc due to low space */ ext4_write_begin() ext4_should_dioread_nolock() // true since mount flags still have delalloc __block_write_begin(..., ext4_get_block_unwritten) __block_write_begin_int() for(each buffer head in page) { /* first iteration, this is bh1 which contains i_size */ if (!buffer_mapped) get_block() /* returns bh with only UNWRITTEN and MAPPED */ /* second iteration, bh2 */ if (!buffer_mapped) get_block() /* we fail here, could be ENOSPC */ } if (err) /* * this would zero out all new buffers and mark them uptodate. * Since bh1 was never marked new, we skip it here which causes * the bug later. */ folio_zero_new_buffers(); /* ext4_wrte_begin() error handling */ ext4_truncate_failed_write() ext4_truncate() ext4_block_truncate_page() __ext4_block_zero_page_range() if(!buffer_uptodate()) ext4_read_bh_lock() ext4_read_bh() -> ... ext4_submit_bh_wbc() BUG_ON(buffer_unwritten(bh)); /* !!! */ 2. The second issue is stale data exposure with page size >= blocksize with dioread_nolock. The conditions needed for it to happen are same as the previous issue ie dioread_nolock around ENOSPC condition. The issue is also similar where in __block_write_begin_int() when we call ext4_get_block_unwritten() on the buffer_head and the underlying extent is unwritten, we get an unwritten and mapped buffer head. Since it is not new, we never zero out the partial range which is not under write, thus writing stale data to disk. This can be easily observed with the following reproducer: fallocate -l 4k testfile xfs_io -c "pwrite 2k 2k" testfile # hexdump output will have stale data in from byte 0 to 2k in testfile hexdump -C testfile NOTE: To trigger this, we need dioread_nolock enabled and write happening via ext4_write_begin(), which is usually used when we have -o nodealloc. Since dioread_nolock is disabled with nodelalloc, the only alternate way to call ext4_write_begin() is to ensure that delayed alloc switches to nodelalloc ie ext4_da_write_begin() calls ext4_write_begin(). This will usually happen when ext4 is almost full like the way generic/269 was triggering it in Issue 1 above. This might make the issue harder to hit. Hence, for reliable replication, I used the below patch to temporarily allow dioread_nolock with nodelalloc and then mount the disk with -o nodealloc,dioread_nolock. With this you can hit the stale data issue 100% of times: @@ -508,8 +508,8 @@ static inline int ext4_should_dioread_nolock(struct inode *inode) if (ext4_should_journal_data(inode)) return 0; /* temporary fix to prevent generic/422 test failures */ - if (!test_opt(inode->i_sb, DELALLOC)) - return 0; + // if (!test_opt(inode->i_sb, DELALLOC)) + // return 0; return 1; } After applying this patch to mark buffer as NEW, both the above issues are fixed. Signed-off-by: Ojaswin Mujoo Cc: stable@kernel.org Reviewed-by: Jan Kara Reviewed-by: "Ritesh Harjani (IBM)" Link: https://lore.kernel.org/r/d0ed09d70a9733fbb5349c5c7b125caac186ecdf.1695033645.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o commit af90a8f4a09ec4a3de20142e37f37205d4687f28 Author: Gou Hao Date: Wed Sep 6 09:33:41 2023 +0800 ext4: move 'ix' sanity check to corrent position Check 'ix' before it is used. Fixes: 80e675f906db ("ext4: optimize memmmove lengths in extent/index insertions") Signed-off-by: Gou Hao Link: https://lore.kernel.org/r/20230906013341.7199-1-gouhao@uniontech.com Signed-off-by: Theodore Ts'o commit 8b6b562121f1981315e76b6ae1f8a5cbbcf14bd7 Author: Ye Bin Date: Mon Sep 4 18:58:17 2023 +0800 jbd2: fix printk format type for 'io_block' in do_one_pass() 'io_block' is unsinged long but print it by '%ld'. Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230904105817.1728356-3-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit 71cd5a5aa0607073adba3852739b7f8c22bc7b50 Author: Ye Bin Date: Mon Sep 4 18:58:16 2023 +0800 jbd2: print io_block if check data block checksum failed when do recovery Now, if check data block checksum failed only print data's block number then skip write data. However, one data block may in more than one transaction. In some scenarios, offline analysis is inconvenient. As a result, it is difficult to locate the areas where data is faulty. So print 'io_block' if check data block checksum failed. Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230904105817.1728356-2-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit 248b45b621a77155f81129e6b572ec833edb4cf4 Author: Kemeng Shi Date: Sun Aug 27 01:47:12 2023 +0800 ext4: remove unnecessary initialization of count2 in set_flexbg_block_bitmap We always overwrite count2 to "EXT4_CLUSTERS_PER_GROUP(sb) - (first_cluster - start)" after its initialization in for loop initialization statement . Just remove unnecessary initialization of count2. Signed-off-by: Kemeng Shi Reviewed-by: Theodore Ts'o Link: https://lore.kernel.org/r/20230826174712.4059355-14-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 350bb48b84b8f4ad4ea179dbb97f568d12626188 Author: Kemeng Shi Date: Sun Aug 27 01:47:11 2023 +0800 ext4: remove unnecessary check to avoid repeat update_backups for the same gdb The sbi->s_group_desc contains array of bh's for block group descriptors and continuous EXT4_DESC_PER_BLOCK(sb) bg descriptors in single block share the same bh. Simply call update_backups for each gdb_bh in sbi->s_group_desc will not update same group descriptors block for multiple times. Commit 0acdb8876fead ("ext4: don't call update_backups() multiple times for the same bg") wrongly assumed each block group descriptor in the same block has a individual bh and unnecessary check was added. Signed-off-by: Kemeng Shi Link: https://lore.kernel.org/r/20230826174712.4059355-13-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 9dca529bdaad7a7242a36d04f73cb998b817ab48 Author: Kemeng Shi Date: Sun Aug 27 01:47:10 2023 +0800 ext4: simplify the gdbblock calculation in add_new_gdb_meta_bg We always call add_new_gdb_meta_bg with first group in mete_bg. Remove the unnecessary ext4_meta_bg_first_group conversion to simplify the gdbblock calculation. Signed-off-by: Kemeng Shi Link: https://lore.kernel.org/r/20230826174712.4059355-12-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 70cbfd257995b3f23c2408fd893cc18b61e58b4a Author: Kemeng Shi Date: Sun Aug 27 01:47:09 2023 +0800 ext4: use saved local variable sbi instead of EXT4_SB(sb) We save EXT4_SB(sb) to local variable sbi at beginning of function ext4_resize_begin. Use sbi directly instead of EXT4_SB(sb) to remove unnecessary pointer dereference. Signed-off-by: Kemeng Shi Reviewed-by: Theodore Ts'o Link: https://lore.kernel.org/r/20230826174712.4059355-11-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 95b635689b58e0ebe5197bf99c82c681eabe17ee Author: Kemeng Shi Date: Sun Aug 27 01:47:08 2023 +0800 ext4: remove EXT4FS_DEBUG defination in resize.c Remove EXT4FS_DEBUG defination in resize.c for following reasons: 1. EXT4FS_DEBUG will enable debug messages, it should only be defined when debugging. 2. ext4.h included from ext4_jbd2.h after EXT4FS_DEBUG defination will "#undef EXT4FS_DEBUG", then EXT4FS_DEBUG defination in resize.c can't actually turn on ext4_debug messages. Signed-off-by: Kemeng Shi Reviewed-by: Theodore Ts'o Link: https://lore.kernel.org/r/20230826174712.4059355-10-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 1fc1bd2d18bbade157f7b14270f509ebbd89881b Author: Kemeng Shi Date: Sun Aug 27 01:47:07 2023 +0800 ext4: calculate free_clusters_count in cluster unit in verify_group_input The field free_cluster_count in struct ext4_new_group_data should be in units of clusters. In verify_group_input() this field is being filled in units of blocks. Fortunately, we don't support online resizing of bigalloc file systems, and for non-bigalloc file systems, the cluster size == block size. But fix this in case we do support online resizing of bigalloc file systems in the future. Signed-off-by: Kemeng Shi Reviewed-by: Theodore Ts'o Link: https://lore.kernel.org/r/20230826174712.4059355-9-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 31458077273b5f883d99bee33a7fb295f155712d Author: Kemeng Shi Date: Sun Aug 27 01:47:06 2023 +0800 ext4: remove commented code in reserve_backup_gdb Remove commented code in reserve_backup_gdb Signed-off-by: Kemeng Shi Reviewed-by: Theodore Ts'o Link: https://lore.kernel.org/r/20230826174712.4059355-8-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 7d4cd3b45af025befe3bca94f87359a6603b6e95 Author: Kemeng Shi Date: Sun Aug 27 01:47:05 2023 +0800 ext4: remove redundant check of count Remove zero check of count which is always non-zero. Signed-off-by: Kemeng Shi Reviewed-by: Theodore Ts'o Link: https://lore.kernel.org/r/20230826174712.4059355-7-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit e44fc921b84ff08a9e2fb827a146fa4021d016f3 Author: Kemeng Shi Date: Sun Aug 27 01:47:04 2023 +0800 ext4: fix typo in setup_new_flex_group_blocks grop -> group Signed-off-by: Kemeng Shi Reviewed-by: Theodore Ts'o Link: https://lore.kernel.org/r/20230826174712.4059355-6-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o commit 40dd7953f4d606c280074f10d23046b6812708ce Author: Kemeng Shi Date: Sun Aug 27 01:47:03 2023 +0800 ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks Wrong check of gdb backup in meta bg as following: first_group is the first group of meta_bg which contains target group, so target group is always >= first_group. We check if target group has gdb backup by comparing first_group with [group + 1] and [group + EXT4_DESC_PER_BLOCK(sb) - 1]. As group >= first_group, then [group + N] is > first_group. So no copy of gdb backup in meta bg is done in setup_new_flex_group_blocks. No need to do gdb backup copy in meta bg from setup_new_flex_group_blocks as we always copy updated gdb block to backups at end of ext4_flex_group_add as following: ext4_flex_group_add /* no gdb backup copy for meta bg any more */ setup_new_flex_group_blocks /* update current group number */ ext4_update_super sbi->s_groups_count += flex_gd->count; /* * if group in meta bg contains backup is added, the primary gdb block * of the meta bg will be copy to backup in new added group here. */ for (; gdb_num <= gdb_num_end; gdb_num++) update_backups(...) In summary, we can remove wrong gdb backup copy code in setup_new_flex_group_blocks. Signed-off-by: Kemeng Shi Reviewed-by: Theodore Ts'o Link: https://lore.kernel.org/r/20230826174712.4059355-5-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 48f1551592c54f7d8e2befc72a99ff4e47f7dca0 Author: Kemeng Shi Date: Sun Aug 27 01:47:02 2023 +0800 ext4: correct return value of ext4_convert_meta_bg Avoid to ignore error in "err". Signed-off-by: Kemeng Shi Link: https://lore.kernel.org/r/20230826174712.4059355-4-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 9adac8b01f4be28acd5838aade42b8daa4f0b642 Author: Kemeng Shi Date: Sun Aug 27 01:47:01 2023 +0800 ext4: add missed brelse in update_backups add missed brelse in update_backups Signed-off-by: Kemeng Shi Reviewed-by: Theodore Ts'o Link: https://lore.kernel.org/r/20230826174712.4059355-3-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 31f13421c004a420c0e9d288859c9ea9259ea0cc Author: Kemeng Shi Date: Sun Aug 27 01:47:00 2023 +0800 ext4: correct offset of gdb backup in non meta_bg group to update_backups Commit 0aeaa2559d6d5 ("ext4: fix corruption when online resizing a 1K bigalloc fs") found that primary superblock's offset in its group is not equal to offset of backup superblock in its group when block size is 1K and bigalloc is enabled. As group descriptor blocks are right after superblock, we can't pass block number of gdb to update_backups for the same reason. The root casue of the issue above is that leading 1K padding block is count as data block offset for primary block while backup block has no padding block offset in its group. Remove padding data block count to fix the issue for gdb backups. For meta_bg case, update_backups treat blk_off as block number, do no conversion in this case. Signed-off-by: Kemeng Shi Reviewed-by: Theodore Ts'o Link: https://lore.kernel.org/r/20230826174712.4059355-2-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit ebf6cb7c6e1241984f75f29f1bdbfa2fe7168f88 Author: Wang Jianjian Date: Thu Aug 24 23:56:31 2023 +0800 ext4: no need to generate from free list in mballoc Commit 7a2fcbf7f85 ("ext4: don't use blocks freed but not yet committed in buddy cache init") added a code to mark as used blocks in the list of not yet committed freed blocks during initialization of a buddy page. However ext4_mb_free_metadata() makes sure buddy page is already loaded and takes a reference to it so it cannot happen that ext4_mb_init_cache() is called when efd list is non-empty. Just remove the ext4_mb_generate_from_freelist() call. Fixes: 7a2fcbf7f85('ext4: don't use blocks freed but not yet committed in buddy cache init') Signed-off-by: Wang Jianjian Link: https://lore.kernel.org/r/tencent_53CBCB1668358AE862684E453DF37B722008@qq.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 8fedebb5ea183994aca39af3f80623f5db42fff7 Author: Wang Jianjian Date: Thu Aug 24 23:23:24 2023 +0800 ext4: fix incorrect offset The last argument of ext4_check_dir_entry is dentry offset int the file. Luckily this error only results in the wrong offset being printed in the eventual error message. Signed-off-by: Wang Jianjian Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/tencent_F992989953734FD5DE3F88ECB2191A856206@qq.com Signed-off-by: Theodore Ts'o commit 8e387c89e96b9543a339f84043cf9df15fed2632 Author: Zhang Yi Date: Thu Aug 24 17:26:05 2023 +0800 ext4: make sure allocate pending entry not fail __insert_pending() allocate memory in atomic context, so the allocation could fail, but we are not handling that failure now. It could lead ext4_es_remove_extent() to get wrong reserved clusters, and the global data blocks reservation count will be incorrect. The same to extents_status entry preallocation, preallocate pending entry out of the i_es_lock with __GFP_NOFAIL, make sure __insert_pending() and __revise_pending() always succeeds. Signed-off-by: Zhang Yi Cc: stable@kernel.org Link: https://lore.kernel.org/r/20230824092619.1327976-3-yi.zhang@huaweicloud.com Reviewed-by: Jan Kara Signed-off-by: Theodore Ts'o commit 40ea98396a3659062267d1fe5f99af4f7e4f05e3 Author: Zhang Yi Date: Thu Aug 24 17:26:04 2023 +0800 ext4: correct the start block of counting reserved clusters When big allocate feature is enabled, we need to count and update reserved clusters before removing a delayed only extent_status entry. {init|count|get}_rsvd() have already done this, but the start block number of this counting isn't correct in the following case. lblk end | | v v ------------------------- | | orig_es ------------------------- ^ ^ len1 is 0 | len2 | If the start block of the orig_es entry founded is bigger than lblk, we passed lblk as start block to count_rsvd(), but the length is correct, finally, the range to be counted is offset. This patch fix this by passing the start blocks to 'orig_es->lblk + len1'. Signed-off-by: Zhang Yi Cc: stable@kernel.org Link: https://lore.kernel.org/r/20230824092619.1327976-2-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o Reviewed-by: Jan Kara commit a1e932cefac987b5e4a7ddde37c99e3d2e6fe73e Author: Stanley Chang Date: Mon Sep 4 13:12:48 2023 +0800 dt-bindings: usb: Add Realtek DHC RTD SoC Type-C Document the device-tree bindings for Realtek SoCs Type-C. Realtek DHC (digital home center) RTD SoCs support a Type-C module. Link: https://lore.kernel.org/lkml/20230904051253.23208-2-stanley_chang@realtek.com/ Signed-off-by: Stanley Chang Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanwoo Choi commit 8a590d7371f02ba37d073bed9f988f529f95a03c Author: Stanley Chang Date: Mon Sep 4 13:12:47 2023 +0800 extcon: add Realtek DHC RTD SoC Type-C driver This patch adds the extcon driver for Realtek DHC (digital home center) RTD SoCs type-c module. This can be used to detect whether the port is configured as a downstream or upstream facing port. And notify the status of extcon to listeners. Link: https://lore.kernel.org/lkml/20230904051253.23208-2-stanley_chang@realtek.com/ Signed-off-by: Stanley Chang Signed-off-by: Chanwoo Choi commit ce774e5365e46be73ed055302c6de123a03394ea Author: Jinke Han Date: Mon Jun 12 20:40:17 2023 +0800 ext4: make running and commit transaction have their own freed_data_list When releasing space in jbd, we traverse s_freed_data_list to get the free range belonging to the current commit transaction. In extreme cases, the time spent may not be small, and we have observed cases exceeding 10ms. This patch makes running and commit transactions manage their own free_data_list respectively, eliminating unnecessary traversal. And in the callback phase of the commit transaction, no one will touch it except the jbd thread itself, so s_md_lock is no longer needed. Signed-off-by: Jinke Han Reviewed-by: Zhang Yi Link: https://lore.kernel.org/r/20230612124017.14115-1-hanjinke.666@bytedance.com Signed-off-by: Theodore Ts'o commit a8c1eb77edfc92a64788dad70fedf9277cbafe76 Author: Lu Hongfei Date: Mon May 29 15:09:30 2023 +0800 ext4: fix traditional comparison using max/min method It would be better to replace the traditional ternary conditional operator with max()/min() Signed-off-by: Lu Hongfei Reviewed-by: Kemeng Shi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230529070930.37949-1-luhongfei@vivo.com Signed-off-by: Theodore Ts'o commit 745f17a4166e79315e4b7f33ce89d03e75a76983 Author: Baokun Li Date: Wed May 24 15:25:38 2023 +0800 ext4: fix race between writepages and remount We got a WARNING in ext4_add_complete_io: ================================================================== WARNING: at fs/ext4/page-io.c:231 ext4_put_io_end_defer+0x182/0x250 CPU: 10 PID: 77 Comm: ksoftirqd/10 Tainted: 6.3.0-rc2 #85 RIP: 0010:ext4_put_io_end_defer+0x182/0x250 [ext4] [...] Call Trace: ext4_end_bio+0xa8/0x240 [ext4] bio_endio+0x195/0x310 blk_update_request+0x184/0x770 scsi_end_request+0x2f/0x240 scsi_io_completion+0x75/0x450 scsi_finish_command+0xef/0x160 scsi_complete+0xa3/0x180 blk_complete_reqs+0x60/0x80 blk_done_softirq+0x25/0x40 __do_softirq+0x119/0x4c8 run_ksoftirqd+0x42/0x70 smpboot_thread_fn+0x136/0x3c0 kthread+0x140/0x1a0 ret_from_fork+0x2c/0x50 ================================================================== Above issue may happen as follows: cpu1 cpu2 ----------------------------|---------------------------- mount -o dioread_lock ext4_writepages ext4_do_writepages *if (ext4_should_dioread_nolock(inode))* // rsv_blocks is not assigned here mount -o remount,dioread_nolock ext4_journal_start_with_reserve __ext4_journal_start __ext4_journal_start_sb jbd2__journal_start *if (rsv_blocks)* // h_rsv_handle is not initialized here mpage_map_and_submit_extent mpage_map_one_extent dioread_nolock = ext4_should_dioread_nolock(inode) if (dioread_nolock && (map->m_flags & EXT4_MAP_UNWRITTEN)) mpd->io_submit.io_end->handle = handle->h_rsv_handle ext4_set_io_unwritten_flag io_end->flag |= EXT4_IO_END_UNWRITTEN // now io_end->handle is NULL but has EXT4_IO_END_UNWRITTEN flag scsi_finish_command scsi_io_completion scsi_io_completion_action scsi_end_request blk_update_request req_bio_endio bio_endio bio->bi_end_io > ext4_end_bio ext4_put_io_end_defer ext4_add_complete_io // trigger WARN_ON(!io_end->handle && sbi->s_journal); The immediate cause of this problem is that ext4_should_dioread_nolock() function returns inconsistent values in the ext4_do_writepages() and mpage_map_one_extent(). There are four conditions in this function that can be changed at mount time to cause this problem. These four conditions can be divided into two categories: (1) journal_data and EXT4_EXTENTS_FL, which can be changed by ioctl (2) DELALLOC and DIOREAD_NOLOCK, which can be changed by remount The two in the first category have been fixed by commit c8585c6fcaf2 ("ext4: fix races between changing inode journal mode and ext4_writepages") and commit cb85f4d23f79 ("ext4: fix race between writepages and enabling EXT4_EXTENTS_FL") respectively. Two cases in the other category have not yet been fixed, and the above issue is caused by this situation. We refer to the fix for the first category, when applying options during remount, we grab s_writepages_rwsem to avoid racing with writepages ops to trigger this problem. Fixes: 6b523df4fb5a ("ext4: use transaction reservation for extent conversion in ext4_end_io") Cc: stable@vger.kernel.org Signed-off-by: Baokun Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20230524072538.2883391-1-libaokun1@huawei.com Signed-off-by: Theodore Ts'o commit ee6a12d0d4d85f3833d177cd382cd417f0ef011b Author: Theodore Ts'o Date: Thu Oct 5 21:42:47 2023 -0400 ext4: add missing initialization of call_notify_error in update_super_work() Fixes: ff0722de896e ("ext4: add periodic superblock update check") Signed-off-by: Theodore Ts'o commit 4514aa9f56fd7acf9e4f247bd38c0642e55109f7 Author: Kees Cook Date: Tue Oct 3 16:18:43 2023 -0700 nfp: Annotate struct nfp_reprs with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct nfp_reprs. Cc: Simon Horman Cc: oss-drivers@corigine.com Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Acked-by: Louis Peens Link: https://lore.kernel.org/r/20231003231843.work.811-kees@kernel.org Signed-off-by: Jakub Kicinski commit 0fef0907d6faaab280d052e385d0da876182a1d2 Author: Kees Cook Date: Tue Oct 3 16:18:23 2023 -0700 netem: Annotate struct disttable with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct disttable. Cc: Jamal Hadi Salim Cc: Cong Wang Cc: Jiri Pirko Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Stephen Hemminger Link: https://lore.kernel.org/r/20231003231823.work.684-kees@kernel.org Signed-off-by: Jakub Kicinski commit 3e584e32b19d4c8d4591dc720277e2001d135ee1 Author: Kees Cook Date: Tue Oct 3 16:18:18 2023 -0700 nexthop: Annotate struct nh_notifier_res_table_info with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct nh_notifier_res_table_info. Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Cc: llvm@lists.linux.dev Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20231003231818.work.883-kees@kernel.org Signed-off-by: Jakub Kicinski commit 2253bb3ff242af3b1a53cb98e2e4eb1eec82dd2a Author: Kees Cook Date: Tue Oct 3 16:18:13 2023 -0700 nexthop: Annotate struct nh_res_table with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct nh_res_table. Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20231003231813.work.042-kees@kernel.org Signed-off-by: Jakub Kicinski commit b374d522985ca1a1edb0f165b64974e045e8c490 Merge: 98bdeae9502b9 5ffe330e40bdf Author: Jakub Kicinski Date: Thu Oct 5 18:05:07 2023 -0700 Merge branch 'rework-tx-fault-fixups' Russell King says: ==================== Rework tx fault fixups This series reworks the tx-fault fixup and then improves the Nokia GPON workaround to also ignore the RX LOS signal as well. We do this by introducing a mask of hardware pin states that should be ignored, converting the tx-fault fixup to use that, and then augmenting it for RX LOS. ==================== Link: https://lore.kernel.org/r/ZRwYJXRizvkhm83M@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 5ffe330e40bdfad9c49a615c54d2d89343b2f08a Author: Russell King (Oracle) Date: Tue Oct 3 14:34:29 2023 +0100 net: sfp: improve Nokia GPON sfp fixup Improve the Nokia GPON fixup - we need to ignore not only the hardware LOS signal, but also the software implementation as well. Do this by using the new state_ignore_mask to indicate that we should ignore not only the hardware RX_LOS signal, and also clear the LOS bits in the option field. Signed-off-by: Russell King (Oracle) Tested-by: Christian Marangi Link: https://lore.kernel.org/r/E1qnfXh-008UDe-F9@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit e184e8609f8c1cd9fef703f667245b6ebd89c2ed Author: Russell King (Oracle) Date: Tue Oct 3 14:34:24 2023 +0100 net: sfp: re-implement ignoring the hardware TX_FAULT signal Re-implement how we ignore the hardware TX_FAULT signal. Rather than having a separate boolean for this, use a bitmask of the hardware signals that we wish to ignore. This gives more flexibility in the future to ignore other signals such as RX_LOS. Signed-off-by: Russell King (Oracle) Tested-by: Christian Marangi Link: https://lore.kernel.org/r/E1qnfXc-008UDY-91@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit f404a58dcf0c862b05602f641ce5fdd8b98fbc3a Author: Aaron Plattner Date: Wed Oct 4 17:08:19 2023 -0700 objtool: Remove max symbol name length limitation If one of the symbols processed by read_symbols() happens to have a .cold variant with a name longer than objtool's MAX_NAME_LEN limit, the build fails. Avoid this problem by just using strndup() to copy the parent function's name, rather than strncpy()ing it onto the stack. Signed-off-by: Aaron Plattner Link: https://lore.kernel.org/r/41e94cfea1d9131b758dd637fecdeacd459d4584.1696355111.git.aplattner@nvidia.com Signed-off-by: Josh Poimboeuf commit e959c279d391c10b35ce300fb4b0fe3b98e86bd2 Author: Aaron Plattner Date: Wed Oct 4 17:08:18 2023 -0700 objtool: Propagate early errors If objtool runs into a problem that causes it to exit early, the overall tool still returns a status code of 0, which causes the build to continue as if nothing went wrong. Note this only affects early errors, as later errors are still ignored by check(). Fixes: b51277eb9775 ("objtool: Ditch subcommands") Signed-off-by: Aaron Plattner Link: https://lore.kernel.org/r/cb6a28832d24b2ebfafd26da9abb95f874c83045.1696355111.git.aplattner@nvidia.com Signed-off-by: Josh Poimboeuf commit 98bdeae9502b90822a9666efac76373bfa9c2ad1 Author: Wolfram Sang Date: Fri Sep 22 08:15:26 2023 +0200 net: cpmac: remove driver to prepare for platform removal AR7 is going to be removed from the Kernel, so remove its networking support in form of the cpmac driver. This allows us to remove the platform because this driver includes a platform specific header. Signed-off-by: Wolfram Sang Acked-by: Florian Fainelli Link: https://lore.kernel.org/all/20230922061530.3121-6-wsa+renesas@sang-engineering.com/ Signed-off-by: Jakub Kicinski commit 06eaa531f2dd1a4d5137a1b49e7c762cc3689b14 Author: Bartosz Golaszewski Date: Mon Sep 11 11:44:43 2023 +0200 hte: tegra194: improve the GPIO-related comment Using any of the GPIO interfaces using the global numberspace is deprecated. Make it clear in the comment. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij Reviewed-by: Dipen Patel Signed-off-by: Dipen Patel commit 63a0b7dc15376c495dbbeadf55bf887412a7f877 Author: Ruan Jinjie Date: Thu Aug 17 15:09:31 2023 +0800 PCI: endpoint: Use IS_ERR_OR_NULL() helper function Use the IS_ERR_OR_NULL() helper instead of open-coding a NULL and an error pointer checks to simplify the code and improve readability. No functional changes are intended. [kwilczynski: commit log] Signed-off-by: Ruan Jinjie Signed-off-by: Krzysztof Wilczyński Signed-off-by: Bjorn Helgaas Reviewed-by: Manivannan Sadhasivam commit c8e7df374ba2ce715ed7f3ceba34efdbfffcb0a9 Author: Kees Cook Date: Tue Oct 3 16:29:52 2023 -0700 drm/amdgpu: Annotate struct amdgpu_bo_list with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct amdgpu_bo_list. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: "Gustavo A. R. Silva" Cc: Luben Tuikov Cc: Christophe JAILLET Cc: Felix Kuehling Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: linux-hardening@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Reviewed-by: Luben Tuikov Reviewed-by: Christian König Signed-off-by: Kees Cook Signed-off-by: Alex Deucher commit e0a3e7bf62dfbf6a1730f244b2adf53fac07003b Author: Srinivasan Shanmugam Date: Sat Sep 30 08:11:31 2023 +0530 drm/amdgpu: Drop unnecessary return statements There is no reason to call return at the end of function that returns void. Fixes the below: WARNING: void function return statements are not generally useful Thus remove such a statement in the affected functions. Cc: Christian König Cc: Alex Deucher Cc: "Pan, Xinhui" Signed-off-by: Srinivasan Shanmugam Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 4798db85b76a0e2bebe8bb51251c2688b1e8ab93 Author: Lijo Lazar Date: Thu Sep 28 09:04:11 2023 +0530 Documentation/amdgpu: Add board info details Add documentation for board info sysfs attribute. Signed-off-by: Lijo Lazar Reviewed-by: Alex Deucher Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 76da73f0266cd0141bd60e4c21bbbdff2abafe63 Author: Lijo Lazar Date: Thu Sep 28 08:56:20 2023 +0530 drm/amdgpu: Add sysfs attribute to get board info Add a sysfs attribute which shows the board form factor like OAM or CEM. Signed-off-by: Lijo Lazar Reviewed-by: Alex Deucher Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b0a4553336aa3cbef2680fd1812fb48c1d0d02f1 Author: Lijo Lazar Date: Thu Sep 28 08:51:06 2023 +0530 drm/amdgpu: Get package types for smuio v13.0 Add support to query package types supported in smuio v13.0 ASICs. Signed-off-by: Lijo Lazar Reviewed-by: Alex Deucher Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 4365d2ed09db752b32137b8cc830efb8bb0eac0f Author: Lijo Lazar Date: Thu Sep 28 08:45:26 2023 +0530 drm/amdgpu: Add more smuio v13.0.3 package types Expand support to get other board types like OAM or CEM. Signed-off-by: Lijo Lazar Reviewed-by: Alex Deucher Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit cbad0dd13ac9976a66f197a8f8d00f7bd534bc1a Author: Sathishkumar S Date: Wed Sep 20 20:19:44 2023 +0530 drm/amdgpu: fix ip count query for xcp partitions fix wrong ip count INFO on spatial partitions. update the query to return the instance count corresponding to the partition id. v2: initialize variables only when required to be (Christian) move variable declarations to the beginning of function (Christian) Signed-off-by: Sathishkumar S Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit c207c36544ee71cbcf8672c85d7b898e1f22379c Author: Asad Kamal Date: Thu Sep 28 23:51:11 2023 +0800 drm/amd/pm: Remove set df cstate for SMUv13.0.6 Remove set df cstate as disallow df state is not required for SMUv13.0.6 Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 28a3f4960948630630f2255726e114f785dc87ce Author: Lijo Lazar Date: Wed Sep 27 12:17:32 2023 +0530 drm/amdgpu: Move package type enum to amdgpu_smuio Move definition of package type to amdgpu_smuio header and add new package types for CEM and OAM. Signed-off-by: Lijo Lazar Reviewed-by: Alex Deucher Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 2b6b29f33fddc8d61527d5f5cf1dec9e1821b16c Author: Srinivasan Shanmugam Date: Sat Sep 30 11:55:11 2023 +0530 drm/amdgpu: Fix complex macros error Fixes the below: ERROR: Macros with complex values should be enclosed in parentheses WARNING: macros should not use a trailing semicolon +#define amdgpu_inc_vram_lost(adev) atomic_inc(&((adev)->vram_lost_counter)); Cc: Christian König Cc: Alex Deucher Cc: "Pan, Xinhui" Signed-off-by: Srinivasan Shanmugam Reviewed-by: Christian König Signed-off-by: Alex Deucher commit dc427a473e5d119232ddb27530920d9796cdea70 Author: Xiaogang Chen Date: Wed Oct 4 16:20:58 2023 -0500 drm/amdkfd: Use partial migrations in GPU page faults This patch implements partial migration in gpu page fault according to migration granularity(default 2MB) and not split svm range in cpu page fault handling. A svm range may include pages from both system ram and vram of one gpu now. These chagnes are expected to improve migration performance and reduce mmu callback and TLB flush workloads. Signed-off-by: Xiaogang Chen Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit de5e73dc6baf4a2969493a2f16aed3fe222eb363 Author: Sebastian Andrzej Siewior Date: Thu Sep 21 16:15:13 2023 +0200 drm/amd/display: Simplify the per-CPU usage. The fpu_recursion_depth counter is used to ensure that dc_fpu_begin() can be invoked multiple times while the FPU-disable function itself is only invoked once. Also the counter part (dc_fpu_end()) is ballanced properly. Instead of using the get_cpu_ptr() dance around the inc it is simpler to increment the per-CPU variable directly. Also the per-CPU variable has to be incremented and decremented on the same CPU. This is ensured by the inner-part which disables preemption. This is kind of not obvious, works and the preempt-counter is touched a few times for no reason. Disable preemption before incrementing fpu_recursion_depth for the first time. Keep preemption disabled until dc_fpu_end() where the counter is decremented making it obvious that the preemption has to stay disabled while the counter is non-zero. Use simple inc/dec functions. Remove the nested preempt_disable/enable functions which are now not needed. Acked-by: Harry Wentland Reviewed-by: Rodrigo Siqueira Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 9c77dcf6a5b179a9574b2f9633c6e2cdf52fafec Author: Sebastian Andrzej Siewior Date: Thu Sep 21 16:15:12 2023 +0200 drm/amd/display: Remove migrate_en/dis from dc_fpu_begin(). This is a revert of the commit mentioned below while it is not wrong, as in the kernel will explode, having migrate_disable() here it is complete waste of resources. Additionally commit message is plain wrong the review tag does not make it any better. The migrate_disable() interface has a fat comment describing it and it includes the word "undesired" in the headline which should tickle people to read it before using it. Initially I assumed it is worded too harsh but now I beg to differ. The reviewer of the original commit, even not understanding what migrate_disable() does should ask the following: - migrate_disable() is added only to the CONFIG_X86 block and it claims to protect fpu_recursion_depth. Why are the other the architectures excluded? - migrate_disable() is added after fpu_recursion_depth was modified. Shouldn't it be added before the modification or referencing takes place? Moving on. Disabling preemption DOES prevent CPU migration. A task, that can not be pushed away from the CPU by the scheduler (due to disabled preemption) can not be pushed or migrated to another CPU. Disabling migration DOES NOT ensure consistency of per-CPU variables. It only ensures that the task acts always on the same per-CPU variable. The task remains preemptible meaning multiple tasks can access the same per-CPU variable. This in turn leads to inconsistency for the statement *pcpu -= 1; with two tasks on one CPU and a preemption point during the RMW operation: Task A Task B read pcpu to reg # 0 inc reg # 0 -> 1 read pcpu to reg # 0 inc reg # 0 -> 1 write reg to pcpu # 1 write reg to pcpu # 1 At the end pcpu reads 1 but should read 2 instead. Boom. get_cpu_ptr() already contains a preempt_disable() statement. That means that the per-CPU variable can only be referenced by a single task which is currently running. The only inconsistency that can occur if the variable is additionally accessed from an interrupt. Remove migrate_disable/enable() from dc_fpu_begin/end(). Cc: Tianci Yin Cc: Aurabindo Pillai Fixes: 0c316556d124 ("drm/amd/display: Disable migration to ensure consistency of per-CPU variable") Acked-by: Harry Wentland Reviewed-by: Rodrigo Siqueira Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 0029e4d46b8958c2b2cd249f9fd820954713463e Author: Randy Dunlap Date: Sun Oct 1 18:08:33 2023 -0700 drm/amdgpu: amdgpu_drm.h: fix comment typos Correct typos of "occurred". Signed-off-by: Randy Dunlap Cc: Alex Deucher Cc: Christian König Cc: "Pan, Xinhui" Cc: amd-gfx@lists.freedesktop.org Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 7d3f1d76f33dbeca5ffb2cb424f1e3b7e34c8d45 Author: Alex Deucher Date: Wed Jul 26 17:09:40 2023 -0400 drm/amdgpu: refine fault cache updates Don't update the fault cache if status is 0. In the multiple fault case, subsequent faults will return a 0 status which is useless for userspace and replaces the useful fault status, so only update if status is non-0. Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 7a41ed8b59ba74ae36adc7f4688feff9e710cf76 Author: Alex Deucher Date: Tue Oct 6 16:54:35 2020 -0400 drm/amdgpu: add new INFO ioctl query for the last GPU page fault Add a interface to query the last GPU page fault for the process. Useful for debugging context lost errors. v2: split vmhub representation between kernel and userspace v3: add locking when fetching fault info in INFO IOCTL Mesa MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238 libdrm MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23238 Cc: samuel.pitoiset@gmail.com Reviewed-by: Christian König Acked-by: Guchun Chen Signed-off-by: Alex Deucher commit 0a6fa8f03e1497d3d1bf2e55f1e5b082dda227d4 Author: Mark Brown Date: Wed Sep 27 12:18:59 2023 +0200 selftests: timers: Convert nsleep-lat test to generate KTAP output Currently the nsleep-lat test does not produce KTAP output but rather a custom format. This means that we only get a pass/fail for the suite, not for each individual test that the suite does. Convert to using the standard kselftest output functions which result in KTAP output being generated. Signed-off-by: Mark Brown Signed-off-by: Shuah Khan commit 071af0c9e582bc47e379e39490a2bc1adfe4ec68 Author: Mark Brown Date: Wed Sep 27 12:18:58 2023 +0200 selftests: timers: Convert posix_timers test to generate KTAP output Currently the posix_timers test does not produce KTAP output but rather a custom format. This means that we only get a pass/fail for the suite, not for each individual test that the suite does. Convert to using the standard kselftest output functions which result in KTAP output being generated. As part of this fix the printing of diagnostics in the unlikely event that the pthread APIs fail, these were using perror() but the API functions directly return an error code instead of setting errno. Signed-off-by: Mark Brown Signed-off-by: Shuah Khan commit 47903c1d153d5178d54ea086e2bfa5298506f04f Author: Mark Brown Date: Thu Sep 28 16:38:12 2023 +0200 selftests/exec: Convert execveat test to generate KTAP output Currently the execveat test does not produce KTAP output but rather a custom format. This means that we only get a pass/fail for the suite, not for each individual test that the suite does. Convert to using the standard kselftest output functions which result in KTAP output being generated. The main trick with this is that, being an exec() related test, the program executes itself and returns specific exit codes to verify success meaning that we need to only use the top level kselftest header/summary functions when invoked directly rather than when run as part of a test. Signed-off-by: Mark Brown Reviewed-by: Kees Cook Signed-off-by: Shuah Khan commit 907f33028871fa7c9a3db1efd467b78ef82cce20 Author: Mark Brown Date: Thu Sep 28 16:38:11 2023 +0200 kselftest: Add a ksft_perror() helper The standard library perror() function provides a convenient way to print an error message based on the current errno but this doesn't play nicely with KTAP output. Provide a helper which does an equivalent thing in a KTAP compatible format. nolibc doesn't have a strerror() and adding the table of strings required doesn't seem like a good fit for what it's trying to do so when we're using that only print the errno. Signed-off-by: Mark Brown Reviewed-by: Kees Cook Signed-off-by: Shuah Khan commit 1c71a121c7ff41bf6605b2604408d109eab047ae Author: Javier Carrasco Date: Sun Oct 1 15:18:09 2023 +0200 selftests: static_keys: fix test name in messages As a general rule, the name of the selftest is printed at the beginning of every message. Use "static_keys" (name of the test itself) consistently instead of mixing "static_key" and "static_keys" at the beginning of the messages in the test_static_keys script. Signed-off-by: Javier Carrasco Signed-off-by: Shuah Khan commit 5b45a753776be5d21cf395ec97e81c9187fbeaca Author: Javier Carrasco Date: Sun Oct 1 10:37:44 2023 +0200 selftests: uevent filtering: fix return on error in uevent_listener The ret variable is used to check function return values and assigning values to it on error has no effect as it is an unused value. The current implementation uses an additional variable (fret) to return the error value, which in this case is unnecessary and lead to the above described misuse. There is no restriction in the current implementation to always return -1 on error and the actual negative error value can be returned safely without storing -1 in a specific variable. Simplify the error checking by using a single variable which always holds the returned value. Signed-off-by: Javier Carrasco Signed-off-by: Shuah Khan commit 37013b557b7f39e603b4459ef82dc8b848f98a67 Author: Björn Töpel Date: Wed Oct 4 14:48:37 2023 +0200 kbuild: Merge per-arch config for kselftest-merge target Some kselftests has a per-arch config, e.g. tools/testing/selftests/bpf/config.s390x. Make sure these configs are picked up by the kselftest-merge target. Signed-off-by: Björn Töpel Signed-off-by: Shuah Khan commit 6d3d638d1865a6e34787c6e20eee1c6d8d32fd40 Author: Björn Töpel Date: Wed Oct 4 14:48:36 2023 +0200 kbuild: Let builtin have precedence over modules for kselftest-merge The kselftest-merge target walks all kselftests configs, and merges them. However, builtin does not have precedence over modules. This breaks some of the tests, e.g.: $ grep CONFIG_NF_NAT tools/testing/selftests/{bpf,net}/config tools/testing/selftests/bpf/config:CONFIG_NF_NAT=y tools/testing/selftests/net/config:CONFIG_NF_NAT=m Here, the net config will set NF_NAT to module, which makes it clunky to run the BPF tests. Add '-y' to scripts/kconfig/merge_config.sh. Signed-off-by: Björn Töpel Signed-off-by: Shuah Khan commit 876d7fcd1f4c7475b79fc3b923058f5ac7524646 Author: Javier Carrasco Date: Wed Oct 4 15:47:43 2023 +0200 selftests/dmabuf-heaps: add gitignore file dmabuf-heaps builds a dmabuf-heap binary that can be ignored by git. Signed-off-by: Javier Carrasco Signed-off-by: Shuah Khan commit 7359da1cc2fe10e18d4f9ddcc0786ac89e5a6170 Author: Javier Carrasco Date: Wed Oct 4 15:47:42 2023 +0200 selftests/tdx: add gitignore file tdx builds a tdx_guest_test binary that can be ignored by git. Signed-off-by: Javier Carrasco Signed-off-by: Shuah Khan commit 1da3f00e5e0c615819448e259b6d0dd012359b52 Author: Javier Carrasco Date: Wed Oct 4 15:47:41 2023 +0200 selftests/user_events: add gitignore file user_events builds a series of binaries that can be ignored by git. Signed-off-by: Javier Carrasco Signed-off-by: Shuah Khan commit 2606cf059c56bfb86d5d6bd0f41bd7eedefc8b0a Merge: 49e7265fd098f f291209eca5eb Author: Jakub Kicinski Date: Thu Oct 5 13:16:31 2023 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. No conflicts (or adjacent changes of note). Signed-off-by: Jakub Kicinski commit bf176313c62ec4f97daa893888aa4fde86749cb2 Merge: 2f0382a7590ed 137f59d5dab4b Author: Marc Kleine-Budde Date: Thu Oct 5 21:48:09 2023 +0200 Merge patch series "can: at91: add can_state_get_by_berr_counter() helper, cleanup and convert to rx_offload" Marc Kleine-Budde says: This series first introduces the can_state_get_by_berr_counter() helper function. It returns the current TX and RX state depending on the provided CAN bit error counters. It will be later used by the at91_can driver. The remaining patches of this series first clean up the at91_can driver, clean up the bus- and line error (including bus-off) handling, and then convert it use the rx_offload helper. The driver works better under high system load and the order of received CAN frames is better maintained. Due to a hardware limitation the converted driver could trigger a race condition in the can_restart() CAN bus-off handler. The patch series [1] fixes the issue. [1] https://lore.kernel.org/all/20231005-can-dev-fix-can-restart-v2-0-91b5c1fd922c@pengutronix.de Changes in v2: - 1/27: can_state_err_to_state(): use symbolic error values instead of plain numbers (Thanks Vincent) - 27/27: fix patch description and typos (Thanks Vincent) - Link to v1: https://lore.kernel.org/all/20231004-at91_can-rx_offload-v1-0-c32bf99097db@pengutronix.de Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-0-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 137f59d5dab4bd55ab3d40080de18bf641bdc26a Author: Marc Kleine-Budde Date: Sun May 10 17:25:14 2015 +0200 can: at91_can: switch to rx-offload implementation The current at91_can driver uses NAPI to handle RX'ed CAN frames, the RX IRQ is disabled and a NAPI poll is scheduled. Then in at91_poll_rx() the RX'ed CAN frames are tried to read in order from the device. This approach has 2 drawbacks: - Under high system load it might take too long from the initial RX IRQ to the NAPI poll function to run. This causes RX buffer overflows. - The algorithm to read the CAN frames in order is not bullet proof and may fail under certain use cases/system loads. The rx-offload helper fixes these problems by reading the RX'ed CAN frames in the interrupt handler and adding it to a list sorted by RX timestamp. This list of RX'ed SKBs is then passed to the networking stack via NAPI. Convert the RX path to rx-offload, pass all CAN error frames with can_rx_offload_queue_timestamp(). Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-27-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit dd94a2f1f2f848a2534c4b0115db752a55b7eb03 Author: Marc Kleine-Budde Date: Thu Sep 28 11:15:15 2023 +0200 can: at91_can: at91_alloc_can_err_skb() introduce new function This is a preparation patch to convert the driver to make use of the rx-offload helper. With rx-offload the received CAN frames are sorted by their timestamp. Regular CAN RX'ed and TX'ed CAN frames are timestamped by the hardware. Error events are not. Introduce a new function at91_alloc_can_err_skb() the allocates an error SKB and reads the current timestamp from the controller. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-26-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 3db6154e44dba8626cd6e31e15bd29d1c3861ca8 Author: Marc Kleine-Budde Date: Thu Sep 28 10:05:17 2023 +0200 can: at91_can: at91_irq_err_line(): send error counters with state change Since 3e5c291c7942 ("can: add CAN_ERR_CNT flag to notify availability of error counter") there is a dedicated flag to inform the user space, that there are CAN error counters in the CAN error frame. In case the device is not in bus off mode, send the error counters to user space and set CAN_ERR_CNT. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-25-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 9df2faf947bc4e7a48dbd7768ccb95337bb12c44 Author: Marc Kleine-Budde Date: Mon May 1 18:14:41 2023 +0200 can: at91_can: at91_irq_err_line(): make use of can_change_state() and can_bus_off() The driver implements a hand crafted CAN state handling. Update the driver to make use of can_change_state(), introduced in ("can: dev: Consolidate and unify state change handling") Also switch from hand crafted CAN bus off handling to can_bus_off(): In case of a bus off, abort all pending TX requests, switch off the device and let can_bus_off() handle the device restart. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-24-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit f13e86993d85ac98b12159ca9e31dc0357e5a926 Author: Marc Kleine-Budde Date: Mon May 1 18:14:41 2023 +0200 can: at91_can: at91_irq_err_line(): take reg_sr into account for bus off The at91 CAN controller automatically recovers from bus-off after 128 occurrences of 11 consecutive recessive bits. After an auto-recovered bus-off, the error counters no longer reflect this fact. On the sam9263 the state bits in the SR register show the current state (based on the current error counters), while on sam9x5 and newer SoCs these bits are latched. Take any latched bus-off information from the SR register into account when calculating the CAN new state, to start the standard CAN bus off handling. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-23-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 910f179aa0de17bab654291548aec378f74db293 Author: Marc Kleine-Budde Date: Mon May 1 18:14:41 2023 +0200 can: at91_can: at91_irq_err_line(): make use of can_state_get_by_berr_counter() On the sam9263 the SR bits for bus off, error passive, warning limit, and error active are not latched and reflect the current status of the controller. On the sam9x5 and newer SoCs these bits are latched. To simplify the code, use can_state_get_by_berr_counter() to get the state of the controller regardless of the SoC version. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-22-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit efad777c3e97472fbd6aa4e5db11dcb3ef3eae90 Author: Marc Kleine-Budde Date: Mon May 1 18:14:41 2023 +0200 can: at91_can: at91_irq_err(): rename to at91_irq_err_line() This is a cleanup patch, no functional change intended. The function at91_irq_err() only handles the CAN line errors, so rename it accordingly to at91_irq_err_line(). Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-21-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit e0c9db91d60ba44705a7f333cbed2be8b32b293c Author: Marc Kleine-Budde Date: Thu Sep 28 11:15:15 2023 +0200 can: at91_can: at91_irq_err_frame(): move next to at91_irq_err() This is a cleanup patch, no functional change intended. As at91_irq_err_frame() is called from the IRQ handler move it in front of the IRQ handler next to at91_irq_err(). Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-20-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit d3f4cf05402b06631f282e23dcba85daed732e38 Author: Marc Kleine-Budde Date: Mon May 1 18:14:41 2023 +0200 can: at91_can: at91_irq_err_frame(): call directly from IRQ handler This is a preparation patch to convert the driver to the rx-offload helper. In rx-offload RX, TX-done and CAN error handling are done in the IRQ handler, SKB are pushed to the network stack in the NAPI poll function. Move the CAN frame error handling from the NAPI function at91_poll() to the IRQ handler at91_poll(). To reflect this change, rename at91_poll_err() to at91_irq_err_frame(). Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-19-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit aa3f5d935cbb302dce89e8f278f6e8a3e2ecea18 Author: Marc Kleine-Budde Date: Mon May 1 18:14:41 2023 +0200 can: at91_can: at91_poll_err(): increase stats even if no quota left or OOM at91_poll_err() allocates a can error SKB, to inform the user space about the CAN error. Then it fills the SKB with information the error information and increases the net device error stats. In case no SBK can be allocated (e.g. due to an OOM) or the NAPI quota is 0 the function is left early and no stats are updated. This is not helpful to the user, as there is no information about the faulty CAN bus. Increase the error stats even if no quota is left or no SKB can be allocated. While there treat No-Acknowledgment as a bus error, too. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-18-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 864c6f07d3c4a4ed40fca932d9aec17607c6cc96 Author: Marc Kleine-Budde Date: Mon May 1 18:14:41 2023 +0200 can: at91_can: at91_poll_err(): fold in at91_poll_err_frame() This is a preparation patch for the cleanup of at91_poll_err(). Fold at91_poll_err_frame() into at91_poll_err() so that it can be easier modified. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-17-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 3ecc09856afb83a02c4079db595f9dcc8122b3be Author: Marc Kleine-Budde Date: Mon May 1 18:14:41 2023 +0200 can: at91_can: add CAN transceiver support Add support for Linux-PHY based CAN transceivers. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-16-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 99f4ff41bbb0a22b3c4bf800b060833255f6ae2a Author: Marc Kleine-Budde Date: Mon May 1 18:14:41 2023 +0200 can: at91_can: at91_open(): forward request_irq()'s return value in case or an error If request_irq() fails, forward the return value. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-15-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 8227088cb3c2afb58a45a946d92f6bf93d04d6de Author: Marc Kleine-Budde Date: Mon May 1 18:14:41 2023 +0200 can: at91_can: at91_chip_start(): don't disable IRQs twice In at91_chip_start() first all IRQs are disabled, they do not have to be disabled again at the end of the function before the requested IRQs are enabled. Remove the 2nd disable of all IRQs at the end of the function. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-14-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit ccd7cd07051fbd50bbbc6a55547d965c3392f318 Author: Marc Kleine-Budde Date: Tue Apr 18 16:36:30 2023 +0200 can: at91_can: at91_set_bittiming(): demote register output to debug level This message isn't really helpful for the general reader of the kernel logs, so should not be printed with info level. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-13-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 2f1a01a82fca5fa734dbe653cce54463f61f0299 Author: Marc Kleine-Budde Date: Fri Apr 21 18:15:15 2023 +0200 can: at91_can: rename struct at91_priv::{tx_next,tx_echo} to {tx_head,tx_tail} To increase code readability, use the same naming of the counters for the TX FIFO as in the other drivers implementing the same algorithm. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-12-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 2b08e5217a1d151bd8901ad2b7de220227e04b0d Author: Marc Kleine-Budde Date: Thu Sep 28 22:02:16 2023 +0200 can: at91_can: at91_setup_mailboxes(): update comments Since 6388b3961420 ("can: at91_can: add support for the AT91SAM9X5 SOCs") the number of mailboxes used for RX and TX is no longer constant, but depends on the IP core used. Remove the fixed number of mailboxes from the comment. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-11-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 63446dc70316e104d8454d4a2143a652d2d47a99 Author: Marc Kleine-Budde Date: Sun May 10 17:25:14 2015 +0200 can: at91_can: add more register definitions Add more register definitions found in the data sheet. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-10-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 5e9c5bcc017d24fe0e990aa793086d4eb175079c Author: Marc Kleine-Budde Date: Tue Apr 18 16:35:54 2023 +0200 can: at91_can: MCR Register: convert to FIELD_PREP() Use FIELD_PREP() to access the individual fields of the MCR register. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-9-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit bdfff1433cd6e2f47155f7bf205bcee32001a075 Author: Marc Kleine-Budde Date: Tue Apr 18 16:35:54 2023 +0200 can: at91_can: MSR Register: convert to FIELD_PREP() Use FIELD_PREP() to access the individual fields of the MSR register. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-8-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 90aa9a250cf2def73e890177867155f6ce956912 Author: Marc Kleine-Budde Date: Tue Apr 18 16:35:54 2023 +0200 can: at91_can: MID registers: convert access to FIELD_PREP(), FIELD_GET() Use FIELD_PREP() and FIELD_GET() to access the individual fields of the MID register. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-7-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 53558ac133c0a8d4fd4c81d6c7885dacd3cca557 Author: Marc Kleine-Budde Date: Tue Apr 18 16:35:54 2023 +0200 can: at91_can: MMR registers: convert to FIELD_PREP() Use FIELD_PREP() to access the individual fields of the MMR register. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-6-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit abe1348753b3e062da7e0bfee1da0eef9dffe336 Author: Marc Kleine-Budde Date: Tue Apr 18 16:35:54 2023 +0200 can: at91_can: ECR register: convert to FIELD_GET() Use FIELD_GET() to access the individual fields of the ECR register. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-5-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit bd7854e83900b0f4c1ec5ddc91c447509f23b160 Author: Marc Kleine-Budde Date: Tue Apr 18 16:35:54 2023 +0200 can: at91_can: BR register: convert to FIELD_PREP() Use FIELD_PREP() to access the individual fields of the BR register. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-4-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 18c98714748364354701c18e93b60f6550171014 Author: Marc Kleine-Budde Date: Sun Apr 23 13:47:40 2023 +0200 can: at91_can: at91_irq_tx(): remove one level of indention Improve code readability by removing one level of indention. If a mailbox is not ready, continue the loop early. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-3-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit e26ccc4658c10fc949e475238f94a20b19e96b56 Author: Marc Kleine-Budde Date: Tue Apr 18 16:26:52 2023 +0200 can: at91_can: use a consistent indention Convert the driver to use a consistent indention of one space after defines and in enums. That makes it easier to add new defines, which will be done in the coming patches. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-2-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 9beebc2b5d0038a65977a7a14909598c64ce070f Author: Marc Kleine-Budde Date: Thu Sep 28 09:24:28 2023 +0200 can: dev: add can_state_get_by_berr_counter() to return the CAN state based on the current error counters Some CAN controllers do not have a register that contains the current CAN state, but only a register that contains the error counters. Introduce a new function can_state_get_by_berr_counter() that returns the current TX and RX state depending on the provided CAN bit error counters. Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-1-9987d53600e0@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 2f0382a7590ed65ef6a4336aace0f30814e24dc1 Merge: 3b9333493b5fa 6411959c10fe9 Author: Marc Kleine-Budde Date: Thu Oct 5 21:34:37 2023 +0200 Merge patch series "can: dev: fix can_restart() and replace BUG_ON() by error handling" Marc Kleine-Budde says: There are 2 BUG_ON() in the CAN dev helpers. During the update/test of the at91_can driver to rx-offload the one in can_restart() was triggered, due to a race condition in can_restart() and a hardware limitation of the at91_can IP core. This series fixes the race condition, replaces BUG_ON() with an error message, and does some cleanup. Finally, the BUG_ON() in can_put_echo_skb() is also replaced with error handling. Changes in v2: - 4/5: move "Restarted" debug message and stats after successful restart (Thanks Vincent) - Link to v1: https://lore.kernel.org/all/20231004-can-dev-fix-can-restart-v1-0-2e52899eaaf5@pengutronix.de Link: https://lore.kernel.org/all/20231005-can-dev-fix-can-restart-v2-0-91b5c1fd922c@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 6411959c10fe917288cbb1038886999148560057 Author: Marc Kleine-Budde Date: Fri Sep 29 10:23:47 2023 +0200 can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds If the "struct can_priv::echoo_skb" is accessed out of bounds, this would cause a kernel crash. Instead, issue a meaningful warning message and return with an error. Fixes: a6e4bc530403 ("can: make the number of echo skb's configurable") Link: https://lore.kernel.org/all/20231005-can-dev-fix-can-restart-v2-5-91b5c1fd922c@pengutronix.de Reviewed-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit f0e0c809c0be05fe865b9ac128ef3ee35c276021 Author: Marc Kleine-Budde Date: Fri Sep 29 10:18:02 2023 +0200 can: dev: can_restart(): move debug message and stats after successful restart Move the debug message "restarted" and the CAN restart stats_after_ the successful restart of the CAN device, because the restart may fail. While there update the error message from printing the error number to printing symbolic error names. Link: https://lore.kernel.org/all/20231005-can-dev-fix-can-restart-v2-4-91b5c1fd922c@pengutronix.de Reviewed-by: Vincent Mailhol [mkl: mention stats in subject and description, too] Signed-off-by: Marc Kleine-Budde commit 8f3ec204d340af183fb2bb21b8e797ac2ed012b2 Author: Marc Kleine-Budde Date: Fri Sep 29 09:47:38 2023 +0200 can: dev: can_restart(): reverse logic to remove need for goto Reverse the logic in the if statement and eliminate the need for a goto to simplify code readability. Link: https://lore.kernel.org/all/20231005-can-dev-fix-can-restart-v2-3-91b5c1fd922c@pengutronix.de Reviewed-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 6841cab8c4504835e4011689cbdb3351dec693fd Author: Marc Kleine-Budde Date: Fri Sep 29 10:25:11 2023 +0200 can: dev: can_restart(): fix race condition between controller restart and netif_carrier_on() This race condition was discovered while updating the at91_can driver to use can_bus_off(). The following scenario describes how the converted at91_can driver would behave. When a CAN device goes into BUS-OFF state, the driver usually stops/resets the CAN device and calls can_bus_off(). This function sets the netif carrier to off, and (if configured by user space) schedules a delayed work that calls can_restart() to restart the CAN device. The can_restart() function first checks if the carrier is off and triggers an error message if the carrier is OK. Then it calls the driver's do_set_mode() function to restart the device, then it sets the netif carrier to on. There is a race window between these two calls. The at91 CAN controller (observed on the sama5d3, a single core 32 bit ARM CPU) has a hardware limitation. If the device goes into bus-off while sending a CAN frame, there is no way to abort the sending of this frame. After the controller is enabled again, another attempt is made to send it. If the bus is still faulty, the device immediately goes back to the bus-off state. The driver calls can_bus_off(), the netif carrier is switched off and another can_restart is scheduled. This occurs within the race window before the original can_restart() handler marks the netif carrier as OK. This would cause the 2nd can_restart() to be called with an OK netif carrier, resulting in an error message. The flow of the 1st can_restart() looks like this: can_restart() // bail out if netif_carrier is OK netif_carrier_ok(dev) priv->do_set_mode(dev, CAN_MODE_START) // enable CAN controller // sama5d3 restarts sending old message // CAN devices goes into BUS_OFF, triggers IRQ // IRQ handler start at91_irq() at91_irq_err_line() can_bus_off() netif_carrier_off() schedule_delayed_work() // IRQ handler end netif_carrier_on() The 2nd can_restart() will be called with an OK netif carrier and the error message will be printed. To close the race window, first set the netif carrier to on, then restart the controller. In case the restart fails with an error code, roll back the netif carrier to off. Fixes: 39549eef3587 ("can: CAN Network device driver and Netlink interface") Link: https://lore.kernel.org/all/20231005-can-dev-fix-can-restart-v2-2-91b5c1fd922c@pengutronix.de Reviewed-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit fe5c9940dfd8ba0c73672dddb30acd1b7a11d4c7 Author: Marc Kleine-Budde Date: Thu Sep 28 21:58:23 2023 +0200 can: dev: can_restart(): don't crash kernel if carrier is OK During testing, I triggered a can_restart() with the netif carrier being OK [1]. The BUG_ON, which checks if the carrier is OK, results in a fatal kernel crash. This is neither helpful for debugging nor for a production system. [1] The root cause is a race condition in can_restart() which will be fixed in the next patch. Do not crash the kernel, issue an error message instead, and continue restarting the CAN device anyway. Fixes: 39549eef3587 ("can: CAN Network device driver and Netlink interface") Link: https://lore.kernel.org/all/20231005-can-dev-fix-can-restart-v2-1-91b5c1fd922c@pengutronix.de Reviewed-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit b2516f7af9d238ebc391bdbdae01ac9528f1109e Author: Gary Guo Date: Sat Sep 23 10:46:50 2023 +0800 rust: kernel: remove `#[allow(clippy::new_ret_no_self)]` Clippy triggered a false positive on its `new_ret_no_self` lint when using the `pin_init!` macro. Since Rust 1.67.0, that does not happen anymore, since Clippy learnt to not warn about `-> impl Trait` [1][2]. The kernel nowadays uses Rust 1.72.1, thus remove the `#[allow]`. Signed-off-by: Gary Guo Reviewed-by: Alice Ryhl Reviewed-by: Benno Lossin Reviewed-by: Finn Behrens Reviewed-by: Martin Rodriguez Reboredo Link: https://github.com/rust-lang/rust-clippy/issues/7344 [1] Link: https://github.com/rust-lang/rust-clippy/pull/9733 [2] Link: https://lore.kernel.org/r/20230923024707.47610-1-gary@garyguo.net [ Reworded slightly and added a couple `Link`s. ] Signed-off-by: Miguel Ojeda commit fc388bea85f88cb9117eda808ed9237af65f3041 Author: Miguel Ojeda Date: Wed Aug 30 18:59:49 2023 +0200 MAINTAINERS: add Maintainer Entry Profile field for Rust The `P:` field allows a URI, and we have been adding information on how to contribute to the Rust subsystem to our webpage for a while now (and other relevant topics, e.g. branches, third-party crates, Rust unstable features...). The webpage/document does not currently follow the headings of the Maintainer Entry Profile, but it does nevertheless answer some of the questions we have got so far from contributors and it covers partially some of the topics there. Thus link to our "Contributing" document [1]. Link: https://rust-for-linux.com/contributing [1] Reviewed-by: Andreas Hindborg Reviewed-by: Alice Ryhl Reviewed-by: Vincenzo Palazzo Reviewed-by: Benno Lossin Link: https://lore.kernel.org/r/20230830165949.127475-2-ojeda@kernel.org Signed-off-by: Miguel Ojeda commit bb97dbfaf936fba43dc7b66004bbf4c0386a84c0 Author: Miguel Ojeda Date: Wed Aug 30 18:59:48 2023 +0200 MAINTAINERS: update Rust webpage A few months ago we started a webpage for the Rust subsystem and the overall Rust for Linux project [1]. The current `W:` field of the Rust entry points to the GitHub repository, since originally we kept information in a `README.md` file that got rendered by GitHub when visiting that URL. That information was moved into the webpage and got expanded. The webpage is also nowadays the entry point to the project, and we pointed the "Website" GitHub metadata field to it. Thus update the `W:` field to point to the actual webpage. Link: https://rust-for-linux.com [1] Reviewed-by: Vincenzo Palazzo Reviewed-by: Andreas Hindborg Reviewed-by: Benno Lossin Reviewed-by: Alice Ryhl Reviewed-by: Geert Stappers Reviewed-by: Boqun Feng Link: https://lore.kernel.org/r/20230830165949.127475-1-ojeda@kernel.org Signed-off-by: Miguel Ojeda commit ae6df65dabc3f8bd89663d96203963323e266d90 Author: Miguel Ojeda Date: Wed Aug 23 18:02:43 2023 +0200 rust: upgrade to Rust 1.72.1 This is the third upgrade to the Rust toolchain, from 1.71.1 to 1.72.1 (i.e. the latest) [1]. See the upgrade policy [2] and the comments on the first upgrade in commit 3ed03f4da06e ("rust: upgrade to Rust 1.68.2"). # Unstable features No unstable features (that we use) were stabilized. Therefore, the only unstable feature allowed to be used outside the `kernel` crate is still `new_uninit`, though other code to be upstreamed may increase the list. Please see [3] for details. # Other improvements Previously, the compiler could incorrectly generate a `.eh_frame` section under `-Cpanic=abort`. We were hitting this bug when debug assertions were enabled (`CONFIG_RUST_DEBUG_ASSERTIONS=y`) [4]: LD .tmp_vmlinux.kallsyms1 ld.lld: error: :(.eh_frame) is being placed in '.eh_frame' Gary fixed the issue in Rust 1.72.0 [5]. # Required changes For the upgrade, the following changes are required: - A call to `Box::from_raw` in `rust/kernel/sync/arc.rs` now requires an explicit `drop()` call. See previous patch for details. # `alloc` upgrade and reviewing The vast majority of changes are due to our `alloc` fork being upgraded at once. There are two kinds of changes to be aware of: the ones coming from upstream, which we should follow as closely as possible, and the updates needed in our added fallible APIs to keep them matching the newer infallible APIs coming from upstream. Instead of taking a look at the diff of this patch, an alternative approach is reviewing a diff of the changes between upstream `alloc` and the kernel's. This allows to easily inspect the kernel additions only, especially to check if the fallible methods we already have still match the infallible ones in the new version coming from upstream. Another approach is reviewing the changes introduced in the additions in the kernel fork between the two versions. This is useful to spot potentially unintended changes to our additions. To apply these approaches, one may follow steps similar to the following to generate a pair of patches that show the differences between upstream Rust and the kernel (for the subset of `alloc` we use) before and after applying this patch: # Get the difference with respect to the old version. git -C rust checkout $(linux/scripts/min-tool-version.sh rustc) git -C linux ls-tree -r --name-only HEAD -- rust/alloc | cut -d/ -f3- | grep -Fv README.md | xargs -IPATH cp rust/library/alloc/src/PATH linux/rust/alloc/PATH git -C linux diff --patch-with-stat --summary -R > old.patch git -C linux restore rust/alloc # Apply this patch. git -C linux am rust-upgrade.patch # Get the difference with respect to the new version. git -C rust checkout $(linux/scripts/min-tool-version.sh rustc) git -C linux ls-tree -r --name-only HEAD -- rust/alloc | cut -d/ -f3- | grep -Fv README.md | xargs -IPATH cp rust/library/alloc/src/PATH linux/rust/alloc/PATH git -C linux diff --patch-with-stat --summary -R > new.patch git -C linux restore rust/alloc Now one may check the `new.patch` to take a look at the additions (first approach) or at the difference between those two patches (second approach). For the latter, a side-by-side tool is recommended. Link: https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1721-2023-09-19 [1] Link: https://rust-for-linux.com/rust-version-policy [2] Link: https://github.com/Rust-for-Linux/linux/issues/2 [3] Closes: https://github.com/Rust-for-Linux/linux/issues/1012 [4] Link: https://github.com/rust-lang/rust/pull/112403 [5] Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Gary Guo Reviewed-by: Alice Ryhl Reviewed-by: Björn Roy Baron Link: https://lore.kernel.org/r/20230823160244.188033-3-ojeda@kernel.org [ Used 1.72.1 instead of .0 (no changes in `alloc`) and reworded to mention that we hit the `.eh_frame` bug under debug assertions. ] Signed-off-by: Miguel Ojeda commit fae633cfb729da2771b5433f6b84ae7e8b4aa5f7 Author: David Arcari Date: Thu Oct 5 07:17:57 2023 -0400 thermal: intel: powerclamp: fix mismatch in get function for max_idle KASAN reported this [ 444.853098] BUG: KASAN: global-out-of-bounds in param_get_int+0x77/0x90 [ 444.853111] Read of size 4 at addr ffffffffc16c9220 by task cat/2105 ... [ 444.853442] The buggy address belongs to the variable: [ 444.853443] max_idle+0x0/0xffffffffffffcde0 [intel_powerclamp] There is a mismatch between the param_get_int and the definition of max_idle. Replacing param_get_int with param_get_byte resolves this issue. Fixes: ebf519710218 ("thermal: intel: powerclamp: Add two module parameters") Cc: 6.3+ # 6.3+ Signed-off-by: David Arcari Reviewed-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit b57587f11f8116c3835e994caed81fc4d8ab5dbd Author: Peng Fan Date: Sun Oct 1 16:27:56 2023 +0800 gpio: vf610: simplify code by dropping data check All of_device_id entries has valid data, so code simplified a bit by dropping the data check. Signed-off-by: Peng Fan Signed-off-by: Bartosz Golaszewski commit 76bc907b142cca4a043e0a18be4d8a4e6d2df328 Author: Peng Fan Date: Sun Oct 1 16:27:55 2023 +0800 gpio: vf610: add i.MX8ULP of_device_id entry i.MX8ULP/93 GPIO supports similar feature as i.MX7ULP GPIO, but i.MX8ULP is actually not hardware compatible with i.MX7ULP. i.MX8ULP only has one register base, not two bases. i.MX8ULP and i.MX93 actually has two interrupts for each gpio controller, one for Trustzone non-secure world, one for secure world. Although the Linux Kernel driver gpio-vf610.c could work with fsl,imx7ulp-gpio compatible, it is based on some tricks did in device tree with some offset added to base address. Add a new of_device_id entry for i.MX8ULP. But to make the driver could also support old bindings, check the compatible string first, before check the device data. Signed-off-by: Peng Fan Signed-off-by: Bartosz Golaszewski commit 2b575631fe5f4e7948954e70fcff409b67ed42c3 Author: Peng Fan Date: Sun Oct 1 16:27:54 2023 +0800 dt-bindings: gpio: vf610: add i.MX95 compatible Add i.MX95 compatible string which is compatible with i.MX8ULP Acked-by: Krzysztof Kozlowski Signed-off-by: Peng Fan Signed-off-by: Bartosz Golaszewski commit 1619a094443659a16a39be9ee17567fd01723f4d Author: Peng Fan Date: Sun Oct 1 16:27:53 2023 +0800 dt-bindings: gpio: vf610: correct i.MX8ULP and i.MX93 i.MX8ULP and i.MX93 actually has two interrupts for each gpio controller, one for Trustzone non-secure world, one for secure world. And they has one register based, not two as i.MX7ULP or VF610. Although the Linux Kernel driver gpio-vf610.c could work with fsl,imx7ulp-gpio compatible, it is based on some tricks did in device tree with some offset added to base address. So actually i.MX8ULP/i.MX93 is not compatible with i.MX7ULP. Last, i.MX93 is directly derived from i.MX8ULP, so make i.MX93 GPIO compatible with i.MX8ULP Reviewed-by: Rob Herring Signed-off-by: Peng Fan Signed-off-by: Bartosz Golaszewski commit 690acef3c47f96cd89853fad90f02ba80a497306 Author: Peng Fan Date: Sun Oct 1 16:27:52 2023 +0800 dt-bindings: gpio: vf610: update gpio-ranges i.MX93 supports four gpio-ranges at max. To fix below issue: "gpio@43820080: gpio-ranges: [[30, 0, 84, 8], [30, 8, 66, 18], [30, 26, 34, 2], [30, 28, 0, 4]] is too long" Update the gpio-ranges property Acked-by: Krzysztof Kozlowski Reviewed-by: Fabio Estevam Reviewed-by: Linus Walleij Signed-off-by: Peng Fan Signed-off-by: Bartosz Golaszewski commit ccd3129aca286c41616afe357e3494c5b43350a0 Author: Kees Cook Date: Thu Oct 5 09:14:12 2023 -0700 nvmet-fc: Annotate struct nvmet_fc_tgt_queue with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct nvmet_fc_tgt_queue. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. Cc: James Smart Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: linux-nvme@lists.infradead.org Reviewed-by: Gustavo A. R. Silva Reviewed-by: Chaitanya Kulkarni Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Signed-off-by: Keith Busch commit 190c3ad68f389ef06e82c3a08c1d0bea57379d93 Author: Ivan Vecera Date: Wed Sep 27 10:31:35 2023 +0200 i40e: Move DDP specific macros and structures to i40e_ddp.c Move several DDP related macros and structures from i40e.h header to i40e_ddp.c where are privately used. Make static i40e_ddp_load() function that is also used only in i40e_ddp and move declaration of i40e_ddp_flash() used by i40e_ethtool.c to i40e_prototype.h Signed-off-by: Ivan Vecera Reviewed-by: Przemek Kitszel Reviewed-by: Jesse Brandeburg Reviewed-by: Aleksandr Loktionov Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 56df345917c09ffc00b7834f88990a7a7c338b5c Author: Ivan Vecera Date: Wed Sep 27 10:31:34 2023 +0200 i40e: Remove circular header dependencies and fix headers Similarly as for ice driver [1] there are also circular header dependencies in i40e driver: i40e.h -> i40e_virtchnl_pf.h -> i40e.h Another issue is that i40e header files does not contain their own dependencies on other header files (both private and standard) so their inclusion in .c file require to add these deps in certain order to that .c file to make it compilable. Fix both issues by removal the mentioned circular dependency, by filling i40e headers with their dependencies so they can be placed anywhere in a source code. Additionally remove bunch of includes from i40e.h super header file that are not necessary and include i40e.h only in .c files that really require it. [1] 649c87c6ff52 ("ice: remove circular header dependencies on ice.h") Signed-off-by: Ivan Vecera Reviewed-by: Przemek Kitszel Reviewed-by: Jesse Brandeburg Reviewed-by: Aleksandr Loktionov Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 5dfd37c37a44ba47c35ff8e6eaff14c226141111 Author: Ivan Vecera Date: Wed Sep 27 10:31:33 2023 +0200 i40e: Split i40e_osdep.h Header i40e_osdep.h contains only IO primitives and couple of debug printing macros. Split this header file to i40e_io.h and i40e_debug.h and move i40e_debug_mask enum to i40e_debug.h Signed-off-by: Ivan Vecera Reviewed-by: Przemek Kitszel Reviewed-by: Jesse Brandeburg Reviewed-by: Aleksandr Loktionov Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit ef5d54078d451973f90e123fafa23fc95c2a08ae Author: Ivan Vecera Date: Wed Sep 27 10:31:32 2023 +0200 i40e: Move memory allocation structures to i40e_alloc.h Structures i40e_dma_mem & i40e_virt_mem are defined i40e_osdep.h while memory allocation functions that use them are declared in i40e_alloc.h Move them there. Signed-off-by: Ivan Vecera Reviewed-by: Przemek Kitszel Reviewed-by: Jesse Brandeburg Reviewed-by: Aleksandr Loktionov Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit d3276f928a1d2dfebc41a82e967cd0dffeb540f8 Author: Ivan Vecera Date: Wed Sep 27 10:31:31 2023 +0200 i40e: Simplify memory allocation functions Enum i40e_memory_type enum is unused in i40e_allocate_dma_mem() thus can be safely removed. Useless macros in i40e_alloc.h can be removed as well. Signed-off-by: Ivan Vecera Reviewed-by: Przemek Kitszel Reviewed-by: Jesse Brandeburg Reviewed-by: Aleksandr Loktionov Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 7151d87a175c6618fe81705755eb3dc4199cad4e Author: Ivan Vecera Date: Wed Sep 27 10:31:30 2023 +0200 virtchnl: Add header dependencies The uses BIT, struct_size and ETH_ALEN macros but does not include appropriate header files that defines them. Add these dependencies so this header file can be included anywhere. Signed-off-by: Ivan Vecera Reviewed-by: Przemek Kitszel Reviewed-by: Jesse Brandeburg Reviewed-by: Aleksandr Loktionov Signed-off-by: Tony Nguyen commit 8196b5fd6c7312d31775f77c7fff0253eb0ecdaa Author: Ivan Vecera Date: Wed Sep 27 10:31:29 2023 +0200 i40e: Refactor I40E_MDIO_CLAUSE* macros The macros I40E_MDIO_CLAUSE22* and I40E_MDIO_CLAUSE45* are using I40E_MASK together with the same values I40E_GLGEN_MSCA_STCODE_SHIFT and I40E_GLGEN_MSCA_OPCODE_SHIFT to define masks. Introduce I40E_GLGEN_MSCA_OPCODE_MASK and I40E_GLGEN_MSCA_STCODE_MASK for both shifts in i40e_register.h and use them to refactor the macros mentioned above. Signed-off-by: Ivan Vecera Reviewed-by: Przemek Kitszel Reviewed-by: Jesse Brandeburg Reviewed-by: Aleksandr Loktionov Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 9d84f739d617e85f1931e08ad53ef044178db5cc Author: Ivan Vecera Date: Wed Sep 27 10:31:28 2023 +0200 i40e: Move I40E_MASK macro to i40e_register.h The macro is practically used only in i40e_register.h header file except few I40E_MDIO_CLAUSE* macros that are defined in i40e_type.h Move I40E_MASK macro to i40e_register.h header, I40E_MDIO_CLAUSE* macros are refactored in subsequent patch. Signed-off-by: Ivan Vecera Reviewed-by: Przemek Kitszel Reviewed-by: Jesse Brandeburg Reviewed-by: Aleksandr Loktionov Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 39ec612acf6d075809c38a7262d7ad09314762f3 Author: Ivan Vecera Date: Wed Sep 27 10:31:27 2023 +0200 i40e: Remove back pointer from i40e_hw structure The .back field placed in i40e_hw is used to get pointer to i40e_pf instance but it is not necessary as the i40e_hw is a part of i40e_pf and containerof macro can be used to obtain the pointer to i40e_pf. Remove .back field from i40e_hw structure, introduce i40e_hw_to_pf() and i40e_hw_to_dev() helpers and use them. Signed-off-by: Ivan Vecera Reviewed-by: Przemek Kitszel Reviewed-by: Jesse Brandeburg Reviewed-by: Aleksandr Loktionov Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 5b9ceb63c49b9934cf2ec70b3b76951927e50a24 Author: John Sanpe Date: Fri Sep 15 22:06:50 2023 +0800 logic_pio: Remove logic_outb(), _outw(), outl() duplicate declarations Remove duplicate declarations of logic_out* functions. Link: https://lore.kernel.org/r/20230915140650.3562504-1-sanpeqf@gmail.com Signed-off-by: John Sanpe Signed-off-by: Bjorn Helgaas commit 24d813b2ec7dc7b617fee835baaf91c42436367b Author: Randy Dunlap Date: Sun Sep 24 21:23:16 2023 -0700 PCI: Make pci_assign_unassigned_resources() non-init Fix a section mismatch warning on Sparc 32-bit: WARNING: modpost: vmlinux: section mismatch in reference: leon_pci_init+0xf8 (section: .text) -> pci_assign_unassigned_resources (section: .init.text) This is due to this comment from arch/sparc/kernel/leon_pci.c: The LEON architecture does not rely on a BIOS or bootloader to setup PCI for us. The Linux generic routines are used to setup resources, reset values of configuration-space register settings are preserved. Link: https://lore.kernel.org/r/20230925042316.15415-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Signed-off-by: Bjorn Helgaas Cc: "David S. Miller" Cc: sparclinux@vger.kernel.org commit 7e6f3b6d2c352b5fde37ce3fed83bdf6172eebd4 Author: Vicki Pfau Date: Wed Sep 27 13:22:12 2023 -0700 PCI: Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device The AMD VanGogh SoC contains a DesignWare USB3 Dual-Role Device that can be operated as either a USB Host or a USB Device, similar to on the AMD Nolan platform. be6646bfbaec ("PCI: Prevent xHCI driver from claiming AMD Nolan USB3 DRD device") added a quirk to let the dwc3 driver claim the Nolan device since it provides more specific support. Extend that quirk to include the VanGogh SoC USB3 device. Link: https://lore.kernel.org/r/20230927202212.2388216-1-vi@endrift.com Signed-off-by: Vicki Pfau [bhelgaas: include be6646bfbaec reference, add stable tag] Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # v3.19+ commit 9031e0013f819ca697a65046e5b86cd1a21b86ea Author: Wayne Lin Date: Thu Oct 5 16:04:05 2023 +0800 drm/amd/display: Fix mst hub unplug warning [Why] Unplug mst hub will cause warning. That's because dm_helpers_construct_old_payload() is changed to be called after payload removement from dc link. In dm_helpers_construct_old_payload(), We refer to the vcpi in payload allocation table of dc link to construct the old payload and payload is no longer in the table when we call the function now. [How] Refer to the mst_state to construct the number of time slot for old payload now. Note that dm_helpers_construct_old_payload() is just a quick workaround before and we are going to abandon it soon. Fixes: 5aa1dfcdf0a4 ("drm/mst: Refactor the flow for payload allocation/removement") Reviewed-by: Jerry Zuo Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20231005080405.169841-1-Wayne.Lin@amd.com commit eba90a7aa2258cae4caeaa8f748506c315c30bd1 Author: Chris Morgan Date: Tue Oct 3 11:33:55 2023 -0500 drm/panel: nv3051d: Add Support for Anbernic 351V Add support for the Anbernic 351V. Just like the 353 series the underlying vendor is unknown/unmarked (at least not visible in a non-destructive manner). The panel had slightly different init sequences and timings in the BSP kernel, but works fine with the same ones used in the existing driver. The panel will not work without the inclusion of the MIPI_DSI_CLOCK_NON_CONTINUOUS flag, and this flag prevents the 353 series from working correctly, so a new compatible string is added. Tested colors and timings using modetest and all seem to work identical to the 353 otherwise. Signed-off-by: Chris Morgan Reviewed-by: Jessica Zhang Link: https://lore.kernel.org/r/20231003163355.143704-3-macroalpha82@gmail.com Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231003163355.143704-3-macroalpha82@gmail.com commit e111ac7025cb8aff275dda40ca09f9de9f84b7e9 Author: Li Chen Date: Wed Jul 5 18:15:51 2023 +0800 PCI: cadence: Drop unused member from struct cdns_plat_pcie The struct cdns_plat_pcie contains a member called is_rc that is not being used beyond being assigned a value within the cdns_plat_pcie_probe() function, which is then not used for anything. Thus, drop is_rc from the struct cdns_plat_pcie, especially since there already is an is_rc member within the struct cdns_plat_pcie_of_data that is actively used to convey information about the PCIe controller mode. [kwilczynski: commit log] Signed-off-by: Li Chen Signed-off-by: Krzysztof Wilczyński Signed-off-by: Bjorn Helgaas commit 1b063368ee71f252c5a7f86e100b3b67271608ae Author: Chris Morgan Date: Tue Oct 3 11:33:54 2023 -0500 dt-bindings: display: newvision,nv3051d: Add Anbernic 351V Document the Anbernic RG351V panel, which is identical to the panel used in their 353 series except for in inclusion of an additional DSI format flag. Signed-off-by: Chris Morgan Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20231003163355.143704-2-macroalpha82@gmail.com Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231003163355.143704-2-macroalpha82@gmail.com commit 4a2c5dddf9e9049bfb3dde18657ee349131b0def Author: Jai Luthra Date: Tue Oct 3 14:41:34 2023 +0530 arm64: dts: ti: k3-am62a7-sk: Enable audio on AM62A Add nodes for audio codec and sound card, enable the audio serializer (McASP1) under use and update pinmux. Reviewed-by: Jayesh Choudhary Reviewed-by: Devarsh Thakkar Link: https://www.ti.com/lit/zip/sprr459 Signed-off-by: Jai Luthra Link: https://lore.kernel.org/r/20231003-mcasp_am62a-v3-5-2b631ff319ca@ti.com Signed-off-by: Vignesh Raghavendra commit 3a8222080334fd0ffec9a6a563304f77571a1853 Author: Julien Panis Date: Tue Oct 3 14:41:33 2023 +0530 arm64: dts: ti: k3-am62a7-sk: Add support for TPS6593 PMIC This patch adds support for TPS6593 PMIC on main I2C0 bus. This device provides regulators (bucks and LDOs), but also GPIOs, a RTC, a watchdog, an ESM (Error Signal Monitor) which monitors the SoC error output signal, and a PFSM (Pre-configurable Finite State Machine) which manages the operational modes of the PMIC. Signed-off-by: Julien Panis Signed-off-by: Esteban Blanc Signed-off-by: Jai Luthra Link: https://lore.kernel.org/r/20231003-mcasp_am62a-v3-4-2b631ff319ca@ti.com Signed-off-by: Vignesh Raghavendra commit 63e5aa69b821472a3203a29e17c025329c1b151f Author: Jai Luthra Date: Tue Oct 3 14:41:32 2023 +0530 arm64: dts: ti: k3-am62a7-sk: Drop i2c-1 to 100Khz The TLV320AIC3106 audio codec is interfaced on the i2c-1 bus. With the default rate of 400Khz the i2c register writes fail to sync: [ 36.026387] tlv320aic3x 1-001b: Unable to sync registers 0x16-0x16. -110 [ 38.101130] omap_i2c 20010000.i2c: controller timed out Dropping the rate to 100Khz fixes the issue. Fixes: 38c4a08c820c ("arm64: dts: ti: Add support for AM62A7-SK") Reviewed-by: Devarsh Thakkar Reviewed-by: Aradhya Bhatia Signed-off-by: Jai Luthra Link: https://lore.kernel.org/r/20231003-mcasp_am62a-v3-3-2b631ff319ca@ti.com Signed-off-by: Vignesh Raghavendra commit 770480e7eb729d49f2a10530d628e9778c1b3bd8 Author: Jai Luthra Date: Tue Oct 3 14:41:31 2023 +0530 arm64: dts: ti: k3-am62a7-sk: Split vcc_3v3 regulators VCC_3V3_MAIN is the output of LM5141-Q1, and it serves as an input to TPS22965DSGT which produces VCC_3V3_SYS. [1] Link: https://www.ti.com/lit/zip/sprr459 [1] Signed-off-by: Jai Luthra Reviewed-by: Devarsh Thakkar Link: https://lore.kernel.org/r/20231003-mcasp_am62a-v3-2-2b631ff319ca@ti.com Signed-off-by: Vignesh Raghavendra commit 1d181c96ef3b6f9b29474fb18eb9f426bb6b16ac Author: Jai Luthra Date: Tue Oct 3 14:41:30 2023 +0530 arm64: dts: ti: k3-am62a-main: Add nodes for McASP Same as AM62, AM62A has three instances of McASP which can be used for transmitting or receiving digital audio in various formats. Reviewed-by: Jayesh Choudhary Reviewed-by: Devarsh Thakkar Signed-off-by: Jai Luthra Link: https://lore.kernel.org/r/20231003-mcasp_am62a-v3-1-2b631ff319ca@ti.com Signed-off-by: Vignesh Raghavendra commit 06a0d54202e0de04e62c1991d39d6c7595f0d88a Author: Matthias Schiffer Date: Thu Sep 28 13:45:13 2023 +0200 arm64: dts: ti: k3-am64-tqma64xxl-mbax4xxl: update gpio-led configuration Replace the deprecated label property with color/function. Signed-off-by: Matthias Schiffer Link: https://lore.kernel.org/r/79cb3cdfed19962ce0d4ae558de897695658a81f.1695901360.git.matthias.schiffer@ew.tq-group.com Signed-off-by: Vignesh Raghavendra commit 92039884c9b57d14601c6e0e913b184dd2bff75c Author: Matthias Schiffer Date: Thu Sep 28 13:45:12 2023 +0200 arm64: dts: ti: k3-am64-tqma64xxl-mbax4xxl: add chassis-type Set the "embedded" chassis-type for the MBaX4XxL. Signed-off-by: Matthias Schiffer Link: https://lore.kernel.org/r/55bf14afa377b9bbc1d6c4647895c51c018ae761.1695901360.git.matthias.schiffer@ew.tq-group.com Signed-off-by: Vignesh Raghavendra commit ec30a50c72bdaa6007c999846675241b44b233d0 Author: Matthias Schiffer Date: Thu Sep 28 13:45:11 2023 +0200 arm64: dts: ti: k3-am64-tqma64xxl-mbax4xxl: add muxing for GPIOs on pin headers The pin headers X41 and X42 do not have a fixed function. All of these pins can be assigned to PRG0, but as a default, it makes more sense to configure them as simple GPIOs, as the MBaX4XxL is a starterkit/evaluation mainboard. Signed-off-by: Matthias Schiffer Link: https://lore.kernel.org/r/77c30081154774ce31fc4306474a3afa52b07753.1695901360.git.matthias.schiffer@ew.tq-group.com Signed-off-by: Vignesh Raghavendra commit 8e4e717be847913517977d9689ab88f1b86d71d8 Author: Matthias Schiffer Date: Thu Sep 28 13:45:10 2023 +0200 arm64: dts: ti: k3-am64-tqma64xxl: add supply regulator for I2C devices Describes the hardware better, and avoids a few warnings during boot: lm75 0-004a: supply vs not found, using dummy regulator at24 0-0050: supply vcc not found, using dummy regulator at24 0-0054: supply vcc not found, using dummy regulator Signed-off-by: Matthias Schiffer Link: https://lore.kernel.org/r/d5991041263c96c798b94c0844a1550e28daa3b1.1695901360.git.matthias.schiffer@ew.tq-group.com Signed-off-by: Vignesh Raghavendra commit c7368ddba2ffcc5d200122c5bb122c3825ecb976 Author: Masahiro Yamada Date: Wed Sep 27 18:06:00 2023 +0100 ARM: 9326/1: make self-contained for ARM When I compiled the following code for ARM, I encountered numerous errors. [Test Code] #include #include int foo(int *x, int __user *ptr) { return get_user(*x, ptr); } To fix the errors, make some asm headers self-contained: 1. In arch/arm/include/asm/domain.h, include for current_thread_info(). 2. In arch/arm/include/asm/traps.h, remove unneeded __init, and include for asmlinkage. 3. In arch/arm/include/asm/uaccess.h, include for might_fault(). Signed-off-by: Masahiro Yamada Signed-off-by: Russell King (Oracle) commit 2d3dff577dd0ea8fe9637a13822f7603c4a881c8 Author: Matti Vaittinen Date: Tue Oct 3 12:57:47 2023 +0300 tools: iio: iio_generic_buffer ensure alignment The iio_generic_buffer can return garbage values when the total size of scan data is not a multiple of the largest element in the scan. This can be demonstrated by reading a scan, consisting, for example of one 4-byte and one 2-byte element, where the 4-byte element is first in the buffer. The IIO generic buffer code does not take into account the last two padding bytes that are needed to ensure that the 4-byte data for next scan is correctly aligned. Add the padding bytes required to align the next sample with the scan size. Signed-off-by: Matti Vaittinen Fixes: e58537ccce73 ("staging: iio: update example application.") Link: https://lore.kernel.org/r/ZRvlm4ktNLu+qmlf@dc78bmyyyyyyyyyyyyydt-3.rev.dnainternet.fi Signed-off-by: Jonathan Cameron commit 24d3ba0a7b44c1617c27f5045eecc4f34752ab03 Author: Masahiro Yamada Date: Tue Sep 26 17:09:03 2023 +0100 ARM: 9324/1: fix get_user() broken with veneer The 32-bit ARM kernel stops working if the kernel grows to the point where veneers for __get_user_* are created. AAPCS32 [1] states, "Register r12 (IP) may be used by a linker as a scratch register between a routine and any subroutine it calls. It can also be used within a routine to hold intermediate values between subroutine calls." However, bl instructions buried within the inline asm are unpredictable for compilers; hence, "ip" must be added to the clobber list. This becomes critical when veneers for __get_user_* are created because veneers use the ip register since commit 02e541db0540 ("ARM: 8323/1: force linker to use PIC veneers"). [1]: https://github.com/ARM-software/abi-aa/blob/2023Q1/aapcs32/aapcs32.rst Signed-off-by: Masahiro Yamada Reviewed-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) commit 399da29ff5eb3f675c71423bec4cf2208f218576 Author: wahrenst Date: Wed Sep 6 22:40:12 2023 +0100 ARM: 9323/1: mm: Fix ARCH_LOW_ADDRESS_LIMIT when CONFIG_ZONE_DMA Configuring VMSPLIT_2G + LPAE on Raspberry Pi 4 leads to SWIOTLB buffer allocation beyond platform dma_zone_size of SZ_1G, which results in broken SD card boot. So fix this be setting ARCH_LOW_ADDRESS_LIMIT in CONFIG_ZONE_DMA case. Suggested-by: Russell King Fixes: e9faf9b0b07a ("ARM: add multi_v7_lpae_defconfig") Signed-off-by: Stefan Wahren Reviewed-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) commit 3562257b34165bc9553fefbd48a85dc9337c14bb Author: Rob Herring Date: Tue Aug 22 23:58:18 2023 +0100 ARM: 9322/1: Explicitly include correct DT includes The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring Signed-off-by: Russell King (Oracle) commit c0e824661f443b8cab3897006c1bbc69fd0e7bc4 Author: Kursad Oney Date: Tue Aug 22 15:06:06 2023 +0100 ARM: 9321/1: memset: cast the constant byte to unsigned char memset() description in ISO/IEC 9899:1999 (and elsewhere) says: The memset function copies the value of c (converted to an unsigned char) into each of the first n characters of the object pointed to by s. The kernel's arm32 memset does not cast c to unsigned char. This results in the following code to produce erroneous output: char a[128]; memset(a, -128, sizeof(a)); This is because gcc will generally emit the following code before it calls memset() : mov r0, r7 mvn r1, #127 ; 0x7f bl 00000000 r1 ends up with 0xffffff80 before being used by memset() and the 'a' array will have -128 once in every four bytes while the other bytes will be set incorrectly to -1 like this (printing the first 8 bytes) : test_module: -128 -1 -1 -1 test_module: -1 -1 -1 -128 The change here is to 'and' r1 with 255 before it is used. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reviewed-by: Ard Biesheuvel Reviewed-by: Linus Walleij Signed-off-by: Kursad Oney Signed-off-by: Russell King (Oracle) commit b0150014878c32197cfa66e3e2f79e57f66babc0 Author: Vincent Whitchurch Date: Mon Aug 21 08:45:21 2023 +0100 ARM: 9320/1: fix stack depot IRQ stack filter Place IRQ handlers such as gic_handle_irq() in the irqentry section even if FUNCTION_GRAPH_TRACER is not enabled. Without this, the stack depot's filter_irq_stacks() does not correctly filter out IRQ stacks in those configurations, which hampers deduplication and eventually leads to "Stack depot reached limit capacity" splats with KASAN. A similar fix was done for arm64 in commit f6794950f0e5ba37e3bbed ("arm64: set __exception_irq_entry with __irq_entry as a default"). Link: https://lore.kernel.org/r/20230803-arm-irqentry-v1-1-8aad8e260b1c@axis.com Signed-off-by: Vincent Whitchurch Signed-off-by: Russell King (Oracle) commit 414f28a94222fe372a5b2378415895b9c4dc540f Author: Randy Dunlap Date: Mon Aug 21 03:10:38 2023 +0100 ARM: 9319/1: sa1111: fix sa1111_probe kernel-doc warnings Document only the platform_driver probe entry point in kernel-doc to prevent kernel-doc warnings: sa1111.c:802: warning: Function parameter or member 'me' not described in '__sa1111_probe' sa1111.c:802: warning: Function parameter or member 'mem' not described in '__sa1111_probe' sa1111.c:802: warning: Function parameter or member 'irq' not described in '__sa1111_probe' sa1111.c:802: warning: expecting prototype for sa1111_probe(). Prototype was for __sa1111_probe() instead Also, use ReST list format to enumerate the return values. Link: https://lore.kernel.org/oe-kbuild-all/202308112255.SK1J0rze-lkp@intel.com/ Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: linux-arm-kernel@lists.infradead.org Cc: patches@armlinux.org.uk Signed-off-by: Russell King (Oracle) commit 067878e6cd25e071106eb7998165dd3cb46ff2ce Author: Sinthu Raja Date: Thu Sep 21 15:30:39 2023 +0530 arm64: dts: ti: k3-am68-sk: Add DT node for USB AM68 Starter kit has a USB3 hub that connects to the SerDes0 Lane 2. Update the SerDes configuration to support USB3. Signed-off-by: Sinthu Raja Signed-off-by: Ravi Gunasekaran Link: https://lore.kernel.org/r/20230921100039.19897-4-r-gunasekaran@ti.com Signed-off-by: Vignesh Raghavendra commit 73e8ec1b2d101fb030f6906c9d2799bea80e3804 Author: Sinthu Raja Date: Thu Sep 21 15:30:38 2023 +0530 arm64: dts: ti: k3-am68-sk: Add DT node for PCIe AM68 Starter kit features with one PCIe M.2 Key M connector interfaced via two SerDes lanes. Update the SerDes configuration for PCIe. Signed-off-by: Sinthu Raja Signed-off-by: Ravi Gunasekaran Link: https://lore.kernel.org/r/20230921100039.19897-3-r-gunasekaran@ti.com Signed-off-by: Vignesh Raghavendra commit b024d1a853b7bc8e2e01aa9a219d81a9df1a2ceb Author: Sinthu Raja Date: Thu Sep 21 15:30:37 2023 +0530 arm64: dts: ti: Add USB Type C swap defines for J721S2 SoC Lanes 0 and 2 of the J721S2 SerDes WIZ are reserved for USB type-C lane swap. Update the macro definition for it. Signed-off-by: Sinthu Raja Signed-off-by: Ravi Gunasekaran Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230921100039.19897-2-r-gunasekaran@ti.com Signed-off-by: Vignesh Raghavendra commit c2e7258dbd451fff84fac2375aaec2f56f57f0b3 Author: Apurva Nandan Date: Sun Oct 1 23:44:17 2023 +0530 arm64: dts: ti: k3-am69-sk: Add DDR carveout memory nodes for C71x DSP Two carveout reserved memory nodes each have been added for each of the C71x DSP for the TI K3 AM69 SK boards. These nodes are assigned to the respective rproc device nodes as well. The first region will be used as the DMA pool for the rproc device, and the second region will furnish the static carveout regions for the firmware memory. The current carveout addresses and sizes are defined statically for each device. The C71x DSP processor supports a MMU called CMMU, but is not currently supported and as such requires the exact memory used by the firmware to be set-aside. Signed-off-by: Sinthu Raja Signed-off-by: Apurva Nandan Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20231001181417.743306-10-a-nandan@ti.com Signed-off-by: Vignesh Raghavendra commit 567f75ab67d0d1b5ef4a2ca9d28f23e0876e1d61 Author: Apurva Nandan Date: Sun Oct 1 23:44:16 2023 +0530 arm64: dts: ti: k3-am69-sk: Add DDR carveout memory nodes for R5F Two carveout reserved memory nodes each have been added for each of the R5F remote processor device within both the MCU and MAIN domains for the TI K3 AM69 SK boards. These nodes are assigned to the respective rproc device nodes as well. The first region will be used as the DMA pool for the rproc device, and the second region will furnish the static carveout regions for the firmware memory. The current carveout addresses and sizes are defined statically for each device. The R5F processors do not have an MMU, and as such require the exact memory used by the firmwares to be set-aside. The firmware images do not require any RSC_CARVEOUT entries in their resource tables either to allocate the memory for firmware memory segments. Note that the R5F1 carveouts are needed only if the R5F cluster is running in Split (non-LockStep) mode. The reserved memory nodes can be disabled later on if there is no use-case defined to use the corresponding remote processor. Signed-off-by: Sinthu Raja Signed-off-by: Apurva Nandan Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20231001181417.743306-9-a-nandan@ti.com Signed-off-by: Vignesh Raghavendra commit 89e788b71b96f07be99b21107167c4f185b96405 Author: Apurva Nandan Date: Sun Oct 1 23:44:15 2023 +0530 arm64: dts: ti: k3-am68-sk-som: Add DDR carveout memory nodes for C71x DSP Two carveout reserved memory nodes each have been added for each of the C71x DSP for the TI K3 AM68 SK boards. These nodes are assigned to the respective rproc device nodes as well. The first region will be used as the DMA pool for the rproc device, and the second region will furnish the static carveout regions for the firmware memory. The current carveout addresses and sizes are defined statically for each device. The C71x DSP processor supports a MMU called CMMU, but is not currently supported and as such requires the exact memory used by the firmware to be set-aside. Signed-off-by: Sinthu Raja Signed-off-by: Apurva Nandan Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20231001181417.743306-8-a-nandan@ti.com Signed-off-by: Vignesh Raghavendra commit 641d62f2012d99a7dc739bb1bd5718e149fd80ed Author: Apurva Nandan Date: Sun Oct 1 23:44:14 2023 +0530 arm64: dts: ti: k3-am68-sk-som: Add DDR carveout memory nodes for R5F Two carveout reserved memory nodes each have been added for each of the R5F remote processor device within both the MCU and MAIN domains for the TI K3 AM68 SK boards. These nodes are assigned to the respective rproc device nodes as well. The first region will be used as the DMA pool for the rproc device, and the second region will furnish the static carveout regions for the firmware memory. The current carveout addresses and sizes are defined statically for each device. The R5F processors do not have an MMU, and as such require the exact memory used by the firmwares to be set-aside. The firmware images do not require any RSC_CARVEOUT entries in their resource tables either to allocate the memory for firmware memory segments. Note that the R5F1 carveouts are needed only if the R5F cluster is running in Split (non-LockStep) mode. The reserved memory nodes can be disabled later on if there is no use-case defined to use the corresponding remote processor. Signed-off-by: Sinthu Raja Signed-off-by: Apurva Nandan Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20231001181417.743306-7-a-nandan@ti.com Signed-off-by: Vignesh Raghavendra commit 35fa951c89f6abcb74f73643940b2656c0921353 Author: Apurva Nandan Date: Sun Oct 1 23:44:13 2023 +0530 arm64: dts: ti: k3-j721s2-som-p0: Add DDR carveout memory nodes for C71x DSPs Two carveout reserved memory nodes each have been added for each of the C71x DSP for the TI J721S2 EVM boards. These nodes are assigned to the respective rproc device nodes as well. The first region will be used as the DMA pool for the rproc device, and the second region will furnish the static carveout regions for the firmware memory. The current carveout addresses and sizes are defined statically for each device. The C71x DSP processor supports a MMU called CMMU, but is not currently supported and as such requires the exact memory used by the firmware to be set-aside. Signed-off-by: Hari Nagalla Signed-off-by: Apurva Nandan Reviewed-by: Andrew Davis Link: https://lore.kernel.org/r/20231001181417.743306-6-a-nandan@ti.com Signed-off-by: Vignesh Raghavendra commit 3328b0419815bcc0c6d93c66f9c11eefca42a59b Author: Apurva Nandan Date: Sun Oct 1 23:44:12 2023 +0530 arm64: dts: ti: k3-j721s2-som-p0: Add DDR carveout memory nodes for R5F Two carveout reserved memory nodes each have been added for each of the R5F remote processor device within both the MCU and MAIN domains for the TI J721S2 EVM boards. These nodes are assigned to the respective rproc device nodes as well. The first region will be used as the DMA pool for the rproc device, and the second region will furnish the static carveout regions for the firmware memory. The current carveout addresses and sizes are defined statically for each device. The R5F processors do not have an MMU, and as such require the exact memory used by the firmwares to be set-aside. The firmware images do not require any RSC_CARVEOUT entries in their resource tables either to allocate the memory for firmware memory segments. Note that the R5F1 carveouts are needed only if the R5F cluster is running in Split (non-LockStep) mode. The reserved memory nodes can be disabled later on if there is no use-case defined to use the corresponding remote processor. Signed-off-by: Hari Nagalla Signed-off-by: Apurva Nandan Reviewed-by: Andrew Davis Link: https://lore.kernel.org/r/20231001181417.743306-5-a-nandan@ti.com Signed-off-by: Vignesh Raghavendra commit fad9312e432db993ea47947db53dde85462967c1 Author: Apurva Nandan Date: Sun Oct 1 23:44:11 2023 +0530 arm64: dts: ti: k3-j721s2-main: Add C7x remote processsor nodes The K3 J721S2 SoCs have two C71x DSP subsystems in MAIN voltage domain. The C71x DSPs are 64 bit machine with fixed and floating point DSP operations. Similar to the R5F remote cores, the inter-processor communication between the main A72 cores and these DSP cores is achieved through shared memory and Mailboxes. The following firmware names are used by default for these DSP cores, and can be overridden in a board dts file if desired: MAIN C71_0 : j721s2-c71_0-fw MAIN C71_1 : j721s2-c71_1-fw Signed-off-by: Hari Nagalla Signed-off-by: Apurva Nandan Reviewed-by: Andrew Davis Link: https://lore.kernel.org/r/20231001181417.743306-4-a-nandan@ti.com Signed-off-by: Vignesh Raghavendra commit 9a7b145b0ecdc7db7f06eb7edb1c2ed5e8f9a3b7 Author: Apurva Nandan Date: Sun Oct 1 23:44:10 2023 +0530 arm64: dts: ti: k3-j721s2-main: Add MAIN R5F remote processsor nodes The J721S2 SoCs have 2 dual-core Arm Cortex-R5F processor (R5FSS) subsystems/clusters in MAIN voltage domain. Each of these can be configured at boot time to be either run in a LockStep mode or in an Asymmetric Multi Processing (AMP) fashion in Split-mode. These subsystems have 64 KB each Tightly-Coupled Memory (TCM) internal memories for each core split between two banks - ATCM and BTCM (further interleaved into two banks). The TCMs of both Cores are combined in LockStep-mode to provide a larger 128 KB of memory, but otherwise are functionally similar to those on J721E SoCs. Add the DT nodes for the MAIN domain R5F cluster/subsystems, the two R5F cores are added as child nodes to each of the R5F cluster nodes. The clusters are configured to run in LockStep mode by default, with the ATCMs enabled to allow the R5 cores to execute code from DDR with boot-strapping code from ATCM. The inter-processor communication between the main A72 cores and these processors is achieved through shared memory and Mailboxes. The following firmware names are used by default for these cores, and can be overridden in a board dts file if desired: MAIN R5FSS0 Core0: j721s2-main-r5f0_0-fw (both in LockStep & Split mode) MAIN R5FSS0 Core1: j721s2-main-r5f0_1-fw (needed only in Split mode) MAIN R5FSS1 Core0: j721s2-main-r5f1_0-fw (both in LockStep & Split mode) MAIN R5FSS1 Core1: j721s2-main-r5f1_1-fw (needed only in Split mode) Signed-off-by: Hari Nagalla Signed-off-by: Apurva Nandan Reviewed-by: Andrew Davis Link: https://lore.kernel.org/r/20231001181417.743306-3-a-nandan@ti.com Signed-off-by: Vignesh Raghavendra commit 1b70e86cb8506f358437ce9dccab8b9746c61e5d Author: Apurva Nandan Date: Sun Oct 1 23:44:09 2023 +0530 arm64: dts: ti: k3-j721s2-mcu: Add MCU R5F cluster nodes The J721S2 SoCs have a dual-core Arm Cortex-R5F processor (R5FSS) subsystems/cluster in MCU voltage domain. It can be configured at boot time to be either run in a LockStep mode or in an Asymmetric Multi Processing (AMP) fashion in Split-mode. These subsystems have 64 KB each Tightly-Coupled Memory (TCM) internal memories for each core split between two banks - ATCM and BTCM (further interleaved into two banks). The TCMs of both Cores are combined in LockStep-mode to provide a larger 128 KB of memory, but otherwise are functionally similar to those on J721E SoCs. Add the DT nodes for the MCU domain R5F cluster/subsystem, the two R5F cores are added as child nodes to each of the R5F cluster nodes. The clusters are configured to run in LockStep mode by default, with the ATCMs enabled to allow the R5 cores to execute code from DDR with boot-strapping code from ATCM. The inter-processor communication between the main A72 cores and these processors is achieved through shared memory and Mailboxes. The following firmware names are used by default for these cores, and can be overridden in a board dts file if desired: MCU R5FSS0 Core0: j721s2-mcu-r5f0_0-fw (both in LockStep and Split mode) MCU R5FSS0 Core1: j721s2-mcu-r5f0_1-fw (needed only in Split mode) Signed-off-by: Hari Nagalla Signed-off-by: Apurva Nandan Reviewed-by: Andrew Davis Link: https://lore.kernel.org/r/20231001181417.743306-2-a-nandan@ti.com Signed-off-by: Vignesh Raghavendra commit 0997638a7580fc53e2162a480c8be521196f1319 Author: Neha Malcom Francis Date: Tue Sep 26 19:58:10 2023 +0530 arm64: dts: ti: k3-j721e-mcu-wakeup: Add MCU domain ESM instance Currently J721E defines only the main_esm in DTS. Add node for mcu_esm as well. According to J721E TRM (12.11.2.2 ESM Environment) [1], we see that the interrupt line from ESMi (main_esm) is routed to MCU_ESM (mcu_esm). This is MCU_ESM0_LVL_IN_95 with interrupt ID 95. Configure mcu_esm accordingly so that errors from main_esm are routed to mcu_esm and handled. [1] https://www.ti.com/lit/zip/spruil1 Signed-off-by: Neha Malcom Francis Reviewed-by: Udit Kumar Link: https://lore.kernel.org/r/20230926142810.602384-1-n-francis@ti.com Signed-off-by: Vignesh Raghavendra commit 33269ac0b768b07da017df173d52952625c57870 Author: Wadim Egorov Date: Mon Sep 25 17:14:44 2023 +0200 arm64: dts: ti: k3-am625-beagleplay: Fix typo in ramoops reg Seems like the address value of the reg property was mistyped. Update reg to 0x9ca00000 to match node's definition. Fixes: f5a731f0787f ("arm64: dts: ti: Add k3-am625-beagleplay") Signed-off-by: Wadim Egorov Reviewed-by: Nishanth Menon Link: https://lore.kernel.org/r/20230925151444.1856852-1-w.egorov@phytec.de Signed-off-by: Vignesh Raghavendra commit a716abbaa145d30653cee2f2644f9bd721117150 Author: Roger Quadros Date: Sat Sep 23 11:00:46 2023 +0300 arm64: dts: ti: k3-am64: Add GPIO expander on I2C0 A TCA9554 GPIO expander is present on I2C0. Add it. Signed-off-by: Roger Quadros Link: https://lore.kernel.org/r/20230923080046.5373-3-rogerq@kernel.org Signed-off-by: Vignesh Raghavendra commit 848f68c760ab1e14a9046ea6e45e3304ab9fa50b Author: André Apitzsch Date: Sun Oct 1 18:09:56 2023 +0200 iio: magnetometer: ak8975: Fix 'Unexpected device' error Explicity specify array indices to fix mapping between asahi_compass_chipset and ak_def_array. While at it, remove unneeded AKXXXX. Fixes: 4f9ea93afde1 ("iio: magnetometer: ak8975: Convert enum->pointer for data in the match tables") Signed-off-by: André Apitzsch Reviewed-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231001-ak_magnetometer-v1-1-09bf3b8798a3@apitzsch.eu Signed-off-by: Jonathan Cameron commit 5ddd8baa4857709b4e5d84b376d735152851955b Author: Steven Rostedt (Google) Date: Thu Oct 5 10:47:45 2023 -0400 tracing: Make system_callback() function static The system_callback() function in trace_events.c is only used within that file. The "static" annotation was missed. Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_inode") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310051743.y9EobbUr-lkp@intel.com/ Signed-off-by: Steven Rostedt (Google) commit 2819f23ac12ce93ff79ca7a54597df9a4a1f6331 Author: Steven Rostedt (Google) Date: Thu Oct 5 09:13:48 2023 -0400 eventfs: Use eventfs_remove_events_dir() The update to removing the eventfs_file changed the way the events top level directory was handled. Instead of returning a dentry, it now returns the eventfs_inode. In this changed, the removing of the events top level directory is not much different than removing any of the other directories. Because of this, the removal just called eventfs_remove_dir() instead of eventfs_remove_events_dir(). Although eventfs_remove_dir() does the clean up, it misses out on the dget() of the ei->dentry done in eventfs_create_events_dir(). It makes more sense to match eventfs_create_events_dir() with a specific function eventfs_remove_events_dir() and this specific function can then perform the dput() to the dentry that had the dget() when it was created. Fixes: 5790b1fb3d67 ("eventfs: Remove eventfs_file and just use eventfs_inode") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202310051743.y9EobbUr-lkp@intel.com/ Signed-off-by: Steven Rostedt (Google) commit b3a4dbc89d4021b3f90ff6a13537111a004f9d07 Author: Gabriel Krisman Bertazi Date: Wed Oct 4 20:05:31 2023 -0400 io_uring/kbuf: Use slab for struct io_buffer objects The allocation of struct io_buffer for metadata of provided buffers is done through a custom allocator that directly gets pages and fragments them. But, slab would do just fine, as this is not a hot path (in fact, it is a deprecated feature) and, by keeping a custom allocator implementation we lose benefits like tracking, poisoning, sanitizers. Finally, the custom code is more complex and requires keeping the list of pages in struct ctx for no good reason. This patch cleans this path up and just uses slab. I microbenchmarked it by forcing the allocation of a large number of objects with the least number of io_uring commands possible (keeping nbufs=USHRT_MAX), with and without the patch. There is a slight increase in time spent in the allocation with slab, of course, but even when allocating to system resources exhaustion, which is not very realistic and happened around 1/2 billion provided buffers for me, it wasn't a significant hit in system time. Specially if we think of a real-world scenario, an application doing register/unregister of provided buffers will hit ctx->io_buffers_cache more often than actually going to slab. Signed-off-by: Gabriel Krisman Bertazi Link: https://lore.kernel.org/r/20231005000531.30800-4-krisman@suse.de Signed-off-by: Jens Axboe commit f74c746e476b9dad51448b9a9421aae72b60e25f Author: Gabriel Krisman Bertazi Date: Wed Oct 4 20:05:30 2023 -0400 io_uring/kbuf: Allow the full buffer id space for provided buffers nbufs tracks the number of buffers and not the last bgid. In 16-bit, we have 2^16 valid buffers, but the check mistakenly rejects the last bid. Let's fix it to make the interface consistent with the documentation. Fixes: ddf0322db79c ("io_uring: add IORING_OP_PROVIDE_BUFFERS") Signed-off-by: Gabriel Krisman Bertazi Link: https://lore.kernel.org/r/20231005000531.30800-3-krisman@suse.de Signed-off-by: Jens Axboe commit ab69838e7c75b0edb699c1a8f42752b30333c46f Author: Gabriel Krisman Bertazi Date: Wed Oct 4 20:05:29 2023 -0400 io_uring/kbuf: Fix check of BID wrapping in provided buffers Commit 3851d25c75ed0 ("io_uring: check for rollover of buffer ID when providing buffers") introduced a check to prevent wrapping the BID counter when sqe->off is provided, but it's off-by-one too restrictive, rejecting the last possible BID (65534). i.e., the following fails with -EINVAL. io_uring_prep_provide_buffers(sqe, addr, size, 0xFFFF, 0, 0); Fixes: 3851d25c75ed ("io_uring: check for rollover of buffer ID when providing buffers") Signed-off-by: Gabriel Krisman Bertazi Link: https://lore.kernel.org/r/20231005000531.30800-2-krisman@suse.de Signed-off-by: Jens Axboe commit 1c61848f53180e18e725290991da453fc59c80a4 Author: David Lechner Date: Fri Sep 29 12:23:06 2023 -0500 dt-bindings: iio: resolver: add devicetree bindings for ad2s1210 This adds new DeviceTree bindings for the Analog Devices, Inc. AD2S1210 resolver-to-digital converter. Co-developed-by: Apelete Seketeli Signed-off-by: Apelete Seketeli Signed-off-by: David Lechner Acked-by: Michael Hennerich Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-1-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit 82bcca7b7fed9f3a6917401e366ac657ee96aae4 Author: Shubhrajyoti Datta Date: Thu Oct 5 15:42:41 2023 +0530 dt-bindings: memory-controllers: Add support for Xilinx Versal EDAC for DDRMC Add device tree bindings for Xilinx Versal EDAC for DDR controller. Co-developed-by: Sai Krishna Potthuri Signed-off-by: Sai Krishna Potthuri Signed-off-by: Shubhrajyoti Datta Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20231005101242.14621-2-shubhrajyoti.datta@amd.com commit 1731a0c492c806ba3678b6c1aa3081a77ca1abb3 Author: Justin Stitt Date: Thu Sep 21 04:54:00 2023 +0000 iio: adc: stm32-adc: Replace deprecated strncpy() with strscpy() strncpy() is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. We expect adc->chan_name[val] to be NUL-terminated based on ch_name's use within functions that expect NUL-terminated strings like strncmp and printf-likes: | if (!strncmp(stm32_adc_ic[i].name, ch_name, STM32_ADC_CH_SZ)) { | /* Check internal channel availability */ | switch (i) { | case STM32_ADC_INT_CH_VDDCORE: | if (!adc->cfg->regs->or_vddcore.reg) | dev_warn(&indio_dev->dev, | "%s channel not available\n", ch_name); ... There is no evidence that NUL-padding is needed either. Considering the above, a suitable replacement is strscpy() [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. If, for any reason, NUL-padding _is_ required we should go for `strscpy_pad`. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230921-strncpy-drivers-iio-adc-stm32-adc-c-v1-1-c50eca098597@google.com Signed-off-by: Jonathan Cameron commit d27425d5d8b1cd930a31b92fb426cdbcbf876b10 Author: George Stark Date: Fri Jul 21 13:23:09 2023 +0300 iio: adc: meson: improve error logging at probe stage Add log messages for errors that may occur at the probe stage Signed-off-by: George Stark Link: https://lore.kernel.org/r/20230721102413.255726-3-gnstark@sberdevices.ru Signed-off-by: Jonathan Cameron commit 1c8af63782583ee9d3a95e971a26570ae3f25af6 Author: Matti Vaittinen Date: Thu Sep 28 11:45:39 2023 +0300 iio: kx022a: Support ROHM KX132ACR-LBZ dt-bindings: iio: Add KX132ACR-LBZ accelerometer ROHM KX132ACR-LBZ is an accelerometer for industrial applications. It has a subset of KX022A functionalities, dropping support for tap, free fall and tilt detection engines. Also, the register interface is an exact subset of what is found on KX022A (except the WHO_AM_I register value). Add support for KX132ACR-LBZ. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/272065b9f35b817aff86b7760ff1aaaaaaa969f5.1695879676.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit a68ad2062fb2fb227a022b0392398bb53fd75012 Author: Matti Vaittinen Date: Thu Sep 28 11:45:21 2023 +0300 dt-bindings: iio: Add KX132ACR-LBZ accelerometer ROHM KX132ACR-LBZ is an accelerometer for industrial applications. It has a subset of KX022A functionalities, dropping support for tap, free fall and tilt detection engines. Also, the register interface is an exact subset of what is found on KX022A. Extend the kionix,kx022a.yaml file to support the KX132ACR-LBZ device Signed-off-by: Matti Vaittinen Acked-by: Conor Dooley Link: https://lore.kernel.org/r/5c9e03ffad5e6e5970d6e71fb02eab4b652e109f.1695879676.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit e49075c7e9420b11b8e1aa8434e8790282df4a39 Author: Alisa-Dariana Roman Date: Mon Sep 25 00:51:47 2023 +0300 iio: adc: ad7192: Improve f_order computation Instead of using the f_order member of ad7192_state, a function that computes the f_order coefficient makes more sense. This coefficient is a function of the sinc filter and chop filter states. Remove f_order member of ad7192_state structure. Instead use ad7192_compute_f_order function to compute the f_order coefficient according to the sinc filter and chop filter states passed as parameters. Add ad7192_get_f_order function that returns the current f_order coefficient of the device. Add ad7192_compute_f_adc function that computes the f_adc value according to the sinc filter and chop filter states passed as parameters. Add ad7192_get_f_adc function that returns the current f_adc value of the device. Signed-off-by: Alisa-Dariana Roman Link: https://lore.kernel.org/r/20230924215148.102491-3-alisadariana@gmail.com Signed-off-by: Jonathan Cameron commit 874bbd1219c70b0d14881214c9768a0e4598fad5 Author: Alisa-Dariana Roman Date: Mon Sep 25 00:51:46 2023 +0300 iio: adc: ad7192: Use bitfield access macros Include bitfield.h and update driver to use bitfield access macros GENMASK, FIELD_PREP and FIELD_GET. Remove old macros in favor of using FIELD_PREP and masks. Change %d to %ld to match the type of FIELD_GET(). Signed-off-by: Alisa-Dariana Roman Link: https://lore.kernel.org/r/20230924215148.102491-2-alisadariana@gmail.com Signed-off-by: Jonathan Cameron commit 3b4e0e9677551806766a1ffd19a4a365c10f43d9 Author: Matti Vaittinen Date: Wed Sep 27 11:28:29 2023 +0300 MAINTAINERS: Add ROHM BM1390 Add myself as a maintainer for ROHM BM1390 pressure sensor driver. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/fb19d3027ac19663789e18d4dc972a5dac0fde74.1695727471.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 81ca5979b6ed9a2b49cf9e253a494e0777b0edf9 Author: Matti Vaittinen Date: Wed Sep 27 11:28:13 2023 +0300 iio: pressure: Support ROHM BU1390 Support for the ROHM BM1390 pressure sensor. The BM1390GLV-Z can measure pressures ranging from 300 hPa to 1300 hPa with configurable measurement averaging and internal FIFO. The sensor does also provide temperature measurements. Sensor does also contain IIR filter implemented in HW. The data-sheet says the IIR filter can be configured to be "weak", "middle" or "strong". Some RMS noise figures are provided in data sheet but no accurate maths for the filter configurations is provided. Hence, the IIR filter configuration is not supported by this driver and the filter is configured to the "middle" setting (at least not for now). The FIFO measurement mode is only measuring the pressure and not the temperature. The driver measures temperature when FIFO is flushed and simply uses the same measured temperature value to all reported temperatures. This should not be a problem when temperature is not changing very rapidly (several degrees C / second) but allows users to get the temperature measurements from sensor without any additional logic. This driver allows the sensor to be used in two muitually exclusive ways, 1. With trigger (data-ready IRQ). In this case the FIFO is not used as we get data ready for each collected sample. Instead, for each data-ready IRQ we read the sample from sensor and push it to the IIO buffer. 2. With hardware FIFO and watermark IRQ. In this case the data-ready is not used but we enable watermark IRQ. At each watermark IRQ we go and read all samples in FIFO and push them to the IIO buffer. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/4f23211e3cf248f9f48ddb2a752387bb00e9c2c4.1695727471.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 62593189b66ac6b5b69d2cf5b90728cc65a8fd68 Author: Matti Vaittinen Date: Wed Sep 27 11:27:57 2023 +0300 dt-bindings: Add ROHM BM1390 pressure sensor BM1390GLV-Z is a pressure sensor which performs internal temperature compensation for the MEMS. Pressure range is from 300 hPa to 1300 hPa and sample averaging and IIR filtering is built in sensor. Temperature measurement is also supported. Add dt-bindings for the sensor. Signed-off-by: Matti Vaittinen Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/08796e6b28d2c67933b1a1a5eca0f43da322a597.1695727471.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit 8a76356e7db02ec7b1913db06605e70294d94672 Author: Matti Vaittinen Date: Wed Sep 27 11:27:41 2023 +0300 iio: improve doc for available_scan_mask The available_scan_mask is an array of bitmaps representing the channels which can be simultaneously enabled by the driver. In many cases, the hardware can offer more channels than what the user is interested in obtaining. In such cases, it may be preferred that only a subset of channels are enabled, and the driver reads only a subset of the channels from the hardware. Some devices can't support all channel combinations. For example, the BM1390 pressure sensor must always read the pressure data in order to acknowledge the watermark IRQ, while reading temperature can be omitted. So, the available scan masks would be 'pressure and temperature' and 'pressure only'. When IIO searches for the scan mask it asks the driver to use, it will pick the first suitable one from the 'available_scan_mask' array. Hence, ordering the masks in the array makes a difference. We should 'prefer' reading just the pressure from the hardware (as it is a cheaper operation than reading both pressure and temperature) over reading both pressure and temperature. Hence, we should set the 'only pressure' as the first scan mask in available_scan_mask array. If we set the 'pressure and temperature' as first in the array, then the 'only temperature' will never get used as 'pressure and temperature' can always serve the user's needs. Add (minimal) kerneldoc to the 'available_scan_mask' to hint the user that the ordering of masks matters. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/4e43bf0186df5c8a56b470318b4827605f9cad6c.1695727471.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron commit c48fb9f956081d663bc8cfe3df32c59d2e869bea Author: Andreas Kemnade Date: Wed Sep 27 19:32:44 2023 +0200 iio: imu: mpu6050: add level shifter flag Some boards fail in magnetometer probe if level shifter flag is not set, definition was found in the vendor Linux kernel v3.0. Signed-off-by: Andreas Kemnade Reviewed-by: Andy Shevchenko Acked-by: Jean-Baptiste Maneyrol Link: https://lore.kernel.org/r/20230927173245.2151083-3-andreas@kemnade.info Signed-off-by: Jonathan Cameron commit 14114c8a747e12c169550d1806f8f87345480448 Author: Andreas Kemnade Date: Wed Sep 27 19:32:43 2023 +0200 dt-bindings: iio: imu: mpu6050: Add level shifter Add a level shifter flag as found in ancient platform data struct: level_shifter: 0: VLogic, 1: VDD Signed-off-by: Andreas Kemnade Acked-by: Rob Herring Acked-by: Jean-Baptiste Maneyrol Link: https://lore.kernel.org/r/20230927173245.2151083-2-andreas@kemnade.info Signed-off-by: Jonathan Cameron commit 67142d6f1e2fd97c035a42612b5b28809dc5f6ea Author: Antoniu Miclaus Date: Tue Sep 26 13:01:49 2023 +0300 MAINTAINERS: fix Analog Devices website link The http://ez.analog.com/community/linux-device-drivers link is broken. Update website link to the new available one: https://ez.analog.com/linux-software-drivers Signed-off-by: Antoniu Miclaus Link: https://lore.kernel.org/r/20230926100149.4611-1-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron commit d2d1ecc67c48caf479319c4e1ab3d7896f826429 Author: Ramona Gradinariu Date: Tue Sep 26 11:57:21 2023 +0300 iio: imu: adis16475: Add buffer padding after temp channel The temperature channel has 16-bit storage size. We need to perform the padding to have the buffer elements naturally aligned in case the temperature channel is enabled and there are any 32-bit storage size channels enabled which have a scan index higher than the temperature channel scan index. Fixes: 8f6bc87d67c0 ("iio: imu: adis16475.c: Add delta angle and delta velocity channels") Signed-off-by: Ramona Gradinariu Reviewed-by: Nuno Sa Link: https://lore.kernel.org/r/20230926085721.645687-2-ramona.gradinariu@analog.com Signed-off-by: Jonathan Cameron commit 500d7640f63d557c397f74b7d5bf8c81377b50b3 Author: David Lechner Date: Fri Sep 29 12:23:21 2023 -0500 staging: iio: resolver: ad2s1210: read excitation frequency from control register This modifies the ad2s1210_show_fexcit() function to read the excitation frequency from the control register. This way we don't have to keep track of the value and don't risk returning a stale value. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-16-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit de69623c7cc7b960ee5bec134707bf6567199fc9 Author: David Lechner Date: Fri Sep 29 12:23:20 2023 -0500 staging: iio: resolver: ad2s1210: refactor setting excitation frequency This combines the ad2s1210_update_frequency_control_word() and ad2s1210_soft_reset() functions into a single function since they both have to be called together. (The software reset does not reset any configuration registers, it only updates the excitation output and resets the tracking loop.) Also clean up a few things while touching this: - move AD2S1210_DEF_EXCIT macro with similar macros - remove unnecessary dev_err() calls Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-15-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit 168115f989311867b48292f4f056eb2f96cef67b Author: David Lechner Date: Fri Sep 29 12:23:18 2023 -0500 staging: iio: resolver: ad2s1210: rework gpios - Remove "adi," prefix from gpio names. - Sample gpio is now expected to be active low. - Convert A0 and A1 gpios to "mode-gpios" gpio array. - Convert RES0 and RES1 gpios to "resolution-gpios" gpio array. - Remove extraneous lookup tables. - Remove unused mode field from state struct. - Swap argument order of ad2s1210_set_mode() while we are touching this. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-13-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit 647d5c5a9e7672e285f54f0e141ee759e69382f2 Author: Ilkka Koskinen Date: Wed Sep 13 16:39:40 2023 -0700 perf: arm_cspmu: Support implementation specific validation Some platforms may use e.g. different filtering mechanism and, thus, may need different way to validate the events and group. Signed-off-by: Ilkka Koskinen Reviewed-by: Jonathan Cameron Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230913233941.9814-4-ilkka@os.amperecomputing.com Signed-off-by: Will Deacon commit 0a7603ab242e9bab530227cf0d0d344d4e334acc Author: Ilkka Koskinen Date: Wed Sep 13 16:39:39 2023 -0700 perf: arm_cspmu: Support implementation specific filters ARM Coresight PMU architecture specification [1] defines PMEVTYPER and PMEVFILT* registers as optional in Chapter 2.1. Moreover, implementers may choose to use PMIMPDEF* registers (offset: 0xD80-> 0xDFF) to filter the events. Add support for those by adding implementation specific filter callback function. [1] https://developer.arm.com/documentation/ihi0091/latest Signed-off-by: Ilkka Koskinen Reviewed-by: Besar Wicaksono Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230913233941.9814-3-ilkka@os.amperecomputing.com Signed-off-by: Will Deacon commit 8c282414ca6209977cb6d6cc66470ca2d1e56bf6 Author: Ilkka Koskinen Date: Wed Sep 13 16:39:38 2023 -0700 perf: arm_cspmu: Split 64-bit write to 32-bit writes Split the 64-bit register accesses if 64-bit access is not supported by the PMU. Signed-off-by: Ilkka Koskinen Reviewed-by: Besar Wicaksono Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20230913233941.9814-2-ilkka@os.amperecomputing.com Signed-off-by: Will Deacon commit e2272bfb18ee7010790ed53690fa3f62cfde30c5 Author: Jani Nikula Date: Wed Oct 4 19:21:49 2023 +0300 drm/dp: switch drm_dp_downstream_*() helpers to struct drm_edid Prefer struct drm_edid where possible. With limited users for the drm_dp_downstream_*() helpers, this is fairly straightforward. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231004162149.2802113-1-jani.nikula@intel.com commit bfc653aa89cb05796d7b4e046600accb442c9b7a Author: Besar Wicaksono Date: Mon Aug 21 18:16:08 2023 -0500 perf: arm_cspmu: Separate Arm and vendor module Arm Coresight PMU driver consists of main standard code and vendor backend code. Both are currently built as a single module. This patch adds vendor registration API to separate the two to keep things modular. The main driver requests each known backend module during initialization and defer device binding process. The backend module then registers an init callback to the main driver and continue the device driver binding process. Signed-off-by: Besar Wicaksono Reviewed-by: Suzuki K Poulose Reviewed-and-tested-by: Ilkka Koskinen Link: https://lore.kernel.org/r/20230821231608.50911-1-bwicaksono@nvidia.com Signed-off-by: Will Deacon commit 09cfdb5a97b53d117682211a4d32a39af2e819e4 Author: Claudiu Beznea Date: Fri Sep 29 08:39:15 2023 +0300 arm64: defconfig: Enable RZ/G3S (R9A08G045) SoC Enable the config flag for the Renesas RZ/G3S (R9A08G045) SoC. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-29-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit c083e9daf4a6f5bc61c5a0eb3ba3e229271fc624 Author: Wolfram Sang Date: Wed Oct 4 17:27:51 2023 +0200 arm64: dts: renesas: ebisu: Document Ebisu-4D support Document properly that Ebisu-support includes the Ebisu-4D variant, so there won't be confusion what happened with support for this board. Signed-off-by: Wolfram Sang Acked-by: Rob Herring Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20231004152751.3917-1-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 93be50c7ff8e8087d5a3ff5a4ff2ffc5dbb1c9b2 Author: Kuninori Morimoto Date: Tue Oct 3 02:33:49 2023 +0000 arm64: dts: renesas: Add R-Car S4 Starter Kit support Add initial support for the R-Car S4 Starter Kit with R8A779F4 SoC support. Based on a patch in the BSP. Signed-off-by: Michael Dege Signed-off-by: Yusuke Goda Signed-off-by: Tam Nguyen Signed-off-by: Hai Pham Co-developed-by: Yoshihiro Shimoda Signed-off-by: Yoshihiro Shimoda Signed-off-by: Kuninori Morimoto Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/87pm1wfn8z.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven commit 92c4f314065a3b63ea6c2d6ac44e867e34031cd0 Author: Kuninori Morimoto Date: Tue Oct 3 02:33:42 2023 +0000 arm64: dts: renesas: Add Renesas R8A779F4 SoC support The R8A779F4 (R-Car S4-8) SoC is an updated version of R8A779F0. Add support for it, using the r8a779f0 .dtsi internally. Signed-off-by: Kuninori Morimoto Reviewed-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/87r0mcfn95.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven commit 177e2ee9a967d410b6daeff7a5b85f96bb833a2e Author: Claudiu Beznea Date: Fri Sep 29 08:39:14 2023 +0300 arm64: dts: renesas: Add initial device tree for RZ/G3S SMARC EVK board Add the initial device tree for the Renesas RZ/G3S SMARC EVK board. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-28-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit d1ae4200bb268fda8cf885e053306c2bd7deb62a Author: Claudiu Beznea Date: Fri Sep 29 08:39:12 2023 +0300 arm64: dts: renesas: Add initial device tree for RZ SMARC Carrier-II Board Add the initial device tree for the RZ SMARC Carrier-II. At the moment it contains only the serial interface. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-26-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit adb4f0c5699c45d0034abde786e748250705a3b6 Author: Claudiu Beznea Date: Fri Sep 29 08:39:11 2023 +0300 arm64: dts: renesas: Add initial support for RZ/G3S SMARC SoM Add initial support for the RZ/G3S SMARC SoM. The following devices available on the SoM are added to this initial device tree: - RZ/G3S SoC: Renesas R9A08G045S33GBG - Clock Generator (only 24MHz output): Renesas 5L35023B - 1GiB LPDDR4 SDRAM: Micron MT53D512M16D1DS-046 - 64GB eMMC Flash (though SD ch0): Micron MTFC64GBCAQTC SD channel 0 of RZ/G3S is connected to an uSD card interface and an eMMC. The selection b/w them is done through a hardware switch. The DT will select b/w uSD and eMMC through the SW_SD0_DEV_SEL build flag. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-25-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit e20396d65b959a65be84e0eda3c106360114b7ae Author: Claudiu Beznea Date: Fri Sep 29 08:39:09 2023 +0300 arm64: dts: renesas: Add initial DTSI for RZ/G3S SoC Add the initial DTSI for the RZ/G3S SoC. The files in this commit have the following meaning: - r9a08g045.dtsi: RZ/G3S family SoC common parts - r9a08g045s33.dtsi: RZ/G3S R0A08G045S33 SoC specific parts Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-23-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 66ffb01b263924d136ae4899727477d4ff0ea440 Merge: bfef0760d2475 e372aee8c2495 Author: Geert Uytterhoeven Date: Thu Oct 5 14:28:26 2023 +0200 Merge tag 'renesas-r9a08g045-dt-binding-defs-tag' into renesas-dts-for-v6.7 Renesas RZ/G3S DT Binding Definitions Clock definitions for the Renesas RZ/G3S (R9A08G045) SoC, shared by driver and DT source files. commit bfef0760d247550318a4a4a71ae472875caf711c Author: Lad Prabhakar Date: Fri Sep 29 01:07:02 2023 +0100 riscv: dts: renesas: rzfive-smarc: Enable the blocks which were explicitly disabled Now that noncoherent dma support for the RZ/Five SoC has been added, enable the IP blocks which were disabled on the RZ/Five SMARC. This adds support for the below peripherals: * Ethernet * DMAC * SDHI * USB * RSPI * SSI Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929000704.53217-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 9e40584dc2592edbd35485731c3e9ab1291e6a13 Author: Lad Prabhakar Date: Fri Sep 29 01:07:01 2023 +0100 riscv: dts: renesas: r9a07g043f: Add dma-noncoherent property RZ/Five is a noncoherent SoC so to indicate this add dma-noncoherent property to RZ/Five SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929000704.53217-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a38b1061d327c120844e5dc0217191b06ce3b25f Author: Lad Prabhakar Date: Fri Sep 29 01:07:00 2023 +0100 riscv: dts: renesas: r9a07g043f: Add L2 cache node Add L2 cache node for RZ/Five SoC. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929000704.53217-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 587c848ac3ea69fcecef7b4814c2a51bbda727a3 Author: Geert Uytterhoeven Date: Fri Sep 15 11:04:46 2023 +0200 ARM: dts: renesas: bockw: Add FLASH node Add a device node for the Spansion S29GL512P NOR FLASH on the Bock-W development board. This FLASH resides in the external address space of the Local Bus State Controller. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/45e6343ae07ef1add8bba5e8281ef9e6a977c573.1694768311.git.geert+renesas@glider.be commit feab6a13ae63101e62a9f3b0e552f13067218e6f Author: Biju Das Date: Fri Aug 25 10:05:18 2023 +0100 arm64: dts: renesas: rz-smarc: Use versa3 clk for audio mclk Currently audio mclk uses a fixed clk of 11.2896MHz (multiple of 44.1kHz). Replace this fixed clk with the programmable versa3 clk that can provide the clocking to support both 44.1kHz (with a clock of 11.2896MHz) and 48kHz (with a clock of 12.2880MHz), based on audio sampling rate for playback and record. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230825090518.87394-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 75b696a43fdd1740359cf967a6cbc9ae06fb616d Merge: d70be079c3cf3 a47b44fbb13f5 Author: Geert Uytterhoeven Date: Thu Oct 5 14:21:59 2023 +0200 Merge tag 'clk-fixes-for-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux into renesas-dts-for-v6.7 Adding versa3 clock generator nodes to DTS depends on the fixed clock index handling: - Fix the binding for versaclock3 that was introduced this merge window so we know what the values are for clk consumers commit eb7581deb4c2eef77f6368e1891e123b69349bb0 Author: Andy Shevchenko Date: Tue Sep 12 19:53:12 2023 +0300 resource: Constify resource crosscheck APIs Constify APIs: _contains(), _overlaps(), _intersection(), _union(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230912165312.402422-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 10dabdf45ed34caaaad97978306fe6e9ee7581d9 Author: Andy Shevchenko Date: Tue Sep 12 19:53:11 2023 +0300 resource: Unify next_resource() and next_resource_skip_children() We have the next_resource() is used once and no user for the next_resource_skip_children() outside of the for_each_resource(). Unify them by adding skip_children parameter to the next_resource(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230912165312.402422-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 441f0dd8fa035a2c7cfe972047bb905d3be05c1b Author: Andy Shevchenko Date: Tue Sep 12 19:53:10 2023 +0300 resource: Reuse for_each_resource() macro We have a few places where for_each_resource() is open coded. Replace that by the macro. This makes code easier to read and understand. With this, compile r_next() only for CONFIG_PROC_FS=y. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230912165312.402422-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d712d205210c494c29f33dc1d1f2ce4d7448faa9 Author: Ivan Orlov Date: Thu Aug 10 23:51:03 2023 +0400 rapidio: make all 'class' structures const Now that the driver core allows for struct class to be in read-only memory, making all 'class' structures to be declared at build time placing them into read-only memory, instead of having to be dynamically allocated at load time. Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Link: https://lore.kernel.org/r/20230810195103.27069-1-ivan.orlov0322@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3e8008fcf6b7f7c65ad2718c18fb79f37007f1a5 Author: Claudiu Beznea Date: Fri Sep 29 08:38:56 2023 +0300 clk: renesas: rzg2l: Remove CPG_SDHI_DSEL from generic header Remove CPG_SDHI_DSEL and its bits from the generic header as RZ/G3S has different offset registers and bits for this, thus avoid mixing them. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-10-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 97c1c4ccda76d2919775d748cf223637cf0e82ae Author: Claudiu Beznea Date: Fri Sep 29 08:38:55 2023 +0300 clk: renesas: rzg2l: Add struct clk_hw_data Add clk_hw_data struct that keeps the core part of the clock data. sd_hw_data embeds a member of type struct clk_hw_data along with other members (in the next commits). This commit prepares the field for refactoring the SD MUX clock driver. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-9-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 01eabef547e63d80086acd3f247d36c5f9f92456 Author: Claudiu Beznea Date: Fri Sep 29 08:38:54 2023 +0300 clk: renesas: rzg2l: Add support for RZ/G3S PLL Add support for reading the frequency of PLL1/4/6 as available on RZ/G3S. The computation formula for the PLL frequency is as follows: Fout = (nir + nfr / 4096) * Fin / (mr * pr) Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-8-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 5f710e3bc5987373737470f98798bbd49134a2e0 Author: Claudiu Beznea Date: Fri Sep 29 08:38:53 2023 +0300 clk: renesas: rzg2l: Remove critical area The spinlock in rzg2l_mod_clock_endisable() is intended to protect RMW-accesses to the hardware register. There is no need to protect instructions that set temporary variables which will be written afterwards to a hardware register. With this only one write to one clock register is executed thus locking/unlocking rmw_lock is removed. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-7-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a2b23159499efd36b2d63b3c4534075d12ddc97a Author: Claudiu Beznea Date: Fri Sep 29 08:38:52 2023 +0300 clk: renesas: rzg2l: Fix computation formula According to the hardware manual for RZ/G2L (r01uh0914ej0130-rzg2l-rzg2lc.pdf), the computation formula for PLL rate is as follows: Fout = ((m + k/65536) * Fin) / (p * 2^s) and k has values in the range [-32768, 32767]. Dividing k by 65536 with integer arithmetic gives zero all the time, causing slight differences b/w what has been set vs. what is displayed. Thus, get rid of this and decompose the formula before dividing k by 65536. Fixes: ef3c613ccd68a ("clk: renesas: Add CPG core wrapper for RZ/G2L SoC") Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-6-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit bf51d3b2d048c312764a55d91d67a85ee5535e31 Author: Claudiu Beznea Date: Fri Sep 29 08:38:51 2023 +0300 clk: renesas: rzg2l: Trust value returned by hardware The onitial value of the CPG_PL2SDHI_DSEL bits 0..1 or 4..6 is 01b. The hardware user's manual (r01uh0914ej0130-rzg2l-rzg2lc.pdf) specifies that setting 0 is prohibited. Hence rzg2l_cpg_sd_clk_mux_get_parent() should just read CPG_PL2SDHI_DSEL, trust the value, and return the proper clock parent index based on the value read. Fixes: eaff33646f4cb ("clk: renesas: rzg2l: Add SDHI clk mux support") Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-5-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit d2692ed490e680a41401cef879adebcfafb4298f Author: Claudiu Beznea Date: Fri Sep 29 08:38:50 2023 +0300 clk: renesas: rzg2l: Lock around writes to mux register The SD MUX output (SD0) is further divided by 4 in G2{L,UL}. The divided clock is SD0_DIV4. SD0_DIV4 is registered with CLK_SET_RATE_PARENT which means a rate request for it is propagated to the MUX and could reach rzg2l_cpg_sd_clk_mux_set_parent() concurrently with the users of SD0. Add proper locking to avoid concurrent accesses on SD MUX set rate registers. Fixes: eaff33646f4cb ("clk: renesas: rzg2l: Add SDHI clk mux support") Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-4-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 549f4ae2601f968e2474c6031fb4799468882f64 Author: Claudiu Beznea Date: Fri Sep 29 08:38:49 2023 +0300 clk: renesas: rzg2l: Wait for status bit of SD mux before continuing The hardware user manual for RZ/G2L (r01uh0914ej0130-rzg2l-rzg2lc.pdf, chapter 7.4.7 Procedure for Switching Clocks by the Dynamic Switching Frequency Selectors) specifies that we need to check CPG_PL2SDHI_DSEL for SD clock switching status. Fixes: eaff33646f4cb ("clk: renesas: rzg2l: Add SDHI clk mux support") Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-3-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit d5252d9697a3e7007c741e9c103073868955a304 Author: Dirk Behme Date: Thu Sep 28 10:03:17 2023 +0200 clk: renesas: rcar-gen3: Extend SDnH divider table The clock dividers might be used with clock stop bit enabled or not. Current tables only support recommended values from the datasheet. This might result in warnings like below because no valid clock divider is found. Resulting in a 0 divider. There are Renesas ARM Trusted Firmware version out there which e.g. configure 0x201 (shifted logical right by 2: 0x80) and with this match the added { STPnHCK | 0, 1 }: https://github.com/renesas-rcar/arm-trusted-firmware/blob/rcar_gen3_v2.3/drivers/renesas/rcar/emmc/emmc_init.c#L108 ------------[ cut here ]------------ sd1h: Zero divisor and CLK_DIVIDER_ALLOW_ZERO not set WARNING: CPU: 1 PID: 1 at drivers/clk/clk-divider.c:141 divider_recalc_rate+0x48/0x70 Modules linked in: CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.1.52 #1 Hardware name: Custom board based on r8a7796 (DT) pstate: 40000005 (nZcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : divider_recalc_rate+0x48/0x70 ... ------------[ cut here ]------------ Fixes: bb6d3fa98a41 ("clk: renesas: rcar-gen3: Switch to new SD clock handling") Signed-off-by: Dirk Behme [wsa: extended the table to 5 entries, added comments, reword commit message a little] Signed-off-by: Wolfram Sang Tested-by: Dirk Behme Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230928080317.28224-1-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 4f01342464a8a99bf0cbb45a3ce4cf44a8baa1c5 Author: Hugo Villeneuve Date: Mon Sep 11 16:36:30 2023 -0400 Documentation: stable: clarify patch series prerequisites Add some clarifications for patches that have dependencies within the patch series. Signed-off-by: Hugo Villeneuve Rule: add Link: https://lore.kernel.org/stable/20230911203628.20068-1-hugo%40hugovil.com Link: https://lore.kernel.org/r/20230911203628.20068-1-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman commit 24de09c16f974dce70e2c56e3a4325117221ed12 Author: Valentine Sinitsyn Date: Mon Sep 25 11:40:13 2023 +0300 PCI: Implement custom llseek for sysfs resource entries Since commit 636b21b50152 ("PCI: Revoke mappings like devmem"), mmappable sysfs entries have started to receive their f_mapping from the iomem pseudo filesystem, so that CONFIG_IO_STRICT_DEVMEM is honored in sysfs (and procfs) as well as in /dev/[k]mem. This resulted in a userspace-visible regression: 1. Open a sysfs PCI resource file (eg. /sys/bus/pci/devices/*/resource0) 2. Use lseek(fd, 0, SEEK_END) to determine its size Expected result: a PCI region size is returned. Actual result: 0 is returned. The reason is that PCI resource files residing in sysfs use generic_file_llseek(), which relies on f_mapping->host inode to get the file size. As f_mapping is now redefined, f_mapping->host points to an anonymous zero-sized iomem_inode which has nothing to do with sysfs file in question. Implement a custom llseek method for sysfs PCI resources, which is almost the same as proc_bus_pci_lseek() used for procfs entries. This makes sysfs and procfs entries consistent with regards to seeking, but also introduces userspace-visible changes to seeking PCI resources in sysfs: - SEEK_DATA and SEEK_HOLE are no longer supported; - Seeking past the end of the file is prohibited while previously offsets up to MAX_NON_LFS were accepted (reading from these offsets was always invalid). Signed-off-by: Valentine Sinitsyn Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20230925084013.309399-2-valesini@yandex-team.ru Signed-off-by: Greg Kroah-Hartman commit 0fedefd4c4e33dd24f726b13b5d7c143e2b483be Author: Valentine Sinitsyn Date: Mon Sep 25 11:40:12 2023 +0300 kernfs: sysfs: support custom llseek method for sysfs entries As of now, seeking in sysfs files is handled by generic_file_llseek(). There are situations where one may want to customize seeking logic: - Many sysfs entries are fixed files while generic_file_llseek() accepts past-the-end positions. Not only being useless by itself, this also means a bug in userspace code will trigger not at lseek(), but at some later point making debugging harder. - generic_file_llseek() relies on f_mapping->host to get the file size which might not be correct for all sysfs entries. See commit 636b21b50152 ("PCI: Revoke mappings like devmem") as an example. Implement llseek method to override this behavior at sysfs attribute level. The method is optional, and if it is absent, generic_file_llseek() is called to preserve backwards compatibility. Signed-off-by: Valentine Sinitsyn Link: https://lore.kernel.org/r/20230925084013.309399-1-valesini@yandex-team.ru Signed-off-by: Greg Kroah-Hartman commit 1b057bd800c3ea0c926191d7950cd2365eddc9bb Author: Max Kellermann Date: Tue Sep 19 09:37:42 2023 +0200 drivers/char/mem: implement splice() for /dev/zero, /dev/full This allows splicing zeroed pages into a pipe, and allows discarding pages from a pipe by splicing them to /dev/zero. Writing to /dev/zero should have the same effect as writing to /dev/null, and a "splice_write" implementation exists only for /dev/null. (The /dev/zero splice_read implementation could be optimized by pushing references to the global zero page to the pipe, but that's an optimization for another day.) Signed-off-by: Max Kellermann Link: https://lore.kernel.org/r/20230919073743.1066313-1-max.kellermann@ionos.com Signed-off-by: Greg Kroah-Hartman commit 19e3e6cdfdc73400eb68d1102cdbad4f9493f474 Author: Justin Stitt Date: Mon Sep 18 05:30:15 2023 +0000 accessibility: speakup: refactor deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. Let's refactor this function to just use synth_write(). Link: www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings[1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Suggested-by: Kees Cook Reviewed-by: Kees Cook Tested-by: Samuel Thibault Link: https://lore.kernel.org/r/20230918-strncpy-drivers-accessibility-speakup-kobjects-c-v2-1-d5b1976c5dbf@google.com Signed-off-by: Greg Kroah-Hartman commit 2953fa030690bdca0b14ab641c8e8c1df002aa51 Author: Kees Cook Date: Fri Sep 22 10:53:48 2023 -0700 hpet: Annotate struct hpets with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct hpets. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Clemens Ladisch Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175348.work.056-kees@kernel.org Signed-off-by: Greg Kroah-Hartman commit 1b6f457b835447a787a729dbd421653f865921d0 Author: Justin Stitt Date: Wed Sep 27 05:20:58 2023 +0000 c2port: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect `c2dev->name` to be NUL-terminated based on its usage with format strings: | dev_info(c2dev->dev, "C2 port %s removed\n", c2dev->name); Moreover, NUL-padding is _not_ required as c2dev is zero-allocated: | c2dev = kzalloc(sizeof(struct c2port_device), GFP_KERNEL); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Let's also drop `C2PORT_NAME_LEN - 1` for `sizeof(dest)` which is more idiomatic strscpy usage. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230927-strncpy-drivers-misc-c2port-core-c-v1-1-978f6d220a54@google.com Signed-off-by: Greg Kroah-Hartman commit 6f17027cc48793b9e6631fe0e52fee1af0e8b7e0 Author: Kuan-Wei Chiu Date: Mon Sep 4 04:42:50 2023 +0800 binderfs: fix typo in binderfs.c The word "wich" was corrected to "which" for spelling accuracy. Signed-off-by: Kuan-Wei Chiu Acked-by: Carlos Llamas Link: https://lore.kernel.org/r/20230903204250.2697370-1-visitorckw@gmail.com Signed-off-by: Greg Kroah-Hartman commit 77f048bcbf07f7dc961f3b2b7815038b5405ec60 Author: Christophe JAILLET Date: Sat Sep 30 11:14:47 2023 +0200 comedi: Annotate struct comedi_lrange with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). Signed-off-by: Christophe JAILLET Reviewed-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/5c3b7459b820e22e2ac6ce892d4aadcc119cc919.1696065263.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit e6c1ccaa711aeca0191f9d9f036e688a2c52ab8c Author: Ian Abbott Date: Wed Sep 13 18:07:12 2023 +0100 comedi: add HAS_IOPORT dependencies again In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. We thus need to add HAS_IOPORT as dependency for those drivers using them. This was previously done in commit b5c75b68b7de ("comedi: add HAS_IOPORT dependencies"), but that has been reverted because it made it impossible to select configuration options for several comedi drivers. This is a do-over that avoids that. Since the original patch, modifications have been made to various comedi modules so that they can still be built even if the port I/O functions have not been declared, so the configuration options for building those modules no longer need to depend on HAS_IOPORT. Make the COMEDI_ISA_DRIVERS menu option (which allows configuration options for ISA and PC/104 drivers to be selected) depend on HAS_IOPORT, and also depend on ISA || ISA_BUS || PC104. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Co-developed-by: Niklas Schnelle Signed-off-by: Niklas Schnelle Cc: Arnd Bergmann Cc: Niklas Schnelle Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20230913170712.111719-14-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 88dd4797746ff93093728a48dd9a88cff95f4ca0 Author: Ian Abbott Date: Wed Sep 13 18:07:11 2023 +0100 comedi: amplc_dio200_common: Conditionally remove I/O port support In a future patch, the port I/O functions (`inb()`, `outb()`, and friends will only be declared in the `HAS_IOPORT` configuration option is enabled. The amplc_dio200_common module is used by the amplc_dio200 module (for ISA cards) and the amplc_dio200_pci module (for PCI and PCI Express cards). It supports both port I/O and memory-mapped I/O. Port I/O and memory-mapped I/O is confined to the `dio200___read8()`, `dio200___read32()`, `dio200___write8()` and `dio200___write32()` functions. Conditionally compile two versions of those functions. If the `CONFIG_HAS_IOPORT` macro is defined, call either the port I/O or memory mapped I/O functions depending on the `mmio` member of the `struct comedi_device`. If the `CONFIG_HAS_IOPORT` macro is undefined only call the memory-mapped I/O functions. Add a run-time check to `amplc_dio200_common_attach()` to return an error if the device wants to use port I/O when the `CONFIG_HAS_IOPORT` macro is undefined. The changes allow the module to be built even if the port I/O functions have not been declared. Cc: Arnd Bergmann Cc: Niklas Schnelle Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20230913170712.111719-13-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit a3f2b80847e2b4dd7180872e69b84d515174c236 Author: Ian Abbott Date: Wed Sep 13 18:07:10 2023 +0100 comedi: amplc_dio200_common: Refactor register access functions The `dio200_read8()`, `dio200_write8()`, `dio200_read32()` and `dio200_write32()` functions apply a right-shift to the register offset for some devices and then perform the actual register access. Factor the register access part out to new functions `dio200___read8()`, `dio200___write8()`, `dio200___read32()`, and `dio200___write32()`. This will reduce duplicated code in a subsequent patch that will conditionally compile support for port I/O as part of the `HAS_IOPORT` changes. Cc: Arnd Bergmann Cc: Niklas Schnelle Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20230913170712.111719-12-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 772dcada0e733a567ad90cca7165c5fef2a1171c Author: Ian Abbott Date: Wed Sep 13 18:07:09 2023 +0100 comedi: amplc_dio200_pci: Conditionally remove devices that use port I/O In a future patch, the port I/O functions (`inb()`, `outb()`, and friends will only be declared in the `HAS_IOPORT` configuration option is enabled. The amplc_dio200_pci module supports various Amplicon PCI and PCI Express devices. Some of the supported devices (the PCI ones) use port I/O, and some of them (the PCIe ones) only use memory-mapped I/O. Conditionally compile in support for the devices that need port I/O if and only if the `CONFIG_HAS_IOPORT` macro is defined. Add a run-time check in `dio200_pci_auto_attach()` to return an error if the device actually requires port I/O (based on the PCI BAR resource flags) but the `HAS_IOPORT` configuration option is not enabled. Cc: Arnd Bergmann Cc: Niklas Schnelle Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20230913170712.111719-11-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 4e1bd6724b854808aa3b94f17f5c27da59a34ff4 Author: Ian Abbott Date: Wed Sep 13 18:07:08 2023 +0100 comedi: ni_mio_common: Conditionally use I/O port or MMIO In a future patch, the port I/O functions (`inb()`, `outb()`, and friends will only be declared in the `HAS_IOPORT` configuration option is enabled. The "ni_mio_common.c" file contains calls to both port I/O functions and memory-mapped I/O functions. The file is `#include`d by "ni_atmio.c", "ni_mio_cs.c", and "ni_pcimio.c" for the ni_atmio, ni_mio_cs, and ni_pcimio modules, respectively. Only "ni_pcimio.c" defines the `PCIDMA` macro before including "ni_mio_common.c" and various bits of code in "ni_mio_common.c" is conditionally compiled according to whether that macro is defined or not. Currently, the port I/O function calls are compiled in regardless of whether the `PCIDMA` macro is defined or not. However, the fact is that the ni_atmio and ni_mio_cs modules will never call the memory-mapped I/O functions, and the ni_pcimio module will never call the port I/O functions. Calls to the port I/O and memory-mapped I/O functions is confined to the `ni_writel()`, `ni_writew()`, `ni_writeb()`, `ni_readl()`, `ni_readw()`, and `ni_readb()` functions which do a run-time test to decide whether to call the port I/O functions or the memory-mapped I/O functions. Conditionally compile two variants of the functions so they only call the port I/O functions if the `PCIDMA` macro is undefined (for the ni_atmio and ni_mio_cs modules), and only call the memory-mapped I/O functions if the `PCIDMA` macro is defined (for the ni_pcimio module). Add a run-time check in the `ni_E_init()` function to return an error if the comedi device has been set up to use port I/O if `PCIDMA` is defined, or has been set up to use memory-mapped I/O if `PCIDMA` is not defined. The changes make it possible to build the ni_pcimio module even if the port I/O functions have not been declared. (The ni_atmio and ni_mio_cs modules do still require the port I/O functions to be declared.) Cc: Arnd Bergmann Cc: Niklas Schnelle Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20230913170712.111719-10-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit a7b9ffd8c208d5911ba44a31e65d7c40400bbebd Author: Ian Abbott Date: Wed Sep 13 18:07:07 2023 +0100 comedi: ni_labpc_common: Conditionally remove I/O port support In a future patch, the port I/O functions (`inb()`, `outb()`, and friends will only be declared in the `HAS_IOPORT` configuration option is enabled. The ni_labpc_common module is used by the ni_labpc module (for ISA cards), the ni_labpc_cs module (for PCMCIA cards), and the ni_labpc_pci module (for PCI cards). The ISA and PCMCIA cards use port I/O and the PCI cards use memory-mapped I/O. Conditionally compile the parts of the module that use the port I/O functions so they are compiled if and only if the `CONFIG_HAS_IOPORT` macro is defined, so that the module can be built if the port I/O functions have not been declared. Add a run-time check in the `labpc_common_attach()` to return an error if the comedi device wants to use port I/O when the `CONFIG_HAS_IOPORT` macro is undefined. The changes allow the module to be built even if the port I/O functions have not been declared. Cc: Arnd Bergmann Cc: Niklas Schnelle Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20230913170712.111719-9-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 7187a0939a1773e6a2663a02a6c456047a5e6289 Author: Ian Abbott Date: Wed Sep 13 18:07:06 2023 +0100 comedi: comedi_8255: Conditionally remove I/O port support In a future patch, the port I/O functions (`inb()`, `outb()`, and friends will only be declared in the `HAS_IOPORT` configuration option is enabled. The comedi_8255 module supports both port I/O and memory-mapped I/O. Conditionally compile the parts of the module that use port I/O if and only if the `CONFIG_HAS_IOPORT` macro is defined so that it can still be built if the port I/O functions have not been declared. If the `CONFIG_HAS_IOPORT` macro is undefined, replace the GPL-exported `subdev_8255_io_init()` function with a dummy static inline version that just returns `-ENXIO`. Cc: Arnd Bergmann Cc: Niklas Schnelle Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20230913170712.111719-8-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 5c57b1ccecc72738d4b9be2dfcdfb9001be76bd7 Author: Ian Abbott Date: Wed Sep 13 18:07:05 2023 +0100 comedi: comedi_8255: Rework subdevice initialization functions Comedi drivers can initialize an 8255 subdevice in I/O space by calling `subdev_8255_init()`, or in memory-mapped I/O space by calling `subdev_8255_mm_init()`, or by supplying a call-back function pointer and context to either of those functions. Change it so that a new function `subdev_8255_cb_init()` shall be called instead when supplying a callback function and context, and remove the call-back function parameter from `subdev_8255_init()` and `subdev_8255_mm_init()`. Also rename `subdev_8255_init()` to `subdev_8255_io_init()`. The parameters are changing, so might as well rename it at the same time. Also rename the `regbase` member of `struct subdev_8255_private` to `context` since this holds the context for the call-back function call. Cc: Arnd Bergmann Cc: Niklas Schnelle Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20230913170712.111719-7-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 0ccb86a690c52d047b6cafa0f7f99805bf6eeb4e Author: Ian Abbott Date: Wed Sep 13 18:07:04 2023 +0100 comedi: 8255_pci: Conditionally remove devices that use port I/O In a future patch, the port I/O functions (`inb()`, `outb()`, and friends will only be declared in the `HAS_IOPORT` configuration option is enabled. The 8255_pci module supports PCI digital I/O devices from various manufacturers that consist of one or more 8255 Programmable Peripheral Interface chips (or equivalent hardware) to provide their digital I/O ports. Some of the devices use port I/O and some only use memory-mapped I/O. Conditionally compile in support for the devices that need port I/O if and only if the `CONFIG_HAS_IOPORT` macro is defined. Change `pci_8255_auto_attach()` to return an error if the device actually requires port I/O (based on the PCI BAR resource flags) but the `HAS_IOPORT` configuration is not enabled. Cc: Arnd Bergmann Cc: Niklas Schnelle Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20230913170712.111719-6-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 90d256757e0bffd7a9beafd7c2bdc40a0236f9ec Author: Ian Abbott Date: Wed Sep 13 18:07:03 2023 +0100 comedi: comedi_8254: Conditionally remove I/O port support The comedi_8254 module supports both port I/O and memory-mapped I/O. In a future patch, the port I/O functions (`inb()`, `outb()`, and friends) will only be declared if the `HAS_IOPORT` configuration option is enabled. Conditionally compile the parts of the module that use port I/O so they are compiled if and only if the `CONFIG_HAS_IOPORT` macro is defined, so that it can still be built if the port I/O functions have not been declared. If `CONFIG_HAS_IOPORT` is undefined, replace the GPL-exported `comedi_8254_io_alloc()` function with a dummy static inline version that just returns `ERR_PTR(-ENXIO)`. Cc: Arnd Bergmann Cc: Niklas Schnelle Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20230913170712.111719-5-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit fade5e5b0b2a2cc3855f64be6407b0bdcd837714 Author: Ian Abbott Date: Wed Sep 13 18:07:02 2023 +0100 comedi: comedi_8254: Replace comedi_8254_init() and comedi_8254_mm_init() `comedi_8254_init()` and `comedi_8254_mm_init()` return `NULL` on failure, but the failure is not necessarily due to lack of memory. Change them to return an `ERR_PTR` value on failure and rename the functions to make it obvious the API has changed. `comedi_8254_init()` has been replaced with `comedi_8254_io_alloc()`, and `comedi_8254_mm_init()` has been replaced with `comedi_8254_mm_alloc()`. Cc: Arnd Bergmann Cc: Niklas Schnelle Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20230913170712.111719-4-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit c62f5032f72a745542aa6a7e777c7819c96adfbe Author: Ian Abbott Date: Wed Sep 13 18:07:01 2023 +0100 comedi: comedi_8254: Use a call-back function for register access Rework the comedi_8254 module to use a call-back function for register access. This will make it easier to isolate the parts that will depend on the `CONFIG_HAS_IOPORT` macro being defined and also allows the possibility of supplying an external callback function during initialization by a variant of the `comedi_8254_init()` and `comedi_8254_mm_init()` functions, although that has not been implemented yet. The `struct comedi_8254` members have been changed to use a pointer to a callback function and a context of type `unsigned long`. The `comedi_8254_init()` and `comedi_8254_mm_init()` functions use an internal callback function and set the context to the base address of the registers (for `comedi_8254_mm_init()` that involves converting a `void __iomem *` to `unsigned long`). A minor change to `dio200_subdev_8254_offset()` in the amplc_dio200_common module has been made due to the changes in `struct comedi_8254`. Cc: Arnd Bergmann Cc: Niklas Schnelle Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20230913170712.111719-3-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 7b79e3d2c6333f410a9dc2e61f987120315f09c0 Author: Ian Abbott Date: Wed Sep 13 18:07:00 2023 +0100 comedi: Correct dependencies for COMEDI_NI_PCIDIO The ni_pcidio module does not depend on the comedi_8255 module, so change the `COMEDI_NI_PCIDIO` configuration option to not select `COMEDI_8255` and remove the inherited dependency on `HAS_IOPORT`. Cc: Arnd Bergmann Cc: Niklas Schnelle Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20230913170712.111719-2-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 14388ec0052c14640bf805dee55372f92557c6d9 Author: Justin Stitt Date: Tue Oct 3 22:23:07 2023 +0000 drivers: misc: ti-st: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect both `kim_data->dev_name` and `kim_gdata->dev_name` to be NUL-terminated. `kim_data->dev_name` seems to not require NUL-padding. `kim_gdata` is already zero-allocated and as such does not require NUL-padding: | kim_gdata = kzalloc(sizeof(struct kim_data_s), GFP_KERNEL); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Let's also opt to use the more idiomatic strscpy usage of: strscpy(dest, src, sizeof(dest)) Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20231003-strncpy-drivers-misc-ti-st-st_kim-c-v2-1-79630447b0a1@google.com Signed-off-by: Greg Kroah-Hartman commit 2801badd26540ecc9c93f6007e2d6e5030246d76 Author: Justin Stitt Date: Wed Sep 27 05:52:14 2023 +0000 ibmvmc: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230927-strncpy-drivers-misc-ibmvmc-c-v1-1-29f56cd3a269@google.com Signed-off-by: Greg Kroah-Hartman commit bd4da04c79346cc7e6b2d4e158adb7d2a4bac53b Author: Randy Dunlap Date: Sat Sep 30 15:14:28 2023 -0700 mei: fix doc typos Fix grammar and punctuation. Signed-off-by: Randy Dunlap Cc: Tomas Winkler Cc: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230930221428.18463-3-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit 3c69d52e3e12f0330c554c9c6e5498c436c86f4b Author: Kees Cook Date: Fri Sep 22 10:50:58 2023 -0700 misc: bcm-vk: Annotate struct bcm_vk_wkent with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct bcm_vk_wkent. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Scott Branden Cc: Broadcom internal kernel review list Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175057.work.558-kees@kernel.org Signed-off-by: Greg Kroah-Hartman commit 4963e34ce7b95237021575d208fa576f88697839 Author: Rafael J. Wysocki Date: Tue Oct 3 15:25:33 2023 +0200 thermal: core: Drop thermal_zone_device_exec() Because thermal_zone_device_exec() has no users any more and there are no plans to use it anywhere, revert commit 9a99a996d1ec ("thermal: core: Introduce thermal_zone_device_exec()") that introduced it. No functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano commit b251ab28caeb5a4a63d832dcd53d29ad2dd5318f Author: Rafael J. Wysocki Date: Tue Oct 3 15:24:12 2023 +0200 ACPI: thermal: Use thermal_zone_for_each_trip() for updating trips Rearrange the code handling notifications from the platform firmware regarding trip point updates to carry out one loop over trip points instead of two of them by using thermal_zone_for_each_trip() for that, which is more straightforward than using a combination of thermal_zone_device_exec() and for_each_thermal_trip(), each with its own callback function. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano commit cd3c00e7760905270541981f4c5d1e31f38c2e47 Author: Rafael J. Wysocki Date: Tue Oct 3 15:26:35 2023 +0200 thermal: int340x: Use thermal_zone_for_each_trip() Modify int340x_thermal_update_trips() to use thermal_zone_for_each_trip() for walking trips instead of using the trips[] table passed to the thermal zone registration function. For this purpose, store active trip point indices in the priv fieids of the corresponding thermal_trip structures. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano commit 828176d037e29f813792a8b3ac1591834240e96f Author: Miguel Ojeda Date: Wed Aug 23 18:02:42 2023 +0200 rust: arc: add explicit `drop()` around `Box::from_raw()` `Box::from_raw()` is `#[must_use]`, which means the result cannot go unused. In Rust 1.71.0, this was not detected because the block expression swallows the diagnostic [1]: unsafe { Box::from_raw(self.ptr.as_ptr()) }; It would have been detected, however, if the line had been instead: unsafe { Box::from_raw(self.ptr.as_ptr()); } i.e. the semicolon being inside the `unsafe` block, rather than outside. In Rust 1.72.0, the compiler started warning about this [2], so without this patch we will get: error: unused return value of `alloc::boxed::Box::::from_raw` that must be used --> rust/kernel/sync/arc.rs:302:22 | 302 | unsafe { Box::from_raw(self.ptr.as_ptr()) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: call `drop(Box::from_raw(ptr))` if you intend to drop the `Box` = note: `-D unused-must-use` implied by `-D warnings` help: use `let _ = ...` to ignore the resulting value | 302 | unsafe { let _ = Box::from_raw(self.ptr.as_ptr()); }; | +++++++ + Thus add an add an explicit `drop()` as the `#[must_use]`'s annotation suggests (instead of the more general help line). Link: https://github.com/rust-lang/rust/issues/104253 [1] Link: https://github.com/rust-lang/rust/pull/112529 [2] Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Gary Guo Reviewed-by: Alice Ryhl Reviewed-by: Andreas Hindborg Reviewed-by: Björn Roy Baron Link: https://lore.kernel.org/r/20230823160244.188033-2-ojeda@kernel.org Signed-off-by: Miguel Ojeda commit 49e7265fd098fdade2bbdd9331e6b914cda7fa83 Author: Eric Dumazet Date: Mon Oct 2 13:17:38 2023 +0000 net_sched: sch_fq: add TCA_FQ_WEIGHTS attribute This attribute can be used to tune the per band weight and report them in "tc qdisc show" output: qdisc fq 802f: parent 1:9 limit 100000p flow_limit 500p buckets 1024 orphan_mask 1023 quantum 8364b initial_quantum 41820b low_rate_threshold 550Kbit refill_delay 40ms timer_slack 10us horizon 10s horizon_drop bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 weights 589824 196608 65536 Sent 236460814 bytes 792991 pkt (dropped 0, overlimits 0 requeues 0) rate 25816bit 10pps backlog 0b 0p requeues 0 flows 4 (inactive 4 throttled 0) gc 0 throttled 19 latency 17.6us fastpath 773882 Signed-off-by: Eric Dumazet Acked-by: Dave Taht Reviewed-by: Willem de Bruijn Reviewed-by: Toke Høiland-Jørgensen Signed-off-by: Paolo Abeni commit 29f834aa326e659ed354c406056e94ea3d29706a Author: Eric Dumazet Date: Mon Oct 2 13:17:37 2023 +0000 net_sched: sch_fq: add 3 bands and WRR scheduling Before Google adopted FQ for its production servers, we had to ensure AF4 packets would get a higher share than BE1 ones. As discussed this week in Netconf 2023 in Paris, it is time to upstream this for public use. After this patch FQ can replace pfifo_fast, with the following differences : - FQ uses WRR instead of strict prio, to avoid starvation of low priority packets. - We make sure each band/prio tracks its own usage against sch->limit. This was done to make sure flood of low priority packets would not prevent AF4 packets to be queued. Contributed by Willem. - priomap can be changed, if needed (default value are the ones coming from pfifo_fast). In this patch, we set default band weights so that : - high prio (band=0) packets get 90% of the bandwidth if they compete with low prio (band=2) packets. - high prio packets get 75% of the bandwidth if they compete with medium prio (band=1) packets. Following patch in this series adds the possibility to tune the per-band weights. As we added many fields in 'struct fq_sched_data', we had to make sure to have the first cache line read-mostly, and avoid wasting precious cache lines. More optimizations are possible but will be sent separately. Signed-off-by: Eric Dumazet Acked-by: Dave Taht Reviewed-by: Willem de Bruijn Acked-by: Soheil Hassas Yeganeh Reviewed-by: Toke Høiland-Jørgensen Signed-off-by: Paolo Abeni commit 5579ee462dfe768297563a6083e21df52c3ad856 Author: Eric Dumazet Date: Mon Oct 2 13:17:36 2023 +0000 net_sched: export pfifo_fast prio2band[] pfifo_fast prio2band[] is renamed to sch_default_prio2band[] and exported because we want to share it in FQ. Signed-off-by: Eric Dumazet Acked-by: Dave Taht Reviewed-by: Willem de Bruijn Reviewed-by: Toke Høiland-Jørgensen Signed-off-by: Paolo Abeni commit 2ae45136a93839326f8fdc1286a4b0457da97ce8 Author: Eric Dumazet Date: Mon Oct 2 13:17:35 2023 +0000 net_sched: sch_fq: remove q->ktime_cache Now that both enqueue() and dequeue() need to use ktime_get_ns(), there is no point wasting 8 bytes in struct fq_sched_data. This makes room for future fields. ;) Signed-off-by: Eric Dumazet Acked-by: Dave Taht Reviewed-by: Willem de Bruijn Reviewed-by: Toke Høiland-Jørgensen Signed-off-by: Paolo Abeni commit 2cbe1a333115b9d318a5066945a74f1d01e9ee19 Merge: a56cc0a833852 1ced5dce63d0a Author: Rafael J. Wysocki Date: Thu Oct 5 13:24:25 2023 +0200 Merge earlier changes in Intel thermal drivers for v6.7. commit c2a5b4597ab821a379cd84e385c9202ffed4c038 Author: Marek Szyprowski Date: Thu Oct 5 13:17:18 2023 +0200 ARM: multi_v7_defconfig: add tm2-touchkey driver The Cypress 'touchkey' hardware is available on Exynos4412-based Midas family boards, so enable the driver for it to increase testing coverage. Signed-off-by: Marek Szyprowski Link: https://lore.kernel.org/r/20231005111718.1096634-1-m.szyprowski@samsung.com Signed-off-by: Krzysztof Kozlowski commit 4f9cf91e4102fe77ef3393febab72612b594172f Author: Rafael J. Wysocki Date: Tue Oct 3 15:21:30 2023 +0200 ACPI: thermal: Combine passive and active trip update functions Combine acpi_thermal_update_passive_trip() and acpi_thermal_update_active_trip() into one common function called acpi_thermal_update_trip(), so as to reduce code duplication and prepare the code in question for subsequent changes. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 44babd829a7e0c13b57040fc8234f64fabab1efd Author: Rafael J. Wysocki Date: Tue Oct 3 15:18:31 2023 +0200 ACPI: thermal: Move get_active_temp() Put the get_active_temp() function next to the analogous get_passive_temp() one to allow subsequent changes to be easier to follow. No functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano commit 8820087ee5e7e15a5b041d02c9585fff16f858e1 Merge: 1dd72ce0c1251 a56cc0a833852 Author: Rafael J. Wysocki Date: Thu Oct 5 13:18:27 2023 +0200 Merge thermal core material depended on by subsequent changes. commit 7360a48bd0f5e62b2d00c387d5d3f2821eb290ce Author: Mike Tipton Date: Fri Sep 22 06:45:12 2023 -0700 debugfs: Fix __rcu type comparison warning Sparse reports the following: fs/debugfs/file.c:942:9: sparse: sparse: incompatible types in comparison expression (different address spaces): fs/debugfs/file.c:942:9: sparse: char [noderef] __rcu * fs/debugfs/file.c:942:9: sparse: char * rcu_assign_pointer() expects that it's assigning to pointers annotated with __rcu. We can't annotate the generic struct file::private_data, so cast it instead. Fixes: 86b5488121db ("debugfs: Add write support to debugfs_create_str()") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309091933.BRWlSnCq-lkp@intel.com/ Signed-off-by: Mike Tipton Link: https://lore.kernel.org/r/20230922134512.5126-1-quic_mdtipton@quicinc.com Signed-off-by: Greg Kroah-Hartman commit a56cc0a8338523f709892696cc229527617c1316 Author: Rafael J. Wysocki Date: Tue Oct 3 15:17:24 2023 +0200 thermal: core: Add function to walk trips under zone lock Add a wrapper around for_each_thermal_trip(), called thermal_zone_for_each_trip(), that will invoke the former under the thermal zone lock and pass its return value to the caller. Two drivers will be modified subsequently to use this new function. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 1dc05a274a7b13fd61b6c43f0136153752e6f731 Author: Andy Shevchenko Date: Wed Sep 20 18:38:19 2023 +0300 device property: Replace custom implementation of COUNT_ARGS() Replace custom and non-portable implementation of COUNT_ARGS(). Fixes: e64b674bc9d7 ("software node: implement reference properties") Reported-by: Nick Desaulniers Closes: https://lore.kernel.org/r/ZQoILN6QCjzosCOs@google.com Signed-off-by: Andy Shevchenko Reviewed-by: Takashi Iwai Closes: https://github.com/ClangBuiltLinux/linux/issues/1935 Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20230920153819.2069869-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 98ad1dd06a02096fff6c65703a85b9f3c3de1a7d Author: Geert Uytterhoeven Date: Wed Sep 27 15:20:10 2023 +0200 drivers: base: test: Make property entry API test modular There is no reason why the KUnit Tests for the property entry API can only be built-in. Add support for building these tests as a loadable module, like is supported by most other tests. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/98388154383df9d4ced73946efd18318aeea50e2.1695820382.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit f1ac370cdda304d2fed44455ae685c7ee9539c0a Author: Andy Shevchenko Date: Tue Sep 19 22:50:48 2023 +0300 driver core: Add missing parameter description to __fwnode_link_add() The kernel documentation validator is not happy with: drivers/base/core.c:67: warning: Function parameter or member 'flags' not described in '__fwnode_link_add' Add missing parameter description. Fixes: 6a6dfdf8b3ff ("driver core: fw_devlink: Allow marking a fwnode link as being part of a cycle") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230919195048.3197551-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 7523d330aac7190f738998a52df8d5aa14293280 Author: Andy Shevchenko Date: Mon Sep 4 13:40:46 2023 +0300 device property: Clarify usage scope of some struct fwnode_handle members Most of the struct fwnode_handle members are for exclusive use with device links framework. Clarify this by adding a respective comment. Signed-off-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Reviewed-by: Sakari Ailus Link: https://lore.kernel.org/r/20230904104046.1682875-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit b85b4f30846bb169c114e99ceee17cc119f02a4b Author: Jason Gunthorpe Date: Wed Oct 4 09:08:32 2023 -0300 iommu: Fix return code in iommu_group_alloc_default_domain() This function returns NULL on errors, not ERR_PTR. Fixes: 1c68cbc64fe6 ("iommu: Add IOMMU_DOMAIN_PLATFORM") Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/8fb75157-6c81-4a9c-9992-d73d49902fa8@moroto.mountain Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/0-v2-ee2bae9af0f2+96-iommu_ga_err_ptr_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 92bce97f0c341d3037b0f364b6839483f6a41cae Author: Niklas Schnelle Date: Wed Oct 4 10:56:12 2023 +0200 s390/pci: Fix reset of IOMMU software counters Together with enabling the Function Measurement Block zpci_fmb_enable_device() also resets the software counters. This allows to use "echo 0 > /sys/kernel/debug/pci//statistics" followed by echo "1 > /../statistics" to reset all counters. In commit c76c067e488c ("s390/pci: Use dma-iommu layer") this use of the now obsolete counters in struct zpci_device was missed as was their removal. Fix this by resetting the new counters and removing the old ones. Fixes: c76c067e488c ("s390/pci: Use dma-iommu layer") Signed-off-by: Niklas Schnelle Reviewed-by: Matthew Rosato Link: https://lore.kernel.org/r/20231004-dma_iommu_fix-v1-1-129777cd8232@linux.ibm.com Signed-off-by: Joerg Roedel commit 0f6a90436a5771fc9f6ca0d1e64f7549219e6c3c Author: Jason Gunthorpe Date: Tue Oct 3 13:52:36 2023 -0300 iommu: Do not use IOMMU_DOMAIN_DMA if CONFIG_IOMMU_DMA is not enabled msm_iommu platforms do not select either CONFIG_IOMMU_DMA or CONFIG_ARM_DMA_USE_IOMMU so they create a IOMMU_DOMAIN_DMA domain by default and never populate it. This acts like a BLOCKED domain and breaks the GPU driver on the platform. Detect this and force use of IDENTITY instead. Fixes: 98ac73f99bc4 ("iommu: Require a default_domain for all iommu drivers") Reported-by: Dmitry Baryshkov Link: https://lore.kernel.org/linux-iommu/CAA8EJprz7VVmBG68U9zLuqPd0UdSRHYoLDJSP6tCj6H6qanuTQ@mail.gmail.com/ Signed-off-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Tested-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/0-v1-20700abdf239+19c-iommu_no_dma_iommu_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 64909aa6ddd0be084beb6e6ae68d0e649e382bfd Author: Ville Syrjälä Date: Tue Oct 3 22:42:56 2023 +0300 drm/i915/fbc: Remove pointless "stride is multiple of 64 bytes" check Plane stride is always a multiple of 64 bytes. Remove the pointless check that really doesn't have anything to do with FBC. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231003194256.28569-6-ville.syrjala@linux.intel.com Reviewed-by: Vinod Govindapillai commit 1fe5c43e447b63d29b54154832f0b9bc49d949df Author: Ville Syrjälä Date: Tue Oct 3 22:42:55 2023 +0300 drm/i915/fbc: Split plane pixel format checks per-platform Carve up pixel_format_is_valid() into per-platform variants to make it easier to see what limits are actually being imposed. Note that the XRGB1555 can be dropped from the g4x+ variant since the plane no longer supports that format anyway. TODO: maybe go for vfuncs later v2: Update for lnl changes Reviewed-by: Juha-Pekka Heikkila #v1 Reviewed-by: Vinod Govindapillai Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231003194256.28569-5-ville.syrjala@linux.intel.com commit 5737f7dc16a10d660a8c698c11f02d16ede7ef62 Author: Ville Syrjälä Date: Tue Oct 3 22:42:54 2023 +0300 drm/i915/fbc: Split plane rotation checks per-platform Carve up rotation_is_valid() into per-platform variants to make it easier to see what limits are actually being imposed. TODO: maybe go for vfuncs later Reviewed-by: Juha-Pekka Heikkila Reviewed-by: Vinod Govindapillai Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231003194256.28569-4-ville.syrjala@linux.intel.com commit 9fbe915b88923c60acca127b464cc7485c03ec3f Author: Ville Syrjälä Date: Tue Oct 3 22:42:53 2023 +0300 drm/i915/fbc: Split plane tiling checks per-platform Carve up tiling_is_valid() into per-platform variants to make it easier to see what limits are actually being imposed. TODO: maybe go for vfuncs later Reviewed-by: Juha-Pekka Heikkila Reviewed-by: Vinod Govindapillai Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231003194256.28569-3-ville.syrjala@linux.intel.com commit a8a3b4cd74612980c1af69ad34433336024e86a9 Author: Ville Syrjälä Date: Tue Oct 3 22:42:52 2023 +0300 drm/i915/fbc: Split plane stride checks per-platform Carve up stride_is_valid() into per-platform variants to make it easier to see what limits are actually being imposed. TODO: maybe go for vfuncs later Reviewed-by: Juha-Pekka Heikkila Reviewed-by: Vinod Govindapillai Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231003194256.28569-2-ville.syrjala@linux.intel.com commit da7b3b03f4c5f02e83dbd7cf9215e0fe6683e930 Author: Ville Syrjälä Date: Tue Oct 3 22:42:51 2023 +0300 drm/i915/fbc: Remove ancient 16k plane stride limit The 16k max plane stride limit seems to be originally from i965gm, and no explicit limit has been specified since (g4x+). So let's assume the max plane stride itself is a suitable limit also for the more recent FBC hardware. In fact even for i965gm the max X-tiled stride is also 16k so technically we don't need the check there either, but let's keep it there anyway since it's explicitly mentioned in the spec. Gen2/3 have more strict limits checked separately. Reviewed-by: Swati Sharma Reviewed-by: Juha-Pekka Heikkila Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231003194256.28569-1-ville.syrjala@linux.intel.com commit 6097cdac5af6115041dd7835670650c9c3633877 Author: Uros Bizjak Date: Mon Jul 3 17:08:18 2023 +0200 drm/i915/pmu: Use local64_try_cmpxchg in i915_pmu_event_read Use local64_try_cmpxchg instead of local64_cmpxchg (*ptr, old, new) == old in i915_pmu_event_read. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails. There is no need to re-read the value in the loop. No functional change intended. Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Uros Bizjak Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230703150859.6176-1-ubizjak@gmail.com commit 8468516f9f93a41dc65158b6428a1a1039c68f20 Author: Dimitri John Ledkov Date: Mon Oct 2 00:57:15 2023 +0100 crypto: pkcs7 - remove md4 md5 x.509 support Remove support for md4 md5 hash and signatures in x.509 certificate parsers, pkcs7 signature parser, authenticode parser. All of these are insecure or broken, and everyone has long time ago migrated to alternative hash implementations. Also remove md2 & md3 oids which have already didn't have support. This is also likely the last user of md4 in the kernel, and thus crypto/md4.c and related tests in tcrypt & testmgr can likely be removed. Other users such as cifs smbfs ext modpost sumversions have their own internal implementation as needed. Signed-off-by: Dimitri John Ledkov Reviewed-by: Jarkko Sakkinen Signed-off-by: Herbert Xu commit 18e2ef172cec1680a6736cc7f6e1b92c93b3daa0 Author: Randy Dunlap Date: Sat Sep 30 17:00:44 2023 -0700 crypto: sig - fix kernel-doc typo Correct typo of "destination". Signed-off-by: Randy Dunlap Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Signed-off-by: Herbert Xu commit 595729b6f5711e0ab311d6ead78a92bce3bb828b Author: Randy Dunlap Date: Sat Sep 30 17:00:43 2023 -0700 crypto: akcipher - fix kernel-doc typos Correct typos of "destination". Signed-off-by: Randy Dunlap Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-crypto@vger.kernel.org Signed-off-by: Herbert Xu commit 3c3507d2b1b0752f916cf0a7f641480eaf2a37b2 Author: Alexey Romanov Date: Fri Sep 29 13:29:37 2023 +0300 dt-bindings: rng: meson: add meson-rng-s4 compatible Add compatible for hardware number generator node for Amlogic S4-series. Signed-off-by: Alexey Romanov Acked-by: Conor Dooley Signed-off-by: Herbert Xu commit a5de196d6d7df5b1ed1c4c87ee57429e2d74dafb Author: Alexey Romanov Date: Fri Sep 29 13:29:36 2023 +0300 hwrng: meson - add support for S4 For some Amlogic SOC's, mechanism to obtain random number has been changed. For example, S4 now uses status bit waiting algo. Signed-off-by: Alexey Romanov Signed-off-by: Herbert Xu commit b42ab1c61a77832040ad42ebf9adf237360e49f7 Author: Weili Qian Date: Thu Sep 28 17:21:47 2023 +0800 crypto: hisilicon/qm - check function qp num before alg register When the Kunpeng accelerator executes tasks such as encryption and decryption have minimum requirements on the number of device queues. If the number of queues does not meet the requirement, the process initialization will fail. Therefore, the driver checks the number of queues on the device before registering the algorithm. If the number does not meet the requirements, the driver does not register the algorithm to crypto subsystem, the device is still added to the qm_list. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit ff3ddca9ca153d8a0ba0ed9325b15bdca92df769 Author: Weili Qian Date: Thu Sep 28 17:21:03 2023 +0800 crypto: hisilicon/qm - fix the type value of aeq The type of aeq has only 4bits in dw0 17 to 20bits, but 15bits(17 to 31bits) are read in function qm_aeq_thread(). The remaining 11bits(21 to 31bits) are reserved for aeq, but may not be 0. To avoid getting incorrect value of type, other bits are cleared. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 5831fc1fd4a578232fea708b82de0c666ed17153 Author: Longfang Liu Date: Thu Sep 28 16:57:22 2023 +0800 crypto: hisilicon/qm - fix PF queue parameter issue If the queue isolation feature is enabled, the number of queues supported by the device changes. When PF is enabled using the current default number of queues, the default number of queues may be greater than the number supported by the device. As a result, the PF fails to be bound to the driver. After modification, if queue isolation feature is enabled, when the default queue parameter is greater than the number supported by the device, the number of enabled queues will be changed to the number supported by the device, so that the PF and driver can be properly bound. Fixes: 8bbecfb402f7 ("crypto: hisilicon/qm - add queue isolation support for Kunpeng930") Signed-off-by: Longfang Liu Signed-off-by: Herbert Xu commit e12a68b3c6ac2cecb365b57c639df71e3564d68b Author: Chang S. Bae Date: Thu Sep 28 00:25:08 2023 -0700 crypto: x86/aesni - Perform address alignment early for XTS mode Currently, the alignment of each field in struct aesni_xts_ctx occurs right before every access. However, it's possible to perform this alignment ahead of time. Introduce a helper function that converts struct crypto_skcipher *tfm to struct aesni_xts_ctx *ctx and returns an aligned address. Utilize this helper function at the beginning of each XTS function and then eliminate redundant alignment code. Suggested-by: Eric Biggers Link: https://lore.kernel.org/all/ZFWQ4sZEVu%2FLHq+Q@gmail.com/ Signed-off-by: Chang S. Bae Cc: linux-crypto@vger.kernel.org Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Herbert Xu commit d148736ff17de5db1fd0e9b03e9e77615162f613 Author: Chang S. Bae Date: Thu Sep 28 00:25:07 2023 -0700 crypto: x86/aesni - Correct the data type in struct aesni_xts_ctx Currently, every field in struct aesni_xts_ctx is defined as a byte array of the same size as struct crypto_aes_ctx. This data type is obscure and the choice lacks justification. To rectify this, update the field type in struct aesni_xts_ctx to match its actual structure. Suggested-by: Eric Biggers Link: https://lore.kernel.org/all/ZFWQ4sZEVu%2FLHq+Q@gmail.com/ Signed-off-by: Chang S. Bae Cc: linux-crypto@vger.kernel.org Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Herbert Xu commit 62496a2dead7a1e483d6b3660a2145dad1f34225 Author: Chang S. Bae Date: Thu Sep 28 00:25:06 2023 -0700 crypto: x86/aesni - Refactor the common address alignment code The address alignment code has been duplicated for each mode. Instead of duplicating the same code, refactor the alignment code and simplify the alignment helpers. Suggested-by: Eric Biggers Link: https://lore.kernel.org/all/20230526065414.GB875@sol.localdomain/ Signed-off-by: Chang S. Bae Cc: linux-crypto@vger.kernel.org Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Herbert Xu commit a1e452026e6d7d16253b29b9d19d3c99a5066726 Author: Lukas Wunner Date: Tue Sep 26 11:46:41 2023 +0200 X.509: Add missing IMPLICIT annotations to AKID ASN.1 module The ASN.1 module in RFC 5280 appendix A.1 uses EXPLICIT TAGS whereas the one in appendix A.2 uses IMPLICIT TAGS. The kernel's simplified asn1_compiler.c always uses EXPLICIT TAGS, hence definitions from appendix A.2 need to be annotated as IMPLICIT for the compiler to generate RFC-compliant code. In particular, GeneralName is defined in appendix A.2: GeneralName ::= CHOICE { otherName [0] OtherName, ... dNSName [2] IA5String, x400Address [3] ORAddress, directoryName [4] Name, ... } Because appendix A.2 uses IMPLICIT TAGS, the IA5String tag (0x16) of a dNSName is not rendered. Instead, the string directly succeeds the [2] tag (0x82). Likewise, the SEQUENCE tag (0x30) of an OtherName is not rendered. Instead, only the constituents of the SEQUENCE are rendered: An OID tag (0x06), a [0] tag (0xa0) and an ANY tag. That's three consecutive tags instead of a single encompassing tag. The situation is different for x400Address and directoryName choices: They reference ORAddress and Name, which are defined in appendix A.1, therefore use EXPLICIT TAGS. The AKID ASN.1 module is missing several IMPLICIT annotations, hence isn't RFC-compliant. In the unlikely event that an AKID contains other elements beside a directoryName, users may see parse errors. Add the missing annotations but do not tag this commit for stable as I am not aware of any issue reports. Fixes are only eligible for stable if they're "obviously correct" and with ASN.1 there's no such thing. Signed-off-by: Lukas Wunner Signed-off-by: Herbert Xu commit 200a98797b8f6414dc7a852e8bb650ce726b8a15 Author: Fabio Estevam Date: Mon Sep 25 08:12:20 2023 -0300 dt-bindings: crypto: fsl-imx-sahara: Fix the number of irqs i.MX27 has only one Sahara interrupt. i.MX53 has two. Describe this difference. Signed-off-by: Fabio Estevam Reviewed-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit dcd7a8961c99aab619f1efdf2c2f94f0e0ecbc34 Author: Fabio Estevam Date: Mon Sep 25 08:12:19 2023 -0300 dt-bindings: crypto: fsl-imx-sahara: Document the clocks Describe the clocks (ipg and ahb) needed by Sahara block to operate. Signed-off-by: Fabio Estevam Reviewed-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit 137e6c52ac4ac2fb11cbd479d006eda410bfe707 Author: Fabio Estevam Date: Mon Sep 25 08:12:18 2023 -0300 dt-bindings: crypto: fsl-imx-sahara: Shorten the title In the title, there is no need to mention "included in some i.MX chips" as it is too vague. Remove it to make it simpler. While at it, also remove the extra space in the first reg entry. Signed-off-by: Fabio Estevam Acked-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit fa095fe0ab3589109dc5add3f34e16a053d90260 Author: Mark Tseng Date: Thu Sep 21 13:26:37 2023 +0800 soc: mediatek: svs: Add support for voltage bins Add support voltage bins turn point Signed-off-by: Mark Tseng Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230921052637.30444-4-chun-jen.tseng@mediatek.com commit 1f6c9cbc49bb07b25c2f4b998ebe1248691e082d Author: Mark Tseng Date: Thu Sep 21 13:26:36 2023 +0800 soc: mediatek: svs: Add support for MT8188 SoC MT8188 svs gpu uses 2-line high bank and low bank to optimize the voltage of opp table for higher and lower frequency respectively. Signed-off-by: Mark Tseng Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230921052637.30444-3-chun-jen.tseng@mediatek.com commit 6b841f34d51c9e0e69751e023130992687c9fd37 Author: Mark Tseng Date: Thu Sep 21 13:26:35 2023 +0800 dt-bindings: soc: mediatek: add mt8188 svs dt-bindings Add mt8188 svs compatible in dt-bindings. Signed-off-by: Mark Tseng Acked-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230921052637.30444-2-chun-jen.tseng@mediatek.com commit 466f70fb1b10fd139582646285e587fb38a9ff2c Author: Tzung-Bi Shih Date: Tue Oct 3 08:05:15 2023 +0000 platform/chrome: kunit: make EC protocol tests independent Remove CONFIG_CROS_KUNIT and common code concept for ChromeOS Kunit but make it bundle to ChromeOS EC protocol tests. Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231003080515.4011374-1-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih commit e410b4ade83d06a046f6e32b5085997502ba0559 Author: Tzung-Bi Shih Date: Tue Oct 3 08:05:04 2023 +0000 platform/chrome: kunit: initialize lock for fake ec_dev cros_ec_cmd_xfer() uses ec_dev->lock. Initialize it. Otherwise, dmesg shows the following: > DEBUG_LOCKS_WARN_ON(lock->magic != lock) > ... > Call Trace: > ? __mutex_lock > ? __warn > ? __mutex_lock > ... > ? cros_ec_cmd_xfer Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231003080504.4011337-1-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih commit a7bad167bdc3cf4c47c6a9ec4fc9b4ae18b4614d Author: Tzung-Bi Shih Date: Tue Oct 3 08:04:53 2023 +0000 platform/chrome: cros_ec: fix compilation warning When including cros_ec.h solely, the compiler emits the following warning: > 'struct cros_ec_device' declared inside parameter list will not be visible outside of this definition or declaration Fix it by forward declaration. Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231003080453.4011301-1-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih commit c0a2c7619666ae857a52219f344fbaa915cd181a Author: Kuninori Morimoto Date: Tue Oct 3 02:33:29 2023 +0000 dt-bindings: soc: renesas: Document R-Car S4 Starter Kit Add "renesas,s4sk" which targets the Renesas R-Car S4 Starter Kit board. Signed-off-by: Yusuke Goda Signed-off-by: Kuninori Morimoto Acked-by: Krzysztof Kozlowski Reviewed-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/87sf6sfn9i.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven commit 6042f5365bee167ac27d02454f5cba403747277a Author: Claudiu Beznea Date: Fri Sep 29 08:39:13 2023 +0300 dt-bindings: soc: renesas: Document SMARC Carrier-II EVK Document the Renesas SMARC Carrier-II EVK board which is based on the Renesas RZ/G3S SMARC SoM. The SMARC Carrier-II EVK consists of an RZ/G3S SoM module and a SMARC Carrier-II carrier board; the SoM module sits on top of the carrier board. Signed-off-by: Claudiu Beznea Acked-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-27-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 1c3be6ca72293723e009a29fbe90385fa047e5ee Author: Claudiu Beznea Date: Fri Sep 29 08:39:10 2023 +0300 dt-bindings: soc: renesas: Document RZ/G3S SMARC SoM Document the Renesas RZ/G3S SMARC SoM board which is based on the Renesas RZ/G3S (R9A08G045S33) SoC. Suggested-by: Geert Uytterhoeven Signed-off-by: Claudiu Beznea Acked-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-24-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 4202bcac5e65de2d7193b7e27984b810ba33aada Author: Oliver Upton Date: Wed Oct 4 23:49:47 2023 +0000 KVM: arm64: Use mtree_empty() to determine if SMCCC filter configured The smccc_filter maple tree is only populated if userspace attempted to configure it. Use the state of the maple tree to determine if the filter has been configured, eliminating the VM flag. Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231004234947.207507-4-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit d34b76489ea0c6168d230d4f9ad065422ba5f6d6 Author: Oliver Upton Date: Wed Oct 4 23:49:46 2023 +0000 KVM: arm64: Only insert reserved ranges when SMCCC filter is used The reserved ranges are only useful for preventing userspace from adding a rule that intersects with functions we must handle in KVM. If userspace never writes to the SMCCC filter than this is all just wasted work/memory. Insert reserved ranges on the first call to KVM_ARM_VM_SMCCC_FILTER. Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231004234947.207507-3-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit bb17fb31f00ebd8df478a9533c6b77d6eebe6464 Author: Oliver Upton Date: Wed Oct 4 23:49:45 2023 +0000 KVM: arm64: Add a predicate for testing if SMCCC filter is configured Eventually we can drop the VM flag, move around the existing implementation for now. Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231004234947.207507-2-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 9586e2401700208fac72c5f78bbf15f8fb7007cb Author: Kees Cook Date: Fri Sep 22 10:32:14 2023 -0700 drm/v3d: Annotate struct v3d_perfmon with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct v3d_perfmon. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Emma Anholt Cc: Melissa Wen Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Maíra Canal Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230922173216.3823169-9-keescook@chromium.org commit 45744668746b0bcb36d58a73c2cab603090da9ac Author: Kees Cook Date: Fri Sep 22 10:32:13 2023 -0700 drm/vmwgfx: Annotate struct vmw_surface_dirty with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct vmw_surface_dirty. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Zack Rusin Cc: VMware Graphics Reviewers Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Zack Rusin Reviewed-by: Gustavo A. R. Silva Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230922173216.3823169-8-keescook@chromium.org commit 25765dde572b2266c4619d85ef0b3aeb47e24f13 Author: Kees Cook Date: Fri Sep 22 10:32:12 2023 -0700 drm/virtio: Annotate struct virtio_gpu_object_array with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct virtio_gpu_object_array. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: David Airlie Cc: Gerd Hoffmann Cc: Gurchetan Singh Cc: Chia-I Wu Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: virtualization@lists.linux-foundation.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230922173216.3823169-7-keescook@chromium.org commit b16cc13baca7381737e2656c0095f787328a44b4 Author: Kees Cook Date: Fri Sep 22 10:32:11 2023 -0700 drm/vc4: Annotate struct vc4_perfmon with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct vc4_perfmon. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Emma Anholt Cc: Maxime Ripard Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230922173216.3823169-6-keescook@chromium.org commit 9760e50db54f3a858e67703f74f99e65784fd873 Author: Kees Cook Date: Fri Sep 22 10:32:10 2023 -0700 drm/nouveau/pm: Annotate struct nvkm_perfdom with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct nvkm_perfdom. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Ben Skeggs Cc: Karol Herbst Cc: Lyude Paul Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Lyude Paul Reviewed-by: Gustavo A. R. Silva Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230922173216.3823169-5-keescook@chromium.org commit 8f5d3daad715ea55d1cfdaa3e180d3820237cad5 Author: Kees Cook Date: Fri Sep 22 10:32:09 2023 -0700 drm/msm/dpu: Annotate struct dpu_hw_intr with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct dpu_hw_intr. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Rob Clark Cc: Abhinav Kumar Cc: Dmitry Baryshkov Cc: Sean Paul Cc: Marijn Suijten Cc: David Airlie Cc: Daniel Vetter Cc: Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230922173216.3823169-4-keescook@chromium.org commit 8a922cf12cdeadc64abdbb1c9fe330c44a045f57 Author: Kees Cook Date: Fri Sep 22 10:32:08 2023 -0700 drm/i915/selftests: Annotate struct perf_series with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct perf_series. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: David Airlie Cc: Daniel Vetter Cc: Chris Wilson Cc: John Harrison Cc: Andi Shyti Cc: Matthew Brost Cc: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Andrzej Hajda Reviewed-by: Andi Shyti Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230922173216.3823169-3-keescook@chromium.org commit ac8e62ab25f2b8d7e0077093d66f00419f382c4b Author: Kees Cook Date: Fri Sep 22 10:32:07 2023 -0700 drm/amdgpu/discovery: Annotate struct ip_hw_instance with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ip_hw_instance. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: Hawking Zhang Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook Acked-by: Alex Deucher Reviewed-by: Gustavo A. R. Silva Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230922173216.3823169-2-keescook@chromium.org commit a640e3c3a573f53088e251b2fb6e7cd7a9546151 Author: Kees Cook Date: Fri Sep 22 10:32:06 2023 -0700 drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct smu10_voltage_dependency_table. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Evan Quan Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: Xiaojian Du Cc: Huang Rui Cc: Kevin Wang Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Kees Cook Acked-by: Alex Deucher Reviewed-by: Gustavo A. R. Silva Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230922173216.3823169-1-keescook@chromium.org commit 4d08c3d12b61022501989f9f071514d2d6f77c47 Author: Jinjie Ruan Date: Wed Aug 23 11:50:20 2023 +0800 misc: st_core: Do not call kfree_skb() under spin_lock_irqsave() It is not allowed to call kfree_skb() from hardware interrupt context or with hardware interrupts being disabled. So replace kfree_skb() with dev_kfree_skb_irq() under spin_lock_irqsave(). Compile tested only. Fixes: 53618cc1e51e ("Staging: sources for ST core") Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230823035020.1281892-1-ruanjinjie@huawei.com Signed-off-by: Greg Kroah-Hartman commit e372aee8c24957cbcb55d93b14ba386096497bca Author: Claudiu Beznea Date: Fri Sep 29 08:38:59 2023 +0300 dt-bindings: clock: renesas,rzg2l-cpg: Document RZ/G3S SoC Add documentation for the RZ/G3S CPG. The RZ/G3S CPG module is almost identical to the one available in RZ/G2{L,UL}, the exception being some core clocks as follows: - The SD clock is composed of a mux and a divider, and the divider has some limitations (div = 1 cannot be set if mux rate is 800MHz), - There are 3 SD clocks, - The OCTA and TSU clocks are specific to RZ/G3S, - PLL1/4/6 are specific to RZ/G3S with its own computation formula. Even with this RZ/G3S could use the same bindings as RZ/G2L. Along with documentation bindings for the RZ/G3S (R9A08G045) Clock Pulse Generator (CPG) core clocks, module clocks and resets were added. Signed-off-by: Claudiu Beznea Acked-by: Rob Herring Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230929053915.1530607-13-claudiu.beznea@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 8d1b43f6a6df7bcea20982ad376a000d90906b42 Author: Hanno Böck Date: Mon Aug 28 18:41:17 2023 +0200 tty: Restrict access to TIOCLINUX' copy-and-paste subcommands TIOCLINUX can be used for privilege escalation on virtual terminals when code is executed via tools like su/sudo and sandboxing tools. By abusing the selection features, a lower-privileged application can write content to the console, select and copy/paste that content and thereby executing code on the privileged account. See also the poc here: https://www.openwall.com/lists/oss-security/2023/03/14/3 Selection is usually used by tools like gpm that provide mouse features on the virtual console. gpm already runs as root (due to earlier changes that restrict access to a user on the current TTY), therefore it will still work with this change. With this change, the following TIOCLINUX subcommands require CAP_SYS_ADMIN: * TIOCL_SETSEL - setting the selected region on the terminal * TIOCL_PASTESEL - pasting the contents of the selected region into the input buffer * TIOCL_SELLOADLUT - changing word-by-word selection behaviour The security problem mitigated is similar to the security risks caused by TIOCSTI, which, since kernel 6.2, can be disabled with CONFIG_LEGACY_TIOCSTI=n. Signed-off-by: Hanno Böck Signed-off-by: Günther Noack Tested-by: Günther Noack Link: https://lore.kernel.org/r/20230828164117.3608812-2-gnoack@google.com Signed-off-by: Greg Kroah-Hartman commit a083c755e136844a934bc9b4416cd23b5c19c617 Author: Masahiro Yamada Date: Fri Sep 8 22:58:40 2023 +0900 devres: rename the first parameter of devm_add_action(_or_reset) The first parameter of devm_add_action(_or_reset) is a device. The name 'release' is confusing because it is often used for dr_release_t in the devres context. Rename it to 'dev'. No functional change intended. Signed-off-by: Masahiro Yamada Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230908135840.2362708-1-masahiroy@kernel.org Signed-off-by: Greg Kroah-Hartman commit 243e1b776f613501cd8de4e56c2eb415c942bb04 Author: Andy Shevchenko Date: Tue Oct 3 17:21:22 2023 +0300 driver core: platform: Unify the firmware node type check OF and ACPI currently are using asymmetrical APIs to check for the firmware node type. Unify them by using is_*_node() against struct fwnode_handle pointer. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231003142122.3072824-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 6136597c8feae2cfefd80973b966c092c4ab42d9 Author: Andy Shevchenko Date: Tue Oct 3 17:21:21 2023 +0300 driver core: platform: Use temporary variable in platform_device_add() With the temporary variable for the struct device pointer the code looks better and slightly easier to read and parse by human being. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231003142122.3072824-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a549e3aac29cde86c1ade76909df759918c11653 Author: Andy Shevchenko Date: Tue Oct 3 17:21:20 2023 +0300 driver core: platform: Refactor error path in a couple places The usual pattern is to bail out on the error case. Besides that one of the labels is redundant as we may return directly. Refactor platform_device_add() and platform_dma_configure() accordingly. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231003142122.3072824-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit aab8aa0d35fc59e81c367cf34f990aaf48d24419 Author: Andy Shevchenko Date: Tue Oct 3 17:21:19 2023 +0300 driver core: platform: Drop redundant check in platform_device_add() Starting from the commit 37c12e7497b6 ("[DRIVER MODEL] Improved dynamically allocated platform_device interface") the pdev expects to be allocated beforehand or guaranteed to be non-NULL. Hence the leftover check is now redundant (as we have no combined calls like platform_device_add(platform_device_alloc(...)) in the entire kernel source code. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231003142122.3072824-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 0113a99b8a75f307439c2950cec5b5dab818f35c Author: Heiner Kallweit Date: Sun Sep 24 23:49:09 2023 +0200 eeprom: Remove deprecated legacy eeprom driver Driver was marked deprecated 4 years ago, so it's time to remove it. This driver is the only i2c client driver using class I2C_CLASS_SPD. Apparently, as a follow-up step, we can remove I2C_CLASS_SPD altogether. Signed-off-by: Heiner Kallweit Reviewed-by: Jean Delvare Link: https://lore.kernel.org/r/18241458-52db-4537-bead-d570801253c3@gmail.com Signed-off-by: Greg Kroah-Hartman commit bcdf91c9f9077d24153258faa4942512a340d399 Author: Justin Stitt Date: Wed Sep 27 05:37:06 2023 +0000 eeprom: idt_89hpesx: replace open-coded kmemdup_nul A malloc + strncpy + manual NUL_termination is just kmemdup_nul. Let's use this interface as it is less error-prone and more readable. Also drop `csraddr_len` as it is just used in a single place and we can just do the arithmetic in-line. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Cc: Kees Cook Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230927-strncpy-drivers-misc-eeprom-idt_89hpesx-c-v1-1-08e3d45b8c05@google.com Signed-off-by: Greg Kroah-Hartman commit 1053c4a4b8fcbd28386e80347e7c82d4d617e352 Author: Greg Kroah-Hartman Date: Thu Oct 5 10:51:11 2023 +0200 Revert "usb: gadget: uvc: stop pump thread on video disable" This reverts commit 3a63f86c6a6cb0601f0563a81574745da2979e3b. Based on review comments, it was applied too soon and needs more work. Reported-by: Laurent Pinchart Link: https://lore.kernel.org/r/20231005081716.GA13853@pendragon.ideasonboard.com Cc: Michael Grzeschik Signed-off-by: Greg Kroah-Hartman commit dddc00f255415b826190cfbaa5d6dbc87cd9ded1 Author: Greg Kroah-Hartman Date: Thu Oct 5 10:51:04 2023 +0200 Revert "usb: gadget: uvc: cleanup request when not in correct state" This reverts commit 52a39f2cf62bb5430ad1f54cd522dbfdab1d71ba. Based on review comments, it was applied too soon and needs more work. Reported-by: Laurent Pinchart Link: https://lore.kernel.org/r/20231005081716.GA13853@pendragon.ideasonboard.com Cc: Michael Grzeschik Signed-off-by: Greg Kroah-Hartman commit e0fa80bbede825f470869f41b132daff99f33a1c Author: Greg Kroah-Hartman Date: Thu Oct 5 10:50:57 2023 +0200 Revert "usb: gadget: uvc: rework pump worker to avoid while loop" This reverts commit bb00788bd62778ef80a97d67a0e3c569ac6be06f. Based on review comments, it was applied too soon and needs more work. Reported-by: Laurent Pinchart Link: https://lore.kernel.org/r/20231005081716.GA13853@pendragon.ideasonboard.com Cc: Michael Grzeschik Signed-off-by: Greg Kroah-Hartman commit 0cff993e08a7578e2c1df93a95fc5059f447e7ae Author: pangzizhen001@208suo.com Date: Thu Jul 20 23:45:39 2023 +0800 locking/seqlock: Fix typo in comment s/the the /the [ mingo: Cleaned up the changelog. ] Signed-off-by: Zizhen Pang Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/70293ecd5bb7a1cd370fd4d95c35f936@208suo.com commit e6814ec3ba1994561db9b1c05a80227d30cc18fa Author: Xiu Jianfeng Date: Fri Jul 21 09:06:07 2023 +0000 perf/core: Rename perf_proc_update_handler() -> perf_event_max_sample_rate_handler(), for readability Follow the naming pattern of the other sysctl handlers in perf. Signed-off-by: Xiu Jianfeng Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230721090607.172002-1-xiujianfeng@huawei.com commit bab9fa6dc5e4483749838877deebe038de3ce97e Author: Brian Gerst Date: Fri Jul 21 12:10:16 2023 -0400 x86/entry/32: Remove SEP test for SYSEXIT SEP must be already be present in order for do_fast_syscall_32() to be called on native 32-bit, so checking it again is unnecessary. Signed-off-by: Brian Gerst Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230721161018.50214-6-brgerst@gmail.com commit 0d3109ad2e6125add5b3c88e8de3fb7bfd4e8c49 Author: Brian Gerst Date: Fri Jul 21 12:10:15 2023 -0400 x86/entry/32: Convert do_fast_syscall_32() to bool return type Doesn't have to be 'long' - this simplifies the code a bit. Signed-off-by: Brian Gerst Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230721161018.50214-5-brgerst@gmail.com commit eec62f61e134d6711f98d4005c6439f24d03d54f Author: Brian Gerst Date: Fri Jul 21 12:10:14 2023 -0400 x86/entry/compat: Combine return value test from syscall handler Move the sysret32_from_system_call label to remove a duplicate test of the return value from the syscall handler. Signed-off-by: Brian Gerst Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230721161018.50214-4-brgerst@gmail.com commit eb43c9b1517b48e2ff0d3a584aca197338987d7b Author: Brian Gerst Date: Fri Jul 21 12:10:12 2023 -0400 x86/entry/64: Remove obsolete comment on tracing vs. SYSRET This comment comes from a time when the kernel attempted to use SYSRET on all returns to userspace, including interrupts and exceptions. Ever since commit fffbb5dc ("Move opportunistic sysret code to syscall code path"), SYSRET is only used for returning from system calls. The specific tracing issue listed in this comment is not possible anymore. Signed-off-by: Brian Gerst Signed-off-by: Ingo Molnar Cc: Andy Lutomirski Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Josh Poimboeuf Link: https://lore.kernel.org/r/20230721161018.50214-2-brgerst@gmail.com commit 3fc18b06b8f3408951b5e43548f22984412b0831 Merge: a11e097504ac1 8a749fd1a8720 Author: Ingo Molnar Date: Thu Oct 5 10:05:51 2023 +0200 Merge tag 'v6.6-rc4' into x86/entry, to pick up fixes Signed-off-by: Ingo Molnar commit 06d0b811883b867b9a6336585b9122fcde20f078 Author: Umang Jain Date: Sat Sep 23 20:02:00 2023 +0530 staging: bcm2835-audio: Register bcm2835-audio with vchiq_bus_type Similar to how bcm2385-camera device is registered, register the bcm2835-audio with vchiq_bus_type as well. Since we moved away bcm2835-audio from platform driver/device, we have to set the DMA mask explicitly. Set the DMA mask at probe time. Meanwhile at it, change the name and module alias from "bcm2835_audio" to "bcm2835-audio" to be consistent with bcm2835-camera device. This does not brings any functional change as '-' and '_' are interchangeable as per modprobe man pages. Also, drop vchiq_register_child() helper which is no longer needed after this patch. Signed-off-by: Umang Jain Link: https://lore.kernel.org/r/20230923143200.268063-7-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 899038ae82bd65191c6a2f19bf693bf6f24e5b3c Author: Umang Jain Date: Sat Sep 23 20:01:59 2023 +0530 staging: bcm2835-camera: Register bcm2835-camera with vchiq_bus_type Register the bcm2835-camera with the vchiq_bus_type instead of using platform driver/device. Since we moved away bcm2835-camera from platform driver/device, we have to set the DMA mask explicitly. Set the DMA mask at probe time. Also the VCHIQ firmware doesn't support device enumeration, hence one has to maintain a list of devices to be registered in the interface. Signed-off-by: Umang Jain Link: https://lore.kernel.org/r/20230923143200.268063-6-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 162bd0dda990e25a9d55412a8b6db245a2cf77f6 Author: Umang Jain Date: Sat Sep 23 20:01:58 2023 +0530 staging: vc04_services: vchiq_arm: Register vchiq_bus_type Register the vchiq_bus_type bus with the vchiq interface. The bcm2835-camera and bcm2835_audio will be registered to this bus type going ahead. Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/20230923143200.268063-5-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 027e5703de6bfa1887443ed335118658e6fb41aa Author: Umang Jain Date: Sat Sep 23 20:01:57 2023 +0530 staging: vc04_services: vchiq_arm: Add new bus type and device type The devices that the vchiq interface registers (bcm2835-audio, bcm2835-camera) are implemented and exposed by the VC04 firmware. The device tree describes the VC04 itself with the resources required to communicate with it through a mailbox interface. However, the vchiq interface registers these devices as platform devices. This also means the specific drivers for these devices are getting registered as platform drivers. This is not correct and a blatant abuse of platform device/driver. Add a new bus type, vchiq_bus_type and device type (struct vchiq_device) which will be used to migrate child devices that the vchiq interfaces creates/registers from the platform device/driver. Signed-off-by: Umang Jain Link: https://lore.kernel.org/r/20230923143200.268063-4-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 311b94dc641dcb06b54e5e70555f19c6413eda96 Author: Umang Jain Date: Sat Sep 23 20:01:56 2023 +0530 staging: vc04_services: bcm2835-audio: Explicitly set DMA mask In the following patches, vchiq_arm will be migrated to create and use its own bus and all the vchiq drivers (bcm2835-camera, bcm2835-audio) will be registered to it. Since the platform driver/device model internally sets the DMA mask for its registered devices, we would have to do it ourself when we remove the platform driver/device registration for vchiq devices. This patch explicitly sets the DMA mask to bcm2835-audio so as not to introduce a regression when we move away from platform device/driver model. Signed-off-by: Umang Jain Link: https://lore.kernel.org/r/20230923143200.268063-3-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit bc65b13eddc35f0cf5b429ca143b9394a6826707 Author: Umang Jain Date: Sat Sep 23 20:01:55 2023 +0530 staging: vc04_services: bcm2835-camera: Explicitly set DMA mask In the following patches, vchiq_arm will be migrated to create and use its own bus and all the vchiq drivers (bcm2835-camera, bcm2835-audio) will be registered to it. Since the platform driver/device model internally sets the DMA mask for its registered devices, we would have to do it ourself when we remove the platform driver/device registration for vchiq devices. This patch explicitly sets the DMA mask to bcm2835-camera so as not to introduce a regression when we move away from platform device/driver model. Signed-off-by: Umang Jain Link: https://lore.kernel.org/r/20230923143200.268063-2-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman commit 274fba8bb9e3dd581d91372a0bb84fe32870aa60 Author: Philipp Hortmann Date: Tue Oct 3 21:34:17 2023 +0200 staging: rtl8192e: Remove constant variable bToOtherSTA Remove variable bToOtherSTA as it is set to 0 and unchanged. The equations result accordingly. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/ecfcd8bff80d98a4e9a2797535a274625607c699.1696360404.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0c82f418112ccf61d26cb9018a141d74d358b9e1 Author: Philipp Hortmann Date: Tue Oct 3 21:34:07 2023 +0200 staging: rtl8192e: Remove constant variable net_promiscuous_md Remove variable net_promiscuous_md as it is set to 0 and unchanged. The equations result accordingly. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/84a9865f763feeaaa51ce9abecf76c848e13580e.1696360404.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit ff56e82adf81b8a42da6fdb3aa7119e74c9df390 Author: Philipp Hortmann Date: Tue Oct 3 21:34:01 2023 +0200 staging: rtl8192e: Remove constant variable promiscuous_on Remove variable promiscuous_on as it is set to 0 and unchanged. The equation results accordingly. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/07936bcc6a426d6f6d74bece2970ab6028abef44.1696360404.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1e420c19803cd6d9b8f853c45e19a0e1f84a901b Author: Philipp Hortmann Date: Tue Oct 3 21:33:55 2023 +0200 staging: rtl8192e: Remove constant variable fltr_src_sta_frame Remove variable fltr_src_sta_frame as it is set to 0 and unchanged. The equation results accordingly. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/1a37a8be464bb25531657aa7c868201676d7abb6.1696360404.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4ba2590bff3195eb8c9254154c03156de8984ff9 Author: Philipp Hortmann Date: Tue Oct 3 21:33:47 2023 +0200 staging: rtl8192e: Remove function _rtl92e_wx_get_promisc_mode() Remove function _rtl92e_wx_get_promisc_mode() as this functionality is not commonly used and the tool to access it is deprecated. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/8b1735a3f249b1cf73189e98a07e134c5cd50974.1696360404.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0fe73dca6c94a1ea790f9aac3850b7b3091aa273 Author: Philipp Hortmann Date: Tue Oct 3 21:33:41 2023 +0200 staging: rtl8192e: Remove function _rtl92e_wx_set_promisc_mode() Remove function _rtl92e_wx_set_promisc_mode() as this functionality is not commonly used and the tool to access it is deprecated. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/d318afeae38f14db36da9f2b229ff61535b815c8.1696360404.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit ea4ba9614f222b24187780bd6ada1dedd4ffaa6c Author: Philipp Hortmann Date: Tue Oct 3 21:33:33 2023 +0200 staging: rtl8192e: Remove unused parameter mesh_flag Remove unused parameter mesh_flag of function rtllib_softmac_start_protocol(). Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/3daa591db70978b305e4a1db7353fd96574d5591.1696360403.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit f3f03ebb48f97a03b938e17aaef498fc75f8bbf8 Author: Philipp Hortmann Date: Tue Oct 3 21:33:27 2023 +0200 staging: rtl8192e: Remove unused variable raw_tx Remove unused variable raw_tx as it is just set to 0 and not used. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/7ab7606ba836746d28afdb72914fb4e05824dac8.1696360403.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 841ee18e57cf5e8b8f72a2310fe7ff65be57d6d8 Author: Philipp Hortmann Date: Tue Oct 3 21:33:19 2023 +0200 staging: rtl8192e: Remove function rtllib_start_monitor_mode() Remove equation with raw_tx in function rtllib_start_monitor_mode() as it is always false. rtllib_start_monitor_mode() is then empty and can be removed as well. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/0031b5f9150851e5ec86a56c1ffad5488fa065f4.1696360403.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit a65552cf00b1b77d1a4ade5547e8e269d23f65a5 Author: Philipp Hortmann Date: Tue Oct 3 21:33:12 2023 +0200 staging: rtl8192e: Remove equation in function rtllib_xmit_inter() Remove equation with raw_tx in function rtllib_xmit_inter() as it is always true. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/970cd327eaecab8565e7486bbf62e1440a3b44b7.1696360403.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 093eeaa28ff7968db5b4d72ff562b090006ddc06 Author: Philipp Hortmann Date: Tue Oct 3 21:33:05 2023 +0200 staging: rtl8192e: Remove function _rtl92e_wx_set_rawtx() Remove function _rtl92e_wx_set_rawtx() as this functionality is not commonly used and the tool to access it is deprecated. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/96196bf0f45934e8e49f1d185165e2a36f5bca7d.1696360403.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit d459c3c0cb4c198300a7216c2c2727c37d92fc6e Author: Tree Davies Date: Mon Oct 2 20:18:49 2023 -0700 Staging: rtl8192e: Rename variable pBA Rename variable pBA to ba to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Link: https://lore.kernel.org/r/20231003031849.176743-4-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 782bfb06247ca508462f6167d500f3f47b583777 Author: Tree Davies Date: Mon Oct 2 20:18:48 2023 -0700 Staging: rtl8192e: Rename variable bCurrentHTSupport Rename variable bCurrentHTSupport to current_ht_support to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Link: https://lore.kernel.org/r/20231003031849.176743-3-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit a1471d8830da55dfe301ecc915449b611fad46c2 Author: Tree Davies Date: Mon Oct 2 20:18:47 2023 -0700 Staging: rtl8192e: Rename variable pTSInfo Rename variable pTSInfo to ts_info to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Link: https://lore.kernel.org/r/20231003031849.176743-2-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit c61d7510ea0ba9ae173b70acc0cd320fcb080fea Author: Philipp Hortmann Date: Mon Oct 2 19:53:56 2023 +0200 staging: rtl8192e: Remove constant parameter from rtllib_stop_protocol() Remove constant parameter shutdown of function rtllib_stop_protocol(). shutdown is always true. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/7eebcd3a8637b686331e34532136df3e7760f869.1696266965.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit fe8ab331af3f71ba547ffc3e48ea44c4267cad12 Author: Philipp Hortmann Date: Mon Oct 2 19:53:45 2023 +0200 staging: rtl8192e: Remove unused/constant parameter mesh_flag and shutdown Remove parameters mesh_flag and shutdown of function rtllib_softmac_stop_protocol(). mesh_flag is unused. shutdown is always true. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/5a8f87165b10fd93e3e2fad83ff3380c9f4f22b2.1696266965.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 33b0503ad09ff5c73844038bc78a423aeed4b2ea Author: Philipp Hortmann Date: Mon Oct 2 19:53:38 2023 +0200 staging: rtl8192e: Remove unused variable rfc_txpowertrackingindex rfc_txpowertrackingindex is initialized to 0 and unchanged. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/20a1f7b8297e93e2f0e593f3ddd772ff10d1fecb.1696266965.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit fcc25eb4ab79f4886925c6b862c2130dc6363cf0 Author: Philipp Hortmann Date: Mon Oct 2 19:53:32 2023 +0200 staging: rtl8192e: Remove unused variable rate_adaptive_disabled rate_adaptive_disabled is initialized to 0 and unchanged. The equation results accordingly. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/31ba05bce9966dfac15cac15aa0e79cf36fad27f.1696266964.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3390f2627bfd82d25468a2fe70c66d585ca07869 Author: Philipp Hortmann Date: Mon Oct 2 19:53:26 2023 +0200 staging: rtl8192e: Remove unused variable last_ratr last_ratr is written but never evaluated. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/2b91a8f4ec6184c2f16b8f65bdf65c69a4d17458.1696266964.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4a0fc1c07dba35cda2acc89a3bc33babec96d312 Author: Philipp Hortmann Date: Mon Oct 2 19:53:20 2023 +0200 staging: rtl8192e: Remove unused function rtl92e_cam_restore() rtl92e_cam_restore() is unused. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/4375f7909fe717555adca1338506fb6d4dad142e.1696266964.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit b85875603f1e542a9b0c1dce4f309aeb7db79a53 Author: Philipp Hortmann Date: Mon Oct 2 19:53:15 2023 +0200 staging: rtl8192e: Remove unused function rtl92e_dm_restore_state() Remove rtl92e_dm_restore_state() as it is unused. Remove called functions _rtl92e_dm_tx_power_reset_recovery() and _rtl92e_dm_bb_initialgain_restore() as well. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/be2293f1e50993ae473130403b6150d04427576e.1696266964.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8e386a037b75a28abe5514c84cb19b468ffffd93 Author: Philipp Hortmann Date: Mon Oct 2 19:53:08 2023 +0200 staging: rtl8192e: Remove unused function rtl92e_dm_backup_state() rtl92e_dm_backup_state() is unused. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/104b248b35b4fda560056fc4ab4ac230dea98d3f.1696266964.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit f656445356349a9b9925708fb97fd2c9c85ae349 Author: Philipp Hortmann Date: Sun Oct 1 15:45:27 2023 +0200 staging: rtl8192e: Remove r8192_private_handler _rtl92e_wx_force_reset() Remove r8192_private_handler _rtl92e_wx_force_reset() as driver does not reset. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/8447643122088ff03dab65ac15e5e5199603008d.1696165351.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5fb6ef8702c0ba613684cdae593dea49b3e1f382 Author: Philipp Hortmann Date: Sun Oct 1 15:45:21 2023 +0200 staging: rtl8192e: Remove unused variables priv->reset_count and reset_cnt Remove unused variables priv->reset_count, reset_cnt and reset_cnt_highpwr as those are always 0. All equations result accordingly. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/27adae9b824a522280485b3d16f14893bf99da4c.1696165351.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9283469604783a9034dd191f0639427b490db86d Author: Philipp Hortmann Date: Sun Oct 1 15:45:13 2023 +0200 staging: rtl8192e: Remove unused variable is_silent_reset ieee->is_silent_reset is set to false and never changed. All equations result accordingly. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/124d8f91db347e0e35184b356ba4ec39f52871cb.1696165351.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit b45ed52b707de76f549213d411f00e92af38a4d0 Author: Philipp Hortmann Date: Sun Oct 1 15:45:07 2023 +0200 staging: rtl8192e: Remove unused parameter from _rtl92e_up() Remove unused parameter is_silent_reset from _rtl92e_up(). Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/24f221c44beae8e6fbf895f82fe04b082f8679d5.1696165351.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 33f67636d98c41cec1bedca1a4115396abdd5a41 Author: Philipp Hortmann Date: Sun Oct 1 15:44:59 2023 +0200 staging: rtl8192e: Remove unused parameter from _rtl92e_sta_up() Remove unused parameter is_silent_reset from _rtl92e_sta_up(). Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/105beac3b04bd73267b3e30e6b944b381dcfa8a1.1696165351.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9b604554c476a6daa3d17dc3fd99624060250f09 Author: Philipp Hortmann Date: Sun Oct 1 15:44:54 2023 +0200 staging: rtl8192e: Remove unused variable reset_in_progress priv->reset_in_progress is set to false and never changed. All equations result accordingly. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/25259d69b955472a74725f3665238fb6daee76b4.1696165351.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 287fcbd3e68dd940d33347d00e54021c990da82f Author: Philipp Hortmann Date: Sun Oct 1 15:44:35 2023 +0200 staging: rtl8192e: Remove unused variable rst_progress priv->rst_progress is set to RESET_TYPE_NORESET and never changed. All equations are true. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/21f4ab4eff53cce0debcd113c2dc1718dc713aeb.1696165351.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0b1df0a580842fb18ca352230ed2485886d42158 Author: Philipp Hortmann Date: Sun Oct 1 15:44:28 2023 +0200 staging: rtl8192e: Remove broken function _rtl92e_if_silent_reset() When the function _rtl92e_if_silent_reset() is called the variable priv->rst_progress is set to RESET_TYPE_SILENT. Since priv->up is always true the function is left at "if (priv->up) {" without resetting. Now the function _rtl92e_if_silent_reset() is like deactivated because the equation at the very beginning is false: "if (priv->rst_progress == RESET_TYPE_NORESET) {" This leads to a state where the driver hangs in the reset state and cannot go forward. In 30% of the cases the wlan is disconnected and cannot reconnect. The rest of the time it continues working but no reset is done at all. Further requests for reset are ignored. Remove broken function _rtl92e_if_silent_reset() and remove return value of _rtl92e_if_check_reset() to avoid compiler warnings. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/8b1b04b512b5691968a49308fdc052973fbe5032.1696165351.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit ba8d9a3bb6249e7cfa07d065362915914db374b1 Author: Philipp Hortmann Date: Sun Oct 1 15:44:20 2023 +0200 staging: rtl8192e: Remove RESET_TYPE_NORMAL ResetType == RESET_TYPE_NORMAL is always false. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e951e39f0d75fb6baf8beb37e8c5fed05365078d.1696165351.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit c199cbac1431991fd40b8f705a80c2b0a1de0f1b Author: Philipp Hortmann Date: Sun Oct 1 15:44:06 2023 +0200 staging: rtl8192e: Remove dead code from _rtl92e_if_check_reset() The return value of _rtl92e_tx_check_stuck() and _rtl92e_rx_check_stuck() can only be RESET_TYPE_SILENT or RESET_TYPE_NORESET. This functions are only used in _rtl92e_if_check_reset(). In _rtl92e_if_check_reset() the return values are checked for RESET_TYPE_NORMAL which cannot occur. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/5f29332205dd76896e981fa627925d62a6bf7f63.1696165351.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 04590c88e4f00414170080bbbb886fa042e974f3 Author: Philipp Hortmann Date: Sun Oct 1 15:43:59 2023 +0200 staging: rtl8192e: Remove ibss_maxjoin_chal Remove ibss_maxjoin_chal as it is just set and never evaluated. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/7c5d512a69e5832263a0a2e8f4ea3608fe286a09.1696165351.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 058cbee52ccd7be77e373d31a4f14670cfd32018 Author: Chengfeng Ye Date: Tue Sep 26 16:13:23 2023 +0000 staging: ks7010: disable bh on tx_dev_lock As &priv->tx_dev.tx_dev_lock is also acquired by xmit callback which could be call from timer under softirq context, use spin_lock_bh() on it to prevent potential deadlock. hostif_sme_work() --> hostif_sme_set_pmksa() --> hostif_mib_set_request() --> ks_wlan_hw_tx() --> spin_lock(&priv->tx_dev.tx_dev_lock) ks_wlan_start_xmit() --> hostif_data_request() --> ks_wlan_hw_tx() --> spin_lock(&priv->tx_dev.tx_dev_lock) Signed-off-by: Chengfeng Ye Link: https://lore.kernel.org/r/20230926161323.41928-1-dg573847474@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3b9333493b5fa69f2dce8eb96bbef32df1b65c4a Author: Justin Stitt Date: Thu Oct 5 00:05:35 2023 +0000 can: peak_pci: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. NUL-padding is not required since card is already zero-initialized: | card = kzalloc(sizeof(*card), GFP_KERNEL); A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/all/20231005-strncpy-drivers-net-can-sja1000-peak_pci-c-v1-1-c36e1702cd56@google.com Signed-off-by: Marc Kleine-Budde commit 78510a4db873bea115ccfb88a9493c1465105733 Author: Jorge Sanjuan Garcia Date: Wed Sep 6 11:49:28 2023 +0000 mcb: use short version for function pointer for mcb_free_bus Just a style change so that the device release callbacks are defined in the same way for devices in mcb_bus and mcb_device. Signed-off-by: Jorge Sanjuan Garcia Co-developed-by: Jose Javier Rodriguez Barbarin Signed-off-by: Jose Javier Rodriguez Barbarin Link: https://lore.kernel.org/r/20230906114901.63174-3-JoseJavier.Rodriguez@duagon.com Signed-off-by: Greg Kroah-Hartman commit 7cda0b9eb6eb9e761f452e2ef4e81eca20b19938 Author: Andy Shevchenko Date: Tue Oct 3 17:23:46 2023 +0300 serial: core: Simplify uart_get_rs485_mode() Simplify uart_get_rs485_mode() by using temporary variable for the GPIO descriptor. With that, use proper type for the flags of the GPIO descriptor. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231003142346.3072929-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 8700a7ea5519fb0b3bad2362adfeac358c2119ce Author: Tony Lindgren Date: Wed Oct 4 09:26:48 2023 +0300 serial: 8250_omap: Drop pm_runtime_irq_safe() Let's drop the use of pm_runtime_irq_safe() for 8250_omap. The use of pm_runtime_irq_safe() is not nice as it takes a permanent usage count on the parent device. We can finally drop pm_runtime_irq_safe() safely as the kernel now knows when the uart port tx is active. This changed with commit 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM"). For serial port rx, we already use Linux generic wakeirqs for 8250_omap. To drop pm_runtime_irq_safe(), we need to add handling for shallow idle state where the port hardware may already be awake and an IO interrupt happens. We also need to replace the serial8250_rpm sync calls in the interrupt handlers with async runtime PM calls. Note that omap8250_irq() calls omap_8250_dma_handle_irq(), so we don't need separate runtime PM calls in omap_8250_dma_handle_irq(). While at it, let's also add the missing line break to the end of omap8250_runtime_resume() to group the calls. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20231004062650.64487-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit b9cbe7e8f27b4e4ab38db5ba5634d12f86574ca7 Author: Tony Lindgren Date: Wed Oct 4 11:55:10 2023 +0300 serial: 8250: Check for valid console index Let's not allow negative numbers for console index. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20231004085511.42645-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman commit 12c66bf0ec473d8819c83fa7e8f2e6c08a054965 Author: Neil Armstrong Date: Mon Oct 2 12:20:24 2023 +0200 arm64: dts: qcom: sm8550-qrd: add orientation gpio Specify orientation GPIO to the PMIC GLINK node. Signed-off-by: Neil Armstrong Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231002-topic-sm8550-upstream-type-c-orientation-v2-4-125410d3ff95@linaro.org Signed-off-by: Greg Kroah-Hartman commit 8cda5bf9c10f8bba3b9117a493836d29f1a95834 Author: Neil Armstrong Date: Mon Oct 2 12:20:23 2023 +0200 arm64: dts: qcom: sm8550-mtp: add orientation gpio Specify orientation GPIO in the PMIC GLINK node. Signed-off-by: Neil Armstrong Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231002-topic-sm8550-upstream-type-c-orientation-v2-3-125410d3ff95@linaro.org Signed-off-by: Greg Kroah-Hartman commit c6165ed2f425c273244191930a47c8be23bc51bd Author: Neil Armstrong Date: Mon Oct 2 12:20:22 2023 +0200 usb: ucsi: glink: use the connector orientation GPIO to provide switch events On SM8550, the non-altmode orientation is not given anymore within altmode events, even with USB SVIDs events. On the other side, the Type-C connector orientation is correctly reported by a signal from the PMIC. Take this gpio signal when we detect some Type-C port activity to notify any Type-C switches tied to the Type-C port connectors. Acked-by: Heikki Krogerus Signed-off-by: Neil Armstrong Reviewed-by: Dmitry Baryshkov Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20231002-topic-sm8550-upstream-type-c-orientation-v2-2-125410d3ff95@linaro.org Signed-off-by: Greg Kroah-Hartman commit 65682407f8f4b9c583f672746980ec7ec6aaef4d Author: Neil Armstrong Date: Mon Oct 2 12:20:21 2023 +0200 dt-bindings: soc: qcom: qcom,pmic-glink: add a gpio used to determine the Type-C port plug orientation On SM8450 and SM8550 based platforms, the Type-C plug orientation is given on a GPIO line for each connector which are set by the PMIC(s). Document this optional Type-C connector property, and take the assumption an active level represents an inverted/flipped orientation. Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20231002-topic-sm8550-upstream-type-c-orientation-v2-1-125410d3ff95@linaro.org Signed-off-by: Greg Kroah-Hartman commit e24bc293a6a6d29a2df235056094574ba37acc04 Author: Swarup Laxman Kotiaklapudi Date: Tue Oct 3 02:31:37 2023 +0530 usb: dwc3: document gfladj_refclk_lpm_sel field Avoid a kernel-doc warning by documenting it: drivers/usb/dwc3/core.h:1343: warning: Function parameter or member 'gfladj_refclk_lpm_sel' not described in 'dwc3' Fixes: a6fc2f1b0927 ("usb: dwc3: core: add gfladj_refclk_lpm_sel quirk") Signed-off-by: Swarup Laxman Kotiaklapudi Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20231002210137.209382-1-swarupkotikalapudi@gmail.com Signed-off-by: Greg Kroah-Hartman commit de2eb28cdb76df9ce7587e1c6552b169069af4bb Author: James Gruber Date: Thu Sep 14 15:27:46 2023 -0700 usb: gadget: f_uac2: allow changing terminal types through configfs Add "c_terminal_type" and "p_terminal_type" configfs entries in order to allow the user to change the capture and playback terminal type codes. These fields affect the type of audio device that Windows detects, so being able to modify this is useful when it would be advantageous for a gadget to be detected as something other than a generic speaker/microphone. The fields default to microphone for the capture type field and speaker for the playback type field as was the case before. Signed-off-by: James Gruber Link: https://lore.kernel.org/r/20230914222746.155126-1-jimmyjgruber@gmail.com Signed-off-by: Greg Kroah-Hartman commit af313201946a7e64f6985711136ef02f9113a8fc Author: Fabio Estevam Date: Wed Sep 27 09:35:10 2023 -0300 dt-bindings: usb: gpio-sbu-mux: Add an entry for CBDTU02043 Add a compatible entry for the NXP CBDTU02043 GPIO-based mux hardware used for connecting, disconnecting and switching orientation of the SBU lines in USB Type-C applications. CBTU02043 datasheet: https://www.nxp.com/docs/en/data-sheet/CBTU02043.pdf Signed-off-by: Fabio Estevam Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230927123511.45085-1-festevam@gmail.com Signed-off-by: Greg Kroah-Hartman commit 44ceac8c92daa2e08ba402c6609293cef2969093 Author: Randy Li Date: Fri Sep 15 01:23:24 2023 +0800 docs: driver-api: usb: update dma info We should not hide the recommend APIs in a obscure place. Signed-off-by: Randy Li Link: https://lore.kernel.org/r/20230914172336.18761-3-ayaka@soulik.info Signed-off-by: Greg Kroah-Hartman commit 1cf56299f9bc7d4b8e1e39af08f01d6380e28173 Author: Randy Li Date: Fri Sep 15 01:23:23 2023 +0800 USB: dma: remove unused function prototype usb_buffer_map_sg() and usb_buffer_unmap_sg() have no definition since the beginning of v5.4. The rest are gone from 2.6.12. Signed-off-by: Randy Li Link: https://lore.kernel.org/r/20230914172336.18761-2-ayaka@soulik.info Signed-off-by: Greg Kroah-Hartman commit 5846cdfd3d58852cdc991e589de7535151a47a4e Author: Uma Shankar Date: Fri Sep 29 13:13:06 2023 +0530 drm/i915/display: Created exclusive version of vga decode setup Current vga arbiter implementation in i915 needs a re-design. The current approach would cause real problems if anyone actually needs to talk another GPU using legacy VGA resources. The main issue is that X becomes a slideshow if it thinks there are multiple GPUs that have VGA decoding enabled as it insists on adjusting the VGA routing pretty much for every little operation involving any of the GPUs. The cleanup will be planned for i915. Meanwhile to focus on Xe upstreaming and have a cleaner separation, the said functionality is being moved to a different file exclusive for i915. Xe driver will re-use rest of the display code from i915. v2: Addressed Jani Nikula's review comments. v3: Dropped a duplicate function (Jani) v4: Updated commit message with reasoning as sugested by Ville. Signed-off-by: Uma Shankar Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/20230929074306.1533859-1-uma.shankar@intel.com commit 9418edf8ff01e7a4904aac1aca4864ecdea37593 Author: Dmitry Antipov Date: Tue Oct 3 07:33:16 2023 +0300 wifi: rtlwifi: remove unreachable code in rtl92d_dm_check_edca_turbo() Since '!(0x5ea42b & 0xffff0000)' is always false, remove unreachable block in 'rtl92d_dm_check_edca_turbo()' and convert EDCA limits to constant variables. Compile tested only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231003043318.11370-1-dmantipov@yandex.ru commit 036042e15770eab835e8e13f8164c6df63a74dbb Author: Zong-Zhe Yang Date: Tue Oct 3 09:54:46 2023 +0800 wifi: rtw89: debug: txpwr table supports Wi-Fi 7 chips We add TX power table format for Wi-Fi 7 chips. Since Wi-Fi 7 tables are larger, in order to reuse some chunks, we extend code to process nested entries. Now, dbgfs txpwr_table can work with Wi-Fi 7 chips. An output example of dbgfs txpwr_table on Wi-Fi 7 chips is shown below. ... [TX power byrate] << BW20 >> CCK - 1M 2M 5.5M 11M | 20, 20, 20, 20, dBm LEGACY - 6M 9M 12M 18M | 18, 18, 18, 18, dBm LEGACY - 24M 36M 48M 54M | 18, 18, 17, 16, dBm EHT - MCS14 MCS15 | 0, 0, dBm DLRU_EHT - MCS14 MCS15 | 0, 18, dBm MCS_1SS - MCS0 MCS1 MCS2 MCS3 | 18, 18, 18, 18, dBm MCS_1SS - MCS4 MCS5 MCS6 MCS7 | 18, 17, 16, 15, dBm MCS_1SS - MCS8 MCS9 MCS10 MCS11 | 14, 13, 12, 11, dBm MCS_1SS - MCS12 MCS13 | 10, 9, dBm HEDCM_1SS - MCS0 MCS1 MCS3 MCS4 | 18, 18, 18, 18, dBm DLRU_MCS_1SS - MCS0 MCS1 MCS2 MCS3 | 18, 18, 18, 18, dBm DLRU_MCS_1SS - MCS4 MCS5 MCS6 MCS7 | 18, 17, 16, 15, dBm DLRU_MCS_1SS - MCS8 MCS9 MCS10 MCS11 | 14, 13, 12, 11, dBm DLRU_MCS_1SS - MCS12 MCS13 | 10, 9, dBm DLRU_HEDCM_1SS - MCS0 MCS1 MCS3 MCS4 | 18, 18, 18, 18, dBm MCS_2SS - MCS0 MCS1 MCS2 MCS3 | 18, 18, 18, 18, dBm ... [TX power limit] << 1TX >> CCK_20M - NON_BF BF | 0, 0, dBm CCK_40M - NON_BF BF | 0, 0, dBm OFDM - NON_BF BF | 18, 0, dBm MCS_20M_0 - NON_BF BF | 18, 0, dBm MCS_20M_1 - NON_BF BF | 0, 0, dBm ... Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231003015446.14658-8-pkshih@realtek.com commit f680fc56956673a84c253ea688fe48b703f11bfb Author: Zong-Zhe Yang Date: Tue Oct 3 09:54:45 2023 +0800 wifi: rtw89: debug: show txpwr table according to chip gen Since current TX power stuffs are for ax chips, add a suffix `_ax` to them. Then, when requested to show txpwr table, select table according to chip generation first. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231003015446.14658-7-pkshih@realtek.com commit 932f85c18aef095dc8b573112f6c3b955ff43a72 Author: Zong-Zhe Yang Date: Tue Oct 3 09:54:44 2023 +0800 wifi: rtw89: phy: set TX power RU limit according to chip gen Wi-Fi 6 chips and Wi-Fi 7 chips have different register design for TX power RU limit. We rename original setting stuffs with a suffix `_ax`, concentrate related enum declaration in phy.h, and implement setting flow for Wi-Fi 7 chips. Then, we set TX power RU limit according to chip generation. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231003015446.14658-6-pkshih@realtek.com commit 70aa04f2d58cc5f3a94ce02f6442e9bac6c2468e Author: Zong-Zhe Yang Date: Tue Oct 3 09:54:43 2023 +0800 wifi: rtw89: phy: set TX power limit according to chip gen Wi-Fi 6 chips and Wi-Fi 7 chips have different register design for TX power limit. We rename original setting stuffs with a suffix `_ax`, concentrate related enum declaration in phy.h, and implement setting flow for Wi-Fi 7 chips. Then, we set TX power limit according to chip generation. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231003015446.14658-5-pkshih@realtek.com commit 3b7dc652cc40bf7550cfaa1b3b49dd96f3d35904 Author: Zong-Zhe Yang Date: Tue Oct 3 09:54:42 2023 +0800 wifi: rtw89: phy: set TX power offset according to chip gen We have a register to control TX power of each rate section to increase or decrease an offset. But, Wi-Fi 6 chips and Wi-Fi 7 chips have different address and format for this control register. We rename original setting stuffs with a suffix `_ax` and implement setting flow for Wi-Fi 7 chips. Then, we set TX power offset according to chip generation. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231003015446.14658-4-pkshih@realtek.com commit d51366421529fb6507d1936059fa40d51c20e216 Author: Zong-Zhe Yang Date: Tue Oct 3 09:54:41 2023 +0800 wifi: rtw89: phy: set TX power by rate according to chip gen Wi-Fi 6 chips and Wi-Fi 7 chips have different register design for TX power by rate. We rename original setting stuffs with a suffix `_ax` and implement setting flow for Wi-Fi 7 chips. Then, we set TX power by rate according to chip generation. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231003015446.14658-3-pkshih@realtek.com commit 06b26738a7bb8595e2aba51888cc8385dd892701 Author: Zong-Zhe Yang Date: Tue Oct 3 09:54:40 2023 +0800 wifi: rtw89: mac: get TX power control register according to chip gen There are two difference between Wi-Fi 6 and Wi-Fi 7 chips. 1. Address range of TX power control register 2. Checking code to get a TX power control register So, separate the implementation of them, access according to chip generation, and rename original things with a suffix `_ax`. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231003015446.14658-2-pkshih@realtek.com commit 453a62a3ee65aeba6e69bfd09227fc2f19290bea Author: Kalle Valo Date: Tue Oct 3 18:01:32 2023 +0300 wifi: ath12k: fix debug messages In ath12k the debug messages were broken, no matter setting what value to the debug_mask module parameter would not get the debug messages printed. The issue is that __ath12k_dbg() uses dev_dbg() to print the debug messages which requires either enabling CONFIG_DYNAMIC_DEBUG or DEBUG symbol in the driver. ath12k is supposed to use debug_mask module to control whether debug messages are printed or not. Using both CONFIG_DYNAMIC_DEBUG and debug_mask parameter does not make any sense so switch to using dev_printk(), just like ath11k does. Now it's enough just to debug_mask module parameter to get the debug messages. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20231003150132.187875-1-kvalo@kernel.org commit 77f1ee6fd8b6e470f721d05a2e269039d5cafcb7 Author: Aditya Kumar Singh Date: Tue Oct 3 17:26:54 2023 +0300 wifi: ath11k: fix Tx power value during active CAC Tx power is fetched from firmware's pdev stats. However, during active CAC, firmware does not fill the current Tx power and sends the max initialised value filled during firmware init. If host sends this power to user space, this is wrong since in certain situations, the Tx power could be greater than the max allowed by the regulatory. Hence, host should not be fetching the Tx power during an active CAC. Fix this issue by returning -EAGAIN error so that user space knows that there's no valid value available. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Fixes: 9a2aa68afe3d ("wifi: ath11k: add get_txpower mac ops") Signed-off-by: Aditya Kumar Singh Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230912051857.2284-4-quic_adisi@quicinc.com commit 69fcb525905600a151997cd16367bb92c34a2b14 Author: Aditya Kumar Singh Date: Tue Oct 3 17:26:54 2023 +0300 wifi: ath11k: fix CAC running state during virtual interface start Currently channel definition's primary channel's DFS CAC time as well as primary channel's state i.e usable are used to set the CAC_RUNNING flag for the ath11k radio structure. However, this is wrong since certain channel definition are possbile where primary channel may not be a DFS channel but, secondary channel is a DFS channel. For example - channel 36 with 160 MHz bandwidth. In such cases, the flag will not be set which is wrong. Fix this issue by using cfg80211_chandef_dfs_usable() function from cfg80211 which return trues if at least one channel is in usable state. While at it, modify the CAC running debug log message to print the CAC time as well in milli-seconds. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aditya Kumar Singh Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230912051857.2284-3-quic_adisi@quicinc.com commit 1d495f1c896cfa8c78e7a858119e2fbfcbd0925e Author: Kees Cook Date: Tue Oct 3 16:18:28 2023 -0700 xfrm: Annotate struct xfrm_sec_ctx with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct xfrm_sec_ctx. Cc: Steffen Klassert Cc: Herbert Xu Cc: "David S. Miller" Cc: netdev@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Steffen Klassert commit d7c9ae8d5d1be0c4156d1e20e4369a77b711a4cc Author: Kajol Jain Date: Tue Oct 3 14:51:13 2023 +0530 tools/perf: Update call stack check in builtin-lock.c The perf test named "kernel lock contention analysis test" fails in powerpc system with below error: [command]# ./perf test 81 -vv 81: kernel lock contention analysis test : --- start --- test child forked, pid 2140 Testing perf lock record and perf lock contention Testing perf lock contention --use-bpf [Skip] No BPF support Testing perf lock record and perf lock contention at the same time Testing perf lock contention --threads Testing perf lock contention --lock-addr Testing perf lock contention --type-filter (w/ spinlock) Testing perf lock contention --lock-filter (w/ tasklist_lock) Testing perf lock contention --callstack-filter (w/ unix_stream) [Fail] Recorded result should have a lock from unix_stream: test child finished with -1 ---- end ---- kernel lock contention analysis test: FAILED! The test is failing because we get an address entry with 0 in perf lock samples for powerpc, and code for lock contention option "--callstack-filter" will not check further entries after address 0. Below are some of the samples from test generated perf.data file, which have 0 address in the 2nd entry of callstack: -------- sched-messaging 3409 [001] 7152.904029: lock:contention_begin: 0xc00000c80904ef00 (flags=SPIN) c0000000001e926c __traceiter_contention_begin+0x6c ([kernel.kallsyms]) 0 [unknown] ([unknown]) c000000000f8a178 native_queued_spin_lock_slowpath+0x1f8 ([kernel.kallsyms]) c000000000f89f44 _raw_spin_lock_irqsave+0x84 ([kernel.kallsyms]) c0000000001d9fd0 prepare_to_wait+0x50 ([kernel.kallsyms]) c000000000c80f50 sock_alloc_send_pskb+0x1b0 ([kernel.kallsyms]) c000000000e82298 unix_stream_sendmsg+0x2b8 ([kernel.kallsyms]) c000000000c78980 sock_sendmsg+0x80 ([kernel.kallsyms]) sched-messaging 3408 [005] 7152.904036: lock:contention_begin: 0xc00000c80904ef00 (flags=SPIN) c0000000001e926c __traceiter_contention_begin+0x6c ([kernel.kallsyms]) 0 [unknown] ([unknown]) c000000000f8a178 native_queued_spin_lock_slowpath+0x1f8 ([kernel.kallsyms]) c000000000f89f44 _raw_spin_lock_irqsave+0x84 ([kernel.kallsyms]) c0000000001d9fd0 prepare_to_wait+0x50 ([kernel.kallsyms]) c000000000c80f50 sock_alloc_send_pskb+0x1b0 ([kernel.kallsyms]) c000000000e82298 unix_stream_sendmsg+0x2b8 ([kernel.kallsyms]) c000000000c78980 sock_sendmsg+0x80 ([kernel.kallsyms]) -------- Based on commit 20002ded4d93 ("perf_counter: powerpc: Add callchain support"), incase of powerpc, the callchain saved by kernel always includes first three entries as the NIP (next instruction pointer), LR (link register), and the contents of LR save area in the second stack frame. In certain scenarios its possible to have invalid kernel instruction addresses in either of LR or the second stack frame's LR. In that case, kernel will store the address as zer0. Hence, its possible to have 2nd or 3rd callstack entry as 0. As per the current code in match_callstack_filter function, we skip the callstack check incase we get 0 address. And hence the test case is failing in powerpc. Fix this issue by updating the check in match_callstack_filter function, to not skip callstack check if the 2nd or 3rd entry have 0 address for powerpc. Result in powerpc after patch changes: [command]# ./perf test 81 -vv 81: kernel lock contention analysis test : --- start --- test child forked, pid 4570 Testing perf lock record and perf lock contention Testing perf lock contention --use-bpf [Skip] No BPF support Testing perf lock record and perf lock contention at the same time Testing perf lock contention --threads Testing perf lock contention --lock-addr Testing perf lock contention --type-filter (w/ spinlock) Testing perf lock contention --lock-filter (w/ tasklist_lock) [Skip] Could not find 'tasklist_lock' Testing perf lock contention --callstack-filter (w/ unix_stream) Testing perf lock contention --callstack-filter with task aggregation Testing perf lock contention CSV output [Skip] No BPF support test child finished with 0 ---- end ---- kernel lock contention analysis test: Ok Fixes: ebab291641be ("perf lock contention: Support filters for different aggregation") Reported-by: Disha Goel Tested-by: Disha Goel Signed-off-by: Kajol Jain Cc: maddy@linux.ibm.com Cc: atrajeev@linux.vnet.ibm.com Link: https://lore.kernel.org/r/20231003092113.252380-1-kjain@linux.ibm.com Signed-off-by: Namhyung Kim commit 8f5b62a100cb235ad7708af991b5b5899fb42778 Author: Athira Rajeev Date: Thu Sep 28 13:22:13 2023 +0530 tools/perf/tests: Fix object code reading to skip address that falls out of text section The testcase "Object code reading" fails in somecases for "fs_something" sub test as below: Reading object code for memory address: 0xc008000007f0142c File is: /lib/modules/6.5.0-rc3+/kernel/fs/xfs/xfs.ko On file address is: 0x1114cc Objdump command is: objdump -z -d --start-address=0x11142c --stop-address=0x1114ac /lib/modules/6.5.0-rc3+/kernel/fs/xfs/xfs.ko objdump read too few bytes: 128 test child finished with -1 This can alo be reproduced when running perf record with workload that exercises fs_something() code. In the test setup, this is exercising xfs code since root is xfs. # perf record ./a.out # perf report -v |grep "xfs.ko" 0.76% a.out /lib/modules/6.5.0-rc3+/kernel/fs/xfs/xfs.ko 0xc008000007de5efc B [k] xlog_cil_commit 0.74% a.out /lib/modules/6.5.0-rc3+/kernel/fs/xfs/xfs.ko 0xc008000007d5ae18 B [k] xfs_btree_key_offset 0.74% a.out /lib/modules/6.5.0-rc3+/kernel/fs/xfs/xfs.ko 0xc008000007e11fd4 B [k] 0x0000000000112074 Here addr "0xc008000007e11fd4" is not resolved. since this is a kernel module, its offset is from the DSO. Xfs module is loaded at 0xc008000007d00000 # cat /proc/modules | grep xfs xfs 2228224 3 - Live 0xc008000007d00000 And size is 0x220000. So its loaded between  0xc008000007d00000 and 0xc008000007f20000. From objdump, text section is: text 0010f7bc 0000000000000000 0000000000000000 000000a0 2**4 Hence perf captured ip maps to 0x112074 which is: ( ip - start of module ) + a0 This offset 0x112074 falls out .text section which is up to 0x10f7bc In this case for module, the address 0xc008000007e11fd4 is pointing to stub instructions. This address range represents the module stubs which is allocated on module load and hence is not part of DSO offset. To address this issue in "object code reading", skip the sample if address falls out of text section and is within the module end. Use the "text_end" member of "struct dso" to do this check. To address this issue in "perf report", exploring an option of having stubs range as part of the /proc/kallsyms, so that perf report can resolve addresses in stubs range However this patch uses text_end to skip the stub range for Object code reading testcase. Reported-by: Disha Goel Signed-off-by: Athira Rajeev Tested-by: Disha Goel Reviewed-by: Adrian Hunter Reviewed-by: Kajol Jain Cc: maddy@linux.ibm.com Cc: disgoel@linux.vnet.ibm.com Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230928075213.84392-3-atrajeev@linux.vnet.ibm.com Signed-off-by: Namhyung Kim commit 6be5d82862ee9b4e517dcfdfb064c2d671dbd45a Author: Athira Rajeev Date: Thu Sep 28 13:22:12 2023 +0530 tools/perf: Add "is_kmod" to struct dso to check if it is kernel module Update "struct dso" to include new member "is_kmod". This new field will determine if the file is a kernel module or not. To resolve the address from a sample, perf looks at the DSO maps. In case of address from a kernel module, there were some address found to be not resolved. This was observed while running perf test for "Object code reading". Though the ip falls beteen the start address of the loaded module (perf map->start ) and end address ( perf map->end), it was unresolved. This was happening because in some cases for kernel modules, address from sample points to stub instructions. To identify if the DSO is a kernel module, the new field "is_kmod" is added to "struct dso". Reported-by: Disha Goel Signed-off-by: Athira Rajeev Acked-by: Namhyung Kim Cc: kjain@linux.ibm.com Cc: maddy@linux.ibm.com Cc: disgoel@linux.vnet.ibm.com Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230928075213.84392-2-atrajeev@linux.vnet.ibm.com Signed-off-by: Namhyung Kim commit 26a5262d30e1452071bcfe86725f2fe4e164db04 Author: Athira Rajeev Date: Thu Sep 28 13:22:11 2023 +0530 tools/perf: Add text_end to "struct dso" to save .text section size Update "struct dso" to include new member "text_end". This new field will represent the offset for end of text section for a dso. For elf, this value is derived as: sh_size (Size of section in byes) + sh_offset (Section file offst) of the elf header for text. For bfd, this value is derived as: 1. For PE file, section->size + ( section->vma - dso->text_offset) 2. Other cases: section->filepos (file position) + section->size (size of section) To resolve the address from a sample, perf looks at the DSO maps. In case of address from a kernel module, there were some address found to be not resolved. This was observed while running perf test for "Object code reading". Though the ip falls beteen the start address of the loaded module (perf map->start ) and end address ( perf map->end), it was unresolved. Example: Reading object code for memory address: 0xc008000007f0142c File is: /lib/modules/6.5.0-rc3+/kernel/fs/xfs/xfs.ko On file address is: 0x1114cc Objdump command is: objdump -z -d --start-address=0x11142c --stop-address=0x1114ac /lib/modules/6.5.0-rc3+/kernel/fs/xfs/xfs.ko objdump read too few bytes: 128 test child finished with -1 Here, module is loaded at: # cat /proc/modules | grep xfs xfs 2228224 3 - Live 0xc008000007d00000 From objdump for xfs module, text section is: text 0010f7bc 0000000000000000 0000000000000000 000000a0 2**4 Here the offset for 0xc008000007f0142c ie 0x112074 falls out .text section which is up to 0x10f7bc. In this case for module, the address 0xc008000007e11fd4 is pointing to stub instructions. This address range represents the module stubs which is allocated on module load and hence is not part of DSO offset. To identify such address, which falls out of text section and within module end, added the new field "text_end" to "struct dso". Reported-by: Disha Goel Signed-off-by: Athira Rajeev Reviewed-by: Adrian Hunter Reviewed-by: Kajol Jain Acked-by: Namhyung Kim Cc: maddy@linux.ibm.com Cc: disgoel@linux.vnet.ibm.com Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230928075213.84392-1-atrajeev@linux.vnet.ibm.com Signed-off-by: Namhyung Kim commit 0ddce121b038c553d6ec103f3b9fc399f99945e9 Author: Ian Rogers Date: Fri Sep 29 23:02:06 2023 -0700 perf test: Avoid system wide when not privileged Switch the test program to sleep that makes more sense for system wide events. Only enable system wide when root or not paranoid. This avoids failures under some testing conditions like ARM cloud. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Link: https://lore.kernel.org/r/20230930060206.2353141-1-irogers@google.com Signed-off-by: Namhyung Kim commit be7a4caa7c45bd4b0a39cdb260905b52a87c8688 Author: Kuan-Wei Chiu Date: Sat Sep 30 15:27:19 2023 +0800 perf hisi-ptt: Fix memory leak in lseek failure handling In the previous code, there was a memory leak issue where the previously allocated memory was not freed upon a failed lseek operation. This patch addresses the problem by releasing the old memory before returning -errno in case of a lseek failure. This ensures that memory is properly managed and avoids potential memory leaks. Signed-off-by: Kuan-Wei Chiu Acked-by: Namhyung Kim Cc: yangyicong@hisilicon.com Cc: jonathan.cameron@huawei.com Link: https://lore.kernel.org/r/20230930072719.1267784-1-visitorckw@gmail.com Signed-off-by: Namhyung Kim commit 93e7eca853ca0087b129433630ddd89288d2b8b4 Merge: d86e5fbd4c965 e2ca31cee9095 Author: Jakub Kicinski Date: Wed Oct 4 17:33:56 2023 -0700 Merge branch 'ynl-makefile-cleanup' Jakub Kicinski says: ==================== ynl Makefile cleanup While catching up on recent changes I noticed unexpected changes to Makefiles in YNL. Indeed they were not working as intended but the fixes put in place were not what I had in mind :) ==================== Link: https://lore.kernel.org/r/20231003153416.2479808-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit e2ca31cee9095244885f2cd0df602a5eef11c826 Author: Jakub Kicinski Date: Tue Oct 3 08:34:16 2023 -0700 tools: ynl: use uAPI include magic for samples Makefile.deps provides direct includes in CFLAGS_$(obj). We just need to rewrite the rules to make use of the extra flags, no need to hard-include all of tools/include/uapi. Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20231003153416.2479808-4-kuba@kernel.org Signed-off-by: Jakub Kicinski commit a50660173c7329c5d2ce1780a0f712a7f584d378 Author: Jakub Kicinski Date: Tue Oct 3 08:34:15 2023 -0700 tools: ynl: don't regen on every make As far as I can tell the normal Makefile dependency tracking works, generated files get re-generated if the YAML was updated. Let make do its job, don't force the re-generation. make hardclean can be used to force regeneration. Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20231003153416.2479808-3-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 0629f22ec130940c9c8a15fa9a4994996816d474 Author: Jakub Kicinski Date: Tue Oct 3 08:34:14 2023 -0700 ynl: netdev: drop unnecessary enum-as-flags enum-as-flags can be used when enum declares bit positions but we want to carry bitmask in an attribute. If the definition is already provided as flags there's no need to indicate the flag-iness of the attribute. Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20231003153416.2479808-2-kuba@kernel.org Signed-off-by: Jakub Kicinski commit d86e5fbd4c965fdda72f99ccd54a1031ea4df51d Author: Eric Dumazet Date: Tue Oct 3 18:19:20 2023 +0000 net: skb_queue_purge_reason() optimizations 1) Exit early if the list is empty. 2) splice the list into a local list, so that we block hard irqs only once. Signed-off-by: Eric Dumazet Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231003181920.3280453-1-edumazet@google.com Signed-off-by: Jakub Kicinski commit 397f70e3be01e2a62d08a12fa135d0f13fea9fb8 Merge: b4ac75a3bb5cd 70dc7ab7645a4 Author: Jakub Kicinski Date: Wed Oct 4 17:27:24 2023 -0700 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-10-03 (i40e, iavf) This series contains updates to i40e and iavf drivers. Yajun Deng aligns reporting of buffer exhaustion statistics to follow documentation for i40e. Jake removes undesired 'inline' from functions in iavf. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: iavf: remove "inline" functions from iavf_txrx.c i40e: Add rx_missed_errors for buffer exhaustion ==================== Link: https://lore.kernel.org/r/20231003223610.2004976-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit b4ac75a3bb5cdf5c8bfac3f0a92db53091faba35 Merge: 78cac6f17133d f4ecb3d44a117 Author: Jakub Kicinski Date: Wed Oct 4 17:15:06 2023 -0700 Merge branch 'fix-a-couple-recent-instances-of-wincompatible-function-pointer-types-strict-from-mode_get-implementations' Nathan Chancellor says: ==================== Fix a couple recent instances of -Wincompatible-function-pointer-types-strict from ->mode_get() implementations This series fixes a couple of instances of -Wincompatible-function-pointer-types-strict that were introduced by a recent series that added a new type of ops, struct dpll_device_ops, along with implementations of the callback ->mode_get() that had a mismatched mode type. This warning is not currently enabled for any build but I am planning on submitting a patch to add it to W=1 to prevent new instances of the warning from popping up while we try and fix the existing instances in other drivers. This series is based on current net-next but if they need to go into individual maintainer trees, please feel free to take the patches individually. ==================== Link: https://lore.kernel.org/r/20231002-net-wifpts-dpll_mode_get-v1-0-a356a16413cf@kernel.org Signed-off-by: Jakub Kicinski commit f4ecb3d44a117b16029485325bda1bc98c26de36 Author: Nathan Chancellor Date: Mon Oct 2 13:55:21 2023 -0700 mlx5: Fix type of mode parameter in mlx5_dpll_device_mode_get() When building with -Wincompatible-function-pointer-types-strict, a warning designed to catch potential kCFI failures at build time rather than run time due to incorrect function pointer types, there is a warning due to a mismatch between the type of the mode parameter in mlx5_dpll_device_mode_get() vs. what the function pointer prototype for ->mode_get() in 'struct dpll_device_ops' expects. drivers/net/ethernet/mellanox/mlx5/core/dpll.c:141:14: error: incompatible function pointer types initializing 'int (*)(const struct dpll_device *, void *, enum dpll_mode *, struct netlink_ext_ack *)' with an expression of type 'int (const struct dpll_device *, void *, u32 *, struct netlink_ext_ack *)' (aka 'int (const struct dpll_device *, void *, unsigned int *, struct netlink_ext_ack *)') [-Werror,-Wincompatible-function-pointer-types-strict] 141 | .mode_get = mlx5_dpll_device_mode_get, | ^~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Change the type of the mode parameter in mlx5_dpll_device_mode_get() to clear up the warning and avoid kCFI failures at run time. Fixes: 496fd0a26bbf ("mlx5: Implement SyncE support using DPLL infrastructure") Signed-off-by: Nathan Chancellor Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231002-net-wifpts-dpll_mode_get-v1-2-a356a16413cf@kernel.org Signed-off-by: Jakub Kicinski commit 26cc115d590c70e66d8399f39e4d9973d26439bc Author: Nathan Chancellor Date: Mon Oct 2 13:55:20 2023 -0700 ptp: Fix type of mode parameter in ptp_ocp_dpll_mode_get() When building with -Wincompatible-function-pointer-types-strict, a warning designed to catch potential kCFI failures at build time rather than run time due to incorrect function pointer types, there is a warning due to a mismatch between the type of the mode parameter in ptp_ocp_dpll_mode_get() vs. what the function pointer prototype for ->mode_get() in 'struct dpll_device_ops' expects. drivers/ptp/ptp_ocp.c:4353:14: error: incompatible function pointer types initializing 'int (*)(const struct dpll_device *, void *, enum dpll_mode *, struct netlink_ext_ack *)' with an expression of type 'int (const struct dpll_device *, void *, u32 *, struct netlink_ext_ack *)' (aka 'int (const struct dpll_device *, void *, unsigned int *, struct netlink_ext_ack *)') [-Werror,-Wincompatible-function-pointer-types-strict] 4353 | .mode_get = ptp_ocp_dpll_mode_get, | ^~~~~~~~~~~~~~~~~~~~~ 1 error generated. Change the type of the mode parameter in ptp_ocp_dpll_mode_get() to clear up the warning and avoid kCFI failures at run time. Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops") Signed-off-by: Nathan Chancellor Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20231002-net-wifpts-dpll_mode_get-v1-1-a356a16413cf@kernel.org Signed-off-by: Jakub Kicinski commit d7e9a9037de27b642d5a3edef7c69e2a2b460287 Author: Daniel Rosenberg Date: Mon Oct 2 16:09:35 2023 -0700 f2fs: Support Block Size == Page Size This allows f2fs to support cases where the block size = page size for both 4K and 16K block sizes. Other sizes should work as well, should the need arise. This does not currently support 4K Block size filesystems if the page size is 16K. Signed-off-by: Daniel Rosenberg Signed-off-by: Jaegeuk Kim commit 78cac6f17133d503add9005e891e15637b2a1012 Merge: f8e5b77862376 788d30daa8f97 Author: Jakub Kicinski Date: Wed Oct 4 16:51:33 2023 -0700 Merge branch 'r8152-modify-rx_bottom' Hayes Wang says: ==================== r8152: modify rx_bottom v3: For patch #1, this patch is replaced. The new patch only break the loop, and keep that the driver would queue the rx packets. For patch #2, modify the code depends on patch #1. For work_down < budget, napi_get_frags() and napi_gro_frags() would be used. For the others, nothing is changed. v2: For patch #1, add comment, update commit message, and add Fixes tag. v1: These patches are used to improve rx_bottom(). ==================== Link: https://lore.kernel.org/r/20230926111714.9448-432-nic_swsd@realtek.com Signed-off-by: Jakub Kicinski commit 788d30daa8f97f06166b6a63f0e51f2a4c2f036a Author: Hayes Wang Date: Tue Sep 26 19:17:14 2023 +0800 r8152: use napi_gro_frags Use napi_gro_frags() for the skb of fragments when the work_done is less than budget. Signed-off-by: Hayes Wang Link: https://lore.kernel.org/r/20230926111714.9448-434-nic_swsd@realtek.com Signed-off-by: Jakub Kicinski commit 2cf51f931797d9a47e75d999d0993a68cbd2a560 Author: Hayes Wang Date: Tue Sep 26 19:17:13 2023 +0800 r8152: break the loop when the budget is exhausted A bulk transfer of the USB may contain many packets. And, the total number of the packets in the bulk transfer may be more than budget. Originally, only budget packets would be handled by napi_gro_receive(), and the other packets would be queued in the driver for next schedule. This patch would break the loop about getting next bulk transfer, when the budget is exhausted. That is, only the current bulk transfer would be handled, and the other bulk transfers would be queued for next schedule. Besides, the packets which are more than the budget in the current bulk trasnfer would be still queued in the driver, as the original method. In addition, a bulk transfer wouldn't contain more than 400 packets, so the check of queue length is unnecessary. Therefore, I replace it with WARN_ON_ONCE(). Fixes: cf74eb5a5bc8 ("eth: r8152: try to use a normal budget") Signed-off-by: Hayes Wang Link: https://lore.kernel.org/r/20230926111714.9448-433-nic_swsd@realtek.com Signed-off-by: Jakub Kicinski commit 9cff0879aefeca6eba586f02cad337e409e4f2b0 Author: Lijo Lazar Date: Wed Sep 20 15:49:30 2023 +0530 drm/amd/pm: Add GC v9.4.3 thermal limits to hwmon Publish max operating temperature of SOC and memory as temp*_emergency nodes in hwmon. temp*_crit will show the throttle temperature limits. Signed-off-by: Lijo Lazar Reviewed-by: Asad Kamal Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit df7a2808528f213c81d4db5f236d54e0d52c8f46 Author: Lijo Lazar Date: Wed Sep 20 12:08:58 2023 +0530 drm/amd/pm: Add throttle limit for SMU v13.0.6 CTF limit represents the max operating temperature and thermal limit gives the limit at which throttling starts. Add support for both limits. SOC and HBM may have different limit values.*_emergency_max gives max operating temperature and *_crit_max value represents throttle limit. Signed-off-by: Lijo Lazar Reviewed-by: Asad Kamal Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 2358ecdabe3733336a20d0ab7bdd243af550dbfb Author: Aric Cyr Date: Sun Sep 24 12:54:02 2023 -0400 drm/amd/display: 3.2.254 DC v3.2.254 * Stability fixes through null pointer checks, blackscreen fixes on certain configurations * Improvements for various functionality like Idle optimization, ILR, DSC, IPS * Fixes for ILR functionality * Trivial code cleanups =================================================================== Acked-by: Aurabindo Pillai Cc: Daniel Wheeler Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 13c0e836316a03ab859f616b85cfe25c3d69d5db Author: Aurabindo Pillai Date: Mon Sep 25 17:07:33 2023 -0400 drm/amd/display: Adjust code style for hw_sequencer.h [Why&How] * Rearrange some definitions for consistency * Drop legacy code Signed-off-by: Aurabindo Pillai Reviewed-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0653e02f4100f734011df8891097f88eb2df3a6e Author: Aurabindo Pillai Date: Mon Sep 25 16:57:50 2023 -0400 drm/amd/display: Adjust code style for dmub_cmd.h [Why&How] Make some formatting changes and rearranging of definitions for consistency. Signed-off-by: Aurabindo Pillai Reviewed-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8114c64a81b79127c64d8ba53d07207c4cdeb528 Author: Aurabindo Pillai Date: Mon Sep 25 16:55:34 2023 -0400 drm/amd/display: Update DMUB cmd header [Why&How] * Add hints about the bits used in the packed struct. * Update new bitfields for ABM and IPS Signed-off-by: Aurabindo Pillai Reviewed-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 434cf7af492fcacf7ca93c05e0bafd266b2e7cbb Author: Sung Joon Kim Date: Sun Sep 24 12:34:11 2023 -0400 drm/amd/display: Add a check for idle power optimization [why] Need a helper function to check idle power is allowed so that dc doesn't access any registers that are power-gated. [how] Implement helper function to check idle power optimization. Enable a hook to check if detection is allowed. Signed-off-by: Sung Joon Kim Acked-by: Aurabindo Pillai Reviewed-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 05b78277ef0efc1deebc8a22384fffec29a3676e Author: Wenjing Liu Date: Thu Sep 21 14:43:21 2023 -0400 drm/amd/display: use full update for clip size increase of large plane source [why] Clip size increase will increase viewport, which could cause us to switch to MPC combine. If we skip full update, we are not able to change to MPC combine in fast update. This will cause corruption showing on the video plane. [how] treat clip size increase of a surface larger than 5k as a full update. Reviewed-by: Jun Lei Acked-by: Aurabindo Pillai Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 889d55154516ec8f98ea953e8660963f2e29c75d Author: Aric Cyr Date: Mon Sep 18 20:33:15 2023 -0400 drm/amd/display: Clean up code warnings - Fix constness of string parameters - Fix zero-initialization of structs which cannot take a 0 literal as the first field, for example enums Reviewed-by: Dillon Varone Acked-by: Aurabindo Pillai Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c0af8c744e7e8f55ea2c26c80fe5c1cfee3a9359 Author: Ovidiu Bunea Date: Wed Sep 20 15:25:46 2023 -0400 drm/amd/display: Make driver backwards-compatible with non-IPS PMFW [why] Driver needs to be compatible with PM FW that doesn't support IPS [how] Toggle internal control flag Reviewed-by: Charlene Liu Acked-by: Aurabindo Pillai Signed-off-by: Ovidiu Bunea Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6ec876472ff7edeaf2a07bf6afbff74d7f1dfa35 Author: Sherry Wang Date: Fri Sep 8 14:45:00 2023 +0800 drm/amd/display: refactor ILR to make it work [Why] Current ILR toggle is on/off as a part of panel config for new function, which breaks original ILR logic [How] Refactor ILR and take panel config into account Reviewed-by: Anthony Koo Acked-by: Aurabindo Pillai Signed-off-by: Sherry Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 984abb5384b0f8644fbad3bfe1f8fd4e29c418cf Author: Chiawen Huang Date: Wed Sep 20 11:28:30 2023 +0800 drm/amd/display: remove duplicated edp relink to fastboot [Why&How] enable_accelerated_mode function is fully to check whether fastboot support or not. It is no longer to disable_vbios_mode_if_required. Reviewed-by: Anthony Koo Acked-by: Aurabindo Pillai Signed-off-by: Chiawen Huang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b3551d0b481d075127cf2cb13f925d053618ec57 Author: Samson Tam Date: Mon Sep 18 18:43:13 2023 -0400 drm/amd/display: apply edge-case DISPCLK WDIVIDER changes to master OTG pipes only [Why] The edge-case DISPCLK WDIVIDER changes call stream_enc functions. But with MPC pipes, downstream pipes have null stream_enc and will cause crash. [How] Only call stream_enc functions for pipes that are OTG master. Reviewed-by: Alvin Lee Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Aurabindo Pillai Signed-off-by: Samson Tam Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 40255df370e94d44f0f0a924400d68db0ee31bec Author: Muhammad Ahmed Date: Mon Sep 18 16:52:54 2023 -0400 drm/amd/display: enable dsc_clk even if dsc_pg disabled [why] need to enable dsc_clk regardless dsc_pg Reviewed-by: Charlene Liu Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Aurabindo Pillai Signed-off-by: Muhammad Ahmed Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 23de7616f35800412a2c4e4f7398c5601488d1aa Author: Philip Yang Date: Tue Oct 3 11:37:40 2023 -0400 drm/amdkfd: Fix EXT_COHERENT memory allocation crash If there is no VRAM domain, bo_node is NULL and this causes crash. Refactor the change, and use the module parameter as higher privilege. Need another patch to support override PTE flag on APU. Fixes: 5f248462c69d ("drm/amdgpu: Add EXT_COHERENT memory allocation flags") Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit fdac89096666ef80691994391c7ba7f03520797a Author: Philip Yang Date: Thu Sep 28 18:17:21 2023 -0400 drm/amdgpu: ratelimited override pte flags messages Use ratelimited version of dev_dbg to avoid flooding dmesg log. No functional change. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit e186400685d8a9287388a8535e2399bc673bfe95 Author: Gabe Teeger Date: Fri Sep 15 18:18:48 2023 -0400 drm/amd/display: Add Null check for DPP resource [what and why] Check whether dpp resource pointer is null in advance and return early if so. Reviewed-by: Charlene Liu Reviewed-by: Martin Leung Signed-off-by: Gabe Teeger Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b8e6aec14691b44e6a26d25052a2f4fa8c5f7b28 Author: Mario Limonciello Date: Fri Sep 29 22:14:17 2023 -0500 drm/amd: Drop all hand-built MIN and MAX macros in the amdgpu base driver Several files declare MIN() or MAX() macros that ignore the types of the values being compared. Drop these macros and switch to min() min_t(), and max() from `linux/minmax.h`. Suggested-by: Hamza Mahfooz Signed-off-by: Mario Limonciello Acked-by: Christian König Signed-off-by: Alex Deucher commit 7752ccf85b929a22e658ec145283e8f31232f4bb Author: Mario Limonciello Date: Fri Sep 29 22:12:18 2023 -0500 drm/amd: Update `update_pcie_parameters` functions to use uint8_t arguments The matching values for `pcie_gen_cap` and `pcie_width_cap` when fetched from powerplay tables are 1 byte, so narrow the arguments to match to ensure min() and max() comparisons without casts. Signed-off-by: Mario Limonciello Acked-by: Christian König Signed-off-by: Alex Deucher commit bc0b79ce2050aa523c38c96b6d26340a96bfbdca Author: Michel Dänzer Date: Mon Oct 2 16:16:49 2023 +0200 drm/amd/display: Bail from dm_check_crtc_cursor if no relevant change If no plane was newly enabled or changed scaling, there can be no new scaling mismatch with the cursor plane. By not pulling non-cursor plane states into all atomic commits while the cursor plane is enabled, this avoids synchronizing all cursor plane changes to vertical blank, which caused the following IGT tests to fail: kms_cursor_legacy@cursor-vs-flip.* kms_cursor_legacy@flip-vs-cursor.* Fixes: 003048ddf44b ("drm/amd/display: Check all enabled planes in dm_check_crtc_cursor") Signed-off-by: Michel Dänzer Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit f8e5b778623767463ec62c81cf5a357b2f1d3315 Merge: 07cf7974a2236 1508cb7e07520 Author: Jakub Kicinski Date: Wed Oct 4 15:37:15 2023 -0700 Merge branch 'chelsio-annotate-structs-with-__counted_by' Kees Cook says: ==================== chelsio: Annotate structs with __counted_by This annotates several chelsio structures with the coming __counted_by attribute for bounds checking of flexible arrays at run-time. For more details, see commit dd06e72e68bc ("Compiler Attributes: Add __counted_by macro"). ==================== Link: https://lore.kernel.org/r/20230929181042.work.990-kees@kernel.org Signed-off-by: Jakub Kicinski commit 1508cb7e07520d34b5f45992bbd172dd5728cbc7 Author: Kees Cook Date: Fri Sep 29 11:11:49 2023 -0700 cxgb4: Annotate struct smt_data with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct smt_data. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Raju Rangoju Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230929181149.3006432-5-keescook@chromium.org Signed-off-by: Jakub Kicinski commit ceba9725fb4554c3cd07d055332272208b8a052f Author: Kees Cook Date: Fri Sep 29 11:11:48 2023 -0700 cxgb4: Annotate struct sched_table with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct sched_table. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Raju Rangoju Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230929181149.3006432-4-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 157c56a4fedecb0f91a96a138a5cd8954d00541f Author: Kees Cook Date: Fri Sep 29 11:11:47 2023 -0700 cxgb4: Annotate struct cxgb4_tc_u32_table with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct cxgb4_tc_u32_table. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Raju Rangoju Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230929181149.3006432-3-keescook@chromium.org Signed-off-by: Jakub Kicinski commit c3db467b08224bfc58e65f56b895d3d32615a8f7 Author: Kees Cook Date: Fri Sep 29 11:11:46 2023 -0700 cxgb4: Annotate struct clip_tbl with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct clip_tbl. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Raju Rangoju Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230929181149.3006432-2-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 3bbae5f1c651f55046fc2a889d144a148b25192e Author: Kees Cook Date: Fri Sep 29 11:11:45 2023 -0700 chelsio/l2t: Annotate struct l2t_data with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct l2t_data. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Raju Rangoju Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230929181149.3006432-1-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 62e6a28684b21c1c575ddb14938859ba417287ab Author: Ivan Lipski Date: Mon Oct 2 13:47:54 2023 -0400 Revert "drm/amd/display: Enable Replay for static screen use cases" This reverts commit 44e60b14d5a72f91fd0bdeae8da59ae37a3ca8e5. Since, it causes a regression in which eDP displays with PSR support, but no Replay support (Sink support <= 0x03), fail to enable PSR and consequently all IGT amd_psr tests fail. So, revert this until a more suitable fix can be found. Cc: stable@vger.kernel.org Acked-by: Leo Li Signed-off-by: Ivan Lipski Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 8dbf1ba867c23a581973207d6d1d15ed72e814a7 Author: Alex Deucher Date: Thu Sep 29 11:57:12 2022 -0400 drm/amdgpu: cache gpuvm fault information for gmc7+ Cache the current fault info in the vm struct. This can be queried by userspace later to help debug UMDs. Cc: samuel.pitoiset@gmail.com Reviewed-by: Christian König Acked-by: Guchun Chen Signed-off-by: Alex Deucher commit 2e8ef6a56129526a67b1058124be0839ab8f976a Author: Alex Deucher Date: Tue Oct 6 10:54:38 2020 -0400 drm/amdgpu: add cached GPU fault structure to vm struct When we get a GPU page fault, cache the fault for later analysis. Cc: samuel.pitoiset@gmail.com Reviewed-by: Christian König Acked-by: Guchun Chen Signed-off-by: Alex Deucher commit ec4d770bbb155674c2497f255f4199bdc42287a9 Author: Michel Dänzer Date: Mon Oct 2 16:16:48 2023 +0200 drm/amd/display: Refactor dm_get_plane_scale helper Cleanup, no functional change intended. Signed-off-by: Michel Dänzer Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit f4bff6e0b9e1dc29bc54d7c7e1c01f2c701eb36f Author: Rajneesh Bhardwaj Date: Mon Oct 2 15:27:01 2023 -0400 drm/amdgpu: Use ttm_pages_limit to override vram reporting On GFXIP9.4.3 APU, allow the memory reporting as per the ttm pages limit in NPS1 mode. Reviewed-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 9b37d45d797e9441a415e17bf963423162d8f998 Author: Rajneesh Bhardwaj Date: Thu Sep 14 15:26:10 2023 -0400 drm/amdgpu: Rework KFD memory max limits To allow bigger allocations specially on systems such as GFXIP 9.4.3 that use GTT memory for VRAM allocations, relax the limits to maximize ROCm allocations. Reviewed-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 67318cb8434182ff4c3294dad6c3fbf5538aeb8e Author: Alex Deucher Date: Thu Sep 14 16:23:02 2023 -0400 drm/amdgpu/gmc11: set gart placement GC11 Needed to avoid a hardware issue. v2: force high for all GC11 parts for consistency (Alex) v3: rebase Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 917f91d8d8e866965f2193d7962e064a4d139d8d Author: Alex Deucher Date: Thu Sep 14 16:23:01 2023 -0400 drm/amdgpu/gmc: add a way to force a particular placement for GART We normally place GART based on the location of VRAM and the available address space around that, but provide an option to force a particular location for hardware that needs it. v2: Switch to passing the placement via parameter Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 52ed23dc29db2fe80e8332200e66a0e5a5c20683 Author: Wayne Lin Date: Fri Sep 22 12:04:39 2023 +0800 drm/amd/display: fix problems in power_helper [Why & How] Fix following problems: - In abm config, forget to initialize config.ambient_thresholds_lux. - Adjust the coding style problem - Restrict to call psr_su_set_dsc_slice_height() under edp only Reviewed-by: Robin Chen Signed-off-by: Wayne Lin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a19d934986b0f750ca95b5da2ebe54ee27fc25e8 Author: Lang Yu Date: Thu Sep 21 12:29:52 2023 +0800 drm/amdgpu: correct gpu clock counter query on cyan skilfish Cayn skilfish uses SMUIO v11.0.8 offset. Signed-off-by: Lang Yu Reviewed-by: Aaron Liu Signed-off-by: Alex Deucher Cc: # v5.15+ commit 409f2e92a27a210fc768c5569851b4a419e6a232 Author: Paul Durrant Date: Wed Oct 4 17:46:28 2023 +0000 KVM: x86/xen: ignore the VCPU_SSHOTTMR_future flag Upstream Xen now ignores _VCPU_SSHOTTMR_future[1], since the only guest kernel ever to use it was buggy. By ignoring the flag the guest will always get a callback if it sets a negative timeout which upstream Xen has determined not to cause problems for any guest setting the flag. [1] https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=19c6cbd909 Signed-off-by: Paul Durrant Reviewed-by: David Woodhouse Link: https://lore.kernel.org/r/20231004174628.2073263-1-paul@xen.org Signed-off-by: Sean Christopherson commit e47d86083c66525b89c7fc66cdd64d5937725563 Author: Josh Poimboeuf Date: Fri Aug 25 00:01:36 2023 -0700 KVM: x86: Add SBPB support Add support for the AMD Selective Branch Predictor Barrier (SBPB) by advertising the CPUID bit and handling PRED_CMD writes accordingly. Note, like SRSO_NO and IBPB_BRTYPE before it, advertise support for SBPB even if it's not enumerated by in the raw CPUID. Some CPUs that gained support via a uCode patch don't report SBPB via CPUID (the kernel forces the flag). Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/a4ab1e7fe50096d50fde33e739ed2da40b41ea6a.1692919072.git.jpoimboe@kernel.org Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson commit 6f0f23ef76be11bc6ace10df5e807f3542da8772 Author: Josh Poimboeuf Date: Fri Aug 25 00:01:35 2023 -0700 KVM: x86: Add IBPB_BRTYPE support Add support for the IBPB_BRTYPE CPUID flag, which indicates that IBPB includes branch type prediction flushing. Note, like SRSO_NO, advertise support for IBPB_BRTYPE even if it's not enumerated by in the raw CPUID, i.e. bypass the cpuid_count() in __kvm_cpu_cap_mask(). Some CPUs that gained support via a uCode patch don't report IBPB_BRTYPE via CPUID (the kernel forces the flag). Opportunistically use kvm_cpu_cap_check_and_set() for SRSO_NO instead of manually querying host support (cpu_feature_enabled() and boot_cpu_has() yield the same end result in this case). Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/79d5f5914fb42c2c62418ffbcd78f138645ded21.1692919072.git.jpoimboe@kernel.org Signed-off-by: Sean Christopherson commit 00682995409696866fe43984c74c8688bdf8f0a5 Author: Sean Christopherson Date: Thu Aug 24 18:36:21 2023 -0700 KVM: SVM: Treat all "skip" emulation for SEV guests as outright failures Treat EMULTYPE_SKIP failures on SEV guests as unhandleable emulation instead of simply resuming the guest, and drop the hack-a-fix which effects that behavior for the INT3/INTO injection path. If KVM can't skip an instruction for which KVM has already done partial emulation, resuming the guest is undesirable as doing so may corrupt guest state. Link: https://lore.kernel.org/r/20230825013621.2845700-5-seanjc@google.com Signed-off-by: Sean Christopherson commit aeb904f6b9f1de588cf3130dc8a2c458b236704e Author: Sean Christopherson Date: Thu Aug 24 18:36:20 2023 -0700 KVM: x86: Refactor can_emulate_instruction() return to be more expressive Refactor and rename can_emulate_instruction() to allow vendor code to return more than true/false, e.g. to explicitly differentiate between "retry", "fault", and "unhandleable". For now, just do the plumbing, a future patch will expand SVM's implementation to signal outright failure if KVM attempts EMULTYPE_SKIP on an SEV guest. No functional change intended (or rather, none that are visible to the guest or userspace). Link: https://lore.kernel.org/r/20230825013621.2845700-4-seanjc@google.com Signed-off-by: Sean Christopherson commit 916e15b73bdd36233adc8118ec295cd98fc68049 Merge: a7de2727e5f35 0cd3f86ad558d Author: Ulf Hansson Date: Wed Oct 4 23:42:07 2023 +0200 pmdomain: Merge branch genpd_dt into next Merge the immutable branch genpd_dt into next, to allow the DT bindings to be tested together with new pmdomain changes that are targeted for v6.7. Signed-off-by: Ulf Hansson commit a7de2727e5f35110fe68ea08c899647a41bcc86c Author: Changhuang Liang Date: Wed Sep 27 06:07:34 2023 -0700 pmdomain: starfive: Update prefixes for AON power domain Use "JH7110_AON_PD_" prefix for AON power doamin for JH7110 SoC. Reviewed-by: Walker Chen Signed-off-by: Changhuang Liang Link: https://lore.kernel.org/r/20230927130734.9921-3-changhuang.liang@starfivetech.com Signed-off-by: Ulf Hansson commit 793f4def8c0a4e0ba8e711421768fd2bcca04cd1 Author: Changhuang Liang Date: Wed Sep 27 06:07:33 2023 -0700 dt-bindings: power: Update prefixes for AON power domain Use "JH7110_AON_PD_" prefix for AON power domain for JH7110 SoC. Reviewed-by: Walker Chen Signed-off-by: Changhuang Liang Acked-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230927130734.9921-2-changhuang.liang@starfivetech.com Signed-off-by: Ulf Hansson commit 0958eccbeb818f56b314c34881315bd6e81d90e2 Author: Danila Tikhonov Date: Sat Sep 16 20:59:52 2023 +0300 pmdomain: qcom: rpmhpd: Add support for SM7150 rpmh clocks This adds the RPMH clocks present in SM7150 SoC. Signed-off-by: Danila Tikhonov Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230916175952.178611-3-danila@jiaxyga.com Signed-off-by: Ulf Hansson commit 38c2efa260e6d0eab861c21c6ad1e4d79e1377ac Author: Justin Stitt Date: Mon Aug 14 22:11:28 2023 +0000 pmdomain: renesas: rmobile-sysc: fix -Wvoid-pointer-to-enum-cast warning When building with clang 18 I see the following warning: | drivers/soc/renesas/rmobile-sysc.c:193:22: warning: cast to smaller integer | type 'enum pd_types' from 'const void *' [-Wvoid-pointer-to-enum-cast] | 193 | add_special_pd(np, (enum pd_types)id->data); This is due to the fact that `id->data` is a void* and `enum pd_types` has the size of an integer. This cast from pointer-width to int-width causes truncation and possible data loss. Instead, cast to `uintptr_t` which has the same width as void*. Reported-by: Nathan Chancellor Closes: https://github.com/ClangBuiltLinux/linux/issues/1910 Signed-off-by: Justin Stitt Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230814-void-drivers-soc-renesas-rmobile-sysc-v1-1-6648dfd854de@google.com Signed-off-by: Ulf Hansson commit d8237f8733efeb2f687907e73c658e4662dbfa00 Author: Ulf Hansson Date: Tue Sep 12 15:41:22 2023 +0200 pmdomain: xilinx: Move Kconfig option to the pmdomain subsystem The Kconfig option belongs closer to the corresponding implementation, hence let's move it from the soc subsystem to the pmdomain subsystem. Cc: Michal Simek Signed-off-by: Ulf Hansson commit 02c24a120374b8beb3078a40ce1e7fd326518fcf Author: Ulf Hansson Date: Tue Sep 12 15:35:25 2023 +0200 pmdomain: ti: Move and add Kconfig options to the pmdomain subsystem The TI_SCI_PM_DOMAINS Kconfig option belongs closer to its corresponding implementation, hence let's move it from the soc subsystem to the pmdomain subsystem. While at it, let's also add a Kconfig option the omap_prm driver, rather than using ARCH_OMAP2PLUS directly. Cc: Nishanth Menon Cc: Santosh Shilimkar Cc: Tero Kristo Cc: Tony Lindgren Reviewed-by: Dhruva Gole Signed-off-by: Ulf Hansson commit f28cd697505d4d4d83fcb0d132d042551056ee13 Author: Ulf Hansson Date: Tue Sep 12 14:16:49 2023 +0200 pmdomain: tegra: Move Kconfig option to the pmdomain subsystem The Kconfig option belongs closer to the corresponding implementation, hence let's move it from the soc subsystem to the pmdomain subsystem. Cc: Thierry Reding Cc: Jonathan Hunter Cc: Mikko Perttunen Cc: Signed-off-by: Ulf Hansson commit fe78050a002524f332d19bca8127de6fdbdad32b Author: Ulf Hansson Date: Tue Sep 12 14:09:39 2023 +0200 pmdomain: sunxi: Move Kconfig option to the pmdomain subsystem The Kconfig option belongs closer to the corresponding implementation, hence let's move it from the soc subsystem to the pmdomain subsystem. Cc: Chen-Yu Tsai Cc: Jernej Skrabec Cc: Samuel Holland Cc: Acked-by: Jernej Skrabec Signed-off-by: Ulf Hansson commit ac68b50d15f12f3168f6cde8e59928ec86ba0f36 Author: Ulf Hansson Date: Tue Sep 12 13:31:44 2023 +0200 pmdomain: starfive: Move Kconfig file to the pmdomain subsystem The Kconfig belongs closer to the corresponding implementation, hence let's move it from the soc subsystem to the pmdomain subsystem. Cc: Walker Chen Cc: Conor Dooley Acked-by: Conor Dooley Signed-off-by: Ulf Hansson commit c6d6afb840108ae3920812dd66b25a65acfe447b Author: Ulf Hansson Date: Tue Sep 12 12:59:11 2023 +0200 pmdomain: st: Add a Kconfig option for the ux500 power domain We shouldn't really use the CONFIG_ARCH_U8500 option directly, but rather have our own dedicated Kconfig option, so let's add that. Cc: Linus Walleij Reviewed-by: Linus Walleij Signed-off-by: Ulf Hansson commit 70556c57eab404cc0241e991065b4cd532883e57 Author: Ulf Hansson Date: Tue Sep 12 12:48:37 2023 +0200 pmdomain: samsung: Move Kconfig option to the pmdomain subsystem The Kconfig option belongs closer to the corresponding implementation, hence let's move it from the soc subsystem to the pmdomain subsystem. Cc: Krzysztof Kozlowski Cc: Alim Akhtar Cc: Signed-off-by: Ulf Hansson commit 70a69266b3925f7d0e9c3906d15d4ca3431aa519 Author: Ulf Hansson Date: Tue Sep 12 12:39:02 2023 +0200 pmdomain: rockchip: Move Kconfig option to the pmdomain subsystem The Kconfig option belongs closer to the corresponding implementation, hence let's move it from the soc subsystem to the pmdomain subsystem. Cc: Heiko Stuebner Cc: Acked-by: Heiko Stuebner Signed-off-by: Ulf Hansson commit a3aa70f9727431a1fef70f9f9cbc4765599c0cc2 Author: Ulf Hansson Date: Tue Sep 12 12:27:58 2023 +0200 pmdomain: renesas: Move Kconfig options to the pmdomain subsystem The Kconfig options belongs closer to the corresponding implementations, hence let's move them from the soc subsystem to the pmdomain subsystem. Cc: Geert Uytterhoeven Cc: Magnus Damm Cc: Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Signed-off-by: Ulf Hansson commit 4eb42e5bd86da528be604845f52732742ef74e6b Author: Ulf Hansson Date: Tue Sep 12 11:39:24 2023 +0200 pmdomain: qcom: Move Kconfig options to the pmdomain subsystem The Kconfig options belongs closer to the corresponding implementations, hence let's move them from the soc subsystem to the pmdomain subsystem. Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: Andy Gross Cc: Acked-by: Konrad Dybcio Reviewed-by: Bjorn Andersson Signed-off-by: Ulf Hansson commit 8b1d7a2785ab2d4153abd7bf77e53b8e5fa49869 Author: Ulf Hansson Date: Tue Sep 12 00:52:25 2023 +0200 pmdomain: mediatek: Move Kconfig options to the pmdomain subsystem The Kconfig options belongs closer to the corresponding implementations, hence let's move them from the soc subsystem to the pmdomain subsystem. Cc: Matthias Brugger Cc: AngeloGioacchino Del Regno Cc: Signed-off-by: Ulf Hansson commit 24a11a1e82456d865c4ab18f01456ef5e0f9dda0 Author: Ulf Hansson Date: Tue Sep 12 00:45:34 2023 +0200 pmdomain: imx: Move Kconfig options to the pmdomain subsystem The Kconfig options belongs closer to the corresponding implementations, hence let's move them from the soc- and firmware subsystem to the pmdomain subsystem. Cc: Shawn Guo Cc: Sascha Hauer Cc: Fabio Estevam Cc: Peng Fan Cc: Cc: Acked-by: Peng Fan Acked-by: Shawn Guo Signed-off-by: Ulf Hansson commit c96b13d7c0e494e1072648301e61e13a2a85a362 Author: Alex Bee Date: Tue Aug 29 23:40:09 2023 +0200 ARM: dts: rockchip: Switch to operating-points-v2 for RK3128's CPU This will allow frequency-scaling for the cpu-cores. Operating frequencies and voltages have been taken from Rockchip's downstream kernel. Signed-off-by: Alex Bee Link: https://lore.kernel.org/r/20230829214004.314932-10-knaerzche@gmail.com Signed-off-by: Heiko Stuebner commit da8b973957ca03f05f78384f2bf6d79a3fce9fb0 Author: Alex Bee Date: Tue Aug 29 23:40:07 2023 +0200 ARM: dts: rockchip: Enable SMP bring-up for RK3128 For bring-up of the non-boot cpu cores the enable-method for RK3036 can be re-used. This adds a (small) chunk of SRAM for execution of the SMP trampoline code and the respective enable-method property to the cpus. Signed-off-by: Alex Bee Link: https://lore.kernel.org/r/20230829214004.314932-8-knaerzche@gmail.com Signed-off-by: Heiko Stuebner commit 02941bc2a1bc8ea82617ba1fd4d2c0643399a9ea Author: Alex Bee Date: Tue Aug 29 23:40:05 2023 +0200 ARM: dts: rockchip: Add CPU resets for RK3128 In order to support bring-up of the non-boot cores, this patch adds the reset controls for the cpu cores. They are required/will be used by the Rockchip platsmp driver. Signed-off-by: Alex Bee Link: https://lore.kernel.org/r/20230829214004.314932-6-knaerzche@gmail.com Signed-off-by: Heiko Stuebner commit 9107283badc7d058e34ef3b60a52afe6a5e0acfb Author: Alex Bee Date: Tue Aug 29 23:40:03 2023 +0200 ARM: dts: rockchip: Add SRAM node for RK3128 RK3128 SoCs have 8KB of SRAM. Add the respective device tree node for it. Signed-off-by: Alex Bee Link: https://lore.kernel.org/r/20230829214004.314932-4-knaerzche@gmail.com Signed-off-by: Heiko Stuebner commit ef4907deff89dd547c8fdfe4fdd4bbfe6b4446d8 Author: Jagan Teki Date: Mon Jul 31 16:05:14 2023 +0530 ARM: dts: rockchip: Enable pwm fan for edgeble-neu2 Edgeble Neu2 IO board Fan connected to PWM11. Enable the pwm fan for it. Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20230731103518.2906147-10-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit c5cb195053aebf9eafece6f54ac25fdf3e694df7 Author: Jagan Teki Date: Mon Jul 31 16:05:10 2023 +0530 ARM: dts: rockchip: Add pwm11 node to rv1126 Add pwm11 node for Rockchip RV1126. Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20230731103518.2906147-6-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit 61e510db47ac3c6b371006705c7f563435ae0a30 Author: Jagan Teki Date: Mon Jul 31 16:05:09 2023 +0530 ARM: dts: rockchip: Add pwm11m0 pins to rv1126 Add pwm11m0 pins for Rockchip RV1126 PWM11. Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20230731103518.2906147-5-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit 28b2ae4ab0d139b5e1d64e4cbb245f2661a83036 Author: Jagan Teki Date: Mon Jul 31 16:05:08 2023 +0530 ARM: dts: rockchip: Add pwm2 node to rv1126 Add PWM2 node for Rockchip RV1126. Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20230731103518.2906147-4-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit 07cf7974a2236a66f989869c301aa0220f33905c Merge: 2b464cc2fd57c 013714bf3e125 Author: Jakub Kicinski Date: Wed Oct 4 14:25:37 2023 -0700 Merge tag 'nf-next-23-09-28' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Florian Westphal says: ==================== netfilter updates for net-next First patch, from myself, is a bug fix. The issue (connect timeout) is ancient, so I think its safe to give this more soak time given the esoteric conditions needed to trigger this. Also updates the existing selftest to cover this. Add netlink extacks when an update references a non-existent table/chain/set. This allows userspace to provide much better errors to the user, from Pablo Neira Ayuso. Last patch adds more policy checks to nf_tables as a better alternative to the existing runtime checks, from Phil Sutter. * tag 'nf-next-23-09-28' of https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next: netfilter: nf_tables: Utilize NLA_POLICY_NESTED_ARRAY netfilter: nf_tables: missing extended netlink error in lookup functions selftests: netfilter: test nat source port clash resolution interaction with tcp early demux netfilter: nf_nat: undo erroneous tcp edemux lookup after port clash ==================== Link: https://lore.kernel.org/r/20230928144916.18339-1-fw@strlen.de Signed-off-by: Jakub Kicinski commit 5162bba5b38ce18906fe2be14f0c41e016a88d61 Author: Jagan Teki Date: Mon Jul 31 16:05:07 2023 +0530 ARM: dts: rockchip: Add pwm2m0 pins to rv1126 Add pwm2m0 pins for Rockchip RV1126 PWM2. Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20230731103518.2906147-3-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit ac76b786cc370b000c76f3115a5d2ee76ff05c08 Author: John Clark Date: Wed Sep 6 01:23:05 2023 +0000 arm64: dts: rockchip: Add NanoPC T6 PCIe e-key support before ~~~~ 0000:00:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) 0002:20:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) 0002:21:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05) 0004:40:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) 0004:41:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05) after ~~~ 0000:00:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) 0002:20:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) 0002:21:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05) 0003:30:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) 0003:31:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822CE 802.11ac PCIe Wireless Network Adapter 0004:40:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) 0004:41:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05) Signed-off-by: John Clark Link: https://lore.kernel.org/r/20230906012305.7113-1-inindev@gmail.com Signed-off-by: Heiko Stuebner commit f5d9e8e08f81c9e7c723de7abcce106808f0770c Author: Steven Rostedt (Google) Date: Thu Sep 14 12:35:06 2023 -0400 tracing/selftests: Update kprobe args char/string to match new functions The function that the kprobe_args_char and kprobes_arg_string attaches to for its test has changed its name once again. Now we need to check for eventfs_create_dir(), and if it exists, use that, otherwise check for eventfs_add_dir() and if that exists use that, otherwise use the original tracefs_create_dir()! Link: https://lore.kernel.org/linux-trace-kernel/20230914163535.487267410@goodmis.org Cc: Mark Rutland Cc: Andrew Morton Cc: Ajay Kaher Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt (Google) commit 5790b1fb3d672d9a1fe3881a7181dfdbe741568f Author: Steven Rostedt (Google) Date: Wed Oct 4 16:50:07 2023 -0400 eventfs: Remove eventfs_file and just use eventfs_inode Instead of having a descriptor for every file represented in the eventfs directory, only have the directory itself represented. Change the API to send in a list of entries that represent all the files in the directory (but not other directories). The entry list contains a name and a callback function that will be used to create the files when they are accessed. struct eventfs_inode *eventfs_create_events_dir(const char *name, struct dentry *parent, const struct eventfs_entry *entries, int size, void *data); is used for the top level eventfs directory, and returns an eventfs_inode that will be used by: struct eventfs_inode *eventfs_create_dir(const char *name, struct eventfs_inode *parent, const struct eventfs_entry *entries, int size, void *data); where both of the above take an array of struct eventfs_entry entries for every file that is in the directory. The entries are defined by: typedef int (*eventfs_callback)(const char *name, umode_t *mode, void **data, const struct file_operations **fops); struct eventfs_entry { const char *name; eventfs_callback callback; }; Where the name is the name of the file and the callback gets called when the file is being created. The callback passes in the name (in case the same callback is used for multiple files), a pointer to the mode, data and fops. The data will be pointing to the data that was passed in eventfs_create_dir() or eventfs_create_events_dir() but may be overridden to point to something else, as it will be used to point to the inode->i_private that is created. The information passed back from the callback is used to create the dentry/inode. If the callback fills the data and the file should be created, it must return a positive number. On zero or negative, the file is ignored. This logic may also be used as a prototype to convert entire pseudo file systems into just-in-time allocation. The "show_events_dentry" file has been updated to show the directories, and any files they have. With just the eventfs_file allocations: Before after deltas for meminfo (in kB): MemFree: -14360 MemAvailable: -14260 Buffers: 40 Cached: 24 Active: 44 Inactive: 48 Inactive(anon): 28 Active(file): 44 Inactive(file): 20 Dirty: -4 AnonPages: 28 Mapped: 4 KReclaimable: 132 Slab: 1604 SReclaimable: 132 SUnreclaim: 1472 Committed_AS: 12 Before after deltas for slabinfo: : [ * = ] ext4_inode_cache 27 [* 1184 = 31968 ] extent_status 102 [* 40 = 4080 ] tracefs_inode_cache 144 [* 656 = 94464 ] buffer_head 39 [* 104 = 4056 ] shmem_inode_cache 49 [* 800 = 39200 ] filp -53 [* 256 = -13568 ] dentry 251 [* 192 = 48192 ] lsm_file_cache 277 [* 32 = 8864 ] vm_area_struct -14 [* 184 = -2576 ] trace_event_file 1748 [* 88 = 153824 ] kmalloc-1k 35 [* 1024 = 35840 ] kmalloc-256 49 [* 256 = 12544 ] kmalloc-192 -28 [* 192 = -5376 ] kmalloc-128 -30 [* 128 = -3840 ] kmalloc-96 10581 [* 96 = 1015776 ] kmalloc-64 3056 [* 64 = 195584 ] kmalloc-32 1291 [* 32 = 41312 ] kmalloc-16 2310 [* 16 = 36960 ] kmalloc-8 9216 [* 8 = 73728 ] Free memory dropped by 14,360 kB Available memory dropped by 14,260 kB Total slab additions in size: 1,771,032 bytes With this change: Before after deltas for meminfo (in kB): MemFree: -12084 MemAvailable: -11976 Buffers: 32 Cached: 32 Active: 72 Inactive: 168 Inactive(anon): 176 Active(file): 72 Inactive(file): -8 Dirty: 24 AnonPages: 196 Mapped: 8 KReclaimable: 148 Slab: 836 SReclaimable: 148 SUnreclaim: 688 Committed_AS: 324 Before after deltas for slabinfo: : [ * = ] tracefs_inode_cache 144 [* 656 = 94464 ] shmem_inode_cache -23 [* 800 = -18400 ] filp -92 [* 256 = -23552 ] dentry 179 [* 192 = 34368 ] lsm_file_cache -3 [* 32 = -96 ] vm_area_struct -13 [* 184 = -2392 ] trace_event_file 1748 [* 88 = 153824 ] kmalloc-1k -49 [* 1024 = -50176 ] kmalloc-256 -27 [* 256 = -6912 ] kmalloc-128 1864 [* 128 = 238592 ] kmalloc-64 4685 [* 64 = 299840 ] kmalloc-32 -72 [* 32 = -2304 ] kmalloc-16 256 [* 16 = 4096 ] total = 721352 Free memory dropped by 12,084 kB Available memory dropped by 11,976 kB Total slab additions in size: 721,352 bytes That's over 2 MB in savings per instance for free and available memory, and over 1 MB in savings per instance of slab memory. Link: https://lore.kernel.org/linux-trace-kernel/20231003184059.4924468e@gandalf.local.home Link: https://lore.kernel.org/linux-trace-kernel/20231004165007.43d79161@gandalf.local.home Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Andrew Morton Cc: Ajay Kaher Signed-off-by: Steven Rostedt (Google) commit 1c9a53ff7ece056eb995332f0d9523ca43fdcb5a Author: Tamás Szűcs Date: Sun Sep 24 20:37:45 2023 +0000 arm64: dts: rockchip: Add sdio node to rock-5b Enable SDIO on Radxa ROCK 5 Model B M.2 Key E. Add sdio node and alias as mmc2. Add regulator for the 3.3 V rail bringing it up during boot. Make sure EKEY_EN is muxed as GPIO. Signed-off-by: Tamás Szűcs Reviewed-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230924203740.65744-1-tszucs@protonmail.ch Signed-off-by: Heiko Stuebner commit 46bb398ea1d81302e3735087ceb4b5763d5afc29 Author: Sebastian Reichel Date: Mon Sep 18 16:13:27 2023 +0200 arm64: dts: rockchip: add PCIe3 bus to rk3588-evb1 Enable PCIe3 support, which is exposed via a PCIe3 connector. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230918141327.131108-3-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 86a2024d95e259c4309ced53242c0db6d993320b Author: Sebastian Reichel Date: Mon Sep 18 16:13:26 2023 +0200 arm64: dts: rockchip: add PCIe2 network controller to rk3588-evb1 The RK3588 EVB1 has a second network card, which is connected via PCIe2. This adds support for that. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230918141327.131108-2-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit da447ec387800bdf2df1fb1d8c1522991d025952 Author: Sebastian Reichel Date: Mon Sep 18 16:14:51 2023 +0200 arm64: dts: rockchip: add PCIe for M.2 E-Key to rock-5b Enable PCIe2_0 controller and its voltage supply, which is routed to the M.2 E-Key on the upper side of the Radxa Rock 5B. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230918141451.131247-4-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 199cbd5f195adbc0e70ad218cdba82f45750f11b Author: Sebastian Reichel Date: Mon Sep 18 16:14:50 2023 +0200 arm64: dts: rockchip: add PCIe for M.2 M-key to rock-5b The Radxa Rock 5B has PCIe 3x4 routed to its M.2 M-key connector on the board's back. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230918141451.131247-3-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 42145b7a823530f57983fb6e6897f40c0be278d5 Author: Sebastian Reichel Date: Mon Sep 18 16:14:49 2023 +0200 arm64: dts: rockchip: add PCIe network controller to rock-5b Enable the RTL8125 network controller, which is connected via PCIe. Signed-off-by: Sebastian Reichel Link: https://lore.kernel.org/r/20230918141451.131247-2-sebastian.reichel@collabora.com Signed-off-by: Heiko Stuebner commit 2b464cc2fd57c5a0250ae2f31505ac8e26e9748c Author: Geert Uytterhoeven Date: Thu Sep 28 14:17:48 2023 +0200 sctp: Spelling s/preceeding/preceding/g Fix a misspelling of "preceding". Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/663b14d07d6d716ddc34482834d6b65a2f714cfb.1695903447.git.geert+renesas@glider.be Signed-off-by: Jakub Kicinski commit f48a288a4a65bc8c3830b4295afb98101f234412 Author: Chris Morgan Date: Mon Sep 18 12:32:55 2023 -0500 arm64: dts: rockchip: Add saradc node to Indiedroid Nova Add ADC support for the Indiedroid Nova, as well as the two ADC buttons found on the device. The buttons are documented as "boot" and "recovery". The boot button is used by the bootloader to boot into USB recovery mode. The recovery button use is currently unknown. Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20230918173255.1325-4-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit aee432b50f6e15886bddcb6f92028265db4b254e Author: Chris Morgan Date: Mon Sep 18 12:32:54 2023 -0500 arm64: dts: rockchip: add USB2 to rk3588s-indiedroid Enable USB2 (EHCI and OCHI mode) support for the Indiedroid Nova. This adds support for USB for the 4 full size USB-A ports. Note that USB 3 (the two blue full-size USB-A ports) is still outstanding, as is support for USB on the USB-C ports. The controller is not yet supported for these ports. Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20230918173255.1325-3-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit f5fb02c7125e3564aa773f54add37655d09e64f1 Author: Chris Morgan Date: Mon Sep 18 12:32:53 2023 -0500 arm64: dts: rockchip: add PCIe to rk3588s-indiedroid-nova Add the necessary nodes to the Indiedroid Nova to activate the PCI express port that is used by the RTL8111 ethernet controller. Signed-off-by: Chris Morgan Link: https://lore.kernel.org/r/20230918173255.1325-2-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner commit a28ab03b499601c14b8f502d875c2bee23209659 Author: Frederic Weisbecker Date: Fri Sep 8 22:36:03 2023 +0200 rcu: Comment why callbacks migration can't wait for CPUHP_RCUTREE_PREP The callbacks migration is performed through an explicit call from the hotplug control CPU right after the death of the target CPU and before proceeding with the CPUHP_ teardown functions. This is unusual but necessary and yet uncommented. Summarize the reason as explained in the changelog of: a58163d8ca2c (rcu: Migrate callbacks earlier in the CPU-offline timeline) Reviewed-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 3157b7ce14bbf468b0ca8613322a05c37b5ae25d Merge: cbcb199b7cd2a e096ab9d9f45b Author: Andrii Nakryiko Date: Wed Oct 4 13:35:07 2023 -0700 Merge branch 'selftest/bpf, riscv: Improved cross-building support' Björn Töpel says: ==================== From: Björn Töpel Yet another "more cross-building support for RISC-V" series. An example how to invoke a gen_tar build: | make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- CC=riscv64-linux-gnu-gcc \ | HOSTCC=gcc O=/workspace/kbuild FORMAT= \ | SKIP_TARGETS="arm64 ia64 powerpc sparc64 x86 sgx" -j $(($(nproc)-1)) \ | -C tools/testing/selftests gen_tar Björn ==================== Signed-off-by: Andrii Nakryiko commit e096ab9d9f45bea9fb8126c46f6151d81aa0836f Author: Björn Töpel Date: Wed Oct 4 14:27:21 2023 +0200 selftests/bpf: Add uprobe_multi to gen_tar target The uprobe_multi program was not picked up for the gen_tar target. Fix by adding it to TEST_GEN_FILES. Signed-off-by: Björn Töpel Signed-off-by: Andrii Nakryiko Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20231004122721.54525-4-bjorn@kernel.org commit 72fae6319962fca2ecd8bb4f4e8dbdda7fe9af6f Author: Björn Töpel Date: Wed Oct 4 14:27:20 2023 +0200 selftests/bpf: Enable lld usage for RISC-V RISC-V has proper lld support. Use that, similar to what x86 does, for urandom_read et al. Signed-off-by: Björn Töpel Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20231004122721.54525-3-bjorn@kernel.org commit 97a79e502e25e27a65b0506c9fb210cb2d89b52e Author: Björn Töpel Date: Wed Oct 4 14:27:19 2023 +0200 selftests/bpf: Add cross-build support for urandom_read et al Some userland programs in the BPF test suite, e.g. urandom_read, is missing cross-build support. Add cross-build support for these programs Signed-off-by: Björn Töpel Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20231004122721.54525-2-bjorn@kernel.org commit 448e9f34d91d1a4799fdb06a93c2c24b34b6fd9d Author: Frederic Weisbecker Date: Fri Sep 8 22:36:01 2023 +0200 rcu: Standardize explicit CPU-hotplug calls rcu_report_dead() and rcutree_migrate_callbacks() have their headers in rcupdate.h while those are pure rcutree calls, like the other CPU-hotplug functions. Also rcu_cpu_starting() and rcu_report_dead() have different naming conventions while they mirror each other's effects. Fix the headers and propose a naming that relates both functions and aligns with the prefix of other rcutree CPU-hotplug functions. Reviewed-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 3f26d8b6d1cbd41c5fa663c9ea48a2b832cfb58f Author: Jakob Hauser Date: Sun Oct 1 15:17:44 2023 +0200 power: supply: rt5033_charger: Replace "&pdev->dev" by "charger->dev" in probe At the beginning of the probe function, "charger->dev" is set equal to "&pdev->dev". Therefore it's more clear to subsequently use "charger->dev" instead of "&pdev->dev". Signed-off-by: Jakob Hauser Link: https://lore.kernel.org/r/39b4f00e010446e453905c8dc3ca1e47e9f2c5f8.1696165240.git.jahau@rocketmail.com Signed-off-by: Sebastian Reichel commit 1c6877f1768a34c04e3a82f9f950f78488a1753b Author: Jakob Hauser Date: Sun Oct 1 15:17:43 2023 +0200 power: supply: rt5033_charger: Simplify initialization of rt5033_charger_data Currently the struct "rt5033_charger_data" is initialized rather complicated. The cause lies inside of the struct "rt5033_charger", where struct "rt5033_charger_data" is implemented as a pointer *chg. Therefore, inside of struct "rt5033_charger" change the struct "rt5033_charger_data" to non-pointer "chg". It is then initialized right away and can be accessed more easily. Signed-off-by: Jakob Hauser Link: https://lore.kernel.org/r/0aff8c2a18cf4b88ec3333f6679a8419dd76ca29.1696165240.git.jahau@rocketmail.com Signed-off-by: Sebastian Reichel commit 8242336dc8a8009b93fb7c4506d79a8c894b3583 Author: Jakob Hauser Date: Sun Oct 1 15:17:42 2023 +0200 power: supply: rt5033_charger: Add cable detection and USB OTG supply Implement cable detection by extcon and handle the driver according to the connector type. There are basically three types of action: "set_charging", "set_otg" and "set_disconnect". A forth helper function to "unset_otg" was added because this is used in both "set_charging" and "set_disconnect". In the first case it covers the rather rare event that someone changes from OTG to charging without disconnect. In the second case, when disconnecting, the values are set back to the ones from initialization to return into a defined state. Additionally, there is "set_mivr". When connecting to e.g. a laptop/PC, the minimum input voltage regulation (MIVR) shall prevent a voltage drop if the cable or the supply is weak. The MIVR value is set to 4600MV, same as in the Android driver [1]. When disconnecting, MIVR is set back to DISABLED. In the function rt5033_get_charger_state(): When in OTG mode, the chip reports status "charging". Change this to "discharging" because there is no charging going on in OTG mode [2]. Yang Yingliang detected missing mutex_unlock() in some error path and suggested a fix [3]. The suggestion was squashed into this patch. [1] https://github.com/msm8916-mainline/linux-downstream/blob/GT-I9195I/drivers/battery/rt5033_charger.c#L499 [2] https://github.com/msm8916-mainline/linux-downstream/blob/GT-I9195I/drivers/battery/rt5033_charger.c#L686-L687 [3] https://lore.kernel.org/linux-pm/20230822030207.644738-1-yangyingliang@huawei.com Tested-by: Raymond Hackley Co-developed-by: Yang Yingliang Signed-off-by: Jakob Hauser Link: https://lore.kernel.org/r/cc4e37e510abbb0cdfa7faa8408da48c2cb448a4.1696165240.git.jahau@rocketmail.com Signed-off-by: Sebastian Reichel commit 2cb1f6e9a743af58a23cf14563b5eada1e0d3fde Author: Frederic Weisbecker Date: Fri Sep 8 22:36:00 2023 +0200 rcu: Conditionally build CPU-hotplug teardown callbacks Among the three CPU-hotplug teardown RCU callbacks, two of them early exit if CONFIG_HOTPLUG_CPU=n, and one is left unchanged. In any case all of them have an implementation when CONFIG_HOTPLUG_CPU=n. Align instead with the common way to deal with CPU-hotplug teardown callbacks and provide a proper stub when they are not supported. Reviewed-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit cbcb199b7cd2af17604fa3241884139bf7286ff1 Merge: 93fb2776f43e3 b55b775f03166 Author: Andrii Nakryiko Date: Wed Oct 4 13:18:49 2023 -0700 Merge branch 'libbpf/selftests syscall wrapper fixes for RISC-V' Björn Töpel says: ==================== From: Björn Töpel Commit 08d0ce30e0e4 ("riscv: Implement syscall wrappers") introduced some regressions in libbpf, and the kselftests BPF suite, which are fixed with these three patches. Note that there's an outstanding fix [1] for ftrace syscall tracing which is also a fallout from the commit above. Björn [1] https://lore.kernel.org/linux-riscv/20231003182407.32198-1-alexghiti@rivosinc.com/ Alexandre Ghiti (1): libbpf: Fix syscall access arguments on riscv ==================== Signed-off-by: Andrii Nakryiko commit b55b775f03166b8da60af80ef33da8bf83ca96c1 Author: Björn Töpel Date: Wed Oct 4 13:09:05 2023 +0200 selftests/bpf: Define SYS_NANOSLEEP_KPROBE_NAME for riscv Add missing sys_nanosleep name for RISC-V, which is used by some tests (e.g. attach_probe). Fixes: 08d0ce30e0e4 ("riscv: Implement syscall wrappers") Signed-off-by: Björn Töpel Signed-off-by: Andrii Nakryiko Reviewed-by: Sami Tolvanen Link: https://lore.kernel.org/bpf/20231004110905.49024-4-bjorn@kernel.org commit 0f2692ee4324679df6c80ccbb75660564009d187 Author: Björn Töpel Date: Wed Oct 4 13:09:04 2023 +0200 selftests/bpf: Define SYS_PREFIX for riscv SYS_PREFIX was missing for a RISC-V, which made a couple of kprobe tests fail. Add missing SYS_PREFIX for RISC-V. Fixes: 08d0ce30e0e4 ("riscv: Implement syscall wrappers") Signed-off-by: Björn Töpel Signed-off-by: Andrii Nakryiko Reviewed-by: Sami Tolvanen Link: https://lore.kernel.org/bpf/20231004110905.49024-3-bjorn@kernel.org commit e508560672890b2873c89258b88fade1356392ce Author: Paul Moore Date: Wed Oct 4 16:08:09 2023 -0400 lsm: fix a spelling mistake Fix a spelling mistake in the security_inode_notifysecctx() kdoc header block. Signed-off-by: Paul Moore commit 8a412c5c1cd6cc6c55e8b9b84fbb789fc395fe78 Author: Alexandre Ghiti Date: Wed Oct 4 13:09:03 2023 +0200 libbpf: Fix syscall access arguments on riscv Since commit 08d0ce30e0e4 ("riscv: Implement syscall wrappers"), riscv selects ARCH_HAS_SYSCALL_WRAPPER so let's use the generic implementation of PT_REGS_SYSCALL_REGS(). Fixes: 08d0ce30e0e4 ("riscv: Implement syscall wrappers") Signed-off-by: Alexandre Ghiti Signed-off-by: Andrii Nakryiko Reviewed-by: Sami Tolvanen Link: https://lore.kernel.org/bpf/20231004110905.49024-2-bjorn@kernel.org commit 24a0fbf48cbecc6fd8cc13eecdf70e8373933314 Author: Dan Carpenter Date: Wed Sep 27 15:55:10 2023 +0300 ptp: ocp: fix error code in probe() There is a copy and paste error so this uses a valid pointer instead of an error pointer. Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops") Signed-off-by: Dan Carpenter Reviewed-by: Vadim Fedorenko Link: https://lore.kernel.org/r/5c581336-0641-48bd-88f7-51984c3b1f79@moroto.mountain Signed-off-by: Jakub Kicinski commit 2175362f594bc8d3764c8108b1a0b88d0a56610a Author: Kees Cook Date: Wed Oct 4 12:34:45 2023 -0700 MAINTAINERS: Include additional ASoC paths Make sure a few other paths are correctly sent to the ASoC maintainers. Link: https://lore.kernel.org/lkml/63dd3676.170a0220.1f1b2.3244@mx.google.com/ Cc: Mark Brown Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20231004193441.work.109-kees@kernel.org Signed-off-by: Mark Brown commit 77c9b9dea4fb3e51e0d850db7f21cb1156d987bd Author: David Woodhouse Date: Sat Sep 30 14:58:35 2023 +0100 KVM: x86/xen: Use fast path for Xen timer delivery Most of the time there's no need to kick the vCPU and deliver the timer event through kvm_xen_inject_timer_irqs(). Use kvm_xen_set_evtchn_fast() directly from the timer callback, and only fall back to the slow path if delivering the timer would block, i.e. if kvm_xen_set_evtchn_fast() returns -EWOULDBLOCK. If delivery fails for any other reason, do nothing and just let it fail silently, as that is what the slow path would end up doing anyways. This gives a significant improvement in timer latency testing (using nanosleep() for various periods and then measuring the actual time elapsed). However, there was a reason[1] the fast path was dropped when this support was first added. The current code holds vcpu->mutex for all operations on the kvm->arch.timer_expires field, and the fast path introduces a potential race condition. Avoid that race by ensuring the hrtimer is (temporarily) cancelled before making changes in kvm_xen_start_timer(), and also when reading the values out for KVM_XEN_VCPU_ATTR_TYPE_TIMER. [1] https://lore.kernel.org/kvm/846caa99-2e42-4443-1070-84e49d2f11d2@redhat.com Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant Link: https://lore.kernel.org/r/f21ee3bd852761e7808240d4ecaec3013c649dc7.camel@infradead.org [sean: massage changelog] Signed-off-by: Sean Christopherson commit ee11ab6bb04e1093d3cc5f5bea9779799ce1d2c7 Author: Peng Hao Date: Tue Sep 5 09:07:09 2023 +0800 KVM: X86: Reduce size of kvm_vcpu_arch structure when CONFIG_KVM_XEN=n When CONFIG_KVM_XEN=n, the size of kvm_vcpu_arch can be reduced from 5100+ to 4400+ by adding macro control. Signed-off-by: Peng Hao Link: https://lore.kernel.org/all/CAPm50aKwbZGeXPK5uig18Br8CF1hOS71CE2j_dLX+ub7oJdpGg@mail.gmail.com [sean: fix whitespace damage] Signed-off-by: Sean Christopherson commit d5a590b1b614d99a147cb3ec71954d96ef1a0834 Author: Russell King (Oracle) Date: Wed Sep 27 13:13:56 2023 +0100 net: dsa: mt753x: remove mt753x_phylink_pcs_link_up() Remove the mt753x_phylink_pcs_link_up() function for two reasons: 1) priv->pcs[i].pcs.neg_mode is set true, meaning it doesn't take a MLO_AN_FIXED anymore, but one of PHYLINK_PCS_NEG_*. However, this is inconsequential due to... 2) priv->pcs[port].pcs.ops is always initialised to point at mt7530_pcs_ops, which does not have a pcs_link_up() member. So, let's remove mt753x_phylink_pcs_link_up() entirely. Signed-off-by: Russell King (Oracle) Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/E1qlTQS-008BWe-Va@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit e3c2d2d144c082dd71596953193adf9891491f42 Author: Danny Kaehn Date: Tue Sep 19 16:22:45 2023 -0500 hid: cp2112: Fix duplicate workqueue initialization Previously the cp2112 driver called INIT_DELAYED_WORK within cp2112_gpio_irq_startup, resulting in duplicate initilizations of the workqueue on subsequent IRQ startups following an initial request. This resulted in a warning in set_work_data in workqueue.c, as well as a rare NULL dereference within process_one_work in workqueue.c. Initialize the workqueue within _probe instead. Fixes: 13de9cca514e ("HID: cp2112: add IRQ chip handling") Signed-off-by: Danny Kaehn Signed-off-by: Jiri Kosina commit 928276075f169d36f34e751ea5c81dd24d3a6823 Author: Martino Fontana Date: Sun Sep 24 16:13:34 2023 +0200 HID: nintendo: cleanup LED code - Support player LED patterns up to 8 players. (Note that the behavior still consinsts in increasing the player number every time a controller is connected, never decreasing it. It should be as is described in https://bugzilla.kernel.org/show_bug.cgi?id=216225. However, any implementation here would stop making sense as soon as a non-Nintendo controller is connected, which is why I'm not bothering.) - Split part of `joycon_home_led_brightness_set` (which is called by hid) into `joycon_set_home_led` (which is what actually sets the LEDs), for consistency with player LEDs. - `joycon_player_led_brightness_set` won't try it to "determine which player led this is" anymore: it's already looking at every LED brightness value. - Instead of first registering the `led_classdev`, then attempting to set the LED and unregistering the `led_classdev` if it fails, first attempt to set the LED, then register the `led_classdev` only if it succeeds (the class is still filled up in either case). - If setting the player LEDs fails, still attempt setting the home LED. (I don't know there's a third party controller where this may actually happen, but who knows...) - Use `JC_NUM_LEDS` where appropriate instead of 4. - Print return codes in more places. - Use spinlock instead of mutex for `input_num`. Copy its value to a local variable, so that it can be unlocked immediately. - `input_num` starts counting from 0 - Less holding of mutexes in general. Signed-off-by: Martino Fontana Reviewed-by: Daniel J. Ogorchock Signed-off-by: Jiri Kosina commit 46a0a2c96f0f47628190f122c2e3d879e590bcbe Author: Mikhail Khvainitski Date: Sun Sep 24 01:58:30 2023 +0300 HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround Built-in firmware of cptkbd handles scrolling by itself (when middle button is pressed) but with issues: it does not support horizontal and hi-res scrolling and upon middle button release it sends middle button click even if there was a scrolling event. Commit 3cb5ff0220e3 ("HID: lenovo: Hide middle-button press until release") workarounds last issue but it's impossible to workaround scrolling-related issues without firmware modification. Likely, Dennis Schneider has reverse engineered the firmware and provided an instruction on how to patch it [1]. However, aforementioned workaround prevents userspace (libinput) from knowing exact moment when middle button has been pressed down and performing "On-Button scrolling". This commit detects correctly-behaving patched firmware if cursor movement events has been received during middle button being pressed and stops applying workaround for this device. Link: https://hohlerde.org/rauch/en/elektronik/projekte/tpkbd-fix/ [1] Signed-off-by: Mikhail Khvainitski Signed-off-by: Jiri Kosina commit 783a8334ec1cadefbb992ca2adbb459b0ee0f9f7 Author: Harshit Mogalapalli Date: Tue Sep 26 23:58:01 2023 -0700 cgroup/cpuset: Cleanup signedness issue in cpu_exclusive_check() Smatch complains about returning negative error codes from a type bool function. kernel/cgroup/cpuset.c:705 cpu_exclusive_check() warn: signedness bug returning '(-22)' The code works correctly, but it is confusing. The current behavior is that cpu_exclusive_check() returns true if it's *NOT* exclusive. Rename it to cpusets_are_exclusive() and reverse the returns so it returns true if it is exclusive and false if it's not. Update both callers as well. Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202309201706.2LhKdM6o-lkp@intel.com/ Signed-off-by: Harshit Mogalapalli Reviewed-by: Kamalesh Babulal Acked-by: Waiman Long Signed-off-by: Tejun Heo commit 81701f7132f8cc589a67b6f4ecac2f759f140498 Author: Christophe JAILLET Date: Mon Sep 18 04:54:32 2023 -0700 HID: nvidia-shield: Introduce thunderstrike_destroy() In order to simplify some error handling paths and avoid code duplication, introduce thunderstrike_destroy() which undoes thunderstrike_create(). Signed-off-by: Christophe JAILLET Reviewed-by: Rahul Rameshbabu Signed-off-by: Jiri Kosina commit ec2926f5f6221b550fbed6912dafd6ef72b29131 Author: Christophe JAILLET Date: Mon Sep 18 04:54:31 2023 -0700 HID: nvidia-shield: Fix some missing function calls() in the probe error handling path The commit in Fixes updated the error handling path of thunderstrike_create() and the remove function but not the error handling path of shield_probe(), should an error occur after a successful thunderstrike_create() call. Add the missing calls. Fixes: 3ab196f88237 ("HID: nvidia-shield: Add battery support for Thunderstrike") Signed-off-by: Christophe JAILLET Reviewed-by: Rahul Rameshbabu Signed-off-by: Jiri Kosina commit 2ed20dec2a885dd8bea5af104b7bebc4ba5c9e72 Author: Christophe JAILLET Date: Mon Sep 18 04:54:30 2023 -0700 HID: nvidia-shield: Fix a missing led_classdev_unregister() in the probe error handling path The commit in Fixes updated the error handling path of thunderstrike_create() and the remove function but not the error handling path of shield_probe(), should an error occur after a successful thunderstrike_create() call. Add the missing call. Make sure it is safe to call in the probe error handling path by preventing the led_classdev from attempting to set the LED brightness to the off state on unregister. Fixes: f88af60e74a5 ("HID: nvidia-shield: Support LED functionality for Thunderstrike") Signed-off-by: Christophe JAILLET Reviewed-by: Rahul Rameshbabu Signed-off-by: Jiri Kosina commit 0aa44595d61ca9e61239f321fec799518884feb3 Author: Chuck Lever Date: Wed Oct 4 11:29:41 2023 -0400 RDMA/core: Fix a couple of obvious typos in comments Fix typos. Signed-off-by: Chuck Lever Link: https://lore.kernel.org/r/169643338101.8035.6826446669479247727.stgit@manet.1015granger.net Signed-off-by: Leon Romanovsky commit 46c521bac592251229acdd2cd67976a7b1f88bed Author: Waiman Long Date: Tue Oct 3 10:44:20 2023 -0400 cgroup/cpuset: Enable invalid to valid local partition transition When a local partition becomes invalid, it won't transition back to valid partition automatically if a proper "cpuset.cpus.exclusive" or "cpuset.cpus" change is made. Instead, system administrators have to explicitly echo "root" or "isolated" into the "cpuset.cpus.partition" file at the partition root. This patch now enables the automatic transition of an invalid local partition back to valid when there is a proper "cpuset.cpus.exclusive" or "cpuset.cpus" change. Automatic transition of an invalid remote partition to a valid one, however, is not covered by this patch. They still need an explicit write to "cpuset.cpus.partition" to become valid again. The test_cpuset_prs.sh test script is updated to add new test cases to test this automatic state transition. Reported-by: Pierre Gondois Link: https://lore.kernel.org/lkml/9777f0d2-2fdf-41cb-bd01-19c52939ef42@arm.com Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 00f3696f7555d0890ae07b635e6ccbf39fd2eb3a Author: Greg Kroah-Hartman Date: Wed Sep 27 11:00:30 2023 +0200 net: appletalk: remove cops support The COPS Appletalk support is very old, never said to actually work properly, and the firmware code for the devices are under a very suspect license. Remove it all to clear up the license issue, if it is still needed and actually used by anyone, we can add it back later once the license is cleared up. Reported-by: Prarit Bhargava Cc: jschlst@samba.org Signed-off-by: Greg Kroah-Hartman Acked-by: Christoph Hellwig Acked-by: Prarit Bhargava Reviewed-by: Vitaly Kuznetsov Link: https://lore.kernel.org/r/20230927090029.44704-2-gregkh@linuxfoundation.org Signed-off-by: Jakub Kicinski commit 9b81d3a5be05d350ac93d99762c7ee91fe29b4cb Author: Luiz Capitulino Date: Wed Sep 27 14:25:40 2023 +0000 cgroup: add cgroup_favordynmods= command-line option We have a need of using favordynmods with cgroup v1, which doesn't support changing mount flags during remount. Enabling CONFIG_CGROUP_FAVOR_DYNMODS at build-time is not an option because we want to be able to selectively enable it for certain systems. This commit addresses this by introducing the cgroup_favordynmods= command-line option. This option works for both cgroup v1 and v2 and also allows for disabling favorynmods when the kernel built with CONFIG_CGROUP_FAVOR_DYNMODS=y. Also, note that when cgroup_favordynmods=true favordynmods is never disabled in cgroup_destroy_root(). Signed-off-by: Luiz Capitulino Reviewed-by: Michal Koutný Signed-off-by: Tejun Heo commit c27153682eac34e04f5346dd554ad74a78d84c0e Author: Jakub Kicinski Date: Wed Oct 4 11:20:29 2023 -0700 Revert "bnxt_en: Support QOS and TPID settings for the SRIOV VLAN" This reverts commit e76d44fe722761f5480b908e38c5ce1a2c2cb6d6. We no longer accept drivers extending their use of the legacy SR-IOV configuration APIs. Users should move to bridge offload. Link: https://lore.kernel.org/r/20231004112243.41cb6351@kernel.org/ Signed-off-by: Jakub Kicinski commit 16419098e8b301417173d8d2cbfa94a56ac9900b Merge: 964168970cef5 82f9378c443c2 Author: Leon Romanovsky Date: Wed Oct 4 21:21:49 2023 +0300 IPsec packet offload support in multiport RoCE devices This series from Patrisious extends mlx5 to support IPsec packet offload in multiport devices (MPV, see [1] for more details). These devices have single flow steering logic and two netdev interfaces, which require extra logic to manage IPsec configurations as they performed on netdevs. Thanks [1] https://lore.kernel.org/linux-rdma/20180104152544.28919-1-leon@kernel.org/ Link: https://lore.kernel.org/all/20231002083832.19746-1-leon@kernel.org Signed-of-by: Leon Romanovsky * mlx5-next: (576 commits) net/mlx5: Handle IPsec steering upon master unbind/bind net/mlx5: Configure IPsec steering for ingress RoCEv2 MPV traffic net/mlx5: Configure IPsec steering for egress RoCEv2 MPV traffic net/mlx5: Add create alias flow table function to ipsec roce net/mlx5: Implement alias object allow and create functions net/mlx5: Add alias flow table bits net/mlx5: Store devcom pointer inside IPsec RoCE net/mlx5: Register mlx5e priv to devcom in MPV mode RDMA/mlx5: Send events from IB driver about device affiliation state net/mlx5: Introduce ifc bits for migration in a chunk mode Linux 6.6-rc3 ... commit ca6f5c2f94aa40028b3173967d3e5cb3a68aaa74 Author: Fabio Estevam Date: Tue Sep 26 08:10:17 2023 -0300 dt-bindings: net: fec: Add imx8dxl description The imx8dl FEC has the same programming model as the one on the imx8qxp. Add the imx8dl compatible string. Signed-off-by: Fabio Estevam Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230926111017.320409-1-festevam@gmail.com Signed-off-by: Jakub Kicinski commit c37e56cac3d62c69f093904afbc58fc428484d14 Author: Baoquan He Date: Thu Sep 14 11:31:42 2023 +0800 crash_core.c: remove unneeded functions So far, nobody calls functions parse_crashkernel_high() and parse_crashkernel_low(), remove both of them. Link: https://lkml.kernel.org/r/20230914033142.676708-10-bhe@redhat.com Signed-off-by: Baoquan He Reviewed-by: Zhen Lei Cc: Catalin Marinas Cc: Chen Jiahao Signed-off-by: Andrew Morton commit 39365395046fe74bebf6f70e86439f48ba56a75e Author: Baoquan He Date: Thu Sep 14 11:31:41 2023 +0800 riscv: kdump: use generic interface to simplify crashkernel reservation With the help of newly changed function parse_crashkernel() and generic reserve_crashkernel_generic(), crashkernel reservation can be simplified by steps: 1) Add a new header file , and define CRASH_ALIGN, CRASH_ADDR_LOW_MAX, CRASH_ADDR_HIGH_MAX and DEFAULT_CRASH_KERNEL_LOW_SIZE in ; 2) Add arch_reserve_crashkernel() to call parse_crashkernel() and reserve_crashkernel_generic(); 3) Add ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION Kconfig in arch/riscv/Kconfig. The old reserve_crashkernel_low() and reserve_crashkernel() can be removed. [chenjiahao16@huawei.com: fix crashkernel reserving problem on RISC-V] Link: https://lkml.kernel.org/r/20230925024333.730964-1-chenjiahao16@huawei.com Link: https://lkml.kernel.org/r/20230914033142.676708-9-bhe@redhat.com Signed-off-by: Baoquan He Signed-off-by: Chen Jiahao Cc: Catalin Marinas Cc: Chen Jiahao Cc: Zhen Lei Signed-off-by: Andrew Morton commit fdc268232dbbae8d3acdc5536370b53327be3bb0 Author: Baoquan He Date: Thu Sep 14 11:31:40 2023 +0800 arm64: kdump: use generic interface to simplify crashkernel reservation With the help of newly changed function parse_crashkernel() and generic reserve_crashkernel_generic(), crashkernel reservation can be simplified by steps: 1) Add a new header file , and define CRASH_ALIGN, CRASH_ADDR_LOW_MAX, CRASH_ADDR_HIGH_MAX and DEFAULT_CRASH_KERNEL_LOW_SIZE in ; 2) Add arch_reserve_crashkernel() to call parse_crashkernel() and reserve_crashkernel_generic(); 3) Add ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION Kconfig in arch/arm64/Kconfig. The old reserve_crashkernel_low() and reserve_crashkernel() can be removed. Link: https://lkml.kernel.org/r/20230914033142.676708-8-bhe@redhat.com Signed-off-by: Baoquan He Reviewed-by: Zhen Lei Cc: Catalin Marinas Cc: Chen Jiahao Signed-off-by: Andrew Morton commit 9c08a2a139fe83f217625ee0352ce531b9a666ea Author: Baoquan He Date: Thu Sep 14 11:31:39 2023 +0800 x86: kdump: use generic interface to simplify crashkernel reservation code With the help of newly changed function parse_crashkernel() and generic reserve_crashkernel_generic(), crashkernel reservation can be simplified by steps: 1) Add a new header file , and define CRASH_ALIGN, CRASH_ADDR_LOW_MAX, CRASH_ADDR_HIGH_MAX and DEFAULT_CRASH_KERNEL_LOW_SIZE in ; 2) Add arch_reserve_crashkernel() to call parse_crashkernel() and reserve_crashkernel_generic(), and do the ARCH specific work if needed. 3) Add ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION Kconfig in arch/x86/Kconfig. When adding DEFAULT_CRASH_KERNEL_LOW_SIZE, add crash_low_size_default() to calculate crashkernel low memory because x86_64 has special requirement. The old reserve_crashkernel_low() and reserve_crashkernel() can be removed. [bhe@redhat.com: move crash_low_size_default() code into ] Link: https://lkml.kernel.org/r/ZQpeAjOmuMJBFw1/@MiWiFi-R3L-srv Link: https://lkml.kernel.org/r/20230914033142.676708-7-bhe@redhat.com Signed-off-by: Baoquan He Cc: Catalin Marinas Cc: Chen Jiahao Cc: Zhen Lei Signed-off-by: Andrew Morton commit b631b95dded5e7f007a3a79cbaf82ef50c1e2cf7 Author: Baoquan He Date: Thu Sep 14 11:31:38 2023 +0800 crash_core: move crashk_*res definition into crash_core.c Both crashk_res and crashk_low_res are used to mark the reserved crashkernel regions in iomem_resource tree. And later the generic crashkernel resrvation will be added into crash_core.c. So move crashk_res and crashk_low_res definition into crash_core.c to avoid compiling error if CONFIG_CRASH_CORE=on while CONFIG_KEXEC_CORE is unset. Meanwhile include in if generic reservation is needed. In that case, need be added by ARCH. In asm/crash_core.h, ARCH can provide its own macro definitions to override macros in if needed. Wrap the including into CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION ifdeffery scope to avoid compiling error in other ARCH-es which don't take the generic reservation way yet. Link: https://lkml.kernel.org/r/20230914033142.676708-6-bhe@redhat.com Signed-off-by: Baoquan He Reviewed-by: Zhen Lei Cc: Catalin Marinas Cc: Chen Jiahao Signed-off-by: Andrew Morton commit 0ab97169aa0517079b22c2e64192906caa5dc6d5 Author: Baoquan He Date: Thu Sep 14 11:31:37 2023 +0800 crash_core: add generic function to do reservation In architecture like x86_64, arm64 and riscv, they have vast virtual address space and usually have huge physical memory RAM. Their crashkernel reservation doesn't have to be limited under 4G RAM, but can be extended to the whole physical memory via crashkernel=,high support. Now add function reserve_crashkernel_generic() to reserve crashkernel memory if users specify any case of kernel pamameters, like crashkernel=xM[@offset] or crashkernel=,high|low. This is preparation to simplify code of crashkernel=,high support in architecutures. Link: https://lkml.kernel.org/r/20230914033142.676708-5-bhe@redhat.com Signed-off-by: Baoquan He Reviewed-by: Zhen Lei Cc: Catalin Marinas Cc: Chen Jiahao Signed-off-by: Andrew Morton commit 70916e9c8d9f1a286c99727072b22e395097909f Author: Baoquan He Date: Thu Sep 14 11:31:36 2023 +0800 crash_core: change parse_crashkernel() to support crashkernel=,high|low parsing Now parse_crashkernel() is a real entry point for all kinds of crahskernel parsing on any architecture. And wrap the crahskernel=,high|low handling inside CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION ifdeffery scope. Link: https://lkml.kernel.org/r/20230914033142.676708-4-bhe@redhat.com Signed-off-by: Baoquan He Reviewed-by: Zhen Lei Cc: Catalin Marinas Cc: Chen Jiahao Signed-off-by: Andrew Morton commit a9e1a3d84e4a0ea560ed4d84c28d06dbfdffed22 Author: Baoquan He Date: Thu Sep 14 11:31:35 2023 +0800 crash_core: change the prototype of function parse_crashkernel() Add two parameters 'low_size' and 'high' to function parse_crashkernel(), later crashkernel=,high|low parsing will be added. Make adjustments in all call sites of parse_crashkernel() in arch. Link: https://lkml.kernel.org/r/20230914033142.676708-3-bhe@redhat.com Signed-off-by: Baoquan He Reviewed-by: Zhen Lei Cc: Catalin Marinas Cc: Chen Jiahao Signed-off-by: Andrew Morton commit a6304272b03ece97346f16923453f7e36ec19a5a Author: Baoquan He Date: Thu Sep 14 11:31:34 2023 +0800 crash_core.c: remove unnecessary parameter of function Patch series "kdump: use generic functions to simplify crashkernel reservation in arch", v3. In the current arm64, crashkernel=,high support has been finished after several rounds of posting and careful reviewing. The code in arm64 which parses crashkernel kernel parameters firstly, then reserve memory can be a good example for other ARCH to refer to. Whereas in x86_64, the code mixing crashkernel parameter parsing and memory reserving is twisted, and looks messy. Refactoring the code to make it more readable maintainable is necessary. Here, firstly abstract the crashkernel parameter parsing code into parse_crashkernel() to make it be able to parse crashkernel=,high|low. Then abstract the crashkernel memory reserving code into a generic function reserve_crashkernel_generic(). Finally, in ARCH which crashkernel=,high support is needed, a simple arch_reserve_crashkernel() can be added to call above two functions. This can remove the duplicated implmentation code in each ARCH, like arm64, x86_64 and riscv. crashkernel=512M,high crashkernel=512M,high crashkernel=256M,low crashkernel=512M,high crashkernel=0M,low crashkernel=0M,high crashkernel=256M,low crashkernel=512M crashkernel=512M@0x4f000000 crashkernel=1G-4G:256M,4G-64G:320M,64G-:576M crashkernel=0M This patch (of 9): In all call sites of __parse_crashkernel(), the parameter 'name' is hardcoded as "crashkernel=". So remove the unnecessary parameter 'name', add local varibale 'name' inside __parse_crashkernel() instead. Link: https://lkml.kernel.org/r/20230914033142.676708-1-bhe@redhat.com Link: https://lkml.kernel.org/r/20230914033142.676708-2-bhe@redhat.com Signed-off-by: Baoquan He Reviewed-by: Zhen Lei Cc: Catalin Marinas Cc: Chen Jiahao Cc: Zhen Lei Signed-off-by: Andrew Morton commit e22c3872e4d58191538a2c31d47bb6bcec0fdfa0 Author: Azeem Shaikh Date: Thu Aug 31 19:38:27 2023 +0000 fs: ocfs2: replace strlcpy with sysfs_emit strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with sysfs_emit(). Direct replacement is safe here since its ok for `kernel_param_ops.get()` to return -errno [3]. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 [3] https://elixir.bootlin.com/linux/v6.5/source/include/linux/moduleparam.h#L52 Link: https://lkml.kernel.org/r/20230831193827.1528867-1-azeemshaikh38@gmail.com Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Reviewed-by: Joseph Qi Cc: Christian Brauner Cc: Dave Chinner Cc: Jan Kara Cc: Jeff Layton Cc: Joel Becker Cc: Mark Fasheh Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton commit f6e9d38f8eb00ac8b52e6d15f6aa9bcecacb081b Author: Andy Shevchenko Date: Tue Sep 12 12:23:55 2023 +0300 minmax: fix header inclusions BUILD_BUG_ON*() macros are defined in build_bug.h. Include it. Replace compiler_types.h by compiler.h, which provides the former, to have a definition of the __UNIQUE_ID(). Link: https://lkml.kernel.org/r/20230912092355.79280-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Reviewed-by: Herve Codina Cc: Rasmus Villemoes Signed-off-by: Andrew Morton commit 2d57792a39e5473c5d98fc0138c4e9ab9c98a57b Author: Rong Tao Date: Mon Sep 11 22:55:09 2023 +0800 pid: pid_ns_ctl_handler: remove useless comment commit 95846ecf9dac("pid: replace pid bitmap implementation with IDR API") removes 'last_pid' element, and use the idr_get_cursor-idr_set_cursor pair to set the value of idr, so useless comments should be removed. Link: https://lkml.kernel.org/r/tencent_157A2A1CAF19A3F5885F0687426159A19708@qq.com Signed-off-by: Rong Tao Cc: Aleksa Sarai Cc: Christian Brauner Cc: Frederic Weisbecker Cc: Jeff Xu Cc: Kees Cook Cc: Luis Chamberlain Signed-off-by: Andrew Morton commit 5e57418a2031cd5e1863efdf3d7447a16a368172 Author: Andy Shevchenko Date: Mon Sep 11 18:49:13 2023 +0300 minmax: deduplicate __unconst_integer_typeof() It appears that compiler_types.h already have an implementation of the __unconst_integer_typeof() called __unqual_scalar_typeof(). Use it instead of the copy. Link: https://lkml.kernel.org/r/20230911154913.4176033-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Herve Codina Signed-off-by: Andrew Morton commit 6309727ef27162deabd5c095c11af24970fba5a2 Author: Andreas Gruenbacher Date: Fri Sep 8 01:40:48 2023 +0200 kthread: add kthread_stop_put Add a kthread_stop_put() helper that stops a thread and puts its task struct. Use it to replace the various instances of kthread_stop() followed by put_task_struct(). Remove the kthread_stop_put() macro in usbip that is similar but doesn't return the result of kthread_stop(). [agruenba@redhat.com: fix kerneldoc comment] Link: https://lkml.kernel.org/r/20230911111730.2565537-1-agruenba@redhat.com [akpm@linux-foundation.org: document kthread_stop_put()'s argument] Link: https://lkml.kernel.org/r/20230907234048.2499820-1-agruenba@redhat.com Signed-off-by: Andreas Gruenbacher Signed-off-by: Andrew Morton commit ed5378a387fd7c382497f2abcf4605e030b64044 Author: Oleg Nesterov Date: Sat Sep 9 23:49:51 2023 +0200 taskstats: fill_stats_for_tgid: use for_each_thread() do/while_each_thread should be avoided when possible. Plus I _think_ this change allows to avoid lock_task_sighand() but I am not sure, I forgot everything about taskstats. In any case, this code does not look right in that the same thread can be accounted twice: taskstats_exit() can account the exiting thread in signal->stats and drop ->siglock but this thread is still on the thread-group list, so lock_task_sighand() can't help. Link: https://lkml.kernel.org/r/20230909214951.GA24274@redhat.com Signed-off-by: Oleg Nesterov Cc: Eric W. Biederman Signed-off-by: Andrew Morton commit 13b7bc60b5353371460a203df6c38ccd38ad7a3a Author: Oleg Nesterov Date: Sat Sep 9 19:26:29 2023 +0200 getrusage: use __for_each_thread() do/while_each_thread should be avoided when possible. Plus this change allows to avoid lock_task_sighand(), we can use rcu and/or sig->stats_lock instead. Link: https://lkml.kernel.org/r/20230909172629.GA20454@redhat.com Signed-off-by: Oleg Nesterov Cc: Eric W. Biederman Signed-off-by: Andrew Morton commit c7ac8231ace9b07306d0299969e42073b189c70a Author: Oleg Nesterov Date: Sat Sep 9 19:25:54 2023 +0200 getrusage: add the "signal_struct *sig" local variable No functional changes, cleanup/preparation. Link: https://lkml.kernel.org/r/20230909172554.GA20441@redhat.com Signed-off-by: Oleg Nesterov Cc: Eric W. Biederman Signed-off-by: Andrew Morton commit e5ecf29c507830f192d3eb255662ad9ba219c442 Author: Oleg Nesterov Date: Sat Sep 9 18:45:37 2023 +0200 signal: complete_signal: use __for_each_thread() do/while_each_thread should be avoided when possible. Link: https://lkml.kernel.org/r/20230909164537.GA11633@redhat.com Signed-off-by: Oleg Nesterov Cc: Eric W. Biederman Signed-off-by: Andrew Morton commit 7904e53ed5a20fc678c01d5d1b07ec486425bb6a Author: Oleg Nesterov Date: Sat Sep 9 18:45:01 2023 +0200 fs/proc: do_task_stat: use __for_each_thread() do/while_each_thread should be avoided when possible. Link: https://lkml.kernel.org/r/20230909164501.GA11581@redhat.com Signed-off-by: Oleg Nesterov Cc: Eric W. Biederman Signed-off-by: Andrew Morton commit a9d56ce053dacf6e4171c984e2c6e689f10e94bd Author: Xingui Yang Date: Tue Sep 5 02:48:35 2023 +0000 scsi: qla2xxx: use DEFINE_SHOW_STORE_ATTRIBUTE() helper for debugfs Use DEFINE_SHOW_STORE_ATTRIBUTE() helper for read-write file to reduce some duplicated code. Link: https://lkml.kernel.org/r/20230905024835.43219-4-yangxingui@huawei.com Signed-off-by: Luo Jiaxing Co-developed-by: Xingui Yang Signed-off-by: Xingui Yang Reviewed-by: Andy Shevchenko Cc: Al Viro Cc: Animesh Manna Cc: Anshuman Gupta Cc: Damien Le Moal Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: Himanshu Madhani Cc: James Bottomley Cc: John Garry Cc: Martin K. Petersen Cc: Uma Shankar Cc: Xiang Chen Cc: Zeng Tao Signed-off-by: Andrew Morton commit 00c9d55f57d53a12866cbf5e5aee9a9a0e572b19 Author: Xingui Yang Date: Tue Sep 5 02:48:34 2023 +0000 scsi: hisi_sas: use DEFINE_SHOW_STORE_ATTRIBUTE() helper for debugfs Use DEFINE_SHOW_STORE_ATTRIBUTE() helper for read-write file to reduce some duplicated code. Link: https://lkml.kernel.org/r/20230905024835.43219-3-yangxingui@huawei.com Signed-off-by: Luo Jiaxing Co-developed-by: Xingui Yang Signed-off-by: Xingui Yang Reviewed-by: Andy Shevchenko Cc: Al Viro Cc: Animesh Manna Cc: Anshuman Gupta Cc: Damien Le Moal Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: Himanshu Madhani Cc: James Bottomley Cc: John Garry Cc: Martin K. Petersen Cc: Uma Shankar Cc: Xiang Chen Cc: Zeng Tao Signed-off-by: Andrew Morton commit 9cba82bba500e3ce875381350f289cfb3aa633ba Author: Xingui Yang Date: Tue Sep 5 02:48:33 2023 +0000 seq_file: add helper macro to define attribute for rw file Patch series "Add helper macro DEFINE_SHOW_STORE_ATTRIBUTE() at seq_file.c", v6. We already own DEFINE_SHOW_ATTRIBUTE() helper macro for defining attribute for read-only file, but we found many of drivers also want a helper macro for read-write file too. So we add this helper macro to reduce duplicated code. This patch (of 3): We already own DEFINE_SHOW_ATTRIBUTE() helper macro for defining attribute for read-only file, but many of drivers want a helper macro for read-write file too. So we add DEFINE_SHOW_STORE_ATTRIBUTE() helper to reduce duplicated code. Link: https://lkml.kernel.org/r/20230905024835.43219-1-yangxingui@huawei.com Link: https://lkml.kernel.org/r/20230905024835.43219-2-yangxingui@huawei.com Signed-off-by: Luo Jiaxing Co-developed-by: Xingui Yang Signed-off-by: Xingui Yang Reviewed-by: Andy Shevchenko Cc: Al Viro Cc: Animesh Manna Cc: Anshuman Gupta Cc: Damien Le Moal Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: Himanshu Madhani Cc: James Bottomley Cc: John Garry Cc: Martin K. Petersen Cc: Uma Shankar Cc: Xiang Chen Cc: Zeng Tao Signed-off-by: Andrew Morton commit 9734fe4dc22052d8010cc0b68b092fe5335ccb31 Author: Uros Bizjak Date: Mon Sep 4 17:21:01 2023 +0200 panic: use atomic_try_cmpxchg in panic() and nmi_panic() Use atomic_try_cmpxchg instead of atomic_cmpxchg (*ptr, old, new) == old in panic() and nmi_panic(). x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, rename cpu variable to this_cpu in nmi_panic() and try to unify logic flow between panic() and nmi_panic(). No functional change intended. [ubizjak@gmail.com: clean up if/else block] Link: https://lkml.kernel.org/r/20230906191200.68707-1-ubizjak@gmail.com Link: https://lkml.kernel.org/r/20230904152230.9227-1-ubizjak@gmail.com Signed-off-by: Uros Bizjak Cc: Mark Rutland Signed-off-by: Andrew Morton commit 398352049146e34ec6113a00c63457149a81345c Author: Oleg Nesterov Date: Wed Aug 23 19:14:55 2023 +0200 __kill_pgrp_info: simplify the calculation of return value No need to calculate/check the "success" variable, we can kill it and update retval in the main loop unless it is zero. Link: https://lkml.kernel.org/r/20230823171455.GA12188@redhat.com Signed-off-by: Oleg Nesterov Suggested-by: David Laight Cc: Eric W. Biederman Signed-off-by: Andrew Morton commit 8e1f385104ac044f1552686ad6e1cbc71cc05a30 Author: Oleg Nesterov Date: Sat Aug 26 13:14:09 2023 +0200 kill task_struct->thread_group The last user was removed by the previous patch. Link: https://lkml.kernel.org/r/20230826111409.GA23243@redhat.com Signed-off-by: Oleg Nesterov Cc: Eric W. Biederman Cc: Peter Zijlstra Signed-off-by: Andrew Morton commit e34a35ee1f52312af130b5ebd42fa28313fc6149 Author: Oleg Nesterov Date: Sat Aug 26 13:14:06 2023 +0200 change thread_group_empty() to use task_struct->thread_node Patch series "kill task_struct->thread_group". This patch (of 2): It could use list_is_singular() but this way it is cheaper. Plus the thread_group_leader() check makes it clear that thread_group_empty() can only return true if p is a group leader. This was not immediately obvious before this patch. task_struct->thread_group no longer has users, it can die. Link: https://lkml.kernel.org/r/20230826111200.GA22982@redhat.com Link: https://lkml.kernel.org/r/20230826111406.GA23238@redhat.com Signed-off-by: Oleg Nesterov Cc: Eric W. Biederman Cc: Peter Zijlstra Signed-off-by: Andrew Morton commit d639cf4abb4d171ab2456904da5668c42b5c1937 Author: Oleg Nesterov Date: Thu Aug 24 16:32:01 2023 +0200 change next_thread() to use __next_thread() ?: group_leader This relies on fact that group leader is always the 1st entry in the signal->thread_head list. With or without this change, if the lockless next_thread(last_thread) races with exec it can return the old or the new leader. We are almost ready to kill task->thread_group, after this change its only user is thread_group_empty(). Link: https://lkml.kernel.org/r/20230824143201.GB31222@redhat.com Signed-off-by: Oleg Nesterov Cc: Eric W. Biederman Cc: Peter Zijlstra Signed-off-by: Andrew Morton commit 33a9813825710fdc2b980d566ee391fd093a36c6 Author: Oleg Nesterov Date: Thu Aug 24 16:31:42 2023 +0200 introduce __next_thread(), fix next_tid() vs exec() race Patch series "introduce __next_thread(), change next_thread()". After commit dce8f8ed1de1 ("document while_each_thread(), change first_tid() to use for_each_thread()") + this series 1. We have only one lockless user of next_thread(), task_group_seq_get_next(). I think it should be changed too. 2. We have only one user of task_struct->thread_group, thread_group_empty(). The next patches will change thread_group_empty() and kill ->thread_group. This patch (of 2): next_tid(start) does: rcu_read_lock(); if (pid_alive(start)) { pos = next_thread(start); if (thread_group_leader(pos)) pos = NULL; else get_task_struct(pos); it should return pos = NULL when next_thread() wraps to the 1st thread in the thread group, group leader, and the thread_group_leader() check tries to detect this case. But this can race with exec. To simplify, suppose we have a main thread M and a single sub-thread T, next_tid(T) should return NULL. Now suppose that T execs. If next_tid(T) is called after T changes the leadership and before it does release_task() which removes the old leader from list, then next_thread() returns M and thread_group_leader(M) = F. Lockless use of next_thread() should be avoided. After this change only task_group_seq_get_next() does this, and I believe it should be changed as well. Link: https://lkml.kernel.org/r/20230824143112.GA31208@redhat.com Link: https://lkml.kernel.org/r/20230824143142.GA31222@redhat.com Signed-off-by: Oleg Nesterov Cc: Eric W. Biederman Cc: Peter Zijlstra Signed-off-by: Andrew Morton commit 00adf323b2e7c973a7129b906c381ed377aec1a5 Author: Yuanheng Zhang Date: Mon Aug 28 13:17:41 2023 +0800 ocfs2: correct range->len in ocfs2_trim_fs() global bitmap is a cluster allocator,so after we traverse the global bitmap and finished the fstrim,the trimmed range should be 'trimmed * clustersize'.otherwise,the trimmed range printed by 'fstrim -v' is not as expected. Link: https://lkml.kernel.org/r/20230828051741.204577-1-yuanhengzhang1214@gmail.com Signed-off-by: Yuanheng Zhang Reviewed-by: Joseph Qi Cc: Joel Becker Cc: Mark Fasheh Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton commit a8306f2d4dcea03538c70c26d2948483f70254ff Author: Nick Desaulniers Date: Thu Aug 31 09:33:40 2023 -0700 compiler.h: unify __UNIQUE_ID commit 6f33d58794ef ("__UNIQUE_ID()") added a fallback definition of __UNIQUE_ID because gcc 4.2 and older did not support __COUNTER__. Also, this commit is effectively a revert of commit b41c29b0527c ("Kbuild: provide a __UNIQUE_ID for clang") which mentions clang 2.6+ supporting __COUNTER__. Documentation/process/changes.rst currently lists the minimum supported version of these compilers as: - gcc: 5.1 - clang: 11.0.0 It should be safe to say that __COUNTER__ is well supported by this point. Link: https://lkml.kernel.org/r/20230831-unique_id-v1-1-28bacd18eb1d@google.com Signed-off-by: Nick Desaulniers Cc: Arnd Bergmann Cc: Jan Beulich Cc: Luc Van Oostenryck Cc: Michal rarek Cc: Nathan Chancellor Cc: Paul Russel Cc: Tom Rix Signed-off-by: Andrew Morton commit c0d2f4ce5c9fbc3e3b219d828b77ecd4445c1ad2 Author: Costa Shulyupin Date: Fri Aug 25 04:30:57 2023 +0300 docs: fix link s390/zfcpdump.rst After move of Documentation/s390 to Documentation/arch/s390 Link: https://lkml.kernel.org/r/20230825013102.1487979-1-costa.shul@redhat.com Signed-off-by: Costa Shulyupin Cc: Baoquan He Cc: Eric DeVolder Cc: Hari Bathini Cc: Sourabh Jain Cc: Heiko Carstens Signed-off-by: Andrew Morton commit dc68badcede4ec3b4e5cdfcb8f678670220ac2ca Author: Yin Fengwei Date: Mon Sep 18 15:33:18 2023 +0800 mm: mlock: update mlock_pte_range to handle large folio Current kernel only lock base size folio during mlock syscall. Add large folio support with following rules: - Only mlock large folio when it's in VM_LOCKED VMA range and fully mapped to page table. fully mapped folio is required as if folio is not fully mapped to a VM_LOCKED VMA, if system is in memory pressure, page reclaim is allowed to pick up this folio, split it and reclaim the pages which are not in VM_LOCKED VMA. - munlock will apply to the large folio which is in VMA range or cross the VMA boundary. This is required to handle the case that the large folio is mlocked, later the VMA is split in the middle of large folio. Link: https://lkml.kernel.org/r/20230918073318.1181104-4-fengwei.yin@intel.com Signed-off-by: Yin Fengwei Cc: David Hildenbrand Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Ryan Roberts Cc: Yang Shi Cc: Yosry Ahmed Cc: Yu Zhao Signed-off-by: Andrew Morton commit 1acbc3f936146d1b34987294803ac131bc298ce8 Author: Yin Fengwei Date: Mon Sep 18 15:33:17 2023 +0800 mm: handle large folio when large folio in VM_LOCKED VMA range If large folio is in the range of VM_LOCKED VMA, it should be mlocked to avoid being picked by page reclaim. Which may split the large folio and then mlock each pages again. Mlock this kind of large folio to prevent them being picked by page reclaim. For the large folio which cross the boundary of VM_LOCKED VMA or not fully mapped to VM_LOCKED VMA, we'd better not to mlock it. So if the system is under memory pressure, this kind of large folio will be split and the pages ouf of VM_LOCKED VMA can be reclaimed. Ideally, for large folio, we should mlock it when the large folio is fully mapped to VMA and munlock it if any page are unmampped from VMA. But it's not easy to detect whether the large folio is fully mapped to VMA in some cases (like add/remove rmap). So we update mlock_vma_folio() and munlock_vma_folio() to mlock/munlock the folio according to vma->vm_flags. Let caller to decide whether they should call these two functions. For add rmap, only mlock normal 4K folio and postpone large folio handling to page reclaim phase. It is possible to reuse page table iterator to detect whether folio is fully mapped or not during page reclaim phase. For remove rmap, invoke munlock_vma_folio() to munlock folio unconditionly because rmap makes folio not fully mapped to VMA. Link: https://lkml.kernel.org/r/20230918073318.1181104-3-fengwei.yin@intel.com Signed-off-by: Yin Fengwei Cc: David Hildenbrand Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Ryan Roberts Cc: Yang Shi Cc: Yosry Ahmed Cc: Yu Zhao Signed-off-by: Andrew Morton commit 28e566572aacdc551e24649e57cc9f04ba880cd2 Author: Yin Fengwei Date: Mon Sep 18 15:33:16 2023 +0800 mm: add functions folio_in_range() and folio_within_vma() Patch series "support large folio for mlock", v3. Yu mentioned at [1] about the mlock() can't be applied to large folio. I leant the related code and here is my understanding: - For RLIMIT_MEMLOCK related, there is no problem. Because the RLIMIT_MEMLOCK statistics is not related underneath page. That means underneath page mlock or munlock doesn't impact the RLIMIT_MEMLOCK statistics collection which is always correct. - For keeping the page in RAM, there is no problem either. At least, during try_to_unmap_one(), once detect the VMA has VM_LOCKED bit set in vm_flags, the folio will be kept whatever the folio is mlocked or not. So the function of mlock for large folio works. But it's not optimized because the page reclaim needs scan these large folio and may split them. This series identified the large folio for mlock to four types: - The large folio is in VM_LOCKED range and fully mapped to the range - The large folio is in the VM_LOCKED range but not fully mapped to the range - The large folio cross VM_LOCKED VMA boundary - The large folio cross last level page table boundary For the first type, we mlock large folio so page reclaim will skip it. For the second/third type, we don't mlock large folio. As the pages not mapped to VM_LOACKED range are mapped to none VM_LOCKED range, if system is in memory pressure situation, the large folio can be picked by page reclaim and split. Then the pages not mapped to VM_LOCKED range can be reclaimed. For the fourth type, we don't mlock large folio because locking one page table lock can't prevent the part in another last level page table being unmapped. Thanks to Ryan for pointing this out. To check whether the folio is fully mapped to the range, PTEs needs be checked to see whether the page of folio is associated. Which needs take page table lock and is heavy operation. So far, the only place needs this check is madvise and page reclaim. These functions already have their own PTE iterator. patch1 introduce API to check whether large folio is in VMA range. patch2 make page reclaim/mlock_vma_folio/munlock_vma_folio support large folio mlock/munlock. patch3 make mlock/munlock syscall support large folio. Yu also mentioned a race which can make folio unevictable after munlock during RFC v2 discussion [3]: We decided that race issue didn't block this series based on: - That race issue was not introduced by this series - We had a looks-ok fix for that race issue. Need to wait for mlock_count fixing patch as Yosry Ahmed suggested [4] [1] https://lore.kernel.org/linux-mm/CAOUHufbtNPkdktjt_5qM45GegVO-rCFOMkSh0HQminQ12zsV8Q@mail.gmail.com/ [2] https://lore.kernel.org/linux-mm/20230809061105.3369958-1-fengwei.yin@intel.com/ [3] https://lore.kernel.org/linux-mm/CAOUHufZ6=9P_=CAOQyw0xw-3q707q-1FVV09dBNDC-hpcpj2Pg@mail.gmail.com/ This patch (of 3): folio_in_range() will be used to check whether the folio is mapped to specific VMA and whether the mapping address of folio is in the range. Also a helper function folio_within_vma() to check whether folio is in the range of vma based on folio_in_range(). Link: https://lkml.kernel.org/r/20230918073318.1181104-1-fengwei.yin@intel.com Link: https://lkml.kernel.org/r/20230918073318.1181104-2-fengwei.yin@intel.com Signed-off-by: Yin Fengwei Cc: David Hildenbrand Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Ryan Roberts Cc: Yang Shi Cc: Yosry Ahmed Cc: Yu Zhao Signed-off-by: Andrew Morton commit a0ce79253a96ee6bbcce90775ed342ef3153c68e Author: Jinjie Ruan Date: Mon Sep 18 20:09:51 2023 +0800 mm/damon/core-test: fix memory leak in damon_new_ctx() When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. The damon_ctx which is allocated by kzalloc() in damon_new_ctx() in damon_test_ops_registration() and damon_test_set_attrs() are not freed. So use damon_destroy_ctx() to free it. After applying this patch, the following memory leak is never detected unreferenced object 0xffff2b49c6968800 (size 512): comm "kunit_try_catch", pid 350, jiffies 4294895294 (age 557.028s) hex dump (first 32 bytes): 88 13 00 00 00 00 00 00 a0 86 01 00 00 00 00 00 ................ 00 87 93 03 00 00 00 00 0a 00 00 00 00 00 00 00 ................ backtrace: [<0000000088e71769>] slab_post_alloc_hook+0xb8/0x368 [<0000000073acab3b>] __kmem_cache_alloc_node+0x174/0x290 [<00000000b5f89cef>] kmalloc_trace+0x40/0x164 [<00000000eb19e83f>] damon_new_ctx+0x28/0xb4 [<00000000daf6227b>] damon_test_ops_registration+0x34/0x328 [<00000000559c4801>] kunit_try_run_case+0x50/0xac [<000000003932ed49>] kunit_generic_run_threadfn_adapter+0x20/0x2c [<000000003c3e9211>] kthread+0x124/0x130 [<0000000028f85bdd>] ret_from_fork+0x10/0x20 unreferenced object 0xffff2b49c1a9cc00 (size 512): comm "kunit_try_catch", pid 356, jiffies 4294895306 (age 557.000s) hex dump (first 32 bytes): 88 13 00 00 00 00 00 00 a0 86 01 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 0a 00 00 00 00 00 00 00 ................ backtrace: [<0000000088e71769>] slab_post_alloc_hook+0xb8/0x368 [<0000000073acab3b>] __kmem_cache_alloc_node+0x174/0x290 [<00000000b5f89cef>] kmalloc_trace+0x40/0x164 [<00000000eb19e83f>] damon_new_ctx+0x28/0xb4 [<00000000058495c4>] damon_test_set_attrs+0x30/0x1a8 [<00000000559c4801>] kunit_try_run_case+0x50/0xac [<000000003932ed49>] kunit_generic_run_threadfn_adapter+0x20/0x2c [<000000003c3e9211>] kthread+0x124/0x130 [<0000000028f85bdd>] ret_from_fork+0x10/0x20 Link: https://lkml.kernel.org/r/20230918120951.2230468-3-ruanjinjie@huawei.com Fixes: d1836a3b2a9a ("mm/damon/core-test: initialise context before test in damon_test_set_attrs()") Fixes: 4f540f5ab4f2 ("mm/damon/core-test: add a kunit test case for ops registration") Signed-off-by: Jinjie Ruan Reviewed-by: Feng Tang Reviewed-by: SeongJae Park Cc: Brendan Higgins Signed-off-by: Andrew Morton commit f950fa6ec6d2c058c64d364df5a460d1a0f16e96 Author: Jinjie Ruan Date: Mon Sep 18 20:09:50 2023 +0800 mm/damon/core-test: fix memory leak in damon_new_region() Patch series "mm/damon/core-test: Fix memory leaks in core-test", v3. There are a few memory leaks in core-test which are detected by kmemleak. This patchset fixes the issues. This patch (of 2): When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. The damon_region which is allocated by kmem_cache_alloc() in damon_new_region() in damon_test_regions() and damon_test_update_monitoring_result() are not freed. So for damon_test_regions(), replace damon_del_region() call with damon_destroy_region() so that it calls both damon_del_region() and damon_free_region(), the latter will free the damon_region. For damon_test_update_monitoring_result(), call damon_free_region() to free it. After applying this patch, the following memory leak is never detected. unreferenced object 0xffff2b49c3edc000 (size 56): comm "kunit_try_catch", pid 338, jiffies 4294895280 (age 557.084s) hex dump (first 32 bytes): 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 49 2b ff ff ............I+.. backtrace: [<0000000088e71769>] slab_post_alloc_hook+0xb8/0x368 [<00000000b528f67c>] kmem_cache_alloc+0x168/0x284 [<000000008603f022>] damon_new_region+0x28/0x54 [<00000000a3b8c64e>] damon_test_regions+0x38/0x270 [<00000000559c4801>] kunit_try_run_case+0x50/0xac [<000000003932ed49>] kunit_generic_run_threadfn_adapter+0x20/0x2c [<000000003c3e9211>] kthread+0x124/0x130 [<0000000028f85bdd>] ret_from_fork+0x10/0x20 unreferenced object 0xffff2b49c5b20000 (size 56): comm "kunit_try_catch", pid 354, jiffies 4294895304 (age 556.988s) hex dump (first 32 bytes): 03 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 96 00 00 00 49 2b ff ff ............I+.. backtrace: [<0000000088e71769>] slab_post_alloc_hook+0xb8/0x368 [<00000000b528f67c>] kmem_cache_alloc+0x168/0x284 [<000000008603f022>] damon_new_region+0x28/0x54 [<00000000ca019f80>] damon_test_update_monitoring_result+0x18/0x34 [<00000000559c4801>] kunit_try_run_case+0x50/0xac [<000000003932ed49>] kunit_generic_run_threadfn_adapter+0x20/0x2c [<000000003c3e9211>] kthread+0x124/0x130 [<0000000028f85bdd>] ret_from_fork+0x10/0x20 Link: https://lkml.kernel.org/r/20230918120951.2230468-1-ruanjinjie@huawei.com Link: https://lkml.kernel.org/r/20230918120951.2230468-2-ruanjinjie@huawei.com Fixes: 17ccae8bb5c9 ("mm/damon: add kunit tests") Fixes: f4c978b6594b ("mm/damon/core-test: add a test for damon_update_monitoring_results()") Signed-off-by: Jinjie Ruan Reviewed-by: SeongJae Park Cc: Brendan Higgins Cc: Feng Tang Signed-off-by: Andrew Morton commit ab428b4c459e62df7dab3b1b783ea03ea06ca895 Author: Jianguo Bao Date: Sun Sep 17 23:04:01 2023 +0800 mm/writeback: update filemap_dirty_folio() comment Change to use new address space operation dirty_folio(). Link: https://lkml.kernel.org/r/20230917-trycontrib1-v1-1-db22630b8839@gmail.com Fixes: 6f31a5a261db ("fs: Add aops->dirty_folio") Signed-off-by: Jianguo Bau Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit d57d36b56d66835411fe11332eeaa37e3f30173b Author: SeongJae Park Date: Sat Sep 16 02:09:45 2023 +0000 Docs/ABI/damon: update for DAMOS apply intervals Update DAMON ABI document for the newly added DAMON sysfs file for DAMOS apply intervals (apply_interval_us file). Link: https://lkml.kernel.org/r/20230916020945.47296-10-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Shuah Khan Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 033343d5c5b06431b83fb0c7d1af4aaebe0be75e Author: SeongJae Park Date: Sat Sep 16 02:09:44 2023 +0000 Docs/admin-guide/mm/damon/usage: update for DAMOS apply intervals Update DAMON usage document's DAMON sysfs interface section for the newly added DAMOS apply intervals support (apply_interval_us file). Link: https://lkml.kernel.org/r/20230916020945.47296-9-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Shuah Khan Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 65ded14e2818bdd9b9bdc128cf47122533f46778 Author: SeongJae Park Date: Sat Sep 16 02:09:43 2023 +0000 selftests/damon/sysfs: test DAMOS apply intervals Update DAMON selftests to test existence of the file for reading/writing DAMOS apply interval under each scheme directory. Link: https://lkml.kernel.org/r/20230916020945.47296-8-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Shuah Khan Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit a2a9f68e358fa9627aa72e7182ad0b82846bda9e Author: SeongJae Park Date: Sat Sep 16 02:09:42 2023 +0000 mm/damon/sysfs-schemes: support DAMOS apply interval Update DAMON sysfs interface to support DAMOS apply intervals by adding a new file, 'apply_interval_us' in each scheme directory. Users can set and get the interval for each scheme in microseconds by writing to and reading from the file. Link: https://lkml.kernel.org/r/20230916020945.47296-7-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Shuah Khan Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 3f8723f12990d38ed800570fb77b92cf4eff54c8 Author: SeongJae Park Date: Sat Sep 16 02:09:41 2023 +0000 Docs/mm/damon/design: document DAMOS apply intervals Update DAMON design doc to explain about DAMOS apply intervals. Link: https://lkml.kernel.org/r/20230916020945.47296-6-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Shuah Khan Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 42f994b71404b17abcd6b170de7a6aa95ffe5d4a Author: SeongJae Park Date: Sat Sep 16 02:09:40 2023 +0000 mm/damon/core: implement scheme-specific apply interval DAMON-based operation schemes are applied for every aggregation interval. That was mainly because schemes were using nr_accesses, which be complete to be used for every aggregation interval. However, the schemes are now using nr_accesses_bp, which is updated for each sampling interval in a way that reasonable to be used. Therefore, there is no reason to apply schemes for each aggregation interval. The unnecessary alignment with aggregation interval was also making some use cases of DAMOS tricky. Quotas setting under long aggregation interval is one such example. Suppose the aggregation interval is ten seconds, and there is a scheme having CPU quota 100ms per 1s. The scheme will actually uses 100ms per ten seconds, since it cannobe be applied before next aggregation interval. The feature is working as intended, but the results might not that intuitive for some users. This could be fixed by updating the quota to 1s per 10s. But, in the case, the CPU usage of DAMOS could look like spikes, and would actually make a bad effect to other CPU-sensitive workloads. Implement a dedicated timing interval for each DAMON-based operation scheme, namely apply_interval. The interval will be sampling interval aligned, and each scheme will be applied for its apply_interval. The interval is set to 0 by default, and it means the scheme should use the aggregation interval instead. This avoids old users getting any behavioral difference. Link: https://lkml.kernel.org/r/20230916020945.47296-5-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Shuah Khan Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit a72217ad596ec8a957e1f73e45817c3664d99f1e Author: SeongJae Park Date: Sat Sep 16 02:09:39 2023 +0000 mm/damon/core: use nr_accesses_bp as a source of damos_before_apply tracepoint damos_before_apply tracepoint is exposing access rate of DAMON regions using nr_accesses field of regions, which was actually used by DAMOS in the past. However, it has changed to use nr_accesses_bp instead. Update the tracepoint to expose the value that DAMOS is really using. Note that it doesn't expose the value as is in the basis point, but after converting it to the natural number by dividing it by 10,000. Therefore this change doesn't make user-visible behavioral differences. Link: https://lkml.kernel.org/r/20230916020945.47296-4-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Shuah Khan Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit e7639bb48d39dd7f544b19c8a09bb62f934b6e32 Author: SeongJae Park Date: Sat Sep 16 02:09:38 2023 +0000 mm/damon/sysfs-schemes: use nr_accesses_bp as the source of tried_regions//nr_accesses DAMON sysfs interface exposes access rate of each region via DAMOS tried regions directory. For this, the nr_accesses field of the region is used. DAMOS was actually using nr_accesses in the past, but it uses nr_accesses_bp now. Use the value that it is really using as the source. Note that this doesn't expose nr_accesses_bp as is (in basis point), but after converting it to the natural number by dividing the value by 10,000. Hence there is no behavioral change from users' perspective. Link: https://lkml.kernel.org/r/20230916020945.47296-3-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Shuah Khan Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit affa87c708185cab194099ee51b946ef0297f063 Author: SeongJae Park Date: Sat Sep 16 02:09:37 2023 +0000 mm/damon/core: make DAMOS uses nr_accesses_bp instead of nr_accesses Patch series "mm/damon: implement DAMOS apply intervals". DAMON-based operation schemes are applied for every aggregation interval. That is mainly because schemes are using nr_accesses, which be complete to be used for every aggregation interval. This makes some DAMOS use cases be tricky. Quota setting under long aggregation interval is one such example. Suppose the aggregation interval is ten seconds, and there is a scheme having CPU quota 100ms per 1s. The scheme will actually uses 100ms per ten seconds, since it cannobe be applied before next aggregation interval. The feature is working as intended, but the results might not that intuitive for some users. This could be fixed by updating the quota to 1s per 10s. But, in the case, the CPU usage of DAMOS could look like spikes, and actually make a bad effect to other CPU-sensitive workloads. Also, with such huge aggregation interval, users may want schemes to be applied more frequently. DAMON provides nr_accesses_bp, which is updated for each sampling interval in a way that reasonable to be used. By using that instead of nr_accesses, DAMOS can have its own time interval and mitigate abovely mentioned issues. This patchset makes DAMOS schemes to use nr_accesses_bp instead of nr_accesses, and have their own timing intervals. Also update DAMOS tried regions sysfs files and DAMOS before_apply tracepoint to use the new data as their source. Note that the interval is zero by default, and it is interpreted to use the aggregation interval instead. This avoids making user-visible behavioral changes. Patches Seuqeunce ----------------- The first patch (patch 1/9) makes DAMOS uses nr_accesses_bp instead of nr_accesses, and following two patches (patches 2/9 and 3/9) updates DAMON sysfs interface for DAMOS tried regions and the DAMOS before_apply tracespoint to use nr_accesses_bp instead of nr_accesses, respectively. The following two patches (patches 4/9 and 5/9) implements the scheme-specific apply interval for DAMON kernel API users and update the design document for the new feature. Finally, the following four patches (patches 6/9, 7/9, 8/9 and 9/9) add support of the feature in DAMON sysfs interface, add a simple selftest test case, and document the new file on the usage and the ABI documents, repsectively. This patch (of 9): DAMON provides nr_accesses_bp, which becomes same to nr_accesses * 10000 for every aggregation interval, but updated every sampling interval with a reasonable accuracy. Since DAMON-based operation schemes are applied in every aggregation interval using nr_accesses, using nr_accesses_bp instead will make no difference to users. Meanwhile, it allows DAMOS to apply the schemes in a time interval that less than the aggregation interval. It could be useful and more flexible for some cases. Do it. Link: https://lkml.kernel.org/r/20230916020945.47296-1-sj@kernel.org Link: https://lkml.kernel.org/r/20230916020945.47296-2-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Shuah Khan Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit d5b43e9683ec5c78524f9ae93c1824edcbc1f08d Author: Matthew Wilcox (Oracle) Date: Thu Aug 24 15:13:25 2023 +0100 hugetlb: convert remove_pool_huge_page() to remove_pool_hugetlb_folio() Convert the callers to expect a folio and remove the unnecesary conversion back to a struct page. Link: https://lkml.kernel.org/r/20230824141325.2704553-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Sidhartha Kumar Signed-off-by: Andrew Morton commit 04bbfd844b99c7c89a344236d3758e7a2d41572f Author: Matthew Wilcox (Oracle) Date: Thu Aug 24 15:13:24 2023 +0100 hugetlb: remove a few calls to page_folio() Anything found on a linked list threaded through ->lru is guaranteed to be a folio as the compound_head found in a tail page overlaps the ->lru member of struct page. So we can pull folios directly off these lists no matter whether pages or folios were added to the list. Link: https://lkml.kernel.org/r/20230824141325.2704553-3-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Sidhartha Kumar Signed-off-by: Andrew Morton commit 3ec145f9d01e799bc7e41277e571141546b850f3 Author: Matthew Wilcox (Oracle) Date: Thu Aug 24 15:13:23 2023 +0100 hugetlb: use a folio in free_hpage_workfn() Patch series "Small hugetlb cleanups", v2. Some trivial folio conversions This patch (of 3): update_and_free_hugetlb_folio puts the memory on hpage_freelist as a folio so we can take it off the list as a folio. Link: https://lkml.kernel.org/r/20230824141325.2704553-1-willy@infradead.org Link: https://lkml.kernel.org/r/20230824141325.2704553-2-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song Cc: Sidhartha Kumar Signed-off-by: Andrew Morton commit fde1c4ecf91640e5a95ec36b71ec2e8ec379ce40 Author: Usama Arif Date: Wed Sep 13 11:54:01 2023 +0100 mm: hugetlb: skip initialization of gigantic tail struct pages if freed by HVO The new boot flow when it comes to initialization of gigantic pages is as follows: - At boot time, for a gigantic page during __alloc_bootmem_hugepage, the region after the first struct page is marked as noinit. - This results in only the first struct page to be initialized in reserve_bootmem_region. As the tail struct pages are not initialized at this point, there can be a significant saving in boot time if HVO succeeds later on. - Later on in the boot, the head page is prepped and the first HUGETLB_VMEMMAP_RESERVE_SIZE / sizeof(struct page) - 1 tail struct pages are initialized. - HVO is attempted. If it is not successful, then the rest of the tail struct pages are initialized. If it is successful, no more tail struct pages need to be initialized saving significant boot time. The WARN_ON for increased ref count in gather_bootmem_prealloc was changed to a VM_BUG_ON. This is OK as there should be no speculative references this early in boot process. The VM_BUG_ON's are there just in case such code is introduced. [akpm@linux-foundation.org: make it nicer for 80 cols] Link: https://lkml.kernel.org/r/20230913105401.519709-5-usama.arif@bytedance.com Signed-off-by: Usama Arif Reviewed-by: Muchun Song Reviewed-by: Mike Kravetz Cc: Fam Zheng Cc: Mike Rapoport (IBM) Cc: Punit Agrawal Signed-off-by: Andrew Morton commit 77e6c43e137c130138c3fbadc847351a83c4befe Author: Usama Arif Date: Wed Sep 13 11:54:00 2023 +0100 memblock: introduce MEMBLOCK_RSRV_NOINIT flag For reserved memory regions marked with this flag, reserve_bootmem_region is not called during memmap_init_reserved_pages. This can be used to avoid struct page initialization for regions which won't need them, for e.g. hugepages with Hugepage Vmemmap Optimization enabled. Link: https://lkml.kernel.org/r/20230913105401.519709-4-usama.arif@bytedance.com Signed-off-by: Usama Arif Acked-by: Muchun Song Reviewed-by: Mike Rapoport (IBM) Cc: Fam Zheng Cc: Mike Kravetz Cc: Punit Agrawal Signed-off-by: Andrew Morton commit ee8d2071ef52d83a2ac4f8a474fafb2aea91766d Author: Usama Arif Date: Wed Sep 13 11:53:59 2023 +0100 memblock: pass memblock_type to memblock_setclr_flag This allows setting flags to both memblock types and is in preparation for setting flags (for e.g. to not initialize struct pages) on reserved memory region. [usama.arif@bytedance.com: add missing argument definition] Link: https://lkml.kernel.org/r/20230918090657.220463-1-usama.arif@bytedance.com Link: https://lkml.kernel.org/r/20230913105401.519709-3-usama.arif@bytedance.com Signed-off-by: Usama Arif Reviewed-by: Muchun Song Reviewed-by: Mike Rapoport (IBM) Acked-by: Mike Kravetz Cc: Fam Zheng Cc: Punit Agrawal Signed-off-by: Andrew Morton commit a9e34ea1f62c1e359ed197ec01d056c25edb2b61 Author: Usama Arif Date: Wed Sep 13 11:53:58 2023 +0100 mm: hugetlb_vmemmap: use nid of the head page to reallocate it Patch series "mm: hugetlb: Skip initialization of gigantic tail struct pages if freed by HVO", v5. This series moves the boot time initialization of tail struct pages of a gigantic page to later on in the boot. Only the HUGETLB_VMEMMAP_RESERVE_SIZE / sizeof(struct page) - 1 tail struct pages are initialized at the start. If HVO is successful, then no more tail struct pages need to be initialized. For a 1G hugepage, this series avoid initialization of 262144 - 63 = 262081 struct pages per hugepage. When tested on a 512G system (allocating 500 1G hugepages), the kexec-boot times with DEFERRED_STRUCT_PAGE_INIT enabled are: - with patches, HVO enabled: 1.32 seconds - with patches, HVO disabled: 2.15 seconds - without patches, HVO enabled: 3.90 seconds - without patches, HVO disabled: 3.58 seconds This represents an approximately 70% reduction in boot time and will significantly reduce server downtime when using a large number of gigantic pages. This patch (of 4): If tail page prep and initialization is skipped, then the "start" page will not contain the correct nid. Use the nid from first vmemap page. Link: https://lkml.kernel.org/r/20230913105401.519709-1-usama.arif@bytedance.com Link: https://lkml.kernel.org/r/20230913105401.519709-2-usama.arif@bytedance.com Signed-off-by: Usama Arif Reviewed-by: Muchun Song Reviewed-by: Mike Kravetz Cc: Fam Zheng Cc: Mike Rapoport (IBM) Cc: Punit Agrawal Signed-off-by: Andrew Morton commit 863803a7948c8e33e6a7b002017747ca83ecfd63 Author: SeongJae Park Date: Fri Sep 15 02:52:51 2023 +0000 mm/damon/core: mark damon_moving_sum() as a static function The function is used by only mm/damon/core.c. Mark it as a static function. Link: https://lkml.kernel.org/r/20230915025251.72816-9-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Signed-off-by: Andrew Morton commit 401807a316bb913f5eefcaf8343575ec9296d6b1 Author: SeongJae Park Date: Fri Sep 15 02:52:50 2023 +0000 mm/damon/core: skip updating nr_accesses_bp for each aggregation interval damon_merge_regions_of(), which is called for each aggregation interval, updates nr_accesses_bp to nr_accesses * 10000. However, nr_accesses_bp is updated for each sampling interval via damon_moving_sum() using the aggregation interval as the moving time window. And by the definition of the algorithm, the value becomes same to discrete-window based sum for each time window-aligned time. Hence, nr_accesses_bp will be same to nr_accesses * 10000 for each aggregation interval without explicit update. Remove the unnecessary update of nr_accesses_bp in damon_merge_regions_of(). Link: https://lkml.kernel.org/r/20230915025251.72816-8-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Signed-off-by: Andrew Morton commit ace30fb21af5f1be1605db72c16040b95b1557ef Author: SeongJae Park Date: Fri Sep 15 02:52:49 2023 +0000 mm/damon/core: use pseudo-moving sum for nr_accesses_bp Let nr_accesses_bp be calculated as a pseudo-moving sum that updated for every sampling interval, using damon_moving_sum(). This is assumed to be useful for cases that the aggregation interval is set quite huge, but the monivoting results need to be collected earlier than next aggregation interval is passed. Link: https://lkml.kernel.org/r/20230915025251.72816-7-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Signed-off-by: Andrew Morton commit 80333828ea7728ebe85d079bb5c1467eb9fc6c8c Author: SeongJae Park Date: Fri Sep 15 02:52:48 2023 +0000 mm/damon/core: introduce nr_accesses_bp Add yet another representation of the access rate of each region, namely nr_accesses_bp. It is just same to the nr_accesses but represents the value in basis point (1 in 10,000), and updated at once in every aggregation interval. That is, moving_accesses_bp is just nr_accesses * 10000. This may seems useless at the moment. However, it will be useful for representing less than one nr_accesses value that will be needed to make moving sum-based nr_accesses. Link: https://lkml.kernel.org/r/20230915025251.72816-6-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Signed-off-by: Andrew Morton commit 0926e8ff96b58845e802438374caaca53ab36053 Author: SeongJae Park Date: Fri Sep 15 02:52:47 2023 +0000 mm/damon/core-test: add a unit test for damon_moving_sum() Add a simple unit test for the pseudo moving-sum function (damon_moving_sum()). Link: https://lkml.kernel.org/r/20230915025251.72816-5-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Signed-off-by: Andrew Morton commit d2c062ade07ffd206dd16bf085f02abc59651309 Author: SeongJae Park Date: Fri Sep 15 02:52:46 2023 +0000 mm/damon/core: implement a pseudo-moving sum function For values that continuously change, moving average or sum are good ways to provide fast updates while handling temporal and errorneous variability of the value. For example, the access rate counter (nr_accesses) is calculated as a sum of the number of positive sampled access check results that collected during a discrete time window (aggregation interval), and hence it handles temporal and errorneous access check results, but provides the update only for every aggregation interval. Using a moving sum method for that could allow providing the value for every sampling interval. That could be useful for getting monitoring results snapshot or running DAMOS in fine-grained timing. However, supporting the moving sum for cases that number of samples in the time window is arbirary could impose high overhead, since the number of past values that it needs to keep could be too high. The nr_accesses would also be one of the cases. To mitigate the overhead, implement a pseudo-moving sum function that only provides an estimated pseudo-moving sum. It assumes there was no error in last discrete time window and subtract constant portion of last discrete time window sum. Note that the function is not strictly implementing the moving sum, but it keeps a property of moving sum, which makes the value same to the dsicrete-window based sum for each time window-aligned timing. Hence, people collecting the value in the old timings would show no difference. Link: https://lkml.kernel.org/r/20230915025251.72816-4-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Signed-off-by: Andrew Morton commit 22a7788038a660df8876ba54b941b418d2178f99 Author: SeongJae Park Date: Fri Sep 15 02:52:45 2023 +0000 mm/damon/vaddr: call damon_update_region_access_rate() always When getting mm_struct of the monitoring target process fails, there wil be no need to increase the access rate counter (nr_accesses) of the regions for the process. Hence, damon_va_check_accesses() skips calling damon_update_region_access_rate() in the case. This breaks the assumption that damon_update_region_access_rate() is called for every region, for every sampling interval. Call the function for every region even in the case. This might increase the overhead in some cases, but such case would not be frequent, so no significant impact is really expected. Link: https://lkml.kernel.org/r/20230915025251.72816-3-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Signed-off-by: Andrew Morton commit 78fbfb155d204428119310d1b9df665ab88da6e8 Author: SeongJae Park Date: Fri Sep 15 02:52:44 2023 +0000 mm/damon/core: define and use a dedicated function for region access rate update Patch series "mm/damon: provide pseudo-moving sum based access rate". DAMON checks the access to each region for every sampling interval, increase the access rate counter of the region, namely nr_accesses, if the access was made. For every aggregation interval, the counter is reset. The counter is exposed to users to be used as a metric showing the relative access rate (frequency) of each region. In other words, DAMON provides access rate of each region in every aggregation interval. The aggregation avoids temporal access pattern changes making things confusing. However, this also makes a few DAMON-related operations to unnecessarily need to be aligned to the aggregation interval. This can restrict the flexibility of DAMON applications, especially when the aggregation interval is huge. To provide the monitoring results in finer-grained timing while keeping handling of temporal access pattern change, this patchset implements a pseudo-moving sum based access rate metric. It is pseudo-moving sum because strict moving sum implementation would need to keep all values for last time window, and that could incur high overhead of there could be arbitrary number of values in a time window. Especially in case of the nr_accesses, since the sampling interval and aggregation interval can arbitrarily set and the past values should be maintained for every region, it could be risky. The pseudo-moving sum assumes there were no temporal access pattern change in last discrete time window to remove the needs for keeping the list of the last time window values. As a result, it beocmes not strict moving sum implementation, but provides a reasonable accuracy. Also, it keeps an important property of the moving sum. That is, the moving sum becomes same to discrete-window based sum at the time that aligns to the time window. This means using the pseudo moving sum based nr_accesses makes no change to users who shows the value for every aggregation interval. Patches Sequence ---------------- The sequence of the patches is as follows. The first four patches are for preparation of the change. The first two (patches 1 and 2) implements a helper function for nr_accesses update and eliminate corner case that skips use of the function, respectively. Following two (patches 3 and 4) respectively implement the pseudo-moving sum function and its simple unit test case. Two patches for making DAMON to use the pseudo-moving sum follow. The fifthe one (patch 5) introduces a new field for representing the pseudo-moving sum-based access rate of each region, and the sixth one makes the new representation to actually updated with the pseudo-moving sum function. Last two patches (patches 7 and 8) makes followup fixes for skipping unnecessary updates and marking the moving sum function as static, respectively. This patch (of 8): Each DAMON operarions set is updating nr_accesses field of each damon_region for each of their access check results, from the check_accesses() callback. Directly accessing the field could make things complex to manage and change in future. Define and use a dedicated function for the purpose. Link: https://lkml.kernel.org/r/20230915025251.72816-1-sj@kernel.org Link: https://lkml.kernel.org/r/20230915025251.72816-2-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Signed-off-by: Andrew Morton commit 4472edf63d6630e6cf65e205b4fc8c3c94d0afe5 Author: SeongJae Park Date: Thu Sep 14 02:15:23 2023 +0000 mm/damon/core: use number of passed access sampling as a timer DAMON sleeps for sampling interval after each sampling, and check if the aggregation interval and the ops update interval have passed using ktime_get_coarse_ts64() and baseline timestamps for the intervals. That design is for making the operations occur at deterministic timing regardless of the time that spend for each work. However, it turned out it is not that useful, and incur not-that-intuitive results. After all, timer functions, and especially sleep functions that DAMON uses to wait for specific timing, are not necessarily strictly accurate. It is legal design, so no problem. However, depending on such inaccuracies, the nr_accesses can be larger than aggregation interval divided by sampling interval. For example, with the default setting (5 ms sampling interval and 100 ms aggregation interval) we frequently show regions having nr_accesses larger than 20. Also, if the execution of a DAMOS scheme takes a long time, next aggregation could happen before enough number of samples are collected. This is not what usual users would intuitively expect. Since access check sampling is the smallest unit work of DAMON, using the number of passed sampling intervals as the DAMON-internal timer can easily avoid these problems. That is, convert aggregation and ops update intervals to numbers of sampling intervals that need to be passed before those operations be executed, count the number of passed sampling intervals, and invoke the operations as soon as the specific amount of sampling intervals passed. Make the change. Note that this could make a behavioral change to settings that using intervals that not aligned by the sampling interval. For example, if the sampling interval is 5 ms and the aggregation interval is 12 ms, DAMON effectively uses 15 ms as its aggregation interval, because it checks whether the aggregation interval after sleeping the sampling interval. This change will make DAMON to effectively use 10 ms as aggregation interval, since it uses 'aggregation interval / sampling interval * sampling interval' as the effective aggregation interval, and we don't use floating point types. Usual users would have used aligned intervals, so this behavioral change is not expected to make any meaningful impact, so just make this change. Link: https://lkml.kernel.org/r/20230914021523.60649-1-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton commit aa5fe31b6b59210cb4ea28a59e68781f48eeca74 Author: Zi Yan Date: Wed Sep 13 16:12:48 2023 -0400 mips: use nth_page() in place of direct struct page manipulation __flush_dcache_pages() is called during hugetlb migration via migrate_pages() -> migrate_hugetlbs() -> unmap_and_move_huge_page() -> move_to_new_folio() -> flush_dcache_folio(). And with hugetlb and without sparsemem vmemmap, struct page is not guaranteed to be contiguous beyond a section. Use nth_page() instead. Without the fix, a wrong address might be used for data cache page flush. No bug is reported. The fix comes from code inspection. Link: https://lkml.kernel.org/r/20230913201248.452081-6-zi.yan@sent.com Fixes: 15fa3e8e3269 ("mips: implement the new page table range API") Signed-off-by: Zi Yan Cc: David Hildenbrand Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Muchun Song Cc: Thomas Bogendoerfer Cc: Signed-off-by: Andrew Morton commit 8db0ec791f7788cd21e7f91ee5ff42c1c458d0e7 Author: Zi Yan Date: Wed Sep 13 16:12:47 2023 -0400 fs: use nth_page() in place of direct struct page manipulation When dealing with hugetlb pages, struct page is not guaranteed to be contiguous on SPARSEMEM without VMEMMAP. Use nth_page() to handle it properly. Without the fix, a wrong subpage might be checked for HWPoison, causing wrong number of bytes of a page copied to user space. No bug is reported. The fix comes from code inspection. Link: https://lkml.kernel.org/r/20230913201248.452081-5-zi.yan@sent.com Fixes: 38c1ddbde6c6 ("hugetlbfs: improve read HWPOISON hugepage") Signed-off-by: Zi Yan Reviewed-by: Muchun Song Cc: David Hildenbrand Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Thomas Bogendoerfer Cc: Signed-off-by: Andrew Morton commit 1640a0ef80f6d572725f5b0330038c18e98ea168 Author: Zi Yan Date: Wed Sep 13 16:12:46 2023 -0400 mm/memory_hotplug: use pfn math in place of direct struct page manipulation When dealing with hugetlb pages, manipulating struct page pointers directly can get to wrong struct page, since struct page is not guaranteed to be contiguous on SPARSEMEM without VMEMMAP. Use pfn calculation to handle it properly. Without the fix, a wrong number of page might be skipped. Since skip cannot be negative, scan_movable_page() will end early and might miss a movable page with -ENOENT. This might fail offline_pages(). No bug is reported. The fix comes from code inspection. Link: https://lkml.kernel.org/r/20230913201248.452081-4-zi.yan@sent.com Fixes: eeb0efd071d8 ("mm,memory_hotplug: fix scan_movable_pages() for gigantic hugepages") Signed-off-by: Zi Yan Reviewed-by: Muchun Song Acked-by: David Hildenbrand Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Thomas Bogendoerfer Cc: Signed-off-by: Andrew Morton commit 426056efe835cf4864ccf4c328fe3af9146fc539 Author: Zi Yan Date: Wed Sep 13 16:12:45 2023 -0400 mm/hugetlb: use nth_page() in place of direct struct page manipulation When dealing with hugetlb pages, manipulating struct page pointers directly can get to wrong struct page, since struct page is not guaranteed to be contiguous on SPARSEMEM without VMEMMAP. Use nth_page() to handle it properly. A wrong or non-existing page might be tried to be grabbed, either leading to a non freeable page or kernel memory access errors. No bug is reported. It comes from code inspection. Link: https://lkml.kernel.org/r/20230913201248.452081-3-zi.yan@sent.com Fixes: 57a196a58421 ("hugetlb: simplify hugetlb handling in follow_page_mask") Signed-off-by: Zi Yan Reviewed-by: Muchun Song Cc: David Hildenbrand Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Thomas Bogendoerfer Cc: Signed-off-by: Andrew Morton commit 2e7cfe5cd5b6b0b98abf57a3074885979e187c1c Author: Zi Yan Date: Wed Sep 13 16:12:44 2023 -0400 mm/cma: use nth_page() in place of direct struct page manipulation Patch series "Use nth_page() in place of direct struct page manipulation", v3. On SPARSEMEM without VMEMMAP, struct page is not guaranteed to be contiguous, since each memory section's memmap might be allocated independently. hugetlb pages can go beyond a memory section size, thus direct struct page manipulation on hugetlb pages/subpages might give wrong struct page. Kernel provides nth_page() to do the manipulation properly. Use that whenever code can see hugetlb pages. This patch (of 5): When dealing with hugetlb pages, manipulating struct page pointers directly can get to wrong struct page, since struct page is not guaranteed to be contiguous on SPARSEMEM without VMEMMAP. Use nth_page() to handle it properly. Without the fix, page_kasan_tag_reset() could reset wrong page tags, causing a wrong kasan result. No related bug is reported. The fix comes from code inspection. Link: https://lkml.kernel.org/r/20230913201248.452081-1-zi.yan@sent.com Link: https://lkml.kernel.org/r/20230913201248.452081-2-zi.yan@sent.com Fixes: 2813b9c02962 ("kasan, mm, arm64: tag non slab memory allocated via pagealloc") Signed-off-by: Zi Yan Reviewed-by: Muchun Song Cc: David Hildenbrand Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Mike Rapoport (IBM) Cc: Thomas Bogendoerfer Cc: Signed-off-by: Andrew Morton commit 3dfbb555c98ac55b9d911f9af0e35014b445fb41 Author: Vlastimil Babka Date: Thu Sep 14 15:16:39 2023 +0200 mm, vmscan: remove ISOLATE_UNMAPPED This isolate_mode_t flag is effectively unused since 89f6c88a6ab4 ("mm: __isolate_lru_page_prepare() in isolate_migratepages_block()") as sc->may_unmap is now checked directly (and only node_reclaim has a mode that sets it to 0). The last remaining place is mm_vmscan_lru_isolate tracepoint for the isolate_mode parameter. That one was mainly used to indicate the active/inactive mode, which the trace-vmscan-postprocess.pl script consumed, but that got silently broken. After fixing the script by the previous patch, it does not need the isolate_mode anymore. So just remove the parameter and with that the whole ISOLATE_UNMAPPED flag. Link: https://lkml.kernel.org/r/20230914131637.12204-4-vbabka@suse.cz Signed-off-by: Vlastimil Babka Cc: Hugh Dickins Cc: Mel Gorman Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 83121580f2eb487b7510fb892674c28412e7c73e Author: Vlastimil Babka Date: Thu Sep 14 15:16:38 2023 +0200 trace-vmscan-postprocess: sync with tracepoints updates The script has fallen behind tracepoint changes for a while, fix it up. Most changes are mechanical (renames, removal of tracepoint parameters that are not used by the script). More notable change involves mm_vmscan_lru_isolate which is relying on the isolate_mode to determine if the inactive list is being scanned. However the parameter currently only indicates ISOLATE_UNMAPPED. We can use the lru parameter instead to determine which list is scanned, and stop checking isolate_mode. Link: https://lkml.kernel.org/r/20230914131637.12204-3-vbabka@suse.cz Signed-off-by: Vlastimil Babka Cc: Hugh Dickins Cc: Mel Gorman Signed-off-by: Andrew Morton commit 93b13ecaa713e1fcbf23b7483eec065d300c5ad8 Author: Matthew Wilcox (Oracle) Date: Thu Sep 14 16:00:11 2023 +0100 buffer: remove __getblk_gfp() Inline it into __bread_gfp(). Link: https://lkml.kernel.org/r/20230914150011.843330-9-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Hui Zhu Signed-off-by: Andrew Morton commit 8a83ac54940d27b8f56d766e1cb270d150fedd50 Author: Matthew Wilcox (Oracle) Date: Thu Sep 14 16:00:10 2023 +0100 ext4: call bdev_getblk() from sb_getblk_gfp() Most of the callers of sb_getblk_gfp() already assumed that they were passing the entire GFP flags to use. Fix up the two callers that didn't, and remove the __GFP_NOFAIL from them since they both appear to correctly handle failure. Link: https://lkml.kernel.org/r/20230914150011.843330-8-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Hui Zhu Signed-off-by: Andrew Morton commit 4b9c8b1919323f7f359376ca31a4c721cb2b3acf Author: Matthew Wilcox (Oracle) Date: Thu Sep 14 16:00:09 2023 +0100 buffer: convert sb_getblk() to call __getblk() Now that __getblk() is in the right place in the file, it is trivial to call it from sb_getblk(). Link: https://lkml.kernel.org/r/20230914150011.843330-7-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Hui Zhu Signed-off-by: Andrew Morton commit c645e65c0675dd4df7ee68b995154dc1c1e7ce3b Author: Matthew Wilcox (Oracle) Date: Thu Sep 14 16:00:08 2023 +0100 buffer: convert getblk_unmovable() and __getblk() to use bdev_getblk() Move these two functions up in the file for the benefit of the next patch, and pass in all of the GFP flags to use instead of the partial GFP flags used by __getblk_gfp(). Link: https://lkml.kernel.org/r/20230914150011.843330-6-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Hui Zhu Signed-off-by: Andrew Morton commit 775d9b10530a0a303dc08a9cdb2ed1f8667d9c5f Author: Matthew Wilcox (Oracle) Date: Thu Sep 14 16:00:07 2023 +0100 buffer: use bdev_getblk() to avoid memory reclaim in readahead path __getblk() adds __GFP_NOFAIL, which is unnecessary for readahead; we're quite comfortable with the possibility that we may not get a bh back. Switch to bdev_getblk() which does not include __GFP_NOFAIL. Link: https://lkml.kernel.org/r/20230914150011.843330-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Hui Zhu Signed-off-by: Andrew Morton commit e509ad4d77e6c8852f082104e388110d16fdfb97 Author: Matthew Wilcox (Oracle) Date: Thu Sep 14 16:00:06 2023 +0100 ext4: use bdev_getblk() to avoid memory reclaim in readahead path sb_getblk_gfp adds __GFP_NOFAIL, which is unnecessary for readahead; we're quite comfortable with the possibility that we may not get a bh back. Switch to bdev_getblk() which does not include __GFP_NOFAIL. Link: https://lkml.kernel.org/r/20230914150011.843330-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reported-by: Hui Zhu Closes: https://lore.kernel.org/linux-fsdevel/20230811035705.3296-1-teawaterz@linux.alibaba.com/ Signed-off-by: Andrew Morton commit 3ed65f04aac4d1cd025f30ee3fac174bcbf2b018 Author: Matthew Wilcox (Oracle) Date: Thu Sep 14 16:00:05 2023 +0100 buffer: hoist GFP flags from grow_dev_page() to __getblk_gfp() grow_dev_page() is only called by grow_buffers(). grow_buffers() is only called by __getblk_slow() and __getblk_slow() is only called from __getblk_gfp(), so it is safe to move the GFP flags setting all the way up. With that done, add a new bdev_getblk() entry point that leaves the GFP flags the way the caller specified them. [willy@infradead.org: fix grow_dev_page() error handling] Link: https://lkml.kernel.org/r/ZRREEIwqiy5DijKB@casper.infradead.org Link: https://lkml.kernel.org/r/20230914150011.843330-3-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Hui Zhu Cc: Dan Carpenter Signed-off-by: Andrew Morton commit 2a41815784e029cbef571511384f00fa40f2a82e Author: Matthew Wilcox (Oracle) Date: Thu Sep 14 16:00:04 2023 +0100 buffer: pass GFP flags to folio_alloc_buffers() Patch series "Add and use bdev_getblk()", v2. This patch series fixes a bug reported by Hui Zhu; see proposed patches v1 and v2: https://lore.kernel.org/linux-fsdevel/20230811035705.3296-1-teawaterz@linux.alibaba.com/ https://lore.kernel.org/linux-fsdevel/20230811071519.1094-1-teawaterz@linux.alibaba.com/ I decided to go in a rather different direction for this fix, and fix a related problem at the same time. I don't think there's any urgency to rush this into Linus' tree, nor have I marked it for stable. Reasonable people may disagree. This patch (of 8): Instead of creating entirely new flags, inherit them from grow_dev_page(). The other callers create the same flags that this function used to create. Link: https://lkml.kernel.org/r/20230914150011.843330-1-willy@infradead.org Link: https://lkml.kernel.org/r/20230914150011.843330-2-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Cc: Hui Zhu Signed-off-by: Andrew Morton commit 1b2b7a17ab60ed58875ba6a86ec79fad2f7b7d38 Author: SeongJae Park Date: Wed Sep 13 02:20:50 2023 +0000 Docs/admin-guide/mm/damon/usage: document damos_before_apply tracepoint Document damos_before_apply tracepoint on the usage document. Link: https://lkml.kernel.org/r/20230913022050.2109-3-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit c603c630b509d690d470b9b49eb96f40482f47d5 Author: SeongJae Park Date: Wed Sep 13 02:20:49 2023 +0000 mm/damon/core: add a tracepoint for damos apply target regions Patch series "mm/damon: add a tracepoint for damos apply target regions", v2. DAMON provides damon_aggregated tracepoint to let users record full monitoring results. Sometimes, users need to record monitoring results of specific pattern. DAMOS tried regions directory of DAMON sysfs interface allows it, but the interface is mainly designed for snapshots and therefore would be inefficient for such recording. Implement yet another tracepoint for efficient support of the usecase. This patch (of 2): DAMON provides damon_aggregated tracepoint, which exposes details of each region and its access monitoring results. It is useful for getting whole monitoring results, e.g., for recording purposes. For investigations of DAMOS, DAMON Sysfs interface provides DAMOS statistics and tried_regions directory. But, those provides only statistics and snapshots. If the scheme is frequently applied and if the user needs to know every detail of DAMOS behavior, the snapshot-based interface could be insufficient and expensive. As a last resort, userspace users need to record the all monitoring results via damon_aggregated tracepoint and simulate how DAMOS would worked. It is unnecessarily complicated. DAMON kernel API users, meanwhile, can do that easily via before_damos_apply() callback field of 'struct damon_callback', though. Add a tracepoint that will be called just after before_damos_apply() callback for more convenient investigations of DAMOS. The tracepoint exposes all details about each regions, similar to damon_aggregated tracepoint. Please note that DAMOS is currently not only for memory management but also for query-like efficient monitoring results retrievals (when 'stat' action is used). Until now, only statistics or snapshots were supported. Addition of this tracepoint allows efficient full recording of DAMOS-based filtered monitoring results. Link: https://lkml.kernel.org/r/20230913022050.2109-1-sj@kernel.org Link: https://lkml.kernel.org/r/20230913022050.2109-2-sj@kernel.org Signed-off-by: SeongJae Park Reviewed-by: Steven Rostedt (Google) [tracing] Cc: Jonathan Corbet Signed-off-by: Andrew Morton commit fa1df3f6287e1e1fd8b5309828238e2c728e985f Author: Kefeng Wang Date: Wed Sep 13 17:51:31 2023 +0800 mm: migrate: remove isolated variable in add_page_for_migration() Directly check the return of isolate_hugetlb() and folio_isolate_lru() to remove isolated variable, also setup err = -EBUSY in advance before isolation, and update err only when successfully queued for migration, which could help us to unify and simplify code a bit. Link: https://lkml.kernel.org/r/20230913095131.2426871-9-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: Zi Yan Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Signed-off-by: Andrew Morton commit b426ed7889be80359cb4edef142e5c5fa697b068 Author: Kefeng Wang Date: Wed Sep 13 17:51:30 2023 +0800 mm: migrate: remove PageHead() check for HugeTLB in add_page_for_migration() There is some different between hugeTLB and THP behave when passed the address of a tail page, for THP, it will migrate the entire THP page, but for HugeTLB, it will return -EACCES, or -ENOENT before commit e66f17ff7177 ("mm/hugetlb: take page table lock in follow_huge_pmd()"), -EACCES The page is mapped by multiple processes and can be moved only if MPOL_MF_MOVE_ALL is specified. -ENOENT The page is not present. But when check manual[1], both of the two errnos are not suitable, it is better to keep the same behave between hugetlb and THP when passed the address of a tail page, so let's just remove the PageHead() check for HugeTLB. [1] https://man7.org/linux/man-pages/man2/move_pages.2.html Link: https://lkml.kernel.org/r/20230913095131.2426871-8-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Suggested-by: Mike Kravetz Acked-by: Zi Yan Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit d64cfccbc805663a2c5691f638cf9198b9676a9f Author: Kefeng Wang Date: Wed Sep 13 17:51:29 2023 +0800 mm: migrate: use a folio in add_page_for_migration() Use a folio in add_page_for_migration() to save compound_head() calls. Link: https://lkml.kernel.org/r/20230913095131.2426871-7-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: Zi Yan Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 7e2a5e5ab217d5e4166cdbdf4af8c5e34b6200bb Author: Kefeng Wang Date: Wed Sep 13 17:51:28 2023 +0800 mm: migrate: use __folio_test_movable() Use __folio_test_movable(), no need to convert from folio to page again. Link: https://lkml.kernel.org/r/20230913095131.2426871-6-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand Reviewed-by: Zi Yan Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 73eab3ca481e5be0f1fd8140365d604482f84ee1 Author: Kefeng Wang Date: Wed Sep 13 17:51:27 2023 +0800 mm: migrate: convert migrate_misplaced_page() to migrate_misplaced_folio() At present, numa balance only support base page and PMD-mapped THP, but we will expand to support to migrate large folio/pte-mapped THP in the future, it is better to make migrate_misplaced_page() to take a folio instead of a page, and rename it to migrate_misplaced_folio(), it is a preparation, also this remove several compound_head() calls. Link: https://lkml.kernel.org/r/20230913095131.2426871-5-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: Zi Yan Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 2ac9e99f3b21b2864305fbfba4bae5913274c409 Author: Kefeng Wang Date: Wed Sep 13 17:51:26 2023 +0800 mm: migrate: convert numamigrate_isolate_page() to numamigrate_isolate_folio() Rename numamigrate_isolate_page() to numamigrate_isolate_folio(), then make it takes a folio and use folio API to save compound_head() calls. Link: https://lkml.kernel.org/r/20230913095131.2426871-4-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: Zi Yan Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 728be28fae8c838d52c91dce4867133798146357 Author: Kefeng Wang Date: Wed Sep 13 17:51:25 2023 +0800 mm: migrate: remove THP mapcount check in numamigrate_isolate_page() The check of THP mapped by multiple processes was introduced by commit 04fa5d6a6547 ("mm: migrate: check page_count of THP before migrating") and refactor by commit 340ef3902cf2 ("mm: numa: cleanup flow of transhuge page migration"), which is out of date, since migrate_misplaced_page() is now using the standard migrate_pages() for small pages and THPs, the reference count checking is in folio_migrate_mapping(), so let's remove the special check for THP. Link: https://lkml.kernel.org/r/20230913095131.2426871-3-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Suggested-by: Matthew Wilcox (Oracle) Reviewed-by: "Huang, Ying" Cc: David Hildenbrand Cc: Hugh Dickins Cc: Mike Kravetz Cc: Zi Yan Signed-off-by: Andrew Morton commit a8ac4a767dcd9d87d8229045904d9fe15ea5e0e8 Author: Kefeng Wang Date: Wed Sep 13 17:51:24 2023 +0800 mm: migrate: remove PageTransHuge check in numamigrate_isolate_page() Patch series "mm: migrate: more folio conversion and unification", v3. Convert more migrate functions to use a folio, it is also a preparation for large folio migration support when balancing numa. This patch (of 8): The assert VM_BUG_ON_PAGE(order && !PageTransHuge(page), page) is not very useful, 1) for a tail/base page, order = 0, for a head page, the order > 0 && PageTransHuge() is true 2) there is a PageCompound() check and only base page is handled in do_numa_page(), and do_huge_pmd_numa_page() only handle PMD-mapped THP 3) even though the page is a tail page, isolate_lru_page() will post a warning, and fail to isolate the page 4) if large folio/pte-mapped THP migration supported in the future, we could migrate the entire folio if numa fault on a tail page so just remove the check. Link: https://lkml.kernel.org/r/20230913095131.2426871-1-wangkefeng.wang@huawei.com Link: https://lkml.kernel.org/r/20230913095131.2426871-2-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Suggested-by: Matthew Wilcox (Oracle) Cc: David Hildenbrand Cc: Huang Ying Cc: Hugh Dickins Cc: Mike Kravetz Cc: Zi Yan Signed-off-by: Andrew Morton commit 09c550508a4b8f7844b197cc16877dd0f7c42d8f Author: David Hildenbrand Date: Wed Sep 13 14:51:13 2023 +0200 mm/rmap: pass folio to hugepage_add_anon_rmap() Let's pass a folio; we are always mapping the entire thing. Link: https://lkml.kernel.org/r/20230913125113.313322-7-david@redhat.com Signed-off-by: David Hildenbrand Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit 132b180f06a74ddfc526709928036db3b7a1cf6d Author: David Hildenbrand Date: Wed Sep 13 14:51:12 2023 +0200 mm/rmap: simplify PageAnonExclusive sanity checks when adding anon rmap Let's sanity-check PageAnonExclusive vs. mapcount in page_add_anon_rmap() and hugepage_add_anon_rmap() after setting PageAnonExclusive simply by re-reading the mapcounts. We can stop initializing the "first" variable in page_add_anon_rmap() and no longer need an atomic_inc_and_test() in hugepage_add_anon_rmap(). While at it, switch to VM_WARN_ON_FOLIO(). [david@redhat.com: update check for doubly-mapped page] Link: https://lkml.kernel.org/r/d8e5a093-2e22-c14b-7e64-6da280398d9f@redhat.com Link: https://lkml.kernel.org/r/20230913125113.313322-6-david@redhat.com Signed-off-by: David Hildenbrand Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit a1f34ee1de2c3a55bc2a6b9a38e1ecd2830dcc03 Author: David Hildenbrand Date: Wed Sep 13 14:51:11 2023 +0200 mm/rmap: warn on new PTE-mapped folios in page_add_anon_rmap() If swapin code would ever decide to not use order-0 pages and supply a PTE-mapped large folio, we will have to change how we call __folio_set_anon() -- eventually with exclusive=false and an adjusted address. For now, let's add a VM_WARN_ON_FOLIO() with a comment about the situation. Link: https://lkml.kernel.org/r/20230913125113.313322-5-david@redhat.com Signed-off-by: David Hildenbrand Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit c5c540034747dfe450f64d1151081a6080daa8f9 Author: David Hildenbrand Date: Wed Sep 13 14:51:10 2023 +0200 mm/rmap: move folio_test_anon() check out of __folio_set_anon() Let's handle it in the caller; no need for the "first" check based on the mapcount. We really only end up with !anon pages in page_add_anon_rmap() via do_swap_page(), where we hold the folio lock. So races are not possible. Add a VM_WARN_ON_FOLIO() to make sure that we really hold the folio lock. In the future, we might want to let do_swap_page() use folio_add_new_anon_rmap() on new pages instead: however, we might have to pass then whether the folio is exclusive or not. So keep it in there for now. For hugetlb we never expect to have a non-anon page in hugepage_add_anon_rmap(). Remove that code, along with some other checks that are either not required or were checked in hugepage_add_new_anon_rmap() already. Link: https://lkml.kernel.org/r/20230913125113.313322-4-david@redhat.com Signed-off-by: David Hildenbrand Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit c66db8c0702c0ab741ecfd5e12b323ff49fe9089 Author: David Hildenbrand Date: Wed Sep 13 14:51:09 2023 +0200 mm/rmap: move SetPageAnonExclusive out of __page_set_anon_rmap() Let's handle it in the caller. No need to pass the page. While at it, rename the function to __folio_set_anon() and pass "bool exclusive" instead of "int exclusive". Link: https://lkml.kernel.org/r/20230913125113.313322-3-david@redhat.com Signed-off-by: David Hildenbrand Cc: Matthew Wilcox Cc: Mike Kravetz Cc: Muchun Song Signed-off-by: Andrew Morton commit fd63908706f79c963946a77b7f352db5431deed5 Author: David Hildenbrand Date: Wed Sep 13 14:51:08 2023 +0200 mm/rmap: drop stale comment in page_add_anon_rmap and hugepage_add_anon_rmap() Patch series "Anon rmap cleanups". Some cleanups around rmap for anon pages. I'm working on more cleanups also around file rmap -- also to handle the "compound" parameter internally only and to let hugetlb use page_add_file_rmap(), but these changes make sense separately. This patch (of 6): That comment was added in commit 5dbe0af47f8a ("mm: fix kernel BUG at mm/rmap.c:1017!") to document why we can see vma->vm_end getting adjusted concurrently due to a VMA split. However, the optimized locking code was changed again in bf181b9f9d8 ("mm anon rmap: replace same_anon_vma linked list with an interval tree."). ... and later, the comment was changed in commit 0503ea8f5ba7 ("mm/mmap: remove __vma_adjust()") to talk about "vma_merge" although the original issue was with VMA splitting. Let's just remove that comment. Nowadays, it's outdated, imprecise and confusing. Link: https://lkml.kernel.org/r/20230913125113.313322-1-david@redhat.com Link: https://lkml.kernel.org/r/20230913125113.313322-2-david@redhat.com Signed-off-by: David Hildenbrand Cc: Mike Kravetz Cc: Muchun Song Cc: Matthew Wilcox Signed-off-by: Andrew Morton commit 811244a501b967b00fecb1ae906d5dc6329c91e0 Author: Xin Hao Date: Thu Sep 14 00:49:37 2023 +0800 mm: memcg: add THP swap out info for anonymous reclaim At present, we support per-memcg reclaim strategy, however we do not know the number of transparent huge pages being reclaimed, as we know the transparent huge pages need to be splited before reclaim them, and they will bring some performance bottleneck effect. for example, when two memcg (A & B) are doing reclaim for anonymous pages at same time, and 'A' memcg is reclaiming a large number of transparent huge pages, we can better analyze that the performance bottleneck will be caused by 'A' memcg. therefore, in order to better analyze such problems, there add THP swap out info for per-memcg. [akpm@linux-foundation.orgL fix swap_writepage_fs(), per Johannes] Link: https://lkml.kernel.org/r/20230913213343.GB48476@cmpxchg.org Link: https://lkml.kernel.org/r/20230913164938.16918-1-vernhao@tencent.com Signed-off-by: Xin Hao Suggested-by: Johannes Weiner Acked-by: Johannes Weiner Cc: Michal Hocko Cc: Roman Gushchin Cc: Shakeel Butt Cc: Muchun Song Signed-off-by: Andrew Morton commit ed547ab6f4041c2186df672029eb17f98f44d125 Author: liujinlong Date: Tue Sep 12 16:59:23 2023 +0800 mm: vmscan: modify an easily misunderstood function name When looking at the code in the memory part, I found that the purpose of the function prepare_scan_countis very different from the function name. It is easy to misunderstand when reading.The function prepare_scan_count mainly completes the assignment of the scan_control structure.Therefore, I suggest that the function name can be changed to prepare_scan_control, which is easier to understand. Link: https://lkml.kernel.org/r/20230912085923.27238-1-liujinlong@kylinos.cn Signed-off-by: liujinlong Signed-off-by: Andrew Morton commit 8a0e8bb112af28362514624fc46e20426b4bdf1f Author: Qi Zheng Date: Mon Sep 11 17:44:44 2023 +0800 mm: shrinker: convert shrinker_rwsem to mutex Now there are no readers of shrinker_rwsem, so we can simply replace it with mutex lock. [akpm@linux-foundation.org: update the fix to alloc_shrinker_info()] Link: https://lkml.kernel.org/r/20230911094444.68966-46-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 604b8b655020816b66ae474681d1100c5c0ba8c4 Author: Qi Zheng Date: Mon Sep 11 17:44:43 2023 +0800 mm: shrinker: hold write lock to reparent shrinker nr_deferred For now, reparent_shrinker_deferred() is the only holder of read lock of shrinker_rwsem. And it already holds the global cgroup_mutex, so it will not be called in parallel. Therefore, in order to convert shrinker_rwsem to shrinker_mutex later, here we change to hold the write lock of shrinker_rwsem to reparent. Link: https://lkml.kernel.org/r/20230911094444.68966-45-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 50d09da8e1199092a128eebd8a986d1fb0335fe4 Author: Qi Zheng Date: Mon Sep 11 17:44:42 2023 +0800 mm: shrinker: make memcg slab shrink lockless Like global slab shrink, this commit also uses refcount+RCU method to make memcg slab shrink lockless. Use the following script to do slab shrink stress test: ``` DIR="/root/shrinker/memcg/mnt" do_create() { mkdir -p /sys/fs/cgroup/memory/test echo 4G > /sys/fs/cgroup/memory/test/memory.limit_in_bytes for i in `seq 0 $1`; do mkdir -p /sys/fs/cgroup/memory/test/$i; echo $$ > /sys/fs/cgroup/memory/test/$i/cgroup.procs; mkdir -p $DIR/$i; done } do_mount() { for i in `seq $1 $2`; do mount -t tmpfs $i $DIR/$i; done } do_touch() { for i in `seq $1 $2`; do echo $$ > /sys/fs/cgroup/memory/test/$i/cgroup.procs; dd if=/dev/zero of=$DIR/$i/file$i bs=1M count=1 & done } case "$1" in touch) do_touch $2 $3 ;; test) do_create 4000 do_mount 0 4000 do_touch 0 3000 ;; *) exit 1 ;; esac ``` Save the above script, then run test and touch commands. Then we can use the following perf command to view hotspots: perf top -U -F 999 1) Before applying this patchset: 33.15% [kernel] [k] down_read_trylock 25.38% [kernel] [k] shrink_slab 21.75% [kernel] [k] up_read 4.45% [kernel] [k] _find_next_bit 2.27% [kernel] [k] do_shrink_slab 1.80% [kernel] [k] intel_idle_irq 1.79% [kernel] [k] shrink_lruvec 0.67% [kernel] [k] xas_descend 0.41% [kernel] [k] mem_cgroup_iter 0.40% [kernel] [k] shrink_node 0.38% [kernel] [k] list_lru_count_one 2) After applying this patchset: 64.56% [kernel] [k] shrink_slab 12.18% [kernel] [k] do_shrink_slab 3.30% [kernel] [k] __rcu_read_unlock 2.61% [kernel] [k] shrink_lruvec 2.49% [kernel] [k] __rcu_read_lock 1.93% [kernel] [k] intel_idle_irq 0.89% [kernel] [k] shrink_node 0.81% [kernel] [k] mem_cgroup_iter 0.77% [kernel] [k] mem_cgroup_calculate_protection 0.66% [kernel] [k] list_lru_count_one We can see that the first perf hotspot becomes shrink_slab, which is what we expect. Link: https://lkml.kernel.org/r/20230911094444.68966-44-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit ca1d36b823944f24b5755311e95883fb5fdb807b Author: Qi Zheng Date: Mon Sep 11 17:44:41 2023 +0800 mm: shrinker: make global slab shrink lockless The shrinker_rwsem is a global read-write lock in shrinkers subsystem, which protects most operations such as slab shrink, registration and unregistration of shrinkers, etc. This can easily cause problems in the following cases. 1) When the memory pressure is high and there are many filesystems mounted or unmounted at the same time, slab shrink will be affected (down_read_trylock() failed). Such as the real workload mentioned by Kirill Tkhai: ``` One of the real workloads from my experience is start of an overcommitted node containing many starting containers after node crash (or many resuming containers after reboot for kernel update). In these cases memory pressure is huge, and the node goes round in long reclaim. ``` 2) If a shrinker is blocked (such as the case mentioned in [1]) and a writer comes in (such as mount a fs), then this writer will be blocked and cause all subsequent shrinker-related operations to be blocked. Even if there is no competitor when shrinking slab, there may still be a problem. The down_read_trylock() may become a perf hotspot with frequent calls to shrink_slab(). Because of the poor multicore scalability of atomic operations, this can lead to a significant drop in IPC (instructions per cycle). We used to implement the lockless slab shrink with SRCU [2], but then kernel test robot reported -88.8% regression in stress-ng.ramfs.ops_per_sec test case [3], so we reverted it [4]. This commit uses the refcount+RCU method [5] proposed by Dave Chinner to re-implement the lockless global slab shrink. The memcg slab shrink is handled in the subsequent patch. For now, all shrinker instances are converted to dynamically allocated and will be freed by call_rcu(). So we can use rcu_read_{lock,unlock}() to ensure that the shrinker instance is valid. And the shrinker instance will not be run again after unregistration. So the structure that records the pointer of shrinker instance can be safely freed without waiting for the RCU read-side critical section. In this way, while we implement the lockless slab shrink, we don't need to be blocked in unregister_shrinker(). The following are the test results: stress-ng --timeout 60 --times --verify --metrics-brief --ramfs 9 & 1) Before applying this patchset: setting to a 60 second run per stressor dispatching hogs: 9 ramfs stressor bogo ops real time usr time sys time bogo ops/s bogo ops/s (secs) (secs) (secs) (real time) (usr+sys time) ramfs 473062 60.00 8.00 279.13 7884.12 1647.59 for a 60.01s run time: 1440.34s available CPU time 7.99s user time ( 0.55%) 279.13s system time ( 19.38%) 287.12s total time ( 19.93%) load average: 7.12 2.99 1.15 successful run completed in 60.01s (1 min, 0.01 secs) 2) After applying this patchset: setting to a 60 second run per stressor dispatching hogs: 9 ramfs stressor bogo ops real time usr time sys time bogo ops/s bogo ops/s (secs) (secs) (secs) (real time) (usr+sys time) ramfs 477165 60.00 8.13 281.34 7952.55 1648.40 for a 60.01s run time: 1440.33s available CPU time 8.12s user time ( 0.56%) 281.34s system time ( 19.53%) 289.46s total time ( 20.10%) load average: 6.98 3.03 1.19 successful run completed in 60.01s (1 min, 0.01 secs) We can see that the ops/s has hardly changed. [1]. https://lore.kernel.org/lkml/20191129214541.3110-1-ptikhomirov@virtuozzo.com/ [2]. https://lore.kernel.org/lkml/20230313112819.38938-1-zhengqi.arch@bytedance.com/ [3]. https://lore.kernel.org/lkml/202305230837.db2c233f-yujie.liu@intel.com/ [4]. https://lore.kernel.org/all/20230609081518.3039120-1-qi.zheng@linux.dev/ [5]. https://lore.kernel.org/lkml/ZIJhou1d55d4H1s0@dread.disaster.area/ Link: https://lkml.kernel.org/r/20230911094444.68966-43-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 48a7a0996a0089f4161ad437a810a10596e8d278 Author: Qi Zheng Date: Mon Sep 11 17:44:40 2023 +0800 mm: shrinker: rename {prealloc|unregister}_memcg_shrinker() to shrinker_memcg_{alloc|remove}() With the new shrinker APIs, there is no action such as prealloc, so rename {prealloc|unregister}_memcg_shrinker() to shrinker_memcg_{alloc|remove}(), which corresponds to the idr_{alloc|remove}() inside the function. Link: https://lkml.kernel.org/r/20230911094444.68966-42-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 307bececcd1205bcb67a3c0d53a69db237ccc9d4 Author: Qi Zheng Date: Mon Sep 11 17:44:39 2023 +0800 mm: shrinker: add a secondary array for shrinker_info::{map, nr_deferred} Currently, we maintain two linear arrays per node per memcg, which are shrinker_info::map and shrinker_info::nr_deferred. And we need to resize them when the shrinker_nr_max is exceeded, that is, allocate a new array, and then copy the old array to the new array, and finally free the old array by RCU. For shrinker_info::map, we do set_bit() under the RCU lock, so we may set the value into the old map which is about to be freed. This may cause the value set to be lost. The current solution is not to copy the old map when resizing, but to set all the corresponding bits in the new map to 1. This solves the data loss problem, but bring the overhead of more pointless loops while doing memcg slab shrink. For shrinker_info::nr_deferred, we will only modify it under the read lock of shrinker_rwsem, so it will not run concurrently with the resizing. But after we make memcg slab shrink lockless, there will be the same data loss problem as shrinker_info::map, and we can't work around it like the map. For such resizable arrays, the most straightforward idea is to change it to xarray, like we did for list_lru [1]. We need to do xa_store() in the list_lru_add()-->set_shrinker_bit(), but this will cause memory allocation, and the list_lru_add() doesn't accept failure. A possible solution is to pre-allocate, but the location of pre-allocation is not well determined (such as deferred_split_shrinker case). Therefore, this commit chooses to introduce the following secondary array for shrinker_info::{map, nr_deferred}: +---------------+--------+--------+-----+ | shrinker_info | unit 0 | unit 1 | ... | (secondary array) +---------------+--------+--------+-----+ | v +---------------+-----+ | nr_deferred[] | map | (leaf array) +---------------+-----+ (shrinker_info_unit) The leaf array is never freed unless the memcg is destroyed. The secondary array will be resized every time the shrinker id exceeds shrinker_nr_max. So the shrinker_info_unit can be indexed from both the old and the new shrinker_info->unit[x]. Then even if we get the old secondary array under the RCU lock, the found map and nr_deferred are also true, so the updated nr_deferred and map will not be lost. [1]. https://lore.kernel.org/all/20220228122126.37293-13-songmuchun@bytedance.com/ [zhengqi.arch@bytedance.com: unlock the &shrinker_rwsem before the call to free_shrinker_info()] Link: https://lkml.kernel.org/r/20230928141517.12164-1-zhengqi.arch@bytedance.com Link: https://lkml.kernel.org/r/20230911094444.68966-41-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit f2383e01507eeee8a1c1283d61a117a97d6c4ebe Author: Qi Zheng Date: Mon Sep 11 17:44:38 2023 +0800 mm: shrinker: remove old APIs Now no users are using the old APIs, just remove them. Link: https://lkml.kernel.org/r/20230911094444.68966-40-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 1720f5dd8d3af34d6023fb9e8c35e5e60e8b6643 Author: Qi Zheng Date: Mon Sep 11 17:44:37 2023 +0800 fs: super: dynamically allocate the s_shrink In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the s_shrink, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct super_block. Link: https://lkml.kernel.org/r/20230911094444.68966-39-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Acked-by: David Sterba Cc: Chris Mason Cc: Josef Bacik Cc: Alexander Viro Cc: Christian Brauner Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit c19b548b493455cfb80895074687152869e77742 Author: Qi Zheng Date: Mon Sep 11 17:44:36 2023 +0800 zsmalloc: dynamically allocate the mm-zspool shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the mm-zspool shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct zs_pool. Link: https://lkml.kernel.org/r/20230911094444.68966-38-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Reviewed-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit fe88527852be8a6f1391c961db38d342cc46461d Author: Qi Zheng Date: Mon Sep 11 17:44:35 2023 +0800 xfs: dynamically allocate the xfs-qm shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the xfs-qm shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct xfs_quotainfo. Link: https://lkml.kernel.org/r/20230911094444.68966-37-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Chandan Babu R Cc: "Darrick J. Wong" Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 1a86a53da46778a583cd866465e18d662d866f30 Author: Qi Zheng Date: Mon Sep 11 17:44:34 2023 +0800 xfs: dynamically allocate the xfs-inodegc shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the xfs-inodegc shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct xfs_mount. Link: https://lkml.kernel.org/r/20230911094444.68966-36-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Chandan Babu R Cc: "Darrick J. Wong" Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 17e7a00e60c8fff31082d5216b5c7d06d156f972 Author: Qi Zheng Date: Mon Sep 11 17:44:33 2023 +0800 xfs: dynamically allocate the xfs-buf shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the xfs-buf shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct xfs_buftarg. Link: https://lkml.kernel.org/r/20230911094444.68966-35-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Chandan Babu R Cc: "Darrick J. Wong" Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 8eea99a81c6f67c08fedd7db2ccd09aa93db69a7 Author: Qi Zheng Date: Mon Sep 11 17:44:32 2023 +0800 nfsd: dynamically allocate the nfsd-reply shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the nfsd-reply shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct nfsd_net. Link: https://lkml.kernel.org/r/20230911094444.68966-34-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Acked-by: Chuck Lever Acked-by: Jeff Layton Acked-by: Muchun Song Cc: Neil Brown Cc: Olga Kornievskaia Cc: Dai Ngo Cc: Tom Talpey Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Nadav Amit Cc: Oleksandr Tyshchenko Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit d17452aa33a6fd0e9cf2bd3d43237f2d2c294a7e Author: Qi Zheng Date: Mon Sep 11 17:44:31 2023 +0800 nfsd: dynamically allocate the nfsd-client shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the nfsd-client shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct nfsd_net. Link: https://lkml.kernel.org/r/20230911094444.68966-33-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Acked-by: Chuck Lever Acked-by: Jeff Layton Cc: Jeff Layton Cc: Olga Kornievskaia Cc: Dai Ngo Cc: Tom Talpey Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 4b403dfa8ea8dfbc9d317b25a0433c1ac6765f7f Author: Qi Zheng Date: Mon Sep 11 17:44:30 2023 +0800 jbd2,ext4: dynamically allocate the jbd2-journal shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the jbd2-journal shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct journal_s. Link: https://lkml.kernel.org/r/20230911094444.68966-32-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Acked-by: Jan Kara Cc: "Theodore Ts'o" Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 4d09d75d8b8cb3c8087b46585924777bc8737663 Author: Qi Zheng Date: Mon Sep 11 17:44:29 2023 +0800 ext4: dynamically allocate the ext4-es shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the ext4-es shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct ext4_sb_info. Link: https://lkml.kernel.org/r/20230911094444.68966-31-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: "Theodore Ts'o" Cc: Andreas Dilger Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 714e5bde00a58ba13b03b68547931e011f93de58 Author: Qi Zheng Date: Mon Sep 11 17:44:28 2023 +0800 mbcache: dynamically allocate the mbcache shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the mbcache shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct mb_cache. Link: https://lkml.kernel.org/r/20230911094444.68966-30-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Alexander Viro Cc: Christian Brauner Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 0fbb99698b165444e3cf5421f96de01d9d56baf4 Author: Qi Zheng Date: Mon Sep 11 17:44:27 2023 +0800 virtio_balloon: dynamically allocate the virtio-balloon shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the virtio-balloon shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct virtio_balloon. Link: https://lkml.kernel.org/r/20230911094444.68966-29-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: "Michael S. Tsirkin" Cc: David Hildenbrand Cc: Jason Wang Cc: Xuan Zhuo Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Yue Hu Signed-off-by: Andrew Morton commit 17c4eb036a37f079ce2857be5914f839623b4eb2 Author: Qi Zheng Date: Mon Sep 11 17:44:26 2023 +0800 vmw_balloon: dynamically allocate the vmw-balloon shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the vmw-balloon shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct vmballoon. And we can simply exit vmballoon_init() when registering the shrinker fails. So the shrinker_registered indication is redundant, just remove it. Link: https://lkml.kernel.org/r/20230911094444.68966-28-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Acked-by: Nadav Amit Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit a6a1eb6214cf7adfd1e2da33d819df17fe8a64d7 Author: Qi Zheng Date: Mon Sep 11 17:44:25 2023 +0800 bcache: dynamically allocate the md-bcache shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the md-bcache shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct cache_set. Link: https://lkml.kernel.org/r/20230911094444.68966-27-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Acked-by: Muchun Song Cc: Coly Li Cc: Kent Overstreet Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 86298d8b8ceacc17d0192cd6412d2773ff51b27f Author: Qi Zheng Date: Mon Sep 11 17:44:24 2023 +0800 md/raid5: dynamically allocate the md-raid5 shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the md-raid5 shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct r5conf. Link: https://lkml.kernel.org/r/20230911094444.68966-26-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Reviewed-by: Song Liu Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit ba3d6acafd26416c3001adb4cc3cedcd6a419c73 Author: Qi Zheng Date: Mon Sep 11 17:44:23 2023 +0800 dm zoned: dynamically allocate the dm-zoned-meta shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the dm-zoned-meta shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct dmz_metadata. Link: https://lkml.kernel.org/r/20230911094444.68966-25-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Abhinav Kumar Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 1f1d459c9a2f0c8618b137fe845c09e405ae59fc Author: Qi Zheng Date: Mon Sep 11 17:44:22 2023 +0800 dm: dynamically allocate the dm-bufio shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the dm-bufio shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct dm_bufio_client. Link: https://lkml.kernel.org/r/20230911094444.68966-24-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Abhinav Kumar Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit e11c4f3acbbb776992425867df894b8c0f131f50 Author: Qi Zheng Date: Mon Sep 11 17:44:21 2023 +0800 drm/panfrost: dynamically allocate the drm-panfrost shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the drm-panfrost shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct panfrost_device. Link: https://lkml.kernel.org/r/20230911094444.68966-23-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Steven Price Acked-by: Daniel Vetter Cc: Rob Herring Cc: Tomeu Vizoso Cc: Alyssa Rosenzweig Cc: David Airlie Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit cd61a76c210afd324c345ff62d950e2ff7947f11 Author: Qi Zheng Date: Mon Sep 11 17:44:20 2023 +0800 drm/msm: dynamically allocate the drm-msm_gem shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the drm-msm_gem shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct msm_drm_private. Link: https://lkml.kernel.org/r/20230911094444.68966-22-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Acked-by: Daniel Vetter Cc: Rob Clark Cc: Abhinav Kumar Cc: Dmitry Baryshkov Cc: Sean Paul Cc: Marijn Suijten Cc: David Airlie Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Hildenbrand Cc: David Sterba Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 583cc9e41095292e2ebf33c977d8ba1e64308892 Author: Qi Zheng Date: Mon Sep 11 17:44:19 2023 +0800 drm/i915: dynamically allocate the i915_gem_mm shrinker In preparation for implementing lockless slab shrink, use new APIs to dynamically allocate the i915_gem_mm shrinker, so that it can be freed asynchronously via RCU. Then it doesn't need to wait for RCU read-side critical section when releasing the struct drm_i915_private. Link: https://lkml.kernel.org/r/20230911094444.68966-21-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Acked-by: Daniel Vetter Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: David Airlie Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 219c666eb2854bb9ca94d04a53ceb14aaf81cb28 Author: Qi Zheng Date: Mon Sep 11 17:44:18 2023 +0800 mm: workingset: dynamically allocate the mm-shadow shrinker Use new APIs to dynamically allocate the mm-shadow shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-20-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Acked-by: Muchun Song Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit abe0c269f9820c637223ad88d77d174e8d85c58f Author: Qi Zheng Date: Mon Sep 11 17:44:17 2023 +0800 sunrpc: dynamically allocate the sunrpc_cred shrinker Use new APIs to dynamically allocate the sunrpc_cred shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-19-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Jeff Layton Cc: Neil Brown Cc: Olga Kornievskaia Cc: Dai Ngo Cc: Tom Talpey Cc: Trond Myklebust Cc: Anna Schumaker Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Oleksandr Tyshchenko Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 54d917295b8366545e6ee940c93dffe1452e6480 Author: Qi Zheng Date: Mon Sep 11 17:44:16 2023 +0800 mm: thp: dynamically allocate the thp-related shrinkers Use new APIs to dynamically allocate the thp-zero and thp-deferred_split shrinkers. Link: https://lkml.kernel.org/r/20230911094444.68966-18-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 21e0b932fb5d72bb6cefdf56e22bfddea968cf32 Author: Qi Zheng Date: Mon Sep 11 17:44:15 2023 +0800 rcu: dynamically allocate the rcu-kfree shrinker Use new APIs to dynamically allocate the rcu-kfree shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-17-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Joel Fernandes (Google) Reviewed-by: Muchun Song Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 2fbacff0cbf58530fa459c3f28ba9125df33ad86 Author: Qi Zheng Date: Mon Sep 11 17:44:14 2023 +0800 rcu: dynamically allocate the rcu-lazy shrinker Use new APIs to dynamically allocate the rcu-lazy shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-16-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Joel Fernandes (Google) Acked-by: Muchun Song Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 827a34f90e5a27b83f188b914512d81e36688dec Author: Qi Zheng Date: Mon Sep 11 17:44:13 2023 +0800 ubifs: dynamically allocate the ubifs-slab shrinker Use new APIs to dynamically allocate the ubifs-slab shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-15-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Richard Weinberger Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit eab477e883b52a82bd7b4437111bbc6264694349 Author: Qi Zheng Date: Mon Sep 11 17:44:12 2023 +0800 quota: dynamically allocate the dquota-cache shrinker Use new APIs to dynamically allocate the dquota-cache shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-14-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Acked-by: Jan Kara Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 856e594965414a1cc63d0f3e709ecb6869bc685e Author: Qi Zheng Date: Mon Sep 11 17:44:11 2023 +0800 nfsd: dynamically allocate the nfsd-filecache shrinker Use new APIs to dynamically allocate the nfsd-filecache shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-13-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Jeff Layton Cc: Neil Brown Cc: Olga Kornievskaia Cc: Dai Ngo Cc: Tom Talpey Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Oleksandr Tyshchenko Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 777fc8f1b4b9a0c5a558f1ab49ddfa5137bfaeb3 Author: Qi Zheng Date: Mon Sep 11 17:44:10 2023 +0800 nfs: dynamically allocate the nfs-acl shrinker Use new APIs to dynamically allocate the nfs-acl shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-12-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Trond Myklebust Cc: Anna Schumaker Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit d5dad4929fb42e7f610cda5e1ea51cd76be998d4 Author: Qi Zheng Date: Mon Sep 11 17:44:09 2023 +0800 NFSv4.2: dynamically allocate the nfs-xattr shrinkers Use new APIs to dynamically allocate the nfs-xattr shrinkers. Link: https://lkml.kernel.org/r/20230911094444.68966-11-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Trond Myklebust Cc: Anna Schumaker Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 8ee0fd9c1085d952ea62c1879620eaa01e4c6332 Author: Qi Zheng Date: Mon Sep 11 17:44:08 2023 +0800 gfs2: dynamically allocate the gfs2-qd shrinker Use new APIs to dynamically allocate the gfs2-qd shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-10-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Bob Peterson Cc: Andreas Gruenbacher Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit a304c23cd6c96ecdf5f96df66e809993d5e96bf0 Author: Qi Zheng Date: Mon Sep 11 17:44:07 2023 +0800 gfs2: dynamically allocate the gfs2-glock shrinker Use new APIs to dynamically allocate the gfs2-glock shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-9-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Bob Peterson Cc: Andreas Gruenbacher Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit bfcba5ba39cbce8957b4908c9dd570dd6097fff3 Author: Qi Zheng Date: Mon Sep 11 17:44:06 2023 +0800 f2fs: dynamically allocate the f2fs-shrinker Use new APIs to dynamically allocate the f2fs-shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-8-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Reviewed-by: Chao Yu Cc: Jaegeuk Kim Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 557936ee8dc6bd0d5e078f415441d9f2a3fcca23 Author: Qi Zheng Date: Mon Sep 11 17:44:05 2023 +0800 erofs: dynamically allocate the erofs-shrinker Use new APIs to dynamically allocate the erofs-shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-7-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Reviewed-by: Chao Yu Reviewed-by: Gao Xiang Cc: Yue Hu Cc: Jeffle Xu Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Signed-off-by: Andrew Morton commit 1ec016bfa10f2873c125018c4efcf09c141645ff Author: Qi Zheng Date: Mon Sep 11 17:44:04 2023 +0800 xenbus/backend: dynamically allocate the xen-backend shrinker Use new APIs to dynamically allocate the xen-backend shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-6-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Acked-by: Juergen Gross Cc: Stefano Stabellini Cc: Oleksandr Tyshchenko Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit d35b5c98c1f1ea44d4652a78163ce6d0e6ec2b78 Author: Qi Zheng Date: Mon Sep 11 17:44:03 2023 +0800 drm/ttm: dynamically allocate the drm-ttm_pool shrinker Use new APIs to dynamically allocate the drm-ttm_pool shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-5-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Acked-by: Daniel Vetter Cc: Christian Koenig Cc: Huang Rui Cc: David Airlie Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 95a542da5322ef2db193a546d2d888cf4dbaa219 Author: Qi Zheng Date: Mon Sep 11 17:44:02 2023 +0800 binder: dynamically allocate the android-binder shrinker Use new APIs to dynamically allocate the android-binder shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-4-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Acked-by: Carlos Llamas Cc: Greg Kroah-Hartman Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit e5985c40987640717e3985e2ae02bf707c12f74a Author: Qi Zheng Date: Mon Sep 11 17:44:01 2023 +0800 kvm: mmu: dynamically allocate the x86-mmu shrinker Use new APIs to dynamically allocate the x86-mmu shrinker. Link: https://lkml.kernel.org/r/20230911094444.68966-3-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Brauner Cc: Christian Koenig Cc: Chuck Lever Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Greg Kroah-Hartman Cc: Huang Rui Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Kirill Tkhai Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Paul E. McKenney Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Roman Gushchin Cc: Sean Paul Cc: Sergey Senozhatsky Cc: Song Liu Cc: Stefano Stabellini Cc: Steven Price Cc: "Theodore Ts'o" Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Vlastimil Babka Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit c42d50aefd17a6bad3ed617769edbbb579137545 Author: Qi Zheng Date: Mon Sep 11 17:44:00 2023 +0800 mm: shrinker: add infrastructure for dynamically allocating shrinker Patch series "use refcount+RCU method to implement lockless slab shrink", v6. 1. Background ============= We used to implement the lockless slab shrink with SRCU [1], but then kernel test robot reported -88.8% regression in stress-ng.ramfs.ops_per_sec test case [2], so we reverted it [3]. This patch series aims to re-implement the lockless slab shrink using the refcount+RCU method proposed by Dave Chinner [4]. [1]. https://lore.kernel.org/lkml/20230313112819.38938-1-zhengqi.arch@bytedance.com/ [2]. https://lore.kernel.org/lkml/202305230837.db2c233f-yujie.liu@intel.com/ [3]. https://lore.kernel.org/all/20230609081518.3039120-1-qi.zheng@linux.dev/ [4]. https://lore.kernel.org/lkml/ZIJhou1d55d4H1s0@dread.disaster.area/ 2. Implementation ================= Currently, the shrinker instances can be divided into the following three types: a) global shrinker instance statically defined in the kernel, such as workingset_shadow_shrinker. b) global shrinker instance statically defined in the kernel modules, such as mmu_shrinker in x86. c) shrinker instance embedded in other structures. For case a, the memory of shrinker instance is never freed. For case b, the memory of shrinker instance will be freed after synchronize_rcu() when the module is unloaded. For case c, the memory of shrinker instance will be freed along with the structure it is embedded in. In preparation for implementing lockless slab shrink, we need to dynamically allocate those shrinker instances in case c, then the memory can be dynamically freed alone by calling kfree_rcu(). This patchset adds the following new APIs for dynamically allocating shrinker, and add a private_data field to struct shrinker to record and get the original embedded structure. 1. shrinker_alloc() 2. shrinker_register() 3. shrinker_free() In order to simplify shrinker-related APIs and make shrinker more independent of other kernel mechanisms, this patchset uses the above APIs to convert all shrinkers (including case a and b) to dynamically allocated, and then remove all existing APIs. This will also have another advantage mentioned by Dave Chinner: ``` The other advantage of this is that it will break all the existing out of tree code and third party modules using the old API and will no longer work with a kernel using lockless slab shrinkers. They need to break (both at the source and binary levels) to stop bad things from happening due to using uncoverted shrinkers in the new setup. ``` Then we free the shrinker by calling call_rcu(), and use rcu_read_{lock,unlock}() to ensure that the shrinker instance is valid. And the shrinker::refcount mechanism ensures that the shrinker instance will not be run again after unregistration. So the structure that records the pointer of shrinker instance can be safely freed without waiting for the RCU read-side critical section. In this way, while we implement the lockless slab shrink, we don't need to be blocked in unregister_shrinker() to wait RCU read-side critical section. PATCH 1: introduce new APIs PATCH 2~38: convert all shrinnkers to use new APIs PATCH 39: remove old APIs PATCH 40~41: some cleanups and preparations PATCH 42-43: implement the lockless slab shrink PATCH 44~45: convert shrinker_rwsem to mutex 3. Testing ========== 3.1 slab shrink stress test --------------------------- We can reproduce the down_read_trylock() hotspot through the following script: ``` DIR="/root/shrinker/memcg/mnt" do_create() { mkdir -p /sys/fs/cgroup/memory/test echo 4G > /sys/fs/cgroup/memory/test/memory.limit_in_bytes for i in `seq 0 $1`; do mkdir -p /sys/fs/cgroup/memory/test/$i; echo $$ > /sys/fs/cgroup/memory/test/$i/cgroup.procs; mkdir -p $DIR/$i; done } do_mount() { for i in `seq $1 $2`; do mount -t tmpfs $i $DIR/$i; done } do_touch() { for i in `seq $1 $2`; do echo $$ > /sys/fs/cgroup/memory/test/$i/cgroup.procs; dd if=/dev/zero of=$DIR/$i/file$i bs=1M count=1 & done } case "$1" in touch) do_touch $2 $3 ;; test) do_create 4000 do_mount 0 4000 do_touch 0 3000 ;; *) exit 1 ;; esac ``` Save the above script, then run test and touch commands. Then we can use the following perf command to view hotspots: perf top -U -F 999 1) Before applying this patchset: 33.15% [kernel] [k] down_read_trylock 25.38% [kernel] [k] shrink_slab 21.75% [kernel] [k] up_read 4.45% [kernel] [k] _find_next_bit 2.27% [kernel] [k] do_shrink_slab 1.80% [kernel] [k] intel_idle_irq 1.79% [kernel] [k] shrink_lruvec 0.67% [kernel] [k] xas_descend 0.41% [kernel] [k] mem_cgroup_iter 0.40% [kernel] [k] shrink_node 0.38% [kernel] [k] list_lru_count_one 2) After applying this patchset: 64.56% [kernel] [k] shrink_slab 12.18% [kernel] [k] do_shrink_slab 3.30% [kernel] [k] __rcu_read_unlock 2.61% [kernel] [k] shrink_lruvec 2.49% [kernel] [k] __rcu_read_lock 1.93% [kernel] [k] intel_idle_irq 0.89% [kernel] [k] shrink_node 0.81% [kernel] [k] mem_cgroup_iter 0.77% [kernel] [k] mem_cgroup_calculate_protection 0.66% [kernel] [k] list_lru_count_one We can see that the first perf hotspot becomes shrink_slab, which is what we expect. 3.2 registration and unregistration stress test ----------------------------------------------- Run the command below to test: stress-ng --timeout 60 --times --verify --metrics-brief --ramfs 9 & 1) Before applying this patchset: setting to a 60 second run per stressor dispatching hogs: 9 ramfs stressor bogo ops real time usr time sys time bogo ops/s bogo ops/s (secs) (secs) (secs) (real time) (usr+sys time) ramfs 473062 60.00 8.00 279.13 7884.12 1647.59 for a 60.01s run time: 1440.34s available CPU time 7.99s user time ( 0.55%) 279.13s system time ( 19.38%) 287.12s total time ( 19.93%) load average: 7.12 2.99 1.15 successful run completed in 60.01s (1 min, 0.01 secs) 2) After applying this patchset: setting to a 60 second run per stressor dispatching hogs: 9 ramfs stressor bogo ops real time usr time sys time bogo ops/s bogo ops/s (secs) (secs) (secs) (real time) (usr+sys time) ramfs 477165 60.00 8.13 281.34 7952.55 1648.40 for a 60.01s run time: 1440.33s available CPU time 8.12s user time ( 0.56%) 281.34s system time ( 19.53%) 289.46s total time ( 20.10%) load average: 6.98 3.03 1.19 successful run completed in 60.01s (1 min, 0.01 secs) We can see that the ops/s has hardly changed. This patch (of 45): Currently, the shrinker instances can be divided into the following three types: a) global shrinker instance statically defined in the kernel, such as workingset_shadow_shrinker. b) global shrinker instance statically defined in the kernel modules, such as mmu_shrinker in x86. c) shrinker instance embedded in other structures. For case a, the memory of shrinker instance is never freed. For case b, the memory of shrinker instance will be freed after synchronize_rcu() when the module is unloaded. For case c, the memory of shrinker instance will be freed along with the structure it is embedded in. In preparation for implementing lockless slab shrink, we need to dynamically allocate those shrinker instances in case c, then the memory can be dynamically freed alone by calling kfree_rcu(). So this commit adds the following new APIs for dynamically allocating shrinker, and add a private_data field to struct shrinker to record and get the original embedded structure. 1. shrinker_alloc() Used to allocate shrinker instance itself and related memory, it will return a pointer to the shrinker instance on success and NULL on failure. 2. shrinker_register() Used to register the shrinker instance, which is same as the current register_shrinker_prepared(). 3. shrinker_free() Used to unregister (if needed) and free the shrinker instance. In order to simplify shrinker-related APIs and make shrinker more independent of other kernel mechanisms, subsequent submissions will use the above API to convert all shrinkers (including case a and b) to dynamically allocated, and then remove all existing APIs. This will also have another advantage mentioned by Dave Chinner: ``` The other advantage of this is that it will break all the existing out of tree code and third party modules using the old API and will no longer work with a kernel using lockless slab shrinkers. They need to break (both at the source and binary levels) to stop bad things from happening due to using unconverted shrinkers in the new setup. ``` [zhengqi.arch@bytedance.com: mm: shrinker: some cleanup] Link: https://lkml.kernel.org/r/20230919024607.65463-1-zhengqi.arch@bytedance.com Link: https://lkml.kernel.org/r/20230911094444.68966-1-zhengqi.arch@bytedance.com Link: https://lkml.kernel.org/r/20230911094444.68966-2-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Christian Brauner Cc: Chuck Lever Cc: Darrick J. Wong Cc: Dave Chinner Cc: Greg Kroah-Hartman Cc: Kirill Tkhai Cc: Paul E. McKenney Cc: Roman Gushchin Cc: Sergey Senozhatsky Cc: Steven Price Cc: Theodore Ts'o Cc: Vlastimil Babka Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Christian Koenig Cc: Coly Li Cc: Dai Ngo Cc: Daniel Vetter Cc: Daniel Vetter Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joel Fernandes (Google) Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Sean Paul Cc: Song Liu Cc: Stefano Stabellini Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 0b2f5ea1aa39c0ed34bdadb53faf519e3d84ac4a Author: Qi Zheng Date: Mon Sep 11 17:25:17 2023 +0800 drm/ttm: introduce pool_shrink_rwsem Currently, synchronize_shrinkers() is only used by TTM pool. It only requires that no shrinkers run in parallel. After we use RCU+refcount method to implement the lockless slab shrink, we can not use shrinker_rwsem or synchronize_rcu() to guarantee that all shrinker invocations have seen an update before freeing memory. So we introduce a new pool_shrink_rwsem to implement a private ttm_pool_synchronize_shrinkers(), so as to achieve the same purpose. Link: https://lkml.kernel.org/r/20230911092517.64141-5-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Reviewed-by: Christian König Acked-by: Daniel Vetter Cc: Christian Brauner Cc: Chuck Lever Cc: Daniel Vetter Cc: Darrick J. Wong Cc: Dave Chinner Cc: Greg Kroah-Hartman Cc: Joel Fernandes Cc: Kirill Tkhai Cc: Paul E. McKenney Cc: Roman Gushchin Cc: Sergey Senozhatsky Cc: Steven Price Cc: Theodore Ts'o Cc: Vlastimil Babka Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Coly Li Cc: Dai Ngo Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Sean Paul Cc: Song Liu Cc: Stefano Stabellini Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 1dd49e58f966b1eecd935dc28458a8369ae94ad1 Author: Qi Zheng Date: Mon Sep 11 17:25:16 2023 +0800 mm: shrinker: remove redundant shrinker_rwsem in debugfs operations debugfs_remove_recursive() will wait for debugfs_file_put() to return, so the shrinker will not be freed when doing debugfs operations (such as shrinker_debugfs_count_show() and shrinker_debugfs_scan_write()), so there is no need to hold shrinker_rwsem during debugfs operations. Link: https://lkml.kernel.org/r/20230911092517.64141-4-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Christian Brauner Cc: Christian König Cc: Chuck Lever Cc: Daniel Vetter Cc: Daniel Vetter Cc: Darrick J. Wong Cc: Dave Chinner Cc: Greg Kroah-Hartman Cc: Joel Fernandes Cc: Kirill Tkhai Cc: Paul E. McKenney Cc: Roman Gushchin Cc: Sergey Senozhatsky Cc: Steven Price Cc: Theodore Ts'o Cc: Vlastimil Babka Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Coly Li Cc: Dai Ngo Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Sean Paul Cc: Song Liu Cc: Stefano Stabellini Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 96f7b2b9bbb1d680fab1fa96a3958b2d759b881f Author: Qi Zheng Date: Mon Sep 11 17:25:15 2023 +0800 mm: vmscan: move shrinker-related code into a separate file The mm/vmscan.c file is too large, so separate the shrinker-related code from it into a separate file. No functional changes. Link: https://lkml.kernel.org/r/20230911092517.64141-3-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Christian Brauner Cc: Christian König Cc: Chuck Lever Cc: Daniel Vetter Cc: Daniel Vetter Cc: Darrick J. Wong Cc: Dave Chinner Cc: Greg Kroah-Hartman Cc: Joel Fernandes Cc: Kirill Tkhai Cc: Paul E. McKenney Cc: Roman Gushchin Cc: Sergey Senozhatsky Cc: Steven Price Cc: Theodore Ts'o Cc: Vlastimil Babka Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Coly Li Cc: Dai Ngo Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Sean Paul Cc: Song Liu Cc: Stefano Stabellini Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit 3ee0aa9f06756e959633ffda37856c6741d948ed Author: Qi Zheng Date: Mon Sep 11 17:25:14 2023 +0800 mm: move some shrinker-related function declarations to mm/internal.h Patch series "cleanups for lockless slab shrink", v4. This series is some cleanups for lockless slab shrink. This patch (of 4): The following functions are only used inside the mm subsystem, so it's better to move their declarations to the mm/internal.h file. 1. shrinker_debugfs_add() 2. shrinker_debugfs_detach() 3. shrinker_debugfs_remove() Link: https://lkml.kernel.org/r/20230911092517.64141-1-zhengqi.arch@bytedance.com Link: https://lkml.kernel.org/r/20230911092517.64141-2-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Cc: Christian Brauner Cc: Christian König Cc: Chuck Lever Cc: Daniel Vetter Cc: Darrick J. Wong Cc: Dave Chinner Cc: Greg Kroah-Hartman Cc: Joel Fernandes Cc: Kirill Tkhai Cc: Paul E. McKenney Cc: Roman Gushchin Cc: Sergey Senozhatsky Cc: Steven Price Cc: Theodore Ts'o Cc: Vlastimil Babka Cc: Daniel Vetter Cc: Abhinav Kumar Cc: Alasdair Kergon Cc: Alexander Viro Cc: Alyssa Rosenzweig Cc: Andreas Dilger Cc: Andreas Gruenbacher Cc: Anna Schumaker Cc: Arnd Bergmann Cc: Bob Peterson Cc: Borislav Petkov Cc: Carlos Llamas Cc: Chandan Babu R Cc: Chao Yu Cc: Chris Mason Cc: Coly Li Cc: Dai Ngo Cc: Dave Hansen Cc: David Airlie Cc: David Hildenbrand Cc: David Sterba Cc: Dmitry Baryshkov Cc: Gao Xiang Cc: Huang Rui Cc: Ingo Molnar Cc: Jaegeuk Kim Cc: Jani Nikula Cc: Jan Kara Cc: Jason Wang Cc: Jeff Layton Cc: Jeffle Xu Cc: Joonas Lahtinen Cc: Josef Bacik Cc: Juergen Gross Cc: Kent Overstreet Cc: Marijn Suijten Cc: "Michael S. Tsirkin" Cc: Mike Snitzer Cc: Minchan Kim Cc: Muchun Song Cc: Nadav Amit Cc: Neil Brown Cc: Oleksandr Tyshchenko Cc: Olga Kornievskaia Cc: Richard Weinberger Cc: Rob Clark Cc: Rob Herring Cc: Rodrigo Vivi Cc: Sean Paul Cc: Song Liu Cc: Stefano Stabellini Cc: Thomas Gleixner Cc: Tomeu Vizoso Cc: Tom Talpey Cc: Trond Myklebust Cc: Tvrtko Ursulin Cc: Xuan Zhuo Cc: Yue Hu Signed-off-by: Andrew Morton commit e538a582097878c536c68002c79722e4a037c080 Author: Adrian Hunter Date: Mon Sep 11 14:21:14 2023 +0300 proc/kcore: do not try to access unaccepted memory Support for unaccepted memory was added recently, refer commit dcdfdd40fa82 ("mm: Add support for unaccepted memory"), whereby a virtual machine may need to accept memory before it can be used. Do not try to access unaccepted memory because it can cause the guest to fail. For /proc/kcore, which is read-only and does not support mmap, this means a read of unaccepted memory will return zeros. Link: https://lkml.kernel.org/r/20230911112114.91323-3-adrian.hunter@intel.com Signed-off-by: Adrian Hunter Reviewed-by: David Hildenbrand Cc: Ard Biesheuvel Cc: Baoquan He Cc: Borislav Petkov (AMD) Cc: Dave Hansen Cc: Dave Young Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Mike Rapoport Cc: Tom Lendacky Cc: Vivek Goyal Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 7cd34dd3c9bf1d67ce7d1ab3fe8886c583ae0d9a Author: Adrian Hunter Date: Mon Sep 11 14:21:13 2023 +0300 efi/unaccepted: do not let /proc/vmcore try to access unaccepted memory Patch series "Do not try to access unaccepted memory", v2. Support for unaccepted memory was added recently, refer commit dcdfdd40fa82 ("mm: Add support for unaccepted memory"), whereby a virtual machine may need to accept memory before it can be used. Plug a few gaps where RAM is exposed without checking if it is unaccepted memory. This patch (of 2): Support for unaccepted memory was added recently, refer commit dcdfdd40fa82 ("mm: Add support for unaccepted memory"), whereby a virtual machine may need to accept memory before it can be used. Do not let /proc/vmcore try to access unaccepted memory because it can cause the guest to fail. For /proc/vmcore, which is read-only, this means a read or mmap of unaccepted memory will return zeros. Link: https://lkml.kernel.org/r/20230911112114.91323-1-adrian.hunter@intel.com Link: https://lkml.kernel.org/r/20230911112114.91323-2-adrian.hunter@intel.com Signed-off-by: Adrian Hunter Cc: Ard Biesheuvel Cc: Baoquan He Cc: Borislav Petkov (AMD) Cc: Dave Hansen Cc: Dave Young Cc: Kirill A. Shutemov Cc: Lorenzo Stoakes Cc: Mike Rapoport Cc: Tom Lendacky Cc: Vivek Goyal Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 46fa84a2b920f91780db3347de81d65efb668301 Author: Alexander Potapenko Date: Mon Sep 11 16:57:02 2023 +0200 kmsan: introduce test_memcpy_initialized_gap() Add a regression test for the special case where memcpy() previously failed to correctly set the origins: if upon memcpy() four aligned initialized bytes with a zero origin value ended up split between two aligned four-byte chunks, one of those chunks could've received the zero origin value even despite it contained uninitialized bytes from other writes. Link: https://lkml.kernel.org/r/20230911145702.2663753-4-glider@google.com Signed-off-by: Alexander Potapenko Suggested-by: Marco Elver Acked-by: Marco Elver Cc: Dmitry Vyukov Signed-off-by: Andrew Morton commit c3ab4873c8d3620493042123471e65b5e2c37b2c Author: Alexander Potapenko Date: Mon Sep 11 16:57:01 2023 +0200 kmsan: merge test_memcpy_aligned_to_unaligned{,2}() together Introduce report_reset() that allows checking for more than one KMSAN report per testcase. Fold test_memcpy_aligned_to_unaligned2() into test_memcpy_aligned_to_unaligned(), so that they share the setup phase and check the behavior of a single memcpy() call. Link: https://lkml.kernel.org/r/20230911145702.2663753-3-glider@google.com Signed-off-by: Alexander Potapenko Acked-by: Marco Elver Cc: Dmitry Vyukov Signed-off-by: Andrew Morton commit 0be7b2c232cfb1621660c78b0fd7260361c75e27 Author: Alexander Potapenko Date: Mon Sep 11 16:57:00 2023 +0200 kmsan: prevent optimizations in memcpy tests Clang 18 learned to optimize away memcpy() calls of small uninitialized scalar values. To ensure that memcpy tests in kmsan_test.c still perform calls to memcpy() (which KMSAN replaces with __msan_memcpy()), declare a separate memcpy_noinline() function with volatile parameters, which won't be optimized. Also retire DO_NOT_OPTIMIZE(), as memcpy_noinline() is apparently enough. Link: https://lkml.kernel.org/r/20230911145702.2663753-2-glider@google.com Signed-off-by: Alexander Potapenko Acked-by: Marco Elver Cc: Dmitry Vyukov Signed-off-by: Andrew Morton commit be1ab60eb04f27e559d8be9655beb04d2bc90b25 Author: Alexander Potapenko Date: Mon Sep 11 16:56:59 2023 +0200 kmsan: simplify kmsan_internal_memmove_metadata() kmsan_internal_memmove_metadata() is the function that implements copying metadata every time memcpy()/memmove() is called. Because shadow memory stores 1 byte per each byte of kernel memory, copying the shadow is trivial and can be done by a single memmove() call. Origins, on the other hand, are stored as 4-byte values corresponding to every aligned 4 bytes of kernel memory. Therefore, if either the source or the destination of kmsan_internal_memmove_metadata() is unaligned, the number of origin slots corresponding to the source or destination may differ: 1) memcpy(0xffff888080a00000, 0xffff888080900000, 4) copies 1 origin slot into 1 origin slot: src (0xffff888080900000): xxxx src origins: o111 dst (0xffff888080a00000): xxxx dst origins: o111 2) memcpy(0xffff888080a00001, 0xffff888080900000, 4) copies 1 origin slot into 2 origin slots: src (0xffff888080900000): xxxx src origins: o111 dst (0xffff888080a00000): .xxx x... dst origins: o111 o111 3) memcpy(0xffff888080a00000, 0xffff888080900001, 4) copies 2 origin slots into 1 origin slot: src (0xffff888080900000): .xxx x... src origins: o111 o222 dst (0xffff888080a00000): xxxx dst origins: o111 (or o222) Previously, kmsan_internal_memmove_metadata() tried to solve this problem by copying min(src_slots, dst_slots) as is and cloning the missing slot on one of the ends, if needed. This was error-prone even in the simple cases where 4 bytes were copied, and did not account for situations where the total number of nonzero origin slots could have increased by more than one after copying: memcpy(0xffff888080a00000, 0xffff888080900002, 8) src (0xffff888080900002): ..xx .... xx.. src origins: o111 0000 o222 dst (0xffff888080a00000): xx.. ..xx o111 0000 (or 0000 o222) The new implementation simply copies the shadow byte by byte, and updates the corresponding origin slot, if the shadow byte is nonzero. This approach can handle complex cases with mixed initialized and uninitialized bytes. Similarly to KMSAN inline instrumentation, latter writes to bytes sharing the same origin slots take precedence. Link: https://lkml.kernel.org/r/20230911145702.2663753-1-glider@google.com Fixes: f80be4571b19 ("kmsan: add KMSAN runtime core") Signed-off-by: Alexander Potapenko Acked-by: Marco Elver Cc: Dmitry Vyukov Signed-off-by: Andrew Morton commit 1717449b4417da2d24e2f9db95239e85f1317002 Author: Aleksa Sarai Date: Tue Sep 12 01:17:20 2023 +1000 memfd: drop warning for missing exec-related flags Commit 434ed3350f57 ("memfd: improve userspace warnings for missing exec-related flags") attempted to make these warnings more useful (so they would work as an incentive to get users to switch to specifying these flags -- as intended by the original MFD_NOEXEC_SEAL patchset). Unfortunately, it turns out that even INFO-level logging is too extreme to enable by default and alternative solutions to the spam issue (such as doing more extreme rate-limiting per-task) are either too ugly or overkill for something as simple as emitting a log as a developer aid. Given that the flags are new and there is no harm to not specifying them (after all, we maintain backwards compatibility) we can just drop the warnings for now until some time in the future when most programs have migrated and distributions start using vm.memfd_noexec=1 (where failing to pass the flag would result in unexpected errors for programs that use executable memfds). Link: https://lkml.kernel.org/r/20230912-memfd-reduce-spam-v2-1-7d92a4964b6a@cyphar.com Fixes: 434ed3350f57 ("memfd: improve userspace warnings for missing exec-related flags") Fixes: 2562d67b1bdf ("revert "memfd: improve userspace warnings for missing exec-related flags".") Signed-off-by: Aleksa Sarai Reported-by: Damian Tometzki Reviewed-by: Christian Brauner Cc: Daniel Verkamp Cc: Jeff Xu Cc: Kees Cook Cc: Shuah Khan Signed-off-by: Andrew Morton commit 84e8e54e2ed9d857c4e10a7e487532203385249c Author: Ying Sun Date: Wed Sep 6 12:50:12 2023 +0800 mm/shmem: remove dead code can not be satisfied by "(CONFIG_SHMEM)&&(!(CONFIG_SHMEM))" The value of “.fs_flags” in line 4608 is a dead code which will never be implemented,because its conditions of line 47 "#ifdef CONFIG_SHMEM" and line 4607 are mutually exclusive. It is recommended to delete redundant code. Link: https://lkml.kernel.org/r/20230906045012.14999-1-sunying@nj.iscas.ac.cn Signed-off-by: Ying Sun Suggested-by: Yanjie Ren Signed-off-by: Andrew Morton commit 037dd8f9024bdd5540e2b66eba56c279f740b23c Author: Angus Chen Date: Wed Sep 6 16:37:00 2023 +0800 mm/vmscan: print err before panic If panic is enable,the err information will not be printed before bugon, So swap it. Print the return value of PTR_ERR(pgdat->kswapd) also. Link: https://lkml.kernel.org/r/20230906083700.181-1-angus.chen@jaguarmicro.com Signed-off-by: Angus Chen Signed-off-by: Andrew Morton commit 40dca9b3d65a20c4b7a48252ece572132a299302 Author: Yajun Deng Date: Wed Sep 6 17:11:13 2023 +0800 mm/mm_init.c: remove redundant pr_info when node is memoryless There is a similar pr_info in free_area_init_node(), so remove the redundant pr_info. before: [ 0.006314] Initializing node 0 as memoryless [ 0.006445] Initmem setup node 0 as memoryless [ 0.006450] Initmem setup node 1 [mem 0x0000000000001000-0x000000003fffffff] [ 0.006453] Initmem setup node 2 [mem 0x0000000040000000-0x000000007ffd7fff] [ 0.006454] Initializing node 3 as memoryless [ 0.006584] Initmem setup node 3 as memoryless [ 0.006585] Initmem setup node 4 [mem 0x0000000100000000-0x00000001bfffffff] [ 0.006586] Initmem setup node 5 [mem 0x00000001c0000000-0x00000001ffffffff] [ 0.006587] Initmem setup node 6 [mem 0x0000000200000000-0x000000023fffffff] after: [ 0.004147] Initmem setup node 0 as memoryless [ 0.004148] Initmem setup node 1 [mem 0x0000000000001000-0x000000003fffffff] [ 0.004150] Initmem setup node 2 [mem 0x0000000040000000-0x000000007ffd7fff] [ 0.004154] Initmem setup node 3 as memoryless [ 0.004155] Initmem setup node 4 [mem 0x0000000100000000-0x00000001bfffffff] [ 0.004156] Initmem setup node 5 [mem 0x00000001c0000000-0x00000001ffffffff] [ 0.004157] Initmem setup node 6 [mem 0x0000000200000000-0x000000023fffffff] Link: https://lkml.kernel.org/r/20230906091113.4029983-1-yajun.deng@linux.dev Signed-off-by: Yajun Deng Reviewed-by: David Hildenbrand Cc: Mike Rapoport (IBM) Signed-off-by: Andrew Morton commit 6a898c2757af1ac852bb917a0866d2724f303076 Author: Yuan Can Date: Wed Sep 6 17:31:57 2023 +0800 mm: hugetlb_vmemmap: allow alloc vmemmap pages fallback to other nodes In vmemmap_remap_free(), a new head vmemmap page is allocated to avoid breaking a contiguous block of struct page memory, however, the allocation can always fail when the given node is movable node. Remove the __GFP_THISNODE to help avoid fragmentation. Link: https://lkml.kernel.org/r/20230906093157.9737-1-yuancan@huawei.com Signed-off-by: Yuan Can Suggested-by: Mike Kravetz Reviewed-by: Mike Kravetz Suggested-by: Muchun Song Reviewed-by: Muchun Song Signed-off-by: Andrew Morton commit 7fa38d0ea00ffe2cd3c95c96c85221b8ae221875 Author: Xiu Jianfeng Date: Wed Sep 6 10:33:12 2023 +0000 mm: remove duplicated vma->vm_flags check when expanding stack expand_upwards() and expand_downwards() will return -EFAULT if VM_GROWSUP or VM_GROWSDOWN is not correctly set in vma->vm_flags, however in !CONFIG_STACK_GROWSUP case, expand_stack_locked() returns -EINVAL first if !(vma->vm_flags & VM_GROWSDOWN) before calling expand_downwards(), to keep the consistency with CONFIG_STACK_GROWSUP case, remove this check. The usages of this function are as below: A:fs/exec.c ret = expand_stack_locked(vma, stack_base); if (ret) ret = -EFAULT; or B:mm/memory.c mm/mmap.c if (expand_stack_locked(vma, addr)) return NULL; which means the return value will not propagate to other places, so I believe there is no user-visible effects of this change, and it's unnecessary to backport to earlier versions. Link: https://lkml.kernel.org/r/20230906103312.645712-1-xiujianfeng@huaweicloud.com Fixes: f440fa1ac955 ("mm: make find_extend_vma() fail if write lock not held") Signed-off-by: Xiu Jianfeng Cc: Liam R. Howlett Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 2d00946bd7f4e8c17cbd2fce5fd7c3ab58046dff Author: SeongJae Park Date: Thu Sep 7 02:29:29 2023 +0000 mm/damon/core: remove 'struct target *' parameter from damon_aggregated tracepoint damon_aggregateed tracepoint is receiving 'struct target *', but doesn't use it. Remove it from the prototype. Link: https://lkml.kernel.org/r/20230907022929.91361-12-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit cf0a96bd3ab4d9d8a1c92baf1a822f2ddbca3a34 Author: SeongJae Park Date: Thu Sep 7 02:29:28 2023 +0000 mm/damon/core: remove duplicated comment for watermarks-based deactivation The comment for explaining about watermarks-based monitoring part deactivation is duplicated in two paragraphs. Remove one. Link: https://lkml.kernel.org/r/20230907022929.91361-11-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit d896073fc767ebb40c11a6a9de71c390757ac64b Author: SeongJae Park Date: Thu Sep 7 02:29:27 2023 +0000 mm/damon/core: add more comments for nr_accesses The comment on struct damon_region about nr_accesses field looks not sufficient. Many people actually used to ask what nr_accesses mean. There is more detailed explanation of the mechanism on the comment for struct damon_attrs, but it is also ambiguous, as it doesn't specify the name of the counter for aggregating the access check results. Make those more detailed. Link: https://lkml.kernel.org/r/20230907022929.91361-10-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 27e68c4b0d5a945d975140315332ea2e7aa2c57b Author: SeongJae Park Date: Thu Sep 7 02:29:26 2023 +0000 mm/damon/core: fix a comment about damon_set_attrs() call timings The comment on damon_set_attrs() says it should not be called while the kdamond is running, but now some DAMON modules like sysfs interface and DAMON_RECLAIM call it from after_aggregation() and/or after_wmarks_check() callbacks for online tuning. Update the comment. Link: https://lkml.kernel.org/r/20230907022929.91361-9-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 46158bf211bd557cb7849ff747a5a94d82cd4aa8 Author: SeongJae Park Date: Thu Sep 7 02:29:25 2023 +0000 Docs/admin-guide/mm/damon/usage: link design doc for details of kdamond and context The explanation of kdamond and context is duplicated in the design and the usage documents. Replace that in the usage with links to those in the design document. Link: https://lkml.kernel.org/r/20230907022929.91361-8-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 86ae64cde2f7165a20e2824431cec8e820a0b689 Author: SeongJae Park Date: Thu Sep 7 02:29:24 2023 +0000 Docs/mm/damon/design: add a section for kdamond and DAMON context The design document is not explaining about the concept of kdamond and the DAMON context, while usage document does. Those concept explanation should be in the design document, and usage document should link those. Add a section for those. Link: https://lkml.kernel.org/r/20230907022929.91361-7-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 4f554ca15ad24022178b954e03d73502a98d6d44 Author: SeongJae Park Date: Thu Sep 7 02:29:23 2023 +0000 Docs/admin-guide/mm/damon/usage: explain the format of damon_aggregate tracepoint The example of the section for damon_aggregated tracepoint is not explaining how the output looks like, and how it can be interpreted. Add it. Link: https://lkml.kernel.org/r/20230907022929.91361-6-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 24df886f9f32087ba70d95a03a11c23db171a756 Author: SeongJae Park Date: Thu Sep 7 02:29:22 2023 +0000 Docs/mm/damon/design: explicitly introduce ``nr_accesses`` The design document is explaining about the access tracking mechanism and the access rate counter (nr_accesses), but not directly mentions the name. Add a sentence for making it clear. Link: https://lkml.kernel.org/r/20230907022929.91361-5-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 4f7112786e5c670fed2787d4f80291aa55c4a26c Author: SeongJae Park Date: Thu Sep 7 02:29:21 2023 +0000 Docs/admin-guide/mm/damon/usage: move debugfs intro to the bottom of the section On the DAMON usage introduction section, the introduction of DAMON debugfs interface, which is deprecated, is above kernel API, which is actively supported. Move the DAMON debugfs intro to bottom, so that readers have less chances to read it. Link: https://lkml.kernel.org/r/20230907022929.91361-4-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 75999724ba3ffcbda571ec11272644b76cfd9b9f Author: SeongJae Park Date: Thu Sep 7 02:29:20 2023 +0000 Docs/admin-guide/mm/damon/usage: place debugfs usage at the bottom debugfs interface is deprecated. Put it at the bottom of the document so that readers have less chances to read it. Link: https://lkml.kernel.org/r/20230907022929.91361-3-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit b4c078004a435712fb0f61e1ac84b4832ecaecdc Author: SeongJae Park Date: Thu Sep 7 02:29:19 2023 +0000 Docs/admin-guide/mm/damon/usage: fixup missed :ref: keyword Patch series "mm/damon: misc fixups for documents, comments and its tracepoint". This patchset contains miscellaneous simple fixups for documents, comments and tracepoint of DAMON. This patch (of 11): A cross-link reference in DAMON usage document is missing ':ref:' Sphynx keyword. Fix it. Link: https://lkml.kernel.org/r/20230907022929.91361-1-sj@kernel.org Link: https://lkml.kernel.org/r/20230907022929.91361-2-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Steven Rostedt (Google) Signed-off-by: Andrew Morton commit 64d4d49c5f3bd9a8a24f52d1e9d16af1b368114b Author: Nhat Pham Date: Fri Sep 8 16:51:15 2023 -0700 zswap: change zswap's default allocator to zsmalloc Out of zswap's 3 allocators, zsmalloc is the clear superior in terms of memory utilization, both in theory and as observed in practice, with its high storage density and low internal fragmentation. zsmalloc is also more actively developed and maintained, since it is the allocator of choice for zswap for many users, as well as the only allocator for zram. A historical objection to the selection of zsmalloc as the default allocator for zswap is its lack of writeback capability. However, this has changed, with the zsmalloc writeback patchset, and the subsequent zswap LRU refactor. With this, there is not a lot of good reasons to keep zbud, an otherwise inferior allocator, as the default instead of zswap. This patch changes the default allocator to zsmalloc. The only exception is on settings without MMU, in which case zbud will remain as the default. Link: https://lkml.kernel.org/r/20230908235115.2943486-1-nphamcs@gmail.com Signed-off-by: Nhat Pham Acked-by: Johannes Weiner Acked-by: Yosry Ahmed Cc: Dan Streetman Cc: Domenico Cerasuolo Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton commit 7b709f38dc0faf0d6dfeff681e37e59f9aabebd6 Author: Joel Fernandes Date: Sun Sep 3 15:13:28 2023 +0000 selftests: mm: add a test for moving from an offset from start of mapping It is possible that the aligned address falls on no existing mapping, however that does not mean that we can just align it down to that. This test verifies that the "vma->vm_start != addr_to_align" check in can_align_down() prevents disastrous results if aligning down when source and dest are mutually aligned within a PMD but the source/dest addresses requested are not at the beginning of the respective mapping containing these addresses. Link: https://lkml.kernel.org/r/20230903151328.2981432-8-joel@joelfernandes.org Signed-off-by: Joel Fernandes (Google) Reviewed-by: Lorenzo Stoakes Cc: Kalesh Singh Cc: "Kirill A. Shutemov" Cc: Liam R. Howlett Cc: Linus Torvalds Cc: Lokesh Gidra Cc: Michal Hocko Cc: Paul E. McKenney Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 85a22845b094ec6eeb7c24c692f2290e56d9f07c Author: Joel Fernandes (Google) Date: Sun Sep 3 15:13:27 2023 +0000 selftests: mm: add a test for remapping within a range Move a block of memory within a memory range. Any alignment optimization on the source address may cause corruption. Verify using kselftest that it works. I have also verified with tracing that such optimization does not happen due to this check in can_align_down(): if (!for_stack && vma->vm_start != addr_to_align) return false; Link: https://lkml.kernel.org/r/20230903151328.2981432-7-joel@joelfernandes.org Signed-off-by: Joel Fernandes (Google) Reviewed-by: Lorenzo Stoakes Cc: Kalesh Singh Cc: "Kirill A. Shutemov" Cc: Liam R. Howlett Cc: Linus Torvalds Cc: Lokesh Gidra Cc: Michal Hocko Cc: Paul E. McKenney Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit a4cb3b2433434377ae820ac4adcde1a570c6f332 Author: Joel Fernandes (Google) Date: Sun Sep 3 15:13:26 2023 +0000 selftests: mm: add a test for remapping to area immediately after existing mapping This patch adds support for verifying that we correctly handle the situation where something is already mapped before the destination of the remap. Any realignment of destination address and PMD-copy will destroy that existing mapping. In such cases, we need to avoid doing the optimization. To test this, we map an area called the preamble before the remap region. Then we verify after the mremap operation that this region did not get corrupted. Putting some prints in the kernel, I verified that we optimize correctly in different situations: Optimize when there is alignment and no previous mapping (this is tested by previous patch). can_align_down(old_vma->vm_start=2900000, old_addr=2900000, mask=-2097152): 0 can_align_down(new_vma->vm_start=2f00000, new_addr=2f00000, mask=-2097152): 0 === Starting move_page_tables === Doing PUD move for 2800000 -> 2e00000 of extent=200000 <-- Optimization Doing PUD move for 2a00000 -> 3000000 of extent=200000 Doing PUD move for 2c00000 -> 3200000 of extent=200000 Don't optimize when there is alignment but there is previous mapping (this is tested by this patch). Notice that can_align_down() returns 1 for the destination mapping as we detected there is something there. can_align_down(old_vma->vm_start=2900000, old_addr=2900000, mask=-2097152): 0 can_align_down(new_vma->vm_start=5700000, new_addr=5700000, mask=-2097152): 1 === Starting move_page_tables === Doing move_ptes for 2900000 -> 5700000 of extent=100000 <-- Unoptimized Doing PUD move for 2a00000 -> 5800000 of extent=200000 Doing PUD move for 2c00000 -> 5a00000 of extent=200000 Link: https://lkml.kernel.org/r/20230903151328.2981432-6-joel@joelfernandes.org Signed-off-by: Joel Fernandes (Google) Reviewed-by: Lorenzo Stoakes Cc: Kalesh Singh Cc: "Kirill A. Shutemov" Cc: Liam R. Howlett Cc: Linus Torvalds Cc: Lokesh Gidra Cc: Michal Hocko Cc: Paul E. McKenney Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 8ed873d8e5cdec3852bcb59f7cc6d017f7bc0ab7 Author: Joel Fernandes (Google) Date: Sun Sep 3 15:13:25 2023 +0000 selftests: mm: add a test for mutually aligned moves > PMD size This patch adds a test case to check if a PMD-alignment optimization successfully happens. I add support to make sure there is some room before the source mapping, otherwise the optimization to trigger PMD-aligned move will be disabled as the kernel will detect that a mapping before the source exists and such optimization becomes impossible. Link: https://lkml.kernel.org/r/20230903151328.2981432-5-joel@joelfernandes.org Signed-off-by: Joel Fernandes (Google) Reviewed-by: Lorenzo Stoakes Cc: Kalesh Singh Cc: "Kirill A. Shutemov" Cc: Liam R. Howlett Cc: Linus Torvalds Cc: Lokesh Gidra Cc: Michal Hocko Cc: Paul E. McKenney Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 99eb26d59ce38a9f9ac0d63421deca6073f45086 Author: Joel Fernandes (Google) Date: Sun Sep 3 15:13:24 2023 +0000 selftests: mm: fix failure case when new remap region was not found When a valid remap region could not be found, the source mapping is not cleaned up. Fix the goto statement such that the clean up happens. Link: https://lkml.kernel.org/r/20230903151328.2981432-4-joel@joelfernandes.org Signed-off-by: Joel Fernandes (Google) Reviewed-by: Lorenzo Stoakes Cc: Kalesh Singh Cc: "Kirill A. Shutemov" Cc: Liam R. Howlett Cc: Linus Torvalds Cc: Lokesh Gidra Cc: Michal Hocko Cc: Paul E. McKenney Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit b1e5a3dee255a11cbdd5a0e814829276bd33a793 Author: Joel Fernandes (Google) Date: Sun Sep 3 15:13:23 2023 +0000 mm/mremap: allow moves within the same VMA for stack moves For the stack move happening in shift_arg_pages(), the move is happening within the same VMA which spans the old and new ranges. In case the aligned address happens to fall within that VMA, allow such moves and don't abort the mremap alignment optimization. In the regular non-stack mremap case, we cannot allow any such moves as will end up destroying some part of the mapping (either the source of the move, or part of the existing mapping). So just avoid it for stack moves. Link: https://lkml.kernel.org/r/20230903151328.2981432-3-joel@joelfernandes.org Signed-off-by: Joel Fernandes (Google) Reviewed-by: Lorenzo Stoakes Cc: Kalesh Singh Cc: "Kirill A. Shutemov" Cc: Liam R. Howlett Cc: Linus Torvalds Cc: Lokesh Gidra Cc: Michal Hocko Cc: Paul E. McKenney Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit af8ca1c149069176e6322a77b532e3ffd99ccffe Author: Joel Fernandes (Google) Date: Sun Sep 3 15:13:22 2023 +0000 mm/mremap: optimize the start addresses in move_page_tables() Patch series "Optimize mremap during mutual alignment within PMD", v6. This patchset optimizes the start addresses in move_page_tables() and tests the changes. It addresses a warning [1] that occurs due to a downward, overlapping move on a mutually-aligned offset within a PMD during exec. By initiating the copy process at the PMD level when such alignment is present, we can prevent this warning and speed up the copying process at the same time. Linus Torvalds suggested this idea. Check the individual patches for more details. [1] https://lore.kernel.org/all/ZB2GTBD%2FLWTrkOiO@dhcp22.suse.cz/ This patch (of 7): Recently, we see reports [1] of a warning that triggers due to move_page_tables() doing a downward and overlapping move on a mutually-aligned offset within a PMD. By mutual alignment, I mean the source and destination addresses of the mremap are at the same offset within a PMD. This mutual alignment along with the fact that the move is downward is sufficient to cause a warning related to having an allocated PMD that does not have PTEs in it. This warning will only trigger when there is mutual alignment in the move operation. A solution, as suggested by Linus Torvalds [2], is to initiate the copy process at the PMD level whenever such alignment is present. Implementing this approach will not only prevent the warning from being triggered, but it will also optimize the operation as this method should enhance the speed of the copy process whenever there's a possibility to start copying at the PMD level. Some more points: a. The optimization can be done only when both the source and destination of the mremap do not have anything mapped below it up to a PMD boundary. I add support to detect that. b. #1 is not a problem for the call to move_page_tables() from exec.c as nothing is expected to be mapped below the source. However, for non-overlapping mutually aligned moves as triggered by mremap(2), I added support for checking such cases. c. I currently only optimize for PMD moves, in the future I/we can build on this work and do PUD moves as well if there is a need for this. But I want to take it one step at a time. d. We need to be careful about mremap of ranges within the VMA itself. For this purpose, I added checks to determine if the address after alignment falls within its VMA itself. [1] https://lore.kernel.org/all/ZB2GTBD%2FLWTrkOiO@dhcp22.suse.cz/ [2] https://lore.kernel.org/all/CAHk-=whd7msp8reJPfeGNyt0LiySMT0egExx3TVZSX3Ok6X=9g@mail.gmail.com/ Link: https://lkml.kernel.org/r/20230903151328.2981432-1-joel@joelfernandes.org Link: https://lkml.kernel.org/r/20230903151328.2981432-2-joel@joelfernandes.org Signed-off-by: Joel Fernandes (Google) Reviewed-by: Lorenzo Stoakes Suggested-by: Linus Torvalds Cc: Kalesh Singh Cc: "Kirill A. Shutemov" Cc: Liam R. Howlett Cc: Lokesh Gidra Cc: Michal Hocko Cc: Paul E. McKenney Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton commit 2eaa6c2abb9dd55041a05c20c451790c124d5cf0 Author: Yuan Can Date: Tue Sep 5 20:45:03 2023 +0800 mm: hugetlb_vmemmap: fix hugetlb page number decrease failed on movable nodes The decreasing of hugetlb pages number failed with the following message given: sh: page allocation failure: order:0, mode:0x204cc0(GFP_KERNEL|__GFP_RETRY_MAYFAIL|__GFP_THISNODE) CPU: 1 PID: 112 Comm: sh Not tainted 6.5.0-rc7-... #45 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace.part.6+0x84/0xe4 show_stack+0x18/0x24 dump_stack_lvl+0x48/0x60 dump_stack+0x18/0x24 warn_alloc+0x100/0x1bc __alloc_pages_slowpath.constprop.107+0xa40/0xad8 __alloc_pages+0x244/0x2d0 hugetlb_vmemmap_restore+0x104/0x1e4 __update_and_free_hugetlb_folio+0x44/0x1f4 update_and_free_hugetlb_folio+0x20/0x68 update_and_free_pages_bulk+0x4c/0xac set_max_huge_pages+0x198/0x334 nr_hugepages_store_common+0x118/0x178 nr_hugepages_store+0x18/0x24 kobj_attr_store+0x18/0x2c sysfs_kf_write+0x40/0x54 kernfs_fop_write_iter+0x164/0x1dc vfs_write+0x3a8/0x460 ksys_write+0x6c/0x100 __arm64_sys_write+0x1c/0x28 invoke_syscall+0x44/0x100 el0_svc_common.constprop.1+0x6c/0xe4 do_el0_svc+0x38/0x94 el0_svc+0x28/0x74 el0t_64_sync_handler+0xa0/0xc4 el0t_64_sync+0x174/0x178 Mem-Info: ... The reason is that the hugetlb pages being released are allocated from movable nodes, and with hugetlb_optimize_vmemmap enabled, vmemmap pages need to be allocated from the same node during the hugetlb pages releasing. With GFP_KERNEL and __GFP_THISNODE set, allocating from movable node is always failed. Fix this problem by removing __GFP_THISNODE. Link: https://lkml.kernel.org/r/20230905124503.24899-1-yuancan@huawei.com Fixes: ad2fa3717b74 ("mm: hugetlb: alloc the vmemmap pages associated with each HugeTLB page") Signed-off-by: Yuan Can Reviewed-by: Muchun Song Cc: Kefeng Wang Cc: Mike Kravetz Signed-off-by: Andrew Morton commit 77cd814835df22e177a9caac1b046f7ffdfeedd0 Author: Uros Bizjak Date: Mon Sep 4 17:08:49 2023 +0200 mm/vmstat: use this_cpu_try_cmpxchg in mod_{zone,node}_state Use this_cpu_try_cmpxchg instead of this_cpu_cmpxchg (*ptr, old, new) == old in mod_zone_state and mod_node_state. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails. There is no need to re-read the value in the loop. No functional change intended. Link: https://lkml.kernel.org/r/20230904150917.8318-1-ubizjak@gmail.com Signed-off-by: Uros Bizjak Signed-off-by: Andrew Morton commit 91e79d22be75fec88ae58d274a7c9e49d6215099 Author: Matthew Wilcox (Oracle) Date: Wed Aug 23 00:13:14 2023 +0100 mm: convert DAX lock/unlock page to lock/unlock folio The one caller of DAX lock/unlock page already calls compound_head(), so use page_folio() instead, then use a folio throughout the DAX code to remove uses of page->mapping and page->index. [jane.chu@oracle.com: add comment to mf_generic_kill_procss(), simplify mf_generic_kill_procs:folio initialization] Link: https://lkml.kernel.org/r/20230908222336.186313-1-jane.chu@oracle.com Link: https://lkml.kernel.org/r/20230822231314.349200-1-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Jane Chu Acked-by: Naoya Horiguchi Cc: Dan Williams Cc: Jane Chu Signed-off-by: Andrew Morton commit bc0c3357601e3ff1b006600530079bd246ef0d82 Author: Mateusz Guzik Date: Wed Aug 23 19:05:56 2023 +0200 mm: remove remnants of SPLIT_RSS_COUNTING The feature got retired in f1a7941243c1 ("mm: convert mm's rss stats into percpu_counter"), but the patch failed to fully clean it up. Link: https://lkml.kernel.org/r/20230823170556.2281747-1-mjguzik@gmail.com Signed-off-by: Mateusz Guzik Acked-by: Shakeel Butt Signed-off-by: Andrew Morton commit 97144ce008f918249fa7275ee1d29f6f27665c34 Author: Vern Hao Date: Fri Aug 25 15:57:34 2023 +0800 mm/vmscan: use folio_migratetype() instead of get_pageblock_migratetype() In skip_cma(), we can use folio_migratetype() to replace get_pageblock_migratetype(). Link: https://lkml.kernel.org/r/20230825075735.52436-1-user@VERNHAO-MC1 Signed-off-by: Vern Hao Reviewed-by: David Hildenbrand Cc: Zhaoyang Huang Signed-off-by: Andrew Morton commit 80e4a765a770c491e081463c38be927a876e2ce8 Author: Lorenzo Stoakes Date: Sun Aug 27 12:08:48 2023 +0100 mm: refactor si_mem_available() si_mem_available() needlessly places LRU statistics into an array before retrieving only two of them, simply access those directly. In addition, refactor the code so that the blocks of code which calculate the page cache and reclaimable components each resemble one another to clearly indicate we cap both against wmark_low in the same fashion. Link: https://lkml.kernel.org/r/20230827110848.43510-1-lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes Cc: David Hildenbrand Cc: Hugh Dickins Cc: Kefeng Wang Signed-off-by: Andrew Morton commit b72b3c9c34c825c81d205241c5f822fc7835923f Author: Xueshi Hu Date: Tue Aug 29 11:33:43 2023 +0800 mm/hugetlb: fix nodes huge page allocation when there are surplus pages In set_nr_huge_pages(), local variable "count" is used to record persistent_huge_pages(), but when it cames to nodes huge page allocation, the semantics changes to nr_huge_pages. When there exists surplus huge pages and using the interface under /sys/devices/system/node/node*/hugepages to change huge page pool size, this difference can result in the allocation of an unexpected number of huge pages. Steps to reproduce the bug: Starting with: Node 0 Node 1 Total HugePages_Total 0.00 0.00 0.00 HugePages_Free 0.00 0.00 0.00 HugePages_Surp 0.00 0.00 0.00 create 100 huge pages in Node 0 and consume it, then set Node 0 's nr_hugepages to 0. yields: Node 0 Node 1 Total HugePages_Total 200.00 0.00 200.00 HugePages_Free 0.00 0.00 0.00 HugePages_Surp 200.00 0.00 200.00 write 100 to Node 1's nr_hugepages echo 100 > /sys/devices/system/node/node1/\ hugepages/hugepages-2048kB/nr_hugepages gets: Node 0 Node 1 Total HugePages_Total 200.00 400.00 600.00 HugePages_Free 0.00 400.00 400.00 HugePages_Surp 200.00 0.00 200.00 Kernel is expected to create only 100 huge pages and it gives 200. Link: https://lkml.kernel.org/r/20230829033343.467779-1-xueshi.hu@smartx.com Fixes: 9a30523066cd ("hugetlb: add per node hstate attributes") Signed-off-by: Xueshi Hu Reviewed-by: Mike Kravetz Cc: Andi Kleen Cc: Lee Schermerhorn Cc: Mel Gorman Cc: Muchun Song Signed-off-by: Andrew Morton commit d8f5f7e445f02eb10dee1a0a992146314cf460f8 Author: Mike Kravetz Date: Tue Aug 29 14:37:34 2023 -0700 hugetlb: set hugetlb page flag before optimizing vmemmap Currently, vmemmap optimization of hugetlb pages is performed before the hugetlb flag (previously hugetlb destructor) is set identifying it as a hugetlb folio. This means there is a window of time where an ordinary folio does not have all associated vmemmap present. The core mm only expects vmemmap to be potentially optimized for hugetlb and device dax. This can cause problems in code such as memory error handling that may want to write to tail struct pages. There is only one call to perform hugetlb vmemmap optimization today. To fix this issue, simply set the hugetlb flag before that call. There was a similar issue in the free hugetlb path that was previously addressed. The two routines that optimize or restore hugetlb vmemmap should only be passed hugetlb folios/pages. To catch any callers not following this rule, add VM_WARN_ON calls to the routines. In the hugetlb free code paths, some calls could be made to restore vmemmap after clearing the hugetlb flag. This was 'safe' as in these cases vmemmap was already present and the call was a NOOP. However, for consistency these calls where eliminated so that we can add the VM_WARN_ON checks. Link: https://lkml.kernel.org/r/20230829213734.69673-1-mike.kravetz@oracle.com Fixes: f41f2ed43ca5 ("mm: hugetlb: free the vmemmap pages associated with each HugeTLB page") Signed-off-by: Mike Kravetz Reviewed-by: Muchun Song Cc: James Houghton Cc: Miaohe Lin Cc: Michal Hocko Cc: Naoya Horiguchi Cc: Usama Arif Signed-off-by: Andrew Morton commit dd34d9fe3b427dea47f81443d022dbaec4339f7e Author: Anthony Yznaga Date: Tue Aug 29 17:43:24 2023 -0700 mm: fix unaccount of memory on vma_link() failure Fix insert_vm_struct() so that only accounted memory is unaccounted if vma_link() fails. Link: https://lkml.kernel.org/r/20230830004324.16101-1-anthony.yznaga@oracle.com Fixes: d4af56c5c7c6 ("mm: start tracking VMAs with maple tree") Signed-off-by: Anthony Yznaga Reviewed-by: Liam R. Howlett Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 954652b9f33bb1892ea4448479d78779e4a8ae13 Author: Anthony Yznaga Date: Tue Aug 29 17:45:49 2023 -0700 mm/mremap: fix unaccount of memory on vma_merge() failure Fix mremap so that only accounted memory is unaccounted if the mapping is expandable but vma_merge() fails. Link: https://lkml.kernel.org/r/20230830004549.16131-1-anthony.yznaga@oracle.com Fixes: fdbef6149135 ("mm/mremap: don't account pages in vma_to_resize()") Signed-off-by: Anthony Yznaga Acked-by: Brian Geffon Signed-off-by: Andrew Morton commit b6afcb94ce331b6d94dbeb56def173483993faf3 Author: Ding Xiang Date: Thu Aug 31 17:31:44 2023 +0800 selftests/mm: gup_longterm: fix a resource leak The opened file should be closed in run_with_tmpfile(), otherwise resource leak will occur Link: https://lkml.kernel.org/r/20230831093144.7520-1-dingxiang@cmss.chinamobile.com Signed-off-by: Ding Xiang Signed-off-by: Andrew Morton commit e19a3f595ae47bd8c034b98eb0b28a3877413387 Author: Kemeng Shi Date: Fri Sep 1 23:51:41 2023 +0800 mm/compaction: factor out code to test if we should run compaction for target order We always do zone_watermark_ok check and compaction_suitable check together to test if compaction for target order should be ran. Factor these code out to remove repeat code. Link: https://lkml.kernel.org/r/20230901155141.249860-7-shikemeng@huaweicloud.com Signed-off-by: Kemeng Shi Reviewed-by: Baolin Wang Cc: David Hildenbrand Cc: Matthew Wilcox (Oracle) Cc: Mel Gorman Signed-off-by: Andrew Morton commit 9cc17ede5125933ab47f8f359c2cce3aca8ee757 Author: Kemeng Shi Date: Fri Sep 1 23:51:40 2023 +0800 mm/compaction: improve comment of is_via_compact_memory We do proactive compaction with order == -1 via 1. /proc/sys/vm/compact_memory 2. /sys/devices/system/node/nodex/compact 3. /proc/sys/vm/compaction_proactiveness Add missed situation in which order == -1. Link: https://lkml.kernel.org/r/20230901155141.249860-6-shikemeng@huaweicloud.com Signed-off-by: Kemeng Shi Reviewed-by: Baolin Wang Acked-by: Mel Gorman Cc: David Hildenbrand Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 8df4e28c64188911fba33789bf2cb882b3ae524e Author: Kemeng Shi Date: Fri Sep 1 23:51:39 2023 +0800 mm/compaction: remove repeat compact_blockskip_flush check in reset_isolation_suitable We have compact_blockskip_flush check in __reset_isolation_suitable, just remove repeat check before __reset_isolation_suitable in compact_blockskip_flush. Link: https://lkml.kernel.org/r/20230901155141.249860-5-shikemeng@huaweicloud.com Signed-off-by: Kemeng Shi Reviewed-by: Baolin Wang Acked-by: Mel Gorman Cc: David Hildenbrand Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 3da0272a4c7d0d37b47b28e87014f421296fc2be Author: Kemeng Shi Date: Fri Sep 1 23:51:38 2023 +0800 mm/compaction: correctly return failure with bogus compound_order in strict mode In strict mode, we should return 0 if there is any hole in pageblock. If we successfully isolated pages at beginning at pageblock and then have a bogus compound_order outside pageblock in next page. We will abort search loop with blockpfn > end_pfn. Although we will limit blockpfn to end_pfn, we will treat it as a successful isolation in strict mode as blockpfn is not < end_pfn and return partial isolated pages. Then isolate_freepages_range may success unexpectly with hole in isolated range. Link: https://lkml.kernel.org/r/20230901155141.249860-4-shikemeng@huaweicloud.com Fixes: 9fcd6d2e052e ("mm, compaction: skip compound pages by order in free scanner") Signed-off-by: Kemeng Shi Reviewed-by: Baolin Wang Acked-by: Mel Gorman Cc: David Hildenbrand Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit 4c17989116cb0a6a91f4184077c342a9097b748e Author: Kemeng Shi Date: Fri Sep 1 23:51:37 2023 +0800 mm/compaction: call list_is_{first}/{last} more intuitively in move_freelist_{head}/{tail} We use move_freelist_head after list_for_each_entry_reverse to skip recent pages. And there is no need to do actual move if all freepages are searched in list_for_each_entry_reverse, e.g. freepage point to first page in freelist. It's more intuitively to call list_is_first with list entry as the first argument and list head as the second argument to check if list entry is the first list entry instead of call list_is_last with list entry and list head passed in reverse. Similarly, call list_is_last in move_freelist_tail is more intuitively. Link: https://lkml.kernel.org/r/20230901155141.249860-3-shikemeng@huaweicloud.com Signed-off-by: Kemeng Shi Reviewed-by: Baolin Wang Acked-by: Mel Gorman Cc: David Hildenbrand Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit bbefa0fc04bab21e85f6b2ee7984c59694366f6a Author: Kemeng Shi Date: Fri Sep 1 23:51:36 2023 +0800 mm/compaction: use correct list in move_freelist_{head}/{tail} Patch series "Fixes and cleanups to compaction", v3. This is a series to do fix and clean up to compaction. Patch 1-2 fix and clean up freepage list operation. Patch 3-4 fix and clean up isolation of freepages Patch 7 factor code to check if compaction is needed for allocation order. More details can be found in respective patches. This patch (of 6): The freepage is chained with buddy_list in freelist head. Use buddy_list instead of lru to correct the list operation. Link: https://lkml.kernel.org/r/20230901155141.249860-1-shikemeng@huaweicloud.com Link: https://lkml.kernel.org/r/20230901155141.249860-2-shikemeng@huaweicloud.com Signed-off-by: Kemeng Shi Reviewed-by: Baolin Wang Acked-by: Mel Gorman Cc: David Hildenbrand Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton commit dafa493dd01d5992f1cb70b08d1741c3ab99e04a Author: Oliver Upton Date: Tue Oct 3 23:04:06 2023 +0000 KVM: arm64: Document vCPU feature selection UAPIs KVM/arm64 has a couple schemes for handling vCPU feature selection now, which is a lot to put on userspace. Add some documentation about how these interact and provide some recommendations for how to use the writable ID register scheme. Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231003230408.3405722-11-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit f89fbb350dd76d6b5f080954309b9dec5ad220ac Author: Oliver Upton Date: Tue Oct 3 23:04:05 2023 +0000 KVM: arm64: Allow userspace to change ID_AA64ZFR0_EL1 All known fields in ID_AA64ZFR0_EL1 describe the unprivileged instructions supported by the PE's SVE implementation. Allow userspace to pick and choose the advertised feature set, though nothing stops the guest from using undisclosed instructions. Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231003230408.3405722-10-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 8cfd5be88ebe3d71be1a2c52fc72a355bb924b49 Author: Jing Zhang Date: Tue Oct 3 23:04:04 2023 +0000 KVM: arm64: Allow userspace to change ID_AA64PFR0_EL1 Allow userspace to change the guest-visible value of the register with some severe limitation: - No changes to features not virtualized by KVM (AMU, MPAM, RAS) - Short of full GICv2 emulation in kernel, hiding GICv3 from the guest makes absolutely no sense. - FP is effectively assumed for KVM VMs. Signed-off-by: Jing Zhang [oliver: restrict features that are illogical to change] Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231003230408.3405722-9-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit d5a32b60dc184cc7309f83648a368b94d91c797f Author: Jing Zhang Date: Tue Oct 3 23:04:03 2023 +0000 KVM: arm64: Allow userspace to change ID_AA64MMFR{0-2}_EL1 Allow userspace to modify the guest-visible values of these ID registers. Prevent changes to any of the virtualization features until KVM picks up support for nested and we have a handle on managing NV features. Signed-off-by: Jing Zhang [oliver: prevent changes to EL2 features for now] Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231003230408.3405722-8-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 56d77aa8bdf527f3b767fa27a3f135769151c92d Author: Oliver Upton Date: Tue Oct 3 23:04:02 2023 +0000 KVM: arm64: Allow userspace to change ID_AA64ISAR{0-2}_EL1 Almost all of the features described by the ISA registers have no KVM involvement. Allow userspace to change the value of these registers with a couple exceptions: - MOPS is not writable as KVM does not currently virtualize FEAT_MOPS. - The PAuth fields are not writable as KVM requires both address and generic authentication be enabled. Co-developed-by: Jing Zhang Signed-off-by: Jing Zhang Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231003230408.3405722-7-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 9f9917bc71b08335819ea667d1e392424fb76450 Author: Oliver Upton Date: Tue Oct 3 23:04:01 2023 +0000 KVM: arm64: Bump up the default KVM sanitised debug version to v8p8 Since ID_AA64DFR0_EL1 and ID_DFR0_EL1 are now writable from userspace, it is safe to bump up the default KVM sanitised debug version to v8p8. Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231003230408.3405722-6-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit a9bc4a1c1e0c206838bc2d0c8621ca6df9704a2f Author: Oliver Upton Date: Tue Oct 3 23:04:00 2023 +0000 KVM: arm64: Reject attempts to set invalid debug arch version The debug architecture is mandatory in ARMv8, so KVM should not allow userspace to configure a vCPU with less than that. Of course, this isn't handled elegantly by the generic ID register plumbing, as the respective ID register fields have a nonzero starting value. Add an explicit check for debug versions less than v8 of the architecture. Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231003230408.3405722-5-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 5a23e5c7cb0d5b2b38c33417579cd628be7d14c5 Author: Oliver Upton Date: Wed Oct 4 17:03:17 2023 +0000 KVM: arm64: Advertise selected DebugVer in DBGDIDR.Version Much like we do for other fields, extract the Debug architecture version from the ID register to populate the corresponding field in DBGDIDR. Rewrite the existing sysreg field extractors to use SYS_FIELD_GET() for consistency. Suggested-by: Marc Zyngier Signed-off-by: Oliver Upton commit 8b6958d6ace19d56b44ca0f961f4fa480d4b48fc Author: Jing Zhang Date: Tue Oct 3 23:03:59 2023 +0000 KVM: arm64: Use guest ID register values for the sake of emulation Since KVM now supports per-VM ID registers, use per-VM ID register values for the sake of emulation for DBGDIDR and LORegion. Signed-off-by: Jing Zhang Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231003230408.3405722-4-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 6656cda0f3b269cb87cfb5773d3369e6d96e83db Author: Jing Zhang Date: Tue Oct 3 23:03:58 2023 +0000 KVM: arm64: Document KVM_ARM_GET_REG_WRITABLE_MASKS Add some basic documentation on how to get feature ID register writable masks from userspace. Signed-off-by: Jing Zhang Reviewed-by: Cornelia Huck Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231003230408.3405722-3-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 3f9cd0ca848413fd368278310d2cdd6c2bef48b2 Author: Jing Zhang Date: Tue Oct 3 23:03:57 2023 +0000 KVM: arm64: Allow userspace to get the writable masks for feature ID registers While the Feature ID range is well defined and pretty large, it isn't inconceivable that the architecture will eventually grow some other ranges that will need to similarly be described to userspace. Add a VM ioctl to allow userspace to get writable masks for feature ID registers in below system register space: op0 = 3, op1 = {0, 1, 3}, CRn = 0, CRm = {0 - 7}, op2 = {0 - 7} This is used to support mix-and-match userspace and kernels for writable ID registers, where userspace may want to know upfront whether it can actually tweak the contents of an idreg or not. Add a new capability (KVM_CAP_ARM_SUPPORTED_FEATURE_ID_RANGES) that returns a bitmap of the valid ranges, which can subsequently be retrieved, one at a time by setting the index of the set bit as the range identifier. Suggested-by: Marc Zyngier Suggested-by: Cornelia Huck Signed-off-by: Jing Zhang Reviewed-by: Cornelia Huck Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20231003230408.3405722-2-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 91e43ca0090b5fd59302c3d150835299785f30ea Author: Jacob Keller Date: Mon Oct 2 11:51:32 2023 -0700 ice: fix linking when CONFIG_PTP_1588_CLOCK=n The recent support for DPLL introduced by commit 8a3a565ff210 ("ice: add admin commands to access cgu configuration") and commit d7999f5ea64b ("ice: implement dpll interface to control cgu") broke linking the ice driver if CONFIG_PTP_1588_CLOCK=n: ld: vmlinux.o: in function `ice_init_feature_support': (.text+0x8702b8): undefined reference to `ice_is_phy_rclk_present' ld: (.text+0x8702cd): undefined reference to `ice_is_cgu_present' ld: (.text+0x8702d9): undefined reference to `ice_is_clock_mux_present_e810t' ld: vmlinux.o: in function `ice_dpll_init_info_direct_pins': ice_dpll.c:(.text+0x894167): undefined reference to `ice_cgu_get_pin_freq_supp' ld: ice_dpll.c:(.text+0x894197): undefined reference to `ice_cgu_get_pin_name' ld: ice_dpll.c:(.text+0x8941a8): undefined reference to `ice_cgu_get_pin_type' ld: vmlinux.o: in function `ice_dpll_update_state': ice_dpll.c:(.text+0x894494): undefined reference to `ice_get_cgu_state' ld: vmlinux.o: in function `ice_dpll_init': (.text+0x8953d5): undefined reference to `ice_get_cgu_rclk_pin_info' The first commit broke things by calling functions in ice_init_feature_support that are compiled as part of ice_ptp_hw.o, including: * ice_is_phy_rclk_present * ice_is_clock_mux_present_e810t * ice_is_cgU_present The second commit continued the break by calling several CGU functions defined in ice_ptp_hw.c in the DPLL code. Because the ice_dpll.c file is compiled unconditionally, it will not link when CONFIG_PTP_1588_CLOCK=n. It might be possible to break this dependency and expose those functions without CONFIG_PTP_1588_CLOCK, but that is not clear to me. For the DPLL case, simply compile ice_dpll.o only when we have CONFIG_PTP_1588_CLOCK. Add stub no-op implementation of ice_dpll_init() and ice_dpll_uninit() when CONFIG_PTP_1588_CLOCK=n into ice_dpll.h The other functions are part of checking the netlist to see if hardware features are enabled. These checks don't really belong in ice_ptp_hw.c, and make more sense as part of the ice_common.c file. We already have ice_is_gps_in_netlist() in ice_common.c which is doing a similar check. Move the functions into ice_common.c and rename them to have the similar postfix of "in_netlist()" to be more expressive of what they are actually checking. This also makes the ice_find_netlist_node only called from within ice_common.c, so its safe to mark it static and stop declaring it in the ice_common.h header as well. Fixes: 8a3a565ff210 ("ice: add admin commands to access cgu configuration") Fixes: d7999f5ea64b ("ice: implement dpll interface to control cgu") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309191214.TaYEct4H-lkp@intel.com Signed-off-by: Jacob Keller Reviewed-by: Przemek Kitszel Signed-off-by: Tony Nguyen Reviewed-by: Simon Horman Tested-by: Simon Horman # build-tested Link: https://lore.kernel.org/r/20231002185132.1575271-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 01a99a750a4f414c221781de2e5570e0ceae04b5 Author: Li zeming Date: Wed Jul 26 03:50:47 2023 +0800 futex/requeue: Remove unnecessary ‘NULL’ initialization from futex_proxy_trylock_atomic() 'top_waiter' is assigned unconditionally before first use, so it does not need an initialization. [ mingo: Created legible changelog. ] Signed-off-by: Li zeming Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230725195047.3106-1-zeming@nfschina.com commit 07f9cfe2ef6c086a3760430d7c0a224584d495a4 Author: Imre Deak Date: Fri Sep 29 18:49:29 2023 +0300 drm/i915/dp_mst: Make sure pbn_div is up-to-date after sink reconnect Atm the MST encoder config computation may use an out-of-date pbn_div value, if the sink is unplugged and a sink is replugged with different link rate/lane count capabilities. The current way of reinitializing pbn_div depends on pbn_div getting cleared via intel_atomic_check() -> drm_dp_mst_atomic_check() -> drm_dp_mst_atomic_check_payload_alloc_limits(), however the clearing won't happen if the sink got unplugged (and hence drm_dp_mst_topology_mgr::mst_state being false). To fix the above, simply update pbn_div unconditionally during config computation, making pbn_div always match the link rate and lane count. Cc: Lyude Paul Reviewed-by: Lyude Paul Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230929154929.343947-1-imre.deak@intel.com commit a9930e85290ef0a3ebefc90b30638722db3a947c Author: Frederic Weisbecker Date: Fri Sep 8 22:36:02 2023 +0200 rcu: Remove references to rcu_migrate_callbacks() from diagrams This function is gone since: 53b46303da84 (rcu: Remove rsp parameter from rcu_boot_init_percpu_data() and friends) Reviewed-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit c964c1f5ee96e1460606d44f80a47bdacd8fe568 Author: Frederic Weisbecker Date: Fri Sep 8 22:35:59 2023 +0200 rcu: Assume rcu_report_dead() is always called locally rcu_report_dead() has to be called locally by the CPU that is going to exit the RCU state machine. Passing a cpu argument here is error-prone and leaves the possibility for a racy remote call. Use local access instead. Reviewed-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 358662a9616c5078dc4d389d6bceeb5974f4aa97 Author: Frederic Weisbecker Date: Fri Sep 8 22:35:58 2023 +0200 rcu: Assume IRQS disabled from rcu_report_dead() rcu_report_dead() is the last RCU word from the CPU down through the hotplug path. It is called in the idle loop right before the CPU shuts down for good. Because it removes the CPU from the grace period state machine and reports an ultimate quiescent state if necessary, no further use of RCU is allowed. Therefore it is expected that IRQs are disabled upon calling this function and are not to be re-enabled again until the CPU shuts down. Remove the IRQs disablement from that function and verify instead that it is actually called with IRQs disabled as it is expected at that special point in the idle path. Reviewed-by: Joel Fernandes (Google) Reviewed-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit cf37c0979e558213e2a2f87c2c3dfe644a66b210 Author: Niko Tsirakis Date: Mon Oct 2 20:47:09 2023 +0000 drm/i915/display/lspcon: Increase LSPCON mode settle timeout This is to eliminate all cases of "*ERROR* LSPCON mode hasn't settled", followed by link training errors. Intel engineers recommended increasing this timeout and that does resolve the issue. On some CometLake-based device designs the Parade PS175 takes more than 400ms to settle in PCON mode. 100 reboot trials on one device resulted in a median settle time of 440ms and a maximum of 444ms. Even after increasing the timeout to 500ms, 2% of devices still had this error. So this increases the timeout to 800ms. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9443 Signed-off-by: Pablo Ceballos Signed-off-by: Niko Tsirakis Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20231002204709.761089-1-ntsirakis@google.com commit 7df2a2a024145d0dcc1e51dc378c527000b35b07 Author: Frederic Weisbecker Date: Fri Sep 8 22:35:54 2023 +0200 rcu: Use rcu_segcblist_segempty() instead of open coding it This makes the code more readable. Reviewed-by: Qiuxu Zhuo Reviewed-by: Joel Fernandes (Google) Reviewed-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 5f98fd034ca6fd1ab8c91a3488968a0e9caaabf6 Author: Catalin Marinas Date: Sat Sep 30 17:46:56 2023 +0000 rcu: kmemleak: Ignore kmemleak false positives when RCU-freeing objects Since the actual slab freeing is deferred when calling kvfree_rcu(), so is the kmemleak_free() callback informing kmemleak of the object deletion. From the perspective of the kvfree_rcu() caller, the object is freed and it may remove any references to it. Since kmemleak does not scan RCU internal data storing the pointer, it will report such objects as leaks during the grace period. Tell kmemleak to ignore such objects on the kvfree_call_rcu() path. Note that the tiny RCU implementation does not have such issue since the objects can be tracked from the rcu_ctrlblk structure. Signed-off-by: Catalin Marinas Reported-by: Christoph Paasch Closes: https://lore.kernel.org/all/F903A825-F05F-4B77-A2B5-7356282FBA2C@apple.com/ Cc: Tested-by: Christoph Paasch Reviewed-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) Signed-off-by: Frederic Weisbecker commit 14aebb78b994fd307ec26f82f9f8ccea2a12c6a1 Author: Jani Nikula Date: Mon Oct 2 11:47:04 2023 +0300 drm/i915/gt: remove i915->gt0 in favour of i915->gt[0] Since gt0 == i915->gt[0], just drop the former. Signed-off-by: Jani Nikula Reviewed-by: Gustavo Sousa Reviewed-by: Andi Shyti Acked-by: Michał Winiarski Link: https://patchwork.freedesktop.org/patch/msgid/5319364f4c9416fed218382d020a57c5b0a17bee.1696236329.git.jani.nikula@intel.com commit 39fa9a7d5fb7d8316b9c7c56a1f8e473008244e8 Author: Jani Nikula Date: Mon Oct 2 11:47:03 2023 +0300 drm/i915: allocate i915->gt0 dynamically Convert i915->gt0 to a pointer, and allocate it dynamically. Signed-off-by: Jani Nikula Reviewed-by: Gustavo Sousa Reviewed-by: Andi Shyti Acked-by: Michał Winiarski Link: https://patchwork.freedesktop.org/patch/msgid/01bf968aa431b77d491790178cbeece18b5fc4c0.1696236329.git.jani.nikula@intel.com commit 5ed8c7bcf9a58372d3be3d9cd167e45497efaae2 Author: Jani Nikula Date: Mon Oct 2 11:47:02 2023 +0300 drm/i915/mocs: use to_gt() instead of direct &i915->gt Have to give up the const on i915 pointer, but it's not big of a deal considering non-const i915 gets passed all over the place. Signed-off-by: Jani Nikula Reviewed-by: Gustavo Sousa Reviewed-by: Andi Shyti Acked-by: Michał Winiarski Link: https://patchwork.freedesktop.org/patch/msgid/63e644f056c7745eb0e8e165c990c392a38ec85c.1696236329.git.jani.nikula@intel.com commit c98a0a83dccd19283da34a298876d26c7f06750f Author: Simon Trimmer Date: Wed Oct 4 15:42:03 2023 +0100 ASoC: cs35l56: Initialise a variable to silence possible static analysis error read_poll_timeout() is a macro and val will be populated before use, however some static analysis tools treat it as a function and warn of uninitialised variable usage. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20231004144203.151775-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 7824a88b4286980512de2a46763646100274a5ac Merge: 25591b66d0a4f caacbdc28f545 Author: Jani Nikula Date: Wed Oct 4 18:06:27 2023 +0300 Merge drm/drm-next into drm-intel-next Backmerge to sync up with drm-intel-gt-next and drm-misc-next. Signed-off-by: Jani Nikula commit 05d9ea1ceb62a55af6727a69269a4fd310edf483 Author: Manas Ghandat Date: Wed Oct 4 13:10:40 2023 +0530 jfs: fix array-index-out-of-bounds in diAlloc Currently there is not check against the agno of the iag while allocating new inodes to avoid fragmentation problem. Added the check which is required. Reported-by: syzbot+79d792676d8ac050949f@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=79d792676d8ac050949f Signed-off-by: Manas Ghandat Signed-off-by: Dave Kleikamp commit 22cad8bc1d36547cdae0eef316c47d917ce3147c Author: Manas Ghandat Date: Wed Oct 4 11:17:18 2023 +0530 jfs: fix array-index-out-of-bounds in dbFindLeaf Currently while searching for dmtree_t for sufficient free blocks there is an array out of bounds while getting element in tp->dm_stree. To add the required check for out of bound we first need to determine the type of dmtree. Thus added an extra parameter to dbFindLeaf so that the type of tree can be determined and the required check can be applied. Reported-by: syzbot+aea1ad91e854d0a83e04@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=aea1ad91e854d0a83e04 Signed-off-by: Manas Ghandat Signed-off-by: Dave Kleikamp commit a31281acc4a4e051a0bf2f1d3556ba4deea4d2a0 Author: Jan Höppner Date: Fri Sep 15 15:10:01 2023 +0200 partitions/ibm: Introduce defines for magic string length values The length values for volume label type and volume label id are hard-coded in several places. Provide defines for those values and replace all occurrences accordingly. Note that the length is defined and used, and not the size since the volume label type string and volume label id string are not nul-terminated. Signed-off-by: Jan Höppner Reviewed-by: Stefan Haberland Signed-off-by: Stefan Haberland Link: https://lore.kernel.org/r/20230915131001.697070-4-sth@linux.ibm.com Signed-off-by: Jens Axboe commit f5f43aae6f336ae436759144a31879375e65ed28 Author: Jan Höppner Date: Fri Sep 15 15:10:00 2023 +0200 partitions/ibm: Replace strncpy() and improve readability strncpy() is deprecated and needs to be replaced. The volume label information strings are not nul-terminated and strncpy() can simply be replaced with memcpy(). To enhance the readability of find_label() alongside this change, the following improvements are made: - Introduce the array dasd_vollabels[] containing all information necessary for the label detection. - Provide a helper function to obtain an index value corresponding to a volume label type. This allows the use of a switch statement to reduce indentation levels. - The 'temp' variable is used to check against valid volume label types. In the good case, this variable already contains the volume label type making it unnecessary to copy the information again from e.g. label->vol.vollbl. Remove the 'temp' variable and the second copy as all information are already provided. - Remove the 'found' variable and replace it with early returns Signed-off-by: Jan Höppner Reviewed-by: Stefan Haberland Signed-off-by: Stefan Haberland Link: https://lore.kernel.org/r/20230915131001.697070-3-sth@linux.ibm.com Signed-off-by: Jens Axboe commit d323c1a9477a82843795f10fb23f1634cea44007 Author: Jan Höppner Date: Fri Sep 15 15:09:59 2023 +0200 partitions/ibm: Remove unnecessary memset The data holding the volume label information is zeroed in case no valid volume label was found. Since the label information isn't used in that case, zeroing the data doesn't provide any value whatsoever. Remove the unnecessary memset() call accordingly. Signed-off-by: Jan Höppner Reviewed-by: Stefan Haberland Signed-off-by: Stefan Haberland Link: https://lore.kernel.org/r/20230915131001.697070-2-sth@linux.ibm.com Signed-off-by: Jens Axboe commit 90a6c030f506585f484a9804aafe29cb42b93697 Author: Li Zetao Date: Thu Aug 3 11:32:35 2023 +0800 dmaengine: xilinx: xdma: Use resource_size() in xdma_probe() There is a warning reported by coccinelle: ./drivers/dma/xilinx/xdma.c:888:22-25: ERROR: Missing resource_size with res Use resource_size() on resource object instead of explicit computation. Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230803033235.3049137-1-lizetao1@huawei.com Signed-off-by: Vinod Koul commit a1cb2ffe5fe59b0f5612e5e9148c5311c32f311c Author: Li Zetao Date: Fri Aug 4 18:02:45 2023 +0800 dmaengine: fsl-dpaa2-qdma: Remove redundant initialization owner in dpaa2_qdma_driver The fsl_mc_driver_register() will set "THIS_MODULE" to driver.owner when register a fsl_mc_driver driver, so it is redundant initialization to set driver.owner in dpaa2_qdma_driver statement. Remove it for clean code. Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230804100245.100068-1-lizetao1@huawei.com Signed-off-by: Vinod Koul commit 09361abc346102c505657db4f3ae19ed70e1b703 Author: Yue Haibing Date: Wed Aug 9 16:00:12 2023 +0800 dmaengine: Remove unused declaration dma_chan_cleanup() Commit f27c580c3628 ("dmaengine: remove 'bigref' infrastructure") removed the implementation but left declaration in place. Remove it. Signed-off-by: Yue Haibing Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230809080012.22000-1-yuehaibing@huawei.com Signed-off-by: Vinod Koul commit 094f9ee5fb547c31486801a017a07d7f1c1e7881 Author: Krzysztof Kozlowski Date: Thu Aug 10 12:00:00 2023 +0200 dmaengine: mmp: fix Wvoid-pointer-to-enum-cast warning 'type' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: mmp_tdma.c:649:10: error: cast to smaller integer type 'enum mmp_tdma_type' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230810100000.123515-2-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 9a2136b60cc1a5ba9c5878f08a41f41271c4cd17 Author: Krzysztof Kozlowski Date: Thu Aug 10 11:59:59 2023 +0200 dmaengine: qcom: fix Wvoid-pointer-to-enum-cast warning 'cap' is an enum, thus cast of pointer on 64-bit compile test with W=1 causes: hidma.c:748:8: error: cast to smaller integer type 'enum hidma_cap' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230810100000.123515-1-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 00d589ace5f4edae7d5e5e5d0727196c8d681363 Author: Hugo Villeneuve Date: Mon Oct 2 14:38:12 2023 -0400 dt-bindings: writing-schema: add example for multiple DT_SCHEMA_FILES Variable DT_SCHEMA_FILES can specify multiple files or patterns, but the documentation does not indicate how to do it. Each entry needs to be separated by a column symbol ':'. Add an example to make it more obvious how to specify multiple DT_SCHEMA_FILES. Signed-off-by: Hugo Villeneuve Link: https://lore.kernel.org/r/20231002183813.1702052-1-hugo@hugovil.com Signed-off-by: Rob Herring commit 25591b66d0a4f9277241cebe1a74b4f985bc27a9 Author: Ville Syrjälä Date: Tue Oct 3 23:06:20 2023 +0300 drm/i915: s/dev_priv/i915/ in the shared_dpll code Do a s/dev_priv/i915/ pass over the shared_dpll code to get the variable names into sync with modern standards. v2: Rebase Reviewed-by: Jani Nikula #v1 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231003200620.11633-5-ville.syrjala@linux.intel.com commit 88ba97688a03843755803bfc28b975ae27d533d1 Author: Jinjie Ruan Date: Fri Sep 1 15:11:14 2023 +0800 dmaengine: fsl-edma: Remove redundant dev_err() for platform_get_irq() Since commit 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()") and commit 2043727c2882 ("driver core: platform: Make use of the helper function dev_err_probe()"), there is no need to call the dev_err() function directly to print a custom message when handling an error from platform_get_irq() function as it is going to display an appropriate error message in case of a failure. Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support") Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230901071115.1322000-1-ruanjinjie@huawei.com Signed-off-by: Vinod Koul commit 51d3e62927193c101e02ad3ef114dbcd8f49b34a Author: Ville Syrjälä Date: Tue Oct 3 23:06:19 2023 +0300 drm/i915: Introduce for_each_shared_dpll() No one really cares how we store the shared_dplls. Currently it happens to be an array, but we could change that to a more flexible scheme at some point. Hide the implementation details behind an iterator macro. The slight downside is the pll variable moving out of the loop scope, but maybe someday soon we'll start to convert everything over to having declarations within for-statements... Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231003200620.11633-4-ville.syrjala@linux.intel.com commit 99e5a010e8153bf2454ceefe725fea5de72e7d64 Author: Ville Syrjälä Date: Tue Oct 3 23:06:18 2023 +0300 drm/i915: Decouple I915_NUM_PLLS from PLL IDs Stop assuming the size of PLL ID based bitmask is restricted to I915_NUM_PLLS bits. This is the last thing coupling the two things together and thus artificially limiting PLL IDs. We could just pass any arbitrary (large enough) size to for_each_set_bit() and be done with it, but the WARN requiring the caller to not pass in a bogus bitmask seems potentially useful to keep around. So let's just calculate the full bitmask on the spot. And while at it let's assert that the PLL IDs will fit into the bitmask we use for them. TODO: could also get rid of I915_NUM_PLLS entirely and just dynamically allocate i915->shared_dplls[] and state->shared_dpll[]. But that would involve error handling in the modeset init path. Uff. v2: Warn about conflicting PLL IDs (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231003200620.11633-3-ville.syrjala@linux.intel.com commit 027c57017795de145b8800f00665aae9a313ab26 Author: Ville Syrjälä Date: Tue Oct 3 23:06:17 2023 +0300 drm/i915: Stop requiring PLL index == PLL ID There's no good reason to keep around this PLL index == PLL ID footgun. Get rid of it. Both i915->shared_dplls[] and state->shared_dpll[] are indexed by the same thing now, which is just the index we get at initialization from dpll_mgr->dpll_info[]. The rest is all about PLL IDs now. v2: Add pll->index to mimic drm_crtc & co. Remove the comment saying ID should match the index v3: s/i/pll->index/ in debugfs loop (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20231003200620.11633-2-ville.syrjala@linux.intel.com commit 93fb2776f43e3834796218ed77b237f85fdd10a9 Merge: 2147c8d07e1ab 6d198a89c0047 Author: Daniel Borkmann Date: Wed Oct 4 15:26:02 2023 +0200 Merge branch 'bpf-xsk-sh-umem' Tushar Vyavahare says: ==================== Implement a test for the SHARED_UMEM feature in this patch set and make necessary changes/improvements. Ensure that the framework now supports different streams for different sockets. v2->v3: - Set the sock_num at the end of the while loop. - Declare xsk at the top of the while loop. v1->v2: - Remove generate_mac_addresses() and generate mac addresses based on the number of sockets in __test_spec_init() function. [Magnus] - Update Makefile to include find_bit.c for compiling xskxceiver. - Add bitmap_full() function to verify all bits are set to break the while loop in the receive_pkts() and send_pkts() functions. - Replace __test_and_set_bit() function with __set_bit() function. - Add single return check for wait_for_tx_completion() function call. Patch series summary: 1: Move the packet stream from the ifobject struct to the xsk_socket_info struct to enable the use of different streams for different sockets This will facilitate the sending and receiving of data from multiple sockets simultaneously using the SHARED_XDP_UMEM feature. It gives flexibility of send/recive individual traffic on particular socket. 2: Rename the header file to a generic name so that it can be used by all future XDP programs. 3: Move the src_mac and dst_mac fields from the ifobject structure to the xsk_socket_info structure to achieve per-socket MAC address assignment. Require this in order to steer traffic to various sockets in subsequent patches. 4: Improve the receive_pkt() function to enable it to receive packets from multiple sockets. Define a sock_num variable to iterate through all the sockets in the Rx path. Add nb_valid_entries to check that all the expected number of packets are received. 5: The pkt_set() function no longer needs the umem parameter. This commit removes the umem parameter from the pkt_set() function. 6: Iterate over all the sockets in the send pkts function. Update send_pkts() to handle multiple sockets for sending packets. Multiple TX sockets are utilized alternately based on the batch size for improve packet transmission. 7: Modify xsk_update_xskmap() to accept the index as an argument, enabling the addition of multiple sockets to xskmap. 8: Add a new test for testing shared umem feature. This is accomplished by adding a new XDP program and using the multiple sockets. The new XDP program redirects the packets based on the destination MAC address. ==================== Signed-off-by: Daniel Borkmann commit 6d198a89c004723d9d2fff469fdcb1074c9642d6 Author: Tushar Vyavahare Date: Wed Sep 27 19:22:41 2023 +0530 selftests/xsk: Add a test for shared umem feature Add a new test for testing shared umem feature. This is accomplished by adding a new XDP program and using the multiple sockets. The new XDP program redirects the packets based on the destination MAC address. Signed-off-by: Tushar Vyavahare Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20230927135241.2287547-9-tushar.vyavahare@intel.com commit fc2cb86495da6b67518bedbf1a2d49af220d1521 Author: Tushar Vyavahare Date: Wed Sep 27 19:22:40 2023 +0530 selftests/xsk: Modify xsk_update_xskmap() to accept the index as an argument Modify xsk_update_xskmap() to accept the index as an argument, enabling the addition of multiple sockets to xskmap. Signed-off-by: Tushar Vyavahare Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20230927135241.2287547-8-tushar.vyavahare@intel.com commit fd0815ae9b8aa136c11dfa040740ca035e4602c0 Author: Tushar Vyavahare Date: Wed Sep 27 19:22:39 2023 +0530 selftests/xsk: Iterate over all the sockets in the send pkts function Update send_pkts() to handle multiple sockets for sending packets. Multiple TX sockets are utilized alternately based on the batch size for improve packet transmission. Signed-off-by: Tushar Vyavahare Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20230927135241.2287547-7-tushar.vyavahare@intel.com commit 46e43786cc60b5816a71e1ff6244d91618f01d90 Author: Tushar Vyavahare Date: Wed Sep 27 19:22:38 2023 +0530 selftests/xsk: Remove unnecessary parameter from pkt_set() function call The pkt_set() function no longer needs the umem parameter. This commit removes the umem parameter from the pkt_set() function. Signed-off-by: Tushar Vyavahare Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20230927135241.2287547-6-tushar.vyavahare@intel.com commit 8913e653e9b8e08f15c2c25d1b7a6d897350985b Author: Tushar Vyavahare Date: Wed Sep 27 19:22:37 2023 +0530 selftests/xsk: Iterate over all the sockets in the receive pkts function Improve the receive_pkt() function to enable it to receive packets from multiple sockets. Define a sock_num variable to iterate through all the sockets in the Rx path. Add nb_valid_entries to check that all the expected number of packets are received. Revise the function __receive_pkts() to only inspect the receive ring once, handle any received packets, and promptly return. Implement a bitmap to store the value of number of sockets. Update Makefile to include find_bit.c for compiling xskxceiver. Signed-off-by: Tushar Vyavahare Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20230927135241.2287547-5-tushar.vyavahare@intel.com commit 985fd2145a2932c9d7bda219271e3f453d4607ef Author: Tushar Vyavahare Date: Wed Sep 27 19:22:36 2023 +0530 selftests/xsk: Move src_mac and dst_mac to the xsk_socket_info Move the src_mac and dst_mac fields from the ifobject structure to the xsk_socket_info structure to achieve per-socket MAC address assignment. Require this in order to steer traffic to various sockets in subsequent patches. Signed-off-by: Tushar Vyavahare Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20230927135241.2287547-4-tushar.vyavahare@intel.com commit 93ba112479070d9cd2445640b60f414178c3914c Author: Tushar Vyavahare Date: Wed Sep 27 19:22:35 2023 +0530 selftests/xsk: Rename xsk_xdp_metadata.h to xsk_xdp_common.h Rename the header file to a generic name so that it can be used by all future XDP programs. Ensure that the xsk_xdp_common.h header file includes include guards. Signed-off-by: Tushar Vyavahare Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20230927135241.2287547-3-tushar.vyavahare@intel.com commit 8367eb954e24f0842e42c0b21ddb4513e0e9a235 Author: Tushar Vyavahare Date: Wed Sep 27 19:22:34 2023 +0530 selftests/xsk: Move pkt_stream to the xsk_socket_info Move the packet stream from the ifobject struct to the xsk_socket_info struct to enable the use of different streams for different sockets. This will facilitate the sending and receiving of data from multiple sockets simultaneously using the SHARED_XDP_UMEM feature. Signed-off-by: Tushar Vyavahare Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20230927135241.2287547-2-tushar.vyavahare@intel.com commit 2838820800dcaa60f32bef715c7e2e87e049aebc Author: Peng Fan Date: Tue Sep 12 17:19:05 2023 +0800 clk: imx: imx8qm/qxp: add more resources to whitelist Add CAN_1/2 support for i.MX8QM Add M4_0, PI_0_PWM_0 and PI_0_I2C_0 for i.MX8QXP Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230912-imx8-clk-v1-v1-7-69a34bcfcae1@nxp.com Signed-off-by: Abel Vesa commit eaefd1cf36a6507ff7dd2d30f68201de259eec63 Author: Peng Fan Date: Tue Sep 12 17:19:04 2023 +0800 clk: imx: scu: ignore clks not owned by Cortex-A partition Not register clks that not owned to current partition. CPU resources are specical resources, it is assigned in ATF, not non-secure OS, but we still need to allow cpu freq, so return true for non-secure OS for cpu resources. Otherwise there will be error log if the resources are owned by current partition: [ 19.387291] cm40_i2c_div: failed to attached the power domain -2 [ 19.389305] cm40_lpuart_div: failed to attached the power domain -2 Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230912-imx8-clk-v1-v1-6-69a34bcfcae1@nxp.com Signed-off-by: Abel Vesa commit a699148b8704aa11600321b9f6b6b21f09418c42 Author: Peng Fan Date: Tue Sep 12 17:19:03 2023 +0800 clk: imx8: remove MLB support MLB was de-featured, so drop MLB clk for i.MX8QM/QXP/DXL Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230912-imx8-clk-v1-v1-5-69a34bcfcae1@nxp.com Signed-off-by: Abel Vesa commit 4fcb51fb0e3084ee81edaf8aea98ac01e456a871 Author: Peng Fan Date: Tue Sep 12 17:19:02 2023 +0800 clk: imx: imx8qm-rsrc: drop VPU_UART/VPUCORE IMX_SC_R_VPU_UART and IMX_SC_R_VPUCORE was used in i.MX8QM A0 which not for mass production. i.MX8QM B0 not have the two resources, so drop it. Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230912-imx8-clk-v1-v1-4-69a34bcfcae1@nxp.com Signed-off-by: Abel Vesa commit 8568b3c499268456b76cdc2e9e1b9d86d8b08837 Author: Shenwei Wang Date: Tue Sep 12 17:19:01 2023 +0800 clk: imx: imx8qxp: correct the enet clocks for i.MX8DXL The SC_PM_CLK_MISC0 clock is not available for the resources of ENET0/1 on i.MX8DXL. Using the clock device compatible string to identify the platform and only initialize the enetX_rgmii_rx_clk clock for non i.MX8DXL platform. Signed-off-by: Shenwei Wang Reviewed-by: Ranjani Vaidyanathan Reviewed-by: Jacky Bai Acked-by: Jason Liu Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230912-imx8-clk-v1-v1-3-69a34bcfcae1@nxp.com Signed-off-by: Abel Vesa commit 15cee75dacb82ade710d61bfd536011933ef9bf2 Author: Robert Chiras Date: Tue Sep 12 17:19:00 2023 +0800 clk: imx: imx8qxp: Fix elcdif_pll clock Move the elcdif_pll clock initialization before the lcd_clk, since the elcdif_clk needs to be initialized ahead of lcd_clk, being its parent. This change fixes issues with the LCD clocks during suspend/resume. Fixes: babfaa9556d7 ("clk: imx: scu: add more scu clocks") Suggested-by: Ranjani Vaidyanathan Acked-by: Laurentiu Palcu Signed-off-by: Robert Chiras Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230912-imx8-clk-v1-v1-2-69a34bcfcae1@nxp.com Signed-off-by: Abel Vesa commit ab2c30f6bbe34dbf13ff2cc0cf7bc237de2df013 Author: Viorel Suman Date: Tue Sep 12 17:18:59 2023 +0800 clk: imx: imx8dxl-rsrc: keep sorted in the ascending order Entries in imx8dxl_clk_scu_rsrc_table must be kept in the ascending order, and IMX_SC_R_M4_0_UART < IMX_SC_R_M4_0_I2C. Fixes: 036a4b4b4dfa ("clk: imx: Add imx8dxl clk driver") Signed-off-by: Viorel Suman Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230912-imx8-clk-v1-v1-1-69a34bcfcae1@nxp.com Signed-off-by: Abel Vesa commit 0a22b3a6f446223aff5bcdcc06003ef6e412bfd8 Author: Fabio Estevam Date: Tue Aug 15 10:09:23 2023 -0300 clk: imx: imx6sx: Allow a different LCDIF1 clock parent It is not a good idea to hardcode the LCDIF1 parent inside the clock driver because some users may want to use a different clock parent for LCDIF1. One of the reasons could be related to EMI tests. Remove the harcoded LCDIF1 parent when the LCDIF1 parent is described via devicetree. Old dtb's that do not describe the LCDIF1 parent via devicetree will use the same PLL5 clock as parent to keep the original behavior. Signed-off-by: Fabio Estevam Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230815130923.775117-1-festevam@gmail.com Signed-off-by: Abel Vesa commit 80e698e2df5ba2124bdeca37f1e589de58a4d514 Author: Kees Cook Date: Tue Oct 3 16:28:53 2023 -0700 ASoC: soc-dapm: Annotate struct snd_soc_dapm_widget_list with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct snd_soc_dapm_widget_list. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: "Gustavo A. R. Silva" Cc: alsa-devel@alsa-project.org Cc: linux-hardening@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20231003232852.work.257-kees@kernel.org Signed-off-by: Mark Brown commit 0c42fc96cc020b7879b38c8e8597ffbbf34e0eda Author: Bartosz Golaszewski Date: Tue Sep 5 20:53:03 2023 +0200 arm: omap1: ams-delta: stop using gpiochip_find() gpiochip_find() is going away as it's not hot-unplug safe. This platform is not affected by any of the related problems as this GPIO controller cannot really go away but in order to finally remove this function, we need to convert it to using gpio_device_find() as well. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Acked-by: Janusz Krzysztofik Acked-by: Tony Lindgren commit 7691ba064b71ffa03bbaefcb2af7ec1e2131eeed Author: Linus Walleij Date: Mon Oct 2 10:12:47 2023 +0200 gpio: Further document optional GPIOLIB Optional GPIOLIB as in not depended on or selected by a driver should NOT use any *_optional() calls, this becomes paradoxical. Signed-off-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit e404b0cc9f0b0b551f3276a814d38abf1f26d98f Author: Bartosz Golaszewski Date: Wed Sep 27 16:29:31 2023 +0200 gpio: sysfs: drop the mention of gpiochip_find() from sysfs code We have removed all callers of gpiochip_find() so don't mention it in gpiolib-sysfs.c. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij commit b7b56e64a345e738eda17352f735f1e5af287862 Author: Bartosz Golaszewski Date: Wed Sep 27 16:29:30 2023 +0200 gpio: swnode: replace gpiochip_find() with gpio_device_find_by_label() We're porting all users of gpiochip_find() to using gpio_device_find(). Update the swnode GPIO code. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij commit 3c9d5431b40701e35e8af470d6a3e9babe44ffef Author: Bartosz Golaszewski Date: Wed Sep 27 16:29:29 2023 +0200 gpio: acpi: replace gpiochip_find() with gpio_device_find() We're porting all users of gpiochip_find() to using gpio_device_find(). Update the ACPI GPIO code. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Reviewed-by: Mika Westerberg commit 0f21c53c28639c5c69ad01cebfc4be7b2805703a Author: Bartosz Golaszewski Date: Wed Sep 27 16:29:28 2023 +0200 gpio: of: replace gpiochip_find_* with gpio_device_find_* We're porting all users of gpiochip_find() to using gpio_device_find(). Update the OF GPIO code. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij commit db5469604464af0bb6d6da9da090494812d4ef32 Author: Bartosz Golaszewski Date: Wed Sep 27 16:29:27 2023 +0200 gpiolib: replace find_chip_by_name() with gpio_device_find_by_label() Remove all remaining uses of find_chip_by_name() (and subsequently: gpiochip_find()) from gpiolib.c and use the new gpio_device_find_by_label() instead. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij commit 9b418780844c677669ab474f6f29940ef545c954 Author: Bartosz Golaszewski Date: Wed Sep 27 16:29:26 2023 +0200 gpiolib: reluctantly provide gpio_device_get_chip() The process of converting all unauthorized users of struct gpio_chip to using dedicated struct gpio_device function will be long so in the meantime we must provide a way of retrieving the pointer to struct gpio_chip from a GPIO device. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij commit 93548f8bbbbf5b62dbd37c8f61a037a06666787b Author: Bartosz Golaszewski Date: Wed Sep 27 16:29:25 2023 +0200 gpiolib: provide gpio_device_get_desc() Getting the GPIO descriptor directly from the gpio_chip struct is dangerous as we don't take the reference to the underlying GPIO device. In order to start working towards removing gpiochip_get_desc(), let's provide a safer variant that works with an existing reference to struct gpio_device. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij commit d62fcd9f1897d587f8f9db3f77ccae8797a44b5d Author: Bartosz Golaszewski Date: Wed Sep 27 16:29:24 2023 +0200 gpiolib: provide gpio_device_find_by_label() By far the most common way of looking up GPIO devices is using their label. Provide a helpers for that to avoid every user implementing their own matching function. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij commit cfe102f63308c8c8e01199a682868a64b83f653e Author: Bartosz Golaszewski Date: Wed Sep 27 16:29:23 2023 +0200 gpiolib: provide gpio_device_find() gpiochip_find() is wrong and its kernel doc is misleading as the function doesn't return a reference to the gpio_chip but just a raw pointer. The chip itself is not guaranteed to stay alive, in fact it can be deleted at any point. Also: other than GPIO drivers themselves, nobody else has any business accessing gpio_chip structs. Provide a new gpio_device_find() function that returns a real reference to the opaque gpio_device structure that is guaranteed to stay alive for as long as there are active users of it. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij commit 9e4555d1e54a18946d7ca363b9fc8ed1fe7dfde4 Author: Bartosz Golaszewski Date: Wed Sep 27 16:29:22 2023 +0200 gpiolib: add support for scope-based management to gpio_device As the few users that need to get the reference to the GPIO device often release it right after inspecting its properties, let's add support for the automatic reference release to struct gpio_device. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko commit 36aa129f221c9070afd8dff03154ab49702a5b1b Author: Bartosz Golaszewski Date: Wed Sep 27 16:29:21 2023 +0200 gpiolib: make gpio_device_get() and gpio_device_put() public In order to start migrating away from accessing struct gpio_chip by users other than their owners, let's first make the reference management functions for the opaque struct gpio_device public in the driver.h header. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko commit 407c0ad5b19a477ff974a1c8007c00f01e7d04b5 Author: Adrián Larumbe Date: Fri Sep 29 19:14:31 2023 +0100 drm/panfrost: Implement generic DRM object RSS reporting function BO's RSS is updated every time new pages are allocated on demand and mapped for the object at GPU page fault's IRQ handler, but only for heap buffers. The reason this is unnecessary for non-heap buffers is that they are mapped onto the GPU's VA space and backed by physical memory in their entirety at BO creation time. This calculation is unnecessary for imported PRIME objects, since heap buffers cannot be exported by our driver, and the actual BO RSS size is the one reported in its attached dmabuf structure. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Boris Brezillon Link: https://patchwork.freedesktop.org/patch/msgid/20230929181616.2769345-6-adrian.larumbe@collabora.com commit 553c84892bac704e1a7999b7db7e67640a31a4fa Author: Adrián Larumbe Date: Fri Sep 29 19:14:30 2023 +0100 drm/drm_file: Add DRM obj's RSS reporting function for fdinfo Some BO's might be mapped onto physical memory chunkwise and on demand, like Panfrost's tiler heap. In this case, even though the drm_gem_shmem_object page array might already be allocated, only a very small fraction of the BO is currently backed by system memory, but drm_show_memory_stats will then proceed to add its entire virtual size to the file's total resident size regardless. This led to very unrealistic RSS sizes being reckoned for Panfrost, where said tiler heap buffer is initially allocated with a virtual size of 128 MiB, but only a small part of it will eventually be backed by system memory after successive GPU page faults. Provide a new DRM object generic function that would allow drivers to return a more accurate RSS and purgeable sizes for their BOs. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Rob Clark Signed-off-by: Boris Brezillon Link: https://patchwork.freedesktop.org/patch/msgid/20230929181616.2769345-5-adrian.larumbe@collabora.com commit 9ccdac7aa822f0468893e161c1a311674667da1b Author: Adrián Larumbe Date: Fri Sep 29 19:14:29 2023 +0100 drm/panfrost: Add fdinfo support for memory stats A new DRM GEM object function is added so that drm_show_memory_stats can provide more accurate memory usage numbers. Ideally, in panfrost_gem_status, the BO's purgeable flag would be checked after locking the driver's shrinker mutex, but drm_show_memory_stats takes over the drm file's object handle database spinlock, so there's potential for a race condition here. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Boris Brezillon Link: https://patchwork.freedesktop.org/patch/msgid/20230929181616.2769345-4-adrian.larumbe@collabora.com commit f11b0417eec21ade937da866363433cc0b8b396c Author: Adrián Larumbe Date: Fri Sep 29 19:14:28 2023 +0100 drm/panfrost: Add fdinfo support GPU load metrics The drm-stats fdinfo tags made available to user space are drm-engine, drm-cycles, drm-max-freq and drm-curfreq, one per job slot. This deviates from standard practice in other DRM drivers, where a single set of key:value pairs is provided for the whole render engine. However, Panfrost has separate queues for fragment and vertex/tiler jobs, so a decision was made to calculate bus cycles and workload times separately. Maximum operating frequency is calculated at devfreq initialisation time. Current frequency is made available to user space because nvtop uses it when performing engine usage calculations. It is important to bear in mind that both GPU cycle and kernel time numbers provided are at best rough estimations, and always reported in excess from the actual figure because of two reasons: - Excess time because of the delay between the end of a job processing, the subsequent job IRQ and the actual time of the sample. - Time spent in the engine queue waiting for the GPU to pick up the next job. To avoid race conditions during enablement/disabling, a reference counting mechanism was introduced, and a job flag that tells us whether a given job increased the refcount. This is necessary, because user space can toggle cycle counting through a debugfs file, and a given job might have been in flight by the time cycle counting was disabled. The main goal of the debugfs cycle counter knob is letting tools like nvtop or IGT's gputop switch it at any time, to avoid power waste in case no engine usage measuring is necessary. Also add a documentation file explaining the possible values for fdinfo's engine keystrings and Panfrost-specific drm-curfreq- pairs. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Boris Brezillon Link: https://patchwork.freedesktop.org/patch/msgid/20230929181616.2769345-3-adrian.larumbe@collabora.com commit 51dcc15b5b0fb548c47cf5188f88d86fe79312bd Author: Adrián Larumbe Date: Fri Sep 29 19:14:27 2023 +0100 drm/panfrost: Add cycle count GPU register definitions These GPU registers will be used when programming the cycle counter, which we need for providing accurate fdinfo drm-cycles values to user space. Signed-off-by: Adrián Larumbe Reviewed-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Boris Brezillon Link: https://patchwork.freedesktop.org/patch/msgid/20230929181616.2769345-2-adrian.larumbe@collabora.com commit dd8bb80308c474ea0e7ddb244962cb2d7001bae2 Author: Jiapeng Chong Date: Fri Aug 25 14:46:56 2023 +0800 can: raw: Remove NULL check before dev_{put, hold} The call netdev_{put, hold} of dev_{put, hold} will check NULL, so there is no need to check before using dev_{put, hold}, remove it to silence the warning: ./net/can/raw.c:497:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6231 Signed-off-by: Jiapeng Chong Reported-by: Simon Horman Acked-by: Oliver Hartkopp Link: https://lore.kernel.org/all/20230825064656.87751-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Marc Kleine-Budde commit 20767b235da13cd2905afbec37e6019c13456360 Merge: 20f7cce7cf180 cbdbf0aa41ba6 Author: David S. Miller Date: Wed Oct 4 11:23:02 2023 +0100 Merge branch 'bnxt_en-hwmon-SRIOV' Michael Chan says: ==================== bnxt_en: hwmon and SRIOV updates The first 7 patches are v2 of the hwmon patches posted about 6 weeks ago on Aug 14. The last 2 patches are SRIOV related updates. Link to v1 hwmon patches: https://lore.kernel.org/netdev/20230815045658.80494-11-michael.chan@broadcom.com/ ==================== Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit cbdbf0aa41ba696269ca41def7aa5fc54ede5dca Author: Vikas Gupta Date: Tue Sep 26 20:57:34 2023 -0700 bnxt_en: Update VNIC resource calculation for VFs Newer versions of firmware will pre-reserve 1 VNIC for every possible PF and VF function. Update the driver logic to take this into account when assigning VNICs to the VFs. These pre-reserved VNICs for the inactive VFs should be subtracted from the global pool before assigning them to the active VFs. Not doing so may cause discrepancies that ultimately may cause some VFs to have insufficient VNICs to support features such as aRFS. Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit e76d44fe722761f5480b908e38c5ce1a2c2cb6d6 Author: Sreekanth Reddy Date: Tue Sep 26 20:57:33 2023 -0700 bnxt_en: Support QOS and TPID settings for the SRIOV VLAN Add these missing settings in the .ndo_set_vf_vlan() method. Older firmware does not support the TPID setting so check for proper support. Remove the unused BNXT_VF_QOS flag. Signed-off-by: Sreekanth Reddy Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit a19b4801457b0806c0153dc344f548c6f8615896 Author: Kalesh AP Date: Tue Sep 26 20:57:32 2023 -0700 bnxt_en: Event handler for Thermal event Newer FW will send a new async event when it detects that the chip's temperature has crossed the configured threshold value. The driver will now notify hwmon and will log a warning message. Link: https://lore.kernel.org/netdev/20230815045658.80494-13-michael.chan@broadcom.com/ Cc: Jean Delvare Cc: Guenter Roeck Cc: linux-hwmon@vger.kernel.org Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Acked-by: Guenter Roeck Signed-off-by: David S. Miller commit 3d9cf962067bef73757f987e3b30928b036499d8 Author: Kalesh AP Date: Tue Sep 26 20:57:31 2023 -0700 bnxt_en: Use non-standard attribute to expose shutdown temperature Implement the sysfs attributes directly in the driver for shutdown threshold temperature and pass an extra attribute group to the hwmon core when registering the hwmon device. Link: https://lore.kernel.org/netdev/20230815045658.80494-12-michael.chan@broadcom.com/ Cc: Jean Delvare Cc: Guenter Roeck Cc: linux-hwmon@vger.kernel.org Reviewed-by: Andy Gospodarek Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit cd13244f19eb4cf6f6fd4150fa7d05f435a78d0f Author: Kalesh AP Date: Tue Sep 26 20:57:30 2023 -0700 bnxt_en: Expose threshold temperatures through hwmon HWRM_TEMP_MONITOR_QUERY response now indicates various threshold temperatures. Expose these threshold temperatures through the hwmon sysfs using this mapping: hwmon_temp_max : bp->warn_thresh_temp hwmon_temp_crit : bp->crit_thresh_temp hwmon_temp_emergency : bp->fatal_thresh_temp hwmon_temp_max_alarm : temp >= bp->warn_thresh_temp hwmon_temp_crit_alarm : temp >= bp->crit_thresh_temp hwmon_temp_emergency_alarm : temp >= bp->fatal_thresh_temp Link: https://lore.kernel.org/netdev/20230815045658.80494-12-michael.chan@broadcom.com/ Cc: Jean Delvare Cc: Guenter Roeck Cc: linux-hwmon@vger.kernel.org Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Acked-by: Guenter Roeck Signed-off-by: David S. Miller commit 847da8b1178c9a3ccfc86e72a5a0433509e32802 Author: Kalesh AP Date: Tue Sep 26 20:57:29 2023 -0700 bnxt_en: Modify the driver to use hwmon_device_register_with_info The use of hwmon_device_register_with_groups() is deprecated. Modified the driver to use hwmon_device_register_with_info(). Driver currently exports only temp1_input through hwmon sysfs interface. But FW has been modified to report more threshold temperatures and driver want to report them through the hwmon interface. Cc: Jean Delvare Cc: Guenter Roeck Cc: linux-hwmon@vger.kernel.org Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Acked-by: Guenter Roeck Signed-off-by: David S. Miller commit a47f3b3992aa7666227e2e48d45fd6b8bc8053be Author: Kalesh AP Date: Tue Sep 26 20:57:28 2023 -0700 bnxt_en: Move hwmon functions into a dedicated file This is in preparation for upcoming patches in the series. Driver has to expose more threshold temperatures through the hwmon sysfs interface. More code will be added and do not want to overload bnxt.c. Reviewed-by: Andy Gospodarek Cc: Jean Delvare Cc: Guenter Roeck Cc: linux-hwmon@vger.kernel.org Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Acked-by: Guenter Roeck Signed-off-by: David S. Miller commit 6ad71984aa6bb29813c80a7d5c4993966553a431 Author: Kalesh AP Date: Tue Sep 26 20:57:27 2023 -0700 bnxt_en: Enhance hwmon temperature reporting Driver currently does hwmon device register and unregister in open and close() respectively. As a result, user will not be able to query hwmon temperature when interface is in ifdown state. Enhance it by moving the hwmon register/unregister to the probe/remove functions. Reviewed-by: Somnath Kotur Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 754fbf604ff6aa10a68a2dbf292da3e4cbc52c2e Author: Michael Chan Date: Tue Sep 26 20:57:26 2023 -0700 bnxt_en: Update firmware interface to 1.10.2.171 The main changes are the additional thermal thresholds in hwrm_temp_monitor_query_output and the new async event to report thermal errors. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 2806d74deb42f7a253a40d032153c628f37c19ce Merge: e36c56bf77d53 4f8005092cafc Author: Marc Kleine-Budde Date: Wed Oct 4 11:46:27 2023 +0200 Merge patch series "can: etas_es58x: clean-up of new GCC W=1 and old checkpatch warnings" Vincent Mailhol says: The kernel recently added new warnings, one of which triggers a known false positive on the etas_es58x module. In an effort to keep es58x_etas free of any W=12 (excluding those produced by foreign headers), add a workaround to silence it. While at it, this series also fix a checkpatch warning which I knew existed for a long time but was too lazy to tackle. v2 -> v3: * if the parsing of one of the version/revision numbers fail, es58x_parse_product_info() immediately returns. If this occurs early, the other version/revision numbers would still be set to zero (which is now considered a valid version number). Set the version and revision to an invalid number before starting the parsing so that everything is set even if an early return occurs. v1 -> v2: * v1 had two different check logics for the version numbers: - check that none of the sub-version number are zero to make sure the parsing succeeded - check that all of the sub-version number fit the expected digit range to please GCC. v2 simplifies things by merging those two logics together. Link: https://lore.kernel.org/all/20230924110914.183898-1-mailhol.vincent@wanadoo.fr [mkl: fixed typos] Signed-off-by: Marc Kleine-Budde commit 4f8005092cafc194ba6a8e5f39626ba0b9f08271 Author: Vincent Mailhol Date: Sun Sep 24 20:06:48 2023 +0900 can: etas_es58x: add missing a blank line after declaration Fix below checkpatch warning: WARNING: Missing a blank line after declarations #2233: FILE: drivers/net/can/usb/etas_es58x/es58x_core.c:2233: + int ret = es58x_init_netdev(es58x_dev, ch_idx); + if (ret) { Fixes: d8f26fd689dd ("can: etas_es58x: remove es58x_get_product_info()") Signed-off-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230924110914.183898-3-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde commit 107e6f6fe6f38577baecf0e01f517c8607a3a625 Author: Vincent Mailhol Date: Sun Sep 24 20:06:47 2023 +0900 can: etas_es58x: rework the version check logic to silence -Wformat-truncation Following [1], es58x_devlink.c now triggers the following format-truncation GCC warnings: drivers/net/can/usb/etas_es58x/es58x_devlink.c: In function ‘es58x_devlink_info_get’: drivers/net/can/usb/etas_es58x/es58x_devlink.c:201:41: warning: ‘%02u’ directive output may be truncated writing between 2 and 3 bytes into a region of size between 1 and 3 [-Wformat-truncation=] 201 | snprintf(buf, sizeof(buf), "%02u.%02u.%02u", | ^~~~ drivers/net/can/usb/etas_es58x/es58x_devlink.c:201:30: note: directive argument in the range [0, 255] 201 | snprintf(buf, sizeof(buf), "%02u.%02u.%02u", | ^~~~~~~~~~~~~~~~ drivers/net/can/usb/etas_es58x/es58x_devlink.c:201:3: note: ‘snprintf’ output between 9 and 12 bytes into a destination of size 9 201 | snprintf(buf, sizeof(buf), "%02u.%02u.%02u", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 202 | fw_ver->major, fw_ver->minor, fw_ver->revision); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/can/usb/etas_es58x/es58x_devlink.c:211:41: warning: ‘%02u’ directive output may be truncated writing between 2 and 3 bytes into a region of size between 1 and 3 [-Wformat-truncation=] 211 | snprintf(buf, sizeof(buf), "%02u.%02u.%02u", | ^~~~ drivers/net/can/usb/etas_es58x/es58x_devlink.c:211:30: note: directive argument in the range [0, 255] 211 | snprintf(buf, sizeof(buf), "%02u.%02u.%02u", | ^~~~~~~~~~~~~~~~ drivers/net/can/usb/etas_es58x/es58x_devlink.c:211:3: note: ‘snprintf’ output between 9 and 12 bytes into a destination of size 9 211 | snprintf(buf, sizeof(buf), "%02u.%02u.%02u", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 212 | bl_ver->major, bl_ver->minor, bl_ver->revision); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/can/usb/etas_es58x/es58x_devlink.c:221:38: warning: ‘%03u’ directive output may be truncated writing between 3 and 5 bytes into a region of size between 2 and 4 [-Wformat-truncation=] 221 | snprintf(buf, sizeof(buf), "%c%03u/%03u", | ^~~~ drivers/net/can/usb/etas_es58x/es58x_devlink.c:221:30: note: directive argument in the range [0, 65535] 221 | snprintf(buf, sizeof(buf), "%c%03u/%03u", | ^~~~~~~~~~~~~ drivers/net/can/usb/etas_es58x/es58x_devlink.c:221:3: note: ‘snprintf’ output between 9 and 13 bytes into a destination of size 9 221 | snprintf(buf, sizeof(buf), "%c%03u/%03u", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 222 | hw_rev->letter, hw_rev->major, hw_rev->minor); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is not an actual bug because the sscanf() parsing makes sure that the u8 are only two digits long and the u16 only three digits long. Thus below declaration: char buf[max(sizeof("xx.xx.xx"), sizeof("axxx/xxx"))]; allocates just what is needed to represent either of the versions. This warning was known but ignored because, at the time of writing, -Wformat-truncation was not present in the kernel, not even at W=3 [2]. One way to silence this warning is to check the range of all sub version numbers are valid: [0, 99] for u8 and range [0, 999] for u16. The module already has a logic which considers that when all the sub version numbers are zero, the version number is not set. Note that not having access to the device specification, this was an arbitrary decision. This logic can thus be removed in favor of global check that would cover both cases: - the version number is not set (parsing failed) - the version number is not valid (paranoiac check to please gcc) Before starting to parse the product info string, set the version sub-numbers to the maximum unsigned integer thus violating the definitions of struct es58x_sw_version or struct es58x_hw_revision. Then, rework the es58x_sw_version_is_set() and es58x_hw_revision_is_set() functions: remove the check that the sub-numbers are non zero and replace it by a check that they fit in the expected number of digits. This done, rename the functions to reflect the change and rewrite the documentation. While doing so, also add a description of the return value. Finally, the previous version only checked that &es58x_hw_revision.letter was not the null character. Replace this check by an alphanumeric character check to make sure that we never return a special character or a non-printable one and update the documentation of struct es58x_hw_revision accordingly. All those extra checks are paranoid but have the merit to silence the newly introduced W=1 format-truncation warning [1]. [1] commit 6d4ab2e97dcf ("extrawarn: enable format and stringop overflow warnings in W=1") Link: https://git.kernel.org/torvalds/c/6d4ab2e97dcf [2] https://lore.kernel.org/all/CAMZ6Rq+K+6gbaZ35SOJcR9qQaTJ7KR0jW=XoDKFkobjhj8CHhw@mail.gmail.com/ Reported-by: Marc Kleine-Budde Closes: https://lore.kernel.org/linux-can/20230914-carrousel-wrecker-720a08e173e9-mkl@pengutronix.de/ Fixes: 9f06631c3f1f ("can: etas_es58x: export product information through devlink_ops::info_get()") Signed-off-by: Vincent Mailhol Link: https://lore.kernel.org/all/20230924110914.183898-2-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde commit e36c56bf77d53f649de7d6bfc6d87539ea4b7549 Author: Miquel Raynal Date: Fri Sep 22 17:51:30 2023 +0200 can: sja1000: Fix comment There is likely a copy-paste error here, as the exact same comment appears below in this function, one time calling set_reset_mode(), the other set_normal_mode(). Fixes: 429da1cc841b ("can: Driver for the SJA1000 CAN controller") Signed-off-by: Miquel Raynal Reviewed-by: Simon Horman Link: https://lore.kernel.org/all/20230922155130.592187-1-miquel.raynal@bootlin.com Signed-off-by: Marc Kleine-Budde commit 74d885711c2f619e92f41ef308691948cc63f224 Author: Kees Cook Date: Thu Sep 28 16:43:42 2023 -0700 dmaengine: ep93xx_dma: Annotate struct ep93xx_dma_engine with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ep93xx_dma_engine. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Cc: dmaengine@vger.kernel.org Cc: llvm@lists.linux.dev Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230928234334.work.391-kees@kernel.org Signed-off-by: Vinod Koul commit 079d0b01bc5943dd19c7cb8fa9a99976217cc4c6 Author: Jani Nikula Date: Tue Oct 3 15:42:10 2023 +0300 drm/i915: separate subplatform init and runtime feature init Adjusting ->port_mask does not belong in intel_device_info_subplatform_init(), but rather intel_display_device_info_runtime_init(). Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/1035800e623e13d5e7baf1215b07e7cdad5eb764.1696336887.git.jani.nikula@intel.com commit b8eed6a4aee4f85ed0465b233b63e2b233a420b9 Author: Jani Nikula Date: Tue Oct 3 15:42:09 2023 +0300 drm/i915: separate display runtime info init Move display related functionality from intel_device_info_runtime_init() to intel_display_device_info_runtime_init() and call the latter from the top level. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/a2226a47a4450e75d867c2ac48665b387af0e42d.1696336887.git.jani.nikula@intel.com commit 5e72e75d30fcff599e306fc9987eed8639c4a84a Author: Jani Nikula Date: Tue Oct 3 15:42:08 2023 +0300 drm/i915: move display info related macros to display Anything looking at display (runtime) info should be under display. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/41b53870ffa7bd41ccc337616c756c69326f05cf.1696336887.git.jani.nikula@intel.com commit fe63ea7c3dbb68a4a8f43a175c76e435b6ffb4ca Author: Jani Nikula Date: Tue Oct 3 15:42:07 2023 +0300 drm/i915: convert INTEL_DISPLAY_ENABLED() into a function There's no need for this to be a macro. Add some documentation too. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/480b9b697b2ffa0c8677115bd443ba633801c6c1.1696336887.git.jani.nikula@intel.com commit 5e0eb67974e88dbaded765278a3ffe7af33e3b22 Author: Uros Bizjak Date: Mon Jul 31 10:42:23 2023 +0200 locking/local, arch: Rewrite local_add_unless() as a static inline function Rewrite local_add_unless() as a static inline function with boolean return value, similar to the arch_atomic_add_unless() arch fallbacks. The function is currently unused. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230731084458.28096-1-ubizjak@gmail.com commit 968118fcf0546ef74cf306bf8f8c1e06efff10e3 Author: Linus Walleij Date: Tue Sep 12 10:44:52 2023 +0200 OMAP/gpio: drop MPUIO static base The OMAP GPIO driver hardcodes the MPIO chip base, but there is no point: we have already moved all consumers over to using descriptor look-ups. Drop the MPUIO GPIO base and use dynamic assignment. Root out the unused instances of the OMAP_MPUIO() macro and delete the unused OMAP_GPIO_IS_MPUIO() macro. Signed-off-by: Linus Walleij Reviewed-by: Tony Lindgren Tested-by: Janusz Krzysztofik Signed-off-by: Bartosz Golaszewski commit 8df012a7f513141412b3c35af204ccdb810fcc81 Author: Srinivas Pandruvada Date: Mon Sep 25 12:42:19 2023 -0700 platform/x86/intel/tpmi: Add debugfs support for read/write blocked Display read and write blocked status of each TPMI feature in addition to disabled and locked status. This will require reading of read/write blocked state from the hardware. Currently tpmi_read_feature_status(), doesn't provide this state. Define TPMI feature state as defined in the TPMI spec. Modify the function tpmi_read_feature_status() to update full feature state instead of just disabled and locked state. Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20230925194219.966602-1-srinivas.pandruvada@linux.intel.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 577ad169966e6e75b10e004389a3f79813e84b5d Author: Peng Fan Date: Sun Oct 1 20:26:18 2023 +0800 clk: imx: imx8mq: correct error handling path Avoid memory leak in error handling path. It does not make much sense for the SoC without clk driver, to make program behavior correct, let's fix it. Fixes: b80522040cd3 ("clk: imx: Add clock driver for i.MX8MQ CCM") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202309240551.e46NllPa-lkp@intel.com/ Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20231001122618.194498-1-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa commit 05eeeff22b216e871be76dcf216a2fdda48880e2 Author: Adam Ford Date: Wed Aug 30 23:44:31 2023 -0500 clk: imx8mp: Remove non-existent IMX8MP_CLK_AUDIOMIX_PDM_ROOT The TRM shows there is only one AUDIOMIX PDM Root Clock Select register, and it's called IMX8MP_CLK_AUDIOMIX_PDM_SEL. That selector doesn't appear to have any more children and the MICFIL driver can reference IMX8MP_CLK_AUDIOMIX_PDM_SEL directly without the need for any other. Remove this errant clock, since it doesn't really exist. Signed-off-by: Adam Ford Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230831044431.250338-3-aford173@gmail.com Signed-off-by: Abel Vesa commit 3af29a89de2c6e49737a1201b7d6fd5ad3f635a4 Author: Christophe JAILLET Date: Thu Sep 14 22:31:06 2023 +0200 clk: imx: imx8: Simplify clk_imx_acm_detach_pm_domains() The return value of clk_imx_acm_detach_pm_domains() is never used. Simplify the code and turn it into a void function. Reviewed-by: Peng Fan Signed-off-by: Christophe JAILLET Signed-off-by: Abel Vesa commit ef23d44b7fcbd19773dcedcb50ca2f625107604f Author: Christophe JAILLET Date: Thu Sep 14 22:31:05 2023 +0200 clk: imx: imx8: Add a message in case of devm_clk_hw_register_mux_parent_data_table() error If devm_clk_hw_register_mux_parent_data_table() fails, we branch to the error handling path and imx_check_clk_hws() is never called. Actually, imx_check_clk_hws() is a no-op because values in 'hws' are either valid, either NULL. Move the call to imx_check_clk_hws() in the error handling path, so that an error is logged. Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver") Reviewed-by: Peng Fan Signed-off-by: Christophe JAILLET Signed-off-by: Abel Vesa commit e9a164e367f039629fd5466a79b9f495646e1261 Author: Christophe JAILLET Date: Thu Sep 14 22:31:04 2023 +0200 clk: imx: imx8: Fix an error handling path in imx8_acm_clk_probe() If an error occurs after a successful clk_imx_acm_attach_pm_domains() call, it must be undone. Add an explicit error handling path, re-order the code and add the missing clk_imx_acm_detach_pm_domains() call. Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver") Reviewed-by: Peng Fan Signed-off-by: Christophe JAILLET Signed-off-by: Abel Vesa commit 9a0108acdb1b6189dcc8f9318edfc6b7e0281df4 Author: Christophe JAILLET Date: Thu Sep 14 22:31:03 2023 +0200 clk: imx: imx8: Fix an error handling path if devm_clk_hw_register_mux_parent_data_table() fails If a devm_clk_hw_register_mux_parent_data_table() call fails, it is likely that the probe should fail with an error code. Set 'ret' before leaving the function. Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver") Reviewed-by: Peng Fan Signed-off-by: Christophe JAILLET Signed-off-by: Abel Vesa commit 156624e2cf815ce98fad5a24f04370f4459ae6f4 Author: Christophe JAILLET Date: Thu Sep 14 22:31:02 2023 +0200 clk: imx: imx8: Fix an error handling path in clk_imx_acm_attach_pm_domains() If a dev_pm_domain_attach_by_id() call fails, previously allocated resources need to be released. Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver") Reviewed-by: Peng Fan Signed-off-by: Christophe JAILLET Signed-off-by: Abel Vesa commit 317e69c49b4ceef8aebb47d771498ccb3571bdf9 Author: Abel Vesa Date: Thu Sep 21 12:23:54 2023 +0300 clk: imx: Select MXC_CLK for CLK_IMX8QXP If the i.MX8QXP clock provider is built-in but the MXC_CLK is built as module, build fails: aarch64-linux-ld: drivers/clk/imx/clk-imx8-acm.o: in function `imx8_acm_clk_probe': clk-imx8-acm.c:(.text+0x3d0): undefined reference to `imx_check_clk_hws' Fix that by selecting MXC_CLK in case of CLK_IMX8QXP. Fixes: c2cccb6d0b33 ("clk: imx: add imx8qxp clk driver") Closes: https://lore.kernel.org/all/8b77219e-b59e-40f1-96f1-980a0b2debcf@infradead.org/ Reported-by: Randy Dunlap Reviewed-by: Peng Fan Acked-by: Randy Dunlap Tested-by: Randy Dunlap Signed-off-by: Abel Vesa commit 4b0d9c8f8f55562ed5346723e66eec64f22887f4 Author: Srinivas Pandruvada Date: Tue Oct 3 11:49:16 2023 -0700 platform/x86/intel-uncore-freq: Ignore minor version change The hardware definition of every TPMI feature contains a major and minor version. When there is a change in the MMIO offset or change in the definition of a field, hardware will change major version. For addition of new fields without modifying existing MMIO offsets or fields, only the minor version is changed. Driver is developed to support uncore frequency control (UFS) for a major and minor version. If the hardware changes major version, since offsets and definitions are changed, driver cannot continue to provide UFS interface to users. Driver can still function with minor version change as it will just miss the new functionality added by the hardware. The current implementation logs information message and skips adding uncore sysfs entry for a resource for any version mismatch. Check major and minor version mismatch for every valid resource and fail on any major version mismatch by logging an error message. A valid resource has a version which is not 0xFF. If there is mismatch with the minor version, continue with a log message. Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20231003184916.1860084-4-srinivas.pandruvada@linux.intel.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 07510a59b316445311775ee53adf10448140607a Author: Srinivas Pandruvada Date: Tue Oct 3 11:49:15 2023 -0700 platform/x86: ISST: Ignore minor version change The hardware definition of every TPMI feature contains a major and minor version. When there is a change in the MMIO offset or change in the definition of a field, hardware will change major version. For addition of new fields without modifying existing MMIO offsets or fields, only the minor version is changed. Driver is developed to support SST functionality for a major and minor version. If the hardware changes major version, since offsets and definitions are changed, driver cannot continue to provide SST interface to users. Driver can still function with a minor version change as it will just miss the new functionality added by the hardware. The current implementation doesn't ignore any version change. If there is mismatch with the minor version, continue with an information log message. If there is mismatch with the major version, log error and exit. Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20231003184916.1860084-3-srinivas.pandruvada@linux.intel.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 8874e414fe78718d0f2861fe511cecbd1cd73f4d Author: Srinivas Pandruvada Date: Tue Oct 3 11:49:14 2023 -0700 platform/x86/intel/tpmi: Add defines to get version information Add defines to get major and minor version from a TPMI version field value. This will avoid code duplication to convert in every feature driver. Also add define for invalid version field. Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20231003184916.1860084-2-srinivas.pandruvada@linux.intel.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 23f392ea6d1916f68be8067e2a038ef9a746a94b Author: Srinivas Pandruvada Date: Tue Oct 3 09:32:34 2023 -0700 platform/x86: intel_speed_select_if: Use devm_ioremap_resource Replace devm_ioremap() with devm_ioremap_resource() by defining a resource. Signed-off-by: Srinivas Pandruvada Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20231003163234.1856669-5-srinivas.pandruvada@linux.intel.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 7525cea3ef9384054a30f25ebb501234befecdcb Author: Srinivas Pandruvada Date: Tue Oct 3 09:32:33 2023 -0700 platform/x86: intel_speed_select_if: Remove hardcoded map size The driver is using 256 as the size while calling devm_ioremap(). The maximum offset can be obtained from isst_mmio_range. Add a field "size" to the isst_mmio_range and use it instead of hardcoding. No functional impact is expected. Signed-off-by: Srinivas Pandruvada Reviewed-by: Andy Shevchenko Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20231003163234.1856669-4-srinivas.pandruvada@linux.intel.com Signed-off-by: Ilpo Järvinen commit a22d36eb5b150913325640cb793e13e08d1bd715 Author: Srinivas Pandruvada Date: Tue Oct 3 09:32:32 2023 -0700 platform/x86: ISST: Allow level 0 to be not present It is possible that SST level 0 or base level is not present in some configurations. So don't set level 0 mask in level_en_mask by default. Signed-off-by: Srinivas Pandruvada Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20231003163234.1856669-3-srinivas.pandruvada@linux.intel.com Signed-off-by: Ilpo Järvinen commit da4082841ccf022beae73e63d3f476f59777172b Author: Srinivas Pandruvada Date: Tue Oct 3 09:32:31 2023 -0700 platform/x86: ISST: Use fuse enabled mask instead of allowed levels Allowed level mask is a mask of levels, which are currently allowed to dynamically switch by the OS. Fused mask is a mask of all levels even if OS is not allowed to switch. Even if OS is not allowed to dynamically switch, it is still possible for user to boot to a level by using BIOS option. To decide which level to boot next time, user wants to check parameters (power, performance or thermal) of that level to decide. So, when passing the level mask for display to user space, use fuse enabled mask, which has all levels. Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20231003163234.1856669-2-srinivas.pandruvada@linux.intel.com Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit c9babd5d95abf3fae6e798605ce5cac98e08daf9 Author: Justin Stitt Date: Tue Oct 3 21:54:59 2023 +0000 x86/tdx: Replace deprecated strncpy() with strtomem_pad() strncpy() works perfectly here in all cases, however, it is deprecated and as such we should prefer more robust and less ambiguous string APIs: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings Let's use strtomem_pad() as this matches the functionality of strncpy() and is _not_ deprecated. Signed-off-by: Justin Stitt Signed-off-by: Ingo Molnar Reviewed-by: Kees Cook Acked-by: Dave Hansen Link: https://github.com/KSPP/linux/issues/90 Link: https://lore.kernel.org/r/20231003-strncpy-arch-x86-coco-tdx-tdx-c-v2-1-0bd21174a217@google.com commit 7af1e0aceeb321cbc90fcf6fa0bec8870290377f Author: Dave Jiang Date: Fri Sep 8 13:10:45 2023 -0700 dmaengine: idxd: add wq driver name support for accel-config user tool With the possibility of multiple wq drivers that can be bound to the wq, the user config tool accel-config needs a way to know which wq driver to bind to the wq. Introduce per wq driver_name sysfs attribute where the user can indicate the driver to be bound to the wq. This allows accel-config to just bind to the driver using wq->driver_name. Signed-off-by: Dave Jiang Signed-off-by: Tom Zanussi Reviewed-by: Fenghua Yu Acked-by: Vinod Koul Link: https://lore.kernel.org/r/20230908201045.4115614-1-fenghua.yu@intel.com Signed-off-by: Vinod Koul commit 20f7cce7cf18020cd2b052a6441a7d1623f0e352 Author: Lukas Bulwahn Date: Mon Sep 25 07:43:05 2023 +0200 MAINTAINERS: adjust header file entry in DPLL SUBSYSTEM Commit 9431063ad323 ("dpll: core: Add DPLL framework base functions") adds the section DPLL SUBSYSTEM in MAINTAINERS and includes a file entry to the non-existing file 'include/net/dpll.h'. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Looking at the file stat of the commit above, this entry clearly intended to refer to 'include/linux/dpll.h'. Adjust this header file entry in DPLL SUBSYSTEM. Signed-off-by: Lukas Bulwahn Reviewed-by: Vadim Fedorenko Signed-off-by: David S. Miller commit c223bafdcbd51506df00509088efc62e08ef6c3f Author: Kees Cook Date: Tue Oct 3 16:27:56 2023 -0700 dmaengine: fsl-edma: Annotate struct struct fsl_edma_engine with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct struct fsl_edma_engine. Cc: Vinod Koul Cc: dmaengine@vger.kernel.org Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1] Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20231003232704.work.596-kees@kernel.org Signed-off-by: Vinod Koul commit 03cf2af41b37daa96635a31a012b86d0053e0670 Author: Greg Kroah-Hartman Date: Wed Oct 4 08:42:13 2023 +0200 Revert "phy: qcom-qmp-usb: Add Qualcomm SDX75 USB3 PHY support" This reverts commit 685dbd1b2306c9fe1ffc150f81b3ac11b1e1bc9e. It is reported to break the build in linux-next so revert it for now. Reported-by: Stephen Rothwell Link: https://lore.kernel.org/r/20231004132247.01c3bfeb@canb.auug.org.au Cc: Rohit Agarwal Cc: Dmitry Baryshkov Signed-off-by: Greg Kroah-Hartman commit 389af786f92ecdff35883551d54bf4e507ffcccb Merge: caacbdc28f545 3570bd989acc6 Author: Dave Airlie Date: Wed Oct 4 13:55:19 2023 +1000 Merge tag 'drm-intel-next-2023-09-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 feature pull for v6.7: Features and functionality: - Early Xe2 LPD / Lunarlake (LNL) display enabling (Lucas, Matt, Gustavo, Stanislav, Luca, Clint, Juha-Pekka, Balasubramani, Ravi) - Plenty of various DSC improvements and fixes (Ankit) - Add DSC PPS state readout and verification (Suraj) - Improve fastsets for VRR, LRR and M/N updates (Ville) - Use connector->ddc to create (non-DP MST) connector sysfs ddc symlinks (Ville) - Various DSB improvements, load LUTs using DSB (Ville) - Improve shared link bandwidth management, starting with FDI (Imre) - Optimize get param ioctl for PXP status (Alan) - Remove DG2 pre-production hardware workarounds (Matt) - Add more RPL P/U PCI IDs (Dnyaneshwar) - Add new DG2-G12 stepping (Swati) - Add PSR sink error status to debugfs (Jouni) - Add DP enhanced framing to crtc state checker (Ville) Refactoring and cleanups: - Simplify TileY/Tile4 tiling selftest enumeration (Matt) - Remove some unused power domain code (Gustavo) - Check stepping of display IP version rather than MTL platform (Matt) - DP audio compute config cleanups (Vinod) - SDVO cleanups and refactoring, more robust failure handling (Ville) - Color register definition and readout cleanups (Jani) - Reduce header interdependencies for frontbuffer tracking (Jani) - Continue replacing struct edid with struct drm_edid (Jani) - Use source physical address instead of EDID for CEC (Jani) - Clean up Type-C port lane count functions (Luca) - Clean up DSC PPS register definitions and readout (Jani) - Stop using GEM_BUG_ON()/GEM_WARN_ON() in display code (Jani) - Move more of the display probe to display code (Jani) - Remove redundant runtime suspended state flag (Jouni) - Move display info printing to display code (Balasubramani) - Frontbuffer tracking improvements (Jouni) - Add trailing newlines to debug logging (Jim Cromie) - Separate display workarounds from clock gating init (Matt) - Reduce dmesg log spamming for combo PHY, PLL state, FEC, DP MST (Ville, Imre) Fixes: - Fix hotplug poll detect loops via suspend/resume (Imre) - Fix hotplug detect for forced connectors (Imre) - Fix DSC first_line_bpg_offset calculation (Suraj) - Fix debug prints for SDP CRC16 (Arun) - Fix PXP runtime resume (Alan) - Fix cx0 PHY lane handling (Gustavo) - Fix frontbuffer tracking locking in debugfs (Juha-Pekka) - Fix SDVO detect on some models (Ville) - Fix SDP split configuration for DP MST (Vinod) - Fix AUX usage and reads for HDCP on DP MST (Suraj) - Fix PSR workaround (Jouni) - Fix redundant AUX power get/put in DP force (Imre) - Fix ICL DSI TCLK POST by letting hardware handle it (William) - Fix IRQ reset for XE LP+ (Gustavo) - Fix h/vsync_end instead of h/vtotal in VBT (Ville) - Fix C20 PHY msgbus timeout issues (Gustavo) - Fix pre-TGL FEC pipe A vs. DDI A mixup (Ville) - Fix FEC state readout for DP MST (Ville) DRM subsystem core changes: - Assume sink supports 8 bpc when DSC is supported (Ankit) - Add drm_edid_is_digital() helper (Jani) - Parse source physical address from EDID (Jani) - Add function to attach CEC without EDID (Jani) - Reorder connector sysfs/debugfs remove (Ville) - Register connector sysfs ddc symlink later (Ville) Media subsystem changes: - Add comments about CEC source physical address usage (Jani) Merges: - Backmerge drm-next to get v6.6-rc1 (Jani) Signed-off-by: Dave Airlie # Conflicts: # drivers/gpu/drm/i915/i915_drv.h From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87r0mhi7a6.fsf@intel.com commit 2f3dd39e2b492bec366487a2c9bcbdbd7792f77c Author: Stephen Boyd Date: Mon Oct 2 17:34:28 2023 -0700 platform/chrome: cros_ec_proto: Mark outdata as const The 'outdata' is copied to the data buffer in cros_ec_cmd() before being sent over to the EC. Mark the argument as const so that callers can pass const pointers to this function and so that callers know the data won't be modified. Cc: Prashant Malani Signed-off-by: Stephen Boyd Acked-by: Prashant Malani Link: https://lore.kernel.org/r/20231003003429.1378109-5-swboyd@chromium.org Signed-off-by: Tzung-Bi Shih commit 14e7c01cc3494b75c3ff1d099a2f5f76b1fcb01d Author: Stephen Boyd Date: Mon Oct 2 17:34:27 2023 -0700 platform/chrome: cros_typec_vdm: Mark port_amode_ops const Mark this struct of functions const so it moves to RO memory. Cc: Prashant Malani Signed-off-by: Stephen Boyd Acked-by: Prashant Malani Link: https://lore.kernel.org/r/20231003003429.1378109-4-swboyd@chromium.org Signed-off-by: Tzung-Bi Shih commit 2b055bf8ac8492111a62177764e54e0d2614c6b8 Author: Stephen Boyd Date: Mon Oct 2 17:34:26 2023 -0700 platform/chrome: cros_ec_typec: Use dev_err_probe() more There's some debug prints here that can be upgraded to dev_err_probe() so that we don't have to fish out the error messages when a true error happens. If they're simply probe defers then the kernel will keep silent but if they're true errors we'll see the errors in the logs. Cc: Prashant Malani Signed-off-by: Stephen Boyd Acked-by: Prashant Malani Link: https://lore.kernel.org/r/20231003003429.1378109-3-swboyd@chromium.org Signed-off-by: Tzung-Bi Shih commit a88f6ef679579256ec9561fb1359332df5eaa94d Author: Stephen Boyd Date: Mon Oct 2 17:34:25 2023 -0700 platform/chrome: cros_ec_typec: Use semi-colons instead of commas These should be semi-colons so that one statement is per line. Cc: Prashant Malani Signed-off-by: Stephen Boyd Acked-by: Prashant Malani Link: https://lore.kernel.org/r/20231003003429.1378109-2-swboyd@chromium.org Signed-off-by: Tzung-Bi Shih commit 553e41d1bc95a09e32b6beb0a2b1c20dc4ea9b19 Author: Greg Ungerer Date: Wed Sep 27 23:29:33 2023 +1000 binfmt_elf_fdpic: clean up debug warnings The binfmt_elf_fdpic loader has some debug trace that can be enabled at build time. The recent 64-bit additions cause some warnings if that debug is enabled, such as: fs/binfmt_elf_fdpic.c: In function ‘elf_fdpic_map_file’: fs/binfmt_elf_fdpic.c:46:33: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘Elf64_Addr’ {aka ‘long long unsigned int’} [-Wformat=] 46 | #define kdebug(fmt, ...) printk("FDPIC "fmt"\n" ,##__VA_ARGS__ ) | ^~~~~~~~ ./include/linux/printk.h:427:25: note: in definition of macro ‘printk_index_wrap’ 427 | _p_func(_fmt, ##__VA_ARGS__); \ | ^~~~ Cast values to the largest possible type (which is equivilent to unsigned long long in this case) and use appropriate format specifiers to match. Fixes: b922bf04d2c1 ("binfmt_elf_fdpic: support 64-bit systems") Signed-off-by: Greg Ungerer Link: https://lore.kernel.org/r/20230927132933.3290734-1-gerg@kernel.org Signed-off-by: Kees Cook commit 2632bb84d1d53cfd6cf65261064273ded4f759d5 Author: Kees Cook Date: Thu Sep 28 20:24:34 2023 -0700 mm: Remove unused vm_brk() With fs/binfmt_elf.c fully refactored to use the new elf_load() helper, there are no more users of vm_brk(), so remove it. Cc: Andrew Morton Cc: linux-mm@kvack.org Suggested-by: Eric Biederman Tested-by: Pedro Falcato Signed-off-by: Sebastian Ott Link: https://lore.kernel.org/r/20230929032435.2391507-6-keescook@chromium.org Signed-off-by: Kees Cook commit f9c0a39d95301a36baacfd3495374c6128d662fa Author: Kees Cook Date: Thu Sep 28 20:24:33 2023 -0700 binfmt_elf: Only report padzero() errors when PROT_WRITE Errors with padzero() should be caught unless we're expecting a pathological (non-writable) segment. Report -EFAULT only when PROT_WRITE is present. Additionally add some more documentation to padzero(), elf_map(), and elf_load(). Cc: Eric Biederman Cc: Alexander Viro Cc: Christian Brauner Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org Suggested-by: Eric Biederman Tested-by: Pedro Falcato Signed-off-by: Sebastian Ott Link: https://lore.kernel.org/r/20230929032435.2391507-5-keescook@chromium.org Signed-off-by: Kees Cook commit d5ca24f639588811af57ceac513183fa2004bd3a Author: Kees Cook Date: Thu Sep 28 20:24:32 2023 -0700 binfmt_elf: Use elf_load() for library While load_elf_library() is a libc5-ism, we can still replace most of its contents with elf_load() as well, further simplifying the code. Some historical context: - libc4 was a.out and used uselib (a.out support has been removed) - libc5 was ELF and used uselib (there may still be users) - libc6 is ELF and has never used uselib Cc: Alexander Viro Cc: Christian Brauner Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org Suggested-by: Eric Biederman Tested-by: Pedro Falcato Signed-off-by: Sebastian Ott Link: https://lore.kernel.org/r/20230929032435.2391507-4-keescook@chromium.org Signed-off-by: Kees Cook commit 2c6d0950f65e537ddec96548e2f73c00e758f87e Author: Beau Belgrave Date: Tue Sep 12 18:07:04 2023 +0000 tracing/user_events: Document persist event flags Users need to know how to make events persist now that we allow for that. We also now allow the dynamic_events file to create events by utilizing the persist flag during event register. Add back in to documentation how /sys/kernel/tracing/dynamic_events can be used to create persistent user_events. Add a section under registering for the currently supported flags (USER_EVENT_REG_PERSIST) and the required permissions. Add a note under deleting that deleting a persistent event also requires sufficient permission. Link: https://lkml.kernel.org/r/20230912180704.1284-4-beaub@linux.microsoft.com Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit cf74c59c4fc10e45c6f415ee6624b07ed747f963 Author: Beau Belgrave Date: Tue Sep 12 18:07:03 2023 +0000 selftests/user_events: Test persist flag cases Now that we have exposed USER_EVENT_REG_PERSIST events can persist both via the ABI and in the /sys/kernel/tracing/dynamic_events file. Ensure both the ABI and DYN cases work by calling both during the parse tests. Add new flags test that ensures only USER_EVENT_REG_PERSIST is honored and any other flag is invalid. Link: https://lkml.kernel.org/r/20230912180704.1284-3-beaub@linux.microsoft.com Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit 5dbd04eddb2c0841d1b3930e0a9944a2343c9cac Author: Beau Belgrave Date: Tue Sep 12 18:07:02 2023 +0000 tracing/user_events: Allow events to persist for perfmon_capable users There are several scenarios that have come up where having a user_event persist even if the process that registered it exits. The main one is having a daemon create events on bootup that shouldn't get deleted if the daemon has to exit or reload. Another is within OpenTelemetry exporters, they wish to potentially check if a user_event exists on the system to determine if exporting the data out should occur. The user_event in this case must exist even in the absence of the owning process running (such as the above daemon case). Expose the previously internal flag USER_EVENT_REG_PERSIST to user processes. Upon register or delete of events with this flag, ensure the user is perfmon_capable to prevent random user processes with access to tracefs from creating events that persist after exit. Link: https://lkml.kernel.org/r/20230912180704.1284-2-beaub@linux.microsoft.com Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) commit 6a3ecfd4a04d800e291e1652ce1f22eff613e8ec Author: John Harrison Date: Thu Sep 21 11:20:33 2023 -0700 drm/i915/guc: Suppress 'ignoring reset notification' message If an active context has been banned (e.g. Ctrl+C killed) then it is likely to be reset as part of evicting it from the hardware. That results in a 'ignoring context reset notification: banned = 1' message at info level. This confuses/concerns people and makes them think something has gone wrong when it hasn't. There is already a debug level message with essentially the same information. So drop the 'ignore' info level one and just add the 'ignore' flag to the debug level one instead (which will therefore not appear by default but will still show up in CI runs). Signed-off-by: John Harrison Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230921182033.135448-1-John.C.Harrison@Intel.com commit bdf4fb628093b4ab2f4eb312256233a2ae0594b7 Author: Uros Bizjak Date: Thu Sep 14 18:34:02 2023 +0200 ring_buffer: Use try_cmpxchg instead of cmpxchg in rb_insert_pages Use try_cmpxchg instead of cmpxchg (*ptr, old, new) == old in rb_insert_pages. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). No functional change intended. Link: https://lore.kernel.org/linux-trace-kernel/20230914163420.12923-1-ubizjak@gmail.com Cc: Steven Rostedt Cc: Masami Hiramatsu Signed-off-by: Uros Bizjak Signed-off-by: Steven Rostedt (Google) commit 5e9b7cfc209b84d135993b8cb75ea383f24b2bba Author: Justin Stitt Date: Tue Sep 19 05:27:45 2023 +0000 aoe: replace strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. `aoe_iflist` is expected to be NUL-terminated which is evident by its use with string apis later on like `strspn`: | p = aoe_iflist + strspn(aoe_iflist, WHITESPACE); It also seems `aoe_iflist` does not need to be NUL-padded which means `strscpy` [2] is a suitable replacement due to the fact that it guarantees NUL-termination on the destination buffer while not unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Cc: Kees Cook Cc: Xu Panda Cc: Yang Yang Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230919-strncpy-drivers-block-aoe-aoenet-c-v2-1-3d5d158410e9@google.com Signed-off-by: Jens Axboe commit e1f2760ba3478fa3f8c48db8e91fbe3df8bea2f8 Author: Justin Stitt Date: Tue Sep 19 05:30:35 2023 +0000 null_blk: replace strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should favor a more robust and less ambiguous interface. We expect that both `nullb->disk_name` and `disk->disk_name` be NUL-terminated: | snprintf(nullb->disk_name, sizeof(nullb->disk_name), | "%s", config_item_name(&dev->group.cg_item)); ... | pr_info("disk %s created\n", nullb->disk_name); It seems like NUL-padding may be required due to __assign_disk_name() utilizing a memcpy as opposed to a `str*cpy` api. | static inline void __assign_disk_name(char *name, struct gendisk *disk) | { | if (disk) | memcpy(name, disk->disk_name, DISK_NAME_LEN); | else | memset(name, 0, DISK_NAME_LEN); | } Then we go and print it with `__print_disk_name` which wraps `nullb_trace_disk_name()`. | #define __print_disk_name(name) nullb_trace_disk_name(p, name) This function obviously expects a NUL-terminated string. | const char *nullb_trace_disk_name(struct trace_seq *p, char *name) | { | const char *ret = trace_seq_buffer_ptr(p); | | if (name && *name) | trace_seq_printf(p, "disk=%s, ", name); | trace_seq_putc(p, 0); | | return ret; | } >From the above, we need both 1) a NUL-terminated string and 2) a NUL-padded string. So, let's use strscpy_pad() as per Kees' suggestion from v1. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Cc: Kees Cook Cc: Nick Desaulniers Cc: Nathan Chancellor Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230919-strncpy-drivers-block-null_blk-main-c-v3-1-10cf0a87a2c3@google.com Signed-off-by: Jens Axboe commit 64933ab7b04881c6c18b21ff206c12278341c72e Author: Juntong Deng Date: Wed Oct 4 02:06:41 2023 +0800 fs/jfs: Add validity check for db_maxag and db_agpref Both db_maxag and db_agpref are used as the index of the db_agfree array, but there is currently no validity check for db_maxag and db_agpref, which can lead to errors. The following is related bug reported by Syzbot: UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dmap.c:639:20 index 7936 is out of range for type 'atomic_t[128]' Add checking that the values of db_maxag and db_agpref are valid indexes for the db_agfree array. Reported-by: syzbot+38e876a8aa44b7115c76@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=38e876a8aa44b7115c76 Signed-off-by: Juntong Deng Signed-off-by: Dave Kleikamp commit 525b861a008143048535011f3816d407940f4bfa Author: Juntong Deng Date: Mon Oct 2 17:56:58 2023 +0800 fs/jfs: Add check for negative db_l2nbperpage l2nbperpage is log2(number of blks per page), and the minimum legal value should be 0, not negative. In the case of l2nbperpage being negative, an error will occur when subsequently used as shift exponent. Syzbot reported this bug: UBSAN: shift-out-of-bounds in fs/jfs/jfs_dmap.c:799:12 shift exponent -16777216 is negative Reported-by: syzbot+debee9ab7ae2b34b0307@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=debee9ab7ae2b34b0307 Signed-off-by: Juntong Deng Signed-off-by: Dave Kleikamp commit a1f157c7a3bb342b972c2830a0ad53f627000a04 Author: Zheng Yejian Date: Wed Sep 6 17:18:37 2023 +0800 tracing: Expand all ring buffers individually The ring buffer of global_trace is set to the minimum size in order to save memory on boot up and then it will be expand when some trace feature enabled. However currently operations under an instance can also cause global_trace ring buffer being expanded, and the expanded memory would be wasted if global_trace then not being used. See following case, we enable 'sched_switch' event in instance 'A', then ring buffer of global_trace is unexpectedly expanded to be 1410KB, also the '(expanded: 1408)' from 'buffer_size_kb' of instance is confusing. # cd /sys/kernel/tracing # mkdir instances/A # cat buffer_size_kb 7 (expanded: 1408) # cat instances/A/buffer_size_kb 1410 (expanded: 1408) # echo sched:sched_switch > instances/A/set_event # cat buffer_size_kb 1410 # cat instances/A/buffer_size_kb 1410 To fix it, we can: - Make 'ring_buffer_expanded' as a member of 'struct trace_array'; - Make 'ring_buffer_expanded' of instance is defaultly true, global_trace is defaultly false; - In order not to expose 'global_trace' outside of file 'kernel/trace/trace.c', introduce trace_set_ring_buffer_expanded() to set 'ring_buffer_expanded' as 'true'; - Pass the expected trace_array to tracing_update_buffers(). Link: https://lore.kernel.org/linux-trace-kernel/20230906091837.3998020-1-zhengyejian1@huawei.com Signed-off-by: Zheng Yejian Signed-off-by: Steven Rostedt (Google) commit 4ed33e69e136e7b295ff69449853beac605e8502 Author: Jaegeuk Kim Date: Tue Oct 3 15:51:49 2023 -0700 f2fs: stop iterating f2fs_map_block if hole exists Let's avoid unnecessary f2fs_map_block calls to load extents. # f2fs_io fadvise willneed 0 4096 /data/local/tmp/test f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 386, start blkaddr = 0x34ac00, len = 0x1400, flags = 2, f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 5506, start blkaddr = 0x34c200, len = 0x1000, flags = 2, f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 9602, start blkaddr = 0x34d600, len = 0x1200, flags = 2, f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 14210, start blkaddr = 0x34ec00, len = 0x400, flags = 2, f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 15235, start blkaddr = 0x34f401, len = 0xbff, flags = 2, f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 18306, start blkaddr = 0x350200, len = 0x1200, flags = 2 f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 22915, start blkaddr = 0x351601, len = 0xa7d, flags = 2 f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 25600, start blkaddr = 0x351601, len = 0x0, flags = 0 f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 25601, start blkaddr = 0x351601, len = 0x0, flags = 0 f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 25602, start blkaddr = 0x351601, len = 0x0, flags = 0 ... f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 1037188, start blkaddr = 0x351601, len = 0x0, flags = 0 f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 1038206, start blkaddr = 0x351601, len = 0x0, flags = 0 f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 1039224, start blkaddr = 0x351601, len = 0x0, flags = 0 f2fs_map_blocks: dev = (254,51), ino = 85845, file offset = 2075548, start blkaddr = 0x351601, len = 0x0, flags = 0 Signed-off-by: Jaegeuk Kim commit 473267a4911f2469722c74ca58087d951072f72a Author: Patrick Rohr Date: Mon Sep 25 14:47:11 2023 -0700 net: add sysctl to disable rfc4862 5.5.3e lifetime handling This change adds a sysctl to opt-out of RFC4862 section 5.5.3e's valid lifetime derivation mechanism. RFC4862 section 5.5.3e prescribes that the valid lifetime in a Router Advertisement PIO shall be ignored if it less than 2 hours and to reset the lifetime of the corresponding address to 2 hours. An in-progress 6man draft (see draft-ietf-6man-slaac-renum-07 section 4.2) is currently looking to remove this mechanism. While this draft has not been moving particularly quickly for other reasons, there is widespread consensus on section 4.2 which updates RFC4862 section 5.5.3e. Cc: Maciej Żenczykowski Cc: Lorenzo Colitti Cc: Jen Linkova Signed-off-by: Patrick Rohr Reviewed-by: Jiri Pirko Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20230925214711.959704-1-prohr@google.com Signed-off-by: Jakub Kicinski commit 70dc7ab7645a438600e05a0196dbaf251e7f7062 Author: Jacob Keller Date: Thu Aug 24 14:44:00 2023 -0600 iavf: remove "inline" functions from iavf_txrx.c The iAVF txrx hotpath code has several functions that are marked as "static inline" in the iavf_txrx.c file. This use of inline is frowned upon in the netdev community and explicitly marked as something to avoid in the Linux coding-style document (section 15). Even though these functions are only used once, it is expected that GCC is smart enough to decide when to perform function inlining where appropriate without the "hint". ./scripts/bloat-o-meter is showing zero difference with this changes. Signed-off-by: Jacob Keller Signed-off-by: Ahmed Zaki Signed-off-by: Tony Nguyen commit 5337d294973331660e84e41836a54014de22e5b0 Author: Yajun Deng Date: Wed Sep 6 15:27:57 2023 +0800 i40e: Add rx_missed_errors for buffer exhaustion As the comment in struct rtnl_link_stats64, rx_dropped should not include packets dropped by the device due to buffer exhaustion. They are counted in rx_missed_errors, procfs folds those two counters together. Add rx_missed_errors for buffer exhaustion, rx_missed_errors corresponds to rx_discards, rx_dropped corresponds to rx_discards_other. Signed-off-by: Yajun Deng Tested-by: Arpana Arland (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 4a7ce8334965bf175344f49bb933e45fa4db02f5 Author: Gustavo A. R. Silva Date: Mon Oct 2 21:04:15 2023 +0200 PCI/P2PDMA: Fix undefined behavior bug in struct pci_p2pdma_pagemap Struct dev_pagemap is a flexible structure, which means that it contains a flexible-array member. If dev_pagemap.nr_range > 1, the memory following the dev_pagemap could be overwritten. This is currently not an issue because pci_p2pdma_pagemap is not exposed outside p2pdma.c, and p2pdma.c only sets dev_pagemap.nr_range to 1. To prevent problems if p2pdma.c ever uses nr_range > 1, move the flexible struct dev_pagemap to the end of struct pci_p2pdma_pagemap. -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting ready to enable it globally. Link: https://lore.kernel.org/r/ZRsUL/hATNruwtla@work Signed-off-by: "Gustavo A. R. Silva" [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit 8989682a1cb600bac1149ed17b1ce929ab472e79 Merge: 0e0c52d603b20 c8afdc0183294 Author: Jakub Kicinski Date: Tue Oct 3 15:02:19 2023 -0700 Merge branch 'documentation-fixes-for-dpll-subsystem' Bagas Sanjaya says: ==================== Documentation fixes for dpll subsystem Here is a mini docs fixes for dpll subsystem. The fixes are all code block-related. This series is triggered because I was emailed by kernel test robot, alerting htmldocs warnings (see patch [1/2]). [1]: https://lore.kernel.org/all/20230918093240.29824-1-bagasdotme@gmail.com/ ==================== Link: https://lore.kernel.org/r/20230928052708.44820-1-bagasdotme@gmail.com Signed-off-by: Jakub Kicinski commit c8afdc01832943fab030103bd027ce021d26ddcf Author: Bagas Sanjaya Date: Thu Sep 28 12:27:08 2023 +0700 Documentation: dpll: wrap DPLL_CMD_PIN_GET output in a code block DPLL_CMD_PIN_GET netlink command output for mux-type pins looks ugly with normal paragraph formatting. Format it as a code block instead. Signed-off-by: Bagas Sanjaya Acked-by: Randy Dunlap Tested-by: Randy Dunlap Reviewed-by: Vadim Fedorenko Link: https://lore.kernel.org/r/20230928052708.44820-3-bagasdotme@gmail.com Signed-off-by: Jakub Kicinski commit 92425d08a60814b4a2e91626f1e24e4fd5fd5c7e Author: Bagas Sanjaya Date: Thu Sep 28 12:27:07 2023 +0700 Documentation: dpll: Fix code blocks kernel test robot and Stephen Rothwell report htmldocs warnings: Documentation/driver-api/dpll.rst:427: WARNING: Error in "code-block" directive: maximum 1 argument(s) allowed, 18 supplied. .. code-block:: c ... Documentation/driver-api/dpll.rst:444: WARNING: Error in "code-block" directive: maximum 1 argument(s) allowed, 21 supplied. .. code-block:: c ... Documentation/driver-api/dpll.rst:474: WARNING: Error in "code-block" directive: maximum 1 argument(s) allowed, 12 supplied. .. code-block:: c ... Fix these above by adding missing blank line separator after code-block directive. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309180456.lOhxy9gS-lkp@intel.com/ Reported-by: Stephen Rothwell Closes: https://lore.kernel.org/linux-next/20230918131521.155e9e63@canb.auug.org.au/ Fixes: dbb291f19393b6 ("dpll: documentation on DPLL subsystem interface") Signed-off-by: Bagas Sanjaya Acked-by: Randy Dunlap Tested-by: Randy Dunlap Reviewed-by: Vadim Fedorenko Link: https://lore.kernel.org/r/20230928052708.44820-2-bagasdotme@gmail.com Signed-off-by: Jakub Kicinski commit 19c1c9916dbf9b05157a0c4970f61f952c0cb86a Author: Jacob Satterfield Date: Fri Sep 29 19:56:12 2023 +0000 selinux: simplify avtab_insert_node() prototype __hashtab_insert() in hashtab.h has a cleaner interface that allows the caller to specify the chain node location that the new node is being inserted into so that it can update the node that currently occupies it. Signed-off-by: Jacob Satterfield Reviewed-by: Stephen Smalley Signed-off-by: Paul Moore commit 8ae292c66dcb160b3e1e16b66c3076d5a2c63873 Author: Zhu Wang Date: Mon Jul 31 19:36:22 2023 +0800 x86/lib: Address kernel-doc warnings Fix all kernel-doc warnings in csum-wrappers_64.c: arch/x86/lib/csum-wrappers_64.c:25: warning: Excess function parameter 'isum' description in 'csum_and_copy_from_user' arch/x86/lib/csum-wrappers_64.c:25: warning: Excess function parameter 'errp' description in 'csum_and_copy_from_user' arch/x86/lib/csum-wrappers_64.c:49: warning: Excess function parameter 'isum' description in 'csum_and_copy_to_user' arch/x86/lib/csum-wrappers_64.c:49: warning: Excess function parameter 'errp' description in 'csum_and_copy_to_user' arch/x86/lib/csum-wrappers_64.c:71: warning: Excess function parameter 'sum' description in 'csum_partial_copy_nocheck' Signed-off-by: Zhu Wang Signed-off-by: Ingo Molnar Cc: linux-kernel@vger.kernel.org commit 90879f5dfcf6cf1d56f4d1b696a25c44e1f5ba14 Author: Zhu Wang Date: Mon Jul 31 19:34:57 2023 +0800 x86/fpu/xstate: Address kernel-doc warning Fix kernel-doc warning: arch/x86/kernel/fpu/xstate.c:1753: warning: Excess function parameter 'tsk' description in 'fpu_xstate_prctl' Signed-off-by: Zhu Wang Signed-off-by: Ingo Molnar Cc: linux-kernel@vger.kernel.org commit 63137bee5a7a45df82d948e39b3b4c07d8b1ce03 Author: Bartosz Golaszewski Date: Mon Sep 11 11:46:04 2023 +0200 hte: allow building modules with COMPILE_TEST enabled Allow building all HTE modules with COMPILE_TEST Kconfig option enabled. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij Acked-by: Dipen Patel Signed-off-by: Dipen Patel commit d484366854f535fa25a863a575c5b6a86f4f4bdc Author: Kees Cook Date: Fri Sep 22 10:53:45 2023 -0700 hte: Annotate struct hte_device with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct hte_device. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Dipen Patel Cc: timestamp@lists.linux.dev Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Dipen Patel Reviewed-by: Justin Stitt Signed-off-by: Dipen Patel commit c4c8955b8acb4d88d2ca02a7dc6010e5f0c5288d Author: Mario Limonciello Date: Tue Sep 26 17:59:53 2023 -0500 drm/amd: Fix detection of _PR3 on the PCIe root port On some systems with Navi3x dGPU will attempt to use BACO for runtime PM but fails to resume properly. This is because on these systems the root port goes into D3cold which is incompatible with BACO. This happens because in this case dGPU is connected to a bridge between root port which causes BOCO detection logic to fail. Fix the intent of the logic by looking at root port, not the immediate upstream bridge for _PR3. Cc: stable@vger.kernel.org Suggested-by: Jun Ma Tested-by: David Perry Fixes: b10c1c5b3a4e ("drm/amdgpu: add check for ACPI power resources") Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ade134ddaee5baa1fa35cc66a12d2489213a26e0 Author: Mario Limonciello Date: Tue Sep 26 21:07:43 2023 -0500 drm/amd: Fix logic error in sienna_cichlid_update_pcie_parameters() While aligning SMU11 with SMU13 implementation an assumption was made that `dpm_context->dpm_tables.pcie_table` was populated in dpm table initialization like in SMU13 but it isn't. So restore some of the original logic and instead just check for amdgpu_device_pcie_dynamic_switching_supported() to decide whether to hardcode values; erring on the side of performance. Cc: stable@vger.kernel.org # 6.1+ Reported-and-tested-by: Umio Yasuno Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1447#note_2101382 Fixes: e701156ccc6c ("drm/amd: Align SMU11 SMU_MSG_OverridePcieParameters implementation with SMU13") Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 77a66faaccc0455fe30e326e9a997aec8d0abed4 Author: Alex Hung Date: Fri Jun 23 09:40:39 2023 -0600 drm/amd/display: Disable DWB frame capture to emulate oneshot [WHY] drm_writeback requires to capture exact one frame in each writeback call. [HOW] frame_capture is disabled after each writeback is completed. Reviewed-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit b79a00a4d4f8fc827ca0fc19e259913a81252f6b Author: Alex Hung Date: Fri Jun 23 09:39:46 2023 -0600 drm/amd/display: Add new set_fc_enable to struct dwbc_funcs [WHAT] Add a function to enable and disable DWB's frame captures. Reviewed-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit 428542d9177286c01ef7a3dbd026eb00567e06b1 Author: Alex Hung Date: Thu Jun 1 18:22:32 2023 -0600 drm/amd/display: Setup for mmhubbub3_warmup_mcif with big buffer [WHY] Hardware may require different warmup approaches - big buffer or individual buffers. [HOW] Setup warmup for big buffer when it is required by specific hardware. Reviewed-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit f6893fcb10c7b24526454e465f6ec2563ef044cc Author: Alex Hung Date: Tue May 23 22:07:46 2023 -0600 drm/amd/display: Add writeback enable field (wb_enabled) [WHAT] Add a new field to keep track whether a crtc is previously writeback-enabled. Reviewed-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit 5b89d2ccc8466e0445a4994cb288fc009b565de5 Author: Alex Hung Date: Fri May 19 17:14:30 2023 -0600 drm/amd/display: Fix writeback_info is not removed [WHY] Counter j was not updated to present the num of writeback_info when writeback pipes are removed. [HOW] update j (num of writeback info) under the correct condition. Reviewed-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit 58c3b3341cea4f75dc8c003b89f8a6dd8ec55e50 Author: Alex Hung Date: Mon Jul 10 18:23:58 2023 -0600 drm/amd/display: Validate hw_points_num before using it [WHAT] hw_points_num is 0 before ogam LUT is programmed; however, function "dwb3_program_ogam_pwl" assumes hw_points_num is always greater than 0, i.e. substracting it by 1 as an array index. [HOW] Check hw_points_num is not equal to 0 before using it. Reviewed-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit 8a307777c36e15f38c9f23778babcd368144c7d8 Author: Alex Hung Date: Fri May 5 14:14:38 2023 -0600 drm/amd/display: Fix writeback_info never got updated [WHY] wb_enabled field is set to false before it is used, and the following code will never be executed. [HOW] Setting wb_enable to false after all removal work is completed. Reviewed-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit c6d3c7b6309726fbe93cf595d6de326fb8295a64 Author: Alex Hung Date: Wed Feb 1 18:54:51 2023 -0700 drm/amd/display: Add writeback enable/disable in dc [WHAT] The enable and disable writeback calls need to be included in the coressponding functions in dc_stream. Reviewed-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit cd1a4bc22821eea9a98f1beddd1a8d789989a720 Author: Alex Hung Date: Mon Jul 3 18:17:32 2023 -0600 drm/amd/display: Hande writeback request from userspace [WHAT] Handle writeback requests and fill in the required information for DWB programming and setup. Reviewed-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit 01aaeb8c23301194ee063d89c06eae41599698af Author: Harry Wentland Date: Wed Nov 2 16:06:30 2022 -0400 drm/amd/display: Create fake sink and stream for writeback connector [WHAT] Writeback connectors don't have a physical sink but DC still needs a sink to function. Create a fake sink and stream for writeback connectors Reviewed-by: Alex Hung Signed-off-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit a5f9523c9ca352d6454e81ff9e9a4419f457210a Author: Harry Wentland Date: Wed Nov 2 15:54:52 2022 -0400 drm/amd/display: Create amdgpu_dm_wb_connector [WHY] We need to track the dc_link and it would get confusing if re-using the amdgpu_dm_connector. [HOW] Creating new amdgpu_dm_wb_connector. Reviewed-by: Alex Hung Signed-off-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit c4c182b5488e8d4a48be3327aab14d778cdfe5e7 Author: Harry Wentland Date: Wed Nov 2 16:28:02 2022 -0400 drm/amd/display: Use drm_connector in create_validate_stream_for_sink [WHAT] Again, we need to use this function for writeback connectors, which are not of type amdgpu_dm_connector. Use the common base drm_connector instead. Reviewed-by: Alex Hung Signed-off-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit b44fe93281edaf7dab14cd8b09f3c6f5585b1fbf Author: Srinivasan Shanmugam Date: Mon Sep 25 11:42:33 2023 +0530 drm/amd/display: Address 'srf_updates' not described in 'could_mpcc_tree_change_for_active_pipes' Fixes the following: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3928: warning: Function parameter or member 'srf_updates' not described in 'could_mpcc_tree_change_for_active_pipes' Cc: Harry Wentland Cc: Rodrigo Siqueira Cc: Aurabindo Pillai Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 723d873dd79597602f0e60ee49786ffd07145e5c Author: Dan Carpenter Date: Wed Sep 27 15:37:51 2023 +0300 drm/amd/pm: delete dead code "ret" was checked earlier inside the loop, so we know it is zero here. No need to check a second time. Reviewed-by: Yang Wang Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit 5d91801870ba0ba23d90885edf0821634ecd405d Author: Harry Wentland Date: Wed Nov 2 15:15:32 2022 -0400 drm/amd/display: Use drm_connector in create_stream_for_sink [WHAT] We need to use this function for both amdgpu_dm_connectors and drm_writeback_connectors. Modify it to operate on a drm_connector as a common base. Reviewed-by: Alex Hung Signed-off-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit 0021d70a0654e668d457758110abec33dfbd3ba5 Author: Alex Deucher Date: Tue Sep 26 12:00:23 2023 -0400 drm/amdkfd: drop struct kfd_cu_info I think this was an abstraction back from when kfd supported both radeon and amdgpu. Since we just support amdgpu now, there is no more need for this and we can use the amdgpu structures directly. This also avoids having the kfd_cu_info structures on the stack when inlining which can blow up the stack. Cc: Arnd Bergmann Acked-by: Arnd Bergmann Reviewed-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Alex Deucher commit ca2b37a1c249d05f21eeb7522489036efbc6c7f8 Author: Harry Wentland Date: Wed Nov 2 14:10:41 2022 -0400 drm/amd/display: Return drm_connector from find_first_crtc_matching_connector [WHY] We will be dealing with two types of connector: amdgpu_dm_connector and drm_writeback_connector. [HOW] We want to find both and then cast to the appriopriate type afterwards. Reviewed-by: Alex Hung Signed-off-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit 4ff91f218547bfc3d230c00e46725b71a625acbc Author: Alex Deucher Date: Thu Sep 21 10:32:09 2023 -0400 drm/amdkfd: reduce stack size in kfd_topology_add_device() kfd_topology.c:2082:1: warning: the frame size of 1440 bytes is larger than 1024 bytes Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2866 Cc: Arnd Bergmann Acked-by: Arnd Bergmann Acked-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 758a74306f1076b50cb9872af18cb900bafd9497 Author: Ruan Jinjie Date: Tue Aug 1 11:52:30 2023 +0800 objtool: Use 'the fallthrough' pseudo-keyword Replace the existing /* fallthrough */ comments with the new 'fallthrough' pseudo-keyword macro: https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Ruan Jinjie Signed-off-by: Ingo Molnar Cc: Josh Poimboeuf Cc: Peter Zijlstra Cc: linux-kernel@vger.kernel.org commit d4d6596b43868a1e05fe5b047e73c3aff96444c6 Author: Yu Liao Date: Wed Aug 2 10:15:01 2023 +0800 sched/headers: Remove duplicate header inclusions and "autogroup.h" are included twice, remove the duplicate header inclusion. Signed-off-by: Yu Liao Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230802021501.2511569-1-liaoyu15@huawei.com commit 618e77d77494bfd6273256d43eafe4368445c745 Author: David Reaver Date: Tue Aug 1 08:56:51 2023 -0700 perf/x86/rapl: Fix "Using plain integer as NULL pointer" Sparse warning Change 0 to NULL when initializing the test field of perf_msr structs to avoid the following sparse warnings: make C=2 arch/x86/events/rapl.o CHECK arch/x86/events/rapl.c ... arch/x86/events/rapl.c:540:59: warning: Using plain integer as NULL pointer arch/x86/events/rapl.c:542:59: warning: Using plain integer as NULL pointer arch/x86/events/rapl.c:543:59: warning: Using plain integer as NULL pointer arch/x86/events/rapl.c:544:59: warning: Using plain integer as NULL pointer Signed-off-by: David Reaver Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230801155651.108076-1-me@davidreaver.com commit 2e89345764c6a87c778e776c0590bda07425f251 Author: Kees Cook Date: Fri Sep 22 10:53:15 2023 -0700 ACPI: PRM: Annotate struct prm_module_info with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct prm_module_info. Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci # [1] Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Rafael J. Wysocki commit eeb6d1d6f4ec0e304608f72c3ead584bbb155714 Author: GuoHua Cheng Date: Wed Sep 27 13:56:08 2023 +0800 PNP: Clean up coding style in pnp.h Address the following checkpatch complaints: ERROR: "foo * bar" should be "foo *bar" ERROR: space required after that ';' (ctx:VxV) Signed-off-by: GuoHua Cheng [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 0e0c52d603b20e4810542e71337b8c8556054266 Merge: e643597346c72 e268b97227056 Author: Jakub Kicinski Date: Tue Oct 3 12:17:13 2023 -0700 Merge branch 'introduce-define_flex-macro' Przemek Kitszel says: ==================== introduce DEFINE_FLEX() macro Add DEFINE_FLEX() macro, that helps on-stack allocation of structures with trailing flex array member. Expose __struct_size() macro which reads size of data allocated by DEFINE_FLEX(). Accompany new macros introduction with actual usage, in the ice driver - hence targeting for netdev tree. Obvious benefits include simpler resulting code, less heap usage, less error checking. Less obvious is the fact that compiler has more room to optimize, and as a whole, even with more stuff on the stack, we end up with overall better (smaller) report from bloat-o-meter: add/remove: 8/6 grow/shrink: 7/18 up/down: 2211/-2270 (-59) (individual results in each patch). ==================== Link: https://lore.kernel.org/r/20230912115937.1645707-1-przemyslaw.kitszel@intel.com Signed-off-by: Jakub Kicinski commit e268b972270567e0414836919c5b9f8bc01651a4 Author: Przemek Kitszel Date: Tue Sep 12 07:59:37 2023 -0400 ice: make use of DEFINE_FLEX() in ice_switch.c Use DEFINE_FLEX() macro for 1-elem flex array members of ice_switch.c Signed-off-by: Przemek Kitszel Link: https://lore.kernel.org/r/20230912115937.1645707-8-przemyslaw.kitszel@intel.com Signed-off-by: Jakub Kicinski commit 11dee3d611dd2bba0d9c91d8a8960e602b9944c0 Author: Przemek Kitszel Date: Tue Sep 12 07:59:36 2023 -0400 ice: make use of DEFINE_FLEX() for struct ice_aqc_dis_txq_item Use DEFINE_FLEX() macro for 1-elem flex array use case of struct ice_aqc_dis_txq_item. Signed-off-by: Przemek Kitszel Link: https://lore.kernel.org/r/20230912115937.1645707-7-przemyslaw.kitszel@intel.com Signed-off-by: Jakub Kicinski commit 43bba3b1664d303bfed3382bd3e6b6b48b8e5039 Author: Przemek Kitszel Date: Tue Sep 12 07:59:35 2023 -0400 ice: make use of DEFINE_FLEX() for struct ice_aqc_add_tx_qgrp Use DEFINE_FLEX() macro for 1-elem flex array use case of struct ice_aqc_add_tx_qgrp. Signed-off-by: Przemek Kitszel Link: https://lore.kernel.org/r/20230912115937.1645707-6-przemyslaw.kitszel@intel.com Signed-off-by: Jakub Kicinski commit 230064baa43d7e3f13c9d5471350194e74f83601 Author: Przemek Kitszel Date: Tue Sep 12 07:59:34 2023 -0400 ice: make use of DEFINE_FLEX() in ice_ddp.c Use DEFINE_FLEX() macro for constant-num-of-elems (4) flex array members of ice_ddp.c Signed-off-by: Przemek Kitszel Link: https://lore.kernel.org/r/20230912115937.1645707-5-przemyslaw.kitszel@intel.com Signed-off-by: Jakub Kicinski commit a034fcdbeaf7478ccbdec03650b07feaa6ecd51a Author: Przemek Kitszel Date: Tue Sep 12 07:59:33 2023 -0400 ice: drop two params of ice_aq_move_sched_elems() Remove two arguments of ice_aq_move_sched_elems(). Last of them was always NULL, and @grps_req was always 1. Assuming @grps_req to be one, allows us to use DEFINE_FLEX() macro, what removes some need for heap allocations. Signed-off-by: Przemek Kitszel Link: https://lore.kernel.org/r/20230912115937.1645707-4-przemyslaw.kitszel@intel.com Signed-off-by: Jakub Kicinski commit ece285af77d00f7f4f9dd311f5cfa866a51c010f Author: Przemek Kitszel Date: Tue Sep 12 07:59:32 2023 -0400 ice: ice_sched_remove_elems: replace 1 elem array param by u32 Replace array+size params of ice_sched_remove_elems:() by just single u32, as all callers are using it with "1". This enables moving from heap-based, to stack-based allocation, what is also more elegant thanks to DEFINE_FLEX() macro. Signed-off-by: Przemek Kitszel Link: https://lore.kernel.org/r/20230912115937.1645707-3-przemyslaw.kitszel@intel.com Signed-off-by: Jakub Kicinski commit 26dd68d293fd1c5ac966fb5dd5f6d89de322a541 Author: Przemek Kitszel Date: Tue Sep 12 07:59:31 2023 -0400 overflow: add DEFINE_FLEX() for on-stack allocs Add DEFINE_FLEX() macro for on-stack allocations of structs with flexible array member. Expose __struct_size() macro outside of fortify-string.h, as it could be used to read size of structs allocated by DEFINE_FLEX(). Move __member_size() alongside it. -Kees Using underlying array for on-stack storage lets us to declare known-at-compile-time structures without kzalloc(). Actual usage for ice driver is in following patches of the series. Missing __has_builtin() workaround is moved up to serve also assembly compilation with m68k-linux-gcc, see [1]. Error was (note the .S file extension): In file included from ../include/linux/linkage.h:5, from ../arch/m68k/fpsp040/skeleton.S:40: ../include/linux/compiler_types.h:331:5: warning: "__has_builtin" is not defined, evaluates to 0 [-Wundef] 331 | #if __has_builtin(__builtin_dynamic_object_size) | ^~~~~~~~~~~~~ ../include/linux/compiler_types.h:331:18: error: missing binary operator before token "(" 331 | #if __has_builtin(__builtin_dynamic_object_size) | ^ [1] https://lore.kernel.org/netdev/202308112122.OuF0YZqL-lkp@intel.com/ Co-developed-by: Kees Cook Signed-off-by: Kees Cook Signed-off-by: Przemek Kitszel Link: https://lore.kernel.org/r/20230912115937.1645707-2-przemyslaw.kitszel@intel.com Signed-off-by: Jakub Kicinski commit bcc6ec3d954bbcc8bec34a21c05ea536a2e96d6f Author: Uros Bizjak Date: Mon Aug 7 16:51:15 2023 +0200 perf/x86/rapl: Use local64_try_cmpxchg in rapl_event_update() Use local64_try_cmpxchg() instead of local64_cmpxchg(*ptr, old, new) == old. X86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after CMPXCHG (and related move instruction in front of CMPXCHG). Also, try_cmpxchg() implicitly assigns old *ptr value to "old" when CMPXCHG fails. There is no need to re-read the value in the loop. No functional change intended. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Linus Torvalds Cc: "H. Peter Anvin" Link: https://lore.kernel.org/r/20230807145134.3176-2-ubizjak@gmail.com commit 1ce19bf90bd55bf54f9ed75d594029db63d395b0 Author: Uros Bizjak Date: Mon Aug 7 16:51:14 2023 +0200 perf/x86/rapl: Stop doing cpu_relax() in the local64_cmpxchg() loop in rapl_event_update() According to the following commit: f5fe24ef17b5 ("lockref: stop doing cpu_relax in the cmpxchg loop") "On the x86-64 architecture even a failing cmpxchg grants exclusive access to the cacheline, making it preferable to retry the failed op immediately instead of stalling with the pause instruction." Based on the above observation, remove cpu_relax() from the local64_cmpxchg() loop of rapl_event_update(). Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Cc: Linus Torvalds Cc: "H. Peter Anvin" Link: https://lore.kernel.org/r/20230807145134.3176-1-ubizjak@gmail.com commit a83c68a3bf7c418c9a46693c63c638852b0c1f4e Author: Vasily Khoruzhick Date: Wed Sep 27 12:50:02 2023 -0700 ACPI: FPDT: properly handle invalid FPDT subtables Buggy BIOSes may have invalid FPDT subtables, e.g. on my hardware: S3PT subtable: 7F20FE30: 53 33 50 54 24 00 00 00-00 00 00 00 00 00 18 01 *S3PT$...........* 7F20FE40: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 *................* 7F20FE50: 00 00 00 00 Here the first record has zero length. FBPT subtable: 7F20FE50: 46 42 50 54-3C 00 00 00 46 42 50 54 *....FBPT<...FBPT* 7F20FE60: 02 00 30 02 00 00 00 00-00 00 00 00 00 00 00 00 *..0.............* 7F20FE70: 2A A6 BC 6E 0B 00 00 00-1A 44 41 70 0B 00 00 00 **..n.....DAp....* 7F20FE80: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 *................* And here FBPT table has FBPT signature repeated instead of the first record. Current code will be looping indefinitely due to zero length records, so break out of the loop if record length is zero. While we are here, add proper handling for fpdt_process_subtable() failures. Fixes: d1eb86e59be0 ("ACPI: tables: introduce support for FPDT table") Cc: All applicable Signed-off-by: Vasily Khoruzhick [ rjw: Comment edit, added empty code lines ] Signed-off-by: Rafael J. Wysocki commit 6b54bdd1685a3e81dd062b6886e8e729e5b2a8ee Author: Jonathan Bergh Date: Thu Sep 28 23:48:23 2023 +0200 ACPI: utils: Remove redundant braces around individual statement Remove braces that are not required for a one-line statement which follows a control statement. Signed-off-by: Jonathan Bergh [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 6c766f7aacc0fa5b461ca3d8067c9065a6a53ef4 Author: Jonathan Bergh Date: Thu Sep 28 23:48:07 2023 +0200 ACPI: utils: Fix up white space in a few places Fix up the following formatting issues flagged by checkpatch: * Remove indentation before goto label * Remove whitespace ahead of a comma in parameter list Signed-off-by: Jonathan Bergh [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 802e87cc464613441f9098ebf940b1895fe3f5e5 Author: Alexey Dobriyan Date: Tue Oct 3 19:18:43 2023 +0300 selftests/x86/mm: Add new test that userspace stack is in fact NX Here is how it works: * fault and fill the stack from RSP with INT3 down until rlimit allows, * fill upwards with INT3 too, overwrite libc stuff, argv, envp, * try to exec INT3 on each page and catch it in either SIGSEGV or SIGTRAP handler. Note: trying to execute _every_ INT3 on a 8 MiB stack takes 30-40 seconds even on fast machine which is too much for kernel selftesting (not for LTP!) so only 1 INT3 per page is tried. Tested on F37 kernel and on a custom kernel which does: vm_flags |= VM_EXEC; to stack VMA. Report from the buggy kernel: $ ./nx_stack_32 stack min ff007000 stack max ff807000 FAIL executable page on the stack: eip ff806001 $ ./nx_stack_64 stack min 7ffe65bb0000 stack max 7ffe663b0000 FAIL executable page on the stack: rip 7ffe663af001 Signed-off-by: Alexey Dobriyan Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/4cef8266-ad6d-48af-a5f1-fc2b6a8eb422@p183 commit 1dd72ce0c125110033e65051c9f8b2676e425cfd Author: Jonathan Bergh Date: Fri Sep 29 00:13:44 2023 +0200 ACPI: thermal: Fix up function header formatting in two places Fix up the following formatting issues: * braces following function declarations should be on a new line * empty line should be present between function declarations Signed-off-by: Jonathan Bergh [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 35a341c9b25da6a479bd8013bcb11a680a7233e3 Author: Ondrej Zary Date: Fri Sep 29 22:20:55 2023 +0200 ACPI: video: Add acpi_backlight=vendor quirk for Toshiba Portégé R100 Toshiba Portégé R100 has both acpi_video and toshiba_acpi vendor backlight driver working. But none of them gets activated as it has a VGA with no kernel driver (Trident CyberBlade XP4m32). The DMI strings are very generic ("Portable PC") so add a custom callback function to check for Trident CyberBlade XP4m32 PCI device before enabling the vendor backlight driver (better than acpi_video as it has more brightness steps). Fixes: 5aa9d943e9b6 ("ACPI: video: Don't enable fallback path for creating ACPI backlight by default") Signed-off-by: Ondrej Zary Signed-off-by: Rafael J. Wysocki commit a1da3b78c08357f67adecf3b2e2be7d13aaccca7 Author: Jonathan Bergh Date: Sat Sep 30 11:04:36 2023 +0200 ACPI: OSL: Add empty lines after local variable declarations Fix up four places where there is no empty line after declarations of local variables in a function (as per the kernel coding style). Signed-off-by: Jonathan Bergh [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 9d4e27dd88275a8e2a14521b63792f33edca5758 Author: Jonathan Bergh Date: Sat Sep 30 11:04:21 2023 +0200 ACPI: OSL: Remove redundant parentheses in return statements Fix up three return statements including redundant perens around the return value. Signed-off-by: Jonathan Bergh [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 92002fb39e8e4a199231c1c842b07dbbd806ba75 Author: Jonathan Bergh Date: Sat Sep 30 11:02:48 2023 +0200 ACPI: OSL: Fix up white space in parameter lists Fix up declarations of pointer arguments where a space is present before the argument name, which does not agree with the kernel coding style. Signed-off-by: Jonathan Bergh [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit ccab211af3c2b90ed792eb5f33707d2f0d59fe50 Author: Sohil Mehta Date: Mon Jul 10 18:51:24 2023 +0000 syscalls: Cleanup references to sys_lookup_dcookie() commit 'be65de6b03aa ("fs: Remove dcookies support")' removed the syscall definition for lookup_dcookie. However, syscall tables still point to the old sys_lookup_dcookie() definition. Update syscall tables of all architectures to directly point to sys_ni_syscall() instead. Signed-off-by: Sohil Mehta Reviewed-by: Randy Dunlap Acked-by: Namhyung Kim # for perf Acked-by: Russell King (Oracle) Acked-by: Geert Uytterhoeven Signed-off-by: Arnd Bergmann commit f9af5ad0f5b599fadf6fc7c9c2153d7919c7691e Author: Nathan Chancellor Date: Mon Oct 2 10:53:13 2023 -0700 vfio/cdx: Add parentheses between bitwise AND expression and logical NOT When building with clang, there is a warning (or error with CONFIG_WERROR=y) due to a bitwise AND and logical NOT in vfio_cdx_bm_ctrl(): drivers/vfio/cdx/main.c:77:6: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses] 77 | if (!vdev->flags & BME_SUPPORT) | ^ ~ drivers/vfio/cdx/main.c:77:6: note: add parentheses after the '!' to evaluate the bitwise operator first 77 | if (!vdev->flags & BME_SUPPORT) | ^ | ( ) drivers/vfio/cdx/main.c:77:6: note: add parentheses around left hand side expression to silence this warning 77 | if (!vdev->flags & BME_SUPPORT) | ^ | ( ) 1 error generated. Add the parentheses as suggested in the first note, which is clearly what was intended here. Closes: https://github.com/ClangBuiltLinux/linux/issues/1939 Fixes: 8a97ab9b8b31 ("vfio-cdx: add bus mastering device feature support") Signed-off-by: Nathan Chancellor Reviewed-by: Philippe Mathieu-Daudé Acked-by: Nikhil Agarwal Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20231002-vfio-cdx-logical-not-parentheses-v1-1-a8846c7adfb6@kernel.org Signed-off-by: Alex Williamson commit 8624ebc300b2418b498cb85463682afc9bde5d54 Author: Andy Shevchenko Date: Mon Oct 2 16:53:52 2023 +0300 PCI/ACPI: Use acpi_evaluate_dsm_typed() The acpi_evaluate_dsm_typed() provides a way to check the type of the object evaluated by _DSM call. Use it instead of open coded variant. Link: https://lore.kernel.org/r/20231002135352.2603096-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Bjorn Helgaas Acked-by: "Rafael J. Wysocki" commit 83c088148c8e5c439eec6c7651692f797547e1a8 Author: Ilpo Järvinen Date: Tue Oct 3 15:53:00 2023 +0300 PCI: Use PCI_HEADER_TYPE_* instead of literals Replace literals under drivers/pci/ with PCI_HEADER_TYPE_MASK, PCI_HEADER_TYPE_NORMAL, and PCI_HEADER_TYPE_MFD. Also replace !! boolean conversions with FIELD_GET(). Link: https://lore.kernel.org/r/20231003125300.5541-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas Reviewed-by: Wolfram Sang # for Renesas R-Car commit bdca03a271f2de2c24ea56756fd9bbcff35173fb Author: Ilpo Järvinen Date: Tue Oct 3 15:52:59 2023 +0300 PCI: Add PCI_HEADER_TYPE_MFD definition Add PCI_HEADER_TYPE_MFD so we can replace literals in the code. Link: https://lore.kernel.org/r/20231003125300.5541-3-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas commit 5827e17d0555b566c32044b0632b46f9f95054fa Author: Ilpo Järvinen Date: Tue Oct 3 15:52:58 2023 +0300 PCI: vmd: Correct PCI Header Type Register's multi-function check vmd_domain_reset() attempts to find whether the device may contain multiple functions by checking 0x80 (Multi-Function Device), however, the hdr_type variable has already been masked with PCI_HEADER_TYPE_MASK so the check can never true. To fix the issue, don't mask the read with PCI_HEADER_TYPE_MASK. Fixes: 6aab5622296b ("PCI: vmd: Clean up domain before enumeration") Link: https://lore.kernel.org/r/20231003125300.5541-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen Signed-off-by: Bjorn Helgaas Cc: Nirmal Patel commit 6b8ace7a14e7926b7b914ccd96a8ac657c0d518c Author: Chris Wilson Date: Mon Oct 2 07:07:42 2023 -0700 drm/i915: Invalidate the TLBs on each GT With multi-GT devices, the object may have been bound on each GT and so we need to invalidate the TLBs across all GT before releasing the pages back to the system. Fixes: d6c531ab4820 ("drm/i915: Invalidate the TLBs on each GT") Signed-off-by: Chris Wilson Signed-off-by: Jonathan Cavitt CC: Matt Roper CC: Andi Shyti Reviewed-by: Andi Shyti Reviewed-by: Nirmoy Das Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20231002140742.933530-1-jonathan.cavitt@intel.com commit 92224e806f7c8e133b2249408958ca988cf7413f Author: Randy Dunlap Date: Sat Sep 23 12:51:44 2023 -0700 docs: admin-guide: sysctl: fix details of struct dentry_stat_t Commit c8c0c239d5ab moved struct dentry_stat_t to fs/dcache.c but did not update its location in Documentation, so update that now. Also change each struct member from int to long as done in commit 3942c07ccf98. Fixes: c8c0c239d5ab ("fs: move dcache sysctls to its own file") Fixes: 3942c07ccf98 ("fs: bump inode and dentry counters to long") Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: Alexander Viro Cc: Christian Brauner Cc: linux-fsdevel@vger.kernel.org Cc: Luis Chamberlain Cc: Arnd Bergmann Cc: Glauber Costa Acked-by: Christian Brauner Signed-off-by: Jonathan Corbet Link: https://lore.kernel.org/r/20230923195144.26043-1-rdunlap@infradead.org commit 0abd1557e21c617bd13fc18f7725fc6363c05913 Author: Al Viro Date: Mon Oct 2 03:33:44 2023 +0100 gfs2: fix an oops in gfs2_permission In RCU mode, we might race with gfs2_evict_inode(), which zeroes ->i_gl. Freeing of the object it points to is RCU-delayed, so if we manage to fetch the pointer before it's been replaced with NULL, we are fine. Check if we'd fetched NULL and treat that as "bail out and tell the caller to get out of RCU mode". Signed-off-by: Al Viro Signed-off-by: Andreas Gruenbacher commit e643597346c72ebb961ee79ebec34acc042e8ac2 Merge: 788f63c4dc178 75cec20345fa8 Author: Jakub Kicinski Date: Tue Oct 3 07:34:53 2023 -0700 Merge branch 'bpf-remove-xdp_do_flush_map' Sebastian Andrzej Siewior says: ==================== bpf: Remove xdp_do_flush_map(). I had #1 split in several patches per vendor and then decided to merge it. I can repost it with one patch per vendor if this preferred. ==================== Link: https://lore.kernel.org/r/20230908143215.869913-1-bigeasy@linutronix.de Signed-off-by: Jakub Kicinski commit 75cec20345fa8e05a2b5f861fada95ad8e165257 Author: Sebastian Andrzej Siewior Date: Fri Sep 8 16:32:15 2023 +0200 bpf: Remove xdp_do_flush_map(). xdp_do_flush_map() can be removed because there is no more user in tree. Remove xdp_do_flush_map(). Signed-off-by: Sebastian Andrzej Siewior Acked-by: Toke Høiland-Jørgensen Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/r/20230908143215.869913-3-bigeasy@linutronix.de Signed-off-by: Jakub Kicinski commit 7f04bd109d4c358a12b125bc79a6f0eac2e915ec Author: Sebastian Andrzej Siewior Date: Fri Sep 8 16:32:14 2023 +0200 net: Tree wide: Replace xdp_do_flush_map() with xdp_do_flush(). xdp_do_flush_map() is deprecated and new code should use xdp_do_flush() instead. Replace xdp_do_flush_map() with xdp_do_flush(). Cc: AngeloGioacchino Del Regno Cc: Clark Wang Cc: Claudiu Manoil Cc: David Arinzon Cc: Edward Cree Cc: Felix Fietkau Cc: Grygorii Strashko Cc: Jassi Brar Cc: Jesse Brandeburg Cc: John Crispin Cc: Leon Romanovsky Cc: Lorenzo Bianconi Cc: Louis Peens Cc: Marcin Wojtas Cc: Mark Lee Cc: Matthias Brugger Cc: NXP Linux Team Cc: Noam Dagan Cc: Russell King Cc: Saeed Bishara Cc: Saeed Mahameed Cc: Sean Wang Cc: Shay Agroskin Cc: Shenwei Wang Cc: Thomas Petazzoni Cc: Tony Nguyen Cc: Vladimir Oltean Cc: Wei Fang Signed-off-by: Sebastian Andrzej Siewior Acked-by: Arthur Kiyanovski Acked-by: Toke Høiland-Jørgensen Acked-by: Ilias Apalodimas Acked-by: Martin Habets Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/r/20230908143215.869913-2-bigeasy@linutronix.de Signed-off-by: Jakub Kicinski commit 4c6a08125f2249531ec01783a5f4317d7342add5 Author: Bob Peterson Date: Thu Sep 21 08:46:43 2023 -0500 gfs2: ignore negated quota changes When lots of quota changes are made, there may be cases in which an inode's quota information is increased and then decreased, such as when blocks are added to a file, then deleted from it. If the timing is right, function do_qc can add pending quota changes to a transaction, then later, another call to do_qc can negate those changes, resulting in a net gain of 0. The quota_change information is recorded in the qc buffer (and qd element of the inode as well). The buffer is added to the transaction by the first call to do_qc, but a subsequent call changes the value from non-zero back to zero. At that point it's too late to remove the buffer_head from the transaction. Later, when the quota sync code is called, the zero-change qd element is discovered and flagged as an assert warning. If the fs is mounted with errors=panic, the kernel will panic. This is usually seen when files are truncated and the quota changes are negated by punch_hole/truncate which uses gfs2_quota_hold and gfs2_quota_unhold rather than block allocations that use gfs2_quota_lock and gfs2_quota_unlock which automatically do quota sync. This patch solves the problem by adding a check to qd_check_sync such that net-zero quota changes already added to the transaction are no longer deemed necessary to be synced, and skipped. In this case references are taken for the qd and the slot from do_qc so those need to be put. The normal sequence of events for a normal non-zero quota change is as follows: gfs2_quota_change do_qc qd_hold slot_hold Later, when the changes are to be synced: gfs2_quota_sync qd_fish qd_check_sync gets qd ref via lockref_get_not_dead do_sync do_qc(QC_SYNC) qd_put lockref_put_or_lock qd_unlock qd_put lockref_put_or_lock In the net-zero change case, we add a check to qd_check_sync so it puts the qd and slot references acquired in gfs2_quota_change and skip the unneeded sync. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 322a487c53f84e4586f5bbed33bd373e25abfe42 Author: Dmitry Antipov Date: Mon Oct 2 20:03:57 2023 +0300 wifi: ath10k: simplify ath10k_peer_create() Use convenient 'list_count_nodes()' in 'ath10k_peer_create()', thus making the latter a bit smaller and simpler. Signed-off-by: Dmitry Antipov Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230704180617.84948-1-dmantipov@yandex.ru commit 788f63c4dc1780c84deb5fe820f6446c28364a0d Author: Dan Carpenter Date: Fri Sep 8 10:03:37 2023 +0300 net: microchip: sparx5: clean up error checking in vcap_show_admin() The vcap_decode_rule() never returns NULL. There is no need to check for that. This code assumes that if it did return NULL we should end abruptly and return success. It is confusing. Fix the check to just be if (IS_ERR()) instead of if (IS_ERR_OR_NULL()). Reported-by: kernel test robot Closes: https://lore.kernel.org/r/202309070831.hTvj9ekP-lkp@intel.com/ Signed-off-by: Dan Carpenter Reviewed-by: Simon Horman Reviewed-by: Daniel Machon Link: https://lore.kernel.org/r/b88eba86-9488-4749-a896-7c7050132e7b@moroto.mountain Signed-off-by: Jakub Kicinski commit 178e1ea6a68f12967ee0e9afc4d79a2939acd43c Author: Dave Jiang Date: Sun Oct 1 07:35:29 2023 -0700 ACPICA: Add defines for CDAT SSLBIS Add upstream port and any port definition for SSLBIS. Link: https://github.com/acpica/acpica/pull/898 Reviewed-by: Jonathan Cameron Signed-off-by: Dave Jiang Signed-off-by: Rafael J. Wysocki commit 43451c4bf9b049e67c48e74a31edd8eced27d8ea Author: Andy Shevchenko Date: Mon Oct 2 16:46:30 2023 +0300 ACPI: property: Document the _DSD data buffer GUID As the rest of the GUIDs document one for _DSD data buffer so it will be eaisier to search for on internet or documentation. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 046ece773cc77ef5d2a1431b188ac3d0840ed150 Author: Andy Shevchenko Date: Mon Oct 2 16:46:29 2023 +0300 ACPI: property: Allow _DSD buffer data only for byte accessors In accordance with ACPI specificication and _DSD data buffer representation the data there is an array of bytes. Hence, accessing it with something longer will create a sparse data which is against of how device property APIs work in general and also not defined in the ACPI specification (see [1]). Fix the code to emit an error if non-byte accessor is used to retrieve _DSD buffer data. Fixes: 369af6bf2c28 ("ACPI: property: Read buffer properties as integers") Link: https://uefi.org/specs/ACPI/6.5/19_ASL_Reference.html#buffer-declare-buffer-object # [1] Signed-off-by: Andy Shevchenko [ rjw: Add missing braces ] Signed-off-by: Rafael J. Wysocki commit 943bcc742ec4d7da4d26477f2188940ecad76569 Author: Bragatheswaran Manickavel Date: Sat Sep 30 22:20:50 2023 +0530 ASoC: dt-bindings: rt5616: Convert to dtschema Convert the rt5616 audio CODEC bindings to DT schema Signed-off-by: Bragatheswaran Manickavel Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230930165050.7793-1-bragathemanick0908@gmail.com Signed-off-by: Mark Brown commit d4e1417bb9e675ea2e4d4a6f993e3a9ae8118ac8 Author: Simon Trimmer Date: Tue Oct 3 10:34:18 2023 +0100 ASoC: cs35l56: Remove unused hibernate wake constants The two CS35L56_HIBERNATE_WAKE_* constants in cs35l56.h aren't used by any of the driver code. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20231003093418.21600-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 553921875ff7bcd5f33eb08afb67fba4e864f646 Author: Andy Shevchenko Date: Mon Oct 2 16:52:18 2023 +0300 ACPI: x86: s2idle: Switch to use acpi_evaluate_dsm_typed() The acpi_evaluate_dsm_typed() provides a way to check the type of the object evaluated by _DSM call. Use it instead of open coded variant. Signed-off-by: Andy Shevchenko Reviewed-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki commit 9fbdc0504244a3c958a0ef4f0ff7016072553f71 Author: Andy Shevchenko Date: Mon Oct 2 16:54:24 2023 +0300 ACPI: PCI: Switch to use acpi_evaluate_dsm_typed() The acpi_evaluate_dsm_typed() provides a way to check the type of the object evaluated by _DSM call. Use it instead of open coded variant. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit bda3df10fb1ee9902df718f38349199e44fea3d0 Author: Raag Jadav Date: Tue Oct 3 13:52:33 2023 +0530 ACPI: LPSS: drop BayTrail and Lynxpoint pinctrl HIDs Platform devices are now created by ACPI core on device enumeration on acpi_bus_scan() -> acpi_bus_attach() path after commit 48459340b92b ("ACPI / scan: use platform bus type by default for _HID enumeration"). No need to create them from LPSS unless we explicitly need to set acpi_lpss_pm_domain for them. Signed-off-by: Raag Jadav Reviewed-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki commit bfb32e2008e278507bd93bff91662422d9cda9da Author: GUO Zihua Date: Wed Aug 2 10:14:36 2023 +0800 x86/sev: Make boot_ghcb_page[] static boot_ghcb_page is not used by any other file, so make it static. This also resolves sparse warning: arch/x86/boot/compressed/sev.c:28:13: warning: symbol 'boot_ghcb_page' was not declared. Should it be static? Signed-off-by: GUO Zihua Signed-off-by: Ingo Molnar Cc: linux-kernel@vger.kernel.org commit f2bbe6f1f446b4c13466ebe7a2bf268bdbe0496b Author: Andy Shevchenko Date: Tue Oct 3 15:10:11 2023 +0300 pinctrl: moorefield: Replace kernel.h by what is actually being used The kernel.h is a mess of unrelated things and we only used it as a proxy to array_size.h, hence switch from former to the latter. Signed-off-by: Andy Shevchenko commit 068866fb5c903a58b8ac341ef763f468d98a013d Author: Andy Shevchenko Date: Tue Oct 3 15:10:11 2023 +0300 pinctrl: merrifield: Replace kernel.h by what is actually being used The kernel.h is a mess of unrelated things and we only used it as a proxy to array_size.h, hence switch from former to the latter. Signed-off-by: Andy Shevchenko commit 1cb71a63f62263b6d5ca5c9f57bb0ac5f5610825 Author: Andy Shevchenko Date: Tue Oct 3 15:10:11 2023 +0300 pinctrl: lynxpoint: Replace kernel.h by what is actually being used The kernel.h is a mess of unrelated things and we only used it as a proxy to array_size.h, hence switch from former to the latter. Signed-off-by: Andy Shevchenko commit 315ef5fcd2d980d00ce452ae429e9301086653b5 Author: Andy Shevchenko Date: Tue Oct 3 15:10:11 2023 +0300 pinctrl: cherryview: Replace kernel.h by what is actually being used The kernel.h is a mess of unrelated things and we only used it as a proxy to array_size.h, hence switch from former to the latter. Signed-off-by: Andy Shevchenko commit a4877a858e80a559b6c0de81bd81d0037dbce5b6 Author: Andy Shevchenko Date: Tue Oct 3 15:10:11 2023 +0300 pinctrl: baytrail: Replace kernel.h by what is actually being used The kernel.h is a mess of unrelated things and we only used it as a proxy to array_size.h, hence switch from former to the latter. Signed-off-by: Andy Shevchenko commit a8c199a2ad067eb23fb2b97f9985398dc809316b Merge: 1209d59070b57 67c9e830d0c4e Author: Andy Shevchenko Date: Tue Oct 3 15:26:04 2023 +0300 Merge patch series "Drop runtime PM support for Baytrail and Lynxpoint pinctrl" Raag Jadav says: This series removes runtime PM support for the devices that are not explicitly attached to acpi_lpss_pm_domain as it is dead code anyway. This has no functional impact and helps reduce their code and memory footprint. bloat-o-meter: ============== Baytrail: add/remove: 2/4 grow/shrink: 0/3 up/down: 49/-103 (-54) Total: Before=16104, After=16050, chg -0.34% Lynxpoint: add/remove: 7/10 grow/shrink: 1/3 up/down: 152/-223 (-71) Total: Before=7506, After=7435, chg -0.95% Link: https://lore.kernel.org/r/20231003114036.27674-1-raag.jadav@intel.com Signed-off-by: Andy Shevchenko commit 1209d59070b577c6319f4aef322093a434544c7e Author: Raag Jadav Date: Tue Oct 3 13:48:24 2023 +0530 pinctrl: intel: refine intel_config_set_pull() function Improve intel_config_set_pull() implementation in Intel pinctrl driver by: - Reducing scope of spinlock by moving unneeded operations out of it. - Utilizing temporary variables for common operations. - Limiting IO operations to positive cases. Signed-off-by: Raag Jadav Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit 67c9e830d0c4e481ebc41d32b8e83bb27689747f Author: Raag Jadav Date: Tue Oct 3 17:10:36 2023 +0530 pinctrl: lynxpoint: drop runtime PM support Since Lynxpoint pinctrl device is not attached to acpi_lpss_pm_domain, runtime PM serves no purpose here. Drop it and switch to pm_sleep_ptr() as now we only have resume handle in place. Signed-off-by: Raag Jadav Acked-by: Mika Westerberg Link: https://lore.kernel.org/r/20231003114036.27674-3-raag.jadav@intel.com Signed-off-by: Andy Shevchenko commit f29047a09b5ed3265a5af68626e40ff772e5e07e Author: Andy Shevchenko Date: Tue Oct 3 15:10:11 2023 +0300 pinctrl: intel: Replace kernel.h by what is actually being used The kernel.h is a mess of unrelated things and we only used it as a proxy to array_size.h, hence switch from former to the latter. Signed-off-by: Andy Shevchenko commit 8fd516168df19af5d32d5c7dc824605b4fb0bc72 Author: Raag Jadav Date: Tue Oct 3 17:10:35 2023 +0530 pinctrl: baytrail: drop runtime PM support Since Baytrail pinctrl device is not attached to acpi_lpss_pm_domain, runtime PM serves no purpose here. Drop it and switch to pm_sleep_ptr() as now we only have suspend and resume handles in place. Signed-off-by: Raag Jadav Acked-by: Mika Westerberg Link: https://lore.kernel.org/r/20231003114036.27674-2-raag.jadav@intel.com Signed-off-by: Andy Shevchenko commit 82cc14c9930c7613da2fcb41a8d4f90c8b4cb048 Author: Andy Shevchenko Date: Tue Oct 3 15:10:11 2023 +0300 pinctrl: Replace kernel.h by what is actually being used The kernel.h is a mess of unrelated things and we only used it as a proxy to array_size.h, hence switch from former to the latter. While at it, group and sort the headers where it makes sense. Signed-off-by: Andy Shevchenko commit 3cd39bc3b11b8d34b7d7c961a35fdfd18b0ebf75 Author: Alejandro Colomar Date: Tue Oct 3 14:59:53 2023 +0300 kernel.h: Move ARRAY_SIZE() to a separate header Touching files so used for the kernel, forces 'make' to recompile most of the kernel. Having those definitions in more granular files helps avoid recompiling so much of the kernel. Signed-off-by: Alejandro Colomar Reviewed-by: Giovanni Cabiddu Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230817143352.132583-2-lucas.segarra.fernandez@intel.com [andy: reduced to cover only string.h for now] Signed-off-by: Andy Shevchenko commit 4c9d0d6f63c72cf121d15ab81ab9e1cdf50ec02c Merge: 736b884a7b68c 4eed047b76fa8 Author: Mark Brown Date: Tue Oct 3 14:21:12 2023 +0100 Remove reset GPIO for AW88261 Merge series from Luca Weiss : The AW88261 chip doesn't have a reset gpio, so remove it from the bindings and from the driver. commit 653e2486450a0d973d15f6ae870cfdfad1b8fe17 Author: Ville Syrjälä Date: Wed Sep 20 17:03:38 2023 +0300 drm/vblank: Warn when silently cancelling vblank works Silently cancelling vblank works is a bit rude, especially if said works do any resource management (eg. free memory). WARN if we ever hit this. TODO: Maybe drm_crtc_vblank_off() should wait for any pending work to reach its target vblank before actually doing anything drastic? Cc: Lyude Paul Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230920140339.28322-2-ville.syrjala@linux.intel.com Reviewed-by: Lyude Paul commit 0d447e927ee86e9ff89010085a47a275c2bb5594 Author: Hugo Villeneuve Date: Wed Sep 27 12:01:53 2023 -0400 dt-bindings: sc16is7xx: convert to YAML Convert binding from text format to YAML. Additions to original text binding: - add rs485 reference. Signed-off-by: Hugo Villeneuve Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230927160153.2717788-3-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman commit 1a0a2a1e57aa8dcdae25229f6e95cf6bd4817faf Author: Hugo Villeneuve Date: Wed Sep 27 12:01:52 2023 -0400 serial: sc16is7xx: use device_property APIs when configuring irda mode Convert driver to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Hugo Villeneuve Link: https://lore.kernel.org/r/20230927160153.2717788-2-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman commit 6905ab83b7b429bfe856536982ae00c1f594ba1f Author: Fabio Estevam Date: Thu Sep 28 11:58:42 2023 -0300 serial: amba-pl011: Do not complain when DMA is absent Many SoCs do not integrate DMA for the amba pl011 UART, causing the following message on boot: uart-pl011 80074000.serial: no DMA platform data The UART still works in PIO, so better not to print such message that may confuse people by causing them to think that there is something wrong with the UART. Change the message to debug level. Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20230928145842.466933-1-festevam@gmail.com Signed-off-by: Greg Kroah-Hartman commit bb5ab77e8543f5c3601635bc2fc40b794add7143 Author: Sascha Hauer Date: Thu Sep 28 08:43:20 2023 +0200 serial: imx: Put DMA enabled UART in separate lock subclass Lockdep complains about possible circular locking dependencies when the i.MX SDMA driver issues console messages under its spinlock. While the SDMA driver calls back into the UART when issuing a message, the i.MX UART driver will never call back into the SDMA driver for this UART, because DMA is explicitly not used for UARTs providing the console. To avoid the lockdep warnings put the UART port lock for console devices into a separate subclass. This fixes possible deadlock warnings like the following which was provoked by adding a printk to the i.MX SDMA driver at a place where the driver holds its spinlock. ====================================================== WARNING: possible circular locking dependency detected 6.6.0-rc3-00045-g517852be693b-dirty #110 Not tainted ------------------------------------------------------ swapper/0/0 is trying to acquire lock: c1818e04 (console_owner){-...}-{0:0}, at: console_flush_all+0x1c4/0x634 but task is already holding lock: c44649e0 (&vc->lock){-...}-{3:3}, at: sdma_int_handler+0xc4/0x368 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&vc->lock){-...}-{3:3}: _raw_spin_lock_irqsave+0x4c/0x68 sdma_prep_dma_cyclic+0x1a8/0x21c imx_uart_startup+0x44c/0x5d4 uart_startup+0x120/0x2b0 uart_port_activate+0x44/0x98 tty_port_open+0x80/0xd0 uart_open+0x18/0x20 tty_open+0x120/0x664 chrdev_open+0xc0/0x214 do_dentry_open+0x1d0/0x544 path_openat+0xbb0/0xea0 do_filp_open+0x5c/0xd4 do_sys_openat2+0xb8/0xf0 sys_openat+0x8c/0xd8 ret_fast_syscall+0x0/0x1c -> #1 (&port_lock_key){-.-.}-{3:3}: _raw_spin_lock_irqsave+0x4c/0x68 imx_uart_console_write+0x164/0x1a0 console_flush_all+0x220/0x634 console_unlock+0x64/0x164 vprintk_emit+0xb0/0x390 vprintk_default+0x24/0x2c _printk+0x2c/0x5c register_console+0x244/0x478 serial_core_register_port+0x5c4/0x618 imx_uart_probe+0x4e0/0x7d4 platform_probe+0x58/0xb0 really_probe+0xc4/0x2e0 __driver_probe_device+0x84/0x1a0 driver_probe_device+0x2c/0x108 __driver_attach+0x94/0x17c bus_for_each_dev+0x7c/0xd0 bus_add_driver+0xc4/0x1cc driver_register+0x7c/0x114 imx_uart_init+0x20/0x40 do_one_initcall+0x7c/0x3c4 kernel_init_freeable+0x17c/0x228 kernel_init+0x14/0x140 ret_from_fork+0x14/0x24 -> #0 (console_owner){-...}-{0:0}: __lock_acquire+0x14b0/0x29a0 lock_acquire.part.0+0xb4/0x264 console_flush_all+0x20c/0x634 console_unlock+0x64/0x164 vprintk_emit+0xb0/0x390 vprintk_default+0x24/0x2c _printk+0x2c/0x5c sdma_int_handler+0xcc/0x368 __handle_irq_event_percpu+0x94/0x2d0 handle_irq_event+0x38/0xd0 handle_fasteoi_irq+0x98/0x248 handle_irq_desc+0x1c/0x2c gic_handle_irq+0x6c/0x90 generic_handle_arch_irq+0x2c/0x64 __irq_svc+0x90/0xbc cpuidle_enter_state+0x1a0/0x4f4 cpuidle_enter+0x30/0x40 do_idle+0x210/0x2b4 cpu_startup_entry+0x28/0x2c rest_init+0xd0/0x184 arch_post_acpi_subsys_init+0x0/0x8 other info that might help us debug this: Chain exists of: console_owner --> &port_lock_key --> &vc->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&vc->lock); lock(&port_lock_key); lock(&vc->lock); lock(console_owner); *** DEADLOCK *** 3 locks held by swapper/0/0: #0: c44649e0 (&vc->lock){-...}-{3:3}, at: sdma_int_handler+0xc4/0x368 #1: c1818d50 (console_lock){+.+.}-{0:0}, at: vprintk_default+0x24/0x2c #2: c1818d08 (console_srcu){....}-{0:0}, at: console_flush_all+0x44/0x634 stack backtrace: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.6.0-rc3-00045-g517852be693b-dirty #110 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) unwind_backtrace from show_stack+0x10/0x14 show_stack from dump_stack_lvl+0x60/0x90 dump_stack_lvl from check_noncircular+0x184/0x1b8 check_noncircular from __lock_acquire+0x14b0/0x29a0 __lock_acquire from lock_acquire.part.0+0xb4/0x264 lock_acquire.part.0 from console_flush_all+0x20c/0x634 console_flush_all from console_unlock+0x64/0x164 console_unlock from vprintk_emit+0xb0/0x390 vprintk_emit from vprintk_default+0x24/0x2c vprintk_default from _printk+0x2c/0x5c _printk from sdma_int_handler+0xcc/0x368 sdma_int_handler from __handle_irq_event_percpu+0x94/0x2d0 __handle_irq_event_percpu from handle_irq_event+0x38/0xd0 handle_irq_event from handle_fasteoi_irq+0x98/0x248 handle_fasteoi_irq from handle_irq_desc+0x1c/0x2c handle_irq_desc from gic_handle_irq+0x6c/0x90 gic_handle_irq from generic_handle_arch_irq+0x2c/0x64 generic_handle_arch_irq from __irq_svc+0x90/0xbc Exception stack(0xc1801ee8 to 0xc1801f30) 1ee0: ffffffff ffffffff 00000001 00030349 00000000 00000012 1f00: 00000000 d7e45f4b 00000012 00000000 d7e16d63 c1810828 00000000 c1801f38 1f20: c108125c c1081260 60010013 ffffffff __irq_svc from cpuidle_enter_state+0x1a0/0x4f4 cpuidle_enter_state from cpuidle_enter+0x30/0x40 cpuidle_enter from do_idle+0x210/0x2b4 do_idle from cpu_startup_entry+0x28/0x2c cpu_startup_entry from rest_init+0xd0/0x184 rest_init from arch_post_acpi_subsys_init+0x0/0x8 Reported-by: Tim van der Staaij Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20230928064320.711603-1-s.hauer@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 00c77bcf2a624e6863121ea0eeb37e35c58ca5d0 Author: Wolfram Sang Date: Fri Sep 22 08:36:42 2023 +0200 serial: core: add comment about definitely used port types When port type 18 was removed, it was deduced that the code could go but its define has to stay because it is used in userspace. Share that knowledge by adding a comment about it. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20230922063642.4120-3-wsa+renesas@sang-engineering.com Signed-off-by: Greg Kroah-Hartman commit b02d006194938593373f189f8d0e84991e6949a2 Author: Wolfram Sang Date: Fri Sep 22 08:36:41 2023 +0200 serial: core: remove cruft from uapi header Remove the GPL boilerplate since we have a valid SPDX entry. Also, remove the outdated filename from the comment. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230922063642.4120-2-wsa+renesas@sang-engineering.com Signed-off-by: Greg Kroah-Hartman commit fb110d1b1c52277f6bf1a6918c1ac8774528eee5 Author: Kees Cook Date: Fri Sep 22 10:52:42 2023 -0700 serial: 8250_pci1xxxx: Annotate struct pci1xxxx_8250 with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct pci1xxxx_8250. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Kumaravel Thiagarajan Cc: Tharun Kumar P Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175242.work.442-kees@kernel.org Signed-off-by: Greg Kroah-Hartman commit f2a7b9cd5b06eba8cf12153507ff77cc80c7b45f Author: Vinod Govindapillai Date: Fri Sep 22 16:30:03 2023 +0300 drm/i915/lnl: update the supported plane formats with FBC FBC is supported with RGB32 8:8:8:8 with or without alpha Bspec: 68904, 69560 Signed-off-by: Vinod Govindapillai Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230922133003.150578-3-vinod.govindapillai@intel.com commit de1ee4e4cd32ce044276ba809c985344cecdf7ac Author: Vinod Govindapillai Date: Fri Sep 22 16:30:02 2023 +0300 drm/i915/lnl: possibility to enable FBC on first three planes In LNL onwards, FBC can be associated to the first three planes. FBC will be enabled on planes first come first served basis until the userspace can select one of these FBC capable planes explicitly. v2: - avoid fbc->state.plane check in intel_fbc_check_plane (Ville) - simplify plane binding register writes (Matt) - Update the subject to reflect that fbc can be enabled only in the first three planes (Matt) v3: - use icl_is_hdr_plane(), use wrapper macro for plane binding register access, comments update and patch split (Ville) v4: - update to the plane binding register access macro Bspec: 69560 Signed-off-by: Vinod Govindapillai Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230922133003.150578-2-vinod.govindapillai@intel.com commit 687911b37e89c80c47d2f105022b678aef604136 Author: Matthew Howell Date: Fri Sep 29 17:40:55 2023 +0000 serial: exar: Add RS-485 support for Sealevel XR17V35X based cards Sealevel XR17V35X based cards utilize DTR to control RS-485 Enable, but the current implementation of 8250_exar uses RTS for the auto-RS485-Enable mode of the XR17V35X UARTs. This patch implements DTR Auto-RS485 on Sealevel cards. Signed-off-by: Matthew Howell Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/4b8ad8ab6728742464c4e048fdeecb2b40522aef.camel@sealevel.com Signed-off-by: Greg Kroah-Hartman commit 6c756af23b3333f14876a80b85028430b243f280 Author: Matthew Howell Date: Fri Sep 29 17:39:49 2023 +0000 serial: exar: Revert "serial: exar: Add support for Sealevel 7xxxC serial cards" Hardware ID of Sealevel 7xxxC cards changed prior to release. This has rendered 14ee78d5932a redundant. This reverts commit 14ee78d5932afeb710c8305196a676a715bfdea8. Signed-off-by: Matthew Howell Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/8ffa2f583ff142c3b0eb6cf51a7c9cef5dbfd320.camel@sealevel.com Signed-off-by: Greg Kroah-Hartman commit 95e8e7eebab58ec8f6c978242a6d143ba238a69e Author: Azeem Shaikh Date: Tue Sep 19 19:21:56 2023 +0000 vt: Replace strlcpy with strscpy strlcpy() reads the entire source buffer first and returns the size of the source string, not the destination string, which can be accidentally misused [1]. The copy_to_user() call uses @len returned from strlcpy() directly without checking its value. This could potentially lead to read overflow. There is no existing bug since @len is always guaranteed to be greater than hardcoded strings in @func_table[kb_func]. But as written it is very fragile and specifically uses a strlcpy() result without sanity checking and using it to copy to userspace. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230919192156.121503-1-azeems@google.com Signed-off-by: Greg Kroah-Hartman commit 29bff582b74ed0bdb7e6986482ad9e6799ea4d2f Author: Randy Dunlap Date: Tue Sep 26 21:41:28 2023 -0700 serial: core: fix kernel-doc for uart_port_unlock_irqrestore() Fix the function name to avoid a kernel-doc warning: include/linux/serial_core.h:666: warning: expecting prototype for uart_port_lock_irqrestore(). Prototype was for uart_port_unlock_irqrestore() instead Fixes: b0af4bcb4946 ("serial: core: Provide port lock wrappers") Signed-off-by: Randy Dunlap Cc: Thomas Gleixner Cc: John Ogness Cc: linux-serial@vger.kernel.org Cc: Greg Kroah-Hartman Cc: Jiri Slaby Reviewed-by: John Ogness Link: https://lore.kernel.org/r/20230927044128.4748-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman commit f34907ecca71177a438bc1f1012e945326f707c3 Author: Kees Cook Date: Fri Sep 22 10:52:45 2023 -0700 mxser: Annotate struct mxser_board with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mxser_board. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Jiri Slaby Cc: Greg Kroah-Hartman Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: linux-serial@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Jiri Slaby Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175245.work.196-kees@kernel.org Signed-off-by: Greg Kroah-Hartman commit 500d179674c674c0fe143d9673d17bc4ee8a88f2 Author: Marek Vasut Date: Thu Sep 21 21:27:29 2023 +0200 dt-bindings: serial: imx: Document wakeup-source property The i.MX UART can be used as a wake-up source, document the 'wakeup-source' property as allowed property. Signed-off-by: Marek Vasut Acked-by: Conor Dooley Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20230921192729.71259-1-marex@denx.de Signed-off-by: Greg Kroah-Hartman commit c5c8a6e93ef6effe00c7022587ddea6a5d8fc1eb Author: Fabio Estevam Date: Thu Sep 21 10:37:33 2023 -0300 dt-bindings: serial: mxs: Fix compatible list imx23 and imx28 are SoCs from the same family (mxs) and they share the same AUART block, so the same programming model. imx23 is the first member of this family. It had an AUART DMA erratum. imx28 is the second member of this family and has this erratum fixed. imx28.dtsi uses the following description: compatible = "fsl,imx28-auart", "fsl,imx23-auart"; Make it valid so that the following schema warning could be avoided: imx28-apx4devkit.dtb: serial@8006a000: compatible: ['fsl,imx28-auart', 'fsl,imx23-auart'] is too long from schema $id: http://devicetree.org/schemas/serial/fsl-mxs-auart.yaml# Signed-off-by: Fabio Estevam Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230921133733.224602-1-festevam@gmail.com Signed-off-by: Greg Kroah-Hartman commit 70a0d499db058b517bf60ec2e954a9a6bb688daa Author: Andy Shevchenko Date: Tue Sep 19 22:55:13 2023 +0300 serial: 8250_dw: Use devm_clk_get_optional_enabled() Use devm_clk_get_optional_enabled() to simplify the code. Signed-off-by: Andy Shevchenko Reviewed-by: Andi Shyti Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230919195513.3197930-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit aef6b8631f9ddf22e9f331608ecc1573943c3c81 Author: Andy Shevchenko Date: Tue Sep 19 22:55:19 2023 +0300 serial: 8250_of: Use devm_clk_get_enabled() Use devm_clk_get_enabled() to simplify the code. Signed-off-by: Andy Shevchenko Reviewed-by: Andi Shyti Link: https://lore.kernel.org/r/20230919195519.3197963-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 182fb83d596b69779a76b5f206f0b506aa889328 Author: Andy Shevchenko Date: Tue Sep 19 22:54:50 2023 +0300 serial: 8250_aspeed_vuart: Use devm_clk_get_enabled() Use devm_clk_get_enabled() to simplify the code. Signed-off-by: Andy Shevchenko Reviewed-by: Andi Shyti Link: https://lore.kernel.org/r/20230919195450.3197881-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 24f2cd019946fc2e88e632d2e24a34c2cc3f2be4 Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:56 2023 +0200 tty: use 'if' in send_break() instead of 'goto' Now, the "jumped-over" code is simple enough to be put inside an 'if'. Do so to make it 'goto'-less. Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-16-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit fd99392b643b824813df2edbaebe26a2136d31e6 Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:55 2023 +0200 tty: don't check for signal_pending() in send_break() msleep_interruptible() will check on its own. So no need to do the check in send_break() before calling the above. Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-15-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit 66619686d187b4a6395316b7f39881e945dce4bc Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:54 2023 +0200 tty: early return from send_break() on TTY_DRIVER_HARDWARE_BREAK If the driver sets TTY_DRIVER_HARDWARE_BREAK, we leave ops->break_ctl() to the driver and return from send_break(). But we do it using a local variable and keep the code flowing through the end of the function. Instead, do 'return' immediately with the ops->break_ctl()'s return value. This way, we don't have to stuff the 'else' branch of the 'if' with the software break handling. And we can re-indent the function too. Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-14-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit e5d0424ac31154e47bfce857ba908bbe861c7a92 Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:53 2023 +0200 tty: convert THROTTLE constants into enum And make an explicit constant for zero too. This allows for easier type checking of the parameter. Note: tty_struct::flow_change is kept as int because include/tty.h (tty_struct) doesn't see tty/tty.h (this enum). Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-13-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit 083cfcf38364d8a3869c46875e8ed08f9d1ee160 Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:52 2023 +0200 tty: tty_buffer: use bool for 'restart' in tty_buffer_unlock_exclusive() It's a boolean value, so no need for 'int' there. Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-12-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit c38f45ef5fe223671949622eba12918e8f41ffcf Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:51 2023 +0200 tty: stop using ndash in kernel-doc An ndash used instead of a single dash renders a bullet to the result. So use only single dashes in kernel-doc. Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-11-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit 71067fb797e074c468221793fe93ba1b58350f1e Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:50 2023 +0200 tty: fix kernel-doc for functions in tty.h tty_kref_get() is already included in Documentation, but is not properly formatted. Fix this. tty_get_baud_rate() is neither properly formatted, nor is included. Fix both. Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-10-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit 3b1a696bb96882d4f85c7cca07383d94cb7c2de3 Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:49 2023 +0200 tty: fix up and plug in tty_ioctl kernel-doc The ioctl helpers are well documented, except they are not plugged in the Documentation. So fix up the minor issues in the kernel-doc and plug it in. The minor issues include: * bad \t on every line (sphinx misinterprets the description otherwise) * missing colon after Return * superfluous \n after the comment * make some struct members and constants a hyperlink * and so on Perhaps better to use --word-diff if one wants to see the "real" changes. Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-9-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit 5b4f9cf3cc339565be1ecd64d608b6ffdfba7c1e Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:48 2023 +0200 tty: invert return values of tty_{,un}throttle_safe() If tty_{,un}throttle_safe() returned true on success (similar to *_trylock()), it would make the conditions in callers more obvious. So perform the switch to these inverted values (and fix the callers). Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-8-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit c2a36609dab3b7c937ab95bfb8b98e72391f772e Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:47 2023 +0200 tty: switch tty_{,un}throttle_safe() to return a bool They return 0 or 1 -- a boolean value, so make it clear than noone should expect negative or other values. Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-7-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit 043c8a7c01ec4b13aa0da11a86425241937b112c Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:46 2023 +0200 tty: n_tty: use do-while in n_tty_check_{,un}throttle() This change gets rid of the complicated exit from the loops. It can be done much easier using do-while loops. Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-6-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit c2b0fb9f69987ddec6bf21f95157603ea4c83aff Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:45 2023 +0200 tty: n_tty: invert the condition in copy_from_read_buf() Make "no numbers available" a fast quit from the function. And do the heavy work outside the 'if'. This makes the code more understandable and conforming to the common kernel coding style. Signed-off-by: "Jiri Slaby (SUSE)" Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230919085156.1578-5-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit 72369f2d493d4c0f4f0ed5a66b19c6912c4837ef Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:44 2023 +0200 tty: n_tty: use min3() in copy_from_read_buf() n is a minimum of: * available chars in the ring buffer * available chars in the ring buffer till the end of the ring buffer * requested number (*nr) We can use min3() for that instead of two min()s. Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-4-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit 1e619477a9c8d6e2ec05a53cda97558fdf9f440e Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:43 2023 +0200 tty: n_tty: rename and retype 'retval' in n_tty_ioctl() The value stored to the current 'retval' is number of characters. It is both obtained and put to user as unsigned. So make its type unsigned. And provided it's not a "return value" per se, rename it to 'num'. Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-3-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit 4a2ad26613867a9a6c49abf7b9319e2a5f6671b0 Author: Jiri Slaby (SUSE) Date: Tue Sep 19 10:51:42 2023 +0200 tty: n_tty: use 'retval' instead of 'c' In n_tty_read(), there is a separate int variable 'c' and is used only to hold an int value returned from job_control(). There is also a 'retval' variable typed ssize_t. So drop this single occurrence of 'c' and reuse 'retval' which is used on all other places to hold the value returned from n_tty_read(). Note that 'retval' needs not be initialized now. Drop that. Signed-off-by: "Jiri Slaby (SUSE)" Link: https://lore.kernel.org/r/20230919085156.1578-2-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman commit c77247a52be2359fbf13daabb16fb318df41e1c3 Author: Andy Shevchenko Date: Mon Sep 18 13:36:48 2023 +0300 serial: 8250_bcm7271: Use dev_err_probe() instead of dev_err() Make the error messages format unified by switching to use dev_err_probe() where it makes sense. This also helps simplifing the code. Signed-off-by: Andy Shevchenko Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20230918103648.1185663-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 1412e667efa4de0ebad7c114ad434efca582ed43 Merge: e27aca3760c08 2d61298fdd7b5 Author: Paolo Abeni Date: Tue Oct 3 13:51:06 2023 +0200 Merge branch 'net-dsa-hsr-enable-hsr-hw-offloading-for-ksz9477' Lukasz Majewski says: ==================== net: dsa: hsr: Enable HSR HW offloading for KSZ9477 This patch series provides support for HSR HW offloading in KSZ9477 switch IC. To test this feature: ip link add name hsr0 type hsr slave1 lan1 slave2 lan2 supervision 45 version 1 ip link set dev lan1 up ip link set dev lan2 up ip a add 192.168.0.1/24 dev hsr0 ip link set dev hsr0 up To remove HSR network device: ip link del hsr0 To test if one can adjust MAC address: ip link set lan2 address 00:01:02:AA:BB:CC It is also possible to create another HSR interface, but it will only support HSR is software - e.g. ip link add name hsr1 type hsr slave1 lan3 slave2 lan4 supervision 45 version 1 Test HW: Two KSZ9477-EVB boards with HSR ports set to "Port1" and "Port2". Performance SW used: nuttcp -S --nofork nuttcp -vv -T 60 -r 192.168.0.2 nuttcp -vv -T 60 -t 192.168.0.2 Code: v6.6.0-rc2+ Linux net-next repository SHA1: 5a1b322cb0b7d0d33a2d13462294dc0f46911172 Tested HSR v0 and v1 Results: With KSZ9477 offloading support added: RX: 100 Mbps TX: 98 Mbps With no offloading RX: 63 Mbps TX: 63 Mbps ==================== Link: https://lore.kernel.org/r/20230922133108.2090612-1-lukma@denx.de Signed-off-by: Paolo Abeni commit 2d61298fdd7b57a81b2ef9ad99c5752f9bed6d14 Author: Lukasz Majewski Date: Fri Sep 22 15:31:08 2023 +0200 net: dsa: microchip: Enable HSR offloading for KSZ9477 This patch adds functions for providing in KSZ9477 switch HSR (High-availability Seamless Redundancy) hardware offloading. According to AN3474 application note following features are provided: - TX packet duplication from host to switch (NETIF_F_HW_HSR_DUP) - RX packet duplication discarding - Prevention of packet loop For last two ones - there is a probability that some packets will not be filtered in HW (in some special cases - described in AN3474). Hence, the HSR core code shall be used to discard those not caught frames. Moreover, some switch registers adjustments are required - like setting MAC address of HSR network interface. Additionally, the KSZ9477 switch has been configured to forward frames between HSR ports (e.g. 1,2) members to provide support for NETIF_F_HW_HSR_FWD flag. Join and leave functions are written in a way, that are executed with single port - i.e. configuration is NOT done only when second HSR port is configured. Co-developed-by: Vladimir Oltean Signed-off-by: Vladimir Oltean Signed-off-by: Lukasz Majewski Reviewed-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit e5de2ad163e7df2c2af7d262ee9dec682f580444 Author: Vladimir Oltean Date: Fri Sep 22 15:31:07 2023 +0200 net: dsa: microchip: move REG_SW_MAC_ADDR to dev->info->regs[] Defining macros which have the same name but different values is bad practice, because it makes it hard to avoid code duplication. The same code does different things, depending on the file it's placed in. Case in point, we want to access REG_SW_MAC_ADDR from ksz_common.c, but currently we can't, because we don't know which kszXXXX_reg.h to include from the common code. Remove the REG_SW_MAC_ADDR_{0..5} macros from ksz8795_reg.h and ksz9477_reg.h, and re-add this register offset to the dev->info->regs[] array. Signed-off-by: Vladimir Oltean Signed-off-by: Lukasz Majewski Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit 5e5db71a92c537ff37149b58bba6a8b2588a46f0 Author: Lukasz Majewski Date: Fri Sep 22 15:31:06 2023 +0200 net: dsa: tag_ksz: Extend ksz9477_xmit() for HSR frame duplication The KSZ9477 has support for HSR (High-Availability Seamless Redundancy). One of its offloading (i.e. performed in the switch IC hardware) features is to duplicate received frame to both HSR aware switch ports. To achieve this goal - the tail TAG needs to be modified. To be more specific, both ports must be marked as destination (egress) ones. The NETIF_F_HW_HSR_DUP flag indicates that the device supports HSR and assures (in HSR core code) that frame is sent only once from HOST to switch with tail tag indicating both ports. Signed-off-by: Lukasz Majewski Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit 6715042cd112e1db971583e2eed89b90d6f9b139 Author: Vladimir Oltean Date: Fri Sep 22 15:31:05 2023 +0200 net: dsa: notify drivers of MAC address changes on user ports In some cases, drivers may need to veto the changing of a MAC address on a user port. Such is the case with KSZ9477 when it offloads a HSR device, because it programs the MAC address of multiple ports to a shared hardware register. Those ports need to have equal MAC addresses for the lifetime of the HSR offload. Signed-off-by: Vladimir Oltean Signed-off-by: Lukasz Majewski Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit fefe5dc4afeafe896c90d5b20b605f2759343c3b Author: Vladimir Oltean Date: Fri Sep 22 15:31:04 2023 +0200 net: dsa: propagate extack to ds->ops->port_hsr_join() Drivers can provide meaningful error messages which state a reason why they can't perform an offload, and dsa_slave_changeupper() already has the infrastructure to propagate these over netlink rather than printing to the kernel log. So pass the extack argument and modify the xrs700x driver's port_hsr_join() prototype. Also take the opportunity and use the extack for the 2 -EOPNOTSUPP cases from xrs700x_hsr_join(). Signed-off-by: Vladimir Oltean Signed-off-by: Lukasz Majewski Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Signed-off-by: Paolo Abeni commit ffa46bbc5892ebba8a95c839dc302cad7f22c209 Author: Masahiro Yamada Date: Sat Sep 30 19:38:47 2023 +0900 kbuild: rpm-pkg: generate kernel.spec in rpmbuild/SPECS/ kernel.spec is the last piece that resides outside the rpmbuild/ directory. Move all the RPM-related files to rpmbuild/ consistently. Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor commit f0fb62e090bdf38eb3c7e127f21858708b55b71b Author: Dmitry Antipov Date: Fri Sep 29 18:45:20 2023 +0300 wifi: rtlwifi: use unsigned long for rtl_bssid_entry timestamp Since 'age' of 'struct rtl_bssid_entry' is in jiffies, prefer 'unsigned long' over 'u32' to avoid possible truncation in 'rtl_collect_scan_list()' and thus weird result in 'rtl_scan_list_expire()'. Compile tested only. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230929154524.222498-1-dmantipov@yandex.ru commit 3391ee7f9ea508c375d443cd712c2e699be235b4 Author: Dmitry Antipov Date: Thu Sep 28 08:23:19 2023 +0300 wifi: rtlwifi: fix EDCA limit set by BT coexistence In 'rtl92c_dm_check_edca_turbo()', 'rtl88e_dm_check_edca_turbo()', and 'rtl8723e_dm_check_edca_turbo()', the DL limit should be set from the corresponding field of 'rtlpriv->btcoexist' rather than UL. Compile tested only. Fixes: 0529c6b81761 ("rtlwifi: rtl8723ae: Update driver to match 06/28/14 Realtek version") Fixes: c151aed6aa14 ("rtlwifi: rtl8188ee: Update driver to match Realtek release of 06282014") Fixes: beb5bc402043 ("rtlwifi: rtl8192c-common: Convert common dynamic management routines for addition of rtl8192se and rtl8192de") Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230928052327.120178-1-dmantipov@yandex.ru commit 2ecfe6f07e8e6257cad3d3290c5aec2102120041 Author: Shiji Yang Date: Sat Sep 23 09:01:01 2023 +0800 wifi: rt2x00: fix MT7620 low RSSI issue On Mediatek vendor driver[1], MT7620 (RT6352) uses different RSSI base value '-2' compared to the other RT2x00 chips. This patch introduces the SoC specific base value to fix the low RSSI value reports on MT7620. [1] Found on MT76x2E_MT7620_LinuxAP_V3.0.4.0_P3 ConvertToRssi(). Signed-off-by: Shiji Yang Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/TYAP286MB031571CDB146C414A908A66DBCFEA@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM commit fc158f91360da3549b3772c686fe2d04a49ebb14 Author: Po-Hao Huang Date: Fri Sep 29 08:40:24 2023 +0800 wifi: rtw89: refine bandwidth 160MHz uplink OFDMA performance This improves 160MHz performance degradation with certain APs. Some ICs transmit preamble that are hard to decode by others, continuous retries then yield low throughput. Fix it with pre-calculated antenna matrices. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230929004024.7504-3-pkshih@realtek.com commit ccd88204275174365cdb5d35ae37816b09c10063 Author: Po-Hao Huang Date: Fri Sep 29 08:40:23 2023 +0800 wifi: rtw89: refine uplink trigger based control mechanism Rename support_ul_tb_ctrl to waveform_ctrl since we need to do more trigger based control and the naming could be confusing. Move related code to leaf function so we make each functions separate and can be easier to maintain. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230929004024.7504-2-pkshih@realtek.com commit e9d9027e4ac97627e3fea4a169f887ff204573e6 Author: Zong-Zhe Yang Date: Wed Sep 27 15:21:56 2023 +0800 wifi: rtw89: 8851b: update TX power tables to R34 Update TX power tables to RF version R34. * tweak values of CN for its new regulation * add TX power by rate table for RFE (RF Front End) type 2 * add TX shape table for RU limit Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo commit e4a8efb52ef0ecac9e43cc809060f3f6a62f899f Author: Zong-Zhe Yang Date: Wed Sep 27 15:21:55 2023 +0800 wifi: rtw89: 8852b: update TX power tables to R35 Update TX power tables to RF version R35. * tweak values of CN for its new regulation * add TX shape table for RU limit Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo commit ae22f2b9f53555c7d07c047acd2f9e5766bd701f Author: Zong-Zhe Yang Date: Wed Sep 27 15:21:54 2023 +0800 wifi: rtw89: 8852c: update TX power tables to R67 Update TX power tables to RF version R67. * tweak values of CN for its new regulation * configure values of Thailand for its regulation * add TX shape table for RU limit Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo commit 1af55a76e0732f4ab77c1bfaf0e6409853dd7007 Author: Zong-Zhe Yang Date: Wed Sep 27 15:21:53 2023 +0800 wifi: rtw89: regd: configure Thailand in regulation type Realtek RFE (RF Front End) parameters can consider Thailand individually now, so we add it into regulation type enum. Then, we map country code TH to RTW89_ETSI/RTW89_THAILAND according to band. The RF TX power tables will add entries for RTW89_THAILAND in the following. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo commit 4074532758c5c367d3fcb8d124150824a254659d Author: Jack Brennen Date: Tue Sep 26 08:40:44 2023 -0400 modpost: Optimize symbol search from linear to binary search Modify modpost to use binary search for converting addresses back into symbol references. Previously it used linear search. This change saves a few seconds of wall time for defconfig builds, but can save several minutes on allyesconfigs. Before: $ make LLVM=1 -j128 allyesconfig vmlinux -s KCFLAGS="-Wno-error" $ time scripts/mod/modpost -M -m -a -N -o vmlinux.symvers vmlinux.o 198.38user 1.27system 3:19.71elapsed After: $ make LLVM=1 -j128 allyesconfig vmlinux -s KCFLAGS="-Wno-error" $ time scripts/mod/modpost -M -m -a -N -o vmlinux.symvers vmlinux.o 11.91user 0.85system 0:12.78elapsed Signed-off-by: Jack Brennen Tested-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit e27aca3760c08b7b05aea71068bd609aa93e7b35 Author: Raju Lakkaraju Date: Mon Sep 25 13:30:59 2023 +0530 net: sfp: add quirk for FS's 2.5G copper SFP Add a quirk for a copper SFP that identifies itself as "FS" "SFP-2.5G-T". This module's PHY is inaccessible, and can only run at 2500base-X with the host without negotiation. Add a quirk to enable the 2500base-X interface mode with 2500base-T support and disable auto negotiation. Signed-off-by: Raju Lakkaraju Link: https://lore.kernel.org/r/20230925080059.266240-1-Raju.Lakkaraju@microchip.com Signed-off-by: Paolo Abeni commit f25e621f5d4c423fa7217afbddd427007b0e0ec0 Author: Beniamino Galvani Date: Sun Sep 24 17:30:14 2023 +0200 ipv6: mark address parameters of udp_tunnel6_xmit_skb() as const The function doesn't modify the addresses passed as input, mark them as 'const' to make that clear. Signed-off-by: Beniamino Galvani Reviewed-by: Guillaume Nault Link: https://lore.kernel.org/r/20230924153014.786962-1-b.galvani@gmail.com Signed-off-by: Paolo Abeni commit 32030345297e2a5c94afabb1427862299931b654 Author: Linus Walleij Date: Sun Sep 24 10:19:02 2023 +0200 net: phy: amd: Support the Altima AMI101L The Altima AC101L is obviously compatible with the AMD PHY, as seen by reading the datasheet. Datasheet: https://docs.broadcom.com/doc/AC101L-DS05-405-RDS.pdf Signed-off-by: Linus Walleij Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20230924-ac101l-phy-v1-1-5e6349e28aa4@linaro.org Signed-off-by: Paolo Abeni commit ef35bed6fad6eda8de0277eda77803c748f306d1 Author: Christophe JAILLET Date: Sun Sep 24 10:03:07 2023 +0200 udp_tunnel: Use flex array to simplify code 'n_tables' is small, UDP_TUNNEL_NIC_MAX_TABLES = 4 as a maximum. So there is no real point to allocate the 'entries' pointers array with a dedicate memory allocation. Using a flexible array for struct udp_tunnel_nic->entries avoids the overhead of an additional memory allocation. This also saves an indirection when the array is accessed. Finally, __counted_by() can be used for run-time bounds checking if configured and supported by the compiler. Signed-off-by: Christophe JAILLET Reviewed-by: Willem de Bruijn Link: https://lore.kernel.org/r/4a096ba9cf981a588aa87235bb91e933ee162b3d.1695542544.git.christophe.jaillet@wanadoo.fr Signed-off-by: Paolo Abeni commit 13efc44ca644257dd35c1b380294086505e69e7e Author: Linus Walleij Date: Sat Sep 23 20:38:22 2023 +0200 net: ixp4xx_eth: Specify min/max MTU As we don't specify the MTU in the driver, the framework will fall back to 1500 bytes and this doesn't work very well when we try to attach a DSA switch: eth1: mtu greater than device maximum ixp4xx_eth c800a000.ethernet eth1: error -22 setting MTU to 1504 to include DSA overhead I checked the developer docs and the hardware can actually do really big frames, so update the driver accordingly. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230923-ixp4xx-eth-mtu-v1-1-9e88b908e1b2@linaro.org Signed-off-by: Paolo Abeni commit 9f76d606269be7bd1ee5942b7c9c21bb0b43825f Author: Wang Jinchao Date: Thu Aug 3 17:44:00 2023 +0800 x86/boot: Harmonize the style of array-type parameter for fixup_pointer() calls The usage of '&' before the array parameter is redundant because '&array' is equivalent to 'array'. Therefore, there is no need to include '&' before the array parameter. In fact, using '&' can cause more confusion, especially for individuals who are not familiar with the address-of operation for arrays. They might mistakenly believe that one is different from the other and spend additional time realizing that they are actually the same. Harmonizing the style by removing the unnecessary '&' would save time for those individuals. Signed-off-by: Wang Jinchao Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/ZMt24BGEX9IhPSY6@fedora commit bceef326bc87781abb5139898d5f2807881194d9 Author: Jan Kara Date: Tue Oct 3 11:19:02 2023 +0200 udf: Avoid unneeded variable length array in struct fileIdentDesc impUse variable length array in struct fileIdentDesc is never used. It serves only for documentation purposes of the on-disk format. Remove it from the struct so that it doesn't confuse the compiler and reviewers. Reported-by: "Gustavo A. R. Silva" References: https://lore.kernel.org/all/ZRrsYkKIQe8K6F/t@work Signed-off-by: Jan Kara commit 2a565258b3f4bbdc7a3c09cd02082cb286a7bffc Author: Yazen Ghannam Date: Thu Aug 3 10:04:30 2023 -0500 x86/amd_nb: Use Family 19h Models 60h-7Fh Function 4 IDs Three PCI IDs for DF Function 4 were defined but not used. Add them to the "link" list. Fixes: f8faf3496633 ("x86/amd_nb: Add AMD PCI IDs for SMN communication") Fixes: 23a5b8bb022c ("x86/amd_nb: Add PCI ID for family 19h model 78h") Signed-off-by: Yazen Ghannam Signed-off-by: Ingo Molnar Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230803150430.3542854-1-yazen.ghannam@amd.com commit 8b01de80306cbd914be9c45bce30206a49699141 Author: Masahiro Yamada Date: Sun Aug 6 23:59:57 2023 +0900 x86/headers: Remove All *.S files under arch/x86/ have been converted to include instead of . Remove . Signed-off-by: Masahiro Yamada Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230806145958.380314-3-masahiroy@kernel.org commit 94ea9c05219518ef7ec90b7ef2cb108476df764b Author: Masahiro Yamada Date: Sun Aug 6 23:59:56 2023 +0900 x86/headers: Replace #include with #include The following commit: ddb5cdbafaaa ("kbuild: generate KSYMTAB entries by modpost") deprecated , which is now a wrapper of . Use in *.S as well as in *.c files. After all the lines are replaced, and will be removed. Signed-off-by: Masahiro Yamada Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230806145958.380314-2-masahiroy@kernel.org commit b425232c676b264faa9edb0b6cece4bd08d8ee82 Author: Masahiro Yamada Date: Sun Aug 6 23:59:55 2023 +0900 x86/headers: Remove unnecessary #include There is no EXPORT_SYMBOL() line there, hence #include is unnecessary. Signed-off-by: Masahiro Yamada Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230806145958.380314-1-masahiroy@kernel.org commit 001470fed5959d01faecbd57fcf2f60294da0de1 Author: Yuntao Wang Date: Mon Aug 7 16:45:47 2023 +0800 x86/boot: Fix incorrect startup_gdt_descr.size Since the size value is added to the base address to yield the last valid byte address of the GDT, the current size value of startup_gdt_descr is incorrect (too large by one), fix it. [ mingo: This probably never mattered, because startup_gdt[] is only used in a very controlled fashion - but make it consistent nevertheless. ] Fixes: 866b556efa12 ("x86/head/64: Install startup GDT") Signed-off-by: Yuntao Wang Signed-off-by: Ingo Molnar Cc: "H. Peter Anvin" Link: https://lore.kernel.org/r/20230807084547.217390-1-ytcoode@gmail.com commit 8788c6c2feb3600ba1a2f84ac5d258af4a284cea Author: Atul Kumar Pant Date: Mon Aug 7 17:48:34 2023 +0530 locking/debug: Fix debugfs API return value checks to use IS_ERR() Update the checking of return values from debugfs_create_file() and debugfs_create_dir() to use IS_ERR(). Signed-off-by: Atul Kumar Pant Signed-off-by: Ingo Molnar Acked-by: Waiman Long Link: https://lore.kernel.org/r/20230807121834.7438-1-atulpant.linux@gmail.com commit f01821b7634895feab1a47235387d122e0dd4faa Merge: 35766690d675f 6532e257aa736 Author: Paolo Abeni Date: Tue Oct 3 10:05:24 2023 +0200 Merge branch 'tcp_metrics-four-fixes' Eric Dumazet says: ==================== tcp_metrics: four fixes Looking at an inconclusive syzbot report, I was surprised to see that tcp_metrics cache on my host was full of useless entries, even though I have /proc/sys/net/ipv4/tcp_no_metrics_save set to 1. While looking more closely I found a total of four issues. ==================== Link: https://lore.kernel.org/r/20230922220356.3739090-1-edumazet@google.com Signed-off-by: Paolo Abeni commit 6532e257aa73645e28dee5b2232cc3c88be62083 Author: Eric Dumazet Date: Fri Sep 22 22:03:56 2023 +0000 tcp_metrics: optimize tcp_metrics_flush_all() This is inspired by several syzbot reports where tcp_metrics_flush_all() was seen in the traces. We can avoid acquiring tcp_metrics_lock for empty buckets, and we should add one cond_resched() to break potential long loops. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Acked-by: Neal Cardwell Signed-off-by: Paolo Abeni commit a135798e6e200ecb2f864cecca6d257ba278370c Author: Eric Dumazet Date: Fri Sep 22 22:03:55 2023 +0000 tcp_metrics: do not create an entry from tcp_init_metrics() tcp_init_metrics() only wants to get metrics if they were previously stored in the cache. Creating an entry is adding useless costs, especially when tcp_no_metrics_save is set. Fixes: 51c5d0c4b169 ("tcp: Maintain dynamic metrics in local cache.") Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Acked-by: Neal Cardwell Signed-off-by: Paolo Abeni commit 081480014a64a69d901f8ef1ffdd56d6085cf87e Author: Eric Dumazet Date: Fri Sep 22 22:03:54 2023 +0000 tcp_metrics: properly set tp->snd_ssthresh in tcp_init_metrics() We need to set tp->snd_ssthresh to TCP_INFINITE_SSTHRESH in the case tcp_get_metrics() fails for some reason. Fixes: 9ad7c049f0f7 ("tcp: RFC2988bis + taking RTT sample from 3WHS for the passive open side") Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Acked-by: Neal Cardwell Signed-off-by: Paolo Abeni commit cbc3a153222805d65f821e10f4f78b6afce06f86 Author: Eric Dumazet Date: Fri Sep 22 22:03:53 2023 +0000 tcp_metrics: add missing barriers on delete When removing an item from RCU protected list, we must prevent store-tearing, using rcu_assign_pointer() or WRITE_ONCE(). Fixes: 04f721c671656 ("tcp_metrics: Rewrite tcp_metrics_flush_all") Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Acked-by: Neal Cardwell Signed-off-by: Paolo Abeni commit de80193308f43d3ae52cd3561e8ba77cd1437311 Merge: 54aee5f15b834 8a749fd1a8720 Author: Ingo Molnar Date: Tue Oct 3 09:32:25 2023 +0200 Merge tag 'v6.6-rc4' into perf/core, to pick up fixes Signed-off-by: Ingo Molnar commit 9c303439c4e9a56b96b655f3cc921a01268f7945 Author: Mathias Krause Date: Thu Sep 28 20:20:19 2023 +0200 drm/i915: Clarify type evolution of uabi_node/uabi_engines Chaining user engines happens in multiple passes during driver initialization, mutating its type along the way. It starts off with a simple lock-less linked list (struct llist_node/head) populated by intel_engine_add_user() which later gets sorted and converted to an intermediate regular list (struct list_head) just to be converted once more to its final rb-tree structure (struct rb_node/root) in intel_engines_driver_register(). All of these types overlay the uabi_node/uabi_engines members which is unfortunate but safe if one takes care about using the rb-tree based structure only after the conversion has completed. However, mistakes happen and commit 1ec23ed7126e ("drm/i915: Use uabi engines for the default engine map") violated that assumption, as the multiple type evolution was all to easy hidden behind casts papering over it. Make the type evolution of uabi_node/uabi_engines more visible by putting all members into an anonymous union and use the correctly typed member in its various users. This allows us to drop quite some ugly casts and, hopefully, make the evolution of the members better recognisable to avoid future mistakes. Signed-off-by: Mathias Krause Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20230928182019.10256-3-minipli@grsecurity.net commit 2b562f032fc2594fb3fac22b7a2eb3c1969a7ba3 Author: Mathias Krause Date: Thu Sep 28 20:20:18 2023 +0200 drm/i915: Register engines early to avoid type confusion Commit 1ec23ed7126e ("drm/i915: Use uabi engines for the default engine map") switched from using for_each_engine() to for_each_uabi_engine() to iterate over the user engines. While this seems to be a sensible change, it's only safe to do when the engines are actually chained using the rb-tree structure which is not the case during early driver initialization where it can be either a lock-less list or regular double-linked list. In fact, the modesetting initialization code may end up calling default_engines() through the fb helper code while the engines list is still llist_node-based: i915_driver_probe() -> intel_display_driver_probe() -> intel_fbdev_init() -> drm_fb_helper_init() -> drm_client_init() -> drm_client_open() -> drm_file_alloc() -> i915_driver_open() -> i915_gem_open() -> i915_gem_context_open() -> i915_gem_create_context() -> default_engines() Using for_each_uabi_engine() in default_engines() is therefore wrong, as it would try to interpret the llist as rb-tree, making it find no engine at all, as the rb_left and rb_right members will still be NULL, as they haven't been initialized yet. To fix this type confusion register the engines earlier and at the same time reduce the amount of code that has to deal with the intermediate llist state. Reported-by: sanity checks in grsecurity Suggested-by: Tvrtko Ursulin Fixes: 1ec23ed7126e ("drm/i915: Use uabi engines for the default engine map") Signed-off-by: Mathias Krause Cc: Jonathan Cavitt Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20230928182019.10256-2-minipli@grsecurity.net [tursulin: fixed commit tag typo] commit 3e32552652917f10c0aa8ac75cdc8f0b8d257dec Author: Dave Hansen Date: Mon Oct 2 15:00:45 2023 -0700 x86/boot: Move x86_cache_alignment initialization to correct spot c->x86_cache_alignment is initialized from c->x86_clflush_size. However, commit fbf6449f84bf moved c->x86_clflush_size initialization to later in boot without moving the c->x86_cache_alignment assignment: fbf6449f84bf ("x86/sev-es: Set x86_virt_bits to the correct value straight away, instead of a two-phase approach") This presumably left c->x86_cache_alignment set to zero for longer than it should be. The result was an oops on 32-bit kernels while accessing a pointer at 0x20. The 0x20 came from accessing a structure member at offset 0x10 (buffer->cpumask) from a ZERO_SIZE_PTR=0x10. kmalloc() can evidently return ZERO_SIZE_PTR when it's given 0 as its alignment requirement. Move the c->x86_cache_alignment initialization to be after c->x86_clflush_size has an actual value. Fixes: fbf6449f84bf ("x86/sev-es: Set x86_virt_bits to the correct value straight away, instead of a two-phase approach") Signed-off-by: Dave Hansen Signed-off-by: Ingo Molnar Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/20231002220045.1014760-1-dave.hansen@linux.intel.com commit 966e2ec6ef3fa786defe07ebca6795f284dde5b0 Author: Marek Szyprowski Date: Thu Sep 28 22:27:24 2023 +0200 ARM: exynos_defconfig: replace SATA_AHCI_PLATFORM with AHCI_DWC driver Commit 33629d35090f ("ata: ahci: Add DWC AHCI SATA controller support") moved support for "snps,dwc-ahci" compatible (present in exynos5250.dtsi) to separate DWC AHCI driver, so reflect this change in exynos_defconfig. Signed-off-by: Marek Szyprowski Link: https://lore.kernel.org/r/20230928202724.340420-1-m.szyprowski@samsung.com Signed-off-by: Krzysztof Kozlowski commit de1f6a85398e6bff2e6dfa326531daf6358b64dc Author: Marek Szyprowski Date: Thu Sep 28 22:27:36 2023 +0200 ARM: multi_v7_defconfig: add AHCI_DWC driver Commit 33629d35090f ("ata: ahci: Add DWC AHCI SATA controller support") moved support for "snps,dwc-ahci" compatible (present in exynos5250.dtsi) to separate DWC AHCI driver, so enable this driver in multi_v7_defconfig. Signed-off-by: Marek Szyprowski Link: https://lore.kernel.org/r/20230928202736.340435-1-m.szyprowski@samsung.com Signed-off-by: Krzysztof Kozlowski commit 0264be0ac4069530a6fd10dc22f40d3bae343b24 Author: Marek Szyprowski Date: Fri Sep 29 14:18:00 2023 +0200 ARM: multi_v7_defconfig: make Exynos related PHYs modules Exynos Display Port PHY and Exynos MIPI Video PHY drivers are not essential to boot on the Exynos based system, so make them modules instead of build-in. Signed-off-by: Marek Szyprowski Link: https://lore.kernel.org/r/20230929121800.1722211-1-m.szyprowski@samsung.com Signed-off-by: Krzysztof Kozlowski commit 0fe4f414c7c8ff8559206b0b6d7724cacb6f2463 Author: Svyatoslav Ryhel Date: Mon Jul 31 10:36:13 2023 +0300 ARM: s5pv210_defconfig: enable IIO required by MAX17040 After adding support for passing temperature data from thermal sensor to MAX17040 it got dependency on CONFIG_IIO. From all defconfigs using MAX17040 only s5pv210_defconfig did not have IIO already enabled so let's enable it to avoid regression. Signed-off-by: Svyatoslav Ryhel Link: https://lore.kernel.org/r/20230731073613.10394-5-clamor95@gmail.com Signed-off-by: Krzysztof Kozlowski commit 114b0ff62a6510eb218660cb4925b4c4a01cdd84 Author: Joel Granados Date: Mon Oct 2 23:02:03 2023 +0100 cdrom: Remove now superfluous sentinel element from ctl_table array This commit comes at the tail end of a greater effort to remove the empty elements at the end of the ctl_table arrays (sentinels) which will reduce the overall build time size of the kernel and run time memory bloat by ~64 bytes per sentinel (further information Link : https://lore.kernel.org/all/ZO5Yx5JFogGi%2FcBo@bombadil.infradead.org/) Remove sentinel element from cdrom_table Signed-off-by: Joel Granados Link: https://lore.kernel.org/lkml/20231002-jag-sysctl_remove_empty_elem_drivers-v2-1-02dd0d46f71e@samsung.com Reviewed-by: Phillip Potter Link: https://lore.kernel.org/lkml/20231002214528.15529-1-phil@philpotter.co.uk Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20231002220203.15637-2-phil@philpotter.co.uk Signed-off-by: Jens Axboe commit b8b8b4e0c052b2c06e1c4820a8001f4e0f77900f Author: Mika Westerberg Date: Mon Sep 25 11:05:38 2023 +0300 ata: ahci: Add Intel Alder Lake-P AHCI controller to low power chipsets list Intel Alder Lake-P AHCI controller needs to be added to the mobile chipsets list in order to have link power management enabled. Without this the CPU cannot enter lower power C-states making idle power consumption high. Cc: Koba Ko Signed-off-by: Mika Westerberg Signed-off-by: Damien Le Moal commit 1b947279798fd51bef46e8241102f5b896add021 Author: Damien Le Moal Date: Mon Aug 28 13:10:28 2023 +0900 ata: libata: Cleanup inline DMA helper functions Simplify the inline DMA helper functions ata_using_mwdma(), ata_using_udma() and ata_dma_enabled() to directly return as a boolean the result of their test condition. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Tested-by: Chia-Lin Kao (AceLan) Tested-by: Geert Uytterhoeven Reviewed-by: Martin K. Petersen commit 0fecb50891aa8731f39c65ab59c3f5d3cf2ce468 Author: Damien Le Moal Date: Tue Aug 29 11:44:10 2023 +0900 ata: libata-eh: Reduce "disable device" message verbosity There is no point in warning about a device being disabled when we expect it to be, that is, on suspend, shutdown or when detaching the device. Suppress the message "disable device" for these cases by introducing the EH static function ata_eh_dev_disable() and by using it in ata_eh_unload() and ata_eh_detach_dev(). ata_dev_disable() code is modified to call this new function after printing the "disable device" message. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Tested-by: Chia-Lin Kao (AceLan) Tested-by: Geert Uytterhoeven Reviewed-by: Martin K. Petersen commit 7f95731c74d73d07958889a685bbfc13e8d82721 Author: Damien Le Moal Date: Tue Aug 29 11:25:47 2023 +0900 ata: libata-eh: Improve reset error messages Some drives are really slow to spinup on resume, resulting is a very slow response to COMRESET and to error messages such as: ata1: COMRESET failed (errno=-16) ata1: link is slow to respond, please be patient (ready=0) ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300) ata1.00: configured for UDMA/133 Given that the slowness of the response is indicated with the message "link is slow to respond..." and that resets are retried until the device is detected as online after up to 1min (ata_eh_reset_timeouts), there is no point in printing the "COMRESET failed" error message. Let's not scare the user with non fatal errors and only warn about reset failures in ata_eh_reset() when all reset retries have been exhausted. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Tested-by: Chia-Lin Kao (AceLan) Tested-by: Geert Uytterhoeven Reviewed-by: Martin K. Petersen commit 88b9f89286781ebfd3931867f6a6f037236bbeab Author: Damien Le Moal Date: Wed Aug 30 16:59:04 2023 +0900 ata: libata-sata: Improve ata_sas_slave_configure() Change ata_sas_slave_configure() to return the return value of ata_scsi_dev_config() to ensure that any error from that function is propagated to libsas. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Reviewed-by: John Garry Tested-by: Chia-Lin Kao (AceLan) Tested-by: Geert Uytterhoeven Reviewed-by: Martin K. Petersen commit 3341b82368fb26dcf75f2c60320dc7442dac7075 Author: Damien Le Moal Date: Sat Sep 2 16:32:21 2023 +0900 ata: libata-core: Do not resume runtime suspended ports The scsi disk driver does not resume disks that have been runtime suspended by the user. To be consistent with this behavior, do the same for ata ports and skip the PM request in ata_port_pm_resume() if the port was already runtime suspended. With this change, it is no longer necessary to force the PM state of the port to ACTIVE as the PM core code will take care of that when handling runtime resume. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Tested-by: Chia-Lin Kao (AceLan) Tested-by: Geert Uytterhoeven Reviewed-by: Martin K. Petersen commit 3a94af2488bfe7dfe70fd9277d4548f971b06ec8 Author: Damien Le Moal Date: Thu Aug 31 15:23:37 2023 +0900 ata: libata-core: Do not poweroff runtime suspended ports When powering off, there is no need to suspend a port that has already been runtime suspended. Skip the EH PM request in ata_port_pm_poweroff() in this case. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Tested-by: Chia-Lin Kao (AceLan) Tested-by: Geert Uytterhoeven Reviewed-by: Martin K. Petersen commit 09b055cfb0e9a337938f7a47681b2203bd7b85d2 Author: Damien Le Moal Date: Mon Sep 4 20:59:35 2023 +0900 ata: libata-core: Remove ata_port_resume_async() Remove ata_port_resume_async() and replace it with a modified ata_port_resume() taking an additional bool argument indicating if ata EH resume operation should be executed synchronously or asynchronously. With this change, the variable ata_port_resume_ehi is not longer necessary and its value (ATA_EHI_XXX flags) passed directly to ata_port_request_pm(). Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Tested-by: Chia-Lin Kao (AceLan) Tested-by: Geert Uytterhoeven Reviewed-by: Martin K. Petersen commit 6702255d700a6b41413d6701454cac320f2a9a42 Author: Damien Le Moal Date: Mon Sep 4 20:46:23 2023 +0900 ata: libata-core: Remove ata_port_suspend_async() ata_port_suspend_async() is only called by ata_sas_port_suspend(). Modify ata_port_suspend() with an additional bool argument indicating an asynchronous or synchronous suspend to allow removing that helper function. With this change, the variable ata_port_resume_ehi can also be removed and its value (ATA_EHI_XXX flags passed directly to ata_port_request_pm(). Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Tested-by: Chia-Lin Kao (AceLan) Tested-by: Geert Uytterhoeven Reviewed-by: Martin K. Petersen commit 5b6fba546da246b3d0dd8465c07783e22629cc53 Author: Damien Le Moal Date: Mon Aug 28 16:01:58 2023 +0900 ata: libata-core: Detach a port devices on shutdown Modify ata_pci_shutdown_one() to schedule EH to unload a port devices before freezing and thawing the port. This ensures that drives are cleanly disabled and transitioned to standby power mode when a PCI adapter is removed or the system is powered off. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Tested-by: Chia-Lin Kao (AceLan) Tested-by: Geert Uytterhoeven Reviewed-by: Martin K. Petersen commit cfead0dd81de95f52f416a676d4697484e093c8b Author: Damien Le Moal Date: Mon Aug 28 15:57:11 2023 +0900 ata: libata-core: Synchronize ata_port_detach() with hotplug The call to async_synchronize_cookie() to synchronize a port removal and hotplug probe is done in ata_host_detach() right before calling ata_port_detach(). Move this call at the beginning of ata_port_detach() to ensure that this operation is always synchronized with probe. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Tested-by: Chia-Lin Kao (AceLan) Tested-by: Geert Uytterhoeven Reviewed-by: Martin K. Petersen commit 8c1f08170694f50216f0e336ccfc589d3430a339 Author: Damien Le Moal Date: Tue Aug 29 10:18:34 2023 +0900 ata: libata-scsi: Cleanup ata_scsi_start_stop_xlat() Now that libata does its own internal device power mode management through libata EH, the scsi disk driver will not issue START STOP UNIT commands anymore. We can receive this command only from user passthrough operations. So there is no need to consider the system state and ATA port flags for suspend to translate the command. Since setting up the taskfile for the verify and standby immediate commands is the same as done in ata_dev_power_set_active() and ata_dev_power_set_standby(), factor out this code into the helper function ata_dev_power_init_tf() to simplify ata_scsi_start_stop_xlat() as well as ata_dev_power_set_active() and ata_dev_power_set_standby(). Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Tested-by: Chia-Lin Kao (AceLan) Tested-by: Geert Uytterhoeven Reviewed-by: Martin K. Petersen commit c4367ac83805a2322268c9736cd8ef9124063424 Author: Damien Le Moal Date: Sat Aug 26 12:48:33 2023 +0900 scsi: Remove scsi device no_start_on_resume flag The scsi device flag no_start_on_resume is not set by any scsi low level driver. Remove it. This reverts the changes introduced by commit 0a8589055936 ("ata,scsi: do not issue START STOP UNIT on resume"). Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Tested-by: Chia-Lin Kao (AceLan) Tested-by: Geert Uytterhoeven Reviewed-by: Martin K. Petersen commit 0e19548145d863c48c6562add768a05231d768c9 Author: Kees Cook Date: Fri Sep 22 10:52:11 2023 -0700 ata: libata: Annotate struct ata_cpr_log with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ata_cpr_log. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Damien Le Moal Cc: linux-ide@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Damien Le Moal commit 3bf6141060948e27b62b13beb216887f2e54591e Author: Szuying Chen Date: Thu Sep 21 17:33:51 2023 +0800 ata: ahci: add identifiers for ASM2116 series adapters Add support for PCIe SATA adapter cards based on Asmedia 2116 controllers. These cards can provide up to 10 SATA ports on PCIe card. Signed-off-by: Szuying Chen Signed-off-by: Damien Le Moal commit affccb16c117d188eb09495cbdea149cecbf00b9 Author: Niklas Cassel Date: Wed Sep 6 11:22:32 2023 +0200 ata: ahci: print the lpm policy on boot The target LPM policy can be set using either a Kconfig or a kernel module parameter. However, if the board type is set to anything but board_ahci_low_power, then the LPM policy will overridden and set to ATA_LPM_UNKNOWN. Additionally, if the default suspend is suspend to idle, depending on the hardware capabilities of the HBA, ahci_update_initial_lpm_policy() might override the LPM policy to either ATA_LPM_MIN_POWER_WITH_PARTIAL or ATA_LPM_MIN_POWER. All this means that it is very hard to know which LPM policy a user will actually be using on a given system. In order to make it easier to debug LPM related issues, print the LPM policy on boot. One common LPM related issue is that the device fails to link up. Because of that, we cannot add this print to ata_dev_configure(), as that function is only called after a successful link up. Instead, add the info using ata_port_desc(), with the help of a new ata_port_desc_misc() helper. The port description is printed once per port during boot. Before changes: ata1: SATA max UDMA/133 abar m524288@0xa5780000 port 0xa5780100 irq 170 ata2: SATA max UDMA/133 abar m524288@0xa5780000 port 0xa5780180 irq 170 After changes: ata1: SATA max UDMA/133 abar m524288@0xa5780000 port 0xa5780100 irq 170 lpm-pol 4 ata2: SATA max UDMA/133 abar m524288@0xa5780000 port 0xa5780180 irq 170 lpm-pol 4 Signed-off-by: Niklas Cassel Signed-off-by: Damien Le Moal commit 922a2c78f13611e2c08fc48f615c0cd367dcb6da Author: Jens Axboe Date: Mon Oct 2 18:25:23 2023 -0600 io_uring/rsrc: cleanup io_pin_pages() This function is overly convoluted with a goto error path, and checks under the mmap_read_lock() that don't need to be at all. Rearrange it a bit so the checks and errors fall out naturally, rather than needing to jump around for it. Signed-off-by: Jens Axboe commit caacbdc28f545744770fb2caf347b3c4be9a6299 Merge: 79fb229b88100 03d681412b385 Author: Dave Airlie Date: Tue Oct 3 06:02:29 2023 +1000 Merge tag 'drm-intel-gt-next-2023-09-28' of git://anongit.freedesktop.org/drm/drm-intel into drm-next Driver Changes: Fixes/improvements/new stuff: - Fix TLB-Invalidation seqno store [mtl] (Alan Previn) - Force a reset on internal GuC error [guc] (John Harrison) - Define GSC fw [gsc] (Daniele Ceraolo Spurio) - Update workaround 14016712196 [dg2/mtl] (Tejas Upadhyay) - Mark requests for GuC virtual engines to avoid use-after-free (Andrzej Hajda) - Add Wa_14015150844 [dg2/mtl] (Shekhar Chauhan) - Prevent error pointer dereference (Dan Carpenter) - Add Wa_18022495364 [tgl,adl,rpl] (Dnyaneshwar Bhadane) - Fix GuC PMU by moving execlist stats initialization to execlist specific setup (Umesh Nerlige Ramappa) - Fix PXP firmware load [pxp/mtl] (Alan Previn) - Fix execution/context state of PXP contexts (Alan Previn) - Limit the length of an sg list to the requested length (Matthew Wilcox) - Fix reservation address in ggtt_reserve_guc_top [guc] (Javier Pello) - Add Wa_18028616096 [dg2] (Shekhar Chauhan) - Get runtime pm in busyness worker only if already active [guc/pmu] (Umesh Nerlige Ramappa) - Don't set PIPE_CONTROL_FLUSH_L3 for aux inval (Nirmoy Das) Future platform enablement: - Fix and consolidate some workaround checks, make others IP version based [mtl] (Matt Roper) - Replace Meteorlake subplatforms with IP version checks (Matt Roper) - Adding DeviceID for Arrowlake-S under MTL [mtl] (Nemesa Garg) - Run relevant bits of debugfs drop_caches per GT (Tvrtko Ursulin) Miscellaneous: - Remove Wa_15010599737 [dg2] (Shekhar Chauhan) - Align igt_spinner_create_request with hangcheck [selftests] (Jonathan Cavitt) - Remove pre-production workarounds [dg2] (Matt Roper) - Tidy some workaround definitions (Matt Roper) - Wait longer for tasks in migrate selftest [gt] (Jonathan Cavitt) - Skip WA verification for GEN7_MISCCPCTL on DG2 [gt] (Andrzej Hajda) - Silence injected failure in the load via GSC path [huc] (Daniele Ceraolo Spurio) - Refactor deprecated strncpy (Justin Stitt) - Update RC6 mask for mtl_drpc [debugfs/mtl] (Badal Nilawar) - Remove a static inline that requires including i915_drv.h [gt] (Jani Nikula) - Remove inlines from i915_gem_execbuffer.c [gem] (Jani Nikula) - Remove gtt_offset from stream->oa_buffer.head/.tail [perf] (Ashutosh Dixit) - Do not disable preemption for resets (Tvrtko Ursulin) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/ZRVzL02VFuwIkcGl@tursulin-desk commit 35766690d675f63c111afa0a2f5286b74a5b5cc2 Merge: af54c197a90b8 160f404495aa9 Author: Jakub Kicinski Date: Mon Oct 2 12:34:23 2023 -0700 Merge branch 'fix-implicit-sign-conversions-in-handshake-upcall' Chuck Lever says: ==================== Fix implicit sign conversions in handshake upcall An internal static analysis tool noticed some implicit sign conversions for some of the arguments in the handshake upcall protocol. ==================== Link: https://lore.kernel.org/r/169530154802.8905.2645661840284268222.stgit@oracle-102.nfsv4bat.org Signed-off-by: Jakub Kicinski commit 160f404495aa9282cac99b518d1b379e31ef1bdd Author: Chuck Lever Date: Thu Sep 21 09:08:07 2023 -0400 handshake: Fix sign of key_serial_t fields key_serial_t fields are signed integers. Use nla_get/put_s32 for those to avoid implicit signed conversion in the netlink protocol. Signed-off-by: Chuck Lever Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/169530167716.8905.645746457741372879.stgit@oracle-102.nfsv4bat.org Signed-off-by: Jakub Kicinski commit a6b07a51b161ba1ad3d81919955fe77b697f9d48 Author: Chuck Lever Date: Thu Sep 21 09:07:40 2023 -0400 handshake: Fix sign of socket file descriptor fields Socket file descriptors are signed integers. Use nla_get/put_s32 for those to avoid implicit signed conversion in the netlink protocol. Signed-off-by: Chuck Lever Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/169530165057.8905.8650469415145814828.stgit@oracle-102.nfsv4bat.org Signed-off-by: Jakub Kicinski commit 0c436a58292d0ca1af213ede75b2508995c8af0b Author: Saurabh Sengar Date: Fri Aug 25 00:47:37 2023 -0700 x86/numa: Add Devicetree support Hyper-V has usecases where it needs to fetch NUMA information from Devicetree. Currently, it is not possible to extract the NUMA information from Devicetree for the x86 arch. Add support for Devicetree in the x86_numa_init() function, allowing the retrieval of NUMA node information from the Devicetree. Signed-off-by: Saurabh Sengar Signed-off-by: Ingo Molnar Cc: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/1692949657-16446-2-git-send-email-ssengar@linux.microsoft.com commit 0d294c8c4efa5c0f283a6dfc82dc014a5dbd9308 Author: Saurabh Sengar Date: Fri Aug 25 00:47:36 2023 -0700 x86/of: Move the x86_flattree_get_config() call out of x86_dtb_init() Fetching the device tree configuration before initmem_init() is necessary to allow the parsing of NUMA node information. However moving the entire x86_dtb_init() call before initmem_init() is not correct as APIC/IO-APIC enumeration has to be after initmem_init(). Thus, move the x86_flattree_get_config() call out of x86_dtb_init(), into setup_arch(), to call it before initmem_init(), and leave the ACPI/IOAPIC registration sequence as-is. [ mingo: Updated the changelog for clarity. ] Signed-off-by: Saurabh Sengar Signed-off-by: Ingo Molnar Cc: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/1692949657-16446-1-git-send-email-ssengar@linux.microsoft.com commit d844fe65f0957024c3e1b0bf2a0615246184d9bc Author: Kir Kolyshkin Date: Mon Aug 7 20:03:57 2023 -0700 sched/headers: Move 'struct sched_param' out of uapi, to work around glibc/musl breakage Both glibc and musl define 'struct sched_param' in sched.h, while kernel has it in uapi/linux/sched/types.h, making it cumbersome to use sched_getattr(2) or sched_setattr(2) from userspace. For example, something like this: #include #include struct sched_attr sa; will result in "error: redefinition of ‘struct sched_param’" (note the code doesn't need sched_param at all -- it needs struct sched_attr plus some stuff from sched.h). The situation is, glibc is not going to provide a wrapper for sched_{get,set}attr, thus the need to include linux/sched_types.h directly, which leads to the above problem. Thus, the userspace is left with a few sub-par choices when it wants to use e.g. sched_setattr(2), such as maintaining a copy of struct sched_attr definition, or using some other ugly tricks. OTOH, 'struct sched_param' is well known, defined in POSIX, and it won't be ever changed (as that would break backward compatibility). So, while 'struct sched_param' is indeed part of the kernel uapi, exposing it the way it's done now creates an issue, and hiding it (like this patch does) fixes that issue, hopefully without creating another one: common userspace software rely on libc headers, and as for "special" software (like libc), it looks like glibc and musl do not rely on kernel headers for 'struct sched_param' definition (but let's Cc their mailing lists in case it's otherwise). The alternative to this patch would be to move struct sched_attr to, say, linux/sched.h, or linux/sched/attr.h (the new file). Oh, and here is the previous attempt to fix the issue: https://lore.kernel.org/all/20200528135552.GA87103@google.com/ While I support Linus arguments, the issue is still here and needs to be fixed. [ mingo: Linus is right, this shouldn't be needed - but on the other hand I agree that this header is not really helpful to user-space as-is. So let's pretend that is only about sched_attr, and call this commit a workaround for user-space breakage that it in reality is ... Also, remove the Fixes tag. ] Signed-off-by: Kir Kolyshkin Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230808030357.1213829-1-kolyshkin@gmail.com commit ce8ab92e66ccc99591b9cbb6630d720d5e6ad6ec Author: Chen-Yu Tsai Date: Thu Sep 28 16:55:34 2023 +0800 regulator: mt6358: Add supply names for MT6366 regulators The DT bindings for MT6366 regulator defines the supply names for the PMIC. Add support for them by adding .supply_name field settings for each regulator. The buck regulators each have their own supply whose name can be derived from the regulator name. The LDOs have shared supplies. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230928085537.3246669-12-wenst@chromium.org Signed-off-by: Mark Brown commit b7768e67af9a5b6d6101cbfc146969fedf8df4be Author: Chen-Yu Tsai Date: Thu Sep 28 16:55:33 2023 +0800 regulator: mt6358: Add missing regulators for MT6366 When support for the MT6366 PMIC regulators was added, it was assumed that it had the same functionality as MT6358. In reality there are differences. A few regulators have different ranges, or were renamed and repurposed, or removed altogether. Add the 3 regulators that were missing from the original submission. These are added for completeness. VSRAM_CORE is not used in existing projects. VM18 and VMDDR feed DRAM related consumers, and are not used in-kernel. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Acked-by: Lee Jones Link: https://lore.kernel.org/r/20230928085537.3246669-11-wenst@chromium.org Signed-off-by: Mark Brown commit b7f3b89848b3bae3b1e3a97e75b82c65a4952cfc Author: Chen-Yu Tsai Date: Thu Sep 28 16:55:32 2023 +0800 regulator: mt6358: Make MT6366 vcn18 LDO configurable The VCN18 regulator on the MT6366 (only) actually has a wide configurable range of voltages, even though its name suggests a fixed output voltage. Convert it from a fixed LDO to a configurable LDO. Its range of settings is the same as the VM18 regulator, which is missing and will be added in a subsequent patch. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230928085537.3246669-10-wenst@chromium.org Signed-off-by: Mark Brown commit 0c3697b8980dd44df05ed77222c09bd8fe729626 Author: Chen-Yu Tsai Date: Thu Sep 28 16:55:31 2023 +0800 regulator: mt6358: fix and drop type prefix in MT6366 regulator node names The new MT6366 binding does away with the type prefix ("buck_", "ldo_") in the regulator node names. This better matches the PMIC pin names. Remaining underscores in names are also replaced with hyphens. Drop the type prefixes and replace remaining underscores to match the MT6366 binding. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230928085537.3246669-9-wenst@chromium.org Signed-off-by: Mark Brown commit 3dfa8a7071d4e748d5a59566f9a96e381a9fccb2 Author: Chen-Yu Tsai Date: Thu Sep 28 16:55:30 2023 +0800 regulator: mt6358: Add supply names for MT6358 regulators The DT bindings for MT6358 regulator now defines the supply names for the PMIC. Add support for them by adding .supply_name field settings for each regulator. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230928085537.3246669-8-wenst@chromium.org Signed-off-by: Mark Brown commit 9f3bec54d06f1eb4b47c7f78ef1401bc71977e9e Author: Chen-Yu Tsai Date: Thu Sep 28 16:55:29 2023 +0800 regulator: mt6358: Use mt6397-regulator.h binding header for buck mode macros The (undocumented) possible values for the buck operating modes on the MT6358 are the same as those on the MT6397, both for the device tree bindings and the actual hardware register values. Reuse the macros for the MT6397 PMIC in the MT6358 regulator driver by including the mt6397-regulator.h binding header and replacing the existing macros. This aligns it with other PMIC. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230928085537.3246669-7-wenst@chromium.org Signed-off-by: Mark Brown commit c631494a69c55301a03af9c028892c9098019652 Author: Zhiyong Tao Date: Thu Sep 28 16:55:28 2023 +0800 regulator: dt-bindings: mt6358: Add MT6366 PMIC The MediaTek MT6366 PMIC is similar to the MT6358 PMIC. It is designed to be paired with the MediaTek MT8186 SoC. It has 9 buck regulators and 29 LDO regulators, not counting ones that feed internally and basically have no controls. The regulators are named after their intended usage for the SoC and system design, thus not named generically as ldoX or dcdcX, but as vcn33 or vgpu. The differences compared to the MT6358 are minimal: - Regulators removed: VCAMA1, VCAMA2, VCAMD, VCAMIO, VLDO28 - Regulators added: VM18, VMDDR, VSRAM_CORE Both PMIC models contain a chip ID register at the same address that can be used to differentiate the actual model. Thus, even though the MT6366 is not fully backward compatible with the MT6358, it still falls back on the MT6358 compatible string. It is up to the implementation to use the chip ID register as a probing mechanism. Update the MT6358 regulator binding and add entries for all the MT6366's regulators and their supplies. The regulator node names follow a cleaned up style without type prefixes and with underscores replaced with hyphens. Signed-off-by: Zhiyong Tao [wens@chromium.org: major rework and added commit message] Signed-off-by: Chen-Yu Tsai Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230928085537.3246669-6-wenst@chromium.org Signed-off-by: Mark Brown commit 2f384e60acbac140732367d037c5f08db21513a0 Author: Chen-Yu Tsai Date: Thu Sep 28 16:55:27 2023 +0800 regulator: dt-bindings: mt6358: Add regulator supplies The MT6358 PMIC has various regulator power supply pins that should be supplied from external power sources or routed from one of its outputs. Add these regulator supplies to the binding. The names are the actual names from the datasheet, with hyphens replacing underscores. Signed-off-by: Chen-Yu Tsai Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230928085537.3246669-5-wenst@chromium.org Signed-off-by: Mark Brown commit 0bf4b56b5ecaf711865f313476f91c18338307bb Author: Chen-Yu Tsai Date: Thu Sep 28 16:55:26 2023 +0800 regulator: dt-bindings: mt6358: Add regulator-allowed-modes property The MT6358 PMIC allows changing operating modes for the buck regulators, but not the LDOs. Existing device trees and the Linux implementation already utilize this through the standard regulator-allowed-modes property. The values currently used in existing device trees are simply raw numbers. The values in the Linux driver are matching numbers defined with macros denoting the two supported modes. Turns out these two modes are common across parts of the larger MT63xx PMIC family. The MT6397 regulator binding already has macros for the two modes, with matching numbers. Codify the supported values for regulator-allowed-modes for the MT6358 in the device tree binding: 0 and 1 are supported for buck regulators, and the property should not be present for LDO regulators. Users should use the dt-bindings/regulator/mediatek,mt6397-regulator.h header for the macros, instead of using raw numbers. Signed-off-by: Chen-Yu Tsai Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230928085537.3246669-4-wenst@chromium.org Signed-off-by: Mark Brown commit 93880f7e5c8c864309a57c47669ac0bc432524d5 Author: Chen-Yu Tsai Date: Thu Sep 28 16:55:25 2023 +0800 regulator: dt-bindings: mt6358: Convert to DT schema Convert this from the old style text based binding to the new DT schema style. This will make adding the MT6366 portion easier. The examples have been trimmed down considerably, and the remaining entries now match what is seen in actual device trees, minus some properties that aren't covered by the bindings yet, or don't make sense on their own. The original submitter seems to have left MediaTek, so instead the submitter and maintainer for the MT6366 binding is listed as the maintainer here. Cc: Zhiyong Tao Signed-off-by: Chen-Yu Tsai Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230928085537.3246669-3-wenst@chromium.org Signed-off-by: Mark Brown commit 736b884a7b68c4eeb66dbf75b97c8ec9b9eeff7f Author: Joerg Schambacher Date: Fri Sep 29 17:05:55 2023 +0200 ASoC: pcm512x: Adds bindings for TAS575x devices The TAS5754/6 power amplifiers use the same pcm512x driver with only minor restictions described in the bindings document. Signed-off-by: Joerg Schambacher Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230929150555.405388-1-joerg.hifiberry@gmail.com Signed-off-by: Mark Brown commit 1f817805262c2c34142291da376d4932d3c493bc Author: Joerg Schambacher Date: Fri Sep 29 17:07:20 2023 +0200 ASoC: Adds support for TAS575x to the pcm512x driver Enables the existing pcm512x driver to control the almost compatible TAS5754 and -76 amplifers. Both amplifiers support only an I2C interface and the internal PLL must be always on to provide necessary clocks to the amplifier section. Tested on TAS5756 with support from Andreas Arbesser-Krasser from Texas Instruments Signed-off-by: Joerg Schambacher Link: https://lore.kernel.org/r/20230929150722.405415-1-joerg.hifiberry@gmail.com Signed-off-by: Mark Brown commit 4eed047b76fa8f56af478ca7e6d56ca7e5330cf2 Author: Luca Weiss Date: Mon Oct 2 16:00:12 2023 +0200 ASoC: codecs: aw88261: Remove non-existing reset gpio According to the AW88261 datasheet (V1.1) and device schematics I have access to, there is no reset gpio present on the AW88261. Remove it. Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20231002-aw88261-reset-v2-2-837cb1e7b95c@fairphone.com Signed-off-by: Mark Brown commit c7b94e8614e35f1919b51c23fe590884149ae341 Author: Luca Weiss Date: Mon Oct 2 16:00:11 2023 +0200 ASoC: dt-bindings: awinic,aw88395: Remove reset-gpios from AW88261 The AW88261 chip doesn't have a reset GPIO, so disallow providing reset-gpios. At the same time also don't keep reset-gpios required for AW88395. This is both because the Linux driver has it optional, and it also simplifies the bindings by not introducing another conditional. Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20231002-aw88261-reset-v2-1-837cb1e7b95c@fairphone.com Signed-off-by: Mark Brown commit c0989f7d1264b2b1885345a28a32fd5e1e61f9c7 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:20 2023 +0200 soc: qcom: socinfo: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-30-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit bdd7cc62cf69fe989557445d65d6c8cb2f956518 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:19 2023 +0200 soc: qcom: smsm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-29-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit 1cd966c2dc19654ed08c843e5c933db8c1349636 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:18 2023 +0200 soc: qcom: smp2p: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-28-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit 4b8dee9a34d51a61f60add996fae6a7140a20ae5 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:17 2023 +0200 soc: qcom: smem: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-27-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit 7c93da5b8b69d4e4e7270c33ba3206af43930e1d Author: Uwe Kleine-König Date: Mon Sep 25 11:55:16 2023 +0200 soc: qcom: rmtfs_mem: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-26-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit a47ff90bf2f93ce4ca99858948a74a0c10a2bc45 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:15 2023 +0200 soc: qcom: qcom_stats: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-25-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit 57b31729bd2c72b00d400106e18db91e9d95d3c3 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:14 2023 +0200 soc: qcom: qcom_gsbi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-24-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit ffbe84a514f863a46a85c1e47b2b6d930b1b463e Author: Uwe Kleine-König Date: Mon Sep 25 11:55:13 2023 +0200 soc: qcom: qcom_aoss: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-23-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit 4b3373e42dc2caa34394ac090c8c70bed49badd6 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:12 2023 +0200 soc: qcom: pmic_glink: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-22-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit 0b742c498bcd7d215501b10fe9df72a16237735a Author: Uwe Kleine-König Date: Mon Sep 25 11:55:11 2023 +0200 soc: qcom: ocmem: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230925095532.1984344-21-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit d85a9d18a58156fc8b5ab185e00e078adaaeefde Author: Uwe Kleine-König Date: Mon Sep 25 11:55:10 2023 +0200 soc: qcom: llcc-qcom: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230925095532.1984344-20-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit dd714c568ed4e6f79017be45077de71e9908af03 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:09 2023 +0200 soc: qcom: icc-bwmon: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Krzysztof Kozlowski Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230925095532.1984344-19-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit af54c197a90b804b57eb7ae4256aaeb5c46216c5 Merge: 6d6e40ec48ca7 18cee9da32cda Author: Jakub Kicinski Date: Mon Oct 2 11:27:17 2023 -0700 Merge branch 'mlxsw-annotate-structs-with-__counted_by' Kees Cook says: ==================== mlxsw: Annotate structs with __counted_by This annotates several mlxsw structures with the coming __counted_by attribute for bounds checking of flexible arrays at run-time. For more details, see commit dd06e72e68bc ("Compiler Attributes: Add __counted_by macro"). ==================== Link: https://lore.kernel.org/r/20230929180611.work.870-kees@kernel.org Signed-off-by: Jakub Kicinski commit 18cee9da32cdabd1cd9344e1369cd8adcc14d022 Author: Kees Cook Date: Fri Sep 29 11:07:44 2023 -0700 mlxsw: spectrum_span: Annotate struct mlxsw_sp_span with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mlxsw_sp_span. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Petr Machata Signed-off-by: Kees Cook Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20230929180746.3005922-5-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 4d3a42ec5cff817502ef19ae04427caab6fd5481 Author: Kees Cook Date: Fri Sep 29 11:07:43 2023 -0700 mlxsw: spectrum_router: Annotate struct mlxsw_sp_nexthop_group_info with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mlxsw_sp_nexthop_group_info. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Petr Machata Signed-off-by: Kees Cook Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20230929180746.3005922-4-keescook@chromium.org Signed-off-by: Jakub Kicinski commit f7ebae83768f1b64b099657f2a91a9f6afee6c24 Author: Kees Cook Date: Fri Sep 29 11:07:42 2023 -0700 mlxsw: spectrum: Annotate struct mlxsw_sp_counter_pool with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mlxsw_sp_counter_pool. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Petr Machata Signed-off-by: Kees Cook Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20230929180746.3005922-3-keescook@chromium.org Signed-off-by: Jakub Kicinski commit c63da7d628933a228efebd0b0886749bbb83f883 Author: Kees Cook Date: Fri Sep 29 11:07:41 2023 -0700 mlxsw: core: Annotate struct mlxsw_env with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mlxsw_env. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Petr Machata Signed-off-by: Kees Cook Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20230929180746.3005922-2-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 0b7ed8183375751ec018dd912643a85191cc2e27 Author: Kees Cook Date: Fri Sep 29 11:07:40 2023 -0700 mlxsw: Annotate struct mlxsw_linecards with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mlxsw_linecards. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Petr Machata Signed-off-by: Kees Cook Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20230929180746.3005922-1-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 6d6e40ec48ca7195dceba681551dd92dc197b5a2 Merge: 436e5f758d6fb 0d01cfe5aaafd Author: Jakub Kicinski Date: Mon Oct 2 11:25:03 2023 -0700 Merge branch 'batch-1-annotate-structs-with-__counted_by' Kees Cook says: ==================== Batch 1: Annotate structs with __counted_by This is the batch 1 of patches touching netdev for preparing for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by to structs that would benefit from the annotation. Since the element count member must be set before accessing the annotated flexible array member, some patches also move the member's initialization earlier. (These are noted in the individual patches.) [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci ==================== Link: https://lore.kernel.org/r/20230922172449.work.906-kees@kernel.org Signed-off-by: Jakub Kicinski commit 0d01cfe5aaafdff82df0381295620e58db29d0a8 Author: Kees Cook Date: Fri Sep 22 10:28:55 2023 -0700 net: tulip: Annotate struct mediatable with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mediatable. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Shaokun Zhang Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922172858.3822653-13-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 16ae53d80c00445c903128f2a64af87b5a03d474 Author: Kees Cook Date: Fri Sep 22 10:28:54 2023 -0700 net: openvswitch: Annotate struct dp_meter with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct dp_meter. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Pravin B Shelar Cc: dev@openvswitch.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922172858.3822653-12-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 93bc6ab6b19d3f6609a3f4a31103880e89c4c118 Author: Kees Cook Date: Fri Sep 22 10:28:53 2023 -0700 net: enetc: Annotate struct enetc_psfp_gate with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct enetc_psfp_gate. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Claudiu Manoil Cc: Vladimir Oltean Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922172858.3822653-11-keescook@chromium.org Signed-off-by: Jakub Kicinski commit e7b34822fa4dcf6101deb3d51a77efd77533571d Author: Kees Cook Date: Fri Sep 22 10:28:52 2023 -0700 net: openvswitch: Annotate struct dp_meter_instance with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct dp_meter_instance. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Pravin B Shelar Cc: dev@openvswitch.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922172858.3822653-10-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 59656519763d55bb93730ca17a11fba399a6ef49 Author: Kees Cook Date: Fri Sep 22 10:28:51 2023 -0700 net: mana: Annotate struct hwc_dma_buf with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct hwc_dma_buf. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Long Li Cc: Ajay Sharma Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Wei Liu Cc: Dexuan Cui Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922172858.3822653-9-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 20551ee45d7d9fc655e27d16380e65ae8acbacc0 Author: Kees Cook Date: Fri Sep 22 10:28:50 2023 -0700 net: ipa: Annotate struct ipa_power with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ipa_power. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Alex Elder Link: https://lore.kernel.org/r/20230922172858.3822653-8-keescook@chromium.org Signed-off-by: Jakub Kicinski commit a3d7a1209bbb06fe9d24b274475bc9879ca73333 Author: Kees Cook Date: Fri Sep 22 10:28:49 2023 -0700 net: mana: Annotate struct mana_rxq with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mana_rxq. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Wei Liu Cc: Dexuan Cui Cc: Long Li Cc: Ajay Sharma Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922172858.3822653-7-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 2290999d278e7552e71df6b13f619a4f73d348bc Author: Kees Cook Date: Fri Sep 22 10:28:48 2023 -0700 net: hisilicon: Annotate struct rcb_common_cb with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct rcb_common_cb. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Yisen Zhuang Cc: Salil Mehta Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922172858.3822653-6-keescook@chromium.org Signed-off-by: Jakub Kicinski commit dd8e215ea9a801f2253e0f8fef99653d543491fc Author: Kees Cook Date: Fri Sep 22 10:28:47 2023 -0700 net: enetc: Annotate struct enetc_int_vector with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct enetc_int_vector. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Claudiu Manoil Cc: Vladimir Oltean Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922172858.3822653-5-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 5b829c8460aeaaa9b9c7efc8cb020b83f9f36203 Author: Kees Cook Date: Fri Sep 22 10:28:46 2023 -0700 net: hns: Annotate struct ppe_common_cb with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ppe_common_cb. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Yisen Zhuang Cc: Salil Mehta Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922172858.3822653-4-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 5d22b6528073fd79f6a520234c77f77c2ed8b9e1 Author: Kees Cook Date: Fri Sep 22 10:28:45 2023 -0700 ipv6: Annotate struct ip6_sf_socklist with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ip6_sf_socklist. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922172858.3822653-3-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 210d4e9c732fa87b584af72faae96c037d9d7957 Author: Kees Cook Date: Fri Sep 22 10:28:44 2023 -0700 ipv4/igmp: Annotate struct ip_sf_socklist with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ip_sf_socklist. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Martin KaFai Lau Cc: Alexei Starovoitov Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922172858.3822653-2-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 5b98fd5dc1e3b8446f98bc8c6e71d2585f9dcdce Author: Kees Cook Date: Fri Sep 22 10:28:43 2023 -0700 ipv4: Annotate struct fib_info with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct fib_info. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: David Ahern Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922172858.3822653-1-keescook@chromium.org Signed-off-by: Jakub Kicinski commit cba58fcbc4ab75d8814ec43db32d4830670526f8 Author: Justin Stitt Date: Fri Sep 22 11:49:14 2023 +0000 isdn: kcapi: replace deprecated strncpy with strscpy_pad `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. `buf` is used in this context as a data buffer with 64 bytes of memory to be occupied by capi_manufakturer. We see the caller capi20_get_manufacturer() passes data.manufacturer as its `buf` argument which is then later passed over to user space. Due to this, let's keep the NUL-padding that strncpy provided by using strscpy_pad so as to not leak any stack data. | cdev->errcode = capi20_get_manufacturer(data.contr, data.manufacturer); | if (cdev->errcode) | return -EIO; | | if (copy_to_user(argp, data.manufacturer, | sizeof(data.manufacturer))) | return -EFAULT; Perhaps this would also be a good instance to use `strtomem_pad` for but in my testing the compiler was not able to determine the size of `buf` -- even with all the hints. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230922-strncpy-drivers-isdn-capi-kcapi-c-v1-1-55fcf8b075fb@google.com Signed-off-by: Kees Cook commit 5c80c4fced22ae719d37db754144e75688eb52c8 Author: Justin Stitt Date: Fri Sep 22 11:58:06 2023 +0000 isdn: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect `iclock->name` to be NUL-terminated based on its use within printk: | printk(KERN_DEBUG "%s: %s %d\n", __func__, iclock->name, | iclock->pri); `iclock` is zero-initialized and as such is already NUL-padded which means strncpy is doing extra work here by eagerly NUL-padding the destination buffer. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230922-strncpy-drivers-isdn-misdn-clock-c-v1-1-3ba2a5ae627a@google.com Signed-off-by: Kees Cook commit d876188ab8074087b23b3d83a56c889ebb1904ae Author: Wen Gong Date: Sat Sep 30 07:54:48 2023 +0300 wifi: ath10k: indicate to mac80211 scan complete with aborted flag for ATH10K_SCAN_STARTING state Scan failure can not be recovered from when running a loop of the following steps: 1. run scan: "iw wlan scan". 2. run command: echo soft > /sys/kernel/debug/ieee80211/phy0/ath10k/simulate_fw_crash immediately after step 1. result: scan failed and can not recover even when wlan recovery succeeds: command failed: Device or resource busy (-16) reason: When scan arrives, WMI_START_SCAN_CMDID is sent to the firmware and function ath10k_hw_scan() returns, then simulate_fw_crash arrives and the scan started event does not arrive, and then it starts to do recovery of wlan. __ath10k_scan_finish() which is called from ath10k_halt() is one step of recovery, it will not call ieee80211_scan_completed() by logic currently because the scan state is ATH10K_SCAN_STARTING. Thus it leads the scan not being completed in mac80211, and leads all consecutive scans failing with -EBUSY in nl80211_trigger_scan even after wlan recovery success. Indicate scan complete with aborted flag to mac80211 for ATH10K_SCAN_STARTING to allow recovery from scan failed with "Device or resource busy (-16)" after wlan recovery. Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00174 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230626024232.15579-1-quic_wgong@quicinc.com commit 27e154abf6940d6478ca698019fb1ce783e85602 Author: Christophe JAILLET Date: Sat Sep 30 07:54:48 2023 +0300 wifi: ath: dfs_pattern_detector: Use flex array to simplify code At the time of the writing, the value of 'num_radar_types' is 7 or 9. So on a 64 bits system, only 56 or 72 bytes are allocated for the 'detectors' array. Turn it into a flex array, in order to simplify memory management and save an indirection when the array is used. Doing so, cd->detectors can't be NULL, and channel_detector_exit() can be simplified as well. Signed-off-by: Christophe JAILLET Reviewed-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1920cc38db2e570633e13b37d50852f3202a7270.1695538105.git.christophe.jaillet@wanadoo.fr commit 79bd60ee87e1136718a686d6617ced5de88ee350 Author: Christophe JAILLET Date: Sat Sep 30 07:54:47 2023 +0300 wifi: ath: dfs_pattern_detector: Fix a memory initialization issue If an error occurs and channel_detector_exit() is called, it relies on entries of the 'detectors' array to be NULL. Otherwise, it may access to un-initialized memory. Fix it and initialize the memory, as what was done before the commit in Fixes. Fixes: a063b650ce5d ("ath: dfs_pattern_detector: Avoid open coded arithmetic in memory allocation") Signed-off-by: Christophe JAILLET Reviewed-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/ad8c55b97ee4b330cb053ce2c448123c309cc91c.1695538105.git.christophe.jaillet@wanadoo.fr commit 6c751f1a7bb864bcb93b2148a09d476706427144 Author: Wu Yunchuan Date: Sat Sep 30 07:54:47 2023 +0300 wifi: carl9170: remove unnecessary (void*) conversions No need cast (void *) to (struct ar9170 *), (u8 *) or (void*). Signed-off-by: Wu Yunchuan Acked-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230919044916.523308-1-yunchuan@nfschina.com commit 170c75d43a77dc937c58f07ecf847ba1b42ab74e Author: Douglas Anderson Date: Sat Sep 30 07:54:48 2023 +0300 wifi: ath10k: Don't touch the CE interrupt registers after power up As talked about in commit d66d24ac300c ("ath10k: Keep track of which interrupts fired, don't poll them"), if we access the copy engine register at a bad time then ath10k can go boom. However, it's not necessarily easy to know when it's safe to access them. The ChromeOS test labs saw a crash that looked like this at shutdown/reboot time (on a chromeos-5.15 kernel, but likely the problem could also reproduce upstream): Internal error: synchronous external abort: 96000010 [#1] PREEMPT SMP ... CPU: 4 PID: 6168 Comm: reboot Not tainted 5.15.111-lockdep-19350-g1d624fe6758f #1 010b9b233ab055c27c6dc88efb0be2f4e9e86f51 Hardware name: Google Kingoftown (DT) ... pc : ath10k_snoc_read32+0x50/0x74 [ath10k_snoc] lr : ath10k_snoc_read32+0x24/0x74 [ath10k_snoc] ... Call trace: ath10k_snoc_read32+0x50/0x74 [ath10k_snoc ...] ath10k_ce_disable_interrupt+0x190/0x65c [ath10k_core ...] ath10k_ce_disable_interrupts+0x8c/0x120 [ath10k_core ...] ath10k_snoc_hif_stop+0x78/0x660 [ath10k_snoc ...] ath10k_core_stop+0x13c/0x1ec [ath10k_core ...] ath10k_halt+0x398/0x5b0 [ath10k_core ...] ath10k_stop+0xfc/0x1a8 [ath10k_core ...] drv_stop+0x148/0x6b4 [mac80211 ...] ieee80211_stop_device+0x70/0x80 [mac80211 ...] ieee80211_do_stop+0x10d8/0x15b0 [mac80211 ...] ieee80211_stop+0x144/0x1a0 [mac80211 ...] __dev_close_many+0x1e8/0x2c0 dev_close_many+0x198/0x33c dev_close+0x140/0x210 cfg80211_shutdown_all_interfaces+0xc8/0x1e0 [cfg80211 ...] ieee80211_remove_interfaces+0x118/0x5c4 [mac80211 ...] ieee80211_unregister_hw+0x64/0x1f4 [mac80211 ...] ath10k_mac_unregister+0x4c/0xf0 [ath10k_core ...] ath10k_core_unregister+0x80/0xb0 [ath10k_core ...] ath10k_snoc_free_resources+0xb8/0x1ec [ath10k_snoc ...] ath10k_snoc_shutdown+0x98/0xd0 [ath10k_snoc ...] platform_shutdown+0x7c/0xa0 device_shutdown+0x3e0/0x58c kernel_restart_prepare+0x68/0xa0 kernel_restart+0x28/0x7c Though there's no known way to reproduce the problem, it makes sense that it would be the same issue where we're trying to access copy engine registers when it's not allowed. Let's fix this by changing how we "disable" the interrupts. Instead of tweaking the copy engine registers we'll just use disable_irq() and enable_irq(). Then we'll configure the interrupts once at power up time. Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2.c10-00754-QCAHLSWMTPL-1 Signed-off-by: Douglas Anderson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230630151842.1.If764ede23c4e09a43a842771c2ddf99608f25f8e@changeid commit 3fcb81420aca8cbc6f45f36c90ff09fc12d31024 Author: Dmitry Antipov Date: Sat Sep 30 07:54:47 2023 +0300 wifi: ath10k: consistently use kstrtoX_from_user() functions Use 'kstrtoul_from_user()', 'kstrtobool_from_user()' and 'kstrtoint_from_user()' where appropriate and thus avoid some code duplication. Signed-off-by: Dmitry Antipov Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230920154018.48314-1-dmantipov@yandex.ru commit 972754bfeec489fc03eec3df512be11dff457a65 Author: Wen Gong Date: Sat Sep 30 07:54:52 2023 +0300 wifi: ath12k: add keep backward compatibility of PHY mode to avoid firmware crash In a special WCN7855 firmware release the EHT (IEEE 802.11be) support has been disabled for size reduction. Currently ath12k always enables EHT PHY mode during vdev start but with the special firmware that will cause a firmware crash during vdev start in firmware initialisation. This is because the firmware will use the EHT mode to allocate resources but as the EHT mode is not available in the firmware, there's an internal conflict and the firmware will crash. To fix the crash check the WMI_TLV_SERVICE_11BE flag to see if the firmware supports EHT. If EHT is not supported downgrade the PHY mode to HE (IEEE 802.11ax). This does not impact QCN9274, because WMI_SERVICE_11BE is always enabled for QCN9274, then eht_cap->has_eht will always set for it, and the logic of this patch will not take effect and the PHY mode will not down grade for it. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230913105757.17744-1-quic_wgong@quicinc.com commit 1c674013547d0b9131dce0acdda74c2a5b95510e Author: Kees Cook Date: Fri Sep 15 13:14:39 2023 -0700 NFS/flexfiles: Annotate struct nfs4_ff_layout_segment with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct nfs4_ff_layout_segment. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Trond Myklebust Cc: Anna Schumaker Cc: linux-nfs@vger.kernel.org Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230915201434.never.346-kees@kernel.org Signed-off-by: Kees Cook commit c0c64aac4916a2592bd174547b279a408368dd31 Author: Kees Cook Date: Fri Sep 15 13:14:27 2023 -0700 nfs41: Annotate struct nfs4_file_layout_dsaddr with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct nfs4_file_layout_dsaddr. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Trond Myklebust Cc: Anna Schumaker Cc: "Gustavo A. R. Silva" Cc: linux-nfs@vger.kernel.org Link: https://lore.kernel.org/r/20230915201427.never.771-kees@kernel.org Signed-off-by: Kees Cook commit 96d7c65939793c2efc16e43c81a92aed9eed0d78 Author: Kees Cook Date: Fri Sep 15 13:04:08 2023 -0700 dm: Annotate struct dm_bio_prison with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct dm_bio_prison. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Alasdair Kergon Cc: Mike Snitzer Cc: dm-devel@redhat.com Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230915200407.never.611-kees@kernel.org Signed-off-by: Kees Cook commit 37d27cf1f5836a5f889e66bee755254d4a1faf72 Author: Kees Cook Date: Fri Sep 15 13:04:01 2023 -0700 dm: Annotate struct dm_stat with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct dm_stat. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Alasdair Kergon Cc: Mike Snitzer Cc: dm-devel@redhat.com Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230915200400.never.585-kees@kernel.org Signed-off-by: Kees Cook commit 694b3b9d7acf771c4289babbe0f810556625b6b3 Author: Kees Cook Date: Fri Sep 15 13:03:53 2023 -0700 dm: Annotate struct stripe_c with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct stripe_c. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Alasdair Kergon Cc: Mike Snitzer Cc: dm-devel@redhat.com Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230915200352.never.118-kees@kernel.org Signed-off-by: Kees Cook commit 6521ba56ca86c19328f956090e367eacee4eb9d1 Author: Kees Cook Date: Fri Sep 15 13:03:45 2023 -0700 dm crypt: Annotate struct crypt_config with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct crypt_config. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Alasdair Kergon Cc: Mike Snitzer Cc: dm-devel@redhat.com Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230915200344.never.272-kees@kernel.org Signed-off-by: Kees Cook commit e3260d90c8f35c03ce182bfd2eeea75805586c25 Author: Kees Cook Date: Fri Sep 15 13:03:36 2023 -0700 dm raid: Annotate struct raid_set with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct raid_set. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Alasdair Kergon Cc: Mike Snitzer Cc: dm-devel@redhat.com Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230915200335.never.098-kees@kernel.org Signed-off-by: Kees Cook commit 150849c5e2630ddf29411bb5334a548cc10d4814 Author: Kees Cook Date: Fri Sep 15 13:03:16 2023 -0700 drbd: Annotate struct fifo_buffer with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct fifo_buffer. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Philipp Reisner Cc: Lars Ellenberg Cc: Christoph Böhmwalder Cc: Jens Axboe Cc: drbd-dev@lists.linbit.com Cc: linux-block@vger.kernel.org Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230915200316.never.707-kees@kernel.org Signed-off-by: Kees Cook commit 182717026e2c8e6cc3b5757f601c3fee15f64ecb Author: Kees Cook Date: Fri Sep 15 12:59:39 2023 -0700 usb: gadget: f_midi: Annotate struct f_midi with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct f_midi. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Greg Kroah-Hartman Cc: John Keeping Cc: Peter Chen Cc: Hulk Robot Cc: Allen Pais Cc: Will McVicker Cc: Davidlohr Bueso Cc: Zhang Qilong Cc: linux-usb@vger.kernel.org Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230915195938.never.611-kees@kernel.org Signed-off-by: Kees Cook commit c7c4ac7f4779bc186b3b8f9b55b6f19735480ef2 Author: Kees Cook Date: Fri Sep 15 12:58:49 2023 -0700 usb: gadget: f_fs: Annotate struct ffs_buffer with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ffs_buffer. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Greg Kroah-Hartman Cc: John Keeping Cc: Udipto Goswami Cc: Linyu Yuan Cc: linux-usb@vger.kernel.org Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230915195849.never.275-kees@kernel.org Signed-off-by: Kees Cook commit d5ae1c3b970eee69022c5f05b8c8da18427dc999 Author: Kees Cook Date: Fri Sep 15 12:58:16 2023 -0700 usb: Annotate struct urb_priv with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct urb_priv. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Alan Stern Cc: Greg Kroah-Hartman Cc: Mathias Nyman Cc: linux-usb@vger.kernel.org Link: https://lore.kernel.org/r/20230915195812.never.371-kees@kernel.org Signed-off-by: Kees Cook commit 2d26302bdff1300029a67931739f5770eac22493 Author: Kees Cook Date: Fri Sep 15 13:14:49 2023 -0700 afs: Annotate struct afs_addr_list with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct afs_addr_list. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: David Howells Cc: Marc Dionne Cc: linux-afs@lists.infradead.org Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230915201449.never.649-kees@kernel.org Signed-off-by: Kees Cook commit aade15333c3b4fe24403fd9a52e15fb61993face Author: Kees Cook Date: Fri Sep 15 13:14:56 2023 -0700 afs: Annotate struct afs_permits with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct afs_permits. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: David Howells Cc: Marc Dionne Cc: linux-afs@lists.infradead.org Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230915201456.never.529-kees@kernel.org Signed-off-by: Kees Cook commit 5234193ee2b997e59326b047610a8f3f64a0ce02 Author: Kees Cook Date: Fri Sep 15 13:15:17 2023 -0700 ceph: Annotate struct ceph_osd_request with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ceph_osd_request. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Ilya Dryomov Cc: Xiubo Li Cc: Jeff Layton Cc: ceph-devel@vger.kernel.org Reviewed-by: "Gustavo A. R. Silva" Reviewed-by: Xiubo Li Link: https://lore.kernel.org/r/20230915201517.never.373-kees@kernel.org Signed-off-by: Kees Cook commit e91673b8dc59d7370492c653b84680503cac3aec Author: Kees Cook Date: Fri Sep 15 13:15:23 2023 -0700 ocfs2: Annotate struct ocfs2_slot_info with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ocfs2_slot_info. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Mark Fasheh Cc: Joel Becker Cc: Joseph Qi Cc: ocfs2-devel@lists.linux.dev Reviewed-by: "Gustavo A. R. Silva" Reviewed-by: Joseph Qi Link: https://lore.kernel.org/r/20230915201522.never.979-kees@kernel.org Signed-off-by: Kees Cook commit b7fa76e03b0d83a035b20e0ef1a3d65a4557f76c Author: Gustavo A. R. Silva Date: Fri Sep 15 13:20:14 2023 -0600 usb: atm: Use size_add() in call to struct_size() If, for any reason, the open-coded arithmetic causes a wraparound, the protection that `struct_size()` adds against potential integer overflows is defeated. Fix this by hardening call to `struct_size()` with `size_add()`. Fixes: b626871a7cda ("usb: atm: Use struct_size() helper") Signed-off-by: "Gustavo A. R. Silva" Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/ZQSuboEIhvATAdxN@work Signed-off-by: Kees Cook commit 587e80dc1cb5f1f3f41b38356d3e3563c01d9d8e Author: Rodrigo Vivi Date: Tue Sep 26 13:55:54 2023 -0400 drm/i915: Add missing GSCCS documentation Introduce the basic documentation about GSC CS. This "GPU Basics" section is focused on explaining the hardware rather than the driver/uapi, so let's make sure GSC is also properly documented here. v2: Fixes from Matt: typos and acronym. Fixes: 5fd974d164b4 ("drm/i915/mtl: add initial definitions for GSC CS") Suggested-by: Matt Roper Cc: Daniele Ceraolo Spurio Cc: Tvrtko Ursulin Signed-off-by: Rodrigo Vivi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230926175554.25968-1-rodrigo.vivi@intel.com commit d38d753da7f7c9c4739e3e9ca3c986fa2c1b8c98 Author: Rodrigo Vivi Date: Tue Sep 26 12:51:06 2023 -0400 drm/i915: Add missing CCS documentation Let's introduce the basic documentation about CCS. While doing that, also removed the legacy execution flag name. That flag simply doesn't exist for CCS and it is not needed on current context submission. Those flag names are only needed on legacy context, while on new ones we only need to pass the engine ID. It is worth mention that this documentation should probably live with the engine definitions rather than in the i915.rst file directly and that more updates are likely need in this section. But this should come later. v2: Overall improvements from Matt and Tvrtko. Fixes: 944823c94639 ("drm/i915/xehp: Define compute class and engine") Cc: Matt Roper Cc: Sushma Venkatesh Reddy Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Signed-off-by: Rodrigo Vivi Acked-by: Tvrtko Ursulin Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230926165107.23440-1-rodrigo.vivi@intel.com commit 7d9832e3b5385b3a02867e563ea1b1c0a7407100 Author: Wen Gong Date: Sat Sep 30 07:54:51 2023 +0300 wifi: ath12k: 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: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230905105637.10230-1-quic_wgong@quicinc.com commit 1e55298a63948ce15ea3f538be2eed937467012d Author: Hari Chandrakanthan Date: Sat Sep 30 07:54:51 2023 +0300 wifi: ath12k: do not drop data frames from unassociated stations >From 'IEEE Std 802.11-2020 section 11.3.4.1': If STA A in an infrastructure BSS receives a Class 2 or Class 3 frame from STA B that is not authenticated with STA A (i.e., the state for STA B is State 1), STA A shall discard the frame. If the frame has an individual address in the Address 1 field, the MLME of STA A shall send a Deauthentication frame to STA B. When data frames from unassociated stations are received by an AP, the AP is supposed to send a deauthentication/disassociation frame with reason code "Class 2 frame received from nonauthenticated STA" or "Class 3 frame received from nonassociated STA". But ath12k AP doesn't send deauthentication/disassociation frames, when it receives data frames from unassociated stations. The ath12k driver drops the data frames from unassociated station and the upper layer(mac80211/hostapd) is not aware of such event. Hence deauthentication/disassociation frame is not sent to that particular station by the AP. To address this issue, allow the data frames from the unassociated stations to reach mac80211 so that mac80211 can send NL80211_CMD_UNEXPECTED_FRAME event to userspace(hostapd) and hostapd upon receiving the event will send the deauthentication/disassociation frame with proper reason code. The data frame from unassociated stations gets dropped in mac80211. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-02903-QCAHKSWPL_SILICONZ-1 Signed-off-by: Hari Chandrakanthan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1689749074-14676-1-git-send-email-quic_haric@quicinc.com commit 47c27aa7ded4b8ead19b3487cc42a6185b762903 Author: Ma Ke Date: Sat Sep 30 07:54:47 2023 +0300 wifi: ath12k: mhi: fix potential memory leak in ath12k_mhi_register() mhi_alloc_controller() allocates a memory space for mhi_ctrl. When some errors occur, mhi_ctrl should be freed by mhi_free_controller() and set ab_pci->mhi_ctrl = NULL. We can fix it by calling mhi_free_controller() when the failure happens and set ab_pci->mhi_ctrl = NULL in all of the places where we call mhi_free_controller(). Signed-off-by: Ma Ke Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230922021036.3604157-1-make_ruc2021@163.com commit 4c7690614c8bbd6cd29b949f9084ddb294ffe284 Author: Rodrigo Vivi Date: Fri Sep 29 16:50:23 2023 -0400 drm/i915: Abstract display info away during probe The goal is to have this function ready for Xe to use directly. So, let's use the available macro. Cc: Jani Nikula Signed-off-by: Rodrigo Vivi Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230929205023.1202735-1-rodrigo.vivi@intel.com commit eb15bd5c2a690a84eb998140f99b2b660b4c8e7d Author: Konrad Dybcio Date: Wed Aug 30 14:48:40 2023 +0200 dt-bindings: dmaengine: qcom: gpi: Allow dma-coherent On SM8550, the GPI DMA controller is coherent with the CPU. Allow specifying that. Signed-off-by: Konrad Dybcio Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230830-topic-8550_dmac2-v1-1-49bb25239fb1@linaro.org Signed-off-by: Vinod Koul commit f1009d3214ede734e01da4cc64fc2854bf94a2f2 Author: Kaiwei Liu Date: Tue Sep 19 09:49:29 2023 +0800 dmaengine: sprd: delete redundant parameter for dma driver function The parameter *sdesc in function sprd_dma_check_trans_done is not used, so here delete redundant parameter. Signed-off-by: Kaiwei Liu Reviewed-by: Baolin Wang Link: https://lore.kernel.org/r/20230919014929.17037-1-kaiwei.liu@unisoc.com Signed-off-by: Vinod Koul commit 14f6d317913f634920a640e9047aa2e66f5bdcb7 Author: Dan Carpenter Date: Fri Sep 15 15:59:59 2023 +0300 dmaengine: ti: edma: handle irq_of_parse_and_map() errors Zero is not a valid IRQ for in-kernel code and the irq_of_parse_and_map() function returns zero on error. So this check for valid IRQs should only accept values > 0. Fixes: 2b6b3b742019 ("ARM/dmaengine: edma: Merge the two drivers under drivers/dma/") Signed-off-by: Dan Carpenter Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/f15cb6a7-8449-4f79-98b6-34072f04edbc@moroto.mountain Signed-off-by: Vinod Koul commit 9c6e02eab10a8a7628cac2cd9b8db6806acc63ca Author: Kaiwei Liu Date: Tue Sep 19 15:38:01 2023 +0800 dmaengine: sprd: add dma mask interface in probe In the probe of DMA, the default addressing range is 32 bits, while the actual DMA hardware addressing range used is 36 bits. So add dma_set_mask_and_coherent function to match DMA addressing range. Signed-off-by: Kaiwei Liu Reviewed-by: Baolin Wang Link: https://lore.kernel.org/r/20230919073801.25054-1-kaiwei.liu@unisoc.com Signed-off-by: Vinod Koul commit a9b696c851c226b8fa89faeb56e581a8f077924b Merge: 4c556d1ea5a77 67ebde42034ec Author: Mark Brown Date: Mon Oct 2 16:17:47 2023 +0100 GPIO descriptors for TI ASoC codecs Merge series from Linus Walleij : This cleans up and rewrites the GPIO usage in the TI ASoC components to use GPIO descriptors exclusively. Signed-off-by: Linus Walleij --- Linus Walleij (5): ASoC: ti: Convert N810 ASoC to GPIO descriptors ASoC: ti: Convert RX51 to use exclusively GPIO descriptors ASoC: ti: Convert TWL4030 to use GPIO descriptors ASoC: ti: Convert Pandora ASoC to GPIO descriptors ASoC: ti: osk5912: Drop unused include arch/arm/mach-omap2/board-n8x0.c | 10 +++++ arch/arm/mach-omap2/pdata-quirks.c | 10 +++++ include/linux/platform_data/omap-twl4030.h | 3 -- sound/soc/ti/n810.c | 31 ++++++++------- sound/soc/ti/omap-twl4030.c | 20 ++++------ sound/soc/ti/omap3pandora.c | 63 +++++++++++------------------- sound/soc/ti/osk5912.c | 1 - sound/soc/ti/rx51.c | 19 ++------- 8 files changed, 72 insertions(+), 85 deletions(-) --- base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d change-id: 20230922-descriptors-asoc-ti-a852eff479ed Best regards, -- Linus Walleij commit fc85c59b85d111f51b58ecf08485fa74ac5471cd Author: Andrey Konovalov Date: Mon Aug 28 17:43:04 2023 +0200 usb: gadgetfs: return USB_GADGET_DELAYED_STATUS from setup() Return USB_GADGET_DELAYED_STATUS from the setup() callback for 0-length transfers as a workaround to stop some UDC drivers (e.g. dwc3) from automatically proceeding with the status stage. This workaround should be removed once all UDC drivers are fixed to always delay the status stage until a response is queued to EP0. Reviewed-by: Alan Stern Signed-off-by: Andrey Konovalov Link: https://lore.kernel.org/r/a8d2b91f9890dc21daa359183e84879ff4525180.1693237258.git.andreyknvl@gmail.com Signed-off-by: Greg Kroah-Hartman commit cf9f7a6ee7b1f53f9ae13da55585b7d16aee2460 Author: Andrey Konovalov Date: Mon Aug 28 17:43:03 2023 +0200 usb: raw-gadget: return USB_GADGET_DELAYED_STATUS from setup() Return USB_GADGET_DELAYED_STATUS from the setup() callback for 0-length transfers as a workaround to stop some UDC drivers (e.g. dwc3) from automatically proceeding with the status stage. This workaround should be removed once all UDC drivers are fixed to always delay the status stage until a response is queued to EP0. Signed-off-by: Andrey Konovalov Link: https://lore.kernel.org/r/c56077322f0d3fc6d504092a266cb89d75701087.1693237258.git.andreyknvl@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3551ff7c5cfff4dc27fdcd14fa286edc08d78088 Author: Andrey Konovalov Date: Mon Aug 28 17:43:02 2023 +0200 usb: gadget: clarify usage of USB_GADGET_DELAYED_STATUS USB_GADGET_DELAYED_STATUS was introduced in commit 1b9ba000177e ("usb: gadget: composite: Allow function drivers to pause control transfers"). It was initially intended for the composite framework to allow delaying completing the status stage of a SET_CONFIGURATION request until all functions are ready. Unfortunately, that commit had an unintended side-effect of returning USB_GADGET_DELAYED_STATUS from the ->setup() call of the composite framework gadget driver. As a result of this and the incomplete documentation, some UDC drivers started relying on USB_GADGET_DELAYED_STATUS to decide when to avoid autocompleting the status stage for 0-length control transfers. dwc3 was the first in commit 5bdb1dcc6330 ("usb: dwc3: ep0: handle delayed_status again"). And a number of other UDC drivers followed later, probably relying on the dwc3 behavior as a reference. Unfortunately, this violated the interface between the UDC and the gadget driver for 0-length control transfers: the UDC driver must only proceed with the status stage for a 0-length control transfer once the gadget driver queued a response to EP0. As a result, a few gadget drivers are partially broken when used with a UDC that only delays the status stage for 0-length transfers when USB_GADGET_DELAYED_STATUS is returned from the setup() callback. This includes Raw Gadget and GadgetFS. For FunctionFS, a workaround was added in commit 946ef68ad4e4 ("usb: gadget: ffs: Let setup() return USB_GADGET_DELAYED_STATUS") and commit 4d644abf2569 ("usb: gadget: f_fs: Only return delayed status when len is 0"). The proper solution to this issue would be to contain USB_GADGET_DELAYED_STATUS within the composite framework and make all UDC drivers to not complete the status stage for 0-length requests on their own. Unfortunately, there is quite a few UDC drivers that need to get fixed and the required changes for some of them are not trivial. For now, update the comments to clarify that USB_GADGET_DELAYED_STATUS must not be used by the UDC drivers. The following two commits also add workarounds to Raw Gadget and GadgetFS to make them compatible with the broken UDC drivers until they are fixed. Acked-by: Alan Stern Signed-off-by: Andrey Konovalov Link: https://lore.kernel.org/r/7f0ee06c68c7241c844cd50f8565fdd5ead79b1b.1693237258.git.andreyknvl@gmail.com Signed-off-by: Greg Kroah-Hartman commit 36c38087a3fb1083628b8a90f15eb5398e2cd0f9 Author: Yue Haibing Date: Fri Aug 25 17:15:18 2023 +0800 USB: c67x00: Remove unused declaration c67x00_hcd_msg_received() Commit e9b29ffc519b ("USB: add Cypress c67x00 OTG controller HCD driver") declared but never implemented this. Signed-off-by: Yue Haibing Link: https://lore.kernel.org/r/20230825091518.22180-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman commit 568441b7d45fc7198a89b522d721428f2005c356 Author: Heikki Krogerus Date: Mon Oct 2 17:22:40 2023 +0300 usb: pd: Exposing the Peak Current value of Fixed Supplies to user space Exposing the value of the field as is. The Peak Current value has to be interpreted as described in Table 6-10 (Fixed Power Source Peak Current Capability) of the USB Power Delivery Specification, but that interpretation will be done in user space, not in kernel. Suggested-by: Douglas Gilbert Reviewed-by: Guenter Roeck Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20231002142240.2641962-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit b447e9efe50a1d64070c4f3ec1b1ee1882ee9c7a Author: Jerome Brunet Date: Mon Oct 2 14:29:09 2023 +0200 usb: misc: onboard_usb_hub: add Genesys Logic gl3510 hub support Add support for the gl3510 4 ports USB3.1 hub. This allows to control its reset pins with a gpio. No public documentation is available for this hub. Using the same reset duration as the gl852g which seems OK. Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20231002122909.2338049-3-jbrunet@baylibre.com Signed-off-by: Greg Kroah-Hartman commit bb9f10ff6709e15fb935c954f1fb715ac1f970e7 Author: Jerome Brunet Date: Mon Oct 2 14:29:08 2023 +0200 dt-bindings: usb: add device for Genesys Logic hub gl3510 Add gl3510 USB 3 root hub device id Acked-by: Krzysztof Kozlowski Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20231002122909.2338049-2-jbrunet@baylibre.com Signed-off-by: Greg Kroah-Hartman commit dbc1defec1aa7d8d80da3ea9e3ddafbcfca8f822 Author: Michael Wu Date: Wed Sep 20 14:30:30 2023 +0800 usb:typec:tcpm:support double Rp to Vbus cable as sink The USB Type-C Cable and Connector Specification defines the wire connections for the USB Type-C to USB 2.0 Standard-A cable assembly (Release 2.2, Chapter 3.5.2). The Notes says that Pin A5 (CC) of the USB Type-C plug shall be connected to Vbus through a resister Rp. However, there is a large amount of such double Rp connected to Vbus non-standard cables which produced by UGREEN circulating on the market, and it can affects the normal operations of the state machine easily, especially to CC1 and CC2 be pulled up at the same time. In fact, we can regard those cables as sink to avoid abnormal state. Message as follow: [ 58.900212] VBUS on [ 59.265433] CC1: 0 -> 3, CC2: 0 -> 3 [state TOGGLING, polarity 0, connected] [ 62.623308] CC1: 3 -> 0, CC2: 3 -> 0 [state TOGGLING, polarity 0, disconnected] [ 62.625006] VBUS off [ 62.625012] VBUS VSAFE0V Signed-off-by: Michael Wu Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230920063030.66312-1-michael@allwinnertech.com Signed-off-by: Greg Kroah-Hartman commit 5c954e030f55b40b0b538c66d1a49a91b727f4dc Author: Chunfeng Yun Date: Wed Aug 30 20:28:20 2023 +0800 usb: xhci-mtk: improve split scheduling by separate IN/OUT budget Calculate the IN/OUT budget separately to improve the bandwidth schedule, meanwhile should avoid Start-Split token overlap between IN and OUT endpoints, and take into account the FS/LS bandwidth boundary in each microframe and also in each FS frame. Calculate the budget for SS of OUT eps and CS of IN eps, but not include extra-cs, and always add at most extra-cs allowed. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20230830122820.18859-2-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit ba6b83a910b6d8a9379bda55cbf06cb945473a96 Author: Chunfeng Yun Date: Wed Aug 30 20:28:19 2023 +0800 usb: xhci-mtk: add a bandwidth budget table In order to estimate when fs/ls transactions appear on a downstream bus, the host must calculate a best case full-speed budget, use a table to track how many bytes occure in each microframe. This patch is prepared for introducing an improved bandwidth scheduling. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20230830122820.18859-1-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 0e650c94a422be51b1dbe3cb4598ab247adabb29 Author: Fabio Estevam Date: Sun Sep 24 13:03:51 2023 -0300 dt-bindings: usb: ci-hdrc-usb2: Allow "fsl,imx27-usb" to be passed alone imx27.dtsi describes its usb nodes as: compatible = "fsl,imx27-usb"; Adjust the bindings to allow it and avoid the following schema warning: usb@10024000: compatible: 'oneOf' conditional failed, one must be fixed: ['fsl,imx27-usb'] is too short Signed-off-by: Fabio Estevam Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230924160351.692867-1-festevam@gmail.com Signed-off-by: Greg Kroah-Hartman commit 664e2852aa9142193c2e241327631f032b966742 Author: Francesco Dolcini Date: Fri Sep 22 14:30:03 2023 +0200 arm64: dts: ti: verdin-am62: disable MIPI DSI bridge Keep the DPI to MIPI-DSI bridge disabled in the SoM dtsi file. The display chain is not wholly described in the device tree file, on Verdin product family the displays are additional accessories that are configured/enabled using DT overlays. With this enabled we have issues when a display is enabled on TIDSS port1 (LVDS) and port0 (DSI) is not used. Fixes: 9e77200356ba ("arm64: dts: ti: verdin-am62: Add DSI display support") Signed-off-by: Francesco Dolcini Link: https://lore.kernel.org/r/20230922123003.25002-1-francesco@dolcini.it Signed-off-by: Vignesh Raghavendra commit 2f40c6df3dcc1341afd99cd1a4de035f807c8a03 Author: Ravi Gunasekaran Date: Wed Sep 20 11:08:34 2023 +0530 arm64: dts: ti: k3-am654-base-board: Add I2C I/O expander AM654 baseboard has two TCA9554 I/O expander on the WKUP_I2C0 bus. The expander at address 0x38 is used to detect daughter cards. Add a node for this I/O expander. Signed-off-by: Ravi Gunasekaran Reviewed-by: Andrew Davis Link: https://lore.kernel.org/r/20230920053834.21399-1-r-gunasekaran@ti.com Signed-off-by: Vignesh Raghavendra commit a1cd710f56c145bc7e7fc2bfbe332d944d5338cd Author: Wadim Egorov Date: Thu Sep 14 11:30:27 2023 +0200 arm64: dts: ti: phycore-am64: Add RTC interrupt pin Wth commit 16b26f602758 ("rtc: rv3028: Use IRQ flags obtained from device tree if available") we can now use the interrupt pin of the RTC. Let's add interrupt pin definitions to the SoM RTC. Signed-off-by: Wadim Egorov Link: https://lore.kernel.org/r/20230914093027.3901602-1-w.egorov@phytec.de Signed-off-by: Vignesh Raghavendra commit dc16ab3ebf9d2b322f7463c5112f8875dcaca0e5 Author: Wadim Egorov Date: Tue Sep 12 15:30:36 2023 +0200 arm64: dts: ti: k3-am64: Fix indentation in watchdog nodes Use single instead of double tab. Signed-off-by: Wadim Egorov Link: https://lore.kernel.org/r/20230912133036.257277-1-w.egorov@phytec.de Signed-off-by: Vignesh Raghavendra commit 35be6ac964450687ab39b846d65ee1cb2a352280 Author: Siddharth Vadapalli Date: Tue Sep 12 10:03:08 2023 +0530 arm64: dts: ti: k3-j721s2-evm-gesi: Specify base dtb for overlay file Specify the base dtb file k3-j721s2-common-proc-board.dtb on which the k3-j721s2-evm-gesi-exp-board.dtbo overlay has to be applied. Name the resulting dtb as k3-j721s2-evm.dtb. Fixes: cac04e27f093 ("arm64: dts: ti: k3-j721s2: Add overlay to enable main CPSW2G with GESI") Reported-by: Rob Herring Signed-off-by: Siddharth Vadapalli Link: https://lore.kernel.org/r/20230912043308.20629-1-s-vadapalli@ti.com Signed-off-by: Vignesh Raghavendra commit 4669288219a7f77c6ff992d10ce6a20660863979 Author: Nishanth Menon Date: Mon Sep 11 12:29:02 2023 -0500 arm64: dts: ti: k3-am642-sk: Add boot phase tags marking bootph-all as phase tag was added to dt-schema (dtschema/schemas/bootph.yaml) to describe various node usage during boot phases with DT. Describe the same for AM642-sk boot devices. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230911172902.1057417-4-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 33830e077797ce4d7317b83a145f03bfde06ad4c Author: Nishanth Menon Date: Mon Sep 11 12:29:01 2023 -0500 arm64: dts: ti: k3-am642-evm: Add boot phase tags marking bootph-all as phase tag was added to dt-schema (dtschema/schemas/bootph.yaml) to describe various node usage during boot phases with DT. Describe the same for AM642-evm boot devices. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230911172902.1057417-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 8d5bfa637f0f04a71166b9bde0ef022b08986296 Author: Nishanth Menon Date: Mon Sep 11 12:29:00 2023 -0500 arm64: dts: ti: k3-am64: Add phase tags marking bootph-all as phase tag was added to dt-schema (dtschema/schemas/bootph.yaml) to describe various node usage during boot phases with DT. On TI K3 AM642 SoC, only esm nodes are exclusively used by R5 bootloader, rest of the dts nodes with bootph-* are used by later boot stages also. Add bootph-all for all other nodes that are used in the bootloader on K3 AM642 SoC, and bootph-pre-ram is not needed specifically for any other node in kernel dts. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230911172902.1057417-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit c412c2f26eed08b1836ccf79f5547b67c1b55d5d Author: Nishanth Menon Date: Mon Sep 11 11:25:35 2023 -0500 arm64: dts: ti: k3-am625-sk: Add boot phase tags marking bootph-all as phase tag was added to dt-schema (dtschema/schemas/bootph.yaml) to describe various node usage during boot phases with DT. Describe the same for am625-sk boot devices. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230911162535.1044560-4-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 944adefc7f88aec1adf5f76f593d483938bc5e4e Author: Nishanth Menon Date: Mon Sep 11 11:25:34 2023 -0500 arm64: dts: ti: k3-am625-beagleplay: Add boot phase tags marking bootph-all as phase tag was added to dt-schema (dtschema/schemas/bootph.yaml) to describe various node usage during boot phases with DT. Describe the same for beagleplay boot devices. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230911162535.1044560-3-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 87e437a0fb6cbecbabff293061793b32e3bcd3b1 Author: Nishanth Menon Date: Mon Sep 11 11:25:33 2023 -0500 arm64: dts: ti: k3-am625: Add boot phase tags marking bootph-all as phase tag was added to dt-schema (dtschema/schemas/bootph.yaml) to describe various node usage during boot phases with DT. On TI K3 AM625 SoC, only secure_proxy_sa3 and esm nodes are exclusively used by R5 bootloader, rest of the dts nodes with bootph-* are used by later boot stages also. Add bootph-all for all other nodes that are used in the bootloader on K3 AM625 SoC, and bootph-pre-ram is not needed specifically for any other node in kernel dts. Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20230911162535.1044560-2-nm@ti.com Signed-off-by: Vignesh Raghavendra commit 7c3bc1952dd2b02983c06632b2d342823e9d6b96 Author: Marcel Ziswiler Date: Fri Sep 1 15:32:32 2023 +0200 arm64: dts: ti: verdin-am62: add iw416 based bluetooth Add NXP IW416 based u-blox MAYA-W1 Bluetooth (using btnxpuart) as used on the V1.1 SoMs. Wi-Fi is and was already using mwifiex. Signed-off-by: Marcel Ziswiler Link: https://lore.kernel.org/r/20230901133233.105546-1-marcel@ziswiler.com Signed-off-by: Vignesh Raghavendra commit 358ad297e379ff548247e3e24c6619559942bfdd Author: Niklas Schnelle Date: Mon Sep 11 14:56:53 2023 +0200 usb: pci-quirks: handle HAS_IOPORT dependency for UHCI handoff In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. With the AMD quirk handled USB PCI quirks still use inw() in uhci_check_and_reset_hc() and thus indirectly in quirk_usb_handoff_uhci(). Handle this by conditionally compiling uhci_check_and_reset_hc() and stubbing out quirk_usb_handoff_uhci() when HAS_IOPORT is not available. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230911125653.1393895-4-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 52e24f8c0a102ac76649c6b71224fadcc82bd5da Author: Niklas Schnelle Date: Mon Sep 11 14:56:52 2023 +0200 usb: pci-quirks: handle HAS_IOPORT dependency for AMD quirk In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not being declared. In the pci-quirks case the I/O port acceses are used in the quirks for several AMD south bridges, Add a config option for the AMD quirks to depend on HAS_IOPORT and #ifdef the quirk code. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230911125653.1393895-3-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 7ca9f9ba8aa7380dee5dd8346b57bbaf198b075a Author: Niklas Schnelle Date: Mon Sep 11 14:56:51 2023 +0200 usb: pci-quirks: group AMD specific quirk code together A follow on patch will introduce CONFIG_USB_PCI_AMD governing the AMD quirk and adding its compile time dependency on HAS_IOPORT. In order to minimize the number of #ifdefs in C files and make that patch easier to read first group the code together. This is pure code movement no functional change is intended. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230911125653.1393895-2-schnelle@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 80920e21269265fd6fc5abf825af77ea2d100c8a Author: Jinjie Ruan Date: Wed Aug 30 16:56:58 2023 +0800 usbmon: Use list_for_each_entry() helper Convert list_for_each() to list_for_each_entry() so that the p/pos list_head pointer and list_entry() call are no longer needed, which can reduce a few lines of code. No functional changed. Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230830085658.527752-1-ruanjinjie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 82e83cb51c87b5bf3ab83f7c7b150c19400056c2 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:30 2023 +0200 soc/ti: wkup_m3_ipc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-40-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon commit ba03aab9bfb4c9d456419da3891375d45c6bfe15 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:29 2023 +0200 soc/ti: smartreflex: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-39-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon commit d183b20d340b7c098f44cb5c02f4ced01cfd0b16 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:28 2023 +0200 soc/ti: pruss: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-38-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon commit 9eb950e9fffc5337bfe1798cf89ce4d97a4f1221 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:27 2023 +0200 soc/ti: pm33xx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-37-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon commit af97160a0c5f1908c6f2830023fb93baac4451d3 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:26 2023 +0200 soc/ti: knav_qmss_queue: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-36-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon commit 3af4ec7c7dd39a2c4618f6536b2e7b73a19be169 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:25 2023 +0200 soc/ti: knav_dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-35-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon commit f34b902c5ba67841902cd7f0e24e64bb82f69cb4 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:24 2023 +0200 soc/ti: k3-ringacc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Konrad Dybcio # qcom Link: https://lore.kernel.org/r/20230925095532.1984344-34-u.kleine-koenig@pengutronix.de Signed-off-by: Nishanth Menon commit 7b7a224b1ba1703583b25a3641ad9798f34d832a Author: Dhruva Gole Date: Thu Sep 21 14:40:26 2023 +0530 firmware: ti_sci: Mark driver as non removable The TI-SCI message protocol provides a way to communicate between various compute processors with a central system controller entity. It provides the fundamental device management capability and clock control in the SOCs that it's used in. The remove function failed to do all the necessary cleanup if there are registered users. Some things are freed however which likely results in an oops later on. Ensure that the driver isn't unbound by suppressing its bind and unbind sysfs attributes. As the driver is built-in there is no way to remove device once bound. We can also remove the ti_sci_remove call along with the ti_sci_debugfs_destroy as there are no callers for it any longer. Fixes: aa276781a64a ("firmware: Add basic support for TI System Control Interface (TI-SCI) protocol") Reported-by: Uwe Kleine-König Closes: https://lore.kernel.org/linux-arm-kernel/20230216083908.mvmydic5lpi3ogo7@pengutronix.de/ Suggested-by: Uwe Kleine-König Acked-by: Uwe Kleine-König Signed-off-by: Dhruva Gole Link: https://lore.kernel.org/r/20230921091025.133130-1-d-gole@ti.com Signed-off-by: Nishanth Menon commit c31071eabb448c58e0c43d519932af42dfc8f07d Author: Bartosz Golaszewski Date: Wed Sep 20 10:56:39 2023 +0200 gpiolib: extend the critical sections of lookup tables There are two places in the code where we retrieve a lookup table using gpiod_find_lookup_table() (which protects the table list with the lookup table lock) and then use it after the lock is released. We need to keep the lookup table mutex locked the entire time we're using the tables. Remove the locking from gpiod_find_lookup_table() and use guards to protect the code actually using the table objects. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij commit 83494dc51033506eb60c5e11a335461b2dc42111 Author: Cyril Hrubis Date: Mon Oct 2 13:55:53 2023 +0200 sched/rt/docs: Use 'real-time' instead of 'realtime' Standardize on a single variant. Signed-off-by: Cyril Hrubis Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231002115553.3007-4-chrubis@suse.cz commit e6dbdd8fb75526b01787050087b65d12c76b3666 Author: Cyril Hrubis Date: Mon Oct 2 13:55:52 2023 +0200 sched/rt/docs: Clarify & fix sched_rt_* sysctl docs - Describe explicitly that sched_rt_runtime_us is allocated from sched_rt_period_us and hence always less or equal to that value. - The limit for sched_rt_runtime_us is not INT_MAX-1, but rather it's limited by the value of sched_rt_period_us. If sched_rt_period_us is INT_MAX then sched_rt_runtime_us can be set to INT_MAX as well. Signed-off-by: Cyril Hrubis Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231002115553.3007-3-chrubis@suse.cz commit 079be8fc630943d9fc70a97807feb73d169ee3fc Author: Cyril Hrubis Date: Mon Oct 2 13:55:51 2023 +0200 sched/rt: Disallow writing invalid values to sched_rt_period_us The validation of the value written to sched_rt_period_us was broken because: - the sysclt_sched_rt_period is declared as unsigned int - parsed by proc_do_intvec() - the range is asserted after the value parsed by proc_do_intvec() Because of this negative values written to the file were written into a unsigned integer that were later on interpreted as large positive integers which did passed the check: if (sysclt_sched_rt_period <= 0) return EINVAL; This commit fixes the parsing by setting explicit range for both perid_us and runtime_us into the sched_rt_sysctls table and processes the values with proc_dointvec_minmax() instead. Alternatively if we wanted to use full range of unsigned int for the period value we would have to split the proc_handler and use proc_douintvec() for it however even the Documentation/scheduller/sched-rt-group.rst describes the range as 1 to INT_MAX. As far as I can tell the only problem this causes is that the sysctl file allows writing negative values which when read back may confuse userspace. There is also a LTP test being submitted for these sysctl files at: http://patchwork.ozlabs.org/project/ltp/patch/20230901144433.2526-1-chrubis@suse.cz/ Signed-off-by: Cyril Hrubis Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231002115553.3007-2-chrubis@suse.cz commit 4c556d1ea5a771a91f946964d931b4974a6b917e Author: Shenghao Ding Date: Mon Oct 2 17:04:33 2023 +0800 ASoC: tas2781: fixed compiling issue in m68k fixed m68k compiling issue: mapping table can save code field; storing the dev_idx as a member of block can reduce unnecessary time and system resource comsumption of dev_idx mapping every time the block data writing to the dsp. Signed-off-by: Shenghao Ding Link: https://lore.kernel.org/r/20231002090434.1896-1-shenghao-ding@ti.com Signed-off-by: Mark Brown commit 045059e4d3ce39104323fe01da61374ba73f31b3 Author: Amadeusz Sławiński Date: Mon Oct 2 10:46:29 2023 +0200 ASoC: Intel: avs: Remove unused variable Recent commit removed the only user of bus variable in avs_dai_fe_prepare(), also remove the variable itself. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309292121.5DdaNpLj-lkp@intel.com/ Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20231002084629.903103-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 3746284c233d5cf5f456400e61cd4a46a69c6e8c Author: Gustavo A. R. Silva Date: Fri Sep 15 13:09:11 2023 -0600 ASoC: SOF: ipc4-topology: Use size_add() in call to struct_size() If, for any reason, the open-coded arithmetic causes a wraparound, the protection that `struct_size()` adds against potential integer overflows is defeated. Fix this by hardening call to `struct_size()` with `size_add()`. Fixes: f9efae954905 ("ASoC: SOF: ipc4-topology: Add support for base config extension") Signed-off-by: "Gustavo A. R. Silva" Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/ZQSr15AYJpDpipg6@work Signed-off-by: Mark Brown commit 67ebde42034ec8d199ec7877efed4bd08eb0c5e0 Author: Linus Walleij Date: Tue Sep 26 15:25:33 2023 +0200 ASoC: ti: osk5912: Drop unused include This driver includes the legacy header but doesn't use it. Drop the include. Signed-off-by: Linus Walleij Acked-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230926-descriptors-asoc-ti-v1-5-60cf4f8adbc5@linaro.org Signed-off-by: Mark Brown commit 319e6ac143b9e9048e527ab9dd2aabb8fdf3d60f Author: Linus Walleij Date: Tue Sep 26 15:25:32 2023 +0200 ASoC: ti: Convert Pandora ASoC to GPIO descriptors The Pandora uses GPIO descriptors pretty much exclusively, but not for ASoC, so let's fix it. Register the pins in a descriptor table in the machine since the ASoC device is not using device tree. Use static locals for the GPIO descriptors because I'm not able to experient with better state storage on any real hardware. Others using the Pandora can come afterwards and improve this. Signed-off-by: Linus Walleij Acked-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230926-descriptors-asoc-ti-v1-4-60cf4f8adbc5@linaro.org Signed-off-by: Mark Brown commit 1b8a62937e0b23c41956feec778ca7776a01df48 Author: Linus Walleij Date: Tue Sep 26 15:25:31 2023 +0200 ASoC: ti: Convert TWL4030 to use GPIO descriptors The TWL4030 is actually only ever populated from the device tree, so we can just pass the right device and headphone jack GPIO name to snd_soc_jack_add_gpios() and it will pick the right GPIO right from the device tree. The platform data patch is unused (no in-tree users of the pdata method) but these can use GPIO descriptor tables rather than global GPIO numbers if they need this. Signed-off-by: Linus Walleij Acked-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230926-descriptors-asoc-ti-v1-3-60cf4f8adbc5@linaro.org Signed-off-by: Mark Brown commit 22041ed154aaf89f31306014a305dde516c308ea Author: Linus Walleij Date: Tue Sep 26 15:25:29 2023 +0200 ASoC: ti: Convert N810 ASoC to GPIO descriptors The N810 uses GPIO descriptors pretty much exclusively, but not for ASoC, so let's fix it. Register the pins in a descriptor table in the machine since the ASoC device is not using device tree. Use static locals for the GPIO descriptors because I'm not able to experient with better state storage on any real hardware. Others using the N810 can come afterwards and improve this. Signed-off-by: Linus Walleij Acked-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230926-descriptors-asoc-ti-v1-1-60cf4f8adbc5@linaro.org Signed-off-by: Mark Brown commit 5b12dd84499a74be9d133e020e424025359a244f Author: Linus Walleij Date: Tue Sep 26 15:25:30 2023 +0200 ASoC: ti: Convert RX51 to use exclusively GPIO descriptors The RX51/Nokia n900 uses the legacy GPIO header to convert a GPIO back to the global GPIO numberspace and then the jack using it in the snd_soc_jack_add_gpios() call immediately looks up the corresponding descriptor again. The snd_soc_jack_add_gpios() handles GPIOs passed with devices just fine: pass in the device instead, and rename the GPIO to match the property in the device tree, and it should work all the same but without all the trouble. Signed-off-by: Linus Walleij Tested-by: Jarkko Nikula Acked-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230926-descriptors-asoc-ti-v1-2-60cf4f8adbc5@linaro.org Signed-off-by: Mark Brown commit eea6c26207255461c1d5b59d74ee460442113ece Author: Uwe Kleine-König Date: Wed Sep 27 21:37:06 2023 +0200 thermal: amlogic: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). amlogic_thermal_disable() always returned zero. Change it to return no value and then trivially convert the driver to .remove_new() and fix a whitespace inconsitency en passant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 439f0bb3a7c529feadce975cf96e8cf8fcf929bf Author: Uwe Kleine-König Date: Wed Sep 27 21:37:36 2023 +0200 thermal: uniphier: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit f3e38da002571ca76bcd75000c847d7a4ccb2c73 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:35 2023 +0200 thermal: ti-bandgap: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit f021f0526274834ae941f5ab9b06d56e13d75db7 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:34 2023 +0200 thermal: tegra-bpmp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit f1afede9e24cb06f409d855aa546e99bbe4817fb Author: Uwe Kleine-König Date: Wed Sep 27 21:37:33 2023 +0200 thermal: soctherm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit ca92bdec592f59ae7a1ca1da6ce77e7de84acdee Author: Uwe Kleine-König Date: Wed Sep 27 21:37:32 2023 +0200 thermal: stm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 295b117645814de05ab863e9f890cbd79d7a2a38 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:31 2023 +0200 thermal: sprd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 7c2714a1e6895e49e002ad136280e47671843443 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:30 2023 +0200 thermal: spear: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 0b478d7b867b9c1621b0bb31ee0c416bed376631 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:29 2023 +0200 thermal: exynos_tmu: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 24bbbfb73e9bf3188177950d420d059225070250 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:28 2023 +0200 thermal: rzg2l: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit cc86ac43e555ea40a22825f1eec5fb72c8e59522 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:27 2023 +0200 thermal: rockchip: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Reviewed-by: Heiko Stuebner Signed-off-by: Rafael J. Wysocki commit eb9c996f0110de117bf4d4e2ba837790a17d9ed2 Author: Michał Mirosław Date: Thu Sep 28 23:06:04 2023 +0200 usb: chipidea: tegra: Consistently use dev_err_probe() Convert all error exits from probe() to dev_err_probe(). Acked-by: Peter Chen Signed-off-by: Michał Mirosław Link: https://lore.kernel.org/r/43d03aad1c394d9995f69d13ca1176f9ff8a8dab.1695934946.git.mirq-linux@rere.qmqm.pl Signed-off-by: Greg Kroah-Hartman commit 2ae61a2562c0d1720545b0845829a65fb6a9c2c6 Author: Michał Mirosław Date: Thu Sep 28 23:06:03 2023 +0200 usb: chipidea: Simplify Tegra DMA alignment code The USB host on Tegra3 works with 32-bit alignment. Previous code tried to align the buffer, but it did align the wrapper struct instead, so the buffer was at a constant offset of 8 bytes (two pointers) from expected alignment. Since kmalloc() guarantees at least 8-byte alignment already, the alignment-extending is removed. Fixes: fc53d5279094 ("usb: chipidea: tegra: Support host mode") Signed-off-by: Michał Mirosław Link: https://lore.kernel.org/r/a0d917d492b1f91ee0019e68b8e8bca9c585393f.1695934946.git.mirq-linux@rere.qmqm.pl Signed-off-by: Greg Kroah-Hartman commit 7ab8716713c931ac79988f2592e1cf8b2e4fec1b Author: Michał Mirosław Date: Thu Sep 28 23:06:03 2023 +0200 usb: chipidea: Fix DMA overwrite for Tegra Tegra USB controllers seem to issue DMA in full 32-bit words only and thus may overwrite unevenly-sized buffers. One such occurrence is detected by SLUB when receiving a reply to a 1-byte buffer (below). Fix this by allocating a bounce buffer also for buffers with sizes not a multiple of 4. ============================================================================= BUG kmalloc-64 (Tainted: G B ): kmalloc Redzone overwritten ----------------------------------------------------------------------------- 0x8555cd02-0x8555cd03 @offset=3330. First byte 0x0 instead of 0xcc Allocated in usb_get_status+0x2b/0xac age=1 cpu=3 pid=41 __kmem_cache_alloc_node+0x12f/0x1e4 __kmalloc+0x33/0x8c usb_get_status+0x2b/0xac hub_probe+0x5e9/0xcec usb_probe_interface+0xbf/0x21c really_probe+0xa5/0x2c4 __driver_probe_device+0x75/0x174 driver_probe_device+0x31/0x94 __device_attach_driver+0x65/0xc0 bus_for_each_drv+0x4b/0x74 __device_attach+0x69/0x120 bus_probe_device+0x65/0x6c device_add+0x48b/0x5f8 usb_set_configuration+0x37b/0x6b4 usb_generic_driver_probe+0x37/0x68 usb_probe_device+0x35/0xb4 Slab 0xbf622b80 objects=21 used=18 fp=0x8555cdc0 flags=0x800(slab|zone=0) Object 0x8555cd00 @offset=3328 fp=0x00000000 Redzone 8555ccc0: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc ................ Redzone 8555ccd0: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc ................ Redzone 8555cce0: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc ................ Redzone 8555ccf0: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc ................ Object 8555cd00: 01 00 00 00 cc cc cc cc cc cc cc cc cc cc cc cc ................ Object 8555cd10: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc ................ Object 8555cd20: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc ................ Object 8555cd30: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc ................ Redzone 8555cd40: cc cc cc cc .... Padding 8555cd74: 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a 5a ZZZZZZZZZZZZ CPU: 3 PID: 41 Comm: kworker/3:1 Tainted: G B 6.6.0-rc1mq-00118-g59786f827ea1 #1115 Hardware name: NVIDIA Tegra SoC (Flattened Device Tree) Workqueue: usb_hub_wq hub_event [<8010ca28>] (unwind_backtrace) from [<801090a5>] (show_stack+0x11/0x14) [<801090a5>] (show_stack) from [<805da2fb>] (dump_stack_lvl+0x4d/0x7c) [<805da2fb>] (dump_stack_lvl) from [<8026464f>] (check_bytes_and_report+0xb3/0xe4) [<8026464f>] (check_bytes_and_report) from [<802648e1>] (check_object+0x261/0x290) [<802648e1>] (check_object) from [<802671b1>] (free_to_partial_list+0x105/0x3f8) [<802671b1>] (free_to_partial_list) from [<80268613>] (__kmem_cache_free+0x103/0x128) [<80268613>] (__kmem_cache_free) from [<80425a67>] (usb_get_status+0x73/0xac) [<80425a67>] (usb_get_status) from [<80421b31>] (hub_probe+0x5e9/0xcec) [<80421b31>] (hub_probe) from [<80428bbb>] (usb_probe_interface+0xbf/0x21c) [<80428bbb>] (usb_probe_interface) from [<803ee13d>] (really_probe+0xa5/0x2c4) [<803ee13d>] (really_probe) from [<803ee3d1>] (__driver_probe_device+0x75/0x174) [<803ee3d1>] (__driver_probe_device) from [<803ee501>] (driver_probe_device+0x31/0x94) usb 1-1: device descriptor read/8, error -71 Fixes: fc53d5279094 ("usb: chipidea: tegra: Support host mode") Signed-off-by: Michał Mirosław Link: https://lore.kernel.org/r/ef8466b834c1726f5404c95c3e192e90460146f8.1695934946.git.mirq-linux@rere.qmqm.pl Signed-off-by: Greg Kroah-Hartman commit 685dbd1b2306c9fe1ffc150f81b3ac11b1e1bc9e Author: Rohit Agarwal Date: Fri Sep 22 10:42:05 2023 +0530 phy: qcom-qmp-usb: Add Qualcomm SDX75 USB3 PHY support Add support for USB3 QMP PHY found in SDX75 platform. Signed-off-by: Rohit Agarwal Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/1695359525-4548-6-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Greg Kroah-Hartman commit f2b5cdb003e4047b6c55a24fd7d3a2482b9e1300 Author: Rohit Agarwal Date: Fri Sep 22 10:42:04 2023 +0530 dt-bindings: usb: dwc3: Add SDX75 compatible Document the SDX75 dwc3 compatible. Signed-off-by: Rohit Agarwal Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1695359525-4548-5-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 91da60e3fda8bc917d48ba387942f08296e2af87 Author: Rohit Agarwal Date: Fri Sep 22 10:42:03 2023 +0530 dt-bindings: usb: qcom,dwc3: Fix SDX65 clocks SDX65 has 5 clocks so mention in the bindings. Fixes: 16946a60715c ("dt-bindings: usb: qcom,dwc3: fix clock matching") Signed-off-by: Rohit Agarwal Acked-by: Rob Herring Link: https://lore.kernel.org/r/1695359525-4548-4-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Greg Kroah-Hartman commit df55d4f814f9b4f9deccb85e1a0ee34321572eab Author: Rohit Agarwal Date: Fri Sep 22 10:42:02 2023 +0530 dt-bindings: phy: qcom,qmp-usb: Add SDX75 USB3 PHY Add dt-bindings for USB3 PHY found on Qualcomm SDX75. Signed-off-by: Rohit Agarwal Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1695359525-4548-3-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Greg Kroah-Hartman commit e38447bea4428e7dd80daba2b40160d5154e6e59 Author: Rohit Agarwal Date: Fri Sep 22 10:42:01 2023 +0530 dt-bindings: phy: qcom,snps-eusb2-phy: Add compatible for SDX75 Add a dt-bindings compatible string for the SDX75 SoC that uses Synopsis eUSB2 PHY. Signed-off-by: Rohit Agarwal Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1695359525-4548-2-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 6591e278f05c13f2525e0adb805e18174eda7024 Author: Stanley Chang Date: Tue Sep 12 12:19:03 2023 +0800 dt-bindings: usb: dwc3: Add DWC_usb3 TX/RX threshold configurable In Synopsys's dwc3 data book: To avoid underrun and overrun during the burst, in a high-latency bus system (like USB), threshold and burst size control is provided through GTXTHRCFG and GRXTHRCFG registers. By default, USB TX and RX threshold are not enabled. To enable TX or RX threshold, both packet threshold count and max burst size properties must be set to a valid non-zero value. In Realtek DHC SoC, DWC3 USB 3.0 uses AHB system bus. When dwc3 is connected with USB 2.5G Ethernet, there will be overrun problem. Therefore, setting TX/RX thresholds can avoid this issue. Signed-off-by: Stanley Chang Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230912041904.30721-2-stanley_chang@realtek.com Signed-off-by: Greg Kroah-Hartman commit e72fc8d6a12af7ae8dd1b52cf68ed68569d29f80 Author: Stanley Chang Date: Tue Sep 12 12:19:02 2023 +0800 usb: dwc3: core: configure TX/RX threshold for DWC3_IP In Synopsys's dwc3 data book: To avoid underrun and overrun during the burst, in a high-latency bus system (like USB), threshold and burst size control is provided through GTXTHRCFG and GRXTHRCFG registers. In Realtek DHC SoC, DWC3 USB 3.0 uses AHB system bus. When dwc3 is connected with USB 2.5G Ethernet, there will be overrun problem. Therefore, setting TX/RX thresholds can avoid this issue. Signed-off-by: Stanley Chang Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230912041904.30721-1-stanley_chang@realtek.com Signed-off-by: Greg Kroah-Hartman commit a3d19c289bedc99f01010020074f00b60640ade8 Author: Stanley Chang Date: Sat Aug 26 11:10:07 2023 +0800 dt-bindings: usb: dwc3: Add Realtek DHC RTD SoC DWC3 USB Document the DWC3 USB bindings for Realtek SoCs. Signed-off-by: Stanley Chang Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230826031028.1892-2-stanley_chang@realtek.com Signed-off-by: Greg Kroah-Hartman commit 34c200483569fc209e31017e2f6fdbfcb79cd3d5 Author: Stanley Chang Date: Sat Aug 26 11:10:06 2023 +0800 usb: dwc3: add Realtek DHC RTD SoC dwc3 glue layer driver Realtek DHC RTD SoCs integrate dwc3 IP and has some customizations to support different generations of SoCs. The RTD1619b subclass SoC only supports USB 2.0 from dwc3. The driver can set a maximum speed to support this. Add role switching function, that can switch USB roles through other drivers, or switch USB roles through user space through set /sys/class/usb_role/. Signed-off-by: Stanley Chang Acked-by: Thinh Nguyen Link: https://lore.kernel.org/r/20230826031028.1892-1-stanley_chang@realtek.com Signed-off-by: Greg Kroah-Hartman commit 6c29de68fb2955463d6b4115364ca78fcb0275bd Author: Utkarsh Patel Date: Tue Sep 19 19:32:43 2023 -0700 usb: typec: intel_pmc_mux: Configure Displayport Alternate mode 2.1 Mux agent driver can configure cable details such as cable type and cable speed received as a part of displayport configuration to support Displayport Alternate mode 2.1. Reviewed-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Signed-off-by: Utkarsh Patel Link: https://lore.kernel.org/r/20230920023243.2494410-6-utkarsh.h.patel@intel.com Signed-off-by: Greg Kroah-Hartman commit 70ca6c7312c5ec5bd8a3656c9df8b2c90d04bdc5 Author: Utkarsh Patel Date: Tue Sep 19 19:32:42 2023 -0700 platform/chrome: cros_ec_typec: Add Displayport Alternatemode 2.1 Support Displayport Alternatemode 2.1 requires cable capabilities such as cable signalling, cable type, DPAM version which then will be used by mux driver for displayport configuration. These capabilities can be derived from the Cable VDO. Acked-by: Prashant Malani Signed-off-by: Utkarsh Patel Link: https://lore.kernel.org/r/20230920023243.2494410-5-utkarsh.h.patel@intel.com Signed-off-by: Greg Kroah-Hartman commit f9ee6043283a78c84adf6ef3cef7a085eee4130f Author: Utkarsh Patel Date: Tue Sep 19 19:32:41 2023 -0700 usb: pd: Add helper macro to get Type C cable speed Added a helper macro to get the Type C cable speed when provided the cable VDO. Reviewed-by: Heikki Krogerus Signed-off-by: Utkarsh Patel Link: https://lore.kernel.org/r/20230920023243.2494410-4-utkarsh.h.patel@intel.com Signed-off-by: Greg Kroah-Hartman commit c365b1e1f40499472433cc8fca3d0ea280ead52a Author: Utkarsh Patel Date: Tue Sep 19 19:32:40 2023 -0700 usb: typec: Add Active or Passive cable defination to cable discover mode VDO As per USB Type-C Connector specification v2.2 section F.2.6, BIT25 represents Active or Passive cable. Added BIT25 defination to the Thunderbolt 3 cable discover mode VDO. Reviewed-by: Heikki Krogerus Signed-off-by: Utkarsh Patel Link: https://lore.kernel.org/r/20230920023243.2494410-3-utkarsh.h.patel@intel.com Signed-off-by: Greg Kroah-Hartman commit a17fae8fc38e91026f116a85c5068668fbf9848a Author: Utkarsh Patel Date: Tue Sep 19 19:32:39 2023 -0700 usb: typec: Add Displayport Alternate Mode 2.1 Support Displayport Alternate mode 2.1 requires configuration for additional cable details such as signalling for cable, UHBR13.5 Support, Cable type and DPAM version. These details can be used with mux drivers to configure SOP DP configuration for Displayport Alternate mode 2.1. This change also includes pertinent cable signalling support in displayport alternate mode. Reviewed-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Signed-off-by: Utkarsh Patel Link: https://lore.kernel.org/r/20230920023243.2494410-2-utkarsh.h.patel@intel.com Signed-off-by: Greg Kroah-Hartman commit bb00788bd62778ef80a97d67a0e3c569ac6be06f Author: Michael Grzeschik Date: Mon Sep 11 16:05:30 2023 +0200 usb: gadget: uvc: rework pump worker to avoid while loop The uvc_video_enable function is calling cancel_work_sync which will be blocking as long as new requests will be queued with the while loop. To ensure an earlier stop in the pumping loop in this particular case we rework the worker to requeue itself on every requests. Since the worker is already running prioritized, the scheduling overhad did not have real impact on the performance. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20230911140530.2995138-4-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 52a39f2cf62bb5430ad1f54cd522dbfdab1d71ba Author: Michael Grzeschik Date: Mon Sep 11 16:05:29 2023 +0200 usb: gadget: uvc: cleanup request when not in correct state The uvc_video_enable function of the uvc-gadget driver is dequeing and immediately deallocs all requests on its disable codepath. This is not save since the dequeue function is async and does not ensure that the requests are left unlinked in the controller driver. By adding the ep_free_request into the completion path of the requests we ensure that the request will be properly deallocated. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20230911140530.2995138-3-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 3a63f86c6a6cb0601f0563a81574745da2979e3b Author: Michael Grzeschik Date: Mon Sep 11 16:05:28 2023 +0200 usb: gadget: uvc: stop pump thread on video disable Since the uvc-video gadget driver is using the v4l2 interface, the streamon and streamoff can be triggered at any times. To ensure that the pump worker will be closed as soon the userspace is calling streamoff we synchronize the state of the gadget ensuring the pump worker to bail out. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20230911140530.2995138-2-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 0ea39e030a80be2b1b5f98d6b330a8b97dcf3342 Author: Krishna Kurapati Date: Wed Sep 27 13:00:27 2023 +0530 usb: gadget: udc: Handle gadget_connect failure during bind operation In the event gadget_connect call (which invokes pullup) fails, propagate the error to udc bind operation which in turn sends the error to configfs. The userspace can then retry enumeration if it chooses to. Signed-off-by: Krishna Kurapati Reviewed-by: Alan Stern Link: https://lore.kernel.org/r/20230927073027.27952-1-quic_kriskura@quicinc.com Signed-off-by: Greg Kroah-Hartman commit ef307bc6ef04e8c1ea843231db58e3afaafa9fa6 Author: Jia-Ju Bai Date: Tue Sep 26 10:44:04 2023 +0800 usb: dwc2: fix possible NULL pointer dereference caused by driver concurrency In _dwc2_hcd_urb_enqueue(), "urb->hcpriv = NULL" is executed without holding the lock "hsotg->lock". In _dwc2_hcd_urb_dequeue(): spin_lock_irqsave(&hsotg->lock, flags); ... if (!urb->hcpriv) { dev_dbg(hsotg->dev, "## urb->hcpriv is NULL ##\n"); goto out; } rc = dwc2_hcd_urb_dequeue(hsotg, urb->hcpriv); // Use urb->hcpriv ... out: spin_unlock_irqrestore(&hsotg->lock, flags); When _dwc2_hcd_urb_enqueue() and _dwc2_hcd_urb_dequeue() are concurrently executed, the NULL check of "urb->hcpriv" can be executed before "urb->hcpriv = NULL". After urb->hcpriv is NULL, it can be used in the function call to dwc2_hcd_urb_dequeue(), which can cause a NULL pointer dereference. This possible bug is found by an experimental static analysis tool developed by myself. This tool analyzes the locking APIs to extract function pairs that can be concurrently executed, and then analyzes the instructions in the paired functions to identify possible concurrency bugs including data races and atomicity violations. The above possible bug is reported, when my tool analyzes the source code of Linux 6.5. To fix this possible bug, "urb->hcpriv = NULL" should be executed with holding the lock "hsotg->lock". After using this patch, my tool never reports the possible bug, with the kernelconfiguration allyesconfig for x86_64. Because I have no associated hardware, I cannot test the patch in runtime testing, and just verify it according to the code logic. Fixes: 33ad261aa62b ("usb: dwc2: host: spinlock urb_enqueue") Signed-off-by: Jia-Ju Bai Link: https://lore.kernel.org/r/20230926024404.832096-1-baijiaju@buaa.edu.cn Signed-off-by: Greg Kroah-Hartman commit a60359ea32251399c00d934981f5a6fa25ec917f Author: Wolfram Sang Date: Fri Sep 22 08:45:51 2023 +0200 usb: renesas_usbhs: remove boilerplate from header file There is a SPDX entry, so we can remove the boilerplate. Signed-off-by: Wolfram Sang Reviewed-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230922064551.4663-1-wsa+renesas@sang-engineering.com Signed-off-by: Greg Kroah-Hartman commit cc07fc805590f59e54c6c2d98a40504773fe15b5 Author: Wolfram Sang Date: Fri Sep 22 10:04:18 2023 +0200 usb: typec: drop check because i2c_unregister_device() is NULL safe No need to check the argument of i2c_unregister_device() because the function itself does it. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Acked-by: Heikki Krogerus Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/20230922080421.35145-2-wsa+renesas@sang-engineering.com Signed-off-by: Greg Kroah-Hartman commit f782152b2560e6a772a5c2f4022c70bb100cdcc3 Author: Biju Das Date: Wed Sep 6 09:06:19 2023 +0100 usb: typec: tcpci_rt1711h: Drop CONFIG_OF ifdeffery Drop of_match_ptr() from rt1711h_of_match and get rid of ugly CONFIG_OF ifdeffery. This slightly increases the size of rt1711h_of_match on non-OF system and shouldn't be an issue. It also allows, in case if needed, to enumerate this device via ACPI with PRP0001 magic. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230906080619.36930-6-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 15ebb02abde80c2e1567b605251dd2052d2b792c Author: Biju Das Date: Wed Sep 6 09:06:18 2023 +0100 usb: typec: tcpci_rt1711h: Add enable_pd30_extended_message variable to struct rt1711h_chip_info The RT1715 has PD30 extended message compared to RT1711H. Add a variable enable_pd30_extended_message to struct rt1711h_chip_info to enable this feature for RT1715. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230906080619.36930-5-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 0f9df9662097c1ea3a9aa20aad5a818e6532de19 Author: Biju Das Date: Wed Sep 6 09:06:17 2023 +0100 usb: typec: tcpci_rt1711h: Add rxdz_sel variable to struct rt1711h_chip_info The RT1715 needs 0.35V/0.75V rx threshold for rd/rp whereas it is 0.4V/0.7V for RT1711H. Add rxdz_sel variable to struct rt1711h_chip_info for handling this difference. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230906080619.36930-4-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit e2d514dffcb583977150a6bee9d39aeb393ee8d9 Author: Biju Das Date: Wed Sep 6 09:06:16 2023 +0100 usb: typec: tcpci_rt1711h: Convert enum->pointer for data in the match tables Currently did varaible is used for HW differences between the devices which complicates the code by adding checks. Therefore it is better to convert enum->pointer for data match and extend match support for both ID and OF tables by using i2c_get_match_data(). Add struct rt1711h_chip_info with did variable and replace did->info in struct rt1711h_chip. Later patch will add more hw differences to struct rt1711h_chip_info and avoid checking did for HW differences. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230906080619.36930-3-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 343a9d34a74359dba67c10e394dbd68c621fa657 Author: Biju Das Date: Wed Sep 6 09:06:15 2023 +0100 usb: typec: tcpci_rt1711h: Remove trailing comma in the terminator entry for OF table Remove trailing comma in the terminator entry for OF table. While at it, drop a space in the terminator for ID table. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Reviewed-by: Heikki Krogerus Link: https://lore.kernel.org/r/20230906080619.36930-2-biju.das.jz@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 60958b3abacc4eeea21236aa61bfacd1c3520168 Author: Krishna Kurapati Date: Mon Aug 28 19:00:23 2023 +0530 usb: xhci: Move extcaps related macros to respective header file DWC3 driver needs access to XHCI Extended Capabilities registers to read number of usb2 ports and usb3 ports present on multiport controller. Since the extcaps header is sufficient to parse this info, move port_count related macros and structure from xhci.h to xhci-ext-caps.h. Signed-off-by: Krishna Kurapati Link: https://lore.kernel.org/r/20230828133033.11988-4-quic_kriskura@quicinc.com Acked-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit eb3f1d9e42b1499152442e97b51bc1bcfee29d71 Author: Krishna Kurapati Date: Mon Aug 28 19:00:22 2023 +0530 dt-bindings: usb: Add bindings for multiport properties on DWC3 controller Add bindings to indicate properties required to support multiport on Synopsys DWC3 controller. Suggested-by: Bjorn Andersson Signed-off-by: Krishna Kurapati Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230828133033.11988-3-quic_kriskura@quicinc.com Signed-off-by: Greg Kroah-Hartman commit ca58c4ae75b65e1d78408b134f129ea91e9595b8 Author: Krishna Kurapati Date: Mon Aug 28 19:00:21 2023 +0530 dt-bindings: usb: qcom,dwc3: Add bindings for SC8280 Multiport Add the compatible string for SC8280 Multiport USB controller from Qualcomm. There are 4 power event irq interrupts supported by this controller (one for each port of multiport). Added all the 4 as non-optional interrupts for SC8280XP-MP Also each port of multiport has one DP and oen DM IRQ. Add all DP/DM IRQ's related to 4 ports of SC8280XP Teritiary controller. Also added ss phy irq for both SS Ports. Signed-off-by: Krishna Kurapati Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230828133033.11988-2-quic_kriskura@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 8929f62f1d7a45d109cd747cdeb60f3eae1c0717 Author: Uday M Bhat Date: Wed Sep 6 12:57:17 2023 +0530 usb: typec: intel_pmc_mux: enable sysfs usb role access The OS, such as ChromeOS, uses Android Runtime to run Android applications. This necessitates supporting tools, for example, Android Debugger (ADB). On host to host setup xHC.DbC shall support ADB with USB. This requires user space to control USB roles. Enable user space control to modify the USB Type-C role. At run time it will create a role attribute in /sys/class/usb_role//. Attribute can be modified based on the values suggested in the Documentation/ABI/testing/sysfs-class-usb_role. Reviewed-by: Andy Shevchenko Signed-off-by: Uday M Bhat Link: https://lore.kernel.org/r/20230906072717.32485-1-uday.m.bhat@intel.com Signed-off-by: Greg Kroah-Hartman commit 2f07592c30e1db498fe198a80e9d36f9d7cce441 Author: Grant B Adams Date: Wed Aug 23 10:54:30 2023 +0200 usb: musb: dsps: Fix vbus vs tps65217-charger irq conflict Enabling the tps65217-charger driver/module causes an interrupt conflict with the vbus driver resulting in a probe failure. The conflict is resolved by changing both driver's threaded interrupt request function from IRQF_ONESHOT to IRQF_SHARED. Signed-off-by: Grant B Adams Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230823085430.6610-3-nemith592@gmail.com Signed-off-by: Greg Kroah-Hartman commit ea17be9d16f4422ba4e80e42cc54b0149fcf09ae Author: Grant B Adams Date: Wed Aug 23 10:54:29 2023 +0200 power: supply: Fix tps65217-charger vs vbus irq conflict Enabling the tps65217-charger driver/module causes an interrupt conflict with the vbus driver resulting in a probe failure. The conflict is resolved by changing both driver's threaded interrupt request function from IRQF_ONESHOT to IRQF_SHARED. Signed-off-by: Grant B Adams Reviewed-by: Tony Lindgren Link: https://lore.kernel.org/r/20230823085430.6610-2-nemith592@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3865a64284cc4845c61cf3dc6c7246349d80cc49 Author: Nitheesh Sekar Date: Thu Aug 31 08:35:03 2023 +0530 dt-bindings: usb: dwc3: Add IPQ5018 compatible Document the IPQ5018 dwc3 compatible. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Nitheesh Sekar Link: https://lore.kernel.org/r/20230831030503.17100-1-quic_nsekar@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 964168970cef5f5b738fae047e6de2107842feb7 Author: Kees Cook Date: Fri Sep 29 11:04:30 2023 -0700 IB/hfi1: Annotate struct tid_rb_node with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct tid_rb_node. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Dennis Dalessandro Cc: Jason Gunthorpe Cc: Leon Romanovsky Cc: linux-rdma@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230929180431.3005464-7-keescook@chromium.org Signed-off-by: Leon Romanovsky commit 2aba54a9e0ead531f7fd35f312239788a435a4f5 Author: Kees Cook Date: Fri Sep 29 11:04:29 2023 -0700 IB/mthca: Annotate struct mthca_icm_table with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mthca_icm_table. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Jason Gunthorpe Cc: Leon Romanovsky Cc: linux-rdma@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230929180431.3005464-6-keescook@chromium.org Signed-off-by: Leon Romanovsky commit bd8eec5bfa59b59bc6e6abcfee9cae1a68769e89 Author: Kees Cook Date: Fri Sep 29 11:04:28 2023 -0700 IB/srp: Annotate struct srp_fr_pool with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct srp_fr_pool. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Bart Van Assche Cc: Jason Gunthorpe Cc: Leon Romanovsky Cc: linux-rdma@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230929180431.3005464-5-keescook@chromium.org Signed-off-by: Leon Romanovsky commit 0bc018b7a7b73357d57f0f48289557a347bd1be8 Author: Kees Cook Date: Fri Sep 29 11:04:27 2023 -0700 RDMA/siw: Annotate struct siw_pbl with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct siw_pbl. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Bernard Metzler Cc: Jason Gunthorpe Cc: Leon Romanovsky Cc: linux-rdma@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230929180431.3005464-4-keescook@chromium.org Signed-off-by: Leon Romanovsky commit ed7c64de622ff9fd34c5e306a90f2462a156cbe6 Author: Kees Cook Date: Fri Sep 29 11:04:26 2023 -0700 RDMA/usnic: Annotate struct usnic_uiom_chunk with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct usnic_uiom_chunk. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Christian Benvenuti Cc: Nelson Escobar Cc: Jason Gunthorpe Cc: Leon Romanovsky Cc: linux-rdma@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230929180431.3005464-3-keescook@chromium.org Signed-off-by: Leon Romanovsky commit fc424078f50840a6610bfdd860cb0c515fe33398 Author: Kees Cook Date: Fri Sep 29 11:04:25 2023 -0700 RDMA/core: Annotate struct ib_pkey_cache with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ib_pkey_cache. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Jason Gunthorpe Cc: Leon Romanovsky Cc: "Håkon Bugge" Cc: Avihai Horon Cc: Anand Khoje Cc: Mark Bloch Cc: linux-rdma@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230929180431.3005464-2-keescook@chromium.org Signed-off-by: Leon Romanovsky commit 4755dc6f29597d9f52fe69e8230e145680e30f8d Author: Kees Cook Date: Fri Sep 29 11:04:24 2023 -0700 RDMA: Annotate struct rdma_hw_stats with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct rdma_hw_stats. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Jason Gunthorpe Cc: Leon Romanovsky Cc: linux-rdma@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230929180431.3005464-1-keescook@chromium.org Signed-off-by: Leon Romanovsky commit d424348b060d87f92cc59d8e6ea9c612c5b708f5 Author: Dragos Tatulea Date: Thu Sep 28 19:45:12 2023 +0300 vdpa/mlx5: Expose descriptor group mkey hw capability Necessary for improved live migration flow. Actual support will be added in a downstream patch. Reviewed-by: Gal Pressman Signed-off-by: Dragos Tatulea Link: https://lore.kernel.org/r/20230928164550.980832-3-dtatulea@nvidia.com Signed-off-by: Leon Romanovsky commit 90f055df112162fd9e093c16be1c21f38c35b907 Author: Vlastimil Babka Date: Fri Sep 8 12:18:09 2023 +0200 mm/slub: refactor calculate_order() and calc_slab_order() After the previous cleanups, we can now move some code from calc_slab_order() to calculate_order() so it's executed just once, and do some more cleanups. - move the min_order and MAX_OBJS_PER_PAGE evaluation to calculate_order(). - change calc_slab_order() parameter min_objects to min_order Also make MAX_OBJS_PER_PAGE check more robust by considering also min_objects in addition to slub_min_order. Otherwise this is not a functional change. Signed-off-by: Vlastimil Babka Reviewed-by: Feng Tang Reviewed-and-tested-by: Jay Patel commit 5886fc82b6e3166dd1ba876809888fc39028d626 Author: Vlastimil Babka Date: Fri Sep 8 11:47:09 2023 +0200 mm/slub: attempt to find layouts up to 1/2 waste in calculate_order() The main loop in calculate_order() currently tries to find an order with at most 1/4 waste. If that's impossible (for particular large object sizes), there's a fallback that will try to place one object within slab_max_order. If we expand the loop boundary to also allow up to 1/2 waste as the last resort, we can remove the fallback and simplify the code, as the loop will find an order for such sizes as well. Note we don't need to allow more than 1/2 waste as that will never happen - calc_slab_order() would calculate more objects to fit, reducing waste below 1/2. Successfully finding an order in the loop (compared to the fallback) will also have the benefit in trying to satisfy min_objects, because the fallback was passing 1. Thus the resulting slab orders might be larger (not because it would improve waste, but to reduce pressure on shared locks), which is one of the goals of calculate_order(). For example, with nr_cpus=1 and 4kB PAGE_SIZE, slub_max_order=3, before the patch we would get the following orders for these object sizes: 2056 to 10920 - order-3 as selected by the loop 10928 to 12280 - order-2 due to fallback, as <1/4 waste is not possible 12288 to 32768 - order-3 as <1/4 waste is again possible After the patch: 2056 to 32768 - order-3, because even in the range of 10928 to 12280 we try to satisfy the calculated min_objects. As a result the code is simpler and gives more consistent results. Signed-off-by: Vlastimil Babka Reviewed-by: Feng Tang Reviewed-and-tested-by: Jay Patel commit 0fe2735d5e2e00601339aab3658e05f3707a1745 Author: Vlastimil Babka Date: Fri Sep 8 10:53:26 2023 +0200 mm/slub: remove min_objects loop from calculate_order() calculate_order() currently has two nested loops. The inner one that gradually modifies the acceptable waste from 1/16 up to 1/4, and the outer one that decreases min_objects down to 2. Upon closer inspection, the outer loop is unnecessary. Decreasing min_objects could have in theory two effects to make the inner loop and its call to calc_slab_order() succeed where a previous iteration with higher min_objects would not: - it could cause the min_objects-derived min_order to fit within slub_max_order. But min_objects is already pre-capped to max_objects that's derived from slub_max_order above the loops, so every iteration tries at least slub_max_order in calc_slab_order() - it could cause calc_slab_order() to be called with lower min_objects thus potentially lower min_order in its loop. This would make a difference if the lower order could cause the fractional waste test to succeed where a higher order has already failed with same fract_leftover in the previous iteration with a higher min_order. But that's not possible, because increasing the order can only result in lower (or same) fractional waste. If we increase the slab size 2 times, we will fit at least 2 times the number of objects (thus same fraction of waste), or it will allow us to fit one more object (lower fraction of waste). For more confidence I have tried adding a printk to notify when decreasing min_objects resulted in a success, and simulated calculations for a range of object sizes, nr_cpus and page_sizes. As expected, the printk never triggered. Thus remove the outer loop and adjust comments accordingly. There's almost no functional change except a weird corner case when slub_min_objects=1 on boot command line would cause the whole two nested loops to be skipped before this patch. Now it would try to find the best layout as usual, resulting in potentially higher orderthat minimizes waste. This is not wrong and will be further expanded by the next patch. Signed-off-by: Vlastimil Babka Reviewed-by: Feng Tang Reviewed-and-tested-by: Jay Patel commit c7355d755698a01ff4187a0d2f6ad21ba233dc21 Author: Vlastimil Babka Date: Fri Sep 8 09:57:13 2023 +0200 mm/slub: simplify the last resort slab order calculation If calculate_order() can't fit even a single large object within slub_max_order, it will try using the smallest necessary order that may exceed slub_max_order but not MAX_ORDER. Currently this is done with a call to calc_slab_order() which is unnecessary. We can simply use get_order(size). No functional change. Signed-off-by: Vlastimil Babka Reviewed-by: Feng Tang Reviewed-and-tested-by: Jay Patel commit e519ce7a26b4c877d834e4234e8d24478448c0d3 Author: Feng Tang Date: Wed Sep 20 15:44:13 2023 +0800 mm/slub: add sanity check for slub_min/max_order cmdline setup Currently there are 2 parameters could be setup from kernel cmdline: slub_min_order and slub_max_order. It's possible that the user configured slub_min_order is bigger than the default slub_max_order [1], which can still take effect, as calculate_oder() will use MAX_ORDER as a fallback to check against, but has some downsides: * the kernel message about SLUB will be strange in showing min/max orders: SLUB: HWalign=64, Order=9-3, MinObjects=0, CPUs=16, Nodes=1 * in calculate_order() called by each slab, the 2 loops of calc_slab_order() will all be meaningless due to slub_min_order is bigger than slub_max_order * prevent future code cleanup like in [2]. Fix it by adding some sanity check to enforce the min/max semantics. [1]. https://lore.kernel.org/lkml/21a0ba8b-bf05-0799-7c78-2a35f8c8d52a@os.amperecomputing.com/ [2]. https://lore.kernel.org/lkml/20230908145302.30320-7-vbabka@suse.cz/ Signed-off-by: Feng Tang Signed-off-by: Vlastimil Babka commit d9d5829d457f1fe72f42cc813008eb7a8f789c47 Author: Bartosz Golaszewski Date: Thu Sep 28 11:34:37 2023 +0200 gpio: sim: add missing include We use size_t, ssize_t, bool and some other types defined in linux/types.h so include it in the driver. Signed-off-by: Bartosz Golaszewski commit db0f246c39be6971cdaa2b9326f7cb6cdfd8f11b Author: André Almeida Date: Fri Sep 29 11:25:09 2023 +0200 drm/doc: Document DRM device reset expectations Create a section that specifies how to deal with DRM device resets for kernel and userspace drivers. Signed-off-by: André Almeida Acked-by: Pekka Paalanen Acked-by: Sebastian Wick Reviewed-by: Christian König Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230929092509.42042-1-andrealmeid@igalia.com commit c9aa36faddaf73ee6d8dcc2dc5b36b6a3a2bebd5 Merge: f4dcf06bc6e01 2ce3262553c69 Author: Rafael J. Wysocki Date: Mon Oct 2 10:59:07 2023 +0200 Merge back new ACPI backlight material for v6.7. commit c9813b0b9992eab01a47ad8d10f0add13f898692 Author: Yangyang Li Date: Tue Sep 26 21:00:26 2023 +0800 RDMA/hns: Support SRQ record doorbell Compared with normal doorbell, using record doorbell can shorten the process of ringing the doorbell and reduce the latency. Add a flag HNS_ROCE_CAP_FLAG_SRQ_RECORD_DB to allow FW to enable/disable SRQ record doorbell. If the flag above is set, allocate the dma buffer for SRQ record doorbell and write the buffer address into SRQC during SRQ creation. For userspace SRQ, add a flag HNS_ROCE_RSP_SRQ_CAP_RECORD_DB to notify userspace whether the SRQ record doorbell is enabled. Signed-off-by: Yangyang Li Signed-off-by: Junxian Huang Link: https://lore.kernel.org/r/20230926130026.583088-1-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit 82f9378c443c206d3f9e45844306e5270e7e4109 Author: Patrisious Haddad Date: Thu Sep 21 15:10:35 2023 +0300 net/mlx5: Handle IPsec steering upon master unbind/bind When the master device is unbinded, make sure to clean up all of the steering rules or flow tables that were created over the master, in order to allow proper unbinding of master, and for ethernet traffic to continue to work independently. Upon bringing master device back up and attaching the slave to it, checks if the slave already has IPsec configured and if so reconfigure the rules needed to support RoCE traffic. Note that while master device is unbound, the user is unable to configure IPsec again, since they are in a kind of illegal state in which they are in MPV mode but the slave has no master. However if IPsec was configured before hand, it will continue to work for ethernet traffic while master is unbound, and would continue to work for all traffic when the master is bound back again. Signed-off-by: Patrisious Haddad Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/8434e88912c588affe51b34669900382a132e873.1695296682.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit f2f0231cfe8905af217e5bf1a08bfb8e4d3b74fb Author: Patrisious Haddad Date: Thu Sep 21 15:10:34 2023 +0300 net/mlx5: Configure IPsec steering for ingress RoCEv2 MPV traffic Add empty flow table in RDMA_RX master domain, to forward all received traffic to it, in order to continue through the FW RoCE steering. In order to achieve that however, first we check if the decrypted traffic is RoCEv2, if so then forward it to RDMA_RX domain. But in case the traffic is coming from the slave, have to first send the traffic to an alias table in order to switch gvmi and from there we can go to the appropriate gvmi flow table in RDMA_RX master domain. Signed-off-by: Patrisious Haddad Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/d2200b53158b1e7ef30996812107dd7207485c28.1695296682.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit dfbd229abeee76a0bcf015e93c85dca8d18568d4 Author: Patrisious Haddad Date: Thu Sep 21 15:10:33 2023 +0300 net/mlx5: Configure IPsec steering for egress RoCEv2 MPV traffic Add steering tables/rules in RDMA_TX master domain, to forward all traffic to IPsec crypto table in NIC domain. But in case the traffic is coming from the slave, have to first send the traffic to an alias table in order to switch gvmi and from there we can go to the appropriate gvmi crypto table in NIC domain. Signed-off-by: Patrisious Haddad Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/7ca5cf1ac5c6979359b8726e97510574e2b3d44d.1695296682.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit 69c08efcbe7fa87ec89f28e0eed0c8c1deedfd83 Author: Patrisious Haddad Date: Thu Sep 21 15:10:32 2023 +0300 net/mlx5: Add create alias flow table function to ipsec roce Implements functions which creates an alias flow table, and check if alias flow table creation is even supported, and if successful returns the created alias flow table object id. This function would be used in later patches to allow jumping from one vhca to another, in order to add support for MPV mode. Signed-off-by: Patrisious Haddad Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/36e15ef41586f2a9aacc65b935de18391eef5607.1695296682.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit 8c894f88c479e4b059464aee45a42ab72023b0c3 Author: Patrisious Haddad Date: Thu Sep 21 15:10:31 2023 +0300 net/mlx5: Implement alias object allow and create functions Add functions which allow one vhca to access another vhca object, and functions that creates an alias object or destroys it. Together they can be used to create cross vhca flow table that is able jump from the steering domain that is managed by one vport, to the steering domain on a different vport. Signed-off-by: Patrisious Haddad Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/f45a9c85319fa783186b8988abcd64955b5f2a0c.1695296682.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit ef36ffcb381096ed32c309c342a02bf62939c503 Author: Patrisious Haddad Date: Thu Sep 21 15:10:30 2023 +0300 net/mlx5: Add alias flow table bits Add all the capabilities needed to check for alias object support. As well as all the fields or commands needed for its creation and the creation of flow table that is able to jump to an alias object. Signed-off-by: Patrisious Haddad Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/544c030f2a78c4adf3fe6b64f97a39cc1bbdabb9.1695296682.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit eff5b663a6c3047ebf75ce520d3b3eaccd9fc957 Author: Patrisious Haddad Date: Thu Sep 21 15:10:29 2023 +0300 net/mlx5: Store devcom pointer inside IPsec RoCE Store the mlx5e priv devcom component within IPsec RoCE to enable the IPsec RoCE code to access the other device's private information. This includes retrieving the necessary device information and the IPsec database, which helps determine if IPsec is configured or not. Signed-off-by: Patrisious Haddad Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/5bb3160ceeb07523542302886da54c78eef0d2af.1695296682.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit bf11485f8419f90ffaa3804fd01d8468fcc56e23 Author: Patrisious Haddad Date: Thu Sep 21 15:10:28 2023 +0300 net/mlx5: Register mlx5e priv to devcom in MPV mode If the device is in MPV mode, the ethernet driver would now register to events from IB driver about core devices affiliation or de-affiliation. Use the key provided in said event to connect each mlx5e priv instance to it's master counterpart, this way the ethernet driver is now aware of who is his master core device and even more, such as knowing if partner device has IPsec configured or not. Signed-off-by: Patrisious Haddad Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/279adfa0aa3a1957a339086f2c1739a50b8e4b68.1695296682.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit 0d293714ac32650bfb669ceadf7cc2fad8161401 Author: Patrisious Haddad Date: Thu Sep 21 15:10:27 2023 +0300 RDMA/mlx5: Send events from IB driver about device affiliation state Send blocking events from IB driver whenever the device is done being affiliated or if it is removed from an affiliation. This is useful since now the EN driver can register to those event and know when a device is affiliated or not. Signed-off-by: Patrisious Haddad Reviewed-by: Mark Bloch Link: https://lore.kernel.org/r/a7491c3e483cfd8d962f5f75b9a25f253043384a.1695296682.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit 1c0b3cbe7fd98f54fb447e74119216f550a045b9 Merge: e8b4ff6a856d0 c385256611b1a Author: Linus Walleij Date: Mon Oct 2 09:49:47 2023 +0200 Merge tag 'renesas-pinctrl-for-v6.7-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v6.7 - Miscellaneous fixes and improvements. commit 3bb5c9ddf46bf35bd86293cf77f1d88689689fc2 Author: Linus Walleij Date: Tue Sep 26 23:48:11 2023 +0200 gpiolib: of: Allow "trigger-sources" to reference a GPIO The "trigger-sources" phandle used for LED triggers are special: the DT bindings mandate that such triggers have the same phandle references no matter what the trigger is. A GPIO is just another kind of device that can trigger a LED. Signed-off-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 988d0ff29ecf7ab750b9be29fddae588156c3d03 Author: Konrad Dybcio Date: Fri Sep 29 14:54:21 2023 +0200 drm/panel: Add driver for BOE RM692E5 AMOLED panel Add support for the 2700x1224 AMOLED BOE panel bundled with a RM692E5 driver IC, as found on the Fairphone 5 smartphone. Co-developed-by: Luca Weiss Signed-off-by: Luca Weiss Signed-off-by: Konrad Dybcio Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230927-topic-fp5_disp-v2-2-7b5e1d1662a6@linaro.org commit d1fd19e6bd7d276cf2290300cc563e2e5ac4ebf7 Author: Konrad Dybcio Date: Fri Sep 29 14:54:20 2023 +0200 dt-bindings: display: panel: Add Raydium RM692E5 Raydium RM692E5 is a display driver IC used to drive AMOLED DSI panels. Describe it. Reviewed-by: Conor Dooley Signed-off-by: Konrad Dybcio Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230927-topic-fp5_disp-v2-1-7b5e1d1662a6@linaro.org commit 800c1ff7d1b12b6309eb877542367b94f376acbc Author: Mark Brown Date: Sun Oct 1 11:24:14 2023 +0100 drm/panel: ili9322: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231001-drm-sn65dsi83-maple-v1-2-5519799a55e5@kernel.org commit c8c575ebf6daaf1fbe029cc04c845e2fad462320 Author: Mark Brown Date: Sun Oct 1 11:24:13 2023 +0100 drm/panel: ili9322: Remove redundant volatle_reg() operation The ili9322 driver has a volatile_reg() operation in it's regmap which always returns false. This is redundant since it is the default in the regmap core, remove the operation for a trivial code size and performance improvement. Signed-off-by: Mark Brown Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231001-drm-sn65dsi83-maple-v1-1-5519799a55e5@kernel.org commit 0908a0225d0fa6d7675bf3c2cc4c25a89e13e83c Author: Mark Brown Date: Sun Oct 1 11:26:22 2023 +0100 drm/bridge: sn65dsi83: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231001-drm-sn65dsi83-maple-v1-1-cf8ad22b6be0@kernel.org commit eae0cfcce3cd10a9189bf46934de9bde7ad7b2d0 Author: Mark Brown Date: Sun Oct 1 11:24:49 2023 +0100 drm/bridge: lt9211: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231001-drm-lt9211-maple-v1-1-1cf74fb10991@kernel.org commit fb6f4f47dd4a71a0394d346eda7589dd9397c4bc Author: Mark Brown Date: Sun Oct 1 00:46:38 2023 +0100 drm/bridge: icn6211: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231001-drm-chipone-maple-v1-1-fb3ce5a53710@kernel.org commit 4dd9368671fb7649dc914e661256a07250c271ca Author: Mark Brown Date: Sun Oct 1 01:43:13 2023 +0200 drm/bridge: tc358767: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231001-drm-tc358767-maple-v1-1-f759fcc4bd98@kernel.org commit 9a9f6fb5205a6cb189147bca1264311c4bf45163 Author: Mark Brown Date: Sun Oct 1 01:42:24 2023 +0200 drm/bridge: dpc3433: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20231001-drm-dlpc3433-maple-v1-1-7d71170c010b@kernel.org commit 86c3331c8089ac1cf231825f406c4bf8afd9f3a2 Author: Mark Brown Date: Fri Sep 29 14:54:19 2023 +0200 drm/bridge: adv7511: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Reviewed-by: Laurent Pinchart Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230929-drm-adv7511-v1-1-b871b28ee594@kernel.org commit 436e5f758d6fbc2c5903d59f2cf9bb753ec77d9e Merge: fbff653a40f6a 1f73286371c27 Author: David S. Miller Date: Mon Oct 2 08:07:13 2023 +0100 Merge branch 'mlxsw-next' Petr Machata says: ==================== mlxsw: Provide enhancements and new feature Vadim Pasternak writes: Patch #1 - Optimize transaction size for efficient retrieval of module data. Patch #3 - Enable thermal zone binding with new cooling device. Patch #4 - Employ standard macros for dividing buffer into the chunks. ==================== Signed-off-by: David S. Miller commit 1f73286371c27cca0fd0094962e480e2b9ef3809 Author: Vadim Pasternak Date: Fri Sep 22 19:18:38 2023 +0200 mlxsw: i2c: Utilize standard macros for dividing buffer into chunks Use standard macro DIV_ROUND_UP() to determine the number of chunks required for a given buffer. Signed-off-by: Vadim Pasternak Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 7afc79e20e22dc3ca552a75665b51b5a93e29632 Author: Vadim Pasternak Date: Fri Sep 22 19:18:37 2023 +0200 mlxsw: core: Extend allowed list of external cooling devices for thermal zone binding Extend the list of allowed external cooling devices for thermal zone binding to include devices of type "emc2305". The motivation is to provide support for the system SN2201, which is equipped with the Spectrum-1 ASIC. The system's airflow control is managed by the EMC2305 RPM-based PWM Fan Speed Controller as the cooling device. Signed-off-by: Vadim Pasternak Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit c755655c3d8b2a4afe9610ec58a41c08d62c8ec0 Author: Vadim Pasternak Date: Fri Sep 22 19:18:36 2023 +0200 mlxsw: reg: Limit MTBR register payload to a single data record The MTBR register is used to read temperatures from multiple sensors in one transaction, but the driver only reads from a single sensor in each transaction. Rrestrict the payload size of the MTBR register to prevent the transmission of redundant data to the firmware. Signed-off-by: Vadim Pasternak Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 1e3dbe8006247386592a2fdce3a52cca15625997 Author: Alexey Romanov Date: Fri Sep 29 13:29:38 2023 +0300 arm64: dts: meson-s4: add hwrng node Using this node, we can obtain random numbers via hardware random number generator. Signed-off-by: Alexey Romanov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230929102942.67985-4-avromanov@salutedevices.com [narmstrong: fixed commit message] Signed-off-by: Neil Armstrong commit 46d0825104b8e62ea5b3f0f749e656ecfdcc20da Author: Mark Brown Date: Fri Sep 29 16:11:24 2023 +0200 gpio: fx6408: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit bad66884acb55e2419b8fdc56ae902d3bfc0c2e3 Author: Mark Brown Date: Fri Sep 29 14:24:13 2023 +0200 gpio: pca953x: Convert to use maple tree register cache The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Mark Brown Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 7d099290486bd0a86d5e5ccf8e19dbdef95e5400 Author: Uwe Kleine-König Date: Thu Sep 28 09:07:00 2023 +0200 gpio: tb10x: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 8c75532803a3ae1ecaae4d6a1198d6c8cb2bb8ba Author: Uwe Kleine-König Date: Thu Sep 28 09:07:06 2023 +0200 gpio: zynq: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 4f7b5eed4f2231248a168d9fdf24a1b72cdf84fb Author: Uwe Kleine-König Date: Thu Sep 28 09:07:05 2023 +0200 gpio: xilinx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Shubhrajyoti Datta Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 302fbb0ef9f2301172369f9ccdaaf53e80b588b5 Author: Uwe Kleine-König Date: Thu Sep 28 09:07:04 2023 +0200 gpio: xgs-iproc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit a98ac19b165735997c06605658b48234cd0ccb7d Author: Uwe Kleine-König Date: Thu Sep 28 09:07:03 2023 +0200 gpio: xgene-sb: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 0a6a3ac26140be4632517e02bccb17c794dd5e40 Author: Uwe Kleine-König Date: Thu Sep 28 09:07:02 2023 +0200 gpio: uniphier: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit a2e09217aaaeac7b1e2ffe27242a244127f066d6 Author: Uwe Kleine-König Date: Thu Sep 28 09:07:01 2023 +0200 gpio: ts5500: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 12305969d7f7f63a762989983f337f51f5e0658f Author: Uwe Kleine-König Date: Thu Sep 28 09:06:59 2023 +0200 gpio: rockchip: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Heiko Stuebner Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 31d8108413e3665aa50b3168277c001bf84eb77d Author: Uwe Kleine-König Date: Thu Sep 28 09:06:58 2023 +0200 gpio: rcar: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit f822f46f30893beee6e9a0f4643cefd7d160f6ff Author: Uwe Kleine-König Date: Thu Sep 28 09:06:57 2023 +0200 gpio: omap: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 7a222f57d856c30433e5a526fc1bcc42fc8d92b1 Author: Uwe Kleine-König Date: Thu Sep 28 09:06:56 2023 +0200 gpio: mpc8xxx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 0ede8698083c5e5b1076b6d3c39819facbcc06ec Author: Uwe Kleine-König Date: Thu Sep 28 09:06:55 2023 +0200 gpio: mpc5200: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 4f5c7bc1612d9d43a7c005b2bb903c3488e72ce7 Author: Uwe Kleine-König Date: Thu Sep 28 09:06:54 2023 +0200 gpio: mm-lantiq: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit e86c4f1cf158c42c2a651b612b660c0761f52a00 Author: Uwe Kleine-König Date: Thu Sep 28 09:06:53 2023 +0200 gpio: mb86s7x: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 43fdda49869419f50359bd398a3e206a3ec64fad Author: Uwe Kleine-König Date: Thu Sep 28 09:06:52 2023 +0200 gpio: lpc18xx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit da2ad5fe2292f28d4315920f936f9394c994aa14 Author: Uwe Kleine-König Date: Thu Sep 28 09:06:51 2023 +0200 gpio: ljca: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit b6c4391569f948edc1537372154f403447aebe59 Author: Uwe Kleine-König Date: Thu Sep 28 09:06:50 2023 +0200 gpio: grgpio: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit b57d8416893fe1392984c5c25b1765fac152aea3 Author: Uwe Kleine-König Date: Thu Sep 28 09:06:49 2023 +0200 gpio: ftgpio010: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 6a277ca75e4531e391a62d2552fca59c62347a26 Author: Uwe Kleine-König Date: Thu Sep 28 09:06:48 2023 +0200 gpio: dln2: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 67c811b601f3e84ea81dc91bc050ed73bf699848 Author: Uwe Kleine-König Date: Thu Sep 28 09:06:47 2023 +0200 gpio: cadence: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 0667faab9657e3178657a1711bb95188f6b43221 Author: Uwe Kleine-König Date: Thu Sep 28 09:06:46 2023 +0200 gpio: brcmstb: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 484b3226761b09dbc36be37ff476502f2bd96fd9 Author: Uwe Kleine-König Date: Thu Sep 28 09:06:45 2023 +0200 gpio: amdpt: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 2ae6a45f8135ae93bf0841e9c93f55b073f16b34 Author: Uwe Kleine-König Date: Thu Sep 28 09:06:44 2023 +0200 gpio: altera: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 9f5b681e2a3f7d5bab02e68f3e68a50b23968c7c Author: Niklas Schnelle Date: Thu Sep 28 16:31:40 2023 +0200 iommu/dma: Use a large flush queue and timeout for shadow_on_flush Flush queues currently use a fixed compile time size of 256 entries. This being a power of 2 allows the compiler to use shift and mask instead of more expensive modulo operations. With per-CPU flush queues larger queue sizes would hit per-CPU allocation limits, with a single flush queue these limits do not apply however. Also with single queues being particularly suitable for virtualized environments with expensive IOTLB flushes these benefit especially from larger queues and thus fewer flushes. To this end re-order struct iova_fq so we can use a dynamic array and introduce the flush queue size and timeouts as new options in the iommu_dma_options struct. So as not to lose the shift and mask optimization, use a power of 2 for the length and use explicit shift and mask instead of letting the compiler optimize this. A large queue size and 1 second timeout is then set for the shadow on flush case set by s390 paged memory guests. This then brings performance on par with the previous s390 specific DMA API implementation. Acked-by: Robin Murphy Reviewed-by: Matthew Rosato #s390 Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230928-dma_iommu-v13-6-9e5fc4dacc36@linux.ibm.com Signed-off-by: Joerg Roedel commit 32d5bc8b09c7cc48c511809e7c3b1755c7ecc5fa Author: Niklas Schnelle Date: Thu Sep 28 16:31:39 2023 +0200 iommu/dma: Allow a single FQ in addition to per-CPU FQs In some virtualized environments, including s390 paged memory guests, IOTLB flushes are used to update IOMMU shadow tables. Due to this, they are much more expensive than in typical bare metal environments or non-paged s390 guests. In addition they may parallelize poorly in virtualized environments. This changes the trade off for flushing IOVAs such that minimizing the number of IOTLB flushes trumps any benefit of cheaper queuing operations or increased paralellism. In this scenario per-CPU flush queues pose several problems. Firstly per-CPU memory is often quite limited prohibiting larger queues. Secondly collecting IOVAs per-CPU but flushing via a global timeout reduces the number of IOVAs flushed for each timeout especially on s390 where PCI interrupts may not be bound to a specific CPU. Let's introduce a single flush queue mode that reuses the same queue logic but only allocates a single global queue. This mode is selected by dma-iommu if a newly introduced .shadow_on_flush flag is set in struct dev_iommu. As a first user the s390 IOMMU driver sets this flag during probe_device. With the unchanged small FQ size and timeouts this setting is worse than per-CPU queues but a follow up patch will make the FQ size and timeout variable. Together this allows the common IOVA flushing code to more closely resemble the global flush behavior used on s390's previous internal DMA API implementation. Link: https://lore.kernel.org/all/9a466109-01c5-96b0-bf03-304123f435ee@arm.com/ Acked-by: Robin Murphy Reviewed-by: Matthew Rosato #s390 Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230928-dma_iommu-v13-5-9e5fc4dacc36@linux.ibm.com Signed-off-by: Joerg Roedel commit 53f8e9ad7653eefe250834511e34cdef3d1c444e Author: Niklas Schnelle Date: Thu Sep 28 16:31:38 2023 +0200 iommu/s390: Disable deferred flush for ISM devices ISM devices are virtual PCI devices used for cross-LPAR communication. Unlike real PCI devices ISM devices do not use the hardware IOMMU but inspects IOMMU translation tables directly on IOTLB flush (s390 RPCIT instruction). ISM devices keep their DMA allocations static and only very rarely DMA unmap at all. For each IOTLB flush that occurs after unmap the ISM devices will however inspect the area of the IOVA space indicated by the flush. This means that for the global IOTLB flushes used by the flush queue mechanism the entire IOVA space would be inspected. In principle this would be fine, albeit potentially unnecessarily slow, it turns out however that ISM devices are sensitive to seeing IOVA addresses that are currently in use in the IOVA range being flushed. Seeing such in-use IOVA addresses will cause the ISM device to enter an error state and become unusable. Fix this by claiming IOMMU_CAP_DEFERRED_FLUSH only for non-ISM devices. This makes sure IOTLB flushes only cover IOVAs that have been unmapped and also restricts the range of the IOTLB flush potentially reducing latency spikes. Signed-off-by: Niklas Schnelle Reviewed-by: Matthew Rosato Link: https://lore.kernel.org/r/20230928-dma_iommu-v13-4-9e5fc4dacc36@linux.ibm.com Signed-off-by: Joerg Roedel commit c76c067e488ccd55734c3e750799caf2c5956db6 Author: Niklas Schnelle Date: Thu Sep 28 16:31:37 2023 +0200 s390/pci: Use dma-iommu layer While s390 already has a standard IOMMU driver and previous changes have added I/O TLB flushing operations this driver is currently only used for user-space PCI access such as vfio-pci. For the DMA API s390 instead utilizes its own implementation in arch/s390/pci/pci_dma.c which drives the same hardware and shares some code but requires a complex and fragile hand over between DMA API and IOMMU API use of a device and despite code sharing still leads to significant duplication and maintenance effort. Let's utilize the common code DMAP API implementation from drivers/iommu/dma-iommu.c instead allowing us to get rid of arch/s390/pci/pci_dma.c. Reviewed-by: Matthew Rosato Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230928-dma_iommu-v13-3-9e5fc4dacc36@linux.ibm.com Signed-off-by: Joerg Roedel commit b6f888709a155b4e748aded93afc9fa43aaa28dd Author: Niklas Schnelle Date: Thu Sep 28 16:31:36 2023 +0200 s390/pci: prepare is_passed_through() for dma-iommu With the IOMMU always controlled through the IOMMU driver testing for zdev->s390_domain is not a valid indication of the device being passed-through. Instead test if zdev->kzdev is set. Reviewed-by: Pierre Morel Reviewed-by: Matthew Rosato Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230928-dma_iommu-v13-2-9e5fc4dacc36@linux.ibm.com Signed-off-by: Joerg Roedel commit fa4c4507099f781ca89a748c480af9cf97629726 Author: Niklas Schnelle Date: Thu Sep 28 16:31:35 2023 +0200 iommu: Allow .iotlb_sync_map to fail and handle s390's -ENOMEM return On s390 when using a paging hypervisor, .iotlb_sync_map is used to sync mappings by letting the hypervisor inspect the synced IOVA range and updating a shadow table. This however means that .iotlb_sync_map can fail as the hypervisor may run out of resources while doing the sync. This can be due to the hypervisor being unable to pin guest pages, due to a limit on mapped addresses such as vfio_iommu_type1.dma_entry_limit or lack of other resources. Either way such a failure to sync a mapping should result in a DMA_MAPPING_ERROR. Now especially when running with batched IOTLB flushes for unmap it may be that some IOVAs have already been invalidated but not yet synced via .iotlb_sync_map. Thus if the hypervisor indicates running out of resources, first do a global flush allowing the hypervisor to free resources associated with these mappings as well a retry creating the new mappings and only if that also fails report this error to callers. Reviewed-by: Lu Baolu Reviewed-by: Matthew Rosato Acked-by: Jernej Skrabec # sun50i Signed-off-by: Niklas Schnelle Link: https://lore.kernel.org/r/20230928-dma_iommu-v13-1-9e5fc4dacc36@linux.ibm.com Signed-off-by: Joerg Roedel commit 45a1c8dfa28a0b8b6954d5905bee04877d2ad548 Merge: c980248179d65 8a749fd1a8720 Author: Greg Kroah-Hartman Date: Mon Oct 2 08:17:05 2023 +0200 Merge 6.6-rc4 into tty-next We need the tty fixes in here as well for testing and to base changes on. Signed-off-by: Greg Kroah-Hartman commit f52d1493dfbf9ba421bb3f84a798cc309128b728 Author: Jouni Högander Date: Fri Sep 29 14:20:47 2023 +0300 drm/i915/display: Include i915_active header in frontbuffer tracking code Intel frontbuffer tracking code is using i915_active functions -> include i915_active.h directly instead of relying getting indirectly included. Cc: Jani Nikula Signed-off-by: Jouni Högander Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230929112047.1151914-1-jouni.hogander@intel.com commit 2c10cda4b777be4be9d9e69e4f70c818dbb15e21 Author: Tianrui Zhao Date: Mon Oct 2 10:01:29 2023 +0800 LoongArch: KVM: Add maintainers for LoongArch KVM Add maintainers for LoongArch KVM. Acked-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 6f0257a03212d4f66954ce14402adb5c68fed075 Author: Tianrui Zhao Date: Mon Oct 2 10:01:29 2023 +0800 LoongArch: KVM: Supplement kvm document about LoongArch-specific part Supplement kvm document about LoongArch-specific part, such as add api introduction for GET/SET_ONE_REG, GET/SET_FPU, GET/SET_MP_STATE, etc. Reviewed-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit c1fc48aad14dbe7654f5986afb906332b528d54b Author: Tianrui Zhao Date: Mon Oct 2 10:01:29 2023 +0800 LoongArch: KVM: Enable kvm config and add the makefile Enable LoongArch kvm config and add the makefile to support build kvm module. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 39fdf4be72f2b81238acbd4da48c75c135a6f1e0 Author: Tianrui Zhao Date: Mon Oct 2 10:01:29 2023 +0800 LoongArch: KVM: Implement vcpu world switch Implement LoongArch vcpu world switch, including vcpu enter guest and vcpu exit from guest, both operations need to save or restore the host and guest registers. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 71f4fb845874c3c54527e2e5afd687493db9d4d4 Author: Tianrui Zhao Date: Mon Oct 2 10:01:29 2023 +0800 LoongArch: KVM: Implement kvm exception vectors Implement kvm exception vectors, using kvm_fault_tables array to save the handle function pointers and it is used when vcpu handle guest exit. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 37cdfc6dbf04169310a24f3a79b554c363260562 Author: Tianrui Zhao Date: Mon Oct 2 10:01:29 2023 +0800 LoongArch: KVM: Implement handle fpu exception Implement handle fpu exception, using kvm_own_fpu() to enable fpu for guest. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit d5b65882d57c91e5fec8c4c0b0a0a88f343b4525 Author: Tianrui Zhao Date: Mon Oct 2 10:01:28 2023 +0800 LoongArch: KVM: Implement handle mmio exception Implement handle mmio exception, setting the mmio info into vcpu_run and return to user space to handle it. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 13c82f5e6e5088a2998036714239cf00e48f5c10 Author: Tianrui Zhao Date: Mon Oct 2 10:01:28 2023 +0800 LoongArch: KVM: Implement handle gspr exception Implement kvm handle gspr exception interface, including emulate the reading and writing of cpucfg, csr, iocsr resource. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit f41c8bdbbdbe73343d4842e580c6ab9db9d84171 Author: Tianrui Zhao Date: Mon Oct 2 10:01:28 2023 +0800 LoongArch: KVM: Implement handle idle exception Implement kvm handle LoongArch vcpu idle exception, using kvm_vcpu_block to emulate it. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 81efe043a35113ec1352f6eb2b954d02aac368db Author: Tianrui Zhao Date: Mon Oct 2 10:01:28 2023 +0800 LoongArch: KVM: Implement handle iocsr exception Implement kvm handle vcpu iocsr exception, setting the iocsr info into vcpu_run and return to user space to handle it. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit da50f5a693ff55ef367a4c5c9145f0bfea3e476d Author: Tianrui Zhao Date: Mon Oct 2 10:01:28 2023 +0800 LoongArch: KVM: Implement handle csr exception Implement kvm handle LoongArch vcpu exit caused by reading, writing and exchanging csr. Use kvm_vcpu_arch::csr structure to emulate the software registers. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 752e2cd7b4fb412f3e008493e0195e357bab9773 Author: Tianrui Zhao Date: Mon Oct 2 10:01:28 2023 +0800 LoongArch: KVM: Implement kvm mmu operations Implement LoongArch kvm mmu, it is used to switch gpa to hpa when guest exit because of address translation exception. This patch implement: allocating gpa page table, searching gpa from it, and flushing guest gpa in the table. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit d7f4ed4b22908077bd219dd172b27b51927aff6d Author: Tianrui Zhao Date: Mon Oct 2 10:01:28 2023 +0800 LoongArch: KVM: Implement virtual machine tlb operations Implement LoongArch virtual machine tlb operations such as flush tlb by specific gpa parameter and flush all of the virtual machine's tlbs. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit a5857b9ff6e06cac4adc8d671a74b7739a88623e Author: Tianrui Zhao Date: Mon Oct 2 10:01:28 2023 +0800 LoongArch: KVM: Implement vcpu timer operations Implement LoongArch vcpu timer operations such as init kvm timer, acquire kvm timer, save kvm timer and restore kvm timer. When vcpu exit, we use kvm soft timer to emulate hardware timer. If timeout happens, the vcpu timer interrupt will be set and it is going to be handled at vcpu next entrance. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 93a9a197b680dd6b98afb629d2bfb3bd51a83d84 Author: Tianrui Zhao Date: Mon Oct 2 10:01:28 2023 +0800 LoongArch: KVM: Implement misc vcpu related interfaces 1, Implement LoongArch vcpu status description such as idle exits counter, signal exits counter, cpucfg exits counter, etc. 2, Implement some misc vcpu relaterd interfaces, such as vcpu runnable, vcpu should kick, vcpu dump regs, etc. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 1f4c39b9892e12385e075efa9cb3f014b700204d Author: Tianrui Zhao Date: Mon Oct 2 10:01:28 2023 +0800 LoongArch: KVM: Implement vcpu load and vcpu put operations Implement LoongArch vcpu load and vcpu put operations, including load csr value into hardware and save csr value into vcpu structure. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit f45ad5b8aa9335bc6b30331b739e778f2f730b35 Author: Tianrui Zhao Date: Mon Oct 2 10:01:28 2023 +0800 LoongArch: KVM: Implement vcpu interrupt operations Implement vcpu interrupt operations such as vcpu set irq and vcpu clear irq, using set_gcsr_estat() to set irq which is parsed by the irq bitmap. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 84be4212dcda361b52fc5a071044e5fa237a58d7 Author: Tianrui Zhao Date: Mon Oct 2 10:01:28 2023 +0800 LoongArch: KVM: Implement fpu operations for vcpu Implement LoongArch fpu related interface for vcpu, such as get fpu, set fpu, own fpu and lose fpu, etc. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit f6deff355b5c7072a05232f0861cfdfe372c6bfd Author: Tianrui Zhao Date: Mon Oct 2 10:01:27 2023 +0800 LoongArch: KVM: Implement basic vcpu ioctl interfaces Implement basic vcpu ioctl interfaces, including: 1, vcpu KVM_ENABLE_CAP ioctl interface. 2, vcpu get registers and set registers operations, it is called when user space use the ioctl interface to get or set regs. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 2fc3bd86db4b6f6992d4b459879a17b2ae6b2b3d Author: Tianrui Zhao Date: Mon Oct 2 10:01:27 2023 +0800 LoongArch: KVM: Implement basic vcpu interfaces Implement basic vcpu interfaces, including: 1, vcpu create and destroy interface, saving info into vcpu arch structure such as vcpu exception entrance, vcpu enter guest pointer, etc. Init vcpu timer and set address translation mode when vcpu create. 2, vcpu run interface, handling mmio, iocsr reading fault and deliver interrupt, lose fpu before vcpu enter guest. 3, vcpu handle exit interface, getting the exit code by ESTAT register and using kvm exception vector to handle it. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit dfe3dc07fa68f2be1bf8af98656e674e9636d965 Author: Tianrui Zhao Date: Mon Oct 2 10:01:27 2023 +0800 LoongArch: KVM: Add vcpu related header files Add LoongArch vcpu related header files, including vcpu csr information, irq number definitions, and some vcpu interfaces. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 482795cb62aa63bbba3a1265fa5b5601be9d13df Author: Tianrui Zhao Date: Mon Oct 2 10:01:27 2023 +0800 LoongArch: KVM: Implement VM related functions Implement LoongArch VM operations: Init and destroy vm interface, allocating memory page to save the vm pgd when init vm. Implement vm check extension, such as getting vcpu number info, memory slots info, and fpu info. And implement vm status description. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 0d0df3c99d4fbc6561b0addb094e52f19f3c7baa Author: Tianrui Zhao Date: Mon Oct 2 10:01:20 2023 +0800 LoongArch: KVM: Implement kvm hardware enable, disable interface Implement kvm hardware enable, disable interface, setting the guest config register to enable virtualization features when called the interface. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 2bd6ac68726131da32ace9717aa63ff68cf6605c Author: Tianrui Zhao Date: Mon Oct 2 10:01:20 2023 +0800 LoongArch: KVM: Implement kvm module related interface Implement LoongArch kvm module init, module exit interface, using kvm context to save the vpid info and vcpu world switch interface pointer. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit b37e6b680e3a4fad40d8c7b92cfe9b2806c6248e Author: Tianrui Zhao Date: Mon Oct 2 10:01:20 2023 +0800 LoongArch: KVM: Add kvm related header files Add LoongArch KVM related header files, including kvm.h, kvm_host.h and kvm_types.h. All of those are about LoongArch virtualization features and kvm interfaces. Reviewed-by: Bibo Mao Tested-by: Huacai Chen Signed-off-by: Tianrui Zhao Signed-off-by: Huacai Chen commit 20bd1191830478cfdc9be766a735923c5fbe5350 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:21 2023 +0200 soc/rockchip: io-domain: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230925095532.1984344-31-u.kleine-koenig@pengutronix.de Signed-off-by: Heiko Stuebner commit b0d587be2407ae7319098339034296370a851939 Author: Jagan Teki Date: Mon Jul 31 16:05:06 2023 +0530 dt-bindings: pwm: rockchip: Document rv1126-pwm Document pwm compatible for rv1126 which is fallback compatible of rk3328-pwm group. Signed-off-by: Jagan Teki Acked-by: Conor Dooley Acked-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230731103518.2906147-2-jagan@edgeble.ai Signed-off-by: Heiko Stuebner commit e005a9b35b464be5b2e0194f717e90e7e496785d Author: Doug Berger Date: Wed Aug 30 15:47:47 2023 -0700 rtc: brcmstb-waketimer: support level alarm_irq Some devices (e.g. BCM72112) use an alarm_irq interrupt that is connected to a level interrupt controller rather than an edge interrupt controller. In this case, the interrupt cannot be left enabled by the irq handler while preserving the hardware wake-up signal on wake capable devices or an interrupt storm will occur. The alarm_expired flag is introduced to allow the disabling of the interrupt when an alarm expires and to support balancing the calls to disable_irq() and enable_irq() in accordance with the existing design. Fixes: 24304a87158a ("rtc: brcmstb-waketimer: allow use as non-wake alarm") Signed-off-by: Doug Berger Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20230830224747.1663044-1-opendmb@gmail.com Signed-off-by: Alexandre Belloni commit d4277fa4a1a806ab9ec7da994fc3dd1ec25689fe Author: Alexandre Belloni Date: Mon Sep 11 11:50:51 2023 +0200 rtc: sh: silence warning Silence: drivers/rtc/rtc-sh.c:517:58: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 3 [-Wformat-truncation=] Link: https://lore.kernel.org/r/20230911095052.1292869-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni commit fbff653a40f6a806edf54e1f5003d2c4eb510b6a Merge: 2be825ebb9d1b 02715925222c1 Author: David S. Miller Date: Sun Oct 1 19:39:19 2023 +0100 Merge branch 'inet-more-data-race-fixes' Eric Dumazet says: ==================== inet: more data-race fixes This series fixes some existing data-races on inet fields: inet->mc_ttl, inet->pmtudisc, inet->tos, inet->uc_index, inet->mc_index and inet->mc_addr. While fixing them, we convert eight socket options to lockless implementation. v2: addressed David Ahern feedback on ("inet: implement lockless IP_TOS") Added David Reviewed-by: tag on other patches. ==================== Signed-off-by: David S. Miller commit 02715925222c137f418ecac417b68c7801e8f729 Author: Eric Dumazet Date: Fri Sep 22 03:42:21 2023 +0000 inet: implement lockless getsockopt(IP_MULTICAST_IF) Add missing annotations to inet->mc_index and inet->mc_addr to fix data-races. getsockopt(IP_MULTICAST_IF) can be lockless. setsockopt() side is left for later. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit c4480eb5504c9771f935cbca58a3b874bdd36af8 Author: Eric Dumazet Date: Fri Sep 22 03:42:20 2023 +0000 inet: lockless IP_PKTOPTIONS implementation Current implementation is already lockless, because the socket lock is released before reading socket fields. Add missing READ_ONCE() annotations. Note that corresponding WRITE_ONCE() are needed, the order of the patches do not really matter. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 959d5c11601b2b337c364b2e3102d392365e3dd3 Author: Eric Dumazet Date: Fri Sep 22 03:42:19 2023 +0000 inet: implement lockless getsockopt(IP_UNICAST_IF) Add missing READ_ONCE() annotations when reading inet->uc_index Implementing getsockopt(IP_UNICAST_IF) locklessly seems possible, the setsockopt() part might not be possible at the moment. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 3523bc91e4b4da39ccf18a0252d13108877ece0a Author: Eric Dumazet Date: Fri Sep 22 03:42:18 2023 +0000 inet: lockless getsockopt(IP_MTU) sk_dst_get() does not require socket lock. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit a4725d0d893599253a4bb283fdabdd4a66d9451d Author: Eric Dumazet Date: Fri Sep 22 03:42:17 2023 +0000 inet: lockless getsockopt(IP_OPTIONS) inet->inet_opt being RCU protected, we can use RCU instead of locking the socket. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit e08d0b3d172311e2bb500865c0d0038533d0ff11 Author: Eric Dumazet Date: Fri Sep 22 03:42:16 2023 +0000 inet: implement lockless IP_TOS Some reads of inet->tos are racy. Add needed READ_ONCE() annotations and convert IP_TOS option lockless. v2: missing changes in include/net/route.h (David Ahern) Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit ceaa714138a372ac63cc2c5c19ee0882d22827f9 Author: Eric Dumazet Date: Fri Sep 22 03:42:15 2023 +0000 inet: implement lockless IP_MTU_DISCOVER inet->pmtudisc can be read locklessly. Implement proper lockless reads and writes to inet->pmtudisc ip_sock_set_mtu_discover() can now be called from arbitrary contexts. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit c9746e6a19c24b2d9a74d6657daee3b39fdc1bec Author: Eric Dumazet Date: Fri Sep 22 03:42:14 2023 +0000 inet: implement lockless IP_MULTICAST_TTL inet->mc_ttl can be read locklessly. Implement proper lockless reads and writes to inet->mc_ttl Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 2be825ebb9d1b17f1a9e46af78d24b76c4ff7a1f Merge: 06bc3668cc2a6 eb44ad4e63513 Author: David S. Miller Date: Sun Oct 1 19:09:55 2023 +0100 Merge branch 'socket-option-lockless' Eric Dumazet says: ==================== net: more data-races fixes and lockless socket options This is yet another round of data-races fixes, and lockless socket options. ==================== Signed-off-by: David S. Miller commit eb44ad4e635132754bfbcb18103f1dcb7058aedd Author: Eric Dumazet Date: Thu Sep 21 20:28:18 2023 +0000 net: annotate data-races around sk->sk_dst_pending_confirm This field can be read or written without socket lock being held. Add annotations to avoid load-store tearing. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 0bb4d124d34044179b42a769a0c76f389ae973b6 Author: Eric Dumazet Date: Thu Sep 21 20:28:17 2023 +0000 net: annotate data-races around sk->sk_tx_queue_mapping This field can be read or written without socket lock being held. Add annotations to avoid load-store tearing. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 5eef0b8de1be40c5d05873b7e3d63824300c9f39 Author: Eric Dumazet Date: Thu Sep 21 20:28:16 2023 +0000 net: lockless implementation of SO_TXREHASH sk->sk_txrehash readers are already safe against concurrent change of this field. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 28b24f90020fed8e8e3e8e20575f08c1cd06e54f Author: Eric Dumazet Date: Thu Sep 21 20:28:15 2023 +0000 net: implement lockless SO_MAX_PACING_RATE SO_MAX_PACING_RATE setsockopt() does not need to hold the socket lock, because sk->sk_pacing_rate readers can run fine if the value is changed by other threads, after adding READ_ONCE() accessors. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 2a4319cf3c83fc5d1997466196b99b3e14584e76 Author: Eric Dumazet Date: Thu Sep 21 20:28:14 2023 +0000 net: lockless implementation of SO_BUSY_POLL, SO_PREFER_BUSY_POLL, SO_BUSY_POLL_BUDGET Setting sk->sk_ll_usec, sk_prefer_busy_poll and sk_busy_poll_budget do not require the socket lock, readers are lockless anyway. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit b120251590a9c771bae353e444503fa49793c75e Author: Eric Dumazet Date: Thu Sep 21 20:28:13 2023 +0000 net: lockless SO_{TYPE|PROTOCOL|DOMAIN|ERROR } setsockopt() This options can not be set and return -ENOPROTOOPT, no need to acqure socket lock. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 8ebfb6db5a01f16cd37254bfad7145204e4bf6f2 Author: Eric Dumazet Date: Thu Sep 21 20:28:12 2023 +0000 net: lockless SO_PASSCRED, SO_PASSPIDFD and SO_PASSSEC sock->flags are atomic, no need to hold the socket lock in sk_setsockopt() for SO_PASSCRED, SO_PASSPIDFD and SO_PASSSEC. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 10bbf1652c1cca9819e98d56f3432c56d7a2d229 Author: Eric Dumazet Date: Thu Sep 21 20:28:11 2023 +0000 net: implement lockless SO_PRIORITY This is a followup of 8bf43be799d4 ("net: annotate data-races around sk->sk_priority"). sk->sk_priority can be read and written without holding the socket lock. Signed-off-by: Eric Dumazet Reviewed-by: Wenjia Zhang Signed-off-by: David S. Miller commit 06bc3668cc2a6db2831b9086f0e3c6ebda599dba Author: Ilya Maximets Date: Thu Sep 21 21:42:35 2023 +0200 openvswitch: reduce stack usage in do_execute_actions do_execute_actions() function can be called recursively multiple times while executing actions that require pipeline forking or recirculations. It may also be re-entered multiple times if the packet leaves openvswitch module and re-enters it through a different port. Currently, there is a 256-byte array allocated on stack in this function that is supposed to hold NSH header. Compilers tend to pre-allocate that space right at the beginning of the function: a88: 48 81 ec b0 01 00 00 sub $0x1b0,%rsp NSH is not a very common protocol, but the space is allocated on every recursive call or re-entry multiplying the wasted stack space. Move the stack allocation to push_nsh() function that is only used if NSH actions are actually present. push_nsh() is also a simple function without a possibility for re-entry, so the stack is returned right away. With this change the preallocated space is reduced by 256 B per call: b18: 48 81 ec b0 00 00 00 sub $0xb0,%rsp Signed-off-by: Ilya Maximets Reviewed-by: Eric Dumazet Reviewed-by: Eelco Chaudron echaudro@redhat.com Reviewed-by: Aaron Conole Signed-off-by: David S. Miller commit c1157c114a23029a93dc8b5a766a1acea8db2686 Merge: a63df366d0915 a56d9390bd604 Author: David S. Miller Date: Sun Oct 1 16:33:01 2023 +0100 Merge branch 'dev-stats-virtio-l2tp_eth' Eric Dumazet says: ==================== net: use DEV_STATS_xxx() helpers in virtio_net and l2tp_eth Inspired by another (minor) KCSAN syzbot report. Both virtio_net and l2tp_eth can use DEV_STATS_xxx() helpers. ==================== Signed-off-by: David S. Miller commit a56d9390bd6045e8c37bcfd0586ff5f65ef22997 Author: Eric Dumazet Date: Thu Sep 21 08:52:18 2023 +0000 net: l2tp_eth: use generic dev->stats fields Core networking has opt-in atomic variant of dev->stats, simply use DEV_STATS_INC(), DEV_STATS_ADD() and DEV_STATS_READ(). v2: removed @priv local var in l2tp_eth_dev_recv() (Simon) Signed-off-by: Eric Dumazet Cc: Simon Horman Signed-off-by: David S. Miller commit d12a26b74fb77434b73fe39022266c4b00907219 Author: Eric Dumazet Date: Thu Sep 21 08:52:17 2023 +0000 virtio_net: avoid data-races on dev->stats fields Use DEV_STATS_INC() and DEV_STATS_READ() which provide atomicity on paths that can be used concurrently. Reported-by: syzbot Signed-off-by: Eric Dumazet Reviewed-by: Xuan Zhuo Cc: "Michael S. Tsirkin" Cc: Jason Wang Signed-off-by: David S. Miller commit 0b068c714ca9479d2783cc333fff5bc2d4a6d45c Author: Eric Dumazet Date: Thu Sep 21 08:52:16 2023 +0000 net: add DEV_STATS_READ() helper Companion of DEV_STATS_INC() & DEV_STATS_ADD(). This is going to be used in the series. Use it in macsec_get_stats64(). Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit a63df366d0915a85d31498d295e6ae81815badde Author: Hariprasad Kelam Date: Thu Sep 21 14:20:55 2023 +0530 octeontx2-pf: Tc flower offload support for MPLS This patch extends flower offload support for MPLS protocol. Due to hardware limitation, currently driver supports lse depth up to 4. Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Goutham Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit f77e9f13ba090d922fdd3f6e3485fc32010284db Author: Uwe Kleine-König Date: Thu Sep 21 08:35:01 2023 +0200 net: ethernet: xilinx: Drop kernel doc comment about return value During review of the patch that became 2e0ec0afa902 ("net: ethernet: xilinx: Convert to platform remove callback returning void") in net-next, Radhey Shyam Pandey pointed out that the change makes the documentation about the return value obsolete. The patch was applied without addressing this feedback, so here comes a fix in a separate patch. Fixes: 2e0ec0afa902 ("net: ethernet: xilinx: Convert to platform remove callback returning void") Signed-off-by: Uwe Kleine-König Reviewed-by: Radhey Shyam Pandey Signed-off-by: David S. Miller commit d87c59f2b00d03fa1c30ca72ed73e8ec17d3b601 Author: Sieng-Piaw Liew Date: Thu Sep 21 08:56:23 2023 +0800 net: atl1c: switch to napi_consume_skb() Switch to napi_consume_skb() to take advantage of bulk free, and skb reuse through skb cache in conjunction with napi_build_skb(). When parameter 'budget' = 0, indicating non-NAPI context, dev_consume_skb_any() is called internally. Signed-off-by: Sieng-Piaw Liew Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit b49a948568dcbb5f38cbf5356ea0fb9c9c6f6953 Merge: 66ac08a7385fa 8f6c4ff9e0522 Author: David S. Miller Date: Sun Oct 1 13:20:36 2023 +0100 Merge branch 'sch_fq-improvements' Eric Dumazet says: ==================== net_sched: sch_fq: round of improvements For FQ tenth anniversary, it was time for making it faster. The FQ part (as in Fair Queue) is rather expensive, because we have to classify packets and store them in a per-flow structure, and add this per-flow structure in a hash table. Then the RR lists also add cache line misses. Most fq qdisc are almost idle. Trying to share NIC bandwidth has no benefits, thus the qdisc could behave like a FIFO. This series brings a 5 % throughput increase in intensive tcp_rr workload, and 13 % increase for (unpaced) UDP packets. v2: removed an extra label (build bot). Fix an accidental increase of stat_internal_packets counter in fast path. Added "constify qdisc_priv()" patch to allow fq_fastpath_check() first parameter to be const. typo on 'eligible' (Willem) ==================== Reviewed-by: Jamal Hadi Salim Reviewed-by: Willem de Bruijn Reviewed-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 8f6c4ff9e0522da9313fbff5295ae208af679fed Author: Eric Dumazet Date: Wed Sep 20 20:17:15 2023 +0000 net_sched: sch_fq: always garbage collect FQ performs garbage collection at enqueue time, and only if number of flows is above a given threshold, which is hit after the qdisc has been used a bit. Since an RB-tree traversal is needed to locate a flow, it makes sense to perform gc all the time, to keep rb-trees smaller. This reduces by 50 % average storage costs in FQ, and avoids 1 cache line miss at enqueue time when fast path added in prior patch can not be used. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 076433bd78d719b34d465c1e69eef512036b534c Author: Eric Dumazet Date: Wed Sep 20 20:17:14 2023 +0000 net_sched: sch_fq: add fast path for mostly idle qdisc TCQ_F_CAN_BYPASS can be used by few qdiscs. Idea is that if we queue a packet to an empty qdisc, following dequeue() would pick it immediately. FQ can not use the generic TCQ_F_CAN_BYPASS code, because some additional checks need to be performed. This patch adds a similar fast path to FQ. Most of the time, qdisc is not throttled, and many packets can avoid bringing/touching at least four cache lines, and consuming 128bytes of memory to store the state of a flow. After this patch, netperf can send UDP packets about 13 % faster, and pktgen goes 30 % faster (when FQ is in the way), on a fast NIC. TCP traffic is also improved, thanks to a reduction of cache line misses. I have measured a 5 % increase of throughput on a tcp_rr intensive workload. tc -s -d qd sh dev eth1 ... qdisc fq 8004: parent 1:2 limit 10000p flow_limit 100p buckets 1024 orphan_mask 1023 quantum 3028b initial_quantum 15140b low_rate_threshold 550Kbit refill_delay 40ms timer_slack 10us horizon 10s horizon_drop Sent 5646784384 bytes 1985161 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 flows 122 (inactive 122 throttled 0) gc 0 highprio 0 fastpath 659990 throttled 27762 latency 8.57us Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit ee9af4e14d166c34ec78896bb1ba545249445df0 Author: Eric Dumazet Date: Wed Sep 20 20:17:13 2023 +0000 net_sched: sch_fq: change how @inactive is tracked Currently, when one fq qdisc has no more packets to send, it can still have some flows stored in its RR lists (q->new_flows & q->old_flows) This was a design choice, but what is a bit disturbing is that the inactive_flows counter does not include the count of empty flows in RR lists. As next patch needs to know better if there are active flows, this change makes inactive_flows exact. Before the patch, following command on an empty qdisc could have returned: lpaa17:~# tc -s -d qd sh dev eth1 | grep inactive flows 1322 (inactive 1316 throttled 0) flows 1330 (inactive 1325 throttled 0) flows 1193 (inactive 1190 throttled 0) flows 1208 (inactive 1202 throttled 0) After the patch, we now have: lpaa17:~# tc -s -d qd sh dev eth1 | grep inactive flows 1322 (inactive 1322 throttled 0) flows 1330 (inactive 1330 throttled 0) flows 1193 (inactive 1193 throttled 0) flows 1208 (inactive 1208 throttled 0) Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 54ff8ad69c6e93c0767451ae170b41c000e565dd Author: Eric Dumazet Date: Wed Sep 20 20:17:12 2023 +0000 net_sched: sch_fq: struct sched_data reorg q->flows can be often modified, and q->timer_slack is read mostly. Exchange the two fields, so that cache line countaining quantum, initial_quantum, and other critical parameters stay clean (read-mostly). Move q->watchdog next to q->stat_throttled Add comments explaining how the structure is split in three different parts. pahole output before the patch: struct fq_sched_data { struct fq_flow_head new_flows; /* 0 0x10 */ struct fq_flow_head old_flows; /* 0x10 0x10 */ struct rb_root delayed; /* 0x20 0x8 */ u64 time_next_delayed_flow; /* 0x28 0x8 */ u64 ktime_cache; /* 0x30 0x8 */ unsigned long unthrottle_latency_ns; /* 0x38 0x8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct fq_flow internal __attribute__((__aligned__(64))); /* 0x40 0x80 */ /* XXX last struct has 16 bytes of padding */ /* --- cacheline 3 boundary (192 bytes) --- */ u32 quantum; /* 0xc0 0x4 */ u32 initial_quantum; /* 0xc4 0x4 */ u32 flow_refill_delay; /* 0xc8 0x4 */ u32 flow_plimit; /* 0xcc 0x4 */ unsigned long flow_max_rate; /* 0xd0 0x8 */ u64 ce_threshold; /* 0xd8 0x8 */ u64 horizon; /* 0xe0 0x8 */ u32 orphan_mask; /* 0xe8 0x4 */ u32 low_rate_threshold; /* 0xec 0x4 */ struct rb_root * fq_root; /* 0xf0 0x8 */ u8 rate_enable; /* 0xf8 0x1 */ u8 fq_trees_log; /* 0xf9 0x1 */ u8 horizon_drop; /* 0xfa 0x1 */ /* XXX 1 byte hole, try to pack */ u32 flows; /* 0xfc 0x4 */ /* --- cacheline 4 boundary (256 bytes) --- */ u32 inactive_flows; /* 0x100 0x4 */ u32 throttled_flows; /* 0x104 0x4 */ u64 stat_gc_flows; /* 0x108 0x8 */ u64 stat_internal_packets; /* 0x110 0x8 */ u64 stat_throttled; /* 0x118 0x8 */ u64 stat_ce_mark; /* 0x120 0x8 */ u64 stat_horizon_drops; /* 0x128 0x8 */ u64 stat_horizon_caps; /* 0x130 0x8 */ u64 stat_flows_plimit; /* 0x138 0x8 */ /* --- cacheline 5 boundary (320 bytes) --- */ u64 stat_pkts_too_long; /* 0x140 0x8 */ u64 stat_allocation_errors; /* 0x148 0x8 */ u32 timer_slack; /* 0x150 0x4 */ /* XXX 4 bytes hole, try to pack */ struct qdisc_watchdog watchdog; /* 0x158 0x48 */ /* size: 448, cachelines: 7, members: 34 */ /* sum members: 411, holes: 2, sum holes: 5 */ /* padding: 32 */ /* paddings: 1, sum paddings: 16 */ /* forced alignments: 1 */ }; pahole output after the patch: struct fq_sched_data { struct fq_flow_head new_flows; /* 0 0x10 */ struct fq_flow_head old_flows; /* 0x10 0x10 */ struct rb_root delayed; /* 0x20 0x8 */ u64 time_next_delayed_flow; /* 0x28 0x8 */ u64 ktime_cache; /* 0x30 0x8 */ unsigned long unthrottle_latency_ns; /* 0x38 0x8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct fq_flow internal __attribute__((__aligned__(64))); /* 0x40 0x80 */ /* XXX last struct has 16 bytes of padding */ /* --- cacheline 3 boundary (192 bytes) --- */ u32 quantum; /* 0xc0 0x4 */ u32 initial_quantum; /* 0xc4 0x4 */ u32 flow_refill_delay; /* 0xc8 0x4 */ u32 flow_plimit; /* 0xcc 0x4 */ unsigned long flow_max_rate; /* 0xd0 0x8 */ u64 ce_threshold; /* 0xd8 0x8 */ u64 horizon; /* 0xe0 0x8 */ u32 orphan_mask; /* 0xe8 0x4 */ u32 low_rate_threshold; /* 0xec 0x4 */ struct rb_root * fq_root; /* 0xf0 0x8 */ u8 rate_enable; /* 0xf8 0x1 */ u8 fq_trees_log; /* 0xf9 0x1 */ u8 horizon_drop; /* 0xfa 0x1 */ /* XXX 1 byte hole, try to pack */ u32 timer_slack; /* 0xfc 0x4 */ /* --- cacheline 4 boundary (256 bytes) --- */ u32 flows; /* 0x100 0x4 */ u32 inactive_flows; /* 0x104 0x4 */ u32 throttled_flows; /* 0x108 0x4 */ /* XXX 4 bytes hole, try to pack */ u64 stat_throttled; /* 0x110 0x8 */ struct qdisc_watchdog watchdog; /* 0x118 0x48 */ /* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */ u64 stat_gc_flows; /* 0x160 0x8 */ u64 stat_internal_packets; /* 0x168 0x8 */ u64 stat_ce_mark; /* 0x170 0x8 */ u64 stat_horizon_drops; /* 0x178 0x8 */ /* --- cacheline 6 boundary (384 bytes) --- */ u64 stat_horizon_caps; /* 0x180 0x8 */ u64 stat_flows_plimit; /* 0x188 0x8 */ u64 stat_pkts_too_long; /* 0x190 0x8 */ u64 stat_allocation_errors; /* 0x198 0x8 */ /* Force padding: */ u64 :64; u64 :64; u64 :64; u64 :64; /* size: 448, cachelines: 7, members: 34 */ /* sum members: 411, holes: 2, sum holes: 5 */ /* padding: 32 */ /* paddings: 1, sum paddings: 16 */ /* forced alignments: 1 */ }; Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 1add90738cf58def972356ecf402e36397187db7 Author: Eric Dumazet Date: Wed Sep 20 20:17:11 2023 +0000 net_sched: constify qdisc_priv() In order to propagate const qualifiers, we change qdisc_priv() to accept a possibly const argument. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 66ac08a7385fa8a5d3312ca96d1399670cfca0eb Merge: 236f3873b517a bbf80d713fe75 Author: David S. Miller Date: Sun Oct 1 13:13:01 2023 +0100 Merge branch 'tcp_delack_max' Eric Dumazet says: ==================== tcp: add tcp_delack_max() First patches are adding const qualifiers to four existing helpers. Third patch adds a much needed companion feature to RTAX_RTO_MIN. ==================== Signed-off-by: David S. Miller commit bbf80d713fe75cfbecda26e7c03a9a8d22af2f4f Author: Eric Dumazet Date: Wed Sep 20 17:29:43 2023 +0000 tcp: derive delack_max from rto_min While BPF allows to set icsk->->icsk_delack_max and/or icsk->icsk_rto_min, we have an ip route attribute (RTAX_RTO_MIN) to be able to tune rto_min, but nothing to consequently adjust max delayed ack, which vary from 40ms to 200 ms (TCP_DELACK_{MIN|MAX}). This makes RTAX_RTO_MIN of almost no practical use, unless customers are in big trouble. Modern days datacenter communications want to set rto_min to ~5 ms, and the max delayed ack one jiffie smaller to avoid spurious retransmits. After this patch, an "rto_min 5" route attribute will effectively lower max delayed ack timers to 4 ms. Note in the following ss output, "rto:6 ... ato:4" $ ss -temoi dst XXXXXX State Recv-Q Send-Q Local Address:Port Peer Address:Port Process ESTAB 0 0 [2002:a05:6608:295::]:52950 [2002:a05:6608:297::]:41597 ino:255134 sk:1001 <-> skmem:(r0,rb1707063,t872,tb262144,f0,w0,o0,bl0,d0) ts sack cubic wscale:8,8 rto:6 rtt:0.02/0.002 ato:4 mss:4096 pmtu:4500 rcvmss:536 advmss:4096 cwnd:10 bytes_sent:54823160 bytes_acked:54823121 bytes_received:54823120 segs_out:1370582 segs_in:1370580 data_segs_out:1370579 data_segs_in:1370578 send 16.4Gbps pacing_rate 32.6Gbps delivery_rate 1.72Gbps delivered:1370579 busy:26920ms unacked:1 rcv_rtt:34.615 rcv_space:65920 rcv_ssthresh:65535 minrtt:0.015 snd_wnd:65536 While we could argue this patch fixes a bug with RTAX_RTO_MIN, I do not add a Fixes: tag, so that we can soak it a bit before asking backports to stable branches. Signed-off-by: Eric Dumazet Acked-by: Soheil Hassas Yeganeh Acked-by: Neal Cardwell Signed-off-by: David S. Miller commit f68a181fcd3b6a22236794813d5c9e5a62efd2b4 Author: Eric Dumazet Date: Wed Sep 20 17:29:42 2023 +0000 tcp: constify tcp_rto_min() and tcp_rto_min_us() argument Make clear these functions do not change any field from TCP socket. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 5033f58d5feed1040eebeadb0c5efc95b8bf5720 Author: Eric Dumazet Date: Wed Sep 20 17:29:41 2023 +0000 net: constify sk_dst_get() and __sk_dst_get() argument Both helpers only read fields from their socket argument. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 0ebc7feae79ac07772a20382eebd8c3503313714 Author: Dr. David Alan Gilbert Date: Fri Aug 25 15:27:54 2023 +0100 powerpc: Use shared font data PowerPC has a 'btext' font used for the console which is almost identical to the shared font_sun8x16, so use it rather than duplicating the data. They were actually identical until about a decade ago when commit bcfbeecea11c ("drivers: console: font_: Change a glyph from "broken bar" to "vertical line"") which changed the | in the shared font to be a solid bar rather than a broken bar. That's the only difference. This was originally spotted by the PMF source code analyser, which noticed that sparc does the same thing with the same data, and they also share a bunch of functions to manipulate the data. I've previously posted a near identical patch for sparc. Tested very lightly with a boot without FS in qemu. Signed-off-by: "Dr. David Alan Gilbert" Signed-off-by: Michael Ellerman Link: https://msgid.link/20230825142754.1487900-1-linux@treblig.org commit 5ec12f1c7bac891c3268dd6e441a3755ca2b46e0 Author: Uwe Kleine-König Date: Sat Sep 23 12:08:06 2023 +0200 crypto: engine - Make crypto_engine_exit() return void All callers ignore the return value, so simplify by not providing one. Note that crypto_engine_exit() is typically called in a device driver's remove path (or the error path in probe), where errors cannot be handled anyhow. Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 0eb85cb3c8a78a5df09d8f91a246d5d068160b74 Author: Uwe Kleine-König Date: Sat Sep 23 12:08:05 2023 +0200 crypto: keembay - Don't pass errors to the caller in .remove() Returning an error code in the remove function of a platform device has no effect (compared to returning zero) apart from an error message, that the error is ignored. Then the device is removed irrespective of the returned value. As kmb_ocs_hcu_remove is only called after kmb_ocs_hcu_probe() returned successfully, platform_get_drvdata() never returns NULL and so the respective check can just be dropped. crypto_engine_exit() might return an error code but already emits an error message in that case, so better return zero in kmb_ocs_hcu_remove() even in this case to suppress another error message. All other crypto drivers also ignore the return value of crypto_engine_exit(). Signed-off-by: Uwe Kleine-König Signed-off-by: Herbert Xu commit 141f12be09ac693e2384a7999f6782c7750c30a5 Author: Kees Cook Date: Fri Sep 22 10:54:33 2023 -0700 crypto: qat - Annotate struct adf_fw_counters with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct adf_fw_counters. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Giovanni Cabiddu Cc: Herbert Xu Cc: "David S. Miller" Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Cc: Adam Guerin Cc: Lucas Segarra Fernandez Cc: Andy Shevchenko Cc: qat-linux@intel.com Cc: linux-crypto@vger.kernel.org Cc: llvm@lists.linux.dev Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Acked-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 4e4e2ed22d505c5bacf65c6a39bfb6d120d24785 Author: Giovanni Cabiddu Date: Fri Sep 22 10:03:47 2023 +0100 crypto: qat - increase size of buffers Increase the size of the buffers used for composing the names used for the transport debugfs entries and the vector name to avoid a potential truncation. This resolves the following errors when compiling the driver with W=1 and KCFLAGS=-Werror on GCC 12.3.1: drivers/crypto/intel/qat/qat_common/adf_transport_debug.c: In function ‘adf_ring_debugfs_add’: drivers/crypto/intel/qat/qat_common/adf_transport_debug.c:100:60: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=] drivers/crypto/intel/qat/qat_common/adf_isr.c: In function ‘adf_isr_resource_alloc’: drivers/crypto/intel/qat/qat_common/adf_isr.c:197:47: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size between 0 and 5 [-Werror=format-truncation=] Fixes: a672a9dc872e ("crypto: qat - Intel(R) QAT transport code") Signed-off-by: Giovanni Cabiddu Reviewed-by: Damian Muszynski Signed-off-by: Herbert Xu commit a8d3cdcc092fb2f2882acb6c20473a1be0ef4484 Author: Gaurav Jain Date: Thu Sep 21 18:12:37 2023 +0530 crypto: caam/jr - fix Chacha20 + Poly1305 self test failure key buffer is not copied in chachapoly_setkey function, results in wrong output for encryption/decryption operation. fix this by memcpy the key in caam_ctx key arrary Fixes: d6bbd4eea243 ("crypto: caam/jr - add support for Chacha20 + Poly1305") Signed-off-by: Gaurav Jain Signed-off-by: Herbert Xu commit 0baa8fab334a4d7017235b72fa8a547433572109 Author: Stephan Müller Date: Thu Sep 21 13:48:59 2023 +0200 crypto: jitter - Allow configuration of oversampling rate The oversampling rate used by the Jitter RNG allows the configuration of the heuristically implied entropy in one timing measurement. This entropy rate is (1 / OSR) bits of entropy per time stamp. Considering that the Jitter RNG now support APT/RCT health tests for different OSRs, allow this value to be configured at compile time to support systems with limited amount of entropy in their timer. The allowed range of OSR values complies with the APT/RCT cutoff health test values which range from 1 through 15. The default value of the OSR selection support is left at 1 which is the current default. Thus, the addition of the configuration support does not alter the default Jitter RNG behavior. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 59bcfd788552504606e3eb774ae68052379396b6 Author: Stephan Müller Date: Thu Sep 21 13:48:33 2023 +0200 crypto: jitter - Allow configuration of memory size The memory size consumed by the Jitter RNG is one contributing factor in the amount of entropy that is gathered. As the amount of entropy directly correlates with the distance of the memory from the CPU, the caches that are possibly present on a given system have an impact on the collected entropy. Thus, the kernel compile time should offer a means to configure the amount of memory used by the Jitter RNG. Although this option could be turned into a runtime option (e.g. a kernel command line option), it should remain a compile time option as otherwise adminsitrators who may not have performed an entropy assessment may select a value that is inappropriate. The default value selected by the configuration is identical to the current Jitter RNG value. Thus, the patch should not lead to any change in the Jitter RNG behavior. To accommodate larger memory buffers, kvzalloc / kvfree is used. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 04597c8dd6c4b55e946fec50dc3b14a5d9d54501 Author: Stephan Müller Date: Thu Sep 21 13:48:11 2023 +0200 crypto: jitter - add RCT/APT support for different OSRs The oversampling rate (OSR) value specifies the heuristically implied entropy in the recorded data - H_submitter = 1/osr. A different entropy estimate implies a different APT/RCT cutoff value. This change adds support for OSRs 1 through 15. This OSR can be selected by the caller of the Jitter RNG. For this patch, the caller still uses one hard-coded OSR. A subsequent patch allows this value to be configured. In addition, the power-up self test is adjusted as follows: * It allows the caller to provide an oversampling rate that should be tested with - commonly it should be the same as used for the actual runtime operation. This makes the power-up testing therefore consistent with the runtime operation. * It calls now jent_measure_jitter (i.e. collects the full entropy that can possibly be harvested by the Jitter RNG) instead of only jent_condition_data (which only returns the entropy harvested from the conditioning component). This should now alleviate reports where the Jitter RNG initialization thinks there is too little entropy. * The power-up test now solely relies on the (enhanced) APT and RCT test that is used as a health test at runtime. The code allowing the different OSRs as well as the power-up test changes are present in the user space version of the Jitter RNG 3.4.1 and thus was already in production use for some time. Reported-by "Ospan, Abylay" Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 7b8c6aee0d5b864e70c0da82583f9862e374eaf3 Author: Gaurav Jain Date: Thu Sep 21 15:14:44 2023 +0530 crypto: caam/qi2 - fix Chacha20 + Poly1305 self test failure key buffer is not copied in chachapoly_setkey function, results in wrong output for encryption/decryption operation. fix this by memcpy the key in caam_ctx key arrary Fixes: c10a53367901 ("crypto: caam/qi2 - add support for Chacha20 + Poly1305") Signed-off-by: Gaurav Jain Signed-off-by: Herbert Xu commit ff4e46104f2e105c95ea84bda6350cea471d285d Author: Gatien Chevallier Date: Thu Sep 21 10:03:00 2023 +0200 hwrng: stm32 - rework power management sequences Implement stm32_rng_suspend()/stm32_rng_resume() low-power APIs called when the hardware block context will be lost. There is no need to save the RNG_CR register in stm32_rng_runtime_suspend() as the context is not lost. Therefore, only enable/disable the RNG in the runtime sequences. Signed-off-by: Gatien Chevallier Signed-off-by: Herbert Xu commit a1b03e7ade409125712313c04a97242e18aae88e Author: Gatien Chevallier Date: Thu Sep 21 10:02:59 2023 +0200 hwrng: stm32 - support RNG configuration locking mechanism If "st,rng-lock-conf" DT binding property is set for a stm32-rng node, the RNG configuration will be locked until next hardware block reset or platform reset. Signed-off-by: Gatien Chevallier Signed-off-by: Herbert Xu commit 28d13f3fdbe52192e3a961ed489b542b111a098e Author: Gatien Chevallier Date: Thu Sep 21 10:02:58 2023 +0200 hwrng: stm32 - restrain RNG noise source clock For NIST certification the noise source sampling may need to be restrained. This change implements an algorithm that gets the rate of the RNG clock and apply the correct value in CLKDIV field in RNG_CR register to force the RNG clock rate to be "max_clock_rate" maximum. As it is platform-specific, implement it as a compat data. Signed-off-by: Gatien Chevallier Signed-off-by: Herbert Xu commit b17bc6eb7c2b089f4425b5b656184385acac77fe Author: Gatien Chevallier Date: Thu Sep 21 10:02:57 2023 +0200 hwrng: stm32 - rework error handling in stm32_rng_read() Try to conceal seed errors when possible. If, despite the error concealing tries, a seed error is still present, then return an error. A clock error does not compromise the hardware block and data can still be read from RNG_DR. Just warn that the RNG clock is too slow and clear RNG_SR. Signed-off-by: Gatien Chevallier Signed-off-by: Herbert Xu commit 8f1c5227eccb4e1c47b30bbe4a63b87535d12674 Author: Gatien Chevallier Date: Thu Sep 21 10:02:56 2023 +0200 hwrng: stm32 - implement error concealment The RNG driver should be capable of recovering from an error. Implement an error concealment API. This avoids irrecoverable RNG state. Signed-off-by: Gatien Chevallier Signed-off-by: Herbert Xu commit 6b85a7e141cbcea6dca677827544c39403b4c39a Author: Gatien Chevallier Date: Thu Sep 21 10:02:55 2023 +0200 hwrng: stm32 - implement STM32MP13x support The RNG present on STM32MP13x platforms introduces a customizable configuration and the conditional reset. STM32 RNG configuration should best fit the requirements of the platform. Therefore, put a platform-specific RNG configuration field in the platform data. Default RNG configuration for STM32MP13 is the NIST certified configuration [1]. While there, fix and the RNG init sequence to support all RNG versions. [1] https://csrc.nist.gov/projects/cryptographic-module-validation-program/entropy-validations/certificate/53 Signed-off-by: Gatien Chevallier Signed-off-by: Herbert Xu commit 18d9a8262bd4e481fac99c60a0bc2effd04fdea9 Author: Gatien Chevallier Date: Thu Sep 21 10:02:54 2023 +0200 hwrng: stm32 - use devm_platform_get_and_ioremap_resource() API Use devm_platform_get_and_ioremap_resource() to get and ioremap a resource. Signed-off-by: Gatien Chevallier Signed-off-by: Herbert Xu commit 0d2d67b48646b3b7d5f830525e3779a0f9efa424 Author: Gatien Chevallier Date: Thu Sep 21 10:02:53 2023 +0200 dt-bindings: rng: introduce new compatible for STM32MP13x Introduce st,stm32mp13-rng compatible and add st,rng-lock-conf. If st,rng-lock-conf is set, the RNG configuration in RNG_CR, RNG_HTCR and RNG_NSCR will be locked. It is supported starting from the RNG version present in the STM32MP13 Signed-off-by: Gatien Chevallier Reviewed-by: Rob Herring Signed-off-by: Herbert Xu commit 29b49013176ba066a41fc417e17f85dfdf3336c0 Author: Herbert Xu Date: Thu Sep 21 07:20:25 2023 +0800 ipsec: Select CRYPTO_AEAD Select CRYPTO_AEAD so that crypto_has_aead is available. Fixes: 1383e2ab102c ("ipsec: Stop using crypto_has_alg") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309202112.33V1Ezb1-lkp@intel.com/ Signed-off-by: Herbert Xu commit c6e2b6078a38dd98b04d13bc72ff620cae02e957 Author: Bartosz Golaszewski Date: Wed Sep 13 17:35:28 2023 +0200 dt-bindings: crypto: ice: document the sa8775p inline crypto engine Add the compatible string for QCom ICE on sa8775p SoCs. Signed-off-by: Bartosz Golaszewski Reviewed-by: Krzysztof Kozlowski Signed-off-by: Herbert Xu commit 0ce51459c8353b2b18ad3a430dbebf29af8b579c Author: Thomas Weißschuh Date: Fri Sep 29 19:39:00 2023 +0200 power: supply: core: remove opencoded string_lower() string_lower from string_helpers.h can be used to modify the string in-place. Use it to get rid of the custom str_to_lower(). Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20230929-power_supply-string_lower-v1-1-3141a2634d53@weissschuh.net Signed-off-by: Sebastian Reichel commit 15a4e422f3c9b041261b6810c90ce09d4ebe2a14 Author: Rob Herring Date: Tue Sep 26 11:44:42 2023 -0500 dt-bindings: power: supply: sbs-manager: Add missing unevaluatedProperties on child node schemas Just as unevaluatedProperties or additionalProperties are required at the top level of schemas, they should (and will) also be required for child node schemas. That ensures only documented properties are present for any node. Add unevaluatedProperties as needed, and then add any missing properties flagged by the addition. Signed-off-by: Rob Herring Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230926164446.101327-1-robh@kernel.org Signed-off-by: Sebastian Reichel commit 8f8e9b7388514d937843337140f18ceb0f3da6eb Author: Dan Carpenter Date: Wed Sep 27 15:41:05 2023 +0300 power: supply: mm8013: Fix an error checking issue in mm8013_checkdevice() There is a missing "ret = " assignment so this checks the same "ret" value twice. Fixes: c75f4bf6800b ("power: supply: Introduce MM8013 fuel gauge driver") Signed-off-by: Dan Carpenter Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/c46b4408-bf1d-408d-9e6b-16b0ad272532@moroto.mountain Signed-off-by: Sebastian Reichel commit bd94d501c0c99753497f8396e96738a560bac10e Author: Kees Cook Date: Fri Sep 15 13:06:12 2023 -0700 wifi: mt76: Annotate struct mt76_rx_tid with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mt76_rx_tid. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Felix Fietkau Cc: Lorenzo Bianconi Cc: Ryder Lee Cc: Shayne Chen Cc: Sean Wang Cc: Kalle Valo Cc: Matthias Brugger Cc: AngeloGioacchino Del Regno Cc: linux-wireless@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Felix Fietkau commit 09382d8f8641bc12fffc41a93eb9b37be0e653c0 Author: Ming Yen Hsieh Date: Sat Sep 30 10:25:09 2023 +0800 wifi: mt76: mt7921: update the channel usage when the regd domain changed The 5.9/6GHz channel license of a certain platform device has been regulated in various countries. That may be difference with standard Liunx regulatory domain settings. In this case, when .reg_notifier() called for regulatory change, mt792x chipset should update the channel usage based on clc or dts configurations. Channel would be disabled by following cases. * clc report the particular UNII-x is disabled. * dts enabled and the channel is not configured. Signed-off-by: Ming Yen Hsieh Co-developed-by: Deren Wu Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 4fc8df50fd41c2762d893211487be0ecb24c6a05 Author: Ming Yen Hsieh Date: Sat Sep 30 10:25:08 2023 +0800 wifi: mt76: mt7921: get regulatory information from the clc event The clc event can report the radio configuration for the corresponding country and the driver would take it as regulatory information of a certain platform device. This patch would change the clc commnad from no-waiting to waiting for event. For backward compatible, we also add a new nic capability tag to indicate the firmware did support this new clc event from now on. Signed-off-by: Ming Yen Hsieh Co-developed-by: Deren Wu Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 51ba0e3a15eb1643116a93674e230e11b9499592 Author: Ming Yen Hsieh Date: Sat Sep 30 10:25:07 2023 +0800 wifi: mt76: mt7921: add 6GHz power type support for clc There are several power type should be supported in 6GHz band. mt7921 apply 6GHz power type from AP settings and clc will setup the corresponding regulatory power. Signed-off-by: Ming Yen Hsieh Co-developed-by: Deren Wu Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 7801da3388567c78f79d5ed96a5527de264fdef7 Author: Ming Yen Hsieh Date: Sat Sep 30 10:25:06 2023 +0800 wifi: mt76: mt7921: enable set txpower for UNII-4 support power config for channel 165/173/177 Signed-off-by: Ming Yen Hsieh Signed-off-by: Felix Fietkau commit dab35009fc1c6dc1598e832016594161988d8f68 Author: Deren Wu Date: Sat Sep 30 10:25:05 2023 +0800 wifi: mt76: mt7921: move connac nic capability handling to mt7921 mt76_connac_mcu_get_nic_capability() is used by mt7921 only. It would be better to put the code in chip folder. And we can provide more chip capability information in mt792x_phy without making mt76_phy much bigger. The three functions would be moved to mt7921 folder and renamed. mt76_connac_mcu_parse_tx_resource() mt76_connac_mcu_parse_phy_cap() mt76_connac_mcu_get_nic_capability() Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit ef444ad00474bc5ebbcd4f6a2ea87f6fbe7977ce Author: Sean Wang Date: Wed Sep 27 06:20:25 2023 +0800 wifi: mt76: reduce spin_lock_bh held up in mt76_dma_rx_cleanup mt76_dma_rx_cleanup would be frequenetly called up to reset the dma rings to be freshed as new ones when switching back from the deep sleep mode to the active mode on mt7921 and mt7922. Shrink the scope of spin_lock_bh in mt76_dma_rx_cleanup being held up to allow the kernel scheduler to be able to switch other tasks in time by reducing the latency. Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 9585316a2aaf773a67846bdc8bbdd4df1e9622fa Author: Benjamin Lin Date: Thu Sep 21 14:04:03 2023 -0700 wifi: mt76: mt7996: remove periodic MPDU TXS request Remove periodic MPDU TXS request. Get TID and FrameType from SKB instead of TXWI, which is empty for Data Frame after MPDU TXS request is removed, hence prohibiting the establishment of TX BA session. Signed-off-by: Benjamin Lin Signed-off-by: Yi-Chia Hsieh Signed-off-by: Money Wang Signed-off-by: Peter Chiu Signed-off-by: Evelyn Tsai Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 2569ea5326e2a71149bf6be57ec24d98c703acf1 Author: Yi-Chia Hsieh Date: Thu Sep 21 14:04:02 2023 -0700 wifi: mt76: mt7996: enable PPDU-TxS to host Enable PPDU TxS by default. This makes the driver able to get Tx rate information from TxS. The driver will also refresh BA session timer on receive of PPDU TxS when WED is on. Signed-off-by: Yi-Chia Hsieh Signed-off-by: Money Wang Signed-off-by: Peter Chiu Signed-off-by: Evelyn Tsai Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit adde3eed4a75fe346d5ec1d78cd117e06bd70404 Author: Yi-Chia Hsieh Date: Thu Sep 21 14:04:01 2023 -0700 wifi: mt76: mt7996: Add mcu commands for getting sta tx statistic Per peer Tx/Rx statistic can only be obtained by querying WM when WED is on. This patch switches to periodic event reporting in the case of WED being enabled. Signed-off-by: Yi-Chia Hsieh Signed-off-by: Money Wang Signed-off-by: Peter Chiu Signed-off-by: Evelyn Tsai Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 2461599f835eeb0877a3ad7335f6c43b35960979 Author: Yi-Chia Hsieh Date: Thu Sep 21 14:04:00 2023 -0700 wifi: mt76: mt7996: get tx_retries and tx_failed from txfree Retrieve tx retries/failed counts from 'txfree done' events and report them via mt7996_sta_statistics(). Signed-off-by: Yi-Chia Hsieh Signed-off-by: Money Wang Signed-off-by: Peter Chiu Signed-off-by: Evelyn Tsai Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit 5ab7d466c4ace74ac46808ff6468f9a34ca0b350 Author: Lorenzo Bianconi Date: Thu Sep 21 12:23:48 2023 +0200 wifi: mt76: mt792x: move some common usb code in mt792x module Move the following shared usb routines in mt792x module: - mt792xu_stop - mt792x_stop Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 4d2cb56afaf7a96f04bab4c03506e4f5ad8f03db Author: Lorenzo Bianconi Date: Thu Sep 21 12:23:47 2023 +0200 wifi: mt76: mt792x: move mt7921_skb_add_usb_sdio_hdr in mt792x module Since mt7921_skb_add_usb_sdio_hdr is shared between mt7925 and mt7921 drivers, move it in mt792x module. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit f9940416f193d148dd7ad7498ce4f40c83d12e7a Author: Marc Zyngier Date: Wed Sep 27 10:09:11 2023 +0100 KVM: arm64: Clarify the ordering requirements for vcpu/RD creation It goes without saying, but it is probably better to spell it out: If userspace tries to restore and VM, but creates vcpus and/or RDs in a different order, the vcpu/RD mapping will be different. Yes, our API is an ugly piece of crap and I can't believe that we missed this. If we want to relax the above, we'll need to define a new userspace API that allows the mapping to be specified, rather than relying on the kernel to perform the mapping on its own. Reviewed-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230927090911.3355209-12-maz@kernel.org Signed-off-by: Oliver Upton commit b5daffb120bb60f974ae1a5589160b05c98e00e5 Author: Marc Zyngier Date: Wed Sep 27 10:09:10 2023 +0100 KVM: arm64: vgic-v3: Optimize affinity-based SGI injection Our affinity-based SGI injection code is a bit daft. We iterate over all the CPUs trying to match the set of affinities that the guest is trying to reach, leading to some very bad behaviours if the selected targets are at a high vcpu index. Instead, we can now use the fact that we have an optimised MPIDR to vcpu mapping, and only look at the relevant values. This results in a much faster injection for large VMs, and in a near constant time, irrespective of the position in the vcpu index space. As a bonus, this is mostly deleting a lot of hard-to-read code. Nobody will complain about that. Suggested-by: Xu Zhao Tested-by: Joey Gouly Tested-by: Shameer Kolothum Reviewed-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230927090911.3355209-11-maz@kernel.org Signed-off-by: Oliver Upton commit 54a8006d0b49044d0cb682119686a45de906fe3c Author: Marc Zyngier Date: Wed Sep 27 10:09:09 2023 +0100 KVM: arm64: Fast-track kvm_mpidr_to_vcpu() when mpidr_data is available If our fancy little table is present when calling kvm_mpidr_to_vcpu(), use it to recover the corresponding vcpu. Reviewed-by: Joey Gouly Reviewed-by: Zenghui Yu Tested-by: Joey Gouly Tested-by: Shameer Kolothum Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230927090911.3355209-10-maz@kernel.org Signed-off-by: Oliver Upton commit 5544750efd51143fee9e9184d69518c0c05426a1 Author: Marc Zyngier Date: Wed Sep 27 10:09:08 2023 +0100 KVM: arm64: Build MPIDR to vcpu index cache at runtime The MPIDR_EL1 register contains a unique value that identifies the CPU. The only problem with it is that it is stupidly large (32 bits, once the useless stuff is removed). Trying to obtain a vcpu from an MPIDR value is a fairly common, yet costly operation: we iterate over all the vcpus until we find the correct one. While this is cheap for small VMs, it is pretty expensive on large ones, specially if you are trying to get to the one that's at the end of the list... In order to help with this, it is important to realise that the MPIDR values are actually structured, and that implementations tend to use a small number of significant bits in the 32bit space. We can use this fact to our advantage by computing a small hash table that uses the "compression" of the significant MPIDR bits as an index, giving us the vcpu index as a result. Given that the MPIDR values can be supplied by userspace, and that an evil VMM could decide to make *all* bits significant, resulting in a 4G-entry table, we only use this method if the resulting table fits in a single page. Otherwise, we fallback to the good old iterative method. Nothing uses that table just yet, but keep your eyes peeled. Reviewed-by: Joey Gouly Reviewed-by: Zenghui Yu Tested-by: Joey Gouly Tested-by: Shameer Kolothum Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230927090911.3355209-9-maz@kernel.org Signed-off-by: Oliver Upton commit 0a2acd38d23b8865b3a5a8c851001350df76fc09 Author: Marc Zyngier Date: Wed Sep 27 10:09:07 2023 +0100 KVM: arm64: Simplify kvm_vcpu_get_mpidr_aff() By definition, MPIDR_EL1 cannot be modified by the guest. This means it is pointless to check whether this is loaded on the CPU. Simplify the kvm_vcpu_get_mpidr_aff() helper to directly access the in-memory value. Reviewed-by: Joey Gouly Reviewed-by: Zenghui Yu Tested-by: Joey Gouly Tested-by: Shameer Kolothum Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230927090911.3355209-8-maz@kernel.org Signed-off-by: Oliver Upton commit 5f4bd815ec718992c09de1f39479ae90dcbb7df3 Author: Marc Zyngier Date: Wed Sep 27 10:09:06 2023 +0100 KVM: arm64: Use vcpu_idx for invalidation tracking While vcpu_id isn't necessarily a bad choice as an identifier for the currently running vcpu, it is provided by userspace, and there is close to no guarantee that it would be unique. Switch it to vcpu_idx instead, for which we have much stronger guarantees. Reviewed-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230927090911.3355209-7-maz@kernel.org Signed-off-by: Oliver Upton commit ac0fe56d46c0d534dddcf97d132c222722b9b7a5 Author: Marc Zyngier Date: Wed Sep 27 10:09:05 2023 +0100 KVM: arm64: vgic: Use vcpu_idx for the debug information When dumping the debug information, use vcpu_idx instead of vcpu_id, as this is independent of any userspace influence. Reviewed-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230927090911.3355209-6-maz@kernel.org Signed-off-by: Oliver Upton commit 4e7728c81a54b17bd33be402ac140bc11bb0c4f4 Author: Marc Zyngier Date: Wed Sep 27 10:09:04 2023 +0100 KVM: arm64: vgic-v2: Use cpuid from userspace as vcpu_id When parsing a GICv2 attribute that contains a cpuid, handle this as the vcpu_id, not a vcpu_idx, as userspace cannot really know the mapping between the two. For this, use kvm_get_vcpu_by_id() instead of kvm_get_vcpu(). Take this opportunity to get rid of the pointless check against online_vcpus, which doesn't make much sense either, and switch to FIELD_GET as a way to extract the vcpu_id. Reviewed-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230927090911.3355209-5-maz@kernel.org Signed-off-by: Oliver Upton commit f3f60a56539108dacfd87b6514398b3970daec54 Author: Marc Zyngier Date: Wed Sep 27 10:09:03 2023 +0100 KVM: arm64: vgic-v3: Refactor GICv3 SGI generation As we're about to change the way SGIs are sent, start by splitting out some of the basic functionnality: instead of intermingling the broadcast and non-broadcast cases with the actual SGI generation, perform the following cleanups: - move the SGI queuing into its own helper - split the broadcast code from the affinity-driven code - replace the mask/shift combinations with FIELD_GET() - fix the confusion between vcpu_id and vcpu when handling the broadcast case The result is much more readable, and paves the way for further optimisations. Tested-by: Joey Gouly Tested-by: Shameer Kolothum Reviewed-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230927090911.3355209-4-maz@kernel.org Signed-off-by: Oliver Upton commit d455d366c451e68781122c693e2e357c673ee807 Author: Marc Zyngier Date: Wed Sep 27 10:09:02 2023 +0100 KVM: arm64: vgic-its: Treat the collection target address as a vcpu_id Since our emulated ITS advertises GITS_TYPER.PTA=0, the target address associated to a collection is a PE number and not an address. So far, so good. However, the PE number is what userspace has provided given us (aka the vcpu_id), and not the internal vcpu index. Make sure we consistently retrieve the vcpu by ID rather than by index, adding a helper that deals with most of the cases. We also get rid of the pointless (and bogus) comparisons to online_vcpus, which don't really make sense. Reviewed-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230927090911.3355209-3-maz@kernel.org Signed-off-by: Oliver Upton commit 9a0a75d3ccee20149587ab740a2dee31ba401ada Author: Marc Zyngier Date: Wed Sep 27 10:09:01 2023 +0100 KVM: arm64: vgic: Make kvm_vgic_inject_irq() take a vcpu pointer Passing a vcpu_id to kvm_vgic_inject_irq() is silly for two reasons: - we often confuse vcpu_id and vcpu_idx - we eventually have to convert it back to a vcpu - we can't count Instead, pass a vcpu pointer, which is unambiguous. A NULL vcpu is also allowed for interrupts that are not private to a vcpu (such as SPIs). Reviewed-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230927090911.3355209-2-maz@kernel.org Signed-off-by: Oliver Upton commit 81af5418049ff673ddad0ba9377230bdb13a1f24 Author: Felix Fietkau Date: Mon Mar 20 20:47:04 2023 +0100 wifi: mt76: mt7915 add tc offloading support This is used for offloading flows from WLAN to Ethernet, or from WLAN to WLAN Signed-off-by: Felix Fietkau commit c948b5da6bbec742b433138e3e3f9537a85af2e5 Author: Deren Wu Date: Mon Sep 18 17:30:54 2023 +0800 wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips Add mt7925, a new mac80211 driver for the MediaTek Wi-Fi 7 (802.11be) device Filogic 360, which can support Station, AP, P2P, and monitor modes. Filogic 360 supports max 4096-QAM/160MHz radio operation at 6 GHz, 5 GHz, or 2.4 GHz with 2x2 antennas. This chip supports PCIe and USB bus type. mt7925 supports Wi-Fi 6E and EHT rate with single link only at this moment, whereas Wi-Fi 7 and its specific features are working in progress. They will be introduced in further patches. The driver is build tested by Intel's kernel test robot with both GCC and Clang with several architecture. Sparse reports no warnings. There are multiple authors, they are listed in alphabetical order below. Co-developed-by: Hao Zhang Signed-off-by: Hao Zhang Co-developed-by: Leon Yen Signed-off-by: Leon Yen Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Co-developed-by: Mingyen Hsieh Signed-off-by: Mingyen Hsieh Co-developed-by: Nelson Yu Signed-off-by: Nelson Yu Co-developed-by: Quan Zhou Signed-off-by: Quan Zhou Co-developed-by: Rong Yan Signed-off-by: Rong Yan Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit c558d22e7a93affeb18aae1dcd777ddd1ad18da1 Author: Sean Wang Date: Mon Sep 18 16:03:08 2023 +0800 wifi: mt76: mt7921: fix the wrong rate selected in fw for the chanctx driver The variable band should be determined by the ieee80211_chanctx_conf when the driver is a kind of chanctx one e.g mt7921 and mt7922 driver so we added the extension to mt76_connac2_mac_tx_rate_val and mt76_connac_get_he_phy_cap for the firmware can select the proper rate. Fixes: 41ac53c899bd ("wifi: mt76: mt7921: introduce chanctx support") Signed-off-by: Sean Wang Tested-by: David Ruth Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 32b1000db221df33ec8b57794a091ba6075b6c28 Author: Sean Wang Date: Mon Sep 18 16:03:07 2023 +0800 wifi: mt76: mt7921: fix the wrong rate pickup for the chanctx driver The variable band should be determined by the ieee80211_chanctx_conf when the driver is a kind of chanctx one e.g mt7921 and mt7922 driver so we added the extension to mt76_connac2_mac_tx_rate_val by distinguishing if it can support chanctx to fix the incorrect rate pickup. Fixes: 41ac53c899bd ("wifi: mt76: mt7921: introduce chanctx support") Signed-off-by: Sean Wang Reviewed-by: David Ruth Tested-by: David Ruth Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit f50206555992abb802cee4e3f951d1ea669cb8bc Author: Sean Wang Date: Mon Sep 18 16:03:06 2023 +0800 wifi: mt76: move struct ieee80211_chanctx_conf up to struct mt76_vif Move struct ieee80211_chanctx_conf up to struct mt76_vif to allow the connac2 library can access the struct ieee80211_chanctx_conf * member in struct mt76_vif. Signed-off-by: Sean Wang Reviewed-by: David Ruth Tested-by: David Ruth Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 1f39e1d95a210ac98422b5111962f9bb9f2428a4 Author: Jinjie Ruan Date: Sun Sep 3 11:02:16 2023 +0800 wifi: mt76: Drop unnecessary error check for debugfs_create_dir() debugfs_create_dir() returns ERR_PTR and never return NULL. As Russell suggested, this patch removes the error checking for debugfs_create_dir(). This is because the DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes. The debugfs APIs have a IS_ERR() judge in start_creating() which can handle it gracefully. So these checks are unnecessary. Fixes: 17f1de56df05 ("mt76: add common code shared between multiple chipsets") Signed-off-by: Jinjie Ruan Suggested-by: Russell King (Oracle) Signed-off-by: Felix Fietkau commit ced1a0b8f3944e44e7f4eb3772dea1bada25d38a Author: MeiChia Chiu Date: Thu Aug 31 14:22:21 2023 +0800 wifi: mt76: mt7915: fix beamforming availability check Without this patch, when ap sets the tx stream number to 2, ap won't send any beamforming packet. Fixes: f89f297aef28 ("mt76: mt7915: fix txbf starec TLV issues") Signed-off-by: MeiChia Chiu Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit 3d5a42905a7299a1b36052eabc127e6e8dbaca47 Author: Peter Chiu Date: Thu Aug 31 14:22:20 2023 +0800 wifi: mt76: mt7915: update mpdu density capability Set mpdu density to 2 usec for non-mt7915 Wi-Fi 6 generation chipsets to align to the hardware capability which improves the throughput. Signed-off-by: Peter Chiu Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit 8234324ae90948a4e5bfaebe042c51c400cf017a Author: Peter Chiu Date: Thu Aug 31 14:22:19 2023 +0800 wifi: mt76: check vif type before reporting cca and csa Do not report cca and csa finish to upper layer on station type vif to prevent warnings caused by setting beacon. Signed-off-by: Peter Chiu Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit c685034cabc574dbdf16fa675010e202083cb4c2 Author: Shayne Chen Date: Thu Aug 31 14:22:18 2023 +0800 wifi: mt76: fix per-band IEEE80211_CONF_MONITOR flag comparison Use the correct ieee80211_conf of each band for IEEE80211_CONF_MONITOR comparison. Fixes: 24e69f6bc3ca ("mt76: fix monitor rx FCS error in DFS channel") Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit 413f05d68d11981f5984b49214d3a5a0d88079b1 Author: StanleyYP Wang Date: Thu Aug 31 14:22:17 2023 +0800 wifi: mt76: get rid of false alamrs of tx emission issues When the set_chan_info command is set with CH_SWITCH_NORMAL reason, even if the action is UNI_CHANNEL_RX_PATH, it'll still generate some unexpected tones, which might confuse DFS CAC tests that there are some tone leakages. To get rid of these kinds of false alarms, always bypass DPD calibration when IEEE80211_CONF_IDLE is set. Reviewed-by: Evelyn Tsai Signed-off-by: StanleyYP Wang Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit d6a2f91741d9f43b31cb16c82da37f35117a6d1c Author: Bo Jiao Date: Thu Aug 31 14:22:16 2023 +0800 wifi: mt76: fix potential memory leak of beacon commands Fix potential memory leak when setting beacon and inband discovery commands. Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets") Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Bo Jiao Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit aad094be9f442a5d6dc72626594ff687749dfbf9 Author: Allen Ye Date: Thu Aug 31 14:22:15 2023 +0800 wifi: mt76: check sta rx control frame to multibss capability Add CAP3_RX_CTRL_FRAME_TO_MULTIBSS check when setting sta_muru_tlv, which is used to get stations's capability of receiving control frames when running OFDMA with MBSSIDs. Signed-off-by: Allen Ye Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit de869f81f994c4a4dea0d70921ac5ab78858b224 Author: MeiChia Chiu Date: Thu Aug 31 14:22:14 2023 +0800 wifi: mt76: update beacon size limitation To accommodate 11v MBSSID IE and support maximum 16 MBSSIDs, expand the beacon size limitation for beacon and inband discovery commands. Co-developed-by: Peter Chiu Signed-off-by: Peter Chiu Co-developed-by: Money Wang Signed-off-by: Money Wang Signed-off-by: MeiChia Chiu Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit e35f43aa34d36e6cb1de00705c08026b023ef5ed Author: Chank Chen Date: Thu Aug 31 14:22:13 2023 +0800 wifi: mt76: connac: add MBSSID support for mt7996 Add bss_info_uni_mbssid tag and implement 802.11v MBSSID support for mt7996 chipsets. Signed-off-by: Chank Chen Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit 03f0e11da7fb26db4f27e6b83a223512db9f7ca5 Author: Dmitry Antipov Date: Tue Aug 29 12:43:49 2023 +0300 wifi: mt76: fix clang-specific fortify warnings When compiling with clang 16.0.6 and CONFIG_FORTIFY_SOURCE=y, I've noticed the following (somewhat confusing due to absence of an actual source code location): In file included from drivers/net/wireless/mediatek/mt76/mt792x_core.c:4: In file included from ./include/linux/module.h:13: In file included from ./include/linux/stat.h:19: In file included from ./include/linux/time.h:60: In file included from ./include/linux/time32.h:13: In file included from ./include/linux/timex.h:67: In file included from ./arch/x86/include/asm/timex.h:5: In file included from ./arch/x86/include/asm/processor.h:23: In file included from ./arch/x86/include/asm/msr.h:11: In file included from ./arch/x86/include/asm/cpumask.h:5: In file included from ./include/linux/cpumask.h:12: In file included from ./include/linux/bitmap.h:11: In file included from ./include/linux/string.h:254: ./include/linux/fortify-string.h:592:4: warning: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] __read_overflow2_field(q_size_field, size); In file included from drivers/net/wireless/mediatek/mt76/mt7915/main.c:4: In file included from ./include/linux/etherdevice.h:20: In file included from ./include/linux/if_ether.h:19: In file included from ./include/linux/skbuff.h:15: In file included from ./include/linux/time.h:60: In file included from ./include/linux/time32.h:13: In file included from ./include/linux/timex.h:67: In file included from ./arch/x86/include/asm/timex.h:5: In file included from ./arch/x86/include/asm/processor.h:23: In file included from ./arch/x86/include/asm/msr.h:11: In file included from ./arch/x86/include/asm/cpumask.h:5: In file included from ./include/linux/cpumask.h:12: In file included from ./include/linux/bitmap.h:11: In file included from ./include/linux/string.h:254: ./include/linux/fortify-string.h:592:4: warning: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] __read_overflow2_field(q_size_field, size); In file included from drivers/net/wireless/mediatek/mt76/mt7996/main.c:6: In file included from drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h:9: In file included from ./include/linux/interrupt.h:8: In file included from ./include/linux/cpumask.h:12: In file included from ./include/linux/bitmap.h:11: In file included from ./include/linux/string.h:254: ./include/linux/fortify-string.h:592:4: warning: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] __read_overflow2_field(q_size_field, size); The compiler actually complains on 'mt7915_get_et_strings()', 'mt792x_get_et_strings()' and 'mt7996_get_et_strings()' due to the same reason: fortification logic inteprets call to 'memcpy()' as an attempt to copy the whole array from its first member and so issues an overread warning. These warnings may be silenced by passing an address of the whole array and not the first member to 'memcpy()'. Signed-off-by: Dmitry Antipov Signed-off-by: Felix Fietkau commit fce9c967820a72f600abbf061d7077861685a14d Author: Ingo Rohloff Date: Sat Aug 26 22:02:41 2023 +0200 wifi: mt76: mt7921e: Support MT7992 IP in Xiaomi Redmibook 15 Pro (2023) In the Xiaomi Redmibook 15 Pro (2023) laptop I have got, a wifi chip is used, which according to its PCI Vendor ID is from "ITTIM Technology". This chip works flawlessly with the mt7921e module. The driver doesn't bind to this PCI device, because the Vendor ID from "ITTIM Technology" is not recognized. This patch adds the PCI Vendor ID from "ITTIM Technology" to the list of PCI Vendor IDs and lets the mt7921e driver bind to the mentioned wifi chip. Signed-off-by: Ingo Rohloff Signed-off-by: Felix Fietkau commit ed160b600ffc1a23fe04c6e8c1b0210f70c45d39 Author: Jinjie Ruan Date: Tue Aug 22 14:30:36 2023 +0800 wifi: mt76: Use PTR_ERR_OR_ZERO() to simplify code Return PTR_ERR_OR_ZERO() instead of return 0 or PTR_ERR() to simplify code. Signed-off-by: Jinjie Ruan Signed-off-by: Felix Fietkau commit 377844a7c4871a049734d79a9d9b0b31112eefb1 Author: Jen-Hao Cheng Date: Thu Aug 17 16:01:54 2023 +0800 wifi: mt76: mt7996: support per-band LED control Extend settings of LED registers to support per-band configuration. Signed-off-by: Jen-Hao Cheng Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit 005c3f5914a81780278a50f8ad56474dcb633c6f Author: Howard Hsu Date: Thu Aug 17 16:01:53 2023 +0800 wifi: mt76: mt7996: support more options for mt7996_set_bitrate_mask() Add support to configure parameters at runtime, such as mcs, gi, and he_ltf. Note that EHT mode does not support this feature yet. Co-developed-by: MeiChia Chiu Signed-off-by: MeiChia Chiu Signed-off-by: Howard Hsu Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit 11ca0163970bd9fba896c7f5bf7e345af7736998 Author: Shayne Chen Date: Thu Aug 17 16:01:52 2023 +0800 wifi: mt76: mt7996: only set vif teardown cmds at remove interface Only send commands that disable vif when removing interface, this reduces some unnecessary bss_info and sta_rec commands, especially for station interface. Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit 84f313b7392f6501f05d8981105d79859b1252cb Author: Peter Chiu Date: Thu Aug 17 16:01:51 2023 +0800 wifi: mt76: mt7996: fix TWT command format Align the command format of UNI_CMD_TWT_ARGT_UPDATE to firmware. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Peter Chiu Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit 0197923ecf5eb4dbd785f5576040d49611f591a4 Author: Peter Chiu Date: Thu Aug 17 16:01:50 2023 +0800 wifi: mt76: mt7996: fix rx rate report for CBW320-2 RX vector reports channel bandwidth 320-1 and 320-2 with different values. Fix it to correctly report rx rate when using CBW320-2. Fixes: 80f5a31d2856 ("wifi: mt76: mt7996: add support for EHT rate report") Signed-off-by: Peter Chiu Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit 9b11696e5c5bf6030a32571f3f88845226d8b662 Author: Peter Chiu Date: Thu Aug 17 16:01:49 2023 +0800 wifi: mt76: mt7996: fix wmm queue mapping Firmware uses access class index (ACI) for wmm parameters update, so convert mac80211 queue to ACI in mt7996_conf_tx(). Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Peter Chiu Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit e19028104b2de5510b43282f632c4b6453568c41 Author: Howard Hsu Date: Thu Aug 17 16:01:48 2023 +0800 wifi: mt76: mt7996: fix beamformee ss subfield in EHT PHY cap According to P802.11be_D3.2 Table 9-404m, the minimum value of Beamformee SS field shall be 3. Fix the values to follow the spec. Fixes: 348533eb968d ("wifi: mt76: mt7996: add EHT capability init") Signed-off-by: Howard Hsu Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit d40fd59b7267d2e7722d3edf3935a9a9f03c0115 Author: Howard Hsu Date: Thu Aug 17 16:01:47 2023 +0800 wifi: mt76: mt7996: fix beamform mcu cmd configuration The bf_num field represents how many bands can support beamform, so set the value to 3, and bf_bitmap represents the bitmap of bf_num. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Howard Hsu Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit bde2e77f76266fbd81ff74cb12b3d87f9460b1e0 Author: Peter Chiu Date: Thu Aug 17 16:01:46 2023 +0800 wifi: mt76: mt7996: set correct wcid in txp Set correct wcid in txp to let the SDO hw module look into the correct wtbl, otherwise the tx descriptor may be wrongly fiiled. This patch also fixed the issue that driver could not correctly report sta statistics, especially in WDS mode, which misled AQL. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Co-developed-by: Michael-CY Lee Signed-off-by: Michael-CY Lee Signed-off-by: Peter Chiu Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit ebe81e6b8659bbae5d76c0b292e38abe4aa0cb1d Author: Deren Wu Date: Tue Aug 1 22:30:32 2023 +0800 wifi: mt76: connac: add more unified event IDs Add more unified event IDs which will be used in new chipset. This is the preliminary patch for mt7925 support. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 3c1199134874d567afe5771721af28a804d78977 Author: Deren Wu Date: Tue Aug 1 22:30:31 2023 +0800 wifi: mt76: connac: add more unified command IDs Add more unified command IDs which will be used in new chipset. This is the preliminary patch for mt7925 support. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 473f26fb167e2cb93a4e75a3cec6c6fe173505c9 Author: Deren Wu Date: Tue Aug 1 22:30:30 2023 +0800 wifi: mt76: connac: add data field in struct tlv Add tlv->data element for tlv parsing easier. This is a preliminary patch to support mt7925 driver. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 975cd4d6d547936aaae6fae0cb4bdc9a18ecc2f8 Author: Deren Wu Date: Tue Aug 1 22:30:29 2023 +0800 wifi: mt76: connac: add eht support for tx power Add eht field in struct mt76_power_limits for 802.11be power config. The function stack size would be too big by eht adding in structure, we also refactor mt76_connac_mcu_rate_txpower_band() to take dynamic allocated memory instead. This is a preliminary patch to support mt7925 driver. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit e9eac4eb1bbdeac5b05de085062591dfe1460396 Author: Deren Wu Date: Tue Aug 1 22:30:28 2023 +0800 wifi: mt76: connac: add eht support for phy mode config Add eht configuration support in existing function mt76_connac_get_phy_mode_v2() and export it for mt7925. This is a preliminary patch to support mt7925 driver. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit d3d7f57e5c1c6e0337a72944f242ed2c8b028861 Author: Deren Wu Date: Tue Aug 1 22:30:27 2023 +0800 wifi: mt76: connac: export functions for mt7925 mt7925 rely on the similar functionalities in connac layer. Export them for mt7925 reuse. This is a preliminary patch to support mt7925 driver. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 69f94b9fab06af98f9b3fbd0dc3d9e8ae3c8bd26 Author: Deren Wu Date: Tue Aug 1 22:30:26 2023 +0800 wifi: mt76: mt792x: support mt7925 chip init add firmware download and dma init support for mt7925. This is a preliminary patch to support mt7925 driver. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 525209262f9c2999f6f5fa0c40b4519cd6acfa2e Author: Deren Wu Date: Tue Aug 1 22:30:25 2023 +0800 wifi: mt76: connac: introduce helper for mt7925 chipset Introduce is_mt7925() helper for new chipset. mt7925 runs the same firmware download and mmio map flow as mt7921. This is a preliminary patch to support mt7925 driver. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit b2491018587a4aca6ea398bbad8f142306b8e086 Author: Felix Fietkau Date: Thu Aug 31 15:13:01 2023 +0200 wifi: mt76: mt7915: fix monitor mode issues Enable receiving other-unicast packets Disable RX header translation in order to proprerly receive data packets. Fixes warnings and missed packets when rx decap offload is enabled Signed-off-by: Felix Fietkau commit 5d0e7dde4a688948e701939bc7d3fe9adf8786c5 Author: Dmitry Antipov Date: Fri Sep 1 11:19:04 2023 +0300 wifi: mt76: add DMA mapping error check in mt76_alloc_txwi() Add 'dma_mapping_error()' check in 'mt76_alloc_txwi()'. Signed-off-by: Dmitry Antipov Signed-off-by: Felix Fietkau commit 832f42699791e7a90e81c15da0ce886b4f8300b8 Author: Felix Fietkau Date: Mon Sep 11 15:15:18 2023 +0200 wifi: mt76: remove unused error path in mt76_connac_tx_complete_skb The error handling code was added in order to allow tx enqueue to fail after calling .tx_prepare_skb. Since this can no longer happen, the error handling code is unused. Signed-off-by: Felix Fietkau commit 0335c034e7265d36d956e806f33202c94a8a9860 Author: Felix Fietkau Date: Tue Aug 29 10:39:53 2023 +0200 wifi: mt76: fix race condition related to checking tx queue fill status When drv_tx calls race against local tx scheduling, the queue fill status checks can potentially race, leading to dma queue entries being overwritten. Fix this by deferring packets from drv_tx calls to the tx worker, in order to ensure that all regular queue tx comes from the same context. Reported-by: Ryder Lee Signed-off-by: Felix Fietkau commit debd133ab2e2e06989c24e1a72be2b7997f30456 Author: Johannes Berg Date: Mon Aug 28 17:18:31 2023 +0200 wifi: mt76: use atomic iface iteration for pre-TBTT work In addition to the previous series I posted, over time I'd also like to get rid of the iflist_mtx in mac80211. That isn't easy now since lots of places use iteration and would have to be audited, but even a cursory look suggests that mt76 might be more problematic than most since holding the wiphy lock for the latency-sensitive pre-TBTT work could be an issue. Convert the pre-TBTT work to use atomic iteration and then sending the device commands outside of it. Signed-off-by: Johannes Berg Signed-off-by: Felix Fietkau commit c2fcc83b41a64ae3baa12dfb7ee5d8587373493d Author: Felix Fietkau Date: Mon Aug 14 14:10:51 2023 +0200 wifi: mt76: mt7603: disable A-MSDU tx support on MT7628 It was reported that this can cause the PSE hang issues, even with a low number of fragments. Link: https://github.com/openwrt/mt76/issues/793#issuecomment-1676529138 Signed-off-by: Felix Fietkau commit 19e4f271d62e14e92d15bebddc567dab2eb47535 Author: Felix Fietkau Date: Fri Jul 28 16:23:47 2023 +0200 wifi: mt76: mt7603: add missing register initialization for MT7628 Ported from the vendor driver code Signed-off-by: Felix Fietkau commit 3176205933494bd184c6acd70e796c382bc729b5 Author: Felix Fietkau Date: Fri Jul 28 16:21:18 2023 +0200 wifi: mt76: mt7603: improve stuck beacon handling Before preparing the new beacon, check the queue status, flush out all previous beacons and buffered multicast packets, then (if necessary) try to recover more gracefully from a stuck beacon condition by making a less invasive attempt at getting the MAC un-stuck. Fixes: c8846e101502 ("mt76: add driver for MT7603E and MT7628/7688") Signed-off-by: Felix Fietkau commit c677dda165231c3efffb9de4bace249d5d2a51b9 Author: Felix Fietkau Date: Fri Jul 28 16:04:40 2023 +0200 wifi: mt76: mt7603: improve watchdog reset reliablity Only trigger PSE reset if PSE was stuck, otherwise it can cause DMA issues. Trigger the PSE reset while DMA is fully stopped in order to improve reliabilty. Fixes: c8846e101502 ("mt76: add driver for MT7603E and MT7628/7688") Signed-off-by: Felix Fietkau commit baa19b2e4b7bbb509a7ca7939c8785477dcd40ee Author: Felix Fietkau Date: Fri Jul 28 09:51:01 2023 +0200 wifi: mt76: mt7603: rework/fix rx pse hang check It turns out that the code in mt7603_rx_pse_busy() does not detect actual hardware hangs, it only checks for busy conditions in PSE. A reset should only be performed if these conditions are true and if there is no rx activity as well. Reset the counter whenever a rx interrupt occurs. In order to also deal with a fully loaded CPU that leaves interrupts disabled with continuous NAPI polling, also check for pending rx interrupts in the function itself. Fixes: c8846e101502 ("mt76: add driver for MT7603E and MT7628/7688") Signed-off-by: Felix Fietkau commit 236f3873b517acfaf949c23bb2d5dec13bfd2da2 Merge: 7c7dd1d64910d 170911bb1b046 Author: David S. Miller Date: Sat Sep 30 18:49:14 2023 +0100 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== ice: add PTP auxiliary bus support Michal Michalik says: Auxiliary bus allows exchanging information between PFs, which allows both fixing problems and simplifying new features implementation. The auxiliary bus is enabled for all devices supported by ice driver. ==================== Signed-off-by: David S. Miller commit c04bf723ccd639250fa680a0fb4e1ac15bb84c3b Author: Vincent Donnefort Date: Thu Sep 28 18:32:03 2023 +0100 KVM: arm64: Do not transfer page refcount for THP adjustment GUP affects a refcount common to all pages forming the THP. There is therefore no need to move the refcount from a tail to the head page. Under the hood it decrements and increments the same counter. Signed-off-by: Vincent Donnefort Reviewed-by: Gavin Shan Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20230928173205.2826598-2-vdonnefort@google.com Signed-off-by: Oliver Upton commit 68ede283a1d8fe0813b218aeb498faf3b0fc0a7b Author: Justin Stitt Date: Sat Sep 30 09:32:31 2023 -0700 Input: axp20x-pek - avoid needless newline removal This code is doing more work than it needs to. Before handing off `val_str` to `kstrtouint()` we are eagerly removing any trailing newline which requires copying `buf`, validating it's length and checking/replacing any potential newlines. kstrtouint() handles this implicitly: kstrtouint -> kstrotoull -> (documentation) | /** | * kstrtoull - convert a string to an unsigned long long | * @s: The start of the string. The string must be null-terminated, and may also | * include a single newline before its terminating null. The first character | ... Let's remove the redundant functionality and let kstrtouint handle it. Suggested-by: Kees Cook Signed-off-by: Justin Stitt Reviewed-by: Chen-Yu Tsai Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230925-strncpy-drivers-input-misc-axp20x-pek-c-v2-1-ff7abe8498d6@google.com Signed-off-by: Dmitry Torokhov commit 348cbf987ed328682af7d74ce98d9f0e6857f42f Author: Kees Cook Date: Sat Sep 30 09:20:20 2023 -0700 Input: mt - annotate struct input_mt with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct input_mt. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922175036.work.762-kees@kernel.org Signed-off-by: Dmitry Torokhov commit 21d7ec79ef5b1c23495dd88e5679c1a1d6dd17ae Author: Kees Cook Date: Sat Sep 30 09:19:13 2023 -0700 Input: leds - annotate struct input_leds with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct input_leds. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922175031.work.467-kees@kernel.org Signed-off-by: Dmitry Torokhov commit 8927e688e9e0ae625af6a917bace8cc9cac55677 Author: Kees Cook Date: Sat Sep 30 09:17:43 2023 -0700 Input: evdev - annotate struct evdev_client with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct evdev_client. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922175027.work.563-kees@kernel.org Signed-off-by: Dmitry Torokhov commit 96609688ab8a8ec25c4eeced53e88e26cff4fb06 Author: Justin Stitt Date: Sat Sep 30 09:05:07 2023 -0700 Input: synaptics-rmi4 - replace deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] Let's use memcpy() as the bounds have already been checked and this decays into a simple byte copy from one buffer to another removing any ambiguity that strncpy has. Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230921-strncpy-drivers-input-rmi4-rmi_f34-c-v1-1-4aef2e84b8d2@google.com Signed-off-by: Dmitry Torokhov commit 91951d36c2231c84be8266b2e852e59a552e66d0 Author: Arthur Grillo Date: Mon Sep 18 20:51:05 2023 -0300 drm/tests: Add new format conversion tests to better cover drm_fb_blit() To fully cover drm_fb_blit(), add format conversion tests that are only supported through drm_fb_blit(). Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230918-final-gsoc-v3-2-b999c042a4cc@riseup.net commit 15bda1f8de5d192fb003c63c4d13cf53d9ae4590 Author: Arthur Grillo Date: Mon Sep 18 20:51:04 2023 -0300 drm/tests: Add calls to drm_fb_blit() on supported format conversion tests Add a call to drm_fb_blit() on existing format conversion tests that has support. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230918-final-gsoc-v3-1-b999c042a4cc@riseup.net commit 8ab5bf1a2264e380635913bc9ac72d1ab55088c0 Author: David Lechner Date: Fri Sep 29 12:23:17 2023 -0500 staging: iio: resolver: ad2s1210: remove config attribute This removes the config register sysfs attribute. Writing to the config register directly can be dangerous and userspace should not need to have to know the register layout. This register can still be accessed though debugfs if needed. We can add new attributes to set specific flags in the config register in the future if needed (e.g. `enable_hysterisis` and `phase_lock_range`). Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-12-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit 569dc8054e702f504bd8d07e2c4e315b2097d746 Author: David Lechner Date: Fri Sep 29 12:23:16 2023 -0500 staging: iio: resolver: ad2s1210: add debugfs reg access This add an implementation of debugfs_reg_access for the AD2S1210 driver. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-11-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit b3689e14415a874630f0894d8c3ac7ea01603d57 Author: David Lechner Date: Fri Sep 29 12:23:15 2023 -0500 staging: iio: resolver: ad2s1210: use regmap for config registers This makes use of the regmap API to read and write the configuration registers. This simplifies code quite a bit and makes it safer (previously, it was easy to write a bad value to the config registers which causes the chip to lock up and need to be reset). This chip has multiple modes of operation. In normal mode, we do not use regmap since there is no addressing - data is just bitshifted out during the SPI read. In config mode, we use regmap since it requires writing the address (with read/write flag) before reading and writing. We don't use the lock provided by the regmap because we need to also synchronize with the normal mode SPI reads and with the various GPIOs. There is also a quirk when reading registers (other than the fault register). If the address/data bit is set in the value read, then it indicates there is a configuration parity error and the data is not valid. Previously, this was checked in a few places, but not consistently. Now, we always check it in the regmap read function. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-10-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit 68d319571b8fee7b4135b118ad4733b4469ccaf0 Author: David Lechner Date: Fri Sep 29 12:23:14 2023 -0500 staging: iio: resolver: ad2s1210: use devicetree to get CLKIN rate This removes the fclkin sysfs attribute and replaces it with getting the CLKIN clock rate using the clk subsystem (i.e. from the devicetree). CLKIN comes from an external oscillator that is connected directly to the AD2S1210 chip, so users of the sysfs attributes should not need to be concerned with this. The fclkin field (the datasheet name) is renamed to clkin_hz to be more obvious that it is a frequency in Hz. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-9-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit 4623b414e68bb57ce30fe286ca932202fc438a16 Author: David Lechner Date: Fri Sep 29 12:23:13 2023 -0500 staging: iio: resolver: ad2s1210: implement IIO_CHAN_INFO_SCALE This adds an implementation of IIO_CHAN_INFO_SCALE to the ad2s1210 resolver driver. This allows userspace to get the scale factor for the raw values. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-8-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit 1b6eba71cae261d504d5826897a22a9a45f200d2 Author: David Lechner Date: Fri Sep 29 12:23:12 2023 -0500 staging: iio: resolver: ad2s1210: always use 16-bit value for raw read This removes the special handling for resolutions lower than 16 bits. This will allow us to use a fixed scale independent of the resolution. A new sample field is added to store the raw data instead of reusing the config mode rx buffer so that we don't have to do a cast or worry about unaligned access. Also, for the record, according to the datasheet, the logic for the special handling based on hysteresis that was removed was incorrect. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-7-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit acbfaee17014811d96d9094ce2fb723384dfc009 Author: David Lechner Date: Fri Sep 29 12:23:11 2023 -0500 staging: iio: resolver: ad2s1210: sort imports There are quite a few imports and we will be adding more so it will make it easier to read if they are sorted. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-6-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit f434eac79bee6e44d7d46113391e55d9157cbc65 Author: David Lechner Date: Fri Sep 29 12:23:10 2023 -0500 staging: iio: resolver: ad2s1210: remove spi_set_drvdata() Since we never call spi_get_drvdata(), we can remove spi_set_drvdata(). Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-5-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit 3c1f41d5f320a001507257ca3504716e8f8bc00c Author: David Lechner Date: Fri Sep 29 12:23:09 2023 -0500 staging: iio: resolver: ad2s1210: check return of ad2s1210_initial() This adds a check to the return value of ad2s1210_initial() since it can fail. The call is also moved before devm_iio_device_register() so that we don't have to unregister the device if it fails. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-4-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit 9829ebacea804ad4b5d1a74a8d94a1f843505546 Author: David Lechner Date: Fri Sep 29 12:23:08 2023 -0500 staging: iio: resolver: ad2s1210: remove call to spi_setup() This removes the call to spi_setup() in the ad2s1210 driver. Setting MODE_3 was incorrect. It should be MODE_1 but we can let the device tree select this and avoid the need to call spi_setup(). Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-3-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit 7fe2d05cee46b1c4d9f1efaeab08cc31a0dfff60 Author: David Lechner Date: Fri Sep 29 12:23:07 2023 -0500 staging: iio: resolver: ad2s1210: fix use before initialization This fixes a use before initialization in ad2s1210_probe(). The ad2s1210_setup_gpios() function uses st->sdev but it was being called before this field was initialized. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230929-ad2s1210-mainline-v3-2-fa4364281745@baylibre.com Signed-off-by: Jonathan Cameron commit 799d794f75598353c8e5854fc9c57cc46d236c4e Author: Nirmoy Das Date: Tue Sep 26 10:37:42 2023 +0200 drm/i915: Enable GGTT updates with binder in MTL MTL can hang because of a HW bug while parallel reading/writing from/to LMEM/GTTMMADR BAR so try to reduce GGTT update related pci transactions with blitter command as recommended for Wa_13010847436 and Wa_14019519902. Signed-off-by: Nirmoy Das Reviewed-by: Oak Zeng Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230926083742.14740-8-nirmoy.das@intel.com commit a2ae29629230588d50dfcba306decad7e4f690f3 Author: Nirmoy Das Date: Tue Sep 26 10:37:41 2023 +0200 drm/i915: Toggle binder context ready status Toggle binder context ready status when needed. To issue gpu commands, the driver must be primed to receive requests. Maintain binder-based GGTT update disablement until driver probing completes. Moreover, implement a temporary disablement of blitter prior to entering suspend, followed by re-enablement post-resume. This is acceptable as those transition periods are mostly single threaded. v2: move changes to lower levels from i915_driver.c(Jani). use new function for setting context ready status. Signed-off-by: Nirmoy Das Signed-off-by: Oak Zeng Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230926083742.14740-7-nirmoy.das@intel.com commit 8a7f77fabac16e284cc47191fe033770012bf48d Author: Nirmoy Das Date: Tue Sep 26 10:37:40 2023 +0200 drm/i915: Implement GGTT update method with MI_UPDATE_GTT Implement GGTT update method with blitter command, MI_UPDATE_GTT and install those handlers if a platform requires that. v2: Make sure we hold the GT wakeref and Blitter engine wakeref before we call mutex_lock/intel_context_enter below. When GT/engine are not awake, the intel_context_enter calls into some runtime pm function which can end up with kmalloc/fs_reclaim. But trigger fs_reclaim holding a mutex lock is not allowed because shrinker can also try to hold the same mutex lock. It is a circular lock. So hold the GT/blitter engine wakeref before calling mutex_lock, to fix the circular lock. Signed-off-by: Nirmoy Das Signed-off-by: Oak Zeng Acked-by: Oak Zeng Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230926083742.14740-6-nirmoy.das@intel.com commit 3f5f62883631a987964102bc5044f7bf62c26323 Author: Nirmoy Das Date: Tue Sep 26 10:37:39 2023 +0200 drm/i915: Parameterize binder context creation Add i915_ggtt_require_binder() to indicate that i915 needs to create binder context which will be used by subsequent patch to enable i915_address_space vfuncs that will use GPU commands to update GGTT. Signed-off-by: Nirmoy Das Reviewed-by: Oak Zeng Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230926083742.14740-5-nirmoy.das@intel.com commit 0e514878486053363f8b2a806525fe67ae692827 Author: Nirmoy Das Date: Tue Sep 26 10:37:38 2023 +0200 drm/i915: Implement for_each_sgt_daddr_next Implement a way to iterate over sgt with pre-initialized sgt_iter state. Signed-off-by: Nirmoy Das Reviewed-by: Oak Zeng Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230926083742.14740-4-nirmoy.das@intel.com commit b352749936806c9d5ed6a6021d84c1df4d1df3da Author: Nirmoy Das Date: Tue Sep 26 10:37:37 2023 +0200 drm/i915: Create a kernel context for GGTT updates Create a separate kernel context if a platform requires GGTT updates using MI_UPDATE_GTT blitter command. Subsequent patch will introduce methods to update GGTT using this bind context and MI_UPDATE_GTT blitter command. v2: fix context leak on err(Oak) v3: improve err handling and improve function names(Andi) add docs for few functions. Signed-off-by: Nirmoy Das Reviewed-by: Oak Zeng Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230926083742.14740-3-nirmoy.das@intel.com commit 4cd64e9d2c7206db05e7162d0258b455726b7ec5 Author: Chris Wilson Date: Tue Sep 26 10:37:36 2023 +0200 drm/i915: Lift runtime-pm acquire callbacks out of intel_wakeref.mutex When runtime pm is first woken, it will synchronously call the registered callbacks for the device. These callbacks may pull in their own forest of locks, which we do not want to conflate with the intel_wakeref.mutex. A second minor benefit to reducing the coverage of the mutex, is that it will reduce contention for frequent sleeps and wakes (such as when being used for soft-rc6). v2: remove usage of fetch_and_zero() and other improvements(Jani) Signed-off-by: Chris Wilson Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230926083742.14740-2-nirmoy.das@intel.com commit 0951dce656e2b3c4c9a5096cd2cedb39a5d6e637 Author: Jonathan Cavitt Date: Tue Sep 26 11:30:28 2023 +0200 drm/i915/gem: Make i915_gem_shrinker multi-gt aware Where applicable, use for_each_gt instead of to_gt in the i915_gem_shrinker functions to make them apply to more than just the primary GT. Specifically, this ensure i915_gem_shrink_all retires all requests across all GTs, and this makes i915_gem_shrinker_vmap unmap VMAs from all GTs. v2: Pass correct GT to intel_gt_retire_requests(Andrzej). v3: Remove unnecessary braces(Andi) v4: Undo v3 to fix build failure. Signed-off-by: Jonathan Cavitt Signed-off-by: Nirmoy Das Reviewed-by: Andrzej Hajda Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230926093028.23614-1-nirmoy.das@intel.com commit af571133f7ae028ec9b5fdab78f483af13bf28d3 Author: William Qiu Date: Fri Sep 22 14:28:34 2023 +0800 riscv: dts: starfive: add assigned-clock* to limit frquency In JH7110 SoC, we need to go by-pass mode, so we need add the assigned-clock* properties to limit clock frquency. Signed-off-by: William Qiu Reviewed-by: Emil Renner Berthing Signed-off-by: Conor Dooley commit c258bcc289e6920038186eae38b2b7aa9786d796 Author: Dan Carpenter Date: Wed Sep 27 15:44:01 2023 +0300 ALSA: hda: cirrus_scodec: fix an error code The "ret" variable is zero but we should return -EINVAL. Fixes: 2144833e7b41 ("ALSA: hda: cirrus_scodec: Add KUnit test") Signed-off-by: Dan Carpenter Reviewed-by: Richard Fitzgerald Link: https://lore.kernel.org/r/5eea7fd5-67c8-4ed4-b5b3-b85dfb7572cc@moroto.mountain Signed-off-by: Takashi Iwai commit f2d87895cbc4af80649850dcf5da36de6b2ed3dd Author: Adrian Hunter Date: Thu Sep 28 10:29:53 2023 +0300 perf intel-pt: Fix async branch flags Ensure PERF_IP_FLAG_ASYNC is set always for asynchronous branches (i.e. interrupts etc). Fixes: 90e457f7be08 ("perf tools: Add Intel PT support") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter Acked-by: Namhyung Kim Link: https://lore.kernel.org/r/20230928072953.19369-1-adrian.hunter@intel.com Signed-off-by: Namhyung Kim commit b1f05622fef39dded385f9e360e859846c1ddaf1 Author: Ian Rogers Date: Sun Sep 24 23:23:23 2023 -0700 perf pmus: Make PMU alias name loading lazy PMU alias names were computed when the first perf_pmu is created, scanning all PMUs in event sources for a file called alias that generally doesn't exist. Switch to trying to load the file when all PMU related files are loaded in lookup. This would cause a PMU name lookup of an alias name to fail if no PMUs were loaded, so in that case all PMUs are loaded and the find repeated. The overhead is similar but in the (very) general case not all PMUs are scanned for the alias file. As the overhead occurs once per invocation it doesn't show in perf bench internals pmu-scan. On a tigerlake machine, the number of openat system calls for an event of cpu/cycles/ with perf stat reduces from 94 to 69 (ie 25 fewer openat calls). Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Ravi Bangoria Cc: James Clark Cc: Leo Yan Cc: Kan Liang Link: https://lore.kernel.org/r/20230925062323.840799-1-irogers@google.com Signed-off-by: Namhyung Kim commit 70b70a4307cccebe91388337b1c85735ce4de6ff Author: Lukas Wunner Date: Mon Sep 18 14:48:01 2023 +0200 PCI/sysfs: Protect driver's D3cold preference from user space struct pci_dev contains two flags which govern whether the device may suspend to D3cold: * no_d3cold provides an opt-out for drivers (e.g. if a device is known to not wake from D3cold) * d3cold_allowed provides an opt-out for user space (default is true, user space may set to false) Since commit 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend"), the user space setting overwrites the driver setting. Essentially user space is trusted to know better than the driver whether D3cold is working. That feels unsafe and wrong. Assume that the change was introduced inadvertently and do not overwrite no_d3cold when d3cold_allowed is modified. Instead, consider d3cold_allowed in addition to no_d3cold when choosing a suspend state for the device. That way, user space may opt out of D3cold if the driver hasn't, but it may no longer force an opt in if the driver has opted out. Fixes: 9d26d3a8f1b0 ("PCI: Put PCIe ports into D3 during suspend") Link: https://lore.kernel.org/r/b8a7f4af2b73f6b506ad8ddee59d747cbf834606.1695025365.git.lukas@wunner.de Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Reviewed-by: Mika Westerberg Reviewed-by: Mario Limonciello Cc: stable@vger.kernel.org # v4.8+ commit e30a106558e7d1e06d1fcfd12466dc646673d03d Author: Dan Williams Date: Fri Sep 29 12:44:20 2023 -0700 cxl/pci: Cleanup 'sanitize' to always poll In preparation for fixing the init/teardown of the 'sanitize' workqueue and sysfs notification mechanism, arrange for cxl_mbox_sanitize_work() to be the single location where the sysfs attribute is notified. With that change there is no distinction between polled mode and interrupt mode. All the interrupt does is accelerate the polling interval. The change to check for "mds->security.sanitize_node" under the lock is there to ensure that the interrupt, the work routine and the setup/teardown code can all have a consistent view of the registered notifier and the workqueue state. I.e. the expectation is that the interrupt is live past the point that the sanitize sysfs attribute is published, and it may race teardown, so it must be consulted under a lock. Given that new locking requirement, cxl_pci_mbox_irq() is moved from hard to thread irq context. Lastly, some opportunistic replacements of "queue_delayed_work(system_wq, ...)", which is just open coded schedule_delayed_work(), are included. Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Reviewed-by: Ira Weiny Reviewed-by: Davidlohr Bueso Signed-off-by: Dan Williams commit 8fddc4b660273f96f2d216b04642b070a59c019c Author: Gustavo A. R. Silva Date: Fri Sep 15 12:43:20 2023 -0600 drm/gud: Use size_add() in call to struct_size() If, for any reason, the open-coded arithmetic causes a wraparound, the protection that `struct_size()` adds against potential integer overflows is defeated. Fix this by hardening call to `struct_size()` with `size_add()`. Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver") Signed-off-by: "Gustavo A. R. Silva" Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/ZQSlyHKPdw/zsy4c@work Signed-off-by: Kees Cook commit 6b343a46428255e7f383deda53b1ad38db513897 Author: Justin Stitt Date: Mon Sep 18 07:47:29 2023 +0000 EDAC/mc_sysfs: Replace deprecated strncpy() with memcpy() `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We've already calculated bounds, possible truncation with '\0' or '\n' and manually NUL-terminated. The situation is now just a literal byte copy from one buffer to another, let's treat it as such and use a less ambiguous interface in memcpy. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230918-strncpy-drivers-edac-edac_mc_sysfs-c-v4-1-38a23d2fcdd8@google.com Signed-off-by: Kees Cook commit 8046da444df5fc35ed12b6b52c090dc89c8a5f96 Author: Justin Stitt Date: Thu Sep 14 23:10:34 2023 +0000 hwmon: (asus_wmi_sensors) Replace deprecated strncpy() with strscpy() `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. If, for any reason, NUL-padding is needed let's opt for `strscpy_pad`. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230914-strncpy-drivers-hwmon-asus_wmi_sensors-c-v1-1-e1703cf91693@google.com Signed-off-by: Kees Cook commit 66f8a4a0cc69ea1ddbebb6afcd8bd47511e9929c Author: Justin Stitt Date: Tue Sep 19 05:22:51 2023 +0000 hwmon: (ibmpowernv) Replace deprecated strncpy() with memcpy() `strncpy` is deprecated for use on NUL-terminated destination strings [1]. A suitable replacement is `memcpy` as we've already precisely calculated the number of bytes to copy while `buf` has been explicitly zero-initialized: | char buf[8] = { 0 }; Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Tested-by: Michael Ellerman Acked-by: Michael Ellerman Link: https://lore.kernel.org/r/20230919-strncpy-drivers-hwmon-ibmpowernv-c-v2-1-37d3e64172bc@google.com Signed-off-by: Kees Cook commit abe6db6c43fa59c4755f210e92d6fbe97a0ad1aa Author: Justin Stitt Date: Thu Sep 14 22:20:55 2023 +0000 HID: prodikeys: Replace deprecated strncpy() with strscpy() `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230914-strncpy-drivers-hid-hid-prodikeys-c-v1-1-10c00550f2c2@google.com Signed-off-by: Kees Cook commit 9b9056a3137b2e00273f889bfdf498ef6570e332 Author: Justin Stitt Date: Wed Sep 13 19:38:44 2023 +0000 firmware: tegra: bpmp: Replace deprecated strncpy() with strscpy_pad() `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. It seems like the filename stored at `namevirt` is expected to be NUL-terminated. A suitable replacement is `strscpy_pad` due to the fact that it guarantees NUL-termination on the destination buffer whilst maintaining the NUL-padding behavior that strncpy provides. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230913-strncpy-drivers-firmware-tegra-bpmp-debugfs-c-v1-1-828b0a8914b5@google.com Signed-off-by: Kees Cook commit b545465e22f5fec2862132c01a5d2abd3c4c4d50 Author: Justin Stitt Date: Wed Sep 13 00:23:19 2023 +0000 cpuidle: dt: Replace deprecated strncpy() with strscpy() `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer. With this, we can also drop the now unnecessary `CPUIDLE_(NAME|DESC)_LEN - 1` pieces. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230913-strncpy-drivers-cpuidle-dt_idle_states-c-v1-1-d16a0dbe5658@google.com Signed-off-by: Kees Cook commit 0faf84caee63a5f331bda130265fdceb7d4101b5 Author: Justin Stitt Date: Wed Sep 13 00:07:21 2023 +0000 cpufreq: Replace deprecated strncpy() with strscpy() `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. Both `policy->last_governor` and `default_governor` are expected to be NUL-terminated which is shown by their heavy usage with other string apis like `strcmp`. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20230913-strncpy-drivers-cpufreq-cpufreq-c-v1-1-f1608bfeff63@google.com Signed-off-by: Kees Cook commit de055e6116742291a31a21a10108d426574988ff Author: Justin Stitt Date: Tue Sep 12 22:52:04 2023 +0000 bus: fsl-mc: Replace deprecated strncpy() with strscpy_pad() `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We need to prefer more robust and less ambiguous string interfaces. `obj_desc->(type|label)` are expected to be NUL-terminated strings as per "include/linux/fsl/mc.h +143" | ... | * struct fsl_mc_obj_desc - Object descriptor | * @type: Type of object: NULL terminated string | ... It seems `cmd_params->obj_type` is also expected to be a NUL-terminated string. A suitable replacement is `strscpy_pad` due to the fact that it guarantees NUL-termination on the destination buffer whilst keeping the NUL-padding behavior that `strncpy` provides. Padding may not strictly be necessary but let's opt to keep it as this ensures no functional change. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Cc: Kees Cook Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230912-strncpy-drivers-bus-fsl-mc-dprc-c-v1-1-cdb56aa3f4f4@google.com Signed-off-by: Kees Cook commit a952abcdaa22116d940ca9cb9253caad1622ae93 Author: Justin Stitt Date: Mon Sep 11 20:51:04 2023 +0000 auxdisplay: panel: Replace deprecated strncpy() with strtomem_pad() `strncpy` is deprecated and as such we should prefer more robust and less ambiguous interfaces. In this case, all of `press_str`, `repeat_str` and `release_str` are explicitly marked as nonstring: | struct { /* valid when type == INPUT_TYPE_KBD */ | char press_str[sizeof(void *) + sizeof(int)] __nonstring; | char repeat_str[sizeof(void *) + sizeof(int)] __nonstring; | char release_str[sizeof(void *) + sizeof(int)] __nonstring; | } kbd; ... which makes `strtomem_pad` a suitable replacement as it is functionally the same whilst being more obvious about its behavior. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Cc: Kees Cook Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230911-strncpy-drivers-auxdisplay-panel-c-v1-1-b60bd0ae8552@google.com Signed-off-by: Kees Cook commit 76fe8713dd0a1331d84d767e8e5d3f365d959e8a Author: Dan Williams Date: Fri Sep 29 14:44:46 2023 -0700 cxl/pci: Remove unnecessary device reference management in sanitize work Given that any particular put_device() could be the final put of the device, the fact that there are usages of cxlds->dev after put_device(cxlds->dev) is a red flag. Drop the reference counting since the device is pinned by being registered and will not be unregistered without triggering the driver + workqueue to shutdown. Reviewed-by: Dave Jiang Reviewed-by: Davidlohr Bueso Reviewed-by: Jonathan Cameron Reviewed-by: Ira Weiny Signed-off-by: Dan Williams commit 2147c8d07e1abc8dfc3433ca18eed5295e230ede Author: Hengqi Chen Date: Fri Sep 29 15:59:54 2023 +0000 libbpf: Allow Golang symbols in uprobe secdef Golang symbols in ELF files are different from C/C++ which contains special characters like '*', '(' and ')'. With generics, things get more complicated, there are symbols like: github.com/cilium/ebpf/internal.(*Deque[go.shape.interface { Format(fmt.State, int32); TypeName() string;github.com/cilium/ebpf/btf.copy() github.com/cilium/ebpf/btf.Type}]).Grow Matching such symbols using `%m[^\n]` in sscanf, this excludes newline which typically does not appear in ELF symbols. This should work in most use-cases and also work for unicode letters in identifiers. If newline do show up in ELF symbols, users can still attach to such symbol by specifying bpf_uprobe_opts::func_name. A working example can be found at this repo ([0]). [0]: https://github.com/chenhengqi/libbpf-go-symbols Suggested-by: Andrii Nakryiko Signed-off-by: Hengqi Chen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230929155954.92448-1-hengqi.chen@gmail.com commit aa75cc029e053627743fba2cde8a73519abe8421 Author: Johannes Berg Date: Fri Sep 29 15:58:14 2023 +0200 wifi: mac80211: add back SPDX identifier Looks like I lost that by accident, add it back. Fixes: 076fc8775daf ("wifi: cfg80211: remove wdev mutex") Signed-off-by: Johannes Berg commit c419d884551fa4f000996ace22ab498415afad2e Author: Johannes Berg Date: Fri Sep 29 16:21:00 2023 +0200 wifi: mac80211: fix ieee80211_drop_unencrypted_mgmt return type/value Somehow, I managed to botch this and pretty much completely break wifi. My original patch did contain these changes, but I seem to have lost them before sending to the list. Fix it now. Reported-and-tested-by: Kalle Valo Fixes: 6c02fab72429 ("wifi: mac80211: split ieee80211_drop_unencrypted_mgmt() return value") Signed-off-by: Johannes Berg commit 6c774377359923e4bb46c6f26381edd9189389ed Author: Ingo Molnar Date: Thu Sep 28 11:07:01 2023 +0200 tick/nohz: Update comments some more Inspired by recent enhancements to comments in kernel/time/tick-sched.c, go through the entire file and fix/unify its comments: - Fix over a dozen typos, spelling mistakes & cases of bad grammar. - Re-phrase sentences that I needed to read three times to understand. [ I used the following arbitrary rule-of-thumb: - if I had to read a comment twice, it was usually my fault, - if I had to read it a third time, it was the comment's fault. ] - Comma updates: - Add commas where needed - Remove commas where not needed - In cases where a comma is optional, choose one variant and try to standardize it over similar sentences in the file. - Standardize on standalone 'NOHZ' spelling in free-flowing comments: s/nohz/NOHZ s/no idle tick/NOHZ Still keep 'dynticks' as a popular synonym. - Standardize on referring to variable names within free-flowing comments with the "'var'" nomenclature, and function names as "function_name()". - Standardize on '64-bit' and '32-bit': s/32bit/32-bit s/64bit/64-bit - Standardize on 'IRQ work': s/irq work/IRQ work - A few other tidyups I probably missed to list. No change in functionality intended - other than one small change to a syslog output string. Signed-off-by: Ingo Molnar Acked-by: Frederic Weisbecker Link: https://lore.kernel.org/r/ZRVCNeMcSQcXS36N@gmail.com commit 3cec9514911c4400a4b4ab778b9e92b60a14c677 Author: Tudor Ambarus Date: Thu Sep 28 16:36:44 2023 +0200 ARM: dts: at91: sam9x60_curiosity: Add mandatory dt property for RTT atmel,rtt-rtc-time-reg is a mandatory property and encodes the GPBR register used to store the time base when the RTT is used as an RTC. Align the RTT with what's currently done for sam9x60ek and sama7g5ek, and enable it by default even if RTC is also enabled. Signed-off-by: Tudor Ambarus [nicolas.ferre@microchip.com: adapt to newer kernel] Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20230928143644.208515-1-nicolas.ferre@microchip.com Signed-off-by: Claudiu Beznea commit e0bbf92682ad1df36ef43104a036469ac0ab3a4a Author: Justin Stitt Date: Mon Sep 11 17:52:44 2023 +0000 um,ethertap: Replace deprecated strncpy() with strscpy() `strncpy` is deprecated for use on NUL-terminated destination strings [1]. `gate_buf` should always be NUL-terminated and does not require NUL-padding. It is used as a string arg inside an argv array given to `run_helper()`. Due to this, let's use `strscpy` as it guarantees NUL-terminated on the destination buffer preventing potential buffer overreads [2]. This exact invocation was changed from `strcpy` to `strncpy` in commit 7879b1d94badb ("um,ethertap: use strncpy") back in 2015. Let's continue hardening our `str*cpy` apis and use the newer and safer `strscpy`! Link: www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings[1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Cc: Kees Cook Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230911-strncpy-arch-um-os-linux-drivers-ethertap_user-c-v1-1-d9e53f52ab32@google.com Signed-off-by: Kees Cook commit d77008421afda6208b1256c9b218457acd174ca6 Author: Elena Reshetova Date: Thu Aug 17 21:14:57 2023 -0700 groups: Convert group_info.usage to refcount_t atomic_t variables are currently used to implement reference counters with the following properties: - counter is initialized to 1 using atomic_set() - a resource is freed upon counter reaching zero - once counter reaches zero, its further increments aren't allowed - counter schema uses basic atomic operations (set, inc, inc_not_zero, dec_and_test, etc.) Such atomic variables should be converted to a newly provided refcount_t type and API that prevents accidental counter overflows and underflows. This is important since overflows and underflows can lead to use-after-free situation and be exploitable. The variable group_info.usage is used as pure reference counter. Convert it to refcount_t and fix up the operations. **Important note for maintainers: Some functions from refcount_t API defined in refcount.h have different memory ordering guarantees than their atomic counterparts. Please check Documentation/core-api/refcount-vs-atomic.rst for more information. Normally the differences should not matter since refcount_t provides enough guarantees to satisfy the refcounting use cases, but in some rare cases it might matter. Please double check that you don't have some undocumented memory guarantees for this variable usage. For the group_info.usage it might make a difference in following places: - put_group_info(): decrement in refcount_dec_and_test() only provides RELEASE ordering and ACQUIRE ordering on success vs. fully ordered atomic counterpart Suggested-by: Kees Cook Signed-off-by: Elena Reshetova Reviewed-by: David Windsor Reviewed-by: Hans Liljestrand Link: https://lore.kernel.org/r/20230818041456.gonna.009-kees@kernel.org Signed-off-by: Kees Cook commit 4cb2e89fea5fe4238c554fcb62afed5231e1d020 Author: Gustavo A. R. Silva Date: Wed Aug 16 12:05:06 2023 -0600 nouveau/svm: Split assignment from if conditional Fix checkpatch.pl ERROR: do not use assignment in if condition. Signed-off-by: "Gustavo A. R. Silva" Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/6b900e80b5587187c68efc788f5b042ca747d374.1692208802.git.gustavoars@kernel.org Signed-off-by: Kees Cook commit 6ad33b53c9b8a1c99bcd2fb96123d5d45bc88d7b Author: Gustavo A. R. Silva Date: Wed Aug 16 12:04:06 2023 -0600 nouveau/svm: Replace one-element array with flexible-array member in struct nouveau_svm One-element and zero-length arrays are deprecated. So, replace one-element array in struct nouveau_svm with flexible-array member. This results in no differences in binary output. Link: https://github.com/KSPP/linux/issues/338 Signed-off-by: "Gustavo A. R. Silva" Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/087a1c335228bd245192bbb2fb347c9af1be5750.1692208802.git.gustavoars@kernel.org Signed-off-by: Kees Cook commit ce63e97b674d03e5a87906fcbac19756f11f22c2 Author: Chris Morgan Date: Fri Sep 29 09:44:41 2023 -0500 ARM: dts: sunxi: add support for Anbernic RG-Nano The Anbernic RG-Nano is a small portable game device based on the Allwinner V3s SoC. It has GPIO buttons on the face and side for input, a single mono speaker, a 240x240 SPI controlled display, a USB-C OTG port, an SD card slot for booting, and 64MB of RAM included in the SoC. There does not appear to be a crystal feeding the internal RTC so it does not keep proper time (for me it ran 8 hours slow in a 24 hour period). External RTC works just fine. Working/Tested: - SDMMC - UART (for debugging) - Buttons - Charging/battery/PMIC - Speaker - RTC (external RTC) - USB - Display Signed-off-by: Chris Morgan Reviewed-by: Andre Przywara Acked-by: Jernej Skrabec Reviewed-by: Samuel Holland Link: https://lore.kernel.org/r/20230929144441.3409-5-macroalpha82@gmail.com Signed-off-by: Jernej Skrabec commit 50fa4947efca88b6550e0bfff2d7e6a7d16c2c61 Author: Chris Morgan Date: Fri Sep 29 09:44:40 2023 -0500 dt-bindings: arm: sunxi: add Anbernic RG-Nano The Anbernic RG-Nano is a portable handheld console from Anbernic which uses the Allwinner V3s SoC. Signed-off-by: Chris Morgan Acked-by: Krzysztof Kozlowski Reviewed-by: Andre Przywara Link: https://lore.kernel.org/r/20230929144441.3409-4-macroalpha82@gmail.com Signed-off-by: Jernej Skrabec commit 04aff09c4b3d0beacb5f8369cc351e7893072f64 Author: Chris Morgan Date: Fri Sep 29 09:44:39 2023 -0500 ARM: dts: sun8i: v3s: add EHCI and OHCI to v3s dts Add the EHCI and OHCI controller to the Allwinner v3s to support using USB in host mode. Signed-off-by: Chris Morgan Reviewed-by: Andre Przywara Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230929144441.3409-3-macroalpha82@gmail.com Signed-off-by: Jernej Skrabec commit 41192b67593928a3e1aa26edb7cb45e00c728dde Author: Chris Morgan Date: Fri Sep 29 09:44:38 2023 -0500 arm: dts: sun8i: V3s: Add pinctrl for pwm Add pinctrl nodes for pwm0 and pwm1. Signed-off-by: Chris Morgan Reviewed-by: Andre Przywara Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230929144441.3409-2-macroalpha82@gmail.com Signed-off-by: Jernej Skrabec commit 8b04d32678e3c46b8a738178e0e55918eaa3be17 Author: Kees Cook Date: Thu Sep 28 20:24:31 2023 -0700 binfmt_elf: Use elf_load() for interpreter Handle arbitrary memsz>filesz in interpreter ELF segments, instead of only supporting it in the last segment (which is expected to be the BSS). Cc: Eric Biederman Cc: Alexander Viro Cc: Christian Brauner Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org Reported-by: Pedro Falcato Closes: https://lore.kernel.org/lkml/20221106021657.1145519-1-pedro.falcato@gmail.com/ Tested-by: Pedro Falcato Signed-off-by: Sebastian Ott Link: https://lore.kernel.org/r/20230929032435.2391507-3-keescook@chromium.org Signed-off-by: Kees Cook commit 8ed2ef21ff564cf4a25c098ace510ee6513c9836 Author: Kees Cook Date: Thu Sep 28 20:24:30 2023 -0700 binfmt_elf: elf_bss no longer used by load_elf_binary() With the BSS handled generically via the new filesz/memsz mismatch handling logic in elf_load(), elf_bss no longer needs to be tracked. Drop the variable. Cc: Eric Biederman Cc: Alexander Viro Cc: Christian Brauner Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org Suggested-by: Eric Biederman Tested-by: Pedro Falcato Signed-off-by: Sebastian Ott Link: https://lore.kernel.org/r/20230929032435.2391507-2-keescook@chromium.org Signed-off-by: Kees Cook commit 585a018627b4d7ed37387211f667916840b5c5ea Author: Eric W. Biederman Date: Thu Sep 28 20:24:29 2023 -0700 binfmt_elf: Support segments with 0 filesz and misaligned starts Implement a helper elf_load() that wraps elf_map() and performs all of the necessary work to ensure that when "memsz > filesz" the bytes described by "memsz > filesz" are zeroed. An outstanding issue is if the first segment has filesz 0, and has a randomized location. But that is the same as today. In this change I replaced an open coded padzero() that did not clear all of the way to the end of the page, with padzero() that does. I also stopped checking the return of padzero() as there is at least one known case where testing for failure is the wrong thing to do. It looks like binfmt_elf_fdpic may have the proper set of tests for when error handling can be safely completed. I found a couple of commits in the old history https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git, that look very interesting in understanding this code. commit 39b56d902bf3 ("[PATCH] binfmt_elf: clearing bss may fail") commit c6e2227e4a3e ("[SPARC64]: Missing user access return value checks in fs/binfmt_elf.c and fs/compat.c") commit 5bf3be033f50 ("v2.4.10.1 -> v2.4.10.2") Looking at commit 39b56d902bf3 ("[PATCH] binfmt_elf: clearing bss may fail"): > commit 39b56d902bf35241e7cba6cc30b828ed937175ad > Author: Pavel Machek > Date: Wed Feb 9 22:40:30 2005 -0800 > > [PATCH] binfmt_elf: clearing bss may fail > > So we discover that Borland's Kylix application builder emits weird elf > files which describe a non-writeable bss segment. > > So remove the clear_user() check at the place where we zero out the bss. I > don't _think_ there are any security implications here (plus we've never > checked that clear_user() return value, so whoops if it is a problem). > > Signed-off-by: Pavel Machek > Signed-off-by: Andrew Morton > Signed-off-by: Linus Torvalds It seems pretty clear that binfmt_elf_fdpic with skipping clear_user() for non-writable segments and otherwise calling clear_user(), aka padzero(), and checking it's return code is the right thing to do. I just skipped the error checking as that avoids breaking things. And notably, it looks like Borland's Kylix died in 2005 so it might be safe to just consider read-only segments with memsz > filesz an error. Reported-by: Sebastian Ott Reported-by: Thomas Weißschuh Closes: https://lkml.kernel.org/r/20230914-bss-alloc-v1-1-78de67d2c6dd@weissschuh.net Signed-off-by: "Eric W. Biederman" Link: https://lore.kernel.org/r/87sf71f123.fsf@email.froward.int.ebiederm.org Tested-by: Pedro Falcato Signed-off-by: Sebastian Ott Link: https://lore.kernel.org/r/20230929032435.2391507-1-keescook@chromium.org Signed-off-by: Kees Cook commit 6013727fc33d9361fb01cb4d072134d3d37a1c1a Author: Tanmay Shah Date: Mon Sep 25 10:26:48 2023 -0700 remoteproc: zynqmp: Change tcm address translation method Introduce device address in hardcode TCM table. Device address is used for address translation. Also, previous method(hack) to mask few bits from address to achieve address translation is removed Signed-off-by: Tanmay Shah Link: https://lore.kernel.org/r/20230925172648.2339048-1-tanmay.shah@amd.com Signed-off-by: Mathieu Poirier commit 3accaef1f61e0c5531ae9e92ff0d66981cdf1516 Author: Mark Brown Date: Fri Sep 15 13:18:07 2023 +0100 kselftest/arm64: Verify HWCAP2_SVE_B16B16 Validate that SVE B16B16 support is reported correctly and consistently to userspace. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230915-arm64-zfr-b16b16-el0-v1-2-f9aba807bdb5@kernel.org Signed-off-by: Catalin Marinas commit 5d5b4e8c2d9ec12a5cc013b82c1873cd387e0ddf Author: Mark Brown Date: Fri Sep 15 13:18:06 2023 +0100 arm64/sve: Report FEAT_SVE_B16B16 to userspace SVE 2.1 introduced a new feature FEAT_SVE_B16B16 which adds instructions supporting the BFloat16 floating point format. Report this to userspace through the ID registers and hwcap. Reported-by: Peter Maydell Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230915-arm64-zfr-b16b16-el0-v1-1-f9aba807bdb5@kernel.org Signed-off-by: Catalin Marinas commit b87b8f43afd5f7afd3920532942f5e9ea028d955 Author: Cezary Rojewski Date: Fri Sep 29 13:24:36 2023 +0200 ASoC: Intel: avs: Drop superfluous stream decoupling HDAudio streams are decoupled on startup() and, decoupling them again on prepare() is redundant. Signed-off-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20230929112436.787058-7-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit a5e6ea01265e9ed9ab8511907ebbc82552cd2e9e Author: Wu Zhou Date: Fri Sep 29 13:24:35 2023 +0200 ASoC: Intel: avs: Disable DSP before loading basefw When audio controller is passed-through to the guest machine in virtualized environment, the basefw load will fail the next time guest OS reboots. Disable the DSP main core before loading the base firmware to sanitize the environment. Signed-off-by: Wu Zhou Signed-off-by: Libin Yang Signed-off-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20230929112436.787058-6-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 0a5fb3cc28fda52c761775db2ccb7ccb954aee2a Author: Cezary Rojewski Date: Fri Sep 29 13:24:34 2023 +0200 ASoC: Intel: avs: Keep module refcount up when gathering traces To prevent rmmod and similar behave unexpectedly when invoked on snd_soc_avs module while the AudioDSP firmware tracing is ongoing, increase the module refcount until the tracing is stopped. Signed-off-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20230929112436.787058-5-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 28a21cb26425797910b4d7ab0cad0d377d4a004c Author: Amadeusz Sławiński Date: Fri Sep 29 13:24:33 2023 +0200 ASoC: Intel: avs: Preallocate memory for module configuration In order to instantiate modules on the firmware side, the driver sends payload with module configuration. In some case size of this information is not known before hand, so driver allocates temporary memory during module creation and frees it after use. Optimize the flow a bit, by preallocating maximum buffer. This removes the time spend on allocating memory, as well as potential OOM errors during module initialization. Handlers for modules, where configuration data fits on stack, are left as is. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20230929112436.787058-4-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 7eb878e768fd952739a03bf4bbd021496a818eb9 Author: Amadeusz Sławiński Date: Fri Sep 29 13:24:32 2023 +0200 ASoC: Intel: avs: Use generic size defines Instead of using PAGE_SIZE as base of definitions in headers, use generic size defines. While x86 platforms use 4096 as page size, there are platforms which use different page sizes. Two of changed defines are for memory windows on DSP side, which have fixed size independent of host side page size. Another one is for CLDMA buffer which also doesn't need to change with page size. Reviewed-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20230929112436.787058-3-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 26033ae6bd896d89aac4a3194ceb5dc673ce9214 Author: Cezary Rojewski Date: Fri Sep 29 13:24:31 2023 +0200 ASoC: Intel: avs: Move IPC error messages one level down Code size can be reduced if avs_dsp_send_xxx_msg()s take responsibility for dumping logs in case of an IPC message failure. In consequence, avs_ipc_err() helper is removed. Signed-off-by: Cezary Rojewski Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20230929112436.787058-2-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 565c88ae53c5d0acacb7644f337e786d08874b76 Author: Sascha Hauer Date: Fri Sep 22 12:00:21 2023 +0200 ARM: dts: stm32: omit unused pinctrl groups from stm32mp15 dtb files stm32mp15-pinctrl.dtsi contains nearly all pinctrl groups collected from all boards. Most of them end up unused by a board and only waste binary space. Add /omit-if-no-ref/ to the groups to scrub the unused groups from the dtbs. Signed-off-by: Sascha Hauer Reviewed-by: Ahmad Fatoum Signed-off-by: Alexandre Torgue commit 88bb50edb61068c4416df2e55677fb3159f647f1 Author: Dario Binacchi Date: Mon Sep 4 20:03:41 2023 +0200 ARM: dts: stm32: stm32f7-pinctrl: don't use multiple blank lines The patch fixes the following warning: arch/arm/dts/stm32f7-pinctrl.dtsi:380: check: Please don't use multiple blank lines Fixes: ba287d1a0137 ("ARM: dts: stm32: add pin map for LTDC on stm32f7") Signed-off-by: Dario Binacchi Reviewed-by: Raphaël Gallais-Pou Signed-off-by: Alexandre Torgue commit 358d04ca9737f3ce90dda50a1f68a954032aadc9 Author: Lionel Debieve Date: Wed Aug 16 16:26:17 2023 +0200 ARM: dts: stm32: add HASH on stm32mp131 Add the HASH support on stm32mp131. Signed-off-by: Lionel Debieve Signed-off-by: Thomas Bourgoin Signed-off-by: Alexandre Torgue commit 99b22552330b09f623f12f5dc2402175cbc18a15 Author: Alexandre Torgue Date: Thu Sep 21 15:30:05 2023 +0200 arm64: dts: st: enable secure arm-wdt watchdog on stm32mp257f-ev1 Enable the watchdog and define the default timeout to 32 seconds. Signed-off-by: Lionel Debieve Signed-off-by: Alexandre Torgue commit a46e42c097982e258f89c64c5f52f30994bcfeda Author: Sudeep Holla Date: Wed Sep 27 17:26:13 2023 +0100 soc: kunpeng_hccs: Migrate to use generic PCC shmem related macros Use the newly defined common and generic PCC shared memory region related macros in this driver to replace the locally defined ones. Cc: Huisong Li Reviewed-by: Huisong Li Link: https://lore.kernel.org/r/20230927-pcc_defines-v2-4-0b8ffeaef2e5@arm.com Signed-off-by: Sudeep Holla commit 2cf39b806be74661cc347e99796c97d9f54b7c42 Author: Sudeep Holla Date: Wed Sep 27 17:26:12 2023 +0100 hwmon: (xgene) Migrate to use generic PCC shmem related macros Use the newly defined common and generic PCC shared memory region related macros in this driver to replace the locally defined ones. Cc: Jean Delvare Acked-by: Guenter Roeck Link: https://lore.kernel.org/r/20230927-pcc_defines-v2-3-0b8ffeaef2e5@arm.com Signed-off-by: Sudeep Holla commit 89a4ad1f437c049534891c3d83cd96d7c7debd2a Author: Sudeep Holla Date: Wed Sep 27 17:26:11 2023 +0100 i2c: xgene-slimpro: Migrate to use generic PCC shmem related macros Use the newly defined common and generic PCC shared memory region related macros in this driver to replace the locally defined ones. Reviewed-by: Andi Shyti Acked-by: Wolfram Sang Link: https://lore.kernel.org/r/20230927-pcc_defines-v2-2-0b8ffeaef2e5@arm.com Signed-off-by: Sudeep Holla commit 659eed2ef0e6bd9dc0d4e503a65e74726e330e1b Author: Jani Nikula Date: Tue Sep 12 14:06:46 2023 +0300 drm/i915/display: add I915 conditional build to vlv_dsi_pll.h Add stubs for !I915. Not all the functions need to be stubbed. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/930c8d332d425a54dae7af16aed26ec293f80afd.1694514689.git.jani.nikula@intel.com commit 7f5c64c0871ea63a420ca4cd05e9df2d4e5f9232 Author: Jani Nikula Date: Tue Sep 12 14:06:45 2023 +0300 drm/i915/display: add I915 conditional build to intel_tv.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/290e555ac87ea11cd6021c1338b75ad64c42ae98.1694514689.git.jani.nikula@intel.com commit e6a5ad9a75500506f2c516ef85eb03ec5c49140e Author: Jani Nikula Date: Tue Sep 12 14:06:44 2023 +0300 drm/i915/display: add I915 conditional build to intel_sdvo.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/c34ea1f470590488acf40512da3892ca153f482a.1694514689.git.jani.nikula@intel.com commit 6842d38178e71051a8c7ce5bb32314ec2fa5cf17 Author: Jani Nikula Date: Tue Sep 12 14:06:43 2023 +0300 drm/i915/display: add I915 conditional build to intel_dvo.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/d43b27742297083b37d52222c4bb72b062ef4967.1694514689.git.jani.nikula@intel.com commit 9543cc39db988527fbb54283aa7b49d810a46f9f Author: Jani Nikula Date: Tue Sep 12 14:06:42 2023 +0300 drm/i915/display: add I915 conditional build to g4x_hdmi.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/ba2eea7ac081d0858a573062f197e00f3b186faf.1694514689.git.jani.nikula@intel.com commit 7a4946840481ea62874b80ee374b6e85cb0d3e96 Author: Jani Nikula Date: Tue Sep 12 14:06:41 2023 +0300 drm/i915/display: add I915 conditional build to i9xx_wm.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/bf15b14d3d060fdb256c78d4b8514d642a8958e6.1694514689.git.jani.nikula@intel.com commit ca116c0075d4d1b70abf2e0e961aea6f13423351 Author: Jani Nikula Date: Tue Sep 12 14:06:40 2023 +0300 drm/i915/display: add I915 conditional build to vlv_dsi.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/9f538824f15096b0c1444ee50d175a0a22d7bd5e.1694514689.git.jani.nikula@intel.com commit 3675c607a81e70c1697a72b713da83a6be0ead95 Author: Jani Nikula Date: Tue Sep 12 14:06:39 2023 +0300 drm/i915/display: add I915 conditional build to intel_crt.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/89a6daca98f87ed1a8a54367a977f146216330d2.1694514689.git.jani.nikula@intel.com commit bc872e300b64ac9bd45bde9a7311edfc3ac41993 Author: Jani Nikula Date: Tue Sep 12 14:06:38 2023 +0300 drm/i915/display: add I915 conditional build to intel_dpio_phy.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/978bc7263e8de10ffc1ef16086341dd629347c8e.1694514689.git.jani.nikula@intel.com commit 603dbd3e33d7bc88b7a04b3e82cf1b329b819e6b Author: Jani Nikula Date: Tue Sep 12 14:06:37 2023 +0300 drm/i915/display: add I915 conditional build to g4x_dp.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/ba92fc1dee1f71018179dbe10b91982c9c93e7e6.1694514689.git.jani.nikula@intel.com commit cebaacae96cbbd443be948eda1c71a58542c1fce Author: Jani Nikula Date: Tue Sep 12 14:06:36 2023 +0300 drm/i915/display: add I915 conditional build to intel_overlay.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/45a127d37816ac97dfe493beeed060e323047014.1694514689.git.jani.nikula@intel.com commit 8cd3a40c52ea222a5565e50aacec431140af259c Author: Jani Nikula Date: Tue Sep 12 14:06:35 2023 +0300 drm/i915/display: add I915 conditional build to intel_sprite.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/b9680203b0b93dc3472260d7e4128984e533b421.1694514689.git.jani.nikula@intel.com commit 6df6daad84d84ed9fae500f47b0a1837220923df Author: Jani Nikula Date: Tue Sep 12 14:06:34 2023 +0300 drm/i915/display: add I915 conditional build to intel_pch_display.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/02de0089de58c9fb19b6b56121f6c917f51b4561.1694514689.git.jani.nikula@intel.com commit 19ff503b866bddee53206ed59e7aa341f481d56f Author: Jani Nikula Date: Tue Sep 12 14:06:33 2023 +0300 drm/i915/display: add I915 conditional build to intel_pch_refclk.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/4359b34cbcff6199b5e42b5311c815aa6f4a167c.1694514689.git.jani.nikula@intel.com commit 3c0e538a6d307cf2f22737ee58bd3af64e74e82a Author: Jani Nikula Date: Tue Sep 12 14:06:32 2023 +0300 drm/i915/display: add I915 conditional build to intel_lpe_audio.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/7c10d8c4a2a628cba17b3b0f89b657dfbc91eaa9.1694514689.git.jani.nikula@intel.com commit 818fdb16d40c4bba3daf2d208e32a8b3ee1b2f95 Author: Jani Nikula Date: Tue Sep 12 14:06:31 2023 +0300 drm/i915/display: add I915 conditional build to i9xx_plane.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/4ad1864c66adcf691906c37b554f640d04069fb2.1694514689.git.jani.nikula@intel.com commit f8b5f0efa0318e2a2764ae6a8f96b55d84715981 Author: Jani Nikula Date: Tue Sep 12 14:06:30 2023 +0300 drm/i915/display: add I915 conditional build to hsw_ips.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/04469b92be51b8394d74a508174f041aa7e011e8.1694514689.git.jani.nikula@intel.com commit 197a30c4c62fb0ce4d6553443775f23987bada8e Author: Jani Nikula Date: Tue Sep 12 14:06:29 2023 +0300 drm/i915/display: add I915 conditional build to intel_lvds.h Add stubs for !I915. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/f06a88a69b7e326ff0914baca5e6a0e5f06e1867.1694514689.git.jani.nikula@intel.com commit a4ba1ea69f6b6d2b3eee7234deba986a82a77203 Author: Jani Nikula Date: Tue Sep 12 14:06:28 2023 +0300 drm/i915: define I915 during i915 driver build The xe driver will reuse i915 display code by compiling it separately as part of xe. We'll want to be able to distinguish between building the i915 display code for i915 and xe. Define I915 when building i915. Cc: David Airlie Cc: Daniel Vetter Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: Lucas De Marchi Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/97558201836115b91cbe32840239df855d0c2e4c.1694514689.git.jani.nikula@intel.com commit c6767334185e50121b66eae9f882d2832d2d2ad1 Author: Rafael J. Wysocki Date: Thu Sep 28 20:47:31 2023 +0200 ACPI: thermal: Drop list of device ACPI handles from struct acpi_thermal Notice that the list of device ACPI handles in struct acpi_thermal is not used and drop it. No functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano commit 2e57d10a6591560724b80a628235559571f4cb8d Author: Rafael J. Wysocki Date: Wed Sep 27 13:17:25 2023 -0700 ACPI: utils: Dynamically determine acpi_handle_list size Address a long-standing "TBD" comment in the ACPI headers regarding the number of handles in struct acpi_handle_list. The number 10, which along with the comment dates back to 2.4.23, seems like it may have been arbitrarily chosen and isn't sufficient in all cases [1]. Finally change the code to dynamically determine the size of the handles table in struct acpi_handle_list and allocate it accordingly. Update the users of to struct acpi_handle_list to take the additional dynamic allocation into account. Link: https://lore.kernel.org/linux-acpi/20230809094451.15473-1-ivan.hu@canonical.com # [1] Co-developed-by: Vicki Pfau Signed-off-by: Vicki Pfau Signed-off-by: Rafael J. Wysocki commit 03a5a75a6ad26afdb8b507cf26ef6dea45239911 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:26 2023 +0200 thermal: rcar: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Rafael J. Wysocki commit a07f4487bc49f5af8bd7d194890e5ed1dd7c4994 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:25 2023 +0200 thermal: rcar_gen3: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Rafael J. Wysocki commit 2128ba4639e37f39c73e2e07baed24038d47b973 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:24 2023 +0200 thermal: tsens: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 2d3c823df218fa30b63a00819b179c95c0199fbc Author: Uwe Kleine-König Date: Wed Sep 27 21:37:23 2023 +0200 thermal: lvts: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 3ebaf0f244d4cd1a4a018edd46f642f241ef97f1 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:22 2023 +0200 thermal: kirkwood: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 3c9e0f218c0fa5bcff18091d13519c9411c328f0 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:21 2023 +0200 thermal: k3_j72xx_bandgap: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit ff96e615ea49cd1910a6367efe19ebec9516ca2d Author: Uwe Kleine-König Date: Wed Sep 27 21:37:20 2023 +0200 thermal: k3_bandgap: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit a876f99d120dd81ff1e195260901f4a68fc4b498 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:19 2023 +0200 thermal: int3406: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 2570108311433217cc0ba78707067e728a5f03d6 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:18 2023 +0200 thermal: int3403: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit f287083ba7bff4924e0d18c085bcae53eabf36e8 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:17 2023 +0200 thermal: int3402: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 8cc099170f615d7b40a849d389207c9c4268f57a Author: Uwe Kleine-König Date: Wed Sep 27 21:37:16 2023 +0200 thermal: int3401: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 75b66d7e599395c844c85fad6d0a97c8b7e609fa Author: Uwe Kleine-König Date: Wed Sep 27 21:37:15 2023 +0200 thermal: int3400: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 02e7baaf5165a11f5075fa23c10f5834d92b19bd Author: Uwe Kleine-König Date: Wed Sep 27 21:37:14 2023 +0200 thermal: imx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 5568f642bb7a16ba75aceadc4f264be92365e677 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:13 2023 +0200 thermal: imx8mm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 6abe2f00d27aa4f337e7a2e5f1bc6accd9474698 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:12 2023 +0200 thermal: hisi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 7aa234e99fa2e007f004df8ef5b01f045378977d Author: Uwe Kleine-König Date: Wed Sep 27 21:37:11 2023 +0200 thermal: dove: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 0d0f8b2c4df0e9b8010344c6ad0d8b02c7cb6487 Author: Uwe Kleine-König Date: Wed Sep 27 21:37:10 2023 +0200 thermal: da9062: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit aa599650d26f6588723bc4c903704a7fa3df6c1e Author: Uwe Kleine-König Date: Wed Sep 27 21:37:09 2023 +0200 thermal: ns: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit f29ecd3748a28d0b52512afc81b3c13fd4a00c9b Author: Uwe Kleine-König Date: Wed Sep 27 21:37:08 2023 +0200 thermal: bcm2835: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 4347e7d0b4e8e1cb9ef4576cc94d122b02ee6f5b Author: Uwe Kleine-König Date: Wed Sep 27 21:37:07 2023 +0200 thermal: armada: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 3570bd989acc66add5726785058cceffa06b1f54 Author: Jani Nikula Date: Fri Sep 29 12:43:23 2023 +0300 drm/i915: Update DRIVER_DATE to 20230929 Signed-off-by: Jani Nikula commit b5034c63858d8cb44587bb1ce5a0790a1b4e4a05 Author: Baolin Liu Date: Wed Aug 9 16:09:11 2023 +0800 x86/cpu/amd: Remove redundant 'break' statement This break is after the return statement, so it is redundant & confusing, and should be deleted. Signed-off-by: Baolin Liu Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/396ba14d.2726.189d957b74b.Coremail.liubaolin12138@163.com commit 8f350194d5cfd7016d4cd44e433df0faa4d4a703 Author: Jens Axboe Date: Mon Jun 12 19:04:32 2023 -0600 io_uring: add support for vectored futex waits This adds support for IORING_OP_FUTEX_WAITV, which allows registering a notification for a number of futexes at once. If one of the futexes are woken, then the request will complete with the index of the futex that got woken as the result. This is identical to what the normal vectored futex waitv operation does. Use like IORING_OP_FUTEX_WAIT, except sqe->addr must now contain a pointer to a struct futex_waitv array, and sqe->off must now contain the number of elements in that array. As flags are passed in the futex_vector array, and likewise for the value and futex address(es), sqe->addr2 and sqe->addr3 are also reserved for IORING_OP_FUTEX_WAITV. For cancelations, FUTEX_WAITV does not rely on the futex_unqueue() return value as we're dealing with multiple futexes. Instead, a separate per io_uring request atomic is used to claim ownership of the request. Waiting on N futexes could be done with IORING_OP_FUTEX_WAIT as well, but that punts a lot of the work to the application: 1) Application would need to submit N IORING_OP_FUTEX_WAIT requests, rather than just a single IORING_OP_FUTEX_WAITV. 2) When one futex is woken, application would need to cancel the remaining N-1 requests that didn't trigger. While this is of course doable, having a single vectored futex wait makes for much simpler application code. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Jens Axboe commit e9a56c9325ef28d5481712e85dd5d3f8b2a68e88 Author: Jens Axboe Date: Tue Jun 13 08:34:08 2023 -0600 futex: make the vectored futex operations available Rename unqueue_multiple() as futex_unqueue_multiple(), and make both that and futex_wait_multiple_setup() available for external users. This is in preparation for wiring up vectored waits in io_uring. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Jens Axboe commit 5177c0cb306a8628bafbf1e6b7aa7e1b7436b8dc Author: Jens Axboe Date: Tue Jun 13 08:31:58 2023 -0600 futex: make futex_parse_waitv() available as a helper To make it more generically useful, augment it with allowing the caller to pass in the wake handler and wake data. Convert the futex_waitv() syscall, passing in the default handlers. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Jens Axboe commit 8af1692616d993c93a080865a7f19506733aa462 Author: Jens Axboe Date: Tue Jun 13 15:44:42 2023 -0600 futex: add wake_data to struct futex_q With handling multiple futex_q for waitv, we cannot easily go from the futex_q to data related to that request or queue. Add a wake_data argument that belongs to the wake handler assigned. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Jens Axboe commit 194bb58c6090e39bd7d9b9c888a079213628e1f6 Author: Jens Axboe Date: Thu Jun 8 11:57:40 2023 -0600 io_uring: add support for futex wake and wait Add support for FUTEX_WAKE/WAIT primitives. IORING_OP_FUTEX_WAKE is mix of FUTEX_WAKE and FUTEX_WAKE_BITSET, as it does support passing in a bitset. Similary, IORING_OP_FUTEX_WAIT is a mix of FUTEX_WAIT and FUTEX_WAIT_BITSET. For both of them, they are using the futex2 interface. FUTEX_WAKE is straight forward, as those can always be done directly from the io_uring submission without needing async handling. For FUTEX_WAIT, things are a bit more complicated. If the futex isn't ready, then we rely on a callback via futex_queue->wake() when someone wakes up the futex. From that calback, we queue up task_work with the original task, which will post a CQE and wake it, if necessary. Cancelations are supported, both from the application point-of-view, but also to be able to cancel pending waits if the ring exits before all events have occurred. The return value of futex_unqueue() is used to gate who wins the potential race between cancelation and futex wakeups. Whomever gets a 'ret == 1' return from that claims ownership of the io_uring futex request. This is just the barebones wait/wake support. PI or REQUEUE support is not added at this point, unclear if we might look into that later. Likewise, explicit timeouts are not supported either. It is expected that users that need timeouts would do so via the usual io_uring mechanism to do that using linked timeouts. The SQE format is as follows: `addr` Address of futex `fd` futex2(2) FUTEX2_* flags `futex_flags` io_uring specific command flags. None valid now. `addr2` Value of futex `addr3` Mask to wake/wait Acked-by: Peter Zijlstra (Intel) Signed-off-by: Jens Axboe commit e52c43403c9b839a30a9cfc4b75109581389d764 Author: Jens Axboe Date: Wed Jul 12 09:14:52 2023 -0600 futex: abstract out a __futex_wake_mark() helper Move the unqueue and lock_ptr clear into a helper that futex_wake_mark() calls. Add it to the public functions as well, in preparation for using it outside the core futex code. Suggested-by: Peter Zijlstra Acked-by: Peter Zijlstra (Intel) Signed-off-by: Jens Axboe commit 12a4be50aff30ee8f2c6a64020c82a4e997e8d6c Author: Jens Axboe Date: Thu Jun 8 11:56:06 2023 -0600 futex: factor out the futex wake handling In preparation for having another waker that isn't futex_wake_mark(), add a wake handler in futex_q. No extra data is associated with the handler outside of struct futex_q itself. futex_wake_mark() is defined as the standard wakeup helper, now set through futex_q_init like other defaults. Normal sync futex waiting relies on wake_q holding tasks that should be woken up. This is what futex_wake_mark() does, it'll unqueue the futex and add the associated task to the wake queue. For async usage of futex waiting, rather than having tasks sleeping on the futex, we'll need to deal with a futex wake differently. For the planned io_uring case, that means posting a completion event for the task in question. Having a definable wake handler can help support that use case. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Jens Axboe commit 3b0781595431acafe3db6596e12deb46975d91dd Author: Jens Axboe Date: Fri Jul 21 08:41:27 2023 -0600 futex: move FUTEX2_VALID_MASK to futex.h We need this for validating the futex2 flags outside of the normal futex syscalls. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Jens Axboe commit 15874a3d27e6405e9d17595f83bd3ca1b6cab16d Author: Qais Yousef Date: Sun Sep 17 00:29:55 2023 +0100 sched/debug: Add new tracepoint to track compute energy computation It was useful to track feec() placement decision and debug the spare capacity and optimization issues vs uclamp_max. Signed-off-by: Qais Yousef (Google) Signed-off-by: Ingo Molnar Reviewed-by: Dietmar Eggemann Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230916232955.2099394-4-qyousef@layalina.io commit 23c9519def98ee0fa97ea5871535e9b136f522fc Author: Qais Yousef Date: Sun Sep 17 00:29:54 2023 +0100 sched/uclamp: Ignore (util == 0) optimization in feec() when p_util_max = 0 find_energy_efficient_cpu() bails out early if effective util of the task is 0 as the delta at this point will be zero and there's nothing for EAS to do. When uclamp is being used, this could lead to wrong decisions when uclamp_max is set to 0. In this case the task is capped to performance point 0, but it is actually running and consuming energy and we can benefit from EAS energy calculations. Rework the condition so that it bails out when both util and uclamp_min are 0. We can do that without needing to use uclamp_task_util(); remove it. Fixes: d81304bc6193 ("sched/uclamp: Cater for uclamp in find_energy_efficient_cpu()'s early exit condition") Signed-off-by: Qais Yousef (Google) Signed-off-by: Ingo Molnar Reviewed-by: Vincent Guittot Reviewed-by: Dietmar Eggemann Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230916232955.2099394-3-qyousef@layalina.io commit 6b00a40147653c8ea748e8f4396510f252763364 Author: Qais Yousef Date: Sun Sep 17 00:29:53 2023 +0100 sched/uclamp: Set max_spare_cap_cpu even if max_spare_cap is 0 When uclamp_max is being used, the util of the task could be higher than the spare capacity of the CPU, but due to uclamp_max value we force-fit it there. The way the condition for checking for max_spare_cap in find_energy_efficient_cpu() was constructed; it ignored any CPU that has its spare_cap less than or _equal_ to max_spare_cap. Since we initialize max_spare_cap to 0; this lead to never setting max_spare_cap_cpu and hence ending up never performing compute_energy() for this cluster and missing an opportunity for a better energy efficient placement to honour uclamp_max setting. max_spare_cap = 0; cpu_cap = capacity_of(cpu) - cpu_util(p); // 0 if cpu_util(p) is high ... util_fits_cpu(...); // will return true if uclamp_max forces it to fit ... // this logic will fail to update max_spare_cap_cpu if cpu_cap is 0 if (cpu_cap > max_spare_cap) { max_spare_cap = cpu_cap; max_spare_cap_cpu = cpu; } prev_spare_cap suffers from a similar problem. Fix the logic by converting the variables into long and treating -1 value as 'not populated' instead of 0 which is a viable and correct spare capacity value. We need to be careful signed comparison is used when comparing with cpu_cap in one of the conditions. Fixes: 1d42509e475c ("sched/fair: Make EAS wakeup placement consider uclamp restrictions") Signed-off-by: Qais Yousef (Google) Signed-off-by: Ingo Molnar Reviewed-by: Vincent Guittot Reviewed-by: Dietmar Eggemann Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230916232955.2099394-2-qyousef@layalina.io commit 5fe7765997b139e2d922b58359dea181efe618f9 Author: Valentin Schneider Date: Thu Sep 28 17:02:51 2023 +0200 sched/deadline: Make dl_rq->pushable_dl_tasks update drive dl_rq->overloaded dl_rq->dl_nr_migratory is increased whenever a DL entity is enqueued and it has nr_cpus_allowed > 1. Unlike the pushable_dl_tasks tree, dl_rq->dl_nr_migratory includes a dl_rq's current task. This means a dl_rq can have a migratable current, N non-migratable queued tasks, and be flagged as overloaded and have its CPU set in the dlo_mask, despite having an empty pushable_tasks tree. Make an dl_rq's overload logic be driven by {enqueue,dequeue}_pushable_dl_task(), in other words make DL RQs only be flagged as overloaded if they have at least one runnable-but-not-current migratable task. o push_dl_task() is unaffected, as it is a no-op if there are no pushable tasks. o pull_dl_task() now no longer scans runqueues whose sole migratable task is their current one, which it can't do anything about anyway. It may also now pull tasks to a DL RQ with dl_nr_running > 1 if only its current task is migratable. Since dl_rq->dl_nr_migratory becomes unused, remove it. RT had the exact same mechanism (rt_rq->rt_nr_migratory) which was dropped in favour of relying on rt_rq->pushable_tasks, see: 612f769edd06 ("sched/rt: Make rt_rq->pushable_tasks updates drive rto_mask") Signed-off-by: Valentin Schneider Signed-off-by: Ingo Molnar Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20230928150251.463109-1-vschneid@redhat.com commit 967dad97757057dcd72ec27cdb3c14c1774f606c Author: Rob Herring Date: Thu Sep 28 14:41:16 2023 -0500 ASoC: dt-bindings: Simplify referencing dai-params.yaml There's generally no need to use definitions to reference from individual properties. All the property names are the same, and all the defined properties are used by all the users. Signed-off-by: Rob Herring Acked-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20230928194126.1146622-1-robh@kernel.org Signed-off-by: Mark Brown commit a9d0eb95dbdbd3fdb8fff2ad94b4356fb9dd5e77 Author: Jouni Högander Date: Thu Sep 28 11:29:24 2023 +0300 drm/i915: Warn on if set frontbuffer return value is not NULL on release i915_gem_object_set_frontbuffer returns set frontbuffer pointer. When we are releasing frontbuffer we are clearing the pointer from the object. Warn on if return value is not null. v3: Check i915_gem_object_set_frontbuffer return value separately v2: Instead of ignoring do drm_WARN_ON Cc: Rodrigo Vivi Cc: Jani Nikula Signed-off-by: Jouni Högander Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230928082924.164720-1-jouni.hogander@intel.com commit 37d62359b15e1f8374e5f8ba9e5fe03408faf864 Author: Nirmoy Das Date: Thu Sep 28 15:00:15 2023 +0200 drm/i915/mtl: Skip MCR ops for ring fault register On MTL GEN12_RING_FAULT_REG is not replicated so don't do mcr based operation for this register. v2: use MEDIA_VER() instead of GRAPHICS_VER()(Matt). v3: s/"MEDIA_VER(i915) == 13"/"MEDIA_VER(i915) >= 13"(Matt) improve comment. v4: improve the comment further(Andi) Signed-off-by: Nirmoy Das Reviewed-by: Matt Roper Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230928130015.6758-4-nirmoy.das@intel.com commit 37280ef5c1c4f600d18dbf8588c4bd3325efe156 Author: Nirmoy Das Date: Thu Sep 28 15:00:14 2023 +0200 drm/i915: Clean steer semaphore on resume During resume, the steer semaphore on GT1 was observed to be held. The hardware team has confirmed the safety of clearing steer semaphores for all GTs during driver load/resume, as no lock acquisitions can occur in this process by other agents. v2: reset on resume not in intel_gt_init(). v3: do the reset on intel_gt_resume_early() v4: do general sanitization for all GTs(Matt) Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230928130015.6758-3-nirmoy.das@intel.com commit 35ba33f76c2f514d6ece6ded44c4bd0d68ba68c9 Author: Nirmoy Das Date: Thu Sep 28 15:00:13 2023 +0200 drm/i915: Introduce the intel_gt_resume_early() Move early resume functions of gt to a proper file. Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230928130015.6758-2-nirmoy.das@intel.com commit 42a71bbaeef2888d3c7a0fe2c7c23c2a399bbf41 Author: Nirmoy Das Date: Thu Sep 28 15:00:12 2023 +0200 drm/i915: Introduce intel_gt_mcr_lock_sanitize() Implement intel_gt_mcr_lock_sanitize() to provide a mechanism for cleaning the steer semaphore when absolutely necessary. v2: remove unnecessary lock(Andi, Matt) improve the kernel doc(Matt) s/intel_gt_mcr_lock_clear/intel_gt_mcr_lock_sanitize Signed-off-by: Nirmoy Das Reviewed-by: Andi Shyti Reviewed-by: Matt Roper Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230928130015.6758-1-nirmoy.das@intel.com commit d85c4229e9256a482b700d713e133ca2f27560fc Author: Mihai Sain Date: Tue Sep 19 15:46:05 2023 +0300 ARM: dts: at91: sama5d29_curiosity: Add device tree for sama5d29_curiosity board Add initial device tree file for sama5d29_curiosity board. Signed-off-by: Mihai Sain Link: https://lore.kernel.org/r/20230919124606.26898-3-mihai.sain@microchip.com Signed-off-by: Claudiu Beznea commit 949652c6bbf43e2a31e1a1b9b988d6bed0fca452 Author: Andrei Simion Date: Tue Sep 19 15:46:04 2023 +0300 dt-bindings: ARM: at91: Document Microchip SAMA5D29 Curiosity Document device tree binding of SAMA5D29 Curiosity, from Microchip. Signed-off-by: Andrei Simion Signed-off-by: Mihai Sain Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230919124606.26898-2-mihai.sain@microchip.com Signed-off-by: Claudiu Beznea commit 03f7b57a5942055ace7ff42c599803461dd20852 Merge: aa511ff8218b3 ceb0416383988 Author: Jens Axboe Date: Thu Sep 28 23:58:34 2023 -0600 Merge tag 'md-next-20230927' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-6.7/block Pull MD updates from Song: "1. Make rdev add/remove independent from daemon thread, by Yu Kuai; 2. Refactor code around quiesce() and mddev_suspend(), by Yu Kuai." * tag 'md-next-20230927' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: replace deprecated strncpy with memcpy md/md-linear: Annotate struct linear_conf with __counted_by md: don't check 'mddev->pers' and 'pers->quiesce' from suspend_lo_store() md: don't check 'mddev->pers' from suspend_hi_store() md-bitmap: suspend array earlier in location_store() md-bitmap: remove the checking of 'pers->quiesce' from location_store() md: don't rely on 'mddev->pers' to be set in mddev_suspend() md: initialize 'writes_pending' while allocating mddev md: initialize 'active_io' while allocating mddev md: delay remove_and_add_spares() for read only array to md_start_sync() md: factor out a helper rdev_addable() from remove_and_add_spares() md: factor out a helper rdev_is_spare() from remove_and_add_spares() md: factor out a helper rdev_removeable() from remove_and_add_spares() md: delay choosing sync action to md_start_sync() md: factor out a helper to choose sync action from md_check_recovery() md: use separate work_struct for md_start_sync() commit 3f0b916f3a7eaa8aab6f6ab465a4f5342b5253c7 Author: Jerome Brunet Date: Mon Sep 25 15:53:26 2023 +0200 arm64: dts: meson: g12: name spdifout consistently g12 and sm1 are fairly similar when it comes to audio. Both have 2 spdif outputs. While the 2nd output is named "spdifout_b" for both, the 1st one is named 'spdifout' for g12 and 'spdifout_a' for sm1. Use 'spdifout_a' for both instead. This change does not fix any particular problem. The intent is just to make it easier to have a common card definitions for platform designs using both SoC families, when spdifout is used. Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20230925135326.1689396-1-jbrunet@baylibre.com Signed-off-by: Neil Armstrong commit d0f3a19a990a8fde6a7730255af74ef8d70c3761 Author: Huqiang Qin Date: Fri Sep 22 17:43:42 2023 +0800 arm64: dts: Add pinctrl node for Amlogic T7 SoCs Add pinctrl device. Signed-off-by: Huqiang Qin Reviewed-by: Neil Armstrong Tested-by: Lucas Tanure Link: https://lore.kernel.org/r/20230922094342.637251-4-huqiang.qin@amlogic.com Signed-off-by: Neil Armstrong commit 4ae7f6320aeb599c10b057abe7fcfcc277532959 Author: Kees Cook Date: Mon Sep 25 10:30:58 2023 -0700 MAINTAINERS: hardening: Add Gustavo as Reviewer It's an oversight to not have already listed Gustavo here. Add him as a Reviewer. Cc: Gustavo A. R. Silva Signed-off-by: Kees Cook commit 5e6a1c803f10afec6f7bf349536ce13f60b4a108 Author: Kees Cook Date: Fri Sep 22 10:54:17 2023 -0700 accel/ivpu: Annotate struct ivpu_job with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ivpu_job. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Jacek Lawrynowicz Cc: Stanislaw Gruszka Cc: Oded Gabbay Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Cc: dri-devel@lists.freedesktop.org Cc: llvm@lists.linux.dev Reviewed-by: Stanislaw Gruszka Link: https://lore.kernel.org/r/20230922175416.work.272-kees@kernel.org Signed-off-by: Kees Cook commit 921f15fe8c8cf9543665bdc556e080a5ecbc34b3 Author: Kees Cook Date: Mon Sep 25 10:17:36 2023 -0700 MAINTAINERS: hardening: Add __counted_by regex Since __counted_by annotations may also require that code be changed to get initialization ordering correct, let's get an extra group of eyes on code that is working on these annotations. Signed-off-by: Kees Cook commit cf77bf698887c3b9ebed76dea492b07a3c2c7632 Author: Ricardo Cañuelo Date: Wed Aug 2 08:32:52 2023 +0200 selftests/lkdtm: Disable CONFIG_UBSAN_TRAP in test config The lkdtm selftest config fragment enables CONFIG_UBSAN_TRAP to make the ARRAY_BOUNDS test kill the calling process when an out-of-bound access is detected by UBSAN. However, after this [1] commit, UBSAN is triggered under many new scenarios that weren't detected before, such as in struct definitions with fixed-size trailing arrays used as flexible arrays. As a result, CONFIG_UBSAN_TRAP=y has become a very aggressive option to enable except for specific situations. `make kselftest-merge` applies CONFIG_UBSAN_TRAP=y to the kernel config for all selftests, which makes many of them fail because of system hangs during boot. This change removes the config option from the lkdtm kselftest and configures the ARRAY_BOUNDS test to look for UBSAN reports rather than relying on the calling process being killed. [1] commit 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS on GCC")' Signed-off-by: Ricardo Cañuelo Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230802063252.1917997-1-ricardo.canuelo@collabora.com Signed-off-by: Kees Cook commit eac80dd4bc22bb754a5476fe5064e662c22f51ba Author: Mark Rutland Date: Thu Sep 21 17:16:34 2023 +0100 lkdtm/bugs: add test for panic() with stuck secondary CPUs Upon a panic() the kernel will use either smp_send_stop() or crash_smp_send_stop() to attempt to stop secondary CPUs via an IPI, which may or may not be an NMI. Generally it's preferable that this is an NMI so that CPUs can be stopped in as many situations as possible, but it's not always possible to provide an NMI, and there are cases where CPUs may be unable to handle the NMI regardless. This patch adds a test for panic() where all other CPUs are stuck with interrupts disabled, which can be used to check whether the kernel gracefully handles CPUs failing to respond to a stop, and whether NMIs actually work to stop CPUs. For example, on arm64 *without* an NMI, this results in: | # echo PANIC_STOP_IRQOFF > /sys/kernel/debug/provoke-crash/DIRECT | lkdtm: Performing direct entry PANIC_STOP_IRQOFF | Kernel panic - not syncing: panic stop irqoff test | CPU: 2 PID: 24 Comm: migration/2 Not tainted 6.5.0-rc3-00077-ge6c782389895-dirty #4 | Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015 | Stopper: multi_cpu_stop+0x0/0x1a0 <- stop_machine_cpuslocked+0x158/0x1a4 | Call trace: | dump_backtrace+0x94/0xec | show_stack+0x18/0x24 | dump_stack_lvl+0x74/0xc0 | dump_stack+0x18/0x24 | panic+0x358/0x3e8 | lkdtm_PANIC+0x0/0x18 | multi_cpu_stop+0x9c/0x1a0 | cpu_stopper_thread+0x84/0x118 | smpboot_thread_fn+0x224/0x248 | kthread+0x114/0x118 | ret_from_fork+0x10/0x20 | SMP: stopping secondary CPUs | SMP: failed to stop secondary CPUs 0-3 | Kernel Offset: 0x401cf3490000 from 0xffff80008000000c0 | PHYS_OFFSET: 0x40000000 | CPU features: 0x00000000,68c167a1,cce6773f | Memory Limit: none | ---[ end Kernel panic - not syncing: panic stop irqoff test ]--- Note the "failed to stop secondary CPUs 0-3" message. On arm64 *with* an NMI, this results in: | # echo PANIC_STOP_IRQOFF > /sys/kernel/debug/provoke-crash/DIRECT | lkdtm: Performing direct entry PANIC_STOP_IRQOFF | Kernel panic - not syncing: panic stop irqoff test | CPU: 1 PID: 19 Comm: migration/1 Not tainted 6.5.0-rc3-00077-ge6c782389895-dirty #4 | Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015 | Stopper: multi_cpu_stop+0x0/0x1a0 <- stop_machine_cpuslocked+0x158/0x1a4 | Call trace: | dump_backtrace+0x94/0xec | show_stack+0x18/0x24 | dump_stack_lvl+0x74/0xc0 | dump_stack+0x18/0x24 | panic+0x358/0x3e8 | lkdtm_PANIC+0x0/0x18 | multi_cpu_stop+0x9c/0x1a0 | cpu_stopper_thread+0x84/0x118 | smpboot_thread_fn+0x224/0x248 | kthread+0x114/0x118 | ret_from_fork+0x10/0x20 | SMP: stopping secondary CPUs | Kernel Offset: 0x55a9c0bc0000 from 0xffff800080000000 | PHYS_OFFSET: 0x40000000 | CPU features: 0x00000000,68c167a1,fce6773f | Memory Limit: none | ---[ end Kernel panic - not syncing: panic stop irqoff test ]--- Note the absence of a "failed to stop secondary CPUs" message, since we don't log anything when secondary CPUs are successfully stopped. Signed-off-by: Mark Rutland Cc: Douglas Anderson Cc: Kees Cook Cc: Stephen Boyd Cc: Sumit Garg Reviewed-by: Kees Cook Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20230921161634.4063233-1-mark.rutland@arm.com Signed-off-by: Kees Cook commit 79fb229b8810071648b65c37382aea7819a5f935 Merge: f107ff76a8c24 78f54469b871d Author: Dave Airlie Date: Fri Sep 29 08:27:00 2023 +1000 Merge tag 'drm-misc-next-2023-09-27' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v6.7-rc1: UAPI Changes: - drm_file owner is now updated during use, in the case of a drm fd opened by the display server for a client, the correct owner is displayed. - Qaic gains support for the QAIC_DETACH_SLICE_BO ioctl to allow bo recycling. Cross-subsystem Changes: - Disable boot logo for au1200fb, mmpfb and unexport logo helpers. Only fbcon should manage display of logo. - Update freescale in MAINTAINERS. - Add some bridge files to bridge in MAINTAINERS. - Update gma500 driver repo in MAINTAINERS to point to drm-misc. Core Changes: - Move size computations to drm buddy allocator. - Make drm_atomic_helper_shutdown(NULL) a nop. - Assorted small fixes in drm_debugfs, DP-MST payload addition error handling. - Fix DRM_BRIDGE_ATTACH_NO_CONNECTOR handling. - Handle bad (h/v)sync_end in EDID by clipping to htotal. - Build GPUVM as a module. Driver Changes: - Simple drivers don't need to cache prepared result. - Call drm_atomic_helper_shutdown() in shutdown/unbind for a whole lot more drm drivers. - Assorted small fixes in amdgpu, ssd130x, bridge/it6621, accel/qaic, nouveau, tc358768. - Add NV12 for komeda writeback. - Add arbitration lost event to synopsis/dw-hdmi-cec. - Speed up s/r in nouveau by not restoring some big bo's. - Assorted nouveau display rework in preparation for GSP-RM, especially related to how the modeset sequence works and the DP sequence in relation to link training. - Update anx7816 panel. - Support NVSYNC and NHSYNC in tegra. - Allow multiple power domains in simple driver. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/f1fae5eb-25b8-192a-9a53-215e1184ce81@linux.intel.com commit b5fc04039b9578d8bcc46bf70bcfe6b137340aeb Author: Sui Jingfeng Date: Fri Aug 25 14:27:14 2023 +0800 drm/radeon: Use pci_get_base_class() to reduce duplicated code Use pci_get_base_class() to reduce duplicated code. No functional change intended. Link: https://lore.kernel.org/r/20230825062714.6325-6-sui.jingfeng@linux.dev Signed-off-by: Sui Jingfeng Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Deucher Cc: Alex Deucher commit 18bf400530ca06e4bffcc9ce4741cf7a3526b85f Author: Sui Jingfeng Date: Fri Aug 25 14:27:13 2023 +0800 drm/amdgpu: Use pci_get_base_class() to reduce duplicated code Use pci_get_base_class() to reduce duplicated code. No functional change intended. Link: https://lore.kernel.org/r/20230825062714.6325-5-sui.jingfeng@linux.dev Signed-off-by: Sui Jingfeng Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Deucher Cc: Alex Deucher commit c213ed390cf1352f954164bad71275d6a095200c Author: Sui Jingfeng Date: Fri Aug 25 14:27:12 2023 +0800 drm/nouveau: Use pci_get_base_class() to reduce duplicated code Use pci_get_base_class() to reduce duplicated code. No functional change intended. Link: https://lore.kernel.org/r/20230825062714.6325-4-sui.jingfeng@linux.dev Signed-off-by: Sui Jingfeng Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Deucher Cc: Ben Skeggs Cc: Karol Herbst Cc: Lyude Paul Cc: David Airlie Cc: Daniel Vetter commit 9ed8fcfd7f17152e6ff5711bb3ddca82f75a38d4 Author: Sui Jingfeng Date: Fri Aug 25 14:27:11 2023 +0800 ALSA: hda: Use pci_get_base_class() to reduce duplicated code Use pci_get_base_class() to reduce duplicated code. No functional change intended. Link: https://lore.kernel.org/r/20230825062714.6325-3-sui.jingfeng@linux.dev Signed-off-by: Sui Jingfeng Signed-off-by: Bjorn Helgaas Reviewed-by: Takashi Iwai Reviewed-by: Alex Deucher Cc: Jaroslav Kysela Cc: Fred Oh Cc: Pierre-Louis Bossart Cc: Kai Vehmanen commit d427da2323b093a65d8317783e76ab8fad2e2ef0 Author: Sui Jingfeng Date: Fri Aug 25 14:27:10 2023 +0800 PCI: Add pci_get_base_class() helper There is no function to get all PCI devices in a system by matching against the base class code only, ignoring the sub-class code and the programming interface. Add pci_get_base_class() to suit the need. For example, if a driver wants to process all PCI display devices in a system, it can do so like this: pdev = NULL; while ((pdev = pci_get_base_class(PCI_BASE_CLASS_DISPLAY, pdev))) { do_something_for_pci_display_device(pdev); } Link: https://lore.kernel.org/r/20230825062714.6325-2-sui.jingfeng@linux.dev Signed-off-by: Sui Jingfeng [bhelgaas: reword commit log] Signed-off-by: Bjorn Helgaas Reviewed-by: Alex Deucher commit fbf6449f84bf5e4ad09f2c09ee70ed7d629b5ff6 Author: Adam Dunlap Date: Mon Sep 11 17:27:03 2023 -0700 x86/sev-es: Set x86_virt_bits to the correct value straight away, instead of a two-phase approach Instead of setting x86_virt_bits to a possibly-correct value and then correcting it later, do all the necessary checks before setting it. At this point, the #VC handler references boot_cpu_data.x86_virt_bits, and in the previous version, it would be triggered by the CPUIDs between the point at which it is set to 48 and when it is set to the correct value. Suggested-by: Dave Hansen Signed-off-by: Adam Dunlap Signed-off-by: Ingo Molnar Tested-by: Jacob Xu Link: https://lore.kernel.org/r/20230912002703.3924521-3-acdunlap@google.com commit f79936545fb122856bd78b189d3c7ee59928c751 Author: Adam Dunlap Date: Mon Sep 11 17:27:02 2023 -0700 x86/sev-es: Allow copy_from_kernel_nofault() in earlier boot Previously, if copy_from_kernel_nofault() was called before boot_cpu_data.x86_virt_bits was set up, then it would trigger undefined behavior due to a shift by 64. This ended up causing boot failures in the latest version of ubuntu2204 in the gcp project when using SEV-SNP. Specifically, this function is called during an early #VC handler which is triggered by a CPUID to check if NX is implemented. Fixes: 1aa9aa8ee517 ("x86/sev-es: Setup GHCB-based boot #VC handler") Suggested-by: Dave Hansen Signed-off-by: Adam Dunlap Signed-off-by: Ingo Molnar Tested-by: Jacob Xu Link: https://lore.kernel.org/r/20230912002703.3924521-2-acdunlap@google.com commit 09f894affcf2daac5aa841ffff43d1242215fd80 Author: Mariusz Tkaczyk Date: Thu Sep 28 14:55:17 2023 +0200 md: do not require mddev_lock() for all options in array_state_store() We don't need to lock device to reject not supported request in array_state_store(). No functional changes intended. There are differences between ioctl and sysfs handling during stopping. With this change, it will be easier to add additional steps which needs to be completed before mddev_lock() is taken. Reviewed-by: Yu Kuai Signed-off-by: Mariusz Tkaczyk Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230928125517.12356-1-mariusz.tkaczyk@linux.intel.com commit 482b9626b95c4f8e5f7f3a9054b496eec4edc8fe Author: Liu Ying Date: Thu Feb 11 12:27:52 2021 +0800 dt-bindings: display: panel: one file of all simple LVDS panels with dual ports To complement panel-simple.yaml, create panel-simple-lvds-dual-ports.yaml. panel-simple-lvds-dual-ports.yaml is for all simple LVDS panels that have dual LVDS ports and require only a single power-supply. The first port receives odd pixels, and the second port receives even pixels. Optionally, a backlight and an enable GPIO can be specified as properties. Panels with swapped pixel order, if any, need dedicated bindings. Migrate 'auo,g133han01', 'auo,g185han01', 'auo,g190ean01', 'koe,tx26d202vm0bwa' and 'nlt,nl192108ac18-02d' over to the new file. The objectives with one file for all the simple LVDS panels with dual ports are: - Make it simpler to add bindings for this kind of LVDS panels - Keep the number of bindings file lower - Keep the binding documentation for this kind of LVDS panels more consistent - Make it possible for drivers to get pixel order via drm_of_lvds_get_dual_link_pixel_order(), as the 'ports' property is required Suggested-by: Sam Ravnborg Cc: Thierry Reding Cc: Sam Ravnborg Cc: David Airlie Cc: Daniel Vetter Cc: Rob Herring Cc: Lucas Stach Cc: Sebastian Reichel Signed-off-by: Liu Ying Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1613017672-2734-1-git-send-email-victor.liu@nxp.com Signed-off-by: Rob Herring commit fc598890715669ff794b253fdf387cd02b9396f8 Author: Tao Zhou Date: Wed Sep 27 18:02:29 2023 +0800 drm/amdgpu: update retry times for psp vmbx wait Increase the retry loops and replace the constant number with macro. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 30a24318cc8f4947c6567c78997c8deb546e7a0b Author: Harry Wentland Date: Thu Oct 27 14:17:48 2022 -0400 drm/amd/display: Skip writeback connector when we get amdgpu_dm_connector [WHY] Writeback connectors are based on a different object: drm_writeback_connector, and are therefore different from amdgpu_dm_connector. We need to be careful to ensure code designed for amdgpu_dm_connector doesn't inadvertently try to operate on a drm_writeback_connector. [HOW] Skip them when connector type is DRM_MODE_CONNECTOR_WRITEBACK. Reviewed-by: Alex Hung Signed-off-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit 1934907234c86514475b00c8169e7b56ef29ed52 Author: Tao Zhou Date: Wed Sep 27 17:59:59 2023 +0800 drm/amdgpu: exit directly if gpu reset fails No need to perform the full reset operation in case of gpu reset failure. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit b57c4f1c3ba52467db6cc6dfbbb217348fd2c288 Author: Victor Zhao Date: Mon Sep 25 14:28:25 2023 +0800 drm/amd/pm: Disallow managing power profiles on SRIOV for gc11.0.3 disable pp_power_profile_mode for sriov on gc11.0.3 as not supported by smu Signed-off-by: Victor Zhao Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 709c348261618da7ed89d6c303e2ceb9e453ba74 Author: Xiaogang Chen Date: Wed Sep 27 11:20:28 2023 -0500 drm/amdkfd: Fix a race condition of vram buffer unref in svm code prange->svm_bo unref can happen in both mmu callback and a callback after migrate to system ram. Both are async call in different tasks. Sync svm_bo unref operation to avoid random "use-after-free". Signed-off-by: Xiaogang Chen Reviewed-by: Philip Yang Reviewed-by: Jesse Zhang Tested-by: Jesse Zhang Signed-off-by: Alex Deucher commit 003048ddf44b1a6cfa57afa5a0cf40673e13f1ba Author: Michel Dänzer Date: Tue Sep 12 12:22:24 2023 +0200 drm/amd/display: Check all enabled planes in dm_check_crtc_cursor It was only checking planes which had any state changes in the same commit. However, it also needs to check other enabled planes. Not doing this meant that a commit might spuriously "succeed", resulting in the cursor plane displaying with incorrect scaling. See https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3177#note_1824263 for an example. Fixes: d1bfbe8a3202 ("amd/display: check cursor plane matches underlying plane") Reviewed-by: Alex Deucher Signed-off-by: Michel Dänzer Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit a2830b9e852f4007f7ee53f2c5765ab07ddb55e2 Author: Alex Hung Date: Wed Nov 2 11:44:08 2022 -0400 drm/amd/display: Initialize writeback connector [WHAT] Create a drm_writeback_connector when connector signal equals SIGNAL_TYPE_VIRTUAL. Reviewed-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit 93499bd6cdcbb89008f6e04c5b5691e49968e3bd Author: Mario Limonciello Date: Mon Sep 25 14:02:22 2023 -0500 drm/amd: Move microcode init from sw_init to early_init for CIK SDMA As part of IP discovery early_init is run for all HW IP blocks. During this phase all firmware is supposed to be identified that may be missing so that the driver can avoid releasing resources used by the EFI framebuffer or simpledrm until the last possible moment. Move microcode loading from sw_init to early_init. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 751e293f2c998eda03004f9b351b0b6bdc335bd9 Author: Mario Limonciello Date: Mon Sep 25 14:02:10 2023 -0500 drm/amd: Move microcode init from sw_init to early_init for SDMA v2.4 As part of IP discovery early_init is run for all HW IP blocks. During this phase all firmware is supposed to be identified that may be missing so that the driver can avoid releasing resources used by the EFI framebuffer or simpledrm until the last possible moment. Move microcode loading from sw_init to early_init. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit cc766304833d1b44a705330383bf2ccee80ab554 Author: Mario Limonciello Date: Mon Sep 25 14:02:02 2023 -0500 drm/amd: Move microcode init from sw_init to early_init for SDMA v3.0 As part of IP discovery early_init is run for all HW IP blocks. During this phase all firmware is supposed to be identified that may be missing so that the driver can avoid releasing resources used by the EFI framebuffer or simpledrm until the last possible moment. Move microcode loading from sw_init to early_init. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit e0d4fbb58c4c0cd381089a6a083a4fa4662f007c Author: Mario Limonciello Date: Mon Sep 25 14:01:50 2023 -0500 drm/amd: Move microcode init from sw_init to early_init for SDMA v5.2 As part of IP discovery early_init is run for all HW IP blocks. During this phase all firmware is supposed to be identified that may be missing so that the driver can avoid releasing resources used by the EFI framebuffer or simpledrm until the last possible moment. Move microcode loading from sw_init to early_init. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 95b456d3b085314bffaa7ad125f3864db525b45b Author: Mario Limonciello Date: Mon Sep 25 14:01:35 2023 -0500 drm/amd: Move microcode init from sw_init to early_init for SDMA v6.0 As part of IP discovery early_init is run for all HW IP blocks. During this phase all firmware is supposed to be identified that may be missing so that the driver can avoid releasing resources used by the EFI framebuffer or simpledrm until the last possible moment. Move microcode loading from sw_init to early_init. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ed1c1053cd00739eed2a96b5e19dd0b5e91477b9 Author: Mario Limonciello Date: Mon Sep 25 13:56:16 2023 -0500 drm/amd: Move microcode init from sw_init to early_init for SDMA v5.0 As part of IP discovery early_init is run for all HW IP blocks. During this phase all firmware is supposed to be identified that may be missing so that the driver can avoid releasing resources used by the EFI framebuffer or simpledrm until the last possible moment. Move microcode loading from sw_init to early_init. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 0c3601a2fbfb265ce283651480e30c8e60459112 Author: Cong Liu Date: Tue Sep 26 13:56:17 2023 +0800 drm/amd/display: Fix null pointer dereference in error message This patch fixes a null pointer dereference in the error message that is printed when the Display Core (DC) fails to initialize. The original message includes the DC version number, which is undefined if the DC is not initialized. Fixes: 9788d087caff ("drm/amd/display: improve the message printed when loading DC") Signed-off-by: Cong Liu Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 554340133e4f596fc40fd75a58f9cf18b6b8dbbc Author: Harry Wentland Date: Wed Nov 2 11:10:12 2022 -0400 drm/amd/display: Create one virtual connector in DC [WHAT] Prepare a virtual connector for writeback. Reviewed-by: Alex Hung Signed-off-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit 161d076c2d163d4e6d83e55a6363eb6070eb36b9 Author: Mario Limonciello Date: Mon Sep 25 13:48:05 2023 -0500 drm/amd: Drop error message about failing to load SDMA firmware The error path for SDMA firmware loading is unnecessarily noisy. When a firmware is missing 3 errors show up: ``` amdgpu 0000:07:00.0: Direct firmware load for amdgpu/green_sardine_sdma.bin failed with error -2 [drm:sdma_v4_0_early_init [amdgpu]] *ERROR* Failed to load sdma firmware! [drm:amdgpu_device_init [amdgpu]] *ERROR* early_init of IP block failed -19 ``` The error code for the device init is bubbled up already, remove the second one. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 2b44d0a417630929d12de355ea4fa48dc80ace18 Author: Le Ma Date: Tue Sep 26 18:56:50 2023 +0800 drm/amd/pm: fix the print_clk_levels issue for SMU v13.0.6 Pass the correct size to smu_v13_0_6_print_clks, otherwise the same place in buf will be re-written. Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 3152d01e881602406ce5aa1f0ef154da56d69fc8 Author: Le Ma Date: Wed Sep 20 15:17:12 2023 +0800 drm/amd/pm: deprecate allow_xgmi_power_down interface Replace with set_plpd_mode uniformly for places to use. Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit c01c8523cb075a8d2869811d7662cc093e780760 Author: Le Ma Date: Wed Sep 20 15:10:48 2023 +0800 drm/amd/pm: integrate plpd allow/disallow into select_xgmi_plpd_policy in ppt level The allow_xgmi_power_down(true/false) will be generally replaced by: - allow: select_xgmi_plpd_policy(XGMI_PLPD_DEFAULT) - disallow: select_xgmi_plpd_policy(XGMI_PLPD_DISALLOW) Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 6ec2f5cd45fc6bb45cd8fd6c9f5f8143e774e1e2 Author: Le Ma Date: Wed Sep 20 11:16:39 2023 +0800 drm/amd/pm: init plpd_mode properly for different asics Assign DEFAULT mode if it supports plpd, otherwise keeps NONE v2: reduce ip version checks Signed-off-by: Le Ma Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 3a41a3982b1e27a6cf7d820aa18a29eabc7daec0 Author: Stylon Wang Date: Wed Sep 20 18:13:35 2023 +0800 drm/amd/display: Remove unused DPCD declarations [Why & How] These DPCD addresses are either declared in other header files where it makes more sense or simply not used by any DC code. Remove them to reduce redundancies and potential confusion. Reviewed-by: Harry Wentland Signed-off-by: Stylon Wang Signed-off-by: Alex Deucher commit 1b097bcd224e76807b66ef32cee76a3e87271a2b Author: Harry Wentland Date: Wed Oct 26 14:08:31 2022 -0400 drm/amd/display: Skip entire amdgpu_dm build if !CONFIG_DRM_AMD_DC [WHY] Previously this only excluded build for a few amdgpu_dm binaries which makes no sense. [HOW] Wrap the entire Makefile in "ifneq ($(CONFIG_DRM_AMD_DC),)" Reviewed-by: Alex Hung Signed-off-by: Harry Wentland Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit 3657a1d5ac8f2072c5d838216d4394a039ca2a17 Author: Mario Limonciello Date: Mon Sep 25 20:31:06 2023 -0500 drm/amd: Limit seamless boot by default to APUs A hang is reported on DCN 3.2 with seamless boot enabled. As the benefits come from an eDP setup, limit it to only enabled by default with APUs. Suggested-by: Alexander.Deucher@amd.com Reported-by: feifei.xu@amd.com Closes: https://lore.kernel.org/amd-gfx/85b427f6-11ec-4249-bf6f-eadf9c375f88@amd.com/T/#m2887e919d7c01b2a4860d2261b366d22e070f309 Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit fcb2f2ed4a80cfe383d87da75caba958516507e9 Author: Yishai Hadas Date: Mon Sep 11 12:38:56 2023 +0300 vfio/mlx5: Activate the chunk mode functionality Now that all pieces are in place, activate the chunk mode functionality based on device capabilities. Signed-off-by: Yishai Hadas Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230911093856.81910-10-yishaih@nvidia.com Signed-off-by: Alex Williamson commit a899cacab56b0dc9a94b7c02007d2f0b2076b18e Author: Yishai Hadas Date: Mon Sep 11 12:38:55 2023 +0300 vfio/mlx5: Add support for READING in chunk mode Add support for READING in chunk mode. In case the last SAVE command recognized that there was still some image to be read, however, there was no available chunk to use for, this task was delayed for the reader till one chunk will be consumed and becomes available. In the above case, a work will be executed to read in the background the next image from the device. Signed-off-by: Yishai Hadas Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230911093856.81910-9-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 67135f29451ef9dc56ff0415705d667267c4d9d2 Author: Yishai Hadas Date: Mon Sep 11 12:38:54 2023 +0300 vfio/mlx5: Add support for SAVING in chunk mode Add support for SAVING in chunk mode, it includes running a work that will fill the next chunk from the device. In case the number of available chunks will reach the MAX_NUM_CHUNKS, the next chunk SAVING will be delayed till the reader will consume one chunk. The next patch from the series will add the reader part of the chunk mode. Signed-off-by: Yishai Hadas Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230911093856.81910-8-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 5798e4dd584f23bb5a4db4c524522c4dd8a84a78 Author: Yishai Hadas Date: Mon Sep 11 12:38:53 2023 +0300 vfio/mlx5: Pre-allocate chunks for the STOP_COPY phase This patch is another preparation step towards working in chunk mode. It pre-allocates chunks for the STOP_COPY phase to let the driver use them immediately and prevent an extra allocation upon that phase. Before that patch we had a single large buffer that was dedicated for the STOP_COPY phase as there was a single SAVE in the source for the last image. Once we'll move to chunk mode the idea is to have some small buffers that will be used upon the STOP_COPY phase. The driver will read-ahead from the firmware the full state in small/optimized chunks while letting QEMU/user space read in parallel the available data. Each buffer holds its chunk number to let it be recognized down the road in the coming patches. The chunk buffer size is picked-up based on the minimum size that firmware requires, the total full size and some max value in the driver code which was set to 8MB to achieve some optimized downtime in the general case. As the chunk mode is applicable even if we move directly to STOP_COPY the buffers preparation and some other related stuff is done unconditionally with regards to STOP/PRE-COPY. Note: In that phase in the series we still didn't activate the chunk mode and the first buffer will be used in all the places. Signed-off-by: Yishai Hadas Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230911093856.81910-7-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 9114100d10b3e970857afd0bc2f296e147fc9392 Author: Yishai Hadas Date: Mon Sep 11 12:38:52 2023 +0300 vfio/mlx5: Rename some stuff to match chunk mode Upon chunk mode there may be multiple images that will be read from the device upon STOP_COPY. This patch is some preparation for that mode by replacing the relevant stuff to a better matching name. As part of that, be stricter to recognize PRE_COPY error only when it didn't occur on a STOP_COPY chunk. Signed-off-by: Yishai Hadas Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230911093856.81910-6-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 543640af84802e84f1e38ee102882d6ae1354701 Author: Yishai Hadas Date: Mon Sep 11 12:38:51 2023 +0300 vfio/mlx5: Enable querying state size which is > 4GB Once the device supports 'chunk mode' the driver can support state size which is larger than 4GB. In that case the device has the capability to split a single image to multiple chunks as long as the software provides a buffer in the minimum size reported by the device. The driver should query for the minimum buffer size required using QUERY_VHCA_MIGRATION_STATE command with the 'chunk' bit set in its input, in that case, the output will include both the minimum buffer size (i.e. required_umem_size) and also the remaining total size to be reported/used where that it will be applicable. At that point in the series the 'chunk' bit is off, the last patch will activate the feature once all pieces will be ready. Note: Before this change we were limited to 4GB state size as of 4 bytes max value based on the device specification for the query/save/load commands. Signed-off-by: Yishai Hadas Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230911093856.81910-5-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 34a64c8eac2380a28eeab191dc5bf4e0dbadf7c6 Author: Yishai Hadas Date: Mon Sep 11 12:38:50 2023 +0300 vfio/mlx5: Refactor the SAVE callback to activate a work only upon an error Upon a successful SAVE callback there is no need to activate a work, all the required stuff can be done directly. As so, refactor the above flow to activate a work only upon an error. Signed-off-by: Yishai Hadas Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230911093856.81910-4-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 82470eba9df97a021309b360ec48342deaa3c7af Author: Yishai Hadas Date: Mon Sep 11 12:38:49 2023 +0300 vfio/mlx5: Wake up the reader post of disabling the SAVING migration file Post of disabling the SAVING migration file, which includes setting the file state to be MLX5_MIGF_STATE_ERROR, call to wake_up_interruptible() on its poll_wait member. This lets any potential reader which is waiting already for data as part of mlx5vf_save_read() to wake up, recognize the error state and return with an error. Post of that we don't need to rely on any other condition to wake up the reader as of the returning of the SAVE command that was previously executed, etc. In addition, this change will simplify error flows (e.g health recovery) once we'll move to chunk mode and multiple SAVE commands may run in the STOP_COPY phase as we won't need to rely any more on a SAVE command to wake-up a potential waiting reader. Signed-off-by: Yishai Hadas Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230911093856.81910-3-yishaih@nvidia.com Signed-off-by: Alex Williamson commit 6581da706473073066e45b8fc4913f61c2bf6e05 Merge: 6465e260f4879 5aa4c9608d2d5 Author: Leon Romanovsky Date: Thu Sep 28 21:43:11 2023 +0300 Merge branch 'mlx5-vfio' into mlx5-next IFC patch for "Add chunk mode support for mlx5 driver" VFIO series. Link: https://lore.kernel.org/all/20230911093856.81910-1-yishaih@nvidia.com/ Signed-off-by: Leon Romanovsky * mlx5-vfio: net/mlx5: Introduce ifc bits for migration in a chunk mode commit 61050c73441be7933d2170642c3f3e36313e56c8 Author: Stefan Hajnoczi Date: Mon Sep 18 16:56:17 2023 -0400 vfio: use __aligned_u64 in struct vfio_device_ioeventfd The memory layout of struct vfio_device_ioeventfd is architecture-dependent due to a u64 field and a struct size that is not a multiple of 8 bytes: - On x86_64 the struct size is padded to a multiple of 8 bytes. - On x32 the struct size is only a multiple of 4 bytes, not 8. - Other architectures may vary. Use __aligned_u64 to make memory layout consistent. This reduces the chance that 32-bit userspace on a 64-bit kernel breakage. This patch increases the struct size on x32 but this is safe because of the struct's argsz field. The kernel may grow the struct as long as it still supports smaller argsz values from userspace (e.g. applications compiled against older kernel headers). The code that uses struct vfio_device_ioeventfd already works correctly when the struct size grows, so only the struct definition needs to be changed. Suggested-by: Jason Gunthorpe Reviewed-by: Jason Gunthorpe Reviewed-by: Kevin Tian Signed-off-by: Stefan Hajnoczi Link: https://lore.kernel.org/r/20230918205617.1478722-4-stefanha@redhat.com Signed-off-by: Alex Williamson commit a7bea9f4fecce0afd37ee58a552eef71d8b4ab9f Author: Stefan Hajnoczi Date: Mon Sep 18 16:56:16 2023 -0400 vfio: use __aligned_u64 in struct vfio_device_gfx_plane_info The memory layout of struct vfio_device_gfx_plane_info is architecture-dependent due to a u64 field and a struct size that is not a multiple of 8 bytes: - On x86_64 the struct size is padded to a multiple of 8 bytes. - On x32 the struct size is only a multiple of 4 bytes, not 8. - Other architectures may vary. Use __aligned_u64 to make memory layout consistent. This reduces the chance of 32-bit userspace on a 64-bit kernel breakage. This patch increases the struct size on x32 but this is safe because of the struct's argsz field. The kernel may grow the struct as long as it still supports smaller argsz values from userspace (e.g. applications compiled against older kernel headers). Suggested-by: Jason Gunthorpe Reviewed-by: Kevin Tian Signed-off-by: Stefan Hajnoczi Link: https://lore.kernel.org/r/20230918205617.1478722-3-stefanha@redhat.com Signed-off-by: Alex Williamson commit 2f8d25fa8aed030d7d049f0aef1b78713f431a79 Author: Stefan Hajnoczi Date: Mon Sep 18 16:56:15 2023 -0400 vfio: trivially use __aligned_u64 for ioctl structs u64 alignment behaves differently depending on the architecture and so offers __aligned_u64 to achieve consistent behavior in kernel<->userspace ABIs. There are structs in that can trivially be updated to __aligned_u64 because the struct sizes are multiples of 8 bytes. There is no change in memory layout on any CPU architecture and therefore this change is safe. The commits that follow this one handle the trickier cases where explanation about ABI breakage is necessary. Suggested-by: Jason Gunthorpe Reviewed-by: Jason Gunthorpe Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Kevin Tian Signed-off-by: Stefan Hajnoczi Link: https://lore.kernel.org/r/20230918205617.1478722-2-stefanha@redhat.com Signed-off-by: Alex Williamson commit 8a97ab9b8b31790d0014d3183f33a167454171c0 Author: Nipun Gupta Date: Fri Sep 15 10:24:23 2023 +0530 vfio-cdx: add bus mastering device feature support Support Bus master enable and disable on VFIO-CDX devices using VFIO_DEVICE_FEATURE_BUS_MASTER flag over VFIO_DEVICE_FEATURE IOCTL. Co-developed-by: Shubham Rohila Signed-off-by: Shubham Rohila Signed-off-by: Nipun Gupta Link: https://lore.kernel.org/r/20230915045423.31630-3-nipun.gupta@amd.com Signed-off-by: Alex Williamson commit f59a7b6af012619199c55f587a6c4ed681639b32 Author: Nipun Gupta Date: Fri Sep 15 10:24:22 2023 +0530 vfio: add bus master feature to device feature ioctl add bus mastering control to VFIO_DEVICE_FEATURE IOCTL. The VFIO user can use this feature to enable or disable the Bus Mastering of a device bound to VFIO. Co-developed-by: Shubham Rohila Signed-off-by: Shubham Rohila Signed-off-by: Nipun Gupta Link: https://lore.kernel.org/r/20230915045423.31630-2-nipun.gupta@amd.com Signed-off-by: Alex Williamson commit a941b784b15ff65e1a3b6a259c6d6cf7fa0bb3c3 Author: Nipun Gupta Date: Fri Sep 15 10:24:21 2023 +0530 cdx: add support for bus mastering Introduce cdx_set_master() and cdx_clear_master() APIs to support enable and disable of bus mastering. Drivers need to use these APIs to enable/disable DMAs from the CDX devices. Signed-off-by: Nipun Gupta Reviewed-by: Pieter Jansen van Vuuren Link: https://lore.kernel.org/r/20230915045423.31630-1-nipun.gupta@amd.com Signed-off-by: Alex Williamson commit c9260693aa0c1e029ed23693cfd4d7814eee6624 Author: Lukas Wunner Date: Thu Sep 21 16:23:34 2023 +0200 PCI: Lengthen reset delay for VideoPropulsion Torrent QN16e card Commit ac91e6980563 ("PCI: Unify delay handling for reset and resume") shortened an unconditional 1 sec delay after a Secondary Bus Reset to 100 msec for PCIe (per PCIe r6.1 sec 6.6.1). The 1 sec delay is only required for Conventional PCI. But it turns out that there are PCIe devices which require a longer delay than prescribed before first config space access after reset recovery or resume from D3cold: Chad reports that a "VideoPropulsion Torrent QN16e" MPEG QAM Modulator "raises a PCI system error (PERR), as reported by the IPMI event log, and the hardware itself would suffer a catastrophic event, cycling the server" unless the longer delay is observed. The card is specified to conform to PCIe r1.0 and indeed only supports Gen1 speed (2.5 GT/s) according to lspci. PCIe r1.0 sec 7.6 prescribes the same 100 msec delay as PCIe r6.1 sec 6.6.1: To allow components to perform internal initialization, system software must wait for at least 100 ms from the end of a reset (cold/warm/hot) before it is permitted to issue Configuration Requests The behavior of the Torrent QN16e card thus appears to be a quirk. Treat it as such and lengthen the reset delay for this specific device. Fixes: ac91e6980563 ("PCI: Unify delay handling for reset and resume") Link: https://lore.kernel.org/r/47727e792c7f0282dc144e3ec8ce8eb6e713394e.1695304512.git.lukas@wunner.de Reported-by: Chad Schroeder Closes: https://lore.kernel.org/linux-pci/DM6PR16MB2844903E34CAB910082DF019B1FAA@DM6PR16MB2844.namprd16.prod.outlook.com/ Tested-by: Chad Schroeder Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # v5.4+ commit a1e16a38968806b5fc855e17bc124d752a6b7fc8 Merge: b6cd17050bc08 5aa4c9608d2d5 Author: Alex Williamson Date: Thu Sep 28 12:06:41 2023 -0600 Merge branch 'mlx5-vfio' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux into v6.7/vfio/next Signed-off-by: Alex Williamson commit 629d3698f6958ee6f8131ea324af794f973b12ac Author: Tao Su Date: Thu Sep 14 13:55:04 2023 +0800 KVM: x86: Clear bit12 of ICR after APIC-write VM-exit When IPI virtualization is enabled, a WARN is triggered if bit12 of ICR MSR is set after APIC-write VM-exit. The reason is kvm_apic_send_ipi() thinks the APIC_ICR_BUSY bit should be cleared because KVM has no delay, but kvm_apic_write_nodecode() doesn't clear the APIC_ICR_BUSY bit. Under the x2APIC section, regarding ICR, the SDM says: It remains readable only to aid in debugging; however, software should not assume the value returned by reading the ICR is the last written value. I.e. the guest is allowed to set bit 12. However, the SDM also gives KVM free reign to do whatever it wants with the bit, so long as KVM's behavior doesn't confuse userspace or break KVM's ABI. Clear bit 12 so that it reads back as '0'. This approach is safer than "do nothing" and is consistent with the case where IPI virtualization is disabled or not supported, i.e., handle_fastpath_set_x2apic_icr_irqoff() -> kvm_x2apic_icr_write() Opportunistically replace the TODO with a comment calling out that eating the write is likely faster than a conditional branch around the busy bit. Link: https://lore.kernel.org/all/ZPj6iF0Q7iynn62p@google.com/ Fixes: 5413bcba7ed5 ("KVM: x86: Add support for vICR APIC-write VM-Exits in x2APIC mode") Cc: stable@vger.kernel.org Signed-off-by: Tao Su Tested-by: Yi Lai Reviewed-by: Chao Gao Link: https://lore.kernel.org/r/20230914055504.151365-1-tao1.su@linux.intel.com [sean: tweak changelog, replace TODO with comment, drop local "val"] Signed-off-by: Sean Christopherson commit 03a6d5986c9dea51f05c66a5f2fee6a15e498160 Author: Rafael J. Wysocki Date: Thu Sep 21 20:06:58 2023 +0200 ACPI: thermal: Rename structure fields holding temperature in deci-Kelvin Rename structure fields holding temperature values in deci-Kelvin so as to avoid temperature units confusion. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano commit c8f46f43a1db7a9a46cd9313aa434380238e874f Author: Rafael J. Wysocki Date: Thu Sep 21 20:04:49 2023 +0200 ACPI: thermal: Drop critical_valid and hot_valid trip flags The critical_valid and hot_valid flags in struct acpi_thermal_trips are only used during initialization and they are only false if the corresponding trip temperatures are equal to THERMAL_TEMP_INVALID, so drop them and use THERMAL_TEMP_INVALID checks instead of them where applicable. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit d5ea889246b112e228433a5f27f57af90ca0c1fb Author: Rafael J. Wysocki Date: Thu Sep 21 20:02:59 2023 +0200 ACPI: thermal: Do not use trip indices for cooling device binding Rearrange the ACPI thermal driver's callback functions used for cooling device binding and unbinding, acpi_thermal_bind_cooling_device() and acpi_thermal_unbind_cooling_device(), respectively, so that they use trip pointers instead of trip indices which is more straightforward and allows the driver to become independent of the ordering of trips in the thermal zone structure. The general functionality is not expected to be changed. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 9cfec6d097c607e36199cf0cfbb8cf5acbd8e9b2 Author: Haitao Shan Date: Tue Sep 12 16:55:45 2023 -0700 KVM: x86: Fix lapic timer interrupt lost after loading a snapshot. When running android emulator (which is based on QEMU 2.12) on certain Intel hosts with kernel version 6.3-rc1 or above, guest will freeze after loading a snapshot. This is almost 100% reproducible. By default, the android emulator will use snapshot to speed up the next launching of the same android guest. So this breaks the android emulator badly. I tested QEMU 8.0.4 from Debian 12 with an Ubuntu 22.04 guest by running command "loadvm" after "savevm". The same issue is observed. At the same time, none of our AMD platforms is impacted. More experiments show that loading the KVM module with "enable_apicv=false" can workaround it. The issue started to show up after commit 8e6ed96cdd50 ("KVM: x86: fire timer when it is migrated and expired, and in oneshot mode"). However, as is pointed out by Sean Christopherson, it is introduced by commit 967235d32032 ("KVM: vmx: clear pending interrupts on KVM_SET_LAPIC"). commit 8e6ed96cdd50 ("KVM: x86: fire timer when it is migrated and expired, and in oneshot mode") just makes it easier to hit the issue. Having both commits, the oneshot lapic timer gets fired immediately inside the KVM_SET_LAPIC call when loading the snapshot. On Intel platforms with APIC virtualization and posted interrupt processing, this eventually leads to setting the corresponding PIR bit. However, the whole PIR bits get cleared later in the same KVM_SET_LAPIC call by apicv_post_state_restore. This leads to timer interrupt lost. The fix is to move vmx_apicv_post_state_restore to the beginning of the KVM_SET_LAPIC call and rename to vmx_apicv_pre_state_restore. What vmx_apicv_post_state_restore does is actually clearing any former apicv state and this behavior is more suitable to carry out in the beginning. Fixes: 967235d32032 ("KVM: vmx: clear pending interrupts on KVM_SET_LAPIC") Cc: stable@vger.kernel.org Suggested-by: Sean Christopherson Signed-off-by: Haitao Shan Link: https://lore.kernel.org/r/20230913000215.478387-1-hshan@google.com Signed-off-by: Sean Christopherson commit bc3d7c5570a03ab45bde4bae83697c80900fb714 Author: Peter Gonda Date: Thu Sep 7 09:24:49 2023 -0700 KVM: SVM: Update SEV-ES shutdown intercepts with more metadata Currently if an SEV-ES VM shuts down userspace sees KVM_RUN struct with only errno=EINVAL. This is a very limited amount of information to debug the situation. Instead return KVM_EXIT_SHUTDOWN to alert userspace the VM is shutting down and is not usable any further. Signed-off-by: Peter Gonda Suggested-by: Sean Christopherson Suggested-by: Tom Lendacky Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Tom Lendacky Cc: Joerg Roedel Cc: Borislav Petkov Cc: x86@kernel.org Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Tom Lendacky Link: https://lore.kernel.org/r/20230907162449.1739785-1-pgonda@google.com [sean: tweak changelog] Signed-off-by: Sean Christopherson commit 377020153617db399334531114fe86a3552e801d Merge: 2713b83cb3b0c d069ed6b752f9 Author: Rafael J. Wysocki Date: Thu Sep 28 19:10:50 2023 +0200 Merge branch 'thermal-core' Merge thermal core changes for v6.7 depended on by subsequent ACPI thermal driver changes: - Drop trips_disabled bitmask that is not really useful any more from the thermal zone structure. - Drop a reduntant NULL pointer check from for_each_thermal_trip(). - Redefine struct thermal_instance to hold a thernal trip pointer instead of a trip index. - Add helpers for binding and unbinding cooling devices to and from trip points, reslectively, that take trip pointers as arguments. * thermal-core: thermal: core: Allow trip pointers to be used for cooling device binding thermal: core: Store trip pointer in struct thermal_instance thermal: trip: Drop redundant trips check from for_each_thermal_trip() thermal: core: Drop trips_disabled bitmask commit 2713b83cb3b0ca78dc16a6968d58bee1342c4bc7 Author: Rafael J. Wysocki Date: Thu Sep 28 17:45:59 2023 +0200 ACPI: thermal: Mark uninitialized active trips as invalid After removing the valid flag from struct acpi_thermal_trip, the trip temperature value is used in validity checks, so it must be THERMAL_TEMP_INVALID for the active trip entries in struct acpi_thermal_trips that are not going to be used (because the corresponding objects are not present in the ACPI tables, for example). Accordingly, modify acpi_thermal_get_trip_points() to set the temperature value to THERMAL_TEMP_INVALID for trip point entries skipped by it after acpi_thermal_init_trip() has returned 'false' for an active trip. Fixes: 058f5e407deb ("ACPI: thermal: Drop valid flag from struct acpi_thermal_trip") Signed-off-by: Rafael J. Wysocki commit 9e09b75079e229b08f12a732712100fdb9af8cab Author: Ruowen Qin Date: Tue Sep 26 23:50:30 2023 -0500 samples/bpf: Add -fsanitize=bounds to userspace programs The sanitizer flag, which is supported by both clang and gcc, would make it easier to debug array index out-of-bounds problems in these programs. Make the Makfile smarter to detect ubsan support from the compiler and add the '-fsanitize=bounds' accordingly. Suggested-by: Mimi Zohar Signed-off-by: Jinghao Jia Signed-off-by: Jinghao Jia Signed-off-by: Ruowen Qin Signed-off-by: Andrii Nakryiko Tested-by: Jiri Olsa Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20230927045030.224548-2-ruowenq2@illinois.edu commit 9896f0608f9fe0b49badd2fd6ae76ec761c70624 Merge: 6016f0cb02f4d 9e61589ac3c2d Author: Kalle Valo Date: Thu Sep 28 19:27:58 2023 +0300 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v6.7. Major changes: ath12k * WCN7850: enable 320 MHz channels in 6 GHz band * WCN7850: hardware rfkill support * WCN7850: enable IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS to make scan faster ath11k * add chip id board name while searching board-2.bin commit 6016f0cb02f4de005d7829da959e774447ff40fb Author: Dmitry Antipov Date: Mon Sep 25 12:04:48 2023 +0300 wifi: rtlwifi: cleanup few rtlxxxx_set_hw_reg() routines Since 'u8' comparison against zero is always false, drop the corresponding branches of AMPDU_MIN_SPACE adjustment within 'rtlxxxx_set_hw_reg()' for rtl8188ee, rtl8192ce, rtl8192de, rtl8723ae, rtl8723be, and rtl8821ae. Compile tested only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230925090452.25633-1-dmantipov@yandex.ru commit f10a570b093e60c6bd3f210ae909f014f421352a Author: Kyle Meyer Date: Thu Aug 24 16:52:46 2023 -0500 KVM: x86: Add CONFIG_KVM_MAX_NR_VCPUS to allow up to 4096 vCPUs Add a Kconfig entry to set the maximum number of vCPUs per KVM guest and set the default value to 4096 when MAXSMP is enabled, as there are use cases that want to create more than the currently allowed 1024 vCPUs and are more than happy to eat the memory overhead. The Hyper-V TLFS doesn't allow more than 64 sparse banks, i.e. allows a maximum of 4096 virtual CPUs. Cap KVM's maximum number of virtual CPUs to 4096 to avoid exceeding Hyper-V's limit as KVM support for Hyper-V is unconditional, and alternatives like dynamically disabling Hyper-V enlightenments that rely on sparse banks would require non-trivial code changes. Suggested-by: Sean Christopherson Signed-off-by: Kyle Meyer Link: https://lore.kernel.org/r/20230824215244.3897419-1-kyle.meyer@hpe.com [sean: massage changelog with --verbose, document #ifdef mess] Signed-off-by: Sean Christopherson commit 8e73c0455b1266146fb972794af1831bd4389eec Author: Zong-Zhe Yang Date: Thu Sep 21 08:35:59 2023 +0800 wifi: rtw89: declare MCC in interface combination MCC (multi-channel concurrency) supports two combinations as below. * P2P-GO + STA * P2P-GC + STA We add the corresponding ieee80211_iface_limit for it into ieee80211_iface_combination. Besides, for multiple channels, it must run with mac80211 chanctx. So, only with it, ieee80211_iface_combination can allow MCC case. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230921003559.11588-5-pkshih@realtek.com commit 0f93824ed720e7149567a9ce5deb700c3b9142b6 Author: Zong-Zhe Yang Date: Thu Sep 21 08:35:58 2023 +0800 wifi: rtw89: 8852c: declare to support two chanctx We are going to allow RTL8852C to support MCC (multi-channel concurrency). So, we increase 8852c::support_chanctx_num up to 2. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230921003559.11588-4-pkshih@realtek.com commit 5f499ce69b8dfcae6c7459eb30175c2495b8441f Author: Zong-Zhe Yang Date: Thu Sep 21 08:35:57 2023 +0800 wifi: rtw89: pause/proceed MCC for ROC and HW scan During (TDMA-based) MCC (multi-channel concurrency), the below two cases might not have a good behavior on channel usage. * ROC (remain on channel) * HW scan So, we tend to separate them from MCC. The two cases would expect to operate the channel to which they want. However, during MCC, channels are scheduled by FW MCC state mechanism. So, channels cannot be controlled explicitly. To avoid the two cases from operating wrong channels with chance, we pause MCC (essentially stop FW MCC) once the two cases are coming. And then, we proceed MCC again (essentially restart FW MCC) once the two cases finish. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230921003559.11588-3-pkshih@realtek.com commit a4d7c872eb87ac00b0af475796f77abda3193b3f Author: Zong-Zhe Yang Date: Thu Sep 21 08:35:56 2023 +0800 wifi: rtw89: mcc: fix NoA start time when GO is auxiliary Under TDMA-based MCC (multi-channel concurrency), there are two roles, reference and auxiliary. We arrange MCC timeline based on time domain of reference role. Then, we calculate NoA start time according to MCC timeline. Besides, when MCC runs GO+STA mode, we plan an offset between GO time domain and STA time domain to make their TBTTs have a time gap. However, if GO is auxiliary role instead of reference role, NoA start time is described by STA time domain instead of GO time domain. To fix this, we apply the offset mentioned above to NoA start time to convert time domain from STA to GO. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230921003559.11588-2-pkshih@realtek.com commit b2172a9330b5e48f37c3d4f29604727228b39885 Author: Colin Ian King Date: Wed Sep 20 13:12:40 2023 +0100 wifi: rt2x00: remove redundant check if u8 array element is less than zero The check on vga_gain[ch_idx] being less than zero is always false since vga_gain is a u8 array. Clean up the code by removing the check and the following assignment. Cleans up clang scan build warning: drivers/net/wireless/ralink/rt2x00/rt2800lib.c:9704:26: warning: result of comparison of unsigned expression < 0 is always false [-Wtautological-unsigned-zero-compare] Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230920121240.120455-1-colin.i.king@gmail.com commit 44a7f34dd8ef9b8dbcceab33ee2d2841bf38d60d Author: Rob Herring Date: Tue Sep 26 11:45:44 2023 -0500 dt-bindings: arm,psci: Add missing unevaluatedProperties on child node schemas Just as unevaluatedProperties or additionalProperties are required at the top level of schemas, they should (and will) also be required for child node schemas. That ensures only documented properties are present for any node. Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230926164553.102914-1-robh@kernel.org Signed-off-by: Rob Herring commit 9e61589ac3c2d23c528d3ffd44604d98553ea1cb Author: Kalle Valo Date: Wed Sep 27 17:27:08 2023 +0300 wifi: ath11k: mac: fix struct ieee80211_sband_iftype_data handling Commit e8c1841278a7 ("wifi: cfg80211: annotate iftype_data pointer with sparse") added sparse checks for struct ieee80211_sband_iftype_data handling which immediately found an issue in ath11k: drivers/net/wireless/ath/ath11k/mac.c:7952:22: warning: incorrect type in argument 1 (different address spaces) drivers/net/wireless/ath/ath11k/mac.c:7952:22: expected struct ieee80211_sta_he_cap const *he_cap drivers/net/wireless/ath/ath11k/mac.c:7952:22: got struct ieee80211_sta_he_cap const [noderef] __iftype_data * The problem here is that we are accessing sband->iftype_data directly even though we should use for_each_sband_iftype_data() or similar. Fortunately there's ieee80211_get_he_iftype_cap_vif() which is just what we need here so use it to get HE capabilities. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Reported-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230927142708.2897504-2-kvalo@kernel.org commit 4fd15bb705d3faa7e6adab2daba2e3af80d9b6bd Author: Dmitry Antipov Date: Tue Sep 26 07:29:04 2023 +0300 wifi: ath11k: fix ath11k_mac_op_remain_on_channel() stack usage When compiling with clang 16.0.6, I've noticed the following: drivers/net/wireless/ath/ath11k/mac.c:8903:12: warning: stack frame size (1032) exceeds limit (1024) in 'ath11k_mac_op_remain_on_channel' [-Wframe-larger-than] static int ath11k_mac_op_remain_on_channel(struct ieee80211_hw *hw, ^ 68/1032 (6.59%) spills, 964/1032 (93.41%) variables So switch to kzalloc()'ed instance of 'struct scan_req_params' like it's done in 'ath11k_mac_op_hw_scan()'. Compile tested only. Signed-off-by: Dmitry Antipov Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230926042906.13725-1-dmantipov@yandex.ru commit ed823fd113b769bf38ca6d0c2e5a588f778b5127 Author: Kang Yang Date: Mon Sep 11 17:30:54 2023 +0800 wifi: ath12k: add msdu_end structure for WCN7850 WCN7850 and QCN9274 currently use the same structure rx_msdu_end_qcn9274 for msdu_end. But content of msdu_end on WCN7850 is different from that of QCN9274. Need to update it for WCN7850, otherwise will get the wrong values when using it. For example, TID is no longer in WCN7850's msdu_end. But ath12k_dp_rx_process_err() and ath12k_dp_rx_process_wbm_err() still get TID from msdu_end. So an uncertain value will be used in these two functions on WCN7850. Therefore, add new structure rx_msdu_end_wcn7850 for WCN7850. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Kang Yang Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230911093054.74943-1-quic_kangyang@quicinc.com commit c4cb46dfb291e1bb13dc2bb8050156bdf1ca406c Author: Sidhanta Sahu Date: Tue Sep 5 14:39:43 2023 -0700 wifi: ath12k: Set default beacon mode to burst mode Currently, firmware does not like when beacon mode is set as staggered mode for more than one beaconing vifs. Beacon mode for multiple beaconing (transmitted) vifs are expected to be in burst mode. So set beacon mode to burst mode by default. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Sidhanta Sahu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230905213943.12275-1-quic_sidhanta@quicinc.com commit 43a10990404f382342e6e4d74d561a30eb933e42 Author: Aloka Dixit Date: Tue Sep 5 10:43:24 2023 -0700 wifi: ath12k: call ath12k_mac_fils_discovery() without condition Mac80211 does not set flags BSS_CHANGED_FILS_DISCOVERY and BSS_CHANGED_UNSOL_BCAST_PROBE_RESP if there are no updates to FILS discovery and unsolicited broadcast probe response transmission configurations respectively. For BSS change operations such as channel switch, this results in the transmissions getting stopped because the driver does not send WMI command to firmware if the flags are not set. Remove the checks for the flags to always send the existing configuration to firmware. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230905174324.25296-1-quic_alokad@quicinc.com commit 87fd0602610d6965c45afc61780ac98842e8f902 Author: Wu Yunchuan Date: Thu Sep 21 11:50:05 2023 +0300 wifi: ath11k: remove unnecessary (void*) conversions No need cast (void *) to (struct ath11k_base *), struct hal_rx_msdu_link *), (struct ath11k_buffer_addr *) or other types. Signed-off-by: Wu Yunchuan Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230919045150.524304-1-yunchuan@nfschina.com commit a1e09eb35476d66d7641c226f7d531cdac844761 Author: Wen Gong Date: Wed Sep 13 06:55:07 2023 -0400 wifi: ath12k: enable IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS for WCN7850 Currently mac80211 will send 3 scan request for each scan of WCN7850, they are 2.4 GHz/5 GHz/6 GHz band scan. Firmware of WCN7850 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 WCN7850 since it supports 2.4 GHz/5 GHz/6 GHz in a single wiphy/ieee80211_hw. This does not impact QCN9274, because it is not single_phy, so does not have 2.4 GHz/5 GHz/6 GHz in the same wiphy, then it does not match the condition and then IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS will not set for QCN9274. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230913105507.17675-1-quic_wgong@quicinc.com commit c86ba8ee7e32d78aaf684483d2b8a7c5a9377fa9 Author: Wen Gong Date: Wed Sep 6 05:03:55 2023 -0400 wifi: ath12k: change to treat alpha code na as world wide regdomain Some firmware versions for WCN7850 report the default regdomain with alpha code "na" by default when load as a world wide regdomain, ath12k should treat it as a world wide alpha code. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230906090355.19181-1-quic_wgong@quicinc.com commit 870c6a72739c4905e592da9c01731f975e46c30a Author: Wen Gong Date: Wed Sep 6 04:57:46 2023 -0400 wifi: ath12k: indicate scan complete for scan canceled when scan running ath12k prints "Received scan event for unknown vdev" when doing the following test: 1. trigger scan 2. wait 0.2 second 3. iw reg set is issued or 11d scan complete event is sent from firmware Reason is: When iw reg set is issues or the 11d scan complete event is received, the new country code will be set to the firmware, and the new regdomain info indicated to ath12k, then the new channel list will be sent to the firmware. The firmware will cancel the current scan after receiving WMI_SCAN_CHAN_LIST_CMDID which is used for the new channel list, and the state of ath12k is ATH12K_SCAN_RUNNING, then ath12k_get_ar_on_scan_abort() returns NULL and ath12k_scan_event() returns at this point and does not indicate scan completion to mac80211. Indicate scan completion to mac80211 and get rid of the "Received scan event for unknown vdev" print for the above case. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230906085746.18968-1-quic_wgong@quicinc.com commit c2ebb1d11ab95cdb56529182a9673ed05c33e7fd Author: Wen Gong Date: Tue Sep 5 06:59:47 2023 -0400 wifi: ath12k: indicate to mac80211 scan complete with aborted flag for ATH12K_SCAN_STARTING state Scan failure can not be recovered from when running a loop of the following steps: 1. run scan: "iw wlan scan". 2. run command: echo assert > /sys/kernel/debug/ath12k/wcn7850\ hw2.0/simulate_fw_crash immediately after step 1. result: scan failed and can not recover even when wlan recovery succeeds: command failed: Device or resource busy (-16) reason: When scan arrives, WMI_START_SCAN_CMDID is sent to the firmware and function ath12k_mac_op_hw_scan() returns, then simulate_fw_crash arrives and the scan started event does not arrive, and then it starts to do recovery of wlan. __ath12k_mac_scan_finish() which is called from ath12k_core_halt() is one step of recovery, it will not call ieee80211_scan_completed() by logic currently because the scan state is ATH12K_SCAN_STARTING. Thus it leads the scan not being completed in mac80211, and leads all consecutive scans failing with -EBUSY in nl80211_trigger_scan even after wlan recovery success. Indicate scan complete with aborted flag to mac80211 for ATH12K_SCAN_STARTING to allow recovery from scan failed with "Device or resource busy (-16)" after wlan recovery. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230905105947.10369-1-quic_wgong@quicinc.com commit ecbb987b0a96b89aef669d3422f1ca09000424dc Author: Wen Gong Date: Tue Sep 5 06:52:29 2023 -0400 wifi: ath12k: fix recovery fail while firmware crash when doing channel switch When firmware crashed while channel switch running, recovery starts in ath12k. Then ieee80211_sta_connection_lost() will be called by function ieee80211_restart_work() in mac80211. And then many WMI command timeout because firmware is crashed. Each WMI command cost 3 seconds, then the total time will be large and leads recovery fail. Hence change to set value ATH12K_FLAG_CRASH_FLUSH early and then ath12k_wmi_cmd_send() will not wait 3 seconds, then recovery will be started quickly and success. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230905105229.10090-1-quic_wgong@quicinc.com commit 004ccbc0dd49c63576a4c60a663a38dd3cb6bee5 Author: Lingbo Kong Date: Wed Sep 6 19:04:12 2023 +0800 wifi: ath12k: add support for hardware rfkill for WCN7850 When hardware rfkill is enabled in the firmware, it will report the capability using WMI_SYS_CAP_INFO_RFKILL bit in the WMI_SERVICE_READY event to the host. Currently ath12k does not process this service capability. In order to support this, update ath12k to check if the capability is enabled, if so, send the GPIO information to firmware. When the firmware detects hardware rfkill is enabled by the user, it will report it using WMI_RFKILL_STATE_CHANGE_EVENTID. When ath12k receive the event, it will set the value of rfkill_radio_on based on whether radio_state is equal to WMI_RFKILL_RADIO_STATE_ON, then send WMI_PDEV_PARAM_RFKILL_ENABLE to firmware. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Lingbo Kong Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230906110412.182176-1-quic_lingbok@quicinc.com commit 8040345fdae4cb256c5d981f91ae0f22bea8adcc Author: Jinjie Ruan Date: Wed Sep 27 17:03:50 2023 +0800 kunit: test: Fix the possible memory leak in executor_test When CONFIG_KUNIT_ALL_TESTS=y, making CONFIG_DEBUG_KMEMLEAK=y and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. If kunit_filter_suites() succeeds, not only copy but also filtered_suite and filtered_suite->test_cases should be freed. So as Rae suggested, to avoid the suite set never be freed when KUNIT_ASSERT_EQ() fails and exits after kunit_filter_suites() succeeds, update kfree_at_end() func to free_suite_set_at_end() to use kunit_free_suite_set() to free them as kunit_module_exit() and kunit_run_all_tests() do it. As the second arg got of free_suite_set_at_end() is a local variable, copy it for free to avoid wild-memory-access. After applying this patch, the following memory leak is never detected. unreferenced object 0xffff8881001de400 (size 1024): comm "kunit_try_catch", pid 1396, jiffies 4294720452 (age 932.801s) hex dump (first 32 bytes): 73 75 69 74 65 32 00 00 00 00 00 00 00 00 00 00 suite2.......... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] __kmalloc_node_track_caller+0x53/0x150 [] kmemdup+0x22/0x50 [] kunit_filter_suites+0x44d/0xcc0 [] filter_suites_test+0x12f/0x360 [] kunit_generic_run_threadfn_adapter+0x4a/0x90 [] kthread+0x2b6/0x380 [] ret_from_fork+0x2d/0x70 [] ret_from_fork_asm+0x11/0x20 unreferenced object 0xffff8881052cd388 (size 192): comm "kunit_try_catch", pid 1396, jiffies 4294720452 (age 932.801s) hex dump (first 32 bytes): a0 85 9e 82 ff ff ff ff 80 cd 7c 84 ff ff ff ff ..........|..... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] __kmalloc+0x52/0x150 [] kunit_filter_suites+0x481/0xcc0 [] filter_suites_test+0x12f/0x360 [] kunit_generic_run_threadfn_adapter+0x4a/0x90 [] kthread+0x2b6/0x380 [] ret_from_fork+0x2d/0x70 [] ret_from_fork_asm+0x11/0x20 unreferenced object 0xffff888100da8400 (size 1024): comm "kunit_try_catch", pid 1398, jiffies 4294720454 (age 781.945s) hex dump (first 32 bytes): 73 75 69 74 65 32 00 00 00 00 00 00 00 00 00 00 suite2.......... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] __kmalloc_node_track_caller+0x53/0x150 [] kmemdup+0x22/0x50 [] kunit_filter_suites+0x44d/0xcc0 [] filter_suites_test_glob_test+0x12f/0x560 [] kunit_generic_run_threadfn_adapter+0x4a/0x90 [] kthread+0x2b6/0x380 [] ret_from_fork+0x2d/0x70 [] ret_from_fork_asm+0x11/0x20 unreferenced object 0xffff888105117878 (size 96): comm "kunit_try_catch", pid 1398, jiffies 4294720454 (age 781.945s) hex dump (first 32 bytes): a0 85 9e 82 ff ff ff ff a0 ac 7c 84 ff ff ff ff ..........|..... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] __kmalloc+0x52/0x150 [] kunit_filter_suites+0x481/0xcc0 [] filter_suites_test_glob_test+0x12f/0x560 [] kunit_generic_run_threadfn_adapter+0x4a/0x90 [] kthread+0x2b6/0x380 [] ret_from_fork+0x2d/0x70 [] ret_from_fork_asm+0x11/0x20 unreferenced object 0xffff888102c31c00 (size 1024): comm "kunit_try_catch", pid 1404, jiffies 4294720460 (age 781.948s) hex dump (first 32 bytes): 6e 6f 72 6d 61 6c 5f 73 75 69 74 65 00 00 00 00 normal_suite.... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] __kmalloc_node_track_caller+0x53/0x150 [] kmemdup+0x22/0x50 [] kunit_filter_attr_tests+0xf7/0x860 [] kunit_filter_suites+0x82f/0xcc0 [] filter_attr_test+0x195/0x5f0 [] kunit_generic_run_threadfn_adapter+0x4a/0x90 [] kthread+0x2b6/0x380 [] ret_from_fork+0x2d/0x70 [] ret_from_fork_asm+0x11/0x20 unreferenced object 0xffff8881052cd250 (size 192): comm "kunit_try_catch", pid 1404, jiffies 4294720460 (age 781.948s) hex dump (first 32 bytes): a0 85 9e 82 ff ff ff ff 00 a9 7c 84 ff ff ff ff ..........|..... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] __kmalloc+0x52/0x150 [] kunit_filter_attr_tests+0x1a1/0x860 [] kunit_filter_suites+0x82f/0xcc0 [] filter_attr_test+0x195/0x5f0 [] kunit_generic_run_threadfn_adapter+0x4a/0x90 [] kthread+0x2b6/0x380 [] ret_from_fork+0x2d/0x70 [] ret_from_fork_asm+0x11/0x20 unreferenced object 0xffff888104f4e400 (size 1024): comm "kunit_try_catch", pid 1408, jiffies 4294720464 (age 781.944s) hex dump (first 32 bytes): 73 75 69 74 65 00 00 00 00 00 00 00 00 00 00 00 suite........... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [] __kmalloc_node_track_caller+0x53/0x150 [] kmemdup+0x22/0x50 [] kunit_filter_attr_tests+0xf7/0x860 [] kunit_filter_suites+0x82f/0xcc0 [] filter_attr_skip_test+0x133/0x6e0 [] kunit_generic_run_threadfn_adapter+0x4a/0x90 [] kthread+0x2b6/0x380 [] ret_from_fork+0x2d/0x70 [] ret_from_fork_asm+0x11/0x20 unreferenced object 0xffff8881052cc620 (size 192): comm "kunit_try_catch", pid 1408, jiffies 4294720464 (age 781.944s) hex dump (first 32 bytes): a0 85 9e 82 ff ff ff ff c0 a8 7c 84 ff ff ff ff ..........|..... 00 00 00 00 00 00 00 00 02 00 00 00 02 00 00 00 ................ backtrace: [] __kmalloc+0x52/0x150 [] kunit_filter_attr_tests+0x1a1/0x860 [] kunit_filter_suites+0x82f/0xcc0 [] filter_attr_skip_test+0x133/0x6e0 [] kunit_generic_run_threadfn_adapter+0x4a/0x90 [] kthread+0x2b6/0x380 [] ret_from_fork+0x2d/0x70 [] ret_from_fork_asm+0x11/0x20 Fixes: e5857d396f35 ("kunit: flatten kunit_suite*** to kunit_suite** in .kunit_test_suites") Fixes: 76066f93f1df ("kunit: add tests for filtering attributes") Signed-off-by: Jinjie Ruan Suggested-by: Rae Moar Reviewed-by: David Gow Suggested-by: David Gow Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309142251.uJ8saAZv-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202309270433.wGmFRGjd-lkp@intel.com/ Signed-off-by: Shuah Khan commit 24de14c98b37ea40a7e493dfd0d93b400b6efbca Author: Jinjie Ruan Date: Wed Sep 27 17:03:49 2023 +0800 kunit: Fix possible memory leak in kunit_filter_suites() If the outer layer for loop is iterated more than once and it fails not in the first iteration, the filtered_suite and filtered_suite->test_cases allocated in the last kunit_filter_attr_tests() in last inner for loop is leaked. So add a new free_filtered_suite err label and free the filtered_suite and filtered_suite->test_cases so far. And change kmalloc_array of copy to kcalloc to Clear the copy to make the kfree safe. Fixes: 529534e8cba3 ("kunit: Add ability to filter attributes") Signed-off-by: Jinjie Ruan Reviewed-by: Rae Moar Reviewed-by: David Gow Signed-off-by: Shuah Khan commit e44679515a7b803cf0143dc9de3d2ecbe907f939 Author: Jinjie Ruan Date: Wed Sep 27 17:03:48 2023 +0800 kunit: Fix the wrong kfree of copy for kunit_filter_suites() If the outer layer for loop is iterated more than once and it fails not in the first iteration, the copy pointer has been moved. So it should free the original copy's backup copy_start. Fixes: abbf73816b6f ("kunit: fix possible memory leak in kunit_filter_suites()") Signed-off-by: Jinjie Ruan Reviewed-by: Rae Moar Reviewed-by: David Gow Signed-off-by: Shuah Khan commit a6074cf0126b0bee51ab77a15930dc24a4d5db90 Author: Jinjie Ruan Date: Wed Sep 27 17:03:47 2023 +0800 kunit: Fix missed memory release in kunit_free_suite_set() modprobe cpumask_kunit and rmmod cpumask_kunit, kmemleak detect a suspected memory leak as below. If kunit_filter_suites() in kunit_module_init() succeeds, the suite_set.start will not be NULL and the kunit_free_suite_set() in kunit_module_exit() should free all the memory which has not been freed. However the test_cases in suites is left out. unreferenced object 0xffff54ac47e83200 (size 512): comm "modprobe", pid 592, jiffies 4294913238 (age 1367.612s) hex dump (first 32 bytes): 84 13 1a f0 d3 b6 ff ff 30 68 1a f0 d3 b6 ff ff ........0h...... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<000000008dec63a2>] slab_post_alloc_hook+0xb8/0x368 [<00000000ec280d8e>] __kmem_cache_alloc_node+0x174/0x290 [<00000000896c7740>] __kmalloc+0x60/0x2c0 [<000000007a50fa06>] kunit_filter_suites+0x254/0x5b8 [<0000000078cc98e2>] kunit_module_notify+0xf4/0x240 [<0000000033cea952>] notifier_call_chain+0x98/0x17c [<00000000973d05cc>] notifier_call_chain_robust+0x4c/0xa4 [<000000005f95895f>] blocking_notifier_call_chain_robust+0x4c/0x74 [<0000000048e36fa7>] load_module+0x1a2c/0x1c40 [<0000000004eb8a91>] init_module_from_file+0x94/0xcc [<0000000037dbba28>] idempotent_init_module+0x184/0x278 [<00000000161b75cb>] __arm64_sys_finit_module+0x68/0xa8 [<000000006dc1669b>] invoke_syscall+0x44/0x100 [<00000000fa87e304>] el0_svc_common.constprop.1+0x68/0xe0 [<000000009d8ad866>] do_el0_svc+0x1c/0x28 [<000000005b83c607>] el0_svc+0x3c/0xc4 Fixes: a127b154a8f2 ("kunit: tool: allow filtering test cases via glob") Signed-off-by: Jinjie Ruan Reviewed-by: Rae Moar Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 55d235ebb684b993b3247740c1c8e273f8af4a54 Author: Sudeep Holla Date: Wed Sep 27 17:26:10 2023 +0100 ACPI: PCC: Add PCC shared memory region command and status bitfields Define the common macros to use when referring to various bitfields in the PCC generic communications channel command and status fields. Currently different drivers that need to use these bitfields have defined these locally. This common macro is intended to consolidate and replace those. Cc: "Rafael J. Wysocki" Link: https://lore.kernel.org/r/20230927-pcc_defines-v2-1-0b8ffeaef2e5@arm.com Signed-off-by: Sudeep Holla commit 013714bf3e125a218bb02c938ff6df348dda743e Author: Phil Sutter Date: Fri Sep 1 14:16:15 2023 +0200 netfilter: nf_tables: Utilize NLA_POLICY_NESTED_ARRAY Mark attributes which are supposed to be arrays of nested attributes with known content as such. Originally suggested for NFTA_RULE_EXPRESSIONS only, but does apply to others as well. Suggested-by: Florian Westphal Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal commit aee1f692bfeda9e5c3a40cbc165d80de0ffb0879 Author: Pablo Neira Ayuso Date: Tue Aug 22 19:11:17 2023 +0200 netfilter: nf_tables: missing extended netlink error in lookup functions Set netlink extended error reporting for several lookup functions which allows userspace to infer what is the error cause. Reported-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal commit 117e149e26d193467a3a136aa4393d32a3e7046f Author: Florian Westphal Date: Tue Aug 15 11:52:41 2023 +0200 selftests: netfilter: test nat source port clash resolution interaction with tcp early demux Test that nat engine resolves the source port clash and tcp packet is passed to the correct socket. While at it, get rid of the iperf3 dependency, just use socat for listener side too. Signed-off-by: Florian Westphal commit e27c3295114bb6a6dc6d58a38f8503c0ea97aa6b Author: Florian Westphal Date: Tue Aug 15 11:52:40 2023 +0200 netfilter: nf_nat: undo erroneous tcp edemux lookup after port clash In commit 03a3ca37e4c6 ("netfilter: nf_nat: undo erroneous tcp edemux lookup") I fixed a problem with source port clash resolution and DNAT. A very similar issue exists with REDIRECT (DNAT to local address) and port rewrites. Consider two port redirections done at prerouting hook: -p tcp --port 1111 -j REDIRECT --to-ports 80 -p tcp --port 1112 -j REDIRECT --to-ports 80 Its possible, however unlikely, that we get two connections sharing the same source port, i.e. saddr:12345 -> daddr:1111 saddr:12345 -> daddr:1112 This works on sender side because destination address is different. After prerouting, nat will change first syn packet to saddr:12345 -> daddr:80, stack will send a syn-ack back and 3whs completes. The second syn however will result in a source port clash: after dnat rewrite, new syn has saddr:12345 -> daddr:80 This collides with the reply direction of the first connection. The NAT engine will handle this in the input nat hook by also altering the source port, so we get for example saddr:13535 -> daddr:80 This allows the stack to send back a syn-ack to that address. Reverse NAT during POSTROUTING will rewrite the packet to daddr:1112 -> saddr:12345 again. Tuple will be unique on-wire and peer can process it normally. Problem is when ACK packet comes in: After prerouting, packet payload is mangled to saddr:12345 -> daddr:80. Early demux will assign the 3whs-completing ACK skb to the first connections' established socket. This will then elicit a challenge ack from the first connections' socket rather than complete the connection of the second. The second connection can never complete. Detect this condition by checking if the associated sockets port matches the conntrack entries reply tuple. If it doesn't, then input source address translation mangled payload after early demux and the found sk is incorrect. Discard this sk and let TCP stack do another lookup. Signed-off-by: Florian Westphal commit 7c7dd1d64910d07ab36b858d53d00e89b6d918d6 Author: Liang Chen Date: Wed Sep 20 20:56:58 2023 +0800 pktgen: Introducing 'SHARED' flag for testing with non-shared skb Currently, skbs generated by pktgen always have their reference count incremented before transmission, causing their reference count to be always greater than 1, leading to two issues: 1. Only the code paths for shared skbs can be tested. 2. In certain situations, skbs can only be released by pktgen. To enhance testing comprehensiveness, we are introducing the "SHARED" flag to indicate whether an SKB is shared. This flag is enabled by default, aligning with the current behavior. However, disabling this flag allows skbs with a reference count of 1 to be transmitted. So we can test non-shared skbs and code paths where skbs are released within the stack. Signed-off-by: Liang Chen Reviewed-by: Benjamin Poirier Link: https://lore.kernel.org/r/20230920125658.46978-2-liangchen.linux@gmail.com Signed-off-by: Paolo Abeni commit 057708a9ca5930d4d9a456c29010f4f90ae760b7 Author: Liang Chen Date: Wed Sep 20 20:56:57 2023 +0800 pktgen: Automate flag enumeration for unknown flag handling When specifying an unknown flag, it will print all available flags. Currently, these flags are provided as fixed strings, which requires manual updates when flags change. Replacing it with automated flag enumeration. Signed-off-by: Liang Chen Signed-off-by: Benjamin Poirier Link: https://lore.kernel.org/r/20230920125658.46978-1-liangchen.linux@gmail.com Signed-off-by: Paolo Abeni commit 458f66c30df2b8495790cf6fca76ebad44046921 Author: Dmitry Antipov Date: Thu Sep 21 11:16:57 2023 +0300 wifi: ath11k: use kstrtoul_from_user() where appropriate Use 'kstrtoul_from_user()' in 'ath11k_write_file_spectral_count()' and 'ath11k_write_file_spectral_bins()' Signed-off-by: Dmitry Antipov Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230824075121.121144-4-dmantipov@yandex.ru commit b5d5c87986d5bfb72320170e76d94eae48635fc1 Author: Amadeusz Sławiński Date: Thu Sep 28 15:47:06 2023 +0200 ASoC: doc: Update codec to codec examples There are examples in documentation for codec to codec connection. However they show method before recent series of patches which renamed the fields. Update documentation accordingly. Fixes: 7ddc7f91beb2 ("ASoC: soc.h: clarify Codec2Codec params") Signed-off-by: Amadeusz Sławiński Link: https://lore.kernel.org/r/20230928134706.662947-1-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown commit 02c4e661658f73d3c266c68f89f0b14bd8ba6bd8 Author: Flavio Suligoi Date: Mon Sep 25 14:26:08 2023 +0200 dt-bindings: backlight: Add MPS MP3309C The Monolithic Power (MPS) MP3309C is a WLED step-up converter, featuring a programmable switching frequency to optimize efficiency. The brightness can be controlled either by I2C commands (called "analog" mode) or by a PWM input signal (PWM mode). This driver supports both modes. For device driver details, please refer to: - drivers/video/backlight/mp3309c_bl.c The datasheet is available at: - https://www.monolithicpower.com/en/mp3309c.html Signed-off-by: Flavio Suligoi Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230925122609.78849-1-f.suligoi@asem.it Signed-off-by: Lee Jones commit 19f5eef8bf732406415b44783ea623e3a31c34c9 Author: Harini Katakam Date: Wed Sep 20 17:20:47 2023 +0530 MAINTAINERS: Add an obsolete entry for LL TEMAC driver LL TEMAC IP is no longer supported. Hence add an entry marking the driver as obsolete. Signed-off-by: Harini Katakam Link: https://lore.kernel.org/r/20230920115047.31345-1-harini.katakam@amd.com Signed-off-by: Paolo Abeni commit 52e856c38761bae0cea09b25cfbb4d46cd930d45 Merge: 73c7e7a91f041 cfa92b6d52071 Author: Jens Axboe Date: Thu Sep 28 07:47:07 2023 -0600 Merge branch 'locking/core' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into io_uring-futex Pull in locking/core from the tip tree, to get the futex2 dependencies from Peter Zijlstra. * 'locking/core' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits) locking/ww_mutex/test: Make sure we bail out instead of livelock locking/ww_mutex/test: Fix potential workqueue corruption locking/ww_mutex/test: Use prng instead of rng to avoid hangs at bootup futex: Add sys_futex_requeue() futex: Add flags2 argument to futex_requeue() futex: Propagate flags into get_futex_key() futex: Add sys_futex_wait() futex: FLAGS_STRICT futex: Add sys_futex_wake() futex: Validate futex value against futex size futex: Flag conversion futex: Extend the FUTEX2 flags futex: Clarify FUTEX2 flags asm-generic: ticket-lock: Optimize arch_spin_value_unlocked() futex/pi: Fix recursive rt_mutex waiter state locking/rtmutex: Add a lockdep assert to catch potential nested blocking locking/rtmutex: Use rt_mutex specific scheduler helpers sched: Provide rt_mutex specific scheduler helpers sched: Extract __schedule_loop() locking/rtmutex: Avoid unconditional slowpath for DEBUG_RT_MUTEXES ... commit 73c7e7a91f041f4c2e3c0db1e727163b331c60c9 Merge: 6465e260f4879 93b8cc60c37b9 Author: Jens Axboe Date: Thu Sep 28 07:46:55 2023 -0600 Merge branch 'for-6.7/io_uring' into io_uring-futex * for-6.7/io_uring: io_uring: cancelable uring_cmd io_uring: retain top 8bits of uring_cmd flags for kernel internal use io_uring: add IORING_OP_WAITID support exit: add internal include file with helpers exit: add kernel_waitid_prepare() helper exit: move core of do_wait() into helper exit: abstract out should_wake helper for child_wait_callback() io_uring/rw: add support for IORING_OP_READ_MULTISHOT io_uring/rw: mark readv/writev as vectored in the opcode definition io_uring/rw: split io_read() into a helper commit 416a01a4dacf06e5e129deab39ea8227cae903bf Merge: c1fec890458ad e738e35504523 Author: Paolo Abeni Date: Thu Sep 28 15:45:25 2023 +0200 Merge tag 'mlx5-updates-2023-09-19' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2023-09-19 Misc updates for mlx5 driver 1) From Erez, Add support for multicast forwarding to multi destination in bridge offloads with software steering mode (SMFS). 2) From Jianbo, Utilize the maximum aggregated link speed for police action rate. 3) From Moshe, Add a health error syndrome for pci data poisoned 4) From Shay, Enable 4 ports multiport E-switch 5) From Jiri, Trivial SF code cleanup ==================== Link: https://lore.kernel.org/r/20230920063552.296978-1-saeed@kernel.org Signed-off-by: Paolo Abeni commit 93b8cc60c37b9d17732b7a297e5dca29b50a990d Author: Ming Lei Date: Thu Sep 28 20:43:25 2023 +0800 io_uring: cancelable uring_cmd uring_cmd may never complete, such as ublk, in which uring cmd isn't completed until one new block request is coming from ublk block device. Add cancelable uring_cmd to provide mechanism to driver for cancelling pending commands in its own way. Add API of io_uring_cmd_mark_cancelable() for driver to mark one command as cancelable, then io_uring will cancel this command in io_uring_cancel_generic(). ->uring_cmd() callback is reused for canceling command in driver's way, then driver gets notified with the cancelling from io_uring. Add API of io_uring_cmd_get_task() to help driver cancel handler deal with the canceling. Reviewed-by: Gabriel Krisman Bertazi Suggested-by: Jens Axboe Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 528ce6781726e022bc5dc84034360e6e8f1b89bd Author: Ming Lei Date: Thu Sep 28 20:43:24 2023 +0800 io_uring: retain top 8bits of uring_cmd flags for kernel internal use Retain top 8bits of uring_cmd flags for kernel internal use, so that we can move IORING_URING_CMD_POLLED out of uapi header. Reviewed-by: Gabriel Krisman Bertazi Reviewed-by: Anuj Gupta Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 37b4346ed8681660ae60de4facc3d499d8e5cf2a Merge: 54ac512048c98 4717636f3fc25 Author: Mark Brown Date: Thu Sep 28 15:22:35 2023 +0200 ASoC: codecs: Add aw87390 amplifier driver Merge series from wangweidong.a@awinic.com: The awinic aw87390 is a new high efficiency, low noise, constant large volume, 6th Smart K audio amplifier. commit 54ac512048c98b720a8fbf5899308788dff8def0 Merge: 67fcdbfd9e133 d9ef56d94fac5 Author: Mark Brown Date: Thu Sep 28 14:42:32 2023 +0200 ASoC: codecs: rtq9128: Add TDM input source select Merge series from cy_huang@richtek.com: This patch series create a TDM source select property and use it to decide which TDM data source is connected. Following by the below patch disccuion https://lore.kernel.org/lkml/1695780376-32301-1-git-send-email-cy_huang@richtek.com/#t It may not be a good choice to add the user controlable mixer control item. Since it follows the board design, make it as a device property. commit 4717636f3fc257f2d35acbf5b5c21d0831d701da Author: Weidong Wang Date: Thu Sep 28 18:57:27 2023 +0800 ASoC: codecs: Add aw87390 amplifier driver Add i2c and amplifier registration for aw87390 and their associated operation functions. Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20230928105727.47273-11-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit f83287a72551833a6fe2fc96f334b26e6eba77e8 Author: Weidong Wang Date: Thu Sep 28 18:57:26 2023 +0800 ASoC: codecs: Modify the transmission mode of function parameters Change the transmission mode of the "aw88261_dev_get_prof_name" function parameter Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20230928105727.47273-10-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit c786770ed8a53836490f6157f40ef83c7149ee75 Author: Weidong Wang Date: Thu Sep 28 18:57:25 2023 +0800 ASoC: codecs: Rename "sync-flag" to "awinic,sync-flag" Rename "sync-flag" to "awinic,sync-flag", this is to be consistent with the "awinic,aw88395.yaml" file Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20230928105727.47273-9-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit b116c832c9e84843c64eed087271e29b3bc6c1b8 Author: Weidong Wang Date: Thu Sep 28 18:57:24 2023 +0800 ASoC: codecs: Add code for bin parsing compatible with aw87390 Add aw87390 compatible code to the aw88395_lib.c file so that it can parse aw87390's bin file Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20230928105727.47273-8-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit 6a4c3ce3f06cee1c25420cae8634269021ef8504 Author: Weidong Wang Date: Thu Sep 28 18:57:23 2023 +0800 ASoC: codecs: Modify i2c driver name Change the name of the i2c driver, this is to be consistent with the "awinic,aw88395.yaml" file Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20230928105727.47273-7-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit e83219c94abb4ad977f6b2b8be7d466ef0c2248f Author: Weidong Wang Date: Thu Sep 28 18:57:22 2023 +0800 ASoC: codecs: Modify the transmission method of parameters Change the transmission mode of the "aw88395_dev_get_prof_name" function parameter, Instead of using return values for data transfer, parameters are used Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20230928105727.47273-6-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit 74ff4f22d81e97b5c2505cee2ff743fc9249d9e2 Author: Weidong Wang Date: Thu Sep 28 18:57:21 2023 +0800 ASoC: codecs: Rename "sound-channel" to "awinic,audio-channel" Rename "sound-channel" to "awinic,audio-channel", this is to be consistent with the "awinic,aw88395.yaml" file Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20230928105727.47273-5-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit 085370aa8c880da7014d0d8f93343fc1d21104b8 Author: Weidong Wang Date: Thu Sep 28 18:57:20 2023 +0800 ASoC: codecs: Remove the "fade-enable property" Remove the "fade-enable" property because the "fade_step" property already implement this functionality. Signed-off-by: Weidong Wang Link: https://lore.kernel.org/r/20230928105727.47273-4-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit 457b6587c112e162d3bec871c7b93359168d5c0a Author: Weidong Wang Date: Thu Sep 28 18:57:19 2023 +0800 ASoC: dt-bindings: Add schema for "awinic,aw87390" Add a DT schema for describing awinic aw87390 audio amplifiers. They are controlled using I2C. Signed-off-by: Weidong Wang Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230928105727.47273-3-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit b99d8d8adfda1f9220dd2ee9bdb96ba02dc62bd7 Author: Weidong Wang Date: Thu Sep 28 18:57:18 2023 +0800 ASoC: dt-bindings: awinic,aw88395: Add properties for multiple PA support Add two properties, the "awinic,audio-channel" property and the "awinic,sync-flag". The "awinic,audio-channel" is used to make different PA load different configurations, the "awinic,sync-flag" is used to synchronize the phases of multiple PA. These two properties will be read by the corresponding driver, allowing multi-PA to achieve better playback effect. Signed-off-by: Weidong Wang Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230928105727.47273-2-wangweidong.a@awinic.com Signed-off-by: Mark Brown commit a04bbeaa37d8789de5592506fa776256e784b69c Author: Kees Cook Date: Thu Aug 17 16:58:58 2023 -0700 dmaengine: usb-dmac: Annotate struct usb_dmac_desc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct usb_dmac_desc. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Yu Kuai Cc: Greg Kroah-Hartman Cc: Jordy Zomer Cc: Jernej Skrabec Cc: Tudor Ambarus Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-21-keescook@chromium.org Signed-off-by: Vinod Koul commit 7935de861aed45f97a4262d9b215d9feb172516b Author: Kees Cook Date: Thu Aug 17 16:58:57 2023 -0700 dmaengine: uniphier-xdmac: Annotate struct uniphier_xdmac_device with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct uniphier_xdmac_device. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Kunihiko Hayashi Cc: Masami Hiramatsu Cc: dmaengine@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-20-keescook@chromium.org Signed-off-by: Vinod Koul commit 5a67a8f93f02027e4ac8583715d2f4bd2de20e10 Author: Kees Cook Date: Thu Aug 17 16:58:56 2023 -0700 dmaengine: uniphier-xdmac: Annotate struct uniphier_xdmac_desc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct uniphier_xdmac_desc. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Kunihiko Hayashi Cc: Masami Hiramatsu Cc: dmaengine@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-19-keescook@chromium.org Signed-off-by: Vinod Koul commit b85178611c1156deb3c09e7f8d8cdd662b8df99c Author: Kees Cook Date: Thu Aug 17 16:58:55 2023 -0700 dmaengine: ti: omap-dma: Annotate struct omap_desc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct omap_desc. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Peter Ujfalusi Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-18-keescook@chromium.org Signed-off-by: Vinod Koul commit 5f240e0cdbcb0cc60d6a75ea7d492ce93b7fd52e Author: Kees Cook Date: Thu Aug 17 16:58:54 2023 -0700 dmaengine: ti: edma: Annotate struct edma_desc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct edma_desc. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Peter Ujfalusi Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-17-keescook@chromium.org Signed-off-by: Vinod Koul commit 15f2c636dde8c4370db87ceabce5cc8325460d77 Author: Kees Cook Date: Thu Aug 17 16:58:53 2023 -0700 dmaengine: tegra210-adma: Annotate struct tegra_adma with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct tegra_adma. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Laxman Dewangan Cc: Jon Hunter Cc: Thierry Reding Cc: dmaengine@vger.kernel.org Cc: linux-tegra@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-16-keescook@chromium.org Signed-off-by: Vinod Koul commit 32b5e2d7cd14c80de1fa1cdffcc6ec211b615d82 Author: Kees Cook Date: Thu Aug 17 16:58:52 2023 -0700 dmaengine: tegra: Annotate struct tegra_dma_desc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct tegra_dma_desc. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Laxman Dewangan Cc: Jon Hunter Cc: Thierry Reding Cc: dmaengine@vger.kernel.org Cc: linux-tegra@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-15-keescook@chromium.org Signed-off-by: Vinod Koul commit 7ba0035dc02ce0c877004dc4052c6d5f873539db Author: Kees Cook Date: Thu Aug 17 16:58:51 2023 -0700 dmaengine: stm32-mdma: Annotate struct stm32_mdma_device with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct stm32_mdma_device. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: dmaengine@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-14-keescook@chromium.org Signed-off-by: Vinod Koul commit 035472170a2a21fc62d8258883a9f566943058b7 Author: Kees Cook Date: Thu Aug 17 16:58:50 2023 -0700 dmaengine: stm32-mdma: Annotate struct stm32_mdma_desc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct stm32_mdma_desc. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: dmaengine@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-13-keescook@chromium.org Signed-off-by: Vinod Koul commit 195e46df2d996ff4bbf624891b1d3ae8ea9f315d Author: Kees Cook Date: Thu Aug 17 16:58:49 2023 -0700 dmaengine: stm32-dma: Annotate struct stm32_dma_desc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct stm32_dma_desc. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: dmaengine@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-12-keescook@chromium.org Signed-off-by: Vinod Koul commit 8279f0b476f37c51de2ed8bd70d770b2893dd2fa Author: Kees Cook Date: Thu Aug 17 16:58:48 2023 -0700 dmaengine: st_fdma: Annotate struct st_fdma_desc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct st_fdma_desc. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Patrice Chotard Cc: linux-arm-kernel@lists.infradead.org Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-11-keescook@chromium.org Signed-off-by: Vinod Koul commit 8360c11aef5775745fc10438e24db95ab2329b1d Author: Kees Cook Date: Thu Aug 17 16:58:47 2023 -0700 dmaengine: sprd: Annotate struct sprd_dma_dev with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct sprd_dma_dev. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Orson Zhai Cc: Baolin Wang Cc: Chunyan Zhang Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook Acked-by: Chunyan Zhang Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-10-keescook@chromium.org Signed-off-by: Vinod Koul commit 1539a22e144106eefc0ef05e7b91f68ad20a71ad Author: Kees Cook Date: Thu Aug 17 16:58:46 2023 -0700 dmaengine: sf-pdma: Annotate struct sf_pdma with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct sf_pdma. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Green Wan Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-9-keescook@chromium.org Signed-off-by: Vinod Koul commit 04b5433b8c0e1b014f081f4bf79767bbc207a7b0 Author: Kees Cook Date: Thu Aug 17 16:58:45 2023 -0700 dmaengine: sa11x0: Annotate struct sa11x0_dma_desc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct sa11x0_dma_desc. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-8-keescook@chromium.org Signed-off-by: Vinod Koul commit b9fe0bd5903140cc3e1ae4e542ae7ff38c90d011 Author: Kees Cook Date: Thu Aug 17 16:58:44 2023 -0700 dmaengine: qcom: bam_dma: Annotate struct bam_async_desc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct bam_async_desc. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Andy Gross Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-7-keescook@chromium.org Signed-off-by: Vinod Koul commit fd1cb31a037bf8894a710392c2354281c5276d09 Author: Kees Cook Date: Thu Aug 17 16:58:43 2023 -0700 dmaengine: moxart-dma: Annotate struct moxart_desc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct moxart_desc. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-6-keescook@chromium.org Signed-off-by: Vinod Koul commit 7d4b82185521538eab8b0532b9bd7b8c8ca3e63b Author: Kees Cook Date: Thu Aug 17 16:58:42 2023 -0700 dmaengine: hisilicon: Annotate struct hisi_dma_dev with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct hisi_dma_dev. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Zhou Wang Cc: Jie Hai Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-5-keescook@chromium.org Signed-off-by: Vinod Koul commit f1bc0d01cb349da43d55548b57c915ef8fe024c7 Author: Kees Cook Date: Thu Aug 17 16:58:40 2023 -0700 dmaengine: axi-dmac: Annotate struct axi_dmac_desc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct axi_dmac_desc. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Lars-Peter Clausen Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-3-keescook@chromium.org Signed-off-by: Vinod Koul commit 81cd3cb3b3dd37df1fc45c5b6443a07bc2a7fee4 Author: Kees Cook Date: Thu Aug 17 16:58:39 2023 -0700 dmaengine: at_hdmac: Annotate struct at_desc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct at_desc. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Ludovic Desroches Cc: Tudor Ambarus Cc: linux-arm-kernel@lists.infradead.org Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Tudor Ambarus Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-2-keescook@chromium.org Signed-off-by: Vinod Koul commit 83c5d35bf9112577da097c1b4fbfedef93b951e6 Author: Kees Cook Date: Thu Aug 17 16:58:38 2023 -0700 dmaengine: apple-admac: Annotate struct admac_data with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct admac_data. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Vinod Koul Cc: Hector Martin Cc: Sven Peter Cc: Alyssa Rosenzweig Cc: asahi@lists.linux.dev Cc: linux-arm-kernel@lists.infradead.org Cc: dmaengine@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230817235859.49846-1-keescook@chromium.org Signed-off-by: Vinod Koul commit 5aa4c9608d2d5fea29e211a80c29696f7d94e9f7 Author: Yishai Hadas Date: Mon Sep 11 12:38:48 2023 +0300 net/mlx5: Introduce ifc bits for migration in a chunk mode Introduce ifc related stuff to enable migration in a chunk mode. Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/20230911093856.81910-2-yishaih@nvidia.com Reviewed-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky commit d069ed6b752f91cea6341a9c60be42837678a7f5 Author: Rafael J. Wysocki Date: Thu Sep 21 20:01:43 2023 +0200 thermal: core: Allow trip pointers to be used for cooling device binding Add new helper functions, thermal_bind_cdev_to_trip() and thermal_unbind_cdev_from_trip(), to allow a trip pointer to be used for binding a cooling device to a trip point and unbinding it, respectively, and redefine the existing helpers, thermal_zone_bind_cooling_device() and thermal_zone_unbind_cooling_device(), as wrappers around the new ones, respectively. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 2c7b4bfadef08cc0995c24a7b9eb120fe897165f Author: Rafael J. Wysocki Date: Thu Sep 21 19:52:44 2023 +0200 thermal: core: Store trip pointer in struct thermal_instance Replace the integer trip number stored in struct thermal_instance with a pointer to the relevant trip and adjust the code using the structure in question accordingly. The main reason for making this change is to allow the trip point to cooling device binding code more straightforward, as illustrated by subsequent modifications of the ACPI thermal driver, but it also helps to clarify the overall design and allows the governor code overhead to be reduced (through subsequent modifications). The only case in which it adds complexity is trip_point_show() that needs to walk the trips[] table to find the index of the given trip point, but this is not a critical path and the interface that trip_point_show() belongs to is problematic anyway (for instance, it doesn't cover the case when the same cooling devices is associated with multiple trip points). This is a preliminary change and the affected code will be refined by a series of subsequent modifications of thermal governors, the core and the ACPI thermal driver. The general functionality is not expected to be affected by this change. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 3e7d6f396d74a3e40c390bb53947938957426097 Author: Rafael J. Wysocki Date: Thu Sep 21 19:51:19 2023 +0200 ACPI: thermal: Merge trip initialization functions In order to reduce code duplicationeve further, merge acpi_thermal_init_passive/active_trip() into one function called acpi_thermal_init_trip() that will be used for initializing both the passive and active trip points. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 54fc61a106c9b7fb55a3c6a595349826c0548468 Author: Rafael J. Wysocki Date: Thu Sep 21 19:50:08 2023 +0200 ACPI: thermal: Collapse trip devices update function wrappers In order to reduce code duplicationeve further, merge acpi_thermal_update_passive/active_devices() into one function called acpi_thermal_update_trip_devices() that will be used for updating both the passive and active trip points. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 317508c65f1f966367553ef84f5d8eba16720f32 Author: Rafael J. Wysocki Date: Thu Sep 21 19:49:24 2023 +0200 ACPI: thermal: Collapse trip devices update functions In order to reduce code duplication, merge update_passive_devices() and update_active_devices() into one function called update_trip_devices() that will be used for updating both the passive and active trip points. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 0fa1bf34980eba19a5f07f97297bbd60b796e6d1 Author: Rafael J. Wysocki Date: Thu Sep 21 19:48:33 2023 +0200 ACPI: thermal: Add device list to struct acpi_thermal_trip The device lists present in struct acpi_thermal_passive and struct acpi_thermal_active can be located in struct acpi_thermal_trip which then will allow the same code to be used for handling both the passive and active trip points, so make that change. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 65b87548041ad70a8e26af08c0dda0b5893baf6b Author: Jonathan Neuschäfer Date: Sun Sep 24 17:23:32 2023 +0200 dmaengine: hisi: Simplify preconditions of CONFIG_K3_DMA Commit e39a2329cfb09 ("Kconfig: Allow k3dma driver to be selected for more then HISI3xx platforms") expanded the "depends on" line of K3_DMA from "ARCH_HI3xxx" to "ARCH_HI3xxx || ARCH_HISI || COMPILE_TEST". However, ARCH_HI3xxx implies ARCH_HISI, so it's unnecessary to list both. Instead, just list ARCH_HISI, which covers all HiSilicon platforms. Signed-off-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/20230924152332.2254305-1-j.neuschaefer@gmx.net Signed-off-by: Vinod Koul commit 5fa4704d14b29ca59e80212e0a067b0c83b42d42 Author: Yue Haibing Date: Sat Jul 29 20:28:58 2023 +0800 xfrm: Remove unused function declarations commit a269fbfc4e9f ("xfrm: state: remove extract_input indirection from xfrm_state_afinfo") left behind this. Signed-off-by: Yue Haibing Signed-off-by: Steffen Klassert commit 49d371ab9d2c850867332b469fa6b3a2d5cf338c Author: Uwe Kleine-König Date: Wed Sep 27 10:10:40 2023 +0200 platform/x86/siemens: simatic-ipc-batt-f7188x: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-28-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 0d643dcd78423afad7204a280dc25dc67bcd85c0 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:39 2023 +0200 platform/x86/siemens: simatic-ipc-batt-elkhartlake: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-27-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit e139d97f049a8d924f91700a9a5f28c8bfe676d3 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:38 2023 +0200 platform/x86/siemens: simatic-ipc-batt-apollolake: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-26-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 2f46e417384e0412c5e239fe6a84ace7d955b33e Author: Uwe Kleine-König Date: Wed Sep 27 10:10:37 2023 +0200 platform/x86/siemens: simatic-ipc-batt: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-25-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 0580422560e2b93fe2e343d8438823824729a574 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:36 2023 +0200 platform/x86/siemens: simatic-ipc-batt: Simplify simatic_ipc_batt_remove() Instead of unconditionally returning zero, let simatic_ipc_batt_remove() return no value. This is a preparation to convert the drivers using this function to struct platform_driver::remove_new(). Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-24-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 9e6b44d43e31160bfba568244c785f439ac33d0e Author: Uwe Kleine-König Date: Wed Sep 27 10:10:35 2023 +0200 platform/x86: sel3350-platform: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-23-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 1348317db770681cde4c6ac04afd75a1b0a99098 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:34 2023 +0200 platform/x86: mlx-platform: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-22-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 3e29812e6e172ba772761e6995753b729e8a6f77 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:33 2023 +0200 platform/x86/intel: bytcrc_pwrsrc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-21-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 61e2e9ee39d921756050dafeb91537284139f611 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:32 2023 +0200 platform/mellanox: nvsw-sn2201: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-20-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit cfae9860ca990c5a642da85e01e0eb2e7dd9db35 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:31 2023 +0200 platform/mellanox: mlxreg-lc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-19-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit e0489bb002ff581f9439de2d22b49e140e73e6b4 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:30 2023 +0200 platform/mellanox: mlxreg-io: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-18-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit a62507eb57124f4889b97de9917a164bf3109aa6 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:29 2023 +0200 platform/mellanox: mlxreg-hotplug: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-17-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit db971cf26014948d642522dae9a01968d009751c Author: Uwe Kleine-König Date: Wed Sep 27 10:10:28 2023 +0200 platform/mellanox: mlxbf-tmfifo: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-16-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit a6cff4212984010c119263593c0a249e15ad5caf Author: Uwe Kleine-König Date: Wed Sep 27 10:10:27 2023 +0200 platform/mellanox: mlxbf-bootctl: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-15-u.kleine-koenig@pengutronix.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 6260ecd04594360ae2af104fb2641317728a66e4 Author: Kees Cook Date: Fri Sep 22 10:51:27 2023 -0700 irqdomain: Annotate struct irq_domain with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct irq_domain. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Signed-off-by: Thomas Gleixner Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922175127.work.214-kees@kernel.org commit c1fec890458ad101ddbbc52cdd29f7bba6aa2b10 Author: Jinjie Ruan Date: Tue Sep 19 10:04:09 2023 -0700 ethernet/intel: Use list_for_each_entry() helper Convert list_for_each() to list_for_each_entry() where applicable. No functional changed. Signed-off-by: Jinjie Ruan Reviewed-by: Jacob Keller Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230919170409.1581074-1-anthony.l.nguyen@intel.com Signed-off-by: Paolo Abeni commit 18801efed74a671f5c3bd1869739854cf2a5568f Author: Fernando Eckhardt Valle Date: Tue Sep 26 17:21:44 2023 -0300 platform/x86: thinkpad_acpi: sysfs interface to auxmac Newer Thinkpads have a feature called MAC Address Pass-through. This patch provides a sysfs interface that userspace can use to get this auxiliary mac address. Signed-off-by: Fernando Eckhardt Valle Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230926202144.5906-1-fevalle@ipt.br Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 67fcdbfd9e133be69c9541a806f6ccfe594fa9a9 Author: Jiapeng Chong Date: Thu Sep 28 16:52:00 2023 +0800 ASoC: cs42l43: Remove useless else The assignment of the else and if branches is the same, so the else here is redundant, so we remove it. ./sound/soc/codecs/cs42l43-sdw.c:35:1-3: WARNING: possible condition with no effect (if == else). Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6712 Signed-off-by: Jiapeng Chong Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230928085200.48635-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Mark Brown commit f67ff36f2117ff789876abb2e48f42e086475095 Author: Imre Deak Date: Thu Sep 21 22:51:59 2023 +0300 drm/i915/fdi: Recompute state for affected CRTCs on FDI links Recompute the state of all CRTCs on an FDI link during a modeset that may be affected by the modeset of other CRTCs on the same link. This ensures that each CRTC on the link maximizes its BW use (after another CRTC is disabled). In practice this means recomputing pipe B's config on IVB if pipe C gets disabled. v2: - Add the change recomputing affected CRTC states in a separate patch. (Ville) v3: (Ville) - Constify old and new crtc states. - Check for fused off pipe C. - Fix new vs. old crtc state mixup. - Drop check for pipe C's enabled state. Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-12-imre.deak@intel.com commit 998d2cd361caeb59d7d9574617f1f5d25ae73788 Author: Imre Deak Date: Thu Sep 21 22:51:58 2023 +0300 drm/i915/fdi: Improve FDI BW sharing between pipe B and C At the moment modesetting pipe C on IVB will fail if pipe B uses 4 FDI lanes. Make the BW sharing more dynamic by trying to reduce pipe B's link bpp in this case, until pipe B uses only up to 2 FDI lanes. For this instead of the encoder compute config retry loop - which reduced link bpp only for the encoder's pipe - reduce the maximum link bpp for pipe B/C as required after all CRTC states are computed and recompute the CRTC states with the new bpp limit. Atm, all FDI encoder's compute config function returns an error if a BW constrain prevents increasing the pipe bpp value. The corresponding crtc_state->bw_constrained check can be replaced with checking crtc_state->max_link_bpp_x16, add TODO comments for this. SDVO is an exception where this case is only handled in the outer config retry loop, failing the modeset with a WARN, add a FIXME comment to handle this in the encoder code similarly to other encoders. v2: - Don't assume that a CRTC is already in the atomic state, while reducing its link bpp. - Add DocBook description to intel_fdi_atomic_check_link(). v3: - Enable BW management for FDI links in a separate patch. (Ville) v4: (Ville) - Fail the SDVO encoder config computation if it doesn't support the link bpp limit. - Add TODO: comments about checking link_bpp_x16 instead of bw_constrained. v5: - Replace link bpp limit check with a FIXME: comment in intel_sdvo_compute_config(). (Ville) Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä [Amended commit message wrt. changes in v5] Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-11-imre.deak@intel.com commit 8ca0b875c08258e42a26e4f61574e874a64db1af Author: Imre Deak Date: Thu Sep 21 22:51:57 2023 +0300 drm/i915: Add helpers for BW management on shared display links At the moment a modeset fails if the config computation of a pipe can't fit its required BW to the available link BW even though the limitation may be resolved by reducing the BW requirement of other pipes. To improve the above this patch adds helper functions checking the overall BW limits after all CRTC states have been computed. If the check fails the maximum link bpp for a selected pipe will be reduced and all the CRTC states will be recomputed until either the overall BW limit check passes, or further bpp reduction is not possible (because all pipes/encoders sharing the link BW reached their minimum link bpp). Atm, the MST encoder allocates twice the required BW for YUV420 format streams. A follow-up patchset will fix that, add a code comment about this. This change prepares for upcoming patches enabling the above BW management on FDI and MST links. v2: - Rename intel_crtc_state::max_link_bpp to max_link_bpp_x16 and intel_link_bw_limits::max_bpp to max_bpp_x16. (Jani) v3: - Add the helper functions in a separate patch. (Ville) - Add the functions to intel_link_bw.c instead of intel_atomic.c (Ville) - Return -ENOSPC instead of -EINVAL to userspace in case of a link BW limit failure. v4: - Make intel_atomic_check_config() static. v5: (Ville) - Rename intel_link_bw_limits::min_bpp_pipes to min_bpp_reached_pipes and intel_link_bw_reset_pipe_limit_to_min() to intel_link_bw_set_min_bpp_for_pipe(). - Rename pipe_bpp to link_bpp in intel_link_bw_reduce_bpp(). - Add FIXME: comment about MST encoder's YUV420 BW allocation and tracking the link bpp limit accordingly. v6: - Move intel_link_bw_compute_pipe_bpp() to intel_fdi.c (Ville) - WARN_ON(BIT(pipe) & min_bpp_reached_pipes) in intel_link_bw_set_bpp_limit_for_pipe(). (Ville) - Rename intel_link_bw_set_min_bpp_for_pipe() to intel_link_bw_set_bpp_limit_for_pipe() and intel_link_bw_limits::min_bpp_reached_pipes to bpp_limit_reached_pipes. (Ville) - Remove unused header includes. Cc: Jani Nikula Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-10-imre.deak@intel.com commit 1050e4c2368eabe309193f89281259784f542a41 Author: Imre Deak Date: Thu Sep 21 22:51:56 2023 +0300 drm/i915: Factor out a helper to check/compute all the CRTC states Factor out intel_atomic_check_config() to check and compute all the CRTC states. This will be used by a follow up patch to recompute/check the state until required by BW limitations between CRTCs. Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-9-imre.deak@intel.com commit e3b269049103444ccbaafdaa470571d44322375b Author: Imre Deak Date: Thu Sep 21 22:51:55 2023 +0300 drm/i915: Rename intel_modeset_all_pipes() to intel_modeset_all_pipes_late() Rename intel_modeset_all_pipes() to intel_modeset_all_pipes_late() to clarify when the function can be called (vs. intel_modeset_pipes_in_mask_early()). Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-8-imre.deak@intel.com commit fa7a7a1c9c0517add2efb7040d6bfb197f747915 Author: Imre Deak Date: Thu Sep 21 22:51:54 2023 +0300 drm/i915: Add helper to modeset a set of pipes Add intel_modeset_pipes_in_mask_early() to modeset a provided set of pipes, used in a follow-up patch. As opposed to intel_modeset_all_pipes() which modesets only the active pipes - others don't requiring programming the HW - modeset all enabled pipes in intel_modeset_pipes_in_mask_early() which may need to recompute their state even if they are not active (that is in the DPMS off state). While at it add DocBook descriptions for the two exported functions. v2: - Add a flag controlling if active planes are force updated as well. - Add DockBook descriptions. v3: - For clarity use _early/_late suffixes for the exported functions instead of the update_active_planes parameter. (Ville) v4: - In intel_modeset_pipes_in_mask_early() update only the crtc flags relevant to the early phase. (Ville) - Rename intel_modeset_all_pipes() in a separate patch. Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-7-imre.deak@intel.com commit 592b9bfd25e471bfe9a4bb4365d86a9dccc807cc Author: Imre Deak Date: Thu Sep 21 22:51:53 2023 +0300 drm/i915/dp: Limit the output link bpp in DSC mode Limit the output link bpp in DSC mode to the link_config_limits link.min_bpp_x16 .. max_bpp_x16 range the same way it's done in non-DSC mode. Atm this doesn't make a difference, the link bpp range being 0 .. max pipe bpp, but a follow-up patch will need a way to reduce max link bpp below its current value. v2: - Add to_bpp_int_roundup() instead of open coding it. (Jani) Cc: Jani Nikula Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-6-imre.deak@intel.com commit 78015e27b7d75ec497a9b5f14a7dc0ee9288d560 Author: Imre Deak Date: Thu Sep 21 22:51:52 2023 +0300 drm/i915/dp: Update the link bpp limits for DSC mode In non-DSC mode the link bpp can be set in 2*3 bpp steps in the pipe bpp range, while in DSC mode it can be set in 1/16 bpp steps to any value up to the maximum pipe bpp. Update the limits accordingly in both modes to prepare for a follow-up patch which may need to reduce the max link bpp value and starts to check the link bpp limits in DSC mode as well. While at it add more detail to the link limit debug print and print it also for DSC mode. v2: - Add to_bpp_frac_dec() instead of open coding it. (Jani) v3: (Ville) - Add BPP_X16_FMT / BPP_X16_ARG. - Add TODO: comment about initializing the DSC link bpp limits earlier. Cc: Jani Nikula Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-5-imre.deak@intel.com commit 7d0f2f68b661e5fb4bc833d6ca22974134220e99 Author: Imre Deak Date: Thu Sep 21 22:51:51 2023 +0300 drm/i915/dp: Skip computing a non-DSC link config if DSC is needed Computing the non-DSC mode link config is redundant once it's determined that DSC will be needed, so skip computing it. In a follow-up patch this simplifies setting the link limits which are dependent on the DSC vs. non-DSC mode. While at it sanitize the debug print about the MST DSC fallback path, making it similar to the SST DSC one. Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-4-imre.deak@intel.com commit 703c5994fe1a2bf45391c2a2a365bea541041b9a Author: Imre Deak Date: Thu Sep 21 22:51:50 2023 +0300 drm/i915/dp: Track the pipe and link bpp limits separately A follow-up patch will need to limit the output link bpp both in the non-DSC and DSC configuration, so track the pipe and link bpp limits separately in the link_config_limits struct. Use .4 fixed point format for link bpp matching the 1/16 bpp granularity in DSC mode and for now keep this limit matching the pipe bpp limit. v2: (Jani) - Add to_bpp_int(), to_bpp_x16() helpers instead of opencoding them. - Rename link_config_limits::link.min/max_bpp to min/max_bpp_x16. Cc: Jani Nikula Reviewed-by: Luca Coelho Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-3-imre.deak@intel.com commit 72b2d2a6f178b99354eaccfac2c5e9bf5e2fcb53 Author: Imre Deak Date: Thu Sep 21 22:51:49 2023 +0300 drm/i915/dp: Factor out helpers to compute the link limits Factor out helpers that DP / DP_MST encoders can use to compute the link rate/lane count and bpp limits. A follow-up patch will call these to recalculate the limits if DSC compression is required. Reviewed-by: Ville Syrjälä Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230921195159.2646027-2-imre.deak@intel.com commit d2efde5cc970cd21de0f94cf03e059adc1e1311b Author: Geert Uytterhoeven Date: Mon Sep 11 15:17:40 2023 +0200 ARM: shmobile: defconfig: Refresh for v6.6-rc3 - Move CONFIG_KEXEC (moved in commit 89cde455915f4611 ("kexec: consolidate kexec and crash options into kernel/Kconfig.kexec")), Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1b8aee0cfcb2fa8c6e73c67f1c85c4630d946159.1694438226.git.geert+renesas@glider.be Link: https://lore.kernel.org/r/401e68aa456557c9e1f4d2841ae7601686699974.1695815769.git.geert+renesas@glider.be commit 03d681412b38558aefe4fb0f46e36efa94bb21ef Author: Nirmoy Das Date: Tue Sep 26 16:24:01 2023 +0200 drm/i915: Don't set PIPE_CONTROL_FLUSH_L3 for aux inval PIPE_CONTROL_FLUSH_L3 is not needed for aux invalidation so don't set that. Fixes: ad8ebf12217e ("drm/i915/gt: Ensure memory quiesced before invalidation") Cc: Jonathan Cavitt Cc: Andi Shyti Cc: # v5.8+ Cc: Andrzej Hajda Cc: Tvrtko Ursulin Cc: Matt Roper Cc: Tejas Upadhyay Cc: Lucas De Marchi Cc: Prathap Kumar Valsan Cc: Tapani Pälli Cc: Mark Janes Cc: Rodrigo Vivi Signed-off-by: Nirmoy Das Acked-by: Matt Roper Reviewed-by: Andi Shyti Tested-by: Tapani Pälli Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230926142401.25687-1-nirmoy.das@intel.com commit e35728d0286c79ea6cf16fa0c7847cf2b65e690f Author: Jani Nikula Date: Thu Sep 14 16:14:50 2023 +0300 drm/bridge: lt9611uxc: use drm_bridge_get_edid() instead of using ->get_edid directly Make drm_bridge_get_edid() the one place to call the hook. Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Signed-off-by: Jani Nikula Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20230914131450.2473061-2-jani.nikula@intel.com commit ab2dbf894a0f931aa4aba52f736ce460028c187f Author: Jani Nikula Date: Thu Sep 14 16:14:49 2023 +0300 drm/bridge: use drm_bridge_get_edid() instead of using ->get_edid directly Make drm_bridge_get_edid() the one place to call the hook. Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Signed-off-by: Jani Nikula Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20230914131450.2473061-1-jani.nikula@intel.com commit fc5fb9e7f81e4ae73958d05adb4fe7cde24c88a2 Author: Douglas Anderson Date: Mon Sep 25 15:49:29 2023 -0700 MAINTAINERS: Document that the NXP i.MX 8MQ DCSS driver goes thru drm-misc As per the discussion on the lists [1], changes to this driver generally flow through drm-misc. Add a tag in MAINTAINERS to document this [1] https://lore.kernel.org/r/20230925054710.r3guqn5jzdl4giwd@fsr-ub1664-121.ea.freescale.net Signed-off-by: Douglas Anderson Acked-by: Laurentiu Palcu Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230925154929.1.I3287e895ce8e68d41b458494a49a1b5ec5c71013@changeid commit 5a44d50f00725f31bf4a85e61587c87ce0429787 Author: Maxime Ripard Date: Thu Sep 21 12:57:43 2023 +0200 MAINTAINERS: Update drm-misc entry to match all drivers We've had a number of times when a patch slipped through and we couldn't pick them up either because our MAINTAINERS entry only covers the framework and thus we weren't Cc'd. Let's take another approach where we match everything, and remove all the drivers that are not maintained through drm-misc. Acked-by: Jani Nikula Acked-by: Dave Airlie Acked-by: Thomas Zimmermann Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230921105743.2611263-1-mripard@kernel.org commit d9ef56d94fac52f7e06c0ba5a28075456eff405c Author: ChiYuan Huang Date: Thu Sep 28 11:41:08 2023 +0800 ASoC: codecs: rtq9128: Add TDM input source select Pase the property to decide the TDM input source comes from 'DATA1' or 'DATA2 pin. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1695872468-24433-3-git-send-email-cy_huang@richtek.com Signed-off-by: Mark Brown commit bf38a0be7c57e43303600b5afc9b740882b3ed87 Author: ChiYuan Huang Date: Thu Sep 28 11:41:07 2023 +0800 ASoC: dt-bindings: rtq9128: Add TDM input source slect property Create a boolean property to select TDM input source coms from 'DATA2'. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1695872468-24433-2-git-send-email-cy_huang@richtek.com Signed-off-by: Mark Brown commit b3bee1e7c3f2b1b77182302c7b2131c804175870 Author: Alexey Dobriyan Date: Wed Sep 27 18:42:11 2023 +0300 x86/boot: Compile boot code with -std=gnu11 too Use -std=gnu11 for consistency with main kernel code. It doesn't seem to change anything in vmlinux. Signed-off-by: Alexey Dobriyan Signed-off-by: Ingo Molnar Acked-by: H. Peter Anvin (Intel) Link: https://lore.kernel.org/r/2058761e-12a4-4b2f-9690-3c3c1c9902a5@p183 commit 6d925797304e345e397bc24e62a334b41503fb1d Author: Kuninori Morimoto Date: Thu Sep 28 00:04:16 2023 +0000 sh: boards: Fix Sound Simple-Card struct name "asoc_simple_card_info" was renamed to "simple_util_info" by commit ad484cc98f2 ("ASoC: remove asoc_xxx() compatible macro"). This patch fixup it For SH7724 boards. Fixes: ad484cc98f2 ("ASoC: remove asoc_xxx() compatible macro") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309280417.rOLRdrdM-lkp@intel.com/ Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87ttrfgo3j.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 1dca98e70c1057b35afe99417996f11c28350e4b Merge: 34dc1baba215b 374a69427f2e6 Author: Arnd Bergmann Date: Thu Sep 28 10:00:53 2023 +0200 Merge tag 'ux500-dts-for-armsoc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into soc/dt Ux500 device tree updates for v6.7: - Two fixes from Krzysztof fixing up DT properties on the touchscreen. * tag 'ux500-dts-for-armsoc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: dts: st: href-tvk1281618: correct touchscreen syna,nosleep-mode ARM: dts: st: href-tvk1281618: fix touchscreen VIO supply Link: https://lore.kernel.org/r/CACRpkdZc5Yzsos2+gRPtCT-+ohmaV69ew5YFJLakD+9VFkrkfQ@mail.gmail.com Signed-off-by: Arnd Bergmann commit 88928addeec577386e8c83b48b5bc24d28ba97fd Author: Fenghua Yu Date: Sun Sep 24 09:22:32 2023 -0700 dmaengine: idxd: Register dsa_bus_type before registering idxd sub-drivers idxd sub-drivers belong to bus dsa_bus_type. Thus, dsa_bus_type must be registered in dsa bus init before idxd drivers can be registered. But the order is wrong when both idxd and idxd_bus are builtin drivers. In this case, idxd driver is compiled and linked before idxd_bus driver. Since the initcall order is determined by the link order, idxd sub-drivers are registered in idxd initcall before dsa_bus_type is registered in idxd_bus initcall. idxd initcall fails: [ 21.562803] calling idxd_init_module+0x0/0x110 @ 1 [ 21.570761] Driver 'idxd' was unable to register with bus_type 'dsa' because the bus was not initialized. [ 21.586475] initcall idxd_init_module+0x0/0x110 returned -22 after 15717 usecs [ 21.597178] calling dsa_bus_init+0x0/0x20 @ 1 To fix the issue, compile and link idxd_bus driver before idxd driver to ensure the right registration order. Fixes: d9e5481fca74 ("dmaengine: dsa: move dsa_bus_type out of idxd driver to standalone") Reported-by: Michael Prinke Signed-off-by: Fenghua Yu Reviewed-by: Dave Jiang Reviewed-by: Lijun Pan Tested-by: Lijun Pan Link: https://lore.kernel.org/r/20230924162232.1409454-1-fenghua.yu@intel.com Signed-off-by: Vinod Koul commit 555921feb2ac03d88647ccc62015e68f157c30a2 Author: Dave Jiang Date: Sat Sep 23 17:23:47 2023 -0700 dmaengine: idxd: rate limit printk in misc interrupt thread Add rate limit to the dev_warn() call in the misc interrupt thread. This limits dmesg getting spammed if a descriptor submitter is spamming bad descriptors with invalid completion records and resulting the errors being continuously reported by the misc interrupt handling thread. Reported-by: Sanjay Kumar Signed-off-by: Dave Jiang Reviewed-by: Fenghua Yu Acked-by: Lijun Pan Link: https://lore.kernel.org/r/20230924002347.1117757-1-fenghua.yu@intel.com Signed-off-by: Vinod Koul commit f940d704d87a8056e7639461f4ecda7bc2e7bd03 Merge: d387e34fec407 d3fc4eea9742b Author: Paolo Abeni Date: Thu Sep 28 09:51:09 2023 +0200 Merge branch 'selftests-tc-testing-parallel-tdc' Pedro Tammela says: ==================== selftests/tc-testing: parallel tdc As the number of tdc tests is growing, so is our completion wall time. One of the ideas to improve this is to run tests in parallel, as they are self contained. This series allows for tests to run in parallel, in batches of 32 tests. Not all tests can run in parallel as they might conflict with each other. The code will still honor this requirement even when trying to run the tests over the worker pool. In order to make this happen we had to localize the test resources (patches 1 and 2), where instead of having all tests sharing one single namespace and veths devices each test now gets it's own local namespace and devices. Even though the tests serialize over rtnl_lock in the kernel, we measured a speedup of about 3x in a test VM. ==================== Link: https://lore.kernel.org/r/20230919135404.1778595-1-pctammela@mojatatu.com Signed-off-by: Paolo Abeni commit d3fc4eea9742b89ba9b1609463cf62bba4b9be82 Author: Pedro Tammela Date: Tue Sep 19 10:54:04 2023 -0300 selftests/tc-testing: update tdc documentation Update the documentation to reflect the changes made to tdc with regards to minimal requirements and test definitions expectations. Tested-by: Davide Caratti Signed-off-by: Pedro Tammela Acked-by: Jamal Hadi Salim Signed-off-by: Paolo Abeni commit ac9b8293096465914c1a0b778e759333ceac5cd1 Author: Pedro Tammela Date: Tue Sep 19 10:54:03 2023 -0300 selftests/tc-testing: implement tdc parallel test run Use a Python process pool to run the tests in parallel. Not all tests can run in parallel, for instance tests that are not namespaced and tests that use netdevsim, as they can conflict with one another. The code logic will split the tests into serial and parallel. For the parallel tests, we build batches of 32 tests and queue each batch on the process pool. For the serial tests, they are queued as a whole into the process pool, which in turn executes them concurrently with the parallel tests. Even though the tests serialize on rtnl_lock in the kernel, this feature showed results with a ~3x speedup on the wall time for the entire test suite running in a VM: Before - 4m32.502s After - 1m19.202s Examples: In order to run tdc using 4 processes: ./tdc.py -J4 <...> In order to run tdc using 1 process: ./tdc.py -J1 <...> || ./tdc.py <...> Note that the kernel configuration will affect the speed of the tests, especially if such configuration slows down process creation and/or fork(). Tested-by: Davide Caratti Signed-off-by: Pedro Tammela Acked-by: Jamal Hadi Salim Signed-off-by: Paolo Abeni commit d227cc0b1ee12560f7489239fc69ba6a10b14607 Author: Pedro Tammela Date: Tue Sep 19 10:54:02 2023 -0300 selftests/tc-testing: update test definitions for local resources With resources localized on a per test basis, some tests definitions either contain redundant commands, were wrong or could be simplified. Update all of them to match the new requirements. Tested-by: Davide Caratti Signed-off-by: Pedro Tammela Acked-by: Jamal Hadi Salim Signed-off-by: Paolo Abeni commit 98cfbe4234a41e4d7baf3f58b95cab5fc50d1492 Author: Pedro Tammela Date: Tue Sep 19 10:54:01 2023 -0300 selftests/tc-testing: localize test resources As of today, the current tdc architecture creates one netns and uses it to run all tests. This assumption was embedded into the nsPlugin which carried over as how the tests were written. The tdc tests are by definition self contained and can, theoretically, run in parallel. Even though in the kernel they will serialize over the rtnl lock, we should expect a significant speedup of the total wall time for the entire test suite, which is hitting close to 1100 tests at this point. A first step to achieve this goal is to remove sharing of global resources like veth/dummy interfaces and the netns. In this patch we 'localize' these resources on a per test basis. Each test gets it's own netns, VETH/dummy interfaces. The resources are spawned in the pre_suite phase, where tdc will prepare all netns and interfaces for all tests. This is done in order to avoid concurrency issues with netns / interfaces spawning and commands using them. As tdc progresses, the resources are deleted after each test finishes executing. Tests that don't use the nsPlugin still run under the root namespace, but are now required to manage any external resources like interfaces. These cannot be parallelized as their definition doesn't allow it. On the other hand, when using the nsPlugin, tests don't need to create dummy/veth interfaces as these are handled already. Tested-by: Davide Caratti Signed-off-by: Pedro Tammela Acked-by: Jamal Hadi Salim Signed-off-by: Paolo Abeni commit 646fe2e4b39049078d18c72832afec21dc9d6b52 Author: Brad Larson Date: Mon Sep 25 12:56:09 2023 -0700 arm64: Add config for AMD Pensando SoC platforms Add ARCH_PENSANDO configuration option for AMD Pensando SoC based platforms. Signed-off-by: Brad Larson Link: https://lore.kernel.org/r/20230925195610.47971-4-blarson@amd.com Signed-off-by: Arnd Bergmann commit fbf37376f8acc47e379fe7411c039e67181bc4b8 Author: Brad Larson Date: Mon Sep 25 12:56:08 2023 -0700 MAINTAINERS: Add entry for AMD PENSANDO Add entry for AMD PENSANDO maintainer and files Signed-off-by: Brad Larson Link: https://lore.kernel.org/r/20230925195610.47971-3-blarson@amd.com Signed-off-by: Arnd Bergmann commit 34dc1baba215b826e454b8d19e4f24adbeb7d00d Author: Brad Larson Date: Mon Sep 25 12:56:10 2023 -0700 arm64: dts: Add AMD Pensando Elba SoC support Add AMD Pensando common and Elba SoC specific device nodes Signed-off-by: Brad Larson Link: https://lore.kernel.org/r/20230925195610.47971-5-blarson@amd.com Signed-off-by: Arnd Bergmann commit b0292fd8be37bb108ff3fd03d20484920d70d2a3 Author: Brad Larson Date: Mon Sep 25 12:56:07 2023 -0700 dt-bindings: arm: add AMD Pensando boards Document the compatible for AMD Pensando Elba SoC boards. Signed-off-by: Brad Larson Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230925195610.47971-2-blarson@amd.com Signed-off-by: Arnd Bergmann commit b1c50ac25425385b576dd58b7b38c1c5963dde85 Author: Uwe Kleine-König Date: Tue Sep 19 15:32:07 2023 +0200 dmaengine: xilinx: zynqmp_dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-60-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit c962eca73c5cce72936a8b3bd23a24b29852ea97 Author: Uwe Kleine-König Date: Tue Sep 19 15:32:06 2023 +0200 dmaengine: xilinx: xilinx_dpdma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-59-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit cc99582d46b428ba4c2cb7ecd05df4569b02d1f4 Author: Uwe Kleine-König Date: Tue Sep 19 15:32:05 2023 +0200 dmaengine: xilinx: xilinx_dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-58-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 78369eb5dc8881d78f163434ee2788a800b89219 Author: Uwe Kleine-König Date: Tue Sep 19 15:32:04 2023 +0200 dmaengine: xilinx: xdma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-57-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 2c9d879fae9ab1be3d4926ebea5e85305998cf93 Author: Uwe Kleine-König Date: Tue Sep 19 15:32:03 2023 +0200 dmaengine: xgene-dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-56-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit a3b4af719e571bd899b7952626c2b4d8ec7c0c77 Author: Uwe Kleine-König Date: Tue Sep 19 15:32:02 2023 +0200 dmaengine: txx9dmac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-55-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 4f339d6efa6a74a16f77fd9a06adf01d9df84734 Author: Uwe Kleine-König Date: Tue Sep 19 15:32:01 2023 +0200 dmaengine: timb_dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-54-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 5ea68dc1cee00e5ecf174f2a3ef13d63520971cb Author: Uwe Kleine-König Date: Tue Sep 19 15:32:00 2023 +0200 dmaengine: ti: omap-dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230919133207.1400430-53-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 68bcaf5c4e03ada2696b4fbd03ee775781945034 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:59 2023 +0200 dmaengine: ti: edma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230919133207.1400430-52-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 36a7e98c36a598c2865daf748a7d9d889a34aaf3 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:58 2023 +0200 dmaengine: ti: cppi41: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230919133207.1400430-51-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 1a3fa3e369bf54bef0021a8c840567622f52354f Author: Uwe Kleine-König Date: Tue Sep 19 15:31:57 2023 +0200 dmaengine: tegra210-adma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-50-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit afd1ac2e1b9b39040bb5eedd94b2b152020994e0 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:56 2023 +0200 dmaengine: tegra20-apb-dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-49-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit d669b198efac1ea97fa39d6f8be59aefe5f39171 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:55 2023 +0200 dmaengine: tegra186-gpc-dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-48-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 7d6ef7550a4577ae943194421dea73f3df084265 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:54 2023 +0200 dmaengine: sun6i-dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230919133207.1400430-47-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 2db76471c8f45837efafdd7d57633aa9f194d787 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:53 2023 +0200 dmaengine: sun4i-dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230919133207.1400430-46-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 9c52ffa09f580c49df1cc0b1998d7ea8fdf2c0b4 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:52 2023 +0200 dmaengine: st_fdma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-45-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 8d82eb85a74246afb9b4bc69abf6e79014b06d4f Author: Uwe Kleine-König Date: Tue Sep 19 15:31:51 2023 +0200 dmaengine: sprd-dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-44-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 9f2812a7fe47c422a367ef95e418dd63fced7238 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:50 2023 +0200 dmaengine: sh: usb-dmac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-43-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 384ba9a683d3ba9f2f598b4c5fbf6f79a9213e94 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:49 2023 +0200 dmaengine: sh: shdmac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-42-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit bd4205f52310a158c78171d3a5f68c7301a532fd Author: Uwe Kleine-König Date: Tue Sep 19 15:31:48 2023 +0200 dmaengine: sh: rz-dmac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230919133207.1400430-41-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 8ca342994ab8abda069c4b918aab5fa6b8c1614f Author: Uwe Kleine-König Date: Tue Sep 19 15:31:47 2023 +0200 dmaengine: sh: rcar-dmac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-40-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 3d97deeb3b3077b3a6f9636f3ea312fef7f54059 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:46 2023 +0200 dmaengine: sf-pdma: sf-pdma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-39-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit d6798037fa1c01e6b9486cc1fbe1b5a272dde477 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:45 2023 +0200 dmaengine: sa11x0-dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-38-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 1a6d1c87542d6bb178db5bc2befc9abf99447684 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:44 2023 +0200 dmaengine: qcom: qcom_adm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230919133207.1400430-37-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit af9bc3c26b08714eb2309dcbf9a74a6c7af6327f Author: Uwe Kleine-König Date: Tue Sep 19 15:31:43 2023 +0200 dmaengine: qcom: hidma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230919133207.1400430-36-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 8d0f1ca5e4037f671cee43a4a582c0f8c6e8e31d Author: Uwe Kleine-König Date: Tue Sep 19 15:31:42 2023 +0200 dmaengine: qcom: bam_dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230919133207.1400430-35-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 44ea88715d37dc31145b7712b5474808258bab5f Author: Uwe Kleine-König Date: Tue Sep 19 15:31:41 2023 +0200 dmaengine: pxa_dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-34-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 5f8f212fb416dc3600046955fb008732a512fa5c Author: Uwe Kleine-König Date: Tue Sep 19 15:31:40 2023 +0200 dmaengine: ppc4xx: adma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-33-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 1260486a347567c33e0118626bb8778e342e6080 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:39 2023 +0200 dmaengine: owl-dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-32-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 44d5338c4a5d7f3f1ef07d502b9db22a29a8756a Author: Uwe Kleine-König Date: Tue Sep 19 15:31:38 2023 +0200 dmaengine: nbpfaxi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-31-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 733dbb8d62f33448c0d7470ba06ce39bdd790ddd Author: Uwe Kleine-König Date: Tue Sep 19 15:31:37 2023 +0200 dmaengine: mv_xor_v2: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-30-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 80d0159bbe80d8de6f64c0a8554b4066c66eb378 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:36 2023 +0200 dmaengine: mpc512x_dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-29-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 1a65831fa037457114ca75ea262d87fbde3158f0 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:35 2023 +0200 dmaengine: moxart-dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-28-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit f543b251500a0de589bc4c97da45b88410bf7c56 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:34 2023 +0200 dmaengine: mmp_tdma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-27-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit c0f0d93fc1da36de564da9b3f0462b5bdc4b1948 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:33 2023 +0200 dmaengine: mmp_pdma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-26-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 4db30945a001ac97b5044db2aa2990b8e7df9452 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:32 2023 +0200 dmaengine: mediatek: mtk-uart-apdma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230919133207.1400430-25-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 97283173effa6e53ea698726ea5d07f7ca06e5cf Author: Uwe Kleine-König Date: Tue Sep 19 15:31:31 2023 +0200 dmaengine: mediatek: mtk-hsdma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230919133207.1400430-24-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit bdeb61f5180efc920cf55b966a2a30bc2336d6d4 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:30 2023 +0200 dmaengine: mediatek: mtk-cqdma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230919133207.1400430-23-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 48236cb8314238917788f73353290dd1afb9a7c6 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:29 2023 +0200 dmaengine: mcf-edma-main: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-22-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 3faf902cb808163e9e65bf568c235a272215aed2 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:28 2023 +0200 dmaengine: k3dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-21-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 06e4f653fafdeec7b13958b771226efa1cdf76d2 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:27 2023 +0200 dmaengine: imx-sdma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-20-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 14c49dd0c34e457d71494b04290c27d7a14584d7 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:26 2023 +0200 dmaengine: imx-dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-19-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 6e1b4a907e860071d957baee688a30a0bff102ef Author: Uwe Kleine-König Date: Tue Sep 19 15:31:25 2023 +0200 dmaengine: img-mdc-dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-18-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit e8da277fbb8701308cfd2337afb13d34cc233349 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:24 2023 +0200 dmaengine: idma64: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-17-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit d69f80110da5d0e665d7f2872bf2185fe7f14409 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:23 2023 +0200 dmaengine: fsldma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-16-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 37b24b50c5f8ad9037fbe81f1ee43f5e16fb5334 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:22 2023 +0200 dmaengine: fsl_raid: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-15-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit fe3d44cdaea41173e50833440db84982e2a8d2a7 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:21 2023 +0200 dmaengine: fsl-qdma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-14-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit fa13c3ef3f45bca5a1474755dac57bfaf28ef61b Author: Uwe Kleine-König Date: Tue Sep 19 15:31:20 2023 +0200 dmaengine: fsl-edma-main: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-13-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 67572bfe2e35c232c3497b3fc8babbfe62600ce0 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:19 2023 +0200 dmaengine: dw: platform: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20230919133207.1400430-12-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit c689a2fd2a3f2a0a9e775c59c0f02ea64677c254 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:18 2023 +0200 dmaengine: dw-axi-dmac: dw-axi-dmac-platform: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-11-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit a8c85540bee12d492904a430c0c1105a4b7b101c Author: Uwe Kleine-König Date: Tue Sep 19 15:31:17 2023 +0200 dmaengine: dma-jz4780: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paul Cercueil Link: https://lore.kernel.org/r/20230919133207.1400430-10-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit b5f095a70117629c3abb49bcb07dfa954d275e99 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:16 2023 +0200 dmaengine: dma-axi-dmac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-9-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 7689bca111997e0d7a12cf6457fc26a52b8c800f Author: Uwe Kleine-König Date: Tue Sep 19 15:31:15 2023 +0200 dmaengine: bestcomm: bestcomm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-8-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 8f63a2da288454e9228f6b438b86627f6ceae36b Author: Uwe Kleine-König Date: Tue Sep 19 15:31:14 2023 +0200 dmaengine: bcm2835-dma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-7-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 017df796a3635edee5169a0700634da6dac92f6a Author: Uwe Kleine-König Date: Tue Sep 19 15:31:13 2023 +0200 dmaengine: bcm-sba-raid: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-6-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit b13af3c41bad5f4e45a73d6978f31ad48ffc2dee Author: Uwe Kleine-König Date: Tue Sep 19 15:31:12 2023 +0200 dmaengine: at_xdmac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-5-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit ae3f38e495b42494414cbace3b3bd3cb6dc10506 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:11 2023 +0200 dmaengine: at_hdmac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-4-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit e7d5aa30c8a19e6d9c4ec19d3b9e501df22e1d1a Author: Uwe Kleine-König Date: Tue Sep 19 15:31:10 2023 +0200 dmaengine: apple-admac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919133207.1400430-3-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 8876762f285fff08b1aefeba52c7157a2c9beec1 Author: Uwe Kleine-König Date: Tue Sep 19 15:31:09 2023 +0200 dmaengine: altera-msgdma: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Olivier Dautricourt Link: https://lore.kernel.org/r/20230919133207.1400430-2-u.kleine-koenig@pengutronix.de Signed-off-by: Vinod Koul commit 8d21670105fe14f37f447825ed511fd950dd3ad0 Author: Trevor Woerner Date: Tue Sep 19 08:51:11 2023 -0400 ARM: defconfig: cleanup orphaned CONFIGs Drop CONFIG_NF_LOG_NETDEV as it was removed in commit 1510618e45cb ("netfilter: nf_log_netdev: merge with nf_log_syslog"). Drop CONFIG_NFT_COUNTER as it was removed in commit 023223dfbfb3 ("netfilter: nf_tables: make counter support built-in"). Drop CONFIG_NF_FLOW_TABLE_IPV6 and CONFIG_NF_FLOW_TABLE_IPV4 as they were removed in commit c42ba4290b21 ("netfilter: flowtable: remove ipv4/ipv6 modules"). Drop CONFIG_NF_LOG_BRIDGE as it was removed in commit 77ccee96a674 ("netfilter: nf_log_bridge: merge with nf_log_syslog"). Drop CONFIG_IP_NF_TARGET_CLUSTERIP from any remaining arm defconfigs as it was removed in commit 9db5d918e2c0 ("netfilter: ip_tables: remove clusterip target"). Drop CONFIG_USB_MUSB_AM35X as it was removed in commit 57f8e00d8a82 ("usb: musb: Drop old unused am35x glue layer"). Drop CONFIG_NFT_OBJREF as it was removed in commit d037abc2414b ("netfilter: nft_objref: make it builtin"). Signed-off-by: Trevor Woerner Link: https://lore.kernel.org/r/20230919125112.15515-2-twoerner@gmail.com Signed-off-by: Arnd Bergmann commit d387e34fec407f881fdf165b5d7ec128ebff362f Author: Christian Marangi Date: Tue Sep 19 14:47:20 2023 +0200 net: sfp: add quirk for Fiberstone GPON-ONU-34-20BI Fiberstone GPON-ONU-34-20B can operate at 2500base-X, but report 1.2GBd NRZ in their EEPROM. The module also require the ignore tx fault fixup similar to Huawei MA5671A as it gets disabled on error messages with serial redirection enabled. Signed-off-by: Christian Marangi Link: https://lore.kernel.org/r/20230919124720.8210-1-ansuelsmth@gmail.com Signed-off-by: Paolo Abeni commit 823a6d9e79fc069a0a77f195aa74c3703b847ca0 Author: Richard Acayan Date: Wed Aug 16 19:04:16 2023 -0400 dt-bindings: cpufreq: cpufreq-qcom-hw: add SDM670 compatible The bindings for Qualcomm CPU frequency have a compatible for each SoC. Add the compatible for SDM670. Fixes: 0c665213d126 ("arm64: dts: qcom: sdm670: add cpu frequency scaling") Signed-off-by: Richard Acayan Reviewed-by: Krzysztof Kozlowski Signed-off-by: Viresh Kumar commit 55530ab888cfd20befad976c72b72ac76651b2c2 Author: Stephan Gerhold Date: Tue Sep 12 11:40:17 2023 +0200 dt-bindings: cpufreq: qcom-nvmem: Document MSM8909 Document that MSM8909 is used with qcom-cpufreq-nvmem for voltage scaling and to restrict the maximum frequency based on the speedbin encoded in the nvmem cells. Signed-off-by: Stephan Gerhold Acked-by: Rob Herring Signed-off-by: Viresh Kumar commit 40f6be3ef2bed759ad91d335d36f8dc9d64c87e2 Author: Stephan Gerhold Date: Tue Sep 12 11:40:16 2023 +0200 cpufreq: dt: platdev: Add MSM8909 to blocklist MSM8909 uses qcom-cpufreq-nvmem to attach power domains and to parse the speedbin from NVMEM (for opp-supported-hw). Signed-off-by: Stephan Gerhold Reviewed-by: Konrad Dybcio [ Viresh: Fixed order in table ] Signed-off-by: Viresh Kumar commit e96c6b8f212a510c9b22362de519f6e1d7920de5 Author: Song Shuai Date: Sat Jun 24 11:26:07 2023 +0800 memblock: report failures when memblock_can_resize is not set The callers of memblock_reserve() do not check the return value presuming that memblock_reserve() always succeeds, but there are cases where it may fail. Having numerous memblock reservations at early boot where memblock_can_resize is unset may exhaust the INIT_MEMBLOCK_REGIONS sized memblock.reserved regions array and an attempt to double this array via memblock_double_array() will fail and will return -1 to the caller. When this happens the system crashes anyway, but it's hard to identify the reason for the crash. Add a panic message to memblock_double_array() to aid debugging of the cases when too many regions are reserved before memblock can resize memblock.reserved array. Link: https://lore.kernel.org/linux-kernel/20230614131746.3670303-1-songshuaishuai@tinylab.org/ Signed-off-by: Song Shuai Link: https://lore.kernel.org/r/20230624032607.921173-1-songshuaishuai@tinylab.org Signed-off-by: Mike Rapoport (IBM) commit 387bb6fdd0af1f853deeb1cdd8331c07b6a66b32 Author: Rob Herring Date: Mon Sep 25 16:26:21 2023 -0500 dt-bindings: memory-controllers: Make "additionalProperties: true" explicit Make it explicit that child nodes have additional properties and the child node schema is not complete. The complete schemas are applied separately based the compatible strings. Signed-off-by: Rob Herring Reviewed-by: Roger Quadros Link: https://lore.kernel.org/r/20230925212626.1974676-1-robh@kernel.org Signed-off-by: Krzysztof Kozlowski commit 7396a5b980fdeb2cb97136db45405b4fb5d21dfc Author: Uwe Kleine-König Date: Wed Sep 27 10:10:25 2023 +0200 platform/chrome/wilco_ec: telemetry: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-13-u.kleine-koenig@pengutronix.de Signed-off-by: Tzung-Bi Shih commit 1fca58f347d8a958bd708a98c0e478e65ab48408 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:24 2023 +0200 platform/chrome/wilco_ec: debugfs: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-12-u.kleine-koenig@pengutronix.de Signed-off-by: Tzung-Bi Shih commit 48648504e488f9affbb2bbe8b48e4f5f724a89ba Author: Uwe Kleine-König Date: Wed Sep 27 10:10:23 2023 +0200 platform/chrome/wilco_ec: core: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-11-u.kleine-koenig@pengutronix.de Signed-off-by: Tzung-Bi Shih commit b98362be7c92003903c9feefddeab7ca30392aae Author: Uwe Kleine-König Date: Wed Sep 27 10:10:22 2023 +0200 platform/chrome: cros_usbpd_notify: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-10-u.kleine-koenig@pengutronix.de Signed-off-by: Tzung-Bi Shih commit b6c1fea8355045d13b888743cba5a2cf8627d845 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:21 2023 +0200 platform/chrome: cros_usbpd_logger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-9-u.kleine-koenig@pengutronix.de Signed-off-by: Tzung-Bi Shih commit ea4bad2badb704a64556116e831979a5761da1d8 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:20 2023 +0200 platform/chrome: cros_typec_switch: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-8-u.kleine-koenig@pengutronix.de Signed-off-by: Tzung-Bi Shih commit 58b15196b0ef1be58d331d47d7787c1baca85e80 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:19 2023 +0200 platform/chrome: cros_ec_vbc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-7-u.kleine-koenig@pengutronix.de Signed-off-by: Tzung-Bi Shih commit 6478e302409a0377cd6382c05b0ece22fc05c308 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:18 2023 +0200 platform/chrome: cros_ec_sysfs: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-6-u.kleine-koenig@pengutronix.de Signed-off-by: Tzung-Bi Shih commit e02944e85169b0350ea12264e530858250991546 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:17 2023 +0200 platform/chrome: cros_ec_lpc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-5-u.kleine-koenig@pengutronix.de Signed-off-by: Tzung-Bi Shih commit fa45583c3133ed4c910216cae38c49c65af70c85 Author: Uwe Kleine-König Date: Wed Sep 27 10:10:16 2023 +0200 platform/chrome: cros_ec_lightbar: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-4-u.kleine-koenig@pengutronix.de Signed-off-by: Tzung-Bi Shih commit f366fa0064ef3f7dda4ed8d25b41f8c96f5b2d3e Author: Uwe Kleine-König Date: Wed Sep 27 10:10:15 2023 +0200 platform/chrome: cros_ec_debugfs: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-3-u.kleine-koenig@pengutronix.de Signed-off-by: Tzung-Bi Shih commit f04410e7be65f0d005238f286ee37572874c0d5d Author: Uwe Kleine-König Date: Wed Sep 27 10:10:14 2023 +0200 platform/chrome: cros_ec_chardev: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230927081040.2198742-2-u.kleine-koenig@pengutronix.de Signed-off-by: Tzung-Bi Shih commit ee33a0ef8468063b34eed4330b0023c1a8d62f8f Author: Athira Rajeev Date: Wed Sep 27 23:47:03 2023 +0530 perf test: Fix parse-events tests to skip parametrized events Testcase "Parsing of all PMU events from sysfs" parse events for all PMUs, and not just cpu. In case of powerpc, the PowerVM environment supports events from hv_24x7 and hv_gpci PMU which is of example format like below: - hv_24x7/CPM_ADJUNCT_INST,domain=?,core=?/ - hv_gpci/event,partition_id=?/ The value for "?" needs to be filled in depending on system configuration. It is better to skip these parametrized events in this test as it is done in: 'commit b50d691e50e6 ("perf test: Fix "all PMU test" to skip parametrized events")' which handled a simialr instance with "all PMU test". Fix parse-events test to skip parametrized events since it needs proper setup of the parameters. Signed-off-by: Athira Rajeev Tested-by: Ian Rogers Tested-by: Sachin Sant Reviewed-by: Kajol Jain Cc: maddy@linux.ibm.com Cc: disgoel@linux.vnet.ibm.com Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230927181703.80936-1-atrajeev@linux.vnet.ibm.com Signed-off-by: Namhyung Kim commit 4f3ee7d1d5ced888e603c7fbe48e3468320745c1 Author: Jing Zhang Date: Wed Sep 27 13:59:51 2023 +0800 perf vendor events: Add JSON metrics for Arm CMN Add JSON metrics for Arm CMN. Currently just add part of CMN PMU metrics which are general and compatible for any SoC with CMN-ANY. Signed-off-by: Jing Zhang Reviewed-by: John Garry Reviewed-by: Ian Rogers Tested-by: Ian Rogers Cc: James Clark Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Shuai Xue Cc: Zhuo Song Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/1695794391-34817-8-git-send-email-renyu.zj@linux.alibaba.com Signed-off-by: Namhyung Kim commit 0b4de7bdf46c521518e38579d0ab5600a6949bec Author: Jing Zhang Date: Wed Sep 27 13:59:50 2023 +0800 perf jevents: Add support for Arm CMN PMU aliasing Currently just add aliases for part of Arm CMN PMU events which are general and compatible for any SoC and CMN-ANY. "Compat" value "(434|436|43c|43a).*" means it is compatible with all CMN600/CMN650/CMN700/Ci700, which can be obtained from commit 7819e05a0dce ("perf/arm-cmn: Revamp model detection"). The arm-cmn PMU events got from: [0] https://developer.arm.com/documentation/100180/0302/?lang=en [1] https://developer.arm.com/documentation/101408/0100/?lang=en [2] https://developer.arm.com/documentation/102308/0302/?lang=en [3] https://developer.arm.com/documentation/101569/0300/?lang=en Signed-off-by: Jing Zhang Reviewed-by: John Garry Reviewed-by: Ian Rogers Tested-by: Ian Rogers Cc: James Clark Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Shuai Xue Cc: Zhuo Song Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/1695794391-34817-7-git-send-email-renyu.zj@linux.alibaba.com Signed-off-by: Namhyung Kim commit 7fded33c6971b6c8e87cbbf48e74536aacca2991 Author: Jing Zhang Date: Wed Sep 27 13:59:49 2023 +0800 perf test: Add pmu-event test for "Compat" and new event_field. Add new event test for uncore system event which is used to verify the functionality of "Compat" matching multiple identifiers and the new event fields "EventidCode" and "NodeType". Signed-off-by: Jing Zhang Reviewed-by: Ian Rogers Tested-by: Ian Rogers Cc: James Clark Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Shuai Xue Cc: Zhuo Song Cc: John Garry Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/1695794391-34817-6-git-send-email-renyu.zj@linux.alibaba.com Signed-off-by: Namhyung Kim commit 3bb59e759cbb357f8fb46cc5a48d2b0da09b37c4 Author: Jing Zhang Date: Wed Sep 27 13:59:48 2023 +0800 perf test: Make matching_pmu effective The perf_pmu_test_event.matching_pmu didn't work. No matter what its value is, it does not affect the test results. So let matching_pmu be used for matching perf_pmu_test_pmu.pmu.name. Signed-off-by: Jing Zhang Reviewed-by: John Garry Reviewed-by: Ian Rogers Tested-by: Ian Rogers Cc: James Clark Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Shuai Xue Cc: Zhuo Song Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/1695794391-34817-5-git-send-email-renyu.zj@linux.alibaba.com Signed-off-by: Namhyung Kim commit e3e42e23c0c6e791a00eb8331dc948f316e6de1f Author: Jing Zhang Date: Wed Sep 27 13:59:47 2023 +0800 perf jevents: Support EventidCode and NodeType The previous code assumes an event has either an "event=" or "config" field at the beginning. For CMN neither of these may be present, as an event is typically "type=xx,eventid=xxx". So add EventidCode and NodeType to support CMN event description. I compared pmu_event.c before and after compiling with JEVENT_ARCH=all, they are consistent. Signed-off-by: Jing Zhang Reviewed-by: Ian Rogers Tested-by: Ian Rogers Cc: James Clark Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Shuai Xue Cc: Zhuo Song Cc: John Garry Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/1695794391-34817-4-git-send-email-renyu.zj@linux.alibaba.com Signed-off-by: Namhyung Kim commit 54409997d4b99ab63616bd431cf6244d58f8a597 Author: Jing Zhang Date: Wed Sep 27 13:59:46 2023 +0800 perf metric: "Compat" supports regular expression matching identifiers The jevent "Compat" is used for uncore PMU alias or metric definitions. The same PMU driver has different PMU identifiers due to different hardware versions and types, but they may have some common PMU metric. Since a Compat value can only match one identifier, when adding the same metric to PMUs with different identifiers, each identifier needs to be defined once, which is not streamlined enough. So let "Compat" support using regular expression to match multiple identifiers for uncore PMU metric. Signed-off-by: Jing Zhang Reviewed-by: John Garry Reviewed-by: Ian Rogers Tested-by: Ian Rogers Cc: James Clark Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Shuai Xue Cc: Zhuo Song Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/1695794391-34817-3-git-send-email-renyu.zj@linux.alibaba.com Signed-off-by: Namhyung Kim commit 2879ff36f5ed80deec5f9d82a7a4107f2347630e Author: Jing Zhang Date: Wed Sep 27 13:59:45 2023 +0800 perf pmu: "Compat" supports regular expression matching identifiers The jevent "Compat" is used for uncore PMU alias or metric definitions. The same PMU driver has different PMU identifiers due to different hardware versions and types, but they may have some common PMU event. Since a Compat value can only match one identifier, when adding the same event alias to PMUs with different identifiers, each identifier needs to be defined once, which is not streamlined enough. So let "Compat" support using regular expression to match identifiers for uncore PMU alias. For example, if the "Compat" value is set to "43401|43c01", it would be able to match PMU identifiers such as "43401" or "43c01", which correspond to CMN600_r0p0 or CMN700_r0p0. Signed-off-by: Jing Zhang Reviewed-by: Ian Rogers Tested-by: Ian Rogers Cc: James Clark Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Shuai Xue Cc: Zhuo Song Cc: John Garry Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/1695794391-34817-2-git-send-email-renyu.zj@linux.alibaba.com Signed-off-by: Namhyung Kim commit 0e501a65d35bf72414379fed0e31a0b6b81ab57d Author: Namhyung Kim Date: Fri Sep 22 16:44:44 2023 -0700 perf record: Fix BTF type checks in the off-cpu profiling The BTF func proto for a tracepoint has one more argument than the actual tracepoint function since it has a context argument at the begining. So it should compare to 5 when the tracepoint has 4 arguments. typedef void (*btf_trace_sched_switch)(void *, bool, struct task_struct *, struct task_struct *, unsigned int); Also, recent change in the perf tool would use a hand-written minimal vmlinux.h to generate BTF in the skeleton. So it won't have the info of the tracepoint. Anyway it should use the kernel's vmlinux BTF to check the type in the kernel. Fixes: b36888f71c85 ("perf record: Handle argument change in sched_switch") Reviewed-by: Ian Rogers Acked-by: Song Liu Cc: Hao Luo CC: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230922234444.3115821-1-namhyung@kernel.org Signed-off-by: Namhyung Kim commit 3337a6fea25370d3d244ec6bb38c71ee86fcf837 Author: Kathiravan Thirumoorthy Date: Mon Sep 25 13:59:22 2023 +0530 firmware: qcom_scm: use 64-bit calling convention only when client is 64-bit Per the "SMC calling convention specification", the 64-bit calling convention can only be used when the client is 64-bit. Whereas the 32-bit calling convention can be used by either a 32-bit or a 64-bit client. Currently during SCM probe, irrespective of the client, 64-bit calling convention is made, which is incorrect and may lead to the undefined behaviour when the client is 32-bit. Let's fix it. Cc: stable@vger.kernel.org Fixes: 9a434cee773a ("firmware: qcom_scm: Dynamically support SMCCC and legacy conventions") Reviewed-By: Elliot Berman Signed-off-by: Kathiravan Thirumoorthy Link: https://lore.kernel.org/r/20230925-scm-v3-1-8790dff6a749@quicinc.com Signed-off-by: Bjorn Andersson commit f1a1bc8775b26345aba2be278118999e7f661d3d Author: Uwe Kleine-König Date: Tue Sep 26 10:32:29 2023 +0200 soc: qcom: llcc: Handle a second device without data corruption Usually there is only one llcc device. But if there were a second, even a failed probe call would modify the global drv_data pointer. So check if drv_data is valid before overwriting it. Signed-off-by: Uwe Kleine-König Fixes: a3134fb09e0b ("drivers: soc: Add LLCC driver") Link: https://lore.kernel.org/r/20230926083229.2073890-1-u.kleine-koenig@pengutronix.de Signed-off-by: Bjorn Andersson commit 2138c32af19740ab54bf5622890fe96ba3530b75 Author: Krzysztof Kozlowski Date: Sun Sep 24 20:39:14 2023 +0200 ARM: dts: qcom: ipq8064: move keys and leds out of soc node GPIO keys and LEDs are not part of the SoC, so move them to top-level to fix dtbs_check warnings like: qcom-ipq8064-rb3011.dtb: soc: gpio-keys: {'compatible': ['gpio-keys'], ... should not be valid under {'type': 'object'} from schema $id: http://devicetree.org/schemas/simple-bus.yaml# Reviewed-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230924183914.51414-4-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 09f8ee81b6da5f76de8b83c8bfc4475b54e101e0 Author: Krzysztof Kozlowski Date: Sun Sep 24 20:39:13 2023 +0200 ARM: dts: qcom: mdm9615: populate vsdcc fixed regulator Fixed regulator put under "regulators" node will not be populated, unless simple-bus or something similar is used. Drop the "regulators" wrapper node to fix this. Fixes: 2c5e596524e7 ("ARM: dts: Add MDM9615 dtsi") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230924183914.51414-3-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 34c006f42cb15ac574c61859d07ae7a41ec04d84 Author: Krzysztof Kozlowski Date: Sun Sep 24 20:39:12 2023 +0200 ARM: dts: qcom: apq8060: drop incorrect regulator-type regulator-fixed does not have a "regulator-type" property: qcom-apq8060-dragonboard.dtb: regulator-fixed: Unevaluated properties are not allowed ('regulator-type' was unexpected) Reviewed-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230924183914.51414-2-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 686bca7bd170430d226c74337488088b1979bdbf Author: Krzysztof Kozlowski Date: Sun Sep 24 20:39:11 2023 +0200 ARM: dts: qcom: apq8064: drop incorrect regulator-type regulator-fixed does not have a "regulator-type" property: qcom-apq8064-ifc6410.dtb: regulator-ext-3p3v: Unevaluated properties are not allowed ('regulator-type' was unexpected) Reviewed-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230924183914.51414-1-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 88fc274cb6c4bd643b0157db2602f685af57b846 Author: Krzysztof Kozlowski Date: Sun Sep 24 20:33:35 2023 +0200 ARM: dts: qcom: sdx65: fix SDHCI clocks order Bindings expect clocks to be in different order: qcom-sdx65-mtp.dtb: mmc@8804000: clock-names:0: 'iface' was expected qcom-sdx65-mtp.dtb: mmc@8804000: clock-names:1: 'core' was expected Reviewed-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230924183335.49961-2-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 83daed13a5aa0ca563bfde920178ca67fbbdb5f3 Author: Krzysztof Kozlowski Date: Sun Sep 24 20:33:34 2023 +0200 ARM: dts: qcom: apq8064: drop label property from DSI DSI node does not accept nor use "label" property: qcom-apq8064-asus-nexus7-flo.dtb: dsi@4700000: Unevaluated properties are not allowed ('label' was unexpected) Reviewed-by: Konrad Dybcio Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230924183335.49961-1-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 9b09c0f289c5a8fc5e9b0c1f3cd2766d33b910dc Author: Unnathi Chalicheemala Date: Fri Sep 22 11:48:17 2023 -0700 soc: qcom: Switch to EXPORT_SYMBOL_GPL() Switch to GPL version of EXPORT_SYMBOL for Qualcomm SoC drivers. Signed-off-by: Unnathi Chalicheemala Reviewed-by: Trilok Soni Link: https://lore.kernel.org/r/20230922184817.5183-1-quic_uchalich@quicinc.com Signed-off-by: Bjorn Andersson commit 433ce46a97116f431ee114b4607143860aad4054 Author: Kees Cook Date: Fri Sep 22 10:54:14 2023 -0700 soc: qcom: smem: Annotate struct qcom_smem with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct qcom_smem. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Andy Gross Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Cc: linux-arm-msm@vger.kernel.org Cc: llvm@lists.linux.dev Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175413.work.929-kees@kernel.org Signed-off-by: Bjorn Andersson commit 02c58ac774a03ffefd3708f9c17ea4d911e0ade7 Author: Matti Lehtimäki Date: Fri Sep 22 03:35:33 2023 +0300 ARM: qcom: msm8974: Add rpm-master-stats node Add rpm-master-stats node for MSM8974 and the required RPM MSG RAM slices for memory access. Signed-off-by: Matti Lehtimäki Reviewed-by: Luca Weiss Link: https://lore.kernel.org/r/20230922003533.107835-3-matti.lehtimaki@gmail.com Signed-off-by: Bjorn Andersson commit bd837be0ff3879209df6fb85cf9e22fd1ba7f79b Author: Matti Lehtimäki Date: Fri Sep 22 03:35:32 2023 +0300 ARM: qcom: msm8226: Add rpm-master-stats node Add rpm-master-stats node for MSM8226 and the required RPM MSG RAM slices for memory access. Signed-off-by: Matti Lehtimäki Reviewed-by: Luca Weiss Link: https://lore.kernel.org/r/20230922003533.107835-2-matti.lehtimaki@gmail.com Signed-off-by: Bjorn Andersson commit 0b73519790d29e4bc71afc4882a9aa9ea649bcf7 Author: Matti Lehtimäki Date: Fri Sep 22 04:12:11 2023 +0300 ARM: dts: qcom: apq8026-samsung-matisse-wifi: Fix inverted hall sensor Fix hall sensor GPIO polarity and also allow disabling the sensor. Remove unneeded interrupt. Fixes: f15623bda1dc ("ARM: dts: qcom: Add support for Samsung Galaxy Tab 4 10.1 (SM-T530)") Signed-off-by: Matti Lehtimäki Reviewed-by: Luca Weiss Link: https://lore.kernel.org/r/20230922011211.115234-1-matti.lehtimaki@gmail.com Signed-off-by: Bjorn Andersson commit 33e9032a1875bb1aee3c68a4540f5a577ff44130 Author: Stephan Gerhold Date: Fri Sep 22 12:49:55 2023 +0200 arm64: dts: qcom: apq8016-sbc: Add missing ADV7533 regulators Add the missing regulator supplies to the ADV7533 HDMI bridge to fix the following dtbs_check warnings. They are all also supplied by pm8916_l6 so there is no functional difference. apq8016-sbc.dtb: bridge@39: 'dvdd-supply' is a required property apq8016-sbc.dtb: bridge@39: 'pvdd-supply' is a required property apq8016-sbc.dtb: bridge@39: 'a2vdd-supply' is a required property from schema display/bridge/adi,adv7533.yaml Fixes: 28546b095511 ("arm64: dts: apq8016-sbc: Add HDMI display support") Signed-off-by: Stephan Gerhold Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230922-db410c-adv7533-regulators-v1-1-68aba71e529b@gerhold.net Signed-off-by: Bjorn Andersson commit 9265bc6bce6919c771970e5a425a66551a1c78a0 Author: Bjorn Andersson Date: Wed Sep 20 19:37:31 2023 -0700 soc: qcom: rmtfs: Support discarding guard pages In some configurations, the exact placement of the rmtfs shared memory region isn't so strict. The DeviceTree author can then choose to use the "size" property and rely on the OS for placement (in combination with "alloc-ranges", if desired). But on some platforms the rmtfs memory region may not be allocated adjacent to regions allocated by other clients. Add support for discarding the first and last 4k block in the region, if qcom,use-guard-pages is specified in DeviceTree. Signed-off-by: Bjorn Andersson Reviewed-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230920-rmtfs-mem-guard-pages-v3-2-305b37219b78@quicinc.com Signed-off-by: Bjorn Andersson commit 3ad96787949a96256931ca59aff73ea604bc0e6c Author: Bjorn Andersson Date: Wed Sep 20 19:37:30 2023 -0700 dt-bindings: reserved-memory: rmtfs: Allow guard pages On some Qualcomm platforms the firwmare, or hardware, does not gracefully handle memory protection of the rmtfs memory region when placed adjacent to other protected region. Some DeviceTree authors have worked around this issue by explicitly reserving the space around the region, but this prevents such author to use rely on the OS to place the region, through the use of "size" (instead of a fixed location). Introduce a flag to indicate that guard pages need be carved at the beginning and end of the memory region. The user shall account for the two pages in the defined size. Signed-off-by: Bjorn Andersson Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230920-rmtfs-mem-guard-pages-v3-1-305b37219b78@quicinc.com Signed-off-by: Bjorn Andersson commit 609252ea46643f437febf312fbea1464df60b585 Author: Shuijing Li Date: Wed Aug 23 17:20:47 2023 +0800 drm/mediatek: dsi: Add mode_valid callback to DSI bridge Support IGT (Intel GPU Tools) in Mediatek DSI driver. According to the description of MIPI Alliance Specification for D-PHY Version 1.1, the maximum supported data rate is 1.5Gbps, so add mode_valid callback to dsi bridge to filter out the data rate exceeding the Specification. Signed-off-by: Shuijing Li Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/dri-devel/patch/20230823092047.32258-1-shuijing.li@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit b35babd3abea081de0611ce0d5b85281c18c52c7 Author: Jinrong Liang Date: Wed May 31 15:50:52 2023 +0800 KVM: x86/pmu: Add documentation for fixed ctr on PMU filter Update the documentation for the KVM_SET_PMU_EVENT_FILTER ioctl to include a detailed description of how fixed performance events are handled in the pmu filter. The action and fixed_counter_bitmap members of the pmu filter to determine whether fixed performance events can be programmed by the guest. This information is helpful for correctly configuring the fixed_counter_bitmap and action fields to filter fixed performance events. Suggested-by: Like Xu Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202304150850.rx4UDDsB-lkp@intel.com Signed-off-by: Jinrong Liang Link: https://lore.kernel.org/r/20230531075052.43239-1-cloudliang@tencent.com Signed-off-by: Sean Christopherson commit cf1b6d4441fffd0ba8ae4ced6a12f578c95ca049 Author: Yu Kuai Date: Wed Sep 27 14:12:41 2023 +0800 md: simplify md_seq_ops Before this patch, the implementation is hacky and hard to understand: 1) md_seq_start set pos to 1; 2) md_seq_show found pos is 1, then print Personalities; 3) md_seq_next found pos is 1, then it update pos to the first mddev; 4) md_seq_show found pos is not 1 or 2, show mddev; 5) md_seq_next found pos is not 1 or 2, update pos to next mddev; 6) loop 4-5 until the last mddev, then md_seq_next update pos to 2; 7) md_seq_show found pos is 2, then print unused devices; 8) md_seq_next found pos is 2, stop; This patch remove the magic value and use seq_list_start/next/stop() directly, and move printing "Personalities" to md_seq_start(), "unsed devices" to md_seq_stop(): 1) md_seq_start print Personalities, and then set pos to first mddev; 2) md_seq_show show mddev; 3) md_seq_next update pos to next mddev; 4) loop 2-3 until the last mddev; 5) md_seq_stop print unsed devices; Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230927061241.1552837-3-yukuai1@huaweicloud.com commit 3d8d32873c7b6d9cec5b40c2ddb8c7c55961694f Author: Yu Kuai Date: Wed Sep 27 14:12:40 2023 +0800 md: factor out a helper from mddev_put() There are no functional changes, prepare to simplify md_seq_ops in next patch. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230927061241.1552837-2-yukuai1@huaweicloud.com commit 78b5605d44e65cb2e07181fcbcde8c76ad5b07b1 Author: Mingwei Zhang Date: Tue Sep 12 18:45:53 2023 +0000 KVM: Documentation: Add the missing description for tdp_mmu_page into kvm_mmu_page Add the description for tdp_mmu_page into kvm_mmu_page description. tdp_mmu_page is a field to differentiate shadow pages from TDP MMU and non-TDP MMU. Signed-off-by: Mingwei Zhang Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230912184553.1887764-7-mizhang@google.com Signed-off-by: Sean Christopherson commit c3204c406b6d4223022af26699bd3a5b71ba5fd8 Author: Mingwei Zhang Date: Tue Sep 12 18:45:52 2023 +0000 KVM: Documentation: Add the missing description for mmu_valid_gen into kvm_mmu_page Add the description for mmu_valid_gen into kvm_mmu_page description. mmu_valid_gen is used in shadow MMU for fast zapping. Update the doc to reflect that. Signed-off-by: Mingwei Zhang Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230912184553.1887764-6-mizhang@google.com Signed-off-by: Sean Christopherson commit 6a713928ae1cb8aaa008b6ffb709fd9293614c89 Author: Mingwei Zhang Date: Tue Sep 12 18:45:51 2023 +0000 KVM: Documentation: Add the missing description for tdp_mmu_root_count into kvm_mmu_page Add the description of tdp_mmu_root_count into kvm_mmu_page description and combine it with the description of root_count. tdp_mmu_root_count is an atomic counter used only in TDP MMU. Update the doc. Signed-off-by: Mingwei Zhang Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230912184553.1887764-5-mizhang@google.com Signed-off-by: Sean Christopherson commit b40a2455e9ebdf32417e979f043c2830dd3fb3bb Author: Mingwei Zhang Date: Tue Sep 12 18:45:50 2023 +0000 KVM: Documentation: Add the missing description for ptep in kvm_mmu_page Add the missing description for ptep in kvm_mmu_page description. ptep is used when TDP MMU is enabled and it shares the storage with parent_ptes. Update the doc to help readers to get up-to-date info. Signed-off-by: Mingwei Zhang Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230912184553.1887764-4-mizhang@google.com Signed-off-by: Sean Christopherson commit fdaca560b6c4c011d76d24e8a16cb43eae63b25f Author: Mingwei Zhang Date: Tue Sep 12 18:45:49 2023 +0000 KVM: Documentation: Update the field name gfns and its description in kvm_mmu_page Update the field 'gfns' in kvm_mmu_page to 'shadowed_translation' to be consistent with the code. Also update the corresponding 'gfns' in the comments. The more detailed description of 'shadowed_translation' is already inlined in the data structure definition, so no need to duplicate the text but simply just update the names. Signed-off-by: Mingwei Zhang Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230912184553.1887764-3-mizhang@google.com Signed-off-by: Sean Christopherson commit b207cfbc8c1d04a32d19919a0df9920e909f82a5 Author: Mingwei Zhang Date: Tue Sep 12 18:45:48 2023 +0000 KVM: Documentation: Add the missing description for guest_mode in kvm_mmu_page_role Add the missing description for guest_mode in kvm_mmu_page_role description. guest_mode tells KVM whether a shadow page is used for the L1 or an L2. Update the missing field in documentation. Signed-off-by: Mingwei Zhang Reviewed-by: Kai Huang Link: https://lore.kernel.org/r/20230912184553.1887764-2-mizhang@google.com Signed-off-by: Sean Christopherson commit 57f33f1a8756c980acb335852e802e656be8aec0 Author: Michal Luczaj Date: Tue Aug 15 00:08:37 2023 +0200 KVM: Correct kvm_vcpu_event(s) typo in KVM API documentation Set KVM_GET_VCPU_EVENTS and KVM_SET_VCPU_EVENTS parameter type to `struct kvm_vcpu_events`. Events, plural. Opportunistically fix few other typos. Signed-off-by: Michal Luczaj Link: https://lore.kernel.org/r/20230814222358.707877-4-mhal@rbox.co Signed-off-by: Sean Christopherson commit 4346db6e6e7a63c25a2f6dd93f4613d6a17dbd4e Author: Michal Luczaj Date: Tue Aug 15 00:08:36 2023 +0200 KVM: x86: Force TLB flush on userspace changes to special registers Userspace can directly modify the content of vCPU's CR0, CR3, and CR4 via KVM_SYNC_X86_SREGS and KVM_SET_SREGS{,2}. Make sure that KVM flushes guest TLB entries and paging-structure caches if a (partial) guest TLB flush is architecturally required based on the CRn changes. To keep things simple, flush whenever KVM resets the MMU context, i.e. if any bits in CR0, CR3, CR4, or EFER are modified. This is extreme overkill, but stuffing state from userspace is not such a hot path that preserving guest TLB state is a priority. Suggested-by: Paolo Bonzini Signed-off-by: Michal Luczaj Link: https://lore.kernel.org/r/20230814222358.707877-3-mhal@rbox.co [sean: call out that the flushing on MMU context resets is for simplicity] Signed-off-by: Sean Christopherson commit 9dbb029b9c44a84968317d462eaa5a748317d8fb Author: Michal Luczaj Date: Tue Aug 15 00:08:35 2023 +0200 KVM: x86: Remove redundant vcpu->arch.cr0 assignments Drop the vcpu->arch.cr0 assignment after static_call(kvm_x86_set_cr0). CR0 was already set by {vmx,svm}_set_cr0(). Signed-off-by: Michal Luczaj Link: https://lore.kernel.org/r/20230814222358.707877-2-mhal@rbox.co Signed-off-by: Sean Christopherson commit 37a672be3ae357a0f87fbc00897fa7fcb3d7d782 Author: Dan Carpenter Date: Wed Sep 27 15:38:36 2023 +0300 i2c: rcar: fix error code in probe() Return an error code if devm_reset_control_get_exclusive() fails. The current code returns success. Fixes: 0e864b552b23 ("i2c: rcar: reset controller is mandatory for Gen3+") Signed-off-by: Dan Carpenter Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit 470a662688563d8f5e0fb164930d6f5507a883e4 Author: Sean Nyekjaer Date: Wed Aug 16 10:05:52 2023 +0200 i2c: stm32f7: Add atomic_xfer method to driver Add an atomic_xfer method to the driver so that it behaves correctly when controlling a PMIC that is responsible for device shutdown. The atomic_xfer method added is similar to the one from the i2c-mv64xxx driver. When running an atomic_xfer a bool flag in the driver data is set, the interrupt is not unmasked on transfer start, and the IRQ handler is manually invoked while waiting for pending transfers to complete. Signed-off-by: Sean Nyekjaer Acked-by: Andi Shyti Signed-off-by: Wolfram Sang commit 5ef104b749e8a9d47b0d93329e0445acff961972 Author: Jiapeng Chong Date: Fri Sep 22 18:06:57 2023 +0800 scsi: fnic: Clean up some inconsistent indenting No functional modification involved. drivers/scsi/fnic/fnic_fcs.c:152 fnic_handle_link() warn: inconsistent indenting. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6678 Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20230922100657.14566-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Martin K. Petersen commit fd86eff33898f8ec2381620be32b06ee57f9adf8 Author: Kees Cook Date: Fri Sep 22 10:52:39 2023 -0700 libnvdimm: Annotate struct nd_region with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct nd_region. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Ira Weiny Cc: nvdimm@lists.linux.dev Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Vishal Verma Reviewed-by: Dave Jiang Signed-off-by: Ira Weiny commit 36c75ce3bd299878fd9b238e9803d3817ddafbf3 Author: Tomas Glozar Date: Wed Sep 20 07:37:12 2023 +0200 nd_btt: Make BTT lanes preemptible nd_region_acquire_lane uses get_cpu, which disables preemption. This is an issue on PREEMPT_RT kernels, since btt_write_pg and also nd_region_acquire_lane itself take a spin lock, resulting in BUG: sleeping function called from invalid context. Fix the issue by replacing get_cpu with smp_process_id and migrate_disable when needed. This makes BTT operations preemptible, thus permitting the use of spin_lock. BUG example occurring when running ndctl tests on PREEMPT_RT kernel: BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 4903, name: libndctl preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 Preemption disabled at: [] nd_region_acquire_lane+0x15/0x90 [libnvdimm] Call Trace: dump_stack_lvl+0x8e/0xb0 __might_resched+0x19b/0x250 rt_spin_lock+0x4c/0x100 ? btt_write_pg+0x2d7/0x500 [nd_btt] btt_write_pg+0x2d7/0x500 [nd_btt] ? local_clock_noinstr+0x9/0xc0 btt_submit_bio+0x16d/0x270 [nd_btt] __submit_bio+0x48/0x80 __submit_bio_noacct+0x7e/0x1e0 submit_bio_wait+0x58/0xb0 __blkdev_direct_IO_simple+0x107/0x240 ? inode_set_ctime_current+0x51/0x110 ? __pfx_submit_bio_wait_endio+0x10/0x10 blkdev_write_iter+0x1d8/0x290 vfs_write+0x237/0x330 ... Fixes: 5212e11fde4d ("nd_btt: atomic sector updates") Signed-off-by: Tomas Glozar Reviewed-by: Ira Weiny Reviewed-by: Vishal Verma Signed-off-by: Ira Weiny commit 6fd4ebfc4d61e3097b595ab2725d513e3bbd6739 Author: Chen Ni Date: Thu Sep 14 07:03:27 2023 +0000 libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return value Use devm_kstrdup() instead of kstrdup() and check its return value to avoid memory leak. Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique name for bus provider") Signed-off-by: Chen Ni Reviewed-by: Ira Weiny Reviewed-by: Dave Jiang Signed-off-by: Ira Weiny commit 75b3d5dc0846cfa54ea52d7d84215b761ecbf569 Author: Justin Stitt Date: Wed Sep 13 01:10:24 2023 +0000 dax: refactor deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. `dax_id->dev_name` is expected to be NUL-terminated and has been zero-allocated. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer. Moreover, due to `dax_id` being zero-allocated the padding behavior of `strncpy` is not needed and a simple 1:1 replacement of strncpy -> strscpy should suffice. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Dave Jiang Signed-off-by: Ira Weiny commit a4ead6e37e3290cff399e2598d75e98777b69b37 Author: Arnd Bergmann Date: Mon Sep 25 17:59:24 2023 +0200 drm/nouveau/kms/nv50: hide unused variables After a recent change, two variables are only used in an #ifdef: drivers/gpu/drm/nouveau/dispnv50/disp.c: In function 'nv50_sor_atomic_disable': drivers/gpu/drm/nouveau/dispnv50/disp.c:1569:13: error: unused variable 'ret' [-Werror=unused-variable] 1569 | int ret; | ^~~ drivers/gpu/drm/nouveau/dispnv50/disp.c:1568:28: error: unused variable 'aux' [-Werror=unused-variable] 1568 | struct drm_dp_aux *aux = &nv_connector->aux; | ^~~ Move them into the same conditional block, along with the nv_connector variable that becomes unused during that fix. Fixes: 757033808c95 ("drm/nouveau/kms/nv50-: fixup sink D3 before tearing down link") Signed-off-by: Arnd Bergmann Reviewed-by: Danilo Krummrich Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20230925155930.677620-1-arnd@kernel.org commit 24c614c3d60c41743b1a5e588a4019c1d30c0faa Author: Danilo Krummrich Date: Tue Sep 26 12:51:28 2023 +0200 drm/gpuvm: doc: fix filename references Commit f72c2db47080 ("drm/gpuvm: rename struct drm_gpuva_manager to struct drm_gpuvm") did also change the corresponding filenames which are referenced from the documentation, but were not adjusted accordingly. Hence, fix up those filenames. Fixes: f72c2db47080 ("drm/gpuvm: rename struct drm_gpuva_manager to struct drm_gpuvm") Reported-by: Stephen Rothwell Closes: https://lore.kernel.org/dri-devel/20230926150725.4cca5fc5@canb.auug.org.au/ Signed-off-by: Danilo Krummrich Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230926105146.10808-1-dakr@redhat.com commit f83b94d23770c234cdc51a1468b3ce9d7e42f20e Author: Ville Syrjälä Date: Tue Jun 6 22:15:02 2023 +0300 drm/i915/dsb: Use DEwake to combat PkgC latency Normally we could be in a deep PkgC state all the way up to the point when DSB starts its execution at the transcoders undelayed vblank. The DSB will then have to wait for the hardware to wake up before it can execute anything. This will waste a huge chunk of the vblank time just waiting, and risks the DSB execution spilling into the vertical active period. That will be very bad, especially when programming the LUTs as the anti-collision logic will cause DSB to corrupt LUT writes during vertical active. To avoid these problems we can instruct the DSB to pre-wake the display engine on a specific scanline so that everything will be 100% ready to go when we hit the transcoder's undelayed vblank. One annoyance is that the scanline is specified as just that, a single scanline. So if we happen to start the DSB execution after passing said scanline no DEwake will happen and we may drop back into some PkgC state before reaching the transcoder's undelayed vblank. To prevent that we'll use the "force DEwake" bit to manually force the display engine to stay awake. We'll then have to clear the force bit again after the DSB is done (the force bit remains effective even when the DSB is otherwise disabled). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-18-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 77d8285683d81321cac88a4d6cdb08f1b205f432 Author: Ville Syrjälä Date: Tue Jun 6 22:15:01 2023 +0300 drm/i915: Introduce intel_crtc_scanline_to_hw() Add a helper to convert our idea of a scanline to the hw's idea of the same scanline (ie. apply crtc->scanline_offset in reverse). We'll need this to tell the DSB do stuff on a specific scanline. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-17-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit b4283282c9538958f7ee23c5af3bab3e4e94d553 Author: Ville Syrjälä Date: Tue Jun 6 22:15:00 2023 +0300 drm/i915: Introduce skl_watermark_max_latency() The DSB code will want to know the maximum PkgC latency it has to contend with. Add a helper to expose that information. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-16-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 7678e089bd18b4dd61478ce728f01fd5239e97ff Author: Ville Syrjälä Date: Tue Jun 6 22:14:59 2023 +0300 drm/i915/dsb: Evade transcoder undelayed vblank when using DSB We want to start the DSB execution from the transcoder's undelayed vblank, so in order to guarantee atomicity with the all the other mmio register writes we need to evade both vblanks. Note that currently we don't add any vblank delay, so this is effectively a nop. But in the future when we start to program double buffered registers from the DSB we'll need to delay the pipe's vblank to provide the register programming "window2" for the DSB. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-15-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 25ea3411bd23c5f0043881e2c6710423eb411784 Author: Ville Syrjälä Date: Tue Jun 6 22:14:58 2023 +0300 drm/i915/dsb: Use non-posted register writes for legacy LUT The DSB has problems writing the legacy LUT. The two workarounds I've discoverted are: - write each entry twice back to back - use non-posted writes Let's use non-posted writes as that seems a bit more standard. TODO: measure which is faster Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-14-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 5ae0da3fc78d3fdef278a22e874d6d5c305d1e03 Author: Ville Syrjälä Date: Tue Jun 6 22:14:57 2023 +0300 drm/i915/dsb: Load LUTs using the DSB during vblank Loading LUTs with the DSB outside of vblank doesn't really work due to the palette anti-collision logic. Apparently the DSB register writes don't get stalled like CPU mmio writes do and instead we end up corrupting the LUT entries. Disabling the anti-collision logic would allow us to successfully load the LUT outside of vblank, but presumably that risks the LUT reads from the scanout (temporarily) getting corrupted data from the LUT instead. The anti-collision logic isn't active during vblank so that is when we can successfully load the LUT with the DSB. That is what we want to do anyway to avoid tearing. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-13-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit dd1c3eae5855ad36134ea415d84e567d2b55e6c7 Author: Ville Syrjälä Date: Tue Jun 6 22:14:56 2023 +0300 drm/i915/dsb: Don't use DSB to load the LUTs during full modeset Using the DSB for LUT loading during full modesets would require some actual though. Let's just use mmio for the time being. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-12-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 5053121b25bf860e231784165e62714ae817e313 Author: Ville Syrjälä Date: Tue Jun 6 22:14:55 2023 +0300 drm/i915/dsb: Add support for non-posted DSB registers writes Writing specific transcoder registers (and as it turns out, the legacy LUT as well) via DSB needs a magic sequence to emit non-posted register writes. Add a helper for this. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-11-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit e39845d651791f190f10e63cc564c2e1a8aeb504 Author: Ville Syrjälä Date: Tue Jun 6 22:14:54 2023 +0300 drm/i915/dsb: Introduce intel_dsb_reg_write_masked() Add a function for emitting masked register writes. Note that the mask is implemented through byte enables, so can only mask off aligned 8bit sets of bits. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-10-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit df3b919286981bd00d115569fd431d4266731f47 Author: Ville Syrjälä Date: Tue Jun 6 22:14:53 2023 +0300 drm/i915/dsb: Introduce intel_dsb_noop() Add a helper for emitting a number of DSB NOOPs commands. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-9-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 0c1c7a649975a2cec5645860be76a91a3653e944 Author: Ville Syrjälä Date: Tue Jun 6 22:14:50 2023 +0300 drm/i915/dsb: Define the contents of some intstructions bit better Add some defines to specify what goes inside certain DSB instructions. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-6-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 357832b5cc04b063993f004eac8c332d6bba5f17 Author: Ville Syrjälä Date: Tue Jun 6 22:14:49 2023 +0300 drm/i915/dsb: Define more DSB bits Define all the DSB register bits so I don't have to look through bspec to find them. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-5-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit fa1b97f85d3bee4e9a6d6626817ab5f83a7b1b85 Author: Ville Syrjälä Date: Tue Jun 6 22:14:47 2023 +0300 drm/i915/dsb: Use non-locked register access Avoid the locking overhead for DSB registers. We don't need the locks and intel_dsb_commit() in particular needs to be called from the vblank evade critical section and thus needs to be fast. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-3-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit caf22c969ed185c41e04b3aa8e5755edcefd4225 Author: Kees Cook Date: Fri Sep 22 10:53:01 2023 -0700 scsi: target: tcmu: Annotate struct tcmu_tmr with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct tcmu_tmr. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Bodo Stroesser Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: target-devel@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230922175300.work.148-kees@kernel.org Reviewed-by: "Gustavo A. R. Silva" Reviewed-by: Bodo Stroesser Signed-off-by: Martin K. Petersen commit d15dbf000153c997e07bdebb87e24ca150eab917 Merge: f3f50c78649cb 00d2fa28da0aa Author: Martin K. Petersen Date: Wed Sep 27 11:14:07 2023 -0400 Merge patch series "UFS core patches" Bart Van Assche says: Hi Martin, Please consider these UFS core patches for the next merge window. Thanks, Bart. Link: https://lore.kernel.org/r/20230921192335.676924-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit 00d2fa28da0aa371ad215e92ebf5297c0e7d4861 Author: Bart Van Assche Date: Thu Sep 21 12:22:49 2023 -0700 scsi: ufs: core: Set the Command Priority (CP) flag for RT requests Make the UFS device execute realtime (RT) requests before other requests. This will be used in Android to reduce the I/O latency of the foreground app. Note: UFS devices do not support CDL so using CDL is not a viable alternative. Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230921192335.676924-5-bvanassche@acm.org Reviewed-by: Avri Altman Signed-off-by: Martin K. Petersen commit c788cf8a21cd3b12a1823869878e3fd93132859f Author: Bart Van Assche Date: Thu Sep 21 12:22:48 2023 -0700 scsi: ufs: core: Simplify ufshcd_comp_scsi_upiu() ufshcd_comp_scsi_upiu() has one caller and that caller ensures that lrbp->cmd != NULL. Hence leave out the lrbp->cmd check from ufshcd_comp_scsi_upiu(). Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230921192335.676924-4-bvanassche@acm.org Reviewed-by: Avri Altman Signed-off-by: Martin K. Petersen commit 858231bdb223916d6fa56fd0278074905cc201c1 Author: Bart Van Assche Date: Thu Sep 21 12:22:47 2023 -0700 scsi: ufs: core: Move the 4K alignment code into the Exynos driver The DMA alignment for the Exynos controller follows directly from the PRDT segment size configured in ufs-exynos.c. Hence, move the DMA alignment code into the Exynos driver source code. Cc: Alim Akhtar Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230921192335.676924-3-bvanassche@acm.org Reviewed-by: Alim Akhtar Tested-by: Alim Akhtar Signed-off-by: Martin K. Petersen commit cdaaff61d3bfd61aa3966eb1624e66c4152e6d1d Author: Bart Van Assche Date: Thu Sep 21 12:22:46 2023 -0700 scsi: ufs: core: Remove request tag range checks The block layer core guarantees that tag numbers are in the expected range. Hence remove the statements that check this. This patch suppresses Coverity warnings about left shifts with a negative right hand operand. The following commit originally introduced request tag range checks: 14497328b6a6 ("scsi: ufs: verify command tag validity"). Cc: daejun7.park@samsung.com Cc: John Garry Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230921192335.676924-2-bvanassche@acm.org Reviewed-by: John Garry Signed-off-by: Martin K. Petersen commit f3f50c78649cb167b5b1c567090d89824da84b2b Author: Bart Van Assche Date: Wed Sep 20 13:00:19 2023 -0700 scsi: target: Remove the references to http://www.linux-iscsi.org/ The website http://www.linux-iscsi.org/ disappeared more than a year ago. DNS records have been removed for linux-iscsi.org. The company that sponsored this website (Datera; formerly called Rising Tide) has been liquidated in early 2021 according to https://blocksandfiles.com/2021/03/19/datera-is-being-liquidated/. Since it is unlikely that the website http://www.linux-iscsi.org/ will be restored, remove the references to that website. Reviewed-by: Hannes Reinecke Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230920200232.3721784-2-bvanassche@acm.org Signed-off-by: Martin K. Petersen commit c02a427f7b64ed5b840a0720a6cee5a17a1e7e07 Author: Xueshi Hu Date: Tue Sep 12 12:44:05 2023 +0200 tick/nohz: Remove unused tick_nohz_idle_stop_tick_protected() All the caller has been removed since commit 336f560a8917 ("x86/xen: don't let xen_pv_play_dead() return") Signed-off-by: Xueshi Hu Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230912104406.312185-5-frederic@kernel.org commit 4f7f4409af289715f44685f250e380ce2cbffc7e Author: Frederic Weisbecker Date: Tue Sep 12 12:44:04 2023 +0200 tick/nohz: Don't shutdown the lowres tick from itself In lowres dynticks mode, just like in highres dynticks mode, when there is no tick to program in the future, the tick eventually gets deactivated either: * From the idle loop if in idle mode. * From the IRQ exit if in full dynticks mode. Therefore there is no need to deactivate it from the tick itself. This just just brings more overhead in the idle tick path for no reason. Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Reviewed-by: Joel Fernandes (Google) Link: https://lore.kernel.org/r/20230912104406.312185-4-frederic@kernel.org commit 822deeed3a6a3fdf0cd899d3b403ecbb12fb6c7a Author: Frederic Weisbecker Date: Tue Sep 12 12:44:03 2023 +0200 tick/nohz: Update obsolete comments Some comments are obsolete enough to assume that IRQ exit restarts the tick in idle or RCU is turned on at the same time as the tick, among other details. Update them and add more. Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230912104406.312185-3-frederic@kernel.org commit dba428a678c7263afce06b1f765efa0e054278e2 Author: Frederic Weisbecker Date: Tue Sep 12 12:44:02 2023 +0200 tick/nohz: Rename the tick handlers to more self-explanatory names The current names of the tick handlers don't tell much about what different between them. Use names that better reflect their role and resolution. Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230912104406.312185-2-frederic@kernel.org commit 6b74a30b767e362eda7deeac52edcd546c5f6d8f Author: Zhang Rui Date: Sat Sep 9 13:26:51 2023 +0800 tools/power/turbostat: Remove PC7/PC9 support on ADL/RPL Compared with other platforms that share cnl_features, ADL/RPL don't have PC7/PC9. Clone a new platform feature set from cnl_features for ADL/RPL, with PC7/PC9 removed. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 05ad96ff0fb9d1b16abb5022b9c62636c6780fc2 Author: Zhang Rui Date: Sun Aug 27 15:33:27 2023 +0800 tools/power/turbostat: Enable MSR_CORE_C1_RES on recent Intel client platforms All recent Intel client platforms have MSR_CORE_C1_RES. Enable the support on these platforms, including CNL/ICL/LKF/RKL/TGL/ADL/RPL/MTL. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 7ee39d8d593e3d28eced0fa1a8c8c6bdcbd4156e Author: Zhang Rui Date: Wed Sep 13 23:32:39 2023 +0800 tools/power/turbostat: Introduce probe_pm_features() Feature probe has nothing to do with CPUID, thus it should not be in process_cpuids(). Introduce probe_pm_features() and move all feature probing functions into it. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 5612b2c89bd0a3a2f7c9e8756e6ead971b03f8a3 Author: Zhang Rui Date: Wed Aug 30 16:54:51 2023 +0800 tools/power/turbostat: Relocate more probing related code Relocate more feature probing code outside of process_cpuids() into the corresponding probing functions. This improves the readability of code and the turbostat output. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit ce7a32c2a4cdba06ed5ead4ed8f980c893e20cd2 Author: Zhang Rui Date: Wed Aug 30 16:36:06 2023 +0800 tools/power/turbostat: Reorder some functions Reorder some functions to solve code depdency introduced by next patch. No functional change. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit db735f8ba78bf7692579b78f0ca1e40563ef79fd Author: Zhang Rui Date: Thu Aug 31 16:02:16 2023 +0800 tools/power/turbostat: Relocate thermal probing code Introduce probe_thermal(), and move all thermal probing related code into it. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit e7d7b82de192464b733fb2bcc9e305ea6f6ea47e Author: Zhang Rui Date: Thu Aug 31 16:01:36 2023 +0800 tools/power/turbostat: Relocate lpi probing code Introduce probe_lpi(), and move all lpi probing related code into it. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 2538d1673d02f66f6bdf01eebf36e271228778e9 Author: Zhang Rui Date: Thu Aug 31 16:01:12 2023 +0800 tools/power/turbostat: Relocate graphics probing code Introduce probe_graphics(), and move all graphics probing related code into it. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 6cb13609a07ba466b4613fdce7da8c98508069b7 Author: Zhang Rui Date: Thu Aug 31 16:00:33 2023 +0800 tools/power/turbostat: Rename rapl probing function Rename rapl_probe() to probe_rapl() to be consistent with other probing function names. Probe rapl after probing uncore frequency. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 622c8f23556266a5afdd657aa0518b7d70d5dfc7 Author: Zhang Rui Date: Thu Aug 31 16:00:15 2023 +0800 tools/power/turbostat: Rename uncore probing function Rename intel_uncore_frequency_probe() to probe_intel_uncore_frequency() to be consistent with other probing function names. Probe uncore frequency right after probing cstates. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 11cd9a09f3e827605cf8fc7c343ddb8c9f4ee95d Author: Zhang Rui Date: Thu Aug 31 15:58:10 2023 +0800 tools/power/turbostat: Relocate pstate probing code Introduce probe_pstates() and move all pstate probing related code into it. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 045acf6064c5567011163e97c28906e0a7791414 Author: Zhang Rui Date: Tue Aug 29 13:47:58 2023 +0800 tools/power/turbostat: Relocate cstate probing code Move all cstate probing related code into probe_cstates(). Note that dump_platform_info() actually dumps both MSR_PLATFORM_INFO and MSR_IA32_POWER_CTL. MSR_PLATFORM_INFO is for pstate and MSR_IA32_POWER_CTL is for cstate. So split dump_platform_info() and dump MSR_IA32_POWER_CTL in probe_cstates(). Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 32e8c6169af7ef7c938b1bd996d27ab171e27d80 Author: Zhang Rui Date: Thu Aug 31 14:44:06 2023 +0800 tools/power/turbostat: Improve probe_platform_features() logic AMD/Hygon platforms that don't have RAPL use 'amd_features' to describe the platform features. Unknown Intel platforms use 'default_features' to describe the platform features. As none of the platform feature is set for 'amd_features' or 'default_features', there is no need to maintain both of them. Remove 'amd_features' structure and improve the logic in probe_platform_features(). Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit d085b3b0f11af7d23601b832e0d9e446d18df968 Author: Zhang Rui Date: Sun Aug 27 21:53:21 2023 +0800 tools/power/turbostat: Delete intel_model_duplicates() Now CPU model checks have been cleaned up, no code depends on the duplicated CPU model value. Delete intel_model_duplicates(). Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 7d0ebe6f7eaf8c0ac069ddab1fe3793401139fb3 Author: Zhang Rui Date: Thu Aug 31 15:57:44 2023 +0800 tools/power/turbostat: Abstract cstate prewake bit support Abstract cstate prewake bit support. Delete is_icx()/is_spr() CPU model checks. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit ed43247b15a4fb4df01c3408fcab6e206f93ab87 Author: Zhang Rui Date: Thu Aug 31 15:49:10 2023 +0800 tools/power/turbostat: Abstract aperf/mperf multiplier support Abstract aperf/mperf multiplier support. Delete is_knl() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 58ddb691d8d8a281535406766da4e23e0f011126 Author: Zhang Rui Date: Sun Aug 27 15:07:43 2023 +0800 tools/power/turbostat: Abstract extended cstate MSRs support Abstract the support for MSR_PKG_WEIGHTED_CORE_C0_RES, MSR_PKG_ANY_CORE_C0_RES, MSR_PKG_ANY_GFXE_C0_RES and MSR_PKG_BOTH_CORE_GFXE_C0_RES. Delete has_skl_msrs() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 80d132cb45f2cc171395bfaacd74567a183ab160 Author: Zhang Rui Date: Sun Aug 27 15:00:58 2023 +0800 tools/power/turbostat: Abstract MSR_KNL_CORE_C6_RESIDENCY support Abstract the support for MSR_KNL_CORE_C6_RESIDENCY. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit c8202a6c3acf7bbde42b5e389eec40fd8e1b8358 Author: Zhang Rui Date: Sun Aug 27 15:26:14 2023 +0800 tools/power/turbostat: Abstract MSR_ATOM_PKG_C6_RESIDENCY support Abstract the support for MSR_ATOM_PKG_C6_RESIDENCY. Delete is_slm() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 6c36882e09dbc9a44d64180ba7972838d3f45488 Author: Zhang Rui Date: Sun Aug 27 14:52:24 2023 +0800 tools/power/turbostat: Abstract MSR_CC6/MC6_DEMOTION_POLICY_CONFIG support Abstract the support for MSR_CC6/MC6_DEMOTION_POLICY_CONFIG. Delete has_slv_msrs() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 9cc1c1038526a5b6c9a57397def80ba79c260ff2 Author: Zhang Rui Date: Sun Aug 27 14:47:30 2023 +0800 tools/power/turbostat: Abstract MSR_MODULE_C6_RES_MS support Abstract MSR_MODULE_C6_RES_MS support. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 76d83d2ae8e3099d9a6bd67fba918108824d7d4d Author: Zhang Rui Date: Sun Aug 27 14:41:30 2023 +0800 tools/power/turbostat: Abstract MSR_CORE_C1_RES support Abstract the support for MSR_CORE_C1_RES. Delete is_dnv() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 148df4fd04a98fb24198ecb4419c87e07d38af30 Author: Zhang Rui Date: Fri Sep 8 23:18:51 2023 +0800 tools/power/turbostat: Abstract IRTL support Abstract the support for MSR_PKGC3/PKGC6/PKGC7/PKGC8/PKGC9/PKGC10_IRTL. Delete has_snb_msrs() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 8c382f9e74663072805565036026d4e79de96425 Author: Zhang Rui Date: Sun Aug 27 14:27:26 2023 +0800 tools/power/turbostat: Use fine grained IRTL output It is pointless to dump the IRTL register for a package cstate that is not supported by the platform. Print IRTL only for states that are available in platform->supported_cstates. Delete has_c8910_msrs() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit cd7a2b6a61100a0fe8a40916d1afbd72d8833d57 Author: Zhang Rui Date: Sun Aug 27 14:24:19 2023 +0800 tools/power/turbostat: Adjust cstate for is_slm()/is_knl()/is_cnl()/is_ehl() models Disable CC3 for is_slm()/is_knl()/is_cnl()/is_ehl() models. Delete is_cnl()/is_ehl() CPU model checks. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 4d2c95d40a90877ffd8f961055419f1f550a7ed9 Author: Zhang Rui Date: Sun Aug 27 14:20:02 2023 +0800 tools/power/turbostat: Adjust cstate for has_c8910_msrs() models Enable PC8/PC9/PC10 for has_c8910_msrs() models. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 1109694817fb4fcdfccb1a86fd58e69fb60f4eab Author: Zhang Rui Date: Sun Aug 27 14:16:52 2023 +0800 tools/power/turbostat: Adjust cstate for is_bdx() models Disable CC7/PC7 for is_bdx() models. Delete is_bdx() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 24d16bec379db6eea2d72e18c97c6c80e486a5e1 Author: Zhang Rui Date: Fri Sep 8 23:18:27 2023 +0800 tools/power/turbostat: Adjust cstate for is_skx()/is_icx()/is_spr() models Disable CC3/CC7/PC3/PC7 for is_skx()/is_icx()/is_spr() models. Delete is_skx() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 8e20ced057423f0edaf40b650facc221e8030b33 Author: Zhang Rui Date: Sun Aug 27 14:12:29 2023 +0800 tools/power/turbostat: Adjust cstate for is_dnv() models Enable CC1 and disable CC3/CC7/PC3/PC7 for is_dnv() models. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 3d982ac0dafeab860b9d42f5cc41a78753275fdd Author: Zhang Rui Date: Sun Aug 27 14:09:20 2023 +0800 tools/power/turbostat: Adjust cstate for is_jvl() models Disable CC3/CC7/PC2/PC3/PC6/PC7 for is_jvl() models. Delete is_jvl() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit ff206149551f09117f44883650a45ae692745703 Author: Zhang Rui Date: Sun Aug 27 14:07:08 2023 +0800 tools/power/turbostat: Adjust cstate for has_slv_msrs() models Disable PC2/PC3/PC7 and enable PC6 for has_slv_msrs() models. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 192cbf0468ae31062526287e257f5b56214d2da5 Author: Zhang Rui Date: Fri Sep 8 23:17:58 2023 +0800 tools/power/turbostat: Adjust cstate for has_snb_msrs() models Enable PC7 for has_snb_msrs() models. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 6f1935c036f79b56b6a1dc6e51c8c6fe483983ec Author: Zhang Rui Date: Fri Sep 8 23:17:23 2023 +0800 tools/power/turbostat: Adjust cstate for models with .cst_limit set Enable PC3/PC6 for platforms with .cst_limit set because package cstates are guarded by pkg_cstate_limit. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 942c854d8d0f6c6fc0864a9da5f5e374a8e146e5 Author: Zhang Rui Date: Fri Sep 8 23:16:56 2023 +0800 tools/power/turbostat: Adjust cstate for has_snb_msrs() models Enable CC7 and PC2 for has_snb_msrs() models. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit ce7ddf8af2f96a8a7af4cc2273843518c5810166 Author: Zhang Rui Date: Fri Sep 8 23:16:27 2023 +0800 tools/power/turbostat: Adjust cstate for models with .has_nhm_msrs set Enable CC1/CC3/CC6 for platforms with .has_nhm_msrs set. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 3c6a17b8ae44b0116e303402803c173fe2a3da92 Author: Zhang Rui Date: Sun Aug 27 22:37:37 2023 +0800 tools/power/turbostat: Add skeleton support for cstate enumeration Add skeleton support for cstate enumeration. Note that the previous logic may override the cstate setting for multiple times for different reasons. The conversion to new cstate enumeration must be done step by step following the previous code order strictly. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 485a017c45200ed82518f6cdeea554f77e9a0562 Author: Zhang Rui Date: Sun Aug 27 10:37:23 2023 +0800 tools/power/turbostat: Abstract TSC tweak support On some models, the CPU base frequency is different from the TSC frequency, and the aperf/mperf counters are running at CPU base frequency instead of TSC frequency. Abstract support for TSC tweak. Given that tsc_tweak depends on base_hz, move the code to probe_bclk() after base_hz is available. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit bf1ad57c3f92c551dbfdcecd49797253f55cb7c1 Author: Zhang Rui Date: Sun Aug 27 10:28:04 2023 +0800 tools/power/turbostat: Remove unused family/model parameters for RAPL functions RAPL probing can be done without family/model checking. Remove these parameters in rapl probe functions. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 7c60409382a4be05d601e0b45db7b0166845b0cf Author: Zhang Rui Date: Sun Aug 27 10:21:10 2023 +0800 tools/power/turbostat: Abstract hardcoded TDP value Different hardcoded TDP values are used when TDP can not be retrieved from the hardware. Abstract hardcoded TDP value. Delete CPU model checks in get_tdp_intel(). Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 9e6f35159cdef148c711d2fb7d5fd2b2b6fb772d Author: Zhang Rui Date: Sat Apr 22 12:21:58 2023 +0800 tools/power/turbostat: Abstract fixed DRAM Energy unit support Abstract the support for fixed Dram domain energy unit. Delete rapl_dram_energy_units_probe() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 6d35b8c4a661c849361239fe316035ea952606a3 Author: Zhang Rui Date: Sat Apr 22 11:59:04 2023 +0800 tools/power/turbostat: Abstract RAPL divisor support INTEL_FAM6_ATOM_SILVERMONT model needs a divisor to convert the raw Energy Units value from MSR_RAPL_POWER_UNIT. Abstract the support for RAPL divisor. Delete CPU model check in rapl_probe_intel(). Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit e338831b14d2da921348c8c4055b9f2c94effe73 Author: Zhang Rui Date: Sun Aug 27 21:37:46 2023 +0800 tools/power/turbostat: Abstract Per Core RAPL support Abstract the support for Per Core RAPL. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 86ba263d9b72b7766a99059e9b3bd104d089b7fa Author: Zhang Rui Date: Mon Aug 28 15:09:40 2023 +0800 tools/power/turbostat: Abstract RAPL MSRs support Abstract the support for RAPL MSRs. Delete CPU model checks in rapl_probe_intel(). Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit a98f886035d5f7e0ec66036dd6bf98b40e75b692 Author: Zhang Rui Date: Sat Aug 26 14:57:12 2023 +0800 tools/power/turbostat: Simplify the logic for RAPL enumeration The support for each RAPL domains, as well as the support for the perf status of each RAPL domains, can be detected by checking the availabilities of the corresponding RAPL MSRs. Change the code accordingly and remove the hardcoded logic for each model. Note that this also fixes the INTEL_FAM6_ATOM_TREMONT model, which has RAPL_PKG_PERF_STATUS and MSR_DRAM_PERF_STATUS but doesn't have BIC_PKG__ and BIC_RAM__ set. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit b9cd66833d3a651cea10666674e9abcf2182e8ad Author: Zhang Rui Date: Sat Aug 26 14:38:38 2023 +0800 tools/power/turbostat: Redefine RAPL macros Redefine RAPL macros to make the code more readable. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit a5d1ab93a0993616efbf61378e491d6673f4684d Author: Zhang Rui Date: Sat Apr 22 11:39:49 2023 +0800 tools/power/turbostat: Abstract hardcoded Crystal Clock frequency Abstract the support for hardcoded Crystal Clock frequency, which is used when crystal clock is not available from CPUID.15. Delete CPU model checks in process_cpuid(). Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit d90120bf9f111bec8ba0b8ef86c46ccbcd9df188 Author: Zhang Rui Date: Sat Apr 22 11:29:18 2023 +0800 tools/power/turbostat: Abstract Automatic Cstate Conversion support Abstract the support for AUTOMATIC_CSTATE_CONVERSION bit in MSR_PKG_CST_CONFIG_CONTROL. Delete automatic_cstate_conversion_probe() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 0c057cf7a0e163bf9631b83c002b3a55691674c7 Author: Zhang Rui Date: Sun Jul 30 14:25:17 2023 +0800 tools/power/turbostat: Abstract Perf Limit Reasons MSRs support Abstract the support for MSR_CORE/GFX/RING_PERF_LIMIT_REASONS MSRs. Delete perf_limit_reasons_probe() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit d8e1623baa0b49aa90cf5801cfaac9e3d3aa1e19 Author: Zhang Rui Date: Fri Aug 25 23:04:44 2023 +0800 tools/power/turbostat: Abstract TCC Offset bits support Abstract the support for different TCC Offset bits in MSR_IA32_TEMPERATURE_TARGET. Delete check_tcc_offset() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit a61c9cb478c0bf31a50d1829834e822e92876c95 Author: Zhang Rui Date: Thu Aug 31 14:19:46 2023 +0800 tools/power/turbostat: Abstract Config TDP MSRs support Abstract the support for MSR_CONFIG_TDP_NOMINAL/LEVEL_1/LEVEL_2/CONTROL and MSR_TURBO_ACTIVATION_RATIO. Delete has_config_tdp() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit a3943deaf98f713c819dd7e67af734d4ed4da030 Author: Zhang Rui Date: Sun Jul 30 13:54:25 2023 +0800 tools/power/turbostat: Rename some TRL functions Rename dump_hsw_turbo_ratio_limits() and dump_ivt_turbo_ratio_limits() to dump_turbo_ratio_limit2() and dump_turbo_ratio_limit1() because they dump MSR_TURBO_RATIO_LIMIT1/LIMIT2, and the MSRs' behavior is consistent when they are available. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 10d85d85ab4f3ae7faca4450ce7b0a166fd396f0 Author: Zhang Rui Date: Fri Sep 8 23:16:00 2023 +0800 tools/power/turbostat: Abstract Turbo Ratio Limit MSRs support Abstract the support for MSR_TURBO_RATIO_LIMIT, MSR_TRUBO_RATIO_LIMIT1, MSR_TURBO_RATIO_LIMIT2, MSR_SECONDARY_TURBO_RATIO_LIMIT, MSR_ATOM_CORE_RATIOS and MSR_ATOM_CORE_TURBO_RATIOS. Delete has_turbo_ratio_group_limits(), has_turbo_ratio_limit(), has_atom_turbo_ratio_limit(), has_ivt_turbo_ratio_limit(), has_hsw_turbo_ratio_limit(), has_knl_turbo_ratio_limit() and has_glm_turbo_ratio_limit() CPU model checks. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 8b7199c0855e3b22532a21aaaed78e699431e4e5 Author: Zhang Rui Date: Mon Mar 27 14:58:35 2023 +0800 tools/power/turbostat: Rename some functions Rename dump_nhm_platform_info() and dump_nhm_cst_cfg() to dump_platform_info() and dump_cst_cfg() because these MSRs' behavior is consistent when they're available. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit c2c25e85df316a624e4a8ee85d65ea29265f486d Author: Zhang Rui Date: Mon Mar 27 14:57:06 2023 +0800 tools/power/turbostat: Remove a redundant check Platforms with has_msr_misc_pwr_mgmt set is a subset of platforms with has_nhm_msrs set. Thus remove the redudant check for platform->has_nhm_msrs. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit fcfa1ce074ab76272639961d4d7900b91657a8d5 Author: Zhang Rui Date: Fri Aug 25 16:52:23 2023 +0800 tools/power/turbostat: Abstract Nehalem MSRs support MSR_PLATFORM_INFO, MSR_IA32_TEMPERATURE_TARGET, MSR_SMI_COUNT, MSR_PKG_CST_CONFIG_CONTROL, and the TRL MSRs are always available for platforms since Nehalem. Support for these msrs can be described altogether. Abstract the support for these MSRs. Delete probe_nhm_msrs() CPU model check. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 3989fc890782c8002477895e9f24ffb98a132293 Author: Zhang Rui Date: Sun Aug 27 22:37:06 2023 +0800 tools/power/turbostat: Abstract Package cstate limit decoding support Abstract the support for decoding package cstate limit from MSR_PKG_CST_CONFIG_CONTROL. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 71e841293c715797d8c6ae8cdc3f74b4396c5570 Author: Zhang Rui Date: Mon Aug 21 22:22:48 2023 +0800 tools/power/turbostat: Abstract BCLK frequency support Abstract CPU base clock frequency support. Note that bclk is used by 1. calculate base_hz using MSR_PLATFORM_INFO, which is guarded by probe_nhm_msrs(). 2. dump MSR_PLATFORM_INFO and Turbo Ratio Limit MSRs, which are also guarded by probe_nhm_msrs(). Thus probe_bclk() works for probe_nhm_msrs() models only. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 3dd0e7547d11e770bafb40ad41f2631cc4b16649 Author: Zhang Rui Date: Mon Aug 21 22:12:57 2023 +0800 tools/power/turbostat: Abstract MSR_MISC_PWR_MGMT support Abstract MSR_MISC_PWR_MGMT support. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 778fc34a7a3db2811e28ce570318dd047f278cb2 Author: Zhang Rui Date: Mon Aug 21 15:26:32 2023 +0800 tools/power/turbostat: Abstract MSR_MISC_FEATURE_CONTROL support Abstract MSR_MISC_FEATURE_CONTROL support. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 45232ab168a3c5abad86eafaef2beed8d7037666 Author: Zhang Rui Date: Sun Aug 27 21:52:53 2023 +0800 tools/power/turbostat: Add skeleton support for table driven feature enumeration Turbostat supports a series of features that may diverge among different CPU models. Current code uses various of CPU model checks in different places to handle this, which makes the code hard to maintain. Add skeleton support for table driven feature enumeration to replace the current error-prone CPU model checks and global variables. Note: by comparing the CPU models with intel-family.h, it is found that turbostat support for below four Models are missing, including INTEL_FAM6_ICELAKE, INTEL_FAM6_ATOM_SILVERMONT_MID, INTEL_FAM6_ATOM_AIRMONT_MID and INTEL_FAM6_ATOM_AIRMONT_NP. Adding support for these models is a different work, thus it is not covered in this patch set. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 48674c1bb6124fe392e8fed80a39fcb3f62e6551 Author: Zhang Rui Date: Mon Mar 27 12:36:55 2023 +0800 tools/power/turbostat: Remove pseudo check for two models INTEL_FAM6_ATOM_SILVERMONT_MID/INTEL_FAM6_ATOM_AIRMONT_MID are not listed in probe_nhm_msrs(). This means that most of the turbostat features are not available on these two platforms. Further more, checking for these two models in has_slv_msrs() is dead code. Because has_slv_msrs() is called by the code guarded by probe_nhm_msrs(). For these two reasons, remove pseudo check for INTEL_FAM6_ATOM_SILVERMONT_MID and INTEL_FAM6_ATOM_AIRMONT_MID. Will add back the support when we can access these two platforms. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit bbfc33b1e49f443296e56d8b76c77373f700aedc Author: Zhang Rui Date: Fri Mar 24 16:27:30 2023 +0800 tools/power/turbostat: Remove redundant duplicates Remove redundant duplicates in intel_model_duplicates(). Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 6d306d6ec7e0f9a5e90f5afd70e3b6c32ae50ce6 Author: Zhang Rui Date: Fri Mar 24 16:26:25 2023 +0800 tools/power/turbostat: Replace raw value cpu model with Macro Kernel already has #define INTEL_FAM6_NEHALEM_G 0x1F /* Auburndale / Havendale */ Use standard Macro for CPU Model instead of raw value. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 2c019d657968bdd93e11615e0919d8181a54742d Author: Zhang Rui Date: Sun Aug 21 22:39:16 2022 +0800 tools/power/turbostat: Support alternative graphics sysfs knobs /sys/class/graphics/fb0/device/drm/card0/ and /sys/class/drm/card0/ point to the same device node. But in some cases, one exists and the other one does not. Prefer to use /sys/class/drm/card0/, and fall back to /sys/class/graphics/fb0/device/drm/card0/. This recovers the "GFXMHz" and "GFXAMHz" columns on some platforms like a SPR server. Reviewed-by: Rodrigo Vivi Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit b98a6d78768ec459d394db8bc086d071eb6556c8 Author: Zhang Rui Date: Fri Mar 24 16:30:55 2023 +0800 tools/power/turbostat: Enable TCC Offset on more models All Models that duplicate INTEL_FAM6_CANNONLAKE_L support TCC Offset. Enable this feature on all these models. Delete obsolete model_orig. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit b61b7d8c4c22c4298a50ae5d0ee88facb85ce665 Author: Chen Yu Date: Mon Mar 27 11:17:44 2023 +0800 tools/power/turbostat: Enable the C-state Pre-wake printing Currently the C-state Pre-wake will not be printed due to the probe has not been invoked. Invoke the probe function accordingly. Fixes: aeb01e6d71ff ("tools/power turbostat: Print the C-state Pre-wake settings") Signed-off-by: Chen Yu Reviewed-by: Zhang Rui Reviewed-by: Len Brown commit 137f01b3529d292a68d22e9681e2f903c768f790 Author: Zhang Rui Date: Sat Mar 25 21:57:07 2023 +0800 tools/power/turbostat: Fix a knl bug MSR_KNL_CORE_C6_RESIDENCY should be evaluated only if 1. this is KNL platform AND 2. need to get C6 residency or need to calculate C1 residency Fix the broken logic introduced by commit 1e9042b9c8d4 ("tools/power turbostat: Fix CPU%C1 display value"). Fixes: 1e9042b9c8d4 ("tools/power turbostat: Fix CPU%C1 display value") Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 4d1827485acecac0016eaaec199e97697afdaa84 Author: Zhang Rui Date: Mon Jul 31 14:02:11 2023 +0800 tools/power/turbostat: Fix failure with new uncore sysfs On some platforms, turbostat fails during launch time like below, turbostat version 2023.03.17 - Len Brown ... cpu40: MSR_IA32_PACKAGE_THERM_STATUS: 0x884c0000 (24 C) cpu40: MSR_IA32_PACKAGE_THERM_INTERRUPT: 0x00000003 (100 C, 100 C) turbostat: snapshot_sysfs_counter(/sys/devices/system/cpu/intel_uncore_frequency/package_00_die_00/current_freq_khz): No data available This is because new uncore sysfs is used on these platforms as introduced by commit 9b8dea80e3cb ("platform/x86/intel-uncore-freq: Support for cluster level controls"). With the new uncore sysfs interface, /sys/devices/system/cpu/intel_uncore_frequency/package_00_die_00/current_freq_khz is still available, but reading it fails. How to support the fabric cluster level uncore sysfs is not settled yet, as a short term fix, clear the BIC_UNCORE_MHZ bit when new sysfs I/F is detected. Signed-off-by: Zhang Rui Reviewed-by: Len Brown commit 0d9741abd1c583e7bedb178358a9abd0981f49ba Author: Dan Carpenter Date: Wed Sep 27 15:37:26 2023 +0300 ACPI: thermal: Fix a small leak in acpi_thermal_add() Free "tz" if the "trip" allocation fails. Fixes: 5fc2189f9335 ("ACPI: thermal: Create and populate trip points table earlier") Signed-off-by: Dan Carpenter Signed-off-by: Rafael J. Wysocki commit 8b6022be4c6e3e0d37c3e1378c9ff0a2c8717b09 Author: Sudeep Holla Date: Mon Sep 25 11:15:57 2023 +0100 firmware: arm_scmi: Rename scmi_{msg_,}clock_config_{get,set}_{2,21} It is very confusing to use *_v2 for everything applicable until SCMI clock protocol version v2.0 including v1.0 for example. So let us rename such that *_v2 is used only for SCMI clock protocol v2.1 onwards. Also add comment to indicate the same explicitly. Reviewed-by: Cristian Marussi Link: https://lore.kernel.org/r/20230925101557.3839860-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit cec422ab8c1ef320cba23b7dbf9ea5364b9c8207 Author: Andy Shevchenko Date: Tue Sep 26 22:08:18 2023 +0300 pinctrl: denverton: Enable platform device in the absence of ACPI enumeration This is to cater the need for non-ACPI system whereby a platform device has to be created in order to bind with the Denverton pinctrl platform driver. Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit a10aa2584ef5223398cce82310bf5fa6ef9a75ab Author: Sudeep Holla Date: Thu Sep 21 09:52:57 2023 +0100 firmware: arm_scmi: Do not use !! on boolean when setting msg->flags Both pc->async_powercap_cap_set and ignore_dresp are already boolean. Use of !! on them is obviously dubious. Sparse reports: drivers/firmware/arm_scmi/powercap.c:363:17: warning: dubious: x & !y drivers/firmware/arm_scmi/powercap.c:363:17: warning: dubious: x & !y Remove the unnecessary !! and get rid of the warning. Reviewed-by: Cristian Marussi Link: https://lore.kernel.org/r/20230921085257.3125744-1-sudeep.holla@arm.com Signed-off-by: Sudeep Holla commit 0361e81f3170a4675f8841ba9d52670934dd0339 Author: Varadarajan Narayanan Date: Thu Sep 7 10:51:43 2023 +0530 dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ9574 Document IPQ9574 compatible for Qcom NVMEM CPUFreq driver. Signed-off-by: Varadarajan Narayanan Acked-by: Krzysztof Kozlowski Signed-off-by: Viresh Kumar commit 0cd3f86ad558d3f585634e211c6fccbe786cbc28 Author: Danila Tikhonov Date: Sat Sep 16 20:59:51 2023 +0300 dt-bindings: power: qcom,rpmpd: Add SM7150 Add a compatible for SM7150 platforms. Signed-off-by: Danila Tikhonov Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230916175952.178611-2-danila@jiaxyga.com Signed-off-by: Ulf Hansson commit 8c6f736d8acf02603bc503786e6ffb89e0cab39e Author: Varadarajan Narayanan Date: Thu Sep 7 10:51:40 2023 +0530 dt-bindings: cpufreq: qcom-cpufreq-nvmem: document IPQ5332 Document IPQ5332 compatible for Qcom NVMEM CPUFreq driver. Signed-off-by: Varadarajan Narayanan Acked-by: Krzysztof Kozlowski Signed-off-by: Viresh Kumar commit b9a663c4c224372ae847f500fdadcc1bdc9e8425 Author: Rob Herring Date: Mon Sep 25 14:02:35 2023 -0500 cpufreq: pmac32: Use of_property_read_reg() to parse "reg" Use the recently added of_property_read_reg() helper to get the untranslated "reg" address value. Signed-off-by: Rob Herring Signed-off-by: Viresh Kumar commit 3a7fd473bd5d430c8045830e9a09e8dc35bcca6b Author: Bartosz Golaszewski Date: Tue Sep 26 11:06:23 2023 +0200 mtd: rawnand: ingenic: move the GPIO quirk to gpiolib-of.c We have a special place for OF polarity quirks in gpiolib-of.c. Let's move this over there so that it doesn't pollute the driver. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Acked-by: Miquel Raynal Acked-by: Paul Cercueil Reviewed-by: Andy Shevchenko commit d776f654d08948639d445a750839612977e78a49 Author: Stanislaw Gruszka Date: Thu Sep 7 09:26:10 2023 +0200 accel/ivpu: Compile ivpu_debugfs.c conditionally Only compile ivpu_debugfs.c file with CONFIG_DEBUG_FS. Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230907072610.433497-2-stanislaw.gruszka@linux.intel.com commit c78199a78fe8c4f1724820a8f41f81a08a8d6e8a Author: Stanislaw Gruszka Date: Thu Sep 7 09:26:09 2023 +0200 accel/ivpu: Update debugfs to latest changes in DRM Use new drm debugfs helpers. This is needed after changes from commit 78346ebf9f94 ("drm/debugfs: drop debugfs_init() for the render and accel node v2"). Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230907072610.433497-1-stanislaw.gruszka@linux.intel.com commit 1e975e591af98b45a9e37eabfd4bb01a6184c314 Author: Tvrtko Ursulin Date: Tue Sep 26 11:08:55 2023 +0100 drm/i915: Do not disable preemption for resets Commit ade8a0f59844 ("drm/i915: Make all GPU resets atomic") added a preempt disable section over the hardware reset callback to prepare the driver for being able to reset from atomic contexts. In retrospect I can see that the work item at a time was about removing the struct mutex from the reset path. Code base also briefly entertained the idea of doing the reset under stop_machine in order to serialize userspace mmap and temporary glitch in the fence registers (see eb8d0f5af4ec ("drm/i915: Remove GPU reset dependence on struct_mutex"), but that never materialized and was soon removed in 2caffbf11762 ("drm/i915: Revoke mmaps and prevent access to fence registers across reset") and replaced with a SRCU based solution. As such, as far as I can see, today we still have a requirement that resets must not sleep (invoked from submission tasklets), but no need to support invoking them from a truly atomic context. Given that the preemption section is problematic on RT kernels, since the uncore lock becomes a sleeping lock and so is invalid in such section, lets try and remove it. Potential downside is that our short waits on GPU to complete the reset may get extended if CPU scheduling interferes, but in practice that probably isn't a deal breaker. In terms of mechanics, since the preemption disabled block is being removed we just need to replace a few of the wait_for_atomic macros into busy looping versions which will work (and not complain) when called from non-atomic sections. v2: * Fix timeouts which are now in us. (Andi) * Update one comment as a drive by. (Andi) Signed-off-by: Tvrtko Ursulin Cc: Chris Wilson Cc: Paul Gortmaker Cc: Sebastian Andrzej Siewior Cc: Andi Shyti Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230926100855.61722-1-tvrtko.ursulin@linux.intel.com commit 09b59829715bc3c929bb300e2bd5d01e37faa3d3 Merge: 4b9b94766534e 84ee19bffc930 Author: Ulf Hansson Date: Wed Sep 27 12:39:29 2023 +0200 mmc: Merge branch fixes into next Merge the mmc fixes for v6.6-rc[n] into the next branch, to allow them to get tested together with the new mmc changes that are targeted for v6.7. Signed-off-by: Ulf Hansson commit 9edb071c8bd322482fa9cd1b60f26d0243479d76 Author: Justin Stitt Date: Tue Sep 19 04:41:16 2023 +0000 drm/gma500: refactor deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. Since `chan->base.name` is expected to be NUL-terminated, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without also unnecessarily NUL-padding (since `chan` is kzalloc'd already). Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20230919-drivers-gpu-drm-gma500-oaktrail_lvds_i2c-c-v2-1-9ebe6983b4cb@google.com commit 4b9b94766534ea23bffc8606b73fb18501b49a67 Author: Justin Stitt Date: Wed Sep 27 06:41:37 2023 +0000 mmc: vub300: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect `vub300->vub_name` to be NUL-terminated based on its uses with format strings: | dev_info(&vub300->udev->dev, "using %s for SDIO offload processing\n", | vub300->vub_name); NUL-padding is not needed. We can see cleaning out vub_name simply consists of: | vub300->vub_name[0] = 0; Considering the above, for all 11 cases a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. To be clear, there is no existing bug in the current implementation as the string literals are all small enough as to not cause a buffer overread. Nonetheless, this gets us 11 steps closer to removing strncpy uses. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Link: https://lore.kernel.org/r/20230927-strncpy-drivers-mmc-host-vub300-c-v1-1-77426f62eef4@google.com Signed-off-by: Ulf Hansson commit 3e65dba664d88ed7075ff9dc2090767fa4b3bec8 Merge: 45492b13453f9 c7bb120c1c666 Author: Ulf Hansson Date: Wed Sep 27 12:13:24 2023 +0200 mmc: Merge branch fixes into next Merge the mmc fixes for v6.6-rc[n] into the next branch, to allow them to get tested together with the new mmc changes that are targeted for v6.7. Signed-off-by: Ulf Hansson commit 45492b13453f9862abff6f9d7af5e8116849a9c9 Author: Kees Cook Date: Fri Sep 22 10:52:50 2023 -0700 memstick: jmb38x_ms: Annotate struct jmb38x_ms with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct jmb38x_ms. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Maxim Levitsky Cc: Alex Dubov Cc: Ulf Hansson Cc: Tom Rix Cc: Len Baker Cc: Dan Carpenter Cc: "Gustavo A. R. Silva" Cc: linux-mmc@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230922175249.work.593-kees@kernel.org Signed-off-by: Ulf Hansson commit c8b850f0f021c15594a1543b7f5d629e45f9150a Author: William Qiu Date: Fri Sep 22 14:28:33 2023 +0800 mmc: starfive: Change tuning implementation Before, we used syscon to achieve tuning, but the actual measurement showed little effect, so the tuning implementation was modified here, and it was realized by reading and writing the UHS_REG_EXT register. Signed-off-by: William Qiu Reviewed-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20230922062834.39212-3-william.qiu@starfivetech.com Signed-off-by: Ulf Hansson commit 54a88bfbce2562b11b2db7cd1c255ebf590d0e14 Author: William Qiu Date: Fri Sep 22 14:28:32 2023 +0800 dt-bindings: mmc: starfive: Remove properties from required Due to the change of tuning implementation, it's no longer necessary to use the "starfive,sysreg" property in dts, so remove it from required. Signed-off-by: William Qiu Acked-by: Conor Dooley Reviewed-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20230922062834.39212-2-william.qiu@starfivetech.com Signed-off-by: Ulf Hansson commit 68df98c48398e68e7f187b5ee92fb2576d6fd7d1 Author: Wenchao Chen Date: Tue Sep 19 15:47:07 2023 +0800 mmc: hsq: Improve random I/O write performance for 4k buffers By dynamically adjusting the host->hsq_depth, based upon the buffer size being 4k and that we get at least two I/O write requests in flight, we can improve the throughput a bit. This is typical for a random I/O write pattern. More precisely, by dynamically changing the number of requests in flight from 2 to 5, we can on some platforms observe ~4-5% increase in throughput. Signed-off-by: Wenchao Chen Link: https://lore.kernel.org/r/20230919074707.25517-3-wenchao.chen@unisoc.com [Ulf: Re-wrote the commitmsg, minor adjustment to the code - all to clarify.] Signed-off-by: Ulf Hansson commit 2e2b547950bc09e75afe912f9683be39c2195d9d Author: Wenchao Chen Date: Tue Sep 19 15:47:06 2023 +0800 mmc: core: Allow dynamical updates of the number of requests for hsq To allow dynamical updates of the current number of used in-flight requests, let's move away from using a hard-coded value to a use a corresponding variable in the struct mmc_host. This can be valuable when optimizing for certain I/O request sequences, as shown by subsequent changes. Signed-off-by: Wenchao Chen Link: https://lore.kernel.org/r/20230919074707.25517-2-wenchao.chen@unisoc.com [Ulf: Re-wrote the commitmsg to clarify the change] Signed-off-by: Ulf Hansson commit 3efcb471f871cc095841d411f98c593228ecbac6 Author: Chancel Liu Date: Wed Sep 20 23:36:21 2023 +0800 ASoC: soc-pcm.c: Make sure DAI parameters cleared if the DAI becomes inactive The commit 1da681e52853 ("ASoC: soc-pcm.c: Clear DAIs parameters after stream_active is updated") tries to make sure DAI parameters can be cleared properly through moving the cleanup to the place where stream active status is updated. However, it will cause the cleanup only happening in soc_pcm_close(). Suppose a case: aplay -Dhw:0 44100.wav 48000.wav. The case calls soc_pcm_open()->soc_pcm_hw_params()->soc_pcm_hw_free()-> soc_pcm_hw_params()->soc_pcm_hw_free()->soc_pcm_close() in order. The parameters would be remained in the system even if the playback of 44100.wav is finished. The case requires us clearing parameters in phase of soc_pcm_hw_free(). However, moving the DAI parameters cleanup back to soc_pcm_hw_free() has the risk that DAIs parameters never be cleared if there're more than one stream, see commit 1da681e52853 ("ASoC: soc-pcm.c: Clear DAIs parameters after stream_active is updated") for more details. To meet all these requirements, in addition to do DAI parameters cleanup in soc_pcm_hw_free(), also check it in soc_pcm_close() to make sure DAI parameters cleared if the DAI becomes inactive. Fixes: 1da681e52853 ("ASoC: soc-pcm.c: Clear DAIs parameters after stream_active is updated") Signed-off-by: Chancel Liu Link: https://lore.kernel.org/r/20230920153621.711373-2-chancel.liu@nxp.com Signed-off-by: Mark Brown commit 57b55c76aaf1ba50ecc6dcee5cd6843dc4d85239 Author: Yu Tu Date: Mon Sep 4 15:55:04 2023 +0800 clk: meson: S4: add support for Amlogic S4 SoC peripheral clock controller Add the peripherals clock controller driver in the S4 SoC family. [jbrunet: remove extra new line at end of s4-peripherals.h] Signed-off-by: Yu Tu Link: https://lore.kernel.org/r/20230904075504.23263-5-yu.tu@amlogic.com Signed-off-by: Jerome Brunet commit 435d422624b74085e2c0be650dc3a1d3a4a6bfa5 Author: Geert Uytterhoeven Date: Thu Aug 31 13:17:47 2023 +0200 ARM: shmobile: sh73a0: Reserve boot area when SMP is enabled CPU core bringup on SH-Mobile AG5 uses the SYS Boot Address (SBAR) and Address Translation Area (APARMBAREA) registers to specify the base address and size of the boot area of the System CPU. With this enabled, when the System CPU accesses a physical address in the range from zero up to the configured size, the top address bits are replaced by those specified in the SBAR register. Hence any device residing in this low part of physical address space cannot be accessed. Prevent conflicts by reserving this memory region using request_mem_region(). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20eb4e7fca9c41a34500fc5984602b41006b4575.1693409184.git.geert+renesas@glider.be commit 8d17004ebcd2cdcb8192500173fca67004e7c9ca Author: Geert Uytterhoeven Date: Thu Aug 31 13:17:46 2023 +0200 ARM: shmobile: r8a7779: Reserve boot area when SMP is enabled CPU core bringup on R-Car H1 uses the ARM Reset Vector Address Register (AVECR) to specify the base address and size of the boot area of the System CPU. With this enabled, when the System CPU accesses a physical address in the range from zero up to the configured size, the top address bits are replaced by those specified in the AVECR register. Hence any device residing in this low part of physical address space cannot be accessed, Prevent conflicts by reserving this memory region using request_mem_region(). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/924961188abdf2adb52167edb7ed848a6efcca39.1693409184.git.geert+renesas@glider.be commit 9797e3519c68fd75eb73eb959f8d11830261e7bb Author: Geert Uytterhoeven Date: Thu Aug 31 13:17:45 2023 +0200 ARM: shmobile: rcar-gen2: Reserve boot area when SMP is enabled CPU core bringup on R-Car Gen2 SoCs uses the Cortex-A7/A15 Boot Address Register to specify the boot area of the System CPU. With this enabled, when the System CPU accesses a physical address in the range from 0x0 to 0x3ffff, the top address bits are replaced by those specified in the SBAR register. Hence any device residing in the low 256 KiB of physical address space cannot be accessed. Prevent conflicts by reserving this memory region using request_mem_region(). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/091150233acb0557a2ad3294d67b2adb6758670c.1693409184.git.geert+renesas@glider.be commit e8b4ff6a856d02ee64a6023edf45e11827badeef Author: Kees Cook Date: Fri Sep 22 10:50:06 2023 -0700 pinctrl: uniphier: Annotate struct uniphier_pinctrl_reg_region with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct uniphier_pinctrl_reg_region. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Linus Walleij Cc: Kunihiko Hayashi Cc: Masami Hiramatsu Cc: linux-gpio@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175006.work.421-kees@kernel.org Signed-off-by: Linus Walleij commit 07113fea91dc50ff6f6d06893d972109d6416cd8 Author: Luca Weiss Date: Tue Sep 19 14:45:59 2023 +0200 dt-bindings: pinctrl: qcom,sc7280: Allow gpio-reserved-ranges Allow the gpio-reserved-ranges property on SC7280 TLMM. Acked-by: Linus Walleij Acked-by: Krzysztof Kozlowski Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20230919-fp5-initial-v2-5-14bb7cedadf5@fairphone.com Signed-off-by: Linus Walleij commit b50df2f58aa363945deb9bf395764c7c0f659492 Author: Luca Ceresoli Date: Tue Sep 26 12:39:38 2023 +0200 pinctrl: tegra: add OF node when logging OF parsing errors These errors are not quite clear without also logging they device tree node being parsed, especially when the pinmux node has lots of subnodes. Adding the node name helps a lot in finding the node that triggers the error. Signed-off-by: Luca Ceresoli Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20230926103938.334055-1-luca.ceresoli@bootlin.com Signed-off-by: Linus Walleij commit e787c9c55edadb5d9d6c75ce5080dd3c64bd996b Author: Yu Tu Date: Mon Sep 4 15:55:03 2023 +0800 clk: meson: S4: add support for Amlogic S4 SoC PLL clock driver Add the S4 PLL clock controller driver in the S4 SoC family. Signed-off-by: Yu Tu Link: https://lore.kernel.org/r/20230904075504.23263-4-yu.tu@amlogic.com Signed-off-by: Jerome Brunet commit 98949499169634263ed4a0bb21e9d9677301c17d Author: Yu Tu Date: Mon Sep 4 15:55:02 2023 +0800 dt-bindings: clock: document Amlogic S4 SoC peripherals clock controller Add the S4 peripherals clock controller dt-bindings in the S4 SoC family. Signed-off-by: Yu Tu Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230904075504.23263-3-yu.tu@amlogic.com Signed-off-by: Jerome Brunet commit 923a77a2e18001f290432b96cb71f68b3423296d Author: Yu Tu Date: Mon Sep 4 15:55:01 2023 +0800 dt-bindings: clock: document Amlogic S4 SoC PLL clock controller Add the S4 PLL clock controller dt-bindings in the S4 SoC family. Signed-off-by: Yu Tu Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230904075504.23263-2-yu.tu@amlogic.com Signed-off-by: Jerome Brunet commit fd6627cb82d5e991dedbd972a219311eabe89884 Author: Hans Verkuil Date: Sat Sep 23 17:21:07 2023 +0200 media: radio-si476x: don't fill in bus_info Let the V4L2 core fill in bus_info. This fixes this warning: drivers/media/radio/radio-si476x.c: In function 'si476x_radio_querycap': drivers/media/radio/radio-si476x.c:333:28: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 23 [-Wformat-truncation=] 333 | "platform:%s", radio->v4l2dev.name); | ^~ drivers/media/radio/radio-si476x.c:332:9: note: 'snprintf' output between 10 and 45 bytes into a destination of size 32 332 | snprintf(capability->bus_info, sizeof(capability->bus_info), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 333 | "platform:%s", radio->v4l2dev.name); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil commit b66215e7b7802caf6aceba0928a437d40e15d3f1 Author: Hans Verkuil Date: Sat Sep 23 17:21:06 2023 +0200 media: verisilicon: replace snprintf with strscpy+strlcat Fixes this warning: drivers/media/platform/verisilicon/hantro_drv.c: In function 'hantro_add_func': drivers/media/platform/verisilicon/hantro_drv.c:902:49: warning: '%s' directive output may be truncated writing up to 127 bytes into a region of size 64 [-Wformat-truncation=] 902 | snprintf(vfd->name, sizeof(vfd->name), "%s-%s", match->compatible, | ^~ drivers/media/platform/verisilicon/hantro_drv.c:902:9: note: 'snprintf' output between 5 and 132 bytes into a destination of size 64 902 | snprintf(vfd->name, sizeof(vfd->name), "%s-%s", match->compatible, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 903 | funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER ? "enc" : "dec"); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/verisilicon/hantro_drv.c:902:49: warning: '%s' directive output may be truncated writing up to 127 bytes into a region of size 64 [-Wformat-truncation=] 902 | snprintf(vfd->name, sizeof(vfd->name), "%s-%s", match->compatible, | ^~ drivers/media/platform/verisilicon/hantro_drv.c:902:9: note: 'snprintf' output between 5 and 132 bytes into a destination of size 64 902 | snprintf(vfd->name, sizeof(vfd->name), "%s-%s", match->compatible, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 903 | funcid == MEDIA_ENT_F_PROC_VIDEO_ENCODER ? "enc" : "dec"); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil commit b74093bfbcada7c45ea7425118cd8ee57314162d Author: Hans Verkuil Date: Sat Sep 23 17:21:05 2023 +0200 media: radio-miropcm20: set bus_info to explicit name Fill in bus_info with fixed name. This fixes this compiler warning: drivers/media/radio/radio-miropcm20.c: In function 'vidioc_querycap': drivers/media/radio/radio-miropcm20.c:206:57: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 28 [-Wformat-truncation=] 206 | snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", dev->v4l2_dev.name); | ^~ drivers/media/radio/radio-miropcm20.c:206:9: note: 'snprintf' output between 5 and 40 bytes into a destination of size 32 206 | snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", dev->v4l2_dev.name); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil commit 8b7f3cf4eb9a95940eaabad3226caeaa0d9aa59d Author: Hans Verkuil Date: Sat Sep 23 17:21:04 2023 +0200 media: radio-isa: use dev_name to fill in bus_info This fixes this warning: drivers/media/radio/radio-isa.c: In function 'radio_isa_querycap': drivers/media/radio/radio-isa.c:39:57: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 28 [-Wformat-truncation=] 39 | snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", isa->v4l2_dev.name); | ^~ drivers/media/radio/radio-isa.c:39:9: note: 'snprintf' output between 5 and 40 bytes into a destination of size 32 39 | snprintf(v->bus_info, sizeof(v->bus_info), "ISA:%s", isa->v4l2_dev.name); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil commit 127299a41cf96caa9ef02c6f0bb9af1d93cfc55a Author: Hans Verkuil Date: Sat Sep 23 17:21:03 2023 +0200 media: atmel: drop bus_info Let the V4L2 core fill this in. Fixes this warning: drivers/staging/media/deprecated/atmel/atmel-isc-base.c: In function 'isc_querycap': drivers/staging/media/deprecated/atmel/atmel-isc-base.c:496:28: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 23 [-Wformat-truncation=] 496 | "platform:%s", isc->v4l2_dev.name); | ^~ drivers/staging/media/deprecated/atmel/atmel-isc-base.c:495:9: note: 'snprintf' output between 10 and 45 bytes into a destination of size 32 495 | snprintf(cap->bus_info, sizeof(cap->bus_info), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 496 | "platform:%s", isc->v4l2_dev.name); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil Acked-by: Nicolas Ferre commit bd6ef410676e9a2729ebea2b5cd43689f521dfd3 Author: Hans Verkuil Date: Sat Sep 23 17:21:02 2023 +0200 media: am437x: don't fill in bus_info Let the V4L2 core fill this in. This fixes this warning: drivers/media/platform/ti/am437x/am437x-vpfe.c: In function 'vpfe_querycap': drivers/media/platform/ti/am437x/am437x-vpfe.c:1279:35: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 23 [-Wformat-truncation=] 1279 | "platform:%s", vpfe->v4l2_dev.name); | ^~ drivers/media/platform/ti/am437x/am437x-vpfe.c:1278:9: note: 'snprintf' output between 10 and 45 bytes into a destination of size 32 1278 | snprintf(cap->bus_info, sizeof(cap->bus_info), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1279 | "platform:%s", vpfe->v4l2_dev.name); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil Reviewed-by: Lad Prabhakar commit 37272d21cec670e27f0a2e3117bb5116b2d6ca2d Author: Hans Verkuil Date: Sat Sep 23 17:21:01 2023 +0200 media: rcar_drif: use explicit name for bus_info Fixes this compiler warning: drivers/media/platform/renesas/rcar_drif.c: In function 'rcar_drif_querycap': drivers/media/platform/renesas/rcar_drif.c:874:66: warning: '%s' directive output may be truncated writing up to 63 bytes into a region of size 23 [-Wformat-truncation=] 874 | snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", | ^~ drivers/media/platform/renesas/rcar_drif.c:874:9: note: 'snprintf' output between 10 and 73 bytes into a destination of size 32 874 | snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 875 | sdr->vdev->name); | ~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil commit 4ebdec2aeed3362c5920468f7dbf11883f72ac33 Author: Hans Verkuil Date: Sat Sep 23 17:21:00 2023 +0200 media: microchip: don't set bus_info Let the V4L2 core fill this in. Fixes these compiler warnings: drivers/media/platform/microchip/microchip-isc-base.c: In function 'isc_querycap': drivers/media/platform/microchip/microchip-isc-base.c:486:28: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 23 [-Wformat-truncation=] 486 | "platform:%s", isc->v4l2_dev.name); | ^~ drivers/media/platform/microchip/microchip-isc-base.c:485:9: note: 'snprintf' output between 10 and 45 bytes into a destination of size 32 485 | snprintf(cap->bus_info, sizeof(cap->bus_info), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 486 | "platform:%s", isc->v4l2_dev.name); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/microchip/microchip-isc-base.c: In function 'isc_mc_init': drivers/media/platform/microchip/microchip-isc-base.c:1996:76: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 23 [-Wformat-truncation=] 1996 | snprintf(isc->mdev.bus_info, sizeof(isc->mdev.bus_info), "platform:%s", | ^~ drivers/media/platform/microchip/microchip-isc-base.c:1996:9: note: 'snprintf' output between 10 and 45 bytes into a destination of size 32 1996 | snprintf(isc->mdev.bus_info, sizeof(isc->mdev.bus_info), "platform:%s", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1997 | isc->v4l2_dev.name); | ~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil Acked-by: Nicolas Ferre commit 10939357c4cc178d4a8628a728cb33f70b3d4edd Author: Hans Verkuil Date: Sat Sep 23 17:20:59 2023 +0200 media: vivid: use VIVID_MODULE_NAME to fill bus_info Fixes this compiler warning: drivers/media/test-drivers/vivid/vivid-core.c: In function 'vidioc_querycap': drivers/media/test-drivers/vivid/vivid-core.c:243:35: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 23 [-Wformat-truncation=] 243 | "platform:%s", dev->v4l2_dev.name); | ^~ drivers/media/test-drivers/vivid/vivid-core.c:242:9: note: 'snprintf' output between 10 and 45 bytes into a destination of size 32 242 | snprintf(cap->bus_info, sizeof(cap->bus_info), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 243 | "platform:%s", dev->v4l2_dev.name); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil commit 06016a67c61675642c71358c2afe6ce99b5d1468 Author: Hans Verkuil Date: Sat Sep 23 17:20:58 2023 +0200 media: v4l2-device.h: drop V4L2_DEVICE_NAME_SIZE Don't use defines for the size of a name field, everyone should just use sizeof(). In this case it was never used, but it is bad practice, so just drop it. Signed-off-by: Hans Verkuil commit 8cdd708f11655d5f28fca1ab2fa0dbe5424f274c Author: Hans Verkuil Date: Sat Sep 23 17:20:57 2023 +0200 media: use sizeof() instead of V4L2_SUBDEV_NAME_SIZE Don't rely on a define, let the compiler use the actual field size. Remove all uses of the V4L2_SUBDEV_NAME_SIZE define and also drop the define itself. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Maxime Ripard Reviewed-by: Luca Ceresoli Tested-by: Luca Ceresoli commit d9d432af1415b358d76b110c9e37e4f07d2e1c7b Author: Hans Verkuil Date: Sat Sep 23 17:20:56 2023 +0200 media: v4l2-subdev.h: increase struct v4l2_subdev name size This resolves a lot of the string truncate compiler warnings. Signed-off-by: Hans Verkuil commit 9cc0f40cac6ae5bc8529caa5e9d477678336450c Author: Hans Verkuil Date: Sat Sep 23 17:20:55 2023 +0200 media: v4l2-dev.h: increase struct video_device name size Increase the size of the name field to prevent a lot of string truncate compiler warnings. Signed-off-by: Hans Verkuil commit 3e80a88911a350438b60581daf11a115e020631d Author: Hans Verkuil Date: Sat Sep 23 17:20:54 2023 +0200 media: zoran: increase name size Fixes this compiler warning: drivers/media/pci/zoran/zoran_card.c: In function 'zoran_probe': drivers/media/pci/zoran/zoran_card.c:1316:62: warning: '%u' directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 31 [-Wformat-truncation=] 1316 | snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "%s[%u]", | ^~ drivers/media/pci/zoran/zoran_card.c:1316:58: note: directive argument in the range [0, 65535] 1316 | snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "%s[%u]", | ^~~~~~~~ drivers/media/pci/zoran/zoran_card.c:1316:9: note: 'snprintf' output between 4 and 39 bytes into a destination of size 32 1316 | snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "%s[%u]", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1317 | zr->card.name, zr->id); | ~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil commit acec3a11c32ca656aba682f4117e754501fa0746 Author: Hans Verkuil Date: Sat Sep 23 17:20:53 2023 +0200 media: renesas-ceu: keep input name simple Just show the Camera index as input name in VIDIOC_ENUM_INPUT, no need to show the subdev name as well as that is meaningless for users anyway. This fixes this compiler warning: drivers/media/platform/renesas/renesas-ceu.c: In function 'ceu_enum_input': drivers/media/platform/renesas/renesas-ceu.c:1195:59: warning: '%s' directive output may be truncated writing up to 47 bytes into a region of size between 14 and 23 [-Wformat-truncation=] 1195 | snprintf(inp->name, sizeof(inp->name), "Camera%u: %s", | ^~ drivers/media/platform/renesas/renesas-ceu.c:1195:9: note: 'snprintf' output between 10 and 66 bytes into a destination of size 32 1195 | snprintf(inp->name, sizeof(inp->name), "Camera%u: %s", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1196 | inp->index, ceusd->v4l2_sd->name); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil Reviewed-by: Jacopo Mondi commit 7ba5e7b78b068e212c85926723990482ee7b1962 Author: Hans Verkuil Date: Sat Sep 23 17:20:52 2023 +0200 media: cec.h: increase input_phys buffer Fixes this compiler warning: drivers/media/cec/core/cec-core.c: In function 'cec_allocate_adapter': drivers/media/cec/core/cec-core.c:317:21: warning: '/input0' directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Wformat-truncation=] 317 | "%s/input0", adap->name); | ^~~~~~~ drivers/media/cec/core/cec-core.c:316:9: note: 'snprintf' output between 8 and 39 bytes into a destination of size 32 316 | snprintf(adap->input_phys, sizeof(adap->input_phys), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 317 | "%s/input0", adap->name); | ~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil commit b05aba9fffd21bdf8168c7db8c2cd40e9d347f13 Author: Hans Verkuil Date: Sat Sep 23 17:20:51 2023 +0200 media: rc: ati_remote: increase mouse_name buffer size Fixes this compiler warning: drivers/media/rc/ati_remote.c: In function 'ati_remote_probe': drivers/media/rc/ati_remote.c:876:21: warning: ' mouse' directive output may be truncated writing 6 bytes into a region of size between 1 and 80 [-Wformat-truncation=] 876 | "%s mouse", ati_remote->rc_name); | ^~~~~~ drivers/media/rc/ati_remote.c:875:9: note: 'snprintf' output between 7 and 86 bytes into a destination of size 80 875 | snprintf(ati_remote->mouse_name, sizeof(ati_remote->mouse_name), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 876 | "%s mouse", ati_remote->rc_name); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil Reviewed-by: Sean Young Acked-by: Arnd Bergmann commit 7c051b680048e4d79c5c0457ca370c0c09f69709 Author: Hans Verkuil Date: Sat Sep 23 17:20:50 2023 +0200 media: cx18: increase in_workq_name size Fixes this compiler warning: drivers/media/pci/cx18/cx18-driver.c: In function 'cx18_init_struct1': drivers/media/pci/cx18/cx18-driver.c:688:65: warning: '%s' directive output may be truncated writing up to 35 bytes into a region of size 11 [-Wformat-truncation=] 688 | snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in", | ^~ In function 'cx18_create_in_workq', inlined from 'cx18_init_struct1' at drivers/media/pci/cx18/cx18-driver.c:724:8: drivers/media/pci/cx18/cx18-driver.c:688:9: note: 'snprintf' output between 4 and 39 bytes into a destination of size 11 688 | snprintf(cx->in_workq_name, sizeof(cx->in_workq_name), "%s-in", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 689 | cx->v4l2_dev.name); | ~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil Acked-by: Arnd Bergmann commit 83d0d4cc1423194b580356966107379490edd02e Author: Hans Verkuil Date: Sat Sep 23 17:20:49 2023 +0200 media: ipu-bridge: increase sensor_name size Fixes this compiler warning: In file included from include/linux/property.h:14, from include/linux/acpi.h:16, from drivers/media/pci/intel/ipu-bridge.c:4: In function 'ipu_bridge_init_swnode_names', inlined from 'ipu_bridge_create_connection_swnodes' at drivers/media/pci/intel/ipu-bridge.c:445:2, inlined from 'ipu_bridge_connect_sensor' at drivers/media/pci/intel/ipu-bridge.c:656:3: include/linux/fwnode.h:81:49: warning: '%u' directive output may be truncated writing between 1 and 3 bytes into a region of size 2 [-Wformat-truncation=] 81 | #define SWNODE_GRAPH_PORT_NAME_FMT "port@%u" | ^~~~~~~~~ drivers/media/pci/intel/ipu-bridge.c:384:18: note: in expansion of macro 'SWNODE_GRAPH_PORT_NAME_FMT' 384 | SWNODE_GRAPH_PORT_NAME_FMT, sensor->link); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/fwnode.h: In function 'ipu_bridge_connect_sensor': include/linux/fwnode.h:81:55: note: format string is defined here 81 | #define SWNODE_GRAPH_PORT_NAME_FMT "port@%u" | ^~ In function 'ipu_bridge_init_swnode_names', inlined from 'ipu_bridge_create_connection_swnodes' at drivers/media/pci/intel/ipu-bridge.c:445:2, inlined from 'ipu_bridge_connect_sensor' at drivers/media/pci/intel/ipu-bridge.c:656:3: include/linux/fwnode.h:81:49: note: directive argument in the range [0, 255] 81 | #define SWNODE_GRAPH_PORT_NAME_FMT "port@%u" | ^~~~~~~~~ drivers/media/pci/intel/ipu-bridge.c:384:18: note: in expansion of macro 'SWNODE_GRAPH_PORT_NAME_FMT' 384 | SWNODE_GRAPH_PORT_NAME_FMT, sensor->link); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/pci/intel/ipu-bridge.c:382:9: note: 'snprintf' output between 7 and 9 bytes into a destination of size 7 382 | snprintf(sensor->node_names.remote_port, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 383 | sizeof(sensor->node_names.remote_port), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 384 | SWNODE_GRAPH_PORT_NAME_FMT, sensor->link); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil Acked-by: Arnd Bergmann commit 4567ebf8e8f9546b373e78e3b7d584cc30b62028 Author: Hans Verkuil Date: Sat Sep 23 17:20:48 2023 +0200 media: vivid: avoid integer overflow Fixes these compiler warnings: drivers/media/test-drivers/vivid/vivid-rds-gen.c: In function 'vivid_rds_gen_fill': drivers/media/test-drivers/vivid/vivid-rds-gen.c:147:56: warning: '.' directive output may be truncated writing 1 byte into a region of size between 0 and 3 [-Wformat-truncation=] 147 | snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d", | ^ drivers/media/test-drivers/vivid/vivid-rds-gen.c:147:52: note: directive argument in the range [0, 9] 147 | snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d", | ^~~~~~~~~ drivers/media/test-drivers/vivid/vivid-rds-gen.c:147:9: note: 'snprintf' output between 9 and 12 bytes into a destination of size 9 147 | snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 148 | freq / 16, ((freq & 0xf) * 10) / 16); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil Acked-by: Arnd Bergmann commit f55254c96a85f43261f9952c74a7461752964dfc Author: Hans Verkuil Date: Sat Sep 23 17:20:47 2023 +0200 media: atomisp: ia_ccs_debug.c: increase enable_info buffer Fixes these compiler warnings: drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c: In function 'ia_css_debug_pipe_graph_dump_stage': drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2786:66: warning: '\n' directive output may be truncated writing 2 bytes into a region of size between 0 and 198 [-Wformat-truncation=] 2786 | "%s\\n%s\\n%s", | ^~~ drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2785:49: note: 'snprintf' output between 5 and 302 bytes into a destination of size 200 2785 | snprintf(enable_info, sizeof(enable_info), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2786 | "%s\\n%s\\n%s", | ~~~~~~~~~~~~~~~ 2787 | enable_info1, enable_info2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2788 | enable_info3); | ~~~~~~~~~~~~~ drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2772:66: warning: '\n' directive output may be truncated writing 2 bytes into a region of size between 0 and 198 [-Wformat-truncation=] 2772 | "%s\\n%s\\n%s", | ^~~ drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2771:49: note: 'snprintf' output between 5 and 302 bytes into a destination of size 200 2771 | snprintf(enable_info, sizeof(enable_info), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2772 | "%s\\n%s\\n%s", | ~~~~~~~~~~~~~~~ 2773 | enable_info1, enable_info2, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2774 | enable_info3); | ~~~~~~~~~~~~~ drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2749:92: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=] 2749 | snprintf(enable_info, sizeof(enable_info), "%s\\n%s", | ^ drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c:2749:41: note: 'snprintf' output between 3 and 201 bytes into a destination of size 200 2749 | snprintf(enable_info, sizeof(enable_info), "%s\\n%s", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2750 | enable_info1, enable_info2); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil Reviewed-by: Hans de Goede Acked-by: Arnd Bergmann commit 94451182166ae92a28eb79a3e02c75542f1807d8 Author: Hans Verkuil Date: Sat Sep 23 17:20:46 2023 +0200 media: cadence: increase buffer size in csi2tx_get_resources() Fixes this compiler warning: drivers/media/platform/cadence/cdns-csi2tx.c: In function 'csi2tx_get_resources': drivers/media/platform/cadence/cdns-csi2tx.c:485:63: warning: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size 8 [-Wformat-truncation=] 485 | snprintf(clk_name, sizeof(clk_name), "pixel_if%u_clk", i); | ^~ drivers/media/platform/cadence/cdns-csi2tx.c:485:54: note: directive argument in the range [0, 4294967294] 485 | snprintf(clk_name, sizeof(clk_name), "pixel_if%u_clk", i); | ^~~~~~~~~~~~~~~~ drivers/media/platform/cadence/cdns-csi2tx.c:485:17: note: 'snprintf' output between 14 and 23 bytes into a destination of size 16 485 | snprintf(clk_name, sizeof(clk_name), "pixel_if%u_clk", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil Acked-by: Maxime Ripard Acked-by: Arnd Bergmann commit 41c4c6fd8116f67cfd3e862d00ee11bcceece244 Author: Hans Verkuil Date: Sat Sep 23 17:20:45 2023 +0200 media: allegro-dvt: increase buffer size in msg_type_name() Fixes this compile error drivers/media/platform/allegro-dvt/allegro-mail.c: In function 'msg_type_name': drivers/media/platform/allegro-dvt/allegro-mail.c:37:48: warning: '%04x' directive output may be truncated writing between 4 and 8 bytes into a region of size 6 [-Wformat-truncation=] 37 | snprintf(buf, sizeof(buf), "(0x%04x)", type); | ^~~~ drivers/media/platform/allegro-dvt/allegro-mail.c:37:44: note: directive argument in the range [1, 4294967295] 37 | snprintf(buf, sizeof(buf), "(0x%04x)", type); | ^~~~~~~~~~ drivers/media/platform/allegro-dvt/allegro-mail.c:37:17: note: 'snprintf' output between 9 and 13 bytes into a destination of size 9 37 | snprintf(buf, sizeof(buf), "(0x%04x)", type); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil Reviewed-by: Michael Tretter Acked-by: Arnd Bergmann commit 0301a15a42f2e414d6f628fb51821a186cbfbbbf Author: Hans Verkuil Date: Tue Sep 26 11:27:09 2023 +0200 media: atomisp: fix 'read beyond size of field' If CONFIG_FORTIFY_SOURCE=y, then this warning is produced: In file included from ./include/linux/string.h:254, from ./include/linux/bitmap.h:11, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/cpumask.h:5, from ./arch/x86/include/asm/msr.h:11, from ./arch/x86/include/asm/processor.h:23, 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:9, from ./include/linux/preempt.h:79, from ./include/linux/spinlock.h:56, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:7, from ./include/linux/slab.h:16, from ./drivers/staging/media/atomisp//include/hmm/hmm.h:26, from drivers/staging/media/atomisp/pci/sh_css_params.c:26: In function ‘fortify_memcpy_chk’, inlined from ‘sh_css_store_sp_group_to_ddr’ at drivers/staging/media/atomisp/pci/sh_css_params.c:3736:3: ./include/linux/fortify-string.h:592:25: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] 592 | __read_overflow2_field(q_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The reason is that the memcpy copies two fields (each a u8), when the source pointer points to the first field. It's a bit unexpected, so just make this explicit. Signed-off-by: Hans Verkuil Reviewed-by: Hans de Goede commit 1d4b7855b1cf7a00a46bb8158572727c63f50a22 Author: Matti Lehtimäki Date: Sat Sep 23 16:14:32 2023 +0300 pinctrl: qcom: msm8974: Add MPM pin mappings Add pin <-> wakeirq mappings to allow for waking up the AP from sleep through MPM-connected pins. Signed-off-by: Matti Lehtimäki Reviewed-by: Luca Weiss Link: https://lore.kernel.org/r/20230923131432.21721-3-matti.lehtimaki@gmail.com Signed-off-by: Linus Walleij commit 259fe3cbf2a537e6534bdcff314555f0eb77a886 Author: Matti Lehtimäki Date: Sat Sep 23 16:14:31 2023 +0300 pinctrl: qcom: msm8226: Add MPM pin mappings Add pin <-> wakeirq mappings to allow for waking up the AP from sleep through MPM-connected pins. Signed-off-by: Matti Lehtimäki Reviewed-by: Luca Weiss Link: https://lore.kernel.org/r/20230923131432.21721-2-matti.lehtimaki@gmail.com Signed-off-by: Linus Walleij commit 8f407eda173f1d43466636314c7aa30405e4dd67 Author: Nicolas Ferre Date: Tue Sep 26 15:16:55 2023 +0200 mtd: spi-nor: atmel: add at25ff321a entry Add the at25ff321a 4MB SPI flash which is able to provide SFDP information. Link: https://www.renesas.com/us/en/document/dst/at25ff321a-datasheet Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20230926131655.51224-1-nicolas.ferre@microchip.com Signed-off-by: Tudor Ambarus commit ba369b3b49eabef03e4452aea7abb10edee65340 Author: Luca Weiss Date: Fri Sep 22 18:55:14 2023 +0200 ARM: dts: qcom: msm8226: Add blsp1_i2c6 and blsp1_uart2 Add more busses found on msm8226 SoC. Signed-off-by: Luca Weiss Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230922-msm8226-i2c6-v2-3-3fb55c47a084@z3ntu.xyz Signed-off-by: Linus Walleij commit 52d637cd9265b56022eac31373d52634a33b22f0 Author: Luca Weiss Date: Fri Sep 22 18:55:13 2023 +0200 pinctrl: qcom: msm8226: Add blsp_i2c6 function On GPIO22 and GPIO23 there is another I2C bus. Add the function for it. Signed-off-by: Luca Weiss Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230922-msm8226-i2c6-v2-2-3fb55c47a084@z3ntu.xyz Signed-off-by: Linus Walleij commit 505ab2cf43f62df9b9a0eba0273f931e60ae293f Author: Luca Weiss Date: Fri Sep 22 18:55:12 2023 +0200 dt-bindings: pinctrl: qcom,msm8226: Add blsp_i2c6 function Add the blsp_i2c6 function that can be found on some pins. Signed-off-by: Luca Weiss Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230922-msm8226-i2c6-v2-1-3fb55c47a084@z3ntu.xyz Signed-off-by: Linus Walleij commit 96a35cf6a4e4b15894eb0439205df68af1c0e28b Author: Karina Yankevich Date: Fri Sep 22 16:59:26 2023 +0300 pinctrl: mediatek: moore: handle mtk_hw_set_value() errors in mtk_pinmux_set_mux() mtk_pinmux_set_mux() doesn't check the result of mtk_hw_set_value() despite it may return a negative error code. Propagate error code to caller functions. Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool. Signed-off-by: Karina Yankevich Link: https://lore.kernel.org/r/20230922135926.3653428-2-k.yankevich@omp.ru Signed-off-by: Linus Walleij commit 3d855c3f2e1373f40962ea4ab7b97c6a563b52bc Author: Karina Yankevich Date: Fri Sep 22 16:59:25 2023 +0300 pinctrl: mediatek: paris: handle mtk_hw_set_value() errors in mtk_pmx_set_mux() mtk_pmx_set_mux() doesn't check the result of mtk_hw_set_value() despite it may return negative error code. Propagate error code to caller functions. Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool. Signed-off-by: Karina Yankevich Link: https://lore.kernel.org/r/20230922135926.3653428-1-k.yankevich@omp.ru Signed-off-by: Linus Walleij commit 1882366217757d3549e48a833bf9a5799b172251 Author: Xin Li (Intel) Date: Mon Sep 25 23:13:19 2023 -0700 x86/entry: Fix typos in comments Fix 2 typos in the comments. Signed-off-by: Xin Li (Intel) Signed-off-by: Ingo Molnar Acked-by: H. Peter Anvin (Intel) Link: https://lore.kernel.org/r/20230926061319.1929127-1-xin@zytor.com commit da4aff622a7ae424a0292d7288744692fca34319 Author: Xin Li (Intel) Date: Mon Sep 25 23:13:19 2023 -0700 x86/entry: Remove unused argument %rsi passed to exc_nmi() exc_nmi() only takes one argument of type struct pt_regs *, but asm_exc_nmi() calls it with 2 arguments. The second one passed in %rsi seems to be a leftover, so simply remove it. Signed-off-by: Xin Li (Intel) Signed-off-by: Ingo Molnar Acked-by: H. Peter Anvin (Intel) Link: https://lore.kernel.org/r/20230926061319.1929127-1-xin@zytor.com commit 24775700eaa93ff83b2a0f1e005879cdf186cdd9 Author: Muralidhara M K Date: Tue Sep 26 05:19:32 2023 +0000 x86/amd_nb: Add AMD Family MI300 PCI IDs Add new Root, Device 18h Function 3, and Function 4 PCI IDS for AMD F19h Model 90h-9fh (MI300A). Signed-off-by: Muralidhara M K Signed-off-by: Suma Hegde Signed-off-by: Ingo Molnar Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20230926051932.193239-1-suma.hegde@amd.com commit a0bcd433b9bf8e256f7c0c4d8b91551dbd439fef Author: Hans de Goede Date: Sun Aug 13 17:26:45 2023 +0200 media: atomisp: Drop atomisp-ov5693 sensor driver After recent improvements to atomisp driver, the atomisp driver now works fine with the standard ov5693 driver. Drop the no longer necessary atomisp specific atomisp-ov5693 sensor driver. Link: https://lore.kernel.org/r/20230813152645.45834-2-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 18fa57148abeed2fc128264f2efbf3b4fd35d50c Author: Hans de Goede Date: Sun Aug 13 17:26:44 2023 +0200 media: atomisp: Disable VCM for OV5693 for now ov5693 sensor modules have a VCM, but for unknown reasons the sensor fails to start streaming when instantiating a VCM i2c-client (and the runtime-pm link between VCM and sensor). Disable the VCM for now, until this is resolved. Link: https://lore.kernel.org/r/20230813152645.45834-1-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 2b5a90f08c09245de2f3422d3d1615ce6c0d8d27 Author: Hans de Goede Date: Sat Aug 12 15:36:28 2023 +0200 media: atomisp: gc0310: Stop setting v4l2_subdev.fwnode to the endpoint fwnode Endpoint matching is now handled by the v4l2-core and drivers no longer should set v4l2_subdev.fwnode to the endpoint fwnode. Link: https://lore.kernel.org/r/20230812133628.355812-1-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 61d6b3503cda0c77da270b2c1080b1be5f1e249c Author: Hans de Goede Date: Sat Aug 12 15:35:23 2023 +0200 media: atomisp: Drop VIDEO_ATOMISP_ISP2401 Kconfig option Drop the VIDEO_ATOMISP_ISP2401 Kconfig option and the -DISP2401 cflags. This is no longer necessary since all ISP2400 vs ISP2401 differences are now dealt with at runtime. Many thanks to Kate Hsuan for all her work on this. Link: https://lore.kernel.org/r/20230812133523.355581-2-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 00c408775ade09cfa16b300db43b0b7be48197e6 Author: Hans de Goede Date: Sat Aug 12 15:35:22 2023 +0200 media: atomisp: Drop ia_css_debug_dump_debug_info() and functions only used by it ia_css_debug_dump_debug_info() is defined but never called anywhere, drop it. Also drop all the other ia_css_debug_dump_* functions only called by ia_css_debug_dump_debug_info(), as well as *_get_state() functions only used by those. Link: https://lore.kernel.org/r/20230812133523.355581-1-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 42c26b4cd1f725653476c5423d260609b6446fea Author: Hans de Goede Date: Sat Aug 12 12:46:12 2023 +0200 media: atomisp: Simplify some if (IS_ISP2401...) statements Replace: if (!IS_ISP2401 || (IS_ISP2401 && xxx)) with: if (!IS_ISP2401 || xxx) If the right side of the '||' needs to be evaluated then it is already known that IS_ISP2401 is true, so no need to check for it. Link: https://lore.kernel.org/r/20230812104612.38806-1-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 65214188ca1dbaa390edbae20ae31d210da7c46b Author: Kate Hsuan Date: Wed Aug 2 11:56:06 2023 +0200 media: atomisp: atomisp_v4l2: Removed unnecessary code Here is the last step of #ifdef ISP2401 removal work. Since the driver became generic, this part of the code was no longer needed and can be removed. Link: https://lore.kernel.org/r/20230802095606.1298152-13-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit ec1f9f15a9c28bd22769e9f37ba14bacf2178048 Author: Kate Hsuan Date: Wed Aug 2 11:56:05 2023 +0200 media: atomisp: sh_css: Removed #ifdef ISP2401 to make the driver generic Removed #ifdef ISP2401 to make the driver generic. Link: https://lore.kernel.org/r/20230802095606.1298152-12-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 113401c6738643fbdc8f3010cdac4166106b4683 Author: Kate Hsuan Date: Wed Aug 2 11:56:04 2023 +0200 media: atomisp: sh_css: Removed #ifdef ISP2401 to make code generic Removed #ifdef ISP2401 to allow the destroy function can destroy the data of both types of ISP. Link: https://lore.kernel.org/r/20230802095606.1298152-11-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit ad6979477073bfef6fb95f33dfd0a9bce49e6007 Author: Kate Hsuan Date: Wed Aug 2 11:56:03 2023 +0200 media: atomisp: sh_css: Renamed sh_css_config_input_network() sh_css_config_input_network() is renamed to sh_css_config_input_network_2400() and sh_css_config_input_network_2401() since a generic driver should cover the implementation for both types. Link: https://lore.kernel.org/r/20230802095606.1298152-10-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit ade6b4c2b8a33866af5760beeea3b5ca2c9097de Author: Kate Hsuan Date: Wed Aug 2 11:56:02 2023 +0200 media: atomisp: sh_css: Removed #ifdef ISP2401 to make driver generic Removed #ifdef ISP2401 to expose ia_css_stream_configure_rx() for ISP2400. Link: https://lore.kernel.org/r/20230802095606.1298152-9-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit d1f3bed602239c62a2374c518a9e19c7dc75f66e Author: Kate Hsuan Date: Wed Aug 2 11:56:01 2023 +0200 media: atomisp: sh_css_sp: Remove #ifdef ISP2401 to make driver generic Removed #ifdef ISP2401 to make the driver generic. The uncessary codes were removed and the types of the ISP is determines in runtime. Link: https://lore.kernel.org/r/20230802095606.1298152-8-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 1e1ea859e4e6c2346be1513c006447a62717133a Author: Kate Hsuan Date: Wed Aug 2 11:56:00 2023 +0200 media: atomisp: sh_css: Removed #ifdef ISP2401 to make the driver generic Removed #ifdef ISP2401 to expose the necessary functions for ISP2401 and also make the driver generic. Link: https://lore.kernel.org/r/20230802095606.1298152-7-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit fc280df3aa3738865bff77dfb0fafc249ac87954 Author: Kate Hsuan Date: Wed Aug 2 11:55:59 2023 +0200 media: atomisp: sh_css_mipi: Removed unused code ia_css_mipi_frame_enable_check_on_size() ia_css_mipi_frame_enable_check_on_size() wasn't used by any functions. So, it can be removed. Link: https://lore.kernel.org/r/20230802095606.1298152-6-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit fdd9681f7e9ede01f53241326a7ab259de4762cc Author: Kate Hsuan Date: Wed Aug 2 11:55:58 2023 +0200 media: atomisp: atomisp_compat_css20: Removed #ifdef ISP2401 to make driver generic Removed #ifdef ISP2401 to make code to be generic. The driver flow is determined in runtime. Link: https://lore.kernel.org/r/20230802095606.1298152-5-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 7d5901b49c22b55c48a91c545f8c94f0bbbcbf9a Author: Kate Hsuan Date: Wed Aug 2 11:55:57 2023 +0200 media: atomisp: hive_isp_css_include: Removed #ifdef ISP2401 to make driver generic Removed #ifdef ISP2401 to make the driver generic. Link: https://lore.kernel.org/r/20230802095606.1298152-4-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 2b5d1e149edf31d54bd93417bf81c960a96019b3 Author: Kate Hsuan Date: Wed Aug 2 11:55:56 2023 +0200 media: atomisp: binary: Removed #ifdef ISP2401 to make driver generic Removed #ifdef ISP2401 to make the driver generic. The driver flow is determined in runtime. Link: https://lore.kernel.org/r/20230802095606.1298152-3-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 68b9a816cabefc9c9f04c7b99ad2d92cb306136b Author: Kate Hsuan Date: Wed Aug 2 11:55:55 2023 +0200 media: atomisp: ia_css_raw.host: Remove #ifdef ISP2401 to make the driver generic Remove #ifdef from the code and made the code generic. The raw image configuration was determined during runtime. Link: https://lore.kernel.org/r/20230802095606.1298152-2-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit b6e5978323d5aca0b64f02efbca5f735c114eeb0 Author: Hans de Goede Date: Sat Jul 15 19:09:06 2023 +0200 media: atomisp: Mark ia_css_isys_240?_init() static ia_css_isys_240?_init() are only used inside the C file where they are declared, mark them as static fixing: drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c:24:20: warning: no previous prototype for 'ia_css_isys_2400_init' 24 | input_system_err_t ia_css_isys_2400_init(void) | ^~~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c:87:20: warning: no previous prototype for 'ia_css_isys_2401_init' 87 | input_system_err_t ia_css_isys_2401_init(void) | ^~~~~~~~~~~~~~~~~~~~~ Closes: https://lore.kernel.org/oe-kbuild-all/202307152046.rvhFGrbz-lkp@intel.com/ Link: https://lore.kernel.org/r/20230715170906.3627-3-hdegoede@redhat.com Reported-by: kernel test robot Signed-off-by: Hans de Goede Reviewed-by: Kate Hsuan Signed-off-by: Mauro Carvalho Chehab commit 983993cb8231993c1ecd10dab0dbe0ff2852d8fa Author: Hans de Goede Date: Sat Jul 15 19:09:05 2023 +0200 media: atomisp: Remove aliases for MIPI_FORMAT_2400_CUSTOM0 isp2400_input_system_local.h defines 2 aliases for MIPI_FORMAT_2400_CUSTOM0 MIPI_FORMAT_JPEG, which is entirely unused and MIPI_FORMAT_BINARY_8 which is used once in ia_css_isys_2400_set_fmt_type(). Drop these aliases and directly use MIPI_FORMAT_2400_CUSTOM0 in ia_css_isys_2400_set_fmt_type(). Link: https://lore.kernel.org/r/20230715170906.3627-2-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Kate Hsuan Signed-off-by: Mauro Carvalho Chehab commit b70fbcd6507ccb31b469214e11e8a37a8ea426b4 Author: Hans de Goede Date: Sat Jul 15 19:09:04 2023 +0200 media: atomisp: Remove empty isys_public.h isys_public.h is empty, remove it. Link: https://lore.kernel.org/r/20230715170906.3627-1-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Kate Hsuan Signed-off-by: Mauro Carvalho Chehab commit 16fb1d5b2bbea609bbdfa832fd99771a744aff78 Author: Kate Hsuan Date: Thu Jul 13 12:02:31 2023 +0200 media: atomisp: isys_init: Initiate atomisp in a generic manner The original implementation distinguishes and initiates atomisp during compiler time. This commit allows isys_init to initiate isys for both types of atomisp in a generic manner. Link: https://lore.kernel.org/r/20230713100231.308923-12-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 0df4319c55cb5722a9bea9e4ca0ca849c1d9c524 Author: Kate Hsuan Date: Thu Jul 13 12:02:30 2023 +0200 media: atomisp: rx: Removed #if defined(ISP2401) to make driver generic The conflicts of variable declarations were resolved through previous commits so the #if defined(ISP2401) can be removed. Link: https://lore.kernel.org/r/20230713100231.308923-11-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit feae4208b422f2ccb6496bdba6674dcdfd15a68f Author: Kate Hsuan Date: Thu Jul 13 12:02:29 2023 +0200 media: atomisp: Compile the object codes for a generic driver Since a generic driver should support every type of atomisp, all the codes need to be compiled. The ISP2401 flag controls the Makefile to build the binary file for ISP2400 and ISP2401. Therefore, this section of Makefile should be removed allowing all the necessary codes can be built. Moreover, some parts of "removing #ifdef ISP2401" works are related to it so they were also removed here. Link: https://lore.kernel.org/r/20230713100231.308923-10-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit f6675353feee991cf429fb22c4a8f639ec2b0ca5 Author: Kate Hsuan Date: Thu Jul 13 12:02:28 2023 +0200 media: atomisp: ifmtr: Removed #if defined(ISP2401) to make driver generic Removed #if defined(ISP2401) to make driver generic. Link: https://lore.kernel.org/r/20230713100231.308923-9-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 404af81df6b55cd51366c823510658236b86292b Author: Kate Hsuan Date: Thu Jul 13 12:02:27 2023 +0200 media: atomisp: pipeline: Removed #if defined(ISP2401) to make driver generic Removed #if defined(ISP2401) to make driver generic. Link: https://lore.kernel.org/r/20230713100231.308923-8-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 58e6d7d80bf1e9fc3e0b809aa343c4f445bfa493 Author: Kate Hsuan Date: Thu Jul 13 12:02:26 2023 +0200 media: atomisp: hive_isp_css_common: Removed #if defined(ISP2401) to make driver generic Removed #if defined(ISP2401) to make code generic. Link: https://lore.kernel.org/r/20230713100231.308923-7-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit db401104fa02dbd698c051246be2e2855cb0cef8 Author: Kate Hsuan Date: Thu Jul 13 12:02:25 2023 +0200 media: atomisp: isys: Removed #if defined(ISP2401) to make driver generic Removed #if defined(ISP2401) to make code generic. Link: https://lore.kernel.org/r/20230713100231.308923-6-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 7ed0c6c069b6713f9d483605772488082a2b6b7c Author: Kate Hsuan Date: Thu Jul 13 12:02:24 2023 +0200 media: atomisp: css_2401_system: Remove #ifdef ISP2401 to make the driver generic Removed #if defined(2401) to make the driver generic. Link: https://lore.kernel.org/r/20230713100231.308923-5-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 2aea82b03cd4e57f3d639d3bedb0876082416052 Author: Kate Hsuan Date: Thu Jul 13 12:02:23 2023 +0200 media: atomisp: Included both input system headers Included necessary input system header files (local, private, public scopes) for both types of atomisp. There is also a conflict of declaration issue so the unused input_system_state_s is removed. Link: https://lore.kernel.org/r/20230713100231.308923-4-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 8fc67b18fa1ccaf8c35919f27ccb119fdc2a35a8 Author: Kate Hsuan Date: Thu Jul 13 12:02:22 2023 +0200 media: atomisp: Make two individual enum to define the MIPI format The original mipi_format_t represents the MIPI format settings for both atomisp with the same name and the enum member was controlled by #if defined(ISP2401). However, if we want to make this driver generic, this enum should be individually defined for them. Since the format type is redefined, the format setting function ia_css_isys_set_fmt_type() should be reworked for ISP2400 and ISP2401 called ia_css_isys_2400_set_fmt_type() and ia_css_isys_2401_set_fmt_type() . Additionally, the function called is_mipi_format_yuv420() isn't used by any functions so it can be removed. Link: https://lore.kernel.org/r/20230713100231.308923-3-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit b0e59612eb2cbb5c62343fba60893451bbfb4bbf Author: Kate Hsuan Date: Thu Jul 13 12:02:21 2023 +0200 media: atomisp: ia_css_debug: Removed debug codes for dumping status This portion of debug code was based on a structure for both ISP2400 and 2401 with the same name and controlled by #if defined(ISP2401). This structure was only used to dump the status of atomisp. So, to make the driver generic, this part of debug codes can be removed. Link: https://lore.kernel.org/r/20230713100231.308923-2-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 10c6c42859cc381e9176594544b15e7260737e56 Author: Hans de Goede Date: Mon Jun 19 12:52:12 2023 +0200 media: atomisp: Remove v4l2_ctrl_s_ctrl(asd->run_mode) calls from atomisp_open() The v4l2_ctrl_s_ctrl(asd->run_mode) call in atomisp_subdev_init_struct() gets immediately overridden by a second call directly after atomisp_subdev_init_struct() is called. And the second call in atomisp_open() also is not helpful. ATOMISP_RUN_MODE_PREVIEW is the default and if changed controls are supposed to stay changed over an open/close of the /dev/video# node. So drop both calls. Link: https://lore.kernel.org/r/20230619105212.303653-7-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit b6da9e5a061751f92be7f18208a4aab9e52f24da Author: Hans de Goede Date: Mon Jun 19 12:52:11 2023 +0200 media: atomisp: Remove support for custom run-mode v4l2-ctrl on sensors Remove the support to update a V4L2_CID_RUN_MODE run-mode control on sensors when changing the atomisp run-mode or directly by calling the custom ATOMISP_IOC_S_SENSOR_RUNMODE IOCTL. No sensor drivers implement this and having custom controls / IOCTLs is undesirable. Even if there was such a control on sensors then userspace should directly talk to the sensor v4l2-subdev, rather than relying on a custom IOCTLs on the output /dev/video# node to pass this through to the senor. Link: https://lore.kernel.org/r/20230619105212.303653-6-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 2ffb2e640c8aae2bef59848c93fcb6bf03152424 Author: Hans de Goede Date: Mon Jun 19 12:52:10 2023 +0200 media: atomisp: Add some higher resolutions to atomisp_enum_framesizes() Add some higher resolutions to the fixed list of resolutions which atomisp_enum_framesizes() uses on sensors which can do cropping and can thus make any resolution that will fit. This is useful for higher resolution sensors like the 2560x1920 ov5693 sensor. Note the highest resolutions added here are 1920x because the atomisp firmware does not support widths > 1920 with the default asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW setting. Link: https://lore.kernel.org/r/20230619105212.303653-5-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit b24209cf1c5c47bee31d0f03dae6f2349b8b85ac Author: Hans de Goede Date: Mon Jun 19 12:52:09 2023 +0200 media: atomisp: Change atomisp_enum_framesizes() too small cut off from 2/3th to 5/8th Change atomisp_enum_framesizes() cut off for too small resolutions from 2/3th to 5/8th this results in more resolutions being available with some sensors. E.g. this allows using 800x600 with a 1280x960 sensor. Link: https://lore.kernel.org/r/20230619105212.303653-4-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit d86c33af672d126bbba0b61947078c317994dcc5 Author: Hans de Goede Date: Mon Jun 19 12:52:08 2023 +0200 media: atomisp: Clamp width to max 1920 pixels when in ATOMISP_RUN_MODE_PREVIEW The pipeline firmware-binaries used in previed mode have ia_css_binary_xinfo.output.max_width set to 1920. This causes ia_css_binary_find() to fail when trying to set a higher resolution resulting in the dump_stack() call in ia_css_binary_find() triggering and resulting in the try_fmt() or set_fmt() IOCTL failing. Fix this by clamping the width to max 1920 when in preview mode. Link: https://lore.kernel.org/r/20230619105212.303653-3-hdegoede@redhat.com Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 0e2c53ff13e2240dea196d5813cc08ea923951dc Author: Hans de Goede Date: Mon Jun 19 12:52:06 2023 +0200 media: atomisp: Fix missing v4l2_fh_release() in atomisp_open() error exit Fix missing v4l2_fh_release() in atomisp_open()'s "if (pipe->users)" error exit path. Closes: https://lore.kernel.org/r/202306180511.XWN0Hr7F-lkp@intel.com/ Link: https://lore.kernel.org/r/20230619105212.303653-1-hdegoede@redhat.com Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 921f9a1945e4f0109552d5526013a5b88ea7ce5f Author: Kate Hsuan Date: Mon Jun 19 07:24:53 2023 +0200 media: atomisp: sh_css_internal: sh_css_params: Unifying sh_css_sp_group data structure Since some parts of the data structure elements are determined in compile time, the configuration data structure should be compiled for both two ISP models. In order to set the configuration for both ISP models in runtime, The sh_css_sp_group is unified to one data structure for the configuration to ensure the data structure can be used for both ISP2400 and 2401 in runtime. Also, the unused codes for debug purpose are removed. Form the aspect of ISP setting, the length and the content of the configuration structure for ISP2400 and ISP2401 are different. So, we need to pick up the necessary part of sp_group configuration for both models and then copy those parts into a temporary buffer. This buffer is finally written to the ISP with the corresponding length. Link: https://lore.kernel.org/r/20230619052453.48598-4-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 55c3407c63fbdfef0a5632ac6d09e2e76334fef2 Author: Kate Hsuan Date: Mon Jun 19 07:24:52 2023 +0200 media: atomisp: Removed unused HAS_WATCHDOG_SP_THREAD_DEBUG debug Since the debug codes around #ifdef HAS_WATCHDOG_SP_THREAD_DEBUG are no longer used, the debug implementation of this can be removed. Link: https://lore.kernel.org/r/20230619052453.48598-3-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit b55ce3e6b227119040efb838de19b9ded8c84533 Author: Kate Hsuan Date: Mon Jun 19 07:24:51 2023 +0200 media: atomisp: ia_css_debug: Removed unused codes for debug This portion of the codes was not referenced so it can be completely removed. Link: https://lore.kernel.org/r/20230619052453.48598-2-hpa@redhat.com Signed-off-by: Kate Hsuan Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 5e05f204a19bb62142e97e30345eb21f2880f392 Author: Zelong Dong Date: Fri Aug 25 19:53:09 2023 +0800 dt-bindings: media: Add compatible for Meson-S4 IR Controller Add new compatible for Amlogic's Meson-S4 IR Controller. Meson IR Controller supports hardware decoder in Meson-S4 and later SoC. Signed-off-by: Zelong Dong Acked-by: Krzysztof Kozlowski Signed-off-by: Sean Young Signed-off-by: Hans Verkuil commit e798f5b2d1cc22c6a01107da504dd195e685339c Author: Zelong Dong Date: Fri Aug 25 19:53:08 2023 +0800 media: rc: meson-ir: support rc driver type RC_DRIVER_SCANCODE Meson IR Controller supports hardware decoder in Meson-S4 and later SoC. So far, protocol NEC could be decoded by hardware decoder. Signed-off-by: Zelong Dong Reviewed-by: Neil Armstrong Signed-off-by: Sean Young Signed-off-by: Hans Verkuil commit 5ce19a501673b72cf57ce1908a29a3c5b3cd30bb Author: Sean Young Date: Fri Sep 1 15:18:56 2023 +0100 media: rc: remove ir-rx51 in favour of generic pwm-ir-tx The ir-rx51 is a pwm-based TX driver specific to the N900. This can be handled entirely by the generic pwm-ir-tx driver, and in fact the pwm-ir-tx driver has been compatible with ir-rx51 from the start. Note that the suspend code in the ir-rx51 driver is unnecessary, since during transmit, the process is not in interruptable sleep. The process is not put to sleep until the transmit completes. Acked-by: Uwe Kleine-König Tested-by: Sicelo A. Mhlongo Signed-off-by: Sean Young Signed-off-by: Hans Verkuil commit da923feefead2efc05ef21eb2a3f1058fe4c13ae Author: Sean Young Date: Fri Sep 1 15:18:55 2023 +0100 dt-bindings: media: remove nokia,n900-ir as pwm-ir-tx is compatible The generic pwm-ir-tx driver works for the Nokia n900, so nokia,n900-ir can be removed. Acked-by: Conor Dooley Acked-by: Lee Jones Signed-off-by: Sean Young Signed-off-by: Hans Verkuil commit 46c15a4ff1f4fe078c5b250fb2570020211eab38 Author: Marvin Lin Date: Fri Sep 22 14:24:05 2023 +0800 media: nuvoton: Add driver for NPCM video capture and encoding engine Add driver for Video Capture/Differentiation Engine (VCD) and Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs. As described in the datasheet NPCM750D_DS_Rev_1.0, the VCD can capture frames from digital video input and compare two frames in memory, and then the ECE can compress the frame data into HEXTILE format. This driver implements V4L2 interfaces and provides user controls to support KVM feature, also tested with VNC Viewer ver.6.22.826 and openbmc/obmc-ikvm. Signed-off-by: Marvin Lin Signed-off-by: Hans Verkuil commit 1568583b3977f232e6e7a652fd4be95a11d0ecae Author: Marvin Lin Date: Fri Sep 22 14:24:04 2023 +0800 media: uapi: Add controls for NPCM video driver Create controls for Nuvoton NPCM video driver to support setting capture mode of Video Capture/Differentiation (VCD) engine and getting the count of HEXTILE rectangles that is compressed by Encoding Compression Engine (ECE). Signed-off-by: Marvin Lin Signed-off-by: Hans Verkuil commit 2817154cd18942cd89e254d3764a378518a3270f Author: Marvin Lin Date: Fri Sep 22 14:24:03 2023 +0800 media: v4l2-ctrls: Add user control base for Nuvoton NPCM controls Add a control base for Nuvoton NPCM driver controls, and reserve 16 controls. Signed-off-by: Marvin Lin Signed-off-by: Hans Verkuil commit d62d8e7b59f9d7ed9b6eaaa788fee0d727b7d3ad Author: Marvin Lin Date: Fri Sep 22 14:24:02 2023 +0800 media: v4l: Add HEXTILE compressed format Add HEXTILE compressed format which is defined in Remote Framebuffer Protocol (RFC 6143, chapter 7.7.4 Hextile Encoding) and is used by Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs. Signed-off-by: Marvin Lin Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil commit c3dea90fdfc16b768add6ef99dfd6eec8a0bf48c Author: Marvin Lin Date: Fri Sep 22 14:24:01 2023 +0800 dt-bindings: soc: nuvoton: Add NPCM GFXI Add dt-bindings document for Graphics Core Information (GFXI) node. It is used by NPCM video driver to retrieve Graphics core information. Signed-off-by: Marvin Lin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Hans Verkuil commit f329051273ca01c74a827c70d0d47f2525678b7a Author: Marvin Lin Date: Fri Sep 22 14:24:00 2023 +0800 media: dt-bindings: nuvoton: Add NPCM VCD and ECE engine Add dt-bindings document for Video Capture/Differentiation Engine (VCD) and Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs. Signed-off-by: Marvin Lin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Hans Verkuil commit 2a2fffb488a3c5ea9c06d0b572c90c4aa78709b6 Author: Hans Verkuil Date: Sun Aug 13 10:22:54 2023 +0200 media: remove the old videobuf framework The last driver that still used this old framework has been converted to the videobuf2 framework. So it is now time to delete the old videobuf code. Signed-off-by: Hans Verkuil Reviewed-by: Hans de Goede commit 785c4aa400cb81cb96793771bb629c6582c71f21 Author: Hans Verkuil Date: Sun Aug 13 10:20:49 2023 +0200 media: atomisp: remove left-over videobuf include This source still included the media/videobuf-vmalloc.h header, even though it is no longer used. Since the old videobuf framework is about to be removed, delete this include first. Signed-off-by: Hans Verkuil Reviewed-by: Hans de Goede commit 0c7b8c5c2aed26234b281e167f07ded444246116 Author: Yue Haibing Date: Thu Aug 17 21:43:54 2023 +0800 media: imx-jpeg: Remove unused declarations These are never implemented, remove them. Signed-off-by: Yue Haibing Signed-off-by: Hans Verkuil commit ba85aea885a195b1b6c802a4ff8edf4e014e54b5 Author: Yu Liao Date: Wed Aug 16 14:31:43 2023 +0800 media: use struct_size() helper Prefer struct_size() over open-coded versions of idiom: sizeof(struct-with-flex-array) + sizeof(typeof-flex-array-elements) * count where count is the max number of items the flexible array is supposed to contain. Signed-off-by: Yu Liao Reviewed-by: Tomasz Figa Signed-off-by: Hans Verkuil commit 6c4ef82846066bf70a07026fe56e9f209a9a5953 Author: Colin Ian King Date: Tue Aug 15 13:14:46 2023 +0100 media: mediatek: vcodec: fix spelling mistake "resonable" -> "reasonable" There are a couple of spelling mistakes in pr_err error messages. Fix them. Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil commit 292f83dc68442c8a33cdc6358795786234bf2f50 Author: Krzysztof Kozlowski Date: Tue Aug 15 08:07:39 2023 +0200 media: exynos4-is: fimc-is: replace duplicate pmu node with phandle Devicetree for the FIMC IS camera included duplicated PMU node as its child like: soc@0 { system-controller@10020000 { ... }; // Real PMU camera@11800000 { fimc-is@12000000 { // FIMC IS camera node pmu@10020000 { reg = <0x10020000 0x3000>; // Fake PMU node }; }; }; }; This is not a correct representation of the hardware. Mapping the PMU (Power Management Unit) IO memory should be via syscon-like phandle (samsung,pmu-syscon, already used for other drivers), not by duplicating "pmu" Devicetree node inside the FIMC IS. Backward compatibility is preserved. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Hans Verkuil commit 6c378c24921e659203d8d4c7ca5c495458c92dfb Author: Krzysztof Kozlowski Date: Tue Aug 15 08:07:38 2023 +0200 media: dt-bindings: samsung,fimc: correct unit addresses in DTS example The camera node's ranges property and unit addresses of its children were not correct. If camera is @11800000, then its fimc child is @0. Acked-by: Conor Dooley Signed-off-by: Krzysztof Kozlowski Signed-off-by: Hans Verkuil commit 99e6eaab4c8440eaa6badb83e8e18923c2580c07 Author: Krzysztof Kozlowski Date: Tue Aug 15 08:07:37 2023 +0200 media: dt-bindings: samsung,exynos4212-fimc-is: replace duplicate pmu node with phandle The FIMC IS camera must access the PMU (Power Management Unit) IO memory to control camera power. This was achieved by duplicating the PMU node as its child like: soc@0 { system-controller@10020000 { ... }; // Real PMU camera@11800000 { fimc-is@12000000 { // FIMC IS camera node pmu@10020000 { reg = <0x10020000 0x3000>; // Fake PMU node }; }; }; }; This is not a correct representation of the hardware. Mapping the PMU (Power Management Unit) IO memory should be via syscon-like phandle (samsung,pmu-syscon, already used for other drivers), not by duplicating "pmu" Devicetree node inside the FIMC IS. Reviewed-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Signed-off-by: Hans Verkuil commit 29d3e0b8bdb5dae76e529c70c06a2132d9c39f86 Author: Ruan Jinjie Date: Fri Aug 11 10:49:45 2023 +0800 media: staging: media: sunxi: cedrus: Remove redundant of_match_ptr() The driver depends on CONFIG_OF, it is not necessary to use of_match_ptr() here. Signed-off-by: Ruan Jinjie Acked-by: Jernej Skrabec Acked-by: Paul Kocialkowski Signed-off-by: Hans Verkuil commit d27bb0246e5356dbef4d923e72c680bf893885a8 Author: Li Zetao Date: Thu Aug 10 19:52:20 2023 +0800 media: nxp: Use devm_kmemdup to replace devm_kmalloc + memcpy Use the helper function devm_kmemdup() rather than duplicating its implementation, which helps to enhance code readability. Signed-off-by: Li Zetao Signed-off-by: Hans Verkuil commit 57a3afc5d542afcb4ca0ddd3379ab95c984bba88 Author: Hans Verkuil Date: Thu Aug 3 09:42:10 2023 +0200 media: cx25840: simplify cx23885_dif_setup() Instead of creating a huge switch statement (that thoroughly confuses smatch), create a table of coefficients and use that. Signed-off-by: Hans Verkuil commit 3f1e1f69ad6c13c9e9fadd0595f7e2ce33ba89a1 Author: Wang Ming Date: Wed Jul 26 19:51:58 2023 +0800 media: platform: Use dev_err_probe instead of dev_err It is possible that dma_request_chan will return EPROBE_DEFER, which means that dma->xdev->dev is not ready yet. In this case, dev_err(dma->xdev->dev), there will be no output. This patch fixes the bug. Signed-off-by: Wang Ming Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 026c341795e593df640b901f8d36f90a2461a180 Author: Colin Ian King Date: Tue Jun 27 16:37:38 2023 +0100 media: bt8xx: make read-only arrays static Don't populate the arrays on the stack, instead make them static const. Also add spaces between values to clean up checkpatch style warnings. Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil commit 1a6c4bada40a02cadf0ca7c6deab78c163774566 Author: Juerg Haefliger Date: Fri Jun 16 14:04:06 2023 +0200 media: bttv: Add MODULE_FIRMWARE macro The module loads firmware so add a MODULE_FIRMWARE macro to provide that information via modinfo. Signed-off-by: Juerg Haefliger Signed-off-by: Hans Verkuil commit bd5b50b329e850d467e7bcc07b2b6bde3752fbda Author: Zheng Wang Date: Thu Apr 13 11:49:42 2023 +0800 media: bttv: fix use after free error due to btv->timeout timer There may be some a race condition between timer function bttv_irq_timeout and bttv_remove. The timer is setup in probe and there is no timer_delete operation in remove function. When it hit kfree btv, the function might still be invoked, which will cause use after free bug. This bug is found by static analysis, it may be false positive. Fix it by adding del_timer_sync invoking to the remove function. cpu0 cpu1 bttv_probe ->timer_setup ->bttv_set_dma ->mod_timer; bttv_remove ->kfree(btv); ->bttv_irq_timeout ->USE btv Fixes: 162e6376ac58 ("media: pci: Convert timers to use timer_setup()") Signed-off-by: Zheng Wang Signed-off-by: Hans Verkuil commit 56e9e480b6f2b8790798a89a5a8419683164cb17 Author: Laurent Pinchart Date: Thu Sep 14 21:17:04 2023 +0300 media: i2c: ov9734: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 19ae6ba57f88dc4d01cd2a5dc6c4ca367ead8552 Author: Laurent Pinchart Date: Thu Sep 14 21:17:03 2023 +0300 media: i2c: ov8856: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 046da914bf5ff9c8c89f708b63c488e3e88610b6 Author: Laurent Pinchart Date: Thu Sep 14 21:17:02 2023 +0300 media: i2c: ov5675: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit b268547c5c094df94186c8cad26904a4ffa5ae1c Author: Laurent Pinchart Date: Thu Sep 14 21:17:01 2023 +0300 media: i2c: ov5670: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 5c873f079da7751957f3cfa02da38a8d15ffde65 Author: Laurent Pinchart Date: Thu Sep 14 21:17:00 2023 +0300 media: i2c: ov13b10: Drop stream handling in runtime PM handlers The sensor is guaranteed not to be streaming when the runtime PM resume handler is called, as the resume handler is only called from the .s_stream() operation when starting streaming. Similarly, the sensor has been stopped when the runtime PM suspend handler is called. There is thus no need for manual stream start/stop from the runtime PM handlers. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 55e941d06a761be4f769c1c2e1fff3664c78ab4a Author: Laurent Pinchart Date: Thu Sep 14 21:16:59 2023 +0300 media: i2c: ov2740: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit f82344daa782d6621a2b7f4ca30358386e7c3247 Author: Laurent Pinchart Date: Thu Sep 14 21:16:58 2023 +0300 media: i2c: ov13858: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit b8b84d75304404c7c5a63d863e0000d748892628 Author: Laurent Pinchart Date: Thu Sep 14 21:16:57 2023 +0300 media: i2c: ov08x40: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit a1c4cca2167babf1c267b6640b524278170fd9e6 Author: Laurent Pinchart Date: Thu Sep 14 21:16:56 2023 +0300 media: i2c: ov08d10: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 480ff48163e5b24ba39681fb50bb486cf95a019f Author: Laurent Pinchart Date: Thu Sep 14 21:16:55 2023 +0300 media: i2c: ov02a10: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 6f40f7caf7b66e32392ba6a46136d3faf5dff9be Author: Laurent Pinchart Date: Thu Sep 14 21:16:54 2023 +0300 media: i2c: ov01a10: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit b477adeb9a4645413131f764a35abb58ccd097b6 Author: Laurent Pinchart Date: Thu Sep 14 21:16:53 2023 +0300 media: i2c: og01a1b: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 96608f4f74c12a7af2afdce11bb7e78fa0a3f085 Author: Laurent Pinchart Date: Thu Sep 14 21:16:52 2023 +0300 media: i2c: imx355: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 4c9e4ea49abb407bbe33e5b327cd041ef80d72a6 Author: Laurent Pinchart Date: Thu Sep 14 21:16:51 2023 +0300 media: i2c: imx319: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit e1124ace4504405ee5c81da1bf98f9faf068c44c Author: Laurent Pinchart Date: Thu Sep 14 21:16:50 2023 +0300 media: i2c: imx258: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit b8074db07429b845b805416d261b502f814a80fe Author: Laurent Pinchart Date: Thu Sep 14 21:16:49 2023 +0300 media: i2c: imx219: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 0484cde1dfaacbf8748eb89ea23c274b72466fe3 Author: Laurent Pinchart Date: Thu Sep 14 21:16:48 2023 +0300 media: i2c: imx214: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Reviewed-by: Ricardo Ribalda Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit c628b64d313f4c148ec49d1ea75cdb620c5ee7e9 Author: Laurent Pinchart Date: Thu Sep 14 21:16:47 2023 +0300 media: i2c: imx208: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 35e663b4a3edf9fa11564abaadb9de8b059cf3b6 Author: Laurent Pinchart Date: Thu Sep 14 21:16:46 2023 +0300 media: i2c: hi847: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 2223243cdfc07bb8d0e01bdbfb2233f5489f49f1 Author: Laurent Pinchart Date: Thu Sep 14 21:16:45 2023 +0300 media: i2c: hi846: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. Now that the runtime PM operations are not called from the system PM handlers, the sensor is guaranteed not to be streaming when the runtime PM resume handler is called, and to have been stopped already when the runtime PM suspend handler is called. Drop the manual stream start/stop from the runtime PM handlers. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 5d821eb21f431724237c0d7c25816d92b7b1e857 Author: Laurent Pinchart Date: Thu Sep 14 21:16:44 2023 +0300 media: i2c: hi556: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 2c13a5ad0426e64cc30da41af580bbfbb58f55d8 Author: Laurent Pinchart Date: Thu Sep 14 21:16:43 2023 +0300 media: i2c: ccs: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 8c1e33818003183890bba78c0cabbf203846f85a Author: Laurent Pinchart Date: Thu Sep 14 21:16:42 2023 +0300 media: i2c: ar0521: Drop system suspend and resume handlers Stopping streaming on a camera pipeline at system suspend time, and restarting it at system resume time, requires coordinated action between the bridge driver and the camera sensor driver. This is handled by the bridge driver calling the sensor's .s_stream() handler at system suspend and resume time. There is thus no need for the sensor to independently implement system sleep PM operations. Drop them. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Acked-by: Krzysztof Hałasa Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 7610bfe723650c4c34bd9eb59d389975150a6c5b Author: Laurent Pinchart Date: Thu Sep 14 21:16:41 2023 +0300 Documentation: media: camera-sensor: Improve power management documentation Camera sensor drivers are highly subject to cargo cult programming, with back practices being copied from old to new drivers. In particular, many drivers implement system and runtime PM incorrectly. As a first step towards fixing this situation, refactor and expand the power management documentation to detail correct usage of system and runtime PM. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit f13734b5071751bc2093c4cc4ada88e585cfa797 Author: Laurent Pinchart Date: Thu Sep 14 21:16:40 2023 +0300 Documentation: media: camera-sensor: Move power management section Move the power management section up, just after clocks, as it relates to internal system resources and not features exposed to applications. The text itself is otherwise unchanged. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 6d032832b1ffa0f6933bb99dd3d1461763025ed4 Author: Laurent Pinchart Date: Thu Sep 14 21:16:39 2023 +0300 Documentation: media: camera-sensor: Use link to upstream DT bindings The Documentation/devicetree/bindings/clock/clock-bindings.txt file is deprecated and points to clock-bindings.yaml, which is not hosted in the kernel source tree. Use an HTTPS link to refer to the YAML binding document. While at it, drop "currently" from the paragraph, as the whole file refers to the current recommended practices except where explicitly noted. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 8c547f9b3e641332a5c06454d03f7de6e5acda7e Author: Laurent Pinchart Date: Thu Sep 14 21:16:38 2023 +0300 Documentation: media: camera-sensor: Fix typo and vocabulary selection Drop an unneeded double colon, and use 'shall' instead of 'must' for consistency with the rest of the file. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit f765cc2913c0fea9820bfcfef783992d34d250c9 Author: Laurent Pinchart Date: Thu Sep 14 21:16:37 2023 +0300 media: i2c: ov9734: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 36cb37a69ebd61d0e6acf1db05d2b17077014f1b Author: Laurent Pinchart Date: Thu Sep 14 21:16:36 2023 +0300 media: i2c: ov9282: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 741358bb85578d49601b8a1c085da1b63d7a0f85 Author: Laurent Pinchart Date: Thu Sep 14 21:16:35 2023 +0300 media: i2c: ov8856: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit f29f0a98f223c44fe919124ef46ad95d2444193a Author: Laurent Pinchart Date: Thu Sep 14 21:16:34 2023 +0300 media: i2c: ov7740: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 3ca1480abdd93b6f7559720794db8527288abc56 Author: Laurent Pinchart Date: Thu Sep 14 21:16:33 2023 +0300 media: i2c: ov5695: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 1b59508e0ba66dfebf0e716eafc34dbaca966488 Author: Laurent Pinchart Date: Thu Sep 14 21:16:32 2023 +0300 media: i2c: ov5675: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 33e9cdc325b7121f33c7dd1184ea5dd62e770201 Author: Laurent Pinchart Date: Thu Sep 14 21:16:31 2023 +0300 media: i2c: ov5670: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 444a94daac36c4cb3133af42d8f170ce15ab4138 Author: Laurent Pinchart Date: Thu Sep 14 21:16:30 2023 +0300 media: i2c: ov5647: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit e8d6eb9a9b8dcf050e345ebe7edc31691c73f608 Author: Laurent Pinchart Date: Thu Sep 14 21:16:29 2023 +0300 media: i2c: ov4689: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Reviewed-by: Mikhail Rudenko [Sakari Ailus: remove now-redundant "streaming" from comment.] Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 58e7ab2f381b06e9eb212fc9ba4d2f1cef4181b0 Author: Laurent Pinchart Date: Thu Sep 14 21:16:28 2023 +0300 media: i2c: ov2740: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 493d786bd87dbb92d8051fae7ab5505650b805f9 Author: Laurent Pinchart Date: Thu Sep 14 21:16:27 2023 +0300 media: i2c: ov2685: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit acc53ef65cab23b02918da8806d387dbc4045683 Author: Laurent Pinchart Date: Thu Sep 14 21:16:26 2023 +0300 media: i2c: ov13b10: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 70096d41d02b94b8eeb143b989ab590f009c9ccb Author: Laurent Pinchart Date: Thu Sep 14 21:16:25 2023 +0300 media: i2c: ov13858: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit a0caba4916af26ae992141f98a9eb340efb47730 Author: Laurent Pinchart Date: Thu Sep 14 21:16:24 2023 +0300 media: i2c: ov08x40: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 51d5de9da3be1d5b615183223c559a95ee4710c5 Author: Laurent Pinchart Date: Thu Sep 14 21:16:23 2023 +0300 media: i2c: ov08d10: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 608e0f10bfb903d15a936f02a4d6ca752347dd3c Author: Laurent Pinchart Date: Thu Sep 14 21:16:22 2023 +0300 media: i2c: ov01a10: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 062361fc6c84e457778f2f80aa26b2d504d3fe21 Author: Laurent Pinchart Date: Thu Sep 14 21:16:21 2023 +0300 media: i2c: og01a1b: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 8beaae2c2bf05e312f4b2434e334e8a44e499032 Author: Laurent Pinchart Date: Thu Sep 14 21:16:20 2023 +0300 media: i2c: mt9m001: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit bf5c004691d19adb900044f0696c4d1156881747 Author: Laurent Pinchart Date: Thu Sep 14 21:16:19 2023 +0300 media: i2c: imx412: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 972ba0bcac67397a71205e60c18d358efc7ec748 Author: Laurent Pinchart Date: Thu Sep 14 21:16:18 2023 +0300 media: i2c: imx355: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit ee44330bf068eaca358ba474ac525264e78ec3fd Author: Laurent Pinchart Date: Thu Sep 14 21:16:17 2023 +0300 media: i2c: imx335: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 5a6e2fc7d018c32136dbc05f7fa66b5b91b25ffa Author: Laurent Pinchart Date: Thu Sep 14 21:16:16 2023 +0300 media: i2c: imx334: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. The streaming field of the driver's private structure is now unused, drop it as well. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 1cbdd6659b2ac70a1188dab9ea56d58dba71ee12 Author: Laurent Pinchart Date: Thu Sep 14 21:16:15 2023 +0300 media: i2c: imx319: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 9c5ab9574fa18d497abddca323e42ea9b00c6c15 Author: Laurent Pinchart Date: Thu Sep 14 21:16:14 2023 +0300 media: i2c: imx258: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit fcf877f19165dadb2e0c9e631b4cb7027f24ec86 Author: Laurent Pinchart Date: Thu Sep 14 21:16:13 2023 +0300 media: i2c: imx219: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Reviewed-by: Dave Stevenson Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit f35675411bbe239201f1c962fa16f30b5003c28a Author: Laurent Pinchart Date: Thu Sep 14 21:16:12 2023 +0300 media: i2c: imx214: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Reviewed-by: Ricardo Ribalda Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 4d06c42942f440a3c418e2af4a02d7d00d331840 Author: Laurent Pinchart Date: Thu Sep 14 21:16:11 2023 +0300 media: i2c: imx208: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit c42995a717ec920ac9220914617358d6f6a867b2 Author: Laurent Pinchart Date: Thu Sep 14 21:16:10 2023 +0300 media: i2c: hi846: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 97c1151991274eed9b836a45d197093344e11173 Author: Laurent Pinchart Date: Thu Sep 14 21:16:09 2023 +0300 media: i2c: hi556: Drop check for reentrant .s_stream() The subdev .s_stream() operation shall not be called to start streaming on an already started subdev, or stop streaming on a stopped subdev. Remove the check that guards against that condition. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 009905ec50433259c05f474251000b040098564e Author: Laurent Pinchart Date: Mon Sep 18 15:48:38 2023 +0300 media: v4l2-subdev: Document and enforce .s_stream() requirements The subdev .s_stream() operation must not be called to start an already started subdev, or stop an already stopped one. This requirement has never been formally documented. Fix it, and catch possible offenders with a WARN_ON() in the call_s_stream() wrapper. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 397b2a25b8c0b66dd5e317db620eb5c72dc25827 Author: Hao Yao Date: Fri Sep 15 16:45:27 2023 +0800 media: ov13b10: Add 1364x768 register settings This commit adds support for: - 1364x768 at 120 FPS Signed-off-by: Hao Yao Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 3a5c419fff2428d2ff7d6501476b02da6195cfa3 Author: Fabio Estevam Date: Wed Sep 13 16:28:11 2023 -0300 media: dt-bindings: Add OV5642 As explained in the description text from trivial-devices.yaml: "This is a list of trivial I2C and SPI devices that have simple device tree bindings, consisting only of a compatible field, an address and possibly an interrupt line." A camera device does not fall into this category as it needs other properties such as regulators, reset and powerdown GPIOs, clocks, media endpoint. Remove the OV5642 entry from trivial-devices.yaml and add its own ovti,ov5642.yaml. Signed-off-by: Fabio Estevam Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 4af8528f90e6a2c030598162c62d012c122a1e20 Author: Sakari Ailus Date: Fri Sep 15 01:01:24 2023 +0300 media: Documentation: Mention CCS tools CCS tools is a useful set of programs and libraries for working with CCS static data. Do mention that in context of the CCS driver. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit def13c37e772b762f86dbfbd322d8ee333ecbc5d Author: Laurent Pinchart Date: Thu Sep 14 20:46:47 2023 +0300 media: i2c: imx296: Replace streaming flag with runtime PM check The streaming flag in the driver private structure is used for the sole purpose of gating register writes when setting a V4L2 control. This is better handled by checking if the sensor is powered up using the runtime PM API. Do so and drop the streaming flag. Signed-off-by: Laurent Pinchart Reviewed-by: Tommaso Merciai Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit b2b5905aa5a3efb4dcbc4ac3f5f0525190a3e3a8 Author: Laurent Pinchart Date: Thu Sep 14 20:46:00 2023 +0300 media: i2c: imx415: Replace streaming flag with runtime PM check The streaming flag in the driver private structure is used for the sole purpose of gating register writes when setting a V4L2 control. This is better handled by checking if the sensor is powered up using the runtime PM API. Do so and drop the streaming flag. Signed-off-by: Laurent Pinchart [Sakari Ailus: Runtime PM put when setting analgue gain.] Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 165457e6d084c308dd9399a04c71ee85bb28d300 Author: Laurent Pinchart Date: Thu Sep 14 20:45:08 2023 +0300 media: i2c: ov5693: Drop the unused streaming flag The streaming flag in the driver's private structure is set but never used. Drop it. Signed-off-by: Laurent Pinchart Reviewed-by: Daniel Scally Reviewed-by: Tommaso Merciai Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit b92f8f3591aca18fe677092fcc567c698368f651 Author: Laurent Pinchart Date: Thu Sep 14 20:20:54 2023 +0300 media: i2c: Use pm_runtime_resume_and_get() Simplify error handling by using pm_runtime_resume_and_get() instead of pm_runtime_get_sync() with a put call in the error path. Signed-off-by: Laurent Pinchart Acked-by: Benjamin Mugnier (st-vgxy61) Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 20290feaaeb76cc719921aad275ccb18662a7c3a Author: Xiaolei Wang Date: Mon Aug 7 17:05:35 2023 +0800 media: ov5640: Fix a memory leak when ov5640_probe fails sensor->ctrls.handler is initialized in ov5640_init_controls(), so when the sensor is not connected and ov5640_sensor_resume() fails, sensor->ctrls.handler should be released, otherwise a memory leak will be detected: unreferenced object 0xc674ca80 (size 64): comm "swapper/0", pid 1, jiffies 4294938337 (age 204.880s) hex dump (first 32 bytes): 80 55 75 c6 80 54 75 c6 00 55 75 c6 80 52 75 c6 .Uu..Tu..Uu..Ru. 00 53 75 c6 00 00 00 00 00 00 00 00 00 00 00 00 .Su.......... Fixes: 85644a9b37ec ("media: ov5640: Use runtime PM") Signed-off-by: Xiaolei Wang Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit a6403dddaebf32a3cad3763924a10be02ed327e0 Author: Shravan Chippa Date: Fri Aug 4 20:45:41 2023 +0530 media: i2c: imx334: add support for test pattern generator Add support for the imx334's test pattern generator. By default the test pattern generator is disabled, so add support for enabling and disabling horizontal and vertical colour bars. Signed-off-by: Shravan Chippa Acked-by: Daniele Alessandrelli Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 2d13621c6b7b5290c8114c8c33e8e66297ce26bf Author: Biju Das Date: Sun Sep 10 16:00:33 2023 +0100 media: i2c: ov7670: Drop CONFIG_OF ifdeffery Drop of_match_ptr() from ov7670_driver and get rid of ugly CONFIG_OF if check. This slightly increases the size of ov7670_driver on non-OF system and shouldn't be an issue. Add mod_devicetable.h include. It also allows, in case if needed, to enumerate this device via ACPI with PRP0001 magic. Signed-off-by: Biju Das Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit dd2dbf3cbd3f091f20860586f1115eb0fa513d5d Author: Biju Das Date: Sun Sep 10 16:00:32 2023 +0100 media: i2c: ov7670: Extend match support for OF tables The driver has an OF match table, still, it uses an ID lookup table for retrieving match data. Currently, the driver is working on the assumption that an I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using i2c_get_match_data() if the devices are registered via OF/ID. Unify the OF/ID table by using struct ov7670_devtype as match data for both these tables and replace the ID lookup table for the match data by i2c_get_match_data(). Split the array ov7670_devdata[] as individual variables, and make lines shorter by referring to e.g. &ov7670_devdata instead of &ov7670_devdata[MODEL_OV7670]. Drop enum ov7670_model as there is no user. While at it, remove the trailing comma in the terminator entry for the OF table making code robust against (theoretical) misrebases or other similar things where the new entry goes _after_ the termination without the compiler noticing. Signed-off-by: Biju Das Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 578295176d5caaf0a91314826152b4b3a5766320 Author: Biju Das Date: Sun Sep 10 17:54:32 2023 +0100 media: i2c: mt9v032: Drop CONFIG_OF ifdeffery Drop of_match_ptr() from mt9v032_driver and get rid of ugly CONFIG_OF if check. This slightly increases the size of mt9v032_driver on non-OF system and shouldn't be an issue. Add mod_devicetable.h include. It also allows, in case if needed, to enumerate this device via ACPI with PRP0001 magic. Signed-off-by: Biju Das Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 5e1abb1a9bf29a35ac74f480307d4d18a3b8eb1c Author: Biju Das Date: Sun Sep 10 17:54:31 2023 +0100 media: i2c: mt9v032: Extend match support for OF tables The driver has an OF match table, still, it uses an ID lookup table for retrieving match data. Currently, the driver is working on the assumption that an I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using i2c_get_match_data() if the devices are registered via OF/ID. Unify the OF/ID table by using mt9v032_model_info as match data for both these tables and replace the ID lookup table for the match data by i2c_get_match_data() and simplifly probe(). Signed-off-by: Biju Das Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit b4e9a2d278c955715926f332773a9f66140fc41d Author: Jacopo Mondi Date: Mon Sep 11 16:56:36 2023 +0200 media: i2c: Drop ifdeffery from sensor drivers Since commit 7d3c7d2a2914 ("media: i2c: Add a camera sensor top level menu") the CONFIG_MEDIA_CONTROLLER and CONFIG_VIDEO_V4L2_SUBDEV_API are selected by the top-level VIDEO_CAMERA_SENSOR menu. Remove all ifdefferies from camera sensor drivers to simplify the code. Compile-tested only. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit d1560d57d75c05004e19cd3333e72b13940863f4 Author: Biju Das Date: Sun Aug 20 08:58:46 2023 +0100 media: i2c: video-i2c: Convert enum->pointer for data in the match tables Convert enum->pointer for data in the match tables, so that device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c bus type match support added to it. Replace enum->struct *video_i2c_chip for data in the match table. Simplify the probe() by replacing device_get_match_data() and ID lookup for retrieving data by i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit a111f02464ca74358a001ff710334e09a22cdd7a Author: Krzysztof Kozlowski Date: Wed Aug 23 10:56:10 2023 +0200 media: platform: use capital "OR" for multiple licenses in SPDX Documentation/process/license-rules.rst and checkpatch expect the SPDX identifier syntax for multiple licenses to use capital "OR". Correct it to keep consistent format and avoid copy-paste issues. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit da7e34e558a522d4a71660a165815979b1397074 Author: Laurent Pinchart Date: Fri Aug 18 18:55:18 2023 +0300 media: v4l2-subdev: Document that routing support depends on streams Routing support, through the subdev .set_routing() operation, requires the subdev to support streams. This is however not clearly documented anywhere. Fix it by expanding the operation's documentation to indicate that subdevs must set the V4L2_SUBDEV_FL_STREAMS flag. Signed-off-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 71f8a5e4be122a8737abfa6d14551480747c5e00 Author: Umang Jain Date: Wed Aug 30 10:23:23 2023 +0530 media: i2c: imx415: Use v4l2_subdev_get_fmt() The imx415 driver uses the subdev active state, there's no need to implement the .get_fmt() operation manually. Use the v4l2_subdev_get_fmt() helper instead. Signed-off-by: Umang Jain Reviewed-by: Michael Riesch Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 0822315e46b400f611cba1193456ee6a5dc3e41d Author: Christophe JAILLET Date: Sat Aug 26 00:13:40 2023 +0200 media: i2c: max9286: Fix some redundant of_node_put() calls This is odd to have a of_node_put() just after a for_each_child_of_node() or a for_each_endpoint_of_node() loop. It should already be called during the last iteration. Remove these calls. Fixes: 66d8c9d2422d ("media: i2c: Add MAX9286 driver") Signed-off-by: Christophe JAILLET Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 6966f2f7abbaf32fa395eff8e2888ea10d422e40 Author: Wentong Wu Date: Tue Aug 29 13:24:28 2023 +0800 media: ivsc: ace: probe ace device after IPU bridge is initialized. During probe ivsc ace device, acpi_dev_clear_dependencies() will be called to clear the consumer and supplier relationship between camera sensor device and ivsc device. But IPU bridge will setup the connection swnodes for ivsc device and camera sensor device based on this consumer and supplier relationship. This patch defers ivsc ace's probe to make sure IPU bridge is initialized before this consumer and supplier relationship between camera sensor device and IVSC device is cleared. Signed-off-by: Wentong Wu Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 6b6f41791b443e9d141ae254ec0de833841497a9 Author: Wentong Wu Date: Tue Aug 29 13:24:27 2023 +0800 media: ivsc: ace: remove name identifier Remove name identifier to match the device with the defined UUID when load driver module. Signed-off-by: Wentong Wu Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 18e35ba0d89f89bdda8001c6b34b18f62917d10d Author: Wentong Wu Date: Tue Aug 29 13:24:26 2023 +0800 media: ivsc: csi: remove name identifier Remove name identifier to match the device with the defined UUID when load driver module. Signed-off-by: Wentong Wu Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit b97213a41140b87f48865ba594a1f4b5c5566631 Author: Sakari Ailus Date: Wed Aug 23 12:03:42 2023 +0300 media: v4l2-mc: Make v4l2_pipeline_pm_{get,put} deprecated The v4l2_pipeline_pm_get() and v4l2_pipeline_pm_put() functions were needed to control sub-devices' power states before runtime PM. These functions should no longer be used, and instead sub-device drivers should use runtime PM. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit e9e2e88f3c16a7462420182afafb8d8783524ffd Author: Ruan Jinjie Date: Fri Aug 18 18:16:24 2023 +0800 media: ov2640: Use the devm_clk_get_enabled() helper function With devm_clk_get_enabled() the call to clk_disable_unprepare() can be dropped from the error path and the remove callback. Signed-off-by: Ruan Jinjie Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 17f2370a21e4a435768c4f81cc82779a2135bff7 Author: Suhrid Subramaniam Date: Mon Jul 10 18:31:40 2023 -0700 media: v4l: Fix documentation for 12-bit packed Bayer Fix documentation for R13 and R33 low bits. Signed-off-by: Suhrid Subramaniam Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit e2d3e77d0e7d3caf676cb0eb707f8c7b0a4d41b9 Author: Jean-Michel Hautbois Date: Thu Sep 16 19:25:04 2021 +0200 media: staging: ipu3-imgu: Initialise height_per_slice in the stripes While playing with low resolutions for the grid, it appeared that height_per_slice is not initialised if we are not using both stripes for the calculations. This pattern occurs three times: - for the awb_fr processing block - for the af processing block - for the awb processing block The idea of this small portion of code is to reduce complexity in loading the statistics, it could be done also when only one stripe is used. Fix it by getting this initialisation code outside of the else() test case. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 12ee5f71e0e7f93b10f83655c8c334c06536f9cb Author: Tommaso Merciai Date: Mon Jul 31 23:52:15 2023 +0200 media: dt-bindings: ov5693: fix maintainer email address Switch my mail address from a company mail to a personal one. Signed-off-by: Tommaso Merciai Acked-by: Conor Dooley Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit b9a53a6975d9bcfb41950ed8566ae76ceb24d595 Author: Sakari Ailus Date: Fri Aug 4 09:23:22 2023 +0300 media: ivsc: Improve Kconfig help text Improve the Kconfig help text to convey the ACE is for changing camera sensor ownership and CSI for configuring the CSI-2 rx and tx. Suggested-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 8fc29e3c9f682d4ad9b0764d44ecc6c19b000051 Author: Guoniu.zhou Date: Wed Jul 19 15:30:12 2023 +0800 media: ov5640: fix vblank unchange issue when work at dvp mode The value of V4L2_CID_VBLANK control is initialized to default vblank value of 640x480 when driver probe. When OV5640 work at DVP mode, the control value won't update and lead to sensor can't output data if the resolution remain the same as last time since incorrect total vertical size. So update it when there is a new value applied. Fixes: bce93b827de6 ("media: ov5640: Add VBLANK control") Signed-off-by: Guoniu.zhou Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit d66b45e1b082462c3e14528b83e18ee92362e456 Author: Dan Carpenter Date: Wed Jul 19 13:16:10 2023 +0300 media: ov13b10: Fix some error checking in probe The "ret = " assignment was missing, so ov13b10_power_on() is not checked for errors. Add the assignment. Fixes: 6e28afd15228 ("media: ov13b10: add PM control support based on power resources") Signed-off-by: Dan Carpenter Reviewed-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit e986ab55e7576053a6a764ec71e0517245eae758 Author: Mikhail Rudenko Date: Thu Aug 3 15:37:42 2023 +0300 MAINTAINERS: fix file path for Omnvision OV4689 Correct the driver source path specified in the MAINTAINERS file, which was mistakenly set due to an oversight during the driver's initial addition. Signed-off-by: Mikhail Rudenko Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil commit 2b651ba688b3d0dbfc35701a12d6eb4885800e14 Author: Jinjie Ruan Date: Sun Sep 3 16:14:40 2023 +0800 media: cx231xx: Add EP5_BUF_SIZE and EP5_TIMEOUT_MS macros Define EP5_BUF_SIZE and EP5_TIMEOUT_MS macros to make the code more readable. Signed-off-by: Jinjie Ruan Suggested-by: Andrzej Pietrasiewicz Signed-off-by: Hans Verkuil commit e85322573d986f0cd069eb8b639955d21d90db44 Author: Jinjie Ruan Date: Sun Sep 3 16:14:39 2023 +0800 media: cx231xx: Switch to use kmemdup() helper Use kmemdup() helper instead of open-coding to simplify the code. Signed-off-by: Jinjie Ruan Signed-off-by: Hans Verkuil commit 05b34200a1552d39f2369052ce94d9563a5f15c0 Author: Hans Verkuil Date: Wed Aug 30 14:31:40 2023 +0200 media: videobuf2: fix typo: vb2_dbuf -> vb2_qbuf Fix a small typo in the debug message: vb2_dbuf -> vb2_qbuf Signed-off-by: Hans Verkuil Reviewed-by: Andrzej Pietrasiewicz commit 099be1822d1f095433f4b08af9cc9d6308ec1953 Author: Rajeshwar R Shinde Date: Wed Aug 30 13:14:01 2023 +0530 media: gspca: cpia1: shift-out-of-bounds in set_flicker Syzkaller reported the following issue: UBSAN: shift-out-of-bounds in drivers/media/usb/gspca/cpia1.c:1031:27 shift exponent 245 is too large for 32-bit type 'int' When the value of the variable "sd->params.exposure.gain" exceeds the number of bits in an integer, a shift-out-of-bounds error is reported. It is triggered because the variable "currentexp" cannot be left-shifted by more than the number of bits in an integer. In order to avoid invalid range during left-shift, the conditional expression is added. Reported-by: syzbot+e27f3dbdab04e43b9f73@syzkaller.appspotmail.com Closes: https://lore.kernel.org/all/20230818164522.12806-1-coolrrsh@gmail.com Link: https://syzkaller.appspot.com/bug?extid=e27f3dbdab04e43b9f73 Signed-off-by: Rajeshwar R Shinde Signed-off-by: Hans Verkuil commit 6e481d52d363218a3e6feb31694da74b38b30fad Author: Marek Vasut Date: Thu Aug 24 03:39:35 2023 +0200 media: verisilicon: Do not enable G2 postproc downscale if source is narrower than destination In case of encoded input VP9 data width that is not multiple of macroblock size, which is 16 (e.g. 1080x1920 frames, where 1080 is multiple of 8), the width is padded to be a multiple of macroblock size (for 1080x1920 frames, that is 1088x1920). The hantro_postproc_g2_enable() checks whether the encoded data width is equal to decoded frame width, and if not, enables down-scale mode. For a frame where input is 1080x1920 and output is 1088x1920, this is incorrect as no down-scale happens, the frame is only padded. Enabling the down-scale mode in this case results in corrupted frames. Fix this by adjusting the check to test whether encoded data width is greater than decoded frame width, and only in that case enable the down-scale mode. To generate input test data to trigger this bug, use e.g.: $ gst-launch-1.0 videotestsrc ! video/x-raw,width=272,height=256,format=I420 ! \ vp9enc ! matroskamux ! filesink location=/tmp/test.vp9 To trigger the bug upon decoding (note that the NV12 must be forced, as that assures the output data would pass the G2 postproc): $ gst-launch-1.0 filesrc location=/tmp/test.vp9 ! matroskademux ! vp9parse ! \ v4l2slvp9dec ! video/x-raw,format=NV12 ! videoconvert ! fbdevsink Fixes: 79c987de8b35 ("media: hantro: Use post processor scaling capacities") Signed-off-by: Marek Vasut Reviewed-by: Benjamin Gaignard Signed-off-by: Hans Verkuil commit 88d4b23a629ebd34f682f770cb6c2116c851f7b8 Author: Marek Vasut Date: Thu Aug 24 03:38:58 2023 +0200 media: hantro: Check whether reset op is defined before use The i.MX8MM/N/P does not define the .reset op since reset of the VPU is done by genpd. Check whether the .reset op is defined before calling it to avoid NULL pointer dereference. Note that the Fixes tag is set to the commit which removed the reset op from i.MX8M Hantro G2 implementation, this is because before this commit all the implementations did define the .reset op. Fixes: 6971efb70ac3 ("media: hantro: Allow i.MX8MQ G1 and G2 to run independently") Signed-off-by: Marek Vasut Reviewed-by: Chen-Yu Tsai Tested-by: Chen-Yu Tsai Reviewed-by: Adam Ford Signed-off-by: Hans Verkuil commit 0c7af09408b3e4bb7e9a3b430a93473494d9b748 Author: Jinjie Ruan Date: Wed Aug 23 15:16:52 2023 +0800 media: cobalt: Use list_for_each_entry() helper Convert list_for_each() to list_for_each_entry() so that the p list_head pointer and list_entry() call are no longer needed, which can reduce a few lines of code. No functional changed. Signed-off-by: Jinjie Ruan Signed-off-by: Hans Verkuil commit 1c2786632e20c8f0fd4004fae3b3490276e5e5da Author: Ming Qian Date: Tue Aug 22 09:45:06 2023 +0800 media: imx-jpeg: initiate a drain of the capture queue in dynamic resolution change The last buffer from before the change must be marked, with the V4L2_BUF_FLAG_LAST flag, similarly to the Drain sequence above. Meanwhile if V4L2_DEC_CMD_STOP is sent before the source change triggered, we need to restore the is_draing flag after the draining in dynamic resolution change. Fixes: b4e1fb8643da ("media: imx-jpeg: Support dynamic resolution change") Signed-off-by: Ming Qian Reviewed-by: Nicolas Dufresne Signed-off-by: Hans Verkuil commit a805136eec48c7f0e3b7dad44ec5efb506a938d8 Author: Ruan Jinjie Date: Fri Aug 18 18:15:40 2023 +0800 media: c8sectpfe: Use the devm_clk_get_enabled() helper function With devm_clk_get_enabled() the call to clk_disable_unprepare() can be dropped from the error path and the remove callback. Signed-off-by: Ruan Jinjie Reviewed-by: Patrice Chotard Signed-off-by: Hans Verkuil commit 16fae979ed6b2753c07bdc9943cd9892349b69d4 Author: Chen Jiahao Date: Wed Aug 16 10:23:23 2023 +0800 media: usb: siano: Use kmemdup to simplify kmalloc and memcpy logic Using kmemdup() helper function rather than implementing it again with kmalloc() + memcpy(), which improves the code readability. Signed-off-by: Chen Jiahao Reviewed-by: Dongliang Mu Signed-off-by: Hans Verkuil commit e2f01278781f80ccb329218793d78980cdd8d3c3 Author: Ruan Jinjie Date: Fri Aug 4 14:55:23 2023 +0800 media: dvb-usb: gp8psk: Remove an unnecessary ternary operator There is a ternary operator, the true or false judgement of which is unnecessary in C language semantics. Signed-off-by: Ruan Jinjie Signed-off-by: Hans Verkuil commit e0878c7f7f2139ece5563d194872ba84d7e2f4bf Author: Ruan Jinjie Date: Fri Aug 4 14:55:22 2023 +0800 media: radio-wl1273: Remove an unnecessary ternary operator There is a ternary operator, the true or false judgement of which is unnecessary in C language semantics. Signed-off-by: Ruan Jinjie Signed-off-by: Hans Verkuil commit e50f23b1ca240ec2ba9d6d3f17eb936d484e9888 Author: Ruan Jinjie Date: Fri Aug 4 14:55:21 2023 +0800 media: dvb-frontends: drx39xyj: Remove unnecessary ternary operators There are a few ternary operators, the true or false judgement of which is unnecessary in C language semantics. Signed-off-by: Ruan Jinjie Signed-off-by: Hans Verkuil commit beeefd75fa35bc037bff10fc4f65434eb4429750 Author: rasheed.hsueh Date: Fri Aug 18 10:58:48 2023 +0800 media: platform: cros-ec: Add Boxy to the match table The Google Boxy device uses the same approach as the Google Brask which enables the HDMI CEC via the cros-ec-cec driver. Signed-off-by: rasheed.hsueh Signed-off-by: Hans Verkuil [hverkuil: updated to the new multi-port datastructures] commit 5bc2de5f517d561a5b8dc472d3ba17d0f32b122e Author: Stefan Adolfsson Date: Wed Aug 16 12:41:25 2023 +0200 media: cros-ec-cec: Add Constitution to the match table Constitution has two HDMI ports which support CEC: Port B is EC port 0 Port A is EC port 1 This patch depends on "media: cros-ec-cec: Add Dibbi to the match table". Signed-off-by: Stefan Adolfsson Reviewed-by: Guenter Roeck Signed-off-by: Hans Verkuil [hverkuil: updated to the new multi-port datastructures] commit 8d3e6030e30fd1f2fad74265219f4ba39170a4ba Author: Reka Norman Date: Fri Aug 25 12:44:02 2023 +1000 media: cros-ec-cec: Add Dibbi to the match table Dibbi has two HDMI ports which support CEC: Port D is EC port 0 Port B is EC port 1 Signed-off-by: Reka Norman Signed-off-by: Hans Verkuil commit 5d227f02ceb9cc120cf04efbd77e12da182a5f62 Author: Reka Norman Date: Fri Aug 25 12:44:01 2023 +1000 media: cros-ec-cec: Get number of CEC ports from EC Add a new CEC port count host command and use it to query the number of CEC ports from the EC. If the host command is not supported then it must be old EC firmware which only supports one port, so fall back to assuming one port. This patch completes support for multiple ports in cros-ec-cec. Signed-off-by: Reka Norman Signed-off-by: Hans Verkuil commit e7885b9c6564dc39b55f546b4a4afa0a44bb0be5 Author: Reka Norman Date: Fri Aug 25 12:44:00 2023 +1000 media: cros-ec-cec: Allow specifying multiple HDMI connectors Update the cec_dmi_match_table to allow specifying multiple HDMI connectors for each device. Signed-off-by: Reka Norman Signed-off-by: Hans Verkuil commit 425d20518c54bc6d66d733fb117a9a4046932d50 Author: Reka Norman Date: Fri Aug 25 12:43:59 2023 +1000 media: cros-ec-cec: Support receiving messages from multiple ports Currently, received messages are sent from the EC in the cec_message MKBP event. Since the size of ec_response_get_next_data_v1 is 16 bytes, which is also the maximum size of a CEC message, there is no space to add a port parameter. Increasing the size of ec_response_get_next_data_v1 is an option, but this would increase EC-kernel traffic for all MKBP event types. Instead, use an event to notify that data is ready, and add a new read command to read the data. For backwards compatibility with old EC firmware, continue to handle cec_message events as well. Signed-off-by: Reka Norman Signed-off-by: Hans Verkuil commit 1cabf52639d16428bc0d61028dcaf38e29c5f3b5 Author: Reka Norman Date: Fri Aug 25 12:43:58 2023 +1000 media: cros-ec-cec: Support multiple ports in MKBP cec_events Use the top four bits of the cec_events MKBP event to store the port number. Signed-off-by: Reka Norman Signed-off-by: Hans Verkuil commit adbfc747ddfb48c06d238640e16939916b7a4494 Author: Reka Norman Date: Fri Aug 25 12:43:57 2023 +1000 media: cros-ec-cec: Support multiple ports in write command Add a v1 of the CEC write command which contains a port parameter. Check which versions of the write command the EC supports and use the highest supported version. If it only supports v0, check that there is only one port. With v0, the EC will assume all write commands are for port 0. Signed-off-by: Reka Norman Signed-off-by: Hans Verkuil commit e90bd1fe7cda1aa267fe683e392b4433ec2dc0d3 Author: Reka Norman Date: Fri Aug 25 12:43:56 2023 +1000 media: cros-ec-cec: Support multiple ports in set/get host commands Reuse the top four bits of the cmd field to specify the port number. The reason for doing this as opposed to adding a separate uint8_t field is it avoids the need to add new versions of these commands. The change is backwards compatible since these bits were previously always zero, so the default behaviour is to always operate on port 0. Signed-off-by: Reka Norman Signed-off-by: Hans Verkuil commit 4d0e179a42879f7d76a5b95a2e7e7a5afa33954a Author: Reka Norman Date: Fri Aug 25 12:43:55 2023 +1000 media: cros-ec-cec: Manage an array of ports To support multiple CEC ports, change cros_ec_cec to contain an array of ports, each with their own CEC adapter, etc. For now, only create a single port and use that port everywhere, so there is no functional change. Support for multiple ports will be added in the following patches. Signed-off-by: Reka Norman Signed-off-by: Hans Verkuil commit afca12e35e711ae8f97e835a3704cc305592eac9 Author: Reka Norman Date: Fri Aug 25 12:43:54 2023 +1000 media: cros-ec-cec: Use cros_ec_cmd to send host commands Use the cros_ec_cmd helper function to reduce the amount of boilerplate when sending host commands. Signed-off-by: Reka Norman Signed-off-by: Hans Verkuil commit 89936bfbdf11f8758b852e7225a02e5fee57a1cd Author: Martin Dørum Date: Thu Apr 13 12:54:36 2023 +0200 media: qcom/camss: use 1X16 formats instead of 2X8 Platforms with qcom-camss use CSI-2, which means 1X16 is more correct than 2X8. The fact that qcom-camss supported only 2X8 meant it was incompatible with camera sensors it should have been compatible with. For example, the ov5645 driver (correctly) reports that its format is UYVY8_1X16 (after ba449bb56203aedc4530a82b0f3f83358808b7f2). Since qcom-camss only supports 2X8, the qcom-camss system is incompatible with the ov5645 driver, even though they should be compatible. This patch replaces all uses of UYVY8_2X8/VYUY8_2X8/YUYV8_2X8/YVYU8_2X8 with the equivalent 1X16 formats. Signed-off-by: Martin Dørum Acked-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit ef876db6a2bf412b550fd3cbdfdcc73ca9959420 Author: Konrad Dybcio Date: Fri Apr 7 15:28:31 2023 +0200 dt-bindings: media: qcom,sdm845-venus-v2: Allow interconnect properties Allow the interconnect properties, which have been in use for ages. Signed-off-by: Konrad Dybcio Acked-by: Rob Herring Signed-off-by: Hans Verkuil commit 87889f1b7ea40d2544b49c62092e6ef2792dced7 Author: Andrey Konovalov Date: Wed Aug 30 16:16:15 2023 +0100 media: qcom: camss: Fix csid-gen2 for test pattern generator In the current driver csid Test Pattern Generator (TPG) doesn't work. This change: - fixes writing frame width and height values into CSID_TPG_DT_n_CFG_0 - fixes the shift by one between test_pattern control value and the actual pattern. - drops fixed VC of 0x0a which testing showed prohibited some test patterns in the CSID to produce output. So that TPG starts working, but with the below limitations: - only test_pattern=9 works as it should - test_pattern=8 and test_pattern=7 produce black frame (all zeroes) - the rest of test_pattern's don't work (yavta doesn't get the data) - regardless of the CFA pattern set by 'media-ctl -V' the actual pixel order is always the same (RGGB for any RAW8 or RAW10P format in 4608x2592 resolution). Tested with: RAW10P format, VC0: media-ctl -V '"msm_csid0":0[fmt:SRGGB10/4608x2592 field:none]' media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/4608x2592 field:none]' media-ctl -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]' v4l2-ctl -d /dev/v4l-subdev6 -c test_pattern=9 yavta -B capture-mplane --capture=3 -n 3 -f SRGGB10P -s 4608x2592 /dev/video0 RAW10P format, VC1: media-ctl -V '"msm_csid0":2[fmt:SRGGB10/4608x2592 field:none]' media-ctl -V '"msm_vfe0_rdi1":0[fmt:SRGGB10/4608x2592 field:none]' media-ctl -l '"msm_csid0":2->"msm_vfe0_rdi1":0[1]' v4l2-ctl -d /dev/v4l-subdev6 -c test_pattern=9 yavta -B capture-mplane --capture=3 -n 3 -f SRGGB10P -s 4608x2592 /dev/video1 RAW8 format, VC0: media-ctl --reset media-ctl -V '"msm_csid0":0[fmt:SRGGB8/4608x2592 field:none]' media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB8/4608x2592 field:none]' media-ctl -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]' yavta -B capture-mplane --capture=3 -n 3 -f SRGGB8 -s 4608x2592 /dev/video0 Fixes: eebe6d00e9bf ("media: camss: Add support for CSID hardware version Titan 170") Cc: stable@vger.kernel.org Signed-off-by: Andrey Konovalov Signed-off-by: Bryan O'Donoghue Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit e655d1ae9703286cef7fda8675cad62f649dc183 Author: Bryan O'Donoghue Date: Wed Aug 30 16:16:14 2023 +0100 media: qcom: camss: Fix set CSI2_RX_CFG1_VC_MODE when VC is greater than 3 VC_MODE = 0 implies a two bit VC address. VC_MODE = 1 is required for VCs with a larger address than two bits. Fixes: eebe6d00e9bf ("media: camss: Add support for CSID hardware version Titan 170") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit d8f7e1a60d01739a1d78db2b08603089c6cf7c8e Author: Bryan O'Donoghue Date: Wed Aug 30 16:16:13 2023 +0100 media: qcom: camss: Fix invalid clock enable bit disjunction define CSIPHY_3PH_CMN_CSI_COMMON_CTRL5_CLK_ENABLE BIT(7) disjunction for gen2 ? BIT(7) : is a nop we are setting the same bit either way. Fixes: 4abb21309fda ("media: camss: csiphy: Move to hardcode CSI Clock Lane number") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Reviewed-by: Konrad Dybcio Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit b6e1bdca463a932c1ac02caa7d3e14bf39288e0c Author: Bryan O'Donoghue Date: Wed Aug 30 16:16:12 2023 +0100 media: qcom: camss: Fix missing vfe_lite clocks check check_clock doesn't account for vfe_lite which means that vfe_lite will never get validated by this routine. Add the clock name to the expected set to remediate. Fixes: 7319cdf189bb ("media: camss: Add support for VFE hardware version Titan 170") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 7f24d291350426d40b36dfbe6b3090617cdfd37a Author: Bryan O'Donoghue Date: Wed Aug 30 16:16:11 2023 +0100 media: qcom: camss: Fix VFE-480 vfe_disable_output() vfe-480 is copied from vfe-17x and has the same racy idle timeout bug as in 17x. Fix the vfe_disable_output() logic to no longer be racy and to conform to the 17x way of quiescing and then resetting the VFE. Fixes: 4edc8eae715c ("media: camss: Add initial support for VFE hardware version Titan 480") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit 3143ad282fc08bf995ee73e32a9e40c527bf265d Author: Bryan O'Donoghue Date: Wed Aug 30 16:16:10 2023 +0100 media: qcom: camss: Fix VFE-17x vfe_disable_output() There are two problems with the current vfe_disable_output() routine. Firstly we rightly use a spinlock to protect output->gen2.active_num everywhere except for in the IDLE timeout path of vfe_disable_output(). Even if that is not racy "in practice" somehow it is by happenstance not by design. Secondly we do not get consistent behaviour from this routine. On sc8280xp 50% of the time I get "VFE idle timeout - resetting". In this case the subsequent capture will succeed. The other 50% of the time, we don't hit the idle timeout, never do the VFE reset and subsequent captures stall indefinitely. Rewrite the vfe_disable_output() routine to - Quiesce write masters with vfe_wm_stop() - Set active_num = 0 remembering to hold the spinlock when we do so followed by - Reset the VFE Testing on sc8280xp and sdm845 shows this to be a valid fix. Fixes: 7319cdf189bb ("media: camss: Add support for VFE hardware version Titan 170") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit 26bda3da00c3edef727a6acb00ed2eb4b22f8723 Author: Bryan O'Donoghue Date: Wed Aug 30 16:16:09 2023 +0100 media: qcom: camss: Fix vfe_get() error jump Right now it is possible to do a vfe_get() with the internal reference count at 1. If vfe_check_clock_rates() returns non-zero then we will leave the reference count as-is and run: - pm_runtime_put_sync() - vfe->ops->pm_domain_off() skip: - camss_disable_clocks() Subsequent vfe_put() calls will when the ref-count is non-zero unconditionally run: - pm_runtime_put_sync() - vfe->ops->pm_domain_off() - camss_disable_clocks() vfe_get() should not attempt to roll-back on error when the ref-count is non-zero as the upper layers will still do their own vfe_put() operations. vfe_put() will drop the reference count and do the necessary power domain release, the cleanup jumps in vfe_get() should only be run when the ref-count is zero. [ 50.095796] CPU: 7 PID: 3075 Comm: cam Not tainted 6.3.2+ #80 [ 50.095798] Hardware name: LENOVO 21BXCTO1WW/21BXCTO1WW, BIOS N3HET82W (1.54 ) 05/26/2023 [ 50.095799] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 50.095802] pc : refcount_warn_saturate+0xf4/0x148 [ 50.095804] lr : refcount_warn_saturate+0xf4/0x148 [ 50.095805] sp : ffff80000c7cb8b0 [ 50.095806] x29: ffff80000c7cb8b0 x28: ffff16ecc0e3fc10 x27: 0000000000000000 [ 50.095810] x26: 0000000000000000 x25: 0000000000020802 x24: 0000000000000000 [ 50.095813] x23: ffff16ecc7360640 x22: 00000000ffffffff x21: 0000000000000005 [ 50.095815] x20: ffff16ed175f4400 x19: ffffb4d9852942a8 x18: ffffffffffffffff [ 50.095818] x17: ffffb4d9852d4a48 x16: ffffb4d983da5db8 x15: ffff80000c7cb320 [ 50.095821] x14: 0000000000000001 x13: 2e656572662d7265 x12: 7466612d65737520 [ 50.095823] x11: 00000000ffffefff x10: ffffb4d9850cebf0 x9 : ffffb4d9835cf954 [ 50.095826] x8 : 0000000000017fe8 x7 : c0000000ffffefff x6 : 0000000000057fa8 [ 50.095829] x5 : ffff16f813fe3d08 x4 : 0000000000000000 x3 : ffff621e8f4d2000 [ 50.095832] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff16ed32119040 [ 50.095835] Call trace: [ 50.095836] refcount_warn_saturate+0xf4/0x148 [ 50.095838] device_link_put_kref+0x84/0xc8 [ 50.095843] device_link_del+0x38/0x58 [ 50.095846] vfe_pm_domain_off+0x3c/0x50 [qcom_camss] [ 50.095860] vfe_put+0x114/0x140 [qcom_camss] [ 50.095869] csid_set_power+0x2c8/0x408 [qcom_camss] [ 50.095878] pipeline_pm_power_one+0x164/0x170 [videodev] [ 50.095896] pipeline_pm_power+0xc4/0x110 [videodev] [ 50.095909] v4l2_pipeline_pm_use+0x5c/0xa0 [videodev] [ 50.095923] v4l2_pipeline_pm_get+0x1c/0x30 [videodev] [ 50.095937] video_open+0x7c/0x100 [qcom_camss] [ 50.095945] v4l2_open+0x84/0x130 [videodev] [ 50.095960] chrdev_open+0xc8/0x250 [ 50.095964] do_dentry_open+0x1bc/0x498 [ 50.095966] vfs_open+0x34/0x40 [ 50.095968] path_openat+0xb44/0xf20 [ 50.095971] do_filp_open+0xa4/0x160 [ 50.095974] do_sys_openat2+0xc8/0x188 [ 50.095975] __arm64_sys_openat+0x6c/0xb8 [ 50.095977] invoke_syscall+0x50/0x128 [ 50.095982] el0_svc_common.constprop.0+0x4c/0x100 [ 50.095985] do_el0_svc+0x40/0xa8 [ 50.095988] el0_svc+0x2c/0x88 [ 50.095991] el0t_64_sync_handler+0xf4/0x120 [ 50.095994] el0t_64_sync+0x190/0x198 [ 50.095996] ---[ end trace 0000000000000000 ]--- Fixes: 779096916dae ("media: camss: vfe: Fix runtime PM imbalance on error") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit f69791c39745e64621216fe8919cb73c0065002b Author: Bryan O'Donoghue Date: Wed Aug 30 16:16:08 2023 +0100 media: qcom: camss: Fix genpd cleanup Right now we never release the power-domains properly on the error path. Add a routine to be reused for this purpose and appropriate jumps in probe() to run that routine where necessary. Fixes: 2f6f8af67203 ("media: camss: Refactor VFE power domain toggling") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil commit b278080a89f452063915beda0ade6b3ed5ee4271 Author: Bryan O'Donoghue Date: Wed Aug 30 16:16:07 2023 +0100 media: qcom: camss: Fix V4L2 async notifier error path Previously the jump label err_cleanup was used higher in the probe() function to release the async notifier however the async notifier registration was moved later in the code rendering the previous four jumps redundant. Rename the label from err_cleanup to err_v4l2_device_unregister to capture what the jump does. Fixes: 51397a4ec75d ("media: qcom: Initialise V4L2 async notifier later") Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil [hverkuil: fix old name in commit log: err_v4l2_device_register -> err_v4l2_device_unregister] commit 7405116519ad70b8c7340359bfac8db8279e7ce4 Author: Bryan O'Donoghue Date: Wed Aug 30 16:16:06 2023 +0100 media: qcom: camss: Fix pm_domain_on sequence in probe We need to make sure camss_configure_pd() happens before camss_register_entities() as the vfe_get() path relies on the pointer provided by camss_configure_pd(). Fix the ordering sequence in probe to ensure the pointers vfe_get() demands are present by the time camss_register_entities() runs. In order to facilitate backporting to stable kernels I've moved the configure_pd() call pretty early on the probe() function so that irrespective of the existence of the old error handling jump labels this patch should still apply to -next circa Aug 2023 to v5.13 inclusive. Fixes: 2f6f8af67203 ("media: camss: Refactor VFE power domain toggling") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil commit 16fdcec8080cc85df05ab97cb330eb96f3f2cd84 Author: Fabio Estevam Date: Mon Sep 25 09:44:02 2023 -0300 dt-bindings: gpio: fsl-imx-gpio: Document imx25 and imx27 fsl,imx25-gpio and fsl,imx27-gpio are not documented, causing schema warnings. fsl,imx25-gpio is compatible with fsl,imx35-gpio and fsl,imx27-gpio is compatible with fsl,imx21-gpio. Document them accordingly. Signed-off-by: Fabio Estevam Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit 3feb70a61740817c1b0d940ee46f1a51881e2a71 Author: Yinbo Zhu Date: Thu Sep 21 09:52:47 2023 +0800 gpio: loongson: add more gpio chip support This patch was to add loongson 2k0500, 2k2000 and 3a5000 gpio chip driver support and define inten_offset attibute to enable gpio chip interrupt. Signed-off-by: Yinbo Zhu Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 1b83a90bd11aa1e686a87fb16732a41dcaa40548 Author: Yinbo Zhu Date: Thu Sep 21 09:52:46 2023 +0800 gpio: dt-bindings: add more loongson gpio chip support This patch was to add loongson 2k0500, 2k2000 and 3a5000 gpio chip dt-bindings support in yaml file. Signed-off-by: Yinbo Zhu Reviewed-by: Linus Walleij Reviewed-by: Conor Dooley Signed-off-by: Bartosz Golaszewski commit aa01dd7bc100af0bd230fc498d4a5750d0be73b2 Author: Luca Weiss Date: Wed Aug 30 11:58:34 2023 +0200 cpufreq: Add QCM6490 to cpufreq-dt-platdev blocklist The Qualcomm QCM6490 platform uses the qcom-cpufreq-hw driver, so add it to the cpufreq-dt-platdev driver's blocklist. Signed-off-by: Luca Weiss Signed-off-by: Viresh Kumar commit bae8222a6c291dbe58c908dab5c2abd3a75d0d63 Author: Sumit Gupta Date: Tue Aug 29 14:13:22 2023 +0530 cpufreq: tegra194: fix warning due to missing opp_put Fix the warning due to missing dev_pm_opp_put() call and hence wrong refcount value. This causes below warning message when trying to remove the module. Call trace: dev_pm_opp_put_opp_table+0x154/0x15c dev_pm_opp_remove_table+0x34/0xa0 _dev_pm_opp_cpumask_remove_table+0x7c/0xbc dev_pm_opp_of_cpumask_remove_table+0x10/0x18 tegra194_cpufreq_exit+0x24/0x34 [tegra194_cpufreq] cpufreq_remove_dev+0xa8/0xf8 subsys_interface_unregister+0x90/0xe8 cpufreq_unregister_driver+0x54/0x9c tegra194_cpufreq_remove+0x18/0x2c [tegra194_cpufreq] platform_remove+0x24/0x74 device_remove+0x48/0x78 device_release_driver_internal+0xc8/0x160 driver_detach+0x4c/0x90 bus_remove_driver+0x68/0xb8 driver_unregister+0x2c/0x58 platform_driver_unregister+0x10/0x18 tegra194_ccplex_driver_exit+0x14/0x1e0 [tegra194_cpufreq] __arm64_sys_delete_module+0x184/0x270 Fixes: f41e1442ac5b ("cpufreq: tegra194: add OPP support and set bandwidth") Signed-off-by: Sumit Gupta [ Viresh: Add a blank line ] Signed-off-by: Viresh Kumar commit ff2cbd758d5c1ad9c1782100c3ea9721811f95b2 Author: Linus Walleij Date: Sat Sep 23 18:02:28 2023 +0200 gpio: Rewrite IXP4xx GPIO bindings in schema This rewrites the IXP4xx GPIO bindings to use YAML schema, and adds two new properties to enable fixed clock output on pins 14 and 15. Reviewed-by: Rob Herring Signed-off-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit bb2e04d4499c611382aeb75063cf7f185cf20197 Author: Yang Jihong Date: Sat Sep 23 09:30:37 2023 +0000 perf bench messaging: Kill child processes when exit abnormally in process mode When exit abnormally in process mode, customize SIGINT and SIGTERM signal handler to kill the forked child processes. Before: # perf bench sched messaging -l 1000000 -g 1 & [1] 8519 # # Running 'sched/messaging' benchmark: # pgrep sched-messaging | wc -l 41 # kill -15 8519 [1]+ Terminated perf bench sched messaging -l 1000000 -g 1 # pgrep sched-messaging | wc -l 40 After: # perf bench sched messaging -l 1000000 -g 1 & [1] 8472 # # Running 'sched/messaging' benchmark: # pgrep sched-messaging | wc -l 41 # kill -15 8472 [1]+ Exit 1 perf bench sched messaging -l 1000000 -g 1 # pgrep sched-messaging | wc -l 0 Signed-off-by: Yang Jihong Reviewed-by: Ian Rogers Link: https://lore.kernel.org/r/20230923093037.961232-5-yangjihong1@huawei.com [ namhyung: fix a whitespace ] Signed-off-by: Namhyung Kim commit 07f3e6cf8581bcfe9f1bd4540768bc202983349f Author: Yang Jihong Date: Sat Sep 23 09:30:36 2023 +0000 perf bench messaging: Store chlid process pid when creating worker for process mode To save pid of child processes when creating worker: 1. The messaging worker is changed to `union` type to store thread id and process pid. 2. Save child process pid in create_process_worker(). 3. Rename `pth_tab` as `work_tab`. Test result: # perf bench sched messaging # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 6.744 [sec] # perf bench sched messaging -t # Running 'sched/messaging' benchmark: # 20 sender and receiver threads per group # 10 groups == 400 threads run Total time: 5.788 [sec] Signed-off-by: Yang Jihong Reviewed-by: Ian Rogers Link: https://lore.kernel.org/r/20230923093037.961232-4-yangjihong1@huawei.com Signed-off-by: Namhyung Kim commit 5d2050453d489595ffa9491e05964e85c1927f35 Author: Yang Jihong Date: Sat Sep 23 09:30:35 2023 +0000 perf bench messaging: Factor out create_worker() Refactor the create_worker() helper: 1. Modify the return value and use pthread pointer as a parameter to facilitate value assignment in create_worker(). 2. The thread worker creation and process worker creation are abstracted into independent helpers. No functional change. Test result: # perf bench sched messaging # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 6.332 [sec] # perf bench sched messaging -t # Running 'sched/messaging' benchmark: # 20 sender and receiver threads per group # 10 groups == 400 threads run Total time: 5.545 [sec] Signed-off-by: Yang Jihong Reviewed-by: Ian Rogers Link: https://lore.kernel.org/r/20230923093037.961232-3-yangjihong1@huawei.com Signed-off-by: Namhyung Kim commit 8870261a70942ba7feee85c0f9a24c68c307af68 Author: Yang Jihong Date: Sat Sep 23 09:30:34 2023 +0000 perf bench messaging: Fix coding style issues for sched-messaging Fixed several code style issues in sched-messaging: 1. Use one space around "-" and "+" operators. 2. When a long line is broken, the operator is at the end of the line. Signed-off-by: Yang Jihong Reviewed-by: Ian Rogers Link: https://lore.kernel.org/r/20230923093037.961232-2-yangjihong1@huawei.com Signed-off-by: Namhyung Kim commit cefff1f33d2357102f83b99457fd4f9e2ff4eda2 Author: Athira Rajeev Date: Thu Sep 7 22:45:40 2023 +0530 tests/shell: Fix shellcheck warnings for SC2153 in multiple scripts Running shellcheck on some of the shell scripts, throws below warning on shellcheck v0.6. Example: In tests/shell/coresight/asm_pure_loop.sh line 14: DATA="$DATD/perf-$TEST-$DATV.data" ^---^ SC2153: Possible misspelling: DATD may not be assigned, but DATA is. Here, DATD is exported from "lib/coresight.sh" and this warning can be ignored. Use "shellcheck disable=" to ignore this check. Signed-off-by: Athira Rajeev Tested-by: Ian Rogers Reviewed-by: Kajol Jain Cc: maddy@linux.ibm.com Cc: disgoel@linux.vnet.ibm.com Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230907171540.36736-4-atrajeev@linux.vnet.ibm.com Signed-off-by: Namhyung Kim commit 55312ca7527e018c5ceacc4e311ac201c8bca90d Author: Athira Rajeev Date: Thu Sep 7 22:45:39 2023 +0530 tests/shell: Fix shellcheck issues in tests/shell/stat+shadow_stat.sh tetscase Running shellcheck on stat+shadow_stat.sh generates below warning In tests/shell/stat+csv_summary.sh line 26: while read _num _event _run _pct ^--^ SC2034: _num appears unused. Verify use (or export if used externally). ^----^ SC2034: _event appears unused. Verify use (or export if used externally). ^--^ SC2034: _run appears unused. Verify use (or export if used externally). ^--^ SC2034: _pct appears unused. Verify use (or export if used externally). This variable is intentionally unused since it is needed to parse through the output. commit used "_" as a prefix for this throw away variable. But this stil shows warning with shellcheck v0.6. Fix this by only using "_" instead of prefix and variable name. Signed-off-by: Athira Rajeev Tested-by: Ian Rogers Reviewed-by: Kajol Jain Cc: maddy@linux.ibm.com Cc: disgoel@linux.vnet.ibm.com Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230907171540.36736-3-atrajeev@linux.vnet.ibm.com Signed-off-by: Namhyung Kim commit 35de80c709d730987c9a13911f836fbd92c5d1c5 Author: Athira Rajeev Date: Thu Sep 7 22:45:38 2023 +0530 tests/shell: Fix shellcheck SC1090 to handle the location of sourced files Running shellcheck on some of the shell scripts throws below error: In tests/shell/coresight/unroll_loop_thread_10.sh line 8: . "$(dirname $0)"/../lib/coresight.sh ^-- SC1090: Can't follow non-constant source. Use a directive to specify location. This happens on shellcheck version "0.6.0". Fix shellcheck warning for SC1090 using "shellcheck source="i option to mention the location of sourced files. Signed-off-by: Athira Rajeev Tested-by: Ian Rogers Reviewed-by: Kajol Jain Cc: maddy@linux.ibm.com Cc: disgoel@linux.vnet.ibm.com Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230907171540.36736-2-atrajeev@linux.vnet.ibm.com Signed-off-by: Namhyung Kim commit cd0f9e3f7e046c253a23a728cb7953819cff1541 Author: Colin Ian King Date: Mon Sep 25 06:50:37 2023 +0100 perf kwork: Fix spelling mistake "Captuer" -> "Capture" There is a spelling mistake in a pr_debug message. Fix it. (I didn't see this one in the first spell check scan I ran). Signed-off-by: Colin Ian King Reviewed-by: Ian Rogers Cc: kernel-janitors@vger.kernel.org Link: https://lore.kernel.org/r/20230925055037.18089-1-colin.i.king@gmail.com Signed-off-by: Namhyung Kim commit f9cdeb58a9cf46c09b56f5f661ea8da24b6458c3 Author: Ian Rogers Date: Fri Sep 15 20:56:40 2023 -0700 perf evlist: Avoid frequency mode for the dummy event Dummy events are created with an attribute where the period and freq are zero. evsel__config will then see the uninitialized values and initialize them in evsel__default_freq_period. As fequency mode is used by default the dummy event would be set to use frequency mode. However, this has no effect on the dummy event but does cause unnecessary timers/interrupts. Avoid this overhead by setting the period to 1 for dummy events. evlist__add_aux_dummy calls evlist__add_dummy then sets freq=0 and period=1. This isn't necessary after this change and so the setting is removed. From Stephane: The dummy event is not counting anything. It is used to collect mmap records and avoid a race condition during the synthesize mmap phase of perf record. As such, it should not cause any overhead during active profiling. Yet, it did. Because of a bug the dummy event was programmed as a sampling event in frequency mode. Events in that mode incur more kernel overheads because on timer tick, the kernel has to look at the number of samples for each event and potentially adjust the sampling period to achieve the desired frequency. The dummy event was therefore adding a frequency event to task and ctx contexts we may otherwise not have any, e.g., perf record -a -e cpu/event=0x3c,period=10000000/. On each timer tick the perf_adjust_freq_unthr_context() is invoked and if ctx->nr_freq is non-zero, then the kernel will loop over ALL the events of the context looking for frequency mode ones. In doing, so it locks the context, and enable/disable the PMU of each hw event. If all the events of the context are in period mode, the kernel will have to traverse the list for nothing incurring overhead. The overhead is multiplied by a very large factor when this happens in a guest kernel. There is no need for the dummy event to be in frequency mode, it does not count anything and therefore should not cause extra overhead for no reason. Fixes: 5bae0250237f ("perf evlist: Introduce perf_evlist__new_dummy constructor") Reported-by: Stephane Eranian Signed-off-by: Ian Rogers Acked-by: Adrian Hunter Cc: Yang Jihong Cc: Kan Liang Link: https://lore.kernel.org/r/20230916035640.1074422-1-irogers@google.com Signed-off-by: Namhyung Kim commit c87b8cc816da05d0a4d7e0696bb62909c8592809 Author: Charles Han Date: Mon Sep 18 11:36:23 2023 +0800 perf vendors events: Remove repeated word in comments Remove the repeated word "of" in comments. Signed-off-by: Charles Han Reviewed-by: Ian Rogers Cc: james.clark@arm.com Cc: nick.forrington@arm.com Cc: leo.yan@linaro.org Cc: mike.leach@linaro.org Cc: john.g.garry@oracle.com Cc: ilkka@os.amperecomputing.com Link: https://lore.kernel.org/r/20230918033623.159213-1-hanchunchao@inspur.com Signed-off-by: Namhyung Kim commit 59faeaf80d0239412056c4495cc49097e9cea4da Author: Ilkka Koskinen Date: Tue Sep 19 23:18:39 2023 -0700 perf vendor events arm64: Fix for AmpereOne metrics This patch addresses review comments that were given for 705ed549148f ("perf vendor events arm64: Add AmpereOne metrics") but didn't make it to the original patch [1][2] Changes include: A fix for backend_memory formula, use of standard metrics when possible, using #slots, renaming metrics to avoid spaces in the names, and cleanup. [1] https://lore.kernel.org/linux-perf-users/e9bdacb-a231-36af-6a2e-6918ee7effa@os.amperecomputing.com/ [2] https://lore.kernel.org/linux-perf-users/20230826192352.3043220-1-ilkka@os.amperecomputing.com/ Fixes: 705ed549148f ("perf vendor events arm64: Add AmpereOne metrics") Signed-off-by: Ilkka Koskinen Reviewed-by: Ian Rogers Cc: James Clark Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Dave Kleikamp Cc: John Garry Cc: D Scott Phillips Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230920061839.2437413-1-ilkka@os.amperecomputing.com Signed-off-by: Namhyung Kim commit 078a2ead544c56fbe6a3bed8cc90b5151a328b81 Author: Justin Stitt Date: Tue Sep 12 21:03:50 2023 +0000 selftests/rseq: fix kselftest Clang build warnings When building with Clang, I am getting many warnings from the selftests/rseq tree. Here's one such example from rseq tree: | param_test.c:1234:10: error: address argument to atomic operation must be a pointer to _Atomic type ('intptr_t *' (aka 'long *') invalid) | 1234 | while (!atomic_load(&args->percpu_list_ptr)) {} | | ^ ~~~~~~~~~~~~~~~~~~~~~~ | /usr/local/google/home/justinstitt/repos/tc-build/build/llvm/final/lib/clang/18/include/stdatomic.h:140:29: note: expanded from macro 'atomic_load' | 140 | #define atomic_load(object) __c11_atomic_load(object, __ATOMIC_SEQ_CST) | | ^ ~~~~~~ Use compiler builtins `__atomic_load_n()` and `__atomic_store_n()` with accompanying __ATOMIC_ACQUIRE and __ATOMIC_RELEASE, respectively. This will fix the warnings because the compiler builtins do not expect their arguments to have _Atomic type. This should also make TSAN happier. Link: https://github.com/ClangBuiltLinux/linux/issues/1698 Link: https://github.com/ClangBuiltLinux/continuous-integration2/issues/61 Suggested-by: Mathieu Desnoyers Signed-off-by: Justin Stitt Reviewed-by: Mathieu Desnoyers Signed-off-by: Shuah Khan commit 18378b0e49d97719467ce9b098aa859b1b750bb4 Author: Juntong Deng Date: Tue Sep 26 04:35:52 2023 +0800 selftests/damon: Add executable permission to test scripts When running the test for the damon subsystem, there are a lot of warnings because test scripts do not have executable permission, for example: Warning: file debugfs_attrs.sh is not executable Warning: file debugfs_schemes.sh is not executable Warning: file debugfs_target_ids.sh is not executable ... This patch adds executable permission to test scripts to eliminate these warnings. Signed-off-by: Juntong Deng Reviewed-by: SeongJae Park Signed-off-by: Shuah Khan commit 90295cf73b6a3fe6c31f2f805a814ec2741e2499 Author: Mario Limonciello Date: Mon Sep 25 14:51:23 2023 -0500 drm/amd: Drop error message about failing to load DMUB firmware The error path for DMUB firmware loading is unnecessarily noisy. When a firmware is missing 3 errors show up: ``` amdgpu 0000:07:00.0: Direct firmware load for amdgpu/green_sardine_dmcub.bin failed with error -2 [drm:dm_early_init [amdgpu]] *ERROR* DMUB firmware loading failed: -19 [drm:amdgpu_device_init [amdgpu]] *ERROR* early_init of IP block failed -19 ``` The error code for the device init is bubbled up already, remove the second one. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit eb3c357bcb286e89386e89302061fe717fe4e562 Author: Philip Yang Date: Wed Sep 13 10:10:23 2023 -0400 drm/amdkfd: Handle errors from svm validate and map If new range is splited to multiple pranges with max_svm_range_pages alignment and added to update_list, svm validate and map should keep going after error to make sure prange->mapped_to_gpu flag is up to date for the whole range. svm validate and map update set prange->mapped_to_gpu after mapping to GPUs successfully, otherwise clear prange->mapped_to_gpu flag (for update mapping case) instead of setting error flag, we can remove the redundant error flag to simpliy code. Refactor to remove goto and update prange->mapped_to_gpu flag inside svm_range_lock, to guarant we always evict queues or unmap from GPUs if there are invalid ranges. After svm validate and map return error -EAGIN, the caller retry will update the mapping for the whole range again. Fixes: c22b04407097 ("drm/amdkfd: flag added to handle errors from svm validate and map") Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Tested-by: James Zhu Signed-off-by: Alex Deucher commit 21e43386aec839faf00b71b4684cc72eb649a0f5 Author: Le Ma Date: Thu Sep 7 15:50:14 2023 +0800 drm/amd/pm: add xgmi_plpd_policy sysfs node for user to change plpd policy Add xgmi_plpd_policy sysfs node for users to check and select xgmi per-link power down policy: - arg 0: disallow plpd - arg 1: default policy - arg 2: optimized policy v2: split from smu v13.0.6 code and miscellaneous updates v3: add usage comments around set/get functions Signed-off-by: Le Ma Reviewed-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit d07f1c20dd7c5d94cb7eceb822a060c108e49d23 Author: Le Ma Date: Thu Sep 7 15:32:13 2023 +0800 drm/amd/pm: add xgmi plpd mode selecting interface for smu v13.0.6 Add the interface to change xgmi per-link power down policy. v2: split from sysfs interface code and miscellaneous updates v3: check against XGMI_PLPD_DEFAULT/XGMI_PLPD_OPTIMIZED and pass PPSMC param Signed-off-by: Le Ma Reviewed-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 10d9ee96ce058eea6b9bb670d2dff69694bb99d4 Author: Le Ma Date: Tue Aug 29 19:38:48 2023 +0800 drm/amd/pm: add plpd_mode in smu_context to indicate current mode Add enum pp_xgmi_plpd_mode to describe PLPD policies. v2: move the enum from amdgpu_smu.h to kgd_pp_interface.h Signed-off-by: Le Ma Reviewed-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit ca2ce4cc080e197b0374099b3e4b98bb14d4f273 Author: Le Ma Date: Fri Sep 15 16:21:18 2023 +0800 drm/amd/pm: update pmfw headers for version 85.73.0 To add message to select PLPD mode. Signed-off-by: Le Ma Reviewed-by: Asad Kamal Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit e1133ac8117672c22c904db52ad2f9995da044b9 Author: Juntong Deng Date: Sun Sep 24 21:00:26 2023 +0100 drm/amdgpu: Add description for AMD_IP_BLOCK_TYPE_VPE AMD_IP_BLOCK_TYPE_VPE is a new IP BLOCK type for Video Processing Engine, but currently lacks description. Fix the documentation warning: warning: Enum value 'AMD_IP_BLOCK_TYPE_VPE' not described in enum 'amd_ip_block_type' Signed-off-by: Juntong Deng Reviewed-by: Lang Yu Acked-by: Christian König Signed-off-by: Alex Deucher commit 1ca965719b5bff60a7fcf489f38313ca237a7d77 Author: Mario Limonciello Date: Mon Sep 25 12:57:47 2023 -0500 drm/amd/display: Change dc_set_power_state() to bool instead of int DC code is reused by other OSes and so Linux return codes don't make sense. Change dc_set_power_state() to boolean and add a wrapper dm_set_power_state() to return a Linux error code for the memory allocation failure. Suggested-by: Harry Wentland Signed-off-by: Mario Limonciello Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit b2e1cbe6281feb880dbfbee47aa6defee4227cf0 Author: Alex Deucher Date: Thu Sep 21 09:44:34 2023 -0400 drm/amdgpu/gmc11: disable AGP on GC 11.5 AGP aperture is deprecated and no longer functional. v2: fix typo (Alex) v3: just skip the agp setup call v4: revert back to the original model v5: back to v3 Reviewed-by: Christian König Signed-off-by: Alex Deucher commit fa1f1cc09d588a90c8ce3f507c47df257461d148 Author: David (Ming Qiang) Wu Date: Thu Sep 14 16:34:08 2023 -0400 drm/amdgpu: not to save bo in the case of RAS err_event_athub err_event_athub will corrupt VCPU buffer and not good to be restored in amdgpu_vcn_resume() and in this case the VCPU buffer needs to be cleared for VCN firmware to work properly. Acked-by: Leo Liu Signed-off-by: David (Ming Qiang) Wu Signed-off-by: Alex Deucher commit 9ed630c5c4b3d3d6e333ae629c1a9c4be6745f74 Author: Luben Tuikov Date: Fri Sep 22 17:21:21 2023 -0400 drm/amdgpu: Fix a memory leak Fix a memory leak in amdgpu_fru_get_product_info(). Cc: Alex Deucher Reported-by: Yang Wang Fixes: 0dbf2c562625 ("drm/amdgpu: Interpret IPMI data for product information (v2)") Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 7441ef0b3ebe11ee46db82f7f7eee0f68b35e192 Author: Mario Limonciello Date: Thu Sep 21 09:50:04 2023 -0500 drm/amd: Propagate failures in dc_set_power_state() During the suspend process dc_set_power_state() will use kzalloc to allocate memory, but this potentially fails with memory pressure. If it fails, the suspend should be aborted. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362 Signed-off-by: Mario Limonciello Reviewed-by: Christian König Cc: Harry.Wentland@amd.com Signed-off-by: Alex Deucher commit 41801c6b3042e2813365ee4def3f2804fd77776a Author: Melissa Wen Date: Fri Jul 21 12:24:31 2023 -0100 drm/amd/display: set stream gamut remap matrix to MPC for DCN3+ dc->caps.color.mpc.gamut_remap says there is a post-blending color block for gamut remap matrix for DCN3 HW family and newer versions. However, those drivers still follow DCN10 programming that remap stream gamut_remap_matrix to DPP (pre-blending). To enable pre-blending and post-blending gamut_remap matrix supports at the same time, set stream gamut_remap to MPC and plane gamut_remap to DPP for DCN families that support both. It was tested using IGT KMS color tests for DRM CRTC CTM property and it preserves test results. Signed-off-by: Melissa Wen Signed-off-by: Harry Wentland Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit de59b69932e64d77445d973a101d81d6e7e670c6 Author: Alex Deucher Date: Wed Sep 20 13:27:58 2023 -0400 drm/amdgpu/gmc: set a default disable value for AGP To disable AGP, the start needs to be set to a higher value than the end. Set a default disable value for the AGP aperture and allow the IP specific GMC code to enable it selectively be calling amdgpu_gmc_agp_location(). Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 29495d81457a483c2859ccde59cc063034bfe47d Author: Alex Deucher Date: Wed Sep 20 13:07:00 2023 -0400 drm/amdgpu/gmc6-8: properly disable the AGP aperture The BOT register needs to be larger than the TOP register for this to be properly disabled. The lower 22 bits of the BOT address are always 0 and the lower 22 bits of the TOP register are always 1 so you need to make the upper bits of BOT larger than the upper bits of BOT. Reviewed-by: Christian König Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit cd956e7531281fba1b7cbb97e5cb55c99701f0c6 Author: Mangesh Gadre Date: Fri Sep 22 13:16:00 2023 +0800 drm/amdgpu:Expose physical id of device in XGMI hive This identifies the physical ordering of devices in the hive v2: fix compilation issue Signed-off-by: Mangesh Gadre Reviewed-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit be5a3fdc8b2c169c330233821383748207d9970e Author: Alvin Lee Date: Thu Sep 14 11:40:31 2023 -0400 drm/amd/display: Break after finding supported vlevel for repopulate [Description] After repopulating pipes for a split / merge, we want to find the lowest vlevel that supports the desired mpc combine level. Reviewed-by: Nevenko Stupar Reviewed-by: Dillon Varone Reviewed-by: Aric Cyr Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 40de8403b998020a7bf3e356ef64feefa77f096b Author: Hong-lu Cheng Date: Thu Sep 14 11:32:56 2023 -0400 drm/amd/display: Update OPP counter from new interface [Description] Change to new interface for notifying OS of cursor support changes Reviewed-by: Gang Chu Reviewed-by: Jaina Han Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Hong-lu Cheng Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5fad7d8cc4d425524f39cc7202a8211184ac4657 Author: Max Tseng Date: Fri Sep 8 15:31:33 2023 +0800 drm/amd/display: augment display clock in dc_cap structure [Why] Allow dc report maximum display clock possible at vmin Reviewed-by: Wayne Lin Acked-by: Wayne Lin Signed-off-by: Max Tseng Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b308e6f3af1cb27dd710ff781c0637fa34de4eed Author: Aric Cyr Date: Sun Sep 17 23:50:49 2023 -0400 drm/amd/display: 3.2.253 This version brings along the following: - Fix incorrect odm change detection logic - Add primary pipe check when building slice table for dcn3x - Add get primary dpp pipe resource interface - Add missing function pointer for DCN321 resource - Rename DisableMinDispClkODM in dc_config - Break after finding supported vlevel for repopulate - Update OPP counter from new interface - Augment display clock in dc_cap structure - Improve code style on bios_parser2 - Skip audio config for virtual signal - Block MPO if it prevents pstate support - Fix DP2.0 timing sync - Improve x86 and dmub ips handshake - Remove guaranteed viewports limitation for odm - Add new windowed mpo odm minimal transition sequence - Reset stream slice count for new ODM policy - Determine fast update only before commit minimal transition state - Remove unused mmhub_reg_offsets Acked-by: Wayne Lin Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d849434977a8a5926c449c761fa9869071091f6a Author: Wenjing Liu Date: Thu Sep 14 12:42:50 2023 -0400 drm/amd/display: fix incorrect odm change detection logic [why] The current ODM change detection only compares first two ODM slices. If there are 4 ODM slices and the change is within the last two slices, the logic fails to detect ODM change and cause us to skip ODM programming unexpectedly. [how] Add a is ODM topology changed resource interface to check any ODM topology changes with a more generic method. Reviewed-by: Dillon Varone Acked-by: Wayne Lin Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit df475cced6af357304e8959df2ce740992aa0dec Author: Wenjing Liu Date: Thu Sep 14 11:55:02 2023 -0400 drm/amd/display: add primary pipe check when building slice table for dcn3x [why] There is a corner use case where the same plane pointer can be added into dc state twice. In addition to plane state pointer check we also need to match primary pipe before identifying the same plane. Reviewed-by: Dillon Varone Acked-by: Wayne Lin Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 173db0c8b7664892fee343e5a605197962fc3ca8 Author: Wenjing Liu Date: Mon Sep 11 17:28:26 2023 -0400 drm/amd/display: add get primary dpp pipe resource interface [why] Need to have a helper function to find the primary dp pipe of the plane associated with a dpp pipe Reviewed-by: Dillon Varone Acked-by: Wayne Lin Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit cd1baa1f6aa307e5829b3e6c7512ec61d2b8bfb3 Author: Wenjing Liu Date: Mon Sep 11 17:25:58 2023 -0400 drm/amd/display: add missing function pointer for DCN321 resource [why] acquire_free_pipe_as_secondary_opp_head function pointer is not assigned. This causes ODM mode to be disabled after enabling windowed MPO ODM capability on DCN321. [how] assign the correct function to the function pointer. Reviewed-by: Dillon Varone Acked-by: Wayne Lin Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 99c1673fd14797591d11126dd093313e8aed466c Author: Gabe Teeger Date: Thu Sep 14 16:00:16 2023 -0400 drm/amd/display: Rename DisableMinDispClkODM in dc_config [what and why] The logic for DisableMinDispClkODM is reversed now that odm is disabled by default. Renaming to EnableMinDispClkODM. Reviewed-by: Charlene Liu Acked-by: Wayne Lin Signed-off-by: Gabe Teeger Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7021b397c684c624800b464dbd3a2f9d945a56a3 Author: Lang Yu Date: Fri Sep 22 09:23:14 2023 +0800 drm/amdgpu/vpe: fix truncation warnings Fix truncation warnings. Fixes: 9d4346bdbc64 ("drm/amdgpu: add VPE 6.1.0 support") Signed-off-by: Lang Yu Reviewed-by: Yifan Zhang Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202309200028.aUVuM8os-lkp@intel.com Signed-off-by: Alex Deucher commit fc105f2a80e548c6c235790feae7611dc0e83991 Author: Rodrigo Siqueira Date: Tue Sep 12 15:18:00 2023 -0600 drm/amd/display: Improve code style on bios_parser2 bios_parser2 uses space instead of tabs in multiple areas; this commit converts those spaces into tabs. It also removes some other small details. Reviewed-by: Aurabindo Pillai Acked-by: Wayne Lin Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0e859faf8670a78ce206977dcf1a31a0231e9ca5 Author: Alex Hung Date: Fri Aug 25 13:21:28 2023 -0600 drm/amd/display: Remove unwanted drm edid references [WHY] edid_override and drm_edid_override_connector_update, according to drm documentation, should not be referred outside drm_edid. [HOW] Remove and replace them accordingly. This can tested by IGT's kms_hdmi_inject test. Reviewed-by: Harry Wentland Acked-by: Jani Nikula Signed-off-by: Alex Hung Signed-off-by: Alex Deucher commit 5d72e247e58c966f4e50cffebf0d414de7fc90ed Author: Hamza Mahfooz Date: Wed Sep 20 13:38:11 2023 -0400 drm/amd/display: switch DC over to the new DRM logging macros For multi-GPU systems it is difficult to tell which GPU a particular message is being printed for and that is undesirable because it complicates debugging efforts. Also, the new macros allow us to enable logging for particular parts of the codebase more selectively (since we no longer need to throw everything at DRM_DEBUG_KMS()). So, for the reasons outlined above we should switch to the new macros. We can accomplish this by using the existing DC_LOGGER code to pass around the relevant `struct drm_device` which will be fed to the new macros in logger_types.h. Also, we must get rid of all instances of the DC_LOG_.*() functions that are currently in amdgpu_dm since we don't use the DC logger there and we can simply refer to the macros directly there instead. Reviewed-by: Rodrigo Siqueira Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit a73d4e88db772d7955f99cc62b104f84d5ea06c3 Author: Alex Hung Date: Tue Sep 12 17:43:02 2023 -0600 drm/amd/display: skip audio config for virtual signal [WHY & HOW] IGT's kms_hdmi_inject (subtest inject_audio) triggers a warning message from dce_aud_az_configure. This can be fixed by checking Virtual signal that does not need to configure AZ audio since it does not have any. Reviewed-by: Rodrigo Siqueira Acked-by: Wayne Lin Signed-off-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f7f9e48fa8d53159b6d27d2a809031c7718a305d Author: Ma Jun Date: Thu Sep 7 15:33:12 2023 +0800 drm/amd/pm: Add reset option for fan_curve on smu13_0_0 Add reset option for fan_curve. User can use command "echo r > fan_cure" to reset the fan_curve to boot value Signed-off-by: Ma Jun Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 072ae240cd113978657037f3fb701e9efaf6da9b Author: Dmytro Laktyushkin Date: Mon Sep 11 09:56:45 2023 -0400 drm/amd/display: block MPO if it prevents pstate support This change adds a method to block mpo when it would cause us to exit pstate support. We should block mpo by default where MPO causes issues by preventing pstate change. Reviewed-by: Jun Lei Reviewed-by: Aric Cyr Acked-by: Wayne Lin Signed-off-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ce74bece80a914deb118bb0a0511a16ad344ffd2 Author: Ilya Bakoulin Date: Thu Sep 7 14:03:15 2023 -0400 drm/amd/display: Fix DP2.0 timing sync [Why] Triggering OTG sync before all OTG/HPO clock programming is complete causes timing sync to fail and a subsequent P-state hang. [How] Move DTB clock programming earlier in the sequence to enable_stream_timing. Reviewed-by: Ariel Bernstein Acked-by: Wayne Lin Signed-off-by: Ilya Bakoulin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1288d702080949f87688d49dfeeacc99f40adc9b Author: Duncan Ma Date: Mon Aug 28 15:48:27 2023 -0400 drm/amd/display: Improve x86 and dmub ips handshake [Why] There is a race condition between x86 and dmcub fw when attempting to exit IPS2. Scenarios including exiting IPS2 before IPS2 has been entered. This can cause unexpected hang when DMCUB attempt to exit while PMFW still tries to enter IPS2. [How] A new design has been introduced to remove race conditions and improve the handshake between x86 and DMCUB. An AON scratch register is borrowed from PMFW to determine whether DMCUB has committed to IPS entry or not. In the case when dmcub has committed IPS entry, x86 must poll until an exit event occurred either from DMCUB(IPS1) or PMFW(IPS2). x86 will wait upperbound of evaluation and IPS entry time to ensure IPS2 exit event has been sent to PMFW. Reviewed-by: Charlene Liu Acked-by: Wayne Lin Signed-off-by: Duncan Ma Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 786d3b1d83432d4c91468933793c25e248f26cb5 Author: Wenjing Liu Date: Thu Aug 31 14:11:09 2023 -0400 drm/amd/display: remove guaranteed viewports limitation for odm [why] With the more generic hw minimal state transition sequence, this limitation has been overcome. Reviewed-by: Aric Cyr Acked-by: Wayne Lin Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ad3b63a0d298bc94452ae2b584b99b24b7c81ecd Author: Wenjing Liu Date: Thu Aug 31 14:09:26 2023 -0400 drm/amd/display: add new windowed mpo odm minimal transition sequence [why] We do not have a programming sequence to support seamless transition between MPC combine to ODM combine when plane count remains the same. This can happen with windowed MPO ODM use cases when plane scaling is changed over ODM Combine's capability. [How] We are adding a programming sequence specifically to handle the transition between MPC combine and ODM combine during plane scaling change. Reviewed-by: Aric Cyr Acked-by: Wayne Lin Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 177ea58bef72ee84d8c692950ba51889478a7d15 Author: Wenjing Liu Date: Mon Aug 28 15:43:03 2023 -0400 drm/amd/display: reset stream slice count for new ODM policy [why] ODM combine could prevent us from supporting more planes we will reset ODM slice count back to 1 when all planes have been removed to maximize the amount of planes supported when new planes are added. [how] reset ODM slice count when all planes are removed. Reviewed-by: Aric Cyr Acked-by: Wayne Lin Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 036cf278a8257b391b4f5b919ddc668c9b1ce9a7 Author: Wenjing Liu Date: Thu Sep 7 12:14:37 2023 -0400 drm/amd/display: determine fast update only before commit minimal transition state [why] commit minimal transition state would update current state to new state with surface and stream update applied. If we determine fast update only after we have committed the minimal transition state based on new state, we will skip committing the full new state. [how] determine fast update only earlier based on the actaul currents state. Only skip full commit when the transition between actual current state and new state is fast update only. Reviewed-by: Aric Cyr Acked-by: Wayne Lin Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 08338707ccd4b8a07b565d953684af495270b41e Author: Qingqing Zhuo Date: Mon Sep 11 16:34:47 2023 -0400 drm/amd/display: remove unused mmhub_reg_offsets [Why & How] mmhub_reg_offsets never used in code. Remove it. Reviewed-by: Rodrigo Siqueira Acked-by: Wayne Lin Signed-off-by: Qingqing Zhuo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7bfaa160caed8192f8262c4638f552cad94bcf5a Author: Xiaogang Chen Date: Wed Sep 20 11:02:51 2023 -0500 drm/amdkfd: fix some race conditions in vram buffer alloc/free of svm code This patch fixes: 1: ref number of prange's svm_bo got decreased by an async call from hmm. When wait svm_bo of prange got released we shoul also wait prang->svm_bo become NULL, otherwise prange->svm_bo may be set to null after allocate new vram buffer. 2: During waiting svm_bo of prange got released in a while loop should reschedule current task to give other tasks oppotunity to run, specially the the workque task that handles svm_bo ref release, otherwise we may enter to softlock. Signed-off-by: Xiaogang.Chen Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 101b8104307eac734f2dfa4d3511430b0b631c73 Author: Philip Yang Date: Mon Sep 11 14:44:22 2023 -0400 drm/amdkfd: Move dma unmapping after TLB flush Otherwise GPU may access the stale mapping and generate IOMMU IO_PAGE_FAULT. Move this to inside p->mutex to prevent multiple threads mapping and unmapping concurrently race condition. After kfd_mem_dmaunmap_attachment is removed from unmap_bo_from_gpuvm, kfd_mem_dmaunmap_attachment is called if failed to map to GPUs, and before free the mem attachment in case failed to unmap from GPUs. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 08abccc9a7a7ff51cb10948042360448ea30d413 Author: Christian König Date: Mon Sep 4 17:41:11 2023 +0200 drm/amdgpu: further move TLB hw workarounds a layer up For the PASID flushing we already handled that at a higher layer, apply those workarounds to the standard flush as well. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit e2e3788850b9e250d6b3dee36e37ee5c73ae024c Author: Christian König Date: Mon Sep 4 16:58:45 2023 +0200 drm/amdgpu: rework lock handling for flush_tlb v2 Instead of each implementation doing this more or less correctly move taking the reset lock at a higher level. v2: fix typo Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3983c9fd2d8b5aa254f5f467604d30f977bb1a04 Author: Christian König Date: Mon Sep 4 15:50:35 2023 +0200 drm/amdgpu: drop error return from flush_gpu_tlb_pasid That function never fails, drop the error return. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 041a5743883df09386bf0cd95745b514f86473c2 Author: Christian König Date: Mon Sep 4 13:54:46 2023 +0200 drm/amdgpu: fix and cleanup gmc_v11_0_flush_gpu_tlb_pasid The same PASID can be used by more than one VMID, reset each of them. Use the common KIQ handling. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 72cc99205c0b6706b361fb27ccc62564587cadcb Author: Christian König Date: Mon Sep 4 13:24:51 2023 +0200 drm/amdgpu: cleanup gmc_v10_0_flush_gpu_tlb_pasid The same PASID can be used by more than one VMID, reset each of them. Use the common KIQ handling. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit e7b90e99fa8fd65bc37628c0ba8a7363e8757f3e Author: Christian König Date: Mon Sep 4 13:03:23 2023 +0200 drm/amdgpu: fix and cleanup gmc_v9_0_flush_gpu_tlb_pasid Testing for reset is pointless since the reset can start right after the test. The same PASID can be used by more than one VMID, invalidate each of them. Move the KIQ and all the workaround handling into common GMC code. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 0c525aa406490a779541025df83890fc54e78094 Author: Christian König Date: Fri Sep 1 15:20:39 2023 +0200 drm/amdgpu: fix and cleanup gmc_v8_0_flush_gpu_tlb_pasid Testing for reset is pointless since the reset can start right after the test. Grab the reset semaphore instead. The same PASID can be used by more than once VMID, build a mask of VMIDs to invalidate instead of just restting the first one. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Shashank Sharma Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit fb4c52db69746ee0429cedee562ce861f5392e73 Author: Christian König Date: Fri Sep 1 14:44:38 2023 +0200 drm/amdgpu: fix and cleanup gmc_v7_0_flush_gpu_tlb_pasid Testing for reset is pointless since the reset can start right after the test. Grab the reset semaphore instead. The same PASID can be used by more than once VMID, build a mask of VMIDs to invalidate instead of just restting the first one. Signed-off-by: Christian König Reviewed-by: Alex Deucher Reviewed-by: Shashank Sharma Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit a54db42ff3a05e9eb1081093bfd91be56c94f6d5 Author: Christian König Date: Fri Sep 1 14:40:18 2023 +0200 drm/amdgpu: cleanup gmc_v11_0_flush_gpu_tlb Remove leftovers from copying this from the gmc v10 code. v2: squash in fix from Yifan Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit a70cb2176f7ef6fec68c999d1f58635744125a8a Author: Christian König Date: Fri Sep 1 14:32:36 2023 +0200 drm/amdgpu: rework gmc_v10_0_flush_gpu_tlb v2 Move the SDMA workaround necessary for Navi 1x into a higher layer. v2: use dev_err Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 8c14a67bdfab8e52e016a51fb2c34d26edb520ae Author: Tao Zhou Date: Tue Sep 19 16:00:19 2023 +0800 drm/amdgpu: change if condition for bad channel bitmap update The amdgpu_ras_eeprom_control.bad_channel_bitmap is u32 type, but the channel index could be larger than 32. For the ASICs whose channel number is more than 32, the amdgpu_dpm_send_hbm_bad_channel_flag interface is not supported, so we simply bypass channel bitmap update under this condition. v2: replace sizeof with BITS_PER_TYPE, we should check bit number instead of byte number. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6205b558e1ea27aad0cff5083e8adc775afa867b Author: Tao Zhou Date: Tue Sep 19 15:57:00 2023 +0800 drm/amdgpu: fix value of some UMC parameters for UMC v12 Prepare for bad page retirement. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d82758ad4a99bf0b993dd520be6ea87db026d7c7 Author: Kenneth Feng Date: Fri Aug 11 12:25:26 2023 +0800 drm/amd/pm: add unique_id for gc 11.0.3 add unique_id for gc 11.0.3 Signed-off-by: Kenneth Feng Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher commit cac9f51d73ba4fa619af0bdc14229cc03b722270 Author: Alex Deucher Date: Wed Sep 20 09:35:32 2023 -0400 drm/amd/display: fix some style issues Fixes a few style issues: - Only calculate the dto_params and dp_hpo_inst when dccg is present. - Fix indentation - Drop empty else block Fixes: 7f7925e25828 ("drm/amd/display: Fix MST recognizes connected displays as one") Cc: Muhammad Ahmed Cc: Michel Dänzer Cc: Stylon Wang Reviewed-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit e61801f162ddcf8874c820639483ec4849b0fb0b Author: Philip Yang Date: Mon Aug 28 14:05:55 2023 -0400 drm/amdkfd: Don't use sw fault filter if retry cam enabled If retry cam enabled, we don't use sw retry fault filter and add fault into sw filter ring, so we shouldn't remove fault from sw filter. Signed-off-by: Philip Yang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 24a6eb92b7f6ce099e4d25c1d17ce398c299f389 Author: Christian König Date: Fri Sep 1 07:45:52 2023 +0200 drm/amdgpu: fix and cleanup gmc_v9_0_flush_gpu_tlb The KIQ code path was ignoring the second flush. Also avoid long lines and re-calculating the register offsets over and over again. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit f1235727ccc9058e082363d5cb1832f7812276a8 Author: Swarup Laxman Kotiaklapudi Date: Tue Sep 19 15:03:11 2023 +0530 gpu: drm: amd: display: fix kernel-doc warnings Fix kernel-doc warnings discovered in AMD gpu display driver. Fixes these warnings: ./drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h:110: warning: Function parameter or member 'overlap_only' not described in 'mpcc_blnd_cfg'. ./drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h:110: warning: Function parameter or member 'bottom_gain_mode' not described in 'mpcc_blnd_cfg'. ./drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h:110: warning: Function parameter or member 'background_color_bpc' not described in 'mpcc_blnd_cfg'. ./drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h:110: warning: Function parameter or member 'top_gain' not described in 'mpcc_blnd_cfg'. ./drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h:110: warning: Function parameter or member 'bottom_inside_gain' not described in 'mpcc_blnd_cfg'. ./drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h:110: warning: Function parameter or member 'bottom_outside_gain' not described in 'mpcc_blnd_cfg'. Tested-by: Randy Dunlap Acked-by: Randy Dunlap Signed-off-by: Swarup Laxman Kotiaklapudi Signed-off-by: Alex Deucher commit bcfb9cee61207b80f37663ffa08c135657a27ad5 Author: Philip Yang Date: Fri Sep 15 15:13:48 2023 -0400 drm/amdgpu: Increase IH soft ring size for GFX v9.4.3 dGPU On GFX v9.4.3 dGPU, applications have random timeout failure when XNACK on, dmesg log has "amdgpu: IH soft ring buffer overflow 0x900, 0x900", because dGPU mode has 272 cam entries. After increasing IH soft ring to 512 entries, no more IH soft ring overflow message and application passed. Fixes: bf80d34b6c58 ("drm/amdgpu: Increase soft IH ring size") Signed-off-by: Philip Yang Reviewed-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit c45e38f21754b7cf0043618ebc2c145a23ecccaf Author: Lijo Lazar Date: Fri Sep 8 13:41:24 2023 +0530 drm/amdgpu: Restore partition mode after reset On a full device reset, PSP FW gets unloaded. Hence restore the partition mode by placing a new request. Signed-off-by: Lijo Lazar Reviewed-by: Asad Kamal Acked-by: Alex Deucher Tested-by: Asad Kamal Signed-off-by: Alex Deucher commit f4f8a4dac0e110bb13a6620ac71aa87482f8e09d Author: Aric Cyr Date: Sun Sep 10 12:18:54 2023 -0400 drm/amd/display: 3.2.252 This version brings along the following: - Use optc32 instead of optc30 in DC - Optimize OLED T7 delay - Multiple fixes for MST, register mas, and others - Update driver and IPS interop - Improve z8 watermark mask - DCN35 updates - Enable replay for DCN35 - Temporarily disable clock gating Tested-by: Daniel Wheeler Acked-by: Rodrigo Siqueira Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 26a0e208676908888ecbf43a9c0ac27041c227f6 Author: Rodrigo Siqueira Date: Tue Sep 12 16:01:57 2023 -0600 drm/amd/display: Drop unused link FPGA code There are multiple parts of the code that DC does not use anymore, and this commit drops those dead codes. Tested-by: Daniel Wheeler Reviewed-by: Harry Wentland Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 6d1d1c7de7332b237415b0919d1b3965865d4bad Author: Muhammad Ahmed Date: Fri Sep 8 17:26:47 2023 -0400 drm/amd/display: Enable DCN low mem power by default Enable DCN low mem power by default. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Rodrigo Siqueira Signed-off-by: Muhammad Ahmed Signed-off-by: Alex Deucher commit 77d1414ddd2a14c11d0aebb424abd86512aaabf5 Author: Muhammad Ahmed Date: Wed Sep 6 20:05:11 2023 -0400 drm/amd/display: Expand DML to better support replay Update with extended blank Vstartup adjustment for replay. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Rodrigo Siqueira Signed-off-by: Muhammad Ahmed Signed-off-by: Alex Deucher commit 3d457727dad87ba2d409334d488141e5578a821d Author: Ovidiu Bunea Date: Wed Sep 6 18:03:19 2023 -0400 drm/amd/display: Use optc32 instead of optc30 in DC Change DC to use optc32, which uses REG_UPDATE instead of REG_SET. REG_SET clears OTG_H_TIMING_DIV_MODE_MANUAL which must be set to 1 in some specific HDMI configurations. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Rodrigo Siqueira Signed-off-by: Ovidiu Bunea Signed-off-by: Alex Deucher commit 5710c6c0bda39789ada08fbe7b64aa13654b2dd2 Author: Agustin Gutierrez Date: Thu Sep 7 01:57:59 2023 -0400 drm/amd/display: Optimize OLED T7 delay [Why] Driver doesn't need T7 delay for OLED panels, since it doesn't control power sequence. [How] This delay can be skipped to optimize resume times. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Reviewed-by: Swapnil Patel Acked-by: Rodrigo Siqueira Signed-off-by: Agustin Gutierrez Signed-off-by: Alex Deucher commit 9419ae7e40d392994ee9fa8a37409296be872a62 Author: Andy Shevchenko Date: Tue Sep 26 15:22:00 2023 +0300 pinctrl: intel: Simplify code with cleanup helpers Use macros defined in linux/cleanup.h to automate resource lifetime control in the driver. While at it, unify the variables and approach in intel_gpio_irq_*(). Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Reviewed-by: Linus Walleij commit 7bf770f74e850c0b8d21ac143b3b2bc18813a6eb Author: Christoph Hellwig Date: Mon Sep 25 09:40:58 2023 +0200 PM: hibernate: fix the kerneldoc comment for swsusp_check() and swsusp_close() The comments for both swsusp_check() and swsusp_close() don't actually describe what they are doing. Just removing the comments would probably better, but as the file is full of useless kerneldoc comments for non-exported symbols this fits in better with the style. Signed-off-by: Christoph Hellwig Signed-off-by: Rafael J. Wysocki commit d08970df1980476f27936e24d452550f3e9e92e1 Author: Brian Geffon Date: Fri Sep 22 12:07:04 2023 -0400 PM: hibernate: Clean up sync_read handling in snapshot_write_next() In snapshot_write_next(), sync_read is set and unset in three different spots unnecessiarly. As a result there is a subtle bug where the first page after the meta data has been loaded unconditionally sets sync_read to 0. If this first PFN was actually a highmem page, then the returned buffer will be the global "buffer," and the page needs to be loaded synchronously. That is, I'm not sure we can always assume the following to be safe: handle->buffer = get_buffer(&orig_bm, &ca); handle->sync_read = 0; Because get_buffer() can call get_highmem_page_buffer() which can return 'buffer'. The easiest way to address this is just set sync_read before snapshot_write_next() returns if handle->buffer == buffer. Signed-off-by: Brian Geffon Fixes: 8357376d3df2 ("[PATCH] swsusp: Improve handling of highmem") Cc: All applicable [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 3e729e50d01e6a336132d1739866a6463f82faa9 Author: Jaegeuk Kim Date: Tue Sep 19 17:43:52 2023 -0700 f2fs: preload extent_cache for POSIX_FADV_WILLNEED This patch tries to preload extent_cache given POSIX_FADV_WILLNEED, which is more useful for generic usecases. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 8d74f1da776da9b0306630b13a3025214fa44618 Author: Raag Jadav Date: Fri Sep 22 11:15:52 2023 +0530 PM: sleep: Fix symbol export for _SIMPLE_ variants of _PM_OPS() Currently EXPORT_*_SIMPLE_DEV_PM_OPS() use EXPORT_*_DEV_PM_OPS() set of macros to export dev_pm_ops symbol, which export the symbol in case CONFIG_PM=y but don't take CONFIG_PM_SLEEP into consideration. Since _SIMPLE_ variants of _PM_OPS() do not include runtime PM handles and are only used in case CONFIG_PM_SLEEP=y, we should not be exporting dev_pm_ops symbol for them in case CONFIG_PM_SLEEP=n. This can be fixed by having two distinct set of export macros for both _RUNTIME_ and _SIMPLE_ variants of _PM_OPS(), such that the export of dev_pm_ops symbol used in each variant depends on CONFIG_PM and CONFIG_PM_SLEEP respectively. Introduce _DEV_SLEEP_PM_OPS() set of export macros for _SIMPLE_ variants of _PM_OPS(), which export dev_pm_ops symbol only in case CONFIG_PM_SLEEP=y and discard it otherwise. Fixes: 34e1ed189fab ("PM: Improve EXPORT_*_DEV_PM_OPS macros") Signed-off-by: Raag Jadav Reviewed-by: Paul Cercueil Signed-off-by: Rafael J. Wysocki commit bb812e0069ce5de9af2a7910951c8c95632cebe3 Author: Nicolin Chen Date: Mon Sep 18 18:16:37 2023 -0700 iommufd/selftest: Iterate idev_ids in mock_domain's alloc_hwpt test The point in iterating variant->mock_domains is to test the idev_ids[0] and idev_ids[1]. So use it instead of keeping testing idev_ids[0] only. Link: https://lore.kernel.org/r/20230919011637.16483-1-nicolinc@nvidia.com Signed-off-by: Nicolin Chen Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe commit a15ffa783ea4210877886c59566a0d20f6b2bc09 Author: Rafael J. Wysocki Date: Tue Sep 19 20:59:53 2023 +0200 thermal: trip: Drop redundant trips check from for_each_thermal_trip() It is invalid to call for_each_thermal_trip() on an unregistered thermal zone anyway, and as per thermal_zone_device_register_with_trips(), the trips[] table must be present if num_trips is greater than zero for the given thermal zone. Hence, the trips check in for_each_thermal_trip() is redundant and so it can be dropped. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano commit 058f5e407deb8d21b0a04e50e8efbd25b1fcbd1b Author: Rafael J. Wysocki Date: Wed Sep 20 15:03:46 2023 +0200 ACPI: thermal: Drop valid flag from struct acpi_thermal_trip Notice that the valid flag in struct acpi_thermal_trip is in fact redundant, because the temperature field of invalid trips is always equal to THERMAL_TEMP_INVALID, so drop it from there and adjust the code accordingly. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 4175a24f01eb4bfde7d57a9a3ea254649f440034 Author: Rafael J. Wysocki Date: Tue Sep 12 20:46:02 2023 +0200 ACPI: thermal: Drop redundant trip point flags Trip point flags previously used by the driver need not be used any more after the preceding changes, so drop them and adjust the code accordingly. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit cdfe09df04a0706f3926c0643ba2218fae04003b Author: Rafael J. Wysocki Date: Wed Sep 20 14:35:46 2023 +0200 ACPI: thermal: Untangle initialization and updates of active trips Separate the code needed to update active trips (in a response to a notification from the platform firmware) as well as to initialize them from the code that is only necessary for their initialization and cleanly divide it into functions that each carry out a specific action. Signed-off-by: Rafael J. Wysocki Acked-by: Daniel Lezcano commit 64c512edf97735ecd882b532a5c5351edde39676 Author: Rafael J. Wysocki Date: Tue Sep 12 20:43:52 2023 +0200 ACPI: thermal: Untangle initialization and updates of the passive trip Separate the code needed to update the passive trip (in a response to a notification from the platform firmware) as well as to initialize it from the code that is only necessary for its initialization and cleanly divide it into functions that each carry out a specific action. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 30f04c7535e464f1824edb02e736a50be018777b Author: Rafael J. Wysocki Date: Tue Sep 12 20:41:06 2023 +0200 ACPI: thermal: Simplify critical and hot trips representation Notice that the only piece of information regarding the critical and hot trips that needs to be stored in the driver's local data structures is whether or not these trips are valid, so drop all of the redundant information from there and adjust the code accordingly. Among other things, this requires acpi_thermal_add() to be rearranged so as to obtain the critical trip temperature before populating the trip points table and for symmetry, the hot trip temperature is obtained earlier too. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 06a5f76ee104c17022425ade32b970c1d7793e01 Author: Rafael J. Wysocki Date: Tue Sep 12 20:39:15 2023 +0200 ACPI: thermal: Create and populate trip points table earlier Create and populate the driver's trip points table in acpi_thermal_add() so as to allow the its data structures to be simplified going forward. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit f04256a8f7de2c13619b636cec1109e596804229 Author: Rafael J. Wysocki Date: Tue Sep 12 20:37:59 2023 +0200 ACPI: thermal: Determine the number of trip points earlier Compute the number of trip points in acpi_thermal_add() so as to allow the driver's data structures to be simplified going forward. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit b09872a652d386207600fcd001077251c0eae15a Author: Rafael J. Wysocki Date: Tue Sep 12 20:36:21 2023 +0200 ACPI: thermal: Fold acpi_thermal_get_info() into its caller There is only one caller of acpi_thermal_get_info() and the code from it can be folded into its caller just fine, so do that. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit 4be32333d941a53dcfb48e342c808c63a3b25576 Author: Rafael J. Wysocki Date: Tue Sep 12 20:35:40 2023 +0200 ACPI: thermal: Simplify initialization of critical and hot trips Use the observation that the critical and hot trip points are never updated by the ACPI thermal driver, because the flags passed from acpi_thermal_notify() to acpi_thermal_trips_update() do not include ACPI_TRIPS_CRITICAL or ACPI_TRIPS_HOT, to move the initialization of those trip points directly into acpi_thermal_get_trip_points() and reduce the size of __acpi_thermal_trips_update(). Also make the critical and hot trip points initialization code more straightforward and drop the flags that are not needed any more. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano commit e2f99b79d4c594cdf7ab449e338d4947f5ea8903 Author: Umesh Nerlige Ramappa Date: Mon Sep 25 12:21:17 2023 -0700 i915/guc: Get runtime pm in busyness worker only if already active Ideally the busyness worker should take a gt pm wakeref because the worker only needs to be active while gt is awake. However, the gt_park path cancels the worker synchronously and this complicates the flow if the worker is also running at the same time. The cancel waits for the worker and when the worker releases the wakeref, that would call gt_park and would lead to a deadlock. The resolution is to take the global pm wakeref if runtime pm is already active. If not, we don't need to update the busyness stats as the stats would already be updated when the gt was parked. Note: - We do not requeue the worker if we cannot take a reference to runtime pm since intel_guc_busyness_unpark would requeue the worker in the resume path. - If the gt was parked longer than time taken for GT timestamp to roll over, we ignore those rollovers since we don't care about tracking the exact GT time. We only care about roll overs when the gt is active and running workloads. - There is a window of time between gt_park and runtime suspend, where the worker may run. This is acceptable since the worker will not find any new data to update busyness. v2: (Daniele) - Edit commit message and code comment - Use runtime pm in the worker - Put runtime pm after enabling the worker - Use Link tag and add Fixes tag v3: (Daniele) - Reword commit and comments and add details Link: https://gitlab.freedesktop.org/drm/intel/-/issues/7077 Fixes: 77cdd054dd2c ("drm/i915/pmu: Connect engine busyness stats from GuC to pmu") Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230925192117.2497058-1-umesh.nerlige.ramappa@intel.com commit 317aa3c4fe708fcbee5b9fe5fc25e1b9e92b83f5 Author: Stephan Gerhold Date: Tue Sep 12 09:49:54 2023 +0200 regulator: qcom_spmi: Add PMA8084 regulators Add the necessary definitions for the PMA8084 PMIC to the qcom_spmi-regulator driver to allow reading the actual voltages applied to the hardware at runtime. This is mainly intended for debugging since the regulators are usually controlled through the RPM firmware (via qcom_smd-regulator). Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230912-spmi-pm8909-v1-6-ba4b3bfaf87d@gerhold.net Signed-off-by: Mark Brown commit f72d04235781cf89410ffd750109f4b9931c50ea Author: Stephan Gerhold Date: Tue Sep 12 09:49:53 2023 +0200 dt-bindings: regulator: qcom,spmi: Document PMA8084 Document the qcom,pma8084-regulators compatible together with the necessary supply properties to allow interfacing via the hardware regulator registers directly via SPMI. This is mainly intended for debugging since the regulators are typically controlled via the RPM firmware (qcom,rpm-pma8084-regulators compatible). Signed-off-by: Stephan Gerhold Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230912-spmi-pm8909-v1-5-ba4b3bfaf87d@gerhold.net Signed-off-by: Mark Brown commit 5b30cb2a317a8e2636f724e8ebf5cbe3849e786e Author: Stephan Gerhold Date: Tue Sep 12 09:49:52 2023 +0200 regulator: qcom_spmi: Add PM8019 regulators Add the necessary definitions for the PM8019 PMIC to the qcom_spmi-regulator driver to allow reading the actual voltages applied to the hardware at runtime. This is mainly intended for debugging since the regulators are usually controlled through the RPM firmware (via qcom_smd-regulator). Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230912-spmi-pm8909-v1-4-ba4b3bfaf87d@gerhold.net Signed-off-by: Mark Brown commit 350aab7f8f2c7d7368d2bbc47717696a51014078 Author: Stephan Gerhold Date: Tue Sep 12 09:49:51 2023 +0200 dt-bindings: regulator: qcom,spmi: Document PM8019 Document the qcom,pm8019-regulators compatible together with the necessary supply properties to allow interfacing via the hardware regulator registers directly via SPMI. This is mainly intended for debugging since the regulators are typically controlled via the RPM firmware (qcom,rpm-pm8019-regulators compatible). Signed-off-by: Stephan Gerhold Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230912-spmi-pm8909-v1-3-ba4b3bfaf87d@gerhold.net Signed-off-by: Mark Brown commit 813d01a40ae7c0c67681c82edce8463fbbd84b08 Author: Stephan Gerhold Date: Tue Sep 12 09:49:50 2023 +0200 regulator: qcom_spmi: Add PM8909 regulators Add the necessary definitions for the PM8909 PMIC to the qcom_spmi-regulator driver to allow reading the actual voltages applied to the hardware at runtime. This is mainly intended for debugging since the regulators are usually controlled through the RPM firmware (via qcom_smd-regulator). Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230912-spmi-pm8909-v1-2-ba4b3bfaf87d@gerhold.net Signed-off-by: Mark Brown commit 6f20872035378ab2311cc901f8f94f8718f1b17f Author: Stephan Gerhold Date: Tue Sep 12 09:49:49 2023 +0200 dt-bindings: regulator: qcom,spmi: Document PM8909 Document the qcom,pm8909-regulators compatible together with the necessary supply properties to allow interfacing via the hardware regulator registers directly via SPMI. This is mainly intended for debugging since the regulators are typically controlled via the RPM firmware (qcom,rpm-pm8909-regulators compatible). Signed-off-by: Stephan Gerhold Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230912-spmi-pm8909-v1-1-ba4b3bfaf87d@gerhold.net Signed-off-by: Mark Brown commit ad484cc98f2c7ee8e22f63691562a7abae5a9832 Author: Kuninori Morimoto Date: Tue Sep 26 06:27:06 2023 +0000 ASoC: remove asoc_xxx() compatible macro No driver is using asoc_xxx() any more. This patch removes compatible macro for asoc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/878r8tfo06.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 4d5f41191ca83fa4bf6120c5cbcd085aa2aeec0e Author: Kuninori Morimoto Date: Tue Sep 26 06:25:22 2023 +0000 ASoC: sof: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87sf71fo32.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit a2c1125e5b99cd9722d7ee320756bba948855e1e Author: Kuninori Morimoto Date: Tue Sep 26 06:24:24 2023 +0000 ASoC: intel: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87zg19fo4o.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 1a543d2a1cdbe2aae039a9b7f5ab6d0cbddebf95 Author: Kuninori Morimoto Date: Tue Sep 26 06:23:51 2023 +0000 ASoC: starfive: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/874jjhh2q1.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit de9e70137f006855a540f510a2c7dfb8850bedb7 Author: Kuninori Morimoto Date: Tue Sep 26 06:23:35 2023 +0000 ASoC: mediatek: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/877codh2qg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 4c1a094692cbafbd163229e353a2a7150f09665c Author: Kuninori Morimoto Date: Tue Sep 26 06:21:00 2023 +0000 ASoC: amd: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/875y3xihf7.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit af08458988cb5dd4b4ff87cfb9da81c6d2c8ef7a Merge: e952e89b0602a 2b21207afd067 Author: Mark Brown Date: Tue Sep 26 16:14:44 2023 +0200 ASoC: Merge up fixes For the benefit of CI. commit e952e89b0602aeb856396eac4306098249c43548 Merge: 7b71da59122c3 c067b1f83ea46 Author: Mark Brown Date: Tue Sep 26 15:16:52 2023 +0200 ASoC: convert asoc_xxx() to snd_soc_xxx() Merge series from Kuninori Morimoto : ASoC is using 2 type of prefix (asoc_xxx() vs snd_soc_xxx()), but there is no particular reason about that [1]. To reduce confusing, standarding these to snd_soc_xxx() is sensible. This patch adds asoc_xxx() macro to keep compatible for a while. It will be removed if all drivers were switched to new style. Link: https://lore.kernel.org/r/87h6td3hus.wl-kuninori.morimoto.gx@renesas.com [1] commit d7133797e9e1b72fd89237f68cb36d745599ed86 Author: Victor Shih Date: Tue Sep 12 17:17:10 2023 +0800 mmc: sdhci-pci-gli: A workaround to allow GL9750 to enter ASPM L1.2 When GL9750 enters ASPM L1 sub-states, it will stay at L1.1 and will not enter L1.2. The workaround is to toggle PM state to allow GL9750 to enter ASPM L1.2. Signed-off-by: Victor Shih Link: https://lore.kernel.org/r/20230912091710.7797-1-victorshihgli@gmail.com Signed-off-by: Ulf Hansson commit 3b7eee6aae0b3212183fa63a4ae7887924218987 Author: Claudiu Beznea Date: Tue Sep 12 07:51:51 2023 +0300 dt-bindings: mmc: renesas,sdhi: Document RZ/G3S support Document support for the SD Card/MMC interface on the Renesas RZ/G3S (R9A08G045) SoC. Signed-off-by: Claudiu Beznea Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230912045157.177966-32-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Ulf Hansson commit 6f39adf955d8767c78fba94cf9abe989e0d1e111 Author: Balamanikandan Gunasundar Date: Mon Sep 11 14:55:40 2023 +0530 mmc: atmel-mci: Add description for struct member Add description for dma filtering function in struct mci_platform_data. Fixes the warning: Function parameter or member 'dma_filter' not described in 'mci_platform_data'. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309020937.C5S2sRnr-lkp@intel.com/ Signed-off-by: Balamanikandan Gunasundar Link: https://lore.kernel.org/r/20230911092540.76334-1-balamanikandan.gunasundar@microchip.com Signed-off-by: Ulf Hansson commit 134d3cfbb8658eb9600a6db689d0b47d24d96fbe Author: Julia Lawall Date: Thu Sep 7 11:55:15 2023 +0200 mmc: atmel-mci: add missing of_node_put for_each_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. This was done using the Coccinelle semantic patch iterators/for_each_child.cocci Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20230907095521.14053-6-Julia.Lawall@inria.fr Signed-off-by: Ulf Hansson commit bbe6dc429bf52b0062c2a9b39f850cfd317289a7 Author: Lad Prabhakar Date: Fri Sep 1 13:27:01 2023 +0100 mmc: host: Kconfig: Make MMC_SDHI_INTERNAL_DMAC config option dependant on ARCH_RENESAS MMC_SDHI_INTERNAL_DMAC config option has dependency on ARM64 and R7S9210/R8A77470 this dependency will keep growing for future SoCs for varying architectures. So to simplify this configuration make MMC_SDHI_INTERNAL_DMAC solely depend on ARCH_RENESAS, as all Renesas SoCs inherently depend on the ARCH_RENESAS config option. This allows selecting MMC_SDHI_INTERNAL_DMAC config option for RZ/Five SoC which is based on RISC-V architecture. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Acked-by: Wolfram Sang Link: https://lore.kernel.org/r/20230901122701.318082-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Ulf Hansson commit 541a95e64d7606ead18a4e8aa78c753a2494cae0 Author: Haibo Chen Date: Thu Aug 31 11:26:47 2023 +0800 mmc: sdhci-esdhc-imx: optimize the manual tuing logic to get the best timing Current manual tuning logic only get the first pass window, but this pass window maybe not the best pass window. Now find all the pass window, and chose the largest pass window, and use the average value of this largest pass window to get the best timing. Signed-off-by: Haibo Chen Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20230831032647.3128702-1-haibo.chen@nxp.com Signed-off-by: Ulf Hansson commit a5b5006edc6273c278930f0ee92773c13abd660e Author: Krzysztof Kozlowski Date: Fri Aug 25 15:55:03 2023 +0200 dt-bindings: mmc: sdhci-msm: allow flexible order of optional clocks The Qualcomm SDHCI controller lists optional clocks, but still expects fixed order of them and does not allow to skip such clocks if further one in the list is needed. These optional clocks are truly optional, so we need to allow the list to have different orders. The clocks are: - ice: used for Inline Crypto Engine, which is actually separate block and merging it with SDHCI is not a requirement, - bus: clock for SDCC bus frequency voting, - cal and sleep: used for RCLK delay calibration and required for certain platforms for such calibration (as expressed in original commit 4946b3af5e8e ("mmc: sdhci-msm: Enable delay circuit calibration clocks")). Only MSM8974pro has these clocks. Relaxing the order fixes dtbs_check warnings: qcom-msm8974pro-fairphone-fp2.dtb: mmc@f9824900: clock-names:3: 'ice' was expected qcom-msm8974pro-fairphone-fp2.dtb: mmc@f9824900: clock-names:4: 'bus' was expected Signed-off-by: Krzysztof Kozlowski Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230825135503.282135-2-krzysztof.kozlowski@linaro.org Signed-off-by: Ulf Hansson commit 9cf63f3a33e929f7eca36409914b8c12102b9984 Author: Kees Cook Date: Fri Sep 22 10:54:37 2023 -0700 platform/surface: aggregator: Annotate struct ssam_event with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ssam_event. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Maximilian Luz Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20230922175436.work.031-kees@kernel.org Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 55ec81f7517fad09135f65552cea0a3ee84fff30 Author: Kees Cook Date: Fri Sep 22 10:54:21 2023 -0700 platform/x86: hp-bioscfg: Annotate struct bios_args with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct bios_args. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Jorge Lopez Cc: Hans de Goede Cc: Mark Gross Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Cc: platform-driver-x86@vger.kernel.org Cc: llvm@lists.linux.dev Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175420.work.701-kees@kernel.org Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen commit 86401132d7bbb550d80df0959ad9fa356ebc168d Author: Dhruva Gole Date: Tue Sep 19 13:16:59 2023 +0530 spi: spi-cadence-quadspi: Fix missing unwind goto warnings The following smatch warnings [0] were recently introduced: drivers/spi/spi-cadence-quadspi.c:1882 cqspi_probe() warn: missing unwind goto? Fix these warnings by releasing dma channel and adding a goto fail probe. [0] https://lore.kernel.org/all/5e21c351-cd08-443e-8509-aecf242a4da9@kadam.mountain/ Fixes: 0578a6dbfe75 ("spi: spi-cadence-quadspi: add runtime pm support") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202309140543.03dMbMM5-lkp@intel.com/ Signed-off-by: Dhruva Gole Link: https://lore.kernel.org/r/20230919074658.41666-1-d-gole@ti.com Signed-off-by: Mark Brown commit 2d9f4877988f64f0f336983de65c365b6a7debfb Author: Vaishnav Achath Date: Tue Sep 26 17:08:12 2023 +0530 spi: omap2-mcspi: Fix hardcoded reference clock A hardcoded reference clock of 48 MHz is used to calculate the clock divisor values, but the reference clock frequency can be different across devices and can be configured which can cause a mismatch between the reported frequency and actual SPI clock frequency observed. Fix this by fetching the clock rate from the clock provider and falling back to hardcoded reference only if the clock is not supplied. Fixes: 2cd7d393f461 ("arm64: dts: ti: k3-am654: Add McSPI DT nodes") Signed-off-by: Vaishnav Achath Reviewed-by: Dhruva Gole Link: https://lore.kernel.org/r/20230926113812.30692-1-vaishnav.a@ti.com Signed-off-by: Mark Brown commit 4a710a0b0c68d4bf48ed70083e5a28984e5994c2 Merge: 66af368359816 017c6658fd597 Author: Mark Brown Date: Tue Sep 26 13:57:13 2023 +0200 regulator: mt6358: Remove bogus regulators and Merge series from Chen-Yu Tsai : Hi, This is v3 of the remainder of the MT6358 regulator driver cleanup and improvement series. v1 can be found here [1]; v2 is here [2]. Changes since v2: - Merged patches dropped - Fixed up pickable linear ranges' selector values - Collected tags - Patch adding missing regulator definitions squashed into patch using the definitions; recommended by Krzysztof on my MT6366 series. - Remaining dts patch split out to be sent separately Changes since v1: - Merged patches dropped - Added patch to move VCN33 regulator status sync after ID check - Added patch to fix VCN33 sync fail error message - Added patch to add missing register definitions Various discrepancies were found while preparing to upstream MT8186 device trees, which utilize the MT6366 PMIC, that is also covered by this driver. Patches 1~3 should go through the regulator tree, and patch 4 through the soc/mediatek tree. ** Note: patch 2 needs an ack from Lee for the mfd header change. This v3 series can be seen as two parts. v1 had three parts, but one part was fully merged, and then v2 gained another cleanup. v3 drops the "fixing bogus regulators" part: driver changes are fully merged and device tree change will be sent separately. Part 1 - Robust chip ID checking (patch 1) Angelo suggested making the driver fail to probe if an unexpected chip ID was found. Patch 1 implements this. Part 2 - Output voltage fine tuning support (patches 2, 3) Many of the LDOs on these PMIC support an extra level of output voltage fine tuning. Most default to no offset, but a couple have a non-zero offset by default. Previously this was unaccounted for in the driver and device tree constraints. On the outputs with non-zero offset, this ends up becoming a discrepancy between the device tree and actual hardware. These two patches adds support for this second level of tuning, modeled as bunch of linear ranges. While it's unlikely we need this level of control, it's nice to be able to read back the accurate hardware settings. Please have a look. Thanks ChenYu [1] https://lore.kernel.org/linux-arm-kernel/20230609083009.2822259-1-wenst@chromium.org/ [2] https://lore.kernel.org/linux-mediatek/20230721082903.2038975-1-wenst@chromium.org/ Chen-Yu Tsai (3): regulator: mt6358: Fail probe on unknown chip ID regulator: mt6358: Add output voltage fine tuning to fixed regulators regulator: mt6358: Add output voltage fine tuning to variable LDOs drivers/regulator/mt6358-regulator.c | 304 ++++++++++++--------------- include/linux/mfd/mt6358/registers.h | 6 + 2 files changed, 144 insertions(+), 166 deletions(-) -- 2.42.0.283.g2d96d420d3-goog commit f067976e4939133e656ce4532995ba96bfe68366 Author: Jani Nikula Date: Thu Sep 21 18:53:25 2023 +0300 drm/i915/cx0: prefer forward declarations over includes Avoid including the world from headers when forward declarations suffice. Cc: Radhakrishna Sripada Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Reviewed-by: Radhakrishna Sripada Link: https://patchwork.freedesktop.org/patch/msgid/20230921155325.3851197-1-jani.nikula@intel.com commit 8dc0fd2f5693ab71f84fb16339c483999a909ab0 Author: Patrisious Haddad Date: Wed Sep 20 13:07:45 2023 +0300 RDMA/ipoib: Add support for XDR speed in ethtool The IBTA specification 1.7 has new speed - XDR, supporting signaling rate of 200Gb. Ethtool support of IPoIB driver translates IB speed to signaling rate. Added translation of XDR IB type to rate of 200Gb Ethernet speed. Signed-off-by: Patrisious Haddad Reviewed-by: Mark Zhang Link: https://lore.kernel.org/r/ca252b79b7114af967de3d65f9a38992d4d87a14.1695204156.git.leon@kernel.org Reviewed-by: Jacob Keller Signed-off-by: Leon Romanovsky commit 4f4db190893fb8dee3761b4c5a704ffa5713b73c Author: Patrisious Haddad Date: Wed Sep 20 13:07:44 2023 +0300 IB/mlx5: Adjust mlx5 rate mapping to support 800Gb Adjust mlx5 function which maps the speed rate from IB spec values to internal driver values to be able to handle speeds up to 800Gb. Signed-off-by: Patrisious Haddad Reviewed-by: Mark Zhang Link: https://lore.kernel.org/r/301c803d8486b0df8aefad3fb3cc10dc58671985.1695204156.git.leon@kernel.org Reviewed-by: Jacob Keller Signed-off-by: Leon Romanovsky commit b28ad32442bec2f0d9cb660d7d698a1a53c13d08 Author: Patrisious Haddad Date: Wed Sep 20 13:07:43 2023 +0300 IB/mlx5: Rename 400G_8X speed to comply to naming convention Rename 400G_8X speed to comply to naming convention. Signed-off-by: Patrisious Haddad Reviewed-by: Mark Zhang Link: https://lore.kernel.org/r/ac98447cac8379a43fbdb36d56e5fb2b741a97ff.1695204156.git.leon@kernel.org Reviewed-by: Jacob Keller Signed-off-by: Leon Romanovsky commit 948f0bf5ad6ac1e5f19f6aa8e7da4a950d66b661 Author: Patrisious Haddad Date: Wed Sep 20 13:07:42 2023 +0300 IB/mlx5: Add support for 800G_8X lane speed Add a check for 800G_8X speed when querying PTYS and report it back correctly when needed. Signed-off-by: Patrisious Haddad Reviewed-by: Mark Zhang Link: https://lore.kernel.org/r/26fd0b6e1fac071c3eb779657bb3d8ba47f47c4f.1695204156.git.leon@kernel.org Reviewed-by: Jacob Keller Signed-off-by: Leon Romanovsky commit 561b4a3ac65597c5eca62c91260240a47c88b3da Author: Or Har-Toov Date: Wed Sep 20 13:07:41 2023 +0300 IB/mlx5: Expose XDR speed through MAD Under MAD query port, Report NDR speed when NDR is supported in the port capability mask. Signed-off-by: Or Har-Toov Reviewed-by: Mark Zhang Link: https://lore.kernel.org/r/d30bdec2a66a8a2edd1d84ee61453c58cf346b43.1695204156.git.leon@kernel.org Reviewed-by: Jacob Keller Signed-off-by: Leon Romanovsky commit 703289ce43f740b0096724300107df82d008552f Author: Or Har-Toov Date: Wed Sep 20 13:07:40 2023 +0300 IB/core: Add support for XDR link speed Add new IBTA speed XDR, the new rate that was added to Infiniband spec as part of XDR and supporting signaling rate of 200Gb. In order to report that value to rdma-core, add new u32 field to query_port response. Signed-off-by: Or Har-Toov Reviewed-by: Mark Zhang Link: https://lore.kernel.org/r/9d235fc600a999e8274010f0e18b40fa60540e6c.1695204156.git.leon@kernel.org Reviewed-by: Jacob Keller Signed-off-by: Leon Romanovsky commit 57e7071683ef6148c9f5ea0ba84598d2ba681375 Author: Shay Drory Date: Thu Sep 21 11:07:16 2023 +0300 RDMA/mlx5: Implement mkeys management via LIFO queue Currently, mkeys are managed via xarray. This implementation leads to a degradation in cases many MRs are unregistered in parallel, due to xarray internal implementation, for example: deregistration 1M MRs via 64 threads is taking ~15% more time[1]. Hence, implement mkeys management via LIFO queue, which solved the degradation. [1] 2.8us in kernel v5.19 compare to 3.2us in kernel v6.4 Signed-off-by: Shay Drory Link: https://lore.kernel.org/r/fde3d4cfab0f32f0ccb231cd113298256e1502c5.1695283384.git.leon@kernel.org Signed-off-by: Leon Romanovsky commit 690391777f4d81a0877c98e0492c245c2aa7b10d Author: Jani Nikula Date: Fri Sep 22 13:56:45 2023 +0300 drm/i915/dp: refactor aux_ch_name() Convert aux_ch_name() to a helper that prints a string to a caller provided buffer, and use it to get more consistent aux channel debugs. Now that all users of aux_ch_name() are in intel_dp_aux.c, we can make it static too. Signed-off-by: Jani Nikula Reviewed-by: Gustavo Sousa Reviewed-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230922105645.3991066-1-jani.nikula@intel.com commit d8d5b7bf6f2105883bbd91bbd4d5b67e4e3dff71 Author: Denis Arefev Date: Mon Sep 4 15:21:14 2023 +0300 srcu: Fix srcu_struct node grpmask overflow on 64-bit systems The value of a bitwise expression 1 << (cpu - sdp->mynode->grplo) is subject to overflow due to a failure to cast operands to a larger data type before performing the bitwise operation. The maximum result of this subtraction is defined by the RCU_FANOUT_LEAF Kconfig option, which on 64-bit systems defaults to 16 (resulting in a maximum shift of 15), but which can be set up as high as 64 (resulting in a maximum shift of 63). A value of 31 can result in sign extension, resulting in 0xffffffff80000000 instead of the desired 0x80000000. A value of 32 or greater triggers undefined behavior per the C standard. This bug has not been known to cause issues because almost all kernels take the default CONFIG_RCU_FANOUT_LEAF=16. Furthermore, as long as a given compiler gives a deterministic non-zero result for 1<=32, the code correctly invokes all SRCU callbacks, albeit wasting CPU time along the way. This commit therefore substitutes the correct 1UL for the buggy 1. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Denis Arefev Reviewed-by: Mathieu Desnoyers Reviewed-by: Joel Fernandes (Google) Cc: David Laight Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit eb507641d0be6a4fb2f06cd7325953ba5e4f6c3e Author: Pavan Bobba Date: Thu Sep 21 17:38:37 2023 +0530 staging: vt6655: Type encoding info dropped from variable "byRFType" variable name "byRFType" updated like below: a.type encoding info dropped from name b.camelcase name replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/ZQwyRXFHA9hTLcyv@ubuntu.myguest.virtualbox.org Signed-off-by: Greg Kroah-Hartman commit 31f912557e02f41657a4f0fce646603354149895 Author: Arnd Bergmann Date: Mon Sep 25 17:54:04 2023 +0200 staging: rtl8192e: remove bogus __packed annotations The rtllib_rxb structure contains a pointer, so this is not a hardware structure but could benefit from loading the pointer in a single instruction rather than assembling it from four or eight individual bytes. Both structures are allocated as part of larger structure that already enforce at least a 4-byte alignment, so there is no reason to ever have to deal with misaligned definitions. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20230925155413.471287-2-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit d50f64b5520311cacf38b8c2c240c5955c815d10 Author: Philipp Hortmann Date: Sun Sep 24 21:51:10 2023 +0200 staging: rtl8192e: Resolve circular locking with rx_pkt_pending_timer Resolve circular locking from reorder_spinlock with rx_pkt_pending_timer. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/08ff2088b0264bef60142ca35f7198dd8afa963c.1695582999.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit f4050ec5b906067f71f5a490fa0b1f2ea853eee8 Author: Philipp Hortmann Date: Sun Sep 24 21:51:02 2023 +0200 staging: rtl8192e: Unlock mutex for one line in rtllib_stop_protocol() The following command uses the mutex ieee->wx_mutex: cancel_delayed_work_sync(&ieee->associate_retry_wq) Therefore it cannot be canceled with ieee->wx_mutex locked. rtllib_stop_protocol() is always called with ieee->wx_mutex locked so according line can be unlocked. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/ffe60e8f6e29197f331e239ab38154da97c743be.1695582999.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit d17631c44dea13f7cd6bced705b5c8c8c0bf69c1 Author: Philipp Hortmann Date: Sun Sep 24 21:50:55 2023 +0200 staging: rtl8192e: Remove mutex from rtllib_softmac_free() The following commands use the mutex ieee->wx_mutex: cancel_delayed_work_sync(&ieee->associate_retry_wq) cancel_delayed_work_sync(&ieee->associate_procedure_wq) cancel_work_sync(&ieee->wx_sync_scan_wq) Therefore they cannot be canceled with ieee->wx_mutex locked. As the work functions are executed time shifted during normal operation of the driver, proper locking can only be done inside the functions. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/a5308876bd8fabcb5f8b25d14dbad2c1f68ce59f.1695582999.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1579c70661fa95d8ae6910fb80de431260552f46 Author: Philipp Hortmann Date: Sun Sep 24 21:50:49 2023 +0200 staging: rtl8192e: Put kfree() to end of rtllib_softmac_free() To reverse order of initialization put kfree() to the end of rtllib_softmac_free(). Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/85b63c62780356af91c30cc63280c5f59cd29210.1695582999.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit b174d2c54049acdf714102d970551de66c220a74 Author: Philipp Hortmann Date: Fri Sep 22 15:30:00 2023 +0200 staging: rtl8192e: Remove rtllib_stop_send_beacons rtllib_start_send_beacons() is removed so no need for rtllib_stop_send_beacons() anymore. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/17c5545102ad8f50ca320af17aafa555f8caec2d.1695387832.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 91f70cf236a2c7a2e9ea7869fb1d2d2f2118b2da Author: Philipp Hortmann Date: Fri Sep 22 15:29:53 2023 +0200 staging: rtl8192e: Remove delayed_work start_ibss_wq Remove delayed_work start_ibss_wq and the related functions which are not needed anymore. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/805447a41feffb9da7d82830868dc1d47f9aa737.1695387832.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 27cde974f2c995fd3e053e57515fe8268aca6aac Author: Philipp Hortmann Date: Fri Sep 22 15:29:47 2023 +0200 staging: rtl8192e: Remove mode IW_MODE_ADHOC from rtllib_softmac.c Remove unsupported mode IW_MODE_ADHOC from rtllib_softmac.c. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/4259c06deaf2e3f3cc615e8c55bcf6f70ce4e277.1695387832.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8e040dd3aa7912842bc302eee97c5716052f3e06 Author: Philipp Hortmann Date: Fri Sep 22 15:29:41 2023 +0200 staging: rtl8192e: Remove mode IW_MODE_ADHOC from rtl_cam.c Remove unsupported mode IW_MODE_ADHOC from rtl_cam.c. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/143345585dfcc0e920b2ba5fa614f626ab3ad8ee.1695387832.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4df4813f956242006fa4c063ef59d6a418f2febb Author: Philipp Hortmann Date: Fri Sep 22 15:29:35 2023 +0200 staging: rtl8192e: Remove mode IW_MODE_ADHOC from rtl_core.c Remove unsupported mode IW_MODE_ADHOC from rtl_core.c and further files. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/7b9a4790238081736e6530135309e53d36f28574.1695387832.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit decfb8dd8c0911fb830d60a87072b7d88c7b7443 Author: Philipp Hortmann Date: Fri Sep 22 15:29:28 2023 +0200 staging: rtl8192e: Remove mode IW_MODE_ADHOC from rtllib_rx.c Remove unsupported mode IW_MODE_ADHOC from rtllib_rx.c and all related functions and structs. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/5400c68e17b86b1170ac997fae3fe1fb09220af8.1695387832.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 97dc4753e0d4bad6ccfb009f0ed01fe9ebda0e7b Author: Philipp Hortmann Date: Fri Sep 22 15:29:21 2023 +0200 staging: rtl8192e: Remove mode IW_MODE_ADHOC from rtllib_tx.c Remove unsupported mode IW_MODE_ADHOC from rtllib_tx.c, rtl819x_TSProc.c, rtl819x_HTProc.c, r8192E_dev.c Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/59564ce06fc0a23fd26304b8ecd585abd5ddd82f.1695387832.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit dfbf4bde2b85504a62907ad5cb80ac4ba8b2df4e Author: Tree Davies Date: Wed Sep 20 20:25:15 2023 -0700 Staging: rtl8192e: Rename variable StatusCode Rename variable StatusCode to status_code to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230921032515.96152-12-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit e47c30b540a4b1ac0b3ad1b8c039e4968422cb07 Author: Tree Davies Date: Wed Sep 20 20:25:14 2023 -0700 Staging: rtl8192e: Rename function TSInitialize Rename function TSInitialize to rtllib_ts_init to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230921032515.96152-11-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit a747b924909cc9051cb0f39f46ead961aed666e7 Author: Tree Davies Date: Wed Sep 20 20:25:13 2023 -0700 Staging: rtl8192e: Rename function GetTs() Rename function GetTs to rtllib_get_ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230921032515.96152-10-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit dcda7ec95104356f21764b92b1c8cc8a21b03f56 Author: Tree Davies Date: Wed Sep 20 20:25:12 2023 -0700 Staging: rtl8192e: Rename variable Policy Rename variable Policy to policy to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230921032515.96152-9-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 718aa4d31fc485f5218054e4ad274e455df6e0ea Author: Tree Davies Date: Wed Sep 20 20:25:11 2023 -0700 Staging: rtl8192e: Rename variable pStatusCode Rename variable pStatusCode to status_code to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230921032515.96152-8-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 7f39ba9d62fd366c622d267ec845761aecf55675 Author: Tree Davies Date: Wed Sep 20 20:25:10 2023 -0700 Staging: rtl8192e: Rename variable Addr Rename variable Addr to addr to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230921032515.96152-7-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 408d085d957def53c8f847ec3e4703af325d21ce Author: Tree Davies Date: Wed Sep 20 20:25:09 2023 -0700 Staging: rtl8192e: Rename variable pPendingBA Rename variable pPendingBA to pending_ba to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230921032515.96152-6-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 0f2954b5e780f0469606e9699ff9f7d10a440661 Author: Tree Davies Date: Wed Sep 20 20:25:08 2023 -0700 Staging: rtl8192e: Rename variable Dst Rename variable Dst to dst to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230921032515.96152-5-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit f20a45d4500dec83e1392d918182d2ca7b69887e Author: Tree Davies Date: Wed Sep 20 20:25:07 2023 -0700 Staging: rtl8192e: Rename variable pPendingBa Rename variable pPendingBa to pending_ba to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230921032515.96152-4-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit ae25149935df1ef0d56e056bd0143b730bdfc8f7 Author: Tree Davies Date: Wed Sep 20 20:25:06 2023 -0700 Staging: rtl8192e: Rename variable pAdmittedBa Rename variable pAdmittedBa to admitted_ba to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230921032515.96152-3-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 7458fdf8a778b14ad814c9c13695d0c85b210afa Author: Tree Davies Date: Wed Sep 20 20:25:05 2023 -0700 Staging: rtl8192e: Rename variable Time Rename variable Time to time to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230921032515.96152-2-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit e2572686a5a8fa35f8d1a449311f1b98165e4015 Author: Philipp Hortmann Date: Mon Sep 18 18:43:10 2023 +0200 staging: rtl8192e: Fix compiler warning truncated writing of iwe.u.name iwe.u.name and proto_name have both 16 bytes of space. But when writing to iwe.u.name the first 10 bytes are used by the fixed string "IEEE802.11". Evaluating the code shows that only the following strings can occur in proto_name: "N-24G", "g", "b", "bg". Therefore it is sufficient to shorten proto_name to 6 bytes. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309171733.Gl96cmYd-lkp@intel.com/ Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/2caafb8628880570725385e87150c47689474fc4.1695054044.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9d600c0960d8a7fbd1112636c71a1cbc58a7a609 Author: Philipp Hortmann Date: Mon Sep 18 18:43:04 2023 +0200 staging: rtl8192e: Fix alignment of structs in rtllib.h to two Fix alignment of structs to even addresses to support all architectures. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309171733.Gl96cmYd-lkp@intel.com/ Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/3140277dca915a1af9f66b1e7b4b47f5c7f6cd77.1695054044.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6fc44688457e928bc5ed32103418b6442bc58441 Author: Bragatheswaran Manickavel Date: Sun Sep 17 19:19:40 2023 +0530 staging: rtl8723bs: hal: Fix codespell-reported spelling mistakes They are appear to be spelling mistakes, Initially identified in a codespell report and never been addressed so far. ./rtl8723b_phycfg.c:156: Threre ==> There, three ./rtl8723b_phycfg.c:283: Condig ==> Config ./rtl8723b_phycfg.c:328: Tranceiver ==> Transceiver Signed-off-by: Bragatheswaran Manickavel Link: https://lore.kernel.org/r/20230917134940.2746-1-bragathemanick0908@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9f778f377cd3b8d6699025ea75732ca91a239cd1 Author: Rob Herring Date: Mon Sep 25 16:26:00 2023 -0500 spi: dt-bindings: Make "additionalProperties: true" explicit Make it explicit that child nodes have additional properties and the child node schema is not complete. The complete schemas are applied separately based the compatible strings. Signed-off-by: Rob Herring Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230925212614.1974243-1-robh@kernel.org Signed-off-by: Mark Brown commit 66af368359816d62cf91ed1b02fe99f9a4015f3a Author: Rob Herring Date: Mon Sep 25 16:26:53 2023 -0500 regulator: dt-bindings: Add missing unevaluatedProperties on child node schemas Just as unevaluatedProperties or additionalProperties are required at the top level of schemas, they should (and will) also be required for child node schemas. That ensures only documented properties are present for any node. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230925212658.1975419-1-robh@kernel.org Signed-off-by: Mark Brown commit 7b71da59122c3ab82908910abf78db1fd6340cac Author: Rob Herring Date: Mon Sep 25 17:09:28 2023 -0500 ASoC: dt-bindings: Add missing (unevaluated|additional)Properties on child node schemas Just as unevaluatedProperties or additionalProperties are required at the top level of schemas, they should (and will) also be required for child node schemas. That ensures only documented properties are present for any node. Add unevaluatedProperties or additionalProperties as appropriate. Signed-off-by: Rob Herring Acked-by: Herve Codina Link: https://lore.kernel.org/r/20230925220947.2031536-1-robh@kernel.org Signed-off-by: Mark Brown commit c385256611b1af79d180e35c07992b43e1be5067 Author: Geert Uytterhoeven Date: Fri Sep 22 09:53:11 2023 +0200 pinctrl: renesas: rzg2l: Rename rzg2l_gpio_configs[] The rzg2l_gpio_configs array is really related to the RZ/G2L (R9A07G044) Soc only. Hence rename it to r9a07g044_gpio_configs[]. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/19958e63a2b793be5182640c4301ec5a77a507f6.1695369116.git.geert+renesas@glider.be commit dd462cf53e4dff0f4eba5e6650e31ceddec74c6f Author: Biju Das Date: Mon Sep 18 13:33:54 2023 +0100 pinctrl: renesas: rzg2l: Make reverse order of enable() for disable() We usually do reverse order of enable() for disable(). Currently, the ordering of irq_chip_disable_parent() is not correct in rzg2l_gpio_irq_disable(). Fix the incorrect order. Fixes: db2e5f21a48e ("pinctrl: renesas: pinctrl-rzg2l: Add IRQ domain to handle GPIO interrupt") Signed-off-by: Biju Das Tested-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230918123355.262115-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 84c580e9695084d688904a18bfdc129aeca78144 Author: Claudiu Beznea Date: Tue Sep 12 07:51:48 2023 +0300 pinctrl: renesas: rzg2l: Make struct rzg2l_pinctrl_data::dedicated_pins constant struct rzg2l_pinctrl_data::dedicated_pins is constant thus mark it so. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230912045157.177966-29-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 87882525e5ddae7ef6f1b1df5e1eda9bcbcd7720 Author: Marek Vasut Date: Sun Sep 17 11:58:32 2023 +0200 clk: renesas: r8a7795: Constify r8a7795_*_clks Make r8a7795_core_clks and r8a7795_mod_clks arrays const and align them with the other clock tables in other *cpg-mssr.c . No functional change. Signed-off-by: Marek Vasut Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230917095832.39007-1-marek.vasut+renesas@mailbox.org Signed-off-by: Geert Uytterhoeven commit da6de6d3ecc1ac37c36ed4c0c4ce5dcd410cddcf Merge: 8a771075e50be ecdaa9473019f Author: Mark Brown Date: Tue Sep 26 09:35:54 2023 +0200 spi: qup: Allow scaling power domains and Merge series from Stephan Gerhold : Make it possible to scale performance states of the power domain and interconnect of the SPI QUP controller in relation to the selected SPI speed / core clock. This is done separately by: - Parsing the OPP table from the device tree for performance state votes of the power domain - Voting for the necessary bandwidth on the interconnect path to DRAM commit f5f331930bf00d80fc69a0b4d994481fbba42774 Author: Andreas Kemnade Date: Mon Sep 25 00:27:18 2023 +0200 ARM: dts: omap: omap4-embt2ws: Let IMU driver handle Magnetometer internally Possibility to use the i2c gate is only for compatibility reasons, so avoid messing around with additional i2c busses. Signed-off-by: Andreas Kemnade Message-ID: <20230924222718.2038849-1-andreas@kemnade.info> Signed-off-by: Tony Lindgren commit 9485f78703bfd0369c49e60c20ff09e14ad9e955 Author: Trevor Woerner Date: Tue Aug 22 10:30:50 2023 -0400 ARM: dts: am335x-pocketbeagle: add missing GPIO mux Add the default MODE setting of a GPIO pin that was missing from the device tree (i.e. P2.20/gpio2_00). This is to ensure the GPIO pins match the pocketbeagle wiring expectations. Signed-off-by: Trevor Woerner Message-ID: <20230822143051.7640-5-twoerner@gmail.com> [tony@atomide.com: leave out extra line break] Signed-off-by: Tony Lindgren commit b6ef9b9ece3f259daa8894886f0dea45e2eac43f Author: Trevor Woerner Date: Tue Aug 22 10:30:49 2023 -0400 ARM: dts: am335x-pocketbeagle: enable pru Now that the PRU code is upstream and can be loaded via remoteproc, adjust the device tree to enable it and adjust the pin muxing so that the default setting of the pins matches what's is given on the silkscreen and/or pocketbeagle wiring. Caveat: In most cases, the silkscreen will indicate, for example, "PRU0.7", but it doesn't indicate whether that pin should be enabled for input or output. On the PRU a different MODE is used for input versus output. So it is unclear which mode to enable (MODE5 = output, MODE6 = input). In cases where there is a choice (PRU1.11, PRU0.7, PRU0.4, PRU0.1, PRU1.10, PRU0.6, PRU0.3, PRU0.2, and PRU0.5) output is assumed (MODE5). The remaining PRU silkscreen pins do not have a choice and are set as follows: PRU0.16 MODE5 input PRU0.15i MODE6 input Signed-off-by: Trevor Woerner Message-ID: <20230822143051.7640-4-twoerner@gmail.com> [tony@atomide.com: formatted description to fit 75 characters] Signed-off-by: Tony Lindgren commit 05586fd24e3620408c0e78d67c9371cd43fbbbb9 Author: Trevor Woerner Date: Tue Aug 22 10:30:48 2023 -0400 ARM: dts: am335x-pocketbeagle: remove dependency cycle Remove the self-referenceing "pinctrl-0" entry inside the pinmux clause. This eliminates the set of boot messages (one for each referenced pin) similar to the following: platform 44e10800.pinmux: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@10000/scm@0/pinmux@800/pinmux_P2_17_gpio Signed-off-by: Trevor Woerner Message-ID: <20230822143051.7640-3-twoerner@gmail.com> Signed-off-by: Tony Lindgren commit 909ed2f52a06ac65d397e6c9efdba3a6260cb0b5 Author: Trevor Woerner Date: Tue Aug 22 10:30:47 2023 -0400 ARM: dts: am335x-pocketbeagle: update LED information Add the "color" and "description" properties. Signed-off-by: Trevor Woerner Message-ID: <20230822143051.7640-2-twoerner@gmail.com> Signed-off-by: Tony Lindgren commit 05ee882d396f0468882c2f47b3428884d2cd3f09 Author: Andreas Kemnade Date: Sat Aug 19 16:31:09 2023 +0200 ARM: dts: omap4: embt2ws: add LED Add LED since the driver is now available. Signed-off-by: Andreas Kemnade Message-ID: <20230819143109.471615-1-andreas@kemnade.info> Signed-off-by: Tony Lindgren commit 2a1c5c7de468801d414dcb4410aba32c3ee7207b Author: Johannes Berg Date: Mon Sep 25 17:25:11 2023 +0200 wifi: mac80211: expand __ieee80211_data_to_8023() status Make __ieee80211_data_to_8023() return more individual drop reasons instead of just doing RX_DROP_U_INVALID_8023. Signed-off-by: Johannes Berg commit 6c02fab72429b4950f5d6edd003310d9245e18e4 Author: Johannes Berg Date: Mon Sep 25 17:25:10 2023 +0200 wifi: mac80211: split ieee80211_drop_unencrypted_mgmt() return value This has many different reasons, split the return value into the individual reasons for better traceability. Also, since symbolic tracing doesn't work for these, add a few comments for the numbering. Signed-off-by: Johannes Berg commit dccc9aa7ee84a9bed7a4840608829eba66f84cb9 Author: Johannes Berg Date: Mon Sep 25 17:25:09 2023 +0200 wifi: mac80211: remove RX_DROP_UNUSABLE Convert all instances of RX_DROP_UNUSABLE to indicate a better reason, and then remove RX_DROP_UNUSABLE. Signed-off-by: Johannes Berg commit 583058542f46e3e2b0c536316fbd641f62d91dc6 Author: Johannes Berg Date: Mon Sep 25 17:24:39 2023 +0200 wifi: mac80211: fix check for unusable RX result If we just check "result & RX_DROP_UNUSABLE", this really only works by accident, because SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE got to have the value 1, and SKB_DROP_REASON_SUBSYS_MAC80211_MONITOR is 2. Fix this to really check the entire subsys mask for the value, so it doesn't matter what the subsystem value is. Fixes: 7f4e09700bdc ("wifi: mac80211: report all unusable beacon frames") Signed-off-by: Johannes Berg commit e406f291501050e63a805d6b87a0d9bf198fedf9 Author: Johannes Berg Date: Mon Sep 25 17:24:28 2023 +0200 wifi: cfg80211: add local_state_change to deauth trace Add the local_state_change request to the deauth trace for easier debugging. Signed-off-by: Johannes Berg commit caaeb8c551123e26e86270c8dec99a78f1f6fe0f Author: Rob Herring Date: Mon Sep 25 16:27:10 2023 -0500 dt-bindings: pinctrl: Add missing additionalProperties on child node schemas Just as unevaluatedProperties or additionalProperties are required at the top level of schemas, they should (and will) also be required for child node schemas. That ensures only documented properties are present for any node. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230925212713.1975800-1-robh@kernel.org Signed-off-by: Linus Walleij commit aa511ff8218b3fb328181fbaac48aa5e9c5c6d93 Author: Coly Li Date: Sat Aug 12 01:05:12 2023 +0800 badblocks: switch to the improved badblock handling code This patch removes old code of badblocks_set(), badblocks_clear() and badblocks_check(), and make them as wrappers to call _badblocks_set(), _badblocks_clear() and _badblocks_check(). By this change now the badblock handing switch to the improved algorithm in _badblocks_set(), _badblocks_clear() and _badblocks_check(). This patch only contains the changes of old code deletion, new added code for the improved algorithms are in previous patches. Signed-off-by: Coly Li Cc: Dan Williams Cc: Geliang Tang Cc: Hannes Reinecke Cc: Jens Axboe Cc: NeilBrown Cc: Vishal L Verma Cc: Xiao Ni Reviewed-by: Xiao Ni Acked-by: Geliang Tang Link: https://lore.kernel.org/r/20230811170513.2300-7-colyli@suse.de Signed-off-by: Jens Axboe commit 3ea3354cb9f03e34ee3fab98f127ab8da4131eee Author: Coly Li Date: Sat Aug 12 01:05:11 2023 +0800 badblocks: improve badblocks_check() for multiple ranges handling This patch rewrites badblocks_check() with similar coding style as _badblocks_set() and _badblocks_clear(). The only difference is bad blocks checking may handle multiple ranges in bad tables now. If a checking range covers multiple bad blocks range in bad block table, like the following condition (C is the checking range, E1, E2, E3 are three bad block ranges in bad block table), +------------------------------------+ | C | +------------------------------------+ +----+ +----+ +----+ | E1 | | E2 | | E3 | +----+ +----+ +----+ The improved badblocks_check() algorithm will divide checking range C into multiple parts, and handle them in 7 runs of a while-loop, +--+ +----+ +----+ +----+ +----+ +----+ +----+ |C1| | C2 | | C3 | | C4 | | C5 | | C6 | | C7 | +--+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+ | E1 | | E2 | | E3 | +----+ +----+ +----+ And the start LBA and length of range E1 will be set as first_bad and bad_sectors for the caller. The return value rule is consistent for multiple ranges. For example if there are following bad block ranges in bad block table, Index No. Start Len Ack 0 400 20 1 1 500 50 1 2 650 20 0 the return value, first_bad, bad_sectors by calling badblocks_set() with different checking range can be the following values, Checking Start, Len Return Value first_bad bad_sectors 100, 100 0 N/A N/A 100, 310 1 400 10 100, 440 1 400 10 100, 540 1 400 10 100, 600 -1 400 10 100, 800 -1 400 10 In order to make code review easier, this patch names the improved bad block range checking routine as _badblocks_check() and does not change existing badblock_check() code yet. Later patch will delete old code of badblocks_check() and make it as a wrapper to call _badblocks_check(). Then the new added code won't mess up with the old deleted code, it will be more clear and easier for code review. Signed-off-by: Coly Li Cc: Dan Williams Cc: Geliang Tang Cc: Hannes Reinecke Cc: Jens Axboe Cc: NeilBrown Cc: Vishal L Verma Cc: Xiao Ni Reviewed-by: Xiao Ni Acked-by: Geliang Tang Link: https://lore.kernel.org/r/20230811170513.2300-6-colyli@suse.de Signed-off-by: Jens Axboe commit db448eb6862979aad2468ecf957a20ef98b82f29 Author: Coly Li Date: Sat Aug 12 01:05:10 2023 +0800 badblocks: improve badblocks_clear() for multiple ranges handling With the fundamental ideas and helper routines from badblocks_set() improvement, clearing bad block for multiple ranges is much simpler. With a similar idea from badblocks_set() improvement, this patch simplifies bad block range clearing into 5 situations. No matter how complicated the clearing condition is, we just look at the head part of clearing range with relative already set bad block range from the bad block table. The rested part will be handled in next run of the while-loop. Based on existing helpers added from badblocks_set(), this patch adds two more helpers, - front_clear() Clear the bad block range from bad block table which is front overlapped with the clearing range. - front_splitting_clear() Handle the condition that the clearing range hits middle of an already set bad block range from bad block table. Similar as badblocks_set(), the first part of clearing range is handled with relative bad block range which is find by prev_badblocks(). In most cases a valid hint is provided to prev_badblocks() to avoid unnecessary bad block table iteration. This patch also explains the detail algorithm code comments at beginning of badblocks.c, including which five simplified situations are categrized and how all the bad block range clearing conditions are handled by these five situations. Again, in order to make the code review easier and avoid the code changes mixed together, this patch does not modify badblock_clear() and implement another routine called _badblock_clear() for the improvement. Later patch will delete current code of badblock_clear() and make it as a wrapper to _badblock_clear(), so the code change can be much clear for review. Signed-off-by: Coly Li Cc: Dan Williams Cc: Geliang Tang Cc: Hannes Reinecke Cc: Jens Axboe Cc: NeilBrown Cc: Vishal L Verma Cc: Xiao Ni Reviewed-by: Xiao Ni Acked-by: Geliang Tang Link: https://lore.kernel.org/r/20230811170513.2300-5-colyli@suse.de Signed-off-by: Jens Axboe commit 1726c774678331b4af5e78db87e10ff5da448456 Author: Coly Li Date: Sat Aug 12 01:05:09 2023 +0800 badblocks: improve badblocks_set() for multiple ranges handling Recently I received a bug report that current badblocks code does not properly handle multiple ranges. For example, badblocks_set(bb, 32, 1, true); badblocks_set(bb, 34, 1, true); badblocks_set(bb, 36, 1, true); badblocks_set(bb, 32, 12, true); Then indeed badblocks_show() reports, 32 3 36 1 But the expected bad blocks table should be, 32 12 Obviously only the first 2 ranges are merged and badblocks_set() returns and ignores the rest setting range. This behavior is improper, if the caller of badblocks_set() wants to set a range of blocks into bad blocks table, all of the blocks in the range should be handled even the previous part encountering failure. The desired way to set bad blocks range by badblocks_set() is, - Set as many as blocks in the setting range into bad blocks table. - Merge the bad blocks ranges and occupy as less as slots in the bad blocks table. - Fast. Indeed the above proposal is complicated, especially with the following restrictions, - The setting bad blocks range can be acknowledged or not acknowledged. - The bad blocks table size is limited. - Memory allocation should be avoided. The basic idea of the patch is to categorize all possible bad blocks range setting combinations into much less simplified and more less special conditions. Inside badblocks_set() there is an implicit loop composed by jumping between labels 're_insert' and 'update_sectors'. No matter how large the setting bad blocks range is, in every loop just a minimized range from the head is handled by a pre-defined behavior from one of the categorized conditions. The logic is simple and code flow is manageable. The different relative layout between the setting range and existing bad block range are checked and handled (merge, combine, overwrite, insert) by the helpers in previous patch. This patch is to make all the helpers work together with the above idea. This patch only has the algorithm improvement for badblocks_set(). There are following patches contain improvement for badblocks_clear() and badblocks_check(). But the algorithm in badblocks_set() is fundamental and typical, other improvement in clear and check routines are based on all the helpers and ideas in this patch. In order to make the change to be more clear for code review, this patch does not directly modify existing badblocks_set(), and just add a new one named _badblocks_set(). Later patch will remove current existing badblocks_set() code and make it as a wrapper of _badblocks_set(). So the new added change won't be mixed with deleted code, the code review can be easier. Signed-off-by: Coly Li Cc: Dan Williams Cc: Geliang Tang Cc: Hannes Reinecke Cc: Jens Axboe Cc: NeilBrown Cc: Vishal L Verma Cc: Wols Lists Cc: Xiao Ni Reviewed-by: Xiao Ni Acked-by: Geliang Tang Link: https://lore.kernel.org/r/20230811170513.2300-4-colyli@suse.de Signed-off-by: Jens Axboe commit c3c6a86e9efc5da5964260c322fe07feca6df782 Author: Coly Li Date: Sat Aug 12 01:05:08 2023 +0800 badblocks: add helper routines for badblock ranges handling This patch adds several helper routines to improve badblock ranges handling. These helper routines will be used later in the improved version of badblocks_set()/badblocks_clear()/badblocks_check(). - Helpers prev_by_hint() and prev_badblocks() are used to find the bad range from bad table which the searching range starts at or after. - The following helpers are to decide the relative layout between the manipulating range and existing bad block range from bad table. - can_merge_behind() Return 'true' if the manipulating range can backward merge with the bad block range. - can_merge_front() Return 'true' if the manipulating range can forward merge with the bad block range. - can_combine_front() Return 'true' if two adjacent bad block ranges before the manipulating range can be merged. - overlap_front() Return 'true' if the manipulating range exactly overlaps with the bad block range in front of its range. - overlap_behind() Return 'true' if the manipulating range exactly overlaps with the bad block range behind its range. - can_front_overwrite() Return 'true' if the manipulating range can forward overwrite the bad block range in front of its range. - The following helpers are to add the manipulating range into the bad block table. Different routine is called with the specific relative layout between the manipulating range and other bad block range in the bad block table. - behind_merge() Merge the manipulating range with the bad block range behind its range, and return the number of merged length in unit of sector. - front_merge() Merge the manipulating range with the bad block range in front of its range, and return the number of merged length in unit of sector. - front_combine() Combine the two adjacent bad block ranges before the manipulating range into a larger one. - front_overwrite() Overwrite partial of whole bad block range which is in front of the manipulating range. The overwrite may split existing bad block range and generate more bad block ranges into the bad block table. - insert_at() Insert the manipulating range at a specific location in the bad block table. All the above helpers are used in later patches to improve the bad block ranges handling for badblocks_set()/badblocks_clear()/badblocks_check(). Signed-off-by: Coly Li Cc: Dan Williams Cc: Geliang Tang Cc: Hannes Reinecke Cc: Jens Axboe Cc: NeilBrown Cc: Vishal L Verma Cc: Xiao Ni Reviewed-by: Xiao Ni Acked-by: Geliang Tang Link: https://lore.kernel.org/r/20230811170513.2300-3-colyli@suse.de Signed-off-by: Jens Axboe commit e850d9a52f4cd31521c80a7ea9718b69129af4d5 Author: Coly Li Date: Sat Aug 12 01:05:07 2023 +0800 badblocks: add more helper structure and routines in badblocks.h This patch adds the following helper structure and routines into badblocks.h, - struct badblocks_context This structure is used in improved badblocks code for bad table iteration. - BB_END() The macro to calculate end LBA of a bad range record from bad table. - badblocks_full() and badblocks_empty() The inline routines to check whether bad table is full or empty. - set_changed() and clear_changed() The inline routines to set and clear 'changed' tag from struct badblocks. These new helper structure and routines can help to make the code more clear, they will be used in the improved badblocks code in following patches. Signed-off-by: Coly Li Reviewed-by: Xiao Ni Cc: Dan Williams Cc: Geliang Tang Cc: Hannes Reinecke Cc: Jens Axboe Cc: NeilBrown Cc: Vishal L Verma Acked-by: Geliang Tang Link: https://lore.kernel.org/r/20230811170513.2300-2-colyli@suse.de Signed-off-by: Jens Axboe commit a383a021804ce5eb8fada3ee83ce8a74077fe9b9 Author: Ashutosh Dixit Date: Tue Sep 19 21:02:11 2023 -0700 drm/i915/perf: Remove gtt_offset from stream->oa_buffer.head/.tail There is no reason to add gtt_offset to the cached head/tail pointers stream->oa_buffer.head and stream->oa_buffer.tail. This causes the code to constantly add gtt_offset and subtract gtt_offset and is error prone. It is much simpler to maintain stream->oa_buffer.head and stream->oa_buffer.tail without adding gtt_offset to them and just allow for the gtt_offset when reading/writing from/to HW registers. v2: Minor tweak to commit message due to dropping patch in previous series Signed-off-by: Ashutosh Dixit Reviewed-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20230920040211.2351279-1-ashutosh.dixit@intel.com commit 5b11888471806edf699316d4dcb9b426caebbef2 Author: Eric Biggers Date: Sun Sep 24 22:54:51 2023 -0700 fscrypt: support crypto data unit size less than filesystem block size Until now, fscrypt has always used the filesystem block size as the granularity of file contents encryption. Two scenarios have come up where a sub-block granularity of contents encryption would be useful: 1. Inline crypto hardware that only supports a crypto data unit size that is less than the filesystem block size. 2. Support for direct I/O at a granularity less than the filesystem block size, for example at the block device's logical block size in order to match the traditional direct I/O alignment requirement. (1) first came up with older eMMC inline crypto hardware that only supports a crypto data unit size of 512 bytes. That specific case ultimately went away because all systems with that hardware continued using out of tree code and never actually upgraded to the upstream inline crypto framework. But, now it's coming back in a new way: some current UFS controllers only support a data unit size of 4096 bytes, and there is a proposal to increase the filesystem block size to 16K. (2) was discussed as a "nice to have" feature, though not essential, when support for direct I/O on encrypted files was being upstreamed. Still, the fact that this feature has come up several times does suggest it would be wise to have available. Therefore, this patch implements it by using one of the reserved bytes in fscrypt_policy_v2 to allow users to select a sub-block data unit size. Supported data unit sizes are powers of 2 between 512 and the filesystem block size, inclusively. Support is implemented for both the FS-layer and inline crypto cases. This patch focuses on the basic support for sub-block data units. Some things are out of scope for this patch but may be addressed later: - Supporting sub-block data units in combination with FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64, in most cases. Unfortunately this combination usually causes data unit indices to exceed 32 bits, and thus fscrypt_supported_policy() correctly disallows it. The users who potentially need this combination are using f2fs. To support it, f2fs would need to provide an option to slightly reduce its max file size. - Supporting sub-block data units in combination with FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32. This has the same problem described above, but also it will need special code to make DUN wraparound still happen on a FS block boundary. - Supporting use case (2) mentioned above. The encrypted direct I/O code will need to stop requiring and assuming FS block alignment. This won't be hard, but it belongs in a separate patch. - Supporting this feature on filesystems other than ext4 and f2fs. (Filesystems declare support for it via their fscrypt_operations.) On UBIFS, sub-block data units don't make sense because UBIFS encrypts variable-length blocks as a result of compression. CephFS could support it, but a bit more work would be needed to make the fscrypt_*_block_inplace functions play nicely with sub-block data units. I don't think there's a use case for this on CephFS anyway. Link: https://lore.kernel.org/r/20230925055451.59499-6-ebiggers@kernel.org Signed-off-by: Eric Biggers commit 7a0263dc904f3467f474e4088ae092eda9a5a99b Author: Eric Biggers Date: Sun Sep 24 22:54:50 2023 -0700 fscrypt: replace get_ino_and_lblk_bits with just has_32bit_inodes Now that fs/crypto/ computes the filesystem's lblk_bits from its maximum file size, it is no longer necessary for filesystems to provide lblk_bits via fscrypt_operations::get_ino_and_lblk_bits. It is still necessary for fs/crypto/ to retrieve ino_bits from the filesystem. However, this is used only to decide whether inode numbers fit in 32 bits. Also, ino_bits is static for all relevant filesystems, i.e. it doesn't depend on the filesystem instance. Therefore, in the interest of keeping things as simple as possible, replace 'get_ino_and_lblk_bits' with a flag 'has_32bit_inodes'. This can always be changed back to a function if a filesystem needs it to be dynamic, but for now a static flag is all that's needed. Link: https://lore.kernel.org/r/20230925055451.59499-5-ebiggers@kernel.org Signed-off-by: Eric Biggers commit f0904e8bc3c513e9fd50bdca5365f998578177a0 Author: Eric Biggers Date: Sun Sep 24 22:54:49 2023 -0700 fscrypt: compute max_lblk_bits from s_maxbytes and block size For a given filesystem, the number of bits used by the maximum file logical block number is computable from the maximum file size and the block size. These values are always present in struct super_block. Therefore, compute it this way instead of using the value from fscrypt_operations::get_ino_and_lblk_bits. Since filesystems always have to set the super_block fields anyway, this avoids having to provide this information redundantly via fscrypt_operations. This change is in preparation for adding support for sub-block data units. For that, the value that is needed will become "the maximum file data unit index". A hardcoded value won't suffice for that; it will need to be computed anyway. Link: https://lore.kernel.org/r/20230925055451.59499-4-ebiggers@kernel.org Signed-off-by: Eric Biggers commit 78f54469b871db5ba8ea49abd4e5994e97bd525b Author: Danilo Krummrich Date: Wed Sep 20 16:42:36 2023 +0200 drm/nouveau: uvmm: rename 'umgr' to 'base' Rename struct drm_gpuvm within struct nouveau_uvmm from 'umgr' to base. Reviewed-by: Dave Airlie Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20230920144343.64830-4-dakr@redhat.com commit fe7acaa727e135621c062caa2d6d3ad4ad0b0185 Author: Danilo Krummrich Date: Wed Sep 20 16:42:35 2023 +0200 drm/gpuvm: allow building as module Currently, the DRM GPUVM does not have any core dependencies preventing a module build. Also, new features from subsequent patches require helpers (namely drm_exec) which can be built as module. Reviewed-by: Christian König Reviewed-by: Dave Airlie Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20230920144343.64830-3-dakr@redhat.com commit f72c2db47080523d5e0f3c20846c96ed31c35648 Author: Danilo Krummrich Date: Wed Sep 20 16:42:34 2023 +0200 drm/gpuvm: rename struct drm_gpuva_manager to struct drm_gpuvm Rename struct drm_gpuva_manager to struct drm_gpuvm including corresponding functions. This way the GPUVA manager's structures align very well with the documentation of VM_BIND [1] and VM_BIND locking [2]. It also provides a better foundation for the naming of data structures and functions introduced for implementing a common dma-resv per GPU-VM including tracking of external and evicted objects in subsequent patches. [1] Documentation/gpu/drm-vm-bind-async.rst [2] Documentation/gpu/drm-vm-bind-locking.rst Cc: Thomas Hellström Cc: Matthew Brost Acked-by: Dave Airlie Acked-by: Christian König Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20230920144343.64830-2-dakr@redhat.com commit 0e73ef1d8c09a1f21ca2b19684819dbbcdce00f9 Merge: e0fa6523e02ab 85981e0f9e9fc Author: Andrii Nakryiko Date: Mon Sep 25 16:37:45 2023 -0700 Merge branch 'bpf: Add missed stats for kprobes' Jiri Olsa says: ==================== hi, at the moment we can't retrieve the number of missed kprobe executions and subsequent execution of BPF programs. This patchset adds: - counting of missed execution on attach layer for: . kprobes attached through perf link (kprobe/ftrace) . kprobes attached through kprobe.multi link (fprobe) - counting of recursion_misses for BPF kprobe programs It's still technically possible to create kprobe without perf link (using SET_BPF perf ioctl) in which case we don't have a way to retrieve the kprobe's 'missed' count. However both libbpf and cilium/ebpf libraries use perf link if it's available, and for old kernels without perf link support we can use BPF program to retrieve the kprobe missed count. v3 changes: - added acks [Song] - make test_missed not serial [Andrii] Also available at: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/missed_stats thanks, jirka ==================== Signed-off-by: Andrii Nakryiko commit 85981e0f9e9fc882578f0ad7488d6c59193dd187 Author: Jiri Olsa Date: Wed Sep 20 23:31:45 2023 +0200 selftests/bpf: Add test for recursion counts of perf event link tracepoint Adding selftest that puts kprobe on bpf_fentry_test1 that calls bpf_printk and invokes bpf_trace_printk tracepoint. The bpf_trace_printk tracepoint has test[234] programs attached to it. Because kprobe execution goes through bpf_prog_active check, programs attached to the tracepoint will fail the recursion check and increment the recursion_misses stats. Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Tested-by: Song Liu Reviewed-by: Song Liu Link: https://lore.kernel.org/bpf/20230920213145.1941596-10-jolsa@kernel.org commit 59e83c0187c5eed648c28aea637a5cf3e246921b Author: Jiri Olsa Date: Wed Sep 20 23:31:44 2023 +0200 selftests/bpf: Add test for recursion counts of perf event link kprobe Adding selftest that puts kprobe.multi on bpf_fentry_test1 that calls bpf_kfunc_common_test kfunc which has 3 perf event kprobes and 1 kprobe.multi attached. Because fprobe (kprobe.multi attach layear) does not have strict recursion check the kprobe's bpf_prog_active check is hit for test2-5. Disabling this test for arm64, because there's no fprobe support yet. Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Tested-by: Song Liu Reviewed-by: Song Liu Acked-by: Hou Tao Link: https://lore.kernel.org/bpf/20230920213145.1941596-9-jolsa@kernel.org commit 01e4ae474e39b855f911caec355bb79e722562b3 Author: Jiri Olsa Date: Wed Sep 20 23:31:43 2023 +0200 selftests/bpf: Add test for missed counts of perf event link kprobe Adding test that puts kprobe on bpf_fentry_test1 that calls bpf_kfunc_common_test kfunc, which has also kprobe on. The latter won't get triggered due to kprobe recursion check and kprobe missed counter is incremented. Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Acked-by: Hou Tao Link: https://lore.kernel.org/bpf/20230920213145.1941596-8-jolsa@kernel.org commit b563b9bae8c3a6583e34820856dc6eafc2239aaf Author: Jiri Olsa Date: Wed Sep 20 23:31:42 2023 +0200 bpftool: Display missed count for kprobe perf link Adding 'missed' field to display missed counts for kprobes attached by perf event link, like: # bpftool link 5: perf_event prog 82 kprobe ffffffff815203e0 ksys_write 6: perf_event prog 83 kprobe ffffffff811d1e50 scheduler_tick missed 682217 # bpftool link -jp [{ "id": 5, "type": "perf_event", "prog_id": 82, "retprobe": false, "addr": 18446744071584220128, "func": "ksys_write", "offset": 0, "missed": 0 },{ "id": 6, "type": "perf_event", "prog_id": 83, "retprobe": false, "addr": 18446744071580753488, "func": "scheduler_tick", "offset": 0, "missed": 693469 } ] Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20230920213145.1941596-7-jolsa@kernel.org commit b24fc35521b09b5feaf5d06a75e8a43042592d0b Author: Jiri Olsa Date: Wed Sep 20 23:31:41 2023 +0200 bpftool: Display missed count for kprobe_multi link Adding 'missed' field to display missed counts for kprobes attached by kprobe multi link, like: # bpftool link 5: kprobe_multi prog 76 kprobe.multi func_cnt 1 missed 1 addr func [module] ffffffffa039c030 fp3_test [fprobe_test] # bpftool link -jp [{ "id": 5, "type": "kprobe_multi", "prog_id": 76, "retprobe": false, "func_cnt": 1, "missed": 1, "funcs": [{ "addr": 18446744072102723632, "func": "fp3_test", "module": "fprobe_test" } ] } ] Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20230920213145.1941596-6-jolsa@kernel.org commit dd8657894c11b03c6eb0fd53fe9d7fec2072d18b Author: Jiri Olsa Date: Wed Sep 20 23:31:40 2023 +0200 bpf: Count missed stats in trace_call_bpf Increase misses stats in case bpf array execution is skipped because of recursion check in trace_call_bpf. Adding bpf_prog_inc_misses_counters that increase misses counts for all bpf programs in bpf_prog_array. Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Tested-by: Song Liu Reviewed-by: Song Liu Link: https://lore.kernel.org/bpf/20230920213145.1941596-5-jolsa@kernel.org commit 3acf8ace68230e9558cf916847f1cc9f208abdf1 Author: Jiri Olsa Date: Wed Sep 20 23:31:39 2023 +0200 bpf: Add missed value to kprobe perf link info Add missed value to kprobe attached through perf link info to hold the stats of missed kprobe handler execution. The kprobe's missed counter gets incremented when kprobe handler is not executed due to another kprobe running on the same cpu. Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230920213145.1941596-4-jolsa@kernel.org commit e2b2cd592adbd303bcc02451d32fedd511000fb0 Author: Jiri Olsa Date: Wed Sep 20 23:31:38 2023 +0200 bpf: Add missed value to kprobe_multi link info Add missed value to kprobe_multi link info to hold the stats of missed kprobe_multi probe. The missed counter gets incremented when fprobe fails the recursion check or there's no rethook available for return probe. In either case the attached bpf program is not executed. Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Tested-by: Song Liu Reviewed-by: Song Liu Acked-by: Hou Tao Link: https://lore.kernel.org/bpf/20230920213145.1941596-3-jolsa@kernel.org commit f915fcb38553eb9150a918348d932fd292de71dc Author: Jiri Olsa Date: Wed Sep 20 23:31:37 2023 +0200 bpf: Count stats for kprobe_multi programs Adding support to gather missed stats for kprobe_multi programs due to bpf_prog_active protection. Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Tested-by: Song Liu Reviewed-by: Song Liu Link: https://lore.kernel.org/bpf/20230920213145.1941596-2-jolsa@kernel.org commit e0fa6523e02ab31a27daf52e58a0d95fd52d5300 Merge: 831916fb93d4b cb3d7dd2d0dbe Author: Andrii Nakryiko Date: Mon Sep 25 16:22:43 2023 -0700 Merge branch 'add libbpf getters for individual ringbuffers' Martin Kelly says: ==================== This patch series adds a new ring__ API to libbpf exposing getters for accessing the individual ringbuffers inside a struct ring_buffer. This is useful for polling individually, getting available data, or similar use cases. The API looks like this, and was roughly proposed by Andrii Nakryiko in another thread: Getting a ring struct: struct ring *ring_buffer__ring(struct ring_buffer *rb, unsigned int idx); Using the ring struct: unsigned long ring__consumer_pos(const struct ring *r); unsigned long ring__producer_pos(const struct ring *r); size_t ring__avail_data_size(const struct ring *r); size_t ring__size(const struct ring *r); int ring__map_fd(const struct ring *r); int ring__consume(struct ring *r); Changes in v2: - Addressed all feedback from Andrii Nakryiko ==================== Signed-off-by: Andrii Nakryiko commit cb3d7dd2d0dbe92ff3ebdd87fefc254f1c89aeeb Author: Martin Kelly Date: Mon Sep 25 14:50:45 2023 -0700 selftests/bpf: Add tests for ring__consume Add tests for new API ring__consume. Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-15-martin.kelly@crowdstrike.com commit 16058ff28b7eedd62f1643beb841e3bd611674fe Author: Martin Kelly Date: Mon Sep 25 14:50:44 2023 -0700 libbpf: Add ring__consume Add ring__consume to consume a single ringbuffer, analogous to ring_buffer__consume. Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-14-martin.kelly@crowdstrike.com commit 6e38ba5291f9e082f9472a8ef682dc54cff0b3e4 Author: Martin Kelly Date: Mon Sep 25 14:50:43 2023 -0700 selftests/bpf: Add tests for ring__map_fd Add tests for the new API ring__map_fd. Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-13-martin.kelly@crowdstrike.com commit ae769390377adaec2798bd1a69171f00d0a25be0 Author: Martin Kelly Date: Mon Sep 25 14:50:42 2023 -0700 libbpf: Add ring__map_fd Add ring__map_fd to get the file descriptor underlying a given ringbuffer. Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-12-martin.kelly@crowdstrike.com commit bb32dd2c8fec71990bbc231aac934e1c73a17341 Author: Martin Kelly Date: Mon Sep 25 14:50:41 2023 -0700 selftests/bpf: Add tests for ring__size Add tests for the new API ring__size. Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-11-martin.kelly@crowdstrike.com commit e79abf717fce6439022547124571dfe17f2ac15a Author: Martin Kelly Date: Mon Sep 25 14:50:40 2023 -0700 libbpf: Add ring__size Add ring__size to get the total size of a given ringbuffer. Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-10-martin.kelly@crowdstrike.com commit f3a01d385fbb9c76abfad8d104d08453f289e2d3 Author: Martin Kelly Date: Mon Sep 25 14:50:39 2023 -0700 selftests/bpf: Add tests for ring__avail_data_size Add test for the new API ring__avail_data_size. Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-9-martin.kelly@crowdstrike.com commit 3b34d2972612299fb38ad7f3c2bc62c2d03237f3 Author: Martin Kelly Date: Mon Sep 25 14:50:38 2023 -0700 libbpf: Add ring__avail_data_size Add ring__avail_data_size for querying the currently available data in the ringbuffer, similar to the BPF_RB_AVAIL_DATA flag in bpf_ringbuf_query. This is racy during ongoing operations but is still useful for overall information on how a ringbuffer is behaving. Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-8-martin.kelly@crowdstrike.com commit b18db8712ecf5c880da222f6e0d7be53f0af4c4d Author: Martin Kelly Date: Mon Sep 25 14:50:37 2023 -0700 selftests/bpf: Add tests for ring__*_pos Add tests for the new APIs ring__producer_pos and ring__consumer_pos. Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-7-martin.kelly@crowdstrike.com commit 059a8c0c5acd37ecfa64f1832e8765d30f253ce8 Author: Martin Kelly Date: Mon Sep 25 14:50:36 2023 -0700 libbpf: Add ring__producer_pos, ring__consumer_pos Add APIs to get the producer and consumer position for a given ringbuffer. Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-6-martin.kelly@crowdstrike.com commit c1ad2e47f97c6d95e52be0c2a68b23fc99214734 Author: Martin Kelly Date: Mon Sep 25 14:50:35 2023 -0700 selftests/bpf: Add tests for ring_buffer__ring Add tests for the new API ring_buffer__ring. Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-5-martin.kelly@crowdstrike.com commit 1c97f6afd73934881ae8514c51efc8e162b4b406 Author: Martin Kelly Date: Mon Sep 25 14:50:34 2023 -0700 libbpf: Add ring_buffer__ring Add a new function ring_buffer__ring, which exposes struct ring * to the user, representing a single ringbuffer. Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-4-martin.kelly@crowdstrike.com commit ef3b82003e6ca9554a144a9f42e7239ba39f0b97 Author: Martin Kelly Date: Mon Sep 25 14:50:33 2023 -0700 libbpf: Switch rings to array of pointers Switch rb->rings to be an array of pointers instead of a contiguous block. This allows for each ring pointer to be stable after ring_buffer__add is called, which allows us to expose struct ring * to the user without gotchas. Without this change, the realloc in ring_buffer__add could invalidate a struct ring *, making it unsafe to give to the user. Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-3-martin.kelly@crowdstrike.com commit 4448f64c549c28175dd9af4e8f9a2e0c62ef6d38 Author: Martin Kelly Date: Mon Sep 25 14:50:32 2023 -0700 libbpf: Refactor cleanup in ring_buffer__add Refactor the cleanup code in ring_buffer__add to use a unified err_out label. This reduces code duplication, as well as plugging a potential leak if mmap_sz != (__u64)(size_t)mmap_sz (currently this would miss unmapping tmp because ringbuf_unmap_ring isn't called). Signed-off-by: Martin Kelly Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230925215045.2375758-2-martin.kelly@crowdstrike.com commit 89755ee1d59311855b4afcf35aebddcb653b3cd5 Author: Douglas Anderson Date: Thu Sep 21 12:26:44 2023 -0700 drm/imx/dcss: Call drm_atomic_helper_shutdown() at shutdown time Based on grepping through the source code this driver appears to be missing a call to drm_atomic_helper_shutdown() at system shutdown time. Among other things, this means that if a panel is in use that it won't be cleanly powered off at system shutdown time. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown/restart comes straight out of the kernel doc "driver instance overview" in drm_drv.c. Suggested-by: Maxime Ripard Reviewed-by: Maxime Ripard Tested-by: Laurentiu Palcu Reviewed-by: Laurentiu Palcu Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230921122641.RFT.v2.1.I134336fce7eac5a63bdac46d57b0888858fc8081@changeid commit cab63f64887616e3c4e31cfd8103320be6ebc8d3 Author: Dinghao Liu Date: Thu Sep 21 16:24:10 2023 +0800 i3c: Fix potential refcount leak in i3c_master_register_new_i3c_devs put_device() needs to be called on failure of device_register() to give up the reference initialized in it to avoid refcount leak. Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure") Signed-off-by: Dinghao Liu Link: https://lore.kernel.org/r/20230921082410.25548-1-dinghao.liu@zju.edu.cn Signed-off-by: Alexandre Belloni commit ceb0416383988dbd5decd6a70141a3507732c160 Author: Justin Stitt Date: Mon Sep 25 09:49:17 2023 +0000 md: replace deprecated strncpy with memcpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. There are three such strncpy uses that this patch addresses: The respective destination buffers are: 1) mddev->clevel 2) clevel 3) mddev->metadata_type We expect mddev->clevel to be NUL-terminated due to its use with format strings: | ret = sprintf(page, "%s\n", mddev->clevel); Furthermore, we can see that mddev->clevel is not expected to be NUL-padded as `md_clean()` merely set's its first byte to NULL -- not the entire buffer: | static void md_clean(struct mddev *mddev) | { | mddev->array_sectors = 0; | mddev->external_size = 0; | ... | mddev->level = LEVEL_NONE; | mddev->clevel[0] = 0; | ... A suitable replacement for this instance is `memcpy` as we know the number of bytes to copy and perform manual NUL-termination at a specified offset. This really decays to just a byte copy from one buffer to another. `strscpy` is also a considerable replacement but using `slen` as the length argument would result in truncation of the last byte unless something like `slen + 1` was provided which isn't the most idiomatic strscpy usage. For the next case, the destination buffer `clevel` is expected to be NUL-terminated based on its usage within kstrtol() which expects NUL-terminated strings. Note that, in context, this code removes a trailing newline which is seemingly not required as kstrtol() can handle trailing newlines implicitly. However, there exists further usage of clevel (or buf) that would also like to have the newline removed. All in all, with similar reasoning to the first case, let's just use memcpy as this is just a byte copy and NUL-termination is handled manually. The third and final case concerning `mddev->metadata_type` is more or less the same as the other two. We expect that it be NUL-terminated based on its usage with seq_printf: | seq_printf(seq, " super external:%s", | mddev->metadata_type); ... and we can surmise that NUL-padding isn't required either due to how it is handled in md_clean(): | static void md_clean(struct mddev *mddev) | { | ... | mddev->metadata_type[0] = 0; | ... So really, all these instances have precisely calculated lengths and purposeful NUL-termination so we can just use memcpy to remove ambiguity surrounding strncpy. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230925-strncpy-drivers-md-md-c-v1-1-2b0093b89c2b@google.com commit fc9176e794d74baccb1e4ef41894ac141f524992 Author: Jarkko Nikula Date: Thu Sep 21 08:57:04 2023 +0300 i3c: mipi-i3c-hci: Resume controller after aborted transfer Host Controller goes to halt state after aborted transfer and needs to be resumed by SW. Add this resuming to DMA mode code too. Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230921055704.1087277-13-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni commit 3521fa63c1ee7414e6ba0fdf98b82b07939147d9 Author: Jarkko Nikula Date: Thu Sep 21 08:57:03 2023 +0300 i3c: mipi-i3c-hci: Resume controller explicitly On an HW I'm using in enabling work the RESUME bit is not set in the HC_CONTROLLER register when Host Controller goes to halt state. Value 1 should mean controller is suspended when reading and writing 1 resumes it. Because of this erratic behaviour plain HC_CONTROL read and write back won't resume the controller. Therefore do it by setting the RESUME bit explicitly. Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230921055704.1087277-12-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni commit 4c36f656b7d1fc00643730c5845c19b3e15be856 Author: Jarkko Nikula Date: Thu Sep 21 08:57:02 2023 +0300 i3c: mipi-i3c-hci: Fix missing xfer->completion in hci_cmd_v1_daa() Due to missing completion object for the ENTDAA command transfer in the hci_cmd_v1_daa() the wait_for_completion_timeout() will obviously timeout even the transfer itself may succeed. Fix this by setting the xfer->completion to the already initialized completion object. Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230921055704.1087277-11-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni commit b8806e0c939f168237593af0056c309bf31022b0 Author: Jarkko Nikula Date: Thu Sep 21 08:57:01 2023 +0300 i3c: mipi-i3c-hci: Do not unmap region not mapped for transfer Fix following warning (with CONFIG_DMA_API_DEBUG) which happens with a transfer without a data buffer. DMA-API: i3c mipi-i3c-hci.0: device driver tries to free DMA memory it has not allocated [device address=0x0000000000000000] [size=0 bytes] For those transfers the hci_dma_queue_xfer() doesn't create a mapping and the DMA address pointer xfer->data_dma is not set. Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230921055704.1087277-10-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni commit 7ccd40edc1f5c43e3f1c7d209336d3981943ab63 Author: Jarkko Nikula Date: Thu Sep 21 08:57:00 2023 +0300 i3c: mipi-i3c-hci: Set number of SW enabled Ring Bundles earlier Number of software enabled Ring Bundles must be set before using them. Otherwise Ring will not start and may be power-gated by the Host Controller. Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230921055704.1087277-9-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni commit 4e40642cdb621c669507d7ef098c93ff98e8747c Author: Jarkko Nikula Date: Thu Sep 21 08:56:59 2023 +0300 i3c: mipi-i3c-hci: Fix race between bus cleanup and interrupt If there is a transfer error during i3c_master_bus_init() and code goes doing the bus cleanup in i3c_hci_bus_cleanup() there is possibility that i3c_hci_irq_handler() is running in parallel with hci->io->cleanup() which can be racy. Prevent this by waiting there is no pending interrupt on other CPU before doing the IO cleanup. This was observed with ring headers where first transfer failed and sometimes transfer error or ring transfer abort interrupt was coming simultaneously with the bus cleanup path. Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230921055704.1087277-8-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni commit e141db842766b1d9af32030a842ceb5eaf389bbb Author: Jarkko Nikula Date: Thu Sep 21 08:56:58 2023 +0300 i3c: mipi-i3c-hci: Set ring start request together with enable Set ring start request together with ring enable in hci_dma_init(). This causes the ring abort request in hci_dma_dequeue_xfer() will raise the INTR_RING_OP (RING_OP_STAT in MIPI I3C HCI specification) interrupt in the RH_INTR_STATUS register. Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230921055704.1087277-7-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni commit 361acacaf7c706223968c8186f0d3b6e214e7403 Author: Jarkko Nikula Date: Thu Sep 21 08:56:57 2023 +0300 i3c: mipi-i3c-hci: Remove BUG() when Ring Abort request times out Ring Abort request will timeout in case there is an error in the Host Controller interrupt delivery or Ring Header configuration. Using BUG() makes hard to debug those cases. Make it less severe and turn BUG() to WARN_ON(). Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230921055704.1087277-6-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni commit 45a832f989e520095429589d5b01b0c65da9b574 Author: Jarkko Nikula Date: Thu Sep 21 08:56:56 2023 +0300 i3c: mipi-i3c-hci: Fix out of bounds access in hci_dma_irq_handler Do not loop over ring headers in hci_dma_irq_handler() that are not allocated and enabled in hci_dma_init(). Otherwise out of bounds access will occur from rings->headers[i] access when i >= number of allocated ring headers. Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230921055704.1087277-5-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni commit 0676bfebf5766f0a60549f74ba597115028fa39c Author: Jarkko Nikula Date: Thu Sep 21 08:56:55 2023 +0300 i3c: mipi-i3c-hci: Fix DAT/DCT entry sizes MIPI I3C HCI specification v1.1 describes the ENTRY_SIZE field for the Device Address Table (DAT) and the Device Characteristics Table (DCT) section offset registers (DAT_SECTION_OFFSET and DCT_SECTION_OFFSET). That field is not documented in earlier version. ENTRY_SIZE value 0 is meant to be backward compatible. For the DAT entry size it is interpreted as 2 DWORDs (8-bytes) and for the DCT entry size as 4 DWORDs (16-bytes). Values 1-15 are reserved for future use. New version I believe fixes also the TABLE_SIZE field description. Before it was defined in DWORDs which I believe is incorrect since the DAT/DCT table entry structures, and sizes, are described having 8-bytes/16-bytes entries. This is more clear in the specification v1.1 which states the TABLE_SIZE fields are interpreted as number of entries in the DAT/DCT tables. I believe this same holds also in earlier version, at least it makes more sense. Fix code accordingly and let the DAT_entry_size and the DCT_entry_size variables carry the size as bytes. Which is how it is already interpreted in the dat_v1.c: hci_dat_v1_init(). Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230921055704.1087277-4-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni commit f656f6bd22d7cd08b55c6495fcfaa391c2eb933f Author: Jarkko Nikula Date: Thu Sep 21 08:56:54 2023 +0300 i3c: mipi-i3c-hci: Add MODULE_ALIAS Add MODULE_ALIAS() in order to be able to autoload this driver when the device is added as a platform device from another glue code driver. Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230921055704.1087277-3-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni commit 0c35691551387e060e6ae7a6652b4101270c73cf Author: Jarkko Nikula Date: Thu Sep 21 08:56:53 2023 +0300 i3c: master: Inherit DMA masks and parameters from parent device Copy the DMA masks and parameters for an I3C master device from parent device so that the master device has them set for the DMA buffer and mapping API. Signed-off-by: Jarkko Nikula Link: https://lore.kernel.org/r/20230921055704.1087277-2-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni commit a8b163e184dede158c94f6392a406ac40a08fb1b Author: Kees Cook Date: Fri Sep 22 10:50:23 2023 -0700 i3c: svc: Annotate struct svc_i3c_xfer with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct svc_i3c_xfer. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Miquel Raynal Cc: Conor Culhane Cc: Alexandre Belloni Cc: linux-i3c@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/r/20230922175023.work.239-kees@kernel.org Signed-off-by: Alexandre Belloni commit 751d377f0f7a09d6122de0e2232133524568c52b Author: Kees Cook Date: Fri Sep 22 10:50:19 2023 -0700 i3c/master/mipi-i3c-hci: Annotate struct hci_rings_data with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct hci_rings_data. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Alexandre Belloni Cc: Nicolas Pitre Cc: Len Baker Cc: Boris Brezillon Cc: linux-i3c@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922175019.work.129-kees@kernel.org Signed-off-by: Alexandre Belloni commit 49f33846efc079eb94b044bf897e90909fd3aa11 Author: Kees Cook Date: Fri Sep 22 10:50:15 2023 -0700 i3c: master: cdns: Annotate struct cdns_i3c_xfer with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct cdns_i3c_xfer. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: "Przemysław Gaj" Cc: Alexandre Belloni Cc: linux-i3c@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922175014.work.637-kees@kernel.org Signed-off-by: Alexandre Belloni commit 014c9a0e6f9ff573099051e1e2ff6efc3470d02d Author: Kees Cook Date: Fri Sep 22 10:50:11 2023 -0700 i3c: dw: Annotate struct dw_i3c_xfer with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct dw_i3c_xfer. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Alexandre Belloni Cc: Jeremy Kerr Cc: Joel Stanley Cc: linux-i3c@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Jeremy Kerr Link: https://lore.kernel.org/r/20230922175011.work.800-kees@kernel.org Signed-off-by: Alexandre Belloni commit fa7726a4d9b91e0a8fb6fbbd819cd20f116f6c21 Author: Justin Stitt Date: Thu Sep 21 03:51:04 2023 +0000 i3c: replace deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. We expect adap->name to be NUL-terminated based on i2c_adapter name use: | dev_dbg(&adap->dev, "adapter [%s] registered\n", adap->name); NUL-padding does not seem to be required as `master` is zero-allocated and `i3c_master_to_i2c_adapter` simply returns a field from within `master`: | master = devm_kzalloc(dev, sizeof(*master), GFP_KERNEL); ... | struct i2c_adapter *adap = i3c_master_to_i2c_adapter(master); ... | static struct i2c_adapter * | i3c_master_to_i2c_adapter(struct i3c_master_controller *master) | { | return &master->i2c; | } This means that `adap->name` should already be filled with NUL-bytes. Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230921-strncpy-drivers-i3c-master-c-v1-1-9fdb8d8169e1@google.com Signed-off-by: Alexandre Belloni commit 4bd8405257da717cd556f99e5fb68693d12c9766 Author: Joshua Yeong Date: Wed Sep 13 11:17:45 2023 +0800 i3c: master: cdns: Fix reading status register IBIR_DEPTH and CMDR_DEPTH should read from status0 instead of status1. Cc: stable@vger.kernel.org Fixes: 603f2bee2c54 ("i3c: master: Add driver for Cadence IP") Signed-off-by: Joshua Yeong Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/r/20230913031743.11439-2-joshua.yeong@starfivetech.com Signed-off-by: Alexandre Belloni commit 15b286d1fd056b0366bc8d211ff2c4ce2449eacb Author: Alice Ryhl Date: Mon Aug 28 10:48:07 2023 +0000 rust: workqueue: add examples This adds two examples of how to use the workqueue. The first example shows how to use it when you only have one `work_struct` field, and the second example shows how to use it when you have multiple `work_struct` fields. Signed-off-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Gary Guo Reviewed-by: "Andreas Hindborg (Samsung)" Reviewed-by: Benno Lossin Reviewed-by: Boqun Feng Signed-off-by: Tejun Heo commit 115c95e9e14c482682080598907e6a18091fd0af Author: Alice Ryhl Date: Mon Aug 28 10:48:06 2023 +0000 rust: workqueue: add `try_spawn` helper method This adds a convenience method that lets you spawn a closure for execution on a workqueue. This will be the most convenient way to use workqueues, but it is fallible because it needs to allocate memory. Co-developed-by: Gary Guo Signed-off-by: Gary Guo Signed-off-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: "Andreas Hindborg (Samsung)" Reviewed-by: Benno Lossin Reviewed-by: Boqun Feng Signed-off-by: Tejun Heo commit 47f0dbe8fdc28e6e79505b640619e0cbccb91cef Author: Alice Ryhl Date: Mon Aug 28 10:48:05 2023 +0000 rust: workqueue: implement `WorkItemPointer` for pointer types This implements the `WorkItemPointer` trait for the pointer types that you are likely to use the workqueue with. The `Arc` type is for reference counted objects, and the `Pin>` type is for objects where the caller has exclusive ownership of the object. Co-developed-by: Gary Guo Signed-off-by: Gary Guo Signed-off-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: "Andreas Hindborg (Samsung)" Reviewed-by: Benno Lossin Reviewed-by: Boqun Feng Signed-off-by: Tejun Heo commit 7324b88975c525a013ae0db747df97924ce80675 Author: Alice Ryhl Date: Mon Aug 28 10:48:04 2023 +0000 rust: workqueue: add helper for defining work_struct fields The main challenge with defining `work_struct` fields is making sure that the function pointer stored in the `work_struct` is appropriate for the work item type it is embedded in. It needs to know the offset of the `work_struct` field being used (even if there are several!) so that it can do a `container_of`, and it needs to know the type of the work item so that it can call into the right user-provided code. All of this needs to happen in a way that provides a safe API to the user, so that users of the workqueue cannot mix up the function pointers. There are three important pieces that are relevant when doing this: * The pointer type. * The work item struct. This is what the pointer points at. * The `work_struct` field. This is a field of the work item struct. This patch introduces a separate trait for each piece. The pointer type is given a `WorkItemPointer` trait, which pointer types need to implement to be usable with the workqueue. This trait will be implemented for `Arc` and `Box` in a later patch in this patchset. Implementing this trait is unsafe because this is where the `container_of` operation happens, but user-code will not need to implement it themselves. The work item struct should then implement the `WorkItem` trait. This trait is where user-code specifies what they want to happen when a work item is executed. It also specifies what the correct pointer type is. Finally, to make the work item struct know the offset of its `work_struct` field, we use a trait called `HasWork`. If a type implements this trait, then the type declares that, at the given offset, there is a field of type `Work`. The trait is marked unsafe because the OFFSET constant must be correct, but we provide an `impl_has_work!` macro that can safely implement `HasWork` on a type. The macro expands to something that only compiles if the specified field really has the type `Work`. It is used like this: ``` struct MyWorkItem { work_field: Work, } impl_has_work! { impl HasWork for MyWorkItem { self.work_field } } ``` Note that since the `Work` type is annotated with an id, you can have several `work_struct` fields by using a different id for each one. Co-developed-by: Gary Guo Signed-off-by: Gary Guo Signed-off-by: Alice Ryhl Reviewed-by: Benno Lossin Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Andreas Hindborg Reviewed-by: Boqun Feng Signed-off-by: Tejun Heo commit 033941307471787ef8ee65bfc411dcbb6a81ea18 Author: Wedson Almeida Filho Date: Mon Aug 28 10:48:03 2023 +0000 rust: workqueue: define built-in queues We provide these methods because it lets us access these queues from Rust without using unsafe code. These methods return `&'static Queue`. References annotated with the 'static lifetime are used when the referent will stay alive forever. That is ok for these queues because they are global variables and cannot be destroyed. Signed-off-by: Wedson Almeida Filho Co-developed-by: Alice Ryhl Signed-off-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Gary Guo Reviewed-by: "Andreas Hindborg (Samsung)" Reviewed-by: Benno Lossin Reviewed-by: Boqun Feng Signed-off-by: Tejun Heo commit d4d791d4aac041fde6eeba0a8f9201d728b52373 Author: Alice Ryhl Date: Mon Aug 28 10:48:02 2023 +0000 rust: workqueue: add low-level workqueue bindings Define basic low-level bindings to a kernel workqueue. The API defined here can only be used unsafely. Later commits will provide safe wrappers. Co-developed-by: Gary Guo Signed-off-by: Gary Guo Signed-off-by: Alice Ryhl Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: "Andreas Hindborg (Samsung)" Reviewed-by: Benno Lossin Reviewed-by: Boqun Feng Signed-off-by: Tejun Heo commit a8321776ca0b13ec4d4fc817144fe1b3f6ba4625 Author: Wedson Almeida Filho Date: Mon Aug 28 10:48:01 2023 +0000 rust: sync: add `Arc::{from_raw, into_raw}` These methods can be used to turn an `Arc` into a raw pointer and back, in a way that preserves the metadata for fat pointers. This is done using the unstable ptr_metadata feature [1]. However, it could also be done using the unstable pointer_byte_offsets feature [2], which is likely to have a shorter path to stabilization than ptr_metadata. Link: https://github.com/rust-lang/rust/issues/81513 [1] Link: https://github.com/rust-lang/rust/issues/96283 [2] Signed-off-by: Wedson Almeida Filho Co-developed-by: Alice Ryhl Signed-off-by: Alice Ryhl Reviewed-by: Gary Guo Reviewed-by: Martin Rodriguez Reboredo Reviewed-by: Benno Lossin Reviewed-by: Andreas Hindborg Reviewed-by: Boqun Feng Signed-off-by: Tejun Heo commit cb289ce6e2ce4cee594285d0c1e0249ae868c1de Author: Kees Cook Date: Fri Sep 22 10:52:35 2023 -0700 bus: vexpress-config: Annotate struct vexpress_syscfg_func with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct vexpress_syscfg_func. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Liviu Dudau Cc: Sudeep Holla Cc: Lorenzo Pieralisi Cc: Rob Herring Cc: Yangtao Li Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Link: https://lore.kernel.org/r/20230922175234.work.134-kees@kernel.org Signed-off-by: Sudeep Holla commit 11a7a42ea76e61a8d2f7374ecdd95460dec4413f Author: Mark Brown Date: Fri Sep 22 14:42:55 2023 +0100 kselftest/arm64: Validate SVCR in streaming SVE stress test In the ZA and ZT test programs we explicitly validate that PSTATE.ZA is as expected on each loop but we do not do the equivalent for our streaming SVE test, add a check that we are still in streaming mode on every loop in case that goes wrong. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230922-arm64-ssve-validate-svcr-v1-1-f518960eaeda@kernel.org Signed-off-by: Catalin Marinas commit ae0e5e6eaaabd54377fe6f649d49ff5fbbc58d95 Author: Shekhar Chauhan Date: Fri Sep 22 21:23:56 2023 +0530 drm/i915: Add Wa_18028616096 Drop UGM per set fragment threshold to 3 BSpec: 54833 Signed-off-by: Shekhar Chauhan Reviewed-by: Matt Roper [mattrope: moved above xehpsdv block for consistency] Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230922155356.583595-1-shekhar.chauhan@intel.com commit 62817d5ba25d2361488184f85d628b5b540e254b Author: Douglas Anderson Date: Wed Sep 6 09:03:02 2023 -0700 arm64: smp: Mark IPI globals as __ro_after_init Mark the three IPI-related globals in smp.c as "__ro_after_init" since they are only ever set in set_smp_ipi_range(), which is marked "__init". This is a better and more secure marking than the old "__read_mostly". Suggested-by: Stephen Boyd Acked-by: Mark Rutland Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20230906090246.v13.7.I625d393afd71e1766ef73d3bfaac0b347a4afd19@changeid Signed-off-by: Catalin Marinas commit 2f5cd0c7ffde0ec7779f27e5c4ed30e131b66393 Author: Douglas Anderson Date: Wed Sep 6 09:03:01 2023 -0700 arm64: kgdb: Implement kgdb_roundup_cpus() to enable pseudo-NMI roundup Up until now we've been using the generic (weak) implementation for kgdb_roundup_cpus() when using kgdb on arm64. Let's move to a custom one. The advantage here is that, when pseudo-NMI is enabled on a device, we'll be able to round up CPUs using pseudo-NMI. This allows us to debug CPUs that are stuck with interrupts disabled. If pseudo-NMIs are not enabled then we'll fallback to just using an IPI, which is still slightly better than the generic implementation since it avoids the potential situation described in the generic kgdb_call_nmi_hook(). Co-developed-by: Sumit Garg Signed-off-by: Sumit Garg Reviewed-by: Daniel Thompson Reviewed-by: Stephen Boyd Acked-by: Mark Rutland Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20230906090246.v13.6.I2ef26d1b3bfbed2d10a281942b0da7d9854de05e@changeid Signed-off-by: Catalin Marinas commit d7402513c935ad87413b01aa51a7ada0ad2f0163 Author: Douglas Anderson Date: Wed Sep 6 09:03:00 2023 -0700 arm64: smp: IPI_CPU_STOP and IPI_CPU_CRASH_STOP should try for NMI There's no reason why IPI_CPU_STOP and IPI_CPU_CRASH_STOP can't be handled as NMI. They are very simple and everything in them is NMI-safe. Mark them as things to use NMI for if NMI is available. Suggested-by: Mark Rutland Reviewed-by: Stephen Boyd Reviewed-by: Misono Tomohiro Reviewed-by: Sumit Garg Acked-by: Mark Rutland Tested-by: Mark Rutland Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20230906090246.v13.5.Ifadbfd45b22c52edcb499034dd4783d096343260@changeid Signed-off-by: Catalin Marinas commit 331a1b3a836c0f38165dcec168c0a03b93cf0c17 Author: Douglas Anderson Date: Wed Sep 6 09:02:59 2023 -0700 arm64: smp: Add arch support for backtrace using pseudo-NMI Enable arch_trigger_cpumask_backtrace() support on arm64. This enables things much like they are enabled on arm32 (including some of the funky logic around NR_IPI, nr_ipi, and MAX_IPI) but with the difference that, unlike arm32, we'll try to enable the backtrace to use pseudo-NMI. NOTE: this patch is a squash of the little bit of code adding the ability to mark an IPI to try to use pseudo-NMI plus the little bit of code to hook things up for kgdb. This approach was decided upon in the discussion of v9 [1]. This patch depends on commit 8d539b84f1e3 ("nmi_backtrace: allow excluding an arbitrary CPU") since that commit changed the prototype of arch_trigger_cpumask_backtrace(), which this patch implements. [1] https://lore.kernel.org/r/ZORY51mF4alI41G1@FVFF77S0Q05N Co-developed-by: Sumit Garg Signed-off-by: Sumit Garg Co-developed-by: Mark Rutland Signed-off-by: Mark Rutland Reviewed-by: Stephen Boyd Reviewed-by: Misono Tomohiro Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20230906090246.v13.4.Ie6c132b96ebbbcddbf6954b9469ed40a6960343c@changeid Signed-off-by: Catalin Marinas commit 2b2d0a7a96ab36ed6d963e29b6211b184ef81596 Author: Mark Rutland Date: Wed Sep 6 09:02:58 2023 -0700 arm64: smp: Remove dedicated wakeup IPI To enable NMI backtrace and KGDB's NMI cpu roundup, we need to free up at least one dedicated IPI. On arm64 the IPI_WAKEUP IPI is only used for the ACPI parking protocol, which itself is only used on some very early ARMv8 systems which couldn't implement PSCI. Remove the IPI_WAKEUP IPI, and rely on the IPI_RESCHEDULE IPI to wake CPUs from the parked state. This will cause a tiny amonut of redundant work to check the thread flags, but this is miniscule in relation to the cost of taking and handling the IPI in the first place. We can safely handle redundant IPI_RESCHEDULE IPIs, so there should be no functional impact as a result of this change. Signed-off-by: Mark Rutland Reviewed-by: Stephen Boyd Reviewed-by: Sumit Garg Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson Cc: Marc Zyngier Cc: Will Deacon Link: https://lore.kernel.org/r/20230906090246.v13.3.I7209db47ef8ec151d3de61f59005bbc59fe8f113@changeid Signed-off-by: Catalin Marinas commit d0c14a7d36f035aeae1bdd6f4afc6488400ed5cf Author: Douglas Anderson Date: Wed Sep 6 09:02:57 2023 -0700 arm64: idle: Tag the arm64 idle functions as __cpuidle As per the (somewhat recent) comment before the definition of `__cpuidle`, the tag is like `noinstr` but also marks a function so it can be identified by cpu_in_idle(). Let's add these markings to arm64 cpuidle functions With this change we get useful backtraces like: NMI backtrace for cpu N skipped: idling at cpu_do_idle+0x94/0x98 instead of useless backtraces when dumping all processors using nmi_cpu_backtrace(). NOTE: this patch won't make cpu_in_idle() work perfectly for arm64, but it doesn't hurt and does catch some cases. Specifically an example that wasn't caught in my testing looked like this: gic_cpu_sys_reg_init+0x1f8/0x314 gic_cpu_pm_notifier+0x40/0x78 raw_notifier_call_chain+0x5c/0x134 cpu_pm_notify+0x38/0x64 cpu_pm_exit+0x20/0x2c psci_enter_idle_state+0x48/0x70 cpuidle_enter_state+0xb8/0x260 cpuidle_enter+0x44/0x5c do_idle+0x188/0x30c Acked-by: Mark Rutland Reviewed-by: Stephen Boyd Acked-by: Sumit Garg Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson Link: https://lore.kernel.org/r/20230906090246.v13.2.I4baba13e220bdd24d11400c67f137c35f07f82c7@changeid Signed-off-by: Catalin Marinas commit a02026bf9da13cd44fb444857d5aebc934e1af5a Author: Douglas Anderson Date: Wed Sep 6 09:02:56 2023 -0700 irqchip/gic-v3: Enable support for SGIs to act as NMIs As of commit 6abbd6988971 ("irqchip/gic, gic-v3: Make SGIs use handle_percpu_devid_irq()") SGIs are treated the same as PPIs/EPPIs and use handle_percpu_devid_irq() by default. Unfortunately, handle_percpu_devid_irq() isn't NMI safe, and so to run in an NMI context those should use handle_percpu_devid_fasteoi_nmi(). In order to accomplish this, we just have to make room for SGIs in the array of refcounts that keeps track of which interrupts are set as NMI. We also rename the array and create a new indexing scheme that accounts for SGIs. Also, enable NMI support prior to gic_smp_init() as allocation of SGIs as IRQs/NMIs happen as part of this routine. Co-developed-by: Sumit Garg Signed-off-by: Sumit Garg Acked-by: Mark Rutland Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20230906090246.v13.1.I1223c11c88937bd0cbd9b086d4ef216985797302@changeid Signed-off-by: Catalin Marinas commit 156adfa55f23620f5817e1cf93dd6f762c8890b4 Author: Gustavo Sousa Date: Wed Sep 20 16:53:52 2023 -0300 drm/i915/irq: Clear GFX_MSTR_IRQ as part of IRQ reset Starting with Xe_LP+, GFX_MSTR_IRQ contains status bits that have W1C behavior. If we do not properly reset them, we would miss delivery of interrupts if a pending bit is set when enabling IRQs. As an example, the display part of our probe routine contains paths where we wait for vblank interrupts. If a display interrupt was already pending when enabling IRQs, we would time out waiting for the vblank. Avoid the potential issue by clearing GFX_MSTR_IRQ as part of the IRQ reset. v2: - Move logic from gen11_gt_irq_reset() to dg1_irq_reset(). (Matt) BSpec: 50875, 54028 Cc: Matt Roper Signed-off-by: Gustavo Sousa Reviewed-by: Ville Syrjälä Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230920195351.59421-2-gustavo.sousa@intel.com commit 1056063756d7bbd5e49532278448cd28ecb8f359 Author: Geert Uytterhoeven Date: Mon Sep 25 14:56:46 2023 +0200 ASoC: sh: dma-sh7760: Use %pad and %zu to format dma_addr_t and size_t sound/soc/sh/dma-sh7760.c: In function ‘camelot_prepare’: ./include/linux/kern_levels.h:5:25: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Wformat=] 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */ sound/soc/sh/dma-sh7760.c:198:9: note: in expansion of macro ‘pr_debug’ 198 | pr_debug("PCM data: addr 0x%08lx len %d\n", | ^~~~~~~~ Fix this by using "%pad" and taking the address to format the DMA address. While at it, use "%zu" to format size_t. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309250903.XNAjFuxy-lkp@intel.com/ Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230925125646.3681807-1-geert+renesas@glider.be Signed-off-by: Mark Brown commit 391208485c3ad50ff4f2ddd9f7d4a1d77341acbb Author: Mark Brown Date: Wed Sep 13 15:48:13 2023 +0100 arm64/sve: Remove SMCR pseudo register from cpufeature code For reasons that are not currently apparent during cpufeature enumeration we maintain a pseudo register for SMCR which records the maximum supported vector length using the value that would be written to SMCR_EL1.LEN to configure it. This is not exposed to userspace and is not sufficient for detecting unsupportable configurations, we need the more detailed checks in vec_update_vq_map() for that since we can't cope with missing vector lengths on late CPUs and KVM requires an exactly matching set of supported vector lengths as EL1 can enumerate VLs directly with the hardware. Remove the code, replacing the usage in sme_setup() with a query of the vq_map. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230913-arm64-vec-len-cpufeature-v1-2-cc69b0600a8a@kernel.org Signed-off-by: Catalin Marinas commit abef0695f9665c3dbe9473f964c4da3c1f7c5d3f Author: Mark Brown Date: Wed Sep 13 15:48:12 2023 +0100 arm64/sve: Remove ZCR pseudo register from cpufeature code For reasons that are not currently apparent during cpufeature enumeration we maintain a pseudo register for ZCR which records the maximum supported vector length using the value that would be written to ZCR_EL1.LEN to configure it. This is not exposed to userspace and is not sufficient for detecting unsupportable configurations, we need the more detailed checks in vec_update_vq_map() for that since we can't cope with missing vector lengths on late CPUs and KVM requires an exactly matching set of supported vector lengths as EL1 can enumerate VLs directly with the hardware. Remove the code, replacing the usage in sve_setup() with a query of the vq_map. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230913-arm64-vec-len-cpufeature-v1-1-cc69b0600a8a@kernel.org Signed-off-by: Catalin Marinas commit 2fc37c0c59c925ac1e60c007670b9921565005a7 Author: Jani Nikula Date: Thu Sep 21 19:06:37 2023 +0300 drm/i915/gem: remove inlines from i915_gem_execbuffer.c Just let the compiler decide what's best. Turns out absolutely nothing changes in the output with the inlines removed. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230921160637.3862597-1-jani.nikula@intel.com commit 3447aea1b5e11e4e3734b8b6becde038438d85a2 Author: Tvrtko Ursulin Date: Wed Sep 20 09:57:15 2023 +0100 drm/i915: Zap some empty lines Recent refactoring left an unsightly block of empty lines. Remove them. Signed-off-by: Tvrtko Ursulin Cc: Dnyaneshwar Bhadane Cc: Anusha Srivatsa Cc: Radhakrishna Sripada Reviewed-by: Jani Nikula Reviewed-by: Radhakrishna Sripada Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230920085715.6905-1-tvrtko.ursulin@linux.intel.com commit 8a771075e50bef5e2a063a9f954b36a33fb7359f Author: Christophe JAILLET Date: Sun Sep 17 16:36:26 2023 +0200 spi: at91-usart: Remove some dead code dma_request_chan() does not return NULL. It returns a valid pointer or an error pointer. So, some dead code can be removed. The IS_ERR_OR_NULL() in the error handling path are still needed, because the error handling path is common to the whole function and the ctlr->dma_xx are NULL when at91_usart_spi_configure_dma() is called. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/84eb08daf85d203b34af9d8d08abf86804211413.1694961365.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 0fc57bf1b2ff178377e756761a884d4b6c69ebf9 Author: Rob Herring Date: Thu Sep 14 14:00:42 2023 -0500 spi: dt-bindings: st,stm32-spi: Move "st,spi-midi-ns" to spi-peripheral-props.yaml In order to validate SPI peripherals, SPI controller-specific child node properties need to be in a separate schema, spi-peripheral-props.yaml, which SPI peripheral schemas reference. As there is just a single property in this case, just add it to spi-peripheral-props.yaml directly. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20230914190049.1853136-1-robh@kernel.org Signed-off-by: Mark Brown commit 34d7c484c577d65c1b45cfbf6b0a50314d308f74 Merge: 44da5bf49bf4e 9681df024c9af Author: Linus Walleij Date: Mon Sep 25 15:49:35 2023 +0200 Merge branch 'ib-amlogic-t7' into devel commit 9681df024c9af234a9b6c56dfa2af227aee3fa59 Author: Huqiang Qin Date: Fri Sep 22 17:43:41 2023 +0800 pinctrl: Add driver support for Amlogic T7 SoCs Add a new pinctrl driver for Amlogic T7 SoCs which share the same register layout as the previous Amlogic S4. Signed-off-by: Huqiang Qin Reviewed-by: Neil Armstrong Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230922094342.637251-3-huqiang.qin@amlogic.com Signed-off-by: Linus Walleij commit 2b7eb110d3c8c744cb37782d060b942d0bc2eb8e Author: Huqiang Qin Date: Fri Sep 22 17:43:40 2023 +0800 dt-bindings: pinctrl: Add support for Amlogic T7 SoCs Add a new compatible name for Amlogic T7 pin controller, and add a new dt-binding header file which document the detail pin names. Signed-off-by: Huqiang Qin Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230922094342.637251-2-huqiang.qin@amlogic.com Signed-off-by: Linus Walleij commit 44da5bf49bf4ea20028cda5a803de0a8421b309e Author: iuncuim Date: Sat Sep 16 11:16:15 2023 +0300 pinctrl: sunxi: h616: add extra gpio banks Some SoCs from the H616 family (such as the T507) have the same die but more output pins that are used for additional peripherals. The T507 SoC don't have a built-in multiphy like the AC200 or AC300 connected to the bank A. With the T507 these pins can be freely used for any other application. This patch adds the missing muxes on banks A, D and E. Thanks to Samuel and Andre for the review. Reviewed-by: Andre Przywara Link: https://lore.kernel.org/r/20230916081615.4237-1-iuncuim@gmail.com Signed-off-by: Mikhail Kalashnikov Signed-off-by: Linus Walleij commit 0ec8ae43136df7e27c5cc64674db7eee91cd748e Author: Joe Wang Date: Wed Sep 20 18:33:32 2023 +0800 pinctrl: pinctrl-aspeed-g6: Add more settings for USB2AHP function AST2600 USB2AHP (USB PortA: PCIe EHCI to PHY) function needs to set the register SCUC20[16]. Set it to enable the PCIe EHCI device on PCIe bus. Besides, also add USB2AHP signal expressions into pin declarations. Signed-off-by: Joe Wang Link: https://lore.kernel.org/r/20230920103332.274151-1-joe_wang@aspeedtech.com Signed-off-by: Linus Walleij commit f1982740f5e77090bde41a9b84e257d69ec46598 Author: David Howells Date: Mon Sep 25 13:03:04 2023 +0100 iov_iter: Convert iterate*() to inline funcs Convert the iov_iter iteration macros to inline functions to make the code easier to follow. The functions are marked __always_inline as we don't want to end up with indirect calls in the code. This, however, leaves dealing with ->copy_mc in an awkard situation since the step function (memcpy_from_iter_mc()) needs to test the flag in the iterator, but isn't passed the iterator. This will be dealt with in a follow-up patch. The variable names in the per-type iterator functions have been harmonised as much as possible and made clearer as to the variable purpose. The iterator functions are also moved to a header file so that other operations that need to scan over an iterator can be added. For instance, the rbd driver could use this to scan a buffer to see if it is all zeros and libceph could use this to generate a crc. Signed-off-by: David Howells Link: https://lore.kernel.org/r/3710261.1691764329@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/855.1692047347@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/20230816120741.534415-1-dhowells@redhat.com/ # v3 Link: https://lore.kernel.org/r/20230925120309.1731676-8-dhowells@redhat.com cc: Alexander Viro cc: Jens Axboe cc: Christoph Hellwig cc: Christian Brauner cc: Matthew Wilcox cc: Linus Torvalds cc: David Laight cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: Christian Brauner commit f1b4cb650b9a0eeba206d8f069fcdc532bfbcd74 Author: David Howells Date: Mon Sep 25 13:03:03 2023 +0100 iov_iter: Derive user-backedness from the iterator type Use the iterator type to determine whether an iterator is user-backed or not rather than using a special flag for it. Now that ITER_UBUF and ITER_IOVEC are 0 and 1, they can be checked with a single comparison. Signed-off-by: David Howells Link: https://lore.kernel.org/r/20230925120309.1731676-7-dhowells@redhat.com cc: Alexander Viro cc: Jens Axboe cc: Christoph Hellwig cc: Christian Brauner cc: Matthew Wilcox cc: Linus Torvalds cc: David Laight cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: Christian Brauner commit 7d9e44a6ad8a22135e6308d330da29271f41a98a Author: David Howells Date: Mon Sep 25 13:03:02 2023 +0100 iov_iter: Renumber ITER_* constants Renumber the ITER_* iterator-type constants to put things in the same order as in the iteration functions and to group user-backed iterators at the bottom. Signed-off-by: David Howells Link: https://lore.kernel.org/r/20230925120309.1731676-6-dhowells@redhat.com cc: Alexander Viro cc: Jens Axboe cc: Christoph Hellwig cc: Christian Brauner cc: Matthew Wilcox cc: Linus Torvalds cc: David Laight cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: Christian Brauner commit 7ebc540b3524c77dc4370c497dc7af2b44ac5281 Author: David Howells Date: Mon Sep 25 13:03:01 2023 +0100 infiniband: Use user_backed_iter() to see if iterator is UBUF/IOVEC Use user_backed_iter() to see if iterator is UBUF/IOVEC rather than poking inside the iterator. Signed-off-by: David Howells Link: https://lore.kernel.org/r/20230925120309.1731676-5-dhowells@redhat.com cc: Dennis Dalessandro cc: Jason Gunthorpe cc: Leon Romanovsky cc: linux-rdma@vger.kernel.org Signed-off-by: Christian Brauner commit 1fcb71282e732a27b2d1d2003ab24d9f13f26e19 Author: David Howells Date: Mon Sep 25 13:03:00 2023 +0100 sound: Fix snd_pcm_readv()/writev() to use iov access functions Fix snd_pcm_readv()/writev() to use iov access functions rather than poking at the iov_iter internals directly. Signed-off-by: David Howells Link: https://lore.kernel.org/r/20230925120309.1731676-4-dhowells@redhat.com Reviewed-by: Jaroslav Kysela Reviewed-by: Takashi Iwai cc: Oswald Buddenhagen cc: Jens Axboe cc: Suren Baghdasaryan cc: Kuninori Morimoto cc: alsa-devel@alsa-project.org Signed-off-by: Christian Brauner commit 066baf92bed934c9fb4bcee97a193f47aa63431c Author: David Howells Date: Mon Sep 25 13:02:59 2023 +0100 iov_iter, x86: Be consistent about the __user tag on copy_mc_to_user() copy_mc_to_user() has the destination marked __user on powerpc, but not on x86; the latter results in a sparse warning in lib/iov_iter.c. Fix this by applying the tag on x86 too. Fixes: ec6347bb4339 ("x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}()") Signed-off-by: David Howells Link: https://lore.kernel.org/r/20230925120309.1731676-3-dhowells@redhat.com cc: Dan Williams cc: Thomas Gleixner cc: Ingo Molnar cc: Borislav Petkov cc: Dave Hansen cc: "H. Peter Anvin" cc: Alexander Viro cc: Jens Axboe cc: Christoph Hellwig cc: Christian Brauner cc: Matthew Wilcox cc: Linus Torvalds cc: David Laight cc: x86@kernel.org cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: Christian Brauner commit 581beb4fe37d17571c87058d13d298d5458e25e9 Author: David Howells Date: Mon Sep 25 13:02:58 2023 +0100 iov_iter: Remove last_offset from iov_iter as it was for ITER_PIPE Now that ITER_PIPE has been removed, iov_iter::last_offset is no longer used, so remove it. Signed-off-by: David Howells Link: https://lore.kernel.org/r/20230925120309.1731676-2-dhowells@redhat.com cc: Alexander Viro cc: Jens Axboe cc: Christoph Hellwig cc: Christian Brauner cc: Matthew Wilcox cc: Linus Torvalds cc: David Laight cc: linux-block@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: Christian Brauner commit c351835058419c1eb8791941a057c3f3e6068cb6 Author: Christophe JAILLET Date: Sun Sep 24 09:36:01 2023 +0200 ASoC: audio-iio-aux: Use flex array to simplify code "io-channel-names" is expected to have few values, so there is no real point to allocate audio_iio_aux_chan structure with a dedicate memory allocation. Using a flexible array for struct audio_iio_aux->chans avoids the overhead of an additional, managed, memory allocation. This also saves an indirection when the array is accessed. Finally, __counted_by() can be used for run-time bounds checking if configured and supported by the compiler. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/1c0090aaf49504eaeaff5e7dd119fd37173290b5.1695540940.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 017c6658fd59740f9845ca0d3369ddd778e3e0c0 Author: Chen-Yu Tsai Date: Wed Sep 13 16:29:18 2023 +0800 regulator: mt6358: Add output voltage fine tuning to variable LDOs Some of the LDO regulators in the MT6358/MT6366 have sparsely populated voltage tables, supported by custom get/set operators. While it works, it requires more code and an extra field to store the lookup table. These LDOs also have fine voltage calibration settings that can slightly boost the output voltage from 0 mV to 100 mV, in 10 mV increments. These combined could be modeled as a pickable set of linear ranges. The coarse voltage setting is modeled as the range selector, while each range has 11 selectors, starting from the range's base voltage, up to +100 mV, in 10mV increments. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230913082919.1631287-4-wenst@chromium.org Signed-off-by: Mark Brown commit cf08fa74c716cf20e5038d1e7dbbd7dba1b76062 Author: Chen-Yu Tsai Date: Wed Sep 13 16:29:17 2023 +0800 regulator: mt6358: Add output voltage fine tuning to fixed regulators The "fixed" LDO regulators found on the MT6358 and MT6366 PMICs have either no voltage selection register, or only one valid setting. However these do have a fine voltage calibration setting that can slightly boost the output voltage from 0 mV to 100 mV, in 10 mV increments. Add support for this by changing these into linear range regulators. Some register definitions that are missing are also added. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Acked-by: Lee Jones Link: https://lore.kernel.org/r/20230913082919.1631287-3-wenst@chromium.org Signed-off-by: Mark Brown commit 7442edec72bc657e6ce38ae01de9f10e55decfaa Author: Chen-Yu Tsai Date: Wed Sep 13 16:29:16 2023 +0800 regulator: mt6358: Fail probe on unknown chip ID The MT6358 and MT6366 PMICs, and likely many others from MediaTek, have a chip ID register, making the chip semi-discoverable. The driver currently supports two PMICs and expects to be probed on one or the other. It does not account for incorrect mfd driver entries or device trees. While these should not happen, if they do, it could be catastrophic for the device. The driver should be sure the hardware is what it expects. Make the driver fail to probe if the chip ID presented is not a known one. Suggested-by: AngeloGioacchino Del Regno Fixes: f0e3c6261af1 ("regulator: mt6366: Add support for MT6366 regulator") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230913082919.1631287-2-wenst@chromium.org Signed-off-by: Mark Brown commit ecdaa9473019f94e0ad6974a5f69b9be7de137d3 Author: Stephan Gerhold Date: Tue Sep 19 13:59:51 2023 +0200 spi: qup: Vote for interconnect bandwidth to DRAM When the SPI QUP controller is used together with a DMA engine it needs to vote for the interconnect path to the DRAM. Otherwise it may be unable to access the memory quickly enough. The requested peak bandwidth is dependent on the SPI core/bus clock so that the bandwidth scales together with the selected SPI speed. To avoid sending votes too often the bandwidth is always requested when a DMA transfer starts, but dropped only on runtime suspend. Runtime suspend should only happen if no transfer is active. After resumption we can defer the next vote until the first DMA transfer actually happens. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230919-spi-qup-dvfs-v2-4-1bac2e9ab8db@kernkonzept.com Signed-off-by: Mark Brown commit d15befc0cef42db7712714157d9483cab81149a1 Author: Stephan Gerhold Date: Tue Sep 19 13:59:50 2023 +0200 spi: dt-bindings: qup: Document interconnects When the SPI QUP controller is used together with a DMA engine it needs to vote for the interconnect path to the DRAM. Otherwise it may be unable to access the memory quickly enough. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230919-spi-qup-dvfs-v2-3-1bac2e9ab8db@kernkonzept.com Signed-off-by: Mark Brown commit 287fcdaa35fc666640f805310095c52f2d818d26 Author: Stephan Gerhold Date: Tue Sep 19 13:59:49 2023 +0200 spi: qup: Parse OPP table for DVFS support Parse the OPP table from the device tree and use dev_pm_opp_set_rate() instead of clk_set_rate() to allow making performance state for power domains specified in the OPP table. This is needed to guarantee correct behavior of the clock, especially with the higher clock/SPI bus frequencies. Acked-by: Konrad Dybcio Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230919-spi-qup-dvfs-v2-2-1bac2e9ab8db@kernkonzept.com Signed-off-by: Mark Brown commit e6419c35f0d92632e06708c5610a31957f1bd6b3 Author: Stephan Gerhold Date: Tue Sep 19 13:59:48 2023 +0200 spi: dt-bindings: qup: Document power-domains and OPP Document power-domains and operating-points-v2 to allow making performance state votes for certain clock frequencies of the SPI QUP controller. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230919-spi-qup-dvfs-v2-1-1bac2e9ab8db@kernkonzept.com Signed-off-by: Mark Brown commit c067b1f83ea46346a352c2e43ac80f2166172d8a Author: Kuninori Morimoto Date: Mon Sep 11 23:52:23 2023 +0000 ASoC: soc-generic-dmaengine-pcm: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87cyyop8so.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit c35691ffcdbd57049d23ff4a596dd28635aabcdc Author: Kuninori Morimoto Date: Mon Sep 11 23:52:18 2023 +0000 ASoC: soc-component: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87edj4p8st.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 28b11fd4ab604ff8a3650d10e37c2d1d93873b7b Author: Kuninori Morimoto Date: Mon Sep 11 23:52:13 2023 +0000 ASoC: soc-compress: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87fs3kp8sz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 8bfbdb18e2fd25385caece357a715cc058c40726 Author: Kuninori Morimoto Date: Mon Sep 11 23:52:08 2023 +0000 ASoC: soc-topology: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87h6o0p8t4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit b1f96e94e860f7dfecedb30fc08e19424892b660 Author: Kuninori Morimoto Date: Mon Sep 11 23:52:02 2023 +0000 ASoC: soc-utils: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87il8gp8ta.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 9099904bac50385721ef2e0d7e54a412f7527975 Author: Kuninori Morimoto Date: Mon Sep 11 23:51:56 2023 +0000 ASoC: soc-link: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87jzswp8tf.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 36570f3222fdfbcdd4cda28d4367efc17661290f Author: Kuninori Morimoto Date: Mon Sep 11 23:51:51 2023 +0000 ASoC: soc-dapm: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87ledcp8tk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit eeec74aa0ff8af329b9a4504a59a568b93ab2a0f Author: Kuninori Morimoto Date: Mon Sep 11 23:51:46 2023 +0000 ASoC: soc-core: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87msxsp8tp.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 2679a5b2f7d99e3a733cb229c95b4c2e78d17b23 Author: Kuninori Morimoto Date: Mon Sep 11 23:51:41 2023 +0000 ASoC: soc-pcm: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87o7i8p8tu.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 52d98d06eb0bf26312b26fb2d7aa19ddad2a9288 Author: Kuninori Morimoto Date: Mon Sep 11 23:51:25 2023 +0000 ASoC: soc-dai: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87pm2op8ua.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 80b72082e9677026f8874b3db6bf417f473a74cf Author: Kuninori Morimoto Date: Mon Sep 11 23:51:19 2023 +0000 ASoC: sof: mediatek: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87r0n4p8uh.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit e79a972539628b626c4eb68e0c0341ffca1d6217 Author: Kuninori Morimoto Date: Mon Sep 11 23:51:14 2023 +0000 ASoC: sof: intel: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87sf7kp8um.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit b787e09f590656da9b2e5bd3e2484121368b6561 Author: Kuninori Morimoto Date: Mon Sep 11 23:51:08 2023 +0000 ASoC: sof: amd: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87tts0p8ur.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit a62886e3e74552ce91a4de2a9012cfac678ab4a8 Author: Kuninori Morimoto Date: Mon Sep 11 23:50:57 2023 +0000 ASoC: codec: cs47lxx: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87wmwwp8v3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 4cfa9963faa42eb71550e7697df0889b66c11898 Author: Kuninori Morimoto Date: Mon Sep 11 23:50:52 2023 +0000 ASoC: codec: rt5677: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87y1hcp8v8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 221a3d283ee57e75f68f83157d3a1c7cc88a5fa9 Author: Kuninori Morimoto Date: Mon Sep 11 23:50:47 2023 +0000 ASoC: codec: wm: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87zg1sp8vd.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 5d2d1a48a2f7734aee273303fadbb5929b5b8d37 Author: Kuninori Morimoto Date: Mon Sep 11 23:50:41 2023 +0000 ASoC: intel: avs: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/871qf4qnfz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 50cd92e0c8d35d634275ae29f769244ad26b41fa Author: Kuninori Morimoto Date: Mon Sep 11 23:50:29 2023 +0000 ASoC: soundwire: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/874jk0qnga.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 91941d84038ef392370172053cb8e0ca62ae9e56 Author: Kuninori Morimoto Date: Mon Sep 11 23:50:24 2023 +0000 ASoC: uniphier: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/875y4gqngf.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit b551aafeb9f6f5bce299f08c3799fb58e8372293 Author: Kuninori Morimoto Date: Mon Sep 11 23:50:19 2023 +0000 ASoC: starfive: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/877cowqngl.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 1a72df807968d259987f4e08fa7e2c92e3710717 Author: Kuninori Morimoto Date: Mon Sep 11 23:50:13 2023 +0000 ASoC: rockchip: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/878r9cqngq.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 5f444041c1d225bcc8f44dc4b027eb41e2f2f175 Author: Kuninori Morimoto Date: Mon Sep 11 23:50:01 2023 +0000 ASoC: loongson: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87bke8qnh3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit fe4c755de065b156ddc884a5b21b38e7063468b1 Author: Kuninori Morimoto Date: Mon Sep 11 23:49:56 2023 +0000 ASoC: kirkwood: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87cyyoqnh8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit c578d73e919b4805fbddf278627af1302b6246ec Author: Kuninori Morimoto Date: Mon Sep 11 23:49:51 2023 +0000 ASoC: extensa: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87edj4qnhd.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 21b6cd54c98efedd29a2f8c92c3ee64fb324f4ec Author: Kuninori Morimoto Date: Mon Sep 11 23:49:45 2023 +0000 ASoC: samsung: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87fs3kqnhi.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit b4b7de99c6da461315bfcce28018ab9f660c913b Author: Kuninori Morimoto Date: Mon Sep 11 23:49:40 2023 +0000 ASoC: generic: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87h6o0qnho.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 1880a434948346f00509ad9a9f0885a66e5432d0 Author: Kuninori Morimoto Date: Mon Sep 11 23:49:34 2023 +0000 ASoC: cirrus: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87il8gqnht.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 08b7174fb8d126e607e385e34b9e1da4f3be274f Author: Kuninori Morimoto Date: Mon Sep 11 23:49:29 2023 +0000 ASoC: google: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87jzswqnhy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 3a0901d771d77c6a6be45e0a912c246d1ddee05b Author: Kuninori Morimoto Date: Mon Sep 11 23:49:24 2023 +0000 ASoC: ux500: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87ledcqni4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 436f4c706c22682b357dbdb97a6196449293e2a8 Author: Kuninori Morimoto Date: Mon Sep 11 23:49:18 2023 +0000 ASoC: tegra: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87msxsqni9.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 7912371430a49daaa63a2098aa8c944a1ecb0b9b Author: Kuninori Morimoto Date: Mon Sep 11 23:49:13 2023 +0000 ASoC: sunxi: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87o7i8qnie.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 0d102e68e1075dbfb24d35c29bf9e64e7936b9f8 Author: Kuninori Morimoto Date: Mon Sep 11 23:49:08 2023 +0000 ASoC: meson: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87pm2oqnik.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 6547effc3aea50cc3c60874f9a65a19f4919ef9d Author: Kuninori Morimoto Date: Mon Sep 11 23:49:01 2023 +0000 ASoC: atmel: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87r0n4qniq.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 2bbb49e294acb690340693f5f54dc6ef29641d54 Author: Kuninori Morimoto Date: Mon Sep 11 23:48:52 2023 +0000 ASoC: apple: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87sf7kqnj0.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit a87a5c6ee44e0a50f29268bab8b11d8da418af41 Author: Kuninori Morimoto Date: Mon Sep 11 23:48:46 2023 +0000 ASoC: sprd: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87tts0qnj5.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 9b1a2dfa8a00ff10550d6ca103f494c60f13cb03 Author: Kuninori Morimoto Date: Mon Sep 11 23:48:40 2023 +0000 ASoC: qcom: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87v8cgqnjc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 2162d45392c69b7976e5e294c2104236b15e47c1 Author: Kuninori Morimoto Date: Mon Sep 11 23:48:33 2023 +0000 ASoC: au1x: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87wmwwqnji.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit d69bd6dbc651ba86fe40f4cc6b125a7fb3f4be51 Author: Kuninori Morimoto Date: Mon Sep 11 23:48:27 2023 +0000 ASoC: stm: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87y1hcqnjo.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 2f688d1ea1cc167fdc0a65d3b2f77dd752d55117 Author: Kuninori Morimoto Date: Mon Sep 11 23:48:22 2023 +0000 ASoC: pxa: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87zg1sqnjt.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 59b8f7185ed402a90782e0e8b25ccf9284a7e8e3 Author: Kuninori Morimoto Date: Mon Sep 11 23:48:13 2023 +0000 ASoC: mxs: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/871qf4s24j.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit cc807acede357e2d05969bc52073f1ad678f4677 Author: Kuninori Morimoto Date: Mon Sep 11 23:48:07 2023 +0000 ASoC: img: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/8734zks24o.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 14ec63f678e8beaaa1005ccae6c112bf672ba2b3 Author: Kuninori Morimoto Date: Mon Sep 11 23:48:02 2023 +0000 ASoC: fsl: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/874jk0s24t.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit f8af41a3ac938e3764d89f7e05b0a8d130f6075a Author: Kuninori Morimoto Date: Mon Sep 11 23:47:56 2023 +0000 ASoC: dwc: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/875y4gs24z.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit aa435567d75fd5128d45141f81278abf1f7d47c4 Author: Kuninori Morimoto Date: Mon Sep 11 23:47:51 2023 +0000 ASoC: bcm: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/877cows255.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit d4f23dcd6906ad8f76df046bad9a0dea353c4543 Author: Kuninori Morimoto Date: Mon Sep 11 23:47:45 2023 +0000 ASoC: amd: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/878r9cs25b.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 3cdd333a36dae6c56ffceedce8737cca23b632ba Author: Kuninori Morimoto Date: Mon Sep 11 23:47:39 2023 +0000 ASoC: arm: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87a5tss25h.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 1af529320d56e99f0745e432966d5f6652353b99 Author: Kuninori Morimoto Date: Mon Sep 11 23:47:29 2023 +0000 ASoC: ti: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87bke8s25q.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit c4ccfe4e5fa5d36a418bdb78dbe00a97b77954f9 Author: Kuninori Morimoto Date: Mon Sep 11 23:47:22 2023 +0000 ASoC: sh: convert not to use asoc_xxx() ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87cyyos25y.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit b5a95c5bf6d6953d05b2c12acc8c07783232bea9 Author: Kuninori Morimoto Date: Mon Sep 11 23:47:09 2023 +0000 ASoC: simple_card_utils.h: convert not to use asoc_xxx() ASoC is using 2 type of prefix (asoc_xxx() vs snd_soc_xxx()), but these are unified into snd_soc_xxx(). simple_card / audio_graph drivers are historically using asoc_xxx() prefix too. simple_card / audio_graph are not ASoC framework, so let's use simple_card_xxx_() / audio_graph_xxx() for global function prefix. This patch has asoc_xxx() as define to keep compatible. It will be removed if all drivers were switched to new style. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87edj4s26a.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 1d5a2b5dd0a8d2b2b535b5266699429dbd48e62f Author: Kuninori Morimoto Date: Mon Sep 11 23:47:02 2023 +0000 ASoC: soc.h: convert asoc_xxx() to snd_soc_xxx() ASoC is using 2 type of prefix (asoc_xxx() vs snd_soc_xxx()), but there is no particular reason about that [1]. To reduce confusing, standarding these to snd_soc_xxx() is sensible. This patch adds asoc_xxx() macro to keep compatible for a while. It will be removed if all drivers were switched to new style. Link: https://lore.kernel.org/r/87h6td3hus.wl-kuninori.morimoto.gx@renesas.com [1] Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87fs3ks26i.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 330140d7319fcc4ec68bd924ea212e476bf12275 Author: Xin Ji Date: Fri Sep 22 17:34:49 2023 +0800 drm/bridge: Add 200ms delay to wait FW HPD status stable For the no-interrupt design (sink device is panel, polling HPD status when chip power on), anx7625 FW has more than 200ms HPD de-bounce time in FW, for the safety to get HPD status, driver better to wait 200ms before HPD detection after OS resume back. Signed-off-by: Xin Ji Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230922093450.3574349-1-xji@analogixsemi.com commit f7da9c081517daba70f9f9342e09d7a6322ba323 Author: Jinjie Ruan Date: Fri Sep 1 15:30:56 2023 +0800 iommu/tegra-smmu: Drop unnecessary error check for for debugfs_create_dir() The debugfs_create_dir() function returns error pointers. It never returns NULL. As Baolu suggested, this patch removes the error checking for debugfs_create_dir in tegra-smmu.c. This is because the DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes. The debugfs APIs have a IS_ERR() judge in start_creating() which can handle it gracefully. So these checks are unnecessary. Fixes: d1313e7896e9 ("iommu/tegra-smmu: Add debugfs support") Signed-off-by: Jinjie Ruan Suggested-by: Baolu Lu Acked-by: Thierry Reding Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20230901073056.1364755-1-ruanjinjie@huawei.com Signed-off-by: Joerg Roedel commit 82b1e8f7ff6ab0b3fe43fbf10ab720e06db0cfd2 Author: Jani Nikula Date: Thu Sep 21 19:24:56 2023 +0300 drm/i915/gt: remove a static inline that requires including i915_drv.h It's actively harmful to add static inlines in headers that require you to pull in more headers. Remove the include added in commit f1530f912ed8 ("drm/i915/gt: Apply workaround 22016122933 correctly"). We see that there's already an implicit dependency on the i915_drv.h that we need to address too. Cc: Andi Shyti Cc: Fei Yang Cc: Jonathan Cavitt Cc: Matt Roper Signed-off-by: Jani Nikula Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230921162456.3889375-1-jani.nikula@intel.com commit ccb76c5751634541bfd2222374f46e1dea83d525 Author: Jiapeng Chong Date: Fri Aug 18 17:26:20 2023 +0800 iommu: Remove duplicate include ./drivers/iommu/iommu.c: iommu-priv.h is included more than once. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6186 Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20230818092620.91748-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Joerg Roedel commit 7016b3005547bae3ba4577980db0ede53a79784a Author: Vasant Hegde Date: Thu Sep 21 09:21:47 2023 +0000 iommu/amd: Initialize iommu_device->max_pasids Commit 1adf3cc20d69 ("iommu: Add max_pasids field in struct iommu_device") introduced a variable struct iommu_device.max_pasids to track max PASIDS supported by each IOMMU. Let us initialize this field for AMD IOMMU. IOMMU core will use this value to set max PASIDs per device (see __iommu_probe_device()). Also remove unused global 'amd_iommu_max_pasid' variable. Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-15-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit eda8c2860ab6799620c6fbb8600d56e32f437a90 Author: Vasant Hegde Date: Thu Sep 21 09:21:46 2023 +0000 iommu/amd: Enable device ATS/PASID/PRI capabilities independently Introduce helper functions to enable/disable device ATS/PASID/PRI capabilities independently along with the new pasid_enabled and pri_enabled variables in struct iommu_dev_data to keep track, which allows attach_device() and detach_device() to be simplified. Co-developed-by: Suravee Suthikulpanit Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-14-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 92e2bd56a5f9fc44313fda802a43a63cc2a9c8f6 Author: Vasant Hegde Date: Thu Sep 21 09:21:45 2023 +0000 iommu/amd: Introduce iommu_dev_data.flags to track device capabilities Currently we use struct iommu_dev_data.iommu_v2 to keep track of the device ATS, PRI, and PASID capabilities. But these capabilities can be enabled independently (except PRI requires ATS support). Hence, replace the iommu_v2 variable with a flags variable, which keep track of the device capabilities. From commit 9bf49e36d718 ("PCI/ATS: Handle sharing of PF PRI Capability with all VFs"), device PRI/PASID is shared between PF and any associated VFs. Hence use pci_pri_supported() and pci_pasid_features() instead of pci_find_ext_capability() to check device PRI/PASID support. Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-13-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 739eb25514c90aa8ea053ed4d2b971f531e63ded Author: Suravee Suthikulpanit Date: Thu Sep 21 09:21:44 2023 +0000 iommu/amd: Introduce iommu_dev_data.ppr For AMD IOMMU, the PPR feature is needed to support IO page fault (IOPF). PPR is enabled per PCI end-point device, and is configured by the PPR bit in the IOMMU device table entry (i.e DTE[PPR]). Introducing struct iommu_dev_data.ppr track PPR setting for each device. Also iommu_dev_data.ppr will be set only when IOMMU supports PPR. Hence remove redundant feature support check in set_dte_entry(). Signed-off-by: Suravee Suthikulpanit Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-12-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit b0cc5dae1ac0c18748706a4beb636e3b726dd744 Author: Vasant Hegde Date: Thu Sep 21 09:21:43 2023 +0000 iommu/amd: Rename ats related variables Remove nested structure and make it as 'ats_{enable/qdep}'. Also convert 'dev_data.pri_tlp' to bit field. No functional changes intended. Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-11-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit e339b51c13ffb2173ea28679547f3abca7f4d76a Author: Suravee Suthikulpanit Date: Thu Sep 21 09:21:42 2023 +0000 iommu/amd: Modify logic for checking GT and PPR features In order to support v2 page table, IOMMU driver need to check if the hardware can support Guest Translation (GT) and Peripheral Page Request (PPR) features. Currently, IOMMU driver uses global (amd_iommu_v2_present) and per-iommu (struct amd_iommu.is_iommu_v2) variables to track the features. There variables area redundant since we could simply just check the global EFR mask. Therefore, replace it with a helper function with appropriate name. Signed-off-by: Suravee Suthikulpanit Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-10-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 7b7563a93437ef945c829538da28f0095f1603ec Author: Suravee Suthikulpanit Date: Thu Sep 21 09:21:41 2023 +0000 iommu/amd: Consolidate feature detection and reporting logic Currently, IOMMU driver assumes capabilities on all IOMMU instances to be homogeneous. During early_amd_iommu_init(), the driver probes all IVHD blocks and do sanity check to make sure that only features common among all IOMMU instances are supported. This is tracked in the global amd_iommu_efr and amd_iommu_efr2, which should be used whenever the driver need to check hardware capabilities. Therefore, introduce check_feature() and check_feature2(), and modify the driver to adopt the new helper functions. In addition, clean up the print_iommu_info() to avoid reporting redundant EFR/EFR2 for each IOMMU instance. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-9-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 45677ab1e5ca65622b35cc231c5d31c699cfaefe Author: Suravee Suthikulpanit Date: Thu Sep 21 09:21:40 2023 +0000 iommu/amd: Miscellaneous clean up when free domain * Use the protection_domain_free() helper function to free domain. The function has been modified to also free memory used for the v1 and v2 page tables. Also clear gcr3 table in v2 page table free path. * Refactor code into cleanup_domain() for reusability. Change BUG_ON to WARN_ON in cleanup path. * Protection domain dev_cnt should be read when the domain is locked. Signed-off-by: Suravee Suthikulpanit Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-8-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 4c721d6a085ca7baa4289bcf786c71684b2ef281 Author: Vasant Hegde Date: Thu Sep 21 09:21:39 2023 +0000 iommu/amd: Do not set amd_iommu_pgtable in pass-through mode Since AMD IOMMU page table is not used in passthrough mode, switching to v1 page table is not required. Therefore, remove redundant amd_iommu_pgtable update and misleading warning message. Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-7-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 206fb06dc54a7b3df0107a96e221e7b49661059d Author: Suravee Suthikulpanit Date: Thu Sep 21 09:21:38 2023 +0000 iommu/amd: Introduce helper functions for managing GCR3 table Refactor domain_enable_v2() into helper functions for managing GCR3 table (i.e. setup_gcr3_table() and get_gcr3_levels()), which will be used in subsequent patches. Also re-arrange code and remove forward declaration. Signed-off-by: Suravee Suthikulpanit Co-developed-by: Vasant Hegde Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-6-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit bac05772fa9912195b2029ab757fe86773c7ff00 Author: Vasant Hegde Date: Thu Sep 21 09:21:37 2023 +0000 iommu/amd: Refactor protection domain allocation code To replace if-else with switch-case statement due to increasing number of domain types. No functional changes intended. Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-5-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit ba7d263b7749f8e7f227d7357963632711b5c6ea Author: Suravee Suthikulpanit Date: Thu Sep 21 09:21:36 2023 +0000 iommu/amd: Consolidate logic to allocate protection domain Move the logic into the common caller function to simplify the code. No functional changes intended. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-4-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 75e6d7edfdcc540fc59d7bb289bd8b68ca11aa1c Author: Suravee Suthikulpanit Date: Thu Sep 21 09:21:35 2023 +0000 iommu/amd: Consolidate timeout pre-define to amd_iommu_type.h To allow inclusion in other files in subsequent patches. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-3-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit ade4bec9e18294dd2f754007cfdc5d3bc294400d Author: Suravee Suthikulpanit Date: Thu Sep 21 09:21:34 2023 +0000 iommu/amd: Remove unused amd_io_pgtable.pt_root variable It has been no longer used since the commit 6eedb59c18a3 ("iommu/amd: Remove amd_iommu_domain_get_pgtable"). Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde Reviewed-by: Jason Gunthorpe Reviewed-by: Jerry Snitselaar Link: https://lore.kernel.org/r/20230921092147.5930-2-vasant.hegde@amd.com Signed-off-by: Joerg Roedel commit 22dedf8f4570897f15e156ac5547cef93e802182 Author: Uwe Kleine-König Date: Mon Sep 25 11:55:07 2023 +0200 soc/microchip: mpfs-sys-controller: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However, the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here, there is a quest to make the remove callback return void. In the first step of this quest, all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: Conor Dooley commit 233045378dbbc0a7346127d19a54d4f91e0bd855 Author: Robin Murphy Date: Tue Sep 12 17:28:06 2023 +0100 iommu/iova: Manage the depot list size Automatically scaling the depot up to suit the peak capacity of a workload is all well and good, but it would be nice to have a way to scale it back down again if the workload changes. To that end, add backround reclaim that will gradually free surplus magazines if the depot size remains above a reasonable threshold for long enough. Reviewed-by: Jerry Snitselaar Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/03170665c56d89c6ce6081246b47f68d4e483308.1694535580.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 911aa1245da83ff5e76d33bb612d8b5a3f2ec4a5 Author: Robin Murphy Date: Tue Sep 12 17:28:05 2023 +0100 iommu/iova: Make the rcache depot scale better The algorithm in the original paper specifies the storage of full magazines in the depot as an unbounded list rather than a fixed-size array. It turns out to be pretty straightforward to do this in our implementation with no significant loss of efficiency. This allows the depot to scale up to the working set sizes of larger systems, while also potentially saving some memory on smaller ones too. Since this involves touching struct iova_magazine with the requisite care, we may as well reinforce the comment with a proper assertion too. Reviewed-by: John Garry Reviewed-by: Jerry Snitselaar Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/f597aa72fc3e1d315bc4574af0ce0ebe5c31cd22.1694535580.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit afad94a93ef12887390d67aa9b6dd6be2657712f Author: Robin Murphy Date: Tue Sep 12 17:18:44 2023 +0100 iommu: Improve map/unmap sanity checks The current checks for the __IOMMU_DOMAIN_PAGING capability seem a bit stifled, since it is quite likely now that a non-paging domain won't have a pgsize_bitmap and/or mapping ops, and thus get caught by the earlier condition anyway. Swap them around to test the more fundamental condition first, then we can reasonably also upgrade the other to a WARN_ON, since if a driver does ever expose a paging domain without the means to actually page, it's clearly very broken. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/524db1ec0139c964d26928a6a264945aa66d010c.1694525662.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit bd111e987e762d82dc738232c6ed4b3c9bcc5c91 Author: Robin Murphy Date: Tue Sep 12 17:18:43 2023 +0100 iommu: Retire map/unmap ops With everyone now implementing the new interfaces, clean up the last remnants of the old map/unmap ops and simplify the calling logic again. Signed-off-by: Robin Murphy Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/d2afdf13b2fbf537713c3ec642dfd49d16dd9e6a.1694525662.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 39f823dfb59e8a4f718a16e8a1cdac32d42804ad Author: Robin Murphy Date: Tue Sep 12 17:18:42 2023 +0100 iommu/tegra-smmu: Update to {map,unmap}_pages Trivially update map/unmap to the new interface, which is quite happy for drivers to still process just one page per call. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/338c520ed947d6d5b9d0509ccb4588908bd9ce1e.1694525662.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 8c63d1e3d3a04d99684ad6f6af7f4bb641fd6928 Author: Robin Murphy Date: Tue Sep 12 17:18:40 2023 +0100 iommu/sun50i: Update to {map,unmap}_pages Trivially update map/unmap to the new interface, which is quite happy for drivers to still process just one page per call. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/395995e5097803f9a65f2fb79e0732d41c2b8a84.1694525662.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit d47b9777e7bf842f4206d6883c608a103fccd419 Author: Robin Murphy Date: Tue Sep 12 17:18:39 2023 +0100 iommu/rockchip: Update to {map,unmap}_pages Trivially update map/unmap to the new interface, which is quite happy for drivers to still process just one page per call. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/ccc21bf7d1d0da8989d4d517a13d0846d6b71a38.1694525662.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit dc9ffd8dba8b2769528bf60b0fb6551cd02365b7 Author: Robin Murphy Date: Tue Sep 12 17:18:38 2023 +0100 iommu/omap: Update to {map,unmap}_pages Trivially update map/unmap to the new interface, which is quite happy for drivers to still process just one page per call. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/7bad94ffccd4cba32bded72e0860974012881e24.1694525662.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 983efefa44a3eadbc59d9801c61009ee86b7d4f8 Author: Robin Murphy Date: Tue Sep 12 17:18:37 2023 +0100 iommu/exynos: Update to {map,unmap}_pages Trivially update map/unmap to the new interface, which is quite happy for drivers to still process just one page per call. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/579176033e92d49ec9fc9f3d33d7b9d4c474f0b4.1694525662.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit ebfdc4569eabeacd5ef52364ac0496981652c055 Author: Jason Gunthorpe Date: Tue Aug 22 13:16:02 2023 -0300 iommu/omap: Convert to generic_single_device_group() Use the new helper. For some reason omap will probe its driver even if it doesn't load an iommu driver. Keep this working by keeping a bool to track if the iommu driver was started. Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/7-v1-c869a95191f2+5e8-iommu_single_grp_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 8f68911efc16feba1faf073ebea53f6a5b363e7c Author: Jason Gunthorpe Date: Tue Aug 22 13:16:01 2023 -0300 iommu/ipmmu-vmsa: Convert to generic_single_device_group() Use the new helper. This driver is kind of weird since in ARM mode it pretends it has per-device groups, but ARM64 mode does not. Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/6-v1-c869a95191f2+5e8-iommu_single_grp_jgg@nvidia.com Signed-off-by: Joerg Roedel commit ef0f48c6be822ead31465d17a429174d56300cf8 Author: Jason Gunthorpe Date: Tue Aug 22 13:16:00 2023 -0300 iommu/rockchip: Convert to generic_single_device_group() Use the new helper. Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/5-v1-c869a95191f2+5e8-iommu_single_grp_jgg@nvidia.com Signed-off-by: Joerg Roedel commit a62cafe124b3b91ce85d17c036552b59c1243011 Author: Jason Gunthorpe Date: Tue Aug 22 13:15:59 2023 -0300 iommu/sprd: Convert to generic_single_device_group() Use the new helper. Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/4-v1-c869a95191f2+5e8-iommu_single_grp_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 4f43b6b6d1e025ecac792298d67a7c6c11334cfc Author: Jason Gunthorpe Date: Tue Aug 22 13:15:58 2023 -0300 iommu/sun50i: Convert to generic_single_device_group() Use the new helper. Signed-off-by: Jason Gunthorpe Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/3-v1-c869a95191f2+5e8-iommu_single_grp_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 950210887670cbb7d2eb9af6fb743b70f1a1ebdc Author: Rafael J. Wysocki Date: Tue Sep 19 20:54:37 2023 +0200 thermal: core: Drop trips_disabled bitmask After recent changes, thermal_zone_get_trip() cannot fail, as invoked from thermal_zone_device_register_with_trips(), so the only role of the trips_disabled bitmask is struct thermal_zone_device is to make handle_thermal_trip() skip trip points whose temperature was initially zero. However, since the unit of temperature in the thermal core is millicelsius, zero may very well be a valid temperature value at least in some usage scenarios and the trip temperature may as well change later. Thus there is no reason to permanently disable trip points with initial temperature equal to zero. Accordingly, drop the trips_disabled bitmask along with the code related to it. Signed-off-by: Rafael J. Wysocki Tested-by: Ido Schimmel Acked-by: Daniel Lezcano commit e8f52d84cf0b6d1862ab62f7ed705f78690d11b2 Author: Jason Gunthorpe Date: Tue Aug 22 13:15:57 2023 -0300 iommu: Add generic_single_device_group() This implements the common pattern seen in drivers of a single iommu_group for the entire iommu driver instance. Implement this in core code so the drivers that want this can select it from their ops. Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/2-v1-c869a95191f2+5e8-iommu_single_grp_jgg@nvidia.com Signed-off-by: Joerg Roedel commit e946f8e3e62bf05da21a14658f8cb05e2a616260 Author: Jason Gunthorpe Date: Tue Aug 22 13:15:56 2023 -0300 iommu: Remove useless group refcounting Several functions obtain the group reference and then release it before returning. This gives the impression that the refcount is protecting something for the duration of the function. In truth all of these functions are called in places that know a device driver is probed to the device and our locking rules already require that dev->iommu_group cannot change while a driver is attached to the struct device. If this was not the case then this code is already at risk of triggering UAF as it is racy if the dev->iommu_group is concurrently going to NULL/free. refcount debugging will throw a WARN if kobject_get() is called on a 0 refcount object to highlight the bug. Remove the confusing refcounting and leave behind a comment about the restriction. Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/1-v1-c869a95191f2+5e8-iommu_single_grp_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 4efd98d41ea71835f4d291176ff1fd0a1803dfd5 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:57 2023 -0300 iommu: Convert remaining simple drivers to domain_alloc_paging() These drivers don't support IOMMU_DOMAIN_DMA, so this commit effectively allows them to support that mode. The prior work to require default_domains makes this safe because every one of these drivers is either compilation incompatible with dma-iommu.c, or already establishing a default_domain. In both cases alloc_domain() will never be called with IOMMU_DOMAIN_DMA for these drivers so it is safe to drop the test. Removing these tests clarifies that the domain allocation path is only about the functionality of a paging domain and has nothing to do with policy of how the paging domain is used for UNMANAGED/DMA/DMA_FQ. Tested-by: Niklas Schnelle Tested-by: Steven Price Tested-by: Marek Szyprowski Tested-by: Nicolin Chen Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/24-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 3529375e7777b0f9b77c53df9a7da122bd165ae7 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:56 2023 -0300 iommu: Convert simple drivers with DOMAIN_DMA to domain_alloc_paging() These drivers are all trivially converted since the function is only called if the domain type is going to be IOMMU_DOMAIN_UNMANAGED/DMA. Tested-by: Heiko Stuebner Tested-by: Steven Price Tested-by: Marek Szyprowski Tested-by: Nicolin Chen Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Tested-by: Yong Wu #For mtk_iommu.c Link: https://lore.kernel.org/r/23-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 4601cd2d7c4c82c4bafc822e1ff630a709eff206 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:55 2023 -0300 iommu: Add ops->domain_alloc_paging() This callback requests the driver to create only a __IOMMU_DOMAIN_PAGING domain, so it saves a few lines in a lot of drivers needlessly checking the type. More critically, this allows us to sweep out all the IOMMU_DOMAIN_UNMANAGED and IOMMU_DOMAIN_DMA checks from a lot of the drivers, simplifying what is going on in the code and ultimately removing the now-unused special cases in drivers where they did not support IOMMU_DOMAIN_DMA. domain_alloc_paging() should return a struct iommu_domain that is functionally compatible with ARM_DMA_USE_IOMMU, dma-iommu.c and iommufd. Be forwards looking and pass in a 'struct device *' argument. We can provide this when allocating the default_domain. No drivers will look at this. Tested-by: Steven Price Tested-by: Marek Szyprowski Tested-by: Nicolin Chen Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/22-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 8359cf39acba72606736f453f54432ac9dc28523 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:54 2023 -0300 iommu: Add __iommu_group_domain_alloc() Allocate a domain from a group. Automatically obtains the iommu_ops to use from the device list of the group. Convert the internal callers to use it. Tested-by: Steven Price Tested-by: Marek Szyprowski Tested-by: Nicolin Chen Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/21-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 98ac73f99bc44fba8a14252ffb0bad02459f7008 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:53 2023 -0300 iommu: Require a default_domain for all iommu drivers At this point every iommu driver will cause a default_domain to be selected, so we can finally remove this gap from the core code. The following table explains what each driver supports and what the resulting default_domain will be: ops->defaut_domain IDENTITY DMA PLATFORM v ARM32 dma-iommu ARCH amd/iommu.c Y Y N/A either apple-dart.c Y Y N/A either arm-smmu.c Y Y IDENTITY either qcom_iommu.c G Y IDENTITY either arm-smmu-v3.c Y Y N/A either exynos-iommu.c G Y IDENTITY either fsl_pamu_domain.c Y Y N/A N/A PLATFORM intel/iommu.c Y Y N/A either ipmmu-vmsa.c G Y IDENTITY either msm_iommu.c G IDENTITY N/A mtk_iommu.c G Y IDENTITY either mtk_iommu_v1.c G IDENTITY N/A omap-iommu.c G IDENTITY N/A rockchip-iommu.c G Y IDENTITY either s390-iommu.c Y Y N/A N/A PLATFORM sprd-iommu.c Y N/A DMA sun50i-iommu.c G Y IDENTITY either tegra-smmu.c G Y IDENTITY IDENTITY virtio-iommu.c Y Y N/A either spapr Y Y N/A N/A PLATFORM * G means ops->identity_domain is used * N/A means the driver will not compile in this configuration ARM32 drivers select an IDENTITY default domain through either the ops->identity_domain or directly requesting an IDENTIY domain through alloc_domain(). In ARM64 mode tegra-smmu will still block the use of dma-iommu.c and forces an IDENTITY domain. S390 uses a PLATFORM domain to represent when the dma_ops are set to the s390 iommu code. fsl_pamu uses an PLATFORM domain. POWER SPAPR uses PLATFORM and blocking to enable its weird VFIO mode. The x86 drivers continue unchanged. After this patch group->default_domain is only NULL for a short period during bus iommu probing while all the groups are constituted. Otherwise it is always !NULL. This completes changing the iommu subsystem driver contract to a system where the current iommu_domain always represents some form of translation and the driver is continuously asserting a definable translation mode. It resolves the confusion that the original ops->detach_dev() caused around what translation, exactly, is the IOMMU performing after detach. There were at least three different answers to that question in the tree, they are all now clearly named with domain types. Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Tested-by: Steven Price Tested-by: Marek Szyprowski Tested-by: Nicolin Chen Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 5b167dea64a3fb72907e33f30211d4a5711076f1 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:52 2023 -0300 iommu/sun50i: Add an IOMMU_IDENTITIY_DOMAIN Prior to commit 1b932ceddd19 ("iommu: Remove detach_dev callbacks") the sun50i_iommu_detach_device() function was being called by ops->detach_dev(). This is an IDENTITY domain so convert sun50i_iommu_detach_device() into sun50i_iommu_identity_attach() and a full IDENTITY domain and thus hook it back up the same was as the old ops->detach_dev(). Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/19-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit b01b12573837f237cec13b9ddf8e5e623ee6f981 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:51 2023 -0300 iommu/mtk_iommu: Add an IOMMU_IDENTITIY_DOMAIN This brings back the ops->detach_dev() code that commit 1b932ceddd19 ("iommu: Remove detach_dev callbacks") deleted and turns it into an IDENTITY domain. Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/18-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 666c9f1ef7fa9330ea041aba36658aeb48145846 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:50 2023 -0300 iommu/ipmmu: Add an IOMMU_IDENTITIY_DOMAIN This brings back the ops->detach_dev() code that commit 1b932ceddd19 ("iommu: Remove detach_dev callbacks") deleted and turns it into an IDENTITY domain. Also reverts commit 584d334b1393 ("iommu/ipmmu-vmsa: Remove ipmmu_utlb_disable()") Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/17-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 786478a90294ea5b149ed1156a43e82d63ea61ff Author: Jason Gunthorpe Date: Wed Sep 13 10:43:49 2023 -0300 iommu/qcom_iommu: Add an IOMMU_IDENTITIY_DOMAIN This brings back the ops->detach_dev() code that commit 1b932ceddd19 ("iommu: Remove detach_dev callbacks") deleted and turns it into an IDENTITY domain. Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/16-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 24b1d476167df3e30c7a53b67765bf3c787c5160 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:48 2023 -0300 iommu: Remove ops->set_platform_dma_ops() All drivers are now using IDENTITY or PLATFORM domains for what this did, we can remove it now. It is no longer possible to attach to a NULL domain. Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Tested-by: Steven Price Tested-by: Marek Szyprowski Tested-by: Nicolin Chen Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/15-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 78fc30b4bb3540c88edd19c36d0a72bb0dd02d0b Author: Jason Gunthorpe Date: Wed Sep 13 10:43:47 2023 -0300 iommu/msm: Implement an IDENTITY domain What msm does during msm_iommu_set_platform_dma() is actually putting the iommu into identity mode. Move to the new core support for ARM_DMA_USE_IOMMU by defining ops->identity_domain. This driver does not support IOMMU_DOMAIN_DMA, however it cannot be compiled on ARM64 either. Most likely it is fine to support dma-iommu.c Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/14-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit bbe39b76330ecf64f8b3f45cdf8bacbbb7f390c9 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:46 2023 -0300 iommu/omap: Implement an IDENTITY domain What omap does during omap_iommu_set_platform_dma() is actually putting the iommu into identity mode. Move to the new core support for ARM_DMA_USE_IOMMU by defining ops->identity_domain. This driver does not support IOMMU_DOMAIN_DMA, however it cannot be compiled on ARM64 either. Most likely it is fine to support dma-iommu.c Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/13-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit f128094f347f578279e551488796d0a0067cbdff Author: Jason Gunthorpe Date: Wed Sep 13 10:43:45 2023 -0300 iommu/tegra-smmu: Support DMA domains in tegra All ARM64 iommu drivers should support IOMMU_DOMAIN_DMA to enable dma-iommu.c. tegra is blocking dma-iommu usage, and also default_domain's, because it wants an identity translation. This is needed for some device quirk. The correct way to do this is to support IDENTITY domains and use ops->def_domain_type() to return IOMMU_DOMAIN_IDENTITY for only the quirky devices. Add support for IOMMU_DOMAIN_DMA and force IOMMU_DOMAIN_IDENTITY mode for everything so no behavior changes. Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/12-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit c8cc2655cc6c7ff832827ad5bc1a8f3df165706d Author: Jason Gunthorpe Date: Wed Sep 13 10:43:44 2023 -0300 iommu/tegra-smmu: Implement an IDENTITY domain What tegra-smmu does during tegra_smmu_set_platform_dma() is actually putting the iommu into identity mode. Move to the new core support for ARM_DMA_USE_IOMMU by defining ops->identity_domain. Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/11-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit b3d14960e629f9ee8c82f8feb211ae43e1cb3246 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:43 2023 -0300 iommu/exynos: Implement an IDENTITY domain What exynos calls exynos_iommu_detach_device is actually putting the iommu into identity mode. Move to the new core support for ARM_DMA_USE_IOMMU by defining ops->identity_domain. Tested-by: Marek Szyprowski Acked-by: Marek Szyprowski Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/10-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit e98befd010bd56b8b3f2afea2d600e30df023e6b Author: Jason Gunthorpe Date: Wed Sep 13 10:43:42 2023 -0300 iommu: Allow an IDENTITY domain as the default_domain in ARM32 Even though dma-iommu.c and CONFIG_ARM_DMA_USE_IOMMU do approximately the same stuff, the way they relate to the IOMMU core is quiet different. dma-iommu.c expects the core code to setup an UNMANAGED domain (of type IOMMU_DOMAIN_DMA) and then configures itself to use that domain. This becomes the default_domain for the group. ARM_DMA_USE_IOMMU does not use the default_domain, instead it directly allocates an UNMANAGED domain and operates it just like an external driver. In this case group->default_domain is NULL. If the driver provides a global static identity_domain then automatically use it as the default_domain when in ARM_DMA_USE_IOMMU mode. This allows drivers that implemented default_domain == NULL as an IDENTITY translation to trivially get a properly labeled non-NULL default_domain on ARM32 configs. With this arrangment when ARM_DMA_USE_IOMMU wants to disconnect from the device the normal detach_domain flow will restore the IDENTITY domain as the default domain. Overall this makes attach_dev() of the IDENTITY domain called in the same places as detach_dev(). This effectively migrates these drivers to default_domain mode. For drivers that support ARM64 they will gain support for the IDENTITY translation mode for the dma_api and behave in a uniform way. Drivers use this by setting ops->identity_domain to a static singleton iommu_domain that implements the identity attach. If the core detects ARM_DMA_USE_IOMMU mode then it automatically attaches the IDENTITY domain during probe. Drivers can continue to prevent the use of DMA translation by returning IOMMU_DOMAIN_IDENTITY from def_domain_type, this will completely prevent IOMMU_DMA from running but will not impact ARM_DMA_USE_IOMMU. This allows removing the set_platform_dma_ops() from every remaining driver. Remove the set_platform_dma_ops from rockchip and mkt_v1 as all it does is set an existing global static identity domain. mkt_v1 does not support IOMMU_DOMAIN_DMA and it does not compile on ARM64 so this transformation is safe. Tested-by: Steven Price Tested-by: Marek Szyprowski Tested-by: Nicolin Chen Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/9-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 59ddce4418da483c932bc7a08b88d6ba14020e83 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:41 2023 -0300 iommu: Reorganize iommu_get_default_domain_type() to respect def_domain_type() Except for dart (which forces IOMMU_DOMAIN_DMA) every driver returns 0 or IDENTITY from ops->def_domain_type(). The drivers that return IDENTITY have some kind of good reason, typically that quirky hardware really can't support anything other than IDENTITY. Arrange things so that if the driver says it needs IDENTITY then iommu_get_default_domain_type() either fails or returns IDENTITY. It will not ignore the driver's override to IDENTITY. Split the function into two steps, reducing the group device list to the driver's def_domain_type() and the untrusted flag. Then compute the result based on those two reduced variables. Fully reject combining untrusted with IDENTITY. Remove the debugging print on the iommu_group_store_type() failure path, userspace should not be able to trigger kernel prints. This makes the next patch cleaner that wants to force IDENTITY always for ARM_IOMMU because there is no support for DMA. Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/8-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 90057dc095dca023ad3e8cd5a129f392b543fb9e Author: Jason Gunthorpe Date: Wed Sep 13 10:43:40 2023 -0300 iommu/mtk_iommu_v1: Implement an IDENTITY domain What mtk does during mtk_iommu_v1_set_platform_dma() is actually putting the iommu into identity mode. Make this available as a proper IDENTITY domain. The mtk_iommu_v1_def_domain_type() from commit 8bbe13f52cb7 ("iommu/mediatek-v1: Add def_domain_type") explains this was needed to allow probe_finalize() to be called, but now the IDENTITY domain will do the same job so change the returned def_domain_type. mkt_v1 is the only driver that returns IOMMU_DOMAIN_UNMANAGED from def_domain_type(). This allows the next patch to enforce an IDENTITY domain policy for this driver. Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/7-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit c462944901319cb52ec0d0382dcea64f4f6f70e8 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:39 2023 -0300 iommu/tegra-gart: Remove tegra-gart Thierry says this is not used anymore, and doesn't think it makes sense as an iommu driver. The HW it supports is about 10 years old now and newer HW uses different IOMMU drivers. As this is the only driver with a GART approach, and it doesn't really meet the driver expectations from the IOMMU core, let's just remove it so we don't have to think about how to make it fit in. It has a number of identified problems: - The assignment of iommu_groups doesn't match the HW behavior - It claims to have an UNMANAGED domain but it is really an IDENTITY domain with a translation aperture. This is inconsistent with the core expectation for security sensitive operations - It doesn't implement a SW page table under struct iommu_domain so * It can't accept a map until the domain is attached * It forgets about all maps after the domain is detached * It doesn't clear the HW of maps once the domain is detached (made worse by having the wrong groups) Cc: Thierry Reding Cc: Dmitry Osipenko Acked-by: Thierry Reding Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/6-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 8565915e75581ba540527d1d9a2b89620002a0d0 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:38 2023 -0300 iommu/fsl_pamu: Implement a PLATFORM domain This driver is nonsensical. To not block migrating the core API away from NULL default_domains give it a hacky of a PLATFORM domain that keeps it working exactly as it always did. Leave some comments around to warn away any future people looking at this. Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/5-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit e04c7487a6655722172e93e8f36e51d6ab279f86 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:37 2023 -0300 iommu: Add IOMMU_DOMAIN_PLATFORM for S390 The PLATFORM domain will be set as the default domain and attached as normal during probe. The driver will ignore the initial attach from a NULL domain to the PLATFORM domain. After this, the PLATFORM domain's attach_dev will be called whenever we detach from an UNMANAGED domain (eg for VFIO). This is the same time the original design would have called op->detach_dev(). This is temporary until the S390 dma-iommu.c conversion is merged. Tested-by: Heiko Stuebner Tested-by: Niklas Schnelle Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/4-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 2ad56efa80dba89162106c06ebc00b611325e584 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:36 2023 -0300 powerpc/iommu: Setup a default domain and remove set_platform_dma_ops POWER is using the set_platform_dma_ops() callback to hook up its private dma_ops, but this is buired under some indirection and is weirdly happening for a BLOCKED domain as well. For better documentation create a PLATFORM domain to manage the dma_ops, since that is what it is for, and make the BLOCKED domain an alias for it. BLOCKED is required for VFIO. Also removes the leaky allocation of the BLOCKED domain by using a global static. Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/3-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 1c68cbc64fe6ac01dc242ba562344303031a76fb Author: Jason Gunthorpe Date: Wed Sep 13 10:43:35 2023 -0300 iommu: Add IOMMU_DOMAIN_PLATFORM This is used when the iommu driver is taking control of the dma_ops, currently only on S390 and power spapr. It is designed to preserve the original ops->detach_dev() semantic that these S390 was built around. Provide an opaque domain type and a 'default_domain' ops value that allows the driver to trivially force any single domain as the default domain. Update iommufd selftest to use this instead of set_platform_dma_ops Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/2-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit df31b298477e65a01deff0af352be3a61524d930 Author: Jason Gunthorpe Date: Wed Sep 13 10:43:34 2023 -0300 iommu: Add iommu_ops->identity_domain This allows a driver to set a global static to an IDENTITY domain and the core code will automatically use it whenever an IDENTITY domain is requested. By making it always available it means the IDENTITY can be used in error handling paths to force the iommu driver into a known state. Devices implementing global static identity domains should avoid failing their attach_dev ops. To make global static domains simpler allow drivers to omit their free function and update the iommufd selftest. Convert rockchip to use the new mechanism. Tested-by: Steven Price Tested-by: Marek Szyprowski Tested-by: Nicolin Chen Reviewed-by: Lu Baolu Reviewed-by: Jerry Snitselaar Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/1-v8-81230027b2fa+9d-iommu_all_defdom_jgg@nvidia.com Signed-off-by: Joerg Roedel commit 374a69427f2e6a675cb0ec871d9cfb8152008a3f Author: Krzysztof Kozlowski Date: Thu Jul 20 13:55:24 2023 +0200 ARM: dts: st: href-tvk1281618: correct touchscreen syna,nosleep-mode There is no syna,nosleep property in Synaptics RMI4 touchscreen: ste-hrefprev60-tvk.dtb: synaptics@4b: rmi4-f01@1: 'syna,nosleep' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Message-ID: <20230720115524.137944-2-krzysztof.kozlowski@linaro.org> Signed-off-by: Linus Walleij commit 3cb85fad3695d0d3c82162d7ec56d04661757ace Author: Krzysztof Kozlowski Date: Thu Jul 20 13:55:23 2023 +0200 ARM: dts: st: href-tvk1281618: fix touchscreen VIO supply According to bindings and Linux driver, there is no VDDIO but VIO supply: ste-hrefprev60-tvk.dtb: synaptics@4b: Unevaluated properties are not allowed ('vddio-supply' was unexpected) Signed-off-by: Krzysztof Kozlowski Message-ID: <20230720115524.137944-1-krzysztof.kozlowski@linaro.org> Signed-off-by: Linus Walleij commit 5482c0a28b2634e7a7d8ddaca7feac183e74b528 Author: Vinayak Yadawad Date: Fri Sep 22 14:55:51 2023 +0530 wifi: cfg80211: OWE DH IE handling offload Introduce new feature flags for OWE offload that driver can advertise to indicate kernel/application space to avoid DH IE handling. When this flag is advertised, the driver/device will take care of DH IE inclusion and processing of peer DH IE to generate PMK. Signed-off-by: Vinayak Yadawad Link: https://lore.kernel.org/r/f891cce4b52c939dfc6b71bb2f73e560e8cad287.1695374530.git.vinayak.yadawad@broadcom.com Signed-off-by: Johannes Berg commit 823a0258912b1a4f627e455bee7e78d349c29c5b Author: Po-Hao Huang Date: Mon Sep 25 16:08:59 2023 +0800 wifi: ieee80211: add UL-bandwidth definition of trigger frame Define UL-bandwidth values of trigger frame according to 802.11 std. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Link: https://lore.kernel.org/r/20230925080902.51449-2-pkshih@realtek.com Signed-off-by: Johannes Berg commit 61df9ca231075e7031ed3dcf8b9986dfd80050f6 Author: Janne Grunau Date: Tue Sep 12 22:22:05 2023 +0200 drm/simpledrm: Add support for multiple "power-domains" Multiple power domains need to be handled explicitly in each driver. The driver core can not handle it automatically since it is not aware of power sequencing requirements the hardware might have. This is not a problem for simpledrm since everything is expected to be powered on by the bootloader. simpledrm has just ensure it remains powered on during its lifetime. This is required on Apple silicon M2 and M2 Pro/Max/Ultra desktop systems. The HDMI output initialized by the bootloader requires keeping the display controller and a DP phy power domain on. Signed-off-by: Janne Grunau Reviewed-by: Eric Curtin Reviewed-by: Neal Gompa Reviewed-by: Thomas Zimmermann Reviewed-by: Sven Peter Reviewed-by: Javier Martinez Canillas Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20230912-simpledrm-multiple-power-domains-v2-1-01b66bfb1980@jannau.net commit 612f769edd06a6e42f7cd72425488e68ddaeef0a Author: Valentin Schneider Date: Fri Aug 11 12:20:44 2023 +0100 sched/rt: Make rt_rq->pushable_tasks updates drive rto_mask Sebastian noted that the rto_push_work IRQ work can be queued for a CPU that has an empty pushable_tasks list, which means nothing useful will be done in the IPI other than queue the work for the next CPU on the rto_mask. rto_push_irq_work_func() only operates on tasks in the pushable_tasks list, but the conditions for that irq_work to be queued (and for a CPU to be added to the rto_mask) rely on rq_rt->nr_migratory instead. nr_migratory is increased whenever an RT task entity is enqueued and it has nr_cpus_allowed > 1. Unlike the pushable_tasks list, nr_migratory includes a rt_rq's current task. This means a rt_rq can have a migratible current, N non-migratible queued tasks, and be flagged as overloaded / have its CPU set in the rto_mask, despite having an empty pushable_tasks list. Make an rt_rq's overload logic be driven by {enqueue,dequeue}_pushable_task(). Since rt_rq->{rt_nr_migratory,rt_nr_total} become unused, remove them. Note that the case where the current task is pushed away to make way for a migration-disabled task remains unchanged: the migration-disabled task has to be in the pushable_tasks list in the first place, which means it has nr_cpus_allowed > 1. Reported-by: Sebastian Andrzej Siewior Signed-off-by: Valentin Schneider Signed-off-by: Ingo Molnar Tested-by: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/20230811112044.3302588-1-vschneid@redhat.com commit 6b16953bec40e6fce853d2a69b8e738d61896568 Author: Geert Uytterhoeven Date: Thu Aug 31 13:17:44 2023 +0200 ARM: shmobile: rcar-gen2: Remove unneeded once handling rcar_gen2_pm_init() is only called from the smp_operations.smp_prepare_cpus() callback, which is called at most once. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/116ef21e5f495432d913315bdc25fbc30edcf2e1.1693409184.git.geert+renesas@glider.be commit a512635da9f7223b97262a5f376c7f1c3e9f6f7d Author: Kees Cook Date: Fri Sep 22 10:52:03 2023 -0700 gpiolib: cdev: annotate struct linereq with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct linereq. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 997a29bbb1e0d6d10ebc2291fac604c4cded5828 Author: Kees Cook Date: Fri Sep 22 10:51:55 2023 -0700 eeprom: at24: Annotate struct at24_data with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct at24_data. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Bartosz Golaszewski commit d70be079c3cf34bd91e1c8f7b4bc760356c9150c Author: Kuninori Morimoto Date: Wed Sep 20 23:53:12 2023 +0000 arm64: dts: renesas: ulcb/kf: Use multi Component sound +-- ULCB -------------------+ |+--------+ +--------+| || SSI0| <---> |ak4613 || || SSI1| <---> | || || | +--------+| || | +--------+| || SSI2| <---> |HDMI || || | +--------+| || SSI3| <--+ | || SSI4| <-+| | |+--------+ || | +-------------||------------+ +-- Kingfisher -------------+ | || +--------+| | |+->|pcm3168a|| | +-->| || | +--------+| +---------------------------+ On UCLB/KF, we intuitively think we want to handle these as "2 Sound Cards": card0,0: 1st sound of ULCB (SSI0 - ak4613) card0,1: 2nd sound of ULCB (SSI2 - HDMI) card1,0: 1st sound of KF (SSI3 - pcm3168a) ^ ^ However, because of ASoC Component vs. Card framework limitations, we needed to handle this as "1 big Sound Card": card0,0: 1st sound of ULCB/KF (SSI0 - ak4613) card0,1: 2nd sound of ULCB/KF (SSI2 - HDMI) card0,2: 3rd sound of ULCB/KF (SSI3 - pcm3168a) ^ ^ Now ASoC supports multi Component, which allows us to handle "2 Sound Cards" such as "ULCB Sound Card" and "Kingfisher Sound Card", all ULCB/KF Audio dtsi can be updated. Note that this changes the Sound Card specification method from userland, especially for Kingfisher Sound. Signed-off-by: Kuninori Morimoto Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/87fs382yhk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven commit 98537eb77d3ef185a4b1b4004da75301038cf76b Author: Geert Uytterhoeven Date: Thu Aug 31 13:52:33 2023 +0200 ARM: dts: renesas: rskrza1: Add FLASH nodes Add device nodes for the dual Spansion S25FL512S QSPI NOR FLASH and the Spansion S29GL512S CFI NOR FLASH on the RSK+RZA1 development board. The former is mapped directly through the SPI Multi I/O Bus Controller. The latter resides in the external address space of the Bus State Controller (BSC). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/17a221699da14639e72264ffa39d47592d470f9a.1693481518.git.geert+renesas@glider.be commit 30e0a8cf886cb459dc8a895ba9a4fb5132b41499 Author: Geert Uytterhoeven Date: Thu Aug 31 13:52:32 2023 +0200 ARM: dts: renesas: genmai: Add FLASH nodes Add device nodes for the dual Spansion S25FL512S QSPI NOR FLASH and the two Spansion S29GL512S CFI NOR FLASHes on the Genmai development board. The former is mapped directly through the SPI Multi I/O Bus Controller. The latter reside in the address space of the Bus State Controller (BSC). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/53c89c70c6b010702fd9ab5247e19986857671ba.1693481518.git.geert+renesas@glider.be commit 86b37eb01684db8f425108dd82c0781bf9812390 Author: Geert Uytterhoeven Date: Thu Aug 31 13:52:31 2023 +0200 ARM: dts: renesas: wheat: Move Ethernet node to LBSC The SMSC LAN89218AQ Ethernet controller on the Wheat development board resides in the external address space of the Local Bus State Controller (LBSC). Move the Ethernet device node to reflect this. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/a291c2750144df29e69824d5b9d76cbc11f613c1.1693481518.git.geert+renesas@glider.be commit d6c2de6b151069ebc3d24c226e482b10981ead92 Author: Geert Uytterhoeven Date: Thu Aug 31 13:52:30 2023 +0200 ARM: dts: renesas: blanche: Move Ethernet node to LBSC The SMSC LAN89218AQ Ethernet controller on the Blanche development board resides in the external address space of the Local Bus State Controller (LBSC). Move the Ethernet device node to reflect this. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/457239047bc8b5deabf15d816043a89ab00db5ef.1693481518.git.geert+renesas@glider.be commit dcd96d036db2563314f86f47a27b7dea8d508cfd Author: Geert Uytterhoeven Date: Thu Aug 31 13:52:29 2023 +0200 ARM: dts: renesas: marzen: Move Ethernet node to LBSC The SMSC LAN89218AQ Ethernet controller on the Marzen development board resides in the external address space of the Local Bus State Controller (LBSC). Move the Ethernet device node to reflect this. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/74a8ee61ed89c9ca0489156a4f135ecb825e56b9.1693481518.git.geert+renesas@glider.be commit 990da779a43aa678045bdb23f937e219e3ebc480 Author: Geert Uytterhoeven Date: Thu Aug 31 13:52:28 2023 +0200 ARM: dts: renesas: r8a7792: Add LBSC node Add a minimal device node for the Local Bus State Controller (LBSC) on the R-Car V2H SoC, to be extended by board DTS files for devices residing in the LBSC external address space. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/182fce2257679f6a8963ecb77aae68af617556d1.1693481518.git.geert+renesas@glider.be commit f7287f78d5b3650092507e38429219a5d2cb8489 Author: Geert Uytterhoeven Date: Thu Aug 31 13:52:27 2023 +0200 ARM: dts: renesas: r8a7779: Add LBSC node Add a minimal device node for the Local Bus State Controller (LBSC) on the R-Car H1 SoC, to be extended by board DTS files for devices residing in the LBSC external address space. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/2d0a6054306b4975355e65fe012f860ec00fcf55.1693481518.git.geert+renesas@glider.be commit 175f1971164a6f8f351907ea9fadb38d8406ffc8 Author: Geert Uytterhoeven Date: Thu Aug 31 13:52:26 2023 +0200 ARM: dts: renesas: r7s72100: Add BSC node Add a minimal device node for the Bus State Controller (BSC) on the RZ/A1H SoC, to be extended by board DTS files for devices residing in the BSC external address space. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/ccab4fa198225edcd3750f62532a1ee3c6d2a109.1693481518.git.geert+renesas@glider.be commit 7801764bb8ff68d9ca3dc6967d4642e205a22a0f Author: Geert Uytterhoeven Date: Thu Aug 31 13:52:25 2023 +0200 ARM: dts: renesas: Remove unused LBSC nodes from board DTS Several board DTS files contain minimal device nodes that represent on-SoC Local Bus State Controllers (LBSC), although they belong in the SoC-specific DTS files instead. As these device nodes are incomplete and unused, and hamper adding proper nodes later, it is better to just remove them. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/76ece7602045670cbb8dff684c3366ba6eb89add.1693481518.git.geert+renesas@glider.be commit c513228c472d65980f81ff061adb1b656b4dca90 Author: Mukesh Sisodiya Date: Thu Sep 21 11:58:10 2023 +0300 wifi: iwlwifi: add mapping of a periphery register crf for WH RF Add the support for prph register RF details and map it to get the RF ID of NIC. Signed-off-by: Mukesh Sisodiya Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230921110727.ccfc4868111f.I94dd75fc82443facf571f2fe8e23c50e9053a35a@changeid Signed-off-by: Johannes Berg commit 3aa80d31869bc2ba86f709843f7dbe1514ea10bb Author: Johannes Berg Date: Thu Sep 21 11:58:09 2023 +0300 wifi: iwlwifi: mvm: check for iwl_mvm_mld_update_sta() errors The return value of this function is assigned, but then unused. Check for errors here. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230921110727.a9496c232d48.I74adaa8f3c6fd3252348e79f18605246936ef27d@changeid Signed-off-by: Johannes Berg commit 7534e9665ae7a78c1e47fc07f1e3ed14bc579ea9 Author: Johannes Berg Date: Thu Sep 21 11:58:08 2023 +0300 wifi: iwlwifi: mvm: support injection antenna control Pull up the injection rate control one layer, and let it control the antenna settings as well. Since mac80211 has already checked that enough antennas are configured, and we only have two bits, it's enough to just copy the data over. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230921110727.12ab7634dbbc.I5aa16c99864ecd7375011a8996de2564fd01fc30@changeid Signed-off-by: Johannes Berg commit b99c4607973ae69af3b953c28952d3c9872007c8 Author: Johannes Berg Date: Thu Sep 21 11:58:07 2023 +0300 wifi: iwlwifi: mvm: refactor TX rate handling Refactor the injection and other frame TX rate handling to always return the injection rate directly, by factoring the legay rate portion out into a new function called in the two relevant places (injection and non-injection). Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230921110727.dc920357bad0.I5ee8512fb63f0423c1da35b59fea8811d60c1ad3@changeid Signed-off-by: Johannes Berg commit a856ce662c476d75405f576809b84f752909ddac Author: Johannes Berg Date: Thu Sep 21 11:58:06 2023 +0300 wifi: iwlwifi: mvm: make pldr_sync AX210 specific The register here is device specific, so we need to gate the reading/checking to apply only on AX210 family. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230921110726.928901700ad8.I648efdc4400d9e537359915a9a8f363d5d255ead@changeid Signed-off-by: Johannes Berg commit 6185e1e5b4d0a7bb78de0d4b2951e1d396fc67a0 Author: Johannes Berg Date: Thu Sep 21 11:58:05 2023 +0300 wifi: iwlwifi: fail NIC access fast on dead NIC If the NIC is already dead, as detected by the transport then there's no point to try to grab the NIC access and time out, we can just fail fast. This may speed up recovery. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230921110726.f3d8498c5a60.I5d0c442a731ca4c00716910d215b4bcde6963a65@changeid Signed-off-by: Johannes Berg commit 0c4aa7a12a5a96604c809092ae9a94891b4f230a Author: Yedidya Benshimol Date: Thu Sep 21 11:58:04 2023 +0300 wifi: iwlwifi: mvm: add support for new wowlan_info_notif This new version of wolan_info_notif supports the handling of bigtk during d3, this patch holds parsing of the new notif version, adding new keys and updating ipn of existing keys during the resume flow. Signed-off-by: Yedidya Benshimol Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230921110726.4ebcd244f436.Ib507573d50fa0ac666d09ab71f5241ccbcd7cd00@changeid Signed-off-by: Johannes Berg commit 54d1e8b27e8652c369d0e70eda3ea38b97836c1d Author: Johannes Berg Date: Thu Sep 21 11:58:03 2023 +0300 wifi: iwlwifi: pcie: (re-)assign BAR0 on driver bind There's a race with runtime PM getting enabled by userspace: - we rescan the PCI bus - this creates the new PCI device including its sysfs representation - udev sees the new device, and the (OS-specific?) scripting enables runtime PM by writing to power/control; this can happen _before_ the next step - this will runtime-suspend the device which saves the config space, including the BAR0 that wasn't assigned yet - the bus rescan assigns resources to the devices and writes them to the config space of the device (but not the runtime-pm saved copy) - the driver binds and this disallows runtime PM, so the device is resumed, restoring the (incomplete!) config space - the driver cannot work due to BAR0 not being configured Fixing the actual race is hard and deep in the PCI layer, though probably should be done for upstream as well; perhaps runtime PM should only be allowed after resource assignment, or some other TBD way. Work around this in the driver for now by simply (re-)assigning BAR0 when the driver initializes, if it's unset. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230921110726.5f5f782a4e97.I4b7bf5c52ba44a8c7f9878009021689bbfa9c5ef@changeid Signed-off-by: Johannes Berg commit 2f199ba8776adb5e6e138559acd88f508193cf37 Author: Anjaneyulu Date: Thu Sep 21 11:58:02 2023 +0300 wifi: iwlwifi: implement enable/disable for China 2022 regulatory China 2022 regulations are enabled by default. Disable only when disabled in BIOS or the firmware don't support this capability. If the firmware has this capability, read BIOS configuration data in function 4 using ACPI API and send GRP_REGULATORY_LARI_CONFIG_CHANGE_CMD to the firmware. Any error while reading BIOS data results in enablement of china 2022 regulations. Signed-off-by: Anjaneyulu Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230921110726.ba7cb3003e53.If5a180a59ee85ed4a4c9146cfeff841c25b81066@changeid Signed-off-by: Johannes Berg commit 89dc0a27e3fabfd58ce812d3b2c23217e8ca07f9 Author: Johannes Berg Date: Thu Sep 21 11:58:01 2023 +0300 wifi: iwlwifi: mvm: handle link-STA allocation in restart During HW restart, STA link changes happen while the link-sta is already allocated (had been prior to the restart). Adjust the allocation and checks to handle that. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230921110726.99b7cc754b00.Iaa0503a3100250489fed8b4bdcf60e24a96d3392@changeid Signed-off-by: Johannes Berg commit 5f809bafe48cf3f1d4bf1b1c852441d737194def Author: Johannes Berg Date: Thu Sep 21 11:58:00 2023 +0300 wifi: iwlwifi: mvm: iterate active links for STA queues During HW restart in eSR, links allocated in a station and links active in the interface may differ. Use for_each_sta_active_link to capture this. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230921110726.7ee1f1a55e1c.I410c512d1fad7d1cf9b2d2a3451a312821dc816d@changeid Signed-off-by: Johannes Berg commit 4ea1ed1d14d86173ff4298b1d8fcb60946602f93 Author: Emmanuel Grumbach Date: Thu Sep 21 11:57:59 2023 +0300 wifi: iwlwifi: mvm: support set_antenna() set_antenna() is supported only when the device is not started in mac80211 which translates to the firmware not being loaded in iwlwifi. The tricky part is that iwlwifi populates the sband data during its boot and doesn't touch this data afterwards, but if the antenna settings forbid MIMO, we need to update the sband data. Rework the nvm parsing code to allow to get an existing nvm_data and modify the sband with additional constraints (tx / rx chains masks). Suggested-by: Ben Greear Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230921110726.81d94d630c95.I9473da818cbeeb51b2f89dcc59b00019113e7f55@changeid [add bugfix from Benjamin for iwl_mvm_get_valid_rx_ant()] Signed-off-by: Johannes Berg commit 1228c749416cb2b0232cbd9beb0c9f1200dfb3c9 Author: Benjamin Berg Date: Wed Sep 20 21:25:29 2023 +0300 wifi: mac80211: reject MLO channel configuration if not supported Reject configuring a channel for MLO if either EHT is not supported or the BSS does not have the correct ML element. This avoids trying to do a multi-link association with a misconfigured AP. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.80c3b8e5a344.Iaa2d466ee6280994537e1ae7ab9256a27934806f@changeid Signed-off-by: Johannes Berg commit 4aa064484504fba48b3c71321940893ca7cebc84 Author: Benjamin Berg Date: Wed Sep 20 21:25:28 2023 +0300 wifi: mac80211: report per-link error during association With this cfg80211 can report the link that caused the error to userspace which is then able to react to it by e.g. removing the link from the association and retrying. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.275fc7f5c426.I8086c0fdbbf92537d6a8b8e80b33387fcfd5553d@changeid Signed-off-by: Johannes Berg commit a7b2cc591d556eca044c823e4e92d8c1cb430ef7 Author: Benjamin Berg Date: Wed Sep 20 21:25:27 2023 +0300 wifi: cfg80211: report per-link errors during association When one of the links (other than the assoc_link) is misconfigured and cannot work the association will fail. However, userspace was not able to tell that the operation only failed because of a problem with one of the links. Fix this, by allowing the driver to set a per-link error code and reporting the (first) offending link by setting the bad_attr accordingly. This only allows us to report the first error, but that is sufficient for userspace to e.g. remove the offending link and retry. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.ebe63c0bd513.I40799998f02bf987acee1501a2522dc98bb6eb5a@changeid Signed-off-by: Johannes Berg commit ef246a1480cc484cd2aeda75737cb0848616ddf3 Author: Johannes Berg Date: Wed Sep 20 21:25:26 2023 +0300 wifi: mac80211: support antenna control in injection Support antenna control for injection by parsing the antenna radiotap field (which may be presented multiple times) and telling the driver about the resulting antenna bitmap. Of course there's no guarantee the driver will actually honour this, just like any other injection control. If misconfigured, i.e. the injected HT/VHT MCS needs more chains than antennas are configured, the bitmap is reset to zero, indicating no selection. For now this is only set up for two anntenas so we keep more free bits, but that can be trivially extended if any driver implements support for it that can deal with hardware with more antennas. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.f71001aa4da9.I00ccb762a806ea62bc3d728fa3a0d29f4f285eeb@changeid Signed-off-by: Johannes Berg commit 702e80470a3359ce02b3f846f48f6db4ac7fd837 Author: Ayala Beker Date: Wed Sep 20 21:25:25 2023 +0300 wifi: mac80211: support handling of advertised TID-to-link mapping Support handling of advertised TID-to-link mapping elements received in a beacon. These elements are used by AP MLD to disable specific links and force all clients to stop using these links. By default if no TID-to-link mapping is advertised, all TIDs shall be mapped to all links. Signed-off-by: Ayala Beker Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.623c4b692ff9.Iab0a6f561d85b8ab6efe541590985a2b6e9e74aa@changeid Signed-off-by: Johannes Berg commit 62e9c64eedfeb697ba28081ccaac59a45f9a96e1 Author: Ayala Beker Date: Wed Sep 20 21:25:24 2023 +0300 wifi: mac80211: add support for parsing TID to Link mapping element Add the relevant definitions for TID to Link mapping element according to the P802.11be_D4.0. Signed-off-by: Ayala Beker Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.9ea9b0b4412a.I2281ab2c70e8b43a39032dc115db6a80f1f0b3f4@changeid Signed-off-by: Johannes Berg commit f605d10ad12bb2d414c610e0a7c640d1cf097d46 Author: Ilan Peer Date: Wed Sep 20 21:25:23 2023 +0300 wifi: mac80211_hwsim: Handle BSS_CHANGED_VALID_LINKS In station mode, set the active links to all the usable links. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.6218307226d3.I249f52b4773423a33c3121e31002abe0a8d98e78@changeid Signed-off-by: Johannes Berg commit 041a74cbe49048abc3adb6129141256e50b84b6e Author: Ilan Peer Date: Wed Sep 20 21:25:22 2023 +0300 wifi: mac80211: Notify the low level driver on change in MLO valid links Notify the low level driver when there is change in the valid links. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.4fc85b0a51b0.I64238e0e892709a2bd4764b3bca93cdcf021e2fd@changeid Signed-off-by: Johannes Berg commit c9394c8210c8a44e189d27ac85ee618780a4b6dc Author: Johannes Berg Date: Wed Sep 20 21:25:19 2023 +0300 wifi: mac80211_hwsim: move kernel-doc description Move the description after the parameter section, to make the kernel-doc script in verbose mode happy about it. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.7f5951a8e327.I5e0cc993acf281d6d90f124c6cce9a2f47000c7d@changeid Signed-off-by: Johannes Berg commit cef7104720cc1d4af238e8507a98e116c4b78ba2 Author: Johannes Berg Date: Wed Sep 20 21:25:18 2023 +0300 wifi: mac80211: describe return values in kernel-doc Add descriptions for two return values for two functions that are missing them. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.79307c341723.Ibae386f0354f2e215d4955752ac378acc2466b51@changeid Signed-off-by: Johannes Berg commit 87cd646f615ce152952b3bbd0c0b65863b7ff7ee Author: Johannes Berg Date: Wed Sep 20 21:25:17 2023 +0300 wifi: cfg80211: reg: describe return values in kernel-doc Describe the function return values in kernel-doc. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.8b1e45c8bab8.I6dbae4f6dfe8f5352bc44565cc5131e73dd1873f@changeid Signed-off-by: Johannes Berg commit e865c827e9da4d4740746b3fa1e321fab5482e12 Author: Johannes Berg Date: Wed Sep 20 21:25:16 2023 +0300 wifi: mac80211: allow for_each_sta_active_link() under RCU Since we only use this to protect the dereference and with STA mutex, we can also allow this with just RCU. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.73c3e04985f4.I52ef396d693e0e381a73eade06850137d8900948@changeid Signed-off-by: Johannes Berg commit 8a58fc1ce487a77dc9c87e12682b5297e4a030fa Author: Johannes Berg Date: Wed Sep 20 21:25:15 2023 +0300 wifi: mac80211: relax RCU check in for_each_vif_active_link() To iterate the vif links we don't necessarily need to be in an RCU critical section, it's also possible to hold the sdata/wdev mutex. Annotate for_each_vif_active_link() accordingly. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.858921bd2860.I01f456be8ce2a4fbd15e0d44302e2f7d72e91987@changeid Signed-off-by: Johannes Berg commit c09c4f31998bac6d73508e38812518aceb069b68 Author: Ayala Beker Date: Wed Sep 20 21:25:14 2023 +0300 wifi: mac80211: don't connect to an AP while it's in a CSA process Connection to an AP that is running a CSA flow may end up with a failure as the AP might change its channel during the connection flow while we do not track the channel change yet. Avoid that by rejecting a connection to such an AP. Signed-off-by: Ayala Beker Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.e5001a762a4a.I9745c695f3403b259ad000ce94110588a836c04a@changeid Signed-off-by: Johannes Berg commit 2bf57b00abecb2646bb3a387cfc9e6980658cdb5 Author: Emmanuel Grumbach Date: Wed Sep 20 21:25:13 2023 +0300 wifi: mac80211: update the rx_chains after set_antenna() rx_chains was set only upon registration and it we rely on it for the active chains upon SMPS configuration after association. When we use the set_antenna() API to limit the rx_chains from 2 to 1, this caused issues with iwlwifi since we still had 2 active_chains requested. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.2dde4da246b2.I904223c868c77cf2ba132a3088fe6506fcbb443b@changeid Signed-off-by: Johannes Berg commit b3239498353484fd6ddeb513df89c4628cd623d0 Author: Johannes Berg Date: Wed Sep 20 21:25:12 2023 +0300 wifi: mac80211: use bandwidth indication element for CSA In CSA, parse the (EHT) bandwidth indication element and use it (in fact prefer it if present). Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230920211508.43ef01920556.If4f24a61cd634ab1e50eba43899b9e992bf25602@changeid Signed-off-by: Johannes Berg commit bb55441c57ccc5cc2eab44e1a97698b9d708871d Author: Johannes Berg Date: Mon Sep 25 08:56:38 2023 +0200 wifi: cfg80211: split struct cfg80211_ap_settings Using the full struct cfg80211_ap_settings for an update is misleading, since most settings cannot be updated. Split the update case off into a new struct cfg80211_ap_update. Change-Id: I3ba4dd9280938ab41252f145227a7005edf327e4 Signed-off-by: Johannes Berg commit 6b348f6e34ce7dc5eb68066377d5e38780ce4095 Author: Johannes Berg Date: Tue Sep 19 08:40:52 2023 +0200 wifi: mac80211: ethtool: always hold wiphy mutex Drivers should really be able to rely on the wiphy mutex being held all the time, unless otherwise documented. For ethtool, that wasn't quite right. Fix and clarify this in both code and documentation. Reported-by: syzbot+c12a771b218dcbba32e1@syzkaller.appspotmail.com Fixes: 0e8185ce1dde ("wifi: mac80211: check wiphy mutex in ops") Signed-off-by: Johannes Berg commit 9f93f18305f5777820491e6ab9b34422c160371b Author: Bartosz Golaszewski Date: Sun Sep 17 10:58:37 2023 +0200 gpio: sim: initialize a managed pointer when declaring it Variables managed with __free() should typically be initialized where they are declared so that the __free() callback is paired with its counterpart resource allocator. Fix the second instance of using __free() in gpio-sim to follow this pattern. Fixes: 3faf89f27aab ("gpio: sim: simplify code with cleanup helpers") Suggested-by: Linus Torvalds Signed-off-by: Bartosz Golaszewski commit 5b43bd71f4942afa79b0683f4f41b1d47a21a9c7 Author: Colin Ian King Date: Tue Sep 19 10:52:05 2023 +0100 wifi: cfg80211: make read-only array centers_80mhz static const Don't populate the read-only array lanes on the stack, instead make it static const. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20230919095205.24949-1-colin.i.king@gmail.com Signed-off-by: Johannes Berg commit 40e13e18168fd0f1a6ad10166f5042a21c47ab99 Author: Eric Biggers Date: Sun Sep 24 22:54:48 2023 -0700 fscrypt: make the bounce page pool opt-in instead of opt-out Replace FS_CFLG_OWN_PAGES with a bit flag 'needs_bounce_pages' which has the opposite meaning. I.e., filesystems now opt into the bounce page pool instead of opt out. Make fscrypt_alloc_bounce_page() check that the bounce page pool has been initialized. I believe the opt-in makes more sense, since nothing else in fscrypt_operations is opt-out, and these days filesystems can choose to use blk-crypto which doesn't need the fscrypt bounce page pool. Also, I happen to be planning to add two more flags, and I wanted to fix the "FS_CFLG_" name anyway as it wasn't prefixed with "FSCRYPT_". Link: https://lore.kernel.org/r/20230925055451.59499-3-ebiggers@kernel.org Signed-off-by: Eric Biggers commit 5970fbad1036d1015abe45651628b39b5bcb8a22 Author: Eric Biggers Date: Sun Sep 24 22:54:47 2023 -0700 fscrypt: make it clearer that key_prefix is deprecated fscrypt_operations::key_prefix should not be set by any filesystems that aren't setting it already. This is already documented, but apparently it's not sufficiently clear, as both ceph and btrfs have tried to set it. Rename the field to legacy_key_prefix and improve the documentation to hopefully make it clearer. Link: https://lore.kernel.org/r/20230925055451.59499-2-ebiggers@kernel.org Signed-off-by: Eric Biggers commit 109ff9ed0f3c3c6b20233aab3e75fc0555d321a2 Author: Fabio Estevam Date: Sun Sep 10 09:57:25 2023 -0300 arm64: dts: imx93: Add the TMU interrupt The Thermal Monitoring Unit (TMU) interrupt is number 83. Describe it in the devicetree to fix the following schema warning: imx93-11x11-evk.dtb: tmu@44482000: 'oneOf' conditional failed, one must be fixed: 'interrupts' is a required property 'interrupts-extended' is a required property from schema $id: http://devicetree.org/schemas/thermal/qoriq-thermal.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit bbe3f08fcd938bcff8d4945ee736b512df82f1fb Author: Fabio Estevam Date: Sat Sep 9 13:44:03 2023 -0300 arm64: dts: imx8dxl-ss-adma: Fix i2c compatible entries Per i2c-imx-lpi2c.yaml, the imx8dxl lpi2c compatible should be: compatible = "fsl,imx8dxl-lpi2c", "fsl,imx7ulp-lpi2c"; Change it accordingly to fix the following schema warning: imx8dxl-evk.dtb: i2c@5a800000: compatible: 'oneOf' conditional failed, one must be fixed: ['fsl,imx8dxl-lpi2c', 'fsl,imx8qxp-lpi2c', 'fsl,imx7ulp-lpi2c'] is too long 'fsl,imx8dxl-lpi2c' is not one of ['fsl,imx7ulp-lpi2c'] 'fsl,imx7ulp-lpi2c' was expected from schema $id: http://devicetree.org/schemas/i2c/i2c-imx-lpi2c.yaml# Signed-off-by: Fabio Estevam Reviewed-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 4a1ec092d400e2dc041a9f7b259f2eddd158a767 Author: Fabio Estevam Date: Sat Sep 9 09:48:34 2023 -0300 arm64: dts: imx8x-colibri-iris-v2: Fix pinctrl node names Per fsl,scu-pinctrl.yaml, the pinctrl node names should end with 'grp'. Change them to fix the following schema warning: imx8qxp-colibri-iris-v2.dtb: pinctrl: 'enable_3v3_vmmc', 'lcd-lvds' do not match any of the regexes: 'grp$', 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/pinctrl/fsl,scu-pinctrl.yaml# Signed-off-by: Fabio Estevam Reviewed-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit b943126fd6b1039fa0a1437e5e46f925941e4088 Author: Fabio Estevam Date: Sat Sep 9 09:31:07 2023 -0300 arm64: dts: imx8dxl-ss-conn: Complete the FEC compatibles Use the full compatible list for the imx8dl FEC as per fsl,fec.yaml. This fixes the following schema warning: imx8dxl-evk.dtb: ethernet@5b040000: compatible: 'oneOf' conditional failed, one must be fixed: ['fsl,imx8qm-fec'] is too short 'fsl,imx8qm-fec' is not one of ['fsl,imx25-fec', 'fsl,imx27-fec', 'fsl,imx28-fec', 'fsl,imx6q-fec', 'fsl,mvf600-fec', 'fsl,s32v234-fec'] 'fsl,imx8qm-fec' is not one of ['fsl,imx53-fec', 'fsl,imx6sl-fec'] 'fsl,imx8qm-fec' is not one of ['fsl,imx35-fec', 'fsl,imx51-fec'] 'fsl,imx8qm-fec' is not one of ['fsl,imx6ul-fec', 'fsl,imx6sx-fec'] 'fsl,imx8qm-fec' is not one of ['fsl,imx7d-fec'] 'fsl,imx8mq-fec' was expected 'fsl,imx8qm-fec' is not one of ['fsl,imx8mm-fec', 'fsl,imx8mn-fec', 'fsl,imx8mp-fec', 'fsl,imx93-fec'] 'fsl,imx8qm-fec' is not one of ['fsl,imx8dxl-fec', 'fsl,imx8qxp-fec'] 'fsl,imx8qm-fec' is not one of ['fsl,imx8ulp-fec'] from schema $id: http://devicetree.org/schemas/net/fsl,fec.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit d3b127827e29d83afc163ffba3a560cd0d5143db Author: Fabio Estevam Date: Fri Sep 8 23:03:31 2023 -0300 arm64: dts: imx8m: Remove 'nand-on-flash-bbt' from nand controller The 'nand-on-flash-bbt' property is a property for the NAND device, not for the GPMI nand controller. Remove it to fix the following schema warnings: imx8mm-ddr4-evk.dtb: nand-controller@33002000: Unevaluated properties are not allowed ('nand-on-flash-bbt' was unexpected) from schema $id: http://devicetree.org/schemas/mtd/gpmi-nand.yaml# imx8mn-bsh-smm-s2.dtb: nand-controller@33002000: Unevaluated properties are not allowed ('nand-on-flash-bbt' was unexpected) from schema $id: http://devicetree.org/schemas/mtd/gpmi-nand.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 66fd9c5b01148c25c8583d4ef5d0ee6c97cf171e Author: Fabio Estevam Date: Fri Sep 8 22:35:47 2023 -0300 arm64: dts: imx8mp-debix-som-a-bmb: Fix EEPROM #size-cells The mac-address is passed as a subnode of the eeprom and its 'reg' property describe a range of addresses in the eeprom. Therefore, #size-cells should be set to 1 instead of 0. This fixes the following schema warnings: imx8mp-debix-som-a-bmb-08.dtb: eeprom@52: #size-cells:0:0: 1 was expected from schema $id: http://devicetree.org/schemas/eeprom/at24.yaml# imx8mp-debix-som-a-bmb-08.dtb: eeprom@52: mac-address@0:reg: [[0], [12]] is too long from schema $id: http://devicetree.org/schemas/eeprom/at24.yaml# imx8mp-debix-som-a-bmb-08.dtb: eeprom@52: mac-address@c:reg: [[12], [12]] is too long from schema $id: http://devicetree.org/schemas/eeprom/at24.yaml# imx8mp-debix-som-a-bmb-08.dtb: eeprom@52: Unevaluated properties are not allowed ('#address-cells', '#size-cells', 'mac-address@0', 'mac-address@c' were unexpected) from schema $id: http://devicetree.org/schemas/eeprom/at24.yaml# Signed-off-by: Fabio Estevam Reviewed-by: Marco Felsch Signed-off-by: Shawn Guo commit 6c32f75d67a8c1ea94295234db7c11a29c189e6f Author: Fabio Estevam Date: Fri Sep 8 13:47:35 2023 -0300 arm64: dts: imx8-ss-lsio: Add PWM interrupts The PWM interrupt is mandatory per imx-pwm.yaml. Add them. This also fixes the followig schema warning: imx8qm-apalis-v1.1-ixora-v1.2.dtb: pwm@5d000000: 'oneOf' conditional failed, one must be fixed: 'interrupts' is a required property 'interrupts-extended' is a required property from schema $id: http://devicetree.org/schemas/pwm/imx-pwm.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 51dd506ba6928c27f6d7f2f8711a697f647c4ee4 Author: Fabio Estevam Date: Sun Sep 24 15:43:20 2023 -0300 ARM: dts: imx53: Adjust the ecspi compatible Per fsl-imx-cspi.yaml, "fsl,imx53-ecspi" should not contain addtional compatible entries. Change it accordingly to fix the following schema warning: spi@63fac000: compatible: 'oneOf' conditional failed, one must be fixed: ['fsl,imx53-ecspi', 'fsl,imx51-ecspi'] is too long Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 70e5c3a2a8f4ed82bde734449e894cfab90d21ea Author: Fabio Estevam Date: Sat Sep 23 17:42:58 2023 -0300 dt-bindings: arm: fsl: Document the missing imx23 boards There are some imx23 based boards that are not documented. Add them to the list of supportted i.MX23 boards. Signed-off-by: Fabio Estevam Reviewed-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit 9a7912daf7a5d45524d0176ded6cc38a514c6259 Author: Fabio Estevam Date: Sat Sep 23 15:50:10 2023 -0300 ARM: dts: imx7ulp: Fix usbphy1 compatible Per fsl,mxs-usbphy.yaml, fsl,imx7ulp-usbphy is not compatible with fsl,imx6ul-usbphy. Remove 'fsl,imx6ul-usbphy' from the compatible string to fix the following schema warning: imx7ulp-com.dtb: usb-phy@40350000: compatible: 'oneOf' conditional failed, one must be fixed: ['fsl,imx7ulp-usbphy', 'fsl,imx6ul-usbphy'] is too long Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 185460f28b3c4431f33c11a914ad4e74ef11b351 Author: Fabio Estevam Date: Sat Sep 23 15:44:38 2023 -0300 ARM: dts: imx6q-pistachio: Use a valid value for fsl,tx-d-cal Passing 5 to fsl,tx-d-cal is not valid as per fsl,mxs-usbphy.yaml: imx6q-pistachio.dtb: usbphy@20c9000: fsl,tx-d-cal:0:0: 5 is less than the minimum of 79 from schema $id: http://devicetree.org/schemas/phy/fsl,mxs-usbphy.yaml# Pass the minimum value of 79 instead. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 589a17f677fac13670b95e4ad9bfa2cf65778a8b Author: Fabio Estevam Date: Sat Sep 23 15:44:37 2023 -0300 ARM: dts: imx6q-b650v3: Fix fsl,tx-cal-45-dn-ohms Passing 55 to fsl,tx-cal-45-dn-ohms is not valid as per fsl,mxs-usbphy.yaml: imx6q-b650v3.dtb: usbphy@20c9000: fsl,tx-cal-45-dn-ohms:0:0: 55 is greater than the maximum of 54 from schema $id: http://devicetree.org/schemas/phy/fsl,mxs-usbphy.yaml# Pass the maximum value of 54 instead. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 2c9d0bd685b3323333cbc790c6c1e02c2ba8dd26 Author: Fabio Estevam Date: Sat Sep 23 15:29:06 2023 -0300 ARM: dts: imx28-tx28: Move phy_type to USB node phy_type is a property for the USB controller, not for the USB PHY. Move it to the USB controller nodes to fix the following schema warning: imx28-tx28.dtb: usbphy@8007c000: 'phy_type' does not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/phy/fsl,mxs-usbphy.yaml Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 1970fc659410e7b8ba75c5dee7dac387a4d30adf Author: Fabio Estevam Date: Fri Sep 22 09:42:29 2023 -0300 ARM: dts: mxs: Switch to #pwm-cells = <3> mxs-pwm.yaml documents that #pwm-cells should be 3. This is correct as the last cell may indicate the PWM polarity. Convert all mxs devicetree files to using #pwm-cells = <3> for consistency. Signed-off-by: Fabio Estevam Reviewed-by: Uwe Kleine-König Signed-off-by: Shawn Guo commit a5b59a3f41bdeef5661fa44d96352ce62ecca5cc Author: James Hilliard Date: Sat Sep 23 22:47:57 2023 -0600 ARM: dts: imx6q: Add Variscite MX6 Custom board support This patch adds support for the Variscite MX6 SoM Carrier Board. This Carrier-Board has the following : - LVDS interface for the VLCD-CAP-GLD-LVDS 7" LCD 800 x 480 touch display - HDMI Connector - USB Host + USB OTG Connector - 10/100/1000 Mbps Ethernet - miniPCI-Express slot - SD Card connector - Audio Headphone/Line In jack connectors - S-ATA - On-board DMIC - RS485 Header - CAN bus header - SPI header - Camera Interfaces header - OnBoard RTC with Coin Backup battery socket - RS232 Debug Header (IDC10) - RS232 DTE Product Page : https://www.variscite.com/product/single-board-computers/var-mx6customboard The dts file based on the ones provided by Variscite on their own kernel, but adapted for mainline. Cc: Pierluigi Passaro Reviewed-by: Fabio Estevam Signed-off-by: Gregory CLEMENT Signed-off-by: James Hilliard Signed-off-by: Shawn Guo commit e5c810848d2a64e6ca7d30a49a8e1ef1a34af510 Author: James Hilliard Date: Sat Sep 23 22:47:56 2023 -0600 ARM: dts: imx6qdl: Add Variscite VAR-SOM-MX6 SoM support This patch adds support for the Variscite VAR_SOM-MX6 SoM with : - i.MX6 Quad or Dual Lite SoC - 256 – 4096 MB DDR3 - 4-64 GB eMMC - 128 – 1024 MB SLC NAND - Camera Interface - HDMI+CEC interface - LVDS / DSI / Parallel RGB interfaces - Ethernet RGMII interface - On-SoM Wi-Fi/Bluetooth with WiLink wl183x SDIO Module - SD/MMC/SDIO interface - USB Host + USB OTG interface - I2C interfaces - SPI interfaces - PCI-Express 2.0 interface - on-SoM Audio Codec with HP/Line-In interfaces + DMIC interface - Digital Audio interface - S/PDIF interface Product website : https://www.variscite.com/product/system-on-module-som/cortex-a9/var-som-mx6-cpu-freescale-imx6/ Support is handled with a SoM-centric dtsi exporting the default interfaces along the default pinmuxing to be enabled by the board dts file. This file is based on the one provided by Variscite on their own kernel, but adapted for mainline. Cc: Pierluigi Passaro Reviewed-by: Fabio Estevam Signed-off-by: Gregory CLEMENT Signed-off-by: James Hilliard Signed-off-by: Shawn Guo commit b136d55c142e10cfd152368f285598b21bf246e7 Author: Fabio Estevam Date: Thu Sep 21 11:17:42 2023 -0300 ARM: dts: mxs: Fix duart clock-names Per pl011.yaml, the first entry of clock-names should be "uartclk". Change it accordingly to fix the following schema warning: imx23-xfi3.dtb: serial@80070000: clock-names:0: 'uartclk' was expected The pl011 driver does not search for the clock name, so this change is safe and was tested on a imx28-evk board. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit b68fb6f0c8dad849ddd9f85b6ac6ea805a07d60d Author: James Hilliard Date: Sat Sep 23 22:47:55 2023 -0600 dt-bindings: arm: fsl: Add VAR-SOM-MX6 SoM with Custom Board Add support for Variscite i.MX6Q VAR-SOM-MX6 SoM with Custom Board. Cc: Pierluigi Passaro Acked-by: Krzysztof Kozlowski Acked-by: Conor Dooley Signed-off-by: James Hilliard Signed-off-by: Shawn Guo commit 09ecbb0ecc4abbaef20e108ceecfb0828a0b08ad Author: Fabio Estevam Date: Fri Sep 15 09:33:50 2023 -0300 ARM: dts: imx6ull/7d-colibri: Fix compatible Fix the imx6ull/7d-colibri devicetrees as per the rules defined at fsl.yaml. Signed-off-by: Fabio Estevam Reviewed-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 018df03936f601bb24f0e40b448c8252044b4a0d Author: Fabio Estevam Date: Thu Sep 14 16:40:27 2023 -0300 ARM: dts: imx6ull-phytec-tauri: Fix compatible Per fsl.yaml, the order of the compatible strings are not correct for imx6ull-phytec-tauri-emmc and imx6ull-phytec-tauri-nand. Fix them accordingly. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 7bb2a3618542f9f392a75713ee9b41cf92e1edd1 Author: Fabio Estevam Date: Thu Sep 14 16:40:26 2023 -0300 ARM: dts: imx6ull-phytec-tauri: Remove board model and compatible The imx6ull-phytec-tauri.dtsi file is included in two places: imx6ull-phytec-tauri-emmc.dts imx6ull-phytec-tauri-nand.dts These two files overwrite the board model and compatible locally, so there is no need for describing them in imx6ull-phytec-tauri.dtsi. Remove the board model and compatible. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit d29c60ab0dfe74fffd8a9cf6691fa7a8c28c8544 Author: Fabio Estevam Date: Wed Sep 13 10:36:48 2023 -0300 ARM: dts: imx7s: Fix CSI clocks Per nxp,imx7-csi.yaml, there is only one CSI clock entry. Fix it. This fixes the following schema warnings: imx7d-zii-rpu2.dtb: csi@30710000: clocks: [[1, 413], [1, 326], [1, 413]] is too long from schema $id: http://devicetree.org/schemas/media/nxp,imx7-csi.yaml# imx7d-zii-rpu2.dtb: csi@30710000: clock-names:0: 'mclk' was expected from schema $id: http://devicetree.org/schemas/media/nxp,imx7-csi.yaml# imx7d-zii-rpu2.dtb: csi@30710000: clock-names: ['axi', 'mclk', 'dcic'] is too long from schema $id: http://devicetree.org/schemas/media/nxp,imx7-csi.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 87d64a54e01248402048af5fe39962148d732a0c Author: Fabio Estevam Date: Tue Sep 12 18:38:37 2023 -0300 ARM: dts: imx51-zii-rdu1: Use preferred i2c-gpios properties The 'gpios' property to describe the SDA and SCL GPIOs is considered deprecated according to i2c-gpio.yaml. Switch to the preferred 'sda-gpios' and 'scl-gpios' properties. This fixes the following schema warnings: imx51-zii-rdu1.dtb: i2c-gpio: 'sda-gpios' is a required property from schema $id: http://devicetree.org/schemas/i2c/i2c-gpio.yaml# imx51-zii-rdu1.dtb: i2c-gpio: 'scl-gpios' is a required property from schema $id: http://devicetree.org/schemas/i2c/i2c-gpio.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit cd53859961b8db5f205fe76a077fe6278613e872 Author: Fabio Estevam Date: Tue Sep 12 18:38:36 2023 -0300 ARM: dts: imx6ul-tx6ul: Use preferred i2c-gpios properties The 'gpios' property to describe the SDA and SCL GPIOs is considered deprecated according to i2c-gpio.yaml. Switch to the preferred 'sda-gpios' and 'scl-gpios' properties. This fixes the following schema warnings: imx6ul-tx6ul-0011.dtb: i2c-gpio: 'sda-gpios' is a required property from schema $id: http://devicetree.org/schemas/i2c/i2c-gpio.yaml# imx6ul-tx6ul-0011.dtb: i2c-gpio: 'scl-gpios' is a required property from schema $id: http://devicetree.org/schemas/i2c/i2c-gpio.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 1aa8df90f4569acd36d2c94a9cfe1eee561575d6 Author: Kees Cook Date: Fri Sep 22 10:51:47 2023 -0700 platform/chrome: wilco_ec: Annotate struct ec_event_queue with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ec_event_queue. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Benson Leung Cc: Tzung-Bi Shih Cc: Dawei Li Cc: Dmitry Torokhov Cc: Maximilian Luz Cc: "Uwe Kleine-König" Cc: Greg Kroah-Hartman Cc: Jiang Jian Cc: chrome-platform@lists.linux.dev Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922175146.work.219-kees@kernel.org Signed-off-by: Tzung-Bi Shih commit 40786789e445157b7d01419424f87240d64f5656 Author: Fabio Estevam Date: Thu Sep 7 22:51:30 2023 -0300 arm64: dts: imx8mq-librem5: Remove invalid charger properties Per bq25890.yaml, 'phys', 'ti,use-vinmin-threshold', 'ti,vinmin-threshold' are not valid properties. Remove them to fix the following schema warning: imx8mq-librem5-r2.dtb: charger@6a: Unevaluated properties are not allowed ('phys', 'ti,use-vinmin-threshold', 'ti,vinmin-threshold' were unexpected) from schema $id: http://devicetree.org/schemas/power/supply/bq25890.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 15f8cfe7627a8ca11cf9e53836f1abc14fd1fb49 Author: Fabio Estevam Date: Thu Sep 7 22:44:29 2023 -0300 arm64: dts: imx8-apalis-v1.1: Remove invalid GPIO properties Per fsl-imx-gpio.yaml, 'pad-wakeup' and 'pad-wakeup-num' are not valid properties/ Remove them to fix the following schema warning: imx8qm-apalis-ixora-v1.1.dtb: gpio@5d0a0000: 'pad-wakeup', 'pad-wakeup-num' do not match any of the regexes: '^(hog-[0-9]+|.+-hog(-[0-9]+)?)$', 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/gpio/fsl-imx-gpio.yaml# Signed-off-by: Fabio Estevam Reviewed-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 32bf91783d6013a32564795c355fcb023492bd8e Author: Fabio Estevam Date: Thu Sep 7 22:44:28 2023 -0300 arm64: dts: imx8-apalis-ixora: Remove invalid ngpios property Per fsl-imx-gpio.yaml, 'ngpios' is not a valid property. Remove it to fix the following schema warning: imx8qm-apalis-v1.1-ixora-v1.2.dtb: gpio@5d0d0000: 'ngpios' does not match any of the regexes: '^(hog-[0-9]+|.+-hog(-[0-9]+)?)$', 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/gpio/fsl-imx-gpio.yaml# Signed-off-by: Fabio Estevam Reviewed-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit 0a09ba38ed2a381f59dd04740a7e86b101b98a7f Author: Fabio Estevam Date: Thu Sep 7 22:33:18 2023 -0300 arm64: dts: imx8mq-zii-ultra: Fix mdio node name Per mdio-gpio.yaml, the node name should be 'mdio'. Change it accordingly to fix the following schema warning: imx8mq-zii-ultra-zest.dtb: bitbang-mdio: $nodename:0: 'bitbang-mdio' does not match '^mdio(@.*)?' from schema $id: http://devicetree.org/schemas/net/mdio-gpio.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit e7c1101c95c284154eadf57a99059ccc1a10c345 Author: Fabio Estevam Date: Thu Sep 7 22:27:39 2023 -0300 arm64: dts: imx8mq-nitrogen: Fix PCA9546 I2C subnodes Per i2c-mux-pca954x.yaml, the PCA9546 I2C subnodes should be in the 'i2c@' format. Change it accordingly to fix the following schema warning: imx8mm-nitrogen-r2.dtb: i2c-mux@70: Unevaluated properties are not allowed ('i2c3@0' was unexpected) Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit b61c090b967148f1a0356657b1035d511df73a41 Author: Fabio Estevam Date: Thu Sep 7 19:58:07 2023 -0300 ARM: dts: imx6qdl-gw591: Remove lis2de12 interrupt-names According to st,st-sensors.yaml, the 'interrupt-names' property is not a valid one. Remove it to fix the following schema warnings: imx6dl-gw5912.dtb: accel@19: 'interrupt-names' does not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/iio/st,st-sensors.yaml# Signed-off-by: Fabio Estevam Acked-by: Tim Harvey Signed-off-by: Shawn Guo commit 7b2a19c8045aa6b6c9674e392a8fc1a622cc7d3a Author: Fabio Estevam Date: Thu Sep 7 16:12:37 2023 -0300 arm64: dts: imx8mm/p-venice: Remove lis2de12 interrupt-names According to st,st-sensors.yaml, the 'interrupt-names' property is not a valid one. Remove it to fix the following schema warnings: imx8mp-venice-gw73xx-2x.dtb: accelerometer@19: 'interrupt-names' does not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/iio/st,st-sensors.yaml# Signed-off-by: Fabio Estevam Acked-by: Tim Harvey Signed-off-by: Shawn Guo commit 43211f6232f70bbf4abfe64c7b8c480e5934f6fe Author: Fabio Estevam Date: Thu Sep 7 14:20:52 2023 -0300 arm64: dts: imx8ulp: Fix the SPI clock-names order spi-nxp-fspi.yaml expects the clock-names entries to be in the following order: "fspi_en", "fspi". Change it accordingly to fix the following schema warnings: imx8ulp-evk.dtb: spi@29810000: clock-names:0: 'fspi_en' was expected from schema $id: http://devicetree.org/schemas/spi/spi-nxp-fspi.yaml# imx8ulp-evk.dtb: spi@29810000: clock-names:1: 'fspi' was expected from schema $id: http://devicetree.org/schemas/spi/spi-nxp-fspi.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 97be373594c30f5c180890bf0e939072553307ea Author: Fabio Estevam Date: Thu Sep 7 14:20:51 2023 -0300 arm64: dts: imx8dxl-evk: Remove invalid spi property nxp,fspi-dll-slvdly is not documented nor used anywhere. Drop this invalid property. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 2b0082a51c9b70667289447626baaee81cc85c7e Author: Fabio Estevam Date: Thu Sep 7 12:20:08 2023 -0300 arm64: dts: imx8dxl-ss-conn: Move conn_enet0_root_clk outside of soc The conn_enet0_root_clk node does not have any register associated with it, so it should be moved outside of soc to fix schema warning from simple-bus.yaml. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit e4b4830d3ed7ec543122307e4eb26a3437a76f54 Author: Fabio Estevam Date: Thu Sep 7 12:20:07 2023 -0300 arm64: dts: imx8-ss-audio: Move audio_ipg_clk outside of soc The audio_ipg_clk node does not have any register associated with it, so it should be moved outside of soc to fix schema warning from simple-bus.yaml. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit e88dd5c08d4ed3d7c852296a3959c0ad8cce7efc Author: Fabio Estevam Date: Thu Sep 7 12:20:06 2023 -0300 arm64: dts: imx8-ss-img: Move img_ipg_clk outside of soc The img_ipg_clk node does not have any register associated with it, so it should be moved outside of soc to fix schema warning from simple-bus.yaml. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit efee26c76268610614a2814d8e0746f2d2088555 Author: Fabio Estevam Date: Thu Sep 7 12:20:05 2023 -0300 arm64: dts: imx8-ss-conn: Move conn clocks outside of soc The conn clock nodes do not have any register associated with it, so they should be moved outside of soc to fix schema warning from simple-bus.yaml. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 9a69f7688e2e0fce198f99856668053b44df7837 Author: Fabio Estevam Date: Thu Sep 7 12:20:04 2023 -0300 arm64: dts: imx8-ss-dma: Move dma_ipg_clk outside of soc The dma_ipg_clk node does not have any register associated with it, so it should be moved outside of soc to fix schema warning from simple-bus.yaml. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 74bf3eab65bad6d2447bc35b8bc7b1fcf8bdafb7 Author: Fabio Estevam Date: Thu Sep 7 12:20:03 2023 -0300 arm64: dts: imx8-ss-lsio: Move lsio_bus_clk outside of soc The lsio_bus_clk node does not have any register associated with it, so it should be moved outside of soc to fix schema warning from simple-bus.yaml. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 2c387d6963ef3f05eb355b58af83d8c9e34bd48d Author: Fabio Estevam Date: Thu Sep 7 12:20:02 2023 -0300 arm64: dts: imx8-ss-lsio: Remove unused clock The lsio_mem_clk is not used anywhere, so simply remove it. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 2ab94dfc885a9861f88ad35f10a2798c61a87b74 Author: Fabio Estevam Date: Wed Sep 6 08:54:44 2023 -0300 arm64: dts: imx8mq: Move funnel outside from soc The 'funnel' node does not contain a register range, so it should be placed outside of the soc node to fix schema warnings from simple-bus.yaml. Signed-off-by: Fabio Estevam Acked-by: Alexander Stein Signed-off-by: Shawn Guo commit 9cfe3c892b76115cd7d28a377402e9376cb84769 Author: Fabio Estevam Date: Wed Sep 6 08:54:43 2023 -0300 arm64: dts: imx8mp: Move funnel outside from soc The 'funnel' node does not contain a register range, so it should be placed outside of the soc node to fix schema warnings from simple-bus.yaml. Signed-off-by: Fabio Estevam Acked-by: Alexander Stein Signed-off-by: Shawn Guo commit 4a58fcdb18187fee3d88bedaa5989dccb9aa963d Author: Teresa Remmet Date: Wed Sep 6 12:08:57 2023 +0200 arm64: dts: imx8mp-phyboard-pollux: Add support for RS232/RS485 Add UART2 for RS232/RS485 support. Signed-off-by: Teresa Remmet (Updated the node by not setting the reserved bits(BIT 0 and BIT 3) and enabled internal pullup for RX and TX.) Signed-off-by: Yashwanth Varakala Signed-off-by: Cem Tenruh Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 3bd7fdcc359eb3cd96ce8f49965b30f321979c32 Author: Cem Tenruh Date: Wed Sep 6 12:08:56 2023 +0200 arm64: dts: imx8mp-phyboard-pollux: Add gpio-line-names Add gpio-line-names to the imx8mp-phyboard-pollux devicetree. Signed-off-by: Cem Tenruh Signed-off-by: Shawn Guo commit 596f0a692be3cfbc74bb27706b0f45fdaf022857 Author: Cem Tenruh Date: Wed Sep 6 12:08:55 2023 +0200 arm64: dts: imx8mp-phycore-som: Add gpio-line-names Add gpio-line-names to the imx8mp-phycore-som devicetree. Signed-off-by: Cem Tenruh Signed-off-by: Shawn Guo commit f5faa633daf83efa30c9a780a51e39e8f92e12d7 Author: Teresa Remmet Date: Wed Sep 6 12:08:54 2023 +0200 arm64: dts: imx8mp-phyboard-pollux: Enable USB support Enable USB support for both interfaces in host mode. USB1 is directly conncted to a type-A connector and USB2 is attached to a 4-Port USB Hub. Signed-off-by: Teresa Remmet Signed-off-by: Cem Tenruh Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 27c0dc128d041a89d73ff0dd6a59b587ee85f90f Author: Teresa Remmet Date: Wed Sep 6 12:08:53 2023 +0200 arm64: dts: imx8mp-phyboard-pollux: Add flexcan support Add flexcan1 and flexcan2 support for CAN FD on phyBOARD-Pollux. Signed-off-by: Teresa Remmet Signed-off-by: Cem Tenruh Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 3baf264bcdcd8c498807c65bf7bd271f399e6ea9 Author: Marek Vasut Date: Thu Aug 31 21:55:09 2023 +0200 arm64: dts: imx8mp: Simplify USB C on DH i.MX8M Plus DHCOM PDK3 Remove the connector as well as all the links and only connect the PTN5150 with xHCI controller. This is sufficient to implement the role switching. Furthermore, this makes resume work without hanging. Without this patch, the platform would hang on resume of 'connector'. Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit ff7a65492c4c88010491ca0995a7e072d2c01879 Author: Alejandro Colomar Date: Tue Aug 29 20:51:22 2023 +0200 elf, uapi: Remove struct tag 'dynamic' Such a generic struct tag shouldn't have been exposed in a public header. Since it's undocumented, we can assume it's a historical accident. And since no software (at least on Debian) relies on this tag, we can safely remove it. Here are the results of a Debian Code Search[1]: $ # packages that contain 'include [<"]linux/elf\.h[">]' $ curl -s https://codesearch.debian.net/results/e5e7c74dfcdae609/packages.txt > include $ # packages that contain '\bstruct dynamic\b' $ curl -s https://codesearch.debian.net/results/b23577e099048c6a/packages.txt > struct $ cat struct include | sort | uniq -d chromium hurd linux qemu qt6-webengine qtwebengine-opensource-src $ # chromium: Seems to hold a copy of the UAPI header. No uses of the tag. $ # hurd: Same thing as chromium. $ # linux: :) $ # qemu: Same thing as chromium. $ # qt6-webengine: Same thing as all. $ # qtwebengine-opensource-src: Yet another copy. Link: https://codesearch.debian.net/ [1] Link: https://lore.kernel.org/linux-mm/87wmxdokum.fsf@email.froward.int.ebiederm.org/T/ Cc: "Eric W. Biederman" Cc: Matthew Wilcox Cc: David Howells Cc: Rolf Eike Beer Cc: Arnd Bergmann Cc: Thomas Gleixner Cc: "Paul E. McKenney" Cc: Dave Jones Signed-off-by: Alejandro Colomar Signed-off-by: Kees Cook commit 5c6d04e481975263327f5d928caf44c729ec1465 Author: Adam Ford Date: Wed Aug 30 23:44:30 2023 -0500 arm64: dts: imx8mp: Add micfil node The i.MX8MP has a micfil controller which is used for interfacing with a pulse density microphone. Add the node and mark it as disabled by default. Signed-off-by: Adam Ford Signed-off-by: Shawn Guo commit 37e7b41820b745b9e86e25a735a19d7eddf1da02 Author: Adam Ford Date: Wed Aug 30 23:44:29 2023 -0500 arm64: dts: imx8mp: Add easrc node The i.MX8MP has an asynchronous sample rate converter which seems to be the same as what is available on the i.MX8M Nano. Signed-off-by: Adam Ford Signed-off-by: Shawn Guo commit 567f38317054e66647fd59cfa4e261219a2a21db Author: Tim Harvey Date: Mon Aug 28 12:27:41 2023 -0700 arm64: dts: freescale: imx8m*-venice: remove label = "cpu" from DSA dt-binding This is not used by the DSA dt-binding, so remove it from the devicetrees. Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo commit 2af439120257583191ba20c0d055054447b01271 Author: Tim Harvey Date: Mon Aug 28 12:26:15 2023 -0700 ARM: dts: imx6qdl-gw5904: add internal mdio nodes Complete the switch definition by adding the internal mdio nodes. This does not change behavior on Linux but is required if the dt is used for U-Boot which requires the internal PHY ports to be defined for DSA. Signed-off-by: Tim Harvey Reviewed-by: Vladimir Oltean Signed-off-by: Shawn Guo commit 8c17cec6347d9e0ab2c6005bd1804067e12ca4e0 Author: Dmitry Baryshkov Date: Sun Aug 27 00:54:29 2023 +0300 ARM: dts: imx: add support for the ATM0700D4 panel attached to sk-imx53 The SK-ATM0700D4-Plug is an extension board (provided by the same manufacturer, [1]) which can be connected to the SK-IMX53 panel kit. The panel can be connected either using the RGB parallel bus or using the LVDS connector (recommended). Add DT files describing this "shield", both RGB and LVDS connections. [1] http://starterkit.ru/html/index.php?name=shop&op=view&id=64 Signed-off-by: Dmitry Baryshkov Signed-off-by: Shawn Guo commit ccd58dad0b4831d4229380ca5b0c0b891e219d66 Author: Frank Li Date: Thu Aug 24 12:57:53 2023 -0400 arm64: dts: imx93-evk: add uart5 Enable uart5 for imx93-evk board. Signed-off-by: Frank Li Signed-off-by: Shawn Guo commit c7c4825bbe22121f9a3633f2b6ee350beae29d67 Author: Frank Li Date: Thu Aug 24 12:57:52 2023 -0400 arm64: dts: imx93: add dma support for lpuart[1..8] Add dma support for lpuart[1..8]. Signed-off-by: Frank Li Signed-off-by: Shawn Guo commit d34d2aa594d00a7311e2a56d26e4c17352867191 Author: Frank Li Date: Thu Aug 24 12:57:51 2023 -0400 arm64: dts: imx93: add edma1 and edma2 Add edma nodes. Signed-off-by: Frank Li Signed-off-by: Shawn Guo commit 5cd602fca7ae95be810d21c3ea385de810027e20 Author: Alexander Stein Date: Tue Aug 22 14:08:03 2023 +0200 arm64: dts: imx8mq-tqma8mq-mba8mx: Add LVDS overlay This overlay enables the DSI-LVDS display chain and configures the actual panel compatible. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 21ff74b8ff2c703b974f7b76c2029eec20d30145 Author: Alexander Stein Date: Tue Aug 22 14:08:02 2023 +0200 arm64: dts: imx8mn-tqma8mqnl-mba8mx: Add LVDS overlay This overlay enables the DSI-LVDS display chain and configures the actual panel compatible. Also add the DSIM supply voltages. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 6975bc28bff9161f0fc8a0a84ea063c71822090c Author: Alexander Stein Date: Tue Aug 22 14:08:01 2023 +0200 arm64: dts: imx8mm-tqma8mqml-mba8mx: Add LVDS overlay This overlay enables the DSI-LVDS display chain and configures the actual panel compatible. Also add the DSIM supply voltages. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit c03bff9777df21495813823389f8097356abe99f Author: Alexander Stein Date: Tue Aug 22 14:08:00 2023 +0200 arm64: dts: mba8mx: Add DSI-LVDS bridge nodes This adds the DSI-LVDS bridge including the regulator, backlight and an unspecified panel. It is expected to set the compatible when the display chain is enabled. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit b9b99cef37b2b04165550bda949f702ae5ab1afc Author: Fabio Estevam Date: Tue Sep 5 11:28:35 2023 -0300 arm64: dts: imx8qm-apalis: Remove invalid FEC property The 'fsl,rgmii_txc_dly' is not a valid property. Remove it to fix the following schema warning: imx8qm-apalis-ixora-v1.1.dtb: ethernet@5b040000: Unevaluated properties are not allowed ('fsl,rgmii_txc_dly' was unexpected) from schema $id: http://devicetree.org/schemas/net/fsl,fec.yaml# Signed-off-by: Fabio Estevam Reviewed-by: Marcel Ziswiler Signed-off-by: Shawn Guo commit b98f0bee1948249c45bccc53c3385fd79f045594 Author: Fabio Estevam Date: Tue Sep 5 11:15:46 2023 -0300 arm64: dts: imx8mq-thor96: Fix sdio-pwrseq GPIO property As per mmc-pwrseq-simple.yaml, the correct way to describe the GPIO is by using the 'reset-gpios' property. Change it accordingly to fix the following schema warning: imx8mq-thor96.dtb: sdio-pwrseq: 'gpio' does not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/mmc/mmc-pwrseq-simple.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit fc03e8195d0054f0fc6196bc9562c13578f45c13 Author: Fabio Estevam Date: Tue Sep 5 11:08:04 2023 -0300 arm64: dts: imx8mq-pico-pi: Fix PMIC properties Pass the required '#clock-cells' property and remove the invalid 'interrupt-names' property to fix the following schema warnings: imx8mq-pico-pi.dtb: pmic@4b: '#clock-cells' is a required property from schema $id: http://devicetree.org/schemas/mfd/rohm,bd71837-pmic.yaml# imx8mq-pico-pi.dtb: pmic@4b: 'interrupt-names' does not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/mfd/rohm,bd71837-pmic.yaml# Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 53f7d469de23eec66b09f4b4e9ae5d8303421430 Author: Fabio Estevam Date: Mon Sep 4 21:23:03 2023 -0300 arm64: dts: imx8mq-librem5: Fix gpio-hog property The 'lane-mapping' property is not a valid one and cause the following schema warning: imx8mq-librem5-r2.dtb: pmic-5v-hog: 'lane-mapping' does not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/gpio/gpio-hog.yaml# Replace it with 'line-name'. Signed-off-by: Fabio Estevam Reviewed-by: Guido Günther Signed-off-by: Shawn Guo commit 929dcf7dce56ea03795b7293975687d252c29215 Author: Marek Vasut Date: Tue Aug 22 02:50:07 2023 +0200 arm64: dts: imx8mp: Switch PCIe to HSIO PLL on i.MX8MP DHCOM PDK2 and generate clock from SoC The PDK2 carrier board had to be manually patched to obtain working PCIe with the i.MX8MP DHCOM SoM so far, because the PCIe clock generator has not been connected to the PCIe block REF_PAD_CLK inputs. Switch to use of HSIO PLL as the clock source for the PCIe block instead, and use the REF_PAD_CLK as outputs to generate PCIe clock from the SoC. This way, it is not necessary to patch the PDK2 in any way to obtain a working PCIe. Note that PDK3 has PCIe clock generator always connected to REF_PAD_CLK and is not affected. Signed-off-by: Marek Vasut Signed-off-by: Shawn Guo commit 5e7de0aafcf22d903c0f89fec191b4ddc7099f4f Author: Fabio Estevam Date: Mon Aug 14 08:39:17 2023 -0300 arm64: dts: imx8dxl-evk: Remove invalid SPI property 'pinctrl-assert-gpios' is not a valid property. Remove it to fix the following schema warning: imx8dxl-evk.dtb: spi@5a030000: Unevaluated properties are not allowed ('pinctrl-assert-gpios' was unexpected) Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit eb2350fd60b7f8f3be736d82ecafa9dcec1b340f Author: Fabio Estevam Date: Fri Aug 11 09:14:16 2023 -0300 arm64: dts: imx8mm-phg: Disable flexspi The imx8mm-tqma8mqml SoM used on the PHG board does not come with the QSPI flash populated, so disable it to avoid the following error message: spi-nor spi3.0: unrecognized JEDEC id bytes: 00 00 00 00 00 00 Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 7d7f27be8f67b7b2b3fbf373b7931c4acec284a5 Author: Tim Harvey Date: Tue Jul 11 15:15:18 2023 -0700 arm64: dts: imx8mp: add imx8mp-venice-gw74xx-imx219 overlay for rpi v2 camera Add support for the RaspberryPi Camera v2 which is an IMX219 8MP module: - https://datasheets.raspberrypi.com/camera/camera-v2-schematics.pdf - has its own on-board 24MHz osc so no clock required from baseboard - pin 11 enables 1.8V and 2.8V LDO which is connected to GW74xx MIPI_GPIO4 (IMX8MP GPIO1_IO4) so we use this as a gpio Support is added via a device-tree overlay. The IMX219 supports RAW8/RAW10 image formats. Example configuration: media-ctl -l "'imx219 3-0010':0->'csis-32e40000.csi':0[1]" media-ctl -v -V "'imx219 3-0010':0 [fmt:SRGGB8/640x480 field:none]" media-ctl -v -V "'crossbar':0 [fmt:SRGGB8/640x480 field:none]" media-ctl -v -V "'mxc_isi.0':0 [fmt:SRGGB8/640x480 field:none]" v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=RGGB v4l2-ctl --stream-mmap --stream-to=frame.raw --stream-count=1 convert -size 640x480 -depth 8 gray:frame.raw frame.png gst-launch-1.0 v4l2src ! \ video/x-bayer,format=rggb,width=640,height=480,framerate=10/1 ! \ bayer2rgb ! fbdevsink Signed-off-by: Tim Harvey Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 5943de495b6d054f36c0f5feec20570964bd1dd7 Author: Ming Qian Date: Thu Jun 1 10:38:01 2023 +0800 arm64: dts: imx8-ss-img: Assign slot for imx jpeg encoder/decoder assign a single slot, configure interrupt and power domain only for 1 slot, not for the all 4 slots. Signed-off-by: Ming Qian Signed-off-by: Shawn Guo commit f5f1783784193feee847071ce1443545b53da3d4 Author: Alexander Stein Date: Tue Aug 22 14:08:04 2023 +0200 arm64: defconfig: Enable Samsung DSIM driver This driver, together with GPIO delay, is required for TQMa8MxML based boards to use LVDS output. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 43ee22422db545800b8bf2c24ef53d040372fc7a Author: Harshit Mogalapalli Date: Sat Sep 23 04:48:06 2023 -0700 power: supply: mm8013: Fix error code in mm8013_probe() The value of ret is zero when passed to dev_error_probe(), we are passing zero to dev_err_probe() is a success which is incorrect. Fix this by getting the error code using PTR_ERR(). Fixes: c75f4bf6800b ("power: supply: Introduce MM8013 fuel gauge driver") Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202309190838.eu8WS6sz-lkp@intel.com/ Signed-off-by: Harshit Mogalapalli Link: https://lore.kernel.org/r/20230923114807.2829188-1-harshit.m.mogalapalli@oracle.com Signed-off-by: Sebastian Reichel commit 3a133a4e44554bb7af114f231db2f30f447417cc Author: Kees Cook Date: Fri Sep 22 10:54:25 2023 -0700 i2c: Annotate struct i2c_atr with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct i2c_atr. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Wolfram Sang commit 86f8a1ef96819d2ae62eaf3d89a0f0404348daa3 Author: Kees Cook Date: Fri Sep 22 10:49:59 2023 -0700 i2c: mux: demux-pinctrl: Annotate struct i2c_demux_pinctrl_priv with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct i2c_demux_pinctrl_priv. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva [wsa: improved blank lines] Signed-off-by: Wolfram Sang commit b3eaec0789d87b4d6c01decf8a1f93f873619475 Author: Inochi Amaoto Date: Mon Aug 28 12:30:22 2023 +0800 riscv: dts: allwinner: d1: Add PMU event node D1 has several pmu events supported by opensbi. These events can be used by perf for profiling. Signed-off-by: Inochi Amaoto Link: https://dl.linux-sunxi.org/D1/Xuantie_C906_R1S0_User_Manual.pdf Link: https://github.com/T-head-Semi/openc906/blob/main/C906_RTL_FACTORY/gen_rtl/pmu/rtl/aq_hpcp_top.v#L657 Reviewed-by: Guo Ren Acked-by: Jernej Skrabec Acked-by: Conor Dooley Link: https://lore.kernel.org/r/IA1PR20MB49534918FCA69399CE2E0C53BBE0A@IA1PR20MB4953.namprd20.prod.outlook.com Signed-off-by: Jernej Skrabec commit d3a3d6a38e6d8b9446230bbf34b1991d78560e32 Author: Martin Botka Date: Tue Sep 12 13:20:50 2023 +0200 arm64: dts: allwinner: h616: Add BigTreeTech Pi support The BigTreeTech Pi is an H616 based board based on CB1. Just in Rpi format board. It features the same internals as BTT CB1 but adds: - Fan port - IR receiver - ADXL345 Accelerometer connector via SPI - 24V DC power supply via terminal plugs - USB to CAN module connector (External Module) List of currently working things is same as BTT CB1 but also: - IR receiver - ADXL345 connector Signed-off-by: Martin Botka Reviewed-by: Andre Przywara Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230912-b4-cb1-v6-4-bb11238f3a9c@somainline.org Signed-off-by: Jernej Skrabec commit 2e33101f1db456d927012174a6d8c6fde8570247 Author: Martin Botka Date: Tue Sep 12 13:20:49 2023 +0200 arm64: dts: allwinner: h616: Add BigTreeTech CB1 SoM & boards support CB1 is Compute Module style board that plugs into Rpi board style adapter or Manta 3D printer boards (M4P/M8P). The SoM features: - H616 SoC - 1GiB of RAM - AXP313A PMIC - RTL8189FTV WiFi Boards feature: - 4x USB via USB2 hub (usb1 on SoM). - SDcard slot for loading images. - Ethernet port wired to the internal PHY. (100M) - 2x HDMI 2.0. (Only 1 usable on CB1) - Power and Status LEDs. (Only Status LED usable on CB1) - 40 pin GPIO header Currently working: - Booting - USB - UART - MMC - Status LED - WiFi (RTL8189FS via out of tree driver) I didnt want to duplicate things so the manta DTS can also be used on BTT pi4b adapter. CB1 SoM has its own DTSI file in case other boards shows up that accept this SoM. Signed-off-by: Martin Botka Reviewed-by: Andre Przywara Reviewed-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230912-b4-cb1-v6-3-bb11238f3a9c@somainline.org Signed-off-by: Jernej Skrabec commit 2845d77ab354c691723bf96aaf6ca41368632411 Author: Martin Botka Date: Tue Sep 12 13:20:48 2023 +0200 dt-bindings: arm: sunxi: Add BigTreeTech boards Add name & compatible for BigTreeTech Manta boards and BigTreeTech Pi Signed-off-by: Martin Botka Reviewed-by: Krzysztof Kozlowski Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230912-b4-cb1-v6-2-bb11238f3a9c@somainline.org Signed-off-by: Jernej Skrabec commit 1f5219781c7faafbf7fb6ad7bcaa0d1f33d07b9a Author: Martin Botka Date: Tue Sep 12 13:20:47 2023 +0200 dt-bindings: vendor-prefixes: Add BigTreeTech BigTreeTech is a company based in Shenzhen that makes 3D printers and accessories. Add prefix for it. Signed-off-by: Martin Botka Reviewed-by: Andre Przywara Reviewed-by: Krzysztof Kozlowski Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230912-b4-cb1-v6-1-bb11238f3a9c@somainline.org Signed-off-by: Jernej Skrabec commit 951992797378a2177946400438f4d23c9fceae5b Author: Martin Botka Date: Tue Sep 12 14:25:13 2023 +0200 arm64: dts: allwinner: h616: Add SID controller node Add node for the H616 SID controller Signed-off-by: Martin Botka Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230912-sid-h616-v3-2-ee18e1c5bbb5@somainline.org Signed-off-by: Jernej Skrabec commit 8081fb2465a1dcbb6c7b23d724c83bbfa645722a Author: Martin Botka Date: Tue Sep 12 14:25:12 2023 +0200 dt-bindings: nvmem: SID: Add binding for H616 SID controller Add binding for the SID controller found in H616 SoC Signed-off-by: Martin Botka Acked-by: Conor Dooley Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230912-sid-h616-v3-1-ee18e1c5bbb5@somainline.org Signed-off-by: Jernej Skrabec commit 267860b10c67dd396c73a9e6e8103670d78a4c01 Author: Conor Dooley Date: Sat Sep 16 10:14:00 2023 +0100 riscv: dts: allwinner: remove address-cells from intc node A recent submission [1] from Rob has added additionalProperties: false to the interrupt-controller child node of RISC-V cpus, highlighting that the D1 DT has been incorrectly using #address-cells since its introduction. It has no child nodes, so #address-cells is not needed. Remove it. Fixes: 077e5f4f5528 ("riscv: dts: allwinner: Add the D1/D1s SoC devicetree") Link: https://patchwork.kernel.org/project/linux-riscv/patch/20230915201946.4184468-1-robh@kernel.org/ [1] Signed-off-by: Conor Dooley Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230916-saddling-dastardly-8cf6d1263c24@spud Signed-off-by: Jernej Skrabec commit 062b9b661f42e76eb6e4b8328f1121cba61a447e Author: Krzysztof Kozlowski Date: Wed Aug 23 10:52:38 2023 +0200 riscv: dts: use capital "OR" for multiple licenses in SPDX Documentation/process/license-rules.rst and checkpatch expect the SPDX identifier syntax for multiple licenses to use capital "OR". Correct it to keep consistent format and avoid copy-paste issues. Signed-off-by: Krzysztof Kozlowski Acked-by: Jernej Skrabec Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230823085238.113642-1-krzysztof.kozlowski@linaro.org Signed-off-by: Jernej Skrabec commit 12ca3ca8cf06d803b3690ef523ccf5ffd0b23a71 Author: Krzysztof Kozlowski Date: Sun Jul 2 20:53:01 2023 +0200 arm64: dts: marvell: minor whitespace cleanup around '=' The DTS code coding style expects exactly one space before and after '=' sign. Link: https://lore.kernel.org/r/20230702185301.44505-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit aee69e4538e137313831bdb05512686d4f950378 Author: Krzysztof Kozlowski Date: Sun Jul 2 20:51:27 2023 +0200 arm64: dts: mediatek: minor whitespace cleanup around '=' The DTS code coding style expects exactly one space before and after '=' sign. Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230702185128.44052-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 73f20a373811b303fc5bd8f3d5a4c5c1582f1ba2 Author: Krzysztof Kozlowski Date: Wed Jul 5 17:00:45 2023 +0200 ARM: dts: nuvoton: add missing space before { Add missing whitespace between node name/label and opening {. Link: https://lore.kernel.org/r/20230705150045.293879-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 96ba96612d85766b20d2e3e4445c96875351eb7b Author: Krzysztof Kozlowski Date: Sun Jul 2 20:51:28 2023 +0200 ARM: dts: mediatek: minor whitespace cleanup around '=' The DTS code coding style expects exactly one space before and after '=' sign. Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230702185128.44052-2-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit a9c740c57f977deb41bc53c02d0dae3d0e2f191a Author: Krzysztof Kozlowski Date: Wed Jul 5 17:00:06 2023 +0200 arm64: dts: mediatek: add missing space before { Add missing whitespace between node name/label and opening {. Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230705150006.293690-2-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit f673ab0ceb8dc8ccd291db9bbc200dbd8cd399f4 Author: Krzysztof Kozlowski Date: Wed Jul 5 17:00:05 2023 +0200 ARM: dts: mediatek: add missing space before { Add missing whitespace between node name/label and opening {. Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230705150006.293690-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 05521ef09891dfd0e0dbc0b37fcca0f15174e60e Author: Krzysztof Kozlowski Date: Wed Jul 5 16:59:34 2023 +0200 arm64: dts: apm: add missing space before { Add missing whitespace between node name/label and opening {. Link: https://lore.kernel.org/r/20230705145934.293487-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 33d6227fcd1a8b68bf8d5e68f69a931dc87eac81 Author: Krzysztof Kozlowski Date: Thu Jul 13 17:29:13 2023 +0200 ARM: dts: omap3-devkit8000: correct ethernet reg addresses (split) The davicom,dm9000 Ethernet Controller accepts two reg addresses. Link: https://lore.kernel.org/r/20230713152913.82846-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 0b137caaaab462debb1cd342cdc0df307e301bfc Author: Krzysztof Kozlowski Date: Wed Jul 12 09:46:11 2023 +0200 arm64: dts: bitmain: lowercase unit addresses Unit addresses are expected to be lower case. Pointed also by W=1 builds: Warning (simple_bus_reg): /soc/serial@5801A000: simple-bus unit address format error, expected "5801a000" Link: https://lore.kernel.org/r/20230712074611.35952-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 5e99f692d4e32e3250ab18d511894ca797407aec Author: David Lechner Date: Thu Sep 21 09:43:45 2023 -0500 staging: iio: resolver: ad2s1210: fix not restoring sample gpio in channel read In theory, this code path should not be reachable because of the previous switch statement. But just in case we should make sure we are restoring the SAMPLE gpio to its original state before returning in addition to releasing the mutex lock. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230921144400.62380-5-dlechner@baylibre.com Signed-off-by: Jonathan Cameron commit c78a96ab0f52a12b344882241019dd9070aa988c Author: David Lechner Date: Thu Sep 21 09:43:44 2023 -0500 staging: iio: resolver: ad2s1210: fix ad2s1210_show_fault When reading the fault attribute, an empty string was printed if the fault register value was non-zero. This is fixed by checking that the return value is less than zero instead of not zero. Also always print two hex digits while we are touching this line. Signed-off-by: David Lechner Link: https://lore.kernel.org/r/20230921144400.62380-4-dlechner@baylibre.com Signed-off-by: Jonathan Cameron commit 3e9b009c168e2448ab16f98f10045360b5b41816 Author: Paul E. McKenney Date: Fri Sep 8 05:13:18 2023 -0700 torture: Convert parse-console.sh to mktemp This commit does the long-overdue conversion of the parse-console.sh file to use mktemp to create its temporary directory. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 771a92b85a388b751bb9473300ea24c53f54387e Author: Zqiang Date: Thu Aug 24 16:42:06 2023 +0800 rcutorture: Traverse possible cpu to set maxcpu in rcu_nocb_toggle() Currently, the maxcpu is set by traversing online CPUs, however, if the rcutorture.onoff_holdoff is set zero and onoff_interval is set non-zero, and the some CPUs with larger cpuid has been offline before setting maxcpu, for these CPUs, even if they are online again, also cannot be offload or deoffload. This can result in rcutorture attempting to (de-)offload CPUs that have never been online, but the (de-)offload code handles this. This commit therefore use for_each_possible_cpu() instead of for_each_online_cpu() in rcu_nocb_toggle(). Signed-off-by: Zqiang Reviewed-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 66bcb1321b104cce9c767087656e16883f17dfde Author: Joel Fernandes (Google) Date: Wed Aug 16 20:49:12 2023 +0000 rcutorture: Replace schedule_timeout*() 1-jiffy waits with HZ/20 In the past, spinning on schedule_timeout* with a wait of 1 jiffy has hung the kernel. See for example d52d3a2bf408 ("torture: Fix hang during kthread shutdown phase"). This issue recently recurred in torture's stutter code. The result is that the function instantly returns and never goes to sleep, preempting whatever might otherwise make useful forward progress. To prevent future issues, apply the commit-d52d3a2bf408 fix throughout rcutorture, moving from a 1-jiffy wait to a 50-millisecond wait. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 30639bfdac3e7a7383b6133d8ea9a55e397715d8 Author: Paul E. McKenney Date: Wed Aug 23 12:50:10 2023 -0700 torture: Add kvm.sh --debug-info argument This commit adds a --debug-info argument to kvm.sh in order to ease interpretation of addresses printed on the console and the like. This argument also disables KASLR. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 2273799c292b033a20b0897e1ce2e2dee32304ef Author: Paul E. McKenney Date: Tue Aug 22 08:48:16 2023 -0700 locktorture: Rename readers_bind/writers_bind to bind_readers/bind_writers This commit renames the readers_bind and writers_bind module parameters to bind_readers and bind_writers, respectively. This provides added clarity via the imperative mode and better organizes the documentation. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit b1326d766b437a122fb072106ba462569c192a59 Author: Paul E. McKenney Date: Mon Aug 21 20:17:26 2023 -0700 doc: Catch-up update for locktorture module parameters This commit documents recently added locktorture module parameters. Signed-off-by: Paul E. McKenney Cc: Joel Fernandes Signed-off-by: Frederic Weisbecker commit 7f993623e9ebcd633c0f760991e5078b95a37db3 Author: Paul E. McKenney Date: Mon Aug 21 19:36:10 2023 -0700 locktorture: Add call_rcu_chains module parameter When running locktorture on large systems, there will normally be enough RCU activity to ensure that there is a grace period in flight at all times. However, on smaller systems, RCU might well be idle the majority of the time. This situation can be inconvenient in cases where the RCU CPU stall warning is part of the debugging process. This commit therefore adds an call_rcu_chains module parameter to locktorture, allowing the user to specify the desired number of self-propagating call_rcu() chains. For good measure, immediately before invoking call_rcu(), the self-propagating RCU callback invokes start_poll_synchronize_rcu() to force the immediate start of a grace period, with the call_rcu() forcing another to start shortly thereafter. Booting with locktorture.call_rcu_chains=2 increases the probability of a stuck locking primitive resulting in an RCU CPU stall warning from about 25% to nearly 100%. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 00c24c9cfa7895d6e712bea6f7109911cfdd54d0 Author: Paul E. McKenney Date: Mon Aug 21 16:42:21 2023 -0700 locktorture: Add new module parameters to lock_torture_print_module_parms() This commit adds new module parameters to lock_torture_print_module_parms, and alphabetizes things while in the area. This change makes locktorture test results more useful and self-contained. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 92776c62408f354d254495ea61b3377b450dc69f Author: Paul E. McKenney Date: Wed Aug 16 14:20:49 2023 -0700 torture: Make torture.sh refscale testing qualify verbose_batched In torture.sh, the testing of refscale incorrectly used verbose_batched as a kernel boot parameter, which causes this parameter to be passed to the init process. This commit therefore prefixes it with refscale, so that refscale.verbose_batched is passed to the kernel. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 394473d876eaee0338a50249d5f807d4ae95e33c Author: Paul E. McKenney Date: Wed Aug 16 12:24:44 2023 -0700 torture: Print out torture module parameters The kernel/torture.c module now has several module parameters, so this commit causes them to be printed out. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit fcc7a329a7bfafe732586d876f16be5918b2b0e5 Author: Joel Fernandes (Google) Date: Tue Aug 15 19:09:49 2023 +0000 rcutorture: Copy out ftrace into its own console file When debugging, it can be difficult to quickly find the ftrace dump within the console log, which in turn makes it difficult to process it independent of the rest of the console output. This commit therefore copies the contents of the buffers into its own file to make it easier to locate and process the ftrace dump. The original ftrace dump is still available in the console log in cases because it can be more convenient to process it in situ, for example, for scripts that process console output as well as ftrace-dump data. Also handle the case of multiple ftrace dumps potentially showing up in the log. Example for a file like [1], it will extract as [2]. [1]: foo foo Dumping ftrace buffer: --------------------------------- blah blah --------------------------------- more bar baz Dumping ftrace buffer: --------------------------------- blah2 blah2 --------------------------------- bleh bleh [2]: Ftrace dump 1: blah blah Ftrace dump 2: blah2 blah2 [ paulmck: Fixed awk indentation, input up front. ] Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit e3bdaefbccbd27b1829414604456611928a5e291 Author: Paul E. McKenney Date: Wed Aug 2 16:32:06 2023 -0700 locktorture: Add acq_writer_lim to complain about long acquistion times This commit adds a locktorture.acq_writer_lim module parameter that specifies the maximum number of jiffies that is expected to be consumed by write-side lock acquisition. If this limit is exceeded, a WARN_ONCE() causes a splat. Note that this limit applies to the main lock acquisition only, not to any nested acquisitions. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 84cee9e72e15b65921f05d41788d66a79c1baa25 Author: Paul E. McKenney Date: Wed Aug 2 15:42:03 2023 -0700 locktorture: Consolidate "if" statements in lock_torture_writer() There is a pair of adjacent "if" statements with identical conditions in the lock_torture_writer() function. This commit therefore combines them. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 31742a56c676b6014fde99a0cf07d3d12b822e9a Author: Paul E. McKenney Date: Wed Aug 2 15:30:31 2023 -0700 locktorture: Alphabetize torture_param() entries There are getting to be too many module parameters for a random list to be comfortable, so this commit alphabetizes the list. Strictly code motion. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit cca42bd8eb1b54a4c9bbf48c79d120e66619a3e4 Author: Joel Fernandes (Google) Date: Sat Jul 29 14:27:31 2023 +0000 rcutorture: Fix stuttering races and other issues The stuttering code isn't functioning as expected. Ideally, it should pause the torture threads for a designated period before resuming. Yet, it fails to halt the test for the correct duration. Additionally, a race condition exists, potentially causing the stuttering code to pause for an extended period if the 'spt' variable is non-zero due to the stutter orchestration thread's inadequate CPU time. Moreover, over-stuttering can hinder RCU's progress on TREE07 kernels. This happens as the stuttering code may run within a softirq due to RCU callbacks. Consequently, ksoftirqd keeps a CPU busy for several seconds, thus obstructing RCU's progress. This situation triggers a warning message in the logs: [ 2169.481783] rcu_torture_writer: rtort_pipe_count: 9 This warning suggests that an RCU torture object, although invisible to RCU readers, couldn't make it past the pipe array and be freed -- a strong indication that there weren't enough grace periods during the stutter interval. To address these issues, this patch sets the "stutter end" time to an absolute point in the future set by the main stutter thread. This is then used for waiting in stutter_wait(). While the stutter thread still defines this absolute time, the waiters' waiting logic doesn't rely on the stutter thread receiving sufficient CPU time to halt the stuttering as the halting is now self-controlled. Cc: stable@vger.kernel.org Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 65b73f1ff6d98a4a0d28c4c6f6497686fef557fa Author: Paul E. McKenney Date: Fri Jul 28 13:42:34 2023 -0700 rcutorture: Add CONFIG_DEBUG_OBJECTS to RCU Tasks testing This commit adds CONFIG_DEBUG_OBJECTS=y to the TRACE02 rcutorture scenario to catch any further RCU Tasks bugs involving this Kconfig option. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 73e3412424832f519004dd2176226982be35d34e Author: Paul E. McKenney Date: Thu Jul 27 20:04:06 2023 -0700 locktorture: Add readers_bind and writers_bind module parameters This commit adds readers_bind and writers_bind module parameters to locktorture in order to skew tests across socket boundaries. This skewing is intended to provide additional variable-latency stress on the primitive under test. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 0cfecd7d754f2ef5d7e6b56ee656a8544ade920a Author: Paul E. McKenney Date: Mon Jul 31 13:10:34 2023 -0700 torture: Move rcutorture_sched_setaffinity() out of rcutorture The rcutorture_sched_setaffinity() function is needed by locktorture, so move its declaration from rcu.h to torture.h and rename it to the more generic torture_sched_setaffinity() name. Please note that use of this function is still restricted to torture tests, and of those, currently only rcutorture and locktorture. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 3853a720f8bce9c5facb593e817f97659cc0512a Author: Arnd Bergmann Date: Thu Aug 3 16:40:11 2023 +0200 rcu: Include torture_sched_setaffinity() declaration The prototype for torture_sched_setaffinity() will be moved to a different header, which will need to be included from update.c to avoid this W=1 warning: kernel/rcu/update.c:529:6: error: no previous prototype for 'torture_sched_setaffinity' [-Werror=missing-prototypes] 529 | long torture_sched_setaffinity(pid_t pid, const struct cpumask *in_mask) Signed-off-by: Arnd Bergmann Reviewed-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit a741deac787f0d2d7068638c067db20af9e63752 Author: Paul E. McKenney Date: Wed Jul 26 13:57:03 2023 -0700 torture: Make torture_hrtimeout_ns() take an hrtimer mode parameter The current torture-test sleeps are waiting for a duration, but there are situations where it is better to wait for an absolute time, for example, when ending a stutter interval. This commit therefore adds an hrtimer mode parameter to torture_hrtimeout_ns(). Why not also the other torture_hrtimeout_*() functions? The theory is that most absolute times will be in nanoseconds, especially not (say) jiffies. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 40baf39fc57c61554dc744d924257940574ac76b Author: Paul E. McKenney Date: Fri Jul 21 14:45:08 2023 -0700 torture: Make kvm-recheck.sh use mktemp This commit switches from the old "/tmp/kvm-recheck.sh.$$" approach to the newer and now reliable "mktemp" approach. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit d0b654e19a83840e11d6ba87ea0be30e5fae343a Author: Paul E. McKenney Date: Wed Jul 19 12:03:20 2023 -0700 torture: Share torture_random_state with torture_shuffle_tasks() Both torture_shuffle_tasks() and its caller torture_shuffle() define a torture_random_state structure. This is suboptimal given that torture_shuffle_tasks() runs for a very short period of time. This commit therefore causes torture_shuffle() to pass a pointer to its torture_random_state structure down to torture_shuffle_tasks(). Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit fcaf9761fd5884a64eaac48536f8c27ecfd2e6bc Author: Jani Nikula Date: Thu Sep 14 16:10:58 2023 +0300 drm/mediatek/dp: fix memory leak on ->get_edid callback error path Setting new_edid to NULL leaks the buffer. Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") Cc: Markus Schneider-Pargmann Cc: Guillaume Ranquet Cc: Bo-Chen Chen Cc: CK Hu Cc: AngeloGioacchino Del Regno Cc: Dmitry Osipenko Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: Matthias Brugger Cc: dri-devel@lists.freedesktop.org Cc: linux-mediatek@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: # v6.1+ Signed-off-by: Jani Nikula Reviewed-by: Guillaume Ranquet Link: https://patchwork.kernel.org/project/dri-devel/patch/20230914131058.2472260-1-jani.nikula@intel.com/ Signed-off-by: Chun-Kuang Hu commit 0f462d9dcf833ba9d82f52f48e1415ba2842a593 Author: Krzysztof Kozlowski Date: Wed Sep 6 10:46:25 2023 +0200 ARM: dts: nxp: imx6qdl-nitrogen6: correct regulator node name Root node is not a bus, thus top-level nodes do not have unit addresses. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Shawn Guo commit dab12fa8d2bd3868cf2de485ed15a3feef28a13d Author: Jani Nikula Date: Thu Sep 14 18:53:17 2023 +0300 drm/mediatek/dp: fix memory leak on ->get_edid callback audio detection The sads returned by drm_edid_to_sad() needs to be freed. Fixes: e71a8ebbe086 ("drm/mediatek: dp: Audio support for MT8195") Cc: Guillaume Ranquet Cc: Bo-Chen Chen Cc: AngeloGioacchino Del Regno Cc: Dmitry Osipenko Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: Matthias Brugger Cc: dri-devel@lists.freedesktop.org Cc: linux-mediatek@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: # v6.1+ Signed-off-by: Jani Nikula Reviewed-by: Chen-Yu Tsai Link: https://patchwork.kernel.org/project/dri-devel/patch/20230914155317.2511876-1-jani.nikula@intel.com/ Signed-off-by: Chun-Kuang Hu commit 350c3fe907fbfccb534198d69a580f5fef4ab834 Author: Shuijing Li Date: Tue Aug 22 10:41:55 2023 +0800 drm/mediatek: dp: Add support MT8188 dp/edp function Add support MT8188 dp/edp function Signed-off-by: Shuijing Li Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/dri-devel/patch/20230822024155.26670-5-shuijing.li@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit d2f7f1ba5cbec030c0011831d9624f6b27b1d71a Author: Shuijing Li Date: Tue Aug 22 10:41:54 2023 +0800 drm/mediatek: dp: Add the audio divider to mtk_dp_data struct Due to the difference of HW, different dividers need to be set. Signed-off-by: Shuijing Li Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/dri-devel/patch/20230822024155.26670-4-shuijing.li@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 2d503773483edb1c0ffc24ad47eef2b60e8c340a Author: Shuijing Li Date: Tue Aug 22 10:41:53 2023 +0800 drm/mediatek: dp: Add the audio packet flag to mtk_dp_data struct The audio packet arrangement function is to only arrange audio packets into the Hblanking area. In order to align with the HW default setting of mt8195, this function needs to be turned off. Signed-off-by: Shuijing Li Reviewed-by: CK Hu Link: https://patchwork.kernel.org/project/dri-devel/patch/20230822024155.26670-3-shuijing.li@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 579932444fb88cc035d2e0f6cb4aeb0e072b35b9 Author: Shuijing Li Date: Tue Aug 22 10:41:52 2023 +0800 dt-bindings: display: mediatek: dp: Add compatible for MediaTek MT8188 Add dt-binding documentation of dp-tx for MediaTek MT8188 SoC. Signed-off-by: Shuijing Li Signed-off-by: Jitao Shi Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu Acked-by: Krzysztof Kozlowski Link: https://patchwork.kernel.org/project/dri-devel/patch/20230822024155.26670-2-shuijing.li@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 7ba639b53d04db2e50568ca13299310e3e2772de Author: Fabio Estevam Date: Wed Aug 16 15:21:22 2023 -0300 arm64: defconfig: Enable CONFIG_USB_MASS_STORAGE Enable CONFIG_USB_MASS_STORAGE so that it is possible to mount the eMMC content in the PC by doing: modprobe g_mass_storage file=/dev/mmcblk1 removable=1 Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit efea15e3c65d96bac17a4d8104e3fff7c07cc910 Author: Marius Cristea Date: Mon Sep 18 10:56:33 2023 +0300 iio: adc: MCP3564: fix the static checker warning The patch 33ec3e5fc1ea: "iio: adc: adding support for MCP3564 ADC" from Aug 29, 2023 (linux-next), leads to the following Smatch static checker warning:         drivers/iio/adc/mcp3564.c:1426 mcp3564_probe()         warn: address of NULL pointer 'indio_dev' drivers/iio/adc/mcp3564.c 1421 struct iio_dev *indio_dev; 1422 struct mcp3564_state *adc; 1423 1424 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*adc)); 1425 if (!indio_dev) { --> 1426 dev_err_probe(&indio_dev->dev, PTR_ERR(indio_dev), ^^^^^^^^^^^^^^^ Fixes: 33ec3e5fc1ea (iio: adc: adding support for MCP3564 ADC) Signed-off-by: Marius Cristea Link: https://lore.kernel.org/r/20230918075633.1884-1-marius.cristea@microchip.com Signed-off-by: Jonathan Cameron commit 5f80901522bb485d994fb4aa1239a6b2e49bf143 Author: Alexander Stein Date: Wed Aug 16 09:54:52 2023 +0200 ARM: dts: imx6ul: mba6ulx: Fix gpio-keys button node names Numbers are separated by dashes. Fixes the warnings: arch/arm/boot/dts/nxp/imx/imx6ull-tqma6ull2-mba6ulx.dtb: gpio-keys: 'button1', 'button2', 'button3' do not match any of the regexes: '^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$', 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 2de7444888dda33d38373f1b339db84dd6fdca97 Author: Alexander Stein Date: Wed Aug 16 09:54:51 2023 +0200 ARM: dts: imx6ul: mba6ulx: Mark gpio-buttons as wakeup-source I2C expander is capable of generating an IRQ during powersave, so the attached buttons can be used for waking up the system. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 431dffc1df07b93ce9be26d264b7946cd65cb949 Merge: 57d3909596f99 c6c97210e2723 Author: Jonathan Cameron Date: Sun Sep 24 13:39:25 2023 +0100 Merge branch 'ib-iio-hid-sensors-v6.6-rc1' into togreg The deta angle and deta velocity channels were added in parallel with color temperature and chromacity so this merge had to assign a consistent order. I put the color related ones second. Signed-off-by: Jonathan Cameron commit c6c97210e27237438689611980f8a7b87bcc79bf Author: Basavaraj Natikar Date: Tue Sep 19 13:40:54 2023 +0530 HID: amd_sfh: Add light chromaticity for SFH1.1 In most cases, ambient color sensors also support the x and y light colors, which represent the coordinates on the CIE 1931 chromaticity diagram. Thus, add light chromaticity x and y for SFH1.1. Signed-off-by: Basavaraj Natikar Acked-by: Jiri Kosina Link: https://lore.kernel.org/r/20230919081054.2050714-10-Basavaraj.Natikar@amd.com Signed-off-by: Jonathan Cameron commit 3244d44a7c5e6961d79eafa44370ff13c909d670 Author: Basavaraj Natikar Date: Tue Sep 19 13:40:53 2023 +0530 HID: amd_sfh: Add light chromaticity support In most cases, ambient color sensors also support the x and y light colors, which represent the coordinates on the CIE 1931 chromaticity diagram. Thus, add light chromaticity x and y. Signed-off-by: Basavaraj Natikar Acked-by: Jiri Kosina Link: https://lore.kernel.org/r/20230919081054.2050714-9-Basavaraj.Natikar@amd.com Signed-off-by: Jonathan Cameron commit ee3710f39f9d0ae5137a866138d005fe1ad18132 Author: Basavaraj Natikar Date: Tue Sep 19 13:40:52 2023 +0530 iio: hid-sensor-als: Add light chromaticity support In most cases, ambient color sensors also support the x and y light colors, which represent the coordinates on the CIE 1931 chromaticity diagram. Thus, add light chromaticity x and y. Signed-off-by: Basavaraj Natikar Acked-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20230919081054.2050714-8-Basavaraj.Natikar@amd.com Signed-off-by: Jonathan Cameron commit 06790d4c69d1851573baa4459e5bf6ac986cb0eb Author: Basavaraj Natikar Date: Tue Sep 19 13:40:51 2023 +0530 iio: Add channel type for chromaticity In most cases, ambient color sensors also support the x and y light colors, which represent the coordinates on the CIE 1931 chromaticity diagram. Thus, add channel type for chromaticity. Signed-off-by: Basavaraj Natikar Link: https://lore.kernel.org/r/20230919081054.2050714-7-Basavaraj.Natikar@amd.com Signed-off-by: Jonathan Cameron commit 82cdcdf227f3965cce3ac94bc2e473e9c898f402 Author: Basavaraj Natikar Date: Tue Sep 19 13:40:50 2023 +0530 HID: amd_sfh: Add support for SFH1.1 light color temperature In most cases, ambient color sensors also support light color temperature. As a result, add support of light color temperature for SFH1.1. Signed-off-by: Basavaraj Natikar Acked-by: Jiri Kosina Link: https://lore.kernel.org/r/20230919081054.2050714-6-Basavaraj.Natikar@amd.com Signed-off-by: Jonathan Cameron commit 908fee511ced79537b78db60f9b9bdb2f537679a Author: Basavaraj Natikar Date: Tue Sep 19 13:40:49 2023 +0530 HID: amd_sfh: Add support for light color temperature In most cases, ambient color sensors also support light color temperature. As a result, add support of light color temperature. Signed-off-by: Basavaraj Natikar Acked-by: Jiri Kosina Link: https://lore.kernel.org/r/20230919081054.2050714-5-Basavaraj.Natikar@amd.com Signed-off-by: Jonathan Cameron commit 5f05285df691b1e82108eead7165feae238c95ef Author: Basavaraj Natikar Date: Tue Sep 19 13:40:48 2023 +0530 iio: hid-sensor-als: Add light color temperature support In most cases, ambient color sensors also support light color temperature. As a result, add support of light color temperature. Signed-off-by: Basavaraj Natikar Acked-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20230919081054.2050714-4-Basavaraj.Natikar@amd.com Signed-off-by: Jonathan Cameron commit 42f311751102ef4884ae7352d7e85bd97280d2d3 Author: Basavaraj Natikar Date: Tue Sep 19 13:40:47 2023 +0530 iio: Add channel type light color temperature In most cases, ambient color sensors also support light color temperature, which is measured in kelvin. Thus, add channel type light color temperature. Signed-off-by: Basavaraj Natikar Link: https://lore.kernel.org/r/20230919081054.2050714-3-Basavaraj.Natikar@amd.com Signed-off-by: Jonathan Cameron commit 286d528bf0fae9f334fba857825b9701df1675b2 Author: Basavaraj Natikar Date: Tue Sep 19 13:40:46 2023 +0530 iio: hid-sensor-als: Use channel index to support more hub attributes Sensor hub attributes can be extended to support more channels. Repeat the reading for the two existing channels and store them separately. It still operates in the same manner as before where there was just one entry. So in order to support more sensor hub attributes for ALS use channel index to get specific sensor hub attributes. Signed-off-by: Basavaraj Natikar Acked-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20230919081054.2050714-2-Basavaraj.Natikar@amd.com Signed-off-by: Jonathan Cameron commit c1f2c81631df7654c249a457b7a54bbc36042248 Author: Kees Cook Date: Fri Sep 22 10:52:15 2023 -0700 memory: atmel-ebi: Annotate struct atmel_ebi_dev with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct atmel_ebi_dev. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Claudiu Beznea Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922175215.work.122-kees@kernel.org Signed-off-by: Krzysztof Kozlowski commit f4c5ca9850124fb5715eff06cffb1beed837500c Author: Hugh Dickins Date: Mon Aug 14 19:53:18 2023 -0700 x86_64: Show CR4.PSE on auxiliaries like on BSP Set CR4.PSE in secondary_startup_64: the Intel SDM is clear that it does not matter whether it's 0 or 1 when 4-level-pts are enabled, but it's distracting to find CR4 different on BSP and auxiliaries - on x86_64, BSP alone got to add the PSE bit, in probe_page_size_mask(). Peter Zijlstra adds: "I think the point is that PSE bit is completely without meaning in long mode. But yes, having the same CR4 bits set across BSP and APs is definitely sane." Signed-off-by: Hugh Dickins Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/103ad03a-8c93-c3e2-4226-f79af4d9a074@google.com commit 3eafe225995c67f8c179011ec2d6e4c12b32a53d Author: Wang Jinchao Date: Sun Aug 20 20:53:17 2023 +0800 sched/core: Refactor the task_flags check for worker sleeping in sched_submit_work() Simplify the conditional logic for checking worker flags by splitting the original compound `if` statement into separate `if` and `else if` clauses. This modification not only retains the previous functionality, but also reduces a single `if` check, improving code clarity and potentially enhancing performance. Signed-off-by: Wang Jinchao Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/ZOIMvURE99ZRAYEj@fedora commit 2f8c62296b6f656bbfd17e9f1fadd7478003a9d9 Author: Josh Don Date: Fri Sep 22 16:05:35 2023 -0700 sched/fair: Fix warning in bandwidth distribution We've observed the following warning being hit in distribute_cfs_runtime(): SCHED_WARN_ON(cfs_rq->runtime_remaining > 0) We have the following race: - CPU 0: running bandwidth distribution (distribute_cfs_runtime). Inspects the local cfs_rq and makes its runtime_remaining positive. However, we defer unthrottling the local cfs_rq until after considering all remote cfs_rq's. - CPU 1: starts running bandwidth distribution from the slack timer. When it finds the cfs_rq for CPU 0 on the throttled list, it observers the that the cfs_rq is throttled, yet is not on the CSD list, and has a positive runtime_remaining, thus triggering the warning in distribute_cfs_runtime. To fix this, we can rework the local unthrottling logic to put the local cfs_rq on a local list, so that any future bandwidth distributions will realize that the cfs_rq is about to be unthrottled. Signed-off-by: Josh Don Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230922230535.296350-2-joshdon@google.com commit 30797bce8ef0c73f0c388148ffac92458533b10e Author: Josh Don Date: Fri Sep 22 16:05:34 2023 -0700 sched/fair: Make cfs_rq->throttled_csd_list available on !SMP This makes the following patch cleaner by avoiding extra CONFIG_SMP conditionals on the availability of rq->throttled_csd_list. Signed-off-by: Josh Don Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230922230535.296350-1-joshdon@google.com commit d9a01959d9c954c8fe1d132b52401b0e219e37f6 Author: Kees Cook Date: Fri Sep 22 10:51:51 2023 -0700 x86/platform/uv: Annotate struct uv_rtc_timer_head with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). Found with Coccinelle: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Add __counted_by for struct uv_rtc_timer_head. Signed-off-by: Kees Cook Signed-off-by: Ingo Molnar Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20230922175151.work.118-kees@kernel.org commit c53cbc54ccffcd1f436f29456d8a8c9addb29c2b Author: Jianlin Li Date: Sat Sep 23 15:13:45 2023 +0800 x86/iommu/docs: Update AMD IOMMU specification document URL The previous link to the AMD IOMMU specification is no longer available, replace it with the latest one. Signed-off-by: Jianlin Li Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230923071344.540894-1-ljianlin99@gmail.com commit 5ee1a430479914e694584f83a4972e373e3b4c6c Author: Tudor Ambarus Date: Thu Sep 14 13:37:29 2023 +0000 docs: pstore-blk.rst: fix typo, s/console/ftrace The author referred to the ftrace log, but mentioned console log instead. Fix the typo. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20230914133729.1956907-2-tudor.ambarus@linaro.org Signed-off-by: Kees Cook commit 4bc028de97c289e40b20842e361133225454bc48 Author: Tudor Ambarus Date: Thu Sep 14 13:37:28 2023 +0000 docs: pstore-blk.rst: use "about" as a preposition after "care" Reword the sentence to "care about the {oops/panic, pmsg, console} log." Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20230914133729.1956907-1-tudor.ambarus@linaro.org Signed-off-by: Kees Cook commit c50fdc48643a25f5218f6b8bba4f28e1b4a94708 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:29 2023 +0200 Input: wm97xx-core - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230920125829.1478827-53-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 33984b4f42b732075cdd19b93ef7608dca23b96f Author: Uwe Kleine-König Date: Wed Sep 20 14:58:28 2023 +0200 Input: wm831x-ts - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230920125829.1478827-52-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit d722a70213f92a1563913d612287e15ed3fad489 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:27 2023 +0200 Input: ti_am335x_tsc - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-51-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 1b1904f61b3d46d06e8432a5a51ca4b290a693a3 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:26 2023 +0200 Input: sun4i-ts - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230920125829.1478827-50-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 3401b7f542fa5695956f1c9676783d178f2a8b83 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:25 2023 +0200 Input: stmpe-ts - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-49-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit f6f14e4a33a492d0761ce9f07bd299d7c656bd1a Author: Uwe Kleine-König Date: Wed Sep 20 14:58:24 2023 +0200 Input: pcap_ts - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-48-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 02fd95e114a6f87aed670cb19f2b631b33fc239d Author: Uwe Kleine-König Date: Wed Sep 20 14:58:23 2023 +0200 Input: mc13783_ts - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-47-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 02bb3ecaf9f2e556086e1ab37d1dcb02fc54be8f Author: Uwe Kleine-König Date: Wed Sep 20 14:58:22 2023 +0200 Input: mainstone-wm97xx - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-46-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit b436514915a00031bbc1408b92606ba67c151798 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:21 2023 +0200 Input: da9052_tsi - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-45-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 8df828424d3dce854c5ca10d685c27ab42a4a6f4 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:20 2023 +0200 Input: xilinx_ps2 - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-44-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit e453a3e6d4024e46c9bc86ce5c61dda536800293 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:19 2023 +0200 Input: sun4i-ps2 - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230920125829.1478827-43-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit d4904adb6628597054eaf1144c181759651764f5 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:18 2023 +0200 Input: rpckbd - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-42-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 68f59e2bb7a7c98bc1b71f1e128b8a09bcaaf27e Author: Uwe Kleine-König Date: Wed Sep 20 14:58:17 2023 +0200 Input: q40kbd - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-41-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 21c3c272a21f99b5915902f8908735cf0a4efe58 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:16 2023 +0200 Input: ps2-gpio - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-40-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 9c3c1674ba295243fa03d620b034752e91355b4d Author: Uwe Kleine-König Date: Wed Sep 20 14:58:15 2023 +0200 Input: olpc_apsp - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-39-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit b72729b7e6abf3f877856a4030b64c94e388cce1 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:14 2023 +0200 Input: maceps2 - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-38-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 150e792dee9ca8416f3d375e48f2f4d7f701fc6b Author: Uwe Kleine-König Date: Wed Sep 20 14:58:13 2023 +0200 Input: ioc3kbd - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-37-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 2e760e9b6d4758a5ab86d8fe1030d7f76370f01a Author: Uwe Kleine-König Date: Wed Sep 20 14:58:12 2023 +0200 Input: i8042 - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-36-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 57f534c1e53d545c19aa711f0eb7f70987ea7655 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:11 2023 +0200 Input: i8042-sparcio - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-35-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 508366de110a042a8ca2cbcc46b6fb637eb6512a Author: Uwe Kleine-König Date: Wed Sep 20 14:58:10 2023 +0200 Input: ct82c710 - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-34-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit da93e8a64f54274bc0a2c9d8238f3b2576f98c1b Author: Uwe Kleine-König Date: Wed Sep 20 14:58:09 2023 +0200 Input: arc_ps2 - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-33-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 15514b9c61a4b0e3072d149d09c6c3cbf46f1b7e Author: Uwe Kleine-König Date: Wed Sep 20 14:58:08 2023 +0200 Input: apbps2 - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-32-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit d484d0f847e17d4df5d81b8c9ea625d85e929312 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:07 2023 +0200 Input: ams_delta_serio - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-31-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit fb4f4f37676548778d477f910707f3dffecffe32 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:06 2023 +0200 Input: altera_ps2 - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-30-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 37a432c2278967cc678a4a1c4a1ee751582636e0 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:05 2023 +0200 Input: navpoint - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-29-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit ee3d5597133c03c7c200f63c51534c2ada24b8fc Author: Uwe Kleine-König Date: Wed Sep 20 14:58:04 2023 +0200 Input: wm831x-on - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230920125829.1478827-28-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit ad43716068130dd22d14dc5223f5f5675d96fd12 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:03 2023 +0200 Input: wistron_btns - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-27-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit c55fb9780590b8612ef4338441687e6d2aff8c36 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:02 2023 +0200 Input: sparcspkr - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-26-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 2c4fd21f4a6ffb0c8c2632470b602c0dde8ff20f Author: Uwe Kleine-König Date: Wed Sep 20 14:58:01 2023 +0200 Input: soc_button_array - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-25-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit a72aa189b2df3508c2fcbe41eec96530ed830e50 Author: Uwe Kleine-König Date: Wed Sep 20 14:58:00 2023 +0200 Input: pm8941-pwrkey - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230920125829.1478827-24-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 5cd345ec1cf1350089bf02c66f5cd473c0a5a218 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:59 2023 +0200 Input: pcspkr - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-23-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 3b87328b0179d13a5e44736fa11ed44abcc30409 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:58 2023 +0200 Input: pcf50633-input - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-22-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 3757a5fd11ed595b87a39f0db9780cf4c1149564 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:57 2023 +0200 Input: pcap_keys - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-21-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 7db7e7ef75b2658a2a31b69ca68d9e3b5c51702c Author: Uwe Kleine-König Date: Wed Sep 20 14:57:56 2023 +0200 Input: palmas-pwrbutton - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-20-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 9b6619667e9ecc771d8d6379311793d8823dad70 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:55 2023 +0200 Input: mc13783-pwrbutton - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-19-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 3254392ead69ba6b063b3a3871f69c6bf4bb5ccb Author: Uwe Kleine-König Date: Wed Sep 20 14:57:54 2023 +0200 Input: max8997_haptic - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-18-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 6d3a5b825496785bf3fc6872e49a9f8443b0d66b Author: Uwe Kleine-König Date: Wed Sep 20 14:57:53 2023 +0200 Input: m68kspkr - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-17-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 48309b52b175586a9eb5a655f7ea04bb21c8a295 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:52 2023 +0200 Input: ideapad_slidebar - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-16-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit d8584e00d989ad2eee3fe2dc09ce2a1a31f060d1 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:51 2023 +0200 Input: da9055_onkey - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-15-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit d6bcf6cdd041050d3f5713f06ded31ef8afe143f Author: Uwe Kleine-König Date: Wed Sep 20 14:57:50 2023 +0200 Input: da9052_onkey - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-14-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 3e2ccfd93c4a2c274900537595105589cb9882ed Author: Uwe Kleine-König Date: Wed Sep 20 14:57:49 2023 +0200 Input: 88pm80x_onkey - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-13-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 00e0df61ee6a44fdd82aa871cdaa8284e4fbbbb4 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:48 2023 +0200 Input: stmpe-keypad - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-12-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit dc20ae18d1a6eb94c8311c701bc6846112bd95d7 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:47 2023 +0200 Input: spear-keyboard - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-11-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit e340089d76f49a462471507aebf1efffeeca65c8 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:46 2023 +0200 Input: sh_keysc - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-10-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 4e26858958e41f520a607df258a0c709f0c9a5ce Author: Uwe Kleine-König Date: Wed Sep 20 14:57:45 2023 +0200 Input: samsung-keypad - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-9-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit ec4c61a69ddc8b7f486f81f356f7cd29699b8662 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:44 2023 +0200 Input: omap4-keypad - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-8-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit d93f3feb443939d27a2dc664267d29d42c4a6955 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:43 2023 +0200 Input: omap-keypad - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-7-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit af90388a598d39584283c18e4047124fee8f1801 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:42 2023 +0200 Input: matrix_keypad - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-6-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 0080c3c43dbafb819c91a5fc6a782834badc6527 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:41 2023 +0200 Input: iqs62x-keys - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Jeff LaBundy Link: https://lore.kernel.org/r/20230920125829.1478827-5-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit d9ee4119a83cab3184b2bd8cc2804bdcb043fc3d Author: Uwe Kleine-König Date: Wed Sep 20 14:57:40 2023 +0200 Input: ep93xx_keypad - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-4-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 63ef64cb6453740ecb53acbbfdfe5725adcd2a8f Author: Uwe Kleine-König Date: Wed Sep 20 14:57:39 2023 +0200 Input: cros_ec_keyb - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20230920125829.1478827-3-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 18965fcfc5d0762e6e1bcd5ab48172ffce9433d5 Author: Uwe Kleine-König Date: Wed Sep 20 14:57:38 2023 +0200 Input: adp5520-keys - convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230920125829.1478827-2-u.kleine-koenig@pengutronix.de Signed-off-by: Dmitry Torokhov commit 4d8b5d7171722d2cdccc880d8e449f7ca9c7b6bf Author: Luca Weiss Date: Thu Sep 21 08:34:02 2023 +0200 ARM: dts: qcom: sdx65-mtp: Specify PM7250B SID to use Now that the pm7250b.dtsi can be configured to be on a different SID, we also need to specify it for this dts file. Set it to the SID 2/3 like it was before commit 8e2d56f64572 ("arm64: dts: qcom: pm7250b: make SID configurable"). Fixes: 8e2d56f64572 ("arm64: dts: qcom: pm7250b: make SID configurable") Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20230921-pm7250b-sid-fixup-v1-1-231c1a65471f@fairphone.com Signed-off-by: Bjorn Andersson commit 57d3909596f9941c7d0777004994438df1b5ba0a Author: Andy Shen Shen Date: Thu Sep 21 11:14:44 2023 +0800 iio: adc: palmas_gpadc: Drop duplicated the in comment. In line 460 of the palmas_gpadc.c file, fix kernel comment errors. Signed-off-by: Andy Shen Shen Link: https://lore.kernel.org/r/20230921031444.63594-1-shengaoya@inspur.com Signed-off-by: Jonathan Cameron commit 2da980fd5dcb5345a1c072fd29a04130631913c0 Author: Marek Vasut Date: Thu Sep 21 21:24:20 2023 +0200 dt-bindings: iio: adc: ti,ads1015: Document optional interrupt line The ADS1015 can have optional IRQ line connected, document it in the DT bindings. Signed-off-by: Marek Vasut Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230921192420.70643-1-marex@denx.de Signed-off-by: Jonathan Cameron commit e377df03082b36f748894904c990617682b8cec6 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:31 2023 +0200 iio: trigger: stm32-timer: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-50-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 548eb81d7bfcf48370f4a82483f6ed0f1378b719 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:30 2023 +0200 iio: trigger: iio-trig-interrupt: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-49-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit f55891730682f3e2d7401de6f52eddb1338107cb Author: Uwe Kleine-König Date: Tue Sep 19 19:49:29 2023 +0200 iio: temperature: hid-sensor: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-48-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 4abfc97db98be23f33c5b003d13bbb02c8fde679 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:28 2023 +0200 iio: proximity: srf04: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-47-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 2df694f710d29d6c9d10f09cd368d2f544c7ba4c Author: Uwe Kleine-König Date: Tue Sep 19 19:49:27 2023 +0200 iio: proximity: cros_ec_mkbp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20230919174931.1417681-46-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 23c81c1098ae4569aecca4d2040ee9d144e804f7 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:26 2023 +0200 iio: pressure: hid-sensor: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-45-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 94f2dab24ee87b4322a7c9e60959391717368e5e Author: Uwe Kleine-König Date: Tue Sep 19 19:49:25 2023 +0200 iio: position: hid-sensor-custom-intel-hinge: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-44-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit d93837b8d4331af9d5d270e36d2dcb7273c24eee Author: Uwe Kleine-König Date: Tue Sep 19 19:49:24 2023 +0200 iio: orientation: hid-sensor-rotation: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-43-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 44b25cf7195e953a8f56d3928e62133cd2ef790e Author: Uwe Kleine-König Date: Tue Sep 19 19:49:23 2023 +0200 iio: orientation: hid-sensor-incl-3d: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-42-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 622adde5e54de35eaca7ff065ef2970b8495fffd Author: Uwe Kleine-König Date: Tue Sep 19 19:49:22 2023 +0200 iio: magnetometer: hid-sensor-magn-3d: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-41-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 4235ac7e6f9650ab07bbcd7c33c46a2a70f6ca56 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:21 2023 +0200 iio: light: lm3533-als: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-40-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit c707ccc7005475764ee0f2438055e2592c3d5138 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:20 2023 +0200 iio: light: hid-sensor-prox: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-39-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit b428adb4113b20f123bf467a909332824048b741 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:19 2023 +0200 iio: light: hid-sensor-als: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-38-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 3e1e6787dc4b42c09a23cfe4e898b01f5a07b559 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:18 2023 +0200 iio: light: cm3605: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-37-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit b06ab8c8ac9da9d03cec61678fe04404450ee76a Author: Uwe Kleine-König Date: Tue Sep 19 19:49:17 2023 +0200 iio: humidity: hid-sensor-humidity: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-36-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 3a8799735b406919b28f0539a1234fe8a895bd88 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:16 2023 +0200 iio: gyro: hid-sensor-gyro-3d: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-35-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit cf22fc5566ccf1b23c4a5489912e6e406a0377fd Author: Uwe Kleine-König Date: Tue Sep 19 19:49:15 2023 +0200 iio: dac: vf610: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-34-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 85a32a0ae2212ccbf8551993e494d68dbfc059ef Author: Uwe Kleine-König Date: Tue Sep 19 19:49:14 2023 +0200 iio: dac: stm32-dac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-33-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit b5821e60388428226cc1e7cfe0543f7e190fa4fc Author: Uwe Kleine-König Date: Tue Sep 19 19:49:13 2023 +0200 iio: dac: stm32-dac-core: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-32-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit b4785a25a969bc53773c6abb89f3592b7fd4fe9e Author: Uwe Kleine-König Date: Tue Sep 19 19:49:12 2023 +0200 iio: dac: lpc18xx_dac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-31-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 3de9b0729567c873571090287baf45957efd5ba9 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:11 2023 +0200 iio: dac: dpot-dac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-30-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit aec6dbe61f2b01b572cc85643eaf0095b8c66bbf Author: Uwe Kleine-König Date: Tue Sep 19 19:49:10 2023 +0200 iio: adc: vf610_adc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-29-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit d355c20e710edf9242c5e5ef5fad42ed79786046 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:09 2023 +0200 iio: adc: twl6030-gpadc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-28-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 30ff88e96b5e9ff1d190bbce6caa80a2265d9a43 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:08 2023 +0200 iio: adc: twl4030-madc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-27-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit e4bd0e6040e93f4895371abd4fca7291a5c5e9ef Author: Uwe Kleine-König Date: Tue Sep 19 19:49:07 2023 +0200 iio: adc: ti_am335x_adc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-26-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 794c760fd3da939db6fdd903d190a68838b86aa3 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:06 2023 +0200 iio: adc: sun4i-gpadc-iio: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230919174931.1417681-25-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 259fbaecb7b56c202ff4fae9a4ad98df3de28b22 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:05 2023 +0200 iio: adc: stm32-dfsdm-core: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-24-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit cd918e75b42e24bac86d1b33118b936cff3bb3bd Author: Uwe Kleine-König Date: Tue Sep 19 19:49:04 2023 +0200 iio: adc: stm32-dfsdm-adc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-23-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit da8431b4fd160ac9f13c8ca2bef04d89ff559a67 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:03 2023 +0200 iio: adc: stm32-adc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-22-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit eedcd8c7327f27924048ebdf2532ee7004c668e4 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:02 2023 +0200 iio: adc: stm32-adc-core: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-21-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit e785bace1a77a31c3853f01735e651c9c2b43b03 Author: Uwe Kleine-König Date: Tue Sep 19 19:49:01 2023 +0200 iio: adc: rcar-gyroadc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-20-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 0de6e194459168c804816abb08e9d955da73b40c Author: Uwe Kleine-König Date: Tue Sep 19 19:49:00 2023 +0200 iio: adc: qcom-pm8xxx-xoadc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230919174931.1417681-19-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 5253a5cc7709688b9a000f7928bfaa3366d0af98 Author: Uwe Kleine-König Date: Tue Sep 19 19:48:59 2023 +0200 iio: adc: npcm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-18-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit a72e156f53095b1893a9a133744e454879992f76 Author: Uwe Kleine-König Date: Tue Sep 19 19:48:58 2023 +0200 iio: adc: mxs-lradc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-17-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 9e7e402055bd9d611f1779df1dd2758668cefb3a Author: Uwe Kleine-König Date: Tue Sep 19 19:48:57 2023 +0200 iio: adc: mp2629: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-16-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit c0fe02aa5e69f3c09f72b943b8d0ad24c00d9a3f Author: Uwe Kleine-König Date: Tue Sep 19 19:48:56 2023 +0200 iio: adc: meson_saradc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-15-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 71e79bb48f2dd8147e13d574894c6b9641d843b4 Author: Uwe Kleine-König Date: Tue Sep 19 19:48:55 2023 +0200 iio: adc: imx93: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-14-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 7ed89f54f62f8318a65049954a8929ea98c2fe19 Author: Uwe Kleine-König Date: Tue Sep 19 19:48:54 2023 +0200 iio: adc: imx8qxp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-13-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit b7962fc9a5130842786b141a8d9bbaae347d94af Author: Uwe Kleine-König Date: Tue Sep 19 19:48:53 2023 +0200 iio: adc: hx711: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-12-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit cfac92804fd394a1b9d962825b12c989c56e4149 Author: Uwe Kleine-König Date: Tue Sep 19 19:48:52 2023 +0200 iio: adc: fsl-imx25-gcq: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-11-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 5c5b7b3f9e89a522ef026fc38c53e1827a731959 Author: Uwe Kleine-König Date: Tue Sep 19 19:48:51 2023 +0200 iio: adc: exynos: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-10-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit b8943902874c363ea48c101838baf4933c44836b Author: Uwe Kleine-König Date: Tue Sep 19 19:48:50 2023 +0200 iio: adc: ep93xx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Alexander Sverdlin Link: https://lore.kernel.org/r/20230919174931.1417681-9-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit cb299d2a561dfd6816d120deac096562d5f111b5 Author: Uwe Kleine-König Date: Tue Sep 19 19:48:49 2023 +0200 iio: adc: dln2: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-8-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit bf7c022b58e3e62087d563b8b69ba8354bde1fe0 Author: Uwe Kleine-König Date: Tue Sep 19 19:48:48 2023 +0200 iio: adc: bcm_iproc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20230919174931.1417681-7-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 5ff1f754009b00a2352e17c22f224e9d77dc6fa9 Author: Uwe Kleine-König Date: Tue Sep 19 19:48:47 2023 +0200 iio: adc: axp20x: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-6-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 3624d5fd3be2e3320b96086dc2c5e6c57255b333 Author: Uwe Kleine-König Date: Tue Sep 19 19:48:46 2023 +0200 iio: adc: at91: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-5-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit e5e92308c4691e39f57f3352ffd094ead4f4b569 Author: Uwe Kleine-König Date: Tue Sep 19 19:48:45 2023 +0200 iio: adc: at91-sama5d2: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-4-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 9cb1bcd4ea25b16035cb02b00b6c79d23a3a90f4 Author: Uwe Kleine-König Date: Tue Sep 19 19:48:44 2023 +0200 iio: adc: ab8500-gpadc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-3-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 53cb25c97be2fb859166f14c862f4d09e3c1e0c9 Author: Uwe Kleine-König Date: Tue Sep 19 19:48:43 2023 +0200 iio: accel: hid-sensor-accel-3d: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230919174931.1417681-2-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit f5cc9cdfc96fb1f26f986801cee473e2e68ba737 Author: Kees Cook Date: Fri Sep 22 10:50:47 2023 -0700 ALSA: usx2y: Annotate struct snd_usx2y_urb_seq with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct snd_usx2y_urb_seq. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230922175046.work.766-kees@kernel.org Signed-off-by: Takashi Iwai commit 81420faff0eb8603c6d5e5267455bddf70f20a95 Author: Kees Cook Date: Fri Sep 22 10:50:42 2023 -0700 ALSA: hda: Annotate struct hda_conn_list with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct hda_conn_list. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Cezary Rojewski Cc: alsa-devel@alsa-project.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230922175042.work.547-kees@kernel.org Signed-off-by: Takashi Iwai commit 1f597b1a6ec28f848fc236f17f246c4cac7aa8cc Author: Carlos Bilbao Date: Thu Sep 14 11:20:46 2023 -0500 docs: security: Confidential computing intro and threat model for x86 virtualization Kernel developers working on confidential computing for virtualized environments in x86 operate under a set of assumptions regarding the Linux kernel threat model that differs from the traditional view. Historically, the Linux threat model acknowledges attackers residing in userspace, as well as a limited set of external attackers that are able to interact with the kernel through networking or limited HW-specific exposed interfaces (e.g. USB, thunderbolt). The goal of this document is to explain additional attack vectors that arise in the virtualized confidential computing space. Reviewed-by: Larry Dewey Reviewed-by: David Kaplan Co-developed-by: Elena Reshetova Signed-off-by: Elena Reshetova Signed-off-by: Carlos Bilbao Message-ID: <98804f27-c2e7-74d6-d671-1eda927e19fe@amd.com> Signed-off-by: Jonathan Corbet commit 42b37783e2f6f806d4d5cd7e44d1b9016d93e5d9 Author: Avadhut Naik Date: Thu Sep 14 12:47:52 2023 -0500 docs/sp_SP: Add translation of process/embargoed-hardware-issues Translate Documentation/process/embargoed-hardware-issues.rst into Spanish Signed-off-by: Avadhut Naik Reviewed-by: Carlos Bilbao Signed-off-by: Jonathan Corbet Message-ID: <20230914174752.3091407-3-avadhut.naik@amd.com> commit d059d4c601544e4731c18e0e4ce85c67c6e782d4 Author: Avadhut Naik Date: Thu Sep 14 12:47:51 2023 -0500 docs/sp_SP: Add translation of process/security-bugs Translate Documentation/process/security-bugs.rst into Spanish Signed-off-by: Avadhut Naik Reviewed-by: Carlos Bilbao Signed-off-by: Jonathan Corbet Message-ID: <20230914174752.3091407-2-avadhut.naik@amd.com> commit 831916fb93d4b99bd5f18b8530708b88d901a522 Merge: ac0691c75ab78 7089f85a9eb94 Author: Andrii Nakryiko Date: Fri Sep 22 14:18:56 2023 -0700 Merge branch 'libbpf: Support symbol versioning for uprobe' Hengqi Chen says: ==================== Dynamic symbols in shared library may have the same name, for example: $ nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep rwlock_wrlock 000000000009b1a0 T __pthread_rwlock_wrlock@GLIBC_2.2.5 000000000009b1a0 T pthread_rwlock_wrlock@@GLIBC_2.34 000000000009b1a0 T pthread_rwlock_wrlock@GLIBC_2.2.5 $ readelf -W --dyn-syms /lib/x86_64-linux-gnu/libc.so.6 | grep rwlock_wrlock 706: 000000000009b1a0 878 FUNC GLOBAL DEFAULT 15 __pthread_rwlock_wrlock@GLIBC_2.2.5 2568: 000000000009b1a0 878 FUNC GLOBAL DEFAULT 15 pthread_rwlock_wrlock@@GLIBC_2.34 2571: 000000000009b1a0 878 FUNC GLOBAL DEFAULT 15 pthread_rwlock_wrlock@GLIBC_2.2.5 There are two pthread_rwlock_wrlock symbols in libc.so .dynsym section. The one with @@ is the default version, the other is hidden. Note that the version info is stored in .gnu.version and .gnu.version_d sections of libc and the two symbols are at the _same_ offset. Currently, specify `pthread_rwlock_wrlock`, `pthread_rwlock_wrlock@@GLIBC_2.34` or `pthread_rwlock_wrlock@GLIBC_2.2.5` in bpf_uprobe_opts::func_name won't work. Because there are two `pthread_rwlock_wrlock` in .dynsym sections without the version suffix and both are global bind. We could solve this by introducing symbol versioning ([0]). So that users can specify func, func@LIB_VERSION or func@@LIB_VERSION to attach a uprobe. This patchset resolves symbol conflicts and add symbol versioning for uprobe. - Patch 1 resolves symbol conflicts at the same offset - Patch 2 adds symbol versioning for dynsym - Patch 3 adds selftests for the above changes Changes from v3: - Address comments from Andrii Changes from v2: - Add uretprobe selfttest (Alan) - Check symbol exact match (Alan) - Fix typo (Jiri) Changes from v1: - Address comments from Alan and Jiri - Add selftests (Someone reminds me that there is an attempt at [1] and part of the selftest code from Andrii is taken from there) [0]: https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/symversion.html [1]: https://lore.kernel.org/lkml/CAEf4BzZTrjjyyOm3ak9JsssPSh6T_ZmGd677a2rt5e5rBLUrpQ@mail.gmail.com/ ==================== Signed-off-by: Andrii Nakryiko commit 7089f85a9eb943716052bb91bd65ce939976ebfa Author: Hengqi Chen Date: Mon Sep 18 02:48:13 2023 +0000 selftests/bpf: Add tests for symbol versioning for uprobe This exercises the newly added dynsym symbol versioning logics. Now we accept symbols in form of func, func@LIB_VERSION or func@@LIB_VERSION. The test rely on liburandom_read.so. For liburandom_read.so, we have: $ nm -D liburandom_read.so w __cxa_finalize@GLIBC_2.17 w __gmon_start__ w _ITM_deregisterTMCloneTable w _ITM_registerTMCloneTable 0000000000000000 A LIBURANDOM_READ_1.0.0 0000000000000000 A LIBURANDOM_READ_2.0.0 000000000000081c T urandlib_api@@LIBURANDOM_READ_2.0.0 0000000000000814 T urandlib_api@LIBURANDOM_READ_1.0.0 0000000000000824 T urandlib_api_sameoffset@LIBURANDOM_READ_1.0.0 0000000000000824 T urandlib_api_sameoffset@@LIBURANDOM_READ_2.0.0 000000000000082c T urandlib_read_without_sema@@LIBURANDOM_READ_1.0.0 00000000000007c4 T urandlib_read_with_sema@@LIBURANDOM_READ_1.0.0 0000000000011018 D urandlib_read_with_sema_semaphore@@LIBURANDOM_READ_1.0.0 For `urandlib_api`, specifying `urandlib_api` will cause a conflict because there are two symbols named urandlib_api and both are global bind. For `urandlib_api_sameoffset`, there are also two symbols in the .so, but both are at the same offset and essentially they refer to the same function so no conflict. Signed-off-by: Hengqi Chen Signed-off-by: Andrii Nakryiko Reviewed-by: Alan Maguire Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20230918024813.237475-4-hengqi.chen@gmail.com commit bb7fa09399b937cdc4432ac99f9748f5a7f69389 Author: Hengqi Chen Date: Mon Sep 18 02:48:12 2023 +0000 libbpf: Support symbol versioning for uprobe In current implementation, we assume that symbol found in .dynsym section would have a version suffix and use it to compare with symbol user supplied. According to the spec ([0]), this assumption is incorrect, the version info of dynamic symbols are stored in .gnu.version and .gnu.version_d sections of ELF objects. For example: $ nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep rwlock_wrlock 000000000009b1a0 T __pthread_rwlock_wrlock@GLIBC_2.2.5 000000000009b1a0 T pthread_rwlock_wrlock@@GLIBC_2.34 000000000009b1a0 T pthread_rwlock_wrlock@GLIBC_2.2.5 $ readelf -W --dyn-syms /lib/x86_64-linux-gnu/libc.so.6 | grep rwlock_wrlock 706: 000000000009b1a0 878 FUNC GLOBAL DEFAULT 15 __pthread_rwlock_wrlock@GLIBC_2.2.5 2568: 000000000009b1a0 878 FUNC GLOBAL DEFAULT 15 pthread_rwlock_wrlock@@GLIBC_2.34 2571: 000000000009b1a0 878 FUNC GLOBAL DEFAULT 15 pthread_rwlock_wrlock@GLIBC_2.2.5 In this case, specify pthread_rwlock_wrlock@@GLIBC_2.34 or pthread_rwlock_wrlock@GLIBC_2.2.5 in bpf_uprobe_opts::func_name won't work. Because the qualified name does NOT match `pthread_rwlock_wrlock` (without version suffix) in .dynsym sections. This commit implements the symbol versioning for dynsym and allows user to specify symbol in the following forms: - func - func@LIB_VERSION - func@@LIB_VERSION In case of symbol conflicts, error out and users should resolve it by specifying a qualified name. [0]: https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/symversion.html Signed-off-by: Hengqi Chen Signed-off-by: Andrii Nakryiko Reviewed-by: Alan Maguire Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20230918024813.237475-3-hengqi.chen@gmail.com commit 7257cee65269a066c242f4863b456275cb0218b5 Author: Hengqi Chen Date: Mon Sep 18 02:48:11 2023 +0000 libbpf: Resolve symbol conflicts at the same offset for uprobe Dynamic symbols in shared library may have the same name, for example: $ nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep rwlock_wrlock 000000000009b1a0 T __pthread_rwlock_wrlock@GLIBC_2.2.5 000000000009b1a0 T pthread_rwlock_wrlock@@GLIBC_2.34 000000000009b1a0 T pthread_rwlock_wrlock@GLIBC_2.2.5 $ readelf -W --dyn-syms /lib/x86_64-linux-gnu/libc.so.6 | grep rwlock_wrlock 706: 000000000009b1a0 878 FUNC GLOBAL DEFAULT 15 __pthread_rwlock_wrlock@GLIBC_2.2.5 2568: 000000000009b1a0 878 FUNC GLOBAL DEFAULT 15 pthread_rwlock_wrlock@@GLIBC_2.34 2571: 000000000009b1a0 878 FUNC GLOBAL DEFAULT 15 pthread_rwlock_wrlock@GLIBC_2.2.5 Currently, users can't attach a uprobe to pthread_rwlock_wrlock because there are two symbols named pthread_rwlock_wrlock and both are global bind. And libbpf considers it as a conflict. Since both of them are at the same offset we could accept one of them harmlessly. Note that we already does this in elf_resolve_syms_offsets. Signed-off-by: Hengqi Chen Signed-off-by: Andrii Nakryiko Reviewed-by: Alan Maguire Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20230918024813.237475-2-hengqi.chen@gmail.com commit de1ca06bc0364a58ba0889d97a7a094d87dd5477 Author: Kees Cook Date: Fri Sep 22 10:53:58 2023 -0700 power: supply: axp20x_usb_power: Annotate struct axp20x_usb_power with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct axp20x_usb_power. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Chen-Yu Tsai Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230922175358.work.774-kees@kernel.org Signed-off-by: Sebastian Reichel commit 7daa3bd4b0b4de1446cd4e6a66bba022101ae9ee Author: Kees Cook Date: Fri Sep 22 10:53:55 2023 -0700 power: supply: axp20x_ac_power: Annotate struct axp20x_ac_power with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct axp20x_ac_power. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Chen-Yu Tsai Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230922175355.work.006-kees@kernel.org Signed-off-by: Sebastian Reichel commit bc17fd92c1eb7589f1f3df1893e9f62bb35b8cc8 Author: Tengfei Fan Date: Fri Sep 22 16:10:21 2023 +0800 dt-bindings: interrupt-controller: qcom,pdc: document qcom,sm4450-pdc Add SM4450 PDC, which will used in SM4450 DTS. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Tengfei Fan Link: https://lore.kernel.org/r/20230922081026.2799-2-quic_tengfan@quicinc.com Signed-off-by: Rob Herring commit e887544d7620f1d3cef017e45df7bc625182caff Author: Kees Cook Date: Fri Sep 15 13:03:28 2023 -0700 md/md-linear: Annotate struct linear_conf with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct linear_conf. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Song Liu Cc: linux-raid@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230915200328.never.064-kees@kernel.org commit c40897f4730f4f9a37f3155e3e0452e1c8da37b4 Author: Kees Cook Date: Fri Sep 22 10:53:23 2023 -0700 spi: mchp-pci1xxxx: Annotate struct pci1xxxx_spi with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct pci1xxxx_spi. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Mark Brown Cc: linux-spi@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230922175322.work.170-kees@kernel.org Signed-off-by: Mark Brown commit 6e6891ccf0c7e70f13bc1d5ce5a7edee2b5de045 Author: Kees Cook Date: Fri Sep 22 10:54:02 2023 -0700 regulator: mc13xxx: Annotate struct mc13xxx_regulator_priv with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct mc13xxx_regulator_priv. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Liam Girdwood Cc: Mark Brown Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230922175402.work.819-kees@kernel.org Signed-off-by: Mark Brown commit 909b583f81b5bb5a398d4580543f59b908a86ccc Author: Oliver Upton Date: Wed Sep 20 08:01:33 2023 +0000 KVM: arm64: Avoid soft lockups due to I-cache maintenance Gavin reports of soft lockups on his Ampere Altra Max machine when backing KVM guests with hugetlb pages. Upon further investigation, it was found that the system is unable to keep up with parallel I-cache invalidations done by KVM's stage-2 fault handler. This is ultimately an implementation problem. I-cache maintenance instructions are available at EL0, so nothing stops a malicious userspace from hammering a system with CMOs and cause it to fall over. "Fixing" this problem in KVM is nothing more than slapping a bandage over a much deeper problem. Anyway, the kernel already has a heuristic for limiting TLB invalidations to avoid soft lockups. Reuse that logic to limit I-cache CMOs done by KVM to map executable pages on systems without FEAT_DIC. While at it, restructure __invalidate_icache_guest_page() to improve readability and squeeze our new condition into the existing branching structure. Link: https://lore.kernel.org/kvmarm/20230904072826.1468907-1-gshan@redhat.com/ Reviewed-by: Gavin Shan Tested-by: Gavin Shan Link: https://lore.kernel.org/r/20230920080133.944717-3-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit ec1c3b9ff16082f880b304be40992568f4eee6a7 Author: Oliver Upton Date: Wed Sep 20 08:01:32 2023 +0000 arm64: tlbflush: Rename MAX_TLBI_OPS Perhaps unsurprisingly, I-cache invalidations suffer from performance issues similar to TLB invalidations on certain systems. TLB and I-cache maintenance all result in DVM on the mesh, which is where the real bottleneck lies. Rename the heuristic to point the finger at DVM, such that it may be reused for limiting I-cache invalidations. Reviewed-by: Gavin Shan Tested-by: Gavin Shan Acked-by: Will Deacon Link: https://lore.kernel.org/r/20230920080133.944717-2-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 39fce972fd7259395663586e59388d702afec30e Author: Bragatheswaran Manickavel Date: Fri Sep 22 00:03:13 2023 +0530 ASoC: dt-bindings: tfa9879: Convert to dtschema Convert the tfa9879 audio CODEC bindings to DT schema No error/warning seen when running make dt_binding_check Signed-off-by: Bragatheswaran Manickavel Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230921183313.54112-1-bragathemanick0908@gmail.com Signed-off-by: Mark Brown commit 54d21eb6ad5e57e70157590397ba01b9faed6b59 Author: Yu Kuai Date: Fri Aug 25 11:09:56 2023 +0800 md: don't check 'mddev->pers' and 'pers->quiesce' from suspend_lo_store() Now that mddev_suspend() doean't rely on 'mddev->pers' to be set, it's safe to remove such checking. This will also allow the array to be suspended even before the array is ran. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825030956.1527023-8-yukuai1@huaweicloud.com commit a2a9f16838509475ea6801f7794a89e03d55e3ed Author: Yu Kuai Date: Fri Aug 25 11:09:55 2023 +0800 md: don't check 'mddev->pers' from suspend_hi_store() Now that mddev_suspend() doean't rely on 'mddev->pers' to be set, it's safe to remove such checking. This will also allow the array to be suspended even before the array is ran. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825030956.1527023-7-yukuai1@huaweicloud.com commit 158d32af8710777b146f5303a5ca066b493d18e8 Author: Yu Kuai Date: Fri Aug 25 11:09:54 2023 +0800 md-bitmap: suspend array earlier in location_store() Now that mddev_suspend() doean't rely on 'mddev->pers' to be set, it's safe to call mddev_suspend() earlier. This will also be helper to refactor mddev_suspend() later. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825030956.1527023-6-yukuai1@huaweicloud.com commit b71fe4ac7531d67e6fc8c287cbcb2b176aa93833 Author: Yu Kuai Date: Fri Aug 25 11:09:53 2023 +0800 md-bitmap: remove the checking of 'pers->quiesce' from location_store() After commit 4d27e927344a ("md: don't quiesce in mddev_suspend()"), there is no need to check 'pers->quiesce' before calling mddev_suspend(). Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825030956.1527023-5-yukuai1@huaweicloud.com commit b721e7885eb242aa2459ee66bb42ceef1bcf0f0c Author: Yu Kuai Date: Fri Aug 25 11:09:52 2023 +0800 md: don't rely on 'mddev->pers' to be set in mddev_suspend() 'active_io' used to be initialized while the array is running, and 'mddev->pers' is set while the array is running as well. Hence caller must hold 'reconfig_mutex' and guarantee 'mddev->pers' is set before calling mddev_suspend(). Now that 'active_io' is initialized when mddev is allocated, such restriction doesn't exist anymore. In the meantime, follow up patches will refactor mddev_suspend(), hence add checking for 'mddev->pers' to prevent null-ptr-deref. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825030956.1527023-4-yukuai1@huaweicloud.com commit b8494823e236326500aa1004155e83f748dd10da Author: Yu Kuai Date: Fri Aug 25 11:09:51 2023 +0800 md: initialize 'writes_pending' while allocating mddev Currently 'writes_pending' is initialized in pers->run for raid1/5/10, and it's freed while deleing mddev, instead of pers->free. pers->run can be called multiple times before mddev is deleted, and a helper mddev_init_writes_pending() is used to prevent 'writes_pending' to be initialized multiple times, this usage is safe but a litter weird. On the other hand, 'writes_pending' is only initialized for raid1/5/10, however, it's used in common layer, for example: array_state_store set_in_sync if (!mddev->in_sync) -> in_sync is used for all levels // access writes_pending There might be some implicit dependency that I don't recognized to make sure 'writes_pending' can only be accessed for raid1/5/10, but there are no comments about that. By the way, it make sense to initialize 'writes_pending' in common layer because there are already three levels use it. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825030956.1527023-3-yukuai1@huaweicloud.com commit d58eff83bd3c6166944f6b159544438385d48549 Author: Yu Kuai Date: Fri Aug 25 11:09:50 2023 +0800 md: initialize 'active_io' while allocating mddev 'active_io' is used for mddev_suspend() and it's initialized in md_run(), this restrict that 'reconfig_mutex' must be held and "mddev->pers" must be set before calling mddev_suspend(). Initialize 'active_io' early so that mddev_suspend() is safe to call once mddev is allocated, this will be helpful to refactor mddev_suspend() in following patches. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825030956.1527023-2-yukuai1@huaweicloud.com commit 81e2ce1b3d5a896e24fe5af83896fec057860a25 Author: Yu Kuai Date: Fri Aug 25 11:16:22 2023 +0800 md: delay remove_and_add_spares() for read only array to md_start_sync() Before this patch, for read-only array: md_check_recovery() check that 'MD_RECOVERY_NEEDED' is set, then it will call remove_and_add_spares() directly to try to remove and add rdevs from array. After this patch: 1) md_check_recovery() check that 'MD_RECOVERY_NEEDED' is set, and the worker 'sync_work' is not pending, and there are rdevs can be added or removed, then it will queue new work md_start_sync(); 2) md_start_sync() will call remove_and_add_spares() and exist; This change make sure that array reconfiguration is independent from daemon, and it'll be much easier to synchronize it with io, consier that io may rely on daemon thread to be done. Also fix a problem that 'pers->spars_active' is called after remove_and_add_spares(), which order is wrong, because spares must active first, and then remove_and_add_spares() can add spares to the array, like what read-write case does: 1) daemon set 'MD_RECOVERY_RUNNING', register new sync thread to do recovery; 2) recovery is done, md_do_sync() set 'MD_RECOVERY_DONE' before return; 3) daemon call 'pers->spars_active', and clear 'MD_RECOVERY_RUNNING'; 4) in the next round of daemon, call remove_and_add_spares() to add spares to the array. Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825031622.1530464-8-yukuai1@huaweicloud.com commit a0ae7e4e0bc00ae178e42391157e8ddb88b2838a Author: Yu Kuai Date: Fri Aug 25 11:16:21 2023 +0800 md: factor out a helper rdev_addable() from remove_and_add_spares() There are no functional changes, just to make the code simpler and prepare to delay remove_and_add_spares() to md_start_sync(). Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825031622.1530464-7-yukuai1@huaweicloud.com commit b172a0704d0ddea3a55f3633f8249c3ce7d960bc Author: Yu Kuai Date: Fri Aug 25 11:16:20 2023 +0800 md: factor out a helper rdev_is_spare() from remove_and_add_spares() There are no functional changes, just to make the code simpler and prepare to delay remove_and_add_spares() to md_start_sync(). Signed-off-by: Yu Kuai Reviewed-by: Xiao Ni Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825031622.1530464-6-yukuai1@huaweicloud.com commit 3389d57f97531efe9e285a0740c9b767d6f29f6c Author: Yu Kuai Date: Fri Aug 25 11:16:19 2023 +0800 md: factor out a helper rdev_removeable() from remove_and_add_spares() There are no functional changes, just to make the code simpler and prepare to delay remove_and_add_spares() to md_start_sync(). Signed-off-by: Yu Kuai Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825031622.1530464-5-yukuai1@huaweicloud.com commit db5e653d7c9fae8ed61da58ab5e9a8db2cd61a2b Author: Yu Kuai Date: Fri Aug 25 11:16:18 2023 +0800 md: delay choosing sync action to md_start_sync() Before this patch, for read-write array: 1) md_check_recover() found that something need to be done, and it'll try to grab 'reconfig_mutex'. The case that md_check_recover() need to do something: - array is not suspend; - super_block need to be updated; - 'MD_RECOVERY_NEEDED' or 'MD_RECOVERY_DONE' is set; - unusual case related to safemode; 2) if 'MD_RECOVERY_RUNNING' is not set, and 'MD_RECOVERY_NEEDED' is set, md_check_recover() will try to choose a sync action, and then queue a work md_start_sync(). 3) md_start_sync() register sync_thread; After this patch, 1) is the same; 2) if 'MD_RECOVERY_RUNNING' is not set, and 'MD_RECOVERY_NEEDED' is set, queue a work md_start_sync() directly; 3) md_start_sync() will try to choose a sync action, and then register sync_thread(); Because 'MD_RECOVERY_RUNNING' is cleared when sync_thread is done, 2) and 3) and md_do_sync() is always ran in serial and they can never concurrent, this change should not introduce any behavior change for now. Also fix a problem that md_start_sync() can clear 'MD_RECOVERY_RUNNING' without protection in error path, which might affect the logical in md_check_recovery(). The advantage to change this is that array reconfiguration is independent from daemon now, and it'll be much easier to synchronize it with io, consider that io may rely on daemon thread to be done. Signed-off-by: Yu Kuai Reviewed-by: Xiao Ni Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825031622.1530464-4-yukuai1@huaweicloud.com commit 897c62a1cae6485870a45934b22c180016a0570f Author: Yu Kuai Date: Fri Aug 25 11:16:17 2023 +0800 md: factor out a helper to choose sync action from md_check_recovery() There are no functional changes, on the one hand make the code cleaner, on the other hand prevent following checkpatch error in the next patch to delay choosing sync action to md_start_sync(). ERROR: do not use assignment in if condition + } else if ((spares = remove_and_add_spares(mddev, NULL))) { Signed-off-by: Yu Kuai Reviewed-by: Xiao Ni Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825031622.1530464-3-yukuai1@huaweicloud.com commit ac619781967bd5663c29606246b50dbebd8b3473 Author: Yu Kuai Date: Fri Aug 25 11:16:16 2023 +0800 md: use separate work_struct for md_start_sync() It's a little weird to borrow 'del_work' for md_start_sync(), declare a new work_struct 'sync_work' for md_start_sync(). Signed-off-by: Yu Kuai Reviewed-by: Xiao Ni Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230825031622.1530464-2-yukuai1@huaweicloud.com commit 6cd59324c69a8d30956c70a870dcd0cb14977914 Author: Azeem Shaikh Date: Thu Aug 31 14:01:04 2023 +0000 kobject: Replace strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). Direct replacement is safe here since return value of -errno is used to check for truncation instead of sizeof(dest). [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230831140104.207019-1-azeemshaikh38@gmail.com Signed-off-by: Kees Cook commit 8ebab155ea18a6d6c47b17287a0ab4633334f6eb Author: Azeem Shaikh Date: Wed Aug 30 16:08:06 2023 +0000 init/version.c: Replace strlcpy with strscpy strlcpy() reads the entire source buffer first. This read may exceed the destination size limit. This is both inefficient and can lead to linear read overflows if a source string is not NUL-terminated [1]. In an effort to remove strlcpy() completely [2], replace strlcpy() here with strscpy(). Direct replacement is safe here since return value of -errno is used to check for truncation instead of sizeof(dest). [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy [2] https://github.com/KSPP/linux/issues/89 Signed-off-by: Azeem Shaikh Reviewed-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230830160806.3821893-1-azeemshaikh38@gmail.com Signed-off-by: Kees Cook commit 215199e3d9f3dc01a6d10b8229891e6f7f1085e7 Author: Kees Cook Date: Thu Aug 24 21:25:55 2023 -0700 hardening: Provide Kconfig fragments for basic options Inspired by Salvatore Mesoraca's earlier[1] efforts to provide some in-tree guidance for kernel hardening Kconfig options, add a new fragment named "hardening-basic.config" (along with some arch-specific fragments) that enable a basic set of kernel hardening options that have the least (or no) performance impact and remove a reasonable set of legacy APIs. Using this fragment is as simple as running "make hardening.config". More extreme fragments can be added[2] in the future to cover all the recognized hardening options, and more per-architecture files can be added too. For now, document the fragments directly via comments. Perhaps .rst documentation can be generated from them in the future (rather than the other way around). [1] https://lore.kernel.org/kernel-hardening/1536516257-30871-1-git-send-email-s.mesoraca16@gmail.com/ [2] https://github.com/KSPP/linux/issues/14 Cc: Salvatore Mesoraca Cc: x86@kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-doc@vger.kernel.org Cc: linux-kbuild@vger.kernel.org Signed-off-by: Kees Cook commit 217b812364d360e1933d8485f063400e5dda7d66 Author: Pranjal Ramajor Asha Kanojiya Date: Fri Sep 1 11:22:47 2023 -0600 accel/qaic: Add QAIC_DETACH_SLICE_BO IOCTL Once a BO is attached with slicing configuration that BO can only be used for that particular setting. With this new feature user can detach slicing configuration off an already sliced BO and attach new slicing configuration using QAIC_ATTACH_SLICE_BO. This will support BO recycling. detach_slice_bo() detaches slicing configuration from a BO. This new helper function can also be used in release_dbc() as we are doing the exact same thing. Signed-off-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Jeffrey Hugo [jhugo: add documentation for new ioctl] Signed-off-by: Jeffrey Hugo Reviewed-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901172247.11410-8-quic_jhugo@quicinc.com commit b2576f6cf6da6adde5c698aa281c883f2376b876 Author: Pranjal Ramajor Asha Kanojiya Date: Fri Sep 1 11:22:46 2023 -0600 accel/qaic: Create a function to initialize BO This makes sure that we have a single place to initialize and re-initialize BO. Use this new API to cleanup release_dbc() We will need this for next patch to detach slicing to a BO. Signed-off-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Jeffrey Hugo Signed-off-by: Jeffrey Hugo Reviewed-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901172247.11410-7-quic_jhugo@quicinc.com commit 0a9ee93b8294e479f9ee845241246a83477233b3 Author: Pranjal Ramajor Asha Kanojiya Date: Fri Sep 1 11:22:45 2023 -0600 accel/qaic: Clean up BO during flushing of transfer list Variables that are set while adding the corresponding BO in transfer list should be cleaned when flushing them out of transfer list prematurely. After this patch we do not need some of the cleanup done in release_dbc() This patch would also pave the way to have a central location to clean BO, during an undesired situation. Signed-off-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Jeffrey Hugo Signed-off-by: Jeffrey Hugo Reviewed-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901172247.11410-6-quic_jhugo@quicinc.com commit b3107e75a96ee17a510deabf4b00b0c37d2351d4 Author: Pranjal Ramajor Asha Kanojiya Date: Fri Sep 1 11:22:44 2023 -0600 accel/qaic: Undo slicing setup done in qaic_attach_slicing_bo() qaic_attach_slicing_bo() updates slicing config on BO. Use the existing function qaic_free_slices_bo() to remove slicing config done in qaic_attach_slicing_bo(). Use qaic_free_slices_bo() to cleanup release_dbc() This would be helpful when we introduce a new IOCTL to detach slicing configuration onto a BO. Signed-off-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Jeffrey Hugo Signed-off-by: Jeffrey Hugo Reviewed-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901172247.11410-5-quic_jhugo@quicinc.com commit 77f71e153f09acef574dffc4298eac7822407665 Author: Pranjal Ramajor Asha Kanojiya Date: Fri Sep 1 11:22:43 2023 -0600 accel/qaic: Declare BO 'sliced' after all the operations are complete Once the BO is declared 'sliced' by setting bo->sliced to true we can perform DMA (QAIC_EXECUTE_BO) operation on that BO. Hence we should declare a BO sliced after completing all the operations. Adding BO to its respective DBC list in qaic_attach_slicing_bo() seems out of place as qaic_attach_slicing_bo() should just update BO with slicing configuration. Signed-off-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Jeffrey Hugo Signed-off-by: Jeffrey Hugo Reviewed-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901172247.11410-4-quic_jhugo@quicinc.com commit 76d42aa951aefbad2490551a35bd8496bd7b65bf Author: Pranjal Ramajor Asha Kanojiya Date: Fri Sep 1 11:22:42 2023 -0600 accel/qaic: Update BO metadata in a central location Update/Clean up BO metadata in a central location, this will help maintain the code and looks cleaner. Use qaic_unprepare_bo() to cleanup release_dbc() Next few patches will be implementing detach IOCTL which will leverage this patch. Signed-off-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Jeffrey Hugo Signed-off-by: Jeffrey Hugo Reviewed-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901172247.11410-3-quic_jhugo@quicinc.com commit cb850f6f69d1ee03ca4a5746df2870cf49e90871 Author: Pranjal Ramajor Asha Kanojiya Date: Fri Sep 1 11:22:41 2023 -0600 accel/qaic: Remove ->size field from struct qaic_bo ->size field in struct qaic_bo stores user requested buffer size for allocate path or size of the dmabuf(PRIME). Now for allocate path driver allocates a BO of size which is PAGE_SIZE aligned, this size is already stored in base BO structure (struct drm_gem_object). So difference is ->size of struct qaic_bo stores the raw value coming from user and ->size in struct drm_gem_object stores the PAGE_SZIE aligned size. Do not use ->size from struct qaic_bo for any validation or operation instead use ->size from struct drm_gem_object since we already have allocated that much memory then why not use it. Only validate if user is trying to use more then the BO size. This make the driver more flexible. After this change ->size field of struct qaic_bo becomes redundant. Remove it. Signed-off-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Jeffrey Hugo Signed-off-by: Jeffrey Hugo Reviewed-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901172247.11410-2-quic_jhugo@quicinc.com commit 6a18ae51d2655b1fe32a135d674d6b863eaf3bdf Author: Balasubramani Vivekanandan Date: Thu Sep 21 16:29:54 2023 +0530 drm/i915/display: Print display info inside driver display initialization Separate the printing of display version and feature flags from the main driver probe to inside the display initialization. This is in alignment with isolating the display code from the main driver and helps Xe driver to resuse it. v2: Replace drm_info_printer with drm_debug_printer (Jani) Signed-off-by: Balasubramani Vivekanandan Reviewed-by: Jani Nikula Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20230921105954.2002469-1-balasubramani.vivekanandan@intel.com commit d78bfa1346ab1fe04d20aa45a0678d1fc866f37c Author: Chengming Zhou Date: Wed Sep 13 15:16:16 2023 +0000 block/null_blk: add queue_rqs() support Add batched mq_ops.queue_rqs() support in null_blk for testing. The implementation is much easy since null_blk doesn't have commit_rqs(). We simply handle each request one by one, if errors are encountered, leave them in the passed in list and return back. There is about 3.6% improvement in IOPS of fio/t/io_uring on null_blk with hw_queue_depth=256 on my test VM, from 1.09M to 1.13M. Signed-off-by: Chengming Zhou Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20230913151616.3164338-6-chengming.zhou@linux.dev Signed-off-by: Jens Axboe commit 217b613a53d3a430aa2e5d1523819dc271f02ff0 Author: Chengming Zhou Date: Wed Sep 13 15:16:15 2023 +0000 blk-mq: update driver tags request table when start request Now we update driver tags request table in blk_mq_get_driver_tag(), so the driver that support queue_rqs() have to update that inflight table by itself. Move it to blk_mq_start_request(), which is a better place where we setup the deadline for request timeout check. And it's just where the request becomes inflight. Signed-off-by: Chengming Zhou Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20230913151616.3164338-5-chengming.zhou@linux.dev Signed-off-by: Jens Axboe commit 434097ee375fff36bc5037524609ffd6199f11da Author: Chengming Zhou Date: Wed Sep 13 15:16:14 2023 +0000 blk-mq: support batched queue_rqs() on shared tags queue Since active requests have been accounted when allocate driver tags, we can remove this limit now. Signed-off-by: Chengming Zhou Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20230913151616.3164338-4-chengming.zhou@linux.dev Signed-off-by: Jens Axboe commit 48554df6bf2b1e83f70749bf4b4d7914f8b3c01d Author: Chengming Zhou Date: Wed Sep 13 15:16:13 2023 +0000 blk-mq: remove RQF_MQ_INFLIGHT Since the previous patch change to only account active requests when we really allocate the driver tag, the RQF_MQ_INFLIGHT can be removed and no double account problem. 1. none elevator: flush request will use the first pending request's driver tag, won't double account. 2. other elevator: flush request will be accounted when allocate driver tag when issue, and will be unaccounted when it put the driver tag. Signed-off-by: Chengming Zhou Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20230913151616.3164338-3-chengming.zhou@linux.dev Signed-off-by: Jens Axboe commit b8643d682669994b3f57c3440df3d4f9cb735f35 Author: Chengming Zhou Date: Wed Sep 13 15:16:12 2023 +0000 blk-mq: account active requests when get driver tag There is a limit that batched queue_rqs() can't work on shared tags queue, since the account of active requests can't be done there. Now we account the active requests only in blk_mq_get_driver_tag(), which is not the time we get driver tag actually (with none elevator). To support batched queue_rqs() on shared tags queue, we move the account of active requests to where we get the driver tag: 1. none elevator: blk_mq_get_tags() and blk_mq_get_tag() 2. other elevator: __blk_mq_alloc_driver_tag() This is clearer and match with the unaccount side, which just happen when we put the driver tag. The other good point is that we don't need RQF_MQ_INFLIGHT trick anymore, which used to avoid double account of flush request. Now we only account when actually get the driver tag, so all is good. We will remove RQF_MQ_INFLIGHT in the next patch. Signed-off-by: Chengming Zhou Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20230913151616.3164338-2-chengming.zhou@linux.dev Signed-off-by: Jens Axboe commit 3cff177fc2793a362d784c912f536e69a755925e Author: Shivamurthy Shastri Date: Tue Sep 19 13:33:20 2023 +0200 mtd: map_ram: prevent use of point and unpoint when NO_XIP is set When the DT property no-unaligned-direct-access is set, map->phys is set to NO_XIP. With this property set, the flash should not be exposed directly to MTD users, since it cannot be mapped. map_ram() exposes the flash direct access unconditionally which leads to access errors (when the bus width does not match the RAM width). Therefore do not set point and unpoint when NO_XIP is set. Signed-off-by: Shivamurthy Shastri Reviewed-by: Benedikt Spranger Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230919113320.16953-1-shivamurthy.shastri@linutronix.de commit 28a05da765c0cd21654ef5fed3b53af5cd278d63 Author: Kees Cook Date: Fri Sep 15 13:13:01 2023 -0700 mtd: rawnand: sunxi: Annotate struct sunxi_nand_chip with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct sunxi_nand_chip. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: Chen-Yu Tsai Cc: Jernej Skrabec Cc: Samuel Holland Cc: Manuel Dipolt Cc: linux-mtd@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-sunxi@lists.linux.dev Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230915201300.never.057-kees@kernel.org commit cb5fce7d90a1d1c72a1179686989ef8f02aee8e4 Author: Kees Cook Date: Fri Sep 15 13:12:54 2023 -0700 mtd: rawnand: renesas: Annotate struct rnand_chip with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct rnand_chip. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org Cc: linux-renesas-soc@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230915201254.never.511-kees@kernel.org commit 627e79b7cf1e1488ca772720026d9cbfa3f90730 Author: Kees Cook Date: Fri Sep 15 13:12:49 2023 -0700 mtd: rawnand: meson: Annotate struct meson_nfc_nand_chip with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct meson_nfc_nand_chip. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Liang Yang Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: Neil Armstrong Cc: Kevin Hilman Cc: Jerome Brunet Cc: Martin Blumenstingl Cc: linux-mtd@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230915201249.never.509-kees@kernel.org commit a8eaf3ef549980719c5fcca257d5b220ac0f3f1b Author: Kees Cook Date: Fri Sep 15 13:12:43 2023 -0700 mtd: rawnand: marvell: Annotate struct marvell_nand_chip with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct marvell_nand_chip. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230915201243.never.235-kees@kernel.org commit e87f0d64c9063eb26337db79edeccbdd0710eb66 Author: Kees Cook Date: Fri Sep 15 13:12:35 2023 -0700 mtd: rawnand: ingenic: Annotate struct ingenic_nfc with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ingenic_nfc. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Paul Cercueil Cc: Harvey Hunt Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-mips@vger.kernel.org Cc: linux-mtd@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230915201234.never.868-kees@kernel.org commit 48ec74fd8af6d94becf6b53af0c49c888511ec38 Author: Kees Cook Date: Fri Sep 15 13:12:28 2023 -0700 mtd: rawnand: denali: Annotate struct denali_chip with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct denali_chip. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230915201227.never.483-kees@kernel.org commit 79c610ab40ec57de5d36acc2b72d28f7d46cdbf8 Author: Kees Cook Date: Fri Sep 15 13:12:20 2023 -0700 mtd: rawnand: atmel: Annotate struct atmel_nand with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct atmel_nand. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Tudor Ambarus Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Claudiu Beznea Cc: linux-mtd@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Tudor Ambarus Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230915201219.never.352-kees@kernel.org commit 1442d628d05c7aad86e5754fa554f32edc3e77a8 Author: Kees Cook Date: Fri Sep 15 13:12:06 2023 -0700 mtd: cfi: Annotate struct cfi_private with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct cfi_private. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230915201206.never.107-kees@kernel.org commit f1a9be986cedbef839062428e8e9b2bcc9c58af5 Author: Kees Cook Date: Fri Sep 15 13:12:00 2023 -0700 mtd: Annotate struct lpddr_private with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct lpddr_private. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230915201159.never.112-kees@kernel.org commit bdc4d17e1627e3b44f25b8f87509023dc2b438a2 Author: Vignesh Raman Date: Mon Sep 11 21:45:18 2023 +0530 arm64: dts: qcom: apq8016-sbc: Add overlay for usb host mode Due to the presence of the fastboot micro cable in the CI farm, it causes the hardware to remain in gadget mode instead of host mode. So it doesn't find the network, which results in failure to mount root fs via NFS. Add an overlay dtso file that sets the dr_mode to host, allowing the USB controllers to work in host mode. With commit 15d16d6dadf6 ("kbuild: Add generic rule to apply fdtoverlay"), overlay target can be used to simplify the build of DTB overlays. It uses fdtoverlay to merge base device tree with the overlay dtso. apq8016-sbc-usb-host.dtb file can be used by drm-ci, mesa-ci. Suggested-by: Dmitry Baryshkov Suggested-by: Maxime Ripard Signed-off-by: Helen Koike Signed-off-by: David Heidelberg Signed-off-by: Vignesh Raman Reviewed-by: Dmitry Baryshkov Acked-by: Helen Koike Link: https://lore.kernel.org/r/20230911161518.650726-1-vignesh.raman@collabora.com Signed-off-by: Bjorn Andersson commit 9cf16b380af5bab7d0952b9aad0601ebf986de69 Author: Christian Brauner Date: Fri Sep 22 13:49:05 2023 +0200 fsconfig: ensure that dirfd is set to aux The code in fs_param_is_fd() expects param->dirfd to be set to the fd that was used to set param->file to initialize result->uint_32. So make sure it's set so users like autofs using FSCONFIG_SET_FD with the new mount api can rely on this to be set to the correct value. Link: https://lore.kernel.org/lkml/20230922-vorbringen-spaghetti-946729122076@brauner Signed-off-by: Christian Brauner commit dede367149c48822c9f699291d71a3211c2a91bb Author: Ian Kent Date: Fri Sep 22 12:12:15 2023 +0800 autofs: fix protocol sub version setting There were a number of updates to protocol version 4, take account of that when setting the super block info sub version field. Signed-off-by: Ian Kent Reviewed-by: Bill O'Donnell Message-Id: <20230922041215.13675-9-raven@themaw.net> Signed-off-by: Christian Brauner commit e6ec453bd0f03a60a80f00f95ae2eaa260faa3c2 Author: Ian Kent Date: Fri Sep 22 12:12:14 2023 +0800 autofs: convert autofs to use the new mount api Convert the autofs filesystem to use the mount API. The conversion patch was originally written by David Howells. I have taken that patch and broken it into several patches in an effort to make the change easier to review. Signed-off-by: Ian Kent Reviewed-by: Bill O'Donnell Message-Id: <20230922041215.13675-8-raven@themaw.net> Signed-off-by: Christian Brauner commit 089f4eb003dc2265036aac99c02aa99d6b5c4ac7 Author: Andreas Gruenbacher Date: Wed Sep 20 18:17:39 2023 +0200 gfs2: Don't update inode timestamps for direct writes During direct reads and writes, the caller is holding the inode glock in deferred mode, which doesn't allow metadata updates. However, a previous change caused callers to update the inode modification time before carrying out direct writes, which caused the inode glock to be converted to exclusive mode for the timestamp update, only to be immediately converted back to deferred mode for the direct write. This locks out other direct readers and writers and wreaks havoc on performance. Fix that by reverting to not updating the inode modification time for direct writes. Signed-off-by: Andreas Gruenbacher commit 21d9067efc7fe94d2bc6f7c7ce71834d5766bbd8 Author: Andreas Gruenbacher Date: Wed Sep 20 20:07:06 2023 +0200 gfs2: Get rid of the gfs2_glock_is_held_* helpers Those helpers don't add any clarity and are easy to use wrong. Spell them out to make more obvious what's happening. Signed-off-by: Andreas Gruenbacher commit 41bd33df4e180bfe9d206685270cff34a9a71d62 Author: Kuan-Wei Chiu Date: Sun Sep 3 00:41:21 2023 +0800 docs: block: blk-mq.rst: correct places -> place Corrected a typo in the blk-mq.rst documentation where 'places' was incorrectly used instead of 'place'. Signed-off-by: Kuan-Wei Chiu Signed-off-by: Jonathan Corbet Message-ID: <20230902164121.2653109-1-visitorckw@gmail.com> commit e4c0138ab396c727e6d5ca83cfe2e3d5b00be97c Author: Mikko Rapeli Date: Mon Sep 4 14:32:14 2023 +0300 Documentation efi-stub.rst: fix arm64 EFI source location arch/arm64/kernel/efi-entry.S has been moved to drivers/firmware/efi/libstub/arm64-entry.S by commit v6.1-rc4-6-g4ef806096bdb and to drivers/firmware/efi/libstub/arm64.c by commit v6.2-rc3-6-g617861703830 Signed-off-by: Mikko Rapeli Acked-by: Ard Biesheuvel Signed-off-by: Jonathan Corbet Message-ID: <20230904113214.4147021-1-mikko.rapeli@linaro.org> commit 82ec73c7325bed221c63c7cf31c6b8ac2965f114 Author: Costa Shulyupin Date: Wed Sep 13 13:55:18 2023 +0300 docs: move leds under section Human interfaces from uncategorized list Signed-off-by: Costa Shulyupin Signed-off-by: Jonathan Corbet Message-ID: <20230913105519.675183-1-costa.shul@redhat.com> commit 9845f7409e6d5b0540cfd952083b610359ade7d7 Author: Charles Han Date: Mon Sep 18 15:19:05 2023 +0800 Documentation: xfs: Remove repeated word in comments Remove the repeated word "the" in comments. Signed-off-by: Charles Han Reviewed-by: "Darrick J. Wong" Reviewed: Dave Chinner Signed-off-by: "Matthew Wilcox (Oracle)" Signed-off-by: Jonathan Corbet commit d25e92d2aed9cdff2a2222e82412a53f70e17c1a Author: Wang Jinchao Date: Fri Sep 22 10:00:21 2023 +0800 memory-hotplug.rst: fix wrong /sys/device/ path Actually, it should be /sys/devices/ Signed-off-by: Wang Jinchao Reviewed-by: David Hildenbrand Signed-off-by: Jonathan Corbet Message-ID: commit cb7ab7854bc70942abed62d19d8c16d0064bf7dc Author: Justin Stitt Date: Thu Sep 21 07:58:48 2023 +0000 IB/qib: Replace deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We know `txselect_list` is expected to be NUL-terminated based on its use in `param_get_string()`: | int param_get_string(char *buffer, const struct kernel_param *kp) | { | const struct kparam_string *kps = kp->str; | return scnprintf(buffer, PAGE_SIZE, "%s\n", kps->string); | } Note that `txselect_list` is assigned to `kp_txselect`'s string field: | static struct kparam_string kp_txselect = { | .string = txselect_list, | .maxlen = MAX_ATTEN_LEN | }; Wherein it is then assigned the set and get methods: | module_param_call(txselect, setup_txselect, param_get_string, | &kp_txselect, S_IWUSR | S_IRUGO); Considering the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Link: https://lore.kernel.org/r/20230921-strncpy-drivers-infiniband-hw-qib-qib_iba7322-c-v1-1-373727763f5b@google.com Signed-off-by: Leon Romanovsky commit c2d0c5b28a77d549ea52c70cb828e3ae29dda24d Author: Justin Stitt Date: Thu Sep 21 07:17:47 2023 +0000 IB/hfi1: Replace deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We see that `buf` is expected to be NUL-terminated based on it's use within a trace event wherein `is_misc_err_name` and `is_various_name` map to `is_name` through `is_table`: | TRACE_EVENT(hfi1_interrupt, | TP_PROTO(struct hfi1_devdata *dd, const struct is_table *is_entry, | int src), | TP_ARGS(dd, is_entry, src), | TP_STRUCT__entry(DD_DEV_ENTRY(dd) | __array(char, buf, 64) | __field(int, src) | ), | TP_fast_assign(DD_DEV_ASSIGN(dd); | is_entry->is_name(__entry->buf, 64, | src - is_entry->start); | __entry->src = src; | ), | TP_printk("[%s] source: %s [%d]", __get_str(dev), __entry->buf, | __entry->src) | ); Considering the above, a suitable replacement is `strscpy_pad` due to the fact that it guarantees NUL-termination on the destination buffer while maintaining the NUL-padding behavior that strncpy provides. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Link: https://lore.kernel.org/r/20230921-strncpy-drivers-infiniband-hw-hfi1-chip-c-v1-1-37afcf4964d9@google.com Signed-off-by: Leon Romanovsky commit f0cc82ca116f5b710bc298ea9bbbdb05bae01f5c Author: Justin Stitt Date: Thu Sep 21 07:36:26 2023 +0000 RDMA/irdma: Replace deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy_pad` due to the fact that it guarantees NUL-termination on the destination buffer. It is unclear to me whether `i40iw_client.name` requires NUL-padding but have opted to keep the NUL-padding behavior that strncpy provides to ensure no functional change. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Link: https://lore.kernel.org/r/20230921-strncpy-drivers-infiniband-hw-irdma-i40iw_if-c-v1-1-22d87aef7186@google.com Signed-off-by: Leon Romanovsky commit 65917718fb8bc2c94df3d52c054116c0e2e640cc Author: Justin Stitt Date: Wed Sep 20 11:07:35 2023 +0000 i2c: powermac: replace deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. `info.type` is expected to be NUL-terminated judging by its use in `i2c_new_client_device()` wherein it is used to populate `client->name`: | strscpy(client->name, info->type, sizeof(client->name)); NUL-padding is not required and even if it was, `client` is already zero-initialized. Considering the two points from above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: Wolfram Sang commit e2def33f9ee1b1a8cda4ec5cde69840b5708f068 Author: Justin Stitt Date: Wed Sep 20 08:08:52 2023 +0000 i2c: cp2615: replace deprecated strncpy with strscpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. We expect name to be NUL-terminated based on its numerous uses with functions that expect NUL-terminated strings. For example in i2c-core-base.c +1533: | dev_dbg(&adap->dev, "adapter [%s] registered\n", adap->name); NUL-padding is not required as `adap` is already zero-alloacted with: | adap = devm_kzalloc(&usbif->dev, sizeof(struct i2c_adapter), GFP_KERNEL); With the above in mind, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: Wolfram Sang commit 0c051c824912f149b66d2ede42dcfd2ae871b2a1 Author: Wolfram Sang Date: Thu Sep 21 10:57:51 2023 +0200 i2c: mux: gpio: adhere to coding style Advertise our coding style by following it :) Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Acked-by: Peter Rosin Signed-off-by: Wolfram Sang commit 24051338322f096f7bfeff52fddf2aec7cb16191 Author: Wolfram Sang Date: Thu Sep 21 10:40:15 2023 +0200 i2c: gpio: remove error checks with debugfs debugfs can handle error pointers in subsequent calls. So, remove the error checks as suggested by kerneldoc of this function. Reported-by: Minjie Du Closes: http://patchwork.ozlabs.org/project/linux-i2c/patch/20230713101829.15548-1-duminjie@vivo.com/ Signed-off-by: Wolfram Sang Reviewed-by: Andi Shyti Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit 54c76ed33008d0b342daa52a45ac304e5e3ab312 Author: Wolfram Sang Date: Thu Sep 21 14:53:50 2023 +0200 i2c: rcar: improve accuracy for R-Car Gen3+ With some new registers, SCL can be calculated to be closer to the desired rate. Apply the new formula for R-Car Gen3 device types. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit 0e864b552b2302e40b2277629ebac79544a5c433 Author: Wolfram Sang Date: Thu Sep 21 14:53:49 2023 +0200 i2c: rcar: reset controller is mandatory for Gen3+ Initially, we only needed a reset controller to make sure RXDMA works at least once per transfer. Meanwhile, documentation has been updated. It now says that a reset has to be performed prior every transaction, even if it is non-DMA. So, make the reset controller a requirement instead of being optional. And bail out if resetting fails. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit dc461c48deda8a2d243fbaf49e276d555eb833d8 Author: Liming Wu Date: Fri Aug 25 10:35:00 2023 +0800 sched/debug: Avoid checking in_atomic_preempt_off() twice in schedule_debug() in_atomic_preempt_off() already gets called in schedule_debug() once, which is the only caller of __schedule_bug(). Skip the second call within __schedule_bug(), it should always be true at this point. [ mingo: Clarified the changelog. ] Signed-off-by: Liming Wu Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230825023501.1848-1-liming.wu@jaguarmicro.com commit a08e0622c42f6d445604d8bc042e0f78dee09594 Author: Javier Martinez Canillas Date: Thu Sep 14 21:51:24 2023 +0200 drm/ssd130x: Drop _helper prefix from struct drm_*_helper_funcs callbacks The driver uses a naming convention where functions for struct drm_*_funcs callbacks are named ssd130x_$object_$operation, while the callbacks for struct drm_*_helper_funcs are named ssd130x_$object_helper_$operation. The idea is that this helper_ prefix in the function names denote that are for struct drm_*_helper_funcs callbacks. This convention was copied from other drivers when ssd130x was written, but Maxime pointed out that is the exception rather than the norm. So let's get rid of the _helper prefixes from the function handlers names. Suggested-by: Maxime Ripard Signed-off-by: Javier Martinez Canillas Reviewed-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230914195138.1518065-1-javierm@redhat.com commit f707d6b9e7c18f669adfdb443906d46cfbaaa0c1 Author: Heiner Kallweit Date: Wed Sep 20 09:33:01 2023 +0200 i2c: i801: replace acpi_lock with I2C bus lock I2C core ensures in i2c_smbus_xfer() that the I2C bus lock is held when calling the smbus_xfer callback. That's i801_access() in our case. I think it's safe in general to assume that the I2C bus lock is held when the smbus_xfer callback is called. Therefore I see no need to define an own mutex. Signed-off-by: Heiner Kallweit Reviewed-by: Jean Delvare Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit b8ec60e1186cdcfce41e7db4c827cb107e459002 Author: Fangrui Song Date: Tue Sep 19 17:17:28 2023 -0700 x86/speculation, objtool: Use absolute relocations for annotations .discard.retpoline_safe sections do not have the SHF_ALLOC flag. These sections referencing text sections' STT_SECTION symbols with PC-relative relocations like R_386_PC32 [0] is conceptually not suitable. Newer LLD will report warnings for REL relocations even for relocatable links [1]: ld.lld: warning: vmlinux.a(drivers/i2c/busses/i2c-i801.o):(.discard.retpoline_safe+0x120): has non-ABS relocation R_386_PC32 against symbol '' Switch to absolute relocations instead, which indicate link-time addresses. In a relocatable link, these addresses are also output section offsets, used by checks in tools/objtool/check.c. When linking vmlinux, these .discard.* sections will be discarded, therefore it is not a problem that R_X86_64_32 cannot represent a kernel address. Alternatively, we could set the SHF_ALLOC flag for .discard.* sections, but I think non-SHF_ALLOC for sections to be discarded makes more sense. Note: if we decide to never support REL architectures (e.g. arm, i386), we can utilize R_*_NONE relocations (.reloc ., BFD_RELOC_NONE, sym), making .discard.* sections zero-sized. That said, the section content waste is 4 bytes per entry, much smaller than sizeof(Elf{32,64}_Rel). [0] commit 1c0c1faf5692 ("objtool: Use relative pointers for annotations") [1] https://github.com/ClangBuiltLinux/linux/issues/1937 Signed-off-by: Fangrui Song Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra (Intel) Cc: Josh Poimboeuf Link: https://lore.kernel.org/r/20230920001728.1439947-1-maskray@google.com commit d0d0f827e067b70c533cca98df772fc65729b522 Author: Heiner Kallweit Date: Wed Sep 20 09:29:28 2023 +0200 i2c: i801: use i2c_mark_adapter_suspended/resumed When entering the suspend callback, at first we should ensure that transfers are finished and I2C core can't start further transfers. Use i2c_mark_adapter_suspended() for this purpose, and complement it with a call to i2c_mark_adapter_resumed() in the resume path. Signed-off-by: Heiner Kallweit Reviewed-by: Jean Delvare Reviewed-by: Andi Shyti Signed-off-by: Wolfram Sang commit bad0524e242012ec626c766f4ea2d8e4d67347be Author: Jianlin Li Date: Fri Sep 22 16:25:47 2023 +0800 x86/sev/docs: Update document URL in amd-memory-encryption.rst The previous link to AMD programmer's manual is no longer available, replace it with the new one. Signed-off-by: Jianlin Li Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230922082547.522689-1-ljianlin99@gmail.com commit 7deda2ce5b33edc6d689e429e3fe75382468b030 Author: Paolo Bonzini Date: Thu Sep 21 07:49:40 2023 -0400 x86/cpu: Clear SVM feature if disabled by BIOS When SVM is disabled by BIOS, one cannot use KVM but the SVM feature is still shown in the output of /proc/cpuinfo. On Intel machines, VMX is cleared by init_ia32_feat_ctl(), so do the same on AMD and Hygon processors. Signed-off-by: Paolo Bonzini Signed-off-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/20230921114940.957141-1-pbonzini@redhat.com commit 4c870513fbb02b842408b840cf68ea8fe09ed82e Author: Stefan Binding Date: Thu Sep 21 17:28:49 2023 +0100 ALSA: hda: cs35l41: Add read-only ALSA control for forced mute When the CS35L41 amp is requested to mute using the ACPI notification mechanism, userspace is not notified that the amp is muted. To allow userspace to know about the mute, add an ALSA control which tracks the forced mute override. This control does not track the overall mute state of the amp, since the amp is only unmuted during playback anyway, instead it tracks the mute override request from the ACPI notification. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20230921162849.1988124-5-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 447106e92a0c86c332d40710436f38f64c322cd6 Author: Stefan Binding Date: Thu Sep 21 17:28:48 2023 +0100 ALSA: hda: cs35l41: Support mute notifications for CS35L41 HDA Some laptops require a hardware based mute system, where when a hotkey is pressed, it forces the amp to be muted. For CS35L41, when the hotkey is pressed, an acpi notification is sent to the CS35L41 Device Node. The driver needs to handle this notification and call a _DSM function to retrieve the mute state. Since the amp is only muted during playback, the driver will only mute or unmute if playback is occurring, otherwise it will save the mute state for when playback starts. This uses the ACPI Notification mechanism, where a handler has been registered in the component master, which notifies each amp through the component binding. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20230921162849.1988124-4-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 7ce669334c55c50ecc2909c42275a3eec0039799 Author: Stefan Binding Date: Thu Sep 21 17:28:47 2023 +0100 ALSA: hda/realtek: Support ACPI Notification framework via component binding For systems which have support for ACPI notifications, add a mechanism to register a handler for ACPI notifications and then call the acpi_notify api on the bound components. Registering a handler in the Realtek HDA driver, allows a single handler to be registered, which then calls into all the components, rather than attempting to register the same handler multiple times, once for each component. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20230921162849.1988124-3-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 502629a75566b5cb409c118125d38102e5edc8f6 Author: Stefan Binding Date: Thu Sep 21 17:28:46 2023 +0100 ALSA: hda: cs35l41: Add notification support into component binding Some systems support a notification from ACPI, which can be used for different things. Only one handler can be registered for the acpi notification, but all amps need to receive that notification, we can register a single handler inside the component master, so that it can then notify through the component framework. This is required to support mute notifications from ACPI. Signed-off-by: Stefan Binding Link: https://lore.kernel.org/r/20230921162849.1988124-2-sbinding@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 1f50012d9c63c690f25956239bd25d10236405f8 Author: Ian Kent Date: Fri Sep 22 12:12:13 2023 +0800 autofs: validate protocol version Move the protocol parameter validation into a seperate function. Signed-off-by: Ian Kent Reviewed-by: Bill O'Donnell Message-Id: <20230922041215.13675-7-raven@themaw.net> Signed-off-by: Christian Brauner commit 9b2731666d1d46bb476df6e4f2ec9a776ad7a507 Author: Ian Kent Date: Fri Sep 22 12:12:12 2023 +0800 autofs: refactor parse_options() Seperate out parts of parse_options() that will match better the individual option processing used in the mount API to further simplify the upcoming conversion. Signed-off-by: Ian Kent Reviewed-by: Bill O'Donnell Message-Id: <20230922041215.13675-6-raven@themaw.net> Signed-off-by: Christian Brauner commit 7efd93ea790ec64221458bbb0705ccba54beab0e Author: Ian Kent Date: Fri Sep 22 12:12:11 2023 +0800 autofs: reformat 0pt enum declaration The enum of options is only reformated in the patch to convert autofs to use the mount API so do that now to simplify the conversion patch. Signed-off-by: Ian Kent Reviewed-by: Bill O'Donnell Message-Id: <20230922041215.13675-5-raven@themaw.net> Signed-off-by: Christian Brauner commit a7467430b4de0985b7d1de8f1e50f8dd47eb6c4a Author: Ian Kent Date: Fri Sep 22 12:12:10 2023 +0800 autofs: refactor super block info init Move the allocation and initialisation of the super block info struct to its own function. Signed-off-by: Ian Kent Reviewed-by: Bill O'Donnell Message-Id: <20230922041215.13675-4-raven@themaw.net> Signed-off-by: Christian Brauner commit 546694b8f65807427a0104154abd8cdc633b36e3 Author: Ian Kent Date: Fri Sep 22 12:12:09 2023 +0800 autofs: add autofs_parse_fd() Factor out the fd mount option handling. Signed-off-by: Ian Kent Reviewed-by: Bill O'Donnell Message-Id: <20230922041215.13675-3-raven@themaw.net> Signed-off-by: Christian Brauner commit bc69fdde0ae1aff595590d802b6ef39114f2b260 Author: Ian Kent Date: Fri Sep 22 12:12:08 2023 +0800 autofs: refactor autofs_prepare_pipe() Refactor autofs_prepare_pipe() by seperating out a check function to be used later. Signed-off-by: Ian Kent Reviewed-by: Bill O'Donnell Message-Id: <20230922041215.13675-2-raven@themaw.net> Signed-off-by: Christian Brauner commit 5ee7b2ea07cc6972bc505103f5d483943754a601 Author: Zong-Zhe Yang Date: Wed Sep 20 15:43:22 2023 +0800 wifi: rtw89: load TX power related tables from FW elements The following FW elements are recognized, and then the valid entries in them are loaded into SW struct case by case. * TX power by rate * TX power limit 2 GHz * TX power limit 5 GHz * TX power limit 6 GHz * TX power limit RU 2 GHz * TX power limit RU 5 GHz * TX power limit RU 6 GHz * TX shape limit * TX shape limit RU One single firmware file can contain multiples of each of the above FW elements. Each of them is configured with a target RFE (RF front end) type. We choose one of the multiples to load based on RFE type. If there are multiples of the same FW elements with the same target RFE type. The last one will be applied. We don't want to have many loading variants for above FW elements. Even if between different chips or between different generations, we would like to maintain only one single set of loadings. So, the loadings are designed to consider compatibility. The main concepts are listed below. * The driver structures, which are used to cast binary entry from FW, cannot insert new members in the middle. If there are something new, they should always be appended at the tail. * Each binary entry from FW uses a dictionary way containing a key set and a data. The keys in the key set indicate where to put the data. * If size of driver struct and size of binary entry do not match when loading, it means the number of keys in the key set are different. Then, we deal with compatibility. No matter which one has more keys, we take/use zero on those mismatched keys. If driver struct is bigger (backward compatibility): e.g. SW uses two keys, but FW is built with one key. Then, put the data of FW(keyX) into SW[keyX][0]. If binary entry is bigger (forward compatibility): e.g. FW is built with two keys, but SW uses one key. Then, only take the data of FW(keyX, keyY = 0) into SW[keyX] Besides, chip info setup flow is tweaked a bit for the following. * Before loading FW elements, we need to determine chip RFE via efuse. * Setting up RFE parameters depends on loading FW elements ahead. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230920074322.42898-8-pkshih@realtek.com commit f6d601c7590fe3615a0c5872bd22f8c9a0a1d001 Author: Zong-Zhe Yang Date: Wed Sep 20 15:43:21 2023 +0800 wifi: rtw89: phy: extend TX power common stuffs for Wi-Fi 7 chips The following are introduced for Wi-Fi 7 chips. 1. take BW/OFDMA into account on TX power by rate 2. increase TX power offset types up to EHT 3. split TX shape into tx_shape_lmt and tx_shape_lmt_ru If functions which are only for AX, they always access TX power by rate with BW/OFDMA = 0/0, and they don't access tx_shape's lmt_ru section. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230920074322.42898-7-pkshih@realtek.com commit 9707ea6d68226507f2ce46f7d2098b20595beffb Author: Zong-Zhe Yang Date: Wed Sep 20 15:43:20 2023 +0800 wifi: rtw89: load TX power by rate when RFE parms setup Table of TX power by rate only needs to be loaded once. But, we originally loaded it every time we start core. Now, we load it one time along as RFE (RF Front End) parameters are determined. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230920074322.42898-6-pkshih@realtek.com commit 634fd9920c28693d94c74a57cd7b1a21f5183c11 Author: Zong-Zhe Yang Date: Wed Sep 20 15:43:19 2023 +0800 wifi: rtw89: phy: refine helpers used for raw TX power Originally, these helpers were implemented by macros. We rewrite them by normal functions. In the new function to seek raw TX power by rate, we access the array according to rate section and discard the original pointer arithmetic. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230920074322.42898-5-pkshih@realtek.com commit 4cc05e3156503fc596c7b161f010f1d9fc16a985 Author: Zong-Zhe Yang Date: Wed Sep 20 15:43:18 2023 +0800 wifi: rtw89: indicate TX power by rate table inside RFE parameter For next-generation chips, TX power by rate table comes from RFE (RF front end) parameter. It can be different according to RFE type. So, we indicate TX power by rate table inside RFE parameter ahead. For current chips, even with different RFE types, a chip is configured with a single TX power by rate table. So, this commit doesn't really affect these currently supported chips. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230920074322.42898-4-pkshih@realtek.com commit 1bf24172cc7559e7b3ccd22120a7965c70ce6760 Author: Zong-Zhe Yang Date: Wed Sep 20 15:43:17 2023 +0800 wifi: rtw89: indicate TX shape table inside RFE parameter For next-generation chips, TX shape table comes from RFE (RF front end) parameter. It can be different according to RFE type. So, we indicate TX shape table inside RFE parameter ahead. For current chips, even with different RFE types, a chip is configured with a single TX shape table. So, this commit doesn't really affect these currently supported chips. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230920074322.42898-3-pkshih@realtek.com commit 9483d8b3aac8864e3860278006b414f996677175 Author: Ping-Ke Shih Date: Wed Sep 20 15:43:16 2023 +0800 wifi: rtw89: add subband index of primary channel to struct rtw89_chan The subband index is a hardware value of relationship between primary channel and bandwidth, and it is used by setting channel/bandwidth to specify the primary channel. Because this index is only needed when bandwidth >= 20 MHz, adjust order of enumerator bandwidth to access offsets array easier. To prevent misuse RTW89_CHANNEL_WIDTH_NUM as size, change it to RTW89_CHANNEL_WIDTH_ORDINARY_NUM that will be the size of array. The enumerator values of bandwidth (before ordinary number) will be also used by upcoming TX power table built in firmware file, so add a comment to remind keeping the order. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230920074322.42898-2-pkshih@realtek.com commit cfa92b6d52071aaa8f27d21affdcb14e7448fbc1 Author: John Stultz Date: Fri Sep 22 04:36:01 2023 +0000 locking/ww_mutex/test: Make sure we bail out instead of livelock I've seen what appears to be livelocks in the stress_inorder_work() function, and looking at the code it is clear we can have a case where we continually retry acquiring the locks and never check to see if we have passed the specified timeout. This patch reworks that function so we always check the timeout before iterating through the loop again. I believe others may have hit this previously here: https://lore.kernel.org/lkml/895ef450-4fb3-5d29-a6ad-790657106a5a@intel.com/ Reported-by: Li Zhijian Signed-off-by: John Stultz Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230922043616.19282-4-jstultz@google.com commit bccdd808902f8c677317cec47c306e42b93b849e Author: John Stultz Date: Fri Sep 22 04:36:00 2023 +0000 locking/ww_mutex/test: Fix potential workqueue corruption In some cases running with the test-ww_mutex code, I was seeing odd behavior where sometimes it seemed flush_workqueue was returning before all the work threads were finished. Often this would cause strange crashes as the mutexes would be freed while they were being used. Looking at the code, there is a lifetime problem as the controlling thread that spawns the work allocates the "struct stress" structures that are passed to the workqueue threads. Then when the workqueue threads are finished, they free the stress struct that was passed to them. Unfortunately the workqueue work_struct node is in the stress struct. Which means the work_struct is freed before the work thread returns and while flush_workqueue is waiting. It seems like a better idea to have the controlling thread both allocate and free the stress structures, so that we can be sure we don't corrupt the workqueue by freeing the structure prematurely. So this patch reworks the test to do so, and with this change I no longer see the early flush_workqueue returns. Signed-off-by: John Stultz Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230922043616.19282-3-jstultz@google.com commit 4812c54dc0498c4b757cbc7f41c1999b5a1c9f67 Author: John Stultz Date: Fri Sep 22 04:35:59 2023 +0000 locking/ww_mutex/test: Use prng instead of rng to avoid hangs at bootup Booting w/ qemu without kvm, and with 64 cpus, I noticed we'd sometimes hung task watchdog splats in get_random_u32_below() when using the test-ww_mutex stress test. While entropy exhaustion is no longer an issue, the RNG may be slower early in boot. The test-ww_mutex code will spawn off 128 threads (2x cpus) and each thread will call get_random_u32_below() a number of times to generate a random order of the 16 locks. This intense use takes time and without kvm, qemu can be slow enough that we trip the hung task watchdogs. For this test, we don't need true randomness, just mixed up orders for testing ww_mutex lock acquisitions, so it changes the logic to use the prng instead, which takes less time and avoids the watchdgos. Feedback would be appreciated! Signed-off-by: John Stultz Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230922043616.19282-2-jstultz@google.com commit 804edf4d18e2caf008f0aaffe2a6d1a0b66fc8fc Author: Dmitry Antipov Date: Tue Sep 19 16:28:00 2023 +0300 wifi: mwifiex: followup PCIE and related cleanups Introduce a few more (PCIE and generic interface related) cleanups which becomes reasonable after the previous patch. Signed-off-by: Dmitry Antipov Acked-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230919132804.73340-2-dmantipov@yandex.ru commit c2e01a3a7b9a20404f4b6196c51385a42a7dc5fa Author: Dmitry Antipov Date: Tue Sep 19 16:27:59 2023 +0300 wifi: mwifiex: simplify PCIE write operations Since 'mwifiex_write_reg()' just issues void 'iowrite32()', convert the former to 'void' and simplify all related users (with the only exception of 'read_poll_timeout()' which explicitly requires a non-void function argument). Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov Acked-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230919132804.73340-1-dmantipov@yandex.ru commit 8bf0cdfac7f8aa3fa6151b5c5f5eebdb44a64e89 Author: Ingo Molnar Date: Thu Sep 21 11:32:58 2023 +0200 : Introduce the list_for_each_reverse() method The list_head counterpart of list_for_each_entry_reverse() was missing, add it to complete the list handling APIs in . [ This new API is also relied on by a WIP scheduler patch, so this variant is not a theoretical possibility only. ] Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: linux-kernel@vger.kernel.org commit ad424743256b0119bd60a9248db4df5d998000a4 Author: Ingo Molnar Date: Sat Jan 22 13:39:15 2022 +0100 x86/bitops: Remove unused __sw_hweight64() assembly implementation on x86-32 Header cleanups in the fast-headers tree highlighted that we have an unused assembly implementation for __sw_hweight64(): WARNING: modpost: EXPORT symbol "__sw_hweight64" [vmlinux] version ... __arch_hweight64() on x86-32 is defined in the arch/x86/include/asm/arch_hweight.h header as an inline, using __arch_hweight32(): #ifdef CONFIG_X86_32 static inline unsigned long __arch_hweight64(__u64 w) { return __arch_hweight32((u32)w) + __arch_hweight32((u32)(w >> 32)); } *But* there's also a __sw_hweight64() assembly implementation: arch/x86/lib/hweight.S SYM_FUNC_START(__sw_hweight64) #ifdef CONFIG_X86_64 ... #else /* CONFIG_X86_32 */ /* We're getting an u64 arg in (%eax,%edx): unsigned long hweight64(__u64 w) */ pushl %ecx call __sw_hweight32 movl %eax, %ecx # stash away result movl %edx, %eax # second part of input call __sw_hweight32 addl %ecx, %eax # result popl %ecx ret #endif But this __sw_hweight64 assembly implementation is unused - and it's essentially doing the same thing that the inline wrapper does. Remove the assembly version and add a comment about it. Reported-by: Nathan Chancellor Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: linux-kernel@vger.kernel.org commit d73a105586434ca919a1a487a467e5664f9300c4 Author: Ingo Molnar Date: Fri Sep 22 09:29:59 2023 +0200 x86/mm: Move arch_memory_failure() and arch_is_platform_page() definitions from to relies on these definitions being included first, which is true currently due to historic header spaghetti, but in the future will not guaranteed to be included by the MM code. Move these definitions over into a suitable MM header. This is a preparatory patch for x86 header dependency simplifications and reductions. Signed-off-by: Ingo Molnar Cc: linux-kernel@vger.kernel.org commit 89fca38168c9da9cb890ae4033af479c4cee1469 Author: Alexandre Torgue Date: Thu Sep 21 15:29:32 2023 +0200 arm64: dts: st: add arm-wdt node for watchdog support on stm32mp251 Add the node to use the ARM SMC watchdog support. It will use a dedicated smc-id to configure and kick the watchdog. Signed-off-by: Lionel Debieve Signed-off-by: Alexandre Torgue commit 5a1b322cb0b7d0d33a2d13462294dc0f46911172 Merge: 84c19e655b29f 92953e7aab013 Author: David S. Miller Date: Fri Sep 22 08:26:30 2023 +0100 Merge branch 'mlxsw-multicast' Petr Machata says: ==================== mlxsw: Improve blocks selection for IPv6 multicast forwarding Amit Cohen writes: The driver configures two ACL regions during initialization, these regions are used for IPv4 and IPv6 multicast forwarding. Entries residing in these two regions match on the {SIP, DIP, VRID} key elements. Currently for IPv6 region, 9 key blocks are used. This can be improved by reducing the amount key blocks needed for the IPv6 region to 8. It is possible to use key blocks that mix subsets of the VRID element with subsets of the DIP element. To make this happen, we have to take in account the algorithm that chooses which key blocks will be used. It is lazy and not the optimal one as it is a complex task. It searches the block that contains the most elements that are required, chooses it, removes the elements that appear in the chosen block and starts again searching the block that contains the most elements. To optimize the nubmber of the blocks for IPv6 multicast forwarding, handle the following: 1. Add support for key blocks that mix subsets of the VRID element with subsets of the DIP element. 2. Prevent the algorithm from chosing another blocks for VRID. Currently, we have the block 'ipv4_4' which contains 2 sub-elements of VRID. With the existing algorithm, this block might be chosen, then 8 blocks must be chosen for SIP and DIP and we will get 9 blocks to match on {SIP, DIP, VRID}. Therefore, replace this block with a new block 'ipv4_5' that contains 1 element for VRID, this will not be chosen for IPv6 as VRID element will be broken to several sub-elements. In this way we can get 8 blocks for IPv6 multicast forwarding. This improvement was tested and indeed 8 blocks are used instead of 9. v2: - Resending without changes. ==================== Signed-off-by: David S. Miller commit 92953e7aab013719aa8974805614c0bc11361026 Author: Amit Cohen Date: Tue Sep 19 17:42:56 2023 +0200 mlxsw: Edit IPv6 key blocks to use one less block for multicast forwarding Two ACL regions that are configured by the driver during initialization are the ones used for IPv4 and IPv6 multicast forwarding. Entries residing in these two regions match on the {SIP, DIP, VRID} key elements. Currently for IPv6 region, 9 key blocks are used: * 4 for SIP - 'ipv4_1', 'ipv6_{3,4,5}' * 4 for DIP - 'ipv4_0', 'ipv6_{0,1,2/2b}' * 1 for VRID - 'ipv4_4b' This can be improved by reducing the amount key blocks needed for the IPv6 region to 8. It is possible to use key blocks that mix subsets of the VRID element with subsets of the DIP element. The following key blocks can be used: * 4 for SIP - 'ipv4_1', 'ipv6_{3,4,5}' * 1 for subset of DIP - 'ipv4_0' * 3 for the rest of DIP and subsets of VRID - 'ipv6_{0,1,2/2b}' To make this happen, add VRID sub-elements as part of existing keys - 'ipv6_{0,1,2/2b}'. Note that one of the sub-elements is called VRID_ROUTER_MSB and does not contain bit numbers like the rest, as for Spectrum < 4 this element represents bits 8-10 and for Spectrum-4 it represents bits 8-11. Breaking VRID into 3 sub-elements makes the driver use one less block in IPv6 region for multicast forwarding. The sub-elements can be filled in blocks that are used for destination IP. The algorithm in the driver that chooses which key blocks will be used is lazy and not the optimal one. It searches the block that contains the most elements that are required, chooses it, removes the elements that appear in the chosen block and starts again searching the block that contains the most elements. When key block 'ipv4_4' is defined, the algorithm might choose it, as it contains 2 sub-elements of VRID, then 8 blocks must be chosen for SIP and DIP and we get 9 blocks to match on {SIP, DIP, VRID}. That is why we had to remove key block 'ipv4_4' in a previous patch and use key block that contains one field for VRID. This improvement was tested and indeed 8 blocks are used instead of 9. Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit c6caabdf3e0cc50ba4a44bebc82cda5551d81d4f Author: Amit Cohen Date: Tue Sep 19 17:42:55 2023 +0200 mlxsw: spectrum_acl_flex_keys: Add 'ipv4_5b' flex key The previous patch replaced the key block 'ipv4_4' with 'ipv4_5'. The corresponding block for Spectrum-4 is 'ipv4_4b'. To be consistent, replace key block 'ipv4_4b' with 'ipv4_5b'. Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit c2f3e10ac4ebf23e177226b9b4d297bfe2fb6b20 Author: Amit Cohen Date: Tue Sep 19 17:42:54 2023 +0200 mlxsw: Add 'ipv4_5' flex key Currently virtual router ID element is broken to two sub-elements - 'VIRT_ROUTER_LSB' and 'VIRT_ROUTER_MSB'. It was broken as this field is broken in 'ipv4_4' flex key which is used for IPv4 in Spectrum < 4. For Spectrum-4, we use 'ipv4_4b' flex key which contains one field for virtual router, this key is not supported in older ASICs. Add 'ipv4_5' flex key which is supported in all ASICs and contains one field for virtual router. Then there is no reason to use 'VIRT_ROUTER_LSB' and 'VIRT_ROUTER_MSB', remove them and add one element 'VIRT_ROUTER' for this field. The motivation is to get rid of 'ipv4_4' flex key, as it might be chosen for IPv6 multicast forwarding region. This will not allow the improvement in a following patch. See more details in the cover letter and in a following patch. Signed-off-by: Amit Cohen Reviewed-by: Ido Schimmel Signed-off-by: Petr Machata Signed-off-by: David S. Miller commit 84c19e655b29fb31d416d00f2f0290d6397b8eef Author: Peter Lafreniere Date: Tue Sep 19 14:14:23 2023 +0000 hamradio: baycom: remove useless link in Kconfig The Kconfig help text for baycom drivers suggests that more information on the hardware can be found at . The website now includes no information on their ham radio products other than a mention that they were once produced by the company, saying: "The amateur radio equipment is now no longer part and business of BayCom GmbH" As there is no information relavent to the baycom driver on the site, remove the link. Signed-off-by: Peter Lafreniere Signed-off-by: David S. Miller commit 74649c9895037eae02ecbe1c5d49c09529664769 Author: Yann Gautier Date: Mon Sep 4 15:22:12 2023 +0200 arm64: dts: st: add SD-card support on STM32MP257F-EV1 board Add the configuration node for SD-card support on STM32MP257F-EV1 board. For the moment it uses a fixed regulator for vmmc, and vqmmc is skipped until regulator driver is available. Signed-off-by: Yann Gautier Signed-off-by: Alexandre Torgue commit 7db55ad3a64a46bfcdb6f902090f844654d60dfe Author: Yann Gautier Date: Mon Sep 4 15:22:11 2023 +0200 arm64: dts: st: add sdmmc1 pins for stm32mp25 Add the pins used for SD-card on STM32MP257F-EV1 board. Signed-off-by: Yann Gautier Signed-off-by: Alexandre Torgue commit 873863dd13ffc58a8671d48798f1b2e6901dca59 Author: Yann Gautier Date: Mon Sep 4 15:22:10 2023 +0200 arm64: dts: st: add sdmmc1 node in stm32mp251 SoC file The SDMMC1 peripheral is used for SD-cards (default on ST boards), or eMMC cards. For the moment it uses the fixed clock ck_flexgen_51, until clock driver is available. Signed-off-by: Yann Gautier Signed-off-by: Alexandre Torgue commit f107ff76a8c242b298413ef52db9978dc3fe0153 Merge: ce9ecca0238b1 15d30b46573d7 Author: Dave Airlie Date: Fri Sep 22 16:28:29 2023 +1000 Merge tag 'drm-misc-next-2023-09-11-1' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v6.7-rc1: UAPI Changes: - Nouveau changed to not set NO_PREFETCH flag explicitly. Cross-subsystem Changes: - Update documentation of dma-buf intro and uapi. - fbdev/sbus fixes. - Use initializer macros in a lot of fbdev drivers. - Add Boris Brezillon as Panfrost driver maintainer. - Add Jessica Zhang as drm/panel reviewer. - Make more fbdev drivers use fb_ops helpers for deferred io. - Small hid trailing whitespace fix. - Use fb_ops in hid/picolcd Core Changes: - Assorted small fixes to ttm tests, drm/mst. - Documentation updates to bridge. - Add kunit tests for some drm_fb functions. - Rework drm_debugfs implementation. - Update xe documentation to mark todos as completed. Driver Changes: - Add support to rockchip for rv1126 mipi-dsi and vop. - Assorted small fixes to nouveau, bridge/samsung-dsim, bridge/lvds-codec, loongson, rockchip, panfrost, gma500, repaper, komeda, virtio, ssd130x. - Add support for simple panels Mitsubishi AA084XE01, JDI LPM102A188A, - Documentation updates to accel/ivpu. - Some nouveau scheduling/fence fixes. - Power management related fixes and other fixes to ivpu. - Assorted bridge/it66121 fixes. - Make platform drivers return void in remove() callback. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/3da6554b-3b47-fe7d-c4ea-21f4f819dbb6@linux.intel.com commit d2f6fc54fc507751c1d086f64825bf1899648786 Author: Eddie James Date: Fri Jun 16 09:26:10 2023 -0500 ARM: dts: aspeed: bonnell: Add reserved memory for TPM event log Trusted boot support requires the platform event log passed up from the bootloader. In U-Boot, this can now be accomplished with a reserved memory region, so add a region for this purpose to the Bonnell BMC devicetree. Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20230616142610.356623-1-eajames@linux.ibm.com Signed-off-by: Joel Stanley commit 02e2d8f4c2f4c4632c4040a7db58977a9815401c Author: Tyrel Datwyler Date: Thu Sep 21 17:54:35 2023 -0500 scsi: ibmvfc: Add protocol field to target structure Add a per target protocol field so target code can determine correct protocol specific actions as well as identify the correct channel group target list. Signed-off-by: Tyrel Datwyler Link: https://lore.kernel.org/r/20230921225435.3537728-12-tyreld@linux.ibm.com Reviewed-by: Brian King Signed-off-by: Martin K. Petersen commit 50fe1a3fddda4b25050a7e535d2d087f4ffc0d41 Author: Tyrel Datwyler Date: Thu Sep 21 17:54:34 2023 -0500 scsi: ibmvfc: Make discovery buffer per protocol channel group The target discovery buffer that the VIOS populates with targets is currently a host adapter field. To facilitate the discovery of NVMe targets as well as SCSI another discovery buffer is required. Move the discovery buffer out of the host struct and into the ibmvfc_channels struct so that each channels instance for a given protocol has its own discovery buffer. Signed-off-by: Tyrel Datwyler Link: https://lore.kernel.org/r/20230921225435.3537728-11-tyreld@linux.ibm.com Reviewed-by: Brian King Signed-off-by: Martin K. Petersen commit eb85f1d76aac7c0d0f3487aa31b9b88c0ca81929 Author: Tyrel Datwyler Date: Thu Sep 21 17:54:33 2023 -0500 scsi: ibmvfc: Add protocol field to ibmvfc_channels There are cases in the generic code where protocol specific configuration or actions may need to be taken. Add a protocol field to struct ibmvfc_channels and initial IBMVFC_PROTO_[SCSI/NVME] definitions. Signed-off-by: Tyrel Datwyler Link: https://lore.kernel.org/r/20230921225435.3537728-10-tyreld@linux.ibm.com Reviewed-by: Brian King Signed-off-by: Martin K. Petersen commit f28f16d373efb2277c7cdd63b3bc2d226182c6ba Author: Tyrel Datwyler Date: Thu Sep 21 17:54:32 2023 -0500 scsi: ibmvfc: Make channel allocation generic With the coming of NVMeoF support the driver will need to also allocate channels for NVMe. Implement generic channel allocation wrappers that can be used for both SCSI and NVMeoF protocol setup. Signed-off-by: Tyrel Datwyler Link: https://lore.kernel.org/r/20230921225435.3537728-9-tyreld@linux.ibm.com Reviewed-by: Brian King Signed-off-by: Martin K. Petersen commit 9e5605404bb786870867e0d6b2bb3fa47dbe3bfd Author: Tyrel Datwyler Date: Thu Sep 21 17:54:31 2023 -0500 scsi: ibmvfc: Track max and desired queue size in ibmvfc_channels Add fields for desired and max number of queues to ibmvfc_channels. With support for NVMeoF protocol coming these sorts of values should be tracked in the protocol specific channel struct instead of the overarching host adapter. Signed-off-by: Tyrel Datwyler Link: https://lore.kernel.org/r/20230921225435.3537728-8-tyreld@linux.ibm.com Reviewed-by: Brian King Signed-off-by: Martin K. Petersen commit d3558ca8a0e683185540fad9456e8536643f67ef Author: Tyrel Datwyler Date: Thu Sep 21 17:54:30 2023 -0500 scsi: ibmvfc: Rename ibmvfc_scsi_channels to ibmvfc_channels There is nothing scsi specific about the ibmvfc_scsi_channels struct. It is meant to encapsulate a set of channels regardless of protocol. Remove _scsi from the struct name to reflect this genric nature. Signed-off-by: Tyrel Datwyler Link: https://lore.kernel.org/r/20230921225435.3537728-7-tyreld@linux.ibm.com Reviewed-by: Brian King Signed-off-by: Martin K. Petersen commit 5144905884e2bfbbde8593045ea26bffd199aa4d Author: Tyrel Datwyler Date: Thu Sep 21 17:54:29 2023 -0500 scsi: ibmvfc: Use a bitfield for boolean flags There are currently 9 binary flag fields in the ibmvfc host structure. Converting each of these to a single bitfield reduces the foot print of the structure by 32 bytes. Signed-off-by: Tyrel Datwyler Link: https://lore.kernel.org/r/20230921225435.3537728-6-tyreld@linux.ibm.com Reviewed-by: Brian King Signed-off-by: Martin K. Petersen commit 670106eb4c8b23475f8c2b3416005a312afa622f Author: Tyrel Datwyler Date: Thu Sep 21 17:54:28 2023 -0500 scsi: ibmvfc: Fix erroneous use of rtas_busy_delay with hcall return code Commit 0217a272fe13 ("scsi: ibmvfc: Store return code of H_FREE_SUB_CRQ during cleanup") wrongly changed the busy loop check to use rtas_busy_delay() instead of H_BUSY and H_IS_LONG_BUSY(). The busy return codes for RTAS and hypercalls are not the same. Fix this issue by restoring the use of H_BUSY and H_IS_LONG_BUSY(). Fixes: 0217a272fe13 ("scsi: ibmvfc: Store return code of H_FREE_SUB_CRQ during cleanup") Signed-off-by: Tyrel Datwyler Link: https://lore.kernel.org/r/20230921225435.3537728-5-tyreld@linux.ibm.com Reviewed-by: Brian King Signed-off-by: Martin K. Petersen commit b27bce7291e688738c7ed47f300c877c11cef2dc Author: Tyrel Datwyler Date: Thu Sep 21 17:54:27 2023 -0500 scsi: ibmvfc: Limit max hw queues by num_online_cpus() An LPAR could potentially be configured with a small logical cpu count that is less then the default hardware queue max. Ensure that we don't allocate more hw queues than available cpus. Signed-off-by: Tyrel Datwyler Link: https://lore.kernel.org/r/20230921225435.3537728-4-tyreld@linux.ibm.com Reviewed-by: Brian King Signed-off-by: Martin K. Petersen commit e1a4e0d3ce3b24421c25b7c335f0b7b948fd0c7f Author: Tyrel Datwyler Date: Thu Sep 21 17:54:26 2023 -0500 scsi: ibmvfc: Implement channel queue depth and event buffer accounting Extend ibmvfc_queue, ibmvfc_event, and ibmvfc_event_pool to provide queue depths for general I/O commands and reserved commands as well as proper accounting of the free events of each type from the general event pool. Further, calculate the negotiated max command limit with the VIOS at NPIV login time as a function of the number of queues times their total queue depth (general and reserved depths combined). This does away with the legacy max_request value, and allows the driver to better manage and track it resources. Signed-off-by: Tyrel Datwyler Link: https://lore.kernel.org/r/20230921225435.3537728-3-tyreld@linux.ibm.com Reviewed-by: Brian King Signed-off-by: Martin K. Petersen commit b39f2d10b86d0af353ea339e5815820026bca48f Author: Tyrel Datwyler Date: Thu Sep 21 17:54:25 2023 -0500 scsi: ibmvfc: Remove BUG_ON in the case of an empty event pool In practice the driver should never send more commands than are allocated to a queue's event pool. In the unlikely event that this happens, the code asserts a BUG_ON, and in the case that the kernel is not configured to crash on panic returns a junk event pointer from the empty event list causing things to spiral from there. This BUG_ON is a historical artifact of the ibmvfc driver first being upstreamed, and it is well known now that the use of BUG_ON is bad practice except in the most unrecoverable scenario. There is nothing about this scenario that prevents the driver from recovering and carrying on. Remove the BUG_ON in question from ibmvfc_get_event() and return a NULL pointer in the case of an empty event pool. Update all call sites to ibmvfc_get_event() to check for a NULL pointer and perfrom the appropriate failure or recovery action. Signed-off-by: Tyrel Datwyler Link: https://lore.kernel.org/r/20230921225435.3537728-2-tyreld@linux.ibm.com Reviewed-by: Brian King Signed-off-by: Martin K. Petersen commit 63f0733d07ce60252e885602b39571ade0441015 Author: Yihang Li Date: Wed Sep 13 10:15:27 2023 +0800 scsi: hisi_sas: Allocate DFX memory during dump trigger Currently, if CONFIG_SCSI_HISI_SAS_DEBUGFS_DEFAULT_ENABLE is enabled, the memory space used by DFX is allocated during device initialization, which occupies a large number of memory resources. The memory usage before and after the driver is loaded is as follows: Memory usage before the driver is loaded: $ free -m total used free shared buff/cache available Mem: 867352 2578 864037 11 735 861681 Swap: 4095 0 4095 Memory usage after the driver which include 4 HBAs is loaded: $ insmod hisi_sas_v3_hw.ko $ free -m total used free shared buff/cache available Mem: 867352 4760 861848 11 743 859495 Swap: 4095 0 4095 The driver with 4 HBAs connected will allocate about 110 MB of memory without enabling debugfs. Therefore, to avoid wasting memory resources, DFX memory is allocated during dump triggering. The dump may fail due to memory allocation failure. After this change, each dump costs about 10 MB of memory, and each dump lasts about 100 ms. Signed-off-by: Yihang Li Signed-off-by: Xiang Chen Link: https://lore.kernel.org/r/1694571327-78697-4-git-send-email-chenxiang66@hisilicon.com Signed-off-by: Martin K. Petersen commit 2ff07b5c6fe9173e7a7de3b23f300d71ad4d8fde Author: Yihang Li Date: Wed Sep 13 10:15:26 2023 +0800 scsi: hisi_sas: Directly call register snapshot instead of using workqueue Currently, register information dump is performed via workqueue, regardless of the trigger mode (automatic or manual). There is a delay in dumping register through workqueue, the exact register information at trigger time cannot be obtained. Call register snapshot directly instead of through a workqueue. Signed-off-by: Yihang Li Signed-off-by: Xiang Chen Link: https://lore.kernel.org/r/1694571327-78697-3-git-send-email-chenxiang66@hisilicon.com Signed-off-by: Martin K. Petersen commit 6de426f9276c448e2db7238911c97fb157cb23be Author: Yihang Li Date: Wed Sep 13 10:15:25 2023 +0800 scsi: hisi_sas: Set debugfs_dir pointer to NULL after removing debugfs If init debugfs failed during device registration due to memory allocation failure, debugfs_remove_recursive() is called, after which debugfs_dir is not set to NULL. debugfs_remove_recursive() will be called again during device removal. As a result, illegal pointer is accessed. [ 1665.467244] hisi_sas_v3_hw 0000:b4:02.0: failed to init debugfs! ... [ 1669.836708] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000a0 [ 1669.872669] pc : down_write+0x24/0x70 [ 1669.876315] lr : down_write+0x1c/0x70 [ 1669.879961] sp : ffff000036f53a30 [ 1669.883260] x29: ffff000036f53a30 x28: ffffa027c31549f8 [ 1669.888547] x27: ffffa027c3140000 x26: 0000000000000000 [ 1669.893834] x25: ffffa027bf37c270 x24: ffffa027bf37c270 [ 1669.899122] x23: ffff0000095406b8 x22: ffff0000095406a8 [ 1669.904408] x21: 0000000000000000 x20: ffffa027bf37c310 [ 1669.909695] x19: 00000000000000a0 x18: ffff8027dcd86f10 [ 1669.914982] x17: 0000000000000000 x16: 0000000000000000 [ 1669.920268] x15: 0000000000000000 x14: ffffa0274014f870 [ 1669.925555] x13: 0000000000000040 x12: 0000000000000228 [ 1669.930842] x11: 0000000000000020 x10: 0000000000000bb0 [ 1669.936129] x9 : ffff000036f537f0 x8 : ffff80273088ca10 [ 1669.941416] x7 : 000000000000001d x6 : 00000000ffffffff [ 1669.946702] x5 : ffff000008a36310 x4 : ffff80273088be00 [ 1669.951989] x3 : ffff000009513e90 x2 : 0000000000000000 [ 1669.957276] x1 : 00000000000000a0 x0 : ffffffff00000001 [ 1669.962563] Call trace: [ 1669.965000] down_write+0x24/0x70 [ 1669.968301] debugfs_remove_recursive+0x5c/0x1b0 [ 1669.972905] hisi_sas_debugfs_exit+0x24/0x30 [hisi_sas_main] [ 1669.978541] hisi_sas_v3_remove+0x130/0x150 [hisi_sas_v3_hw] [ 1669.984175] pci_device_remove+0x48/0xd8 [ 1669.988082] device_release_driver_internal+0x1b4/0x250 [ 1669.993282] device_release_driver+0x28/0x38 [ 1669.997534] pci_stop_bus_device+0x84/0xb8 [ 1670.001611] pci_stop_and_remove_bus_device_locked+0x24/0x40 [ 1670.007244] remove_store+0xfc/0x140 [ 1670.010802] dev_attr_store+0x44/0x60 [ 1670.014448] sysfs_kf_write+0x58/0x80 [ 1670.018095] kernfs_fop_write+0xe8/0x1f0 [ 1670.022000] __vfs_write+0x60/0x190 [ 1670.025472] vfs_write+0xac/0x1c0 [ 1670.028771] ksys_write+0x6c/0xd8 [ 1670.032071] __arm64_sys_write+0x24/0x30 [ 1670.035977] el0_svc_common+0x78/0x130 [ 1670.039710] el0_svc_handler+0x38/0x78 [ 1670.043442] el0_svc+0x8/0xc To fix this, set debugfs_dir to NULL after debugfs_remove_recursive(). Signed-off-by: Yihang Li Signed-off-by: Xingui Yang Signed-off-by: Xiang Chen Link: https://lore.kernel.org/r/1694571327-78697-2-git-send-email-chenxiang66@hisilicon.com Signed-off-by: Martin K. Petersen commit 0842b7617e3491f489aff6f84712c388e32c1877 Author: Uwe Kleine-König Date: Sun Sep 17 16:57:22 2023 +0200 scsi: ufs: Convert all platform drivers to return void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). All platform drivers below drivers/ufs/ unconditionally return zero in their remove callback and so can be converted trivially to the variant returning void. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230917145722.1131557-1-u.kleine-koenig@pengutronix.de Reviewed-by: Bean Huo Signed-off-by: Martin K. Petersen commit fe15880f317348ba9e81c46f270d1c1ee0002e8e Merge: 17d1194982737 80975adc79dde Author: Martin K. Petersen Date: Thu Sep 21 21:44:12 2023 -0400 Merge patch series "scsi: pm8001: Bug fix and cleanup" Damien Le Moal says: The first patch of this series fixes an issue with IRQ setup which prevents the controller from resuming after a system suspend. The following patches are code cleanup without any functional changes. [mkp: The first patch went into v6.6-rc2 and thus this merge constitutes the remaining patches of the series] Link: https://lore.kernel.org/r/20230911232745.325149-1-dlemoal@kernel.org Signed-off-by: Martin K. Petersen commit 80975adc79dde8985f4ea68fe0b158bc8a913580 Author: Damien Le Moal Date: Tue Sep 12 08:27:45 2023 +0900 scsi: pm8001: Remove PM8001_READ_VPD Remove the macro PM8001_READ_VPD used to define if a controller WWN should be retrieved from the device. Instead, define the better named boolean module parameter "read_wwn" to control this. The code to set a fixed address for a phy device address when read_wwn is set to false is simplified and fixed to avoid sparse warnings. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230911232745.325149-11-dlemoal@kernel.org Signed-off-by: Martin K. Petersen commit 205430290ad0b8f06924393eb9275e65392c86f3 Author: Damien Le Moal Date: Tue Sep 12 08:27:44 2023 +0900 scsi: pm8001: Remove PM8001_USE_TASKLET Remove the macro PM8001_USE_TASKLET used to conditionally use tasklets for MSI-X interrupts handling and replace it with the boolean module parameter pm8001_use_tasklet. This parameter defaults to true and can be true only if pm8001_use_msix is also true. Code conditionnaly defined with PM8001_USE_TASKLET is modified to instead use the parameter pm8001_use_tasklet. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230911232745.325149-10-dlemoal@kernel.org Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit efa1fca45082c75061a53fa58ca69468f407291c Author: Damien Le Moal Date: Tue Sep 12 08:27:43 2023 +0900 scsi: pm8001: Remove PM8001_USE_MSIX The pm8001 driver does not compile if PM8001_USE_MSIX is not defined in pm8001_sas.h because various fields and functions conditionally defined are used unconditionally without a "#ifdef PM8001_USE_MSIX" protection. This macro is rather useless anyway and not convenient as diabling MSI-X use requires recompiling the driver. Remove this macro and replace it with the bool module parameter "use_msix" which defaults to true. The use of MSI-X interrupts for an adapter is gated by this module parameter for adapters that actually support MSI-X. The "use_msix" boolean field is added to struct pm8001_hba_info and all code defined depending on PM8001_USE_MSIX is modified to rely on pm8001_hba_info->use_msix instead. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230911232745.325149-9-dlemoal@kernel.org Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit d93e1ac40354903812e80733e92566470fa7bd2b Author: Damien Le Moal Date: Tue Sep 12 08:27:42 2023 +0900 scsi: pm8001: Remove pm80xx_chip_intx_interrupt_enable/disable() Remove the functions pm80xx_chip_intx_interrupt_enable() and pm80xx_chip_intx_interrupt_disable() and open code them respectively in pm80xx_chip_interrupt_enable() and pm80xx_chip_interrupt_disable(). Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230911232745.325149-8-dlemoal@kernel.org Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit d6f2f6c6e341998fcaf4e04c0308c24d86bece51 Author: Damien Le Moal Date: Tue Sep 12 08:27:41 2023 +0900 scsi: pm8001: Simplify pm8001_chip_interrupt_enable/disable() pm8001_chip_msix_interrupt_enable() and pm8001_chip_msix_interrupt_disable() are always cold with the vector argument equal to 0. This allows simplifying the code for these functions. With this change, the functions are simple enough and can be removed by open coding them directly in pm8001_chip_interrupt_enable() and pm8001_chip_interrupt_disable(). Also do the same for the functions pm8001_chip_intx_interrupt_enable() and pm8001_chip_intx_interrupt_disable() and remove these functions. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230911232745.325149-7-dlemoal@kernel.org Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit 07ca8c1ad0618e1c7e399a204928b3f2f9778eca Author: Damien Le Moal Date: Tue Sep 12 08:27:40 2023 +0900 scsi: pm8001: Introduce pm8001_handle_irq() Factor out the common code of pm8001_interrupt_handler_msix and of pm8001_interrupt_handler_intx() into the new function pm8001_handle_irq() and use this new helper in these two functions to simplify the code. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230911232745.325149-6-dlemoal@kernel.org Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit 80bb942b35c7277a1276b6a52a9478f55feb8b03 Author: Damien Le Moal Date: Tue Sep 12 08:27:39 2023 +0900 scsi: pm8001: Introduce pm8001_kill_tasklet() Factor out the identical code for killing tasklets in pm8001_pci_remove() and pm8001_pci_suspend() and instead use the new function pm8001_kill_tasklet(). Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230911232745.325149-5-dlemoal@kernel.org Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit a08119183bc67f5ac0e92b2ca7444f9a976195c1 Author: Damien Le Moal Date: Tue Sep 12 08:27:38 2023 +0900 scsi: pm8001: Introduce pm8001_init_tasklet() Factor out the identical code for initializing tasklets in pm8001_pci_alloc() and pm8001_pci_resume() and instead use the new function pm8001_init_tasklet(). Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230911232745.325149-4-dlemoal@kernel.org Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit d21bfabf0e6543a1d8a04dbff3e46e79fce37cc3 Author: Damien Le Moal Date: Tue Sep 12 08:27:37 2023 +0900 scsi: pm8001: Introduce pm8001_free_irq() Instead of repeating the same code twice in pm8001_pci_remove() and pm8001_pci_suspend() to free IRQs, introduuce the function pm8001_free_irq() to do that. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230911232745.325149-3-dlemoal@kernel.org Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit 41e845628511878d6e89e2a9249c095e72aab7eb Author: Mateusz Guzik Date: Sat Sep 9 21:19:32 2023 +0200 cred: add get_cred_many and put_cred_many Some of the frequent consumers of get_cred and put_cred operate on 2 references on the same creds back-to-back. Switch them to doing the work in one go instead. Signed-off-by: Mateusz Guzik [PM: removed changelog from commit description] Signed-off-by: Paul Moore commit ac0691c75ab78cd240630c184ffbf09433de2d2e Author: Tiezhu Yang Date: Tue Sep 19 16:25:37 2023 +0800 bpf, docs: Add loongarch64 as arch supporting BPF JIT As BPF JIT support for loongarch64 was added about one year ago with commit 5dc615520c4d ("LoongArch: Add BPF JIT support"), it is appropriate to add loongarch64 as arch supporting BPF JIT in bpf and sysctl docs as well. Signed-off-by: Tiezhu Yang Link: https://lore.kernel.org/r/1695111937-19697-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Martin KaFai Lau commit 9220c3ef6fefbf18f24aeedb1142a642b3de0596 Author: Jinghao Jia Date: Sun Sep 17 16:42:20 2023 -0500 samples/bpf: syscall_tp_user: Fix array out-of-bound access Commit 06744f24696e ("samples/bpf: Add openat2() enter/exit tracepoint to syscall_tp sample") added two more eBPF programs to support the openat2() syscall. However, it did not increase the size of the array that holds the corresponding bpf_links. This leads to an out-of-bound access on that array in the bpf_object__for_each_program loop and could corrupt other variables on the stack. On our testing QEMU, it corrupts the map1_fds array and causes the sample to fail: # ./syscall_tp prog #0: map ids 4 5 verify map:4 val: 5 map_lookup failed: Bad file descriptor Dynamically allocate the array based on the number of programs reported by libbpf to prevent similar inconsistencies in the future Fixes: 06744f24696e ("samples/bpf: Add openat2() enter/exit tracepoint to syscall_tp sample") Signed-off-by: Jinghao Jia Signed-off-by: Ruowen Qin Signed-off-by: Jinghao Jia Link: https://lore.kernel.org/r/20230917214220.637721-4-jinghao7@illinois.edu Signed-off-by: Alexei Starovoitov commit 0ee352fe0d28015cab161b04d202fa3231c0ba3b Author: Jinghao Jia Date: Sun Sep 17 16:42:19 2023 -0500 samples/bpf: syscall_tp_user: Rename num_progs into nr_tests The variable name num_progs causes confusion because that variable really controls the number of rounds the test should be executed. Rename num_progs into nr_tests for the sake of clarity. Signed-off-by: Jinghao Jia Signed-off-by: Ruowen Qin Signed-off-by: Jinghao Jia Link: https://lore.kernel.org/r/20230917214220.637721-3-jinghao7@illinois.edu Signed-off-by: Alexei Starovoitov commit cf67d28de348f109251a9045a472a39724e2b4fa Merge: e9cbc89067cce c29913bbf4ec1 Author: Alexei Starovoitov Date: Thu Sep 21 14:22:01 2023 -0700 Merge branch 'implement-cpuv4-support-for-s390x' Ilya Leoshkevich says: ==================== Implement cpuv4 support for s390x v1: https://lore.kernel.org/bpf/20230830011128.1415752-1-iii@linux.ibm.com/ v1 -> v2: - Redo Disable zero-extension for BPF_MEMSX as Puranjay and Alexei suggested. - Drop the bpf_ct_insert_entry() patch, it went in via the bpf tree. - Rebase, don't apply A-bs because there were fixed conflicts. Hi, This series adds the cpuv4 support to the s390x eBPF JIT. Patches 1-3 are preliminary bugfixes. Patches 4-8 implement the new instructions. Patches 9-10 enable the tests. Best regards, Ilya ==================== Link: https://lore.kernel.org/r/20230919101336.2223655-1-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov commit c29913bbf4ec172da08157efc7b417f684c42dd6 Author: Ilya Leoshkevich Date: Tue Sep 19 12:09:12 2023 +0200 selftests/bpf: Trim DENYLIST.s390x Enable all selftests, except the 2 that have to do with the userspace unwinding, and the new exceptions test, in the s390x CI. Signed-off-by: Ilya Leoshkevich Link: https://lore.kernel.org/r/20230919101336.2223655-11-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov commit 48c432382dd44363f5110692a9b469a7b2e962ee Author: Ilya Leoshkevich Date: Tue Sep 19 12:09:11 2023 +0200 selftests/bpf: Enable the cpuv4 tests for s390x Now that all the cpuv4 support is in place, enable the tests. Signed-off-by: Ilya Leoshkevich Link: https://lore.kernel.org/r/20230919101336.2223655-10-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov commit 91d2ad78e90c26189bb27789099a8170edfad2f0 Author: Ilya Leoshkevich Date: Tue Sep 19 12:09:10 2023 +0200 s390/bpf: Implement signed division Implement the cpuv4 signed division. It is encoded as unsigned division, but with off field set to 1. s390x has the necessary instructions: dsgfr, dsgf and dsgr. Signed-off-by: Ilya Leoshkevich Link: https://lore.kernel.org/r/20230919101336.2223655-9-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov commit c690191e23d82137b876d8980c967b87de69a011 Author: Ilya Leoshkevich Date: Tue Sep 19 12:09:09 2023 +0200 s390/bpf: Implement unconditional jump with 32-bit offset Implement the cpuv4 unconditional jump with 32-bit offset, which is encoded as BPF_JMP32 | BPF_JA and stores the offset in the imm field. Reuse the existing BPF_JMP | BPF_JA logic. Signed-off-by: Ilya Leoshkevich Link: https://lore.kernel.org/r/20230919101336.2223655-8-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov commit 90f426d35e01f7d19ede5f331c013f7d81ce670b Author: Ilya Leoshkevich Date: Tue Sep 19 12:09:08 2023 +0200 s390/bpf: Implement unconditional byte swap Implement the cpuv4 unconditional byte swap, which is encoded as BPF_ALU64 | BPF_END | BPF_FROM_LE. Since s390x is big-endian, it's the same as the existing BPF_ALU | BPF_END | BPF_FROM_LE. Signed-off-by: Ilya Leoshkevich Link: https://lore.kernel.org/r/20230919101336.2223655-7-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov commit 738476a079bd238a65c09c63e7437832d96b08e8 Author: Ilya Leoshkevich Date: Tue Sep 19 12:09:07 2023 +0200 s390/bpf: Implement BPF_MEMSX Implement the cpuv4 load with sign-extension, which is encoded as BPF_MEMSX (and, for internal uses cases only, BPF_PROBE_MEMSX). This is the same as BPF_MEM and BPF_PROBE_MEM, but with sign extension instead of zero extension, and s390x has the necessary instructions: lgb, lgh and lgf. Signed-off-by: Ilya Leoshkevich Link: https://lore.kernel.org/r/20230919101336.2223655-6-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov commit 3de55893f6482660e2f04454eb0e65a070523ba0 Author: Ilya Leoshkevich Date: Tue Sep 19 12:09:06 2023 +0200 s390/bpf: Implement BPF_MOV | BPF_X with sign-extension Implement the cpuv4 register-to-register move with sign extension. It is distinguished from the normal moves by non-zero values in insn->off, which determine the source size. s390x has instructions to deal with all of them: lbr, lhr, lgbr, lghr and lgfr. Signed-off-by: Ilya Leoshkevich Link: https://lore.kernel.org/r/20230919101336.2223655-5-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov commit 9873ce2e9c68193371c111a1a9f06064e36b9814 Author: Ilya Leoshkevich Date: Tue Sep 19 12:09:05 2023 +0200 selftests/bpf: Add big-endian support to the ldsx test Prepare the ldsx test to run on big-endian systems by adding the necessary endianness checks around narrow memory accesses. Signed-off-by: Ilya Leoshkevich Link: https://lore.kernel.org/r/20230919101336.2223655-4-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov commit 6cb66eca36f3c6b37447ca79c6d7fc6db339c23e Author: Ilya Leoshkevich Date: Tue Sep 19 12:09:04 2023 +0200 selftests/bpf: Unmount the cgroup2 work directory test_progs -t bind_perm,bpf_obj_pinning/mounted-str-rel fails when the selftests directory is mounted under /mnt, which is a reasonable thing to do when sharing the selftests residing on the host with a virtual machine, e.g., using 9p. The reason is that cgroup2 is mounted at /mnt and not unmounted, causing subsequent tests that need to access the selftests directory to fail. Fix by unmounting it. The kernel maintains a mount stack, so this reveals what was mounted there before. Introduce cgroup_workdir_mounted in order to maintain idempotency. Make it thread-local in order to support test_progs -j. Signed-off-by: Ilya Leoshkevich Link: https://lore.kernel.org/r/20230919101336.2223655-3-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov commit 577c06af8188d1f6919ef7b62fc1b78fb1b86eb7 Author: Ilya Leoshkevich Date: Tue Sep 19 12:09:03 2023 +0200 bpf: Disable zero-extension for BPF_MEMSX On the architectures that use bpf_jit_needs_zext(), e.g., s390x, the verifier incorrectly inserts a zero-extension after BPF_MEMSX, leading to miscompilations like the one below: 24: 89 1a ff fe 00 00 00 00 "r1 = *(s16 *)(r10 - 2);" # zext_dst set 0x3ff7fdb910e: lgh %r2,-2(%r13,%r0) # load halfword 0x3ff7fdb9114: llgfr %r2,%r2 # wrong! 25: 65 10 00 03 00 00 7f ff if r1 s> 32767 goto +3 # check_cond_jmp_op() Disable such zero-extensions. The JITs need to insert sign-extension themselves, if necessary. Suggested-by: Puranjay Mohan Signed-off-by: Ilya Leoshkevich Reviewed-by: Puranjay Mohan Link: https://lore.kernel.org/r/20230919101336.2223655-2-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov commit e9cbc89067cce78211c8629c78e931c0fe64e29d Merge: f30e5323a188c 27bbf45eae9ca Author: Paolo Abeni Date: Thu Sep 21 21:49:45 2023 +0200 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. No conflicts. Signed-off-by: Paolo Abeni commit bb6f53d4f5be085dd3cffdcb5e32719cdf63466b Author: Ville Syrjälä Date: Thu Sep 21 00:19:34 2023 +0300 drm/i915/bios: Fixup h/vsync_end instead of h/vtotal We have the same h/vsync_end vs. h/vtotal quirk in the VBT parser that was also present in EDID parser. Adjust the VBT parser the same way as was done for hte EDID parser to fixup h/vsync_end instead of h/vtotal. While I'm not currently aware of any machines that need this for the VBT it seems prudent to keep both parsers in sync. And while at it let's add some debugs here as well. A bit lackluster but didn't feel like plumbing the connector all the way down at this time. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230920211934.14920-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 0f3fa942d91165c2702577e9274d2ee1c7212afc Author: Javier Pello Date: Sat Sep 2 17:10:39 2023 +0200 drm/i915/gt: Fix reservation address in ggtt_reserve_guc_top There is an assertion in ggtt_reserve_guc_top that the global GTT is of size at least GUC_GGTT_TOP, which is not the case on a 32-bit platform; see commit 562d55d991b39ce376c492df2f7890fd6a541ffc ("drm/i915/bdw: Only use 2g GGTT for 32b platforms"). If GEM_BUG_ON is enabled, this triggers a BUG(); if GEM_BUG_ON is disabled, the subsequent reservation fails and the driver fails to initialise the device: i915 0000:00:02.0: [drm:i915_init_ggtt [i915]] Failed to reserve top of GGTT for GuC i915 0000:00:02.0: Device initialization failed (-28) i915 0000:00:02.0: Please file a bug on drm/i915; see https://gitlab.freedesktop.org/drm/intel/-/wikis/How-to-file-i915-bugs for details. i915: probe of 0000:00:02.0 failed with error -28 Make the reservation at the top of the available space, whatever that is, instead of assuming that the top will be GUC_GGTT_TOP. Fixes: 911800765ef6 ("drm/i915/uc: Reserve upper range of GGTT") Link: https://gitlab.freedesktop.org/drm/intel/-/issues/9080 Signed-off-by: Javier Pello Reviewed-by: Daniele Ceraolo Spurio Cc: Fernando Pacheco Cc: Chris Wilson Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: intel-gfx@lists.freedesktop.org Cc: stable@vger.kernel.org # v5.3+ Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230902171039.2229126186d697dbcf62d6d8@otheo.eu commit 2682768bde745b10ae126a322cdcaf532cf88851 Author: Ville Syrjälä Date: Thu Sep 21 00:19:33 2023 +0300 drm/edid: Fixup h/vsync_end instead of h/vtotal There are some weird EDIDs floating around that have the sync pulse extending beyond the end of the blanking period. On the currently problemtic machine (HP Omni 120) EDID reports the following mode: "1600x900": 60 108000 1600 1780 1860 1800 900 910 913 1000 0x40 0x5 which is then "corrected" to have htotal=1861 by the current drm_edid.c code. The fixup code was originally added in commit 7064fef56369 ("drm: work around EDIDs with bad htotal/vtotal values"). Googling around we end up in https://bugs.launchpad.net/ubuntu/hardy/+source/xserver-xorg-video-intel/+bug/297245 where we find an EDID for a Dell Studio 15, which reports: (II) VESA(0): clock: 65.0 MHz Image Size: 331 x 207 mm (II) VESA(0): h_active: 1280 h_sync: 1328 h_sync_end 1360 h_blank_end 1337 h_border: 0 (II) VESA(0): v_active: 800 v_sync: 803 v_sync_end 809 v_blanking: 810 v_border: 0 Note that if we use the hblank size (as opposed of the hsync_end) from the DTD to determine htotal we get exactly 60Hz refresh rate in both cases, whereas using hsync_end to determine htotal we get a slightly lower refresh rates. This makes me believe the using the hblank size is what was intended even in those cases. Also note that in case of the HP Onmi 120 the VBIOS boots with these: crtc timings: 108000 1600 1780 1860 1800 900 910 913 1000, type: 0x40 flags: 0x5 ie. it just blindly stuffs the bogus hsync_end and htotal from the DTD into the transcoder timing registers, and the display works. I believe the (at least more modern) hardware will automagically terminate the hsync pulse when the timing generator reaches htotal, which again points that we should use the hblank size to determine htotal. Unfortunatley the old bug reports for the Dell machines are extremely lacking in useful details so we have no idea what kind of timings the VBIOS programmed into the hardware :( Let's just flip this quirk around and reduce the length of the sync pulse instead of extending the blanking period. This at least seems to be the correct thing to do on more modern hardware. And if any issues crop up on older hardware we need to debug them properly. v2: Add debug message breadcrumbs (Jani) Reviewed-by: Jani Nikula Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8895 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230920211934.14920-1-ville.syrjala@linux.intel.com commit f1fce1cf4509aa0676b363c203b9ab190c1fd8e8 Author: Justin Stitt Date: Mon Sep 11 20:36:44 2023 +0000 ACPI: OSI: refactor deprecated strncpy() `strncpy()` is deprecated for use on NUL-terminated destination strings [1]. We know `osi->string` is a NUL-terminated string due to its eventual use in `acpi_install_interface()` and `acpi_remove_interface()` which expect a `acpi_string` which has been specifically typedef'd as: | typedef char *acpi_string; /* Null terminated ASCII string */ ... and which also has other string functions used on it like `strlen`. Furthermore, padding is not needed in this instance either. Due to the reasoning above a suitable replacement is `strscpy` [2] since it guarantees NUL-termination on the destination buffer and doesn't unnecessarily NUL-pad. While there is unlikely to be a buffer overread (or other related bug) in this case, we should still favor a more robust and less ambiguous interface. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: Rafael J. Wysocki commit 29441ab3a30a1a5e2dc35ea519bbd5dd210b7666 Author: Veronika Molnarova Date: Tue Sep 19 17:02:43 2023 +0200 perf test lock_contention.sh: Skip test if not enough CPUs Machines with less then 4 CPUs weren't consistently triggering lock events required for the test. Skip the test on those machines. The limit of 4 CPUs is set as it generates around 100 lock events for a test. Signed-off-by: Veronika Molnarova Acked-by: Michael Petlan Link: https://lore.kernel.org/r/20230919150419.23193-2-vmolnaro@redhat.com Signed-off-by: Namhyung Kim commit fa52d995d1d0b64e75f63571df2e57ba22ff0cb1 Author: Veronika Molnarova Date: Tue Sep 19 17:02:42 2023 +0200 perf test stat+shadow_stat.sh: Add threshold for rounding errors The test was failing in specific scenarios due to imperfection of FP arithmetics. The `bc` command wasn't correctly rounding the result of division causing the failure. Replace the `bc` with `awk` which should work with more decimal places and add a threshold to catch any possible rounding errors. The acceptable rounding error is set to 0.01 when the test passes with a warning message. Signed-off-by: Veronika Molnarova Acked-by: Michael Petlan Link: https://lore.kernel.org/r/20230919150419.23193-1-vmolnaro@redhat.com Signed-off-by: Namhyung Kim commit 83f5ad58daf1576640bec3aa2f81f003f8e6c48b Author: Su Hui Date: Thu Aug 31 15:34:56 2023 +0800 ACPI: OSL: add __printf format attribute to acpi_os_vprintf() With gcc and W=1 option to compile the kernel, warning occurs: drivers/acpi/osl.c:156:2: error: function ‘acpi_os_vprintf’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]. Allow the compiler to recognize and check format strings is safer. Signed-off-by: Su Hui [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit e2abc47a5a1a9f641e7cacdca643fdd40729bf6e Author: Shiju Jose Date: Thu Sep 21 02:03:36 2023 +0800 ACPI: APEI: Fix AER info corruption when error status data has multiple sections ghes_handle_aer() passes AER data to the PCI core for logging and recovery by calling aer_recover_queue() with a pointer to struct aer_capability_regs. The problem was that aer_recover_queue() queues the pointer directly without copying the aer_capability_regs data. The pointer was to the ghes->estatus buffer, which could be reused before aer_recover_work_func() reads the data. To avoid this problem, allocate a new aer_capability_regs structure from the ghes_estatus_pool, copy the AER data from the ghes->estatus buffer into it, pass a pointer to the new struct to aer_recover_queue(), and free it after aer_recover_work_func() has processed it. Reported-by: Bjorn Helgaas Acked-by: Bjorn Helgaas Signed-off-by: Shiju Jose [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki commit e68cb15bdc93b076eb222e6e435f89532d5a12e8 Author: Doug Smythies Date: Sun Sep 17 21:03:54 2023 -0700 tools/power/x86/intel_pstate_tracer: python minimum version Change the minimum python version from 2.7 to 3.6. Remove a 2.X backwards compatibility line. Signed-off-by: Doug Smythies Acked-by: Srinivas Pandruvada Reviewed-by: Mario Limonciello Tested-by: Swapnil Sapkal Signed-off-by: Rafael J. Wysocki commit 1ced5dce63d0a43eda3e81d2dd74e17f9c4a30b5 Author: Srinivas Pandruvada Date: Wed Sep 20 11:51:53 2023 -0700 thermal: int340x: processor_thermal: Ack all PCI interrupts All interrupts from the processor thermal PCI device require ACK. This is done by writing 0x01 at offset 0xDC in the config space. This is already done for the thereshold interrupt. Extend this for the workload hint interrupt. Fixes: e682b86211a1 ("thermal: int340x: Handle workload hint interrupts") Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit f0c7183008b41e92fa676406d87f18773724b48b Author: Brian Geffon Date: Thu Sep 21 13:00:45 2023 -0400 PM: hibernate: Use __get_safe_page() rather than touching the list We found at least one situation where the safe pages list was empty and get_buffer() would gladly try to use a NULL pointer. Signed-off-by: Brian Geffon Fixes: 8357376d3df2 ("[PATCH] swsusp: Improve handling of highmem") Cc: All applicable Signed-off-by: Rafael J. Wysocki commit 1de10b7d13a971f9ab90c5ed300b76d6e0c0db38 Author: Oliver Upton Date: Wed Sep 20 19:50:36 2023 +0000 KVM: arm64: Get rid of vCPU-scoped feature bitmap The vCPU-scoped feature bitmap was left in place a couple of releases ago in case the change to VM-scoped vCPU features broke anyone. Nobody has complained and the interop between VM and vCPU bitmaps is pretty gross. Throw it out. Link: https://lore.kernel.org/r/20230920195036.1169791-9-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 3d4b2a4cddd783bc5a75585a7cb6189a8a551b22 Author: Oliver Upton Date: Wed Sep 20 19:50:35 2023 +0000 KVM: arm64: Remove unused return value from kvm_reset_vcpu() Get rid of the return value for kvm_reset_vcpu() as there are no longer any cases where it returns a nonzero value. Link: https://lore.kernel.org/r/20230920195036.1169791-8-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit d99fb82fd35e816b3656141e5dd940dfd00d09fd Author: Oliver Upton Date: Wed Sep 20 19:50:34 2023 +0000 KVM: arm64: Hoist NV+SVE check into KVM_ARM_VCPU_INIT ioctl handler Move the feature check out of kvm_reset_vcpu() so we can make the function succeed uncondtitionally. Link: https://lore.kernel.org/r/20230920195036.1169791-7-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 12405b09926f0270f7033ed5293241180ea57343 Author: Oliver Upton Date: Wed Sep 20 19:50:33 2023 +0000 KVM: arm64: Prevent NV feature flag on systems w/o nested virt It would appear that userspace can select the NV feature flag regardless of whether the system actually supports the feature. Obviously a nested guest isn't getting far in this situation; let's reject the flag instead. Link: https://lore.kernel.org/r/20230920195036.1169791-6-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit baa28a53ddbe2d27377b9a4aeff5eb8b706c8d38 Author: Oliver Upton Date: Wed Sep 20 19:50:32 2023 +0000 KVM: arm64: Hoist PAuth checks into KVM_ARM_VCPU_INIT ioctl Test for feature support in the ioctl handler rather than kvm_reset_vcpu(). Continue to uphold our all-or-nothing policy with address and generic pointer authentication. Link: https://lore.kernel.org/r/20230920195036.1169791-5-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit be9c0c018389e0722a97ac5cd3152afff1111e37 Author: Oliver Upton Date: Wed Sep 20 19:50:31 2023 +0000 KVM: arm64: Hoist SVE check into KVM_ARM_VCPU_INIT ioctl handler Test that the system supports SVE before ever getting to kvm_reset_vcpu(). Link: https://lore.kernel.org/r/20230920195036.1169791-4-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit 9116db11feb521d9eaa850d3a6a8b713f59c6971 Author: Oliver Upton Date: Wed Sep 20 19:50:30 2023 +0000 KVM: arm64: Hoist PMUv3 check into KVM_ARM_VCPU_INIT ioctl handler Test that the system supports PMUv3 before ever getting to kvm_reset_vcpu(). Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20230920195036.1169791-3-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit ef150908b6bd80a54126dbec324bd63a24a5628a Author: Oliver Upton Date: Wed Sep 20 19:50:29 2023 +0000 KVM: arm64: Add generic check for system-supported vCPU features To date KVM has relied on kvm_reset_vcpu() failing when the vCPU feature flags are unsupported by the system. This is a bit messy since kvm_reset_vcpu() is called at runtime outside of the KVM_ARM_VCPU_INIT ioctl when it is expected to succeed. Further complicating the matter is that kvm_reset_vcpu() must tolerate be idemptotent to the config_lock, as it isn't consistently called with the lock held. Prepare to move feature compatibility checks out of kvm_reset_vcpu() with a 'generic' check that compares the user-provided flags with a computed maximum feature set for the system. Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20230920195036.1169791-2-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit f31ecf671ddc498f20219453395794ff2383e06b Author: Jens Axboe Date: Mon Jul 10 16:14:37 2023 -0600 io_uring: add IORING_OP_WAITID support This adds support for an async version of waitid(2), in a fully async version. If an event isn't immediately available, wait for a callback to trigger a retry. The format of the sqe is as follows: sqe->len The 'which', the idtype being queried/waited for. sqe->fd The 'pid' (or id) being waited for. sqe->file_index The 'options' being set. sqe->addr2 A pointer to siginfo_t, if any, being filled in. buf_index, add3, and waitid_flags are reserved/unused for now. waitid_flags will be used for options for this request type. One interesting use case may be to add multi-shot support, so that the request stays armed and posts a notification every time a monitored process state change occurs. Note that this does not support rusage, on Arnd's recommendation. See the waitid(2) man page for details on the arguments. Signed-off-by: Jens Axboe commit 2e521a2064bf8b26cf178c0f7644a70ed1a512fa Author: Jens Axboe Date: Tue Jul 11 10:40:31 2023 -0600 exit: add internal include file with helpers Move struct wait_opts and waitid_info into kernel/exit.h, and include function declarations for the recently added helpers. Make them non-static as well. This is in preparation for adding a waitid operation through io_uring. With the abtracted helpers, this is now possible. Signed-off-by: Jens Axboe commit eda7e9d409ce16960d5ed28bedf8a33b2667a93c Author: Jens Axboe Date: Tue Jul 11 10:38:23 2023 -0600 exit: add kernel_waitid_prepare() helper Move the setup logic out of kernel_waitid(), and into a separate helper. No functional changes intended in this patch. Signed-off-by: Jens Axboe commit 06a101ca45b296fe951692620b0bc49abf90c368 Author: Jens Axboe Date: Tue Jul 11 10:34:37 2023 -0600 exit: move core of do_wait() into helper Rather than have a maze of gotos, put the actual logic in __do_wait() and have do_wait() loop deal with waitqueue setup/teardown and whether to call __do_wait() again. No functional changes intended in this patch. Acked-by: Christian Brauner Signed-off-by: Jens Axboe commit 9d900d4ea352069de8728f11fe4b20051d64cc20 Author: Jens Axboe Date: Tue Jul 11 10:31:10 2023 -0600 exit: abstract out should_wake helper for child_wait_callback() Abstract out the helper that decides if we should wake up following a wake_up() callback on our internal waitqueue. No functional changes intended in this patch. Acked-by: Christian Brauner Signed-off-by: Jens Axboe commit fc68fcda049108478ee4704d8a3ad3e05cc72fd0 Author: Jens Axboe Date: Mon Sep 11 13:35:42 2023 -0600 io_uring/rw: add support for IORING_OP_READ_MULTISHOT This behaves like IORING_OP_READ, except: 1) It only supports pollable files (eg pipes, sockets, etc). Note that for sockets, you probably want to use recv/recvmsg with multishot instead. 2) It supports multishot mode, meaning it will repeatedly trigger a read and fill a buffer when data is available. This allows similar use to recv/recvmsg but on non-sockets, where a single request will repeatedly post a CQE whenever data is read from it. 3) Because of #2, it must be used with provided buffers. This is uniformly true across any request type that supports multishot and transfers data, with the reason being that it's obviously not possible to pass in a single buffer for the data, as multiple reads may very well trigger before an application has a chance to process previous CQEs and the data passed from them. Reviewed-by: Gabriel Krisman Bertazi Signed-off-by: Jens Axboe commit d2d778fbf9964e4e5b8d7420eba8ec5ce938e794 Author: Jens Axboe Date: Mon Sep 11 13:46:07 2023 -0600 io_uring/rw: mark readv/writev as vectored in the opcode definition This is cleaner than gating on the opcode type, particularly as more read/write type opcodes may be added. Then we can use that for the data import, and for __io_read() on whether or not we need to copy state. Reviewed-by: Gabriel Krisman Bertazi Signed-off-by: Jens Axboe commit a08d195b586a217d76b42062f88f375a3eedda4d Author: Jens Axboe Date: Mon Sep 11 13:31:56 2023 -0600 io_uring/rw: split io_read() into a helper Add __io_read() which does the grunt of the work, leaving the completion side to the new io_read(). No functional changes in this patch. Reviewed-by: Gabriel Krisman Bertazi Signed-off-by: Jens Axboe commit 918ce0906dcd685951439b2b5f5e9fd47ea9a8d7 Author: Douglas Anderson Date: Fri Sep 1 16:39:57 2023 -0700 drm/hisilicon/kirin: Call drm_atomic_helper_shutdown() at shutdown/unbind time Based on grepping through the source code this driver appears to be missing a call to drm_atomic_helper_shutdown() at system shutdown time and at driver unbind time. Among other things, this means that if a panel is in use that it won't be cleanly powered off at system shutdown time. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown/restart and at driver remove (or unbind) time comes straight out of the kernel doc "driver instance overview" in drm_drv.c. I have attempted to put this in the right place at unbind time. In most other DRM drivers the call is made right after the call to drm_kms_helper_poll_fini(), so I've put it there. That means that this call will also be made in the case that we hit errors in bind, since kirin_drm_kms_cleanup() is called both in the bind error path and in unbind. I believe this is harmless even though it's not needed in the bind error path. For handling shutdown, we rely on the common technique of seeing if the drvdata is NULL to know whether we need to call drm_atomic_helper_shutdown(). This makes it important to make sure that the drvdata is NULL if bind failed or if unbind was called. We don't need the actual check for NULL and we'll rely on the patch ("drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a noop"). Suggested-by: Maxime Ripard Acked-by: Maxime Ripard Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.6.I21e0916bbd276033f7d31979c0da171458dedd4d@changeid commit 3c4babae3c4a1ae05f8f3f5f3d50c440ead7ca6a Author: Douglas Anderson Date: Fri Sep 1 16:39:56 2023 -0700 drm: Call drm_atomic_helper_shutdown() at shutdown/remove time for misc drivers Based on grepping through the source code these drivers appear to be missing a call to drm_atomic_helper_shutdown() at system shutdown time and at driver remove (or unbind) time. Among other things, this means that if a panel is in use that it won't be cleanly powered off at system shutdown time. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown/restart and at driver remove (or unbind) time comes straight out of the kernel doc "driver instance overview" in drm_drv.c. A few notes about these fixes: - I confirmed that these drivers were all DRIVER_MODESET type drivers, which I believe makes this relevant. - I confirmed that these drivers were all DRIVER_ATOMIC. - When adding drm_atomic_helper_shutdown() to the remove/unbind path, I added it after drm_kms_helper_poll_fini() when the driver had it. This seemed to be what other drivers did. If drm_kms_helper_poll_fini() wasn't there I added it straight after drm_dev_unregister(). - This patch deals with drivers using the component model in similar ways as the patch ("drm: Call drm_atomic_helper_shutdown() at shutdown time for misc drivers") - These fixes rely on the patch ("drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a noop") to simplify shutdown. Suggested-by: Maxime Ripard Reviewed-by: Tomi Valkeinen Tested-by: Tomi Valkeinen # tilcdc Acked-by: Maxime Ripard Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.5.I771eb4bd03d8772b19e7dcfaef3e2c167bce5846@changeid commit 10c8204c8b172234f11a0482a89fb4affadfaab5 Author: Douglas Anderson Date: Fri Sep 1 16:39:55 2023 -0700 drm/ssd130x: Call drm_atomic_helper_shutdown() at remove time Based on grepping through the source code, this driver appears to be missing a call to drm_atomic_helper_shutdown() at remove time. Let's add it. The fact that we should call drm_atomic_helper_shutdown() in the case of OS driver remove comes straight out of the kernel doc "driver instance overview" in drm_drv.c. Suggested-by: Maxime Ripard Acked-by: Maxime Ripard Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.4.I4752a39ad9f8fd08b32c2b78a8a3e40491bfb5eb@changeid commit 013d382d11a29ee13023c21dade684f98e47ec5a Author: Douglas Anderson Date: Fri Sep 1 16:39:54 2023 -0700 drm/vc4: Call drm_atomic_helper_shutdown() at shutdown time Based on grepping through the source code these drivers appear to be missing a call to drm_atomic_helper_shutdown() at system shutdown time. Among other things, this means that if a panel is in use that it won't be cleanly powered off at system shutdown time. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown/restart comes straight out of the kernel doc "driver instance overview" in drm_drv.c. Suggested-by: Maxime Ripard Acked-by: Maxime Ripard Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.3.I10dbe099fb1059d304ba847d19fc45054f7ffe9f@changeid commit ce3d99c8349584bc0fbe1e21918a3ea1155343aa Author: Douglas Anderson Date: Fri Sep 1 16:39:53 2023 -0700 drm: Call drm_atomic_helper_shutdown() at shutdown time for misc drivers Based on grepping through the source code these drivers appear to be missing a call to drm_atomic_helper_shutdown() at system shutdown time. Among other things, this means that if a panel is in use that it won't be cleanly powered off at system shutdown time. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown/restart comes straight out of the kernel doc "driver instance overview" in drm_drv.c. All of the drivers in this patch were fairly straightforward to fix since they already had a call to drm_atomic_helper_shutdown() at remove/unbind time but were just lacking one at system shutdown. The only hitch is that some of these drivers use the component model to register/unregister their DRM devices. The shutdown callback is part of the original device. The typical solution here, based on how other DRM drivers do this, is to keep track of whether the device is bound based on drvdata. In most cases the drvdata is the drm_device, so we can just make sure it is NULL when the device is not bound. In some drivers, this required minor code changes. To make things simpler, drm_atomic_helper_shutdown() has been modified to consider a NULL drm_device as a noop in the patch ("drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a noop"). Suggested-by: Maxime Ripard Reviewed-by: Tomi Valkeinen Tested-by: Tomi Valkeinen Acked-by: Maxime Ripard Tested-by: Jernej Skrabec Reviewed-by: Jernej Skrabec Reviewed-by: Sui Jingfeng Tested-by: Sui Jingfeng Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.2.I9115e5d094a43e687978b0699cc1fe9f2a3452ea@changeid commit c478768ce80772e932f246d9ce0378f2a6b7cfeb Author: Douglas Anderson Date: Fri Sep 1 16:41:12 2023 -0700 drm/armada: Call drm_atomic_helper_shutdown() at shutdown time Based on grepping through the source code this driver appears to be missing a call to drm_atomic_helper_shutdown() at system shutdown time. Among other things, this means that if a panel is in use that it won't be cleanly powered off at system shutdown time. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown/restart comes straight out of the kernel doc "driver instance overview" in drm_drv.c. This driver was fairly easy to update. The drm_device is stored in the drvdata so we just have to make sure the drvdata is NULL whenever the device is not bound. To make things simpler, drm_atomic_helper_shutdown() has been modified to consider a NULL drm_device as a noop in the patch ("drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a noop"). Suggested-by: Maxime Ripard Reviewed-by: Maxime Ripard Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230901164111.RFT.1.I3d5598bd73a59b5ded71430736c93f67dc5dea61@changeid commit 0f4b5f972216782a4acb1ae00dcb55173847c2ff Author: peterz@infradead.org Date: Thu Sep 21 12:45:15 2023 +0200 futex: Add sys_futex_requeue() Finish off the 'simple' futex2 syscall group by adding sys_futex_requeue(). Unlike sys_futex_{wait,wake}() its arguments are too numerous to fit into a regular syscall. As such, use struct futex_waitv to pass the 'source' and 'destination' futexes to the syscall. This syscall implements what was previously known as FUTEX_CMP_REQUEUE and uses {val, uaddr, flags} for source and {uaddr, flags} for destination. This design explicitly allows requeueing between different types of futex by having a different flags word per uaddr. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Acked-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230921105248.511860556@noisy.programming.kicks-ass.net commit 27b88f3519e72d71c8cead6b835a26c171109c9b Author: peterz@infradead.org Date: Thu Sep 21 12:45:14 2023 +0200 futex: Add flags2 argument to futex_requeue() In order to support mixed size requeue, add a second flags argument to the internal futex_requeue() function. No functional change intended. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230921105248.396780136@noisy.programming.kicks-ass.net commit 3b63a55f498b763aba0886b244df613587a73c46 Author: peterz@infradead.org Date: Thu Sep 21 12:45:13 2023 +0200 futex: Propagate flags into get_futex_key() Instead of only passing FLAGS_SHARED as a boolean, pass down flags as a whole. No functional change intended. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230921105248.282857501@noisy.programming.kicks-ass.net commit cb8c4312afca1b2dc64107e7e7cea81911055612 Author: peterz@infradead.org Date: Thu Sep 21 12:45:12 2023 +0200 futex: Add sys_futex_wait() To complement sys_futex_waitv()/wake(), add sys_futex_wait(). This syscall implements what was previously known as FUTEX_WAIT_BITSET except it uses 'unsigned long' for the value and bitmask arguments, takes timespec and clockid_t arguments for the absolute timeout and uses FUTEX2 flags. The 'unsigned long' allows FUTEX2_SIZE_U64 on 64bit platforms. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Acked-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230921105248.164324363@noisy.programming.kicks-ass.net commit 43adf844951084c266f172561f84c5f8120dd60b Author: peterz@infradead.org Date: Thu Sep 21 12:45:11 2023 +0200 futex: FLAGS_STRICT The current semantics for futex_wake() are a bit loose, specifically asking for 0 futexes to be woken actually gets you 1. Adding a !nr check to sys_futex_wake() makes that it would return 0 for unaligned futex words, because that check comes in the shared futex_wake() function. Adding the !nr check there, would affect the legacy sys_futex() semantics. Hence frob a flag :-( Suggested-by: André Almeida Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230921105248.048643656@noisy.programming.kicks-ass.net commit 9f6c532f59b20580acf8ede9409c9b8dce6e74e1 Author: peterz@infradead.org Date: Thu Sep 21 12:45:10 2023 +0200 futex: Add sys_futex_wake() To complement sys_futex_waitv() add sys_futex_wake(). This syscall implements what was previously known as FUTEX_WAKE_BITSET except it uses 'unsigned long' for the bitmask and takes FUTEX2 flags. The 'unsigned long' allows FUTEX2_SIZE_U64 on 64bit platforms. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Acked-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230921105247.936205525@noisy.programming.kicks-ass.net commit 698eb826383616ce0e817d2384da6413d1439fb6 Author: peterz@infradead.org Date: Thu Sep 21 12:45:09 2023 +0200 futex: Validate futex value against futex size Ensure the futex value fits in the given futex size. Since this adds a constraint to an existing syscall, it might possibly change behaviour. Currently the value would be truncated to a u32 and any high bits would get silently lost. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230921105247.828934099@noisy.programming.kicks-ass.net commit 5694289ce183bc3336407a78c8c722a0b9208f9b Author: peterz@infradead.org Date: Thu Sep 21 12:45:08 2023 +0200 futex: Flag conversion Futex has 3 sets of flags: - legacy futex op bits - futex2 flags - internal flags Add a few helpers to convert from the API flags into the internal flags. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Reviewed-by: André Almeida Link: https://lore.kernel.org/r/20230921105247.722140574@noisy.programming.kicks-ass.net commit d6d08d24790e82c69a46ef78ae44fe1b1ed30775 Author: peterz@infradead.org Date: Thu Sep 21 12:45:07 2023 +0200 futex: Extend the FUTEX2 flags Add the definition for the missing but always intended extra sizes, and add a NUMA flag for the planned numa extention. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Reviewed-by: André Almeida Link: https://lore.kernel.org/r/20230921105247.617057368@noisy.programming.kicks-ass.net commit 4923954bbc4a760e0b2210e0cb5733726ac2e2e9 Author: peterz@infradead.org Date: Thu Sep 21 12:45:06 2023 +0200 futex: Clarify FUTEX2 flags sys_futex_waitv() is part of the futex2 series (the first and only so far) of syscalls and has a flags field per futex (as opposed to flags being encoded in the futex op). This new flags field has a new namespace, which unfortunately isn't super explicit. Notably it currently takes FUTEX_32 and FUTEX_PRIVATE_FLAG. Introduce the FUTEX2 namespace to clarify this Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Reviewed-by: André Almeida Link: https://lore.kernel.org/r/20230921105247.507327749@noisy.programming.kicks-ass.net commit 00a6d389b82477548e54d4813d504c2a7317ef7c Merge: 2f3fb85b25833 736064c64cf3f Author: Mark Brown Date: Thu Sep 21 17:45:30 2023 +0100 ASoC: Add rtq9128 audio amplifier Merge series from cy_huang@richtek.com: This patch series adds Richtek rtq9128 automotive audio amplifier support. It can deliver up to 4x75W into 4Ohm speaker from a 25V supply in automotive applications. commit 6cb9c8637c672584d4915559001020237840acba Author: Andy Shevchenko Date: Mon Sep 18 16:51:16 2023 +0300 platform/x86: think-lmi: Use strreplace() to replace a character by nul We can replace p = strchrnul(str, '$OLD'); *p = '\0'; with strreplace(str, '$OLD', '\0'); that does the compatible modification without a need of the temporary variable. Reviewed-by: Ilpo Järvinen Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230918135116.1248560-2-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit e621198016e99cddc097d32cd3b56b15cee27d91 Author: Andy Shevchenko Date: Mon Sep 18 16:51:15 2023 +0300 platform/x86: think-lmi: Replace kstrdup() + strreplace() with kstrdup_and_replace() Replace open coded functionalify of kstrdup_and_replace() with a call. Reviewed-by: Ilpo Järvinen Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230918135116.1248560-1-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit d5e2c23366d8fb86d06a7d8eb949f0dffc41b50c Author: Uwe Kleine-König Date: Sun Sep 17 22:38:05 2023 +0200 platform/surface: hotplug: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20230917203805.1149595-8-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 52f8a4b63b0e289b2b83b55a65993b3a7997836e Author: Uwe Kleine-König Date: Sun Sep 17 22:38:04 2023 +0200 platform/surface: gpe: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20230917203805.1149595-7-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 0c845611a20edcd803f9ab7fd2725922008fa178 Author: Uwe Kleine-König Date: Sun Sep 17 22:38:03 2023 +0200 platform/surface: dtx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20230917203805.1149595-6-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 09416e0f88a96d4783c17cfc29b9c9fd6d0000b1 Author: Uwe Kleine-König Date: Sun Sep 17 22:38:02 2023 +0200 platform/surface: aggregator-registry: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20230917203805.1149595-5-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 1cc995a6e4e81cdef91628a929992f2142836ffc Author: Uwe Kleine-König Date: Sun Sep 17 22:38:01 2023 +0200 platform/surface: aggregator-cdev: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20230917203805.1149595-4-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 342d7dce2f12f31b3397043c2ddb6e2c84503b32 Author: Uwe Kleine-König Date: Sun Sep 17 22:38:00 2023 +0200 platform/surface: acpi-notify: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20230917203805.1149595-3-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 8d53109dd66f20fe987206258d1371b163f48ead Author: Uwe Kleine-König Date: Sun Sep 17 22:37:59 2023 +0200 platform/surface: surface3-wmi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20230917203805.1149595-2-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 45ae16ec3a3d63375cd95317af66b844661e86c4 Author: Hans de Goede Date: Fri Sep 15 23:49:33 2023 +0200 platform/x86: x86-android-tablets: Fix Lenovo Yoga Tablet 2 830F/L vs 1050F/L detection gpio_crystalcove pin 10 is already in input mode and passing GPIOD_IN when requesting the GPIO changes its pull-up/-down settings causing the 830F/L to get misdetected as 1050F/L. Switch to using GPIOD_ASIS when requesting the GPIO to fix the misdetection. Fixes: 4014ae236b1d ("platform/x86: x86-android-tablets: Stop using gpiolib private APIs") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20230915214933.62595-1-hdegoede@redhat.com commit 318d97849fc2cb45b2238fdb9eaa714b5d669df5 Author: Mark Pearson Date: Tue Sep 19 10:15:26 2023 -0400 platform/x86: think-lmi: Add bulk save feature On Lenovo platforms there is a limitation in the number of times an attribute can be saved. This is an architectural limitation and it limits the number of attributes that can be modified to 48. A solution for this is instead of the attribute being saved after every modification allow a user to bulk set the attributes and then trigger a final save. This allows unlimited attributes. This patch introduces a save_settings attribute that can be configured to either single or bulk mode by the user. Single mode is the default but customers who want to avoid the 48 attribute limit can enable bulk mode. Displaying the save_settings attribute will display the enabled mode. When in bulk mode writing 'save' to the save_settings attribute will trigger a save. Once this has been done a reboot is required before more attributes can be modified. Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20230919141530.4805-1-mpearson-lenovo@squebb.ca Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit af78e5c309c4b797168c8ce87c60ca06b26b1e73 Author: Sudeep Holla Date: Thu Sep 21 12:24:15 2023 +0100 firmware: arm_scmi: Move power-domain driver to the pmdomain dir To simplify with maintenance let's move the Arm SCMI power-domain driver to the new pmdomain directory. Link: https://lore.kernel.org/all/20230921113328.3208651-1-sudeep.holla@arm.com Reviewed-by: Ulf Hansson Cc: Cristian Marussi Signed-off-by: Sudeep Holla commit 2af23ceb8624a419eaf40295c11fcb86ec9ee303 Author: Ulf Hansson Date: Tue Sep 19 14:16:05 2023 +0200 pmdomain: arm: Add the SCMI performance domain To enable support for performance scaling (DVFS) for generic devices with the SCMI performance protocol, let's add an SCMI performance domain. This is being modelled as a genpd provider, with support for performance scaling through genpd's ->set_performance_state() callback. Note that, this adds the initial support that allows consumer drivers for attached devices, to vote for a new performance state via calling the dev_pm_genpd_set_performance_state(). However, this should be avoided as it's in most cases preferred to use the OPP library to vote for a new OPP instead. The support using the OPP library isn't part of this change, but needs to be implemented from subsequent changes. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20230919121605.7304-1-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit 3dd91515ef43dd43e32e2a84e4bd881b64fb33ae Author: Ulf Hansson Date: Fri Aug 25 13:26:32 2023 +0200 PM: domains: Allow genpd providers to manage OPP tables directly by its FW In some cases the OPP tables aren't specified in device tree, but rather encoded in the FW. To allow a genpd provider to specify them dynamically instead, let's add a new genpd flag, GENPD_FLAG_OPP_TABLE_FW. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20230825112633.236607-13-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit 92b2028b00ff987272a10fee980c7412ae7ebea6 Author: Ulf Hansson Date: Fri Aug 25 13:26:31 2023 +0200 cpufreq: scmi: Add support to parse domain-id using #power-domain-cells The performance domain-id can be described in DT using the power-domains property or the clock property. The latter is already supported, so let's add support for the power-domains too. Signed-off-by: Ulf Hansson Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20230825112633.236607-12-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit 0ead1f3e158c44aa274f2d5c49be947fbfcdffe0 Author: Ulf Hansson Date: Fri Aug 25 13:26:30 2023 +0200 dt-bindings: power: Clarify performance capabilities of power-domains The power-domains bindings has in many years been used to describe so called performance-domains too. Rather than using a separate binding it has been convenient to re-use the power-domain bindings, as in some cases it's in fact a combination of the both that would be the best description. Therefore, let's make it more clear that the power-domains bindings can be used to describe a performance-domain too. Cc: "Rafael J. Wysocki" Cc: Kevin Hilman Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: Conor Dooley Cc: devicetree@vger.kernel.org Signed-off-by: Ulf Hansson Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230825112633.236607-11-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit e11c480b6df1942b8f9a6958c2d881d8a9a9fb3b Author: Ulf Hansson Date: Fri Aug 25 13:26:29 2023 +0200 dt-bindings: firmware: arm,scmi: Extend bindings for protocol@13 The protocol@13 node is describing the performance scaling option for the ARM SCMI interface, as a clock provider. This is unnecessary limiting, as performance scaling is in many cases not limited to switching a clock's frequency. Therefore, let's extend the binding so the interface can be modelled as a generic performance domain too. The common way to describe this, is to use the power-domain DT bindings, so let's use that. Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: Conor Dooley Cc: devicetree@vger.kernel.org Signed-off-by: Ulf Hansson Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230825112633.236607-10-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit 6e429adc60b1fa87b6e89d68cb9d1c0a8224d58a Author: Ulf Hansson Date: Fri Aug 25 13:26:28 2023 +0200 dt-bindings: arm: cpus: Add a power-domain-name for a performance-domain When an CPU's performance domain is managed through the SCMI firmware, let's enable us describe this as a consumer of a power-domain provider, which is the de-facto standard to use for performance domains. In this case, let's specify a corresponding power-domain-name, to point out the corresponding index for it. Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: Conor Dooley Cc: devicetree@vger.kernel.org Cc: Lorenzo Pieralisi Signed-off-by: Ulf Hansson Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230825112633.236607-9-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit 4f1f0bc8ed1647007ad4ad8d2b8ce0092bb22d43 Author: Ulf Hansson Date: Fri Aug 25 13:26:26 2023 +0200 cpufreq: scmi: Avoid one OF parsing in scmi_get_sharing_cpus() The domain-id for the cpu_dev has already been parsed at the point when scmi_get_sharing_cpus() is getting called. Let's pass it as an in-parameter to avoid the unnecessary OF parsing. Signed-off-by: Ulf Hansson Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20230825112633.236607-7-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit 9b578d83629e13f81a53d1695a4f700cdb10f772 Author: Ulf Hansson Date: Fri Aug 25 13:26:25 2023 +0200 firmware: arm_scmi: Drop redundant ->device_domain_id() from perf ops There are no longer any users of the ->device_domain_id() ops in the scmi_perf_proto_ops, therefore let's remove it. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20230825112633.236607-6-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit 39dfa5b9e1f0fa63b811a0a87f1c2fb9c76a0456 Author: Ulf Hansson Date: Fri Aug 25 13:26:24 2023 +0200 firmware: arm_scmi: Align perf ops to use domain-id as in-parameter Most scmi_perf_proto_ops are already using an "u32 domain" as an in-parameter to indicate what performance domain we shall operate upon. However, some of the ops are using a "struct device *dev", which means that an additional OF parsing is needed each time the perf ops gets called, to find the corresponding domain-id. To avoid the above, but also to make the code more consistent, let's replace the in-parameter "struct device *dev" with an "u32 domain". Note that, this requires us to make some corresponding changes to the scmi cpufreq driver, so let's do that too. Signed-off-by: Ulf Hansson Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20230825112633.236607-5-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit e336baa4193ecc788a06c0c4659e400bb53689b4 Author: Ulf Hansson Date: Fri Aug 25 13:26:23 2023 +0200 cpufreq: scmi: Prepare to move OF parsing of domain-id to cpufreq The OF parsing of the clock domain specifier seems to better belong in the scmi cpufreq driver, rather than being implemented behind the generic ->device_domain_id() perf protocol ops. To prepare to remove the ->device_domain_id() ops, let's implement the OF parsing in the scmi cpufreq driver instead. Signed-off-by: Ulf Hansson Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20230825112633.236607-4-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit 3d99ed60721bf2e108c8fc660775766057689a92 Author: Ulf Hansson Date: Fri Aug 25 13:26:22 2023 +0200 firmware: arm_scmi: Extend perf protocol ops to get information of a domain Similar to other protocol ops, it's useful for an scmi module driver to get some generic information of a performance domain. Therefore, let's add a new callback to provide this information. The information is currently limited to the name of the performance domain and whether the set-level operation is supported, although this can easily be extended if we find the need for it. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20230825112633.236607-3-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit 3d3696c0fed102c56a6addd81070d3679dba4fdf Author: Stanislav Lisovskiy Date: Tue Sep 19 12:21:28 2023 -0700 drm/i915/lnl: Start using CDCLK through PLL Introduce correspondent definitions for choosing between CD2X CDCLK and PLL CDCLK as a source. All the entries in cdclk table for xe2lpd are defined with PLL CDCLK as source, so simply set it. Also skl_cdclk_decimal() shouldn't be set in CDCLK_CTL anymore, so skip it for display version 20 and above. v2: - Remove unneeded comment and use REG_BIT() (Matt Roper) - Rename CDCLK_SOURCE_SEL_CDCLK_PLL() to MDCLK_SOURCE_SEL_CDCLK_PLL to match spec (Lucas) Signed-off-by: Stanislav Lisovskiy Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-22-lucas.demarchi@intel.com commit 43e18b0a54d700fdcc746293a5697a2097ee23f5 Author: Matt Roper Date: Tue Sep 19 12:21:27 2023 -0700 drm/i915/xe2lpd: Add DC state support Xe2_LPD supports DC5, DC6, and DC9 (DC3CO no longer exists). The overall programming and requirements to enter DC states are similar to those of Xe_LPD+ although AUX transactions do not require DC5/DC6 exit as they did previously. Bspec: 68851, 68857, 68886, 69115 Cc: Anusha Srivatsa Signed-off-by: Matt Roper Signed-off-by: Lucas De Marchi Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-21-lucas.demarchi@intel.com commit c2d9d8e7ee157f0ef78bcf5c0df149a4a03ae1cd Author: Ravi Kumar Vodapalli Date: Tue Sep 19 12:21:26 2023 -0700 drm/i915/xe2lpd: Add display power well Add Display Power Well for Xe2_LPD. It's mostly the same as Xe_LPD+, so reuse the code. PGPICA1 contains type-C capable port slices which requires the well to power powered up, so add new power well definition for it. The DC_OFF fake power well will be added in a follow up commit. v2: Do not rmw as bit 31 is the only R/W bit in the register (Matt Roper) BSpec: 68886 Signed-off-by: Ravi Kumar Vodapalli Signed-off-by: Gustavo Sousa Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-20-lucas.demarchi@intel.com commit 394b4b7df9f791dc2dcc95f29cda0961900da6e9 Author: Stanislav Lisovskiy Date: Tue Sep 19 12:21:25 2023 -0700 drm/i915/lnl: Add CDCLK table Add a new CDCLK table for Lunar Lake. v2: - Remove mdclk from the table as it's not needed (Matt Roper) - Update waveform values to the latest from spec (Matt Roper) - Rename functions and calculation to match by pixel rate (Lucas) v3: Keep only the table: as far as intel_pixel_rate_to_cdclk() is concerned, the minimum cdclk should still be half the pixel rate on Xe2 (bspec 68858: "Pipe maximum pixel rate = 2 * CDCLK frequency * Pipe Ratio") (Matt Roper) Bspec: 68861, 68858 Signed-off-by: Stanislav Lisovskiy Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-19-lucas.demarchi@intel.com commit 9d404dad0bf8c949a2c8dabdf280389c8262ddb9 Author: Lucas De Marchi Date: Tue Sep 19 12:21:24 2023 -0700 drm/i915/lnl: Add gmbus/ddc support LNL's south display uses the same table as MTP. Check for LNL's fake PCH to make it consistent with the other checks. The VBT table doesn't contain the VBT -> spec mapping for LNL. Like in other cases, uses the same as the previous platform. Bspec: 68971, 20124 Cc: Anusha Srivatsa Reviewed-by: Matt Roper Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-18-lucas.demarchi@intel.com commit f96fdcd2f41e1a6f7a827a0c354afa83515285bd Author: Lucas De Marchi Date: Tue Sep 19 12:21:23 2023 -0700 drm/i915/xe2lpd: Extend Wa_15010685871 Xe2_LPD also needs workaround 15010685871. While adding the new display version, also re-order the condition to follow the convention of new version first. v2: Remove redundant HAS_CDCLK_SQUASH(). As the platform or IP version needing the workaround are handpicked, there is no need to also check if tha platform has squashing support (Matt Roper) Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-17-lucas.demarchi@intel.com commit 696c331990cf6cf00506b9e56e0fe7a075cf47c5 Author: Gustavo Sousa Date: Tue Sep 19 12:21:22 2023 -0700 drm/i915/xe2lpd: Add support for HPD Hotplug setup for Xe2_LPD differs from Xe_LPD+ by the fact that the extra programming for hotplug inversion and DDI HPD filter duration is not necessary anymore. As mtp_hpd_irq_setup() is reasonably small, prefer to fork it into a new function for Xe2_LPD instead of adding a platform check. v2: Add extra bspec reference and fix missing else (Matt Roper) BSpec: 68970, 69940 Signed-off-by: Gustavo Sousa Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-16-lucas.demarchi@intel.com commit 533a7836d39f1a60dc78fb46f6cde9a25ffafe2d Author: Juha-Pekka Heikkilä Date: Tue Sep 19 12:21:21 2023 -0700 drm/i915/xe2lpd: Enable odd size and panning for planar yuv Enable odd size and panning for planar yuv formats. Cc: Suraj Kandpal Signed-off-by: Juha-Pekka Heikkilä Reviewed-by: Suraj Kandpal Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-15-lucas.demarchi@intel.com commit 6f35a04fd6636d749cb6dd3a937061ed4e7deb16 Author: Luca Coelho Date: Tue Sep 19 12:21:20 2023 -0700 drm/i915/xe2lpd: Read pin assignment from IOM Starting from display version 20, we need to read the pin assignment from the IOM TCSS_DDI_STATUS register instead of reading it from the FIA. We use the pin assignment to decide the maximum lane count. So, to support this change, add a new lnl_tc_port_get_max_lane_count() function that reads from the TCSS_DDI_STATUS register and decides the maximum lane count based on that. BSpec: 69594 Cc: Mika Kahola Signed-off-by: Luca Coelho Reviewed-by: Matt Roper Reviewed-by: Mika Kahola Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-14-lucas.demarchi@intel.com commit 925163b4af66dcf18e0f0dcd2ceffd3b7e5965af Author: Gustavo Sousa Date: Tue Sep 19 12:21:19 2023 -0700 drm/i915/xe2lpd: Handle port AUX interrupts Differently from previous version, Xe2_LPD groups all port AUX interrupt bits into PICA interrupt registers. While at it, drop some trailing newlines. BSpec: 68958, 69697 Signed-off-by: Gustavo Sousa Reviewed-by: Matt Roper Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-13-lucas.demarchi@intel.com commit 449f87e66df299a1b79567352cba1f5b29421fba Author: Lucas De Marchi Date: Tue Sep 19 12:21:18 2023 -0700 drm/i915/xe2lpd: Re-order DP AUX regs The address of CTL and DATA registers for DP AUX were changed in Xe2_LPD: now they are all in a single range, with CH_A and CH_B coming right after the USBC instances. Like was done when moving registers to PICA, use a helper macro to remap the ch passed to an index that can be used to calculate the right offset. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-12-lucas.demarchi@intel.com commit e9090e70e618cd62ab7bf2914511e5eea31a2535 Author: Ulf Hansson Date: Fri Aug 25 13:26:21 2023 +0200 firmware: arm_scmi: Extend perf protocol ops to get number of domains Similar to other protocol ops, it's useful for an scmi module driver to get the number of supported performance domains, hence let's make this available by adding a new perf protocol callback. Note that, a user is being added from subsequent changes. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20230825112633.236607-2-ulf.hansson@linaro.org Signed-off-by: Sudeep Holla commit 98a0465531a5982dd897fd81222a5d3465999951 Author: John Ogness Date: Wed Sep 20 17:58:38 2023 +0206 printk: fix illegal pbufs access for !CONFIG_PRINTK When CONFIG_PRINTK is not set, PRINTK_MESSAGE_MAX is 0. This leads to a zero-sized array @outbuf in @printk_shared_pbufs. In console_flush_all() a pointer to the first element of the array is assigned with: char *outbuf = &printk_shared_pbufs.outbuf[0]; For !CONFIG_PRINTK this leads to a compiler warning: warning: array subscript 0 is outside array bounds of 'char[0]' [-Warray-bounds] This is not really dangerous because printk_get_next_message() always returns false for !CONFIG_PRINTK, which leads to @outbuf never being used. However, it makes no sense to even compile these functions for !CONFIG_PRINTK. Extend the existing '#ifdef CONFIG_PRINTK' block to contain the formatting and emitting functions since these have no purpose in !CONFIG_PRINTK. This also allows removing several more !CONFIG_PRINTK dummies as well as moving @suppress_panic_printk into a CONFIG_PRINTK block. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309201724.M9BMAQIh-lkp@intel.com/ Signed-off-by: John Ogness Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20230920155238.670439-1-john.ogness@linutronix.de commit 858c19720c9ab6db003afc9e2ce8b1bfd3c32644 Author: Lucas De Marchi Date: Tue Sep 19 12:21:17 2023 -0700 drm/i915/display: Use _PICK_EVEN_2RANGES() in DP AUX regs XELPDP_DP_AUX_CH_CTL() and XELPDP_DP_AUX_CH_DATA() use 2 ranges. Prefer using _PICK_EVEN_2RANGES() over PICK(). Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-11-lucas.demarchi@intel.com commit dff869020b5c587d96faf12db7fa4ab8135a6a57 Author: Lucas De Marchi Date: Tue Sep 19 12:21:16 2023 -0700 drm/i915/display: Fix style and conventions for DP AUX regs Fix some whitespace issues for register definitions and keep the defines for DP_AUX_CH_CTL and DP_AUX_CH_DATA in the right place: together with the bit definition. While at it add a TODO entry that those defines shouldn't be using an implicit dev_priv. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-10-lucas.demarchi@intel.com commit b94c165ea1f10f88432282f6a3ff16ff469a437c Author: Clint Taylor Date: Tue Sep 19 12:21:15 2023 -0700 drm/i915/xe2lpd: Register DE_RRMR has been removed Do not read DE_RRMR register after display version 20. This register contains display state information during GFX state dumps. Bspec: 69456 Cc: Anusha Srivatsa Cc: Gustavo Sousa Signed-off-by: Clint Taylor Reviewed-by: Matt Roper Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-9-lucas.demarchi@intel.com commit 8ee35345adf13cea516a36c70b9ba997106cd11a Author: Matt Roper Date: Tue Sep 19 12:21:14 2023 -0700 drm/i915/xe2lpd: Don't try to program PLANE_AUX_DIST Since Xe2LPD technically has FlatCCS, it doesn't have AuxCCS registers like PLANE_AUX_DIST. However we currently have HAS_FLAT_CCS hardcoded to 0 since compression isn't ready; we need to make sure this doesn't cause the display code to go back to trying to write this register. Signed-off-by: Matt Roper Signed-off-by: Lucas De Marchi Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-8-lucas.demarchi@intel.com commit cfeff354f70bb1d0deb0279506e3f7989bc16e28 Author: Stanislav Lisovskiy Date: Tue Sep 19 12:21:13 2023 -0700 drm/i915/xe2lpd: Treat cursor plane as regular plane for DDB allocation We now start calculating relative plane data rate for cursor plane as well, as instructed by BSpec and also treat cursor plane same way as other planes, when doing allocation, i.e not using fixed allocation for cursor anymore. Bspec: 68907 Signed-off-by: Stanislav Lisovskiy Reviewed-by: Matt Roper Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-7-lucas.demarchi@intel.com commit 65578d0d10d841ef96c83ea21a8ada2c8694a1c9 Author: Gustavo Sousa Date: Tue Sep 19 12:21:12 2023 -0700 drm/i915/xe2lpd: Add fake PCH Xe2_LPD doesn't have south display engine on a PCH, it's actually on the SoC die (while north display engine is on compute die). As such it makes no sense to go through the PCI devices looking for an ISA bridge. The approach used by BXT/GLK can't be used here since leaving it with PCH_NONE would mean taking the wrong code paths. For the places we currently use a PCH check, it's enough for now to just check the north display version. Use that to define a fake PCH to be used across the driver. Eventually these PCH checks may need to be re-designed as this is already the third platform using/needing a fake PCH. v2: Match on display IP version rather than on platform (Matt Roper) v3: Extend and clarify commit message (Matt Roper / Ville) Signed-off-by: Gustavo Sousa Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-6-lucas.demarchi@intel.com commit 8dde2e68a55533a047423b7ac378c637eab468ef Author: Lucas De Marchi Date: Tue Sep 19 12:21:11 2023 -0700 drm/i915: Re-order if/else ladder in intel_detect_pch() Follow the convention of checking the last platform first and reword the comment to convey there are more platforms than just DG1. Reviewed-by: Matt Roper Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-5-lucas.demarchi@intel.com commit 212cf016d974d351c252d760a9d42d02b3954830 Author: Clint Taylor Date: Tue Sep 19 12:21:10 2023 -0700 drm/i915/display: Remove FBC capability from fused off pipes If a particular pipe is disabled by fuse also remove the FBC for that pipe. Bspec: 69464 Cc: Anusha Srivatsa Cc: Gustavo Sousa Signed-off-by: Clint Taylor Reviewed-by: Matt Roper Reviewed-by: Vinod Govindapillai Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-4-lucas.demarchi@intel.com commit 66fad3f2db8b3ef678cddb83bba50b85ffbb86b7 Author: Matt Roper Date: Tue Sep 19 12:21:09 2023 -0700 drm/i915/xe2lpd: FBC is now supported on all pipes FBC is no longer limited by pipe: add the defines for pipes B and C that will be used by platforms supporting FBC on such pipes. Bspec: 68881, 68904 Signed-off-by: Matt Roper Signed-off-by: Lucas De Marchi Reviewed-by: Vinod Govindapillai Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-3-lucas.demarchi@intel.com commit 464e8632b6002a402f47aeca4a2a089a2686b63a Author: Balasubramani Vivekanandan Date: Tue Sep 19 12:21:08 2023 -0700 drm/i915/lnl: Add display definitions Add Lunar Lake platform definitions for i915 display. The support for LNL will be added to the xe driver, with i915 only driving the display side. Xe2 display is derived from the Xe_LPD+ IP; additional feature deltas will be introduced in subsequent patches, so here it's just adding a separate xe2_lpd_display struct. v2: Use a LPDP_FEATURES macro (Matt Roper) Signed-off-by: Balasubramani Vivekanandan Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-2-lucas.demarchi@intel.com commit 3dc06a4fb31504c9efdb93fcba5520cbf01b2ccd Author: Lucas De Marchi Date: Tue Sep 19 12:21:07 2023 -0700 drm/i915/xelpdp: Add XE_LPDP_FEATURES Add a FEATURES macro for XE_LPD+ as this is expected to be the baseline for Xe2_LPD and will allow to see the delta more easily. v2: Move everything from xe_lpdp_display to the new macro and remove the version setting: it's not needed with GMD_ID. Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230919192128.2045154-1-lucas.demarchi@intel.com commit 56156a76e765d32009fee058697c591194d0829f Author: Konrad Dybcio Date: Wed Sep 13 11:53:26 2023 +0200 phy: qualcomm: phy-qcom-eusb2-repeater: Add tuning overrides There are devices in the wild, like the Sony Xperia 1 V that *require* different tuning than the base design for USB to work. Add support for overriding the necessary tuning values. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230830-topic-eusb2_override-v2-4-7d8c893d93f6@linaro.org Signed-off-by: Vinod Koul commit 99a517a582fc1272d1d3cf3b9e671a14d7db77b8 Author: Konrad Dybcio Date: Wed Sep 13 11:53:25 2023 +0200 phy: qualcomm: phy-qcom-eusb2-repeater: Zero out untouched tuning regs The vendor kernel zeroes out all tuning data outside the init sequence as part of initialization. Follow suit to avoid UB. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230830-topic-eusb2_override-v2-3-7d8c893d93f6@linaro.org Signed-off-by: Vinod Koul commit 4ba2e52718c0ce4ece6a269bec84319c355c030f Author: Konrad Dybcio Date: Wed Sep 13 11:53:24 2023 +0200 phy: qualcomm: phy-qcom-eusb2-repeater: Use regmap_fields Switch to regmap_fields, so that the values written into registers are sanitized by their explicit sizes and the different registers are structured in an iterable object to make external changes to the init sequence simpler. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230830-topic-eusb2_override-v2-2-7d8c893d93f6@linaro.org Signed-off-by: Vinod Koul commit c20b59b2996c89c4f072c3312e6210528a298330 Author: Konrad Dybcio Date: Wed Sep 13 11:53:23 2023 +0200 dt-bindings: phy: qcom,snps-eusb2-repeater: Add magic tuning overrides The EUSB2 repeater requires some alterations to its init sequence, depending on board design. Add support for making the necessary changes to that sequence to make USB functional on SM8550-based Xperia 1 V. They all have lackluster description due to lack of information. Signed-off-by: Konrad Dybcio Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230830-topic-eusb2_override-v2-1-7d8c893d93f6@linaro.org Signed-off-by: Vinod Koul commit 77fee21e3cc0e24c7e60e554cc069cb3572b4011 Author: Shuijing Li Date: Fri Sep 8 15:53:10 2023 +0800 dt-bindings: phy: Add compatible for Mediatek MT8188 Add dt-binding documentation of dsi-phy for MediaTek MT8188 SoC. Signed-off-by: Shuijing Li Acked-by: Conor Dooley Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230908075310.17825-1-shuijing.li@mediatek.com Signed-off-by: Vinod Koul commit 68320e35f8cb1987b4ad34347fc7033832da99e3 Author: Nitheesh Sekar Date: Mon Sep 4 12:06:33 2023 +0530 phy: qcom-m31: Add compatible, phy init sequence for IPQ5018 Add phy init sequence and compatible string for IPQ5018 chipset. Signed-off-by: Nitheesh Sekar Link: https://lore.kernel.org/r/20230904063635.24975-3-quic_nsekar@quicinc.com Signed-off-by: Vinod Koul commit 1852dfaacd3f4358bbfca134b63a02bbb30c1136 Author: Nitheesh Sekar Date: Mon Sep 4 12:06:32 2023 +0530 dt-bindings: phy: qcom,m31: Add IPQ5018 compatible IPQ5332 qcom,m31 phy driver can support IPQ5018. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Nitheesh Sekar Link: https://lore.kernel.org/r/20230904063635.24975-2-quic_nsekar@quicinc.com Signed-off-by: Vinod Koul commit 2d6064e96631668077504d535ad6bc8c6011a960 Author: Raphael Gallais-Pou Date: Wed Aug 23 15:22:24 2023 +0200 dt-bindings: phy: st: convert phy-stih407-usb to DT schema Convert the st,stih407-usb2-phy binding to DT schema format. Signed-off-by: Raphael Gallais-Pou Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230823132224.111326-1-rgallaispou@gmail.com Signed-off-by: Vinod Koul commit f30e5323a188cfc2d74b04f222cea0dbe9ffd6e6 Author: Colin Ian King Date: Tue Sep 19 10:36:06 2023 +0100 net: dsa: sja1105: make read-only const arrays static Don't populate read-only const arrays on the stack, instead make them static. Signed-off-by: Colin Ian King Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20230919093606.24446-1-colin.i.king@gmail.com Signed-off-by: Paolo Abeni commit 2be22aae6b18326426443d6c0cc9ac6985183a89 Author: Dmitry Baryshkov Date: Fri Aug 25 00:19:42 2023 +0300 phy: qcom-qmp-usb: populate offsets configuration Populate offsets configuration for the rest of USB PHYs to make it possible to switch them to the new (single-node) bindings style. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230824211952.1397699-7-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit dc32762214e4bb683bfb21dcb4ade10e27e11c6d Author: Dmitry Baryshkov Date: Fri Aug 25 00:19:41 2023 +0300 phy: qcom-qmp: move PCS MISC V4 registers to separate header Move PCS MISC V4 registers to the separate header. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230824211952.1397699-6-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit 6e9402261e8c85ec386b473ce3738d6e9d3e5013 Author: Dmitry Baryshkov Date: Fri Aug 25 00:19:40 2023 +0300 phy: qcom-qmp-usb: make QPHY_PCS_MISC_CLAMP_ENABLE access conditional The register QPHY_V[34]_PCS_MISC_CLAMP_ENABLE is present only on some SoC families. Other platforms (qcm2290) can have PCS_MISC region, but do not have this register. Add it to the register layout table and check that it is defined before toggling CLAMP settings. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230824211952.1397699-5-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit fcf63482f6a9d383f04e409bc50f00eecb74ae73 Author: Dmitry Baryshkov Date: Fri Aug 25 00:19:39 2023 +0300 phy: qcom-qmp-usb: rework reset handling All legacy bindings of USB PHYs use "phy", "common" resets, while newer style bindings use "phy", "phy_phy" resets. In preparation for converting existing legacy PHY bindings to use newer scheme, drop reset lists from configuration struture and reference reset lists directly. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230824211952.1397699-4-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit 7233090aba54d82a1ed64f125b32c3ac0b91803c Author: Dmitry Baryshkov Date: Fri Aug 25 00:19:38 2023 +0300 phy: qcom-qmp-usb: simplify clock handling For the existing PHYs for new binding we are going to drop ref_clk_src clock and always use ref clock. Rather than introducing additional code to handle legacy vs current bindings (and clock names), use devm_clk_bulk_get_optional() when new bindings are used and devm_clk_bulk_get_all() when legacy bindings are in place. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230824211952.1397699-3-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit 15c83637402c3654dbc7aac368119c3809a119fa Author: Dmitry Baryshkov Date: Fri Aug 25 00:19:37 2023 +0300 dt-bindings: phy: migrate QMP USB PHY bindings to qcom,sc8280xp-qmp-usb3-uni-phy.yaml Migrate legacy bindings (described in qcom,msm8996-qmp-usb3-phy.yaml) to qcom,sc8280xp-qmp-usb3-uni-phy.yaml. This removes a need to declare the child PHY node or split resource regions. Signed-off-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230824211952.1397699-2-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit 8abe9792d1ff7e60f911b56e8a2537be7e903576 Author: Nitin Rawat Date: Tue Sep 19 02:20:37 2023 +0530 phy: qcom-qmp-ufs: Add Phy Configuration support for SC7280 Add SC7280 specific register layout and table configs. Co-developed-by: Manish Pandey Signed-off-by: Manish Pandey Signed-off-by: Nitin Rawat Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230918205037.25658-3-quic_nitirawa@quicinc.com Signed-off-by: Vinod Koul commit 79eeac2e262545077be482b1a1700669e0c7d90c Author: Nitin Rawat Date: Tue Sep 19 02:20:36 2023 +0530 dt-bindings: phy: Add QMP UFS PHY comptible for SC7280 Document the QMP UFS PHY compatible for SC7280. Signed-off-by: Nitin Rawat Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230918205037.25658-2-quic_nitirawa@quicinc.com Signed-off-by: Vinod Koul commit 2f3fb85b258334a4247af5c92b4a21480ca5634e Author: Bard Liao Date: Thu Sep 21 14:43:17 2023 +0800 ASoC: hdac_hda: fix HDA patch loader support The array size is irrelevant with SNDRV_CARDS. dev_index is from codec address and the available codec number is HDA_MAX_CODECS. Also, hda_pvt->fw is for a temporary use, no need to add a new extra field in hdac_hda_priv{}. Fixes: 842a62a75e70 ("ASoC: hdac_hda: add HDA patch loader support") Signed-off-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20230921064317.2120452-1-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit f20161cf51657bf4c85380c0c1c80188a74f168d Author: Yang Li Date: Tue Sep 19 09:03:05 2023 +0800 netdev: Remove unneeded semicolon ./drivers/dpll/dpll_netlink.c:847:3-4: Unneeded semicolon Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6605 Signed-off-by: Yang Li Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309190540.RFwfIgO7-lkp@intel.com/ Link: https://lore.kernel.org/r/20230919010305.120991-1-yang.lee@linux.alibaba.com Signed-off-by: Paolo Abeni commit 34eb78f28e5a8f7fd155776cdcdd052325b47c6e Author: AngeloGioacchino Del Regno Date: Tue Sep 19 11:23:36 2023 +0200 remoteproc: mediatek: Refactor single core check and fix retrocompatibility In older devicetrees we had the ChromeOS EC in a node called "cros-ec" instead of the newer "cros-ec-rpmsg", but this driver is now checking only for the latter, breaking compatibility with those. Besides, we can check if the SCP is single or dual core by simply walking through the children of the main SCP node and checking if if there's more than one "mediatek,scp-core" compatible node. Fixes: 1fdbf0cdde98 ("remoteproc: mediatek: Probe SCP cluster on multi-core SCP") Reported-by: "kernelci.org bot" Tested-by: Laura Nao Reviewed-by: Chen-Yu Tsai Tested-by: Chen-Yu Tsai Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230919092336.51007-1-angelogioacchino.delregno@collabora.com Signed-off-by: Mathieu Poirier commit cd273b7f1d8dcacb2e9a9a62280b6daba70a5efe Author: Maxime Ripard Date: Thu Sep 21 13:00:38 2023 +0200 MAINTAINERS: Update gma500 git repo The GMA500 driver has been handled through drm-misc for a while but the git repo hasn't been updated. Make sure it points to the right place. Acked-by: Patrik Jakobsson Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230921110038.2613604-1-mripard@kernel.org commit 90f7af497a78bf920a63119f2c7e9dcd98d028fe Author: Varadarajan Narayanan Date: Thu Aug 31 14:47:43 2023 +0530 phy: qcom: m31: Fix indentation issues Fix incorrect indentation Reviewed-by: Dmitry Baryshkov Signed-off-by: Varadarajan Narayanan Link: https://lore.kernel.org/r/7ca6fa68ba33742fcf65147c038c1102cc4901b4.1693468292.git.quic_varada@quicinc.com Signed-off-by: Vinod Koul commit 736064c64cf3fc51c6090884a9f4efe047f9f616 Author: ChiYuan Huang Date: Wed Sep 20 11:50:34 2023 +0800 ASoC: codecs: Add Richtek rtq9128 audio amplifier support Add Richtek rtq9128 automotive audio amplifier. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1695181834-5809-3-git-send-email-cy_huang@richtek.com Signed-off-by: Mark Brown commit 0339eadb871ab1ebf249932fecb75ab13cc3c565 Author: ChiYuan Huang Date: Wed Sep 20 11:50:33 2023 +0800 ASoC: dt-bindings: Add Richtek rtq9128 audio amplifier Create richtek,rtq9128.yaml for rtq9128 amplifier. Signed-off-by: ChiYuan Huang Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1695181834-5809-2-git-send-email-cy_huang@richtek.com Signed-off-by: Mark Brown commit a234990f62b86395e7fa358a76bae5a1fc08b80d Author: Ville Syrjälä Date: Tue Sep 19 12:56:59 2023 +0300 Revert "drm/i915/mst: Populate connector->ddc" This reverts commit 959fb1a686528df1b8fb0cc7bec8ff851b1594a5. Looks like the core MST code might not call i2c_adapter() for us in time, and thus creating the ddc symlink will fail. This will in fact fail the entire connector registration, but the MST code doesn't really seem to care about that and blindly plows ahead. All we may get in the logs is a nearly back to back register+unregister debug messages: [drm:drm_dp_mst_connector_late_register [drm_display_helper]] registering DPMST remote bus for card0-DP-7 [drm:intel_dp_hpd_pulse [i915]] DPRX ESI: 42 00 00 02 [drm:drm_dp_mst_connector_early_unregister [drm_display_helper]] unregistering DPMST remote bus for card0-DP-7 Untangling the initialization order may take some real work, so let's just revert the ddc symlink addition for now... Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9357 Fixes: 959fb1a68652 ("drm/i915/mst: Populate connector->ddc") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230919095659.10742-1-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Tested-by: Karthik B S commit a29e2a48afe3549ee34d39cf42343ba3fced09c6 Author: Andrew Jones Date: Mon Sep 18 15:15:25 2023 +0200 RISC-V: selftests: Add CBO tests Add hwprobe test for Zicboz and its block size. Also, when Zicboz is present, test that cbo.zero may be issued and works. Additionally provide a command line option that enables testing that the Zicbom instructions cause SIGILL and also that cbo.zero causes SIGILL when Zicboz it's not present. The SIGILL tests require "opt-in" with a command line option because the RISC-V ISA does not require unimplemented standard opcodes to issue illegal-instruction exceptions (but hopefully most platforms do). Pinning the test to a subset of cpus with taskset will also restrict the hwprobe calls to that set. Signed-off-by: Andrew Jones Reviewed-by: Xiao Wang Link: https://lore.kernel.org/r/20230918131518.56803-14-ajones@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 2f248e0f8a6aa7199f435d77d94b53cf647e7d7b Author: Andrew Jones Date: Mon Sep 18 15:15:24 2023 +0200 RISC-V: selftests: Convert hwprobe test to kselftest API Returning (exiting with) negative exit codes isn't user friendly, because the user must output the exit code with the shell, convert it from its unsigned 8-bit value back to the negative value, and then look up where that comes from in the code (which may be multiple places). Use the kselftests TAP interface, instead. Signed-off-by: Andrew Jones Link: https://lore.kernel.org/r/20230918131518.56803-13-ajones@ventanamicro.com Signed-off-by: Palmer Dabbelt commit fc9fdf2c5ab71e27e64b9e14606b677cc2e45884 Author: Andrew Jones Date: Mon Sep 18 15:15:23 2023 +0200 RISC-V: selftests: Statically link hwprobe test Statically linking makes it more convenient to copy the test to a minimal busybox environment. Signed-off-by: Andrew Jones Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230918131518.56803-12-ajones@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 9c7646d5ffd2b8bf720a0b77897f6c5095dfc53b Author: Andrew Jones Date: Mon Sep 18 15:15:22 2023 +0200 RISC-V: hwprobe: Expose Zicboz extension and its block size Expose Zicboz through hwprobe and also provide a key to extract its respective block size. Opportunistically add a macro and apply it to current extensions in order to avoid duplicating code. Signed-off-by: Andrew Jones Reviewed-by: Evan Green Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230918131518.56803-11-ajones@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 43c16d51a19b0ba2ed66978d5924d486ec1e42bc Author: Andrew Jones Date: Mon Sep 18 15:15:21 2023 +0200 RISC-V: Enable cbo.zero in usermode When Zicboz is present, enable its instruction (cbo.zero) in usermode by setting its respective senvcfg bit. We don't bother trying to set this bit per-task, which would also require an interface for tasks to request enabling and/or disabling. Instead, permanently set the bit for each hart which has the extension when bringing it online. This patch also introduces riscv_cpu_has_extension_[un]likely() functions to check a specific hart's ISA bitmap for extensions. Prior to checking the specific hart's bitmap in these functions we try the bitmap which represents the LCD of extensions, but only when we know it will use its optimized, alternatives path by gating its call on CONFIG_RISCV_ALTERNATIVE. When alternatives are used, the compiler ensures that the invocation of the LCD search becomes a constant true or false. When it's true, even the new functions will completely vanish from their callsites. OTOH, when the LCD check is false, we need to do a search of the hart's ISA bitmap. Had we also checked the LCD bitmap without the use of alternatives, then we would have ended up with two bitmap searches instead of one. Signed-off-by: Andrew Jones Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230918131518.56803-10-ajones@ventanamicro.com Signed-off-by: Palmer Dabbelt commit 181f2a28d6884eee139a1aab5fc0ad5432b3caba Author: Andrew Jones Date: Mon Sep 18 15:15:20 2023 +0200 RISC-V: Make zicbom/zicboz errors consistent commit c818fea83de4 ("riscv: say disabling zicbom if no or bad riscv,cbom-block-size found") improved the error messages for zicbom but zicboz was missed since its patches were in flight at the same time. Get 'em now. Signed-off-by: Andrew Jones Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230918131518.56803-9-ajones@ventanamicro.com Signed-off-by: Palmer Dabbelt commit b17e6840882dc8a04e7464270906d79954378d41 Author: Badal Nilawar Date: Wed Sep 20 14:36:20 2023 +0530 drm/i915/gt: Update RC6 mask for mtl_drpc It has been observed sometimes RC6 status register's unused bits are being set by h/w, without affecting RC6 functionality therefore updating the mask with used bits accordingly. As mtl_drpc is debugfs function, removing MISSING_CASE from default case as it doesn't make sense to panic (panic_on_warn=1) the CI system if register is reporting unsupported state. Cc: Anshuman Gupta Signed-off-by: Badal Nilawar Reviewed-by: Anshuman Gupta Signed-off-by: Anshuman Gupta Link: https://patchwork.freedesktop.org/patch/msgid/20230920090620.3255091-1-badal.nilawar@intel.com commit 71b263e79370348349553ecdf46f4a69eb436dc7 Merge: b3af9c0e89ca7 581512a6dc939 Author: Paolo Abeni Date: Thu Sep 21 12:34:02 2023 +0200 Merge branch 'vsock-virtio-vhost-msg_zerocopy-preparations' Arseniy Krasnov says: ==================== vsock/virtio/vhost: MSG_ZEROCOPY preparations this patchset is first of three parts of another big patchset for MSG_ZEROCOPY flag support: https://lore.kernel.org/netdev/20230701063947.3422088-1-AVKrasnov@sberdevices.ru/ During review of this series, Stefano Garzarella suggested to split it for three parts to simplify review and merging: 1) virtio and vhost updates (for fragged skbs) <--- this patchset 2) AF_VSOCK updates (allows to enable MSG_ZEROCOPY mode and read tx completions) and update for Documentation/. 3) Updates for tests and utils. This series enables handling of fragged skbs in virtio and vhost parts. Newly logic won't be triggered, because SO_ZEROCOPY options is still impossible to enable at this moment (next bunch of patches from big set above will enable it). ==================== Link: https://lore.kernel.org/r/20230916130918.4105122-1-avkrasnov@salutedevices.com Signed-off-by: Paolo Abeni commit 581512a6dc939ef122e49336626ae159f3b8a345 Author: Arseniy Krasnov Date: Sat Sep 16 16:09:18 2023 +0300 vsock/virtio: MSG_ZEROCOPY flag support This adds handling of MSG_ZEROCOPY flag on transmission path: 1) If this flag is set and zerocopy transmission is possible (enabled in socket options and transport allows zerocopy), then non-linear skb will be created and filled with the pages of user's buffer. Pages of user's buffer are locked in memory by 'get_user_pages()'. 2) Replaces way of skb owning: instead of 'skb_set_owner_sk_safe()' it calls 'skb_set_owner_w()'. Reason of this change is that '__zerocopy_sg_from_iter()' increments 'sk_wmem_alloc' of socket, so to decrease this field correctly, proper skb destructor is needed: 'sock_wfree()'. This destructor is set by 'skb_set_owner_w()'. 3) Adds new callback to 'struct virtio_transport': 'can_msgzerocopy'. If this callback is set, then transport needs extra check to be able to send provided number of buffers in zerocopy mode. Currently, the only transport that needs this callback set is virtio, because this transport adds new buffers to the virtio queue and we need to check, that number of these buffers is less than size of the queue (it is required by virtio spec). vhost and loopback transports don't need this check. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Signed-off-by: Paolo Abeni commit 4b0bf10eb077cb43c09746251ef3608d62c45667 Author: Arseniy Krasnov Date: Sat Sep 16 16:09:17 2023 +0300 vsock/virtio: non-linear skb handling for tap For tap device new skb is created and data from the current skb is copied to it. This adds copying data from non-linear skb to new the skb. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Signed-off-by: Paolo Abeni commit 64c99d2d6adac80cb17669736e32bdb331d68193 Author: Arseniy Krasnov Date: Sat Sep 16 16:09:16 2023 +0300 vsock/virtio: support to send non-linear skb For non-linear skb use its pages from fragment array as buffers in virtio tx queue. These pages are already pinned by 'get_user_pages()' during such skb creation. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Signed-off-by: Paolo Abeni commit 0df7cd3c13e44d01f9f28e29cbce74e2931b00fe Author: Arseniy Krasnov Date: Sat Sep 16 16:09:15 2023 +0300 vsock/virtio/vhost: read data from non-linear skb This is preparation patch for MSG_ZEROCOPY support. It adds handling of non-linear skbs by replacing direct calls of 'memcpy_to_msg()' with 'skb_copy_datagram_iter()'. Main advantage of the second one is that it can handle paged part of the skb by using 'kmap()' on each page, but if there are no pages in the skb, it behaves like simple copying to iov iterator. This patch also adds new field to the control block of skb - this value shows current offset in the skb to read next portion of data (it doesn't matter linear it or not). Idea behind this field is that 'skb_copy_datagram_iter()' handles both types of skb internally - it just needs an offset from which to copy data from the given skb. This offset is incremented on each read from skb. This approach allows to simplify handling of both linear and non-linear skbs, because for linear skb we need to call 'skb_pull()' after reading data from it, while in non-linear case we need to update 'data_len'. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Signed-off-by: Paolo Abeni commit 26a8e32e6d77900819c0c730fbfb393692dbbeea Author: Matthew Wilcox (Oracle) Date: Tue Sep 19 20:48:55 2023 +0100 i915: Limit the length of an sg list to the requested length The folio conversion changed the behaviour of shmem_sg_alloc_table() to put the entire length of the last folio into the sg list, even if the sg list should have been shorter. gen8_ggtt_insert_entries() relied on the list being the right length and would overrun the end of the page tables. Other functions may also have been affected. Clamp the length of the last entry in the sg list to be the expected length. Signed-off-by: Matthew Wilcox (Oracle) Fixes: 0b62af28f249 ("i915: convert shmem_sg_free_table() to use a folio_batch") Cc: stable@vger.kernel.org # 6.5.x Link: https://gitlab.freedesktop.org/drm/intel/-/issues/9256 Link: https://lore.kernel.org/lkml/6287208.lOV4Wx5bFT@natalenko.name/ Reported-by: Oleksandr Natalenko Tested-by: Oleksandr Natalenko Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20230919194855.347582-1-willy@infradead.org commit 95b0f3aa71eb09d067d89395fdb7f2dd87feae18 Author: Bjorn Andersson Date: Fri Jul 21 09:49:01 2023 -0700 soundwire: qcom: Log clk_get("iface") failures Failing to acquire the iface clock makes probing of the Qualcomm SoundWire driver fail without providing any indication to the user. Make the driver log the error to aid debugging system configuration issues. Signed-off-by: Bjorn Andersson Reviewed-by: Andrew Halaney Link: https://lore.kernel.org/r/20230721164901.2155287-1-quic_bjorande@quicinc.com Signed-off-by: Vinod Koul commit 16d568c8f646933710c980783d87d3f59a89b563 Author: Krzysztof Kozlowski Date: Fri Jul 28 13:28:48 2023 +0200 soundwire: qcom: handle command ignored interrupt Qualcomm Soundwire v2.0.0 controller comes with new interrupt bit for ignored commands. Add code to handle it in the interrupt service routine. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230728112848.67092-2-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 5d78c7d684192e42241593a936ee60003d8ac064 Author: Krzysztof Kozlowski Date: Fri Jul 28 13:28:47 2023 +0200 soundwire: qcom: use newer link status tregister on v2.0.0 Soundwire v2.0.0 comes with a new register LINK_STATUS for the FRAME_GEN_ENABLED field (bit indicating that an active frame is running). The old register COMP_STATUS is still there and still works, although the new one is preferred in downstream sources. Probably because it allows to choose Soundwire instance per CPU. Most of the code allowing to use new register for Soundwire v2.0.0 was already there as part of commit 312355a6a9f6 ("soundwire: qcom: add support for v2.0.0 controller"), so switch to it in swrm_wait_for_frame_gen_enabled() function. This should not have functional impact, because the old register still behaves correctly. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230728112848.67092-1-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul commit 1632d47fae2f2d229dd432854c4443ebb0bb27a4 Author: Ingo Molnar Date: Thu Sep 21 11:28:48 2023 +0200 sched/headers: Standardize the header guard #endif Signed-off-by: Ingo Molnar commit 0f9a1a4d234c064d8dff69cf3f3755554dd479ec Author: Ingo Molnar Date: Thu Sep 21 11:27:37 2023 +0200 sched/headers: Standardize the header guard #endif Signed-off-by: Ingo Molnar commit 6eddb116dd830436afbd922568292867de6c8b9e Author: Ingo Molnar Date: Thu Sep 21 11:24:17 2023 +0200 sched/headers: Standardize the header guard name Use the same _LINUX_SCHED_ prefix nomenclature as the other 29 header guards in include/linux/sched/ do. Signed-off-by: Ingo Molnar commit 3ba78da711940ce07c39c4cdd1f4ad284067a42d Author: Ingo Molnar Date: Sun Jun 6 13:27:15 2021 +0200 sched/headers: Add header guard to It's the only non-trivial header in include/linux/sched/ missing a header guard. Signed-off-by: Ingo Molnar commit 57baabe36573c1dc22a53a9ceed748d3e28fe910 Author: Yang Li Date: Wed Aug 16 08:38:42 2023 +0800 x86/platform/uv/apic: Clean up inconsistent indenting Signed-off-by: Yang Li Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230816003842.116574-1-yang.lee@linux.alibaba.com commit c6f4a90022524d06f6d9de323b1757031dcf0c26 Author: Guo Ren Date: Fri Sep 8 11:43:39 2023 -0400 asm-generic: ticket-lock: Optimize arch_spin_value_unlocked() The arch_spin_value_unlocked() of ticket-lock would cause the compiler to generate inefficient asm code in riscv architecture because of unnecessary memory access to the contended value. Before the patch: void lockref_get(struct lockref *lockref) { 78: fd010113 add sp,sp,-48 7c: 02813023 sd s0,32(sp) 80: 02113423 sd ra,40(sp) 84: 03010413 add s0,sp,48 0000000000000088 <.LBB296>: CMPXCHG_LOOP( 88: 00053783 ld a5,0(a0) After the patch: void lockref_get(struct lockref *lockref) { CMPXCHG_LOOP( 78: 00053783 ld a5,0(a0) After the patch, the lockref_get() could get in a fast path instead of the function's prologue. This is because ticket lock complex logic would limit compiler optimization for the spinlock fast path, and qspinlock won't. The caller of arch_spin_value_unlocked() could benefit from this change. Currently, the only caller is lockref. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Signed-off-by: Ingo Molnar Acked-by: Waiman Long Acked-by: Will Deacon Link: https://lore.kernel.org/r/20230908154339.3250567-1-guoren@kernel.org commit 9066794113c4813b6ce4a66ed6ce14ecdf35625d Author: Dmitry Antipov Date: Thu Aug 24 10:50:45 2023 +0300 wifi: ath11k: remove unused members of 'struct ath11k_base' Remove set but otherwise unused 'wlan_init_status' and 'wmi_ready' members of 'struct ath11k_base', adjust 'ath11k_wmi_tlv_rdy_parse()' accordingly. Signed-off-by: Dmitry Antipov Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230824075121.121144-2-dmantipov@yandex.ru commit 82ae3f4635382ff23e2ece55b5d5e713223951ec Author: Dmitry Antipov Date: Thu Aug 24 10:50:44 2023 +0300 wifi: ath11k: drop redundant check in ath11k_dp_rx_mon_dest_process() In 'ath11k_dp_rx_mon_dest_process()', 'mon_dst_srng' points to a member of 'srng_list', which is a fixed-size array inside 'struct ath11k_hal'. This way, if 'ring_id' is valid (i. e. between 0 and HAL_SRNG_RING_ID_MAX - 1 inclusive), 'mon_dst_srng' can't be NULL and so relevant check may be dropped. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230824075121.121144-1-dmantipov@yandex.ru commit ac13a7842ab46a87aa315514d6d7e19b03cb2adc Author: Dmitry Antipov Date: Wed Sep 6 12:36:55 2023 +0300 wifi: ath11k: drop NULL pointer check in ath11k_update_per_peer_tx_stats() Since 'user_stats' is a fixed-size array of 'struct htt_ppdu_user_stats' in 'struct htt_ppdu_stats', any of its member can't be NULL and so relevant check may be dropped. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230906093704.14001-1-dmantipov@yandex.ru commit 39564b475ac5a589e6c22c43a08cbd283c295d2c Author: Baochen Qiang Date: Thu Sep 7 09:56:06 2023 +0800 wifi: ath11k: fix boot failure with one MSI vector Commit 5b32b6dd96633 ("ath11k: Remove core PCI references from PCI common code") breaks with one MSI vector because it moves affinity setting after IRQ request, see below log: [ 1417.278835] ath11k_pci 0000:02:00.0: failed to receive control response completion, polling.. [ 1418.302829] ath11k_pci 0000:02:00.0: Service connect timeout [ 1418.302833] ath11k_pci 0000:02:00.0: failed to connect to HTT: -110 [ 1418.303669] ath11k_pci 0000:02:00.0: failed to start core: -110 The detail is, if do affinity request after IRQ activated, which is done in request_irq(), kernel caches that request and returns success directly. Later when a subsequent MHI interrupt is fired, kernel will do the real affinity setting work, as a result, changs the MSI vector. However at that time host has configured old vector to hardware, so host never receives CE or DP interrupts. Fix it by setting affinity before registering MHI controller where host is, for the first time, doing IRQ request. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-01160-QCAMSLSWPLZ-1 Fixes: 5b32b6dd9663 ("ath11k: Remove core PCI references from PCI common code") Signed-off-by: Baochen Qiang Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230907015606.16297-1-quic_bqiang@quicinc.com commit 30e7099a6dc95e46f94609d0fba787b9deb369a6 Author: Dmitry Antipov Date: Thu Sep 14 19:07:03 2023 +0300 wifi: ath10k: drop HTT_DATA_TX_STATUS_DOWNLOAD_FAIL According to Jeff, 'HTT_DATA_TX_STATUS_DOWNLOAD_FAIL' from 'enum htt_data_tx_status' is never actually used by the firmware code and so may be dropped, with the related adjustment to 'ath10k_htt_rx_tx_compl_ind()'. Suggested-by: Jeff Johnson Signed-off-by: Dmitry Antipov Found by Linux Verification Center (linuxtesting.org) with SVACE. Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230914160744.155903-1-dmantipov@yandex.ru commit 3f856f29551f0cbb8573eadd4d278765a3b95d40 Author: Kees Cook Date: Fri Sep 15 13:06:36 2023 -0700 wifi: ath10k: Annotate struct ath10k_ce_ring with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ath10k_ce_ring. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Kalle Valo Cc: Jeff Johnson Cc: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Signed-off-by: Kees Cook Acked-by: Jeff Johnson Reviewed-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230915200636.never.762-kees@kernel.org commit f8cbbb224b11c142c6621bd195a59103d119ee3c Author: Kees Cook Date: Fri Sep 15 13:06:27 2023 -0700 wifi: wcn36xx: Annotate struct wcn36xx_hal_ind_msg with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct wcn36xx_hal_ind_msg. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Loic Poulain Cc: Kalle Valo Cc: wcn36xx@lists.infradead.org Cc: linux-wireless@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230915200622.never.820-kees@kernel.org commit e5e8b38f0c05a3d0edba76bdee00e753067f4281 Author: Wu Yunchuan Date: Tue Sep 19 12:51:42 2023 +0800 wifi: ath12k: Remove unnecessary (void*) conversions No need cast (void*) to (struct hal_rx_ppdu_end_user_stats *), (struct ath12k_rx_desc_info *) or (struct hal_tx_msdu_ext_desc *). Change the prototype to remove the local variable. Signed-off-by: Wu Yunchuan Suggested-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230919045142.524226-1-yunchuan@nfschina.com commit 16e972d5767a3c1cd7b1da46565f786d84c90e45 Author: Wu Yunchuan Date: Tue Sep 19 12:50:56 2023 +0800 wifi: ath10k: Remove unnecessary (void*) conversions No need cast (void*) to (struct htt_rx_ring_setup_ring32 *), (struct htt_rx_ring_setup_ring64 *). Change the prototype to remove the local variable. Signed-off-by: Wu Yunchuan Suggested-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230919045056.523958-1-yunchuan@nfschina.com commit 779163fa1a3716826752e1d4beac7b180dd2d986 Author: Wu Yunchuan Date: Tue Sep 19 12:50:08 2023 +0800 wifi: ath6kl: remove unnecessary (void*) conversions No need cast (void *) to (struct ath6kl *) or (struct ath6kl_cookie *). Signed-off-by: Wu Yunchuan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230919045008.523730-1-yunchuan@nfschina.com commit 4bd0f7d0f3112e26f14cc4e045a5b3e223584fbf Author: Wu Yunchuan Date: Tue Sep 19 12:49:59 2023 +0800 wifi: ath5k: remove unnecessary (void*) conversions No need cast (void *) to (struct ath5k_hw *). Signed-off-by: Wu Yunchuan Reviewed-by: Jiri Slaby Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230919044959.523576-1-yunchuan@nfschina.com commit 9705103f8e8ea22c0669891edff66751cc3644ba Author: Wu Yunchuan Date: Tue Sep 19 12:49:25 2023 +0800 wifi: wcn36xx: remove unnecessary (void*) conversions No need cast (void *) to other types such as (struct wcn36xx *), (struct wcn36xx_hal_update_scan_params_resp *), etc. Signed-off-by: Wu Yunchuan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230919044925.523403-1-yunchuan@nfschina.com commit 37c113e94fa0c6adc98cd929c132f95f51a1d2c6 Author: Wu Yunchuan Date: Tue Sep 19 12:49:06 2023 +0800 wifi: ar5523: Remove unnecessary (void*) conversions No need cast (void*) to (struct ar5523_cmd_hdr *). Signed-off-by: Wu Yunchuan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230919044906.523189-1-yunchuan@nfschina.com commit 7e1ca09667128c661c03aced310d59b99db13bb7 Author: Jani Nikula Date: Wed Sep 20 14:29:01 2023 +0300 drm/i915: add a note about fec_enable with 128b/132b Add a note that fec_enable actually means FEC is to be enabled explicitly. 128b/132b always has FEC enabled, the driver doesn't need to enable it separately, and fec_enable will be false. Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230920112901.3315876-1-jani.nikula@intel.com commit dc73b20593544f8e1b78dded909296f2777076d0 Author: Dongliang Mu Date: Tue Sep 5 09:35:56 2023 +0800 wifi: ath9k: clean up function ath9k_hif_usb_resume In ath9k_hif_usb_resume, the error handling code calls ath9k_hif_usb_dealloc_urbs twice in different paths. To unify the error handling code, we move the else branch before the if branch and drop one level of indentation of the if branch. In addition, move the ret variable at the end of variable declarations to be reverse x-mas tree order. Note that this patch does not incur any functionability change. Signed-off-by: Dongliang Mu Reviewed-by: Dan Carpenter Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230905013556.2595854-1-dzm91@hust.edu.cn commit 9ae8c496d211155a3f220b63da364fba1a794292 Author: Baochen Qiang Date: Wed Sep 20 16:43:42 2023 +0300 wifi: ath12k: fix DMA unmap warning on NULL DMA address In ath12k_dp_tx(), if we reach fail_dma_unmap due to some errors, current code does DMA unmap unconditionally on skb_cb->paddr_ext_desc. However, skb_cb->paddr_ext_desc may be NULL and thus we get below warning: kernel: [ 8887.076212] WARNING: CPU: 3 PID: 0 at drivers/iommu/dma-iommu.c:1077 iommu_dma_unmap_page+0x79/0x90 Fix it by checking skb_cb->paddr_ext_desc before unmap it. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: Baochen Qiang Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230830021131.5610-1-quic_bqiang@quicinc.com commit b302dce3d9edea5b93d1902a541684a967f3c63c Author: Baochen Qiang Date: Wed Sep 20 16:43:42 2023 +0300 wifi: ath12k: fix possible out-of-bound write in ath12k_wmi_ext_hal_reg_caps() reg_cap.phy_id is extracted from WMI event and could be an unexpected value in case some errors happen. As a result out-of-bound write may occur to soc->hal_reg_cap. Fix it by validating reg_cap.phy_id before using it. This is found during code review. Compile tested only. Signed-off-by: Baochen Qiang Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230830020716.5420-1-quic_bqiang@quicinc.com commit 87c3a5893e865739ce78aa7192d36011022e0af7 Author: Finn Thain Date: Fri Sep 15 15:47:11 2023 +1000 sched/core: Optimize in_task() and in_interrupt() a bit Except on x86, preempt_count is always accessed with READ_ONCE(). Repeated invocations in macros like irq_count() produce repeated loads. These redundant instructions appear in various fast paths. In the one shown below, for example, irq_count() is evaluated during kernel entry if !tick_nohz_full_cpu(smp_processor_id()). 0001ed0a : 1ed0a: 4e56 0000 linkw %fp,#0 1ed0e: 200f movel %sp,%d0 1ed10: 0280 ffff e000 andil #-8192,%d0 1ed16: 2040 moveal %d0,%a0 1ed18: 2028 0008 movel %a0@(8),%d0 1ed1c: 0680 0001 0000 addil #65536,%d0 1ed22: 2140 0008 movel %d0,%a0@(8) 1ed26: 082a 0001 000f btst #1,%a2@(15) 1ed2c: 670c beqs 1ed3a 1ed2e: 2028 0008 movel %a0@(8),%d0 1ed32: 2028 0008 movel %a0@(8),%d0 1ed36: 2028 0008 movel %a0@(8),%d0 1ed3a: 4e5e unlk %fp 1ed3c: 4e75 rts This patch doesn't prevent the pointless btst and beqs instructions above, but it does eliminate 2 of the 3 pointless move instructions here and elsewhere. On x86, preempt_count is per-cpu data and the problem does not arise presumably because the compiler is free to optimize more effectively. This patch was tested on m68k and x86. I was expecting no changes to object code for x86 and mostly that's what I saw. However, there were a few places where code generation was perturbed for some reason. The performance issue addressed here is minor on uniprocessor m68k. I got a 0.01% improvement from this patch for a simple "find /sys -false" benchmark. For architectures and workloads susceptible to cache line bounce the improvement is expected to be larger. The only SMP architecture I have is x86, and as x86 unaffected I have not done any further measurements. Fixes: 15115830c887 ("preempt: Cleanup the macro maze a bit") Signed-off-by: Finn Thain Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/0a403120a682a525e6db2d81d1a3ffcc137c3742.1694756831.git.fthain@linux-m68k.org commit 7c097ca50d2ba7f7989f01175f366151256bfa10 Author: Uros Bizjak Date: Mon Sep 18 17:14:10 2023 +0200 x86/percpu: Do not clobber %rsi in percpu_{try_,}cmpxchg{64,128}_op The fallback alternative uses %rsi register to manually load pointer to the percpu variable before the call to the emulation function. This is unoptimal, because the load is hidden from the compiler. Move the load of %rsi outside inline asm, so the compiler can reuse the value. The code in slub.o improves from: 55ac: 49 8b 3c 24 mov (%r12),%rdi 55b0: 48 8d 4a 40 lea 0x40(%rdx),%rcx 55b4: 49 8b 1c 07 mov (%r15,%rax,1),%rbx 55b8: 4c 89 f8 mov %r15,%rax 55bb: 48 8d 37 lea (%rdi),%rsi 55be: e8 00 00 00 00 callq 55c3 <...> 55bf: R_X86_64_PLT32 this_cpu_cmpxchg16b_emu-0x4 55c3: 75 a3 jne 5568 <...> 55c5: ... 0000000000000000 <.altinstr_replacement>: 5: 65 48 0f c7 0f cmpxchg16b %gs:(%rdi) to: 55ac: 49 8b 34 24 mov (%r12),%rsi 55b0: 48 8d 4a 40 lea 0x40(%rdx),%rcx 55b4: 49 8b 1c 07 mov (%r15,%rax,1),%rbx 55b8: 4c 89 f8 mov %r15,%rax 55bb: e8 00 00 00 00 callq 55c0 <...> 55bc: R_X86_64_PLT32 this_cpu_cmpxchg16b_emu-0x4 55c0: 75 a6 jne 5568 <...> 55c2: ... Where the alternative replacement instruction now uses %rsi: 0000000000000000 <.altinstr_replacement>: 5: 65 48 0f c7 0e cmpxchg16b %gs:(%rsi) The instruction (effectively a reg-reg move) at 55bb: in the original assembly is removed. Also, both the CALL and replacement CMPXCHG16B are 5 bytes long, removing the need for NOPs in the asm code. Suggested-by: Linus Torvalds Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230918151452.62344-1-ubizjak@gmail.com commit fef44ebaf61b57a71ab818058926a3f9a0ac81e6 Author: Colin Ian King Date: Wed Sep 20 12:41:41 2023 +0100 x86/unwind/orc: Remove redundant initialization of 'mid' pointer in __orc_find() The 'mid' pointer is being initialized with a value that is never read, it is being re-assigned and used inside a for-loop. Remove the redundant initialization. Cleans up clang scan build warning: arch/x86/kernel/unwind_orc.c:88:7: warning: Value stored to 'mid' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Ingo Molnar Cc: Josh Poimboeuf Link: https://lore.kernel.org/r/20230920114141.118919-1-colin.i.king@gmail.com commit 357be7ebba38352a75d6e072cab4052e5a6e5064 Author: Kees Cook Date: Fri Sep 15 13:06:02 2023 -0700 wifi: ipw2x00: Annotate struct libipw_txb with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct libipw_txb. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Stanislav Yakovlev Cc: Kalle Valo Cc: linux-wireless@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230915200602.never.582-kees@kernel.org commit 622f0a1d544fa88dda10d27727835e825c84ae0f Author: Sebastian Andrzej Siewior Date: Wed Sep 20 15:00:25 2023 +0200 sched/debug: Update stale reference to sched_debug.c Since commit: 8a99b6833c884 ("sched: Move SCHED_DEBUG sysctl to debugfs") The sched_debug interface moved from /proc to debugfs. The comment mentions still the outdated proc interfaces. Update the comment, point to the current location of the interface. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230920130025.412071-3-bigeasy@linutronix.de commit 17e7170645e34c519443ba63895264bbdee7beee Author: Sebastian Andrzej Siewior Date: Wed Sep 20 15:00:24 2023 +0200 sched/debug: Remove the /proc/sys/kernel/sched_child_runs_first sysctl The /proc/sys/kernel/sched_child_runs_first knob is no longer connected since: 5e963f2bd4654 ("sched/fair: Commit to EEVDF") Remove it. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230920130025.412071-2-bigeasy@linutronix.de commit a08bb28f6eb6143788755526a3839702dbfb678e Author: Prasurjya Rohan Saikia Date: Fri Sep 15 18:00:40 2023 +0000 wifi: wilc1000: add back-off algorithm to balance tx queue packets Add an algorithm to backoff the Tx Task when low memory scenario is triggered at firmware. During high data transfer from host, the firmware runs out of VMM memory, which is used to hold the frames from the host. So, adding the flow control delays the transmit from host side when there is not enough space to accommodate frames in firmware side. Signed-off-by: Prasurjya Rohan Saikia Acked-by: Ajay Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230915175946.4361-1-prasurjya.rohansaikia@microchip.com commit 260323c3a3e3f0adf5a4f1ab0fcf05b2dbcc768d Author: Víctor Gonzalo Date: Fri Sep 15 00:19:38 2023 +0300 wifi: mwifiex: use MODULE_FIRMWARE to add firmware files metadata The mwifiex_pcie driver is missing the MODULE_FIRMWARE macro to add the firmware files needed to the module metadata. Signed-off-by: Víctor Gonzalo Acked-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230914211938.28395-1-victor.gonzalo@anddroptable.net commit 3ffd23d121dea039ee270b1b11ba1a5e963e0ac0 Author: Dmitry Antipov Date: Mon Aug 21 14:52:50 2023 +0300 wifi: mwifiex: cleanup struct mwifiex_sdio_mpa_rx Drop filled with NULL pointers but otherwise unused 'skb_arr' array of 'struct mwifiex_sdio_mpa_rx', adjust related code. Signed-off-by: Dmitry Antipov Acked-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230821115254.167552-1-dmantipov@yandex.ru commit 5642639bd4f772a09bc4cb05ac7ac9378c2c3f5e Author: Justin Stitt Date: Tue Sep 19 04:45:31 2023 +0000 drm/i915: refactor deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. `ctx` is zero allocated and as such strncpy's NUL-padding behavior was strictly a performance hit which is now resolved. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi commit c99b16128082de519975aa147d9da3e40380de67 Author: Philip Yang Date: Tue Aug 1 11:38:32 2023 -0400 drm/amdkfd: Remove svm range validated_once flag The validated_once flag is not used after the prefault was removed, The prefault was needed to ensure validate all system memory pages at least once before mapping or migrating the range to GPU. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit ff96ddc3f2643483dc64373934c5703b3a7a1e7d Author: Lijo Lazar Date: Mon Sep 11 14:52:33 2023 +0530 drm/amdgpu: Add more fields to IP version Include subrevision and variant fileds also to IP version. Signed-off-by: Lijo Lazar Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit f8754f58d6b875880851664353905bffaa954141 Author: Tao Zhou Date: Tue Sep 19 15:51:59 2023 +0800 drm/amdgpu: print channel index for UMC bad page Print channel index for UMC v12. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit df954b695cc57575c23d674a6dc96c969b35da48 Author: Xiaogang Chen Date: Fri Sep 15 17:02:23 2023 -0500 drm/amdkfd: Separate dma unmap and free of dma address array operations We do not need free dma address array of svm_range each time we do dma unmap for pages in svm_range as we can reuse the same array. Only free it when free svm_range. Separate these two operations and use them accordingly. Signed-off-by: Xiaogang Chen Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 8ab7fab6b67dd84b6cceb74752a37b608191932c Author: Lijo Lazar Date: Thu Sep 14 17:42:43 2023 +0530 drm/amd/pm: Remove SMUv13.0.6 unsupported feature Selectively updating feature mask is not supported in SMU v13.0.6. Remove the callback corresponding to that. Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 4ea7fb337527ca4c5ce9ecf356c13974ac9cc653 Author: Lijo Lazar Date: Fri Sep 15 18:25:03 2023 +0530 drm/amd/pm: Round Q10 format values in SMU v13.0.6 Instead of neglecting fractional part, round the Q10 format values in SMU v13.0.6 metrics table. Signed-off-by: Lijo Lazar Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit 5aba51233be866e2d53898cc8867cee87edf5521 Author: Sathishkumar S Date: Wed Sep 13 09:36:21 2023 +0530 drm/amdgpu: update IP count INFO query update the query to return the number of functional instances where there is more than an instance of the requested type and for others continue to return one. v2: count must reflect the actual number of engines (Alex) v3: fix wrong number of engines for vcn (Alex) Signed-off-by: Sathishkumar S Reviewed-by: Leo Liu Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit a83f2bf1f4d95582cadb0136f0e1bd5b398b5c90 Author: Stanley.Yang Date: Fri Sep 15 18:44:17 2023 +0800 drm/amdgpu: Fix false positive error log It should first check block ras obj whether be set, it should return 0 directly if block ras obj or hw_ops is not set. If block doesn't support RAS just return 0 is fine. Changed from V1: return 0 directly if block ras obj or hw ops is not set Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 8c95cda3e15bf76360db625185aa095444aea644 Author: Vignesh Chander Date: Tue Sep 12 23:43:38 2023 -0500 drm/amdgpu/jpeg: skip set pg for sriov Host handles PG. Signed-off-by: Vignesh Chander Signed-off-by: Alex Deucher commit b157df66d81a05a1cbfb5f6faf196afb72d20e88 Author: YuBiao Wang Date: Fri Sep 15 10:47:50 2023 +0800 drm/amdkfd: Use gpu_offset for user queue's wptr Directly use tbo's start address will miss the domain start offset. Need to use gpu_offset instead. Signed-off-by: YuBiao Wang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 2d30263029dd1bdfd5868173fb12978666a40607 Author: Aric Cyr Date: Tue Sep 5 11:31:27 2023 -0400 drm/amd/display: 3.2.251 Acked-by: Rodrigo Siqueira Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 5b7954272ae96070263dd900735e70982e02eb80 Author: Anthony Koo Date: Sun Sep 3 11:22:04 2023 -0400 drm/amd/display: [FW Promotion] Release 0.0.183.0 - Add new IPS ALLOW masks - Add new Replay power configuration options Tested-by: Daniel Wheeler Acked-by: Rodrigo Siqueira Signed-off-by: Anthony Koo Signed-off-by: Alex Deucher commit 8ce74b35630d60f4272da26270233768eb0d17d0 Author: Muhammad Ahmed Date: Wed Aug 23 19:25:25 2023 -0400 drm/amd/display: Fix MST recognizes connected displays as one MST now recognizes both connected displays Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Muhammad Ahmed Signed-off-by: Alex Deucher commit cc1bfdabda2043c6ef8fd97d94d1e94c1b29181d Author: Charlene Liu Date: Fri Aug 25 15:04:46 2023 -0400 drm/amd/display: fix some non-initialized register mask and setting Fix some non-initialized register mask and update golden setting. Tested-by: Daniel Wheeler Reviewed-by: Duncan Ma Acked-by: Qingqing Zhuo Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit 49a8f94b1fb0d1275f8f23f79c2a4cecf7b202e2 Author: Roman Li Date: Tue Aug 22 17:33:45 2023 -0400 drm/amd/display: Enable replay for dcn35 Enable the display replay feature for DCN35. Tested-by: Daniel Wheeler Reviewed-by: Qingqing Zhuo Acked-by: Qingqing Zhuo Signed-off-by: Roman Li Signed-off-by: Alex Deucher commit 31bd496453769a6c669d0053398903362aba91e8 Author: Gabe Teeger Date: Tue Aug 22 15:01:19 2023 -0400 drm/amd/display: Add option to flip ODM optimization Add a config option to disable odm dispclk optimization for debug purpose. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Gabe Teeger Signed-off-by: Alex Deucher commit c0f8b83188c7d4e4d7256023a384986bda27f5f2 Author: Muhammad Ahmed Date: Fri Aug 18 16:21:20 2023 -0400 drm/amd/display: disable IPS Disable IPS by default till it is ready. Tested-by: Daniel Wheeler Reviewed-by: Duncan Ma Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Muhammad Ahmed Signed-off-by: Alex Deucher commit 93a66cef607cfee3953152bfe067038c5b21ea0e Author: Sung Joon Kim Date: Fri Aug 18 12:05:11 2023 -0400 drm/amd/display: Add IPS control flag [why] Currently, driver is not aware if IPS is supported. After PMFW helps implement new message query functionality, driver will set IPS capability flag. [how] Create new SMU hook function to query IPS capability. Based on the cap, set appropriate flags to false for power-gating purposes. This will avoid keeping SMU busy and offloading tasks to DMUB/driver. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Sung Joon Kim Signed-off-by: Alex Deucher commit dc01c4b79bfe052ef0f9624b5e6ea9b05347f5f0 Author: Duncan Ma Date: Wed Aug 16 12:28:05 2023 -0400 drm/amd/display: Update driver and IPS interop [Why] Two issues fixed: 1. Currently, driver does not allow idle prior to PSR entry. Once PSR1+IPS is enabled, there is intermittent hang due to DCN access from IrqMgr during IPS2. 2. Driver is sending multiple commands to PMFW and dmcub to exit IPS even during IPS0. [How] 1. Set driver allow optimization prior to entering PSR mode with the condition for eDP display only. Unregister all interrupts before allowing driver idle and re-register interrupts when exiting from idle. This will prevent IrqMgr to access DCN during IPS2. 2. Block sending PMFW and dmcub exit low power state commands when driver is not in idle state. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Reviewed-by: Jun Lei Reviewed-by: Aric Cyr Acked-by: Qingqing Zhuo Signed-off-by: Duncan Ma Signed-off-by: Alex Deucher commit 4f43d753bf9c709ff771eb6dff76269e657555a6 Author: Charlene Liu Date: Wed Aug 16 20:40:57 2023 -0400 drm/amd/display: Correct z8 watermark mask Correct z8_watermark mask from 16bit to 20bit. Also, do not set dcn35 dprefclk in clk_mgr_construct. Tested-by: Daniel Wheeler Reviewed-by: Muhammad Ahmed Acked-by: Qingqing Zhuo Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit 990d988847c469b5e1e5e0748fb02ef613d9e0d1 Author: Artem Grishin Date: Tue Aug 15 19:59:58 2023 -0400 drm/amd/display: STREAM_MAPPER_CONTROL register offset on DCN35 [Why] The STREAM_MAPPER_CONTROL register offset was left uninitialized, causing warning in the driver log at runtime [How] A temporary solution to add it into dcn35_create_resource_pool. [TODO] Remove duplication between SE_DCN35_REG_LIST_RI in dcn35_resource.h and SE_DCN35_REG_LIST in dcn35_dio_stream_encoder.h Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Artem Grishin Signed-off-by: Alex Deucher commit 17e8f215cd398635f1fe5e2396ae9ea66a2c5a13 Author: Wenjing Liu Date: Thu Aug 10 13:59:29 2023 -0400 drm/amd/display: Update pipe resource interfaces for DCN35 Pipe resource interfaces were changed. Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Qingqing Zhuo Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit a3e6f214032cbbe73a3c012fd11d3f632f8efffa Author: Mustapha Ghaddar Date: Thu Aug 10 16:20:23 2023 -0400 drm/amd/display: Add DPIA Link Encoder Assignment Fix for DCN35 For DPIA we should have preferred DIG assignment based on DPIA selected as per the ASIC design Tested-by: Daniel Wheeler Reviewed-by: George Shen Acked-by: Qingqing Zhuo Signed-off-by: Mustapha Ghaddar Signed-off-by: Alex Deucher commit ecbaaa544b682167f93128098e90d928eba1202c Author: Sung-huai Wang Date: Fri Aug 11 11:15:37 2023 +0800 drm/amd/display: fix static screen detection setting for DCN35 set_static_screen_control has been updated for DCN3 series. Update it for DCN35. Tested-by: Daniel Wheeler Reviewed-by: Anthony Koo Acked-by: Qingqing Zhuo Signed-off-by: Sung-huai Wang Signed-off-by: Alex Deucher commit d44443305599d2e92b6696a8ca42e0dbaab8cb4d Author: Sung Joon Kim Date: Wed Aug 9 16:39:53 2023 -0400 drm/amd/display: Add pointer check before function call Call to immediate_disable_crtc was not checked before calling, exposing a potential null pointer hang. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Sung Joon Kim Signed-off-by: Alex Deucher commit 4b4f585369f627a5b65540112539453d94dfa40e Author: Muhammad Ahmed Date: Thu Aug 3 14:23:57 2023 -0400 drm/amd/display: Enable DCLK_DS from driver by default PMFW ungate this feature, this can be enabled now Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Muhammad Ahmed Signed-off-by: Alex Deucher commit 5cc9e61f54cbab2f65d03277ea4c9fccec9166f2 Author: Qingqing Zhuo Date: Thu Jul 27 19:29:43 2023 -0400 drm/amd/display: Add DCN35 case for dc_clk_mgr_create Add DCN 35 case for dc_clk_mgr_create. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Qingqing Zhuo Signed-off-by: Alex Deucher commit 82f4ab32f5cdfbcbe5e7302ad80dfd5eccfe25e7 Author: Charlene Liu Date: Mon Jul 31 20:01:11 2023 -0400 drm/amd/display: Add z8_marks related in dml for DCN35 Add z8 watermarks to struct for DCN35. Tested-by: Daniel Wheeler Reviewed-by: Alvin Lee Acked-by: Qingqing Zhuo Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit f1eb045639a38ae9ee80c466f81f2e18204f6d25 Author: Duncan Ma Date: Tue Aug 1 17:59:05 2023 -0400 drm/amd/display: Fix dig register undefined [Why] Some of the stream encoder registers have register offset address 0. It is causing no display in some scenarios due to DIG_FE was not setup correctly and was not enabled. [How] Fix stream encoder register define list. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Duncan Ma Signed-off-by: Alex Deucher commit 1101185bc50f5e45b8b89300914d9aa35a0c8cbe Author: Hamza Mahfooz Date: Wed Sep 13 14:48:08 2023 -0400 drm/amd/display: fix the ability to use lower resolution modes on eDP On eDP we can receive invalid modes from dm_update_crtc_state() for entirely new streams for which drm_mode_set_crtcinfo() shouldn't be called on. So, instead of calling drm_mode_set_crtcinfo() from within create_stream_for_sink() we can instead call it from amdgpu_dm_connector_mode_valid(). Since, we are guaranteed to only call drm_mode_set_crtcinfo() for valid modes from that function (invalid modes are rejected by that callback) and that is the only user of create_validate_stream_for_sink() that we need to call drm_mode_set_crtcinfo() for (as before commit cb841d27b876 ("drm/amd/display: Always pass connector_state to stream validation"), that is the only place where create_validate_stream_for_sink()'s dm_state was NULL). Cc: stable@vger.kernel.org Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2693 Fixes: cb841d27b876 ("drm/amd/display: Always pass connector_state to stream validation") Tested-by: Mark Broadworth Reviewed-by: Harry Wentland Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit e4b6d48d0542a870dc2653174b603290b7000b3e Author: Charlene Liu Date: Thu Jul 27 17:58:39 2023 -0400 drm/amd/display: Temporarily disable clock gating Temporarily disable dchubbub clock gating, registers: .DISPCLK_R_DCHUBBUB_GATE_DIS .DCFCLK_R_DCHUBBUB_GATE_DIS need to follow up with sequence issue. Tested-by: Daniel Wheeler Reviewed-by: Leo Chen Acked-by: Qingqing Zhuo Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit f6340612d45fb562d336b0038fd3eccd7154b3ae Author: Muhammad Ahmed Date: Fri Jul 28 15:43:10 2023 -0700 drm/amd/display: disable clock gating logic Disable clock gating logic. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Muhammad Ahmed Signed-off-by: Alex Deucher commit c056bf3746e9139266fa2a8b991d62a1eb01b354 Author: Taimur Hassan Date: Fri Jul 28 12:15:16 2023 -0400 drm/amd/display: Add reset for SYMCLKC_FE_SRC_SEL To prevent confusion after symclk has already been disabled. Tested-by: Daniel Wheeler Reviewed-by: Meenakshikumar Somasundaram Acked-by: Qingqing Zhuo Signed-off-by: Taimur Hassan Signed-off-by: Alex Deucher commit a769178585177a1414255827acb4317ee513773b Author: André Almeida Date: Fri Sep 15 16:37:41 2023 +0200 drm/amdgpu: Rework coredump to use memory dynamically Instead of storing coredump information inside amdgpu_device struct, move if to a proper separated struct and allocate it dynamically. This will make it easier to further expand the logged information. Signed-off-by: André Almeida Reviewed-by: Shashank Sharma Signed-off-by: Alex Deucher commit d834af4e8579b8351d0265944b61707f2dfee82d Author: Joshua Ashton Date: Tue Sep 12 15:01:57 2023 -0100 drm/amd/display: Remove unused display_content_support This was never filled in and thus never truly used. Checking the EDID for content_type support is not required for sending the avi infoframe packet. v2: - rebase to amd-staging-drm-next Reviewed-by: Melissa Wen Reviewed-by: Harry Wentland Signed-off-by: Joshua Ashton Signed-off-by: Melissa Wen Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 4c4583fd3950b532ec1000361f64384009a5493b Author: Joshua Ashton Date: Tue Sep 12 15:01:56 2023 -0100 drm/amd/display: Hook up 'content type' property for HDMI Implements the 'content type' property for HDMI connectors. Verified by checking the avi infoframe on a connected TV. This also simplifies a lot of the code in that area as well, there were a lot of temp variables doing very little and unnecessary logic that was quite confusing. It is not necessary to check for support in the EDID before sending a 'content type' value in the avi infoframe also. v2: - rebase to amd-staging-drm-next - mark CRTC state for reset if content_type differs Reviewed-by: Harry Wentland (v1) Signed-off-by: Joshua Ashton Co-developed-by: Melissa Wen Signed-off-by: Melissa Wen Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 5838f74c29ecc4eac397a2374cf208efcf095563 Author: Cong Liu Date: Thu Sep 14 17:45:33 2023 +0800 drm/amdgpu: fix a memory leak in amdgpu_ras_feature_enable This patch fixes a memory leak in the amdgpu_ras_feature_enable() function. The leak occurs when the function sends a command to the firmware to enable or disable a RAS feature for a GFX block. If the command fails, the kfree() function is not called to free the info memory. Fixes: 9f051d6ff13f ("drm/amdgpu: Free ras cmd input buffer properly") Reviewed-by: Hawking Zhang Signed-off-by: Cong Liu Signed-off-by: Alex Deucher commit 24f60ddc4b55ceb148e6eb994defb28305ec9b56 Author: Lijo Lazar Date: Thu Sep 14 14:51:52 2023 +0530 drm/amdgpu: Fix vbios version string search Search for vbios version string in STRING_OFFSET-ATOM_ROM_HEADER region first. If those offsets are not populated, use the hardcoded region. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 2af351d692dd06ed08b1c0cf3348fc31401e8187 Author: Lijo Lazar Date: Thu Sep 14 11:46:08 2023 +0530 Revert "drm/amdgpu: Report vbios version instead of PN" This reverts commit 7748ce5b69581325cae40c2134088820f0957902. vbios_version sysfs node is used to identify Part Number also. Revert to the same so that it doesn't break scripts/software which parse this. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 25396684b57f7d16306ca149c545db60b2d08dda Author: Yang Wang Date: Mon Sep 4 16:32:30 2023 +0800 drm/amd/pm: add smu_13_0_6 mca dump support v1: implement smu_v13_0_6 mca bank interface. v2: - remove unnecessary lock - move MCMP1_* macros to mp_13_0_6_sh_mask.h file Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit bcd8dc49c0b969b781dd3af5ee8c9896a9315c5e Author: Yang Wang Date: Mon Sep 4 15:45:02 2023 +0800 drm/amd/pm: update smu_v13_0_6 ppsmc header update smu header to support mca dump interface. Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 5f248462c69d5ea7b54a88c62edb73f626d1528d Author: David Francis Date: Fri Jul 21 11:14:24 2023 -0400 drm/amdgpu: Add EXT_COHERENT memory allocation flags These flags (for GEM and SVM allocations) allocate memory that allows for system-scope atomic semantics. On GFX943 these flags cause caches to be avoided on non-local memory. On all other ASICs they are identical in functionality to the equivalent COHERENT flags. Corresponding Thunk patch is at https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/pull/88 Reviewed-by: David Yat Sin Signed-off-by: David Francis Signed-off-by: Alex Deucher commit d92e55565c53eff6d0c549090487d0a1ef704e1c Author: Jonathan Kim Date: Mon Sep 11 12:18:43 2023 -0400 drm/amdkfd: fix add queue process context clear without runtime enable There are cases where HSA runtime is not enabled through the AMDKFD_IOC_RUNTIME_ENABLE call when adding queues and the MES ADD_QUEUE API should clear the MES process context instead of SET_SHADER_DEBUGGER. Such examples are legacy HSA runtime builds that do not support the current exception handling and running KFD tests. The only time ADD_QUEUE.skip_process_ctx_clear is required is for debugger use cases where a debugged process is always runtime enabled when adding a queue. Tested-by: Shikai Guo Signed-off-by: Jonathan Kim Acked-by: Felix Kuehling Reviewed-by: Eric Huang Signed-off-by: Alex Deucher commit 16a9359401edcbc0a3814b9e3bc35cd478b34a3d Author: Ville Syrjälä Date: Fri Sep 15 13:38:00 2023 +0300 drm/i915: Implement transcoder LRR for TGL+ Implement low refresh rate (LRR) where we change the vblank length by hand as requested, but otherwise keep the timing generator running in non-VRR mode (ie. fixed refresh rate). The panel itself must support VRR for this to work, and only TGL+ has the double buffred TRANS_VTOTAL.VTOTAL that we need to make the switch properly. The double buffer latching happens at the start of transcoders undelayed vblank. The other thing that we change is TRANS_VBLANK.VBLANK_END but the hardware entirely ignores that in DP mode. But I decided to keep writing it anyway just to avoid more special cases in readout/state check. v2: Document that TRANS_VBLANK.VBLANK_END is ignored by the hardware v3: Reconcile with VRR fastset Adjust update_lrr flag behaviour Make sure timings stay within VRR range v4: Fix up update_m_n vs. update_lrr rebase fail (Manasi) Drop DOUBLE_BUFFER_VACTIVE define as it's not needed (Manasi) TODO: Hook LRR into the automatic DRRS downclocking stuff? Cc: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230915103800.14218-1-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 26f03ef816632945bec135f12a7f902b2de3a0c3 Author: Ville Syrjälä Date: Fri Sep 1 16:04:39 2023 +0300 drm/i915: Assert that VRR is off during vblank evasion if necessary Whenever we change the actual transcoder timings (clock via seamless M/N, full modeset, (or soon) vtotal via LRR) we want the timing generator to be in non-VRR during the commit. Warn if we forgot to turn VRR off prior to vblank evasion. Cc: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901130440.2085-12-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare Reviewed-by: Mitul Golani commit 0ce013a4e840528fcd1c80a264fd47fa5be6a515 Author: Ville Syrjälä Date: Fri Sep 1 16:04:38 2023 +0300 drm/i915: Update VRR parameters in fastset We should be able to change any of the VRR parameters during fastsets as long as we toggle VRR off at the start and then back on at the end. The transcoder will be running in non-VRR mode during the transition. Co-developed-by: Manasi Navare Signed-off-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901130440.2085-11-ville.syrjala@linux.intel.com Reviewed-by: Sean Paul commit 8f782270cc14a67ac5feba9d473f3ac575d6b08e Author: Ville Syrjälä Date: Fri Sep 1 16:04:37 2023 +0300 drm/i915: Disable VRR during seamless M/N changes Make life less confusing by making sure VRR is disabled whenever we do any drastic changes to the display timings, such as seamless M/N changes. Cc: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901130440.2085-10-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare Reviewed-by: Mitul Golani commit 6a38b36c274f7a969d276ffecad02d974b30175c Author: Ville Syrjälä Date: Fri Sep 1 16:04:36 2023 +0300 drm/i915: Validate that the timings are within the VRR range Let's assume there are some crazy displays where the high end of the VRR range ends up being lower than the refresh rate as determined by the actual timings. In that case when we toggle VRR on/off we would step outside the VRR range when toggling VRR on/off. Let's just make sure that never happens by not using VRR in such cases. If the user really wants VRR they should then select the timings to land within the VRR range. Cc: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901130440.2085-9-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare Reviewed-by: Mitul Golani commit f0f7ec743d06e542e2c8253ceebd38a20b72aaff Author: Ville Syrjälä Date: Fri Sep 1 16:04:35 2023 +0300 drm/i915: Relocate is_in_vrr_range() Move is_in_vrr_range() into intel_vrr.c in anticipation of more users, and rename it accordingly. Cc: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901130440.2085-8-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare Reviewed-by: Mitul Golani commit b4ac591b8e1be78c4eaf089e75034760c0be942c Author: Ville Syrjälä Date: Fri Sep 1 16:04:34 2023 +0300 drm/i915: Optimize out redundant M/N updates Don't perform a seamless M/N update if the values aren't actually changing. This avoids doing extra shenanigans during vblank evasion needlessly. Cc: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901130440.2085-7-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 825edc8bc72f3266534a04e9a4447b12332fac82 Author: Ville Syrjälä Date: Fri Sep 1 16:04:33 2023 +0300 drm/i915: Adjust seamless_m_n flag behaviour Make the seamless_m_n flag more like the update_pipe fastset flag, ie. the flag will only be set if we need to do the seamless M/N update, and in all other cases the flag is cleared. Also rename the flag to update_m_n to make it more clear it's similar to update_pipe. I believe special casing seamless_m_n like this makes sense as it also affects eg. vblank evasion. We can potentially avoid some vblank evasion tricks, simplify some checks, and hopefully will help with the VRR vs. M/N mess. Cc: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901130440.2085-6-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 691dec86acc3afb469f09e9a4a00508b458bdb0c Author: Ville Syrjälä Date: Fri Sep 1 16:04:32 2023 +0300 drm/i915: Enable VRR later during fastsets In order to reconcile seamless M/N updates with VRR we'll need to defer the fastset VRR enable to happen after the seamless M/N update (which happens during the vblank evade critical section). So just push the VRR enable to be the last thing during the update. This will also affect the vblank evasion as the transcoder will now still be running with the old VRR state during the vblank evasion. So just grab the timings always from the old crtc state during any non-modeset commit, and also grab the current state of VRR from the active timings (as we disable VRR before vblank evasion during fastsets). This also fixes vblank evasion for seamless M/N updates as we now properly account for the fact that the M/N update happens after vblank evasion. Cc: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901130440.2085-5-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare Reviewed-by: Mitul Golani commit f4b0cece716c95e16d973a774d5a5c5cc8cb335d Author: Ville Syrjälä Date: Fri Sep 1 16:04:31 2023 +0300 drm/i915: Extract intel_crtc_vblank_evade_scanlines() Pull the vblank evasion scanline calculations into their own helper to declutter intel_pipe_update_start() a bit. Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901130440.2085-4-ville.syrjala@linux.intel.com Reviewed-by: Mitul Golani commit 09f390d4e2f38f8433431f4da31ca0a17a5c7853 Author: Ville Syrjälä Date: Fri Sep 1 16:04:30 2023 +0300 drm/i915: Change intel_pipe_update_{start,end}() calling convention We'll need to also look at the old crtc state in intel_pipe_update_start() so change the calling convention to just plumb in the full atomic state instead. Cc: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901130440.2085-3-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare Reviewed-by: Mitul Golani commit f895e3db65a46e0d82114991bd91ec7b110068f2 Author: Ville Syrjälä Date: Fri Sep 1 16:04:29 2023 +0300 drm/i915: Move psr unlock out from the pipe update critical section Do the PSR unlock after the vblank evade critcal section is fully over, not before. Cc: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901130440.2085-2-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare Reviewed-by: Mitul Golani commit 14571ab1ad213de59b3726a40aea7ca0365bf445 Author: Nícolas F. R. A. Prado Date: Mon Aug 28 17:13:12 2023 -0400 kselftest: Add new test for detecting unprobed Devicetree devices Introduce a new kselftest to detect devices that were declared in the Devicetree, and are expected to be probed by a driver, but weren't. The test uses two lists: a list of compatibles that can match a Devicetree device to a driver, and a list of compatibles that should be ignored. The first is automatically generated by the dt-extract-compatibles script, and is run as part of building this test. The list of compatibles to ignore is a hand-crafted list to capture the few exceptions of compatibles that are expected to match a driver but not be bound to it. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20230828211424.2964562-4-nfraprado@collabora.com Signed-off-by: Rob Herring commit 365ba0c7a73cce407bf40cdf9900b86b945d4acb Author: Nícolas F. R. A. Prado Date: Mon Aug 28 17:13:11 2023 -0400 dt: dt-extract-compatibles: Add flag for driver matching compatibles Add a new flag, '--driver-match', to the dt-extract-compatibles script that causes it to only print out compatibles that are expected to match a driver. This output can then be used by tests to detect device probe failures. In order to filter the compatibles down to only ones that will match to a driver, the following is considered: - A compatible needs to show up in a driver's of_match_table for it to be matched to a driver - Compatibles that are used in both of_match_table and OF_DECLARE type macros can't be expected to match to a driver and so are ignored. One exception is CLK_OF_DECLARE_DRIVER, since it indicates that a driver will also later probe, so compatibles in this macro are not ignored. Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20230828211424.2964562-3-nfraprado@collabora.com Signed-off-by: Rob Herring commit eb2139fc0da63b89a2ad565ecd8133a37e8b7c4f Author: Nícolas F. R. A. Prado Date: Mon Aug 28 17:13:10 2023 -0400 dt: dt-extract-compatibles: Handle cfile arguments in generator function Move the handling of the cfile arguments to a separate generator function to avoid redundancy. Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20230828211424.2964562-2-nfraprado@collabora.com Signed-off-by: Rob Herring commit eee9602ad6498eee9ddab1b7eb6aede288f0b934 Author: Luca Weiss Date: Tue Sep 19 14:46:01 2023 +0200 arm64: dts: qcom: qcm6490: Add device-tree for Fairphone 5 Add device tree for the Fairphone 5 smartphone which is based on the QCM6490 SoC. Supported features are, as of now: * Bluetooth * Debug UART * Display via simplefb * Flash/torch LED * Flip cover sensor * Power & volume buttons * RTC * SD card * USB * Various plumbing like regulators, i2c, spi, etc Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Tested-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230919-fp5-initial-v2-7-14bb7cedadf5@fairphone.com Signed-off-by: Bjorn Andersson commit 4b1a16d776b474345b12f834de1fd42bca226d90 Author: Luca Weiss Date: Tue Sep 19 14:46:00 2023 +0200 dt-bindings: arm: qcom: Add QCM6490 Fairphone 5 Fairphone 5 is a smartphone based on the QCM6490 SoC. Signed-off-by: Luca Weiss Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230919-fp5-initial-v2-6-14bb7cedadf5@fairphone.com Signed-off-by: Bjorn Andersson commit bfd4412a023b2a3a2f858f2ffc13705aaeef5737 Author: Luca Weiss Date: Tue Sep 19 14:45:58 2023 +0200 arm64: dts: qcom: pm8350c: Add flash led node Add a node for the led controller found on PM8350C, used for flash and torch purposes. Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20230919-fp5-initial-v2-4-14bb7cedadf5@fairphone.com Signed-off-by: Bjorn Andersson commit 8e2d56f64572e0432c355093a7601bde29677490 Author: Luca Weiss Date: Tue Sep 19 14:45:57 2023 +0200 arm64: dts: qcom: pm7250b: make SID configurable Like other Qualcomm PMICs the PM7250B can be used on different addresses on the SPMI bus. Use similar defines like the PMK8350 to make this possible but skip the ifndef based on maintainer feedback. Signed-off-by: Luca Weiss Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230919-fp5-initial-v2-3-14bb7cedadf5@fairphone.com Signed-off-by: Bjorn Andersson commit 6da24ba932082bae110feb917a64bb54637fa7c0 Author: Luca Weiss Date: Tue Sep 19 14:45:55 2023 +0200 arm64: dts: qcom: sc7280: Mark some nodes as 'reserved' With the standard Qualcomm TrustZone setup, components such as lpasscc, pdc_reset and watchdog shouldn't be touched by Linux. Mark them with the status 'reserved' and reenable them in the chrome-common dtsi. Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20230919-fp5-initial-v2-1-14bb7cedadf5@fairphone.com Signed-off-by: Bjorn Andersson commit e1592981c51bac38ea2041b642777b3ba30606a8 Author: Konrad Dybcio Date: Tue Sep 12 15:31:48 2023 +0200 remoteproc: qcom: q6v5-mss: Remove PNoC clock from 8996 MSS The PNoC clock is a clock for the entire PNoC bus, managed from within the interconnect driver. Attaching it to MSS was a total hack. Get rid of it. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230721-topic-rpm_clk_cleanup-v2-10-1e506593b1bd@linaro.org Signed-off-by: Bjorn Andersson commit e7781901449cbcff129d80a5d9021e9e96084ec4 Author: Konrad Dybcio Date: Tue Sep 12 15:31:47 2023 +0200 dt-bindings: remoteproc: qcom,msm8996-mss-pil: Remove PNoC clock The PNoC clock is a clock for the entire PNoC bus, managed from within the interconnect driver. Attaching it to MSS was a total hack. Get rid of it. Acked-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230721-topic-rpm_clk_cleanup-v2-9-1e506593b1bd@linaro.org Signed-off-by: Bjorn Andersson commit c4c5b47958529bc1de10260df0c583710853b516 Author: Konrad Dybcio Date: Tue Sep 12 15:31:46 2023 +0200 dt-bindings: remoteproc: qcom,adsp: Remove AGGRE2 clock The AGGRE2 clock is a clock for the entire AGGRE2 bus, managed from within the interconnect driver. Attaching it to SLPI was a total hack. Get rid of it. Signed-off-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230721-topic-rpm_clk_cleanup-v2-8-1e506593b1bd@linaro.org Signed-off-by: Bjorn Andersson commit d40291e52d5ac4d0ff18ca433e84e6ddccc13427 Author: Gaurav Kohli Date: Sun Sep 17 19:30:39 2023 +0530 arm64: dts: qcom: msm8939: Fix iommu local address range Fix the apps iommu local address space range as per data sheet. Fixes: 61550c6c156c ("arm64: dts: qcom: Add msm8939 SoC") Signed-off-by: Gaurav Kohli Reviewed-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230917140039.25283-1-quic_gkohli@quicinc.com Signed-off-by: Bjorn Andersson commit f6aa7386bc40b552eea8ec1b1d2168afe3b31110 Author: Robert Marko Date: Wed Aug 16 18:45:40 2023 +0200 dt-bindings: firmware: qcom,scm: document IPQ5018 compatible It seems that IPQ5018 compatible was never documented in the bindings. Signed-off-by: Robert Marko Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230816164641.3371878-3-robimarko@gmail.com Signed-off-by: Bjorn Andersson commit ff4aa3bc98258a240b9bbab53fd8d2fb8184c485 Author: Robert Marko Date: Wed Aug 16 18:45:39 2023 +0200 firmware: qcom_scm: disable SDI if required IPQ5018 has SDI (Secure Debug Image) enabled by TZ by default, and that means that WDT being asserted or just trying to reboot will hang the board in the debug mode and only pulling the power and repowering will help. Some IPQ4019 boards like Google WiFI have it enabled as well. Luckily, SDI can be disabled via an SCM call. So, lets use the boolean DT property to identify boards that have SDI enabled by default and use the SCM call to disable SDI during SCM probe. It is important to disable it as soon as possible as we might have a WDT assertion at any time which would then leave the board in debug mode, thus disabling it during SCM removal is not enough. Signed-off-by: Robert Marko Reviewed-by: Guru Das Srinagesh Link: https://lore.kernel.org/r/20230816164641.3371878-2-robimarko@gmail.com Signed-off-by: Bjorn Andersson commit 79796e87215db9587d6c66ec6f6781e091bc6464 Author: Robert Marko Date: Wed Aug 16 18:45:41 2023 +0200 arm64: dts: qcom: ipq5018: indicate that SDI should be disabled Now that SCM has support for indicating that SDI has been enabled by default, lets set the property so SCM disables it during probing. Signed-off-by: Robert Marko Link: https://lore.kernel.org/r/20230816164641.3371878-4-robimarko@gmail.com Signed-off-by: Bjorn Andersson commit 92dab9ea5f389c12828283146c60054642453a91 Author: Robert Marko Date: Wed Aug 16 18:45:38 2023 +0200 dt-bindings: firmware: qcom,scm: support indicating SDI default state IPQ5018 has SDI (Secure Debug Image) enabled by TZ by default, and that means that WDT being asserted or just trying to reboot will hang the board in the debug mode and only pulling the power and repowering will help. Some IPQ4019 boards like Google WiFI have it enabled as well. So, lets add a boolean property to indicate that SDI is enabled by default and thus needs to be disabled by the kernel. Signed-off-by: Robert Marko Acked-by: Mukesh Ojha Reviewed-by: Krzysztof Kozlowski Reviewed-by: Brian Norris Link: https://lore.kernel.org/r/20230816164641.3371878-1-robimarko@gmail.com Signed-off-by: Bjorn Andersson commit 684277525c70f329300cc687e27248e405a4ff9e Author: Adam Skladowski Date: Sat Aug 12 13:24:50 2023 +0200 arm64: dts: qcom: msm8976: Fix ipc bit shifts Update bits to match downstream irq-bitmask values. Fixes: 0484d3ce0902 ("arm64: dts: qcom: Add DTS for MSM8976 and MSM8956 SoCs") Signed-off-by: Adam Skladowski Link: https://lore.kernel.org/r/20230812112534.8610-8-a39.skl@gmail.com Signed-off-by: Bjorn Andersson commit 31c133b4a07e3db456a7e661c96653cd65a25bc6 Author: Adam Skladowski Date: Sat Aug 12 13:24:49 2023 +0200 arm64: dts: qcom: msm8976: Split lpass region MSM8976 downstream dts define reloc region which is used by pil-tz to load both wcnss and lpass, on mainline however we might not be able to do it and we need separate regions(also validating dts might get problematic if we had to put memory-region(rproc node) per device). Luckily it seems size and entry points in firmware headers appears to be static across multiple devices including Sony Loire platform and Xiaomi Redmi Note 3 Pro this should let us fit in first ~17MB Split lpass region(reloc on downstream) into two separate regions. Signed-off-by: Adam Skladowski Link: https://lore.kernel.org/r/20230812112534.8610-7-a39.skl@gmail.com Signed-off-by: Bjorn Andersson commit fc3bbd576008e48d22285500c2af77c44ac31c98 Author: William Tseng Date: Thu Sep 14 17:51:37 2023 +0800 drm/i915/dsi: let HW maintain CLK_POST This change is to adjust TCLK-POST timing so DSI signaling can meet CTS specification. For clock lane, the TCLK-POST timing may be changed from 133.44 ns to 178.72 ns, which is greater than (60 ns+52*UI) and is conformed to the CTS standard. The computed UI is around 1.47 ns. v2: remove the change of HS-TRAIL. Cc: Ville Syrjala Cc: Jani Nikula Cc: Vandita Kulkarni Cc: Suraj Kandpal Cc: Lee Shawn C Signed-off-by: William Tseng Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230914095137.4132029-1-william.tseng@intel.com commit 887878014534186cc50dbd16a62e744ad217b4b1 Author: AngeloGioacchino Del Regno Date: Wed Sep 20 10:27:27 2023 +0200 drm/bridge: panel: Fix device link for DRM_BRIDGE_ATTACH_NO_CONNECTOR When external bridges are attached with DRM_BRIDGE_ATTACH_NO_CONNECTOR, the panel bridge may also get the same flag, but in the .attach() callback for the panel bridge a device link is added only when this flag is not present; To make things worse, the .detach() callback tries to delete the device link unconditionally and without checking if it was created in the first place, crashing the kernel with a NULL pointer kernel panic upon calling panel_bridge_detach(). Fix that by moving the device_link_add() call before checking if the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag is present. Fixes: 199cf07ebd2b ("drm/bridge: panel: Add a device link between drm device and panel device") Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Liu Ying Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230920082727.57729-1-angelogioacchino.delregno@collabora.com commit 4a94b52a47f63fb6db44871f446d31c28ca89bb9 Author: Danila Tikhonov Date: Wed Sep 13 21:55:14 2023 +0300 arm64: dts: qcom: pm8150l: Add wled node WLED is used for controlling the backlight on some boards, add the node for it. Signed-off-by: Danila Tikhonov Link: https://lore.kernel.org/r/20230913185514.21840-1-danila@jiaxyga.com Signed-off-by: Bjorn Andersson commit 7138c244fb293f24ce8ab782961022eff00a10c4 Author: Danila Tikhonov Date: Wed Sep 13 20:56:11 2023 +0300 clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src Set .flags = CLK_OPS_PARENT_ENABLE to fix "gcc_sdcc2_apps_clk_src: rcg didn't update its configuration" error. Fixes: 2a1d7eb854bb ("clk: qcom: gcc: Add global clock controller driver for SM8150") Tested-by: Arseniy Velikanov Signed-off-by: Danila Tikhonov Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230913175612.8685-1-danila@jiaxyga.com Signed-off-by: Bjorn Andersson commit 96272ba7103d4518e2d0f17daf6fe0008fc6e12c Author: Bartosz Golaszewski Date: Wed Sep 13 17:35:29 2023 +0200 arm64: dts: qcom: sa8775p: enable the inline crypto engine Add an ICE node to sa8775p SoC description and enable it by adding a phandle to the UFS node. Signed-off-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230913153529.32777-2-bartosz.golaszewski@linaro.org Signed-off-by: Bjorn Andersson commit e3c6386c6a5d0187f103fc9bf39850ac15c01690 Author: Stephan Gerhold Date: Mon Sep 11 19:41:51 2023 +0200 arm64: dts: qcom: msm8916/39: Fix venus memory size Both MSM8916 and MSM8939 have unnecessarily large reservations for the venus firmware for some reason. According to the ELF headers and downstream [1] 5 MiB is enough. Let's set the minimum size as default. With the dynamic reserved memory allocations boards can easily override this if needed, although in practice there does not seem to be any device with a different venus firmware size. [1]: https://git.codelinaro.org/clo/la/kernel/msm-3.10/-/blame/LA.BR.1.2.9.1-02310-8x16.0/arch/arm/boot/dts/qcom/msm8939-common.dtsi#L69 Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230911-msm8916-rmem-v1-9-b7089ec3e3a1@gerhold.net Signed-off-by: Bjorn Andersson commit 35efa1be51bd6db067d7380b34538b17b9f250a8 Author: Stephan Gerhold Date: Mon Sep 11 19:41:50 2023 +0200 arm64: dts: qcom: msm8916/39: Move mpss_mem size to boards The modem firmware size is typically highly device-specific. The current size of the mpss_mem region in msm8916.dtsi (0x2b00000) only works for some APQ8016 devices without full-featured modem, such as the DragonBoard 410c. The full modem firmware is typically about twice as large (~45 MiB -> ~90 MiB) but also varies by a few MiB from device to device. Since these devices are quite memory-constrained nowadays it's important to minimize the unnecessary memory reservations. Make it clear that each board needs to specify the necessary mpss_mem size by replacing the DB410c-specific size in msm8916.dtsi with a simple comment. &mpss_mem is disabled by default so it's fine to leave some properties up to the boards if they want to enable it. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230911-msm8916-rmem-v1-8-b7089ec3e3a1@gerhold.net Signed-off-by: Bjorn Andersson commit 0ece6438a8c0492a7df036d57ac299500a25cb70 Author: Stephan Gerhold Date: Mon Sep 11 19:41:49 2023 +0200 arm64: dts: qcom: msm8916/39: Disable unneeded firmware reservations Now that we no longer have fixed addresses for the firmware memory regions, disable them by default and only enable them together with the actual user in the board DT. This frees up unnecessary reserved memory for boards that do not use some of the remoteprocs and allows moving selected device-specific properties (such as firmware size) to the board-specific DT part in the next step. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230911-msm8916-rmem-v1-7-b7089ec3e3a1@gerhold.net Signed-off-by: Bjorn Andersson commit b22bef3dbc3a67a796f82f49a6df9e413211cb40 Author: Stephan Gerhold Date: Mon Sep 11 19:41:48 2023 +0200 arm64: dts: qcom: msm8939: Reserve firmware memory dynamically Follow the example of MSM8916 and reserve the firmware memory regions dynamically to allow boards to define only the device-specific parts. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230911-msm8916-rmem-v1-6-b7089ec3e3a1@gerhold.net Signed-off-by: Bjorn Andersson commit b4f3a410061bf5a8cc148c9435479da580abf85b Author: Stephan Gerhold Date: Mon Sep 11 19:41:47 2023 +0200 arm64: dts: qcom: msm8916: Reserve MBA memory dynamically At a first glance the MBA memory region on MSM8916 looks intentionally placed at the fixed address 0x8ea00000. This is what the ELF headers of the firmware specify as base address, and the typical Qualcomm-specific bits suggest the binary is not relocatable. However, on a closer look this is pointless: Unlike other firmware images the hardware expects to have the raw ELF image loaded to the MBA region, including the ELF header (without parsing it at all). This means that we actually just load the ELF header (not the code!) at 0x8ea00000. The real LOAD segments follow at arbitrary aligned addresses depending on the structure of the ELF binary. In practice it looks like we can use an arbitrary 1 MiB-aligned region for MBA. The downstream/vendor kernel just allocates this dynamically at an arbitrary (aligned) address. Drop the pointless fixed address and use the new dynamic reserved memory mechanism to allocate a region close to the others. This reduces gaps in the memory map and provides Linux with more contiguous memory. Signed-off-by: Stephan Gerhold Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230911-msm8916-rmem-v1-5-b7089ec3e3a1@gerhold.net Signed-off-by: Bjorn Andersson commit 0ed3d82862e8451cc2b14ddb1b064e72ba3e5a60 Author: Stephan Gerhold Date: Mon Sep 11 19:41:46 2023 +0200 arm64: dts: qcom: msm8916: Reserve firmware memory dynamically Most of the reserved firmware memory on MSM8916 can be relocated when respecting the required alignment. To avoid having to precompute the reserved memory regions in every board DT, describe the actual requirements (size, alignment, alloc-ranges) using the dynamic reserved memory allocation. This approach has several advantages: 1. We can define "templates" for the reserved memory regions in msm8916.dtsi and keep only device-specific details in the board DT. This is useful for the "mpss" region size for example, which varies from device to device. It is no longer necessary to redefine all firmware regions to shift their addresses. 2. When some of the functionality (e.g. WCNSS, Modem, Venus) is not enabled or needed for a device, the reserved memory can stay disabled, freeing up the unused reservation for Linux. 3. Devices with special requirements for one of the firmware regions are handled automatically. For example, msm8916-longcheer-l8150 has non-relocatable "wcnss" firmware that must be loaded exactly at address 0x8b600000. When this is defined as a static region, the other dynamic allocations automatically adjust to a different place with suitable alignment. All in all this approach significantly reduces the boilerplate necessary to define the different firmware regions, and makes it easier to enable functionality on the different devices. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230911-msm8916-rmem-v1-4-b7089ec3e3a1@gerhold.net Signed-off-by: Bjorn Andersson commit 40eb256e5fd1fd49813a27a252b7f45ccca89fde Author: Stephan Gerhold Date: Mon Sep 11 19:41:45 2023 +0200 arm64: dts: qcom: msm8916-ufi: Drop gps_mem for now gps_mem is needed by the modem firmware for GPS to work. However, it is accessed via QMI memshare [1] which is not available upstream yet. Until it lands upstream reserving this does not provide any advantage. [1]: https://lore.kernel.org/linux-arm-msm/20210319172321.22248-1-nikitos.tr@gmail.com/ Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230911-msm8916-rmem-v1-3-b7089ec3e3a1@gerhold.net Signed-off-by: Bjorn Andersson commit 0ce5bb825d54c904b217cc7f1131e084e02ed037 Author: Stephan Gerhold Date: Mon Sep 11 19:41:44 2023 +0200 arm64: dts: qcom: msm8916/39: Disable GPU by default MSM8916/39 do not need signed GPU firmware so it is generally okay to have it enabled by default. However, currently the GPU does not work without also enabling MDSS and it's questionable if someone would really need it without a display in practice. For consistency let's follow newer SoCs and disable the GPU by default. Enable it for all existing devices that already have &mdss enabled. Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230911-msm8916-rmem-v1-2-b7089ec3e3a1@gerhold.net Signed-off-by: Bjorn Andersson commit 29589248420766cd492e6db0632d6f59ec216e92 Author: Stephan Gerhold Date: Mon Sep 11 19:41:43 2023 +0200 arm64: dts: qcom: msm8916: Disable venus by default Venus needs firmware that is usually signed with a device-specific key. There are also devices that might not need it (especially during bring-up), so let's follow more recent SoCs and disable it by default. Enable it explicitly for all current devices except msm8916-mtp. That one has just UART enabled currently so it cannot really benefit from Venus. Signed-off-by: Stephan Gerhold Reviewed-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230911-msm8916-rmem-v1-1-b7089ec3e3a1@gerhold.net Signed-off-by: Bjorn Andersson commit 4051844c6616c0bf33dd16342967ea5b931746ae Author: Yang Wang Date: Wed Sep 6 12:37:14 2023 +0800 drm/amdgpu: add amdgpu mca debug sysfs support add amdgpu mca debug sysfs support. Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d11bbacee3eec50e8912cc1b7324b6ad76b5175c Author: Alex Deucher Date: Tue Sep 12 17:27:44 2023 -0400 drm/amdgpu: add VPE IP discovery info to HW IP info query Add missing IP discovery info. Reviewed-by: Christian König Reviewed-by: Lang Yu Signed-off-by: Alex Deucher commit 7ff607e27233861b3f83e658317b3fb18b047229 Author: Yang Wang Date: Tue Sep 5 11:39:10 2023 +0800 drm/amdgpu: add amdgpu smu mca dump feature support add amdgpu smu mca dump feature support. Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 615585d09b33e609bef5eb7986f5df2b4e053ac3 Author: Lijo Lazar Date: Fri Aug 25 17:02:58 2023 +0530 Documentation/amdgpu: Modify pp_dpm_*clk details pp_dpm_*clk nodes also could show the frequencies when a clock is in 'sleep' state. Add documentation related to that. Signed-off-by: Lijo Lazar Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 7f4ce7b50ae45fd09796e98c56c8471af70322dc Author: Mario Limonciello Date: Tue Sep 5 14:26:00 2023 -0500 drm/amd: Enable seamless boot by default on newer ASICs Seamless boot can technically be supported as far back as DCN1 but to avoid regressions on older hardware, enable it for DCN3 and later. If users report using the module parameter that it works on older ASICs as well, this can be adjusted. Reviewed-by: Harry Wentland Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 5dc270d366bd0a67896ec46e874cb69ade513591 Author: Mario Limonciello Date: Tue Sep 5 14:25:59 2023 -0500 drm/amd: Add a module parameter for seamless boot The module parameter can be used to test more easily enabling seamless boot support on additional ASICs. Reviewed-by: Harry Wentland Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 2fa73a101cd812bceb9d865fee296fc1057541a2 Author: Timmy Tsai Date: Thu Aug 31 13:31:31 2023 -0400 drm/amd: Add HDP flush during jpeg init During jpeg init, CPU writes to frame buffer which can be cached by HDP, occasionally causing invalid header to be sent to MMSCH. Perform HDP flush after writing to frame buffer before continuing with jpeg init sequence. Reviewed-by: Alex Deucher Signed-off-by: Timmy Tsai Signed-off-by: Alex Deucher commit bb0f84293e61f052f96f8bec75844b43ea2e3822 Author: Mario Limonciello Date: Tue Sep 5 14:25:58 2023 -0500 drm/amd: Move seamless boot check out of display This will allow base driver to dictate whether seamless should be enabled. No intended functional changes. Reviewed-by: Harry Wentland Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 3ef07651a5756e7de65615e18eacbf8822c23016 Author: Mario Limonciello Date: Tue Sep 5 14:25:57 2023 -0500 drm/amd: Drop special case for yellow carp without discovery `amdgpu_gmc_get_vbios_allocations` has a special case for how to bring up yellow carp when amdgpu discovery is turned off. As this ASIC ships with discovery turned on, it's generally dead code and worse it causes `adev->mman.keep_stolen_vga_memory` to not be initialized for yellow carp. Remove it. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 608f604c791302ae1d93174d0ab5edba001435ee Author: Lijo Lazar Date: Thu Aug 24 18:24:52 2023 +0530 drm/amd/pm:Fix GFX deep sleep clock reporting For SMU v13.0.6, keep GFX deep sleep clock reporting style consistent with that of other clocks. Sample format below. S: 78Mhz * 0: 600Mhz 1: 800Mhz Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit cad2fb19bbfa6110e8ed71c07a33fb54d2104a0f Author: Lijo Lazar Date: Thu Aug 24 17:25:51 2023 +0530 drm/amd/pm: Fix clock reporting for SMUv13.0.6 On SMU v13.0.6, effective clocks are reported by FW which won't exactly match with DPM level. Report the current clock based on the values matching closest to the effective clock. Also, when deep sleep is applied to a clock, report it with a special level "S:" as in sample clock levels below S: 19Mhz * 0: 615Mhz 1: 800Mhz 2: 888Mhz 3: 1000Mhz Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 4e8303cf2c4dd27374a16a8881ec1a1cd5baf86f Author: Lijo Lazar Date: Mon Sep 11 13:48:11 2023 +0530 drm/amdgpu: Use function for IP version check Use an inline function for version check. Gives more flexibility to handle any format changes. Signed-off-by: Lijo Lazar Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 72f6a13022f3bf16df305b75c32f95ece263a5ce Author: Nícolas F. R. A. Prado Date: Tue Sep 19 11:26:21 2023 -0400 kselftest/alsa: pcm-test: Report cards declared in config but missing When parsing the configs, keep track of card configurations that match the current system but haven't matched any card, and report those as test failures as they represent that a card which was expected to be present on the system is missing. This allows the configuration files to not only be used to detect missing PCM devices (which is currently possible) but also that the soundcard hasn't been registered at all. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Jaroslav Kysela Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20230919152702.100617-1-nfraprado@collabora.com Signed-off-by: Takashi Iwai commit 170911bb1b046c5589e0e973c4f5abdb1d5d9e62 Author: Michal Michalik Date: Thu Jul 27 15:50:37 2023 +0200 ice: Remove the FW shared parameters The only feature using the Firmware (FW) shared parameters was the PTP clock ID. Since this ID is now shared using auxiliary buss - remove the FW shared parameters from the code. Signed-off-by: Michal Michalik Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit fcd2c1e3139a27766ef263bd2011195dbc8a79f5 Author: Michal Michalik Date: Thu Jul 27 15:50:36 2023 +0200 ice: PTP: add clock domain number to auxiliary interface The PHC clock id used to be moved between PFs using FW admin queue shared parameters - move the implementation to auxiliary bus. Signed-off-by: Karol Kolacinski Signed-off-by: Jacob Keller Signed-off-by: Michal Michalik Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 2643f0b069fb6ab6126acac41c576312687b4dd0 Merge: 471e2875f8904 c32c4ef98baca Author: Bjorn Andersson Date: Wed Sep 20 09:01:29 2023 -0700 Merge branch '20230909123431.1725728-1-quic_ajipan@quicinc.com' into clk-for-6.7 Merge the SM4450 RPMHCC and GCC through a topic branch, to allow reuse of the defines from the DeviceTree binding in the DeviceTree source. commit c32c4ef98baca6dfedbddace1e0bbcae0ca65050 Author: Ajit Pandey Date: Sat Sep 9 18:04:31 2023 +0530 clk: qcom: Add GCC driver support for SM4450 Add Global Clock Controller (GCC) support for SM4450 platform. Signed-off-by: Ajit Pandey Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230909123431.1725728-5-quic_ajipan@quicinc.com Signed-off-by: Bjorn Andersson commit d2d04deb5566b82aeb795f24014f5b3bdb8315ed Author: Ajit Pandey Date: Sat Sep 9 18:04:30 2023 +0530 dt-bindings: clock: qcom: Add GCC clocks for SM4450 Add support for qcom global clock controller bindings for SM4450 platform. Signed-off-by: Ajit Pandey Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230909123431.1725728-4-quic_ajipan@quicinc.com Signed-off-by: Bjorn Andersson commit 5a6eabf3268f91ce3cb5350210d0a876fa65b481 Author: Ajit Pandey Date: Sat Sep 9 18:04:29 2023 +0530 clk: qcom: rpmh: Add RPMH clocks support for SM4450 Add support for RPMH clocks for SM4450 platform. Signed-off-by: Ajit Pandey Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230909123431.1725728-3-quic_ajipan@quicinc.com Signed-off-by: Bjorn Andersson commit 0b8aae7ed8eaf24d5f59d390325e9b2ebf1c78bd Author: Ajit Pandey Date: Sat Sep 9 18:04:28 2023 +0530 dt-bindings: clock: qcom: Add RPMHCC for SM4450 Add compatible string for qcom RPMHCC for SM4450 platform. Signed-off-by: Ajit Pandey Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230909123431.1725728-2-quic_ajipan@quicinc.com Signed-off-by: Bjorn Andersson commit af3c5c8748e6d286d4f2dd9800f9d27f29b8e2ef Author: Michal Michalik Date: Thu Jul 27 15:50:35 2023 +0200 ice: Use PTP auxbus for all PHYs restart in E822 The E822 (and other devices based on the same PHY) is having issue while setting the PHC timer - the PHY timers are drifting from the PHC. After such a set all PHYs need to be restarted and resynchronised - do it using auxiliary bus. Signed-off-by: Karol Kolacinski Signed-off-by: Michal Michalik Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit a3d5fb3b084c0c67f9918a866b92cbe09b9e1d77 Author: Nikita Travkin Date: Thu Sep 7 15:02:37 2023 +0500 arm64: dts: qcom: sc7180: Add ADSP sc7180 has an ADSP remoteproc that exclusively controls the audio hardware on devices that use Qualcomm firmware. Add it along with the relevant audio services. Signed-off-by: Nikita Travkin Reviewed-by: Konrad Dybcio Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20230907-sc7180-adsp-rproc-v3-4-6515c3fbe0a3@trvn.ru Signed-off-by: Bjorn Andersson commit 828298a9efb237b76fa667bb74a6450d1df3eeed Author: Nikita Travkin Date: Thu Sep 7 15:02:36 2023 +0500 arm64: dts: qcom: sc7180: Add tertiary mi2s pinctrl Some devices use tertiary mi2s to connect external audio codec. Add it near the other two i2s pinctrl definitions so the devices don't have to duplicate it. Signed-off-by: Nikita Travkin Reviewed-by: Stephen Boyd Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230907-sc7180-adsp-rproc-v3-3-6515c3fbe0a3@trvn.ru Signed-off-by: Bjorn Andersson commit d938a8cca88a5f02f523f95fe3d2d1214f4b4a8d Author: Michal Michalik Date: Thu Jul 27 15:50:34 2023 +0200 ice: Auxbus devices & driver for E822 TS There is a problem in HW in E822-based devices leading to race condition. It might happen that, in order: - PF0 (which owns the PHC) requests few timestamps, - PF1 requests a timestamp, - interrupt is being triggered and both PF0 and PF1 threads are woken up, - PF0 got one timestamp, still waiting for others so not going to sleep, - PF1 gets it's timestamp, process it and go to sleep, - PF1 requests a timestamp again, - just before PF0 goes to sleep timestamp of PF1 appear, - PF0 finishes all it's timestamps and go to sleep (PF1 also sleeping). That leaves PF1 timestamp memory not read, which lead to blocking the next interrupt from arriving. Fix it by adding auxiliary devices and only one driver to handle all the timestamps for all PF's by PHC owner. In the past each PF requested it's own timestamps and process it from the start till the end which causes problem described above. Currently each PF requests the timestamps as before, but the actual reading of the completed timestamps is being done by the PTP auxiliary driver, which is registered by the PF which owns PHC. Additionally, the newly introduced auxiliary driver/devices for PTP clock owner will be used for other features in all products (including E810). Signed-off-by: Jacob Keller Signed-off-by: Karol Kolacinski Signed-off-by: Michal Michalik Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 93f875645c9da9c788224964499e68fa9664e80f Author: Konrad Dybcio Date: Thu Jul 27 19:33:23 2023 +0200 remoteproc: qcom: pas: Add SM6375 MPSS Add a config for the MPSS present on SM6375. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230725-topic-6375_rproc-v5-3-a8e9cde56a20@linaro.org Signed-off-by: Bjorn Andersson commit a6df21cf0c93cab57059e2592c7c99b424965374 Author: Konrad Dybcio Date: Thu Jul 27 19:33:22 2023 +0200 remoteproc: qcom: pas: Add SM6375 ADSP & CDSP Add a config for the ADSP&CDSP present on SM6375. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230725-topic-6375_rproc-v5-2-a8e9cde56a20@linaro.org Signed-off-by: Bjorn Andersson commit 6d3211e015b0f236986b16c042f71cce8d36d727 Author: Konrad Dybcio Date: Thu Jul 27 19:33:21 2023 +0200 dt-bindings: remoteproc: qcom,sm6375-pas: Document remoteprocs SM6375 hosts an ADSP, CDSP and modem as remote processors. Create related bindings. Signed-off-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230725-topic-6375_rproc-v5-1-a8e9cde56a20@linaro.org Signed-off-by: Bjorn Andersson commit d93f191b95bec3c913978eb18c6297e797915993 Author: MD Danish Anwar Date: Mon Aug 14 15:21:41 2023 +0530 dt-bindings: remoteproc: pru: Add Interrupt property Add interrupts and interrupt-names protperties for PRU and RTU cores. Signed-off-by: MD Danish Anwar Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230814095141.3526684-1-danishanwar@ti.com Signed-off-by: Bjorn Andersson commit 8de60bbab994bf8165d7d10e974872852da47aa7 Author: Nikita Travkin Date: Thu Sep 7 15:02:35 2023 +0500 remoteproc: qcom: pas: Add sc7180 adsp sc7180 has a dedicated ADSP similar to the one found in sm8250. Add it's compatible to the driver reusing the existing config so the devices that use the adsp can probe it. Signed-off-by: Nikita Travkin Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20230907-sc7180-adsp-rproc-v3-2-6515c3fbe0a3@trvn.ru Signed-off-by: Bjorn Andersson commit eadadb9510f7e45d2dca602ec261518a65e349f8 Author: Nikita Travkin Date: Thu Sep 7 15:02:34 2023 +0500 dt-bindings: remoteproc: qcom: sc7180-pas: Add ADSP compatible SC7180 has an ADSP remoteproc. Add it's compatible to the bindings and refactor the schema conditionals to fit the ADSP. Signed-off-by: Nikita Travkin Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230907-sc7180-adsp-rproc-v3-1-6515c3fbe0a3@trvn.ru Signed-off-by: Bjorn Andersson commit e735eab705cd0a9b3b98ffd746055c2c49e1572b Author: Neil Armstrong Date: Mon Aug 28 10:04:36 2023 +0200 Revert "arm64: dts: qcom: sm8450: Add PRNG" This reverts commit 76a6dd7bfcbb ("arm64: dts: qcom: sm8450: Add PRNG"), since the RNG HW on the SM8450 SoC is in fact a True Random Number Generator, a more appropriate compatible should be instead as reported at [1]. [1] https://lore.kernel.org/all/20230818161720.3644424-1-quic_omprsing@quicinc.com/ Suggested-by: Om Prakash Singh Suggested-by: Konrad Dybcio Reviewed-by: Konrad Dybcio Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20230828-topic-sm8550-rng-v3-1-7a0678ca7988@linaro.org Signed-off-by: Bjorn Andersson commit c7b34291bb376598ea4279658bf3100c8cb1487b Author: Stephan Gerhold Date: Tue Jul 18 13:40:18 2023 +0200 arm64: dts: qcom: pm8916: Drop codec reg-names and mclk Drop the redundant reg-names and mclk from the PM8916 analog codec that were removed from the DT schema. Having the mclk on the analog codec is incorrect because only the digital codec consumes it directly. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20230718-pm8916-mclk-v1-6-4b4a58b4240a@gerhold.net Signed-off-by: Bjorn Andersson commit 471e2875f8904539985e62220afd6c88e70779fa Author: Luca Weiss Date: Sat Sep 2 19:34:23 2023 +0200 clk: qcom: mmcc-msm8974: remove ocmemcx_ahb_clk According to a commit in the 3.4 vendor kernel sources[0] the ocmemcx_ahb_clk clock "is controlled by RPM and should not be touched by APPS.". [0] https://git.codelinaro.org/clo/la/kernel/msm/-/commit/37df5f2d91b4d5768b37fcaacaeea958dd683ebc And indeed, when using MDSS+GPU+OCMEM on MSM8226 and not using clk_ignore_unused, when Linux tries to disable the clock the device crashes and reboots. And since there's also no evidence of this clock in msm8974 vendor kernel sources, remove the clock for msm8226 and msm8974. Fixes: d8b212014e69 ("clk: qcom: Add support for MSM8974's multimedia clock controller (MMCC)") Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230902-msm8226-ocmemcx_ahb_clk-remove-v1-1-8124dbde83b9@z3ntu.xyz Signed-off-by: Bjorn Andersson commit 141b4fa0362569138653cf0165d92d48576db3fa Author: Cristian Marussi Date: Sat Aug 26 13:53:08 2023 +0100 firmware: arm_scmi: Add clock OEM config clock operations Expose a couple of new SCMI clock operations to get and set OEM specific clock configurations when talking to an SCMI v3.2 compliant. Issuing such requests against an SCMI platform server not supporting v3.2 extension for OEM specific clock configurations will fail. Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20230826125308.462328-7-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit 1b39ff5140c92bc45145ace8e78c00e922449abd Author: Cristian Marussi Date: Sat Aug 26 13:53:07 2023 +0100 clk: scmi: Add support for .is_enabled clk_ops Add support for .is_enabled atomic clk_ops using the related SCMI clock operation in atomic mode, if available. Note that the .is_enabled callback will be supported by this SCMI clock driver only if the configured underlying SCMI transport does support atomic operations. CC: Michael Turquette CC: Stephen Boyd CC: linux-clk@vger.kernel.org Signed-off-by: Cristian Marussi Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20230826125308.462328-6-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit 5b8a8ca37e4949d063b02c0aabd9a258585f3f5f Author: Cristian Marussi Date: Sat Aug 26 13:53:06 2023 +0100 firmware: arm_scmi: Add clock .state_get support to pre-v3.2 Support clock .state_get operation against SCMI platform servers that do not support v3.2 CONFIG_GET dedicated command: while talking with these platforms the command CLOCK_ATTRIBUTES can be used to gather the current clock states. Note that, in case of shared resources, the retrieved clock state 'flavour' (virtual vs physical) depends on the backend SCMI platform server specific kind of implementation. Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20230826125308.462328-5-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit 34592bf0a5cb0681ce3d64de5598951768f43328 Author: Cristian Marussi Date: Sat Aug 26 13:53:05 2023 +0100 firmware: arm_scmi: Add v3.2 clock CONFIG_GET support Add support for v3.2 clock CONFIG_GET command and related new clock protocol operation state_get() to retrieve the status of a clock. Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20230826125308.462328-4-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit e49e314a2cf70270df304c8b87a52fba27986873 Author: Cristian Marussi Date: Sat Aug 26 13:53:04 2023 +0100 firmware: arm_scmi: Add clock v3.2 CONFIG_SET support SCMI v3.2 introduces a new clock CONFIG_SET message format that can optionally carry also OEM specific configuration values beside the usual clock enable/disable requests. Refactor internal helpers and add support to use such new format when talking to a v3.2 compliant SCMI platform. Support existing enable/disable operations across different clock protocol versions: this patch still does not add protocol operations to support the new OEM specific optional configuration capabilities. No functional change for the SCMI drivers users of the related enable and disable clock operations. Signed-off-by: Cristian Marussi Link: https://lore.kernel.org/r/20230826125308.462328-3-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit 03a95cf233b5bdd65ddd4eca63cd4874b6b84d50 Author: Cristian Marussi Date: Sat Aug 26 13:53:03 2023 +0100 firmware: arm_scmi: Simplify enable/disable clock operations SCMI clock enable/disable operations come in 2 different flavours which simply just differ in how the underlying SCMI transactions is carried on: atomic or not. Currently we expose such SCMI operations through 2 distinctly named wrappers, that, in turn, are wrapped into another couple of similarly and distinctly named callbacks inside SCMI clock driver user. Reduce the churn of duplicated wrappers by adding a param to SCMI clock enable/disable operations to ask for atomic operation while removing the _atomic version of such operations. No functional change. CC: Michael Turquette CC: Stephen Boyd CC: linux-clk@vger.kernel.org Signed-off-by: Cristian Marussi Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20230826125308.462328-2-cristian.marussi@arm.com Signed-off-by: Sudeep Holla commit cb4c132ebfeac5962f7258ffc831caa0c4dada1a Author: Dmitry Antipov Date: Tue Aug 29 12:36:02 2023 +0300 wifi: ath10k: fix clang-specific fortify warning When compiling with clang 16.0.6 and CONFIG_FORTIFY_SOURCE=y, I've noticed the following (somewhat confusing due to absence of an actual source code location): In file included from drivers/net/wireless/ath/ath10k/debug.c:8: In file included from ./include/linux/module.h:13: In file included from ./include/linux/stat.h:19: In file included from ./include/linux/time.h:60: In file included from ./include/linux/time32.h:13: In file included from ./include/linux/timex.h:67: In file included from ./arch/x86/include/asm/timex.h:5: In file included from ./arch/x86/include/asm/processor.h:23: In file included from ./arch/x86/include/asm/msr.h:11: In file included from ./arch/x86/include/asm/cpumask.h:5: In file included from ./include/linux/cpumask.h:12: In file included from ./include/linux/bitmap.h:11: In file included from ./include/linux/string.h:254: ./include/linux/fortify-string.h:592:4: warning: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] __read_overflow2_field(q_size_field, size); The compiler actually complains on 'ath10k_debug_get_et_strings()' where fortification logic inteprets call to 'memcpy()' as an attempt to copy the whole 'ath10k_gstrings_stats' array from it's first member and so issues an overread warning. This warning may be silenced by passing an address of the whole array and not the first member to 'memcpy()'. Signed-off-by: Dmitry Antipov Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230829093652.234537-1-dmantipov@yandex.ru commit 1133af5aea588a58043244a4ecb5ce511b310356 Author: Wen Gong Date: Wed Aug 30 02:02:26 2023 -0400 wifi: ath11k: add chip id board name while searching board-2.bin for WCN6855 Sometimes board-2.bin does not have the board data which matched the parameters such as bus type, vendor, device, subsystem-vendor, subsystem-device, qmi-chip-id and qmi-board-id, then wlan will load fail. Hence add another type which only matches the bus type and qmi-chip-id, then the ratio of missing board data reduced. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230830060226.18664-1-quic_wgong@quicinc.com commit 1bc44a505a229bb1dd4957e11aa594edeea3690e Author: Baochen Qiang Date: Fri Sep 1 09:56:02 2023 +0800 wifi: ath12k: fix possible out-of-bound read in ath12k_htt_pull_ppdu_stats() len is extracted from HTT message and could be an unexpected value in case errors happen, so add validation before using to avoid possible out-of-bound read in the following message iteration and parsing. The same issue also applies to ppdu_info->ppdu_stats.common.num_users, so validate it before using too. These are found during code review. Compile test only. Signed-off-by: Baochen Qiang Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230901015602.45112-1-quic_bqiang@quicinc.com commit 41e7a399aea1dbf3d0ffdeb6ef8e9eaea7fa6cf5 Author: Wen Gong Date: Wed Aug 30 02:08:50 2023 -0400 wifi: ath12k: change to initialize recovery variables earlier in ath12k_core_reset() Sometimes device recovery fail with this operation. Run test command for many times: echo assert > /sys/kernel/debug/ath12k/wcn7850\ hw2.0_0000\:03\:00.0/simulate_fw_crash While recovery start, ath12k_core_post_reconfigure_recovery() will call ieee80211_restart_hw(), and the restart_work which queued by ieee80211_restart_hw() is running in another thread, it will call into ath12k_mac_op_start() and ath12k_mac_wait_reconfigure(), and the variables ab->recovery_start_count and ab->recovery_start is used in ath12k_mac_wait_reconfigure(), so ath12k need to initialize the variables before queue the restart_work, otherwise ath12k_mac_wait_reconfigure() maybe use the un-initialized variables. Change to initialize the 2 variables earlier and then recovery process become correct. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230830060850.18881-1-quic_wgong@quicinc.com commit 1c7a387ffef894b1ab3942f0482dac7a6e0a909c Author: Tvrtko Ursulin Date: Wed Jun 21 10:48:24 2023 +0100 drm: Update file owner during use With the typical model where the display server opens the file descriptor and then hands it over to the client(*), we were showing stale data in debugfs. Fix it by updating the drm_file->pid on ioctl access from a different process. The field is also made RCU protected to allow for lockless readers. Update side is protected with dev->filelist_mutex. Before: $ cat /sys/kernel/debug/dri/0/clients command pid dev master a uid magic Xorg 2344 0 y y 0 0 Xorg 2344 0 n y 0 2 Xorg 2344 0 n y 0 3 Xorg 2344 0 n y 0 4 After: $ cat /sys/kernel/debug/dri/0/clients command tgid dev master a uid magic Xorg 830 0 y y 0 0 xfce4-session 880 0 n y 0 1 xfwm4 943 0 n y 0 2 neverball 1095 0 n y 0 3 *) More detailed and historically accurate description of various handover implementation kindly provided by Emil Velikov: """ The traditional model, the server was the orchestrator managing the primary device node. From the fd, to the master status and authentication. But looking at the fd alone, this has varied across the years. IIRC in the DRI1 days, Xorg (libdrm really) would have a list of open fd(s) and reuse those whenever needed, DRI2 the client was responsible for open() themselves and with DRI3 the fd was passed to the client. Around the inception of DRI3 and systemd-logind, the latter became another possible orchestrator. Whereby Xorg and Wayland compositors could ask it for the fd. For various reasons (hysterical and genuine ones) Xorg has a fallback path going the open(), whereas Wayland compositors are moving to solely relying on logind... some never had fallback even. Over the past few years, more projects have emerged which provide functionality similar (be that on API level, Dbus, or otherwise) to systemd-logind. """ v2: * Fixed typo in commit text and added a fine historical explanation from Emil. Signed-off-by: Tvrtko Ursulin Cc: "Christian König" Cc: Daniel Vetter Acked-by: Christian König Reviewed-by: Emil Velikov Reviewed-by: Rob Clark Tested-by: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/20230621094824.2348732-1-tvrtko.ursulin@linux.intel.com Signed-off-by: Christian König commit d4e244c85e45df8e044a1f097e1c78bafd6ec21f Author: Wen Gong Date: Mon Aug 28 00:04:20 2023 -0400 wifi: ath12k: enable 320 MHz bandwidth for 6 GHz band in EHT PHY capability for WCN7850 320 MHz bandwidth is reported only for single PHY mode for WCN7850, get it from WMI_HOST_HW_MODE_SINGLE ath12k_wmi_caps_ext_params and report it for 6 GHz band. After this patch, "iw list" shows 320 MHz support for WCN7850: EHT Iftypes: managed EHT PHY Capabilities: (0xe26f090010768800): 320MHz in 6GHz Supported EHT bw=320 MHz, max NSS for MCS 8-9: Rx=0, Tx=0 EHT bw=320 MHz, max NSS for MCS 10-11: Rx=0, Tx=0 EHT bw=320 MHz, max NSS for MCS 12-13: Rx=0, Tx=0 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230828040420.2165-1-quic_wgong@quicinc.com commit 95f97fe0ac974467ab4da215985a32b2fdf48af0 Author: Dmitry Antipov Date: Tue Aug 29 12:38:12 2023 +0300 wifi: ath9k: fix clang-specific fortify warnings When compiling with clang 16.0.6 and CONFIG_FORTIFY_SOURCE=y, I've noticed the following (somewhat confusing due to absence of an actual source code location): In file included from drivers/net/wireless/ath/ath9k/debug.c:17: In file included from ./include/linux/slab.h:16: In file included from ./include/linux/gfp.h:7: In file included from ./include/linux/mmzone.h:8: In file included from ./include/linux/spinlock.h:56: In file included from ./include/linux/preempt.h:79: In file included from ./arch/x86/include/asm/preempt.h:9: In file included from ./include/linux/thread_info.h:60: In file included from ./arch/x86/include/asm/thread_info.h:53: In file included from ./arch/x86/include/asm/cpufeature.h:5: In file included from ./arch/x86/include/asm/processor.h:23: In file included from ./arch/x86/include/asm/msr.h:11: In file included from ./arch/x86/include/asm/cpumask.h:5: In file included from ./include/linux/cpumask.h:12: In file included from ./include/linux/bitmap.h:11: In file included from ./include/linux/string.h:254: ./include/linux/fortify-string.h:592:4: warning: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] __read_overflow2_field(q_size_field, size); In file included from drivers/net/wireless/ath/ath9k/htc_drv_debug.c:17: In file included from drivers/net/wireless/ath/ath9k/htc.h:20: In file included from ./include/linux/module.h:13: In file included from ./include/linux/stat.h:19: In file included from ./include/linux/time.h:60: In file included from ./include/linux/time32.h:13: In file included from ./include/linux/timex.h:67: In file included from ./arch/x86/include/asm/timex.h:5: In file included from ./arch/x86/include/asm/processor.h:23: In file included from ./arch/x86/include/asm/msr.h:11: In file included from ./arch/x86/include/asm/cpumask.h:5: In file included from ./include/linux/cpumask.h:12: In file included from ./include/linux/bitmap.h:11: In file included from ./include/linux/string.h:254: ./include/linux/fortify-string.h:592:4: warning: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] __read_overflow2_field(q_size_field, size); The compiler actually complains on 'ath9k_get_et_strings()' and 'ath9k_htc_get_et_strings()' due to the same reason: fortification logic inteprets call to 'memcpy()' as an attempt to copy the whole array from it's first member and so issues an overread warning. These warnings may be silenced by passing an address of the whole array and not the first member to 'memcpy()'. Signed-off-by: Dmitry Antipov Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230829093856.234584-1-dmantipov@yandex.ru commit 352281e4a0a020114574b3846a6eed395d0ca908 Author: Dmitry Antipov Date: Wed Aug 23 21:23:34 2023 +0300 wifi: ath9k: use u32 for txgain indexes Since both 'ar9550_hw_get_modes_txgain_index()' and 'ar9561_hw_get_modes_txgain_index()' never returns negative values, prefer 'u32' over 'int' and adjust 'ar9003_hw_process_ini()' accordingly. Suggested-by: Jeff Johnson Signed-off-by: Dmitry Antipov Reviewed-by: Jeff Johnson Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230823182401.196270-2-dmantipov@yandex.ru commit e6a1107bf5ebd531144f46f74ee2b7f8d56d3c79 Author: Dmitry Antipov Date: Wed Aug 23 21:23:33 2023 +0300 wifi: ath9k: simplify ar9003_hw_process_ini() Since commit 8896934c1684 ("ath9k_hw: remove direct accesses to channel mode flags") changes 'ar9550_hw_get_modes_txgain_index()' so it never returns -EINVAL, and 'ar9561_hw_get_modes_txgain_index()' never returns negative value too, an extra check in 'ar9003_hw_process_ini()' may be dropped. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Antipov Reviewed-by: Jeff Johnson Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230823182401.196270-1-dmantipov@yandex.ru commit 3f53624f74f4ccd645adfdb9a6b9f1cd97ec5623 Author: Manish Dharanenthiran Date: Tue Sep 5 16:29:41 2023 +0300 wifi: ath12k: fix radar detection in 160 MHz Radar detection fails in the secondary 80 MHz when the the AP's primary 80 MHz is in non-DFS region in 160 MHz. This is due to WMI channel flag WMI_CHAN_INFO_DFS_FREQ2 is not set properly in case of the primary 80 MHz is in non-DFS region. HALPHY detects the radar pulses in the secondary 80 MHz only when WMI_CHAN_INFO_DFS_FREQ2 is set. Fix this issue by setting WMI channel flag WMI_CHAN_INFO_DFS_FREQ2 based on the radar_enabled flag from the channel context. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manish Dharanenthiran Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230802085852.19821-3-quic_mdharane@quicinc.com commit 8b8b990fe495e9be057249e1651b59b5ebacf2ef Author: Manish Dharanenthiran Date: Tue Sep 5 16:29:41 2023 +0300 wifi: ath12k: fix WARN_ON during ath12k_mac_update_vif_chan Fix WARN_ON() from ath12k_mac_update_vif_chan() if vdev is not up. Since change_chanctx can be called even before vdev_up. Do vdev stop followed by a vdev start in case of vdev is down. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0-02903-QCAHKSWPL_SILICONZ-1 Signed-off-by: Manish Dharanenthiran Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230802085852.19821-2-quic_mdharane@quicinc.com commit d8cce0d5ba4a3157a7a549b9623d1ffc5820ef92 Author: Justin Stitt Date: Wed Sep 13 20:23:02 2023 +0000 firmware: ti_sci: refactor deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer. It does not seem like `ver->firmware_description` requires NUL-padding (which is a behavior that strncpy provides) but if it does let's opt for `strscpy_pad()`. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230913-strncpy-drivers-firmware-ti_sci-c-v1-1-740db471110d@google.com Signed-off-by: Nishanth Menon commit be6d43efb12455dbf85c96ff67582a463d34a0fc Author: Jinjie Ruan Date: Wed Aug 30 17:03:44 2023 +0800 firmware: ti_sci: Use list_for_each_entry() helper Convert list_for_each() to list_for_each_entry() so that the p list_head pointer and list_entry() call are no longer needed, which can reduce a few lines of code. No functional changed. Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230830090344.528818-1-ruanjinjie@huawei.com Signed-off-by: Nishanth Menon commit 1fc62c8347397faf4e18249e88ecd4470c0a5357 Author: Konrad Dybcio Date: Wed Aug 9 21:20:28 2023 +0200 clk: qcom: mmcc-msm8998: Fix the SMMU GDSC The SMMU GDSC doesn't have to be ALWAYS-ON and shouldn't feature the HW_CTRL flag (it's separate from hw_ctrl_addr). In addition to that, it should feature a cxc entry for bimc_smmu_axi_clk and be marked as votable. Fix all of these issues. Fixes: d14b15b5931c ("clk: qcom: Add MSM8998 Multimedia Clock Controller (MMCC) driver") Signed-off-by: Konrad Dybcio Reviewed-by: Jeffrey Hugo Link: https://lore.kernel.org/r/20230531-topic-8998_mmssclk-v3-5-ba1b1fd9ee75@linaro.org Signed-off-by: Bjorn Andersson commit 9906c4140897bbdbff7bb71c6ae67903cb9954ce Author: Konrad Dybcio Date: Wed Aug 9 21:20:27 2023 +0200 clk: qcom: mmcc-msm8998: Don't check halt bit on some branch clks Some branch clocks are governed externally and we're only supposed to send a request concerning their shutdown, not actually ensure it happens. Use the BRANCH_HALT_SKIP define to skip checking the halt bit. Fixes: d14b15b5931c ("clk: qcom: Add MSM8998 Multimedia Clock Controller (MMCC) driver") Reviewed-by: Jeffrey Hugo Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230531-topic-8998_mmssclk-v3-4-ba1b1fd9ee75@linaro.org Signed-off-by: Bjorn Andersson commit 9fc75c40faa29df14ba16066be6bdfaea9f39ce4 Author: Tomi Valkeinen Date: Wed Sep 6 09:50:59 2023 +0300 drm/bridge: tc358768: Attempt to fix DSI horizontal timings The DSI horizontal timing calculations done by the driver seem to often lead to underflows or overflows, depending on the videomode. There are two main things the current driver doesn't seem to get right: DSI HSW and HFP, and VSDly. However, even following Toshiba's documentation it seems we don't always get a working display. This patch attempts to fix the horizontal timings for DSI event mode, and on a system with a DSI->HDMI encoder, a lot of standard HDMI modes now seem to work. The work relies on Toshiba's documentation, but also quite a bit on empirical testing. This also adds timing related debug prints to make it easier to improve on this later. The DSI pulse mode has only been tested with a fixed-resolution panel, which limits the testing of different modes on DSI pulse mode. However, as the VSDly calculation also affects pulse mode, so this might cause a regression. Reviewed-by: Peter Ujfalusi Tested-by: Marcel Ziswiler Tested-by: Maxim Schwalm # Asus TF700T Signed-off-by: Tomi Valkeinen Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-12-31725f008a50@ideasonboard.com commit f1dabbe645065d20ca863c8d446c74c59ca1ca9d Author: Tomi Valkeinen Date: Wed Sep 6 09:50:58 2023 +0300 drm/bridge: tc358768: Fix tc358768_ns_to_cnt() The tc358768_ns_to_cnt() is, most likely, supposed to do a div-round-up operation, but it misses subtracting one from the dividend. Fix this by just using DIV_ROUND_UP(). Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") Reviewed-by: Peter Ujfalusi Tested-by: Maxim Schwalm # Asus TF700T Tested-by: Marcel Ziswiler Signed-off-by: Tomi Valkeinen Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-11-31725f008a50@ideasonboard.com commit b3aa7b34924a9ed64cf96899cac4d8ea08cd829e Author: Tomi Valkeinen Date: Wed Sep 6 09:50:57 2023 +0300 drm/bridge: tc358768: Clean up clock period code The driver defines TC358768_PRECISION as 1000, and uses "nsk" to refer to clock periods. The original author does not remember where all this came from. Effectively the driver is using picoseconds as the unit for clock periods, yet referring to them by "nsk". Clean this up by just saying the periods are in picoseconds. Reviewed-by: Peter Ujfalusi Tested-by: Maxim Schwalm # Asus TF700T Tested-by: Marcel Ziswiler Signed-off-by: Tomi Valkeinen Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-10-31725f008a50@ideasonboard.com commit 699cf62a7d4550759f4a50e614b1952f93de4783 Author: Tomi Valkeinen Date: Wed Sep 6 09:50:56 2023 +0300 drm/bridge: tc358768: Rename dsibclk to hsbyteclk The Toshiba documentation talks about HSByteClk when referring to the DSI HS byte clock, whereas the driver uses 'dsibclk' name. Also, in a few places the driver calculates the byte clock from the DSI clock, even if the byte clock is already available in a variable. To align the driver with the documentation, change the 'dsibclk' variable to 'hsbyteclk'. This also make it easier to visually separate 'dsibclk' and 'dsiclk' variables. Reviewed-by: Peter Ujfalusi Tested-by: Maxim Schwalm # Asus TF700T Tested-by: Marcel Ziswiler Signed-off-by: Tomi Valkeinen Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-9-31725f008a50@ideasonboard.com commit 89cfd50e13f1bead4350998a3a77422bef1ee0a5 Author: Tomi Valkeinen Date: Wed Sep 6 09:50:55 2023 +0300 drm/bridge: tc358768: Use dev for dbg prints, not priv->dev Simplify the code by capturing the priv->dev value to dev variable, and use it. Reviewed-by: Peter Ujfalusi Tested-by: Maxim Schwalm # Asus TF700T Tested-by: Marcel Ziswiler Signed-off-by: Tomi Valkeinen Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-8-31725f008a50@ideasonboard.com commit 013ea98cdfccef3b7c38b087c1f629488d2ef683 Author: Tomi Valkeinen Date: Wed Sep 6 09:50:54 2023 +0300 drm/bridge: tc358768: Print logical values, not raw register values The driver debug prints DSI related timings as raw register values in hex. It is much more useful to see the "logical" value of the timing, not the register value. Change the prints to print the values separately, in case a single register contains multiple values, and use %u to have it in a more human consumable form. Reviewed-by: Peter Ujfalusi Tested-by: Maxim Schwalm # Asus TF700T Tested-by: Marcel Ziswiler Signed-off-by: Tomi Valkeinen Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-7-31725f008a50@ideasonboard.com commit e5fb21678136a9d009d5c43821881eb4c34fae97 Author: Tomi Valkeinen Date: Wed Sep 6 09:50:53 2023 +0300 drm/bridge: tc358768: Use struct videomode The TC358768 documentation uses HFP, HBP, etc. values to deal with the video mode, while the driver currently uses the DRM display mode (htotal, hsync_start, etc). Change the driver to convert the DRM display mode to struct videomode, which then allows us to use the same units the documentation uses. This makes it much easier to work on the code when using the TC358768 documentation as a reference. Reviewed-by: Peter Ujfalusi Tested-by: Maxim Schwalm # Asus TF700T Tested-by: Marcel Ziswiler Signed-off-by: Tomi Valkeinen Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-6-31725f008a50@ideasonboard.com commit 1e08e78871df0fe615c1d90614529181a554da16 Author: Tomi Valkeinen Date: Wed Sep 6 09:50:52 2023 +0300 drm/bridge: tc358768: Cleanup PLL calculations As is quite common, some of TC358768's PLL register fields are to be programmed with (value - 1). Specifically, the FBD and PRD, multiplier and divider, are such fields. However, what the driver currently does is that it considers that the formula used for PLL rate calculation is: RefClk * [(FBD + 1)/ (PRD + 1)] * [1 / (2^FRS)] where FBD and PRD are values directly from the registers, while a more sensible way to look at it is: RefClk * FBD / PRD * (1 / (2^FRS)) and when the FBD and PRD values are written to the registers, they will be subtracted by one. Change the driver accordingly, as it simplifies the PLL code. Reviewed-by: Peter Ujfalusi Tested-by: Maxim Schwalm # Asus TF700T Tested-by: Marcel Ziswiler Signed-off-by: Tomi Valkeinen Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-5-31725f008a50@ideasonboard.com commit 66962d5c3c51377b9b90cae35b7e038950438e02 Author: Tomi Valkeinen Date: Wed Sep 6 09:50:51 2023 +0300 drm/bridge: tc358768: Fix bit updates The driver has a few places where it does: if (thing_is_enabled_in_config) update_thing_bit_in_hw() This means that if the thing is _not_ enabled, the bit never gets cleared. This affects the h/vsyncs and continuous DSI clock bits. Fix the driver to always update the bit. Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") Reviewed-by: Peter Ujfalusi Tested-by: Maxim Schwalm # Asus TF700T Tested-by: Marcel Ziswiler Signed-off-by: Tomi Valkeinen Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-4-31725f008a50@ideasonboard.com commit aa23099f4733a2e0d270c6c02d7a7503c70cdcf0 Author: Tomi Valkeinen Date: Wed Sep 6 09:50:50 2023 +0300 drm/bridge: tc358768: Default to positive h/v syncs As the TC358768 is a DPI to DSI bridge, the DSI side does not need to define h/v sync polarities. This means that sometimes we have a mode without defined sync polarities, which does not work on the DPI side. Add a mode_fixup hook to default to positive sync polarities. Reviewed-by: Peter Ujfalusi Tested-by: Maxim Schwalm # Asus TF700T Tested-by: Marcel Ziswiler Signed-off-by: Tomi Valkeinen Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-3-31725f008a50@ideasonboard.com commit a2d9036615f0adfa5b0a46bb2ce42ef1d9a04fbe Author: Tomi Valkeinen Date: Wed Sep 6 09:50:49 2023 +0300 drm/bridge: tc358768: Fix use of uninitialized variable smatch reports: drivers/gpu/drm/bridge/tc358768.c:223 tc358768_update_bits() error: uninitialized symbol 'orig'. Fix this by bailing out from tc358768_update_bits() if the tc358768_read() produces an error. Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") Reviewed-by: Peter Ujfalusi Tested-by: Maxim Schwalm # Asus TF700T Tested-by: Marcel Ziswiler Signed-off-by: Tomi Valkeinen Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-2-31725f008a50@ideasonboard.com commit 1716b1891e1de05e2c20ccafa9f58550f3539717 Author: Thierry Reding Date: Wed Sep 6 09:50:48 2023 +0300 drm/tegra: rgb: Parameterize V- and H-sync polarities The polarities of the V- and H-sync signals are encoded as flags in the display mode, so use the existing information to setup the signals for the RGB interface. Signed-off-by: Thierry Reding Cc: Thierry Reding [tomi.valkeinen@ideasonboard.com: default to positive sync] Reviewed-by: Peter Ujfalusi Tested-by: Maxim Schwalm # Asus TF700T Tested-by: Marcel Ziswiler Signed-off-by: Tomi Valkeinen Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230906-tc358768-v4-1-31725f008a50@ideasonboard.com commit 74f7957c9b1b95553faaf146a2553e023a9d1720 Author: Jinjie Ruan Date: Tue Sep 19 13:06:50 2023 +0800 wifi: rtw88: debug: Fix the NULL vs IS_ERR() bug for debugfs_create_file() Since debugfs_create_file() return ERR_PTR and never return NULL, so use IS_ERR() to check it instead of checking NULL. Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver") Signed-off-by: Jinjie Ruan Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230919050651.962694-1-ruanjinjie@huawei.com commit 45aec443bbb00c4ecb97c0a1c71920fde6e91f19 Author: Kees Cook Date: Fri Sep 15 13:05:52 2023 -0700 wifi: brcmfmac: firmware: Annotate struct brcmf_fw_request with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct brcmf_fw_request. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Arend van Spriel Cc: Franky Lin Cc: Hante Meuleman Cc: Kalle Valo Cc: Matthias Brugger Cc: Hector Martin Cc: "Alvin Šipraga" Cc: Hans de Goede Cc: linux-wireless@vger.kernel.org Cc: brcm80211-dev-list.pdl@broadcom.com Cc: SHA-cyfmac-dev-list@infineon.com Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Matthias Brugger Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230915200552.never.642-kees@kernel.org commit cf74cdc6e581b158f0b3700a2e8daeb9499bfaba Author: Kees Cook Date: Fri Sep 15 13:05:43 2023 -0700 wifi: brcmfmac: Annotate struct brcmf_gscan_config with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct brcmf_gscan_config. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Arend van Spriel Cc: Franky Lin Cc: Hante Meuleman Cc: Kalle Valo Cc: "Gustavo A. R. Silva" Cc: Hector Martin Cc: Ryohei Kondo Cc: Hans de Goede Cc: linux-wireless@vger.kernel.org Cc: brcm80211-dev-list.pdl@broadcom.com Cc: SHA-cyfmac-dev-list@infineon.com Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230915200542.never.417-kees@kernel.org commit 105c931a22556eec1d2e2f7b5f6f7710081da2b0 Author: Tzuyi Chang Date: Tue Sep 19 18:11:17 2023 +0800 dt-bindings: pinctrl: realtek: add RTD1619B pinctrl binding Add device tree bindings for RTD1619B. Signed-off-by: Tzuyi Chang Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230919101117.4097-8-tychang@realtek.com Signed-off-by: Linus Walleij commit bc8d39a56916edbf7e9dde7489812e1fb11bcdbb Author: Tzuyi Chang Date: Tue Sep 19 18:11:16 2023 +0800 dt-bindings: pinctrl: realtek: add RTD1319D pinctrl binding Add device tree bindings for RTD1319D. Signed-off-by: Tzuyi Chang Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230919101117.4097-7-tychang@realtek.com Signed-off-by: Linus Walleij commit ee3014e863ee14d02992fdf1a19f4cc62dfe82ed Author: Tzuyi Chang Date: Tue Sep 19 18:11:15 2023 +0800 dt-bindings: pinctrl: realtek: add RTD1315E pinctrl binding Add device tree bindings for RTD1315E. Signed-off-by: Tzuyi Chang Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230919101117.4097-6-tychang@realtek.com Signed-off-by: Linus Walleij commit c7910f6aca567614738226e4597d18a6f8dacfee Author: Tzuyi Chang Date: Tue Sep 19 18:11:14 2023 +0800 pinctrl: realtek: Add pinctrl driver for RTD1619B Add RTD1619B support using realtek common pinctrl driver. Signed-off-by: Tzuyi Chang Link: https://lore.kernel.org/r/20230919101117.4097-5-tychang@realtek.com Signed-off-by: Linus Walleij commit 916cc2b734cbdfdd4c58887be51a8a8a398e18d7 Author: Tzuyi Chang Date: Tue Sep 19 18:11:13 2023 +0800 pinctrl: realtek: Add pinctrl driver for RTD1319D Add RTD1319D support using realtek common pinctrl driver. Signed-off-by: Tzuyi Chang Link: https://lore.kernel.org/r/20230919101117.4097-4-tychang@realtek.com Signed-off-by: Linus Walleij commit aa399e6c6b24c9cc8a8e4ccc205457205cd41491 Author: Tzuyi Chang Date: Tue Sep 19 18:11:12 2023 +0800 pinctrl: realtek: Add pinctrl driver for RTD1315E Add RTD1315E support using realtek common pinctrl driver. Signed-off-by: Tzuyi Chang Link: https://lore.kernel.org/r/20230919101117.4097-3-tychang@realtek.com Signed-off-by: Linus Walleij commit e99ce78030db2fca9b296a1c4f4aaa87b008d97b Author: Tzuyi Chang Date: Tue Sep 19 18:11:11 2023 +0800 pinctrl: realtek: Add common pinctrl driver for Realtek DHC RTD SoCs The RTD SoCs share a similar design for pinmux and pinconfig. This common pinctrl driver supports different variants within the RTD SoCs. Signed-off-by: Tzuyi Chang Link: https://lore.kernel.org/r/20230919101117.4097-2-tychang@realtek.com Signed-off-by: Linus Walleij commit bb9fb4a42de14b56bdf90b5af6db770ec4830af8 Author: Alicja Michalska Date: Sat Sep 9 04:37:53 2023 +0200 drm/bridge/analogix/anx78xx: Add missing definition Analogix ANX78XX driver is missing definitions for anx7816. It uses the same I2C register set as anx7818. Signed-off-by: Alicja Michalska Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/ZPvagaXnQ/TlNEkJ@tora commit 5305d85077c739a7f3bd19c434a69e5ab253f229 Author: Alicja Michalska Date: Mon Sep 18 23:49:44 2023 +0200 dt-bindings: display: anx7814: Add definition for anx7816 As requested by Robert Foss , this patch adds definition for anx7816. It supplements the patch submitted to dri-devel. Signed-off-by: Alicja Michalska Acked-by: Rob Herring Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/ZQjFabKW7QvrvsnG@tora commit b3af9c0e89ca721dfed95401c88c8c6e8067b558 Merge: 6c0da8406382d aec42f36237b0 Author: David S. Miller Date: Wed Sep 20 11:56:27 2023 +0100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Alexei Starovoitov says: ==================== bpf-next 2023-09-19 The following pull-request contains BPF updates for your *net-next* tree. We've added 4 non-merge commits during the last 1 day(s) which contain a total of 4 files changed, 9 insertions(+), 13 deletions(-). The main changes are: 1) A set of fixes for bpf exceptions, from Kumar and Alexei. ==================== Signed-off-by: David S. Miller commit 6c0da8406382d39ec06ad54b0d4935bd7d63612c Author: Colin Ian King Date: Tue Sep 19 10:52:05 2023 +0100 wifi: cfg80211: make read-only array centers_80mhz static const Don't populate the read-only array lanes on the stack, instead make it static const. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit ccd663caffc7b5158a0a841b70618d9e87da531c Author: Colin Ian King Date: Tue Sep 19 10:40:21 2023 +0100 net: dsa: mv88e6xxx: make const read-only array lanes static Don't populate the const read-only array lanes on the stack, instead make it static. Signed-off-by: Colin Ian King Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit c067e7ffb31f270163b9f11da83a86ab660ee783 Author: Ulf Hansson Date: Tue Sep 12 00:25:50 2023 +0200 pmdomain: bcm: Move Kconfig options to the pmdomain subsystem The Kconfig options belongs closer to the corresponding implementations, hence let's move them from the soc subsystem to the pmdomain subsystem. Cc: Florian Fainelli Cc: Ray Jui Cc: Scott Branden Cc: Cc: Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Ulf Hansson commit 660b8b2f394470fae2774daf7473ddc259373a5a Author: Robert Marko Date: Thu Sep 14 11:45:01 2023 +0200 arm64: dts: marvell: eDPU: add support for version with external switch New revision of eDPU uses an Marvell MV88E6361 switch to connect the SFP cage and G.hn IC instead of connecting them directly to the ethernet controllers. U-Boot will enable the switch node and disable the unused ethernet controller. Signed-off-by: Robert Marko Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit fe8087770179c104d9edf5f191cd0de1dd3be93d Author: Robert Marko Date: Thu Sep 14 11:45:00 2023 +0200 arm64: dts: marvell: uDPU: rename the SFP GPIO properties Rename the GPIO related SFP properties to include the preffered -gpios suffix as defined in the SFP schema. This fixes the following warning: arch/arm64/boot/dts/marvell/armada-3720-eDPU.dtb: sfp-eth1: 'los-gpio', 'mod-def0-gpio', 'tx-disable-gpio', 'tx-fault-gpio' do not match any of the regexes: 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/net/sff,sfp.yaml# Signed-off-by: Robert Marko Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 0f5f46a869a5e82fde7a208fbde6f3846972c72a Author: Song Shuai Date: Thu Sep 7 18:33:04 2023 +0800 riscv: kexec: Remove -fPIE for PURGATORY_CFLAGS With CONFIG_RELOCATABLE enabled, KBUILD_CFLAGS had a -fPIE option and then the purgatory/string.o was built to reference _ctype symbol via R_RISCV_GOT_HI20 relocations which can't be handled by purgatory. As a consequence, the kernel failed kexec_load_file() with: [ 880.386562] kexec_image: The entry point of kernel at 0x80200000 [ 880.388650] kexec_image: Unknown rela relocation: 20 [ 880.389173] kexec_image: Error loading purgatory ret=-8 So remove the -fPIE option for PURGATORY_CFLAGS to generate R_RISCV_PCREL_HI20 relocations type making puragtory work as it was. Fixes: 39b33072941f ("riscv: Introduce CONFIG_RELOCATABLE") Signed-off-by: Song Shuai Link: https://lore.kernel.org/r/20230907103304.590739-4-songshuaishuai@tinylab.org Signed-off-by: Palmer Dabbelt commit 767423658d53d147409821e51e6d0bc12425b24f Author: Song Shuai Date: Thu Sep 7 18:33:03 2023 +0800 riscv: kexec: Align the kexeced kernel entry The current riscv boot protocol requires 2MB alignment for RV64 and 4MB alignment for RV32. In KEXEC_FILE path, the elf_find_pbase() function should align the kexeced kernel entry according to the requirement, otherwise the kexeced kernel would silently BUG at the setup_vm(). Fixes: 8acea455fafa ("RISC-V: Support for kexec_file on panic") Signed-off-by: Song Shuai Link: https://lore.kernel.org/r/20230907103304.590739-3-songshuaishuai@tinylab.org Signed-off-by: Palmer Dabbelt commit 04a6a8eb1375c1c1f3a735c5715854ce8a3f3730 Author: Song Shuai Date: Thu Sep 7 18:33:02 2023 +0800 riscv: kexec: Cleanup riscv_kexec_relocate For readability and simplicity, cleanup the riscv_kexec_relocate code: - Re-sort the first 4 `mv` instructions against `riscv_kexec_method()` - Eliminate registers for debugging (s9,s10,s11) and storing const-value (s5,s6) - Replace `jalr` with `jr` for no-link jump I tested this on Qemu virt machine and works as it was. Signed-off-by: Song Shuai Link: https://lore.kernel.org/r/20230907103304.590739-2-songshuaishuai@tinylab.org Signed-off-by: Palmer Dabbelt commit 3a69ab875233734bc434402379100272cd70bde2 Merge: 4fa7011d4f22d 529cdfd5e3a69 Author: David S. Miller Date: Wed Sep 20 10:52:31 2023 +0100 Merge branch 'ionic-better-tx-sg=handling' Shannon Nelson says: ==================== ionic: better Tx SG handling The primary patch here is to be sure we're not hitting linearize on a Tx skb when we don't really need to. The other two are related details. ==================== Signed-off-by: David S. Miller commit 529cdfd5e3a69bdc095ce3d535cadf897b787610 Author: Shannon Nelson Date: Mon Sep 18 15:21:36 2023 -0700 ionic: expand the descriptor bufs array When processing a TSO we may have frags spread across several descriptors, and the total count of frags in one skb may exceed our per descriptor IONIC_MAX_FRAGS: this is fine as long as each descriptor has fewer frags than the limit. Since the skb could have as many as MAX_SKB_FRAGS, and the first descriptor is where we track and map the frag buffers, we need to be sure we can map buffers for all of the frags plus the TSO header in the first descriptor's buffer array. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 40d835391b4f0af99cf49c71fab4d6ba8511b07f Author: Shannon Nelson Date: Mon Sep 18 15:21:35 2023 -0700 ionic: add a check for max SGs and SKB frags Add a check of the queue's max_sg_elems against the maximum frags we expect to see per SKB and take the smaller of the two as our max for the queues' descriptor buffer allocations. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 4d9d72200d4c69710e8371c872449c46bcab646f Author: Shannon Nelson Date: Mon Sep 18 15:21:34 2023 -0700 ionic: count SGs in packet to minimize linearize There are some cases where an skb carries more frags than the number of SGs that ionic can support per descriptor - this forces the driver to linearize the skb. However, if this is a TSO packet that is going to become multiple descriptors (one per MTU-sized packet) and spread the frags across them, this time-consuming linearization is likely not necessary. We scan the frag list and count up the number of SGs that would be created for each descriptor that would be generated, and only linearize if we hit the SG limit on a descriptor. In most cases, we won't even get to the frag list scan, so this doesn't affect typical traffic. Signed-off-by: Shannon Nelson Signed-off-by: David S. Miller commit 0878fd86f554ab98aa493996c7e0c72dff58437f Author: Chris Packham Date: Mon Aug 21 10:51:25 2023 +1200 ARM64: dts: marvell: cn9310: Use appropriate label for spi1 pins Both the CN9130-CRB and CN9130-DB use the SPI1 interface but had the pinctrl node labelled as "cp0_spi0_pins". Use the label "cp0_spi1_pins" and update the node name to "cp0-spi-pins-1" to avoid confusion with the pinctrl options for SPI0. Fixes: 4c43a41e5b8c ("arm64: dts: cn913x: add device trees for topology B boards") Fixes: 5c0ee54723f3 ("arm64: dts: add support for Marvell cn9130-crb platform") Signed-off-by: Chris Packham Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 4fa7011d4f22d5b2e14cba19b524a4f90268b5c1 Merge: a76c22e22cb7a 89776a6a702e9 Author: David S. Miller Date: Wed Sep 20 10:35:22 2023 +0100 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-09-18 (ice) This series contains updates to ice driver only. Sergey prepends ICE_ to PTP timer commands to clearly convey namespace of commands. Karol adds retrying to acquire hardware semaphore for cross-timestamping and avoids writing to timestamp registers on E822 devices. He also renames some defines to be more clear and align with the data sheet. Additionally, a range check is moved in order to reduce duplicated code. Jake adds cross-timestamping support for E823 devices as well as adds checks against netlist to aid in determining support for GNSS. He also corrects improper pin assignment for certain E810-T devices and refactors/cleanups PTP related code such as adding PHY model to ease checks for different needed implementations, removing unneeded EXTTS flag, and adding macro to check for source timer owner. ==================== Signed-off-by: David S. Miller commit a76c22e22cb7aecc22051f0bfe36eb50189738fe Merge: ad1e15dd2bb08 032ca4f9e7821 Author: David S. Miller Date: Wed Sep 20 10:29:35 2023 +0100 Merge branch 'mdio-platform-remove-void' Uwe Kleine-König says: ==================== net: mdio: Convert to platform remove callback returning void this series convert all platform drivers below drivers/net/mdio to use remove_new. The motivation is to get rid of an integer return code that is (mostly) ignored by the platform driver core and error prone on the driver side. See commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") for an extended explanation and the eventual goal. There are no interdependencies between the patches. As there are still quite a few drivers to convert, I'm happy about every patch that makes it in. So even if there is a merge conflict with one patch until you apply, please apply the remainder of this series anyhow. ==================== Signed-off-by: David S. Miller commit 032ca4f9e782153aef1dccef6d7f7c75c6f77fd3 Author: Uwe Kleine-König Date: Mon Sep 18 21:51:02 2023 +0200 net: mdio: xgene: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit efd8d907358e4aa6f1998fcd872e06a6bc7200de Author: Uwe Kleine-König Date: Mon Sep 18 21:51:01 2023 +0200 net: mdio: sun4i: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec Signed-off-by: David S. Miller commit 1e39b224b64d22b7db66d1e63fac774559e6d38b Author: Uwe Kleine-König Date: Mon Sep 18 21:51:00 2023 +0200 net: mdio: octeon: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit caa9b6b844e1046c9d41186aab43704a62746397 Author: Uwe Kleine-König Date: Mon Sep 18 21:50:59 2023 +0200 net: mdio: mux-multiplexer: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 70edec6746f27e2f5348f427aa897f432317006e Author: Uwe Kleine-König Date: Mon Sep 18 21:50:58 2023 +0200 net: mdio: mux-mmioreg: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit a2879f755ea63f3a257c0a61e6a0d2b202313b4d Author: Uwe Kleine-König Date: Mon Sep 18 21:50:57 2023 +0200 net: mdio: mux-meson-gxl: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 458eb39d0597e9f94de79abd64d84c165bd544ae Author: Uwe Kleine-König Date: Mon Sep 18 21:50:56 2023 +0200 net: mdio: mux-meson-g12a: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 0ec893508ebd8577c10e419e39a3001d26e5b676 Author: Uwe Kleine-König Date: Mon Sep 18 21:50:55 2023 +0200 net: mdio: mux-gpio: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 4c86f222181025e085563cdcafdcf3d46c0cfebb Author: Uwe Kleine-König Date: Mon Sep 18 21:50:54 2023 +0200 net: mdio: mux-bcm6368: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 8de522ca2d06d40e8926f55c367cb7ca668ba928 Author: Uwe Kleine-König Date: Mon Sep 18 21:50:53 2023 +0200 net: mdio: mux-bcm-iproc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit fa2bc3c45cc91ce9354b8ae6bcccbb4c68c828af Author: Uwe Kleine-König Date: Mon Sep 18 21:50:52 2023 +0200 net: mdio: mscc-miim: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 955d668ea8019080a87abc5b4116899463c12b00 Author: Uwe Kleine-König Date: Mon Sep 18 21:50:51 2023 +0200 net: mdio: moxart: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit cd5510c263d0b3149a3b1f6e6f9eafd3ac1482b0 Author: Uwe Kleine-König Date: Mon Sep 18 21:50:50 2023 +0200 net: mdio: ipq8064: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit b9ac5c4243248efbaae33a141049f2bfeaab6321 Author: Uwe Kleine-König Date: Mon Sep 18 21:50:49 2023 +0200 net: mdio: ipq4019: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 9ef2777c61f79105621a28c064f603509be21077 Author: Uwe Kleine-König Date: Mon Sep 18 21:50:48 2023 +0200 net: mdio: hisi-femac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit d17605282cb0b7f530db5b3baa200ea03a90f7af Author: Uwe Kleine-König Date: Mon Sep 18 21:50:47 2023 +0200 net: mdio: gpio: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 9b12e3f5a2d6e6cfa0c4b4dd9e1974542730ada0 Author: Uwe Kleine-König Date: Mon Sep 18 21:50:46 2023 +0200 net: mdio: bcm-unimac: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit d5bd3038b1998f073da7831569a6d4a12e3ac646 Author: Uwe Kleine-König Date: Mon Sep 18 21:50:45 2023 +0200 net: mdio: bcm-iproc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit a8a61d729e8a85ec21384bcc820cccc0da0c9296 Author: Uwe Kleine-König Date: Mon Sep 18 21:50:44 2023 +0200 net: mdio: aspeed: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit cc3b17cabe9fd2881eace5b7b1581914569d62e9 Author: Julia Lawall Date: Thu Sep 7 11:55:17 2023 +0200 soc: dove: add missing of_node_put for_each_available_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. This was done using the Coccinelle semantic patch iterators/for_each_child.cocci Signed-off-by: Julia Lawall Signed-off-by: Gregory CLEMENT commit ad1e15dd2bb084a85b287fd1cedea42f642e3e47 Merge: 6f0b985d3545e ce322d45683f1 Author: David S. Miller Date: Wed Sep 20 10:25:58 2023 +0100 Merge branch 'dsa-platform-remove-void' Uwe Kleine-König says: ==================== net: dsa: Convert to platform remove callback returning void this series converts all platform drivers below drivers/net/dsa to use remove_new. The motivation is to get rid of an integer return code that is (mostly) ignored by the platform driver core and error prone on the driver side. See commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") for an extended explanation and the eventual goal. There are no interdependencies between the patches. As there are still quite a few drivers to convert, I'm happy about every patch that makes it in. So even if there is a merge conflict with one patch until you apply or a subject prefix is suboptimal, please apply the remainder of this series anyhow. ==================== Signed-off-by: David S. Miller commit ce322d45683f1b0f4cc86ff684eb469eb165b9e9 Author: Uwe Kleine-König Date: Mon Sep 18 21:19:16 2023 +0200 net: dsa: vitesse-vsc73xx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 76be075d7f9984e427c8c90567ff9348ff752ddf Author: Uwe Kleine-König Date: Mon Sep 18 21:19:15 2023 +0200 net: dsa: rzn1_a5psw: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Reviewed-by: Geert Uytterhoeven Signed-off-by: David S. Miller commit d48a5472b8f2b29800bb25913f9403765005f1bc Author: Uwe Kleine-König Date: Mon Sep 18 21:19:14 2023 +0200 net: dsa: realtek: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Reviewed-by: Alvin Šipraga Signed-off-by: David S. Miller commit 68ace16ce3302c8c2e897e7623ea6da924ef519e Author: Uwe Kleine-König Date: Mon Sep 18 21:19:13 2023 +0200 net: dsa: ocelot: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 9764bbad3d33e54f235026b553e73605716de627 Author: Uwe Kleine-König Date: Mon Sep 18 21:19:12 2023 +0200 net: dsa: mt7530: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Acked-by: Daniel Golle Signed-off-by: David S. Miller commit a59f960c4d102bb3700a87e8264226ecd36f5efc Author: Uwe Kleine-König Date: Mon Sep 18 21:19:11 2023 +0200 net: dsa: lantiq_gswip: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit beb8592d041626532d01dc42f8010ba37953c1fc Author: Uwe Kleine-König Date: Mon Sep 18 21:19:10 2023 +0200 net: dsa: hirschmann: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Reviewed-by: Kurt Kanzenbach Signed-off-by: David S. Miller commit 75f5205f1dd84a4668bd639148ff830c94f3d61a Author: Uwe Kleine-König Date: Mon Sep 18 21:19:09 2023 +0200 net: dsa: bcm_sf2: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit c306171d6914d12286098e5383ff1028a340e6fb Author: Uwe Kleine-König Date: Mon Sep 18 21:19:08 2023 +0200 net: dsa: b53: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 67e18e132f0fd738f8c8cac3aa1420312073f795 Author: Zheng Yejian Date: Thu Sep 14 15:26:44 2023 +0800 livepatch: Fix missing newline character in klp_resolve_symbols() Without the newline character, the log may not be printed immediately after the error occurs. Fixes: ca376a937486 ("livepatch: Prevent module-specific KLP rela sections from referencing vmlinux symbols") Signed-off-by: Zheng Yejian Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20230914072644.4098857-1-zhengyejian1@huawei.com commit f9262fb1da6cc5499fff7e169e3aca8f8b59adde Author: Richard Fitzgerald Date: Wed Sep 20 10:03:38 2023 +0100 ALSA: hda: cirrus_scodec: Select GPIOLIB for KUnit test The KUnit test for cirrus_scodec uses GPIO library functions so select GPIOLIB in Kconfig. This fixes the ld failures on builds that didn't already select GPIOLIB. ld: vmlinux.o: in function `cirrus_scodec_test_gpio_get': sound/pci/hda/cirrus_scodec_test.c:40: undefined reference to `gpiochip_get_data' ld: vmlinux.o: in function `cirrus_scodec_test_gpio_probe': sound/pci/hda/cirrus_scodec_test.c:94: undefined reference to `gpiochip_generic_request' ld: sound/pci/hda/cirrus_scodec_test.c:94: undefined reference to `gpiochip_generic_free' ld: sound/pci/hda/cirrus_scodec_test.c:95: undefined reference to `devm_gpiochip_add_data_with_key' Signed-off-by: Richard Fitzgerald Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309201646.NnjfKPWk-lkp@intel.com/ Fixes: 2144833e7b41 ("ALSA: hda: cirrus_scodec: Add KUnit test") Link: https://lore.kernel.org/r/20230920090338.29345-1-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 1bfadf2edd653af321af17e1cfac4fb28c3f790d Author: Ulf Hansson Date: Tue Sep 12 00:13:37 2023 +0200 pmdomain: apple: Move Kconfig option to the pmdomain subsystem The Kconfig option belongs closer to the corresponding implementation, hence let's move it from the soc subsystem to the pmdomain subsystem. Cc: Hector Martin Cc: Sven Peter Cc: Alyssa Rosenzweig Cc: Reviewed-by: Eric Curtin Reviewed-by: Neal Gompa Signed-off-by: Ulf Hansson commit 2dfb28355dd352dcee0053095f3faa7cebe3151e Author: Ulf Hansson Date: Mon Sep 11 23:38:08 2023 +0200 pmdomain: amlogic: Move Kconfig options to the pmdomain subsystem The Kconfig options belongs closer to the corresponding implementations, hence let's move them from the soc subsystem to the pmdomain subsystem. Cc: Neil Armstrong Cc: Kevin Hilman Cc: Jerome Brunet Cc: Martin Blumenstingl Cc: Acked-by: Neil Armstrong Signed-off-by: Ulf Hansson commit 4db570466cddfdf3ccbbc6d180d059551ff93e68 Author: Ulf Hansson Date: Mon Sep 11 17:32:31 2023 +0200 pmdomain: actions: Move Kconfig file to the pmdomain subsystem The Kconfig belongs closer to the corresponding implementation, hence let's move it from the soc subsystem to the pmdomain subsystem. Cc: "Andreas Färber" Cc: Manivannan Sadhasivam Cc: Signed-off-by: Ulf Hansson commit d149718ea22c8e53a7a7dd6ac8034ee9be7784ce Author: Ulf Hansson Date: Mon Sep 11 17:22:15 2023 +0200 pmdomain: Prepare to move Kconfig files into the pmdomain subsystem Rather than having the various Kconfig files for the genpd providers sprinkled across subsystems, let's prepare to move them into the pmdomain subsystem along with the implementations. Reviewed-by: Geert Uytterhoeven Signed-off-by: Ulf Hansson commit 6f0b985d3545e1b1fe58318ef09808ae7aa0c470 Merge: 5bed8d585aa1d d74a5c154b6fa Author: David S. Miller Date: Wed Sep 20 09:06:41 2023 +0100 Merge branch 'net-platform-remove-void' Uwe Kleine-König says: ==================== net: ethernet: Convert to platform remove callback returning void this series convert nearly all platform drivers below drivers/net/ethernet to use remove_new. The motivation is to get rid of an integer return code that is (mostly) ignored by the platform driver core and error prone on the driver side. There are 3 drivers I didn't convert (yet): drivers/net/ethernet/ti/cpsw.c drivers/net/ethernet/ti/cpsw_new.c drivers/net/ethernet/ti/am65-cpsw-nuss.c These are a bit more complicated because they don't always return 0 in .remove(). Unless someone is quicker than me, I'll address them in separate patches at a later time. See commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") for an extended explanation and the eventual goal. There are no interdependencies between the patches. As there are still quite a few drivers to convert, I'm happy about every patch that makes it in. So even if there is a merge conflict with one patch until you apply, please apply the remainder of this series anyhow. ==================== Signed-off-by: David S. Miller commit d74a5c154b6fab303023e46e7cc1b14c3f3cabd9 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:26 2023 +0200 net: ethernet: xscale: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Krzysztof Hałasa Signed-off-by: David S. Miller commit 2e0ec0afa9025abaff214e1023fb11742e7a5cc8 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:25 2023 +0200 net: ethernet: xilinx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 46b5668494d0d1fb0c08546a81e5d0ab8e6084d5 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:24 2023 +0200 net: ethernet: wiznet: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 70680f17828048ddcf293de729970973cd3831ab Author: Uwe Kleine-König Date: Mon Sep 18 22:42:23 2023 +0200 net: ethernet: via: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 2f961952e19e0d92756584d8cefeedc5d67aa84f Author: Uwe Kleine-König Date: Mon Sep 18 22:42:22 2023 +0200 net: ethernet: tundra: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 231ea972ccaf5b4e8909232ac539cb44441f186f Author: Uwe Kleine-König Date: Mon Sep 18 22:42:21 2023 +0200 net: ethernet: ti: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli # cpmac Signed-off-by: David S. Miller commit ede778ed3ea9c567d818f8543b057a4744bf2dd1 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:20 2023 +0200 net: ethernet: sunplus: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 8f4e45a0135ea957af374b00cc30ef52bd93f85f Author: Uwe Kleine-König Date: Mon Sep 18 22:42:19 2023 +0200 net: ethernet: sun: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit d3cd32451c7ea7f9b6b98152fd34f239fc144423 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:18 2023 +0200 net: ethernet: socionext: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit e8e2c863f941e8f34fee2a11fd9d152a35d3ccdd Author: Uwe Kleine-König Date: Mon Sep 18 22:42:17 2023 +0200 net: ethernet: smsc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 506a327ceaaa6cd627bfb0c96a1890ed05d10224 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:16 2023 +0200 net: ethernet: sgi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 02c74030beff381ea2c942c1d3bbef70d6fbbe53 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:15 2023 +0200 net: ethernet: seeq: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 6e8b0ef7b389cb0dad357b725bdc79d43da0f2bf Author: Uwe Kleine-König Date: Mon Sep 18 22:42:14 2023 +0200 net: ethernet: samsung: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 0b4f04e2f60b435ff2457620551957418ac1ee0f Author: Uwe Kleine-König Date: Mon Sep 18 22:42:13 2023 +0200 net: ethernet: renesas: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Reviewed-by: Sergey Shtylyov Reviewed-by: Yoshihiro Shimoda Signed-off-by: David S. Miller commit 5180236592b9c692ff0c5c2d59b63227f78c7011 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:12 2023 +0200 net: ethernet: qualcomm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Timur Tabi Signed-off-by: David S. Miller commit 241882d79f998f0ac6749a5a62682e883faf88ff Author: Uwe Kleine-König Date: Mon Sep 18 22:42:11 2023 +0200 net: ethernet: nxp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 0f09f4e7d40113a2bb4812d4700ead0e69e37894 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:10 2023 +0200 net: ethernet: ni: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit b83fb509c758de30aa34bc1ffd716279b6578cad Author: Uwe Kleine-König Date: Mon Sep 18 22:42:09 2023 +0200 net: ethernet: natsemi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 9f0243d9bcc4e61b2de84c20b8ace17f2ed7a130 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:08 2023 +0200 net: ethernet: natsemi: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 0eaca7a9e9d68783f91c8b72e02690d65e144172 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:07 2023 +0200 net: ethernet: mscc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 253f9c47273d71391225131b9f5c12d469de7549 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:06 2023 +0200 net: ethernet: moxa:: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 5253ae3a6223be467461d183c3836b6eb3e22258 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:05 2023 +0200 net: ethernet: microchip: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit bae04ae2be07a714c9f37f92f4119578b68ec3aa Author: Uwe Kleine-König Date: Mon Sep 18 22:42:04 2023 +0200 net: ethernet: micrel: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit e184700959ecebf56c84ba94e29f369050c3e5d5 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:03 2023 +0200 net: ethernet: mellanox: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 5b6ce1734d9d90e9fcde58ba3ace57c742de4db2 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:02 2023 +0200 net: ethernet: mediatek: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit fee02f498c9a0d4ac92fc3188b680f475dd1a362 Author: Uwe Kleine-König Date: Mon Sep 18 22:42:01 2023 +0200 net: ethernet: marvell: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 36b80b8353afecec8167d1c440df0f1f0f384d1e Author: Uwe Kleine-König Date: Mon Sep 18 22:42:00 2023 +0200 net: ethernet: litex: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Gabriel Somlo Signed-off-by: David S. Miller commit adbb270655a1a17058d2ab42cda59cf52772169d Author: Uwe Kleine-König Date: Mon Sep 18 22:41:59 2023 +0200 net: ethernet: lantiq_xrx200: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit e791aa06a2dd07f25560c36d1846c5b665ae0745 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:58 2023 +0200 net: ethernet: lantiq_etop: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 551598a120d1445ebc7a54f4ca75e609773f5e6a Author: Uwe Kleine-König Date: Mon Sep 18 22:41:57 2023 +0200 net: ethernet: korina: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit ac35a3c4c8da0b931888cd9a82721a413215adba Author: Uwe Kleine-König Date: Mon Sep 18 22:41:56 2023 +0200 net: ethernet: ibm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit e5a6d397ca2e4b19c04790babf1643c5476a66d2 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:55 2023 +0200 net: ethernet: i825xx: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit e5835a0a51196f899eda2badad15469c2904aed1 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:54 2023 +0200 net: ethernet: hisilicon: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit dc715af33b42f5a99c49d8aef9ea75cf8d71e570 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:53 2023 +0200 net: ethernet: faraday: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 4cc08098d1970815e84629c271c21bd915f092db Author: Uwe Kleine-König Date: Mon Sep 18 22:41:52 2023 +0200 net: ethernet: ethoc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit d2e6c2ea996e9da8df65ba68d50d8c0ea38373e4 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:51 2023 +0200 net: ethernet: engleder: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 5db6c1fed1f9475726271c7e2459e26383c07689 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:50 2023 +0200 net: ethernet: dnet: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit ffb928290ba5d9d1b2a9768306dc3f9d2bb93717 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:49 2023 +0200 net: ethernet: davicom: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 1f69574b5cba7a7495541b58aa798f4952fe62dd Author: Uwe Kleine-König Date: Mon Sep 18 22:41:48 2023 +0200 net: ethernet: cortina: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 8ca0ae6a2ec74852482c05e993870a3dad0fa4ac Author: Uwe Kleine-König Date: Mon Sep 18 22:41:47 2023 +0200 net: ethernet: cirrus: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit de413f46a56e7e4d2d53384bb8afb1680bf98661 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:46 2023 +0200 net: ethernet: cavium: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit ca76b17922e67f07ed72dba200241c45c8a85ec6 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:45 2023 +0200 net: ethernet: calxeda: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 6b5940402f9c9c58136d2d4879f2b67f804943dc Author: Uwe Kleine-König Date: Mon Sep 18 22:41:44 2023 +0200 net: ethernet: cadence: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Claudiu Beznea Signed-off-by: David S. Miller commit d4295df3e0431eec484a63d26690a22c3dc5e0d2 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:43 2023 +0200 net: ethernet: broadcom: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit c6e817838902f554dedbf426377778ee56f006b2 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:42 2023 +0200 net: ethernet: atheros: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit de0afa130ed614745747407b66d11d3e6ab6871f Author: Uwe Kleine-König Date: Mon Sep 18 22:41:41 2023 +0200 net: ethernet: arc: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit e5d0a380b2b470cee8c9af59a3dca2e2d9646b36 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:40 2023 +0200 net: ethernet: apple: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 61471264c01887711923e7e310826e6037c4a431 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:39 2023 +0200 net: ethernet: apm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 9ecae52f7db455d9c8cfafb48e2ef19ff2fbe906 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:38 2023 +0200 net: ethernet: amd: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit d0b0245b84c98dc1894bc6b1553ca08da655266b Author: Uwe Kleine-König Date: Mon Sep 18 22:41:37 2023 +0200 net: ethernet: altera: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 9f07797c332e62f83072ca7abcde99fefc4d6e2e Author: Uwe Kleine-König Date: Mon Sep 18 22:41:36 2023 +0200 net: ethernet: allwinner: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Jernej Skrabec Signed-off-by: David S. Miller commit a0fbde8f647b14d744cd2c5ec26862beb56a4344 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:35 2023 +0200 net: ethernet: aeroflex: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit d8c6b3fc918dd7b93c66e49ff8640746b84fbfe9 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:34 2023 +0200 net: ethernet: actions: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 3c000faaaa65038b06261df1d3223b42f699e957 Author: Uwe Kleine-König Date: Mon Sep 18 22:41:33 2023 +0200 net: ethernet: 8390: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert these drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Signed-off-by: David S. Miller commit 58c49c097fbf5ad77fd367ad500339c36d284c23 Author: wenglianfa Date: Mon Sep 18 21:11:10 2023 +0800 RDMA/hns: Support SRQ restrack ops for hns driver The SRQ restrack attributes come from the context maintained by ROCEE. Example: $ rdma res show srq -jp -dd [ { "ifindex": 0, "ifname": "hns_0", "srqn": 0, "type": "BASIC", "lqpn": [ "14-15","22-23" ], "pdn": 2, "pid": 1224, "comm": "ib_send_bw",{ "drv_srqn": 0, "drv_wqe_cnt": 512, "drv_max_gs": 2, "drv_xrcdn": 0 } } ] $ rdma res show srq link hns_0 -jpr [ { "ifindex": 0, "ifname": "hns_0", "data": [ 149,0,0,0,0,0,0,0,0,0,0,0,119,101,120,99,0, 46,62,31,0,0,0,0,3,0,0,1,0,58,62,31,0,0,0,0, 30,159,15,0,0,0,64,5,0,0,0,0,0,0,0,0,0,0,0, 9,0,0,0,0,0,0,0,0 ] } ] Signed-off-by: wenglianfa Link: https://lore.kernel.org/r/20230918131110.3987498-4-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit aebf8145e11a29a77dac15ee041a190676fac05f Author: wenglianfa Date: Mon Sep 18 21:11:09 2023 +0800 RDMA/core: Add support to dump SRQ resource in RAW format Add support to dump SRQ resource in raw format. It enable drivers to return the entire device specific SRQ context without setting each field separately. Example: $ rdma res show srq -r dev hns3 149000... $ rdma res show srq -j -r [{"ifindex":0,"ifname":"hns3","data":[149,0,0,...]}] Signed-off-by: wenglianfa Link: https://lore.kernel.org/r/20230918131110.3987498-3-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit 0e32d7d43b0b2d870b45cf4dff8188203800aa91 Author: wenglianfa Date: Mon Sep 18 21:11:08 2023 +0800 RDMA/core: Add dedicated SRQ resource tracker function Add a dedicated callback function for SRQ resource tracker. Signed-off-by: wenglianfa Link: https://lore.kernel.org/r/20230918131110.3987498-2-huangjunxian6@hisilicon.com Signed-off-by: Leon Romanovsky commit fbeb558b0dd0d6348e0872bbbbe96e30c65867b7 Author: Peter Zijlstra Date: Fri Sep 15 17:19:44 2023 +0200 futex/pi: Fix recursive rt_mutex waiter state Some new assertions pointed out that the existing code has nested rt_mutex wait state in the futex code. Specifically, the futex_lock_pi() cancel case uses spin_lock() while there still is a rt_waiter enqueued for this task, resulting in a state where there are two waiters for the same task (and task_struct::pi_blocked_on gets scrambled). The reason to take hb->lock at this point is to avoid the wake_futex_pi() EAGAIN case. This happens when futex_top_waiter() and rt_mutex_top_waiter() state becomes inconsistent. The current rules are such that this inconsistency will not be observed. Notably the case that needs to be avoided is where futex_lock_pi() and futex_unlock_pi() interleave such that unlock will fail to observe a new waiter. *However* the case at hand is where a waiter is leaving, in this case the race means a waiter that is going away is not observed -- which is harmless, provided this race is explicitly handled. This is a somewhat dangerous proposition because the converse race is not observing a new waiter, which must absolutely not happen. But since the race is valid this cannot be asserted. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Gleixner Reviewed-by: Sebastian Andrzej Siewior Tested-by: Sebastian Andrzej Siewior Link: https://lkml.kernel.org/r/20230915151943.GD6743@noisy.programming.kicks-ass.net commit 45f67f30a22f264bc7a0a61255c2ee1a838e9403 Author: Thomas Gleixner Date: Fri Sep 8 18:22:53 2023 +0200 locking/rtmutex: Add a lockdep assert to catch potential nested blocking There used to be a BUG_ON(current->pi_blocked_on) in the lock acquisition functions, but that vanished in one of the rtmutex overhauls. Bring it back in form of a lockdep assert to catch code paths which take rtmutex based locks with current::pi_blocked_on != NULL. Reported-by: Crystal Wood Signed-off-by: Thomas Gleixner Signed-off-by: "Peter Zijlstra (Intel)" Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230908162254.999499-7-bigeasy@linutronix.de commit d14f9e930b9073de264c106bf04968286ef9b3a4 Author: Sebastian Andrzej Siewior Date: Fri Sep 8 18:22:52 2023 +0200 locking/rtmutex: Use rt_mutex specific scheduler helpers Have rt_mutex use the rt_mutex specific scheduler helpers to avoid recursion vs rtlock on the PI state. [[ peterz: adapted to new names ]] Reported-by: Crystal Wood Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230908162254.999499-6-bigeasy@linutronix.de commit 6b596e62ed9f90c4a97e68ae1f7b1af5beeb3c05 Author: Peter Zijlstra Date: Fri Sep 8 18:22:51 2023 +0200 sched: Provide rt_mutex specific scheduler helpers With PREEMPT_RT there is a rt_mutex recursion problem where sched_submit_work() can use an rtlock (aka spinlock_t). More specifically what happens is: mutex_lock() /* really rt_mutex */ ... __rt_mutex_slowlock_locked() task_blocks_on_rt_mutex() // enqueue current task as waiter // do PI chain walk rt_mutex_slowlock_block() schedule() sched_submit_work() ... spin_lock() /* really rtlock */ ... __rt_mutex_slowlock_locked() task_blocks_on_rt_mutex() // enqueue current task as waiter *AGAIN* // *CONFUSION* Fix this by making rt_mutex do the sched_submit_work() early, before it enqueues itself as a waiter -- before it even knows *if* it will wait. [[ basically Thomas' patch but with different naming and a few asserts added ]] Originally-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230908162254.999499-5-bigeasy@linutronix.de commit de1474b46d889ee0367f6e71d9adfeb0711e4a8d Author: Thomas Gleixner Date: Fri Sep 8 18:22:50 2023 +0200 sched: Extract __schedule_loop() There are currently two implementations of this basic __schedule() loop, and there is soon to be a third. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230908162254.999499-4-bigeasy@linutronix.de commit af9f006393b53409be0ca83ae234bef840cdef4a Author: Sebastian Andrzej Siewior Date: Fri Sep 8 18:22:49 2023 +0200 locking/rtmutex: Avoid unconditional slowpath for DEBUG_RT_MUTEXES With DEBUG_RT_MUTEXES enabled the fast-path rt_mutex_cmpxchg_acquire() always fails and all lock operations take the slow path. Provide a new helper inline rt_mutex_try_acquire() which maps to rt_mutex_cmpxchg_acquire() in the non-debug case. For the debug case it invokes rt_mutex_slowtrylock() which can acquire a non-contended rtmutex under full debug coverage. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230908162254.999499-3-bigeasy@linutronix.de commit 28bc55f654de49f6122c7475b01b5d5ef4bdf0d4 Author: Peter Zijlstra Date: Fri Sep 8 18:22:48 2023 +0200 sched: Constrain locks in sched_submit_work() Even though sched_submit_work() is ran from preemptible context, it is discouraged to have it use blocking locks due to the recursion potential. Enforce this. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20230908162254.999499-2-bigeasy@linutronix.de commit 8bf7187d978610b9e327a3d92728c8864a575ebd Author: Ilpo Järvinen Date: Tue Sep 19 15:56:41 2023 +0300 RDMA/hfi1: Use FIELD_GET() to extract Link Width Use FIELD_GET() to extract PCIe Negotiated Link Width field instead of custom masking and shifting, and remove extract_width() which only wraps that FIELD_GET(). Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230919125648.1920-2-ilpo.jarvinen@linux.intel.com Reviewed-by: Jonathan Cameron Reviewed-by: Dean Luick Signed-off-by: Leon Romanovsky commit e738e355045237ee8802cb2b31a8ed6f4b7ac534 Author: Shay Drory Date: Wed Jun 21 20:25:00 2023 +0300 net/mlx5: Enable 4 ports multiport E-switch enable_mpesw() assumed only 2 ports are available, fix this by removing that assumption and looping through the existing lag ports to enable multi-port E-switch for cards with more than 2 ports. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit e0cc92fd945a9c8e43d4268cf1ea985d0e99a90f Author: Moshe Shemesh Date: Thu Aug 3 16:39:40 2023 +0300 net/mlx5: Add a health error syndrome for pci data poisoned Add new health error syndrome to indicate that pci data poisoned error has been received while fetching device ICM data. Signed-off-by: Moshe Shemesh Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 3b81bcbaee28213ba7e6061c523db918c594ad67 Author: Erez Shitrit Date: Mon Aug 28 14:37:12 2023 +0300 net/mlx5: DR, Handle multi destination action in the right order Whenever we have few destinations from Flow-table type we need to put the one that goes to the wire to be the last one. We are using FW in order to get iterator, the FW uses RX for the first destinations and TX for the last destination, if we want the packet to be directed to the wire it should be done in the TX path and not in the RX. The code now checks if the FT is directed to the wire and if so puts it as the last destination. Signed-off-by: Erez Shitrit Reviewed-by: Moshe Shemesh Reviewed-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed commit f6f46e7173cb4613b84a0c0640355826ee39654f Author: Erez Shitrit Date: Mon Mar 13 14:10:20 2023 +0200 net/mlx5: DR, Add check for multi destination FTE The driver should not allow rule that forward to more than one FT in TX flow unless there is a specific support from the FW. Signed-off-by: Erez Shitrit Reviewed-by: Moshe Shemesh Reviewed-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed commit 653b7eb9d74426397c95061fd57da3063625af65 Author: Erez Shitrit Date: Mon Aug 28 14:20:00 2023 +0300 net/mlx5: Bridge, Enable mcast in smfs steering mode In order to have mcast offloads the driver needs the following: It should know if that mcast comes from wire port, in addition the flow should not be marked as any specific source, that way it will give the flexibility for the driver not to be depended on the way iterator implemented in the FW. Signed-off-by: Erez Shitrit Reviewed-by: Moshe Shemesh Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 4291ab7112ea5a1c72d05707e8e1521845887699 Author: Jianbo Liu Date: Tue Sep 5 03:48:20 2023 +0000 net/mlx5e: Check police action rate for matchall filter As matchall filter uses TSAR (Transmit Scheduling Arbiter) for rate limit, the rate of police action should not be over the port's max link speed, or the maximum aggregated speed of both ports if LAG is configured. Signed-off-by: Jianbo Liu Reviewed-by: Parav Pandit Reviewed-by: Dragos Tatulea Signed-off-by: Saeed Mahameed commit 8d88e198dcaf700e33c2a4c796af9434652c56e7 Author: Jianbo Liu Date: Wed Aug 30 01:19:01 2023 +0000 net/mlx5e: Consider aggregated port speed during rate configuration When LAG is configured, functions (PF,VF,SF) can utilize the maximum aggregated link speed for transmission. Currently the aggregated link speed is not considered. Hence, improve it to use the aggregated link speed by referring to the physical port's upper bonding device when LAG is configured. Signed-off-by: Jianbo Liu Reviewed-by: Parav Pandit Reviewed-by: Dragos Tatulea Signed-off-by: Saeed Mahameed commit 7c35cd836f21acbb1141e03bca737c7e6ddd768a Author: Jiri Pirko Date: Wed Jun 28 13:19:05 2023 +0200 net/mlx5: Remove redundant max_sfs check and field from struct mlx5_sf_dev_table table->max_sfs is initialized in mlx5_sf_dev_table_create() and only used to check for 0 in mlx5_sf_dev_add(). mlx5_sf_dev_add() is called either from mlx5_sf_dev_state_change_handler() or mlx5_sf_dev_add_active_work(). Both ensure max SF count is not 0, using mlx5_sf_max_functions() helper before calling mlx5_sf_dev_add(). So remove the redundant check and no longer used max_sfs field. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 2fe6545ef541bff33362bcce9214e9e390ca34b9 Author: Jiri Pirko Date: Fri May 19 08:21:56 2023 +0200 net/mlx5: Remove SF table reference counting Historically, the SF table reference counting was present in order to protect parallel executions of devlink ops. However, since currently this is protected with devlink instance lock, the SF table reference counting is no longer needed. Remove it entirely. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit a3cc822beacc7ccabc6966e75e721944818f37ff Author: Jiri Pirko Date: Fri Jun 2 16:02:52 2023 +0200 net/mlx5: Push common deletion code into mlx5_sf_del() Don't call the same functions for SF deletion on multiple places. Instead, introduce a helper mlx5_sf_del() and move the code there. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit a65362f2be8daec046f371ada0e0f9f9cd8ed5dd Author: Jiri Pirko Date: Fri Jun 2 15:54:39 2023 +0200 net/mlx5: Rename mlx5_sf_deactivate_all() to mlx5_sf_del_all() The function does not do deactivation, but it deletes all SFs instead. Rename accordingly. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 9497036dfbb8db1fda3915ae72f35db161f09e59 Author: Jiri Pirko Date: Fri Jun 2 15:51:42 2023 +0200 net/mlx5: Move state lock taking into mlx5_sf_dealloc() Instead of taking lock and calling mlx5_sf_dealloc(), move the lock taking into mlx5_sf_dealloc(). The other caller of mlx5_sf_dealloc() does not need it now, but will need it after a follow-up patch removing the table reference counting. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 2284a4836251b3dee348172f69ac84157aa7b03e Author: Jiri Pirko Date: Thu May 18 11:33:16 2023 +0200 net/mlx5: Convert SF port_indices xarray to function_ids xarray No need to lookup for sf by a port index. Convert the xarray to have function id as an index and optimize the remaining function id based lookup. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 9caeb1475c3e852bcfa6332227c6bb2feaa8eb23 Author: Jiri Pirko Date: Wed May 17 13:59:34 2023 +0200 net/mlx5: Use devlink port pointer to get the pointer of container SF struct Benefit from the fact that struct devlink_port is eventually embedded in struct mlx5_sf and use container_of() macro to get it instead of the xarray lookup in every devlink port op. Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 2597ee190b4eb48d3b7d35b7bb2cc18046ae087e Author: Jiri Pirko Date: Fri Jun 2 13:43:42 2023 +0200 net/mlx5: Call mlx5_sf_id_erase() once in mlx5_sf_dealloc() Before every call of mlx5_sf_dealloc(), there is a call to mlx5_sf_id_erase(). So move it to the beginning of mlx5_sf_dealloc(). Also remove redundant mlx5_sf_id_erase() call from mlx5_sf_free() as it is called only from mlx5_sf_dealloc(). Signed-off-by: Jiri Pirko Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed commit 1c43c0f1f84aa59dfc98ce66f0a67b2922aa7f9d Author: Roxana Nicolescu Date: Fri Sep 15 12:23:25 2023 +0200 crypto: x86/sha - load modules based on CPU features x86 optimized crypto modules are built as modules rather than build-in and they are not loaded when the crypto API is initialized, resulting in the generic builtin module (sha1-generic) being used instead. It was discovered when creating a sha1/sha256 checksum of a 2Gb file by using kcapi-tools because it would take significantly longer than creating a sha512 checksum of the same file. trace-cmd showed that for sha1/256 the generic module was used, whereas for sha512 the optimized module was used instead. Add module aliases() for these x86 optimized crypto modules based on CPU feature bits so udev gets a chance to load them later in the boot process. This resulted in ~3x decrease in the real-time execution of kcapi-dsg. Fix is inspired from commit aa031b8f702e ("crypto: x86/sha512 - load based on CPU features") where a similar fix was done for sha512. Cc: stable@vger.kernel.org # 5.15+ Suggested-by: Dimitri John Ledkov Suggested-by: Julian Andres Klode Signed-off-by: Roxana Nicolescu Signed-off-by: Herbert Xu commit ce2cb2e1b8a27d929a0eaa042049912b0756efe0 Author: Wenkai Lin Date: Fri Sep 15 17:13:29 2023 +0800 crypto: hisilicon/sec - fix for sgl unmmap problem When sec_aead_mac_init returns an error code, sec_cipher_map will exit abnormally, the hardware sgl should be unmmaped. Signed-off-by: Wenkai Lin Signed-off-by: Herbert Xu commit 37b14f2dfa791fd485dbc536f8d1ffe8c6990290 Author: Adam Guerin Date: Thu Sep 14 15:14:13 2023 +0100 crypto: qat - enable dc chaining service QAT GEN4 devices support chained compression operations. These allow, with a single request to firmware, to hash then compress data. Extend the configuration to enable such mode. The cfg_services operations in sysfs are extended to allow the string "dcc". When selected, the driver downloads to the device both the symmetric crypto and the compression firmware images and sends an admin message to firmware which enables `chained` operations. In addition, it sets the device's capabilities as the combination of compression and symmetric crypto capabilities, while excluding the ICP_ACCEL_CAPABILITIES_CRYPTO_SYMMETRIC bit to indicate that in this mode, symmetric crypto instances are not supported. When "dcc" is enabled, the device will handle compression requests as if the "dc" configuration is loaded ("dcc" is a variation of "dc") and the driver will register the acomp algorithms. As for the other extended configurations, "dcc" is only available for qat_4xxx devices and the chaining service will be only accessible from user space. Signed-off-by: Adam Guerin Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 71713766380712c8ab2d604605e7b0b20f977801 Author: Giovanni Cabiddu Date: Thu Sep 14 15:14:12 2023 +0100 crypto: qat - consolidate services structure The data structure that associates a service id with its name is replicated across the driver. Remove duplication by moving this data structure to a new include file, adf_cfg_services.h in order to have consistency across the drivers. Note that the data structure is re-instantiated every time the new include is added to a compilation unit. Signed-off-by: Giovanni Cabiddu Reviewed-by: Andy Shevchenko Signed-off-by: Herbert Xu commit 11af152f784d9eca54e193140891ac52de36e9a9 Author: Giovanni Cabiddu Date: Thu Sep 14 10:55:49 2023 +0100 crypto: qat - fix unregistration of compression algorithms The function adf_dev_init(), through the subsystem qat_compression, populates the list of list of compression instances accel_dev->compression_list. If the list of instances is not empty, the function adf_dev_start() will then call qat_compression_registers() register the compression algorithms into the crypto framework. If any of the functions in adf_dev_start() fail, the caller of such function, in the error path calls adf_dev_down() which in turn call adf_dev_stop() and adf_dev_shutdown(), see for example the function state_store in adf_sriov.c. However, if the registration of compression algorithms is not done, adf_dev_stop() will try to unregister the algorithms regardless. This might cause the counter active_devs in qat_compression.c to get to a negative value. Add a new state, ADF_STATUS_COMPRESSION_ALGS_REGISTERED, which tracks if the compression algorithms are registered into the crypto framework. Then use this to unregister the algorithms if such flag is set. This ensures that the compression algorithms are only unregistered if previously registered. Fixes: 1198ae56c9a5 ("crypto: qat - expose deflate through acomp api for QAT GEN2") Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Signed-off-by: Herbert Xu commit 9b2f33a1bfcda90b857431a764c9c8f9a412bbe5 Author: Giovanni Cabiddu Date: Thu Sep 14 10:55:48 2023 +0100 crypto: qat - fix unregistration of crypto algorithms The function adf_dev_init(), through the subsystem qat_crypto, populates the list of list of crypto instances accel_dev->crypto_list. If the list of instances is not empty, the function adf_dev_start() will then call qat_algs_registers() and qat_asym_algs_register() to register the crypto algorithms into the crypto framework. If any of the functions in adf_dev_start() fail, the caller of such function, in the error path calls adf_dev_down() which in turn call adf_dev_stop() and adf_dev_shutdown(), see for example the function state_store in adf_sriov.c. However, if the registration of crypto algorithms is not done, adf_dev_stop() will try to unregister the algorithms regardless. This might cause the counter active_devs in qat_algs.c and qat_asym_algs.c to get to a negative value. Add a new state, ADF_STATUS_CRYPTO_ALGS_REGISTERED, which tracks if the crypto algorithms are registered into the crypto framework. Then use this to unregister the algorithms if such flag is set. This ensures that the crypto algorithms are only unregistered if previously registered. Fixes: d8cba25d2c68 ("crypto: qat - Intel(R) QAT driver framework") Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Signed-off-by: Herbert Xu commit 9c20cb8b1847dedddec3d5163079290542bf00bf Author: Giovanni Cabiddu Date: Thu Sep 14 10:55:47 2023 +0100 crypto: qat - ignore subsequent state up commands If the device is already in the up state, a subsequent write of `up` to the sysfs attribute /sys/bus/pci/devices//qat/state brings the device down. Fix this behaviour by ignoring subsequent `up` commands if the device is already in the up state. Fixes: 1bdc85550a2b ("crypto: qat - fix concurrency issue when device state changes") Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Signed-off-by: Herbert Xu commit c362a58e8da7828cf1501e1af9d43cd6c9641c5b Author: Giovanni Cabiddu Date: Thu Sep 14 10:55:46 2023 +0100 crypto: qat - do not shadow error code Do not shadow the return code from adf_dev_down() in the error path of the DEV_DOWN command. Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Signed-off-by: Herbert Xu commit c9ca9756f376f51f985130a0e599d956065d4c44 Author: Giovanni Cabiddu Date: Thu Sep 14 10:55:45 2023 +0100 crypto: qat - fix state machines cleanup paths Commit 1bdc85550a2b ("crypto: qat - fix concurrency issue when device state changes") introduced the function adf_dev_down() which wraps the functions adf_dev_stop() and adf_dev_shutdown(). In a subsequent change, the sequence adf_dev_stop() followed by adf_dev_shutdown() was then replaced across the driver with just a call to the function adf_dev_down(). The functions adf_dev_stop() and adf_dev_shutdown() are called in error paths to stop the accelerator and free up resources and can be called even if the counterparts adf_dev_init() and adf_dev_start() did not complete successfully. However, the implementation of adf_dev_down() prevents the stop/shutdown sequence if the device is found already down. For example, if adf_dev_init() fails, the device status is not set as started and therefore a call to adf_dev_down() won't be calling adf_dev_shutdown() to undo what adf_dev_init() did. Do not check if a device is started in adf_dev_down() but do the equivalent check in adf_sysfs.c when handling a DEV_DOWN command from the user. Fixes: 2b60f79c7b81 ("crypto: qat - replace state machine calls") Signed-off-by: Giovanni Cabiddu Reviewed-by: Adam Guerin Signed-off-by: Herbert Xu commit 1a9e6f59caeea35d157f91b452ae75f251d8255b Author: Yang Shen Date: Thu Sep 14 17:09:08 2023 +0800 crypto: hisilicon/zip - remove zlib and gzip Remove the support of zlib-deflate and gzip. Signed-off-by: Yang Shen Reviewed-by: Longfang Liu Signed-off-by: Herbert Xu commit aa3f80500382ca864b7cfcff4e5ca2fa6a0e977d Author: Yang Shen Date: Thu Sep 14 17:09:07 2023 +0800 crypto: hisilicon/zip - support deflate algorithm Add the deflate algorithm support for hisilicon zip hardware. Signed-off-by: Yang Shen Signed-off-by: Herbert Xu commit 705b52fef3c73655701d9c8868e744f1fa03e942 Author: Herbert Xu Date: Thu Sep 14 16:28:28 2023 +0800 crypto: cbc - Convert from skcipher to lskcipher Replace the existing skcipher CBC template with an lskcipher version. Signed-off-by: Herbert Xu commit 32a8dc4afcfb098ef4e8b465c90db17d22d90107 Author: Herbert Xu Date: Thu Sep 14 16:28:27 2023 +0800 crypto: ecb - Convert from skcipher to lskcipher This patch adds two different implementations of ECB. First of all an lskcipher wrapper around existing ciphers is introduced as a temporary transition aid. Secondly a permanent lskcipher template is also added. It's simply a wrapper around the underlying lskcipher algorithm. Signed-off-by: Herbert Xu commit 3dfe8786b11a4a3f9ced2eb89c6c5d73eba84700 Author: Herbert Xu Date: Thu Sep 14 16:28:26 2023 +0800 crypto: testmgr - Add support for lskcipher algorithms Test lskcipher algorithms using the same logic as cipher algorithms. Signed-off-by: Herbert Xu commit 8aee5d4ebd113319f6882b2cd0475d270fdc0d41 Author: Herbert Xu Date: Thu Sep 14 16:28:25 2023 +0800 crypto: lskcipher - Add compatibility wrapper around ECB As an aid to the transition from cipher algorithm implementations to lskcipher, add a temporary wrapper when creating simple lskcipher templates by using ecb(X) instead of X if an lskcipher implementation of X cannot be found. This can be reverted once all cipher implementations have switched over to lskcipher. Signed-off-by: Herbert Xu commit 31865c4c4db2b742fec6ccbff80483fa3e7ab9b9 Author: Herbert Xu Date: Thu Sep 14 16:28:24 2023 +0800 crypto: skcipher - Add lskcipher Add a new API type lskcipher designed for taking straight kernel pointers instead of SG lists. Its relationship to skcipher will be analogous to that between shash and ahash. Signed-off-by: Herbert Xu commit b64d143b752932ef483d0ed8d00958f1832dd6bc Author: Herbert Xu Date: Thu Sep 14 16:28:23 2023 +0800 crypto: hash - Hide CRYPTO_ALG_TYPE_AHASH_MASK Move the macro CRYPTO_ALG_TYPE_AHASH_MASK out of linux/crypto.h and into crypto/ahash.c so that it's not visible to users of the Crypto API. Also remove the unused CRYPTO_ALG_TYPE_HASH_MASK macro. Signed-off-by: Herbert Xu commit a1383e2ab102c4e0d25304c07c66232c23ee0d9b Author: Herbert Xu Date: Thu Sep 14 16:28:22 2023 +0800 ipsec: Stop using crypto_has_alg Stop using the obsolete crypto_has_alg helper that is type-agnostic. Instead use the type-specific helpers such as the newly added crypto_has_aead. This means that changes in the underlying type/mask values won't affect IPsec. Signed-off-by: Herbert Xu commit 534562e59f354495c2644de6540d56713dde9e52 Author: Herbert Xu Date: Thu Sep 14 16:28:21 2023 +0800 crypto: aead - Add crypto_has_aead Add the helper crypto_has_aead. This is meant to replace the existing use of crypto_has_alg to locate AEAD algorithms. Signed-off-by: Herbert Xu commit 02968703e846b1b9c7934dc8d6a6dde55dc54001 Author: Bo Liu Date: Thu Sep 14 03:27:50 2023 -0400 crypto: aesni - Fix double word in comments Remove the repeated word "if" in comments. Signed-off-by: Bo Liu Signed-off-by: Herbert Xu commit 17f7b9835a8a2ad5a2d835bc7cce87209468a5c3 Author: Li zeming Date: Thu Sep 14 02:17:27 2023 +0800 crypto: api - Remove unnecessary NULL initialisation tfm is assigned first, so it does not need to initialize the assignment. Signed-off-by: Li zeming Signed-off-by: Herbert Xu commit 3102bbcdcd3c945ef0bcea498d3a0c6384536d6c Author: Justin Stitt Date: Wed Sep 13 00:51:05 2023 +0000 crypto: qat - refactor deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. `buf` is expected to be NUL-terminated for its eventual use in `kstrtoul()` and NUL-padding is not required. Due to the above, a suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Acked-by: Giovanni Cabiddu Reviewed-by: Kees Cook Signed-off-by: Herbert Xu commit 0da05a040d563d4dc5058449be37814bb5177024 Author: Justin Stitt Date: Wed Sep 13 00:32:31 2023 +0000 crypto: cavium/nitrox - refactor deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We know `hw.partname` is supposed to be NUL-terminated by its later use with seq_printf: | nitrox_debugfs.c +25 | seq_printf(s, " Part Name: %s\n", ndev->hw.partname); Let's prefer a more robust and less ambiguous string interface. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Signed-off-by: Herbert Xu commit 50fb6d5c58e4a2cefbd88f52f7197f589ae1bb7c Author: Martin Kaiser Date: Tue Sep 12 16:31:18 2023 +0200 hwrng: imx-rngc - reasonable timeout for initial seed Set a more reasonable timeout for calculating the initial seed. The reference manuals says that "The initial seed takes approximately 2,000,000 clock cycles." The rngc peripheral clock runs at >= 33.25MHz, so seeding takes at most 60ms. A timeout of 200ms is more appropriate than the current value of 3 seconds. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit b6c6044b4ba561e3ca2d8a2a815f3091ee7ff33c Author: Martin Kaiser Date: Tue Sep 12 16:31:17 2023 +0200 hwrng: imx-rngc - reasonable timeout for selftest Set a more reasonable timeout for the rngc selftest. According to the reference manual, "The self test takes approximately 29,000 cycles to complete." The lowest possible frequency of the rngc peripheral clock is 33.25MHz, the selftest would then take about 872us. 2.5ms should be enough for the selftest timeout. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit e49be27e18c59639be28cd0d766caf594fe2b77f Author: Xu Yang Date: Tue Sep 19 16:09:29 2023 +0800 perf jevents: fix no member named 'entries' issue The struct "pmu_events_table" has been changed after commit 2e255b4f9f41 (perf jevents: Group events by PMU, 2023-08-23). So there doesn't exist 'entries' in pmu_events_table anymore. This will align the members with that commit. Othewise, below errors will be printed when run jevent.py: pmu-events/pmu-events.c:5485:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’ 5485 | .entries = pmu_metrics__freescale_imx8dxl_sys, Signed-off-by: Xu Yang Reviewed-by: Ian Rogers Tested-by: Namhyung Kim Link: https://lore.kernel.org/r/20230919080929.3807123-1-xu.yang_2@nxp.com Signed-off-by: Namhyung Kim commit 815ea491460766dbd4b39a3c9904b44b5880c41c Author: Krzysztof Kozlowski Date: Tue Sep 5 18:31:03 2023 +0200 arm64: dts: qcom: sdx75-idp: align RPMh regulator nodes with bindings Device node names should be generic and bindings expect certain pattern for RPMh regulator nodes: sdx75-idp.dtb: rsc@17a00000: 'pmx75-rpmh-regulators' does not match any of the regexes: '^regulators(-[0-9])?$', 'pinctrl-[0-9]+' Fixes: 8a2dc39d1043 ("arm64: dts: qcom: sdx75-idp: Add regulator nodes") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905163103.257412-1-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit a46e3a82aeb0282f80d6b512f8670da4ed12b973 Author: Krzysztof Kozlowski Date: Tue Sep 5 18:19:20 2023 +0200 arm64: dts: qcom: sm4250-billie2: correct UFS pad supply The Qualcomm UFS phy switched from dedicated driver to QMP phy driver. Eventually the old driver was removed in commit 02dca8c981b5 ("phy: qcom: remove ufs qmp phy driver"). The original driver and its binding used vddp-ref-clk regulator supply, but the new one did not and left the supply unused. The Qualcomm UFS phy bindings were also migrated to newer ones and dropped support for vddp-ref-clk regulator in commit dc5cb63592bd ("dt-bindings: phy: migrate QMP UFS PHY bindings to qcom,sc8280xp-qmp-ufs-phy.yaml"). It turns out that this regulator, although with inaccurate name vddp-ref-clk, is actually needed to provide supply for VDD_PX10 (or similar, depending on the SoC) used by UFS controller. Bring back handling of this supply by using more appropriate regulator - UFS controller host supply. This also fixes dtbs_check warning: sm4250-oneplus-billie2.dtb: phy@4807000: 'vddp-ref-clk-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905161920.252013-13-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit c50e34f09a437623fc98b5545b7a097cc9ca53dc Author: Krzysztof Kozlowski Date: Tue Sep 5 18:19:19 2023 +0200 arm64: dts: qcom: msm8998-sagit: correct UFS pad supply The Qualcomm UFS phy switched from dedicated driver to QMP phy driver. Eventually the old driver was removed in commit 02dca8c981b5 ("phy: qcom: remove ufs qmp phy driver"). The original driver and its binding used vddp-ref-clk regulator supply, but the new one did not and left the supply unused. The Qualcomm UFS phy bindings were also migrated to newer ones and dropped support for vddp-ref-clk regulator in commit dc5cb63592bd ("dt-bindings: phy: migrate QMP UFS PHY bindings to qcom,sc8280xp-qmp-ufs-phy.yaml"). It turns out that this regulator, although with inaccurate name vddp-ref-clk, is actually needed to provide supply for VDD_PX10 (or similar, depending on the SoC) used by UFS controller. Bring back handling of this supply by using more appropriate regulator - UFS controller host supply. This also fixes dtbs_check warning: msm8998-xiaomi-sagit.dtb: phy@1da7000: 'vddp-ref-clk-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905161920.252013-12-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 39a123c50f12589949c8ec8b824bb61b94175cc0 Author: Krzysztof Kozlowski Date: Tue Sep 5 18:19:18 2023 +0200 arm64: dts: qcom: msm8998-oneplus: correct UFS pad supply The Qualcomm UFS phy switched from dedicated driver to QMP phy driver. Eventually the old driver was removed in commit 02dca8c981b5 ("phy: qcom: remove ufs qmp phy driver"). The original driver and its binding used vddp-ref-clk regulator supply, but the new one did not and left the supply unused. The Qualcomm UFS phy bindings were also migrated to newer ones and dropped support for vddp-ref-clk regulator in commit dc5cb63592bd ("dt-bindings: phy: migrate QMP UFS PHY bindings to qcom,sc8280xp-qmp-ufs-phy.yaml"). It turns out that this regulator, although with inaccurate name vddp-ref-clk, is actually needed to provide supply for VDD_PX10 (or similar, depending on the SoC) used by UFS controller. Bring back handling of this supply by using more appropriate regulator - UFS controller host supply. This also fixes dtbs_check warning: msm8998-oneplus-dumpling.dtb: phy@1da7000: 'vddp-ref-clk-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905161920.252013-11-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit e699305f858e1e18c90001065e156dd9d4646dcc Author: Krzysztof Kozlowski Date: Tue Sep 5 18:19:17 2023 +0200 arm64: dts: qcom: msm8998-mtp: correct UFS pad supply The Qualcomm UFS phy switched from dedicated driver to QMP phy driver. Eventually the old driver was removed in commit 02dca8c981b5 ("phy: qcom: remove ufs qmp phy driver"). The original driver and its binding used vddp-ref-clk regulator supply, but the new one did not and left the supply unused. The Qualcomm UFS phy bindings were also migrated to newer ones and dropped support for vddp-ref-clk regulator in commit dc5cb63592bd ("dt-bindings: phy: migrate QMP UFS PHY bindings to qcom,sc8280xp-qmp-ufs-phy.yaml"). It turns out that this regulator, although with inaccurate name vddp-ref-clk, is actually needed to provide supply for VDD_PX10 (or similar, depending on the SoC) used by UFS controller. Bring back handling of this supply by using more appropriate regulator - UFS controller host supply. This also fixes dtbs_check warning: msm8998-mtp.dtb: phy@1da7000: 'vddp-ref-clk-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905161920.252013-10-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 304e5c53649f79418cb0e2c5e738a4e1f61729b8 Author: Krzysztof Kozlowski Date: Tue Sep 5 18:19:16 2023 +0200 arm64: dts: qcom: msm8998-pro1: correct UFS pad supply The Qualcomm UFS phy switched from dedicated driver to QMP phy driver. Eventually the old driver was removed in commit 02dca8c981b5 ("phy: qcom: remove ufs qmp phy driver"). The original driver and its binding used vddp-ref-clk regulator supply, but the new one did not and left the supply unused. The Qualcomm UFS phy bindings were also migrated to newer ones and dropped support for vddp-ref-clk regulator in commit dc5cb63592bd ("dt-bindings: phy: migrate QMP UFS PHY bindings to qcom,sc8280xp-qmp-ufs-phy.yaml"). It turns out that this regulator, although with inaccurate name vddp-ref-clk, is actually needed to provide supply for VDD_PX10 (or similar, depending on the SoC) used by UFS controller. Bring back handling of this supply by using more appropriate regulator - UFS controller host supply. This also fixes dtbs_check warning: msm8998-fxtec-pro1.dtb: phy@1da7000: 'vddp-ref-clk-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905161920.252013-9-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 38f6ac152fa641dc4a92a9d5f563ed2794f45b12 Author: Krzysztof Kozlowski Date: Tue Sep 5 18:19:15 2023 +0200 arm64: dts: qcom: msm8996-gemini: correct UFS pad supply The Qualcomm UFS phy switched from dedicated driver to QMP phy driver. Eventually the old driver was removed in commit 02dca8c981b5 ("phy: qcom: remove ufs qmp phy driver"). The original driver and its binding used vddp-ref-clk regulator supply, but the new one did not and left the supply unused. The Qualcomm UFS phy bindings were also migrated to newer ones and dropped support for vddp-ref-clk regulator in commit dc5cb63592bd ("dt-bindings: phy: migrate QMP UFS PHY bindings to qcom,sc8280xp-qmp-ufs-phy.yaml"). It turns out that this regulator, although with inaccurate name vddp-ref-clk, is actually needed to provide supply for VDD_PX10 (or similar, depending on the SoC) used by UFS controller. Bring back handling of this supply by using more appropriate regulator - UFS controller host supply. This also fixes dtbs_check warning: msm8996-xiaomi-gemini.dtb: phy@627000: 'vddp-ref-clk-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905161920.252013-8-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit dfee6788a02c44bbe82a02c58db846ea6edfc630 Author: Krzysztof Kozlowski Date: Tue Sep 5 18:19:14 2023 +0200 arm64: dts: qcom: msm8996-oneplus: correct UFS pad supply The Qualcomm UFS phy switched from dedicated driver to QMP phy driver. Eventually the old driver was removed in commit 02dca8c981b5 ("phy: qcom: remove ufs qmp phy driver"). The original driver and its binding used vddp-ref-clk regulator supply, but the new one did not and left the supply unused. The Qualcomm UFS phy bindings were also migrated to newer ones and dropped support for vddp-ref-clk regulator in commit dc5cb63592bd ("dt-bindings: phy: migrate QMP UFS PHY bindings to qcom,sc8280xp-qmp-ufs-phy.yaml"). It turns out that this regulator, although with inaccurate name vddp-ref-clk, is actually needed to provide supply for VDD_PX10 (or similar, depending on the SoC) used by UFS controller. Bring back handling of this supply by using more appropriate regulator - UFS controller host supply. This also fixes dtbs_check warning: msm8996-oneplus3t.dtb: phy@627000: 'vddp-ref-clk-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905161920.252013-7-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 6dd6ba6cb3a75fd45e4a48502c184a9659728136 Author: Krzysztof Kozlowski Date: Tue Sep 5 18:19:13 2023 +0200 arm64: dts: qcom: apq8096-db820c: correct UFS pad supply The Qualcomm UFS phy switched from dedicated driver to QMP phy driver. Eventually the old driver was removed in commit 02dca8c981b5 ("phy: qcom: remove ufs qmp phy driver"). The original driver and its binding used vddp-ref-clk regulator supply, but the new one did not and left the supply unused. The Qualcomm UFS phy bindings were also migrated to newer ones and dropped support for vddp-ref-clk regulator in commit dc5cb63592bd ("dt-bindings: phy: migrate QMP UFS PHY bindings to qcom,sc8280xp-qmp-ufs-phy.yaml"). It turns out that this regulator, although with inaccurate name vddp-ref-clk, is actually needed to provide supply for VDD_PX10 (or similar, depending on the SoC) used by UFS controller. Bring back handling of this supply by using more appropriate regulator - UFS controller host supply. This also fixes dtbs_check warning: apq8096-db820c.dtb: phy@627000: 'vddp-ref-clk-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905161920.252013-6-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 131b820c8dedf9516b39f74d82a43c5a0a858583 Author: Krzysztof Kozlowski Date: Tue Sep 5 18:19:12 2023 +0200 arm64: dts: qcom: sm6115p-j606f: correct UFS pad supply The Qualcomm UFS phy switched from dedicated driver to QMP phy driver. Eventually the old driver was removed in commit 02dca8c981b5 ("phy: qcom: remove ufs qmp phy driver"). The original driver and its binding used vddp-ref-clk regulator supply, but the new one did not and left the supply unused. The Qualcomm UFS phy bindings were also migrated to newer ones and dropped support for vddp-ref-clk regulator in commit dc5cb63592bd ("dt-bindings: phy: migrate QMP UFS PHY bindings to qcom,sc8280xp-qmp-ufs-phy.yaml"). It turns out that this regulator, although with inaccurate name vddp-ref-clk, is actually needed to provide supply for VDD_PX10 (or similar, depending on the SoC) used by UFS controller. Bring back handling of this supply by using more appropriate regulator - UFS controller host supply. This also fixes dtbs_check warning: sm6115p-lenovo-j606f.dtb: phy@4807000: 'vddp-ref-clk-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905161920.252013-5-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 69a9275aeb9adeb223884c9754a8269fe33b0b88 Author: Krzysztof Kozlowski Date: Tue Sep 5 18:19:11 2023 +0200 arm64: dts: qcom: sm6115-pro1x: correct UFS pad supply The Qualcomm UFS phy switched from dedicated driver to QMP phy driver. Eventually the old driver was removed in commit 02dca8c981b5 ("phy: qcom: remove ufs qmp phy driver"). The original driver and its binding used vddp-ref-clk regulator supply, but the new one did not and left the supply unused. The Qualcomm UFS phy bindings were also migrated to newer ones and dropped support for vddp-ref-clk regulator in commit dc5cb63592bd ("dt-bindings: phy: migrate QMP UFS PHY bindings to qcom,sc8280xp-qmp-ufs-phy.yaml"). It turns out that this regulator, although with inaccurate name vddp-ref-clk, is actually needed to provide supply for VDD_PX10 (or similar, depending on the SoC) used by UFS controller. Bring back handling of this supply by using more appropriate regulator - UFS controller host supply. This also fixes dtbs_check warning: sm6115-fxtec-pro1x.dtb: phy@4807000: 'vddp-ref-clk-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905161920.252013-4-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 08231f1fe620465890554b107032be330d1c66c7 Author: Krzysztof Kozlowski Date: Tue Sep 5 18:19:10 2023 +0200 arm64: dts: qcom: sm6125-sprout: correct UFS pad supply The Qualcomm UFS phy switched from dedicated driver to QMP phy driver. Eventually the old driver was removed in commit 02dca8c981b5 ("phy: qcom: remove ufs qmp phy driver"). The original driver and its binding used vddp-ref-clk regulator supply, but the new one did not and left the supply unused. The Qualcomm UFS phy bindings were also migrated to newer ones and dropped support for vddp-ref-clk regulator in commit dc5cb63592bd ("dt-bindings: phy: migrate QMP UFS PHY bindings to qcom,sc8280xp-qmp-ufs-phy.yaml"). It turns out that this regulator, although with inaccurate name vddp-ref-clk, is actually needed to provide supply for VDD_PX10 (or similar, depending on the SoC) used by UFS controller. Bring back handling of this supply by using more appropriate regulator - UFS controller host supply. This also fixes dtbs_check warning: sm6125-xiaomi-laurel-sprout.dtb: phy@4807000: 'vddp-ref-clk-supply' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905161920.252013-3-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 11bdfe69fb40ca6afdf6bd82946b8197fd7f6c70 Author: Krzysztof Kozlowski Date: Tue Sep 5 18:19:09 2023 +0200 arm64: dts: qcom: sm6125-sprout: drop incorrect UFS phy max current Neither bindings nor UFS phy driver use properties like 'vdda-phy-max-microamp' and 'vdda-pll-max-microamp': sm6125-xiaomi-laurel-sprout.dtb: phy@4807000: 'vdda-phy-max-microamp', 'vdda-pll-max-microamp' do not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Krzysztof Kozlowski Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905161920.252013-2-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 72fc3d58b87b0d622039c6299b89024fbb7b420f Author: Vignesh Viswanathan Date: Tue Sep 5 15:25:34 2023 +0530 arm64: dts: qcom: ipq6018: Fix tcsr_mutex register size IPQ6018's TCSR Mutex HW lock register has 32 locks of size 4KB each. Total size of the TCSR Mutex registers is 128KB. Fix size of the tcsr_mutex hwlock register to 0x20000. Changes in v2: - Drop change to remove qcom,ipq6018-tcsr-mutex compatible string - Added Fixes and stable tags Cc: stable@vger.kernel.org Fixes: 5bf635621245 ("arm64: dts: ipq6018: Add a few device nodes") Signed-off-by: Vignesh Viswanathan Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230905095535.1263113-2-quic_viswanat@quicinc.com Signed-off-by: Bjorn Andersson commit 5fe8508e2bc8eb4208b0434b6c1ca306c1519ade Author: Vignesh Viswanathan Date: Mon Sep 4 22:55:15 2023 +0530 arm64: dts: qcom: ipq9574: Fix hwlock index for SMEM SMEM uses lock index 3 of the TCSR Mutex hwlock for allocations in SMEM region shared by the Host and FW. Fix the SMEM hwlock index to 3 for IPQ9574. Cc: stable@vger.kernel.org Fixes: 46384ac7a618 ("arm64: dts: qcom: ipq9574: Add SMEM support") Signed-off-by: Vignesh Viswanathan Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230904172516.479866-5-quic_viswanat@quicinc.com Signed-off-by: Bjorn Andersson commit 95d97b111e1e184b0c8656137033ed64f2cf21e4 Author: Vignesh Viswanathan Date: Mon Sep 4 22:55:13 2023 +0530 arm64: dts: qcom: ipq6018: Fix hwlock index for SMEM SMEM uses lock index 3 of the TCSR Mutex hwlock for allocations in SMEM region shared by the Host and FW. Fix the SMEM hwlock index to 3 for IPQ6018. Cc: stable@vger.kernel.org Fixes: 5bf635621245 ("arm64: dts: ipq6018: Add a few device nodes") Signed-off-by: Vignesh Viswanathan Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230904172516.479866-3-quic_viswanat@quicinc.com Signed-off-by: Bjorn Andersson commit d08afd80158399a081b478a19902364e3dd0f84c Author: Vignesh Viswanathan Date: Mon Sep 4 22:55:12 2023 +0530 arm64: dts: qcom: ipq5332: Fix hwlock index for SMEM SMEM uses lock index 3 of the TCSR Mutex hwlock for allocations in SMEM region shared by the Host and FW. Fix the SMEM hwlock index to 3 for IPQ5332. Cc: stable@vger.kernel.org Fixes: d56dd7f935e1 ("arm64: dts: qcom: ipq5332: add SMEM support") Signed-off-by: Vignesh Viswanathan Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230904172516.479866-2-quic_viswanat@quicinc.com Signed-off-by: Bjorn Andersson commit 8a781d04e580705d36f7db07f5c80e748100b69d Author: Vignesh Viswanathan Date: Mon Sep 4 22:55:14 2023 +0530 arm64: dts: qcom: ipq8074: Fix hwlock index for SMEM SMEM uses lock index 3 of the TCSR Mutex hwlock for allocations in SMEM region shared by the Host and FW. Fix the SMEM hwlock index to 3 for IPQ8074. Cc: stable@vger.kernel.org Fixes: 42124b947e8e ("arm64: dts: qcom: ipq8074: add SMEM support") Signed-off-by: Vignesh Viswanathan Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230904172516.479866-4-quic_viswanat@quicinc.com Signed-off-by: Bjorn Andersson commit 922c031eb2b4897cc01f4159f7325a2dcd8d6c7e Author: Markuss Broks Date: Mon Sep 4 12:35:03 2023 +0000 arm64: dts: qcom: msm8916-samsung-j5-common: Add accelerometer J5 and J5X have ST LIS2HH12 accelerometer. Add support for it. Signed-off-by: Markuss Broks Co-developed-by: Stephan Gerhold Signed-off-by: Stephan Gerhold Co-developed-by: Lin, Meng-Bo Signed-off-by: Lin, Meng-Bo Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230904123123.2593-1-linmengbo0689@protonmail.com Signed-off-by: Bjorn Andersson commit eb3da369ccd07c0e3d65cd9cd31ca44f9f709673 Author: Danila Tikhonov Date: Wed Sep 13 22:44:18 2023 +0300 dt-bindings: firmware: document Qualcomm SM7150 SCM Document the compatible for Qualcomm SM7150 SCM. Signed-off-by: Danila Tikhonov Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230913194418.30272-1-danila@jiaxyga.com Signed-off-by: Bjorn Andersson commit f7b7d30158cff246667273bd2a62fc93ee0725d2 Author: Devi Priya Date: Fri Sep 1 13:06:40 2023 +0530 clk: qcom: clk-rcg2: Fix clock rate overflow for high parent frequencies If the parent clock rate is greater than unsigned long max/2 then integer overflow happens when calculating the clock rate on 32-bit systems. As RCG2 uses half integer dividers, the clock rate is first being multiplied by 2 which will overflow the unsigned long max value. Hence, replace the common pattern of doing 64-bit multiplication and then a do_div() call with simpler mult_frac call. Fixes: bcd61c0f535a ("clk: qcom: Add support for root clock generators (RCGs)") Signed-off-by: Devi Priya Reviewed-by: Marijn Suijten Link: https://lore.kernel.org/r/20230901073640.4973-1-quic_devipriy@quicinc.com [bjorn: Also drop unnecessary {} around single statements] Signed-off-by: Bjorn Andersson commit e96c4d53d45e1ef0bcd40f2acfc30dfdea4b9131 Author: Neil Armstrong Date: Thu Aug 31 17:25:49 2023 +0200 arm64: dts: qcom: split pmr735d into 2 The second PMR735D PMIC is not always presend on SM8550 based devices, split the pmr735d.dtsi file in two so boards files can only include the ones present on the platform. Suggested-by: Konrad Dybcio Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20230831-topic-sm8550-upstream-pmr735d-split-v1-1-98e632636415@linaro.org Signed-off-by: Bjorn Andersson commit 4afda5f6bcdf673ef2556fcfa458daf3a5a648d8 Author: Konrad Dybcio Date: Thu Aug 31 11:39:14 2023 +0200 clk: qcom: gcc-msm8996: Remove RPM bus clocks The GCC driver contains clocks that are owned (meaning configured and scaled) by the RPM core. Remove them from Linux to stop interjecting the RPM's logic. Fixes: b1e010c0730a ("clk: qcom: Add MSM8996 Global Clock Control (GCC) driver") Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230830-topic-rpmbusclocks8996gcc-v1-1-9e99bedcdc3b@linaro.org Signed-off-by: Bjorn Andersson commit ccd8ab030643040600a663edde56b434b6f4fb6c Author: Varadarajan Narayanan Date: Thu Aug 31 14:58:53 2023 +0530 clk: qcom: ipq5332: Drop set rate parent from gpll0 dependent clocks IPQ5332's GPLL0's nominal/turbo frequency is 800MHz. This must not be scaled based on the requirement of dependent clocks. Hence remove the CLK_SET_RATE_PARENT flag. Fixes: 3d89d52970fd ("clk: qcom: add Global Clock controller (GCC) driver for IPQ5332 SoC") Signed-off-by: Varadarajan Narayanan Reviewed-by: Kathiravan T Link: https://lore.kernel.org/r/1693474133-10467-1-git-send-email-quic_varada@quicinc.com Signed-off-by: Bjorn Andersson commit b46d856cb9b3bd2fef54cc8caec8595a232a23b6 Author: Varadarajan Narayanan Date: Thu Aug 31 14:47:46 2023 +0530 arm64: defconfig: Enable M31 USB phy driver Enable M31 USB phy driver present in IPQ5332. Reviewed-by: Dmitry Baryshkov Signed-off-by: Varadarajan Narayanan Link: https://lore.kernel.org/r/7a5acabcaee60b6a00259bd88c06ffca06999f07.1693468292.git.quic_varada@quicinc.com Signed-off-by: Bjorn Andersson commit 2d81a19ada7867cce950e68001de8abb1cb173ed Author: Varadarajan Narayanan Date: Thu Aug 31 14:47:45 2023 +0530 arm64: dts: qcom: ipq5332: Enable USB Enable USB2 in host mode. Reviewed-by: Dmitry Baryshkov Signed-off-by: Varadarajan Narayanan Link: https://lore.kernel.org/r/d4c20505dd2103b5421eab7602aec4f83bd62dbe.1693468292.git.quic_varada@quicinc.com Signed-off-by: Bjorn Andersson commit bfb9614015f5c605ea5335f4128179af247a06e4 Author: Varadarajan Narayanan Date: Thu Aug 31 14:47:44 2023 +0530 arm64: dts: qcom: ipq5332: Add USB related nodes Add USB phy and controller nodes. Signed-off-by: Varadarajan Narayanan Link: https://lore.kernel.org/r/f25777bfe2c84e203b7615527607900b756c51bd.1693468292.git.quic_varada@quicinc.com Signed-off-by: Bjorn Andersson commit db1e57928766966cd542e59789125968ac29b9da Author: Komal Bajaj Date: Wed Aug 30 16:26:54 2023 +0530 soc: qcom: llcc: Add QDU1000 and QRU1000 LLCC support Add LLCC configuration data for QDU1000 and QRU1000 SoCs. Signed-off-by: Komal Bajaj Reviewed-by: Mukesh Ojha Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230830105654.28057-7-quic_kbajaj@quicinc.com Signed-off-by: Bjorn Andersson commit 0bc76be64e80b15b975345b6957a87a1893c34f2 Author: Komal Bajaj Date: Wed Aug 30 16:26:53 2023 +0530 soc: qcom: llcc: Updating the macro name Update macro name for LLCC_DRE to LLCC_ECC as per the latest specification. Signed-off-by: Komal Bajaj Reviewed-by: Mukesh Ojha Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230830105654.28057-6-quic_kbajaj@quicinc.com Signed-off-by: Bjorn Andersson commit a78502a4b2201235d93b04ac2902e01e32588bd5 Author: Komal Bajaj Date: Wed Aug 30 16:26:52 2023 +0530 soc: qcom: Add LLCC support for multi channel DDR Add LLCC support for multi channel DDR configuration based on a feature register. Signed-off-by: Komal Bajaj Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230830105654.28057-5-quic_kbajaj@quicinc.com Signed-off-by: Bjorn Andersson commit 54e1f99d91405417b3ddb6050cfba82733c3aa41 Author: Komal Bajaj Date: Wed Aug 30 16:26:51 2023 +0530 nvmem: core: Add stub for nvmem_cell_read_u8 Add the stub nvmem_cell_read_u8() function for drivers running with CONFIG_NVMEM disabled. Signed-off-by: Komal Bajaj Reviewed-by: Mukesh Ojha Link: https://lore.kernel.org/r/20230830105654.28057-4-quic_kbajaj@quicinc.com Signed-off-by: Bjorn Andersson commit 16fa93112f26a7a151f3d86a2a9223c564f6e3bf Author: Komal Bajaj Date: Wed Aug 30 16:26:50 2023 +0530 soc: qcom: llcc: Refactor llcc driver to support multiple configuration Refactor driver to support multiple configuration for llcc on a target. Signed-off-by: Komal Bajaj Fixes: ee13b5008707 ("qcom: llcc/edac: Fix the base address used for accessing LLCC banks") Reviewed-by: Mukesh Ojha Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230830105654.28057-3-quic_kbajaj@quicinc.com Signed-off-by: Bjorn Andersson commit 8e2506d0123149a7b7846fbabbf4295b6005faf4 Author: Komal Bajaj Date: Wed Aug 30 16:26:49 2023 +0530 dt-bindings: cache: qcom,llcc: Add LLCC compatible for QDU1000/QRU1000 Add LLCC compatible for QDU1000/QRU1000 SoCs and add optional nvmem-cells and nvmem-cell-names properties to support multiple configurations for multi channel DDR. Signed-off-by: Komal Bajaj Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230830105654.28057-2-quic_kbajaj@quicinc.com Signed-off-by: Bjorn Andersson commit 340ed74de508e5d79599b67553ee1e8e8239e0d1 Author: Krzysztof Kozlowski Date: Sun Aug 27 14:28:40 2023 +0200 ARM: dts: qcom: drop incorrect cell-index from SPMI The SPMI controller (PMIC Arbiter) does not use nor allow 'cell-index' property: qcom-sdx55-mtp.dtb: spmi@c440000: Unevaluated properties are not allowed ('cell-index' was unexpected) Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230827122842.63741-1-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit e34d0497f3c4d1e71063c38e1d8b1d182277f17a Author: Krzysztof Kozlowski Date: Sun Aug 27 14:28:42 2023 +0200 arm64: dts: qcom: sm7225-fp4: Revert "arm64: dts: qcom: sm7225-fairphone-fp4: Add AW8695 haptics" This reverts commit 413821b7777d062b57f8dc66ab088ed390cbc3ec because it was never reviewed, was buggy (report from kernel test robot: https://lore.kernel.org/all/202204090333.QZXMI2tu-lkp@intel.com/) and used undocumented, broken bindings. Half of the properties in this device are questioned, thus adding DTS node causes only errors and does not make the device usable without the bindings and driver part: sm7225-fairphone-fp4.dtb: haptics@5a: failed to match any schema with compatible: ['awinic,aw8695'] sm7225-fairphone-fp4.dtb: haptics@5a: awinic,tset: b'\x12' is not of type 'object', 'array', 'boolean', 'null' sm7225-fairphone-fp4.dtb: haptics@5a: awinic,r-spare: b'h' is not of type 'object', 'array', 'boolean', 'null' Since bindings were abandoned (4 months since review), revert the commit to avoid false sense of supporting something which is not supported. Cc: Luca Weiss Signed-off-by: Krzysztof Kozlowski Acked-by: Konrad Dybcio Acked-by: Luca Weiss Link: https://lore.kernel.org/r/20230827122842.63741-3-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 50888774b5dcf6cf9c1943ccdbc8f9694b9e0c50 Author: Krzysztof Kozlowski Date: Sun Aug 27 14:28:41 2023 +0200 arm64: dts: qcom: sc8180x: drop incorrect cell-index from SPMI The SPMI controller (PMIC Arbiter) does not use nor allow 'cell-index' property: sc8180x-primus.dtb: spmi@c440000: Unevaluated properties are not allowed ('cell-index' was unexpected) Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230827122842.63741-2-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 27da4fd325c371e1ddbb4fc46629e2caf8f73f07 Author: André Apitzsch Date: Sun Aug 27 10:48:00 2023 +0200 arm64: dts: qcom: msm8939-longcheer-l9100: Add initial device tree This dts adds support for BQ Aquaris M5 (Longcheer L9100) released in 2015. Add a device tree with initial support for: - GPIO keys - Hall sensor - SDHCI - WCNSS (BT/WIFI) - Accelerometer/Magnetometer - Vibrator - Touchscreen - Front flash Reviewed-by: Konrad Dybcio Signed-off-by: André Apitzsch Link: https://lore.kernel.org/r/20230827-bq_m5-v4-2-f8435fb8f955@apitzsch.eu Signed-off-by: Bjorn Andersson commit 9905205541d2020e45da5ffe9787b4a2e53cc199 Author: André Apitzsch Date: Sun Aug 27 10:47:59 2023 +0200 dt-bindings: arm: qcom: Add BQ Aquaris M5 Add a compatible for BQ Aquaris M5 (Longcheer L9100). Reviewed-by: Krzysztof Kozlowski Signed-off-by: André Apitzsch Link: https://lore.kernel.org/r/20230827-bq_m5-v4-1-f8435fb8f955@apitzsch.eu Signed-off-by: Bjorn Andersson commit da3620d7c7d78a375b21ccf046b6617598b7c824 Author: Dmitry Baryshkov Date: Sun Aug 27 01:19:15 2023 +0300 arm64: dts: qcom: sdm845-mtp: enable PCIe support Enable two PCIe hosts support on Qualcomm SDM845 MTP board. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230826221915.846937-6-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit be30dc31823d46dca3a184896433ebf8beffa1a0 Author: Dmitry Baryshkov Date: Sun Aug 27 01:19:14 2023 +0300 arm64: dts: qcom: sdm845-mtp: enable Vol-/reset button Wire up the Vol- / reset button on Qualcomm SDM845 MTP board. Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230826221915.846937-5-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 37857110db63783bac36960aa3bd335d4adea9d7 Author: Dmitry Baryshkov Date: Sun Aug 27 01:19:13 2023 +0300 arm64: dts: qcom: sdm845-mtp: switch to mbn firmware We have switched most of devices to use mbn (squashed) firmware files instead of spit mdt+bNN. Even this DT uses modem.mbn and a630_zap.mbn. Let's switch adsp and cdsp firmware files to use .mbn format too. Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230826221915.846937-4-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 84c7786499880d47fbcf0cee9661fd96e026ab2a Author: Dmitry Baryshkov Date: Sun Aug 27 01:19:12 2023 +0300 arm64: dts: qcom: sdm845-mtp: specify wifi variant Specify the variant for the WiFi BDF file, "Qualcomm_sdm845mtp" to ease distinguishing from other (possible) devices using the same board id. For the reference: ath10k_snoc 18800000.wifi: qmi chip_id 0x30214 chip_family 0x4001 board_id 0x3f soc_id 0x40030001 ath10k_snoc 18800000.wifi: qmi fw_version 0x2009856b fw_build_timestamp 2018-07-19 12:28 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HL.2.0-01387-QCAHLSWMTPLZ-1 ath10k_snoc 18800000.wifi: failed to fetch board data for bus=snoc,qmi-board-id=3f,qmi-chip-id=30214,variant=Qualcomm_sdm845mtp from ath10k/WCN3990/hw1.0/board-2.bin ath10k_snoc 18800000.wifi: wcn3990 hw1.0 target 0x00000008 chip_id 0x00000000 sub 0000:0000 ath10k_snoc 18800000.wifi: kconfig debug 1 debugfs 0 tracing 0 dfs 0 testmode 0 ath10k_snoc 18800000.wifi: firmware ver api 5 features wowlan,mgmt-tx-by-reference,non-bmi crc32 b3d4b790 ath10k_snoc 18800000.wifi: htt-ver 3.53 wmi-op 4 htt-op 3 cal file max-sta 32 raw 0 hwcrypto 1 ath10k_snoc 18800000.wifi: invalid MAC address; choosing random Cc: Kalle Valo Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230826221915.846937-3-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit b33868a52f342d9b1f20aa5bffe40cbd69bd0a4b Author: Dmitry Baryshkov Date: Sun Aug 27 01:19:11 2023 +0300 arm64: dts: qcom: sdm845-mtp: fix WiFi configuration Enable the host-cap-8bit quirk on this device. It is required for the WiFi to function properly. Fixes: 022bccb840b7 ("arm64: dts: sdm845: Add WCN3990 WLAN module device node") Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230826221915.846937-2-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 4e4c45f90ee313a4b475591a3109ff5314127f40 Author: Dmitry Baryshkov Date: Sat Aug 26 00:45:50 2023 +0300 arm64: dts: qcom: sm8350-hdk: add pmr735a regulators The SM8350 HDK uses pmr735a to supply some of the voltages (e.g. to WiFi/BT chip). Declare corresponding regulators together with voltage boundaries. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230825214550.1650938-3-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 2037fefcdea0252b45f9003659f8b0431054c417 Author: Dmitry Baryshkov Date: Sat Aug 26 00:45:49 2023 +0300 arm64: dts: qcom: sm8350-hdk: add missing PMICs Include configuration for several PMICs presend on the board. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230825214550.1650938-2-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit c1efa960114f743924b884da098298512a7e9983 Author: Dmitry Baryshkov Date: Sat Aug 26 00:45:48 2023 +0300 arm64: dts: qcom: sm8350: fix pinctrl for UART18 On sm8350 QUP18 uses GPIO 68/69, not 58/59. Fix correponding UART18 pinconf configuraion. Fixes: 98374e6925b8 ("arm64: dts: qcom: sm8350: Set up WRAP2 QUPs") Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230825214550.1650938-1-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit bb56cff4ac0347fe5adb57659ceab338da7f8559 Author: Dmitry Baryshkov Date: Sun Aug 20 17:20:35 2023 +0300 ARM: dts: qcom-sdx55: switch PCIe QMP PHY to new style of bindings Change the PCIe QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230820142035.89903-19-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 714a1cf29d7015f87df28333d8f702e8398aa176 Author: Konrad Dybcio Date: Thu Aug 24 11:58:54 2023 +0200 arm64: dts: qcom: sdm845-tama: Add camera GPIO regulators Like on many other platforms, Tama devices utilize lots of GPIO- enabled regulators for the camera sensors. Define them in the DT. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230824-topic-tama_gpio-v1-3-014e9d198dce@linaro.org Signed-off-by: Bjorn Andersson commit cb1e322cb3f126f19859627a6aeae928caf1f26a Author: Konrad Dybcio Date: Thu Aug 24 11:58:53 2023 +0200 arm64: dts: qcom: sdm845-tama: Add GPIO line names for PMIC GPIOs Sony ever so graciously provides GPIO line names in their downstream kernel (though sometimes they are not 100% accurate and you can judge that by simply looking at them and with what drivers they are used). Add these to the Akari, Apollo & Akatsuki DTS-es to better document the hardware. pm8005 and pm8998 config is common for all three boards. Apollo has VIB_LDO_EN (replacing NC) on PMI8998_GPIO_5 Akari and Akatsuki have WLC_EN_N (replacing NC) on PMI8998_GPIO_8 Akari additionally has RSVD(WLC_EN_N) (replacing) on PMI8998_GPIO_11 which sounds a bit like a forgot-to-update-documentation, but maybe it differs between SKUs.. Time will tell, when we get to enabling the wireless charger. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230824-topic-tama_gpio-v1-2-014e9d198dce@linaro.org Signed-off-by: Bjorn Andersson commit ed92c9c8964c713bbdd610cf616cd10a5b4b9045 Author: Konrad Dybcio Date: Thu Aug 24 11:58:52 2023 +0200 arm64: dts: qcom: sdm845-tama: Add GPIO line names for TLMM Sony ever so graciously provides GPIO line names in their downstream kernel (though sometimes they are not 100% accurate and you can judge that by simply looking at them and with what drivers they are used). Add these to the Akari, Apollo & Akatsuki DTS-es to better document the hardware. Apollo can be considered the 'base configuration'. Akari brings WLC_INT_N on GPIO_31 over that. Akatsuki & Akari diff: < "NC", > "SAMD_RSTEN_N", < "NC", > "MASTER_RST_N", < "NC", > "DISP_ERR_FG", < "NC", > "SAMD_BOOTL_PIN", < "NC", < "NC", < "NC", /* GPIO_60 */ > "SDM_SWD_CLK", > "SDM_SWD_DAT", > "SAMD_RST", /* GPIO_60 */ < "NC", > "MODE_SEL2", < "NC", > "NFC_ESE_PWR_REQ", < "NC", > "TS_VDDIO_EN", Which makes sense, as Akari and Akatsuki have a wireless charger and Akatsuki also additionally has a super-high-end-complex-for-the-time Samsung OLED display, as opposed to LCDs on the other Tama devices. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230824-topic-tama_gpio-v1-1-014e9d198dce@linaro.org Signed-off-by: Bjorn Andersson commit 7d65d4b7d70fb9560ce9baaf4219fb24646bd578 Author: David Wronek Date: Thu Aug 24 11:15:07 2023 +0200 arm64: dts: qcom: Add support for the Xiaomi SM7125 platform There are 6 Xiaomi smartphones with the SM7125 SoC: - POCO M2 Pro (gram) - Redmi Note 9S (curtana) - Redmi Note 9 Pro (Global, joyeuse) - Redmi Note 9 Pro (India, curtana) - Redmi Note 9 Pro Max (excalibur) - Redmi Note 10 Lite (curtana) These devices share a common board design (a.k.a miatoll) with only a few differences. Add support for the common board, as well as support for the global Redmi Note 9 Pro. Signed-off-by: David Wronek Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230824091737.75813-5-davidwronek@gmail.com Signed-off-by: Bjorn Andersson commit 72fbf05149bd451e7222c2ed1e3823972f19df9c Author: David Wronek Date: Thu Aug 24 11:15:06 2023 +0200 arm64: dts: qcom: Add SM7125 device tree The Snapdragon 720G (sm7125) is software-wise very similar to the Snapdragon 7c with minor differences in clock speeds and as added here, it uses the Kryo 465 instead of Kryo 468. Signed-off-by: David Wronek Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230824091737.75813-4-davidwronek@gmail.com Signed-off-by: Bjorn Andersson commit ec053ec90c245a4efc8dda87d9207de0adf0040e Author: David Wronek Date: Thu Aug 24 11:15:05 2023 +0200 arm64: dts: qcom: pm6150: Add resin and rtc nodes Add support for the RTC which is the same as on other PMICs and add the resin child node to the PM6150 PON device, both disabled by default. Signed-off-by: David Wronek Tested-by: Nikita Travkin Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230824091737.75813-3-davidwronek@gmail.com Signed-off-by: Bjorn Andersson commit 9b4adf37fdc0ca8cd1d14b4160e2f04b63df98e6 Author: David Wronek Date: Thu Aug 24 11:15:04 2023 +0200 dt-bindings: arm: qcom: Document SM7125 and xiaomi,joyeuse board Document the xiaomi,joyeuse board based on the Qualcomm SM7125 SoC. Reviewed-by: Krzysztof Kozlowski Signed-off-by: David Wronek Link: https://lore.kernel.org/r/20230824091737.75813-2-davidwronek@gmail.com Signed-off-by: Bjorn Andersson commit b8d34535a04c11b92a687c31a352c123ba21e22b Author: Sheng-Liang Pan Date: Wed Aug 23 15:13:06 2023 +0800 arm64: dts: qcom: sc7180: Add sku_id and board id for lazor/limozeen SKU ID 10: Lazor LTE+Wifi, no-esim (Strapped 0 X 0) SKU ID 15: Limozeen LTE+Wifi, TS, no esim (Strapped 1 X 0) SKU ID 18: Limozeen LTE+Wifi, no TS, no esim (Strapped X 0 0) Even though the "no esim" boards are strapped differently than ones that have an esim, the esim isn't represented in the device tree so the same device tree can be used for LTE w/ esim and LTE w/out esim. add BRD_ID(0, Z, 0) = 10 for new board with ALC5682i-VS Signed-off-by: Sheng-Liang Pan Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20230823151005.v6.2.I8f20fdfe34a2e8a38373bbd65587754b324f3dcb@changeid Signed-off-by: Bjorn Andersson commit 5aca91ec55393b8829978b12062d658de0491f78 Author: Sheng-Liang Pan Date: Wed Aug 23 15:13:05 2023 +0800 dt-bindings: arm: qcom: add sc7180-lazor board bindings Introduce more sc7180-lazor sku and board version configuration, add no-eSIM SKU 10 for Lazor, no-eSIM SKU 15 and 18 for Limozeen, add new board version 10 for audio codec ALC5682i-VS. Signed-off-by: Sheng-Liang Pan Reviewed-by: Douglas Anderson Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230823151005.v6.1.I26e017b00a341e7a5a2e94a83596923713408817@changeid Signed-off-by: Bjorn Andersson commit a912733ccb57c43878427d95af88e2ffa3c37b52 Author: Dmitry Baryshkov Date: Sun Aug 20 17:20:34 2023 +0300 arm64: dts: qcom: sm8450: switch PCIe QMP PHY to new style of bindings Change the PCIe QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). As a part of this conversion also change the "refgen" name to more correct "rchng". Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230820142035.89903-18-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit f96babe4b0e1e9260b43cd95562b78aa4b9bbed9 Author: Dmitry Baryshkov Date: Sun Aug 20 17:20:33 2023 +0300 arm64: dts: qcom: sm8250: switch PCIe QMP PHY to new style of bindings Change the PCIe QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230820142035.89903-17-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit aeda057881256d04ead5ec052d7d909408a9a7b1 Author: Dmitry Baryshkov Date: Sun Aug 20 17:20:32 2023 +0300 arm64: dts: qcom: sm8150: switch PCIe QMP PHY to new style of bindings Change the PCIe QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). As a part of this conversion also add the missing "ref" clock to the PCIe PHY devices. Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230820142035.89903-16-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit c204b3709409279ac019f3d374e444bb0b1424f0 Author: Dmitry Baryshkov Date: Sun Aug 20 17:20:31 2023 +0300 arm64: dts: qcom: sm8150: add ref clock to PCIe PHYs Follow the rest of the platforms and add "ref" clocks to both PCIe PHYs found on the Qualcomm SM8150 platform. Fixes: a1c86c680533 ("arm64: dts: qcom: sm8150: Add PCIe nodes") Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230820142035.89903-15-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit c588c9691f19aa5c650bf70b8fd58905c6b5954f Author: Dmitry Baryshkov Date: Sun Aug 20 17:20:30 2023 +0300 arm64: dts: qcom: sdm845: switch PCIe QMP PHY to new style of bindings Change the PCIe QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230820142035.89903-14-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit a6546460ca439bade19d64eb63cee2d97c29fb72 Author: Dmitry Baryshkov Date: Sun Aug 20 17:20:29 2023 +0300 arm64: dts: qcom: sc8180x: switch PCIe QMP PHY to new style of bindings Change the PCIe QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). While we are at it, rename PHY nodes to `phy@`. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230820142035.89903-13-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 4a8fbb7c176a971a14213cef4a11a27373ffda91 Author: Dmitry Baryshkov Date: Sun Aug 20 17:20:28 2023 +0300 arm64: dts: qcom: sc7280: switch PCIe QMP PHY to new style of bindings Change the PCIe QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230820142035.89903-12-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 8b4a3d4274cbe60e98350ac64fcb2548831503b1 Author: Dmitry Baryshkov Date: Sun Aug 20 17:20:27 2023 +0300 arm64: dts: qcom: msm8998: switch PCIe QMP PHY to new style of bindings Change the PCIe QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230820142035.89903-11-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 9e5e778f3340a687dd91c533064f963d352921c6 Author: Dmitry Baryshkov Date: Sun Aug 20 17:20:26 2023 +0300 arm64: dts: qcom: ipq8074: switch PCIe QMP PHY to new style of bindings Change the PCIe QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230820142035.89903-10-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 2187cc23e89043a2b53495ce34628fc6e2f1e56a Author: Dmitry Baryshkov Date: Sun Aug 20 17:20:25 2023 +0300 arm64: dts: qcom: ipq6018: switch PCIe QMP PHY to new style of bindings Change the PCIe QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230820142035.89903-9-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 39c8af78cbefb8c71a5ad1fa088e761ef418f0a0 Author: Krzysztof Kozlowski Date: Sun Aug 20 09:56:26 2023 +0200 arm64: dts: qcom: sc7280: drop incorrect EUD port on SoC side Qualcomm Embedded USB Debugger (EUD) second port should point to Type-C USB connector. Such connector was defined directly in root node of sc7280.dtsi which is clearly wrong. SC7280 is a chip, so physically it does not have USB Type-C port. The connector is usually accessible through some USB switch or controller. Doug Anderson said that he wasn't ever able to use EUD on Herobrine boards, probably because of invalid or missing DTS description - DTS is saying EUD is on usb_2 node, which is connected to a USB Hub, not to the Type-C port. Correct the EUD/USB connector topology by removing the top-level fake USB connector and EUD port pointing to it, and disabling the incomplete EUD device node. This fixes also dtbs_check warnings: sc7280-herobrine-crd.dtb: connector: ports:port@0: 'reg' is a required property Link: https://lore.kernel.org/all/CAD=FV=Xt26=rBf99mzkAuwwtb2f-jnKtnHaEhXnthz0a5zke4Q@mail.gmail.com/ Fixes: 9ee402ccfeb1 ("arm64: dts: qcom: sc7280: Fix EUD dt node syntax") Cc: Souradeep Chowdhury Cc: Bhupesh Sharma Signed-off-by: Krzysztof Kozlowski Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20230820075626.22600-1-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit ad75cda991f7b335d3b2417f82db07680f92648a Author: Konrad Dybcio Date: Fri Aug 18 13:19:09 2023 +0200 arm64: dts: qcom: sdm670: Fix pdc mapping As pointed out by Richard, I missed a non-continuity in one of the ranges. Fix it. Reported-by: Richard Acayan Fixes: b51ee205dc4f ("arm64: dts: qcom: sdm670: Add PDC") Signed-off-by: Konrad Dybcio Acked-by: Richard Acayan Link: https://lore.kernel.org/r/20230818-topic-670_pdc_fix-v1-1-1ba025041de7@linaro.org Signed-off-by: Bjorn Andersson commit 018c949b32df9f17f52bf0e70f976719811db233 Author: Luca Weiss Date: Fri Aug 18 10:06:09 2023 +0200 arm64: dts: qcom: Use QCOM_SCM_VMID defines for qcom,vmid Since we have those defines available in a header, let's use them everywhere where qcom,vmid property is used. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230818-qcom-vmid-defines-v1-1-45b610c96b13@fairphone.com Signed-off-by: Bjorn Andersson commit 454557d0032d088b4f467f0c541f98edb01fe431 Author: Andrew Halaney Date: Thu Aug 17 16:37:17 2023 -0500 arm64: dts: qcom: sa8775p-ride: Describe sgmii_phy1 irq There's an irq hooked up, so let's describe it. Prior to commit 9757300d2750 ("pinctrl: qcom: Add intr_target_width field to support increased number of interrupt targets") one would not see the IRQ fire, despite some (invasive) debugging showing that the GPIO was in fact asserted, resulting in the interface staying down. Now that the IRQ is properly routed we can describe it. Signed-off-by: Andrew Halaney Reviewed-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230817213815.638189-3-ahalaney@redhat.com Signed-off-by: Bjorn Andersson commit 1ff6569b0ffe7a2e311104cb3cd841983e484ac9 Author: Andrew Halaney Date: Thu Aug 17 16:37:16 2023 -0500 arm64: dts: qcom: sa8775p-ride: Describe sgmii_phy0 irq There's an irq hooked up, so let's describe it. Prior to commit 9757300d2750 ("pinctrl: qcom: Add intr_target_width field to support increased number of interrupt targets") one would not see the IRQ fire, despite some (invasive) debugging showing that the GPIO was in fact asserted, resulting in the interface staying down. Now that the IRQ is properly routed we can describe it. Signed-off-by: Andrew Halaney Reviewed-by: Bartosz Golaszewski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230817213815.638189-2-ahalaney@redhat.com Signed-off-by: Bjorn Andersson commit b3dea914127e9065df003002ed13a2ef40d19877 Author: Dmitry Baryshkov Date: Thu Aug 17 17:59:40 2023 +0300 arm64: dts: qcom: qrb5165-rb5: enable DP altmode Add displayport altmode declaration to the Type-C controller node to enable DP altmode negotiation. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230817145940.9887-5-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 96387ee7534dc449be35a9bb98b7668da2bed545 Author: Dmitry Baryshkov Date: Thu Aug 17 17:59:39 2023 +0300 arm64: dts: qcom: qrb5165-rb5: enable displayport controller Enable the onboard displayport controller, connect it to QMP PHY. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230817145940.9887-4-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit d342e1c993bd7589cad9d2da099c6a9c652ecb9f Author: Dmitry Baryshkov Date: Thu Aug 17 17:59:38 2023 +0300 arm64: dts: qcom: qrb5165-rb5: add onboard USB-C redriver Add the nb7vpq904m, onboard USB-C redriver / retimer. Signed-off-by: Dmitry Baryshkov Reviewed-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230817145940.9887-3-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 956aa24b16350a50d3a6beb9237bc35aa2f447d6 Author: Dmitry Baryshkov Date: Thu Aug 17 17:59:37 2023 +0300 arm64: dts: qcom: sm8250: Add DisplayPort device node Declare the displayport controller present on the Qualcomm SM8250 SoC. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230817145940.9887-2-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 45219a6b9497cb7713dd2bc221248ee1a7e9bb3d Author: Bryan O'Donoghue Date: Wed Aug 16 12:51:51 2023 +0100 arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy Switch on USB orientation-switching for usb_1_qmp via TCPM. Detecting the orientation switch is required to get the PHY to reset and bring-up the PHY with the CC lines set to the appropriate lane. Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230816115151.501736-8-bryan.odonoghue@linaro.org Signed-off-by: Bjorn Andersson commit 25defdca4d902b338c05bc01a1de1064a6d3b7f3 Author: Bryan O'Donoghue Date: Wed Aug 16 12:51:50 2023 +0100 arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for usb_1 Switch on usb-role-switching for usb_1 via TCPM. We need to declare usb-role-switch in &usb_1 and associate with the remote-endpoint in TCPM which provides the necessary signal. Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230816115151.501736-7-bryan.odonoghue@linaro.org Signed-off-by: Bjorn Andersson commit 5b1b6da9d39d515395d85dc678ddac7ff1689438 Author: Bryan O'Donoghue Date: Wed Aug 16 12:51:49 2023 +0100 arm64: dts: qcom: qrb5165-rb5: Switch on basic TCPM Switch on TCPM for the RB5. Here we declare as a source only not a sink since qrb5165 doesn't support powering exclusively from the type-c port. Reviewed-by: Konrad Dybcio Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230816115151.501736-6-bryan.odonoghue@linaro.org Signed-off-by: Bjorn Andersson commit c627d7337aae4d83b4db621fdb9e8f638056dcee Author: Bryan O'Donoghue Date: Wed Aug 16 12:51:48 2023 +0100 arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost Switch on VBUS for the Type-C port. We need to support a higher amperage than the bootloader set 2 Amps. Reviewed-by: Konrad Dybcio Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230816115151.501736-5-bryan.odonoghue@linaro.org Signed-off-by: Bjorn Andersson commit 5a0539515cbfad30b3e08a00004ed0c86136add5 Author: Bryan O'Donoghue Date: Wed Aug 16 12:51:47 2023 +0100 arm64: dts: qcom: pm8150b: Add a TCPM description Type-C port management functionality lives inside of the PMIC block on pm8150b. The Type-C port management logic controls orientation detection, vbus/vconn sense and to send/receive Type-C Power Domain messages. Signed-off-by: Bryan O'Donoghue Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230816115151.501736-4-bryan.odonoghue@linaro.org Signed-off-by: Bjorn Andersson commit ea96b90a58cf5d2e91ac177f081118ff26b85c1d Author: Bryan O'Donoghue Date: Wed Aug 16 12:51:46 2023 +0100 arm64: dts: qcom: sm8250: Define ports for qmpphy orientation-switching ports for orientation switching input and output. The individual board dts files will instantiate port@0, port@1 and/or port@2 depending on the supported feature-set. Reviewed-by: Konrad Dybcio Signed-off-by: Bryan O'Donoghue Link: https://lore.kernel.org/r/20230816115151.501736-3-bryan.odonoghue@linaro.org Signed-off-by: Bjorn Andersson commit 214945cbf375cc27d684f4cd2abb569e8c888688 Author: Douglas Anderson Date: Wed Aug 16 11:21:54 2023 -0700 arm64: dts: qcom: sc7180: Reorganize trogdor rt5682 audio codec dts It was asserted that the "/delete-property/ VBAT-supply;" that we needed to do in the rt5682s dts fragment was ugly. Let's change up all the trogdor device trees to make it explicit which version of "rt5682" we have and avoid the need for the "delete-property". As a side effect, this nicely gets rid of the need for a delete-node in coachz, which doesn't use "rt5682" at all. A few notes: - This doesn't get rid of every "/delete-node/" in trogdor, just the one that was used for rt5682s. - Though we no longer have any "/delete-node/", we do still override the "model" in the "sound" node in one case (in pompom) since that uses the "2mic" sound setup. This is validated to produce the same result (other than a few properties being reordered) when taking the dtbs generated by the kernel build and then doing: for dtb in *trogdor*.dtb; do dtc -I dtb -O dts $dtb -o out/$dtb.dts; done Suggested-by: Krzysztof Kozlowski Signed-off-by: Douglas Anderson Reviewed-by: Sheng-Liang Pan Link: https://lore.kernel.org/r/20230816112143.2.I29a5a330b6994afca81871f74bbacaf55b155937@changeid Signed-off-by: Bjorn Andersson commit 8ff1aaba032dd00e71aadeafa0ef2f79d3693c99 Author: Douglas Anderson Date: Wed Aug 16 11:21:53 2023 -0700 arm64: dts: qcom: sc7180: Move trogdor rt5682s bits to a fragment Several trogdor boards have moved from the older rt5862i to the newer rt5862s, at least on newer revisions of boards. Let's get rid of the dts duplication across boards and promote this to a fragment. Note: The old boards used to override the "compatible" in the "sound" node with the exact same thing that was in "sc7180-trogdor.dtsi" ("google,sc7180-trogdor"). I got rid of that. This is validated to produce the same result when taking the dtbs generated by the kernel build and then doing: for dtb in *trogdor*.dtb; do dtc -I dtb -O dts $dtb -o out/$dtb.dts; done Signed-off-by: Douglas Anderson Acked-by: Konrad Dybcio Reviewed-by: Sheng-Liang Pan Link: https://lore.kernel.org/r/20230816112143.1.I7227efd47e0dc42b6ff243bd22aa1a3e01923220@changeid Signed-off-by: Bjorn Andersson commit 9cbaee8379e620f82112002f973adde19679df31 Author: Robert Marko Date: Wed Aug 16 18:14:00 2023 +0200 arm64: dts: qcom: ipq5018: add watchdog Add the required DT node for watchdog operation. Signed-off-by: Robert Marko Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230816161455.3310629-2-robimarko@gmail.com Signed-off-by: Bjorn Andersson commit b9a2ee03019609f580ac5cae8211371119025909 Author: Krzysztof Kozlowski Date: Wed Aug 16 08:05:02 2023 +0200 arm64: dts: qcom: sc7280-crd: add Bluetooth VDDIO supply Bluetooth requires VDDIO supply and Doug Anderson suggested it is vreg_l18b_1p8. Add one to satisfy `dtbs_check`: sc7280-crd-r3.dtb: bluetooth: 'vddio-supply' is a required property Signed-off-by: Krzysztof Kozlowski Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20230816060502.16789-1-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 59f9ff79cd9cf3bc10743d61662b5729fcffff24 Author: Konrad Dybcio Date: Wed Sep 6 11:24:59 2023 +0200 arm64: dts: qcom: qrb2210-rb1: Hook up USB3 Configure the USB3 PHY to enable USB3 functionality Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230906-topic-rb1_features_sans_icc-v1-5-e92ce6fbde16@linaro.org Signed-off-by: Bjorn Andersson commit 02a2fcfbb835bac0c523b3f89326bc1c69f83ce0 Author: Konrad Dybcio Date: Wed Sep 6 11:24:58 2023 +0200 arm64: dts: qcom: qrb2210-rb1: Add GPIO LEDs Add the three LEDs (blue/yellow/green) connected to TLMM GPIOs. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230906-topic-rb1_features_sans_icc-v1-4-e92ce6fbde16@linaro.org Signed-off-by: Bjorn Andersson commit 9692ccc49583cd43184ea192af127635877e0f24 Author: Konrad Dybcio Date: Wed Sep 6 11:24:57 2023 +0200 arm64: dts: qcom: qrb2210-rb1: Enable remote processors Enable the ADSP, MPSS and Wi-Fi. Tighten up the Wi-Fi regulators to make them compliant with that the chip expects. The Wi-Fi reports: qmi chip_id 0x120 chip_family 0x4007 board_id 0xff soc_id 0x40670000 Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230906-topic-rb1_features_sans_icc-v1-3-e92ce6fbde16@linaro.org Signed-off-by: Bjorn Andersson commit 31bee70793b67f4b428825434542afc72ddb2b3b Author: Konrad Dybcio Date: Wed Sep 6 11:24:56 2023 +0200 arm64: dts: qcom: qrb2210-rb1: Fix regulators Commit b4fe47d12f1f ("arm64: dts: qcom: qrb2210-rb1: Add regulators") introduced regulator settings that were never put in place, as all of the properties ended 'microvolts' instead of 'microvolt' (which dt schema did not check for back then). Fix the microvolts-microvolt typo and adjust voltage ranges where it's necessary to fit within the volt = base + n*step formula. Reported-by: Vladimir Zapolskiy Reported-by: Dmitry Baryshkov Fixes: b4fe47d12f1f ("arm64: dts: qcom: qrb2210-rb1: Add regulators") Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230906-topic-rb1_features_sans_icc-v1-2-e92ce6fbde16@linaro.org Signed-off-by: Bjorn Andersson commit 973c015facabcbd320063648010942c51992c1a1 Author: Konrad Dybcio Date: Wed Sep 6 11:24:55 2023 +0200 arm64: dts: qcom: qrb2210-rb1: Swap UART index Newer RB1 board revisions have a debug UART on QUP0. Sadly, it looks like even when ordering one in retail, customers receive prototype boards with "Enginering Sample" written on them. Use QUP4 for UART to make all known RB1 boards boot. Fixes: e18771961336 ("arm64: dts: qcom: Add initial QTI RB1 device tree") Signed-off-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Reported-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230906-topic-rb1_features_sans_icc-v1-1-e92ce6fbde16@linaro.org Signed-off-by: Bjorn Andersson commit 3f93d119c9d6e1744d55cd48af764160a1a3aca3 Author: Konrad Dybcio Date: Fri Aug 11 22:58:22 2023 +0200 arm64: dts: qcom: sc7280: Add missing LMH interrupts Hook up the interrupts that signal the Limits Management Hardware has started some sort of throttling action. Fixes: 7dbd121a2c58 ("arm64: dts: qcom: sc7280: Add cpufreq hw node") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230811-topic-7280_lmhirq-v1-1-c262b6a25c8f@linaro.org Signed-off-by: Bjorn Andersson commit 073bde453635e4cffb58c9d6bd071c2419dfe8f0 Author: Ben Skeggs Date: Tue Sep 19 17:56:39 2023 -0400 drm/nouveau/kms/nv50-: disable dcb parsing - nvkm should provide all this info now - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-45-lyude@redhat.com commit 0a4410a79fe6b28be42cf936ad1650b6f1186694 Author: Ben Skeggs Date: Tue Sep 19 17:56:38 2023 -0400 drm/nouveau/kms/nv50-: create outputs based on nvkm info - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-44-lyude@redhat.com commit 8b7d92cad9532b8227daf64e13739d22eb910c15 Author: Ben Skeggs Date: Tue Sep 19 17:56:37 2023 -0400 drm/nouveau/kms/nv50-: create connectors based on nvkm info - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-43-lyude@redhat.com commit 9c3361de064153e0e7c72eccc4d2d604d412ac6f Author: Ben Skeggs Date: Tue Sep 19 17:56:36 2023 -0400 drm/nouveau/kms/nv50-: name aux channels after their connector - removes use of VBIOS data for naming - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-42-lyude@redhat.com commit 0880bf4c439da7a9bc1ad1418ebe6a0b2fda4913 Author: Ben Skeggs Date: Tue Sep 19 17:56:35 2023 -0400 drm/nouveau/kms/nv50-: create heads after outps/conns - output info will be used later to determine MST support Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-41-lyude@redhat.com commit 571028c46f3b9cf75bcdb66e364f58ec33c0024a Author: Ben Skeggs Date: Tue Sep 19 17:56:34 2023 -0400 drm/nouveau/kms/nv50-: create heads based on nvkm head mask No need to go poking HW directly, and probably shouldn't on GSP-RM. Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-40-lyude@redhat.com commit 56d732839ea0ec327848df021ae4185c413e3916 Author: Ben Skeggs Date: Tue Sep 19 17:56:33 2023 -0400 drm/nouveau/disp/nv50-: skip DCB_OUTPUT_TV We've never supported it. Signed-off-by: Ben Skeggs Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-39-lyude@redhat.com commit cb3ec8cbd00edb3a32d114da4874cda090766c76 Author: Ben Skeggs Date: Tue Sep 19 17:56:32 2023 -0400 drm/nouveau/disp: move outp init/fini paths to chipset code - pre-nv5x doesn't use any of this - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-38-lyude@redhat.com commit 62b0eef237a39446b8c71fd7271ade858acff1a7 Author: Ben Skeggs Date: Tue Sep 19 17:56:31 2023 -0400 drm/nouveau/disp: move outp/conn construction to chipset code - pre-nv5x doesn't use any of this, has its own version DRM-side - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-37-lyude@redhat.com commit 1958d69fa8e7448a44f12dcb3e5ecd9b78f25121 Author: Ben Skeggs Date: Tue Sep 19 17:56:30 2023 -0400 drm/nouveau/disp: add dp mst id get/put methods - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-36-lyude@redhat.com commit e206cae1e534b7f9944de6d55fd39e9d6b5cf548 Author: Ben Skeggs Date: Tue Sep 19 17:56:29 2023 -0400 drm/nouveau/disp: add dp sst config method This is presently unused on HW, we read a bunch of regs and calculate the watermark during the second supervisor interrupt. I don't want to change this yet as I need to re-remember how older HW works exactly, but RM wants this info via RPC. Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-35-lyude@redhat.com commit 3147ce0d07aaacac4a67a30767a7480596de16e2 Author: Ben Skeggs Date: Tue Sep 19 17:56:28 2023 -0400 drm/nouveau/disp: move link training out of supervisor - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-34-lyude@redhat.com commit 633716501c94cc45e504a1f14fcef717f1ac5e9b Author: Ben Skeggs Date: Tue Sep 19 17:56:27 2023 -0400 drm/nouveau/disp: add dp train method - passes DPCD information from DRM to NVKM - removes NVKM's own sink caps handling - link still trained from supervisor, more patches to come Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-33-lyude@redhat.com commit 757033808c95b0ee66b87803af6d0bf7fdaee3e6 Author: Ben Skeggs Date: Tue Sep 19 17:56:26 2023 -0400 drm/nouveau/kms/nv50-: fixup sink D3 before tearing down link - fixes bug preventing this on SST - implement for MST Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-32-lyude@redhat.com commit 625ead3d39d7021b3e9a2d0662b8bd0c3b5a7ac2 Author: Ben Skeggs Date: Tue Sep 19 17:56:25 2023 -0400 drm/nouveau/kms/nv50-: flush mst disables together - fixes some issues tearing down modes on tiled displays Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-31-lyude@redhat.com commit a5a7379f6d9d83964b3d2e1fe0dd0ad45ee55408 Author: Ben Skeggs Date: Tue Sep 19 17:56:24 2023 -0400 drm/nouveau/kms/nv50-: split DP disable+enable into two modesets Link training can finally be moved out of the supervisor sequence, but first we need to split DP modesets into separate disable and enable sequences to be able to perform link training between them instead. - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-30-lyude@redhat.com commit bfb03a077ba9955c165d355cb3ce4d3622a9c8c6 Author: Ben Skeggs Date: Tue Sep 19 17:56:23 2023 -0400 drm/nouveau/disp: add dp rates method - moves building of link rates table from NVKM to DRM - preparing to move link training out of supervisor Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-29-lyude@redhat.com commit bd7a61bcbb50bfca1b9a585f17d5590dbb521b78 Author: Ben Skeggs Date: Tue Sep 19 17:56:22 2023 -0400 drm/nouveau/disp: add dp aux xfer method - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-28-lyude@redhat.com commit 0bd4e9f7dcd17003b7274b0608bf6575c6a07b88 Author: Ben Skeggs Date: Tue Sep 19 17:56:21 2023 -0400 drm/nouveau/disp: move dp aux pwr method to HAL - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-27-lyude@redhat.com commit e9c9b5b942550bc0f77de3a8c47ea75ff4c0161e Author: Ben Skeggs Date: Tue Sep 19 17:56:20 2023 -0400 drm/nouveau/disp: add hdmi audio hal function This just adds a hook for RM to use, HW paths remain untouched, but should probably be cleaned up to use this too at some point. Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-26-lyude@redhat.com commit 5b9c0307a103bde953b47b4ec86ca5f0a01ce516 Author: Ben Skeggs Date: Tue Sep 19 17:56:19 2023 -0400 drm/nouveau/disp: add output lvds config method - was previously part of acquire() Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-25-lyude@redhat.com commit 2274ce7e368174f7711a16a389fa256b1c89ce46 Author: Ben Skeggs Date: Tue Sep 19 17:56:18 2023 -0400 drm/nouveau/disp: add output backlight control methods - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-24-lyude@redhat.com commit 422f6d8a24bb370a2d9ee9e58634509592295e99 Author: Ben Skeggs Date: Tue Sep 19 17:56:17 2023 -0400 drm/nouveau/disp: remove SOR routing updates from supervisor - these shouldn't be necessary now, and are done in acquire()/release() - preparation for GSP-RM, where we don't control the supervisor Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-23-lyude@redhat.com commit b24bf8b8ba53834590be94d990e3305e4fd914ae Author: Ben Skeggs Date: Tue Sep 19 17:56:16 2023 -0400 drm/nouveau/disp: release outputs post-modeset Prior to this commit, KMS would call release() prior to modeset, and the second supervisor interrupt would update SOR routing if needed. Now, KMS will call release() post-modeset and update routing immediately. - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-22-lyude@redhat.com commit 8ed094211f3b970d74ca8686fac03c88977ca5de Author: Ben Skeggs Date: Tue Sep 19 17:56:15 2023 -0400 drm/nouveau/disp: move hdmi disable out of release() - release() is being moved post-modeset, preserve hdmi behaviour for now Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-21-lyude@redhat.com commit 6c6abab20b99169f5fb11a8619012225ecd02f1e Author: Ben Skeggs Date: Tue Sep 19 17:56:14 2023 -0400 drm/nouveau/disp: add output hdmi config method - was previously part of acquire() - preparation for GSP-RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-20-lyude@redhat.com commit c0f7b729425b8f0764b9e89f19d33a0deba89811 Author: Ben Skeggs Date: Tue Sep 19 17:56:13 2023 -0400 drm/nouveau/kms/nv50-: move audio enable post-modeset - adds tracking for post-UPDATE modeset operations, similar to mst[mo]'s - audio won't work on RM without this - we should probably have been doing this anyway Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-19-lyude@redhat.com commit 232856e896b35adf2560a684b3799fe654483d39 Author: Ben Skeggs Date: Tue Sep 19 17:56:12 2023 -0400 drm/nouveau/kms/nv50-: keep output state around until modeset complete - we'll want this info post-UPDATE for later patches Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-18-lyude@redhat.com commit 42db5692aa2e1c9b322a6a369c1d196f5262156a Author: Ben Skeggs Date: Tue Sep 19 17:56:11 2023 -0400 drm/nouveau/kms/nv50-: remove nv_encoder.audio.connector - use nv_encoder.conn instead, outp->conn never changes Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-17-lyude@redhat.com commit e32de3da3f260fb8126491fb5c6bf79097dab6bf Author: Ben Skeggs Date: Tue Sep 19 17:56:10 2023 -0400 drm/nouveau/kms/nv50-: pull some common init out of OR-specific code - cleanup before additional changes Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-16-lyude@redhat.com commit 45d954c05da1e56b534b28a64c2a7b99576fbd57 Author: Ben Skeggs Date: Tue Sep 19 17:56:09 2023 -0400 drm/nouveau/disp: update SOR routing immediately on acquire() - was previously delayed until second supervisor interrupt Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-15-lyude@redhat.com commit cefc3c1452b19920038b44ae257d6a8af2d4da51 Author: Ben Skeggs Date: Tue Sep 19 17:56:08 2023 -0400 drm/nouveau/disp: add acquire_sor/pior() - preparing to move protocol-specific args out of acquire() again - avoid re-acquiring acquired output, will matter when enforced later - sor/pior done at same time due to shared tmds/dp handling Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-14-lyude@redhat.com commit 724e0f3b8b98d85d920e7517724de1bc4eeced87 Author: Ben Skeggs Date: Tue Sep 19 17:56:07 2023 -0400 drm/nouveau/disp: add acquire_dac() - preparing to move protocol-specific args out of acquire() again - avoid re-acquiring acquired output, will matter when enforced later - this one is basically just a rename Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-13-lyude@redhat.com commit 68ee172269fa2d385166ddc6961fa9249fe88c15 Author: Ben Skeggs Date: Tue Sep 19 17:56:06 2023 -0400 drm/nouveau/disp: shuffle to make upcoming diffs prettier - preparing to move protocol-specific args out of acquire() again - no code changes Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-12-lyude@redhat.com commit 1b477f42285e941627acd46ca0eb27ca05671d39 Author: Lyude Paul Date: Tue Sep 19 17:56:05 2023 -0400 drm/nouveau/kms: Add INHERIT ioctl to nvkm/nvif for reading IOR state Now that we're supporting things like Ada and the GSP, there's situations where we really need to actually know the display state that we're starting with when loading the driver in order to prevent breaking GSP expectations. The first step in doing this is making it so that we can read the current state of IORs from nvkm in DRM, so that we can fill in said into into the atomic state. We do this by introducing an INHERIT ioctl to nvkm/nvif. This is basically another form of ACQUIRE, except that it will only acquire the given output path for userspace if it's already set up in hardware. This way, we can go through and probe each outp object we have in DRM in order to figure out the current hardware state of each one. If the outp isn't in use, it simply returns -ENODEV. This is also part of the work that will be required for implementing GSP support for display. While the GSP should mostly work without this commit, this commit should fix some edge case bugs that can occur on initial driver load. This also paves the way for some of the initial groundwork for fastboot support. Signed-off-by: Lyude Paul Signed-off-by: Ben Skeggs Acked-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-11-lyude@redhat.com commit 8a7783c791b672a463b529751b7beea635a87f44 Author: Ben Skeggs Date: Tue Sep 19 17:56:04 2023 -0400 drm/nouveau/disp: rename internal output acquire/release functions These will be made static later in the patch series, after the code that uses them has been cleaned up in preparation for GSP-RM support. Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-10-lyude@redhat.com commit 0cd7e07181390085742bf623d6af3eef215c0503 Author: Ben Skeggs Date: Tue Sep 19 17:56:03 2023 -0400 drm/nouveau/disp: add output method to fetch edid - needed to support TMDS EDID on RM Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-9-lyude@redhat.com commit a69eeb37f90d8f69cb842e9a42fd508bd321882a Author: Ben Skeggs Date: Tue Sep 19 17:56:02 2023 -0400 drm/nouveau/disp: add output detect method This will check the relevant hotplug pin and skip the DDC probe we currently do if a display is present. - preparation for GSP-RM. Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-8-lyude@redhat.com commit 21636b1a696bdc122c3b8bacb297c5341a95adef Author: Ben Skeggs Date: Tue Sep 19 17:56:01 2023 -0400 drm/nouveau/disp: rearrange output methods - preparation for a bunch of API changes, to make diffs prettier Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-7-lyude@redhat.com commit 167630846960008d2cb7f7bc1459d0800bd347c7 Author: Ben Skeggs Date: Tue Sep 19 17:56:00 2023 -0400 drm/nouveau/kms/nv50-: fix mst payload alloc fail crashing evo Programming -1 (vc_start_slot, if alloc fails) into HW probably isn't the best idea. Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-6-lyude@redhat.com commit 17008293c5726d6a992deb4cc2f1add020c241dc Author: Ben Skeggs Date: Tue Sep 19 17:55:59 2023 -0400 drm/nouveau/mmu/gp100-: always invalidate TLBs at CACHE_LEVEL_ALL Fixes some issues when running on top of RM. Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-5-lyude@redhat.com commit e120f4cafe15b0320f8ec4e60ad61339129304fe Author: Ben Skeggs Date: Tue Sep 19 17:55:58 2023 -0400 drm/nouveau/gr/gf100-: lose contents of global ctxbufs across suspend Some of these buffers are quite large, and there's no need to preserve them across suspend. Mark the contents as lost to speedup suspend/resume. Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-4-lyude@redhat.com commit 12c9b05da9189a14f0db62ac4e31409bb4a87533 Author: Ben Skeggs Date: Tue Sep 19 17:55:57 2023 -0400 drm/nouveau/imem: support allocations not preserved across suspend Will initially be used to tag some large grctx allocations which don't need to be saved, to speedup suspend/resume. Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-3-lyude@redhat.com commit d79d91026e7b2f94ffae08d2b63307810f84a890 Author: Ben Skeggs Date: Tue Sep 19 17:55:56 2023 -0400 drm/nouveau/devinit/tu102-: remove attempt at loading PreOS From Turing, HW will already have handled this and locked-down the falcon before we get control. So this *should* be a no-op. Signed-off-by: Ben Skeggs Reviewed-by: Lyude Paul Acked-by: Danilo Krummrich Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230919220442.202488-2-lyude@redhat.com commit 916b5916f228a9f83a22ad91ad8c5bf788a456d7 Author: Dmitry Baryshkov Date: Mon Jul 31 14:11:58 2023 +0300 arm64: dts: qcom: sc8180x: switch UFS QMP PHY to new style of bindings Change the UFS QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230731111158.3998107-1-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 989aac9dea7fcfc33b5eedc4ae44abbf71460a4d Author: Douglas Anderson Date: Thu Jul 27 10:16:38 2023 -0700 arm64: dts: qcom: sc7180: Link trogdor touchscreens to the panels Let's provide the proper link from the touchscreen to the panel on trogdor devices where the touchscreen support it. This allows the OS to power sequence the touchscreen more properly. For the most part, this is just expected to marginally improve power consumption while the screen is off. However, in at least one trogdor model (wormdingler) it's suspected that this will fix some behavorial corner cases when the panel power cycles (like for a modeset) without the touchscreen power cycling. NOTE: some trogdor variants use touchscreens that don't (yet) support linking the touchscreen and the panel. Those variants are left alone. Reviewed-by: Maxime Ripard Signed-off-by: Douglas Anderson Reviewed-by: Benjamin Tissoires Acked-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20230727101636.v4.11.Ia06c340e3482563e6bfd3106ecd0d3139f173ca4@changeid Signed-off-by: Bjorn Andersson commit 20ef4f6445681217c0cb49dc21402cb2836b22aa Author: Nikita Travkin Date: Tue Jul 25 16:52:03 2023 +0500 arm64: dts: qcom: msm8916-samsung-gt510: Add capacitive keys gt510 has two capacitive keys on the bottom. Define keycodes to enable them. Signed-off-by: Nikita Travkin Link: https://lore.kernel.org/r/20230725-gt5-panel-v1-3-7c787e33a614@trvn.ru Signed-off-by: Bjorn Andersson commit 43525a7a96acad0648577770b84894af8dcb10d2 Author: Siddharth Manthan Date: Tue Jul 25 16:52:02 2023 +0500 arm64: dts: qcom: msm8916-samsung-gt58: Add display panel The device has a 8 inch lsl080al03 display. Add it to the device tree. Signed-off-by: Siddharth Manthan Co-developed-by: Nikita Travkin Signed-off-by: Nikita Travkin Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230725-gt5-panel-v1-2-7c787e33a614@trvn.ru Signed-off-by: Bjorn Andersson commit 4389a650323afe947900f631322fa4db4993d356 Author: Jasper Korten Date: Tue Jul 25 16:52:01 2023 +0500 arm64: dts: qcom: msm8916-samsung-gt510: Add display panel The device has a 9.7 inch ltl101at01 display. Add it to the device tree. Signed-off-by: Jasper Korten Co-developed-by: Nikita Travkin Signed-off-by: Nikita Travkin Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230725-gt5-panel-v1-1-7c787e33a614@trvn.ru Signed-off-by: Bjorn Andersson commit 2f98ed431b77cbaefd75f9690a671c5fe3c9c479 Author: Konrad Dybcio Date: Mon Jul 24 13:39:58 2023 +0200 arm64: defconfig: enable Qualcomm SM6115 LPASS pinctrl Enable the Qualcomm SM6115 LPASS TLMM pin controller driver for providing GPIOs/pins for audio block on SM6115 based boards (e.g. QTI RB2). Reviewed-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20230722-topic-6115_lpasstlmm-v2-3-d4883831a858@linaro.org Signed-off-by: Bjorn Andersson commit 5078dfe3c5c7b8d2d6494c26de81a4f3d4a5a3d7 Author: Marijn Suijten Date: Sun Jul 23 18:08:55 2023 +0200 arm64: dts: qcom: sm6125-seine: Configure MDSS, DSI and panel Enable MDSS and DSI, and configure the Samsung SOFEF01-M ams597ut01 6.0" 1080x2520 panel. Reviewed-by: Konrad Dybcio Signed-off-by: Marijn Suijten Link: https://lore.kernel.org/r/20230723-sm6125-dpu-v4-17-a3f287dd6c07@somainline.org Signed-off-by: Bjorn Andersson commit 0865d23a02260a76963bd18d9ae603e77cdd0eba Author: Marijn Suijten Date: Sun Jul 23 18:08:54 2023 +0200 arm64: dts: qcom: sm6125: Add display hardware nodes Add the DT nodes that describe the MDSS hardware on SM6125, containing one MDP (display controller) together with a single DSI and DSI PHY. No DisplayPort support is added for now. Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Signed-off-by: Marijn Suijten Link: https://lore.kernel.org/r/20230723-sm6125-dpu-v4-16-a3f287dd6c07@somainline.org Signed-off-by: Bjorn Andersson commit 4988881ec067c3e6d382de1583b7f5b1095ddea2 Author: Marijn Suijten Date: Sun Jul 23 18:08:53 2023 +0200 arm64: dts: qcom: sm6125: Add dispcc node Enable and configure the dispcc node on SM6125 for consumption by MDSS later on. Signed-off-by: Marijn Suijten Link: https://lore.kernel.org/r/20230723-sm6125-dpu-v4-15-a3f287dd6c07@somainline.org Signed-off-by: Bjorn Andersson commit cbe82d7d0b149aa9c0c000f7ffd2b18bfd248d35 Author: Marijn Suijten Date: Sun Jul 23 18:08:52 2023 +0200 arm64: dts: qcom: sm6125: Switch fixed xo_board clock to RPM XO clock We have a working RPM XO clock; no other driver except rpmcc should be parenting directly to the fixed-factor xo_board clock nor should it be reachable by that global name. Remove the name to that effect, so that every clock relation is explicitly defined in DTS. Reviewed-by: Konrad Dybcio Signed-off-by: Marijn Suijten Link: https://lore.kernel.org/r/20230723-sm6125-dpu-v4-14-a3f287dd6c07@somainline.org Signed-off-by: Bjorn Andersson commit 3d06cee2249f4764f01a9f602ec1cc1bf4562ca6 Author: Marijn Suijten Date: Sun Jul 23 18:08:41 2023 +0200 arm64: dts: qcom: sm6125: Sort spmi_bus node numerically by reg This node has always resided in the wrong spot, making it somewhat harder to contribute new node entries while maintaining proper sorting around it. Move the node up to sit after hsusb_phy1 where it maintains proper numerical sorting on the (first of its many) reg address property. Fixes: cff4bbaf2a2d ("arm64: dts: qcom: Add support for SM6125") Reviewed-by: Konrad Dybcio Signed-off-by: Marijn Suijten Link: https://lore.kernel.org/r/20230723-sm6125-dpu-v4-3-a3f287dd6c07@somainline.org Signed-off-by: Bjorn Andersson commit 310cdafc4a56827d1aeda7cc297939034adb8f99 Author: Marijn Suijten Date: Sun Jul 23 18:08:40 2023 +0200 arm64: dts: qcom: sm6125: Pad APPS IOMMU address to 8 characters APPS IOMMU is the only node in sm6125.dtsi that doesn't have its address padded to 8 hexadecimals; fix this by prepending a 0. Fixes: 8ddb4bc3d3b5 ("arm64: dts: qcom: sm6125: Configure APPS SMMU") Signed-off-by: Marijn Suijten Link: https://lore.kernel.org/r/20230723-sm6125-dpu-v4-2-a3f287dd6c07@somainline.org Signed-off-by: Bjorn Andersson commit 5af94c7c6578b39f03efbb9b5ee1809e894a0e58 Author: Krzysztof Kozlowski Date: Sun Jul 23 16:18:49 2023 +0200 arm64: dts: qcom: sdm630: align USB DWC3 clocks with bindings Bindings require different order of clocks for USB DWC3 nodes (sleep before mock_utmi). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230723141849.93078-2-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 1e5fd509fef100aec1cdfc3f2d60b9eccd980de4 Author: Krzysztof Kozlowski Date: Sun Jul 23 16:18:48 2023 +0200 arm64: dts: qcom: sc8180x: align USB DWC3 clocks with bindings Bindings require different order of clocks for USB DWC3 nodes (sleep before mock_utmi). Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230723141849.93078-1-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit f32096602c19e68fb9bf04b494d13f1190602554 Author: Krzysztof Kozlowski Date: Thu Jul 20 09:20:48 2023 +0200 arm64: dts: qcom: msm8992-libra: drop duplicated reserved memory There are two entries for similar reserved memory: qseecom@cb400000 and audio@cb400000. Keep the qseecom as it is longer. Warning (unique_unit_address_if_enabled): /reserved-memory/audio@cb400000: duplicate unit-address (also used in node /reserved-memory/qseecom@cb400000) Fixes: 69876bc6fd4d ("arm64: dts: qcom: msm8992-libra: Fix the memory map") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230720072048.10093-2-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit bf80e606ca8db08c840d1ad394ec75eaabba717b Author: Krzysztof Kozlowski Date: Thu Jul 20 09:20:47 2023 +0200 arm64: dts: qcom: msm8994: fix duplicated @6c00000 reserved memory Reserved memory @6c00000 is defined in MSM8994 DTSI and few boards: Warning (unique_unit_address_if_enabled): /reserved-memory/reserved@6c00000: duplicate unit-address (also used in node /reserved-memory/hole2@6c00000) Warning (unique_unit_address_if_enabled): /reserved-memory/reserved@6c00000: duplicate unit-address (also used in node /reserved-memory/memory@6c00000) Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230720072048.10093-1-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 7a9d9ee88cdb25d6241021317bcb3874d0fa7153 Author: Krzysztof Kozlowski Date: Wed Jul 19 21:20:58 2023 +0200 arm64: defconfig: enable Qualcomm SM8350 LPASS pinctrl Enable the Qualcomm SM8350 LPASS TLMM pin controller driver for providing GPIOs/pins for audio block on SM8350 based boards (e.g. HDK8350). Signed-off-by: Krzysztof Kozlowski Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20230719192058.433517-3-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 09f1642eca6eb6d25a630214098350dc02917954 Author: Alexey Minnekhanov Date: Wed Jul 19 12:34:58 2023 +0300 arm64: dts: qcom: sdm630: Add support for modem remoteproc Modem subsystem in SDM630/660 is similar to MSM8998 and device tree node for it is based on the one from msm8998.dtsi. Signed-off-by: Alexey Minnekhanov Link: https://lore.kernel.org/r/20230719093458.2668842-1-alexeymin@postmarketos.org Signed-off-by: Bjorn Andersson commit 274926cc4ced14f4e61204c0cd23fd099daa9b16 Author: Konrad Dybcio Date: Fri Jul 14 14:40:48 2023 +0200 arm64: dts: qcom: sc7280: Remove qcom,adsp-bypass-mode This property isn't used or defined anymore. Get rid of it. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230714-topic-lpass_lpi_cleanup-v1-3-dc18b5bd14f7@linaro.org Signed-off-by: Bjorn Andersson commit f20cf2bc3f770a4f8ce098effbcae5ef5a0912a7 Author: Krzysztof Kozlowski Date: Mon Jul 17 16:38:24 2023 +0200 arm64: dts: qcom: sm8450-hdk: add other analogue microphones Add proper audio routes for onboard analogue microphones: AMIC[1345]. Use also new DAPM input widget (TX SWR_INPUTn) for them, not the deprecated ADC one. Change is not compatible with older kernels not having the new SWR_INPUTn input widget. Cc: Srinivas Kandagatla Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230717143824.203352-1-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit e271b59e39a6fbdc57784fdda7e68076f8e58ef7 Author: Jagadeesh Kona Date: Fri Jul 7 09:27:44 2023 +0530 arm64: dts: qcom: sm8550: Add camera clock controller Add device node for camera clock controller on Qualcomm SM8550 platform. Signed-off-by: Jagadeesh Kona Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230707035744.22245-6-quic_jkona@quicinc.com Signed-off-by: Bjorn Andersson commit bfa9cf9aeb91d481fcc5f01200e059652eb415f7 Merge: 2de8ee9f58fa5 a209cf9cc8ae4 Author: Bjorn Andersson Date: Tue Sep 19 14:18:58 2023 -0700 Merge branch '20230707035744.22245-2-quic_jkona@quicinc.com' into arm64-for-6.7 Merge the SM8550 camera clock controller through a topic branch, to get access to the DeviceTree bindings. commit cdb55bdb50eb1a458ad8f34550304296c39690f3 Author: Ivan Orlov Date: Thu Aug 10 21:46:18 2023 +0400 i2c: dev: make i2c_dev_class a static const structure Now that the driver core allows for struct class to be in read-only memory, move the i2c_dev_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Suggested-by: Greg Kroah-Hartman Signed-off-by: Ivan Orlov Signed-off-by: Wolfram Sang commit 1aabbc532413ced293952f8e149ad0a607d6e470 Author: Sebastian Andrzej Siewior Date: Thu Aug 3 12:09:32 2023 +0200 signal: Don't disable preemption in ptrace_stop() on PREEMPT_RT On PREEMPT_RT keeping preemption disabled during the invocation of cgroup_enter_frozen() is a problem because the function acquires css_set_lock which is a sleeping lock on PREEMPT_RT and must not be acquired with disabled preemption. The preempt-disabled section is only for performance optimisation reasons and can be avoided. Extend the comment and don't disable preemption before scheduling on PREEMPT_RT. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Oleg Nesterov Link: https://lore.kernel.org/r/20230803100932.325870-3-bigeasy@linutronix.de commit a20d6f63dbfc176697886d7709312ad0a795648e Author: Sebastian Andrzej Siewior Date: Thu Aug 3 12:09:31 2023 +0200 signal: Add a proper comment about preempt_disable() in ptrace_stop() Commit 53da1d9456fe7 ("fix ptrace slowness") added a preempt-disable section between read_unlock() and the following schedule() invocation without explaining why it is needed. Replace the existing contentless comment with a proper explanation to clarify that it is not needed for correctness but for performance reasons. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Oleg Nesterov Link: https://lore.kernel.org/r/20230803100932.325870-2-bigeasy@linutronix.de commit bcfaaa9711127eda1803f164ae4d790f38ff1122 Author: Daniel Golle Date: Sun Aug 27 03:13:30 2023 +0100 i2c: mt65xx: allow optional pmic clock Using the I2C host controller on the MT7981 SoC requires 4 clocks to be enabled. One of them, the pmic clk, is only enabled in case 'mediatek,have-pmic' is also set which has other consequences which are not desired in this case. Allow defining a pmic clk even in case the 'mediatek,have-pmic' propterty is not present and the bus is not used to connect to a pmic, but may still require to enable the pmic clock. Signed-off-by: Daniel Golle Reviewed-by: Andi Shyti Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Wolfram Sang commit 19b6ffd5f079741dadc555477375e3da59fd5c58 Author: Heiner Kallweit Date: Mon Sep 18 14:16:58 2023 +0200 i2c: i801: simplify module boilerplate code Simplify the module boilerplate code. Signed-off-by: Heiner Kallweit Reviewed-by: Jean Delvare Acked-by: Andi Shyti Signed-off-by: Wolfram Sang commit 3b0e2091d76ed31b0a135ba971d2d71dacc5151a Author: Heiner Kallweit Date: Mon Sep 18 13:57:01 2023 +0200 i2c: i801: add helper i801_restore_regs In few places relevant registers are reset to their initial value on driver load. Factor this out to new helper i801_restore_regs to avoid code duplication. Even though no actual problems are known, this patch may contribute to avoiding potential issues by: - restoring register values also in the error path of i2c_add_adapter - making restoring registers the last step (especially in i801_remove) Signed-off-by: Heiner Kallweit Reviewed-by: Jean Delvare Acked-by: Andi Shyti Signed-off-by: Wolfram Sang commit 941266451b5d6691fa3b17526d9f3a35ef4bf406 Merge: c1ac8903f31f4 2409205acd3c7 Author: Wolfram Sang Date: Tue Sep 19 21:57:45 2023 +0200 Merge branch 'i2c/for-current' into i2c/for-mergewindow commit afddcbe41f049072b3c62d39ce474bd71b3a5212 Author: Alan Previn Date: Sun Sep 17 14:19:33 2023 -0700 drm/i915/lrc: User PXP contexts requires runalone bit in lrc On Meteorlake onwards, HW specs require that all user contexts that run on render or compute engines and require PXP must enforce run-alone bit in lrc. Add this enforcement for protected contexts. Signed-off-by: Alan Previn Reviewed-by: Vivaik Balasubrawmanian Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230917211933.1407559-4-alan.previn.teres.alexis@intel.com commit c14d446e25fe00a9fd29d317b07bd221fd6f49db Author: Alan Previn Date: Sun Sep 17 14:19:32 2023 -0700 drm/i915/pxp/mtl: Update pxp-firmware packet size Update the GSC-fw input/output HECI packet size to match updated internal fw specs. Signed-off-by: Alan Previn Reviewed-by: Vivaik Balasubrawmanian Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230917211933.1407559-3-alan.previn.teres.alexis@intel.com commit 8ae272348153ed2fa423f739047a592d9bd55ba2 Author: Alan Previn Date: Sun Sep 17 14:19:31 2023 -0700 drm/i915/pxp/mtl: Update pxp-firmware response timeout Update the max GSC-fw response time to match updated internal fw specs. Because this response time is an SLA on the firmware, not inclusive of i915->GuC->HW handoff latency, when submitting requests to the GSC fw via intel_gsc_uc_heci_cmd_submit helpers, start the count after the request hits the GSC command streamer. Also, move GSC_REPLY_LATENCY_MS definition from pxp header to intel_gsc_uc_heci_cmd_submit.h since its for any GSC HECI packet. Signed-off-by: Alan Previn Reviewed-by: Vivaik Balasubrawmanian Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230917211933.1407559-2-alan.previn.teres.alexis@intel.com commit 07c34b37bd955bb62486da1326569ad855f50c69 Merge: 1fa2d1a887c76 a209cf9cc8ae4 Author: Bjorn Andersson Date: Tue Sep 19 11:38:29 2023 -0700 Merge branch '20230707035744.22245-2-quic_jkona@quicinc.com' into clk-for-6.7 Merge the SM8550 camera clock controller patches through a topic branch, to make them available for the DeviceTree source as well. commit a209cf9cc8ae436c227e28c3e6a36fc1894b2dea Author: Jagadeesh Kona Date: Fri Jul 7 09:27:43 2023 +0530 clk: qcom: camcc-sm8550: Add support for qdss, sleep and xo clocks Add support for camera qdss, sleep and xo clocks. Co-developed-by: Taniya Das Signed-off-by: Taniya Das Signed-off-by: Jagadeesh Kona Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230707035744.22245-5-quic_jkona@quicinc.com Signed-off-by: Bjorn Andersson commit ccc4e6a061a21d75b96d82fc4b084a8d96df6eb4 Author: Jagadeesh Kona Date: Fri Jul 7 09:27:42 2023 +0530 clk: qcom: camcc-sm8550: Add camera clock controller driver for SM8550 Add support for the camera clock controller for camera clients to be able to request for camcc clocks on SM8550 platform. Co-developed-by: Taniya Das Signed-off-by: Taniya Das Signed-off-by: Jagadeesh Kona Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230707035744.22245-4-quic_jkona@quicinc.com Signed-off-by: Bjorn Andersson commit 3132a9a11e57f257ab79ae79ce101a38952fa50a Author: Jagadeesh Kona Date: Fri Jul 7 09:27:41 2023 +0530 clk: qcom: clk-alpha-pll: Add support for lucid ole pll configure Lucid ole pll has as extra RINGOSC_CAL_L field in L register in addition to the fields that are part of lucid evo pll, hence add support for lucid ole pll configure function to configure the ole plls. Signed-off-by: Jagadeesh Kona Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230707035744.22245-3-quic_jkona@quicinc.com Signed-off-by: Bjorn Andersson commit 9cbc64745fc6744c0b7a35b59545f21236d81a53 Author: Jagadeesh Kona Date: Fri Jul 7 09:27:40 2023 +0530 dt-bindings: clock: qcom: Add SM8550 camera clock controller Add device tree bindings for the camera clock controller on Qualcomm SM8550 platform. Co-developed-by: Taniya Das Signed-off-by: Taniya Das Signed-off-by: Jagadeesh Kona Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230707035744.22245-2-quic_jkona@quicinc.com Signed-off-by: Bjorn Andersson commit 5692aeea5bcb9331e956628c3bc8fc9afcc9765d Author: Lu Hongfei Date: Mon Jun 12 21:34:52 2023 +0800 soc: qcom: pmic: Fix resource leaks in a device_for_each_child_node() loop The device_for_each_child_node loop should call fwnode_handle_put() before return in the error cases, to avoid resource leaks. Let's fix this bug in pmic_glink_altmode_probe(). Signed-off-by: Lu Hongfei Link: https://lore.kernel.org/r/20230612133452.47315-1-luhongfei@vivo.com [bjorn: Rebased patch, moved fw_handle_put() from jump target into the loop] Signed-off-by: Bjorn Andersson commit 667f45ca80cbf344695cf3a58eeb2191e6724de6 Merge: 03db12ef1cbc3 aa7627111c689 Author: Mark Brown Date: Tue Sep 19 18:22:20 2023 +0100 Minor default jack pop performance updates Merge series from Charles Keepax : Some small updates to the driver defaults to ensure a good pop performance on jack insert and removal. commit 03db12ef1cbc3ad86aaaf3a5e9203a936dba52b8 Merge: 16bb22098f0a4 c1c48fd6bbe78 Author: Mark Brown Date: Tue Sep 19 18:22:11 2023 +0100 ASoC: SOF: ipc4/Intel: Support for firmware exception Merge series from Peter Ujfalusi : When a firmware crashes it creats a panic information into a telemetry slot. The panic format is defined by Zephyr, includes stack and additional information to help to identify the reason for the crash. Part of the firmware exception handling the firmware also sends an EXCEPTION_CAUGHT notification. This series implements the kernel side handling of the exception: print information into the kernel log export the whole telemetry slot to user space for tools extract additional information from the panic dump. commit 16bb22098f0a44fed8192c4b16fede95876fdc19 Merge: cc676c0df591a 07a866a41982c Author: Mark Brown Date: Tue Sep 19 18:11:02 2023 +0100 ASoC: SOF: ipc4-control: Support for Switch and Enum Merge series from Peter Ujfalusi : Currently IPC4 has no notion of a switch or enum type of control which is a generic concept in ALSA. The generic support for these control types will be as follows: - large config is used to send the channel-value par array - param_id of a SWITCH type is 200 - param_id of an ENUM type is 201 Each module need to support a switch or/and enum must handle these universal param_ids. The message payload is described by struct sof_ipc4_control_msg_payload. commit cc676c0df591a81de662bb28a705fe6ed1331024 Merge: 3fd61ce9dcc5f 05fe62842804d Author: Mark Brown Date: Tue Sep 19 17:59:40 2023 +0100 ASoC: intel: Add CS42L43 sdw machine driver support Merge series from Bard Liao : Add cs42l43 codec support to sof_sdw machine driver. commit 3fd61ce9dcc5f1b1c5e708effd46a06c944005bd Merge: 842a62a75e709 7b5300e90a781 Author: Mark Brown Date: Tue Sep 19 17:59:30 2023 +0100 ASoC: SOF: Use generic IPC type identifiers Merge series from Peter Ujfalusi : Hi, rename the IPC type defines to be more generic and intuitive: SOF_IPC -> SOF_IPC_TYPE_3 SOF_INTEL_IPC4 -> SOF_IPC_TYPE_4 No functional change, just renaming all around. Regards, Peter --- Peter Ujfalusi (9): ASoC: SOF: Introduce generic names for IPC types ASoC: SOF: sof-pci-dev: Update the ipc_type module parameter description ASoC: SOF: Kconfig: Rename SND_SOC_SOF_INTEL_IPC4 to SND_SOC_SOF_IPC4 ASoC: SOF: Use generic names for IPC types ASoC: SOF: amd: Use generic names for IPC types ASoC: SOF: imx: Use generic names for IPC types ASoC: SOF: Intel: Use generic names for IPC types ASoC: SOF: mediatek: Use generic names for IPC types ASoC: SOF: Drop unused IPC type defines include/sound/sof.h | 4 +- sound/soc/sof/Kconfig | 2 +- sound/soc/sof/Makefile | 4 +- sound/soc/sof/amd/pci-rmb.c | 10 +- sound/soc/sof/amd/pci-rn.c | 10 +- sound/soc/sof/amd/pci-vangogh.c | 10 +- sound/soc/sof/imx/imx8.c | 20 +-- sound/soc/sof/imx/imx8m.c | 10 +- sound/soc/sof/imx/imx8ulp.c | 10 +- sound/soc/sof/intel/Kconfig | 14 +- sound/soc/sof/intel/apl.c | 4 +- sound/soc/sof/intel/bdw.c | 10 +- sound/soc/sof/intel/byt.c | 30 ++-- sound/soc/sof/intel/cnl.c | 4 +- sound/soc/sof/intel/hda-dai-ops.c | 4 +- sound/soc/sof/intel/hda-dai.c | 4 +- sound/soc/sof/intel/hda-loader.c | 2 +- sound/soc/sof/intel/hda.c | 2 +- sound/soc/sof/intel/icl.c | 4 +- sound/soc/sof/intel/pci-apl.c | 36 ++--- sound/soc/sof/intel/pci-cnl.c | 54 ++++---- sound/soc/sof/intel/pci-icl.c | 36 ++--- sound/soc/sof/intel/pci-lnl.c | 10 +- sound/soc/sof/intel/pci-mtl.c | 12 +- sound/soc/sof/intel/pci-skl.c | 20 +-- sound/soc/sof/intel/pci-tgl.c | 144 ++++++++++---------- sound/soc/sof/intel/pci-tng.c | 10 +- sound/soc/sof/intel/tgl.c | 4 +- sound/soc/sof/ipc.c | 6 +- sound/soc/sof/ipc3-dtrace.c | 2 +- sound/soc/sof/mediatek/mt8186/mt8186.c | 20 +-- sound/soc/sof/mediatek/mt8195/mt8195.c | 10 +- sound/soc/sof/sof-acpi-dev.c | 8 +- sound/soc/sof/sof-client-ipc-msg-injector.c | 4 +- sound/soc/sof/sof-client-probes.c | 6 +- sound/soc/sof/sof-client.c | 26 ++-- sound/soc/sof/sof-of-dev.c | 6 +- sound/soc/sof/sof-pci-dev.c | 2 +- 38 files changed, 286 insertions(+), 288 deletions(-) -- 2.42.0 commit 5bed8d585aa1db1651745173a66e32df82a5cb05 Merge: fa17a6d8a5bd0 1543b8ff02f09 Author: Paolo Abeni Date: Tue Sep 19 18:27:58 2023 +0200 Merge branch 'add-wed-support-for-mt7988-chipset' Lorenzo Bianconi says: ==================== Add WED support for MT7988 chipset Similar to MT7622 and MT7986, introduce Wireless Ethernet Dispatcher (WED) support for MT7988 chipset in order to offload to the hw packet engine traffic received from LAN/WAN device to WLAN nic (MT7996E). Add WED RX support in order to offload traffic received by WLAN nic to the wired interfaces (LAN/WAN). ==================== Link: https://lore.kernel.org/r/cover.1695032290.git.lorenzo@kernel.org Signed-off-by: Paolo Abeni commit 1543b8ff02f095fe7b609475407691dde715d37e Author: Sujuan Chen Date: Mon Sep 18 12:29:19 2023 +0200 net: ethernet: mtk_wed: add wed 3.0 reset support Introduce support for resetting Wireless Ethernet Dispatcher 3.0 available on MT988 SoC. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Sujuan Chen Signed-off-by: Paolo Abeni commit 3f3de094e834255eea3200cd9352855d696bcb51 Author: Sujuan Chen Date: Mon Sep 18 12:29:18 2023 +0200 net: ethernet: mtk_wed: debugfs: add WED 3.0 debugfs entries Introduce WED3.0 debugfs entries useful for debugging. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Sujuan Chen Signed-off-by: Paolo Abeni commit 4b7e02bb6375cd6a23e7834e3da18cb78915afc5 Author: Lorenzo Bianconi Date: Mon Sep 18 12:29:17 2023 +0200 net: ethernet: mtk_wed: debugfs: move wed_v2 specific regs out of regs array Move specific WED2.0 debugfs entries out of regs array. This is a preliminary patch to introduce WED 3.0 debugfs info. Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit 6757d345dd7dba795f5af44d4442d55a83c4b1b4 Author: Sujuan Chen Date: Mon Sep 18 12:29:16 2023 +0200 net: ethernet: mtk_wed: introduce hw_rro support for MT7988 MT7988 SoC support 802.11 receive reordering offload in hw while MT7986 SoC implements it through the firmware running on the mcu. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Sujuan Chen Signed-off-by: Paolo Abeni commit b230812b9dda125e69ab0a5a11cda88d9c0d18a9 Author: Sujuan Chen Date: Mon Sep 18 12:29:15 2023 +0200 net: ethernet: mtk_wed: introduce partial AMSDU offload support for MT7988 Introduce partial AMSDU offload support for MT7988 SoC in order to merge in hw packets belonging to the same AMSDU before passing them to the WLAN nic. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Sujuan Chen Signed-off-by: Paolo Abeni commit 96ddb4d0bf2e68aaff8fdb3b8b0fe125f548dcfd Author: Lorenzo Bianconi Date: Mon Sep 18 12:29:14 2023 +0200 net: ethernet: mtk_wed: refactor mtk_wed_check_wfdma_rx_fill routine Refactor mtk_wed_check_wfdma_rx_fill() in order to be reused adding HW receive offload support for MT7988 SoC. Co-developed-by: Sujuan Chen Signed-off-by: Sujuan Chen Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit e2f64db13aa1d08e32621067e4fe16bbc114b375 Author: Sujuan Chen Date: Mon Sep 18 12:29:13 2023 +0200 net: ethernet: mtk_wed: introduce WED support for MT7988 Similar to MT7986 and MT7622, enable Wireless Ethernet Ditpatcher for MT7988 in order to offload traffic forwarded from LAN/WLAN to WLAN/LAN Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Sujuan Chen Signed-off-by: Paolo Abeni commit 9ae7eca9f901efbf0041b8324f54115a2d633dcd Author: Lorenzo Bianconi Date: Mon Sep 18 12:29:12 2023 +0200 net: ethernet: mtk_wed: add mtk_wed_soc_data structure Introduce mtk_wed_soc_data utility structure to contain per-SoC definitions. Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit c80471ba74b7f332ac19b985ccb76d852d507acf Author: Lorenzo Bianconi Date: Mon Sep 18 12:29:11 2023 +0200 net: ethernet: mtk_wed: fix EXT_INT_STATUS_RX_FBUF definitions for MT7986 SoC Fix MTK_WED_EXT_INT_STATUS_RX_FBUF_LO_TH and MTK_WED_EXT_INT_STATUS_RX_FBUF_HI_TH definitions for MT7986 (MT7986 is the only SoC to use them). Fixes: de84a090d99a ("net: ethernet: mtk_eth_wed: add wed support for mt7986 chipset") Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit 71e2135967f470e34a4436cb277920fcdb4b87e0 Author: Lorenzo Bianconi Date: Mon Sep 18 12:29:10 2023 +0200 net: ethernet: mtk_wed: make memory region optional Make mtk_wed_wo_memory_region optionals. This is a preliminary patch to introduce Wireless Ethernet Dispatcher support for MT7988 SoC since MT7988 WED fw image will have a different layout. Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit c6d961aeaa7721e59316556056d1fd946d810d03 Author: Lorenzo Bianconi Date: Mon Sep 18 12:29:09 2023 +0200 net: ethernet: mtk_wed: move mem_region array out of mtk_wed_mcu_load_firmware Remove mtk_wed_wo_memory_region boot structure in mtk_wed_wo. This is a preliminary patch to introduce WED support for MT7988 SoC. Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit ff0ea57fa30e860d3373acd1383e9d9599144b58 Author: Lorenzo Bianconi Date: Mon Sep 18 12:29:08 2023 +0200 net: ethernet: mtk_wed: introduce mtk_wed_buf structure Introduce mtk_wed_buf structure to store both virtual and physical addresses allocated in mtk_wed_tx_buffer_alloc() routine. This is a preliminary patch to add WED support for MT7988 SoC since it relies on a different dma descriptor layout not storing page dma addresses. Co-developed-by: Sujuan Chen Signed-off-by: Sujuan Chen Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit bafd764a8baa87e19e6beeaa58eb85fcbbdd6b20 Author: Lorenzo Bianconi Date: Mon Sep 18 12:29:07 2023 +0200 net: ethernet: mtk_wed: rename mtk_rxbm_desc in mtk_wed_bm_desc Rename mtk_rxbm_desc structure in mtk_wed_bm_desc since it will be used even on tx side by MT7988 SoC. Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit 7d5a72733b211e020455cd45d63b85352b72c678 Author: Lorenzo Bianconi Date: Mon Sep 18 12:29:06 2023 +0200 net: ethernet: mtk_wed: do not configure rx offload if not supported Check if rx offload is supported running mtk_wed_get_rx_capa routine before configuring it. This is a preliminary patch to introduce Wireless Ethernet Dispatcher (WED) support for MT7988 SoC. Co-developed-by: Sujuan Chen Signed-off-by: Sujuan Chen Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit d274d523c71c825fcd7738c6f401fc283bdad9ff Author: Lorenzo Bianconi Date: Mon Sep 18 12:29:05 2023 +0200 net: ethernet: mtk_wed: introduce versioning utility routines Similar to mtk_eth_soc, introduce the following wed versioning utility routines: - mtk_wed_is_v1 - mtk_wed_is_v2 This is a preliminary patch to introduce WED support for MT7988 SoC Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit f881f27324483b59a47e34d58774d9bcc761626f Author: Lorenzo Bianconi Date: Mon Sep 18 12:29:04 2023 +0200 dt-bindings: arm: mediatek: mt7622-wed: add WED binding for MT7988 SoC Introduce MT7988 SoC compatibility string in mtk_wed binding. Acked-by: Rob Herring Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit 4518b25c63d4e47566be87b06ce4fb880b6d1186 Author: Lorenzo Bianconi Date: Mon Sep 18 12:29:03 2023 +0200 dt-bindings: soc: mediatek: mt7986-wo-ccif: add binding for MT7988 SoC Introduce MT7988 SoC compatibility string in mt7986-wo-ccif binding. Acked-by: Rob Herring Signed-off-by: Lorenzo Bianconi Signed-off-by: Paolo Abeni commit fa17a6d8a5bd0cd7565b613cb804242cd0f6b7ab Author: Eric Dumazet Date: Mon Sep 18 14:23:21 2023 +0000 ipv6: lockless IPV6_ADDR_PREFERENCES implementation We have data-races while reading np->srcprefs Switch the field to a plain byte, add READ_ONCE() and WRITE_ONCE() annotations where needed, and IPV6_ADDR_PREFERENCES setsockopt() can now be lockless. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20230918142321.1794107-1-edumazet@google.com Signed-off-by: Paolo Abeni commit 914efd602a807ea7e360cbb86018f3c4c7469187 Author: Michael Walle Date: Fri Sep 8 12:16:59 2023 +0200 mtd: spi-nor: core: get rid of the INFOx() macros Now that all flash_info tables are converted to the new format, remove the old INFOx() macros. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-41-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 1d4c725453c8e61b6b0fb64ebe79258169cbb03c Author: Michael Walle Date: Fri Sep 8 12:16:58 2023 +0200 mtd: spi-nor: atmel: drop duplicate entry The Atmel AT26DF321 and AT25DF321 have the same ID. Both were just discovered by reading their IDs, that is, there is no probing by name. Thus only the first one (the AT25DF321) in the list was ever probed. Luckily, the AT25DF is also the newer series. Drop the AT26DF321. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-40-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit d3b5ea3cc5bacd66a251c0c7394b5d1f82de0f6b Author: Michael Walle Date: Fri Sep 8 12:16:57 2023 +0200 mtd: spi-nor: winbond: sort flash_info entries The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-39-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 1de410815768295c8ce3c0289d7fc29762e3ca76 Author: Michael Walle Date: Fri Sep 8 12:16:56 2023 +0200 mtd: spi-nor: sst: sort flash_info database The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-38-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 8770a6a89b15af072376fd4ccfb55ea1bda3821b Author: Michael Walle Date: Fri Sep 8 12:16:55 2023 +0200 mtd: spi-nor: spansion: sort flash_info database The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-37-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 9df3c9ac6ea63570c3c219c50b9d7b1df82dd21e Author: Michael Walle Date: Fri Sep 8 12:16:54 2023 +0200 mtd: spi-nor: micron-st: sort flash_info database The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-36-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit b0eea634d08677e578f352cd033f728778e795b5 Author: Michael Walle Date: Fri Sep 8 12:16:53 2023 +0200 mtd: spi-nor: macronix: sort flash_info database The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-35-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 947bb8f24b615fca5290aa13cebec323d43f8d11 Author: Michael Walle Date: Fri Sep 8 12:16:52 2023 +0200 mtd: spi-nor: issi: sort flash_info database The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-34-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 1d8e64f40b248e942813d06fd21c14029eaba982 Author: Michael Walle Date: Fri Sep 8 12:16:51 2023 +0200 mtd: spi-nor: gigadevice: sort flash_info database The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-33-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit bc16dfcbf27fb3bc184ce7bdfc44a56386304012 Author: Michael Walle Date: Fri Sep 8 12:16:50 2023 +0200 mtd: spi-nor: eon: sort flash_info database The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-32-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit a16ae25022d97eb49ac103084c0c6270b5f91d96 Author: Michael Walle Date: Fri Sep 8 12:16:49 2023 +0200 mtd: spi-nor: atmel: sort flash_info database The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-31-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 9e02cb5b1d09705db1a19ef20c5bfdd38237efca Author: Michael Walle Date: Fri Sep 8 12:16:48 2023 +0200 mtd: spi-nor: xmc: convert flash_info to new format The INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-30-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 8e52f54ca9946e0a67e2199a05ca68251de29a95 Author: Michael Walle Date: Fri Sep 8 12:16:47 2023 +0200 mtd: spi-nor: xilinx: use new macros in S3AN_INFO() There won't be any new entries, nor are the entries that much different and the very odd page and sector sizes make the new format hard to read. Therefore, convert the old S3AN_INFO() macro. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-29-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 348d772d04fa36d453587c8a9a2720c77eb242c9 Author: Michael Walle Date: Fri Sep 8 12:16:46 2023 +0200 mtd: spi-nor: winbond: convert flash_info to new format The INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-28-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 47541a60636a344090f24d580274ec7b2dc27926 Author: Michael Walle Date: Fri Sep 8 12:16:45 2023 +0200 mtd: spi-nor: sst: convert flash_info to new format The INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-27-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit bb2d5c67b926811ea8bab882f61cef0e660aa30e Author: Michael Walle Date: Fri Sep 8 12:16:44 2023 +0200 mtd: spi-nor: spansion: convert flash_info to new format The INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-26-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 8eb4eb838f9fd1aed84a3710e89d31570988e3ac Author: Michael Walle Date: Fri Sep 8 12:16:43 2023 +0200 mtd: spi-nor: micron-st: convert flash_info to new format The INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-25-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 09e5a29fa3ad5335c9a09afc5a4299d023c1a863 Author: Michael Walle Date: Fri Sep 8 12:16:42 2023 +0200 mtd: spi-nor: macronix: convert flash_info to new format The INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-24-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 856f61797cbcf801b174425d1659684d17af014e Author: Michael Walle Date: Fri Sep 8 12:16:41 2023 +0200 mtd: spi-nor: issi: convert flash_info to new format The INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-23-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 3de6404725df69d81913d563a6b86cb515ad0298 Author: Michael Walle Date: Fri Sep 8 12:16:40 2023 +0200 mtd: spi-nor: intel: convert flash_info to new format The INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-22-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 29cd12e08cd3f9474464737e53dd5d8c7f622b11 Author: Michael Walle Date: Fri Sep 8 12:16:39 2023 +0200 mtd: spi-nor: gigadevice: convert flash_info to new format The INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-21-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 6ecc52e44dbf6dc56196987b632c8ee4fc0e680a Author: Michael Walle Date: Fri Sep 8 12:16:38 2023 +0200 mtd: spi-nor: everspin: convert flash_info to new format The INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-20-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 5a329c40894b0047e44ceea45079975d550da914 Author: Michael Walle Date: Fri Sep 8 12:16:37 2023 +0200 mtd: spi-nor: esmt: convert flash_info to new format The INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-19-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit ca7fb359d0a1089d955ebc7d5fb7334c4bf198c7 Author: Michael Walle Date: Fri Sep 8 12:16:36 2023 +0200 mtd: spi-nor: eon: convert flash_info to new format The INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-18-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit f9d52efb3953ce38d589150bd87e13886394f985 Author: Michael Walle Date: Fri Sep 8 12:16:35 2023 +0200 mtd: spi-nor: atmel: convert flash_info to new format The INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-17-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit da7e48db514b2dfbf67e0c063fca0a00a34f4b6c Author: Michael Walle Date: Fri Sep 8 12:16:34 2023 +0200 mtd: spi-nor: remove or move flash_info comments Most of the comments are a relict of the past when the flash_info was just one table. Most of them are useless. Remove them. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-16-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 3e85be98875a568b762afd2e9bfd136e22106558 Author: Michael Walle Date: Fri Sep 8 12:16:33 2023 +0200 mtd: spi-nor: add SNOR_ID() and SNOR_OTP() After all the preparation, it is now time to introduce the new macros to specify flashes in our database: SNOR_ID() and SNOR_OTP(). An flash_info entry might now look like: { .id = SNOR_ID(0xef, 0x60, 0x16), .otp = SNOR_OTP(256, 3, 0x1000, 0x1000), .flags = SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB, } Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-15-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 83e62ffa7d1b7830bdeef59b993debb61366f83a Author: Michael Walle Date: Fri Sep 8 12:16:32 2023 +0200 mtd: spi-nor: rename .otp_org to .otp and make it a pointer Move the OTP ops out of the flash_info structure. Besides of saving some space, there will be a new macro SNOR_OTP() which can be used to set the ops: .otp = SNOR_OTP(...), Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-14-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 2d7f3a08875bc7045973fda487d6bf1ecb402e47 Author: Michael Walle Date: Fri Sep 8 12:16:31 2023 +0200 mtd: spi-nor: move the .id and .id_len into an own structure Create a new structure to hold a flash ID and its length. The goal is to have a new macro SNOR_ID() which can have a flexible id length. This way we can get rid of all the individual INFOx() macros. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-13-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 95c6e3d26691d9144bfa3cdb95962bdb24d98905 Author: Michael Walle Date: Fri Sep 8 12:16:30 2023 +0200 mtd: spi-nor: introduce (temporary) INFO0() The id will be converted to an own structure. To differentiate between flashes with and without IDs, introduce a temporary macro INFO0() and convert all flashes with no ID to use it. The difference between INFO0() and INFOx() is that the former, doesn't have a pointer to the id structure. Something which isn't possible to do within the INFOx() macro. After the flash_info conversion, that macro will be removed along with all the other INFOx() macros. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-12-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 3ea3f0ac242c86c0275d347ab8c92bf1eb854b49 Author: Michael Walle Date: Fri Sep 8 12:16:29 2023 +0200 mtd: spi-nor: drop .parse_sfdp Drop the size parameter to indicate we need to do SFDP, we can do that because it is guaranteed that the size will be set by SFDP and because PARSE_SFDP forced the SFDP parsing it must be overwritten. There is a (very tiny) chance that this might break block protection support: we now rely on the SFDP reported size of the flash for the BP calculation. OTOH, if the flash reports its size wrong, we are in bigger trouble than just having the BP calculation wrong. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-11-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 6dec24b1a34c0ba7b09a400b4dfdbf63318f60c0 Author: Michael Walle Date: Fri Sep 8 12:16:28 2023 +0200 mtd: spi-nor: make sector_size optional Most of the (old, non-SFDP) flashes use a sector size of 64k. Make that a default value so it can be optional in the flash_info database. As a preparation for conversion to the new database format, set the sector size to zero if the default value is used. This way, the actual change is happening with this patch ant not with a later conversion patch. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-10-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 9b6bb07eadaf2a98a86b6bc1ab4410c72d6ba572 Author: Michael Walle Date: Fri Sep 8 12:16:27 2023 +0200 mtd: spi-nor: push 4k SE handling into spi_nor_select_uniform_erase() 4k sector erase sizes are only a thing with uniform erase types. Push the "we want 4k erase sizes" handling into spi_nor_select_uniform_erase(). One might wonder why the former sector_size isn't used anymore. It is because we either search for the largest erase size or if selected through kconfig, the 4k erase size. Now, why is that correct? For this, we have to differentiate between (1) flashes with SFDP and (2) without SFDP. For (1), we just set one (or two if SECT_4K is set) erase types and wanted_size is exactly one of these. For (2) things are a bit more complicated. For flashes which we don't have in our flash_info database, the generic driver is used and sector_size was already 0, which in turn selected the largest erase size. For flashes which had SFDP and an entry in flash_info, sector_size was always the largest sector and thus the largest erase type. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-9-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit e255a79162b6fbf3c62f2883ef9ecd66feb10fb6 Author: Michael Walle Date: Fri Sep 8 12:16:26 2023 +0200 mtd: spi-nor: default .n_banks to 1 If .n_banks is not set in the flash_info database, the default value should be 1. This way, we don't have to always set the .n_banks parameter in flash_info. Signed-off-by: Michael Walle Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-8-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 9983e6da917d7a8e367be05be167b1eeb6c8f120 Author: Michael Walle Date: Fri Sep 8 12:16:25 2023 +0200 mtd: spi-nor: store .n_banks in struct spi_nor_flash_parameter First, fixups might want to replace the n_banks parameter, thus we need it in the (writable) parameter struct. Secondly, this way we can have a default in the core and just skip setting the n_banks in the flash_info database. Most of the flashes doesn't have more than one bank. Signed-off-by: Michael Walle Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-7-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit d0cfd228b34c125b76a9a7fd2d69ebf9ff7e5534 Author: Michael Walle Date: Fri Sep 8 12:16:24 2023 +0200 mtd: spi-nor: default page_size to 256 bytes The INFO() macro always set the page_size to 256 bytes. Make that an optional parameter. This default is a sane one for all older flashes, newer ones will set the page size by its SFDP tables anyway. Signed-off-by: Michael Walle Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-6-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 0554effe99f6e9383172b091a3c4c7fd1ed3ef58 Author: Michael Walle Date: Fri Sep 8 12:16:23 2023 +0200 mtd: spi-nor: convert .n_sectors to .size .n_sectors is rarely used. In fact it is only used in swp.c and to calculate the flash size in the core. The use in swp.c might be converted to use the (largest) flash erase size. For now, we just locally calculate the sector size. Simplify the flash_info database and set the size of the flash directly. This also let us use the SZ_x macros. Verified that there's no flash that specifies BP and sector size of zero to make sure we avoid a division by zero in spi_nor_get_min_prot_length_sr(). We'll protect from a possible division by zero in a further patch by introducing a default value for sector_size. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-5-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit afbfb8c5fb57db15b0e34ad01937a985b7160533 Author: Michael Walle Date: Fri Sep 8 12:16:22 2023 +0200 mtd: spi-nor: xilinx: remove addr_nbytes from S3AN_INFO() The default value of addr_nbytes is already 3. Drop it. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-4-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 74b7ad7683536de6d27e15f5cb0c2f1bebd1c375 Author: Michael Walle Date: Fri Sep 8 12:16:21 2023 +0200 mtd: spi-nor: xilinx: use SPI_NOR_ID() in S3AN_INFO() In commit 59273180299a ("mtd: spi-nor: Create macros to define chip IDs and geometries") SPI_NOR_ID() were introduced, but it did only update the INFO() macro in core.h. Also use it in S3AN_INFO(). Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-3-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit d9cd5c9a6fe26d544551cfaa94fb0abc50c0b895 Author: Michael Walle Date: Fri Sep 8 12:16:20 2023 +0200 mtd: spi-nor: remove Fujitsu MB85RS1MT support This part is not a flash but an EEPROM like FRAM. It is even has a DT binding for the (correct) driver (at25), see Documentation/devicetree/bindings/eeprom/at25.yaml. Just remove it. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-2-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 022545e057f395f470ca2731c2b61acb65cacaf8 Author: Michael Walle Date: Fri Sep 8 12:16:19 2023 +0200 mtd: spi-nor: remove catalyst 'flashes' CAT25xx are actually EEPROMs manufactured by Catalyst. The devices are ancient (DS are from 1998), there are not in-tree users, nor are there any device tree bindings. Remove it. The correct driver is the at25. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-1-e60548861b10@kernel.org Signed-off-by: Tudor Ambarus commit 6a23c555f7eb436d6799533675ffa179db3d5834 Author: Russell King (Oracle) Date: Mon Sep 18 14:25:36 2023 +0100 net: phy: fix regression with AX88772A PHY driver Marek reports that a deadlock occurs with the AX88772A PHY used on the ASIX USB network driver: asix 1-1.4:1.0 (unnamed net_device) (uninitialized): PHY [usb-001:003:10] driver [Asix Electronics AX88772A] (irq=POLL) Asix Electronics AX88772A usb-001:003:10: attached PHY driver(mii_bus:phy_addr=usb-001:003:10, irq=POLL) asix 1-1.4:1.0 eth0: register 'asix' at usb-12110000.usb-1.4, ASIX AX88772 USB 2.0 Ethernet, a2:99:b6:cd:11:eb asix 1-1.4:1.0 eth0: configuring for phy/internal link mode ============================================ WARNING: possible recursive locking detected 6.6.0-rc1-00239-g8da77df649c4-dirty #13949 Not tainted -------------------------------------------- kworker/3:3/71 is trying to acquire lock: c6c704cc (&dev->lock){+.+.}-{3:3}, at: phy_start_aneg+0x1c/0x38 but task is already holding lock: c6c704cc (&dev->lock){+.+.}-{3:3}, at: phy_state_machine+0x100/0x2b8 This is because we now consistently call phy_process_state_change() while holding phydev->lock, but the AX88772A PHY driver then goes on to call phy_start_aneg() which tries to grab the same lock - causing deadlock. Fix this by exporting the unlocked version, and use this in the PHY driver instead. Reported-by: Marek Szyprowski Tested-by: Marek Szyprowski Fixes: ef113a60d0a9 ("net: phy: call phy_error_precise() while holding the lock") Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/E1qiEFs-007g7b-Lq@rmk-PC.armlinux.org.uk Signed-off-by: Paolo Abeni commit c1ac8903f31f483089ef30546ed27a95d2a2fa35 Merge: 7890fce6201ae 510f276df2b91 Author: Wolfram Sang Date: Tue Sep 19 16:56:46 2023 +0200 Merge tag 'ib-mfd-i2c-reboot-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into i2c/for-mergewindow Immutable branch between MFD, I2C and Reboot due for the v6.7 merge window commit 1964aacfaed526c7faa4bdc8fedb0f24ff566bdd Author: Colin Ian King Date: Mon Sep 18 14:21:42 2023 +0100 net: dsa: microchip: Fix spelling mistake "unxpexted" -> "unexpected" There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20230918132142.199638-1-colin.i.king@gmail.com Signed-off-by: Paolo Abeni commit 842a62a75e709b3efb5020a25a225fa51748c5f9 Author: Bard Liao Date: Tue Sep 19 16:32:09 2023 +0800 ASoC: hdac_hda: add HDA patch loader support HDA patch loader is supported by legacy HDA driver. Implement it on ASoC HDA driver, too. Signed-off-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20230919083209.1919921-1-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 7b5300e90a781a37a058fce68dac0f7aaebf041b Author: Peter Ujfalusi Date: Tue Sep 19 13:42:26 2023 +0300 ASoC: SOF: Drop unused IPC type defines The SOF stack now uses the generic names for the IPC type, the defines can be dropped. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230919104226.32239-10-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 0f7e753fc3851aac8aeea6b551cbbcf6ca9093dd Author: Peter Ujfalusi Date: Tue Sep 19 13:42:25 2023 +0300 ASoC: SOF: mediatek: Use generic names for IPC types Use the new SOF_IPC_TYPE_3 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230919104226.32239-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit a8fffb94475fbcced74527a20182741b5ef3e5d4 Author: Peter Ujfalusi Date: Tue Sep 19 13:42:24 2023 +0300 ASoC: SOF: Intel: Use generic names for IPC types Use the new SOF_IPC_TYPE_3, SOF_IPC_TYPE_4 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230919104226.32239-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 6a645a5537619e43a8561462d5a8dd2cc74d26b6 Author: Peter Ujfalusi Date: Tue Sep 19 13:42:23 2023 +0300 ASoC: SOF: imx: Use generic names for IPC types Use the new SOF_IPC_TYPE_3 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230919104226.32239-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 3104c3267e95aec0e3bb41c4f13ae7b1703ad3f9 Author: Peter Ujfalusi Date: Tue Sep 19 13:42:22 2023 +0300 ASoC: SOF: amd: Use generic names for IPC types Use the new SOF_IPC_TYPE_3 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230919104226.32239-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit ebe18b1587aa548df09875c372ebb66e63cd5141 Author: Peter Ujfalusi Date: Tue Sep 19 13:42:21 2023 +0300 ASoC: SOF: Use generic names for IPC types Use the new SOF_IPC_TYPE_3, SOF_IPC_TYPE_4 in core code. No functional changes, just renaming. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230919104226.32239-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 82f4b383829322a19f91159cdfdaf6437f56dec6 Author: Peter Ujfalusi Date: Tue Sep 19 13:42:20 2023 +0300 ASoC: SOF: Kconfig: Rename SND_SOC_SOF_INTEL_IPC4 to SND_SOC_SOF_IPC4 Drop the Intel from the IPC type Kconfig option Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230919104226.32239-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 1dff26582677849684204f3231cc7cdcb49fdb9a Author: Peter Ujfalusi Date: Tue Sep 19 13:42:19 2023 +0300 ASoC: SOF: sof-pci-dev: Update the ipc_type module parameter description Clarify the description of the ipc_type module parameter and drop the Intel CAVS in favor of IPC4. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230919104226.32239-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 6974f2cd2fa94fef663133af23722cf607853e22 Author: Peter Ujfalusi Date: Tue Sep 19 13:42:18 2023 +0300 ASoC: SOF: Introduce generic names for IPC types Change the enum names for the IPC types to be more descriptive and drop tying the IPC4 to Intel SoCs. Add defines to avoid build breakage while the related code is modified to use the new enum names. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230919104226.32239-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit aa7627111c689f9dc2458c7dd9c1fbb554502664 Author: Charles Keepax Date: Tue Sep 19 11:31:12 2023 +0100 ASoC: dt-bindings: ASoC: cirrus,cs42l43: Update a couple of default values The bias sense is being enabled by default in the driver, and the default detect time is being dropped slightly. Update the binding document to match. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20230919103116.580305-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 6388a0619c83625214e98377c32bcefa4fffb9cd Author: Charles Keepax Date: Tue Sep 19 11:31:16 2023 +0100 ASoC: cs42l43: Extend timeout on bias sense timeout For very slow removals the current bias sense timeout is sometimes too short and unclamps the mic bias before the jack removal is properly detected by the tip detect, causing a pop. As bias sense should be tuned to deliver very few false positives, increase the timeout fairly dramatically to cover all but the most exaggerated removals. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20230919103116.580305-6-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 1e4ce0d5c023e8d8663f6b79b98b9f8026776127 Author: Charles Keepax Date: Tue Sep 19 11:31:15 2023 +0100 ASoC: cs42l43: Move headset bias sense enable earlier in process Currently the bias sense is enabled along with the button detect, but this has two problems. Firstly, the detections themselves arn't covered by the bias sense, potentially resulting in pops and secondly, the sequence of enabling/disabling looks like: enable bias enable bias sense disable bias sense disable bias When the bias sense is disabled but the bias is still on the clamp is removed and a pop results. Fix both of these issues by moving the bias sense enable/disable to be along with the bias itself. With a resulting sequence of: enable bias sense enable bias disable bias disable bias sense Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20230919103116.580305-5-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 9c0ccc9f8e3be79ab44f5f8034ef90c367caf06f Author: Charles Keepax Date: Tue Sep 19 11:31:14 2023 +0100 ASoC: cs42l43: Enable bias sense by default Improve the default pop performance on jack removal by enabling bias sense on the least sensitive level by default. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20230919103116.580305-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 686b8f711b990d895d39dee3fab88861917d2dc4 Author: Charles Keepax Date: Tue Sep 19 11:31:13 2023 +0100 ASoC: cs42l43: Lower default type detect time The current default is a little excessive, reduce the pop on insertion by reducing the time a little. The new value of 1000uS is still pretty conservative. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20230919103116.580305-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 07a866a41982c896dc46476f57d209a200602946 Author: Peter Ujfalusi Date: Tue Sep 19 13:31:15 2023 +0300 ASoC: SOF: ipc4-control: Add support for ALSA enum control Enum controls use generic param_id and a generic struct where the data is passed to the firmware. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230919103115.30783-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 4a2fd607b7ca6128ee3532161505da7624197f55 Author: Peter Ujfalusi Date: Tue Sep 19 13:31:14 2023 +0300 ASoC: SOF: ipc4-control: Add support for ALSA switch control Volume controls with a max value of 1 are switches. Switch controls use generic param_id and a generic struct where the data is passed to the firmware. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230919103115.30783-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 060a07cd9bc69eba2da33ed96b1fa69ead60bab1 Author: Peter Ujfalusi Date: Tue Sep 19 13:31:13 2023 +0300 ASoC: SOF: ipc4-topology: Add definition for generic switch/enum control Currently IPC4 has no notion of a switch or enum type of control which is a generic concept in ALSA. The generic support for these control types will be as follows: - large config is used to send the channel-value par array - param_id of a SWITCH type is 200 - param_id of an ENUM type is 201 Each module need to support a switch or/and enum must handle these universal param_ids. The message payload is described by struct sof_ipc4_control_msg_payload. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230919103115.30783-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit c1c48fd6bbe788458e3685fea74bdb3cb148ff93 Author: Rander Wang Date: Tue Sep 19 12:24:16 2023 +0300 ASoC: SOF: ipc4: handle EXCEPTION_CAUGHT notification from firmware Driver will receive exception IPC message and process it by snd_sof_dsp_panic. Signed-off-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230919092416.4137-10-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit eb6e5dab11401c64f5d5576c71e5fc0a4c7b321a Author: Rander Wang Date: Tue Sep 19 12:24:15 2023 +0300 ASoC: SOF: Intel: hda: add ipc4 FW panic support on CAVS 2.5+ platforms Get the FW panic information from telemetry data in memory window and dump it to kernel log. The old platforms before CAVS 2.5+ don't support it since there is no support in FW for them. Signed-off-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230919092416.4137-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit e449b18ff03c2f90430d00486fd713854b28c077 Author: Rander Wang Date: Tue Sep 19 12:24:14 2023 +0300 ASoC: SOF: Intel: mtl: dump dsp stack Dump dsp stack with sof_ipc4_intel_dump_telemetry_state since dsp stack information is included by telemetry data. This also supports lnl since the mtl code is reused. Signed-off-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230919092416.4137-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit c8b54a2f7af41740b5faad2f6846d927b14369ca Author: Rander Wang Date: Tue Sep 19 12:24:13 2023 +0300 ASoC: SOF: Intel: add telemetry retrieval support on Intel platforms Telemetry data is decoded based on intel xtensa design and printed in kernel log by sof debug framework. Signed-off-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230919092416.4137-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 80b567f8995757d36008f835853cea8d2f7c34c0 Author: Rander Wang Date: Tue Sep 19 12:24:12 2023 +0300 ASoC: SOF: ipc4: add exception node in sof debugfs directory The exception node is created when FW is ready and clear to zero when FW post boot. Signed-off-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230919092416.4137-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit ab05061d25806515358d184eb4d305f7f12befdc Author: Rander Wang Date: Tue Sep 19 12:24:11 2023 +0300 ASoC: SOF: ipc4: add definition of telemetry slot for exception handling Core dump includes hardware platform information, cpu registers and exception call stack. FW saves core dump to telemetry slot in shared memory window for host in the event of FW exception. This patch creates exception node in debugfs for user to dump telemetry data. Signed-off-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230919092416.4137-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit a397899f81d52202265d4977a99085f53e426826 Author: Rander Wang Date: Tue Sep 19 12:24:10 2023 +0300 ASoC: SOF: ipc4: add a helper function to search debug slot Currently IPC4 supports GDB slot, telemetry slot and debug slot. This helper function will be used to get the slot offset in debug windows for further processing. Signed-off-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230919092416.4137-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 4287205065f244f4d40ae6aa7875b3ebffedcf8d Author: Rander Wang Date: Tue Sep 19 12:24:09 2023 +0300 ASoC: SOF: ipc4-mtrace: move debug slot related definitions to header.h The macro definitions of debug slot can be used by gdb, telemetry and mtrace log, so move these definitions to header.h from mtrace. Then these macro definitions can be shared Signed-off-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230919092416.4137-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 58bb5081cba130f12c26d8e4d5e9416a0272f07e Author: Rander Wang Date: Tue Sep 19 12:24:08 2023 +0300 ASoC: SOF: Xtensa: dump ar registers to restore call stack On Xtensa platform ar0 is for caller address and ar1 is for stack address. The ar register dump can be used to rebuild call stack with FW elf file by debug tools. Signed-off-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230919092416.4137-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 05fe62842804d644d986cb248ca871335b2628af Author: Chao Song Date: Tue Sep 19 10:00:11 2023 +0800 ASoC: Intel: soc-acpi-intel-mtl-match: add acpi match table for cdb35l56-eight-c This patch adds acpi match table for cdb35l56-eight-c AIC board from Cirrus Logic. The codec layout is configured as: - Link0: CS42L43 Jack - Link1: 2x CS35L56 Speaker - Link2: 2x CS35L56 Speaker Signed-off-by: Chao Song Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230919020011.1896041-3-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 06d94b43fc39af16d3d74a93d27ee92902b56bc6 Author: Bard Liao Date: Tue Sep 19 10:00:10 2023 +0800 ASoC: intel: sof_sdw: Add CS42L43 CODEC support Add support for the Cirrus Logic CS42L43 using SoundWire. Signed-off-by: Lucas Tanure Signed-off-by: Charles Keepax Signed-off-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230919020011.1896041-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit f1d6a6b991ef9864dec6437ecf8162dc2ec42260 Author: Alexander Stein Date: Mon Apr 24 10:21:08 2023 +0200 arm64: dts: imx8qxp: add adma_pwm in adma Add PWM device and the corresponding clock gating device in adma subsystem. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 474d9f32766a104fc8703c9a76815769139edd60 Author: GuokaiXu Date: Mon Sep 4 10:32:36 2023 +0800 iommufd: Fix spelling errors in comments requres -> requires dramtically -> dramatically Link: https://lore.kernel.org/r/31680D47D9533D91+20230904023236.GA12494@xgk8823 Signed-off-by: GuokaiXu Signed-off-by: Jason Gunthorpe commit 99441a38c391b1115e405d1f47ede237fca37f1b Author: Heiko Carstens Date: Mon Sep 11 21:40:13 2023 +0200 s390: use control register bit defines Use control register bit defines instead of plain numbers where possible. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 9c66cc5609b13899ef7d143f51c59bdcfd63484d Author: Heiko Carstens Date: Mon Sep 11 21:40:12 2023 +0200 s390/ctlreg: add control register bits Instead of having only masks for specific bit locations within control registers, also define the bit numbers and use them to define the masks. The bit defines can be used to convert plain numbers to defines. Acked-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit da290f4382eb98e152af59e416a08d43a5c31157 Author: Heiko Carstens Date: Mon Sep 11 21:40:11 2023 +0200 s390/irq: use CR0 defines to define CR0_IRQ_SUBCLASS_MASK Use existing CR0 defines to define CR0_IRQ_SUBCLASS_MASK instead of open-coding the defines again. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 4f4cee9619edc877e8da913193968497e4e42cee Author: Heiko Carstens Date: Mon Sep 11 21:40:10 2023 +0200 s390/ctlreg: add missing defines Add a couple of missing control register defines which otherwise would prevent to convert other open-coded usages. Acked-by: Thomas Richter Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 0b6529e3dc1c60565f10ccf40533b127ab3262a1 Author: Heiko Carstens Date: Mon Sep 11 21:40:09 2023 +0200 s390/setup: make use of system_ctl_load() Use system_ctl_load() instead of local_ctl_load() to reflect that control register changes are supposed to be global. Even though setup_cr() was ok, note that the usage of local_ctl_load() would have been wrong, if it would have happened after the control register save area was initialized: only local control register contents would have been changed, but wouldn't be used for new CPUs. With using system_ctl_load() the caller doesn't need to take care. Signed-off-by: Heiko Carstens Reviewed-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 305a5551af34e1848d80e095c23e94c985cc4ebc Author: Heiko Carstens Date: Mon Sep 11 21:40:08 2023 +0200 s390/ctlreg: add system_ctl_load() Add system_ctl_load() which can be used to load a value to a control register system wide. Refactor system_ctl_set_clear_bit() so it can handle all different request types, and also rename it to system_ctlreg_modify() Signed-off-by: Heiko Carstens Reviewed-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 103dde702d698c2e17529550650407a386711cdf Author: Heiko Carstens Date: Mon Sep 11 21:40:07 2023 +0200 s390/early: use system_ctl_set_bit() instead of local_ctl_set_bit() Use system_ctl_set_bit() instead of local_ctl_set_bit() to reflect that the control register changes are supposed to be global. This change is just for documentation purposes, since it still results only in local control register contents being changed. Signed-off-by: Heiko Carstens Reviewed-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit cce2c8606f8ed3b0285842f4ad21e906d511dba1 Author: Heiko Carstens Date: Mon Sep 11 21:40:06 2023 +0200 s390/ctlreg: allow to call system_ctl_set/clear_bit() early Allow to call system_ctl_set_bit() and system_clt_clear_bit() early, so that users do not have to take care when the control register save area has been initialized. Users are supposed to use system_ctl_set_bit() and system:clt_clear_bit() for all control register changes which are supposed to be seen globally. Depending on the system state such calls will change: - local control register contents - save area and local control register contents - save area and global control register contents Signed-off-by: Heiko Carstens Reviewed-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit d11d5c8c8426a4abdcb2252999f1b57e3aa79e5b Author: Heiko Carstens Date: Mon Sep 11 21:40:05 2023 +0200 s390/ctltreg: make initialization of control register save area explicit Commit e1b9c2749af0 ("s390/smp: ensure global control register contents are in sync") made the control register save area contained within the lowcore at absolute address zero a resource which is used when initializing CPUs. However this is anything but obvious from the code. Add an ctlreg_init_save_area() function in order to make this explicit. Signed-off-by: Heiko Carstens Reviewed-by: Alexander Gordeev Signed-off-by: Vasily Gorbik commit 527618abb92793b9d4dba548d55822dcebd95317 Author: Heiko Carstens Date: Mon Sep 11 21:40:04 2023 +0200 s390/ctlreg: add struct ctlreg Add struct ctlreg to enforce strict type checking / usage for control register functions. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit ecc53818f60447177e24ea11b7f136c405150976 Author: Heiko Carstens Date: Mon Sep 11 21:40:03 2023 +0200 s390/ctlreg: add type checking to __local_ctl_load() and __local_ctl_store() Add type checking to __local_ctl_load() and __local_ctl_store(). For both functions enforce to pass an array consisting of unsigned longs. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 4b440e01da51da0cc651c06a036b8914b7b61ccf Author: Heiko Carstens Date: Mon Sep 11 21:40:02 2023 +0200 s390/kprobes,ptrace: open code struct per_reg Open code struct per_regs within kprobes and ptrace code, since at both locations a struct per_regs is passed to __local_ctl_load() and __local_ctl_store() which prevents to implement type checking for both functions. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 80725978260ff823e1c442e75d66cf1b61684bba Author: Heiko Carstens Date: Mon Sep 11 21:40:01 2023 +0200 s390/ctlreg: change parameters of __local_ctl_load() and __local_ctl_store() Change __local_ctl_load() and __local_ctl_store(), so that control register parameters come first. This way all control handling functions consistently have control register(s) parameter first. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 2372d391421350e318c98844d21ab9ad16e3eac0 Author: Heiko Carstens Date: Mon Sep 11 21:40:00 2023 +0200 s390/ctlreg: use local_ctl_load() and local_ctl_store() where possible Convert all single control register usages of __local_ctl_load() and __local_ctl_store() to local_ctl_load() and local_ctl_store(). This also requires to change the type of some struct lowcore members from __u64 to unsigned long. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit dfa33ce1245a4b88402947fa0a847e179044d2fc Author: Heiko Carstens Date: Mon Sep 11 21:39:59 2023 +0200 s390/ctlreg: add local_ctl_load() and local_ctl_store() Add local_ctl_load() and local_ctl_store() which load and store contents for only a single control register. This allows for easier to read code, but also better type checking, since __local_ctl_load() and __local_ctl_store() do not come with any type checking at all (which will be changed with subsequent patches). Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 8d5e98f8d6b11dd0e61323ece3b7ccceea55c281 Author: Heiko Carstens Date: Mon Sep 11 21:39:58 2023 +0200 s390/ctlreg: add local and system prefix to some functions Add local and system prefix to some functions to clarify they change control register contents on either the local CPU or the on all CPUs. This results in the following API: Two defines which load and save multiple control registers. The defines correlate with the following C prototypes: void __local_ctl_load(unsigned long *, unsigned int cr_low, unsigned int cr_high); void __local_ctl_store(unsigned long *, unsigned int cr_low, unsigned int cr_high); Two functions which locally set or clear one bit for a specified control register: void local_ctl_set_bit(unsigned int cr, unsigned int bit); void local_ctl_clear_bit(unsigned int cr, unsigned int bit); Two functions which set or clear one bit for a specified control register on all CPUs: void system_ctl_set_bit(unsigned int cr, unsigned int bit); void system_ctl_clear_bit(unsigend int cr, unsigned int bit); Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit a74e4fc168d284e1e4e7296f8cf4b884035ebd45 Author: Heiko Carstens Date: Mon Sep 11 21:39:57 2023 +0200 s390/ctlreg: cleanup inline assemblies Use symbolic names for operands, remove typedefs, and slightly refactor the code. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit ebe1cd530fb2f6450656758bd904cfb5767f8d33 Author: Heiko Carstens Date: Mon Sep 11 21:39:56 2023 +0200 s390/ctlreg: rename ctl_reg.h to ctlreg.h Rename ctl_reg.h to ctlreg.h so it matches not only ctlreg.c but also other control register related function, union, and structure names, which all come with a ctlreg prefix. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 0c4d01f3952911b766e6394e0053146c24c98357 Author: Heiko Carstens Date: Mon Sep 11 21:39:55 2023 +0200 s390/ctlreg: move control register code to separate file Control register handling has nothing to do with low level SMP code. Move it to a separate file. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit aa36d433b79657c1fed31ff5ae2bbd6f7bc123aa Author: Heiko Carstens Date: Mon Sep 11 13:03:00 2023 +0200 s390/setup: use strlcat() instead of strcat() Use strlcat() instead of strcat() in order to get rid of this W=1 warning: In function ‘strlcat’, inlined from ‘strcat’ at ./include/linux/fortify-string.h:432:6, inlined from ‘setup_zfcpdump’ at arch/s390/kernel/setup.c:308:2, inlined from ‘setup_arch’ at arch/s390/kernel/setup.c:1002:2: ./include/linux/fortify-string.h:406:19: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 406 | p[actual] = '\0'; | ~~~~~~~~~~^~~~~~ As stated in fortify-string.h strcat() should not be used, since FORTIFY_SOURCE cannot figure out the size of the destination buffer. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 3570ee046c46b5dc3d077e3e60616b141a221027 Author: Ilya Leoshkevich Date: Mon Jul 31 17:07:11 2023 +0200 s390/smp: keep the original lowcore for CPU 0 Now that CPU 0 is not hotpluggable, it is not necessary to support freeing its stacks. Delete all the code that migrates it to new stacks and a new lowcore. Suggested-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 496bb034f4ff4866452ced7fdfaa4a0736230bdf Author: Tobias Huschle Date: Wed Aug 16 09:28:20 2023 +0200 s390/smp: disallow CPU hotplug of CPU 0 On s390, CPU 0 has special properties in comparison to other CPUs, as it cannot be deconfigured for example. Therefore, allowing to hotplug CPU 0 introduces additional complexity when handling these properties. Disallowing to hotplug CPU 0 allows to remove such complexities. This follows x86 which also prevents offlining of CPU0 since commit e59e74dc48a3 ("x86/topology: Remove CPU0 hotplug option"). [hca@linux.ibm.com: changed commit message] Suggested-by: Heiko Carstens Signed-off-by: Tobias Huschle Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 4a1725281fc5b0009944b1c0e1d2c1dc311a09ec Author: Heiko Carstens Date: Tue Sep 5 15:49:37 2023 +0200 s390/smp,mcck: fix early IPI handling Both the external call as well as the emergency signal submask bits in control register 0 are set before any interrupt handler is registered. Change the order and first register the interrupt handler and only then enable the interrupts by setting the corresponding bits in control register 0. This prevents that the second part of the machine check handler for early machine check handling is not executed: the machine check handler sends an IPI to the CPU it runs on. If the corresponding interrupts are enabled, but no interrupt handler is present, the interrupt is ignored. Reviewed-by: Sven Schnelle Acked-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit f3cfb875d0fd5f4af40cbb992f436ad396f69a71 Author: Ingo Franzki Date: Thu Aug 31 17:36:43 2023 +0200 s390/zcrypt: update list of EP11 operation modes Add additional operation mode strings into the EP11 operation mode table. These strings are returned by sysfs entries /sys/devices/ap/cardxx/op_modes and /sys/devices/ap/cardxx/xx.yyyy/op_modes. Signed-off-by: Ingo Franzki Reviewed-by: Harald Freudenberger Signed-off-by: Vasily Gorbik commit c945e6f453a361b0e9daddd2be9c099d1b80d6f8 Author: Peter Lafreniere Date: Mon Sep 18 17:56:43 2023 +0000 powerpc/configs: Remove ReiserFS from defconfig ReiserFS has been deprecated for a year and a half, yet is still built as part of a defconfig kernel. According to commit eb103a51640e ("reiserfs: Deprecate reiserfs"), the filesystem is slated to be removed in 2025. Remove it from the defconfig profiles now, as part of its deprecation process. Signed-off-by: Peter Lafreniere Signed-off-by: Michael Ellerman Link: https://msgid.link/20230918175529.19011-3-peter@n8pjl.ca commit 6fcb13972bc2b41211e1dddb02f5e73199addc75 Author: Geert Uytterhoeven Date: Mon Sep 18 12:14:44 2023 +0200 powerpc: Replace GPL 2.0+ README.legal boilerplate with SPDX Upstream Linux never had a "README.legal" file, but it was present in early source releases of Linux/m68k. It contained a simple copyright notice and a link to a version of the "COPYING" file that predated the addition of the "only valid GPL version is v2" clause. Get rid of the references to non-existent files by replacing the boilerplate with SPDX license identifiers. Signed-off-by: Geert Uytterhoeven Acked-by: Michael Ellerman Signed-off-by: Michael Ellerman Link: https://msgid.link/d91725ff1ed5d4b6ba42474e2ebfeebe711cba23.1695031668.git.geert@linux-m68k.org commit c5930a1aa08aafe6ffe15b5d28fe875f88f6ac86 Author: Zhu Yanjun Date: Tue Sep 19 10:08:06 2023 +0800 RDMA/rtrs: Fix the problem of variable not initialized fully No functionality change. The variable which is not initialized fully will introduce potential risks. Signed-off-by: Zhu Yanjun Link: https://lore.kernel.org/r/20230919020806.534183-1-yanjun.zhu@intel.com Signed-off-by: Leon Romanovsky commit 0b8ef824eedef96f3423f61dde2629755707b168 Author: Shinas Rasheed Date: Sun Sep 17 23:56:21 2023 -0700 octeon_ep: restructured interrupt handlers Separated queue specific interrupts to register to individual msix-vectors instead of using a single generic interrupt handler on a single msix-vector. Signed-off-by: Shinas Rasheed Link: https://lore.kernel.org/r/20230918065621.2165449-1-srasheed@marvell.com Signed-off-by: Paolo Abeni commit aec42f36237b09e42eac39f6c74305aec02b4694 Author: Alexei Starovoitov Date: Tue Sep 19 02:25:20 2023 -0700 bpf: Remove unused variables. Remove unused prev_offset, min_size, krec_size variables. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309190634.fL17FWoT-lkp@intel.com/ Fixes: aaa619ebccb2 ("bpf: Refactor check_btf_func and split into two phases") Signed-off-by: Alexei Starovoitov commit 7890fce6201aed46d3576e3d641f9ee5c1f0e16f Author: Wolfram Sang Date: Wed Sep 6 22:00:23 2023 +0200 i2c: riic: avoid potential division by zero Value comes from DT, so it could be 0. Unlikely, but could be. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit 3c417c947c13f22e60a4c3e68a7219a134219925 Author: Wolfram Sang Date: Wed Sep 6 22:00:22 2023 +0200 i2c: rcar: remove open coded DIV_ROUND_CLOSEST It improves readability if we use the available helper. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit 47280af872367ead8202b8503083b0b4016b667b Author: Wolfram Sang Date: Wed Sep 6 22:00:21 2023 +0200 i2c: rcar: calculate divider instead of brute-forcing it Instead of trying all values, we can actually compute it as the comment suggests. It is unclear what the comment means with "involved", it works nicely. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit d72857907af04f47e6844544160be42b0ad56edd Author: Wolfram Sang Date: Wed Sep 6 22:00:20 2023 +0200 i2c: rcar: properly format a debug output Use proper types and spacing. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit be944ceb6761a6198f5df51c36fd91eb9e112704 Author: Wolfram Sang Date: Wed Sep 6 22:00:19 2023 +0200 i2c: rcar: avoid non-standard use of goto Kernel functions goto somewhere on error conditions. Using goto for the default path is irritating. Let's bail out on error instead and use a proper retval. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit 5bfdb4fbf348f9e1935a6e9c64e7f60cb913fb21 Author: Kumar Kartikeya Dwivedi Date: Mon Sep 18 17:52:33 2023 +0200 bpf: Disable exceptions when CONFIG_UNWINDER_FRAME_POINTER=y The build with CONFIG_UNWINDER_FRAME_POINTER=y is broken for current exceptions feature as it assumes ORC unwinder specific fields in the unwind_state. Disable exceptions when frame_pointer unwinder is enabled for now. Fixes: fd5d27b70188 ("arch/x86: Implement arch_bpf_stack_walk") Reported-by: Eric Dumazet Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230918155233.297024-4-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 7d3460632da2c2ad5c5708db82a0b72e2b66396c Author: Kumar Kartikeya Dwivedi Date: Mon Sep 18 17:52:32 2023 +0200 bpf: Fix bpf_throw warning on 32-bit arch On 32-bit architectures, the pointer width is 32-bit, while we try to cast from a u64 down to it, the compiler complains on mismatch in integer size. Fix this by first casting to long which should match the pointer width on targets supported by Linux. Fixes: ec5290a178b7 ("bpf: Prevent KASAN false positive with bpf_throw") Reported-by: Matthieu Baerts Signed-off-by: Kumar Kartikeya Dwivedi Tested-by: Matthieu Baerts Link: https://lore.kernel.org/r/20230918155233.297024-3-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 4d84dcc739d5b253096f9e47957c5964709f5772 Author: Kumar Kartikeya Dwivedi Date: Mon Sep 18 17:52:31 2023 +0200 selftests/bpf: Print log buffer for exceptions test only on failure Alexei reported seeing log messages for some test cases even though we just wanted to match the error string from the verifier. Move the printing of the log buffer to a guarded condition so that we only print it when we fail to match on the expected string in the log buffer, preventing unneeded output when running the test. Reported-by: Alexei Starovoitov Fixes: d2a93715bfb0 ("selftests/bpf: Add tests for BPF exceptions") Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230918155233.297024-2-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit f78ca48a8ba9cdec96e8839351e49eec3233b177 Author: Heiner Kallweit Date: Sat Sep 9 22:25:06 2023 +0200 i2c: i801: fix potential race in i801_block_transaction_byte_by_byte Currently we set SMBHSTCNT_LAST_BYTE only after the host has started receiving the last byte. If we get e.g. preempted before setting SMBHSTCNT_LAST_BYTE, the host may be finished with receiving the byte before SMBHSTCNT_LAST_BYTE is set. Therefore change the code to set SMBHSTCNT_LAST_BYTE before writing SMBHSTSTS_BYTE_DONE for the byte before the last byte. Now the code is also consistent with what we do in i801_isr_byte_done(). Reported-by: Jean Delvare Closes: https://lore.kernel.org/linux-i2c/20230828152747.09444625@endymion.delvare/ Cc: stable@vger.kernel.org Acked-by: Andi Shyti Signed-off-by: Heiner Kallweit Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit e23edc86b09df655bf8963bbcb16647adc787395 Author: Ingo Molnar Date: Tue Sep 19 10:38:21 2023 +0200 sched/fair: Rename check_preempt_curr() to wakeup_preempt() The name is a bit opaque - make it clear that this is about wakeup preemption. Also rename the ->check_preempt_curr() methods similarly. Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra (Intel) commit 82845683ca6a15fe8c7912c6264bb0e84ec6f5fb Author: Ingo Molnar Date: Tue Sep 19 10:31:15 2023 +0200 sched/fair: Rename check_preempt_wakeup() to check_preempt_wakeup_fair() Other scheduling classes already postfix their similar methods with the class name. Signed-off-by: Ingo Molnar Acked-by: Peter Zijlstra (Intel) commit 20a02837fb5e162764828f6ec1b1f75a5de3fca4 Author: Zhu Yanjun Date: Tue Sep 19 15:37:27 2023 +0800 RDMA/rtrs: Require holding rcu_read_lock explicitly No functional change. The function get_next_path_rr needs to hold rcu_read_lock. As such, if no rcu read lock, warnings will pop out. Acked-by: Jack Wang Signed-off-by: Zhu Yanjun Link: https://lore.kernel.org/r/20230919073727.540207-1-yanjun.zhu@intel.com Signed-off-by: Leon Romanovsky commit 81760bedc65194ff38e1e4faefd5f9f0c95c19a4 Author: Gustavo A. R. Silva Date: Sun Sep 17 15:21:36 2023 -0600 RDMA/core: Use size_{add,sub,mul}() in calls to struct_size() If, for any reason, the open-coded arithmetic causes a wraparound, the protection that `struct_size()` provides against potential integer overflows is defeated. Fix this by hardening calls to `struct_size()` with `size_add()`, `size_sub()` and `size_mul()`. Fixes: 467f432a521a ("RDMA/core: Split port and device counter sysfs attributes") Fixes: a4676388e2e2 ("RDMA/core: Simplify how the gid_attrs sysfs is created") Fixes: e9dd5daf884c ("IB/umad: Refactor code to use cdev_device_add()") Fixes: 324e227ea7c9 ("RDMA/device: Add ib_device_get_by_netdev()") Fixes: 5aad26a7eac5 ("IB/core: Use struct_size() in kzalloc()") Signed-off-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/ZQdt4NsJFwwOYxUR@work Signed-off-by: Leon Romanovsky commit 796a35f19400bab757b4325e05ec4333d27028fa Author: Tinghan Shen Date: Fri Sep 1 16:09:23 2023 +0800 arm64: dts: mediatek: Update the node name of SCP rpmsg subnode Align the node name with the definition in SCP bindings. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Acked-by: Matthias Brugger Link: https://lore.kernel.org/r/20230901080935.14571-3-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit ede72dca45b1893f3e9236b6ad6c4e790db232f6 Author: Ian Rogers Date: Thu Sep 14 09:40:28 2023 -0700 perf parse-events: Fix tracepoint name memory leak Fuzzing found that an invalid tracepoint name would create a memory leak with an address sanitizer build: ``` $ perf stat -e '*:o/' true event syntax error: '*:o/' \___ 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 ================================================================= ==59380==ERROR: LeakSanitizer: detected memory leaks Direct leak of 4 byte(s) in 2 object(s) allocated from: #0 0x7f38ac07077b in __interceptor_strdup ../../../../src/libsanitizer/asan/asan_interceptors.cpp:439 #1 0x55f2f41be73b in str util/parse-events.l:49 #2 0x55f2f41d08e8 in parse_events_lex util/parse-events.l:338 #3 0x55f2f41dc3b1 in parse_events_parse util/parse-events-bison.c:1464 #4 0x55f2f410b8b3 in parse_events__scanner util/parse-events.c:1822 #5 0x55f2f410d1b9 in __parse_events util/parse-events.c:2094 #6 0x55f2f410e57f in parse_events_option util/parse-events.c:2279 #7 0x55f2f4427b56 in get_value tools/lib/subcmd/parse-options.c:251 #8 0x55f2f4428d98 in parse_short_opt tools/lib/subcmd/parse-options.c:351 #9 0x55f2f4429d80 in parse_options_step tools/lib/subcmd/parse-options.c:539 #10 0x55f2f442acb9 in parse_options_subcommand tools/lib/subcmd/parse-options.c:654 #11 0x55f2f3ec99fc in cmd_stat tools/perf/builtin-stat.c:2501 #12 0x55f2f4093289 in run_builtin tools/perf/perf.c:322 #13 0x55f2f40937f5 in handle_internal_command tools/perf/perf.c:375 #14 0x55f2f4093bbd in run_argv tools/perf/perf.c:419 #15 0x55f2f409412b in main tools/perf/perf.c:535 SUMMARY: AddressSanitizer: 4 byte(s) leaked in 2 allocation(s). ``` Fix by adding the missing destructor. Fixes: 865582c3f48e ("perf tools: Adds the tracepoint name parsing support") Signed-off-by: Ian Rogers Cc: He Kuang Link: https://lore.kernel.org/r/20230914164028.363220-1-irogers@google.com Signed-off-by: Namhyung Kim commit b4f48f34f9c195e8e82b31ecd8202445962c734b Author: Ian Rogers Date: Thu Sep 14 14:19:48 2023 -0700 perf test: Detect off-cpu support from build options Use perf version to detect whether BPF skeletons were enabled in a build rather than a failing perf record. Signed-off-by: Ian Rogers Tested-by: Namhyung Kim Cc: James Clark Cc: Mark Rutland Cc: Nick Terrell Cc: Patrice Duroux Cc: Nick Desaulniers Cc: Andrii Nakryiko Cc: Nathan Chancellor Cc: Kajol Jain Cc: Athira Rajeev Cc: Tiezhu Yang Cc: Tom Rix Cc: llvm@lists.linux.dev Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230914211948.814999-6-irogers@google.com Signed-off-by: Namhyung Kim commit c2ac838ef734cb0ff351820b77acc6fd3b6634fb Author: Ian Rogers Date: Thu Sep 14 14:19:47 2023 -0700 perf test: Ensure EXTRA_TESTS is covered in build test Add to run variable. Signed-off-by: Ian Rogers Tested-by: Namhyung Kim Cc: James Clark Cc: Nick Terrell Cc: Patrice Duroux Cc: Nick Desaulniers Cc: Andrii Nakryiko Cc: Nathan Chancellor Cc: Kajol Jain Cc: Athira Rajeev Cc: Tiezhu Yang Cc: Tom Rix Cc: llvm@lists.linux.dev Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230914211948.814999-5-irogers@google.com Signed-off-by: Namhyung Kim commit c67c631d52f017c2c4795e024ea6aaf3a092ce9e Author: Ian Rogers Date: Thu Sep 14 14:19:46 2023 -0700 perf test: Update build test for changed BPF skeleton defaults Fix a target name and set BUILD_BPF_SKEL to 0 rather than 1. Signed-off-by: Ian Rogers Tested-by: Namhyung Kim Cc: James Clark Cc: Nick Terrell Cc: Patrice Duroux Cc: Nick Desaulniers Cc: Andrii Nakryiko Cc: Nathan Chancellor Cc: Kajol Jain Cc: Athira Rajeev Cc: Tiezhu Yang Cc: Tom Rix Cc: llvm@lists.linux.dev Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230914211948.814999-4-irogers@google.com Signed-off-by: Namhyung Kim commit 9925495d96efc14d885ba66c5696f664fe0e663c Author: Ian Rogers Date: Thu Sep 14 14:19:45 2023 -0700 perf build: Default BUILD_BPF_SKEL, warn/disable for missing deps LIBBPF is dependent on zlib so move the NO_ZLIB and feature check early to avoid statically building when zlib is disabled. This avoids a linkage failure with perf and static libbpf when zlib isn't specified. Move BUILD_BPF_SKEL logic to one place and if not defined set BUILD_BPF_SKEL to 1. Detect dependencies of building with BPF skeletons and warn/disable if the dependencies aren't present. Change Makefile.perf to contain BPF skeleton logic dependent on the Makefile.config result and refresh the comment about BUILD_BPF_SKEL. Signed-off-by: Ian Rogers Tested-by: Namhyung Kim Cc: James Clark Cc: Nick Terrell Cc: Patrice Duroux Cc: Nick Desaulniers Cc: Andrii Nakryiko Cc: Nathan Chancellor Cc: Kajol Jain Cc: Athira Rajeev Cc: Tiezhu Yang Cc: Tom Rix Cc: llvm@lists.linux.dev Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230914211948.814999-3-irogers@google.com Signed-off-by: Namhyung Kim commit 727e43143737431fa973a0051e9cf644e3f110fe Author: Ian Rogers Date: Thu Sep 14 14:19:44 2023 -0700 perf version: Add status of bpf skeletons Add status for BPF skeletons, to see if a build has them enabled: ``` $ perf version --build-options perf version 6.6.rc1.g0381ae36d1a6 dwarf: [ OFF ] # HAVE_DWARF_SUPPORT dwarf_getlocations: [ OFF ] # HAVE_DWARF_GETLOCATIONS_SUPPORT syscall_table: [ on ] # HAVE_SYSCALL_TABLE_SUPPORT libbfd: [ OFF ] # HAVE_LIBBFD_SUPPORT debuginfod: [ OFF ] # HAVE_DEBUGINFOD_SUPPORT libelf: [ OFF ] # HAVE_LIBELF_SUPPORT libnuma: [ OFF ] # HAVE_LIBNUMA_SUPPORT numa_num_possible_cpus: [ OFF ] # HAVE_LIBNUMA_SUPPORT libperl: [ on ] # HAVE_LIBPERL_SUPPORT libpython: [ on ] # HAVE_LIBPYTHON_SUPPORT libslang: [ on ] # HAVE_SLANG_SUPPORT libcrypto: [ on ] # HAVE_LIBCRYPTO_SUPPORT libunwind: [ OFF ] # HAVE_LIBUNWIND_SUPPORT libdw-dwarf-unwind: [ OFF ] # HAVE_DWARF_SUPPORT zlib: [ on ] # HAVE_ZLIB_SUPPORT lzma: [ on ] # HAVE_LZMA_SUPPORT get_cpuid: [ on ] # HAVE_AUXTRACE_SUPPORT bpf: [ OFF ] # HAVE_LIBBPF_SUPPORT aio: [ on ] # HAVE_AIO_SUPPORT zstd: [ on ] # HAVE_ZSTD_SUPPORT libpfm4: [ on ] # HAVE_LIBPFM libtraceevent: [ on ] # HAVE_LIBTRACEEVENT bpf_skeletons: [ OFF ] # HAVE_BPF_SKEL ``` Signed-off-by: Ian Rogers Tested-by: Namhyung Kim Cc: James Clark Cc: Nick Terrell Cc: Patrice Duroux Cc: Nick Desaulniers Cc: Andrii Nakryiko Cc: Nathan Chancellor Cc: Kajol Jain Cc: Athira Rajeev Cc: Tiezhu Yang Cc: Tom Rix Cc: llvm@lists.linux.dev Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230914211948.814999-2-irogers@google.com Signed-off-by: Namhyung Kim commit a6c6a5fe2a08172c2e045588531f0e05a6c296cf Author: Randy Dunlap Date: Mon Sep 18 13:58:25 2023 -0700 power: supply: pm8916_lbc: observe EXTCON config setting When CONFIG_EXTCON=m and CONFIG_CHARGER_PM8916_LBC=y, there are build errors. Fix them by having CHARGER_PM8916_LBC depend on the setting of EXTCON. aarch64-linux-ld: drivers/power/supply/pm8916_lbc.o: in function `pm8916_lbc_charger_state_changed_irq': pm8916_lbc.c:(.text+0xe8): undefined reference to `extcon_set_state_sync' aarch64-linux-ld: drivers/power/supply/pm8916_lbc.o: in function `pm8916_lbc_charger_probe': pm8916_lbc.c:(.text+0x638): undefined reference to `devm_extcon_dev_allocate' aarch64-linux-ld: pm8916_lbc.c:(.text+0x650): undefined reference to `devm_extcon_dev_register' aarch64-linux-ld: pm8916_lbc.c:(.text+0x688): undefined reference to `extcon_set_state_sync' Fixes: f8d7a3d21160 ("power: supply: Add driver for pm8916 lbc") Signed-off-by: Randy Dunlap Cc: Nikita Travkin Cc: Sebastian Reichel Cc: linux-pm@vger.kernel.org Link: https://lore.kernel.org/r/20230918205825.25864-1-rdunlap@infradead.org Signed-off-by: Sebastian Reichel commit 3ecf87b2d8ffabb88d1e3901d7a429fd1ecbfc6c Author: Yang Li Date: Fri Sep 15 14:38:32 2023 +0800 perf kwork top: Simplify bool conversion ./tools/perf/util/bpf_kwork_top.c:120:53-58: WARNING: conversion to bool not needed here Signed-off-by: Yang Li Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230915063832.120274-1-yang.lee@linux.alibaba.com Signed-off-by: Namhyung Kim commit b4bf3d5c37d404b05356869cdbd16450f3ba02a0 Author: Andreas Gruenbacher Date: Thu Sep 14 23:47:07 2023 +0200 gfs2: Remove unused gfs2_extent_length argument The limit argument of gfs2_extent_length() is unused. Signed-off-by: Andreas Gruenbacher commit bbacb395ac5c57290cdfd02389788cbce64c237e Author: Andreas Gruenbacher Date: Fri Sep 1 21:39:26 2023 +0200 gfs2: Remove freeze_go_demote_ok Before commit b77b4a4815a9 ("gfs2: Rework freeze / thaw logic"), the freeze glock was kept around in the glock cache in shared mode without being actively held while a filesystem is in thawed state. In that state, memory pressure could have eventually evicted the freeze glock, and the freeze_go_demote_ok callback was needed to prevent that from happening. With the freeze / thaw rework, the freeze glock is now always actively held in shared mode while a filesystem is thawed, and the freeze_go_demote_ok hack is no longer needed. Signed-off-by: Andreas Gruenbacher commit 18c1db313ea904ebd01aa08135b72cdb04f889fb Author: Andreas Gruenbacher Date: Sun Dec 11 21:25:39 2022 +0100 gfs2: Simplify function gfs2_upgrade_iopen_glock When trying to upgrade the iopen glock, gfs2_upgrade_iopen_glock() tries to take the iopen glock with the LM_FLAG_TRY_1CB flag set before trying to take it without the LM_FLAG_TRY or LM_FLAG_TRY_1CB flags set. Both calls will cause the lock contention bast callbacks to be invoked throughout the cluster, and we really don't need them to be invoked twice. Remove the first LM_FLAG_TRY_1CB call to eliminate unnecessary dlm traffic. Signed-off-by: Andreas Gruenbacher commit 105f3fe9188b37752c25d154870ceca352c9213f Author: Waiman Long Date: Tue Sep 5 09:32:43 2023 -0400 cgroup/cpuset: Extend test_cpuset_prs.sh to test remote partition This patch extends the test_cpuset_prs.sh test script to support testing the new remote partition type and the new "cpuset.cpus.exclusive" and "cpuset.cpus.exclusive.effective" control files by adding new tests for them. In addition, the following changes are also made: 1) Run the state transition tests directly under root to ease testing of remote partition and remove the unneeded test column. 2) Add a column to for the list of expected isolated CPUs and compare it with the actual value by looking at the state of /sys/kernel/debug/sched/domains which will be available if the verbose flag is set. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit efdf7532bd3d302a96436beee153364f26a1ddae Author: Waiman Long Date: Tue Sep 5 09:32:42 2023 -0400 cgroup/cpuset: Documentation update for partition This patch updates the cgroup-v2.rst file to include information about the new "cpuset.cpus.exclusive" and "cpuset.cpus.excluisve.effective" control files as well as the new remote partition type. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 4a74e418881f26cdeae1011453acd66cedc8ad2c Author: Waiman Long Date: Tue Sep 5 09:32:41 2023 -0400 cgroup/cpuset: Check partition conflict with housekeeping setup A user can pre-configure certain CPUs in an isolated state at boot time with the "isolcpus" kernel boot command line option. Those CPUs will not be in the housekeeping_cpumask(HK_TYPE_DOMAIN) and so will not be in any sched domains. This may conflict with the partition setup at runtime. Those boot time isolated CPUs should only be used in an isolated partition. This patch adds the necessary check and disallows partition setup if the check fails. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 181c8e091aae11b0b7efba49b34adfe3c89ce648 Author: Waiman Long Date: Tue Sep 5 09:32:40 2023 -0400 cgroup/cpuset: Introduce remote partition One can use "cpuset.cpus.partition" to create multiple scheduling domains or to produce a set of isolated CPUs where load balancing is disabled. The former use case is less common but the latter one can be frequently used especially for the Telco use cases like DPDK. The existing "isolated" partition can be used to produce isolated CPUs if the applications have full control of a system. However, in a containerized environment where all the apps are run in a container, it is hard to distribute out isolated CPUs from the root down given the unified hierarchy nature of cgroup v2. The container running on isolated CPUs can be several layers down from the root. The current partition feature requires that all the ancestors of a leaf partition root must be parititon roots themselves. This can be hard to configure. This patch introduces a new type of partition called remote partition. A remote partition is a partition whose parent is not a partition root itself and its CPUs are acquired directly from available CPUs in the top cpuset through a hierachical distribution of exclusive CPUs down from it. By contrast, the existing type of partitions where their parents have to be valid partition roots are referred to as local partitions as they have to be clustered around a parent partition root. Child local partitons can be created under a remote partition, but a remote partition cannot be created under a local partition. We may relax this limitation in the future if there are use cases for such configuration. Manually writing to the "cpuset.cpus.exclusive" file is not necessary when creating local partitions. However, writing proper values to "cpuset.cpus.exclusive" down the cgroup hierarchy before the target remote partition root is mandatory for the creation of a remote partition. The value in "cpuset.cpus.exclusive.effective" may change if its "cpuset.cpus" or its parent's "cpuset.cpus.exclusive.effective" changes. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit e2ffe502ba4505ee9c7b432980c702b7801a37f3 Author: Waiman Long Date: Tue Sep 5 09:32:39 2023 -0400 cgroup/cpuset: Add cpuset.cpus.exclusive for v2 This patch introduces a new writable "cpuset.cpus.exclusive" control file for v2 which will be added to non-root cpuset enabled cgroups. This new file enables user to set a smaller list of exclusive CPUs to be used in the creation of a cpuset partition. The value written to "cpuset.cpus.exclusive" may not be the effective value being used for the creation of cpuset partition, the effective value will show up in "cpuset.cpus.exclusive.effective" and it is subject to the constraint that it must also be a subset of cpus_allowed and parent's "cpuset.cpus.exclusive.effective". By writing to "cpuset.cpus.exclusive", "cpuset.cpus.exclusive.effective" may be set to a non-empty value even for cgroups that are not valid partition roots yet. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 0c7f293efc87a06b51db9aa65256f8cb0a5a0a21 Author: Waiman Long Date: Tue Sep 5 09:32:38 2023 -0400 cgroup/cpuset: Add cpuset.cpus.exclusive.effective for v2 The creation of a cpuset partition means dedicating a set of exclusive CPUs to be used by a particular partition only. These exclusive CPUs will not be used by any cpusets outside of that partition. To enable more flexibility in creating partitions, we need a way to distribute exclusive CPUs that can be used in new partitions. Currently, we have a subparts_cpus cpumask in struct cpuset that tracks only the exclusive CPUs used by all the sub-partitions underneath a given cpuset. This patch reworks the way we do exclusive CPUs tracking. The subparts_cpus is now renamed to effective_xcpus which tracks the exclusive CPUs allocated to a partition root including those that are further distributed down to sub-partitions underneath it. IOW, it also includes the exclusive CPUs used by the current partition root. Note that effective_xcpus can contain offline CPUs and it will always be a subset of cpus_allowed. The renamed effective_xcpus is now exposed via a new read-only "cpuset.cpus.exclusive.effective" control file. The new effective_xcpus cpumask should be set to cpus_allowed when a cpuset becomes a partition root and be cleared if it is not a valid partition root. In the next patch, we will enable write to another new control file to enable further control of what can get into effective_xcpus. Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 6fcdb0183bf024a70abccb0439321c25891c708d Author: Waiman Long Date: Tue Sep 5 09:32:37 2023 -0400 cgroup/cpuset: Fix load balance state in update_partition_sd_lb() Commit a86ce68078b2 ("cgroup/cpuset: Extract out CS_CPU_EXCLUSIVE & CS_SCHED_LOAD_BALANCE handling") adds a new helper function update_partition_sd_lb() to update the load balance state of the cpuset. However the new load balance is determined by just looking at whether the cpuset is a valid isolated partition root or not. That is not enough if the cpuset is not a valid partition root but its parent is in the isolated state (load balance off). Update the function to set the new state to be the same as its parent in this case like what has been done in commit c8c926200c55 ("cgroup/cpuset: Inherit parent's load balance state in v2"). Fixes: a86ce68078b2 ("cgroup/cpuset: Extract out CS_CPU_EXCLUSIVE & CS_SCHED_LOAD_BALANCE handling") Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit a432b7c0cf420dbf2448c6bda6a6697afbb153d5 Author: Uros Bizjak Date: Mon Sep 18 20:40:27 2023 +0200 locking/lockref/x86: Enable ARCH_USE_CMPXCHG_LOCKREF for X86_CMPXCHG64 The following commit: bc08b449ee14 ("lockref: implement lockless reference count updates using cmpxchg()") enabled lockless reference count updates using cmpxchg() only for x86_64, and left x86_32 behind due to inability to detect support for cmpxchg8b instruction. Nowadays, we can use CONFIG_X86_CMPXCHG64 for this purpose. Also, by using try_cmpxchg64() instead of cmpxchg64() in the CMPXCHG_LOOP macro, the compiler actually produces sane code, improving the lockref_get_not_zero() main loop from: eb: 8d 48 01 lea 0x1(%eax),%ecx ee: 85 c0 test %eax,%eax f0: 7e 2f jle 121 f2: 8b 44 24 10 mov 0x10(%esp),%eax f6: 8b 54 24 14 mov 0x14(%esp),%edx fa: 8b 74 24 08 mov 0x8(%esp),%esi fe: f0 0f c7 0e lock cmpxchg8b (%esi) 102: 8b 7c 24 14 mov 0x14(%esp),%edi 106: 89 c1 mov %eax,%ecx 108: 89 c3 mov %eax,%ebx 10a: 8b 74 24 10 mov 0x10(%esp),%esi 10e: 89 d0 mov %edx,%eax 110: 31 fa xor %edi,%edx 112: 31 ce xor %ecx,%esi 114: 09 f2 or %esi,%edx 116: 75 58 jne 170 to: 350: 8d 4f 01 lea 0x1(%edi),%ecx 353: 85 ff test %edi,%edi 355: 7e 79 jle 3d0 357: f0 0f c7 0e lock cmpxchg8b (%esi) 35b: 75 53 jne 3b0 Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Acked-by: Linus Torvalds Link: https://lore.kernel.org/r/20230918184050.9180-1-ubizjak@gmail.com commit 6f23fc47c1b2ac226704fb7294f43ed3b0965e51 Merge: e35a6cf1cc343 ce9ecca0238b1 Author: Ingo Molnar Date: Mon Sep 18 22:17:15 2023 +0200 Merge tag 'v6.6-rc2' into locking/core, to pick up fixes Signed-off-by: Ingo Molnar commit d24f05987ce8bf61e62d86fedbe47523dc5c3393 Author: Kamalesh Babulal Date: Tue Sep 12 12:34:35 2023 +0530 cgroup: Avoid extra dereference in css_populate_dir() Use css directly instead of dereferencing it from &cgroup->self, while adding the cgroup v2 cft base and psi files in css_populate_dir(). Both points to the same css, when css->ss is NULL, this avoids extra deferences and makes code consistent in usage across the function. Signed-off-by: Kamalesh Babulal Signed-off-by: Tejun Heo commit fd55c0adb46a44c9a0630dc32509e4733c290103 Author: Kamalesh Babulal Date: Tue Sep 12 12:34:34 2023 +0530 cgroup: Check for ret during cgroup1_base_files cft addition There is no check for possible failure while populating cgroup1_base_files cft in css_populate_dir(), like its cgroup v2 counter parts cgroup_{base,psi}_files. In case of failure, the cgroup might not be set up right. Add ret value check to return on failure. Signed-off-by: Kamalesh Babulal Signed-off-by: Tejun Heo commit 424009ab203086288dcd183d3ab48d243eb31268 Author: Hans de Goede Date: Wed Sep 13 13:19:51 2023 +0200 ACPI: resource: Drop .ident values from dmi_system_id tables The dmi_system_id.ident values are not used, replace the .ident = "$ident" lines with /* $ident */ to drop the unused strings from the text section. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit d37273af0e428e95a34841c1ade16b172db6c2b5 Author: Hans de Goede Date: Wed Sep 13 13:19:50 2023 +0200 ACPI: resource: Consolidate IRQ trigger-type override DMI tables Before this patch there were 6 dmi_system_id tables. While looking at the override_table[] there are only 2 cases: 1. irq 1, level, active-low, not-shared, skip-override 2. irq 1, edge, activ-low, shared, force-override Merge the dmi_system_id tables for identical cases together, going from 6 dmi_system_id tables and 6 override_table[] entries to just 2, one for each case. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 2ce3262553c690f175705b3ecbdf4146448f5dc8 Author: Hans de Goede Date: Fri Sep 15 23:29:02 2023 +0200 ACPI: video: Add "vendor" quirks for 3 Lenovo x86 Android tablets Like the Xiaomi Mi Pad 2 these 3 Lenovo x86 Android tablet models also use a TI LP8557 backlight controller in direct I2C brightness register control mode. Add "vendor" quirks for these 3 models to disable the non-working native / acpi_video backlight devices. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 22c11b8f1b94ecd3e8c345df1d29eb3a5f931fff Author: Hans de Goede Date: Fri Sep 15 23:29:01 2023 +0200 ACPI: video: Move Xiaomi Mi Pad 2 quirk to its own section The Xiaomi Mi Pad 2 is currently listed under the: "Models which should use the vendor backlight interface, because of broken ACPI video backlight control." section. But this is not 100% correct. The Xiaomi Mi Pad 2 is one of a set of x86 tablets which shipped with Android as factory OS. These tablets have a TI LP8557 backlight controller with its PWM input _not_ connected to the PMIC or chipset (LPSS) PWM output. Instead the backlight can be controlled by configuring the LP8557 for direct control through its brightness I2C register and then using the lp855x driver. This setup means that neither i915's native or acpi_video backlight control works, so a "vendor" quirk is added for these tablets to disable both the native and acpi_video backlight devices, but these devices do not use vendor control in the typical meaning of vendor specific SMBIOS or ACPI calls being used. This patch is a preparation patch for adding "vendor" quirks for a couple more such tablet models. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 89776a6a702e9b7bf9ae1691621f9699b2c18cc1 Author: Jacob Keller Date: Wed Aug 16 17:00:58 2023 -0700 ice: check netlist before enabling ICE_F_GNSS Similar to the change made for ICE_F_SMA_CTRL, check the netlist before enabling support for ICE_F_GNSS. This ensures that the driver only enables the GNSS feature on devices which actually have the feature enabled in the firmware device configuration. Signed-off-by: Jacob Keller Tested-by: Sunitha Mekala (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 6f9fb8afe649a24c7df50ce2f7095b832713e648 Author: Uwe Kleine-König Date: Mon Sep 18 15:37:00 2023 +0200 power: supply: wm97xx_battery: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-33-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 42720969f394dc074ce1c99cd0c425b7dd6017ee Author: Uwe Kleine-König Date: Mon Sep 18 15:36:59 2023 +0200 power: supply: wm8350_power: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-32-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit dab68bbb5450ee17c9acf77916ac2ed659b1e2a7 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:58 2023 +0200 power: supply: wm831x_power: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-31-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit fc7b34ae1347f4eb36f065458e53d6065cd85928 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:57 2023 +0200 power: supply: wm831x_backup: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-30-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit ac51982b04a05eb902a223b3bc83c032903b6ba7 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:56 2023 +0200 power: supply: twl4030_madc_battery: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-29-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 83ef1dbc0de4a127661a175350696e9cfa88bbb1 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:55 2023 +0200 power: supply: twl4030_charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-28-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 07a9398914327bb16584f24dfba02062a5967ab1 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:54 2023 +0200 power: supply: tps65217_charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-27-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 75d8365c94b685dd7377b0251d2407518dc49c02 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:53 2023 +0200 power: supply: tps65090-charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-26-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 0569d4cfa800ba303647dbf8170d1e89bdee3ed9 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:52 2023 +0200 power: supply: sc2731_charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-25-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 9f0da40ae798d3f32d649d1effef246f2c30f13e Author: Uwe Kleine-König Date: Mon Sep 18 15:36:51 2023 +0200 power: supply: rx51_battery: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-24-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 325cb83bbabcafa3e54528d40c86559dde271bc3 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:50 2023 +0200 power: supply: qcom_smbb: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-23-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 6e3ed20e85aacaed7d3deede835a97029ea14560 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:49 2023 +0200 power: supply: pcf50633-charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-22-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 026f25f221866ea89a33697935995db6a1c25a52 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:48 2023 +0200 power: supply: max8925_power: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-21-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 1d138270d2963b68d71852c363298460ea7435c7 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:47 2023 +0200 power: supply: max77693_charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-20-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit cd25ac3e3200626680dac92c9784cce4d59fdc6b Author: Uwe Kleine-König Date: Mon Sep 18 15:36:46 2023 +0200 power: supply: max77650-charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-19-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 81e487b8a4af24c28a3d5c90a6035356098720bb Author: Uwe Kleine-König Date: Mon Sep 18 15:36:45 2023 +0200 power: supply: max14577_charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-18-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 7810ba3c5110ce66652ec6bd2abb92da5d726c3b Author: Uwe Kleine-König Date: Mon Sep 18 15:36:44 2023 +0200 power: supply: lp8788-charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-17-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit cf79047ed4a33704dd465723175041c22091d24c Author: Uwe Kleine-König Date: Mon Sep 18 15:36:43 2023 +0200 power: supply: isp1704_charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-16-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit cbc3e1136d1f8b934cc41b4bc12f5c732d543c59 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:42 2023 +0200 power: supply: ipaq_micro_battery: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-15-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit df1953bcb723538faff6ebb403ac321797f3b04f Author: Uwe Kleine-König Date: Mon Sep 18 15:36:41 2023 +0200 power: supply: goldfish_battery: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-14-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 749e18a800569e894e82fb5f68edd447311f9675 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:40 2023 +0200 power: supply: da9150-charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-13-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit ac67d7fd4e1bad9eac25c3a1a07e4aceda6e1ce3 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:39 2023 +0200 power: supply: da9052-battery: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-12-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit b5ba26ab7a886567759b793161cdd0aae4a76910 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:38 2023 +0200 power: supply: da9030_battery: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-11-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 1abbcff9f0c087e88ae542e0d6b0ee0689881027 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:37 2023 +0200 power: supply: cpcap-charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-10-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 02fecba679bbac3b16c2245e8e462b19fb36cedd Author: Uwe Kleine-König Date: Mon Sep 18 15:36:36 2023 +0200 power: supply: cpcap-battery: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-9-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 403eebf95c38302cacc48c127e575461f0e798be Author: Uwe Kleine-König Date: Mon Sep 18 15:36:35 2023 +0200 power: supply: charger-manager: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-8-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 7a9a4966777b8df6e6f97f82073f4736a5274358 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:34 2023 +0200 power: supply: act8945a_charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-7-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 179297b95198526fbef8f6b92f1b486502144861 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:33 2023 +0200 power: supply: acer_a500_battery: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-6-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 59016f4c0e106ec9ba3ac039bf7e96a474648ea6 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:32 2023 +0200 power: supply: ab8500_fg: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-5-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit c5b08e1bfe087c42e43e64f308b16c6f79444dc9 Author: Uwe Kleine-König Date: Mon Sep 18 15:36:31 2023 +0200 power: supply: ab8500_charger: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-4-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 465ec888880be0f3170b97a0e975bcb1e9b6961b Author: Uwe Kleine-König Date: Mon Sep 18 15:36:30 2023 +0200 power: supply: ab8500_chargalg: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-3-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit dab952c77e5a0bad3a391b8cbb6995f32c9a7b6d Author: Uwe Kleine-König Date: Mon Sep 18 15:36:29 2023 +0200 power: supply: ab8500_btemp: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230918133700.1254499-2-u.kleine-koenig@pengutronix.de Signed-off-by: Sebastian Reichel commit 42d40bb21e332151da6fb689bf7d4af8195866ed Author: Jacob Keller Date: Fri Sep 8 14:37:14 2023 -0700 ice: introduce ice_pf_src_tmr_owned Add ice_pf_src_tmr_owned() macro to check the function capability bit indicating if the current function owns the PTP hardware clock. This is slightly shorter than the more verbose access via hw.func_caps.ts_func_info.src_tmr_owned. Use this where possible rather than open coding its equivalent. Signed-off-by: Jacob Keller Signed-off-by: Tony Nguyen commit 5a7cee1cb4b9ef99fe7acd571e1bd51b023b099a Author: Jacob Keller Date: Wed Aug 16 17:00:55 2023 -0700 ice: fix pin assignment for E810-T without SMA control Since commit 43c4958a3ddb ("ice: Merge pin initialization of E810 and E810T adapters"), the ice_ptp_setup_pins_e810() function has been used for both E810 and E810-T devices. The new implementation only distinguishes between whether the device has SMA control or not. It was assumed this is always true for E810-T devices. In addition, it does not set the n_per_out value appropriately when SMA control is enabled. In some cases, the E810-T device may not have access to SMA control. In that case, the E810-T device actually has access to fewer pins than a standard E810 device. Fix the implementation to correctly assign the appropriate pin counts for E810-T devices both with and without SMA control. The mentioned commit already includes the appropriate macro values for these pin counts but they were unused. Instead of assigning the default E810 values and then overwriting them, handle the cases separately in order of E810-T with SMA, E810-T without SMA, and then standard E810. This flow makes following the logic easier. Fixes: 43c4958a3ddb ("ice: Merge pin initialization of E810 and E810T adapters") Signed-off-by: Jacob Keller Tested-by: Sunitha Mekala (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 12a5a28b565bfb5abab7ab17fe3c6a3c02a2affe Author: Jacob Keller Date: Wed Aug 16 17:00:54 2023 -0700 ice: remove ICE_F_PTP_EXTTS feature flag The ICE_F_PTP_EXTTS feature flag is ostensibly intended to support checking whether the device supports external timestamp pins. It is only checked in E810-specific code flows, and is enabled for all E810-based devices. E822 and E823 flows unconditionally enable external timestamp support. This makes the feature flag meaningless, as it is always enabled. Just unconditionally enable support for external timestamp pins and remove this unnecessary flag. Signed-off-by: Jacob Keller Tested-by: Sunitha Mekala (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit dd84744cf5ea967c8d53aae6b6a45703dbc5c5c4 Author: Karol Kolacinski Date: Wed Jul 26 11:27:45 2023 -0700 ice: PTP: move quad value check inside ice_fill_phy_msg_e822 The callers of ice_fill_phy_msg_e822 check for whether the quad number is within the expected range. Move this check inside the ice_fill_phy_msg_e822 function instead of duplicating it twice. Signed-off-by: Karol Kolacinski Signed-off-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 64fd7de2469dd52a7f1517ce95ae22fcb391a8a1 Author: Karol Kolacinski Date: Wed Jul 26 11:27:44 2023 -0700 ice: PTP: Rename macros used for PHY/QUAD port definitions The ice_fill_phy_msg_e822 function uses several macros to specify the correct address when sending a sideband message to the PHY block in hardware. The names of these macros are fairly generic and confusing. Future development is going to extend the driver to support new hardware families which have different relationships between PHY and QUAD. Rename the macros for clarity and to indicate that they are E822 specific. This also matches closer to the hardware specification in the data sheet. Signed-off-by: Karol Kolacinski Signed-off-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit be65a1a33bdee3912daac50aa6c5270ec9c37010 Author: Karol Kolacinski Date: Wed Jul 26 11:27:43 2023 -0700 ice: PTP: Clean up timestamp registers correctly E822 PHY TS registers should not be written and the only way to clean up them is to reset QUAD memory. To ensure that the status bit for the timestamp index is cleared, ensure that ice_clear_phy_tstamp implementations first read the timestamp out. Implementations which can write the register continue to do so. Add a note to indicate this function should only be called on timestamps which have their valid bit set. Update the dynamic debug messages to reflect the actual action taken. Signed-off-by: Karol Kolacinski Signed-off-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit be16574609f14c67efd89d5d8f9f19ab7724bfc9 Author: Jacob Keller Date: Mon Jul 17 15:17:13 2023 -0700 ice: introduce hw->phy_model for handling PTP PHY differences The ice driver has PTP support which works across a couple of different device families. The device families each have different PHY hardware which have unique requirements for programming. Today, there is E810-based hardware, and E822-based hardware. To handle this, the driver checks the ice_is_e810() function to separate between the two existing families of hardware. Future development is going to add new hardware designs which have further unique requirements. To make this easier, introduce a phy_model field to the HW structure. This field represents what PHY model the current device has, and is used to allow distinguishing which logic a particular device needs. This will make supporting future upcoming hardware easier, by providing an obvious place to initialize the PHY model, and by already using switch/case statements instead of the previous if statements. Astute reviewers may notice that there are a handful of remaining checks for ice_is_e810() left in ice_ptp.c These conflict with some other cleanup patches in development, and will be fixed in the near future. Signed-off-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 88c360e49f512ad50d77444e454331a38c9ba393 Author: Jacob Keller Date: Tue Jul 25 14:50:48 2023 -0700 ice: Support cross-timestamping for E823 devices The E822 hardware has cross timestamping support using a device feature termed "Hammock Harbor" by the data sheet. This device feature is similar to PCIe PTM, and captures the Always Running Timer (ART) simultaneously with the PTP hardware clock time. This functionality also exists on E823 devices, but is not currently enabled. Rename the cross-timestamp functions to use the _e82x postfix, indicating that the support works across the E82x family of devices and not just the E822 hardware. The flow for capturing a cross-timestamp requires an additional step on E823 devices. The GLTSYN_CMD register must be programmed with the READ_TIME command. Otherwise, the cross timestamp will always report a value of zero for the PTP hardware clock time. To fix this, call ice_ptp_src_cmd() prior to initiating the cross timestamp logic. Once the cross timestamp has completed, call ice_ptp_src_cmd() with ICE_PTP_OP to ensure that the timer command registers are cleared. Co-developed-by: Sergey Temerkhanov Signed-off-by: Sergey Temerkhanov Signed-off-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 097c317afe0a582cfbf04506f368ee3a3ad0ae74 Author: Karol Kolacinski Date: Tue Jul 25 14:50:47 2023 -0700 ice: retry acquiring hardware semaphore during cross-timestamp request The hardware for performing a cross-timestamp on E822 uses a hardware semaphore which we must acquire before initiating the cross-timestamp operation. The current implementation only attempts to acquire the semaphore once, and assumes that it will succeed. If the semaphore is busy for any reason, the cross-timestamp operation fails with -EFAULT. Instead of immediately failing, try the acquire the lock a few times with a small sleep between attempts. This ensures that most requests will go through without issue. Additionally, return -EBUSY instead of -EFAULT if the operation can't continue due to the semaphore being busy. Signed-off-by: Karol Kolacinski Signed-off-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 40326b2b4296052039ef1f71330f920063ca1096 Author: Sergey Temerkhanov Date: Tue Jul 25 14:50:46 2023 -0700 ice: prefix clock timer command enumeration values with ICE_PTP The ice driver has an enumeration for the various commands that can be programmed to the MAC and PHY for setting up hardware clock operations. Prefix these with ICE_PTP so that they are clearly namespaced to the ice driver. Signed-off-by: Sergey Temerkhanov Signed-off-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 7b424ffcd45821600312ed4c794c21f7805e79d4 Author: Oliver Upton Date: Wed Sep 13 16:56:44 2023 +0000 KVM: arm64: Don't use kerneldoc comment for arm64_check_features() A double-asterisk opening mark to the comment (i.e. '/**') indicates a comment block is in the kerneldoc format. There's automation in place to validate that kerneldoc blocks actually adhere to the formatting rules. The function comment for arm64_check_features() isn't kerneldoc; use a 'regular' comment to silence automation warnings. Link: https://lore.kernel.org/all/202309112251.e25LqfcK-lkp@intel.com/ Reviewed-by: Zenghui Yu Link: https://lore.kernel.org/r/20230913165645.2319017-1-oliver.upton@linux.dev Signed-off-by: Oliver Upton commit e356289680321c39036847b5967c26716d285c3e Author: Gustavo Sousa Date: Tue Sep 12 12:59:23 2023 -0300 drm/i915/cx0: Add step for programming msgbus timer There was a recent update in the BSpec adding an extra step to the PLL enable sequence, which is for programming the msgbus timer. Since we also touch PHY registers during hw readout, let's do the programming when starting a transaction rather than only when doing the PLL enable sequence. This might be the missing step that was causing the timeouts that we have recently seen during C20 SRAM register programming sequences. With this in place, we shouldn't need the logic to bump the timer thresholds, since now we have a documented value that should be set peform programming the registers. As such, let's also remove intel_cx0_bus_check_and_bump_timer(), but keep the part that checks if hardware really detected a timeout, which might be useful debugging information. v2: - Use debug level instead of warning for the message notifying that the hardware did not detect the timeout. (Mika) - Got a new BSpec update clarifying that we need to program the msgbus timer of both PHY lanes. Update the changes to reflect that. (Gustavo) BSpec: 64568 Cc: Mika Kahola Signed-off-by: Gustavo Sousa Reviewed-by: Mika Kahola Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230912155923.39494-1-gustavo.sousa@intel.com commit ee5f8cc2770b2f0f7cfefb5bf7534e2859e39485 Author: Michal Wajdeczko Date: Thu Aug 31 23:48:47 2023 +0200 kunit: Reset test status on each param iteration If we skip one parametrized test case then test status remains SKIP for all subsequent test params leading to wrong reports: $ ./tools/testing/kunit/kunit.py run \ --kunitconfig ./lib/kunit/.kunitconfig *.example_params* --raw_output \ [ ] Starting KUnit Kernel (1/1)... KTAP version 1 1..1 # example: initializing suite KTAP version 1 # Subtest: example # module: kunit_example_test 1..1 KTAP version 1 # Subtest: example_params_test # example_params_test: initializing # example_params_test: cleaning up ok 1 example value 3 # SKIP unsupported param value 3 # example_params_test: initializing # example_params_test: cleaning up ok 2 example value 2 # SKIP unsupported param value 3 # example_params_test: initializing # example_params_test: cleaning up ok 3 example value 1 # SKIP unsupported param value 3 # example_params_test: initializing # example_params_test: cleaning up ok 4 example value 0 # SKIP unsupported param value 0 # example_params_test: pass:0 fail:0 skip:4 total:4 ok 1 example_params_test # SKIP unsupported param value 0 # example: exiting suite ok 1 example # SKIP Reset test status and status comment after each param iteration to avoid using stale results. Signed-off-by: Michal Wajdeczko Cc: David Gow Cc: Rae Moar Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 53568b720c4dfb70d8db3da3587120fd0c378cae Author: Richard Fitzgerald Date: Mon Aug 28 11:41:11 2023 +0100 kunit: string-stream: Test performance of string_stream Add a test of the speed and memory use of string_stream. string_stream_performance_test() doesn't actually "test" anything (it cannot fail unless the system has run out of allocatable memory) but it measures the speed and memory consumption of the string_stream and reports the result. This allows changes in the string_stream implementation to be compared. Signed-off-by: Richard Fitzgerald Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 05e2006ce493cb6fb5e5b4b8317f82754dfa2b1e Author: Richard Fitzgerald Date: Mon Aug 28 11:41:10 2023 +0100 kunit: Use string_stream for test log Replace the fixed-size log buffer with a string_stream so that the log can grow as lines are added. The existing kunit log tests have been updated for using a string_stream as the log. No new test have been added because there are already tests for the underlying string_stream. As the log tests now depend on string_stream functions they cannot build when kunit-test is a module. They have been surrounded by a #if to replace them with skipping version when the test is build as a module. Though this isn't pretty, it avoids moving code to another file while that code is also being changed. Signed-off-by: Richard Fitzgerald Reviewed-by: David Gow Signed-off-by: Shuah Khan commit d1a0d699bfc00ae5b5e74bb640d791a93e825b68 Author: Richard Fitzgerald Date: Mon Aug 28 11:41:09 2023 +0100 kunit: string-stream: Add tests for freeing resource-managed string_stream string_stream_managed_free_test() allocates a resource-managed string_stream and tests that kunit_free_string_stream() calls string_stream_destroy(). string_stream_resource_free_test() allocates a resource-managed string_stream and tests that string_stream_destroy() is called when the test resources are cleaned up. The old string_stream_init_test() has been split into two tests, one for kunit_alloc_string_stream() and the other for alloc_string_stream(). Signed-off-by: Richard Fitzgerald Reviewed-by: David Gow Signed-off-by: Shuah Khan commit a3fdf784780ccb0008d630e8722d1389c49c7499 Author: Richard Fitzgerald Date: Mon Aug 28 11:41:08 2023 +0100 kunit: string-stream: Decouple string_stream from kunit Re-work string_stream so that it is not tied to a struct kunit. This is to allow using it for the log of struct kunit_suite. Instead of resource-managing individual allocations the whole string_stream can be resource-managed, if required. alloc_string_stream() now allocates a string stream that is not resource-managed. string_stream_destroy() now works on an unmanaged string_stream allocated by alloc_string_stream() and frees the entire string_stream (previously it only freed the fragments). string_stream_clear() has been made public for callers that want to free the fragments without destroying the string_stream. For resource-managed allocations use kunit_alloc_string_stream() and kunit_free_string_stream(). In addition to this, string_stream_get_string() now returns an unmanaged buffer that the caller must kfree(). Signed-off-by: Richard Fitzgerald Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 20631e154c78f4140fffe111f5c79464fae3c38c Author: Richard Fitzgerald Date: Mon Aug 28 11:41:07 2023 +0100 kunit: string-stream: Add kunit_alloc_string_stream() Add function kunit_alloc_string_stream() to do a resource-managed allocation of a string stream, and corresponding kunit_free_string_stream() to free the resource-managed stream. This is preparing for decoupling the string_stream implementation from struct kunit, to reduce the amount of code churn when that happens. Currently: - kunit_alloc_string_stream() only calls alloc_string_stream(). - kunit_free_string_stream() takes a struct kunit* which isn't used yet. Callers of the old alloc_string_stream() and string_stream_destroy() are all requesting a managed allocation so have been changed to use the new functions. alloc_string_stream() has been temporarily made static because its current behavior has been replaced with kunit_alloc_string_stream(). Signed-off-by: Richard Fitzgerald Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 7b4481cbe7e6bde275aa5e5f2aaa21455915e07c Author: Richard Fitzgerald Date: Mon Aug 28 11:41:06 2023 +0100 kunit: Don't use a managed alloc in is_literal() There is no need to use a test-managed alloc in is_literal(). The function frees the temporary buffer before returning. This removes the only use of the test and gfp members of struct string_stream outside of the string_stream implementation. Signed-off-by: Richard Fitzgerald Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 1f58cdb173a4ce1bc670fa4662af0fe3556253cf Author: Richard Fitzgerald Date: Mon Aug 28 11:41:05 2023 +0100 kunit: string-stream-test: Add cases for string_stream newline appending Add test cases for testing the string_stream feature that appends a newline to strings that do not already end with a newline. string_stream_no_auto_newline_test() tests with this feature disabled. Newlines should not be added or dropped. string_stream_auto_newline_test() tests with this feature enabled. Newlines should be added to lines that do not end with a newline. string_stream_append_auto_newline_test() tests appending the content of one stream to another stream when the target stream has newline appending enabled. Signed-off-by: Richard Fitzgerald Reviewed-by: Rae Moar Reviewed-by: David Gow Signed-off-by: Shuah Khan commit a5abe7b201779b0000f1e8ab522e5c6fc0c413bf Author: Richard Fitzgerald Date: Mon Aug 28 11:41:04 2023 +0100 kunit: string-stream: Add option to make all lines end with newline Add an optional feature to string_stream that will append a newline to any added string that does not already end with a newline. The purpose of this is so that string_stream can be used to collect log lines. This is enabled/disabled by calling string_stream_set_append_newlines(). Signed-off-by: Richard Fitzgerald Reviewed-by: Rae Moar Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 4551caca6ab67fb0b5199ca43580c4f8d27bf28a Author: Richard Fitzgerald Date: Mon Aug 28 11:41:03 2023 +0100 kunit: string-stream: Improve testing of string_stream Replace the minimal tests with more-thorough testing. string_stream_init_test() tests that struct string_stream is initialized correctly. string_stream_line_add_test() adds a series of numbered lines and checks that the resulting string contains all the lines. string_stream_variable_length_line_test() adds a large number of lines of varying length to create many fragments, then tests that all lines are present. string_stream_append_test() tests various cases of using string_stream_append() to append the content of one stream to another. Adds string_stream_append_empty_string_test() to test that adding an empty string to a string_stream doesn't create a new empty fragment. Signed-off-by: Richard Fitzgerald Reviewed-by: Rae Moar Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 5c54c9ebb1f4758a4da7731a809148ff1a3a1844 Author: Richard Fitzgerald Date: Mon Aug 28 11:41:02 2023 +0100 kunit: string-stream: Don't create a fragment for empty strings If the result of the formatted string is an empty string just return instead of creating an empty fragment. Signed-off-by: Richard Fitzgerald Reviewed-by: Rae Moar Reviewed-by: David Gow Signed-off-by: Shuah Khan commit 88e20c1f8c1c0018a2dad50b991b87ef028b9c1c Merge: 5d5529b005714 89286e235c2f7 Author: Mark Brown Date: Mon Sep 18 17:36:29 2023 +0100 ASoC: da7213: add .auto_selectable_formats support Merge series from Kuninori Morimoto : da7213 is still using M/S instead of P/C for SND_SOC_DAIFMT_CBx_CFx. [PATCH 1/2] will update it. [PATCH 2/2] will enable DAI format automatic select. commit 2144833e7b41459fa2d52bb0676f0ab4920cf32c Author: Richard Fitzgerald Date: Mon Sep 18 10:51:29 2023 +0100 ALSA: hda: cirrus_scodec: Add KUnit test Add a KUnit test for cirrus_scodec_get_speaker_id(). It is impractical to have enough hardware with every possible permutation of speaker id. So use a test harness to test all theoretically supported options. The test harness consists of: - a mock GPIO controller. - a mock struct device to represent the scodec driver - software nodes to provide the fwnode info that would normally come from ACPI. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20230918095129.440-3-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 6f03b446cbaeb3187b1df1e7e8b13c6340cd6c68 Author: Richard Fitzgerald Date: Mon Sep 18 10:51:28 2023 +0100 ALSA: hda: cs35l56: Add support for speaker id Add handling of the "spk-id-gpios" _DSD property. If present, the value indicated by the GPIOs is appended to the subsystem-id part of the firmware name to load the appropriate tunings for that speaker. Some manufacturers use multiple sources of speakers, which need different tunings for best performance. On these models the type of speaker fitted is indicated by the values of one or more GPIOs. The number formed by the GPIOs identifies the tuning required. The speaker ID is only used in combination with a _SUB identifier because the value is only meaningful if the exact model is known. The code to get the speaker ID value has been implemented as a new library so that the cs35l41_hda driver can be switched in future to share common code. This library can be extended for other common functionality shared by Cirrus Logic amp drivers. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20230918095129.440-2-rf@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 6e743781d62e28f5fa095e5f31f878819622c143 Author: Geoffrey D. Bennett Date: Fri Sep 15 03:03:03 2023 +0930 ALSA: scarlett2: Add correct product series name to messages This driver was originally developed for the Focusrite Scarlett Gen 2 series, but now also supports the Scarlett Gen 3 series, the Clarett 8Pre USB, and the Clarett+ 8Pre. The messages output by the driver on initialisation and error include the identifying text "Scarlett Gen 2/3", but this is no longer accurate, and writing "Scarlett Gen 2/3/Clarett USB/Clarett+" would be unwieldy. Add series_name field to the scarlett2_device_entry struct so that concise and accurate messages can be output. Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/3774b9d35bf1fbdd6fdad9f3f4f97e9b82ac76bf.1694705811.git.g@b4.vu Signed-off-by: Takashi Iwai commit b9a98cdd3ac7b80d8ea0f6acd81c88ad3d8bcb4a Author: Geoffrey D. Bennett Date: Fri Sep 15 03:02:37 2023 +0930 ALSA: scarlett2: Add support for Clarett 8Pre USB The Clarett 8Pre USB works the same as the Clarett+ 8Pre, only the USB ID is different. Tested-by: Philippe Perrot Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/e59f47b29e2037f031b56bde10474c6e96e31ba5.1694705811.git.g@b4.vu Signed-off-by: Takashi Iwai commit d98cc489029dba4d99714c2e8ec4f5ba249f6851 Author: Geoffrey D. Bennett Date: Fri Sep 15 03:02:16 2023 +0930 ALSA: scarlett2: Move USB IDs out from device_info struct By moving the USB IDs from the device_info struct into scarlett2_devices[], that will allow for devices with different USB IDs to share the same device_info. Tested-by: Philippe Perrot Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/8263368e8d49e6fcebc709817bd82ab79b404468.1694705811.git.g@b4.vu Signed-off-by: Takashi Iwai commit bc83058f598757a908b30f8f536338cb1478ab5b Author: Geoffrey D. Bennett Date: Fri Sep 15 03:01:57 2023 +0930 ALSA: scarlett2: Default mixer driver to enabled Early versions of this mixer driver did not work on all hardware, so out of caution the driver was disabled by default and had to be explicitly enabled with device_setup=1. Since commit 764fa6e686e0 ("ALSA: usb-audio: scarlett2: Fix device hang with ehci-pci") no more problems of this nature have been reported. Therefore, enable the driver by default but provide a new device_setup option to disable the driver in case that is needed. - device_setup value of 0 now means "enable" rather than "disable". - device_setup value of 1 is now ignored. - device_setup value of 4 now means "disable". Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/89600a35b40307f2766578ad1ca2f21801286b58.1694705811.git.g@b4.vu Signed-off-by: Takashi Iwai commit 9757acd0a700ba4a0d16dde4ba820eb052aba1a7 Author: Thomas Gleixner Date: Sat Sep 16 21:26:07 2023 +0206 printk: nbcon: Allow drivers to mark unsafe regions and check state For the write_atomic callback, the console driver may have unsafe regions that need to be appropriately marked. Provide functions that accept the nbcon_write_context struct to allow for the driver to enter and exit unsafe regions. Also provide a function for drivers to check if they are still the owner of the console. Co-developed-by: John Ogness Signed-off-by: John Ogness Signed-off-by: Thomas Gleixner (Intel) Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20230916192007.608398-9-john.ogness@linutronix.de commit 06653d57ff283be627a2c769139d73ecc487810f Author: Thomas Gleixner Date: Sat Sep 16 21:26:06 2023 +0206 printk: nbcon: Add emit function and callback function for atomic printing Implement an emit function for nbcon consoles to output printk messages. It utilizes the lockless printk_get_next_message() and console_prepend_dropped() functions to retrieve/build the output message. The emit function includes the required safety points to check for handover/takeover and calls a new write_atomic callback of the console driver to output the message. It also includes proper handling for updating the nbcon console sequence number. A new nbcon_write_context struct is introduced. This is provided to the write_atomic callback and includes only the information necessary for performing atomic writes. Co-developed-by: John Ogness Signed-off-by: John Ogness Signed-off-by: Thomas Gleixner (Intel) Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20230916192007.608398-8-john.ogness@linutronix.de commit ad56ebd1d79b216dc147474fac89a11daf6b10df Author: Thomas Gleixner Date: Sat Sep 16 21:26:05 2023 +0206 printk: nbcon: Add sequence handling Add an atomic_long_t field @nbcon_seq to the console struct to store the sequence number for nbcon consoles. For nbcon consoles this will be used instead of the non-atomic @seq field. The new field allows for safe atomic sequence number updates without requiring any locking. On 64bit systems the new field stores the full sequence number. On 32bit systems the new field stores the lower 32 bits of the sequence number, which are expanded to 64bit as needed by folding the values based on the sequence numbers available in the ringbuffer. For 32bit systems, having a 32bit representation in the console is sufficient. If a console ever gets more than 2^31 records behind the ringbuffer then this is the least of the problems. Co-developed-by: John Ogness Signed-off-by: John Ogness Signed-off-by: Thomas Gleixner (Intel) Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20230916192007.608398-7-john.ogness@linutronix.de commit 4b08d9e24f50163a8bda0a702b45b06bf841d792 Author: Thomas Gleixner Date: Sat Sep 16 21:26:04 2023 +0206 printk: nbcon: Add ownership state functions Provide functions that are related to the safe handover mechanism and allow console drivers to dynamically specify unsafe regions: - nbcon_context_can_proceed() Invoked by a console owner to check whether a handover request is pending or whether the console has been taken over by another context. If a handover request is pending, this function will also perform the handover, thus cancelling its own ownership. - nbcon_context_enter_unsafe()/nbcon_context_exit_unsafe() Invoked by a console owner to denote that the driver is about to enter or leave a critical region where a take over is unsafe. The exit variant is the point where the current owner releases the lock for a higher priority context which asked for the friendly handover. The unsafe state is stored in the console state and allows a new context to make informed decisions whether to attempt a takeover of such a console. The unsafe state is also available to the driver so that it can make informed decisions about the required actions and possibly take a special emergency path. Co-developed-by: John Ogness Signed-off-by: John Ogness Signed-off-by: Thomas Gleixner (Intel) Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20230916192007.608398-6-john.ogness@linutronix.de commit 5634c90fd8553de7cbafecd048d0273690a2e84e Author: Thomas Gleixner Date: Sat Sep 16 21:26:03 2023 +0206 printk: nbcon: Add buffer management In case of hostile takeovers it must be ensured that the previous owner cannot scribble over the output buffer of the emergency/panic context. This is achieved by: - Adding a global output buffer instance for the panic context. This is the only situation where hostile takeovers can occur and there is always at most 1 panic context. - Allocating an output buffer per non-boot console upon console registration. This buffer is used by the console owner when not in panic context. (For boot consoles, the existing shared global legacy output buffer is used instead. Boot console printing will be synchronized with legacy console printing.) - Choosing the appropriate buffer is handled in the acquire/release functions. Co-developed-by: John Ogness Signed-off-by: John Ogness Signed-off-by: Thomas Gleixner (Intel) Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20230916192007.608398-5-john.ogness@linutronix.de commit d818b56f77521ecc5e3eda71dc9b2beb3d6681e3 Author: John Ogness Date: Sat Sep 16 21:26:02 2023 +0206 printk: Make static printk buffers available to nbcon The nbcon boot consoles also need printk buffers that are available very early. Since the nbcon boot consoles will also be serialized by the console_lock, they can use the same static printk buffers that the legacy consoles are using. Make the legacy static printk buffers available outside of printk.c so they can be used by nbcon.c. Signed-off-by: John Ogness Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20230916192007.608398-4-john.ogness@linutronix.de commit 3a5bb25162b880da749f7cdf281c78dbade4164b Author: Thomas Gleixner Date: Sat Sep 16 21:26:01 2023 +0206 printk: nbcon: Add acquire/release logic Add per console acquire/release functionality. The state of the console is maintained in the "nbcon_state" atomic variable. The console is locked when: - The 'prio' field contains the priority of the context that owns the console. Only higher priority contexts are allowed to take over the lock. A value of 0 (NBCON_PRIO_NONE) means the console is not locked. - The 'cpu' field denotes on which CPU the console is locked. It is used to prevent busy waiting on the same CPU. Also it informs the lock owner that it has lost the lock in a more complex scenario when the lock was taken over by a higher priority context, released, and taken on another CPU with the same priority as the interrupted owner. The acquire mechanism uses a few more fields: - The 'req_prio' field is used by the handover approach to make the current owner aware that there is a context with a higher priority waiting for the friendly handover. - The 'unsafe' field allows to take over the console in a safe way in the middle of emitting a message. The field is set only when accessing some shared resources or when the console device is manipulated. It can be cleared, for example, after emitting one character when the console device is in a consistent state. - The 'unsafe_takeover' field is set when a hostile takeover took the console in an unsafe state. The console will stay in the unsafe state until re-initialized. The acquire mechanism uses three approaches: 1) Direct acquire when the console is not owned or is owned by a lower priority context and is in a safe state. 2) Friendly handover mechanism uses a request/grant handshake. It is used when the current owner has lower priority and the console is in an unsafe state. The requesting context: a) Sets its priority into the 'req_prio' field. b) Waits (with a timeout) for the owning context to unlock the console. c) Takes the lock and clears the 'req_prio' field. The owning context: a) Observes the 'req_prio' field set on exit from the unsafe console state. b) Gives up console ownership by clearing the 'prio' field. 3) Unsafe hostile takeover allows to take over the lock even when the console is an unsafe state. It is used only in panic() by the final attempt to flush consoles in a try and hope mode. Note that separate record buffers are used in panic(). As a result, the messages can be read and formatted without any risk even after using the hostile takeover in unsafe state. The release function simply clears the 'prio' field. All operations on @console::nbcon_state are atomic cmpxchg based to handle concurrency. The acquire/release functions implement only minimal policies: - Preference for higher priority contexts. - Protection of the panic CPU. All other policy decisions must be made at the call sites: - What is marked as an unsafe section. - Whether to spin-wait if there is already an owner and the console is in an unsafe state. - Whether to attempt an unsafe hostile takeover. The design allows to implement the well known: acquire() output_one_printk_record() release() The output of one printk record might be interrupted with a higher priority context. The new owner is supposed to reprint the entire interrupted record from scratch. Co-developed-by: John Ogness Signed-off-by: John Ogness Signed-off-by: Thomas Gleixner (Intel) Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20230916192007.608398-3-john.ogness@linutronix.de commit 6b93bb41f6eaa1cc5c5f30ec3b687b380f116cd0 Author: Thomas Gleixner Date: Sat Sep 16 21:26:00 2023 +0206 printk: Add non-BKL (nbcon) console basic infrastructure The current console/printk subsystem is protected by a Big Kernel Lock, (aka console_lock) which has ill defined semantics and is more or less stateless. This puts severe limitations on the console subsystem and makes forced takeover and output in emergency and panic situations a fragile endeavour that is based on try and pray. The goal of non-BKL (nbcon) consoles is to break out of the console lock jail and to provide a new infrastructure that avoids the pitfalls and also allows console drivers to be gradually converted over. The proposed infrastructure aims for the following properties: - Per console locking instead of global locking - Per console state that allows to make informed decisions - Stateful handover and takeover As a first step, state is added to struct console. The per console state is an atomic_t using a 32bit bit field. Reserve state bits, which will be populated later in the series. Wire it up into the console register/unregister functionality. It was decided to use a bitfield because using a plain u32 with mask/shift operations resulted in uncomprehensible code. Co-developed-by: John Ogness Signed-off-by: John Ogness Signed-off-by: Thomas Gleixner (Intel) Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20230916192007.608398-2-john.ogness@linutronix.de commit db8588f95cc5e4c9d134f7f4f939b1eade419560 Author: Bartosz Golaszewski Date: Fri Sep 15 14:34:23 2023 +0200 gpio: sim: include a missing header We're using various ERR macros from linux/err.h but the include is missing. Add it. Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Bartosz Golaszewski commit f00928012886a07ca6817ea70eb4856ce280ce05 Author: Uwe Kleine-König Date: Tue Sep 12 19:12:49 2023 +0200 wifi: wlcore: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. wlcore_remove() returned zero unconditionally. With that converted to return void instead, the wl12xx and wl18xx driver can be converted to .remove_new trivially. Signed-off-by: Uwe Kleine-König Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230912171249.755901-1-u.kleine-koenig@pengutronix.de commit c35642806830e8667d4f3ff5eab99afbc8c88094 Author: Zenm Chen Date: Tue Sep 12 13:36:14 2023 +0800 wifi: rtl8xxxu: Add a description about the device ID 0x7392:0xb722 According to the driver provided by EDIMAX, the device ID 0x7392:0xb722 belongs to EDIMAX EW-7722UTn V3, so add a comment about this. Signed-off-by: Zenm Chen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230912053614.10644-1-zenmchen@gmail.com commit 7c8a55dd265b2801e5d133435edb4422d5ff6ab8 Author: Ping-Ke Shih Date: Mon Sep 11 16:20:49 2023 +0800 wifi: rtw89: add mac_gen pointer to access mac port registers Using mac_gen pointer to reuse the code with WiFi 7 chips, and define MAC ports registers for WiFi 7 chips. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230911082049.33541-7-pkshih@realtek.com commit 651298138e42555be2824ae8a9f69db8a2185537 Author: Ping-Ke Shih Date: Mon Sep 11 16:20:48 2023 +0800 wifi: rtw89: consolidate registers of mac port to struct MAC port is a design to support virtual interface on single MAC hardware. For next generation chips, register addresses are changed but definitions are the same, so move registers together to be easier to reuse codes. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230911082049.33541-6-pkshih@realtek.com commit c8b9a49f7a3dc2eafe61f8d4bd7924b328e1a260 Author: Ping-Ke Shih Date: Mon Sep 11 16:20:47 2023 +0800 wifi: rtw89: add chip_info::txwd_info size to generalize TX WD submit For existing chips, size of TX WD info is 6 words, but upcoming WiFi 7 chips become 8 words, so add a chip_info to reuse the code. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230911082049.33541-5-pkshih@realtek.com commit d542ee748ec3bb56ff87159dc4a745b98c2c8576 Author: Ping-Ke Shih Date: Mon Sep 11 16:20:46 2023 +0800 wifi: rtw89: add to fill TX descriptor v2 The format v2 of TX descriptor contains 8-word body and 8-word info, and fields include packet size, MAC_ID, security key ID and etc. By design, it can possibly only fill body to reduce overhead, but this driver keeps thing simple, so always fill body and info currently. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230911082049.33541-4-pkshih@realtek.com commit 6f09ff0a0927b464256f6e6b3fcd289c66bff6c6 Author: Ping-Ke Shih Date: Mon Sep 11 16:20:45 2023 +0800 wifi: rtw89: add to fill TX descriptor for firmware command v2 This kind of TX descriptor is used to download firmware or send firmware command. Because we want to reduce descriptor overhead and this only needs two fields 'size' and 'type', hardware designers choose short form of RX descriptor for it. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230911082049.33541-3-pkshih@realtek.com commit a1cb73f2953904139cb04cbb530c8ef41e540808 Author: Ping-Ke Shih Date: Mon Sep 11 16:20:44 2023 +0800 wifi: rtw89: add to query RX descriptor format v2 RX descriptor is used to provide meta data of received data. The WiFi 7 chips use different RX descriptor format, so add this parser along with hardware design. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230911082049.33541-2-pkshih@realtek.com commit 97211e02631312f10b33d2b1e2ee37a3ab0813ef Author: Zong-Zhe Yang Date: Fri Sep 8 11:11:45 2023 +0800 wifi: rtw89: mcc: deal with beacon NoA if GO exists In MCC STA+GO mode, we calculate NoA information and fill it into the beacon of P2P GO. Since NoA uses only 32 bits to describe time things, we need to deal with renewal when TSF[63:32] is carried. We trigger FW to notify that. Then, we can update NoA information for new time period once we get notification from FW. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230908031145.20931-9-pkshih@realtek.com commit 9ecb40ef5281eeb5eb06ca6b428f4142987ce0cb Author: Zong-Zhe Yang Date: Fri Sep 8 11:11:44 2023 +0800 wifi: rtw89: mcc: deal with BT slot change When receiving request of adjusting BT slot from coex. mechanism, we need to fetch the new BT slot and use the new one to calculate MCC (multi-channel concurrency) pattern. Then, we update the new MCC pattern to FW. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230908031145.20931-8-pkshih@realtek.com commit 15fe9b731953ace45e3edb3fdd3c3fc0c9250d22 Author: Zong-Zhe Yang Date: Fri Sep 8 11:11:43 2023 +0800 wifi: rtw89: mcc: deal with P2P PS change MCC fills duration limit of a role according to NoA description. If P2P PS changes during MCC, we don't process P2P PS via normal flow. Instead, we re-fill duration limit of the role for new NoA description, and then we do MCC update. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230908031145.20931-7-pkshih@realtek.com commit 5f69aabab12603201bb5101ad195160ce7e779b0 Author: Zong-Zhe Yang Date: Fri Sep 8 11:11:42 2023 +0800 wifi: rtw89: mcc: track beacon offset and update when needed In MCC STA+GC mode, the offset between TBTTs of remote AP and remote GO might change. If the change is larger than tolerance, we should update MCC after re-calculating parameters for new things. So, we track that in rtw89_track_work() now. And, we add MCC update flow to tell FW either to change durations of roles or to replace entire pattern according to how MCC plans BT slot. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230908031145.20931-6-pkshih@realtek.com commit 31e415e3d08a3fe2cde555333a4ca3da6f483ef9 Author: Zong-Zhe Yang Date: Fri Sep 8 11:11:41 2023 +0800 wifi: rtw89: mcc: update role bitmap when changed Each MCC (multi-channel concurrency) role maintains a bitmap of mac IDs. The bitmap is supposed to contain the two points below. * mac ID of itself * mac ID(s) of STA(s) connecting to it Under STA+GC mode, the bitmaps of both roles should not change. However, under STA+GO mode, the bitmap of GO may change due to P2P clients which connect/disconnect to/from it. FW controls (TDMA-based) MCC things via mac IDs in bitmap of each role. For example, mac IDs are required by FW when it wants to pause role1's TX in role0 slot. So, to sync between driver and FW, we update the new mac ID bitmap of GO to FW once it's changed. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230908031145.20931-5-pkshih@realtek.com commit 6e9d6f8254ee4fd737b954a3d9cf70360d211dbf Author: Zong-Zhe Yang Date: Fri Sep 8 11:11:40 2023 +0800 wifi: rtw89: 52c: rfk: disable DPK during MCC DPK is one kind of RF calibration. When MCC (multi-channel concurrency) start/stop, DPK needs to do extra things to be off/on. We add a chanctx callback type, RTW89_CHANCTX_CALLBACK_RFK, and register it for RTL8852C to deal with DPK according to MCC states. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230908031145.20931-4-pkshih@realtek.com commit c83ff9a3a2ca1146dae0fdcb2e518ea83fc0e42d Author: Zong-Zhe Yang Date: Fri Sep 8 11:11:39 2023 +0800 wifi: rtw89: rfk: disable driver tracking during MCC After MCC (multi-channel concurrency) is started, FW will control channel changes and use the corresponding backup of RF calibration result. And, driver RF calibration (RF-K) won't be able to keep up with the speed at which the channels are changing. So, even if we keep tracking it in driver, the RF-K result might not be good either. To save these unnecessary things, we disable driver RF-K tracking during MCC. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230908031145.20931-3-pkshih@realtek.com commit 74b45618f5342ce519ec39659b217a22570420dd Author: Zong-Zhe Yang Date: Fri Sep 8 11:11:38 2023 +0800 wifi: rtw89: 52c: rfk: refine MCC channel info notification RF calibration will notify FW to backup the calibration result after it is done on a channel. For MCC (multi-channel concurrency) flow, when we at RTW89_ENTITY_MODE_MCC_PREPARE mode, RF calibration should execute on second channel of MCC, i.e. RTW89_SUB_ENTITY_1, and then, notify FW to backup the result for the second one. Originally, the RF calibration flow only fit single channel case. We are planning to support MCC on RTL8852C, so we refine its RF calibration flow to fit MCC case. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230908031145.20931-2-pkshih@realtek.com commit b7bcea9c27b3d87b54075735c870500123582145 Author: Jeff Johnson Date: Thu Aug 31 11:22:57 2023 -0700 wifi: cw1200: Avoid processing an invalid TIM IE While converting struct ieee80211_tim_ie::virtual_map to be a flexible array it was observed that the TIM IE processing in cw1200_rx_cb() could potentially process a malformed IE in a manner that could result in a buffer over-read. Add logic to verify that the TIM IE length is large enough to hold a valid TIM payload before processing it. Signed-off-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230831-ieee80211_tim_ie-v3-1-e10ff584ab5d@quicinc.com commit 4c64d708f99378e6719294cc63a77adf8eeb82b4 Author: Xinghui Li Date: Tue Jun 27 19:38:08 2023 +0800 PCI: vmd: Fix inconsistent indentation in vmd_resume() The if-statement within the vmd_resume() function has an inconsistent indentation that leads to a compile time warning. Thus, correct the inconsistent indentation. While at it, remove the if-statement completely, which will make the code simpler. This was detected by Smatch: drivers/pci/controller/vmd.c:1066 vmd_resume() warn: inconsistent indenting No functional changes are intended. [kwilczynski: use correct tags, commit log] Suggested-by: Christoph Hellwig Link: https://lore.kernel.org/linux-pci/20230627113808.269716-1-korantwork@gmail.com Reported-by: Dan Carpenter Signed-off-by: Xinghui Li Signed-off-by: Krzysztof Wilczyński commit 4ed2b53b463f23a578e5948062f51a63f4d30fbe Author: Imre Deak Date: Thu Sep 14 01:32:18 2023 +0300 drm/i915/dp_mst: Tune down error message during payload addition If a sink is removed in the middle of payload addition drm_dp_add_payload_part1() will fail as expected, either not finding the payload's MST port or failing the payload-add AUX transaction. Based on the above tune the error message down to a debug messge. Cc: Lyude Paul Reviewed-by: Lyude Paul Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230913223218.540365-4-imre.deak@intel.com commit 0663e1da5ba8e6459e3555ac12c62741668c0d30 Author: Imre Deak Date: Thu Sep 14 01:32:17 2023 +0300 drm/dp_mst: Tune down error message during payload addition If a sink is removed in the middle of payload addition the corresponding AUX transfer will fail as expected, so tune the error message down to a debug messge. Cc: Wayne Lin Cc: Lyude Paul Cc: dri-devel@lists.freedesktop.org Signed-off-by: Imre Deak Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230913223218.540365-3-imre.deak@intel.com commit 8bde4442acbba41300cc7fd8e48122c70963e041 Author: Imre Deak Date: Thu Sep 14 01:32:16 2023 +0300 drm/dp_mst: Sanitize error return during payload addition Return an error during payload addition if the payload port isn't found. This shouldn't change the behavior since only the i915 driver checks the return value, printing an error message in case of a failure. While at it simplify the control flow. Cc: Wayne Lin Cc: Lyude Paul Cc: dri-devel@lists.freedesktop.org Signed-off-by: Imre Deak Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230913223218.540365-2-imre.deak@intel.com commit 47fadb03bdfd26a7a6d110e1ee60d472b4881b6e Author: Imre Deak Date: Thu Sep 14 01:32:15 2023 +0300 drm/dp_mst: Fix NULL dereference during payload addition Fix the NULL dereference leading to the following stack trace: [ 129.687181] i915 0000:00:02.0: [drm:drm_dp_add_payload_part1 [drm_display_helper]] VCPI 1 for port 000000005be4423e not in topology, not creating a payload to remote [ 129.687257] BUG: kernel NULL pointer dereference, address: 0000000000000560 [ 129.694276] #PF: supervisor read access in kernel mode [ 129.699459] #PF: error_code(0x0000) - not-present page [ 129.704612] PGD 0 P4D 0 [ 129.707178] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 129.711556] CPU: 2 PID: 1623 Comm: Xorg Tainted: G U 6.6.0-rc1-imre+ #985 [ 129.719744] Hardware name: Intel Corporation Alder Lake Client Platform/AlderLake-P DDR5 RVP, BIOS RPLPFWI1.R00.4035.A00.2301200723 01/20/2023 [ 129.732509] RIP: 0010:drm_dp_mst_topology_put_port+0x19/0x170 [drm_display_helper] [ 129.740111] Code: 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 89 fb 48 83 ec 08 <48> 8b 87 60 05 00 00 44 8b 0f 48 8b 70 58 41 83 e9 01 48 85 f6 74 [ 129.758842] RSP: 0018:ffffc90001daf900 EFLAGS: 00010286 [ 129.764104] RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000000 [ 129.771246] RDX: 0000000000000000 RSI: ffffffff9e73d613 RDI: 0000000000000000 [ 129.778394] RBP: ffffc90001daf930 R08: 0000000000000000 R09: 0000000000000020 [ 129.785533] R10: 0000000000ffff10 R11: 000000000000000f R12: ffff888116c65e40 [ 129.792680] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 129.799822] FS: 00007f39f74b1a80(0000) GS:ffff88840f680000(0000) knlGS:0000000000000000 [ 129.807913] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 129.813670] CR2: 0000000000000560 CR3: 0000000138b88000 CR4: 0000000000750ee0 [ 129.820815] PKRU: 55555554 [ 129.823551] Call Trace: [ 129.826022] [ 129.828154] ? show_regs+0x65/0x70 [ 129.831599] ? __die+0x24/0x70 [ 129.834683] ? page_fault_oops+0x160/0x480 [ 129.838824] ? dev_printk_emit+0x83/0xb0 [ 129.842797] ? do_user_addr_fault+0x2e2/0x680 [ 129.847175] ? exc_page_fault+0x78/0x180 [ 129.851143] ? asm_exc_page_fault+0x27/0x30 [ 129.855353] ? drm_dp_mst_topology_put_port+0x19/0x170 [drm_display_helper] [ 129.862354] drm_dp_add_payload_part1+0x85/0x100 [drm_display_helper] [ 129.868832] intel_mst_pre_enable_dp+0x1ef/0x240 [i915] [ 129.874170] intel_encoders_pre_enable+0x83/0xa0 [i915] [ 129.879524] hsw_crtc_enable+0xbe/0x750 [i915] [ 129.884095] intel_enable_crtc+0x68/0xa0 [i915] [ 129.888752] skl_commit_modeset_enables+0x2c4/0x5d0 [i915] [ 129.894365] intel_atomic_commit_tail+0x765/0x1070 [i915] [ 129.899885] intel_atomic_commit+0x3ba/0x400 [i915] [ 129.904892] drm_atomic_commit+0x96/0xd0 [drm] [ 129.909405] ? __pfx___drm_printfn_info+0x10/0x10 [drm] [ 129.914698] drm_atomic_helper_set_config+0x7e/0xc0 [drm_kms_helper] [ 129.921102] drm_mode_setcrtc+0x5af/0x8d0 [drm] [ 129.925695] ? __pfx_drm_mode_setcrtc+0x10/0x10 [drm] [ 129.930810] drm_ioctl_kernel+0xc4/0x170 [drm] [ 129.935317] drm_ioctl+0x2a4/0x520 [drm] [ 129.939305] ? __pfx_drm_mode_setcrtc+0x10/0x10 [drm] [ 129.944415] ? __fget_light+0xa5/0x110 [ 129.948212] __x64_sys_ioctl+0x98/0xd0 [ 129.951985] do_syscall_64+0x37/0x90 [ 129.955581] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 Fixes: 5aa1dfcdf0a4 ("drm/mst: Refactor the flow for payload allocation/removement") Cc: Wayne Lin Cc: Lyude Paul Cc: dri-devel@lists.freedesktop.org Reviewed-by: Lyude Paul Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230913223218.540365-1-imre.deak@intel.com commit 89286e235c2f71244de39ec3992bcded504eb6d2 Author: Kuninori Morimoto Date: Mon Sep 11 01:41:55 2023 +0000 ASoC: da7213: add .auto_selectable_formats support By this patch, DAI format might be automatically selected (Depends on paired DAI, and/or Sound Card). Signed-off-by: Kuninori Morimoto Cc: Linh Phung Tested-by: Khanh Le Link: https://lore.kernel.org/r/87y1hdh4f1.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit e335f29583ac9bb3ba454a1273a3d72c6d2e1fec Author: Kuninori Morimoto Date: Mon Sep 11 01:41:48 2023 +0000 ASoC: da7213: tidyup SND_SOC_DAIFMT_xxx We should use P/C instead of M/S for SND_SOC_DAIFMT_CBx_CFx. We should use SND_SOC_DAIFMT_xxx instead of SND_SOC_DAI_FORMAT_xxx This patch tidyup these. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87zg1th4f8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 5d5529b0057146043a4328aa194280299ba966c2 Author: John Watts Date: Mon Sep 18 23:15:32 2023 +1000 ASoC: dt-bindings: wlf,wm8782: Add wlf,fsampen property The WM8782 can safely support rates higher than 48kHz by changing the value of the FSAMPEN pin. Allow specifying the FSAMPEN pin value in the device tree. Signed-off-by: John Watts Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230918131532.2257615-4-contact@jookia.org Signed-off-by: Mark Brown commit 5d34887eab8daad8f63d584ae4d12d480beb9f0e Author: John Watts Date: Mon Sep 18 23:15:31 2023 +1000 ASoC: wm8782: Use wlf,fsampen device tree property The wm8782 supports rates 96kHz and 192kHz as long as the hardware is configured properly. Allow this to be specified in the device tree. Signed-off-by: John Watts Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230918131532.2257615-3-contact@jookia.org Signed-off-by: Mark Brown commit 00524a8415aa400567538c0e75a463d517cded7f Author: John Watts Date: Mon Sep 18 23:15:30 2023 +1000 ASoC: wm8782: Constrain maximum audio rate at runtime The wm8782 supports up to 192kHz audio when pins are set correctly. Instead of hardcoding which rates are supported constrain them at runtime based on a max_rate variable. Signed-off-by: John Watts Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230918131532.2257615-2-contact@jookia.org Signed-off-by: Mark Brown commit f392f3796bba1a160b8ad706bfe1e1ec3581ad48 Author: Sebastian Reichel Date: Sun Sep 17 21:01:24 2023 +0200 dt-bindings: power: supply: Drop deprecated ab8500-battery Linus Walleij modified AB8500 to use the generic simple-battery and samsung,battery bindings. This is an unused leftover that can be removed. Reviewed-by: Linus Walleij Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230917190124.1012316-1-sebastian.reichel@collabora.com Signed-off-by: Sebastian Reichel commit 21f252cd29f08892d48739fd7513ad79c1cff96a Author: Bartosz Golaszewski Date: Mon Sep 11 18:15:53 2023 +0200 spi: bcm2835: reduce the abuse of the GPIO API Currently the bcm2835 SPI driver uses functions that are available exclusively to GPIO providers as a way to handle a platform quirk. Let's use a slightly better alternative that avoids poking around in GPIOLIB's internals and use GPIO lookup tables. Link: https://www.spinics.net/lists/linux-gpio/msg36218.html Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230911161553.24313-1-brgl@bgdev.pl Signed-off-by: Mark Brown commit 9386c958beb77aee0d95d5fd0c79babd06a86c7d Author: Uwe Kleine-König Date: Sat Sep 16 18:12:35 2023 +0200 spi: Drop warning from spi_stop_queue() Both callers of spi_stop_queue() (i.e. spi_destroy_queue() and spi_controller_suspend()) already emit an error message if spi_stop_queue() fails. Another warning in this case isn't helpful, so drop it. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230916161235.1050176-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit a5ea26536e89d04485aa9e1c8f60ba11dfc5469e Merge: e8535bfbad326 b2504f649bda9 Author: David S. Miller Date: Mon Sep 18 12:44:36 2023 +0100 Merge branch 'stmmac-devvm_stmmac_probe_config_dt-conversion' Jisheng Zhang says: ==================== stmmac: convert to devm_stmmac_probe_config_dt Russell pointed out there's a new devm_stmmac_probe_config_dt() helper now when reviewing my starfive gmac error handling patch[1]. After greping the code, this nice helper was introduced by Bartosz in [2], I think it's time to convert all dwmac users to this helper and finally complete the TODO in [2] "but once all users of the old stmmac_pltfr_remove() are converted to the devres helper, it will be renamed back to stmmac_pltfr_remove() and the no_dt function removed." Link: https://lore.kernel.org/netdev/ZOtWmedBsa6wQQ6+@shell.armlinux.org.uk/ [1] Link: https://lore.kernel.org/all/20230623100417.93592-1-brgl@bgdev.pl/ [2] Since v1: - rebase on new net-next - add make stmmac_{probe|remove}_config_dt static as suggested by Russell. ==================== Reviewed-by: Emil Renner Berthing Signed-off-by: David S. Miller commit b2504f649bda92094dedfb721c7d49f9a348d500 Author: Jisheng Zhang Date: Sat Sep 16 15:58:29 2023 +0800 net: stmmac: make stmmac_{probe|remove}_config_dt static Now there's no external users of these two functions, make them static so that there aren't any new usages of stmmac_probe_config_dt(). To avoid forward declaration, move stmmac_remove_config_dt() location. Signed-off-by: Jisheng Zhang Suggested-by: Russell King Signed-off-by: David S. Miller commit 2c9fc838067b02cb3e6057fef5cd7cf1c04a95aa Author: Jisheng Zhang Date: Sat Sep 16 15:58:28 2023 +0800 net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove Now, all users of the old stmmac_pltfr_remove() are converted to the devres helper, it's time to rename stmmac_pltfr_remove_no_dt() back to stmmac_pltfr_remove() and remove the old stmmac_pltfr_remove(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit d336a117b593e96559c309bb250f06b4fc22998f Author: Jisheng Zhang Date: Sat Sep 16 15:58:27 2023 +0800 net: stmmac: dwmac-visconti: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The calling of stmmac_pltfr_remove() now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit acf73ccff08e6a19b9937623d5eeed0e7a59a158 Author: Jisheng Zhang Date: Sat Sep 16 15:58:26 2023 +0800 net: stmmac: dwmac-tegra: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The calling of stmmac_pltfr_remove() now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 291595337626a14b1116f1a9d93a5415ba12c030 Author: Jisheng Zhang Date: Sat Sep 16 15:58:25 2023 +0800 net: stmmac: dwmac-sunxi: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The remove_new() callback now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Reviewed-by: Jernej Skrabec Signed-off-by: David S. Miller commit 9bdf6909877c994e58c7206b0a5305290393c115 Author: Jisheng Zhang Date: Sat Sep 16 15:58:24 2023 +0800 net: stmmac: dwmac-sun8i: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The calling of stmmac_pltfr_remove() now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Reviewed-by: Jernej Skrabec Signed-off-by: David S. Miller commit 373845154618605a6364e7df877f53ff491131eb Author: Jisheng Zhang Date: Sat Sep 16 15:58:23 2023 +0800 net: stmmac: dwmac-stm32: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit c9445e0bd7299d2d30a7c3a8400fccede9e2b5b1 Author: Jisheng Zhang Date: Sat Sep 16 15:58:22 2023 +0800 net: stmmac: dwmac-sti: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 6d6c119373593d769ee483e472ac376c2446d801 Author: Jisheng Zhang Date: Sat Sep 16 15:58:21 2023 +0800 net: stmmac: dwmac-starfive: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The remove_new() callback now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 9086d3f2b5607f40cb1d37bf4a044f81749fd27e Author: Jisheng Zhang Date: Sat Sep 16 15:58:20 2023 +0800 net: stmmac: dwmac-socfpga: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The calling of stmmac_pltfr_remove() now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 8eee20e10d6f5fd7c43bf14a0488f07524d9b6df Author: Jisheng Zhang Date: Sat Sep 16 15:58:19 2023 +0800 net: stmmac: dwmac-rk: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 551022d680ec194ae935b54a9b5c28d4136b32a8 Author: Jisheng Zhang Date: Sat Sep 16 15:58:18 2023 +0800 net: stmmac: dwmac-meson8b: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The remove_new() callback now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 780b63ae208e249b4a0f5249af7396c4b3ee4cca Author: Jisheng Zhang Date: Sat Sep 16 15:58:17 2023 +0800 net: stmmac: dwmac-meson: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The remove_new() callback now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit d7209c056a49a698e8b1212eff6ae228f02bbee4 Author: Jisheng Zhang Date: Sat Sep 16 15:58:16 2023 +0800 net: stmmac: dwmac-mediatek: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The calling of stmmac_pltfr_remove() now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit d30c08a3b001b4d67609475f1b9740ea4bc96e37 Author: Jisheng Zhang Date: Sat Sep 16 15:58:15 2023 +0800 net: stmmac: dwmac-lpc18xx: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The remove_new() callback now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 72ab86c27d4ec3d95d4d0901aea357977b4009fa Author: Jisheng Zhang Date: Sat Sep 16 15:58:14 2023 +0800 net: stmmac: dwmac-ipq806x: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The remove_new() callback now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit abea8fd5e801a679312479b2bf00d7b4285eca78 Author: Jisheng Zhang Date: Sat Sep 16 15:58:13 2023 +0800 net: stmmac: dwmac-intel-plat: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The calling of stmmac_pltfr_remove() now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 6bb53b2abf30c68090f1ec0a040b350278706c5d Author: Jisheng Zhang Date: Sat Sep 16 15:58:12 2023 +0800 net: stmmac: dwmac-ingenic: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The remove_new() callback now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 115c9248b19b2d94f9b63b7572dafec124be498e Author: Jisheng Zhang Date: Sat Sep 16 15:58:11 2023 +0800 net: stmmac: dwmac-imx: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The remove_new() callback now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 14ec0fc582c5f49695ba02fc26c6280eff269899 Author: Jisheng Zhang Date: Sat Sep 16 15:58:10 2023 +0800 net: stmmac: dwmac-generic: use devm_stmmac_pltfr_probe() Use the devres variant of stmmac_pltfr_probe() and finally drop the remove() hook. Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit d53b19d2a1a82a7b50a9f626cad21918c0e46cdf Author: Jisheng Zhang Date: Sat Sep 16 15:58:09 2023 +0800 net: stmmac: dwmac-generic: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The remove_new() callback now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 0485825dd6a8904f8a29fe9992dede6644b263e7 Author: Jisheng Zhang Date: Sat Sep 16 15:58:08 2023 +0800 net: stmmac: dwmac-dwc-qos-eth: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 6f799fd9dda7ea91c19b5600a7cf05400751d105 Author: Jisheng Zhang Date: Sat Sep 16 15:58:07 2023 +0800 net: stmmac: dwmac-anarion: use devm_stmmac_probe_config_dt() Simplify the driver's probe() function by using the devres variant of stmmac_probe_config_dt(). The remove_new() callback now needs to be switched to stmmac_pltfr_remove_no_dt(). Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 4ececeb839868ad235515f5bb332530f2ac11253 Author: David Ahern Date: Mon Sep 11 15:57:53 2023 -0600 IB/hfi1: Remove open coded reference to skb frag offset frag offset should be obtained from skb_frag_off; update the code. Signed-off-by: David Ahern Cc: Dennis Dalessandro Link: https://lore.kernel.org/r/20230911215753.12325-1-dsahern@kernel.org Signed-off-by: Leon Romanovsky commit a966a0da3bae94d671bbd146ff2e3059eb07d5b0 Author: Srinivas Pandruvada Date: Wed Sep 13 10:35:10 2023 -0700 thermal: int340x: Add ArrowLake-S PCI ID Add ArrowLake-S PCI ID for processor thermal device. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit e8535bfbad326af6061479526effb94084edacd3 Merge: 1cb6422ecac88 8452a05b2c633 Author: David S. Miller Date: Mon Sep 18 11:37:08 2023 +0100 Merge branch 'stmmac-tx-coe' Rohan G Thomas says: ==================== net: stmmac: Tx coe sw fallback DW xGMAC IP can be synthesized such that it can support tx checksum offloading only for a few initial tx queues. Also as Serge pointed out, for the DW QoS IP, tx coe can be individually configured for each tx queue. This patchset adds support for tx coe sw fallback for those queues that don't support tx coe. Also, add binding for snps,coe-unsupported property. changelog v7: * Updated commit message. * Add blank lines around newly added dt binding. changelog v6: * Reworked patchset to cover DW QoS Ethernet IP also. changelog v5: * As rightly suggested by Serge, reworked redundant code. changelog v4: * Replaced tx_q_coe_lmt with bit flag. changelog v3: * Resend with complete email list. changelog v2: * Reformed binding description. * Minor grammatical corrections in comments and commit messages. ==================== Signed-off-by: David S. Miller commit 8452a05b2c633b708dbe3e742f71b24bf21fe42d Author: Rohan G Thomas Date: Sat Sep 16 14:33:12 2023 +0800 net: stmmac: Tx coe sw fallback Add sw fallback of tx checksum calculation for those tx queues that don't support tx checksum offloading. DW xGMAC IP can be synthesized such that it can support tx checksum offloading only for a few initial tx queues. Also as Serge pointed out, for the DW QoS IP, tx coe can be individually configured for each tx queue. So when tx coe is enabled, for any tx queue that doesn't support tx coe with 'coe-unsupported' flag set will have a sw fallback happen in the driver for tx checksum calculation when any packets to be transmitted on these tx queues. Signed-off-by: Rohan G Thomas Signed-off-by: David S. Miller commit 6fb8c20a04be234cf1cfd4bdd8cfb8860c9d2d3b Author: Rohan G Thomas Date: Sat Sep 16 14:33:11 2023 +0800 dt-bindings: net: snps,dwmac: Tx coe unsupported Add dt-bindings for coe-unsupported property per tx queue. Some DWMAC IPs support tx checksum offloading(coe) only for a few tx queues. DW xGMAC IP can be synthesized such that it can support tx coe only for a few initial tx queues. Also as Serge pointed out, for the DW QoS IP tx coe can be individually configured for each tx queue. This property is added to have sw fallback for checksum calculation if a tx queue doesn't support tx coe. Signed-off-by: Rohan G Thomas Acked-by: Conor Dooley Signed-off-by: David S. Miller commit 484281d5436cace1be87584120d74c24d0dba833 Author: Jernej Skrabec Date: Sat Sep 9 16:44:32 2023 +0200 drm/bridge: dw-hdmi-cec: Add arbitration lost event Add handling of arbitration lost event. Signed-off-by: Jernej Skrabec Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230909144432.34972-1-jernej.skrabec@gmail.com commit 1cb6422ecac8804ebe0b71f4b3440674955fec73 Author: Kees Cook Date: Fri Sep 15 13:15:10 2023 -0700 ceph: Annotate struct ceph_monmap with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct ceph_monmap. Additionally, since the element count member must be set before accessing the annotated flexible array member, move its initialization earlier. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Ilya Dryomov Cc: Xiubo Li Cc: Jeff Layton Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: ceph-devel@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Xiubo Li Signed-off-by: David S. Miller commit abc91aaa1937faaea3b385745956f3aeaae0b605 Author: Conor Dooley Date: Mon Sep 18 10:33:32 2023 +0100 soc: sifive: replace SOC_FOO with ARCH_FOO As part of unifiying what RISC-V calls microarch symbols to use ARCH_, replace users of the SOC_ forms. Signed-off-by: Conor Dooley commit c980248179d655d33af47f0b0bec1ce8660994c6 Author: Thomas Gleixner Date: Thu Sep 14 20:44:31 2023 +0206 serial: xilinx_uartps: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-75-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 4bfdd1edfe2eb3a8468e1792714a83fd9efd1860 Author: Thomas Gleixner Date: Thu Sep 14 20:44:30 2023 +0206 serial: vt8500: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-74-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit e21d6c8d60de1f500bc64ef102da1e908ee7b7aa Author: Thomas Gleixner Date: Thu Sep 14 20:44:29 2023 +0206 serial: ucc_uart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Acked-by: Timur Tabi Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-73-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit de71068b6a06788dd179136f43d2d873e6fd14a9 Author: Thomas Gleixner Date: Thu Sep 14 20:44:28 2023 +0206 serial: uartlite: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-72-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 07e893522ead361ad5b43f57a195fd94ec79ccb0 Author: Thomas Gleixner Date: Thu Sep 14 20:44:27 2023 +0206 serial: timbuart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-71-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 3d728b9edb04ab736d76b421c4e5e9f33190cf55 Author: Thomas Gleixner Date: Thu Sep 14 20:44:26 2023 +0206 serial: sunzilog: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-70-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit f610d445ff1a0e812656f7f9cb8498d4d9b0cae2 Author: Thomas Gleixner Date: Thu Sep 14 20:44:25 2023 +0206 serial: sunsu: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-69-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 35e0a339521c075053b9a34cc42576a04d6e5923 Author: Thomas Gleixner Date: Thu Sep 14 20:44:24 2023 +0206 serial: sunsab: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-68-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 3ea01838fc7ba9067ab0ac803964a4dd28afa4a2 Author: Thomas Gleixner Date: Thu Sep 14 20:44:23 2023 +0206 serial: sunplus-uart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-67-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 71007c5e7851e880dc23c141d0708794bc3bbf9e Author: Thomas Gleixner Date: Thu Sep 14 20:44:22 2023 +0206 serial: sunhv: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-66-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit c5d06662551c5e5623fd138016dcd93a48b0c3d8 Author: Thomas Gleixner Date: Thu Sep 14 20:44:21 2023 +0206 serial: stm32: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-65-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 47d4dfd9acb7375ead238bf85aceff94999e956f Author: Thomas Gleixner Date: Thu Sep 14 20:44:20 2023 +0206 serial: st-asc: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-64-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit e58d551d27b995e58b678f096865b92b5d7e0f3e Author: Thomas Gleixner Date: Thu Sep 14 20:44:19 2023 +0206 serial: sprd: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-63-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 93614eff7e8bde60ae97a89933378dd7afe8aca2 Author: Thomas Gleixner Date: Thu Sep 14 20:44:18 2023 +0206 serial: sifive: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-62-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 94c537702c1d80e86bf8f51dcf9cc132a10e641c Author: Thomas Gleixner Date: Thu Sep 14 20:44:17 2023 +0206 serial: sh-sci: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-61-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit b04cfd7d86e046dde64495f77525154525e961e5 Author: Thomas Gleixner Date: Thu Sep 14 20:44:16 2023 +0206 serial: txx9: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-60-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 9683eeb689bd8712de680d6b41db7dabc3ddb74c Author: Thomas Gleixner Date: Thu Sep 14 20:44:15 2023 +0206 serial: mctrl_gpio: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-59-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 559c7ff4e3245583c0093de7398ccb9071577f30 Author: Thomas Gleixner Date: Thu Sep 14 20:44:14 2023 +0206 serial: core: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-58-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 603445a6f6a424cf681b1197b345e2d5a63a947a Author: Thomas Gleixner Date: Thu Sep 14 20:44:13 2023 +0206 serial: tegra: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-57-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit b465848be8a652e2c5fefe102661fb660cff8497 Author: Thomas Gleixner Date: Thu Sep 14 20:44:12 2023 +0206 serial: sc16is7xx: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-56-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 48026e2409ec5460ae2b416759c9264b1ef373b7 Author: Thomas Gleixner Date: Thu Sep 14 20:44:11 2023 +0206 serial: sb1250-duart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-55-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 97d7a9aeba1d424c2359f1686d02c75d798ad184 Author: Thomas Gleixner Date: Thu Sep 14 20:44:10 2023 +0206 serial: samsung_tty: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-54-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit b9cedc0286dadfff580c69ff0b6bc70eb319f1b4 Author: Thomas Gleixner Date: Thu Sep 14 20:44:09 2023 +0206 serial: sa1100: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-53-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit b4a88faeb52c97837bd93eab61ca843b9dd2b1ca Author: Thomas Gleixner Date: Thu Sep 14 20:44:08 2023 +0206 serial: rp2: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-52-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 7c572c17ca898870822bf7d3a6c32f357527f132 Author: Thomas Gleixner Date: Thu Sep 14 20:44:07 2023 +0206 serial: rda: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-51-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit b8ba915d960d03bd7e24eab80f0820bdd19203ec Author: Thomas Gleixner Date: Thu Sep 14 20:44:06 2023 +0206 serial: qcom-geni: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Bjorn Andersson Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-50-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit ae3c39625fb18957e6ed213069b43c58b5320016 Author: Thomas Gleixner Date: Thu Sep 14 20:44:05 2023 +0206 serial: pxa: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-49-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit b7d094df7f3e4a16948d4783104e0339197adad3 Author: Thomas Gleixner Date: Thu Sep 14 20:44:04 2023 +0206 serial: pmac_zilog: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-48-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 8975ed8cf0868d1bdfb6dbd1d34c268759698bbb Author: Thomas Gleixner Date: Thu Sep 14 20:44:03 2023 +0206 serial: pic32: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-47-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 150b59a795252eed5f111d43b5567a5fac543703 Author: Thomas Gleixner Date: Thu Sep 14 20:44:02 2023 +0206 serial: pch: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-46-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 68dcb36907f6b80e2fc70c9cd385302966b79393 Author: Thomas Gleixner Date: Thu Sep 14 20:44:01 2023 +0206 serial: owl: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-45-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit bf607decd0f6e1eea8eebde57e6ded2373e3be5a Author: Thomas Gleixner Date: Thu Sep 14 20:44:00 2023 +0206 serial: omap: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-44-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit f9b7652c32ebf5d0e2842333fa8ca9ba115ad424 Author: Thomas Gleixner Date: Thu Sep 14 20:43:59 2023 +0206 serial: mvebu-uart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-43-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 6cbd979080c788db32b2b3960599dadf1d001368 Author: Thomas Gleixner Date: Thu Sep 14 20:43:58 2023 +0206 serial: msm: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Bjorn Andersson Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-42-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit dab781d277da6d9390ae4ba8f521476a8720e599 Author: Thomas Gleixner Date: Thu Sep 14 20:43:57 2023 +0206 serial: mps2-uart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-41-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit f82723d08011e7ebfba9afc573df9d6cdc3d456c Author: Thomas Gleixner Date: Thu Sep 14 20:43:56 2023 +0206 serial: mpc52xx: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-40-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 4f8cf64e035812cdce3cc8013c390a704d3e5c85 Author: Thomas Gleixner Date: Thu Sep 14 20:43:55 2023 +0206 serial: milbeaut_usio: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-39-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 042d78484c6389933befa0fec3757b45160d9181 Author: Thomas Gleixner Date: Thu Sep 14 20:43:54 2023 +0206 serial: meson: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Acked-by: Neil Armstrong Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-38-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 6db6bc75f4bf9b3df20fec2d3a909e7a26869462 Author: Thomas Gleixner Date: Thu Sep 14 20:43:53 2023 +0206 serial: men_z135_uart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-37-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit f78a6f1374dbbfa7ca23b82fb4b8a7ca1d11ebae Author: Thomas Gleixner Date: Thu Sep 14 20:43:52 2023 +0206 serial: mcf: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-36-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 1b42626add395027818ad8bfd45f5bdf6e063107 Author: Thomas Gleixner Date: Thu Sep 14 20:43:51 2023 +0206 serial: ma35d1: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-35-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 1c00934918b43e77a2ee6a9742121832b1dc5420 Author: Thomas Gleixner Date: Thu Sep 14 20:43:50 2023 +0206 serial: lpc32xx_hs: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-34-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 12e675503dbef7ed860187bc15d34965a0fd663f Author: Thomas Gleixner Date: Thu Sep 14 20:43:49 2023 +0206 serial: liteuart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Acked-by: Gabriel Somlo Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-33-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit e0e6d8b474d8bd146f94d4c2dc67f29edd2861ea Author: Thomas Gleixner Date: Thu Sep 14 20:43:48 2023 +0206 serial: jsm: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-32-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 893d225197d5fc6d112e8edb258265e885dd5246 Author: Thomas Gleixner Date: Thu Sep 14 20:43:47 2023 +0206 serial: ip22zilog: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-31-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 9067817b7196101d4fb8e417a0002734decba14f Author: Thomas Gleixner Date: Thu Sep 14 20:43:46 2023 +0206 serial: imx: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-30-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit b4c7ba244540506414faf7bfa8e46d14543cbbeb Author: Thomas Gleixner Date: Thu Sep 14 20:43:45 2023 +0206 serial: icom: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-29-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 92f4e05bcc7bd3af7591d7abaab8f8c9470c1e7b Author: Thomas Gleixner Date: Thu Sep 14 20:43:44 2023 +0206 serial: fsl_lpuart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-28-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 7c6725ffd58133536b372bdb3559e7da0c89e492 Author: Thomas Gleixner Date: Thu Sep 14 20:43:43 2023 +0206 serial: linflexuart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-27-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 08b08d7c352e90df3deb85e6c1ec7a06ff9d01a6 Author: Thomas Gleixner Date: Thu Sep 14 20:43:42 2023 +0206 serial: dz: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-26-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 2d8a3178f67503da2eaa676f8d1bf24d3eea0b18 Author: Thomas Gleixner Date: Thu Sep 14 20:43:41 2023 +0206 serial: digicolor: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Acked-by: Baruch Siach Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-25-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 34e042252f5bf01ae74e5c7c3b10ad8f90391ef3 Author: Thomas Gleixner Date: Thu Sep 14 20:43:40 2023 +0206 serial: cpm_uart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-24-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 778492b6db28ae5fb77b6e9a9c1987f9ee96d564 Author: Thomas Gleixner Date: Thu Sep 14 20:43:39 2023 +0206 serial: bcm63xx-uart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Florian Fainelli Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-23-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit cb9936f812ce2d437583e21a0f81a2823653535f Author: Thomas Gleixner Date: Thu Sep 14 20:43:38 2023 +0206 serial: atmel: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-22-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 9ed2d5d8209cdff55593f80bb2398d63161681bd Author: Thomas Gleixner Date: Thu Sep 14 20:43:37 2023 +0206 serial: arc_uart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-21-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit cf19e009cde455d22f0b545f25fc8a4652bd3dca Author: Thomas Gleixner Date: Thu Sep 14 20:43:36 2023 +0206 serial: ar933x: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-20-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 5412c394d5c8e052b656afaa7d0c6bb2a0d0bdc6 Author: Thomas Gleixner Date: Thu Sep 14 20:43:35 2023 +0206 serial: apb: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-19-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 68ca3e72d7463d79d29b6e4961d6028df2a88e25 Author: Thomas Gleixner Date: Thu Sep 14 20:43:34 2023 +0206 serial: amba-pl011: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-18-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 01d6461ad7d062a23fcbdf2a19cde723d30919cf Author: Thomas Gleixner Date: Thu Sep 14 20:43:33 2023 +0206 serial: amba-pl010: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-17-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 0783a74f84a62c07426075034c5deda067f46a8d Author: Thomas Gleixner Date: Thu Sep 14 20:43:32 2023 +0206 serial: altera_uart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-16-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit adcdb2c7f0b59a77355a8bfa5d6eaa3d32b6a1cb Author: Thomas Gleixner Date: Thu Sep 14 20:43:31 2023 +0206 serial: altera_jtaguart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-15-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit cbc3508545659bfcb8c30bd854c04d64a10a9ee4 Author: Thomas Gleixner Date: Thu Sep 14 20:43:30 2023 +0206 serial: 8250_pci1xxxx: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-14-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit e4a137586d76186f6f5550ab933af3ec99cf49db Author: Thomas Gleixner Date: Thu Sep 14 20:43:29 2023 +0206 serial: 8250_omap: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-13-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 89dd4aff2c504fd1c123a7268a7440164e34e53c Author: Thomas Gleixner Date: Thu Sep 14 20:43:28 2023 +0206 serial: 8250_mtk: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Chen-Yu Tsai Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-12-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 448d65172f2b964ac10d1d9a33043e5607d2f70a Author: Thomas Gleixner Date: Thu Sep 14 20:43:27 2023 +0206 serial: 8250_fsl: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-11-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 2b71b31f203b7b518b0a13316bd0294126905497 Author: Thomas Gleixner Date: Thu Sep 14 20:43:26 2023 +0206 serial: 8250_exar: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-10-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit fdc5d7a4067672795c87344d2d83a56b43a2cf44 Author: Thomas Gleixner Date: Thu Sep 14 20:43:25 2023 +0206 serial: 8250_dw: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Ilpo Järvinen Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-9-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 1970c8d8eaa3af4e072ac29043681374cdcb543f Author: Thomas Gleixner Date: Thu Sep 14 20:43:24 2023 +0206 serial: 8250_dma: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Ilpo Järvinen Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-8-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit e8f87d3c3357022826a0a6da283209e63ab14484 Author: Thomas Gleixner Date: Thu Sep 14 20:43:23 2023 +0206 serial: 8250: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Ilpo Järvinen Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-7-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 4d8024c675de71cfd36ed65aee66b393f4a51572 Author: Thomas Gleixner Date: Thu Sep 14 20:43:22 2023 +0206 serial: 8250_bcm7271: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-6-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 40c069129c52c8fd147e9816225736840f01025b Author: Thomas Gleixner Date: Thu Sep 14 20:43:21 2023 +0206 serial: 8250_aspeed_vuart: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-5-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit f00e3b4aa9e831a10196980679fa7304e5e32755 Author: Thomas Gleixner Date: Thu Sep 14 20:43:20 2023 +0206 serial: 21285: Use port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-4-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit c5cbdb76e8e33ce90fec2946e8eee7d71d68e57a Author: Thomas Gleixner Date: Thu Sep 14 20:43:19 2023 +0206 serial: core: Use lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms. Converted with coccinelle. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Ilpo Järvinen Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-3-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit b0af4bcb49464c221ad5f95d40f2b1b252ceedcc Author: Thomas Gleixner Date: Thu Sep 14 20:43:18 2023 +0206 serial: core: Provide port lock wrappers When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console. So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress. All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure. Provide wrapper functions for spin_[un]lock*(port->lock) invocations so that the console mechanics can be applied later on at a single place and does not require to copy the same logic all over the drivers. Signed-off-by: Thomas Gleixner Reviewed-by: Ilpo Järvinen Signed-off-by: John Ogness Link: https://lore.kernel.org/r/20230914183831.587273-2-john.ogness@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 11e7f27b79757b6586645d87b95d5b78375ecdfc Author: Yi Yang Date: Thu Aug 31 10:33:29 2023 +0800 tty: tty_jobctrl: fix pid memleak in disassociate_ctty() There is a pid leakage: ------------------------------ unreferenced object 0xffff88810c181940 (size 224): comm "sshd", pid 8191, jiffies 4294946950 (age 524.570s) hex dump (first 32 bytes): 01 00 00 00 00 00 00 00 00 00 00 00 ad 4e ad de .............N.. ff ff ff ff 6b 6b 6b 6b ff ff ff ff ff ff ff ff ....kkkk........ backtrace: [] kmem_cache_alloc+0x5c6/0x9b0 [] alloc_pid+0x72/0x570 [] copy_process+0x1374/0x2470 [] kernel_clone+0xb7/0x900 [] __se_sys_clone+0x85/0xb0 [] __x64_sys_clone+0x2b/0x30 [] do_syscall_64+0x32/0x80 [] entry_SYSCALL_64_after_hwframe+0x61/0xc6 It turns out that there is a race condition between disassociate_ctty() and tty_signal_session_leader(), which caused this leakage. The pid memleak is triggered by the following race: task[sshd] task[bash] ----------------------- ----------------------- disassociate_ctty(); spin_lock_irq(¤t->sighand->siglock); put_pid(current->signal->tty_old_pgrp); current->signal->tty_old_pgrp = NULL; tty = tty_kref_get(current->signal->tty); spin_unlock_irq(¤t->sighand->siglock); tty_vhangup(); tty_lock(tty); ... tty_signal_session_leader(); spin_lock_irq(&p->sighand->siglock); ... if (tty->ctrl.pgrp) //tty->ctrl.pgrp is not NULL p->signal->tty_old_pgrp = get_pid(tty->ctrl.pgrp); //An extra get spin_unlock_irq(&p->sighand->siglock); ... tty_unlock(tty); if (tty) { tty_lock(tty); ... put_pid(tty->ctrl.pgrp); tty->ctrl.pgrp = NULL; //It's too late ... tty_unlock(tty); } The issue is believed to be introduced by commit c8bcd9c5be24 ("tty: Fix ->session locking") who moves the unlock of siglock in disassociate_ctty() above "if (tty)", making a small window allowing tty_signal_session_leader() to kick in. It can be easily reproduced by adding a delay before "if (tty)" and at the entrance of tty_signal_session_leader(). To fix this issue, we move "put_pid(current->signal->tty_old_pgrp)" after "tty->ctrl.pgrp = NULL". Fixes: c8bcd9c5be24 ("tty: Fix ->session locking") Signed-off-by: Yi Yang Co-developed-by: GUO Zihua Signed-off-by: GUO Zihua Link: https://lore.kernel.org/r/20230831023329.165737-1-yiyang13@huawei.com Signed-off-by: Greg Kroah-Hartman commit 305a5dd7a3f29d8221d3f132460b0217d768ebb6 Author: Uwe Kleine-König Date: Mon Sep 11 10:54:51 2023 +0200 serial: imx: Simplify compatibility handling Three of the four entries of imx_uart_devdata[] use .uts_reg = IMX21_UTS. The difference in the .devtype member isn't relevant, the only thing that matters is if is equal to IMX1_UART. So use an entry with .devtype = IMX21_UART on all platforms but i.MX1. There is no need to have the dev types in an array, so split them up in two separate variables. The fsl,imx53-uart devinfo can go away because in the binding and also the dts files all fsl,imx53-uart devices also are compatible to fsl,imx21-uart. That's not the case for fsl,imx6q-uart (which is a bit strange IMHO), so the fsl,imx6q-uart must stay around. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20230911085451.628798-1-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 064f3bb3bc3e3e4ef8a4de664e3ff5c012646143 Author: Hugo Villeneuve Date: Tue Sep 5 11:13:00 2023 -0400 serial: sc16is7xx: improve comments about variants Replace 740/750/760 with generic terms like 74x/75x/76x to account for variants like 741, 752 and 762. Signed-off-by: Hugo Villeneuve Reviewed-by: Lech Perczak Link: https://lore.kernel.org/r/20230905151300.15365-1-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman commit d8a5c0d6a4b62e320814601b91a25926c2bfb991 Author: Simon Arlott Date: Sun Aug 27 19:23:39 2023 +0100 docs: ABI: sysfs-tty: close times are in centiseconds The times for close_delay and closing_wait are in centiseconds, not milliseconds. Fix the documentation and add details of special values. Signed-off-by: Simon Arlott Link: https://lore.kernel.org/r/30fa035a-709f-58cd-fc1e-fef1367dc6dd@0882a8b5-c6c3-11e9-b005-00805fc181fe.uuid.home.arpa Signed-off-by: Greg Kroah-Hartman commit 4e8da86fc1f767371f4395d0d94870ed1e08aa1e Author: Zhang Shurong Date: Sat Aug 26 17:32:24 2023 +0800 tty: serial: linflexuart: Fix to check return value of platform_get_irq() in linflex_probe() The platform_get_irq might be failed and return a negative result. So there should have an error handling code. Fixed this by adding an error handling code. Signed-off-by: Zhang Shurong Link: https://lore.kernel.org/r/tencent_234B0AACD06350E10D7548C2E086A9166305@qq.com Signed-off-by: Greg Kroah-Hartman commit 66ebe67d1b68bebc4b49d022a28f8c6492044f32 Author: Ilpo Järvinen Date: Tue Sep 12 13:35:58 2023 +0300 tty/serial: 8250: Sort drivers in Makefile Sort drivers in alphabetic order in Makefile to make it easier to find the correct line. In case the CONFIG and filenames disagree, sort using the filename (ignore 8250 prefix while sorting). In addition, place 8250_early separately above the drivers. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230912103558.20123-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 3b609120821c551f72522d4378bf606825b095bd Author: Ilpo Järvinen Date: Tue Sep 12 13:35:57 2023 +0300 tty/serial: Sort drivers in makefile Sort drivers in alphabetic order in Makefile to make it easier to find the correct line. In case the CONFIG and filenames disagree, sort using the filename (but ignoring "serial" prefixes). Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230912103558.20123-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 5939ff7ffae095acccdc70820ae17a4706c646e0 Author: Ilpo Järvinen Date: Fri Sep 15 12:43:36 2023 +0300 tty: serial: 8250_exar: Does not use anything from 8250_pci 8250_exar includes linux/8250_pci.h and depends on SERIAL_8250_PCI. Neither is necessary so this patch removes the include and changes the depends on to SERIAL_8250 && PCI (taken from SERIAL_8250_PCI). Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230915094336.13278-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a136abd7e7abe0f1247f8ffde6cc7c8ab09f985b Author: Ilpo Järvinen Date: Fri Sep 15 12:43:35 2023 +0300 serial: 8250_mid: Remove 8250_pci usage 8250_mid uses FL_*BASE* from linux/8250_pci.h and nothing else. The code can be simplified by directly defining BARs within the driver instead. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230915094336.13278-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 4678de73932f8f3b835ff3cda76825ed53d4f6b7 Author: Andy Shevchenko Date: Tue Sep 12 19:56:07 2023 +0300 serial: 8250_of: Use dev_err_probe() instead of dev_warn() The probe process may generate EPROBE_DEFER. In this case dev_err_probe() can still record err information. Otherwise it may pollute logs on that occasion. This also helps simplifing code and standardizing the error output. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230912165607.402580-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit e8bbaeac25503aaaf215e9cc4b278890e043410b Author: Andy Shevchenko Date: Tue Sep 12 19:55:40 2023 +0300 serial: 8250_aspeed_vuart: Use dev_err_probe() instead of dev_err() The probe process may generate EPROBE_DEFER. In this case dev_err_probe() can still record err information. Otherwise it may pollute logs on that occasion. This also helps simplifing code and standardizing the error output. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230912165540.402504-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 2ff477b78250186e611e008320e1de20107e9617 Author: Andy Shevchenko Date: Mon Sep 11 17:43:08 2023 +0300 serial: 8250_port: Introduce UART_IIR_FIFO_ENABLED_16750 The UART_IIR_64BYTE_FIFO is always being used in conjunction with UART_IIR_FIFO_ENABLED. Introduce a joined UART_IIR_FIFO_ENABLED_16750 definition and use it. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230911144308.4169752-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d81ffb87aaa75f842cd7aa57091810353755b3e6 Author: Yi Yang Date: Mon Sep 4 11:52:20 2023 +0800 tty: vcc: Add check for kstrdup() in vcc_probe() Add check for the return value of kstrdup() and return the error, if it fails in order to avoid NULL pointer dereference. Signed-off-by: Yi Yang Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/20230904035220.48164-1-yiyang13@huawei.com Signed-off-by: Greg Kroah-Hartman commit 30e945861f3b46c4a5b25b861da40510a64cf9a4 Author: Erwan Le Ray Date: Wed Sep 6 17:15:47 2023 +0200 serial: stm32: add support for break control Add support for break control to the stm32 serial driver. Signed-off-by: Erwan Le Ray Signed-off-by: Valentin Caron Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/20230906151547.840302-1-valentin.caron@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 46c4699d07e65787d613b92c9fd499e3d44ea80d Author: Bo Liu Date: Fri Sep 8 02:17:26 2023 -0400 tty: hvc: remove set but unused variable The local variable vdev in hvcs_destruct_port() is set but not used. Remove the variable and related code. Signed-off-by: Bo Liu Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/20230908061726.2641-1-liubo03@inspur.com Signed-off-by: Greg Kroah-Hartman commit 22a048b0749346b6e3291892d06b95278d5ba84a Author: Hugo Villeneuve Date: Tue Sep 5 14:16:50 2023 -0400 serial: sc16is7xx: remove unused to_sc16is7xx_port macro This macro is not used anywhere. Signed-off-by: Hugo Villeneuve Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230905181649.134720-1-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman commit 4556c36f4a23fb218763cdb7a20f6a94f4faf1f8 Author: Chen Ni Date: Fri Sep 15 07:11:06 2023 +0000 tty: serial: ma35d1_serial: Add missing check for ioremap Add check for ioremap() and return the error if it fails in order to guarantee the success of ioremap(). Signed-off-by: Chen Ni Acked-by: Jacky Huang Link: https://lore.kernel.org/r/20230915071106.3347-1-nichen@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman commit 0201409079b975e46cc40e8bdff4bd61329ee10f Author: Gustavo A. R. Silva Date: Fri Sep 15 13:25:36 2023 -0600 net: spider_net: Use size_add() in call to struct_size() If, for any reason, the open-coded arithmetic causes a wraparound, the protection that `struct_size()` adds against potential integer overflows is defeated. Fix this by hardening call to `struct_size()` with `size_add()`. Fixes: 3f1071ec39f7 ("net: spider_net: Use struct_size() helper") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Geoff Levand Signed-off-by: David S. Miller commit 61ad21ec519774182d23dd83d6cb44d7b80b7421 Author: Geert Uytterhoeven Date: Fri Sep 15 10:58:05 2023 +0200 soc: renesas: Kconfig: Remove blank line before ARCH_R9A07G043 help text There should not be a blank line before the "help" keyword in the ARCH_R9A07G043 configuration section. Fixes: c6a906cce61a8015 ("soc: renesas: Kconfig: For ARCH_R9A07G043 select the required configs if dependencies are met") Signed-off-by: Geert Uytterhoeven Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/2a3a9d595579b7cea416c12bf9abcfa2227243bb.1694768174.git.geert+renesas@glider.be commit 3655167afeaa77ba2a354b826d0770e9b2aa88b0 Author: Claudiu Beznea Date: Tue Sep 12 07:51:25 2023 +0300 soc: renesas: renesas-soc: Remove blank lines Remove blank lines. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230912045157.177966-6-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 0b9729cdb895a477ba3551cd2102baee2e697cbb Author: Claudiu Beznea Date: Tue Sep 12 07:51:24 2023 +0300 soc: renesas: Identify RZ/G3S SoC Add support to identify the RZ/G3S (R9A08G045) SoC. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230912045157.177966-5-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 2506a91734754de690869824fb0d1ac592ec1266 Author: Gustavo A. R. Silva Date: Fri Sep 15 13:16:26 2023 -0600 tipc: Use size_add() in calls to struct_size() If, for any reason, the open-coded arithmetic causes a wraparound, the protection that `struct_size()` adds against potential integer overflows is defeated. Fix this by hardening call to `struct_size()` with `size_add()`. Fixes: e034c6d23bc4 ("tipc: Use struct_size() helper") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: David S. Miller commit a2713257ee2be22827d7bc248302d408c91bfb95 Author: Gustavo A. R. Silva Date: Fri Sep 15 13:12:38 2023 -0600 tls: Use size_add() in call to struct_size() If, for any reason, the open-coded arithmetic causes a wraparound, the protection that `struct_size()` adds against potential integer overflows is defeated. Fix this by hardening call to `struct_size()` with `size_add()`. Fixes: b89fec54fd61 ("tls: rx: wrap decrypt params in a struct") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: David S. Miller commit e22c6ea025013ae447fe269269753ffec763dde5 Author: Gustavo A. R. Silva Date: Fri Sep 15 13:01:23 2023 -0600 mlxsw: Use size_mul() in call to struct_size() If, for any reason, the open-coded arithmetic causes a wraparound, the protection that `struct_size()` adds against potential integer overflows is defeated. Fix this by hardening call to `struct_size()` with `size_mul()`. Fixes: 2285ec872d9d ("mlxsw: spectrum_acl_bloom_filter: use struct_size() in kzalloc()") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 74fa1a82386e0bc1095ae9d13962606612514df5 Merge: 760554a9add86 a68eed9f63eed Author: David S. Miller Date: Mon Sep 18 09:34:06 2023 +0100 Merge branch 'kselftest-rtnetlink' Daniel Mendes says: ==================== kselftest: rtnetlink: add additional command line options Many other tests implement options like verbose, pause, and pause on failure. These patches just add these options to rtnetlink.sh. The same conventions are used as the tests that already have this functionality: eg verbose is 0 or 1 but PAUSE is "yes" or "no". ==================== Signed-off-by: David S. Miller commit a68eed9f63eedfa762dc54be3834c0df0abe8cc4 Author: Daniel Mendes Date: Tue Sep 12 10:28:36 2023 -0400 kselftest: rtnetlink: add pause and pause on fail flag 'Pause' prompts the user to press Enter to continue running tests once one test has finished. Pause on fail on prompts the user to press enter only when a test fails. Modifications to kci_test_addrlft() and kci_test_ipsec_offload() ensure that whenever end_test is called, [$ret -ne 0] indicates failure. This allows end_test to really easily implement pause on fail functionality. Signed-off-by: Daniel Mendes Signed-off-by: David S. Miller commit 9c2a19f71515553a874e2bf31655ac2264a66e37 Author: Daniel Mendes Date: Tue Sep 12 10:28:35 2023 -0400 kselftest: rtnetlink.sh: add verbose flag Uses a run_cmd helper function similar to other selftests to add verbose functionality i.e. print executed commands and their outputs Many commands silence or redirect output. This can be removed since the verbose helper function captures output anyway and only outputs it if VERBOSE is true. Similarly, the helper command for pipes to grep searches stderr and stdout. This makes output redirection unnecessary in those cases. Signed-off-by: Daniel Mendes Signed-off-by: David S. Miller commit 760554a9add861a0a2d6ac4a85624f8b9537f1bf Merge: 8d6198a14e2bf 1e18ec3e9d46e Author: David S. Miller Date: Mon Sep 18 09:28:22 2023 +0100 Merge branch 'pds_core-pci-reset' Shannon Nelson says: ==================== pds_core: add PCI reset handling Make sure pds_core can handle and recover from PCI function resets and similar PCI bus issues: add detection and handlers for PCI problems. ==================== Signed-off-by: David S. Miller commit 1e18ec3e9d46e4ad2b6507c3bfc7f59e2ab449a2 Author: Shannon Nelson Date: Thu Sep 14 15:32:00 2023 -0700 pds_core: add attempts to fix broken PCI If we see a 0xff value from a PCI register read, we know that the PCI connection is broken, possibly by a low level reset that didn't go through the nice pci_error_handlers path. Make use of the PCI cleanup code that we already have from the reset handlers and add some detection and attempted recovery from a broken PCI connection. Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley Signed-off-by: David S. Miller commit ffa55858330f267beec995fc4f68098c91311c64 Author: Shannon Nelson Date: Thu Sep 14 15:31:59 2023 -0700 pds_core: implement pci reset handlers Implement the callbacks for a nice PCI reset. These get called when a user is nice enough to use the sysfs PCI reset entry, e.g. echo 1 > /sys/bus/pci/devices/0000:2b:00.0/reset Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley Signed-off-by: David S. Miller commit d557c094e7400929bbcd9df6500af0d5e3ab08c1 Author: Shannon Nelson Date: Thu Sep 14 15:31:58 2023 -0700 pds_core: keep viftypes table across reset Keep the viftypes and the current enable/disable states across a recovery action. Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley Signed-off-by: David S. Miller commit f7b5bd725b737de3f2c4a836e07c82ba156d75df Author: Shannon Nelson Date: Thu Sep 14 15:31:57 2023 -0700 pds_core: check health in devcmd wait Similar to what we do in the AdminQ, check for devcmd health while waiting for an answer. Signed-off-by: Shannon Nelson Reviewed-by: Brett Creeley Signed-off-by: David S. Miller commit fbb991530fdcf1150bc23c83775c338059f4f642 Author: Ralph Siemsen Date: Wed Sep 13 16:38:05 2023 -0400 clk: renesas: r9a06g032: Name anonymous structs Clarify the content of the r9a06g032_clkdesc structure by naming the remaining anonymous structures defined inside. Renaming each field and updating the doc then becomes necessary in order to avoid name duplications and kdoc warnings. Signed-off-by: Ralph Siemsen Reviewed-by: Miquel Raynal Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230913203805.465780-2-ralph.siemsen@linaro.org Signed-off-by: Geert Uytterhoeven commit 80374a7fbf7af69bb81b6e4311f2018205b62644 Author: Ralph Siemsen Date: Wed Sep 13 16:38:04 2023 -0400 clk: renesas: r9a06g032: Fix kerneldoc warning Mention the 'dual' structure in the kdoc. This fixes the following W=1 warning during build: > drivers/clk/renesas/r9a06g032-clocks.c:119: warning: Function parameter or member 'dual' not described in 'r9a06g032_clkdesc' Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309101314.kTRoxND5-lkp@intel.com/ Signed-off-by: Ralph Siemsen Reviewed-by: Miquel Raynal Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230913203805.465780-1-ralph.siemsen@linaro.org Signed-off-by: Geert Uytterhoeven commit 897a3e34d6e73d2386715d5c44c57992f2c0eada Author: Claudiu Beznea Date: Tue Sep 12 07:51:34 2023 +0300 clk: renesas: rzg2l: Use u32 for flag and mux_flags flag and mux_flags are intended to keep bit masks. Use u32 type for it. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230912045157.177966-15-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 72977f07b035e488c3f1928832a1616c6cae7278 Author: Claudiu Beznea Date: Tue Sep 12 07:51:33 2023 +0300 clk: renesas: rzg2l: Use FIELD_GET() for PLL register fields Use FIELD_GET() for PLL register fields. This is its purpose. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230912045157.177966-14-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit becf4a771a12b52dc5b3d2b089598d5603f3bbec Author: Claudiu Beznea Date: Tue Sep 12 07:51:31 2023 +0300 clk: renesas: rzg2l: Simplify the logic in rzg2l_mod_clock_endisable() The bitmask << 16 is anyway set on both branches of if thus move it before the if and set the lower bits of registers only in case clock is enabled. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230912045157.177966-12-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 17939df3c9acd26e4dac1c5943dd8e58e1bcb4e7 Author: Claudiu Beznea Date: Tue Sep 12 07:51:30 2023 +0300 clk: renesas: rzg2l: Use core->name for clock name core->name already contains the clock name thus, there is no need to check the GET_SHIFT(core->conf) to decide on it. Signed-off-by: Claudiu Beznea Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230912045157.177966-11-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 111287aa60004e1a58320048c89391056288c455 Author: Claudiu Beznea Date: Tue Sep 12 07:51:23 2023 +0300 dt-bindings: soc: renesas: renesas,rzg2l-sysc: Document RZ/G3S SoC Document RZ/G3S (R9A08G045) SYSC bindings. The SYSC block found on the RZ/G3S SoC is similar to the one found on the RZ/G2UL. Signed-off-by: Claudiu Beznea Acked-by: Rob Herring Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230912045157.177966-4-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 9c57c4a9a45c04c19f38986c73847b756ceae237 Author: Claudiu Beznea Date: Tue Sep 12 07:51:22 2023 +0300 dt-bindings: soc: renesas: Document Renesas RZ/G3S SoC variants Document RZ/G3S (R9A08G045) SoC variants. Signed-off-by: Claudiu Beznea Acked-by: Rob Herring Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230912045157.177966-3-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit ddd7f45c899f7524bdbe6a32fe4906cde8b07b9b Author: Wen Gong Date: Thu Sep 14 04:20:26 2023 -0400 wifi: cfg80211: save power spectral density(psd) of regulatory rule 6 GHz regulatory domains introduces Power Spectral Density (PSD). The PSD value of the regulatory rule should be taken into effect for the ieee80211_channels falling into that particular regulatory rule. Save the values in the channel which has PSD value and add nl80211 attributes accordingly to handle it. Co-developed-by: Aditya Kumar Singh Signed-off-by: Aditya Kumar Singh Signed-off-by: Wen Gong Link: https://lore.kernel.org/r/20230914082026.3709-1-quic_wgong@quicinc.com [use hole in chan flags, reword docs] Signed-off-by: Johannes Berg commit 7ad0354d18ae05e9c8885251e234cbcf141f8972 Author: GUO Zihua Date: Fri Aug 18 09:56:33 2023 +0800 sched/headers: Remove duplicated includes in kernel/sched/sched.h Remove duplicated includes of linux/cgroup.h and linux/psi.h. Both of these includes are included regardless of the config and they are all protected by ifndef, so no point including them again. Signed-off-by: GUO Zihua Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230818015633.18370-1-guozihua@huawei.com commit 518755a7eeae77a399430eaf211a1e71f6b87d4a Author: Kai Huang Date: Mon Sep 18 16:18:58 2023 +1200 x86/tdx: Fix __noreturn build warning around __tdx_hypercall_failed() LKP reported below build warning: vmlinux.o: warning: objtool: __tdx_hypercall+0x128: __tdx_hypercall_failed() is missing a __noreturn annotation The __tdx_hypercall_failed() function definition already has __noreturn annotation, but it turns out the __noreturn must be annotated to the function declaration. PeterZ explains: "FWIW, the reason being that... The point of noreturn is that the caller should know to stop generating code. For that the declaration needs the attribute, because call sites typically do not have access to the function definition in C." Add __noreturn annotation to the declaration of __tdx_hypercall_failed() to fix. It's not a bad idea to document the __noreturn nature at the definition site either, so keep the annotation at the definition. Note is also included by TDX related assembly files. Include only in case of !__ASSEMBLY__ otherwise compiling assembly file would trigger build error. Also, following the objtool documentation, add __tdx_hypercall_failed() to "tools/objtool/noreturns.h". Fixes: c641cfb5c157 ("x86/tdx: Make TDX_HYPERCALL asm similar to TDX_MODULE_CALL") Reported-by: kernel test robot Signed-off-by: Kai Huang Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230918041858.331234-1-kai.huang@intel.com Closes: https://lore.kernel.org/oe-kbuild-all/202309140828.9RdmlH2Z-lkp@intel.com/ commit d1d3fcb324eceee7c4bf34b0ac89942ee16e3b74 Author: Kees Cook Date: Fri Sep 15 13:14:05 2023 -0700 udf: Annotate struct udf_bitmap with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct udf_bitmap. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Jan Kara Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Jan Kara Message-Id: <20230915201404.never.574-kees@kernel.org> commit 1528c661c24b407e92194426b0adbb43de859ce0 Author: Aaron Lu Date: Tue Sep 12 14:58:08 2023 +0800 sched/fair: Ratelimit update to tg->load_avg When using sysbench to benchmark Postgres in a single docker instance with sysbench's nr_threads set to nr_cpu, it is observed there are times update_cfs_group() and update_load_avg() shows noticeable overhead on a 2sockets/112core/224cpu Intel Sapphire Rapids(SPR): 13.75% 13.74% [kernel.vmlinux] [k] update_cfs_group 10.63% 10.04% [kernel.vmlinux] [k] update_load_avg Annotate shows the cycles are mostly spent on accessing tg->load_avg with update_load_avg() being the write side and update_cfs_group() being the read side. tg->load_avg is per task group and when different tasks of the same taskgroup running on different CPUs frequently access tg->load_avg, it can be heavily contended. E.g. when running postgres_sysbench on a 2sockets/112cores/224cpus Intel Sappire Rapids, during a 5s window, the wakeup number is 14millions and migration number is 11millions and with each migration, the task's load will transfer from src cfs_rq to target cfs_rq and each change involves an update to tg->load_avg. Since the workload can trigger as many wakeups and migrations, the access(both read and write) to tg->load_avg can be unbound. As a result, the two mentioned functions showed noticeable overhead. With netperf/nr_client=nr_cpu/UDP_RR, the problem is worse: during a 5s window, wakeup number is 21millions and migration number is 14millions; update_cfs_group() costs ~25% and update_load_avg() costs ~16%. Reduce the overhead by limiting updates to tg->load_avg to at most once per ms. The update frequency is a tradeoff between tracking accuracy and overhead. 1ms is chosen because PELT window is roughly 1ms and it delivered good results for the tests that I've done. After this change, the cost of accessing tg->load_avg is greatly reduced and performance improved. Detailed test results below. ============================== postgres_sysbench on SPR: 25% base: 42382±19.8% patch: 50174±9.5% (noise) 50% base: 67626±1.3% patch: 67365±3.1% (noise) 75% base: 100216±1.2% patch: 112470±0.1% +12.2% 100% base: 93671±0.4% patch: 113563±0.2% +21.2% ============================== hackbench on ICL: group=1 base: 114912±5.2% patch: 117857±2.5% (noise) group=4 base: 359902±1.6% patch: 361685±2.7% (noise) group=8 base: 461070±0.8% patch: 491713±0.3% +6.6% group=16 base: 309032±5.0% patch: 378337±1.3% +22.4% ============================= hackbench on SPR: group=1 base: 100768±2.9% patch: 103134±2.9% (noise) group=4 base: 413830±12.5% patch: 378660±16.6% (noise) group=8 base: 436124±0.6% patch: 490787±3.2% +12.5% group=16 base: 457730±3.2% patch: 680452±1.3% +48.8% ============================ netperf/udp_rr on ICL 25% base: 114413±0.1% patch: 115111±0.0% +0.6% 50% base: 86803±0.5% patch: 86611±0.0% (noise) 75% base: 35959±5.3% patch: 49801±0.6% +38.5% 100% base: 61951±6.4% patch: 70224±0.8% +13.4% =========================== netperf/udp_rr on SPR 25% base: 104954±1.3% patch: 107312±2.8% (noise) 50% base: 55394±4.6% patch: 54940±7.4% (noise) 75% base: 13779±3.1% patch: 36105±1.1% +162% 100% base: 9703±3.7% patch: 28011±0.2% +189% ============================================== netperf/tcp_stream on ICL (all in noise range) 25% base: 43092±0.1% patch: 42891±0.5% 50% base: 19278±14.9% patch: 22369±7.2% 75% base: 16822±3.0% patch: 17086±2.3% 100% base: 18216±0.6% patch: 18078±2.9% =============================================== netperf/tcp_stream on SPR (all in noise range) 25% base: 34491±0.3% patch: 34886±0.5% 50% base: 19278±14.9% patch: 22369±7.2% 75% base: 16822±3.0% patch: 17086±2.3% 100% base: 18216±0.6% patch: 18078±2.9% Reported-by: Nitin Tekchandani Suggested-by: Vincent Guittot Signed-off-by: Aaron Lu Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Vincent Guittot Reviewed-by: Mathieu Desnoyers Reviewed-by: David Vernet Tested-by: Mathieu Desnoyers Tested-by: Swapnil Sapkal Link: https://lkml.kernel.org/r/20230912065808.2530-2-aaron.lu@intel.com commit 8f0eed4a78a81668bc78923ea09f51a7a663c2b0 Author: Elliot Berman Date: Fri Sep 8 15:49:16 2023 -0700 freezer,sched: Use saved_state to reduce some spurious wakeups After commit f5d39b020809 ("freezer,sched: Rewrite core freezer logic"), tasks that transition directly from TASK_FREEZABLE to TASK_FROZEN are always woken up on the thaw path. Prior to that commit, tasks could ask freezer to consider them "frozen enough" via freezer_do_not_count(). The commit replaced freezer_do_not_count() with a TASK_FREEZABLE state which allows freezer to immediately mark the task as TASK_FROZEN without waking up the task. This is efficient for the suspend path, but on the thaw path, the task is always woken up even if the task didn't need to wake up and goes back to its TASK_(UN)INTERRUPTIBLE state. Although these tasks are capable of handling of the wakeup, we can observe a power/perf impact from the extra wakeup. We observed on Android many tasks wait in the TASK_FREEZABLE state (particularly due to many of them being binder clients). We observed nearly 4x the number of tasks and a corresponding linear increase in latency and power consumption when thawing the system. The latency increased from ~15ms to ~50ms. Avoid the spurious wakeups by saving the state of TASK_FREEZABLE tasks. If the task was running before entering TASK_FROZEN state (__refrigerator()) or if the task received a wake up for the saved state, then the task is woken on thaw. saved_state from PREEMPT_RT locks can be re-used because freezer would not stomp on the rtlock wait flow: TASK_RTLOCK_WAIT isn't considered freezable. Reported-by: Prakash Viswalingam Signed-off-by: Elliot Berman Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar commit fbaa6a181a4b1886cbf4214abdf9a2df68471510 Author: Elliot Berman Date: Fri Sep 8 15:49:15 2023 -0700 sched/core: Remove ifdeffery for saved_state In preparation for freezer to also use saved_state, remove the CONFIG_PREEMPT_RT compilation guard around saved_state. On the arm64 platform I tested which did not have CONFIG_PREEMPT_RT, there was no statistically significant deviation by applying this patch. Test methodology: perf bench sched message -g 40 -l 40 Signed-off-by: Elliot Berman Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar commit 8d6198a14e2bfb09f190055b387c90b4ac9b49a4 Author: Shinas Rasheed Date: Fri Sep 15 01:16:07 2023 -0700 octeon_ep: support to fetch firmware info Add support to fetch firmware info such as heartbeat miss count, heartbeat interval. This shall be used for heartbeat monitor. Signed-off-by: Shinas Rasheed Signed-off-by: David S. Miller commit 8874288c803fba7fff4d441464cac3a513364fd1 Author: Jouni Högander Date: Wed Sep 13 13:04:30 2023 +0300 drm/i915: Remove runtime suspended boolean from intel_runtime_pm struct It's not necessary to carry separate suspended status information in intel_runtime_pm struct as this information is already in underlying device structure. Remove it and use pm_runtime_suspended() to obtain suspended status information when needed. Cc: Jani Nikula Cc: Imre Deak Signed-off-by: Jouni Högander Acked-by: Jani Nikula Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230913100430.3433969-1-jouni.hogander@intel.com commit 7e9358bba6bd12c345e38d06de7fdf4613ef091a Author: Nicolas Ferre Date: Wed Sep 6 15:58:38 2023 +0200 ARM: dts: at91/trivial: fix typo in crypto DT naming Fix typo in DT name for TDES node. Signed-off-by: Nicolas Ferre Reviewed-by: Tudor Ambarus Link: https://lore.kernel.org/r/20230906135838.59247-1-nicolas.ferre@microchip.com [claudiu.beznea: removed fixes tag as tdes node is not referenced anywhere by its node name] Signed-off-by: Claudiu Beznea commit ff25ad0aa280012eda5699713a9f0b468a1d6e4e Author: Benjamin Gray Date: Wed Aug 30 14:42:38 2023 +1000 powerpc/configs: Set more PPC debug configs Add more config options that wouldn't be done by the generic debug config in kernel/configs/debug.config CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG Adds an initialized check on each (cpu|mmu)_has_feature() CONFIG_PPC_IRQ_SOFT_MASK_DEBUG Adds some extra checks around IRQ mask manipulation CONFIG_PPC_KUAP_DEBUG Adds some extra KAUP checks around interrupts/context switching CONFIG_PPC_RFI_SRR_DEBUG Adds some extra SSR checks around interrupts/syscalls Signed-off-by: Benjamin Gray Signed-off-by: Michael Ellerman Link: https://msgid.link/20230830044238.578840-1-bgray@linux.ibm.com commit b098f1c32365304633077d73e4ae21c72d4241b3 Author: Hari Bathini Date: Tue Sep 12 13:59:50 2023 +0530 powerpc/fadump: make is_kdump_kernel() return false when fadump is active Currently, is_kdump_kernel() returns true in crash dump capture kernel for both kdump and fadump crash dump capturing methods, as both these methods set elfcorehdr_addr. Some restrictions enforced for crash dump capture kernel, based on is_kdump_kernel(), are specifically meant for kdump case and not desirable for fadump - eg. IO queues restriction in device drivers. So, define is_kdump_kernel() to return false when f/w assisted dump is active. Signed-off-by: Hari Bathini Acked-by: Baoquan He Signed-off-by: Michael Ellerman Link: https://msgid.link/20230912082950.856977-2-hbathini@linux.ibm.com commit 86328b338c3996b814417dd68e3f899a1a649059 Author: Hari Bathini Date: Tue Sep 12 13:59:49 2023 +0530 vmcore: remove dependency with is_kdump_kernel() for exporting vmcore Currently, is_kdump_kernel() returns true when elfcorehdr_addr is set. While elfcorehdr_addr is set for kexec based kernel dump mechanism, alternate dump capturing methods like fadump [1] also set it to export the vmcore. Since, is_kdump_kernel() is used to restrict resources in crash dump capture kernel and such restrictions may not be desirable for fadump, allow is_kdump_kernel() to be defined differently for such scenarios. With this, is_kdump_kernel() could be false while vmcore is usable. So, remove unnecessary dependency with is_kdump_kernel(), for exporting vmcore. [1] https://docs.kernel.org/powerpc/firmware-assisted-dump.html Suggested-by: Michael Ellerman Signed-off-by: Hari Bathini Acked-by: Baoquan He Signed-off-by: Michael Ellerman Link: https://msgid.link/20230912082950.856977-1-hbathini@linux.ibm.com commit 7135b921b32966d7602ede396b7286d372aee63f Author: Aditya Gupta Date: Mon Sep 11 14:44:09 2023 +0530 powerpc: add `cur_cpu_spec` symbol to vmcoreinfo Presently, while reading a vmcore, makedumpfile uses `cur_cpu_spec.mmu_features` to decide whether the crashed system had RADIX MMU or not. Currently, makedumpfile fails to get the `cur_cpu_spec` symbol (unless a vmlinux is passed with the `-x` flag to makedumpfile), and hence assigns offsets and shifts (such as pgd_offset_l4) incorrecly considering MMU to be hash MMU. Add `cur_cpu_spec` symbol and offset of `mmu_features` in the `cpu_spec` struct, to VMCOREINFO, so that the symbol address and offset is accessible to makedumpfile, without needing the vmlinux file Signed-off-by: Aditya Gupta Reported-by: Sachin Sant Tested-by: Sachin Sant Signed-off-by: Michael Ellerman Link: https://msgid.link/20230911091409.415662-1-adityag@linux.ibm.com commit f84b727d132c39c70208503e60149af6dd5a217f Author: Yuan Tan Date: Thu Sep 14 18:10:42 2023 +0800 powerpc/32: Enable POWER_RESET in pmac32_defconfig Enable POWER_RESET, and drop ADB_CUDA as it will now be selected. Suggested-by: Philippe Mathieu-Daudé Suggested-by: Christophe Leroy Signed-off-by: Yuan Tan Signed-off-by: Michael Ellerman Link: https://msgid.link/73716a14e9a24bcea4ca6c454aae308c419933c6.1694685860.git.tanyuan@tinylab.org commit a3ef2fef198c25c1d9ac6ff89fd50230e9507207 Author: Yuan Tan Date: Thu Sep 14 18:10:31 2023 +0800 powerpc/32: Add dependencies of POWER_RESET for pmac32 pmac32's power off depends on ADB_CUDA to work. Enable it when POWER_RESET is set for convenience. Suggested-by: Zhangjin Wu Signed-off-by: Yuan Tan Signed-off-by: Michael Ellerman Link: https://msgid.link/0cca5d5afb6c4a1b78648e98339b4b7c9def46d5.1694685860.git.tanyuan@tinylab.org commit 06b627c1236216ac1239c5e1afcc75359af3fb72 Author: Julia Lawall Date: Thu Sep 7 11:55:16 2023 +0200 powerpc/kexec_file: add missing of_node_put for_each_node_with_property performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. This was done using the Coccinelle semantic patch iterators/for_each_child.cocci Signed-off-by: Julia Lawall Signed-off-by: Michael Ellerman Link: https://msgid.link/20230907095521.14053-7-Julia.Lawall@inria.fr commit a59e9eb25216eb1dc99e14fc31b76aa648d79540 Author: Julia Lawall Date: Thu Sep 7 11:55:13 2023 +0200 powerpc/powermac: 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. This was done using the Coccinelle semantic patch iterators/for_each_child.cocci Signed-off-by: Julia Lawall Signed-off-by: Michael Ellerman Link: https://msgid.link/20230907095521.14053-4-Julia.Lawall@inria.fr commit d692873cbe861a870cdc9cbfb120eefd113c3dfd Author: Gustavo A. R. Silva Date: Fri Sep 15 12:17:49 2023 -0600 gve: Use size_add() in call to struct_size() If, for any reason, `tx_stats_num + rx_stats_num` wraps around, the protection that struct_size() adds against potential integer overflows is defeated. Fix this by hardening call to struct_size() with size_add(). Fixes: 691f4077d560 ("gve: Replace zero-length array with flexible-array member") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: David S. Miller commit 3e3eabe26dc88692d34cf76ca0e0dd331481cc15 Author: Ard Biesheuvel Date: Fri Sep 15 17:16:32 2023 +0000 x86/boot: Increase section and file alignment to 4k/512 Align x86 with other EFI architectures, and increase the section alignment to the EFI page size (4k), so that firmware is able to honour the section permission attributes and map code read-only and data non-executable. There are a number of requirements that have to be taken into account: - the sign tools get cranky when there are gaps between sections in the file view of the image - the virtual offset of each section must be aligned to the image's section alignment - the file offset *and size* of each section must be aligned to the image's file alignment - the image size must be aligned to the section alignment - each section's virtual offset must be greater than or equal to the size of the headers. In order to meet all these requirements, while avoiding the need for lots of padding to accommodate the .compat section, the latter is placed at an arbitrary offset towards the end of the image, but aligned to the minimum file alignment (512 bytes). The space before the .text section is therefore distributed between the PE header, the .setup section and the .compat section, leaving no gaps in the file coverage, making the signing tools happy. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230915171623.655440-18-ardb@google.com commit 34951f3c28bdf6481d949a20413b2ce7693687b2 Author: Ard Biesheuvel Date: Fri Sep 15 17:16:31 2023 +0000 x86/boot: Split off PE/COFF .data section Describe the code and data of the decompressor binary using separate .text and .data PE/COFF sections, so that we will be able to map them using restricted permissions once we increase the section and file alignment sufficiently. This avoids the need for memory mappings that are writable and executable at the same time, which is something that is best avoided for security reasons. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230915171623.655440-17-ardb@google.com commit fa5750521e0a4efbc1af05223da9c4bbd6c21c83 Author: Ard Biesheuvel Date: Fri Sep 15 17:16:30 2023 +0000 x86/boot: Drop PE/COFF .reloc section Ancient buggy EFI loaders may have required a .reloc section to be present at some point in time, but this has not been true for a long time so the .reloc section can just be dropped. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230915171623.655440-16-ardb@google.com commit efa089e63b56bdc5eca754b995cb039dd7a5457e Author: Ard Biesheuvel Date: Fri Sep 15 17:16:29 2023 +0000 x86/boot: Construct PE/COFF .text section from assembler Now that the size of the setup block is visible to the assembler, it is possible to populate the PE/COFF header fields from the asm code directly, instead of poking the values into the binary using the build tool. This will make it easier to reorganize the section layout without having to tweak the build tool in lockstep. This change has no impact on the resulting bzImage binary. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230915171623.655440-15-ardb@google.com commit aeb92067f6ae994b541d7f9752fe54ed3d108bcc Author: Ard Biesheuvel Date: Fri Sep 15 17:16:28 2023 +0000 x86/boot: Derive file size from _edata symbol Tweak the linker script so that the value of _edata represents the decompressor binary's file size rounded up to the appropriate alignment. This removes the need to calculate it in the build tool, and will make it easier to refer to the file size from the header directly in subsequent changes to the PE header layout. While adding _edata to the sed regex that parses the compressed vmlinux's symbol list, tweak the regex a bit for conciseness. This change has no impact on the resulting bzImage binary when configured with CONFIG_EFI_STUB=y. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230915171623.655440-14-ardb@google.com commit 093ab258e3fb1d1d3afdfd4a69403d44ce90e360 Author: Ard Biesheuvel Date: Fri Sep 15 17:16:27 2023 +0000 x86/boot: Define setup size in linker script The setup block contains the real mode startup code that is used when booting from a legacy BIOS, along with the boot_params/setup_data that is used by legacy x86 bootloaders to pass the command line and initial ramdisk parameters, among other things. The setup block also contains the PE/COFF header of the entire combined image, which includes the compressed kernel image, the decompressor and the EFI stub. This PE header describes the layout of the executable image in memory, and currently, the fact that the setup block precedes it makes it rather fiddly to get the right values into the right place in the final image. Let's make things a bit easier by defining the setup_size in the linker script so it can be referenced from the asm code directly, rather than having to rely on the build tool to calculate it. For the time being, add 64 bytes of fixed padding for the .reloc and .compat sections - this will be removed in a subsequent patch after the PE/COFF header has been reorganized. This change has no impact on the resulting bzImage binary when configured with CONFIG_EFI_MIXED=y. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230915171623.655440-13-ardb@google.com commit eac956345f99dda3d68f4ae6cf7b494105e54780 Author: Ard Biesheuvel Date: Fri Sep 15 17:16:26 2023 +0000 x86/boot: Set EFI handover offset directly in header asm The offsets of the EFI handover entrypoints are available to the assembler when constructing the header, so there is no need to set them from the build tool afterwards. This change has no impact on the resulting bzImage binary. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230915171623.655440-12-ardb@google.com commit 2e765c02dcbfc2a8a4527c621a84b9502f6b9bd2 Author: Ard Biesheuvel Date: Fri Sep 15 17:16:25 2023 +0000 x86/boot: Grab kernel_info offset from zoffset header directly Instead of parsing zoffset.h and poking the kernel_info offset value into the header from the build tool, just grab the value directly in the asm file that describes this header. This change has no impact on the resulting bzImage binary. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230915171623.655440-11-ardb@google.com commit ebdada9de39d6a398bd4ba1007e306b57149083c Merge: 685c6d5b2ccbf bc7bea452d322 Author: David S. Miller Date: Sun Sep 17 17:42:37 2023 +0100 Merge branch 'vsock-tests' Stefano Garzarella says: ==================== vsock/test: add recv_buf()/send_buf() utility functions and some improvements We recently found that some tests were failing [1]. The problem was that we were not waiting for all the bytes correctly, so we had a partial read. I had initially suggested using MSG_WAITALL, but this could have timeout problems. Since we already had send_byte() and recv_byte() that handled the timeout, but also the expected return value, I moved that code to two new functions that we can now use to send/receive generic buffers. The last commit is just an improvement to a test I found difficult to understand while using the new functions. @Arseniy a review and some testing are really appreciated :-) [1] https://lore.kernel.org/netdev/63xflnwiohdfo6m3vnrrxgv2ulplencpwug5qqacugqh7xxpu3@tsczkuqgwurb/ ==================== Signed-off-by: David S. Miller commit bc7bea452d322b785d960fd20795babff664975c Author: Stefano Garzarella Date: Fri Sep 15 14:14:52 2023 +0200 vsock/test: track bytes in sk_buff merging test for SOCK_SEQPACKET The test was a bit complicated to read. Added variables to keep track of the bytes read and to be read in each step. Also some comments. The test is unchanged. Signed-off-by: Stefano Garzarella Reviewed-by: Arseniy Krasnov Signed-off-by: David S. Miller commit 2a8548a9bb4c4ba14badd6be72f1d2b87a6bddc0 Author: Stefano Garzarella Date: Fri Sep 15 14:14:51 2023 +0200 vsock/test: use send_buf() in vsock_test.c We have a very common pattern used in vsock_test that we can now replace with the new send_buf(). This allows us to reuse the code we already had to check the actual return value and wait for all the bytes to be sent with an appropriate timeout. Signed-off-by: Stefano Garzarella Reviewed-by: Arseniy Krasnov Signed-off-by: David S. Miller commit 12329bd51fdcde211fd9c76015ded4db3458ba8a Author: Stefano Garzarella Date: Fri Sep 15 14:14:50 2023 +0200 vsock/test: add send_buf() utility function Move the code of send_byte() out in a new utility function that can be used to send a generic buffer. This new function can be used when we need to send a custom buffer and not just a single 'A' byte. Signed-off-by: Stefano Garzarella Reviewed-by: Arseniy Krasnov Signed-off-by: David S. Miller commit a0bcb83577165b0d6fb948c8ab207a1dd7146f6f Author: Stefano Garzarella Date: Fri Sep 15 14:14:49 2023 +0200 vsock/test: use recv_buf() in vsock_test.c We have a very common pattern used in vsock_test that we can now replace with the new recv_buf(). This allows us to reuse the code we already had to check the actual return value and wait for all bytes to be received with an appropriate timeout. Signed-off-by: Stefano Garzarella Reviewed-by: Arseniy Krasnov Signed-off-by: David S. Miller commit a8ed71a27ef524c808b518031feac811ed3e741c Author: Stefano Garzarella Date: Fri Sep 15 14:14:48 2023 +0200 vsock/test: add recv_buf() utility function Move the code of recv_byte() out in a new utility function that can be used to receive a generic buffer. This new function can be used when we need to receive a custom buffer and not just a single 'A' byte. Signed-off-by: Stefano Garzarella Reviewed-by: Arseniy Krasnov Signed-off-by: David S. Miller commit 685c6d5b2ccbf2d93cbe580391f62ceaabf72f33 Merge: fbb49deb2103f ec6f1b4db95b7 Author: David S. Miller Date: Sun Sep 17 15:12:06 2023 +0100 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Alexei Starovoitov says: ==================== The following pull-request contains BPF updates for your *net-next* tree. We've added 73 non-merge commits during the last 9 day(s) which contain a total of 79 files changed, 5275 insertions(+), 600 deletions(-). The main changes are: 1) Basic BTF validation in libbpf, from Andrii Nakryiko. 2) bpf_assert(), bpf_throw(), exceptions in bpf progs, from Kumar Kartikeya Dwivedi. 3) next_thread cleanups, from Oleg Nesterov. 4) Add mcpu=v4 support to arm32, from Puranjay Mohan. 5) Add support for __percpu pointers in bpf progs, from Yonghong Song. 6) Fix bpf tailcall interaction with bpf trampoline, from Leon Hwang. 7) Raise irq_work in bpf_mem_alloc while irqs are disabled to improve refill probabablity, from Hou Tao. Please consider pulling these changes from: git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git Thanks a lot! Also thanks to reporters, reviewers and testers of commits in this pull-request: Alan Maguire, Andrey Konovalov, Dave Marchevsky, "Eric W. Biederman", Jiri Olsa, Maciej Fijalkowski, Quentin Monnet, Russell King (Oracle), Song Liu, Stanislav Fomichev, Yonghong Song ==================== Signed-off-by: David S. Miller commit fbb49deb2103f70d2bc7dc7e79e5bfe33a3824ab Merge: 002841be134e6 adcbb85508c8b Author: David S. Miller Date: Sun Sep 17 14:31:24 2023 +0100 Merge branch 'phy-stopping-race' Russell King says: ==================== net: phy: avoid race when erroring stopping PHY This series addresses a problem reported by Jijie Shao where the PHY state machine can race with phy_stop() leading to an incorrect state. The issue centres around phy_state_machine() dropping the phydev->lock mutex briefly, which allows phy_stop() to get in half-way through the state machine, and when the state machine resumes, it overwrites phydev->state with a value incompatible with a stopped PHY. This causes a subsequent phy_start() to issue a warning. We address this firstly by using versions of functions that do not take tne lock, moving them into the locked region. The only function that this can't be done with is phy_suspend() which needs to call into the driver without taking the lock. For phy_suspend(), we split the state machine into two parts - the initial part which runs under the phydev->lock, and the second part which runs without the lock. We finish off by using the split state machine in phy_stop() which removes another unnecessary unlock-lock sequence from phylib. Changes from RFC: - Added Jijie Shao's tested-by ==================== Signed-off-by: David S. Miller commit adcbb85508c8bb181704154eec1dfe20554ddfe9 Author: Russell King (Oracle) Date: Thu Sep 14 16:36:02 2023 +0100 net: phy: convert phy_stop() to use split state machine Convert phy_stop() to use the new locked-section and unlocked-section parts of the PHY state machine. Tested-by: Jijie Shao Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 8635c0663e6bd8b4a11c0cf33d3b067db67ea819 Author: Russell King (Oracle) Date: Thu Sep 14 16:35:57 2023 +0100 net: phy: split locked and unlocked section of phy_state_machine() Split out the locked and unlocked sections of phy_state_machine() into two separate functions which can be called inside the phydev lock and outside the phydev lock as appropriate, thus allowing us to combine the locked regions in the caller of phy_state_machine() with the locked region inside phy_state_machine(). This avoids unnecessarily dropping the phydev lock which may allow races to occur. Tested-by: Jijie Shao Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit c398ef41b6d48bd204260b136b4517e0f130892a Author: Russell King (Oracle) Date: Thu Sep 14 16:35:52 2023 +0100 net: phy: move phy_state_machine() Move phy_state_machine() before phy_stop() to avoid subsequent patches introducing forward references. Tested-by: Jijie Shao Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 6e19b3502c59ad21aa405383dfd0bdf4e841de57 Author: Russell King (Oracle) Date: Thu Sep 14 16:35:47 2023 +0100 net: phy: move phy_suspend() to end of phy_state_machine() Move the call to phy_suspend() to the end of phy_state_machine() after we release the lock so that we can combine the locked areas. phy_suspend() can not be called while holding phydev->lock as it has caused deadlocks in the past. Tested-by: Jijie Shao Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit ea5968cd7d6e6f237cfc6d00aa29ff1dc9230b2f Author: Russell King (Oracle) Date: Thu Sep 14 16:35:41 2023 +0100 net: phy: move call to start aneg Move the call to start auto-negotiation inside the lock in the PHYLIB state machine, calling the locked variant _phy_start_aneg(). This avoids unnecessarily releasing and re-acquiring the lock. Tested-by: Jijie Shao Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit ef113a60d0a901c28c1b844bf967c180528155c5 Author: Russell King (Oracle) Date: Thu Sep 14 16:35:36 2023 +0100 net: phy: call phy_error_precise() while holding the lock Move the locking out of phy_error_precise() and to its only call site, merging with the locked region that has already been taken. Tested-by: Jijie Shao Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 8da77df649c43d9cec70d683ee317ba5d49d09b7 Author: Russell King (Oracle) Date: Thu Sep 14 16:35:31 2023 +0100 net: phy: always call phy_process_state_change() under lock phy_stop() calls phy_process_state_change() while holding the phydev lock, so also arrange for phy_state_machine() to do the same, so that this function is called with consistent locking. Tested-by: Jijie Shao Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 002841be134e60994a34b510eebf5f091d0cd6c6 Author: Oleksij Rempel Date: Thu Sep 14 15:11:45 2023 +0200 net: dsa: microchip: Add partial ACL support for ksz9477 switches This patch adds partial Access Control List (ACL) support for the ksz9477 family of switches. ACLs enable filtering of incoming layer 2 MAC, layer 3 IP, and layer 4 TCP/UDP packets on each port. They provide additional capabilities for filtering routed network protocols and can take precedence over other forwarding functions. ACLs can filter ingress traffic based on header fields such as source/destination MAC address, EtherType, IPv4 address, IPv4 protocol, UDP/TCP ports, and TCP flags. The ACL is an ordered list of up to 16 access control rules programmed into the ACL Table. Each entry specifies a set of matching conditions and action rules for controlling packet forwarding and priority. The ACL also implements a count function, generating an interrupt instead of a forwarding action. It can be used as a watchdog timer or an event counter. The ACL consists of three parts: matching rules, action rules, and processing entries. Multiple match conditions can be either AND'ed or OR'ed together. This patch introduces support for a subset of the available ACL functionality, specifically layer 2 matching and prioritization of matched packets. For example: tc qdisc add dev lan2 clsact tc filter add dev lan2 ingress protocol 0x88f7 flower action skbedit prio 7 tc qdisc add dev lan1 clsact tc filter add dev lan1 ingress protocol 0x88f7 flower action skbedit prio 7 The hardware offloading implementation was benchmarked against a configuration without hardware offloading. This latter setup relied on a software-based Linux bridge. No noticeable differences were observed between the two configurations. Here is an example of software-based test: ip l s dev enu1u1 up ip l s dev enu1u2 up ip l s dev enu1u4 up ethtool -A enu1u1 autoneg off rx off tx off ethtool -A enu1u2 autoneg off rx off tx off ethtool -A enu1u4 autoneg off rx off tx off ip l a name br0 type bridge ip l s dev br0 up ip l s enu1u1 master br0 ip l s enu1u2 master br0 ip l s enu1u4 master br0 tc qdisc add dev enu1u1 root handle 1: ets strict 4 priomap 3 3 2 2 1 1 0 0 tc qdisc add dev enu1u4 root handle 1: ets strict 4 priomap 3 3 2 2 1 1 0 0 tc qdisc add dev enu1u2 root handle 1: ets strict 4 priomap 3 3 2 2 1 1 0 0 tc qdisc add dev enu1u1 clsact tc filter add dev enu1u1 ingress protocol ipv4 flower action skbedit prio 7 tc qdisc add dev enu1u4 clsact tc filter add dev enu1u4 ingress protocol ipv4 flower action skbedit prio 0 On a system attached to the port enu1u2 I run two iperf3 server instances: iperf3 -s -p 5210 & iperf3 -s -p 5211 & On systems attached to enu1u4 and enu1u1 I run: iperf3 -u -c 172.17.0.1 -p 5210 -b100M -l1472 -t100 and iperf3 -u -c 172.17.0.1 -p 5211 -b100M -l1472 -t100 As a result, IP traffic on port enu1u1 will be prioritized and take precedence over IP traffic on port enu1u4 Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 152992279e416553f7b421ab22406ae0b1c71aba Author: Oleksij Rempel Date: Thu Sep 14 15:11:44 2023 +0200 net: dsa: microchip: Move *_port_setup code to dsa_switch_ops::port_setup() Right now, the *_port_setup code is in dsa_switch_ops::port_enable(), which is not the best place for it. This patch moves it to a more suitable place, dsa_switch_ops::port_setup(), to match the function's purpose and name. This patch is a preparation for coming ACL support patch. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit e03f0dfbddd516687ad5582882037d0462f268cc Merge: 1e73cfe859523 6c75258cc220e Author: David S. Miller Date: Sun Sep 17 14:01:47 2023 +0100 Merge branch 'devlink-instances-relationships' Jiri Pirko says: ==================== expose devlink instances relationships From: Jiri Pirko Currently, the user can instantiate new SF using "devlink port add" command. That creates an E-switch representor devlink port. When user activates this SF, there is an auxiliary device created and probed for it which leads to SF devlink instance creation. There is 1:1 relationship between E-switch representor devlink port and the SF auxiliary device devlink instance. Also, for example in mlx5, one devlink instance is created for PCI device and one is created for an auxiliary device that represents the uplink port. The relation between these is invisible to the user. Patches #1-#3 and #5 are small preparations. Patch #4 adds netnsid attribute for nested devlink if that in a different namespace. Patch #5 is the main one in this set, introduces the relationship tracking infrastructure later on used to track SFs, linecards and devlink instance relationships with nested devlink instances. Expose the relation to the user by introducing new netlink attribute DEVLINK_PORT_FN_ATTR_DEVLINK which contains the devlink instance related to devlink port function. This is done by patch #8. Patch #9 implements this in mlx5 driver. Patch #10 converts the linecard nested devlink handling to the newly introduced rel infrastructure. Patch #11 benefits from the rel infra and introduces possiblitily to have relation between devlink instances. Patch #12 implements this in mlx5 driver. Examples: $ devlink dev pci/0000:08:00.0: nested_devlink auxiliary/mlx5_core.eth.0 pci/0000:08:00.1: nested_devlink auxiliary/mlx5_core.eth.1 auxiliary/mlx5_core.eth.1 auxiliary/mlx5_core.eth.0 $ devlink port add pci/0000:08:00.0 flavour pcisf pfnum 0 sfnum 106 pci/0000:08:00.0/32768: type eth netdev eth4 flavour pcisf controller 0 pfnum 0 sfnum 106 splittable false function: hw_addr 00:00:00:00:00:00 state inactive opstate detached roce enable $ devlink port function set pci/0000:08:00.0/32768 state active $ devlink port show pci/0000:08:00.0/32768 pci/0000:08:00.0/32768: type eth netdev eth4 flavour pcisf controller 0 pfnum 0 sfnum 106 splittable false function: hw_addr 00:00:00:00:00:00 state active opstate attached roce enable nested_devlink auxiliary/mlx5_core.sf.2 $ devlink port show pci/0000:08:00.0/32768 pci/0000:08:00.0/32768: type eth netdev eth4 flavour pcisf controller 0 pfnum 0 sfnum 106 splittable false function: hw_addr 00:00:00:00:00:00 state active opstate attached roce enable nested_devlink auxiliary/mlx5_core.sf.2 nested_devlink_netns ns1 ==================== Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit 6c75258cc220eb11c31ec8cd23ddf7e1232077bd Author: Jiri Pirko Date: Wed Sep 13 09:12:43 2023 +0200 net/mlx5e: Set en auxiliary devlink instance as nested Benefit from the previous commit introducing exposure of devlink instances relationship and set the nested instance for en auxiliary device. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit c5e1bf8a51cfe5060e91c7533098e329c0118f6d Author: Jiri Pirko Date: Wed Sep 13 09:12:42 2023 +0200 devlink: introduce possibility to expose info about nested devlinks In mlx5, there is a devlink instance created for PCI device. Also, one separate devlink instance is created for auxiliary device that represents the netdev of uplink port. This relation is currently invisible to the devlink user. Benefit from the rel infrastructure and allow for nested devlink instance to set the relationship for the nested-in devlink instance. Note that there may be many nested instances, therefore use xarray to hold the list of rel_indexes for individual nested instances. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 9473bc0119e7e7630d7c1c7c3816c290a6f3ae19 Author: Jiri Pirko Date: Wed Sep 13 09:12:41 2023 +0200 devlink: convert linecard nested devlink to new rel infrastructure Benefit from the newly introduced rel infrastructure, treat the linecard nested devlink instances in the same way as port function instances. Convert the code to use the rel infrastructure. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit ac5f395685bd16ca30c1c834dcbf8b555605ccae Author: Jiri Pirko Date: Wed Sep 13 09:12:40 2023 +0200 net/mlx5: SF, Implement peer devlink set for SF representor devlink port Benefit from the existence of internal mlx5 notifier and extend it by event MLX5_DRIVER_EVENT_SF_PEER_DEVLINK. Use this event from SF auxiliary device probe/remove functions to pass the registered SF devlink instance to the SF representor. Process the new event in SF representor code and call devl_port_fn_devlink_set() to do the assignments. Implement this in work to avoid possible deadlock when probe/remove function of SF may be called with devlink instance lock held during devlink reload. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 0b7a2721e36c11313f8b0f251a508d25a872cd28 Author: Jiri Pirko Date: Wed Sep 13 09:12:39 2023 +0200 devlink: expose peer SF devlink instance Introduce a new helper devl_port_fn_devlink_set() to be used by driver assigning a devlink instance to the peer devlink port function. Expose this to user over new netlink attribute nested under port function nest to expose devlink handle related to the port function. This is particularly helpful for user to understand the relationship between devlink instances created for SFs and the port functions they belong to. Note that caller of devlink_port_notify() needs to hold devlink instance lock, put the assertion to devl_port_fn_devlink_set() to make this requirement explicit. Also note the limitations that only allow to make this assignment for registered objects. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit c137743bce02b18c1537d4681aa515f7b80bf0a8 Author: Jiri Pirko Date: Wed Sep 13 09:12:38 2023 +0200 devlink: introduce object and nested devlink relationship infra It is a bit tricky to maintain relationship between devlink objects and nested devlink instances due to following aspects: 1) Locking. It is necessary to lock the devlink instance that contains the object first, only after that to lock the nested instance. 2) Lifetimes. Objects (e.g devlink port) may be removed before the nested devlink instance. 3) Notifications. If nested instance changes (e.g. gets registered/unregistered) the nested-in object needs to send appropriate notifications. Resolve this by introducing an xarray that holds 1:1 relationships between devlink object and related nested devlink instance. Use that xarray index to get the object/nested devlink instance on the other side. Provide necessary helpers: devlink_rel_nested_in_add/clear() to add and clear the relationship. devlink_rel_nested_in_notify() to call the nested-in object to send notifications during nested instance register/unregister/netns change. devlink_rel_devlink_handle_put() to be used by nested-in object fill function to fill the nested handle. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 1c2197c47a93d0ea36e73e437271c7cbcc0e1ceb Author: Jiri Pirko Date: Wed Sep 13 09:12:37 2023 +0200 devlink: extend devlink_nl_put_nested_handle() with attrtype arg As the next patch is going to call this helper with need to fill another type of nested attribute, pass it over function arg. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit af1f1400af02e5a069d86ae7001b563c99395ea2 Author: Jiri Pirko Date: Wed Sep 13 09:12:36 2023 +0200 devlink: move devlink_nl_put_nested_handle() into netlink.c As the next patch is going to call this helper out of the linecard.c, move to netlink.c. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit ad99637ac92dc18b979e6fa26eb440f38c0c6b55 Author: Jiri Pirko Date: Wed Sep 13 09:12:35 2023 +0200 devlink: put netnsid to nested handle If netns of devlink instance and nested devlink instance differs, put netnsid attr to indicate that. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 602d61e307ac9eabb1b3acdec16b3bec78b75e04 Author: Jiri Pirko Date: Wed Sep 13 09:12:34 2023 +0200 net/mlx5: Lift reload limitation when SFs are present Historically, the shared devlink_mutex prevented devlink instances from being registered/unregistered during another devlink instance reload operation. However, devlink_muxex is gone for some time now, this limitation is no longer needed. Lift it. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 85b47dc40bbc72ad68ff9d43bf750290b3c40c2b Author: Jiri Pirko Date: Wed Sep 13 09:12:33 2023 +0200 net/mlx5: Disable eswitch as the first thing in mlx5_unload() The eswitch disable call does removal of all representors. Do that before clearing the SF device table and maintain the same flow as during SF devlink port removal, where the representor is removed before the actual SF is removed. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit d0b7e990f760ec9a614fbe5f89a5cede4335a7bb Author: Jiri Pirko Date: Wed Sep 13 09:12:32 2023 +0200 devlink: move linecard struct into linecard.c Instead of exposing linecard struct, expose a simple helper to get the linecard index, which is all is needed outside linecard.c. Move the linecard struct to linecard.c and keep it private similar to the rest of the devlink objects. Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 1e73cfe859523236e6e29167673fc2885f1b99c4 Author: Pavithra Sathyanarayanan Date: Thu Sep 14 11:47:37 2023 +0530 net: microchip: lan743x: add fixed phy unregister support When operating in fixed phy mode and if there is repeated open/close phy test cases, everytime the fixed phy is registered as a new phy which leads to overrun after 32 iterations. It is solved by adding fixed_phy_unregister() in the phy_close path. In phy_close path, netdev->phydev cannot be used directly in fixed_phy_unregister() due to two reasons, - netdev->phydev is set to NULL in phy_disconnect() - fixed_phy_unregister() can be called only after phy_disconnect() So saving the netdev->phydev in local variable 'phydev' and passing it to phy_disconnect(). Signed-off-by: Pavithra Sathyanarayanan Signed-off-by: David S. Miller commit 037dbd122d0e223b2dbfe4333bce8274f5ab96d5 Merge: 319d9c2a93132 496fd0a26bbf7 Author: David S. Miller Date: Sun Sep 17 11:50:21 2023 +0100 Merge branch 'dpll-api' Vadim Fedorenko says: ==================== Create common DPLL configuration API Implement common API for DPLL configuration and status reporting. The API utilises netlink interface as transport for commands and event notifications. This API aims to extend current pin configuration provided by PTP subsystem and make it flexible and easy to cover complex configurations. Netlink interface is based on ynl spec, it allows use of in-kernel tools/net/ynl/cli.py application to control the interface with properly formated command and json attribute strings. Here are few command examples of how it works with `ice` driver on supported NIC: - dump dpll devices: $ sudo ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/dpll.yaml \ --dump device-get [{'clock-id': 4658613174691613800, 'id': 0, 'lock-status': 'locked-ho-acq', 'mode': 'automatic', 'mode-supported': ['automatic'], 'module-name': 'ice', 'type': 'eec'}, {'clock-id': 4658613174691613800, 'id': 1, 'lock-status': 'locked-ho-acq', 'mode': 'automatic', 'mode-supported': ['automatic'], 'module-name': 'ice', 'type': 'pps'}] - get single pin info: $ sudo ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/dpll.yaml \ --do pin-get --json '{"id":2}' {'board-label': 'C827_0-RCLKA', 'clock-id': 4658613174691613800, 'capabilities': 6, 'frequency': 1953125, 'id': 2, 'module-name': 'ice', 'parent-device': [{'direction': 'input', 'parent-id': 0, 'prio': 9, 'state': 'disconnected'}, {'direction': 'input', 'parent-id': 1, 'prio': 9, 'state': 'disconnected'}], 'type': 'mux'} - set pin's state on dpll: $ sudo ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/dpll.yaml \ --do pin-set --json '{"id":2, "parent-device":{"parent-id":1, "state":2}}' - set pin's prio on dpll: $ sudo ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/dpll.yaml \ --do pin-set --json '{"id":2, "parent-device":{"parent-id":1, "prio":4}}' - set pin's state on parent pin: $ sudo ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/dpll.yaml \ --do pin-set --json '{"id":13, "parent-pin":{"parent-id":2, "state":1}}' Changelog: v7 -> v8: - rebase on top of net-next - no functional changes in patchset v6 -> v7: - use unique id in references array to prevent possible crashes v5 -> v6: - change dpll-caps to pin capabilities and adjust enum accordingly - remove dpll.h from netdevice.h v4 -> v5: - separate namespace for pin attributes - small fixes, more details in the patches v3 -> v4: - rebase on top of net-next - fix flag usage in ice v2 -> v3: - more style and warning fixes - details in per-patch logs v1 -> v2: - remove FREERUN/DETACHED mode - reorder functions in commits not to depend on files introduced in future commits - style and warning fixes v9 RFC -> v1: - Merge header patch into the patches where the actual functions are implemented - Address comments from previous reviews - Per patch change log contains more details RFC versions: v8 -> v9: [00/10] Create common DPLL configuration API - update examples to reflect new pin-parent nest split [01/10] dpll: documentation on DPLL subsystem interface - fix docs build warnings - separate netlink command/attribute list - replace enum description with uapi header - add brief explanation what is a DPLL - fix EOPNOTSUPP typo - fix typo .state_get -> .state_on_dpll_get [02/10] dpll: spec: Add Netlink spec in YAML - regenerate policy max values - add missing enum descriptions - split pin-parent nest: - pin-parent-device - for configuration of pin-device tuple - pin-parent-pin - for configuration od pin-pin tuple - fix typos: - s/working-modes/working modes/ - s/differentiate/differentiates/ - s/valid input, auto selected by dpll/input pin auto selected by dpll/ - remove FREERUN and HOLDOVER modes [03/10] dpll: core: Add DPLL framework base functions - fix description in spdx header. - remove refcount check if refcount was already set - do not validate dpll ptr in dpll_device_put(..) - fix return -ENOMEM on failed memory alloc - do not validate pin ptr in dpll_pin_put(..) - return -EINVAL in case of module/clock_id mismatch - do not {} around one-line xa_for_each() macro - move dpll__registration structs to dpll_core.c - rephrase doc comment on device and pin id struct members - remove ref in case of memory allocation fail - check for required ops on pin/device registration - mark pin with DPLL_REGISTERED once pin is registered with dpll [04/10] dpll: netlink: Add DPLL framework base functions - fix pin-id-get/device-id-get behavior - reshuffle order of functions - avoid forward declarations - functions for adding pin/device handle next to each other - pass ops callback return values to the user - remove dpll_cmd_pin_fill_details(..) function, merge the code into __dpll_cmd_pin_dump_one(..) - rename __dpll_cmd_pin_dump_one() to dpll_cmd_pin_get_one() - use WARN_ON macro when dpll ref is missing - remove redundant pin's dpll list not empty check - remove double spaces inside if statement - add extack message when set command is not possible - do not return error when callback is not required - WARN_ON missing ops moved to dpll_core.c - use DPLL_REGISTERED if pin was registered with dpll - fix pin-id-get return and add extack errors - fix device-id-get return and add extack errors - drop pointless init of variables - add macro for iterating over marked pins/devices - move dpll_set_from_nlattr() for consistent order - use GENL_REQ_ATTR_CHECK() for checking attibute presence - fill extack if pin/device was not found - drop pointless init of variables - WARN_ON if dpll not registered on send event - rename goto labels to indicate error path - fix docs - drop pointless init of variables - verify pin in notify with a mark - prevent ops->mode_set call if missing callback - move static dpll_msg_add_pin_handle() from pin<->netdev patch - split pin-parent nest: - pin-parent-device - for configuration of pin-device tuple - pin-parent-pin - for configuration od pin-pin tuple [06/10] netdev: expose DPLL pin handle for netdevice - net_device->dpll_pin is only valid if IS_ENABLED(CONFIG_DPLL) fix the code in net/core/rtnetlink.c to respect that. - move dpll_msg_add_pin_handle to "dpll: netlink" patch + export the function with this patch [07/10] ice: add admin commands to access cgu configuration - rename MAX_NETLIST_SIZE -> ICE_MAX_NETLIST_SIZE - simplify function: s64 convert_s48_to_s64(s64 signed_48) - do not assign 0 to field that is already 0 [08/10] ice: implement dpll interface to control cgu - drop pointless 0 assignement - ice_dpll_init(..) returns void instead of int - fix context description of the functions - fix ice_dpll_init(..) traces - fix use package_label instead pf board_label for rclk pin - be consistent on cgu presence naming - remove indent in ice_dpll_deinit(..) - remove unused struct field lock_err_num - fix kworker resched behavior - remove debug log from ice_dpll_deinit_worker(..) - reorder ice internal functions - release resources directly on error path - remove redundant NULL checks when releasing resources - do not assign NULL to pointers after releasing resources - simplify variable assignement - fix 'int ret;' declarations across the ice_dpll.c - remove leftover ice_dpll_find(..) - get pf pointer from dpll_priv without type cast - improve error reporting - fix documentation - fix ice_dpll_update_state(..) flow - fix return in case out of range prio set v7 -> v8: [0/10] Create common DPLL configuration API - reorder the patches in patch series - split patch "[RFC PATCH v7 2/8] dpll: Add DPLL framework base functions" into 3 smaller patches for easier review: - [03/10] dpll: core: Add DPLL framework base functions - [04/10] dpll: netlink: Add DPLL framework base functions - [05/10] dpll: api header: Add DPLL framework base - add cli.py usage examples in commit message [01/10] dpll: documentation on DPLL subsystem interface - fix DPLL_MODE_MANUAL documentation - remove DPLL_MODE_NCO - remove DPLL_LOCK_STATUS_CALIBRATING - add grepability Use full names of commands, attributes and values of dpll subsystem in the documentation - align documentation with changes introduced in v8 - fix typos - fix phrases to better show the intentions - move dpll.rst to Documentation/driver-api/ [02/10] dpll: spec: Add Netlink spec in YAML - remove unspec attribute values - add 10 KHZ and 77,5 KHZ frequency defines - fix documentation - remove assigned values from subset attributes - reorder dpll attributes - fix `device` nested attribute usage, device get is not used on pin-get - temperature with 3 digit float precision - remove enum from subset definitions - move pin-direction to pin-dpll tuple/subset - remove DPLL_MODE_NCO - remove DPLL_LOCK_STATUS_CALIBRATING - fix naming scheme od notification interface functions - separate notifications for pins - rename attribute enum name: dplla -> dpll_a - rename pin-idx to pin-id - remove attributes: pin-parent-idx, device - replace bus-name and dev-name attributes with module-name - replace pin-label with 3 new attributes: pin-board-label, pin-panel-label, pin-package-label - add device-id-get and pin-id-get commands - remove rclk-dev-name atribute - rename DPLL_PIN_DIRECTION_SOURCE -> DPLL_PIN_DIRECTION_INPUT [03/10] dpll: core: Add DPLL framework base functions [04/10] dpll: netlink: Add DPLL framework base functions [05/10] dpll: api header: Add DPLL framework base - remove unspec attributes after removing from dpll netlink spec - move pin-direction to pin-dpll tuple - pass parent_priv on state_on_pin_ - align with new notification definitions from netlink spec - use separated notifications for dpll pins and devices - format notification messages as corresponding get netlink commands - rename pin-idx to pin-id - remove attributes pin-parent-idx, device - use DPLL_A_PIN_PARENT to hold information on parent pin or dpll device - refactor lookup for pins and dplls for dpll subsystem - replace bus-name, dev-name with module-name - replace pin-label with 3 new attributes: pin-board-label, pin-panel-label, pin-package-label - add device-id-get and pin-id-get commands - rename dpll_xa_lock to dpll_lock - improve doxygen in dpll_core.c - remove unused parent and dev fields from dpll_device struct - use u32 for pin_idx in dpll_pin_alloc - use driver provided pin properties struct - verify pin/dpll owner on registering pin - remove const arg modifier for helper _priv functions - remove function declaration _get_by_name() - update SPDX headers - parse netlink set attributes with nlattr array - remove rclk-dev-name attribute - remove device pointer from dpll_pin_register/dpll_device_register - remove redundant doxygen from dpll header - use module_name() to get name of module - add missing/remove outdated kdocs - fix call frequency_set only if available - fix call direction_set only for pin-dpll tuple [06/10] netdev: expose DPLL pin handle for netdevice - rebased on top of v8 changes - use dpll_msg_add_pin_handle() in dpll_pin_find_from_nlattr() and dpll_msg_add_pin_parents() - fixed handle to use DPLL_A_PIN_ID and removed temporary comments - added documentation record for dpll_pin pointer - fixed compilation of net/core/dev.c when CONFIG_DPLL is not enabled - adjusted patch description a bit [07/10] ice: add admin commands to access cgu configuration - Remove unspec attributes after removing from dpll netlink spec. [08/10] ice: implement dpll interface to control cgu - remove unspec attributes - do not store pin flags received in set commands - use pin state field to provide pin state to the caller - remove include of uapi header - remove redundant check against null arguments - propagate lock function return value to the caller - use switch case instead of if statements - fix dev_dbg to dev_err for error cases - fix dpll/pin lookup on dpll subsytem callbacks - fix extack of dpll subsystem callbacks - remove double negation and variable cast - simplify ice_dpll_pin_state_set function - pass parent_priv on state_on_pin_ - remove parent hw_idx lookup - fix use const qualifier for dpll/dpll_pin ops - fix IS_ERR macros usage in ice_dpll - add notify previous source state change - fix mutex locking on releasing pins - use '|=' instead of '+=' when modifing capabilities field - rename ice_dpll_register_pins function - clock_id function to return clock ID on the stack instead of using an output variable - DPLL_LOCK_STATUS_CALIBRATING was removed, return: DPLL_LOCK_STATUS_LOCKED - if dpll was locked DPLL_LOCK_STATUS_LOCKED_HO_ACQ - if dpll was locked and holdover is acquired - propagate and use dpll_priv to obtain pf pointer in corresponding functions. - remove null check for pf pointer - adapt to `dpll: core: fix notification scheme` - expose pf related pin to corresponding netdevice - fix dpll init error path - fix dpll pins naming scheme `source` -> `input` - replace pin-label with pin-board-label - dpll remove parent and dev fields from dpll_device - remove device pointer from dpll_pin_register/dpll_device_register - rename DPLL_PIN_DIRECTION_SOURCE -> DPLL_PIN_DIRECTION_INPUT [09/10] ptp_ocp: implement DPLL ops - replace pin-label with pin-board-label - dpll remove parent and dev fields from dpll_device - remove device pointer from dpll_pin_register/dpll_device_register - rename DPLL_PIN_DIRECTION_SOURCE -> DPLL_PIN_DIRECTION_INPUT [10/10] mlx5: Implement SyncE support using DPLL infrastructure - rebased on top of v8 changes: - changed notification scheme - no need to fill pin label - implemented locked_ho_acq status - rename DPLL_PIN_DIRECTION_SOURCE -> DPLL_PIN_DIRECTION_INPUT - remove device pointer from dpll_pin_register/dpll_device_register - fixed MSEES register writes - adjusted pin state and lock state values reported - fixed a white space issue v6 -> v7: * YAML spec: - remove nested 'pin' attribute - clean up definitions on top of the latest changes * pin object: - pin xarray uses id provided by the driver - remove usage of PIN_IDX_INVALID in set function - source_pin_get() returns object instead of idx - fixes in frequency support API * device and pin operations are const now * small fixes in naming in Makefile and in the functions * single mutex for the subsystem to avoid possible ABBA locks * no special *_priv() helpers anymore, private data is passed as void* * no netlink filters by name anymore, only index is supported * update ptp_ocp and ice drivers to follow new API version * add mlx5e driver as a new customer of the subsystem v5 -> v6: * rework pin part to better fit shared pins use cases * add YAML spec to easy generate user-space apps * simple implementation in ptp_ocp is back again v4 -> v5: * fix code issues found during last reviews: - replace cookie with clock id - follow one naming schema in dpll subsys - move function comments to dpll_core.c, fix exports - remove single-use helper functions - merge device register with alloc - lock and unlock mutex on dpll device release - move dpll_type to uapi header - rename DPLLA_DUMP_FILTER to DPLLA_FILTER - rename dpll_pin_state to dpll_pin_mode - rename DPLL_MODE_FORCED to DPLL_MODE_MANUAL - remove DPLL_CHANGE_PIN_TYPE enum value * rewrite framework once again (Arkadiusz) - add clock class: Provide userspace with clock class value of DPLL with dpll device dump netlink request. Clock class is assigned by driver allocating a dpll device. Clock class values are defined as specified in: ITU-T G.8273.2/Y.1368.2 recommendation. - dpll device naming schema use new pattern: "dpll_%s_%d_%d", where: - %s - dev_name(parent) of parent device, - %d (1) - enum value of dpll type, - %d (2) - device index provided by parent device. - new muxed/shared pin registration: Let the kernel module to register a shared or muxed pin without finding it or its parent. Instead use a parent/shared pin description to find correct pin internally in dpll_core, simplifing a dpll API * Implement complex DPLL design in ice driver (Arkadiusz) * Remove ptp_ocp driver from the series for now v3 -> v4: * redesign framework to make pins dynamically allocated (Arkadiusz) * implement shared pins (Arkadiusz) v2 -> v3: * implement source select mode (Arkadiusz) * add documentation * implementation improvements (Jakub) v1 -> v2: * implement returning supported input/output types * ptp_ocp: follow suggestions from Jonathan * add linux-clk mailing list v0 -> v1: * fix code style and errors * add linux-arm mailing list ==================== Signed-off-by: David S. Miller commit 496fd0a26bbf73b6b12407ee4fbe5ff49d659a6d Author: Jiri Pirko Date: Wed Sep 13 21:49:43 2023 +0100 mlx5: Implement SyncE support using DPLL infrastructure Implement SyncE support using newly introduced DPLL support. Make sure that each PFs/VFs/SFs probed with appropriate capability will spawn a dpll auxiliary device and register appropriate dpll device and pin instances. Signed-off-by: Jiri Pirko Signed-off-by: Arkadiusz Kubalewski Signed-off-by: Vadim Fedorenko Signed-off-by: David S. Miller commit 09eeb3aecc6c74c9a911396f9ab46b1a41fcd7b8 Author: Vadim Fedorenko Date: Wed Sep 13 21:49:42 2023 +0100 ptp_ocp: implement DPLL ops Implement basic DPLL operations in ptp_ocp driver as the simplest example of using new subsystem. Signed-off-by: Vadim Fedorenko Signed-off-by: Arkadiusz Kubalewski Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit d7999f5ea64bb10d2857b8cbfe973be373bac7c9 Author: Arkadiusz Kubalewski Date: Wed Sep 13 21:49:41 2023 +0100 ice: implement dpll interface to control cgu Control over clock generation unit is required for further development of Synchronous Ethernet feature. Interface provides ability to obtain current state of a dpll, its sources and outputs which are pins, and allows their configuration. Co-developed-by: Milena Olech Signed-off-by: Milena Olech Co-developed-by: Michal Michalik Signed-off-by: Michal Michalik Signed-off-by: Arkadiusz Kubalewski Signed-off-by: Vadim Fedorenko Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 8a3a565ff210a02a4db270a2e61c37b6687b15aa Author: Arkadiusz Kubalewski Date: Wed Sep 13 21:49:40 2023 +0100 ice: add admin commands to access cgu configuration Add firmware admin command to access clock generation unit configuration, it is required to enable Extended PTP and SyncE features in the driver. Add definitions of possible hardware variations of input and output pins related to clock generation unit and functions to access the data. Signed-off-by: Arkadiusz Kubalewski Signed-off-by: Vadim Fedorenko Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 5f18426928800c59fb0f9bc8fb0c182bb6f5ee24 Author: Jiri Pirko Date: Wed Sep 13 21:49:39 2023 +0100 netdev: expose DPLL pin handle for netdevice In case netdevice represents a SyncE port, the user needs to understand the connection between netdevice and associated DPLL pin. There might me multiple netdevices pointing to the same pin, in case of VF/SF implementation. Add a IFLA Netlink attribute to nest the DPLL pin handle, similar to how it is implemented for devlink port. Add a struct dpll_pin pointer to netdev and protect access to it by RTNL. Expose netdev_dpll_pin_set() and netdev_dpll_pin_clear() helpers to the drivers so they can set/clear the DPLL pin relationship to netdev. Note that during the lifetime of struct dpll_pin the pin handle does not change. Therefore it is save to access it lockless. It is drivers responsibility to call netdev_dpll_pin_clear() before dpll_pin_put(). Signed-off-by: Jiri Pirko Signed-off-by: Arkadiusz Kubalewski Signed-off-by: Vadim Fedorenko Signed-off-by: David S. Miller commit 9d71b54b65b1fb6c0d3a6c5c88ba9b915c783fbc Author: Vadim Fedorenko Date: Wed Sep 13 21:49:38 2023 +0100 dpll: netlink: Add DPLL framework base functions DPLL framework is used to represent and configure DPLL devices in systems. Each device that has DPLL and can configure inputs and outputs can use this framework. Implement dpll netlink framework functions for enablement of dpll subsystem netlink family. Co-developed-by: Milena Olech Signed-off-by: Milena Olech Co-developed-by: Michal Michalik Signed-off-by: Michal Michalik Signed-off-by: Vadim Fedorenko Co-developed-by: Arkadiusz Kubalewski Signed-off-by: Arkadiusz Kubalewski Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 9431063ad323ac864750aeba4d304389bc42ca4e Author: Vadim Fedorenko Date: Wed Sep 13 21:49:37 2023 +0100 dpll: core: Add DPLL framework base functions DPLL framework is used to represent and configure DPLL devices in systems. Each device that has DPLL and can configure inputs and outputs can use this framework. Implement core framework functions for further interactions with device drivers implementing dpll subsystem, as well as for interactions of DPLL netlink framework part with the subsystem itself. Co-developed-by: Milena Olech Signed-off-by: Milena Olech Co-developed-by: Michal Michalik Signed-off-by: Michal Michalik Signed-off-by: Vadim Fedorenko Co-developed-by: Arkadiusz Kubalewski Signed-off-by: Arkadiusz Kubalewski Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 3badff3a25d815e915d89565a0c82dec608a8d2b Author: Vadim Fedorenko Date: Wed Sep 13 21:49:36 2023 +0100 dpll: spec: Add Netlink spec in YAML Add a protocol spec for DPLL. Add code generated from the spec. Signed-off-by: Jakub Kicinski Signed-off-by: Michal Michalik Signed-off-by: Vadim Fedorenko Signed-off-by: Arkadiusz Kubalewski Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit dbb291f19393b628a1d15b94a78d471b9d94e532 Author: Vadim Fedorenko Date: Wed Sep 13 21:49:35 2023 +0100 dpll: documentation on DPLL subsystem interface Add documentation explaining common netlink interface to configure DPLL devices and monitoring events. Common way to implement DPLL device in a driver is also covered. Co-developed-by: Bagas Sanjaya Signed-off-by: Bagas Sanjaya Signed-off-by: Vadim Fedorenko Signed-off-by: Arkadiusz Kubalewski Signed-off-by: Jiri Pirko Signed-off-by: David S. Miller commit 319d9c2a931324e48ec9602c7e1d4bed65c43560 Merge: fff755e76e64f 7559d67242980 Author: David S. Miller Date: Sun Sep 17 11:46:19 2023 +0100 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next -queue Tony Nguyen says: ==================== Support rx-fcs on/off for VFs Ahmed Zaki says: Allow the user to turn on/off the CRC/FCS stripping through ethtool. We first add the CRC offload capability in the virtchannel, then the feature is enabled in ice and iavf drivers. We make sure that the netdev features are fixed such that CRC stripping cannot be disabled if VLAN rx offload (VLAN strip) is enabled. Also, VLAN stripping cannot be enabled unless CRC stripping is ON. Testing was done using tcpdump to make sure that the CRC is included in the frame after: # ethtool -K rx-fcs on and is not included when it is back "off". Also, ethtool should return an error for the above command if "rx-vlan-offload" is already on and at least one VLAN interface/filter exists on the VF. ==================== Signed-off-by: David S. Miller commit e631f61f76329644dd4e88e83d6cca5c0b138949 Author: Mehdi Djait Date: Sat Sep 16 14:38:53 2023 +0200 iio: accel: Add support for Kionix/ROHM KX132-1211 accelerometer Kionix KX132-1211 is a tri-axis 16-bit accelerometer that can support ranges from ±2G to ±16G, digital output through I²C/SPI. Add support for basic accelerometer features such as reading acceleration via IIO using raw reads, triggered buffer (data-ready), or the WMI IRQ. Datasheet: https://kionixfs.azureedge.net/en/document/KX132-1211-Technical-Reference-Manual-Rev-5.0.pdf Acked-by: Matti Vaittinen Reviewed-by: Andy Shevchenko Signed-off-by: Mehdi Djait Link: https://lore.kernel.org/r/389a7d6100ff2e71b1c5d60bebe662d09435996a.1694867379.git.mehdi.djait.k@gmail.com Signed-off-by: Jonathan Cameron commit 774c3fabc9ff5fd10e779a4322ee4cbc36272c07 Author: Mehdi Djait Date: Sat Sep 16 14:38:52 2023 +0200 iio: accel: kionix-kx022a: Add a function to retrieve number of bytes in buffer Since Kionix accelerometers use various numbers of bits to report data, a device-specific function is required. Implement the function as a callback in the device-specific chip_info structure Reviewed-by: Matti Vaittinen Signed-off-by: Mehdi Djait Link: https://lore.kernel.org/r/9c550fb28e34915d473e379f812c7753f7643bae.1694867379.git.mehdi.djait.k@gmail.com Signed-off-by: Jonathan Cameron commit e7123a4dfcd732c4d10620748588e3715f362802 Author: Mehdi Djait Date: Sat Sep 16 14:38:51 2023 +0200 iio: accel: kionix-kx022a: Refactor driver and add chip_info structure Add the chip_info structure to the driver's private data to hold all the device specific infos. Refactor the kx022a driver implementation to make it more generic and extensible. Acked-by: Matti Vaittinen Signed-off-by: Mehdi Djait Link: https://lore.kernel.org/r/7a31d0cdefba15d7c791252ec8bc5db553b3996b.1694867379.git.mehdi.djait.k@gmail.com Signed-off-by: Jonathan Cameron commit 13d5398a8eebcb19e3424979658d97fbe1b21891 Author: Mehdi Djait Date: Sat Sep 16 14:38:50 2023 +0200 iio: accel: kionix-kx022a: Add an i2c_device_id table Add the missing i2c device id. Acked-by: Matti Vaittinen Signed-off-by: Mehdi Djait Link: https://lore.kernel.org/r/61b43bbf35d602eac34b6d81b4d1b2d7ba39786f.1694867379.git.mehdi.djait.k@gmail.com Signed-off-by: Jonathan Cameron commit 8abacef3b7fb6dd7054c0b327390ae8e1087f9e5 Author: Mehdi Djait Date: Sat Sep 16 14:38:49 2023 +0200 iio: accel: kionix-kx022a: Warn on failed matches and assume compatibility Avoid error returns on a failure to match and instead just warn with assumption that we have a correct dt-binding telling us that some new device with a different ID is backwards compatible. Acked-by: Matti Vaittinen Signed-off-by: Mehdi Djait Link: https://lore.kernel.org/r/b587cfec2f3350623277005f62121864bee857c7.1694867379.git.mehdi.djait.k@gmail.com Signed-off-by: Jonathan Cameron commit cfdb1e2875321bdda0a8f0246bcf1d3cbfdd0b09 Author: Mehdi Djait Date: Sat Sep 16 14:38:48 2023 +0200 iio: accel: kionix-kx022a: Remove blank lines Remove blank lines pointed out by the checkpatch script Reviewed-by: Andy Shevchenko Reviewed-by: Matti Vaittinen Signed-off-by: Mehdi Djait Link: https://lore.kernel.org/r/3489099f653491e97b13b8f19fe86635b03020c8.1694867379.git.mehdi.djait.k@gmail.com Signed-off-by: Jonathan Cameron commit 377dddbe53b941fdc4babbf177c47659de68eeef Author: Mehdi Djait Date: Sat Sep 16 14:38:47 2023 +0200 dt-bindings: iio: Add KX132-1211 accelerometer Extend the kionix,kx022a.yaml file to support the kx132-1211 device Acked-by: Krzysztof Kozlowski Acked-by: Matti Vaittinen Signed-off-by: Mehdi Djait Link: https://lore.kernel.org/r/735004c624082aead6e08ae37ea4fc086b11cf86.1694867379.git.mehdi.djait.k@gmail.com Signed-off-by: Jonathan Cameron commit 66fe531268f274310a052603fc298f6cc177489b Author: William Breathitt Gray Date: Sat Sep 16 07:20:31 2023 -0400 iio: addac: stx104: Add 8254 Counter/Timer support The STX104 features an 8254 Counter/Timer chip providing three counter/timers which can be used for frequency measurement, frequency output, pulse width modulation, pulse width measurement, event count, etc. The STX104 provides a register bank selection to bank select between the 8254 Bank and the Indexed Register Array Bank; the Indexed Register Array is not utilized by this driver, so the 8254 Bank is selected unconditionally. Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/20230916112031.3634-1-william.gray@linaro.org Signed-off-by: Jonathan Cameron commit a7705e54e1c895713a09e17bdcfaf507f80de3a0 Author: Jonathan Bergh Date: Thu Sep 14 22:07:33 2023 +0200 staging: vme_user: Fix various comment formatting issues including comment content Fixed various issues relating to comments including: * Lines with '*' in block comments which should be aligned and were not * Corrected comments where closing multiline comment identifier ran over into second newline spuriously * Corrected comment content to correctly reflect hexadecimal for the offsets rather than integers Signed-off-by: Jonathan Bergh Link: https://lore.kernel.org/r/20230914200732.47659-1-bergh.jonathan@gmail.com Signed-off-by: Greg Kroah-Hartman commit c887e0830b3af7d3d64a3d2ae3eccc2c8fcd99a8 Author: Jonathan Bergh Date: Thu Sep 14 22:05:37 2023 +0200 staging: vme_user: Remove spurious newlines between define statements Removed spurious newlines in define statements so that defines which should be grouped together for readability are grouped as such. Signed-off-by: Jonathan Bergh Link: https://lore.kernel.org/r/20230914200536.47619-1-bergh.jonathan@gmail.com Signed-off-by: Greg Kroah-Hartman commit ec2f16f180ae65b7c7179b4bb71af5fb2650f036 Author: Hans de Goede Date: Sat Sep 16 15:06:53 2023 +0200 x86/platform/uv: Rework NMI "action" modparam handling Rework NMI "action" modparam handling: - Replace the uv_nmi_action string with an enum; and - Use sysfs_match_string() for string parsing in param_set_action() No change in functionality intended. Suggested-by: Steve Wahl Signed-off-by: Hans de Goede Signed-off-by: Ingo Molnar Tested-by: Steve Wahl Reviewed-by: Justin Stitt Reviewed-by: Steve Wahl Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230916130653.243532-1-hdegoede@redhat.com commit 144100013266354b21220aa4e26d60de19bfc02b Author: Pavan Bobba Date: Wed Sep 13 17:23:12 2023 +0530 staging: vt6655: Type encoding info dropped from array name "byVT3253B0_" Array names starting with "byVT3253B0_" updated like below: a.type encoding info dropped from names b.camelcase names replaced by snakecase Issue found by checkpatch Signed-off-by: Pavan Bobba Link: https://lore.kernel.org/r/ZQGiqA2GoDp/WiPK@ubuntu.myguest.virtualbox.org Signed-off-by: Greg Kroah-Hartman commit dbe2fdafcc4649bf658bd157ddd416eb9e8567f7 Author: Jonathan Bergh Date: Sun Sep 3 17:06:23 2023 +0200 staging: vme_user: Remove unused (commented) code causing unnecessary checkpatch warning Removed unused/commented code from vme_fake.c which was causing spurious checkpatch warnings. Signed-off-by: Jonathan Bergh Link: https://lore.kernel.org/r/20230903150623.571984-1-bergh.jonathan@gmail.com Signed-off-by: Greg Kroah-Hartman commit b33a296d831189d8a8eedee360e889509b9c81e6 Author: Oliver Crumrine Date: Mon Aug 28 11:39:11 2023 -0400 staging: octeon: remove typedef in structs cvmx_pip_port_status_t and cvmx_pko_port_status_t Remove typedef in structs cvmx_pip_port_status_t and cvmx_pko_port_status_t, and rename all instances to cvmx_pip_port_status, and cvmx_pko_port_status, respectively Signed-off-by: Oliver Crumrine Link: https://lore.kernel.org/r/PH7PR11MB76434462A6563C5FBDEE51A8BCE0A@PH7PR11MB7643.namprd11.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 4fffe4733cfb08a4c08eca722a8eb819b842c043 Author: Oliver Crumrine Date: Mon Aug 28 11:39:10 2023 -0400 staging: octeon: remove typedef in enum cvmx_pko_status_t Remove typedef in enum cmvx_pko_status_t, and rename all instances to cvmx_pko_status Signed-off-by: Oliver Crumrine Link: https://lore.kernel.org/r/PH7PR11MB7643430B9516797F3870936FBCE0A@PH7PR11MB7643.namprd11.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 8d26aa90458f82b952dcaa64e7c4afed9c862d68 Author: Oliver Crumrine Date: Mon Aug 28 11:39:09 2023 -0400 staging: octeon: remove typedef in struct cvmx_pko_lock_t Remove typedef in struct cvmx_pko_lock_t, and rename all instances to cvmx_pko_lock Signed-off-by: Oliver Crumrine Link: https://lore.kernel.org/r/PH7PR11MB764333C6FB367FBF1C676B43BCE0A@PH7PR11MB7643.namprd11.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 28fae776c69bdac005fa77a7e0daa64725d0f4f8 Author: Oliver Crumrine Date: Mon Aug 28 11:39:08 2023 -0400 staging: octeon: remove typedef in enum cvmx_pow_wait_t Remove typedef in enum cvmx_pow_wait_t, and rename all instances to cvmx_pow_wait Signed-off-by: Oliver Crumrine Link: https://lore.kernel.org/r/PH7PR11MB7643299EE41E05AD6D736416BCE0A@PH7PR11MB7643.namprd11.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit a13f7e45823cd29af716ed6be1f53a344e0b9268 Author: Oliver Crumrine Date: Mon Aug 28 11:39:07 2023 -0400 staging: octeon: remove typedef in enum cvmx_helper_interface_mode_t Remove typedef in enum cvmx_helper_interface_mode_t, and rename all instances to cvmx_helper_interface_mode Signed-off-by: Oliver Crumrine Link: https://lore.kernel.org/r/PH7PR11MB7643DEB4401AA83A0578087CBCE0A@PH7PR11MB7643.namprd11.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 7bebd832177670e6cce1783cf144f989cd3cf4b5 Author: Oliver Crumrine Date: Mon Aug 28 11:39:06 2023 -0400 staging: octeon: remove typedef in enum cvmx_spi_mode_t Remove typedef in enum cvmx_spi_mode_t, and rename all instances to cvmx_spi_mode Signed-off-by: Oliver Crumrine Link: https://lore.kernel.org/r/PH7PR11MB764333BA75F5760600A4D08EBCE0A@PH7PR11MB7643.namprd11.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 3abba9a46c9d18b00e9aa52610ee5b07dfcd85e4 Author: Alexon Oliveira Date: Sun Aug 27 16:32:55 2023 -0300 staging: vme_user: fix check unnecessary space after a cast in vme_fake.c Fixed all CHECK: No space is necessary after a cast as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira Link: https://lore.kernel.org/r/603976b29ad4d9a0e4cbd8452ff674ec70a227a8.1693164540.git.alexondunkan@gmail.com Signed-off-by: Greg Kroah-Hartman commit 571fa9b51375eee059846c780dce05f04528b065 Author: Alexon Oliveira Date: Sun Aug 27 16:32:54 2023 -0300 staging: vme_user: fix check unnecessary blank lines in vme_fake.c Fixed all CHECK: Blank lines aren't necessary before a close brace '}' as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira Link: https://lore.kernel.org/r/dde6f13f92a7cb17e01aceaeabe790656078326e.1693164540.git.alexondunkan@gmail.com Signed-off-by: Greg Kroah-Hartman commit f6a90f103fb91c18720f8df33e92e6860db51afc Author: Alexon Oliveira Date: Sun Aug 27 16:32:52 2023 -0300 staging: vme_user: fix check lines not ending with '(' in vme_fake.c Fixed all CHECK: Lines should not end with a '(' as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira Link: https://lore.kernel.org/r/9f3e2facdc4d5e612dc00830c2da0fb19c20f2c5.1693164540.git.alexondunkan@gmail.com Signed-off-by: Greg Kroah-Hartman commit b25f7cb305b9bc6576edd3e4e256b16ce420be09 Author: Alexon Oliveira Date: Sun Aug 27 16:32:50 2023 -0300 staging: vme_user: fix check alignment of open parenthesis in vme_fake.c Fixed all CHECK: Alignment should match open parenthesis as reported by checkpatch to adhere to the Linux kernel coding-style guidelines. Signed-off-by: Alexon Oliveira Link: https://lore.kernel.org/r/639fc19f5c5bce6557a813728b28c299c5134ecf.1693164540.git.alexondunkan@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8e050848c7840f4553df3bbaf90510eeed8cb1dc Author: Philipp Hortmann Date: Fri Sep 15 18:09:57 2023 +0200 staging: rtl8192e: Replace frame control constants with IEEE80211_FCTL_* Replace frame control fields with IEEE80211_FCTL_* to avoid proprietary constant names. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/24d195f60ab9aa1d419c81b749c3d64dc8f643e3.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3f48cad5497a54830f9ce8666c1b7907041c25fc Author: Philipp Hortmann Date: Fri Sep 15 18:09:50 2023 +0200 staging: rtl8192e: Replace usage of RTLLIB_FCTL_DSTODS with function Replace usage of RTLLIB_FCTL_DSTODS with function ieee80211_has_a4() to avoid proprietary code and to increase readability. To achieve this goal it was required to change a parameter of function rtllib_rx_data_filter(). Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/69f72a352b8129bcc6610c1355a41d966abf24d8.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 87f8e11d5147992fe0b8c232e656be96f778408e Author: Philipp Hortmann Date: Fri Sep 15 18:09:42 2023 +0200 staging: rtl8192e: Replace control subframe types with IEEE80211_STYPE_* Replace control and data subframe types RTLLIB_STYPE_* with IEEE80211_STYPE_* to avoid proprietary constant names. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/970555ba76dcf3b9896c51aab8ff333a95f12225.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit c2f7ab521e981416d6c7aa63e0926f61563c8587 Author: Philipp Hortmann Date: Fri Sep 15 18:09:36 2023 +0200 staging: rtl8192e: Replace management subframe types with IEEE80211_STYPE_* Replace management subframe types RTLLIB_STYPE_* with IEEE80211_STYPE_* to avoid proprietary constant names. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/35ff2758b79f8dadb1d864f3f6d948a76179ad36.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 03622cc95b16860484a76cb28856c0f8d50896cd Author: Philipp Hortmann Date: Fri Sep 15 18:09:30 2023 +0200 staging: rtl8192e: Remove struct rtllib_pspoll_hdr Replace struct rtllib_pspoll_hdr with struct ieee80211_pspoll to avoid proprietary code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/a4bd004fcbba81f96fd09f5adec5f029e2de3d6d.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 56724b747af70fc179a9f72cdda777186e6f69c8 Author: Philipp Hortmann Date: Fri Sep 15 18:09:25 2023 +0200 staging: rtl8192e: Remove struct rtllib_hdr_4addrqos Replace struct rtllib_hdr_4addrqos with struct ieee80211_qos_hdr_4addr to avoid proprietary code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e146191ec1781a3989b318316fe9d8cdb330a52a.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit cefacff12095c19938a07a0514d65e0c41767b08 Author: Philipp Hortmann Date: Fri Sep 15 18:09:18 2023 +0200 staging: rtl8192e: Remove struct rtllib_hdr_3addrqos Replace struct rtllib_hdr_3addrqos with struct ieee80211_qos_hdr to avoid proprietary code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/f9c52f9822075476d491b2f1061af51a4b818f3a.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7e2ee215d133acca6d10c0e8d1c2920163c1db79 Author: Philipp Hortmann Date: Fri Sep 15 18:09:12 2023 +0200 staging: rtl8192e: Remove struct rtllib_hdr_4addr Replace struct rtllib_hdr_4addr with struct ieee80211_hdr to avoid proprietary code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/532a589e017bb6edefe60fc2ea402f541eb237ed.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4db8b4dd7b6f5fd69a6f89d2d915ad42735c0310 Author: Philipp Hortmann Date: Fri Sep 15 18:07:43 2023 +0200 staging: rtl8192e: Replace struct rtllib_hdr_4addr in rtllib_crypt*.c Replace struct rtllib_hdr_4addr with struct ieee80211_hdr to avoid proprietary code in rtllib_crypt_tkip.c and rtllib_crypt_ccmp.c. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/6bbbe6617e62fb9e04b4bc23f8bac6c31befcfa8.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1ba92da4c1fe14e776c1363a0b7ecf4e1ab35cbc Author: Philipp Hortmann Date: Fri Sep 15 18:07:36 2023 +0200 staging: rtl8192e: Remove unused struct rtllib_hdr and two enums Remove struct rtllib_hdr, enum rt_ps_mode and enum fw_cmd_io_type as those are not used. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/4bdb5e4d604eb3bd46c7853ad6d9a60f6208dd4a.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 71ddc43ed7c712b386adeb3a16a616fa3a9e52c8 Author: Philipp Hortmann Date: Fri Sep 15 18:07:30 2023 +0200 staging: rtl8192e: Replace struct rtllib_hdr_3addr in structs of rtllib.h Replace struct rtllib_hdr_3addr with struct ieee80211_hdr_3addr to avoid proprietary struct in structs of rtllib.h. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e327712027b022561759d7cadcf51bf8274ab05a.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit a8550ee79026925c627df5ca6228eaeade36af76 Author: Philipp Hortmann Date: Fri Sep 15 18:07:23 2023 +0200 staging: rtl8192e: Replace struct rtllib_hdr_3addr in r8192E_dev.c Replace struct rtllib_hdr_3addr with struct ieee80211_hdr_3addr to avoid proprietary struct in r8192E_dev.c, rtllib_tx.c and in functions of rtllib.h. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/8e5901c4ecb0961374610f627deb6a6ad9bc53df.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit ab4265999a6cf05db42fa674e3dd32e1f07e7ff5 Author: Philipp Hortmann Date: Fri Sep 15 18:07:03 2023 +0200 staging: rtl8192e: Replace struct rtllib_hdr_3addr in rtllib_softmac.c Replace struct rtllib_hdr_3addr with struct ieee80211_hdr_3addr to avoid proprietary struct. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/8e385d0810132086ce44d295c47d3798960a391b.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit e96d150d0de0bef651f93f1bcc275aa483b53da4 Author: Philipp Hortmann Date: Fri Sep 15 18:07:10 2023 +0200 staging: rtl8192e: Replace struct rtllib_hdr_3addr in rtl819x_BAProc.c Replace struct rtllib_hdr_3addr with struct ieee80211_hdr_3addr to avoid proprietary struct. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/aa6d81b6a8bc0f126d174ccbee25fd93d072fa59.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5db7df8e5f5600830d9f394cfbb41b5c6046952e Author: Philipp Hortmann Date: Fri Sep 15 18:06:54 2023 +0200 staging: rtl8192e: Replace struct rtllib_hdr_3addr in rtllib_rx.c Replace struct rtllib_hdr_3addr with struct ieee80211_hdr_3addr to avoid proprietary struct. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/4d5409433c681557f8187b13f0bbf124a662ff96.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2af6ed8d4ff1abf3137cba531ebb294c71692596 Author: Philipp Hortmann Date: Fri Sep 15 18:06:46 2023 +0200 staging: rtl8192e: Replace struct rtllib_hdr_1addr with ieee80211_hdr Replace struct rtllib_hdr_1addr with struct ieee80211_hdr to avoid proprietary struct. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/84aa25fec8e29199970df37b1671f0252d12374e.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 58806573a76b0e55fb0b5b8c323a948fb1540fd7 Author: Philipp Hortmann Date: Tue Sep 12 21:28:53 2023 +0200 staging: rtl8192e: Remove rtllib_get_payload() rtllib_process_action() is only called in one place with management frames. Frame is passed over to rtllib_get_payload() which passes it to rtllib_get_hdrlen(). In rtllib_get_hdrlen() all management frames return with hdrlen = RTLLIB_3ADDR_LEN. Therefore the switch in rtllib_get_payload() is useless and dead code. The condition act == NULL cannot occur and can also be removed. Then rtllib_hdr_2addr is not used anymore and can be removed as well. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/3ef288fb819f50da3eb9291522067babaa57f532.1694546301.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6c8bc47b67b862edb58b649611efef437c7ddb0a Author: Philipp Hortmann Date: Tue Sep 12 21:28:45 2023 +0200 staging: rtl8192e: Replace rtl92e_enable_irq with rtl92e_irq_enable Replace rtl92e_enable_irq with rtl92e_irq_enable to increase readability. priv->irq_enabled = 1 was set in both functions. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/6e8167402d279299e3ccf3468021abb0699d0e8e.1694546300.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0b20155f60159f7c20ab9d1b005c1d98a15c81cf Author: Philipp Hortmann Date: Tue Sep 12 21:28:37 2023 +0200 staging: rtl8192e: Replace rtl92e_disable_irq with rtl92e_irq_disable Replace rtl92e_disable_irq with rtl92e_irq_disable to increase readability. priv->irq_enabled = 0 was set in both functions. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/07c7312d1571e23ee382d47095931d68ba194551.1694546300.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit f59edab87e33b4863c3f19437d93671c74cbf06b Author: Philipp Hortmann Date: Tue Sep 12 21:28:31 2023 +0200 staging: rtl8192e: Use standard function in softmac_mgmt_xmit() Use standard function ieee80211_is_beacon() to avoid proprietary code to identify beacon and to increase readability in softmac_mgmt_xmit() and _rtl92e_translate_rx_signal_stats() Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/bd648e8e3c9c93c7944b72778ef7288973d8386e.1694546300.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit a00e00a20e5732811715fa78f3092fc7340301da Author: Philipp Hortmann Date: Tue Sep 12 21:28:25 2023 +0200 staging: rtl8192e: Use standard function in rtllib_rx_check_duplicate() Use standard function ieee80211_is_beacon() to avoid proprietary code and to increase readability. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/b74b6ef5e266504b9e3d84495bcd8fe4978b4ded.1694546300.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit dabd8585db95fa4c95d894ff2924e9bb4f1f308b Author: Philipp Hortmann Date: Tue Sep 12 21:28:18 2023 +0200 staging: rtl8192e: Use standard function in rtllib_process_probe_response() Replace proprietary is_beacon() with ieee80211_is_beacon() and proprietary "WLAN_FC_GET_STYPE(frame_ctl) == RTLLIB_STYPE_PROBE_RESP" with standard function to increase readability. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/ad24a52c045d6638103f4263b811c87d18cb3e97.1694546300.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 95862d083b08eaed4fb88da11494d4ae4acc447b Author: Philipp Hortmann Date: Tue Sep 12 21:28:11 2023 +0200 staging: rtl8192e: Use standard ieee80211 function in rtllib_rx_mgt() Replace WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)) and comparison with standard function to avoid proprietary code and to increase readability. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/26cb0a7758186090a618a134c21e237594bbc525.1694546300.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 19444ae97eedc786ce7ff60b205b1bbb2608541f Author: Philipp Hortmann Date: Tue Sep 12 21:28:05 2023 +0200 staging: rtl8192e: Remove useless equation in debug output When "switch (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)))" results in "case RTLLIB_STYPE_BEACON:" there is no need to calculate this again inside "case" and when a frame is a beacon there is no need to print the frame identifier again as it is explicit. Same for PROBE RESPONSE and PROBE REQUEST. Remove dead code. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/f3c8deddac66d11c41ba720e4048aba37e41e885.1694546300.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit b50d2a8c86bd5b2b0d6cd3926114c80862bc4c85 Author: Philipp Hortmann Date: Sun Aug 27 15:27:04 2023 +0200 staging: rtl8192e: Remove unsupported mode IW_MODE_ADHOC Remove unsupported mode IW_MODE_ADHOC because this mode is only partially coded in the driver. rtllib_rx_mgt() can only handle probe requests in IW_MODE_ADHOC and no authentication or association frames. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230827132704.GA12506@matrix-ESPRIMO-P710 Signed-off-by: Greg Kroah-Hartman commit a132b784db68b543fd2745973cd8b5edf8e9bde4 Author: Yang Jihong Date: Sat Sep 16 09:16:41 2023 +0000 perf test: Fix test-record-dummy-C0 failure for supported PERF_FORMAT_LOST feature kernel For kernel that supports PERF_FORMAT_LOST, attr->read_format has PERF_FORMAT_LOST bit. Update expected value of attr->read_format of test-record-dummy-C0 for this scenario. Before: # ./perf test 17 -vv 17: Setup struct perf_event_attr : --- start --- test child forked, pid 1609441 running './tests/attr/test-record-dummy-C0' 'PERF_TEST_ATTR=/tmp/tmpm3s60aji ./perf record -o /tmp/tmpm3s60aji/perf.data --no-bpf-event -e dummy -C 0 kill >/dev/null 2>&1' ret '1', expected '1' expected read_format=4, got 20 FAILED './tests/attr/test-record-dummy-C0' - match failure test child finished with -1 ---- end ---- Setup struct perf_event_attr: FAILED! After: # ./perf test 17 -vv 17: Setup struct perf_event_attr : --- start --- test child forked, pid 1609441 running './tests/attr/test-record-dummy-C0' 'PERF_TEST_ATTR=/tmp/tmppa9vxcb7 ./perf record -o /tmp/tmppa9vxcb7/perf.data --no-bpf-event -e dummy -C 0 kill >/dev/null 2>&1' ret '1', expected '1' test child finished with 0 ---- end ---- Setup struct perf_event_attr: Ok Reported-and-Tested-by: Namhyung Kim Signed-off-by: Yang Jihong Link: https://lore.kernel.org/r/20230916091641.776031-1-yangjihong1@huawei.com Signed-off-by: Namhyung Kim commit 12e94aee074ce1c5ffdb8f2246a8c4a095b6aa8a Author: Sebastian Reichel Date: Wed Sep 13 15:39:00 2023 +0200 power: supply: core: Don't export power_supply_notifier power_supply_notifier can be internal, since all users are going through power_supply_reg_notifier()/power_supply_unreg_notifier(). Link: https://lore.kernel.org/r/20230913133900.591637-1-sebastian.reichel@collabora.com Signed-off-by: Sebastian Reichel commit e39257cde7e8ceec6165f54b6e20c72e2862a0b1 Author: Konrad Dybcio Date: Sat Sep 16 02:31:59 2023 +0200 power: supply: mm8013: Add more properties While scanning the internet for MM8013 PDFs, I found one for a different IC from Mitsumi, MM8118 at [1]. It turned out however, that when you search through the PDF, the MM8118 text has an invsible text layer containing "MM8013" underneath.. With some elbow grease, I was able to confirm that most of the registers match between the two ICs. Based on that finding, introduce live battery voltage readout, hw-decided charge behavior readout and max current readout. Also, expand the existing POWER_SUPPLY_HEALTH reporting. [1] https://product.minebeamitsumi.com/en/product/category/ics/battery/fuel_gauge/parts/download/__icsFiles/afieldfile/2023/07/12/1_download_01_12.pdf Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230916-topic-mm8013_2-v1-1-02495e07fca0@linaro.org Signed-off-by: Sebastian Reichel commit ec6f1b4db95b7eedb3fe85f4f14e08fa0e9281c3 Merge: c4ab64e6da420 d2a93715bfb06 Author: Alexei Starovoitov Date: Sat Sep 16 09:34:23 2023 -0700 Merge branch 'exceptions-1-2' Kumar Kartikeya Dwivedi says: ==================== Exceptions - 1/2 This series implements the _first_ part of the runtime and verifier support needed to enable BPF exceptions. Exceptions thrown from programs are processed as an immediate exit from the program, which unwinds all the active stack frames until the main stack frame, and returns to the BPF program's caller. The ability to perform this unwinding safely allows the program to test conditions that are always true at runtime but which the verifier has no visibility into. Thus, it also reduces verification effort by safely terminating redundant paths that can be taken within a program. The patches to perform runtime resource cleanup during the frame-by-frame unwinding will be posted as a follow-up to this set. It must be noted that exceptions are not an error handling mechanism for unlikely runtime conditions, but a way to safely terminate the execution of a program in presence of conditions that should never occur at runtime. They are meant to serve higher-level primitives such as program assertions. The following kfuncs and macros are introduced: Assertion macros are also introduced, please see patch 13 for their documentation. /* Description * Throw a BPF exception from the program, immediately terminating its * execution and unwinding the stack. The supplied 'cookie' parameter * will be the return value of the program when an exception is thrown, * and the default exception callback is used. Otherwise, if an exception * callback is set using the '__exception_cb(callback)' declaration tag * on the main program, the 'cookie' parameter will be the callback's only * input argument. * * Thus, in case of default exception callback, 'cookie' is subjected to * constraints on the program's return value (as with R0 on exit). * Otherwise, the return value of the marked exception callback will be * subjected to the same checks. * * Note that throwing an exception with lingering resources (locks, * references, etc.) will lead to a verification error. * * Note that callbacks *cannot* call this helper. * Returns * Never. * Throws * An exception with the specified 'cookie' value. */ extern void bpf_throw(u64 cookie) __ksym; /* This macro must be used to mark the exception callback corresponding to the * main program. For example: * * int exception_cb(u64 cookie) { * return cookie; * } * * SEC("tc") * __exception_cb(exception_cb) * int main_prog(struct __sk_buff *ctx) { * ... * return TC_ACT_OK; * } * * Here, exception callback for the main program will be 'exception_cb'. Note * that this attribute can only be used once, and multiple exception callbacks * specified for the main program will lead to verification error. */ \#define __exception_cb(name) __attribute__((btf_decl_tag("exception_callback:" #name))) As such, a program can only install an exception handler once for the lifetime of a BPF program, and this handler cannot be changed at runtime. The purpose of the handler is to simply interpret the cookie value supplied by the bpf_throw call, and execute user-defined logic corresponding to it. The primary purpose of allowing a handler is to control the return value of the program. The default handler returns the cookie value passed to bpf_throw when an exception is thrown. Fixing the handler for the lifetime of the program eliminates tricky and expensive handling in case of runtime changes of the handler callback when programs begin to nest, where it becomes more complex to save and restore the active handler at runtime. This version of offline unwinding based BPF exceptions is truly zero overhead, with the exception of generation of a default callback which contains a few instructions to return a default return value (0) when no exception callback is supplied by the user. Callbacks are disallowed from throwing BPF exceptions for now, since such exceptions need to cross the callback helper boundary (and therefore must care about unwinding kernel state), however it is possible to lift this restriction in the future follow-up. Exceptions terminate propogating at program boundaries, hence both BPF_PROG_TYPE_EXT and tail call targets return to their caller context the return value of the exception callback, in the event that they throw an exception. Thus, exceptions do not cross extension or tail call boundary. However, this is mostly an implementation choice, and can be changed to suit more user-friendly semantics. Changelog: ---------- v2 -> v3 v2: https://lore.kernel.org/bpf/20230809114116.3216687-1-memxor@gmail.com * Add Dave's Acked-by. * Address all comments from Alexei. * Use bpf_is_subprog to check for main prog in bpf_stack_walker. * Drop accidental leftover hunk in libbpf patch. * Split libbpf patch's refactoring to aid review * Disable fentry/fexit in addition to freplace for exception cb. * Add selftests for fentry/fexit/freplace on exception cb and main prog. * Use btf_find_by_name_kind in bpf_find_exception_callback_insn_off (Martin) * Split KASAN patch into two to aid backporting (Andrey) * Move exception callback append step to bpf_object__reloacte (Andrii) * Ensure that the exception callback name is unique (Andrii) * Keep ASM implementation of assertion macros instead of C, as it does not achieve intended results for bpf_assert_range and other cases. v1 -> v2 v1: https://lore.kernel.org/bpf/20230713023232.1411523-1-memxor@gmail.com * Address all comments from Alexei. * Fix a few bugs and corner cases in the implementations found during testing. Also add new selftests for these cases. * Reinstate patch to consider ksym.end part of the program (but reworked to cover other corner cases). * Implement new style of tagging exception callbacks, add libbpf support for the new declaration tag. * Limit support to 64-bit integer types for assertion macros. The compiler ends up performing shifts or bitwise and operations when finally making use of the value, which defeats the purpose of the macro. On noalu32 mode, the shifts may also happen before use, hurting reliability. * Comprehensively test assertion macros and their side effects on the verifier state, register bounds, etc. * Fix a KASAN false positive warning. RFC v1 -> v1 RFC v1: https://lore.kernel.org/bpf/20230405004239.1375399-1-memxor@gmail.com * Completely rework the unwinding infrastructure to use offline unwinding support. * Remove the runtime exception state and program rewriting code. * Make bpf_set_exception_callback idempotent to avoid vexing synchronization and state clobbering issues in presence of program nesting. * Disable bpf_throw within callback functions, for now. * Allow bpf_throw in tail call programs and extension programs, removing limitations of rewrite based unwinding. * Expand selftests. ==================== Link: https://lore.kernel.org/r/20230912233214.1518551-1-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit d2a93715bfb0655a63bb1687f43f48eb2e61717b Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:14 2023 +0200 selftests/bpf: Add tests for BPF exceptions Add selftests to cover success and failure cases of API usage, runtime behavior and invariants that need to be maintained for implementation correctness. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-18-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit d6ea06803212d992cbab24466f491ee0178bf9e0 Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:13 2023 +0200 selftests/bpf: Add BPF assertion macros Add macros implementing an 'assert' statement primitive using macros, built on top of the BPF exceptions support introduced in previous patches. The bpf_assert_*_with variants allow supplying a value which can the be inspected within the exception handler to signify the assert statement that led to the program being terminated abruptly, or be returned by the default exception handler. Note that only 64-bit scalar values are supported with these assertion macros, as during testing I found other cases quite unreliable in presence of compiler shifts/manipulations extracting the value of the right width from registers scrubbing the verifier's bounds information and knowledge about the value in the register. Thus, it is easier to reliably support this feature with only the full register width, and support both signed and unsigned variants. The bpf_assert_range is interesting in particular, which clamps the value in the [begin, end] (both inclusive) range within verifier state, and emits a check for the same at runtime. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-17-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 7e2925f6723702bcfcfdf8f73d5e85f7514d4b9f Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:12 2023 +0200 libbpf: Add support for custom exception callbacks Add support to libbpf to append exception callbacks when loading a program. The exception callback is found by discovering the declaration tag 'exception_callback:' and finding the callback in the value of the tag. The process is done in two steps. First, for each main program, the bpf_object__sanitize_and_load_btf function finds and marks its corresponding exception callback as defined by the declaration tag on it. Second, bpf_object__reloc_code is modified to append the indicated exception callback at the end of the instruction iteration (since exception callback will never be appended in that loop, as it is not directly referenced). Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-16-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 6c918709bd30852258e66b3f566c9614e3f29e35 Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:11 2023 +0200 libbpf: Refactor bpf_object__reloc_code Refactor bpf_object__append_subprog_code out of bpf_object__reloc_code to be able to reuse it to append subprog related code for the exception callback to the main program. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-15-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 06d686f771ddc27a8554cd8f5b22e071040dc90e Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:10 2023 +0200 bpf: Fix kfunc callback register type handling The kfunc code to handle KF_ARG_PTR_TO_CALLBACK does not check the reg type before using reg->subprogno. This can accidently permit invalid pointers from being passed into callback helpers (e.g. silently from different paths). Likewise, reg->subprogno from the per-register type union may not be meaningful either. We need to reject any other type except PTR_TO_FUNC. Acked-by: Dave Marchevsky Fixes: 5d92ddc3de1b ("bpf: Add callback validation to kfunc verifier logic") Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-14-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit fd548e1a46185000191a89cae4be560e076ed6c7 Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:09 2023 +0200 bpf: Disallow fentry/fexit/freplace for exception callbacks During testing, it was discovered that extensions to exception callbacks had no checks, upon running a testcase, the kernel ended up running off the end of a program having final call as bpf_throw, and hitting int3 instructions. The reason is that while the default exception callback would have reset the stack frame to return back to the main program's caller, the replacing extension program will simply return back to bpf_throw, which will instead return back to the program and the program will continue execution, now in an undefined state where anything could happen. The way to support extensions to an exception callback would be to mark the BPF_PROG_TYPE_EXT main subprog as an exception_cb, and prevent it from calling bpf_throw. This would make the JIT produce a prologue that restores saved registers and reset the stack frame. But let's not do that until there is a concrete use case for this, and simply disallow this for now. Similar issues will exist for fentry and fexit cases, where trampoline saves data on the stack when invoking exception callback, which however will then end up resetting the stack frame, and on return, the fexit program will never will invoked as the return address points to the main program's caller in the kernel. Instead of additional complexity and back and forth between the two stacks to enable such a use case, simply forbid it. One key point here to note is that currently X86_TAIL_CALL_OFFSET didn't require any modifications, even though we emit instructions before the corresponding endbr64 instruction. This is because we ensure that a main subprog never serves as an exception callback, and therefore the exception callback (which will be a global subprog) can never serve as the tail call target, eliminating any discrepancies. However, once we support a BPF_PROG_TYPE_EXT to also act as an exception callback, it will end up requiring change to the tail call offset to account for the extra instructions. For simplicitly, tail calls could be disabled for such targets. Noting the above, it appears better to wait for a concrete use case before choosing to permit extension programs to replace exception callbacks. As a precaution, we disable fentry and fexit for exception callbacks as well. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-13-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 66d9111f3517f85ef2af0337ece02683ce0faf21 Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:08 2023 +0200 bpf: Detect IP == ksym.end as part of BPF program Now that bpf_throw kfunc is the first such call instruction that has noreturn semantics within the verifier, this also kicks in dead code elimination in unprecedented ways. For one, any instruction following a bpf_throw call will never be marked as seen. Moreover, if a callchain ends up throwing, any instructions after the call instruction to the eventually throwing subprog in callers will also never be marked as seen. The tempting way to fix this would be to emit extra 'int3' instructions which bump the jited_len of a program, and ensure that during runtime when a program throws, we can discover its boundaries even if the call instruction to bpf_throw (or to subprogs that always throw) is emitted as the final instruction in the program. An example of such a program would be this: do_something(): ... r0 = 0 exit foo(): r1 = 0 call bpf_throw r0 = 0 exit bar(cond): if r1 != 0 goto pc+2 call do_something exit call foo r0 = 0 // Never seen by verifier exit // main(ctx): r1 = ... call bar r0 = 0 exit Here, if we do end up throwing, the stacktrace would be the following: bpf_throw foo bar main In bar, the final instruction emitted will be the call to foo, as such, the return address will be the subsequent instruction (which the JIT emits as int3 on x86). This will end up lying outside the jited_len of the program, thus, when unwinding, we will fail to discover the return address as belonging to any program and end up in a panic due to the unreliable stack unwinding of BPF programs that we never expect. To remedy this case, make bpf_prog_ksym_find treat IP == ksym.end as part of the BPF program, so that is_bpf_text_address returns true when such a case occurs, and we are able to unwind reliably when the final instruction ends up being a call instruction. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-12-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit ec5290a178b787b2f8b21581fdadc919bd004e12 Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:07 2023 +0200 bpf: Prevent KASAN false positive with bpf_throw The KASAN stack instrumentation when CONFIG_KASAN_STACK is true poisons the stack of a function when it is entered and unpoisons it when leaving. However, in the case of bpf_throw, we will never return as we switch our stack frame to the BPF exception callback. Later, this discrepancy will lead to confusing KASAN splats when kernel resumes execution on return from the BPF program. Fix this by unpoisoning everything below the stack pointer of the BPF program, which should cover the range that would not be unpoisoned. An example splat is below: BUG: KASAN: stack-out-of-bounds in stack_trace_consume_entry+0x14e/0x170 Write of size 8 at addr ffffc900013af958 by task test_progs/227 CPU: 0 PID: 227 Comm: test_progs Not tainted 6.5.0-rc2-g43f1c6c9052a-dirty #26 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-2.fc39 04/01/2014 Call Trace: dump_stack_lvl+0x4a/0x80 print_report+0xcf/0x670 ? arch_stack_walk+0x79/0x100 kasan_report+0xda/0x110 ? stack_trace_consume_entry+0x14e/0x170 ? stack_trace_consume_entry+0x14e/0x170 ? __pfx_stack_trace_consume_entry+0x10/0x10 stack_trace_consume_entry+0x14e/0x170 ? __sys_bpf+0xf2e/0x41b0 arch_stack_walk+0x8b/0x100 ? __sys_bpf+0xf2e/0x41b0 ? bpf_prog_test_run_skb+0x341/0x1c70 ? bpf_prog_test_run_skb+0x341/0x1c70 stack_trace_save+0x9b/0xd0 ? __pfx_stack_trace_save+0x10/0x10 ? __kasan_slab_free+0x109/0x180 ? bpf_prog_test_run_skb+0x341/0x1c70 ? __sys_bpf+0xf2e/0x41b0 ? __x64_sys_bpf+0x78/0xc0 ? do_syscall_64+0x3c/0x90 ? entry_SYSCALL_64_after_hwframe+0x6e/0xd8 kasan_save_stack+0x33/0x60 ? kasan_save_stack+0x33/0x60 ? kasan_set_track+0x25/0x30 ? kasan_save_free_info+0x2b/0x50 ? __kasan_slab_free+0x109/0x180 ? kmem_cache_free+0x191/0x460 ? bpf_prog_test_run_skb+0x341/0x1c70 kasan_set_track+0x25/0x30 kasan_save_free_info+0x2b/0x50 __kasan_slab_free+0x109/0x180 kmem_cache_free+0x191/0x460 bpf_prog_test_run_skb+0x341/0x1c70 ? __pfx_bpf_prog_test_run_skb+0x10/0x10 ? __fget_light+0x51/0x220 __sys_bpf+0xf2e/0x41b0 ? __might_fault+0xa2/0x170 ? __pfx___sys_bpf+0x10/0x10 ? lock_release+0x1de/0x620 ? __might_fault+0xcd/0x170 ? __pfx_lock_release+0x10/0x10 ? __pfx_blkcg_maybe_throttle_current+0x10/0x10 __x64_sys_bpf+0x78/0xc0 ? syscall_enter_from_user_mode+0x20/0x50 do_syscall_64+0x3c/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 RIP: 0033:0x7f0fbb38880d Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 45 12 00 f7 d8 64 89 01 48 RSP: 002b:00007ffe13907de8 EFLAGS: 00000206 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007ffe13908708 RCX: 00007f0fbb38880d RDX: 0000000000000050 RSI: 00007ffe13907e20 RDI: 000000000000000a RBP: 00007ffe13907e00 R08: 0000000000000000 R09: 00007ffe13907e20 R10: 0000000000000064 R11: 0000000000000206 R12: 0000000000000003 R13: 0000000000000000 R14: 00007f0fbb532000 R15: 0000000000cfbd90 The buggy address belongs to stack of task test_progs/227 KASAN internal error: frame info validation failed; invalid marker: 0 The buggy address belongs to the virtual mapping at [ffffc900013a8000, ffffc900013b1000) created by: kernel_clone+0xcd/0x600 The buggy address belongs to the physical page: page:00000000b70f4332 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11418f flags: 0x2fffe0000000000(node=0|zone=2|lastcpupid=0x7fff) page_type: 0xffffffff() raw: 02fffe0000000000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffffc900013af800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc900013af880: 00 00 00 f1 f1 f1 f1 00 00 00 f3 f3 f3 f3 f3 00 >ffffc900013af900: 00 00 00 00 00 00 00 00 00 00 00 f1 00 00 00 00 ^ ffffc900013af980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc900013afa00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== Disabling lock debugging due to kernel taint Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Vincenzo Frascino Signed-off-by: Kumar Kartikeya Dwivedi Acked-by: Andrey Konovalov Link: https://lore.kernel.org/r/20230912233214.1518551-11-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 7ccb84f04cda1dd6f64f352e9795db308e9cdc0c Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:06 2023 +0200 mm: kasan: Declare kasan_unpoison_task_stack_below in kasan.h We require access to this kasan helper in BPF code in the next patch where we have to unpoison the task stack when we unwind and reset the stack frame from bpf_throw, and it never really unpoisons the poisoned stack slots on entry when compiler instrumentation is generated by CONFIG_KASAN_STACK and inline instrumentation is supported. Also, remove the declaration from mm/kasan/kasan.h as we put it in the header file kasan.h. Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Vincenzo Frascino Suggested-by: Andrey Konovalov Signed-off-by: Kumar Kartikeya Dwivedi Reviewed-by: Andrey Konovalov Link: https://lore.kernel.org/r/20230912233214.1518551-10-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit a923819fb2c5be029a69c0ca53239865c9bc05dd Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:05 2023 +0200 bpf: Treat first argument as return value for bpf_throw In case of the default exception callback, change the behavior of bpf_throw, where the passed cookie value is no longer ignored, but is instead the return value of the default exception callback. As such, we need to place restrictions on the value being passed into bpf_throw in such a case, only allowing those permitted by the check_return_code function. Thus, bpf_throw can now control the return value of the program from each call site without having the user install a custom exception callback just to override the return value when an exception is thrown. We also modify the hidden subprog instructions to now move BPF_REG_1 to BPF_REG_0, so as to set the return value before exit in the default callback. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-9-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit b62bf8a5e9110922f58f6ea8fe747e1759f49e61 Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:04 2023 +0200 bpf: Perform CFG walk for exception callback Since exception callbacks are not referenced using bpf_pseudo_func and bpf_pseudo_call instructions, check_cfg traversal will never explore instructions of the exception callback. Even after adding the subprog, the program will then fail with a 'unreachable insn' error. We thus need to begin walking from the start of the exception callback again in check_cfg after a complete CFG traversal finishes, so as to explore the CFG rooted at the exception callback. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-8-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit b9ae0c9dd0aca79bffc17be51c2dc148d1f72708 Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:03 2023 +0200 bpf: Add support for custom exception callbacks By default, the subprog generated by the verifier to handle a thrown exception hardcodes a return value of 0. To allow user-defined logic and modification of the return value when an exception is thrown, introduce the 'exception_callback:' declaration tag, which marks a callback as the default exception handler for the program. The format of the declaration tag is 'exception_callback:', where is the name of the exception callback. Each main program can be tagged using this BTF declaratiion tag to associate it with an exception callback. In case the tag is absent, the default callback is used. As such, the exception callback cannot be modified at runtime, only set during verification. Allowing modification of the callback for the current program execution at runtime leads to issues when the programs begin to nest, as any per-CPU state maintaing this information will have to be saved and restored. We don't want it to stay in bpf_prog_aux as this takes a global effect for all programs. An alternative solution is spilling the callback pointer at a known location on the program stack on entry, and then passing this location to bpf_throw as a parameter. However, since exceptions are geared more towards a use case where they are ideally never invoked, optimizing for this use case and adding to the complexity has diminishing returns. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-7-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit aaa619ebccb2b78b3c6d2c0cd72d206ee8fc0025 Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:02 2023 +0200 bpf: Refactor check_btf_func and split into two phases This patch splits the check_btf_info's check_btf_func check into two separate phases. The first phase sets up the BTF and prepares func_info, but does not perform any validation of required invariants for subprogs just yet. This is left to the second phase, which happens where check_btf_info executes currently, and performs the line_info and CO-RE relocation. The reason to perform this split is to obtain the userspace supplied func_info information before we perform the add_subprog call, where we would now require finding and adding subprogs that may not have a bpf_pseudo_call or bpf_pseudo_func instruction in the program. We require this as we want to enable userspace to supply exception callbacks that can override the default hidden subprogram generated by the verifier (which performs a hardcoded action). In such a case, the exception callback may never be referenced in an instruction, but will still be suitably annotated (by way of BTF declaration tags). For finding this exception callback, we would require the program's BTF information, and the supplied func_info information which maps BTF type IDs to subprograms. Since the exception callback won't actually be referenced through instructions, later checks in check_cfg and do_check_subprogs will not verify the subprog. This means that add_subprog needs to add them in the add_subprog_and_kfunc phase before we move forward, which is why the BTF and func_info are required at that point. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-6-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit f18b03fabaa9b7c80e80b72a621f481f0d706ae0 Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:01 2023 +0200 bpf: Implement BPF exceptions This patch implements BPF exceptions, and introduces a bpf_throw kfunc to allow programs to throw exceptions during their execution at runtime. A bpf_throw invocation is treated as an immediate termination of the program, returning back to its caller within the kernel, unwinding all stack frames. This allows the program to simplify its implementation, by testing for runtime conditions which the verifier has no visibility into, and assert that they are true. In case they are not, the program can simply throw an exception from the other branch. BPF exceptions are explicitly *NOT* an unlikely slowpath error handling primitive, and this objective has guided design choices of the implementation of the them within the kernel (with the bulk of the cost for unwinding the stack offloaded to the bpf_throw kfunc). The implementation of this mechanism requires use of add_hidden_subprog mechanism introduced in the previous patch, which generates a couple of instructions to move R1 to R0 and exit. The JIT then rewrites the prologue of this subprog to take the stack pointer and frame pointer as inputs and reset the stack frame, popping all callee-saved registers saved by the main subprog. The bpf_throw function then walks the stack at runtime, and invokes this exception subprog with the stack and frame pointers as parameters. Reviewers must take note that currently the main program is made to save all callee-saved registers on x86_64 during entry into the program. This is because we must do an equivalent of a lightweight context switch when unwinding the stack, therefore we need the callee-saved registers of the caller of the BPF program to be able to return with a sane state. Note that we have to additionally handle r12, even though it is not used by the program, because when throwing the exception the program makes an entry into the kernel which could clobber r12 after saving it on the stack. To be able to preserve the value we received on program entry, we push r12 and restore it from the generated subprogram when unwinding the stack. For now, bpf_throw invocation fails when lingering resources or locks exist in that path of the program. In a future followup, bpf_throw will be extended to perform frame-by-frame unwinding to release lingering resources for each stack frame, removing this limitation. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-5-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 335d1c5b545284d75ef96ee42e461eacefe865bb Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:32:00 2023 +0200 bpf: Implement support for adding hidden subprogs Introduce support in the verifier for generating a subprogram and include it as part of a BPF program dynamically after the do_check phase is complete. The first user will be the next patch which generates default exception callbacks if none are set for the program. The phase of invocation will be do_misc_fixups. Note that this is an internal verifier function, and should be used with instruction blocks which uphold the invariants stated in check_subprogs. Since these subprogs are always appended to the end of the instruction sequence of the program, it becomes relatively inexpensive to do the related adjustments to the subprog_info of the program. Only the fake exit subprogram is shifted forward, making room for our new subprog. This is useful to insert a new subprogram, get it JITed, and obtain its function pointer. The next patch will use this functionality to insert a default exception callback which will be invoked after unwinding the stack. Note that these added subprograms are invisible to userspace, and never reported in BPF_OBJ_GET_INFO_BY_ID etc. For now, only a single subprogram is supported, but more can be easily supported in the future. To this end, two function counts are introduced now, the existing func_cnt, and real_func_cnt, the latter including hidden programs. This allows us to conver the JIT code to use the real_func_cnt for management of resources while syscall path continues working with existing func_cnt. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-4-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit fd5d27b70188379bb441d404c29a0afb111e1753 Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:31:59 2023 +0200 arch/x86: Implement arch_bpf_stack_walk The plumbing for offline unwinding when we throw an exception in programs would require walking the stack, hence introduce a new arch_bpf_stack_walk function. This is provided when the JIT supports exceptions, i.e. bpf_jit_supports_exceptions is true. The arch-specific code is really minimal, hence it should be straightforward to extend this support to other architectures as well, as it reuses the logic of arch_stack_walk, but allowing access to unwind_state data. Once the stack pointer and frame pointer are known for the main subprog during the unwinding, we know the stack layout and location of any callee-saved registers which must be restored before we return back to the kernel. This handling will be added in the subsequent patches. Note that while we primarily unwind through BPF frames, which are effectively CONFIG_UNWINDER_FRAME_POINTER, we still need one of this or CONFIG_UNWINDER_ORC to be able to unwind through the bpf_throw frame from which we begin walking the stack. We also require both sp and bp (stack and frame pointers) from the unwind_state structure, which are only available when one of these two options are enabled. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-3-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit 9af27da6313c8f8c6a26c7ea3fe23d6b9664a3a8 Author: Kumar Kartikeya Dwivedi Date: Wed Sep 13 01:31:58 2023 +0200 bpf: Use bpf_is_subprog to check for subprogs We would like to know whether a bpf_prog corresponds to the main prog or one of the subprogs. The current JIT implementations simply check this using the func_idx in bpf_prog->aux->func_idx. When the index is 0, it belongs to the main program, otherwise it corresponds to some subprogram. This will also be necessary to halt exception propagation while walking the stack when an exception is thrown, so we add a simple helper function to check this, named bpf_is_subprog, and convert existing JIT implementations to also make use of it. Signed-off-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/r/20230912233214.1518551-2-memxor@gmail.com Signed-off-by: Alexei Starovoitov commit fff755e76e64f0274e4d40c8ff273e3bc0ffc8a2 Merge: 50675d84e3995 3868ab0f19258 Author: David S. Miller Date: Sat Sep 16 13:42:34 2023 +0100 Merge branch 'TCP_INFO-RTO' Aananth V says: ==================== tcp: new TCP_INFO stats for RTO events The 2023 SIGCOMM paper "Improving Network Availability with Protective ReRoute" has indicated Linux TCP's RTO-triggered txhash rehashing can effectively reduce application disruption during outages. To better measure the efficacy of this feature, this patch set adds three more detailed stats during RTO recovery and exports via TCP_INFO. Applications and monitoring systems can leverage this data to measure the network path diversity and end-to-end repair latency during network outages to improve their network infrastructure. Patch 1 fixes a bug in TFO SYNACK that we encountered while testing these new metrics. Patch 2 adds the new metrics to tcp_sock and tcp_info. v2: Addressed feedback from a check bot in patch 2 by removing the inline keyword from the tcp_update_rto_time and tcp_update_rto_stats functions. Changed a comment in include/net/tcp.h to fit under 80 words. ==================== Signed-off-by: David S. Miller commit 3868ab0f192581eff978501a05f3dc2e01541d77 Author: Aananth V Date: Thu Sep 14 14:36:21 2023 +0000 tcp: new TCP_INFO stats for RTO events The 2023 SIGCOMM paper "Improving Network Availability with Protective ReRoute" has indicated Linux TCP's RTO-triggered txhash rehashing can effectively reduce application disruption during outages. To better measure the efficacy of this feature, this patch adds three more detailed stats during RTO recovery and exports via TCP_INFO. Applications and monitoring systems can leverage this data to measure the network path diversity and end-to-end repair latency during network outages to improve their network infrastructure. The following counters are added to tcp_sock in order to track RTO events over the lifetime of a TCP socket. 1. u16 total_rto - Counts the total number of RTO timeouts. 2. u16 total_rto_recoveries - Counts the total number of RTO recoveries. 3. u32 total_rto_time - Counts the total time spent (ms) in RTO recoveries. (time spent in CA_Loss and CA_Recovery states) To compute total_rto_time, we add a new u32 rto_stamp field to tcp_sock. rto_stamp records the start timestamp (ms) of the last RTO recovery (CA_Loss). Corresponding fields are also added to the tcp_info struct. Signed-off-by: Aananth V Signed-off-by: Neal Cardwell Signed-off-by: Yuchung Cheng Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit e326578a21414738de45f77badd332fb00bd0f58 Author: Aananth V Date: Thu Sep 14 14:36:20 2023 +0000 tcp: call tcp_try_undo_recovery when an RTOd TFO SYNACK is ACKed For passive TCP Fast Open sockets that had SYN/ACK timeout and did not send more data in SYN_RECV, upon receiving the final ACK in 3WHS, the congestion state may awkwardly stay in CA_Loss mode unless the CA state was undone due to TCP timestamp checks. However, if tcp_rcv_synrecv_state_fastopen() decides not to undo, then we should enter CA_Open, because at that point we have received an ACK covering the retransmitted SYNACKs. Currently, the icsk_ca_state is only set to CA_Open after we receive an ACK for a data-packet. This is because tcp_ack does not call tcp_fastretrans_alert (and tcp_process_loss) if !prior_packets Note that tcp_process_loss() calls tcp_try_undo_recovery(), so having tcp_rcv_synrecv_state_fastopen() decide that if we're in CA_Loss we should call tcp_try_undo_recovery() is consistent with that, and low risk. Fixes: dad8cea7add9 ("tcp: fix TFO SYNACK undo to avoid double-timestamp-undo") Signed-off-by: Aananth V Signed-off-by: Neal Cardwell Signed-off-by: Yuchung Cheng Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 50675d84e3995f2606306b5e23e6847273a730e9 Merge: b6a7eeb44a6a8 d67d7247f641f Author: David S. Miller Date: Sat Sep 16 13:40:08 2023 +0100 Merge branch 'dsa-microchip-drive-strength-support' Oleksij Rempel says: ==================== net: dsa: microchip: add drive strength support changes v5: - rename milliamp to microamp - do not expect negative error code on snprintf - set coma after last struct element - rename found to have_any_prop changes v4: - integrate microchip feedback to the ksz9477_drive_strengths comment. - add Reviewed-by: Rob Herring changes v3: - yaml: use enum instead of min/max - do not use snprintf() on overlapping buffer. - unify ksz_drive_strength_to_reg() and ksz_drive_strength_error(). Make it usable for KSZ9477 and KSZ8830 variants. - use ksz_rmw8() in ksz9477_drive_strength_write() ==================== Signed-off-by: David S. Miller commit d67d7247f641fc9e9a8b08894444b5d9904cc44e Author: Oleksij Rempel Date: Thu Sep 14 09:51:07 2023 +0200 net: dsa: microchip: Add drive strength configuration Add device tree based drive strength configuration support. It is needed to pass EMI validation on our hardware. Configuration values are based on the vendor's reference driver. Tested on KSZ9563R. Signed-off-by: Oleksij Rempel Reviewed-by: Andrew Lunn Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit e26f40a60f17050040afcb8777f9aeac4f354a97 Author: Oleksij Rempel Date: Thu Sep 14 09:51:06 2023 +0200 dt-bindings: net: dsa: microchip: Update ksz device tree bindings for drive strength Extend device tree bindings to support drive strength configuration for the ksz* switches. Introduced properties: - microchip,hi-drive-strength-microamp: Controls the drive strength for high-speed interfaces like GMII/RGMII and more. - microchip,lo-drive-strength-microamp: Governs the drive strength for low-speed interfaces such as LEDs, PME_N, and others. - microchip,io-drive-strength-microamp: Controls the drive strength for for undocumented Pads on KSZ88xx variants. Signed-off-by: Oleksij Rempel Reviewed-by: Rob Herring Reviewed-by: Andrew Lunn Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit b6a7eeb44a6a8b1ea2dea78b5de448d86eb0bd96 Merge: 2fa6175d8b208 a251eee621337 Author: David S. Miller Date: Sat Sep 16 12:00:56 2023 +0100 Merge branch '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== Introduce Intel IDPF driver Pavan Kumar Linga says: This patch series introduces the Intel Infrastructure Data Path Function (IDPF) driver. It is used for both physical and virtual functions. Except for some of the device operations the rest of the functionality is the same for both PF and VF. IDPF uses virtchnl version2 opcodes and structures defined in the virtchnl2 header file which helps the driver to learn the capabilities and register offsets from the device Control Plane (CP) instead of assuming the default values. The format of the series follows the driver init flow to interface open. To start with, probe gets called and kicks off the driver initialization by spawning the 'vc_event_task' work queue which in turn calls the 'hard reset' function. As part of that, the mailbox is initialized which is used to send/receive the virtchnl messages to/from the CP. Once that is done, 'core init' kicks in which requests all the required global resources from the CP and spawns the 'init_task' work queue to create the vports. Based on the capability information received, the driver creates the said number of vports (one or many) where each vport is associated to a netdev. Also, each vport has its own resources such as queues, vectors etc. From there, rest of the netdev_ops and data path are added. IDPF implements both single queue which is traditional queueing model as well as split queue model. In split queue model, it uses separate queue for both completion descriptors and buffers which helps to implement out-of-order completions. It also helps to implement asymmetric queues, for example multiple RX completion queues can be processed by a single RX buffer queue and multiple TX buffer queues can be processed by a single TX completion queue. In single queue model, same queue is used for both descriptor completions as well as buffer completions. It also supports features such as generic checksum offload, generic receive offload (hardware GRO) etc. --- v7: Patch 2: * removed pci_[disable|enable]_pcie_error_reporting as they are dropped from the core Patch 4, 9: * used 'kasprintf' instead of 'snprintf' to avoid providing explicit character string size which also fixes "-Wformat-truncation" warnings Patch 14: * used 'ethtool_sprintf' instead of 'snprintf' to avoid providing explicit character string size which also fixes "-Wformat-truncation" warning * add string format argument to the 'ethtool_sprintf' to avoid warning on "-Wformat-security" v6: https://lore.kernel.org/netdev/20230825235954.894050-1-pavan.kumar.linga@intel.com/ Note: 'Acked-by' was only added to patches 1, 2, 12 and not to the other patches because of the changes in v6 Patch 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 15: * renamed 'reset_lock' to 'vport_ctrl_lock' to reflect the lock usage * to avoid defensive programming, used 'vport_ctrl_lock' for the user callbacks that access the 'vport' to prevent the hardware reset thread from releasing the 'vport', when the user callback is in progress * added some variables to netdev private structure to avoid vport access if possible from ethtool and ndo callbacks * moved 'mac_filter_list_lock' and MAC related flags to vport_config structure and refactored mac filter flow to handle asynchronous ndo mac filter callbacks * stop the queues before starting the reset flow to avoid TX hangs * removed 'sw_mutex' and 'stop_mutex' as they are not needed anymore * added missing clear bit in 'init_task' error path * renamed labels appropriately Patch 8: * replaced page_pool_put_page with page_pool_put_full_page * for the page pool max_len, used PAGE_SIZE Patch 10, 11, 13: * made use of the 'netif_txq_maybe_stop', '__netif_txq_completed_wake' helper macros Patch 13: * removed IDPF_HR_RESET_IN_PROG flag check in idpf_tx_singleq_start as it is defensive Patch 14: * removed max descriptor check as the core does that * removed unnecessary error messages * removed the stats that are common between the ones reported by ethtool and ip link * replaced snprintf with ethtool_sprintf * added a comment to explain the reason for the max queue check * as the netdev queues are set on alloc, there is no need to set them again on reset unless there is a queue change, so move the 'idpf_set_real_num_queues' to 'idpf_initiate_soft_reset' Patch 15: * reworded the 'configure SRIOV' in the commit message v5: https://lore.kernel.org/netdev/20230816004305.216136-1-anthony.l.nguyen@intel.com/ Most Patches: * wrapped line limit to 80 chars to those which don't effect readability Patch 12: * in skb_add_rx_frag, offset 'headlen' w.r.t page_offset when adding a frag to avoid adding the header again Patch 14: * added NULL check for 'rxq' when dereferencing it in page_pool_get_stats v4: https://lore.kernel.org/netdev/20230808003416.3805142-1-anthony.l.nguyen@intel.com/ Patch 1: * s/virtcnl/virtchnl * removed the kernel doc for the error code definitions that don't exist * reworded the summary part in the virtchnl2 header Patch 3: * don't set local variable to NULL on error * renamed sq_send_command_out label with err_unlock * don't use __GFP_ZERO in dma_alloc_coherent Patch 4: * introduced mailbox workqueue to process mailbox interrupts Patch 3, 4, 5, 6, 7, 8, 9, 11, 15: * removed unnecessary variable 0-init Patch 3, 5, 7, 8, 9, 15: * removed defensive programming checks wherever applicable * removed IDPF_CAP_FIELD_LAST as it can be treated as defensive programming Patch 3, 4, 5, 6, 7: * replaced IDPF_DFLT_MBX_BUF_SIZE with IDPF_CTLQ_MAX_BUF_LEN Patch 2 to 15: * add kernel-doc for idpf.h and idpf_txrx.h enums and structures Patch 4, 5, 15: * adjusted the destroy sequence of the workqueues as per the alloc sequence Patch 4, 5, 9, 15: * scrub unnecessary flags in 'idpf_flags' - IDPF_REMOVE_IN_PROG flag can take care of the cases where IDPF_REL_RES_IN_PROG is used, removed the later one - IDPF_REQ_[TX|RX]_SPLITQ are replaced with struct variables - IDPF_CANCEL_[SERVICE|STATS]_TASK are redundant as the work queue doesn't get rescheduled again after 'cancel_delayed_work_sync' - IDPF_HR_CORE_RESET is removed as there is no set_bit for this flag - IDPF_MB_INTR_TRIGGER is removed as it is not needed anymore with the mailbox workqueue implementation Patch 7 to 15: * replaced the custom buffer recycling code with page pool API * switched the header split buffer allocations from using a bunch of pages to using one large chunk of DMA memory * reordered some of the flows in vport_open to support page pool Patch 8, 12: * don't suppress the alloc errors by using __GFP_NOWARN Patch 9: * removed dyn_ctl_clrpba_m as it is not being used Patch 14: * introduced enum idpf_vport_reset_cause instead of using vport flags * introduced page pool stats v3: https://lore.kernel.org/netdev/20230616231341.2885622-1-anthony.l.nguyen@intel.com/ Patch 5: * instead of void, used 'struct virtchnl2_create_vport' type for vport_params_recvd and vport_params_reqd and removed the typecasting * used u16/u32 as needed instead of int for variables which cannot be negative and updated in all the places whereever applicable Patch 6: * changed the commit message to "add ptypes and MAC filter support" * used the sender Signed-off-by as the last tag on all the patches * removed unnecessary variables 0-init * instead of fixing the code in this commit, fixed it in the commit where the change was introduced first * moved get_type_info struct on to the stack instead of memory alloc * moved mutex_lock and ptype_info memory alloc outside while loop and adjusted the return flow * used 'break' instead of 'continue' in ptype id switch case v2: https://lore.kernel.org/netdev/20230614171428.1504179-1-anthony.l.nguyen@intel.com/ Patch 2: * added "Intel(R)" to the DRV_SUMMARY and Makefile. Patch 4, 5, 6, 15: * replaced IDPF_VC_MSG_PENDING flag with mutex 'vc_buf_lock' for the adapter related virtchnl opcodes. * get the mutex lock in the virtchnl send thread itself instead of in receive thread. Patch 5, 6, 7, 8, 9, 11, 14, 15: * replaced IDPF_VPORT_VC_MSG_PENDING flag with mutex 'vc_buf_lock' for the vport related virtchnl opcodes. * get the mutex lock in the virtchnl send thread itself instead of in receive thread. Patch 6: * converted get_ptype_info logic from 1:N to 1:1 message exchange for better handling of mutex lock. Patch 15: * introduced 'stats_lock' spinlock to avoid concurrent stats update. v1: https://lore.kernel.org/netdev/20230530234501.2680230-1-anthony.l.nguyen@intel.com/ ==================== Signed-off-by: David S. Miller commit 2fa6175d8b2088345caae07151fa87b94e0986e8 Merge: 487e1937b9c06 d301c66b35b46 Author: David S. Miller Date: Sat Sep 16 11:46:14 2023 +0100 Merge branch 'loongson1-mac' Keguang Zhang says: ==================== Move Loongson1 MAC arch-code to the driver dir In order to convert Loongson1 MAC platform devices to the devicetree nodes, Loongson1 MAC arch-code should be moved to the driver dir. Add dt-binding document and update MAINTAINERS file accordingly. In other words, this patchset is a preparation for converting Loongson1 platform devices to devicetree. Changelog V4 -> V5: Replace stmmac_probe_config_dt() with devm_stmmac_probe_config_dt() Replace stmmac_pltfr_probe() with devm_stmmac_pltfr_probe() Squash patch 4 into patch 2 and 3 V3 -> V4: Add Acked-by tag from Krzysztof Kozlowski Add "|" to description part Amend "phy-mode" property Drop ls1x_dwmac_syscon definition and its instances Drop three redundant fields from the ls1x_dwmac structure Drop the ls1x_dwmac_init() method. Update the dt-binding document entry of Loongson1 Ethernet Some minor improvements V2 -> V3: Split the DT-schema file into loongson,ls1b-gmac.yaml and loongson,ls1c-emac.yaml (suggested by Serge Semin) Change the compatibles to loongson,ls1b-gmac and loongson,ls1c-emac Rename loongson,dwmac-syscon to loongson,ls1-syscon Amend the title Add description Add Reviewed-by tag from Krzysztof Kozlowski Change compatibles back to loongson,ls1b-syscon and loongson,ls1c-syscon Determine the device ID by physical base address(suggested by Serge Semin) Use regmap instead of regmap fields Use syscon_regmap_lookup_by_phandle() Some minor fixes Update the entries of MAINTAINERS V1 -> V2: Leave the Ethernet platform data for now Make the syscon compatibles more specific Fix "clock-names" and "interrupt-names" property Rename the syscon property to "loongson,dwmac-syscon" Drop "phy-handle" and "phy-mode" requirement Revert adding loongson,ls1b-dwmac/loongson,ls1c-dwmac to snps,dwmac.yaml Fix the build errors due to CONFIG_OF being unset Change struct reg_field definitions to const Rename the syscon property to "loongson,dwmac-syscon" Add MII PHY mode for LS1C Improve the commit message ==================== Signed-off-by: David S. Miller commit d301c66b35b469d5f6e48f6a7c115ba135d18a14 Author: Keguang Zhang Date: Thu Sep 14 19:44:35 2023 +0800 net: stmmac: Add glue layer for Loongson-1 SoC This glue driver is created based on the arch-code implemented earlier with the platform-specific settings. Use syscon for SYSCON register access. And modify MAINTAINERS to add a new F: entry for this driver. Partially based on the previous work by Serge Semin. Signed-off-by: Keguang Zhang Reviewed-by: Serge Semin Signed-off-by: David S. Miller commit 2af21077fa9f8aa7b2418bd3bb835d337d1caeab Author: Keguang Zhang Date: Thu Sep 14 19:44:34 2023 +0800 dt-bindings: net: Add Loongson-1 Ethernet Controller Add devicetree binding document for Loongson-1 Ethernet controller. And modify MAINTAINERS to add a new F: entry for Loongson1 dt-binding documents. Signed-off-by: Keguang Zhang Reviewed-by: Krzysztof Kozlowski Reviewed-by: Serge Semin Signed-off-by: David S. Miller commit 7e10088bc4e458493688a7aee08998479f541628 Author: Keguang Zhang Date: Thu Sep 14 19:44:33 2023 +0800 dt-bindings: mfd: syscon: Add compatibles for Loongson-1 syscon Add Loongson LS1B and LS1C compatibles for system controller. Signed-off-by: Keguang Zhang Acked-by: Krzysztof Kozlowski Reviewed-by: Serge Semin Signed-off-by: David S. Miller commit 487e1937b9c06b02a0577da6044694b4aaafc19b Author: Alex Austin Date: Thu Sep 14 16:19:16 2023 +0100 sfc: make coding style of PTP addresses consistent with core Follow the style used in the core kernel (e.g. include/linux/etherdevice.h and include/linux/in6.h) for the PTP IPv6 and Ethernet addresses. No functional changes. Signed-off-by: Alex Austin Reviewed-by: Edward Cree Signed-off-by: David S. Miller commit 01b38de18d06af5e6a703ed2fb8677c376cafc91 Author: Lorenzo Bianconi Date: Wed Sep 13 20:42:47 2023 +0200 net: ethernet: mtk_wed: do not assume offload callbacks are always set Check if wlan.offload_enable and wlan.offload_disable callbacks are set in mtk_wed_flow_add/mtk_wed_flow_remove since mt7996 will not rely on them. Signed-off-by: Lorenzo Bianconi Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit c123e0d30bdb54a0f91ec348827eef76877165d8 Author: Eric Dumazet Date: Wed Sep 13 13:48:41 2023 +0000 net: add truesize debug checks in skb_{add|coalesce}_rx_frag() It can be time consuming to track driver bugs, that might be detected too late from this confusing warning in skb_try_coalesce() WARN_ON_ONCE(delta < len); Add sanity check in skb_add_rx_frag() and skb_coalesce_rx_frag() to better track bug origin for CONFIG_DEBUG_NET=y builds. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 41862d12e77f78b4ecb59b028bf44de92991bda2 Author: Eric Dumazet Date: Wed Sep 13 12:58:35 2023 +0000 net: use indirect call helpers for sk->sk_prot->release_cb() When adding sk->sk_prot->release_cb() call from __sk_flush_backlog() Paolo suggested using indirect call helpers to take care of CONFIG_RETPOLINE=y case. It turns out Google had such mitigation for years in release_sock(), it is time to make this public :) Suggested-by: Paolo Abeni Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 1b27978d69670282a1586465de640cff363a34d8 Author: Ira Weiny Date: Wed May 17 14:28:11 2023 -0700 cxl/pci: Update comment The existence of struct cxl_dev_id containing a single member is odd. The comment made sense when I wrote it but could be clarified. Update the comment and place it next to the odd looking structure. Signed-off-by: Ira Weiny Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Link: https://lore.kernel.org/r/20230426-cxl-fixes-v1-2-870c4c8b463a@intel.com Signed-off-by: Dan Williams commit 7914992b37d5a4b165e65a32a7723afde9356720 Author: Dan Williams Date: Thu Sep 14 20:29:52 2023 -0700 cxl/port: Quiet warning messages from the cxl_test environment The cxl_test platform device CXL port hierarchy is useful for testing, but throws warning messages of the form: cxl_mem mem2: at cxl_root_port.1 no parent for dport: platform cxl_mem mem3: at cxl_root_port.2 no parent for dport: platform cxl_mem mem4: at cxl_root_port.3 no parent for dport: platform cxl_mem mem5: at cxl_root_port.0 no parent for dport: platform cxl_mem mem6: at cxl_root_port.1 no parent for dport: platform cxl_mem mem7: at cxl_root_port.2 no parent for dport: platform cxl_mem mem8: at cxl_root_port.3 no parent for dport: platform cxl_mem mem9: at cxl_root_port.4 no parent for dport: platform cxl_mem mem10: at cxl_root_port.4 no parent for dport: platform ...and this message when running testing in QEMU: cxl_region region4: Bypassing cpu_cache_invalidate_memregion() for testing! Noisy cxl_test warnings have caused other regressions to be missed. In the interest of using cxl_test for early detection of dev_err() and dev_warn() messages, silence platform device topology and cache-invalidation messages. Signed-off-by: Dan Williams commit 2de8ee9f58fa51f707c71f8fbcd8470ab0078102 Author: Gaurav Kohli Date: Fri Sep 15 20:03:04 2023 +0530 arm64: dts: qcom: msm8916: Fix iommu local address range Fix the apps iommu local address space range as per data sheet. Fixes: 6a6729f38436 ("arm64: dts: qcom: msm8916: Add IOMMU support") Reviewed-by: Bryan O'Donoghue Tested-by: Bryan O'Donoghue Signed-off-by: Gaurav Kohli Reviewed-by: Stephan Gerhold Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230915143304.477-1-quic_gkohli@quicinc.com Signed-off-by: Bjorn Andersson commit d74612b6da61aeb32e81bcf762b8be4e3c41bda5 Author: Bjorn Andersson Date: Fri Sep 15 15:50:14 2023 -0700 firmware: qcom: qseecom: Add missing AUXILIARY_BUS dependency The newly introduced QSEECOM driver fail to link if the system is built without CONFIG_AUXILIARY_BUS, make sure it is selected. Fixes: 00b1248606ba ("firmware: qcom_scm: Add support for Qualcomm Secure Execution Environment SCM interface") Reported-by: Randy Dunlap Closes: https://lore.kernel.org/r/9f156fa6-e5aa-4cb2-ab2b-b67fd8fc4840%40infradead.org Signed-off-by: Bjorn Andersson Acked-by: Randy Dunlap Tested-by: Randy Dunlap Link: https://lore.kernel.org/r/20230915-qseecom-auxiliary-fix-v1-1-38a46cfbfdb0@quicinc.com Signed-off-by: Bjorn Andersson commit c4ab64e6da42030c866f0589d1bfc13a037432dd Merge: 9b2b86332a9b9 9b31b4f1d4ae3 Author: Alexei Starovoitov Date: Fri Sep 15 17:11:47 2023 -0700 Merge branch 'arm32-bpf-add-support-for-cpuv4-insns' Puranjay Mohan says: ==================== arm32, bpf: add support for cpuv4 insns Changes in V2 -> V3 - Added comments at places where there could be confustion. - In the patch for DIV64, fix the if-else case that would never run. - In the same patch use a single instruction to POP caller saved regs. - Add a patch to change maintainership of ARM32 BPF JIT. Changes in V1 -> V2: - Fix coding style issues. - Don't use tmp variable for src in emit_ldsx_r() as it is redundant. - Optimize emit_ldsx_r() when offset can fit in immediate. Add the support for cpuv4 instructions for ARM32 BPF JIT. 64-bit division was not supported earlier so this series adds 64-bit DIV, SDIV, MOD, SMOD instructions as well. This series needs any one of the patches from [1] to disable zero-extension for BPF_MEMSX to support ldsx. The relevant selftests have passed expect ldsx_insn which needs fentry: Tested on BeagleBone Black (ARMv7-A): [root@alarm del]# echo 1 > /proc/sys/net/core/bpf_jit_enable [root@alarm del]# ./test_progs -a verifier_sdiv,verifier_movsx,verifier_ldsx,verifier_gotol,verifier_bswap #337/1 verifier_bswap/BSWAP, 16:OK #337/2 verifier_bswap/BSWAP, 16 @unpriv:OK #337/3 verifier_bswap/BSWAP, 32:OK #337/4 verifier_bswap/BSWAP, 32 @unpriv:OK #337/5 verifier_bswap/BSWAP, 64:OK #337/6 verifier_bswap/BSWAP, 64 @unpriv:OK #337 verifier_bswap:OK #351/1 verifier_gotol/gotol, small_imm:OK #351/2 verifier_gotol/gotol, small_imm @unpriv:OK #351 verifier_gotol:OK #359/1 verifier_ldsx/LDSX, S8:OK #359/2 verifier_ldsx/LDSX, S8 @unpriv:OK #359/3 verifier_ldsx/LDSX, S16:OK #359/4 verifier_ldsx/LDSX, S16 @unpriv:OK #359/5 verifier_ldsx/LDSX, S32:OK #359/6 verifier_ldsx/LDSX, S32 @unpriv:OK #359/7 verifier_ldsx/LDSX, S8 range checking, privileged:OK #359/8 verifier_ldsx/LDSX, S16 range checking:OK #359/9 verifier_ldsx/LDSX, S16 range checking @unpriv:OK #359/10 verifier_ldsx/LDSX, S32 range checking:OK #359/11 verifier_ldsx/LDSX, S32 range checking @unpriv:OK #359 verifier_ldsx:OK #370/1 verifier_movsx/MOV32SX, S8:OK #370/2 verifier_movsx/MOV32SX, S8 @unpriv:OK #370/3 verifier_movsx/MOV32SX, S16:OK #370/4 verifier_movsx/MOV32SX, S16 @unpriv:OK #370/5 verifier_movsx/MOV64SX, S8:OK #370/6 verifier_movsx/MOV64SX, S8 @unpriv:OK #370/7 verifier_movsx/MOV64SX, S16:OK #370/8 verifier_movsx/MOV64SX, S16 @unpriv:OK #370/9 verifier_movsx/MOV64SX, S32:OK #370/10 verifier_movsx/MOV64SX, S32 @unpriv:OK #370/11 verifier_movsx/MOV32SX, S8, range_check:OK #370/12 verifier_movsx/MOV32SX, S8, range_check @unpriv:OK #370/13 verifier_movsx/MOV32SX, S16, range_check:OK #370/14 verifier_movsx/MOV32SX, S16, range_check @unpriv:OK #370/15 verifier_movsx/MOV32SX, S16, range_check 2:OK #370/16 verifier_movsx/MOV32SX, S16, range_check 2 @unpriv:OK #370/17 verifier_movsx/MOV64SX, S8, range_check:OK #370/18 verifier_movsx/MOV64SX, S8, range_check @unpriv:OK #370/19 verifier_movsx/MOV64SX, S16, range_check:OK #370/20 verifier_movsx/MOV64SX, S16, range_check @unpriv:OK #370/21 verifier_movsx/MOV64SX, S32, range_check:OK #370/22 verifier_movsx/MOV64SX, S32, range_check @unpriv:OK #370/23 verifier_movsx/MOV64SX, S16, R10 Sign Extension:OK #370/24 verifier_movsx/MOV64SX, S16, R10 Sign Extension @unpriv:OK #370 verifier_movsx:OK #382/1 verifier_sdiv/SDIV32, non-zero imm divisor, check 1:OK #382/2 verifier_sdiv/SDIV32, non-zero imm divisor, check 1 @unpriv:OK #382/3 verifier_sdiv/SDIV32, non-zero imm divisor, check 2:OK #382/4 verifier_sdiv/SDIV32, non-zero imm divisor, check 2 @unpriv:OK #382/5 verifier_sdiv/SDIV32, non-zero imm divisor, check 3:OK #382/6 verifier_sdiv/SDIV32, non-zero imm divisor, check 3 @unpriv:OK #382/7 verifier_sdiv/SDIV32, non-zero imm divisor, check 4:OK #382/8 verifier_sdiv/SDIV32, non-zero imm divisor, check 4 @unpriv:OK #382/9 verifier_sdiv/SDIV32, non-zero imm divisor, check 5:OK #382/10 verifier_sdiv/SDIV32, non-zero imm divisor, check 5 @unpriv:OK #382/11 verifier_sdiv/SDIV32, non-zero imm divisor, check 6:OK #382/12 verifier_sdiv/SDIV32, non-zero imm divisor, check 6 @unpriv:OK #382/13 verifier_sdiv/SDIV32, non-zero imm divisor, check 7:OK #382/14 verifier_sdiv/SDIV32, non-zero imm divisor, check 7 @unpriv:OK #382/15 verifier_sdiv/SDIV32, non-zero imm divisor, check 8:OK #382/16 verifier_sdiv/SDIV32, non-zero imm divisor, check 8 @unpriv:OK #382/17 verifier_sdiv/SDIV32, non-zero reg divisor, check 1:OK #382/18 verifier_sdiv/SDIV32, non-zero reg divisor, check 1 @unpriv:OK #382/19 verifier_sdiv/SDIV32, non-zero reg divisor, check 2:OK #382/20 verifier_sdiv/SDIV32, non-zero reg divisor, check 2 @unpriv:OK #382/21 verifier_sdiv/SDIV32, non-zero reg divisor, check 3:OK #382/22 verifier_sdiv/SDIV32, non-zero reg divisor, check 3 @unpriv:OK #382/23 verifier_sdiv/SDIV32, non-zero reg divisor, check 4:OK #382/24 verifier_sdiv/SDIV32, non-zero reg divisor, check 4 @unpriv:OK #382/25 verifier_sdiv/SDIV32, non-zero reg divisor, check 5:OK #382/26 verifier_sdiv/SDIV32, non-zero reg divisor, check 5 @unpriv:OK #382/27 verifier_sdiv/SDIV32, non-zero reg divisor, check 6:OK #382/28 verifier_sdiv/SDIV32, non-zero reg divisor, check 6 @unpriv:OK #382/29 verifier_sdiv/SDIV32, non-zero reg divisor, check 7:OK #382/30 verifier_sdiv/SDIV32, non-zero reg divisor, check 7 @unpriv:OK #382/31 verifier_sdiv/SDIV32, non-zero reg divisor, check 8:OK #382/32 verifier_sdiv/SDIV32, non-zero reg divisor, check 8 @unpriv:OK #382/33 verifier_sdiv/SDIV64, non-zero imm divisor, check 1:OK #382/34 verifier_sdiv/SDIV64, non-zero imm divisor, check 1 @unpriv:OK #382/35 verifier_sdiv/SDIV64, non-zero imm divisor, check 2:OK #382/36 verifier_sdiv/SDIV64, non-zero imm divisor, check 2 @unpriv:OK #382/37 verifier_sdiv/SDIV64, non-zero imm divisor, check 3:OK #382/38 verifier_sdiv/SDIV64, non-zero imm divisor, check 3 @unpriv:OK #382/39 verifier_sdiv/SDIV64, non-zero imm divisor, check 4:OK #382/40 verifier_sdiv/SDIV64, non-zero imm divisor, check 4 @unpriv:OK #382/41 verifier_sdiv/SDIV64, non-zero imm divisor, check 5:OK #382/42 verifier_sdiv/SDIV64, non-zero imm divisor, check 5 @unpriv:OK #382/43 verifier_sdiv/SDIV64, non-zero imm divisor, check 6:OK #382/44 verifier_sdiv/SDIV64, non-zero imm divisor, check 6 @unpriv:OK #382/45 verifier_sdiv/SDIV64, non-zero reg divisor, check 1:OK #382/46 verifier_sdiv/SDIV64, non-zero reg divisor, check 1 @unpriv:OK #382/47 verifier_sdiv/SDIV64, non-zero reg divisor, check 2:OK #382/48 verifier_sdiv/SDIV64, non-zero reg divisor, check 2 @unpriv:OK #382/49 verifier_sdiv/SDIV64, non-zero reg divisor, check 3:OK #382/50 verifier_sdiv/SDIV64, non-zero reg divisor, check 3 @unpriv:OK #382/51 verifier_sdiv/SDIV64, non-zero reg divisor, check 4:OK #382/52 verifier_sdiv/SDIV64, non-zero reg divisor, check 4 @unpriv:OK #382/53 verifier_sdiv/SDIV64, non-zero reg divisor, check 5:OK #382/54 verifier_sdiv/SDIV64, non-zero reg divisor, check 5 @unpriv:OK #382/55 verifier_sdiv/SDIV64, non-zero reg divisor, check 6:OK #382/56 verifier_sdiv/SDIV64, non-zero reg divisor, check 6 @unpriv:OK #382/57 verifier_sdiv/SMOD32, non-zero imm divisor, check 1:OK #382/58 verifier_sdiv/SMOD32, non-zero imm divisor, check 1 @unpriv:OK #382/59 verifier_sdiv/SMOD32, non-zero imm divisor, check 2:OK #382/60 verifier_sdiv/SMOD32, non-zero imm divisor, check 2 @unpriv:OK #382/61 verifier_sdiv/SMOD32, non-zero imm divisor, check 3:OK #382/62 verifier_sdiv/SMOD32, non-zero imm divisor, check 3 @unpriv:OK #382/63 verifier_sdiv/SMOD32, non-zero imm divisor, check 4:OK #382/64 verifier_sdiv/SMOD32, non-zero imm divisor, check 4 @unpriv:OK #382/65 verifier_sdiv/SMOD32, non-zero imm divisor, check 5:OK #382/66 verifier_sdiv/SMOD32, non-zero imm divisor, check 5 @unpriv:OK #382/67 verifier_sdiv/SMOD32, non-zero imm divisor, check 6:OK #382/68 verifier_sdiv/SMOD32, non-zero imm divisor, check 6 @unpriv:OK #382/69 verifier_sdiv/SMOD32, non-zero reg divisor, check 1:OK #382/70 verifier_sdiv/SMOD32, non-zero reg divisor, check 1 @unpriv:OK #382/71 verifier_sdiv/SMOD32, non-zero reg divisor, check 2:OK #382/72 verifier_sdiv/SMOD32, non-zero reg divisor, check 2 @unpriv:OK #382/73 verifier_sdiv/SMOD32, non-zero reg divisor, check 3:OK #382/74 verifier_sdiv/SMOD32, non-zero reg divisor, check 3 @unpriv:OK #382/75 verifier_sdiv/SMOD32, non-zero reg divisor, check 4:OK #382/76 verifier_sdiv/SMOD32, non-zero reg divisor, check 4 @unpriv:OK #382/77 verifier_sdiv/SMOD32, non-zero reg divisor, check 5:OK #382/78 verifier_sdiv/SMOD32, non-zero reg divisor, check 5 @unpriv:OK #382/79 verifier_sdiv/SMOD32, non-zero reg divisor, check 6:OK #382/80 verifier_sdiv/SMOD32, non-zero reg divisor, check 6 @unpriv:OK #382/81 verifier_sdiv/SMOD64, non-zero imm divisor, check 1:OK #382/82 verifier_sdiv/SMOD64, non-zero imm divisor, check 1 @unpriv:OK #382/83 verifier_sdiv/SMOD64, non-zero imm divisor, check 2:OK #382/84 verifier_sdiv/SMOD64, non-zero imm divisor, check 2 @unpriv:OK #382/85 verifier_sdiv/SMOD64, non-zero imm divisor, check 3:OK #382/86 verifier_sdiv/SMOD64, non-zero imm divisor, check 3 @unpriv:OK #382/87 verifier_sdiv/SMOD64, non-zero imm divisor, check 4:OK #382/88 verifier_sdiv/SMOD64, non-zero imm divisor, check 4 @unpriv:OK #382/89 verifier_sdiv/SMOD64, non-zero imm divisor, check 5:OK #382/90 verifier_sdiv/SMOD64, non-zero imm divisor, check 5 @unpriv:OK #382/91 verifier_sdiv/SMOD64, non-zero imm divisor, check 6:OK #382/92 verifier_sdiv/SMOD64, non-zero imm divisor, check 6 @unpriv:OK #382/93 verifier_sdiv/SMOD64, non-zero imm divisor, check 7:OK #382/94 verifier_sdiv/SMOD64, non-zero imm divisor, check 7 @unpriv:OK #382/95 verifier_sdiv/SMOD64, non-zero imm divisor, check 8:OK #382/96 verifier_sdiv/SMOD64, non-zero imm divisor, check 8 @unpriv:OK #382/97 verifier_sdiv/SMOD64, non-zero reg divisor, check 1:OK #382/98 verifier_sdiv/SMOD64, non-zero reg divisor, check 1 @unpriv:OK #382/99 verifier_sdiv/SMOD64, non-zero reg divisor, check 2:OK #382/100 verifier_sdiv/SMOD64, non-zero reg divisor, check 2 @unpriv:OK #382/101 verifier_sdiv/SMOD64, non-zero reg divisor, check 3:OK #382/102 verifier_sdiv/SMOD64, non-zero reg divisor, check 3 @unpriv:OK #382/103 verifier_sdiv/SMOD64, non-zero reg divisor, check 4:OK #382/104 verifier_sdiv/SMOD64, non-zero reg divisor, check 4 @unpriv:OK #382/105 verifier_sdiv/SMOD64, non-zero reg divisor, check 5:OK #382/106 verifier_sdiv/SMOD64, non-zero reg divisor, check 5 @unpriv:OK #382/107 verifier_sdiv/SMOD64, non-zero reg divisor, check 6:OK #382/108 verifier_sdiv/SMOD64, non-zero reg divisor, check 6 @unpriv:OK #382/109 verifier_sdiv/SMOD64, non-zero reg divisor, check 7:OK #382/110 verifier_sdiv/SMOD64, non-zero reg divisor, check 7 @unpriv:OK #382/111 verifier_sdiv/SMOD64, non-zero reg divisor, check 8:OK #382/112 verifier_sdiv/SMOD64, non-zero reg divisor, check 8 @unpriv:OK #382/113 verifier_sdiv/SDIV32, zero divisor:OK #382/114 verifier_sdiv/SDIV32, zero divisor @unpriv:OK #382/115 verifier_sdiv/SDIV64, zero divisor:OK #382/116 verifier_sdiv/SDIV64, zero divisor @unpriv:OK #382/117 verifier_sdiv/SMOD32, zero divisor:OK #382/118 verifier_sdiv/SMOD32, zero divisor @unpriv:OK #382/119 verifier_sdiv/SMOD64, zero divisor:OK #382/120 verifier_sdiv/SMOD64, zero divisor @unpriv:OK #382 verifier_sdiv:OK Summary: 5/163 PASSED, 0 SKIPPED, 0 FAILED As the selftests don't compile for 32-bit architectures without modifications due to long being 32-bit, I have added new tests to lib/test_bpf.c for cpuv4 insns, all are passing: test_bpf: Summary: 1052 PASSED, 0 FAILED, [891/1040 JIT'ed] test_bpf: test_tail_calls: Summary: 10 PASSED, 0 FAILED, [10/10 JIT'ed] test_bpf: test_skb_segment: Summary: 2 PASSED, 0 FAILED [1] https://lore.kernel.org/all/mb61p5y4u3ptd.fsf@amazon.com/ ==================== Link: https://lore.kernel.org/r/20230907230550.1417590-1-puranjay12@gmail.com Signed-off-by: Alexei Starovoitov commit 9b31b4f1d4ae30627e9a75967e974c766f80e92f Author: Puranjay Mohan Date: Thu Sep 7 23:05:50 2023 +0000 MAINTAINERS: Add myself for ARM32 BPF JIT maintainer. As Shubham has been inactive since 2017, Add myself for ARM32 BPF JIT. Signed-off-by: Puranjay Mohan Link: https://lore.kernel.org/r/20230907230550.1417590-10-puranjay12@gmail.com Signed-off-by: Alexei Starovoitov commit daabb2b098e04753fa3d1b1feed13e5a61bef61c Author: Puranjay Mohan Date: Thu Sep 7 23:05:49 2023 +0000 bpf/tests: add tests for cpuv4 instructions The BPF JITs now support cpuv4 instructions. Add tests for these new instructions to the test suite: 1. Sign extended Load 2. Sign extended Mov 3. Unconditional byte swap 4. Unconditional jump with 32-bit offset 5. Signed division and modulo Signed-off-by: Puranjay Mohan Link: https://lore.kernel.org/r/20230907230550.1417590-9-puranjay12@gmail.com Signed-off-by: Alexei Starovoitov commit 59ff6d63b7307be4dbfbecceea9aedca047c7ffe Author: Puranjay Mohan Date: Thu Sep 7 23:05:48 2023 +0000 selftest, bpf: enable cpu v4 tests for arm32 Now that all the cpuv4 instructions are supported by the arm32 JIT, enable the selftests for arm32. Signed-off-by: Puranjay Mohan Link: https://lore.kernel.org/r/20230907230550.1417590-8-puranjay12@gmail.com Signed-off-by: Alexei Starovoitov commit 71086041c2ba04aa436a4b2283c708345e72a0bb Author: Puranjay Mohan Date: Thu Sep 7 23:05:47 2023 +0000 arm32, bpf: add support for 64 bit division instruction ARM32 doesn't have instructions to do 64-bit/64-bit divisions. So, to implement the following instructions: BPF_ALU64 | BPF_DIV BPF_ALU64 | BPF_MOD BPF_ALU64 | BPF_SDIV BPF_ALU64 | BPF_SMOD We implement the above instructions by doing function calls to div64_u64() and div64_u64_rem() for unsigned division/mod and calls to div64_s64() for signed division/mod. Signed-off-by: Puranjay Mohan Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20230907230550.1417590-7-puranjay12@gmail.com Signed-off-by: Alexei Starovoitov commit 5097faa559a6097de436bdff4027d036b5493d1a Author: Puranjay Mohan Date: Thu Sep 7 23:05:46 2023 +0000 arm32, bpf: add support for 32-bit signed division The cpuv4 added a new BPF_SDIV instruction that does signed division. The encoding is similar to BPF_DIV but BPF_SDIV sets offset=1. ARM32 already supports 32-bit BPF_DIV which can be easily extended to support BPF_SDIV as ARM32 has the SDIV instruction. When the CPU is not ARM-v7, we implement that SDIV/SMOD with the function call similar to the implementation of DIV/MOD. Signed-off-by: Puranjay Mohan Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20230907230550.1417590-6-puranjay12@gmail.com Signed-off-by: Alexei Starovoitov commit 1cfb7eaebeac9270fcb527f47bbdea34ca3cd5b2 Author: Puranjay Mohan Date: Thu Sep 7 23:05:45 2023 +0000 arm32, bpf: add support for unconditional bswap instruction The cpuv4 added a new unconditional bswap instruction with following behaviour: BPF_ALU64 | BPF_TO_LE | BPF_END with imm = 16/32/64 means: dst = bswap16(dst) dst = bswap32(dst) dst = bswap64(dst) As we already support converting to big-endian from little-endian we can use the same for unconditional bswap. just treat the unconditional scenario the same as big-endian conversion. Signed-off-by: Puranjay Mohan Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20230907230550.1417590-5-puranjay12@gmail.com Signed-off-by: Alexei Starovoitov commit fc832653fa0dba174bf8fee9db85f3f9d1450b8a Author: Puranjay Mohan Date: Thu Sep 7 23:05:44 2023 +0000 arm32, bpf: add support for sign-extension mov instruction The cpuv4 added a new BPF_MOVSX instruction that sign extends the src before moving it to the destination. BPF_ALU | BPF_MOVSX sign extends 8-bit and 16-bit operands into 32-bit operands, and zeroes the remaining upper 32 bits. BPF_ALU64 | BPF_MOVSX sign extends 8-bit, 16-bit, and 32-bit operands into 64-bit operands. The offset field of the instruction is used to tell the number of bit to use for sign-extension. BPF_MOV and BPF_MOVSX have the same code but the former sets offset to 0 and the later one sets the offset to 8, 16 or 32 The behaviour of this instruction is dst = (s8,s16,s32)src On ARM32 the implementation uses LSH and ARSH to extend the 8/16 bits to a 32-bit register and then it is sign extended to the upper 32-bit register using ARSH. For 32-bit we just move it to the destination register and use ARSH to extend it to the upper 32-bit register. Signed-off-by: Puranjay Mohan Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20230907230550.1417590-4-puranjay12@gmail.com Signed-off-by: Alexei Starovoitov commit f9e6981b1f1ce5e954e4e9b82e6d3e564d4a3254 Author: Puranjay Mohan Date: Thu Sep 7 23:05:43 2023 +0000 arm32, bpf: add support for sign-extension load instruction The cpuv4 added the support of an instruction that is similar to load but also sign-extends the result after the load. BPF_MEMSX | | BPF_LDX means dst = *(signed size *) (src + offset) here can be one of BPF_B, BPF_H, BPF_W. ARM32 has instructions to load a byte or a half word with sign extension into a 32bit register. As the JIT uses two 32 bit registers to simulate a 64-bit BPF register, an extra instruction is emitted to sign-extent the result up to the second register. Signed-off-by: Puranjay Mohan Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20230907230550.1417590-3-puranjay12@gmail.com Signed-off-by: Alexei Starovoitov commit 471f3d4ee4a6db5c8621bb1c186a1d20a0639630 Author: Puranjay Mohan Date: Thu Sep 7 23:05:42 2023 +0000 arm32, bpf: add support for 32-bit offset jmp instruction The cpuv4 adds unconditional jump with 32-bit offset where the immediate field of the instruction is to be used to calculate the jump offset. BPF_JA | BPF_K | BPF_JMP32 => gotol +imm => PC += imm. Signed-off-by: Puranjay Mohan Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20230907230550.1417590-2-puranjay12@gmail.com Signed-off-by: Alexei Starovoitov commit 79df8365e37d38a84d9a15cc2f6386f5587e211a Author: Colin Ian King Date: Fri Sep 15 10:09:10 2023 +0100 perf kwork: Fix spelling mistake "COMMMAND" -> "COMMAND" There is a spelling mistake in a literal string. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Ian Rogers Cc: kernel-janitors@vger.kernel.org Link: https://lore.kernel.org/r/20230915090910.30182-1-colin.i.king@gmail.com Signed-off-by: Namhyung Kim commit 486021e04b24f8dffe54ec282ce5d4cc3e71133f Author: Namhyung Kim Date: Thu Sep 7 22:22:16 2023 -0700 perf annotate: Add more x86 mov instruction cases Instructions with sign- and zero- extention like movsbl and movzwq were not handled properly. As it can check different size suffix (-b, -w, -l or -q) we can omit that and add the common parts even though some combinations are not possible. Reviewed-by: Ian Rogers Link: https://lore.kernel.org/r/20230908052216.566148-1-namhyung@kernel.org Signed-off-by: Namhyung Kim commit 70360fad919b06100748764eb82fa399a9f37e1c Author: James Clark Date: Wed Sep 13 16:33:50 2023 +0100 perf pmu: Remove unused function pmu_events_table__find() is no longer used so remove it and its Arm specific version. Signed-off-by: James Clark Reviewed-by: Ian Rogers Reviewed-by: John Garry Cc: Ravi Bangoria Cc: Eduard Zingerman Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Jing Zhang Cc: Haixin Yu Cc: Kan Liang Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230913153355.138331-4-james.clark@arm.com Signed-off-by: Namhyung Kim commit 105e5b433e5c743bcdb4956b00b772dfddbee455 Author: James Clark Date: Wed Sep 13 16:33:49 2023 +0100 perf pmus: Simplify perf_pmus__find_core_pmu() Currently the while loop always either exits on the first iteration with a core PMU, or exits with NULL on heterogeneous systems or when not all CPUs are online. Both of the latter behaviors are undesirable for platforms other than Arm so simplify it to always return the first core PMU, or NULL if none exist. This behavior was depended on by the Arm version of pmu_metrics_table__find(), so the logic has been moved there instead. Signed-off-by: James Clark Suggested-by: Ian Rogers Reviewed-by: Ian Rogers Reviewed-by: John Garry Cc: Ravi Bangoria Cc: Eduard Zingerman Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Jing Zhang Cc: Haixin Yu Cc: Kan Liang Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230913153355.138331-3-james.clark@arm.com Signed-off-by: Namhyung Kim commit 3d0f5f456a5786573ba6a3358178c8db580e4b85 Author: James Clark Date: Wed Sep 13 16:33:48 2023 +0100 perf pmu: Move pmu__find_core_pmu() to pmus.c pmu__find_core_pmu() more logically belongs in pmus.c because it iterates over all PMUs, so move it to pmus.c At the same time rename it to perf_pmus__find_core_pmu() to match the naming convention in this file. list_prepare_entry() can't be used in perf_pmus__scan_core() anymore now that it's called from the same compilation unit. This is with -O2 (specifically -O1 -ftree-vrp -finline-functions -finline-small-functions) which allow the bounds of the array access to be determined at compile time. list_prepare_entry() subtracts the offset of the 'list' member in struct perf_pmu from &core_pmus, which isn't a struct perf_pmu. The compiler sees that pmu results in &core_pmus - 8 and refuses to compile. At runtime this works because list_for_each_entry_continue() always adds the offset back again before dereferencing ->next, but it's technically undefined behavior. With -fsanitize=undefined an additional warning is generated. Using list_first_entry_or_null() to get the first entry here avoids doing &core_pmus - 8 but has the same result and fixes both the compile warning and the undefined behavior warning. There are other uses of list_prepare_entry() in pmus.c, but the compiler doesn't seem to be able to see that they can also be called with &core_pmus, so I won't change any at this time. Signed-off-by: James Clark Reviewed-by: Ian Rogers Reviewed-by: John Garry Cc: Ravi Bangoria Cc: Eduard Zingerman Cc: Will Deacon Cc: Leo Yan Cc: Mike Leach Cc: Jing Zhang Cc: Haixin Yu Cc: Kan Liang Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230913153355.138331-2-james.clark@arm.com Signed-off-by: Namhyung Kim commit 21ce931e55c19c1f74378b4836d9dae631da0e62 Author: Ian Rogers Date: Wed Sep 13 21:42:32 2023 -0700 perf symbol: Avoid an undefined behavior warning The node (nd) may be NULL and pointer arithmetic on NULL is undefined behavior. Move the computation of next below the NULL check on the node. Signed-off-by: Ian Rogers Cc: James Clark Link: https://lore.kernel.org/r/20230914044233.1550195-1-irogers@google.com Signed-off-by: Namhyung Kim commit 9dc098e3d7297ec895436a799f5faf27d430674c Author: Colin Ian King Date: Fri Sep 15 10:26:39 2023 +0100 ASoC: cs42l43: make const array controls static Don't populate the const array controls on the stack, instead make it static. Signed-off-by: Colin Ian King Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230915092639.31074-1-colin.i.king@gmail.com Signed-off-by: Mark Brown commit 24af0d7c0f9f49a243b77e607e3f4a4737386b59 Author: Arun T Date: Fri Sep 15 16:06:35 2023 +0800 ASoC: Intel: common: add ACPI matching tables for Arrow Lake Initial support for ARL w/ RT711 Signed-off-by: Arun T Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915080635.1619942-1-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 33f9b528de0aa485a9b99a26cdf2e846ad9e6fd9 Merge: e81a600d42bba 26dfc43461102 Author: Mark Brown Date: Fri Sep 15 21:16:37 2023 +0100 ASoC: SOF: ipc4: Fixup dailink format based on copier Merge series from Peter Ujfalusi : If the copier supports a single format on the DAI side we should fixup the BE dailink to use this single format. commit f8d7a3d21160a0cab4d15b81231f2a76b0fcee13 Author: Nikita Travkin Date: Fri Sep 15 10:01:21 2023 +0500 power: supply: Add driver for pm8916 lbc pm8916 LBC is a Linear Battery Charger hardware block in pm8916 PMIC. This block implements simple CC/CV charging for Li-Po batteries. The hardware has internal state machine to switch between modes and works mostly autonomously, only needing the limits and targets to be set to operate. This driver allows setting limits and enabling the LBC block, monitoring it's state. Signed-off-by: Nikita Travkin Link: https://lore.kernel.org/r/20230915-pm8916-bms-lbc-v3-4-f30881e951a0@trvn.ru Signed-off-by: Sebastian Reichel commit 098bce1838e0549228c8d426e5de72ec5594b5c4 Author: Nikita Travkin Date: Fri Sep 15 10:01:20 2023 +0500 power: supply: Add pm8916 VM-BMS support This driver adds basic support for VM-BMS found in pm8916. VM-BMS is a very basic fuel-gauge hardware block that is, sadly, incapable of any gauging. The hardware supports measuring OCV in sleep mode, where the battery is not in use, or measuring average voltage over time when the device is active. This driver implements basic value readout from this block. Signed-off-by: Nikita Travkin Link: https://lore.kernel.org/r/20230915-pm8916-bms-lbc-v3-3-f30881e951a0@trvn.ru Signed-off-by: Sebastian Reichel commit 5cee843d56072135c0d4be4a2d8a20df05155009 Author: Nikita Travkin Date: Fri Sep 15 10:01:19 2023 +0500 dt-bindings: power: supply: Add pm8916 LBC Qualcomm Linear Battery Charger is a CC/CV charger block in PM8916 PMIC. Document it's DT binding. Signed-off-by: Nikita Travkin Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230915-pm8916-bms-lbc-v3-2-f30881e951a0@trvn.ru Signed-off-by: Sebastian Reichel commit 7f590e38317657123fed828d267372a3d6f93260 Author: Nikita Travkin Date: Fri Sep 15 10:01:18 2023 +0500 dt-bindings: power: supply: Add pm8916 VM-BMS Qualcomm Voltage Mode BMS is a battery monitoring block in PM8916 PMIC. Document it's DT binding. Signed-off-by: Nikita Travkin Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230915-pm8916-bms-lbc-v3-1-f30881e951a0@trvn.ru Signed-off-by: Sebastian Reichel commit 58e4aacb746321d8692996f40a1dcfb9e8b34c23 Author: Vincent Whitchurch Date: Fri Sep 15 09:02:14 2023 +0200 power: supply: Propagate of_node to child device Ensure that the dynamically created power supply device sets its ->of_node if the driver supplies one. This brings it in line with several other subsystems (see git grep 'of_node =.*parent.*of_node') and allows easier identification of the device from udev rules and similar. Before this patch: /sys/class/power_supply# ls -l bq256xx-battery/of_node ls: cannot access 'bq256xx-battery/of_node': No such file or directory # ls -l bq256xx-battery/hwmon1/of_node ls: cannot access 'bq256xx-battery/hwmon1/of_node': No such file or directory After: /sys/class/power_supply# ls -l bq256xx-battery/of_node lrwxrwxrwx 1 root root 0 May 17 09:14 bq256xx-battery/of_node -> ../../../../../../../../firmware/devicetree/base/virtio@1/i2c/bq25619@09 # ls -l bq256xx-battery/hwmon1/of_node lrwxrwxrwx 1 root root 0 May 17 09:14 bq256xx-battery/hwmon1/of_node -> ../../../../../../../../../firmware/devicetree/base/virtio@1/i2c/bq25619@09 Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20230915-power-of-v2-1-ca54c441867e@axis.com Signed-off-by: Sebastian Reichel commit c75f4bf6800bde67df22ac95139279ec8764118a Author: Konrad Dybcio Date: Fri Sep 15 14:45:17 2023 +0200 power: supply: Introduce MM8013 fuel gauge driver Add a driver for the Mitsumi MM8013 fuel gauge. The driver is a vastly cleaned up and improved version of the one that shipped in some obscure Lenovo downstream kernel [1], with some register definitions borrowed from ChromeOS EC platform code [2]. [1] https://github.com/adazem009/kernel_lenovo_bengal/commit/b6b346427a871715709bd22aae449b9383f3b66b [2] https://chromium.googlesource.com/chromiumos/platform/ec/+/master/driver/battery/mm8013.h Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230621-topic-mm8013-v4-3-975aecd173ed@linaro.org Signed-off-by: Sebastian Reichel commit 9d15ff53398b4b21198ee6dec4f65a251de881dc Author: Konrad Dybcio Date: Fri Sep 15 14:45:16 2023 +0200 dt-bindings: power: supply: Document Mitsumi MM8013 fuel gauge The Mitsumi MM8013 is an I2C fuel gauge for Li-Ion cells. The partial datasheet is available at [1]. Add bindings for this chip. [1] https://www.mitsumi.co.jp/latest-M/Catalog/pdf/battery_mm_8013_e.pdf Reviewed-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230621-topic-mm8013-v4-2-975aecd173ed@linaro.org Signed-off-by: Sebastian Reichel commit dc2dc941730438250a5c6567b8685f065ce1dd0f Author: Konrad Dybcio Date: Fri Sep 15 14:45:15 2023 +0200 dt-bindings: vendor-prefixes: Add Mitsumi Electric Co., Ltd. Mitsumi was [1] a Japanese company making various electronics devices and components. They've merged into a new entity, MinebeaMitsumi in 2017. Their current main page is available at [2] [1] https://en.wikipedia.org/wiki/Mitsumi_Electric [2] https://product.minebeamitsumi.com/en/ Acked-by: Krzysztof Kozlowski Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230621-topic-mm8013-v4-1-975aecd173ed@linaro.org Signed-off-by: Sebastian Reichel commit 32e4fa37fa667fdf53499b9de92737dc75199d8e Author: Olaf Hering Date: Mon Sep 4 14:13:50 2023 +0200 cpu/hotplug: Remove unused cpuhp_state CPUHP_AP_X86_VDSO_VMA_ONLINE Commit b2e2ba578e01 ("x86/vdso: Initialize the CPU/node NR segment descriptor earlier") removed the single user of this constant. Remove it to reduce the size of cpuhp_hp_states[]. Signed-off-by: Olaf Hering Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230904121350.18055-1-olaf@aepfle.de commit 9b2b86332a9b9932d9022a0c004251d5d6437020 Author: Larysa Zaremba Date: Fri Sep 15 10:39:10 2023 +0200 bpf: Allow to use kfunc XDP hints and frags together There is no fundamental reason, why multi-buffer XDP and XDP kfunc RX hints cannot coexist in a single program. Allow those features to be used together by modifying the flags condition for dev-bound-only programs, segments are still prohibited for fully offloaded programs, hence additional check. Suggested-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/CAKH8qBuzgtJj=OKMdsxEkyML36VsAuZpcrsXcyqjdKXSJCBq=Q@mail.gmail.com/ Reviewed-by: Maciej Fijalkowski Signed-off-by: Larysa Zaremba Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20230915083914.65538-1-larysa.zaremba@intel.com Signed-off-by: Martin KaFai Lau commit 45ee73a0722b9e1d0b7a524d06756291b13b5912 Merge: d609f3d228a8e 0c6c9b105ee90 Author: Martin KaFai Lau Date: Fri Sep 15 09:18:10 2023 -0700 Merge branch 'bpf: expose information about netdev xdp-metadata kfunc support' Stanislav Fomichev says: ==================== Extend netdev netlink family to expose the bitmask with the kfuncs that the device implements. The source of truth is the device's xdp_metadata_ops. There is some amount of auto-generated netlink boilerplate; the change itself is super minimal. v2: - add netdev->xdp_metadata_ops NULL check when dumping to netlink (Martin) Cc: netdev@vger.kernel.org Cc: Willem de Bruijn ==================== Signed-off-by: Martin KaFai Lau commit 0c6c9b105ee90d7415dc796bcf632147b3d267ce Author: Stanislav Fomichev Date: Wed Sep 13 10:13:50 2023 -0700 tools: ynl: extend netdev sample to dump xdp-rx-metadata-features The tool can be used to verify that everything works end to end. Unrelated updates: - include tools/include/uapi to pick the latest kernel uapi headers - print "xdp-features" and "xdp-rx-metadata-features" so it's clear which bitmask is being dumped Cc: netdev@vger.kernel.org Cc: Willem de Bruijn Signed-off-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20230913171350.369987-4-sdf@google.com Signed-off-by: Martin KaFai Lau commit a9c2a608549bb1a2363d289d63907640afcf22af Author: Stanislav Fomichev Date: Wed Sep 13 10:13:49 2023 -0700 bpf: expose information about supported xdp metadata kfunc Add new xdp-rx-metadata-features member to netdev netlink which exports a bitmask of supported kfuncs. Most of the patch is autogenerated (headers), the only relevant part is netdev.yaml and the changes in netdev-genl.c to marshal into netlink. Example output on veth: $ ip link add veth0 type veth peer name veth1 # ifndex == 12 $ ./tools/net/ynl/samples/netdev 12 Select ifc ($ifindex; or 0 = dump; or -2 ntf check): 12 veth1[12] xdp-features (23): basic redirect rx-sg xdp-rx-metadata-features (3): timestamp hash xdp-zc-max-segs=0 Cc: netdev@vger.kernel.org Cc: Willem de Bruijn Signed-off-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20230913171350.369987-3-sdf@google.com Signed-off-by: Martin KaFai Lau commit fc45c5b642dbcac3bb10f4f904e4b863233e5369 Author: Stanislav Fomichev Date: Wed Sep 13 10:13:48 2023 -0700 bpf: make it easier to add new metadata kfunc No functional changes. Instead of having hand-crafted code in bpf_dev_bound_resolve_kfunc, move kfunc <> xmo handler relationship into XDP_METADATA_KFUNC_xxx. This way, any time new kfunc is added, we don't have to touch bpf_dev_bound_resolve_kfunc. Also document XDP_METADATA_KFUNC_xxx arguments since we now have more than two and it might be confusing what is what. Cc: netdev@vger.kernel.org Cc: Willem de Bruijn Signed-off-by: Stanislav Fomichev Link: https://lore.kernel.org/r/20230913171350.369987-2-sdf@google.com Signed-off-by: Martin KaFai Lau commit e81a600d42bba96f737ec66c467de3376e00f9ff Merge: b1ad9437edd7f 7a35d05f1e768 Author: Mark Brown Date: Fri Sep 15 19:03:43 2023 +0100 ASoC: intel: sof_sdw: Remove large global CPUs array Merge series from Bard Liao : Rather than keeping a single array of CPU dai link components allocate a smaller one for each DAI link, this reduces the amount of state that needs to be passed back and forth in the driver. commit b1ad9437edd7f145fda807efb604ad84348170af Merge: e9c7748084ac7 5a8a9d70ecac3 Author: Mark Brown Date: Fri Sep 15 19:03:35 2023 +0100 ASoC: SOF: ipc4/Intel: Implement split fw library Merge series from Peter Ujfalusi : This series implements support for split library loading to comply with the HDA DMA programming sequence recommendation, which is: 1. DSP side DMA programming and GEN bit set to 1 2. host side DMA programming and RUN bit set to 1 The SOF support for library loading is based on this sequence, backwards compatibility with older reference firmware is supported (where only the LOAD_LIBRARY message is supported). commit e9c7748084ac7236b657b9945789c574a3eb62e0 Merge: 5a7d9aaf274f0 01e76ee227564 Author: Mark Brown Date: Fri Sep 15 19:03:27 2023 +0100 ASoC: cs35l56: Define and export I2C/SPI pm_ops only Merge series from Richard Fitzgerald : These 3 patches update the pm_ops for I2C/SPI so that they are only built and exported if they are needed. commit 5a7d9aaf274f01f2ad18f7b13b344d46e437a0c8 Merge: 925819c7969cc 5f017134e42df Author: Mark Brown Date: Fri Sep 15 19:03:19 2023 +0100 ASoC: Intel: machine driver update Merge series from Bard Liao : Some cleanups from Brent Lu for I2S platforms. And minor additions for RVPs and Chromebooks. commit d609f3d228a8efe991f44f11f24146e2a5209755 Author: Tirthendu Sarkar Date: Thu Sep 7 09:20:32 2023 +0530 xsk: add multi-buffer support for sockets sharing umem Userspace applications indicate their multi-buffer capability to xsk using XSK_USE_SG socket bind flag. For sockets using shared umem the bind flag may contain XSK_USE_SG only for the first socket. For any subsequent socket the only option supported is XDP_SHARED_UMEM. Add option XDP_UMEM_SG_FLAG in umem config flags to store the multi-buffer handling capability when indicated by XSK_USE_SG option in bing flag by the first socket. Use this to derive multi-buffer capability for subsequent sockets in xsk core. Signed-off-by: Tirthendu Sarkar Fixes: 81470b5c3c66 ("xsk: introduce XSK_USE_SG bind flag for xsk socket") Acked-by: Maciej Fijalkowski Link: https://lore.kernel.org/r/20230907035032.2627879-1-tirthendu.sarkar@intel.com Signed-off-by: Alexei Starovoitov commit 37454bcbb68601c326b58ac45f508067047d791f Author: Justin Stitt Date: Thu Sep 14 22:17:08 2023 +0000 drm/nouveau/pm: refactor deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230914-strncpy-drivers-gpu-drm-nouveau-nvkm-engine-pm-base-c-v1-1-4b09ed453f84@google.com commit 00fb28fd16adbfe7642905406290b7b7cea1a80c Author: Justin Stitt Date: Thu Sep 14 21:40:49 2023 +0000 drm/nouveau/core: refactor deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without unnecessarily NUL-padding. There is likely no bug in the current implementation due to the safeguard: | cname[sizeof(cname) - 1] = '\0'; ... however we can provide simpler and easier to understand code using the newer (and recommended) `strscpy` api. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230914-strncpy-drivers-gpu-drm-nouveau-nvkm-core-firmware-c-v1-1-3aeae46c032f@google.com commit 3ce6608bfc84415414b61b05abcfb80d3d8f854d Author: Justin Stitt Date: Thu Sep 14 21:30:37 2023 +0000 drm/nouveau/nvif: refactor deprecated strncpy `strncpy` is deprecated and as such we should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy_pad` due to the fact that it guarantees NUL-termination on the destination buffer whilst also maintaining the NUL-padding behavior that `strncpy` provides. I am not sure whether NUL-padding is strictly needed but I see in `nvif_object_ctor()` args is memcpy'd elsewhere so I figured we'd keep the same functionality. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Justin Stitt Reviewed-by: Kees Cook Reviewed-by: Lyude Paul Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230914-strncpy-drivers-gpu-drm-nouveau-nvif-client-c-v1-1-dc3b3719fcb4@google.com commit 4d938bb93ffd35b1ea664222bb625061d7c4c73b Author: Daniele Ceraolo Spurio Date: Wed Aug 16 16:13:20 2023 -0700 drm/i915/huc: silence injected failure in the load via GSC path If we can't load the HuC due to an injected failure, we don't want to throw and error and trip CI. Using the gt_probe_error macro for logging ensure that the error is only printed if it wasn't explicitly injected. v2: keep the line to less than 100 characters (checkpatch). Link: https://gitlab.freedesktop.org/drm/intel/-/issues/7061 Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: Andi Shyti #v1 Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230816231320.1555190-1-daniele.ceraolospurio@intel.com commit db43b0319df5949286411e3f6ed225186f552297 Author: baozhu.liu Date: Tue Aug 29 17:30:03 2023 +0800 drm/komeda: add NV12 format to support writeback layer type When testing the d71 writeback layer function, the output format is set to NV12, and the following error message is displayed: [drm:komeda_fb_is_layer_supported] Layer TYPE: 4 doesn't support fb FMT: NV12 little-endian (0x3231564e) with modifier: 0x0.. Check the d71 data manual, writeback layer output formats includes NV12 format. Signed-off-by: baozhu.liu Signed-off-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20230829093004.22860-1-lucas.liu@siengine.com commit 4485bd519f5d6d620a29d0547ff3c982bdeeb468 Author: Umesh Nerlige Ramappa Date: Tue Sep 12 14:22:47 2023 -0700 i915/pmu: Move execlist stats initialization to execlist specific setup engine->stats is a union of execlist and guc stat objects. When execlist specific fields are initialized, the initial state of guc stats is affected. This results in bad busyness values when using GuC mode. Move the execlist initialization from common code to execlist specific code. Fixes: 77cdd054dd2c ("drm/i915/pmu: Connect engine busyness stats from GuC to pmu") Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Alan Previn Link: https://patchwork.freedesktop.org/patch/msgid/20230912212247.1828681-1-umesh.nerlige.ramappa@intel.com commit 98fa06e44e3a773f41935323ed1dae7012819b70 Author: Dnyaneshwar Bhadane Date: Fri Sep 15 01:50:00 2023 +0530 drm/i915: Add Wa_18022495364 Invalidate instruction and State cache bit using INDIRECT_CTX on every gpu context switch for gen12. The goal of this workaround is to actually perform an explicit invalidation of that cache (by re-writing the register) during every GPU context switch, which is accomplished via a "workaround batchbuffer" that's attached to the context via INDIRECT_CTX. (Matt Roper) Please refer [1] for more reviews and comment on the same patch [1] https://patchwork.freedesktop.org/series/123377/ v2: - Remove extra parentheses from the condition (Lucas) - Align spacing and new line (Lucas) v3: - Fix commit message. v4: - Only Gen12 changes are kept and Remove DG2+ condition (Matt Roper) - Fix the commit message for r-b (Matt Roper) - Rename the register bit in define v5: - Move out this workaround from golden context init (Matt Roper) - Use INDIRECT_CTX to set bit on each GPU context switch (Matt Roper) v6: - Change IP Version base condition for Gen12 (Matt Roper) - Made imperative form of commit version messages (Suraj) - s/Added/Add in patch header (Suraj) v7: - In version descriptions s/Ropper/Roper (Matt Atwood) BSpec: 11354 Cc: Lucas De Marchi Cc: Matt Roper Cc: Suraj Kandpal Cc: Matt Atwood Signed-off-by: Dnyaneshwar Bhadane Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230914202000.1069884-1-dnyaneshwar.bhadane@intel.com commit 27b87db470e2274e9293375a6c61a2b5d8404f23 Author: Jani Nikula Date: Thu Sep 14 16:19:51 2023 +0300 MAINTAINERS: add drm_bridge_connector.[ch] files under bridge chips Clearly this should be under bridge chips. Cc: Andrzej Hajda Cc: Neil Armstrong Cc: Robert Foss Signed-off-by: Jani Nikula Acked-by: Neil Armstrong Acked-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230914131951.2473844-1-jani.nikula@intel.com commit ea097ffa42b709109717ba42ea09d730ab4959ba Author: Pranjal Ramajor Asha Kanojiya Date: Fri Sep 1 10:12:36 2023 -0600 accel/qaic: Use devm_drm_dev_alloc() instead of drm_dev_alloc() Since drm_dev_alloc() is deprecated it is recommended to use devm_drm_dev_alloc() instead. Update the driver to start using devm_drm_dev_alloc(). Signed-off-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Carl Vanderlip Reviewed-by: Jeffrey Hugo Signed-off-by: Jeffrey Hugo Reviewed-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901161236.8371-1-quic_jhugo@quicinc.com commit 86a9264b6c56c9eee6dd5c8733f92afd3f58ce98 Author: Konrad Dybcio Date: Mon Jul 3 22:15:28 2023 +0200 arm64: dts: qcom: sm8250: Add interconnects and power-domains to QUPs Describe the interconnect paths related to QUPs and add the power-domains powering them. This is required for icc sync_state, as otherwise QUP access is gated. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230703-topic-8250_qup_icc-v2-4-9ba0a9460be2@linaro.org Signed-off-by: Bjorn Andersson commit 1006d67413d72d8cb70e18b02f4072ed06efb29d Author: Pranjal Ramajor Asha Kanojiya Date: Fri Sep 1 10:10:37 2023 -0600 accel/qaic: Register for PCI driver at the beginning of module init As qaic drivers base device is connected to host via PCI framework, it makes sense to register in PCI framework at the beginning of module init. Signed-off-by: Pranjal Ramajor Asha Kanojiya Reviewed-by: Carl Vanderlip Reviewed-by: Jeffrey Hugo Signed-off-by: Jeffrey Hugo Reviewed-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901161037.6124-1-quic_jhugo@quicinc.com commit 93caca6a04b1d2ff8c7d817cccaece08f0f08a2f Author: Jani Nikula Date: Tue Sep 12 15:05:37 2023 +0300 drm/i915: move intel_display_device_probe() one level higher Don't hide display probe in device info code. Cc: Matt Roper Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230912120537.2158209-3-jani.nikula@intel.com commit a2c57575b90a17003a03e1e1a72793c12bde0bce Author: Jani Nikula Date: Tue Sep 12 15:05:36 2023 +0300 drm/i915/display: call gmdid display probe at a higher level Move gmdid selection one abstraction level higher. Cc: Matt Roper Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230912120537.2158209-2-jani.nikula@intel.com commit 6686c30e455cd4bc6dbca44dfc225bc0243e600e Author: Jani Nikula Date: Tue Sep 12 15:05:35 2023 +0300 drm/i915: move more of the display probe to display code Initializing i915->display.info.__device_info and DISPLAY_RUNTIME_INFO() really belongs in display code. Move them there. Cc: Matt Roper Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230912120537.2158209-1-jani.nikula@intel.com commit 43ff221426d33db909f7159fdf620c3b052e2d1c Merge: 0bb80ecc33a8f 944834901adc9 Author: Arnd Bergmann Date: Fri Sep 15 17:21:12 2023 +0200 Merge tag 'tag-remove-ia64' of git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux into asm-generic Remove IA-64 architecture support Fix the IA-64 build before removing the architecture support completely. This makes v6.6 LTS the final Linux release with IA-64/Itanium support. * tag 'tag-remove-ia64' of git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux: Documentation: Drop or replace remaining mentions of IA64 lib/raid6: Drop IA64 support Documentation: Drop IA64 from feature descriptions kernel: Drop IA64 support from sig_fault handlers arch: Remove Itanium (IA-64) architecture acpi: Provide ia64 dummy implementation of acpi_proc_quirk_mwait_check() Acked-by: John Paul Adrian Glaubitz Acked-by: Thomas Gleixner Signed-off-by: Arnd Bergmann commit 4ff34ad3d39377d9f6953f3606ccf611ce636767 Author: Uros Bizjak Date: Tue Feb 28 17:14:26 2023 +0100 sched/core: Use do-while instead of for loop in set_nr_if_polling() Use equivalent do-while loop instead of infinite for loop. There are no asm code changes. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230228161426.4508-1-ubizjak@gmail.com commit 5f017134e42df6208a828f2aca26d56ecca9747c Author: Brent Lu Date: Fri Sep 15 20:48:52 2023 +0800 ASoC: Intel: sof_da7219: use ssp-common module to detect codec Use ssp-common module to detect codec and amplifier type in driver probe function and remove all quirks about amplifier type. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-20-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 6bd912d75dcf2c919a715b6e163f90a125e66d78 Author: Brent Lu Date: Fri Sep 15 20:48:51 2023 +0800 ASoC: Intel: sof_da7219: add adl_mx98360_da7219 board config This configuration supports ADL boards which implement DA7219 on SSP0 and MAX98360A on SSP1. DA7219 uses PLL bypass mode to avoid WCLK locking problem. To use this mode, MCLK frequency must be 12.288 or 24.576MHz. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-19-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 729fd8b233c9a716f38834d486eacb952034fdb0 Author: Brent Lu Date: Fri Sep 15 20:48:50 2023 +0800 ASoC: Intel: sof_da7219: use maxim-common module Use maxim-common module to handle speaker amp DAI link registration. No functional change in this commit. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-18-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 18e12093e3da13f32bc5521a894a9c92357f7f55 Author: Brent Lu Date: Fri Sep 15 20:48:49 2023 +0800 ASoC: Intel: sof_da7219: rename driver file and kernel option Rename the driver file and kernel option to be consistent with other SOF machine drivers. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-17-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 8d2671d12a305ccd81c117a2293b87376a9d8e84 Author: Brent Lu Date: Fri Sep 15 20:48:48 2023 +0800 ASoC: Intel: sof_nau8825: use realtek-common module Use realtek-common module to support rt1019p speaker amplifier. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-16-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit e8f34882622274f6d107774d9f621ef924df0b03 Author: Brent Lu Date: Fri Sep 15 20:48:47 2023 +0800 ASoC: Intel: sof_nau8825: use nuvoton-common module Use nuvoton-common module to support nau8318 speaker amplifier. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-15-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit e82907e7c10ef87768a625e732083f8dc4fe75e3 Author: Brent Lu Date: Fri Sep 15 20:48:46 2023 +0800 ASoC: Intel: nuvoton-common: support nau8318 amplifier Implement nau8318 support code in this common module so it could be shared between multiple SOF machine drivers. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-14-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 48bc32d94c360a8501e632d24557ad3aba304e9e Author: Brent Lu Date: Fri Sep 15 20:48:45 2023 +0800 ASoC: Intel: sof_ssp_amp: do not create amp link for nocodec board A BE DAI link for speaker amplifier is always created even a board quirk specifies there is no amplifier. Modify the driver to check amplifier type before creating corresponding DAI link. The topology (sof-tgl-rt1308-hdmi-ssp.m4) which supports HDMI-IN is using fixed BE ID for each DAI link. Therefore we also uses fixed ID in machine driver side. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Reviewed-by: Balamurugan C Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-13-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 14b7ed66e394d097eed9469abef1434a0e07b383 Author: Balamurugan C Date: Fri Sep 15 20:48:44 2023 +0800 ASoC: Intel: sof_rt5682: add HDMI_In capture feature support for RPL. Added HDMI-in capture support for RPL boards. previously it used adl machines and now its moved into separate match entry. Signed-off-by: Balamurugan C Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-12-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit db31e3a1c5bcf9dc6fe12325f162946e3161bb57 Author: Brent Lu Date: Fri Sep 15 20:48:43 2023 +0800 ASoC: Intel: sof_rt5682: add adl_rt5650 board config This configuration supports ADL boards which implement ALC5650 dual I2S interface codec. Two DAI links are added: AIF1 (on codec side) for headphone and AIF2 for speakers. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-11-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit c1cecc920a7fd2f4d3cc5f77be0de58f2cee4f35 Author: Uday M Bhat Date: Fri Sep 15 20:48:42 2023 +0800 ASoC: Intel: sof_rt5682: Modify number of HDMI to 3 for MTL/Rex devices For all MTL/Rex devices, number of HDMI supported is 3. Signed-off-by: Yong Zhi Signed-off-by: Uday M Bhat Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-10-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit aa3216f52a64c833866b94b1e3e215540f562343 Author: Uday M Bhat Date: Fri Sep 15 20:48:41 2023 +0800 ASoC: Intel: sof_rt5682: Add support for Rex with discrete BT offload. System firmware has included additional audio DMI string MAX98360_ALC5682I_DISCRETE_I2S_BT for discrete BT offload supporting devices. Same DMI string match is introduced in sof_rt5682_quirk_table. Signed-off-by: Uday M Bhat Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-9-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 19fa16b6b66b9ec5fcd1db6ba308062a8090d27f Author: Brent Lu Date: Fri Sep 15 20:48:40 2023 +0800 ASoC: Intel: sof_nau8825: use ssp-common module to detect codec Use ssp-common module to detect codec and amplifier type in driver probe function and remove all quirks about codec and amplifier type. Signed-off-by: Brent Lu Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-8-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 6308c12507c0c24fe594a26a1d92ed899fc1eea5 Author: Brent Lu Date: Fri Sep 15 20:48:39 2023 +0800 ASoC: Intel: sof_ssp_amp: use ssp-common module to detect codec Use ssp-common module to detect codec and amplifier type in driver probe function and remove all quirks about codec and amplifier type. Signed-off-by: Brent Lu Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-7-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 811e874dd3fbe61709c246a99168f6416b76ddf3 Author: Brent Lu Date: Fri Sep 15 20:48:38 2023 +0800 ASoC: Intel: sof_cs42l42: use ssp-common module to detect codec Use ssp-common module to detect codec and amplifier type in driver probe function and remove all quirks about codec and amplifier type. Signed-off-by: Brent Lu Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-6-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 5f706c5e929b10c6fa38c0170d9ddec21e373f20 Author: Brent Lu Date: Fri Sep 15 20:48:37 2023 +0800 ASoC: Intel: sof_rt5682: use ssp-common module to detect codec Use ssp-common module to detect codec and amplifier type in driver probe function and remove all quirks about codec and amplifier type. Due to codec detection feature, we could remove HP Dooly's DMI quirk safely. Signed-off-by: Brent Lu Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-5-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 02a204dd4e627900fad66b4362f6c4fb6a0a7a26 Author: Brent Lu Date: Fri Sep 15 20:48:36 2023 +0800 ASoC: Intel: use ACPI HID definition in ssp-common Use ACPI HID definition in ssp-common header for device name macros. No functional change here. Signed-off-by: Brent Lu Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-4-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 4b38d63916ab0d21c9eb967087e9ccb99d151696 Author: Brent Lu Date: Fri Sep 15 20:48:35 2023 +0800 ASoC: Intel: ssp-common: support codec detection Create a new common module to host functions which could be shared among SSP machine drivers. Add functions to detect headphone codec and speaker amplifier via ACPI system at runtime in order to remove codec type quirks in machine drivers. Signed-off-by: Brent Lu Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-3-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 95409545095bca8fd6a48bc66c401e101dfc57e6 Author: Brent Lu Date: Fri Sep 15 20:48:34 2023 +0800 ASoC: Intel: sof_rt5682: cleanup unnecessary quirk flag Remove SOF_RT5682_MCLK_24MHZ flag from JSL and CML/WHL board configs since the information could be retrieved from SOF API. The macro itself is removed as well. Signed-off-by: Brent Lu Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915124852.1696857-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 2fad9e44bc08a3731cf559ebf5dae58220373028 Author: Jani Nikula Date: Thu Sep 14 12:34:59 2023 +0300 drm/i915/dpt: replace GEM_BUG_ON() with drm_WARN_ON() Avoid using GEM_BUG_ON() in display code. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/17e70eaf967bdfe99111cdbb3bcf6aa2f0b0e837.1694684044.git.jani.nikula@intel.com commit 02cc0ebc41790d190186321bedaa0ba820abbe20 Author: Jani Nikula Date: Thu Sep 14 12:34:58 2023 +0300 drm/i915/fb: replace GEM_WARN_ON() with drm_WARN_ON() Avoid using GEM_WARN_ON() in display code. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/593285450602c259b6985972d68511190c754bf5.1694684044.git.jani.nikula@intel.com commit e7b392824223a08440cb0258a4e65d70af2a5c6e Author: Jani Nikula Date: Thu Sep 14 12:34:57 2023 +0300 drm/i915/fbc: replace GEM_BUG_ON() to drm_WARN_ON() Avoid using GEM_BUG_ON() in display code. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/a7d53a403822b43c7d78689a10480b47ccc0534d.1694684044.git.jani.nikula@intel.com commit 4fa5ce3e3a10da4ecc438a548fc701dec5f28758 Author: Dan Carpenter Date: Wed Sep 13 12:36:29 2023 +0300 tcp: indent an if statement Indent this if statement one tab. Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 13a46acc05042fc1653a5d6ebf6dc957f2744fc6 Merge: 7c192ce9ff1d9 0a205f0fe8dd2 Author: David S. Miller Date: Fri Sep 15 13:54:34 2023 +0100 Merge branch 'icssg-half-duplex-support' ==================== net: Add Half Duplex support for ICSSG Driver This series adds support for half duplex operation for ICSSG driver. In order to support half-duplex operation at 10M and 100M link speeds, the PHY collision detection signal (COL) should be routed to ICSSG GPIO pin (PRGx_PRU0/1_GPI10) so that firmware can detect collision signal and apply the CSMA/CD algorithm applicable for half duplex operation. A DT property, "ti,half-duplex-capable" is introduced for this purpose in the first patch of the series. If board has PHY COL pin conencted to PRGx_PRU1_GPIO10, this DT property can be added to eth node of ICSSG, MII port to support half duplex operation at that port. Second patch of the series configures driver to support half-duplex operation if the DT property "ti,half-duplex-capable" is enabled. This series addresses comments on [v2]. This series is based on the latest net-next/main. This series has no dependency. Changes from v1 to v2: *) Changed the description of "ti,half-duplex-capable" property as asked by Rob and Andrew to avoid confusion between capable and enable. Changes from v1 to v2: *) Dropped the RFC tag. *) Added RB tags of Andrew and Roger. [v1] https://lore.kernel.org/all/20230830113134.1226970-1-danishanwar@ti.com/ [v2] https://lore.kernel.org/all/20230911060200.2164771-1-danishanwar@ti.com/ ==================== Signed-off-by: David S. Miller commit 0a205f0fe8dd2ab80531b54f01d6483f37120c0e Author: MD Danish Anwar Date: Wed Sep 13 14:40:11 2023 +0530 net: ti: icssg-prueth: Add support for half duplex operation This patch adds support for half duplex operation at 10M and 100M link speeds for AM654x/AM64x devices. - Driver configures rand_seed, a random number, in DMEM HD_RAND_SEED_OFFSET field, which will be used by firmware for Back off time calculation. - Driver informs FW about half duplex link operation in DMEM PORT_LINK_SPEED_OFFSET field by setting bit 7 for 10/100M HD. Hence, the half duplex operation depends on board design the "ti,half-duplex-capable" property has to be enabled for ICSS-G ports if HW is capable to perform half duplex. Reviewed-by: Andrew Lunn Reviewed-by: Roger Quadros Signed-off-by: MD Danish Anwar Signed-off-by: David S. Miller commit 927c568d62128f48d6646d6df801c1ae25cf139f Author: MD Danish Anwar Date: Wed Sep 13 14:40:10 2023 +0530 dt-bindings: net: Add documentation for Half duplex support. In order to support half-duplex operation at 10M and 100M link speeds, the PHY collision detection signal (COL) should be routed to ICSSG GPIO pin (PRGx_PRU0/1_GPI10) so that firmware can detect collision signal and apply the CSMA/CD algorithm applicable for half duplex operation. A DT property, "ti,half-duplex-capable" is introduced for this purpose. If board has PHY COL pin conencted to PRGx_PRU1_GPIO10, this DT property can be added to eth node of ICSSG, MII port to support half duplex operation at that port. Reviewed-by: Roger Quadros Signed-off-by: MD Danish Anwar Reviewed-by: Andrew Lunn Acked-by: Conor Dooley Reviewed-by: Rob Herring Signed-off-by: David S. Miller commit 7a35d05f1e7687bbb57b97efe6d0af560826507e Author: Charles Keepax Date: Fri Sep 15 15:56:11 2023 +0800 ASoC: intel: sof_sdw: Increment be_id in init_dai_link Rather than incrementing the ID for the dai_links in many places throughout the code, just increment it each time we initialise a new DAI link. Signed-off-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915075611.1619548-5-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit f6c0273ba936c80632f5edfb5659e49b8bf6b6a9 Author: Charles Keepax Date: Fri Sep 15 15:56:10 2023 +0800 ASoC: intel: sof_sdw: Make create_sdw_dailink allocate link components Now only the SoundWire part of the code uses the global cpus array, remove it and have create_sdw_dailink allocate its own link components. This removes a lot of state being passed around in the driver, which simplifies things a fair bit. Signed-off-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915075611.1619548-4-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit b359760d95eecaabd081c1c2cd58e0a15fe5a68c Author: Charles Keepax Date: Fri Sep 15 15:56:09 2023 +0800 ASoC: intel: sof_sdw: Add simple DAI link creation helper The code contains a fair amount of state tracking and one part of that is keeping track of which entry in the large global cpus snd_soc_dai_link_component array is currently in use. Add a helper function to allocate a simple DAI link, this simplifies the code slightly and moves us in the direction of eliminating the need for the large global cpus array. This does slightly increase the number of allocations done, but this is probe time and the code already does a large number of allocations so this increase is small over all. Signed-off-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915075611.1619548-3-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit fc46ecf34782c0d3ec8224ce6003a2631f8a93f1 Author: Charles Keepax Date: Fri Sep 15 15:56:08 2023 +0800 ASoC: intel: sof_sdw: Move sdw_pin_index into private struct Whilst it should not cause any issues as only a single instance of the machine will be instantiated, it is still slightly better practice to keep working data in the private data structure, rather than a global variable. Move sdw_pin_index into the mc_private structure. Signed-off-by: Charles Keepax Reviewed-by: Pierre-Louis Bossart Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20230915075611.1619548-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit c0490bc9bb62d9376f3dd4ec28e03ca0fef97152 Author: Chengming Zhou Date: Wed Sep 13 13:20:31 2023 +0000 sched/fair: Fix cfs_rq_is_decayed() on !SMP We don't need to maintain per-queue leaf_cfs_rq_list on !SMP, since it's used for cfs_rq load tracking & balancing on SMP. But sched debug interface uses it to print per-cfs_rq stats. This patch fixes the !SMP version of cfs_rq_is_decayed(), so the per-queue leaf_cfs_rq_list is also maintained correctly on !SMP, to fix the warning in assert_list_leaf_cfs_rq(). Fixes: 0a00a354644e ("sched/fair: Delete useless condition in tg_unthrottle_up()") Reported-by: Leo Yu-Chi Liang Signed-off-by: Chengming Zhou Signed-off-by: Ingo Molnar Tested-by: Leo Yu-Chi Liang Reviewed-by: Vincent Guittot Closes: https://lore.kernel.org/all/ZN87UsqkWcFLDxea@swlinux02/ Link: https://lore.kernel.org/r/20230913132031.2242151-1-chengming.zhou@linux.dev commit 925819c7969cc1453a3e8125787942d6127fa002 Author: Takashi Iwai Date: Fri Sep 15 10:22:07 2023 +0200 ASoC: amd: ps: Fix -Wformat-truncation warning The compile warning with -Wformat-truncation at sdw_amd_scan_controller() is false-positive; the max loop size is AMD_SDW_MAX_MANAGERS (= 2), hence it fits with the given size. For suppressing the warning, replace snprintf() with scnprintf(). As stated in the above, truncation doesn't matter. Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20230915082207.26200-1-tiwai@suse.de Signed-off-by: Mark Brown commit 74d71f628db99987d43d242ea4d3631ef0a906d0 Author: Shuming Fan Date: Fri Sep 15 10:05:30 2023 +0800 ASoC: rt1015: fix the first word being cut off This patch adds a control that there are four options to control the digital volume output. The user could select "immediate" to make volume updates immediately. In default, the driver selects the volume update with "zero detection + soft inc/dec change". Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20230915020530.83452-1-shumingf@realtek.com Signed-off-by: Mark Brown commit b0ef97ac89a794ae786eb1ff1cd2b07e9d9ab3c4 Author: Rob Herring Date: Thu Sep 14 14:00:17 2023 -0500 spi: dt-bindings: arm,pl022: Move child node properties to separate schema In order to validate SPI peripherals, SPI controller-specific child node properties need to be in a separate schema, spi-peripheral-props.yaml, which SPI peripheral schemas reference. Move the arm,pl022 child properties to their own schema file and add a $ref in spi-peripheral-props.yaml. Signed-off-by: Rob Herring Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20230914190033.1852600-1-robh@kernel.org Signed-off-by: Mark Brown commit 5a8a9d70ecac3acbd49e70ad8f85153c0315643e Author: Peter Ujfalusi Date: Fri Sep 15 14:40:18 2023 +0300 ASoC: SOF: Intel: hda-loader: Add support for split library loading There is a certain sequence needs to be followed when configuring the HDA DMA in host and DSP. The firmware provides a way to handle this two stage sequencing by splitting the library loading into two stage: 1st stage: LOAD_LIBRARY_PREPARE message the lib_id is 0, used to configure the DMA on DSP side 2nd stage: LOAD_LIBRARY message both dma_id and lib_id is valid, used for the actual transfer of the library In case a firmware without support for this two stage loading is used then the second stage message will trigger the loading and the first stage will return with error, which is ignored by the kernel. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Ranjani Sridharan Reviewed-by: Chao Song Link: https://lore.kernel.org/r/20230915114018.1701-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 4f0f3c774947fdd3c4236cef9372b329c276845c Author: Peter Ujfalusi Date: Fri Sep 15 14:40:17 2023 +0300 ASoC: SOF: ipc4: Add new message type: SOF_IPC4_GLB_LOAD_LIBRARY_PREPARE On Intel platforms there is a strict order requirement for the DMA programming: DSP side configures the buffer and sets the GEN bit Host side sets the RUN bit. In order to follow this flow, a new global message type has been added to prepare the DSP side of the DMA: host sends LOAD_LIBRARY_PREPARE with the dma_id DSP side sets its buffer and sets the GEN bit Host sets the RUN bit Host sends LOAD_LIBRARY with dma_id and lib_id DSP receives the library data. It is up to the platform code to use the new prepare stage message and how to handle the reply to it from the firmware, which can indicate that the message type is not supported/handled. In this case the kernel should proceed to the LOAD_LIBRARY stage assuming a single stage library loading: host sends LOAD_LIBRARY_PREPARE with the dma_id DSP replies that the message type is not supported/handled Host acknowledges the return code and sets the RUN bit Host sends LOAD_LIBRARY with dma_id and lib_id DSP receives the library data. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Ranjani Sridharan Reviewed-by: Chao Song Link: https://lore.kernel.org/r/20230915114018.1701-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 369ea9f82c279e88a52217b56dc1f973de57ac56 Author: Peter Ujfalusi Date: Fri Sep 15 14:40:16 2023 +0300 ASoC: SOF: Intel: hda: Add definition for SDxFIFOS.FIFOS mask The FIFOS (FIFO Size) field is in bit 0-15 of the register. Use the defined mask instead of a magic number for the FIFOS value masking in hda_dsp_stream_hw_params(). Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Ranjani Sridharan Reviewed-by: Chao Song Link: https://lore.kernel.org/r/20230915114018.1701-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit c2d8f17ed0c70816737cbf8f530d2178ee6affbb Author: Peter Ujfalusi Date: Fri Sep 15 14:40:15 2023 +0300 ASoC: SOF: ipc4: Convert status code 2 and 15 to -EOPNOTSUPP The status code 2 and 15 can be translated to -EOPNOTSUPP, so convert them to a meaningful error number. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Reviewed-by: Ranjani Sridharan Reviewed-by: Chao Song Link: https://lore.kernel.org/r/20230915114018.1701-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 26dfc43461102957e33454e766d592df330ef7a0 Author: Bard Liao Date: Fri Sep 15 12:35:07 2023 +0300 ASoC: SOF: ipc4-pcm: fixup dailink based on copier format When a copier exposes a single format, we can fixup the BE dailink with that format. This is helpful when some codec have format restrictions and e.g. don't support a 32-bit format. In that case, the copier output formats mirror that restriction in the topology file. An alternate solution was suggested earlier using a dedicated topology token. When specified, the token would be used to fix-up the dailink. The main reason why this solution was chosen is that there is a risk of a disconnect between token definition and copier format. With a single piece of information as suggested in this patch, there are fewer risks of a bad configuration. Signed-off-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230915093507.7242-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 94fc6da924072399e4f475c7d7124a7272197e6a Author: Bard Liao Date: Fri Sep 15 12:35:06 2023 +0300 ASoC: SOF: ipc4-topology: export sof_ipc4_copier_is_single_format We will use the sof_ipc4_copier_is_single_format() function to check if a ipc4 copier has single format available in ipc4-pcm.c in the next patch. Signed-off-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230915093507.7242-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 32c32155cab3512bf921cabfb7a58c5f314f6c07 Author: Ville Syrjälä Date: Tue Aug 29 14:39:20 2023 +0300 drm/i915/sdvo: Constify mapping structs We aren't intending to mutate the SDVO device mapping structs, so make them const. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-13-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 31a657528976ff94a2afcb8e9ca4c4d4c1b96f9e Author: Ville Syrjälä Date: Tue Aug 29 14:39:19 2023 +0300 drm/i915/hdmi: Remove old i2c symlink Remove the i915 specific i2c-N symlink from HDMI connectors. This was added to sort of mirror the DP connectors that alreayd had their aux ch based i2c adapter sitting beneath them in the sysfs hierarchy. But now that we have the standard "ddc" symlink approach provided by the core let's switch to that fully. I don't think anything beyond igt depends on this. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-12-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit ac6dcb63f2440188825f6bfd89992f82800e708a Author: Ville Syrjälä Date: Tue Aug 29 14:39:18 2023 +0300 drm/i915/hdmi: Nuke hdmi->ddc_bus Remove the mostly redundant hdmi->ddc_bus. The only thing that needs it anymore is get_encoder_by_ddc_bus(), but that can be replaced with a slight detour through attached_connector+intel_gmbus_get_adapter(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-11-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit e046d156249140711a08ff27473591c74ef90814 Author: Ville Syrjälä Date: Tue Aug 29 14:39:17 2023 +0300 drm/i915/hdmi: Use connector->ddc everwhere We already populate connector->ddc for HDMI ports, but so far we've not taken full advantage of it. Do that by eliminating a bunch of intel_gmbus_get_adapter() lookups. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-10-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 6d08ad2166f7770341ea56afad45fa41cd16ae62 Author: Yury Norov Date: Sat Aug 19 07:12:38 2023 -0700 sched/topology: Fix sched_numa_find_nth_cpu() comment Reword sched_numa_find_nth_cpu() comment and make it kernel-doc compatible. Signed-off-by: Yury Norov Signed-off-by: Ingo Molnar Cc: Mel Gorman Link: https://lore.kernel.org/r/20230819141239.287290-7-yury.norov@gmail.com commit 9ecea9ae4d3127a09fb5dfcea87f248937a39ff5 Author: Yury Norov Date: Sat Aug 19 07:12:37 2023 -0700 sched/topology: Handle NUMA_NO_NODE in sched_numa_find_nth_cpu() sched_numa_find_nth_cpu() doesn't handle NUMA_NO_NODE properly, and may crash kernel if passed with it. On the other hand, the only user of sched_numa_find_nth_cpu() has to check NUMA_NO_NODE case explicitly. It would be easier for users if this logic will get moved into sched_numa_find_nth_cpu(). Signed-off-by: Yury Norov Signed-off-by: Ingo Molnar Cc: Mel Gorman Link: https://lore.kernel.org/r/20230819141239.287290-6-yury.norov@gmail.com commit 8ab63d418d4339d996f80d02a00dbce0aa3ff972 Author: Yury Norov Date: Sat Aug 19 07:12:36 2023 -0700 sched/topology: Fix sched_numa_find_nth_cpu() in non-NUMA case When CONFIG_NUMA is enabled, sched_numa_find_nth_cpu() searches for a CPU in sched_domains_numa_masks. The masks includes only online CPUs, so effectively offline CPUs are skipped. When CONFIG_NUMA is disabled, the fallback function should be consistent. Fixes: cd7f55359c90 ("sched: add sched_numa_find_nth_cpu()") Signed-off-by: Yury Norov Signed-off-by: Ingo Molnar Cc: Mel Gorman Link: https://lore.kernel.org/r/20230819141239.287290-5-yury.norov@gmail.com commit 617f2c38cb5ce60226042081c09e2ee3a90d03f8 Author: Yury Norov Date: Sat Aug 19 07:12:35 2023 -0700 sched/topology: Fix sched_numa_find_nth_cpu() in CPU-less case When the node provided by user is CPU-less, corresponding record in sched_domains_numa_masks is not set. Trying to dereference it in the following code leads to kernel crash. To avoid it, start searching from the nearest node with CPUs. Fixes: cd7f55359c90 ("sched: add sched_numa_find_nth_cpu()") Reported-by: Yicong Yang Reported-by: Guenter Roeck Signed-off-by: Yury Norov Signed-off-by: Ingo Molnar Reviewed-by: Yicong Yang Cc: Mel Gorman Link: https://lore.kernel.org/r/20230819141239.287290-4-yury.norov@gmail.com Closes: https://lore.kernel.org/lkml/CAAH8bW8C5humYnfpW3y5ypwx0E-09A3QxFE1JFzR66v+mO4XfA@mail.gmail.com/T/ Closes: https://lore.kernel.org/lkml/ZMHSNQfv39HN068m@yury-ThinkPad/T/#mf6431cb0b7f6f05193c41adeee444bc95bf2b1c4 commit d1db9fb432d50b0eecdfdd85d17cc15a59cc093b Author: Yury Norov Date: Sat Aug 19 07:12:34 2023 -0700 sched/fair: Fix open-coded numa_nearest_node() task_numa_placement() searches for a nearest node to migrate by calling for_each_node_state(). Now that we have numa_nearest_node(), switch to using it. Signed-off-by: Yury Norov Signed-off-by: Ingo Molnar Cc: Mel Gorman Link: https://lore.kernel.org/r/20230819141239.287290-3-yury.norov@gmail.com commit 959fb1a686528df1b8fb0cc7bec8ff851b1594a5 Author: Ville Syrjälä Date: Tue Aug 29 14:39:16 2023 +0300 drm/i915/mst: Populate connector->ddc Populate connector->ddc, and thus create the "ddc" symlink in sysfs for DP MST connectors. TODO: test that this actually works References: https://gitlab.freedesktop.org/drm/intel/-/issues/3605 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-9-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit b1f099b1cf51d553c510c6c8141c27d9ba7ea1fe Author: Yury Norov Date: Sat Aug 19 07:12:33 2023 -0700 numa: Generalize numa_map_to_online_node() The function in fact searches the nearest node for a given one, based on a N_ONLINE state. This is a common pattern to search for a nearest node. This patch converts numa_map_to_online_node() to numa_nearest_node() so that others won't need to opencode the logic. Signed-off-by: Yury Norov Signed-off-by: Ingo Molnar Cc: Mel Gorman Link: https://lore.kernel.org/r/20230819141239.287290-2-yury.norov@gmail.com commit 84fd19644aefea24c7245c6f34e7d614a31b2e66 Author: Ville Syrjälä Date: Tue Aug 29 14:39:15 2023 +0300 drm/i915/dp: Populate connector->ddc Populate connector->ddc, and thus create the "ddc" symlink in sysfs for analog DP SST connectors. Let's also reorder intel_dp_aux_init() vs. drm_connector_init_with_ddc() a bit to make sure the i2c aux ch is at least somewhat populated before we pass it on, though drm_connector_init_with_ddc() does not actually do anything with it. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-8-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 4aad8b9d0e7f7ea55e993ea9b9243dbab8ebf191 Author: Ville Syrjälä Date: Tue Aug 29 14:39:14 2023 +0300 drm/i915/dvo: Populate connector->ddc Populate connector->ddc, and thus create the "ddc" symlink in sysfs for DVO connectors. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-7-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 96f0ef50bfc646056a1a2ecf5a5b99888b97fe3c Author: Ville Syrjälä Date: Tue Aug 29 14:39:13 2023 +0300 drm/i915/crt: Populate connector->ddc Populate connector->ddc, and thus create the "ddc" symlink in sysfs for analog VGA connectors. As a bonus we can replace a bunch of intel_gmbus_get_adapter() lookups with just the connector->ddc pointer. Sadly one extra lookup still remains due to the g4x DVI-I shenanigans. We could perhaps consider borrowing the ddc proxy idea from SDVO to deal with that in a perhaps nicer way, but can't really be bothered right now at least. Also not sure exposing such a dual ddc bus to userspace would be quite wise. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 08a629fff8c9af3283ee9ff4e8d9b7134666166a Author: Ville Syrjälä Date: Tue Aug 29 14:39:12 2023 +0300 drm/i915/lvds: Populate connector->ddc Populate connector->ddc, and thus create the "ddc" symlink in sysfs for the LVDS port. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 30b98ecbfbd632814da8541c2c57a69ff9addb04 Author: Ville Syrjälä Date: Thu Aug 31 13:43:00 2023 +0300 drm/i915: Call the DDC bus i2c adapter "ddc" Rename the various names we've used for the DDC bus i2c adapter ("i2c", "adapter", etc.) to just "ddc". This differentiates it from the various other i2c busses we might have (DSI panel stuff, DVO control bus, etc.). v2: Don't add a bogus drm_get_edid() call (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230831104300.29688-1-ville.syrjala@linux.intel.com commit 21b6c2812f3d9cbcfce9eca76632e2cc8fef214f Author: Ville Syrjälä Date: Tue Aug 29 14:39:10 2023 +0300 drm/sysfs: Register "ddc" symlink later Currently drm_sysfs_connector_add() attempts to register the "ddc" symlink (based one connector->ddc) before the driver's .early_register() hook has been called. That is too early for i915 which only fully registers the aux ch and associated i2c bus from said hook (to prevent half initialized stuff getting exposed to userspace). This causes my attempt at using drm_connector_init_with_ddc() to fail, and the entire connector disappears from sysfs on account of sysfs_create_link() failing. To fix that split the sysfs symlink stuff into separate functions (drm_sysfs_connector_add_late() and drm_sysfs_connector_remove_early()) which are called on the opposite side of the .later_register() and .early_unregister() hooks. Cc: Andrzej Pietrasiewicz Cc: Daniel Vetter Cc: Andrzej Hajda Cc: Emil Velikov Cc: Sam Ravnborg Cc: Neil Armstrong Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula Acked-by: Thomas Zimmermann #irc commit 83a30739970857d3a2d8b8f2f62f829231347b5f Author: Ville Syrjälä Date: Tue Aug 29 14:39:09 2023 +0300 drm: Reorder drm_sysfs_connector_remove() vs. drm_debugfs_connector_remove() Use the standard onion peeling approach and call drm_debugfs_connector_remove() and drm_sysfs_connector_remove() in the reverse order in drm_connector_unregister() than what we called their add counterpartse in drm_connector_register(). The error unwiding in drm_connector_register() is already doing this the correct way around. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230829113920.13713-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula Acked-by: Thomas Zimmermann #irc commit b8e3dfa16ec55f310dd95831614af3d24abf5ed5 Author: Uros Bizjak Date: Wed Aug 30 17:13:57 2023 +0200 x86/percpu: Use raw_cpu_try_cmpxchg() in preempt_count_set() Use raw_cpu_try_cmpxchg() instead of raw_cpu_cmpxchg(*ptr, old, new) == old. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after CMPXCHG (and related MOV instruction in front of CMPXCHG). Also, raw_cpu_try_cmpxchg() implicitly assigns old *ptr value to "old" when cmpxchg fails. There is no need to re-read the value in the loop. No functional change intended. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230830151623.3900-2-ubizjak@gmail.com commit 5f863897d964e834a0da35b1e483b5bb8faca522 Author: Uros Bizjak Date: Wed Aug 30 17:13:56 2023 +0200 x86/percpu: Define raw_cpu_try_cmpxchg and this_cpu_try_cmpxchg() Define target-specific raw_cpu_try_cmpxchg_N() and this_cpu_try_cmpxchg_N() macros. These definitions override the generic fallback definitions and enable target-specific optimized implementations. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230830151623.3900-1-ubizjak@gmail.com commit 54cd971c6f4461fb6b178579751788bf4f64dfca Author: Uros Bizjak Date: Wed Sep 6 20:58:44 2023 +0200 x86/percpu: Define {raw,this}_cpu_try_cmpxchg{64,128} Define target-specific {raw,this}_cpu_try_cmpxchg64() and {raw,this}_cpu_try_cmpxchg128() macros. These definitions override the generic fallback definitions and enable target-specific optimized implementations. Several places in mm/slub.o improve from e.g.: 53bc: 48 8d 4f 40 lea 0x40(%rdi),%rcx 53c0: 48 89 fa mov %rdi,%rdx 53c3: 49 8b 5c 05 00 mov 0x0(%r13,%rax,1),%rbx 53c8: 4c 89 e8 mov %r13,%rax 53cb: 49 8d 30 lea (%r8),%rsi 53ce: e8 00 00 00 00 call 53d3 <...> 53cf: R_X86_64_PLT32 this_cpu_cmpxchg16b_emu-0x4 53d3: 48 31 d7 xor %rdx,%rdi 53d6: 4c 31 e8 xor %r13,%rax 53d9: 48 09 c7 or %rax,%rdi 53dc: 75 ae jne 538c <...> to: 53bc: 48 8d 4a 40 lea 0x40(%rdx),%rcx 53c0: 49 8b 1c 07 mov (%r15,%rax,1),%rbx 53c4: 4c 89 f8 mov %r15,%rax 53c7: 48 8d 37 lea (%rdi),%rsi 53ca: e8 00 00 00 00 call 53cf <...> 53cb: R_X86_64_PLT32 this_cpu_cmpxchg16b_emu-0x4 53cf: 75 bb jne 538c <...> reducing the size of mm/slub.o by 80 bytes: text data bss dec hex filename 39758 5337 4208 49303 c097 slub-new.o 39838 5337 4208 49383 c0e7 slub-old.o Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230906185941.53527-1-ubizjak@gmail.com commit 81995ee1620318b4c7bbeb02bcc372da2c078c76 Author: Jani Nikula Date: Thu Sep 14 16:11:59 2023 +0300 drm: bridge: it66121: ->get_edid callback must not return err pointers The drm stack does not expect error valued pointers for EDID anywhere. Fixes: e66856508746 ("drm: bridge: it66121: Set DDC preamble only once before reading EDID") Cc: Paul Cercueil Cc: Robert Foss Cc: Phong LE Cc: Neil Armstrong Cc: Andrzej Hajda Cc: Robert Foss Cc: Laurent Pinchart Cc: Jonas Karlman Cc: Jernej Skrabec Cc: # v6.3+ Signed-off-by: Jani Nikula Reviewed-by: Neil Armstrong Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20230914131159.2472513-1-jani.nikula@intel.com commit dda5b055e4b4d77c53debe559d74a59a9e32d4de Author: Herbert Xu Date: Wed Aug 23 18:15:24 2023 +0800 chelsio: Do not include crypto/algapi.h The header file crypto/algapi.h is for internal use only. Use the header file crypto/utils.h instead. Signed-off-by: Herbert Xu commit fb3bc06ad85e5b1f1d8616607beca4649c9d75f4 Author: Herbert Xu Date: Tue Aug 22 17:38:49 2023 +0800 KEYS: encrypted: Do not include crypto/algapi.h The header file crypto/algapi.h is for internal use only. Use the header file crypto/utils.h instead. Acked-by: Mimi Zohar Signed-off-by: Herbert Xu commit aa7c98b1243773ea4a1a107d3a6b7df51ece180f Author: Herbert Xu Date: Tue Aug 22 17:37:13 2023 +0800 evm: Do not include crypto/algapi.h The header file crypto/algapi.h is for internal use only. Use the header file crypto/utils.h instead. Acked-by: Mimi Zohar Signed-off-by: Herbert Xu commit 7b5fad7cffc8e660e4361127a965d545cdfc4fc7 Author: Herbert Xu Date: Tue Aug 22 17:36:16 2023 +0800 SUNRPC: Do not include crypto/algapi.h The header file crypto/algapi.h is for internal use only. Use the header file crypto/utils.h instead. Acked-by: Chuck Lever Signed-off-by: Herbert Xu commit bd5af65465c1f9659351ec50bcf167d4966e76d0 Author: Herbert Xu Date: Tue Aug 22 17:34:10 2023 +0800 mptcp: Do not include crypto/algapi.h The header file crypto/algapi.h is for internal use only. Use the header file crypto/utils.h instead. Acked-by: Matthieu Baerts Signed-off-by: Herbert Xu commit c66218ccf03bcf1986d5b52c3f6726c8b41e59e5 Author: Herbert Xu Date: Tue Aug 22 17:30:21 2023 +0800 ah: Do not include crypto/algapi.h The header file crypto/algapi.h is for internal use only. Use the header file crypto/utils.h instead. Signed-off-by: Herbert Xu commit 2defbea39d23badc06c09401429254c24e4729b4 Author: Herbert Xu Date: Tue Aug 22 17:26:25 2023 +0800 Bluetooth: Do not include crypto/algapi.h The header file crypto/algapi.h is for internal use only. Use the header file crypto/utils.h instead. Acked-by: Luiz Augusto von Dentz Signed-off-by: Herbert Xu commit 8622bd190ad5245c2966b965158d90a7c53d96c3 Author: Herbert Xu Date: Tue Aug 22 17:23:58 2023 +0800 ubifs: Do not include crypto/algapi.h The header file crypto/algapi.h is for internal use only. Use the header file crypto/utils.h instead. Signed-off-by: Herbert Xu commit 82d1c16c8f8228f0632602d89551b1123fb4a768 Author: Herbert Xu Date: Tue Aug 22 17:21:11 2023 +0800 fscrypt: Do not include crypto/algapi.h The header file crypto/algapi.h is for internal use only. Use the header file crypto/utils.h instead. Acked-by: Eric Biggers Signed-off-by: Herbert Xu commit 464bd8ec2f06707f3773676a1bd2c64832a3c805 Author: Jonas Gorski Date: Sun Sep 10 10:34:17 2023 +0200 hwrng: geode - fix accessing registers When the membase and pci_dev pointer were moved to a new struct in priv, the actual membase users were left untouched, and they started reading out arbitrary memory behind the struct instead of registers. This unfortunately turned the RNG into a constant number generator, depending on the content of what was at that offset. To fix this, update geode_rng_data_{read,present}() to also get the membase via amd_geode_priv, and properly read from the right addresses again. Fixes: 9f6ec8dc574e ("hwrng: geode - Fix PCI device refcount leak") Reported-by: Timur I. Davletshin Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217882 Tested-by: Timur I. Davletshin Suggested-by: Jo-Philipp Wich Signed-off-by: Jonas Gorski Signed-off-by: Herbert Xu commit 453b3d0278d73e355bedce47147663070004e807 Author: Herbert Xu Date: Fri Sep 8 17:21:13 2023 +0800 hwrng: octeon - Fix warnings on 32-bit platforms Use unsigned long instead of u64 to silence compile warnings on 32-bit platforms. Also remove the __force bit which seems no longer needed with a current sparse. Signed-off-by: Herbert Xu commit 0470bb1b71ac1f05055b10bdc791953209a7976b Author: Mario Limonciello Date: Thu Sep 7 13:48:46 2023 -0500 crypto: ccp - Add support for DBC over PSP mailbox On some SOCs DBC is supported through the PSP mailbox instead of the platform mailbox. This capability is advertised in the PSP capabilities register. Allow using this communication path if supported. Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit 3d5845e18066990ede565ffe2975e6d89786da50 Author: Mario Limonciello Date: Thu Sep 7 13:48:45 2023 -0500 crypto: ccp - Add a macro to check capabilities register Offsets are checked by the capabilities register in multiple places. To make the code more readable add a macro. Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit 2ac85e22e1473775020ef6850c993bcb43957741 Author: Mario Limonciello Date: Thu Sep 7 13:48:44 2023 -0500 crypto: ccp - Add a communication path abstraction for DBC DBC is currently accessed only from the platform access mailbox and a lot of that implementation's communication path is intertwined with DBC. Add an abstraction layer for pointers into the mailbox. No intended functional changes. Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit 6e17375c47a325f79e1f80028344bd4b0bdd985b Author: Mario Limonciello Date: Thu Sep 7 13:48:43 2023 -0500 crypto: ccp - Add support for extended PSP mailbox commands The PSP mailbox supports a number of extended sub-commands. These subcommands are placed in the header of the buffer sent to the mailbox. Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit 949a0c8dd3c257730ef7205be759e4bc6cf49cea Author: Tom Lendacky Date: Thu Sep 7 13:48:42 2023 -0500 crypto: ccp - Move direct access to some PSP registers out of TEE With the PSP mailbox registers supporting more than just TEE, access to them must be maintained and serialized by the PSP device support. Remove TEE support direct access and create an interface in the PSP support where the register access can be controlled/serialized. Signed-off-by: Tom Lendacky Signed-off-by: Mario Limonciello Reviewed-by: Rijo Thomas Tested-by: Rijo Thomas Signed-off-by: Herbert Xu commit b58a36008bfa1aadf55f516bcbfae40c779eb54b Author: Stefan Wahren Date: Wed Sep 6 01:27:57 2023 +0200 hwrng: bcm2835 - Fix hwrng throughput regression The last RCU stall fix caused a massive throughput regression of the hwrng on Raspberry Pi 0 - 3. hwrng_msleep doesn't sleep precisely enough and usleep_range doesn't allow scheduling. So try to restore the best possible throughput by introducing hwrng_yield which interruptable sleeps for one jiffy. Some performance measurements on Raspberry Pi 3B+ (arm64/defconfig): sudo dd if=/dev/hwrng of=/dev/null count=1 bs=10000 cpu_relax ~138025 Bytes / sec hwrng_msleep(1000) ~13 Bytes / sec hwrng_yield ~2510 Bytes / sec Fixes: 96cb9d055445 ("hwrng: bcm2835 - use hwrng_msleep() instead of cpu_relax()") Link: https://lore.kernel.org/linux-arm-kernel/bc97ece5-44a3-4c4e-77da-2db3eb66b128@gmx.net/ Signed-off-by: Stefan Wahren Reviewed-by: Jason A. Donenfeld Signed-off-by: Herbert Xu commit c977950146720abff14e46d8c53f5638b06a9182 Author: Christophe JAILLET Date: Mon Sep 4 22:17:29 2023 +0200 crypto: hisilicon/hpre - Fix a erroneous check after snprintf() This error handling looks really strange. Check if the string has been truncated instead. Fixes: 02ab994635eb ("crypto: hisilicon - Fixed some tiny bugs of HPRE") Signed-off-by: Christophe JAILLET Signed-off-by: Herbert Xu commit 8f4f68e788c3a7a696546291258bfa5fdb215523 Author: Lu Jialin Date: Mon Sep 4 13:33:41 2023 +0000 crypto: pcrypt - Fix hungtask for PADATA_RESET We found a hungtask bug in test_aead_vec_cfg as follows: INFO: task cryptomgr_test:391009 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. Call trace: __switch_to+0x98/0xe0 __schedule+0x6c4/0xf40 schedule+0xd8/0x1b4 schedule_timeout+0x474/0x560 wait_for_common+0x368/0x4e0 wait_for_completion+0x20/0x30 wait_for_completion+0x20/0x30 test_aead_vec_cfg+0xab4/0xd50 test_aead+0x144/0x1f0 alg_test_aead+0xd8/0x1e0 alg_test+0x634/0x890 cryptomgr_test+0x40/0x70 kthread+0x1e0/0x220 ret_from_fork+0x10/0x18 Kernel panic - not syncing: hung_task: blocked tasks For padata_do_parallel, when the return err is 0 or -EBUSY, it will call wait_for_completion(&wait->completion) in test_aead_vec_cfg. In normal case, aead_request_complete() will be called in pcrypt_aead_serial and the return err is 0 for padata_do_parallel. But, when pinst->flags is PADATA_RESET, the return err is -EBUSY for padata_do_parallel, and it won't call aead_request_complete(). Therefore, test_aead_vec_cfg will hung at wait_for_completion(&wait->completion), which will cause hungtask. The problem comes as following: (padata_do_parallel) | rcu_read_lock_bh(); | err = -EINVAL; | (padata_replace) | pinst->flags |= PADATA_RESET; err = -EBUSY | if (pinst->flags & PADATA_RESET) | rcu_read_unlock_bh() | return err In order to resolve the problem, we replace the return err -EBUSY with -EAGAIN, which means parallel_data is changing, and the caller should call it again. v3: remove retry and just change the return err. v2: introduce padata_try_do_parallel() in pcrypt_aead_encrypt and pcrypt_aead_decrypt to solve the hungtask. Signed-off-by: Lu Jialin Signed-off-by: Guo Zihua Signed-off-by: Herbert Xu commit 6b36dafedd53276a8fb7d7a12ee549560e48b8ee Author: Danny Tsen Date: Wed Aug 30 09:49:11 2023 -0400 crypto: vmx - Improved AES/XTS performance of 6-way unrolling for ppc Improve AES/XTS performance of 6-way unrolling for PowerPC up to 17% with tcrypt. This is done by using one instruction, vpermxor, to replace xor and vsldoi. The same changes were applied to OpenSSL code and a pull request was submitted. This patch has been tested with the kernel crypto module tcrypt.ko and has passed the selftest. The patch is also tested with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS enabled. Signed-off-by: Danny Tsen Signed-off-by: Herbert Xu commit 65029eec5ceba7d847f27171cdddb046bdc3a069 Author: Jinjie Ruan Date: Wed Aug 30 15:54:51 2023 +0800 crypto: qat - Use list_for_each_entry() helper Convert list_for_each() to list_for_each_entry() so that the list_itr list_head pointer and list_entry() call are no longer needed, which can reduce a few lines of code. No functional changed. Signed-off-by: Jinjie Ruan Reviewed-by: Andy Shevchenko Acked-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 7b3c2348d314a18f6ed84bab67023ae5d1ec6b1e Author: Mario Limonciello Date: Tue Aug 29 10:07:59 2023 -0500 crypto: ccp - Fix some unfused tests Some of the tests for unfused parts referenced a named member parameter, but when the test suite was switched to call a python ctypes library they weren't updated. Adjust them to refer to the first argument of the process_param() call and set the data type of the signature appropriately. Fixes: 15f8aa7bb3e5 ("crypto: ccp - Add unit tests for dynamic boost control") Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit 2ad01eb5fad24627ab4e196dc54a220753b2238b Author: Mario Limonciello Date: Tue Aug 29 10:07:58 2023 -0500 crypto: ccp - Fix sample application signature passing When parameters are sent the PSP returns back it's own signature for the application to verify the authenticity of the result. Display this signature to the caller instead of the one the caller sent. Fixes: f40d42f116cf ("crypto: ccp - Add a sample python script for Dynamic Boost Control") Fixes: febe3ed3222f ("crypto: ccp - Add a sample library for ioctl use") Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit 70f242c1933e9e881c13c31640bb6d56e8b7e738 Author: Mario Limonciello Date: Tue Aug 29 10:07:57 2023 -0500 crypto: ccp - Fix DBC sample application error handling The sample application was taking values from ioctl() and treating those as the error codes to present to a user. This is incorrect when ret is non-zero, the error is stored to `errno`. Use this value instead. Fixes: f40d42f116cf ("crypto: ccp - Add a sample python script for Dynamic Boost Control") Fixes: febe3ed3222f ("crypto: ccp - Add a sample library for ioctl use") Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit 7f71c3e033824e1da237916a1885e3c0699f86b2 Author: Mario Limonciello Date: Tue Aug 29 10:07:56 2023 -0500 crypto: ccp - Fix ioctl unit tests A local environment change was importing ioctl_opt which is required for ioctl tests to pass. Add the missing import for it. Fixes: 15f8aa7bb3e5 ("crypto: ccp - Add unit tests for dynamic boost control") Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit 53f7f779f45cbe1771bc4ae05f0320e204a18611 Author: Mario Limonciello Date: Tue Aug 29 10:07:55 2023 -0500 crypto: ccp - Get a free page to use while fetching initial nonce dbc_dev_init() gets a free page from `GFP_KERNEL`, but if that page has any data in it the first nonce request will fail. This prevents dynamic boost control from probing. To fix this, explicitly request a zeroed page with `__GFP_ZERO` to ensure first nonce fetch works. Fixes: c04cf9e14f10 ("crypto: ccp - Add support for fetching a nonce for dynamic boost control") Signed-off-by: Mario Limonciello Signed-off-by: Herbert Xu commit 7ba98583448b7a0dbfa8121c7be642651e0abd61 Author: Giovanni Cabiddu Date: Tue Aug 29 11:13:57 2023 +0100 Documentation: ABI: debugfs-driver-qat: fix fw_counters path The debugfs description for fw_counters reports an incorrect path indicating a qat folder that does not exist. Fix it. Fixes: 865b50fe6ea8 ("crypto: qat - add fw_counters debugfs file") Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 3cf755995e49df0cfac9377970c4c507b4a18ca4 Author: Andrei Coardos Date: Mon Aug 28 13:29:43 2023 +0300 hwrng: xiphera - removed unnneded platform_set_drvdata() This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file. Signed-off-by: Andrei Coardos Reviewed-by: Alexandru Ardelean Signed-off-by: Herbert Xu commit 4ff6244696eed0f08398ca500758c85d4b935094 Author: Andrei Coardos Date: Mon Aug 28 13:23:29 2023 +0300 hwrng: xgene - removed unneeded call to platform_set_drvdata() This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file. Signed-off-by: Andrei Coardos Reviewed-by: Martin Kaiser Reviewed-by: Alexandru Ardelean Signed-off-by: Herbert Xu commit c7e2c4b37e6d54db92a7e74f7e4c015be33601a3 Author: Andrei Coardos Date: Mon Aug 28 13:17:57 2023 +0300 hwrng: mpfs - removed unneeded call to platform_set_drvdata() This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file. Signed-off-by: Andrei Coardos Acked-by: Conor Dooley Reviewed-by: Alexandru Ardelean Signed-off-by: Herbert Xu commit 0a596b0682a7ce37e26c36629816f105c6459d06 Author: Herbert Xu Date: Sat Aug 26 16:36:41 2023 +0800 KEYS: Include linux/errno.h in linux/verification.h Add inclusion of linux/errno.h as otherwise the reference to EINVAL may be invalid. Fixes: f3cf4134c5c6 ("bpf: Add bpf_lookup_*_key() and bpf_key_put() kfuncs") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202308261414.HKw1Mrip-lkp@intel.com/ Signed-off-by: Herbert Xu commit d44f588eb12a0e338a6629ee92fd6e53182b99ad Author: Martin Kaiser Date: Thu Aug 24 21:57:40 2023 +0200 hwrng: st - add MODULE_DESCRIPTION Add a MODULE_DESCRIPTION to fix the W=1 warning WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/char/hw_random/st-rng.o Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit 6007d34fce334bf4c8da70d3bc4ebcdf37172ed3 Author: Martin Kaiser Date: Thu Aug 24 21:56:58 2023 +0200 hwrng: nomadik - add MODULE_DESCRIPTION Add a MODULE_DESCRIPTION to fix the W=1 warning WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/char/hw_random/nomadik-rng.o Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit 337be41e07a6a32029d14306d71f764f0f80e318 Author: Martin Kaiser Date: Thu Aug 24 21:40:37 2023 +0200 hwrng: ks-sa - use dev_err_probe Replace dev_err + return with dev_err_probe. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit 2db18098d5ad99306b48146e77c51584fcfe5991 Author: Martin Kaiser Date: Thu Aug 24 21:40:36 2023 +0200 hwrng: ks-sa - remove dev from struct ks_sa_rng dev in struct ks_sa_rng is not used. Remove it. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit b8f836cbe12bccf2beeadd638e1696f4acaa39c3 Author: Martin Kaiser Date: Thu Aug 24 21:40:35 2023 +0200 hwrng: ks-sa - access private data via struct hwrng This driver uses a struct ks_sa_rng for its private data. It contains a struct hwrng. Call container_of to get from hwrng to ks_sa_rng. Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu commit d90dde8c550f6fcf8856b3c88226d774b038bf89 Author: Herbert Xu Date: Thu Aug 24 13:17:45 2023 +0800 wireguard: do not include crypto/algapi.h The header file crypto/algapi.h is for internal use only. Use the header file crypto/utils.h instead. Acked-by: Jason A. Donenfeld Signed-off-by: Herbert Xu commit 9d2c1a985b1dda6fbb5c256862b8e80b92cf51e6 Author: Andrei Coardos Date: Wed Aug 23 14:21:39 2023 +0300 hwrng: hisi - removed unneeded call to platform_set_drvdata() This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file. Signed-off-by: Andrei Coardos Reviewed-by: Martin Kaiser Reviewed-by: Alexandru Ardelean Signed-off-by: Herbert Xu commit 75b2d50d0d7ffae34eefa5a31d8c6ae84496dfd0 Author: Andrei Coardos Date: Wed Aug 23 14:15:55 2023 +0300 hwrng: bcm2835 - removed call to platform_set_drvdata() This function call was found to be unnecessary as there is no equivalent platform_get_drvdata() call to access the private data of the driver. Also, the private data is defined in this driver, so there is no risk of it being accessed outside of this driver file. Signed-off-by: Andrei Coardos Reviewed-by: Martin Kaiser Reviewed-by: Alexandru Ardelean Signed-off-by: Herbert Xu commit 0c35ac18256942e66d8dab6ca049185812e60c69 Author: Mika Westerberg Date: Fri Aug 25 10:10:35 2023 +0300 thunderbolt: Apply USB 3.x bandwidth quirk only in software connection manager This is not needed when firmware connection manager is run so limit this to software connection manager. Signed-off-by: Mika Westerberg commit 7c192ce9ff1d93f004fa6cdc0f567f5ab3dd4feb Author: Linus Walleij Date: Tue Sep 12 23:24:18 2023 +0200 net: dsa: rtl8366rb: Implement setting up link on CPU port We auto-negotiate most ports in the RTL8366RB driver, but the CPU port is hard-coded to 1Gbit, full duplex, tx and rx pause. This isn't very nice. People may configure speed and duplex differently in the device tree. Actually respect the arguments passed to the function for the CPU port, which get passed properly after Russell's patch "net: dsa: realtek: add phylink_get_caps implementation" After this the link is still set up properly. Signed-off-by: Linus Walleij Reviewed-by: Alvin Šipraga Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 35293cb392e6823e35917229c2a9ea01f3176d96 Author: Hariprasad Kelam Date: Tue Sep 12 23:21:16 2023 +0530 octeontx2-pf: Enable PTP PPS output support PTP block supports generating PPS output signal on GPIO pin. This patch adds the support in the PTP PHC driver using standard periodic output interface. User can enable/disable/configure PPS by writing to the below sysfs entry echo perout.index start.sec start.nsec period.sec period.nsec > /sys/class/ptp/ptp0/period Example to generate 50% duty cycle PPS signal: echo 0 0 0 0 500000000 > /sys/class/ptp/ptp0/period Signed-off-by: Hariprasad Kelam Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: Sai Krishna Acked-by: Richard Cochran Signed-off-by: David S. Miller commit e73d5fb75d67538b13fe04d14a55f32ea4efe227 Merge: f2fa1c812c91e 859f8b265fc2a Author: David S. Miller Date: Fri Sep 15 10:33:49 2023 +0100 Merge branch 'ipv6-data-races' Eric Dumazet says: ==================== ipv6: round of data-races fixes This series is inspired by one related syzbot report. Many inet6_sk(sk) fields reads or writes are racy. Move 1-bit fields to inet->inet_flags to provide atomic safety. inet6_{test|set|clear|assign}_bit() helpers could be changed later if we need to make room in inet_flags. Also add missing READ_ONCE()/WRITE_ONCE() when lockless readers need access to specific fields. np->srcprefs will be handled separately to avoid merge conflicts because a prior patch was posted for net tree. ==================== Signed-off-by: David S. Miller commit 859f8b265fc2a11af0fb0c52b4087e0409250592 Author: Eric Dumazet Date: Tue Sep 12 16:02:12 2023 +0000 ipv6: lockless IPV6_FLOWINFO_SEND implementation np->sndflow reads are racy. Use one bit ftom atomic inet->inet_flags instead, IPV6_FLOWINFO_SEND setsockopt() can be lockless. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 6b724bc4300b431443f3b99520994a5aece347cd Author: Eric Dumazet Date: Tue Sep 12 16:02:11 2023 +0000 ipv6: lockless IPV6_MTU_DISCOVER implementation Most np->pmtudisc reads are racy. Move this 3bit field on a full byte, add annotations and make IPV6_MTU_DISCOVER setsockopt() lockless. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 83cd5eb654b320c1972254f243531f3f3cebcccf Author: Eric Dumazet Date: Tue Sep 12 16:02:10 2023 +0000 ipv6: lockless IPV6_ROUTER_ALERT_ISOLATE implementation Reads from np->rtalert_isolate are racy. Move this flag to inet->inet_flags to fix data-races. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 3cccda8db2cf2f2a224d55d5b6e2251d478c58ca Author: Eric Dumazet Date: Tue Sep 12 16:02:09 2023 +0000 ipv6: move np->repflow to atomic flags Move np->repflow to inet->inet_flags to fix data-races. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 3fa29971c69519629370b119b0b618ee88ade6b9 Author: Eric Dumazet Date: Tue Sep 12 16:02:08 2023 +0000 ipv6: lockless IPV6_RECVERR implemetation np->recverr is moved to inet->inet_flags to fix data-races. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 1086ca7cce292bb498d7f8f85f4593c9ef4902b7 Author: Eric Dumazet Date: Tue Sep 12 16:02:07 2023 +0000 ipv6: lockless IPV6_DONTFRAG implementation Move np->dontfrag flag to inet->inet_flags to fix data-races. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 5121516b0c4736b7977d977b239e36d23ec64401 Author: Eric Dumazet Date: Tue Sep 12 16:02:06 2023 +0000 ipv6: lockless IPV6_AUTOFLOWLABEL implementation Move np->autoflowlabel and np->autoflowlabel_set in inet->inet_flags, to fix data-races. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 6559c0ff3bc27d7e4d447d31c1d7e8eae0e959f5 Author: Eric Dumazet Date: Tue Sep 12 16:02:05 2023 +0000 ipv6: lockless IPV6_MULTICAST_ALL implementation Move np->mc_all to an atomic flags to fix data-races. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit dcae74622c051b219ee628669a31716473efda2c Author: Eric Dumazet Date: Tue Sep 12 16:02:04 2023 +0000 ipv6: lockless IPV6_RECVERR_RFC4884 implementation Move np->recverr_rfc4884 to an atomic flag to fix data-races. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 273784d3c5741522199011772651dbb50db8c810 Author: Eric Dumazet Date: Tue Sep 12 16:02:03 2023 +0000 ipv6: lockless IPV6_MINHOPCOUNT implementation Add one missing READ_ONCE() annotation in do_ipv6_getsockopt() and make IPV6_MINHOPCOUNT setsockopt() lockless. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 15f926c4457aa65b1ac83bda1bbdcaad3f48e4e7 Author: Eric Dumazet Date: Tue Sep 12 16:02:02 2023 +0000 ipv6: lockless IPV6_MTU implementation np->frag_size can be read/written without holding socket lock. Add missing annotations and make IPV6_MTU setsockopt() lockless. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 2da23eb07c91241d962f3ff05565065484cd8929 Author: Eric Dumazet Date: Tue Sep 12 16:02:01 2023 +0000 ipv6: lockless IPV6_MULTICAST_HOPS implementation This fixes data-races around np->mcast_hops, and make IPV6_MULTICAST_HOPS lockless. Note that np->mcast_hops is never negative, thus can fit an u8 field instead of s16. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit d986f52124e062753e33b6fe303be5904a997eac Author: Eric Dumazet Date: Tue Sep 12 16:02:00 2023 +0000 ipv6: lockless IPV6_MULTICAST_LOOP implementation Add inet6_{test|set|clear|assign}_bit() helpers. Note that I am using bits from inet->inet_flags, this might change in the future if we need more flags. While solving data-races accessing np->mc_loop, this patch also allows to implement lockless accesses to np->mcast_hops in the following patch. Also constify sk_mc_loop() argument. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit b0adfba7ee770fef20b1b6d86706c28f7fccfb07 Author: Eric Dumazet Date: Tue Sep 12 16:01:59 2023 +0000 ipv6: lockless IPV6_UNICAST_HOPS implementation Some np->hop_limit accesses are racy, when socket lock is not held. Add missing annotations and switch to full lockless implementation. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: David S. Miller commit b618d31f112bea3d2daea19190d63e567f32a4db Author: Ard Biesheuvel Date: Tue Sep 12 09:00:59 2023 +0000 x86/boot: Drop references to startup_64 The x86 boot image generation tool assign a default value to startup_64 and subsequently parses the actual value from zoffset.h but it never actually uses the value anywhere. So remove this code. This change has no impact on the resulting bzImage binary. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230912090051.4014114-25-ardb@google.com commit 7448e8e5d15a3c4df649bf6d6d460f78396f7e1e Author: Ard Biesheuvel Date: Tue Sep 12 09:00:57 2023 +0000 x86/boot: Drop redundant code setting the root device The root device defaults to 0,0 and is no longer configurable at build time [0], so there is no need for the build tool to ever write to this field. [0] 079f85e624189292 ("x86, build: Do not set the root_dev field in bzImage") This change has no impact on the resulting bzImage binary. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230912090051.4014114-23-ardb@google.com commit 8eace5b3555606e684739bef5bcdfcfe68235257 Author: Ard Biesheuvel Date: Tue Sep 12 09:00:56 2023 +0000 x86/boot: Omit compression buffer from PE/COFF image memory footprint Now that the EFI stub decompresses the kernel and hands over to the decompressed image directly, there is no longer a need to provide a decompression buffer as part of the .BSS allocation of the PE/COFF image. It also means the PE/COFF image can be loaded anywhere in memory, and setting the preferred image base is unnecessary. So drop the handling of this from the header and from the build tool. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230912090051.4014114-22-ardb@google.com commit 768171d7ebbce005210e1cf8456f043304805c15 Author: Ard Biesheuvel Date: Tue Sep 12 09:00:55 2023 +0000 x86/boot: Remove the 'bugger off' message Ancient (pre-2003) x86 kernels could boot from a floppy disk straight from the BIOS, using a small real mode boot stub at the start of the image where the BIOS would expect the boot record (or boot block) to appear. Due to its limitations (kernel size < 1 MiB, no support for IDE, USB or El Torito floppy emulation), this support was dropped, and a Linux aware bootloader is now always required to boot the kernel from a legacy BIOS. To smoothen this transition, the boot stub was not removed entirely, but replaced with one that just prints an error message telling the user to install a bootloader. As it is unlikely that anyone doing direct floppy boot with such an ancient kernel is going to upgrade to v6.5+ and expect that this boot method still works, printing this message is kind of pointless, and so it should be possible to remove the logic that emits it. Let's free up this space so it can be used to expand the PE header in a subsequent patch. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Acked-by: H. Peter Anvin (Intel) Link: https://lore.kernel.org/r/20230912090051.4014114-21-ardb@google.com commit bfab35f552ab3dd6d017165bf9de1d1d20f198cc Author: Ard Biesheuvel Date: Tue Sep 12 09:00:54 2023 +0000 x86/efi: Drop alignment flags from PE section headers The section header flags for alignment are documented in the PE/COFF spec as being applicable to PE object files only, not to PE executables such as the Linux bzImage, so let's drop them from the PE header. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230912090051.4014114-20-ardb@google.com commit 7e50262229faad0c7b8c54477cd1c883f31cc4a7 Author: Ard Biesheuvel Date: Tue Sep 12 09:00:53 2023 +0000 x86/efi: Disregard setup header of loaded image The native EFI entrypoint does not take a struct boot_params from the loader, but instead, it constructs one from scratch, using the setup header data placed at the start of the image. This setup header is placed in a way that permits legacy loaders to manipulate the contents (i.e., to pass the kernel command line or the address and size of an initial ramdisk), but EFI boot does not use it in that way - it only copies the contents that were placed there at build time, but EFI loaders will not (and should not) manipulate the setup header to configure the boot. (Commit 63bf28ceb3ebbe76 "efi: x86: Wipe setup_data on pure EFI boot" deals with some of the fallout of using setup_data in a way that breaks EFI boot.) Given that none of the non-zero values that are copied from the setup header into the EFI stub's struct boot_params are relevant to the boot now that the EFI stub no longer enters via the legacy decompressor, the copy can be omitted altogether. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230912090051.4014114-19-ardb@google.com commit 5f51c5d0e905608ba7be126737f7c84a793ae1aa Author: Ard Biesheuvel Date: Tue Sep 12 09:00:52 2023 +0000 x86/efi: Drop EFI stub .bss from .data section Now that the EFI stub always zero inits its BSS section upon entry, there is no longer a need to place the BSS symbols carried by the stub into the .data section. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230912090051.4014114-18-ardb@google.com commit 4de7b17fd05d03fa919e8c47fc66122bd24d7b6c Author: Matthew Wilcox (Oracle) Date: Mon Aug 21 14:44:28 2023 +0100 sched: Assert for_each_thread() is properly locked list_for_each_entry_rcu() takes an optional fourth argument which allows RCU to assert that the correct lock is held. Several callers of for_each_thread() rely on their caller to be holding the appropriate lock, so this is a useful assertion to include. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Ingo Molnar Reviewed-by: Joel Fernandes (Google) Link: https://lore.kernel.org/r/20230821134428.2504912-1-willy@infradead.org commit a3f9e4bc1ec9d8f1e352eb7c1cbaea3168246be7 Merge: 3106c34df6ace 0bb80ecc33a8f Author: Jani Nikula Date: Fri Sep 15 11:23:38 2023 +0300 Merge drm/drm-next into drm-intel-next Sync to v6.6-rc1. Signed-off-by: Jani Nikula commit 5c04433daf9ed8b28d4900112be1fd19e1786b25 Author: Song Liu Date: Thu Sep 14 15:25:42 2023 -0700 bpf: Charge modmem for struct_ops trampoline Current code charges modmem for regular trampoline, but not for struct_ops trampoline. Add bpf_jit_[charge|uncharge]_modmem() to struct_ops so the trampoline is charged in both cases. Signed-off-by: Song Liu Link: https://lore.kernel.org/r/20230914222542.2986059-1-song@kernel.org Signed-off-by: Martin KaFai Lau commit 27801542b2b815dad2759b7b1f85858627671a3b Author: Srinivas Pandruvada Date: Mon Aug 28 17:23:46 2023 -0700 selftests/thermel/intel: Add test to read workload hint Some SoCs have in built firmware support to classify current running workload and pass to OS for making power management decisions. This test program waits for notification of workload type change and prints. This program can be used to test this feature and also allows other user space programs to use as a reference. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit e682b86211a1f6d5f1f6286a4296bcab1b18a4f8 Author: Srinivas Pandruvada Date: Mon Aug 28 17:23:45 2023 -0700 thermal: int340x: Handle workload hint interrupts On thermal device interrupt, if the interrupt is generated for passing workload hint, call the callback to pass notification to the user space. First call proc_thermal_check_wt_intr() to check interrupt, if this callback returns true, wake the IRQ thread to call proc_thermal_wt_intr_callback() to notify user space. Signed-off-by: Srinivas Pandruvada [ rjw: Subject adjustment, changelog edits ] Signed-off-by: Rafael J. Wysocki commit 4b029a81c24e6b249022bab37fa0b61bfcb5c242 Author: Srinivas Pandruvada Date: Mon Aug 28 17:23:44 2023 -0700 thermal: int340x: processor_thermal: Add workload type hint interface Prior to Meteor Lake processor generation, user space can pass workload type request to the firmware. Then firmware can optimize power based on the indicated workload type. User space also uses workload type requests to implement its own heuristics. The firmware in Meteor Lake processor generation is capable of predicting workload type without software help. To avoid duplicate processing, add a sysfs interface allowing user space to obtain the workload hint from the firmware instead of trying to predict the workload type by itself. This workload hint is passed from the firmware via MMIO offset 0x5B18 of the processor thermal PCI device. Before workload hints can be produced by the firmware, it needs to be configured via a mailbox command. This mailbox command turns ON the workload hint and it allows to program a notification delay to control the rate of notifications. The notification delay can be changed from user space vis sysfs. Attribute group 'workload_hint' in sysfs is used for implementing the workload hints interface between user space and the kernel. It contains the following attributes: workload_type_enable: Enables/disables workload type hints from the firmware. notification_delay_ms: Notification delay in milliseconds. workload_type_index: The current workload type index predicted by the firmware (see the documentation changes below for supported index values and their meaning). Signed-off-by: Srinivas Pandruvada [ rjw: Changelog edits, documentation edits, whitespace adjustments ] Signed-off-by: Rafael J. Wysocki commit 2f0b31c02662962b9e51d2a07661089ffddf6bbe Author: Srinivas Pandruvada Date: Mon Aug 28 17:23:43 2023 -0700 thermal: int340x: Remove PROC_THERMAL_FEATURE_WLT_REQ for Meteor Lake Meteor Lake processor supports firmware hints for predicting workload type. So, remove support for passing workload hints to the firmware. Signed-off-by: Srinivas Pandruvada Reviewed-by: Zhang Rui [ rjw: Subject adjustment ] Signed-off-by: Rafael J. Wysocki commit f0658708e8636f64458fe69e0037700ab57124e1 Author: Srinivas Pandruvada Date: Mon Aug 28 17:23:42 2023 -0700 thermal: int340x: processor_thermal: Use non MSI interrupts by default There are issues in using MSI interrupts for processor thermal device. The support is not consistent across generations. But the legacy PCI interrupts work on all current generations. Hence always use legacy PCI interrupts by default, instead of MSI. Add a module param to use of MSI, so that MSI can be still used. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit dd28a3cb92389deb2d5a0ab3e91b97007c8bc366 Author: Srinivas Pandruvada Date: Mon Aug 28 17:23:41 2023 -0700 thermal: int340x: processor_thermal: Add interrupt configuration function Some features like workload type prediction and power floor events require interrupt support to avoid polling. Here interrupts are enabled and disabled via sending mailbox commands. The mailbox command ID is 0x1E for read and 0x1F for write. The interrupt configuration will require mutex protection as it involves read-modify-write operation. Since mutex are already used in the mailbox read/write functions: send_mbox_write_cmd() and send_mbox_read_cmd(), there will be double locking. But, this can be avoided by moving mutexes from mailbox read/write processing functions to the callers: processor_thermal_send_mbox_[read|write]_cmd(). Signed-off-by: Srinivas Pandruvada [ rjw: Adjust subject, fix up computation ] Signed-off-by: Rafael J. Wysocki commit b894685cb8e09305b3cb82bc39f2c4a3d154ce3a Author: Srinivas Pandruvada Date: Mon Aug 28 17:23:40 2023 -0700 thermal: int340x: processor_thermal: Move mailbox code to common module The processor thermal mailbox is used for workload type request and also in the processor thermal RFIM module. So, move the workload type request code to its own module from the current processor thermal mailbox module. processor_thermal_mailbox.c contains only mailbox read/write related source code. The source related to workload_types requests is moved to a module processor_thermal_wt_req.c. In addition - Rename PROC_THERMAL_FEATURE_MBOX to PROC_THERMAL_FEATURE_WT_REQ. - proc_thermal_mbox_add(), which adds workload type sysfs attribute group is renamed to proc_thermal_wt_req_add(). - proc_thermal_mbox_remove() is renamed to proc_thermal_wt_req_remove(). While here, resolve check patch warnings for 100 columns for only modified lines. No functional changes are expected. Signed-off-by: Srinivas Pandruvada Reviewed-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit 20a2aa47097aae7016209c4dbe392b3b25e0d883 Author: Khadija Kamran Date: Wed Aug 23 14:01:28 2023 +0500 lsm: constify 'sb' parameter in security_sb_kern_mount() The "sb_kern_mount" hook has implementation registered in SELinux. Looking at the function implementation we observe that the "sb" parameter is not changing. Mark the "sb" parameter of LSM hook security_sb_kern_mount() as "const" since it will not be changing in the LSM hook. Signed-off-by: Khadija Kamran [PM: minor merge fuzzing due to other constification patches] Signed-off-by: Paul Moore commit a721f7b8c3548e943e514a957f2a37f4763b9888 Author: Khadija Kamran Date: Wed Aug 23 13:16:40 2023 +0500 lsm: constify 'bprm' parameter in security_bprm_committed_creds() Three LSMs register the implementations for the 'bprm_committed_creds()' hook: AppArmor, SELinux and tomoyo. Looking at the function implementations we may observe that the 'bprm' parameter is not changing. Mark the 'bprm' parameter of LSM hook security_bprm_committed_creds() as 'const' since it will not be changing in the LSM hook. Signed-off-by: Khadija Kamran [PM: minor merge fuzzing due to other constification patches] Signed-off-by: Paul Moore commit 971f7c32147f2d0953a815a109b22b8ed45949d4 Author: Artem Savkov Date: Thu Sep 14 14:49:28 2023 +0200 selftests/bpf: Skip module_fentry_shadow test when bpf_testmod is not available This test relies on bpf_testmod, so skip it if the module is not available. Fixes: aa3d65de4b900 ("bpf/selftests: Test fentry attachment to shadowed functions") Signed-off-by: Artem Savkov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20230914124928.340701-1-asavkov@redhat.com commit f5f3bd903a5d3e3b2ba89f11e0e29db25e60c048 Author: Jaegeuk Kim Date: Fri Sep 8 15:41:42 2023 -0700 f2fs: set the default compress_level on ioctl Otherwise, we'll get a broken inode. # touch $FILE # f2fs_io setflags compression $FILE # f2fs_io set_coption 2 8 $FILE [ 112.227612] F2FS-fs (dm-51): sanity_check_compress_inode: inode (ino=8d3fe) has unsupported compress level: 0, run fsck to fix Cc: stable@vger.kernel.org Signed-off-by: Jaegeuk Kim commit f2fa1c812c91e99d0317d1fc7d845e1e05f39716 Merge: 59bb1d698028d 9fdfb15a3dbf8 Author: Paolo Abeni Date: Thu Sep 14 19:48:23 2023 +0200 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. No conflicts. Signed-off-by: Paolo Abeni commit 9af45bbdcbbbb411b6b7440220593a46282fd64b Author: Tanmay Shah Date: Tue Sep 12 19:43:23 2023 -0700 remoteproc: zynqmp: fix TCM carveouts in lockstep mode In lockstep mode following is TCM address map: | *TCM* | *R5 View* | *Linux view* | | R5_0 ATCM (128 KB) | 0x0000_0000 | 0xFFE0_0000 | | R5_0 BTCM (128 KB) | 0x0002_0000 | 0xFFE2_0000 | Current driver keeps single TCM carveout in lockstep mode as ATCM and BTCM addresses form contiguous memory region. Although the addresses are contiguous, it is not same type of memory. ATCM typically holds interrupt or exception code that must be accessed at high speed. BTCM typically holds a block of data for intensive processing, such as audio or video processing. As both are different types of memory, they should be allocated as different carveout. This patch is fixing TCM carveout allocation in lockstep mode. Signed-off-by: Tanmay Shah Link: https://lore.kernel.org/r/20230913024323.2768114-1-tanmay.shah@amd.com Signed-off-by: Mathieu Poirier commit 8fa193412bdced22eb55bf7080716e6501c68881 Merge: 558c50cc3b135 4a5f0ba55f462 Author: Alexei Starovoitov Date: Thu Sep 14 09:47:56 2023 -0700 Merge branch 'seltests-xsk-various-improvements-to-xskxceiver' Magnus Karlsson says: ==================== seltests/xsk: various improvements to xskxceiver This patch set implements several improvements to the xsk selftests test suite that I thought were useful while debugging the xsk multi-buffer code and tests. The largest new feature is the ability to be able to execute a single test instead of the whole test suite. This required some surgery on the current code, details below. Anatomy of the path set: 1: Print useful info on a per packet basis with the option -v 2: Add a timeout in the transmission loop too. We only used to have one for the Rx thread, but Tx can lock up too waiting for completions. 3: Add an option (-m) to only run the tests (or a single test with a later patch) in a single mode: skb, drv, or zc (zero-copy). 4-5: Preparatory patches to be able to specify a test to run. Need to define the test names in a single structure and their entry points, so we can use this when wanting to run a specific test. 6: Adds a command line option (-l) that lists all the tests. 7: Adds a command line option (-t) that runs a specific test instead of the whole test suite. Can be combined with -m to specify a single mode too. 8: Use ksft_print_msg() uniformly throughout the tests. It was a mix of printf() and ksft_print_msg() before. 9: In some places, we failed the whole test suite instead of a single test in certain circumstances. Fix this so only the test in question is failed and the rest of the test suite continues. 10: Display the available command line options with -h v3 -> v4: * Fixed another spelling error in patch #9 [Maciej] * Only allow the actual strings for the -m command [Maciej] * Move some code from patch #7 to #3 [Maciej] v2 -> v3: * Drop the support for environment variables. Probably not useful. [Maciej] * Fixed spelling mistake in patch #9 [Maciej] * Fail gracefully if unsupported mode is chosen [Maciej] * Simplified test run loop [Maciej] v1 -> v2: * Introduce XSKTEST_MODE env variable to be able to set the mode to use [Przemyslaw] * Introduce XSKTEST_ETH env variable to be able to set the ethernet interface to use by introducing a new patch (#11) [Magnus] * Fixed spelling error in patch #5 [Przemyslaw, Maciej] * Fixed confusing documentation in patch #10 [Przemyslaw] * The -l option can now be used without being root [Magnus, Maciej] * Fixed documentation error in patch #7 [Maciej] * Added error handling to the -t option [Maciej] * -h now displayed as an option [Maciej] Thanks: Magnus ==================== Acked-by: Maciej Fijalkowski Link: https://lore.kernel.org/r/20230914084900.492-1-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 4a5f0ba55f4621aed4b22d28e496793e438555e1 Author: Magnus Karlsson Date: Thu Sep 14 10:48:57 2023 +0200 selftests/xsk: display command line options with -h Add the -h option to display all available command line options available for test_xsk.sh and xskxceiver. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230914084900.492-11-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 5fc494d5ab4119967aa967aab0b70bab8bb8b970 Author: Magnus Karlsson Date: Thu Sep 14 10:48:56 2023 +0200 selftests/xsk: fail single test instead of all tests In a number of places at en error, exit_with_error() is called that terminates the whole test suite. This is not always desirable as it would be more logical to only fail that test and then go along with the other ones. So change this in a number of places in which I thought it would be more logical to just fail the test in question. Examples of this are in code that is only used by a single test. Also delete a pointless if-statement in receive_pkts() that has an exit_with_error() in it. It can never occur since the return value is an unsigned and the test is for less than zero. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230914084900.492-10-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 7c3fcf088ba329292d94c03536a8add6c5a84327 Author: Magnus Karlsson Date: Thu Sep 14 10:48:55 2023 +0200 selftests/xsk: use ksft_print_msg uniformly Use ksft_print_msg() instead of printf() and fprintf() in all places as the ksefltests framework is being used. There is only one exception and that is for the list-of-tests print out option, since no tests are run in that case. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230914084900.492-9-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 146e30554a5309b183164b385019b0357ab144dc Author: Magnus Karlsson Date: Thu Sep 14 10:48:54 2023 +0200 selftests/xsk: add option to run single test Add a command line option to be able to run a single test. This option (-t) takes a number from the list of tests available with the "-l" option. Here are two examples: Run test number 2, the "receive single packet" test in all available modes: ./test_xsk.sh -t 2 Run test number 21, the metadata copy test in skb mode only ./test_xsh.sh -t 21 -m skb Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230914084900.492-8-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit c53dab7d39abd46901122fa47d3dce3b482d9c54 Author: Magnus Karlsson Date: Thu Sep 14 10:48:53 2023 +0200 selftests/xsk: add option that lists all tests Add a command line option (-l) that lists all the tests. The number before the test will be used in the next commit for specifying a single test to run. Here is an example of the output: Tests: 0: SEND_RECEIVE 1: SEND_RECEIVE_2K_FRAME 2: SEND_RECEIVE_SINGLE_PKT 3: POLL_RX 4: POLL_TX 5: POLL_RXQ_FULL 6: POLL_TXQ_FULL 7: SEND_RECEIVE_UNALIGNED : : Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230914084900.492-7-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit f20fbcd077eb8f46d6deee46e345fefb1130a181 Author: Magnus Karlsson Date: Thu Sep 14 10:48:52 2023 +0200 selftests/xsk: declare test names in struct Declare the test names statically in a struct so that we can refer to them when adding the support to execute a single test in the next commit. Before this patch, the names of them were not declared in a single place which made it not possible to refer to them. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230914084900.492-6-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 13c341c4508318f77f2c590b9971ac9efec925cc Author: Magnus Karlsson Date: Thu Sep 14 10:48:51 2023 +0200 selftests/xsk: move all tests to separate functions Prepare for the capability to be able to run a single test by moving all the tests to their own functions. This function can then be called to execute that test in the next commit. Also, the tests named RUN_TO_COMPLETION_* were not named well, so change them to SEND_RECEIVE_* as it is just a basic send and receive test of 4K packets. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230914084900.492-5-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 3956bc34b66c99217261def0a1058ebb9cc9b576 Author: Magnus Karlsson Date: Thu Sep 14 10:48:50 2023 +0200 selftests/xsk: add option to only run tests in a single mode Add an option -m on the command line that allows the user to run the tests in a single mode instead of all of them. Valid modes are skb, drv, and zc (zero-copy). An example: To run test suite in drv mode only: ./test_xsk.sh -m drv Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230914084900.492-4-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 64370d7c8a91e65a08f6f5816f108a0485000481 Author: Magnus Karlsson Date: Thu Sep 14 10:48:49 2023 +0200 selftests/xsk: add timeout for Tx thread Add a timeout for the transmission thread. If packets are not completed properly, for some reason, the test harness would previously get stuck forever in a while loop. But with this patch, this timeout will trigger, flag the test as a failure, and continue with the next test. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230914084900.492-3-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit 2d2712caf44b6cc0d571eed01ac13356667f0f8e Author: Magnus Karlsson Date: Thu Sep 14 10:48:48 2023 +0200 selftests/xsk: print per packet info in verbose mode Print info about every packet in verbose mode, both for Tx and Rx. This is useful to have when a test fails or to validate that a test is really doing what it was designed to do. Info on what is supposed to be received and sent is also printed for the custom packet streams since they differ from the base line. Here is an example: Tx addr: 37e0 len: 64 options: 0 pkt_nb: 8 Tx addr: 4000 len: 64 options: 0 pkt_nb: 9 Rx: addr: 100 len: 64 options: 0 pkt_nb: 0 valid: 1 Rx: addr: 1100 len: 64 options: 0 pkt_nb: 1 valid: 1 Rx: addr: 2100 len: 64 options: 0 pkt_nb: 4 valid: 1 Rx: addr: 3100 len: 64 options: 0 pkt_nb: 8 valid: 1 Rx: addr: 4100 len: 64 options: 0 pkt_nb: 9 valid: 1 One pointless verbose print statement is also deleted and another one is made clearer. Signed-off-by: Magnus Karlsson Link: https://lore.kernel.org/r/20230914084900.492-2-magnus.karlsson@gmail.com Signed-off-by: Alexei Starovoitov commit d51f9fbd98b6d88aef4f6431bbb575378a6c7a24 Author: Javier Martinez Canillas Date: Wed Sep 13 07:29:25 2023 +0200 drm/ssd130x: Store the HW buffer in the driver-private CRTC state The commit 45b58669e532 ("drm/ssd130x: Allocate buffer in the plane's .atomic_check() callback") moved the allocation of the intermediate and HW buffers from the encoder's .atomic_enable callback, to the plane's .atomic_check callback. This was suggested by Maxime Ripard, because drivers aren't allowed to fail after the drm_atomic_helper_swap_state() function has been called. And the encoder's .atomic_enable happens after the new atomic state has been swapped, so allocations (that can fail) shouldn't be done there. But the HW buffer isn't really tied to the plane's state. It has a fixed size that only depends on the (also fixed) display resolution defined in the Device Tree Blob. That buffer can be considered part of the CRTC state, and for this reason makes more sense to do its allocation in the CRTC .atomic_check callback. The other allocated buffer (used to store a conversion from the emulated XR24 format to the native R1 format) is part of the plane's state, since it will be optional once the driver supports R1 and allows user-space to set that pixel format. So let's keep the allocation for it in the plane's .atomic_check callback, this can't be moved to the CRTC's .atomic_check because changing a format does not trigger a CRTC mode set. Reported-by: Geert Uytterhoeven Closes: https://lore.kernel.org/dri-devel/CAMuHMdWv_QSatDgihr8=2SXHhvp=icNxumZcZOPwT9Q_QiogNQ@mail.gmail.com/ Signed-off-by: Javier Martinez Canillas Acked-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230913052938.1114651-1-javierm@redhat.com commit bc7fbb5ea701b22c09c0fa5acbc122207283366a Author: Bartosz Golaszewski Date: Wed Sep 13 21:28:26 2023 +0200 firmware: qcom-scm: order includes alphabetically For easier maintenance order the included headers in qcom_scm.c alphabetically. Signed-off-by: Bartosz Golaszewski Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230913192826.36187-2-bartosz.golaszewski@linaro.org Signed-off-by: Bjorn Andersson commit 2758ac3a11d78af56e6969af04dec611806a62de Author: Bartosz Golaszewski Date: Wed Sep 13 21:28:25 2023 +0200 firmware: qcom-scm: drop unneeded 'extern' specifiers The 'extern' specifier in front of a function declaration has no effect. Remove all of them from the qcom-scm header. Signed-off-by: Bartosz Golaszewski Reviewed-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230913192826.36187-1-bartosz.golaszewski@linaro.org Signed-off-by: Bjorn Andersson commit 1769142a14c34a8acd67657bc3e637f22f75e026 Author: Maximilian Weigand Date: Wed Jun 14 20:10:43 2023 +0200 power: supply: rk817: query battery properties right after resume The driver reads battery properties every 8 seconds. In order to prevent problems with wrong property values right after resume, trigger an update of those properties on resuming the system and restart the 8-second interval from there. Signed-off-by: Maximilian Weigand Link: https://lore.kernel.org/r/20230601-rk817_query_at_resume-v1-1-630b0adefbd9@mweigand.net Signed-off-by: Sebastian Reichel commit 59bb1d698028d7f01650f9def579efdfdfb7039f Author: Gavrilov Ilia Date: Tue Sep 12 08:42:49 2023 +0000 ipv6: mcast: Remove redundant comparison in igmp6_mcf_get_next() The 'state->im' value will always be non-zero after the 'while' statement, so the check can be removed. Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Gavrilov Ilia Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20230912084100.1502379-1-Ilia.Gavrilov@infotecs.ru Signed-off-by: Paolo Abeni commit a613ed1afd9696ab6d235c0dab5f557863b94bc8 Author: Gavrilov Ilia Date: Tue Sep 12 08:42:34 2023 +0000 ipv4: igmp: Remove redundant comparison in igmp_mcf_get_next() The 'state->im' value will always be non-zero after the 'while' statement, so the check can be removed. Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Gavrilov Ilia Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20230912084039.1501984-1-Ilia.Gavrilov@infotecs.ru Signed-off-by: Paolo Abeni commit 01e76ee227564008d71ddce6e43132b36d2d2252 Author: Richard Fitzgerald Date: Thu Sep 14 16:09:18 2023 +0100 ASoC: cs35l56: Omit cs35l56_pm_ops_i2c_spi if I2C/SPI not enabled The cs35l56_pm_ops_i2c_spi struct is only needed if either the I2C or SPI modules are selected for building. Otherwise it would be unused bytes, so in that case omit it. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20230914150918.14505-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 6399eb58254b98bbe42c9d14e07c50e1c3d9f8cd Author: Richard Fitzgerald Date: Thu Sep 14 16:09:17 2023 +0100 ASoC: cs35l56: Use new export macro for dev_pm_ops pm.h now has macros to create and export the dev_pm_ops struct only if CONFIG_PM is enabled. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20230914150918.14505-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 3d3a86679541044a65ea23175cb95206921c8fe2 Author: Richard Fitzgerald Date: Thu Sep 14 16:09:16 2023 +0100 ASoC: cs35l56: Use pm_ptr() Use pm_ptr() when setting the pointer to the dev_pm_ops so that it will be NULL if CONFIG_PM is disabled. This allows the dev_pm_ops to be compiled out in that case. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20230914150918.14505-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 642d1de63cea161c629afd2e82d9db5a1582ffea Author: Yong Zhi Date: Thu Sep 14 16:03:03 2023 +0300 ASoC: SOF: ipc4-topology: Add deep buffer size to debug prints Print deep_buffer_dma_ms and dma_buffer_size for debug purpose. Signed-off-by: Yong Zhi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230914130303.13636-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit f7d67a9c254829930355d675e989c0dfa884242c Author: Peter Ujfalusi Date: Thu Sep 14 15:51:15 2023 +0300 ASoC: SOF: ipc4: Dump the payload also when set_get_data fails Move the out label to dump the message payload when the IPC message fails. The payload contains important information on what might have caused the error in firmware. Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230914125115.30904-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 814755c48f8b2c3e83b3c11535c48ab416128978 Author: Svyatoslav Ryhel Date: Mon Jul 31 10:36:12 2023 +0300 power: max17040: get thermal data from adc if available Since fuel gauge does not support thermal monitoring, some vendors may couple this fuel gauge with thermal/adc sensor to monitor battery cell exact temperature. Add this feature by adding optional iio thermal channel. Signed-off-by: Svyatoslav Ryhel Reviewed-by: Iskren Chernev Link: https://lore.kernel.org/r/20230731073613.10394-4-clamor95@gmail.com Signed-off-by: Sebastian Reichel commit f4b782af61ae7bbf93008d5809b0e3a8ac2bb88e Author: Svyatoslav Ryhel Date: Mon Jul 31 10:36:11 2023 +0300 power: max17040: pass status property from supplier Optionally pass status property from supplier if has support for it. If cell is online assume it is present as well. Signed-off-by: Svyatoslav Ryhel Reviewed-by: Iskren Chernev Link: https://lore.kernel.org/r/20230731073613.10394-3-clamor95@gmail.com Signed-off-by: Sebastian Reichel commit ddf5bbee5fa6cb157ecef4fe5263f3f36635e1c3 Author: Svyatoslav Ryhel Date: Mon Jul 31 10:36:10 2023 +0300 dt-bindings: power: supply: maxim,max17040: add temperature support Add temperature monitoring support. Signed-off-by: Svyatoslav Ryhel Reviewed-by: Krzysztof Kozlowski Reviewed-by: Iskren Chernev Link: https://lore.kernel.org/r/20230731073613.10394-2-clamor95@gmail.com Signed-off-by: Sebastian Reichel commit 4e519fb4ee7b838d46865cdf57b647efcbff42a7 Merge: 486e6ca6b48d6 882af43a0fc37 Author: Paolo Abeni Date: Thu Sep 14 16:16:41 2023 +0200 Merge branch 'udp-round-of-data-races-fixes' Eric Dumazet says: ==================== udp: round of data-races fixes This series is inspired by multiple syzbot reports. Many udp fields reads or writes are racy. Add a proper udp->udp_flags and move there all flags needing atomic safety. Also add missing READ_ONCE()/WRITE_ONCE() when lockless readers need access to specific fields. ==================== Link: https://lore.kernel.org/r/20230912091730.1591459-1-edumazet@google.com Signed-off-by: Paolo Abeni commit 882af43a0fc37e26d85fb0df0c9edd3bed928de4 Author: Eric Dumazet Date: Tue Sep 12 09:17:30 2023 +0000 udplite: fix various data-races udp->pcflag, udp->pcslen and udp->pcrlen reads/writes are racy. Move udp->pcflag to udp->udp_flags for atomicity, and add READ_ONCE()/WRITE_ONCE() annotations for pcslen and pcrlen. Fixes: ba4e58eca8aa ("[NET]: Supporting UDP-Lite (RFC 3828) in Linux") Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Signed-off-by: Paolo Abeni commit 729549aa350c56a777bb342941ed4d69b6585769 Author: Eric Dumazet Date: Tue Sep 12 09:17:29 2023 +0000 udplite: remove UDPLITE_BIT This flag is set but never read, we can remove it. Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Signed-off-by: Paolo Abeni commit 70a36f571362a8de8b8c02d21ae524fc776287f2 Author: Eric Dumazet Date: Tue Sep 12 09:17:28 2023 +0000 udp: annotate data-races around udp->encap_type syzbot/KCSAN complained about UDP_ENCAP_L2TPINUDP setsockopt() racing. Add READ_ONCE()/WRITE_ONCE() to document races on this lockless field. syzbot report was: BUG: KCSAN: data-race in udp_lib_setsockopt / udp_lib_setsockopt read-write to 0xffff8881083603fa of 1 bytes by task 16557 on cpu 0: udp_lib_setsockopt+0x682/0x6c0 udp_setsockopt+0x73/0xa0 net/ipv4/udp.c:2779 sock_common_setsockopt+0x61/0x70 net/core/sock.c:3697 __sys_setsockopt+0x1c9/0x230 net/socket.c:2263 __do_sys_setsockopt net/socket.c:2274 [inline] __se_sys_setsockopt net/socket.c:2271 [inline] __x64_sys_setsockopt+0x66/0x80 net/socket.c:2271 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd read-write to 0xffff8881083603fa of 1 bytes by task 16554 on cpu 1: udp_lib_setsockopt+0x682/0x6c0 udp_setsockopt+0x73/0xa0 net/ipv4/udp.c:2779 sock_common_setsockopt+0x61/0x70 net/core/sock.c:3697 __sys_setsockopt+0x1c9/0x230 net/socket.c:2263 __do_sys_setsockopt net/socket.c:2274 [inline] __se_sys_setsockopt net/socket.c:2271 [inline] __x64_sys_setsockopt+0x66/0x80 net/socket.c:2271 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0x01 -> 0x05 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 16554 Comm: syz-executor.5 Not tainted 6.5.0-rc7-syzkaller-00004-gf7757129e3de #0 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: syzbot Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Signed-off-by: Paolo Abeni commit ac9a7f4ce5dda1472e8f44096f33066c6ec1a3b4 Author: Eric Dumazet Date: Tue Sep 12 09:17:27 2023 +0000 udp: lockless UDP_ENCAP_L2TPINUDP / UDP_GRO Move udp->encap_enabled to udp->udp_flags. Add udp_test_and_set_bit() helper to allow lockless udp_tunnel_encap_enable() implementation. Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Signed-off-by: Paolo Abeni commit f5f52f0884a595ff99ab1a608643fe4025fca2d5 Author: Eric Dumazet Date: Tue Sep 12 09:17:26 2023 +0000 udp: move udp->accept_udp_{l4|fraglist} to udp->udp_flags These are read locklessly, move them to udp_flags to fix data-races. Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Signed-off-by: Paolo Abeni commit 6d5a12eb91224d707f8691dccb40a5719fe5466d Author: Eric Dumazet Date: Tue Sep 12 09:17:25 2023 +0000 udp: add missing WRITE_ONCE() around up->encap_rcv UDP_ENCAP_ESPINUDP_NON_IKE setsockopt() writes over up->encap_rcv while other cpus read it. Fixes: 067b207b281d ("[UDP]: Cleanup UDP encapsulation code") Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Signed-off-by: Paolo Abeni commit e1dc0615c6b08ef36414f08c011965b8fb56198b Author: Eric Dumazet Date: Tue Sep 12 09:17:24 2023 +0000 udp: move udp->gro_enabled to udp->udp_flags syzbot reported that udp->gro_enabled can be read locklessly. Use one atomic bit from udp->udp_flags. Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.") Reported-by: syzbot Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Signed-off-by: Paolo Abeni commit bcbc1b1de884647aa0318bf74eb7f293d72a1e40 Author: Eric Dumazet Date: Tue Sep 12 09:17:23 2023 +0000 udp: move udp->no_check6_rx to udp->udp_flags syzbot reported that udp->no_check6_rx can be read locklessly. Use one atomic bit from udp->udp_flags. Fixes: 1c19448c9ba6 ("net: Make enabling of zero UDP6 csums more restrictive") Reported-by: syzbot Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Signed-off-by: Paolo Abeni commit a0002127cd746fcaa182ad3386ef6931c37f3bda Author: Eric Dumazet Date: Tue Sep 12 09:17:22 2023 +0000 udp: move udp->no_check6_tx to udp->udp_flags syzbot reported that udp->no_check6_tx can be read locklessly. Use one atomic bit from udp->udp_flags Fixes: 1c19448c9ba6 ("net: Make enabling of zero UDP6 csums more restrictive") Reported-by: syzbot Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Signed-off-by: Paolo Abeni commit 81b36803ac139827538ac5ce4028e750a3c53f53 Author: Eric Dumazet Date: Tue Sep 12 09:17:21 2023 +0000 udp: introduce udp->udp_flags According to syzbot, it is time to use proper atomic flags for various UDP flags. Add udp_flags field, and convert udp->corkflag to first bit in it. Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Signed-off-by: Paolo Abeni commit 1a47520b314a0f201fcec8c741ae60608380e78c Author: Dmitry Baryshkov Date: Tue Jul 11 15:09:16 2023 +0300 arm64: dts: qcom: sm8250: switch USB+DP QMP PHY to new style of bindings Change the USB QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). Reviewed-by: Neil Armstrong Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230711120916.4165894-11-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 0459c56e538bd4d8ed7f128d7a50a8990cbcb7b8 Author: Dmitry Baryshkov Date: Tue Jul 11 15:09:15 2023 +0300 arm64: dts: qcom: sm8150: switch USB+DP QMP PHY to new style of bindings Change the USB QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). Reviewed-by: Neil Armstrong Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230711120916.4165894-10-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit a9ecdec45a3a59057a68cf61ba4569d34caea5fc Author: Dmitry Baryshkov Date: Tue Jul 11 15:09:14 2023 +0300 arm64: dts: qcom: sdm845: switch USB+DP QMP PHY to new style of bindings Change the USB QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). Reviewed-by: Neil Armstrong Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230711120916.4165894-9-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 36888ed83f998c3335272f9e353eaf6d109e2429 Author: Dmitry Baryshkov Date: Tue Jul 11 15:09:13 2023 +0300 arm64: dts: qcom: sc7280: switch USB+DP QMP PHY to new style of bindings Change the USB QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230711120916.4165894-8-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 70c4a1ca13b333b00e01266d299605fa1041b0d5 Author: Dmitry Baryshkov Date: Tue Jul 11 15:09:12 2023 +0300 arm64: dts: qcom: sc7280: link usb3_phy_wrapper_gcc_usb30_pipe_clk Use usb_1_ssphy's clock as gcc's usb3_phy_wrapper_gcc_usb30_pipe_clk clock source. Suggested-by: Neil Armstrong Fixes: 1c39e6f9b534 ("arm64: dts: qcom: sc7280: Add USB related nodes") Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230711120916.4165894-7-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit ebb840b00b7f9fc15153b37a7d9ec5b47a5308c1 Author: Dmitry Baryshkov Date: Tue Jul 11 15:09:11 2023 +0300 arm64: dts: qcom: sc7180: switch USB+DP QMP PHY to new style of bindings Change the USB QMP PHY to use newer style of QMP PHY bindings (single resource region, no per-PHY subnodes). Reviewed-by: Neil Armstrong Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20230711120916.4165894-6-dmitry.baryshkov@linaro.org Signed-off-by: Bjorn Andersson commit 7925ca85e956191a6a522e0a31a877b98cb5096c Author: Maulik Shah Date: Mon Jul 3 14:25:55 2023 +0530 arm64: dts: qcom: sc7280: Add power-domains for cpuidle states Add power-domains for cpuidle states to use psci os-initiated idle states. Cc: devicetree@vger.kernel.org Reviewed-by: Ulf Hansson Signed-off-by: Maulik Shah Link: https://lore.kernel.org/r/20230703085555.30285-4-quic_mkshah@quicinc.com [bjorn: Corrected psci child node names to match binding] Signed-off-by: Bjorn Andersson commit 89bf1107b7762631262e94fc7f73fa81d4ec0b6d Author: Neil Armstrong Date: Thu Sep 14 15:24:21 2023 +0200 arm64: defconfig: enable NB7VPQ904M driver as module Enable the NB7VPQ904M SuperSpeed redriver/retimer as module as it is now used on the SM8550 QRD platform. Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20230914-topic-sm8x50-upstream-nb7-defconfig-v1-1-4f6fd9f3fded@linaro.org Signed-off-by: Bjorn Andersson commit 201cd8541673f9b553508c2f11dadfab7874addd Author: Krzysztof Kozlowski Date: Wed Sep 6 12:47:44 2023 +0200 arm64: dts: qcom: sm8350-mtp: add UFS host controller supply According to schematics the L9B regulator supplies VCCQ (already in DTS) and the UFS controller pads (VDD_PX10, missing vdd-hba). Add the missing supply for full hardware description, even though it should not have functional impact. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230906104744.163479-6-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 2c20c75d850574c727e07e615ed55e3d5c2b42db Author: Krzysztof Kozlowski Date: Wed Sep 6 12:47:43 2023 +0200 arm64: dts: qcom: sm8350-hdk: add UFS host controller supply According to schematics the L9B regulator supplies VCCQ (already in DTS) and the UFS controller pads (VDD_PX10, missing vdd-hba). Add the missing supply for full hardware description, even though it should not have functional impact. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230906104744.163479-5-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit ebad126daf0c70a054b358e276cef453b2fcdc7f Author: Krzysztof Kozlowski Date: Wed Sep 6 12:47:42 2023 +0200 arm64: dts: qcom: sm8450-qrd: add UFS host controller supply According to schematics the L9B regulator supplies VCCQ (already in DTS) and the UFS controller pads (VDD_PX10, missing vdd-hba). Add the missing supply for full hardware description, even though it should not have functional impact. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230906104744.163479-4-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit f5688b4914fa5c5b9a0fca1692b82d25ae6cee33 Author: Krzysztof Kozlowski Date: Wed Sep 6 12:47:41 2023 +0200 arm64: dts: qcom: sm8450-hdk: add UFS host controller supply According to schematics the L9B regulator supplies VCCQ (already in DTS) and the UFS controller pads (VDD_PX10, missing vdd-hba). Add the missing supply for full hardware description, even though it should not have functional impact. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230906104744.163479-3-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit e485c6e19ae888761d9fc65353722afa0235bbb4 Author: Krzysztof Kozlowski Date: Wed Sep 6 12:47:40 2023 +0200 arm64: dts: qcom: sm8550-qrd: use correct UFS supply According to schematics the VCCQ2 supply is not connected and the L3G regulator instead powers up the controller pads (VDD_PX10). Use correct supply vdd-hba and drop unsupported current limit for the vdd-hba. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230906104744.163479-2-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 5c72cb3a9a96a5103cba49a1c8f2a2c71b158ab6 Author: Krzysztof Kozlowski Date: Wed Sep 6 12:47:39 2023 +0200 arm64: dts: qcom: sm8550-mtp: use correct UFS supply According to schematics the VCCQ2 supply is not connected and the L3G regulator instead powers up the controller pads (VDD_PX10). Use correct supply vdd-hba and drop unsupported current limit for the vdd-hba. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230906104744.163479-1-krzysztof.kozlowski@linaro.org Signed-off-by: Bjorn Andersson commit 197ae69d1caedb3203e0b189a39efb820675fd5c Author: David Heidelberg Date: Tue Sep 12 12:42:04 2023 +0530 arm64: dts: qcom: sdm845: cheza doesn't support LMh node Cheza firmware doesn't allow controlling LMh from the operating system. Fixes: 36c6581214c4 ("arm64: dts: qcom: sdm845: Add support for LMh node") Suggested-by: Dmitry Baryshkov Signed-off-by: David Heidelberg Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20230912071205.11502-2-david@ixit.cz Signed-off-by: Bjorn Andersson commit a5f01673d3946e424091e6b8ff274716f9c21454 Author: David Heidelberg Date: Tue Sep 12 12:42:03 2023 +0530 arm64: dts: qcom: sdm845: Fix PSCI power domain names The original commit hasn't been updated according to refactoring done in sdm845.dtsi. Fixes: a1ade6cac5a2 ("arm64: dts: qcom: sdm845: Switch PSCI cpu idle states from PC to OSI") Suggested-by: Dmitry Baryshkov Reviewed-by: Douglas Anderson Signed-off-by: David Heidelberg Reviewed-by: Stephen Boyd Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20230912071205.11502-1-david@ixit.cz Signed-off-by: Bjorn Andersson commit 2e754956848889d5b04d8023753fa28de679373d Author: Konrad Dybcio Date: Tue Sep 12 15:48:31 2023 +0200 arm64: dts: qcom: sm8250-edo: Set UART alias and stdout-path The GENI UART driver requires one specifies a numeric alias. Do so and set the stdout-path to route the console to the debug uart in the microSD slot by default. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230912-topic-edoconsole-v1-1-b392ea67e539@linaro.org Signed-off-by: Bjorn Andersson commit 486e6ca6b48d68d7fefc99e15cc1865e2210d893 Author: Lorenzo Bianconi Date: Tue Sep 12 10:28:00 2023 +0200 net: ethernet: mtk_wed: check update_wo_rx_stats in mtk_wed_update_rx_stats() Check if update_wo_rx_stats function pointer is properly set in mtk_wed_update_rx_stats routine before accessing it. Signed-off-by: Lorenzo Bianconi Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/b0d233386e059bccb59f18f69afb79a7806e5ded.1694507226.git.lorenzo@kernel.org Signed-off-by: Paolo Abeni commit 5c33c09c89789ea45d2aac2471a28c9f90b04c95 Author: Lorenzo Bianconi Date: Tue Sep 12 10:22:56 2023 +0200 net: ethernet: mtk_eth_soc: rely on mtk_pse_port definitions in mtk_flow_set_output_device Similar to ethernet ports, rely on mtk_pse_port definitions for pse wdma ports as well. Signed-off-by: Lorenzo Bianconi Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/b86bdb717e963e3246c1dec5f736c810703cf056.1694506814.git.lorenzo@kernel.org Signed-off-by: Paolo Abeni commit f557524029458ab7dd1c6077f35fa23fbb744356 Author: Jiawen Wu Date: Tue Sep 12 11:14:24 2023 +0800 net: wangxun: move MDIO bus implementation to the library Move similar code of accessing MDIO bus from txgbe/ngbe to libwx. Signed-off-by: Jiawen Wu Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230912031424.721386-1-jiawenwu@trustnetic.com Signed-off-by: Paolo Abeni commit 353bc9924cb1b7176fdc4ebb3610306398f41c94 Author: Peter Ujfalusi Date: Thu Sep 14 15:49:43 2023 +0300 ASoC: SOF: ops.h: Change the error code for not supported to EOPNOTSUPP New code uses ENOTSUPP as per checkpatch recommendation: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20230914124943.24399-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 476652297f94a2e5e5ef29e734b0da37ade94110 Author: Michael Neuling Date: Thu Sep 14 13:06:00 2023 +1000 docs: powerpc: Document nested KVM on POWER Document support for nested KVM on POWER using the existing API as well as the new PAPR API. This includes the new HCALL interface and how it used by KVM. Signed-off-by: Michael Neuling Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://msgid.link/20230914030600.16993-12-jniethe5@gmail.com commit 19d31c5f115754c369c0995df47479c384757f82 Author: Jordan Niethe Date: Thu Sep 14 13:05:59 2023 +1000 KVM: PPC: Add support for nestedv2 guests A series of hcalls have been added to the PAPR which allow a regular guest partition to create and manage guest partitions of its own. KVM already had an interface that allowed this on powernv platforms. This existing interface will now be called "nestedv1". The newly added PAPR interface will be called "nestedv2". PHYP will support the nestedv2 interface. At this time the host side of the nestedv2 interface has not been implemented on powernv but there is no technical reason why it could not be added. The nestedv1 interface is still supported. Add support to KVM to utilize these hcalls to enable running nested guests as a pseries guest on PHYP. Overview of the new hcall usage: - L1 and L0 negotiate capabilities with H_GUEST_{G,S}ET_CAPABILITIES() - L1 requests the L0 create a L2 with H_GUEST_CREATE() and receives a handle to use in future hcalls - L1 requests the L0 create a L2 vCPU with H_GUEST_CREATE_VCPU() - L1 sets up the L2 using H_GUEST_SET and the H_GUEST_VCPU_RUN input buffer - L1 requests the L0 runs the L2 vCPU using H_GUEST_VCPU_RUN() - L2 returns to L1 with an exit reason and L1 reads the H_GUEST_VCPU_RUN output buffer populated by the L0 - L1 handles the exit using H_GET_STATE if necessary - L1 reruns L2 vCPU with H_GUEST_VCPU_RUN - L1 frees the L2 in the L0 with H_GUEST_DELETE() Support for the new API is determined by trying H_GUEST_GET_CAPABILITIES. On a successful return, use the nestedv2 interface. Use the vcpu register state setters for tracking modified guest state elements and copy the thread wide values into the H_GUEST_VCPU_RUN input buffer immediately before running a L2. The guest wide elements can not be added to the input buffer so send them with a separate H_GUEST_SET call if necessary. Make the vcpu register getter load the corresponding value from the real host with H_GUEST_GET. To avoid unnecessarily calling H_GUEST_GET, track which values have already been loaded between H_GUEST_VCPU_RUN calls. If an element is present in the H_GUEST_VCPU_RUN output buffer it also does not need to be loaded again. Tested-by: Sachin Sant Signed-off-by: Vaibhav Jain Signed-off-by: Gautam Menghani Signed-off-by: Kautuk Consul Signed-off-by: Amit Machhiwal Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://msgid.link/20230914030600.16993-11-jniethe5@gmail.com commit dfcaacc8f970c6b4ea4e32d2186f2bea4a1d5255 Author: Jordan Niethe Date: Thu Sep 14 13:05:58 2023 +1000 KVM: PPC: Book3s HV: Hold LPIDs in an unsigned long The LPID register is 32 bits long. The host keeps the lpids for each guest in an unsigned word struct kvm_arch. Currently, LPIDs are already limited by mmu_lpid_bits and KVM_MAX_NESTED_GUESTS_SHIFT. The nestedv2 API returns a 64 bit "Guest ID" to be used be the L1 host for each L2 guest. This value is used as an lpid, e.g. it is the parameter used by H_RPT_INVALIDATE. To minimize needless special casing it makes sense to keep this "Guest ID" in struct kvm_arch::lpid. This means that struct kvm_arch::lpid is too small so prepare for this and make it an unsigned long. This is not a problem for the KVM-HV and nestedv1 cases as their lpid values are already limited to valid ranges so in those contexts the lpid can be used as an unsigned word safely as needed. In the PAPR, the H_RPT_INVALIDATE pid/lpid parameter is already specified as an unsigned long so change pseries_rpt_invalidate() to match that. Update the callers of pseries_rpt_invalidate() to also take an unsigned long if they take an lpid value. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://msgid.link/20230914030600.16993-10-jniethe5@gmail.com commit 6ccbbc33f06adaf79acde18571c6543ad1cb4be6 Author: Jordan Niethe Date: Thu Sep 14 13:05:57 2023 +1000 KVM: PPC: Add helper library for Guest State Buffers The PAPR "Nestedv2" guest API introduces the concept of a Guest State Buffer for communication about L2 guests between L1 and L0 hosts. In the new API, the L0 manages the L2 on behalf of the L1. This means that if the L1 needs to change L2 state (e.g. GPRs, SPRs, partition table...), it must request the L0 perform the modification. If the nested host needs to read L2 state likewise this request must go through the L0. The Guest State Buffer is a Type-Length-Value style data format defined in the PAPR which assigns all relevant partition state a unique identity. Unlike a typical TLV format the length is redundant as the length of each identity is fixed but is included for checking correctness. A guest state buffer consists of an element count followed by a stream of elements, where elements are composed of an ID number, data length, then the data: Header: <---4 bytes---> +----------------+----- | Element Count | Elements... +----------------+----- Element: <----2 bytes---> <-2 bytes-> <-Length bytes-> +----------------+-----------+----------------+ | Guest State ID | Length | Data | +----------------+-----------+----------------+ Guest State IDs have other attributes defined in the PAPR such as whether they are per thread or per guest, or read-only. Introduce a library for using guest state buffers. This includes support for actions such as creating buffers, adding elements to buffers, reading the value of elements and parsing buffers. This will be used later by the nestedv2 guest support. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://msgid.link/20230914030600.16993-9-jniethe5@gmail.com commit 6de2e837babb411cfb3cdb570581c3a65576ddaf Author: Jordan Niethe Date: Thu Sep 14 13:05:56 2023 +1000 KVM: PPC: Book3S HV: Introduce low level MSR accessor kvmppc_get_msr() and kvmppc_set_msr_fast() serve as accessors for the MSR. However because the MSR is kept in the shared regs they include a conditional check for kvmppc_shared_big_endian() and endian conversion. Within the Book3S HV specific code there are direct reads and writes of shregs::msr. In preparation for Nested APIv2 these accesses need to be replaced with accessor functions so it is possible to extend their behavior. However, using the kvmppc_get_msr() and kvmppc_set_msr_fast() functions is undesirable because it would introduce a conditional branch and endian conversion that is not currently present. kvmppc_set_msr_hv() already exists, it is used for the kvmppc_ops::set_msr callback. Introduce a low level accessor __kvmppc_{s,g}et_msr_hv() that simply gets and sets shregs::msr. This will be extend for Nested APIv2 support. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://msgid.link/20230914030600.16993-8-jniethe5@gmail.com commit ebc88ea7a6ad0ea349df9c765357d3aa4e662aa9 Author: Jordan Niethe Date: Thu Sep 14 13:05:55 2023 +1000 KVM: PPC: Book3S HV: Use accessors for VCPU registers Introduce accessor generator macros for Book3S HV VCPU registers. Use the accessor functions to replace direct accesses to this registers. This will be important later for Nested APIv2 support which requires additional functionality for accessing and modifying VCPU state. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://msgid.link/20230914030600.16993-7-jniethe5@gmail.com commit c8ae9b3c6e7f22a4b71e42edb0fc3942aa7a7c42 Author: Jordan Niethe Date: Thu Sep 14 13:05:54 2023 +1000 KVM: PPC: Use accessors for VCORE registers Introduce accessor generator macros for VCORE registers. Use the accessor functions to replace direct accesses to this registers. This will be important later for Nested APIv2 support which requires additional functionality for accessing and modifying VCPU state. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://msgid.link/20230914030600.16993-6-jniethe5@gmail.com commit 7028ac8d174f28220f0e2de0cb3346cd3c31976d Author: Jordan Niethe Date: Thu Sep 14 13:05:53 2023 +1000 KVM: PPC: Use accessors for VCPU registers Introduce accessor generator macros for VCPU registers. Use the accessor functions to replace direct accesses to this registers. This will be important later for Nested APIv2 support which requires additional functionality for accessing and modifying VCPU state. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://msgid.link/20230914030600.16993-5-jniethe5@gmail.com commit 2a64bc673133346a7a3bd163f2e6048bd1788727 Author: Jordan Niethe Date: Thu Sep 14 13:05:52 2023 +1000 KVM: PPC: Rename accessor generator macros More "wrapper" style accessor generating macros will be introduced for the nestedv2 guest support. Rename the existing macros with more descriptive names now so there is a consistent naming convention. Reviewed-by: Nicholas Piggin Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://msgid.link/20230914030600.16993-4-jniethe5@gmail.com commit 52425a3b3c11cec58cf66e4c897fc1504f3911a9 Author: Jordan Niethe Date: Thu Sep 14 13:05:51 2023 +1000 KVM: PPC: Introduce FPR/VR accessor functions Introduce accessor functions for floating point and vector registers like the ones that exist for GPRs. Use these to replace the existing FPR and VR accessor macros. This will be important later for Nested APIv2 support which requires additional functionality for accessing and modifying VCPU state. Signed-off-by: Gautam Menghani Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://msgid.link/20230914030600.16993-3-jniethe5@gmail.com commit 0e85b7df9cb0c65f840109159ef6754c783e07a0 Author: Jordan Niethe Date: Thu Sep 14 13:05:50 2023 +1000 KVM: PPC: Always use the GPR accessors Always use the GPR accessor functions. This will be important later for Nested APIv2 support which requires additional functionality for accessing and modifying VCPU state. Signed-off-by: Jordan Niethe Signed-off-by: Michael Ellerman Link: https://msgid.link/20230914030600.16993-2-jniethe5@gmail.com commit a11e097504ac1889b35b6858f495565838325f88 Author: Nikolay Borisov Date: Fri Jun 23 14:14:09 2023 +0300 x86: Make IA32_EMULATION boot time configurable Distributions would like to reduce their attack surface as much as possible but at the same time they'd want to retain flexibility to cater to a variety of legacy software. This stems from the conjecture that compat layer is likely rarely tested and could have latent security bugs. Ideally distributions will set their default policy and also give users the ability to override it as appropriate. To enable this use case, introduce CONFIG_IA32_EMULATION_DEFAULT_DISABLED compile time option, which controls whether 32bit processes/syscalls should be allowed or not. This option is aimed mainly at distributions to set their preferred default behavior in their kernels. To allow users to override the distro's policy, introduce the 'ia32_emulation' parameter which allows overriding CONFIG_IA32_EMULATION_DEFAULT_DISABLED state at boot time. Signed-off-by: Nikolay Borisov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230623111409.3047467-7-nik.borisov@suse.com commit 61382281e9054df523d3f9cfdba2faff88955f97 Author: Nikolay Borisov Date: Fri Jun 23 14:14:08 2023 +0300 x86/entry: Make IA32 syscalls' availability depend on ia32_enabled() Another major aspect of supporting running of 32bit processes is the ability to access 32bit syscalls. Such syscalls can be invoked by using the legacy int 0x80 handler and sysenter/syscall instructions. If IA32 emulation is disabled ensure that each of those 3 distinct mechanisms are also disabled. For int 0x80 a #GP exception would be generated since the respective descriptor is not going to be loaded at all. Invoking sysenter will also result in a #GP since IA32_SYSENTER_CS contains an invalid segment. Finally, syscall instruction cannot really be disabled so it's configured to execute a minimal handler. Signed-off-by: Nikolay Borisov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230623111409.3047467-6-nik.borisov@suse.com commit 5ae2702d7c482edbf002499e23a2e22ac4047af1 Author: Nikolay Borisov Date: Fri Jun 23 14:14:07 2023 +0300 x86/elf: Make loading of 32bit processes depend on ia32_enabled() Major aspect of ia32 emulation is the ability to load 32bit processes. That's currently decided (among others) by compat_elf_check_arch(). Make the macro use ia32_enabled() to decide if IA32 compat is enabled before loading a 32bit process. Signed-off-by: Nikolay Borisov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230623111409.3047467-5-nik.borisov@suse.com commit 370dcd58548a360bbf8a65b89b410d09f56bf0c6 Author: Nikolay Borisov Date: Fri Jun 23 14:14:06 2023 +0300 x86/entry: Compile entry_SYSCALL32_ignore() unconditionally To limit the IA32 exposure on 64bit kernels while keeping the flexibility for the user to enable it when required, the compile time enable/disable via CONFIG_IA32_EMULATION is not good enough and will be complemented with a kernel command line option. Right now entry_SYSCALL32_ignore() is only compiled when CONFIG_IA32_EMULATION=n, but boot-time enable- / disablement obviously requires it to be unconditionally available. Remove the #ifndef CONFIG_IA32_EMULATION guard. Signed-off-by: Nikolay Borisov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230623111409.3047467-4-nik.borisov@suse.com commit f71e1d2ff8e6a183bd4004bc97c453ba527b7dc6 Author: Nikolay Borisov Date: Fri Jun 23 14:14:05 2023 +0300 x86/entry: Rename ignore_sysret() The SYSCALL instruction cannot really be disabled in compatibility mode. The best that can be done is to configure the CSTAR msr to point to a minimal handler. Currently this handler has a rather misleading name - ignore_sysret() as it's not really doing anything with sysret. Give it a more descriptive name. Signed-off-by: Nikolay Borisov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230623111409.3047467-3-nik.borisov@suse.com commit 1da5c9bc119d3a749b519596b93f9b2667e93c4a Author: Nikolay Borisov Date: Fri Jun 23 14:14:04 2023 +0300 x86: Introduce ia32_enabled() IA32 support on 64bit kernels depends on whether CONFIG_IA32_EMULATION is selected or not. As it is a compile time option it doesn't provide the flexibility to have distributions set their own policy for IA32 support and give the user the flexibility to override it. As a first step introduce ia32_enabled() which abstracts whether IA32 compat is turned on or off. Upcoming patches will implement the ability to set IA32 compat state at boot time. Signed-off-by: Nikolay Borisov Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230623111409.3047467-2-nik.borisov@suse.com commit 3106c34df6ace8a123027b9afdc73bb05d530052 Author: Suraj Kandpal Date: Tue Sep 12 01:07:43 2023 +0530 drm/i915/dsc: Fix pic_width readout pic_width when written into the PPS register is divided by the no. of vdsc instances first but the actual variable that we compare it to does not change i.e vdsc_cfg->pic_width hence when reading the register back for pic_width it needs to be multiplied by num_vdsc_instances rather than being divided. Fixes: 8b70b5691704 ("drm/i915/vdsc: Fill the intel_dsc_get_pps_config function") Signed-off-by: Suraj Kandpal Reviewed-by: Chaitanya Kumar Borah Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230911193742.836063-1-suraj.kandpal@intel.com commit c92ec50822fb84306d951520d81919328421acbd Author: Dan Carpenter Date: Wed Sep 13 11:17:41 2023 +0300 drm/i915/gt: Prevent error pointer dereference Move the check for "if (IS_ERR(obj))" in front of the call to i915_gem_object_set_cache_coherency() which dereferences "obj". Otherwise it will lead to a crash. Fixes: 43aa755eae2c ("drm/i915/mtl: Update cache coherency setting for context structure") Signed-off-by: Dan Carpenter Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/455b2279-2e08-4d00-9784-be56d8ee42e3@moroto.mountain commit 86565682e9053e5deb128193ea9e88531bbae9cf Author: Sieng-Piaw Liew Date: Tue Sep 12 09:07:11 2023 +0800 atl1c: Work around the DMA RX overflow issue This is based on alx driver commit 881d0327db37 ("net: alx: Work around the DMA RX overflow issue"). The alx and atl1c drivers had RX overflow error which was why a custom allocator was created to avoid certain addresses. The simpler workaround then created for alx driver, but not for atl1c due to lack of tester. Instead of using a custom allocator, check the allocated skb address and use skb_reserve() to move away from problematic 0x...fc0 address. Tested on AR8131 on Acer 4540. Signed-off-by: Sieng-Piaw Liew Link: https://lore.kernel.org/r/20230912010711.12036-1-liew.s.piaw@gmail.com Signed-off-by: Paolo Abeni commit ef399736c3ba77fb82d778b1b7285baa65a7e079 Author: Mateusz Majewski Date: Mon Sep 11 15:34:14 2023 +0200 ARM: dts: samsung: exynos4210: enable polling It seems that thermal in Exynos 4210 is broken without this, as it will never decrease cooling after increasing it. Signed-off-by: Mateusz Majewski Link: https://lore.kernel.org/r/20230911133417.14042-1-m.majewski2@samsung.com [krzk: fix comment coding style and line wrapping] Signed-off-by: Krzysztof Kozlowski commit f28dde395937e000585ac87c0d1c18885661161d Author: Mateusz Majewski Date: Mon Sep 11 15:33:39 2023 +0200 arm64: dts: exynos: remove unused TMU alias The ID of this alias is checked by the exynos-tmu driver, but isn't used anywhere and omitting it does not cause an error. Indeed, this is the only Exynos device that defines this alias. Signed-off-by: Mateusz Majewski Link: https://lore.kernel.org/r/20230911133342.14028-1-m.majewski2@samsung.com Signed-off-by: Krzysztof Kozlowski commit d8c326bd5aa5d6aac0c4826dfeadcb02dc77ab88 Author: Jaewon Kim Date: Tue Sep 12 14:56:35 2023 +0900 arm64: dts: exynos: Use pinctrl macros for exynos5433-tm2 Use pinctrl macro instead of hard-coded number. This makes the code more readable. Signed-off-by: Jaewon Kim Link: https://lore.kernel.org/r/20230912055635.49092-1-jaewon02.kim@samsung.com Signed-off-by: Krzysztof Kozlowski commit 9c386911b16d4bf2f24e55ed42bfa397073b4b84 Author: Johannes Berg Date: Thu Sep 14 09:13:10 2023 +0200 wifi: cfg80211: fix kernel-doc for wiphy_delayed_work_flush() Now that I fixed the function name, we see the parameters are wrong as well. Fix that too. Change-Id: I1a4cfea446875998a5a242ca36acc8244991a199 Reported-by: Stephen Rothwell Signed-off-by: Johannes Berg commit ea8f505ec51e904f4696b5e3e852b7a51c8e956d Merge: ca5ab9638e925 b698bd97c5711 Author: Paolo Abeni Date: Thu Sep 14 08:19:59 2023 +0200 Merge branch 'vsock-handle-writes-to-shutdowned-socket' Arseniy Krasnov says: ==================== vsock: handle writes to shutdowned socket this small patchset adds POSIX compliant behaviour on writes to the socket which was shutdowned with 'shutdown()' (both sides - local with SHUT_WR flag, peer - with SHUT_RD flag). According POSIX we must send SIGPIPE in such cases (but SIGPIPE is not send when MSG_NOSIGNAL is set). First patch is implemented in the same way as net/ipv4/tcp.c:tcp_sendmsg_locked(). It uses 'sk_stream_error()' function which handles EPIPE error. Another way is to use code from net/unix/af_unix.c:unix_stream_sendmsg() where same logic from 'sk_stream_error()' is implemented "from scratch", but it doesn't check 'sk_err' field. I think error from this field has more priority to be returned from syscall. So I guess it is better to reuse currently implemented 'sk_stream_error()' function. Test is also added. ==================== Link: https://lore.kernel.org/r/20230911202027.1928574-1-avkrasnov@salutedevices.com Signed-off-by: Paolo Abeni commit b698bd97c571129cb642eb73ba6fc15bd4c23549 Author: Arseniy Krasnov Date: Mon Sep 11 23:20:27 2023 +0300 test/vsock: shutdowned socket test This adds two tests for 'shutdown()' call. It checks that SIGPIPE is sent when MSG_NOSIGNAL is not set and vice versa. Both flags SHUT_WR and SHUT_RD are tested. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: Paolo Abeni commit 8ecf0cedc08a3a8e663918d22f0350a928ac115c Author: Arseniy Krasnov Date: Mon Sep 11 23:20:26 2023 +0300 vsock: send SIGPIPE on write to shutdowned socket POSIX requires to send SIGPIPE on write to SOCK_STREAM socket which was shutdowned with SHUT_WR flag or its peer was shutdowned with SHUT_RD flag. Also we must not send SIGPIPE if MSG_NOSIGNAL flag is set. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella Signed-off-by: Paolo Abeni commit c286c48018dea3c3bea9813477631cb12d6199c6 Author: Nathan Chancellor Date: Wed Sep 13 16:30:24 2023 -0700 drm/debugfs: Fix drm_debugfs_remove_files() stub When building without CONFIG_DEBUG_FS: drivers/gpu/drm/tegra/dc.c:1757:59: error: too many arguments to function call, expected 3, have 4 1757 | drm_debugfs_remove_files(dc->debugfs_files, count, root, minor); | ~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~ include/drm/drm_debugfs.h:162:19: note: 'drm_debugfs_remove_files' declared here 162 | static inline int drm_debugfs_remove_files(const struct drm_info_list *files, | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 163 | int count, struct drm_minor *minor) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Update the stub to include the root parameter. Fixes: 8e455145d8f1 ("drm/debugfs: rework drm_debugfs_create_files implementation v2") Signed-off-by: Nathan Chancellor Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230913-fix-drm_debugfs_remove_files-stub-v1-1-6b952ac559f3@kernel.org Signed-off-by: Christian König commit 1cec289a3ced45b7f4a5e136acd79e401167c1ba Author: Neil Armstrong Date: Mon Sep 11 09:28:47 2023 +0200 arm64: dts: qcom: sm8550-qrd: add bluetooth support Enable the WCN7850 bluetooth over the UART14 link. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20230911-topic-sm8550-upstream-bt-v4-2-a5a428c77418@linaro.org Signed-off-by: Bjorn Andersson commit 75cac7090298978c12c59dbca377d957f6f8a8bb Author: Neil Armstrong Date: Mon Sep 11 09:28:46 2023 +0200 arm64: dts: qcom: sm8550: add UART14 nodes Add the Geni High Speed UART QUP instance 2 element 6 node and associated default pinctrl. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20230911-topic-sm8550-upstream-bt-v4-1-a5a428c77418@linaro.org Signed-off-by: Bjorn Andersson commit 17d11949827375d74bdf5df18c3f5813ee7d5933 Merge: b0597fd5a9538 5a738cfe49b2c Author: Martin K. Petersen Date: Wed Sep 13 21:31:28 2023 -0400 Merge patch series "scsi: ufs: qcom: Align programming sequence as per HW spec" Nitin Rawat says: This patch series adds programming support for Qualcomm UFS V4 and above to align avoid with Hardware Specification. This patch series will address stability and performance issues. In this patch series below changes are taken care. 1) Register layout for DME_VS_CORE_CLK_CTRL has changed for v4 and above. 2) Adds Support to configure PA_VS_CORE_CLK_40NS_CYCLES attibute for UFS V4 and above. 3) Adds Support to configure multiple unipro frequencies like 403MHz, 300MHz, 202MHz, 150 MHz, 75Mhz, 37.5 MHz for Qualcomm UFS Controller V4 and above. 4) Allow configuration of SYS1CLK_1US_REG for UFS V4 and above. Link: https://lore.kernel.org/r/20230905052400.13935-1-quic_nitirawa@quicinc.com Signed-off-by: Martin K. Petersen commit 5a738cfe49b2cc0896353c0b33dc5cc81316aabe Author: Manivannan Sadhasivam Date: Fri Sep 8 20:23:29 2023 +0530 scsi: ufs: qcom: Rename "hs_gear" to "phy_gear" The "hs_gear" variable is used to cache the gear setting for the PHY that will be used during ufs_qcom_power_up_sequence(). But it creates ambiguity with the gear setting used by the ufshcd driver. So let's rename it to "phy_gear" to make it explicit that this variable caches the gear setting for the PHY. Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20230908145329.154024-2-manivannan.sadhasivam@linaro.org Reviewed-by: Can Guo Tested-by: Can Guo Signed-off-by: Martin K. Petersen commit fc88ca19ad0989dc0e4d4b126d5d0ba91f6cb616 Author: Manivannan Sadhasivam Date: Fri Sep 8 20:23:28 2023 +0530 scsi: ufs: qcom: Update PHY settings only when scaling to higher gears The "hs_gear" variable is used to program the PHY settings (submode) during ufs_qcom_power_up_sequence(). Currently, it is being updated every time the agreed gear changes. Due to this, if the gear got downscaled before suspend (runtime/system), then while resuming, the PHY settings for the lower gear will be applied first and later when scaling to max gear with REINIT, the PHY settings for the max gear will be applied. This adds a latency while resuming and also really not needed as the PHY gear settings are backwards compatible i.e., we can continue using the PHY settings for max gear with lower gear speed. So let's update the "hs_gear" variable _only_ when the agreed gear is greater than the current one. This guarantees that the PHY settings will be changed only during probe time and fatal error condition. Due to this, UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH can now be skipped when the PM operation is in progress. Cc: stable@vger.kernel.org Fixes: 96a7141da332 ("scsi: ufs: core: Add support for reinitializing the UFS device") Reported-by: Can Guo Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20230908145329.154024-1-manivannan.sadhasivam@linaro.org Reviewed-by: Can Guo Tested-by: Can Guo Signed-off-by: Martin K. Petersen commit fd915c67cdd53e201b28b30f8a78e5c85fb97864 Author: Nitin Rawat Date: Tue Sep 5 10:54:00 2023 +0530 scsi: ufs: qcom: Configure SYS1CLK_1US_REG for UFS V4 and above SYS1CLK_1US represents the required number of system 1-clock cycles for one microsecond. UFS Host Controller V4.0 and above mandates to write SYS1CLK_1US_REG register and also these timer configuration needs to be called from clk scaling pre ops as per HPG. Refactor ufs_qcom_cfg_timers and add the below code support to align with HPG. a)Configure SYS1CLK_1US_REG for UFS V4 and above. b)Introduce a new argument is_pre_scale_up for ufs_qcom_cfg_timers to configure SYS1CLK_1US for max freq during prescale and link startup condition. c)Move ufs_qcom_cfg_timers from clk scaling post change ops to clk scaling pre change ops. Co-developed-by: Naveen Kumar Goud Arepalli Signed-off-by: Naveen Kumar Goud Arepalli Signed-off-by: Nitin Rawat Link: https://lore.kernel.org/r/20230905052400.13935-6-quic_nitirawa@quicinc.com Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit 3091181beeefc37dd44b1a0f95015f4367b26a54 Author: Nitin Rawat Date: Tue Sep 5 10:53:59 2023 +0530 scsi: ufs: qcom: Align programing of unipro clk attributes Currently CORE_CLK_1US_CYCLES, PA_VS_CORE_CLK_40NS_CYCLES are configured in clk scaling post change ops. This is not aligning to HPG. Move this to clk scaling pre change ops to align completely with hardware specification. Co-developed-by: Naveen Kumar Goud Arepalli Signed-off-by: Naveen Kumar Goud Arepalli Signed-off-by: Nitin Rawat Link: https://lore.kernel.org/r/20230905052400.13935-5-quic_nitirawa@quicinc.com Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit a53dfc008353b6e1cb6a5d961f1679fb863ab6a1 Author: Nitin Rawat Date: Tue Sep 5 10:53:58 2023 +0530 scsi: ufs: qcom: Add support to configure PA_VS_CORE_CLK_40NS_CYCLES PA_VS_CORE_CLK_40NS_CYCLES attribute represents the required number of Qunipro core clock for 40 nanoseconds. For UFS host controller V4 and above PA_VS_CORE_CLK_40NS_CYCLES needs to be programmed as per frequency of unipro core clk of UFS host controller. Add Support to configure PA_VS_CORE_CLK_40NS_CYCLES for Controller V4 and above to align with the hardware specification and to avoid functionality issues like h8 enter/exit failure, command timeout. Co-developed-by: Naveen Kumar Goud Arepalli Signed-off-by: Naveen Kumar Goud Arepalli Signed-off-by: Nitin Rawat Link: https://lore.kernel.org/r/20230905052400.13935-4-quic_nitirawa@quicinc.com Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit b4e13e1ae95e7d9ad3dd2e1ca98cd1328d913fb8 Author: Nitin Rawat Date: Tue Sep 5 10:53:57 2023 +0530 scsi: ufs: qcom: Add multiple frequency support for MAX_CORE_CLK_1US_CYCLES Qualcomm UFS Controller V4 and above supports multiple unipro frequencies like 403MHz, 300MHz, 202MHz, 150 MHz, 75Mhz, 37.5 MHz. Current code supports only 150MHz and 75MHz which have performance impact due to low UFS controller frequencies. For targets which supports frequencies other than 150 MHz and 75 Mhz, needs an update of MAX_CORE_CLK_1US_CYCLES to match the configured frequency to avoid functionality issues. Add multiple frequency support for MAX_CORE_CLK_1US_CYCLES based on the frequency configured. Co-developed-by: Naveen Kumar Goud Arepalli Signed-off-by: Naveen Kumar Goud Arepalli Signed-off-by: Nitin Rawat Link: https://lore.kernel.org/r/20230905052400.13935-3-quic_nitirawa@quicinc.com Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit 07d2290fe80dc9b1b0d066dc2027b84770144e49 Author: Nitin Rawat Date: Tue Sep 5 10:53:56 2023 +0530 scsi: ufs: qcom: Update MAX_CORE_CLK_1US_CYCLES for UFS V4 and above UFS Controller V4 and above, the register layout for DME_VS_CORE_CLK_CTRL register has changed. MAX_CORE_CLK_1US_CYCLES offset has changed from 0 to 0x10 and length of attrbute is changed from 8bit to 12bit. Add support to configure MAX_CORE_CLK_1US_CYCLES for UFS V4 and above as per new register layout. Co-developed-by: Naveen Kumar Goud Arepalli Signed-off-by: Naveen Kumar Goud Arepalli Signed-off-by: Nitin Rawat Link: https://lore.kernel.org/r/20230905052400.13935-2-quic_nitirawa@quicinc.com Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit b0597fd5a953833399bbb6be55337dd655060143 Author: Alex Henrie Date: Wed Aug 30 23:23:48 2023 -0600 scsi: imm: Add a module parameter for the transfer mode Fix in the imm driver the same problem that was fixed in the ppa driver by commit 68a4f84a17c1 ("scsi: ppa: Add a module parameter for the transfer mode"). Tested and confirmed working with an Iomega Z250P zip drive and a StarTech PEX1P2 AX99100 PCIe parallel port. Signed-off-by: Alex Henrie Link: https://lore.kernel.org/r/20230831054620.515611-1-alexhenrie24@gmail.com Signed-off-by: Martin K. Petersen commit 1345a7d909a3c2bcb588667c676a44cb6176b64a Author: Damien Le Moal Date: Wed Sep 13 08:05:51 2023 +0900 scsi: libsas: Declare sas_discover_end_dev() static sas_discover_end_dev() is defined and used only in sas_discover.c. Define this function as static. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230912230551.454357-4-dlemoal@kernel.org Reviewed-by: John Garry Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 9b52c1c6cafd7ebec34f1d2e5e3cdb1a0dffe81b Author: Damien Le Moal Date: Wed Sep 13 08:05:50 2023 +0900 scsi: libsas: Declare sas_set_phy_speed() static sas_set_phy_speed() is used only within sas_init.c. Declare this function as static. Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230912230551.454357-3-dlemoal@kernel.org Reviewed-by: John Garry Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit d10b11dcb08f064aae5357578246588f08d3d127 Author: Damien Le Moal Date: Wed Sep 13 08:05:49 2023 +0900 scsi: libsas: Move local functions declarations to sas_internal.h Move the declarations of functions used only within libsas from include/scsi/libsas.h to drivers/scsi/libsas/sas_internal.h Signed-off-by: Damien Le Moal Link: https://lore.kernel.org/r/20230912230551.454357-2-dlemoal@kernel.org Reviewed-by: John Garry Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit 2c99e3d7d2cba9dc478c050b506c9482aaa08f32 Author: Krzysztof Kozlowski Date: Wed Sep 6 13:33:02 2023 +0200 scsi: ufs: core: Do not look for unsupported vdd-hba-max-microamp Bindings do not allow vdd-hba-max-microamp property and the driver does not use it (does not control load of vdd-hba supply). Skip looking for this property to avoid misleading dmesg messages: ufshcd-qcom 1d84000.ufs: ufshcd_populate_vreg: unable to find vdd-hba-max-microamp Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230906113302.201888-1-krzysztof.kozlowski@linaro.org Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Martin K. Petersen commit dc1d7b363301eb454e1ee5916cb946f5396fd0c7 Author: Ilpo Järvinen Date: Wed Sep 13 15:27:46 2023 +0300 scsi: qla2xxx: Use FIELD_GET() to extract PCIe capability fields Use FIELD_GET() to extract PCIe capability registers field instead of custom masking and shifting. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230913122748.29530-9-ilpo.jarvinen@linux.intel.com Reviewed-by: Jonathan Cameron Signed-off-by: Martin K. Petersen commit 5532f24951503b55b91c4efc1d0f1e7a9e0ec567 Author: Ilpo Järvinen Date: Wed Sep 13 15:27:45 2023 +0300 scsi: esas2r: Use FIELD_GET() to extract PCIe capability fields Use FIELD_GET() to extract PCIe capability register fields instead of custom masking and shifting. Also remove the unnecessary cast to u8, the value in those fields always fits to u8. Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230913122748.29530-8-ilpo.jarvinen@linux.intel.com Reviewed-by: Jonathan Cameron Signed-off-by: Martin K. Petersen commit ccc3e1363069c5955045824bb0e63c51d8873e25 Author: Bart Van Assche Date: Thu Sep 7 11:37:16 2023 -0700 scsi: ufs: core: Include the SCSI ID in UFS command tracing output The logical unit information is missing from the UFS command tracing output. Although the device name is logged, e.g. 13200000.ufs, this name does not include logical unit information. Hence this patch that replaces the device name with the SCSI ID in the tracing output. An example of tracing output with this patch applied: kworker/8:0H-80 [008] ..... 89.106063: ufshcd_command: send_req: 0:0:0:4: tag: 10, DB: 0x7ffffbff, size: 524288, IS: 0, LBA: 1085538, opcode: 0x8a (WRITE_16), group_id: 0x0 dd-4225 [000] d.h.. 89.106219: ufshcd_command: complete_rsp: 0:0:0:4: tag: 11, DB: 0x7ffff7ff, size: 524288, IS: 0, LBA: 1081728, opcode: 0x8a (WRITE_16), group_id: 0x0 Cc: Christoph Hellwig Cc: Steven Rostedt Signed-off-by: Bart Van Assche Link: https://lore.kernel.org/r/20230907183739.905938-1-bvanassche@acm.org Reviewed-by: Can Guo Signed-off-by: Martin K. Petersen commit ae3a94e4adee4429f364a0761233a928c865f3f8 Author: Changhuang Liang Date: Wed Sep 13 14:54:28 2023 +0100 pmdomain: starfive: Add JH7110 AON PMU support Add AON PMU for StarFive JH7110 SoC. It can be used to turn on/off the dphy rx/tx power switch. Reviewed-by: Walker Chen Signed-off-by: Changhuang Liang Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20230913-dude-imprecise-fc32622bc947@spud Signed-off-by: Ulf Hansson commit 296eea56129bdb30680d97b5297b2e6c598976f1 Author: Changhuang Liang Date: Wed Sep 13 14:54:27 2023 +0100 pmdomain: starfive: Extract JH7110 pmu private operations Move JH7110 private operation into private data of compatible. Convenient to add AON PMU which would not have interrupts property. Signed-off-by: Changhuang Liang Reviewed-by: Walker Chen Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20230913-slideshow-luckiness-38ff17de84c6@spud Signed-off-by: Ulf Hansson commit 6238fda156b498269aa66917de0d1342e90cead1 Author: Changhuang Liang Date: Wed Sep 13 14:54:26 2023 +0100 pmdomain: starfive: Replace SOC_STARFIVE with ARCH_STARFIVE Using ARCH_FOO symbol is preferred than SOC_FOO. Reviewed-by: Conor Dooley Reviewed-by: Walker Chen Signed-off-by: Changhuang Liang Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20230913-legibly-treachery-567cffcb5604@spud Signed-off-by: Ulf Hansson commit 41b66b54a72bd796988377bb78f5a0eae6fb5156 Author: Changhuang Liang Date: Wed Sep 13 14:54:25 2023 +0100 dt-bindings: power: Add power-domain header for JH7110 Add power-domain header for JH7110 SoC, it can use to operate dphy power. Signed-off-by: Changhuang Liang Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20230913-grumbly-rewrite-34c85539f2ed@spud Signed-off-by: Ulf Hansson commit e925bcee7d8ddd6e8990c81c89d90a06014b8ba5 Author: Rob Herring Date: Wed Sep 13 14:54:24 2023 +0100 pmdomain: starfive: Explicitly include correct DT includes The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20230913-swooned-ecosphere-aff4a05c1556@spud Signed-off-by: Ulf Hansson commit 64fc9526147c7fc14535134d8ea79b9c8dc549a7 Author: Khadija Kamran Date: Wed Aug 23 12:47:56 2023 +0500 lsm: constify 'bprm' parameter in security_bprm_committing_creds() The 'bprm_committing_creds' hook has implementations registered in SELinux and Apparmor. Looking at the function implementations we observe that the 'bprm' parameter is not changing. Mark the 'bprm' parameter of LSM hook security_bprm_committing_creds() as 'const' since it will not be changing in the LSM hook. Signed-off-by: Khadija Kamran Signed-off-by: Paul Moore commit 550c025d0f0c9684cd9ce151d32fba7ad0cab627 Merge: ca75e4b214c66 54f1618b951fd Author: Ulf Hansson Date: Thu Sep 14 00:11:33 2023 +0200 pmdomain: Merge the genpd_dt branch into the next branch Merge the immutable branch genpd_dt into next, to allow updates to power-domain DT bindings to be tested together with pmdomain updates. Signed-off-by: Ulf Hansson commit ca75e4b214c6614db666db7b5be6fe4d5e2e73b2 Author: xianwei.zhao Date: Mon Sep 11 10:52:22 2023 +0800 pmdomain: amlogic: Add support for T7 power domains controller Add support for T7 power controller. T7 power control registers are in secure domain, and should be accessed by SMC. Signed-off-by: xianwei.zhao Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230911025223.3433776-6-xianwei.zhao@amlogic.com [Ulf: Re-based to fit the pmdomain subsystem] Signed-off-by: Ulf Hansson commit 0a7bd33c996893cff1d1e680c9ea7f9c90b12560 Author: xianwei.zhao Date: Mon Sep 11 10:52:20 2023 +0800 pmdomain: amlogic: init power domain state If initial power domain with 'AWAY_ON' property state is off, turn on the power. Signed-off-by: xianwei.zhao Link: https://lore.kernel.org/r/20230911025223.3433776-4-xianwei.zhao@amlogic.com [Ulf: Re-based to fit the pmdomain subsystem] Signed-off-by: Ulf Hansson commit efa529b31afe50b88f26a529352c8213e82d61be Author: xianwei.zhao Date: Mon Sep 11 10:52:19 2023 +0800 pmdomain: amlogic: add driver to support power parent node Some power domains depends on other domains, Such as Amlogic T7 SoC. Add parent node to support this case. Signed-off-by: xianwei.zhao Link: https://lore.kernel.org/r/20230911025223.3433776-3-xianwei.zhao@amlogic.com [Ulf: Re-based to fit the pmdomain subsystem] Signed-off-by: Ulf Hansson commit 4a00c673068e72c12d243f5c31000246d6984e44 Author: Khadija Kamran Date: Wed Aug 23 12:17:29 2023 +0500 lsm: constify 'file' parameter in security_bprm_creds_from_file() The 'bprm_creds_from_file' hook has implementation registered in commoncap. Looking at the function implementation we observe that the 'file' parameter is not changing. Mark the 'file' parameter of LSM hook security_bprm_creds_from_file() as 'const' since it will not be changing in the LSM hook. Signed-off-by: Khadija Kamran Signed-off-by: Paul Moore commit e35a6cf1cc343d720ad235f678f1cd2a9876b777 Author: Matthew Wilcox (Oracle) Date: Mon Aug 21 15:22:07 2023 +0100 futex: Use a folio instead of a page The futex code already handles compound pages correctly, but using a folio tells the compiler that there is already a reference to the head page and it doesn't need to call compound_head() again. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Thomas Gleixner Reviewed-by: Davidlohr Bueso Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20230821142207.2537124-1-willy@infradead.org commit a251eee62133774cf35ff829041377e721ef9c8c Author: Joshua Hay Date: Mon Aug 7 17:34:16 2023 -0700 idpf: add SRIOV support and other ndo_ops Add support for SRIOV: send the requested number of VFs to the device Control Plane, via the virtchnl message and then enable the VFs using 'pci_enable_sriov'. Add other ndo ops supported by the driver such as features_check, set_rx_mode, validate_addr, set_mac_address, change_mtu, get_stats64, set_features, and tx_timeout. Initialize the statistics task which requests the queue related statistics to the CP. Add loopback and promiscuous mode support and the respective virtchnl messages. Finally, add documentation and build support for the driver. Signed-off-by: Joshua Hay Co-developed-by: Alan Brady Signed-off-by: Alan Brady Co-developed-by: Madhu Chittim Signed-off-by: Madhu Chittim Co-developed-by: Phani Burra Signed-off-by: Phani Burra Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Co-developed-by: Pavan Kumar Linga Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit 02cbfba1add5bd9088c7d14c6b93b77a6ea8f3bb Author: Alan Brady Date: Mon Aug 7 17:34:15 2023 -0700 idpf: add ethtool callbacks Initialize all the ethtool ops that are supported by the driver and add the necessary support for the ethtool callbacks. Also add asynchronous link notification virtchnl support where the device Control Plane sends the link status and link speed as an asynchronous event message. Driver report the link speed on ethtool .idpf_get_link_ksettings query. Introduce soft reset function which is used by some of the ethtool callbacks such as .set_channels, .set_ringparam etc. to change the existing queue configuration. It deletes the existing queues by sending delete queues virtchnl message to the CP and calls the 'vport_stop' flow which disables the queues, vport etc. New set of queues are requested to the CP and reconfigure the queue context by calling the 'vport_open' flow. Soft reset flow also adjusts the number of vectors associated to a vport if .set_channels is called. Signed-off-by: Alan Brady Co-developed-by: Alice Michael Signed-off-by: Alice Michael Co-developed-by: Joshua Hay Signed-off-by: Joshua Hay Co-developed-by: Phani Burra Signed-off-by: Phani Burra Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Co-developed-by: Pavan Kumar Linga Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit a5ab9ee0df0be82aefb099d29b707d2b106e1c87 Author: Joshua Hay Date: Mon Aug 7 17:34:14 2023 -0700 idpf: add singleq start_xmit and napi poll Add the start_xmit, TX and RX napi poll support for the single queue model. Unlike split queue model, single queue uses same queue to post buffer descriptors and completed descriptors. Signed-off-by: Joshua Hay Co-developed-by: Alan Brady Signed-off-by: Alan Brady Co-developed-by: Madhu Chittim Signed-off-by: Madhu Chittim Co-developed-by: Phani Burra Signed-off-by: Phani Burra Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Co-developed-by: Pavan Kumar Linga Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit 3a8845af66edb340ba9210bb8a0da040c7d6e590 Author: Alan Brady Date: Mon Aug 7 17:34:13 2023 -0700 idpf: add RX splitq napi poll support Add support to handle interrupts for the RX completion queue and RX buffer queue. When the interrupt fires on RX completion queue, process the RX descriptors that are received. Allocate and prepare the SKB with the RX packet info, for both data and header buffer. IDPF uses software maintained refill queues to manage buffers between RX queue producer and the buffer queue consumer. They are required in order to maintain a lockless buffer management system and are strictly software only constructs. Instead of updating the RX buffer queue tail with available buffers right after the clean routine, it posts the buffer ids to the refill queues, only to post them to the HW later. If the generic receive offload (GRO) is enabled in the capabilities and turned on by default or via ethtool, then HW performs the packet coalescing if certain criteria are met by the incoming packets and updates the RX descriptor. Similar to GRO, if generic checksum is enabled, HW computes the checksum and updates the respective fields in the descriptor. Add support to update the SKB fields with the GRO and the generic checksum received. Signed-off-by: Alan Brady Co-developed-by: Joshua Hay Signed-off-by: Joshua Hay Co-developed-by: Madhu Chittim Signed-off-by: Madhu Chittim Co-developed-by: Phani Burra Signed-off-by: Phani Burra Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Acked-by: Jakub Kicinski Co-developed-by: Pavan Kumar Linga Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit c2d548cad1508d334517bcbd7cd5c915cc831fc0 Author: Joshua Hay Date: Mon Aug 7 17:34:12 2023 -0700 idpf: add TX splitq napi poll support Add support to handle the interrupts for the TX completion queue and process the various completion types. In the flow scheduling mode, the driver processes primarily buffer completions as well as descriptor completions occasionally. This mode supports out of order TX completions. To do so, HW generates one buffer completion per packet. Each of those completions contains the unique tag provided during the TX encoding which is used to locate the packet either on the TX buffer ring or in a hash table. The hash table is used to track TX buffer information so the descriptor(s) for a given packet can be reused while the driver is still waiting on the buffer completion(s). Packets end up in the hash table in one of 2 ways: 1) a packet was stashed during descriptor completion cleaning, or 2) because an out of order buffer completion was processed. A descriptor completion arrives only every so often and is primarily used to guarantee the TX descriptor ring can be reused without having to wait on the individual buffer completions. E.g. a descriptor completion for N+16 guarantees HW read all of the descriptors for packets N through N+15, therefore all of the buffers for packets N through N+15 are stashed into the hash table and the descriptors can be reused for more TX packets. Similarly, a packet can be stashed in the hash table because an out an order buffer completion was processed. E.g. processing a buffer completion for packet N+3 implies that HW read all of the descriptors for packets N through N+3 and they can be reused. However, the HW did not do the DMA yet. The buffers for packets N through N+2 cannot be freed, so they are stashed in the hash table. In either case, the buffer completions will eventually be processed for all of the stashed packets, and all of the buffers will be cleaned from the hash table. In queue based scheduling mode, the driver processes primarily descriptor completions and cleans the TX ring the conventional way. Finally, the driver triggers a TX queue drain after sending the disable queues virtchnl message. When the HW completes the queue draining, it sends the driver a queue marker packet completion. The driver determines when all TX queues have been drained and proceeds with the disable flow. With this, the driver can send TX packets and clean up the resources properly. Signed-off-by: Joshua Hay Co-developed-by: Alan Brady Signed-off-by: Alan Brady Co-developed-by: Madhu Chittim Signed-off-by: Madhu Chittim Co-developed-by: Phani Burra Signed-off-by: Phani Burra Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Co-developed-by: Pavan Kumar Linga Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit 6818c4d5b3c2e9dd5d7316792f88d371d07d0ebf Author: Joshua Hay Date: Mon Aug 7 17:34:11 2023 -0700 idpf: add splitq start_xmit Add start_xmit support for split queue model. To start with, add the necessary checks to linearize the skb if it uses more number of buffers than the hardware supported limit. Stop the transmit queue if there are no enough descriptors available for the skb to use or if there we're going to potentially overrun the completion queue. Finally prepare the descriptor with all the required information and update the tail. Signed-off-by: Joshua Hay Co-developed-by: Alan Brady Signed-off-by: Alan Brady Co-developed-by: Madhu Chittim Signed-off-by: Madhu Chittim Co-developed-by: Phani Burra Signed-off-by: Phani Burra Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Co-developed-by: Pavan Kumar Linga Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit d4d5587182664b0c4ab6d3556ce881cb975507c2 Author: Pavan Kumar Linga Date: Mon Aug 7 17:34:10 2023 -0700 idpf: initialize interrupts and enable vport To further continue 'vport open', initialize all the resources required for the interrupts. To start with, initialize the queue vector indices with the ones received from the device Control Plane. Now that all the TX and RX queues are initialized, map the RX descriptor and buffer queues as well as TX completion queues to the allocated vectors. Initialize and enable the napi handler for the napi polling. Finally, request the IRQs for the interrupt vectors from the stack and setup the interrupt handler. Once the interrupt init is done, send 'map queue vector', 'enable queues' and 'enable vport' virtchnl messages to the CP to complete the 'vport open' flow. Co-developed-by: Alan Brady Signed-off-by: Alan Brady Co-developed-by: Joshua Hay Signed-off-by: Joshua Hay Co-developed-by: Madhu Chittim Signed-off-by: Madhu Chittim Co-developed-by: Phani Burra Signed-off-by: Phani Burra Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit 95af467d9a4e3be0204a51e640509a701bbe4581 Author: Alan Brady Date: Mon Aug 7 17:34:09 2023 -0700 idpf: configure resources for RX queues Similar to the TX, RX also supports both single and split queue models. In single queue model, the same descriptor queue is used by SW to post buffer descriptors to HW and by HW to post completed descriptors to SW. In split queue model, "RX buffer queues" are used to pass descriptor buffers from SW to HW whereas "RX queues" are used to post the descriptor completions i.e. descriptors that point to completed buffers, from HW to SW. "RX queue group" is a set of RX queues grouped together and will be serviced by a "RX buffer queue group". IDPF supports 2 buffer queues i.e. large buffer (4KB) queue and small buffer (2KB) queue per buffer queue group. HW uses large buffers for 'hardware gro' feature and also if the packet size is more than 2KB, if not 2KB buffers are used. Add all the resources required for the RX queues initialization. Allocate memory for the RX queue and RX buffer queue groups. Initialize the software maintained refill queues for buffer management algorithm. Same like the TX queues, initialize the queue parameters for the RX queues and send the config RX queue virtchnl message to the device Control Plane. Signed-off-by: Alan Brady Co-developed-by: Alice Michael Signed-off-by: Alice Michael Co-developed-by: Joshua Hay Signed-off-by: Joshua Hay Co-developed-by: Madhu Chittim Signed-off-by: Madhu Chittim Co-developed-by: Phani Burra Signed-off-by: Phani Burra Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Co-developed-by: Pavan Kumar Linga Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit 1c325aac10a82f11410da8a2bf35e3e410a42751 Author: Alan Brady Date: Mon Aug 7 17:34:08 2023 -0700 idpf: configure resources for TX queues IDPF supports two queue models i.e. single queue which is a traditional queueing model as well as split queue model. In single queue model, the same descriptor queue is used by SW to post descriptors to the HW, HW to post completed descriptors to SW. In split queue model, "TX Queues" are used to pass buffers from SW to HW and "TX Completion Queues" are used to post descriptor completions from HW to SW. Device supports asymmetric ratio of TX queues to TX completion queues. Considering this, queue group mechanism is used i.e. some TX queues are grouped together which will be serviced by only one TX completion queue per TX queue group. Add all the resources required for the TX queues initialization. To start with, allocate memory for the TX queue groups, TX queues and TX completion queues. Then, allocate the descriptors for both TX and TX completion queues, and bookkeeping buffers for TX queues alone. Also, allocate queue vectors for the vport and initialize the TX queue related fields for each queue vector. Initialize the queue parameters such as q_id, q_type and tail register offset with the info received from the device control plane (CP). Once all the TX queues are configured, send config TX queue virtchnl message to the CP with all the TX queue context information. Signed-off-by: Alan Brady Co-developed-by: Alice Michael Signed-off-by: Alice Michael Co-developed-by: Joshua Hay Signed-off-by: Joshua Hay Co-developed-by: Phani Burra Signed-off-by: Phani Burra Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Co-developed-by: Pavan Kumar Linga Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit ce1b75d0635ce6daf7c1c3c75ea2f0da61e065b0 Author: Pavan Kumar Linga Date: Mon Aug 7 17:34:07 2023 -0700 idpf: add ptypes and MAC filter support Add the virtchnl support to request the packet types. Parse the responses received from CP and based on the protocol headers, populate the packet type structure with necessary information. Initialize the MAC address and add the virtchnl support to add and del MAC address. Co-developed-by: Alan Brady Signed-off-by: Alan Brady Co-developed-by: Joshua Hay Signed-off-by: Joshua Hay Co-developed-by: Madhu Chittim Signed-off-by: Madhu Chittim Co-developed-by: Phani Burra Signed-off-by: Phani Burra Co-developed-by: Shailendra Bhatnagar Signed-off-by: Shailendra Bhatnagar Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit 0fe45467a1041ea3657a7fa3a791c84c104fbd34 Author: Pavan Kumar Linga Date: Mon Aug 7 17:34:06 2023 -0700 idpf: add create vport and netdev configuration Add the required support to create a vport by spawning the init task. Once the vport is created, initialize and allocate the resources needed for it. Configure and register a netdev for each vport with all the features supported by the device based on the capabilities received from the device Control Plane. Spawn the init task till all the default vports are created. Co-developed-by: Alan Brady Signed-off-by: Alan Brady Co-developed-by: Joshua Hay Signed-off-by: Joshua Hay Co-developed-by: Madhu Chittim Signed-off-by: Madhu Chittim Co-developed-by: Phani Burra Signed-off-by: Phani Burra Co-developed-by: Shailendra Bhatnagar Signed-off-by: Shailendra Bhatnagar Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit 4930fbf419a72d7477426fd883bfc37e20a61a6e Author: Pavan Kumar Linga Date: Mon Aug 7 17:34:05 2023 -0700 idpf: add core init and interrupt request As the mailbox is setup, add the necessary send and receive mailbox message framework to support the virtchnl communication between the driver and device Control Plane (CP). Add the core initialization. To start with, driver confirms the virtchnl version with the CP. Once that is done, it requests and gets the required capabilities and resources needed such as max vectors, queues etc. Based on the vector information received in 'VIRTCHNL2_OP_GET_CAPS', request the stack to allocate the required vectors. Finally add the interrupt handling mechanism for the mailbox queue and enable the interrupt. Note: Checkpatch issues a warning about IDPF_FOREACH_VPORT_VC_STATE and IDPF_GEN_STRING being complex macros and should be enclosed in parentheses but it's not the case. They are never used as a statement and instead only used to define the enum and array. Co-developed-by: Alan Brady Signed-off-by: Alan Brady Co-developed-by: Emil Tantilov Signed-off-by: Emil Tantilov Co-developed-by: Joshua Hay Signed-off-by: Joshua Hay Co-developed-by: Madhu Chittim Signed-off-by: Madhu Chittim Co-developed-by: Phani Burra Signed-off-by: Phani Burra Co-developed-by: Shailendra Bhatnagar Signed-off-by: Shailendra Bhatnagar Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit 8077c727561aace410a67c82d6f058c9bc544b8f Author: Joshua Hay Date: Mon Aug 7 17:34:04 2023 -0700 idpf: add controlq init and reset checks At the end of the probe, initialize and schedule the event workqueue. It calls the hard reset function where reset checks are done to find if the device is out of the reset. Control queue initialization and the necessary control queue support is added. Introduce function pointers for the register operations which are different between PF and VF devices. Signed-off-by: Joshua Hay Co-developed-by: Alan Brady Signed-off-by: Alan Brady Co-developed-by: Madhu Chittim Signed-off-by: Madhu Chittim Co-developed-by: Phani Burra Signed-off-by: Phani Burra Co-developed-by: Shailendra Bhatnagar Signed-off-by: Shailendra Bhatnagar Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Co-developed-by: Pavan Kumar Linga Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit e850efed5e152e6bdd367d5b82019f21298c0653 Author: Phani Burra Date: Mon Aug 7 17:34:03 2023 -0700 idpf: add module register and probe functionality Add the required support to register IDPF PCI driver, as well as probe and remove call backs. Enable the PCI device and request the kernel to reserve the memory resources that will be used by the driver. Finally map the BAR0 address space. Signed-off-by: Phani Burra Co-developed-by: Alan Brady Signed-off-by: Alan Brady Co-developed-by: Madhu Chittim Signed-off-by: Madhu Chittim Co-developed-by: Shailendra Bhatnagar Signed-off-by: Shailendra Bhatnagar Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Acked-by: Jakub Kicinski Co-developed-by: Pavan Kumar Linga Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit 0d7502a9b4a7b7e99dea1dc90c2de6c31d015e26 Author: Pavan Kumar Linga Date: Mon Aug 7 17:34:02 2023 -0700 virtchnl: add virtchnl version 2 ops Virtchnl version 1 is an interface used by the current generation of foundational NICs to negotiate the capabilities and configure the HW resources such as queues, vectors, RSS LUT, etc between the PF and VF drivers. It is not extensible to enable new features supported in the next generation of NICs/IPUs and to negotiate descriptor types, packet types and register offsets. To overcome the limitations of the existing interface, introduce the virtchnl version 2 and add the necessary opcodes, structures, definitions, and descriptor formats. The driver also learns the data queue and other register offsets to use instead of hardcoding them. The advantage of this approach is that it gives the flexibility to modify the register offsets if needed, restrict the use of certain descriptor types and negotiate the supported packet types. Co-developed-by: Alan Brady Signed-off-by: Alan Brady Co-developed-by: Joshua Hay Signed-off-by: Joshua Hay Co-developed-by: Madhu Chittim Signed-off-by: Madhu Chittim Co-developed-by: Phani Burra Signed-off-by: Phani Burra Co-developed-by: Sridhar Samudrala Signed-off-by: Sridhar Samudrala Reviewed-by: Sridhar Samudrala Reviewed-by: Willem de Bruijn Acked-by: Jakub Kicinski Signed-off-by: Pavan Kumar Linga Signed-off-by: Tony Nguyen commit 25cc71d1527b55c880d333e7cc1dc37aeef9843f Author: Khadija Kamran Date: Wed Aug 23 11:44:41 2023 +0500 lsm: constify 'sb' parameter in security_quotactl() SELinux registers the implementation for the "quotactl" hook. Looking at the function implementation we observe that the parameter "sb" is not changing. Mark the "sb" parameter of LSM hook security_quotactl() as "const" since it will not be changing in the LSM hook. Signed-off-by: Khadija Kamran Signed-off-by: Paul Moore commit 558c50cc3b135e00c9ed15df4c9159e84166f94c Author: Quan Tian Date: Mon Sep 11 15:23:53 2023 +0000 docs/bpf: update out-of-date doc in BPF flow dissector Commit a5e2151ff9d5 ("net/ipv6: SKB symmetric hash should incorporate transport ports") removed the use of FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL in __skb_get_hash_symmetric(), making the doc out-of-date. Signed-off-by: Quan Tian Link: https://lore.kernel.org/r/20230911152353.8280-1-qtian@vmware.com Signed-off-by: Martin KaFai Lau commit cfaa4c32ccd3a4cb1140416a9ab51904e938d767 Author: Marian Postevca Date: Thu Sep 14 00:09:16 2023 +0300 ASoC: amd: acp: Fix -Wmissing-prototypes warning Fix prototype missing warning for acp3x_es83xx_init_ops() by including the header acp3x-es83xx.h Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309111220.g63yHDfH-lkp@intel.com/ Signed-off-by: Marian Postevca Link: https://lore.kernel.org/r/20230913210916.2523-1-posteuca@mutex.one Signed-off-by: Mark Brown commit fc71f615fd08a530d24c7af0a1efa72ec6ea8e34 Author: Nathan Chancellor Date: Wed Sep 13 09:10:36 2023 -0700 drm/amd/display: Fix -Wuninitialized in dm_helpers_dp_mst_send_payload_allocation() When building with clang, there is a warning (or error when CONFIG_WERROR is set): drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:368:21: error: variable 'old_payload' is uninitialized when used here [-Werror,-Wuninitialized] 368 | new_payload, old_payload); | ^~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:344:61: note: initialize the variable 'old_payload' to silence this warning 344 | struct drm_dp_mst_atomic_payload *new_payload, *old_payload; | ^ | = NULL 1 error generated. This variable is not required outside of this function so allocate old_payload on the stack and pass it by reference to dm_helpers_construct_old_payload(), resolving the warning. Closes: https://github.com/ClangBuiltLinux/linux/issues/1931 Fixes: 5aa1dfcdf0a4 ("drm/mst: Refactor the flow for payload allocation/removement") Reviewed-by: Hamza Mahfooz Signed-off-by: Nathan Chancellor Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20230913-fix-wuninitialized-dm_helpers_dp_mst_send_payload_allocation-v1-1-2d1b0a3ef16c@kernel.org commit bc51fbeea39e34b9a01820fea5b6092fcc5b48f2 Merge: 8885ab34201c5 1a1c3d794ef65 Author: Mark Brown Date: Wed Sep 13 21:48:57 2023 +0100 ASoC: cs35l56: Use PCI SSID to select specific Merge series from Richard Fitzgerald : The PCI device registers contain a subsystem ID (SSID), that is separate from the silicon ID. The PCI specification defines it thus: "They provide a mechanism for board vendors to distiguish their boards from one another even thought the boards may have the same PCI controller on them." This allows the driver for the silicon part to apply board-speficic settings based on this SSID. The CS35L56 driver uses this to select the correct firmware file for the board. The actual ID is part of the PCI register set of the host audio interface so this set of patches includes extracting the SSID from the Intel audio controller and passing it to the machine driver and then to ASoC components. Other PCI audio controllers will have the same SSID registers, so can use the same mechanism to pass the SSID. commit 0ae9942f03d0d034fdb0a4f44fc99f62a3107987 Author: Paul E. McKenney Date: Fri Aug 18 08:53:58 2023 -0700 rcu: Eliminate rcu_gp_slow_unregister() false positive When using rcutorture as a module, there are a number of conditions that can abort the modprobe operation, for example, when attempting to run both RCU CPU stall warning tests and forward-progress tests. This can cause rcu_torture_cleanup() to be invoked on the unwind path out of rcu_rcu_torture_init(), which will mean that rcu_gp_slow_unregister() is invoked without a matching rcu_gp_slow_register(). This will cause a splat because rcu_gp_slow_unregister() is passed rcu_fwd_cb_nodelay, which does not match a NULL pointer. This commit therefore forgives a mismatch involving a NULL pointer, thus avoiding this false-positive splat. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 2cbc482d325ee58001472c4359b311958c4efdd1 Author: Zhen Lei Date: Sat Aug 5 11:17:26 2023 +0800 rcu: Dump memory object info if callback function is invalid When a structure containing an RCU callback rhp is (incorrectly) freed and reallocated after rhp is passed to call_rcu(), it is not unusual for rhp->func to be set to NULL. This defeats the debugging prints used by __call_rcu_common() in kernels built with CONFIG_DEBUG_OBJECTS_RCU_HEAD=y, which expect to identify the offending code using the identity of this function. And in kernels build without CONFIG_DEBUG_OBJECTS_RCU_HEAD=y, things are even worse, as can be seen from this splat: Unable to handle kernel NULL pointer dereference at virtual address 0 ... ... PC is at 0x0 LR is at rcu_do_batch+0x1c0/0x3b8 ... ... (rcu_do_batch) from (rcu_core+0x1d4/0x284) (rcu_core) from (__do_softirq+0x24c/0x344) (__do_softirq) from (__irq_exit_rcu+0x64/0x108) (__irq_exit_rcu) from (irq_exit+0x8/0x10) (irq_exit) from (__handle_domain_irq+0x74/0x9c) (__handle_domain_irq) from (gic_handle_irq+0x8c/0x98) (gic_handle_irq) from (__irq_svc+0x5c/0x94) (__irq_svc) from (arch_cpu_idle+0x20/0x3c) (arch_cpu_idle) from (default_idle_call+0x4c/0x78) (default_idle_call) from (do_idle+0xf8/0x150) (do_idle) from (cpu_startup_entry+0x18/0x20) (cpu_startup_entry) from (0xc01530) This commit therefore adds calls to mem_dump_obj(rhp) to output some information, for example: slab kmalloc-256 start ffff410c45019900 pointer offset 0 size 256 This provides the rough size of the memory block and the offset of the rcu_head structure, which as least provides at least a few clues to help locate the problem. If the problem is reproducible, additional slab debugging can be enabled, for example, CONFIG_DEBUG_SLAB=y, which can provide significantly more information. Signed-off-by: Zhen Lei Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 6e284c55fc0bef7d25fd34d29db11f483da60ea4 Author: Zhen Lei Date: Sat Aug 5 11:17:25 2023 +0800 mm: Remove kmem_valid_obj() Function kmem_dump_obj() will splat if passed a pointer to a non-slab object. So nothing calls it directly, instead calling kmem_valid_obj() first to determine whether the passed pointer to a valid slab object. This means that merging kmem_valid_obj() into kmem_dump_obj() will make the code more concise. Therefore, convert kmem_dump_obj() to work the same way as vmalloc_dump_obj(), removing the need for the kmem_dump_obj() caller to check kmem_valid_obj(). After this, there are no remaining calls to kmem_valid_obj() anymore, and it can be safely removed. Suggested-by: Matthew Wilcox Signed-off-by: Zhen Lei Reviewed-by: Matthew Wilcox (Oracle) Acked-by: Vlastimil Babka Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit b93c5fe16e4aa177cd072c1c4652cbe1b19a7812 Author: Yue Haibing Date: Thu Aug 3 21:49:19 2023 +0800 rcu: Remove unused function declaration rcu_eqs_special_set() Commit a86baa69c2b7 ("rcu: Remove special bit at the bottom of the ->dynticks counter") left behind this, remove it. Signed-off-by: Yue Haibing Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 16128b1f8c823438dcd3f3b4a57cbe7267bcf82f Author: Paul E. McKenney Date: Tue Aug 1 17:15:25 2023 -0700 rcu: Add sysfs to provide throttled access to rcu_barrier() When running a series of stress tests all making heavy use of RCU, it is all too possible to OOM the system when the prior test's RCU callbacks don't get invoked until after the subsequent test starts. One way of handling this is just a timed wait, but this fails when a given CPU has so many callbacks queued that they take longer to invoke than allowed for by that timed wait. This commit therefore adds an rcutree.do_rcu_barrier module parameter that is accessible from sysfs. Writing one of the many synonyms for boolean "true" will cause an rcu_barrier() to be invoked, but will guarantee that no more than one rcu_barrier() will be invoked per sixteenth of a second via this mechanism. The flip side is that a given request might wait a second or three longer than absolutely necessary, but only when there are multiple uses of rcutree.do_rcu_barrier within a one-second time interval. This commit unnecessarily serializes the rcu_barrier() machinery, given that serialization is already provided by procfs. This has the advantage of allowing throttled rcu_barrier() from other sources within the kernel. Reported-by: Johannes Weiner Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 4502138acc8f4139c94ce0ec0eee926f8805fbbc Author: Joel Fernandes (Google) Date: Sat Jul 29 14:27:36 2023 +0000 rcu/tree: Remove superfluous return from void call_rcu* functions The return keyword is not needed here. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit f0a31b26be1f725e3f56beed76486c1b034120b3 Author: Joel Fernandes (Google) Date: Sat Jul 29 14:27:32 2023 +0000 srcu: Fix error handling in init_srcu_struct_fields() The current error handling in init_srcu_struct_fields() is a bit inconsistent. If init_srcu_struct_nodes() fails, the function either returns -ENOMEM or 0 depending on whether ssp->sda_is_static is true or false. This can make init_srcu_struct_fields() return 0 even if memory allocation failed! Simplify the error handling by always returning -ENOMEM if either init_srcu_struct_nodes() or the per-CPU allocation fails. This makes the control flow easier to follow and avoids the inconsistent return values. Add goto labels to avoid duplicating the error cleanup code. Link: https://lore.kernel.org/r/20230404003508.GA254019@google.com Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit ff18cb816427c3738d5d3fd23b7939a813935e15 Author: Joel Fernandes (Google) Date: Tue Jul 25 23:29:10 2023 +0000 Revert "checkpatch: Error out if deprecated RCU API used" The definition for single-argument kfree_rcu() has been removed, so that any further attempt to use it will result in a build error. Because of this build error, there is no longer any need for a special check in checkpatch.pl. Therefore, revert commit 1eacac3255495be7502d406e2ba5444fb5c3607c. Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit e9104e73d4fc8a023608be9c18ee1b897d0ccb14 Author: Robert Marko Date: Fri Sep 1 20:10:05 2023 +0200 soc: qcom: socinfo: Add IDs for IPQ8174 family IPQ8174 (Oak) family is part of the IPQ8074 family, but the ID-s for it are missing so lets add them. Signed-off-by: Robert Marko Reviewed-by: Kathiravan T Link: https://lore.kernel.org/r/20230901181041.1538999-2-robimarko@gmail.com Signed-off-by: Bjorn Andersson commit b8c889bef9797a58b8b5aad23875cc4d04b3efd3 Author: Robert Marko Date: Fri Sep 1 20:10:04 2023 +0200 dt-bindings: arm: qcom,ids: Add IDs for IPQ8174 family IPQ8174 (Oak) family is part of the IPQ8074 family, but the ID-s for it are missing so lets add them. Signed-off-by: Robert Marko Reviewed-by: Kathiravan T Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230901181041.1538999-1-robimarko@gmail.com Signed-off-by: Bjorn Andersson commit 274707b773378f4ce8ba214002b3d67a4d0785ae Author: Konrad Dybcio Date: Wed Aug 30 14:48:41 2023 +0200 dt-bindings: qcom: geni-se: Allow dma-coherent On SM8550, the QUP controller is coherent with the CPU. Allow specifying that. Signed-off-by: Konrad Dybcio Acked-by: Rob Herring Link: https://lore.kernel.org/r/20230830-topic-8550_dmac2-v1-2-49bb25239fb1@linaro.org Signed-off-by: Bjorn Andersson commit 59872d59d164ec67f295d6f96fe818b92973ee40 Author: Luca Weiss Date: Wed Aug 30 11:58:33 2023 +0200 soc: qcom: socinfo: Add SoC ID for QCM6490 Add SoC ID table entries for Qualcomm QCM6490. Signed-off-by: Luca Weiss Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230830-fp5-initial-v1-8-5a954519bbad@fairphone.com Signed-off-by: Bjorn Andersson commit ccfb4d8b606302d857a03ea29039e21029311335 Author: Luca Weiss Date: Wed Aug 30 11:58:32 2023 +0200 dt-bindings: arm: qcom,ids: Add SoC ID for QCM6490 Add the ID for the Qualcomm QCM6490 SoC. Signed-off-by: Luca Weiss Reviewed-by: Krzysztof Kozlowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230830-fp5-initial-v1-7-5a954519bbad@fairphone.com Signed-off-by: Bjorn Andersson commit 3b1eba1882b74c0e9b9f158ee027e309b1df4782 Author: Konrad Dybcio Date: Wed Aug 30 04:42:43 2023 +0200 soc: qcom: socinfo: Add SM8550-adjacent PMICs Many of the PMICs were missing, add some of them often coupled with SM8550. Signed-off-by: Konrad Dybcio Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230830-topic-pm8550abcxyz-v1-1-3c3ef3d92d51@linaro.org Signed-off-by: Bjorn Andersson commit 9dc03309fe9ba9f9b26a37b2dd4fa2d5111a1ccf Author: Lars-Peter Clausen Date: Sun Sep 10 07:09:03 2023 -0700 iio: ad4310: Replace devm_clk_register() with devm_clk_hw_register() The devm_clk_register() is deprecated and devm_clk_hw_register() should be used as a replacement. Switching to the clk_hw interface also allows to use the built-in device managed version of registering the clock provider. The non-clk_hw interface does not have a device managed version. Signed-off-by: Lars-Peter Clausen Reviewed-by: Nuno Sa Link: https://lore.kernel.org/r/20230910140903.551081-1-lars@metafoo.de Signed-off-by: Jonathan Cameron commit c2bfe2b7a921906858006d72fd822f6121f6649f Author: Li Zetao Date: Tue Aug 8 10:14:46 2023 +0800 soc: qcom: wcnss_ctrl: Remove redundant initialization owner in wcnss_ctrl_driver The module_rpmsg_driver() will set "THIS_MODULE" to driver.owner when register a rpmsg_driver driver, so it is redundant initialization to set driver.owner in the statement. Remove it for clean code. Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230808021446.2975843-1-lizetao1@huawei.com Signed-off-by: Bjorn Andersson commit 1fa2d1a887c763246662a88e203d69b36052770c Author: Adam Skladowski Date: Sat Aug 12 13:24:48 2023 +0200 clk: qcom: hfpll: Add MSM8976 PLL data Add PLL configuration for MSM8976 SoC, this SoC offers 3 HFPLL. Small cluster offers two presets for 652-902Mhz range and 902Mhz-1.47Ghz. For simplicity only add second range as smaller frequencies can be obtained via apcs divider or safe parent this also saves us a hassle of reconfiguring VCO bit and config_val. A72 and CCI cluster only use single frequency range with their outputs/post_dividers/vco_bits being static. Signed-off-by: Adam Skladowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230812112534.8610-6-a39.skl@gmail.com Signed-off-by: Bjorn Andersson commit de37ca2dc98607e74522d8f243aa7feac74577c5 Author: Adam Skladowski Date: Sat Aug 12 13:24:47 2023 +0200 dt-bindings: clock: qcom,hfpll: Document MSM8976 compatibles Document MSM8976 HFPLL compatibles. Signed-off-by: Adam Skladowski Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230812112534.8610-5-a39.skl@gmail.com Signed-off-by: Bjorn Andersson commit 34e000c0963e55f24be2254fa645f8dd8257a9e0 Author: Adam Skladowski Date: Sat Aug 12 13:24:46 2023 +0200 clk: qcom: hfpll: Allow matching pdata HFPLL driver can be used to drive PLLs also on different SoCs like MSM8976 On MSM8976 each PLL gets it own different configuration, add matching pdata to driver to support multiple configurations. Signed-off-by: Adam Skladowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230812112534.8610-4-a39.skl@gmail.com Signed-off-by: Bjorn Andersson commit 500a4609eef46d49a260173b66cabb20bd5159ad Author: Adam Skladowski Date: Sat Aug 12 13:24:45 2023 +0200 clk: qcom: clk-hfpll: Configure l_val in init when required Add support for pre-configuring default frequency multiplier, this appears to be required on some platforms like MSM8976. Without configuring L_VAL device reboots when trying to bring PLL up. Signed-off-by: Adam Skladowski Reviewed-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230812112534.8610-3-a39.skl@gmail.com Signed-off-by: Bjorn Andersson commit e670bfe2736d3bd4436d160d37544e029f2aa813 Author: Antoniu Miclaus Date: Mon Sep 11 17:29:50 2023 +0300 iio: addac: ad74413r: update channel function set According to the datasheet switching to a new channel function implies multiple steps. All functions must be selected for a minimum of 130 μs before changing to another function. The DAC_CODEx registers are not reset by changing channel functions. Prior to changing channel functions, it is recommended to set the DAC code to 0x0000 via the DAC_CODEx registers. Set the channel function to high impedance via the CH_FUNC_SETUPx registers before transitioning to the new channel function. After the new channel function is configured, it is recommended to wait 150 μs before updating the DAC code. Even though the channel switch is done at only at probe, where a device reset is performed, that does not guarantee that the steps prior changing to new channel function should be neglected. Signed-off-by: Antoniu Miclaus Link: https://lore.kernel.org/r/20230911142950.216687-1-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron commit 776b29eb57849bd81ece3e82b1b1b76452dde017 Author: Danila Tikhonov Date: Wed Sep 13 21:17:22 2023 +0300 soc: qcom: socinfo: Add Soc ID for SM7150P Add Soc ID table entries for Qualcomm SM7150P. Signed-off-by: Danila Tikhonov Link: https://lore.kernel.org/r/20230913181722.13917-3-danila@jiaxyga.com Signed-off-by: Bjorn Andersson commit edc3a1fb626bfb191228fb40a9ddd8806a77eeb9 Author: Danila Tikhonov Date: Wed Sep 13 21:17:21 2023 +0300 dt-bindings: arm: qcom,ids: Add Soc ID for SM7150P Add the ID for the Qualcomm SM7150P SoC. Signed-off-by: Danila Tikhonov Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230913181722.13917-2-danila@jiaxyga.com Signed-off-by: Bjorn Andersson commit c3ca98396ffabcea6573bce872d2f8d494c3f7b4 Author: Douglas Anderson Date: Fri Sep 1 16:41:14 2023 -0700 drm/ingenic: Call drm_atomic_helper_shutdown() at shutdown time Based on grepping through the source code this driver appears to be missing a call to drm_atomic_helper_shutdown() at system shutdown time. Among other things, this means that if a panel is in use that it won't be cleanly powered off at system shutdown time. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown/restart comes straight out of the kernel doc "driver instance overview" in drm_drv.c. Since this driver uses the component model and shutdown happens at the base driver, we communicate whether we have to call drm_atomic_helper_shutdown() by seeing if drvdata is non-NULL. Suggested-by: Maxime Ripard Acked-by: Paul Cercueil Reviewed-by: Maxime Ripard Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230901164111.RFT.3.Iea742f06d8bec41598aa40378fc625fbd7e8a3d6@changeid commit b00839ca4cca8aa9641c121c848a553d6220ce70 Author: Justin Stitt Date: Wed Sep 13 17:13:04 2023 +0000 ipmi: refactor deprecated strncpy `strncpy` is deprecated for use on NUL-terminated destination strings [1]. In this case, strncpy is being used specifically for its NUL-padding behavior (and has been commented as such). Moreover, the destination string is not required to be NUL-terminated [2]. We can use a more robust and less ambiguous interface in `memcpy_and_pad` which makes the code more readable and even eliminates the need for that comment. Let's also use `strnlen` instead of `strlen()` with an upper-bounds check as this is intrinsically a part of `strnlen`. Also included in this patch is a simple 1:1 change of `strncpy` to `strscpy` for ipmi_ssif.c. If NUL-padding is wanted here as well then we should opt again for `strscpy_pad`. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] Link: https://lore.kernel.org/all/ZQEADYBl0uZ1nX60@mail.minyard.net/ [2] Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Cc: Kees Cook Signed-off-by: Justin Stitt Message-Id: <20230913-strncpy-drivers-char-ipmi-ipmi-v2-1-e3bc0f6e599f@google.com> Signed-off-by: Corey Minyard commit 8885ab34201c5c34a82539ba2753e8e743b38f38 Author: Seven Lee Date: Wed Sep 13 14:40:03 2023 +0800 ASoC: nau8821: Revise MICBIAS control for power saving. The patch helps save power by control MICBIAS. The headset's MICBIAS should be disabled without button requirement. Signed-off-by: Seven Lee Link: https://lore.kernel.org/r/20230913064003.2925997-1-wtli@nuvoton.com Signed-off-by: Mark Brown commit 9d140885e35dac6dff2c56eccacc13f4fc96188a Author: Jacob Satterfield Date: Wed Sep 6 15:46:06 2023 +0000 selinux: hweight optimization in avtab_read_item avtab_read_item() is a hot function called when reading each rule in a binary policydb. With the current Fedora policy and refpolicy, this function is called nearly 100,000 times per policy load. A single avtab node is only permitted to have a single specifier to describe the data it holds. As such, a check is performed to make sure only one specifier is set. Previously this was done via a for-loop. However, there is already an optimal function for finding the number of bits set (hamming weight) and on some architectures, dedicated instructions (popcount) which can be executed much more efficiently. Even when using -mcpu=generic on a x86-64 Fedora 38 VM, this commit results in a modest 2-4% speedup for policy loading due to a substantial reduction in the number of instructions executed. Signed-off-by: Jacob Satterfield Reviewed-by: Stephen Smalley Signed-off-by: Paul Moore commit 37b7ea3ca3062f5b7f02c2b335f203e4d411793d Author: Christian Göttsche Date: Fri Aug 18 17:12:16 2023 +0200 selinux: improve role transition hashing The number of buckets is calculated by performing a binary AND against the mask of the hash table, which is one less than its size (which is a power of two). This leads to all top bits being discarded, e.g. with the Reference Policy on Debian there exists 376 entries, leading to a size of 512, discarding the top 23 bits. Use jhash to improve the hash table utilization: # current roletr: 376 entries and 124/512 buckets used, longest chain length 8, sum of chain length^2 1496 # patch roletr: 376 entries and 266/512 buckets used, longest chain length 4, sum of chain length^2 646 Signed-off-by: Christian Göttsche Reviewed-by: Stephen Smalley [PM: line wrap in the commit description] Signed-off-by: Paul Moore commit 7969ba577636a83553baf95882eb310b39e1c742 Author: Christian Göttsche Date: Fri Aug 18 17:12:15 2023 +0200 selinux: simplify avtab slot calculation Instead of dividing by 8 and then performing log2 by hand, use a more readable calculation. The behavior of rounddown_pow_of_two() for an input of 0 is undefined, so handle that case and small values manually to achieve the same results. Signed-off-by: Christian Göttsche Reviewed-by: Stephen Smalley Signed-off-by: Paul Moore commit 6f594f5a3dc4917be1556e524673420197ca471d Author: Christian Göttsche Date: Fri Aug 18 17:12:14 2023 +0200 selinux: improve debug configuration If the SELinux debug configuration is enabled define the macro DEBUG such that pr_debug() calls are always enabled, regardless of CONFIG_DYNAMIC_DEBUG, since those message are the main reason for this configuration in the first place. Mention example usage in case CONFIG_DYNAMIC_DEBUG is enabled in the help section of the configuration. Signed-off-by: Christian Göttsche Reviewed-by: Stephen Smalley Signed-off-by: Paul Moore commit fb8142ff4a642f14c4805980efb7531854c5dbdf Author: Christian Göttsche Date: Fri Aug 18 17:12:18 2023 +0200 selinux: print sum of chain lengths^2 for hash tables Print the sum of chain lengths squared as a metric for hash tables to provide more insights, similar to avtabs. While on it add a comma in the avtab message to improve readability of the output. Signed-off-by: Christian Göttsche Reviewed-by: Stephen Smalley Signed-off-by: Paul Moore commit d1a8ac11ee72c192611b0cae98ad6304314f9ae7 Author: Tinghan Shen Date: Fri Sep 1 16:09:34 2023 +0800 remoteproc: mediatek: Refine ipi handler error message The error message doesn't accurately reflect the cause of the error. The error is due to a handler not being found, not an invalid IPI ID. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230901080935.14571-14-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit b0cdc6a4df7a8e0bcddd7a302229a6ae9a3e044e Author: Tinghan Shen Date: Fri Sep 1 16:09:33 2023 +0800 remoteproc: mediatek: Report watchdog crash to all cores To ensure consistent behavior, the watchdog timeout handling of the multi-core SCP should reset the whole SCP sub-system when watchdog timeout. Triggering the rproc recovery flow on all instances will ensure proper recovery of the SCP sub-system. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230901080935.14571-13-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit 5d5cfce48069df97ae83d001187f69d63b87242f Author: Tinghan Shen Date: Fri Sep 1 16:09:32 2023 +0800 remoteproc: mediatek: Handle MT8195 SCP core 1 watchdog timeout The MT8195 SCP core 1 watchdog timeout needs to be handled in the SCP core 0 IRQ handler because the MT8195 SCP core 1 watchdog timeout IRQ is wired on the same IRQ entry for core 0 watchdog timeout. MT8195 SCP has a watchdog status register to identify the watchdog timeout source when IRQ triggered. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230901080935.14571-12-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit c01fb97cf2b55b155ee99c1ad51672f80042a922 Author: Tinghan Shen Date: Fri Sep 1 16:09:31 2023 +0800 remoteproc: mediatek: Setup MT8195 SCP core 1 SRAM offset Because MT8195 SCP core 0 and core 1 both boot from head of SRAM and have the same viewpoint of SRAM, SCP has a "core 1 SRAM offset" configuration to control the access destination of SCP core 1 to boot core 1 from different SRAM location. The "core 1 SRAM offset" configuration is composed by a range and an offset. It works like a simple memory mapped mechanism. When SCP core 1 accesses a SRAM address located in the range, the SCP bus adds the configured offset to the address to shift the physical destination address on SCP SRAM. This shifting is transparent to the software running on SCP core 1. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230901080935.14571-11-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit c6eda63f33cbd6cff7c302869bd9a135b4a8a813 Author: Tinghan Shen Date: Fri Sep 1 16:09:30 2023 +0800 remoteproc: mediatek: Remove dependency of MT8195 SCP L2TCM power control on dual-core SCP Previously, SCP core 0 controlled the power of L2TCM and dictated that SCP core 1 could only boot after SCP core 0. To address this constraint, extracted the power control flow of L2TCM and made it shared between both cores, enabling support for arbitrary boot order. The flow for controlling L2TCM power has been incorporated into the mt8195_scp_before_load() and mt8195_scp_stop() APIs, which are respectively invoked during the rproc->ops->start() and rproc->ops->stop() operations. These APIs effectively serve the same purpose as the rproc prepare()/unprepare() APIs." Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230901080935.14571-10-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit 1fdbf0cdde98c113b17f8cd089a892c5f0437d3e Author: Tinghan Shen Date: Fri Sep 1 16:09:29 2023 +0800 remoteproc: mediatek: Probe SCP cluster on multi-core SCP The difference of single-core SCP and multi-core SCP device tree is the presence of child device nodes described SCP cores. The SCP driver populates the platform device and checks the child nodes to identify whether it's a single-core SCP or a multi-core SCP. Add the remoteproc instances of multi-core SCP to the SCP cluster list. When the SCP driver is removed, it cleanup resources by walking through the cluster list. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230901080935.14571-9-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit eaf5b89953b0f88ddc933bd27e120ba4007231ac Author: Tinghan Shen Date: Fri Sep 1 16:09:28 2023 +0800 remoteproc: mediatek: Probe SCP cluster on single-core SCP This is the 3rd preliminary step for probing multi-core SCP. Rewrite the probing flow of single-core SCP to adapt with the 'cluster' concept needed by the multi-core SCP. The SCP core object(s) is maintained at the cluster list. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230901080935.14571-8-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit fcc14c9cd5ad9186ce9d7777d443e42128ef3b48 Author: Tinghan Shen Date: Fri Sep 1 16:09:27 2023 +0800 remoteproc: mediatek: Revise SCP rproc initialization flow for multi-core SCP This is the 2nd preliminary step for probing multi-core SCP. Initialization of configuration and L1TCM registers is extracted to only performed once on multi-core SCP. The rest of remoteproc initialization procedure is similar for both single and multi-core SCP and is applied to each core. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230901080935.14571-7-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit 9ea166698f48c299ca6bd4730950ca1176f51e1b Author: Tinghan Shen Date: Fri Sep 1 16:09:26 2023 +0800 remoteproc: mediatek: Extract SCP common registers This is the 1st preliminary steps for probing multi-core SCP. The registers of config and l1tcm are common on single-core SCP and multi-core SCP. Extract these registers out to reduce duplicated fields in mtk_scp when multiple SCP instances are created. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230901080935.14571-6-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit 6a1c9aaf04eb4536da922f18e05c73a2afadfe2a Author: Tinghan Shen Date: Fri Sep 1 16:09:25 2023 +0800 remoteproc: mediatek: Add MT8195 SCP core 1 operations The SCP rproc driver has a set of chip dependent callbacks for boot sequence and IRQ handling. Implement these callbacks for MT8195 SCP core 1. Signed-off-by: Tinghan Shen Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230901080935.14571-5-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit 759e7a2b62eb3ef3c93ffeb5cca788a09627d7d9 Author: Maximilian Luz Date: Sun Aug 27 23:14:06 2023 +0200 firmware: Add support for Qualcomm UEFI Secure Application On platforms using the Qualcomm UEFI Secure Application (uefisecapp), EFI variables cannot be accessed via the standard interface in EFI runtime mode. The respective functions return EFI_UNSUPPORTED. On these platforms, we instead need to talk to uefisecapp. This commit provides support for this and registers the respective efivars operations to access EFI variables from the kernel. Communication with uefisecapp follows the Qualcomm QSEECOM / Secure OS conventions via the respective SCM call interface. This is also the reason why variable access works normally while boot services are active. During this time, said SCM interface is managed by the boot services. When calling ExitBootServices(), the ownership is transferred to the kernel. Therefore, UEFI must not use that interface itself (as multiple parties accessing this interface at the same time may lead to complications) and cannot access variables for us. Signed-off-by: Maximilian Luz Acked-by: Ard Biesheuvel Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/20230827211408.689076-4-luzmaximilian@gmail.com Signed-off-by: Bjorn Andersson commit 00b1248606ba3979ccae30ed11df8cdc1a84245a Author: Maximilian Luz Date: Sun Aug 27 23:14:05 2023 +0200 firmware: qcom_scm: Add support for Qualcomm Secure Execution Environment SCM interface Add support for SCM calls to Secure OS and the Secure Execution Environment (SEE) residing in the TrustZone (TZ) via the QSEECOM interface. This allows communication with Secure/TZ applications, for example 'uefisecapp' managing access to UEFI variables. For better separation, make qcom_scm spin up a dedicated child (platform) device in case QSEECOM support has been detected. The corresponding driver for this device is then responsible for managing any QSEECOM clients. Specifically, this driver attempts to automatically detect known and supported applications, creating a client (auxiliary) device for each one. The respective client/auxiliary driver is then responsible for managing and communicating with the application. While this patch introduces only a very basic interface without the more advanced features (such as re-entrant and blocking SCM calls and listeners/callbacks), this is enough to talk to the aforementioned 'uefisecapp'. Signed-off-by: Maximilian Luz Reviewed-by: Johan Hovold Link: https://lore.kernel.org/r/20230827211408.689076-3-luzmaximilian@gmail.com Signed-off-by: Bjorn Andersson commit e4c89f9380017b6b2e63836e2de1af8eb4535384 Author: Maximilian Luz Date: Sun Aug 27 23:14:04 2023 +0200 lib/ucs2_string: Add UCS-2 strscpy function Add a ucs2_strscpy() function for UCS-2 strings. The behavior is equivalent to the standard strscpy() function, just for 16-bit character UCS-2 strings. Signed-off-by: Maximilian Luz Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20230827211408.689076-2-luzmaximilian@gmail.com Signed-off-by: Bjorn Andersson commit 6b55b1e2fd7f0a91e75271c6199a81e72a403492 Author: Tinghan Shen Date: Fri Sep 1 16:09:24 2023 +0800 dt-bindings: remoteproc: mediatek: Support MT8195 dual-core SCP Extend the SCP binding to describe the MT8195 dual-core SCP. Under different applications, the MT8195 SCP can be used as single-core or dual-core. This change keeps the single-core definitions and adds new definitions for the dual-core use case. Signed-off-by: Tinghan Shen Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230901080935.14571-4-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit cdd2218700c129ea24b778856d7819884446999a Author: Tinghan Shen Date: Fri Sep 1 16:09:22 2023 +0800 dt-bindings: remoteproc: mediatek: Improve the rpmsg subnode definition Improve the definition of the rpmsg subnode by assigning a distinct node name and adding the definition source of node properties. Signed-off-by: Tinghan Shen Acked-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230901080935.14571-2-tinghan.shen@mediatek.com Signed-off-by: Mathieu Poirier commit 99f998733dac8b84b96981bf170d39ec721d5b97 Author: Chen Jiahao Date: Thu Aug 17 16:33:36 2023 +0800 remoteproc: stm32: Clean up redundant dev_err_probe() Referring to platform_get_irq()'s definition, the return value has already been checked if ret < 0, and printed via dev_err_probe(). Calling dev_err_probe() one more time outside platform_get_irq() is obviously redundant. Removing outside dev_err_probe() to clean it up. Besides, switch to use platform_get_irq_optional() since the irq is optional here. Signed-off-by: Chen Jiahao Acked-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20230817083336.404635-1-chenjiahao16@huawei.com Signed-off-by: Mathieu Poirier commit 7559d6724298004b696ffead61ee5dce1f97e908 Author: Norbert Zulinski Date: Wed Sep 6 13:57:04 2023 -0600 iavf: Add ability to turn off CRC stripping for VF Previously CRC stripping was always enabled for VF. Now it is possible to turn off CRC stripping via ethtool: #ethtool -K rx-fcs on To turn off CRC stripping, first VLAN stripping must be disabled: #ethtool -K rx-vlan-offload off if any VLAN interfaces exists, otherwise VLAN stripping will be turned off by the driver. In iavf_configure_queues add check if CRC stripping is enabled for VF, if it's enabled then set crc_disabled to false on every VF's queue. In iavf_set_features add check if CRC stripping setting was changed then schedule reset. Signed-off-by: Norbert Zulinski Reviewed-by: Jesse Brandeburg Signed-off-by: Ahmed Zaki Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 7bd48d8d414b378caa5d8a374b931196f8d173e9 Author: Haiyue Wang Date: Wed Sep 6 13:57:03 2023 -0600 ice: Check CRC strip requirement for VLAN strip When VLAN strip is enabled, the CRC strip must not be disabled. And when the CRC strip is disabled, the VLAN strip should not be enabled. The driver needs to check CRC strip disable setting parameter before configuring the Rx/Tx queues, otherwise, in current error handling, the already set Tx queue context doesn't roll back correctly, it will cause the Tx queue setup failure next time: "Failed to set LAN Tx queue context" Signed-off-by: Haiyue Wang Reviewed-by: Jesse Brandeburg Reviewed-by: Paul Menzel Signed-off-by: Ahmed Zaki Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 730cb741815c71d9dd8d1bc7d0b7d9a0acc615a8 Author: Haiyue Wang Date: Wed Sep 6 13:57:02 2023 -0600 ice: Support FCS/CRC strip disable for VF To support CRC strip enable/disable functionality, VF needs the explicit request VIRTCHNL_VF_OFFLOAD_CRC offload. Then according to crc_disable flag of Rx queue configuration information to set up the queue context. Signed-off-by: Haiyue Wang Reviewed-by: Jesse Brandeburg Signed-off-by: Ahmed Zaki Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 89de9921dfa77e43b985bde99a6031ab66511020 Author: Paul M Stillwell Jr Date: Wed Sep 6 13:57:01 2023 -0600 virtchnl: Add CRC stripping capability Some VFs may want to disable CRC stripping on incoming packets so create an offload for that. The VF already sends information about configuring its RX queues so use that structure to indicate that the CRC stripping should be enabled or not. Signed-off-by: Paul M Stillwell Jr Reviewed-by: Jesse Brandeburg Reviewed-by: Paul Menzel Signed-off-by: Ahmed Zaki Signed-off-by: Tony Nguyen commit 02680d71dea89b3e58015cf726f5e175730e1002 Author: Douglas Anderson Date: Fri Sep 1 16:41:24 2023 -0700 drm/imx/ipuv3: Call drm_atomic_helper_shutdown() at shutdown/unbind time Based on grepping through the source code this driver appears to be missing a call to drm_atomic_helper_shutdown() at system shutdown time and at driver unbind time. Among other things, this means that if a panel is in use that it won't be cleanly powered off at system shutdown time. The fact that we should call drm_atomic_helper_shutdown() in the case of OS shutdown/restart and at driver remove (or unbind) time comes straight out of the kernel doc "driver instance overview" in drm_drv.c. A few notes about this fix: - When adding drm_atomic_helper_shutdown() to the unbind path, I added it after drm_kms_helper_poll_fini() since that's when other drivers seemed to have it. - Technically with a previous patch, ("drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a noop"), we don't actually need to check to see if our "drm" pointer is NULL before calling drm_atomic_helper_shutdown(). We'll leave the "if" test in, though, so that this patch can land without any dependencies. It could potentially be removed later. - This patch also makes sure to set the drvdata to NULL in the case of bind errors to make sure that shutdown can't access freed data. Suggested-by: Maxime Ripard Reviewed-by: Maxime Ripard Tested-by: Philipp Zabel Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230901164111.RFT.13.I0a9940ff6f387d6acf4e71d8c7dbaff8c42e3aaa@changeid commit 2a073968289d3e60d9262a12d5dec71725787b2d Author: Douglas Anderson Date: Fri Sep 1 16:39:52 2023 -0700 drm/atomic-helper: drm_atomic_helper_shutdown(NULL) should be a noop As with other places in the Linux kernel--kfree(NULL) being the most famous example--it's convenient to treat being passed a NULL argument as a noop in cleanup functions. Let's make drm_atomic_helper_shutdown() work like this. This is convenient for DRM devices that use the "component" model. On these devices we want shutdown to be a noop if the bind() call of the component hasn't been called yet. As long as drivers are careful to make sure the drvdata is NULL whenever the driver is not bound then we can just do a simple call to drm_atomic_helper_shutdown() with the drvdata at shutdown time. Acked-by: Maxime Ripard Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230901163944.RFT.1.I906acd535bece03b6671d97c2826c6f0444f4728@changeid commit 92e62478b62cac25ff9f29bd314b0e03adb86699 Author: Douglas Anderson Date: Wed Sep 6 07:28:03 2023 -0700 MAINTAINERS: Update DRM DRIVERS FOR FREESCALE IMX entry As per the discussion on the lists [1], changes to this driver generally flow through drm-misc. If they need to be coordinated with v4l2 they sometimes go through Philipp Zabel's tree instead. List both trees in MAINTAINERS. Also update the title of this driver to specify that it's just for IMX 5/6 since, as per Philipp "There are a lot more i.MX that do not use IPUv3 than those that do." [1] https://lore.kernel.org/r/d56dfb568711b4b932edc9601010feda020c2c22.camel@pengutronix.de Acked-by: Philipp Zabel Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230906072803.1.Idef7e77e8961cbeb8625183eec9db0356b2eccd0@changeid commit 1e0465eb16a4f288a1b77b72af2f294c709ecf22 Author: Douglas Anderson Date: Fri Aug 4 14:06:06 2023 -0700 drm/panel: otm8009a: Don't double check prepared/enabled As talked about in commit d2aacaf07395 ("drm/panel: Check for already prepared/enabled in drm_panel"), we want to remove needless code from panel drivers that was storing and double-checking the prepared/enabled state. Even if someone was relying on the double-check before, that double-check is now in the core and not needed in individual drivers. For the "otm8009a" driver we fully remove the storing of the "enabled" state and we remove the double-checking, but we still keep the storing of the "prepared" state since the backlight code in the driver checks it. This backlight code may not be perfectly safe since there doesn't appear to be sufficient synchronization between the backlight driver (which userspace can call into directly) and the code that's unpreparing the panel. However, this lack of safety is not new and can be addressed in a future patch. Reviewed-by: Linus Walleij Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230804140605.RFC.3.I6a4a3c81c78acf5acdc2e5b5d936e19bf57ec07a@changeid commit d43f0fe153dcb963374cd5b1256ec14287f951e4 Author: Douglas Anderson Date: Fri Aug 4 14:06:05 2023 -0700 drm/panel: s6e63m0: Don't store+check prepared/enabled As talked about in commit d2aacaf07395 ("drm/panel: Check for already prepared/enabled in drm_panel"), we want to remove needless code from panel drivers that was storing and double-checking the prepared/enabled state. Even if someone was relying on the double-check before, that double-check is now in the core and not needed in individual drivers. For the s6e63m0 panel driver, this actually fixes a subtle/minor error handling bug in s6e63m0_prepare(). In one error case s6e63m0_prepare() called s6e63m0_unprepare() directly if there was an error. This call to s6e63m0_unprepare() would have been a no-op since ctx->prepared wasn't set yet. Reviewed-by: Linus Walleij Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230804140605.RFC.2.Iabafd062e70f6b6b554cf23eeb75f57a80f7e985@changeid commit f8c37b88092e12157b2b707f1a83684b0b97b68e Author: Douglas Anderson Date: Fri Aug 4 14:06:04 2023 -0700 drm/panel: Don't store+check prepared/enabled for simple cases As talked about in commit d2aacaf07395 ("drm/panel: Check for already prepared/enabled in drm_panel"), we want to remove needless code from panel drivers that was storing and double-checking the prepared/enabled state. Even if someone was relying on the double-check before, that double-check is now in the core and not needed in individual drivers. This pile of panel drivers appears to be simple to handle. Based on code inspection they seemed to be using the prepared/enabled state simply for double-checking that nothing else in the kernel called them inconsistently. Now that the core drm_panel is doing the double checking (and warning) it should be very clear that these devices don't need their own double-check. Reviewed-by: Linus Walleij Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230804140605.RFC.1.Ia54954fd2f7645c1b86597494902973f57feeb71@changeid commit 3072a24c778a7102d70692af5556e47363114c67 Author: Ville Syrjälä Date: Wed May 3 14:36:59 2023 +0300 drm/i915: Introduce crtc_state->enhanced_framing Track DP enhanced framing properly in the crtc state instead of relying just on the cached DPCD everywhere, and hook it up into the state check and dump. v2: Actually set enhanced_framing in .compute_config() Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230503113659.16305-1-ville.syrjala@linux.intel.com Reviewed-by: Luca Coelho commit e160ab85166e77347d0cbe5149045cb25e83937f Author: Ping-Ke Shih Date: Fri Feb 3 10:36:36 2023 +0800 wifi: mac80211: don't return unset power in ieee80211_get_tx_power() We can get a UBSAN warning if ieee80211_get_tx_power() returns the INT_MIN value mac80211 internally uses for "unset power level". UBSAN: signed-integer-overflow in net/wireless/nl80211.c:3816:5 -2147483648 * 100 cannot be represented in type 'int' CPU: 0 PID: 20433 Comm: insmod Tainted: G WC OE Call Trace: dump_stack+0x74/0x92 ubsan_epilogue+0x9/0x50 handle_overflow+0x8d/0xd0 __ubsan_handle_mul_overflow+0xe/0x10 nl80211_send_iface+0x688/0x6b0 [cfg80211] [...] cfg80211_register_wdev+0x78/0xb0 [cfg80211] cfg80211_netdev_notifier_call+0x200/0x620 [cfg80211] [...] ieee80211_if_add+0x60e/0x8f0 [mac80211] ieee80211_register_hw+0xda5/0x1170 [mac80211] In this case, simply return an error instead, to indicate that no data is available. Cc: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Link: https://lore.kernel.org/r/20230203023636.4418-1-pkshih@realtek.com Signed-off-by: Johannes Berg commit 3e99b4d282195435a9271fb738c4b146a9d35a5a Author: Stephen Douthit Date: Mon Feb 13 15:40:24 2023 -0500 wifi: mac80211: Sanity check tx bitrate if not provided by driver If the driver doesn't fill NL80211_STA_INFO_TX_BITRATE in sta_set_sinfo() then as a fallback sta->deflink.tx_stats.last_rate is used. Unfortunately there's no guarantee that this has actually been set before it's used. Originally found when 'iw link' would always return a tx rate of 6Mbps regardless of actual link speed for the QCA9337 running firmware WLAN.TF.2.1-00021-QCARMSWP-1 in my netbook. Use the sanity check logic from ieee80211_fill_rx_status() and refactor that to use the new inline function. Signed-off-by: Stephen Douthit Link: https://lore.kernel.org/r/20230213204024.3377-1-stephen.douthit@gmail.com [change to bool ..._rate_valid() instead of int ..._rate_invalid()] Signed-off-by: Johannes Berg commit 88717def36f7b19f12d6ad6644e73bf91cf86375 Author: Emmanuel Grumbach Date: Wed Sep 13 14:56:51 2023 +0300 wifi: iwlwifi: mvm: add a debug print when we get a BAR Getting a BAR can be an explanation if we're chasing packet loss. Add a print with the relevant debug level in that code path. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.913e989a1751.I6bff9020e339d91b61b5ad6aede27bcf8c7e6819@changeid Signed-off-by: Johannes Berg commit 4f1847cf4dd84deae3d5cbe6c317489617eecb3d Author: Johannes Berg Date: Wed Sep 13 14:56:50 2023 +0300 wifi: iwlwifi: mvm: move listen interval to constants This can be moved to constants, while at it also rename it to have a better name with MVM_ prefix. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.59823deebfda.Ied68b11ca40771d1cfc8c82ee8f9f2b9ea27da65@changeid Signed-off-by: Johannes Berg commit 1bd9c9eba6de1c03f52d711bcd9b03bc467cfbb0 Author: Miri Korenblit Date: Wed Sep 13 14:56:48 2023 +0300 wifi: iwlwifi: no power save during transition to D3 Transition to d3 is much faster if there is no power save during the transition. Therefore a new flag was added to the device power cmd to indicate the power save isn't allowed until the transition is completed. Set this flag in _iwl_mvm_suspend, when the transition begins. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.ced036106507.Ib5ed5a47ee35f624902bd8882dde3e559285965b@changeid Signed-off-by: Johannes Berg commit dfed221d2e2ec190a5931e88dee81460acee36b6 Author: Johannes Berg Date: Wed Sep 13 14:56:47 2023 +0300 wifi: iwlwifi: update context info structure definitions Some new fields were added to the context info structure, define them for future use. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.ef1553ab5178.I326ac8719566e04f799d294d8e863383cff87eaa@changeid Signed-off-by: Johannes Berg commit 828c79d9feb000acbd9c15bd1ed7e0914473b363 Author: Emmanuel Grumbach Date: Wed Sep 13 14:56:46 2023 +0300 wifi: iwlwifi: mvm: fix recovery flow in CSA If the firmware crashes in the de-activation / re-activation of the link during CSA, we will not have a valid phy_ctxt pointer in mvmvif. This is a legit case, but when mac80211 removes the station to cleanup our state during the re-configuration, we need to make sure we clear ap_sta otherwise we won't re-add the station after the firmware has been restarted. Later on, we'd activate the link, try to send a TLC command crash again on ASSERT 3508. Fix this by properly cleaning up our state. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.2651e6f6a55a.I4cd50e88ee5c23c1c8dd5b157a800e4b4c96f236@changeid Signed-off-by: Johannes Berg commit 499d02790495958506a64f37ceda7e97345a50a8 Author: Miri Korenblit Date: Wed Sep 13 14:56:45 2023 +0300 wifi: iwlwifi: Use FW rate for non-data frames Currently we are setting the rate in the tx cmd for mgmt frames (e.g. during connection establishment). This was problematic when sending mgmt frames in eSR mode, as we don't know what link this frame will be sent on (This is decided by the FW), so we don't know what is the lowest rate. Fix this by not setting the rate in tx cmd and rely on FW to choose the right one. Set rate only for injected frames with fixed rate, or when no sta is given. Also set for important frames (EAPOL etc.) the High Priority flag. Fixes: 055b22e770dd ("iwlwifi: mvm: Set Tx rate and flags when there is not station") Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.6c7e59620ee0.I6eaed3ccdd6dd62b9e664facc484081fc5275843@changeid Signed-off-by: Johannes Berg commit 3d66848f032f1cb235b3b1ad0bc8b9e7a9dd03ff Author: Shaul Triebitz Date: Wed Sep 13 14:56:44 2023 +0300 wifi: iwlwifi: mvm: enable FILS DF Tx on non-PSC channel If the channel bandwidth is greater or equal than 80MHz, enable FILS DF transmittion, even if the control channel is non-PSC. That's because that in 80MHz there must be a sub 20MHz PSC channel, and since the FILS DF is duplicated on all sub 20MHz channels, within the 80MHz (hence it will be sent on a PSC channel). Also, if FILS DF Tx is enabled, always configure the firmware with the actual channel bandwidth, even before there is a connected client (rather than the minimum bandwidth e.g. 20MHz), since FILS DF transmission on a PSC channel take presedent over power consumption. Signed-off-by: Shaul Triebitz Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.83b9a76fc6c4.I6703111cc6befcd0e9cd9adf3cb127a648dbb7b1@changeid Signed-off-by: Johannes Berg commit bdd940613b4d0daf09a431096bf7d63aa55dee16 Author: Johannes Berg Date: Wed Sep 13 14:56:43 2023 +0300 wifi: iwlwifi: mvm: make "pldr_sync" mode effective If the device initialized with ME active, this would indeed work, since the NVM information would be obtained from ME. However, in the much more likely case that ME isn't active and the firmware takes actions requiring the sync, this was not working correctly when the firmware is only run at init to obtain NVM data, since mac80211 isn't even initialized. Fix this by moving the 'pldr_sync' handling to a different place. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.45a94d480e56.Id9277f1df6a63ab0dfca0d0c0f448c759e1b8e73@changeid Signed-off-by: Johannes Berg commit 3dfbcf78f65434b7b7baedfbfa6f16d842e7b541 Author: Emmanuel Grumbach Date: Wed Sep 13 14:56:42 2023 +0300 wifi: iwlwifi: mvm: log dropped frames When we drop frames we want to have something printed in the logger. This won't be printed by default of course. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.c2f02fecf66f.Ib472f9fd92856c6e5b5a99b68fdca0f694a531e9@changeid Signed-off-by: Johannes Berg commit fc2fe0a5e856efe58e86115b87c3efe348b8e9ea Author: Gregory Greenman Date: Wed Sep 13 14:56:41 2023 +0300 wifi: iwlwifi: fw: disable firmware debug asserts Disable firmware debug asserts, which are used for internal firmware testing purposes only. Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.8feafd9b17be.Ia7bec82ac25897caab581692d67055aa1aca2ed2@changeid Signed-off-by: Johannes Berg commit c9331008f34035b13078935d38388686cec9ed64 Author: Miri Korenblit Date: Wed Sep 13 14:56:40 2023 +0300 wifi: iwlwifi: remove dead-code This condition will never be true. Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.56ff0569d16c.I455839fad0f4f05043815aee884fab9ec7323f7d@changeid Signed-off-by: Johannes Berg commit 9536a09157d8ff4bae7b559b510a6f35acd83fac Author: Johannes Berg Date: Wed Sep 13 14:56:39 2023 +0300 wifi: iwlwifi: pcie: enable TOP fatal error interrupt Enable the TOP (HW part) fatal error interrupt and add a print when it happens. Currently FW always adds also the SW error interrupt, but for >= Bz we'll need to do PLDR in case this is asserted, so leave a TODO item already. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.127d914a4d0d.I41ea409df63474554ef727c49382d0b5bf15939e@changeid Signed-off-by: Johannes Berg commit af9d34abf54a196d7aac88d87bd2925727889bb1 Author: Johannes Berg Date: Wed Sep 13 14:56:38 2023 +0300 wifi: iwlwifi: pcie: give up mem read if HW is dead If the hardware is not responding, as indicated by (currently) five consecutive HW errors during reading, then just give up and fail, rather than attempting forever and forever for this to not return any useful data anyway. Even though we no longer completely deadlock the machine if it takes a long time, we still make it pretty much unusable since we'll eventually hold the RTNL while waiting for this process to finish. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.345af79f431c.I5ecde6b76b1e3a1572bd59d3cf8f827e767cedeb@changeid Signed-off-by: Johannes Berg commit 111ed1eb175754a9ef11811240329ca40db2072f Author: Johannes Berg Date: Wed Sep 13 14:56:37 2023 +0300 wifi: iwlwifi: pcie: rescan bus if no parent If the bus has no parent due to the topology, the device rescan (after some kind of reset was detected) wouldn't work. On the other hand, some platforms appear to require scanning the parent, though it's not clear why. However if there's no parent, then we skip the rescan, which isn't a good idea. Change the code to go to the parent only if that exists, and rescan the bus itself where it doesn't. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230913145231.f7795a1ccdab.I2b84810a743469a1bcabf3628262cf54311593f4@changeid Signed-off-by: Johannes Berg commit a7891a0aa5fa1c7e4f524602b47a9acea3bc3d50 Author: Ville Syrjälä Date: Tue May 2 17:39:06 2023 +0300 drm/i915: Reduce combo PHY log spam We always check whether combo PHYs need to be re-initialized after disabling DC states, which leads to log spam. Switch things around so that we only log something when we actually have to re-initialized a PHY. The log spam was exacerbated by commit 41b4c7fe72b6 ("drm/i915: Disable DC states for all commits") since we now disable DC states far more often. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230502143906.2401-12-ville.syrjala@linux.intel.com Reviewed-by: Luca Coelho commit d0a309a90f1d3f6502b79a89b8976dde409ed65b Author: Ville Syrjälä Date: Tue May 2 17:39:04 2023 +0300 drm/i915: Stop spamming the logs with PLL state encoder->get_config() is not the place where the state should be dumped. Get rid of the spam. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230502143906.2401-10-ville.syrjala@linux.intel.com Reviewed-by: Luca Coelho commit edc876631b1c1df3bdacfe08af3d3a1d81101985 Author: Ville Syrjälä Date: Tue May 2 17:39:02 2023 +0300 drm/i915: Split some long lines in hsw_fdi_link_train() Split some overly long lines in hsw_fdi_link_train(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230502143906.2401-8-ville.syrjala@linux.intel.com Reviewed-by: Luca Coelho commit 3dfeb80b308882cc6e1f5f6c36fd9a7f4cae5fc6 Author: Ville Syrjälä Date: Tue May 2 17:39:01 2023 +0300 drm/i915: Fix FEC state dump Stop dumping state while reading it out. We have a proper place for that stuff. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230502143906.2401-7-ville.syrjala@linux.intel.com Reviewed-by: Luca Coelho commit 126f94e87e7960ef7ae58180e39c19cc9dcbbf7f Author: Ville Syrjälä Date: Tue May 2 17:38:59 2023 +0300 drm/i915: Fix FEC pipe A vs. DDI A mixup On pre-TGL FEC is a port level feature, not a transcoder level feature, and it's DDI A which doesn't have it, not trancoder A. Check for the correct thing when determining whether FEC is supported or not. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230502143906.2401-5-ville.syrjala@linux.intel.com Reviewed-by: Luca Coelho commit cbbfe9150857253216e519d85d7b4ff2b56558c2 Author: Ville Syrjälä Date: Tue May 2 17:38:58 2023 +0300 drm/i915/mst: Read out FEC state The MST codepath is missing FEC readout. Add it. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230502143906.2401-4-ville.syrjala@linux.intel.com Reviewed-by: Luca Coelho commit be326bee09374a2ebd18cb5af8fcd6f1e7825260 Author: Hal Feng Date: Mon Aug 14 16:06:18 2023 +0800 riscv: dts: starfive: Add JH7110 PWM-DAC support Add PWM-DAC support for StarFive JH7110 SoC. Reviewed-by: Walker Chen Signed-off-by: Hal Feng Signed-off-by: Conor Dooley commit 92cfc35838b2a4006abb9e3bafc291b56f135d01 Author: Xingyu Wu Date: Mon Aug 21 22:41:51 2023 +0800 riscv: dts: starfive: Add the nodes and pins of I2Srx/I2Stx0/I2Stx1 Add I2Srx/I2Stx0/I2Stx1 nodes and pins configuration for the StarFive JH7110 SoC. Signed-off-by: Xingyu Wu Reviewed-by: Walker Chen Signed-off-by: Conor Dooley commit 4e1abae5688aae9dd8345dbd4ea92a4b9adf340d Author: Xingyu Wu Date: Mon Aug 21 22:41:50 2023 +0800 riscv: dts: starfive: pinfunc: Fix the pins name of I2STX1 These pins are actually I2STX1 clock input, not I2STX0, so their names should be changed. Signed-off-by: Xingyu Wu Reviewed-by: Walker Chen Acked-by: Rob Herring Signed-off-by: Conor Dooley commit 0e34600ac9317dbe5f0a7bfaa3d7187d757572ed Author: Peter Zijlstra Date: Fri Jun 9 20:52:49 2023 +0200 sched: Misc cleanups Random remaining guard use... Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar commit 6fb45460615358157a6d3c990e74f9c1395247e2 Author: Peter Zijlstra Date: Fri Jun 9 20:45:16 2023 +0200 sched: Simplify tg_set_cfs_bandwidth() Use guards to reduce gotos and simplify control flow. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar commit fa614b4feb5a246474ac71b45e520a8ddefc809c Author: Peter Zijlstra Date: Fri Jun 9 20:41:09 2023 +0200 sched: Simplify sched_move_task() Use guards to reduce gotos and simplify control flow. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar commit af7c5763f5e8bc1b3f827354a283ccaf6a8c8098 Author: Peter Zijlstra Date: Fri Jun 9 16:59:05 2023 +0200 sched: Simplify sched_rr_get_interval() Use guards to reduce gotos and simplify control flow. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar commit 7a50f76674f8b6f4f30a1cec954179f10e20110c Author: Peter Zijlstra Date: Fri Jun 9 16:58:23 2023 +0200 sched: Simplify yield_to() Use guards to reduce gotos and simplify control flow. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar commit 92c2ec5bc1081e6bbbe172bcfb1a566ad7b4f809 Author: Peter Zijlstra Date: Fri Jun 9 16:57:35 2023 +0200 sched: Simplify sched_{set,get}affinity() Use guards to reduce gotos and simplify control flow. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar commit febe162d4d9158cf2b5d48fdd440db7bb55dd622 Author: Peter Zijlstra Date: Fri Jun 9 16:54:54 2023 +0200 sched: Simplify syscalls Use guards to reduce gotos and simplify control flow. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar commit 94b548a15e8ec47dfbf6925bdfb64bb5657dce0c Author: Peter Zijlstra Date: Fri Jun 9 20:52:55 2023 +0200 sched: Simplify set_user_nice() Use guards to reduce gotos and simplify control flow. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar commit 85be6d842447067ce76047a14d4258c96fd33b7b Author: Peter Zijlstra Date: Tue Aug 15 12:52:04 2023 +0200 cleanup: Make no_free_ptr() __must_check recent discussion brought about the realization that it makes sense for no_free_ptr() to have __must_check semantics in order to avoid leaking the resource. Additionally, add a few comments to clarify why/how things work. All credit to Linus on how to combine __must_check and the stmt-expression. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lkml.kernel.org/r/20230816103102.GF980931@hirez.programming.kicks-ass.net commit d090ec0df81e56556af3a2bf04a7e89347ae5784 Author: Leonardo Bras Date: Thu Aug 31 03:31:28 2023 -0300 smp: Change function signatures to use call_single_data_t call_single_data_t is a size-aligned typedef of struct __call_single_data. This alignment is desirable in order to have smp_call_function*() avoid bouncing an extra cacheline in case of an unaligned csd, given this would hurt performance. Since the removal of struct request->csd in commit 660e802c76c8 ("blk-mq: use percpu csd to remote complete instead of per-rq csd") there are no current users of smp_call_function*() with unaligned csd. Change every 'struct __call_single_data' function parameter to 'call_single_data_t', so we have warnings if any new code tries to introduce an smp_call_function*() call with unaligned csd. Signed-off-by: Leonardo Bras Reviewed-by: Guo Ren Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230831063129.335425-1-leobras@redhat.com commit 67a810b6f37a7805474add2d003034a288b94fa4 Author: Peter Ujfalusi Date: Wed Sep 13 12:13:25 2023 +0300 ASoC: hdac_hdmi: Remove temporary string use in create_fill_jack_kcontrols There is no need to use temporary strings to construct the kcontrol names, devm_kasprintf can be used to replace the snprintf + devm_kstrdup pairs. This change will also fixes the following compiler warning/error (W=1): sound/soc/codecs/hdac_hdmi.c: In function ‘hdac_hdmi_jack_port_init’: sound/soc/codecs/hdac_hdmi.c:1793:63: error: ‘ Switch’ directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Werror=format-truncation=] 1793 | snprintf(kc_name, sizeof(kc_name), "%s Switch", xname); | ^~~~~~~ In function ‘create_fill_jack_kcontrols’, inlined from ‘hdac_hdmi_jack_port_init’ at sound/soc/codecs/hdac_hdmi.c:1871:8: sound/soc/codecs/hdac_hdmi.c:1793:25: note: ‘snprintf’ output between 8 and 39 bytes into a destination of size 32 1793 | snprintf(kc_name, sizeof(kc_name), "%s Switch", xname); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors The warnings got brought to light by a recent patch upstream: commit 6d4ab2e97dcf ("extrawarn: enable format and stringop overflow warnings in W=1") Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20230913091325.16877-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit bbaa6ffa5b6c9609d3b3c431c389b407eea5441f Author: Kai-Heng Feng Date: Wed Sep 13 11:32:33 2023 +0800 power: supply: core: Use blocking_notifier_call_chain to avoid RCU complaint AMD PMF driver can cause the following warning: [ 196.159546] ------------[ cut here ]------------ [ 196.159556] Voluntary context switch within RCU read-side critical section! [ 196.159571] WARNING: CPU: 0 PID: 9 at kernel/rcu/tree_plugin.h:320 rcu_note_context_switch+0x43d/0x560 [ 196.159604] Modules linked in: nvme_fabrics ccm rfcomm snd_hda_scodec_cs35l41_spi cmac algif_hash algif_skcipher af_alg bnep joydev btusb btrtl uvcvideo btintel btbcm videobuf2_vmalloc intel_rapl_msr btmtk videobuf2_memops uvc videobuf2_v4l2 intel_rapl_common binfmt_misc hid_sensor_als snd_sof_amd_vangogh hid_sensor_trigger bluetooth industrialio_triggered_buffer videodev snd_sof_amd_rembrandt hid_sensor_iio_common amdgpu ecdh_generic kfifo_buf videobuf2_common hp_wmi kvm_amd sparse_keymap snd_sof_amd_renoir wmi_bmof industrialio ecc mc nls_iso8859_1 kvm snd_sof_amd_acp irqbypass snd_sof_xtensa_dsp crct10dif_pclmul crc32_pclmul mt7921e snd_sof_pci snd_ctl_led polyval_clmulni mt7921_common polyval_generic snd_sof ghash_clmulni_intel mt792x_lib mt76_connac_lib sha512_ssse3 snd_sof_utils aesni_intel snd_hda_codec_realtek crypto_simd mt76 snd_hda_codec_generic cryptd snd_soc_core snd_hda_codec_hdmi rapl ledtrig_audio input_leds snd_compress i2c_algo_bit drm_ttm_helper mac80211 snd_pci_ps hid_multitouch ttm drm_exec [ 196.159970] drm_suballoc_helper snd_rpl_pci_acp6x amdxcp drm_buddy snd_hda_intel snd_acp_pci snd_hda_scodec_cs35l41_i2c serio_raw gpu_sched snd_hda_scodec_cs35l41 snd_acp_legacy_common snd_intel_dspcfg snd_hda_cs_dsp_ctls snd_hda_codec libarc4 drm_display_helper snd_pci_acp6x cs_dsp snd_hwdep snd_soc_cs35l41_lib video k10temp snd_pci_acp5x thunderbolt snd_hda_core drm_kms_helper cfg80211 snd_seq snd_rn_pci_acp3x snd_pcm snd_acp_config cec snd_soc_acpi snd_seq_device rc_core ccp snd_pci_acp3x snd_timer snd soundcore wmi amd_pmf platform_profile amd_pmc mac_hid serial_multi_instantiate wireless_hotkey hid_sensor_hub sch_fq_codel msr parport_pc ppdev lp parport efi_pstore ip_tables x_tables autofs4 btrfs blake2b_generic raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx libcrc32c xor raid6_pq raid1 raid0 multipath linear dm_mirror dm_region_hash dm_log cdc_ether usbnet r8152 mii hid_generic nvme i2c_hid_acpi i2c_hid nvme_core i2c_piix4 xhci_pci amd_sfh drm xhci_pci_renesas nvme_common hid [ 196.160382] CPU: 0 PID: 9 Comm: kworker/0:1 Not tainted 6.6.0-rc1 #4 [ 196.160397] Hardware name: HP HP EliteBook 845 14 inch G10 Notebook PC/8B6E, BIOS V82 Ver. 01.02.00 08/24/2023 [ 196.160405] Workqueue: events power_supply_changed_work [ 196.160426] RIP: 0010:rcu_note_context_switch+0x43d/0x560 [ 196.160440] Code: 00 48 89 be 40 08 00 00 48 89 86 48 08 00 00 48 89 10 e9 63 fe ff ff 48 c7 c7 10 e7 b0 9e c6 05 e8 d8 20 02 01 e8 13 0f f3 ff <0f> 0b e9 27 fc ff ff a9 ff ff ff 7f 0f 84 cf fc ff ff 65 48 8b 3c [ 196.160450] RSP: 0018:ffffc900001878f0 EFLAGS: 00010046 [ 196.160462] RAX: 0000000000000000 RBX: ffff88885e834040 RCX: 0000000000000000 [ 196.160470] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 196.160476] RBP: ffffc90000187910 R08: 0000000000000000 R09: 0000000000000000 [ 196.160482] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 196.160488] R13: 0000000000000000 R14: ffff888100990000 R15: ffff888100990000 [ 196.160495] FS: 0000000000000000(0000) GS:ffff88885e800000(0000) knlGS:0000000000000000 [ 196.160504] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 196.160512] CR2: 000055cb053c8246 CR3: 000000013443a000 CR4: 0000000000750ef0 [ 196.160520] PKRU: 55555554 [ 196.160526] Call Trace: [ 196.160532] [ 196.160548] ? show_regs+0x72/0x90 [ 196.160570] ? rcu_note_context_switch+0x43d/0x560 [ 196.160580] ? __warn+0x8d/0x160 [ 196.160600] ? rcu_note_context_switch+0x43d/0x560 [ 196.160613] ? report_bug+0x1bb/0x1d0 [ 196.160637] ? handle_bug+0x46/0x90 [ 196.160658] ? exc_invalid_op+0x19/0x80 [ 196.160675] ? asm_exc_invalid_op+0x1b/0x20 [ 196.160709] ? rcu_note_context_switch+0x43d/0x560 [ 196.160727] __schedule+0xb9/0x15f0 [ 196.160746] ? srso_alias_return_thunk+0x5/0x7f [ 196.160765] ? srso_alias_return_thunk+0x5/0x7f [ 196.160778] ? acpi_ns_search_one_scope+0xbe/0x270 [ 196.160806] schedule+0x68/0x110 [ 196.160820] schedule_timeout+0x151/0x160 [ 196.160829] ? srso_alias_return_thunk+0x5/0x7f [ 196.160842] ? srso_alias_return_thunk+0x5/0x7f [ 196.160855] ? acpi_ns_lookup+0x3c5/0xa90 [ 196.160878] __down_common+0xff/0x220 [ 196.160905] __down_timeout+0x16/0x30 [ 196.160920] down_timeout+0x64/0x70 [ 196.160938] acpi_os_wait_semaphore+0x85/0x200 [ 196.160959] acpi_ut_acquire_mutex+0x9e/0x280 [ 196.160979] acpi_ex_enter_interpreter+0x2d/0xb0 [ 196.160992] acpi_ns_evaluate+0x2f0/0x5f0 [ 196.161005] acpi_evaluate_object+0x172/0x490 [ 196.161018] ? acpi_os_signal_semaphore+0x8a/0xd0 [ 196.161038] acpi_evaluate_integer+0x52/0xe0 [ 196.161055] ? kfree+0x79/0x120 [ 196.161071] ? srso_alias_return_thunk+0x5/0x7f [ 196.161089] acpi_ac_get_state.part.0+0x27/0x80 [ 196.161110] get_ac_property+0x5c/0x70 [ 196.161127] ? __pfx___power_supply_is_system_supplied+0x10/0x10 [ 196.161146] __power_supply_is_system_supplied+0x44/0xb0 [ 196.161166] class_for_each_device+0x124/0x160 [ 196.161184] ? acpi_ac_get_state.part.0+0x27/0x80 [ 196.161203] ? srso_alias_return_thunk+0x5/0x7f [ 196.161223] power_supply_is_system_supplied+0x3c/0x70 [ 196.161243] amd_pmf_get_power_source+0xe/0x20 [amd_pmf] [ 196.161276] amd_pmf_power_slider_update_event+0x49/0x90 [amd_pmf] [ 196.161310] amd_pmf_pwr_src_notify_call+0xe7/0x100 [amd_pmf] [ 196.161340] notifier_call_chain+0x5f/0xe0 [ 196.161362] atomic_notifier_call_chain+0x33/0x60 [ 196.161378] power_supply_changed_work+0x84/0x110 [ 196.161394] process_one_work+0x178/0x360 [ 196.161412] ? __pfx_worker_thread+0x10/0x10 [ 196.161424] worker_thread+0x307/0x430 [ 196.161440] ? __pfx_worker_thread+0x10/0x10 [ 196.161451] kthread+0xf4/0x130 [ 196.161467] ? __pfx_kthread+0x10/0x10 [ 196.161486] ret_from_fork+0x43/0x70 [ 196.161502] ? __pfx_kthread+0x10/0x10 [ 196.161518] ret_from_fork_asm+0x1b/0x30 [ 196.161558] [ 196.161562] ---[ end trace 0000000000000000 ]--- Since there's no guarantee that all the callbacks can work in atomic context, switch to use blocking_notifier_call_chain to relax the constraint. Signed-off-by: Kai-Heng Feng Reported-by: Allen Zhong Fixes: 4c71ae414474 ("platform/x86/amd/pmf: Add support SPS PMF feature") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217571 Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20230913033233.602986-1-kai.heng.feng@canonical.com Signed-off-by: Sebastian Reichel commit 7777fa924754f69f9748d6fe730b1e6f38adf252 Author: Bartosz Golaszewski Date: Tue Sep 12 11:45:18 2023 +0200 gpio: eic-sprd: use a helper variable for &pdev->dev Instead of dereferencing pdev everywhere, just store the address of the underlying struct device in a local variable. Signed-off-by: Bartosz Golaszewski Reviewed-by: Baolin Wang commit dbd31c71c5b2cc6dd7acd853e52fb6e7a37fdf61 Author: Bartosz Golaszewski Date: Tue Sep 12 11:45:17 2023 +0200 gpio: eic-sprd: unregister from the irq notifier on remove() This is a tristate module, it can be unloaded. We need to cleanup properly and unregister from the interrupt notifier on driver detach. Fixes: b32415652a4d ("gpio: eic-sprd: use atomic notifiers to notify all chips about irqs") Signed-off-by: Bartosz Golaszewski Reviewed-by: Baolin Wang commit 423c3361855c1e81f1cb91728a2ac5ddfd2cbf16 Author: Shravan Kumar Ramani Date: Tue Sep 5 08:49:34 2023 -0400 platform/mellanox: mlxbf-pmc: Add support for BlueField-3 Add new access mechanism and list of supported events to program and read the counters in BlueField-3. Performance counter blocks being added for BlueField-3 include: - Memory Sub-system (mss) which has counters for monitoring various DRAM and related skylib events - Last level Tile, which has 2 sets of counters (llt, llt_miss) for monitoring Tile and cache metrics Signed-off-by: Shravan Kumar Ramani Reviewed-by: Vadim Pasternak Reviewed-by: David Thompson Link: https://lore.kernel.org/r/d5feee745f6bfd163e0c361e300d4b2ef1d72e00.1693917738.git.shravankr@nvidia.com Signed-off-by: Hans de Goede commit ca5ab9638e925613f73b575041801a7b2fd26bd4 Merge: a4a09ac64ef21 ef765c2587594 Author: David S. Miller Date: Wed Sep 13 12:38:53 2023 +0100 Merge branch 'selftests-classid' Pedro Tammela says: ==================== selftests/tc-testing: add tests covering classid Patches 1-3 add missing tests covering classid behaviour on tdc for cls_fw, cls_route and cls_fw. This behaviour was recently fixed by valis[0]. Patch 4 comes from the development done in the previous patches as it turns out cls_route never returns meaningful errors. [0] https://lore.kernel.org/all/20230729123202.72406-1-jhs@mojatatu.com/ v2->v3: https://lore.kernel.org/all/20230825155148.659895-1-pctammela@mojatatu.com/ - Added changes that were left in the working tree (Jakub) - Fixed two typos in commit message titles - Added Victor tags v1->v2: https://lore.kernel.org/all/20230818163544.351104-1-pctammela@mojatatu.com/ - Drop u32 updates ==================== Signed-off-by: David S. Miller commit ef765c25875941564edf447302ff339363441e58 Author: Pedro Tammela Date: Mon Sep 11 18:50:16 2023 -0300 net/sched: cls_route: make netlink errors meaningful Use netlink extended ack and parsing policies to return more meaningful errors instead of the relying solely on errnos. Reviewed-by: Victor Nogueira Signed-off-by: Pedro Tammela Signed-off-by: David S. Miller commit e2f2fb3c352da855da2b9e1b2fd43a07cc1cd009 Author: Pedro Tammela Date: Mon Sep 11 18:50:15 2023 -0300 selftests/tc-testing: cls_u32: add tests for classid As discussed in '3044b16e7c6f', cls_u32 was handling the use of classid incorrectly. Add a test to check if it's conforming to the correct behaviour. Reviewed-by: Victor Nogueira Signed-off-by: Pedro Tammela Signed-off-by: David S. Miller commit 7c339083616ce803fce1bfe322bf2e20d8d84ab0 Author: Pedro Tammela Date: Mon Sep 11 18:50:14 2023 -0300 selftests/tc-testing: cls_route: add tests for classid As discussed in 'b80b829e9e2c', cls_route was handling the use of classid incorrectly. Add a test to check if it's conforming to the correct behaviour. Reviewed-by: Victor Nogueira Signed-off-by: Pedro Tammela Signed-off-by: David S. Miller commit 70ad43333cbeaaa173cce9825f3afa63ba7ce88d Author: Pedro Tammela Date: Mon Sep 11 18:50:13 2023 -0300 selftests/tc-testing: cls_fw: add tests for classid As discussed in '76e42ae83199', cls_fw was handling the use of classid incorrectly. Add a few tests to check if it's conforming to the correct behaviour. Reviewed-by: Victor Nogueira Signed-off-by: Pedro Tammela Signed-off-by: David S. Miller commit 30ca8b0c4d6c9fb1d76e5894b1e8bf7c6a12224d Author: Aditya Kumar Singh Date: Tue Sep 12 10:48:55 2023 +0530 wifi: cfg80211: export DFS CAC time and usable state helper functions cfg80211 has cfg80211_chandef_dfs_usable() function to know whether at least one channel in the chandef is in usable state or not. Also, cfg80211_chandef_dfs_cac_time() function is there which tells the CAC time required for the given chandef. Make these two functions visible to drivers by exporting their symbol to global list of kernel symbols. Lower level drivers can make use of these two functions to be aware if CAC is required on the given chandef and for how long. For example drivers which maintains the CAC state internally can make use of these. Signed-off-by: Aditya Kumar Singh Reviewed-by: Jeff Johnson Link: https://lore.kernel.org/r/20230912051857.2284-2-quic_adisi@quicinc.com Signed-off-by: Johannes Berg commit a4a09ac64ef211bbcd82b5ff433814746d96605c Author: Andy Gospodarek Date: Mon Sep 11 16:00:59 2023 -0400 MAINTAINERS: update tg3 maintainer list Signed-off-by: Andy Gospodarek Signed-off-by: Pavan Chebbi pavan.chebbi@broadcom.com Signed-off-by: Siva Reddy Kallam Signed-off-by: Prashant Sreedharan Reviewed-by: Michael Chan Signed-off-by: David S. Miller commit 9cc91173cf1b050562244b98af154cef8b9b1096 Author: Christophe JAILLET Date: Mon Sep 11 21:50:52 2023 +0200 net: hinic: Use devm_kasprintf() Use devm_kasprintf() instead of hand writing it. This is less verbose and less error prone. Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman Signed-off-by: David S. Miller commit f3244b6551288a2cf060008df98773b6de001201 Author: Linus Walleij Date: Wed Sep 13 10:50:19 2023 +0200 pinctrl: nuvoton: Fix up Kconfig deps We have build errors due to missing dependency on OF. Add the dependency and do it the same way for all three Nuvotons while we are at it. Reported-by: Randy Dunlap Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230913-novoton-kconfig-v1-1-1c2dff14c0d2@linaro.org commit b13b6bbfbb627884f18982600f7b5a5200652531 Author: Abhishek Kumar Date: Thu Jun 29 03:52:54 2023 +0000 wifi: cfg80211: call reg_call_notifier on beacon hints Currently the channel property updates are not propagated to driver. This causes issues in the discovery of hidden SSIDs and fails to connect to them. This change defines a new wiphy flag which when enabled by vendor driver, the reg_call_notifier callback will be trigger on beacon hints. This ensures that the channel property changes are visible to the vendor driver. The vendor changes the channels for active scans. This fixes the discovery issue of hidden SSID. Signed-off-by: Abhishek Kumar Link: https://lore.kernel.org/r/20230629035254.1.I059fe585f9f9e896c2d51028ef804d197c8c009e@changeid Signed-off-by: Johannes Berg commit 13ba6794d29ee273c26f26b6c7892797ac9957ae Author: Raj Kumar Bhagat Date: Fri Apr 21 11:43:12 2023 +0530 wifi: cfg80211: allow reg update by driver even if wiphy->regd is set Currently regulatory update by driver is not allowed when the wiphy->regd is already set and drivers_request->intersect is false. During wiphy registration, some drivers (ath10k does this currently) first register the world regulatory to cfg80211 using wiphy_apply_custom_regulatory(). The driver then obtain the current operating country and tries to update the correct regulatory to cfg80211 using regulatory_hint(). But at this point, wiphy->regd is already set to world regulatory. Also, since this is the first request from driver after the world regulatory is set this will result in drivers_request->intersect set to false. In this condition the driver request regulatory is not allowed to update to cfg80211 in reg_set_rd_driver(). This restricts the device operation to the world regulatory. This driver request to update the regulatory with current operating country is valid and should be updated to cfg80211. Hence allow regulatory update by driver even if the wiphy->regd is already set and driver_request->intersect is false. Signed-off-by: Raj Kumar Bhagat Reviewed-by: Jeff Johnson Link: https://lore.kernel.org/r/20230421061312.13722-1-quic_rajkbhag@quicinc.com Signed-off-by: Johannes Berg commit 6bc5ddb2fd0653a3e66a8e41fa4c20eced13e4d8 Author: Aloka Dixit Date: Thu Jul 27 10:41:00 2023 -0700 wifi: mac80211: additions to change_beacon() Process FILS discovery and unsolicited broadcast probe response transmission configurations in ieee80211_change_beacon(). Signed-off-by: Aloka Dixit Reviewed-by: Jeff Johnson Link: https://lore.kernel.org/r/20230727174100.11721-6-quic_alokad@quicinc.com Signed-off-by: Johannes Berg commit b2d431d43c8a3e61a384e0b7b3c9d595ea77895d Author: Aloka Dixit Date: Thu Jul 27 10:40:59 2023 -0700 wifi: nl80211: additions to NL80211_CMD_SET_BEACON FILS discovery and unsolicited broadcast probe response templates need to be updated along with beacon templates in some cases such as the channel switch operation. Add the missing implementation. Signed-off-by: Aloka Dixit Reviewed-by: Jeff Johnson Link: https://lore.kernel.org/r/20230727174100.11721-5-quic_alokad@quicinc.com Signed-off-by: Johannes Berg commit 66f85d57b7109baf8a7d5ee04049ac9412611d35 Author: Aloka Dixit Date: Thu Jul 27 10:40:58 2023 -0700 wifi: cfg80211: modify prototype for change_beacon Modify the prototype for change_beacon() in struct cfg80211_op to accept cfg80211_ap_settings instead of cfg80211_beacon_data so that it can process data in addition to beacons. Modify the prototypes of ieee80211_change_beacon() and driver specific functions accordingly. Signed-off-by: Aloka Dixit Reviewed-by: Jeff Johnson Link: https://lore.kernel.org/r/20230727174100.11721-4-quic_alokad@quicinc.com [while at it, remove pointless "if (info)" check in tracing that just makes all the lines longer than they need be - it's never NULL] Signed-off-by: Johannes Berg commit 3b1c256eb4aedfc71dd97d5951ccff824b41d628 Author: Aloka Dixit Date: Thu Jul 27 10:40:57 2023 -0700 wifi: mac80211: fixes in FILS discovery updates FILS discovery configuration gets updated only if the maximum interval is set to a non-zero value, hence there is no way to reset this value to 0 once set. Replace the check for interval with a new flag which is set only if the configuration should be updated. Add similar changes for the unsolicited broadcast probe response handling. Signed-off-by: Aloka Dixit Reviewed-by: Jeff Johnson Link: https://lore.kernel.org/r/20230727174100.11721-3-quic_alokad@quicinc.com [move NULL'ing to else branch to not have intermediate NULL visible] Signed-off-by: Johannes Berg commit 0cfaec25995ad3be316631b945be7ced81daa4e7 Author: Aloka Dixit Date: Thu Jul 27 10:40:56 2023 -0700 wifi: nl80211: fixes to FILS discovery updates Add a new flag 'update' which is set to true during start_ap() if (and only if) one of the following two conditions are met: - Userspace passed an empty nested attribute which indicates that the feature should be disabled and templates deleted. - Userspace passed all the parameters for the nested attribute. Existing configuration will not be changed while the flag remains false. Add similar changes for unsolicited broadcast probe response transmission. Signed-off-by: Aloka Dixit Reviewed-by: Jeff Johnson Link: https://lore.kernel.org/r/20230727174100.11721-2-quic_alokad@quicinc.com Signed-off-by: Johannes Berg commit e04b1973e2ab1e58a79156317b0dc25f848efdc5 Author: Tom Rix Date: Wed May 17 08:33:10 2023 -0400 wifi: lib80211: remove unused variables iv32 and iv16 clang with W=1 reports net/wireless/lib80211_crypt_tkip.c:667:7: error: variable 'iv32' set but not used [-Werror,-Wunused-but-set-variable] u32 iv32 = tkey->tx_iv32; ^ This variable not used so remove it. Then remove a similar iv16 variable. Change the comment because the unmodified value is returned. Signed-off-by: Tom Rix Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20230517123310.873023-1-trix@redhat.com [change commit log wrt. 'length', add comment in the code] Signed-off-by: Johannes Berg commit 3b2562dcf91d460753871415f9571effc7965fcf Author: Andrzej Hajda Date: Tue Sep 12 09:35:21 2023 +0200 drm/i915/gt: skip WA verification for GEN7_MISCCPCTL on DG2 Some DG2 firmware locks this register for modification. Using wa_add with read_mask 0 allows to skip checks of such registers. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8945 Signed-off-by: Andrzej Hajda Reviewed-by: Nirmoy Das Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230912073521.2106162-1-andrzej.hajda@intel.com commit 2400dfe23fa91612c18c6c8d8a5b8164ff98836c Author: Johannes Berg Date: Tue Aug 29 12:17:44 2023 +0200 wifi: mac80211: remove shifted rate support We really cannot even get into this as we can't have a BSS with a 5/10 MHz (scan) width, and therefore all the code handling shifted rates cannot happen. Remove it all, since it's broken anyway, at least with MLO. Signed-off-by: Johannes Berg commit 278adec9392ee4dd5629fae43ce9f4a9825bdf9a Author: xianwei.zhao Date: Mon Sep 11 10:52:18 2023 +0800 pmdomain: amlogic: modify some power domains property Some power domains for C3 can be using runtime PM, remove ALWAYS_ON property. And add some power domains description when ALWAYS_ON property. Signed-off-by: xianwei.zhao Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230911025223.3433776-2-xianwei.zhao@amlogic.com [Ulf: Re-based to fit the pmdomain subsystem] Signed-off-by: Ulf Hansson commit 5add321c329b1746589b51359259666ca3dbe219 Author: Johannes Berg Date: Tue Aug 29 12:17:43 2023 +0200 wifi: cfg80211: remove scan_width support There really isn't any support for scanning at different channel widths than 20 MHz since there's no way to set it. Remove this support for now, if somebody wants to maintain this whole thing later we can revisit how it should work. Signed-off-by: Johannes Berg commit 4c5ba1d7a93e098aececbf93afbdd7add98ec6f3 Author: Jinjie Ruan Date: Wed Aug 23 15:14:37 2023 +0800 staging: vme_user: Use list_for_each_entry() helper Convert list_for_each() to list_for_each_entry() so that the slave/master/dma/handler/lm_pos list_head pointer and list_entry() call are no longer needed, which can reduce a few lines of code. No functional changed. Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230823071437.450460-1-ruanjinjie@huawei.com Signed-off-by: Greg Kroah-Hartman commit 18c258e42b5059ffb1c97b18ce7ea517bc901019 Author: Tree Davies Date: Fri Aug 25 07:08:47 2023 -0700 Staging: rtl8192e: Rename variable pTS in function rtllib_rx_InfraAdhoc() Rename variable pTS in function rtllib_rx_InfraAdhoc() to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-17-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit eb49f4371ba9e87afb7cc52813f33455d4f8ded5 Author: Tree Davies Date: Fri Aug 25 07:08:46 2023 -0700 Staging: rtl8192e: Rename variable pRxTS in function rtllib_rx_check_duplicate() Rename variable pRxTS in function rtllib_rx_check_duplicate() to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-16-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 959e4565b603195e49882c961604564ecad69535 Author: Tree Davies Date: Fri Aug 25 07:08:45 2023 -0700 Staging: rtl8192e: Rename variable pTS in function RxReorderIndicatePacket() Rename variable pTS in function RxReorderIndicatePacket() to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-15-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 90b35a758cc0e666a451004c158ff69ec2c7e49d Author: Tree Davies Date: Fri Aug 25 07:08:44 2023 -0700 Staging: rtl8192e: Rename variable pTS in function rtllib_FlushRxTsPendingPkts() Rename variable pTS in function rtllib_FlushRxTsPendingPkts() to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-14-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit b4a08d2ee13d9469b484ab2c4cfdd094eab7909c Author: Tree Davies Date: Fri Aug 25 07:08:43 2023 -0700 Staging: rtl8192e: Rename variable pTS in function AddReorderEntry() Rename variable pTS in function AddReorderEntry() to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-13-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 097df81e30749db1346af1c25fd75edadf019012 Author: Tree Davies Date: Fri Aug 25 07:08:42 2023 -0700 Staging: rtl8192e: Rename variable pTS in function prototype rtllib_FlushRxTsPendingPkts() Rename variable pTS in function prototype rtllib_FlushRxTsPendingPkts() to ts, to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-12-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit acbc42e16ecd6702dba2fdb8ada224effffde160 Author: Tree Davies Date: Fri Aug 25 07:08:41 2023 -0700 Staging: rtl8192e: Rename variable pRxTS in function RemoveTsEntry() Rename variable pRxTS in function RemoveTsEntry() to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-11-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 12123d88b78bb3b7646f9dd3d88aab840ba4e396 Author: Tree Davies Date: Fri Aug 25 07:08:40 2023 -0700 Staging: rtl8192e: Rename variable tmp in function GetTs() Rename variable tmp in function GetTs() to ts in order to make the name consistent with other references of type struct rx_ts_record. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-10-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 88e5925126fdcd79160b28319e96e57da9da8de2 Author: Tree Davies Date: Fri Aug 25 07:08:39 2023 -0700 Staging: rtl8192e: Rename variable pRxTS in function TSInitialize() Rename variable pRxTS in function TSInitialize() to rxts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-9-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 065680fcc6a4f26d3f84f22b3f58cb87a32b4b5a Author: Tree Davies Date: Fri Aug 25 07:08:38 2023 -0700 Staging: rtl8192e: Rename variable pTS in function ResetRxTsEntry() Rename variable pTS in function ResetRxTsEntry() to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-8-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 9ec52579dcb94a818374c9384316545cd0f00a2c Author: Tree Davies Date: Fri Aug 25 07:08:37 2023 -0700 Staging: rtl8192e: Rename variable pRxTs in function RxPktPendingTimeout() Rename variable pRxTs in function RxPktPendingTimeout() to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-7-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit acb0068f5526b1753870b56125f99343b1dae626 Author: Tree Davies Date: Fri Aug 25 07:08:36 2023 -0700 Staging: rtl8192e: Rename variable pRxTs in function rtllib_rx_ba_inact_timeout() Rename varialbe pRxTs in function rtllib_rx_ba_inact_timeout() to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-6-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 50174d91b2fce3ca05c77ac87f800e6bd8338bd4 Author: Tree Davies Date: Fri Aug 25 07:08:35 2023 -0700 Staging: rtl8192e: Rename variable pRxTs in function rtllib_ts_init_del_ba() Rename variable pRxTs in function rtllib_ts_init_del_ba() to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-5-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 88bb0f442c7f8ac361eb83a7619e2de047054e67 Author: Tree Davies Date: Fri Aug 25 07:08:34 2023 -0700 Staging: rtl8192e: Rename variable pRxTs in function rtllib_rx_DELBA() Rename variable pRxTs in function rtllib_rx_DELBA() to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-4-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 568fb23971046ce10b8d7cff265f661f6ce199de Author: Tree Davies Date: Fri Aug 25 07:08:33 2023 -0700 Staging: rtl8192e: Rename variable pTS in function rtllib_rx_ADDBAReq() Rename variable pTS in function rtllib_rx_ADDBAReq() to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-3-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 0114d2209e88a0b82445c39d7ff88c20402162dd Author: Tree Davies Date: Fri Aug 25 07:08:32 2023 -0700 Staging: rtl8192e: Rename variable pRxTs in function rx_ts_delete_ba() Rename variable pRxTs in function rx_ts_delete_ba() to ts to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies Tested-by: Philipp Hortmann Link: https://lore.kernel.org/r/20230825140847.501113-2-tdavies@darkphysics.net Signed-off-by: Greg Kroah-Hartman commit 22446b7ee2bb44fe7a61d8eda6d83bdc726bbbd9 Author: Dmitry Antipov Date: Tue Sep 12 06:55:16 2023 +0300 wifi: wext: avoid extra calls to strlen() in ieee80211_bss() Since 'sprintf()' returns the number of characters emitted, an extra calls to 'strlen()' in 'ieee80211_bss()' may be dropped. Signed-off-by: Dmitry Antipov Link: https://lore.kernel.org/r/20230912035522.15947-1-dmantipov@yandex.ru Signed-off-by: Johannes Berg commit 8c73d5248dcf112611654bcd32352dc330b02397 Author: Johannes Berg Date: Wed Sep 13 09:34:25 2023 +0200 wifi: cfg80211: fix kernel-doc for wiphy_delayed_work_flush() Clearly, there's no space in the function name, not sure how that could've happened. Put the underscore that it should be. Reported-by: Stephen Rothwell Fixes: 56cfb8ce1f7f ("wifi: cfg80211: add flush functions for wiphy work") Signed-off-by: Johannes Berg commit 7e6cadf51a55e3834db4516b1027894b257a1d39 Merge: 8fc8911b66962 221465de6bd80 Author: David S. Miller Date: Wed Sep 13 06:50:58 2023 +0100 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2023-09-11 (i40e, iavf) This series contains updates to i40e and iavf drivers. Andrii ensures all VSIs are cleaned up for remove in i40e. Brett reworks logic for setting promiscuous mode that can, currently, cause incorrect states on iavf. --- v2: - Remove redundant i40e_vsi_free_q_vectors() and kfree() calls (patch 1) v1: https://lore.kernel.org/netdev/20230905180521.887861-1-anthony.l.nguyen@intel.com/ ==================== Signed-off-by: David S. Miller commit 7b804135d4d1f0a2b9dda69c6303d3f2dcbe9d37 Author: Kai Huang Date: Tue Aug 15 23:02:05 2023 +1200 x86/virt/tdx: Make TDX_MODULE_CALL handle SEAMCALL #UD and #GP SEAMCALL instruction causes #UD if the CPU isn't in VMX operation. Currently the TDX_MODULE_CALL assembly doesn't handle #UD, thus making SEAMCALL when VMX is disabled would cause Oops. Unfortunately, there are legal cases that SEAMCALL can be made when VMX is disabled. For instance, VMX can be disabled due to emergency reboot while there are still TDX guests running. Extend the TDX_MODULE_CALL assembly to return an error code for #UD to handle this case gracefully, e.g., KVM can then quietly eat all SEAMCALL errors caused by emergency reboot. SEAMCALL instruction also causes #GP when TDX isn't enabled by the BIOS. Use _ASM_EXTABLE_FAULT() to catch both exceptions with the trap number recorded, and define two new error codes by XORing the trap number to the TDX_SW_ERROR. This opportunistically handles #GP too while using the same simple assembly code. A bonus is when kernel mistakenly calls SEAMCALL when CPU isn't in VMX operation, or when TDX isn't enabled by the BIOS, or when the BIOS is buggy, the kernel can get a nicer error code rather than a less understandable Oops. This is basically based on Peter's code. Suggested-by: Peter Zijlstra Signed-off-by: Kai Huang Signed-off-by: Dave Hansen Reviewed-by: Kirill A. Shutemov Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/all/de975832a367f476aab2d0eb0d9de66019a16b54.1692096753.git.kai.huang%40intel.com commit c33621b4c5ad5b6b8b245754013cc506f9ded2b8 Author: Kai Huang Date: Tue Aug 15 23:02:04 2023 +1200 x86/virt/tdx: Wire up basic SEAMCALL functions Intel Trust Domain Extensions (TDX) protects guest VMs from malicious host and certain physical attacks. A CPU-attested software module called 'the TDX module' runs inside a new isolated memory range as a trusted hypervisor to manage and run protected VMs. TDX introduces a new CPU mode: Secure Arbitration Mode (SEAM). This mode runs only the TDX module itself or other code to load the TDX module. The host kernel communicates with SEAM software via a new SEAMCALL instruction. This is conceptually similar to a guest->host hypercall, except it is made from the host to SEAM software instead. The TDX module establishes a new SEAMCALL ABI which allows the host to initialize the module and to manage VMs. The SEAMCALL ABI is very similar to the TDCALL ABI and leverages much TDCALL infrastructure. Wire up basic functions to make SEAMCALLs for the basic support of running TDX guests: __seamcall(), __seamcall_ret(), and __seamcall_saved_ret() for TDH.VP.ENTER. All SEAMCALLs involved in the basic TDX support don't use "callee-saved" registers as input and output, except the TDH.VP.ENTER. To start to support TDX, create a new arch/x86/virt/vmx/tdx/tdx.c for TDX host kernel support. Add a new Kconfig option CONFIG_INTEL_TDX_HOST to opt-in TDX host kernel support (to distinguish with TDX guest kernel support). So far only KVM uses TDX. Make the new config option depend on KVM_INTEL. Signed-off-by: Kai Huang Signed-off-by: Dave Hansen Reviewed-by: Kirill A. Shutemov Acked-by: Peter Zijlstra (Intel) Tested-by: Isaku Yamahata Link: https://lore.kernel.org/all/4db7c3fc085e6af12acc2932294254ddb3d320b3.1692096753.git.kai.huang%40intel.com commit 8a8544bde858e5d62d79df6baaa387e0b6587dc7 Author: Kai Huang Date: Tue Aug 15 23:02:03 2023 +1200 x86/tdx: Remove 'struct tdx_hypercall_args' Now 'struct tdx_hypercall_args' is basically 'struct tdx_module_args' minus RCX. Although from __tdx_hypercall()'s perspective RCX isn't used as shared register thus not part of input/output registers, it's not worth to have a separate structure just due to one register. Remove the 'struct tdx_hypercall_args' and use 'struct tdx_module_args' instead in __tdx_hypercall() related code. This also saves the memory copy between the two structures within __tdx_hypercall(). Suggested-by: Peter Zijlstra Signed-off-by: Kai Huang Signed-off-by: Dave Hansen Reviewed-by: Kirill A. Shutemov Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/all/798dad5ce24e9d745cf0e16825b75ccc433ad065.1692096753.git.kai.huang%40intel.com commit 90f5ecd37faed9a59eb2788a56dac8deeee0a508 Author: Kai Huang Date: Tue Aug 15 23:02:02 2023 +1200 x86/tdx: Reimplement __tdx_hypercall() using TDX_MODULE_CALL asm Now the TDX_HYPERCALL asm is basically identical to the TDX_MODULE_CALL with both '\saved' and '\ret' enabled, with two minor things though: 1) The way to restore the structure pointer is different The TDX_HYPERCALL uses RCX as spare to restore the structure pointer, but the TDX_MODULE_CALL assumes no spare register can be used. In other words, TDX_MODULE_CALL already covers what TDX_HYPERCALL does. 2) TDX_MODULE_CALL only clears shared registers for TDH.VP.ENTER For this just need to make that code available for the non-host case. Thus, remove the TDX_HYPERCALL and reimplement the __tdx_hypercall() using the TDX_MODULE_CALL. Extend the TDX_MODULE_CALL to cover "clear shared registers" for TDG.VP.VMCALL. Introduce a new __tdcall_saved_ret() to replace the temporary __tdcall_hypercall(). The __tdcall_saved_ret() can also be used for those new TDCALLs which require more input/output registers than the basic TDCALLs do. Suggested-by: Peter Zijlstra Signed-off-by: Kai Huang Signed-off-by: Dave Hansen Reviewed-by: Kirill A. Shutemov Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/all/e68a2473fb6f5bcd78b078cae7510e9d0753b3df.1692096753.git.kai.huang%40intel.com commit c641cfb5c157b6c3062a824fd8ba190bf06fb952 Author: Kai Huang Date: Tue Aug 15 23:02:01 2023 +1200 x86/tdx: Make TDX_HYPERCALL asm similar to TDX_MODULE_CALL Now the 'struct tdx_hypercall_args' and 'struct tdx_module_args' are almost the same, and the TDX_HYPERCALL and TDX_MODULE_CALL asm macro share similar code pattern too. The __tdx_hypercall() and __tdcall() should be unified to use the same assembly code. As a preparation to unify them, simplify the TDX_HYPERCALL to make it more like the TDX_MODULE_CALL. The TDX_HYPERCALL takes the pointer of 'struct tdx_hypercall_args' as function call argument, and does below extra things comparing to the TDX_MODULE_CALL: 1) It sets RAX to 0 (TDG.VP.VMCALL leaf) internally; 2) It sets RCX to the (fixed) bitmap of shared registers internally; 3) It calls __tdx_hypercall_failed() internally (and panics) when the TDCALL instruction itself fails; 4) After TDCALL, it moves R10 to RAX to return the return code of the VMCALL leaf, regardless the '\ret' asm macro argument; Firstly, change the TDX_HYPERCALL to take the same function call arguments as the TDX_MODULE_CALL does: TDCALL leaf ID, and the pointer to 'struct tdx_module_args'. Then 1) and 2) can be moved to the caller: - TDG.VP.VMCALL leaf ID can be passed via the function call argument; - 'struct tdx_module_args' is 'struct tdx_hypercall_args' + RCX, thus the bitmap of shared registers can be passed via RCX in the structure. Secondly, to move 3) and 4) out of assembly, make the TDX_HYPERCALL always save output registers to the structure. The caller then can: - Call __tdx_hypercall_failed() when TDX_HYPERCALL returns error; - Return R10 in the structure as the return code of the VMCALL leaf; With above changes, change the asm function from __tdx_hypercall() to __tdcall_hypercall(), and reimplement __tdx_hypercall() as the C wrapper of it. This avoids having to add another wrapper of __tdx_hypercall() (_tdx_hypercall() is already taken). The __tdcall_hypercall() will be replaced with a __tdcall() variant using TDX_MODULE_CALL in a later commit as the final goal is to have one assembly to handle both TDCALL and TDVMCALL. Currently, the __tdx_hypercall() asm is in '.noinstr.text'. To keep this unchanged, annotate __tdx_hypercall(), which is a C function now, as 'noinstr'. Remove the __tdx_hypercall_ret() as __tdx_hypercall() already does so. Implement __tdx_hypercall() in tdx-shared.c so it can be shared with the compressed code. Opportunistically fix a checkpatch error complaining using space around parenthesis '(' and ')' while moving the bitmap of shared registers to . [ dhansen: quash new calls of __tdx_hypercall_ret() that showed up ] Suggested-by: Peter Zijlstra Signed-off-by: Kai Huang Signed-off-by: Dave Hansen Reviewed-by: Kirill A. Shutemov Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/all/0cbf25e7aee3256288045023a31f65f0cef90af4.1692096753.git.kai.huang%40intel.com commit 8f1004679987302b155f14b966ca6d4335814fcb Author: Alison Schofield Date: Mon Jul 10 13:02:59 2023 -0700 ACPI/NUMA: Apply SRAT proximity domain to entire CFMWS window Commit fd49f99c1809 ("ACPI: NUMA: Add a node and memblk for each CFMWS not in SRAT") did not account for the case where the BIOS only partially describes a CFMWS Window in the SRAT. That means the omitted address ranges, of a partially described CFMWS Window, do not get assigned to a NUMA node. Replace the call to phys_to_target_node() with numa_add_memblks(). Numa_add_memblks() searches an HPA range for existing memblk(s) and extends those memblk(s) to fill the entire CFMWS Window. Extending the existing memblks is a simple strategy that reuses SRAT defined proximity domains from part of a window to fill out the entire window, based on the knowledge* that all of a CFMWS window is of a similar performance class. *Note that this heuristic will evolve when CFMWS Windows present a wider range of characteristics. The extension of the proximity domain, implemented here, is likely a step in developing a more sophisticated performance profile in the future. There is no change in behavior when the SRAT does not describe the CFMWS Window at all. In that case, a new NUMA node with a single memblk covering the entire CFMWS Window is created. Fixes: fd49f99c1809 ("ACPI: NUMA: Add a node and memblk for each CFMWS not in SRAT") Reported-by: Derick Marks Suggested-by: Dan Williams Signed-off-by: Alison Schofield Signed-off-by: Dave Hansen Reviewed-by: Dan Williams Tested-by: Derick Marks Link: https://lore.kernel.org/all/eaa0b7cffb0951a126223eef3cbe7b55b8300ad9.1689018477.git.alison.schofield%40intel.com commit 8f012db27c9516be1a7aca93ea4a6ca9c75056c9 Author: Alison Schofield Date: Mon Jul 10 13:02:58 2023 -0700 x86/numa: Introduce numa_fill_memblks() numa_fill_memblks() fills in the gaps in numa_meminfo memblks over an physical address range. The ACPI driver will use numa_fill_memblks() to implement a new Linux policy that prescribes extending proximity domains in a portion of a CFMWS window to the entire window. Dan Williams offered this explanation of the policy: A CFWMS is an ACPI data structure that indicates *potential* locations where CXL memory can be placed. It is the playground where the CXL driver has free reign to establish regions. That space can be populated by BIOS created regions, or driver created regions, after hotplug or other reconfiguration. When BIOS creates a region in a CXL Window it additionally describes that subset of the Window range in the other typical ACPI tables SRAT, SLIT, and HMAT. The rationale for BIOS not pre-describing the entire CXL Window in SRAT, SLIT, and HMAT is that it can not predict the future. I.e. there is nothing stopping higher or lower performance devices being placed in the same Window. Compare that to ACPI memory hotplug that just onlines additional capacity in the proximity domain with little freedom for dynamic performance differentiation. That leaves the OS with a choice, should unpopulated window capacity match the proximity domain of an existing region, or should it allocate a new one? This patch takes the simple position of minimizing proximity domain proliferation by reusing any proximity domain intersection for the entire Window. If the Window has no intersections then allocate a new proximity domain. Note that SRAT, SLIT and HMAT information can be enumerated dynamically in a standard way from device provided data. Think of CXL as the end of ACPI needing to describe memory attributes, CXL offers a standard discovery model for performance attributes, but Linux still needs to interoperate with the old regime. Reported-by: Derick Marks Suggested-by: Dan Williams Signed-off-by: Alison Schofield Signed-off-by: Dave Hansen Reviewed-by: Dan Williams Tested-by: Derick Marks Link: https://lore.kernel.org/all/ef078a6f056ca974e5af85997013c0fda9e3326d.1689018477.git.alison.schofield%40intel.com commit b92f5e4fccc2ca96241904bb1a4e96547b69163d Author: Biju Das Date: Sat Sep 2 20:33:31 2023 +0100 power: supply: bq24257_charger: Cleanup OF/ID table terminators Some cleanups: * Remove trailing comma in the terminator entry for OF/ID/ACPI table. * Drop a space from terminator entry for OF table. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230902193331.83672-3-biju.das.jz@bp.renesas.com Signed-off-by: Sebastian Reichel commit 3dc4a291a1b156d3ee9a78672ec950601bd68c1c Author: Biju Das Date: Sat Sep 2 20:33:30 2023 +0100 power: supply: bq24257_charger: Make chip type and name in sync Add struct bq2425x_chip_info to make enum bq2425x_chip and it's name in sync and replace chip->info in struct bq24257_device and add struct bq2425x_chip_info as match data for OF/ACPI/ID tables. Simpilfy probe() by replacing acpi_match_device() and id lookup for retrieving match data by using i2c_get_match_data(). Drop bq2425x_chip_name as there is no user and also drop the comment related to syncing chip and name as it is taken care by struct bq2425x_chip_info. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230902193331.83672-2-biju.das.jz@bp.renesas.com Signed-off-by: Sebastian Reichel commit ab907d99d5d4e40ba638b6a27940d59fcb2ad24d Author: Biju Das Date: Sat Sep 2 21:05:18 2023 +0100 power: supply: bq2515x: Cleanup OF/ID table terminators Some cleanups: * Remove trailing comma in the terminator entry for OF/ID table. * Drop a space from terminator entry for OF table. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230902200518.91585-3-biju.das.jz@bp.renesas.com Signed-off-by: Sebastian Reichel commit addd7aef251cca374cef743824cc5ae230370bd0 Author: Alex Deucher Date: Mon Sep 11 17:38:57 2023 -0400 drm/amdgpu: add remap_hdp_registers callback for nbio 7.11 Implement support for remapping the HDP aperture registers for NBIO 7.11. Reviewed-by: Lang Yu Signed-off-by: Alex Deucher commit b85a17d35415d8a94db5c58f008a2ae11d4702bd Author: Alex Deucher Date: Mon Sep 11 17:30:28 2023 -0400 drm/amdgpu: add vcn_doorbell_range callback for nbio 7.11 Implement support for setting up the VCN doorbell range for NBIO 7.11. Reviewed-by: Lang Yu Signed-off-by: Alex Deucher commit 4412f8529c02f511b1d41e6c800cc90538ff7579 Author: Harish Kasiviswanathan Date: Mon Sep 11 14:49:06 2023 -0400 drm/amdkfd: Insert missing TLB flush on GFX10 and later Heavy-weight TLB flush is required after unmap on all GPUs for correctness and security. Signed-off-by: Harish Kasiviswanathan Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 34df25517a9bbec3436ab6f53074bcce9dc3eafc Author: Kees Cook Date: Thu Aug 17 13:22:17 2023 -0700 selinux: Annotate struct sidtab_str_cache with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct sidtab_str_cache. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Paul Moore Cc: Stephen Smalley Cc: Eric Paris Cc: Ondrej Mosnacek Cc: selinux@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Signed-off-by: Paul Moore commit 999b81b907ea92fa759e426591068244d9635496 Author: Ian Rogers Date: Mon Sep 11 10:05:59 2023 -0700 perf bpf-filter: Add YYDEBUG YYDEBUG enables line numbers and other error helpers in the generated bpf-filter-bison.c. Conditionally enabled only for debug builds. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Gaosheng Cui Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Peter Zijlstra Cc: Rob Herring Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230911170559.4037734-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 943f7c6f987f4a2bd081e76cf68d4c089dc66c65 Author: Chao Yu Date: Mon Sep 4 23:12:42 2023 +0800 f2fs: compress: fix to avoid fragment w/ OPU during f2fs_ioc_compress_file() If file has both cold and compress flag, during f2fs_ioc_compress_file(), f2fs will trigger IPU for non-compress cluster and OPU for compress cluster, so that, data of the file may be fragmented. Fix it by always triggering OPU for IOs from user mode compression. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit a4639380bbe66172df329f8b54aa7d2e943f0f64 Author: Chao Yu Date: Tue Sep 5 12:57:53 2023 +0800 f2fs: fix to drop meta_inode's page cache in f2fs_put_super() syzbot reports a kernel bug as below: F2FS-fs (loop1): detect filesystem reference count leak during umount, type: 10, count: 1 kernel BUG at fs/f2fs/super.c:1639! CPU: 0 PID: 15451 Comm: syz-executor.1 Not tainted 6.5.0-syzkaller-09338-ge0152e7481c6 #0 RIP: 0010:f2fs_put_super+0xce1/0xed0 fs/f2fs/super.c:1639 Call Trace: generic_shutdown_super+0x161/0x3c0 fs/super.c:693 kill_block_super+0x3b/0x70 fs/super.c:1646 kill_f2fs_super+0x2b7/0x3d0 fs/f2fs/super.c:4879 deactivate_locked_super+0x9a/0x170 fs/super.c:481 deactivate_super+0xde/0x100 fs/super.c:514 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1254 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd In f2fs_put_super(), it tries to do sanity check on dirty and IO reference count of f2fs, once there is any reference count leak, it will trigger panic. The root case is, during f2fs_put_super(), if there is any IO error in f2fs_wait_on_all_pages(), we missed to truncate meta_inode's page cache later, result in panic, fix this case. Fixes: 20872584b8c0 ("f2fs: fix to drop all dirty meta/node pages during umount()") Reported-by: syzbot+ebd7072191e2eddd7d6e@syzkaller.appspotmail.com Closes: https://lore.kernel.org/linux-f2fs-devel/000000000000a14f020604a62a98@google.com Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit f803982190f0265fd36cf84670aa6daefc2b0768 Author: Jaegeuk Kim Date: Thu Sep 7 11:11:00 2023 -0700 f2fs: split initial and dynamic conditions for extent_cache Let's allocate the extent_cache tree without dynamic conditions to avoid a missing condition causing a panic as below. # create a file w/ a compressed flag # disable the compression # panic while updating extent_cache F2FS-fs (dm-64): Swapfile: last extent is not aligned to section F2FS-fs (dm-64): Swapfile (3) is not align to section: 1) creat(), 2) ioctl(F2FS_IOC_SET_PIN_FILE), 3) fallocate(2097152 * N) Adding 124996k swap on ./swap-file. Priority:0 extents:2 across:17179494468k ================================================================== BUG: KASAN: null-ptr-deref in instrument_atomic_read_write out/common/include/linux/instrumented.h:101 [inline] BUG: KASAN: null-ptr-deref in atomic_try_cmpxchg_acquire out/common/include/asm-generic/atomic-instrumented.h:705 [inline] BUG: KASAN: null-ptr-deref in queued_write_lock out/common/include/asm-generic/qrwlock.h:92 [inline] BUG: KASAN: null-ptr-deref in __raw_write_lock out/common/include/linux/rwlock_api_smp.h:211 [inline] BUG: KASAN: null-ptr-deref in _raw_write_lock+0x5a/0x110 out/common/kernel/locking/spinlock.c:295 Write of size 4 at addr 0000000000000030 by task syz-executor154/3327 CPU: 0 PID: 3327 Comm: syz-executor154 Tainted: G O 5.10.185 #1 Hardware name: emulation qemu-x86/qemu-x86, BIOS 2023.01-21885-gb3cc1cd24d 01/01/2023 Call Trace: __dump_stack out/common/lib/dump_stack.c:77 [inline] dump_stack_lvl+0x17e/0x1c4 out/common/lib/dump_stack.c:118 __kasan_report+0x16c/0x260 out/common/mm/kasan/report.c:415 kasan_report+0x51/0x70 out/common/mm/kasan/report.c:428 kasan_check_range+0x2f3/0x340 out/common/mm/kasan/generic.c:186 __kasan_check_write+0x14/0x20 out/common/mm/kasan/shadow.c:37 instrument_atomic_read_write out/common/include/linux/instrumented.h:101 [inline] atomic_try_cmpxchg_acquire out/common/include/asm-generic/atomic-instrumented.h:705 [inline] queued_write_lock out/common/include/asm-generic/qrwlock.h:92 [inline] __raw_write_lock out/common/include/linux/rwlock_api_smp.h:211 [inline] _raw_write_lock+0x5a/0x110 out/common/kernel/locking/spinlock.c:295 __drop_extent_tree+0xdf/0x2f0 out/common/fs/f2fs/extent_cache.c:1155 f2fs_drop_extent_tree+0x17/0x30 out/common/fs/f2fs/extent_cache.c:1172 f2fs_insert_range out/common/fs/f2fs/file.c:1600 [inline] f2fs_fallocate+0x19fd/0x1f40 out/common/fs/f2fs/file.c:1764 vfs_fallocate+0x514/0x9b0 out/common/fs/open.c:310 ksys_fallocate out/common/fs/open.c:333 [inline] __do_sys_fallocate out/common/fs/open.c:341 [inline] __se_sys_fallocate out/common/fs/open.c:339 [inline] __x64_sys_fallocate+0xb8/0x100 out/common/fs/open.c:339 do_syscall_64+0x35/0x50 out/common/arch/x86/entry/common.c:46 Cc: stable@vger.kernel.org Fixes: 72840cccc0a1 ("f2fs: allocate the extent_cache by default") Reported-and-tested-by: syzbot+d342e330a37b48c094b7@syzkaller.appspotmail.com Signed-off-by: Jaegeuk Kim commit 7e1b150fece033703a824df1bbc03df091ea53cc Author: Chao Yu Date: Mon Aug 28 22:04:17 2023 +0800 f2fs: compress: fix to avoid redundant compress extension With below script, redundant compress extension will be parsed and added by parse_options(), because parse_options() doesn't check whether the extension is existed or not, fix it. 1. mount -t f2fs -o compress_extension=so /dev/vdb /mnt/f2fs 2. mount -t f2fs -o remount,compress_extension=so /mnt/f2fs 3. mount|grep f2fs /dev/vdb on /mnt/f2fs type f2fs (...,compress_extension=so,compress_extension=so,...) Fixes: 4c8ff7095bef ("f2fs: support data compression") Fixes: 151b1982be5d ("f2fs: compress: add nocompress extensions support") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2aaea533bf063ed3b442df5fe5f6abfc538054c9 Author: Chao Yu Date: Mon Aug 28 22:04:16 2023 +0800 f2fs: compress: do sanity check on cluster when CONFIG_F2FS_CHECK_FS is on This patch covers sanity check logic on cluster w/ CONFIG_F2FS_CHECK_FS, otherwise, there will be performance regression while querying cluster mapping info. Callers of f2fs_is_compressed_cluster() only care about whether cluster is compressed or not, rather than # of valid blocks in compressed cluster, so, let's adjust f2fs_is_compressed_cluster()'s logic according to caller's requirement. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b0327c84e91a0f4f0abced8cb83ec86a7083f086 Author: Chao Yu Date: Mon Aug 28 22:04:15 2023 +0800 f2fs: compress: fix to avoid use-after-free on dic Call trace: __memcpy+0x128/0x250 f2fs_read_multi_pages+0x940/0xf7c f2fs_mpage_readpages+0x5a8/0x624 f2fs_readahead+0x5c/0x110 page_cache_ra_unbounded+0x1b8/0x590 do_sync_mmap_readahead+0x1dc/0x2e4 filemap_fault+0x254/0xa8c f2fs_filemap_fault+0x2c/0x104 __do_fault+0x7c/0x238 do_handle_mm_fault+0x11bc/0x2d14 do_mem_abort+0x3a8/0x1004 el0_da+0x3c/0xa0 el0t_64_sync_handler+0xc4/0xec el0t_64_sync+0x1b4/0x1b8 In f2fs_read_multi_pages(), once f2fs_decompress_cluster() was called if we hit cached page in compress_inode's cache, dic may be released, it needs break the loop rather than continuing it, in order to avoid accessing invalid dic pointer. Fixes: 6ce19aff0b8c ("f2fs: compress: add compress_inode to cache compressed blocks") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c5d3f9b7649abb20aa5ab3ebff9421a171eaeb22 Author: Chao Yu Date: Mon Aug 28 22:04:14 2023 +0800 f2fs: compress: fix deadloop in f2fs_write_cache_pages() With below mount option and testcase, it hangs kernel. 1. mount -t f2fs -o compress_log_size=5 /dev/vdb /mnt/f2fs 2. touch /mnt/f2fs/file 3. chattr +c /mnt/f2fs/file 4. dd if=/dev/zero of=/mnt/f2fs/file bs=1MB count=1 5. sync 6. dd if=/dev/zero of=/mnt/f2fs/file bs=111 count=11 conv=notrunc 7. sync INFO: task sync:4788 blocked for more than 120 seconds. Not tainted 6.5.0-rc1+ #322 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:sync state:D stack:0 pid:4788 ppid:509 flags:0x00000002 Call Trace: __schedule+0x335/0xf80 schedule+0x6f/0xf0 wb_wait_for_completion+0x5e/0x90 sync_inodes_sb+0xd8/0x2a0 sync_inodes_one_sb+0x1d/0x30 iterate_supers+0x99/0xf0 ksys_sync+0x46/0xb0 __do_sys_sync+0x12/0x20 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 The reason is f2fs_all_cluster_page_ready() assumes that pages array should cover at least one cluster, otherwise, it will always return false, result in deadloop. By default, pages array size is 16, and it can cover the case cluster_size is equal or less than 16, for the case cluster_size is larger than 16, let's allocate memory of pages array dynamically. Fixes: 4c8ff7095bef ("f2fs: support data compression") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit f0f4cd1003a03b0ae86be8c9ec8e88b0df384001 Author: Ian Rogers Date: Mon Sep 11 10:05:58 2023 -0700 perf pmu: Add YYDEBUG YYDEBUG enables line numbers and other error helpers in the generated pmu-bison.c. Conditionally enabled only for debug builds. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Gaosheng Cui Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Peter Zijlstra Cc: Rob Herring Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230911170559.4037734-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1344a7077d78bb2ba72e539fc9119321d98fd06e Author: Ian Rogers Date: Mon Sep 11 10:05:57 2023 -0700 perf expr: Make YYDEBUG dependent on doing a debug build YYDEBUG enables line numbers and other error helpers in the generated expr-bison.c. These shouldn't be generated when debugging isn't enabled. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Gaosheng Cui Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Peter Zijlstra Cc: Rob Herring Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230911170559.4037734-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit d4ce60190e08d84f88937019defa5e3d23409ac1 Author: Ian Rogers Date: Mon Sep 11 10:05:56 2023 -0700 perf parse-events: Make YYDEBUG dependent on doing a debug build YYDEBUG enables line numbers and other error helpers in the generated parse-events-bison.c. These shouldn't be generated when debugging isn't enabled. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Gaosheng Cui Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Peter Zijlstra Cc: Rob Herring Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230911170559.4037734-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit dc2cfef9a9afe04a1b7683a999065b544d7b54f7 Author: Ian Rogers Date: Mon Sep 11 10:05:55 2023 -0700 perf parse-events: Remove unused header files The fnmatch header is now used in the PMU matching logic in pmu.c. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Gaosheng Cui Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Peter Zijlstra Cc: Rob Herring Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230911170559.4037734-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f5d98b8bdcd3c39b9ec3954573a7be1a5531215f Author: Athira Rajeev Date: Tue Sep 12 12:08:07 2023 +0530 perf tools: Add includes for detected configs in Makefile.perf Makefile.perf uses "CONFIG_*" checks in the code. Example the config for libtraceevent is used to set PYTHON_EXT_SRCS ifeq ($(CONFIG_LIBTRACEEVENT),y) PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources) else PYTHON_EXT_SRCS := $(shell grep -v '^\#\|util/trace-event.c' util/python-ext-sources) endif But this is not picking the value for CONFIG_LIBTRACEEVENT that is set using the settings in Makefile.config. Include the file ".config-detected" so that make will use the system detected configuration in the CONFIG checks. This will fix isues that could arise when other "CONFIG_*" checks are added to Makefile.perf in future as well. Reviewed-by: Ian Rogers Signed-off-by: Athira Rajeev Cc: Disha Goel Cc: Jiri Olsa Cc: Kajol Jain Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230912063807.74250-1-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit bb350847965daf9217e884dc00639f5d2ea89045 Author: Ruidong Tian Date: Mon Sep 11 14:55:41 2023 +0800 perf test: Update cs_etm testcase for Arm ETE Add ETE as one of the supported device types in perf cs_etm testcase. Reviewed-by: James Clark Signed-off-by: Ruidong Tian Cc: Alexander Shishkin Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230911065541.91293-1-tianruidong@linux.alibaba.com Signed-off-by: Arnaldo Carvalho de Melo commit 5cdb51baf34e3d531f726c47a7ae7db80e2edef7 Author: James Clark Date: Thu Aug 31 17:15:32 2023 +0100 perf vendor events arm64: Add V1 metrics using Arm telemetry repo Metrics for V1 weren't previously included in the Perf Jsons, so add them using the telemetry source [1]. After generation any parts identical to the default metrics in sbsa.json were manually removed. [1]: https://gitlab.arm.com/telemetry-solution/telemetry-solution/-/blob/main/data/pmu/cpu/neoverse/neoverse-v1.json Signed-off-by: James Clark Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Nick Forrington Cc: Peter Zijlstra Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230831161618.134738-3-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit a484e64580bdb792ad613ee45bc36efd24f77191 Author: James Clark Date: Thu Aug 31 17:15:31 2023 +0100 perf vendor events arm64: Update V1 events using Arm telemetry repo The new data [1] includes descriptions that may have product specific details and new groupings that will be consistent with other products. The following command was used to generate the jsons: $ telemetry-solution/tools/perf_json_generator/generate.py \ linux/tools/perf/ --telemetry-files \ telemetry-solution/data/pmu/cpu/neoverse/neoverse-v1.json [1]: https://gitlab.arm.com/telemetry-solution/telemetry-solution/-/blob/main/data/pmu/cpu/neoverse/neoverse-v1.json Signed-off-by: James Clark Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Nick Forrington Cc: Peter Zijlstra Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230831161618.134738-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit a1ebf7718ee31501d2d2ee3af1716e0084c81926 Author: James Clark Date: Mon Sep 4 10:50:46 2023 +0100 perf test: Add a test for strcmp_cpuid_str() expression Test that the new expression builtin returns a match when the current escaped CPU ID is given, and that it doesn't match when "0x0" is given. The CPU ID in test__expr() has to be changed to perf_pmu__getcpuid() which returns the CPU ID string, rather than the raw CPU ID that get_cpuid() returns because that can't be used with strcmp_cpuid_str(). It doesn't affect the is_intel test because both versions contain "Intel". Reviewed-by: Ian Rogers Signed-off-by: James Clark Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Chen Zhongjin Cc: Eduard Zingerman Cc: Haixin Yu Cc: Ingo Molnar Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Will Deacon Cc: Yang Jihong Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230904095104.1162928-5-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 8a55c1e2c9e123b399b272a7db23f09dbb74af21 Author: James Clark Date: Mon Sep 4 10:50:45 2023 +0100 perf util: Add a function for replacing characters in a string It finds all occurrences of a single character and replaces them with a multi character string. This will be used in a test in a following commit. Reviewed-by: Ian Rogers Signed-off-by: James Clark Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Chen Zhongjin Cc: Eduard Zingerman Cc: Haixin Yu Cc: Ingo Molnar Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Will Deacon Cc: Yang Jihong Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230904095104.1162928-4-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit f561fc78c5713aae3f90f943fd5aff347ba3d4ee Author: James Clark Date: Mon Sep 4 10:50:44 2023 +0100 perf jevents: Remove unused keyword 'cpuid_not_more_than' was the working title of the new 'strcmp_cpuid_str' keyword and was accidentally left in. It was never used so tidying it up has no effect. Reviewed-by: Ian Rogers Signed-off-by: James Clark Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Chen Zhongjin Cc: Eduard Zingerman Cc: Haixin Yu Cc: Ingo Molnar Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Will Deacon Cc: Yang Jihong Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230904095104.1162928-3-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit d19a353cdd0d3021e31e00df17811ab68472ad77 Author: James Clark Date: Mon Sep 4 10:50:43 2023 +0100 perf test: Check result of has_event(cycles) test Currently the function always returns 0, so even when the has_event() test fails, the test still passes. Fix it by returning ret instead. Reviewed-by: Ian Rogers Signed-off-by: James Clark Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Chen Zhongjin Cc: Eduard Zingerman Cc: Haixin Yu Cc: Ingo Molnar Cc: Jing Zhang Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Liam Howlett Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Miguel Ojeda Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Will Deacon Cc: Yang Jihong Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20230904095104.1162928-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 6bd8c2ea6b93aabcb4a046ca7a6ad353b574d0a3 Author: Ian Rogers Date: Wed Sep 6 16:44:16 2023 -0700 perf list pfm: Retry supported test with exclude_kernel With paranoia set at 2 evsel__open will fail with EACCES for non-root users. To avoid this stopping libpfm4 events from being printed, retry with exclude_kernel enabled - copying the regular is_event_supported test. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Kang Minchul Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230906234416.3472339-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 4f19fc1839e54d2c0d1e449a29a7578d029846d1 Author: Ian Rogers Date: Wed Sep 6 16:44:15 2023 -0700 perf list: Avoid a hardcoded cpu PMU name Use the first core PMU instead. On a Raspberry Pi, before: $ perf list ... cpu/t1=v1[,t2=v2,t3 ...]/modifier [Raw hardware event descriptor] [(see 'man perf-list' on how to encode it)] ... After: $ perf list ... armv8_cortex_a72/t1=v1[,t2=v2,t3 ...]/modifier [Raw hardware event descriptor] [(see 'man perf-list' on how to encode it)] ... ``` Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Kang Minchul Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230906234416.3472339-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e44b47b93132fb757e52fd4547cbfd2243685cb5 Author: Namhyung Kim Date: Wed Sep 6 10:49:03 2023 -0700 perf test shell lock_contention: Add cgroup aggregation and filter tests Add cgroup aggregation and filter tests. $ sudo ./perf test -v contention 84: kernel lock contention analysis test : --- start --- test child forked, pid 222423 Testing perf lock record and perf lock contention Testing perf lock contention --use-bpf Testing perf lock record and perf lock contention at the same time Testing perf lock contention --threads Testing perf lock contention --lock-addr Testing perf lock contention --lock-cgroup Testing perf lock contention --type-filter (w/ spinlock) Testing perf lock contention --lock-filter (w/ tasklist_lock) Testing perf lock contention --callstack-filter (w/ unix_stream) Testing perf lock contention --callstack-filter with task aggregation Testing perf lock contention --cgroup-filter Testing perf lock contention CSV output test child finished with 0 ---- end ---- kernel lock contention analysis test: Ok Committer testing: [root@quaco ~]# uname -a Linux quaco 6.4.10-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 11 12:20:29 UTC 2023 x86_64 GNU/Linux [root@quaco ~]# perf test -v contention 84: kernel lock contention analysis test : --- start --- test child forked, pid 452625 Testing perf lock record and perf lock contention Testing perf lock contention --use-bpf Testing perf lock record and perf lock contention at the same time Testing perf lock contention --threads Testing perf lock contention --lock-addr Testing perf lock contention --lock-cgroup Testing perf lock contention --type-filter (w/ spinlock) Testing perf lock contention --lock-filter (w/ tasklist_lock) Testing perf lock contention --callstack-filter (w/ unix_stream) Testing perf lock contention --callstack-filter with task aggregation Testing perf lock contention --cgroup-filter Testing perf lock contention CSV output test child finished with 0 ---- end ---- kernel lock contention analysis test: Ok [root@quaco ~]# Reviewed-by: Ian Rogers Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Hao Luo Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230906174903.346486-6-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4fd06bd2dcc893d922985cc4e9082477f6d115e6 Author: Namhyung Kim Date: Wed Sep 6 10:49:02 2023 -0700 perf lock contention: Add -G/--cgroup-filter option The -G/--cgroup-filter is to limit lock contention collection on the tasks in the specific cgroups only. $ sudo ./perf lock con -abt -G /user.slice/.../vte-spawn-52221fb8-b33f-4a52-b5c3-e35d1e6fc0e0.scope \ ./perf bench sched messaging # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 10 groups == 400 processes run Total time: 0.174 [sec] contended total wait max wait avg wait pid comm 4 114.45 us 60.06 us 28.61 us 214847 sched-messaging 2 111.40 us 60.84 us 55.70 us 214848 sched-messaging 2 106.09 us 59.42 us 53.04 us 214837 sched-messaging 1 81.70 us 81.70 us 81.70 us 214709 sched-messaging 68 78.44 us 6.83 us 1.15 us 214633 sched-messaging 69 73.71 us 2.69 us 1.07 us 214632 sched-messaging 4 72.62 us 60.83 us 18.15 us 214850 sched-messaging 2 71.75 us 67.60 us 35.88 us 214840 sched-messaging 2 69.29 us 67.53 us 34.65 us 214804 sched-messaging 2 69.00 us 68.23 us 34.50 us 214826 sched-messaging ... Export cgroup__new() function as it's needed from outside. Reviewed-by: Ian Rogers Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Hao Luo Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230906174903.346486-5-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4d1792d0a2564caf1620a2cc9aa6f12284b3a56f Author: Namhyung Kim Date: Wed Sep 6 10:49:01 2023 -0700 perf lock contention: Add --lock-cgroup option The --lock-cgroup option shows lock contention stats break down by cgroups. Add LOCK_AGGR_CGROUP mode and use it instead of use_cgroup field. $ sudo ./perf lock con -ab --lock-cgroup sleep 1 contended total wait max wait avg wait cgroup 8 15.70 us 6.34 us 1.96 us / 2 1.48 us 747 ns 738 ns /user.slice/.../app.slice/app-gnome-google\x2dchrome-6442.scope 1 848 ns 848 ns 848 ns /user.slice/.../session.slice/org.gnome.Shell@x11.service 1 220 ns 220 ns 220 ns /user.slice/.../session.slice/pipewire-pulse.service For now, the cgroup mode only works with BPF (-b). Committer notes: Remove -g as it is used in the other tools with a clear meaning of collect/show callchains. As agreed with Namhyung off list. Reviewed-by: Ian Rogers Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Hao Luo Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230906174903.346486-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d0c502e46e9796b19e3b0fd28750cb5b679f7c4b Author: Namhyung Kim Date: Wed Sep 6 10:49:00 2023 -0700 perf lock contention: Prepare to handle cgroups Save cgroup info and display cgroup names if requested. This is a preparation for the next patch. Reviewed-by: Ian Rogers Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Hao Luo Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230906174903.346486-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2bc12abce8efb9f755bdbc14d426a0fc80ce74f4 Author: Namhyung Kim Date: Wed Sep 6 10:48:59 2023 -0700 perf tools: Add read_all_cgroups() and __cgroup_find() The read_all_cgroups() is to build a tree of cgroups in the system and users can look up a cgroup using __cgroup_find(). Committer notes: Had to do this to cover that #else block: -static inline u64 __read_cgroup_id(const char *path) { return -1ULL; } +static inline u64 __read_cgroup_id(const char *path __maybe_unused) { return -1ULL; } Reviewed-by: Ian Rogers Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Hao Luo Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230906174903.346486-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 36019dff30f7aacb8a26b2b9564fe04b097d502e Author: Yang Jihong Date: Sat Aug 12 08:49:17 2023 +0000 perf kwork top: Add BPF-based statistics on softirq event support Use BPF to collect statistics on softirq events based on perf BPF skeletons. Example usage: # perf kwork top -b Starting trace, Hit to stop and report ^C Total : 135445.704 ms, 8 cpus %Cpu(s): 28.35% id, 0.00% hi, 0.25% si %Cpu0 [|||||||||||||||||||| 69.85%] %Cpu1 [|||||||||||||||||||||| 74.10%] %Cpu2 [||||||||||||||||||||| 71.18%] %Cpu3 [|||||||||||||||||||| 69.61%] %Cpu4 [|||||||||||||||||||||| 74.05%] %Cpu5 [|||||||||||||||||||| 69.33%] %Cpu6 [|||||||||||||||||||| 69.71%] %Cpu7 [|||||||||||||||||||||| 73.77%] PID SPID %CPU RUNTIME COMMMAND ------------------------------------------------------------- 0 0 30.43 5271.005 ms [swapper/5] 0 0 30.17 5226.644 ms [swapper/3] 0 0 30.08 5210.257 ms [swapper/6] 0 0 29.89 5177.177 ms [swapper/0] 0 0 28.51 4938.672 ms [swapper/2] 0 0 25.93 4223.464 ms [swapper/7] 0 0 25.69 4181.411 ms [swapper/4] 0 0 25.63 4173.804 ms [swapper/1] 16665 16265 2.16 360.600 ms sched-messaging 16537 16265 2.05 356.275 ms sched-messaging 16503 16265 2.01 343.063 ms sched-messaging 16424 16265 1.97 336.876 ms sched-messaging 16580 16265 1.94 323.658 ms sched-messaging 16515 16265 1.92 321.616 ms sched-messaging 16659 16265 1.91 325.538 ms sched-messaging 16634 16265 1.88 327.766 ms sched-messaging 16454 16265 1.87 326.843 ms sched-messaging 16382 16265 1.87 322.591 ms sched-messaging 16642 16265 1.86 320.506 ms sched-messaging 16582 16265 1.86 320.164 ms sched-messaging 16315 16265 1.86 326.872 ms sched-messaging 16637 16265 1.85 323.766 ms sched-messaging 16506 16265 1.82 311.688 ms sched-messaging 16512 16265 1.81 304.643 ms sched-messaging 16560 16265 1.80 314.751 ms sched-messaging 16320 16265 1.80 313.405 ms sched-messaging 16442 16265 1.80 314.403 ms sched-messaging 16626 16265 1.78 295.380 ms sched-messaging 16600 16265 1.77 309.444 ms sched-messaging 16550 16265 1.76 301.161 ms sched-messaging 16525 16265 1.75 296.560 ms sched-messaging 16314 16265 1.75 298.338 ms sched-messaging 16595 16265 1.74 304.390 ms sched-messaging 16555 16265 1.74 287.564 ms sched-messaging 16520 16265 1.74 295.734 ms sched-messaging 16507 16265 1.73 293.956 ms sched-messaging 16593 16265 1.72 296.443 ms sched-messaging 16531 16265 1.72 299.950 ms sched-messaging 16281 16265 1.72 301.339 ms sched-messaging Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-17-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit d2956b3acf869336e30d903dcaf23645c82d06f6 Author: Yang Jihong Date: Sat Aug 12 08:49:16 2023 +0000 perf kwork top: Add BPF-based statistics on hardirq event support Use BPF to collect statistics on hardirq events based on perf BPF skeletons. Example usage: # perf kwork top -k sched,irq -b Starting trace, Hit to stop and report ^C Total : 136717.945 ms, 8 cpus %Cpu(s): 17.10% id, 0.01% hi, 0.00% si %Cpu0 [||||||||||||||||||||||||| 84.26%] %Cpu1 [||||||||||||||||||||||||| 84.77%] %Cpu2 [|||||||||||||||||||||||| 83.22%] %Cpu3 [|||||||||||||||||||||||| 80.37%] %Cpu4 [|||||||||||||||||||||||| 81.49%] %Cpu5 [||||||||||||||||||||||||| 84.68%] %Cpu6 [||||||||||||||||||||||||| 84.48%] %Cpu7 [|||||||||||||||||||||||| 80.21%] PID SPID %CPU RUNTIME COMMMAND ------------------------------------------------------------- 0 0 19.78 3482.833 ms [swapper/7] 0 0 19.62 3454.219 ms [swapper/3] 0 0 18.50 3258.339 ms [swapper/4] 0 0 16.76 2842.749 ms [swapper/2] 0 0 15.71 2627.905 ms [swapper/0] 0 0 15.51 2598.206 ms [swapper/6] 0 0 15.31 2561.820 ms [swapper/5] 0 0 15.22 2548.708 ms [swapper/1] 13253 13018 2.95 513.108 ms sched-messaging 13092 13018 2.67 454.167 ms sched-messaging 13401 13018 2.66 454.790 ms sched-messaging 13240 13018 2.64 454.587 ms sched-messaging 13251 13018 2.61 442.273 ms sched-messaging 13075 13018 2.61 438.932 ms sched-messaging 13220 13018 2.60 443.245 ms sched-messaging 13235 13018 2.59 443.268 ms sched-messaging 13222 13018 2.50 426.344 ms sched-messaging 13410 13018 2.49 426.191 ms sched-messaging 13228 13018 2.46 425.121 ms sched-messaging 13379 13018 2.38 409.950 ms sched-messaging 13236 13018 2.37 413.159 ms sched-messaging 13095 13018 2.36 396.572 ms sched-messaging 13325 13018 2.35 408.089 ms sched-messaging 13242 13018 2.32 394.750 ms sched-messaging 13386 13018 2.31 396.997 ms sched-messaging 13046 13018 2.29 383.833 ms sched-messaging 13109 13018 2.28 388.482 ms sched-messaging 13388 13018 2.28 393.576 ms sched-messaging 13238 13018 2.26 388.487 ms sched-messaging Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-16-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 8c98420987cda501924b7a34f2413b982517d244 Author: Yang Jihong Date: Sat Aug 12 08:49:15 2023 +0000 perf kwork top: Implements BPF-based cpu usage statistics Use BPF to collect statistics on the CPU usage based on perf BPF skeletons. Example usage: # perf kwork top -h Usage: perf kwork top [] -b, --use-bpf Use BPF to measure task cpu usage -C, --cpu list of cpus to profile -i, --input input file name -n, --name event name to profile -s, --sort sort by key(s): rate, runtime, tid --time Time span for analysis (start,stop) # # perf kwork -k sched top -b Starting trace, Hit to stop and report ^C Total : 160702.425 ms, 8 cpus %Cpu(s): 36.00% id, 0.00% hi, 0.00% si %Cpu0 [|||||||||||||||||| 61.66%] %Cpu1 [|||||||||||||||||| 61.27%] %Cpu2 [||||||||||||||||||| 66.40%] %Cpu3 [|||||||||||||||||| 61.28%] %Cpu4 [|||||||||||||||||| 61.82%] %Cpu5 [||||||||||||||||||||||| 77.41%] %Cpu6 [|||||||||||||||||| 61.73%] %Cpu7 [|||||||||||||||||| 63.25%] PID SPID %CPU RUNTIME COMMMAND ------------------------------------------------------------- 0 0 38.72 8089.463 ms [swapper/1] 0 0 38.71 8084.547 ms [swapper/3] 0 0 38.33 8007.532 ms [swapper/0] 0 0 38.26 7992.985 ms [swapper/6] 0 0 38.17 7971.865 ms [swapper/4] 0 0 36.74 7447.765 ms [swapper/7] 0 0 33.59 6486.942 ms [swapper/2] 0 0 22.58 3771.268 ms [swapper/5] 9545 9351 2.48 447.136 ms sched-messaging 9574 9351 2.09 418.583 ms sched-messaging 9724 9351 2.05 372.407 ms sched-messaging 9531 9351 2.01 368.804 ms sched-messaging 9512 9351 2.00 362.250 ms sched-messaging 9514 9351 1.95 357.767 ms sched-messaging 9538 9351 1.86 384.476 ms sched-messaging 9712 9351 1.84 386.490 ms sched-messaging 9723 9351 1.83 380.021 ms sched-messaging 9722 9351 1.82 382.738 ms sched-messaging 9517 9351 1.81 354.794 ms sched-messaging 9559 9351 1.79 344.305 ms sched-messaging 9725 9351 1.77 365.315 ms sched-messaging # perf kwork -k sched top -b -n perf Starting trace, Hit to stop and report ^C Total : 151563.332 ms, 8 cpus %Cpu(s): 26.49% id, 0.00% hi, 0.00% si %Cpu0 [ 0.01%] %Cpu1 [ 0.00%] %Cpu2 [ 0.00%] %Cpu3 [ 0.00%] %Cpu4 [ 0.00%] %Cpu5 [ 0.00%] %Cpu6 [ 0.00%] %Cpu7 [ 0.00%] PID SPID %CPU RUNTIME COMMMAND ------------------------------------------------------------- 9754 9754 0.01 2.303 ms perf # # perf kwork -k sched top -b -C 2,3,4 Starting trace, Hit to stop and report ^C Total : 48016.721 ms, 3 cpus %Cpu(s): 27.82% id, 0.00% hi, 0.00% si %Cpu2 [|||||||||||||||||||||| 74.68%] %Cpu3 [||||||||||||||||||||| 71.06%] %Cpu4 [||||||||||||||||||||| 70.91%] PID SPID %CPU RUNTIME COMMMAND ------------------------------------------------------------- 0 0 29.08 4734.998 ms [swapper/4] 0 0 28.93 4710.029 ms [swapper/3] 0 0 25.31 3912.363 ms [swapper/2] 10248 10158 1.62 264.931 ms sched-messaging 10253 10158 1.62 265.136 ms sched-messaging 10158 10158 1.60 263.013 ms bash 10360 10158 1.49 243.639 ms sched-messaging 10413 10158 1.48 238.604 ms sched-messaging 10531 10158 1.47 234.067 ms sched-messaging 10400 10158 1.47 240.631 ms sched-messaging 10355 10158 1.47 230.586 ms sched-messaging 10377 10158 1.43 234.835 ms sched-messaging 10526 10158 1.42 232.045 ms sched-messaging 10298 10158 1.41 222.396 ms sched-messaging 10410 10158 1.38 221.853 ms sched-messaging 10364 10158 1.38 226.042 ms sched-messaging 10480 10158 1.36 213.633 ms sched-messaging 10370 10158 1.36 223.620 ms sched-messaging 10553 10158 1.34 217.169 ms sched-messaging 10291 10158 1.34 211.516 ms sched-messaging 10251 10158 1.34 218.813 ms sched-messaging 10522 10158 1.33 218.498 ms sched-messaging 10288 10158 1.33 216.787 ms sched-messaging Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-15-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit aa172a5ad3159c1cc97da37253c972683681adaa Author: Yang Jihong Date: Sat Aug 12 08:49:14 2023 +0000 perf kwork top: Add -C/--cpu -i/--input -n/--name -s/--sort --time options Provide the following options for perf kwork top: 1. -C, --cpu list of cpus to profile 2. -i, --input input file name 3. -n, --name event name to profile 4. -s, --sort sort by key(s): rate, runtime, tid 5. --time Time span for analysis (start,stop) Example usage: # perf kwork top -h Usage: perf kwork top [] -C, --cpu list of cpus to profile -i, --input input file name -n, --name event name to profile -s, --sort sort by key(s): rate, runtime, tid --time Time span for analysis (start,stop) # perf kwork top -C 2,4,5 Total : 51226.940 ms, 3 cpus %Cpu(s): 92.59% id, 0.00% hi, 0.09% si %Cpu2 [| 4.61%] %Cpu4 [ 0.01%] %Cpu5 [||||| 17.31%] PID %CPU RUNTIME COMMMAND ---------------------------------------------------- 0 99.98 17073.515 ms swapper/4 0 95.17 16250.874 ms swapper/2 0 82.62 14108.577 ms swapper/5 4342 21.70 3708.358 ms perf 16 0.13 22.296 ms rcu_preempt 75 0.02 4.261 ms kworker/2:1 98 0.01 2.540 ms jbd2/sda-8 61 0.01 3.404 ms kcompactd0 87 0.00 0.145 ms kworker/5:1H 73 0.00 0.596 ms kworker/5:1 41 0.00 0.041 ms ksoftirqd/5 40 0.00 0.718 ms migration/5 64 0.00 0.115 ms kworker/4:1 35 0.00 0.556 ms migration/4 353 0.00 1.143 ms sshd 26 0.00 1.665 ms ksoftirqd/2 25 0.00 0.662 ms migration/2 # perf kwork top -i perf.data Total : 136601.588 ms, 8 cpus %Cpu(s): 95.66% id, 0.04% hi, 0.05% si %Cpu0 [ 0.02%] %Cpu1 [ 0.01%] %Cpu2 [| 4.61%] %Cpu3 [ 0.04%] %Cpu4 [ 0.01%] %Cpu5 [||||| 17.31%] %Cpu6 [ 0.51%] %Cpu7 [||| 11.42%] PID %CPU RUNTIME COMMMAND ---------------------------------------------------- 0 99.98 17073.515 ms swapper/4 0 99.98 17072.173 ms swapper/1 0 99.93 17064.229 ms swapper/3 0 99.62 17011.013 ms swapper/0 0 99.47 16985.180 ms swapper/6 0 95.17 16250.874 ms swapper/2 0 88.51 15111.684 ms swapper/7 0 82.62 14108.577 ms swapper/5 4342 33.00 5644.045 ms perf 4344 0.43 74.351 ms perf 16 0.13 22.296 ms rcu_preempt 4345 0.05 10.093 ms perf 4343 0.05 8.769 ms perf 4341 0.02 4.882 ms perf 4095 0.02 4.605 ms kworker/7:1 75 0.02 4.261 ms kworker/2:1 120 0.01 1.909 ms systemd-journal 98 0.01 2.540 ms jbd2/sda-8 61 0.01 3.404 ms kcompactd0 667 0.01 2.542 ms kworker/u16:2 4340 0.00 1.052 ms kworker/7:2 97 0.00 0.489 ms kworker/7:1H 51 0.00 0.209 ms ksoftirqd/7 50 0.00 0.646 ms migration/7 76 0.00 0.753 ms kworker/6:1 45 0.00 0.572 ms migration/6 87 0.00 0.145 ms kworker/5:1H 73 0.00 0.596 ms kworker/5:1 41 0.00 0.041 ms ksoftirqd/5 40 0.00 0.718 ms migration/5 64 0.00 0.115 ms kworker/4:1 35 0.00 0.556 ms migration/4 353 0.00 2.600 ms sshd 74 0.00 0.205 ms kworker/3:1 33 0.00 1.576 ms kworker/3:0H 30 0.00 0.996 ms migration/3 26 0.00 1.665 ms ksoftirqd/2 25 0.00 0.662 ms migration/2 397 0.00 0.057 ms kworker/1:1 20 0.00 1.005 ms migration/1 2909 0.00 1.053 ms kworker/0:2 17 0.00 0.720 ms migration/0 15 0.00 0.039 ms ksoftirqd/0 # perf kwork top -n perf Total : 136601.588 ms, 8 cpus %Cpu(s): 95.66% id, 0.04% hi, 0.05% si %Cpu0 [ 0.01%] %Cpu1 [ 0.00%] %Cpu2 [| 4.44%] %Cpu3 [ 0.00%] %Cpu4 [ 0.00%] %Cpu5 [ 0.00%] %Cpu6 [ 0.49%] %Cpu7 [||| 11.38%] PID %CPU RUNTIME COMMMAND ---------------------------------------------------- 4342 15.74 2695.516 ms perf 4344 0.43 74.351 ms perf 4345 0.05 10.093 ms perf 4343 0.05 8.769 ms perf 4341 0.02 4.882 ms perf # perf kwork top -s tid Total : 136601.588 ms, 8 cpus %Cpu(s): 95.66% id, 0.04% hi, 0.05% si %Cpu0 [ 0.02%] %Cpu1 [ 0.01%] %Cpu2 [| 4.61%] %Cpu3 [ 0.04%] %Cpu4 [ 0.01%] %Cpu5 [||||| 17.31%] %Cpu6 [ 0.51%] %Cpu7 [||| 11.42%] PID %CPU RUNTIME COMMMAND ---------------------------------------------------- 0 99.62 17011.013 ms swapper/0 0 99.98 17072.173 ms swapper/1 0 95.17 16250.874 ms swapper/2 0 99.93 17064.229 ms swapper/3 0 99.98 17073.515 ms swapper/4 0 82.62 14108.577 ms swapper/5 0 99.47 16985.180 ms swapper/6 0 88.51 15111.684 ms swapper/7 15 0.00 0.039 ms ksoftirqd/0 16 0.13 22.296 ms rcu_preempt 17 0.00 0.720 ms migration/0 20 0.00 1.005 ms migration/1 25 0.00 0.662 ms migration/2 26 0.00 1.665 ms ksoftirqd/2 30 0.00 0.996 ms migration/3 33 0.00 1.576 ms kworker/3:0H 35 0.00 0.556 ms migration/4 40 0.00 0.718 ms migration/5 41 0.00 0.041 ms ksoftirqd/5 45 0.00 0.572 ms migration/6 50 0.00 0.646 ms migration/7 51 0.00 0.209 ms ksoftirqd/7 61 0.01 3.404 ms kcompactd0 64 0.00 0.115 ms kworker/4:1 73 0.00 0.596 ms kworker/5:1 74 0.00 0.205 ms kworker/3:1 75 0.02 4.261 ms kworker/2:1 76 0.00 0.753 ms kworker/6:1 87 0.00 0.145 ms kworker/5:1H 97 0.00 0.489 ms kworker/7:1H 98 0.01 2.540 ms jbd2/sda-8 120 0.01 1.909 ms systemd-journal 353 0.00 2.600 ms sshd 397 0.00 0.057 ms kworker/1:1 667 0.01 2.542 ms kworker/u16:2 2909 0.00 1.053 ms kworker/0:2 4095 0.02 4.605 ms kworker/7:1 4340 0.00 1.052 ms kworker/7:2 4341 0.02 4.882 ms perf 4342 33.00 5644.045 ms perf 4343 0.05 8.769 ms perf 4344 0.43 74.351 ms perf 4345 0.05 10.093 ms perf # perf kwork top --time 128800, Total : 53495.122 ms, 8 cpus %Cpu(s): 94.71% id, 0.09% hi, 0.09% si %Cpu0 [ 0.07%] %Cpu1 [ 0.04%] %Cpu2 [|| 8.49%] %Cpu3 [ 0.09%] %Cpu4 [ 0.02%] %Cpu5 [ 0.06%] %Cpu6 [ 0.12%] %Cpu7 [|||||| 21.24%] PID %CPU RUNTIME COMMMAND ---------------------------------------------------- 0 99.96 3981.363 ms swapper/4 0 99.94 3978.955 ms swapper/1 0 99.91 9329.375 ms swapper/5 0 99.87 4906.829 ms swapper/3 0 99.86 9028.064 ms swapper/6 0 98.67 3928.161 ms swapper/0 0 91.17 8388.432 ms swapper/2 0 78.65 7125.602 ms swapper/7 4342 29.42 2675.198 ms perf 16 0.18 16.817 ms rcu_preempt 4345 0.09 8.183 ms perf 4344 0.04 4.290 ms perf 4343 0.03 2.844 ms perf 353 0.03 2.600 ms sshd 4095 0.02 2.702 ms kworker/7:1 120 0.02 1.909 ms systemd-journal 98 0.02 2.540 ms jbd2/sda-8 61 0.02 1.886 ms kcompactd0 667 0.02 1.011 ms kworker/u16:2 75 0.02 2.693 ms kworker/2:1 4341 0.01 1.838 ms perf 30 0.01 0.788 ms migration/3 26 0.01 1.665 ms ksoftirqd/2 20 0.01 0.752 ms migration/1 2909 0.01 0.604 ms kworker/0:2 4340 0.00 0.635 ms kworker/7:2 97 0.00 0.214 ms kworker/7:1H 51 0.00 0.209 ms ksoftirqd/7 50 0.00 0.646 ms migration/7 76 0.00 0.602 ms kworker/6:1 45 0.00 0.366 ms migration/6 87 0.00 0.145 ms kworker/5:1H 40 0.00 0.446 ms migration/5 35 0.00 0.318 ms migration/4 74 0.00 0.205 ms kworker/3:1 33 0.00 0.080 ms kworker/3:0H 25 0.00 0.448 ms migration/2 397 0.00 0.057 ms kworker/1:1 17 0.00 0.365 ms migration/0 Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-14-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit e29090d28cc1ac1479a062e07260fdd7aa56f057 Author: Yang Jihong Date: Sat Aug 12 08:49:13 2023 +0000 perf kwork top: Add statistics on softirq event support Calculate the runtime of the softirq events and subtract it from the corresponding task runtime to improve the precision. Example usage: # perf kwork -k sched,irq,softirq record -- perf record -e cpu-clock -o perf_record.data -a sleep 10 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.467 MB perf_record.data (7154 samples) ] [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 2.152 MB perf.data (22846 samples) ] # perf kwork top Total : 136601.588 ms, 8 cpus %Cpu(s): 95.66% id, 0.04% hi, 0.05% si %Cpu0 [ 0.02%] %Cpu1 [ 0.01%] %Cpu2 [| 4.61%] %Cpu3 [ 0.04%] %Cpu4 [ 0.01%] %Cpu5 [||||| 17.31%] %Cpu6 [ 0.51%] %Cpu7 [||| 11.42%] PID %CPU RUNTIME COMMMAND ---------------------------------------------------- 0 99.98 17073.515 ms swapper/4 0 99.98 17072.173 ms swapper/1 0 99.93 17064.229 ms swapper/3 0 99.62 17011.013 ms swapper/0 0 99.47 16985.180 ms swapper/6 0 95.17 16250.874 ms swapper/2 0 88.51 15111.684 ms swapper/7 0 82.62 14108.577 ms swapper/5 4342 33.00 5644.045 ms perf 4344 0.43 74.351 ms perf 16 0.13 22.296 ms rcu_preempt 4345 0.05 10.093 ms perf 4343 0.05 8.769 ms perf 4341 0.02 4.882 ms perf 4095 0.02 4.605 ms kworker/7:1 75 0.02 4.261 ms kworker/2:1 120 0.01 1.909 ms systemd-journal 98 0.01 2.540 ms jbd2/sda-8 61 0.01 3.404 ms kcompactd0 667 0.01 2.542 ms kworker/u16:2 4340 0.00 1.052 ms kworker/7:2 97 0.00 0.489 ms kworker/7:1H 51 0.00 0.209 ms ksoftirqd/7 50 0.00 0.646 ms migration/7 76 0.00 0.753 ms kworker/6:1 45 0.00 0.572 ms migration/6 87 0.00 0.145 ms kworker/5:1H 73 0.00 0.596 ms kworker/5:1 41 0.00 0.041 ms ksoftirqd/5 40 0.00 0.718 ms migration/5 64 0.00 0.115 ms kworker/4:1 35 0.00 0.556 ms migration/4 353 0.00 2.600 ms sshd 74 0.00 0.205 ms kworker/3:1 33 0.00 1.576 ms kworker/3:0H 30 0.00 0.996 ms migration/3 26 0.00 1.665 ms ksoftirqd/2 25 0.00 0.662 ms migration/2 397 0.00 0.057 ms kworker/1:1 20 0.00 1.005 ms migration/1 2909 0.00 1.053 ms kworker/0:2 17 0.00 0.720 ms migration/0 15 0.00 0.039 ms ksoftirqd/0 Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-13-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 2f21f5e4b48d910cbbe234264527b23b7cfc49f2 Author: Yang Jihong Date: Sat Aug 12 08:49:12 2023 +0000 perf kwork top: Add statistics on hardirq event support Calculate the runtime of the hardirq events and subtract it from the corresponding task runtime to improve the precision. Example usage: # perf kwork -k sched,irq record -- perf record -o perf_record.data -a sleep 10 [ perf record: Woken up 2 times to write data ] [ perf record: Captured and wrote 1.054 MB perf_record.data (18019 samples) ] [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 1.798 MB perf.data (16334 samples) ] # # perf kwork top Total : 139240.869 ms, 8 cpus %Cpu(s): 94.91% id, 0.05% hi %Cpu0 [ 0.05%] %Cpu1 [| 5.00%] %Cpu2 [ 0.43%] %Cpu3 [ 0.57%] %Cpu4 [ 1.19%] %Cpu5 [|||||| 20.46%] %Cpu6 [ 0.48%] %Cpu7 [||| 12.10%] PID %CPU RUNTIME COMMMAND ---------------------------------------------------- 0 99.54 17325.622 ms swapper/2 0 99.54 17327.527 ms swapper/0 0 99.51 17319.909 ms swapper/6 0 99.42 17304.934 ms swapper/3 0 98.80 17197.385 ms swapper/4 0 94.99 16534.991 ms swapper/1 0 87.89 15295.264 ms swapper/7 0 79.53 13843.182 ms swapper/5 4252 36.50 6361.768 ms perf 4256 1.17 205.215 ms bash 151 0.53 93.298 ms systemd-resolve 4254 0.39 69.468 ms perf 423 0.34 59.368 ms bash 412 0.29 51.204 ms sshd 249 0.20 35.288 ms sd-resolve 16 0.17 30.287 ms rcu_preempt 153 0.09 17.266 ms systemd-timesyn 1 0.09 17.078 ms systemd 4253 0.07 12.457 ms perf 4255 0.06 11.559 ms perf 4234 0.03 6.105 ms kworker/u16:1 69 0.03 6.259 ms kworker/1:1H 4251 0.02 4.615 ms perf 4095 0.02 4.890 ms kworker/7:1 61 0.02 4.005 ms kcompactd0 75 0.02 3.546 ms kworker/2:1 97 0.01 3.106 ms kworker/7:1H 98 0.01 1.995 ms jbd2/sda-8 4088 0.01 1.779 ms kworker/u16:3 2909 0.01 1.795 ms kworker/0:2 4246 0.00 1.117 ms kworker/7:2 51 0.00 0.327 ms ksoftirqd/7 50 0.00 0.369 ms migration/7 102 0.00 0.160 ms kworker/6:1H 76 0.00 0.609 ms kworker/6:1 45 0.00 0.779 ms migration/6 87 0.00 0.504 ms kworker/5:1H 73 0.00 1.130 ms kworker/5:1 41 0.00 0.152 ms ksoftirqd/5 40 0.00 0.702 ms migration/5 64 0.00 0.316 ms kworker/4:1 35 0.00 0.791 ms migration/4 353 0.00 2.211 ms sshd 74 0.00 0.272 ms kworker/3:1 30 0.00 0.819 ms migration/3 25 0.00 0.784 ms migration/2 397 0.00 0.539 ms kworker/1:1 21 0.00 1.600 ms ksoftirqd/1 20 0.00 0.773 ms migration/1 17 0.00 1.682 ms migration/0 15 0.00 0.076 ms ksoftirqd/0 Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-12-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit a8792242e4f2915a85bfa2d21a0ee2d9043de996 Author: Yang Jihong Date: Sat Aug 12 08:49:11 2023 +0000 perf evsel: Add evsel__intval_common() helper Add evsel__intval_common() helper to search for common_field in tracepoint format. Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-11-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 55c40e505234588d049384aa45a6931438c3028d Author: Yang Jihong Date: Sat Aug 12 08:49:10 2023 +0000 perf kwork top: Introduce new top utility Some common tools for collecting statistics on CPU usage, such as top, obtain statistics from timer interrupt sampling, and then periodically read statistics from /proc/stat. This method has some deviations: 1. In the tick interrupt, the time between the last tick and the current tick is counted in the current task. However, the task may be running only part of the time. 2. For each task, the top tool periodically reads the /proc/{PID}/status information. For tasks with a short life cycle, it may be missed. In conclusion, the top tool cannot accurately collect statistics on the CPU usage and running time of tasks. The statistical method based on sched_switch tracepoint can accurately calculate the CPU usage of all tasks. This method is applicable to scenarios where performance comparison data is of high precision. Example usage: # perf kwork Usage: perf kwork [] {record|report|latency|timehist|top} -D, --dump-raw-trace dump raw trace in ASCII -f, --force don't complain, do it -k, --kwork list of kwork to profile (irq, softirq, workqueue, sched, etc) -v, --verbose be more verbose (show symbol address, etc) # perf kwork -k sched record -- perf bench sched messaging -g 1 -l 10000 # Running 'sched/messaging' benchmark: # 20 sender and receiver processes per group # 1 groups == 40 processes run Total time: 14.074 [sec] [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 15.886 MB perf.data (129472 samples) ] # perf kwork top Total : 115708.178 ms, 8 cpus %Cpu(s): 9.78% id %Cpu0 [||||||||||||||||||||||||||| 90.55%] %Cpu1 [||||||||||||||||||||||||||| 90.51%] %Cpu2 [|||||||||||||||||||||||||| 88.57%] %Cpu3 [||||||||||||||||||||||||||| 91.18%] %Cpu4 [||||||||||||||||||||||||||| 91.09%] %Cpu5 [||||||||||||||||||||||||||| 90.88%] %Cpu6 [|||||||||||||||||||||||||| 88.64%] %Cpu7 [||||||||||||||||||||||||||| 90.28%] PID %CPU RUNTIME COMMMAND ---------------------------------------------------- 4113 22.23 3221.547 ms sched-messaging 4105 21.61 3131.495 ms sched-messaging 4119 21.53 3120.937 ms sched-messaging 4103 21.39 3101.614 ms sched-messaging 4106 21.37 3095.209 ms sched-messaging 4104 21.25 3077.269 ms sched-messaging 4115 21.21 3073.188 ms sched-messaging 4109 21.18 3069.022 ms sched-messaging 4111 20.78 3010.033 ms sched-messaging 4114 20.74 3007.073 ms sched-messaging 4108 20.73 3002.137 ms sched-messaging 4107 20.47 2967.292 ms sched-messaging 4117 20.39 2955.335 ms sched-messaging 4112 20.34 2947.080 ms sched-messaging 4118 20.32 2942.519 ms sched-messaging 4121 20.23 2929.865 ms sched-messaging 4110 20.22 2930.078 ms sched-messaging 4122 20.15 2919.542 ms sched-messaging 4120 19.77 2866.032 ms sched-messaging 4116 19.72 2857.660 ms sched-messaging 4127 16.19 2346.334 ms sched-messaging 4142 15.86 2297.600 ms sched-messaging 4141 15.62 2262.646 ms sched-messaging 4136 15.41 2231.408 ms sched-messaging 4130 15.38 2227.008 ms sched-messaging 4129 15.31 2217.692 ms sched-messaging 4126 15.21 2201.711 ms sched-messaging 4139 15.19 2200.722 ms sched-messaging 4137 15.10 2188.633 ms sched-messaging 4134 15.06 2182.082 ms sched-messaging 4132 15.02 2177.530 ms sched-messaging 4131 14.73 2131.973 ms sched-messaging 4125 14.68 2125.439 ms sched-messaging 4128 14.66 2122.255 ms sched-messaging 4123 14.65 2122.113 ms sched-messaging 4135 14.56 2107.144 ms sched-messaging 4133 14.51 2103.549 ms sched-messaging 4124 14.27 2066.671 ms sched-messaging 4140 14.17 2052.251 ms sched-messaging 4138 13.81 2000.361 ms sched-messaging 0 11.42 1652.009 ms swapper/2 0 11.35 1641.694 ms swapper/6 0 9.71 1405.108 ms swapper/7 0 9.48 1372.338 ms swapper/1 0 9.44 1366.013 ms swapper/0 0 9.11 1318.382 ms swapper/5 0 8.90 1287.582 ms swapper/4 0 8.81 1274.356 ms swapper/3 4100 2.61 379.328 ms perf 4101 1.16 169.487 ms perf-exec 151 0.65 94.741 ms systemd-resolve 249 0.36 53.030 ms sd-resolve 153 0.14 21.405 ms systemd-timesyn 1 0.10 16.200 ms systemd 16 0.09 15.785 ms rcu_preempt 4102 0.06 9.727 ms perf 4095 0.03 5.464 ms kworker/7:1 98 0.02 3.231 ms jbd2/sda-8 353 0.02 4.115 ms sshd 75 0.02 3.889 ms kworker/2:1 73 0.01 1.552 ms kworker/5:1 64 0.01 1.591 ms kworker/4:1 74 0.01 1.952 ms kworker/3:1 61 0.01 2.608 ms kcompactd0 397 0.01 1.602 ms kworker/1:1 69 0.01 1.817 ms kworker/1:1H 10 0.01 2.553 ms kworker/u16:0 2909 0.01 2.684 ms kworker/0:2 1211 0.00 0.426 ms kworker/7:0 97 0.00 0.153 ms kworker/7:1H 51 0.00 0.100 ms ksoftirqd/7 120 0.00 0.856 ms systemd-journal 76 0.00 1.414 ms kworker/6:1 46 0.00 0.246 ms ksoftirqd/6 45 0.00 0.164 ms migration/6 41 0.00 0.098 ms ksoftirqd/5 40 0.00 0.207 ms migration/5 86 0.00 1.339 ms kworker/4:1H 36 0.00 0.252 ms ksoftirqd/4 35 0.00 0.090 ms migration/4 31 0.00 0.156 ms ksoftirqd/3 30 0.00 0.073 ms migration/3 26 0.00 0.180 ms ksoftirqd/2 25 0.00 0.085 ms migration/2 21 0.00 0.106 ms ksoftirqd/1 20 0.00 0.118 ms migration/1 302 0.00 1.440 ms systemd-logind 17 0.00 0.132 ms migration/0 15 0.00 0.255 ms ksoftirqd/0 Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-10-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit b83b5071c018c74e53833d2fe7011d6ce583957d Author: Yang Jihong Date: Sat Aug 12 08:49:09 2023 +0000 perf kwork: Add `root` parameter to work_sort() Add a `struct rb_root_cached *root` parameter to work_sort() to sort the specified rb tree elements. No functional change. Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-9-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 38d8d013a525daf4f98a2b53065d8e89d5f810dd Author: Yang Jihong Date: Sat Aug 12 08:49:08 2023 +0000 perf kwork: Add sched record support The kwork_class type of sched is added to support recording and parsing of sched_switch events. As follows: # perf kwork -h Usage: perf kwork [] {record|report|latency|timehist} -D, --dump-raw-trace dump raw trace in ASCII -f, --force don't complain, do it -k, --kwork list of kwork to profile (irq, softirq, workqueue, sched, etc) -v, --verbose be more verbose (show symbol address, etc) # perf kwork -k sched record true [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.083 MB perf.data (47 samples) ] # perf evlist sched:sched_switch dummy:HG # Tip: use 'perf evlist --trace-fields' to show fields for tracepoint events Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-8-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 26b7254ff100fdc9f06eb8f5e2cd7424605fce2b Author: Yang Jihong Date: Sat Aug 12 08:49:07 2023 +0000 perf kwork: Set default events list if not specified in setup_event_list() Currently when no kwork event is specified, all events are configured by default. Now set to default event list string, which is more flexible and supports subsequent function extension. Also put setup_event_list() into each subcommand for different settings. Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-7-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 86c67c8af4bec82962ff711551e7f4d21f340fef Author: Yang Jihong Date: Sat Aug 12 08:49:06 2023 +0000 perf kwork: Overwrite original atom in the list when a new atom is pushed. work_push_atom() supports nesting. Currently, all supported kworks are not nested. A `overwrite` parameter is added to overwrite the original atom in the list. Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-6-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 95064b3352250a199323b8161eb08aee428a8286 Author: Yang Jihong Date: Sat Aug 12 08:49:05 2023 +0000 perf kwork: Add `kwork` and `src_type` to work_init() for 'struct kwork_class' To support different types of reports, two parameters `struct perf_kwork * kwork` and `enum kwork_trace_type src_type` are added to work_init() of struct kwork_class for initialization in different scenarios. No functional change intended. Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-5-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 0c526579a4b2b6ecd540472f2e34c2850cf70f76 Author: Yang Jihong Date: Sat Aug 12 08:49:04 2023 +0000 perf kwork: Set ordered_events to true in 'struct perf_tool' 'perf kwork' processes data based on timestamps and needs to sort events. Fixes: f98919ec4fccdacf ("perf kwork: Implement 'report' subcommand") Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Cc: Yang Jihong Link: https://lore.kernel.org/r/20230812084917.169338-4-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 76e0d8c821bbd952730799cc7af841f9de67b7f7 Author: Yang Jihong Date: Sat Aug 12 08:49:03 2023 +0000 perf kwork: Add the supported subcommands to the document Add missing report, latency and timehist subcommands to the document. Fixes: f98919ec4fccdacf ("perf kwork: Implement 'report' subcommand") Fixes: ad3d9f7a929ab2df ("perf kwork: Implement perf kwork latency") Fixes: bcc8b3e88d6fa1a3 ("perf kwork: Implement perf kwork timehist") Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Link: https://lore.kernel.org/r/20230812084917.169338-3-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit d39710088d82ef100b33cdf4a9de3546fb0bb5df Author: Yang Jihong Date: Sat Aug 12 08:49:02 2023 +0000 perf kwork: Fix incorrect and missing free atom in work_push_atom() 1. Atoms are managed in page mode and should be released using atom_free() instead of free(). 2. When the event does not match, the atom needs to free. Fixes: f98919ec4fccdacf ("perf kwork: Implement 'report' subcommand") Reviewed-by: Ian Rogers Signed-off-by: Yang Jihong Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Sandipan Das Cc: Yang Jihong Link: https://lore.kernel.org/r/20230812084917.169338-2-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit d50ad02cb39a5fe1d0c02b3b51e8a2a37464c54a Author: Yang Jihong Date: Mon Sep 4 02:33:40 2023 +0000 perf test: Add perf_event_attr test for record dummy event If only dummy event is recorded, tracking event is not needed. Add this test scenario. Test result: # ./perf test list 2>&1 | grep 'Setup struct perf_event_attr' 17: Setup struct perf_event_attr # ./perf test 17 -v 17: Setup struct perf_event_attr : --- start --- test child forked, pid 720198 running './tests/attr/test-record-dummy-C0' test child finished with 0 ---- end ---- Setup struct perf_event_attr: Ok Signed-off-by: Yang Jihong Tested-by: Ravi Bangoria Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anshuman Khandual Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Link: https://lore.kernel.org/r/20230904023340.12707-7-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 23b97c7ee963f1d007c035e76ba7e3a4fd1259e6 Author: Yang Jihong Date: Mon Sep 4 02:33:39 2023 +0000 perf test: Add test case for record sideband events Add a new test case to record sideband events for all CPUs when tracing selected CPUs Test result: # ./perf test list 2>&1 | grep 'perf record sideband tests' 95: perf record sideband tests # ./perf test 95 95: perf record sideband tests : Ok Signed-off-by: Yang Jihong Tested-by: Ravi Bangoria Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anshuman Khandual Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Link: https://lore.kernel.org/r/20230904023340.12707-6-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 74b4f3ecdf64b62446abfb36669b3d40a42d34eb Author: Yang Jihong Date: Mon Sep 4 02:33:38 2023 +0000 perf record: Track sideband events for all CPUs when tracing selected CPUs User space tasks can migrate between CPUs, we need to track side-band events for all CPUs. The specific scenarios are as follows: CPU0 CPU1 perf record -C 0 start taskA starts to be created and executed -> PERF_RECORD_COMM and PERF_RECORD_MMAP events only deliver to CPU1 ...... | migrate to CPU0 | Running on CPU0 <----------/ ... perf record -C 0 stop Now perf samples the PC of taskA. However, perf does not record the PERF_RECORD_COMM and PERF_RECORD_MMAP events of taskA. Therefore, the comm and symbols of taskA cannot be parsed. The solution is to record sideband events for all CPUs when tracing selected CPUs. Because this modifies the default behavior, add related comments to the perf record man page. The sys_perf_event_open invoked is as follows: # perf --debug verbose=3 record -e cpu-clock -C 1 true Opening: cpu-clock ------------------------------------------------------------ perf_event_attr: type 1 (PERF_TYPE_SOFTWARE) size 136 config 0 (PERF_COUNT_SW_CPU_CLOCK) { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|CPU|PERIOD|IDENTIFIER read_format ID|LOST disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 1 group_fd -1 flags 0x8 = 5 Opening: dummy:u ------------------------------------------------------------ perf_event_attr: type 1 (PERF_TYPE_SOFTWARE) size 136 config 0x9 (PERF_COUNT_SW_DUMMY) { sample_period, sample_freq } 1 sample_type IP|TID|TIME|CPU|IDENTIFIER read_format ID|LOST inherit 1 exclude_kernel 1 exclude_hv 1 mmap 1 comm 1 task 1 sample_id_all 1 exclude_guest 1 mmap2 1 comm_exec 1 ksymbol 1 bpf_event 1 ------------------------------------------------------------ sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8 = 6 sys_perf_event_open: pid -1 cpu 1 group_fd -1 flags 0x8 = 7 sys_perf_event_open: pid -1 cpu 2 group_fd -1 flags 0x8 = 9 sys_perf_event_open: pid -1 cpu 3 group_fd -1 flags 0x8 = 10 sys_perf_event_open: pid -1 cpu 4 group_fd -1 flags 0x8 = 11 sys_perf_event_open: pid -1 cpu 5 group_fd -1 flags 0x8 = 12 sys_perf_event_open: pid -1 cpu 6 group_fd -1 flags 0x8 = 13 sys_perf_event_open: pid -1 cpu 7 group_fd -1 flags 0x8 = 14 Signed-off-by: Yang Jihong Tested-by: Ravi Bangoria Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anshuman Khandual Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Link: https://lore.kernel.org/r/20230904023340.12707-5-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 1285ab300d598ead593b190af65a16f4b0843c68 Author: Yang Jihong Date: Mon Sep 4 02:33:37 2023 +0000 perf record: Move setting tracking events before record__init_thread_masks() User space tasks can migrate between CPUs, so when tracing selected CPUs, sideband for all CPUs is needed. In this case set the cpu map of the evsel to all online CPUs. This may modify the original cpu map of the evlist. Therefore, need to check whether the preceding scenario exists before record__init_thread_masks(). Dummy tracking has been set in record__open(), move it before record__init_thread_masks() and add a helper for unified processing. The sys_perf_event_open invoked is as follows: # perf --debug verbose=3 record -e cpu-clock -D 100 true Opening: cpu-clock ------------------------------------------------------------ perf_event_attr: type 1 (PERF_TYPE_SOFTWARE) size 136 config 0 (PERF_COUNT_SW_CPU_CLOCK) { sample_period, sample_freq } 4000 sample_type IP|TID|TIME|PERIOD|IDENTIFIER read_format ID|LOST disabled 1 inherit 1 freq 1 sample_id_all 1 exclude_guest 1 ------------------------------------------------------------ sys_perf_event_open: pid 10318 cpu 0 group_fd -1 flags 0x8 = 5 sys_perf_event_open: pid 10318 cpu 1 group_fd -1 flags 0x8 = 6 sys_perf_event_open: pid 10318 cpu 2 group_fd -1 flags 0x8 = 7 sys_perf_event_open: pid 10318 cpu 3 group_fd -1 flags 0x8 = 9 sys_perf_event_open: pid 10318 cpu 4 group_fd -1 flags 0x8 = 10 sys_perf_event_open: pid 10318 cpu 5 group_fd -1 flags 0x8 = 11 sys_perf_event_open: pid 10318 cpu 6 group_fd -1 flags 0x8 = 12 sys_perf_event_open: pid 10318 cpu 7 group_fd -1 flags 0x8 = 13 Opening: dummy:u ------------------------------------------------------------ perf_event_attr: type 1 (PERF_TYPE_SOFTWARE) size 136 config 0x9 (PERF_COUNT_SW_DUMMY) { sample_period, sample_freq } 1 sample_type IP|TID|TIME|IDENTIFIER read_format ID|LOST disabled 1 inherit 1 exclude_kernel 1 exclude_hv 1 mmap 1 comm 1 enable_on_exec 1 task 1 sample_id_all 1 exclude_guest 1 mmap2 1 comm_exec 1 ksymbol 1 bpf_event 1 ------------------------------------------------------------ sys_perf_event_open: pid 10318 cpu 0 group_fd -1 flags 0x8 = 14 sys_perf_event_open: pid 10318 cpu 1 group_fd -1 flags 0x8 = 15 sys_perf_event_open: pid 10318 cpu 2 group_fd -1 flags 0x8 = 16 sys_perf_event_open: pid 10318 cpu 3 group_fd -1 flags 0x8 = 17 sys_perf_event_open: pid 10318 cpu 4 group_fd -1 flags 0x8 = 18 sys_perf_event_open: pid 10318 cpu 5 group_fd -1 flags 0x8 = 19 sys_perf_event_open: pid 10318 cpu 6 group_fd -1 flags 0x8 = 20 sys_perf_event_open: pid 10318 cpu 7 group_fd -1 flags 0x8 = 21 'perf test' needs to update base-record & system-wide-dummy attr expected values for test-record-C0: 1. Because a dummy sideband event is added to the sampling of specified CPUs. When evlist contains evsel of different sample_type, evlist__config() will change the default PERF_SAMPLE_ID bit to PERF_SAMPLE_IDENTIFICATION bit. The attr sample_type expected value of base-record and system-wide-dummy in test-record-C0 needs to be updated. 2. The perf record uses evlist__add_aux_dummy() instead of evlist__add_dummy() to add a dummy event. The expected value of system-wide-dummy attr needs to be updated. The 'perf test' result is as follows: # ./perf test list 2>&1 | grep 'Setup struct perf_event_attr' 17: Setup struct perf_event_attr # ./perf test 17 17: Setup struct perf_event_attr : Ok Signed-off-by: Yang Jihong Acked-by: Adrian Hunter Tested-by: Ravi Bangoria Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anshuman Khandual Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Link: https://lore.kernel.org/r/20230904023340.12707-4-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 9c95e4ef065723496442898614d09a9a916eab81 Author: Yang Jihong Date: Mon Sep 4 02:33:36 2023 +0000 perf evlist: Add evlist__findnew_tracking_event() helper Currently, intel-bts, intel-pt, and arm-spe may add tracking event to the evlist. We may need to search for the tracking event for some settings. Therefore, add evlist__findnew_tracking_event() helper. If system_wide is true, evlist__findnew_tracking_event() set the cpu map of the evsel to all online CPUs. Signed-off-by: Yang Jihong Acked-by: Adrian Hunter Tested-by: Ravi Bangoria Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anshuman Khandual Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Link: https://lore.kernel.org/r/20230904023340.12707-3-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit f6ff1c760431be34e4daaa44f242be911becd998 Author: Yang Jihong Date: Mon Sep 4 02:33:35 2023 +0000 perf evlist: Add perf_evlist__go_system_wide() helper For dummy events that keep tracking, we may need to modify its cpu_maps. For example, change the cpu_maps to record sideband events for all CPUS. Add perf_evlist__go_system_wide() helper to support this scenario. Signed-off-by: Yang Jihong Acked-by: Adrian Hunter Tested-by: Ravi Bangoria Cc: Alexander Shishkin Cc: Andi Kleen Cc: Anshuman Khandual Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Link: https://lore.kernel.org/r/20230904023340.12707-2-yangjihong1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 86a0adc029d338f0da8989e7bb453c1114d51960 Author: Benjamin Gray Date: Tue Sep 12 16:07:56 2023 +1000 Documentation/sphinx: fix Python string escapes Python 3.6 introduced a DeprecationWarning for invalid escape sequences. This is upgraded to a SyntaxWarning in Python 3.12, and will eventually be a syntax error. Fix these now to get ahead of it before it's an error. Signed-off-by: Benjamin Gray Message-ID: <20230912060801.95533-3-bgray@linux.ibm.com> Signed-off-by: Jonathan Corbet commit ef2730fb8122ff90747ee79261c2a9fd35032e17 Author: Biju Das Date: Sat Sep 2 21:05:17 2023 +0100 power: supply: bq2515x: Simpilfy bq2515x_read_properties() and probe() Add struct bq2515x_info and replace device_id->info in struct bq2515x_device. Simpilfy bq2515x_read_properties() and probe() by adding struct bq2425x_chip_info as match data for OF/ID tables and use i2c_get_match_data for retrieving match data instead of ID lookup. Drop enum bq2515x_id as there is no user. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230902200518.91585-2-biju.das.jz@bp.renesas.com Signed-off-by: Sebastian Reichel commit 97f576eb38ae219a6fb337d13586d8acbf01d3f8 Author: Kees Cook Date: Thu Aug 17 13:35:02 2023 -0700 audit: Annotate struct audit_chunk with __counted_by Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct audit_chunk. [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci Cc: Paul Moore Cc: Eric Paris Cc: audit@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Gustavo A. R. Silva" Signed-off-by: Paul Moore commit 5bbb9e1f08352a381a6e8a17b5180170b2a93685 Merge: 96daa9874211d e13b5f2f3ba3d Author: Alexei Starovoitov Date: Tue Sep 12 13:06:12 2023 -0700 Merge branch 'bpf-x64-fix-tailcall-infinite-loop' Leon Hwang says: ==================== bpf, x64: Fix tailcall infinite loop This patch series fixes a tailcall infinite loop on x64. From commit ebf7d1f508a73871 ("bpf, x64: rework pro/epilogue and tailcall handling in JIT"), the tailcall on x64 works better than before. From commit e411901c0b775a3a ("bpf: allow for tailcalls in BPF subprograms for x64 JIT"), tailcall is able to run in BPF subprograms on x64. From commit 5b92a28aae4dd0f8 ("bpf: Support attaching tracing BPF program to other BPF programs"), BPF program is able to trace other BPF programs. How about combining them all together? 1. FENTRY/FEXIT on a BPF subprogram. 2. A tailcall runs in the BPF subprogram. 3. The tailcall calls the subprogram's caller. As a result, a tailcall infinite loop comes up. And the loop would halt the machine. As we know, in tail call context, the tail_call_cnt propagates by stack and rax register between BPF subprograms. So do in trampolines. How did I discover the bug? From commit 7f6e4312e15a5c37 ("bpf: Limit caller's stack depth 256 for subprogs with tailcalls"), the total stack size limits to around 8KiB. Then, I write some bpf progs to validate the stack consuming, that are tailcalls running in bpf2bpf and FENTRY/FEXIT tracing on bpf2bpf. At that time, accidently, I made a tailcall loop. And then the loop halted my VM. Without the loop, the bpf progs would consume over 8KiB stack size. But the _stack-overflow_ did not halt my VM. With bpf_printk(), I confirmed that the tailcall count limit did not work expectedly. Next, read the code and fix it. Thank Ilya Leoshkevich, this bug on s390x has been fixed. Hopefully, this bug on arm64 will be fixed in near future. ==================== Link: https://lore.kernel.org/r/20230912150442.2009-1-hffilwlqm@gmail.com Signed-off-by: Alexei Starovoitov commit e13b5f2f3ba3df1ca31824d2fdbd182250fa10c7 Author: Leon Hwang Date: Tue Sep 12 23:04:42 2023 +0800 selftests/bpf: Add testcases for tailcall infinite loop fixing Add 4 test cases to confirm the tailcall infinite loop bug has been fixed. Like tailcall_bpf2bpf cases, do fentry/fexit on the bpf2bpf, and then check the final count result. tools/testing/selftests/bpf/test_progs -t tailcalls 226/13 tailcalls/tailcall_bpf2bpf_fentry:OK 226/14 tailcalls/tailcall_bpf2bpf_fexit:OK 226/15 tailcalls/tailcall_bpf2bpf_fentry_fexit:OK 226/16 tailcalls/tailcall_bpf2bpf_fentry_entry:OK 226 tailcalls:OK Summary: 1/16 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Leon Hwang Link: https://lore.kernel.org/r/20230912150442.2009-4-hffilwlqm@gmail.com Signed-off-by: Alexei Starovoitov commit 2b5dcb31a19a2e0acd869b12c9db9b2d696ef544 Author: Leon Hwang Date: Tue Sep 12 23:04:41 2023 +0800 bpf, x64: Fix tailcall infinite loop From commit ebf7d1f508a73871 ("bpf, x64: rework pro/epilogue and tailcall handling in JIT"), the tailcall on x64 works better than before. From commit e411901c0b775a3a ("bpf: allow for tailcalls in BPF subprograms for x64 JIT"), tailcall is able to run in BPF subprograms on x64. From commit 5b92a28aae4dd0f8 ("bpf: Support attaching tracing BPF program to other BPF programs"), BPF program is able to trace other BPF programs. How about combining them all together? 1. FENTRY/FEXIT on a BPF subprogram. 2. A tailcall runs in the BPF subprogram. 3. The tailcall calls the subprogram's caller. As a result, a tailcall infinite loop comes up. And the loop would halt the machine. As we know, in tail call context, the tail_call_cnt propagates by stack and rax register between BPF subprograms. So do in trampolines. Fixes: ebf7d1f508a7 ("bpf, x64: rework pro/epilogue and tailcall handling in JIT") Fixes: e411901c0b77 ("bpf: allow for tailcalls in BPF subprograms for x64 JIT") Reviewed-by: Maciej Fijalkowski Signed-off-by: Leon Hwang Link: https://lore.kernel.org/r/20230912150442.2009-3-hffilwlqm@gmail.com Signed-off-by: Alexei Starovoitov commit 2bee9770f3c6be736a28725cb0f93775ed22e720 Author: Leon Hwang Date: Tue Sep 12 23:04:40 2023 +0800 bpf, x64: Comment tail_call_cnt initialisation Without understanding emit_prologue(), it is really hard to figure out where does tail_call_cnt come from, even though searching tail_call_cnt in the whole kernel repo. By adding these comments, it is a little bit easier to understand tail_call_cnt initialisation. Signed-off-by: Leon Hwang Link: https://lore.kernel.org/r/20230912150442.2009-2-hffilwlqm@gmail.com Signed-off-by: Alexei Starovoitov commit 92bbb93aaaefe14c01eac18df46f8260ee4c2825 Author: Krzysztof Kozlowski Date: Fri Sep 1 14:00:57 2023 +0200 power: reset: syscon-poweroff: get regmap from parent node Just like syscon-reboot device, the syscon-poweroff is supposed to be a child of syscon node, thus we can take the same approach as syscon-poweroff: deprecate the 'regmap' field in favor of taking it from the parent's node. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230901120057.47018-3-krzysztof.kozlowski@linaro.org Signed-off-by: Sebastian Reichel commit 6f9c8a1338d90d150767331d4fab051fb8abdba5 Author: Krzysztof Kozlowski Date: Fri Sep 1 14:00:56 2023 +0200 power: reset: syscon-poweroff: simplify pdev->dev usage Make the probe() code a bit simpler and shorter by storing all the '&pdev->dev' as 'dev'. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230901120057.47018-2-krzysztof.kozlowski@linaro.org Signed-off-by: Sebastian Reichel commit 716293381a0f9a400d0010628a9ba4354c2bea40 Author: Krzysztof Kozlowski Date: Fri Sep 1 14:00:55 2023 +0200 dt-bindings: power: syscon-poweroff: get regmap from parent node Just like syscon-reboot device, the syscon-poweroff is supposed to be a child of syscon node, thus we can take the same approach as syscon-poweroff: deprecate the 'regmap' field in favor of taking it from the parent's node. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230901120057.47018-1-krzysztof.kozlowski@linaro.org Signed-off-by: Sebastian Reichel commit c06a65ac4e4945478f46654920f5af1be1cf384e Author: Przemyslaw Chwiala Date: Thu Jul 20 14:31:02 2023 +0200 power: supply: max17042_battery: Do not use CONFIG_ prefix in regular C code Using CONFIG_ prefix for macros is not a good practice. Use CONFIG_ prefix in Kconfig only. Signed-off-by: Przemyslaw Chwiala Reviewed-by: Krzysztof Kozlowski Reviewed-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20230720123102.154699-1-przemekchwiala@gmail.com Signed-off-by: Sebastian Reichel commit 389405146ca11d24f85b3277121a58f98a926a28 Author: Ruan Jinjie Date: Thu Jul 27 19:35:50 2023 +0800 power: supply: Remove redundant dev_err_probe() for platform_get_irq_byname() There is no need to call the dev_err_probe() function directly to print a custom message when handling an error from platform_get_irq_byname() function as it is going to display an appropriate error message in case of a failure. Signed-off-by: Ruan Jinjie Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Dhruva Gole Link: https://lore.kernel.org/r/20230727113550.2599335-1-ruanjinjie@huawei.com Signed-off-by: Sebastian Reichel commit 6eca10a1c2e5c5edaf92d5a9d1bcf415456369b7 Author: Ruan Jinjie Date: Mon Jul 31 19:39:59 2023 +0800 power: supply: 88pm860x_battery: fix the return value handle for platform_get_irq() There is no possible for platform_get_irq() to return 0, and the return value of platform_get_irq() is more sensible to show the error reason. Signed-off-by: Ruan Jinjie Link: https://lore.kernel.org/r/20230731113959.1957820-1-ruanjinjie@huawei.com Signed-off-by: Sebastian Reichel commit 5b69b5f209b7a6d21329b14b533b390fff6895d5 Author: Yang Yingliang Date: Mon Aug 7 21:19:51 2023 +0800 power: reset: syscon-poweroff: use builtin_platform_driver() to simplify code The syscon_poweroff_register() doesn't do anything special, so it can use the builtin_platform_driver() macro to eliminate boilerplate code. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230807131951.3443880-6-yangyingliang@huawei.com Signed-off-by: Sebastian Reichel commit 6a7f7f27e2c766f36c6bd948a5de91ca2703c2a4 Author: Yang Yingliang Date: Mon Aug 7 21:19:50 2023 +0800 power: reset: axxia-reset: use builtin_platform_driver() to simplify code The axxia_reset_init() doesn't do anything special, so it can use the builtin_platform_driver() macro to eliminate boilerplate code. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230807131951.3443880-5-yangyingliang@huawei.com Signed-off-by: Sebastian Reichel commit 764db16149ec6128da548aac54a16b651461fbc8 Author: Yang Yingliang Date: Mon Aug 7 21:19:49 2023 +0800 power: reset: xgene-reboot: use builtin_platform_driver() to simplify code The xgene_reboot_init() doesn't do anything special, so it can use the builtin_platform_driver() macro to eliminate boilerplate code. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230807131951.3443880-4-yangyingliang@huawei.com Signed-off-by: Sebastian Reichel commit 4e579a5c68d88b340776c2270659de111f8923f6 Author: Yang Yingliang Date: Mon Aug 7 21:19:48 2023 +0800 power: reset: msm: use builtin_platform_driver() to simplify code The msm_restart_init() doesn't do anything special, so it can use the builtin_platform_driver() macro to eliminate boilerplate code. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230807131951.3443880-3-yangyingliang@huawei.com Signed-off-by: Sebastian Reichel commit 70c81c37cf252798bef5fe047a57129ff6a2b31b Author: Yang Yingliang Date: Mon Aug 7 21:19:47 2023 +0800 power: reset: st-poweroff: use builtin_platform_driver() to simplify code The st_reset_init() doesn't do anything special, so it can use the builtin_platform_driver() macro to eliminate boilerplate code. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230807131951.3443880-2-yangyingliang@huawei.com Signed-off-by: Sebastian Reichel commit 8e511f42ac9cdab84c692bcd0f9e0c55c75b1856 Author: Andrew Halaney Date: Thu Aug 17 16:41:57 2023 -0500 power: reset: nvmem-reboot-mode: quiet some device deferrals Some errors are being logged that are really due to deferrals, which is confusing to users. Use dev_err_probe() to handle when to log at error level versus debug. This also has the added bonuses of logging to devices_deferred and printing the error value. Signed-off-by: Andrew Halaney Reviewed-by: Brian Masney Tested-by: Brian Masney Link: https://lore.kernel.org/r/20230817214218.638846-1-ahalaney@redhat.com Signed-off-by: Sebastian Reichel commit 1a1c3d794ef65ef2978c5e65e1aed3fe6f014e90 Author: Richard Fitzgerald Date: Tue Sep 12 17:32:07 2023 +0100 ASoC: cs35l56: Use PCI SSID as the firmware UID If the driver properties do not define a cirrus,firmware-uid try to get the PCI SSID as the UID. On PCI-based systems the PCI SSID is used to uniquely identify the specific sound hardware. This is the standard mechanism for x86 systems and is the way to get a unique system identifier for systems that use the CS35L56 on SoundWire. For non-SoundWire systems there is no Windows equivalent of the ASoC driver in I2C/SPI mode. These would be: 1. HDA systems, which are handled by the HDA subsystem. 2. Linux-specific systems. 3. Composite devices where the cs35l56 is not present in ACPI and is configured using software nodes. Case 2 can use the firmware-uid property, though the PCI SSID is supported as an alternative, as it is the standard PCI mechanism. Case 3 is a SoundWire system where some other codec is the SoundWire bridge device and CS35L56 is not listed in ACPI. As these are SoundWire systems they will normally use the PCI SSID. Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230912163207.3498161-5-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit d8b387544ff4d02eda1d1839a0c601de4b037c33 Author: Richard Fitzgerald Date: Tue Sep 12 17:32:06 2023 +0100 ASoC: Intel: sof_sdw: Copy PCI SSID to struct snd_soc_card If the PCI SSID has been set in the struct snd_soc_acpi_mach_params, copy this to struct snd_soc_card so that it can be used by other ASoC components. This is important for components that must apply system-specific configuration. Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230912163207.3498161-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit ba2de401d32625fe538d3f2c00ca73740dd2d516 Author: Richard Fitzgerald Date: Tue Sep 12 17:32:05 2023 +0100 ASoC: SOF: Pass PCI SSID to machine driver Pass the PCI SSID of the audio interface through to the machine driver. This allows the machine driver to use the SSID to uniquely identify the specific hardware configuration and apply any platform-specific configuration. struct snd_sof_pdata is passed around inside the SOF code, but it then passes configuration information to the machine driver through struct snd_soc_acpi_mach and struct snd_soc_acpi_mach_params. So SSID information has been added to both snd_sof_pdata and snd_soc_acpi_mach_params. PCI does not define 0x0000 as an invalid value so we can't use zero to indicate that the struct member was not written. Instead a flag is included to indicate that a value has been written to the subsystem_vendor and subsystem_device members. sof_pci_probe() creates the struct snd_sof_pdata. It is passed a struct pci_dev so it can fill in the SSID value. sof_machine_check() finds the appropriate struct snd_soc_acpi_mach. It copies the SSID information across to the struct snd_soc_acpi_mach_params. This done before calling any custom set_mach_params() so that it could be used by the set_mach_params() callback to apply variant params. The machine driver receives the struct snd_soc_acpi_mach as its platform_data. Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230912163207.3498161-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 47f56e38a199bd45514b8e0142399cba4feeaf1a Author: Richard Fitzgerald Date: Tue Sep 12 17:32:04 2023 +0100 ASoC: soc-card: Add storage for PCI SSID Add members to struct snd_soc_card to store the PCI subsystem ID (SSID) of the soundcard. The PCI specification provides two registers to store a vendor-specific SSID that can be read by drivers to uniquely identify a particular "soundcard". This is defined in the PCI specification to distinguish products that use the same silicon (and therefore have the same silicon ID) so that product-specific differences can be applied. PCI only defines 0xFFFF as an invalid value. 0x0000 is not defined as invalid. So the usual pattern of zero-filling the struct and then assuming a zero value unset will not work. A flag is included to indicate when the SSID information has been filled in. Unlike DMI information, which has a free-format entirely up to the vendor, the PCI SSID has a strictly defined format and a registry of vendor IDs. It is usual in Windows drivers that the SSID is used as the sole identifier of the specific end-product and the Windows driver contains tables mapping that to information about the hardware setup, rather than using ACPI properties. This SSID is important information for ASoC components that need to apply hardware-specific configuration on PCI-based systems. As the SSID is a generic part of the PCI specification and is treated as identifying the "soundcard", it is reasonable to include this information in struct snd_soc_card, instead of components inventing their own custom ways to pass this information around. Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20230912163207.3498161-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit a84e361e58ccd294b7e68355ecc6c6d1ef212874 Merge: b399dc73f012e 1263cc0f414d2 Author: Mark Brown Date: Tue Sep 12 18:41:21 2023 +0100 ASoC: Merge up fixes For the benefit of CI. commit 8fc8911b66962c6ff4345e7000930a4bcc54ae5a Merge: cd8bae8581541 133c4c0d37175 Author: Paolo Abeni Date: Tue Sep 12 19:10:03 2023 +0200 Merge branch 'tcp-backlog-processing-optims' Eric Dumazet says: ==================== tcp: backlog processing optims First patches are mostly preparing the ground for the last one. Last patch of the series implements sort of ACK reduction only for the cases a TCP receiver is under high stress, which happens for high throughput flows. This gives us a ~20% increase of single TCP flow (100Gbit -> 120Gbit) ==================== Link: https://lore.kernel.org/r/20230911170531.828100-1-edumazet@google.com Signed-off-by: Paolo Abeni commit 133c4c0d37175f510a10fa9bed51e223936073fc Author: Eric Dumazet Date: Mon Sep 11 17:05:31 2023 +0000 tcp: defer regular ACK while processing socket backlog This idea came after a particular workload requested the quickack attribute set on routes, and a performance drop was noticed for large bulk transfers. For high throughput flows, it is best to use one cpu running the user thread issuing socket system calls, and a separate cpu to process incoming packets from BH context. (With TSO/GRO, bottleneck is usually the 'user' cpu) Problem is the user thread can spend a lot of time while holding the socket lock, forcing BH handler to queue most of incoming packets in the socket backlog. Whenever the user thread releases the socket lock, it must first process all accumulated packets in the backlog, potentially adding latency spikes. Due to flood mitigation, having too many packets in the backlog increases chance of unexpected drops. Backlog processing unfortunately shifts a fair amount of cpu cycles from the BH cpu to the 'user' cpu, thus reducing max throughput. This patch takes advantage of the backlog processing, and the fact that ACK are mostly cumulative. The idea is to detect we are in the backlog processing and defer all eligible ACK into a single one, sent from tcp_release_cb(). This saves cpu cycles on both sides, and network resources. Performance of a single TCP flow on a 200Gbit NIC: - Throughput is increased by 20% (100Gbit -> 120Gbit). - Number of generated ACK per second shrinks from 240,000 to 40,000. - Number of backlog drops per second shrinks from 230 to 0. Benchmark context: - Regular netperf TCP_STREAM (no zerocopy) - Intel(R) Xeon(R) Platinum 8481C (Saphire Rapids) - MAX_SKB_FRAGS = 17 (~60KB per GRO packet) This feature is guarded by a new sysctl, and enabled by default: /proc/sys/net/ipv4/tcp_backlog_ack_defer Signed-off-by: Eric Dumazet Acked-by: Yuchung Cheng Acked-by: Neal Cardwell Acked-by: Soheil Hassas Yeganeh Acked-by: Dave Taht Signed-off-by: Paolo Abeni commit 4505dc2a522826975167823f64f0896bac1323fb Author: Eric Dumazet Date: Mon Sep 11 17:05:30 2023 +0000 net: call prot->release_cb() when processing backlog __sk_flush_backlog() / sk_flush_backlog() are used when TCP recvmsg()/sendmsg() process large chunks, to not let packets in the backlog too long. It makes sense to call tcp_release_cb() to also process actions held in sk->sk_tsq_flags for smoother scheduling. Signed-off-by: Eric Dumazet Signed-off-by: Paolo Abeni commit 11445469dec803730ac7f78a5ad2a5ed131fa941 Author: Eric Dumazet Date: Mon Sep 11 17:05:29 2023 +0000 net: sock_release_ownership() cleanup sock_release_ownership() should only be called by user owning the socket lock. After prior commit, we can remove one condition. Signed-off-by: Eric Dumazet Signed-off-by: Paolo Abeni commit b49d252216e4f9e3030865b79d5ca16f050e4a19 Author: Eric Dumazet Date: Mon Sep 11 17:05:28 2023 +0000 tcp: no longer release socket ownership in tcp_release_cb() This partially reverts c3f9b01849ef ("tcp: tcp_release_cb() should release socket ownership"). prequeue has been removed by Florian in commit e7942d0633c4 ("tcp: remove prequeue support") __tcp_checksum_complete_user() being gone, we no longer have to release socket ownership in tcp_release_cb(). This is a prereq for third patch in the series ("net: call prot->release_cb() when processing backlog"). Signed-off-by: Eric Dumazet Signed-off-by: Paolo Abeni commit 2d325e54d9e2e4ae247c9fd03f810208ce958c51 Author: Raag Jadav Date: Tue Sep 12 21:18:15 2023 +0530 pinctrl: baytrail: fix debounce disable case We don't need to update debounce pulse value in case debounce is to be disabled. Break such a case where arg value is zero. Fixes: 4cfff5b7af8b ("pinctrl: baytrail: consolidate common mask operation") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/linux-gpio/d164d471-5432-4c3c-afdb-33dc8f53d043@moroto.mountain/ Signed-off-by: Raag Jadav Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit a7d79bcc8364483b0d39c944d72b425cf06eccc5 Author: Biju Das Date: Thu Aug 31 18:12:35 2023 +0100 power: supply: sbs-battery: Make similar OF and ID table Make similar OF and ID table to extend support for ID match using i2c_match_data(). Currently it works only for OF match tables as the field is wrong for ID match. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230831171235.58477-1-biju.das.jz@bp.renesas.com Signed-off-by: Sebastian Reichel commit 78a03b9f8e6b317f7c65738a3fc60e1e85106a64 Author: Jia Jie Ho Date: Thu May 25 14:18:36 2023 +0800 riscv: Kconfig: Add select ARM_AMBA to SOC_STARFIVE Selects ARM_AMBA platform support for StarFive SoCs required by spi and crypto dma engine. Signed-off-by: Jia Jie Ho Acked-by: Palmer Dabbelt Signed-off-by: Conor Dooley commit 02e673e59c3d374924422f74fb229ae4ee6715fc Author: Biju Das Date: Sat Sep 2 21:25:05 2023 +0100 power: supply: bq256xx: Some cleanups Some cleanups: * Remove trailing comma in the terminator entry for OF/ID/ACPI table. * Drop a space from terminator entry for OF table. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230902202505.97609-3-biju.das.jz@bp.renesas.com Signed-off-by: Sebastian Reichel commit f28992902b17245af042913d6cfd6a1cc100bcaf Author: Biju Das Date: Sat Sep 2 21:25:04 2023 +0100 power: supply: bq256xx: Use i2c_get_match_data() Use i2c_get_match_data() for OF/ID/ACPI match instead of ID lookup by replacing OF/ACPI/ID match data from enum bq256xx_id to struct bq256xx_chip_info. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230902202505.97609-2-biju.das.jz@bp.renesas.com Signed-off-by: Sebastian Reichel commit 54aee5f15b83437f23b2b2469bcf21bdd9823916 Author: Shuai Xue Date: Thu Sep 7 08:43:07 2023 +0800 perf/core: Bail out early if the request AUX area is out of bound When perf-record with a large AUX area, e.g 4GB, it fails with: #perf record -C 0 -m ,4G -e arm_spe_0// -- sleep 1 failed to mmap with 12 (Cannot allocate memory) and it reveals a WARNING with __alloc_pages(): ------------[ cut here ]------------ WARNING: CPU: 44 PID: 17573 at mm/page_alloc.c:5568 __alloc_pages+0x1ec/0x248 Call trace: __alloc_pages+0x1ec/0x248 __kmalloc_large_node+0xc0/0x1f8 __kmalloc_node+0x134/0x1e8 rb_alloc_aux+0xe0/0x298 perf_mmap+0x440/0x660 mmap_region+0x308/0x8a8 do_mmap+0x3c0/0x528 vm_mmap_pgoff+0xf4/0x1b8 ksys_mmap_pgoff+0x18c/0x218 __arm64_sys_mmap+0x38/0x58 invoke_syscall+0x50/0x128 el0_svc_common.constprop.0+0x58/0x188 do_el0_svc+0x34/0x50 el0_svc+0x34/0x108 el0t_64_sync_handler+0xb8/0xc0 el0t_64_sync+0x1a4/0x1a8 'rb->aux_pages' allocated by kcalloc() is a pointer array which is used to maintains AUX trace pages. The allocated page for this array is physically contiguous (and virtually contiguous) with an order of 0..MAX_ORDER. If the size of pointer array crosses the limitation set by MAX_ORDER, it reveals a WARNING. So bail out early with -ENOMEM if the request AUX area is out of bound, e.g.: #perf record -C 0 -m ,4G -e arm_spe_0// -- sleep 1 failed to mmap with 12 (Cannot allocate memory) Signed-off-by: Shuai Xue Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar commit dd35a4debcf917f069e83f60b6ac84b5cad6e5e3 Author: Linus Walleij Date: Mon Sep 11 10:27:58 2023 +0200 regulator: rk808: Drop useless headers The RK808 is already using the proper header and includes the legacy headers and for no reason, drop the includes. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230911-descriptors-regulator-v2-1-ce978c52c557@linaro.org Signed-off-by: Mark Brown commit b399dc73f012e463dad38410c147467a292ba4bb Author: Kuninori Morimoto Date: Mon Sep 11 00:45:03 2023 +0000 ASoC: rsnd: remove unneeded of_node_put() The loop is not using "node", of_node_put(node) is not needed. Cc: Julia Lawall Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/8734zlilmd.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 2b3357dc415b331c53adc499eda140b12e99afb9 Merge: 0ed30d3fe2c77 510c46884299c Author: Mark Brown Date: Tue Sep 12 14:29:55 2023 +0100 SM6115 TX Macro Merge series from Konrad Dybcio : Like most Qualcomm SoCs, SM6115 has a TX Macro. Only some minor changes were required. commit ab6fa92531abfcc1f50062e867fe7d001b293f82 Merge: 969b033a77a8f 1b4daf643a3a2 Author: Mark Brown Date: Tue Sep 12 13:10:22 2023 +0100 Match data improvements for pv880x0 regulator Merge series from Biju Das : This patch series aims to add match data improvements for pv880x0 regulator driver. These patches are only compile tested. commit cd8bae85815416d19f46e3828d457442f77de292 Author: Andy Shevchenko Date: Mon Sep 11 16:16:18 2023 +0300 wwan: core: Use the bitmap API to allocate bitmaps Use bitmap_zalloc() and bitmap_free() instead of hand-writing them. It is less verbose and it improves the type checking and semantic. While at it, add missing header inclusion (should be bitops.h, but with the above change it becomes bitmap.h). Reviewed-by: Loic Poulain Reviewed-by: Sergey Ryazanov Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230911131618.4159437-1-andriy.shevchenko@linux.intel.com Signed-off-by: Paolo Abeni commit 762c8dc7f269b748babe32dd19d2084ce1b3f31f Author: Zhengchao Shao Date: Mon Sep 11 20:50:45 2023 +0800 net: dst: remove unnecessary input parameter in dst_alloc and dst_init Since commit 1202cdd66531("Remove DECnet support from kernel") has been merged, all callers pass in the initial_ref value of 1 when they call dst_alloc(). Therefore, remove initial_ref when the dst_alloc() is declared and replace initial_ref with 1 in dst_alloc(). Also when all callers call dst_init(), the value of initial_ref is 1. Therefore, remove the input parameter initial_ref of the dst_init() and replace initial_ref with the value 1 in dst_init. Signed-off-by: Zhengchao Shao Link: https://lore.kernel.org/r/20230911125045.346390-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni commit 22da192f43f7d302d02644efa192ba5a05d935c9 Author: Biju Das Date: Sun Sep 3 15:59:26 2023 +0100 iio: pressure: ms5637: Use i2c_get_match_data() Simplify probe() by replacing id lookup for retrieving match data and device_get_match_data() by i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230903145926.66855-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit c377e2febd91e21782f9106e663937f0629f39f1 Author: Biju Das Date: Sun Sep 3 12:55:48 2023 +0100 iio: dac: mcp4725: Add dac_reg_offset to struct mcp4725_chip_info The MCP4725 has a register offset '3' for reading DAC value compared to '4' for MCP4726. Add dac_reg_offset variable to struct mcp4725_chip_info to handle this difference. Drop chip_id from struct mcp4725_chip_info as it is unused. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230903115548.59306-5-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 155da070b4388ed53f058259923f46740a51afde Author: Biju Das Date: Sun Sep 3 12:55:47 2023 +0100 iio: dac: mcp4725: Add use_ext_ref_voltage to struct mcp4725_chip_info The MCP4725 has external voltage reference compared MCP4725 which has reference embeedded in eeprom. Add use_ext_ref_voltage variable to struct mcp4725_chip_info to handle this difference. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230903115548.59306-4-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 18bdc686c1519e067dc80ec0015da52e2bd628b9 Author: Biju Das Date: Sun Sep 3 12:55:46 2023 +0100 iio: dac: mcp4725: Use i2c_get_match_data() Add struct mcp4725_chip_info with chan_spec and chip_id variable. After this simplify probe() by replacing device_get_match_data() and id lookup for retrieving match data by i2c_get_match_data() by converting enum->pointer for data in the match table. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230903115548.59306-3-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 002d546fff4f83648903eada2b6226d314374fdb Author: Biju Das Date: Sun Sep 3 12:55:45 2023 +0100 iio: dac: mcp4725: Replace variable 'id' from struct mcp4725_data Replace the variable 'id' from struct mcp4725_data with local variable chip_id in probe() as the id variable is not used elsewhere in the driver. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230903115548.59306-2-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit dcc3ac1381eff05e4ab546a42798dd6837b295a7 Author: Biju Das Date: Sun Sep 3 10:00:51 2023 +0100 iio: accel: adxl345: Simplify adxl345_read_raw() Simplify adxl345_read_raw() by adding uscale variable to struct adxl345_chip_info. Also convert variables adxl3{4,7}5_uscale to macros and use it in OF/ACPI/ID match table. Drop enum adxl345_device_type as there is no user. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230903090051.39274-3-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 7d0ba6dbf8356d20b69cfd042800d5d51ac00bd7 Author: Biju Das Date: Sun Sep 3 10:00:50 2023 +0100 iio: accel: adxl345: Convert enum->pointer for data in match data table Convert enum->pointer for data in match data table, so that device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c bus type match support added to it. Add struct adxl345_chip_info and replace enum->adxl345_chip_info in the match table and simplify adxl345_probe(). Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230903090051.39274-2-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 6c70012df1f39bb9bd015b6b6383f66cde95bc94 Author: Biju Das Date: Sat Sep 2 18:05:29 2023 +0100 iio: adc: ltc2497: Simplify probe() Simpilfy probe() by replacing device_get_match_data() and id lookup for retrieving match data by using i2c_get_match_data(). Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230902170529.62297-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit f6b1737921dd38919a6d25826a953bd6d04c8c4b Author: Biju Das Date: Sat Sep 2 17:32:33 2023 +0100 iio: adc: ti-ads1015: Simplify probe() Simpilfy probe() by replacing device_get_match_data() and id lookup for retrieving match data by using i2c_get_match_data(). Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230902163233.56449-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 5793ddcf1f8bf90bfe13b1757a1350d6482a4474 Author: Biju Das Date: Sat Sep 2 17:26:33 2023 +0100 iio: adc: ti-adc081c: Simplify probe() Simpilfy probe() by replacing of_device_get_match_data() and id lookup for retrieving match data by using i2c_get_match_data() by making similar OF/I2C/ACPI match tables. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230902162633.50546-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 17f961a6555ae38490cfcc39f12c0c014cbd2617 Author: Marek Vasut Date: Thu Aug 31 20:25:02 2023 +0200 iio: adc: ti-ads1015: Add edge trigger support The comparator generates an edge on the IRQ like and stays in the configured state until cleared. Support edge triggered IRQs as well as not all controllers do support level triggered IRQ. Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20230831182502.154899-1-marex@denx.de Signed-off-by: Jonathan Cameron commit 33ec3e5fc1ea0e0c5c93425170602533c07f55d4 Author: Marius Cristea Date: Tue Aug 29 18:41:33 2023 +0300 iio: adc: adding support for MCP3564 ADC This is the iio driver for Microchip family of 153.6 ksps, Low-Noise 16/24-Bit Delta-Sigma ADCs with an SPI interface (Microchip's MCP3461, MCP3462, MCP3464, MCP3461R, MCP3462R, MCP3464R, MCP3561, MCP3562, MCP3564, MCP3561R, MCP3562R and MCP3564R analog to digital converters). Signed-off-by: Marius Cristea Link: https://lore.kernel.org/r/20230829154133.40716-3-marius.cristea@microchip.com Signed-off-by: Jonathan Cameron commit df2ece7aec158bd2b62a75b37bcc230bbd2695f4 Author: Marius Cristea Date: Tue Aug 29 18:41:32 2023 +0300 dt-bindings: iio: adc: adding MCP3564 ADC This is the device tree schema for iio driver for Microchip family of 153.6 ksps, Low-Noise 16/24-Bit Delta-Sigma ADCs with an SPI interface (Microchip's MCP3461, MCP3462, MCP3464, MCP3461R, MCP3462R, MCP3464R, MCP3561, MCP3562, MCP3564, MCP3561R, MCP3562R and MCP3564R analog to digital converters). Signed-off-by: Marius Cristea Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230829154133.40716-2-marius.cristea@microchip.com Signed-off-by: Jonathan Cameron commit 733e0fed9c275b7d9e07041cfca8b221c71e3bd2 Author: Liam Beguin Date: Mon Aug 28 22:41:35 2023 -0400 iio: adc: add ltc2309 support The LTC2309 is an 8-Channel, 12-Bit SAR ADC with an I2C Interface. This implements support for all single-ended and differential channels, in unipolar mode only. Signed-off-by: Liam Beguin Link: https://lore.kernel.org/r/20230828-ltc2309-v3-2-338b3a8fab8b@gmail.com Signed-off-by: Jonathan Cameron commit 0679ea0be2c86e384bc7fef46ef94cdd0aa73aa3 Author: Liam Beguin Date: Mon Aug 28 22:41:34 2023 -0400 dt-bindings: iio: adc: add lltc,ltc2309 bindings Add devicetree bindings for the Linear Technology LTC2309 ADC driver. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Liam Beguin Link: https://lore.kernel.org/r/20230828-ltc2309-v3-1-338b3a8fab8b@gmail.com Signed-off-by: Jonathan Cameron commit 8aa6e6682f3624dca0cfbc3824e2d9937e58ca59 Author: Antoniu Miclaus Date: Wed Aug 30 12:43:14 2023 +0300 iio: addac: ad74413r: fix function prefix typo Use complete device name prefix in the input current offset getter function. Signed-off-by: Antoniu Miclaus Reviewed-by: Nuno Sa Link: https://lore.kernel.org/r/20230830094314.26353-1-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron commit 3a23b384e7e3d64d5587ad10729a34d4f761517e Author: Zhang Shurong Date: Sat Jul 15 23:55:50 2023 +0800 iio: adc: stm32-adc: harden against NULL pointer deref in stm32_adc_probe() of_match_device() may fail and returns a NULL pointer. In practice there is no known reasonable way to trigger this, but in case one is added in future, harden the code by adding the check Signed-off-by: Zhang Shurong Link: https://lore.kernel.org/r/tencent_994DA85912C937E3B5405BA960B31ED90A08@qq.com Signed-off-by: Jonathan Cameron commit 8f6bc87d67c0309a98546d933bfefd2837154c8e Author: Ramona Bolboaca Date: Tue Aug 8 10:50:59 2023 +0300 iio: imu: adis16475.c: Add delta angle and delta velocity channels Add support for delta angle and delta velocity raw and buffer readings to adis16475 driver. Signed-off-by: Ramona Bolboaca Reviewed-by: Nuno Sa Link: https://lore.kernel.org/r/20230808075059.645525-4-ramona.bolboaca@analog.com Signed-off-by: Jonathan Cameron commit 94a39f2c443b3fc5efe31a68502991020eefa3d2 Author: Ramona Bolboaca Date: Tue Aug 8 10:50:58 2023 +0300 iio: Add IIO_DELTA_VELOCITY channel type The delta velocity is defined as a piece-wise integration of acceleration data. The delta velocity represents the linear velocity change between two consecutive measurements and it is measured in m / s (meters per second). In order to track the total linear velocity change during a desired period of time, simply sum-up the delta velocity samples acquired during that time. IIO currently does not offer a suitable channel type for this type of measurements hence this patch adds it. Signed-off-by: Ramona Bolboaca Reviewed-by: Nuno Sa Link: https://lore.kernel.org/r/20230808075059.645525-3-ramona.bolboaca@analog.com Signed-off-by: Jonathan Cameron commit 744f4990ee0519ebef21fa7db094240bbaf3d746 Author: Ramona Bolboaca Date: Tue Aug 8 10:50:57 2023 +0300 iio: Add IIO_DELTA_ANGL channel type The delta angle is defined as a piece-wise integration of angular velocity data. The delta angle represents the amount of angular displacement between two consecutive measurements and it is measured in radians. In order to track the total angular displacement during a desired period of time, simply sum-up the delta angle samples acquired during that time. IIO currently does not offer a suitable channel type for this type of measurements hence this patch adds it. Signed-off-by: Ramona Bolboaca Reviewed-by: Nuno Sa Link: https://lore.kernel.org/r/20230808075059.645525-2-ramona.bolboaca@analog.com Signed-off-by: Jonathan Cameron commit 8c337436e6da6ac1dcc2d2f990489c9ebfe429f1 Author: Andy Shevchenko Date: Tue Aug 8 19:41:37 2023 +0300 iio: dac: stm32-dac: Use correct header(s) instead of string_helpers.h There is nothing from string_helpers.h used in the driver, correct the header inclusion block accordingly. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230808164137.66663-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit de39695dd1fb753a6040053483213ebe7a960af2 Author: Andy Shevchenko Date: Tue Aug 8 19:41:52 2023 +0300 iio: accel: msa311: Use correct header(s) instead of string_helpers.h There is nothing from string_helpers.h used in the driver, correct the header inclusion block accordingly. Signed-off-by: Andy Shevchenko Reviewed-by: Dmitry Rokosov Link: https://lore.kernel.org/r/20230808164152.66748-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit b1209cf096358cfb9c538def71ff039fcb8631bd Author: Andy Shevchenko Date: Tue Aug 8 19:42:04 2023 +0300 iio: accel: kionix-kx022a: Use correct header(s) instead of string_helpers.h There is nothing from string_helpers.h used in the driver, correct the header inclusion block accordingly. Signed-off-by: Andy Shevchenko Acked-by: Matti Vaittinen Link: https://lore.kernel.org/r/20230808164204.66818-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 4eaf928622abc5dabc9b42a0de4dafbe29ddf491 Author: Yue Haibing Date: Fri Aug 11 17:57:01 2023 +0800 iio: Remove unused declarations Commit 0f3a8c3f34f7 ("iio: Add support for creating IIO devices via configfs") declared but never implemented iio_sw_device_type_configfs_{un}register(). Commit b662f809d410 ("iio: core: Introduce IIO software triggers") declared but never implemented iio_sw_trigger_type_configfs_{un}register(). Commit a3e0b51884ee ("iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers") declared but never implemented fxls8962af_core_remove(). Commit 8dedcc3eee3a ("iio: core: centralize ioctl() calls to the main chardev") declared but never implemented iio_device_ioctl(). Commit d430f3c36ca6 ("iio: imu: inv_mpu6050: Use regmap instead of i2c specific functions") removed inv_mpu6050_write_reg() but not its declaration. Signed-off-by: Yue Haibing Link: https://lore.kernel.org/r/20230811095701.35372-1-yuehaibing@huawei.com Signed-off-by: Jonathan Cameron commit fc1d297b928b98f2290c1d80f6bb7ff12d278a3a Author: Biju Das Date: Sat Aug 12 17:11:54 2023 +0100 iio: temperature: tmp117: Convert enum->pointer for data in the match tables Convert enum->pointer for data in the match tables, so that device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c bus type match support added to it. Add struct tmp11x_info and replace enum->struct *tmp11x_info for data in the match table. Drop tmp117_identify() and simplify tmp117_probe() by replacing device_get_match_data() and id lookup for retrieving data by i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Marco Felsch Link: https://lore.kernel.org/r/20230812161154.196555-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 5a4ef20aab63dacdce77c97eaf1847355cc9e66e Author: Biju Das Date: Sat Aug 12 16:19:08 2023 +0100 iio: light: opt4001: Use i2c_get_match_data() Replace device_get_match_data()->i2c_get_match_data() to extend matching support for ID table. Signed-off-by: Biju Das Reviewed-by: Stefan Windfeldt-Prytz Tested-by: Stefan Windfeldt-Prytz Link: https://lore.kernel.org/r/20230812151908.188696-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit c4153b5720e62be957f3497049cb2706f0b8a5b1 Author: Biju Das Date: Sat Aug 12 16:08:38 2023 +0100 iio: potentiometer: ad5110: Use i2c_get_match_data() Replace device_get_match_data()->i2c_get_match_data by making similar I2C and DT-based matching table to extend matching support for ID table. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230812150838.185055-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 0f5cecd14f42a2cbd10f7670c025dfb98a817f7b Author: Biju Das Date: Sat Aug 12 15:41:06 2023 +0100 iio: potentiometer: ds1803: Convert enum->pointer for data in the ID table Convert enum->pointer for data in the ID table, so that device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c bus type match support added to it. Replace enum->struct *ds1803_cfg for data in the ID table and simplify ds1803_probe() by replacing device_get_match_data() with i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230812144106.163355-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 8c89edc1ac9e3be816cd37e0df2afe040283a9d3 Author: Biju Das Date: Sat Aug 12 17:57:30 2023 +0100 iio: chemical: sgp30: Convert enum->pointer for data in the match tables Convert enum->pointer for data in the match tables, so that device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c bus type match support added to it. Add product_id variable to struct sgp_device and remove the local variable product_id in probe() and replace enum->struct *sgp_device for data in the match table. Simplify theprobe() by replacing device_get_match_data() and ID lookup for retrieving data by i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230812165730.216180-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 20f87a9a26bea28df91506f3c2747e636d5d589c Author: Ana-Maria Cusco Date: Wed Aug 16 14:09:06 2023 +0300 dt-bindings: iio: hmc425a: add entry for HMC540S Added support for HMC540SLP3E broadband 4-bit Silicon IC digital attenuator with a 15 dB control range and wide frequency coverage (0.1 to 8 GHz). Signed-off-by: Ana-Maria Cusco Acked-by: Conor Dooley Link: https://lore.kernel.org/r/20230816110906.144540-2-ana-maria.cusco@analog.com Signed-off-by: Jonathan Cameron commit 77865a8f9f7085a51188b3fb95368c73a7dd12f3 Author: Michael Hennerich Date: Wed Aug 16 14:09:05 2023 +0300 iio: amplifiers: hmc425a: Add Support HMC540S 4-bit Attenuator This adds support for the Analog Devices HMC540s 1 dB LSB Silicon MMIC 4-Bit Digital Positive Control Attenuator, 0.1 - 8 GHz Signed-off-by: Michael Hennerich Signed-off-by: Ana-Maria Cusco Link: https://lore.kernel.org/r/20230816110906.144540-1-ana-maria.cusco@analog.com Signed-off-by: Jonathan Cameron commit be3af13fc1b5918ab5308eff4d470696325e2d57 Merge: 73be7fb14e83d b256e13378a90 Author: Paolo Abeni Date: Tue Sep 12 10:23:53 2023 +0200 Merge branch 'add-support-for-icssg-on-am64x-evm' MD Danish Anwar says: ==================== Add support for ICSSG on AM64x EVM This series adds support for ICSSG driver on AM64x EVM. First patch of the series adds compatible for AM64x EVM in icssg-prueth dt binding. Second patch adds support for AM64x compatible in the ICSSG driver. This series addresses comments on [v1] (which was posted as RFC). This series is based on the latest net-next/main. This series has no dependency. Changes from v1 to v2: *) Made the compatible list in patch 1 alphanumerically ordered as asked by Krzysztof. *) Dropped the RFC tag. *) Added RB tags of Andrew and Roger. [v1] https://lore.kernel.org/all/20230830113724.1228624-1-danishanwar@ti.com/ ==================== Link: https://lore.kernel.org/r/20230911054308.2163076-1-danishanwar@ti.com Signed-off-by: Paolo Abeni commit b256e13378a90c6465bbab1dcaf8c2847357538d Author: MD Danish Anwar Date: Mon Sep 11 11:13:08 2023 +0530 net: ti: icssg-prueth: Add AM64x icssg support Add AM64x ICSSG support which is similar to am65x SR2.0, but required: - all ring configured in exposed ring mode - always fill both original and buffer fields in cppi5 desc Reviewed-by: Andrew Lunn Reviewed-by: Roger Quadros Signed-off-by: MD Danish Anwar Signed-off-by: Paolo Abeni commit 0caab0a46d066f068952776cba64158c25be70d4 Author: MD Danish Anwar Date: Mon Sep 11 11:13:07 2023 +0530 dt-bindings: net: Add compatible for AM64x in ICSSG Add compatible for AM64x in icssg-prueth dt bindings. AM64x supports ICSSG similar to AM65x SR2.0. Acked-by: Krzysztof Kozlowski Reviewed-by: Roger Quadros Signed-off-by: MD Danish Anwar Signed-off-by: Paolo Abeni commit 2c97d3e55b70edf33b6e7f211bab8a748a0a2bcc Author: Luke D. Jones Date: Wed Aug 30 15:22:37 2023 +1200 platform/x86: asus-wmi: add support for ASUS screenpad Add support for the WMI methods used to turn off and adjust the brightness of the secondary "screenpad" device found on some high-end ASUS laptops like the GX650P series and others. There are some small quirks with this device when considering only the raw WMI methods: 1. The Off method can only switch the device off 2. Changing the brightness turns the device back on 3. To turn the device back on the brightness must be > 1 4. When the device is off the brightness can't be changed (so it is stored by the driver if device is off). 5. Booting with a value of 0 brightness (retained by bios) means the bios will set a value of >0 <15 6. When the device is off it is "unplugged" asus_wmi sets the minimum brightness as 20 in general use, and 60 for booting with values <= min. The ACPI methods are used in a new backlight device named asus_screenpad. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20230830032237.42987-2-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit eab541aac7f49d2f6e21e486af0bd3048cebb3dd Merge: 4106a70ddad57 eee9cd5d25f1b Author: Hans de Goede Date: Tue Sep 12 10:18:01 2023 +0200 Merge remote-tracking branch 'pdx86/platform-drivers-x86-android-tablets' into review-hans commit eee9cd5d25f1be6120fdf1c90c81324d22b4cc49 Author: Hans de Goede Date: Mon Sep 11 23:09:28 2023 +0200 platform/x86: x86-android-tablets: Add a comment about x86_android_tablet_get_gpiod() Add a comment explaining why the special x86_android_tablet_get_gpiod() helper is necessary for some of the GPIOs used in the x86-android-tablets; and that for normal GPIO lookups this example should not be followed. Signed-off-by: Hans de Goede Reviewed-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230911210928.264908-1-hdegoede@redhat.com commit c9336ebe87e77f92ed04a86c0131a0310d0e200d Author: Jernej Skrabec Date: Sat Sep 9 08:36:12 2023 +0200 pinctrl: pinmux: Remove duplicate error message in pin_request() Detailed error message is already printed at the end of the function, so drop redundant one a few lines earlier. Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20230909063613.2867-2-jernej.skrabec@gmail.com Signed-off-by: Linus Walleij commit 70a3894c0aa0c45cc3cd1200fac4ec6408753913 Author: Biju Das Date: Sat Sep 9 12:04:59 2023 +0100 pinctrl: sx150x: Simplify probe() Simpilfy probe() by replacing of_device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230909110459.12453-1-biju.das.jz@bp.renesas.com Signed-off-by: Linus Walleij commit a5c612b9dbe14fee62829b4aecde17d670effed2 Author: Bartosz Golaszewski Date: Fri Sep 1 13:29:26 2023 +0200 pinctrl: da9062: don't include private GPIOLIB header gpiochip_get_desc() now lives in linux/gpio/driver.h and there is no longer any need to include GPIOLIB's private header. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit fe4fa2e4f7d0722c179fffa25911ea35cafadce2 Author: Bartosz Golaszewski Date: Fri Sep 1 13:29:25 2023 +0200 gpiolib: make gpiochip_get_desc() public It makes sense for a GPIO driver to want to get its own descriptor without requesting it. After all, the driver knows that it'll still be valid. Let's move this helper to linux/gpio/driver.h. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit d56c6f798afad4e0ce97194ee22cf2745d438bb3 Author: Bartosz Golaszewski Date: Fri Sep 1 13:29:24 2023 +0200 pinctrl: da9062: add missing include gpiod_is_active_low() is defined in linux/gpio/consumer.h. It's only because we're pulling in the gpiolib.h private header that we get this declaration implicitly but let's fix it as that is going away soon. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit 71567fbd1d33ecda0d75463397c9f3c76065dbbd Author: Biju Das Date: Sat Sep 2 09:22:25 2023 +0100 pinctrl: cy8c95x0: Simplify probe() Simpilfy probe() by replacing device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230902082225.8777-1-biju.das.jz@bp.renesas.com Signed-off-by: Linus Walleij commit 6b711386d13356b964a97f714c4f55ec66936849 Author: Jani Nikula Date: Mon Sep 11 15:33:05 2023 +0300 drm/i915/gt: rename DBG() to GTT_TRACE() intel_gtt.h is indirectly included absolutely everywhere in the driver. DBG() is too short a name. Rename it GTT_TRACE() after GEM_TRACE(). Signed-off-by: Jani Nikula Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230911123305.1682554-1-jani.nikula@intel.com commit 88d31f836b41091dfd9f32c3675e0b225758f993 Author: Bartosz Golaszewski Date: Mon Sep 11 13:07:40 2023 +0200 gpio: sim: don't fiddle with GPIOLIB private members We access internals of struct gpio_device and struct gpio_desc because it's easier but it can actually be avoided and we're working towards a better encapsulation of GPIO data structures across the kernel so let's start at home. Instead of checking gpio_desc flags, let's just track the requests of GPIOs in the driver. We also already store the information about direction of simulated lines. For kobjects needed by sysfs callbacks: we can iterate over the children devices of the top-level platform device and compare their fwnodes against the one passed to the init function from probe. While at it: fix one line break and remove the untrue part about configfs callbacks using dev_get_drvdata() from a comment. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko commit 68a2f05fec4939922aef6710d55c14398a5825f3 Author: Konrad Dybcio Date: Thu Aug 31 23:21:25 2023 +0200 pinctrl: qcom: sdm660: Add MPM pin mappings Add pin <-> wakeirq mappings to allow for waking up the AP from sleep through MPM-connected pins. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230809-topic-mpm_mappings-v2-4-4c2b4495e654@linaro.org Signed-off-by: Linus Walleij commit 9395f831ace53b984c92352b1d2ad0dc9971209e Author: Konrad Dybcio Date: Thu Aug 31 23:21:24 2023 +0200 pinctrl: qcom: sm6125: Add MPM pin mappings Add pin <-> wakeirq mappings to allow for waking up the AP from sleep through MPM-connected pins. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230809-topic-mpm_mappings-v2-3-4c2b4495e654@linaro.org Signed-off-by: Linus Walleij commit bd1b24686bbdd3a5417e5475bc0204d179bedce5 Author: Konrad Dybcio Date: Thu Aug 31 23:21:23 2023 +0200 pinctrl: qcom: sm6115: Add MPM pin mappings Add pin <-> wakeirq mappings to allow for waking up the AP from sleep through MPM-connected pins. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230809-topic-mpm_mappings-v2-2-4c2b4495e654@linaro.org Signed-off-by: Linus Walleij commit 89670ec0c91a88d6c3894fbc6d0fffe6e988e1dc Author: Konrad Dybcio Date: Thu Aug 31 23:21:22 2023 +0200 pinctrl: qcom: msm8996: Add MPM pin mappings Add pin <-> wakeirq mappings to allow for waking up the AP from sleep through MPM-connected pins. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20230809-topic-mpm_mappings-v2-1-4c2b4495e654@linaro.org Signed-off-by: Linus Walleij commit 9a249ec89a5e562f8436ba0edfe7322a22e65b11 Merge: b32415652a4d2 9578db7939fcf Author: Bartosz Golaszewski Date: Tue Sep 12 09:15:48 2023 +0200 Merge tag 'platform-drivers-x86-ib-x86-android-tablets-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 into gpio/for-next Immutable branch between pdx86 android tablets branch and GPIO due for the v6.7 merge window ib-x86-android-tablets-v6.7: v6.6-rc1 + ib-pdx86-android-tablets for merging into the GPIO subsystem for v6.7. commit ffbe4ab0beda55b5c467aa3d95ca14db75a84717 Author: Kan Liang Date: Mon Sep 11 07:41:38 2023 -0700 perf/x86/intel: Extend the ref-cycles event to GP counters The current ref-cycles event is only available on the fixed counter 2. Starting from the GLC and GRT core, the architectural UnHalted Reference Cycles event (0x013c) which is available on general-purpose counters can collect the exact same events as the fixed counter 2. Update the mapping of ref-cycles to 0x013c. So the ref-cycles can be available on both fixed counter 2 and general-purpose counters. Signed-off-by: Kan Liang Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230911144139.2354015-1-kan.liang@linux.intel.com commit 950ecdc672aec9cd29036b2e2535b07c103af494 Author: Kan Liang Date: Mon Sep 11 06:51:28 2023 -0700 perf/x86/intel: Fix broken fixed event constraints extension Unnecessary multiplexing is triggered when running an "instructions" event on an MTL. perf stat -e cpu_core/instructions/,cpu_core/instructions/ -a sleep 1 Performance counter stats for 'system wide': 115,489,000 cpu_core/instructions/ (50.02%) 127,433,777 cpu_core/instructions/ (49.98%) 1.002294504 seconds time elapsed Linux architectural perf events, e.g., cycles and instructions, usually have dedicated fixed counters. These events also have equivalent events which can be used in the general-purpose counters. The counters are precious. In the intel_pmu_check_event_constraints(), perf check/extend the event constraints of these events. So these events can utilize both fixed counters and general-purpose counters. The following cleanup commit: 97588df87b56 ("perf/x86/intel: Add common intel_pmu_init_hybrid()") forgot adding the intel_pmu_check_event_constraints() into update_pmu_cap(). The architectural perf events cannot utilize the general-purpose counters. The code to check and update the counters, event constraints and extra_regs is the same among hybrid systems. Move intel_pmu_check_hybrid_pmus() to init_hybrid_pmu(), and emove the duplicate check in update_pmu_cap(). Fixes: 97588df87b56 ("perf/x86/intel: Add common intel_pmu_init_hybrid()") Signed-off-by: Kan Liang Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230911135128.2322833-1-kan.liang@linux.intel.com commit 21db931445d85a14c0a64a9d54c7617a8c6e5762 Author: Kent Overstreet Date: Tue Apr 25 14:45:28 2023 -0400 lib: Export errname errname() returns the name of an errcode; this functionality is otherwise only available for error pointers via %pE - bcachefs uses this for better error messages. Signed-off-by: Christopher James Halse Rogers Signed-off-by: Kent Overstreet commit 83feeb195592b533541ff6399c8084e5b7c59677 Author: Kent Overstreet Date: Mon Apr 25 15:26:28 2022 -0400 lib/string_helpers: string_get_size() now returns characters wrote printbuf now needs to know the number of characters that would have been written if the buffer was too small, like snprintf(); this changes string_get_size() to return the the return value of snprintf(). Signed-off-by: Kent Overstreet commit 7d672f40941a549f72aa5500f9d32b26b3f6ab34 Author: Christopher James Halse Rogers Date: Mon Jun 27 10:45:12 2022 +1000 stacktrace: Export stack_trace_save_tsk The bcachefs module wants it, and there doesn't seem to be any reason it shouldn't be exported like the other functions. Signed-off-by: Christopher James Halse Rogers Signed-off-by: Kent Overstreet commit 771eb4fe8b420bb8563863e242861e635c742bc2 Author: Kent Overstreet Date: Mon Jul 9 23:27:33 2018 -0400 fs: factor out d_mark_tmpfile() New helper for bcachefs - bcachefs doesn't want the inode_dec_link_count() call that d_tmpfile does, it handles i_nlink on its own atomically with other btree updates Signed-off-by: Kent Overstreet Cc: Alexander Viro Cc: Christian Brauner Cc: linux-fsdevel@vger.kernel.org Reviewed-by: Darrick J. Wong Reviewed-by: Christian Brauner commit 2b69987be575b92adb6c177679f3c559134f0d8f Author: Kent Overstreet Date: Wed Oct 16 15:03:50 2019 -0400 sched: Add task_struct->faults_disabled_mapping There has been a long standing page cache coherence bug with direct IO. This provides part of a mechanism to fix it, currently just used by bcachefs but potentially worth promoting to the VFS. Direct IO evicts the range of the pagecache being read or written to. For reads, we need dirty pages to be written to disk, so that the read doesn't return stale data. For writes, we need to evict that range of the pagecache so that it's not stale after the write completes. However, without a locking mechanism to prevent those pages from being re-added to the pagecache - by a buffered read or page fault - page cache inconsistency is still possible. This isn't necessarily just an issue for userspace when they're playing games; filesystems may hang arbitrary state off the pagecache, and so page cache inconsistency may cause real filesystem bugs, depending on the filesystem. This is less of an issue for iomap based filesystems, but e.g. buffer heads caches disk block mappings (!) and attaches them to the pagecache, and bcachefs attaches disk reservations to pagecache pages. This issue has been hard to fix, because - we need to add a lock (henceforth called pagecache_add_lock), which would be held for the duration of the direct IO - page faults add pages to the page cache, thus need to take the same lock - dio -> gup -> page fault thus can deadlock And we cannot enforce a lock ordering with this lock, since userspace will be controlling the lock ordering (via the fd and buffer arguments to direct IOs), so we need a different method of deadlock avoidance. We need to tell the page fault handler that we're already holding a pagecache_add_lock, and since plumbing it through the entire gup() path would be highly impractical this adds a field to task_struct. Then the full method is: - in the dio path, when we first take the pagecache_add_lock, note the mapping in the current task_struct - in the page fault handler, if faults_disabled_mapping is set, we check if it's the same mapping as the one we're taking a page fault for, and if so return an error. Then we check lock ordering: if there's a lock ordering violation and trylock fails, we'll have to cycle the locks and return an error that tells the DIO path to retry: faults_disabled_mapping is also used for signalling "locks were dropped, please retry". Also relevant to this patch: mapping->invalidate_lock. mapping->invalidate_lock provides most of the required semantics - it's used by truncate/fallocate to block pages being added to the pagecache. However, since it's a rwsem, direct IOs would need to take the write side in order to block page cache adds, and would then be exclusive with each other - we'll need a new type of lock to pair with this approach. Signed-off-by: Kent Overstreet Cc: Jan Kara Cc: Darrick J. Wong Cc: linux-fsdevel@vger.kernel.org Cc: Andreas Grünbacher commit 12f34ed8622aafd3bbd9d8aa4550dcb7016ea1e6 Author: Kai Huang Date: Tue Aug 15 23:02:00 2023 +1200 x86/tdx: Extend TDX_MODULE_CALL to support more TDCALL/SEAMCALL leafs The TDX guest live migration support (TDX 1.5) adds new TDCALL/SEAMCALL leaf functions. Those new TDCALLs/SEAMCALLs take additional registers for input (R10-R13) and output (R12-R13). TDG.SERVTD.RD is an example. Also, the current TDX_MODULE_CALL doesn't aim to handle TDH.VP.ENTER SEAMCALL, which monitors the TDG.VP.VMCALL in input/output registers when it returns in case of VMCALL from TDX guest. With those new TDCALLs/SEAMCALLs and the TDH.VP.ENTER covered, the TDX_MODULE_CALL macro basically needs to handle the same input/output registers as the TDX_HYPERCALL does. And as a result, they also share similar logic in the assembly, thus should be unified to use one common assembly. Extend the TDX_MODULE_CALL asm to support the new TDCALLs/SEAMCALLs and also the TDH.VP.ENTER SEAMCALL. Eventually it will be unified with the TDX_HYPERCALL. The new input/output registers fit with the "callee-saved" registers in the x86 calling convention. Add a new "saved" parameter to support those new TDCALLs/SEAMCALLs and TDH.VP.ENTER and keep the existing TDCALLs/SEAMCALLs minimally impacted. For TDH.VP.ENTER, after it returns the registers shared by the guest contain guest's values. Explicitly clear them to prevent speculative use of guest's values. Note most TDX live migration related SEAMCALLs may also clobber AVX* state ("AVX, AVX2 and AVX512 state: may be reset to the architectural INIT state" -- see TDH.EXPORT.MEM for example). And TDH.VP.ENTER also clobbers XMM0-XMM15 when the corresponding bit is set in RCX. Don't handle them in the TDX_MODULE_CALL macro but let the caller save and restore when needed. This is basically based on Peter's code. Suggested-by: Peter Zijlstra Signed-off-by: Kai Huang Signed-off-by: Dave Hansen Reviewed-by: Kirill A. Shutemov Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/all/d4785de7c392f7c5684407f6c24a73b92148ec49.1692096753.git.kai.huang%40intel.com commit 57a420bb8186d1d0178b857e5dd5026093641654 Author: Kai Huang Date: Tue Aug 15 23:01:59 2023 +1200 x86/tdx: Pass TDCALL/SEAMCALL input/output registers via a structure Currently, the TDX_MODULE_CALL asm macro, which handles both TDCALL and SEAMCALL, takes one parameter for each input register and an optional 'struct tdx_module_output' (a collection of output registers) as output. This is different from the TDX_HYPERCALL macro which uses a single 'struct tdx_hypercall_args' to carry all input/output registers. The newer TDX versions introduce more TDCALLs/SEAMCALLs which use more input/output registers. Also, the TDH.VP.ENTER (which isn't covered by the current TDX_MODULE_CALL macro) basically can use all registers that the TDX_HYPERCALL does. The current TDX_MODULE_CALL macro isn't extendible to cover those cases. Similar to the TDX_HYPERCALL macro, simplify the TDX_MODULE_CALL macro to use a single structure 'struct tdx_module_args' to carry all the input/output registers. Currently, R10/R11 are only used as output register but not as input by any TDCALL/SEAMCALL. Change to also use R10/R11 as input register to make input/output registers symmetric. Currently, the TDX_MODULE_CALL macro depends on the caller to pass a non-NULL 'struct tdx_module_output' to get additional output registers. Similar to the TDX_HYPERCALL macro, change the TDX_MODULE_CALL macro to take a new 'ret' macro argument to indicate whether to save the output registers to the 'struct tdx_module_args'. Also introduce a new __tdcall_ret() for that purpose, similar to the __tdx_hypercall_ret(). Note the tdcall(), which is a wrapper of __tdcall(), is called by three callers: tdx_parse_tdinfo(), tdx_get_ve_info() and tdx_early_init(). The former two need the additional output but the last one doesn't. For simplicity, make tdcall() always call __tdcall_ret() to avoid another "_ret()" wrapper. The last caller tdx_early_init() isn't performance critical anyway. Suggested-by: Peter Zijlstra Signed-off-by: Kai Huang Signed-off-by: Dave Hansen Reviewed-by: Kirill A. Shutemov Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/all/483616c1762d85eb3a3c3035a7de061cfacf2f14.1692096753.git.kai.huang%40intel.com commit 5efb96289e581c187af1bc288ce5d26ed6181749 Author: Kai Huang Date: Tue Aug 15 23:01:58 2023 +1200 x86/tdx: Rename __tdx_module_call() to __tdcall() __tdx_module_call() is only used by the TDX guest to issue TDCALL to the TDX module. Rename it to __tdcall() to match its behaviour, e.g., it cannot be used to make host-side SEAMCALL. Also rename tdx_module_call() which is a wrapper of __tdx_module_call() to tdcall(). No functional change intended. Signed-off-by: Kai Huang Signed-off-by: Dave Hansen Reviewed-by: Kirill A. Shutemov Reviewed-by: Kuppuswamy Sathyanarayanan Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/all/785d20d99fbcd0db8262c94da6423375422d8c75.1692096753.git.kai.huang%40intel.com commit f0024dbfc48d8814d915eb5bd5253496b9b8a6df Author: Kai Huang Date: Tue Aug 15 23:01:57 2023 +1200 x86/tdx: Make macros of TDCALLs consistent with the spec The TDX spec names all TDCALLs with prefix "TDG". Currently, the kernel doesn't follow such convention for the macros of those TDCALLs but uses prefix "TDX_" for all of them. Although it's arguable whether the TDX spec names those TDCALLs properly, it's better for the kernel to follow the spec when naming those macros. Change all macros of TDCALLs to make them consistent with the spec. As a bonus, they get distinguished easily from the host-side SEAMCALLs, which all have prefix "TDH". No functional change intended. Signed-off-by: Kai Huang Signed-off-by: Dave Hansen Reviewed-by: Kirill A. Shutemov Reviewed-by: Kuppuswamy Sathyanarayanan Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/all/516dccd0bd8fb9a0b6af30d25bb2d971aa03d598.1692096753.git.kai.huang%40intel.com commit 03a423d40cb30e0e1cb77a801acb56ddb0bf6f5e Author: Kai Huang Date: Tue Aug 15 23:01:56 2023 +1200 x86/tdx: Skip saving output regs when SEAMCALL fails with VMFailInvalid If SEAMCALL fails with VMFailInvalid, the SEAM software (e.g., the TDX module) won't have chance to set any output register. Skip saving the output registers to the structure in this case. Also, as '.Lno_output_struct' is the very last symbol before RET, rename it to '.Lout' to make it short. Opportunistically make the asm directives unindented. Suggested-by: Peter Zijlstra Signed-off-by: Kai Huang Signed-off-by: Dave Hansen Reviewed-by: Kirill A. Shutemov Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/all/704088f5b4d72c7e24084f7f15bd1ac5005b7213.1692096753.git.kai.huang%40intel.com commit 5d092b66119d774853cc9308522620299048a662 Author: Kai Huang Date: Tue Aug 15 23:01:55 2023 +1200 x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro In the TDX_HYPERCALL asm, after the TDCALL instruction returns from the untrusted VMM, the registers that the TDX guest shares to the VMM need to be cleared to avoid speculative execution of VMM-provided values. RSI is specified in the bitmap of those registers, but it is missing when zeroing out those registers in the current TDX_HYPERCALL. It was there when it was originally added in commit 752d13305c78 ("x86/tdx: Expand __tdx_hypercall() to handle more arguments"), but was later removed in commit 1e70c680375a ("x86/tdx: Do not corrupt frame-pointer in __tdx_hypercall()"), which was correct because %rsi is later restored in the "pop %rsi". However a later commit 7a3a401874be ("x86/tdx: Drop flags from __tdx_hypercall()") removed that "pop %rsi" but forgot to add the "xor %rsi, %rsi" back. Fix by adding it back. Fixes: 7a3a401874be ("x86/tdx: Drop flags from __tdx_hypercall()") Signed-off-by: Kai Huang Signed-off-by: Dave Hansen Reviewed-by: Kuppuswamy Sathyanarayanan Reviewed-by: Kirill A. Shutemov Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/all/e7d1157074a0b45d34564d5f17f3e0ffee8115e9.1692096753.git.kai.huang%40intel.com commit 019b383d1132e4051de0d2e43254454b86538cf4 Author: Dexuan Cui Date: Thu Aug 10 19:12:45 2023 -0700 x86/tdx: Retry partially-completed page conversion hypercalls TDX guest memory is private by default and the VMM may not access it. However, in cases where the guest needs to share data with the VMM, the guest and the VMM can coordinate to make memory shared between them. The guest side of this protocol includes the "MapGPA" hypercall. This call takes a guest physical address range. The hypercall spec (aka. the GHCI) says that the MapGPA call is allowed to return partial progress in mapping this range and indicate that fact with a special error code. A guest that sees such partial progress is expected to retry the operation for the portion of the address range that was not completed. Hyper-V does this partial completion dance when set_memory_decrypted() is called to "decrypt" swiotlb bounce buffers that can be up to 1GB in size. It is evidently the only VMM that does this, which is why nobody noticed this until now. [ dhansen: rewrite changelog ] Signed-off-by: Dexuan Cui Signed-off-by: Dave Hansen Reviewed-by: Michael Kelley Reviewed-by: Kuppuswamy Sathyanarayanan Acked-by: Kirill A. Shutemov Link: https://lore.kernel.org/all/20230811021246.821-2-decui%40microsoft.com commit 0ed30d3fe2c771e12961f97d951cbd3f31a067aa Author: Mark Brown Date: Mon Sep 11 23:48:39 2023 +0100 ASoC: Update jh7110 PWM DAC for ops move For some reason the JH7110 PWM DAC driver made it through build testing in spite of not being updated for the move of probe() to the ops struct. Make the required update. Signed-off-by: Mark Brown commit 96daa9874211d5497aa70fa409b67afc29f0cb86 Author: Leon Hwang Date: Wed Sep 6 23:42:56 2023 +0800 selftests/bpf: Correct map_fd to data_fd in tailcalls Get and check data_fd. It should not check map_fd again. Meanwhile, correct some 'return' to 'goto out'. Thank the suggestion from Maciej in "bpf, x64: Fix tailcall infinite loop"[0] discussions. [0] https://lore.kernel.org/bpf/e496aef8-1f80-0f8e-dcdd-25a8c300319a@gmail.com/T/#m7d3b601066ba66400d436b7e7579b2df4a101033 Fixes: 79d49ba048ec ("bpf, testing: Add various tail call test cases") Fixes: 3b0379111197 ("selftests/bpf: Add tailcall_bpf2bpf tests") Fixes: 5e0b0a4c52d3 ("selftests/bpf: Test tail call counting with bpf2bpf and data on stack") Signed-off-by: Leon Hwang Reviewed-by: Maciej Fijalkowski Link: https://lore.kernel.org/r/20230906154256.95461-1-hffilwlqm@gmail.com Signed-off-by: Martin KaFai Lau commit fd811b62939f6d374546cfc25bbccb697a95519a Merge: fffae3afd6df9 d6c612a347401 Author: Mark Brown Date: Mon Sep 11 22:06:48 2023 +0100 spi: Use devm_clk_get_*() helper function to Merge series from Li Zetao : Commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks") provides a new helper function for prepared and enabled clocks when a driver keeps a clock prepared (or enabled) during the whole lifetime of the driver. So where drivers get clocks and enable them immediately, it can be combined into a single function devm_clk_get_*(). Moreover, the unprepare and disable function has been registered to devm_clk_state, and before devm_clk_state is released, the clocks will be unprepareed and disable, so it is unnecessary to unprepare and disable clocks explicitly when remove drivers or in the error handling path. commit 3597ea747638c64147951b7e2844a36e98120ed5 Merge: ecfca1fb9e227 ef01a6dec7f17 Author: Mark Brown Date: Mon Sep 11 22:39:09 2023 +0100 Match data improvements for wm8580 driver Merge series from Biju Das : This patch series aims to add match data improvements for wm8580 driver. This patch series is only compile tested. commit ecfca1fb9e2278e28c23a4f1318ce96f19db1b09 Merge: 0a69e8a6971c5 0307ba5420cd7 Author: Mark Brown Date: Mon Sep 11 22:39:00 2023 +0100 ASoC: Convert some Maxim codecs to use GPIO Merge series from Linus Walleij : The Maxim devices are pretty straight-forward to convert over to use GPIO descriptors, so let's do it. commit 0a69e8a6971c5e8ba2cd35e5bd0e9ec2d87da82d Merge: 966277df0ab6f c6d86149db94c Author: Mark Brown Date: Mon Sep 11 22:38:52 2023 +0100 Match data improvements for tlv320aic32x4 driver Merge series from Biju Das : This patch series aims to add match data improvements for tlv320aic32x4 driver. This patch series is only compile tested. commit 966277df0ab6f41618d38b6fe64391c6fbb50948 Merge: f3dbb935d27d3 ce22caa4a1f05 Author: Mark Brown Date: Mon Sep 11 22:38:44 2023 +0100 ASoC: Convert some Maxim codecs to use GPIO Merge series from Linus Walleij : The Maxim devices are pretty straight-forward to convert over to use GPIO descriptors, so let's do it. commit f3dbb935d27d3a29a7f281d650b014dc41eea124 Merge: 6a3af823c1ac2 1bce95deab841 Author: Mark Brown Date: Mon Sep 11 22:38:36 2023 +0100 ASoC: mt8188-mt6359: add SOF support Merge series from Trevor Wu : This series introduces dynamic pinctrl and adds support for the SOF on the mt8188-mt6359 machine driver. commit 6a3af823c1ac24ff0365622859e08347dbac97c7 Merge: dbef51669b9a2 d9e6a80a2c7be Author: Mark Brown Date: Mon Sep 11 22:38:28 2023 +0100 Match data improvements for ak4642 driver Merge series from Biju Das : This patch series aims to add match data improvements for ak4642 driver. This patch series is only compile tested. commit dbef51669b9a2f753ba67841a93c9de6d8c58288 Merge: 09d86dbf16fc0 54fcd9dd44b2c Author: Mark Brown Date: Mon Sep 11 22:38:20 2023 +0100 ASoC: amd: acp: Add sound support for a line of Merge series from Marian Postevca : This series adds support for a line of HUAWEI laptops with AMD CPUs that connect using the ACP3x module to a ES8336 CODEC. The CODEC driver must be extended to support the S32 LE format and the MCLK div by 2 option. MCLK div by 2 is needed for one specific SKU, which uses a 48Mhz MCLK, which seems to be too high of a frequency for the CODEC and must be divided by 2. The acp legacy driver must also be extended by using callbacks so that the more complicated handling of this specific CODEC can be moved outside the more generic ACP code. commit 09d86dbf16fc0fa33ad105c57a72008f575ab307 Merge: 5b772c61eb2c2 206b250c3e9be Author: Mark Brown Date: Mon Sep 11 22:38:11 2023 +0100 Improve CS35l41-based audio codec drivers Merge series from Cristian Ciocaltea : This patch series contains several fixes and improvements to drivers based on the CS35l41 audio codec. It has been verified on Valve's Steam Deck, except the HDA related patches. commit 5b772c61eb2c24e58554c5aadd18e94fbdac04cd Merge: e17e892dc8d14 d1802d59ab533 Author: Mark Brown Date: Mon Sep 11 22:37:52 2023 +0100 Add PWM-DAC audio support for StarFive JH7110 Merge series from Hal Feng : This patchset adds PWM-DAC audio support for the StarFive JH7110 SoC. The PWM-DAC module does not require a hardware codec, but a dummy codec is needed for the driver. The dummy spdif codec driver, which is already upstream, is compatible with the one which JH7110 PWM-DAC needed. So we use it as the dummy codec driver for the JH7110 PWM-DAC module. commit 86f2ec2265358fb1d7b76c7ffb86af6e04118388 Author: David Francis Date: Tue Sep 5 10:13:51 2023 -0400 drm/amdgpu: Handle null atom context in VBIOS info ioctl On some APU systems, there is no atom context and so the atom_context struct is null. Add a check to the VBIOS_INFO branch of amdgpu_info_ioctl to handle this case, returning all zeroes. Reviewed-by: Alex Deucher Signed-off-by: David Francis Signed-off-by: Alex Deucher commit ffde72107be547d71f8074afd4f1ef1252073f3b Author: André Almeida Date: Mon Sep 11 14:12:55 2023 -0300 drm/amdgpu: Create an option to disable soft recovery Create a module option to disable soft recoveries on amdgpu, making every recovery go through the device reset path. This option makes easier to force device resets for testing and debugging purposes. Signed-off-by: André Almeida Reviewed-by: Christian König Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 887db1e49a73bc48554a4959eb9679d3d6d90e4e Author: André Almeida Date: Mon Sep 11 14:12:54 2023 -0300 drm/amdgpu: Merge debug module parameters Merge all developer debug options available as separated module parameters in one, making it obvious that are for developers. Drop the obsolete module options in favor of the new ones. Signed-off-by: André Almeida Reviewed-by: Christian König Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit a10ea0ff90c1669c6a85ecb2438da19cc177b8b4 Author: Randy Dunlap Date: Sun Sep 10 16:44:50 2023 -0700 drm/amd/display: fix replay_mode kernel-doc warning Fix the typo in the kernel-doc for @replay_mode to prevent kernel-doc warnings: drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:623: warning: Incorrect use of kernel-doc format: * @replay mode: Replay supported drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:626: warning: Function parameter or member 'replay_mode' not described in 'amdgpu_hdmi_vsdb_info' Fixes: ec8e59cb4e0c ("drm/amd/display: Get replay info from VSDB") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Bhawanpreet Lakha Cc: Harry Wentland Cc: Alex Deucher Cc: Leo Li Cc: Rodrigo Siqueira Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 4738f30c2413fe6fae54aa18cff531476ea576fe Author: Jiapeng Chong Date: Fri Sep 8 15:54:45 2023 +0800 drm/amd/display: clean up some inconsistent indenting No functional modification involved. drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:2476 link_set_dpms_on() warn: if statement not indented. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6502 Signed-off-by: Jiapeng Chong Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 5cf43f2cc26e5dbd661d945deed1df4297633c6d Author: Ian Chen Date: Tue Aug 29 13:17:32 2023 +0800 drm/amd/display: add skip_implict_edp_power_control flag for dcn32 Add flag skip_implict_edp_power_control check in function dcn32_disable_link_output to fix DCN35 issue. Reviewed-by: Robin Chen Acked-by: Stylon Wang Signed-off-by: Ian Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 83b5b7bb867318211f99784b7a7d97b2350ca02c Author: Wenjing Liu Date: Thu Aug 24 15:39:13 2023 -0400 drm/amd/display: minior logging improvements [how] - Add minimial transition log with reason and base state. - Do not log set dpms interfaces for virtual signal in stream. Reviewed-by: Dillon Varone Acked-by: Stylon Wang Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 18aa989ae191e392529370f194bb7b1558846af8 Author: Wenjing Liu Date: Thu Aug 24 14:21:11 2023 -0400 drm/amd/display: do not skip ODM minimal transition based on new state [why] During 8k video plane resizing we could transition from MPC combine mode back to ODM combine 2:1 + 8k video plane. In this transition minimal transition state is based on new state with ODM combine enabled. We are skipping this and it causes corruption because we have to reassign a current DPP pipe to a different MPC blending tree which is not supported seamlessly. Reviewed-by: Dillon Varone Acked-by: Stylon Wang Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3a2c0eccab9ade6d2c977113ba637a10bcfcd612 Author: Wenjing Liu Date: Thu Aug 24 19:50:16 2023 -0400 drm/amd/display: move odm power optimization decision after subvp optimization [why] ODM power optimization excludes subvp power optimization but subvp optimization can override ODM power optimization even if subvp optimization configuration is not found. This happens with 4k144hz + 1 5k desktop plane. We could have applied ODM power optimization however this is overridden by subvp but subvp ends up deciding not apply its optimization. [how] Move ODM power optimization decision after subvp so it will try ODM power optimization after subvp optimization is not possible. Reviewed-by: Dillon Varone Acked-by: Stylon Wang Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 15c6798ae26d5c7a7776f4f7d0c1fa8c462688a2 Author: Wenjing Liu Date: Thu Aug 24 17:08:48 2023 -0400 drm/amd/display: add seamless pipe topology transition check [why] We have a few cases where we need to perform update topology update in dc update interface. However some of the updates are not seamless This could cause user noticible glitches. To enforce seamless transition we are adding a checking condition and error logging so the corruption as result of non seamless transition can be easily spotted. Reviewed-by: Dillon Varone Acked-by: Stylon Wang Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c8b249a783488355f98db3b13137ce71cc869c96 Author: Aric Cyr Date: Sun Aug 27 15:07:35 2023 -0400 drm/amd/display: 3.2.250 Acked-by: Stylon Wang Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7f7925e258288cfcfa2b0e0631fcd91a39744f94 Author: Muhammad Ahmed Date: Wed Aug 23 19:25:25 2023 -0400 drm/amd/display: Fix MST recognizes connected displays as one [What] MST now recognizes both connected displays Reviewed-by: Charlene Liu Acked-by: Stylon Wang Signed-off-by: Muhammad Ahmed Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a6db1993c18bc2138a85227bb28b69c82cbe722b Author: Charlene Liu Date: Fri Aug 25 15:04:46 2023 -0400 drm/amd/display: fix some non-initialized register mask and setting [why] fix some non-initialized register mask and update golden setting Reviewed-by: Duncan Ma Acked-by: Stylon Wang Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c06ef68a794619576a378d4e19cc6ef94fa03b62 Author: Austin Zheng Date: Fri Aug 25 10:51:49 2023 -0400 drm/amd/display: Add check for vrr_active_fixed Why: vrr_active_fixed should also be checked when determining if DRR is in use How: Add check for vrr_active_fixed when allow_freesync and vrr_active_variable are also checked Reviewed-by: Alvin Lee Acked-by: Stylon Wang Signed-off-by: Austin Zheng Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9aa75e3baadb9b02fb81c18dc7c361c54aad57b6 Author: Sridevi Arvindekar Date: Thu Aug 24 19:20:30 2023 -0400 drm/amd/display: dc cleanup for tests [WHY&HOW] Code cleanup found in internal tests Reviewed-by: Dillon Varone Acked-by: Stylon Wang Signed-off-by: Sridevi Arvindekar Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0e64c9aad031391139c7553ce0e208486a742d55 Author: Yifan Zhang Date: Wed Sep 6 17:34:16 2023 +0800 drm/amdgpu: add type conversion for gc info gc info usage misses type conversion. Acked-by: Alex Deucher Signed-off-by: Yifan Zhang Reviewed-by: Li Ma Signed-off-by: Alex Deucher commit 1a2ab18c8f039babbd40427935be36c6d4344224 Author: Qingqing Zhuo Date: Tue Aug 1 21:49:32 2023 -0400 drm/amd/display: Drop unused registers [Why & How] Some registers are never used in the driver but defined. Remove them. Reviewed-by: Roman Li Acked-by: Stylon Wang Signed-off-by: Qingqing Zhuo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8e6302ebedd30a3990c6b9b9a9a51252abcd5d87 Author: Dillon Varone Date: Thu Aug 24 12:19:21 2023 -0400 drm/amd/display: add dp dto programming function to dccg [WHY&HOW] Add support for programming dp dto via dccg. Reviewed-by: Jun Lei Acked-by: Stylon Wang Signed-off-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 77aac4c2801f44dd9124713832727dcca13ce75e Author: Wenjing Liu Date: Wed Aug 23 13:26:35 2023 -0400 drm/amd/display: only allow ODM power optimization if surface is within guaranteed viewport size [why] Current dc update design has limitation to support transition from ODM combine to minimum transition to MPC combine state seamlessly at the capability boundary when MPO plane is resizing. This will require dc update high level refactor in order to remove the design limitation. The decision is to block such use case for existing products by limiting ODM power optimization support for only those surfaces within guaranteed viewport size. This will prevent us from transitioning to MPC combine state when ODM power optimization is enabled. Reviewed-by: Dillon Varone Acked-by: Stylon Wang Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c51d87202d1faef21e1eee37381b43c72bd231bc Author: Wenjing Liu Date: Wed Aug 23 13:19:27 2023 -0400 drm/amd/display: do not attempt ODM power optimization if minimal transition doesn't exist [why] In some cases such as 8k desktop surface with 144Hz timing, we decide to enable ODM power optimization but this surface doesn't have a minimum transition state. Therefore we cannot switch off ODM power optimization seamlessly This creates path depedency on ODM power optimization decision. i.e whether or not we should switch off ODM power optimization is dependent on if the transition to switch off ODM power optimization from current state is seamless. We don't desire a path dependent power optimization policy as it is too dynamic and difficult to maintain. [how] Attempt ODM power optimization only after we can validate new state without using pipe combine. Reviewed-by: Dillon Varone Acked-by: Stylon Wang Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c30406623422b9ddc77f55e94dcd5171bd5cc106 Author: Wenjing Liu Date: Wed Aug 23 13:09:23 2023 -0400 drm/amd/display: remove a function that does complex calculation in every frame but not used [why] The result of predict_pipe_split calculation is no longer used but the function is not removed. This will cause unnecessary calculation of pipe split prediction in every frame update. Reviewed-by: Dillon Varone Acked-by: Stylon Wang Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e379162adf890a72fce2fc898111478854254975 Author: David Francis Date: Tue Nov 22 15:14:32 2022 -0500 drm/amdkfd: Checkpoint and restore queues on GFX11 The code in kfd_mqd_manager_v11.c to support criu dump and restore of queue state was missing. Added it; should be equivalent to kfd_mqd_manager_v10.c. CC: Felix Kuehling Reviewed-by: Harish Kasiviswanathan Acked-by: Alex Deucher Signed-off-by: David Francis Signed-off-by: Alex Deucher commit 42ab1cfed03a3248cd98ca1708f6d7520c606b27 Author: Aurabindo Pillai Date: Wed Aug 23 18:15:51 2023 -0400 drm/amd/display: Add DCHUBBUB callback to report MALL status [Why&How] For enabling automated testing, add a hook to DCHUBBUB interface so that mall status can be queried by userspace through debugfs. This removes dependence on requiring a userspace tool like UMR for querying status for MALL static screen IGT test. Reviewed-by: Alvin Lee Acked-by: Stylon Wang Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 77ad5f6febdc17f4d06bf0b163b8612823e58d74 Author: Ethan Bitnun Date: Thu Aug 24 12:01:44 2023 -0400 drm/amd/display: Add new logs for AutoDPMTest [Description] - Add new logs to be used by the AutoDPMTest - Enclose AutoDPMTest logs in settings - Add logging definition Reviewed-by: Alvin Lee Acked-by: Stylon Wang Signed-off-by: Ethan Bitnun Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit fae058b4d8564714d08db7ccae12b2c10dde3bef Author: Paul Hsieh Date: Tue Aug 22 22:55:13 2023 +0800 drm/amd/display: support main link off before specific vertical line [Why] Some panels request main link off before specific vertical line. If source turn off main link after specific vertical line then panel defect will be exposed. [How] Add interface to support turn off main link before specific vertical line Reviewed-by: Robin Chen Acked-by: Stylon Wang Signed-off-by: Paul Hsieh Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 73c57a0aa7f672110d3f28c0ac03ec778a21d9d4 Author: Wayne Lin Date: Tue Aug 22 16:03:17 2023 +0800 drm/amd/display: Adjust the MST resume flow [Why] In drm_dp_mst_topology_mgr_resume() today, it will resume the mst branch to be ready handling mst mode and also consecutively do the mst topology probing. Which will cause the dirver have chance to fire hotplug event before restoring the old state. Then Userspace will react to the hotplug event based on a wrong state. [How] Adjust the mst resume flow as: 1. set dpcd to resume mst branch status 2. restore source old state 3. Do mst resume topology probing For drm_dp_mst_topology_mgr_resume(), it's better to adjust it to pull out topology probing work into a 2nd part procedure of the mst resume. Will have a follow up patch in drm. Reviewed-by: Chao-kai Wang Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Stylon Wang Signed-off-by: Wayne Lin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 48468787c2b029e5c9f8abef777cd065647abf2e Author: Mustapha Ghaddar Date: Tue Aug 22 16:18:03 2023 -0400 drm/amd/display: Fix 2nd DPIA encoder Assignment [HOW & Why] There seems to be an issue with 2nd DPIA acquiring link encoder for tiled displays. Solution is to remove check for eng_id before we get first dynamic encoder for it Reviewed-by: Cruise Hung Reviewed-by: Meenakshikumar Somasundaram Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Acked-by: Stylon Wang Signed-off-by: Mustapha Ghaddar Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 68fa72a437ea3b8ad6dd1d03247fcd670b8717c1 Author: Mukul Joshi Date: Wed Sep 6 11:01:55 2023 -0400 drm/amdgpu: Rename KGD_MAX_QUEUES to AMDGPU_MAX_QUEUES Rename KGD_MAX_QUEUES to AMDGPU_MAX_QUEUES to conform with the naming convention followed in amdgpu_gfx.h. No functional change. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 26e5817e39dc15facb0ba41bd2cdaaa92ee95748 Author: Wenjing Liu Date: Tue Aug 22 19:42:04 2023 -0400 drm/amd/display: do not block ODM + OPM on one side of the screen [why] build scaling param is overriding validation policy regarding small viewport support. Even if ODM + windowed MPO is not supported. The decision has to be made at the time of validation. When building scaling params, we might be building an initial dc state as an input to DML validation. The initial state is not supposed to be always valid and we rely on DML to modify the initial dc state and determine the final validation result. This check is pre judging validation result when building the initial dc state. This causes an issue where we are transitioning from desktop only ODM combine 2:1 to ODM bypass with 2 planes. In this case we are building an initial state with with ODM 2:1 combine + 2 planes. This is indeed not supported but DML is about to modify the state so it no longer uses ODM combine. Before it reaches DML, dc resource already fails validation because it checks that the initial state is not supported by our policy. This overrides the ODM decision to validate this state with ODM combine disabled. Therefore causes an unexpected validation failure when the secondary plane is added on one side of the screen. Reviewed-by: Dillon Varone Acked-by: Stylon Wang Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d074e0f9ec57e6de09b06b24d208fefee222050f Author: Nicholas Susanto Date: Fri Jul 21 14:45:34 2023 -0400 drm/amd/display: Fix DML calculation errors [Why] DML calculations differ with DCN3.1 spreadsheet values due to translations errors from the visual basic code [How] Add missing calculations that set the value for DSCDelay Reviewed-by: Nicholas Kazlauskas Reviewed-by: Jun Lei Acked-by: Stylon Wang Signed-off-by: Nicholas Susanto Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ced575203a50d7de71b0839fe28284eee0e50f23 Author: Tao Zhou Date: Wed Sep 6 15:49:41 2023 +0800 drm/amdgpu: print more address info of UMC bad page Print out row, column and bank value of UMC error address for UMC v12. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9f9d4651f70e43df76614634670c02b99cfee57e Author: Hawking Zhang Date: Fri Sep 8 21:21:55 2023 +0800 drm/amdgpu: fallback to old RAS error message for aqua_vanjaram So driver doesn't generate incorrect message until the new format is settled down for aqua_vanjaram Signed-off-by: Hawking Zhang Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit 6a82822b902c50efc7218979b01f43c9a97470f4 Author: Alex Deucher Date: Thu Sep 7 15:44:54 2023 -0400 drm/amdgpu/nbio4.3: set proper rmmio_remap.reg_offset for SR-IOV Needed for HDP flush to work correctly. Reviewed-by: Timmy Tsai Signed-off-by: Alex Deucher commit 8a6e26e7efd5b04a529bbb2f028b7dee1dda5a2d Author: Alex Deucher Date: Wed Sep 6 11:35:04 2023 -0400 drm/amdgpu/soc21: don't remap HDP registers for SR-IOV This matches the behavior for soc15 and nv. Acked-by: Christian König Reviewed-by: Timmy Tsai Signed-off-by: Alex Deucher commit 74875440eba9a9628afc85d221db480b38233455 Author: Anthony Koo Date: Sat Aug 19 12:02:25 2023 -0400 drm/amd/display: [FW Promotion] Release 0.0.181.0 - Add new params to dmub_feature_caps for checking replay support in FW Acked-by: Stylon Wang Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2aa4c11f7ddf6f50af16121e9ab95980c7e65f0f Author: Swapnil Patel Date: Thu Aug 17 14:04:26 2023 -0400 drm/amd/display: Don't check registers, if using AUX BL control [Why] Currently the driver looks DCN registers to access if BL is on or not. This check is not valid if we are using AUX based brightness control. This causes driver to not send out "backlight off" command during power off sequence as it already thinks it is off. [How] Only check DCN registers if we aren't using AUX based brightness control. Reviewed-by: Wenjing Liu Acked-by: Stylon Wang Signed-off-by: Swapnil Patel Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b3b186852846d5526134248cdddef004d831998f Author: Dan Carpenter Date: Wed Sep 6 13:54:38 2023 +0300 drm/amdgpu: fix retry loop test This loop will exit with "retry" set to -1 if it fails but the code checks for if "retry" is zero. Fix this by changing post-op to a pre-op. --retry vs retry--. Fixes: e01eeffc3f86 ("drm/amd/pm: avoid driver getting empty metrics table for the first time") Reviewed-by: Evan Quan Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher commit b6c22668a898c326740412a2913c8c4154d7bae6 Author: Bhawanpreet Lakha Date: Tue Aug 22 10:02:46 2023 -0400 drm/amd/display: Add dirty rect support for Replay Dirty rect can be used with replay, so enable them to allow for more powersaving. Reviewed-by: Sun peng Li Acked-by: Stylon Wang Signed-off-by: Bhawanpreet Lakha Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e9981e8e751330cb5aa43d06f2aec080807717e8 Author: Aurabindo Pillai Date: Fri Aug 18 13:36:06 2023 -0400 drm/amd/display: set default return value for ODM Combine debugfs [Why&How] Set a default return value of -ENOTSUPP to indicate that the hardware does not support querying ODM Combine mode. Reviewed-by: Rodrigo Siqueira Acked-by: Stylon Wang Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 601c63ad8e551b2282e94f0a81779e9ae5c8100e Author: Hamza Mahfooz Date: Fri Sep 8 10:36:44 2023 -0400 Revert "drm/amd: Disable S/G for APUs when 64GB or more host memory" This reverts commit 70e64c4d522b732e31c6475a3be2349de337d321. Since, we now have an actual fix for this issue, we can get rid of this workaround as it can cause pin failures if enough VRAM isn't carved out by the BIOS. Cc: stable@vger.kernel.org # 6.1+ Acked-by: Harry Wentland Reviewed-by: Alex Deucher Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit a4246c63516600ce6feb4e2ee2124b8796f7a664 Author: Yifan Zhang Date: Fri Sep 8 16:46:39 2023 +0800 drm/amd/display: fix the white screen issue when >= 64GB DRAM Dropping bit 31:4 of page table base is wrong, it makes page table base points to wrong address if phys addr is beyond 64GB; dropping page_table_start/end bit 31:4 is unnecessary since dcn20_vmid_setup will do that. Also, while we are at it, cleanup the assignments using upper_32_bits()/lower_32_bits() and AMDGPU_GPU_PAGE_SHIFT. Cc: stable@vger.kernel.org Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2354 Fixes: 81d0bcf99009 ("drm/amdgpu: make display pinning more flexible (v2)") Acked-by: Harry Wentland Reviewed-by: Alex Deucher Signed-off-by: Yifan Zhang Co-developed-by: Hamza Mahfooz Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit cbb4c9bc55427774ca4d819933e1b5fa38a6fb44 Author: Alvin Lee Date: Wed Aug 23 10:18:36 2023 -0400 drm/amd/display: Don't lock phantom pipe on disabling [Description] - When disabling a phantom pipe, we first enable the phantom OTG so the double buffer update can successfully take place - However, want to avoid locking the phantom otherwise setting DPG_EN=1 for the phantom pipe is blocked (without this we could hit underflow due to phantom HUBP being blanked by default) Reviewed-by: Samson Tam Acked-by: Stylon Wang Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e87a6c5b7780b5f423797351eb586ed96cc6d151 Author: Alvin Lee Date: Tue Aug 8 13:21:58 2023 -0400 drm/amd/display: Blank phantom OTG before enabling [Description] Before enabling the phantom OTG for an update we must enable DPG to avoid underflow. Reviewed-by: Samson Tam Acked-by: Stylon Wang Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f4fa8fcd25cb771ef5c6955801f364c9eb0f6e38 Author: Mukul Joshi Date: Tue Aug 22 11:35:25 2023 -0400 drm/amdkfd: Update CU masking for GFX 9.4.3 The CU mask passed from user-space will change based on different spatial partitioning mode. As a result, update CU masking code for GFX9.4.3 to work for all partitioning modes. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 610cc82b1fd2830d573c6bd39106353742b6d45f Author: Mukul Joshi Date: Fri Aug 25 12:18:06 2023 -0400 drm/amdkfd: Update cache info reporting for GFX v9.4.3 Update cache info reporting in sysfs to report the correct number of CUs and associated cache information based on different spatial partitioning modes. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3cb9ebc9d652a874ab315eeac59bbe5950987db9 Author: Tao Zhou Date: Wed Jul 26 15:42:26 2023 +0800 drm/amdgpu: add channel index table for UMC v12 Get UMC phyical channel index according to node id, umc instance and channel instance. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit df38fe12a22c5d9a6f4cb86ddcc853a234d3756d Author: Yang Wang Date: Fri Sep 8 11:26:42 2023 +0800 drm/amd/pm: enable smu_v13_0_6 mca debug mode when UMC RAS feature is enabled v1: enable smu_v13_0_6 mca debug mode when UMC RAS feature is enabled. v2: use amdgpu_ras_is_supported() helper function instead bitmask check. Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 174a33e470bfff743b6886e78ae042e520d4f29b Author: Yang Wang Date: Fri Sep 8 11:26:22 2023 +0800 drm/amd/pm: update smu_v13_0_6 smu header update smu firmware header to support smu mca debug feature. Signed-off-by: Yang Wang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 40a08fe890640f9c61d4443c218b61f745b11b2d Author: Tao Zhou Date: Wed May 17 14:20:46 2023 +0800 drm/amdgpu: add address conversion for UMC v12 Convert MCA error address to physical address and find out all pages in one physical row. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit ca7aa3bf31dc7539af950e7c99c330aa3e9b2a0b Author: Lijo Lazar Date: Wed Sep 6 16:48:38 2023 +0530 drm/amdgpu: Use default reset method handler When reset method is not passed in reset context, look for the handler for default reset method. On Aldebaran, default reset method for SOCs connected to CPU over XGMI is MODE2. Signed-off-by: Lijo Lazar Reviewed-by: Asad Kamal Tested-by: Asad Kamal Signed-off-by: Alex Deucher commit f705a6f021b1ab1d2dd0f82e3d369e0feeb2b123 Author: Mukul Joshi Date: Fri Aug 25 11:59:09 2023 -0400 drm/amdgpu: Store CU info from all XCCs for GFX v9.4.3 Currently, we store CU info only for a single XCC assuming that it is the same for all XCCs. However, that may not be true. As a result, store CU info for all XCCs. This info is later used for CU masking. Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a1ce3e1f7c16c183486b108d80138b8f4cba1dc4 Author: Ma Jun Date: Wed Aug 30 14:11:30 2023 +0800 drm/amd: Fix the flag setting code for interrupt request [1] Remove the irq flags setting code since pci_alloc_irq_vectors() handles these flags. [2] Free the msi vectors in case of error. Signed-off-by: Ma Jun Acked-by: Christian König Signed-off-by: Alex Deucher commit 082acfe39cb0090e97bf27057d0efdf1e89abbef Author: Matthew Wilcox (Oracle) Date: Tue Aug 22 21:04:02 2023 +0100 rcu: Describe listRCU read-side guarantees More explicitly state what is, and what is not guaranteed to those who iterate a list while protected by RCU. [ paulmck: Apply Joel Fernandes feedback. ] Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit dbb805215177ce49f37c00c4f026a62eebec19dc Author: Lang Yu Date: Wed Sep 6 19:15:45 2023 +0800 drm/amdgpu: fix unsigned error codes Fixes: 5d5eac7e8303 ("drm/amdgpu: add selftest framework for UMSCH") Signed-off-by: Lang Yu Reviewed-by: Alex Deucher Reported-by: Dan Carpenter Link: https://lore.kernel.org/all/ZPhddADtKmOuVyDq@lang-desktop Signed-off-by: Alex Deucher commit ebbb9d35fd8497591760779b3d5275fb4ce0e50d Author: Wei Zhang Date: Tue Aug 8 23:58:11 2023 +0800 Documentation: RCU: Fix section numbers after adding Section 7 in whatisRCU.rst Signed-off-by: Wei Zhang Reviewed-by: Randy Dunlap Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit fe2b83007385979b42e914adbe3adc22921e1113 Author: Mukul Joshi Date: Tue Aug 29 12:06:09 2023 -0400 drm/amdkfd: Fix unaligned 64-bit doorbell warning This patch fixes the following unaligned 64-bit doorbell warning seen when submitting packets on HIQ on GFX v9.4.3 by making the HIQ doorbell 64-bit aligned. The warning is seen when GPU is loaded in any mode other than SPX mode. [ +0.000301] ------------[ cut here ]------------ [ +0.000003] Unaligned 64-bit doorbell [ +0.000030] WARNING: /amdkfd/kfd_doorbell.c:339 write_kernel_doorbell64+0x72/0x80 [ +0.000003] RIP: 0010:write_kernel_doorbell64+0x72/0x80 [ +0.000004] RSP: 0018:ffffc90004287730 EFLAGS: 00010246 [ +0.000005] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 [ +0.000003] RDX: 0000000000000001 RSI: ffffffff82837c71 RDI: 00000000ffffffff [ +0.000003] RBP: ffffc90004287748 R08: 0000000000000003 R09: 0000000000000001 [ +0.000002] R10: 000000000000001a R11: ffff88a034008198 R12: ffffc900013bd004 [ +0.000003] R13: 0000000000000008 R14: ffffc900042877b0 R15: 000000000000007f [ +0.000003] FS: 00007fa8c7b62000(0000) GS:ffff889f88400000(0000) knlGS:0000000000000000 [ +0.000004] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ +0.000003] CR2: 000056111c45aaf0 CR3: 00000001414f2002 CR4: 0000000000770ee0 [ +0.000003] PKRU: 55555554 [ +0.000002] Call Trace: [ +0.000004] [ +0.000006] kq_submit_packet+0x45/0x50 [amdgpu] [ +0.000524] pm_send_set_resources+0x7f/0xc0 [amdgpu] [ +0.000500] set_sched_resources+0xe4/0x160 [amdgpu] [ +0.000503] start_cpsch+0x1c5/0x2a0 [amdgpu] [ +0.000497] kgd2kfd_device_init.cold+0x816/0xb42 [amdgpu] [ +0.000743] amdgpu_amdkfd_device_init+0x15f/0x1f0 [amdgpu] [ +0.000602] amdgpu_device_init.cold+0x1813/0x2176 [amdgpu] [ +0.000684] ? pci_bus_read_config_word+0x4a/0x80 [ +0.000012] ? do_pci_enable_device+0xdc/0x110 [ +0.000008] amdgpu_driver_load_kms+0x1a/0x110 [amdgpu] [ +0.000545] amdgpu_pci_probe+0x197/0x400 [amdgpu] Fixes: c31866651086 ("drm/amdgpu: use doorbell mgr for kfd kernel doorbells") Signed-off-by: Mukul Joshi Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 56d6daa3c743ab48d2f747d9373bfc4db0c8fd5a Author: Mukul Joshi Date: Mon Aug 28 14:18:23 2023 -0400 drm/amdkfd: Fix reg offset for setting CWSR grace period This patch fixes the case where the code currently passes absolute register address and not the reg offset, which HWS expects, when sending the PM4 packet to set/update CWSR grace period. Additionally, cleanup the signature of build_grace_period_packet_info function as it no longer needs the inst parameter. Signed-off-by: Mukul Joshi Reviewed-by: Jonathan Kim Signed-off-by: Alex Deucher commit 8a4c0c90f2796fd3ac96326e8e2f8b13f7bdc99c Author: Paul E. McKenney Date: Wed Aug 16 11:29:05 2023 -0700 doc: Add refscale.lookup_instances to kernel-parameters.txt This commit adds refscale.lookup_instances to kernel-parameters.txt. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit d6fea1dde2064c8f298dbe872587c7ace7701b3f Author: Paul E. McKenney Date: Wed Aug 16 11:27:26 2023 -0700 refscale: Print out additional module parameters The refscale.verbose_batched and refscale.lookup_instances module parameters are omitted from the ref_scale_print_module_parms() beginning-of-test output. This commit therefore adds them. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 730c3ed4ba30feadfb20b4d4d18e869bc00348f6 Author: Paul E. McKenney Date: Tue Aug 1 09:30:18 2023 -0700 refscale: Fix misplaced data re-read This commit fixes a misplaced data re-read in the typesafe code. The reason that this was not noticed is that this is a performance test with no writers, so a mismatch could not occur. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit fffae3afd6df9c5e0bfcba18dccdb04a9b907f51 Merge: 7a4feff714c74 ee0f793cc1881 Author: Mark Brown Date: Mon Sep 11 21:52:11 2023 +0100 spi: switch to use modern name (part3) Merge series from Yang Yingliang : I'm trying to rename the legacy name to modern name used in SPI drivers, this is part3 patchset. After introducing devm_spi_alloc_host/spi_alloc_host(), the legacy named function devm_spi_alloc_master/spi_alloc_master() can be replaced. And also change other legacy name master/slave to modern name host/target or controller. Each patch compile test passed. commit 0325e8a1282dfd30c3e44928c6384bb978649c63 Author: Jiapeng Chong Date: Thu Aug 3 16:06:59 2023 +0800 rcu-tasks: Make rcu_tasks_lazy_ms static The rcu_tasks_lazy_ms variable is not used outside the file tasks.h, so this commit marks it static. kernel/rcu/tasks.h:1085:5: warning: symbol 'rcu_tasks_lazy_ms' was not declared. Should it be static? Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6086 Signed-off-by: Jiapeng Chong Reviewed-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit e62d8ae4620865411d1b2347980aa28ccf891a3d Author: Paul E. McKenney Date: Wed Aug 2 13:42:00 2023 -0700 rcu-tasks: Pull sampling of ->percpu_dequeue_lim out of loop The rcu_tasks_need_gpcb() samples ->percpu_dequeue_lim as part of the condition clause of a "for" loop, which is a bit confusing. This commit therefore hoists this sampling out of the loop, using the result loaded in the condition clause. So why does this work in the face of a concurrent switch from single-CPU queueing to per-CPU queueing? o The call_rcu_tasks_generic() that makes the change has already enqueued its callback, which means that all of the other CPU's callback queues are empty. o For the call_rcu_tasks_generic() that first notices the switch to per-CPU queues, the smp_store_release() used to update ->percpu_enqueue_lim pairs with the raw_spin_trylock_rcu_node()'s full barrier that is between the READ_ONCE(rtp->percpu_enqueue_shift) and the rcu_segcblist_enqueue() that enqueues the callback. o Because this CPU's queue is empty (unless it happens to be the original single queue, in which case there is no need for synchronization), this call_rcu_tasks_generic() will do an irq_work_queue() to schedule a handler for the needed rcuwait_wake_up() call. This call will be ordered after the first call_rcu_tasks_generic() function's change to ->percpu_dequeue_lim. o This rcuwait_wake_up() will either happen before or after the set_current_state() in rcuwait_wait_event(). If it happens before, the "condition" argument's call to rcu_tasks_need_gpcb() will be ordered after the original change, and all callbacks on all CPUs will be visible. Otherwise, if it happens after, then the grace-period kthread's state will be set back to running, which will result in a later call to rcuwait_wait_event() and thus to rcu_tasks_need_gpcb(), which will again see the change. So it all works out. Suggested-by: Linus Torvalds Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 92a708dc1fb8c33b0017ad77dc7ff6e434f96ee2 Author: Paul E. McKenney Date: Thu Jul 27 13:13:46 2023 -0700 rcu-tasks: Add printk()s to localize boot-time self-test hang Currently, rcu_tasks_initiate_self_tests() prints a message and then initiates self tests on up to three different RCU Tasks flavors. If one of the flavors has a grace-period hang, it is not easy to work out which of the three hung. This commit therefore prints a message prior to each individual test. Reported-by: Guenter Roeck Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit b96e7a5fa0ba9cda32888e04f8f4bac42d49a7f8 Author: Joel Fernandes (Google) Date: Tue Sep 5 00:02:11 2023 +0000 rcu/tree: Defer setting of jiffies during stall reset There are instances where rcu_cpu_stall_reset() is called when jiffies did not get a chance to update for a long time. Before jiffies is updated, the CPU stall detector can go off triggering false-positives where a just-started grace period appears to be ages old. In the past, we disabled stall detection in rcu_cpu_stall_reset() however this got changed [1]. This is resulting in false-positives in KGDB usecase [2]. Fix this by deferring the update of jiffies to the third run of the FQS loop. This is more robust, as, even if rcu_cpu_stall_reset() is called just before jiffies is read, we would end up pushing out the jiffies read by 3 more FQS loops. Meanwhile the CPU stall detection will be delayed and we will not get any false positives. [1] https://lore.kernel.org/all/20210521155624.174524-2-senozhatsky@chromium.org/ [2] https://lore.kernel.org/all/20230814020045.51950-2-chenhuacai@loongson.cn/ Tested with rcutorture.cpu_stall option as well to verify stall behavior with/without patch. Tested-by: Huacai Chen Reported-by: Binbin Zhou Closes: https://lore.kernel.org/all/20230814020045.51950-2-chenhuacai@loongson.cn/ Suggested-by: Paul McKenney Cc: Sergey Senozhatsky Cc: Thomas Gleixner Cc: stable@vger.kernel.org Fixes: a80be428fbc1 ("rcu: Do not disable GP stall detection in rcu_cpu_stall_reset()") Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 7c1b3e0c988f2902695ef6175ab8ad00c0e8b65f Author: Paul E. McKenney Date: Tue Aug 15 15:53:32 2023 -0700 rcutorture: Add test of RCU CPU stall notifiers This commit registers an RCU CPU stall notifier when testing RCU CPU stalls. The notifier logs a message similar to the following: rcu_torture_stall_nf: v=1, duration=21001. Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 14aaccbd34e93c0bbaaf475d174ece170f10f694 Author: Baruch Siach Date: Thu Aug 31 15:36:55 2023 +0300 clk: gate: fix comment typo and grammar Change ouput -> output. While at it change also grammatically incorrect "it's" to "its". Signed-off-by: Baruch Siach Link: https://lore.kernel.org/r/d47978a09dd0320f9929a19fa3e829608a02b224.1693485415.git.baruch@tkos.co.il Signed-off-by: Stephen Boyd commit f2af7cb8ac0f825b415b4846a526bddba68807b1 Author: Stephen Boyd Date: Fri Sep 8 17:07:02 2023 -0700 clk: asm9620: Remove 'hw' local variable that isn't checked The 'hw' pointer local variable in this function became unused after commit f5290d8e4f0c ("clk: asm9260: use parent index to link the reference clock"). Remove it to silence an unused but set variable warning. drivers/clk/clk-asm9260.c:258:17: warning: variable 'hw' set but not used [-Wunused-but-set-variable] struct clk_hw *hw, *pll_hw; ^ 1 warning generated. Cc: Dmitry Baryshkov Fixes: f5290d8e4f0c ("clk: asm9260: use parent index to link the reference clock") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309042014.IWERPl09-lkp@intel.com/ Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20230909000703.3478902-1-sboyd@kernel.org commit 5b404fdabacf4bee92d8c66013402a85f18a6a10 Author: Paul E. McKenney Date: Tue Aug 15 15:46:32 2023 -0700 rcu: Add RCU CPU stall notifier It is sometimes helpful to have a way for the subsystem causing the stall to dump its state when an RCU CPU stall occurs. This commit therefore bases rcu_stall_chain_notifier_register() and rcu_stall_chain_notifier_unregister() on atomic notifiers in order to provide this functionality. Signed-off-by: Paul E. McKenney Cc: Steven Rostedt Signed-off-by: Frederic Weisbecker commit 243d5ab34446854ceca55146fc0d837655657f8e Author: Zhen Lei Date: Mon Jul 24 10:26:51 2023 +0800 rcu: Eliminate check_cpu_stall() duplicate code The code and comments of self-detected and other-detected RCU CPU stall warnings are identical except the output function. This commit therefore refactors so as to consolidate the duplicate code. Signed-off-by: Zhen Lei Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit f3efe02fd56e2498ad8da4c4f444a34aa1456a46 Author: Zhen Lei Date: Wed Jul 12 23:15:57 2023 +0800 rcu: Don't redump the stalled CPU where RCU GP kthread last ran The stacks of all stalled CPUs will be dumped in rcu_dump_cpu_stacks(). If the CPU on where RCU GP kthread last ran is stalled, its stack does not need to be dumped again. We can search the corresponding backtrace based on the printed CPU ID. For example: [ 87.328275] rcu: rcu_sched kthread starved for ... ->cpu=3 <--------| ... ... | [ 89.385007] NMI backtrace for cpu 3 <--------| [ 89.385179] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 5.10.0+ #22 <--| [ 89.385188] Hardware name: linux,dummy-virt (DT) [ 89.385196] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--) [ 89.385204] pc : arch_cpu_idle+0x40/0xc0 [ 89.385211] lr : arch_cpu_idle+0x2c/0xc0 ... ... [ 89.385566] Call trace: [ 89.385574] arch_cpu_idle+0x40/0xc0 [ 89.385581] default_idle_call+0x100/0x450 [ 89.385589] cpuidle_idle_call+0x2f8/0x460 [ 89.385596] do_idle+0x1dc/0x3d0 [ 89.385604] cpu_startup_entry+0x5c/0xb0 [ 89.385613] secondary_start_kernel+0x35c/0x520 Signed-off-by: Zhen Lei Reviewed-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit b934b7ff5ea755473d9737d79ab303722ceba22e Author: Zhen Lei Date: Wed Jul 12 23:15:56 2023 +0800 rcu: Delete a redundant check in rcu_check_gp_kthread_starvation() The rcu_check_gp_kthread_starvation() function uses task_cpu() to sample the last CPU that the grace-period kthread ran on, and task_cpu() samples the thread_info structure's ->cpu field. But this field will always contain a number corresponding to a CPU that was online some time in the past, thus never a negative number. This invariant is checked by a WARN_ON_ONCE() in set_task_cpu(). This means that if the grace-period kthread exists, that is, if the "gpk" local variable is non-NULL, the "cpu" local variable will be non-negative. This in turn means that the existing check for non-negative "cpu" is redundant with the enclosing check for non-NULL "gpk". This commit threefore removes the redundant check of "cpu". Signed-off-by: Zhen Lei Signed-off-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker commit 7a4feff714c747622afd1cadc243ec99700bb23a Merge: 0578a6dbfe751 764246c7feda0 Author: Mark Brown Date: Mon Sep 11 20:32:57 2023 +0100 spidev: A few cleanups Merge series from Andy Shevchenko : A few cleanups to the spidev.c to utilize existing APIs and make it use less amount of Lines of Code. No functional change intended. commit 711fb79a1ea8e79dc600f25d9f8c1ac25870b4de Author: Biju Das Date: Fri Aug 18 08:55:58 2023 +0100 dt-bindings: iio: magnetometer: asahi-kasei,ak8975: Drop deprecated enums Drop deprecated enums from bindings as it is been here for a long time. Signed-off-by: Biju Das Acked-by: Rob Herring Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230818075600.24277-4-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 680b2f21c31d4e0af10cf0f732c2c972a8d7489d Author: Biju Das Date: Fri Aug 18 08:55:57 2023 +0100 iio: magnetometer: ak8975: Sort ID and ACPI tables Sort ID table alphabetically by name and ACPI table by HID. While at it, drop blank line before ID table. Suggested-by: Andy Shevchenko Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230818075600.24277-3-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 4f9ea93afde190a0f906ee624fc9a45cf784551b Author: Biju Das Date: Fri Aug 18 08:55:56 2023 +0100 iio: magnetometer: ak8975: Convert enum->pointer for data in the match tables Convert enum->pointer for data in the match tables to simplify the probe() by replacing device_get_match_data() and i2c_client_get_device_id by i2c_get_match_data() as we have similar I2C, ACPI and DT matching table. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230818075600.24277-2-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 4545d4777d9ede0f8061edf9a08c842d719c0fe6 Author: Biju Das Date: Sat Aug 12 17:22:22 2023 +0100 iio: mlx90614: Use i2c_get_match_data() Replace device_get_match_data()->i2c_get_match_data() to extend matching support for ID table. Signed-off-by: Biju Das Acked-by: "Crt Mori " Link: https://lore.kernel.org/r/20230812162222.200004-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit fe11e389117a6d98a8a5c894f69975877c612d67 Author: Biju Das Date: Sat Aug 12 15:10:44 2023 +0100 iio: accel: bma180: Convert enum->pointer for data in the match table Convert enum->pointer for data in the match table, so that device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c bus type match support added to it. Replace enum->struct *bma180_part_info for data in the match table and simplify bma180_probe(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230812141044.151520-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 9f6001e390927aa3173cfd4c7d325b8f1d93ccf8 Author: Biju Das Date: Sat Aug 12 08:24:19 2023 +0100 iio: adc: max1363: Use i2c_get_match_data() Replace device_get_match_data() and i2c_match_id() by i2c_get_match_data() by making similar I2C and DT-based matching table. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230812072419.42645-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 72d365398d96293291abdab23ab6be08e86001fa Author: Biju Das Date: Sat Aug 12 07:57:40 2023 +0100 iio: magnetometer: yamaha-yas530: Use i2c_get_match_data() Simplify the probe() by replacing device_get_match_data() with i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230812065741.20990-2-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 541d803abf33caa7243c99361a47f7b998966815 Author: Biju Das Date: Fri Aug 18 18:39:07 2023 +0100 iio: dac: ti-dac5571: Sort match tables Sort ID table alphabetically by name and OF table by compatible for single_*bit enums. Suggested-by: Andy Shevchenko Signed-off-by: Biju Das Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/20230818173907.323640-3-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 17dc571687c5cc60e88fe29a33da0b9c64647086 Author: Biju Das Date: Fri Aug 18 18:39:06 2023 +0100 iio: dac: ti-dac5571: Use i2c_get_match_data() Replace device_get_match_data() and id lookup for retrieving match data by i2c_get_match_data() by converting enum->pointer for data in the match table. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230818173907.323640-2-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 21fd3b1373f65c6a9d910642ecef194a077d1624 Author: Biju Das Date: Fri Aug 18 18:58:19 2023 +0100 iio: proximity: sx9310: Convert enum->pointer for match data table Convert enum->pointer for data in match data table, so that device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c bus type match support added to it. Add struct sx931x_info and replace enum->sx931x_info in the match table and simplify sx9310_check_whoami(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20230818175819.325663-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 7f8643aa5e0fbf540eeba412fc2a7d4dfc2f22f8 Author: Biju Das Date: Fri Aug 18 19:31:28 2023 +0100 iio: chemical: atlas-ezo-sensor: Simplify probe() Simplify the probe() by replacing device_get_match_data() and ID lookup match by i2c_get_match_data() as we have similar I2C and DT-based matching table. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230818183128.334233-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit ab3555b4b5b08fb03b8da904cc3fedbba91560df Author: Biju Das Date: Fri Aug 18 19:55:31 2023 +0100 iio: chemical: atlas-sensor: Convert enum->pointer for data in the match tables Convert enum->pointer for data in the match tables, so that device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c bus type match support added to it. Replace enum->struct *atlas_device for data in the match table. Simplify the probe() by replacing device_get_match_data() and ID lookup for retrieving data by i2c_get_match_data(). While at it, add const qualifier to struct atlas_device and drop inner trailing commas from OF table. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230818185531.336672-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 2b0ddc83dcb51737ef52fb1f42ec651a94aafa2c Author: Biju Das Date: Fri Aug 18 20:04:29 2023 +0100 iio: chemical: vz89x: Convert enum->pointer for data in the match tables Convert enum->pointer for data in the match tables, so that device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c bus type match support added to it. Replace enum->struct *vz89x_chip_data for data in the match table. Simplify the probe() by replacing device_get_match_data() and ID lookup for retrieving data by i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230818190429.338065-1-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 6915f0b98b71e5f6a5e49b0ec3ab98a387cef0f3 Author: Biju Das Date: Fri Aug 18 19:40:33 2023 +0100 iio: accel: mma8452: Sort match tables Sort ID table alphabetically by name and OF table by compatible. Suggested-by: Andy Shevchenko Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230818184033.335502-3-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 0f8eaeda7659d02063278c7eb72bbcd2d2819375 Author: Biju Das Date: Fri Aug 18 19:40:32 2023 +0100 iio: accel: mma8452: Convert enum->pointer for data in the ID table Convert enum->pointer for data in the ID table, so that device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c bus type match support added to it. Replace enum->struct *mma_chip_info for data in the ID table and simplify mma8452_probe() by replacing device_get_match_data() with i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/20230818184033.335502-2-biju.das.jz@bp.renesas.com Signed-off-by: Jonathan Cameron commit 974a6c27b4d707f75d283805e7fc8aa54686f198 Author: Jinjie Ruan Date: Mon Aug 28 14:45:46 2023 +0800 iio: adc: at91_adc: Simplify with dev_err_probe() Use the dev_err_probe() helper to simplify error handling during probe. This also handle scenario, when EDEFER is returned and useless error is printed. Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230828064546.2383857-4-ruanjinjie@huawei.com Signed-off-by: Jonathan Cameron commit 892de7031e905f242ea4e851abe5f4f7222e7455 Author: Jinjie Ruan Date: Mon Aug 28 14:45:45 2023 +0800 iio: adc: at91_adc: Use devm_clk_get_enabled() helper function The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code. Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230828064546.2383857-3-ruanjinjie@huawei.com Signed-off-by: Jonathan Cameron commit 449635ec210eb50ee5d11be934350d994080ff40 Author: Jinjie Ruan Date: Mon Aug 28 14:45:44 2023 +0800 iio: adc: at91_adc: Use devm_request_irq() helper function Use devm_request_irq() to request the interrupt, so we can avoid having to manually clean this up. Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230828064546.2383857-2-ruanjinjie@huawei.com Signed-off-by: Jonathan Cameron commit 9979cc64853b598518a485c2e554657d5c7a00c8 Author: Jinjie Ruan Date: Mon Aug 28 14:27:16 2023 +0800 iio: frequency: adf4350: Use device managed functions and fix power down issue. The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. Also replace devm_regulator_get() and regulator_enable() with devm_regulator_get_enable() helper and remove regulator_disable(). Replace iio_device_register() with devm_iio_device_register() and remove iio_device_unregister(). And st->reg is not used anymore, so remove it. As Jonathan pointed out, couple of things that are wrong: 1) The device is powered down 'before' we unregister it with the subsystem and as such userspace interfaces are still exposed which probably won't do the right thing if the chip is powered down. 2) This isn't done in the error paths in probe. To solve this problem, register a new callback adf4350_power_down() with devm_add_action_or_reset(), to enable software power down in both error and device detach path. So the remove function can be removed. Remove spi_set_drvdata() from the probe function, since spi_get_drvdata() is not used anymore. Fixes: e31166f0fd48 ("iio: frequency: New driver for Analog Devices ADF4350/ADF4351 Wideband Synthesizers") Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230828062717.2310219-1-ruanjinjie@huawei.com Signed-off-by: Jonathan Cameron commit da2737c96b6bf5f4090979b0dddd998b7b5b4362 Author: Andreas Kemnade Date: Sun Aug 20 14:32:29 2023 +0200 dt-bindings: iio: adc: Add TI TWL603X GPADC Document TI TWL603X GPADC devicetree bindings. A driver is already there, the compatibles are used, but not documented. Signed-off-by: Andreas Kemnade Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230820123229.530371-1-andreas@kemnade.info Signed-off-by: Jonathan Cameron commit 732ad34260d367661e2f20a5c5a4d54dbc856ac4 Author: Marcus Folkesson Date: Tue Aug 22 21:22:59 2023 +0200 iio: adc: mcp3911: add support for the whole MCP39xx family Microchip does have many similar chips, add support for those. The new supported chips are: - microchip,mcp3910 - microchip,mcp3912 - microchip,mcp3913 - microchip,mcp3914 - microchip,mcp3918 - microchip,mcp3919 Signed-off-by: Marcus Folkesson Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230822192259.1125792-7-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit 593d73629a441bccad21a5bffc126df8f9280831 Author: Marcus Folkesson Date: Tue Aug 22 21:22:58 2023 +0200 iio: adc: mcp3911: avoid ambiguity parameters in macros Name macro parameters after what they represent instead of 'x' and make sure the evaluation of that will have no side effects. Reviewed-by: Andy Shevchenko Signed-off-by: Marcus Folkesson Link: https://lore.kernel.org/r/20230822192259.1125792-6-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit 7e5047334f04d2c8588ee23eadb88ad52998745b Author: Marcus Folkesson Date: Tue Aug 22 21:22:57 2023 +0200 iio: adc: mcp3911: fix indentation The whole file does not make use of indentation properly. Do something about it. Reviewed-by: Andy Shevchenko Signed-off-by: Marcus Folkesson Link: https://lore.kernel.org/r/20230822192259.1125792-5-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit d1f6a2ac592241215f9229e68eb951211d08695e Author: Marcus Folkesson Date: Tue Aug 22 21:22:56 2023 +0200 iio: adc: mcp3911: simplify usage of spi->dev Replace the usage of `adc->spi->dev` with `dev` to make the code prettier. Reviewed-by: Andy Shevchenko Suggested-by: Andy Shevchenko Signed-off-by: Marcus Folkesson Link: https://lore.kernel.org/r/20230822192259.1125792-4-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit 46d1bfa04f61eb9533859d50d33c6f1c3ef98b80 Author: Marcus Folkesson Date: Tue Aug 22 21:22:55 2023 +0200 iio: adc: mcp3911: make use of dev_err_probe() Simplify code by switch to dev_err_probe(). Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Marcus Folkesson Link: https://lore.kernel.org/r/20230822192259.1125792-3-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit 655be10df27d98f014fd4691909e15d56834020e Author: Marcus Folkesson Date: Tue Aug 22 21:22:54 2023 +0200 dt-bindings: iio: adc: mcp3911: add support for the whole MCP39xx family Microchip does have many similar chips, add those to the compatible string as the driver support is extended. The new supported chips are: - microchip,mcp3910 - microchip,mcp3912 - microchip,mcp3913 - microchip,mcp3914 - microchip,mcp3918 - microchip,mcp3919 Signed-off-by: Marcus Folkesson Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230822192259.1125792-2-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron commit 5ff46635e4c51a2aeafb50a06c36bfdd0cda4203 Author: Jinjie Ruan Date: Fri Aug 25 17:56:12 2023 +0800 staging: iio: Use devm_clk_get_enabled() helper function The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code and avoids the need of a dedicated function used with devm_add_action_or_reset(). Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230825095612.2972892-1-ruanjinjie@huawei.com Signed-off-by: Jonathan Cameron commit a2d518fbe3760f66576a5c4f627aa3f126271c8b Author: Jinjie Ruan Date: Sat Aug 26 11:54:02 2023 +0800 iio: adc: mt6577_auxadc: Simplify with device managed function Add a device managed hook, via devm_add_action_or_reset() and mt6577_power_off(), to power off on device detach. Replace iio_device_register() by devm_iio_device_register() and remove the mt6577_auxadc_remove() function used to unregister the device and power off the device. Remove platform_set_drvdata() from the probe function, since platform_get_drvdata() is not used anymore. Remove mt6577_auxadc_mod_reg() call from the probe function error path. Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230826035402.3512033-3-ruanjinjie@huawei.com Signed-off-by: Jonathan Cameron commit 8cbba23e43eb182c75656c0dba40f890feea6400 Author: Jinjie Ruan Date: Sat Aug 26 11:54:01 2023 +0800 iio: adc: mt6577_auxadc: Simplify with dev_err_probe() Use the dev_err_probe() helper to simplify error handling during probe. This also handle scenario, when EDEFER is returned and useless error is printed. Signed-off-by: Jinjie Ruan Suggested-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230826035402.3512033-2-ruanjinjie@huawei.com Signed-off-by: Jonathan Cameron commit b564b99de79cdc87008dab3b19ae67a011f3f2fa Author: Jinjie Ruan Date: Sat Aug 26 14:27:32 2023 +0800 iio: adc: spear_adc: Use dev_err_probe() Use the dev_err_probe() helper to simplify error handling during probe. This also handle scenario, when EDEFER is returned and useless error is printed. Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230826062733.3714169-3-ruanjinjie@huawei.com Signed-off-by: Jonathan Cameron commit 3878ae2a1a7636be7009e20b48d4fc00adab8cf4 Author: Jinjie Ruan Date: Sat Aug 26 14:27:31 2023 +0800 iio: adc: spear_adc: Use device managed function The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. Switch to devm_iio_device_register() and drop the remove function. This simplifies the code. Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230826062733.3714169-2-ruanjinjie@huawei.com Signed-off-by: Jonathan Cameron commit a3e9625ec0c523cba3847ae21c382ae745e71d19 Author: Jinjie Ruan Date: Fri Aug 25 18:57:44 2023 +0800 iio: adc: mt6577_auxadc: Use devm_clk_get_enabled() helper function The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code. Signed-off-by: Jinjie Ruan Link: https://lore.kernel.org/r/20230825105746.2999548-3-ruanjinjie@huawei.com Signed-off-by: Jonathan Cameron commit 37b6ddba967c601479bea418a7ac6ff16b6232b7 Author: Srinivas Pandruvada Date: Thu Sep 7 11:02:07 2023 -0700 cpufreq: intel_pstate: Revise global turbo disable check Setting global turbo flag based on CPU 0 P-state limits is problematic as it limits max P-state request on every CPU on the system just based on its P-state limits. There are two cases in which global.turbo_disabled flag is set: - When the MSR_IA32_MISC_ENABLE_TURBO_DISABLE bit is set to 1 in the MSR MSR_IA32_MISC_ENABLE. This bit can be only changed by the system BIOS before power up. - When the max non turbo P-state is same as max turbo P-state for CPU 0. The second check is not a valid to decide global turbo state based on the CPU 0. CPU 0 max turbo P-state can be same as max non turbo P-state, but for other CPUs this may not be true. There is no guarantee that max P-state limits are same for every CPU. This is possible that during fusing max P-state for a CPU is constrained. Also with the Intel Speed Select performance profile, CPU 0 may not be present in all profiles. In this case the max non turbo and turbo P-state can be set to the lowest possible P-state by the hardware when switched to such profile. Since max non turbo and turbo P-state is same, global.turbo_disabled flag will be set. Once global.turbo_disabled is set, any scaling max and min frequency update for any CPU will result in its max P-state constrained to the max non turbo P-state. Hence remove the check of max non turbo P-state equal to max turbo P-state of CPU 0 to set global turbo disabled flag. Signed-off-by: Srinivas Pandruvada [ rjw: Subject edit ] Signed-off-by: Rafael J. Wysocki commit 8569c31545385195bdb0c021124e68336e91c693 Author: Arunpravin Paneer Selvam Date: Sat Sep 9 09:09:02 2023 -0700 drm/i915: Move the size computations to drm buddy - Move roundup_power_of_two() to drm buddy file to support the new try harder mechanism for contiguous allocation. - Move trim function call to drm_buddy_alloc_blocks() function. Signed-off-by: Arunpravin Paneer Selvam Link: https://patchwork.freedesktop.org/patch/msgid/20230909160902.15644-2-Arunpravin.PaneerSelvam@amd.com Reviewed-by: Matthew Auld Signed-off-by: Christian König commit 2eb412aa25ed2bf59f5ad5f7a09787d182d67934 Author: Arunpravin Paneer Selvam Date: Sat Sep 9 09:09:01 2023 -0700 drm/amdgpu: Move the size computations to drm buddy - Move roundup_power_of_two() and IS_ALIGNED() computations to drm buddy file to support the new try harder mechanism for contiguous allocation. - Move trim function call to drm_buddy_alloc_blocks() function. Signed-off-by: Arunpravin Paneer Selvam Link: https://patchwork.freedesktop.org/patch/msgid/20230909160902.15644-2-Arunpravin.PaneerSelvam@amd.com Reviewed-by: Matthew Auld Signed-off-by: Christian König commit 0a1844bf0b532d84324453374ad6845f64066c28 Author: Arunpravin Paneer Selvam Date: Sat Sep 9 09:09:00 2023 -0700 drm/buddy: Improve contiguous memory allocation Problem statement: The current method roundup_power_of_two() to allocate contiguous address triggers -ENOSPC in some cases even though we have enough free spaces and so to help with that we introduce a try harder mechanism. In case of -ENOSPC, the new try harder mechanism rounddown the original size to power of 2 and iterating over the round down sized freelist blocks to allocate the required size traversing RHS and LHS. As part of the above new method implementation we moved contiguous/alignment size computation part and trim function to the drm buddy file. v2: Modify the alloc_range() function to return total allocated size on -ENOSPC err and traverse RHS/LHS to allocate the required size (Matthew). Signed-off-by: Arunpravin Paneer Selvam Link: https://patchwork.freedesktop.org/patch/msgid/20230909160902.15644-1-Arunpravin.PaneerSelvam@amd.com Reviewed-by: Matthew Auld Signed-off-by: Christian König commit 5cbee5828219c4f7b33e96b5d8ce5e467b2857c8 Author: Rafał Miłecki Date: Fri Sep 1 12:55:49 2023 +0200 ARM: dts: BCM5301X: Set MACs for D-Link DIR-885L Specify NVRAM access and use its "et2macaddr" NVMEM cell. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20230901105549.7076-1-zajec5@gmail.com Signed-off-by: Florian Fainelli commit 2c3a6a613b0715ccdb9117e3a72a921de4a6f475 Author: Jerome Brunet Date: Mon Sep 11 17:45:41 2023 +0200 arm64: dts: meson: u200: add onboard devices Add missing audio devices found on the u200 PCB. This includes * Lineout connected to the internal DAC * SPDIF input connected to a coaxial socket * TDM input decoders allowing output loopback * TDM A and B output encoders and interfaces TDM A and B link format is set by the related external codec. Internal audio DAC can hook to any TDM output. This change does not include support necessary the optional the speaker and PDM Mic headers Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20230911154541.471484-6-jbrunet@baylibre.com [narmstrong: fixed sound-dai-cells and removed default okay status] Signed-off-by: Neil Armstrong commit 221465de6bd8090ab61267f019866e8d2dd4ea3d Author: Brett Creeley Date: Mon Aug 21 17:01:44 2023 -0600 iavf: Fix promiscuous mode configuration flow messages Currently when configuring promiscuous mode on the AVF we detect a change in the netdev->flags. We use IFF_PROMISC and IFF_ALLMULTI to determine whether or not we need to request/release promiscuous mode and/or multicast promiscuous mode. The problem is that the AQ calls for setting/clearing promiscuous/multicast mode are treated separately. This leads to a case where we can trigger two promiscuous mode AQ calls in a row with the incorrect state. To fix this make a few changes. Use IAVF_FLAG_AQ_CONFIGURE_PROMISC_MODE instead of the previous IAVF_FLAG_AQ_[REQUEST|RELEASE]_[PROMISC|ALLMULTI] flags. In iavf_set_rx_mode() detect if there is a change in the netdev->flags in comparison with adapter->flags and set the IAVF_FLAG_AQ_CONFIGURE_PROMISC_MODE aq_required bit. Then in iavf_process_aq_command() only check for IAVF_FLAG_CONFIGURE_PROMISC_MODE and call iavf_set_promiscuous() if it's set. In iavf_set_promiscuous() check again to see which (if any) promiscuous mode bits have changed when comparing the netdev->flags with the adapter->flags. Use this to set the flags which get sent to the PF driver. Add a spinlock that is used for updating current_netdev_promisc_flags and only allows one promiscuous mode AQ at a time. [1] Fixes the fact that we will only have one AQ call in the aq_required queue at any one time. [2] Streamlines the change in promiscuous mode to only set one AQ required bit. [3] This allows us to keep track of the current state of the flags and also makes it so we can take the most recent netdev->flags promiscuous mode state. [4] This fixes the problem where a change in the netdev->flags can cause IAVF_FLAG_AQ_CONFIGURE_PROMISC_MODE to be set in iavf_set_rx_mode(), but cleared in iavf_set_promiscuous() before the change is ever made via AQ call. Fixes: 47d3483988f6 ("i40evf: Add driver support for promiscuous mode") Signed-off-by: Brett Creeley Signed-off-by: Ahmed Zaki Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen commit 5ca636d927a106780451d957734f02589b972e2b Author: Andrii Staikov Date: Fri Sep 8 14:42:01 2023 +0200 i40e: fix potential memory leaks in i40e_remove() Instead of freeing memory of a single VSI, make sure the memory for all VSIs is cleared before releasing VSIs. Add releasing of their resources in a loop with the iteration number equal to the number of allocated VSIs. Fixes: 41c445ff0f48 ("i40e: main driver core") Signed-off-by: Andrii Staikov Signed-off-by: Aleksandr Loktionov Reviewed-by: Simon Horman Signed-off-by: Tony Nguyen commit 956236a24aec8364a3ee5d287e23c0c01cfb9c7c Author: Jerome Brunet Date: Mon Sep 11 17:45:40 2023 +0200 arm64: dts: meson: u200: use TDM C for HDMI On the u200, TDM B is wired to the onboard AD82584F i2c speaker codec. This makes TDM B a poor choice for the interface dedicated to HDMI which uses 4 i2s lanes. TDM A is not a good choice either as it is connected to the SDIO wifi/bt chip. TDM C is not used externally by default, which makes it a better choice for the HDMI interface. Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20230911154541.471484-5-jbrunet@baylibre.com Signed-off-by: Neil Armstrong commit 4e47ea869289dab588c0152ec90d6eb5bf7f7169 Author: Jerome Brunet Date: Mon Sep 11 17:45:39 2023 +0200 arm64: dts: meson: u200: add spdifout b routes spdifout B remains untested as it can only feed the HDMI controller, which does not support spdif ATM. Still if the u200 has spdifout b, the routes to it should be set. Fixes: cfae4eadb7cd ("arm64: dts: meson: add audio playback to u200") Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20230911154541.471484-4-jbrunet@baylibre.com Signed-off-by: Neil Armstrong commit f9dc2d96e1bfb33635df7edf0a1b8572bbb20954 Author: Jerome Brunet Date: Mon Sep 11 17:45:38 2023 +0200 arm64: dts: meson: u200: add missing audio clock controller The audio subsystem will not work if the audio clock controller is not enabled. Fixes: cfae4eadb7cd ("arm64: dts: meson: add audio playback to u200") Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20230911154541.471484-3-jbrunet@baylibre.com Signed-off-by: Neil Armstrong commit 66561cb158d0a25054bbcf423d59dd782311f60d Author: Jerome Brunet Date: Mon Sep 11 17:45:37 2023 +0200 arm64: dts: meson: u200: fix spdif output pin u200 outputs spdif on GPIOAO_10, not GPIOH_4 which is used for the LCD panel. Fixes: cfae4eadb7cd ("arm64: dts: meson: add audio playback to u200") Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20230911154541.471484-2-jbrunet@baylibre.com Signed-off-by: Neil Armstrong commit 8ffd18a6744b18ff9b58abf7261aaccd78be98cf Author: Denis Arefev Date: Thu Aug 24 16:02:15 2023 +0300 mtd: lpddr_cmds: Add literal suffix The value of an arithmetic expression 1 << lpddr->qinfo->DevSizeShift is subject to overflow due to a failure to cast operands to a larger data type before performing arithmetic Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Denis Arefev Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230824130215.10396-1-arefev@swemel.ru commit 48919c6c48380aa1aec4243c7e6ad39e89d78539 Author: Arseniy Krasnov Date: Wed Aug 23 13:52:31 2023 +0300 mtd: rawnand: remove 'nand_exit_status_op()' prototype This function is exported and its prototype is already placed in include/linux/mtd/rawnand.h. Signed-off-by: Arseniy Krasnov Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230823105235.609069-1-AVKrasnov@sberdevices.ru commit c29cc4a95fa84c2c1dc8b1b990365a86a5458070 Author: Yi Yang Date: Mon Aug 21 16:46:22 2023 +0800 mtd: rawnand: omap2: Fix check 0 for platform_get_irq() Refer to commit a85a6c86c25b ("driver core: platform: Clarify that IRQ 0 is invalid"). Do not check 0 for platform_get_irq(), because platform_get_irq() never return zero, and use the return error code of platform_get_irq() instead of -ENODEV. Signed-off-by: Yi Yang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230821084622.218442-1-yiyang13@huawei.com commit 0a1166c27d4e53186e6bf9147ea6db9cd1d65847 Author: Yi Yang Date: Mon Aug 21 16:40:46 2023 +0800 mtd: rawnand: tegra: add missing check for platform_get_irq() Add the missing check for platform_get_irq() and return error code if it fails. Fixes: d7d9f8ec77fe ("mtd: rawnand: add NVIDIA Tegra NAND Flash controller driver") Signed-off-by: Yi Yang Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20230821084046.217025-1-yiyang13@huawei.com commit 30c220a6fdd8883d4167fb09e18aa448f23ae62a Author: Jani Nikula Date: Tue Sep 5 20:11:27 2023 +0300 drm/i915/dsc: use REG_BIT, REG_GENMASK, and friends for PPS0 and PPS1 Use the register helper macros for PPS0 and PPS1 register contents. Cc: Suraj Kandpal Cc: Ankit Nautiyal Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal Link: https://patchwork.freedesktop.org/patch/msgid/0dfebe37a391a5ceb8bfae8e16383f1e5aef815d.1693933849.git.jani.nikula@intel.com commit 051da77ed577d117b329bb62467f09700aedf998 Author: Jani Nikula Date: Tue Sep 5 20:11:26 2023 +0300 drm/i915/dsc: add the PPS number to the register content macros Improve clarity by specifying the PPS number in the register content macros. It's easier to notice if macros are being used for the wrong register. Cc: Suraj Kandpal Cc: Ankit Nautiyal Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal Link: https://patchwork.freedesktop.org/patch/msgid/58de57b04ad2da5207f52c56c9e40663aaf16173.1693933849.git.jani.nikula@intel.com commit 5828681e25ee81c8b4b55e58de3c01b7c82052f5 Author: Jani Nikula Date: Tue Sep 5 20:11:25 2023 +0300 drm/i915/dsc: clean up pps comments Unify comments to be the simple "PPS n" instead of all sorts of variants. Cc: Suraj Kandpal Cc: Ankit Nautiyal Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal Link: https://patchwork.freedesktop.org/patch/msgid/915970973ef117fc8d47fbc57e8fa296235ad3e3.1693933849.git.jani.nikula@intel.com commit 973daa9fe6d17cede17d2eee05bb526cfc97a38f Author: Jani Nikula Date: Tue Sep 5 20:11:24 2023 +0300 drm/i915/dsc: drop redundant = 0 assignments Directly assign the values instead of first assigning 0 and then |= the values. Cc: Suraj Kandpal Cc: Ankit Nautiyal Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal Link: https://patchwork.freedesktop.org/patch/msgid/d752a148cc84558b76c8c3dacd9c0b2e0a4efd91.1693933849.git.jani.nikula@intel.com commit fb1400f7441dbdf569b013e2d9f5c26754e4391a Author: Jani Nikula Date: Tue Sep 5 20:11:23 2023 +0300 drm/i915/dsc: rename pps write to intel_dsc_pps_write() Make the function name conform to existing style better. Cc: Suraj Kandpal Cc: Ankit Nautiyal Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal Link: https://patchwork.freedesktop.org/patch/msgid/e793056e610ee8cfe2a8d69605402cd2445a517a.1693933849.git.jani.nikula@intel.com commit 9995d615125d9a323909171cba736905f6e68843 Author: Jani Nikula Date: Tue Sep 5 20:11:22 2023 +0300 drm/i915/dsc: have intel_dsc_pps_read() return the value Register read functions usually return the value instead of passing via pointer parameters. Return the multiple register verification results via a pointer parameter, which can also be NULL to skip the extra checks. Make the name conform to existing style better while at it. Cc: Suraj Kandpal Cc: Ankit Nautiyal Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal Link: https://patchwork.freedesktop.org/patch/msgid/4d08c0f63c4975cc8cd01b0f82845c989bf13dd0.1693933849.git.jani.nikula@intel.com commit 34131651e1e192b68eaf30167c6bacb38e1870ab Author: Jani Nikula Date: Tue Sep 5 20:11:21 2023 +0300 drm/i915/dsc: have intel_dsc_pps_read_and_verify() return the value Register read functions usually return the value instead of passing via pointer parameters. The calling code becomes easier to read. Make the name conform to existing style better while at it. Cc: Suraj Kandpal Cc: Ankit Nautiyal Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal Link: https://patchwork.freedesktop.org/patch/msgid/89b7d70bb19114ab3ff0e150a4b862d8032f136d.1693933849.git.jani.nikula@intel.com commit d28c8222824140773e0583dd400de6f08faf3a1c Author: Jani Nikula Date: Tue Sep 5 20:11:20 2023 +0300 drm/i915/dsc: improve clarity of the pps reg read/write helpers Make it clear what's the number of vdsc per pipe, and what's the number of registers to grab. Have intel_dsc_get_pps_reg() return the registers it knows even if the requested amount is bigger. Cc: Suraj Kandpal Cc: Ankit Nautiyal Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal Link: https://patchwork.freedesktop.org/patch/msgid/e2551b52ac0dd2b4ffe18d5e7733fafdc191d68a.1693933849.git.jani.nikula@intel.com commit 70052100fabec5d8c1b09c9959817a2f4517e6b5 Author: Ville Syrjälä Date: Fri Sep 8 08:25:27 2023 +0300 drm/i915: Only check eDP HPD when AUX CH is shared Apparently Acer Chromebook C740 (BDW-ULT) doesn't have the eDP HPD line properly connected, and thus fails the new HPD check during eDP probe. The result is that we lose the eDP output. I suspect all such machines would be Chromebooks or other Linux exclusive systems as the Windows driver likely wouldn't work either. I did check a few other BDW machines here and those do have eDP HPD connected, one of them even is a different Chromebook (Samus). To account for these funky machines let's skip the HPD check when it looks like the eDP port is the only one using that specific AUX channel. In case of multiple ports sharing the same AUX CH (eg. on Asrock B250M-HDV) we still do the check and thus should correctly ignore the eDP port in favor of the other DP port (usually a DP->VGA converter). v2: Don't oops during list iteration Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9264 Fixes: cfe5bdfb27fa ("drm/i915: Check HPD live state during eDP probe") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230908052527.685-1-ville.syrjala@linux.intel.com Reviewed-by: Luca Coelho commit 5355699dabac3c97492a30e6e01820fcaae11218 Author: xianwei.zhao Date: Mon Sep 11 10:52:23 2023 +0800 arm64: dts: amlogic: t7: add power domain controller node Add power domain controller node for Amlogic T7 SoC Signed-off-by: "xianwei.zhao" Reviewed-by: Neil Armstrong Tested-by: Lucas Tanure Link: https://lore.kernel.org/r/20230911025223.3433776-7-xianwei.zhao@amlogic.com Signed-off-by: Neil Armstrong commit aa0ade3058af6d67ce5aa773c1012f83df3bfbe9 Merge: a42b8f639298c 54f1618b951fd Author: Neil Armstrong Date: Mon Sep 11 17:06:46 2023 +0200 Merge branch 'genpd_dt' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm into v6.7/arm64-dt Signed-off-by: Neil Armstrong commit b0b0d811eac6b4c52cb9ad632fa6384cf48869e7 Author: Jason-JH.Lin Date: Thu Sep 7 17:14:25 2023 +0800 drm/mediatek: Fix coverity issue with unintentional integer overflow 1. Instead of multiplying 2 variable of different types. Change to assign a value of one variable and then multiply the other variable. 2. Add a int variable for multiplier calculation instead of calculating different types multiplier with dma_addr_t variable directly. Fixes: 1a64a7aff8da ("drm/mediatek: Fix cursor plane no update") Signed-off-by: Jason-JH.Lin Reviewed-by: Alexandre Mergnat Reviewed-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20230907091425.9526-1-jason-jh.lin@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 814d5341f3146a97833c5f7587a349d660e9be4c Author: Shuijing Li Date: Mon Sep 11 20:08:00 2023 +0800 drm/mediatek: Add mt8188 dsi compatible to mtk_dsi.c Add the compatible because there are different definitions for cmdq register bit control in mt8188. Signed-off-by: Shuijing Li Reviewed-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20230911120800.17369-4-shuijing.li@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 2ccf6e2580cdc192b6cb034c98485cca6ccc8f58 Author: Shuijing Li Date: Mon Sep 11 20:07:59 2023 +0800 drm/mediatek: dsi: Add dsi cmdq_ctl to send panel initial code For mt8188, add dsi cmdq reg control to send long packets to panel initialization. MT8188 hardware has been changed to automatically set the cmdq_size value by default when sending long packets. In this patch, the cmdq_size value is set manually instead. Remain consistent with previous IC. Signed-off-by: Shuijing Li Reviewed-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20230911120800.17369-3-shuijing.li@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 81d707f32eb913f3296246ab9e2e6edf1a97064b Author: Shuijing Li Date: Mon Sep 11 20:07:58 2023 +0800 dt-bindings: display: mediatek: dsi: Add compatible for MediaTek MT8188 Add dt-binding documentation of dsi for MediaTek MT8188 SoC. Signed-off-by: Shuijing Li Signed-off-by: Jitao Shi Acked-by: Krzysztof Kozlowski Reviewed-by: Matthias Brugger Reviewed-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20230911120800.17369-2-shuijing.li@mediatek.com/ Signed-off-by: Chun-Kuang Hu commit 54f1618b951fde7803bf5cbdc17412c5165c26fe Author: xianwei.zhao Date: Mon Sep 11 10:52:21 2023 +0800 dt-bindings: power: add Amlogic T7 power domains Add devicetree binding document and related header file for Amlogic T7 secure power domains. Signed-off-by: xianwei.zhao Acked-by: Conor Dooley Tested-by: Lucas Tanure Link: https://lore.kernel.org/r/20230911025223.3433776-5-xianwei.zhao@amlogic.com Signed-off-by: Ulf Hansson commit acf4884a571709cad99f98aabe08b7cacd62dc80 Author: Tomer Maimon Date: Mon Aug 28 17:08:49 2023 +0300 pinctrl: nuvoton: add NPCM8XX pinctrl and GPIO driver Add pinctrl and GPIO controller driver support to Arbel BMC NPCM8XX SoC. Arbel BMC NPCM8XX pinctrl driver based on Poleg NPCM7XX, except the pin mux mapping difference the NPCM8XX GPIO supports adjust debounce period time. Signed-off-by: Tomer Maimon Link: https://lore.kernel.org/r/20230828140849.21724-3-tmaimon77@gmail.com Signed-off-by: Linus Walleij commit 38b99959c3c62032e9dd916ecb0b7e75ae6e65d7 Author: Tomer Maimon Date: Mon Aug 28 17:08:48 2023 +0300 dt-binding: pinctrl: Add NPCM8XX pinctrl and GPIO documentation Added device tree binding documentation for Nuvoton Arbel BMC NPCM8XX pinmux and GPIO controller. Signed-off-by: Tomer Maimon Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20230828140849.21724-2-tmaimon77@gmail.com Signed-off-by: Linus Walleij commit 27e55fdff2f071fcec5e784433424233572a809b Author: Geert Uytterhoeven Date: Thu Aug 24 12:07:44 2023 +0200 pinctrl: nuvoton: Use pinconf_generic_dt_node_to_map_all() Use the pinconf_generic_dt_node_to_map_all() helper instead of open-coding the same operation, to avoid having to provide custom pinctrl_ops.dt_node_to_map() callbacks. Signed-off-by: Geert Uytterhoeven Reviewed-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/81e9ab48f78d63153b23a163b3349b3059d2b7fc.1692871558.git.geert+renesas@glider.be Signed-off-by: Linus Walleij commit d168ccdf50e4d7008cf67ca25a1602ac860592fc Author: Geert Uytterhoeven Date: Thu Aug 24 12:05:50 2023 +0200 pinctrl: berlin: Drop superfluous ampersands There is no need to use an ampersand to take the address of a function. Signed-off-by: Geert Uytterhoeven Reviewed-by: Jisheng Zhang Link: https://lore.kernel.org/r/0ff17be9b31c9fcf03481c0665293b98ced741f7.1692871243.git.geert+renesas@glider.be Signed-off-by: Linus Walleij commit 01499e51d1a75cd00238828ca58e252c6f9714f1 Author: Daniel Golle Date: Sat Aug 26 21:44:31 2023 +0100 pinctrl: mediatek: mt7981: add additional uart groups Add uart2_0_tx_rx (pin 4, 5) and uart1_2 (pins 9, 10) groups to the pinctrl driver for the MediaTek MT7981 SoC. Signed-off-by: Daniel Golle Link: https://lore.kernel.org/r/11db447f257231e08065989100311df57b7f1f1c.1693082594.git.daniel@makrotopia.org Signed-off-by: Linus Walleij commit b333067ff3b0ee63e226a06633f3df12491028ab Author: Ian Rogers Date: Mon Aug 28 17:17:30 2023 -0700 perf vendor events intel: Fix spelling mistakes Update perf JSON files with spelling fixes by Colin Ian King contributed in: https://github.com/intel/perfmon/pull/96 "Fix various spelling mistakes and typos as found using codespell #96" This is added on top of the spelling mistakes and release number updates in: https://github.com/intel/perfmon/pull/98 "EMR, SPR, CLX, SKX, BDX, HSX, BDW-DE, WSM-EP*, NHM-*, JKT, IVT : Release event updates" Some additional spelling fixes reported by Edward Baker are added on top of this. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Colin Ian King Cc: Edward Baker Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230829001730.1352769-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8c994eff8fcfe8ecb1f1dbebed25b4d7bb75be12 Author: Ian Rogers Date: Mon Aug 28 17:17:29 2023 -0700 perf vendor events intel: Add emeraldrapids, update sapphirerapids to v1.16 Add emeraldrapids events that were added at intel's perfmon site in: https://github.com/intel/perfmon/pull/98 "EMR, SPR, CLX, SKX, BDX, HSX, BDW-DE, WSM-EP*, NHM-*, JKT, IVT : Release event updates" "Emerald Rapids (0xCF) was previously pointing to SPR core. In this pull request dedicated EMR files are introduced." Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Colin Ian King Cc: Edward Baker Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230829001730.1352769-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5d6151531a373a71c6ff02eafacd5e3aca610f2d Author: Ian Rogers Date: Mon Aug 28 17:17:28 2023 -0700 perf vendor events intel: Add lunarlake v1.0 Add lunarlake events that were added at intel's perfmon site in: https://github.com/intel/perfmon/pull/97 "LNL: Release initial events" Reviewed-by: Kan Liang Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Colin Ian King Cc: Edward Baker Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20230829001730.1352769-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 0d3f0e6f94ef58d5532e23b6d153b0890cf0014c Author: Ian Rogers Date: Fri Sep 1 16:39:49 2023 -0700 perf parse-events: Introduce 'struct parse_events_terms' parse_events_terms() existed in function names but was passed a 'struct list_head'. As many parse_events functions take an evsel_config list as well as a parse_event_term list, and the naming head_terms and head_config is inconsistent, there's a potential to switch the lists and get errors. Introduce a 'struct parse_events_terms', that just wraps a list_head, to avoid this. Add the regular init/exit functions and transition the code to use them. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rob Herring Link: https://lore.kernel.org/r/20230901233949.2930562-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 727adeed06e82915841e121762eb329881ae0107 Author: Ian Rogers Date: Fri Sep 1 16:39:48 2023 -0700 perf parse-events: Copy fewer term lists When trying to add events to multiple PMUs the term list is copied first as adding the event will rewrite the event's name term into the sysfs and/or json encoding terms (see perf_pmu__check_alias). Change the parse events add API so the passed in term list is const, then copy the list when modification is necessary. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rob Herring Link: https://lore.kernel.org/r/20230901233949.2930562-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 4163644818e95ea6b0afb3982b34c4d59ed50bb2 Author: Ian Rogers Date: Fri Sep 1 16:39:47 2023 -0700 perf parse-events: Avoid enum casts Add term_type to union of values returned by the lexer to avoid casts to and from an integer. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rob Herring Link: https://lore.kernel.org/r/20230901233949.2930562-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8f91662ef8be473fb025e170601b0dd75838f7d4 Author: Ian Rogers Date: Fri Sep 1 16:39:46 2023 -0700 perf parse-events: Tidy up str parameter Add a const and rename str to event_name. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rob Herring Link: https://lore.kernel.org/r/20230901233949.2930562-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 6fcfe54d2c91925ec3054cf25e68064913ca7948 Author: Ian Rogers Date: Fri Sep 1 16:39:45 2023 -0700 perf parse-events: Remove unnecessary __maybe_unused The parameter head_terms is always used in get_config_terms. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rob Herring Link: https://lore.kernel.org/r/20230901233949.2930562-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit fa88095856dfbad439129324a0fb6b4716e17ab1 Author: Ian Rogers Date: Tue Sep 5 11:15:54 2023 -0700 perf shell completion: Support completion of metrics/metricgroups Allow metrics to expand for -M or --metrics options. Committer testing: # grep -m1 'model name' /proc/cpuinfo model name : AMD Ryzen 9 5950X 16-Core Processor # Before: Just expansion of files/directories in the pwd are expanded: # . tools/perf/perf-completion.sh # perf stat -M b block/ build/ # perf stat -M b After: # . tools/perf/perf-completion.sh # perf stat -M all_l2_cache_accesses all_remote_links_outbound data_fabric l1_itlb_misses l2_cache_misses_from_l2_hwpf macro_ops_dispatched tlb all_l2_cache_hits branch_misprediction_ratio decoder l2_cache l3_cache nps1_die_to_dram all_l2_cache_misses branch_prediction ic_fetch_miss_ratio l2_cache_accesses_from_l2_hwpf l3_read_miss_latency op_cache_fetch_miss_ratio # perf stat -M branch_ branch_misprediction_ratio branch_prediction # perf stat -M branch_prediction -a sleep 1 Performance counter stats for 'system wide': 115,079,765 ex_ret_brn # 4.0 % branch_misprediction_ratio 4,561,456 ex_ret_brn_misp 1.015925106 seconds time elapsed # Suggested-by: Arnaldo Carvalho de Melo Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230905181554.3202873-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 493902fcbdd608a6ece49c1670ffc76fed1e617f Author: Ian Rogers Date: Tue Sep 5 11:15:53 2023 -0700 perf completion: Support completion of libpfm4 events Use `perf list --raw-dump pfm` to support completion of libpfm4 events. Committer testing: # grep -m1 'model name' /proc/cpuinfo model name : AMD Ryzen 9 5950X 16-Core Processor Before: Files in the current directory are expanded when After: Only the PFM events are: # . tools/perf/perf-completion.sh # perf stat --pfm-events Becomes: # perf stat --pfm-events perf_raw::r0000 As apparently there are no other PFM events for this Ryzen 9 5950X machine. Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230905181554.3202873-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 10864594d8dedc63183f164c9cb139a521c7c64d Author: Ian Rogers Date: Tue Sep 5 11:15:52 2023 -0700 perf shell completion: Restrict completion of events to events 'perf list' will list libpfm4 events and metrics which aren't valid options to the '-e' option. Restrict the events gathered so that invalid ones aren't shown. Before: $ perf stat -e Display all 633 possibilities? (y or n) After: $ perf stat -e Display all 375 possibilities? (y or n) Committer testing: # grep -m1 'model name' /proc/cpuinfo model name : AMD Ryzen 9 5950X 16-Core Processor # Before: # . tools/perf/perf-completion.sh # perf stat -e Display all 2672 possibilities? (y or n) After: # . tools/perf/perf-completion.sh # perf stat -e Display all 2648 possibilities? (y or n) Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20230905181554.3202873-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a84fbf205609313594b86065c67e823f09ebe29b Author: Ian Rogers Date: Tue Sep 5 17:39:12 2023 -0700 perf stat: Fix aggr mode initialization Generating metrics llc_code_read_mpi_demand_plus_prefetch, llc_data_read_mpi_demand_plus_prefetch, llc_miss_local_memory_bandwidth_read, llc_miss_local_memory_bandwidth_write, nllc_miss_remote_memory_bandwidth_read, memory_bandwidth_read, memory_bandwidth_write, uncore_frequency, upi_data_transmit_bw, C2_Pkg_Residency, C3_Core_Residency, C3_Pkg_Residency, C6_Core_Residency, C6_Pkg_Residency, C7_Core_Residency, C7_Pkg_Residency, UNCORE_FREQ and tma_info_system_socket_clks would trigger an address sanitizer heap-buffer-overflows on a SkylakeX. ``` ==2567752==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x5020003ed098 at pc 0x5621a816654e bp 0x7fffb55d4da0 sp 0x7fffb55d4d98 READ of size 4 at 0x5020003eee78 thread T0 #0 0x558265d6654d in aggr_cpu_id__is_empty tools/perf/util/cpumap.c:694:12 #1 0x558265c914da in perf_stat__get_aggr tools/perf/builtin-stat.c:1490:6 #2 0x558265c914da in perf_stat__get_global_cached tools/perf/builtin-stat.c:1530:9 #3 0x558265e53290 in should_skip_zero_counter tools/perf/util/stat-display.c:947:31 #4 0x558265e53290 in print_counter_aggrdata tools/perf/util/stat-display.c:985:18 #5 0x558265e51931 in print_counter tools/perf/util/stat-display.c:1110:3 #6 0x558265e51931 in evlist__print_counters tools/perf/util/stat-display.c:1571:5 #7 0x558265c8ec87 in print_counters tools/perf/builtin-stat.c:981:2 #8 0x558265c8cc71 in cmd_stat tools/perf/builtin-stat.c:2837:3 #9 0x558265bb9bd4 in run_builtin tools/perf/perf.c:323:11 #10 0x558265bb98eb in handle_internal_command tools/perf/perf.c:377:8 #11 0x558265bb9389 in run_argv tools/perf/perf.c:421:2 #12 0x558265bb9389 in main tools/perf/perf.c:537:3 ``` The issue was the use of testing a cpumap with NULL rather than using empty, as a map containing the dummy value isn't NULL and the -1 results in an empty aggr map being allocated which legitimately overflows when any member is accessed. Fixes: 8a96f454f5668572 ("perf stat: Avoid SEGV if core.cpus isn't set") Signed-off-by: Ian Rogers Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230906003912.3317462-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1bd69b4bf1dde99ac1ba2fdbcd5408d7f82c406a Author: Kajol Jain Date: Tue Sep 5 17:10:39 2023 +0530 perf vendor events: Update metric events for power10 platform Update JSON/events for power10 platform with additional metrics. Signed-off-by: Kajol Jain Cc: Athira Rajeev Cc: Disha Goel Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230905114039.176645-3-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 23ba30b23b761a2c7d6af87eb44e376459ecce3e Author: Kajol Jain Date: Tue Sep 5 17:10:38 2023 +0530 perf vendor events power10: Add extra data-source events Update JSON/Events list with additional data-source events for power10 platform. Signed-off-by: Kajol Jain Cc: Athira Rajeev Cc: Disha Goel Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230905114039.176645-2-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit fc143580753348c62068f30958fede937aa471ad Author: Kajol Jain Date: Tue Sep 5 17:10:37 2023 +0530 perf vendor events power10: Update JSON/events Update JSON/Events list with data-source events for power10 platform. Signed-off-by: Kajol Jain Cc: Athira Rajeev Cc: Disha Goel Cc: Madhavan Srinivasan Cc: Namhyung Kim Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20230905114039.176645-1-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 6066622c97cc0b25d287dc859dbe5f185740e0b4 Author: Jiapeng Chong Date: Thu Feb 25 18:04:43 2021 +0800 perf machine: Use true and false for bool variable Fix the following coccicheck warnings: ./tools/perf/util/machine.c:2000:9-10: WARNING: return of 0/1 in function 'symbol__match_regex' with return type bool. Committer notes: Found this in the pile, it was already returning bool, but this patch simplifies it further, from 3 lines to just 1. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Suggested-by: David Laight Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann 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 Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: https://lore.kernel.org/r/1614247483-102665-1-git-send-email-jiapeng.chong@linux.alibaba.com Signed-off-by: Arnaldo Carvalho de Melo commit 6ae9f693ed4ff54f4bb0bd41e20da10733c49c0c Author: Thomas Zimmermann Date: Thu Sep 7 10:52:06 2023 +0200 fbdev/core: Clean up include statements in fbmem.c Remove all unnecessary include statements from fbmem.c. Most of them were for functionality that has meanwhile been moved into other files. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230907085408.9354-8-tzimmermann@suse.de commit 9ab7dc25ab65db5f8d45bc6ee0431f9ae387b642 Author: Thomas Zimmermann Date: Thu Sep 7 10:52:05 2023 +0200 fbdev/core: Remove empty internal helpers from fb_logo.c Remove the two empty helpers for the case the CONFIG_FB_LOGO_EXTRA has not been set. They are internal functions and only called once. Providing empty replacements seems like overkill. Instead protect the call sites with a test for CONFIG_FB_LOGO_EXTRA. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230907085408.9354-7-tzimmermann@suse.de commit 8887086ef2e0047ec321103a15e7d766be3a3874 Author: Thomas Zimmermann Date: Thu Sep 7 10:52:04 2023 +0200 fbdev/core: Move logo functions into separate source file Move the fbdev function for displaying boot-up logos into their own file fb_logo.c. Only build fb_logo.c if CONFIG_LOGO has been selected. No functional changes. v2: * include fb_internal.h (kernel test robot) * simplify option-parsing ifdefs * build fb_logo.o iff CONFIG_LOGO has been set Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230907085408.9354-6-tzimmermann@suse.de commit fa671e4f1556e2c18e5443f777a75ae041290068 Author: Thomas Zimmermann Date: Thu Sep 7 10:52:03 2023 +0200 fbdev/core: Unexport logo helpers The interfaces for the fbdev logo are not used outside of the fbdev module. Hence declare the fbdev logo functions in the internal header file and remove their symbol exports. Only build the functions if CONFIG_LOGO has been selected. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230907085408.9354-5-tzimmermann@suse.de commit 58d2ef9c1c0c870f1f8b72c3ed104b98aa831f85 Author: Thomas Zimmermann Date: Thu Sep 7 10:52:02 2023 +0200 fbdev/core: Fix style of code for boot-up logo Fix a number of warnings from checkpatch.pl in this code before moving it into a separate file. This includes * Prefer 'unsigned int' to bare use of 'unsigned' * space required after that ',' (ctx:VxV) * space prohibited after that open parenthesis '(' * suspect code indent for conditional statements (16, 32) * braces {} are not necessary for single statement blocks No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230907085408.9354-4-tzimmermann@suse.de commit 828d96633ab7e0fe8032e9123d57b318cfd9f145 Author: Thomas Zimmermann Date: Thu Sep 7 10:52:01 2023 +0200 fbdev/mmp/mmpfb: Do not display boot-up logo The fbcon module takes care of displaying the logo, if any. Remove the code form mmpfb. It is probably no tworking as expected, as it interferes with the framebuffer console. If we want to display the logo without fbcon, we should implement this in the fbdev core code. v2: * add a note on fbcon interference (Javier) Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230907085408.9354-3-tzimmermann@suse.de commit 84a45f4c27d174ed21eab2671bee8137302803bc Author: Thomas Zimmermann Date: Thu Sep 7 10:52:00 2023 +0200 fbdev/au1200fb: Do not display boot-up logo The fbcon module takes care of displaying the logo, if any. Remove the code form au1200fb. If we want to display the logo without fbcon, we should implement this in the fbdev core code. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230907085408.9354-2-tzimmermann@suse.de commit ddf9e2ff67a910acde1d000e76b7e31267599539 Author: Amir Goldstein Date: Fri Sep 8 16:29:00 2023 +0300 fs: export mnt_{get,put}_write_access() to modules Overlayfs is going to use those to get write access on the upper mount during entire copy up without taking freeze protection on upper sb for the entire copy up. Signed-off-by: Amir Goldstein Message-Id: <20230908132900.2983519-3-amir73il@gmail.com> Signed-off-by: Christian Brauner commit 3e15dcf77b23b8e9b9b7f3c0d4def8fe9c12c534 Author: Amir Goldstein Date: Fri Sep 8 16:28:59 2023 +0300 fs: rename __mnt_{want,drop}_write*() helpers Before exporting these helpers to modules, make their names more meaningful. The names mnt_{get,put)_write_access*() were chosen, because they rhyme with the inode {get,put)_write_access() helpers, which have a very close meaning for the inode object. Suggested-by: Christian Brauner Link: https://lore.kernel.org/r/20230817-anfechtbar-ruhelosigkeit-8c6cca8443fc@brauner/ Signed-off-by: Amir Goldstein Message-Id: <20230908132900.2983519-2-amir73il@gmail.com> Signed-off-by: Christian Brauner commit 206b250c3e9be44c096bb9bb1f9d6b7f3440bfbb Author: Cristian Ciocaltea Date: Thu Sep 7 20:10:10 2023 +0300 ALSA: hda: cs35l41: Consistently use dev_err_probe() Replace the remaining dev_err() calls in probe() with dev_err_probe(), to improve consistency. Signed-off-by: Cristian Ciocaltea Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20230907171010.1447274-12-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit 85a1bf86fac0c195929768b4e92c78cad107523b Author: Cristian Ciocaltea Date: Thu Sep 7 20:10:09 2023 +0300 ALSA: hda: cs35l41: Undo runtime PM changes at driver exit time According to the documentation, drivers are responsible for undoing at removal time all runtime PM changes done during probing. Hence, add the missing calls to pm_runtime_dont_use_autosuspend(), which are necessary for undoing pm_runtime_use_autosuspend(). Fixes: 1873ebd30cc8 ("ALSA: hda: cs35l41: Support Hibernation during Suspend") Signed-off-by: Cristian Ciocaltea Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20230907171010.1447274-11-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit 486465508f8a5fe441939a7d97607f4460a60891 Author: Cristian Ciocaltea Date: Thu Sep 7 20:10:08 2023 +0300 ALSA: hda: cs35l41: Fix unbalanced pm_runtime_get() If component_add() fails, probe() returns without calling pm_runtime_put(), which leaves the runtime PM usage counter incremented. Fix the issue by jumping to err_pm label and drop the now unnecessary pm_runtime_disable() call. Fixes: 7b2f3eb492da ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems") Signed-off-by: Cristian Ciocaltea Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20230907171010.1447274-10-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit 611b8813a28f49e206e05198dae77c544c72b050 Author: Cristian Ciocaltea Date: Thu Sep 7 20:10:07 2023 +0300 ASoC: cs35l41: Use modern pm_ops Make use of the recently introduced EXPORT_GPL_DEV_PM_OPS() macro, to conditionally export the runtime/system PM functions. Replace the old SET_{RUNTIME,SYSTEM_SLEEP,NOIRQ_SYSTEM_SLEEP}_PM_OPS() helpers with their modern alternatives and get rid of the now unnecessary '__maybe_unused' annotations on all PM functions. Additionally, use the pm_ptr() macro to fix the following errors when building with CONFIG_PM disabled: ERROR: modpost: "cs35l41_pm_ops" [sound/soc/codecs/snd-soc-cs35l41-spi.ko] undefined! ERROR: modpost: "cs35l41_pm_ops" [sound/soc/codecs/snd-soc-cs35l41-i2c.ko] undefined! Signed-off-by: Cristian Ciocaltea Acked-by: Charles Keepax Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20230907171010.1447274-9-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit 3db52739aca981a436536423a36ab59b9f241096 Author: Cristian Ciocaltea Date: Thu Sep 7 20:10:06 2023 +0300 ASoC: cs35l41: Make use of dev_err_probe() Use dev_err_probe() helper where possible, to simplify error handling during probe. Signed-off-by: Cristian Ciocaltea Acked-by: Charles Keepax Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20230907171010.1447274-8-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit 2d5661e6008ae1a1cd6df7cc844908fb8b982c58 Author: Cristian Ciocaltea Date: Thu Sep 7 20:10:05 2023 +0300 ASoC: cs35l41: Undo runtime PM changes at driver exit time According to the documentation, drivers are responsible for undoing at removal time all runtime PM changes done during probing. Hence, add the missing calls to pm_runtime_dont_use_autosuspend(), which are necessary for undoing pm_runtime_use_autosuspend(). Note this would have been handled implicitly by devm_pm_runtime_enable(), but there is a need to continue using pm_runtime_enable()/pm_runtime_disable() in order to ensure the runtime PM is disabled as soon as the remove() callback is entered. Fixes: f517ba4924ad ("ASoC: cs35l41: Add support for hibernate memory retention mode") Signed-off-by: Cristian Ciocaltea Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20230907171010.1447274-7-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit 9f8948db9849d202dee3570507d3a0642f92d632 Author: Cristian Ciocaltea Date: Thu Sep 7 20:10:04 2023 +0300 ASoC: cs35l41: Verify PM runtime resume errors in IRQ handler The interrupt handler invokes pm_runtime_get_sync() without checking the returned error code. Add a proper verification and switch to pm_runtime_resume_and_get(), to avoid the need to call pm_runtime_put_noidle() for decrementing the PM usage counter before returning from the error condition. Fixes: f517ba4924ad ("ASoC: cs35l41: Add support for hibernate memory retention mode") Signed-off-by: Cristian Ciocaltea Acked-by: Charles Keepax Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20230907171010.1447274-6-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit 77bf613f0bf08c021309cdb5f84b5f630b829261 Author: Cristian Ciocaltea Date: Thu Sep 7 20:10:03 2023 +0300 ASoC: cs35l41: Fix broken shared boost activation Enabling the active/passive shared boosts requires setting SYNC_EN, but *not* before receiving the PLL Lock signal. Due to improper error handling, it was not obvious that waiting for the completion operation times out and, consequently, the shared boost is never activated. Further investigations revealed the signal is triggered while snd_pcm_start() is executed, right after receiving the SNDRV_PCM_TRIGGER_START command, which happens long after the SND_SOC_DAPM_PRE_PMU event handler is invoked as part of snd_pcm_prepare(). That is where cs35l41_global_enable() is called from. Increasing the wait duration doesn't help, as it only causes an unnecessary delay in the invocation of snd_pcm_start(). Moving the wait and the subsequent regmap operations to the SNDRV_PCM_TRIGGER_START callback is not a solution either, since they would be executed in an IRQ-off atomic context. Solve the issue by setting the SYNC_EN bit in PWR_CTRL3 register right after receiving the PLL Lock interrupt. Additionally, drop the unnecessary writes to PWR_CTRL1 register, part of the original mdsync_up_seq, which would have toggled GLOBAL_EN with unwanted consequences on PLL locking behavior. Fixes: f5030564938b ("ALSA: cs35l41: Add shared boost feature") Signed-off-by: Cristian Ciocaltea Reviewed-by: David Rhodes Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20230907171010.1447274-5-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit 5ad668a9ce83d819701fb7abc1c2236049ec15c2 Author: Cristian Ciocaltea Date: Thu Sep 7 20:10:02 2023 +0300 ASoC: cs35l41: Initialize completion object before requesting IRQ Technically, an interrupt handler can be called before probe() finishes its execution, hence ensure the pll_lock completion object is always initialized before being accessed in cs35l41_irq(). Fixes: f5030564938b ("ALSA: cs35l41: Add shared boost feature") Signed-off-by: Cristian Ciocaltea Acked-by: Charles Keepax Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20230907171010.1447274-4-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit 4bb5870ab60abca6ad18196090831b5e4cf82d93 Author: Cristian Ciocaltea Date: Thu Sep 7 20:10:01 2023 +0300 ASoC: cs35l41: Handle mdsync_up reg write errors The return code of regmap_multi_reg_write() call related to "MDSYNC up" sequence is shadowed by the subsequent regmap_read_poll_timeout() invocation, which will hit a timeout in case the write operation above fails. Make sure cs35l41_global_enable() returns the correct error code instead of -ETIMEDOUT. Additionally, to be able to distinguish between the timeouts of wait_for_completion_timeout() and regmap_read_poll_timeout(), print an error message for the former and return immediately. This also avoids having to wait unnecessarily for the second time. Fixes: f8264c759208 ("ALSA: cs35l41: Poll for Power Up/Down rather than waiting a fixed delay") Signed-off-by: Cristian Ciocaltea Acked-by: Charles Keepax Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20230907171010.1447274-3-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit a9a3f54a23d844971c274f352500dddeadb4412c Author: Cristian Ciocaltea Date: Thu Sep 7 20:10:00 2023 +0300 ASoC: cs35l41: Handle mdsync_down reg write errors The return code of regmap_multi_reg_write() call related to "MDSYNC down" sequence is shadowed by the subsequent wait_for_completion_timeout() invocation, which is expected to time timeout in case the write operation failed. Let cs35l41_global_enable() return the correct error code instead of -ETIMEDOUT. Fixes: f5030564938b ("ALSA: cs35l41: Add shared boost feature") Signed-off-by: Cristian Ciocaltea Acked-by: Charles Keepax Reviewed-by: Takashi Iwai Link: https://lore.kernel.org/r/20230907171010.1447274-2-cristian.ciocaltea@collabora.com Signed-off-by: Mark Brown commit ce22caa4a1f050ceee47b45f2e531cf7bfbe0b63 Author: Linus Walleij Date: Mon Sep 11 10:23:54 2023 +0200 ASoC: max98927: Drop pointless includes This driver is already using solely GPIO descriptors and do not need to include the legacy headers or . Drop them. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-7-b9d793fb768e@linaro.org Signed-off-by: Mark Brown commit 0d22f950eb6a0a177826f9cc4f2fc0aa1b560228 Author: Linus Walleij Date: Mon Sep 11 10:23:53 2023 +0200 ASoC: max98520: Drop pointless includes This driver is already using solely GPIO descriptors and do not need to include the legacy headers or . Drop them. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-6-b9d793fb768e@linaro.org Signed-off-by: Mark Brown commit 0a5b7ee05f871272fa3ca43ee9f91282e0c4ffe7 Author: Linus Walleij Date: Mon Sep 11 10:23:52 2023 +0200 ASoC: max98396: Drop pointless include This driver is already using solely GPIO descriptors and do not need to include the legacy header . Drop it. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-5-b9d793fb768e@linaro.org Signed-off-by: Mark Brown commit 832beb640e425b5d1a92d8c2002e6b8e0af693eb Author: Linus Walleij Date: Mon Sep 11 10:23:51 2023 +0200 ASoC: max98388: Correct the includes The MAX98388 driver is using the modern GPIO descriptor API but uses legacy includes. Include the proper header instead. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-4-b9d793fb768e@linaro.org Signed-off-by: Mark Brown commit d3091d09de46e7ea88fa943efd458094e6a6ceb6 Author: Linus Walleij Date: Mon Sep 11 10:23:50 2023 +0200 ASoC: max98373: Convert to use GPIO descriptors Instead of relying on legacy interfaces, convert the driver to use GPIO descriptors. This is a straight-forward conversion, we support also sdw devices providing GPIO descriptor tables if they so desire. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-3-b9d793fb768e@linaro.org Signed-off-by: Mark Brown commit 02de898322869442cf6d6f4ba8f22cbdc5889f4b Author: Linus Walleij Date: Mon Sep 11 10:23:49 2023 +0200 ASoC: max98357a: Drop pointless include This driver is already using solely GPIO descriptors and do not need to include the legacy header . Drop it. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-2-b9d793fb768e@linaro.org Signed-off-by: Mark Brown commit 637a7969ef5780536f4d422f116fdee238bf1d18 Author: Linus Walleij Date: Mon Sep 11 10:23:48 2023 +0200 ASoC: max9768: Convert to use GPIO descriptors The MAX9768 is pretty straight forward to convert to GPIO descriptors. To name the GPIO properties, I looke at the bindings in maxim,max9759.yaml which names these GPIO "mute" and "shutdown" respectively. No board files using platform data exist in the kernel, new users can use GPIO descriptor tables if desired. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-1-b9d793fb768e@linaro.org Signed-off-by: Mark Brown commit c588e1c9846b32182fd5a0ceb637b983810e7100 Author: Yoshihiro Shimoda Date: Tue Sep 5 10:24:04 2023 +0900 arm64: dts: renesas: r8a779f0: spider: Enable PCIe Host ch0 Enable PCIe Host controller channel 0 on R-Car S4-8 Spider board. Since this board has an Oculink connector, CLKREQ# pin of PFC for PCIe should not be used. So, using a GPIO is used to output the clock instead. Otherwise the controller cannot detect a PCIe device. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230905012404.2915246-3-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 183a709d3719e5c9919a6f12c86c0a3e088b712d Author: Yoshihiro Shimoda Date: Tue Sep 5 10:24:03 2023 +0900 arm64: dts: renesas: r8a779f0: Add PCIe Host and Endpoint nodes Add PCIe Host and Endpoint nodes for R-Car S4-8 (R8A779F0). Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230905012404.2915246-2-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 4cc222e187902dfff0ae729871279eaba163ad04 Author: Geert Uytterhoeven Date: Thu Aug 31 13:52:24 2023 +0200 ARM: dts: renesas: gr-peach: Remove unneeded probe-type property The "probe-type" property was only needed when used with the (long obsolete) "direct-mapped" compatible value. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/b2a74d02468f4032e7c3c3a90c85c5e05ebdefa7.1693481518.git.geert+renesas@glider.be commit ed5290f235863d63b46bc36900113a0da0a362c8 Author: Geert Uytterhoeven Date: Thu Aug 31 13:52:23 2023 +0200 ARM: dts: renesas: ape6evm: Drop bogus "mtd-rom" compatible value make dtbs_check: arch/arm/boot/dts/r8a73a4-ape6evm.dtb: flash@0: compatible: 'oneOf' conditional failed, one must be fixed: ['cfi-flash', 'mtd-rom'] is too long 'cfi-flash' is not one of ['amd,s29gl01gp', 'amd,s29gl032a', 'amd,s29gl256n', 'amd,s29gl512n', 'arm,versatile-flash', 'arm,vexpress-flash', 'cortina,gemini-flash', 'cypress,hyperflash', 'ge,imp3a-firmware-mirror', 'ge,imp3a-paged-flash', 'gef,ppc9a-firmware-mirror', 'gef,ppc9a-paged-flash', 'gef,sbc310-firmware-mirror', 'gef,sbc310-paged-flash', 'gef,sbc610-firmware-mirror', 'gef,sbc610-paged-flash', 'intel,28f128j3', 'intel,dt28f160', 'intel,ixp4xx-flash', 'intel,JS28F128', 'intel,JS28F640', 'intel,PC28F640P30T85', 'numonyx,js28f00a', 'numonyx,js28f128', 'sst,sst39vf320', 'xlnx,xps-mch-emc-2.00.a'] 'cfi-flash' is not one of ['cypress,cy7c1019dv33-10zsxi', 'arm,vexpress-psram'] 'mtd-rom' is not one of ['cfi-flash', 'jedec-flash'] 'mtd-ram' was expected From schema: Documentation/devicetree/bindings/mtd/mtd-physmap.yaml Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/1c773aed6bd794cf36a9a787f77469eaa1359bef.1693481518.git.geert+renesas@glider.be commit edc6ef026fe69154bb6b70dd6e7f278cfd7d6919 Author: Geert Uytterhoeven Date: Wed Aug 30 17:21:38 2023 +0200 ARM: dts: renesas: blanche: Fix typo in GP_11_2 pin name On blanche, the GPIO keyboard fails to probe with: sh-pfc e6060000.pinctrl: could not map pin config for "GP_11_02" Fix this by correcting the name for this pin to "GP_11_2". Fixes: 1f27fedead91eb60 ("ARM: dts: blanche: Configure pull-up for SOFT_SW and SW25 GPIO keys") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/203128eca2261ffc33b83637818dd39c488f42b0.1693408326.git.geert+renesas@glider.be commit 8edc16a1e27a941670907a94d15dbf7f68fbf8c7 Author: Krzysztof Kozlowski Date: Mon Jul 31 11:57:30 2023 +0200 ARM: dts: samsung: s5pv210-galaxys: switch sound card to audio-routing "samsung,audio-routing" property is being deprecated, so switch to generic "audio-routing". Link: https://lore.kernel.org/r/20230731095730.204567-8-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 04e08772a1ffa0620fbf89dfaed3a7aef724c739 Author: Krzysztof Kozlowski Date: Mon Jul 31 11:57:29 2023 +0200 ARM: dts: samsung: s5pv210-fascinate4g: switch sound card to audio-routing "samsung,audio-routing" property is being deprecated, so switch to generic "audio-routing". Link: https://lore.kernel.org/r/20230731095730.204567-7-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit c670e7c8f72f68b4fc20eb85fa6101b5ce108515 Author: Krzysztof Kozlowski Date: Mon Jul 31 11:57:28 2023 +0200 ARM: dts: samsung: exynos5422-odroid: switch sound card to audio-routing "samsung,audio-routing" property is being deprecated, so switch to generic "audio-routing". Link: https://lore.kernel.org/r/20230731095730.204567-6-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit f632a4376134722cb16c78d819505aedd9c0d8e3 Author: Krzysztof Kozlowski Date: Mon Jul 31 11:57:27 2023 +0200 ARM: dts: samsung: exynos4412-odroid: switch sound card to audio-routing "samsung,audio-routing" property is being deprecated, so switch to generic "audio-routing". Link: https://lore.kernel.org/r/20230731095730.204567-5-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 1222d604dbbbe54a9e9d5811d46f0680cc9972ce Author: Krzysztof Kozlowski Date: Mon Jul 31 11:57:26 2023 +0200 ARM: dts: samsung: exynos4412-n710x: switch sound card to audio-routing "samsung,audio-routing" property is being deprecated, so switch to generic "audio-routing". Link: https://lore.kernel.org/r/20230731095730.204567-4-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit a1116f96688c7e2d210635ec7cb631473d8ef653 Author: Krzysztof Kozlowski Date: Mon Jul 31 11:57:25 2023 +0200 ARM: dts: samsung: exynos4412-galaxy-s3: switch sound card to audio-routing "samsung,audio-routing" property is being deprecated, so switch to generic "audio-routing". Link: https://lore.kernel.org/r/20230731095730.204567-3-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit fc730f1702e2a5de9ad52f98189460c0d7d75916 Author: Krzysztof Kozlowski Date: Mon Jul 31 11:57:24 2023 +0200 ARM: dts: samsung: exynos4212-tab3: switch sound card to audio-routing "samsung,audio-routing" property is being deprecated, so switch to generic "audio-routing". Link: https://lore.kernel.org/r/20230731095730.204567-2-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit 4179ae98fd525f2895ac726fcd433e730c5e8727 Author: Krzysztof Kozlowski Date: Mon Jul 31 11:57:23 2023 +0200 arm64: dts: exynos: exynos5433-tm2: switch sound card to audio-routing "samsung,audio-routing" property is being deprecated, so switch to generic "audio-routing". Link: https://lore.kernel.org/r/20230731095730.204567-1-krzysztof.kozlowski@linaro.org Signed-off-by: Krzysztof Kozlowski commit f2802c62cca923ff394766c2fec23b00563f33c3 Author: Kuninori Morimoto Date: Tue Aug 22 05:57:55 2023 +0000 arm64: dts: renesas: Handle ADG bit for sound clk_i Renesas Sound has been using CPG_AUDIO_CLK_I on CPG_CORE for clock, but this was wrong. Instead, it needs to use CPG_MOD, so clk_i can handle the "ADG" bit in SMSTPCR9. Signed-off-by: Kuninori Morimoto Tested-by: Vincenzo De Michele [r8a77965] Tested-by: Patrick Keil [r8a77965] Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/87y1i3sjoc.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87wmxnsjo7.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87v8d7sjo2.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87ttsrsjnx.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87sf8bsjns.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87r0nvsjnn.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87pm3fsjni.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87o7izsjnd.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87msyjsjn9.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87lee3sjn4.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87jztnsjmy.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87il97sjmu.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87h6orsjmp.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87fs4bsjml.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87edjvsjmg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven commit 9578db7939fcfa0bdfa6ab767fd0386adf2302eb Author: Hans de Goede Date: Sat Sep 9 16:18:16 2023 +0200 platform/x86: x86-android-tablets: Drop "linux,power-supply-name" from lenovo_yt3_bq25892_0_props[] The "linux,power-supply-name" property is a left-over from an earlier attempt to allow properties to specify the power_supply class-device name. The patch to read this property never made it upstream (and is no longer necessary). Drop the unused property. Signed-off-by: Hans de Goede Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20230909141816.58358-9-hdegoede@redhat.com commit 61226c1cfaf87d8ace76148f6fea42e3d1989373 Author: Hans de Goede Date: Sat Sep 9 16:18:15 2023 +0200 platform/x86: x86-android-tablets: Use platform-device as gpio-keys parent Use the new x86-android-tablets platform-device as gpio-keys parent to make it clear that this gpio-keys device was instantiated by the x86-android-tablets driver. Signed-off-by: Hans de Goede Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20230909141816.58358-8-hdegoede@redhat.com commit 4014ae236b1d490f5db798d159a03470aec71a40 Author: Hans de Goede Date: Sat Sep 9 16:18:14 2023 +0200 platform/x86: x86-android-tablets: Stop using gpiolib private APIs Refactor x86_android_tablet_get_gpiod() to no longer use gpiolib private functions like gpiochip_find(). As a bonus this allows specifying that the GPIO is active-low, like the /CE (charge enable) pin on the bq25892 charger on the Lenovo Yoga Tablet 3. Reported-by: Bartosz Golaszewski Closes: https://lore.kernel.org/platform-driver-x86/20230905185309.131295-12-brgl@bgdev.pl/ Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20230909141816.58358-7-hdegoede@redhat.com commit 8b57d33a6fdbb53d03da762b31e65a1027f74caf Author: Hans de Goede Date: Sat Sep 9 16:18:13 2023 +0200 platform/x86: x86-android-tablets: Create a platform_device from module_init() Create a platform_device from module_init() and change x86_android_tablet_init() / cleanup() into platform_device probe() and remove() functions. This is a preparation patch for refactoring x86_android_tablet_get_gpiod() to no longer use gpiolib private functions like gpiochip_find(). Signed-off-by: Hans de Goede Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20230909141816.58358-6-hdegoede@redhat.com commit 56e1f53b58fd13e642a9665eb014860f31f5fc1d Author: Hans de Goede Date: Sat Sep 9 16:18:12 2023 +0200 platform/x86: x86-android-tablets: Remove invalid_aei_gpiochip support x86_dev_info.invalid_aei_gpiochip is no longer used by any boards and the x86-android-tablets code should not use the gpiolib private acpi_gpiochip_free_interrupts() function. Reported-by: Bartosz Golaszewski Closes: https://lore.kernel.org/platform-driver-x86/20230905185309.131295-12-brgl@bgdev.pl/ Signed-off-by: Hans de Goede Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20230909141816.58358-5-hdegoede@redhat.com commit 1fc95b025f1873ea701655d30c5b8bb9f97d7d28 Author: Hans de Goede Date: Sat Sep 9 16:18:11 2023 +0200 platform/x86: x86-android-tablets: Remove invalid_aei_gpiochip from Peaq C1010 Remove the invalid_aei_gpiochip setting from the x86_dev_info for the Peaq C1010. This is no longer necessary since there now is a quirk to ignore the "dolby" button GPIO in gpiolib_acpi_quirks[] in drivers/gpio/gpiolib-acpi.c . Signed-off-by: Hans de Goede Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20230909141816.58358-4-hdegoede@redhat.com commit 6cc64f6173751d212c9833bde39e856b4f585a3e Author: Hans de Goede Date: Sat Sep 9 16:18:10 2023 +0200 gpiolib: acpi: Add a ignore interrupt quirk for Peaq C1010 On the Peaq C1010 2-in-1 INT33FC:00 pin 3 is connected to a "dolby" button. At the ACPI level an _AEI event-handler is connected which sets an ACPI variable to 1 on both edges. This variable can be polled + cleared to 0 using WMI. Since the variable is set on both edges the WMI interface is pretty useless even when polling. So instead of writing a custom WMI driver for this the x86-android-tablets code instantiates a gpio-keys platform device for the "dolby" button. Add an ignore_interrupt quirk for INT33FC:00 pin 3 on the Peaq C1010, so that it is not seen as busy when the gpio-keys driver requests it. Note this replaces a hack in x86-android-tablets where it would call acpi_gpiochip_free_interrupts() on the INT33FC:00 GPIO controller. acpi_gpiochip_free_interrupts() is considered private (internal) gpiolib API so x86-android-tablets should stop using it. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Reviewed-by: Mika Westerberg Acked-by: Linus Walleij Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230909141816.58358-3-hdegoede@redhat.com commit 5fb36a8c87d9e99a88d6e9128f1f9ec62f8545f1 Author: Hans de Goede Date: Sat Sep 9 16:18:09 2023 +0200 gpiolib: acpi: Check if a GPIO is listed in ignore_interrupt earlier In some cases where a broken AEI is present for a GPIO and the GPIO is listed in the ignore_interrupt list to avoid the broken event handler, the kernel may want to use the GPIO for another purpose. Before this change trying to use such a GPIO for another purpose would fail, because the ignore_interrupt list was only checked after the acpi_request_own_gpiod() call, causing the GPIO to already be claimed even though it is listed in the ignore_interrupt list. Fix this by moving the ignore_interrupt list to above the acpi_request_own_gpiod() call. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Reviewed-by: Mika Westerberg Acked-by: Linus Walleij Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20230909141816.58358-2-hdegoede@redhat.com commit 21c11421db1fdd5ed7c8ea7048178b365185cd3a Author: Geert Uytterhoeven Date: Wed Aug 30 17:25:55 2023 +0200 pinctrl: renesas: r8a7779: s/LSBC/LBSC/ Fix a misspelling of "LBSC" (Local Bus State Controller). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/129f08c4246f88fd5a25ca5b82c255919b71ca6c.1693409115.git.geert+renesas@glider.be commit f2951ee8f7bcdb3844ffe6e54b0601ad8fa58640 Author: Sam Protsenko Date: Fri Aug 25 16:54:45 2023 -0500 arm64: dts: exynos: Enable USB support on E850-96 board The E850-96 board has a micro-USB socket and two USB 2.0 host sockets. The USB role (host or peripheral) is selected automatically depending on micro-USB cable attachment state: - micro-USB cable is attached: USB device role - micro-USB cable is detached: USB host role USB can't act simultaneously as a device and a host, because Exynos850 SoC has only one USB controller and there are no external USB controllers on the E850-96 board. So the USB switch chip (specifically TS3USB221A) connects SoC USB lines either to micro-USB connector or to USB hub chip (LAN9514), w.r.t. micro-USB cable attachment state. When USB works in the host role, Ethernet capability becomes available too, as the LAN9514 chip (providing USB hub) also enables Ethernet PHY and Ethernet MAC. Dynamic role switching is done in gpio-usb-b-connector, using current micro-USB VBUS line level as a trigger: - VBUS=high: SoC USB lines are wired to micro-USB socket - VBUS=low: SoC USB lines are wired to USB hub chip In order to make USB host functional when the board was booted with micro-USB cable disconnected, role-switch-default-mode = "host" is used. One can use E850-96 board schematics [1] to figure out how exactly all related USB hardware connections and lines reflect into corresponding device tree definitions. As PMIC regulators are not implemented yet, we rely on USB LDOs being already enabled in the bootloader. A dummy regulator is provided to "usbdrd" vdd nodes for now. [1] https://www.96boards.org/documentation/consumer/e850-96b/hardware-docs/ Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20230825215445.28309-3-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit 2f911ca41e519dc5986f9483d3e15df4802b64f5 Author: Sam Protsenko Date: Fri Aug 25 16:54:44 2023 -0500 arm64: dts: exynos: Enable USB in Exynos850 Add USB controller and USB PHY controller nodes for Exynos850 SoC. The USB controller has next features: - Dual Role Device (DRD) controller - DWC3 compatible - Supports USB 2.0 host and USB 2.0 device interfaces - Supports full-speed (12 Mbps) and high-speed (480 Mbps) modes with USB device 2.0 interface - Supports on-chip USB PHY transceiver - Supports up to 16 bi-directional endpoints (that includes control endpoint 0) - Complies with xHCI 1.00 specification Only USB 2.0 is supported in Exynos850, so only UTMI+ PHY interface is specified in "phys" property (index 0) and PIPE3 is omitted (index 1). Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20230825215445.28309-2-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit f3ea14c6a243d927c172caf123e9d2ce803fdafc Author: Yang Yingliang Date: Wed Aug 2 17:19:20 2023 +0800 clk: renesas: r9a06g032: Use for_each_compatible_node() Use for_each_compatible_node() instead of open-coding it. Signed-off-by: Yang Yingliang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20230802091920.3270703-1-yangyingliang@huawei.com Signed-off-by: Geert Uytterhoeven commit e57b0eef66849732e4ec28277f70e56220c53477 Author: Rohit Chavan Date: Thu Aug 24 13:43:04 2023 +0530 RDMA/core: Fix repeated words in comments Corrected the repeated words in the documentation of rdma_replace_ah_attr() and ib_resolve_unicast_gid_dmac() functions. Signed-off-by: Rohit Chavan Link: https://lore.kernel.org/r/20230824081304.408-1-roheetchavan@gmail.com Signed-off-by: Leon Romanovsky commit 3ec648c631d27a61d8069f610251d9a752cfc6bd Author: Krzysztof Kozlowski Date: Wed Aug 23 11:29:12 2023 +0200 IB: Use capital "OR" for multiple licenses in SPDX Documentation/process/license-rules.rst and checkpatch expect the SPDX identifier syntax for multiple licenses to use capital "OR". Correct it to keep consistent format and avoid copy-paste issues. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230823092912.122674-1-krzysztof.kozlowski@linaro.org Signed-off-by: Leon Romanovsky commit 2cf254c1e24fa8f01f42f5a8c77617e56bf50b86 Author: Johannes Berg Date: Wed Aug 30 11:31:04 2023 +0300 wifi: iwlwifi: increase number of RX buffers for EHT devices EHT devices can support 512 MPDUs in an A-MPDU, each of which might be an A-MSDU and thus further contain multiple MSDUs, which need their own buffer each. Increase the number of buffers to avoid running out in high-throughput scenarios. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.824e522927f1.Ie5b4a2d3953072b9d76054ae67e2e45900d6bba4@changeid Signed-off-by: Johannes Berg commit 9f9797c7de18d2ec6be4ef6e0abbaea585040b39 Author: Johannes Berg Date: Wed Aug 30 11:31:03 2023 +0300 wifi: iwlwifi: pcie: fix RB status reading On newer hardware, a queue's RB status / write pointer can be bigger than 4095 (0xFFF), so we cannot mask the value by 0xFFF unconditionally. Since anyway that's only necessary on older hardware, move the masking to the helper function and apply it only for older HW. This also moves the endian conversion in to handle it more easily. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.7be2a3fff6f4.I94f11dee314a4f7c1941d2d223936b1fa8aa9ee4@changeid Signed-off-by: Johannes Berg commit 09212dd727397a401aff8dfc98311697b084e507 Author: Johannes Berg Date: Wed Aug 30 11:31:02 2023 +0300 wifi: iwlwifi: mvm: reduce maximum RX A-MPDU size Since 1024 isn't being tested right now, allow only 512 for now. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.6e80366716ad.I19022084ac978b9960b12b205c052a83ab141203@changeid Signed-off-by: Johannes Berg commit 3d6d21b29226cc945445d346254e281e031264b9 Author: Johannes Berg Date: Wed Aug 30 11:31:01 2023 +0300 wifi: iwlwifi: mvm: check link more carefully Some cases of restart crashing here have been reported, while we figure out where this is going wrong, check the link more carefully to avoid the crash. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.2b81f52ce18e.I8f3b1962013107e2d7491d817c3349359341c6ee@changeid Signed-off-by: Johannes Berg commit 4831d19b40244d3298df707a1b5ad1e9fb32fd38 Author: Johannes Berg Date: Wed Aug 30 11:31:00 2023 +0300 wifi: iwlwifi: mvm: move RU alloc B2 placement The firmware was trying to report the B2 RU allocation in the place previously used here as well, but there's a HW block that clears the lower 8 bits in this metadata word even in sniffer mode. Thus, firmware moved B2 to another place, follow that. There's no need to detect the version since moving it to the other place if firmware didn't just means that we'll continue to report the (erroneous) zero value, and it's not really something we can detect from the firmware now. While debugging this we realized that the comments about placement in the metadata dwords are wrong, update them. Reported-by: Youhan Kim Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.dec7f1e07ff8.I623fee2d710cc7b6f392d65b708883ed58632b45@changeid Signed-off-by: Johannes Berg commit 1647fc9885799e4555fada45766304b2f70b9e7d Author: Johannes Berg Date: Wed Aug 30 11:30:59 2023 +0300 wifi: iwlwifi: fw: reconstruct the API/CAPA enum number The last member of the enum is meant to count the items, but sparse cannot increment the previous member due to its bitwise type. Declaring the last entry with a value doesn't work either (cannot mix bitwise/non-bitwise) and declaring it with a bitwise value doesn't work due to the way it gets used. This led to the current construct. However, that construct the kernel-doc script doesn't understand this construct due to the use of #ifdef/#else. Find another solution that makes both tools happy, we do now do declare it as the bitwise value but then just redefine it so that doesn't get used, all still under __CHECKER__ conditional. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.44bdf6a5fa9e.I9f1ea129f89e53043d48676aed0a3b8f6c31ac08@changeid Signed-off-by: Johannes Berg commit e110bf0c826663fd5afa7fb94207c5127044537b Author: Johannes Berg Date: Wed Aug 30 11:30:58 2023 +0300 wifi: iwlwifi: mvm: fix kernel-doc Fix kernel-doc, adding various documentation, but in some cases (notably rate scaling) just removing the erroneous comment format. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.4ce1159b51ab.I2021ae335f6b8e50ee2c1c78a79c5eac1c1aa103@changeid Signed-off-by: Johannes Berg commit 221e290bee238f6b81ea39b4ba781209e8fd07f3 Author: Johannes Berg Date: Wed Aug 30 11:30:57 2023 +0300 wifi: iwlwifi: pcie: fix kernel-doc issues Fix various missing kernel-doc annotations etc. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.a11b39f9a07e.Ia7b189f003db8f6ccaf0a547e71c80e00b85fb5a@changeid Signed-off-by: Johannes Berg commit 744b7e1ef249ea60c57b16b68037521a75554379 Author: Johannes Berg Date: Wed Aug 30 11:30:56 2023 +0300 wifi: iwlwifi: dvm: remove kernel-doc warnings Mostly remove kernel-doc comment annotation since the comments really aren't kernel-doc, and fix a few other places. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.7178fb7c96fb.I6af1f291e306c50a3c4f5afcdc2ba0bbd4bea01f@changeid Signed-off-by: Johannes Berg commit 2ce9c74777999686f44aac27be22e85bedd6e9bc Author: Johannes Berg Date: Wed Aug 30 11:30:55 2023 +0300 wifi: iwlwifi: queue: fix kernel-doc Fix the kernel-doc annotations here, adding the trans parameter and fixing the syntax. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.247919faf4fd.I489f8b3b2ebb49a421bd5d76ea0201262134fb67@changeid Signed-off-by: Johannes Berg commit c46fcc6e43d617252945e706f04e5f82a59f2b8e Author: Miri Korenblit Date: Wed Aug 30 11:30:54 2023 +0300 wifi: iwlwifi: don't use an uninitialized variable Don't use variable err uninitialized. The reason for removing the check instead of initializing it in the beginning of the function is because that way static checkers will be able to catch issues if we do something wrong in the future. Fixes: bf976c814c86 ("wifi: iwlwifi: mvm: implement link change ops") Signed-off-by: Miri Korenblit Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.431b01bd8779.I31fc4ab35f551b85a10f974a6b18fc30191e9c35@changeid Signed-off-by: Johannes Berg commit 594de1229f89943f4f6140cadb8ea188749d7de8 Author: Johannes Berg Date: Wed Aug 30 11:30:53 2023 +0300 wifi: iwlwifi: fix some kernel-doc issues Fix kernel-doc issues. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.2edc4d82f717.Ic7c6f1153939903b067062c9aec8fb70e0a2c30d@changeid Signed-off-by: Johannes Berg commit e0c1ca236e28e4263fba76d47a108ed95dcae33e Author: Emmanuel Grumbach Date: Wed Aug 30 11:30:52 2023 +0300 wifi: iwlwifi: honor the enable_ini value In case the user sets the enable_ini to some preset, we want to honor the value. Remove the ops to set the value of the module parameter is runtime, we don't want to allow to modify the value in runtime since we configure the firmware once at the beginning on its life. Fixes: b49c2b252b58 ("iwlwifi: Configure FW debug preset via module param.") Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.5734e0f374bb.I6698eda8ed2112378dd47ac5d62866ebe7a94f77@changeid Signed-off-by: Johannes Berg commit aee2eac7ccbe975cd1463f558cffc34605e02050 Author: Johannes Berg Date: Wed Aug 30 11:30:51 2023 +0300 wifi: iwlwifi: mvm: disconnect long CSA only w/o alternative If there's an alternative link to use while the CSA is in progress, there's no need to disconnect since another link is still usable during the switching time. Change the code here to handle that accordingly. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.dd1b96a37e51.Idafdcbfcb36ca4c486f4221aef77643869331514@changeid Signed-off-by: Johannes Berg commit 11d0d8311925e1c26e413fbbb8286d84be63fa61 Author: Johannes Berg Date: Wed Aug 30 11:30:50 2023 +0300 wifi: iwlwifi: mvm: increase session protection after CSA In the spec, CSA is defined roughly as follows: - TBTT x: beacon with CSA, count=n (old channel) - TBTT x+1: beacon with CSA, count=n-1 (old channel) - TBTT x+n-1: beacon with CSA, count=1 (old channel) "A Channel Switch Count field set to 1 indicates that the switch occurs immediately before the next TBTT. - TBTT x+n: beacon without CSA (new channel) When we detect it, we currently schedule the CSA event to be at 10 TUs before TBTT x+n-1, for a beacon interval, to give us quiet time. When this event *starts*, we currently notify mac80211 that the channel switch happened, which causes us to add a session protection event to listen for the first beacon (and enable TX etc. when that arrives). We don't even ask for a notification when this event ends so the code that handles that is effectively dead code. The session protection duration is 3 beacon intervals, scheduled at 10 TU before TBTT x+n-1. It will thus end just before TBTT x+n+2. Unfortunately, if the AP doesn't transmit or we miss just the first two beacons on the new channel, then this will cause us to disconnect. Or even just one, if the AP isn't quite aligned with the TBTT after the switch. However, listening to the _end_ of the time event isn't what we want either, because we want all the new PHY and other config that needs to come from mac80211 to start early, so we have a head-start for the new channel, since we're not going to use the old one anyway for this time. So since we don't really have anything better to do at this time, and this is relatively rare, just make the session protection use 5x the beacon interval instead of just 3x, so it's more likely we catch a beacon even if the AP neglected to send it, or we just miss it. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.a74176bac37c.I029a2ebcd1b5012327c728ffa1d33fac19cfdf4b@changeid Signed-off-by: Johannes Berg commit 3723c7c5f65e09a0f417cc73831faa039a31ecb3 Author: Emmanuel Grumbach Date: Wed Aug 30 11:30:49 2023 +0300 wifi: iwlwifi: mvm: support CSA with MLD Pass the right link_id to ieee80211_chswitch_done. Use the link_conf parameter passed to post_channel_switch() to get the right ap_sta_id. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230830112059.19470584fa51.Iad38b5369bededaa126b3eb3cff79f23d61bd783@changeid Signed-off-by: Johannes Berg commit 86a8db67a1330c203ae54cf25f1af08616e2e3c2 Author: Johannes Berg Date: Sun Aug 27 14:05:32 2023 +0300 wifi: mac80211: fix channel switch link data Use the correct link ID and per-link puncturing data instead of hardcoding link ID 0 and using deflink puncturing. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.0b6a211c8e75.I5724d32bb2dae440888efbc47334d8c115db9d50@changeid Signed-off-by: Johannes Berg commit 563fe446ef2b30d0eb918a46070cfc7fb41290a7 Author: Ilan Peer Date: Sun Aug 27 14:05:31 2023 +0300 wifi: mac80211: Do not force off-channel for management Tx with MLO When user space transmits a management frame it is expected to use the MLD addresses if the connection is an MLD one. Thus, in case the management Tx is using the MLD address and no channel is configured off-channel should not be used (as one of the active links would be used). Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.73c8efce252f.Ie4b0a842debb24ef25c5e6cb2ad69b9f46bc4b2a@changeid Signed-off-by: Johannes Berg commit 90668e3204f197f64ac7eb60650c22fb6ec8db6e Author: Johannes Berg Date: Sun Aug 27 14:05:30 2023 +0300 wifi: mac80211: take MBSSID/EHT data also from probe resp The code that sets up the assoc link will currently take the BSS element data from the beacon only. This is correct for some of the data, notably the timing and the "have_beacon", but all the data about MBSSID and EHT really doesn't need to be taken from there, and if the EHT puncturing is misconfigured on the AP but we didn't receive a beacon yet, this causes us to connect but immediately disconnect upon receiving the first beacon, rather than connecting without EHT in the first place. Change the code to take MBSSID and EHT data also from the probe response, for a better picture of what the BSS capabilities are and to avoid that EHT puncturing problem. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.3c7e52d49482.Iba6b672f6dc74b45bba26bc497e953e27da43ef9@changeid Signed-off-by: Johannes Berg commit 0f99f0878350f907b31c1ea091c807faa566dded Author: Ilan Peer Date: Sun Aug 27 14:05:29 2023 +0300 wifi: mac80211: Print local link address during authentication To ease debugging, mostly in cases that authentication fails. Signed-off-by: Ilan Peer Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.9c08605e2691.I0032e9d6e01325862189e4a20b02ddbe8f2f5e75@changeid Signed-off-by: Johannes Berg commit 428e8976a15f849ad92b1c1e38dda2a684350ff7 Author: Johannes Berg Date: Sun Aug 27 14:05:28 2023 +0300 wifi: mac80211: fix # of MSDU in A-MSDU calculation During my refactoring I wanted to get rid of the switch, but replaced it with the wrong calculation. Fix that. Fixes: 175ad2ec89fe ("wifi: mac80211: limit A-MSDU subframes for client too") Reported-by: Emmanuel Grumbach Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.51bf1b8b0adb.Iffbd337fdad2b86ae12f5a39c69fb82b517f7486@changeid Signed-off-by: Johannes Berg commit 8107807891eae9d9de67ff35a40d09354ca265ec Author: Johannes Berg Date: Sun Aug 27 14:05:27 2023 +0300 wifi: mac80211_hwsim: clean up kernel-doc Clean up kernel-doc in hwsim's header file. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.6127359dba54.I8a9ab3d5fc0c0041624b96ab7350097f3f60fbe0@changeid Signed-off-by: Johannes Berg commit 2a53743989868016ac42e578b1ac959014b6b17b Author: Johannes Berg Date: Sun Aug 27 14:05:26 2023 +0300 wifi: cfg80211: reg: fix various kernel-doc issues Clean up the kernel-doc comments in reg.h. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.36d7b52da0f5.I85fbfb3095613f4a0512493cbbdda881dc31be2c@changeid Signed-off-by: Johannes Berg commit 799f53e223cb1bd2155d6aaaf3c3d3955440abfb Author: Johannes Berg Date: Sun Aug 27 14:05:25 2023 +0300 wifi: mac80211: fix various kernel-doc issues There are various kernel-doc issues here, fix them. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.7ce9761f9ebb.I0f44e76c518f72135cc855c809bfa7a5e977b894@changeid Signed-off-by: Johannes Berg commit fe5cb719e78d4507afbada6ccf9730447002d6e2 Author: Johannes Berg Date: Sun Aug 27 14:05:24 2023 +0300 wifi: mac80211: remove unnecessary struct forward declaration This just causes kernel-doc to complain at this spot, but isn't actually needed anyway, so remove it. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.33a5591dfdeb.If4e7e1a1cb4c04f0afd83db7401c780404dca699@changeid Signed-off-by: Johannes Berg commit 79aa3a09a7ff03c66d3f35a157ead0abb7e49812 Author: Benjamin Berg Date: Sun Aug 27 14:05:23 2023 +0300 wifi: mac80211: add more warnings about inserting sta info The sta info needs to be inserted before its links may be modified. Add a few warnings to prevent accidental usage of these functions. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.eeb43b3cc9e3.I5fd8236f70e64bf6268f33c883f7a878d963b83e@changeid Signed-off-by: Johannes Berg commit 5806ef25bc6e6cf0c04005ff25a4585437d567de Author: Benjamin Berg Date: Sun Aug 27 14:05:22 2023 +0300 wifi: cfg80211: add ieee80211_fragment_element to public API This function will be used by the kunit tests within cfg80211. As it is generally useful, move it from mac80211 to cfg80211. Signed-off-by: Benjamin Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.5af9391659f5.Ie534ed6591ba02be8572d4d7242394f29e3af04b@changeid Signed-off-by: Johannes Berg commit ffbd0c8c1e7f86408919d023cf87119b9b7385d5 Author: Johannes Berg Date: Sun Aug 27 14:05:21 2023 +0300 wifi: mac80211: add an element parsing unit test Add a unit test for the parsing of a fragmented sta profile sub-element inside a fragmented multi-link element. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.333bc75df13f.I0ddfeb6a88a4d89e7c7850e8ef45a4b19b5a061a@changeid Signed-off-by: Johannes Berg commit 730eeb17bbdd3c31f91e2a4fff35dd7e9c67d706 Author: Johannes Berg Date: Sun Aug 27 14:05:20 2023 +0300 wifi: cfg80211: add first kunit tests, for element defrag Add a couple of tests for element defragmentation, to see that the function works correctly. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.e2a5cead1816.I09f0edc19d162b54ee330991c728c1e9aa42ebf6@changeid Signed-off-by: Johannes Berg commit 43125539fc69c6aa63d34b516939431391bddeac Author: Johannes Berg Date: Sun Aug 27 14:05:19 2023 +0300 wifi: cfg80211: fix off-by-one in element defrag If a fragment is the last element, it's erroneously not accepted. Fix that. Fixes: f837a653a097 ("wifi: cfg80211: add element defragmentation helper") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230827135854.adca9fbd3317.I6b2df45eb71513f3e48efd196ae3cddec362dc1c@changeid Signed-off-by: Johannes Berg commit a469a5938d1fd98e50119893f22541fe6e269f02 Author: Emmanuel Grumbach Date: Mon Aug 28 13:04:10 2023 +0300 wifi: mac80211: add support for mld in ieee80211_chswitch_done This allows to finalize the CSA per link. In case the switch didn't work, tear down the MLD connection. Also pass the ieee80211_bss_conf to post_channel_switch to let the driver know which link completed the switch. Signed-off-by: Emmanuel Grumbach Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230828130311.3d3eacc88436.Ic2d14e2285aa1646216a56806cfd4a8d0054437c@changeid Signed-off-by: Johannes Berg commit 5ea82df1f50e42416d0a8a7c42d37cc1df1545fe Author: Johannes Berg Date: Mon Sep 11 11:57:52 2023 +0200 wifi: mac80211: fix RCU usage warning in mesh fast-xmit In mesh_fast_tx_flush_addr() we already hold the lock, so don't need additional hashtable RCU protection. Use the rhashtable_lookup_fast() variant to avoid RCU protection warnings. Fixes: d5edb9ae8d56 ("wifi: mac80211: mesh fast xmit support") Signed-off-by: Johannes Berg commit 0d423c4a78984dd02f6596d6fd9dd40446eec517 Author: Alexey Romanov Date: Wed Aug 30 17:08:50 2023 +0300 drivers: meson: sm: correct meson_sm_* API retval handling 1. Following the ARM SMC32 calling convention, the return value from secure monitor is a 32-bit signed integer. This patch changes the type of the return value of the function meson_sm_call(). 2. Now, when meson_sm_call() returns a 32-bit signed integer, we need to ensure that this value is not negative. It is important to check that the return value is not negative in both the meson_sm_call_read() and meson_sm_call_write() functions. 3. Add a comment explaining why it is necessary to check if the SMC return value is equal to 0 in the function meson_sm_call_read(). It is not obvious when reading this code. Signed-off-by: Alexey Romanov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230830140850.17130-1-avromanov@salutedevices.com Signed-off-by: Neil Armstrong commit a42b8f639298c57f119c6d5f55a0c0c87259096a Author: Alexander Stein Date: Tue Aug 8 18:17:53 2023 +0200 arm64: dts: meson-g12: Fix compatible for amlogic,g12a-tdmin amlogic,axg-tdmin is not listed as compatible to g12a-tdmin in bindings. Remove superfluous compatible. Fixes the dtbs_check warnings: arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtb: audio-controller@300: compatible: ['amlogic,g12a-tdmin', 'amlogic,axg-tdmin'] is too long from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-formatters.yaml# arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtb: audio-controller@340: compatible: ['amlogic,g12a-tdmin', 'amlogic,axg-tdmin'] is too long from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-formatters.yaml# arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtb: audio-controller@380: compatible: ['amlogic,g12a-tdmin', 'amlogic,axg-tdmin'] is too long from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-formatters.yaml# arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtb: audio-controller@3c0: compatible: ['amlogic,g12a-tdmin', 'amlogic,axg-tdmin'] is too long from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-formatters.yaml# Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20230808161755.31594-2-alexander.stein@mailbox.org Signed-off-by: Neil Armstrong commit c92997482e70c67ce7b9b32344fe85c4b0cb701d Author: Alexander Stein Date: Tue Aug 8 18:17:52 2023 +0200 arm64: dts: meson-g12: Fix clock order for amlogic,axg-tdm-iface devices Binding specify order of clocks as: 1. "sclk" 2. "lrclk" 3. "mclk" Adjust clocks accordingly. Fixes warnings: arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtb: audio-controller-0: clock-names:0: 'sclk' was expected from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml# arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtb: audio-controller-0: clock-names:1: 'lrclk' was expected from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml# arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtb: audio-controller-0: clock-names:2: 'mclk' was expected from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml# arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtb: audio-controller-1: clock-names:0: 'sclk' was expected from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml# arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtb: audio-controller-1: clock-names:1: 'lrclk' was expected from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml# arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtb: audio-controller-1: clock-names:2: 'mclk' was expected from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml# arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtb: audio-controller-2: clock-names:0: 'sclk' was expected from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml# arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtb: audio-controller-2: clock-names:1: 'lrclk' was expected from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml# arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtb: audio-controller-2: clock-names:2: 'mclk' was expected from schema $id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml# Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20230808161755.31594-1-alexander.stein@mailbox.org Signed-off-by: Neil Armstrong commit 7ca2ef33179f4e1887727c1b5fac39721db8050e Author: Arseniy Krasnov Date: Mon Aug 28 16:36:47 2023 +0300 arm64: dts: amlogic: meson-axg: Meson NAND node Add description of the Meson NAND controller node. Signed-off-by: Arseniy Krasnov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230828133647.3712644-1-avkrasnov@salutedevices.com Signed-off-by: Neil Armstrong commit ec5e354f5d6755bcfd014c974aff11a024999c67 Author: Dmitry Rokosov Date: Thu Aug 24 00:36:30 2023 +0300 dt-bindings: arm: amlogic: add Amlogic AD402 bindings Add the compatible for the Amlogic A1 Based AD402 board. Signed-off-by: Dmitry Rokosov Acked-by: Conor Dooley Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-16-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit f031c3739081f92bbf841064e4547900c5c98d97 Author: Dmitry Rokosov Date: Thu Aug 24 00:36:29 2023 +0300 arm64: dts: introduce Amlogic AD402 reference board based on A113L SoC Supported IPs: CPU, GIC, IRQ, Timer, UART, Reserved memory for secos, OPTEE client, fixed regulators, UART for HCI, SPI NAND, SARADC, USB and SDIO. Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-15-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit 4cc74a6ba19e83c3d4e16a51de7533d25ed2a00c Author: Alexey Romanov Date: Thu Aug 24 00:36:28 2023 +0300 arm64: dts: meson: a1: add ao secure node Add node for board info registers, which allows getting SoC family and board revision. For example, with MESON_GX_SOCINFO config enabled we can get the following information for board with Meson A1 SoC: soc soc0: Amlogic Meson A1 (A113L) Revision 2c:a (1:a) Detected Signed-off-by: Alexey Romanov Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-14-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit 2466460a9c431fdc0fbe33b7f118bb20dd77e2e7 Author: Alexey Romanov Date: Thu Aug 24 00:36:27 2023 +0300 arm64: dts: meson: a1: add hw rng node Add hardware number generator node. HWRNG access requires OTP power domain being enabled. Signed-off-by: Alexey Romanov Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-13-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit 92a24ceb69dd88bfe11177eb6e4a39f433a569e0 Author: George Stark Date: Thu Aug 24 00:36:26 2023 +0300 arm64: dts: meson: a1: add saradc definition Add saradc node to Amlogic Meson A1 SoC main dtsi. Saradc is Successive Approximation Register (SAR) A/D Converter. Signed-off-by: George Stark Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-12-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit 4d860a98bcf39e946e3419f3d42120374590080f Author: Jan Dakinevich Date: Thu Aug 24 00:36:25 2023 +0300 arm64: dts: meson: a1: add eMMC controller and its pins The definition is inspired by a similar one for AXG SoC family. 'sdio_pins' and 'sdio_clk_gate_pins' pinctrls are supposed to be used as "default" and "clk-gate" in board-specific device trees. During initialization 'meson-gx' driver sets clock to safe low-frequency value (400kHz). However, both source clocks ("clkin0" and "clkin1") are high-frequency by default, and using of eMMC's internal divider is not enough to achieve so low values. To provide low-frequency source, reparent "sd_emmc_sel2" clock using 'assigned-clocks' property. Signed-off-by: Jan Dakinevich Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-11-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit dba516fa1981250ab2e27535926532564f658bb1 Author: Oleg Lyovin Date: Thu Aug 24 00:36:24 2023 +0300 arm64: dts: meson: a1: introduce UART_AO mux definitions The Amlogic A1 has a UART_AO port, which can be used, for example, for BT HCI H4 connection. This patch adds mux definitions for it. Signed-off-by: Oleg Lyovin Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-10-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit 8a398729c9b3de40cd820169f3eb09f0a005ec16 Author: Martin Kurbanov Date: Thu Aug 24 00:36:23 2023 +0300 arm64: dts: meson: a1: introduce SPI Flash Controller This controller can be used for spinand flash connection. Signed-off-by: Martin Kurbanov Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-9-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit 28b2f803401b759dd84e2c067a3b7022347b30b1 Author: Alexey Romanov Date: Thu Aug 24 00:36:22 2023 +0300 arm64: dts: meson: a1: enable efuse controller and setup its clk EFUSE A1 controller uses CLKID_OTP clock and PWRC_OTP_ID power domain. Signed-off-by: Alexey Romanov Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-8-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit d3261b54364858e9b410cdf0b9016abfaacd380a Author: Dmitry Rokosov Date: Thu Aug 24 00:36:21 2023 +0300 arm64: dts: meson: a1: support USB controller in OTG mode Amlogic A1 SoC family has USB2.0 controller based on dwc2 and dwc3 heads. It supports otg/host/peripheral modes. Signed-off-by: Yue Wang Signed-off-by: Hanjie Lin Signed-off-by: Dmitry Rokosov Reviewed-by: Martin Blumenstingl Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-7-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit af07cc67f1a5c30373971f02f239a34fac626e74 Author: Dmitry Rokosov Date: Thu Aug 24 00:36:20 2023 +0300 arm64: dts: meson: a1: introduce PLL and Peripherals clk controllers This patch adds clkc and clkc_pll dts nodes to A1 SoC main dtsi. The first one is responsible for all SoC peripherals clocks excluding audio clocks. The second one is used by A1 SoC PLLs. Actually, there are two different APB heads, so we have two different drivers. Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-6-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit 90da39d5429d4c65d110e6506c3ed9bf281bb838 Author: Dmitry Rokosov Date: Thu Aug 24 00:36:19 2023 +0300 arm64: dts: meson: a1: reorder gpio_intc node definition It is recommended to maintain a sorted order of device tree entries, so move the gpio_intc node ahead of the uart_AO node. Fixes: ea254644a228 ("arm64: dts: meson-a1: add gpio_intc node") Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-5-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit bea51840f66df74a454ccb47a23faf826b214347 Author: Dmitry Rokosov Date: Thu Aug 24 00:36:18 2023 +0300 arm64: dts: meson: a1: remove the unnecessary 'okay' status pwrc value In the file 'meson-a1.dtsi,' which is a basic device tree include, it is not necessary to mark the node with 'status = "okay"' because it is enabled by default. Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-4-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit 37cc8d01260ee71439ec17fa52bc72f0139d6983 Author: Dmitry Rokosov Date: Thu Aug 24 00:36:17 2023 +0300 arm64: dts: meson: a1: remove extra empty line before reset node There should be only one empty line between device tree node definitions. Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-3-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit 7124c482dd6f939cd608d97664b04666f7cdaa2a Author: Dmitry Rokosov Date: Thu Aug 24 00:36:16 2023 +0300 arm64: dts: meson: a1: reorder includes to keep them sorted It is recommended to alphabetically sort all headers included in the dtsi. Signed-off-by: Dmitry Rokosov Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230823213630.12936-2-ddrokosov@sberdevices.ru Signed-off-by: Neil Armstrong commit dc8bc779feb5e855421215384f23de90a4fcd622 Author: Zelong Dong Date: Fri Aug 25 19:53:10 2023 +0800 arm64: dts: meson: add IR controller for Meson-S4 SoC Add the IR controller device of Meson-S4 SoC family. Signed-off-by: Zelong Dong Reviewed-by: Neil Armstrong Link: https://lore.kernel.org/r/20230825115310.39993-4-zelong.dong@amlogic.com Signed-off-by: Neil Armstrong commit 8a63d22183d0d96d742e34730430cc1f286c7092 Author: Huqiang Qin Date: Wed Aug 2 11:32:22 2023 +0800 arm64: dts: Add watchdog node for Amlogic-T7 SoCs Add watchdog device. Signed-off-by: Huqiang Qin Reviewed-by: Dmitry Rokosov Link: https://lore.kernel.org/r/20230802033222.4024946-5-huqiang.qin@amlogic.com Signed-off-by: Neil Armstrong commit cfae4eadb7cd44cb5f17285e18477bed4ae5f03c Author: Christian Hewitt Date: Tue Aug 15 09:27:51 2023 +0000 arm64: dts: meson: add audio playback to u200 Add initial support limited to HDMI i2s and SPDIF (LPCM). Signed-off-by: Christian Hewitt Link: https://lore.kernel.org/r/20230815092751.1791195-4-christianshewitt@gmail.com Signed-off-by: Neil Armstrong commit 2b2827a19024abcf879c18053ae3f2fc23891ad4 Author: Christian Hewitt Date: Tue Aug 15 09:27:50 2023 +0000 arm64: dts: meson: add audio playback to p201 Add initial audio support limited to HDMI i2s. Signed-off-by: Christian Hewitt Link: https://lore.kernel.org/r/20230815092751.1791195-3-christianshewitt@gmail.com Signed-off-by: Neil Armstrong commit 61373cc074128c40d53857803371c4a9384d4200 Author: Christian Hewitt Date: Tue Aug 15 09:27:49 2023 +0000 arm64: dts: meson: add audio playback to p200 Add initial support limited to HDMI i2s and SPDIF (LPCM). Signed-off-by: Christian Hewitt Link: https://lore.kernel.org/r/20230815092751.1791195-2-christianshewitt@gmail.com Signed-off-by: Neil Armstrong commit 3db174e478cb0bb34888c20a531608b70aec9c1f Author: Huisong Li Date: Tue Aug 1 14:38:27 2023 +0800 mailbox: pcc: Support shared interrupt for multiple subspaces If the platform acknowledge interrupt is level triggered, then it can be shared by multiple subspaces provided each one has a unique platform interrupt ack preserve and ack set masks. If it can be shared, then we can request the irq with IRQF_SHARED and IRQF_ONESHOT flags. The first one indicating it can be shared and the latter one to keep the interrupt disabled until the hardirq handler finished. Further, since there is no way to detect if the interrupt is for a given channel as the interrupt ack preserve and ack set masks are for clearing the interrupt and not for reading the status(in case Irq Ack register may be write-only on some platforms), we need a way to identify if the given channel is in use and expecting the interrupt. PCC type0, type1 and type5 do not support shared level triggered interrupt. The methods of determining whether a given channel for remaining types should respond to an interrupt are as follows: - type2: Whether the interrupt belongs to a given channel is only determined by the status field in Generic Communications Channel Shared Memory Region, which is done in rx_callback of PCC client. - type3: This channel checks chan_in_use flag first and then checks the command complete bit(value '1' indicates that the command has been completed). - type4: Platform ensure that the default value of the command complete bit corresponding to the type4 channel is '1'. This command complete bit is '0' when receive a platform notification. The new field, 'chan_in_use' is used by the type only support the communication from OSPM to Platform (like type3) and should be completely ignored by other types so as to avoid too many type unnecessary checks in IRQ handler. Signed-off-by: Huisong Li Reviewed-by: Hanjun Guo Link: https://lore.kernel.org/r/20230801063827.25336-3-lihuisong@huawei.com Signed-off-by: Sudeep Holla commit 60c40b06fa68694dd08a1a0038ea8b9de3f3b1ca Author: Huisong Li Date: Tue Aug 1 14:38:26 2023 +0800 mailbox: pcc: Add support for platform notification handling Currently, PCC driver doesn't support the processing of platform notification for type 4 PCC subspaces. According to ACPI specification, if platform sends a notification to OSPM, it must clear the command complete bit and trigger platform interrupt. OSPM needs to check whether the command complete bit is cleared, clear platform interrupt, process command, and then set the command complete and ring doorbell to the Platform. Let us stash the value of the pcc type and use the same while processing the interrupt of the channel. We also need to set the command complete bit and ring doorbell in the interrupt handler for the type 4 channel to complete the communication flow after processing the notification from the Platform. Signed-off-by: Huisong Li Reviewed-by: Hanjun Guo Link: https://lore.kernel.org/r/20230801063827.25336-2-lihuisong@huawei.com Signed-off-by: Sudeep Holla commit e8c1841278a78362f7034f3de415096ddb19f097 Author: Johannes Berg Date: Mon Aug 28 09:54:39 2023 +0200 wifi: cfg80211: annotate iftype_data pointer with sparse There were are a number of cases in mac80211 and iwlwifi (at least) that used the sband->iftype_data pointer directly, instead of using the accessors to find the right array entry to use. Make sparse warn when such a thing is done. To not have a lot of casts, add two helper functions/macros - ieee80211_set_sband_iftype_data() - for_each_sband_iftype_data() Signed-off-by: Johannes Berg commit 05f136220d17839eb7c155f015ace9152f603225 Author: Johannes Berg Date: Tue Aug 29 20:16:11 2023 +0200 wifi: mac80211: fix BA session teardown race As previously reported by Alexander, whose commit 69403bad97aa ("wifi: mac80211: sdata can be NULL during AMPDU start") I'm reverting as part of this commit, there's a race between station destruction and aggregation setup, where the aggregation setup can happen while the station is being removed and queue the work after ieee80211_sta_tear_down_BA_sessions() has already run in __sta_info_destroy_part1(), and thus the worker will run with a now freed station. In his case, this manifested in a NULL sdata pointer, but really there's no guarantee whatsoever. The real issue seems to be that it's possible at all to have a situation where this occurs - we want to stop the BA sessions when doing _part1, but we cannot be sure, and WLAN_STA_BLOCK_BA isn't necessarily effective since we don't know that the setup isn't concurrently running and already got past the check. Simply call ieee80211_sta_tear_down_BA_sessions() again in the second part of station destruction, since at that point really nothing else can hold a reference to the station any more. Also revert the sdata checks since those are just misleading at this point. Signed-off-by: Johannes Berg commit cbaccdc42483c65016f1bae89128c08dc17cfb2a Author: Dmitry Antipov Date: Tue Aug 29 12:41:01 2023 +0300 wifi: mac80211_hwsim: fix clang-specific fortify warning When compiling with clang 16.0.6 and CONFIG_FORTIFY_SOURCE=y, I've noticed the following (somewhat confusing due to absence of an actual source code location): In file included from drivers/net/wireless/virtual/mac80211_hwsim.c:18: In file included from ./include/linux/slab.h:16: In file included from ./include/linux/gfp.h:7: In file included from ./include/linux/mmzone.h:8: In file included from ./include/linux/spinlock.h:56: In file included from ./include/linux/preempt.h:79: In file included from ./arch/x86/include/asm/preempt.h:9: In file included from ./include/linux/thread_info.h:60: In file included from ./arch/x86/include/asm/thread_info.h:53: In file included from ./arch/x86/include/asm/cpufeature.h:5: In file included from ./arch/x86/include/asm/processor.h:23: In file included from ./arch/x86/include/asm/msr.h:11: In file included from ./arch/x86/include/asm/cpumask.h:5: In file included from ./include/linux/cpumask.h:12: In file included from ./include/linux/bitmap.h:11: In file included from ./include/linux/string.h:254: ./include/linux/fortify-string.h:592:4: warning: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] __read_overflow2_field(q_size_field, size); The compiler actually complains on 'mac80211_hwsim_get_et_strings()' where fortification logic inteprets call to 'memcpy()' as an attempt to copy the whole 'mac80211_hwsim_gstrings_stats' array from its first member and so issues an overread warning. This warning may be silenced by passing an address of the whole array and not the first member to 'memcpy()'. Signed-off-by: Dmitry Antipov Link: https://lore.kernel.org/r/20230829094140.234636-1-dmantipov@yandex.ru Signed-off-by: Johannes Berg commit b7600aae8a20ff267ae82ff3c51cef536cd6383d Author: Johannes Berg Date: Tue Aug 29 11:25:50 2023 +0200 wifi: mac80211: fix TXQ error path and cleanup We currently call ieee80211_txq_teardown_flows() as part of ieee80211_remove_interfaces(), but that's not really right in case of HW registration failures, specifically rate control. Call it separately to fix that issue. Reported-by: Zhengchao Shao Signed-off-by: Johannes Berg commit 2ae5c9248e06dac2c2360be26b4e25f673238337 Author: Jeff Johnson Date: Thu Aug 31 11:22:58 2023 -0700 wifi: mac80211: Use flexible array in struct ieee80211_tim_ie Currently struct ieee80211_tim_ie defines: u8 virtual_map[1]; Per the guidance in [1] change this to be a flexible array. Per the discussion in [2] wrap the virtual_map in a union with a u8 item in order to preserve the existing expectation that the virtual_map must contain at least one octet (at least when used in a non-S1G PPDU). This means that no driver changes are required. [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays [2] https://lore.kernel.org/linux-wireless/202308301529.AC90A9EF98@keescook/ Suggested-by: Kees Cook Signed-off-by: Jeff Johnson Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20230831-ieee80211_tim_ie-v3-2-e10ff584ab5d@quicinc.com [add wifi prefix] Signed-off-by: Johannes Berg commit 076fc8775dafe995e94c106bb732bf2d42dedcea Author: Johannes Berg Date: Tue Aug 29 12:18:56 2023 +0200 wifi: cfg80211: remove wdev mutex Since we're now protecting everything with the wiphy mutex (and were really using it for almost everything before), there's no longer any real reason to have a separate wdev mutex. It may feel better, but really has no value. Signed-off-by: Johannes Berg commit a7614b482d64a1d7f595178b12d71f12936ba9a3 Author: Johannes Berg Date: Mon Aug 28 14:00:07 2023 +0200 wifi: mac80211: set wiphy for virtual monitors Drivers might plausibly want to have this, but also the locking assertions will need it later. Signed-off-by: Johannes Berg commit be0df01dae0f21303a7a523dbba35159cf6dfe77 Author: Johannes Berg Date: Mon Aug 28 14:00:06 2023 +0200 wifi: mac80211: reduce iflist_mtx We now hold the wiphy mutex everywhere that we use or needed the iflist_mtx, so we don't need this mutex any more in mac80211. However, drivers may also iterate, and in some cases (e.g. mt76) do so from high-priority contexts. Thus, keep the mutex around but remove its usage in mac80211 apart from those driver-visible parts that are still needed. Most of this change was done automatically with spatch, with the parts that are still needed as described above reverted manually. Signed-off-by: Johannes Berg commit 0cd8080e46b834fa72026112488ab61d4b82f03a Author: Johannes Berg Date: Mon Aug 28 14:00:05 2023 +0200 wifi: mac80211: remove local->mtx We now hold the wiphy mutex everywhere that we use or needed the local->mtx, so we don't need this mutex any more. Remove it. Most of this change was done automatically with spatch. Signed-off-by: Johannes Berg commit 463559b7c3fe5fab1a4b60cd3454ef84a5dc51b8 Author: Johannes Berg Date: Mon Aug 28 14:00:04 2023 +0200 wifi: mac80211: remove ampdu_mlme.mtx We now hold the wiphy mutex everywhere that we use or needed the A-MPDU locking, so we don't need this mutex any more. Remove it. Most of this change was done automatically with spatch. Signed-off-by: Johannes Berg commit 5435af6e6ac0132178b13d57ffc756dab5eef626 Author: Johannes Berg Date: Mon Aug 28 14:00:03 2023 +0200 wifi: mac80211: remove chanctx_mtx We now hold the wiphy mutex everywhere that we use or needed the chanctx_mtx, so we don't need this mutex any more. Remove it. Most of this change was done automatically with spatch. Signed-off-by: Johannes Berg commit 2a8b665e6bcc3d554beb0d7cc1e4fd78dd94b55d Author: Johannes Berg Date: Mon Aug 28 14:00:02 2023 +0200 wifi: mac80211: remove key_mtx We now hold the wiphy mutex everywhere that we use or needed the key_mtx, so we don't need this mutex any more. Remove it. Most of this change was done automatically with spatch. Signed-off-by: Johannes Berg commit 4d3acf4311a0401e3e97c2f2302256cd9d7f5692 Author: Johannes Berg Date: Mon Aug 28 14:00:01 2023 +0200 wifi: mac80211: remove sta_mtx We now hold the wiphy mutex everywhere that we use or needed the sta_mtx, so we don't need this mutex any more. Remove it. Most of this change was done automatically with spatch. Signed-off-by: Johannes Berg commit a26787aa13974fb0b3fb42bfeb4256c1b686e305 Author: Johannes Berg Date: Mon Aug 28 14:00:00 2023 +0200 wifi: mac80211: take wiphy lock for MAC addr change We want to ensure everything holds the wiphy lock, so also extend that to the MAC change callback. Signed-off-by: Johannes Berg commit 332e68bc5526226f50a946b5dd980bba12902595 Author: Johannes Berg Date: Mon Aug 28 13:59:59 2023 +0200 wifi: mac80211: extend wiphy lock in interface removal We want to extend the wiphy locking to the interface list, so move that into the section locked with the wiphy lock. Signed-off-by: Johannes Berg commit 7a53b71d8ebc67b1a23b0cc8dd8b8024e3af9d27 Author: Johannes Berg Date: Mon Aug 28 13:59:58 2023 +0200 wifi: mac80211: hold wiphy_lock around concurrency checks We want to replace the locking in mac80211 by just the wiphy mutex, so hold the lock here around concurrency checks for the future where the chanctx_mtx used inside goes away. Signed-off-by: Johannes Berg commit 01ca280d323ef4a7e6732615b1faaa8877cc417f Author: Johannes Berg Date: Mon Aug 28 13:59:57 2023 +0200 wifi: mac80211: ethtool: hold wiphy mutex We should hold the wiphy mutex here since we're going to call the driver and want to remove the sta_mtx. Signed-off-by: Johannes Berg commit 1474bc87fe57deac726cc10203f73daa6c3212f7 Author: Johannes Berg Date: Mon Aug 28 13:59:56 2023 +0200 wifi: cfg80211: check wiphy mutex is held for wdev mutex This might seem pretty pointless rather than changing the locking immediately, but it seems safer to run for a while with checks and the old locking scheme, and then remove the wdev lock later. Signed-off-by: Johannes Berg commit fa8809a519d85f498f43fadaf82e10831f20625a Author: Johannes Berg Date: Mon Aug 28 13:59:55 2023 +0200 wifi: cfg80211: hold wiphy lock in cfg80211_any_wiphy_oper_chan() We have the RTNL here for the iteration, but we need to lock each wiphy separately as well for using its data. Hold the wiphy lock for all of the ones in the iteration. Note that this implies we cannot already hold the wiphy mutex for the wiphy passed by the argument, but that's true now. Signed-off-by: Johannes Berg commit beb2df475b7cfcc3e107afb4dd2a031bc34fe416 Author: Johannes Berg Date: Mon Aug 28 13:59:54 2023 +0200 wifi: cfg80211: sme: hold wiphy lock for wdev iteration Since we will want to remove the wdev lock in the future, lock the wiphy here to iterate and for checking the status of the connections. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit 0320d68f568126f617a346f601a58254b55e6c31 Author: Johannes Berg Date: Mon Aug 28 13:59:53 2023 +0200 wifi: cfg80211: reg: hold wiphy mutex for wdev iteration Since we will want to remove the wdev lock in the future, lock the wiphy here to iterate and check the flags. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit 0e8185ce1ddebf9de43b1f0fa92bf6dbba6ffb86 Author: Johannes Berg Date: Mon Aug 28 13:59:52 2023 +0200 wifi: mac80211: check wiphy mutex in ops Check that we hold the wiphy mutex in the ops when calling the driver, since we're now on our way to always hold it, and simplify the locking. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit b38579aeb5b04fb34828843457f6d9d6fa3b79c3 Author: Johannes Berg Date: Mon Aug 28 13:59:51 2023 +0200 wifi: mac80211: move color change finalize to wiphy work Again this should be per link and will get cancellation issues, move it to a wiphy work. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit d7074be64a6c0ee7fa81288f182eb22a8127a26e Author: Johannes Berg Date: Mon Aug 28 13:59:50 2023 +0200 wifi: mac80211: move CSA finalize to wiphy work This work should be made per link as well, and then will have cancellation issues. Moving it to a wiphy work already fixes those beforehand. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit a6add8bee6a166d4f15bbd231ce7b71ad88bb8db Author: Johannes Berg Date: Mon Aug 28 13:59:49 2023 +0200 wifi: mac80211: move filter reconfig to wiphy work This again is intended for future cleanups that are possible when mac80211 and drivers can assume the wiphy is locked. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit aca40a5fa679708b9cc7d0de5255e6d6f4b9d2c9 Author: Johannes Berg Date: Mon Aug 28 13:59:48 2023 +0200 wifi: mac80211: move tspec work to wiphy work One more work that will now execute with the wiphy locked, for future cleanups. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit e3208fb739e522fcae7cb8342ac82ebb45d32a2b Author: Johannes Berg Date: Mon Aug 28 13:59:47 2023 +0200 wifi: mac80211: move key tailroom work to wiphy work This way we hold the wiphy mutex there, as a step towards removing some of the additional locks we have. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit 777b26002b73127e81643d9286fadf3d41e0e477 Author: Johannes Berg Date: Mon Aug 28 13:59:46 2023 +0200 wifi: mac80211: move TDLS work to wiphy work Again, to have the wiphy locked for it. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit eadfb54756aea5610d8d0a467f66305f777c85dd Author: Johannes Berg Date: Mon Aug 28 13:59:45 2023 +0200 wifi: mac80211: move sched-scan stop work to wiphy work This also has the wiphy locked here then. We need to use the _locked version of cfg80211_sched_scan_stopped() now, which also fixes an old deadlock there. Fixes: a05829a7222e ("cfg80211: avoid holding the RTNL when calling the driver") Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit 9fa659f9f4a2af348f3075f539dde3ceeb9fc9b6 Author: Johannes Berg Date: Mon Aug 28 13:59:44 2023 +0200 wifi: mac80211: move dynamic PS to wiphy work Along with everything else, move the dynamic PS work to be a wiphy work, to simplify locking later. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit 7206a948715414371a285db8f1aab050f7a3941e Author: Johannes Berg Date: Mon Aug 28 13:59:43 2023 +0200 wifi: mac80211: move link activation work to wiphy work We want to have the wiphy locked for these as well, so move it to be a wiphy work. Signed-off-by: Johannes Berg commit 97c19e42b264e6b71a9ff9deea04c19f621805b9 Author: Johannes Berg Date: Mon Aug 28 13:59:42 2023 +0200 wifi: mac80211: move offchannel works to wiphy work Make the offchannel works wiphy works to have the wiphy locked for executing them. Signed-off-by: Johannes Berg commit 730538edc8e0eb14b02708f65100a0deaf43e6cd Author: Johannes Berg Date: Mon Aug 28 13:59:41 2023 +0200 wifi: mac80211: lock wiphy in IP address notifier Lock the wiphy in the IP address notifier as another place that should have it locked before calling into the driver. This needs a bit of attention since the notifier can be called while the wiphy is already locked, when we remove an interface. Handle this by not running the notifier in this case, and instead calling out to the driver directly. Signed-off-by: Johannes Berg commit ac2f7d6f2765a10b5075e0024706df7e845e7890 Author: Johannes Berg Date: Mon Aug 28 13:59:40 2023 +0200 wifi: mac80211: move monitor work to wiphy work Again this serves to simplify the locking in mac80211 in the future, since this is a relatively complex work. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit 201712512cbbda360f62c222a4bab260350462a0 Author: Johannes Berg Date: Mon Aug 28 13:59:39 2023 +0200 wifi: mac80211: move scan work to wiphy work Move the scan work to wiphy work, which also simplifies the way we handle the work vs. the scan configuration. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit 228e4f931b0e630dacca8dd867ddd863aea53913 Author: Johannes Berg Date: Mon Aug 28 13:59:38 2023 +0200 wifi: mac80211: move radar detect work to wiphy work Move the radar detect work to wiphy work in order to lock the wiphy for it without doing it manually. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit 766d2601a6e50b52c5dcc47dce6d64faa2cffb30 Author: Johannes Berg Date: Mon Aug 28 13:59:37 2023 +0200 wifi: mac80211: move DFS CAC work to wiphy work Move the DFS CAC work over to hold the wiphy lock there without worry about work cancellation. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit 5549b0885d6fbad79e0e471a9a863bd2f45af0c5 Author: Johannes Berg Date: Mon Aug 28 13:59:36 2023 +0200 wifi: mac80211: add more ops assertions Add more might_sleep() checks and check sdata-in-driver for one additional place. type=feature ticket=jira:WIFI-314309 Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit 1b6721189570b7955ff745934fb0e428313e6e51 Author: Johannes Berg Date: Mon Aug 28 13:59:35 2023 +0200 wifi: mac80211: convert A-MPDU work to wiphy work Convert the A-MPDU work to wiphy work so it holds the wiphy mutex and we can later guarantee that to drivers. It might seem that we could run these concurrently for different stations, but they're all on the ordered mac80211 workqueue, so this shouldn't matter for that. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg commit b920590f9a7f7359d37d260726b32dbb21b833be Author: Johannes Berg Date: Mon Aug 28 13:59:34 2023 +0200 wifi: mac80211: flush wiphy work where appropriate Before converting more works to wiphy work, add flushing in mac80211 where we also flush the mac80211 workqueue. Not needed in suspend since cfg80211 will have taken care of it. Signed-off-by: Johannes Berg commit 56cfb8ce1f7f6c4e5ca571a2ec0880e131cd0311 Author: Johannes Berg Date: Mon Aug 28 13:59:33 2023 +0200 wifi: cfg80211: add flush functions for wiphy work There may be sometimes reasons to actually run the work if it's pending, add flush functions for both regular and delayed wiphy work that will do this. Signed-off-by: Johannes Berg commit 7483a2147aebea537e1447489109eeb5e771aff5 Author: Johannes Berg Date: Mon Aug 28 13:59:32 2023 +0200 wifi: cfg80211: check RTNL when iterating devices Add a new "for_each_rdev()" macro and check that we hold the RTNL when calling it. Signed-off-by: Johannes Berg commit e911a8192e29d7326e9062947ecd753c8572eb09 Author: Johannes Berg Date: Mon Aug 28 13:59:31 2023 +0200 wifi: mac80211: lock wiphy for aggregation debugfs To change aggregation status may call into the driver, lock the wiphy for this. Signed-off-by: Johannes Berg commit 0ab6cba0696da4c6dff6e047ef8aa6c9c0fadf13 Author: Johannes Berg Date: Mon Aug 28 13:59:30 2023 +0200 wifi: mac80211: hold wiphy lock in netdev/link debugfs It's no longer really needed to ensure that the debugfs file isn't going away, debugfs handles that. So there's no point in holding dev_base_lock or RTNL here, but we should instead hold the wiphy lock since drivers will be allowed to depend on that. Do that, which requires splitting the sdata and link macros a bit. Signed-off-by: Johannes Berg commit 629ebb8532e96c3921fe8828c650ce03b697cfdd Author: Johannes Berg Date: Mon Aug 28 13:59:29 2023 +0200 wifi: mac80211: debugfs: lock wiphy instead of RTNL Since we no longer really use the RTNL, there's no point in locking it here. Most drivers don't really need to have any locks here anyway, and the rest are probably completely broken, but it's a debugfs-only callback so it really doesn't matter much. Signed-off-by: Johannes Berg commit e3640a82e573f008e5c2058a7971873fa1d438c5 Author: Johannes Berg Date: Mon Aug 28 15:09:26 2023 +0200 wifi: mac80211: fix SMPS status handling The current SMPS status handling isn't per link, so we only ever change the deflink, which is obviously wrong, it's not even used for multi-link connections, but the request API actually includes the link ID. Use the new status_data changes to move the handling to the right link, this also saves parsing the frame again on the status report, instead we can now check only if it was an SMPS frame. Of course, move the worker to be a wiphy work so that we're able to cancel it safely for the link. Signed-off-by: Johannes Berg commit e665ab9c5aab79e1c576a220013419ef215c3b6a Author: Ilan Peer Date: Mon Aug 28 15:09:25 2023 +0200 wifi: mac80211: Fix SMPS handling in the context of MLO When the connection is a MLO connection, a SMPS request should be sent on a specific link, as SMPS is BSS specific, and the DA and BSSID used for the action frame transmission should be the AP MLD address, as the underlying driver is expected to perform the address translation (based on the link ID). Fix the SMPS request handling to use the AP MLD address and provide the link ID for the request processing during Tx. Signed-off-by: Ilan Peer Signed-off-by: Johannes Berg commit f498f6ab7adb461a68e13ea6d4443cb3636f2d93 Author: Johannes Berg Date: Mon Aug 28 15:09:24 2023 +0200 wifi: mac80211: rework ack_frame_id handling a bit Take one more free bit to indicate it's IDR vs. internal usage, to be able to carve out some bits here for other internal usage, other than IDR handling with a full ACK SKB, that is. Reviewed-by: Benjamin Berg Reviewed-by: Ilan Peer Signed-off-by: Johannes Berg commit 0499bead73d77a5d63cde8e2c516552f750e6193 Author: Johannes Berg Date: Mon Aug 28 15:09:23 2023 +0200 wifi: mac80211: tx: clarify conditions in if statement This really just reformats the statement, but makes it more readable. Signed-off-by: Johannes Berg commit b32415652a4d250c51c1f1cc59a02c58e7141417 Author: Bartosz Golaszewski Date: Mon Sep 4 14:33:20 2023 +0200 gpio: eic-sprd: use atomic notifiers to notify all chips about irqs Calling gpiochip_find() from interrupt handler in this driver is an abuse of the GPIO API. It only happens to work because nobody added a might_sleep() to it and the lock used by GPIOLIB is a spinlock. Both will soon be changed as we're limiting both the number of interfaces allowed to be called from atomic context as well as making struct gpio_chip private to the GPIO code that owns it. We'll also switch to protecting the global GPIO device list with a mutex as there is no reason to allow changes to it from interrupt handlers. Instead of iterating over all SPRD chips and looking up each corresponding GPIO chip, let's make each SPRD GPIO controller register with a notifier chain. The chain will be called at interrupt so that every chip that already probed will be notified. The rest of the interrupt handling remains the same. This should result in faster code as we're avoiding iterating over the list of all GPIO devices. Signed-off-by: Bartosz Golaszewski Reviewed-by: Chunyan Zhang Tested-by: Wenhua Lin commit f4e840238c4c956fec196894d3d853f4e5abe509 Author: Bartosz Golaszewski Date: Wed Sep 6 16:51:18 2023 +0200 gpio: mb86s7x: don't include gpiolib.h The gpiolib.h is unnecessarily included in the driver. None of its symbols are used so drop it. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko commit ee27ed13dc9eb70e3f1cda6640ff996020a7c14d Author: Bartosz Golaszewski Date: Wed Sep 6 16:50:45 2023 +0200 gpio: dwapb: don't include gpiolib.h The gpiolib.h is unnecessarily included in the driver. None of its symbols are used so drop it. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko commit f8681c23678528e4eb79d86be7a6fb59bb26a274 Author: Bartosz Golaszewski Date: Wed Sep 6 16:23:57 2023 +0200 gpio: xgene-sb: don't include gpiolib.h The gpiolib.h is unnecessarily included in the driver. None of its symbols are used so drop it. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko commit 37d42ab3924919652858f836a80ab49ec7d11f1e Author: Bartosz Golaszewski Date: Fri Sep 1 13:34:58 2023 +0200 gpiolib: remove unnecessary extern specifiers from the driver header 'extern' doesn't do anything for function declarations. Remove it. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij commit 8de54392b849a612f337044d81d9859ee95ab871 Author: Bartosz Golaszewski Date: Fri Sep 1 13:35:20 2023 +0200 gpiolib: remove stray newline in gpio/driver.h Fix a double newline in the GPIO provider header. Signed-off-by: Bartosz Golaszewski commit 7e12c495a36c3f7bf265db80238f89a72171f381 Author: Bartosz Golaszewski Date: Tue Sep 5 20:53:04 2023 +0200 gpio: of: correct notifier return codes According to the comments in linux/notifier.h, the code to return when a notifications is "not for us" is NOTIFY_DONE, not NOTIFY_OK. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij commit f42dafe3da0cd887c9d2aaa59576f2a92ee4d876 Author: Bartosz Golaszewski Date: Sun Sep 3 21:06:57 2023 +0200 gpiolib: unexport gpiod_set_transitory() There are no and never have been any users of gpiod_set_transitory() outside the core GPIOLIB code. Make it private. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij commit ed9e8d136f6d3d3265ee91bebf6fc934d5ba5a96 Author: Bartosz Golaszewski Date: Thu Sep 7 16:52:30 2023 +0200 gpio: mockup: don't access internal GPIOLIB structures Don't include gpiolib.h. Track the request status of lines locally instead. In order to retrieve the device name use the fact that gpio-mockup supports only a single GPIO device per platform device and call device_find_any_child(). Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij commit 33f909fdd151affe93941d4433b9ca62c3a1a8c5 Author: Bartosz Golaszewski Date: Thu Sep 7 16:52:29 2023 +0200 gpio: mockup: simplify code by using cleanup helpers Use lock from linux/cleanup.h and simplify locking paths. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij commit 9790222d2881b98a6301d0fc8b0db0afad64ba3e Author: Bartosz Golaszewski Date: Thu Sep 7 16:52:28 2023 +0200 gpio: mockup: deprecate the old testing module We have a much better alternative to the clunky old gpio-mockup. Don't remove it just yet (there are tests depending on it out there) but make Kconfig say that it should no longer be used in new projects. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij commit ce9bcbc23ba6c30d783f3d22a0503c0b880406cf Author: Bartosz Golaszewski Date: Thu Sep 7 16:52:27 2023 +0200 gpio: mockup: remove unused field The desc assigned to debugfs private structure is unused so remove it. Fixes: 9202ba2397d1 ("gpio: mockup: implement event injecting over debugfs") Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij commit 8d5e2db297d1430ec8efbdf6bff53cc52ef11f52 Author: Bartosz Golaszewski Date: Thu Sep 7 16:52:26 2023 +0200 gpio: mockup: fix kerneldoc The pull field of the line state struct is undocumented. Fix it. Fixes: 2a9e27408e12 ("gpio: mockup: rework debugfs interface") Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij commit af68c2af22e11f15751031422e31ee695095f108 Author: Masahiro Yamada Date: Thu Aug 24 15:45:08 2023 +0900 pinctrl: single: remove get rid of __maybe_unused These are always used in pcs_probe(). While I was here, I also changed 'unsigned' in the same line to 'unsigned int' to address the checkpatch warnings: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20230824064508.968142-1-masahiroy@kernel.org Signed-off-by: Linus Walleij commit 944834901adc94b3a44d1dd153eb739a937e52d2 Author: Ard Biesheuvel Date: Fri Jan 13 18:32:57 2023 +0100 Documentation: Drop or replace remaining mentions of IA64 Drop or update mentions of IA64, as appropriate. Signed-off-by: Ard Biesheuvel commit b089ea3cc30de85ea7e20aa66500feb4082dfbf7 Author: Ard Biesheuvel Date: Fri Jan 13 18:08:32 2023 +0100 lib/raid6: Drop IA64 support Drop Itanium support from the RAID6 code, and along with it, the 16x and 32x unrolled versions, which were only used by IA64. Signed-off-by: Ard Biesheuvel commit af1f459233d4edeef634f559539e7f4b64cb1d25 Author: Ard Biesheuvel Date: Fri Jan 13 18:07:28 2023 +0100 Documentation: Drop IA64 from feature descriptions Itanium (IA64) is going away, so drop it from the kernel feature documentation. Signed-off-by: Ard Biesheuvel commit f5e836884d8e55b416dfad55c29481ec1b65c1f0 Author: Ard Biesheuvel Date: Fri Jan 13 17:57:47 2023 +0100 kernel: Drop IA64 support from sig_fault handlers Signed-off-by: Ard Biesheuvel commit cf8e8658100d4eae80ce9b21f7a81cb024dd5057 Author: Ard Biesheuvel Date: Thu Oct 20 15:54:33 2022 +0200 arch: Remove Itanium (IA-64) architecture The Itanium architecture is obsolete, and an informal survey [0] reveals that any residual use of Itanium hardware in production is mostly HP-UX or OpenVMS based. The use of Linux on Itanium appears to be limited to enthusiasts that occasionally boot a fresh Linux kernel to see whether things are still working as intended, and perhaps to churn out some distro packages that are rarely used in practice. None of the original companies behind Itanium still produce or support any hardware or software for the architecture, and it is listed as 'Orphaned' in the MAINTAINERS file, as apparently, none of the engineers that contributed on behalf of those companies (nor anyone else, for that matter) have been willing to support or maintain the architecture upstream or even be responsible for applying the odd fix. The Intel firmware team removed all IA-64 support from the Tianocore/EDK2 reference implementation of EFI in 2018. (Itanium is the original architecture for which EFI was developed, and the way Linux supports it deviates significantly from other architectures.) Some distros, such as Debian and Gentoo, still maintain [unofficial] ia64 ports, but many have dropped support years ago. While the argument is being made [1] that there is a 'for the common good' angle to being able to build and run existing projects such as the Grid Community Toolkit [2] on Itanium for interoperability testing, the fact remains that none of those projects are known to be deployed on Linux/ia64, and very few people actually have access to such a system in the first place. Even if there were ways imaginable in which Linux/ia64 could be put to good use today, what matters is whether anyone is actually doing that, and this does not appear to be the case. There are no emulators widely available, and so boot testing Itanium is generally infeasible for ordinary contributors. GCC still supports IA-64 but its compile farm [3] no longer has any IA-64 machines. GLIBC would like to get rid of IA-64 [4] too because it would permit some overdue code cleanups. In summary, the benefits to the ecosystem of having IA-64 be part of it are mostly theoretical, whereas the maintenance overhead of keeping it supported is real. So let's rip off the band aid, and remove the IA-64 arch code entirely. This follows the timeline proposed by the Debian/ia64 maintainer [5], which removes support in a controlled manner, leaving IA-64 in a known good state in the most recent LTS release. Other projects will follow once the kernel support is removed. [0] https://lore.kernel.org/all/CAMj1kXFCMh_578jniKpUtx_j8ByHnt=s7S+yQ+vGbKt9ud7+kQ@mail.gmail.com/ [1] https://lore.kernel.org/all/0075883c-7c51-00f5-2c2d-5119c1820410@web.de/ [2] https://gridcf.org/gct-docs/latest/index.html [3] https://cfarm.tetaneutral.net/machines/list/ [4] https://lore.kernel.org/all/87bkiilpc4.fsf@mid.deneb.enyo.de/ [5] https://lore.kernel.org/all/ff58a3e76e5102c94bb5946d99187b358def688a.camel@physik.fu-berlin.de/ Acked-by: Tony Luck Signed-off-by: Ard Biesheuvel commit 3d15d17fc3deb33b684032925805df75b878db92 Author: xingtong.wu Date: Mon May 29 10:50:12 2023 +0800 gpio-f7188x: fix base values conflicts with other gpio pins switch pin base from static to automatic allocation to avoid conflicts and align with other gpio chip drivers Signed-off-by: xingtong.wu Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit adb5f1560cecfa4c2cb81e220c8c691748dd710a Author: Andy Shevchenko Date: Fri Sep 1 16:40:41 2023 +0300 gpio: pca953x: Revisit header inclusions Some of the headers are not use, some are missing. Fix that. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 40db075545ad984972cd57fed3d910c7ddd8e514 Author: Andy Shevchenko Date: Fri Sep 1 16:40:40 2023 +0300 gpio: pca953x: Get rid of useless goto label In a few functions goto label is useless as there are no locking, no nothing that may justify its usage. Get rid of it. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 7c30130662877a761e53e7a67269b2ed5308aed0 Author: Andy Shevchenko Date: Fri Sep 1 16:40:39 2023 +0300 gpio: pca953x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() SIMPLE_DEV_PM_OPS() is deprecated, replace it with pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() for setting the driver's PM routines. We can now remove the ifdeffery surrounding the suspend and resume functions. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 9da0a75ea7ced4731b1f2c6c67dc409e40efb95a Author: Andy Shevchenko Date: Fri Sep 1 16:40:38 2023 +0300 gpio: pca953x: Utilise temporary variable for struct gpio_chip We have a temporary variable to keep pointer to struct gpio_chip. Utilise it where it makes sense. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 6811886ac91eb414b1b74920e05e6590c3f2a688 Author: Andy Shevchenko Date: Fri Sep 1 16:40:37 2023 +0300 gpio: pca953x: Utilise temporary variable for struct device We have a temporary variable to keep pointer to struct device. Utilise it where it makes sense. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 8e471b784a720f6f34f9fb449ba0744359dcaccb Author: Andy Shevchenko Date: Fri Sep 1 16:40:36 2023 +0300 gpio: pca953x: Simplify code with cleanup helpers Use macros defined in linux/cleanup.h to automate resource lifetime control in gpio-pca953x. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit ec5bde62019b0a5300c67bd81b9864a8ea12274e Author: Andy Shevchenko Date: Fri Sep 1 16:40:35 2023 +0300 gpio: pca953x: Split pca953x_restore_context() and pca953x_save_context() Split regcache handling to the respective helpers. It will allow to have further refactoring with ease. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit c47f7ff0fe61738a40b1b4fef3cd8317ec314079 Author: Andy Shevchenko Date: Fri Sep 1 16:40:34 2023 +0300 gpio: pca953x: Utilise dev_err_probe() where it makes sense At least in pca953x_irq_setup() we may use dev_err_probe(). Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 53c59d66c44c5eb98b34da9967f937e5387f8624 Author: Andy Shevchenko Date: Fri Sep 1 16:40:33 2023 +0300 gpio: pca953x: Fully convert to device managed resources Curtrently the error path is unsynchronised with removal due to regulator being disabled before other device managed resources are handled. Correct that by wrapping regulator enablement in the respective call. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 2f4d3e293392571e02b106c8b431b638bd029276 Author: Andy Shevchenko Date: Fri Sep 1 16:40:32 2023 +0300 gpio: pca953x: Drop unused fields in struct pca953x_platform_data New code should solely use firmware nodes for the specifics and not any callbacks. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 4cdc5dbbc1df36c4d7c93c7c15dde88e997922c2 Author: Biju Das Date: Sat Sep 2 18:45:47 2023 +0100 eeprom: at24: Drop at24_get_chip_data() Replace at24_get_chip_data()->i2c_get_match_data() as it is redundant. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit c848f884d1b4d858dff03269265a3300f542011c Author: Sean Nyekjaer Date: Wed Aug 16 14:24:29 2023 +0200 ARM: dts: stm32: Add Octavo OSD32MP1-RED board Add support for the Octavo OSD32MP1-RED development board. General features: - STM32MP157C - 512MB DDR3 - CAN-FD - HDMI - USB-C OTG - UART Signed-off-by: Sean Nyekjaer Reviewed-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit f186a915ff8ce6d899e7f6d230199b762eac9ee8 Author: Sean Nyekjaer Date: Wed Aug 16 14:24:28 2023 +0200 dt-bindings: arm: stm32: add extra SiP compatible for oct,stm32mp157c-osd32-red Add binding support for the Octavo OSD32MP1-RED development board. General features: - STM32MP157C - 512MB DDR3 - CAN-FD - HDMI - USB-C OTG - UART Signed-off-by: Sean Nyekjaer Acked-by: Conor Dooley Acked-by: Krzysztof Kozlowski Signed-off-by: Alexandre Torgue commit 3028aeb32f2d56fb1bdbfbf42ea3d88a9fed2bef Author: Sean Nyekjaer Date: Wed Aug 16 14:24:27 2023 +0200 ARM: dts: stm32: osd32: fix ldo6 not required to be always-on According to the OSD32MP1 Power System overview[1] there is no hard requirement for the ldo6 to be always-on. [1]: https://octavosystems.com/app_notes/osd32mp1-power-system-overview/#connections Signed-off-by: Sean Nyekjaer Acked-by: Leonard Göhrs Signed-off-by: Alexandre Torgue commit 8c4904488fbc6516f0faaa4b011e0bafcd296087 Author: Sean Nyekjaer Date: Wed Aug 16 14:24:26 2023 +0200 ARM: dts: stm32: lxa-tac: remove v3v3_hdmi override Patch "ARM: dts: stm32: osd32: fix ldo2 not required to be always-on" is making this property delete obsolete. Signed-off-by: Sean Nyekjaer Signed-off-by: Alexandre Torgue commit 0624f833de22ba4013d801be7b48200d3e2a6b18 Author: Sean Nyekjaer Date: Wed Aug 16 14:24:25 2023 +0200 ARM: dts: stm32: osd32: fix ldo2 not required to be always-on According to the OSD32MP1 Power System overview[1] there is no hard requirement for the ldo2 to be always-on. [1]: https://octavosystems.com/app_notes/osd32mp1-power-system-overview/#connections Signed-off-by: Sean Nyekjaer Acked-by: Leonard Göhrs Signed-off-by: Alexandre Torgue commit 37bd2f3dab07eec465c3699e9ea1e3e9185a4966 Author: Sean Nyekjaer Date: Wed Aug 16 14:24:24 2023 +0200 ARM: dts: stm32: osd32: fix ldo1 not required to be always-on According to the OSD32MP1 Power System overview[1] there is no hard requirement for the ldo1 to be always-on. [1]: https://octavosystems.com/app_notes/osd32mp1-power-system-overview/#connections Signed-off-by: Sean Nyekjaer Acked-by: Leonard Göhrs Signed-off-by: Alexandre Torgue commit 12cf3ed9df313394462ab4d49f7cc5c00d9b20e6 Author: Sean Nyekjaer Date: Wed Aug 16 14:24:23 2023 +0200 ARM: dts: stm32: Add alternate pinmux for can pins Add another mux option for can pins, this is used on Octavo OSD32MP1-RED board. Signed-off-by: Sean Nyekjaer Reviewed-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit e404979e55603ef8564fe6cf7c4368aa6aaee719 Author: Sean Nyekjaer Date: Wed Aug 16 14:24:22 2023 +0200 ARM: dts: stm32: Add alternate pinmux for ldtc pins Add another mux option for ltdc pins, this is used on Octavo OSD32MP1-RED board. Signed-off-by: Sean Nyekjaer Reviewed-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit 8892a1e1108e0aec956bd36d4079d56fcb41229f Author: Sean Nyekjaer Date: Wed Aug 16 14:24:21 2023 +0200 ARM: dts: stm32: Add alternate pinmux for i2s pins Add another mux option for i2s pins, this is used on Octavo OSD32MP1-RED board. Signed-off-by: Sean Nyekjaer Reviewed-by: Olivier Moysan Signed-off-by: Alexandre Torgue commit d1802d59ab533f5d5fdfa3483c11ca77c5b21fdd Author: Hal Feng Date: Mon Aug 14 16:06:17 2023 +0800 ASoC: starfive: Add JH7110 PWM-DAC driver Add PWM-DAC driver support for the StarFive JH7110 SoC. Reviewed-by: Walker Chen Signed-off-by: Hal Feng Link: https://lore.kernel.org/r/20230814080618.10036-3-hal.feng@starfivetech.com Signed-off-by: Mark Brown commit 748c482d032ef8a607cbf696c6d31afd25293bcb Author: Hal Feng Date: Mon Aug 14 16:06:16 2023 +0800 ASoC: dt-bindings: Add StarFive JH7110 PWM-DAC controller Add bindings for the PWM-DAC controller on the JH7110 RISC-V SoC by StarFive Ltd. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Hal Feng Link: https://lore.kernel.org/r/20230814080618.10036-2-hal.feng@starfivetech.com Signed-off-by: Mark Brown commit 0578a6dbfe7514db7134501cf93acc21cf13e479 Author: Dhruva Gole Date: Tue Aug 29 11:57:08 2023 +0530 spi: spi-cadence-quadspi: add runtime pm support Add runtime pm support to cadence-qspi driver, this allows the driver to suspend whenever it's is not actively being used thus reducing active power consumed by the system. Also, with the use of devm_pm_runtime_enable we no longer need the fallback probe_pm_failed that used to pm_runtime_disable Co-developed-by: Apurva Nandan Signed-off-by: Apurva Nandan Signed-off-by: Dhruva Gole Link: https://lore.kernel.org/r/20230829062706.786637-1-d-gole@ti.com Signed-off-by: Mark Brown commit eb9913b511f10968a02cfa5329a896855dd152a3 Author: Zhang Shurong Date: Sat Aug 26 18:02:54 2023 +0800 spi: tegra: Fix missing IRQ check in tegra_slink_probe() This func misses checking for platform_get_irq()'s call and may passes the negative error codes to request_irq(), which takes unsigned IRQ #, causing it to fail with -EINVAL, overriding an original error code. Fix this by stop calling request_irq() with invalid IRQ #s. Fixes: dc4dc3605639 ("spi: tegra: add spi driver for SLINK controller") Signed-off-by: Zhang Shurong Reviewed-by: Helen Koike Link: https://lore.kernel.org/r/tencent_73FCC06A3D1C14EE5175253C6FB46A07B709@qq.com Signed-off-by: Mark Brown commit d6c612a34740118855cd1c8acc4339adea686266 Author: Li Zetao Date: Wed Aug 23 21:39:38 2023 +0800 spi: rockchip: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-26-lizetao1@huawei.com Signed-off-by: Mark Brown commit 9351339c1a99cca47e6fbeef88b1ef6438d36127 Author: Li Zetao Date: Wed Aug 23 21:39:37 2023 +0800 spi: spl022: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Moreover, the label "err_no_clk_en" is no used, drop it for clean code. Reviewed-by: Linus Walleij Signed-off-by: Li Zetao Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230823133938.1359106-25-lizetao1@huawei.com Signed-off-by: Mark Brown commit 6b6cc88c4e5b42d2ba6af43152af6d9d96872ee8 Author: Li Zetao Date: Wed Aug 23 21:39:36 2023 +0800 spi: pic32: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-24-lizetao1@huawei.com Signed-off-by: Mark Brown commit 909d4cd6bc316e6cd7958832f3efe9e2fd51dcbf Author: Li Zetao Date: Wed Aug 23 21:39:35 2023 +0800 spi: pic32-sqi: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-23-lizetao1@huawei.com Signed-off-by: Mark Brown commit bbd0a66b85fe860e8b6acfb1739d15b517a4f6fb Author: Li Zetao Date: Wed Aug 23 21:39:34 2023 +0800 spi: orion: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-22-lizetao1@huawei.com Signed-off-by: Mark Brown commit 82c4fadb0b957c817b5a3fcc05dc774bf32a4d07 Author: Li Zetao Date: Wed Aug 23 21:39:33 2023 +0800 spi: npcm-fiu: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-21-lizetao1@huawei.com Signed-off-by: Mark Brown commit a06b6935f10267a300be724dca11226d6d519156 Author: Li Zetao Date: Wed Aug 23 21:39:32 2023 +0800 spi: mtk-snfi: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Also, devm_clk_get_optional() and clk_prepare_enable() can now be replaced by devm_clk_get_optional_enabled().Moreover, the two functions mtk_snand_enable_clk() and mtk_snand_disable_clk() no longer are used, drop them for clean code. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-20-lizetao1@huawei.com Signed-off-by: Mark Brown commit 605204fcb9c49818a8a7e533147061a305ac39e3 Author: Li Zetao Date: Wed Aug 23 21:39:31 2023 +0800 spi: microchip-core: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-19-lizetao1@huawei.com Signed-off-by: Mark Brown commit e922f3fff21445117e9196bd8e940ad8e15ca8c7 Author: Li Zetao Date: Wed Aug 23 21:39:30 2023 +0800 spi: microchip-core-qspi: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-18-lizetao1@huawei.com Signed-off-by: Mark Brown commit c45fd1217b38048332c4f5bff8bfb7c1fe6ab6dd Author: Li Zetao Date: Wed Aug 23 21:39:29 2023 +0800 spi: spi-meson-spifc: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Moreover, the lable "out_clk" no longer makes sense, rename it to "out_pm". Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-17-lizetao1@huawei.com Signed-off-by: Mark Brown commit 7ef51102d32ddc4776b2cdd583fe84afb84c823f Author: Li Zetao Date: Wed Aug 23 21:39:28 2023 +0800 spi: meson-spicc: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-16-lizetao1@huawei.com Signed-off-by: Mark Brown commit e2b9622b2a3d058e7d06827b99487b27f777b9c2 Author: Li Zetao Date: Wed Aug 23 21:39:27 2023 +0800 spi: lantiq-ssc: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-15-lizetao1@huawei.com Signed-off-by: Mark Brown commit 4812bc31af2b523d4da8386a524a2cd2f6f5919b Author: Li Zetao Date: Wed Aug 23 21:39:26 2023 +0800 spi: spi-fsl-dspi: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-14-lizetao1@huawei.com Signed-off-by: Mark Brown commit 349112b6769ec0018404f87dd4632f8ea393fcaf Author: Li Zetao Date: Wed Aug 23 21:39:25 2023 +0800 spi: dw-mmio: Use helper function devm_clk_get_*() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Also, devm_clk_get_optional() and clk_prepare_enable() can now be replaced by devm_clk_get_optional_enabled(). Moreover, the lable "out_clk" no longer makes sense, rename it to "out_reset". Signed-off-by: Li Zetao Reviewed-by: Jonathan Cameron Acked-by: Serge Semin Link: https://lore.kernel.org/r/20230823133938.1359106-13-lizetao1@huawei.com Signed-off-by: Mark Brown commit 10c3937890be2c53bfa4aaf3b22a46749857f86a Author: Li Zetao Date: Wed Aug 23 21:39:24 2023 +0800 spi: dw-bt1: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Acked-by: Serge Semin Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-12-lizetao1@huawei.com Signed-off-by: Mark Brown commit 9dc2aa96a3533215fbed9cf1297f7aa70dae840b Author: Li Zetao Date: Wed Aug 23 21:39:23 2023 +0800 spi: davinci: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-11-lizetao1@huawei.com Signed-off-by: Mark Brown commit c32cb76e8d5e487698f8eceb5b53df95a33fe388 Author: Li Zetao Date: Wed Aug 23 21:39:22 2023 +0800 spi: spi-cavium-thunderx: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-10-lizetao1@huawei.com Signed-off-by: Mark Brown commit f64b1600f92e786e502cc30d31d9e3c5f2f6d682 Author: Li Zetao Date: Wed Aug 23 21:39:21 2023 +0800 spi: spi-cadence: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-9-lizetao1@huawei.com Signed-off-by: Mark Brown commit 0135a38436111366bc2fe6d3cd82a9c2cc92ce7f Author: Li Zetao Date: Wed Aug 23 21:39:20 2023 +0800 spi: bcm2835aux: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-8-lizetao1@huawei.com Signed-off-by: Mark Brown commit ba85f5fad849821bfce0ee154a72df7e2376c5eb Author: Li Zetao Date: Wed Aug 23 21:39:19 2023 +0800 spi: bcm2835: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-7-lizetao1@huawei.com Signed-off-by: Mark Brown commit a08199b309f833fd4221ab5ee2391c791fe26385 Author: Li Zetao Date: Wed Aug 23 21:39:18 2023 +0800 spi: spi-axi-spi-engine: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-6-lizetao1@huawei.com Signed-off-by: Mark Brown commit b3422ea3913e27fd43a7a1883f358cb20599289e Author: Li Zetao Date: Wed Aug 23 21:39:17 2023 +0800 spi: ath79: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-5-lizetao1@huawei.com Signed-off-by: Mark Brown commit 9ee8fbc05ef0b69e8cb4295b2663e044dd3868a3 Author: Li Zetao Date: Wed Aug 23 21:39:16 2023 +0800 spi: aspeed: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Reviewed-by: Chin-Ting Kuo Signed-off-by: Li Zetao Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/r/20230823133938.1359106-4-lizetao1@huawei.com Signed-off-by: Mark Brown commit f918b3a67ccbcf326a80100c17e107eece5df868 Author: Li Zetao Date: Wed Aug 23 21:39:15 2023 +0800 spi: armada-3700: Use helper function devm_clk_get_prepared() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare() can now be replaced by devm_clk_get_prepared() when driver prepares the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare the clocks explicitly. Signed-off-by: Li Zetao Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/20230823133938.1359106-3-lizetao1@huawei.com Signed-off-by: Mark Brown commit 1d3ea34b7b69b2cbdcc82f1d399705c06ea5f748 Author: Li Zetao Date: Wed Aug 23 21:39:14 2023 +0800 spi: ar934x: Use helper function devm_clk_get_enabled() Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be replaced by devm_clk_get_enabled() when driver enables (and possibly prepares) the clocks for the whole lifetime of the device. Moreover, it is no longer necessary to unprepare and disable the clocks explicitly. Reviewed-by: Jonathan Cameron Signed-off-by: Li Zetao Link: https://lore.kernel.org/r/20230823133938.1359106-2-lizetao1@huawei.com Signed-off-by: Mark Brown commit 764246c7feda01f46b1a243cfa15ad5627874ef9 Author: Andy Shevchenko Date: Thu Aug 24 19:22:09 2023 +0300 spidev: Simplify SPI_IOC_RD_MODE* cases in spidev_ioctl() The temporary variable tmp is not used outside of the SPI_IOC_RD_MODE* cases, hence we can optimize its use. Signed-off-by: Andy Shevchenko Reviewed-by: Lukas Wunner Reviewed-by: Alexander Sverdlin Link: https://lore.kernel.org/r/20230824162209.2890440-4-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 193a7f9e1a78f69c913bb26ca4500f6edad1e8ff Author: Andy Shevchenko Date: Thu Aug 24 19:22:08 2023 +0300 spidev: Switch to use spi_get_csgpiod() spidev_ioctl() checks if there is an SPI chip select is driven by GPIO. Instead of current code, we can call spi_get_csgpiod(). Signed-off-by: Andy Shevchenko Reviewed-by: Alexander Sverdlin Link: https://lore.kernel.org/r/20230824162209.2890440-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 12c8d7a76cd6100a2f35b9ef4b87d11128b9105b Author: Andy Shevchenko Date: Thu Aug 24 19:22:07 2023 +0300 spidev: Decrease indentation level in spidev_ioctl() SPI_IOC_RD_MODE* Instead of defining a local controller variable inside an indented block, move the definition to the top of spidev_ioctl() and reuse it in the SPI_IOC_RD_MODE* and SPI_IOC_WR_MODE* cases. This drops unneeded indentation and reduces amount of LoCs. Signed-off-by: Andy Shevchenko Reviewed-by: Alexander Sverdlin Link: https://lore.kernel.org/r/20230824162209.2890440-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit ee0f793cc1881225dee04216f1080201603b46bb Author: Yang Yingliang Date: Wed Aug 23 11:30:03 2023 +0800 spi: omap2-mcspi: switch to use modern name Change legacy name master/slave to modern name host/target or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-22-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 0d81c46e702903c75cce195ed0d3fb968e8341c0 Author: Yang Yingliang Date: Wed Aug 23 11:30:02 2023 +0800 spi: omap-uwire: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-21-yangyingliang@huawei.com Signed-off-by: Mark Brown commit ba0dada2ba1c9a1a948cdec91f4cc3c3efae2911 Author: Yang Yingliang Date: Wed Aug 23 11:30:01 2023 +0800 spi: oc-tiny: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-20-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 8af8a27b7898ad688b7c50c404ed01cec54078a2 Author: Yang Yingliang Date: Wed Aug 23 11:30:00 2023 +0800 spi: nxp-fspi: switch to use modern name Change legacy name master/slave to modern name host/target or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-19-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 2b0aa563b36442068379909a880a741105d0d039 Author: Yang Yingliang Date: Wed Aug 23 11:29:59 2023 +0800 spi: npcm-pspi: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-18-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 7647a16b682ea388830748efd8a8b85c51654dbf Author: Yang Yingliang Date: Wed Aug 23 11:29:58 2023 +0800 spi: mxs: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-17-yangyingliang@huawei.com Signed-off-by: Mark Brown commit fc42bb55c05fa737b3057bbc5349f5fc8c6e68b5 Author: Yang Yingliang Date: Wed Aug 23 11:29:57 2023 +0800 spi: mxic: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-16-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 0fc8a1a43122d3775eb2fff2dc4ee9ff7828b15c Author: Yang Yingliang Date: Wed Aug 23 11:29:56 2023 +0800 spi: mux: switch to use spi_alloc_host() Switch to use modern name function spi_alloc_host(). No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-15-yangyingliang@huawei.com Signed-off-by: Mark Brown commit efdf4c993494a52ee86fc7db83bb257c74cb8184 Author: Yang Yingliang Date: Wed Aug 23 11:29:55 2023 +0800 spi: mtk-snfi: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-14-yangyingliang@huawei.com Signed-off-by: Mark Brown commit a3a77a4268929888ab3ce9e68c83f0d7e63505df Author: Yang Yingliang Date: Wed Aug 23 11:29:54 2023 +0800 spi: mtk-nor: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-13-yangyingliang@huawei.com Signed-off-by: Mark Brown commit e56e3de0039d66b1fe5a0e1b3338907797ef79cd Author: Yang Yingliang Date: Wed Aug 23 11:29:53 2023 +0800 spi: mt7621: switch to use modern name Change legacy name master/slave to modern name host/target or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-12-yangyingliang@huawei.com Signed-off-by: Mark Brown commit cae1578847e60a5cfb4ff881a1670c4b008ce37d Author: Yang Yingliang Date: Wed Aug 23 11:29:52 2023 +0800 spi: mt65xx: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-11-yangyingliang@huawei.com Signed-off-by: Mark Brown commit d6503d1192491bb9d38916b70f87e77ce93c3bb6 Author: Yang Yingliang Date: Wed Aug 23 11:29:51 2023 +0800 spi: mpc52xx: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-10-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 171639f8459192d1f7cc505a7a4269f916d3e4b5 Author: Yang Yingliang Date: Wed Aug 23 11:29:50 2023 +0800 spi: mpc52xx-psc: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-9-yangyingliang@huawei.com Signed-off-by: Mark Brown commit a21db73963c837332e21f1b7a7ee71ae7fd2ec16 Author: Yang Yingliang Date: Wed Aug 23 11:29:49 2023 +0800 spi: mpc512x-psc: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-8-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 8f8bf52ed5b76fc7958b0fbe3131540aecdff8ac Author: Yang Yingliang Date: Wed Aug 23 11:29:48 2023 +0800 spi: microchip-core: switch to use modern name Change legacy name master/slave to modern name host/target or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-7-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 5d97a3abbb5e24cf208f0339e09e58a591652818 Author: Yang Yingliang Date: Wed Aug 23 11:29:47 2023 +0800 spi: microchip-core-qspi: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-6-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 55591ac48152a5f5760b5a989654b95985861ac9 Author: Yang Yingliang Date: Wed Aug 23 11:29:46 2023 +0800 spi: meson-spifc: switch to use modern name Change legacy name master/slave to modern name host/target or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-5-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 68bf3288c7ebc0b9ca8ba9b5b748bd306a3649a3 Author: Yang Yingliang Date: Wed Aug 23 11:29:45 2023 +0800 spi: meson-spicc: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-4-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 48815830a9f66cbec343f078da4ab72b2bdf992e Author: Yang Yingliang Date: Wed Aug 23 11:29:44 2023 +0800 spi: lp-8841: switch to use modern name Change legacy name master/slave to modern name host/target or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-3-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 7c5d1d9787d67966c6e45643920e5bbfa859ccb8 Author: Yang Yingliang Date: Wed Aug 23 11:29:43 2023 +0800 spi: lm70llp: switch to use modern name Change legacy name master to modern name host or controller. No functional changed. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20230823033003.3407403-2-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 969b033a77a8fa59a5fe9320b371eadd4f4321a6 Author: Biju Das Date: Sun Sep 3 17:03:01 2023 +0100 regulator: mp5416: Make similar OF and ID table Make similar OF and ID table to extend support for ID match using i2c_match_data(). Currently it works only for OF match tables as the driver_data is wrong for ID match. While at it, remove trailing comma in the terminator entry for OF/ID table and drop a space from terminator entry for ID table. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230903160301.79111-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 9d9cd8e6a4572efa328ef72a83bbc78a39deca37 Author: Biju Das Date: Sun Sep 3 16:42:57 2023 +0100 regulator: max20086: Make similar OF and ID table Make similar OF and ID table to extend support for ID match using i2c_match_data(). Currently it works only for OF match tables as the driver_data is wrong for ID match. While at it, drop blank lines before MODULE_DEVICE_TABLE* and remove trailing comma in the terminator entry for OF/ID table. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230903154257.70800-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 9e38482cb562f03fe8d521a001d44eba176a9201 Author: Biju Das Date: Sat Aug 26 18:38:41 2023 +0100 regulator: mp886x: Make similar OF and ID table Make similar OF and ID table to extend support for ID match using i2c_match_data(). Currently it works only for OF match tables as the driver_data is wrong for ID match. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230826173841.91807-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 7169654ce0f754679c60a6e2f904f6f19e54bad1 Author: Biju Das Date: Mon Aug 28 17:28:30 2023 +0100 regulator: ltc3589: Convert enum->pointer for data in the match tables Convert enum->pointer for data in the match tables, so that the hw differences can be stored in pointer and there by simpily the code. Add struct ltc3589_info for hw differences between the devices and replace ltc3589_variant->ltc3589_info for data in the match table. Simplify the probe() by replacing of_device_get_match_data() and ID lookup for retrieving data by i2c_get_match_data(). Drop enum ltc3589_variant and variant from struct ltc3589_info as there are no users. While at it, dropped trailing comma in the terminator entries for ID table. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230828162830.97881-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 24d95bb0460aeccfa008faf12721474336d4e0c3 Author: Biju Das Date: Mon Aug 28 17:54:47 2023 +0100 regulator: sy8824x: Make similar OF and ID table Make similar OF and ID table to extend support for ID match using i2c_match_data(). Currently it works only for OF match tables as the driver_data is wrong for ID match. While at it, drop trailing comma in the terminator entry from ID table. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230828165447.106058-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 364a399b7ca35e8f2291ab95bff28baa6e119efe Author: Biju Das Date: Mon Aug 28 17:47:46 2023 +0100 regulator: fan53555: Simplify probe() Simplify probe() by replacing of_device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). While at it, use dev_fwnode() API instead of 'client->dev.of_node'. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230828164746.102992-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 1b4daf643a3a21cff4bcad5b799960d5a0673d11 Author: Biju Das Date: Sun Sep 3 17:48:32 2023 +0100 regulator: pv880x0: Simplify probe() Replace pv88080_types->pv88080_compatible_regmap in OF/ID tables and simplify the probe() by replacing of_match_node() and ID lookup for retrieving match data by i2c_get_match_data(). After this there is no user of enum pv88080_types. So drop it. While at it, move OF table near to the user. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230903164832.83077-3-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit c187b8f87d553cc124c568ecc010a8bf73cf745f Author: Biju Das Date: Sun Sep 3 17:48:31 2023 +0100 regulator: pv880x0: Drop ifdeffery Drop of_match_ptr() from pv88080_regulator_driver and get rid of ugly CONFIG_OF ifdeffery. This slightly increases the size of pv88080_dt_ids on non-OF system and shouldn't be an issue. Add mod_devicetable.h include. While at it, remove trailing comma in the terminator entry for OF/ID table. Suggested-by: Andy Shevchenko Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230903164832.83077-2-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit d3601857e14de6369f00ae19564f1d817d175d19 Author: Christophe JAILLET Date: Mon Sep 4 22:04:06 2023 +0200 regmap: debugfs: Fix a erroneous check after snprintf() This error handling looks really strange. Check if the string has been truncated instead. Fixes: f0c2319f9f19 ("regmap: Expose the driver name in debugfs") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/8595de2462c490561f70020a6d11f4d6b652b468.1693857825.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit e17e892dc8d1404a758d38ec870e44299f97d227 Author: Biju Das Date: Sun Aug 27 10:15:25 2023 +0100 ASoC: tas571x: Simplify probe() Simplify probe() by replacing of_match_device->i2c_get_match_data(). Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230827091525.39263-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit c3c9b17d27887f7b2f6b85d0a364b009b8436539 Author: Vlad Karpovich Date: Thu Aug 31 11:20:42 2023 -0500 ASoC: cs35l45: Add AMP Enable Switch control The "AMP Enable Switch" is useful in systems with multiple amplifiers connected to the same audio bus but not all of them are needed for all use cases. Signed-off-by: Vlad Karpovich Acked-by: Ricardo Rivera-Matos Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230831162042.471801-4-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown commit 3fecf69aa7fdf1910267dee1dbaa8ed865cf2cb6 Author: Vlad Karpovich Date: Thu Aug 31 11:20:41 2023 -0500 ASoC: cs35l45: Connect DSP to the monitoring signals Link VMON, IMON, TEMPMON, VDD_BSTMON and VDD_BATTMON to DSP1. The CSPL firmware uses them for the speaker calibration and monitoring. Signed-off-by: Vlad Karpovich Acked-by: Charles Keepax Acked-by: Ricardo Rivera-Matos Link: https://lore.kernel.org/r/20230831162042.471801-3-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown commit 18050443b9fc4e809c077fbf0967349410e86117 Author: Vlad Karpovich Date: Thu Aug 31 11:20:40 2023 -0500 ASoC: cs35l45: Analog PCM Volume and Amplifier Mode controls Adds "Analog PCM Volume" control with supported values 0 = 10dB,1 = 13dB,2 = 16dB and 3 = 19dB. The amplifier can operate either in Speaker Mode or Receiver Mode as configured by the user. Speaker Mode has four gain options to support maximum amplifier output amplitude for loud speaker application. Receiver Mode has further optimized noise performance while maintaining sufficient output to support phone receiver application. While configured in Receiver Mode, the analog PCM Volume control is disabled and the analog gain is fixed to 1dB. Signed-off-by: Vlad Karpovich Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230831162042.471801-2-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown commit 44f37b6ce041c838cb2f49f08998c41f1ab3b08c Author: Ricardo Rivera-Matos Date: Thu Aug 31 11:20:39 2023 -0500 ASoC: cs35l45: Checks index of cs35l45_irqs[] Checks the index computed by the virq offset before printing the error condition in cs35l45_spk_safe_err() handler. Signed-off-by: Ricardo Rivera-Matos Signed-off-by: Vlad Karpovich Acked-by: Ricardo Rivera-Matos Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230831162042.471801-1-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown commit ad191992330cfeb80ba341d1e75d9fe2719ced68 Author: Biju Das Date: Mon Aug 28 18:48:56 2023 +0100 ASoC: cs42xx8-i2c: Simplify probe() Simplify probe() by replacing of_match_device->i2c_get_match_data() and extend matching support for ID table. Also replace dev_err()->dev_err_probe() to simplify the code. Signed-off-by: Biju Das Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230828174856.122559-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 26eacb98ca7dd3ba5a6845028a13d13a7f03123f Author: Biju Das Date: Mon Aug 28 18:40:19 2023 +0100 ASoC: wm8580: Simplify probe() Simplify probe() by replacing of_match_device->i2c_get_match_data() and extend matching support for ID table. While at it, remove comma in the terminator entry and simplify probe() by replacing dev_err->dev_err_probe(). Signed-off-by: Biju Das Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230828174019.119250-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 43f2d432e47ebf2d7518fdef50d7cc70da376b0e Author: Jerome Brunet Date: Thu Sep 7 11:09:10 2023 +0200 ASoC: meson: axg: extend TDM maximum sample rate to 384kHz The TDM HW on the axg SoC families and derivatives actually supports 384kHz sampling rate. Update the fifo and tdm interface constraints accordingly. Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20230907090910.13546-1-jbrunet@baylibre.com Signed-off-by: Mark Brown commit 428cc4106a430781020eedc68e8d0511380eb0ef Author: Andy Shevchenko Date: Mon Sep 4 14:15:24 2023 +0300 ASoC: soc.h: replace custom COUNT_ARGS() & CONCATENATE() implementations Replace custom implementation of the macros from args.h. Signed-off-by: Andy Shevchenko Reviewed-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20230904111524.1740930-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 54fcd9dd44b2c82a0262e29b288c2d0b36c6bba5 Author: Marian Postevca Date: Wed Aug 30 01:01:16 2023 +0300 ASoC: amd: acp: Add machine driver that enables sound for systems with a ES8336 codec This commit enables sound for a line of Huawei laptops that use the ES8336 codec which is connected to the ACP3X module. Signed-off-by: Marian Postevca Link: https://lore.kernel.org/r/20230829220116.1159-6-posteuca@mutex.one Signed-off-by: Mark Brown commit c680f57095411559e7605af689c7ce01f2281005 Author: Marian Postevca Date: Wed Aug 30 01:01:15 2023 +0300 ASoC: amd: acp: Add support for splitting the codec specific code from the ACP driver This commit adds support for splitting more complicated machine drivers, that need special handling, from the generic ACP code. By adding support for callbacks to configure and handle codec specific implementation details, we can split them in separate files that don't clutter the ACP code. Signed-off-by: Marian Postevca Link: https://lore.kernel.org/r/20230829220116.1159-5-posteuca@mutex.one Signed-off-by: Mark Brown commit 869f30782cdad0a86598a700a864e4a2bf44f8cc Author: Marian Postevca Date: Wed Aug 30 01:01:14 2023 +0300 ASoC: es8316: Enable support for MCLK div by 2 To properly support a line of Huawei laptops with an AMD CPU and an ES8336 codec connected to the ACP3X module, we need to enable the codec option to divide the MCLK by 2. This is needed because for at least one SKU that has a 48Mhz MCLK the sound is distorted unless the MCLK div by 2 option is enabled. The option to divide the MCLK will first be tried. If no suitable clocking can be generated from this frequency, then the normal non-halved MCLK frequency will be tried. Signed-off-by: Marian Postevca Link: https://lore.kernel.org/r/20230829220116.1159-4-posteuca@mutex.one Signed-off-by: Mark Brown commit a43c0dc1004cbe2edbae9b6e6793db71f6896449 Author: Marian Postevca Date: Wed Aug 30 01:01:13 2023 +0300 ASoC: es8316: Replace NR_SUPPORTED_MCLK_LRCK_RATIOS with ARRAY_SIZE() No need for a special define since we can use ARRAY_SIZE() directly, and won't need to worry to keep it in sync. Signed-off-by: Marian Postevca Link: https://lore.kernel.org/r/20230829220116.1159-3-posteuca@mutex.one Signed-off-by: Mark Brown commit 2f06f231f0bfe74711fee14e28a8789a3de9bc36 Author: Marian Postevca Date: Wed Aug 30 01:01:12 2023 +0300 ASoC: es8316: Enable support for S32 LE format This CODEC does support the S32 LE format in es8316_pcm_hw_params(), but doesn't have it enabled in ES8316_FORMATS. Enable it so that we have more options to match with components. Signed-off-by: Marian Postevca Link: https://lore.kernel.org/r/20230829220116.1159-2-posteuca@mutex.one Signed-off-by: Mark Brown commit 510c46884299cf8da8e9d7db27572eafa9a0c567 Author: Konrad Dybcio Date: Fri Aug 25 19:23:13 2023 +0200 ASoC: codecs: lpass-tx-macro: Add SM6115 support SM6115 has a TX macro, which surprisingly doesn't host a SWR master. Conditionally skip the SWR reset sequence on this platform. Signed-off-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230825-topic-6115tx-v1-2-ebed201ad54b@linaro.org Signed-off-by: Mark Brown commit 9ff143aaabba989f275612de0d83cf9d39274828 Author: Konrad Dybcio Date: Fri Aug 25 19:23:12 2023 +0200 ASoC: dt-bindings: qcom,lpass-tx-macro: Add SM6115 SM6115 has a TX Macro, requiring an NPL clock, but not DCODEC. Document it. Signed-off-by: Konrad Dybcio Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20230825-topic-6115tx-v1-1-ebed201ad54b@linaro.org Signed-off-by: Mark Brown commit d9e6a80a2c7bea4cc2edc87fa43b876a64b13074 Author: Biju Das Date: Thu Aug 31 21:47:34 2023 +0100 ASoC: ak4642: Simplify probe() Simpilfy probe() by replacing of_device_get_match_data() and id lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230831204734.104954-3-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit a157d07d029be5b72ee3bce3ac44dab7b967bc9b Author: Biju Das Date: Thu Aug 31 21:47:33 2023 +0100 ASoC: ak4642: Minor cleanups in probe() Some minor cleanups: Replace local variable np with dev_fwnode() Replace dev_err()->dev_err_probe(). Remove comma in the terminator entry for OF table. Drop a space in the terminator entry for ID table. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230831204734.104954-2-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit ef01a6dec7f1717d13282e84bb4ac68f2119d9d9 Author: Biju Das Date: Fri Sep 1 07:59:52 2023 +0100 ASoC: wm8580: Move OF table Move OF table near to the user. Signed-off-by: Biju Das Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230901065952.18760-4-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit aa11a78fecab8809167dcb59dd3f55b5fdbc9ef3 Author: Biju Das Date: Fri Sep 1 07:59:51 2023 +0100 ASoC: wm8580: Remove trailing comma in the terminator entry Remove trailing comma in the terminator entry for OF table. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20230901065952.18760-3-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit bc07df947ce458c376b1bf622ef7d30d6cf6d5da Author: Biju Das Date: Fri Sep 1 07:59:50 2023 +0100 ASoC: wm8580: Simplify probe() Simplify probe() by replacing of_match_device->i2c_get_match_data() and extend matching support for ID table. While at it, remove comma in the terminator entry and simplify probe() by replacing dev_err()->dev_err_probe(). Signed-off-by: Biju Das Acked-by: Charles Keepax Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230901065952.18760-2-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 0307ba5420cd785615efc94be6b101b4ac2538cf Author: Linus Walleij Date: Fri Aug 25 10:12:17 2023 +0200 ASoC: max98927: Drop pointless includes This driver is already using solely GPIO descriptors and do not need to include the legacy headers or . Drop them. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230825-descriptors-asoc-max-v1-7-b212292b2f08@linaro.org Signed-off-by: Mark Brown commit d9241aaea1418fa4bd6653bee093f63cf47a2c6e Author: Linus Walleij Date: Fri Aug 25 10:12:16 2023 +0200 ASoC: max98520: Drop pointless includes This driver is already using solely GPIO descriptors and do not need to include the legacy headers or . Drop them. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230825-descriptors-asoc-max-v1-6-b212292b2f08@linaro.org Signed-off-by: Mark Brown commit 70f29a3078f7bc1f1011b7b5fee41fcd52ff189f Author: Linus Walleij Date: Fri Aug 25 10:12:15 2023 +0200 ASoC: max98396: Drop pointless include This driver is already using solely GPIO descriptors and do not need to include the legacy header . Drop it. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230825-descriptors-asoc-max-v1-5-b212292b2f08@linaro.org Signed-off-by: Mark Brown commit 4b0dfc0e8cdebd6aa6ce25593c0dcc71d9d21961 Author: Linus Walleij Date: Fri Aug 25 10:12:14 2023 +0200 ASoC: max98388: Correct the includes The MAX98388 driver is using the modern GPIO descriptor API but uses legacy includes. Include the proper header instead. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230825-descriptors-asoc-max-v1-4-b212292b2f08@linaro.org Signed-off-by: Mark Brown commit c5cb83a104a2d95ba4ba182051eff2a8c82d5beb Author: Linus Walleij Date: Fri Aug 25 10:12:13 2023 +0200 ASoC: max98373: Convert to use GPIO descriptors Instead of relying on legacy interfaces, convert the driver to use GPIO descriptors. This is a straight-forward conversion, we support also sdw devices providing GPIO descriptor tables if they so desire. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230825-descriptors-asoc-max-v1-3-b212292b2f08@linaro.org Signed-off-by: Mark Brown commit a3b68ba9f594ae4f9a96e0730e9aeadb9f64c43e Author: Linus Walleij Date: Fri Aug 25 10:12:12 2023 +0200 ASoC: max98357a: Drop pointless include This driver is already using solely GPIO descriptors and do not need to include the legacy header . Drop it. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230825-descriptors-asoc-max-v1-2-b212292b2f08@linaro.org Signed-off-by: Mark Brown commit 0015a18acf9ceafbf7e24f5addefce566326132b Author: Linus Walleij Date: Fri Aug 25 10:12:11 2023 +0200 ASoC: max9768: Convert to use GPIO descriptors The MAX9768 is pretty straight forward to convert to GPIO descriptors. To name the GPIO properties, I looke at the bindings in maxim,max9759.yaml which names these GPIO "mute" and "shutdown" respectively. No board files using platform data exist in the kernel, new users can use GPIO descriptor tables if desired. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20230825-descriptors-asoc-max-v1-1-b212292b2f08@linaro.org Signed-off-by: Mark Brown commit c6d86149db94c0289b0e5950fa23c5b19031ab8d Author: Biju Das Date: Thu Aug 31 20:46:22 2023 +0100 ASoC: tlv320aic32x4-spi: Simplify probe() Simplify probe() by replacing of_match_node() and spi_get_device_id() with spi_get_device_match_data(). Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20230831194622.87653-4-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit d44f7bc9d181a2bec0dcff694d00b08c8f99284d Author: Biju Das Date: Thu Aug 31 20:46:21 2023 +0100 ASoC: tlv320aic32x4-i2c: Simplify probe() Simplify probe() by replacing of_match_node() and i2c_match_id() with i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230831194622.87653-3-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit cac1636e214930b01b2f8ac9867771486554271a Author: Biju Das Date: Thu Aug 31 20:46:20 2023 +0100 ASoC: codec: tlv320aic32x4: Add enum aic32x4_type to aic32x4_probe() Add enum aic32x4_type to aic32x4_probe() and drop using dev_set_drvdata() from tlv320aic32x4_{i2c,spi} drivers. Suggested-by: Andy Shevchenko Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20230831194622.87653-2-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit 1bce95deab841ece9602f941e68c7b919fde303d Author: Trevor Wu Date: Fri Aug 25 10:49:35 2023 +0800 ASoC: mediatek: mt8188-mt6359: add SOF support SOF is enabled when adsp phandle is assigned to "mediatek,adsp". The required callback will be assigned when SOF is enabled. Additionally, "mediatek,dai-link" is introduced to decide the supported dai links for a project, so user can reuse the machine driver regardless of dai link combination. Signed-off-by: Trevor Wu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230825024935.10878-4-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 4047b35c836ff9f8bf1f57c4ab871136899267e9 Author: Trevor Wu Date: Fri Aug 25 10:49:34 2023 +0800 ASoC: mediatek: common: revise SOF common code Originally, normal dai link fixup callback is overwritten by sof fixup callback on mtk_sof_card_late_probe and it relies on the mapping defined on struct sof_conn_stream. It's not flexible. When a new hardware connection is adopted, user needs to update struct sof_conn_stream defined in machine driver which is used to specify the mapping relationship of normal BE and SOF BE. In the patch, mtk_sof_check_tplg_be_dai_link_fixup() is introduced for all normal BEs. In mtk_sof_late_probe, back up normal BE fixup if it exists and then overwrite be_hw_params_fixup by the new callback. There are two cases for FE and BE connection. case 1: SOF FE -> normal BE -> SOF_BE case 2: normal FE -> normal BE In the new fixup callback, it tries to find SOF_BE which connects to the same FE, and then reuses the fixup of SOF_BE. If no SOF_BE exists, it must be case 2, so rollback to the original fixup if it exists. As a result, the predefined relation is not needed anymore. Hardware connection can be controlled by the mixer control for AFE interconn. Then, DPCM finds the BE mapping at runtime. Signed-off-by: Trevor Wu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230825024935.10878-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit d601bb78f06b9e3cbb52e6b87b88add9920a11b6 Author: Trevor Wu Date: Fri Aug 25 10:49:33 2023 +0800 ASoC: mediatek: mt8188-mt6359: support dynamic pinctrl To avoid power leakage, it is recommended to replace the default pinctrl state with dynamic pinctrl since certain audio pinmux functions can remain in a HIGH state even when audio is disabled. Linking pinctrl with DAPM using SND_SOC_DAPM_PINCTRL will ensure that audio pins remain in GPIO mode by default and only switch to an audio function when necessary. Signed-off-by: Trevor Wu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20230825024935.10878-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 2d98bdad98aec8238a21712c22d97ff53f290c55 Merge: 0bb80ecc33a8f 578464679f33c Author: Mark Brown Date: Mon Sep 11 01:18:41 2023 +0100 Merge existing fixes from spi/for-6.6 into new branch commit 15d30b46573d75f5cb58cfacded8ebab9c76a2b0 Author: Geert Uytterhoeven Date: Thu Aug 24 17:08:41 2023 +0200 drm/ssd130x: Use bool for ssd130x_deviceinfo flags The .need_pwm and .need_chargepump fields in struct ssd130x_deviceinfo are flags that can have only two possible values: 0 and 1. Reduce kernel size by changing their types from int to bool. Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/285005ff361969eff001386c5f97990f0e703838.1692888745.git.geert@linux-m68k.org commit 4dbce3d6fea59e1df1d1a35aacea0c186f72107a Author: Geert Uytterhoeven Date: Thu Aug 24 17:08:40 2023 +0200 drm/ssd130x: Fix screen clearing Due to the reuse of buffers, ssd130x_clear_screen() no longers clears the screen, but merely redraws the last image that is residing in the intermediate buffer. As there is no point in clearing the intermediate buffer and transposing an all-black image, fix this by just clearing the HW format buffer, and writing it to the panel. Fixes: 49d7d581ceaf4cf8 ("drm/ssd130x: Don't allocate buffers on each plane update") Signed-off-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/c19cd5a57205597bb38a446c3871092993498f01.1692888745.git.geert@linux-m68k.org commit 84f54d4966f48ef88c8db3f524a59f5bc661bc33 Author: Uwe Kleine-König Date: Fri Jul 28 16:58:22 2023 +0200 drm/ssd130x: Print the PWM's label instead of its number struct pwm_device::pwm is a write-only variable in the pwm core and used nowhere apart from this and another dev_dbg. So it isn't useful to identify the used PWM. Emit the PWM's label instead in the debug message. Signed-off-by: Uwe Kleine-König Reviewed-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230728145824.616687-2-u.kleine-koenig@pengutronix.de commit 775b0669e19f2e4ad979e38330b7d23c2405cadd Author: Uwe Kleine-König Date: Sun May 7 18:26:02 2023 +0200 drm/shmobile: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Laurent Pinchart Reviewed-by: Geert Uytterhoeven Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-40-u.kleine-koenig@pengutronix.de commit 01790d5e372f85a8a41742f2b5e06798d76681fd Author: Uwe Kleine-König Date: Sun May 7 18:25:54 2023 +0200 drm/msm: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert the msm drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Dmitry Baryshkov Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-32-u.kleine-koenig@pengutronix.de commit c04ca6bbb7ea6ea7cba9ba8d3d4d4c767008d189 Author: Uwe Kleine-König Date: Sun May 7 18:25:52 2023 +0200 drm/mediatek: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert the mediatek drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Matthias Brugger Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-30-u.kleine-koenig@pengutronix.de commit 232b53724aec05e27f2803f9eb214abb384a2373 Author: Uwe Kleine-König Date: Sun May 7 18:25:51 2023 +0200 drm/mediatek: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Matthias Brugger Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-29-u.kleine-koenig@pengutronix.de commit 2b9b0a9fc548be0cecd16dcb513c6b79c1f4f6cc Author: Uwe Kleine-König Date: Sun May 7 18:25:46 2023 +0200 drm/ingenic: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert the ingenic drm drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Paul Cercueil Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-24-u.kleine-koenig@pengutronix.de commit 3095f1122203f3af6c0362e13892ea36b7721221 Author: Uwe Kleine-König Date: Sun May 7 18:25:45 2023 +0200 drm/imx/ipuv3: Convert to platform remove callback returning void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert the ipuv3 imx drivers from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Philipp Zabel Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-23-u.kleine-koenig@pengutronix.de commit ebc8484d0e6da9e6c9e8cfa1f40bf94e9c6fc512 Author: Denys Zagorui Date: Thu Sep 7 02:02:10 2023 -0700 bpftool: Fix -Wcast-qual warning This cast was made by purpose for older libbpf where the bpf_object_skeleton field is void * instead of const void * to eliminate a warning (as i understand -Wincompatible-pointer-types-discards-qualifiers) but this cast introduces another warning (-Wcast-qual) for libbpf where data field is const void * It makes sense for bpftool to be in sync with libbpf from kernel sources Signed-off-by: Denys Zagorui Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20230907090210.968612-1-dzagorui@cisco.com commit dbbe15859b14d7c4f313dda78fc078e33cb47b11 Merge: 9bc869253d4de a28b1ba25934f Author: Andrii Nakryiko Date: Fri Sep 8 16:22:41 2023 -0700 Merge branch 'selftests/bpf: Optimize kallsyms cache' Rong Tao says: ==================== We need to optimize the kallsyms cache, including optimizations for the number of symbols limit, and, some test cases add new kernel symbols (such as testmods) and we need to refresh kallsyms (reload or refresh). ==================== Signed-off-by: Andrii Nakryiko commit a28b1ba25934f24b9aabfc5cb86247150b7bb67d Author: Rong Tao Date: Thu Sep 7 09:59:14 2023 +0800 selftests/bpf: trace_helpers.c: Add a global ksyms initialization mutex As Jirka said [0], we just need to make sure that global ksyms initialization won't race. [0] https://lore.kernel.org/lkml/ZPCbAs3ItjRd8XVh@krava/ Signed-off-by: Rong Tao Signed-off-by: Andrii Nakryiko Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/tencent_5D0A837E219E2CFDCB0495DAD7D5D1204407@qq.com commit c698eaebdf4759d297343f20e00172610207b754 Author: Rong Tao Date: Thu Sep 7 09:59:13 2023 +0800 selftests/bpf: trace_helpers.c: Optimize kallsyms cache Static ksyms often have problems because the number of symbols exceeds the MAX_SYMS limit. Like changing the MAX_SYMS from 300000 to 400000 in commit e76a014334a6("selftests/bpf: Bump and validate MAX_SYMS") solves the problem somewhat, but it's not the perfect way. This commit uses dynamic memory allocation, which completely solves the problem caused by the limitation of the number of kallsyms. At the same time, add APIs: load_kallsyms_local() ksym_search_local() ksym_get_addr_local() free_kallsyms_local() There are used to solve the problem of selftests/bpf updating kallsyms after attach new symbols during testmod testing. Signed-off-by: Rong Tao Signed-off-by: Andrii Nakryiko Acked-by: Jiri Olsa Acked-by: Stanislav Fomichev Link: https://lore.kernel.org/bpf/tencent_C9BDA68F9221F21BE4081566A55D66A9700A@qq.com commit da1bc5cc3b55af2d785c6dd02c3b461f89f51adf Author: Matt Roper Date: Wed Sep 6 16:47:37 2023 -0700 drm/i915/display: Apply workarounds during display init Rather than applying display workarounds as part of intel_clock_gating_init() (which in turn is confusingly called from i915_gem_init during device probe), handle them at the point we're actually initializing the display hardware. This will also ensure that these workarounds are properly applied during display initialization on the Xe driver, which re-uses i915's display code, but does not call i915's gem init. Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230906234732.3728630-10-matthew.d.roper@intel.com commit 53dd7b1fb4e54d5f029824636b6d17504a4fe80c Author: Matt Roper Date: Wed Sep 6 17:10:10 2023 -0700 drm/i915/display: Extract display workarounds from clock gating init Several of the register updates that are currently done in the clock gating init functions are actually display workarounds that should move into the display-specific part of the code. Furthermore, some of the registers being programmed don't even have anything to do with clock gating at all. Extract the display workarounds for gen11 and later platforms to a dedicated display/intel_display_wa.c file to keep these separate from the SOC / sgunit clock gating that we need on some platforms. The gen11 cutoff here is selected somewhat arbitrarily; this is the point where workarounds were first assigned dedicated lineage numbers that can be easily looked up and confirmed in the modern workaround database. It also avoids any confusion on older platforms where the exact boundaries between display/GT/other IP blocks wasn't as well-defined as it is today. Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230907001009.3732474-2-matthew.d.roper@intel.com commit 3d0a1688fe5b7ff46e4d308488aee38b4146868b Author: Matt Roper Date: Wed Sep 6 16:47:35 2023 -0700 drm/i915/adlp: Stop calling gen12lp_init_clock_gating() The only programming that happens in gen12lp_init_clock_gating is for display workarounds that are specific to display version 12 and are not relevant to ADL-P's display version 13. Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230906234732.3728630-8-matthew.d.roper@intel.com commit 7ed888fa78129941255af09eddbf4cc51a3351d1 Author: Matt Roper Date: Wed Sep 6 16:47:34 2023 -0700 drm/i915: Stop forcing clock gating init for future platforms In the early days of i915, pretty much every platform needed to initialize _something_ in the clock gating init functions. In some cases the items initialized were inside the GT (and really should have been initialized through the GT workaround infrastructure instead). In other cases they were display programming (sometimes not even related to "clock gating" at all!) which probably needs to move inside the display-specific code. The number of initialization tasks that are truly "clock gating" and don't fall within the GT or display domains is relatively limited. Let's stop forcing future platforms to always define a clock gating init hook. Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230906234732.3728630-7-matthew.d.roper@intel.com commit c795d2f40a29f3aa9a4ed811f7787bf2f78111f4 Author: Tvrtko Ursulin Date: Thu Sep 7 14:58:08 2023 +0200 drm/i915: Run relevant bits of debugfs drop_caches per GT Walk all GTs when doing the respective bits of drop_caches work. Signed-off-by: Tvrtko Ursulin Signed-off-by: Andi Shyti Reviewed-by: Rodrigo Vivi Reviewed-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20230907125808.186088-1-andi.shyti@linux.intel.com commit 5aa1dfcdf0a429e4941e2eef75b006a8c7a8ac49 Author: Wayne Lin Date: Mon Aug 7 10:56:38 2023 +0800 drm/mst: Refactor the flow for payload allocation/removement [Why] Today, the allocation/deallocation steps and status is a bit unclear. For instance, payload->vc_start_slot = -1 stands for "the failure of updating DPCD payload ID table" and can also represent as "payload is not allocated yet". These two cases should be handled differently and hence better to distinguish them for better understanding. [How] Define enumeration - ALLOCATION_LOCAL, ALLOCATION_DFP and ALLOCATION_REMOTE to distinguish different allocation status. Adjust the code to handle different status accordingly for better understanding the sequence of payload allocation and payload removement. For payload creation, the procedure should look like this: DRM part 1: * step 1 - update sw mst mgr variables to add a new payload * step 2 - add payload at immediate DFP DPCD payload table Driver: * Add new payload in HW and sync up with DFP by sending ACT DRM Part 2: * Send ALLOCATE_PAYLOAD sideband message to allocate bandwidth along the virtual channel. And as for payload removement, the procedure should look like this: DRM part 1: * step 1 - Send ALLOCATE_PAYLOAD sideband message to release bandwidth along the virtual channel * step 2 - Clear payload allocation at immediate DFP DPCD payload table Driver: * Remove the payload in HW and sync up with DFP by sending ACT DRM part 2: * update sw mst mgr variables to remove the payload Note that it's fine to fail when communicate with the branch device connected at immediate downstrean-facing port, but updating variables of SW mst mgr and HW configuration should be conducted anyway. That's because it's under commit_tail and we need to complete the HW programming. Changes since v1: * Remove the set but not use variable 'old_payload' in function 'nv50_msto_prepare'. Catched by kernel test robot Signed-off-by: Wayne Lin Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230807025639.1612361-3-Wayne.Lin@amd.com commit ae4d2314ff60d2dafe598922a401e78acefccc42 Author: Wayne Lin Date: Mon Aug 7 10:56:37 2023 +0800 drm/mst: delete unnecessary case in drm_dp_add_payload_part2() [Why] There is no need to consider payload->delete case since we won't call drm_dp_add_payload_part2() to create a payload when we're about to remove it. [How] Delete unnecessary case to simplify the code. Signed-off-by: Wayne Lin Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20230807025639.1612361-2-Wayne.Lin@amd.com commit fb0a84e6de1b6bee0a0649cc7ed768f9ff2496bb Author: Arthur Grillo Date: Fri Sep 1 15:52:56 2023 -0300 drm/tests: Zero initialize fourccs_out fourccs_out array is not initialized. As the drm_fb_build_fourcc_list() doesn't necessarily change all the array, and the test compares all of it, the comparison could fail if the array is not initialized. Zero initialize the array to fix this. Fixes: 371e0b186a13 ("drm/tests: Add KUnit tests for drm_fb_build_fourcc_list()") Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230901-zero-init-fourcc-list-test-v1-1-68bc4cc738c8@riseup.net commit b88c168e6b91eefde1ba4cba19b0f3e3d735c3d2 Author: Arthur Grillo Date: Fri Sep 1 15:05:50 2023 -0300 drm/debugfs: Add inline to drm_debugfs_dev_init() to suppres -Wunused-function When CONFIG_DEBUG_FS is not set -Wunused-function warnings appear, make the static function inline to suppress that. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202309012114.T8Vlfaf8-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202309012131.FeakBzEj-lkp@intel.com/ Signed-off-by: Arthur Grillo Reviewed-by: Andi Shyti Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230901-debugfs-fix-unused-function-warning-v1-1-161dd0902975@riseup.net commit 9bc869253d4de75fed388caaeb7626b3ee8ec56c Merge: 35897c3c52644 780aa8dfcb73f Author: Alexei Starovoitov Date: Thu Sep 7 08:46:29 2023 -0700 Merge branch 'bpf-task_group_seq_get_next-misc-cleanups' Oleg Nesterov says: ==================== bpf: task_group_seq_get_next: misc cleanups Yonghong, I am resending 1-5 of 6 as you suggested with your acks included. The next (final) patch will change this code to use __next_thread when https://lore.kernel.org/all/20230824143142.GA31222@redhat.com/ is merged. Oleg. ==================== Link: https://lore.kernel.org/r/20230905154612.GA24872@redhat.com Signed-off-by: Alexei Starovoitov commit 35897c3c5264469cbd45e44d23c165a08cfb6b3c Merge: 1e4a6d975e5cd 29c11aa8082b6 Author: Alexei Starovoitov Date: Tue Sep 5 17:47:54 2023 -0700 Merge branch 'bpf-enable-irq-after-irq_work_raise-completes' Hou Tao says: ==================== bpf: Enable IRQ after irq_work_raise() completes From: Hou Tao Hi, The patchset aims to fix the problem that bpf_mem_alloc() may return NULL unexpectedly when multiple bpf_mem_alloc() are invoked concurrently under process context and there is still free memory available. The problem was found when doing stress test for qp-trie but the same problem also exists for bpf_obj_new() as demonstrated in patch #3. As pointed out by Alexei, the patchset can only fix ENOMEM problem for normal process context and can not fix the problem for irq-disabled context or RT-enabled kernel. Patch #1 fixes the race between unit_alloc() and unit_alloc(). Patch #2 fixes the race between unit_alloc() and unit_free(). And patch #3 adds a selftest for the problem. The major change compared with v1 is using local_irq_{save,restore)() pair to disable and enable preemption instead of preempt_{disable,enable}_notrace pair. The main reason is to prevent potential overhead from __preempt_schedule_notrace(). I also run htab_mem benchmark and hash_map_perf on a 8-CPUs KVM VM to compare the performance between local_irq_{save,restore} and preempt_{disable,enable}_notrace(), but the results are similar as shown below: (1) use preempt_{disable,enable}_notrace() [root@hello bpf]# ./map_perf_test 4 8 0:hash_map_perf kmalloc 652179 events per sec 1:hash_map_perf kmalloc 651880 events per sec 2:hash_map_perf kmalloc 651382 events per sec 3:hash_map_perf kmalloc 650791 events per sec 5:hash_map_perf kmalloc 650140 events per sec 6:hash_map_perf kmalloc 652773 events per sec 7:hash_map_perf kmalloc 652751 events per sec 4:hash_map_perf kmalloc 648199 events per sec [root@hello bpf]# ./benchs/run_bench_htab_mem.sh normal bpf ma ============= overwrite per-prod-op: 110.82 ± 0.02k/s, avg mem: 2.00 ± 0.00MiB, peak mem: 2.73MiB batch_add_batch_del per-prod-op: 89.79 ± 0.75k/s, avg mem: 1.68 ± 0.38MiB, peak mem: 2.73MiB add_del_on_diff_cpu per-prod-op: 17.83 ± 0.07k/s, avg mem: 25.68 ± 2.92MiB, peak mem: 35.10MiB (2) use local_irq_{save,restore} [root@hello bpf]# ./map_perf_test 4 8 0:hash_map_perf kmalloc 656299 events per sec 1:hash_map_perf kmalloc 656397 events per sec 2:hash_map_perf kmalloc 656046 events per sec 3:hash_map_perf kmalloc 655723 events per sec 5:hash_map_perf kmalloc 655221 events per sec 4:hash_map_perf kmalloc 654617 events per sec 6:hash_map_perf kmalloc 650269 events per sec 7:hash_map_perf kmalloc 653665 events per sec [root@hello bpf]# ./benchs/run_bench_htab_mem.sh normal bpf ma ============= overwrite per-prod-op: 116.10 ± 0.02k/s, avg mem: 2.00 ± 0.00MiB, peak mem: 2.74MiB batch_add_batch_del per-prod-op: 88.76 ± 0.61k/s, avg mem: 1.94 ± 0.33MiB, peak mem: 2.74MiB add_del_on_diff_cpu per-prod-op: 18.12 ± 0.08k/s, avg mem: 25.10 ± 2.70MiB, peak mem: 34.78MiB As ususal comments are always welcome. Change Log: v2: * Use local_irq_save to disable preemption instead of using preempt_{disable,enable}_notrace pair to prevent potential overhead v1: https://lore.kernel.org/bpf/20230822133807.3198625-1-houtao@huaweicloud.com/ ==================== Link: https://lore.kernel.org/r/20230901111954.1804721-1-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 780aa8dfcb73f4703b1c4be11c21c8dca36502ad Author: Oleg Nesterov Date: Tue Sep 5 17:46:56 2023 +0200 bpf: task_group_seq_get_next: simplify the "next tid" logic Kill saved_tid. It looks ugly to update *tid and then restore the previous value if __task_pid_nr_ns() returns 0. Change this code to update *tid and common->pid_visiting once before return. Signed-off-by: Oleg Nesterov Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230905154656.GA24950@redhat.com Signed-off-by: Alexei Starovoitov commit 29c11aa8082b6dbef2cffbcd5e81be27e9b50a5b Author: Hou Tao Date: Fri Sep 1 19:19:54 2023 +0800 selftests/bpf: Test preemption between bpf_obj_new() and bpf_obj_drop() The test case creates 4 threads and then pins these 4 threads in CPU 0. These 4 threads will run different bpf program through bpf_prog_test_run_opts() and these bpf program will use bpf_obj_new() and bpf_obj_drop() to allocate and free local kptrs concurrently. Under preemptible kernel, bpf_obj_new() and bpf_obj_drop() may preempt each other, bpf_obj_new() may return NULL and the test will fail before applying these fixes as shown below: test_preempted_bpf_ma_op:PASS:open_and_load 0 nsec test_preempted_bpf_ma_op:PASS:attach 0 nsec test_preempted_bpf_ma_op:PASS:no test prog 0 nsec test_preempted_bpf_ma_op:PASS:no test prog 0 nsec test_preempted_bpf_ma_op:PASS:no test prog 0 nsec test_preempted_bpf_ma_op:PASS:no test prog 0 nsec test_preempted_bpf_ma_op:PASS:pthread_create 0 nsec test_preempted_bpf_ma_op:PASS:pthread_create 0 nsec test_preempted_bpf_ma_op:PASS:pthread_create 0 nsec test_preempted_bpf_ma_op:PASS:pthread_create 0 nsec test_preempted_bpf_ma_op:PASS:run prog err 0 nsec test_preempted_bpf_ma_op:PASS:run prog err 0 nsec test_preempted_bpf_ma_op:PASS:run prog err 0 nsec test_preempted_bpf_ma_op:PASS:run prog err 0 nsec test_preempted_bpf_ma_op:FAIL:ENOMEM unexpected ENOMEM: got TRUE #168 preempted_bpf_ma_op:FAIL Summary: 0/0 PASSED, 0 SKIPPED, 1 FAILED Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20230901111954.1804721-4-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 0ee9808b0a211ba1e572073c6afe5897f8300b9c Author: Oleg Nesterov Date: Tue Sep 5 17:46:54 2023 +0200 bpf: task_group_seq_get_next: kill next_task It only adds the unnecessary confusion and compicates the "retry" code. Signed-off-by: Oleg Nesterov Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230905154654.GA24945@redhat.com Signed-off-by: Alexei Starovoitov commit 62cf51cb0ebe997a9903208e546755b63eb7ff9d Author: Hou Tao Date: Fri Sep 1 19:19:53 2023 +0800 bpf: Enable IRQ after irq_work_raise() completes in unit_free{_rcu}() Both unit_free() and unit_free_rcu() invoke irq_work_raise() to free freed objects back to slab and the invocation may also be preempted by unit_alloc() and unit_alloc() may return NULL unexpectedly as shown in the following case: task A task B unit_free() // high_watermark = 48 // free_cnt = 49 after free irq_work_raise() // mark irq work as IRQ_WORK_PENDING irq_work_claim() // task B preempts task A unit_alloc() // free_cnt = 48 after alloc // does unit_alloc() 32-times ...... // free_cnt = 16 unit_alloc() // free_cnt = 15 after alloc // irq work is already PENDING, // so just return irq_work_raise() // does unit_alloc() 15-times ...... // free_cnt = 0 unit_alloc() // free_cnt = 0 before alloc return NULL Fix it by enabling IRQ after irq_work_raise() completes. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20230901111954.1804721-3-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 87abbf7a54f6c9c51374b0701cd7ab47534516ae Author: Oleg Nesterov Date: Tue Sep 5 17:46:51 2023 +0200 bpf: task_group_seq_get_next: fix the skip_if_dup_files check Unless I am notally confused it is wrong. We are going to return or skip next_task so we need to check next_task-files, not task->files. Signed-off-by: Oleg Nesterov Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230905154651.GA24940@redhat.com Signed-off-by: Alexei Starovoitov commit 4981921350452a7639fac9ac8f19be4d25febdca Author: Oleg Nesterov Date: Tue Sep 5 17:46:49 2023 +0200 bpf: task_group_seq_get_next: cleanup the usage of get/put_task_struct get_pid_task() makes no sense, the code does put_task_struct() soon after. Use find_task_by_pid_ns() instead of find_pid_ns + get_pid_task and kill put_task_struct(), this allows to do get_task_struct() only once before return. While at it, kill the unnecessary "if (!pid)" check in the "if (!*tid)" block, this matches the next usage of find_pid_ns() + get_pid_task() in this function. Signed-off-by: Oleg Nesterov Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230905154649.GA24935@redhat.com Signed-off-by: Alexei Starovoitov commit 1a00ef57d9f120b711b6b1193d12ba3789d47ec2 Author: Oleg Nesterov Date: Tue Sep 5 17:46:46 2023 +0200 bpf: task_group_seq_get_next: cleanup the usage of next_thread() 1. find_pid_ns() + get_pid_task() under rcu_read_lock() guarantees that we can safely iterate the task->thread_group list. Even if this task exits right after get_pid_task() (or goto retry) and pid_alive() returns 0. Kill the unnecessary pid_alive() check. 2. next_thread() simply can't return NULL, kill the bogus "if (!next_task)" check. Signed-off-by: Oleg Nesterov Acked-by: "Eric W. Biederman" Acked-by: Yonghong Song Link: https://lore.kernel.org/r/20230905154646.GA24928@redhat.com Signed-off-by: Alexei Starovoitov commit 1e4a6d975e5cd114509aa447750d68d295a501a7 Merge: 3903802bb99a2 9bc95a95abbe9 Author: Alexei Starovoitov Date: Tue Sep 5 17:41:44 2023 -0700 Merge branch 'bpf-add-support-for-local-percpu-kptr' Yonghong Song says: ==================== bpf: Add support for local percpu kptr Patch set [1] implemented cgroup local storage BPF_MAP_TYPE_CGRP_STORAGE similar to sk/task/inode local storage and old BPF_MAP_TYPE_CGROUP_STORAGE map is marked as deprecated since old BPF_MAP_TYPE_CGROUP_STORAGE map can only work with current cgroup. Similarly, the existing BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE map is a percpu version of BPF_MAP_TYPE_CGROUP_STORAGE and only works with current cgroup. But there is no replacement which can work with arbitrary cgroup. This patch set solved this problem but adding support for local percpu kptr. The map value can have a percpu kptr field which holds a bpf prog allocated percpu data. The below is an example, struct percpu_val_t { ... fields ... } struct map_value_t { struct percpu_val_t __percpu_kptr *percpu_data_ptr; } In the above, 'map_value_t' is the map value type for a BPF_MAP_TYPE_CGRP_STORAGE map. User can access 'percpu_data_ptr' and then read/write percpu data. This covers BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE and more. So BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE map type is marked as deprecated. In additional, local percpu kptr supports the same map type as other kptrs including hash, lru_hash, array, sk/inode/task/cgrp local storage. Currently, percpu data structure does not support non-scalars or special fields (e.g., bpf_spin_lock, bpf_rb_root, etc.). They can be supported in the future if there exist use cases. Please for individual patches for details. [1] https://lore.kernel.org/all/20221026042835.672317-1-yhs@fb.com/ Changelog: v2 -> v3: - fix libbpf_str test failure. v1 -> v2: - does not support special fields in percpu data structure. - rename __percpu attr to __percpu_kptr attr. - rename BPF_KPTR_PERCPU_REF to BPF_KPTR_PERCPU. - better code to handle bpf_{this,per}_cpu_ptr() helpers. - add more negative tests. - fix a bpftool related test failure. ==================== Link: https://lore.kernel.org/r/20230827152729.1995219-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit 566f6de3cea3482d75d836a2398792a8be32ec26 Author: Hou Tao Date: Fri Sep 1 19:19:52 2023 +0800 bpf: Enable IRQ after irq_work_raise() completes in unit_alloc() When doing stress test for qp-trie, bpf_mem_alloc() returned NULL unexpectedly because all qp-trie operations were initiated from bpf syscalls and there was still available free memory. bpf_obj_new() has the same problem as shown by the following selftest. The failure is due to the preemption. irq_work_raise() will invoke irq_work_claim() first to mark the irq work as pending and then inovke __irq_work_queue_local() to raise an IPI. So when the current task which is invoking irq_work_raise() is preempted by other task, unit_alloc() may return NULL for preemption task as shown below: task A task B unit_alloc() // low_watermark = 32 // free_cnt = 31 after alloc irq_work_raise() // mark irq work as IRQ_WORK_PENDING irq_work_claim() // task B preempts task A unit_alloc() // free_cnt = 30 after alloc // irq work is already PENDING, // so just return irq_work_raise() // does unit_alloc() 30-times ...... unit_alloc() // free_cnt = 0 before alloc return NULL Fix it by enabling IRQ after irq_work_raise() completes. An alternative fix is using preempt_{disable|enable}_notrace() pair, but it may have extra overhead. Another feasible fix is to only disable preemption or IRQ before invoking irq_work_queue() and enable preemption or IRQ after the invocation completes, but it can't handle the case when c->low_watermark is 1. Signed-off-by: Hou Tao Link: https://lore.kernel.org/r/20230901111954.1804721-2-houtao@huaweicloud.com Signed-off-by: Alexei Starovoitov commit 9bc95a95abbe91e9315c1fe27dc124019bd2592c Author: Yonghong Song Date: Sun Aug 27 08:28:37 2023 -0700 bpf: Mark BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE deprecated Now 'BPF_MAP_TYPE_CGRP_STORAGE + local percpu ptr' can cover all BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE functionality and more. So mark BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE deprecated. Also make changes in selftests/bpf/test_bpftool_synctypes.py and selftest libbpf_str to fix otherwise test errors. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230827152837.2003563-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit 1bd7931728718bc463c43b78ab74954452e099e3 Author: Yonghong Song Date: Sun Aug 27 08:28:32 2023 -0700 selftests/bpf: Add some negative tests Add a few negative tests for common mistakes with using percpu kptr including: - store to percpu kptr. - type mistach in bpf_kptr_xchg arguments. - sleepable prog with untrusted arg for bpf_this_cpu_ptr(). - bpf_percpu_obj_new && bpf_obj_drop, and bpf_obj_new && bpf_percpu_obj_drop - struct with ptr for bpf_percpu_obj_new - struct with special field (e.g., bpf_spin_lock) for bpf_percpu_obj_new Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230827152832.2002421-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit dfae1eeee9baa12e27f24a223d699326133e366b Author: Yonghong Song Date: Sun Aug 27 08:28:27 2023 -0700 selftests/bpf: Add tests for cgrp_local_storage with local percpu kptr Add a non-sleepable cgrp_local_storage test with percpu kptr. The test does allocation of percpu data, assigning values to percpu data and retrieval of percpu data. The de-allocation of percpu data is done when the map is freed. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230827152827.2001784-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit 46200d6da544a624ad4a6f5745defed7e318f73d Author: Yonghong Song Date: Sun Aug 27 08:28:21 2023 -0700 selftests/bpf: Remove unnecessary direct read of local percpu kptr For the second argument of bpf_kptr_xchg(), if the reg type contains MEM_ALLOC and MEM_PERCPU, which means a percpu allocation, after bpf_kptr_xchg(), the argument is marked as MEM_RCU and MEM_PERCPU if in rcu critical section. This way, re-reading from the map value is not needed. Remove it from the percpu_alloc_array.c selftest. Without previous kernel change, the test will fail like below: 0: R1=ctx(off=0,imm=0) R10=fp0 ; int BPF_PROG(test_array_map_10, int a) 0: (b4) w1 = 0 ; R1_w=0 ; int i, index = 0; 1: (63) *(u32 *)(r10 -4) = r1 ; R1_w=0 R10=fp0 fp-8=0000???? 2: (bf) r2 = r10 ; R2_w=fp0 R10=fp0 ; 3: (07) r2 += -4 ; R2_w=fp-4 ; e = bpf_map_lookup_elem(&array, &index); 4: (18) r1 = 0xffff88810e771800 ; R1_w=map_ptr(off=0,ks=4,vs=16,imm=0) 6: (85) call bpf_map_lookup_elem#1 ; R0_w=map_value_or_null(id=1,off=0,ks=4,vs=16,imm=0) 7: (bf) r6 = r0 ; R0_w=map_value_or_null(id=1,off=0,ks=4,vs=16,imm=0) R6_w=map_value_or_null(id=1,off=0,ks=4,vs=16,imm=0) ; if (!e) 8: (15) if r6 == 0x0 goto pc+81 ; R6_w=map_value(off=0,ks=4,vs=16,imm=0) ; bpf_rcu_read_lock(); 9: (85) call bpf_rcu_read_lock#87892 ; ; p = e->pc; 10: (bf) r7 = r6 ; R6=map_value(off=0,ks=4,vs=16,imm=0) R7_w=map_value(off=0,ks=4,vs=16,imm=0) 11: (07) r7 += 8 ; R7_w=map_value(off=8,ks=4,vs=16,imm=0) 12: (79) r6 = *(u64 *)(r6 +8) ; R6_w=percpu_rcu_ptr_or_null_val_t(id=2,off=0,imm=0) ; if (!p) { 13: (55) if r6 != 0x0 goto pc+13 ; R6_w=0 ; p = bpf_percpu_obj_new(struct val_t); 14: (18) r1 = 0x12 ; R1_w=18 16: (b7) r2 = 0 ; R2_w=0 17: (85) call bpf_percpu_obj_new_impl#87883 ; R0_w=percpu_ptr_or_null_val_t(id=4,ref_obj_id=4,off=0,imm=0) refs=4 18: (bf) r6 = r0 ; R0=percpu_ptr_or_null_val_t(id=4,ref_obj_id=4,off=0,imm=0) R6=percpu_ptr_or_null_val_t(id=4,ref_obj_id=4,off=0,imm=0) refs=4 ; if (!p) 19: (15) if r6 == 0x0 goto pc+69 ; R6=percpu_ptr_val_t(ref_obj_id=4,off=0,imm=0) refs=4 ; p1 = bpf_kptr_xchg(&e->pc, p); 20: (bf) r1 = r7 ; R1_w=map_value(off=8,ks=4,vs=16,imm=0) R7=map_value(off=8,ks=4,vs=16,imm=0) refs=4 21: (bf) r2 = r6 ; R2_w=percpu_ptr_val_t(ref_obj_id=4,off=0,imm=0) R6=percpu_ptr_val_t(ref_obj_id=4,off=0,imm=0) refs=4 22: (85) call bpf_kptr_xchg#194 ; R0_w=percpu_ptr_or_null_val_t(id=6,ref_obj_id=6,off=0,imm=0) refs=6 ; if (p1) { 23: (15) if r0 == 0x0 goto pc+3 ; R0_w=percpu_ptr_val_t(ref_obj_id=6,off=0,imm=0) refs=6 ; bpf_percpu_obj_drop(p1); 24: (bf) r1 = r0 ; R0_w=percpu_ptr_val_t(ref_obj_id=6,off=0,imm=0) R1_w=percpu_ptr_val_t(ref_obj_id=6,off=0,imm=0) refs=6 25: (b7) r2 = 0 ; R2_w=0 refs=6 26: (85) call bpf_percpu_obj_drop_impl#87882 ; ; v = bpf_this_cpu_ptr(p); 27: (bf) r1 = r6 ; R1_w=scalar(id=7) R6=scalar(id=7) 28: (85) call bpf_this_cpu_ptr#154 R1 type=scalar expected=percpu_ptr_, percpu_rcu_ptr_, percpu_trusted_ptr_ The R1 which gets its value from R6 is a scalar. But before insn 22, R6 is R6=percpu_ptr_val_t(ref_obj_id=4,off=0,imm=0) Its type is changed to a scalar at insn 22 without previous patch. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230827152821.2001129-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit 5b221ecb3a9e48013d7b4ad7960af3adba23d1d1 Author: Yonghong Song Date: Sun Aug 27 08:28:16 2023 -0700 bpf: Mark OBJ_RELEASE argument as MEM_RCU when possible In previous selftests/bpf patch, we have p = bpf_percpu_obj_new(struct val_t); if (!p) goto out; p1 = bpf_kptr_xchg(&e->pc, p); if (p1) { /* race condition */ bpf_percpu_obj_drop(p1); } p = e->pc; if (!p) goto out; After bpf_kptr_xchg(), we need to re-read e->pc into 'p'. This is due to that the second argument of bpf_kptr_xchg() is marked OBJ_RELEASE and it will be marked as invalid after the call. So after bpf_kptr_xchg(), 'p' is an unknown scalar, and the bpf program needs to reread from the map value. This patch checks if the 'p' has type MEM_ALLOC and MEM_PERCPU, and if 'p' is RCU protected. If this is the case, 'p' can be marked as MEM_RCU. MEM_ALLOC needs to be removed since 'p' is not an owning reference any more. Such a change makes re-read from the map value unnecessary. Note that re-reading 'e->pc' after bpf_kptr_xchg() might get a different value from 'p' if immediately before 'p = e->pc', another cpu may do another bpf_kptr_xchg() and swap in another value into 'e->pc'. If this is the case, then 'p = e->pc' may get either 'p' or another value, and race condition already exists. So removing direct re-reading seems fine too. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230827152816.2000760-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit 6adf82a4398d774398b4538dad561958c2c9521e Author: Yonghong Song Date: Sun Aug 27 08:28:11 2023 -0700 selftests/bpf: Add tests for array map with local percpu kptr Add non-sleepable and sleepable tests with percpu kptr. For non-sleepable test, four programs are executed in the order of: 1. allocate percpu data. 2. assign values to percpu data. 3. retrieve percpu data. 4. de-allocate percpu data. The sleepable prog tried to exercise all above 4 steps in a single prog. Also for sleepable prog, rcu_read_lock is needed to protect direct percpu ptr access (from map value) and following bpf_this_cpu_ptr() and bpf_per_cpu_ptr() helpers. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230827152811.2000125-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit 968c76cb3dc6cc86e8099ecaa5c30dc0d4738a30 Author: Yonghong Song Date: Sun Aug 27 08:28:05 2023 -0700 selftests/bpf: Add bpf_percpu_obj_{new,drop}() macro in bpf_experimental.h The new macro bpf_percpu_obj_{new/drop}() is very similar to bpf_obj_{new,drop}() as they both take a type as the argument. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230827152805.1999417-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit ed5285a1482f81f031183286e98edfe76fd9ac3b Author: Yonghong Song Date: Sun Aug 27 08:28:00 2023 -0700 libbpf: Add __percpu_kptr macro definition Add __percpu_kptr macro definition in bpf_helpers.h. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230827152800.1998492-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit 3903802bb99a263a3c26422c3d30a121b1f6f939 Author: Andrii Nakryiko Date: Fri Aug 25 13:21:52 2023 -0700 libbpf: Add basic BTF sanity validation Implement a simple and straightforward BTF sanity check when parsing BTF data. Right now it's very basic and just validates that all the string offsets and type IDs are within valid range. For FUNC we also check that it points to FUNC_PROTO kinds. Even with such simple checks it fixes a bunch of crashes found by OSS fuzzer ([0]-[5]) and will allow fuzzer to make further progress. Some other invariants will be checked in follow up patches (like ensuring there is no infinite type loops), but this seems like a good start already. Adding FUNC -> FUNC_PROTO check revealed that one of selftests has a problem with FUNC pointing to VAR instead, so fix it up in the same commit. [0] https://github.com/libbpf/libbpf/issues/482 [1] https://github.com/libbpf/libbpf/issues/483 [2] https://github.com/libbpf/libbpf/issues/485 [3] https://github.com/libbpf/libbpf/issues/613 [4] https://github.com/libbpf/libbpf/issues/618 [5] https://github.com/libbpf/libbpf/issues/619 Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Reviewed-by: Alan Maguire Reviewed-by: Song Liu Closes: https://github.com/libbpf/libbpf/issues/617 Link: https://lore.kernel.org/bpf/20230825202152.1813394-1-andrii@kernel.org commit 96fc99d3d56ff094db7fc5d211183bb3d5c2caaa Author: Yonghong Song Date: Sun Aug 27 08:27:54 2023 -0700 selftests/bpf: Update error message in negative linked_list test Some error messages are changed due to the addition of percpu kptr support. Fix linked_list test with changed error messages. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230827152754.1997769-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit 01cc55af93884f1ff5a883426e1924378dfcc62a Author: Yonghong Song Date: Sun Aug 27 08:27:49 2023 -0700 bpf: Add bpf_this_cpu_ptr/bpf_per_cpu_ptr support for allocated percpu obj The bpf helpers bpf_this_cpu_ptr() and bpf_per_cpu_ptr() are re-purposed for allocated percpu objects. For an allocated percpu obj, the reg type is 'PTR_TO_BTF_ID | MEM_PERCPU | MEM_RCU'. The return type for these two re-purposed helpera is 'PTR_TO_MEM | MEM_RCU | MEM_ALLOC'. The MEM_ALLOC allows that the per-cpu data can be read and written. Since the memory allocator bpf_mem_alloc() returns a ptr to a percpu ptr for percpu data, the first argument of bpf_this_cpu_ptr() and bpf_per_cpu_ptr() is patched with a dereference before passing to the helper func. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230827152749.1997202-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit 36d8bdf75a93190e5669b9d1d95994e13e15ba1d Author: Yonghong Song Date: Sun Aug 27 08:27:44 2023 -0700 bpf: Add alloc/xchg/direct_access support for local percpu kptr Add two new kfunc's, bpf_percpu_obj_new_impl() and bpf_percpu_obj_drop_impl(), to allocate a percpu obj. Two functions are very similar to bpf_obj_new_impl() and bpf_obj_drop_impl(). The major difference is related to percpu handling. bpf_rcu_read_lock() struct val_t __percpu_kptr *v = map_val->percpu_data; ... bpf_rcu_read_unlock() For a percpu data map_val like above 'v', the reg->type is set as PTR_TO_BTF_ID | MEM_PERCPU | MEM_RCU if inside rcu critical section. MEM_RCU marking here is similar to NON_OWN_REF as 'v' is not a owning reference. But NON_OWN_REF is trusted and typically inside the spinlock while MEM_RCU is under rcu read lock. RCU is preferred here since percpu data structures mean potential concurrent access into its contents. Also, bpf_percpu_obj_new_impl() is restricted such that no pointers or special fields are allowed. Therefore, the bpf_list_head and bpf_rb_root will not be supported in this patch set to avoid potential memory leak issue due to racing between bpf_obj_free_fields() and another bpf_kptr_xchg() moving an allocated object to bpf_list_head and bpf_rb_root. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230827152744.1996739-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit 55db92f42fe4a4ef7b4c2b4960c6212c8512dd53 Author: Yonghong Song Date: Sun Aug 27 08:27:39 2023 -0700 bpf: Add BPF_KPTR_PERCPU as a field type BPF_KPTR_PERCPU represents a percpu field type like below struct val_t { ... fields ... }; struct t { ... struct val_t __percpu_kptr *percpu_data_ptr; ... }; where #define __percpu_kptr __attribute__((btf_type_tag("percpu_kptr"))) While BPF_KPTR_REF points to a trusted kernel object or a trusted local object, BPF_KPTR_PERCPU points to a trusted local percpu object. This patch added basic support for BPF_KPTR_PERCPU related to percpu_kptr field parsing, recording and free operations. BPF_KPTR_PERCPU also supports the same map types as BPF_KPTR_REF does. Note that unlike a local kptr, it is possible that a BPF_KTPR_PERCPU struct may not contain any special fields like other kptr, bpf_spin_lock, bpf_list_head, etc. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230827152739.1996391-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit 41a5db8d8161457b121a03fde999ff6e00090ee2 Author: Yonghong Song Date: Sun Aug 27 08:27:34 2023 -0700 bpf: Add support for non-fix-size percpu mem allocation This is needed for later percpu mem allocation when the allocation is done by bpf program. For such cases, a global bpf_global_percpu_ma is added where a flexible allocation size is needed. Signed-off-by: Yonghong Song Link: https://lore.kernel.org/r/20230827152734.1995725-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov commit 94bcf876cb6a224685c750cefc6ca75c01d8db8f Author: Matt Roper Date: Wed Sep 6 17:03:55 2023 -0700 drm/i915/mtl: Drop Wa_14017240301 Drop Wa_14017240301, which is only relevant to pre-production MTL hardware. Although we usually wait a little bit longer to start dropping pre-production workarounds for a platform, it was suggested to eliminate this one slightly earlier because it's a bit unusual/ugly: this workaround is a display-specific workaround that requires matching on the graphics/GT IP version instead of the display IP version. Suggested-by: Jani Nikula Signed-off-by: Matt Roper Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230907000354.3729827-2-matthew.d.roper@intel.com commit 4632e3209f4b4349ebe67597897045b1a8af9daa Author: Shekhar Chauhan Date: Fri Sep 1 10:27:00 2023 +0530 drm/i915: Add Wa_14015150844 Disables Atomic-chaining of Typed Writes. BSpec: 54040 Signed-off-by: Shekhar Chauhan Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230901045700.2553994-1-shekhar.chauhan@intel.com commit e4a0fbdd85216d33b9d7ba5667210fd9a915e62b Author: Rodrigo Vivi Date: Tue Aug 29 12:30:04 2023 -0400 drm/doc/rfc: Mark GPU VA as complete. Nouveau has landed the GPU VA helpers, support and documentation already and Xe is already using the upstream GPU VA. Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/commit/ea4ae69e66b2940107e74f240ecb9dae87bf1ff1 Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/commits/drm-xe-next?ref_type=heads Signed-off-by: Rodrigo Vivi Acked-by: Daniel Vetter Acked-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20230829163005.54067-4-rodrigo.vivi@intel.com commit 3d06add933cc0ccb41cf4ba531216b144e12609f Author: Rodrigo Vivi Date: Tue Aug 29 12:30:03 2023 -0400 drm/doc/rfc: Mark DRM_VM_BIND as complete. The consensus is for individual drivers VM_BIND uapis with the GPUVA helpers that are already implemented and merged upstream. The merged GPUVA documentation also establish some overall rules for the locking to be followed by the drivers. Signed-off-by: Rodrigo Vivi Acked-by: Daniel Vetter Acked-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20230829163005.54067-3-rodrigo.vivi@intel.com commit eed5d32ea1e2a02ba7f14f493263614121a429a3 Author: Rodrigo Vivi Date: Tue Aug 29 12:30:02 2023 -0400 drm/doc/rfc: Mark Dev_coredump as completed. Xe is already using devcoredump infrastructure as the primary error state and all the changes needed for user space error replay and other useful logs are getting added into xe_devcoredump. Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/blob/drm-xe-next/drivers/gpu/drm/xe/xe_devcoredump.c Signed-off-by: Rodrigo Vivi Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20230829163005.54067-2-rodrigo.vivi@intel.com commit d29e112ab8d4fea3bf82c7b023c6e65ed2c0e5eb Author: Rodrigo Vivi Date: Tue Aug 29 12:30:01 2023 -0400 drm/doc/rfc: No STAGING out of drivers/staging. Also the uapi should be reviewed and scrutinized before xe is accepted upstream and we shouldn't cause regression. Link: https://lore.kernel.org/all/20230630100059.122881-1-thomas.hellstrom@linux.intel.com Acked-by: Daniel Vetter Reviewed-by: Lucas De Marchi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230829163005.54067-1-rodrigo.vivi@intel.com commit 9eeba919dd0f524f73feeeef82f3ca877f9ccce4 Author: Javier Carrasco Date: Wed Sep 6 22:47:38 2023 +0200 drm/connector: document DRM_MODE_COLORIMETRY_COUNT The drm_colorspace enum member DRM_MODE_COLORIMETRY_COUNT has been properly documented by moving the description out of the enum to the member description list to get rid of an additional warning and improve documentation clarity. Signed-off-by: Javier Carrasco Reviewed-by: Randy Dunlap Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230906-topic-drm_connector_doc-v2-1-1f2dcaa43269@gmail.com commit 231b1d6c9ab6ff23f7a1826835946dd2b0f57156 Author: Ville Syrjälä Date: Tue Jun 6 22:14:52 2023 +0300 drm/i915/dsb: Don't use indexed writes when byte enables are not all set The indexed write instruction doesn't support byte-enables, so if the non-indexed write used those we must not convert it to an indexed write. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-8-ville.syrjala@linux.intel.com Reviewed-by: Animesh Manna commit 088ca02108fcb75ae60a82f031a2f6aea731c818 Author: Ville Syrjälä Date: Tue Jun 6 22:14:51 2023 +0300 drm/i915/dsb: Avoid corrupting the first register write i915_gem_object_create_internal() does not hand out zeroed memory. Thus we may confuse whatever stale garbage is in there as a previous register write and mistakenly handle the first actual register write as an indexed write. This can end up corrupting the instruction sufficiently well to lose the entire register write. Make sure we've actually emitted a previous instruction before attemting indexed register write merging. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-7-ville.syrjala@linux.intel.com Reviewed-by: Animesh Manna commit 9055e73e8e6a545e43cbc4fd3c9083eeccd8121a Author: Ville Syrjälä Date: Tue Jun 6 22:14:48 2023 +0300 drm/i915/dsb: Dump the DSB command buffer when DSB fails Dump the full DSB command buffers and head/tail pointers if the the DSB hasn't completed its job in time. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-4-ville.syrjala@linux.intel.com Reviewed-by: Animesh Manna commit 61ae1240090407bb17c3d8f66f55ce86eafa02d5 Author: Ville Syrjälä Date: Tue Jun 6 22:14:46 2023 +0300 drm/i915: Constify LUT entries in checker The LUT checker doesn't modify the LUT entries so make them const. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230606191504.18099-2-ville.syrjala@linux.intel.com Reviewed-by: Animesh Manna commit e0b5127fa134fe0284d58877b6b3133939c8b3ce Author: Rand Deeb Date: Tue Sep 5 02:23:46 2023 +0300 ssb: Fix division by zero issue in ssb_calc_clock_rate In ssb_calc_clock_rate(), there is a potential issue where the value of m1 could be zero due to initialization using clkfactor_f6_resolv(). This situation raised concerns about the possibility of a division by zero error. We fixed it by following the suggestions provided by Larry Finger and Michael Büsch . The fix involves returning a value of 1 instead of 0 in clkfactor_f6_resolv(). This modification ensures the proper functioning of the code and eliminates the risk of division by zero errors. Signed-off-by: Rand Deeb Acked-by: Larry Finger Acked-by: Michael Büsch Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230904232346.34991-1-rand.sec96@gmail.com commit b227c990de9a3af37d1c9e6fd9b193145b4ca779 Author: Ping-Ke Shih Date: Fri Sep 1 15:39:56 2023 +0800 wifi: rtw89: 8922a: set memory heap address for secure firmware Secure firmware is protected by public/private key cryptography. To help firmware self verify integrity, configure a heap address for these data before downloading firmware. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230901073956.54203-9-pkshih@realtek.com commit 38bae445a30befdf1d88476ef86ee27ee3525a28 Author: Ping-Ke Shih Date: Fri Sep 1 15:39:55 2023 +0800 wifi: rtw89: fw: refine download flow to support variant firmware suits To support download more than one firmware, adjust flow to download firmware by unit of firmware suit. Then, flow becomes 1. initial setup - disable/enable_wcpu 2. for all firmware suits 2.1. download WiFi CPU, and check ready 2.2. download BB MCU, and check ready 3. check status code to make sure all ready Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230901073956.54203-8-pkshih@realtek.com commit c6ea2a8391a55bf43b67fe6cf7b0688e9c76a060 Author: Ping-Ke Shih Date: Fri Sep 1 15:39:54 2023 +0800 wifi: rtw89: 8922a: add chip_ops::bb_preinit to enable BB before downloading firmware Before downloading firmware for BB MCU, call this ops to enable baseband hardware. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230901073956.54203-7-pkshih@realtek.com commit a712eef681ed998ca5d036a82df38c7efcd4416b Author: Ping-Ke Shih Date: Fri Sep 1 15:39:53 2023 +0800 wifi: rtw89: fw: propagate an argument include_bb for BB MCU firmware Though WiFi 7 chips need BB MCU firmware, we don't download it in probe stage. Instead, only bring interface up under normal operation or WoWLAN mode. So, add an argument to assist download flow to setup download settings properly. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230901073956.54203-6-pkshih@realtek.com commit fa31a8c58d6e612ccaf19fd60eda64faaca35c62 Author: Ping-Ke Shih Date: Fri Sep 1 15:39:52 2023 +0800 wifi: rtw89: fw: add checking type for variant type of firmware For WiFi 6 chips, there is only single one firmware i.e. WiFi CPU firmware, so no need an argument to discriminate them. For WiFi 7 chips, BB MCU firmware is introduced, and we need to check it ready after downloading. For each type of firmware, we need to check corresponding hardware ready bit. After downloading all firmware, check status code to determine if all things are ready. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230901073956.54203-5-pkshih@realtek.com commit 68261ddbb2bc1ec9439582ac0b2b98b4e9d2e6a4 Author: Ping-Ke Shih Date: Fri Sep 1 15:39:51 2023 +0800 wifi: rtw89: fw: implement supported functions of download firmware for WiFi 7 chips To work with generalized flow of download firmware, implement WiFi 7 specific functions to support it. These functions include disable/enable WiFi CPU, status of path ready, and status of firmware. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230901073956.54203-4-pkshih@realtek.com commit ae4dc23d139c7307a0bdd72321913da4eb5f4a85 Author: Ping-Ke Shih Date: Fri Sep 1 15:39:50 2023 +0800 wifi: rtw89: fw: generalize download firmware flow by mac_gen pointers In order to reuse the flow to download firmware, define some mac_gen::ops to implement them for WiFi 6 and 7 chips individually. This doesn't change logic at all. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230901073956.54203-3-pkshih@realtek.com commit 80e706a85cb5e1e2121e9bf09dd4098415d85142 Author: Ping-Ke Shih Date: Fri Sep 1 15:39:49 2023 +0800 wifi: rtw89: fw: move polling function of firmware path ready to an individual function To download firmware, we need to check path is ready. There are two kinds of path -- one is to download firmware header, and the other is to download firmware body. Since the polling method is different from WiFi 7 chips, make it to be an individual function, and then we can reuse the download flow. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230901073956.54203-2-pkshih@realtek.com commit 6fa25e768df48ccf6d57251eb31d2e496cb374b5 Author: Zong-Zhe Yang Date: Thu Aug 31 13:31:33 2023 +0800 wifi: rtw89: mcc: trigger FW to start/stop MCC According to Wi-Fi/BT roles' settings, we fill corresponding H2Cs (host to chip packets). Then, following MCC (multi-channel concurrency) pattern, we send these H2Cs as planned. Eventually, the trigger H2Cs will be sent to tell FW to really start/stop MCC. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230831053133.24015-7-pkshih@realtek.com commit 980d4215f94e9b428d3001c5d31efffed5420820 Author: Zong-Zhe Yang Date: Thu Aug 31 13:31:32 2023 +0800 wifi: rtw89: fix typo of rtw89_fw_h2c_mcc_macid_bitmap() Fix a typo where `bitamp` should be `bitmap`. Don't change functionality at all. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230831053133.24015-6-pkshih@realtek.com commit 17aa2c3326892c31d9d6bf618b17ce87fac8f60c Author: Zong-Zhe Yang Date: Thu Aug 31 13:31:31 2023 +0800 wifi: rtw89: mcc: decide pattern and calculate parameters After the previous works, we can now expand and display the MCC pattern in more detail, as shown below. |< MCC interval >| |< duration ref >| (if mid bt) |< duration aux >| (if tail bt) | ||< toa ref>| ... ||< toa aux>| ... | V V tbtt ref tbtt aux |< beacon offset >| (where tob means `time offset behind` and toa means `time offset ahead`) There are two key points. 1. decide position of BT slot if MCC pattern needs to handle BT duration. 2. calculate all parameters related to tob and toa in MCC pattern. For point (1), when BT duration needs to be handled, BT position will rely on beacon offset, either middle or tail. For point (2), to ensure durations of the Wi-Fi roles cover their beacons, we have to calculate tob and toa for them according to their TBTT. And, there are two strategies to calculate parameters, strict and loose. In strict pattern, all parameters take HW time into account as limitation. But, the strict calculation are not always successful. In loose pattern, it only tries to give positive parameters to reference role and doesn't care much about auxiliary role. If unfortunately auxiliary role gets negative parameters in loose pattern, FW will be notified and then deal with it. So, the loose calculation won't fail. In general, we always try strict pattern cases before using a loose pattern. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230831053133.24015-5-pkshih@realtek.com commit 7d1704640aadc70ef4676abe101d3f99ecc098a2 Author: Zong-Zhe Yang Date: Thu Aug 31 13:31:30 2023 +0800 wifi: rtw89: mcc: consider and determine BT duration Before calculating MCC pattern, we have to determine whether to handle BT duration in it or not. The decision will depend on the channels that Wi-Fi roles use. And, we have three cases shown below. 1. non-2GHz + non-2GHz 2. non-2GHz + 2GHz (different band) 3. 2GHz + 2GHz (dual 2GHz) For case (1), we don't care BT duration in MCC pattern. For case (2), we still don't care BT duration in MCC pattern. Instead, we try to satisfy it by modifying duration of Wi-Fi role on non-2GHz channel. For case (3), we need to modify Wi-Fi durations and also need to handle BT duration in MCC pattern. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230831053133.24015-4-pkshih@realtek.com commit 4dc25ef1916339f92456058f22836b0aa20f40da Author: Zong-Zhe Yang Date: Thu Aug 31 13:31:29 2023 +0800 wifi: rtw89: mcc: fill fundamental configurations We determine the fundamental settings shown below. |< MCC interval >| |< duration ref >|< duration aux >| | | | | |< beacon offset >| | | V V (tbtt ref) (tbtt aux) (where `ref` (reference) and `aux` (auxiliary) mean the two MCC roles) Based on MCC mode (GO+STA or GC+STA), we fill configurations of MCC interval and beacon offset. And, we make sure each MCC role have a basically required duration in the MCC interval. The beacon offset mentioned above is a parameter for further MCC pattern calculation. If MCC is in GC+STA mode, we will calculate the real beacon offset through TSFs shown in beacons of both MCC roles. Otherwise, we will use a default beacon offset, and make GO sync STA's TSF timer with this offset. MCC pattern calculation will break down each MCC role's duration in more detail. We will implement it in the following. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230831053133.24015-3-pkshih@realtek.com commit b09df09b55fb79736122b90bd78546a119fb3d7d Author: Zong-Zhe Yang Date: Thu Aug 31 13:31:28 2023 +0800 wifi: rtw89: mcc: initialize start flow We prepare to support TDMA-based MCC (multi-channel concurrency) which allows two kinds of modes below. * P2P GO + normal STA * P2P GC + normal STA Each mode has two vif and two chanctx. Then, each vif binds one separate chanctx and becomes one MCC role. We name the two MCC roles as follows. * MCC role - reference (ref) We calculate the baseline of our TDMA things accodring to its info, e.g. TBTT. In normal case, it will be put at the first slot of TDMA. * MCC role - auxiliary (aux) MCC state machine will be running in FW eventually, but before that, we have to fill and calculate things that are needed by FW. We fill the information of MCC role according to its vif and its chanctx. Then, we calculate the start time for MCC. Note that the parameters used in the calculation now is assigned by default rules. The precise parameters for better MCC behavior will be derived in the following. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230831053133.24015-2-pkshih@realtek.com commit 3dae5c43badf285e22f6d88388e8a232a83bdfec Author: Nick Desaulniers Date: Mon Aug 28 11:53:57 2023 -0700 x86/asm/bitops: Use __builtin_clz{l|ll} to evaluate constant expressions Micro-optimize the bitops code some more, similar to commits: fdb6649ab7c1 ("x86/asm/bitops: Use __builtin_ctzl() to evaluate constant expressions") 2fcff790dcb4 ("powerpc: Use builtin functions for fls()/__fls()/fls64()") From a recent discussion, I noticed that x86 is lacking an optimization that appears in arch/powerpc/include/asm/bitops.h related to constant folding. If you add a BUILD_BUG_ON(__builtin_constant_p(param)) to these functions, you'll find that there were cases where the use of inline asm pessimized the compiler's ability to perform constant folding resulting in runtime calculation of a value that could have been computed at compile time. Signed-off-by: Nick Desaulniers Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20230828-x86_fls-v1-1-e6a31b9f79c3@google.com commit 305dd76455038f3b2338bd0560387cf829c7567c Author: Dmitry Torokhov Date: Fri Jul 28 17:51:31 2023 -0700 Input: wdt87xx_i2c - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-22-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 97f2bedb620c17c41fee2a7758dddbfcbaa0812b Author: Dmitry Torokhov Date: Fri Jul 28 17:51:30 2023 -0700 Input: tsc2004/5 - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with sysfs_create_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-21-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 6cc3ecfded342cb56a8ebf5de3541b2d9cc41017 Author: Dmitry Torokhov Date: Fri Jul 28 17:51:29 2023 -0700 Input: stmfts - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Andi Shyti Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-20-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 2ad952810861faac2cda65189c7e96c802c7a8f2 Author: Dmitry Torokhov Date: Fri Jul 28 17:51:28 2023 -0700 Input: s6sy761 - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Andi Shyti Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-19-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 3837a4b9384c7e890cd87c39be53486b99ecc8a3 Author: Dmitry Torokhov Date: Fri Jul 28 17:51:27 2023 -0700 Input: rohm_bu21023 - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-18-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 4f17340909098545845fb5aad4a5bc6010f6362d Author: Dmitry Torokhov Date: Fri Jul 28 17:51:26 2023 -0700 Input: raydium_i2c_ts - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-17-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 33478a9257b2b78dc8f3882049689e0a07909593 Author: Dmitry Torokhov Date: Fri Jul 28 17:51:25 2023 -0700 Input: melfas-mip4 - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-16-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 2883d4e30bd7417eae570223a6db180af30e8fa7 Author: Dmitry Torokhov Date: Fri Jul 28 17:51:24 2023 -0700 Input: iqs5xx - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Jeff LaBundy Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-15-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit e6ed1bf97ebc29542789fc5813c0fdda420bdd2c Author: Dmitry Torokhov Date: Fri Jul 28 17:51:23 2023 -0700 Input: ilitek_ts_i2c - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-14-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 6a539138be69ae814e332556663f639d4ac31880 Author: Dmitry Torokhov Date: Fri Jul 28 17:51:22 2023 -0700 Input: ili210x - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-13-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit d9d538cac29a8e60a8461003b449b52201b4131c Author: Dmitry Torokhov Date: Fri Jul 28 17:51:21 2023 -0700 Input: hycon-hy46xx - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-12-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 12f2288b0b635476f022597a8474a4aca8d9c0d6 Author: Dmitry Torokhov Date: Fri Jul 28 17:51:20 2023 -0700 Input: hideep - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-11-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 354f1a2c170fbe5c9a6741c2c6a9ee0098c76b16 Author: Dmitry Torokhov Date: Fri Jul 28 17:51:19 2023 -0700 Input: exc3000 - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-10-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit c9110729a0e36cc355173e6cd1f5a12228c38b36 Author: Dmitry Torokhov Date: Fri Jul 28 17:51:18 2023 -0700 Input: elants_i2c - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-9-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit a1bdf4584565892046db6b3bf75de529d91d58ca Author: Dmitry Torokhov Date: Fri Jul 28 17:51:17 2023 -0700 Input: edt-ft5x06 - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-8-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit e9f6aa10aaa898c88d532c31277436100445f328 Author: Dmitry Torokhov Date: Fri Jul 28 17:51:16 2023 -0700 Input: ads7846 - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-7-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit a32fa4359a7b7766631549db427a183c5c6d032e Author: Dmitry Torokhov Date: Fri Jul 28 17:51:15 2023 -0700 Input: ad7879 - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Acked-by: Michael Hennerich Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-6-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit e86253d98547a2229693dc516943439513949003 Author: Dmitry Torokhov Date: Fri Jul 28 17:51:14 2023 -0700 Input: ad7877 - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Acked-by: Michael Hennerich Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-5-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit b4f2ad7b232a0df8f73cbde5966e4d4e5d82fc52 Author: Dmitry Torokhov Date: Fri Jul 28 17:51:13 2023 -0700 Input: kxtj9 - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-4-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 09adb31f6f6cf73d9be7a695ff030144fb64c91d Author: Dmitry Torokhov Date: Fri Jul 28 17:51:12 2023 -0700 Input: iqs269a - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Mattijs Korpershoek Reviewed-by: Jeff LaBundy Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-3-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 4cd121c19a30bd3f5f84612313e94828edf6a91b Author: Dmitry Torokhov Date: Fri Jul 28 17:51:11 2023 -0700 Input: cyapa - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-2-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 99faa48a5de31b360de22a7134291a110171d3f0 Author: Dmitry Torokhov Date: Fri Jul 28 17:51:10 2023 -0700 Input: cros_ec_keyb - use device core to create driver-specific device attributes Instead of creating driver-specific device attributes with devm_device_add_group() have device core do this by setting up dev_groups pointer in the driver structure. Reviewed-by: Guenter Roeck Reviewed-by: Greg Kroah-Hartman Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20230729005133.1095051-1-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov commit 88ca2f8a962eb02fca31ead32c3cf3f308d6cd1a Author: Yang Li Date: Fri Sep 1 09:29:24 2023 +0800 drm/amd/display: clean up one inconsistent indenting drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn35/dcn35_fpu.c:260 dcn35_update_bw_bounding_box_fpu() warn: inconsistent indenting Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 7e6ec099746aa5769f695c5872147fd363378a03 Author: Candice Li Date: Thu May 11 09:19:58 2023 +0800 drm/amdgpu: Add umc v12_0 ras functions Add umc v12_0 ras error querying. Signed-off-by: Candice Li Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6b7d211740da2c3a7656be8cbb36f32e6d9c6cbd Author: Lijo Lazar Date: Wed Sep 6 09:21:39 2023 +0530 drm/amdgpu: Fix refclk reporting for SMU v13.0.6 SMU v13.0.6 SOCs have 100MHz reference clock. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c2c23a10f18016baab5c8762f9bce5bf80cc6b8f Author: Hawking Zhang Date: Wed Sep 6 17:56:20 2023 +0800 drm/amdgpu: Correct se_num and reg_inst for gfx v9_4_3 ras counters gfx_v9_4_3_ue|ce_reg_list is an array per gfx core instance correct the settings of se_num and reg_inst for some of gfx ras counters so all the available register instances can be polled for ras status. Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 1b8e56b994592fe8909fdf9d81674a9bf5947217 Author: Lijo Lazar Date: Mon Sep 4 18:15:13 2023 +0530 drm/amdgpu: Restrict bootloader wait to SMUv13.0.6 Restrict the wait for boot loader steady state only to SMUv13.0.6. For older SOCs, ASIC init has a longer wait period and that takes care. Signed-off-by: Lijo Lazar Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit b93fb0fe24990f29a2da01abfcc0fd27cad7ff5b Author: Lijo Lazar Date: Fri Aug 25 14:36:58 2023 +0530 drm/amdgpu: Add only valid firmware version nodes Show only firmware version attributes that have valid version. Hide others. Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang Signed-off-by: Alex Deucher commit d519072d26949f9a00a679e112b0297306960696 Author: Lang Yu Date: Mon Sep 4 11:59:59 2023 +0800 drm/amdgpu: fix incompatible types in conditional expression Use proper type. Fixes: 9d4346bdbc64 ("drm/amdgpu: add VPE 6.1.0 support") Signed-off-by: Lang Yu Reviewed-by: Solomon Chiu Reviewed-by: Alex Deucher Reported-by: kernel test robot Link: https://lore.kernel.org/oe-kbuild-all/202309020608.FwP8QMht-lkp@intel.com Signed-off-by: Alex Deucher commit eb3b214c37edd323b496b256bb492592aa51c6f2 Author: Srinivasan Shanmugam Date: Sun Sep 3 12:22:25 2023 +0530 drm/amdgpu: Use min_t to replace min Use min_t to replace min, min_t is a bit fast because min use twice typeof. And using min_t is cleaner here since the min/max macros do a typecheck while min_t()/max_t() to an explicit type cast. Fixes the below checkpatch warning: WARNING: min() should probably be min_t() Cc: Christian König Cc: Alex Deucher Cc: "Pan, Xinhui" Signed-off-by: Srinivasan Shanmugam Acked-by: Christian König Signed-off-by: Alex Deucher commit 806c6b3d6f8302a569d6b358f28e6e800c1f988b Author: Candice Li Date: Thu May 11 01:13:27 2023 +0800 drm/amd: Add umc v12_0_0 ip headers Add umc v12_0_0 ip headers. Signed-off-by: Candice Li Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d57e24aa565aff9e8b85d86b34b78df76b2dee17 Author: Candice Li Date: Mon Sep 4 17:03:34 2023 +0800 drm/amdgpu: Update amdgpu_device_indirect_r/wreg_ext Only calculate pcie_index_hi for register address greater than 32bits. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit a76b2870bd310781263f622ded4d0ca08f017965 Author: Candice Li Date: Wed May 17 10:48:23 2023 +0800 drm/amdgpu: Add RREG64_PCIE_EXT/WREG64_PCIE_EXT functions Add 64bits register access support on register whose address is greater than 32bits. Signed-off-by: Candice Li Reviewed-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9b70a1d4141369486561166aa864b8911ddec2dc Author: Srinivasan Shanmugam Date: Sun Sep 3 11:35:48 2023 +0530 drm/amdgpu: Declare array with strings as pointers constant This warning is for the declaration of a static array, and it is recommended to declare it as type "static const char * const" instead of "static const char *". an array pointer declared as type "static const char *" can point to a different character constant because the pointer is mutable. However, if it is declared as type "static const char * const", the pointer will point to an immutable character constant, preventing it from being modified which can better ensure the safety and stability of the program. Fixes the below: WARNING: static const char * array should probably be static const char * const Cc: Christian König Cc: Alex Deucher Cc: "Pan, Xinhui" Signed-off-by: Srinivasan Shanmugam Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 14bf1c475f7fa1d6627746e7940d65d5456ab2b7 Author: Darren Powell Date: Tue Apr 4 00:14:27 2023 -0400 amdgpu/pm: Optimize emit_clock_levels for aldebaran - part 3 split switch statement into two and consolidate the common code for printing most of the types of clock speeds Signed-off-by: Darren Powell Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit d62846f778f5dc4c521c4b1532ecf3f2d7fd78d9 Author: Darren Powell Date: Mon Apr 3 23:37:50 2023 -0400 amdgpu/pm: Optimize emit_clock_levels for aldebaran - part 2 Use variables to remove ternary expression in print statement and improve readability. This will help to optimize the code duplication in the switch statement Also Changed: replaced single_dpm_table->count as iterator in for loops with safer clocks_num_levels value replaced dpm_table.value usage with local var clocks_mhz Signed-off-by: Darren Powell Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 2ecf214b45a5969f6bf9c69b97d1bb9a721e0093 Author: Darren Powell Date: Mon Apr 3 14:06:47 2023 -0400 amdgpu/pm: Optimize emit_clock_levels for aldebaran - part 1 Use variables to remove the multiple nested ternary expressions and improve readability. This will help to optimize the code duplication in the switch statement Also Changed: Modify function aldebaran_get_clk_table to void function as it always returns 0 Use const string "attempt_string" to cut down on repetition Signed-off-by: Darren Powell Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit bc22d9e0ee26c450f8dde69c0720f8da19e14db3 Author: Darren Powell Date: Fri Apr 8 23:59:36 2022 -0400 amdgpu/pm: Replace print_clock_levels with emit_clock_levels for aldebaran Replace print_clock_levels with emit_clock_levels for aldebaran * replace .print_clk_levels with .emit_clk_levels in aldebaran_ppt_funcs * added extra parameter int *offset * removed var size, uses arg *offset instead * removed call to smu_cmn_get_sysfs_buf * errors are returned to caller * returns 0 on success additional incidental changes * changed type of vars i, now to remove comparing mismatch types * renamed var s/now/cur_value/ * switch statement default now returns -EINVAL * RAS Recovery returns -EBUSY Based on commit b06b48d7ddae ("amdgpu/pm: Implement emit_clk_levels for navi10") Signed-off-by: Darren Powell Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 869df1432fd5a41d66132de1d76ff248fddca111 Author: Yang Li Date: Fri Sep 1 09:29:23 2023 +0800 drm/amd/display: clean up some inconsistent indentings drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c:288 dcn35_update_clocks() warn: inconsistent indenting Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 9f720e4999446f66cc8624915f593dd2d334ea99 Author: Yang Li Date: Fri Sep 1 09:29:22 2023 +0800 drm/amd/display: clean up some inconsistent indentings drivers/gpu/drm/amd/amdgpu/../display/dc/dcn35/dcn35_hwseq.c:159 dcn35_init_hw() warn: inconsistent indentig Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 77dcb33ccb2c6a17eee3adadc5100f7bb25795f0 Author: Yang Li Date: Fri Sep 1 09:29:21 2023 +0800 drm/amd/display: clean up one inconsistent indenting drivers/gpu/drm/amd/amdgpu/../display/dc/dcn35/dcn35_resource.c:1877 dcn35_resource_construct() warn: inconsistent indenting Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 1bb5ed6ffcff2d7e20503d78d1ab120b8bae094f Author: Yang Li Date: Fri Sep 1 09:29:20 2023 +0800 drm/amd/display: clean up one inconsistent indenting drivers/gpu/drm/amd/amdgpu/../display/dmub/src/dmub_srv.c:355 dmub_srv_hw_setup() warn: inconsistent indenting Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 4500cdf072452b5f8432134cc26c2c781bf27459 Author: Yang Li Date: Fri Sep 1 08:52:26 2023 +0800 drm/amd/display: Remove duplicated include in dcn35_clk_mgr.c ./drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c: dcn35_clk_mgr.h is included more than once. Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 084f658ece139645d203fa09c77c7f96cb849bb7 Author: Hamza Mahfooz Date: Tue Sep 5 13:27:22 2023 -0400 drm/amd/display: prevent potential division by zero errors There are two places in apply_below_the_range() where it's possible for a divide by zero error to occur. So, to fix this make sure the divisor is non-zero before attempting the computation in both cases. Cc: stable@vger.kernel.org Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2637 Fixes: a463b263032f ("drm/amd/display: Fix frames_to_insert math") Fixes: ded6119e825a ("drm/amd/display: Reinstate LFC optimization") Reviewed-by: Aurabindo Pillai Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 3b96ec9633ba13f8fad2c8de15fda8d993ecc13e Author: Yang Li Date: Fri Sep 1 08:52:25 2023 +0800 drm/amd/display: Remove duplicated include in dcn35_hwseq.c ./drivers/gpu/drm/amd/display/dc/dcn35/dcn35_hwseq.c: clk_mgr.h is included more than once. Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit bde5f439b8f5cab79e771e4118cf81fc831ac947 Author: Yang Li Date: Fri Sep 1 08:52:24 2023 +0800 drm/amd/display: Remove duplicated include in dcn35_optc.c ./drivers/gpu/drm/amd/display/dc/dcn35/dcn35_optc.c: dcn35_optc.h is included more than once. Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 209d15ffd0567b90f0761907ca52c4238d46183f Author: Yang Li Date: Fri Sep 1 08:52:23 2023 +0800 drm/amd/display: Remove duplicated include in dcn35_resource.c ./drivers/gpu/drm/amd/display/dc/dcn35/dcn35_resource.c: dcn31/dcn31_dio_link_encoder.h is included more than once. Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit df04434cb59db6e718474af5bc2eb408754a1b72 Author: Jiapeng Chong Date: Fri Sep 1 15:02:40 2023 +0800 drm/amdgpu: clean up some inconsistent indenting No functional modification involved. drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c:34 nbio_v7_11_get_rev_id() warn: inconsistent indenting. v2: drop leftover printk (Alex) Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6316 Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit fabd2165d11649ecca5012d786a62ac149e9d83f Author: Melissa Wen Date: Thu Aug 31 15:12:28 2023 -0100 drm/amd/display: enable cursor degamma for DCN3+ DRM legacy gamma For DRM legacy gamma, AMD display manager applies implicit sRGB degamma using a pre-defined sRGB transfer function. It works fine for DCN2 family where degamma ROM and custom curves go to the same color block. But, on DCN3+, degamma is split into two blocks: degamma ROM for pre-defined TFs and `gamma correction` for user/custom curves and degamma ROM settings doesn't apply to cursor plane. To get DRM legacy gamma working as expected, enable cursor degamma ROM for implict sRGB degamma on HW with this configuration. Cc: stable@vger.kernel.org Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2803 Fixes: 96b020e2163f ("drm/amd/display: check attr flag before set cursor degamma on DCN3+") Signed-off-by: Melissa Wen Signed-off-by: Alex Deucher commit 0bdf09cc5ee4d9de4808e23fe1359952b721818f Author: Yifan Zhang Date: Fri Aug 25 11:14:34 2023 +0800 drm/amdgpu: calling address translation functions to simplify codes Use amdgpu_gmc_vram_pa to simplify codes. Signed-off-by: Yifan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 2e3b2cb9b8e00e1ed5e51b93946d78b21f48e3ea Author: Yifan Zhang Date: Thu Aug 31 11:17:35 2023 +0800 drm/amd/pm: only poweron/off vcn/jpeg when they are valid. If vcn is disabled in kernel parameters, don't touch vcn, otherwise it may cause vcn hang. v2: delete unnecessary logs v3: move "is_vcn_enabled" check to smu_dpm_setvcn/jpeg_enable (Evan) Signed-off-by: Yifan Zhang Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 813ba1ff8484e801d2ef155e0e5388b8a7691788 Author: Hamza Mahfooz Date: Thu Aug 31 15:22:35 2023 -0400 drm/amd/display: limit the v_startup workaround to ASICs older than DCN3.1 Since, calling dcn20_adjust_freesync_v_startup() on DCN3.1+ ASICs can cause the display to flicker and underflow to occur, we shouldn't call it for them. So, ensure that the DCN version is less than DCN_VERSION_3_1 before calling dcn20_adjust_freesync_v_startup(). Cc: stable@vger.kernel.org Reviewed-by: Fangzhi Zuo Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 19d5f80128d7a197fcb465f21465c30ee4c36f25 Author: Dembskiy Igor Date: Wed Aug 30 17:01:03 2023 +0300 drm/amd/display: remove useless check in should_enable_fbc() It does not make sense to compare a pointer to array element with NULL. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 65d38262b3e8 ("drm/amd/display: fbc state could not reach while enable fbc") Reviewed-by: Harry Wentland Signed-off-by: Dembskiy Igor Signed-off-by: Alex Deucher commit 63461ea3fb403be0d040be3c88e621b55672e26a Author: Hamza Mahfooz Date: Thu Aug 31 15:17:14 2023 -0400 Revert "drm/amd/display: Remove v_startup workaround for dcn3+" This reverts commit 3a31e8b89b7240d9a17ace8a1ed050bdcb560f9e. We still need to call dcn20_adjust_freesync_v_startup() for older DCN3+ ASICs. Otherwise, it can cause DP to HDMI 2.1 PCONs to fail to light up. Cc: stable@vger.kernel.org Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2809 Reviewed-by: Fangzhi Zuo Reviewed-by: Harry Wentland Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit e028d7a4235dce07ef41b1425cda3356075614e7 Author: Gustavo Sousa Date: Wed Aug 30 09:15:24 2023 -0300 drm/i915/cx0: Check and increase msgbus timeout threshold We have experienced timeout issues when going through the sequence to access C20 SRAM registers. Experimentation showed that bumping the message bus timer threshold helped on getting display Type-C connection on the C20 PHY to work. While the timeout is still under investigation with the HW team, having logic to allow forward progress (with the proper warnings) seems useful. Thus, let's bump the threshold when a timeout is detected. The bumped value of 0x200 pclk cycles was somewhat arbitrary - 2x the default value. That value was successfully tested on real hardware that was displaying timeouts otherwise. v2: - Reword commit message to indicate that access to C20 SRAM registers is not direct. (Radhakrishna) - Prefer not to use REG_FIELD_PREP() in intel_cx0_phy.c. (Radhakrishna) - Simplify intel_cx0_bus_check_and_bump_timer() to use a fixed bumped value instead of progressively increasing the threshold. (Mika) BSpec: 65156 Cc: Radhakrishna Sripada Cc: Mika Kahola Signed-off-by: Gustavo Sousa Reviewed-by: Mika Kahola Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230830121524.15101-1-gustavo.sousa@intel.com commit 183670347b060521920a81f84ff7f10e227ebe05 Author: Jim Cromie Date: Sun Sep 3 12:46:00 2023 -0600 drm/i915: add trailing newlines to msgs By at least strong convention, a print-buffer's trailing newline says "message complete, send it". The exception (no TNL, followed by a call to pr_cont) proves the general rule. Most DRM.debug calls already comport with this: 207 DRM_DEV_DEBUG, 1288 drm_dbg. Clean up the remainders, in maintainer sized chunks. No functional changes. Signed-off-by: Jim Cromie Reviewed-by: Andi Shyti Signed-off-by: Rodrigo Vivi [Rodrigo changed subject while pushing] Link: https://patchwork.freedesktop.org/patch/msgid/20230903184607.272198-4-jim.cromie@gmail.com commit 481fc9e7e11d8ace7e7ae4df1b7ebb5aa4e97789 Author: Biju Das Date: Thu Aug 31 09:09:37 2023 +0100 drm/bridge: Drop CONFIG_OF conditionals around of_node pointers Having conditional around the of_node pointers turns out to make driver code use ugly #ifdef and #if blocks. So drop the conditionals. Suggested-by: Douglas Anderson Signed-off-by: Biju Das Reviewed-by: Douglas Anderson Reviewed-by: Laurent Pinchart Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230831080938.47454-4-biju.das.jz@bp.renesas.com commit d8dfccde2709de4327c3d62b50e5dc012f08836f Author: Biju Das Date: Thu Aug 31 09:09:36 2023 +0100 drm/bridge: Drop conditionals around of_node pointers This patch is based on commit c9e358dfc4a8 ("driver-core: remove conditionals around devicetree pointers"). Having conditional around the of_node pointer of the drm_bridge structure turns out to make driver code use ugly #ifdef blocks. Drop the conditionals to simplify drivers. While this slightly increases the size of struct drm_bridge on non-OF system, the number of bridges used today and foreseen tomorrow on those systems is very low, so this shouldn't be an issue. So drop #if conditionals by adding struct device_node forward declaration. Suggested-by: Douglas Anderson Signed-off-by: Biju Das Reviewed-by: Douglas Anderson Reviewed-by: Laurent Pinchart Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230831080938.47454-3-biju.das.jz@bp.renesas.com commit 39e0b96d61b6f5ad880d9953dc2b4c5b3ee145b3 Author: Biju Das Date: Thu Aug 31 09:09:35 2023 +0100 drm/bridge/analogix/anx78xx: Drop ID table The driver has an ID table, but it uses the wrong API for retrieving match data and that will lead to a crash, if it is instantiated by user space or using ID. From this, there is no user for the ID table and let's drop it from the driver as it saves some memory. Signed-off-by: Biju Das Reviewed-by: Douglas Anderson Reviewed-by: Laurent Pinchart Reviewed-by: Andy Shevchenko Reviewed-by: Helen Koike Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20230831080938.47454-2-biju.das.jz@bp.renesas.com commit 6bd3d8da51ca1ec97c724016466606aec7739b9f Author: Jessica Zhang Date: Thu Aug 31 15:57:36 2023 -0700 MAINTAINERS: Add Jessica as a reviewer for drm/panel As I participate more actively in the drm/panel subsystem, I would like to get notified about new changes in this area. Since I have contributed and continue to contribute to drm/panel, add myself as a reviewer for the DRM panel drivers to help the review process Signed-off-by: Jessica Zhang Acked-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230831225738.26527-1-quic_jesszhan@quicinc.com commit a3f84a67c79146ef2d86743529f8d9670519a170 Author: Jouni Högander Date: Mon Aug 28 11:31:07 2023 +0300 drm/i915/psr: Add psr sink error status into sink status debugfs Normally PSR errors detected by the panel are triggering HPD interrupt and seen as error in dmesg. Some panels are not triggering the interrupt even it is requested and they are detecting error. Due to this it would be good to have possibility to check panel detected errors. Add PSR error status into PSR sink status debugfs interface. Signed-off-by: Jouni Högander Reviewed-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230828083107.1520501-1-jouni.hogander@intel.com commit 182ccc43aa80b468ac210cb03176f1726f2be993 Author: Luca Coelho Date: Fri Aug 25 11:16:38 2023 +0300 drm/i915/tc: remove "fia" from intel_tc_port_fia_max_lane_count() It is irrelevant for the caller that the max lane count is being derived from a FIA register, so having "fia" in the function name is irrelevant. Rename the function accordingly. Reviewed-by: Lucas De Marchi Reviewed-by: Suraj Kandpal Signed-off-by: Luca Coelho Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230825081638.275795-5-luciano.coelho@intel.com commit 6a96c1c63ecdde633675e7cd41a317ba28dd371e Author: Luca Coelho Date: Fri Aug 25 11:16:37 2023 +0300 drm/i915/tc: move legacy code out of the main _max_lane_count() func This makes the code a bit more symmetric and readable, especially when we start adding more display version-specific alternatives. Reviewed-by: Suraj Kandpal Signed-off-by: Luca Coelho Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230825081638.275795-4-luciano.coelho@intel.com commit afaa4ff0bc7820ba98be93efce806a27c3472d9b Author: Luca Coelho Date: Fri Aug 25 11:16:36 2023 +0300 drm/i915/tc: make intel_tc_port_get_lane_mask() static This function is only used locally, so make it static and remove the definition from the header file. Reviewed-by: Suraj Kandpal Signed-off-by: Luca Coelho Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230825081638.275795-3-luciano.coelho@intel.com commit 98090e0bf51addd6d3ddedb6c3685b47a7ca0724 Author: Luca Coelho Date: Fri Aug 25 11:16:35 2023 +0300 drm/i915/tc: rename mtl_tc_port_get_pin_assignment_mask() This function doesn't really return the pin assignment mask, but the max lane count derived from that. So rename the function to mtl_tc_port_get_max_lane_count() to better reflect what it really does. Reviewed-by: Lucas De Marchi Reviewed-by: Suraj Kandpal Signed-off-by: Luca Coelho Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20230825081638.275795-2-luciano.coelho@intel.com commit 34069d12e239ae8f36dd96c378e4622fb1c42a76 Merge: 54116d442e001 2dde18cd1d8fa Author: Dmitry Torokhov Date: Tue Sep 5 14:08:14 2023 -0700 Merge tag 'v6.5' into next Sync up with mainline to bring in updates to the shared infrastructure. commit f45acf7acf75921c0409d452f0165f51a19a74fd Author: Tomi Valkeinen Date: Fri Aug 4 13:48:13 2023 +0300 drm/bridge: lt8912b: Add missing drm_bridge_attach call The driver does not call drm_bridge_attach(), which causes the next bridge to not be added to the bridge chain. This causes the pipeline init to fail when DRM_BRIDGE_ATTACH_NO_CONNECTOR is used. Add the call to drm_bridge_attach(). Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge") Signed-off-by: Tomi Valkeinen Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230804-lt8912b-v1-4-c542692c6a2f@ideasonboard.com commit 6985c5efc4057bc79137807295d84ada3123d051 Author: Tomi Valkeinen Date: Fri Aug 4 13:48:12 2023 +0300 drm/bridge: lt8912b: Manually disable HPD only if it was enabled lt8912b only calls drm_bridge_hpd_enable() if it creates a connector and the next bridge has DRM_BRIDGE_OP_HPD set. However, when calling drm_bridge_hpd_disable() it misses checking if a connector was created, calling drm_bridge_hpd_disable() even if HPD was never enabled. I don't see any issues caused by this wrong call, though. Add the check to avoid wrongly calling drm_bridge_hpd_disable(). Fixes: 3b0a01a6a522 ("drm/bridge: lt8912b: Add hot plug detection") Signed-off-by: Tomi Valkeinen Tested-by: Marcel Ziswiler Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230804-lt8912b-v1-3-c542692c6a2f@ideasonboard.com commit 44283993144a03af9df31934d6c32bbd42d1a347 Author: Tomi Valkeinen Date: Fri Aug 4 13:48:11 2023 +0300 drm/bridge: lt8912b: Fix crash on bridge detach The lt8912b driver, in its bridge detach function, calls drm_connector_unregister() and drm_connector_cleanup(). drm_connector_unregister() should be called only for connectors explicitly registered with drm_connector_register(), which is not the case in lt8912b. The driver's drm_connector_funcs.destroy hook is set to drm_connector_cleanup(). Thus the driver should not call either drm_connector_unregister() nor drm_connector_cleanup() in its lt8912_bridge_detach(), as they cause a crash on bridge detach: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 Mem abort info: ESR = 0x0000000096000006 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x06: level 2 translation fault Data abort info: ISV = 0, ISS = 0x00000006, ISS2 = 0x00000000 CM = 0, WnR = 0, TnD = 0, TagAccess = 0 GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 user pgtable: 4k pages, 48-bit VAs, pgdp=00000000858f3000 [0000000000000000] pgd=0800000085918003, p4d=0800000085918003, pud=0800000085431003, pmd=0000000000000000 Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP Modules linked in: tidss(-) display_connector lontium_lt8912b tc358768 panel_lvds panel_simple drm_dma_helper drm_kms_helper drm drm_panel_orientation_quirks CPU: 3 PID: 462 Comm: rmmod Tainted: G W 6.5.0-rc2+ #2 Hardware name: Toradex Verdin AM62 on Verdin Development Board (DT) pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : drm_connector_cleanup+0x78/0x2d4 [drm] lr : lt8912_bridge_detach+0x54/0x6c [lontium_lt8912b] sp : ffff800082ed3a90 x29: ffff800082ed3a90 x28: ffff0000040c1940 x27: 0000000000000000 x26: 0000000000000000 x25: dead000000000122 x24: dead000000000122 x23: dead000000000100 x22: ffff000003fb6388 x21: 0000000000000000 x20: 0000000000000000 x19: ffff000003fb6260 x18: fffffffffffe56e8 x17: 0000000000000000 x16: 0010000000000000 x15: 0000000000000038 x14: 0000000000000000 x13: ffff800081914b48 x12: 000000000000040e x11: 000000000000015a x10: ffff80008196ebb8 x9 : ffff800081914b48 x8 : 00000000ffffefff x7 : ffff0000040c1940 x6 : ffff80007aa649d0 x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff80008159e008 x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000 Call trace: drm_connector_cleanup+0x78/0x2d4 [drm] lt8912_bridge_detach+0x54/0x6c [lontium_lt8912b] drm_bridge_detach+0x44/0x84 [drm] drm_encoder_cleanup+0x40/0xb8 [drm] drmm_encoder_alloc_release+0x1c/0x30 [drm] drm_managed_release+0xac/0x148 [drm] drm_dev_put.part.0+0x88/0xb8 [drm] devm_drm_dev_init_release+0x14/0x24 [drm] devm_action_release+0x14/0x20 release_nodes+0x5c/0x90 devres_release_all+0x8c/0xe0 device_unbind_cleanup+0x18/0x68 device_release_driver_internal+0x208/0x23c driver_detach+0x4c/0x94 bus_remove_driver+0x70/0xf4 driver_unregister+0x30/0x60 platform_driver_unregister+0x14/0x20 tidss_platform_driver_exit+0x18/0xb2c [tidss] __arm64_sys_delete_module+0x1a0/0x2b4 invoke_syscall+0x48/0x110 el0_svc_common.constprop.0+0x60/0x10c do_el0_svc_compat+0x1c/0x40 el0_svc_compat+0x40/0xac el0t_32_sync_handler+0xb0/0x138 el0t_32_sync+0x194/0x198 Code: 9104a276 f2fbd5b7 aa0203e1 91008af8 (f85c0420) Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge") Signed-off-by: Tomi Valkeinen Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230804-lt8912b-v1-2-c542692c6a2f@ideasonboard.com commit 941882a0e96d245f38116e940912b404b6a93c6f Author: Tomi Valkeinen Date: Fri Aug 4 13:48:10 2023 +0300 drm/bridge: lt8912b: Fix bridge_detach The driver calls lt8912_bridge_detach() from its lt8912_remove() function. As the DRM core detaches bridges automatically, this leads to calling lt8912_bridge_detach() twice. The code probably has tried to manage the double-call with the 'is_attached' variable, but the driver never sets the variable to false, so its of no help. Fix the issue by dropping the call to lt8912_bridge_detach() from lt8912_remove(), as the DRM core will handle the detach call for us, and also drop the useless is_attached field. Fixes: 30e2ae943c26 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge") Signed-off-by: Tomi Valkeinen Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230804-lt8912b-v1-1-c542692c6a2f@ideasonboard.com commit d0375f6858c4ff7244b62b02eb5e93428e1916cd Author: Jai Luthra Date: Fri Sep 1 15:01:23 2023 +0530 drm: bridge: it66121: Fix invalid connector dereference Fix the NULL pointer dereference when no monitor is connected, and the sound card is opened from userspace. Instead return an empty buffer (of zeroes) as the EDID information to the sound framework if there is no connector attached. Fixes: e0fd83dbe924 ("drm: bridge: it66121: Add audio support") Reported-by: Nishanth Menon Closes: https://lore.kernel.org/all/20230825105849.crhon42qndxqif4i@gondola/ Reviewed-by: Helen Koike Signed-off-by: Jai Luthra Tested-by: Nishanth Menon Reviewed-by: Aradhya Bhatia Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230901-it66121_edid-v2-1-aa59605336b9@ti.com commit 29ff3b7e23af86ccaea2750b4edfbe1fc063ec9c Author: Biju Das Date: Fri Aug 18 20:18:17 2023 +0100 drm: bridge: it66121: Simplify probe() Simplify probe() by replacing of_device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Reviewed-by: Laurent Pinchart Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230818191817.340360-3-biju.das.jz@bp.renesas.com commit c11c1a50573e106aa60eed977d199c424c6469e3 Author: Biju Das Date: Fri Aug 18 20:18:16 2023 +0100 drm: bridge: it66121: Extend match support for OF tables The driver has OF match table, still it uses ID lookup table for retrieving match data. Currently the driver is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using of_device_match_data() if the devices are registered via OF. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko Reviewed-by: Laurent Pinchart Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230818191817.340360-2-biju.das.jz@bp.renesas.com commit 7791487cd16cafd018cba0bf73789111a9f16843 Author: Muna Sinada Date: Sat Aug 26 08:42:46 2023 +0300 wifi: ath11k: fix tid bitmap is 0 in peer rx mu stats Correct parsing of reading offset for rx tid 16 bit bitmap. Incorrect offset caused peer rx mu stats tid bitmap to always be zero. This correction is in the software context and does not affect the firmware interface. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1 Signed-off-by: Muna Sinada Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1692827868-15667-2-git-send-email-quic_msinada@quicinc.com commit 5bd2ced044bb95029d5c44cf7d23ced73e0fc05b Author: Muna Sinada Date: Sat Aug 26 08:42:46 2023 +0300 wifi: ath11k: move references from rsvd2 to info fields Remove references to reserved fields and add new info fields for struct hal_rx_ppdu_end_user_stats. Reserved fields should not be accessed, therefore existing references to it are to be changed to referencing specific info fields. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1 Signed-off-by: Muna Sinada Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1692827868-15667-1-git-send-email-quic_msinada@quicinc.com commit d48f55e773dcce8fcf9e587073452a4944011b11 Author: Harshitha Prem Date: Sat Aug 26 08:42:44 2023 +0300 wifi: ath12k: fix undefined behavior with __fls in dp When max virtual ap interfaces are configured in all the bands with ACS and hostapd restart is done every 60s, a crash is observed at random times because of handling the uninitialized peer fragments with fragment id of packet as 0. "__fls" would have an undefined behavior if the argument is passed as "0". Hence, added changes to handle the same. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: Harshitha Prem Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230821130343.29495-3-quic_hprem@quicinc.com commit bbc86757ca62423c3b6bd8f7176da1ff43450769 Author: Harshitha Prem Date: Sat Aug 26 08:42:43 2023 +0300 wifi: ath12k: Ignore fragments from uninitialized peer in dp When max virtual ap interfaces are configured in all the bands with ACS and hostapd restart is done every 60s, a crash is observed at random times. In the above scenario, a fragmented packet is received for self peer, for which rx_tid and rx_frags are not initialized in datapath. While handling this fragment, crash is observed as the rx_frag list is uninitialized and when we walk in ath12k_dp_rx_h_sort_frags, skb null leads to exception. To address this, before processing received fragments we check dp_setup_done flag is set to ensure that peer has completed its dp peer setup for fragment queue, else ignore processing the fragments. Call trace: PC points to "ath12k_dp_process_rx_err+0x4e8/0xfcc [ath12k]" LR points to "ath12k_dp_process_rx_err+0x480/0xfcc [ath12k]". The Backtrace obtained is as follows: ath12k_dp_process_rx_err+0x4e8/0xfcc [ath12k] ath12k_dp_service_srng+0x78/0x260 [ath12k] ath12k_pci_write32+0x990/0xb0c [ath12k] __napi_poll+0x30/0xa4 net_rx_action+0x118/0x270 __do_softirq+0x10c/0x244 irq_exit+0x64/0xb4 __handle_domain_irq+0x88/0xac gic_handle_irq+0x74/0xbc el1_irq+0xf0/0x1c0 arch_cpu_idle+0x10/0x18 do_idle+0x104/0x248 cpu_startup_entry+0x20/0x64 rest_init+0xd0/0xdc arch_call_rest_init+0xc/0x14 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Harshitha Prem Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230821130343.29495-2-quic_hprem@quicinc.com commit 4a93b554cf9fa64faa7cf164c0d32fc3ce67108b Author: Arowa Suliman Date: Sat Aug 26 08:42:42 2023 +0300 wifi: ath11k: mhi: add a warning message for MHI_CB_EE_RDDM crash Currently, the ath11k driver does not print a crash signature when a MHI_CB_EE_RDDM crash happens. Checked by triggering a simulated crash using the command and checking dmesg for logs: echo assert > /sys/kernel/debug/ath11k/../simulate_fw_crash Add a warning when firmware crash MHI_CB_EE_RDDM happens. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Signed-off-by: Arowa Suliman Reviewed-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230714001126.463127-1-arowa@chromium.org commit c3ba2ada133de52a713f6702afcd1de7443156ae Author: Thomas Zimmermann Date: Mon Aug 28 15:14:24 2023 +0200 staging/fbtft: Use fb_ops helpers for deferred I/O Generate callback functions for struct fb_ops with the fbdev macro FB_GEN_DEFAULT_DEFERRED_SYSMEM_OPS(). Initialize struct fb_ops to the generated functions with an fbdev initializer macro. Signed-off-by: Thomas Zimmermann Acked-by: Greg Kroah-Hartman Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230828132131.29295-9-tzimmermann@suse.de commit b1adff68e384eed58c2fee7f6316aa84274caad4 Author: Thomas Zimmermann Date: Mon Aug 28 15:14:23 2023 +0200 staging/fbtft: Initialize fb_op struct as static const Replace dynamic allocation of the fb_ops instance with static allocation. Initialize the fields at module-load time. The owner field changes to THIS_MODULE, as in all other fbdev drivers. Signed-off-by: Thomas Zimmermann Acked-by: Greg Kroah-Hartman Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230828132131.29295-8-tzimmermann@suse.de commit a564708ec491844574481f880bee48cb6a00a55c Author: Thomas Zimmermann Date: Mon Aug 28 15:14:22 2023 +0200 hid/picolcd: Use fb_ops helpers for deferred I/O Generate callback functions for struct fb_ops with the fbdev macro FB_GEN_DEFAULT_DEFERRED_SYSMEM_OPS(). Initialize struct fb_ops to the generated functions with an fbdev initializer macro. Signed-off-by: Thomas Zimmermann Cc: Jiri Kosina Cc: Benjamin Tissoires Cc: "Bruno Prémont" Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230828132131.29295-7-tzimmermann@suse.de commit 73281e02f4b28faafe57272a719c0761dd8ff75c Author: Thomas Zimmermann Date: Mon Aug 28 15:14:21 2023 +0200 hid: Remove trailing whitespace Fix coding style in Kconfig. No functional changes. Signed-off-by: Thomas Zimmermann Cc: Jiri Kosina Cc: Benjamin Tissoires Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230828132131.29295-6-tzimmermann@suse.de commit 66a749a752351c7cdd0a4fefb2544ab05e7987c3 Author: Thomas Zimmermann Date: Mon Aug 28 15:14:20 2023 +0200 fbdev/hyperv_fb: Use fb_ops helpers for deferred I/O Generate callback functions for struct fb_ops with the fbdev macro FB_GEN_DEFAULT_DEFERRED_IOMEM_OPS(). Initialize struct fb_ops to the generated functions with fbdev initializer macros. The hyperv_fb driver is incomplete in its handling of deferred I/O and damage framebuffers. Write operations do no trigger damage handling. Fixing this is beyond the scope of this patch. Signed-off-by: Thomas Zimmermann Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Wei Liu Cc: Dexuan Cui Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230828132131.29295-5-tzimmermann@suse.de commit ee057f972d321cce2637a708d2f189481e855f58 Author: Thomas Zimmermann Date: Mon Aug 28 15:14:19 2023 +0200 fbdev: Add Kconfig macro FB_IOMEM_HELPERS_DEFERRED The new Kconfig macro FB_IOMEM_HELPERS_DEFERRED selects fbdev's helpers for device I/O memory and deferred I/O. Drivers should use it if they perform damage updates on device I/O memory. Signed-off-by: Thomas Zimmermann Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230828132131.29295-4-tzimmermann@suse.de commit 1e3c721664e3ab580b7ebca75b9bb62487baa0bc Author: Thomas Zimmermann Date: Mon Aug 28 15:14:18 2023 +0200 fbdev/udlfb: Use fb_ops helpers for deferred I/O Generate callback functions for struct fb_ops with the fbdev macro FB_GEN_DEFAULT_DEFERRED_SYSMEM_OPS(). Initialize struct fb_ops to the generated functions with fbdev initializer macros. Signed-off-by: Thomas Zimmermann Cc: Bernie Thompson Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230828132131.29295-3-tzimmermann@suse.de commit 2519fceb9f282c8ff091f0dd5352ed53b3dd4b6c Author: Thomas Zimmermann Date: Mon Aug 28 15:14:17 2023 +0200 fbdev/smscufx: Use fb_ops helpers for deferred I/O Generate callback functions for struct fb_ops with the fbdev macro FB_GEN_DEFAULT_DEFERRED_SYSMEM_OPS(). Initialize struct fb_ops to the generated functions with fbdev initializer macros. Signed-off-by: Thomas Zimmermann Cc: Steve Glendinning Acked-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230828132131.29295-2-tzimmermann@suse.de commit fe21299ca2345ef8dcedf06a62a546016978d96f Author: Suraj Kandpal Date: Mon Aug 28 11:13:01 2023 +0530 drm/i915/display: Compare the readout dsc pps params With the dsc config being readout and filled in crtc_state add macros and use them to compare current and previous PPS param in DSC. --v2 -Remove version check [Jani] -Remove dupe macro for dsc pipe compare and use the existing ones [Jani] Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230828054300.560559-9-suraj.kandpal@intel.com commit 8b70b569170407cd7a145b1801120560247e3ccf Author: Suraj Kandpal Date: Mon Aug 28 11:13:00 2023 +0530 drm/i915/vdsc: Fill the intel_dsc_get_pps_config function We have setup both the read and write functions so we can move ahead and fill in all the readout state from PPS register into the crtc_state so we can send it for comparision. --v2 -Shorten comment to just PPSX rather than having the whole "Readout PPSX register" [Jani] -Remove pps_temp reinitialization as its being initialized in the read function [Jani] -Use REG_FIELD_GET to readout certain fields of dsc registers [Jani] --v9 -Place the masks at a more appropriate place [Ankit] Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230828054300.560559-8-suraj.kandpal@intel.com commit 961e11ab9f82e7eb0bc2536e3b19f64e4a874d9e Author: Suraj Kandpal Date: Mon Aug 28 11:12:59 2023 +0530 drm/i915/vdsc: Remove unused dsc registers Now that we have macros that can fetch dsc register values based on pipe and pps parameters we can go ahead and remove all the unused register. Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230828054300.560559-7-suraj.kandpal@intel.com commit 265bb1cbe3d6907fe8db885a8e6d57ff4c18daa4 Author: Suraj Kandpal Date: Mon Aug 28 11:12:58 2023 +0530 drm/i915/vdsc: Add function to write in PPS register Now that we have a function that reads any PPS register based on intel_dsc_pps enum provided lets create a function that can write on any PPS. --v2 -Changes need as PPS enum was dropped -Remove duplicated code in intel_dsc_write_pps_reg [Jani] --v3 -Use dsc_split instead of num_vdsc_instances [Ankit] --v5 -Changes to implement the new dsc_reg array variable passing [Ankit] --v7 -Pass no of vdsc instances to get_pps_reg [Ankit] --v8 -No need for dsc_reg dynamic allocation [Jani] -Change function to void as no return needs to be sent back --v9 -Send ARRAY_SIZE(dsc_reg) instead of vdsc_per_pipe [Ankit] Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230828054300.560559-6-suraj.kandpal@intel.com commit d3cc1b0be258191d6360c82ea158c2972f8d3991 Author: Eric Biggers Date: Mon Sep 4 17:32:27 2023 -0700 quota: explicitly forbid quota files from being encrypted Since commit d7e7b9af104c ("fscrypt: stop using keyrings subsystem for fscrypt_master_key"), xfstest generic/270 causes a WARNING when run on f2fs with test_dummy_encryption in the mount options: $ kvm-xfstests -c f2fs/encrypt generic/270 [...] WARNING: CPU: 1 PID: 2453 at fs/crypto/keyring.c:240 fscrypt_destroy_keyring+0x1f5/0x260 The cause of the WARNING is that not all encrypted inodes have been evicted before fscrypt_destroy_keyring() is called, which violates an assumption. This happens because the test uses an external quota file, which gets automatically encrypted due to test_dummy_encryption. Encryption of quota files has never really been supported. On ext4, ext4_quota_read() does not decrypt the data, so encrypted quota files are always considered invalid on ext4. On f2fs, f2fs_quota_read() uses the pagecache, so trying to use an encrypted quota file gets farther, resulting in the issue described above being possible. But this was never intended to be possible, and there is no use case for it. Therefore, make the quota support layer explicitly reject using IS_ENCRYPTED inodes when quotaon is attempted. Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers Signed-off-by: Jan Kara Message-Id: <20230905003227.326998-1-ebiggers@kernel.org> commit bd077259d0a9c9bf453e7e9751bf41f1996e6585 Author: Suraj Kandpal Date: Mon Aug 28 11:12:57 2023 +0530 drm/i915/vdsc: Add function to read any PPS register Add function to read any PPS register based on the intel_dsc_pps enum provided. Add a function which will call the new pps read function and place it in crtc state. Only PPS0 and PPS1 are readout the rest of the registers will be read in upcoming patches. --v2 -Changes in read function as PPS enum is removed -Initialize pps_val as 0 in pps_read func itself [Jani] -Create a function that gets the required register and call that in the common read function [Jani] -Move the drm_WARN_ON one abstraction layer above [Jani] --v3 -Send both reg values regardless of dsc engine no [Jani] -Don't use num_vdsc_instances stick to dsc_split field [Ankit] --v4 -Manipulate the reg values instead of creating MACRO to change name of pps [Ankit] --v5 -Read dsc reg values using array rather than individual variables [Ankit] -Loop the verification of all dsc engine reads to future proof it [Ankit] -Keep the fix me comment in this patch and remove it in later one where we add other readouts [Ankit] -Add switch statement that fills in the required registers based on no of vdsc engines per pipe. --v7 -Pass no of vdsc instances from read_reg function [Ankit] -Fix issue where arrays do not get freed on return for read_and_verify func [Ankit] --v8 -Simplify reading and verifying of register and remove dynamically allocated arrays [Jani] -Remove no_ from no_vdsc_per_pipe and wherever else it applies [Ankit] --v9 -change variable name to dsc_reg_size rather than vdsc_per_pipe [Ankit] --v10 -remove switch case as we never enter case1 [Ankit] --v11 -Add _ prefix for register that are not supposed to be used directly [Jani] -Remove REG suffix from register macros [Jani] -Do not duplicate register read [Jani] --v12 -Use vdsc_per_pipe rather than array size of dsc_reg [Jani] Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230828054300.560559-5-suraj.kandpal@intel.com commit d03b64c8a5ca92df66dce036c1e4e221d2618620 Author: Suraj Kandpal Date: Mon Aug 28 11:12:56 2023 +0530 drm/i915/vdsc: Add func to get no. of vdsc instances per pipe We have a function that gets us the total of the vdsc engines being used but not the no. of vdsc instances being used by each pipe. --v6 -Change function to static --v7 -Shorten name to intel_dsc_get_vdsc_per_pipe Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230828054300.560559-4-suraj.kandpal@intel.com commit 611977c3e4048a7cda42a8e87dec1672f15f763b Author: Suraj Kandpal Date: Mon Aug 28 11:12:55 2023 +0530 drm/i915/vdsc: Add a check for dsc split cases In intel_vdsc_get_config we only read the primary dsc engine register and not take into account if the other dsc engine is in use and if both registers have the same value or not this patche fixes that by adding a check. --v3 -Remove superfluos new line [Jani] -Fix register naming [Jani] --v5 -pps_temp0/pps_temp1 can be assigned where they are used [Ankit] Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230828054300.560559-3-suraj.kandpal@intel.com commit 76342fce58a58e3c8326a870adfb6b435ecd9abb Author: Suraj Kandpal Date: Mon Aug 28 11:12:54 2023 +0530 drm/i915/vdsc: Refactor dsc register field macro This patch refactors dsc register related macros that prepares the values to be written in the register. The current bit shifting looks bad and going forward will not serve our purpose to readout dsc register field values the change was suggested by Jani Nikula. Cc: Jani Nikula Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230828054300.560559-2-suraj.kandpal@intel.com commit dae4464939025d38940a6bc6b80734adad0ff944 Author: Kuan-Chung Chen Date: Wed Aug 30 17:28:49 2023 +0800 wifi: rtw89: 8852c: Fix TSSI causes transmit power inaccuracy Modify TSSI ADC FIFO Clock follow RX ADC Clock can avoid transmit power inaccuracy. Signed-off-by: Kuan-Chung Chen Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230830092849.153251-3-pkshih@realtek.com commit 8f969ba1de4282fcc760c844943dd449cdf97527 Author: Kuan-Chung Chen Date: Wed Aug 30 17:28:48 2023 +0800 wifi: rtw89: 8852c: Update bandedge parameters for better performance TSSI configures bandedge to TX proper waveform, these new bandedge parameters improve the accuracy of transmit power compensation. This helps to avoid throughput degradation. Signed-off-by: Kuan-Chung Chen Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230830092849.153251-2-pkshih@realtek.com commit a763e92c78615ea838f5b9a841398b1d4adb968e Author: Dmitry Antipov Date: Tue Aug 29 12:45:31 2023 +0300 wifi: plfxlc: fix clang-specific fortify warning When compiling with clang 16.0.6 and CONFIG_FORTIFY_SOURCE=y, I've noticed the following (somewhat confusing due to absence of an actual source code location): In file included from drivers/net/wireless/purelifi/plfxlc/mac.c:6: In file included from ./include/linux/netdevice.h:24: In file included from ./include/linux/timer.h:6: In file included from ./include/linux/ktime.h:24: In file included from ./include/linux/time.h:60: In file included from ./include/linux/time32.h:13: In file included from ./include/linux/timex.h:67: In file included from ./arch/x86/include/asm/timex.h:5: In file included from ./arch/x86/include/asm/processor.h:23: In file included from ./arch/x86/include/asm/msr.h:11: In file included from ./arch/x86/include/asm/cpumask.h:5: In file included from ./include/linux/cpumask.h:12: In file included from ./include/linux/bitmap.h:11: In file included from ./include/linux/string.h:254: ./include/linux/fortify-string.h:592:4: warning: call to '__read_overflow2_field' declared with 'warning' attribute: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning] __read_overflow2_field(q_size_field, size); The compiler actually complains on 'plfxlc_get_et_strings()' where fortification logic inteprets call to 'memcpy()' as an attempt to copy the whole 'et_strings' array from its first member and so issues an overread warning. This warning may be silenced by passing an address of the whole array and not the first member to 'memcpy()'. Signed-off-by: Dmitry Antipov Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230829094541.234751-1-dmantipov@yandex.ru commit e55c486c9b058c5e117b9f42c132d467166ae585 Author: Zenm Chen Date: Tue Aug 29 15:43:58 2023 +0800 wifi: rtl8xxxu: mark TOTOLINK N150UA V5/N150UA-B as tested TOTOLINK N150UA V5/N150UA-B (VID=0x0bda, PID=0x2005) works fine with the rtl8xxxu driver, so mark as tested. Signed-off-by: Zenm Chen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230829074358.14795-1-zenmchen@gmail.com commit 497840a1fc5c40a6a30d22f9a375552323156146 Author: Po-Hao Huang Date: Fri Aug 25 14:24:04 2023 +0800 wifi: rtw88: fix typo rtw8822cu_probe The probe function of 8822cu is misplaced to 8822bu, so we fix it. Just cosmetics, no changes in functionality. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230825062404.50813-1-pkshih@realtek.com commit 578464679f33cde8331507c78f7b302299df7783 Merge: 60ea3db33fbdd 1f11f4202caf5 Author: Mark Brown Date: Mon Sep 4 15:53:37 2023 +0100 spi: sun6i: fix RX data corruption in DMA mode Merge series from Tobias Schramm : This set of patches fixes two bugs in the sun6i SPI driver that result in corruption of received data in DMA RX mode. The first bug seems to be related to an incompatibility of the SPI RX FIFO with wider than single byte read accesses during SPI transfers. I'm not sure if this bug affects all types of SPI controllers found in Allwinner SoCs supported by this driver. However reducing the access width should always be safe. I've tested this change on a V3s SoC. Further testing to narrow down the set of affected SoCs in the future would be welcome. The second bug is a race between SPI RX DMA and FIFO drain logic for interrupt-based SPI operation. This bug affects all SPI controllers supported by this driver. Once again this change has been tested on the Allwinner V3s SoC. commit eefa13a69053a09f20b2d1c00dda59be9c98cfe9 Author: Stanislaw Gruszka Date: Fri Sep 1 11:49:51 2023 +0200 accel/ivpu: Print information about used workarounds Use ivpu_dbg(MISC) to print information about workarounds. Reviewed-by: Karol Wachowski Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-6-stanislaw.gruszka@linux.intel.com commit 1bb2af547a4bc2e053b398573d8ec7c3bf5ce69e Author: Jouni Högander Date: Fri Sep 1 12:35:00 2023 +0300 drm/i915: Handle dma fences in dirtyfb callback Take into account dma fences in dirtyfb callback. If there is no unsignaled dma fences perform flush immediately. If there are unsignaled dma fences perform invalidate and add callback which will queue flush when the fence gets signaled. v4: - Move invalidate before callback is added v3: - Check frontbuffer bits before adding any fence fb - Flush only when adding fence cb succeeds v2: Use dma_resv_get_singleton Signed-off-by: Jouni Högander Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901093500.3463046-5-jouni.hogander@intel.com commit 40320844ca8bda4def0f04d2bd8c2022c867ed86 Author: Jouni Högander Date: Fri Sep 1 12:34:59 2023 +0300 drm/i915: Add new frontbuffer tracking interface to queue flush We want to wait dma fences in dirtyfb ioctl. As we don't want to make dirtyfb ioctl as blocking call we need to use dma_fence_add_callback. Callback used for dma_fence_add_callback is called from atomic context. Due to this we need to add a new frontbuffer tracking interface to queue flush. v3: - Check schedule work success rather than work being pending - Init flush work when frontbuffer struct is initialized v2: Check if flush work is already pending Signed-off-by: Jouni Högander Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901093500.3463046-4-jouni.hogander@intel.com commit 35a97f56d6ccf1870e666fb6efa12a7ec201b9e4 Author: Jouni Högander Date: Fri Sep 1 12:34:58 2023 +0300 drm/i915/psr: Clear frontbuffer busy bits on flip We are planning to move flush performed from work queue. This means it is possible to have invalidate -> flip -> flush sequence. Handle this by clearing possible busy bits on flip. Signed-off-by: Jouni Högander Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230901093500.3463046-3-jouni.hogander@intel.com commit 4f89df198dc17070831af21b74e69ee17352619f Author: Jouni Högander Date: Fri Sep 1 12:34:57 2023 +0300 drm/i915/fbc: Clear frontbuffer busy bits on flip We are planning to move flush performed from work queue. This means it is possible to have invalidate -> flip -> flush sequence. Handle this by clearing possible busy bits on flip. Signed-off-by: Ville Syrjälä Signed-off-by: Jouni Högander Reviewed-by: Luca Coelho Link: https://patchwork.freedesktop.org/patch/msgid/20230901093500.3463046-2-jouni.hogander@intel.com commit beaf3ebf2924a111a64b2eec12f50104367ce0a0 Author: Jacek Lawrynowicz Date: Fri Sep 1 11:49:57 2023 +0200 accel/ivpu: Move MMU register definitions to ivpu_mmu.c MMU registers are not platform specific so they should be defined separate to platform regs. Signed-off-by: Jacek Lawrynowicz Reviewed-by: Stanislaw Gruszka Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-12-stanislaw.gruszka@linux.intel.com commit c92ab36169888362881e61cb300022a3682fa3f9 Author: Stanislaw Gruszka Date: Fri Sep 1 11:49:56 2023 +0200 accel/ivpu/37xx: White space cleanup No functional change, adjust code formatting so that defines line up nicely to improve code readability. Reviewed-by: Karol Wachowski Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-11-stanislaw.gruszka@linux.intel.com commit e5fb2867190f3e6e145da769b21283eeff5f3997 Author: Stanislaw Gruszka Date: Fri Sep 1 11:49:55 2023 +0200 accel/ivpu/37xx: Change register rename leftovers Change remaining MTL_VPU_ register names to generation based names. Reviewed-by: Karol Wachowski Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-10-stanislaw.gruszka@linux.intel.com commit 53d98420f5f93b94b0526a0e9194d226a46151da Author: Jacek Lawrynowicz Date: Fri Sep 1 11:49:53 2023 +0200 accel/ivpu: Move ivpu_fw_load() to ivpu_fw_init() ivpu_fw_load() doesn't have to be called separately in ivpu_dev_init(). Signed-off-by: Jacek Lawrynowicz Reviewed-by: Stanislaw Gruszka Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-8-stanislaw.gruszka@linux.intel.com Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-7-stanislaw.gruszka@linux.intel.com commit 34d03f2a174dce5ad7c2c1149127abddb75ac713 Author: Karol Wachowski Date: Fri Sep 1 11:49:52 2023 +0200 accel/ivpu: Initialize context with SSID = 1 Context with SSID = 1 is reserved and accesses on that context happen only when context is uninitialized on the VPU side. Such access triggers MMU fault (0xa) "Invalid CD Fetch", which doesn't contain any useful information besides context ID. This commit will change that state, now (0x10) "Translation fault" will be triggered and accessed address will shown in the log. Signed-off-by: Karol Wachowski Reviewed-by: Stanislaw Gruszka Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-7-stanislaw.gruszka@linux.intel.com commit edee62c0852aa7e107b9e9e7f1b3669a8d293ca2 Author: Stanislaw Gruszka Date: Fri Sep 1 11:49:50 2023 +0200 accel/ivpu: Add information about context on failure Identify the mmu context that failed to initialize in the error messages. This allows the error to be correlated with a specific user during debug. Reviewed-by: Karol Wachowski Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-5-stanislaw.gruszka@linux.intel.com commit 3f68b03ae6dcd1817d200020e57a40dbe8e80606 Author: Stanislaw Gruszka Date: Fri Sep 1 11:49:49 2023 +0200 accel/ivpu: Make ivpu_pm_init() void ivpu_pm_init() does not return any error, make it void. Reviewed-by: Karol Wachowski Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-4-stanislaw.gruszka@linux.intel.com commit 0a9cd7924e56de982ab4b3c57e3cc1f598746d13 Author: Jacek Lawrynowicz Date: Fri Sep 1 11:49:48 2023 +0200 accel/ivpu: Remove duplicated error messages Reduce the number of error messages per single failure in ivpu_dev_init() and ivpu_probe(). Most error messages are already printed by functions called from ivpu_dev_init(). Add missed error prints in ivpu_ipc_init() and ivpu_mmu_context_init(). Signed-off-by: Jacek Lawrynowicz Reviewed-by: Stanislaw Gruszka Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-3-stanislaw.gruszka@linux.intel.com commit 8ed520ff4682aaaef7d124bd9c0950092fddb9c1 Author: Krystian Pradzynski Date: Fri Sep 1 11:49:47 2023 +0200 accel/ivpu: Move set autosuspend delay to HW specific code Configure autosuspend values per HW generation and per platform. For non silicon platforms disable autosuspend for now, for silicon reduce it to 10 ms. Signed-off-by: Krystian Pradzynski Reviewed-by: Stanislaw Gruszka Reviewed-by: Jeffrey Hugo Signed-off-by: Stanislaw Gruszka Link: https://patchwork.freedesktop.org/patch/msgid/20230901094957.168898-2-stanislaw.gruszka@linux.intel.com commit 4f733de8b78a209501041a4b0a44c83ece0e8933 Author: lizhe Date: Tue Dec 20 22:37:49 2022 -0800 pcmcia: tcic: remove unneeded "&" in call to setup_timer() The second parameter is the entry address of the function, and therefore does not require an "&". Signed-off-by: lizhe [linux@dominikbrodowski.net: update commit message] Signed-off-by: Dominik Brodowski commit 99e25b17d2a3e3b486b4f6f90a740d51245da1f2 Author: Dongliang Mu Date: Wed Nov 16 09:45:50 2022 +0800 pcmcia: typo fix themselfves -> themselves Signed-off-by: Dongliang Mu Signed-off-by: Dominik Brodowski commit 99e1241049a92dd3e9a90a0f91e32ce390133278 Author: Yang Yingliang Date: Sat Nov 12 17:29:24 2022 +0800 pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() Afer commit 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array"), the name of device is allocated dynamically. Therefore, it needs to be freed, which is done by the driver core for us once all references to the device are gone. Therefore, move the dev_set_name() call immediately before the call device_register(), which either succeeds (then the freeing will be done upon subsequent remvoal), or puts the reference in the error call. Also, it is not unusual that the return value of dev_set_name is not checked. Fixes: 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array") Signed-off-by: Yang Yingliang [linux@dominikbrodowski.net: simplification, commit message modified] Signed-off-by: Dominik Brodowski commit 402ab979b29126068e0b596b641422ff7490214c Author: Yang Yingliang Date: Sat Nov 12 17:29:23 2022 +0800 pcmcia: ds: fix refcount leak in pcmcia_device_add() As the comment of device_register() says, it should use put_device() to give up the reference in the error path. Then, insofar resources will be freed in pcmcia_release_dev(), the error path is no longer needed. In particular, this means that the (previously missing) dropping of the reference to &p_dev->function_config->ref is now handled by pcmcia_release_dev(). Fixes: 360b65b95bae ("[PATCH] pcmcia: make config_t independent, add reference counting") Signed-off-by: Yang Yingliang [linux@dominikbrodowski.net: simplification, commit message rewrite] Signed-off-by: Dominik Brodowski commit e3ea1b4847e49234e691c0d66bf030bd65bb7f2b Author: Yang Yingliang Date: Sat Nov 12 17:25:41 2022 +0800 pcmcia: cs: fix possible hung task and memory leak pccardd() If device_register() returns error in pccardd(), it leads two issues: 1. The socket_released has never been completed, it will block pcmcia_unregister_socket(), because of waiting for completion of socket_released. 2. The device name allocated by dev_set_name() is leaked. Fix this two issues by calling put_device() when device_register() fails. socket_released can be completed in pcmcia_release_socket(), the name can be freed in kobject_cleanup(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Yang Yingliang Signed-off-by: Dominik Brodowski commit 38df905b642688c1bd4ea7c644f6852a00ab38c6 Author: Dmitry Osipenko Date: Tue Aug 22 08:25:55 2023 +0300 MAINTAINERS: Add Boris Brezillon as Panfrost driver maintainer Add Boris Brezillon as Panfrost driver maintainer. Boris is a new lead developer of the Panfrost Mesa driver and main developer behind the upcoming Panthor kernel driver that will serve next-gen Mali GPUs. Remove Tomeu and Alyssa, who left Collabora and stepped down from working on Panfrost. Acked-by: Boris Brezillon Acked-by: Tomeu Vizoso Acked-by: Alyssa Rosenzweig Signed-off-by: Dmitry Osipenko Acked-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20230822052555.538110-1-dmitry.osipenko@collabora.com commit f8afe6b41b9fc90a005948aad753d04fa1034a27 Author: Yue Haibing Date: Fri Aug 11 18:18:23 2023 +0800 drm/virtio: Remove unused function declarations Commit dc5698e80cf7 ("Add virtio gpu driver.") declared but never implemented virtio_gpu_attach_status_page()/virtio_gpu_detach_status_page() Also commit 62fb7a5e1096 ("virtio-gpu: add 3d/virgl support") declared but never implemented virtio_gpu_fence_ack() and virtio_gpu_dequeue_fence_func(). Commit c84adb304c10 ("drm/virtio: Support virtgpu exported resources") declared but never implemented virtgpu_gem_prime_get_uuid(). Signed-off-by: Yue Haibing Reviewed-by: Dmitry Osipenko Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20230811101823.32344-1-yuehaibing@huawei.com commit f208f4a49a46cc04f51b0c335d4b6390fbfcd1b8 Author: Jani Nikula Date: Thu Aug 31 13:51:44 2023 +0300 media: cec: core: add note about *_from_edid() function usage in drm In the drm subsystem, the source physical address is, in most cases, available without having to parse the EDID again. Add notes about preferring to use the pre-parsed address instead. Cc: Hans Verkuil Cc: linux-media@vger.kernel.org Signed-off-by: Jani Nikula Reviewed-by: Hans Verkuil Acked-by: Hans Verkuil Link: https://patchwork.freedesktop.org/patch/msgid/20230831105144.25923-1-jani.nikula@intel.com commit 1bc7344835524060f958e1879f8e427e54031098 Author: Jani Nikula Date: Thu Aug 24 16:46:06 2023 +0300 drm/i915/cec: switch to setting physical address directly Avoid parsing the EDID again for source physical address. Also gets rids of a few remaining raw EDID usages. Cc: Hans Verkuil Cc: linux-media@vger.kernel.org Signed-off-by: Jani Nikula Reviewed-by: Hans Verkuil Link: https://patchwork.freedesktop.org/patch/msgid/01a90c82c8a4f2fd945e0181ffeaca595928d19e.1692884619.git.jani.nikula@intel.com commit 113cdddcded6d597b64d824a59d0186db150113a Author: Jani Nikula Date: Fri Aug 25 16:01:20 2023 +0300 drm/cec: add drm_dp_cec_attach() as the non-edid version of set edid Connectors have source physical address available in display info. There's no need to parse the EDID again for this. Add drm_dp_cec_attach() to do this. Seems like the set_edid/unset_edid naming is a bit specific now that there's no need to pass the EDID at all, so aim for attach/detach going forward. v2: Fix the embarrashing build failures Cc: Hans Verkuil Cc: linux-media@vger.kernel.org Signed-off-by: Jani Nikula Reviewed-by: Hans Verkuil Acked-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230825130120.1250089-1-jani.nikula@intel.com commit 82b599ece3b8c25fa6d4823086bfa5800a816bf4 Author: Jani Nikula Date: Thu Aug 24 16:46:04 2023 +0300 drm/edid: parse source physical address CEC needs the source physical address. Parsing it is trivial with the existing EDID CEA DB infrastructure. Default to CEC_PHYS_ADDR_INVALID (0xffff) instead of 0 to cater for easier CEC usage. Cc: Hans Verkuil Cc: linux-media@vger.kernel.org Signed-off-by: Jani Nikula Reviewed-by: Hans Verkuil Acked-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/8c6b6403932536b6849e0b44e1ee6e7ebdbe4a69.1692884619.git.jani.nikula@intel.com commit e1039cde68493fe9bd10e49f7d561eca4bce87b3 Author: Jani Nikula Date: Thu Aug 24 16:46:03 2023 +0300 drm/i915/display: use drm_edid_is_digital() Reduce the use of struct edid and drm_edid_raw(). Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/dbc0269d34f3140aff410eefae8a2711c59299b3.1692884619.git.jani.nikula@intel.com commit 7218779efc46cdb48c1b9f959ea5cbb06333192f Author: Jani Nikula Date: Thu Aug 24 16:46:02 2023 +0300 drm/edid: add drm_edid_is_digital() Checking edid->input & DRM_EDID_INPUT_DIGITAL is common enough to deserve a helper that also lets us abstract the raw EDID a bit better. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Acked-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/4bdb407bf189fd922be022eb2f9564692377c81d.1692884619.git.jani.nikula@intel.com commit a35239a8925986e83c41c92f7147e5bce00d86d5 Author: Suraj Kandpal Date: Wed Aug 30 13:04:38 2023 +0530 drm/i915/hdcp: Use correct aux for capability check scenario Send the correct aux rather than the one derived from intel_digital_port so that the HDCP version of both monitors are fetched rather than just the primary one's Signed-off-by: Suraj Kandpal Reviewed-by: Uma Shankar Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20230830073437.666263-3-suraj.kandpal@intel.com commit 130849f8ec14fcc356ffe2134b018a3779e934c3 Author: Suraj Kandpal Date: Wed Aug 30 13:04:37 2023 +0530 drm/i915/hdcp: Use intel_connector as argument for hdcp_2_2_capable Use intel_connector as argument instead of intel_digital_port in hdcp_2_2_capable function and dig_port can be later derived from connector. This will help with getting the correct hdcp version of particular monitor in a MST setup. Signed-off-by: Suraj Kandpal Reviewed-by: Uma Shankar Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20230830073437.666263-2-suraj.kandpal@intel.com commit 8e455145d8f163aefa6b9cc29478e0a9f82276e6 Author: Christian König Date: Tue Aug 29 13:01:15 2023 +0200 drm/debugfs: rework drm_debugfs_create_files implementation v2 Use managed memory allocation for this. That allows us to not keep track of all the files any more. v2: keep drm_debugfs_cleanup(), but rename to drm_debugfs_unregister(), we still need to cleanup the symlink Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230829110115.3442-6-christian.koenig@amd.com Reviewed-by: Andi Shyti commit ec9c7073bb082412a49466059053ace537c1a30d Author: Christian König Date: Tue Aug 29 13:01:14 2023 +0200 drm/debugfs: remove dev->debugfs_list and debugfs_mutex v2 The mutex was completely pointless in the first place since any parallel adding of files to this list would result in random behavior since the list is filled and consumed multiple times. Completely drop that approach and just create the files directly but return -ENODEV while opening the file when the minors are not registered yet. v2: rebase on debugfs directory rework, limit access before minors are registered. Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230829110115.3442-5-christian.koenig@amd.com Reviewed-by: Andi Shyti commit 0b30d57acafcaa5374756d314ee54f80d0bcc860 Author: Christian König Date: Tue Aug 29 13:01:13 2023 +0200 drm/debugfs: rework debugfs directory creation v5 Instead of the per minor directories only create a single debugfs directory for the whole device directly when the device is initialized. For DRM devices each minor gets a symlink to the per device directory for now until we can be sure that this isn't useful any more in any way. Accel devices create only the per device directory and also drops the mid layer callback to create driver specific files. v2: cleanup accel component as well v3: fix typo when debugfs is disabled v4: call drm_debugfs_dev_fini() during release as well, some kerneldoc typos fixed v5: rebased and one more kerneldoc fix Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230829110115.3442-4-christian.koenig@amd.com Reviewed-by: Andi Shyti commit 173df1eaa8a91ab0b5352d1efb4192e3e5dc6c8f Author: Evan Quan Date: Mon Aug 14 10:16:27 2023 +0800 Revert "drm/amd/pm: disable the SMU13 OD feature support temporarily" This reverts commit 510d242f498a00f4701b77c6f42df880abacb3bd. The enablement for the new OD mechanism completed. Also, the support for fan control related OD feature has been added via this new mechanism. Thus, it is time to bring back the SMU13 OD support. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 9df5d00870ea628c3c6310aea859e5c06d378a12 Author: Evan Quan Date: Fri Aug 11 19:52:12 2023 +0800 drm/amd/pm: add fan minimum pwm OD setting support for SMU13 Add SMU13 fan minimum pwm OD setting support. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit eedd5a343d2294c1593a492edfd5514d4d2c9220 Author: Evan Quan Date: Fri Aug 11 19:33:23 2023 +0800 drm/amd/pm: add fan target temperature OD setting support for SMU13 Add SMU13 fan target temperature OD setting support. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 47cf6fcb88d2b46018a5dc9b1b369518f5588ae4 Author: Evan Quan Date: Fri Aug 11 18:09:14 2023 +0800 drm/amd/pm: add fan acoustic target OD setting support for SMU13 Add SMU13 fan acoustic target OD setting support. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 983ac45a06aec8987755c921aa53e81e6a69fb78 Author: Lang Yu Date: Mon Jul 17 14:30:25 2023 +0800 drm/amdgpu: update SET_HW_RESOURCES definition for UMSCH Align with FW changes. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit eebb06d121dfa611f0f0896b408f98828ab006b1 Author: Lang Yu Date: Sat Jun 3 17:41:20 2023 +0800 drm/amdgpu: add amdgpu_umsch_mm module parameter Enable Multi Media User Mode Scheduler (0 = disabled (default), 1 = enabled). Signed-off-by: Lang Yu Acked-by: Leo Liu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 822f7808291f7fd5a77c83c9ff035ad2e39959ab Author: Lang Yu Date: Wed Jun 21 20:16:46 2023 +0800 drm/amdgpu/discovery: enable UMSCH 4.0 in IP discovery Enable UMSCH to support VPE and VCN user queues. Signed-off-by: Lang Yu Reviewed-by: Leo Liu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 4f94903332c187ffcea1d2f69c494ce677b94781 Author: Lang Yu Date: Mon Jun 19 08:58:32 2023 +0800 drm/amdgpu: add PSP loading support for UMSCH Add front door loading support. Signed-off-by: Lang Yu Reviewed-by: Leo Liu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 40748f9a0a33da4c26ed25b95fcd488d3cafd833 Author: Lang Yu Date: Wed Jun 14 11:50:27 2023 +0800 drm/amdgpu: reserve mmhub engine 3 for UMSCH FW UMSCH FW uses mmhub engine 3 for invalidation. Signed-off-by: Lang Yu Acked-by: Leo Liu Acked-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit d591ae0c9f29c2db6fec4490bb2d493be0a572aa Author: Lang Yu Date: Wed Jun 21 17:56:24 2023 +0800 drm/amdgpu: add VPE queue submission test Submit a fence command through indirect buffer. Signed-off-by: Lang Yu Reviewed-by: Leo Liu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 5d5eac7e8303f8c69d68e157e8ffb25b06f0d0d2 Author: Lang Yu Date: Wed Jun 21 16:07:52 2023 +0800 drm/amdgpu: add selftest framework for UMSCH Prepare for VPE and VCN queue submission test. v2: rebase on drm_exec (Alex) Signed-off-by: Lang Yu Reviewed-by: Leo Liu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit dc6f3d6ff2cae6bb4dbc621dade8bd20f9aa69a2 Author: Lang Yu Date: Wed Jun 21 15:49:48 2023 +0800 drm/amdgpu: enable UMSCH scheduling for VPE Add VPE into UMSCH hw resourses, set vmid mask to 0xf00, set hqd mask to 0xfe, then UMSCH can schedule VPE queues. Signed-off-by: Lang Yu Reviewed-by: Leo Liu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 3488c79beafac3efbac571a2ebffc8ffd78bb7f0 Author: Lang Yu Date: Wed May 10 16:49:45 2023 +0800 drm/amdgpu: add initial support for UMSCH Add basic data structure, dummy ring functions and ip functions for UMSCH. Implement sw_init(ring_init and init_microcodede) and hw_init(load_microcode), UMSCH can boot up now. Implement hw_init(ring_start) and hw_fini(ring_stop), UMSCH is ready for command submission now. Implement set_hw_resources and add/remove_queue, UMSCH is ready for scheduling now. Aggregated doorbell is used to notify UMSCH FW that there is unmapped queue with corresponding priority level (e.g., AGDB[0] for Real time band, etc.) is updating its job. v2: squash together initial patches to avoid breaking the build (Alex) Signed-off-by: Lang Yu Reviewed-by: Leo Liu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 2da1b04a209601fe6e4bfcecdcaf8561c126072f Author: Lang Yu Date: Wed May 10 16:14:44 2023 +0800 drm/amdgpu: add UMSCH 4.0 api definition Add api definition for UMSCH 4.0. v2: adjust coding style. Signed-off-by: Lang Yu Reviewed-by: Leo Liu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 9c852a42a9f0af23f24abf7fac248d0455f39350 Author: Lang Yu Date: Wed May 10 16:13:26 2023 +0800 drm/amdgpu: add UMSCH firmware header definition Add firmware header definition for UMSCH. Signed-off-by: Lang Yu Reviewed-by: Leo Liu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 1a29f367811b0d9e65d30c5797715cfcb3c68b94 Author: Lang Yu Date: Wed May 10 16:04:17 2023 +0800 drm/amdgpu: add UMSCH RING TYPE definition Add RING TYPE definition for Multi Mdeia User Mode Scheduler. Signed-off-by: Lang Yu Reviewed-by: Leo Liu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 548009ad1c9a8e7dedf3c50730214c2e33f03865 Author: Evan Quan Date: Fri Aug 11 17:53:08 2023 +0800 drm/amd/pm: add fan acoustic limit OD setting support for SMU13 Add SMU13 fan acoustic limit OD setting support. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit d7bf1b556fcceaa81c0a18d7828258e7a6c383c2 Author: Evan Quan Date: Fri Aug 11 16:13:59 2023 +0800 drm/amd/pm: add fan temperature/pwm curve OD setting support for SMU13 Add SMU13 fan temperature/pwm curve OD setting support. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 1cf36599b97308622d619146b6801f5eddf282a9 Author: Saleemkhan Jamadar Date: Wed Aug 30 12:00:08 2023 +0530 drm/amdgpu/jpeg: initialize number of jpeg ring Initialize number of jpeg ring for vcn 4.0.5. Signed-off-by: Saleemkhan Jamadar Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit a5492fe27ff9684d901b2829584ea186fbecd71e Author: Christian König Date: Fri Aug 25 15:28:00 2023 +0200 drm/amdgpu: fix amdgpu_cs_p1_user_fence The offset is just 32bits here so this can potentially overflow if somebody specifies a large value. Instead reduce the size to calculate the last possible offset. The error handling path incorrectly drops the reference to the user fence BO resulting in potential reference count underflow. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 90bcb9b595549d75fca573a22f06b05ee15117fa Author: Evan Quan Date: Fri Aug 11 15:14:46 2023 +0800 drm/amdgpu: revise the device initialization sequences By placing the sysfs interfaces creation after `.late_int`. Since some operations performed during `.late_init` may affect how the sysfs interfaces should be created. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 3e38b634f94ef7fe76020cb0df805f218b6a637e Author: Evan Quan Date: Thu Aug 10 15:57:35 2023 +0800 drm/amd/pm: introduce a new set of OD interfaces There will be multiple interfaces(sysfs files) exposed with each representing a single OD functionality. And all those interface will be arranged in a tree liked hierarchy with the top dir as "gpu_od". Meanwhile all functionalities for the same component will be arranged under the same directory. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 2cd1f65d3174256aadce75ba716a18fbccabd5ce Author: Lang Yu Date: Wed May 10 16:08:24 2023 +0800 drm/amdgpu: add UMSCH IP BLOCK TYPE definition Add IP BLOCK TYPE definition for Multimedia User Mode Scheduler which is a hardware scheduler for VCN and VPE workload. Signed-off-by: Lang Yu Reviewed-by: Leo Liu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 433c4dea317168ed1914d28c9ae028e4681915b3 Author: Darren Powell Date: Wed Mar 29 17:27:55 2023 -0400 amdgpu/pm: Optimize emit_clock_levels for arcturus - part 3 split switch statement into two and consolidate the common code for printing most of the types of clock speeds Signed-off-by: Darren Powell Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 2c98de563b6fc093f585a236c82a80e9ca3b9ee0 Author: Lang Yu Date: Fri Jul 14 15:45:42 2023 -0400 drm/amdgpu: add UMSCH 4.0 register headers Add headers for UMSCH 4.0. v2: updates (Alex) Signed-off-by: Lang Yu Reviewed-by: Leo Liu Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit 6be6e74b7d58d4c214aef7b032333c5dd9d56f38 Author: Saleemkhan Jamadar Date: Thu Jul 27 16:10:20 2023 +0530 drm/amdgpu: enable PG flags for VCN Enable PG flags for VCN and Jpeg on IP 11_5_0 Signed-off-by: Saleemkhan Jamadar Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 844d8dd5b99529b5120a98e9fd31b2183d6a2534 Author: Saleemkhan Jamadar Date: Tue Jun 13 17:32:05 2023 +0530 drm/amdgpu/discovery: add VCN 4.0.5 Support Enable VCN 4.0.5 on gc 11_5_0. Signed-off-by: Saleemkhan Jamadar Acked-by: Leo Liu Signed-off-by: Alex Deucher commit c64f389506313a2cb2c31a8f4c59e7f62286f440 Author: Saleemkhan Jamadar Date: Wed Jun 28 10:47:31 2023 +0530 drm/amdgpu/soc21: Add video cap query support for VCN_4_0_5 Added the video capability query support for VCN version 4_0_5 Signed-off-by: Saleemkhan Jamadar Reviewed-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher commit cc308acc9baf78ab951ef4b7d31f2f2a417a0800 Author: Saleemkhan Jamadar Date: Tue Jun 13 15:08:01 2023 +0530 drm/amdgpu:enable CG and PG flags for VCN Enable CG and PG flags for VCN on IP 11_5_0 Signed-off-by: Saleemkhan Jamadar Acked-by: Leo Liu Signed-off-by: Alex Deucher commit 1827b3758293f3dce07988ea4d5e304430dd695c Author: Saleemkhan Jamadar Date: Tue Jun 13 16:50:49 2023 +0530 drm/amdgpu: add VCN_4_0_5 firmware support Add VCN_4_0_5 firmware support Signed-off-by: Saleemkhan Jamadar Acked-by: Leo Liu Signed-off-by: Alex Deucher commit 8f98a715da8e906cff5c635f9eb5399b84751557 Author: Saleemkhan Jamadar Date: Tue Jun 13 16:33:20 2023 +0530 drm/amdgpu/jpeg: add jpeg support for VCN4_0_5 Add jpeg support for VCN4_0_5 v2 - update license year (Leo Liu) Signed-off-by: Saleemkhan Jamadar Acked-by: Leo Liu Signed-off-by: Alex Deucher commit 547aad32edac17a3ec4989d8aad2426d0cbeb590 Author: Saleemkhan Jamadar Date: Tue Jun 13 16:32:23 2023 +0530 drm/amdgpu: add VCN4 ip block support Add VCN 4.0.5 initialization and decoder/encoder ring functions. v2 - update license year (Leo Liu) Signed-off-by: Saleemkhan Jamadar Acked-by: Leo Liu Signed-off-by: Alex Deucher commit c2066c5fb322dbf7c6a4a2815d9d5d2976eac589 Author: Saleemkhan Jamadar Date: Fri Jul 14 15:47:32 2023 -0400 drm/amdgpu: add vcn 4_0_5 header files Add VCN 4.0.5 registers v2 - Add license header (Alexander Deucher) v3 - updates (Alex) Signed-off-by: Saleemkhan Jamadar Acked-by: Leo Liu Signed-off-by: Alex Deucher commit f9ecae9a4ec19c2a7b3ac132411af1ee9940a0f5 Author: Lang Yu Date: Tue Jun 27 09:44:41 2023 +0800 drm/amdgpu: fix VPE front door loading issue Implement proper front door loading for vpe 6.1. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 5f6e9cdc83c146c6c20b36a2fb6dd607ed9e009a Author: Lang Yu Date: Wed May 31 12:19:54 2023 +0800 drm/amdgpu: add VPE FW version query support Add support to query VPE FW version. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 3ee8fb7005efe3cd2dac7220a3ba337fae5d8192 Author: Lang Yu Date: Wed Jul 13 11:34:20 2022 +0800 drm/amdgpu: enable VPE for VPE 6.1.0 Enable Video Processing Engine on SoCs that contain VPE 6.1.0. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 523c12802d2fc7f911a03dd4c81537f835a1da52 Author: Lang Yu Date: Mon Dec 19 14:45:57 2022 +0800 drm/amdgpu: add user space CS support for VPE Enable command submission to VPE from user space. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit c5d67a0ec3cc05eb640729fb61dd8810ba317fba Author: Lang Yu Date: Tue May 9 08:26:37 2023 +0800 drm/amdgpu: add PSP loading support for VPE Add PSP loading support for Video Processing Engine. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 9d4346bdbc6484a1814011315827c258509b483c Author: Lang Yu Date: Mon May 23 10:13:21 2022 +0800 drm/amdgpu: add VPE 6.1.0 support Add skeleton driver code. (Ray) Add initial support for Video Processing Engine. (Lang) Signed-off-by: Huang Rui Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 5861e47731aa8e8c29bca5d51705a5435397c6ae Author: Lang Yu Date: Tue Jul 18 16:29:38 2023 -0400 drm/amdgpu: add nbio 7.11 callback for VPE Add nbio callback to configure doorbell settings. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 75fdd738ff2cedd00a7b9e1bd4db36a3e4199903 Author: Lang Yu Date: Tue Jul 18 16:29:06 2023 -0400 drm/amdgpu: add nbio callback for VPE Add nbio callback to configure doorbell settings. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 964a36d7a4780bb657a98789fae5a620de0bb1e0 Author: Lang Yu Date: Sat May 6 10:09:32 2023 +0800 drm/amdgpu: add PSP FW TYPE for VPE Add PSP FW TYPE for Video Processing Engine. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 4c63735fa8b1c53786ba74421d666c60005582d5 Author: Lang Yu Date: Tue May 9 08:16:46 2023 +0800 drm/amdgpu: add UCODE ID for VPE Add UCODE ID for Video Processing Engine. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit ce7b59c1e61231cb97e2e5b46b2f45c97251d966 Author: Lang Yu Date: Thu May 12 11:22:31 2022 +0800 drm/amdgpu: add support for VPE firmware name decoding Add decoding VPE firmware name support. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 2f3916bedb72934ed67fb18ea0f7f77cc6156511 Author: Lang Yu Date: Wed Jul 13 11:10:45 2022 +0800 drm/amdgpu: add doorbell index for VPE Add doorbell index for Video Processing Engine. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 130c47065350a34b420dc9e626ca513e695dc801 Author: Lang Yu Date: Mon May 23 10:06:58 2022 +0800 drm/amdgpu: add irq src id definitions for VPE The irq src id is used to route interrupts to the corresponding handlers. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 5e18361425701a16a21e3b94c65882a253e669a0 Author: Lang Yu Date: Mon May 23 10:13:21 2022 +0800 drm/amdgpu: add IH CLIENT ID for VPE Add Interrupt Handler Client ID for Video Processing Engine. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 0b233357a63961dbb70fccb5d6076ec80a964b3a Author: Lang Yu Date: Fri Jun 17 10:35:47 2022 +0800 drm/amdgpu: add HWID for VPE Add HWID for Video Processing Engine. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit b0fa855cab567d6b8fdaaac11b058cab3193a797 Author: Lang Yu Date: Mon Jan 16 13:11:59 2023 +0800 drm/amdgpu: add VPE firmware interface Add initial firmware interface. (Ray) Add more opcodes and rename to vpe_v6_1. (Lang) v2: Update copyright date (Alex) Signed-off-by: Huang Rui Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 878fe05116dd39552b052e1e78fe2806b105ced9 Author: Lang Yu Date: Tue May 31 14:22:16 2022 +0800 drm/amdgpu: add VPE firmware header definition Add firmware header definition for Video Processing Engine. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 5b28f1c720f96fb4939c6a062530b4b219f84e99 Author: Huang Rui Date: Sun Apr 24 20:44:35 2022 +0800 drm/amdgpu: add VPE HW IP BLOCK definition Add HW IP BLOCK for Video Processing Engine. Signed-off-by: Huang Rui Signed-off-by: Alex Deucher commit e784199c40b87054a81d6acc25fbe4d9a1a68179 Author: Huang Rui Date: Sat Apr 23 22:37:43 2022 +0800 drm/amdgpu: add VPE IP BLOCK definition Add IP BLOCK for Video Processing Engine. Signed-off-by: Huang Rui Signed-off-by: Alex Deucher commit 2d6ea3b07c371ea1d80f6c41cb7b4ce7c5cf3cd4 Author: Huang Rui Date: Sat Apr 23 22:15:43 2022 +0800 drm/amdgpu: add VPE RING TYPE definition Add RING TYPE for Video Processing Engine. Signed-off-by: Huang Rui Signed-off-by: Alex Deucher commit fb4e4c5e38583a2c6526ce9fb81ddc1f0831087c Author: Jonathan Cavitt Date: Mon Aug 28 12:28:52 2023 -0700 drm/i915/gt: Wait longer for tasks in migrate selftest The thread_global_copy subtest of the live migrate selftest creates a large number of threads and waits 10ms for them all to start. This is not enough time to wait for the threaded tasks to start, as some may need to wait for additional ring space to be granted. Threads that do so are at risk of getting stopped (signaled) in the middle of waiting for additional space, which can result in ERESTARTSYS getting reported erroneously by i915_request_wait. Instead of waiting a flat 10ms for the threads to start, wait 10ms per thread. This grants enough of a buffer for each thread to wait for additional ring space when needed. Signed-off-by: Jonathan Cavitt Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230828192852.2894671-2-jonathan.cavitt@intel.com commit c1464a89e1a41695d5bda47d5c27923b1802ce00 Author: Jani Nikula Date: Wed Aug 30 11:51:27 2023 +0300 drm/i915: add minimal i915_gem_object_frontbuffer.h Split out frontbuffer related declarations and static inlines from gem/i915_gem_object.h into new gem/i915_gem_object_frontbuffer.h. The main goal is to reduce header interdependencies. With gem/i915_gem_object.h including display/intel_frontbuffer.h, modification of the latter causes a whopping 300+ objects to be rebuilt, while many of the source files actually needing it aren't explicitly including it at all. After the change, only 21 objects depend on display/intel_frontbuffer.h, directly or indirectly. Cc: Jouni Högander Reviewed-by: Jouni Högander Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230830085127.2416842-1-jani.nikula@intel.com commit 19ecbe8325a2a7ffda5ff4790955b84eaccba49f Author: baozhu.liu Date: Fri Aug 4 10:05:53 2023 +0800 drm/komeda: drop all currently held locks if deadlock happens If komeda_pipeline_unbound_components() returns -EDEADLK, it means that a deadlock happened in the locking context. Currently, komeda is not dealing with the deadlock properly,producing the following output when CONFIG_DEBUG_WW_MUTEX_SLOWPATH is enabled: ------------[ cut here ]------------ [ 26.103984] WARNING: CPU: 2 PID: 345 at drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c:1248 komeda_release_unclaimed_resources+0x13c/0x170 [ 26.117453] Modules linked in: [ 26.120511] CPU: 2 PID: 345 Comm: composer@2.1-se Kdump: loaded Tainted: G W 5.10.110-SE-SDK1.8-dirty #16 [ 26.131374] Hardware name: Siengine Se1000 Evaluation board (DT) [ 26.137379] pstate: 20400009 (nzCv daif +PAN -UAO -TCO BTYPE=--) [ 26.143385] pc : komeda_release_unclaimed_resources+0x13c/0x170 [ 26.149301] lr : komeda_release_unclaimed_resources+0xbc/0x170 [ 26.155130] sp : ffff800017b8b8d0 [ 26.158442] pmr_save: 000000e0 [ 26.161493] x29: ffff800017b8b8d0 x28: ffff000cf2f96200 [ 26.166805] x27: ffff000c8f5a8800 x26: 0000000000000000 [ 26.172116] x25: 0000000000000038 x24: ffff8000116a0140 [ 26.177428] x23: 0000000000000038 x22: ffff000cf2f96200 [ 26.182739] x21: ffff000cfc300300 x20: ffff000c8ab77080 [ 26.188051] x19: 0000000000000003 x18: 0000000000000000 [ 26.193362] x17: 0000000000000000 x16: 0000000000000000 [ 26.198672] x15: b400e638f738ba38 x14: 0000000000000000 [ 26.203983] x13: 0000000106400a00 x12: 0000000000000000 [ 26.209294] x11: 0000000000000000 x10: 0000000000000000 [ 26.214604] x9 : ffff800012f80000 x8 : ffff000ca3308000 [ 26.219915] x7 : 0000000ff3000000 x6 : ffff80001084034c [ 26.225226] x5 : ffff800017b8bc40 x4 : 000000000000000f [ 26.230536] x3 : ffff000ca3308000 x2 : 0000000000000000 [ 26.235847] x1 : 0000000000000000 x0 : ffffffffffffffdd [ 26.241158] Call trace: [ 26.243604] komeda_release_unclaimed_resources+0x13c/0x170 [ 26.249175] komeda_crtc_atomic_check+0x68/0xf0 [ 26.253706] drm_atomic_helper_check_planes+0x138/0x1f4 [ 26.258929] komeda_kms_check+0x284/0x36c [ 26.262939] drm_atomic_check_only+0x40c/0x714 [ 26.267381] drm_atomic_nonblocking_commit+0x1c/0x60 [ 26.272344] drm_mode_atomic_ioctl+0xa3c/0xb8c [ 26.276787] drm_ioctl_kernel+0xc4/0x120 [ 26.280708] drm_ioctl+0x268/0x534 [ 26.284109] __arm64_sys_ioctl+0xa8/0xf0 [ 26.288030] el0_svc_common.constprop.0+0x80/0x240 [ 26.292817] do_el0_svc+0x24/0x90 [ 26.296132] el0_svc+0x20/0x30 [ 26.299185] el0_sync_handler+0xe8/0xf0 [ 26.303018] el0_sync+0x1a4/0x1c0 [ 26.306330] irq event stamp: 0 [ 26.309384] hardirqs last enabled at (0): [<0000000000000000>] 0x0 [ 26.315650] hardirqs last disabled at (0): [] copy_process+0x5d0/0x183c [ 26.323825] softirqs last enabled at (0): [] copy_process+0x5d0/0x183c [ 26.331997] softirqs last disabled at (0): [<0000000000000000>] 0x0 [ 26.338261] ---[ end trace 20ae984fa860184a ]--- [ 26.343021] ------------[ cut here ]------------ [ 26.347646] WARNING: CPU: 3 PID: 345 at drivers/gpu/drm/drm_modeset_lock.c:228 drm_modeset_drop_locks+0x84/0x90 [ 26.357727] Modules linked in: [ 26.360783] CPU: 3 PID: 345 Comm: composer@2.1-se Kdump: loaded Tainted: G W 5.10.110-SE-SDK1.8-dirty #16 [ 26.371645] Hardware name: Siengine Se1000 Evaluation board (DT) [ 26.377647] pstate: 20400009 (nzCv daif +PAN -UAO -TCO BTYPE=--) [ 26.383649] pc : drm_modeset_drop_locks+0x84/0x90 [ 26.388351] lr : drm_mode_atomic_ioctl+0x860/0xb8c [ 26.393137] sp : ffff800017b8bb10 [ 26.396447] pmr_save: 000000e0 [ 26.399497] x29: ffff800017b8bb10 x28: 0000000000000001 [ 26.404807] x27: 0000000000000038 x26: 0000000000000002 [ 26.410115] x25: ffff000cecbefa00 x24: ffff000cf2f96200 [ 26.415423] x23: 0000000000000001 x22: 0000000000000018 [ 26.420731] x21: 0000000000000001 x20: ffff800017b8bc10 [ 26.426039] x19: 0000000000000000 x18: 0000000000000000 [ 26.431347] x17: 0000000002e8bf2c x16: 0000000002e94c6b [ 26.436655] x15: 0000000002ea48b9 x14: ffff8000121f0300 [ 26.441963] x13: 0000000002ee2ca8 x12: ffff80001129cae0 [ 26.447272] x11: ffff800012435000 x10: ffff000ed46b5e88 [ 26.452580] x9 : ffff000c9935e600 x8 : 0000000000000000 [ 26.457888] x7 : 000000008020001e x6 : 000000008020001f [ 26.463196] x5 : ffff80001085fbe0 x4 : fffffe0033a59f20 [ 26.468504] x3 : 000000008020001e x2 : 0000000000000000 [ 26.473813] x1 : 0000000000000000 x0 : ffff000c8f596090 [ 26.479122] Call trace: [ 26.481566] drm_modeset_drop_locks+0x84/0x90 [ 26.485918] drm_mode_atomic_ioctl+0x860/0xb8c [ 26.490359] drm_ioctl_kernel+0xc4/0x120 [ 26.494278] drm_ioctl+0x268/0x534 [ 26.497677] __arm64_sys_ioctl+0xa8/0xf0 [ 26.501598] el0_svc_common.constprop.0+0x80/0x240 [ 26.506384] do_el0_svc+0x24/0x90 [ 26.509697] el0_svc+0x20/0x30 [ 26.512748] el0_sync_handler+0xe8/0xf0 [ 26.516580] el0_sync+0x1a4/0x1c0 [ 26.519891] irq event stamp: 0 [ 26.522943] hardirqs last enabled at (0): [<0000000000000000>] 0x0 [ 26.529207] hardirqs last disabled at (0): [] copy_process+0x5d0/0x183c [ 26.537379] softirqs last enabled at (0): [] copy_process+0x5d0/0x183c [ 26.545550] softirqs last disabled at (0): [<0000000000000000>] 0x0 [ 26.551812] ---[ end trace 20ae984fa860184b ]--- According to the call trace information,it can be located to be WARN_ON(IS_ERR(c_st)) in the komeda_pipeline_unbound_components function; Then follow the function. komeda_pipeline_unbound_components -> komeda_component_get_state_and_set_user -> komeda_pipeline_get_state_and_set_crtc -> komeda_pipeline_get_state ->drm_atomic_get_private_obj_state -> drm_atomic_get_private_obj_state -> drm_modeset_lock komeda_pipeline_unbound_components -> komeda_component_get_state_and_set_user -> komeda_component_get_state -> drm_atomic_get_private_obj_state -> drm_modeset_lock ret = drm_modeset_lock(&obj->lock, state->acquire_ctx); if (ret) return ERR_PTR(ret); Here it return -EDEADLK. deal with the deadlock as suggested by [1], using the function drm_modeset_backoff(). [1] https://docs.kernel.org/gpu/drm-kms.html?highlight=kms#kms-locking Therefore, handling this problem can be solved by adding return -EDEADLK back to the drm_modeset_backoff processing flow in the drm_mode_atomic_ioctl function. Signed-off-by: baozhu.liu Signed-off-by: menghui.huang Reviewed-by: Liviu Dudau Signed-off-by: Liviu Dudau Link: https://patchwork.freedesktop.org/patch/msgid/20230804013117.6870-1-menghui.huang@siengine.com commit 7a0f217899a1005c8788c768a766dd435ce1c413 Author: Christian König Date: Tue Aug 29 13:01:12 2023 +0200 drm/debugfs: disallow debugfs access when device isn't registered During device bringup it might be that we can't access the debugfs files. Return -ENODEV until the registration is completed on access. Signed-off-by: Christian König Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230829110115.3442-3-christian.koenig@amd.com commit e76e7ec8f16259ff9167ab665eaee0d0fe20f805 Author: Christian König Date: Tue Aug 29 13:01:11 2023 +0200 drm/debugfs: drop debugfs_init() for the render and accel node v2 We want to remove per minor debugfs directories. Start by stopping drivers from adding anything inside of those in the mid layer callback. v2: drop it for the accel node as well Signed-off-by: Christian König Tested-by: Stanislaw Gruszka Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230829110115.3442-2-christian.koenig@amd.com commit 7ce8ac49e421cf115224a915126aacaa5ee9bb80 Author: Imre Deak Date: Wed Aug 30 17:04:21 2023 +0300 drm/i915/mtl: Add TC port lockdep assert to AUX power well enabling Similarly to earlier platforms, assert in the MTL AUX power well enabling handler for TC AUX CH power wells that the TC port using the AUX CH is locked. Signed-off-by: Imre Deak Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230830140421.2031111-2-imre.deak@intel.com commit 74c699e41998e948a72528497c62f878fb145ccd Author: Imre Deak Date: Wed Aug 30 17:04:20 2023 +0300 drm/i915/dp: Drop redundant AUX power get/put in intel_dp_force() intel_dp_force() takes the AUX power reference as required by the DP AUX transactions in intel_dp_set_edid(). However the low level AUX handler takes this reference already so the get/put in intel_dp_force() can be dropped. This also fixes a problem where the TC port mode changed while the AUX power well was enabled. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8779 Signed-off-by: Imre Deak Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230830140421.2031111-1-imre.deak@intel.com commit f65239008a1f5f9b72de6e7259dfd1b7af45a8af Author: Huang Rui Date: Sat Apr 23 22:13:06 2022 +0800 drm/amdgpu: add VPE HW IP definition Add HW IP for Video Processing Engine to support user space CS. Signed-off-by: Huang Rui Signed-off-by: Alex Deucher commit 2edc59309f5402dc9c552673613ce03c74977403 Author: Lang Yu Date: Fri Jul 14 15:50:24 2023 -0400 drm/amdgpu: add VPE 6.1.0 header files Add initial headers. (Ray) Update to align with hardware changes. (Lang) Updates (Alex) Signed-off-by: Huang Rui Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 8254e05c8297e31e398911dffc3d7f37602d87b2 Author: Srinivasan Shanmugam Date: Thu Jul 27 08:02:46 2023 +0530 drm/amdgpu: Fix printk_ratelimit() with DRM_ERROR_RATELIMITED in 'amdgpu_cs_ioctl' Replaced printk_ratelimit() with its DRM equivalent to avoid flooding of dmesg logs & hence fixes the following: WARNING: Prefer printk_ratelimited or pr__ratelimited to printk_ratelimit + if (printk_ratelimit()) Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit fe320639c129c7a46fe6885e9ca0a06201895cb6 Author: Hamza Mahfooz Date: Tue Aug 29 07:27:15 2023 -0400 Revert "Revert "drm/amd/display: Implement zpos property"" This reverts commit e2066eb4efe0e7d2d329d6e6765ed637a523ac45. The problematic IGT test case (i.e. kms_atomic@plane-immutable-zpos) has been fixed as of commit cb77add45011 ("tests/kms_atomic: remove zpos < N-planes assert") to the IGT repo. So, reintroduce the reverted code. Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/commit/cb77add45011b129e21f3cb2a4089a73dde56179 Acked-by: Alex Deucher Reviewed-by: Melissa Wen Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit bf227a4f0558320513b86c279996021480f9e750 Author: Srinivasan Shanmugam Date: Fri Aug 4 11:16:41 2023 +0530 drm/amdgpu: Use READ_ONCE() when reading the values in 'sdma_v4_4_2_ring_get_rptr' Use READ_ONCE() instead of declaring the pointer volatile. To prevent the compiler from refetching or reordering the read, so that the read value is always consistent. Link: https://lwn.net/Articles/624126/ Cc: Felix Kuehling Cc: Guchun Chen Cc: Christian König Cc: Alex Deucher Cc: "Pan, Xinhui" Cc: Le Ma Cc: Hawking Zhang Signed-off-by: Srinivasan Shanmugam Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 4d5dc6260c2d00d603ae9c4ab452b6b4587f0d9f Author: Yifan Zhang Date: Thu Aug 17 14:53:37 2023 +0800 drm/amdgpu: remove unused parameter in amdgpu_vmid_grab_idle amdgpu_vm is not used in amdgpu_vmid_grab_idle. Signed-off-by: Yifan Zhang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 80c74918aa7dbea8ccd42e1c973e4f19580825c0 Author: Asad Kamal Date: Fri Aug 25 15:52:19 2023 +0800 drm/amdkfd: Replace pr_err with dev_err Replace pr_err with dev_err to show the bus-id of failing device with kfd queue errors Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit ee78ef046cde9886c935ee4557039c398e372e8c Author: Darren Powell Date: Thu Apr 20 19:48:08 2023 -0400 amdgpu/pm: Optimize emit_clock_levels for arcturus - part 2 Use variables to remove ternary expression in print statement and improve readability. This will help to optimize the code duplication in the switch statement Also Changed: replaced single_dpm_table->count as iterator in for loops with safer clocks_num_levels value replaced dpm_table.value usage with local var clocks_mhz Signed-off-by: Darren Powell Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit f72dcf8b29c49b18444d7ca7b3341d1ef0cb3402 Author: Darren Powell Date: Wed Mar 29 16:22:36 2023 -0400 amdgpu/pm: Optimize emit_clock_levels for arcturus - part 1 Use variables to remove the multiple nested ternary expressions and improve readability. This will help to optimize the code duplication in the switch statement Also Changed: Modify function arcturus_get_clk_table to void function as it always returns 0 Use const string "attempt_string" to cut down on repetition Signed-off-by: Darren Powell Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 38498908c5e3ef24d6a1c44994e2a3eaf9ffa4a3 Author: Jay Cornwall Date: Fri Aug 25 12:18:41 2023 -0400 drm/amdkfd: Add missing gfx11 MQD manager callbacks mqd_stride function was introduced in commit 2f77b9a242a2 ("drm/amdkfd: Update MQD management on multi XCC setup") but not assigned for gfx11. Fixes a NULL dereference in debugfs. Signed-off-by: Jay Cornwall Signed-off-by: Harish Kasiviswanathan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit bf7aa8bea9cbe26dfc7fe5cf9c0ed05a419dbb64 Author: Hawking Zhang Date: Tue Aug 29 23:20:27 2023 +0800 drm/amdgpu: Free ras cmd input buffer properly Do not access the pointer for ras input cmd buffer if it is even not allocated. Signed-off-by: Hawking Zhang Reviewed-by: Stanley Yang Signed-off-by: Alex Deucher commit eae369917516fff195a49bdff89dcf230671cd6b Author: Srinivasan Shanmugam Date: Tue Aug 29 10:18:49 2023 +0530 drm/amd/display: Adjust kdoc for 'optc35_set_odm_combine' Fixes the following W=1 kernel build warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn35/dcn35_optc.c:46: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Enable CRTC Cc: Qingqing Zhuo Cc: Rodrigo Siqueira Cc: Harry Wentland Cc: Aurabindo Pillai Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 8f9a9a09af24f975ffd6e18b22c4ee8f86bbc01f Author: Ma Jun Date: Fri Aug 25 11:11:51 2023 +0800 drm/amd: Simplify the bo size check funciton Simplify the code logic of size check function amdgpu_bo_validate_size Signed-off-by: Ma Jun Reviewed-by: Christian König Signed-off-by: Alex Deucher commit d30279a9e37a4085d063ae2b551233865b38c3e8 Author: Rajneesh Bhardwaj Date: Thu Aug 24 11:16:40 2023 -0400 drm/amdgpu: Hide xcp partition sysfs under SRIOV XCP partitions should not be visible for the VF for GFXIP 9.4.3. Reviewed-by: Lijo Lazar Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 37fb87910724f21a1f27a75743d4f9accdee77fb Author: Harish Kasiviswanathan Date: Thu Aug 10 12:10:57 2023 -0400 drm/amdkfd: ratelimited SQ interrupt messages No functional change. Use ratelimited version of pr_ to avoid overflowing of dmesg buffer Signed-off-by: Harish Kasiviswanathan Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit ac3343c761fadcc875ffddd96d5740e9ecaadca5 Author: Tao Zhou Date: Fri Aug 25 15:13:57 2023 +0800 drm/amdgpu: use read-modify-write mode for gfx v9_4_3 SQ setting Instead of using direct update, avoid touching unrelated fields. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9f05cfc78c6880e06940ea78fbc43f6392710f17 Author: ZhenGuo Yin Date: Mon Aug 28 14:18:52 2023 +0800 drm/amdgpu: access RLC_SPM_MC_CNTL through MMIO in SRIOV runtime Register RLC_SPM_MC_CNTL is not blocked by L1 policy, VF can directly access it through MMIO during SRIOV runtime. v2: use SOC15 interface to access registers Acked-by: Alex Deucher Signed-off-by: ZhenGuo Yin Signed-off-by: Alex Deucher commit 668dfc4533262b169554f0b8dedb5ce3545d5d06 Author: Lee Jones Date: Thu Aug 24 08:36:53 2023 +0100 drm/amd/amdgpu/sdma_v6_0: Demote a bunch of half-completed function headers Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:248: warning: Function parameter or member 'job' not described in 'sdma_v6_0_ring_emit_ib' drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:248: warning: Function parameter or member 'flags' not described in 'sdma_v6_0_ring_emit_ib' drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:945: warning: Function parameter or member 'timeout' not described in 'sdma_v6_0_ring_test_ib' drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:1124: warning: Function parameter or member 'ring' not described in 'sdma_v6_0_ring_pad_ib' drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:1175: warning: Function parameter or member 'vmid' not described in 'sdma_v6_0_ring_emit_vm_flush' drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c:1175: warning: Function parameter or member 'pd_addr' not described in 'sdma_v6_0_ring_emit_vm_flush' Cc: linaro-mm-sig@lists.linaro.org Signed-off-by: Lee Jones Signed-off-by: Alex Deucher commit da3a815ccd3a86e260999c6fc087ecd48804252e Author: Alex Sierra Date: Mon Aug 28 09:47:21 2023 -0500 drm/amdkfd: use mask to get v9 interrupt sq data bits correctly Interrupt sq data bits were not taken properly from contextid0 and contextid1. Use macro KFD_CONTEXT_ID_GET_SQ_INT_DATA instead. Signed-off-by: Alex Sierra Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 06b1661e45b4a58af165367f82aa25c279903b9b Author: Qingqing Zhuo Date: Thu Aug 3 02:34:54 2023 -0400 drm/amd/display: Add DCN35 DM Support [Why & How] Add DM handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 45e7649fd191d23dbf50a8c7e6e8888233cfca9e Author: Qingqing Zhuo Date: Thu Aug 3 02:30:59 2023 -0400 drm/amd/display: Add DCN35 CORE [Why & How] Add DCN35 support in dc_resource.c. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit d68ccdb26392f72f40848d84bf0b57a56a4e13ef Author: André Almeida Date: Thu Aug 17 15:20:46 2023 -0300 drm/amdgpu: Allocate coredump memory in a nonblocking way During a GPU reset, a normal memory reclaim could block to reclaim memory. Giving that coredump is a best effort mechanism, it shouldn't disturb the reset path. Change its memory allocation flag to a nonblocking one. Signed-off-by: André Almeida Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 1cb87e048975ce59dd2dcadff47002df64f95f72 Author: Qingqing Zhuo Date: Thu Aug 3 18:39:23 2023 -0400 drm/amd/display: Add DCN35 blocks to Makefile [Why & How] Enable DCN35 in makefile. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 69cc1864c99a35ba4133877b3170b87e74cd0202 Author: Qingqing Zhuo Date: Thu Aug 3 02:28:55 2023 -0400 drm/amd/display: Add DCN35 DML [Why & How] Add DML handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 0fa45b6aeae489d271ccb58d80efc0bbec79fa9b Author: Qingqing Zhuo Date: Thu Aug 3 02:10:55 2023 -0400 drm/amd/display: Add DCN35 Resource [Why & How] Add resource handling for DCN35. v2: drop unused guard v3: drop dml2 dependencies for now (Alex) Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit ec129fa356bea5411cb16833cc5dab32689ea389 Author: Qingqing Zhuo Date: Thu Aug 3 02:10:06 2023 -0400 drm/amd/display: Add DCN35 init [Why & How] Add init files for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 65138eb72e1fc687be49932b9a45325598ffa01c Author: Qingqing Zhuo Date: Thu Aug 3 00:32:52 2023 -0400 drm/amd/display: Add DCN35 DMUB [Why & How] Add DMUB handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 9d6fa6760e125542928b3f673620d1f769a55476 Author: Qingqing Zhuo Date: Wed Aug 2 23:41:53 2023 -0400 drm/amd/display: Add DCN35 IRQ [Why & How] - Add IRQ handling for DCN35 - Update IRQ files for other DCNs in accordance to change in irq_service.h Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 8774029f76b9806f2f3586bb0502408076767fd5 Author: Qingqing Zhuo Date: Wed Aug 2 23:37:49 2023 -0400 drm/amd/display: Add DCN35 CLK_MGR [Why & How] Add CLK_MGR handling for DCN35. v2: Drop stale SMU interfaces (Alex) Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 6f8b7565cca4b745da54b7d5f26b7b9265a5f330 Author: Qingqing Zhuo Date: Thu Aug 3 01:44:52 2023 -0400 drm/amd/display: Add DCN35 HWSEQ [Why & How] Add HWSEQ handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 327959a489d54ecd126a00dc6c28197fc680b35d Author: Qingqing Zhuo Date: Thu Aug 3 01:43:51 2023 -0400 drm/amd/display: Add DCN35 DSC [Why & How] Add DSC handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit c10ad60fda8c687b119feefda80fc9329ecdb270 Author: Qingqing Zhuo Date: Thu Aug 3 01:43:19 2023 -0400 drm/amd/display: Add DCN35 MMHUBBUB [Why & How] Add MMHUBBUB handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 4435fc424000195f9f5945a5b68a2809e90143a0 Author: Qingqing Zhuo Date: Thu Aug 3 01:42:51 2023 -0400 drm/amd/display: Add DCN35 HUBBUB [Why & How] Add HUBBUB handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 74c06a327d37a6e6ee267911ec1a2d103ff16407 Author: Qingqing Zhuo Date: Thu Aug 3 01:42:21 2023 -0400 drm/amd/display: Add DCN35 HUBP [Why & How] Add HUBP handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 284246a1c32b69a8f486c4d37669cc588b86a3fd Author: Qingqing Zhuo Date: Thu Aug 3 01:41:55 2023 -0400 drm/amd/display: Add DCN35 DWB [Why & How] Add DWB handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit bd831267c603fdc40c9d99ae34f9a11d57bdd10c Author: Qingqing Zhuo Date: Thu Aug 3 01:41:12 2023 -0400 drm/amd/display: Add DCN35 DPP [Why & How] Add DPP handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit ffb8c23718e4106a56735b9ff5a21f0d876ca923 Author: Qingqing Zhuo Date: Thu Aug 3 01:40:34 2023 -0400 drm/amd/display: Add DCN35 OPP [Why & How] Add OPP handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit b9c96af677cbed62c07272594312cc8198293a24 Author: Qingqing Zhuo Date: Thu Aug 3 01:39:49 2023 -0400 drm/amd/display: Add DCN35 OPTC [Why & How] Add OPTC handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 920f879c8360a84148f0b04712778617c048c8ad Author: Qingqing Zhuo Date: Thu Aug 3 01:37:31 2023 -0400 drm/amd/display: Add DCN35 PG_CNTL [Why & How] Add PG_CNTL handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit e0b394a87a11164b533672df94ed2ce39e5f2bd4 Author: Qingqing Zhuo Date: Thu Aug 3 01:33:06 2023 -0400 drm/amd/display: Add DCN35 DIO [Why & How] Add DIO handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 819af8dc9a78faa3c0c26c11c2c9f2f9300351de Author: Qingqing Zhuo Date: Thu Aug 3 01:26:30 2023 -0400 drm/amd/display: Add DCN35 DCCG [Why & How] Add DCCG handling for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 5f0326ea9560256eff2e9e78197c23cda79d40ad Author: Qingqing Zhuo Date: Thu Aug 3 01:24:58 2023 -0400 drm/amd/display: Add DCN35 GPIO [Why & How] Add DCN35 support in GPIO. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 26a692f2419ce3bb6e2d40d60279b861b4b47f8c Author: Qingqing Zhuo Date: Thu Aug 3 01:21:12 2023 -0400 drm/amd/display: Add DCN35 BIOS command table support [Why & How] Add case for DCN35 in command_table_helper2.c. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit fb8c3ef8058456eceae1d7a746f9e45d3f161ac9 Author: Qingqing Zhuo Date: Thu Aug 3 02:03:42 2023 -0400 drm/amd/display: Update dc.h for DCN35 support [Why & How] Update dc.h for DCN35 usage. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 33e36f8e503881ec4009b16278dc390c10a3d526 Author: Qingqing Zhuo Date: Thu Aug 3 01:12:01 2023 -0400 drm/amd/display: Update DCN32 for DCN35 support [Why & How] Update DCN32 files for DCN35 usage. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 24143e508948571735d05b51922fe17ce8fc0be2 Author: Qingqing Zhuo Date: Thu Aug 3 01:09:39 2023 -0400 drm/amd/display: Update DCN314 for DCN35 support [Why & How] Update DCN314 files for DCN35 usage. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit efc1d1c9893726851e62c2c3c69a1af7258af651 Author: Qingqing Zhuo Date: Thu Aug 3 01:06:58 2023 -0400 drm/amd/display: Update DCN31 for DCN35 support [Why & How] Update DCN31 files for DCN35 usage. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 0ccd770ab05f59f5f308d155610dc8150ab446ff Author: Qingqing Zhuo Date: Thu Aug 3 01:03:53 2023 -0400 drm/amd/display: Update DCN30 for DCN35 support [Why & How] Update DCN30 files for DCN35 usage. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 9fc64eade85dbb1e92944ad07b14c4c24d8c08dc Author: Qingqing Zhuo Date: Thu Aug 3 00:55:47 2023 -0400 drm/amd/display: Update DCN20 for DCN35 support [Why & How] Update DCN20 files for DCN35 usage. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 473eb67cf117ac0ac0f31bc4511cec6418b97d04 Author: Qingqing Zhuo Date: Thu Aug 3 00:53:11 2023 -0400 drm/amd/display: Update DCN10 for DCN35 support [Why & How] Update DCN10 files for DCN35 usage. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 9d1870a7a4c73c781af03937a1bfa72aa7a4c7ea Author: Qingqing Zhuo Date: Thu Aug 3 00:49:48 2023 -0400 drm/amd/display: Update DCE for DCN35 support [Why & How] Update DCE files for DCN35 usage. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit ccecb0796797671bb845c82b70cc43a2d89033a7 Author: Qingqing Zhuo Date: Thu Aug 3 00:20:06 2023 -0400 drm/amd/display: Add DCN35 family information [Why & How] Add DCN35 family information in DC. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit ea629e5cf252dc07656e49cb4ebe240b40475795 Author: Qingqing Zhuo Date: Wed Aug 2 16:03:06 2023 -0400 drm/amd/display: Add dcn35 register header files [Why & How] Add register headers for DCN35. Signed-off-by: Qingqing Zhuo Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit a8cde40201a4a62ee56290fc61b4d5030a845c8e Author: Hawking Zhang Date: Wed Aug 23 17:43:46 2023 +0800 drm/amdgpu: Support query ecc cap for aqua_vanjaram Driver queries umc_info v4_0 to identify ecc cap for aqua_vanjaram Signed-off-by: Hawking Zhang Reviewed-by: Candice Li Signed-off-by: Alex Deucher commit 62a79c93d8c7be32ddead9b72585bf6a60a44f66 Author: Hawking Zhang Date: Wed Aug 23 17:41:44 2023 +0800 drm/amdgpu: Add umc_info v4_0 structure To be used by aqua_vanjaram Signed-off-by: Hawking Zhang Reviewed-by: Candice Li Signed-off-by: Alex Deucher commit 52548038496fd58b762067b946f943c9bbcbd01e Author: Srinivasan Shanmugam Date: Thu Jul 27 19:17:12 2023 +0530 drm/radeon: Remove the references of radeon_gem_ pread & pwrite ioctls Removing the functions of pread & pwrite & IOCTL defines, as their existence allows an authorized client to spam the system logs. Fixes: db996e64b293 ("drm/radeon: Fix ENOSYS with better fitting error codes in radeon_gem.c") Suggested-by: Christian König Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 088c507b5e483e98525c380208a6f52d9b9f8a0c Author: Srinivasan Shanmugam Date: Fri Aug 25 16:05:27 2023 +0530 drm/amd/display: Fix up kdoc format for 'dc_set_edp_power' Fixes the following W=1 kernel build warning: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:5261: warning: Cannot understand ******************************************* Cc: Ian Chen Cc: Rodrigo Siqueira Cc: Harry Wentland Cc: Aurabindo Pillai Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit ea7e2edca8b2150f945ee25af142fef8438c9944 Author: Wenjing Liu Date: Tue Aug 15 10:47:52 2023 -0400 drm/amd/display: always switch off ODM before committing more streams ODM power optimization is only supported with single stream. When ODM power optimization is enabled, we might not have enough free pipes for enabling other stream. So when we are committing more than 1 stream we should first switch off ODM power optimization to make room for new stream and then allocating pipe resource for the new stream. Cc: stable@vger.kernel.org Fixes: 59de751e3845 ("drm/amd/display: add ODM case when looking for first split pipe") Reviewed-by: Dillon Varone Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 0ee5d7374c99ea306bdfd2c8a1baeda6665b91f5 Author: Martin Leung Date: Mon Aug 21 10:22:50 2023 -0400 drm/amd/display: 3.2.249 This version brings along the following: - DCN315 fixes - DCN31 fixes - DPIA fixes - Dump the pipe topology when it updates - Misc code cleanups - New debugfs interface to query the current ODM combine configuration - ODM fixes - Potential deadlock while waiting for MPC idle fix - Support for windowed MPO ODM Acked-by: Hamza Mahfooz Signed-off-by: Martin Leung Signed-off-by: Alex Deucher commit d55a36062eb52e95195dab038bb9f237c69ca190 Author: Wenjing Liu Date: Fri Aug 18 10:08:29 2023 -0400 drm/amd/display: fix pipe topology logging error [why] There is a logging error in the recently added pipe topology log. If the plane with index 0 uses MPC combine, the log shows that as two separate planes. [how] Initialize plane idx as -1 and increment plane idx before logging any primary dpp pipes of a plane. Reviewed-by: Dillon Varone Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 07926ba8a44f0ca9165ee2fb17c9afc7908c3b2b Author: Aurabindo Pillai Date: Wed Aug 16 16:03:20 2023 -0400 drm/amd/display: Add debugfs interface for ODM combine info [Why] For use with IGT tests in userspace, the number of ODM segments in use is required to be exposed to userspace to verify that ODM Combine is working as expected when special timings are committed. [How] Add a connector specific debugfs entry that prints the number of ODM segments in use. Reviewed-by: Wenjing Liu Acked-by: Hamza Mahfooz Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit d755ce6465cab1e60661f329db9eef8594403cf9 Author: Charlene Liu Date: Wed Aug 16 20:40:57 2023 -0400 drm/amd/display: correct z8_watermark 16bit to 20bit mask remove double adjustment for DPREFCLK SS. dprefclk adjusted with SS is used for dp audio only. if adjust DP_DTO, need to adjust VID_M/N Reviewed-by: Muhammad Ahmed Acked-by: Hamza Mahfooz Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit 04f920dc05e71969b25b84dfb81c0b094f34c5d0 Author: Aurabindo Pillai Date: Wed Aug 9 15:43:07 2023 -0400 drm/amd/display: Fix incorrect comment Fix incorrect comment about hardware capabilities debugfs interface. Reviewed-by: Jerry Zuo Acked-by: Hamza Mahfooz Signed-off-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit 5e77c339a291776b88dcf1dd3e18955d0341dd5d Author: Dillon Varone Date: Fri Aug 4 16:55:26 2023 -0400 drm/amd/display: Skip dmub memory flush when not needed [WHY&HOW] Readback is only necessary when loaded via CPU. Reviewed-by: Chris Park Acked-by: Hamza Mahfooz Signed-off-by: Dillon Varone Signed-off-by: Alex Deucher commit d12f00c91fdfe3e50747f9e7e229fd8ede16b632 Author: Gabe Teeger Date: Mon Aug 14 16:06:18 2023 -0400 drm/amd/display: Remove wait while locked [Why] We wait for mpc idle while in a locked state, leading to potential deadlock. [What] Move the wait_for_idle call to outside of HW lock. This and a call to wait_drr_doublebuffer_pending_clear are moved added to a new static helper function called wait_for_outstanding_hw_updates, to make the interface clearer. Cc: stable@vger.kernel.org Fixes: 8f0d304d21b3 ("drm/amd/display: Do not commit pipe when updating DRR") Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Gabe Teeger Signed-off-by: Alex Deucher commit d8bafc2b1eeae78317d37b3440d1022977e9b28c Author: Wenjing Liu Date: Mon Aug 14 17:00:22 2023 -0400 drm/amd/display: add pipe topology update log Given an issue with pipe topology transition. It is very hard to tell the before and after pipe topology without a pipe topology logging. The change adds such logging to help with visualizing the issue. Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 39d39a0196574cc48186000088263807a7004b22 Author: Wenjing Liu Date: Thu Aug 10 19:47:39 2023 -0400 drm/amd/display: switch to new ODM policy for windowed MPO ODM support We need to align windowed MPO ODM support on DCN3x with new ODM policy. Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 9d1e172278886412dff96c451cb2b629f6b4a120 Author: Wenjing Liu Date: Thu Aug 10 19:46:10 2023 -0400 drm/amd/display: use new pipe allocation interface in dcn32 fpu This commit implements a new pipe resource allocation logic for DCN32 when windowed ODM MPO flag is set to enable testing. By default the flag is not set. It will be toggled on after we complete testing. Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 2174181019e4273e583a0f0a9795e9db38984784 Author: Wenjing Liu Date: Thu Aug 10 13:59:29 2023 -0400 drm/amd/display: add more pipe resource interfaces Redesign pipe resource interfaces in resource.h file. The new interface design addresses the issue with lack of pipe topology encapsulation and lack of pipe accessors. Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 7b0c688d4db2a4ecef64ab512a94cc8b154478f7 Author: Wenjing Liu Date: Sat Aug 5 13:37:34 2023 -0400 drm/amd/display: add new resource interfaces to update odm mpc slice count Define two new interfaces to update mpc and odm slice count. Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 6b8333a5b929da9e82410ee923f45dba79780bc0 Author: Wenjing Liu Date: Sat Aug 5 12:55:52 2023 -0400 drm/amd/display: add new resource interface for acquiring sec opp heads and release pipe [why] We need a new algorithm for acquiring secondary opp heads for ODM combine in dcn32 and a release pipe interface to properly release pipe resources. [how] add two new interfaces in DCN specific resource file. Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 9ba46183eb905589a845f3a973a37ffed7aebf1a Author: Wenjing Liu Date: Wed Aug 2 17:35:14 2023 -0400 drm/amd/display: rename function to add otg master for stream We are renaming acquire first free pipe to add otg master pipe for stream because the former name doesn't indicate that it acquires the first free pipe to use as an otg master pipe. This could cause coding errors if someone uses it to acquire a different pipe type. Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 9e0530257e2b45e88cf8bc0c32c457cadf7a07a7 Author: Wenjing Liu Date: Wed Aug 2 17:19:21 2023 -0400 drm/amd/display: add comments to add plane functions Adding detail comments describing the problem we are solving with add plane function. Reviewed-by: Jun Lei Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 753b7e62c9cf62d59264bd56e1c7a4c9505c73bb Author: Mustapha Ghaddar Date: Thu Aug 10 16:20:23 2023 -0400 drm/amd/display: Add DPIA Link Encoder Assignment Fix For DPIA we should have preferred DIG assignment based on DPIA selected as per the ASIC design. Reviewed-by: George Shen Acked-by: Hamza Mahfooz Signed-off-by: Mustapha Ghaddar Signed-off-by: Alex Deucher commit 15e6b396f5ac259126f2447fcd2279ed5d3dd14f Author: Wenjing Liu Date: Mon Aug 14 17:11:16 2023 -0400 drm/amd/display: update blank state on ODM changes When we are dynamically adding new ODM slices, we didn't update blank state, if the pipe used by new ODM slice is previously blanked, we will continue outputting blank pixel data on that slice causing right half of the screen showing blank image. The previous fix was a temporary hack to directly update current state when committing new state. This could potentially cause hw and sw state synchronization issues and it is not permitted by dc commit design. Cc: stable@vger.kernel.org Fixes: 7fbf451e7639 ("drm/amd/display: Reinit DPG when exiting dynamic ODM") Reviewed-by: Dillon Varone Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 302be1cb9f4b02995f3b10c50494d5eb8fdaf5c1 Author: Fudong Wang Date: Fri Aug 11 08:24:59 2023 +0800 drm/amd/display: Add smu write msg id fail retry process A benchmark stress test (12-40 machines x 48hours) found that DCN315 has cases where DC writes to an indirect register to set the smu clock msg id, but when we go to read the same indirect register the returned msg id doesn't match with what we just set it to. So, to fix this retry the write until the register's value matches with the requested value. Cc: stable@vger.kernel.org # 6.1+ Fixes: f94903996140 ("drm/amd/display: Add DCN315 CLK_MGR") Reviewed-by: Charlene Liu Acked-by: Hamza Mahfooz Signed-off-by: Fudong Wang Signed-off-by: Alex Deucher commit 3001e6d1dedc4d486674de7196bb5150168647de Author: Ethan Bitnun Date: Mon Aug 14 10:32:14 2023 -0400 drm/amd/display: Add support for 1080p SubVP to reduce idle power - Override the det to adjust microschedule timings allow for 1080p configs with SubVP - To lower unnecessary risk, we prevent multi 1080p configs from using SubVP, as multi 1080p already has low idle power. - Count the number of streams to verify that we are in a SubVP config before overriding Reviewed-by: Alvin Lee Acked-by: Hamza Mahfooz Signed-off-by: Ethan Bitnun Signed-off-by: Alex Deucher commit c4b9dc5313da08c95e3385b0b9931ed0ec78eb39 Author: Lijo Lazar Date: Wed Jul 19 13:31:47 2023 +0530 drm/amdgpu: Add SMU v13.0.6 default reset methods For APUs with SMU v13.0.6, mode-2 reset is kept as default and for others mode-1 is the default reset method. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Asad Kamal Tested-by: Asad Kamal Signed-off-by: Alex Deucher commit b03b44b622dec8c76a6455958f7576365007b90e Author: Wenjing Liu Date: Tue Aug 8 18:49:20 2023 -0400 Partially revert "drm/amd/display: update add plane to context logic with a new algorithm" This partially reverts commit 460ea8980511 ("drm/amd/display: update add plane to context logic with a new algorithm"). The new secondary pipe allocation logic triggers an issue with a specific hardware state transition and causes a frame of corruption when toggling between windowed MPO and ODM desktop only mode. Ideally hwss is supposed to handle this scenario. We are temporarily reverting the logic and investigate the root cause why this transition would cause corruptions. Fixes: 460ea8980511 ("drm/amd/display: update add plane to context logic with a new algorithm") Reviewed-by: Martin Leung Acked-by: Hamza Mahfooz Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit ed807f0cbfed8d7877bc5a1879330e579f095afa Author: Li Ma Date: Fri Jul 14 15:35:19 2023 -0400 drm/amdgpu: add header files for MP 14.0.0 This patch will add header files for MP 14.0.0. v2: updates (Alex) Signed-off-by: Li Ma Signed-off-by: Alex Deucher commit 04cef5f58395806294a64118cf8a39534bd032a2 Author: Lee Jones Date: Thu Aug 24 08:36:56 2023 +0100 drm/amd/amdgpu/amdgpu_doorbell_mgr: Correct misdocumented param 'doorbell_index' Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c:123: warning: Function parameter or member 'doorbell_index' not described in 'amdgpu_doorbell_index_on_bar' drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c:123: warning: Excess function parameter 'db_index' description in 'amdgpu_doorbell_index_on_bar' Reviewed-by: Shashank Sharma Signed-off-by: Lee Jones Signed-off-by: Alex Deucher commit a728342ae4ec2a7fdab0038b11427579424f133e Author: Lee Jones Date: Thu Aug 24 08:37:05 2023 +0100 drm/amd/amdgpu/imu_v11_0: Increase buffer size to ensure all possible values can be stored Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/imu_v11_0.c: In function ‘imu_v11_0_init_microcode’: drivers/gpu/drm/amd/amdgpu/imu_v11_0.c:52:54: warning: ‘_imu.bin’ directive output may be truncated writing 8 bytes into a region of size between 4 and 33 [-Wformat-truncation=] drivers/gpu/drm/amd/amdgpu/imu_v11_0.c:52:9: note: ‘snprintf’ output between 16 and 45 bytes into a destination of size 40 Signed-off-by: Lee Jones Signed-off-by: Alex Deucher commit ac84d99a1100c0f9a8bdc1099989f3089d4406fa Author: Lee Jones Date: Thu Aug 24 08:37:04 2023 +0100 drm/amd/amdgpu/amdgpu_sdma: Increase buffer size to account for all possible values Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c: In function ‘amdgpu_sdma_init_microcode’: drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c:217:64: warning: ‘.bin’ directive output may be truncated writing 4 bytes into a region of size between 0 and 32 [-Wformat-truncation=] drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c:217:17: note: ‘snprintf’ output between 13 and 52 bytes into a destination of size 40 drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c:215:66: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c:215:17: note: ‘snprintf’ output between 12 and 41 bytes into a destination of size 40 Signed-off-by: Lee Jones Signed-off-by: Alex Deucher commit 3dd8a754a5665bedfbec4eae51ffb11fef3bbc80 Author: Lee Jones Date: Thu Aug 24 08:37:02 2023 +0100 drm/amd/amdgpu/amdgpu_ras: Increase buffer size to account for all possible values Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c: In function ‘amdgpu_ras_sysfs_create’: drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1406:20: warning: ‘_err_count’ directive output may be truncated writing 10 bytes into a region of size between 1 and 32 [-Wformat-truncation=] drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1405:9: note: ‘snprintf’ output between 11 and 42 bytes into a destination of size 32 Signed-off-by: Lee Jones Signed-off-by: Alex Deucher commit 8057a9d6561e1b1fbdb3b0d21d8b3724aa034f4e Author: Lee Jones Date: Thu Aug 24 08:36:57 2023 +0100 drm/amd/amdgpu/amdgpu_device: Provide suitable description for param 'xcc_id' Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:516: warning: Function parameter or member 'xcc_id' not described in 'amdgpu_mm_wreg_mmio_rlc' Signed-off-by: Lee Jones Signed-off-by: Alex Deucher commit 01ee1f8aeac711aad1eda78652e0ad741100958f Author: Lee Jones Date: Thu Aug 24 08:36:52 2023 +0100 drm/radeon/radeon_ttm: Remove unused variable 'rbo' from radeon_bo_move() Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/radeon/radeon_ttm.c: In function ‘radeon_bo_move’: drivers/gpu/drm/radeon/radeon_ttm.c:201:27: warning: variable ‘rbo’ set but not used [-Wunused-but-set-variable] Signed-off-by: Lee Jones Signed-off-by: Alex Deucher commit ddf1639b54c7c519b3807996f0a8477a3aadf56a Author: Colin Ian King Date: Wed Aug 23 10:03:23 2023 +0100 drm/amd: Fix spelling mistake "throtting" -> "throttling" There is a spelling mistake in variable throtting_events, rename it to throttling_events. Reviewed-by: Yang Wang Signed-off-by: Colin Ian King Signed-off-by: Alex Deucher commit 415b7ba36a788dd2496a605f3fc992c793afd406 Author: Christophe JAILLET Date: Sun Aug 20 11:51:16 2023 +0200 drm/amdgpu: Use kvzalloc() to simplify code kvzalloc() can be used instead of kvmalloc() + memset() + explicit NULL assignments. It is less verbose and more future proof. Signed-off-by: Christophe JAILLET Signed-off-by: Alex Deucher commit 5f5c75bf1687d492d35fb37819508a270ba7a8f8 Author: Christophe JAILLET Date: Sun Aug 20 11:51:15 2023 +0200 drm/amdgpu: Remove amdgpu_bo_list_array_entry() Now that there is an explicit flexible array at the end of 'struct amdgpu_bo_list', it can be used to remove amdgpu_bo_list_array_entry() and simplify some macro. Signed-off-by: Christophe JAILLET Signed-off-by: Alex Deucher commit a23abe1fbdc16358ca185b4681fef19ec75b79c3 Author: Christophe JAILLET Date: Sun Aug 20 11:51:14 2023 +0200 drm/amdgpu: Remove a redundant sanity check The case where 'num_entries' is too big, is already handled by struct_size(), because kvmalloc() would fail. It will return -ENOMEM instead of -EINVAL, but it is only related to a unlikely to happen sanity check. Signed-off-by: Christophe JAILLET Signed-off-by: Alex Deucher commit ff49bd2c74f2e9659c942aff9629b5fcbffed97f Author: Christophe JAILLET Date: Sun Aug 20 11:51:13 2023 +0200 drm/amdgpu: Explicitly add a flexible array at the end of 'struct amdgpu_bo_list' 'struct amdgpu_bo_list' is really used as if it was ended by a flex array. So make it more explicit and add a 'struct amdgpu_bo_list_entry entries[]' field at the end of the structure. This way, struct_size() can be used when it is allocated. It is less verbose. Signed-off-by: Christophe JAILLET Signed-off-by: Alex Deucher commit ac0ec1c7d1f0d017d0ea44954026d2f138c581e4 Author: Hamza Mahfooz Date: Tue Aug 22 12:31:09 2023 -0400 drm/amd/display: register edp_backlight_control() for DCN301 As made mention of in commit 099303e9a9bd ("drm/amd/display: eDP intermittent black screen during PnP"), we need to turn off the display's backlight before powering off an eDP display. Not doing so will result in undefined behaviour according to the eDP spec. So, set DCN301's edp_backlight_control() function pointer to dce110_edp_backlight_control(). Cc: stable@vger.kernel.org Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2765 Fixes: 9c75891feef0 ("drm/amd/display: rework recent update PHY state commit") Suggested-by: Swapnil Patel Reviewed-by: Harry Wentland Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit ec70578c83eaf52b78488c887bc2d40a4c3bffe2 Author: Hawking Zhang Date: Thu Aug 24 16:18:59 2023 +0800 drm/amdgpu: Allow issue disable gfx ras cmd to firmware Disable gfx ras command is needed in some use cases Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit e370f8f3897696b29f3ed2a774d22f6cc8b1fb04 Author: Lijo Lazar Date: Wed Jul 19 13:17:22 2023 +0530 drm/amdgpu: Add bootloader wait for PSP v13 Implement the wait for bootloader call back for PSP v13.0 ASICs. Only for ASICs with PSP v13.0.6, it needs an additional check for VBIOS mailbox status. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Asad Kamal Tested-by: Asad Kamal Signed-off-by: Alex Deucher commit 1c6b6bd0780f2f9e460567c4ccf1d69c3fb212cf Author: Hamza Mahfooz Date: Tue Aug 15 09:13:37 2023 -0400 drm/amdgpu: register a dirty framebuffer callback for fbcon fbcon requires that we implement &drm_framebuffer_funcs.dirty. Otherwise, the framebuffer might take a while to flush (which would manifest as noticeable lag). However, we can't enable this callback for non-fbcon cases since it may cause too many atomic commits to be made at once. So, implement amdgpu_dirtyfb() and only enable it for fbcon framebuffers (we can use the "struct drm_file file" parameter in the callback to check for this since it is only NULL when called by fbcon, at least in the mainline kernel) on devices that support atomic KMS. Cc: Aurabindo Pillai Cc: Mario Limonciello Cc: stable@vger.kernel.org # 6.1+ Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2519 Reviewed-by: Mario Limonciello Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit 8525d41b02900173e716c13ff879af89fea8982c Author: Darren Powell Date: Fri Apr 29 22:12:23 2022 -0400 amdgpu/pm: Replace print_clock_levels with emit_clock_levels for arcturus Replace print_clock_levels with emit_clock_levels for arcturus * replace .print_clk_levels with .emit_clk_levels in arcturus_ppt_funcs * added extra parameter int *offset * removed var size, uses arg *offset instead * removed call to smu_cmn_get_sysfs_buf * errors are returned to caller * returns 0 on success additional incidental changes * changed type of var i, now to remove comparing mismatch types * renamed var s/now/cur_value/ * switch statement default now returns -EINVAL * RAS Recovery returns -EBUSY Based on commit b06b48d7ddae ("amdgpu/pm: Implement emit_clk_levels for navi10") Signed-off-by: Darren Powell Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 0bc053404dbdd88ac0bfb7f4ac682c54211fcec7 Author: Evan Quan Date: Wed Aug 16 14:51:19 2023 +0800 drm/amd/pm: fulfill the support for SMU13 `pp_dpm_dcefclk` interface Fulfill the incomplete SMU13 `pp_dpm_dcefclk` implementation. Reported-by: Guan Yu Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit e835bc2628d35c8ef08e0556db6bdee801625ea5 Author: Evan Quan Date: Mon Aug 21 14:15:13 2023 +0800 drm/amd/pm: correct SMU13 gfx voltage related OD settings The voltage offset setting will be applied to the whole v/f curve line instead of per anchor point base. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 2c017263896314cd7cfc4454be1d3bb5ac2d837a Author: Jesse Zhang Date: Wed Aug 23 14:54:21 2023 +0800 drm/amdgpu/pm: Remove the duplicate dpm status check Since the smu firmware has fixed the issue that described in the commit 60d61f4ed6ea ("drm/amdgpu/pm: fix the Stable pstate Test in amdgpu_test"). So we only need keep dpm status check in the funciton - smu_v13_0_5_set_soft_freq_limited_range. Signed-off-by: Jesse Zhang Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher commit 102b80f682463235e22758bc03e6e5ab167a0ca7 Author: Kun Liu Date: Fri Aug 11 10:54:52 2023 +0800 drm/amd/pm: Vangogh: Get average_* from average field of gpu_metrics_table for older BIOS, smu won't fill average field of gpu_metrics_table, so we acquire average_* from current field. but now average value is available in gpu_metrics_v2_4 Signed-off-by: Kun Liu Acked-by: Evan Quan Signed-off-by: Alex Deucher commit d1090194cb4b4bf7f4cfe01f85367580b19e50f6 Author: Srinivasan Shanmugam Date: Wed Aug 23 07:03:32 2023 +0530 drm/amd/pm: Fixes incorrect type in 'amdgpu_hwmon_show_power_avg() & _input()' The val is defined as unsigned int type, if(val<0) is invalid, hence modified its type to ssize_t Fixes the below: drivers/gpu/drm/amd/pm/amdgpu_pm.c:2800:5-8: WARNING: Unsigned expression compared with zero: val < 0 drivers/gpu/drm/amd/pm/amdgpu_pm.c:2813:5-8: WARNING: Unsigned expression compared with zero: val < 0 Cc: Guchun Chen Cc: Christian König Cc: Alex Deucher Cc: "Pan, Xinhui" Signed-off-by: Srinivasan Shanmugam Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit a5600853167aeba5cade81f184a382a0d1b14641 Author: Alex Deucher Date: Fri Aug 18 12:21:32 2023 -0400 drm/amd/pm: fix error flow in sensor fetching Sensor fetching functions should return an signed int to handle errors properly. Reviewed-by: Srinivasan Shanmugam Reported-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 7caebc8f99b29b590bd4e8c42a35a4fb593d4f29 Author: Mangesh Gadre Date: Mon Aug 21 18:26:24 2023 +0800 drm/amdgpu: Updated TCP/UTCL1 programming Update TCP/UTCL1 thrashing control settings v2: updated rev_id check Signed-off-by: Mangesh Gadre Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit f54e1d47e0204d73c29993deecd81d60bbbfc830 Author: Srinivasan Shanmugam Date: Fri Aug 18 11:57:03 2023 +0530 drm/amdgpu: Fix kcalloc over kzalloc in 'gmc_v9_0_init_mem_ranges' Replace kzalloc(n * sizeof(...), ...) with kcalloc(n, sizeof(...), ...) since kcalloc is the preferred API in case of allocating with multiply. Fixes the below: WARNING: Prefer kcalloc over kzalloc with multiply Cc: Guchun Chen Cc: Christian König Cc: Alex Deucher Cc: "Pan, Xinhui" Signed-off-by: Srinivasan Shanmugam Reviewed-by: Lijo Lazar Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit e0e1764a3a05ff2d3f60ae42feccd43f0d546d39 Author: Alex Deucher Date: Fri Aug 18 15:18:07 2023 -0400 drm/amd/pm: fix debugfs pm_info output Print both input and avg power. Fixes: 47f1724db4fe ("drm/amd: Introduce `AMDGPU_PP_SENSOR_GPU_INPUT_POWER`") Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 5d44a766f70d394871da8882e4426f61e86c2d5b Author: Philip Yang Date: Mon Aug 21 15:09:56 2023 -0400 drm/amdkfd: Share the original BO for GTT mapping If mGPUs is on same IOMMU group, or is ram direct mapped, then mGPUs can share the original BO for GTT mapping dma address, without creating new BO from export/import dmabuf. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 2c0f880abcca0f3514a65b90639bce570aeded75 Author: Hawking Zhang Date: Sat Aug 19 14:15:08 2023 +0800 drm/amdgpu: Fix the return for gpu mode1_reset amdgpu_device_mode1_reset will return gpu mode1_reset succeed (ret = 0) as long as wait_for_bootloader call succeed, regardless of the status reported by smu or psp firmware. This results to driver continue executing recovery even smu or psp fail to perform mode1 reset. Signed-off-by: Hawking Zhang Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher commit c234cd5f08666210d34be311b04d9413ac61d073 Author: Aric Cyr Date: Mon Aug 14 01:33:21 2023 -0400 drm/amd/display: 3.2.248 This version brings along following fixes: - Ensure FS is enabled before sending request to DMUB for FS changes - Add check for PMFW hard min request complete - Save addr update in scratch before flip - Fix static screen detection setting - Write flip addr to scratch reg for subvp - set minimum of VBlank_nom - Correct unit conversion for vstartup - Roll back unit correction - Enable runtime register offset init for DCN32 DMUB - Refactor edp power control - PQ regamma end point - PQ tail accuracy - Expose mall capability Acked-by: Wayne Lin Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit af23474345682c7e2e27554a515367be3f9244ec Author: Anthony Koo Date: Sat Aug 12 11:21:06 2023 -0400 drm/amd/display: [FW Promotion] Release 0.0.180.0 - Remove unused flag otg_powered_down Acked-by: Wayne Lin Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 99f596fc9ce556bd92a79c4c1f1ca937610ee633 Author: Samson Tam Date: Fri Aug 11 20:02:17 2023 -0400 drm/amd/display: ensure FS is enabled before sending request to DMUB for FS changes [Why] ignore_msa_timing_param indicates FS is capable but not necessarily enabled [How] add check for either allow_freesync or vrr_active_variable to confirm FS is enabled Reviewed-by: Alvin Lee Acked-by: Wayne Lin Signed-off-by: Samson Tam Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5133b8d2ffd01a5b39543495986a8df285972842 Author: Samson Tam Date: Fri Aug 11 17:53:56 2023 -0400 drm/amd/display: add check for PMFW hard min request complete [Why] When we issue hard min request to PMFW, the ack back does not guarantee the request has been fulfilled. [How] Add new PMFW message to check if the hard min request has been completed. Returned bit mask indicates which clock requests are completed. Check PMFW version before using message Reviewed-by: Alvin Lee Acked-by: Wayne Lin Signed-off-by: Samson Tam Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a03aa4e0409822d323bbaf87a35d5773f79a3a41 Author: Alvin Lee Date: Fri Aug 11 16:59:48 2023 -0400 drm/amd/display: Save addr update in scratch before flip [Why & How] Fix a minor sequencing issue where the address update for a subvp flip should be saved in scratch registers before the actual flip Reviewed-by: Austin Zheng Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b1803560ba9d0c31c1a045fd8e9d438f19decdc8 Author: SungHuai Wang Date: Fri Aug 11 11:15:37 2023 +0800 drm/amd/display: fix static screen detection setting [WHY] OTG_STATIC_SCREEN_EVENT_MASK is changed in DCN3, but we still follow DCN2 to apply setting for OTG_STATIC_SCREEN_EVENT_MASK. [How] Add new function to apply correct settings for DCN3 series. Reviewed-by: Anthony Koo Acked-by: Wayne Lin Signed-off-by: SungHuai Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 96271dd4d56d56cc4087352b3b68997be85a6cf4 Author: benl Date: Wed May 10 17:28:41 2023 +0800 drm/amdgpu: add gfxhub 11.5.0 support Add initial gfxhub 11.5 support. Signed-off-by: benl Signed-off-by: Alex Deucher commit b90975fa5bd8aa6ff93b2256fc2288c05c254dea Author: Prike Liang Date: Fri Jul 14 16:03:39 2023 -0400 drm/amdgpu: enable gmc11 for GC 11.5.0 Add to IP discovery table. Signed-off-by: Prike Liang Signed-off-by: Alex Deucher commit aba2be41470a11629c8378c3651323d7e5416df6 Author: Lang Yu Date: Fri May 5 09:29:42 2023 +0800 drm/amdgpu: add mmhub 3.3.0 support Add initial implementation for mmhub 3.3.0. v2: squash in client id fix (Alex) Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 1aa68225de2740ee596e0c9b62bc0c121125c80e Author: Lang Yu Date: Fri Jul 14 15:11:09 2023 -0400 drm/amdgpu: add mmhub 3.3.0 headers Add new headers. v2: updates (Alex) Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit b5549a2df030d2d029cd4622c670361b76a9d0c3 Author: Prike Liang Date: Fri Jul 14 16:04:49 2023 -0400 drm/amdgpu/discovery: enable gfx11 for GC 11.5.0 Add to IP discovery table. Signed-off-by: Prike Liang Signed-off-by: Alex Deucher commit d3ff0189c1be1f8da64c39248389fbc8f0f09d13 Author: Lang Yu Date: Wed Jul 6 15:46:47 2022 +0800 drm/amdgpu/discovery: enable mes block for gc 11.5.0 Add to IP discovery table. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 10c9d8691851aeb77b8ba9c7d76381734bc84558 Author: Aaron Liu Date: Thu May 25 13:23:51 2023 +0800 drm/amdgpu: add mes firmware support for gc_11_5_0 Add scheduler and kiq firmware support for gc_11_5_0. Signed-off-by: Aaron Liu Signed-off-by: Alex Deucher commit d717da1775ca2b4329ac1daf8790f743fe2f935b Author: Aaron Liu Date: Thu May 25 13:22:42 2023 +0800 drm/amdgpu: add imu firmware support for gc_11_5_0 Add imu firmware support for gc_11_5_0. Signed-off-by: Aaron Liu Signed-off-by: Alex Deucher commit afac198cd11767c9b82b6b37ebef8d3b753c071a Author: Lang Yu Date: Fri Aug 12 09:24:12 2022 +0800 drm/amdkfd: add KFD support for GC 11.5.0 Enable KFD for GC 11.5.0. Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit 8e42b463dfa94d60e2b3cff36c139e6dd83cbdc9 Author: Aaron Liu Date: Mon May 22 12:53:50 2023 +0800 drm/amdgpu: add golden setting for gc_11_5_0 Initialize golden setting for gc_11_5_0. v2: squash in latest golden updates (Alex) v3: squash in checkpatch fix (Alex) Signed-off-by: Aaron Liu Signed-off-by: Alex Deucher commit 15e7cbd91de6b039fb560b29368c53377451eb1b Author: Prike Liang Date: Mon May 30 11:19:51 2022 +0800 drm/amdgpu/gfx11: initialize gfx11.5.0 Initalize gfx 11.5.0 and set gfx hw configuration. Signed-off-by: Prike Liang Signed-off-by: Alex Deucher commit dd5a326155ca9826eff97071fa65db04354eb51e Author: Prike Liang Date: Fri Jul 14 16:13:27 2023 -0400 drm/amdgpu/gmc11: initialize GMC for GC 11.5.0 memory support Initialize vram attribute and VMHUB for GC 11.5.0. Signed-off-by: Prike Liang Signed-off-by: Alex Deucher commit bfb1ee945140d04ca96db505d2ffcedbc7f49eed Author: Lang Yu Date: Fri Jul 14 14:59:08 2023 -0400 drm/amdgpu: add gc headers for gc 11.5.0 Add gc_11_5_0 headers. v2: updates (Alex) Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit d9d6833442b2d0dfebc28cc3044bb0c326e7253e Author: Prike Liang Date: Tue May 24 11:17:29 2022 +0800 drm/amdgpu/discovery: add nbio 7.11.0 support Add to IP discovery table. Signed-off-by: Prike Liang Signed-off-by: Alex Deucher commit e44d856eaa3dbcf1f5237525baff14111e05d940 Author: benl Date: Tue May 9 17:07:25 2023 +0800 drm/amdgpu: add nbio 7.11 support Add initial nbio 7.11 implementation. Signed-off-by: benl Signed-off-by: Alex Deucher commit ca8c68142ad8148a9ee1e3bfbcb916ea5c2b9cf8 Author: benl Date: Fri Jul 14 15:37:40 2023 -0400 drm/amdgpu: add nbio 7.11 registers Add register headers. v2: Updates (Alex) v3: Updates (Alex) v4: Updates (Alex) Signed-off-by: benl Signed-off-by: Alex Deucher commit bb7249ee45ff3133d4b531bb7bea3b979cc83e52 Author: Prike Liang Date: Fri Jul 14 16:01:27 2023 -0400 drm/amdgpu/discovery: enable soc21 support Add 11.5.0 to IP discovery table. Signed-off-by: Prike Liang Signed-off-by: Alex Deucher commit 0d1db799e7a8ba5faad60d81f7e714465b6b6944 Author: Prike Liang Date: Tue May 24 16:22:21 2022 +0800 drm/amdgpu/soc21: add initial GC 11.5.0 soc21 support Disable clock gating and power gating on the early bring up phase. Signed-off-by: Prike Liang Signed-off-by: Alex Deucher commit 2c8a7ca164171d8e9895a0f84da660559e8e414e Author: Prike Liang Date: Fri Jul 14 15:53:40 2023 -0400 drm/amdgpu: add new AMDGPU_FAMILY definition add GC 11.5.0 family Signed-off-by: Prike Liang Signed-off-by: Alex Deucher commit f56c1941ebb729955e73e4dac5e03cc1926326d9 Author: Lang Yu Date: Wed Jul 19 12:32:01 2023 +0800 drm/amdgpu: use 6.1.0 register offset for HDP CLK_CNTL Use 6.1.0 register offset and remove unused variable. v2: clean up logic (Alex) Signed-off-by: Lang Yu Signed-off-by: Alex Deucher commit dd05484f99d16715a88eedfca363828ef9a4c2d4 Author: Konstantin Meskhidze Date: Thu Aug 17 19:33:49 2023 +0800 drm/radeon: possible buffer overflow Buffer 'afmt_status' of size 6 could overflow, since index 'afmt_idx' is checked after access. Fixes: 5cc4e5fc293b ("drm/radeon: Cleanup HDMI audio interrupt handling for evergreen") Co-developed-by: Ivanov Mikhail Signed-off-by: Konstantin Meskhidze Signed-off-by: Alex Deucher commit 95dd6efc6bd322cf6268b41cf635281704d827fe Author: Hamza Mahfooz Date: Fri Aug 18 09:11:11 2023 -0400 drm/amd/display: fix mode scaling (RMX_.*) As made mention of in commit 4a2df0d1f28e ("drm/amd/display: Fixed non-native modes not lighting up"), we shouldn't call drm_mode_set_crtcinfo() once the crtc timings have been decided. Since, it can cause settings to be unintentionally overwritten. So, since dm_state is never NULL now, we can use old_stream to determine if we should call drm_mode_set_crtcinfo() because we only need to set the crtc timing parameters for entirely new streams. Cc: Harry Wentland Cc: Rodrigo Siqueira Fixes: bd49f19039c1 ("drm/amd/display: Always set crtcinfo from create_stream_for_sink") Reviewed-by: Harry Wentland Signed-off-by: Hamza Mahfooz Signed-off-by: Alex Deucher commit d28e6d5aab475eac7b8e72a278f792c3712b2d5f Author: Asad Kamal Date: Fri Aug 18 18:23:36 2023 +0800 drm/amd/pm: Fix critical temp unit of SMU v13.0.6 Critical Temperature needs to be reported in millidegree Celsius. Signed-off-by: Asad Kamal Reviewed-by: Yang Wang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 559259362e5a062c2702a19c6cb562e510deb778 Author: Mangesh Gadre Date: Wed Aug 16 12:57:28 2023 +0800 drm/amdgpu: Remove SRAM clock gater override by driver rlc firmware does required setting, driver need not do it. Signed-off-by: Mangesh Gadre Reviewed-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 15c5c5f575140b01c93969a19a7a23c6c097c925 Author: Lijo Lazar Date: Wed Jul 19 13:03:25 2023 +0530 drm/amdgpu: Add bootloader status check Add a function to wait till bootloader has reached steady state. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Asad Kamal Tested-by: Asad Kamal Signed-off-by: Alex Deucher commit 0bc119fa2ebecd5a42a37fb22f27accb1f0ca75b Author: Horace Chen Date: Thu Aug 17 17:38:29 2023 +0800 drm/amdkfd: use correct method to get clock under SRIOV [What] Current SRIOV still using adev->clock.default_XX which gets from atomfirmware. But these fields are abandoned in atomfirmware long ago. Which may cause function to return a 0 value. [How] We don't need to check whether SR-IOV. For SR-IOV one-vf-mode, pm is enabled and VF is able to read dpm clock from pmfw, so we can use dpm clock interface directly. For multi-VF mode, VF pm is disabled, so driver can just react as pm disabled. One-vf-mode is introduced from GFX9 so it shall not have any backward compatibility issue. Signed-off-by: Horace Chen Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit 36b0f88988beecea6723d70fbde5b16939bf7543 Author: Lijo Lazar Date: Fri Jul 14 17:02:45 2023 +0530 drm/amdgpu: Unset baco dummy mode on nbio v7.9 BACO dummy mode could be set under reset conditions and that affects framebuffer access. Check If baco dummy mode is set, unset it if so. Signed-off-by: Lijo Lazar Signed-off-by: Le Ma Reviewed-by: Hawking Zhang Reviewed-by: Asad Kamal Tested-by: Asad Kamal Signed-off-by: Alex Deucher commit 0b9dc439f4046ef9e43f54989f6c3ff6cddc6d1b Author: Alvin Lee Date: Thu Aug 10 11:50:52 2023 -0400 drm/amd/display: Write flip addr to scratch reg for subvp [Description] SubVP needs to "calculate" the earliest in use META address by using the current primary / meta addresses, but this leads to a race condition where FW and driver can read/write the address at the same time and intermittently produce inconsistent address offsets. To mitigate this issue without locking (too slow), save each surface flip addr into scratch registers and use this to keep track of the earliest in use META addres. Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Alvin Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ec4247823bbc88a7ee81fec579d1b4408bba686d Author: ChunTao Tso Date: Fri Aug 4 14:57:44 2023 +0800 drm/amd/display: set minimum of VBlank_nom [Why] If VBlank_nom is too small, it will cause VStartUP_Start smaller than VBackPorch + VSync width which is an invalid case for VStartUP_Start and where to send AS-SDP. [How] Setup a minimum value to VBlank_nom Reviewed-by: Reza Amini Acked-by: Wayne Lin Signed-off-by: ChunTao Tso Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3ea69187349283b2258e5aedb28f203181a1d488 Author: Reza Amini Date: Fri Jul 14 10:43:05 2023 -0400 drm/amd/display: Correct unit conversion for vstartup [why] vstartup is calculated to be a large number. it works because it is within vertical blank, but it reduces region of blank that can be used for power gating. [how] Calculation needs to convert micro seconds to number of vertical lines. Reviewed-by: Kazlauskas Nicholas Acked-by: Wayne Lin Signed-off-by: Reza Amini Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 65d1f8896e4cd41af2a0b3d2d14749871e287be2 Author: Ovidiu Bunea Date: Wed Aug 9 11:55:14 2023 -0400 drm/amd/display: Roll back unit correction [why] This Unit correction exposes a Replay corruption. [how] This reverts commit: commit dbd29029c7b5 ("drm/amd/display: Correct unit conversion for vstartup") Roll back unit conversion until Replay can fix their corruption. Fixes: dbd29029c7b5 ("drm/amd/display: Correct unit conversion for vstartup") Reviewed-by: Reza Amini Acked-by: Wayne Lin Signed-off-by: Ovidiu Bunea Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 96182df99dadd4b59b7338b29bf45a90ad722625 Author: Aurabindo Pillai Date: Tue Aug 8 16:25:59 2023 -0400 drm/amd/display: Enable runtime register offset init for DCN32 DMUB [Why&How] DMUB subsystem was continuing to use compile time offset calculation for register access. Switch this to runtime calculation to stay consistent with rest of DC code. To enable this, an additional interface init_reg_offsets() are added to DMUB's hw_funcs struct. Asics with runtime register offset calculation enabled shall populate this hook with a fn pointer that will invoke the necessary macros to calculate the offset. Reviewed-by: Alvin Lee Acked-by: Wayne Lin Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 45f98fccb1f6895f527bd5f811f23478c2f920f5 Author: Ian Chen Date: Tue Jul 4 15:31:43 2023 +0800 drm/amd/display: Refactor edp power control [Why & How] To organize the edp power control a bit: 1. add flag in dc_link to indicate dc to skip all implicit eDP power control. 2. add edp_set_panel_power link service for DM to call. Reviewed-by: Aric Cyr Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Ian Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 959d2fc47f14f7f5ab3f74530e80c9407ced91f2 Author: Krunoslav Kovac Date: Tue Aug 8 16:38:56 2023 -0400 drm/amd/display: PQ regamma end point [WHY & HOW] PQ has a fixed range of 0-10,000 nits. Using 1=80 nits normalization, PQ should map to 1.0 for X=125.0 HW LUT used for interpolation does not have X=125 so it's interpolated. However, we cap Y to 1 for all X>=125. The closest larger HW point is 128. What we want is Y(128) such that interpolation through 125 gives 1.0. Such value is ~1.00256. Another change is to hardcode PQ table, we pretty much always have 1=80 normalization so the table can be static. Reviewed-by: Aric Cyr Acked-by: Wayne Lin Signed-off-by: Krunoslav Kovac Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4d5fd3d08ea9926fb2031ff7cfb4d72b7c950301 Author: Krunoslav Kovac Date: Tue Aug 8 14:33:42 2023 -0400 drm/amd/display: PQ tail accuracy [WHY & HOW] HW LUTs changed slightly in DCN3: 256 base+slope pairs were replaced by 257 bases. Code was still calculating all 256 base+slope and then creating 257th pt as last base + last slope. This was done in wrong format, and then "fixed" it by making the last two points the same thus making the last slope=0. However, this also created some precision problems near the end that are not visible but they do show up with capture cards. Solution is to calculate 257 and remove deltas since we no longer have those HW registers. Reviewed-by: Anthony Koo Acked-by: Wayne Lin Signed-off-by: Krunoslav Kovac Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 53d8e3beeaa92d916546abb4c4ac2b88d5a5b3f8 Author: Aurabindo Pillai Date: Fri Aug 4 11:07:59 2023 -0400 drm/amd/display: Expose mall capability [Why&How] Export a debugfs file to report whether MALL cache is supported by the asic or not. Reviewed-by: Hersen Wu Acked-by: Wayne Lin Signed-off-by: Aurabindo Pillai Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c183060031ee70b7641de260207b3013eebf5707 Author: Srinivasan Shanmugam Date: Wed Aug 16 12:16:26 2023 +0530 drm/amd/display: Fix useless else if in display_mode_vba_util_32.c The assignment of the else if and else branches is the same, so the else if here is redundant, hence removed it. Fixes the below: drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c:4664:8-10: WARNING: possible condition with no effect (if == else) Cc: Hamza Mahfooz Cc: Harry Wentland Cc: Rodrigo Siqueira Cc: Aurabindo Pillai Cc: Alex Deucher Cc: Christian König Signed-off-by: Srinivasan Shanmugam Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 80578f1641aaba95c70adc40d84d1b619e92f2d4 Author: YiPeng Chai Date: Tue Aug 15 17:39:30 2023 +0800 drm/amdgpu: Enable ras for mp0 v13_0_6 sriov Enable ras for mp0 v13_0_6 sriov Signed-off-by: YiPeng Chai Reviewed-by: Stanley.Yang Signed-off-by: Alex Deucher commit 01175474322a49e12c29f742bdd365027bd43cd6 Author: Srinivasan Shanmugam Date: Wed Aug 9 12:39:22 2023 +0530 drm/radeon: Cleanup radeon/radeon_fence.c Fixes the following: WARNING: Possible repeated word: 'Fences' WARNING: Missing a blank line after declarations WARNING: braces {} are not necessary for single statement blocks WARNING: braces {} are not necessary for any arm of this statement WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: quoted string split across lines WARNING: Block comments use * on subsequent lines WARNING: Block comments use a trailing */ on a separate line Cc: Guchun Chen Cc: Christian König Cc: Alex Deucher Cc: "Pan, Xinhui" Signed-off-by: Srinivasan Shanmugam Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 176b9dd27634188d8b90c5c197a633f98a184925 Author: Srinivasan Shanmugam Date: Sun Aug 13 13:59:25 2023 +0530 drm/amd/display: Fix unnecessary conversion to bool in 'amdgpu_dm_setup_replay' Fixes the following coccicheck: drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_replay.c:94:102-107: WARNING: conversion to bool not needed here drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_replay.c:102:72-77: WARNING: conversion to bool not needed here Cc: Bhawanpreet Lakha Cc: Harry Wentland Cc: Rodrigo Siqueira Cc: Aurabindo Pillai Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Christian König Signed-off-by: Alex Deucher commit ebac9414a56a5f7c336db5f5c7cc34713b649407 Author: Alex Sierra Date: Tue Aug 15 15:42:52 2023 -0500 drm/amdkfd: retry after EBUSY is returned from hmm_ranges_get_pages if hmm_range_get_pages returns EBUSY error during svm_range_validate_and_map, within the context of a page fault interrupt. This should retry through svm_range_restore_pages callback. Therefore we treat this as EAGAIN error instead, and defer it to restore pages fallback. Signed-off-by: Alex Sierra Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 00481158ca02d09c24edf5721094ab88e1477549 Author: Samir Dhume Date: Wed Aug 16 15:28:17 2023 -0400 drm/amdgpu/jpeg - skip change of power-gating state for sriov Powergating is handled in the host driver. Reviewed-by: Zhigang Luo Signed-off-by: Samir Dhume Signed-off-by: Alex Deucher commit f8a499aed290667bd37011ad534c66320dc48257 Author: Lijo Lazar Date: Sat Aug 5 15:27:01 2023 +0530 drm/amdgpu: Keep reset handlers shared Instead of maintaining a list per device, keep the reset handlers common per ASIC family. A pointer to the list of handlers is maintained in reset control. Signed-off-by: Lijo Lazar Reviewed-by: Le Ma Reviewed-by: Asad Kamal Tested-by: Asad Kamal Signed-off-by: Alex Deucher commit 078649113570c001d6543a8c7eab32282031064a Author: Asad Kamal Date: Sat Aug 12 22:22:10 2023 +0800 drm/amd/pm: Add critical temp for GC v9.4.3 Add critical temperature message support func for smu v13.0.6 and expose critical temperature as part of hw mon attributes for GC v9.4.3 v2: Added comment for pmfw version requirement & move the check to get_thermal_temperature_range function Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 709c280ad5264790b898620d901245f4b99218b5 Author: Asad Kamal Date: Sat Aug 12 21:42:20 2023 +0800 drm/amd/pm: Update SMUv13.0.6 PMFW headers Update PMFW interface headers for updated metrics table and critical temperature message Signed-off-by: Asad Kamal Reviewed-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit e240020ad1e595dd9cee6fa398207a1bf46f6646 Author: Le Ma Date: Mon Aug 14 18:37:28 2023 +0800 drm/amdgpu: update gc_info v2_1 from discovery Several new fields are exposed in gc_info v2_1 Signed-off-by: Le Ma Reviewed-by: Shiwu Zhang Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit f489a41998ac48abe24a5b80d610240d23296454 Author: Le Ma Date: Mon Aug 14 16:27:59 2023 +0800 drm/amdgpu: update mall info v2 from discovery Mall info v2 is introduced in ip discovery Signed-off-by: Le Ma Reviewed-by: Shiwu Zhang Reviewed-by: Hawking Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 46963ed58545284ada1b73e63f1eab73c87ceb24 Author: Candice Li Date: Wed Aug 16 21:33:04 2023 +0800 drm/amdgpu: Only support RAS EEPROM on dGPU platform RAS EEPROM device is only supported on dGPU platform for smu v13_0_6. Signed-off-by: Candice Li Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit f33647b9e1b098181fb7c6a95afe8043285bfea8 Author: Lijo Lazar Date: Wed Aug 16 09:07:42 2023 +0530 Documentation/gpu: Update amdgpu documentation 7957ec80ef97 ("drm/amdgpu: Add FRU sysfs nodes only if needed") moved the documentation for some of the sysfs nodes to amdgpu_fru_eeprom.c. Update the documentation accordingly. Signed-off-by: Lijo Lazar Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit d903af1a918fa1be628ad9c2a4412293c861cd6c Author: Chen Jiahao Date: Wed Aug 16 10:19:58 2023 +0800 drm/amd/amdgpu: Use kmemdup to simplify kmalloc and memcpy logic Using kmemdup() helper function rather than implementing it again with kmalloc() + memcpy(), which improves the code readability. Signed-off-by: Chen Jiahao Signed-off-by: Alex Deucher commit 5465e7b87f589a6e89e73c24371a84c265232230 Author: Bokun Zhang Date: Mon Aug 14 17:06:45 2023 -0400 drm/amdgpu/pm: Add notification for no DC support - There is a DPM issue where if DC is not present, FCLK will stay at low level. We need to send a SMU message to configure the DPM - Reuse smu_v13_0_notify_display_change() for this purpose Reviewed-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Bokun Zhang Signed-off-by: Alex Deucher commit 3cce0bfcd0f90a6b0e4747172b9f3d61925a1932 Author: Bhawanpreet Lakha Date: Tue May 16 12:21:19 2023 -0400 drm/amd/display: Enable Replay for static screen use cases - Setup replay config on device init. - Enable replay if feature is enabled (prioritize replay over PSR, since it can be enabled in more usecases) - Add debug masks to enable replay on supported ASICs Signed-off-by: Bhawanpreet Lakha Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 84bd5e9685948dfded818d35eeceab35f6e42f71 Author: Swati Sharma Date: Tue Aug 29 19:29:45 2023 +0530 drm/i915/dg2: Add support for new DG2-G12 revid 0x1 The bspec has been updated with a new revision 0x1 that translates to A1 GT stepping and C0 display stepping. Bspec: 44477 Signed-off-by: Swati Sharma Reviewed-by: Matt Roper Signed-off-by: Animesh Manna Link: https://patchwork.freedesktop.org/patch/msgid/20230829135945.1201574-1-swati2.sharma@intel.com commit 280410677af763f3871b93e794a199cfcf6fb580 Author: Andrzej Hajda Date: Mon Aug 21 17:30:35 2023 +0200 drm/i915: mark requests for GuC virtual engines to avoid use-after-free References to i915_requests may be trapped by userspace inside a sync_file or dmabuf (dma-resv) and held indefinitely across different proceses. To counter-act the memory leaks, we try to not to keep references from the request past their completion. On the other side on fence release we need to know if rq->engine is valid and points to hw engine (true for non-virtual requests). To make it possible extra bit has been added to rq->execution_mask, for marking virtual engines. Fixes: bcb9aa45d5a0 ("Revert "drm/i915: Hold reference to intel_context over life of i915_request"") Signed-off-by: Chris Wilson Signed-off-by: Andrzej Hajda Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230821153035.3903006-1-andrzej.hajda@intel.com commit a10ca2afb8d3c055b3eae6aecd0c944185c99e48 Author: Ankit Nautiyal Date: Thu Aug 24 18:21:21 2023 +0530 drivers/drm/i915: Honor limits->max_bpp while computing DSC max input bpp Edid specific BPC constraints are stored in limits->max_bpp. Honor these limits while computing the input bpp for DSC. v2: Use int instead of u8 for computations. (Jani) Add closes tag. (Ankit) Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9161 Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230824125121.840298-3-ankit.k.nautiyal@intel.com commit 10eaac085bfe0b3cf7ffd7406375d3f3bc817a95 Author: Ankit Nautiyal Date: Thu Aug 24 18:21:20 2023 +0530 drm/display/dp: Assume 8 bpc support when DSC is supported As per DP v1.4, a DP DSC Sink device shall support 8bpc in DPCD 6Ah. Apparently some panels that do support DSC, are not setting the bit for 8bpc. So always assume 8bpc support by DSC decoder, when DSC is claimed to be supported. v2: Use helper to get check dsc support. (Ankit) v3: Fix styling and other typos. (Jani) Signed-off-by: Ankit Nautiyal Acked-by: Maxime Ripard Reviewed-by: Stanislav Lisovskiy Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230824125121.840298-2-ankit.k.nautiyal@intel.com commit b3bca7b8fa7c5d81c0b4bc0762aee6ca1424d72c Author: Jouni Högander Date: Tue Aug 29 12:44:35 2023 +0300 drm/i915/psr: Apply Wa_14015648006 for all display 14 steppings According to recent Bspec Wa 14015648006 has to be applied for all display 14 steppings. Bspec: 66624 Signed-off-by: Jouni Högander Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230829094435.2100669-1-jouni.hogander@intel.com commit 97588df87b56e27fd2b5d928d61c7a53e38afbb0 Author: Kan Liang Date: Tue Aug 29 05:58:06 2023 -0700 perf/x86/intel: Add common intel_pmu_init_hybrid() The current hybrid initialization codes aren't well organized and are hard to read. Factor out intel_pmu_init_hybrid() to do a common setup for each hybrid PMU. The PMU-specific capability will be updated later via either hard code (ADL) or CPUID hybrid enumeration (MTL). Splitting the ADL and MTL initialization codes, since they have different uarches. The hard code PMU capabilities are not required for MTL either. They can be enumerated by the new leaf 0x23 and IA32_PERF_CAPABILITIES MSR. The hybrid enumeration of the IA32_PERF_CAPABILITIES MSR is broken on MTL. Using the default value. Signed-off-by: Kan Liang Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230829125806.3016082-7-kan.liang@linux.intel.com commit b0560bfd4b70277a4936c82e50e940aa253c95bf Author: Kan Liang Date: Tue Aug 29 05:58:05 2023 -0700 perf/x86/intel: Clean up the hybrid CPU type handling code There is a fairly long list of grievances about the current code. The main beefs: 1. hybrid_big_small assumes that the *HARDWARE* (CPUID) provided core types are a bitmap. They are not. If Intel happened to make a core type of 0xff, hilarity would ensue. 2. adl_get_hybrid_cpu_type() utterly inscrutable. There are precisely zero comments and zero changelog about what it is attempting to do. According to Kan, the adl_get_hybrid_cpu_type() is there because some Alder Lake (ADL) CPUs can do some silly things. Some ADL models are *supposed* to be hybrid CPUs with big and little cores, but there are some SKUs that only have big cores. CPUID(0x1a) on those CPUs does not say that the CPUs are big cores. It apparently just returns 0x0. It confuses perf because it expects to see either 0x40 (Core) or 0x20 (Atom). The perf workaround for this is to watch for a CPU core saying it is type 0x0. If that happens on an Alder Lake, it calls x86_pmu.get_hybrid_cpu_type() and just assumes that the core is a Core (0x40) CPU. To fix up the mess, separate out the CPU types and the 'pmu' types. This allows 'hybrid_pmu_type' bitmaps without worrying that some future CPU type will set multiple bits. Since the types are now separate, add a function to glue them back together again. Actual comment on the situation in the glue function (find_hybrid_pmu_for_cpu()). Also, give ->get_hybrid_cpu_type() a real return type and make it clear that it is overriding the *CPU* type, not the PMU type. Rename cpu_type to pmu_type in the struct x86_hybrid_pmu to reflect the change. Originally-by: Dave Hansen Signed-off-by: Kan Liang Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230829125806.3016082-6-kan.liang@linux.intel.com commit 299a5fc8e783eed705015e83e381912dbbf3eabc Author: Kan Liang Date: Tue Aug 29 05:58:04 2023 -0700 perf/x86/intel: Apply the common initialization code for ADL Use the intel_pmu_init_glc() and intel_pmu_init_grt() to replace the duplicate code for ADL. The current code already checks the PERF_X86_EVENT_TOPDOWN flag before invoking the Topdown metrics functions. (The PERF_X86_EVENT_TOPDOWN flag is to indicate the Topdown metric feature, which is only available for the p-core.) Drop the unnecessary adl_set_topdown_event_period() and adl_update_topdown_event(). Signed-off-by: Kan Liang Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230829125806.3016082-5-kan.liang@linux.intel.com commit d87d221f854b62f5e8026505497d33404ef6050c Author: Kan Liang Date: Tue Aug 29 05:58:03 2023 -0700 perf/x86/intel: Factor out the initialization code for ADL e-core From PMU's perspective, the ADL e-core and newer SRF/GRR have a similar uarch. Most of the initialization code can be shared. Factor out intel_pmu_init_grt() for the common initialization code. The common part of the ADL e-core will be replaced by the later patch. Signed-off-by: Kan Liang Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230829125806.3016082-4-kan.liang@linux.intel.com commit 0ba0c03528e918a8f6b5aa63d502fdc6a9d80fc7 Author: Kan Liang Date: Tue Aug 29 05:58:02 2023 -0700 perf/x86/intel: Factor out the initialization code for SPR The SPR and ADL p-core have a similar uarch. Most of the initialization code can be shared. Factor out intel_pmu_init_glc() for the common initialization code. The common part of the ADL p-core will be replaced by the later patch. Signed-off-by: Kan Liang Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230829125806.3016082-3-kan.liang@linux.intel.com commit d4b5694c75d4eba8238d541a55da0c67e876213e Author: Kan Liang Date: Tue Aug 29 05:58:01 2023 -0700 perf/x86/intel: Use the common uarch name for the shared functions From PMU's perspective, the SPR/GNR server has a similar uarch to the ADL/MTL client p-core. Many functions are shared. However, the shared function name uses the abbreviation of the server product code name, rather than the common uarch code name. Rename these internal shared functions by the common uarch name. Signed-off-by: Kan Liang Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230829125806.3016082-2-kan.liang@linux.intel.com commit 7467e1da906468bcbd311023b30708193103ecf9 Author: Tejas Upadhyay Date: Mon Aug 28 12:04:50 2023 +0530 drm/i915/mtl: Update workaround 14016712196 Now this workaround is permanent workaround on MTL and DG2, earlier we used to apply on MTL A0 step only. VLK-45480 Fixes: d922b80b1010 ("drm/i915/gt: Add workaround 14016712196") Signed-off-by: Tejas Upadhyay Acked-by: Nirmoy Das Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230828063450.2642748-1-tejas.upadhyay@intel.com commit 9c7e9db11aefd1099689a3519cdcf4b0945338ec Author: Ville Syrjälä Date: Fri Aug 25 16:44:31 2023 +0300 drm/i915/sdvo: Print out the i2c pin and slave address To reduce the guesswork a bit let's print out the SDVO device i2c bus and slave address during init. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230825134431.24391-7-ville.syrjala@linux.intel.com commit c0ff6c6e4c2486734d417a61355e1da5d8773039 Author: Ville Syrjälä Date: Fri Aug 25 16:44:30 2023 +0300 drm/i915/sdvo: Rework DDC bus handling Each SDVO device can have up to three sets of DDC pins. Currently we just register a single i2c_adapter for the entire SDVO device and semi-randomly pick the "correct" set of DDC pins during intel_sdvo_tmds_sink_detect(). This doesn't make any real sense especially if we have multiple outputs each with their own dedicated DDC bus. Let's clean up this mess and register a dedicated i2c_adapter for each of the possible pin pairs. Each output (ie. connector) can then pick the correct i2c_adapter to use for its DDC bus. And we can just switch over to drm_connector_init_with_ddc() to take care of the connector->ddc association, which also populates the "ddc" sysfs symlink as a bonus. And now that things are based on the actual connector we can also nuke the sketchy sdvo->controller_output thing. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230825134431.24391-6-ville.syrjala@linux.intel.com commit 5bb306b1d1412c9a42dd4f6534b0033eb36f2bda Author: Ville Syrjälä Date: Fri Aug 25 16:44:29 2023 +0300 drm/i915/sdvo: Get rid of the per-connector i2c symlink We should switch over to the standard "ddc" per-connector symlink instead of rolling our own thing. The i2c specific symlink is also in the way of reworking the SDVO DDC handling (which is a mess atm) so get rid of it. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230825134431.24391-5-ville.syrjala@linux.intel.com commit c6eddd311da44da95a8b4dfbfa33c3b9b66f3042 Author: Ville Syrjälä Date: Fri Aug 25 16:44:28 2023 +0300 drm/i915/sdvo: Nuke the duplicate sdvo->port We already have encoder->port so get rid of the duplicate sdvo->port. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230825134431.24391-4-ville.syrjala@linux.intel.com commit 0eb8252a6f795a439ffca424d474f840a39a58d2 Author: Ville Syrjälä Date: Fri Aug 25 16:44:27 2023 +0300 drm/i915/sdvo: Initialize the encoder earlier Call drm_encoder_init() earlier so that we don't have to keep passing the i915/dev_priv around separately. v2: Reorder drm_encoder_cleanup() in the error path (Jani) Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230825134431.24391-3-ville.syrjala@linux.intel.com commit 31ea78571e0db5f8a49411389a33fa684b82367e Author: Ville Syrjälä Date: Fri Aug 25 16:44:26 2023 +0300 drm/i915/sdvo: Nuke attached_output tracking Instead of operating on the output the user specified (via the connector) the current code tends to operate on whichever outputs it has detected as attached. That is not how the kms uapi is supposed to work. So simply get rid of attached_outputs and instead directly operate on the output the user has specified. Acked-by: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230825134431.24391-2-ville.syrjala@linux.intel.com commit 3974f9c17bb963fadecd88c878d564d9fce21c5e Author: Suraj Kandpal Date: Mon Aug 28 12:04:01 2023 +0530 drm/i915/hdcp: Adjust timeout for read in DPMST Scenario For dpmst hdcp scenario increase the message timeout based on the number of ports connected as each port needs to be validated and each will take the prescribed amount of time for the respective msg_id and total timeout will be original_timeout * num_ports. --v2 -Add justification for Adjusting the timeout [Arun] Signed-off-by: Suraj Kandpal Reviewed-by: Arun R Murthy Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20230828063401.600414-5-suraj.kandpal@intel.com commit ae4f902bb344627b82396c0c2aefbc7218c05bee Author: Suraj Kandpal Date: Mon Aug 28 12:04:00 2023 +0530 drm/i915/hdcp: Send the correct aux for DPMST HDCP scenario Up until now we were sending the base aux stored in dig_port which is not correct as this causes an issue when monitor is connected via a DPMST hub causing it to be remote hence we end up seeing AUX failures so let's send the remote aux in case of DPMST. Signed-off-by: Suraj Kandpal Reviewed-by: Arun R Murthy Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20230828063401.600414-4-suraj.kandpal@intel.com commit 524240b231ea3da914fecfff15660c4fcbfc0e8e Author: Suraj Kandpal Date: Mon Aug 28 12:08:51 2023 +0530 drm/i915/hdcp: Propagate aux info in DP HDCP functions We were propagating dig_port info to dp hdcp2 specific functions. Let us clean that up and send intel_connector in the following functions: intel_dp_hdcp2_wait_for_msg, get_receiver_id_list_rx_info, intel_dp_hdcp2_read_rx_status. This optimises mst scenarios where aux ends up being remote and not stored in dig_port and dig_port can always be derived from intel_connector if needed. --v2 -Fix Typo [Arun] -Dont pass drm_dp core structures [Arun] -Fix commit message styling [Arun] Signed-off-by: Suraj Kandpal Reviewed-by: Arun R Murthy Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20230828063850.604048-1-suraj.kandpal@intel.com commit 51152acfdcb1b1181fa60d20d9ea15f9b429006e Author: Suraj Kandpal Date: Mon Aug 28 12:03:58 2023 +0530 drm/i915/hdcp: Use intel_connector argument in intel_hdcp_shim Update intel_hdcp_shim funcs specifically read_2_2_message, write_2_2_message and config_stream_type to use intel_connector argument instead of intel_digital_port as this will help in getting correct aux later for dp mst scenarios also already hdcp funcs derive digital_port from connector and then many funcs again get back the connector from dig_port which doesn't seem right. Connector specific hdcp functions can derive dig_port on need basis. Signed-off-by: Suraj Kandpal Reviewed-by: Arun R Murthy Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20230828063401.600414-2-suraj.kandpal@intel.com commit e427343185583123fd3485ca7ca595325e589429 Author: Daniele Ceraolo Spurio Date: Fri Aug 25 09:27:53 2023 -0700 drm/i915/gsc: define gsc fw Add FW definition and the matching override modparam. The GSC FW has both a release version, based on platform and a rolling counter, and a compatibility version, which is the one tracking interface changes. Since what we care about is the interface, we use the compatibility version in the binary names. Same as with the GuC, a major version bump indicate a backward-incompatible change, while a minor version bump indicates a backward-compatible one, so we use only the former in the file name. Signed-off-by: Daniele Ceraolo Spurio Cc: Alan Previn Cc: John Harrison Cc: Tvrtko Ursulin Cc: Rodrigo Vivi Reviewed-by: Alan Previn Acked-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20230825162754.1949838-1-daniele.ceraolospurio@intel.com commit a5bb8a64025b4457ead9f588933536795c210f35 Author: Thomas Zimmermann Date: Sun Aug 6 13:59:02 2023 +0200 fbdev/tcx: Use initializer macro for struct fb_ops Initialize struct fb_ops to the correct default values with the macro FB_DEFAULT_SBUS_OPS(). Rename the ioctl and mmap callbacks to use the infix _sbusfb_. This makes them fit the SBUS helpers' naming pattern. Also make the driver depend on FB_SBUS_HELPERS, which selects the correct modules. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-12-tzimmermann@suse.de commit d1ed0f1d2a047035fcfc9f62a2423c7ee2d057f4 Author: Thomas Zimmermann Date: Sun Aug 6 13:59:01 2023 +0200 fbdev/p9100: Use initializer macro for struct fb_ops Initialize struct fb_ops to the correct default values with the macro FB_DEFAULT_SBUS_OPS(). Rename the ioctl and mmap callbacks to use the infix _sbusfb_. This makes them fit the SBUS helpers' naming pattern. Also make the driver depend on FB_SBUS_HELPERS, which selects the correct modules. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-11-tzimmermann@suse.de commit 10ff3e6c8dbb9f1f47eefee842803a7661fd25ee Author: Thomas Zimmermann Date: Sun Aug 6 13:59:00 2023 +0200 fbdev/leo: Use initializer macro for struct fb_ops Initialize struct fb_ops to the correct default values with the macro FB_DEFAULT_SBUS_OPS(). Rename the ioctl and mmap callbacks to use the infix _sbusfb_. This makes them fit the SBUS helpers' naming pattern. Also make the driver depend on FB_SBUS_HELPERS, which selects the correct modules. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-10-tzimmermann@suse.de commit aee3c3119fd5c3c3a3442b7056a2bf08163a8fd7 Author: Thomas Zimmermann Date: Sun Aug 6 13:58:59 2023 +0200 fbdev/ffb: Use initializer macro for struct fb_ops Initialize struct fb_ops to the correct default values with the internal __FB_DEFAULT_SBUS_OPS_*() macros. Rename the ioctl and mmap callbacks to use the infix _sbusfb_. This makes them fit the SBUS helpers' naming pattern. It is not possible to use set all defaults via FB_DEAFULT_SBUS_OPS(), as ffb provides its own implementation of fb_fillrect, fb_copyarea, and fb_imageblit. Hence we also avoid FB_SBUS_HELPERS, but let the driver select its dependencies individually instead. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-9-tzimmermann@suse.de commit 17397471d80ec0aa058d3cd1767aca8caa7e291f Author: Thomas Zimmermann Date: Sun Aug 6 13:58:58 2023 +0200 fbdev/cg6: Use initializer macro for struct fb_ops Initialize struct fb_ops to the correct default values with the internal __FB_DEFAULT_SBUS_OPS_*() macros. Rename the ioctl and mmap callbacks to use the infix _sbusfb_. This makes them fit the SBUS helpers' naming pattern. It is not possible to use set all defaults via FB_DEAFULT_SBUS_OPS(), as cg6 provides its own implementation of fb_fillrect, fb_copyarea, and fb_imageblit. Hence we also avoid FB_SBUS_HELPERS, but let the driver select its dependencies individually instead. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-8-tzimmermann@suse.de commit 6e4241347b656e43c73ce6ebfb5f2961f0cdf4a0 Author: Thomas Zimmermann Date: Sun Aug 6 13:58:57 2023 +0200 fbdev/cg3: Use initializer macro for struct fb_ops Initialize struct fb_ops to the correct default values with the macro FB_DEFAULT_SBUS_OPS(). Rename the ioctl and mmap callbacks to use the infix _sbusfb_. This makes them fit the SBUS helpers' naming pattern. Also make the driver depend on FB_SBUS_HELPERS, which selects the correct modules. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-7-tzimmermann@suse.de commit 1d3bba30ded24c8916fc65cacf5ff16c3d642f81 Author: Thomas Zimmermann Date: Sun Aug 6 13:58:56 2023 +0200 fbdev/cg14: Use initializer macro for struct fb_ops Initialize struct fb_ops to the correct default values with the macro FB_DEFAULT_SBUS_OPS(). Rename the ioctl and mmap callbacks to use the infix _sbusfb_. This makes them fit the SBUS helpers' naming pattern. Also make the driver depend on FB_SBUS_HELPERS, which selects the correct modules. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-6-tzimmermann@suse.de commit 3409343341b10eb99c8bf1eb46a2c49e9cdd786d Author: Thomas Zimmermann Date: Sun Aug 6 13:58:55 2023 +0200 fbdev/bw2: Use initializer macro for struct fb_ops Initialize struct fb_ops to the correct default values with the macro FB_DEFAULT_SBUS_OPS(). Rename the ioctl and mmap callbacks to use the infix _sbusfb_. This makes them fit the SBUS helpers' naming pattern. Also make the driver depend on FB_SBUS_HELPERS, which selects the correct modules. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-5-tzimmermann@suse.de commit cbe606f304ec188b90e0b9f8b3e8b37d57553f81 Author: Thomas Zimmermann Date: Sun Aug 6 13:58:54 2023 +0200 fbdev/sbus: Add initializer macros and Kconfig tokens for SBUS support Add macros to initialize struct fb_ops for drivers that support framebuffers on Sparc's SBUS. Also add a Kconfig token that selects the necessary helpers. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-4-tzimmermann@suse.de commit d3aeac86883ef5481a4bff87cbd955b10ca97c72 Author: Thomas Zimmermann Date: Sun Aug 6 13:58:53 2023 +0200 fbdev/sbus: Forward declare all necessary structures in header In sbuslib.h, declare all of the header file's structs at the top. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-3-tzimmermann@suse.de commit c18df7e69cbcf2e7a6cf069e12ef9deb83f17ee0 Author: Thomas Zimmermann Date: Sun Aug 6 13:58:52 2023 +0200 fbdev/sbus: Build sbuslib.o if CONFIG_FB_SBUS has been selected Avoid duplicate listings of sbuslib.o in the Makefile by building it if CONFIG_FB_SBUS has been selected. Remove the object file from the various drivers' build rules. Signed-off-by: Thomas Zimmermann Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20230806120926.5368-2-tzimmermann@suse.de commit bb7f98db31b3d4aac30d8b5d1a8f81f738664add Author: Arthur Grillo Date: Mon Aug 14 19:12:05 2023 -0300 drm/tests: Add KUnit tests for drm_fb_memcpy() Insert parameterized test for the drm_fb_memcpy() to ensure correctness and prevent future regressions. The test case can accept different formats. Signed-off-by: Arthur Grillo Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230814-gsoc-drm-format-test-v2-v3-6-bd3e9f9bc2fb@riseup.net commit af4fd86a5c2152131852eaf7f5d1598d9483c3d1 Author: Arthur Grillo Date: Mon Aug 14 19:12:04 2023 -0300 drm/tests: Add multi-plane support to conversion_buf_size() The drm_fb_memcpy() supports multi-plane formats. To fully test it in the future, add multi-plane support to the conversion_buf_size() helper. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230814-gsoc-drm-format-test-v2-v3-5-bd3e9f9bc2fb@riseup.net commit 371e0b186a13558228f07a5cfdaa516e0dd875ce Author: Arthur Grillo Date: Mon Aug 14 19:12:03 2023 -0300 drm/tests: Add KUnit tests for drm_fb_build_fourcc_list() Insert parameterized test for the drm_fb_build_fourcc_list() to ensure correctness and prevent future regressions. Signed-off-by: Arthur Grillo Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230814-gsoc-drm-format-test-v2-v3-4-bd3e9f9bc2fb@riseup.net commit c6099d7ed3db22ff5de791090e2f6fa6372a20da Author: Arthur Grillo Date: Mon Aug 14 19:12:02 2023 -0300 drm/tests: Add KUnit tests for drm_fb_clip_offset() Insert parameterized test for the drm_fb_clip_offset() to ensure correctness and prevent future regressions. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230814-gsoc-drm-format-test-v2-v3-3-bd3e9f9bc2fb@riseup.net commit 97eacd052dad4a3afa2d3d0eca0a065429620565 Author: Arthur Grillo Date: Mon Aug 14 19:12:01 2023 -0300 drm/tests: Add KUnit tests for drm_fb_swab() Insert parameterized test for the drm_fb_swab() to ensure correctness and prevent future regressions. Each expected color has it bytes reversed in order, so xrgb would be bgrx. Signed-off-by: Arthur Grillo Reviewed-by: Maíra Canal Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230814-gsoc-drm-format-test-v2-v3-2-bd3e9f9bc2fb@riseup.net commit ef8e29b16ff1f3295c7d2d5f43722a63f75808d7 Author: Arthur Grillo Date: Mon Aug 14 19:12:00 2023 -0300 drm/tests: Test default pitch fallback Test the default pitch fallback when NULL is passed as the dst_pitch on the conversion procedures. Reviewed-by: Maíra Canal Signed-off-by: Arthur Grillo Signed-off-by: Maíra Canal Link: https://patchwork.freedesktop.org/patch/msgid/20230814-gsoc-drm-format-test-v2-v3-1-bd3e9f9bc2fb@riseup.net commit 24883eb269f087b5d1068833fced543e020296ca Author: Justin Stitt Date: Wed Aug 16 19:55:29 2023 +0000 drm/repaper: fix -Wvoid-pointer-to-enum-cast warning When building with clang 18 I see the following warning: | drivers/gpu/drm/tiny/repaper.c:952:11: warning: cast to smaller integer | type 'enum repaper_model' from 'const void *' [-Wvoid-pointer-to-enum-cast] | 952 | model = (enum repaper_model)match; | This is due to the fact that `match` is a void* while `enum repaper_model` has the size of an int. Add uintptr_t cast to silence clang warning while also keeping enum cast for readability and consistency with other `model` assignment just a few lines below: | model = (enum repaper_model)spi_id->driver_data; Link: https://github.com/ClangBuiltLinux/linux/issues/1910 Reported-by: Nathan Chancellor Signed-off-by: Justin Stitt Signed-off-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20230816-void-drivers-gpu-drm-tiny-repaper-v1-1-9d8d10f0d52f@google.com commit 9af09dfcdfa15490a2ad71acd8c5888f06261ebb Author: Jani Nikula Date: Thu Aug 17 18:53:08 2023 +0300 drm/i915/color: move pre-SKL gamma and CSC enable read to intel_color Abstract the register access better. The DSPCNTR read could be moved to either i9xx_plane.c or intel_color.c. The latter feels better, even if the register is written in the former. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/33830dba5d69027469d976f6909740ccff8c7281.1692287501.git.jani.nikula@intel.com commit f56e23edb1968a35d15909d60f4d8f8982d98add Author: Jani Nikula Date: Thu Aug 17 18:53:07 2023 +0300 drm/i915/color: move SKL+ gamma and CSC enable read to intel_color Abstract the platform specific register access better. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/c0c37c06d1f2673c82d567c8bcbb6b0b0054b5fa.1692287501.git.jani.nikula@intel.com commit cecdea151e78c90016909cd4ffc31e99e1d84ff6 Author: Jani Nikula Date: Thu Aug 17 18:53:06 2023 +0300 drm/i915: move ILK+ CSC mode read to intel_color Abstract the platform specific register access better. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/8f34c577c663839020405e96cdb464319c2881d4.1692287501.git.jani.nikula@intel.com commit efe6fcb2dc27c8256659fec77e3ad781b085ff8c Author: Jani Nikula Date: Thu Aug 17 18:53:05 2023 +0300 drm/i915: move HSW+ gamma mode read to intel_color Abstract the platform specific register access better. The separate hsw_read_gamma_mode() will make more sense with the following changes. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/b7ddcc8b0fb783eb149864070821bdb695c40366.1692287501.git.jani.nikula@intel.com commit 7f52ca642f800962529092f4c18bbcdcecc0d528 Author: Jani Nikula Date: Thu Aug 17 18:53:04 2023 +0300 drm/i915/color: move CHV CGM pipe mode read to intel_color Add color .get_config hook to read config other than LUTs and CSCs, and start off with CHV CGM pipe mode to abstract the platform specific register access better. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/1444200931ae61b6360e3dcad8cbea206ad62e2f.1692287501.git.jani.nikula@intel.com commit ae3a70adc273edd501b1168508e415a28e539f2d Author: Jani Nikula Date: Thu Aug 17 18:53:03 2023 +0300 drm/i915/regs: split out intel_color_regs.h Declutter i915_regs.h. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/8e76007a361bd3ca8dd8913281854886b3a1954c.1692287501.git.jani.nikula@intel.com commit 17c35883cf5351fd0667083e752a28222a4cec55 Author: Yue Haibing Date: Thu Aug 17 21:37:54 2023 +0800 drm/gma500: Remove unused declarations These declarations are not implemented now, remove them. Signed-off-by: Yue Haibing Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20230817133754.36524-1-yuehaibing@huawei.com commit da596080b2b400c50fe9f8f237bcaf09fed06af8 Author: Sui Jingfeng Date: Fri Jul 28 02:58:55 2023 +0800 drm/gma500: Fix call trace when psb_gem_mm_init() fails Because the gma_irq_install() is call after psb_gem_mm_init() function, when psb_gem_mm_init() fails, the interrupt line haven't been allocated. Yet the gma_irq_uninstall() is called in the psb_driver_unload() function without checking if checking the irq is registered or not. The calltrace is appended as following: [ 20.539253] ioremap memtype_reserve failed -16 [ 20.543895] gma500 0000:00:02.0: Failure to map stolen base. [ 20.565049] ------------[ cut here ]------------ [ 20.565066] Trying to free already-free IRQ 16 [ 20.565087] WARNING: CPU: 1 PID: 381 at kernel/irq/manage.c:1893 free_irq+0x209/0x370 [ 20.565316] CPU: 1 PID: 381 Comm: systemd-udevd Tainted: G C 6.5.0-rc1+ #368 [ 20.565329] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./IMB-140D Plus, BIOS P1.10 11/18/2013 [ 20.565338] RIP: 0010:free_irq+0x209/0x370 [ 20.565357] Code: 41 5d 41 5e 41 5f 5d 31 d2 89 d1 89 d6 89 d7 41 89 d1 c3 cc cc cc cc 8b 75 d0 48 c7 c7 e0 77 12 9f 4c 89 4d c8 e8 57 fe f4 ff <0f> 0b 48 8b 75 c8 4c 89 f7 e8 29 f3 f1 00 49 8b 47 40 48 8b 40 78 [ 20.565369] RSP: 0018:ffffae3b40733808 EFLAGS: 00010046 [ 20.565382] RAX: 0000000000000000 RBX: ffff9f8082bfe000 RCX: 0000000000000000 [ 20.565390] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 20.565397] RBP: ffffae3b40733840 R08: 0000000000000000 R09: 0000000000000000 [ 20.565405] R10: 0000000000000000 R11: 0000000000000000 R12: ffff9f80871c3100 [ 20.565413] R13: ffff9f80835d3360 R14: ffff9f80835d32a4 R15: ffff9f80835d3200 [ 20.565424] FS: 00007f13d36458c0(0000) GS:ffff9f8138880000(0000) knlGS:0000000000000000 [ 20.565434] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 20.565441] CR2: 00007f0d046f3f20 CR3: 0000000006c8c000 CR4: 00000000000006e0 [ 20.565450] Call Trace: [ 20.565458] [ 20.565470] ? show_regs+0x72/0x90 [ 20.565488] ? free_irq+0x209/0x370 [ 20.565504] ? __warn+0x8d/0x160 [ 20.565520] ? free_irq+0x209/0x370 [ 20.565536] ? report_bug+0x1bb/0x1d0 [ 20.565555] ? handle_bug+0x46/0x90 [ 20.565572] ? exc_invalid_op+0x19/0x80 [ 20.565587] ? asm_exc_invalid_op+0x1b/0x20 [ 20.565607] ? free_irq+0x209/0x370 [ 20.565625] ? free_irq+0x209/0x370 [ 20.565644] gma_irq_uninstall+0x15b/0x1e0 [gma500_gfx] [ 20.565728] psb_driver_unload+0x27/0x190 [gma500_gfx] [ 20.565800] psb_pci_probe+0x5d2/0x790 [gma500_gfx] [ 20.565873] local_pci_probe+0x48/0xb0 [ 20.565892] pci_device_probe+0xc8/0x280 [ 20.565912] really_probe+0x1d2/0x440 [ 20.565929] __driver_probe_device+0x8a/0x190 [ 20.565944] driver_probe_device+0x23/0xd0 [ 20.565957] __driver_attach+0x10f/0x220 [ 20.565971] ? __pfx___driver_attach+0x10/0x10 [ 20.565984] bus_for_each_dev+0x7a/0xe0 [ 20.566002] driver_attach+0x1e/0x30 [ 20.566014] bus_add_driver+0x127/0x240 [ 20.566029] driver_register+0x64/0x140 [ 20.566043] ? __pfx_psb_init+0x10/0x10 [gma500_gfx] [ 20.566111] __pci_register_driver+0x68/0x80 [ 20.566128] psb_init+0x2c/0xff0 [gma500_gfx] [ 20.566194] do_one_initcall+0x46/0x330 [ 20.566214] ? kmalloc_trace+0x2a/0xb0 [ 20.566233] do_init_module+0x6a/0x270 [ 20.566250] load_module+0x207f/0x23a0 [ 20.566278] init_module_from_file+0x9c/0xf0 [ 20.566293] ? init_module_from_file+0x9c/0xf0 [ 20.566315] idempotent_init_module+0x184/0x240 [ 20.566335] __x64_sys_finit_module+0x64/0xd0 [ 20.566352] do_syscall_64+0x59/0x90 [ 20.566366] ? ksys_mmap_pgoff+0x123/0x270 [ 20.566378] ? __secure_computing+0x9b/0x110 [ 20.566392] ? exit_to_user_mode_prepare+0x39/0x190 [ 20.566406] ? syscall_exit_to_user_mode+0x2a/0x50 [ 20.566420] ? do_syscall_64+0x69/0x90 [ 20.566433] ? do_syscall_64+0x69/0x90 [ 20.566445] ? do_syscall_64+0x69/0x90 [ 20.566458] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 20.566472] RIP: 0033:0x7f13d351ea3d [ 20.566485] 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 c3 a3 0f 00 f7 d8 64 89 01 48 [ 20.566496] RSP: 002b:00007ffe566c1fd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 20.566510] RAX: ffffffffffffffda RBX: 000055e66806eec0 RCX: 00007f13d351ea3d [ 20.566519] RDX: 0000000000000000 RSI: 00007f13d36d9441 RDI: 0000000000000010 [ 20.566527] RBP: 0000000000020000 R08: 0000000000000000 R09: 0000000000000002 [ 20.566535] R10: 0000000000000010 R11: 0000000000000246 R12: 00007f13d36d9441 [ 20.566543] R13: 000055e6681108c0 R14: 000055e66805ba70 R15: 000055e66819a9c0 [ 20.566559] [ 20.566566] ---[ end trace 0000000000000000 ]--- Signed-off-by: Sui Jingfeng Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20230727185855.713318-1-suijingfeng@loongson.cn commit afcacac4beb7f4c754fc8116a00c551d89499147 Author: Jorge Maidana Date: Tue Jul 25 14:31:07 2023 -0300 drm/gma500: remove duplicate macro definitions Remove identical duplicate block of macro definitions in drivers/gpu/drm/gma500/psb_drv.h. Signed-off-by: Jorge Maidana Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20230725173107.9593-1-jorgem.linux@gmail.com commit 6297ee90f6827ae31300439fcdca34534301f337 Author: Vinod Govindapillai Date: Tue Aug 22 23:48:18 2023 +0300 drm/i915/display: configure SDP split for DP-MST Extend the SDP split audio config for DP-MST Signed-off-by: Vinod Govindapillai Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230822204818.109742-3-vinod.govindapillai@intel.com commit 2e775f2d41ef8ed93aab2ad1b7a86b41b2da8560 Author: Vinod Govindapillai Date: Tue Aug 22 23:48:17 2023 +0300 drm/i915/display: update intel_dp_has_audio to support MST Modify intel_dp_has_audio to handle DP-MST as well. v1: fix the wrong port comparison (Jani Nikula) Signed-off-by: Vinod Govindapillai Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230822204818.109742-2-vinod.govindapillai@intel.com commit f1f959d523b7a0fd6f3c28a068c75404c697ff82 Author: Jani Nikula Date: Fri Aug 18 14:27:58 2023 +0300 drm/i915/vma: constify unbind_fence_ops unbind_fence_ops can be const and placed in rodata. Signed-off-by: Jani Nikula Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20230818112758.3586545-1-jani.nikula@intel.com commit 5d5fea7c79a7f7b61a9683784c83d539aca8dafe Author: Dnyaneshwar Bhadane Date: Thu Aug 24 11:58:40 2023 +0530 drm/i915/rpl: Update pci ids for RPL P/U Update pci device ids as per bspec for RPL P/U. v2: - Append new id's instead of replacing the existing in device id list define v3: - Fixed the commit messege with revision details. Bpsec: 55376 Signed-off-by: Dnyaneshwar Bhadane Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230824062840.2372872-1-dnyaneshwar.bhadane@intel.com commit e83d12e0923116c11ed54891745edb8003a64854 Author: Ville Syrjälä Date: Wed Jul 5 23:21:16 2023 +0300 drm/i915/sdvo: Fail gracefully if the TV dotclock is out of range Instead of warning and continuing with bogus state when the requested dotclock isn't acceptable just print some debug spew and fail gracefully. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230705202122.17915-8-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit d320aaaa2cdeca73742ef9259e4aba95752be74a Author: Ville Syrjälä Date: Wed Jul 5 23:21:15 2023 +0300 drm/i915/sdvo: Pick the TV dotclock from adjusted_mode port_clock is what the encoder/dpll code is supposed to calculate, it is not the input clock. Use the dotclock as the target we're trying to achieve instead. TODO: the SDVO TV clocking is a mess atm and needs further work Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230705202122.17915-7-ville.syrjala@linux.intel.com Acked-by: Jani Nikula commit c99c0e2839a43f51b9d29b6c782d8bc4f4ecf091 Author: Ville Syrjälä Date: Wed Jul 5 23:21:14 2023 +0300 drm/i915: Fully populate crtc_state->dpll Call *_calc_dpll_params() even in cases where the encoder has computed the DPLL params for us. The SDVO TV output code doesn't populate crtc_state->dpll.dot leading to the dotclock getting calculated as zero, and that leads to all kinds of real problems. The g4x DP code also doesn't populate the derived dividers nor .vco, which could also create some confusion. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230705202122.17915-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 7176dca94314bada5b715611b2a54630ee68e48f Author: Ville Syrjälä Date: Wed Jul 5 23:21:13 2023 +0300 drm/i915: Don't warn about zero N/P in *_calc_dpll_params() Allow *_calc_dpll_params() to be called even if the N/P dividers are zero without warning. We'll want to call these to make sure the derived values are fully computed, but not all users (VLV DSI in particular) even enable the DPLL and thus the dividers will be left at zero. It could also be possible that the BIOS has misprogrammed the DPLL (IIRC happened with some SNB machines with 4k+ displays) and thus we'll currently generate a lot of dmesg spew. Better be silent and just let the normal state checker/etc. deal with any driver bugs. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230705202122.17915-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 469c09624b56be6ae059cd3a692b105c815a1f16 Author: Ville Syrjälä Date: Wed Jul 5 23:21:12 2023 +0300 drm/i915/sdvo: s/sdvo_inputs_mask/sdvo_num_inputs/ The SDVO inputs are reported a simple number, not a bitmask. Adjust the code to match reality. Note that we don't actually support dual input SDVO devices, and we just always use the first input. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230705202122.17915-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit a5d1d0a1fc0362647a4ab1bbcfb0d594dc43664f Author: Ville Syrjälä Date: Wed Jul 5 23:21:11 2023 +0300 drm/i915/sdvo: Protect macro args Put parens around macro argument evaluation for safety. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230705202122.17915-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 1d6f7b19bdff4c62fcbbd0d73868e1292b0ea4d4 Author: Ville Syrjälä Date: Wed Jul 5 23:21:10 2023 +0300 drm/i915/sdvo: Issue SetTargetOutput prior to GetAttachedDisplays I have at least one SDVO device (some Lenovo DVI-I ADD2 card, based on Conexant CX25904) where GetAttachedDisplays returns success but fails to report any attached displays unless we precede the command with a SetTargetOutput. Make it so. I wasn't able to spot anything in the SDVO spec stating that this should be necessary, but real world wins over spec. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230705202122.17915-2-ville.syrjala@linux.intel.com Acked-by: Jani Nikula commit 40a54a268ffc0fa1d28150054d1fffbe0ea37fd8 Author: Juha-Pekka Heikkila Date: Mon Aug 14 19:34:45 2023 +0300 drm/i915/display: add lock while printing frontbuffer tracking bits to debugfs Add missing spin_lock/unlock Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Jouni Högander Signed-off-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20230814163452.2925-1-juhapekka.heikkila@gmail.com commit b715dcd3db4a9a57b3fbe7820db37cae930f0867 Author: Danilo Krummrich Date: Wed Aug 23 20:15:34 2023 +0200 drm/nouveau: uapi: don't pass NO_PREFETCH flag implicitly Currently, NO_PREFETCH is passed implicitly through drm_nouveau_gem_pushbuf_push::length and drm_nouveau_exec_push::va_len. Since this is a direct representation of how the HW is programmed it isn't really future proof for a uAPI. Hence, fix this up for the new uAPI and split up the va_len field of struct drm_nouveau_exec_push, such that we keep 32bit for va_len and 32bit for flags. For drm_nouveau_gem_pushbuf_push::length at least provide NOUVEAU_GEM_PUSHBUF_NO_PREFETCH to indicate the bit shift. While at it, fix up nv50_dma_push() as well, such that the caller doesn't need to encode the NO_PREFETCH flag into the length parameter. Signed-off-by: Danilo Krummrich Reviewed-by: Faith Ekstrand Link: https://patchwork.freedesktop.org/patch/msgid/20230823181746.3446-1-dakr@redhat.com commit 50452f2f76852322620b63e62922b85e955abe94 Author: Imre Deak Date: Tue Aug 22 14:30:15 2023 +0300 drm/i915: Fix HPD polling, reenabling the output poll work as needed After the commit in the Fixes: line below, HPD polling stopped working on i915, since after that change calling drm_kms_helper_poll_enable() doesn't restart drm_mode_config::output_poll_work if the work was stopped (no connectors needing polling) and enabling polling for a connector (during runtime suspend or detecting an HPD IRQ storm). After the above change calling drm_kms_helper_poll_enable() is a nop after it's been called already and polling for some connectors was disabled/re-enabled. Fix this by calling drm_kms_helper_poll_reschedule() added in the previous patch instead, which reschedules the work whenever expected. Fixes: d33a54e3991d ("drm/probe_helper: sort out poll_running vs poll_enabled") CC: stable@vger.kernel.org # 6.4+ Cc: Dmitry Baryshkov Cc: dri-devel@lists.freedesktop.org Reviewed-by: Jouni Högander Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230822113015.41224-2-imre.deak@intel.com commit fe2352fd64029918174de4b460dfe6df0c6911cd Author: Imre Deak Date: Tue Aug 22 14:30:14 2023 +0300 drm: Add an HPD poll helper to reschedule the poll work Add a helper to reschedule drm_mode_config::output_poll_work after polling has been enabled for a connector (and needing a reschedule, since previously polling was disabled for all connectors and hence output_poll_work was not running). This is needed by the next patch fixing HPD polling on i915. CC: stable@vger.kernel.org # 6.4+ Cc: Dmitry Baryshkov Cc: dri-devel@lists.freedesktop.org Reviewed-by: Jouni Högander Reviewed-by: Dmitry Baryshkov Signed-off-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20230822113015.41224-1-imre.deak@intel.com commit 8940da9fe5f278ac6ecb4cafa55c784f524cb3b2 Author: Nemesa Garg Date: Tue Aug 22 22:57:43 2023 +0530 drm/i915/mtl: Adding DeviceID for Arrowlake-S under MTL Arrowlake-S graphics is similar enough to Meteorlake that we can treat them as the same platform Signed-off-by: Nemesa Garg Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230822172743.2113377-1-nemesa.garg@intel.com commit 8884ba07786c718771cf7b78cb3024924b27ec2b Author: Georgia Garcia Date: Mon Aug 21 15:37:24 2023 -0300 apparmor: fix invalid reference on profile->disconnected profile->disconnected was storing an invalid reference to the disconnected path. Fix it by duplicating the string using aa_unpack_strdup and freeing accordingly. Fixes: 72c8a768641d ("apparmor: allow profiles to provide info to disconnected paths") Signed-off-by: Georgia Garcia Signed-off-by: John Johansen commit b2edc4148ad90c906275329711810721719a0c2d Author: John Harrison Date: Tue Aug 15 17:39:57 2023 -0700 drm/i915/guc: Force a reset on internal GuC error If GuC hits an internal error (and survives long enough to report it to the KMD), it is basically toast and will stop until a GT reset and subsequent GuC reload is performed. Previously, the KMD just printed an error message and then waited for the heartbeat to eventually kick in and trigger a reset (assuming the heartbeat had not been disabled). Instead, force the reset immediately to guarantee that it happens and to eliminate the very long heartbeat delay. The captured error state is also more likely to be useful if captured at the time of the error rather than many seconds later. Note that it is not possible to trigger a reset from with the G2H handler itself. The reset prepare process involves flushing outstanding G2H contents. So a deadlock could result. Instead, the G2H handler queues a worker thread to do the reset asynchronously. v2: Flush the worker on suspend and shutdown. Add rate limiting to prevent spam from a totally dead system (review feedback from Daniele). Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230816003957.3572654-1-John.C.Harrison@Intel.com commit b4e9fa933551e51459c634dc4396171dc65284a6 Author: Danilo Krummrich Date: Mon Aug 21 00:29:16 2023 +0200 drm/nouveau: uvmm: fix unset region pointer on remap Transfer the region pointer of a uvma to the new uvma(s) on re-map to prevent potential shader faults when the re-mapped uvma(s) are unmapped. Signed-off-by: Danilo Krummrich Reviewed-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20230820222920.2344-1-dakr@redhat.com commit 7baf605564133405443556b415692d3c7aa54351 Author: Danilo Krummrich Date: Fri Aug 11 03:06:25 2023 +0200 drm/nouveau: sched: avoid job races between entities If a sched job depends on a dma-fence from a job from the same GPU scheduler instance, but a different scheduler entity, the GPU scheduler does only wait for the particular job to be scheduled, rather than for the job to fully complete. This is due to the GPU scheduler assuming that there is a scheduler instance per ring. However, the current implementation, in order to avoid arbitrary amounts of kthreads, has a single scheduler instance while scheduler entities represent rings. As a workaround, set the DRM_SCHED_FENCE_DONT_PIPELINE for all out-fences in order to force the scheduler to wait for full job completion for dependent jobs from different entities and same scheduler instance. There is some work in progress [1] to address the issues of firmware schedulers; once it is in-tree the scheduler topology in Nouveau should be re-worked accordingly. [1] https://lore.kernel.org/dri-devel/20230801205103.627779-1-matthew.brost@intel.com/ Signed-off-by: Danilo Krummrich Reviewed-by: Faith Ekstrand Link: https://patchwork.freedesktop.org/patch/msgid/20230811010632.2473-1-dakr@redhat.com commit 1bd1817b68d7de9e076e0d19a1528dec266722aa Author: Vinod Govindapillai Date: Fri Aug 18 14:19:48 2023 +0300 drm/i915/display: combine DP audio compute config steps Combine all DP audio configs into a single function Signed-off-by: Vinod Govindapillai Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230818111950.128992-3-vinod.govindapillai@intel.com commit 2f092c0c52628292ff59c6215c1da824eb9d9aeb Author: Vinod Govindapillai Date: Fri Aug 18 14:19:47 2023 +0300 drm/i915/display: remove redundant parameter from sdp split update The needed functionality can be performed using crtc_state here. Signed-off-by: Vinod Govindapillai Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20230818111950.128992-2-vinod.govindapillai@intel.com commit e388ae97e2253363275396b0f74c0df7d3f03b15 Author: Matt Roper Date: Mon Aug 21 11:06:28 2023 -0700 drm/i915/display: Eliminate IS_METEORLAKE checks Most of the IS_METEORLAKE checks in the display code shouldn't actually be tied to MTL as a platform, but rather to the Xe_LPD+ display IP (which is used in MTL, but may show up again in future platforms). In cases where we're trying to match that specific IP, use a version check against IP_VER(14, 0). For cases where we're just handling new behavior introduced by this IP (but which may also be inherited by future IP as well), use a ver >= 14 check. The one exception here is the stolen memory workaround Wa_13010847436 (which is mislabelled as "Wa_22018444074" in the code). That's truly a MTL-specific issue rather than being tied to any of the IP blocks, so leaving the condition as IS_METEORLAKE is correct there. v2: - cdclk check should be >=, not >. (Gustavo) Signed-off-by: Matt Roper Reviewed-by: Gustavo Sousa Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-19-matthew.d.roper@intel.com commit 213454b3af2e35c2ce9bbfa3e648bcde6d60eac5 Author: Matt Roper Date: Mon Aug 21 11:06:26 2023 -0700 drm/i915: Eliminate IS_MTL_DISPLAY_STEP Stepping-specific display behavior shouldn't be tied to MTL as a platform, but rather specifically to the Xe_LPD+ IP. Future non-MTL platforms may re-use this IP and will need to follow the exact same logic and apply the same workarounds. IS_MTL_DISPLAY_STEP() is dropped in favor of a new macro IS_DISPLAY_IP_STEP() that only checks the display IP version. v2: - Rename macro to IS_DISPLAY_IP_STEP for consistency with the corresponding GT macro and handle steppings the same way. v3: - Drop the automatic "STEP_" pasting. v4: - Implement IS_DISPLAY_IP_STEP on top of IS_DISPLAY_IP_RANGE / IS_DISPLAY_STEP building blocks and make the parameters from/until instead of begin/fixed. (Jani) - Fix usage details in comment. v5: - Tweak macro comment. (Gustavo) Signed-off-by: Matt Roper Reviewed-by: Gustavo Sousa Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-17-matthew.d.roper@intel.com commit 14128d64090fa88445376cb8ccf91c50c08bd410 Author: Matt Roper Date: Mon Aug 21 11:06:29 2023 -0700 drm/i915: Replace several IS_METEORLAKE with proper IP version checks Many of the IS_METEORLAKE conditions throughout the driver are supposed to be checks for Xe_LPG and/or Xe_LPM+ IP, not for the MTL platform specifically. Update those checks to ensure that the code will still operate properly if/when these IP versions show up on future platforms. v2: - Update two more conditions (one for pg_enable, one for MTL HuC compatibility). v3: - Don't change GuC/HuC compatibility check, which sounds like it truly is specific to the MTL platform. (Gustavo) - Drop a non-lineage workaround number for the OA timestamp frequency workaround. (Gustavo) Cc: Gustavo Sousa Signed-off-by: Matt Roper Reviewed-by: Gustavo Sousa Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-20-matthew.d.roper@intel.com commit 2e3c369f23a77c404fd6b364a120a546f30e651c Author: Matt Roper Date: Mon Aug 21 11:06:27 2023 -0700 drm/i915/mtl: Eliminate subplatforms Now that we properly match the Xe_LPG IP versions associated with various workarounds, there's no longer any need to define separate MTL subplatform in the driver. Nothing in the code is conditional on MTL-M or MTL-P base platforms. Furthermore, I'm not sure the "M" and "P" designations are even an accurate representation of which specific platforms would have which IP versions; those were mostly just placeholders from a long time ago. The reality is that the IP version present on a platform gets read from a fuse register at driver init; we shouldn't be trying to guess which IP is present based on PCI ID anymore. Signed-off-by: Matt Roper Reviewed-by: Nemesa Garg Reviewed-by: Gustavo Sousa Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-18-matthew.d.roper@intel.com commit 81af8abe65134f1b1872e6dfc4ba520c06ac363a Author: Matt Roper Date: Mon Aug 21 11:06:25 2023 -0700 drm/i915: Eliminate IS_MTL_MEDIA_STEP Stepping-specific media behavior shouldn't be tied to MTL as a platform, but rather specifically to the Xe_LPM+ IP. Future non-MTL platforms may re-use this IP and will need to follow the exact same logic and apply the same workarounds. IS_MTL_MEDIA_STEP() is dropped in favor of IS_MEDIA_GT_IP_STEP, which checks the media IP version associated with a specific IP and also ensures that we're operating on the media GT, not the primary GT. v2: - Switch to the IS_GT_IP_STEP macro. v3: - Switch back to long-form IS_MEDIA_GT_IP_STEP. (Jani) v4: - Build IS_MEDIA_GT_IP_STEP on top of IS_MEDIA_GT_IP_RANGE and IS_MEDIA_STEP building blocks and name the parameters from/until rather than begin/fixed.. (Jani) v5: - Tweak macro comment wording. (Gustavo) - Add a check to catch NULL gt in IS_MEDIA_GT_IP_RANGE; this allows it to be used safely on i915->media_gt, which may be NULL on some platforms. (Gustavo) Cc: Jani Nikula Cc: Gustavo Sousa Signed-off-by: Matt Roper Reviewed-by: Gustavo Sousa Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-16-matthew.d.roper@intel.com commit 5a213086a025349361b5cf75c8fd4591d96a7a99 Author: Matt Roper Date: Mon Aug 21 11:06:24 2023 -0700 drm/i915: Eliminate IS_MTL_GRAPHICS_STEP Several workarounds are guarded by IS_MTL_GRAPHICS_STEP. However none of these workarounds are actually tied to MTL as a platform; they only relate to the Xe_LPG graphics IP, regardless of what platform it appears in. At the moment MTL is the only platform that uses Xe_LPG with IP versions 12.70 and 12.71, but we can't count on this being true in the future. Switch these to use a new IS_GFX_GT_IP_STEP() macro instead that is purely based on IP version. IS_GFX_GT_IP_STEP() is also GT-based rather than device-based, which will help prevent mistakes where we accidentally try to apply Xe_LPG graphics workarounds to the Xe_LPM+ media GT and vice-versa. v2: - Switch to a more generic and shorter IS_GT_IP_STEP macro that can be used for both graphics and media IP (and any other kind of GTs that show up in the future). v3: - Switch back to long-form IS_GFX_GT_IP_STEP macro. (Jani) - Move macro to intel_gt.h. (Andi) v4: - Build IS_GFX_GT_IP_STEP on top of IS_GFX_GT_IP_RANGE and IS_GRAPHICS_STEP building blocks and name the parameters from/until rather than begin/fixed. (Jani) - Fix usage examples in comment. v5: - Tweak comment on macro. (Gustavo) Cc: Gustavo Sousa Cc: Tvrtko Ursulin Cc: Andi Shyti Cc: Jani Nikula Signed-off-by: Matt Roper Reviewed-by: Gustavo Sousa Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-15-matthew.d.roper@intel.com commit f7696ded7c9e358670dae1801660f442f059c7db Author: Matt Roper Date: Mon Aug 21 11:06:23 2023 -0700 drm/i915/xelpg: Call Xe_LPG workaround functions based on IP version Although some of our Xe_LPG workarounds were already being applied based on IP version correctly, others were matching on MTL as a base platform, which is incorrect. Although MTL is the only platform right now that uses Xe_LPG IP, this may not always be the case. If a future platform re-uses this graphics IP, the same workarounds should be applied, even if it isn't a "MTL" platform. We were also incorrectly applying Xe_LPG workarounds/tuning to the Xe_LPM+ media IP in one or two places; we should make sure that we don't try to apply graphics workarounds to the media GT and vice versa where they don't belong. A new helper macro IS_GT_IP_RANGE() is added to help ensure this is handled properly -- it checks that the GT matches the IP type being tested as well as the IP version falling in the proper range. Note that many of the stepping-based workarounds are still incorrectly checking for a MTL base platform; that will be remedied in a later patch. v2: - Rework macro into a slightly more generic IS_GT_IP_RANGE() that can be used for either GFX or MEDIA checks. v3: - Switch back to separate macros for gfx and media. (Jani) - Move macro to intel_gt.h. (Andi) Cc: Gustavo Sousa Cc: Tvrtko Ursulin Cc: Jani Nikula Cc: Andi Shyti Signed-off-by: Matt Roper Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-14-matthew.d.roper@intel.com commit ea2f15565d7a082bf21f131225a656793fdca359 Author: Matt Roper Date: Mon Aug 21 11:06:22 2023 -0700 drm/i915/xelpmp: Don't assume workarounds extend to future platforms The currently implemented Xe_LPM+ workarounds are specific to media version 13.00. When new IP versions show up in the future, they'll need their own workaround lists. Signed-off-by: Matt Roper Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-13-matthew.d.roper@intel.com commit 28c46feec7f8760683ef08f12746630a3598173e Author: Matt Roper Date: Mon Aug 21 11:06:21 2023 -0700 drm/i915: Consolidate condition for Wa_22011802037 The workaround bounds for Wa_22011802037 are somewhat complex and are replicated in several places throughout the code. Pull the condition out to a helper function to prevent mistakes if this condition needs to change again in the future. Signed-off-by: Matt Roper Reviewed-by: Gustavo Sousa Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-12-matthew.d.roper@intel.com commit 504245a5ab6b6e1bfe0280baa4885c551e082099 Author: Daniel Stone Date: Thu Aug 3 16:47:29 2023 +0100 doc: uapi: Add document describing dma-buf semantics Since there's a lot of confusion around this, document both the rules and the best practices around negotiating, allocating, importing, and using buffers when crossing context/process/device/subsystem boundaries. This ties up all of dma-buf, formats and modifiers, and their usage. Signed-off-by: Daniel Stone Signed-off-by: Simon Ser Reviewed-by: Simon Ser Reviewed-by: Sui Jingfeng Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20230803154908.105124-4-daniels@collabora.com commit 9173c14fe795383effaf219f02b42dc95d2474ba Author: Gustavo Sousa Date: Thu Aug 17 14:53:12 2023 -0300 drm/i915/display: Remove unused POWER_DOMAIN_MODESET That power domain became unused after commit 41b4c7fe72b6 ("drm/i915: Disable DC states for all commits"). Signed-off-by: Gustavo Sousa Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230817175312.295559-1-gustavo.sousa@intel.com commit 09902f3a1f83085006742f18388b5098c1b57132 Author: Daniel Stone Date: Thu Aug 3 16:47:28 2023 +0100 doc: dma-buf: Rewrite intro section a little Make it a little bit more clear what's going on and fix some formatting. Signed-off-by: Daniel Stone Signed-off-by: Simon Ser Reviewed-by: Simon Ser Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20230803154908.105124-3-daniels@collabora.com commit d7a407bc9ba30628eb699170e21d50c701c0e872 Author: Ruan Jinjie Date: Thu Aug 3 12:03:59 2023 +0800 drm/panfrost: Do not check for 0 return after calling platform_get_irq_byname() It is not possible for platform_get_irq_byname() to return 0. Use the return value from platform_get_irq_byname(). Signed-off-by: Ruan Jinjie Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20230803040401.3067484-2-ruanjinjie@huawei.com commit ad1367f831f8743746a1f49705c28e36a7c95525 Author: Douglas Anderson Date: Thu Aug 17 09:48:09 2023 -0700 drm/bridge: Fix kernel-doc typo in desc of output_bus_cfg in drm_bridge_state There's an obvious copy-paste error in the description of output_bus_cfg. Fix it. Fixes: f32df58acc68 ("drm/bridge: Add the necessary bits to support bus format negotiation") Signed-off-by: Douglas Anderson Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20230817094808.1.I41b04c3a8305c9f1c17af886c327941c5136ca3b@changeid commit 7adfec8c3374faa6b31da34220bd885b3b970903 Author: Ankit Nautiyal Date: Thu Aug 17 19:54:59 2023 +0530 drm/i915/dp: Check if force_dsc_output_format is possible Currently for testing an output format with DSC, we just force the output format, without checking if it can be supported. This also creates an issue where there is a PCON which might need to convert from forced output format to the format to sink format. Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-19-ankit.k.nautiyal@intel.com commit 61d340faaa5b4e2ec242d5942effce3b02f95b88 Author: Ankit Nautiyal Date: Thu Aug 17 19:54:58 2023 +0530 drm/i915/dp: Check src/sink compressed bpp limit for edp Use checks for src and sink limits before computing compressed bpp for eDP. Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-18-ankit.k.nautiyal@intel.com commit 1c56e9a39833975c1a3ae8754eb800d039f123ac Author: Ankit Nautiyal Date: Thu Aug 17 19:54:57 2023 +0530 drm/i915/dp: Get optimal link config to have best compressed bpp Currently, we take the max lane, rate and pipe bpp, to get the maximum compressed bpp possible. We then set the output bpp to this value. This patch provides support to have max bpp, min rate and min lanes, that can support the min compressed bpp. v2: -Avoid ending up with compressed bpp, same as pipe bpp. (Stan) -Fix the checks for limits->max/min_bpp while iterating over list of valid DSC bpcs. (Stan) v3: -Refactor the code to have pipe bpp/compressed bpp computation and slice count calculation separately for different cases. v4: -Separate the pipe_bpp calculation for eDP and DP. v5: -Get rid of magic numbers for max and min bpp, and improve documentation. (Stan). -Use functions for {src_sink}_{min_max}_compressed_bpp (Ville). v6: -Remove lines to set link config to max. v7: -Split the part to separate edp and dp functions for computing DSC BPP into separate patch. v8: -Separate mechanism to get compressed bpp for ICL,TGL and XELPD+. Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-17-ankit.k.nautiyal@intel.com commit a4d30841dee6dc7ea0d5f75d35ea58553d7bd59e Author: Ankit Nautiyal Date: Thu Aug 17 19:54:56 2023 +0530 drm/i915/dp: Separate out function to get compressed bpp with joiner Pull the code to get joiner constraints on maximum compressed bpp into separate function. Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-16-ankit.k.nautiyal@intel.com commit 874aa4a3ff50f0d6be6e5db74495c7e3cbf7d417 Author: Ankit Nautiyal Date: Thu Aug 17 19:54:55 2023 +0530 drm/i915/dp: Add DSC BPC/BPP constraints while selecting pipe bpp with DSC Currently we check if the pipe_bpp selected is >= the min DSC bpc/bpp requirement. We do not check if it is <= the max DSC bpc/bpp requirement. Add checks for max DSC BPC/BPP constraints while computing the pipe_bpp when DSC is in use. v2: Fix the commit message. Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-15-ankit.k.nautiyal@intel.com commit 9c8160a34383194925ec318e32e95f58df38c4c5 Author: Ankit Nautiyal Date: Thu Aug 17 19:54:54 2023 +0530 drm/i915/dp: Separate out functions for edp/DP for computing DSC bpp Refactor code to separate functions for eDP and DP for computing pipe_bpp/compressed bpp when DSC is involved. This will help to optimize the link configuration for DP later. v2: Fix checkpatch warning. Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-14-ankit.k.nautiyal@intel.com commit b9a7efcd99111a8ebe8c666c1affdde919bbaa7d Author: Ankit Nautiyal Date: Thu Aug 17 19:54:53 2023 +0530 drm/i915/dp: Rename helper to get DSC max pipe_bpp The helper intel_dp_dsc_compute_bpp gives the maximum pipe bpp that is allowed with DSC. Rename the this to reflect that it returns max pipe bpp supported with DSC. Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-13-ankit.k.nautiyal@intel.com commit 51dda14868efd5b24ec40d2bfc98eb782606025e Author: Ankit Nautiyal Date: Thu Aug 17 19:54:52 2023 +0530 drm/i915/dp: Avoid left shift of DSC output bpp by 4 To make way for fractional bpp support, avoid left shifting the output_bpp by 4 in helper intel_dp_dsc_get_output_bpp. Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-12-ankit.k.nautiyal@intel.com commit 2f4761c6654f3c7c3de708685ee2537bbb7c370b Author: Ankit Nautiyal Date: Thu Aug 17 19:54:51 2023 +0530 drm/i915/dp: Check min bpc DSC limits for dsc_force_bpc also For DSC the min BPC is 8 for ICL+ and so the min pipe_bpp is 24. Check this condition for cases where bpc is forced by debugfs flag dsc_force_bpc. If the check fails, then WARN and ignore the debugfs flag. For MST case the pipe_bpp is already computed (hardcoded to be 24), and this check is not required. Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-11-ankit.k.nautiyal@intel.com commit 8a969033cee88d89cc2ecfca107092fc66f9bd8c Author: Ankit Nautiyal Date: Thu Aug 17 19:54:50 2023 +0530 drm/i915/dp: Add functions to get min/max src input bpc with DSC Separate out functions for getting maximum and minimum input BPC based on platforms, when DSC is used. v2: Use HAS_DSC macro instead of platform check while getting min input bpc. (Stan) Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-10-ankit.k.nautiyal@intel.com commit e1a211e316252292afe580a8a9d4c5227902dfa1 Author: Ankit Nautiyal Date: Thu Aug 17 19:54:49 2023 +0530 drm/i915/dp: Avoid forcing DSC BPC for MST case For MST the bpc is hardcoded to 8, and pipe bpp to 24. So avoid forcing DSC bpc for MST case. v2: Warn and ignore the debug flag than to bail out. (Jani) v3: Fix dbg message to mention forced bpc instead of bpp. v4: Fix checkpatch longline warning. Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-9-ankit.k.nautiyal@intel.com commit 90bba71a1afdb0ff85144e813883d790446bf66f Author: Ankit Nautiyal Date: Thu Aug 17 19:54:48 2023 +0530 drm/i915/dp: Remove extra logs for printing DSC info DSC compressed bpp and slice counts are already getting printed at the end of dsc compute config. Remove extra logs. Signed-off-by: Ankit Nautiyal Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-8-ankit.k.nautiyal@intel.com commit 7f5ac365261dcbd7e9fb6f4c09d0d363be5b5d4b Author: Ankit Nautiyal Date: Thu Aug 17 19:54:47 2023 +0530 drm/i915/intel_cdclk: Add vdsc with bigjoiner constraints on min_cdlck As per Bsepc:49259, Bigjoiner BW check puts restriction on the compressed bpp for a given CDCLK, pixelclock in cases where Bigjoiner + DSC are used. Currently compressed bpp is computed first, and it is ensured that the bpp will work at least with the max CDCLK freq. Since the CDCLK is computed later, lets account for Bigjoiner BW check while calculating Min CDCLK. v2: Use pixel clock in the bw calculations. (Ville) v3: Use helper to account for FEC overhead. (Stan) Signed-off-by: Ankit Nautiyal Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-7-ankit.k.nautiyal@intel.com commit d9f864efb937a222d1eb1f319bc35176494f5a7d Author: Ankit Nautiyal Date: Thu Aug 17 19:54:46 2023 +0530 drm/i915/dp: Update Bigjoiner interface bits for computing compressed bpp In Bigjoiner check for DSC, bigjoiner interface bits for DP for DISPLAY > 13 is 36 (Bspec: 49259). v2: Corrected Display ver to 13. v3: Follow convention for conditional statement. (Ville) v4: Fix check for display ver. (Ville) v5: Added note for 2 PPC. (Stan) Signed-off-by: Ankit Nautiyal Reviewed-by: Ville Syrjälä Reviewed-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-6-ankit.k.nautiyal@intel.com commit 8d5284765a43f4df2eae35334e697d24fad38b4f Author: Ankit Nautiyal Date: Thu Aug 17 19:54:45 2023 +0530 drm/i915/dp: Use consistent name for link bpp and compressed bpp Currently there are many places where we use output_bpp for link bpp and compressed bpp. Lets use consistent naming: output_bpp : The intermediate value taking into account the output_format chroma subsampling. compressed_bpp : target bpp for the DSC encoder. link_bpp : final bpp used in the link. For 444 sampling without DSC: link_bpp = output_bpp = pipe_bpp For 420 sampling without DSC: output_bpp = pipe_bpp / 2 link_bpp = output_bpp For 444 sampling with DSC: output_bpp = pipe_bpp link_bpp = compressed_bpp, computed with output_bpp (i.e. pipe_bpp in this case) For 420 sampling with DSC: output_bpp = pipe_bpp/2 link_bpp = compressed_bpp, computed with output_bpp Signed-off-by: Ankit Nautiyal Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-5-ankit.k.nautiyal@intel.com commit fd279d21edd2fc4f965ec753d756d0d996d711e8 Author: Ankit Nautiyal Date: Thu Aug 17 19:54:44 2023 +0530 drm/i915/dp_mst: Use output_format to get the final link bpp The final link bpp used to calculate the m_n values depend on the output_format. Though the output_format is set to RGB for MST case and the link bpp will be same as the pipe bpp, for the sake of semantics, lets calculate the m_n values with the link bpp, instead of pipe_bpp. Signed-off-by: Ankit Nautiyal Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-4-ankit.k.nautiyal@intel.com commit 3a4b4809c8cca52d55e81afcdd879206ca287daf Author: Ankit Nautiyal Date: Thu Aug 17 19:54:43 2023 +0530 drm/i915/dp: Move compressed bpp check with 420 format inside the helper Move the check for limiting compressed bits_per_pixel for 420,422 formats in the helper to compute bits_per_pixel. v2: Fix typo in commit message. (Ankit) Signed-off-by: Ankit Nautiyal Reviewed-by: Arun R Murthy Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-3-ankit.k.nautiyal@intel.com commit a1476c2a9715b69b3551b8379cb866bd0639c6e7 Author: Ankit Nautiyal Date: Thu Aug 17 19:54:42 2023 +0530 drm/i915/dp: Consider output_format while computing dsc bpp While using DSC the compressed bpp is computed assuming RGB output format. Consider the output_format and compute the compressed bpp during mode valid and compute config steps. For DP-MST we currently use RGB output format only, so continue using RGB while computing compressed bpp for MST case. v2: Use output_bpp instead for pipe_bpp to clamp compressed_bpp. (Ville) Signed-off-by: Ankit Nautiyal Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20230817142459.89764-2-ankit.k.nautiyal@intel.com commit 4ebf43d0488f65f50fffa35e16b60fcede3f477c Author: Matt Roper Date: Thu Aug 10 16:46:20 2023 -0700 drm/i915: Eliminate has_4tile feature flag We don't really need a feature flag for has_4tile since there's a well-defined cutover point (DG2) at which all new platforms started using Tile4 as their Y-major tiling layout. The GT side of the code already handles Tile4 vs legacy TileY with checks on the IP version rather than looking at the feature flag, and we can simplify the display code similarly (which will also make it more self-contained for re-use in the Xe driver). Signed-off-by: Matt Roper Reviewed-by: Haridhar Kalvala Link: https://patchwork.freedesktop.org/patch/msgid/20230810234618.3738870-4-matthew.d.roper@intel.com commit 3d623691ca300676699a56d5ec154ebcbe5d63eb Author: Matt Roper Date: Thu Aug 10 16:46:19 2023 -0700 drm/i915/selftest: Simplify Y-major tiling in blit selftest Rather than picking random tiling formats from a pool that contains both TileY and Tile4 and then trying to replace one with the other depending on the platform, it's simpler to just use a single enum value that represents whatever the platform-appropriate Y-major tiling format is (i.e., Tile4 on Xe_HP and beyond, legacy TileY on earlier platforms). Signed-off-by: Matt Roper Reviewed-by: Haridhar Kalvala Link: https://patchwork.freedesktop.org/patch/msgid/20230810234618.3738870-3-matthew.d.roper@intel.com commit c9517783060ad09968cef884e712907c70d7a658 Author: Matt Roper Date: Wed Aug 16 14:48:25 2023 -0700 drm/i915/dg2: Drop Wa_16011777198 Wa_16011777198 only applies to pre-production steppings of DG2, which we're no longer supporting. Remove the workaround and override_gucrc handling, which is no longer needed. Since this was the final use of IS_DG2_GRAPHICS_STEP, that macro can also be removed now. v2: - Include the promised removal of override_gucrc handling. Cc: Ashutosh Dixit Cc: Vinay Belgaumkar Cc: Umesh Nerlige Ramappa Signed-off-by: Matt Roper Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20230816214824.548575-2-matthew.d.roper@intel.com commit f1c805716516f9e648e13f0108cea8096e0c7023 Author: Matt Roper Date: Wed Aug 16 14:42:06 2023 -0700 drm/i915: Tidy workaround definitions Removal of the DG2 pre-production workarounds has left duplicate condition blocks in a couple places, as well as some inconsistent platform ordering. Reshuffle and consolidate some of the workarounds to reduce the number of condition blocks and to more consistently follow the "newest platform first" convention. Code movement only; no functional change. Signed-off-by: Matt Roper Acked-by: Jani Nikula Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20230816214201.534095-11-matthew.d.roper@intel.com commit eaeb4b3614529bfa8a7edfdd7ecf6977b27f18b2 Author: Matt Roper Date: Wed Aug 16 14:42:05 2023 -0700 drm/i915/dg2: Drop pre-production GT workarounds DG2 first production steppings were C0 (for DG2-G10), B1 (for DG2-G11), and A1 (for DG2-G12). Several workarounds that apply onto to pre-production hardware can be dropped. Furthermore, several workarounds that apply to all production steppings can have their conditions simplified to no longer check the GT stepping. v2: - Keep Wa_16011777198 in place for now; it will be removed separately in a follow-up patch to keep review easier. Bspec: 44477 Signed-off-by: Matt Roper Acked-by: Jani Nikula Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20230816214201.534095-10-matthew.d.roper@intel.com commit e50086f3d313fb22e19da593d6bb053335862bee Author: Matt Roper Date: Wed Aug 16 14:42:04 2023 -0700 drm/i915/dg2: Drop pre-production display workarounds All production DG2 cards have display stepping C0 or later. We can drop Wa_14013215631 (only applies to pre-C0) and make Wa_14010547955 unconditional (applies to everything B0 and beyond). Also drop the now-unused IS_DG2_DISPLAY_STEP macro. Bspec: 44477 Signed-off-by: Matt Roper Acked-by: Jani Nikula Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20230816214201.534095-9-matthew.d.roper@intel.com commit 3d3e02716136178759e8aacd23dd4c3be64fd3ae Author: Matt Roper Date: Wed Aug 16 14:42:03 2023 -0700 drm/i915/dg2: Recognize pre-production hardware The first production SoC steppings for DG2 were C0 (for G10), B1 (for G11), and A1 (for G12). This corresponds to PCI revision IDs 0x8, 0x5, and 0x1 respectively. Add this information to the driver's pre-production detection. Bspec: 44477 Signed-off-by: Matt Roper Acked-by: Jani Nikula Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20230816214201.534095-8-matthew.d.roper@intel.com commit 226fa3ab8be57aecced64d004ee24437d18bbf5f Author: Gustavo Sousa Date: Mon Aug 14 10:13:31 2023 -0300 drm/i915/cx0: Program vswing only for owned lanes According to the BSpec, voltage swing programming should be done for owned PHY lanes. Do not program a not-owned PHY lane. BSpec: 74103, 74104 Reviewed-by: Mika Kahola Signed-off-by: Gustavo Sousa Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230814131331.69516-5-gustavo.sousa@intel.com commit 6a62986bb52e3c96372d92486f9461190144a66b Author: Gustavo Sousa Date: Mon Aug 14 10:13:30 2023 -0300 drm/i915/cx0: Enable/disable TX only for owned PHY lanes Display must not enable or disable transmitters for not-owned PHY lanes. BSpec: 64539 Reviewed-by: Mika Kahola Signed-off-by: Gustavo Sousa Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230814131331.69516-4-gustavo.sousa@intel.com commit 0f5c2e5bd2fc8d2e09043b6bb3c81a889a483997 Author: Gustavo Sousa Date: Mon Aug 14 10:13:29 2023 -0300 drm/i915: Simplify intel_cx0_program_phy_lane() with loop It is possible to generalize the "disable" value for the transmitters to be a bit mask based on the port width and the port reversal boolean, with a small exception for DP-alt mode with "x1" port width. Simplify the code by using such a mask and a for-loop instead of using switch-case statements. v2: - Use (i < 2) instead of (i / 2 == 0) for PHY lane mask selection. (Jani) BSpec: 64539 Cc: Jani Nikula Signed-off-by: Gustavo Sousa Reviewed-by: Mika Kahola Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230814131331.69516-3-gustavo.sousa@intel.com commit 3a8ecd4c3ede7283619536917e61c1aa3b9db6b7 Author: Gustavo Sousa Date: Mon Aug 14 10:13:28 2023 -0300 drm/i915/cx0: Add intel_cx0_get_owned_lane_mask() There are more parts of C10/C20 programming that need to take owned lanes into account. Define the function intel_cx0_get_owned_lane_mask() and use it. There will be new users of that function in upcoming changes. BSpec: 64539 Reviewed-by: Mika Kahola Signed-off-by: Gustavo Sousa Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230814131331.69516-2-gustavo.sousa@intel.com commit 2643e6d1f2a5e51877be24042d53cf956589be10 Author: Anshuman Gupta Date: Wed Aug 16 18:22:16 2023 +0530 drm/i915/dgfx: Enable d3cold at s2idle System wide suspend already has support for lmem save/restore during suspend therefore enabling d3cold for s2idle and keepng it disable for runtime PM.(Refer below commit for d3cold runtime PM disable justification) 'commit 66eb93e71a7a ("drm/i915/dgfx: Keep PCI autosuspend control 'on' by default on all dGPU")' It will reduce the DG2 Card power consumption to ~0 Watt for s2idle power KPI. v2: - Added "Cc: stable@vger.kernel.org". Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8755 Cc: stable@vger.kernel.org Cc: Rodrigo Vivi Signed-off-by: Anshuman Gupta Reviewed-by: Rodrigo Vivi Tested-by: Aaron Ma Tested-by: Jianshui Yu Link: https://patchwork.freedesktop.org/patch/msgid/20230816125216.1722002-1-anshuman.gupta@intel.com commit 2eb23c9409e07a27cedfbcb2a886e62228ac4355 Author: Jonathan Cavitt Date: Tue Aug 15 09:53:44 2023 -0700 drm/i915/selftests: Align igt_spinner_create_request with hangcheck Align igt_spinner_create_request with the hang_create_request implementation in selftest_hangcheck.c. Signed-off-by: Jonathan Cavitt Reviewed-by: Matt Roper Acked-by: Andi Shyti Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230815165345.964068-2-jonathan.cavitt@intel.com commit c0eeae21425ed8994f3ba5362c2f2faf5ed6d774 Author: Gustavo Sousa Date: Tue Aug 15 17:13:44 2023 -0300 drm/i915/display: Remove unused POWER_DOMAIN_MASK That macro became unused with commit 323286c81245 ("drm/i915: Move the power domain->well mappings to intel_display_power_map.c"). Signed-off-by: Gustavo Sousa Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230815201344.298573-1-gustavo.sousa@intel.com commit 25205087df1ffe06ccea9302944ed1f77dc68c6f Author: Diogo Ivo Date: Mon Aug 7 14:33:02 2023 +0100 drm/panel: Add driver for JDI LPM102A188A The JDI LPM102A188A is a 2560x1800 IPS panel found in the Google Pixel C. This driver is based on the downstream GPLv2 driver released by Google written by Sean Paul [1], which was then adapted to the newer kernel APIs. [1]: https://android.googlesource.com/kernel/tegra/+/refs/heads/android-tegra-dragon-3.18-oreo/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c Signed-off-by: Diogo Ivo Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230807133307.27456-3-diogo.ivo@tecnico.ulisboa.pt commit a913a739ab6e6ef10c0c47cb85dd4a105b3d9df7 Author: Diogo Ivo Date: Mon Aug 7 14:33:01 2023 +0100 dt-bindings: display: Add bindings for JDI LPM102A188A The LPM102A188A is a 10.2" 2560x1800 IPS panel found in the Google Pixel C. Signed-off-by: Diogo Ivo Reviewed-by: Krzysztof Kozlowski Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230807133307.27456-2-diogo.ivo@tecnico.ulisboa.pt commit d3b0466adfd991e39a0550920898bebff870b7d1 Author: Shekhar Chauhan Date: Mon Aug 14 20:32:15 2023 +0530 drm/i915/dg2: Remove Wa_15010599737 Since this Wa is specific to DirectX, this is not required on Linux. Signed-off-by: Shekhar Chauhan Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20230814150215.873941-1-shekhar.chauhan@intel.com commit 3b918f4f0c8b5344af4058f1a12e2023363d0097 Author: Alan Previn Date: Wed Aug 2 11:25:50 2023 -0700 drm/i915/pxp: Optimize GET_PARAM:PXP_STATUS After recent discussions with Mesa folks, it was requested that we optimize i915's GET_PARAM for the PXP_STATUS without changing the UAPI spec. Add these additional optimizations: - If any PXP initializatoin flow failed, then ensure that we catch it so that we can change the returned PXP_STATUS from "2" (i.e. 'PXP is supported but not yet ready') to "-ENODEV". This typically should not happen and if it does, we have a platform configuration issue. - If a PXP arbitration session creation event failed due to incorrect firmware version or blocking SOC fusing or blocking BIOS configuration (platform reasons that won't change if we retry), then reflect that blockage by also returning -ENODEV in the GET_PARAM:PXP_STATUS. - GET_PARAM:PXP_STATUS should not wait at all if PXP is supported but non-i915 dependencies (component-driver / firmware) we are still pending to complete the init flows. In this case, just return "2" immediately (i.e. 'PXP is supported but not yet ready'). Difference from prio revs: v3: - Rebase with latest tip that has pulled in setting the gsc fw load to fail if proxy init fails. v2: - Use a #define for the default readiness timeout (Vivaik). - Improve comments around the failing of proxy-init. v1: - Change the commit msg style to be imperative. (Jani) - Rename timeout to timeout_ms. (Jani) - Fix is_fw_err_platform_config to use higher order param (pxp) first. (Jani) Signed-off-by: Alan Previn Reviewed-by: Balasubrawmanian, Vivaik Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230802182550.1592926-1-alan.previn.teres.alexis@intel.com commit ac765b7018f6dfa9b6986e55d1f6fceb3f4c8011 Author: Alan Previn Date: Wed Aug 2 12:06:11 2023 -0700 drm/i915/pxp/mtl: intel_pxp_init_hw needs runtime-pm inside pm-complete In the case of failed suspend flow or cases where the kernel does not go into full suspend but goes from suspend_prepare back to resume_complete, we get called for a pm_complete but without runtime_pm guaranteed. Thus, ensure we take the runtime_pm when calling intel_pxp_init_hw from within intel_pxp_resume_complete. v2: resume_complete and runtime_resume should abstract a common helper with different wakeref requirements. (Daniele) Signed-off-by: Alan Previn Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20230802190611.1639371-1-alan.previn.teres.alexis@intel.com commit 90b8ad13536e80b1b4d9ed1c9d527e64ee757c26 Author: Alan Previn Date: Mon Aug 14 11:24:49 2023 -0700 drm/i915: Fix TLB-Invalidation seqno store When getting the next gt's seqno to be stored into an objects mm.tlb[gt_id] array, fix the retrieval code to get it from the correct gt instead of the same one. Fixes: d6c531ab4820 ("drm/i915: Invalidate the TLBs on each GT") Signed-off-by: Alan Previn Reviewed-by: Andi Shyti Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20230814182449.1060747-1-alan.previn.teres.alexis@intel.com commit f5d8f9c0d8b4bc8ad7e7b23a9f4d116e99202dd3 Author: David Heidelberg Date: Sat Aug 12 20:52:39 2023 +0200 drm/panel: JDI LT070ME05000 simplify with dev_err_probe() Use the dev_err_probe() helper to simplify error handling during probe. This also handle scenario, when EDEFER is returned and useless error is printed. Fixes error: panel-jdi-lt070me05000 4700000.dsi.0: cannot get enable-gpio -517 Signed-off-by: David Heidelberg Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230812185239.378582-1-david@ixit.cz commit d19859a042668277d79f8df0165ed75011f11e6d Author: David Heidelberg Date: Sat Aug 12 20:34:03 2023 +0200 drm/panel: JDI LT070ME05000 drop broken link Link is no longer functional and web.archive.org doesn't provide PDF with detail information. Some informations can be found from web.archive.org here: https://web.archive.org/web/20170629205602/http://panelone.net/en/7-0-inch/JDI_LT070ME05000_7.0_inch-datasheet Signed-off-by: David Heidelberg Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230812183404.374718-1-david@ixit.cz commit 637d3fdc109a63ed3d3864b9ffe1ae50ef57d03e Author: Thomas Weber Date: Mon Aug 7 14:31:38 2023 +0200 drm/panel: simple: Add support for Mitsubishi AA084XE01 Add support for the Mitsubishi AA084XE01 panel which is an 8.4 inch XGA TFT-LCD module for industrial use. Link: https://www.mouser.fr/datasheet/2/274/aa084xe01_e-364171.pdf Signed-off-by: Thomas Weber Signed-off-by: Miquel Raynal Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230807123138.67443-2-miquel.raynal@bootlin.com commit 50b0cd7d3ac3e6cbd8873434eafc3076957bbdf7 Author: Miquel Raynal Date: Mon Aug 7 14:31:37 2023 +0200 dt-bindings: display: simple: Add Mitsubishi AA084XE01 panel Add Mitsubishi AA084XE01 8.4" XGA TFT LCD panel compatible string. Link: https://www.mouser.fr/datasheet/2/274/aa084xe01_e-364171.pdf Signed-off-by: Miquel Raynal Acked-by: Krzysztof Kozlowski Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230807123138.67443-1-miquel.raynal@bootlin.com commit 199cf07ebd2b0d41185ac79b895547d45610b681 Author: Liu Ying Date: Mon Aug 7 14:11:15 2023 +0800 drm/bridge: panel: Add a device link between drm device and panel device Add the device link when panel bridge is attached and delete the link when panel bridge is detached. The drm device is the consumer while the panel device is the supplier. This makes sure that the drm device suspends eariler and resumes later than the panel device, hence resolves problems where the order is reversed, like the problematic case mentioned in the below link. Link: https://lore.kernel.org/lkml/CAPDyKFr0XjrU_udKoUKQ_q8RWaUkyqL+8fV-7s1CTMqi7u3-Rg@mail.gmail.com/T/ Suggested-by: Ulf Hansson Signed-off-by: Liu Ying Reviewed-by: Ulf Hansson Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20230807061115.3244501-1-victor.liu@nxp.com commit 95c23e2085f28e2c763ca202fdc37a1392982c16 Author: Arun R Murthy Date: Tue Aug 8 09:50:00 2023 +0530 drm/i915/dp: Fix LT debug print in SDP CRC enable The debug print for enabling SDP CRC16 is applicable only for DP2.0, but this debug print was not within the uhbr check and was always printed. Fix this by adding proper checks and returning. v2: Fix typo in commit message (Ankit) Signed-off-by: Arun R Murthy Reviewed-by: Chaitanya Kumar Borah Signed-off-by: Ankit Nautiyal Link: https://patchwork.freedesktop.org/patch/msgid/20230808042000.3210715-1-arun.r.murthy@intel.com commit 58554dbf0991da6a2847b3159594f6306bff978b Author: Suraj Kandpal Date: Fri Aug 4 14:07:37 2023 +0530 drm/i915/vdsc: Fix first_line_bpg_offset calculation On checking DSC1.1 Errata and DSC 1.2 spec the current formula we were using was incorrect to calculate first_line_bpg_offset. The new fixed formula is derived from C model. --v2 -Use clamp function in linux/minmax.h [Ankit] --v3 -remove linux/minmax.h header Signed-off-by: Suraj Kandpal Reviewed-by: Ankit Nautiyal Signed-off-by: Ankit Nautiyal Link: https://patchwork.freedesktop.org/patch/msgid/20230804083737.3844575-1-suraj.kandpal@intel.com commit 4d49d87b3606369c6e29b9d051892ee1a6fc4e75 Author: Jonas Karlman Date: Wed Jun 21 22:33:23 2023 +0000 drm/rockchip: vop2: Add missing call to crtc reset helper Add missing call to crtc reset helper to properly vblank reset. Also move vop2_crtc_reset and call vop2_crtc_destroy_state to simplify and remove duplicated code. Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver") Signed-off-by: Jonas Karlman Reviewed-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20230621223311.2239547-6-jonas@kwiboo.se commit 342f7e4967d02b0ec263b15916304fc54841b608 Author: Jonas Karlman Date: Wed Jun 21 22:33:21 2023 +0000 drm/rockchip: vop2: Don't crash for invalid duplicate_state It's possible for users to try to duplicate the CRTC state even when the state doesn't exist. drm_atomic_helper_crtc_duplicate_state() (and other users of __drm_atomic_helper_crtc_duplicate_state()) already guard this with a WARN_ON() instead of crashing, so let's do that here too. Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver") Signed-off-by: Jonas Karlman Reviewed-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20230621223311.2239547-5-jonas@kwiboo.se commit 5aacd290837828c089a83ac9795c74c4c9e2c923 Author: Jonas Karlman Date: Wed Jun 21 22:33:20 2023 +0000 drm/rockchip: vop: Fix call to crtc reset helper Allocation of crtc_state may fail in vop_crtc_reset, causing an invalid pointer to be passed to __drm_atomic_helper_crtc_reset. Fix this by adding a NULL check of crtc_state, similar to other drivers. Fixes: 01e2eaf40c9d ("drm/rockchip: Convert to using __drm_atomic_helper_crtc_reset() for reset.") Signed-off-by: Jonas Karlman Reviewed-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20230621223311.2239547-4-jonas@kwiboo.se commit 800f7c332df7cd9614c416fd005a6bb53f96f13c Author: Jonas Karlman Date: Wed Jun 21 22:33:18 2023 +0000 drm/rockchip: vop: Use cleanup helper directly as destroy funcs vop_plane_destroy and vop_crtc_destroy are plain wrappers around drm_plane_cleanup and drm_crtc_cleanup. Use them directly as plane and crtc funcs to closer match VOP2 driver. Signed-off-by: Jonas Karlman Reviewed-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20230621223311.2239547-3-jonas@kwiboo.se commit 13fc28804bf10ca0b7bce3efbba95c534836d7ca Author: Jonas Karlman Date: Wed Jun 21 22:33:17 2023 +0000 drm/rockchip: vop: Fix reset of state in duplicate state crtc funcs struct rockchip_crtc_state members such as output_type, output_bpc and enable_afbc is always reset to zero in the atomic_duplicate_state crtc funcs. Fix this by using kmemdup on the subclass rockchip_crtc_state struct. Fixes: 4e257d9eee23 ("drm/rockchip: get rid of rockchip_drm_crtc_mode_config") Signed-off-by: Jonas Karlman Reviewed-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20230621223311.2239547-2-jonas@kwiboo.se commit 5976a28b344ecb6810882a01b76a320cac21d307 Author: Harshit Mogalapalli Date: Thu Jul 20 05:39:50 2023 -0700 drm/loongson: Fix error handling in lsdc_pixel_pll_setup() There are two problems in lsdc_pixel_pll_setup() 1. If kzalloc() fails then call iounmap() to release the resources. 2. Both kzalloc and ioremap does not return error pointers on failure, so using IS_ERR_OR_NULL() checks is a bit confusing and not very right, fix this by changing those to NULL checks instead. Fixes: f39db26c5428 ("drm: Add kms driver for loongson display controller") Signed-off-by: Harshit Mogalapalli Reviewed-by: Sui Jingfeng Signed-off-by: Sui Jingfeng Link: https://patchwork.freedesktop.org/patch/msgid/20230720123950.543082-1-harshit.m.mogalapalli@oracle.com commit b31f784ffff96643fa6dec31b182a3466cf4139e Author: Alexander Stein Date: Thu Aug 10 08:32:29 2023 +0200 drm/bridge: lvds-codec: Implement atomic_get_input_bus_fmts for LVDS encoder atomic_get_input_bus_fmts is only implemented for LVDS decoders, resulting that LVDS encoders only support bus format MEDIA_BUS_FMT_FIXED. This results in warnings like: mxsfb 21c8000.lcdif: Bridge does not provide bus format, assuming MEDIA_BUS_FMT_RGB888_1X24. Please fix bridge driver by handling atomic_get_input_bus_fmts. Fix this by reusing lvds_codec_atomic_get_input_bus_fmts currently used for LVDS decoders. Use RGB888_1X24 for LVDS encoders. This also allows removing the dedicated struct drm_bridge_funcs for decoders. Signed-off-by: Alexander Stein Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230810063229.597533-1-alexander.stein@ew.tq-group.com commit 4bed08d99c681f1564e4a633b33d8a6d0446c706 Author: Imre Deak Date: Wed Aug 9 13:43:07 2023 +0300 drm/i915: Don't change the status of forced connectors during HPD poll detect As described in the previous patch a connector shouldn't change its status while it's forced to a connected/disconnected state. This can still happen while running the connector detect function to account for lost HPD events in a low-power state. Fix this by reusing the connector detect function which handles a hotplug event and prevents updating the status for forced connectors as expected. Testcase: igt@kms_force_connector_basic@force-connector-state Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20230809104307.1218058-3-imre.deak@intel.com commit b77d010d82eac31e161833b8e75d2983e3056171 Author: Imre Deak Date: Wed Aug 9 13:43:06 2023 +0300 drm/i915: Don't change the status of forced connectors during hotplug detect DRM display connectors forced to a connected/disconnected state via the drm_connector::force member shouldn't change their status. Atm, this can still happen in the connector's detect function when called to handle a hotplug event. This in turn may lead to the GETCONNECTOR ioctl to report the incorrect state if it's called to return the connector properties without doing an actual detection (by calling the ioctl with a non-zero drm_mode_get_connector::count_modes). Fix the above by updating the connector state during hotplug detect only if the connector state is not forced. Testcase: igt@kms_force_connector_basic@force-connector-state Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20230809104307.1218058-2-imre.deak@intel.com commit cc018c2626745d2e52273f941f9db222101aa11a Author: Imre Deak Date: Wed Aug 9 13:43:05 2023 +0300 drm/i915: Avoid endless HPD poll detect loop via runtime suspend/resume The issue fixed in commit a8ddac7c9f06 ("drm/i915: Avoid HPD poll detect triggering a new detect cycle") on VLV, CHV is still present on platforms where the display hotplug detection functionality is available whenever the device is in D0 state (hence these platforms switch to HPD polling only when the device is runtime suspended). The above commit avoids an endless i915_hpd_poll_init_work() -> connector detect loop by making sure that by the end of i915_hpd_poll_init_work() all display power references acquired by the connector detect functions which can trigger a new cycle (display core power domain) are dropped. However on platforms where HPD polling is enabled/disabled only from the runtime suspend/resume handlers, this is not ensured: for instance eDP VDD, TypeC port PHYs and the runtime autosuspend delay may still keep the device runtime resumed (via a power reference acquired during connector detection and hence result in an endless loop like the above). Solve the problem described in the above commit on all platforms, by making sure that a i915_hpd_poll_init_work() -> connector detect sequence can't take any power reference in the first place which would trigger a new cycle, instead of relying on these power references to be dropped by the end of the sequence. With the default runtime autosuspend delay (10 sec) this issue didn't happen in practice, since the device remained runtime resumed for the whole duration of the above sequence. CI/IGT tests however set the autosuspend delay to 0, which makes the problem visible, see References: below. Tested on GLK, CHV. v2: Don't warn about a requeued work, to account for disabling polling directly during driver loading, reset and system resume. References: https://gitlab.freedesktop.org/drm/intel/-/issues/7940#note_1997403 Signed-off-by: Imre Deak Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20230809104307.1218058-1-imre.deak@intel.com commit 15f389da11257b806da75a070cfa41ca0cc15aae Author: Marek Szyprowski Date: Wed Aug 9 16:56:41 2023 +0200 drm: bridge: samsung-dsim: Fix waiting for empty cmd transfer FIFO on older Exynos Samsung DSIM used in older Exynos SoCs (like Exynos 4210, 4x12, 3250) doesn't report empty level of packer header FIFO. In case of those SoCs, use the old way of waiting for empty command tranfsfer FIFO, removed recently by commit 14806c641582 ("drm: bridge: samsung-dsim: Drain command transfer FIFO before transfer"). Fixes: 14806c641582 ("drm: bridge: samsung-dsim: Drain command transfer FIFO before transfer") Signed-off-by: Marek Szyprowski Reviewed-by: Marek Vasut Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230809145641.3213210-1-m.szyprowski@samsung.com commit 96413b355a49fd684430a230479bd231d977894f Author: Randy Dunlap Date: Thu Aug 3 20:01:37 2023 -0700 drm: bridge: for GENERIC_PHY_MIPI_DPHY also select GENERIC_PHY Three DRM bridge drivers select GENERIC_PHY_MIPI_DPHY when GENERIC_PHY might not be set. This causes Kconfig warnings and a build error. WARNING: unmet direct dependencies detected for GENERIC_PHY_MIPI_DPHY Depends on [n]: GENERIC_PHY [=n] Selected by [y]: - DRM_NWL_MIPI_DSI [=y] && DRM_BRIDGE [=y] && DRM [=y] && COMMON_CLK [=y] && OF [=y] && HAS_IOMEM [=y] - DRM_SAMSUNG_DSIM [=y] && DRM [=y] && DRM_BRIDGE [=y] && COMMON_CLK [=y] && OF [=y] && HAS_IOMEM [=y] (drm/bridge/cadence/Kconfig was found by inspection.) aarch64-linux-ld: drivers/gpu/drm/bridge/samsung-dsim.o: in function `samsung_dsim_set_phy_ctrl': drivers/gpu/drm/bridge/samsung-dsim.c:731: undefined reference to `phy_mipi_dphy_get_default_config_for_hsclk' Prevent these warnings and build error by also selecting GENERIC_PHY whenever selecting GENERIC_PHY_MIPI_DPHY. Fixes: fced5a364dee ("drm/bridge: cdns: Convert to phy framework") Fixes: 44cfc6233447 ("drm/bridge: Add NWL MIPI DSI host controller support") Fixes: 171b3b1e0f8b ("drm: bridge: samsung-dsim: Select GENERIC_PHY_MIPI_DPHY") Signed-off-by: Randy Dunlap Reported-by: Aleksandr Nogikh Link: lore.kernel.org/r/20230803144227.2187749-1-nogikh@google.com Cc: Adam Ford Cc: Maxime Ripard Cc: Guido Günther Cc: Robert Chiras Cc: Sam Ravnborg Cc: Neil Armstrong Cc: Andrzej Hajda Cc: Robert Foss Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Reviewed-by: Adam Ford Tested-by: Aleksandr Nogikh Reviewed-by: Guido Günther Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230804030140.21395-1-rdunlap@infradead.org commit 192948f6a923bedf461b4aa09e70a25cfb8a6041 Author: Marek Vasut Date: Sun Jul 9 15:48:27 2023 +0200 drm: bridge: samsung-dsim: Initialize ULPS EXIT for i.MX8M DSIM The ULPS EXIT is initialized to 0xaf in downstream BSP as well as older revisions of this patchset, in newer revisions of the DSIM patchset it was left out and set to 0. Fix it. Fixes: 4d562c70c4dc ("drm: bridge: samsung-dsim: Add i.MX8M Mini/Nano support") Signed-off-by: Marek Vasut Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20230709134827.449185-1-marex@denx.de commit 78f46ecd9be8ec85a177c15d6188e1555657ba86 Author: Karolina Stolarek Date: Fri Aug 11 13:36:49 2023 +0200 drm/ttm/tests: Require MMU when testing Satisfy MMU dependency when testing TTM with KUnit. This fixes compilation errors on platforms that don't select this option by default. Signed-off-by: Karolina Stolarek Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202308110133.f0lhFwMV-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202308111032.enU8IisR-lkp@intel.com/ Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20230811113649.697886-1-karolina.stolarek@intel.com Signed-off-by: Christian König commit efcb492d77c42734aaf24aae02b4973323dc15d0 Author: Stanislaw Gruszka Date: Thu Aug 10 10:07:07 2023 +0200 accel/ivpu: Document DRM_IVPU_PARAM_CAPABILITIES Add comments regarding new DRM_IVPU_PARAM_CAPABILITIES param. Signed-off-by: Stanislaw Gruszka Reviewed-by: Jeffrey Hugo Link: https://patchwork.freedesktop.org/patch/msgid/20230810080707.3545883-1-stanislaw.gruszka@linux.intel.com commit 68132cc6d1bcbc78ade524c6c6c226de42139f0e Author: Dave Airlie Date: Fri Aug 11 04:50:20 2023 +1000 nouveau/u_memcpya: use vmemdup_user I think there are limit checks in place for most things but the new uAPI wants to not have them. Add a limit check and use the vmemdup_user helper instead. Signed-off-by: Dave Airlie Reviewed-by: Danilo Krummrich Signed-off-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20230810185020.231135-1-airlied@gmail.com commit 11fdb231f4127bf60839a63a8c7ed640ebe4751a Author: Jagan Teki Date: Mon Jul 31 16:30:06 2023 +0530 drm/rockchip: dsi: Add rv1126 MIPI DSI support RV1126 MIPI DSI supports V1.2 DPHY with 4 lanes and 1Gbps transfer rate for lane. Add support for it. Signed-off-by: Jagan Teki Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20230731110012.2913742-9-jagan@edgeble.ai commit 9610f9fdf9a01ddab0479a4d5959d93ce5a4b2d4 Author: Jagan Teki Date: Mon Jul 31 16:30:05 2023 +0530 dt-bindings: display: rockchip-dw-mipi-dsi: Document rv1126 DSI Document the MIPI DSI for Rockchip RV1126, which is different from other SoCs variants. Signed-off-by: Jagan Teki Acked-by: Conor Dooley Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20230731110012.2913742-8-jagan@edgeble.ai commit 3c3cfcb93f6e6e1cede0cdfe3ec24f16ee108929 Author: Jagan Teki Date: Mon Jul 31 16:30:04 2023 +0530 drm/rockchip: vop: Add rv1126 vop_lite support RV1126 VOP_LITE supports the video output processing ofMIPI DSI, RGB display interfaces with max output resolution of 1920x1080. Add support for rv1126 vop. Signed-off-by: Jagan Teki Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20230731110012.2913742-7-jagan@edgeble.ai commit aadbaac84fc95efa800e4c73ae86fefb8c86288b Author: Jagan Teki Date: Mon Jul 31 16:30:03 2023 +0530 dt-bindings: display: rockchip-vop: Document rv1126 vop The VOP on Rockchip's RV1126 SoC is different from other SoC's VOP implementations, so add a separate compatible for it. Signed-off-by: Jagan Teki Acked-by: Conor Dooley Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20230731110012.2913742-6-jagan@edgeble.ai commit efea5b0dcc433df6e7d74605d37813d69f99bef0 Author: GONG, Ruiqi Date: Mon Aug 7 17:39:04 2023 +0800 apparmor: remove unused PROF_* macros The last usage of PROF_{ADD,REPLACE} were removed by commit 18e99f191a8e ("apparmor: provide finer control over policy management"). So remove these two unused macros. Signed-off-by: GONG, Ruiqi Signed-off-by: John Johansen commit 980a5808686e29f4e2b3cd412a9e0c9ebaac2910 Author: Xiu Jianfeng Date: Tue Jul 25 14:12:59 2023 +0000 apparmor: cleanup unused functions in file.h After changes in commit 33bf60cabcc7 ("LSM: Infrastructure management of the file security"), aa_alloc_file_ctx() and aa_free_file_ctx() are no longer used, so remove them, and also remove aa_get_file_label() because it seems that it's never been used before. Signed-off-by: Xiu Jianfeng Signed-off-by: John Johansen commit 9a0dbdbff01818a4790f6768612e72c222add906 Author: Xiu Jianfeng Date: Tue Jul 25 14:12:39 2023 +0000 apparmor: cleanup unused declarations in policy.h The implementions of these declarations do not exist, remove them all. Signed-off-by: Xiu Jianfeng Signed-off-by: John Johansen commit d2fe16e94cc30c0af5327d5a673dd1761b9edfae Author: John Johansen Date: Tue Aug 8 13:12:19 2023 -0700 apparmor: fixup return comments for kernel doc cleanups by Gaosheng Cui [PATCH -next 05/11] apparmor: Fix kernel-doc warnings in apparmor/label.c missed updating the Returns comment for the new parameter names [PATCH -next 05/11] apparmor: Fix kernel-doc warnings in apparmor/label.c Added the @size parameter comment without mentioning it is a return value. Signed-off-by: John Johansen commit 510f276df2b91efd73f6c53be62b7e692ff533c1 Author: Benjamin Bara Date: Sat Jul 15 09:53:27 2023 +0200 mfd: tps6586x: Register restart handler There are a couple of boards which use a tps6586x as "ti,system-power-controller", e.g. the tegra20-tamonten.dtsi. For these, the only registered restart handler is the warm reboot via tegra's PMC. As the bootloader of the tegra20 requires the VDE, it must be ensured that VDE is enabled (which is the case after a cold reboot). For the "normal reboot", this is basically the case since 8f0c714ad9be. However, this workaround is not executed in case of an emergency restart. In case of an emergency restart, the system now simply hangs in the bootloader, as VDE is not enabled (because it is not used). The TPS658629-Q1 provides a SOFT RST bit in the SUPPLYENE reg to request a (cold) reboot, which takes at least 20ms (as the data sheet states). This avoids the hang-up. Tested on a TPS658640. Reviewed-by: Dmitry Osipenko Signed-off-by: Benjamin Bara Link: https://lore.kernel.org/r/20230327-tegra-pmic-reboot-v7-5-18699d5dcd76@skidata.com Signed-off-by: Lee Jones commit 8bd141b17cedcbcb7d336df6e0462e4f4a528ab1 Author: Benjamin Bara Date: Sat Jul 15 09:53:26 2023 +0200 mfd: tps6586x: Use devm-based power off handler Convert the power off handler to a devm-based power off handler. Reviewed-by: Dmitry Osipenko Signed-off-by: Benjamin Bara Link: https://lore.kernel.org/r/20230327-tegra-pmic-reboot-v7-4-18699d5dcd76@skidata.com Signed-off-by: Lee Jones commit db2d6038c5e795cab4f0a8d3e86b4f7e33338629 Author: Benjamin Bara Date: Sat Jul 15 09:53:25 2023 +0200 kernel/reboot: Add device to sys_off_handler If the dev is known (e.g. a devm-based sys_off_handler is used), it can be passed to the handler's callback to have it available there. Otherwise, cb_data might be set to the dev in most of the cases. Reviewed-by: Dmitry Osipenko Signed-off-by: Benjamin Bara Link: https://lore.kernel.org/r/20230327-tegra-pmic-reboot-v7-3-18699d5dcd76@skidata.com Signed-off-by: Lee Jones commit aa49c90894d06e18a1ee7c095edbd2f37c232d02 Author: Benjamin Bara Date: Sat Jul 15 09:53:24 2023 +0200 i2c: core: Run atomic i2c xfer when !preemptible Since bae1d3a05a8b, i2c transfers are non-atomic if preemption is disabled. However, non-atomic i2c transfers require preemption (e.g. in wait_for_completion() while waiting for the DMA). panic() calls preempt_disable_notrace() before calling emergency_restart(). Therefore, if an i2c device is used for the restart, the xfer should be atomic. This avoids warnings like: [ 12.667612] WARNING: CPU: 1 PID: 1 at kernel/rcu/tree_plugin.h:318 rcu_note_context_switch+0x33c/0x6b0 [ 12.676926] Voluntary context switch within RCU read-side critical section! ... [ 12.742376] schedule_timeout from wait_for_completion_timeout+0x90/0x114 [ 12.749179] wait_for_completion_timeout from tegra_i2c_wait_completion+0x40/0x70 ... [ 12.994527] atomic_notifier_call_chain from machine_restart+0x34/0x58 [ 13.001050] machine_restart from panic+0x2a8/0x32c Use !preemptible() instead, which is basically the same check as pre-v5.2. Fixes: bae1d3a05a8b ("i2c: core: remove use of in_atomic()") Cc: stable@vger.kernel.org # v5.2+ Suggested-by: Dmitry Osipenko Acked-by: Wolfram Sang Reviewed-by: Dmitry Osipenko Tested-by: Nishanth Menon Signed-off-by: Benjamin Bara Link: https://lore.kernel.org/r/20230327-tegra-pmic-reboot-v7-2-18699d5dcd76@skidata.com Signed-off-by: Lee Jones commit 60466c067927abbcaff299845abd4b7069963139 Author: Benjamin Bara Date: Sat Jul 15 09:53:23 2023 +0200 kernel/reboot: emergency_restart: Set correct system_state As the emergency restart does not call kernel_restart_prepare(), the system_state stays in SYSTEM_RUNNING. Since bae1d3a05a8b, this hinders i2c_in_atomic_xfer_mode() from becoming active, and therefore might lead to avoidable warnings in the restart handlers, e.g.: [ 12.667612] WARNING: CPU: 1 PID: 1 at kernel/rcu/tree_plugin.h:318 rcu_note_context_switch+0x33c/0x6b0 [ 12.676926] Voluntary context switch within RCU read-side critical section! ... [ 12.742376] schedule_timeout from wait_for_completion_timeout+0x90/0x114 [ 12.749179] wait_for_completion_timeout from tegra_i2c_wait_completion+0x40/0x70 ... [ 12.994527] atomic_notifier_call_chain from machine_restart+0x34/0x58 [ 13.001050] machine_restart from panic+0x2a8/0x32c Avoid these by setting the correct system_state. Fixes: bae1d3a05a8b ("i2c: core: remove use of in_atomic()") Cc: stable@vger.kernel.org # v5.2+ Reviewed-by: Dmitry Osipenko Tested-by: Nishanth Menon Signed-off-by: Benjamin Bara Link: https://lore.kernel.org/r/20230327-tegra-pmic-reboot-v7-1-18699d5dcd76@skidata.com Signed-off-by: Lee Jones commit 25ff0ff2d6286928dc516c74b879809c691c2dd8 Author: Gaosheng Cui Date: Sun Jun 25 09:13:49 2023 +0800 apparmor: Fix kernel-doc warnings in apparmor/policy.c Fix kernel-doc warnings: security/apparmor/policy.c:294: warning: Function parameter or member 'proxy' not described in 'aa_alloc_profile' security/apparmor/policy.c:785: warning: Function parameter or member 'label' not described in 'aa_policy_view_capable' security/apparmor/policy.c:785: warning: Function parameter or member 'ns' not described in 'aa_policy_view_capable' security/apparmor/policy.c:847: warning: Function parameter or member 'ns' not described in 'aa_may_manage_policy' security/apparmor/policy.c:964: warning: Function parameter or member 'hname' not described in '__lookup_replace' security/apparmor/policy.c:964: warning: Function parameter or member 'info' not described in '__lookup_replace' security/apparmor/policy.c:964: warning: Function parameter or member 'noreplace' not described in '__lookup_replace' security/apparmor/policy.c:964: warning: Function parameter or member 'ns' not described in '__lookup_replace' security/apparmor/policy.c:964: warning: Function parameter or member 'p' not described in '__lookup_replace' Signed-off-by: Gaosheng Cui Signed-off-by: John Johansen commit 2520d61c500b26a4adc0af430c0316e99e1000b9 Author: Gaosheng Cui Date: Sun Jun 25 09:13:48 2023 +0800 apparmor: Fix kernel-doc warnings in apparmor/policy_compat.c Fix kernel-doc warnings: security/apparmor/policy_compat.c:151: warning: Function parameter or member 'size' not described in 'compute_fperms' Signed-off-by: Gaosheng Cui Signed-off-by: John Johansen commit f8fce898e5571846aa1e74385f18691ccfa3ed28 Author: Gaosheng Cui Date: Sun Jun 25 09:13:47 2023 +0800 apparmor: Fix kernel-doc warnings in apparmor/policy_unpack.c Fix kernel-doc warnings: security/apparmor/policy_unpack.c:1173: warning: Function parameter or member 'table_size' not described in 'verify_dfa_accept_index' Signed-off-by: Gaosheng Cui Signed-off-by: John Johansen commit 13c1748e217078d437727eef333cb0387d13bc0e Author: Gaosheng Cui Date: Sun Jun 25 09:13:46 2023 +0800 apparmor: Fix kernel-doc warnings in apparmor/resource.c Fix kernel-doc warnings: security/apparmor/resource.c:111: warning: Function parameter or member 'label' not described in 'aa_task_setrlimit' security/apparmor/resource.c:111: warning: Function parameter or member 'new_rlim' not described in 'aa_task_setrlimit' security/apparmor/resource.c:111: warning: Function parameter or member 'resource' not described in 'aa_task_setrlimit' security/apparmor/resource.c:111: warning: Function parameter or member 'task' not described in 'aa_task_setrlimit' Signed-off-by: Gaosheng Cui Signed-off-by: John Johansen commit 7abbbd573cbd27158137a7c36cdf2f7fe1051644 Author: Gaosheng Cui Date: Sun Jun 25 09:13:45 2023 +0800 apparmor: Fix kernel-doc warnings in apparmor/match.c Fix kernel-doc warnings: security/apparmor/match.c:148: warning: Function parameter or member 'tables' not described in 'verify_table_headers' security/apparmor/match.c:289: warning: Excess function parameter 'kr' description in 'aa_dfa_free_kref' security/apparmor/match.c:289: warning: Function parameter or member 'kref' not described in 'aa_dfa_free_kref' Signed-off-by: Gaosheng Cui Signed-off-by: John Johansen commit 8921482286116af193980f04f2f2755775a410a5 Author: Gaosheng Cui Date: Sun Jun 25 09:13:44 2023 +0800 apparmor: Fix kernel-doc warnings in apparmor/lib.c Fix kernel-doc warnings: security/apparmor/lib.c:33: warning: Excess function parameter 'str' description in 'aa_free_str_table' security/apparmor/lib.c:33: warning: Function parameter or member 't' not described in 'aa_free_str_table' security/apparmor/lib.c:94: warning: Function parameter or member 'n' not described in 'skipn_spaces' security/apparmor/lib.c:390: warning: Excess function parameter 'deny' description in 'aa_check_perms' Signed-off-by: Gaosheng Cui Signed-off-by: John Johansen commit e18573dd2bacead6faa8aa09df8536e7c1b86e57 Author: Gaosheng Cui Date: Sun Jun 25 09:13:43 2023 +0800 apparmor: Fix kernel-doc warnings in apparmor/label.c Fix kernel-doc warnings: security/apparmor/label.c:166: warning: Excess function parameter 'n' description in 'vec_cmp' security/apparmor/label.c:166: warning: Excess function parameter 'vec' description in 'vec_cmp' security/apparmor/label.c:166: warning: Function parameter or member 'an' not described in 'vec_cmp' security/apparmor/label.c:166: warning: Function parameter or member 'bn' not described in 'vec_cmp' security/apparmor/label.c:166: warning: Function parameter or member 'b' not described in 'vec_cmp' security/apparmor/label.c:2051: warning: Function parameter or member 'label' not described in '__label_update' security/apparmor/label.c:266: warning: Function parameter or member 'flags' not described in 'aa_vec_unique' security/apparmor/label.c:594: warning: Excess function parameter 'l' description in '__label_remove' security/apparmor/label.c:594: warning: Function parameter or member 'label' not described in '__label_remove' security/apparmor/label.c:929: warning: Function parameter or member 'label' not described in 'aa_label_insert' security/apparmor/label.c:929: warning: Function parameter or member 'ls' not described in 'aa_label_insert' security/apparmor/label.c:1221: warning: Excess function parameter 'ls' description in 'aa_label_merge' security/apparmor/label.c:1302: warning: Excess function parameter 'start' description in 'label_compound_match' security/apparmor/label.c:1302: warning: Function parameter or member 'rules' not described in 'label_compound_match' security/apparmor/label.c:1302: warning: Function parameter or member 'state' not described in 'label_compound_match' security/apparmor/label.c:2051: warning: Function parameter or member 'label' not described in '__label_update' Signed-off-by: Gaosheng Cui Signed-off-by: John Johansen commit 3175df8032d9486c6d6875256144aa027d905d3f Author: Gaosheng Cui Date: Sun Jun 25 09:13:42 2023 +0800 apparmor: Fix kernel-doc warnings in apparmor/file.c Fix kernel-doc warnings: security/apparmor/file.c:177: warning: Excess function parameter 'dfa' description in 'aa_lookup_fperms' security/apparmor/file.c:177: warning: Function parameter or member 'file_rules' not described in 'aa_lookup_fperms' security/apparmor/file.c:202: warning: Excess function parameter 'dfa' description in 'aa_str_perms' security/apparmor/file.c:202: warning: Excess function parameter 'state' description in 'aa_str_perms' security/apparmor/file.c:202: warning: Function parameter or member 'file_rules' not described in 'aa_str_perms' security/apparmor/file.c:202: warning: Function parameter or member 'start' not described in 'aa_str_perms' Signed-off-by: Gaosheng Cui Signed-off-by: John Johansen commit 76426c9d92fdbd3dd88b1c3553bc4a4d98e6d184 Author: Gaosheng Cui Date: Sun Jun 25 09:13:41 2023 +0800 apparmor: Fix kernel-doc warnings in apparmor/domain.c Fix kernel-doc warnings: security/apparmor/domain.c:279: warning: Function parameter or member 'perms' not described in 'change_profile_perms' security/apparmor/domain.c:380: warning: Function parameter or member 'bprm' not described in 'find_attach' security/apparmor/domain.c:380: warning: Function parameter or member 'head' not described in 'find_attach' security/apparmor/domain.c:380: warning: Function parameter or member 'info' not described in 'find_attach' security/apparmor/domain.c:380: warning: Function parameter or member 'name' not described in 'find_attach' security/apparmor/domain.c:558: warning: Function parameter or member 'info' not described in 'x_to_label' Signed-off-by: Gaosheng Cui Signed-off-by: John Johansen commit c98c8972feb3bdf2e197e63403305176217c78a7 Author: Gaosheng Cui Date: Sun Jun 25 09:13:40 2023 +0800 apparmor: Fix kernel-doc warnings in apparmor/capability.c Fix kernel-doc warnings: security/apparmor/capability.c:45: warning: Function parameter or member 'ab' not described in 'audit_cb' security/apparmor/capability.c:45: warning: Function parameter or member 'va' not described in 'audit_cb' Signed-off-by: Gaosheng Cui Signed-off-by: John Johansen commit 26c9ecb34f5f5fa43c041a220de01d7cbea97dd0 Author: Gaosheng Cui Date: Sun Jun 25 09:13:39 2023 +0800 apparmor: Fix kernel-doc warnings in apparmor/audit.c Fix kernel-doc warnings: security/apparmor/audit.c:150: warning: Function parameter or member 'type' not described in 'aa_audit_msg' Signed-off-by: Gaosheng Cui Signed-off-by: John Johansen commit afad53575a938ceb557227ecfeb0dda59d668d4e Author: Dan Carpenter Date: Wed Jun 14 16:02:04 2023 +0300 apparmor: use passed in gfp flags in aa_alloc_null() These allocations should use the gfp flags from the caller instead of GFP_KERNEL. But from what I can see, all the callers pass in GFP_KERNEL so this does not affect runtime. Fixes: e31dd6e412f7 ("apparmor: fix: kzalloc perms tables for shared dfas") Signed-off-by: Dan Carpenter Signed-off-by: John Johansen commit 180cf257998c5f136f76b8899ef6ec57b410680b Author: John Johansen Date: Thu Mar 16 16:04:17 2023 -0700 apparmor: advertise availability of exended perms Userspace won't load policy using extended perms unless it knows the kernel can handle them. Advertise that extended perms are supported in the feature set. Signed-off-by: John Johansen Reviewed-by: Jon Tourville commit 8de4a7de1950e88c233b105faf24666db348e65a Author: GONG, Ruiqi Date: Wed May 31 19:18:33 2023 +0800 apparmor: remove unused macro SOCK_ctx() doesn't seem to be used anywhere in the code, so remove it. Signed-off-by: GONG, Ruiqi Signed-off-by: John Johansen commit 0897fcb1c1e7316375166e0a665237bce2391a09 Author: Quanfa Fu Date: Sun Jan 15 00:49:52 2023 +0800 apparmor: make aa_set_current_onexec return void Change the return type to void since it always return 0, and no need to do the checking in aa_set_current_onexec. Signed-off-by: Quanfa Fu Reviewed-by: "Tyler Hicks (Microsoft)" Signed-off-by: John Johansen